From: support Date: Thu, 26 Jan 2023 17:22:44 +0000 (+0000) Subject: Built motion from commit 64440dd5.|2.6.29 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=47a14a74ba31482f7919119b020320bbe56091ca;p=motion2.git Built motion from commit 64440dd5.|2.6.29 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index aa3c957..a579fd7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-26T16:48:48.052Z", + "time": "2023-01-26T17:14:10.723Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 18075bb..66a40da 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-26T16:48:48.052Z", + "time": "2023-01-26T17:14:10.723Z", "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 eb5a342..6f08088 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 _0x33d0=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x11c376,_0x54aac3){var _0x349144=function(_0x5728b3){while(--_0x5728b3){_0x11c376['push'](_0x11c376['shift']());}};_0x349144(++_0x54aac3);}(_0x33d0,0x144));var _0x033d=function(_0x3fc219,_0x3f8f1b){_0x3fc219=_0x3fc219-0x0;var _0x8e0b1a=_0x33d0[_0x3fc219];return _0x8e0b1a;};'use strict';var Sequelize=require(_0x033d('0x0'));module[_0x033d('0x1')]={'name':{'type':Sequelize[_0x033d('0x2')],'get':function(_0x5b8fec){return this[_0x033d('0x3')]('action');}},'action':{'type':Sequelize[_0x033d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x033d('0x5'),_0x033d('0x6'),'motionbar',_0x033d('0x7'),'urlForward',_0x033d('0x8'),_0x033d('0x9'),_0x033d('0xa')]],'msg':_0x033d('0xb')}},'comment':_0x033d('0xb')},'data1':{'type':Sequelize[_0x033d('0x4')](0x1000),'comment':_0x033d('0xc')},'data2':{'type':Sequelize[_0x033d('0x4')](0x1000),'comment':_0x033d('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x033d('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x033d('0x4')],'comments':_0x033d('0xe')},'data7':{'type':Sequelize[_0x033d('0xf')],'comments':_0x033d('0x10')}}; \ No newline at end of file +var _0xb70c=['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]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb70c,0x1e0));var _0xcb70=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb70c[_0x454018];return _0x24697d;};'use strict';var Sequelize=require(_0xcb70('0x0'));module[_0xcb70('0x1')]={'name':{'type':Sequelize[_0xcb70('0x2')],'get':function(_0xebe80a){return this['getDataValue'](_0xcb70('0x3'));}},'action':{'type':Sequelize[_0xcb70('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xcb70('0x5'),_0xcb70('0x6'),_0xcb70('0x7'),_0xcb70('0x8'),_0xcb70('0x9'),_0xcb70('0xa'),_0xcb70('0xb'),_0xcb70('0xc')]],'msg':_0xcb70('0xd')}},'comment':_0xcb70('0xd')},'data1':{'type':Sequelize[_0xcb70('0x4')](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[_0xcb70('0x4')](0x1000),'comment':_0xcb70('0xe')},'data3':{'type':Sequelize[_0xcb70('0x4')](0x1000),'comment':_0xcb70('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xcb70('0x4')](0x1000),'comments':_0xcb70('0x10')},'data6':{'type':Sequelize[_0xcb70('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xcb70('0x11')],'comments':_0xcb70('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 9ed8a22..66d2cb8 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 _0x1cba=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','body','Action','find','params','catch','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x58a0ef,_0x303c03){var _0x7c6277=function(_0x1e99c9){while(--_0x1e99c9){_0x58a0ef['push'](_0x58a0ef['shift']());}};_0x7c6277(++_0x303c03);}(_0x1cba,0xf2));var _0xa1cb=function(_0x51f5c5,_0xcc986a){_0x51f5c5=_0x51f5c5-0x0;var _0x5d5363=_0x1cba[_0x51f5c5];return _0x5d5363;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1cb('0x0'));var zipdir=require(_0xa1cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1cb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1cb('0x3'));var path=require(_0xa1cb('0x4'));var sox=require(_0xa1cb('0x5'));var csv=require(_0xa1cb('0x6'));var ejs=require(_0xa1cb('0x7'));var fs=require('fs');var fs_extra=require(_0xa1cb('0x8'));var _=require(_0xa1cb('0x9'));var squel=require('squel');var crypto=require(_0xa1cb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa1cb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa1cb('0xc'));var Papa=require(_0xa1cb('0xd'));var Redis=require(_0xa1cb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa1cb('0xf'));var as=require(_0xa1cb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1cb('0x11'))(_0xa1cb('0x12'));var utils=require(_0xa1cb('0x13'));var config=require(_0xa1cb('0x14'));var licenseUtil=require(_0xa1cb('0x15'));var db=require(_0xa1cb('0x16'))['db'];function respondWithStatusCode(_0x158846,_0x2f58cf){_0x2f58cf=_0x2f58cf||0xcc;return function(_0x4240a8){if(_0x4240a8){return _0x158846[_0xa1cb('0x17')](_0x2f58cf);}return _0x158846['status'](_0x2f58cf)['end']();};}function respondWithResult(_0x18bd63,_0x13b791){_0x13b791=_0x13b791||0xc8;return function(_0x3e09f2){if(_0x3e09f2){return _0x18bd63[_0xa1cb('0x18')](_0x13b791)['json'](_0x3e09f2);}};}function respondWithFilteredResult(_0xb9859b,_0x435ad4){return function(_0x15409e){if(_0x15409e){var _0x2f1df0=typeof _0x435ad4[_0xa1cb('0x19')]===_0xa1cb('0x1a')&&typeof _0x435ad4[_0xa1cb('0x1b')]==='undefined';var _0x1d9f28=_0x15409e['count'];var _0x369e28=_0x2f1df0?0x0:_0x435ad4[_0xa1cb('0x19')];var _0x5a55fe=_0x2f1df0?_0x15409e[_0xa1cb('0x1c')]:_0x435ad4['offset']+_0x435ad4['limit'];var _0x5eaf9e;if(_0x5a55fe>=_0x1d9f28){_0x5a55fe=_0x1d9f28;_0x5eaf9e=0xc8;}else{_0x5eaf9e=0xce;}_0xb9859b[_0xa1cb('0x18')](_0x5eaf9e);return _0xb9859b[_0xa1cb('0x1d')](_0xa1cb('0x1e'),_0x369e28+'-'+_0x5a55fe+'/'+_0x1d9f28)[_0xa1cb('0x1f')](_0x15409e);}return null;};}function patchUpdates(_0x3c5f02){return function(_0xc253c){try{jsonpatch[_0xa1cb('0x20')](_0xc253c,_0x3c5f02,!![]);}catch(_0x286387){return BPromise[_0xa1cb('0x21')](_0x286387);}return _0xc253c['save']();};}function saveUpdates(_0x294872,_0x24b720){return function(_0x4072f4){if(_0x4072f4){return _0x4072f4[_0xa1cb('0x22')](_0x294872)[_0xa1cb('0x23')](function(_0x1af94e){return _0x1af94e;});}return null;};}function removeEntity(_0xea6dfd,_0x58ca59){return function(_0x48af9e){if(_0x48af9e){return _0x48af9e[_0xa1cb('0x24')]()[_0xa1cb('0x23')](function(){_0xea6dfd[_0xa1cb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d0f3,_0x10bf20){return function(_0x159fc3){if(!_0x159fc3){_0x37d0f3[_0xa1cb('0x17')](0x194);}return _0x159fc3;};}function handleError(_0x311ca8,_0x3a9382){_0x3a9382=_0x3a9382||0x1f4;return function(_0x57d185){logger[_0xa1cb('0x25')](_0x57d185['stack']);if(_0x57d185[_0xa1cb('0x26')]){delete _0x57d185[_0xa1cb('0x26')];}_0x311ca8['status'](_0x3a9382)['send'](_0x57d185);};}exports[_0xa1cb('0x22')]=function(_0x3caf03,_0x5b512c){if(_0x3caf03['body']['id']){delete _0x3caf03[_0xa1cb('0x27')]['id'];}return db[_0xa1cb('0x28')][_0xa1cb('0x29')]({'where':{'id':_0x3caf03[_0xa1cb('0x2a')]['id']}})[_0xa1cb('0x23')](handleEntityNotFound(_0x5b512c,null))[_0xa1cb('0x23')](saveUpdates(_0x3caf03[_0xa1cb('0x27')],null))['then'](respondWithResult(_0x5b512c,null))[_0xa1cb('0x2b')](handleError(_0x5b512c,null));};exports['destroy']=function(_0x41a132,_0x1431e0){return db[_0xa1cb('0x28')][_0xa1cb('0x29')]({'where':{'id':_0x41a132[_0xa1cb('0x2a')]['id']}})[_0xa1cb('0x23')](handleEntityNotFound(_0x1431e0,null))[_0xa1cb('0x23')](removeEntity(_0x1431e0,null))['catch'](handleError(_0x1431e0,null));}; \ No newline at end of file +var _0x64a0=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','body','Action','find','params','then','catch','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x71b177,_0x248a33){var _0x4c7363=function(_0x40fd6c){while(--_0x40fd6c){_0x71b177['push'](_0x71b177['shift']());}};_0x4c7363(++_0x248a33);}(_0x64a0,0xe3));var _0x064a=function(_0xa339a9,_0x342371){_0xa339a9=_0xa339a9-0x0;var _0x125a36=_0x64a0[_0xa339a9];return _0x125a36;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x064a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x064a('0x1'));var BPromise=require(_0x064a('0x2'));var Mustache=require(_0x064a('0x3'));var util=require(_0x064a('0x4'));var path=require(_0x064a('0x5'));var sox=require(_0x064a('0x6'));var csv=require(_0x064a('0x7'));var ejs=require(_0x064a('0x8'));var fs=require('fs');var fs_extra=require(_0x064a('0x9'));var _=require(_0x064a('0xa'));var squel=require(_0x064a('0xb'));var crypto=require(_0x064a('0xc'));var jsforce=require(_0x064a('0xd'));var deskjs=require(_0x064a('0xe'));var toCsv=require(_0x064a('0x7'));var querystring=require(_0x064a('0xf'));var Papa=require('papaparse');var Redis=require(_0x064a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x064a('0x11'));var as=require(_0x064a('0x12'));var hardwareService=require(_0x064a('0x13'));var logger=require(_0x064a('0x14'))(_0x064a('0x15'));var utils=require(_0x064a('0x16'));var config=require(_0x064a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x064a('0x18'))['db'];function respondWithStatusCode(_0x54c308,_0x58298b){_0x58298b=_0x58298b||0xcc;return function(_0xb14288){if(_0xb14288){return _0x54c308[_0x064a('0x19')](_0x58298b);}return _0x54c308[_0x064a('0x1a')](_0x58298b)['end']();};}function respondWithResult(_0x1004b0,_0x15e95c){_0x15e95c=_0x15e95c||0xc8;return function(_0x162b60){if(_0x162b60){return _0x1004b0['status'](_0x15e95c)[_0x064a('0x1b')](_0x162b60);}};}function respondWithFilteredResult(_0x96f403,_0x195c7f){return function(_0x402753){if(_0x402753){var _0x2d37cf=typeof _0x195c7f[_0x064a('0x1c')]==='undefined'&&typeof _0x195c7f[_0x064a('0x1d')]===_0x064a('0x1e');var _0x5b2059=_0x402753[_0x064a('0x1f')];var _0x561b59=_0x2d37cf?0x0:_0x195c7f['offset'];var _0xd569b3=_0x2d37cf?_0x402753[_0x064a('0x1f')]:_0x195c7f[_0x064a('0x1c')]+_0x195c7f['limit'];var _0x1814a7;if(_0xd569b3>=_0x5b2059){_0xd569b3=_0x5b2059;_0x1814a7=0xc8;}else{_0x1814a7=0xce;}_0x96f403[_0x064a('0x1a')](_0x1814a7);return _0x96f403['set'](_0x064a('0x20'),_0x561b59+'-'+_0xd569b3+'/'+_0x5b2059)[_0x064a('0x1b')](_0x402753);}return null;};}function patchUpdates(_0x1c289b){return function(_0x25989f){try{jsonpatch[_0x064a('0x21')](_0x25989f,_0x1c289b,!![]);}catch(_0x2d76b5){return BPromise[_0x064a('0x22')](_0x2d76b5);}return _0x25989f[_0x064a('0x23')]();};}function saveUpdates(_0x1ec55c,_0x55dffb){return function(_0x309778){if(_0x309778){return _0x309778[_0x064a('0x24')](_0x1ec55c)['then'](function(_0x1ba57b){return _0x1ba57b;});}return null;};}function removeEntity(_0x33ace4,_0x429d96){return function(_0x47a84c){if(_0x47a84c){return _0x47a84c[_0x064a('0x25')]()['then'](function(){_0x33ace4[_0x064a('0x1a')](0xcc)[_0x064a('0x26')]();});}};}function handleEntityNotFound(_0x13c172,_0x4054d2){return function(_0x23207c){if(!_0x23207c){_0x13c172[_0x064a('0x19')](0x194);}return _0x23207c;};}function handleError(_0x3079d9,_0x364500){_0x364500=_0x364500||0x1f4;return function(_0x2ed3d6){logger[_0x064a('0x27')](_0x2ed3d6[_0x064a('0x28')]);if(_0x2ed3d6['name']){delete _0x2ed3d6[_0x064a('0x29')];}_0x3079d9[_0x064a('0x1a')](_0x364500)['send'](_0x2ed3d6);};}exports[_0x064a('0x24')]=function(_0x18cc92,_0xc5dfe){if(_0x18cc92[_0x064a('0x2a')]['id']){delete _0x18cc92[_0x064a('0x2a')]['id'];}return db[_0x064a('0x2b')][_0x064a('0x2c')]({'where':{'id':_0x18cc92[_0x064a('0x2d')]['id']}})[_0x064a('0x2e')](handleEntityNotFound(_0xc5dfe,null))['then'](saveUpdates(_0x18cc92[_0x064a('0x2a')],null))['then'](respondWithResult(_0xc5dfe,null))[_0x064a('0x2f')](handleError(_0xc5dfe,null));};exports[_0x064a('0x25')]=function(_0x183173,_0x5dbb2c){return db[_0x064a('0x2b')][_0x064a('0x2c')]({'where':{'id':_0x183173[_0x064a('0x2d')]['id']}})[_0x064a('0x2e')](handleEntityNotFound(_0x5dbb2c,null))[_0x064a('0x2e')](removeEntity(_0x5dbb2c,null))[_0x064a('0x2f')](handleError(_0x5dbb2c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ac63302..0300f28 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 _0x0590=['moment','request-promise','rimraf','../../config/environment','exports','define','tools_actions','../../config/logger','api'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0590,0x166));var _0x0059=function(_0x3fc166,_0x193ed0){_0x3fc166=_0x3fc166-0x0;var _0x390298=_0x0590[_0x3fc166];return _0x390298;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0059('0x0'))(_0x0059('0x1'));var moment=require(_0x0059('0x2'));var BPromise=require('bluebird');var rp=require(_0x0059('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0059('0x4'));var config=require(_0x0059('0x5'));var attributes=require('./action.attributes');module[_0x0059('0x6')]=function(_0xb88d6f,_0x489111){return _0xb88d6f[_0x0059('0x7')]('Action',attributes,{'tableName':_0x0059('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f91=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x9f91,0x1e0));var _0x19f9=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x9f91[_0x2bda14];return _0xb5dd49;};'use strict';var _=require(_0x19f9('0x0'));var util=require(_0x19f9('0x1'));var logger=require(_0x19f9('0x2'))(_0x19f9('0x3'));var moment=require(_0x19f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x19f9('0x5'));var fs=require('fs');var path=require(_0x19f9('0x6'));var rimraf=require('rimraf');var config=require(_0x19f9('0x7'));var attributes=require(_0x19f9('0x8'));module[_0x19f9('0x9')]=function(_0x3ebea0,_0x17a8a6){return _0x3ebea0[_0x19f9('0xa')](_0x19f9('0xb'),attributes,{'tableName':_0x19f9('0xc'),'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 4d9b99c..d8bac57 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x15b366,_0x489145){var _0x21b944=function(_0x51b3d1){while(--_0x51b3d1){_0x15b366['push'](_0x15b366['shift']());}};_0x21b944(++_0x489145);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1cb9,0x14e));var _0x91cb=function(_0x297138,_0x2c347e){_0x297138=_0x297138-0x0;var _0x25cf6d=_0x1cb9[_0x297138];return _0x25cf6d;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c5294b0..16647f7 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 _0xde25=['Router','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3ae42b,_0x5bd465){var _0x236ab3=function(_0x30b01e){while(--_0x30b01e){_0x3ae42b['push'](_0x3ae42b['shift']());}};_0x236ab3(++_0x5bd465);}(_0xde25,0x133));var _0x5de2=function(_0x34837c,_0x52e77c){_0x34837c=_0x34837c-0x0;var _0x55eabb=_0xde25[_0x34837c];return _0x55eabb;};'use strict';var multer=require(_0x5de2('0x0'));var util=require(_0x5de2('0x1'));var path=require(_0x5de2('0x2'));var timeout=require(_0x5de2('0x3'));var express=require(_0x5de2('0x4'));var router=express[_0x5de2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0x5de2('0x6')](_0x5de2('0x7'),auth[_0x5de2('0x8')](),controller[_0x5de2('0x9')]);router[_0x5de2('0xa')](_0x5de2('0x7'),auth[_0x5de2('0x8')](),controller[_0x5de2('0xb')]);module[_0x5de2('0xc')]=router; \ No newline at end of file +var _0xd9cb=['/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0xd9cb,0x14d));var _0xbd9c=function(_0x373447,_0x32a264){_0x373447=_0x373447-0x0;var _0x283e0b=_0xd9cb[_0x373447];return _0x283e0b;};'use strict';var multer=require('multer');var util=require(_0xbd9c('0x0'));var path=require(_0xbd9c('0x1'));var timeout=require(_0xbd9c('0x2'));var express=require(_0xbd9c('0x3'));var router=express[_0xbd9c('0x4')]();var fs_extra=require(_0xbd9c('0x5'));var auth=require(_0xbd9c('0x6'));var interaction=require(_0xbd9c('0x7'));var config=require(_0xbd9c('0x8'));var controller=require(_0xbd9c('0x9'));router['put']('/:id',auth[_0xbd9c('0xa')](),controller[_0xbd9c('0xb')]);router['delete'](_0xbd9c('0xc'),auth[_0xbd9c('0xa')](),controller[_0xbd9c('0xd')]);module[_0xbd9c('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 11bef32..00ba690 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x2a3bc8,_0x4fb9fe){var _0x506e96=function(_0x192ac9){while(--_0x192ac9){_0x2a3bc8['push'](_0x2a3bc8['shift']());}};_0x506e96(++_0x4fb9fe);}(_0xeda8,0x104));var _0x8eda=function(_0x24b739,_0x539cd1){_0x24b739=_0x24b739-0x0;var _0x41f45e=_0xeda8[_0x24b739];return _0x41f45e;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file +var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x143679,_0x25a0a1){var _0x109767=function(_0x4ceee5){while(--_0x4ceee5){_0x143679['push'](_0x143679['shift']());}};_0x109767(++_0x25a0a1);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x46a8c7,_0x72d945){_0x46a8c7=_0x46a8c7-0x0;var _0x2542cd=_0x9c5a[_0x46a8c7];return _0x2542cd;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 3eefdcd..995047f 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 _0x5e63=['GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','AnalyticMetric','keyBy','select','from','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','right_join','SUM(%s)','SEC_TO_TIME(%s)','DATE(%s)','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','MIN(%s)','getFields','ValidationErrorItem','findAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','rows','show','params','keys','length','options','find','catch','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)'];(function(_0x2bdf89,_0x21f0ac){var _0x314f23=function(_0x27aaf7){while(--_0x27aaf7){_0x2bdf89['push'](_0x2bdf89['shift']());}};_0x314f23(++_0x21f0ac);}(_0x5e63,0x19f));var _0x35e6=function(_0x2d255d,_0x17f6e5){_0x2d255d=_0x2d255d-0x0;var _0x2bb4b4=_0x5e63[_0x2d255d];return _0x2bb4b4;};'use strict';var emlformat=require(_0x35e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35e6('0x1'));var jsonpatch=require(_0x35e6('0x2'));var rp=require(_0x35e6('0x3'));var moment=require('moment');var BPromise=require(_0x35e6('0x4'));var Mustache=require(_0x35e6('0x5'));var util=require(_0x35e6('0x6'));var path=require(_0x35e6('0x7'));var sox=require(_0x35e6('0x8'));var csv=require('to-csv');var ejs=require(_0x35e6('0x9'));var fs=require('fs');var fs_extra=require(_0x35e6('0xa'));var _=require('lodash');var squel=require(_0x35e6('0xb'));var crypto=require(_0x35e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x35e6('0xd'));var toCsv=require(_0x35e6('0xe'));var querystring=require(_0x35e6('0xf'));var Papa=require(_0x35e6('0x10'));var Redis=require(_0x35e6('0x11'));var authService=require(_0x35e6('0x12'));var qs=require(_0x35e6('0x13'));var as=require(_0x35e6('0x14'));var hardwareService=require(_0x35e6('0x15'));var logger=require(_0x35e6('0x16'))('api');var utils=require(_0x35e6('0x17'));var config=require(_0x35e6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x35e6('0x19'))['db'];var dbH=require(_0x35e6('0x19'))[_0x35e6('0x1a')];function respondWithStatusCode(_0x3787d4,_0x3c820f){_0x3c820f=_0x3c820f||0xcc;return function(_0x48b7c3){if(_0x48b7c3){return _0x3787d4[_0x35e6('0x1b')](_0x3c820f);}return _0x3787d4[_0x35e6('0x1c')](_0x3c820f)[_0x35e6('0x1d')]();};}function respondWithResult(_0x4d3274,_0x296778){_0x296778=_0x296778||0xc8;return function(_0x452916){if(_0x452916){return _0x4d3274[_0x35e6('0x1c')](_0x296778)[_0x35e6('0x1e')](_0x452916);}};}function respondWithFilteredResult(_0x1b82fc,_0x1e68c3){return function(_0x27463b){if(_0x27463b){var _0x16c507=typeof _0x1e68c3['offset']===_0x35e6('0x1f')&&typeof _0x1e68c3[_0x35e6('0x20')]===_0x35e6('0x1f');var _0x35872f=_0x27463b[_0x35e6('0x21')];var _0xc86d32=_0x16c507?0x0:_0x1e68c3[_0x35e6('0x22')];var _0x222bb9=_0x16c507?_0x27463b[_0x35e6('0x21')]:_0x1e68c3[_0x35e6('0x22')]+_0x1e68c3[_0x35e6('0x20')];var _0x241b12;if(_0x222bb9>=_0x35872f){_0x222bb9=_0x35872f;_0x241b12=0xc8;}else{_0x241b12=0xce;}_0x1b82fc[_0x35e6('0x1c')](_0x241b12);return _0x1b82fc[_0x35e6('0x23')](_0x35e6('0x24'),_0xc86d32+'-'+_0x222bb9+'/'+_0x35872f)[_0x35e6('0x1e')](_0x27463b);}return null;};}function patchUpdates(_0x4b5bb1){return function(_0x4ecc19){try{jsonpatch[_0x35e6('0x25')](_0x4ecc19,_0x4b5bb1,!![]);}catch(_0x236230){return BPromise[_0x35e6('0x26')](_0x236230);}return _0x4ecc19[_0x35e6('0x27')]();};}function saveUpdates(_0x4a268e,_0x3624b2){return function(_0x171376){if(_0x171376){return _0x171376['update'](_0x4a268e)[_0x35e6('0x28')](function(_0x2b19aa){return _0x2b19aa;});}return null;};}function removeEntity(_0x47ae82,_0x51cdd1){return function(_0x46edc2){if(_0x46edc2){return _0x46edc2['destroy']()[_0x35e6('0x28')](function(){var _0x593d31=_0x46edc2[_0x35e6('0x29')]({'plain':!![]});var _0x288618=_0x35e6('0x2a');return db[_0x35e6('0x2b')][_0x35e6('0x2c')]({'where':{'type':_0x288618,'resourceId':_0x593d31['id']}})[_0x35e6('0x28')](function(){return _0x46edc2;});})[_0x35e6('0x28')](function(){_0x47ae82[_0x35e6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e5a6,_0x34f8bb){return function(_0x12d733){if(!_0x12d733){_0x46e5a6[_0x35e6('0x1b')](0x194);}return _0x12d733;};}function handleError(_0x544cd1,_0x206f8c){_0x206f8c=_0x206f8c||0x1f4;return function(_0x1a2037){logger[_0x35e6('0x2d')](_0x1a2037['stack']);if(_0x1a2037[_0x35e6('0x2e')]){delete _0x1a2037[_0x35e6('0x2e')];}_0x544cd1[_0x35e6('0x1c')](_0x206f8c)[_0x35e6('0x2f')](_0x1a2037);};}exports[_0x35e6('0x30')]=function(_0x2a303e,_0x2d1822){var _0x3bbb07={},_0x5454b9={},_0x1a3508={'count':0x0,'rows':[]};var _0x55a9ab=_[_0x35e6('0x31')](db[_0x35e6('0x32')][_0x35e6('0x33')],function(_0x67a5b2){return{'name':_0x67a5b2[_0x35e6('0x34')],'type':_0x67a5b2[_0x35e6('0x35')]['key']};});_0x5454b9[_0x35e6('0x36')]=_[_0x35e6('0x31')](_0x55a9ab,_0x35e6('0x2e'));_0x5454b9[_0x35e6('0x37')]=_['keys'](_0x2a303e['query']);_0x5454b9['filters']=_[_0x35e6('0x38')](_0x5454b9[_0x35e6('0x36')],_0x5454b9[_0x35e6('0x37')]);_0x3bbb07[_0x35e6('0x39')]=_['intersection'](_0x5454b9['model'],qs['fields'](_0x2a303e['query'][_0x35e6('0x3a')]));_0x3bbb07[_0x35e6('0x39')]=_0x3bbb07['attributes']['length']?_0x3bbb07[_0x35e6('0x39')]:_0x5454b9[_0x35e6('0x36')];if(!_0x2a303e['query'][_0x35e6('0x3b')](_0x35e6('0x3c'))){_0x3bbb07[_0x35e6('0x20')]=qs[_0x35e6('0x20')](_0x2a303e[_0x35e6('0x37')][_0x35e6('0x20')]);_0x3bbb07[_0x35e6('0x22')]=qs[_0x35e6('0x22')](_0x2a303e[_0x35e6('0x37')]['offset']);}_0x3bbb07[_0x35e6('0x3d')]=qs[_0x35e6('0x3e')](_0x2a303e[_0x35e6('0x37')]['sort']);_0x3bbb07['where']=qs[_0x35e6('0x3f')](_['pick'](_0x2a303e['query'],_0x5454b9[_0x35e6('0x3f')]),_0x55a9ab);if(_0x2a303e[_0x35e6('0x37')][_0x35e6('0x40')]){_0x3bbb07['where']=_[_0x35e6('0x41')](_0x3bbb07[_0x35e6('0x42')],{'$or':_[_0x35e6('0x31')](_0x55a9ab,function(_0x437756){if(_0x437756[_0x35e6('0x35')]!==_0x35e6('0x43')){var _0x44e34a={};_0x44e34a[_0x437756[_0x35e6('0x2e')]]={'$like':'%'+_0x2a303e['query'][_0x35e6('0x40')]+'%'};return _0x44e34a;}})});}_0x3bbb07=_[_0x35e6('0x41')]({},_0x3bbb07,_0x2a303e['options']);var _0xc0867d={'where':_0x3bbb07['where']};return db[_0x35e6('0x32')]['count'](_0xc0867d)[_0x35e6('0x28')](function(_0x4b150c){_0x1a3508[_0x35e6('0x21')]=_0x4b150c;if(_0x2a303e['query'][_0x35e6('0x44')]){_0x3bbb07['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3bbb07);})[_0x35e6('0x28')](function(_0x3fea16){_0x1a3508[_0x35e6('0x45')]=_0x3fea16;return _0x1a3508;})[_0x35e6('0x28')](respondWithFilteredResult(_0x2d1822,_0x3bbb07))['catch'](handleError(_0x2d1822,null));};exports[_0x35e6('0x46')]=function(_0x13d5be,_0x24d422){var _0xcad61e={'raw':![],'where':{'id':_0x13d5be[_0x35e6('0x47')]['id']}},_0x430f13={};_0x430f13[_0x35e6('0x36')]=_['keys'](db[_0x35e6('0x32')]['rawAttributes']);_0x430f13[_0x35e6('0x37')]=_[_0x35e6('0x48')](_0x13d5be[_0x35e6('0x37')]);_0x430f13[_0x35e6('0x3f')]=_[_0x35e6('0x38')](_0x430f13[_0x35e6('0x36')],_0x430f13[_0x35e6('0x37')]);_0xcad61e['attributes']=_['intersection'](_0x430f13[_0x35e6('0x36')],qs[_0x35e6('0x3a')](_0x13d5be[_0x35e6('0x37')]['fields']));_0xcad61e[_0x35e6('0x39')]=_0xcad61e['attributes'][_0x35e6('0x49')]?_0xcad61e[_0x35e6('0x39')]:_0x430f13['model'];if(_0x13d5be['query'][_0x35e6('0x44')]){_0xcad61e['include']=[{'all':!![]}];}_0xcad61e=_['merge']({},_0xcad61e,_0x13d5be[_0x35e6('0x4a')]);return db[_0x35e6('0x32')][_0x35e6('0x4b')](_0xcad61e)[_0x35e6('0x28')](handleEntityNotFound(_0x24d422,null))[_0x35e6('0x28')](respondWithResult(_0x24d422,null))[_0x35e6('0x4c')](handleError(_0x24d422,null));};exports[_0x35e6('0x4d')]=function(_0x1f1966,_0x2b0ee0){return db[_0x35e6('0x32')][_0x35e6('0x4d')](_0x1f1966['body'],{})[_0x35e6('0x28')](function(_0x4dcd83){var _0x1724ec=_0x1f1966[_0x35e6('0x4e')][_0x35e6('0x29')]({'plain':!![]});if(!_0x1724ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1724ec['role']==='user'){var _0x158e64=_0x4dcd83[_0x35e6('0x29')]({'plain':!![]});var _0x3c6b8b='Reports';return db[_0x35e6('0x4f')][_0x35e6('0x4b')]({'where':{'name':_0x3c6b8b,'userProfileId':_0x1724ec['userProfileId']},'raw':!![]})['then'](function(_0x2779f8){if(_0x2779f8&&_0x2779f8[_0x35e6('0x50')]===0x0){return db[_0x35e6('0x2b')][_0x35e6('0x4d')]({'name':_0x158e64[_0x35e6('0x2e')],'resourceId':_0x158e64['id'],'type':_0x35e6('0x2a'),'sectionId':_0x2779f8['id']},{})[_0x35e6('0x28')](function(){return _0x4dcd83;});}else{return _0x4dcd83;}})[_0x35e6('0x4c')](function(_0x2fa4dd){logger['error'](_0x35e6('0x51'),_0x2fa4dd);throw _0x2fa4dd;});}return _0x4dcd83;})[_0x35e6('0x28')](respondWithResult(_0x2b0ee0,0xc9))[_0x35e6('0x4c')](handleError(_0x2b0ee0,null));};exports[_0x35e6('0x52')]=function(_0xfa1b9d,_0x10b348){if(_0xfa1b9d[_0x35e6('0x53')]['id']){delete _0xfa1b9d[_0x35e6('0x53')]['id'];}return db[_0x35e6('0x32')][_0x35e6('0x4b')]({'where':{'id':_0xfa1b9d['params']['id']}})[_0x35e6('0x28')](handleEntityNotFound(_0x10b348,null))['then'](saveUpdates(_0xfa1b9d['body'],null))[_0x35e6('0x28')](respondWithResult(_0x10b348,null))['catch'](handleError(_0x10b348,null));};exports[_0x35e6('0x2c')]=function(_0x3167a7,_0x3e9fef){return db[_0x35e6('0x32')][_0x35e6('0x4b')]({'where':{'id':_0x3167a7['params']['id']}})[_0x35e6('0x28')](handleEntityNotFound(_0x3e9fef,null))[_0x35e6('0x28')](removeEntity(_0x3e9fef,null))[_0x35e6('0x4c')](handleError(_0x3e9fef,null));};exports[_0x35e6('0x54')]=function(_0x28bf62,_0xd211a6){var _0x1be603=0xa;var _0x1ecab9=['join',_0x35e6('0x55'),'right_join',_0x35e6('0x56')];var _0x463d37={'SUM':'SUM(%s)','COUNT':_0x35e6('0x57'),'COUNT DISTINCT':_0x35e6('0x58'),'MAX':_0x35e6('0x59'),'MIN':'MIN(%s)','AVG':_0x35e6('0x5a'),'GROUP_CONCAT':_0x35e6('0x5b'),'GROUP_CONCAT ASC':_0x35e6('0x5c'),'GROUP_CONCAT DESC':_0x35e6('0x5d')};var _0x1ce973={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x35e6('0x5e'),'ROUND':_0x35e6('0x5f'),'UNIX_TIMESTAMP':_0x35e6('0x60')};var _0x9af0bb=function(_0x5ef9f9){return!_[_0x35e6('0x61')]([_0x35e6('0x62'),_0x35e6('0x63'),_0x35e6('0x64'),_0x35e6('0x65')],_0x5ef9f9);};var _0x2cba6c=function(_0x14e450){if(!_0x14e450||!_0x14e450['rules'][_0x35e6('0x49')]){return'';}for(var _0x1862fa='(',_0x415572=0x0;_0x415572<_0x14e450[_0x35e6('0x66')][_0x35e6('0x49')];_0x415572+=0x1){_0x415572>0x0&&(_0x1862fa+='\x20'+_0x14e450[_0x35e6('0x67')]+'\x20');_0x1862fa+=_0x14e450['rules'][_0x415572][_0x35e6('0x68')]?_0x2cba6c(_0x14e450[_0x35e6('0x66')][_0x415572][_0x35e6('0x68')]):_0x14e450['rules'][_0x415572][_0x35e6('0x69')]+'\x20'+_0x14e450['rules'][_0x415572][_0x35e6('0x6a')]+(_0x9af0bb(_0x14e450[_0x35e6('0x66')][_0x415572]['condition'])?'\x20'+_0x14e450[_0x35e6('0x66')][_0x415572][_0x35e6('0x6b')]:'');}return _0x1862fa+')';};var _0x5e3fc5={'where':{'id':_0x28bf62[_0x35e6('0x47')]['id']}},_0x145cd7,_0x14afd4,_0x2b41b6,_0x512610,_0x252d9e;_0x5e3fc5=_[_0x35e6('0x41')]({},_0x5e3fc5,_0x28bf62[_0x35e6('0x4a')]);return db['AnalyticCustomReport'][_0x35e6('0x4b')](_0x5e3fc5)[_0x35e6('0x28')](function(_0x75d914){if(_0x75d914){_0x145cd7=_0x75d914;return _0x75d914['getFields']();}return null;})[_0x35e6('0x28')](function(_0x53db57){if(_0x53db57){if(!_0x53db57[_0x35e6('0x49')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x14afd4=_0x53db57;return db[_0x35e6('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x35e6('0x28')](function(_0x3566c3){if(_0x3566c3){_0x2b41b6=_[_0x35e6('0x6d')](_0x3566c3,'id');var _0x1db5a2;var _0x31ca61=squel[_0x35e6('0x6e')]();_0x31ca61[_0x35e6('0x6f')](_0x145cd7['table']);for(var _0x499857=0x0;_0x499857<_0x14afd4[_0x35e6('0x49')];_0x499857+=0x1){_0x1db5a2=_0x14afd4[_0x499857][_0x35e6('0x70')]?_0x2b41b6[_0x14afd4[_0x499857]['MetricId']][_0x35e6('0x71')]:_0x14afd4[_0x499857][_0x35e6('0x69')];_0x1db5a2=_0x14afd4[_0x499857][_0x35e6('0x72')]?_['replace'](_0x463d37[_0x14afd4[_0x499857]['function']],'%s',_0x1db5a2):_0x1db5a2;_0x1db5a2=_0x14afd4[_0x499857][_0x35e6('0x73')]?_[_0x35e6('0x74')](_0x1ce973[_0x14afd4[_0x499857][_0x35e6('0x73')]],'%s',_0x1db5a2):_0x1db5a2;if(_0x14afd4[_0x499857]['groupBy']){_0x31ca61['group'](_0x1db5a2);}_0x14afd4[_0x499857][_0x35e6('0x75')]&&_0x31ca61[_0x35e6('0x3d')](_0x1db5a2,_0x14afd4[_0x499857]['orderBy']===_0x35e6('0x76')?![]:!![]);_0x31ca61[_0x35e6('0x69')](_0x1db5a2,_0x14afd4[_0x499857][_0x35e6('0x77')]||_0x1db5a2);}if(_0x145cd7[_0x35e6('0x78')]){_0x145cd7[_0x35e6('0x78')]=JSON[_0x35e6('0x79')](_0x145cd7[_0x35e6('0x78')]);for(var _0x5ef0fa=0x0;_0x5ef0fa<_0x145cd7[_0x35e6('0x78')]['length'];_0x5ef0fa+=0x1){if(_0x145cd7[_0x35e6('0x78')][_0x5ef0fa][_0x35e6('0x35')]&&_[_0x35e6('0x61')](_0x1ecab9,_0x145cd7[_0x35e6('0x78')][_0x5ef0fa][_0x35e6('0x35')])&&_0x145cd7['joins'][_0x5ef0fa][_0x35e6('0x7a')]&&_0x145cd7['joins'][_0x5ef0fa][_0x35e6('0x7b')]&&_0x145cd7[_0x35e6('0x78')][_0x5ef0fa][_0x35e6('0x7c')]){_0x31ca61[_0x145cd7[_0x35e6('0x78')][_0x5ef0fa]['type']](_0x145cd7['joins'][_0x5ef0fa][_0x35e6('0x7b')],null,util['format'](_0x35e6('0x7d'),_0x145cd7[_0x35e6('0x7e')],_0x145cd7[_0x35e6('0x78')][_0x5ef0fa][_0x35e6('0x7a')],_0x145cd7['joins'][_0x5ef0fa][_0x35e6('0x7b')],_0x145cd7[_0x35e6('0x78')][_0x5ef0fa][_0x35e6('0x7c')]));}}}if(_0x145cd7['conditions']){_0x145cd7[_0x35e6('0x7f')]=JSON[_0x35e6('0x79')](_0x145cd7[_0x35e6('0x7f')]);_0x31ca61[_0x35e6('0x42')](_0x2cba6c(_0x145cd7['conditions'][_0x35e6('0x68')]));}_0x252d9e=_0x31ca61[_0x35e6('0x80')]();_0x31ca61[_0x35e6('0x20')](_0x1be603);_0x31ca61[_0x35e6('0x22')](0x0);logger[_0x35e6('0x81')](_0x35e6('0x82'),_0x31ca61[_0x35e6('0x83')]());return dbH[_0x35e6('0x84')][_0x35e6('0x37')](_0x31ca61[_0x35e6('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x35e6('0x85')]});}})['then'](respondWithResult(_0xd211a6,null))[_0x35e6('0x4c')](handleError(_0xd211a6,null));};function runReport(_0x145b5a,_0x5a6d37,_0x4daf12){var _0x39d76f=_0x5a6d37[_0x35e6('0x2e')];var _0x36c941=0xa;var _0xfdd48f=[_0x35e6('0x86'),'left_join',_0x35e6('0x87'),_0x35e6('0x56')];var _0x29f8b0={'SUM':_0x35e6('0x88'),'COUNT':_0x35e6('0x57'),'COUNT DISTINCT':_0x35e6('0x58'),'MAX':_0x35e6('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35e6('0x5c'),'GROUP_CONCAT DESC':_0x35e6('0x5d')};var _0x17fcd0={'SEC_TO_TIME':_0x35e6('0x89'),'DATE':_0x35e6('0x8a'),'HOUR':_0x35e6('0x5e'),'ROUND':_0x35e6('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xeda168=function(_0x3fd04f){return!_[_0x35e6('0x61')]([_0x35e6('0x62'),_0x35e6('0x63'),_0x35e6('0x64'),_0x35e6('0x65')],_0x3fd04f);};var _0xf4c172=function(_0x2fa468){if(!_0x2fa468||!_0x2fa468[_0x35e6('0x66')][_0x35e6('0x49')]){return'';}for(var _0x1dfb3c='(',_0x41abd5=0x0;_0x41abd5<_0x2fa468[_0x35e6('0x66')]['length'];_0x41abd5+=0x1){_0x41abd5>0x0&&(_0x1dfb3c+='\x20'+_0x2fa468[_0x35e6('0x67')]+'\x20');_0x1dfb3c+=_0x2fa468['rules'][_0x41abd5][_0x35e6('0x68')]?_0xf4c172(_0x2fa468[_0x35e6('0x66')][_0x41abd5][_0x35e6('0x68')]):_0x2fa468[_0x35e6('0x66')][_0x41abd5][_0x35e6('0x69')]+'\x20'+_0x2fa468[_0x35e6('0x66')][_0x41abd5][_0x35e6('0x6a')]+(_0xeda168(_0x2fa468[_0x35e6('0x66')][_0x41abd5]['condition'])?'\x20'+_0x2fa468[_0x35e6('0x66')][_0x41abd5]['value']:'');}return _0x1dfb3c+')';};var _0x1053c9={'where':{'id':_0x145b5a['id']}},_0x100189,_0x50ca1a,_0xfb4b5b,_0xccced0,_0x4d1c0f;_0x1053c9=_[_0x35e6('0x41')]({},_0x1053c9,_0x4daf12);return db[_0x35e6('0x32')][_0x35e6('0x4b')](_0x1053c9)[_0x35e6('0x28')](function(_0x18d149){if(_0x18d149){_0x100189=_0x18d149;return _0x18d149['getFields']();}return null;})[_0x35e6('0x28')](function(_0x270563){if(_0x270563){if(!_0x270563['length']){throw new db[(_0x35e6('0x8b'))]['ValidationErrorItem'](_0x35e6('0x8c'),0x193);}_0x50ca1a=_0x270563;return db[_0x35e6('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x35e6('0x28')](function(_0x403491){if(_0x403491){_0xfb4b5b=_[_0x35e6('0x6d')](_0x403491,'id');var _0x8b7542;var _0x26f69b=squel[_0x35e6('0x6e')]();_0x26f69b[_0x35e6('0x6f')](_0x100189[_0x35e6('0x7e')]);for(var _0x10fa36=0x0;_0x10fa36<_0x50ca1a[_0x35e6('0x49')];_0x10fa36+=0x1){_0x8b7542=_0x50ca1a[_0x10fa36][_0x35e6('0x70')]?_0xfb4b5b[_0x50ca1a[_0x10fa36][_0x35e6('0x70')]][_0x35e6('0x71')]:_0x50ca1a[_0x10fa36][_0x35e6('0x69')];_0x8b7542=_0x50ca1a[_0x10fa36][_0x35e6('0x72')]?_[_0x35e6('0x74')](_0x29f8b0[_0x50ca1a[_0x10fa36]['function']],'%s',_0x8b7542):_0x8b7542;_0x8b7542=_0x50ca1a[_0x10fa36]['format']?_[_0x35e6('0x74')](_0x17fcd0[_0x50ca1a[_0x10fa36]['format']],'%s',_0x8b7542):_0x8b7542;if(_0x50ca1a[_0x10fa36][_0x35e6('0x8d')]){_0x26f69b[_0x35e6('0x68')](_0x8b7542);}_0x50ca1a[_0x10fa36][_0x35e6('0x75')]&&_0x26f69b[_0x35e6('0x3d')](_0x8b7542,_0x50ca1a[_0x10fa36]['orderBy']===_0x35e6('0x76')?![]:!![]);_0x26f69b['field'](_0x8b7542,_0x50ca1a[_0x10fa36][_0x35e6('0x77')]||_0x8b7542);}if(_0x100189['joins']){_0x100189[_0x35e6('0x78')]=JSON[_0x35e6('0x79')](_0x100189[_0x35e6('0x78')]);for(var _0x1cb874=0x0;_0x1cb874<_0x100189[_0x35e6('0x78')][_0x35e6('0x49')];_0x1cb874+=0x1){if(_0x100189['joins'][_0x1cb874][_0x35e6('0x35')]&&_[_0x35e6('0x61')](_0xfdd48f,_0x100189[_0x35e6('0x78')][_0x1cb874][_0x35e6('0x35')])&&_0x100189[_0x35e6('0x78')][_0x1cb874][_0x35e6('0x7a')]&&_0x100189[_0x35e6('0x78')][_0x1cb874][_0x35e6('0x7b')]&&_0x100189['joins'][_0x1cb874][_0x35e6('0x7c')]){_0x26f69b[_0x100189[_0x35e6('0x78')][_0x1cb874]['type']](_0x100189['joins'][_0x1cb874][_0x35e6('0x7b')],null,util['format'](_0x35e6('0x7d'),_0x100189['table'],_0x100189[_0x35e6('0x78')][_0x1cb874]['parentKey'],_0x100189['joins'][_0x1cb874][_0x35e6('0x7b')],_0x100189['joins'][_0x1cb874]['foreignKey']));}}}if(_0x100189[_0x35e6('0x7f')]){_0x100189['conditions']=JSON[_0x35e6('0x79')](_0x100189['conditions']);_0x26f69b[_0x35e6('0x42')](_0xf4c172(_0x100189[_0x35e6('0x7f')][_0x35e6('0x68')]));}_0x4d1c0f=_0x26f69b[_0x35e6('0x80')]();_0x26f69b['limit'](_0x36c941);_0x26f69b[_0x35e6('0x22')](0x0);return;}})['then'](function(){if(_0x5a6d37['output']===_0x35e6('0x8e')){return null;}var _0x573a63=_[_0x35e6('0x41')](_0x5a6d37,{'name':_0x5a6d37[_0x35e6('0x8f')]||_0x5a6d37[_0x35e6('0x2e')]||_0x100189[_0x35e6('0x2e')],'basename':_0x39d76f,'savename':util[_0x35e6('0x73')](_0x35e6('0x90'),_0x5a6d37['name']||_0x100189[_0x35e6('0x2e')],require('randomstring')[_0x35e6('0x91')](0x4),_0x5a6d37['output']||_0x35e6('0x92')),'reportId':_0x100189['id'],'reportType':'custom'});return db[_0x35e6('0x93')][_0x35e6('0x4d')](_0x573a63,{'raw':!![]});})['then'](function(_0x499af2){if(_0x100189[_0x35e6('0x7e')]===_0x35e6('0x94')){_0x4d1c0f['where'](_0x100189[_0x35e6('0x7e')]+_0x35e6('0x95'),_0x5a6d37[_0x35e6('0x96')],_0x5a6d37[_0x35e6('0x97')]);}else{_0x4d1c0f['where'](_0x100189['table']+_0x35e6('0x98'),_0x5a6d37[_0x35e6('0x96')],_0x5a6d37[_0x35e6('0x97')]);}if(_0x499af2){logger[_0x35e6('0x99')](_0x35e6('0x9a'),_0x4d1c0f['toString']());require(_0x35e6('0x9b'))['fork'](path['join'](__dirname,_0x35e6('0x9c'),_0x499af2[_0x35e6('0x9d')]),[_0x499af2['id'],_0x4d1c0f[_0x35e6('0x83')](),path['join'](__dirname,_0x35e6('0x9e'),_0x499af2[_0x35e6('0x9f')]),_0x39d76f]);return _0x499af2;}else{var _0x18ef72=squel['select']();_0x18ef72[_0x35e6('0x6f')]('('+_0x4d1c0f['toString']()+')',_0x35e6('0xa0'));_0x18ef72['field'](_0x35e6('0xa1'),_0x35e6('0x21'));_0x4d1c0f[_0x35e6('0x20')](_0x5a6d37[_0x35e6('0x20')]||_0x36c941);_0x4d1c0f[_0x35e6('0x22')](_0x5a6d37[_0x35e6('0x22')]||0x0);return dbH[_0x35e6('0x84')][_0x35e6('0x37')](_0x18ef72['toString'](),{'type':dbH['sequelize'][_0x35e6('0xa2')]['SELECT']})[_0x35e6('0x28')](function(_0x1e22c1){if(!_0x1e22c1['length']){_0xccced0=0x0;}else{_0xccced0=_0x1e22c1[0x0][_0x35e6('0x21')]||0x0;}return dbH[_0x35e6('0x84')][_0x35e6('0x37')](_0x4d1c0f[_0x35e6('0x83')](),{'type':dbH[_0x35e6('0x84')][_0x35e6('0xa2')][_0x35e6('0x85')]});})['then'](function(_0x57c9a9){return{'rows':_0x57c9a9||[],'count':_0xccced0};});}});}exports[_0x35e6('0xa3')]=function(_0x135457,_0x39144a){return runReport(_0x135457[_0x35e6('0x47')],_0x135457[_0x35e6('0x37')],_0x135457['options'])[_0x35e6('0x28')](respondWithResult(_0x39144a,null))[_0x35e6('0x4c')](handleError(_0x39144a,null));};exports[_0x35e6('0xa4')]=runReport;exports[_0x35e6('0x37')]=function(_0x315188,_0x568413){var _0x17144a=0xa;var _0x105b07=[_0x35e6('0x86'),_0x35e6('0x55'),_0x35e6('0x87'),_0x35e6('0x56')];var _0x1efefa={'SUM':'SUM(%s)','COUNT':_0x35e6('0x57'),'COUNT DISTINCT':_0x35e6('0x58'),'MAX':_0x35e6('0x59'),'MIN':_0x35e6('0xa5'),'AVG':_0x35e6('0x5a'),'GROUP_CONCAT':_0x35e6('0x5b'),'GROUP_CONCAT ASC':_0x35e6('0x5c'),'GROUP_CONCAT DESC':_0x35e6('0x5d')};var _0x46d7d0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35e6('0x8a'),'HOUR':'HOUR(%s)','ROUND':_0x35e6('0x5f'),'UNIX_TIMESTAMP':_0x35e6('0x60')};var _0xde0b4a=function(_0x4e1e9d){return!_['includes']([_0x35e6('0x62'),_0x35e6('0x63'),_0x35e6('0x64'),_0x35e6('0x65')],_0x4e1e9d);};var _0xdeddfe=function(_0x4a9c6a){if(!_0x4a9c6a||!_0x4a9c6a[_0x35e6('0x66')][_0x35e6('0x49')]){return'';}for(var _0x1da585='(',_0x1c37f4=0x0;_0x1c37f4<_0x4a9c6a[_0x35e6('0x66')]['length'];_0x1c37f4+=0x1){_0x1c37f4>0x0&&(_0x1da585+='\x20'+_0x4a9c6a[_0x35e6('0x67')]+'\x20');_0x1da585+=_0x4a9c6a[_0x35e6('0x66')][_0x1c37f4][_0x35e6('0x68')]?_0xdeddfe(_0x4a9c6a[_0x35e6('0x66')][_0x1c37f4][_0x35e6('0x68')]):_0x4a9c6a['rules'][_0x1c37f4][_0x35e6('0x69')]+'\x20'+_0x4a9c6a[_0x35e6('0x66')][_0x1c37f4][_0x35e6('0x6a')]+(_0xde0b4a(_0x4a9c6a['rules'][_0x1c37f4][_0x35e6('0x6a')])?'\x20'+_0x4a9c6a[_0x35e6('0x66')][_0x1c37f4]['value']:'');}return _0x1da585+')';};var _0x5e866d={'where':{'id':_0x315188[_0x35e6('0x47')]['id']}},_0x280832,_0x4229ae,_0x393fc0,_0x27dc54,_0x554ad3;_0x5e866d=_[_0x35e6('0x41')]({},_0x5e866d,_0x315188[_0x35e6('0x4a')]);return db[_0x35e6('0x32')]['find'](_0x5e866d)[_0x35e6('0x28')](function(_0x22ffea){if(_0x22ffea){_0x280832=_0x22ffea;return _0x22ffea[_0x35e6('0xa6')]();}return null;})['then'](function(_0x1e42ed){if(_0x1e42ed){if(!_0x1e42ed['length']){throw new db[(_0x35e6('0x8b'))][(_0x35e6('0xa7'))](_0x35e6('0x8c'),0x193);}_0x4229ae=_0x1e42ed;return db[_0x35e6('0x6c')][_0x35e6('0xa8')]({'raw':!![]});}return null;})[_0x35e6('0x28')](function(_0x2d4eda){if(_0x2d4eda){_0x393fc0=_['keyBy'](_0x2d4eda,'id');var _0x1e2704;var _0x4f49fe=squel['select']();_0x4f49fe[_0x35e6('0x6f')](_0x280832[_0x35e6('0x7e')]);for(var _0x5645e0=0x0;_0x5645e0<_0x4229ae[_0x35e6('0x49')];_0x5645e0+=0x1){_0x1e2704=_0x4229ae[_0x5645e0][_0x35e6('0x70')]?_0x393fc0[_0x4229ae[_0x5645e0][_0x35e6('0x70')]][_0x35e6('0x71')]:_0x4229ae[_0x5645e0][_0x35e6('0x69')];_0x1e2704=_0x4229ae[_0x5645e0][_0x35e6('0x72')]?_[_0x35e6('0x74')](_0x1efefa[_0x4229ae[_0x5645e0][_0x35e6('0x72')]],'%s',_0x1e2704):_0x1e2704;_0x1e2704=_0x4229ae[_0x5645e0][_0x35e6('0x73')]?_[_0x35e6('0x74')](_0x46d7d0[_0x4229ae[_0x5645e0][_0x35e6('0x73')]],'%s',_0x1e2704):_0x1e2704;if(_0x4229ae[_0x5645e0][_0x35e6('0x8d')]){_0x4f49fe['group'](_0x1e2704);}_0x4229ae[_0x5645e0]['orderBy']&&_0x4f49fe[_0x35e6('0x3d')](_0x1e2704,_0x4229ae[_0x5645e0][_0x35e6('0x75')]===_0x35e6('0x76')?![]:!![]);_0x4f49fe[_0x35e6('0x69')](_0x1e2704,_0x4229ae[_0x5645e0][_0x35e6('0x77')]||_0x1e2704);}if(_0x280832[_0x35e6('0x78')]){_0x280832[_0x35e6('0x78')]=JSON[_0x35e6('0x79')](_0x280832[_0x35e6('0x78')]);for(var _0x3d3793=0x0;_0x3d3793<_0x280832[_0x35e6('0x78')][_0x35e6('0x49')];_0x3d3793+=0x1){if(_0x280832['joins'][_0x3d3793][_0x35e6('0x35')]&&_[_0x35e6('0x61')](_0x105b07,_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x35')])&&_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7a')]&&_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7b')]&&_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7c')]){_0x4f49fe[_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x35')]](_0x280832['joins'][_0x3d3793][_0x35e6('0x7b')],null,util[_0x35e6('0x73')](_0x35e6('0x7d'),_0x280832[_0x35e6('0x7e')],_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7a')],_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7b')],_0x280832[_0x35e6('0x78')][_0x3d3793][_0x35e6('0x7c')]));}}}if(_0x280832[_0x35e6('0x7f')]){_0x280832[_0x35e6('0x7f')]=JSON[_0x35e6('0x79')](_0x280832[_0x35e6('0x7f')]);_0x4f49fe[_0x35e6('0x42')](_0xdeddfe(_0x280832[_0x35e6('0x7f')][_0x35e6('0x68')]));}_0x554ad3=_0x4f49fe['clone']();_0x4f49fe[_0x35e6('0x20')](_0x17144a);_0x4f49fe[_0x35e6('0x22')](0x0);logger[_0x35e6('0x81')](_0x35e6('0x82'),_0x4f49fe[_0x35e6('0x83')]());return dbH[_0x35e6('0x84')][_0x35e6('0x37')](_0x4f49fe['toString'](),{'type':dbH['sequelize'][_0x35e6('0xa2')]['SELECT']});}})[_0x35e6('0x28')](function(){return{'sql':_0x554ad3[_0x35e6('0x83')]()};})[_0x35e6('0x28')](respondWithResult(_0x568413,null))[_0x35e6('0x4c')](handleError(_0x568413,null));}; \ No newline at end of file +var _0x1a40=['.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','keyBy','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','reject','save','update','then','get','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','getFields','ValidationErrorItem','order','alias','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a40,0xb7));var _0x01a4=function(_0x4006f7,_0x2b1071){_0x4006f7=_0x4006f7-0x0;var _0x8aa156=_0x1a40[_0x4006f7];return _0x8aa156;};'use strict';var emlformat=require(_0x01a4('0x0'));var rimraf=require(_0x01a4('0x1'));var zipdir=require(_0x01a4('0x2'));var jsonpatch=require(_0x01a4('0x3'));var rp=require(_0x01a4('0x4'));var moment=require(_0x01a4('0x5'));var BPromise=require(_0x01a4('0x6'));var Mustache=require(_0x01a4('0x7'));var util=require(_0x01a4('0x8'));var path=require(_0x01a4('0x9'));var sox=require(_0x01a4('0xa'));var csv=require(_0x01a4('0xb'));var ejs=require(_0x01a4('0xc'));var fs=require('fs');var fs_extra=require(_0x01a4('0xd'));var _=require(_0x01a4('0xe'));var squel=require(_0x01a4('0xf'));var crypto=require(_0x01a4('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x01a4('0x11'));var toCsv=require(_0x01a4('0xb'));var querystring=require(_0x01a4('0x12'));var Papa=require(_0x01a4('0x13'));var Redis=require(_0x01a4('0x14'));var authService=require(_0x01a4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x01a4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01a4('0x17'))(_0x01a4('0x18'));var utils=require('../../config/utils');var config=require(_0x01a4('0x19'));var licenseUtil=require(_0x01a4('0x1a'));var db=require(_0x01a4('0x1b'))['db'];var dbH=require(_0x01a4('0x1b'))[_0x01a4('0x1c')];function respondWithStatusCode(_0x355100,_0x4bb212){_0x4bb212=_0x4bb212||0xcc;return function(_0x1f701d){if(_0x1f701d){return _0x355100[_0x01a4('0x1d')](_0x4bb212);}return _0x355100[_0x01a4('0x1e')](_0x4bb212)[_0x01a4('0x1f')]();};}function respondWithResult(_0x378625,_0x1abcdf){_0x1abcdf=_0x1abcdf||0xc8;return function(_0x3f3cf1){if(_0x3f3cf1){return _0x378625['status'](_0x1abcdf)['json'](_0x3f3cf1);}};}function respondWithFilteredResult(_0x480a2d,_0x4388cb){return function(_0x22893f){if(_0x22893f){var _0x8327b5=typeof _0x4388cb['offset']===_0x01a4('0x20')&&typeof _0x4388cb[_0x01a4('0x21')]==='undefined';var _0x22c142=_0x22893f['count'];var _0x56ce9a=_0x8327b5?0x0:_0x4388cb[_0x01a4('0x22')];var _0x3c5930=_0x8327b5?_0x22893f[_0x01a4('0x23')]:_0x4388cb['offset']+_0x4388cb[_0x01a4('0x21')];var _0x32c076;if(_0x3c5930>=_0x22c142){_0x3c5930=_0x22c142;_0x32c076=0xc8;}else{_0x32c076=0xce;}_0x480a2d[_0x01a4('0x1e')](_0x32c076);return _0x480a2d['set'](_0x01a4('0x24'),_0x56ce9a+'-'+_0x3c5930+'/'+_0x22c142)[_0x01a4('0x25')](_0x22893f);}return null;};}function patchUpdates(_0x5a127f){return function(_0x417c1b){try{jsonpatch['apply'](_0x417c1b,_0x5a127f,!![]);}catch(_0x43270a){return BPromise[_0x01a4('0x26')](_0x43270a);}return _0x417c1b[_0x01a4('0x27')]();};}function saveUpdates(_0x46fafd,_0x5076e5){return function(_0x3a2993){if(_0x3a2993){return _0x3a2993[_0x01a4('0x28')](_0x46fafd)[_0x01a4('0x29')](function(_0x4063a0){return _0x4063a0;});}return null;};}function removeEntity(_0x31860f,_0x1ff82a){return function(_0x1977f1){if(_0x1977f1){return _0x1977f1['destroy']()[_0x01a4('0x29')](function(){var _0x216810=_0x1977f1[_0x01a4('0x2a')]({'plain':!![]});var _0x53a8d5='CustomReports';return db[_0x01a4('0x2b')]['destroy']({'where':{'type':_0x53a8d5,'resourceId':_0x216810['id']}})['then'](function(){return _0x1977f1;});})[_0x01a4('0x29')](function(){_0x31860f[_0x01a4('0x1e')](0xcc)[_0x01a4('0x1f')]();});}};}function handleEntityNotFound(_0x4249e7,_0x3007f8){return function(_0x2aab8b){if(!_0x2aab8b){_0x4249e7[_0x01a4('0x1d')](0x194);}return _0x2aab8b;};}function handleError(_0x1fcd57,_0x3d4085){_0x3d4085=_0x3d4085||0x1f4;return function(_0x449b12){logger['error'](_0x449b12[_0x01a4('0x2c')]);if(_0x449b12[_0x01a4('0x2d')]){delete _0x449b12[_0x01a4('0x2d')];}_0x1fcd57[_0x01a4('0x1e')](_0x3d4085)[_0x01a4('0x2e')](_0x449b12);};}exports[_0x01a4('0x2f')]=function(_0x2a61ed,_0x2c824f){var _0xc5ea13={},_0x343c9a={},_0x3ee4f0={'count':0x0,'rows':[]};var _0x3e006c=_['map'](db['AnalyticCustomReport'][_0x01a4('0x30')],function(_0x35da28){return{'name':_0x35da28[_0x01a4('0x31')],'type':_0x35da28[_0x01a4('0x32')][_0x01a4('0x33')]};});_0x343c9a[_0x01a4('0x34')]=_[_0x01a4('0x35')](_0x3e006c,'name');_0x343c9a[_0x01a4('0x36')]=_[_0x01a4('0x37')](_0x2a61ed[_0x01a4('0x36')]);_0x343c9a[_0x01a4('0x38')]=_[_0x01a4('0x39')](_0x343c9a[_0x01a4('0x34')],_0x343c9a[_0x01a4('0x36')]);_0xc5ea13[_0x01a4('0x3a')]=_[_0x01a4('0x39')](_0x343c9a[_0x01a4('0x34')],qs[_0x01a4('0x3b')](_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x3b')]));_0xc5ea13[_0x01a4('0x3a')]=_0xc5ea13[_0x01a4('0x3a')][_0x01a4('0x3c')]?_0xc5ea13[_0x01a4('0x3a')]:_0x343c9a[_0x01a4('0x34')];if(!_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x3d')](_0x01a4('0x3e'))){_0xc5ea13[_0x01a4('0x21')]=qs[_0x01a4('0x21')](_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x21')]);_0xc5ea13[_0x01a4('0x22')]=qs[_0x01a4('0x22')](_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x22')]);}_0xc5ea13['order']=qs[_0x01a4('0x3f')](_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x3f')]);_0xc5ea13[_0x01a4('0x40')]=qs[_0x01a4('0x38')](_[_0x01a4('0x41')](_0x2a61ed[_0x01a4('0x36')],_0x343c9a[_0x01a4('0x38')]),_0x3e006c);if(_0x2a61ed['query'][_0x01a4('0x42')]){_0xc5ea13[_0x01a4('0x40')]=_[_0x01a4('0x43')](_0xc5ea13[_0x01a4('0x40')],{'$or':_[_0x01a4('0x35')](_0x3e006c,function(_0x54612a){if(_0x54612a[_0x01a4('0x32')]!==_0x01a4('0x44')){var _0xc38da0={};_0xc38da0[_0x54612a[_0x01a4('0x2d')]]={'$like':'%'+_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x42')]+'%'};return _0xc38da0;}})});}_0xc5ea13=_[_0x01a4('0x43')]({},_0xc5ea13,_0x2a61ed[_0x01a4('0x45')]);var _0x2a7e7c={'where':_0xc5ea13['where']};return db[_0x01a4('0x46')][_0x01a4('0x23')](_0x2a7e7c)['then'](function(_0x38a64d){_0x3ee4f0[_0x01a4('0x23')]=_0x38a64d;if(_0x2a61ed[_0x01a4('0x36')][_0x01a4('0x47')]){_0xc5ea13[_0x01a4('0x48')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x01a4('0x49')](_0xc5ea13);})[_0x01a4('0x29')](function(_0x1868bd){_0x3ee4f0['rows']=_0x1868bd;return _0x3ee4f0;})[_0x01a4('0x29')](respondWithFilteredResult(_0x2c824f,_0xc5ea13))[_0x01a4('0x4a')](handleError(_0x2c824f,null));};exports[_0x01a4('0x4b')]=function(_0x7ea729,_0x26a75e){var _0x3c5ff3={'raw':![],'where':{'id':_0x7ea729['params']['id']}},_0xd8f6a2={};_0xd8f6a2[_0x01a4('0x34')]=_[_0x01a4('0x37')](db['AnalyticCustomReport'][_0x01a4('0x30')]);_0xd8f6a2[_0x01a4('0x36')]=_[_0x01a4('0x37')](_0x7ea729[_0x01a4('0x36')]);_0xd8f6a2[_0x01a4('0x38')]=_['intersection'](_0xd8f6a2[_0x01a4('0x34')],_0xd8f6a2[_0x01a4('0x36')]);_0x3c5ff3[_0x01a4('0x3a')]=_[_0x01a4('0x39')](_0xd8f6a2[_0x01a4('0x34')],qs[_0x01a4('0x3b')](_0x7ea729[_0x01a4('0x36')][_0x01a4('0x3b')]));_0x3c5ff3[_0x01a4('0x3a')]=_0x3c5ff3[_0x01a4('0x3a')][_0x01a4('0x3c')]?_0x3c5ff3[_0x01a4('0x3a')]:_0xd8f6a2[_0x01a4('0x34')];if(_0x7ea729['query'][_0x01a4('0x47')]){_0x3c5ff3[_0x01a4('0x48')]=[{'all':!![]}];}_0x3c5ff3=_[_0x01a4('0x43')]({},_0x3c5ff3,_0x7ea729[_0x01a4('0x45')]);return db['AnalyticCustomReport'][_0x01a4('0x4c')](_0x3c5ff3)['then'](handleEntityNotFound(_0x26a75e,null))[_0x01a4('0x29')](respondWithResult(_0x26a75e,null))[_0x01a4('0x4a')](handleError(_0x26a75e,null));};exports[_0x01a4('0x4d')]=function(_0x35636a,_0xe78275){return db[_0x01a4('0x46')][_0x01a4('0x4d')](_0x35636a[_0x01a4('0x4e')],{})[_0x01a4('0x29')](function(_0x43227c){var _0x144507=_0x35636a[_0x01a4('0x4f')]['get']({'plain':!![]});if(!_0x144507)throw new Error(_0x01a4('0x50'));if(_0x144507['role']===_0x01a4('0x4f')){var _0x628eef=_0x43227c[_0x01a4('0x2a')]({'plain':!![]});var _0x5d1306=_0x01a4('0x51');return db['UserProfileSection'][_0x01a4('0x4c')]({'where':{'name':_0x5d1306,'userProfileId':_0x144507[_0x01a4('0x52')]},'raw':!![]})[_0x01a4('0x29')](function(_0x29b732){if(_0x29b732&&_0x29b732[_0x01a4('0x53')]===0x0){return db[_0x01a4('0x2b')][_0x01a4('0x4d')]({'name':_0x628eef[_0x01a4('0x2d')],'resourceId':_0x628eef['id'],'type':_0x01a4('0x54'),'sectionId':_0x29b732['id']},{})['then'](function(){return _0x43227c;});}else{return _0x43227c;}})[_0x01a4('0x4a')](function(_0x251bc8){logger[_0x01a4('0x55')](_0x01a4('0x56'),_0x251bc8);throw _0x251bc8;});}return _0x43227c;})[_0x01a4('0x29')](respondWithResult(_0xe78275,0xc9))[_0x01a4('0x4a')](handleError(_0xe78275,null));};exports[_0x01a4('0x28')]=function(_0x89af78,_0x4cec74){if(_0x89af78[_0x01a4('0x4e')]['id']){delete _0x89af78['body']['id'];}return db[_0x01a4('0x46')]['find']({'where':{'id':_0x89af78[_0x01a4('0x57')]['id']}})['then'](handleEntityNotFound(_0x4cec74,null))[_0x01a4('0x29')](saveUpdates(_0x89af78[_0x01a4('0x4e')],null))[_0x01a4('0x29')](respondWithResult(_0x4cec74,null))[_0x01a4('0x4a')](handleError(_0x4cec74,null));};exports[_0x01a4('0x58')]=function(_0x327309,_0x36c3bd){return db['AnalyticCustomReport'][_0x01a4('0x4c')]({'where':{'id':_0x327309[_0x01a4('0x57')]['id']}})[_0x01a4('0x29')](handleEntityNotFound(_0x36c3bd,null))[_0x01a4('0x29')](removeEntity(_0x36c3bd,null))[_0x01a4('0x4a')](handleError(_0x36c3bd,null));};exports['preview']=function(_0x23a8b0,_0x259012){var _0xc2443=0xa;var _0xd00fbe=[_0x01a4('0x59'),_0x01a4('0x5a'),_0x01a4('0x5b'),_0x01a4('0x5c')];var _0x131b37={'SUM':_0x01a4('0x5d'),'COUNT':_0x01a4('0x5e'),'COUNT DISTINCT':_0x01a4('0x5f'),'MAX':_0x01a4('0x60'),'MIN':_0x01a4('0x61'),'AVG':_0x01a4('0x62'),'GROUP_CONCAT':_0x01a4('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x01a4('0x64')};var _0xabd6b3={'SEC_TO_TIME':_0x01a4('0x65'),'DATE':_0x01a4('0x66'),'HOUR':_0x01a4('0x67'),'ROUND':_0x01a4('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11204f=function(_0x1235d7){return!_[_0x01a4('0x69')](['IS\x20NULL',_0x01a4('0x6a'),'IS\x20EMPTY',_0x01a4('0x6b')],_0x1235d7);};var _0x1620bc=function(_0x1f1622){if(!_0x1f1622||!_0x1f1622[_0x01a4('0x6c')][_0x01a4('0x3c')]){return'';}for(var _0x5683d9='(',_0x4b5085=0x0;_0x4b5085<_0x1f1622[_0x01a4('0x6c')][_0x01a4('0x3c')];_0x4b5085+=0x1){_0x4b5085>0x0&&(_0x5683d9+='\x20'+_0x1f1622[_0x01a4('0x6d')]+'\x20');_0x5683d9+=_0x1f1622[_0x01a4('0x6c')][_0x4b5085][_0x01a4('0x6e')]?_0x1620bc(_0x1f1622[_0x01a4('0x6c')][_0x4b5085][_0x01a4('0x6e')]):_0x1f1622[_0x01a4('0x6c')][_0x4b5085][_0x01a4('0x6f')]+'\x20'+_0x1f1622[_0x01a4('0x6c')][_0x4b5085]['condition']+(_0x11204f(_0x1f1622['rules'][_0x4b5085][_0x01a4('0x70')])?'\x20'+_0x1f1622[_0x01a4('0x6c')][_0x4b5085]['value']:'');}return _0x5683d9+')';};var _0xaff13e={'where':{'id':_0x23a8b0[_0x01a4('0x57')]['id']}},_0xe0a06a,_0x4b2d73,_0x55d34c,_0x516b2b,_0x1dd208;_0xaff13e=_[_0x01a4('0x43')]({},_0xaff13e,_0x23a8b0[_0x01a4('0x45')]);return db['AnalyticCustomReport'][_0x01a4('0x4c')](_0xaff13e)[_0x01a4('0x29')](function(_0x278b0d){if(_0x278b0d){_0xe0a06a=_0x278b0d;return _0x278b0d['getFields']();}return null;})[_0x01a4('0x29')](function(_0x577158){if(_0x577158){if(!_0x577158[_0x01a4('0x3c')]){throw new db[(_0x01a4('0x71'))]['ValidationErrorItem'](_0x01a4('0x72'),0x193);}_0x4b2d73=_0x577158;return db[_0x01a4('0x73')][_0x01a4('0x49')]({'raw':!![]});}return null;})['then'](function(_0x4de351){if(_0x4de351){_0x55d34c=_['keyBy'](_0x4de351,'id');var _0x12f4dd;var _0x52013a=squel[_0x01a4('0x74')]();_0x52013a[_0x01a4('0x75')](_0xe0a06a[_0x01a4('0x76')]);for(var _0x3f91e8=0x0;_0x3f91e8<_0x4b2d73[_0x01a4('0x3c')];_0x3f91e8+=0x1){_0x12f4dd=_0x4b2d73[_0x3f91e8][_0x01a4('0x77')]?_0x55d34c[_0x4b2d73[_0x3f91e8][_0x01a4('0x77')]]['metric']:_0x4b2d73[_0x3f91e8][_0x01a4('0x6f')];_0x12f4dd=_0x4b2d73[_0x3f91e8][_0x01a4('0x78')]?_[_0x01a4('0x79')](_0x131b37[_0x4b2d73[_0x3f91e8][_0x01a4('0x78')]],'%s',_0x12f4dd):_0x12f4dd;_0x12f4dd=_0x4b2d73[_0x3f91e8][_0x01a4('0x7a')]?_[_0x01a4('0x79')](_0xabd6b3[_0x4b2d73[_0x3f91e8]['format']],'%s',_0x12f4dd):_0x12f4dd;if(_0x4b2d73[_0x3f91e8][_0x01a4('0x7b')]){_0x52013a['group'](_0x12f4dd);}_0x4b2d73[_0x3f91e8][_0x01a4('0x7c')]&&_0x52013a['order'](_0x12f4dd,_0x4b2d73[_0x3f91e8][_0x01a4('0x7c')]===_0x01a4('0x7d')?![]:!![]);_0x52013a[_0x01a4('0x6f')](_0x12f4dd,_0x4b2d73[_0x3f91e8]['alias']||_0x12f4dd);}if(_0xe0a06a[_0x01a4('0x7e')]){_0xe0a06a['joins']=JSON[_0x01a4('0x7f')](_0xe0a06a['joins']);for(var _0x3134e2=0x0;_0x3134e2<_0xe0a06a['joins'][_0x01a4('0x3c')];_0x3134e2+=0x1){if(_0xe0a06a['joins'][_0x3134e2][_0x01a4('0x32')]&&_[_0x01a4('0x69')](_0xd00fbe,_0xe0a06a[_0x01a4('0x7e')][_0x3134e2][_0x01a4('0x32')])&&_0xe0a06a[_0x01a4('0x7e')][_0x3134e2][_0x01a4('0x80')]&&_0xe0a06a['joins'][_0x3134e2][_0x01a4('0x81')]&&_0xe0a06a['joins'][_0x3134e2][_0x01a4('0x82')]){_0x52013a[_0xe0a06a['joins'][_0x3134e2]['type']](_0xe0a06a[_0x01a4('0x7e')][_0x3134e2][_0x01a4('0x81')],null,util[_0x01a4('0x7a')](_0x01a4('0x83'),_0xe0a06a[_0x01a4('0x76')],_0xe0a06a[_0x01a4('0x7e')][_0x3134e2][_0x01a4('0x80')],_0xe0a06a[_0x01a4('0x7e')][_0x3134e2]['foreignTable'],_0xe0a06a['joins'][_0x3134e2][_0x01a4('0x82')]));}}}if(_0xe0a06a[_0x01a4('0x84')]){_0xe0a06a[_0x01a4('0x84')]=JSON[_0x01a4('0x7f')](_0xe0a06a['conditions']);_0x52013a['where'](_0x1620bc(_0xe0a06a[_0x01a4('0x84')][_0x01a4('0x6e')]));}_0x1dd208=_0x52013a[_0x01a4('0x85')]();_0x52013a[_0x01a4('0x21')](_0xc2443);_0x52013a['offset'](0x0);logger[_0x01a4('0x86')](_0x01a4('0x87'),_0x52013a[_0x01a4('0x88')]());return dbH[_0x01a4('0x89')][_0x01a4('0x36')](_0x52013a[_0x01a4('0x88')](),{'type':dbH[_0x01a4('0x89')][_0x01a4('0x8a')][_0x01a4('0x8b')]});}})['then'](respondWithResult(_0x259012,null))[_0x01a4('0x4a')](handleError(_0x259012,null));};function runReport(_0x347182,_0x263486,_0x4a6257){var _0x33a993=_0x263486[_0x01a4('0x2d')];var _0x297bd9=0xa;var _0x24f3e5=[_0x01a4('0x59'),_0x01a4('0x5a'),'right_join',_0x01a4('0x5c')];var _0x513b4c={'SUM':'SUM(%s)','COUNT':_0x01a4('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x01a4('0x60'),'MIN':_0x01a4('0x61'),'AVG':_0x01a4('0x62'),'GROUP_CONCAT':_0x01a4('0x63'),'GROUP_CONCAT ASC':_0x01a4('0x8c'),'GROUP_CONCAT DESC':_0x01a4('0x64')};var _0x470f6d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x01a4('0x66'),'HOUR':'HOUR(%s)','ROUND':_0x01a4('0x68'),'UNIX_TIMESTAMP':_0x01a4('0x8d')};var _0x1185c5=function(_0x4e2393){return!_[_0x01a4('0x69')]([_0x01a4('0x8e'),'IS\x20NOT\x20NULL',_0x01a4('0x8f'),_0x01a4('0x6b')],_0x4e2393);};var _0x5d3d57=function(_0x2784d2){if(!_0x2784d2||!_0x2784d2[_0x01a4('0x6c')][_0x01a4('0x3c')]){return'';}for(var _0x1eaec3='(',_0x5569e3=0x0;_0x5569e3<_0x2784d2[_0x01a4('0x6c')][_0x01a4('0x3c')];_0x5569e3+=0x1){_0x5569e3>0x0&&(_0x1eaec3+='\x20'+_0x2784d2[_0x01a4('0x6d')]+'\x20');_0x1eaec3+=_0x2784d2[_0x01a4('0x6c')][_0x5569e3][_0x01a4('0x6e')]?_0x5d3d57(_0x2784d2['rules'][_0x5569e3]['group']):_0x2784d2[_0x01a4('0x6c')][_0x5569e3]['field']+'\x20'+_0x2784d2[_0x01a4('0x6c')][_0x5569e3][_0x01a4('0x70')]+(_0x1185c5(_0x2784d2[_0x01a4('0x6c')][_0x5569e3][_0x01a4('0x70')])?'\x20'+_0x2784d2[_0x01a4('0x6c')][_0x5569e3]['value']:'');}return _0x1eaec3+')';};var _0xd0aefc={'where':{'id':_0x347182['id']}},_0x1cde98,_0x2320cd,_0x548821,_0x1d01f6,_0x247271;_0xd0aefc=_[_0x01a4('0x43')]({},_0xd0aefc,_0x4a6257);return db['AnalyticCustomReport'][_0x01a4('0x4c')](_0xd0aefc)[_0x01a4('0x29')](function(_0x13aa65){if(_0x13aa65){_0x1cde98=_0x13aa65;return _0x13aa65[_0x01a4('0x90')]();}return null;})[_0x01a4('0x29')](function(_0x29d386){if(_0x29d386){if(!_0x29d386[_0x01a4('0x3c')]){throw new db['Sequelize'][(_0x01a4('0x91'))](_0x01a4('0x72'),0x193);}_0x2320cd=_0x29d386;return db[_0x01a4('0x73')][_0x01a4('0x49')]({'raw':!![]});}return null;})[_0x01a4('0x29')](function(_0x22a8a3){if(_0x22a8a3){_0x548821=_['keyBy'](_0x22a8a3,'id');var _0x22ab5a;var _0x9384d9=squel[_0x01a4('0x74')]();_0x9384d9['from'](_0x1cde98[_0x01a4('0x76')]);for(var _0x105bf2=0x0;_0x105bf2<_0x2320cd[_0x01a4('0x3c')];_0x105bf2+=0x1){_0x22ab5a=_0x2320cd[_0x105bf2][_0x01a4('0x77')]?_0x548821[_0x2320cd[_0x105bf2][_0x01a4('0x77')]]['metric']:_0x2320cd[_0x105bf2][_0x01a4('0x6f')];_0x22ab5a=_0x2320cd[_0x105bf2][_0x01a4('0x78')]?_['replace'](_0x513b4c[_0x2320cd[_0x105bf2][_0x01a4('0x78')]],'%s',_0x22ab5a):_0x22ab5a;_0x22ab5a=_0x2320cd[_0x105bf2][_0x01a4('0x7a')]?_[_0x01a4('0x79')](_0x470f6d[_0x2320cd[_0x105bf2]['format']],'%s',_0x22ab5a):_0x22ab5a;if(_0x2320cd[_0x105bf2][_0x01a4('0x7b')]){_0x9384d9[_0x01a4('0x6e')](_0x22ab5a);}_0x2320cd[_0x105bf2][_0x01a4('0x7c')]&&_0x9384d9[_0x01a4('0x92')](_0x22ab5a,_0x2320cd[_0x105bf2][_0x01a4('0x7c')]==='DESC'?![]:!![]);_0x9384d9[_0x01a4('0x6f')](_0x22ab5a,_0x2320cd[_0x105bf2][_0x01a4('0x93')]||_0x22ab5a);}if(_0x1cde98['joins']){_0x1cde98[_0x01a4('0x7e')]=JSON[_0x01a4('0x7f')](_0x1cde98[_0x01a4('0x7e')]);for(var _0x365276=0x0;_0x365276<_0x1cde98[_0x01a4('0x7e')][_0x01a4('0x3c')];_0x365276+=0x1){if(_0x1cde98['joins'][_0x365276][_0x01a4('0x32')]&&_[_0x01a4('0x69')](_0x24f3e5,_0x1cde98[_0x01a4('0x7e')][_0x365276]['type'])&&_0x1cde98[_0x01a4('0x7e')][_0x365276][_0x01a4('0x80')]&&_0x1cde98[_0x01a4('0x7e')][_0x365276][_0x01a4('0x81')]&&_0x1cde98['joins'][_0x365276][_0x01a4('0x82')]){_0x9384d9[_0x1cde98['joins'][_0x365276][_0x01a4('0x32')]](_0x1cde98[_0x01a4('0x7e')][_0x365276]['foreignTable'],null,util[_0x01a4('0x7a')](_0x01a4('0x83'),_0x1cde98[_0x01a4('0x76')],_0x1cde98[_0x01a4('0x7e')][_0x365276]['parentKey'],_0x1cde98['joins'][_0x365276]['foreignTable'],_0x1cde98['joins'][_0x365276][_0x01a4('0x82')]));}}}if(_0x1cde98['conditions']){_0x1cde98[_0x01a4('0x84')]=JSON[_0x01a4('0x7f')](_0x1cde98[_0x01a4('0x84')]);_0x9384d9[_0x01a4('0x40')](_0x5d3d57(_0x1cde98[_0x01a4('0x84')][_0x01a4('0x6e')]));}_0x247271=_0x9384d9['clone']();_0x9384d9[_0x01a4('0x21')](_0x297bd9);_0x9384d9[_0x01a4('0x22')](0x0);return;}})[_0x01a4('0x29')](function(){if(_0x263486[_0x01a4('0x94')]===_0x01a4('0x95')){return null;}var _0x58dd51=_[_0x01a4('0x43')](_0x263486,{'name':_0x263486['fullPath']||_0x263486[_0x01a4('0x2d')]||_0x1cde98['name'],'basename':_0x33a993,'savename':util['format'](_0x01a4('0x96'),_0x263486[_0x01a4('0x2d')]||_0x1cde98[_0x01a4('0x2d')],require(_0x01a4('0x97'))[_0x01a4('0x98')](0x4),_0x263486[_0x01a4('0x94')]||_0x01a4('0x99')),'reportId':_0x1cde98['id'],'reportType':'custom'});return db[_0x01a4('0x9a')][_0x01a4('0x4d')](_0x58dd51,{'raw':!![]});})[_0x01a4('0x29')](function(_0x2656b1){if(_0x1cde98[_0x01a4('0x76')]===_0x01a4('0x9b')){_0x247271[_0x01a4('0x40')](_0x1cde98[_0x01a4('0x76')]+_0x01a4('0x9c'),_0x263486[_0x01a4('0x9d')],_0x263486[_0x01a4('0x9e')]);}else{_0x247271[_0x01a4('0x40')](_0x1cde98[_0x01a4('0x76')]+_0x01a4('0x9f'),_0x263486[_0x01a4('0x9d')],_0x263486['endDate']);}if(_0x2656b1){logger[_0x01a4('0xa0')](_0x01a4('0xa1'),_0x247271[_0x01a4('0x88')]());require(_0x01a4('0xa2'))['fork'](path['join'](__dirname,_0x01a4('0xa3'),_0x2656b1[_0x01a4('0x94')]),[_0x2656b1['id'],_0x247271[_0x01a4('0x88')](),path[_0x01a4('0x59')](__dirname,_0x01a4('0xa4'),_0x2656b1[_0x01a4('0xa5')]),_0x33a993]);return _0x2656b1;}else{var _0x1af3d5=squel[_0x01a4('0x74')]();_0x1af3d5[_0x01a4('0x75')]('('+_0x247271[_0x01a4('0x88')]()+')',_0x01a4('0xa6'));_0x1af3d5[_0x01a4('0x6f')](_0x01a4('0xa7'),_0x01a4('0x23'));_0x247271[_0x01a4('0x21')](_0x263486[_0x01a4('0x21')]||_0x297bd9);_0x247271[_0x01a4('0x22')](_0x263486[_0x01a4('0x22')]||0x0);return dbH[_0x01a4('0x89')][_0x01a4('0x36')](_0x1af3d5[_0x01a4('0x88')](),{'type':dbH[_0x01a4('0x89')][_0x01a4('0x8a')][_0x01a4('0x8b')]})['then'](function(_0x3ca6ab){if(!_0x3ca6ab[_0x01a4('0x3c')]){_0x1d01f6=0x0;}else{_0x1d01f6=_0x3ca6ab[0x0][_0x01a4('0x23')]||0x0;}return dbH[_0x01a4('0x89')]['query'](_0x247271['toString'](),{'type':dbH[_0x01a4('0x89')][_0x01a4('0x8a')][_0x01a4('0x8b')]});})['then'](function(_0x4e001b){return{'rows':_0x4e001b||[],'count':_0x1d01f6};});}});}exports[_0x01a4('0xa8')]=function(_0x4cf1e8,_0x28d6a5){return runReport(_0x4cf1e8[_0x01a4('0x57')],_0x4cf1e8[_0x01a4('0x36')],_0x4cf1e8[_0x01a4('0x45')])[_0x01a4('0x29')](respondWithResult(_0x28d6a5,null))[_0x01a4('0x4a')](handleError(_0x28d6a5,null));};exports['runReport']=runReport;exports[_0x01a4('0x36')]=function(_0xf46ecb,_0x5bfe71){var _0x105f99=0xa;var _0x57343f=[_0x01a4('0x59'),_0x01a4('0x5a'),_0x01a4('0x5b'),_0x01a4('0x5c')];var _0x3a67f6={'SUM':_0x01a4('0x5d'),'COUNT':_0x01a4('0x5e'),'COUNT DISTINCT':_0x01a4('0x5f'),'MAX':_0x01a4('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x01a4('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x01a4('0x64')};var _0x91248b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x01a4('0x66'),'HOUR':_0x01a4('0x67'),'ROUND':_0x01a4('0x68'),'UNIX_TIMESTAMP':_0x01a4('0x8d')};var _0x3adc67=function(_0x17f8f1){return!_[_0x01a4('0x69')]([_0x01a4('0x8e'),_0x01a4('0x6a'),_0x01a4('0x8f'),_0x01a4('0x6b')],_0x17f8f1);};var _0x2a445c=function(_0x1b446c){if(!_0x1b446c||!_0x1b446c[_0x01a4('0x6c')]['length']){return'';}for(var _0x46f7b5='(',_0x56c4e7=0x0;_0x56c4e7<_0x1b446c['rules'][_0x01a4('0x3c')];_0x56c4e7+=0x1){_0x56c4e7>0x0&&(_0x46f7b5+='\x20'+_0x1b446c['operator']+'\x20');_0x46f7b5+=_0x1b446c[_0x01a4('0x6c')][_0x56c4e7]['group']?_0x2a445c(_0x1b446c['rules'][_0x56c4e7][_0x01a4('0x6e')]):_0x1b446c['rules'][_0x56c4e7][_0x01a4('0x6f')]+'\x20'+_0x1b446c[_0x01a4('0x6c')][_0x56c4e7][_0x01a4('0x70')]+(_0x3adc67(_0x1b446c[_0x01a4('0x6c')][_0x56c4e7][_0x01a4('0x70')])?'\x20'+_0x1b446c['rules'][_0x56c4e7]['value']:'');}return _0x46f7b5+')';};var _0x52f8fb={'where':{'id':_0xf46ecb[_0x01a4('0x57')]['id']}},_0x5a700e,_0x555e4b,_0x5b4689,_0x11d909,_0x33cf8a;_0x52f8fb=_[_0x01a4('0x43')]({},_0x52f8fb,_0xf46ecb[_0x01a4('0x45')]);return db['AnalyticCustomReport'][_0x01a4('0x4c')](_0x52f8fb)[_0x01a4('0x29')](function(_0x5458cb){if(_0x5458cb){_0x5a700e=_0x5458cb;return _0x5458cb[_0x01a4('0x90')]();}return null;})['then'](function(_0x3eb1fa){if(_0x3eb1fa){if(!_0x3eb1fa['length']){throw new db[(_0x01a4('0x71'))][(_0x01a4('0x91'))](_0x01a4('0x72'),0x193);}_0x555e4b=_0x3eb1fa;return db[_0x01a4('0x73')][_0x01a4('0x49')]({'raw':!![]});}return null;})[_0x01a4('0x29')](function(_0x57c2dc){if(_0x57c2dc){_0x5b4689=_[_0x01a4('0xa9')](_0x57c2dc,'id');var _0x58bd11;var _0x278e78=squel[_0x01a4('0x74')]();_0x278e78[_0x01a4('0x75')](_0x5a700e[_0x01a4('0x76')]);for(var _0x5f0dfb=0x0;_0x5f0dfb<_0x555e4b[_0x01a4('0x3c')];_0x5f0dfb+=0x1){_0x58bd11=_0x555e4b[_0x5f0dfb][_0x01a4('0x77')]?_0x5b4689[_0x555e4b[_0x5f0dfb][_0x01a4('0x77')]][_0x01a4('0xaa')]:_0x555e4b[_0x5f0dfb][_0x01a4('0x6f')];_0x58bd11=_0x555e4b[_0x5f0dfb][_0x01a4('0x78')]?_[_0x01a4('0x79')](_0x3a67f6[_0x555e4b[_0x5f0dfb][_0x01a4('0x78')]],'%s',_0x58bd11):_0x58bd11;_0x58bd11=_0x555e4b[_0x5f0dfb][_0x01a4('0x7a')]?_[_0x01a4('0x79')](_0x91248b[_0x555e4b[_0x5f0dfb][_0x01a4('0x7a')]],'%s',_0x58bd11):_0x58bd11;if(_0x555e4b[_0x5f0dfb][_0x01a4('0x7b')]){_0x278e78[_0x01a4('0x6e')](_0x58bd11);}_0x555e4b[_0x5f0dfb][_0x01a4('0x7c')]&&_0x278e78[_0x01a4('0x92')](_0x58bd11,_0x555e4b[_0x5f0dfb][_0x01a4('0x7c')]===_0x01a4('0x7d')?![]:!![]);_0x278e78[_0x01a4('0x6f')](_0x58bd11,_0x555e4b[_0x5f0dfb]['alias']||_0x58bd11);}if(_0x5a700e[_0x01a4('0x7e')]){_0x5a700e[_0x01a4('0x7e')]=JSON[_0x01a4('0x7f')](_0x5a700e[_0x01a4('0x7e')]);for(var _0x2dd49f=0x0;_0x2dd49f<_0x5a700e[_0x01a4('0x7e')][_0x01a4('0x3c')];_0x2dd49f+=0x1){if(_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x32')]&&_[_0x01a4('0x69')](_0x57343f,_0x5a700e[_0x01a4('0x7e')][_0x2dd49f]['type'])&&_0x5a700e[_0x01a4('0x7e')][_0x2dd49f]['parentKey']&&_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x81')]&&_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x82')]){_0x278e78[_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x32')]](_0x5a700e[_0x01a4('0x7e')][_0x2dd49f]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5a700e[_0x01a4('0x76')],_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x80')],_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x81')],_0x5a700e[_0x01a4('0x7e')][_0x2dd49f][_0x01a4('0x82')]));}}}if(_0x5a700e[_0x01a4('0x84')]){_0x5a700e[_0x01a4('0x84')]=JSON['parse'](_0x5a700e[_0x01a4('0x84')]);_0x278e78['where'](_0x2a445c(_0x5a700e[_0x01a4('0x84')][_0x01a4('0x6e')]));}_0x33cf8a=_0x278e78[_0x01a4('0x85')]();_0x278e78[_0x01a4('0x21')](_0x105f99);_0x278e78['offset'](0x0);logger[_0x01a4('0x86')](_0x01a4('0x87'),_0x278e78['toString']());return dbH[_0x01a4('0x89')]['query'](_0x278e78[_0x01a4('0x88')](),{'type':dbH[_0x01a4('0x89')][_0x01a4('0x8a')][_0x01a4('0x8b')]});}})[_0x01a4('0x29')](function(){return{'sql':_0x33cf8a[_0x01a4('0x88')]()};})['then'](respondWithResult(_0x5bfe71,null))[_0x01a4('0x4a')](handleError(_0x5bfe71,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 09987be..a5450b7 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 _0x9eb5=['lodash','util','api','moment','path','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x45b08c,_0x3d6760){var _0x1ff67a=function(_0x458284){while(--_0x458284){_0x45b08c['push'](_0x45b08c['shift']());}};_0x1ff67a(++_0x3d6760);}(_0x9eb5,0x1d0));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x59eb('0x0'));var util=require(_0x59eb('0x1'));var logger=require('../../config/logger')(_0x59eb('0x2'));var moment=require(_0x59eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x59eb('0x4'));var rimraf=require('rimraf');var config=require(_0x59eb('0x5'));var attributes=require(_0x59eb('0x6'));module[_0x59eb('0x7')]=function(_0x28ced9,_0x44ef30){return _0x28ced9['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39b3=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports'];(function(_0x5e7357,_0x29e8c6){var _0x3aac6b=function(_0x403d54){while(--_0x403d54){_0x5e7357['push'](_0x5e7357['shift']());}};_0x3aac6b(++_0x29e8c6);}(_0x39b3,0xf2));var _0x339b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x39b3[_0x5783f4];return _0x28e380;};'use strict';var _=require('lodash');var util=require(_0x339b('0x0'));var logger=require('../../config/logger')(_0x339b('0x1'));var moment=require(_0x339b('0x2'));var BPromise=require(_0x339b('0x3'));var rp=require(_0x339b('0x4'));var fs=require('fs');var path=require(_0x339b('0x5'));var rimraf=require(_0x339b('0x6'));var config=require(_0x339b('0x7'));var attributes=require(_0x339b('0x8'));module[_0x339b('0x9')]=function(_0x3ed28f,_0x150276){return _0x3ed28f['define']('AnalyticCustomReport',attributes,{'tableName':_0x339b('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index f73963e..6f80c76 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 _0xf93e=['message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x42fbdd,_0xbb21a3){var _0x525b95=function(_0x330481){while(--_0x330481){_0x42fbdd['push'](_0x42fbdd['shift']());}};_0x525b95(++_0xbb21a3);}(_0xf93e,0x1a4));var _0xef93=function(_0x16e55b,_0xe38a66){_0x16e55b=_0x16e55b-0x0;var _0x2b6c23=_0xf93e[_0x16e55b];return _0x2b6c23;};'use strict';var _=require('lodash');var util=require(_0xef93('0x0'));var moment=require(_0xef93('0x1'));var BPromise=require(_0xef93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xef93('0x4'));var logger=require(_0xef93('0x5'))(_0xef93('0x6'));var config=require('../../config/environment');var jayson=require(_0xef93('0x7'));var client=jayson[_0xef93('0x8')][_0xef93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a0817,_0x58442f,_0x584cd2){return new BPromise(function(_0x3e3a3c,_0x3cf04f){return client[_0xef93('0xa')](_0x5a0817,_0x584cd2)[_0xef93('0xb')](function(_0x492045){logger[_0xef93('0xc')](_0xef93('0xd'),_0x58442f,_0xef93('0xe'));logger[_0xef93('0xf')](_0xef93('0x10'),_0x58442f,'request\x20sent',JSON[_0xef93('0x11')](_0x492045));if(_0x492045[_0xef93('0x12')]){if(_0x492045[_0xef93('0x12')][_0xef93('0x13')]===0x1f4){logger[_0xef93('0x12')](_0xef93('0xd'),_0x58442f,_0x492045['error'][_0xef93('0x14')]);return _0x3cf04f(_0x492045['error'][_0xef93('0x14')]);}logger[_0xef93('0x12')](_0xef93('0xd'),_0x58442f,_0x492045[_0xef93('0x12')][_0xef93('0x14')]);return _0x3e3a3c(_0x492045[_0xef93('0x12')]['message']);}else{logger[_0xef93('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x58442f,_0xef93('0xe'));_0x3e3a3c(_0x492045['result'][_0xef93('0x14')]);}})[_0xef93('0x15')](function(_0x1ae189){logger[_0xef93('0x12')](_0xef93('0xd'),_0x58442f,_0x1ae189);_0x3cf04f(_0x1ae189);});});} \ No newline at end of file +var _0x5e9a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring'];(function(_0x284311,_0x1e89f5){var _0x1f2969=function(_0x222c7e){while(--_0x222c7e){_0x284311['push'](_0x284311['shift']());}};_0x1f2969(++_0x1e89f5);}(_0x5e9a,0x155));var _0xa5e9=function(_0x1de88d,_0x2fc37e){_0x1de88d=_0x1de88d-0x0;var _0x41bfea=_0x5e9a[_0x1de88d];return _0x41bfea;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var moment=require(_0xa5e9('0x1'));var BPromise=require(_0xa5e9('0x2'));var rs=require(_0xa5e9('0x3'));var fs=require('fs');var Redis=require(_0xa5e9('0x4'));var db=require(_0xa5e9('0x5'))['db'];var utils=require(_0xa5e9('0x6'));var logger=require(_0xa5e9('0x7'))(_0xa5e9('0x8'));var config=require(_0xa5e9('0x9'));var jayson=require(_0xa5e9('0xa'));var client=jayson[_0xa5e9('0xb')][_0xa5e9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x473dee,_0x8deaac,_0xaac9d8){return new BPromise(function(_0x25c9fc,_0x46a081){return client[_0xa5e9('0xd')](_0x473dee,_0xaac9d8)[_0xa5e9('0xe')](function(_0x2c9f30){logger[_0xa5e9('0xf')](_0xa5e9('0x10'),_0x8deaac,_0xa5e9('0x11'));logger[_0xa5e9('0x12')](_0xa5e9('0x13'),_0x8deaac,_0xa5e9('0x11'),JSON['stringify'](_0x2c9f30));if(_0x2c9f30[_0xa5e9('0x14')]){if(_0x2c9f30['error']['code']===0x1f4){logger[_0xa5e9('0x14')](_0xa5e9('0x10'),_0x8deaac,_0x2c9f30[_0xa5e9('0x14')][_0xa5e9('0x15')]);return _0x46a081(_0x2c9f30[_0xa5e9('0x14')][_0xa5e9('0x15')]);}logger[_0xa5e9('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8deaac,_0x2c9f30['error']['message']);return _0x25c9fc(_0x2c9f30['error'][_0xa5e9('0x15')]);}else{logger[_0xa5e9('0xf')](_0xa5e9('0x10'),_0x8deaac,'request\x20sent');_0x25c9fc(_0x2c9f30[_0xa5e9('0x16')][_0xa5e9('0x15')]);}})['catch'](function(_0x5cc3cd){logger[_0xa5e9('0x14')](_0xa5e9('0x10'),_0x8deaac,_0x5cc3cd);_0x46a081(_0x5cc3cd);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 87e665c..dae951d 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 _0x9ef9=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update'];(function(_0x8e5873,_0x435dd3){var _0x3c2e6c=function(_0x1356a5){while(--_0x1356a5){_0x8e5873['push'](_0x8e5873['shift']());}};_0x3c2e6c(++_0x435dd3);}(_0x9ef9,0x16a));var _0x99ef=function(_0x3dea14,_0x384599){_0x3dea14=_0x3dea14-0x0;var _0x4d2176=_0x9ef9[_0x3dea14];return _0x4d2176;};'use strict';var multer=require(_0x99ef('0x0'));var util=require(_0x99ef('0x1'));var path=require(_0x99ef('0x2'));var timeout=require(_0x99ef('0x3'));var express=require(_0x99ef('0x4'));var router=express['Router']();var fs_extra=require(_0x99ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x99ef('0x6'));var config=require('../../config/environment');var controller=require(_0x99ef('0x7'));router[_0x99ef('0x8')]('/',auth[_0x99ef('0x9')](),controller['index']);router[_0x99ef('0x8')](_0x99ef('0xa'),auth[_0x99ef('0x9')](),controller[_0x99ef('0xb')]);router[_0x99ef('0x8')](_0x99ef('0xc'),auth[_0x99ef('0x9')](),controller[_0x99ef('0xd')]);router[_0x99ef('0x8')](_0x99ef('0xe'),auth[_0x99ef('0x9')](),controller[_0x99ef('0xf')]);router[_0x99ef('0x8')](_0x99ef('0x10'),auth[_0x99ef('0x9')](),controller[_0x99ef('0x11')]);router[_0x99ef('0x12')]('/',auth[_0x99ef('0x9')](),controller[_0x99ef('0x13')]);router[_0x99ef('0x14')](_0x99ef('0xa'),auth[_0x99ef('0x9')](),controller[_0x99ef('0x15')]);router[_0x99ef('0x16')]('/:id',auth[_0x99ef('0x9')](),controller[_0x99ef('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe0a0=['/:id','show','/:id/preview','/:id/run','query','post','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x304fd3,_0x3fe8c9){var _0x99c2ba=function(_0xa14734){while(--_0xa14734){_0x304fd3['push'](_0x304fd3['shift']());}};_0x99c2ba(++_0x3fe8c9);}(_0xe0a0,0xec));var _0x0e0a=function(_0xcef3cf,_0x5e2d18){_0xcef3cf=_0xcef3cf-0x0;var _0x1de08e=_0xe0a0[_0xcef3cf];return _0x1de08e;};'use strict';var multer=require(_0x0e0a('0x0'));var util=require(_0x0e0a('0x1'));var path=require('path');var timeout=require(_0x0e0a('0x2'));var express=require('express');var router=express[_0x0e0a('0x3')]();var fs_extra=require(_0x0e0a('0x4'));var auth=require(_0x0e0a('0x5'));var interaction=require(_0x0e0a('0x6'));var config=require('../../config/environment');var controller=require(_0x0e0a('0x7'));router[_0x0e0a('0x8')]('/',auth[_0x0e0a('0x9')](),controller[_0x0e0a('0xa')]);router[_0x0e0a('0x8')](_0x0e0a('0xb'),auth[_0x0e0a('0x9')](),controller[_0x0e0a('0xc')]);router[_0x0e0a('0x8')](_0x0e0a('0xd'),auth[_0x0e0a('0x9')](),controller['preview']);router[_0x0e0a('0x8')](_0x0e0a('0xe'),auth[_0x0e0a('0x9')](),controller['run']);router['get']('/:id/query',auth[_0x0e0a('0x9')](),controller[_0x0e0a('0xf')]);router[_0x0e0a('0x10')]('/',auth[_0x0e0a('0x9')](),controller['create']);router['put'](_0x0e0a('0xb'),auth[_0x0e0a('0x9')](),controller[_0x0e0a('0x11')]);router[_0x0e0a('0x12')]('/:id',auth[_0x0e0a('0x9')](),controller['destroy']);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 36c0f67..6935718 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 _0xbd51=['sequelize','STRING'];(function(_0x5d28e2,_0x1e2167){var _0x5d748e=function(_0x18ed5d){while(--_0x18ed5d){_0x5d28e2['push'](_0x5d28e2['shift']());}};_0x5d748e(++_0x1e2167);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x86984a,_0x2d2daf){_0x86984a=_0x86984a-0x0;var _0x46c62e=_0xbd51[_0x86984a];return _0x46c62e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0xbaa13a,_0x1bebea){var _0x3a3642=function(_0x234fc7){while(--_0x234fc7){_0xbaa13a['push'](_0xbaa13a['shift']());}};_0x3a3642(++_0x1bebea);}(_0x5496,0x175));var _0x6549=function(_0x329c53,_0x124f3d){_0x329c53=_0x329c53-0x0;var _0x25f208=_0x5496[_0x329c53];return _0x25f208;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2e080f9..19347ee 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x123f10,_0x402741){var _0x56bc22=function(_0xab7c13){while(--_0xab7c13){_0x123f10['push'](_0x123f10['shift']());}};_0x56bc22(++_0x402741);}(_0x5fc3,0xa8));var _0x35fc=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x5fc3[_0xc8db6b];return _0x12cb81;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','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','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabce[_0x2dafbe];return _0x58a45a;};'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'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5bac195..8d8eed9 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 _0x5862=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x4f1b35,_0x122eba){var _0x5c7fc5=function(_0x5e4e13){while(--_0x5e4e13){_0x4f1b35['push'](_0x4f1b35['shift']());}};_0x5c7fc5(++_0x122eba);}(_0x5862,0x6e));var _0x2586=function(_0x14d6bb,_0x388b8e){_0x14d6bb=_0x14d6bb-0x0;var _0x191d22=_0x5862[_0x14d6bb];return _0x191d22;};'use strict';var _=require(_0x2586('0x0'));var util=require(_0x2586('0x1'));var logger=require(_0x2586('0x2'))('api');var moment=require(_0x2586('0x3'));var BPromise=require(_0x2586('0x4'));var rp=require(_0x2586('0x5'));var fs=require('fs');var path=require(_0x2586('0x6'));var rimraf=require(_0x2586('0x7'));var config=require(_0x2586('0x8'));var attributes=require(_0x2586('0x9'));module[_0x2586('0xa')]=function(_0x12d49c,_0x35ed1e){return _0x12d49c[_0x2586('0xb')](_0x2586('0xc'),attributes,{'tableName':_0x2586('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe069=['request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','moment','bluebird'];(function(_0x1afadf,_0x357131){var _0x3a3b4a=function(_0x224753){while(--_0x224753){_0x1afadf['push'](_0x1afadf['shift']());}};_0x3a3b4a(++_0x357131);}(_0xe069,0x140));var _0x9e06=function(_0x248fd6,_0x203fe9){_0x248fd6=_0x248fd6-0x0;var _0x869561=_0xe069[_0x248fd6];return _0x869561;};'use strict';var _=require(_0x9e06('0x0'));var util=require(_0x9e06('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e06('0x2'));var BPromise=require(_0x9e06('0x3'));var rp=require(_0x9e06('0x4'));var fs=require('fs');var path=require(_0x9e06('0x5'));var rimraf=require(_0x9e06('0x6'));var config=require('../../config/environment');var attributes=require(_0x9e06('0x7'));module[_0x9e06('0x8')]=function(_0x5d8157,_0xe8ceb7){return _0x5d8157[_0x9e06('0x9')](_0x9e06('0xa'),attributes,{'tableName':_0x9e06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 480bae1..a2f55c6 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 _0x74ed=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x12c7e5,_0x4f82a7){var _0x266fe0=function(_0xe76c9){while(--_0xe76c9){_0x12c7e5['push'](_0x12c7e5['shift']());}};_0x266fe0(++_0x4f82a7);}(_0x74ed,0xe2));var _0xd74e=function(_0x23b857,_0x20d901){_0x23b857=_0x23b857-0x0;var _0x46fec1=_0x74ed[_0x23b857];return _0x46fec1;};'use strict';var _=require(_0xd74e('0x0'));var util=require(_0xd74e('0x1'));var moment=require(_0xd74e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd74e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd74e('0x4'));var jayson=require(_0xd74e('0x5'));var client=jayson[_0xd74e('0x6')][_0xd74e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c7309,_0x45d736,_0x1fe041){return new BPromise(function(_0xb495cf,_0x464db4){return client['request'](_0x4c7309,_0x1fe041)[_0xd74e('0x8')](function(_0x365802){logger[_0xd74e('0x9')](_0xd74e('0xa'),_0x45d736,_0xd74e('0xb'));logger[_0xd74e('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x45d736,'request\x20sent',JSON[_0xd74e('0xd')](_0x365802));if(_0x365802[_0xd74e('0xe')]){if(_0x365802['error'][_0xd74e('0xf')]===0x1f4){logger[_0xd74e('0xe')](_0xd74e('0xa'),_0x45d736,_0x365802[_0xd74e('0xe')][_0xd74e('0x10')]);return _0x464db4(_0x365802[_0xd74e('0xe')][_0xd74e('0x10')]);}logger[_0xd74e('0xe')](_0xd74e('0xa'),_0x45d736,_0x365802[_0xd74e('0xe')]['message']);return _0xb495cf(_0x365802[_0xd74e('0xe')][_0xd74e('0x10')]);}else{logger['info'](_0xd74e('0xa'),_0x45d736,_0xd74e('0xb'));_0xb495cf(_0x365802[_0xd74e('0x11')][_0xd74e('0x10')]);}})['catch'](function(_0xcf7bc6){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x45d736,_0xcf7bc6);_0x464db4(_0xcf7bc6);});});} \ No newline at end of file +var _0x2cd5=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2cd5,0x182));var _0x52cd=function(_0xa39f48,_0x1f27be){_0xa39f48=_0xa39f48-0x0;var _0x75e45c=_0x2cd5[_0xa39f48];return _0x75e45c;};'use strict';var _=require(_0x52cd('0x0'));var util=require('util');var moment=require(_0x52cd('0x1'));var BPromise=require(_0x52cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52cd('0x4'));var config=require(_0x52cd('0x5'));var jayson=require(_0x52cd('0x6'));var client=jayson[_0x52cd('0x7')][_0x52cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55c57c,_0x3cbe07,_0x5b478d){return new BPromise(function(_0x3778e6,_0x35a1e1){return client[_0x52cd('0x9')](_0x55c57c,_0x5b478d)[_0x52cd('0xa')](function(_0x46cf79){logger[_0x52cd('0xb')](_0x52cd('0xc'),_0x3cbe07,_0x52cd('0xd'));logger[_0x52cd('0xe')](_0x52cd('0xf'),_0x3cbe07,'request\x20sent',JSON['stringify'](_0x46cf79));if(_0x46cf79[_0x52cd('0x10')]){if(_0x46cf79['error']['code']===0x1f4){logger['error'](_0x52cd('0xc'),_0x3cbe07,_0x46cf79['error'][_0x52cd('0x11')]);return _0x35a1e1(_0x46cf79[_0x52cd('0x10')][_0x52cd('0x11')]);}logger[_0x52cd('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3cbe07,_0x46cf79['error']['message']);return _0x3778e6(_0x46cf79[_0x52cd('0x10')][_0x52cd('0x11')]);}else{logger[_0x52cd('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3cbe07,_0x52cd('0xd'));_0x3778e6(_0x46cf79[_0x52cd('0x12')][_0x52cd('0x11')]);}})[_0x52cd('0x13')](function(_0x11dd30){logger[_0x52cd('0x10')](_0x52cd('0xc'),_0x3cbe07,_0x11dd30);_0x35a1e1(_0x11dd30);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 606d533..09a3a4b 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 _0x47a1=['/:id','show','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x47a1,0xbd));var _0x147a=function(_0x1496b4,_0x271dd6){_0x1496b4=_0x1496b4-0x0;var _0x534d49=_0x47a1[_0x1496b4];return _0x534d49;};'use strict';var multer=require(_0x147a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x147a('0x1'));var express=require('express');var router=express[_0x147a('0x2')]();var fs_extra=require(_0x147a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x147a('0x4'));var config=require(_0x147a('0x5'));var controller=require(_0x147a('0x6'));router[_0x147a('0x7')]('/',auth[_0x147a('0x8')](),controller['index']);router[_0x147a('0x7')](_0x147a('0x9'),auth[_0x147a('0x8')](),controller[_0x147a('0xa')]);router[_0x147a('0x7')](_0x147a('0xb'),auth[_0x147a('0x8')](),controller['preview']);router[_0x147a('0x7')](_0x147a('0xc'),auth['isAuthenticated'](),controller[_0x147a('0xd')]);router['get'](_0x147a('0xe'),auth[_0x147a('0x8')](),controller[_0x147a('0xf')]);router['post']('/',auth[_0x147a('0x8')](),controller[_0x147a('0x10')]);router[_0x147a('0x11')]('/:id',auth[_0x147a('0x8')](),controller[_0x147a('0x12')]);router[_0x147a('0x13')](_0x147a('0x9'),auth[_0x147a('0x8')](),controller[_0x147a('0x14')]);module[_0x147a('0x15')]=router; \ No newline at end of file +var _0x69ee=['isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x1bce53,_0x252ee8){var _0x3b13b1=function(_0x2588ab){while(--_0x2588ab){_0x1bce53['push'](_0x1bce53['shift']());}};_0x3b13b1(++_0x252ee8);}(_0x69ee,0x167));var _0xe69e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x69ee[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0xe69e('0x0'));var path=require(_0xe69e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe69e('0x2'));var router=express[_0xe69e('0x3')]();var fs_extra=require(_0xe69e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe69e('0x5'));var config=require(_0xe69e('0x6'));var controller=require(_0xe69e('0x7'));router[_0xe69e('0x8')]('/',auth[_0xe69e('0x9')](),controller[_0xe69e('0xa')]);router[_0xe69e('0x8')]('/:id',auth[_0xe69e('0x9')](),controller[_0xe69e('0xb')]);router[_0xe69e('0x8')](_0xe69e('0xc'),auth[_0xe69e('0x9')](),controller['preview']);router[_0xe69e('0x8')](_0xe69e('0xd'),auth[_0xe69e('0x9')](),controller[_0xe69e('0xe')]);router[_0xe69e('0x8')](_0xe69e('0xf'),auth[_0xe69e('0x9')](),controller[_0xe69e('0x10')]);router[_0xe69e('0x11')]('/',auth[_0xe69e('0x9')](),controller[_0xe69e('0x12')]);router[_0xe69e('0x13')](_0xe69e('0x14'),auth[_0xe69e('0x9')](),controller[_0xe69e('0x15')]);router[_0xe69e('0x16')](_0xe69e('0x14'),auth[_0xe69e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8f5fa4a..ced085c 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 _0x6f81=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','sequelize','moment'];(function(_0xf7ecf7,_0x20b70e){var _0x4f8329=function(_0x528d67){while(--_0x528d67){_0xf7ecf7['push'](_0xf7ecf7['shift']());}};_0x4f8329(++_0x20b70e);}(_0x6f81,0x1d7));var _0x16f8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6f81[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x16f8('0x0'));var moment=require(_0x16f8('0x1'));module[_0x16f8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x16f8('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x16f8('0x4')](_0x16f8('0x5'),_0x16f8('0x6'),_0x16f8('0x7')),'allowNull':![],'defaultValue':_0x16f8('0x5')},'savename':{'type':Sequelize[_0x16f8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x16f8('0x8')]},'endDate':{'type':Sequelize[_0x16f8('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x16f8('0x4')](_0x16f8('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x16f8('0x9')},'reportId':{'type':Sequelize[_0x16f8('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x16f8('0x3')]}}; \ No newline at end of file +var _0xd921=['exports','STRING','csv','DATE','Loading','ENUM','scheduled','manual','UNSIGNED','sequelize'];(function(_0x476137,_0x1ccb32){var _0x5acaf8=function(_0x32ff8d){while(--_0x32ff8d){_0x476137['push'](_0x476137['shift']());}};_0x5acaf8(++_0x1ccb32);}(_0xd921,0xbd));var _0x1d92=function(_0x16d58c,_0xadbe40){_0x16d58c=_0x16d58c-0x0;var _0x5471fa=_0xd921[_0x16d58c];return _0x5471fa;};'use strict';var Sequelize=require(_0x1d92('0x0'));var moment=require('moment');module[_0x1d92('0x1')]={'name':{'type':Sequelize[_0x1d92('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1d92('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x1d92('0x3')},'savename':{'type':Sequelize[_0x1d92('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1d92('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x1d92('0x2')],'defaultValue':_0x1d92('0x5')},'type':{'type':Sequelize[_0x1d92('0x6')]('manual',_0x1d92('0x7')),'allowNull':![],'defaultValue':_0x1d92('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x1d92('0x9')]},'reportType':{'type':Sequelize[_0x1d92('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 87dbe4c..2a5f1e8 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 _0x3159=['params','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','ValidationError','exists','%s.%s','basename','toLowerCase','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','AnalyticExtractedReport','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','rows','show'];(function(_0x539f1e,_0x307b1d){var _0x1bd37c=function(_0x402312){while(--_0x402312){_0x539f1e['push'](_0x539f1e['shift']());}};_0x1bd37c(++_0x307b1d);}(_0x3159,0x1e0));var _0x9315=function(_0x14bd47,_0xc8ad78){_0x14bd47=_0x14bd47-0x0;var _0x2bb13f=_0x3159[_0x14bd47];return _0x2bb13f;};'use strict';var emlformat=require(_0x9315('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9315('0x1'));var moment=require('moment');var BPromise=require(_0x9315('0x2'));var Mustache=require(_0x9315('0x3'));var util=require('util');var path=require(_0x9315('0x4'));var sox=require(_0x9315('0x5'));var csv=require(_0x9315('0x6'));var ejs=require(_0x9315('0x7'));var fs=require('fs');var fs_extra=require(_0x9315('0x8'));var _=require(_0x9315('0x9'));var squel=require(_0x9315('0xa'));var crypto=require(_0x9315('0xb'));var jsforce=require(_0x9315('0xc'));var deskjs=require(_0x9315('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9315('0xe'));var Papa=require(_0x9315('0xf'));var Redis=require(_0x9315('0x10'));var authService=require(_0x9315('0x11'));var qs=require(_0x9315('0x12'));var as=require(_0x9315('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9315('0x14'))('api');var utils=require(_0x9315('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9315('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3caac1,_0x31c801){_0x31c801=_0x31c801||0xcc;return function(_0x2dba24){if(_0x2dba24){return _0x3caac1[_0x9315('0x17')](_0x31c801);}return _0x3caac1[_0x9315('0x18')](_0x31c801)[_0x9315('0x19')]();};}function respondWithResult(_0x2cd463,_0x2d995b){_0x2d995b=_0x2d995b||0xc8;return function(_0x19c15e){if(_0x19c15e){return _0x2cd463[_0x9315('0x18')](_0x2d995b)['json'](_0x19c15e);}};}function respondWithFilteredResult(_0x36ec53,_0x4e58a8){return function(_0x2e465a){if(_0x2e465a){var _0x3f901f=typeof _0x4e58a8['offset']===_0x9315('0x1a')&&typeof _0x4e58a8[_0x9315('0x1b')]===_0x9315('0x1a');var _0x3545e5=_0x2e465a[_0x9315('0x1c')];var _0x3cc7ac=_0x3f901f?0x0:_0x4e58a8[_0x9315('0x1d')];var _0x5fe858=_0x3f901f?_0x2e465a['count']:_0x4e58a8[_0x9315('0x1d')]+_0x4e58a8[_0x9315('0x1b')];var _0x8881f9;if(_0x5fe858>=_0x3545e5){_0x5fe858=_0x3545e5;_0x8881f9=0xc8;}else{_0x8881f9=0xce;}_0x36ec53['status'](_0x8881f9);return _0x36ec53[_0x9315('0x1e')]('Content-Range',_0x3cc7ac+'-'+_0x5fe858+'/'+_0x3545e5)['json'](_0x2e465a);}return null;};}function patchUpdates(_0x2d5d57){return function(_0x3b3417){try{jsonpatch[_0x9315('0x1f')](_0x3b3417,_0x2d5d57,!![]);}catch(_0x3dac43){return BPromise['reject'](_0x3dac43);}return _0x3b3417[_0x9315('0x20')]();};}function saveUpdates(_0x4f12f7,_0x49b9f4){return function(_0x51ede7){if(_0x51ede7){return _0x51ede7[_0x9315('0x21')](_0x4f12f7)[_0x9315('0x22')](function(_0x865637){return _0x865637;});}return null;};}function removeEntity(_0x2707f8,_0x2f47a0){return function(_0x526fc3){if(_0x526fc3){return _0x526fc3[_0x9315('0x23')]()[_0x9315('0x22')](function(){var _0x171853=_0x526fc3[_0x9315('0x24')]({'plain':!![]});var _0x313e21=_0x9315('0x25');return db['UserProfileResource'][_0x9315('0x23')]({'where':{'type':_0x313e21,'resourceId':_0x171853['id']}})[_0x9315('0x22')](function(){return _0x526fc3;});})[_0x9315('0x22')](function(){_0x2707f8['status'](0xcc)[_0x9315('0x19')]();});}};}function handleEntityNotFound(_0x5167c6,_0x564a09){return function(_0x8eb25c){if(!_0x8eb25c){_0x5167c6[_0x9315('0x17')](0x194);}return _0x8eb25c;};}function handleError(_0x1a996f,_0x3bd591){_0x3bd591=_0x3bd591||0x1f4;return function(_0x405d43){logger[_0x9315('0x26')](_0x405d43[_0x9315('0x27')]);if(_0x405d43[_0x9315('0x28')]){delete _0x405d43[_0x9315('0x28')];}_0x1a996f[_0x9315('0x18')](_0x3bd591)[_0x9315('0x29')](_0x405d43);};}exports['index']=function(_0x314825,_0x32d427){var _0x16bc3e={},_0x5a5815={},_0x3b3f8a={'count':0x0,'rows':[]};var _0x47a29f=_['map'](db[_0x9315('0x2a')][_0x9315('0x2b')],function(_0x883516){return{'name':_0x883516['fieldName'],'type':_0x883516[_0x9315('0x2c')][_0x9315('0x2d')]};});_0x5a5815[_0x9315('0x2e')]=_['map'](_0x47a29f,_0x9315('0x28'));_0x5a5815['query']=_['keys'](_0x314825['query']);_0x5a5815[_0x9315('0x2f')]=_[_0x9315('0x30')](_0x5a5815[_0x9315('0x2e')],_0x5a5815[_0x9315('0x31')]);_0x16bc3e[_0x9315('0x32')]=_[_0x9315('0x30')](_0x5a5815['model'],qs[_0x9315('0x33')](_0x314825[_0x9315('0x31')][_0x9315('0x33')]));_0x16bc3e[_0x9315('0x32')]=_0x16bc3e[_0x9315('0x32')][_0x9315('0x34')]?_0x16bc3e[_0x9315('0x32')]:_0x5a5815[_0x9315('0x2e')];if(!_0x314825['query'][_0x9315('0x35')](_0x9315('0x36'))){_0x16bc3e[_0x9315('0x1b')]=qs[_0x9315('0x1b')](_0x314825[_0x9315('0x31')][_0x9315('0x1b')]);_0x16bc3e[_0x9315('0x1d')]=qs[_0x9315('0x1d')](_0x314825[_0x9315('0x31')][_0x9315('0x1d')]);}_0x16bc3e[_0x9315('0x37')]=qs[_0x9315('0x38')](_0x314825['query'][_0x9315('0x38')]);_0x16bc3e[_0x9315('0x39')]=qs[_0x9315('0x2f')](_['pick'](_0x314825[_0x9315('0x31')],_0x5a5815[_0x9315('0x2f')]),_0x47a29f);if(_0x314825[_0x9315('0x31')][_0x9315('0x3a')]){_0x16bc3e[_0x9315('0x39')]=_[_0x9315('0x3b')](_0x16bc3e['where'],{'$or':_[_0x9315('0x3c')](_0x47a29f,function(_0x49aa16){if(_0x49aa16[_0x9315('0x2c')]!==_0x9315('0x3d')){var _0x456504={};_0x456504[_0x49aa16[_0x9315('0x28')]]={'$like':'%'+_0x314825['query'][_0x9315('0x3a')]+'%'};return _0x456504;}})});}_0x16bc3e=_[_0x9315('0x3b')]({},_0x16bc3e,_0x314825[_0x9315('0x3e')]);var _0x435160={'where':_0x16bc3e[_0x9315('0x39')]};return db[_0x9315('0x2a')][_0x9315('0x1c')](_0x435160)[_0x9315('0x22')](function(_0x459c08){_0x3b3f8a['count']=_0x459c08;if(_0x314825['query'][_0x9315('0x3f')]){_0x16bc3e['include']=[{'all':!![]}];}return db[_0x9315('0x2a')]['findAll'](_0x16bc3e);})['then'](function(_0x13abac){_0x3b3f8a[_0x9315('0x40')]=_0x13abac;return _0x3b3f8a;})[_0x9315('0x22')](respondWithFilteredResult(_0x32d427,_0x16bc3e))['catch'](handleError(_0x32d427,null));};exports[_0x9315('0x41')]=function(_0x2755ce,_0x30ddb3){var _0x4a0d0c={'raw':!![],'where':{'id':_0x2755ce[_0x9315('0x42')]['id']}},_0x302cd8={};_0x302cd8[_0x9315('0x2e')]=_[_0x9315('0x43')](db[_0x9315('0x2a')][_0x9315('0x2b')]);_0x302cd8['query']=_[_0x9315('0x43')](_0x2755ce[_0x9315('0x31')]);_0x302cd8[_0x9315('0x2f')]=_[_0x9315('0x30')](_0x302cd8[_0x9315('0x2e')],_0x302cd8[_0x9315('0x31')]);_0x4a0d0c[_0x9315('0x32')]=_[_0x9315('0x30')](_0x302cd8[_0x9315('0x2e')],qs[_0x9315('0x33')](_0x2755ce[_0x9315('0x31')][_0x9315('0x33')]));_0x4a0d0c[_0x9315('0x32')]=_0x4a0d0c[_0x9315('0x32')][_0x9315('0x34')]?_0x4a0d0c[_0x9315('0x32')]:_0x302cd8[_0x9315('0x2e')];if(_0x2755ce[_0x9315('0x31')]['includeAll']){_0x4a0d0c[_0x9315('0x44')]=[{'all':!![]}];}_0x4a0d0c=_[_0x9315('0x3b')]({},_0x4a0d0c,_0x2755ce[_0x9315('0x3e')]);return db[_0x9315('0x2a')][_0x9315('0x45')](_0x4a0d0c)[_0x9315('0x22')](handleEntityNotFound(_0x30ddb3,null))[_0x9315('0x22')](respondWithResult(_0x30ddb3,null))[_0x9315('0x46')](handleError(_0x30ddb3,null));};exports['create']=function(_0x4922cf,_0x5bf51e){return db[_0x9315('0x2a')][_0x9315('0x47')](_0x4922cf[_0x9315('0x48')],{})[_0x9315('0x22')](function(_0x5a0d8b){var _0x393bb5=_0x4922cf[_0x9315('0x49')]['get']({'plain':!![]});if(!_0x393bb5)throw new Error(_0x9315('0x4a'));if(_0x393bb5[_0x9315('0x4b')]===_0x9315('0x49')){var _0x137f52=_0x5a0d8b[_0x9315('0x24')]({'plain':!![]});var _0x630554='ExtractedReports';return db[_0x9315('0x4c')][_0x9315('0x45')]({'where':{'name':_0x630554,'userProfileId':_0x393bb5['userProfileId']},'raw':!![]})[_0x9315('0x22')](function(_0x46b70a){if(_0x46b70a&&_0x46b70a['autoAssociation']===0x0){return db[_0x9315('0x4d')]['create']({'name':_0x137f52[_0x9315('0x28')],'resourceId':_0x137f52['id'],'type':_0x46b70a['name'],'sectionId':_0x46b70a['id']},{})[_0x9315('0x22')](function(){return _0x5a0d8b;});}else{return _0x5a0d8b;}})[_0x9315('0x46')](function(_0x1db2ad){logger['error'](_0x9315('0x4e'),_0x1db2ad);throw _0x1db2ad;});}return _0x5a0d8b;})['then'](respondWithResult(_0x5bf51e,0xc9))[_0x9315('0x46')](handleError(_0x5bf51e,null));};exports[_0x9315('0x21')]=function(_0x5719fd,_0x4431d){if(_0x5719fd[_0x9315('0x48')]['id']){delete _0x5719fd[_0x9315('0x48')]['id'];}return db[_0x9315('0x2a')][_0x9315('0x45')]({'where':{'id':_0x5719fd[_0x9315('0x42')]['id']}})[_0x9315('0x22')](handleEntityNotFound(_0x4431d,null))['then'](saveUpdates(_0x5719fd[_0x9315('0x48')],null))['then'](respondWithResult(_0x4431d,null))[_0x9315('0x46')](handleError(_0x4431d,null));};exports[_0x9315('0x23')]=function(_0x184ff2,_0x41685e){return db[_0x9315('0x2a')]['find']({'where':{'id':_0x184ff2[_0x9315('0x42')]['id']}})['then'](handleEntityNotFound(_0x41685e,null))[_0x9315('0x22')](removeEntity(_0x41685e,null))[_0x9315('0x46')](handleError(_0x41685e,null));};exports[_0x9315('0x4f')]=function(_0x4f321b,_0x5f4a0,_0x415283){return db[_0x9315('0x2a')][_0x9315('0x45')]({'where':{'id':_0x4f321b[_0x9315('0x42')]['id']},'attributes':[_0x9315('0x28'),'basename',_0x9315('0x50'),_0x9315('0x51')],'raw':!![]})[_0x9315('0x22')](handleEntityNotFound(_0x5f4a0,null))['then'](function(_0xcb9942){if(_0xcb9942){if(!fs[_0x9315('0x52')](path[_0x9315('0x53')](config[_0x9315('0x54')],_0x9315('0x55'),_0xcb9942['savename']))){throw new db['Sequelize'][(_0x9315('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4f321b['query'][_0x9315('0x57')]){return _0x5f4a0[_0x9315('0x17')](0xc8);}return _0x5f4a0['download'](path['join'](config[_0x9315('0x54')],_0x9315('0x55'),_0xcb9942[_0x9315('0x50')]),util['format'](_0x9315('0x58'),_0xcb9942[_0x9315('0x59')]||_0xcb9942[_0x9315('0x28')],_0xcb9942[_0x9315('0x51')][_0x9315('0x5a')]()));}})['catch'](handleError(_0x5f4a0,null));}; \ No newline at end of file +var _0x6d14=['sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','ExtractedReports','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','body','params','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x6d14,0x176));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x46d1('0x0'));var jsonpatch=require(_0x46d1('0x1'));var rp=require(_0x46d1('0x2'));var moment=require(_0x46d1('0x3'));var BPromise=require(_0x46d1('0x4'));var Mustache=require(_0x46d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x46d1('0x6'));var csv=require(_0x46d1('0x7'));var ejs=require(_0x46d1('0x8'));var fs=require('fs');var fs_extra=require(_0x46d1('0x9'));var _=require(_0x46d1('0xa'));var squel=require(_0x46d1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46d1('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x46d1('0xd'));var Redis=require('ioredis');var authService=require(_0x46d1('0xe'));var qs=require(_0x46d1('0xf'));var as=require(_0x46d1('0x10'));var hardwareService=require(_0x46d1('0x11'));var logger=require(_0x46d1('0x12'))(_0x46d1('0x13'));var utils=require(_0x46d1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x46d1('0x15'));var db=require(_0x46d1('0x16'))['db'];function respondWithStatusCode(_0x5ed20e,_0xb747f8){_0xb747f8=_0xb747f8||0xcc;return function(_0x3556aa){if(_0x3556aa){return _0x5ed20e['sendStatus'](_0xb747f8);}return _0x5ed20e[_0x46d1('0x17')](_0xb747f8)[_0x46d1('0x18')]();};}function respondWithResult(_0x4f788d,_0x399ced){_0x399ced=_0x399ced||0xc8;return function(_0x47933f){if(_0x47933f){return _0x4f788d[_0x46d1('0x17')](_0x399ced)[_0x46d1('0x19')](_0x47933f);}};}function respondWithFilteredResult(_0x250bb5,_0x15e25d){return function(_0x25b6e0){if(_0x25b6e0){var _0x54197d=typeof _0x15e25d[_0x46d1('0x1a')]===_0x46d1('0x1b')&&typeof _0x15e25d['limit']===_0x46d1('0x1b');var _0x4f2eb7=_0x25b6e0[_0x46d1('0x1c')];var _0x414430=_0x54197d?0x0:_0x15e25d[_0x46d1('0x1a')];var _0x4e52b5=_0x54197d?_0x25b6e0[_0x46d1('0x1c')]:_0x15e25d['offset']+_0x15e25d[_0x46d1('0x1d')];var _0x43f79c;if(_0x4e52b5>=_0x4f2eb7){_0x4e52b5=_0x4f2eb7;_0x43f79c=0xc8;}else{_0x43f79c=0xce;}_0x250bb5[_0x46d1('0x17')](_0x43f79c);return _0x250bb5[_0x46d1('0x1e')](_0x46d1('0x1f'),_0x414430+'-'+_0x4e52b5+'/'+_0x4f2eb7)[_0x46d1('0x19')](_0x25b6e0);}return null;};}function patchUpdates(_0x548c3c){return function(_0x263b74){try{jsonpatch[_0x46d1('0x20')](_0x263b74,_0x548c3c,!![]);}catch(_0x4283c4){return BPromise[_0x46d1('0x21')](_0x4283c4);}return _0x263b74['save']();};}function saveUpdates(_0x139469,_0x1dc6f3){return function(_0x242ceb){if(_0x242ceb){return _0x242ceb[_0x46d1('0x22')](_0x139469)[_0x46d1('0x23')](function(_0xd96efd){return _0xd96efd;});}return null;};}function removeEntity(_0x408278,_0x1c91df){return function(_0x338373){if(_0x338373){return _0x338373[_0x46d1('0x24')]()[_0x46d1('0x23')](function(){var _0x217599=_0x338373['get']({'plain':!![]});var _0x4b3887=_0x46d1('0x25');return db['UserProfileResource'][_0x46d1('0x24')]({'where':{'type':_0x4b3887,'resourceId':_0x217599['id']}})[_0x46d1('0x23')](function(){return _0x338373;});})[_0x46d1('0x23')](function(){_0x408278[_0x46d1('0x17')](0xcc)[_0x46d1('0x18')]();});}};}function handleEntityNotFound(_0x21109c,_0x12ca6e){return function(_0x3b579b){if(!_0x3b579b){_0x21109c[_0x46d1('0x26')](0x194);}return _0x3b579b;};}function handleError(_0x261b85,_0x3ac5ef){_0x3ac5ef=_0x3ac5ef||0x1f4;return function(_0x3d86c5){logger[_0x46d1('0x27')](_0x3d86c5[_0x46d1('0x28')]);if(_0x3d86c5[_0x46d1('0x29')]){delete _0x3d86c5[_0x46d1('0x29')];}_0x261b85['status'](_0x3ac5ef)[_0x46d1('0x2a')](_0x3d86c5);};}exports[_0x46d1('0x2b')]=function(_0x3c7dfd,_0x4668c5){var _0x47895e={},_0x3d8ed5={},_0x42bb2={'count':0x0,'rows':[]};var _0x508fbd=_[_0x46d1('0x2c')](db[_0x46d1('0x2d')][_0x46d1('0x2e')],function(_0x4ebc14){return{'name':_0x4ebc14[_0x46d1('0x2f')],'type':_0x4ebc14[_0x46d1('0x30')][_0x46d1('0x31')]};});_0x3d8ed5[_0x46d1('0x32')]=_[_0x46d1('0x2c')](_0x508fbd,_0x46d1('0x29'));_0x3d8ed5[_0x46d1('0x33')]=_[_0x46d1('0x34')](_0x3c7dfd[_0x46d1('0x33')]);_0x3d8ed5[_0x46d1('0x35')]=_[_0x46d1('0x36')](_0x3d8ed5[_0x46d1('0x32')],_0x3d8ed5['query']);_0x47895e[_0x46d1('0x37')]=_[_0x46d1('0x36')](_0x3d8ed5['model'],qs['fields'](_0x3c7dfd[_0x46d1('0x33')][_0x46d1('0x38')]));_0x47895e[_0x46d1('0x37')]=_0x47895e[_0x46d1('0x37')][_0x46d1('0x39')]?_0x47895e[_0x46d1('0x37')]:_0x3d8ed5['model'];if(!_0x3c7dfd[_0x46d1('0x33')]['hasOwnProperty']('nolimit')){_0x47895e['limit']=qs[_0x46d1('0x1d')](_0x3c7dfd['query'][_0x46d1('0x1d')]);_0x47895e[_0x46d1('0x1a')]=qs['offset'](_0x3c7dfd[_0x46d1('0x33')]['offset']);}_0x47895e[_0x46d1('0x3a')]=qs[_0x46d1('0x3b')](_0x3c7dfd[_0x46d1('0x33')]['sort']);_0x47895e[_0x46d1('0x3c')]=qs[_0x46d1('0x35')](_[_0x46d1('0x3d')](_0x3c7dfd[_0x46d1('0x33')],_0x3d8ed5[_0x46d1('0x35')]),_0x508fbd);if(_0x3c7dfd[_0x46d1('0x33')][_0x46d1('0x3e')]){_0x47895e['where']=_[_0x46d1('0x3f')](_0x47895e[_0x46d1('0x3c')],{'$or':_[_0x46d1('0x2c')](_0x508fbd,function(_0x2d75d1){if(_0x2d75d1[_0x46d1('0x30')]!==_0x46d1('0x40')){var _0x4fc882={};_0x4fc882[_0x2d75d1[_0x46d1('0x29')]]={'$like':'%'+_0x3c7dfd['query'][_0x46d1('0x3e')]+'%'};return _0x4fc882;}})});}_0x47895e=_['merge']({},_0x47895e,_0x3c7dfd[_0x46d1('0x41')]);var _0x52bad6={'where':_0x47895e[_0x46d1('0x3c')]};return db[_0x46d1('0x2d')][_0x46d1('0x1c')](_0x52bad6)[_0x46d1('0x23')](function(_0x55dbb8){_0x42bb2[_0x46d1('0x1c')]=_0x55dbb8;if(_0x3c7dfd['query'][_0x46d1('0x42')]){_0x47895e[_0x46d1('0x43')]=[{'all':!![]}];}return db[_0x46d1('0x2d')][_0x46d1('0x44')](_0x47895e);})[_0x46d1('0x23')](function(_0x34c55b){_0x42bb2[_0x46d1('0x45')]=_0x34c55b;return _0x42bb2;})[_0x46d1('0x23')](respondWithFilteredResult(_0x4668c5,_0x47895e))['catch'](handleError(_0x4668c5,null));};exports[_0x46d1('0x46')]=function(_0x3b2dc7,_0x104c8d){var _0x30038a={'raw':!![],'where':{'id':_0x3b2dc7['params']['id']}},_0x5aa261={};_0x5aa261[_0x46d1('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x46d1('0x2e')]);_0x5aa261['query']=_['keys'](_0x3b2dc7[_0x46d1('0x33')]);_0x5aa261['filters']=_[_0x46d1('0x36')](_0x5aa261['model'],_0x5aa261[_0x46d1('0x33')]);_0x30038a['attributes']=_[_0x46d1('0x36')](_0x5aa261['model'],qs[_0x46d1('0x38')](_0x3b2dc7[_0x46d1('0x33')][_0x46d1('0x38')]));_0x30038a[_0x46d1('0x37')]=_0x30038a[_0x46d1('0x37')][_0x46d1('0x39')]?_0x30038a[_0x46d1('0x37')]:_0x5aa261['model'];if(_0x3b2dc7[_0x46d1('0x33')][_0x46d1('0x42')]){_0x30038a[_0x46d1('0x43')]=[{'all':!![]}];}_0x30038a=_[_0x46d1('0x3f')]({},_0x30038a,_0x3b2dc7[_0x46d1('0x41')]);return db[_0x46d1('0x2d')]['find'](_0x30038a)['then'](handleEntityNotFound(_0x104c8d,null))[_0x46d1('0x23')](respondWithResult(_0x104c8d,null))[_0x46d1('0x47')](handleError(_0x104c8d,null));};exports['create']=function(_0x1e2e85,_0x187e94){return db[_0x46d1('0x2d')][_0x46d1('0x48')](_0x1e2e85['body'],{})[_0x46d1('0x23')](function(_0x135b5d){var _0x22bf9c=_0x1e2e85[_0x46d1('0x49')]['get']({'plain':!![]});if(!_0x22bf9c)throw new Error(_0x46d1('0x4a'));if(_0x22bf9c[_0x46d1('0x4b')]==='user'){var _0x2f537f=_0x135b5d['get']({'plain':!![]});var _0x1a6639=_0x46d1('0x25');return db[_0x46d1('0x4c')][_0x46d1('0x4d')]({'where':{'name':_0x1a6639,'userProfileId':_0x22bf9c[_0x46d1('0x4e')]},'raw':!![]})[_0x46d1('0x23')](function(_0x4fbbbc){if(_0x4fbbbc&&_0x4fbbbc['autoAssociation']===0x0){return db[_0x46d1('0x4f')]['create']({'name':_0x2f537f['name'],'resourceId':_0x2f537f['id'],'type':_0x4fbbbc[_0x46d1('0x29')],'sectionId':_0x4fbbbc['id']},{})['then'](function(){return _0x135b5d;});}else{return _0x135b5d;}})['catch'](function(_0x3c954c){logger[_0x46d1('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c954c);throw _0x3c954c;});}return _0x135b5d;})[_0x46d1('0x23')](respondWithResult(_0x187e94,0xc9))[_0x46d1('0x47')](handleError(_0x187e94,null));};exports[_0x46d1('0x22')]=function(_0x3fdbcd,_0x52e9d0){if(_0x3fdbcd[_0x46d1('0x50')]['id']){delete _0x3fdbcd[_0x46d1('0x50')]['id'];}return db[_0x46d1('0x2d')][_0x46d1('0x4d')]({'where':{'id':_0x3fdbcd[_0x46d1('0x51')]['id']}})['then'](handleEntityNotFound(_0x52e9d0,null))[_0x46d1('0x23')](saveUpdates(_0x3fdbcd[_0x46d1('0x50')],null))[_0x46d1('0x23')](respondWithResult(_0x52e9d0,null))['catch'](handleError(_0x52e9d0,null));};exports[_0x46d1('0x24')]=function(_0x21be12,_0x4df395){return db[_0x46d1('0x2d')][_0x46d1('0x4d')]({'where':{'id':_0x21be12[_0x46d1('0x51')]['id']}})[_0x46d1('0x23')](handleEntityNotFound(_0x4df395,null))['then'](removeEntity(_0x4df395,null))[_0x46d1('0x47')](handleError(_0x4df395,null));};exports['download']=function(_0x54f0e0,_0xbd6b28,_0x26f352){return db[_0x46d1('0x2d')]['find']({'where':{'id':_0x54f0e0[_0x46d1('0x51')]['id']},'attributes':['name','basename',_0x46d1('0x52'),_0x46d1('0x53')],'raw':!![]})[_0x46d1('0x23')](handleEntityNotFound(_0xbd6b28,null))[_0x46d1('0x23')](function(_0x59b237){if(_0x59b237){if(!fs[_0x46d1('0x54')](path[_0x46d1('0x55')](config['root'],_0x46d1('0x56'),_0x59b237['savename']))){throw new db[(_0x46d1('0x57'))][(_0x46d1('0x58'))](_0x46d1('0x59'));}if(_0x54f0e0[_0x46d1('0x33')][_0x46d1('0x5a')]){return _0xbd6b28['sendStatus'](0xc8);}return _0xbd6b28[_0x46d1('0x5b')](path[_0x46d1('0x55')](config[_0x46d1('0x5c')],_0x46d1('0x56'),_0x59b237[_0x46d1('0x52')]),util['format'](_0x46d1('0x5d'),_0x59b237['basename']||_0x59b237[_0x46d1('0x29')],_0x59b237[_0x46d1('0x53')][_0x46d1('0x5e')]()));}})['catch'](handleError(_0xbd6b28,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index dfcd95c..d6e4b55 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 _0x49cb=['path','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash','util','../../config/logger','api','request-promise'];(function(_0xe01cf8,_0x36785d){var _0x2f6bfb=function(_0x2c51db){while(--_0x2c51db){_0xe01cf8['push'](_0xe01cf8['shift']());}};_0x2f6bfb(++_0x36785d);}(_0x49cb,0xcd));var _0xb49c=function(_0x56ac85,_0x3b9f06){_0x56ac85=_0x56ac85-0x0;var _0x232bf5=_0x49cb[_0x56ac85];return _0x232bf5;};'use strict';var _=require(_0xb49c('0x0'));var util=require(_0xb49c('0x1'));var logger=require(_0xb49c('0x2'))(_0xb49c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb49c('0x4'));var fs=require('fs');var path=require(_0xb49c('0x5'));var rimraf=require('rimraf');var config=require(_0xb49c('0x6'));var attributes=require(_0xb49c('0x7'));module['exports']=function(_0xd432f7,_0x5348d2){return _0xd432f7[_0xb49c('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0xb49c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68d4=['analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define'];(function(_0x24448a,_0x526116){var _0x48b567=function(_0x2259ae){while(--_0x2259ae){_0x24448a['push'](_0x24448a['shift']());}};_0x48b567(++_0x526116);}(_0x68d4,0x109));var _0x468d=function(_0x4d23dc,_0x30def6){_0x4d23dc=_0x4d23dc-0x0;var _0x1ffc30=_0x68d4[_0x4d23dc];return _0x1ffc30;};'use strict';var _=require('lodash');var util=require(_0x468d('0x0'));var logger=require(_0x468d('0x1'))(_0x468d('0x2'));var moment=require(_0x468d('0x3'));var BPromise=require(_0x468d('0x4'));var rp=require(_0x468d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x468d('0x6'));var config=require(_0x468d('0x7'));var attributes=require(_0x468d('0x8'));module['exports']=function(_0xe41105,_0x50d64c){return _0xe41105[_0x468d('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x468d('0xa'),'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 321579c..9af51ac 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 _0xc547=['code','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x242751,_0x19e618){var _0x9fc070=function(_0x48e026){while(--_0x48e026){_0x242751['push'](_0x242751['shift']());}};_0x9fc070(++_0x19e618);}(_0xc547,0xb6));var _0x7c54=function(_0x5ba4d1,_0x2a4c80){_0x5ba4d1=_0x5ba4d1-0x0;var _0x5589e4=_0xc547[_0x5ba4d1];return _0x5589e4;};'use strict';var _=require(_0x7c54('0x0'));var util=require('util');var moment=require(_0x7c54('0x1'));var BPromise=require('bluebird');var rs=require(_0x7c54('0x2'));var fs=require('fs');var Redis=require(_0x7c54('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c54('0x4'))(_0x7c54('0x5'));var config=require(_0x7c54('0x6'));var jayson=require(_0x7c54('0x7'));var client=jayson[_0x7c54('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd450,_0x3c01ef,_0x136285){return new BPromise(function(_0x263085,_0x1ebb1f){return client[_0x7c54('0x9')](_0x3cd450,_0x136285)[_0x7c54('0xa')](function(_0x39d4a3){logger['info'](_0x7c54('0xb'),_0x3c01ef,_0x7c54('0xc'));logger[_0x7c54('0xd')](_0x7c54('0xe'),_0x3c01ef,_0x7c54('0xc'),JSON[_0x7c54('0xf')](_0x39d4a3));if(_0x39d4a3['error']){if(_0x39d4a3['error'][_0x7c54('0x10')]===0x1f4){logger[_0x7c54('0x11')](_0x7c54('0xb'),_0x3c01ef,_0x39d4a3[_0x7c54('0x11')][_0x7c54('0x12')]);return _0x1ebb1f(_0x39d4a3[_0x7c54('0x11')]['message']);}logger[_0x7c54('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3c01ef,_0x39d4a3[_0x7c54('0x11')]['message']);return _0x263085(_0x39d4a3[_0x7c54('0x11')]['message']);}else{logger[_0x7c54('0x13')](_0x7c54('0xb'),_0x3c01ef,_0x7c54('0xc'));_0x263085(_0x39d4a3[_0x7c54('0x14')][_0x7c54('0x12')]);}})[_0x7c54('0x15')](function(_0x2636e8){logger[_0x7c54('0x11')](_0x7c54('0xb'),_0x3c01ef,_0x2636e8);_0x1ebb1f(_0x2636e8);});});} \ No newline at end of file +var _0x6f33=['stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0xfbc080,_0x179e08){var _0x5482be=function(_0x1f457e){while(--_0x1f457e){_0xfbc080['push'](_0xfbc080['shift']());}};_0x5482be(++_0x179e08);}(_0x6f33,0x1b9));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x36f3('0x0'));var moment=require('moment');var BPromise=require(_0x36f3('0x1'));var rs=require(_0x36f3('0x2'));var fs=require('fs');var Redis=require(_0x36f3('0x3'));var db=require(_0x36f3('0x4'))['db'];var utils=require(_0x36f3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x36f3('0x6'));var jayson=require(_0x36f3('0x7'));var client=jayson['client'][_0x36f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ff8b6,_0x1c9715,_0x32b367){return new BPromise(function(_0x162cd3,_0x457ec6){return client[_0x36f3('0x9')](_0x3ff8b6,_0x32b367)[_0x36f3('0xa')](function(_0x57c57d){logger[_0x36f3('0xb')](_0x36f3('0xc'),_0x1c9715,_0x36f3('0xd'));logger['debug'](_0x36f3('0xe'),_0x1c9715,_0x36f3('0xd'),JSON[_0x36f3('0xf')](_0x57c57d));if(_0x57c57d['error']){if(_0x57c57d[_0x36f3('0x10')][_0x36f3('0x11')]===0x1f4){logger[_0x36f3('0x10')](_0x36f3('0xc'),_0x1c9715,_0x57c57d[_0x36f3('0x10')][_0x36f3('0x12')]);return _0x457ec6(_0x57c57d[_0x36f3('0x10')]['message']);}logger[_0x36f3('0x10')](_0x36f3('0xc'),_0x1c9715,_0x57c57d[_0x36f3('0x10')][_0x36f3('0x12')]);return _0x162cd3(_0x57c57d[_0x36f3('0x10')][_0x36f3('0x12')]);}else{logger['info'](_0x36f3('0xc'),_0x1c9715,_0x36f3('0xd'));_0x162cd3(_0x57c57d['result'][_0x36f3('0x12')]);}})['catch'](function(_0x4401fb){logger[_0x36f3('0x10')](_0x36f3('0xc'),_0x1c9715,_0x4401fb);_0x457ec6(_0x4401fb);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index acbcaef..89d4806 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 _0x29d8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','create','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4309d5,_0x43f89b){var _0x2a5aab=function(_0x375c36){while(--_0x375c36){_0x4309d5['push'](_0x4309d5['shift']());}};_0x2a5aab(++_0x43f89b);}(_0x29d8,0x126));var _0x829d=function(_0x720cb6,_0x5ba64d){_0x720cb6=_0x720cb6-0x0;var _0x112f33=_0x29d8[_0x720cb6];return _0x112f33;};'use strict';var multer=require(_0x829d('0x0'));var util=require(_0x829d('0x1'));var path=require(_0x829d('0x2'));var timeout=require(_0x829d('0x3'));var express=require(_0x829d('0x4'));var router=express[_0x829d('0x5')]();var fs_extra=require(_0x829d('0x6'));var auth=require(_0x829d('0x7'));var interaction=require(_0x829d('0x8'));var config=require(_0x829d('0x9'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x829d('0xa')](),controller['index']);router[_0x829d('0xb')](_0x829d('0xc'),auth['isAuthenticated'](),controller[_0x829d('0xd')]);router['get'](_0x829d('0xe'),auth['isAuthenticated'](),controller[_0x829d('0xf')]);router['post']('/',auth[_0x829d('0xa')](),controller[_0x829d('0x10')]);router[_0x829d('0x11')](_0x829d('0xc'),auth[_0x829d('0xa')](),controller['update']);router[_0x829d('0x12')](_0x829d('0xc'),auth[_0x829d('0xa')](),controller['destroy']);module[_0x829d('0x13')]=router; \ No newline at end of file +var _0x30f4=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/download','download','update','delete','exports'];(function(_0x5266b8,_0x5d9ef4){var _0x28d9c5=function(_0x3ce4c2){while(--_0x3ce4c2){_0x5266b8['push'](_0x5266b8['shift']());}};_0x28d9c5(++_0x5d9ef4);}(_0x30f4,0x132));var _0x430f=function(_0x4faab0,_0x544bf3){_0x4faab0=_0x4faab0-0x0;var _0x5b1f25=_0x30f4[_0x4faab0];return _0x5b1f25;};'use strict';var multer=require(_0x430f('0x0'));var util=require(_0x430f('0x1'));var path=require('path');var timeout=require(_0x430f('0x2'));var express=require(_0x430f('0x3'));var router=express[_0x430f('0x4')]();var fs_extra=require(_0x430f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x430f('0x6'));var config=require(_0x430f('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x430f('0x8')](_0x430f('0x9'),auth[_0x430f('0xa')](),controller[_0x430f('0xb')]);router[_0x430f('0x8')](_0x430f('0xc'),auth[_0x430f('0xa')](),controller[_0x430f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x430f('0x9'),auth[_0x430f('0xa')](),controller[_0x430f('0xe')]);router[_0x430f('0xf')]('/:id',auth[_0x430f('0xa')](),controller['destroy']);module[_0x430f('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6b8176a..a0b18b5 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 _0xf037=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf037,0x9a));var _0x7f03=function(_0x5b406e,_0xcd06bc){_0x5b406e=_0x5b406e-0x0;var _0xe7d242=_0xf037[_0x5b406e];return _0xe7d242;};'use strict';var Sequelize=require(_0x7f03('0x0'));module[_0x7f03('0x1')]={'field':{'type':Sequelize[_0x7f03('0x2')]},'alias':{'type':Sequelize[_0x7f03('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x7f03('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7f03('0x3')]},'custom':{'type':Sequelize[_0x7f03('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x0450=['TEXT','STRING','BOOLEAN'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x0450,0x19b));var _0x0045=function(_0x477d73,_0x2f4814){_0x477d73=_0x477d73-0x0;var _0x38c636=_0x0450[_0x477d73];return _0x38c636;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x0045('0x0')]},'alias':{'type':Sequelize[_0x0045('0x1')]},'function':{'type':Sequelize[_0x0045('0x1')]},'format':{'type':Sequelize[_0x0045('0x1')]},'groupBy':{'type':Sequelize[_0x0045('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0045('0x1')]},'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 361aebf..9bca654 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 _0x76a9=['destroy','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','body','bulkCreate'];(function(_0x4d41d8,_0x20e104){var _0x13ac12=function(_0x1d4f70){while(--_0x1d4f70){_0x4d41d8['push'](_0x4d41d8['shift']());}};_0x13ac12(++_0x20e104);}(_0x76a9,0x14f));var _0x976a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x76a9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x976a('0x0'));var rimraf=require(_0x976a('0x1'));var zipdir=require(_0x976a('0x2'));var jsonpatch=require(_0x976a('0x3'));var rp=require(_0x976a('0x4'));var moment=require('moment');var BPromise=require(_0x976a('0x5'));var Mustache=require(_0x976a('0x6'));var util=require(_0x976a('0x7'));var path=require(_0x976a('0x8'));var sox=require('sox');var csv=require(_0x976a('0x9'));var ejs=require(_0x976a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x976a('0xb'));var squel=require(_0x976a('0xc'));var crypto=require(_0x976a('0xd'));var jsforce=require(_0x976a('0xe'));var deskjs=require(_0x976a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x976a('0x10'));var authService=require(_0x976a('0x11'));var qs=require(_0x976a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x976a('0x13'));var logger=require(_0x976a('0x14'))(_0x976a('0x15'));var utils=require('../../config/utils');var config=require(_0x976a('0x16'));var licenseUtil=require(_0x976a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c2da,_0x1db7d8){_0x1db7d8=_0x1db7d8||0xcc;return function(_0x48de17){if(_0x48de17){return _0x49c2da[_0x976a('0x18')](_0x1db7d8);}return _0x49c2da['status'](_0x1db7d8)[_0x976a('0x19')]();};}function respondWithResult(_0x19b414,_0x38a747){_0x38a747=_0x38a747||0xc8;return function(_0x3485f8){if(_0x3485f8){return _0x19b414[_0x976a('0x1a')](_0x38a747)['json'](_0x3485f8);}};}function respondWithFilteredResult(_0x56386b,_0x1937cc){return function(_0x3c13aa){if(_0x3c13aa){var _0xf47e1c=typeof _0x1937cc[_0x976a('0x1b')]===_0x976a('0x1c')&&typeof _0x1937cc[_0x976a('0x1d')]===_0x976a('0x1c');var _0x24e2e5=_0x3c13aa[_0x976a('0x1e')];var _0x447b7f=_0xf47e1c?0x0:_0x1937cc['offset'];var _0x41a307=_0xf47e1c?_0x3c13aa[_0x976a('0x1e')]:_0x1937cc[_0x976a('0x1b')]+_0x1937cc['limit'];var _0x203531;if(_0x41a307>=_0x24e2e5){_0x41a307=_0x24e2e5;_0x203531=0xc8;}else{_0x203531=0xce;}_0x56386b[_0x976a('0x1a')](_0x203531);return _0x56386b[_0x976a('0x1f')](_0x976a('0x20'),_0x447b7f+'-'+_0x41a307+'/'+_0x24e2e5)[_0x976a('0x21')](_0x3c13aa);}return null;};}function patchUpdates(_0x4a648e){return function(_0x5951cf){try{jsonpatch[_0x976a('0x22')](_0x5951cf,_0x4a648e,!![]);}catch(_0x2ea5cf){return BPromise[_0x976a('0x23')](_0x2ea5cf);}return _0x5951cf[_0x976a('0x24')]();};}function saveUpdates(_0x496755,_0x269064){return function(_0x3c9567){if(_0x3c9567){return _0x3c9567['update'](_0x496755)[_0x976a('0x25')](function(_0x47aa3c){return _0x47aa3c;});}return null;};}function removeEntity(_0x21da92,_0x7d5b9c){return function(_0x278663){if(_0x278663){return _0x278663['destroy']()[_0x976a('0x25')](function(){_0x21da92[_0x976a('0x1a')](0xcc)[_0x976a('0x19')]();});}};}function handleEntityNotFound(_0x532fb9,_0x11ef1e){return function(_0x1c1624){if(!_0x1c1624){_0x532fb9[_0x976a('0x18')](0x194);}return _0x1c1624;};}function handleError(_0x1f0545,_0x33cb40){_0x33cb40=_0x33cb40||0x1f4;return function(_0x3b0ed5){logger[_0x976a('0x26')](_0x3b0ed5['stack']);if(_0x3b0ed5[_0x976a('0x27')]){delete _0x3b0ed5[_0x976a('0x27')];}_0x1f0545['status'](_0x33cb40)[_0x976a('0x28')](_0x3b0ed5);};}exports[_0x976a('0x29')]=function(_0x179708,_0x4758ed){var _0x4babc4={},_0x5168cb={},_0x171dbd={'count':0x0,'rows':[]};var _0x5581b2=_[_0x976a('0x2a')](db[_0x976a('0x2b')][_0x976a('0x2c')],function(_0x24ad59){return{'name':_0x24ad59[_0x976a('0x2d')],'type':_0x24ad59[_0x976a('0x2e')][_0x976a('0x2f')]};});_0x5168cb[_0x976a('0x30')]=_[_0x976a('0x2a')](_0x5581b2,_0x976a('0x27'));_0x5168cb[_0x976a('0x31')]=_[_0x976a('0x32')](_0x179708['query']);_0x5168cb[_0x976a('0x33')]=_[_0x976a('0x34')](_0x5168cb[_0x976a('0x30')],_0x5168cb['query']);_0x4babc4['attributes']=_[_0x976a('0x34')](_0x5168cb[_0x976a('0x30')],qs[_0x976a('0x35')](_0x179708['query'][_0x976a('0x35')]));_0x4babc4[_0x976a('0x36')]=_0x4babc4[_0x976a('0x36')][_0x976a('0x37')]?_0x4babc4['attributes']:_0x5168cb[_0x976a('0x30')];if(!_0x179708['query'][_0x976a('0x38')]('nolimit')){_0x4babc4[_0x976a('0x1d')]=qs[_0x976a('0x1d')](_0x179708[_0x976a('0x31')][_0x976a('0x1d')]);_0x4babc4[_0x976a('0x1b')]=qs[_0x976a('0x1b')](_0x179708[_0x976a('0x31')]['offset']);}_0x4babc4[_0x976a('0x39')]=qs[_0x976a('0x3a')](_0x179708[_0x976a('0x31')][_0x976a('0x3a')]);_0x4babc4[_0x976a('0x3b')]=qs[_0x976a('0x33')](_[_0x976a('0x3c')](_0x179708[_0x976a('0x31')],_0x5168cb[_0x976a('0x33')]),_0x5581b2);if(_0x179708[_0x976a('0x31')][_0x976a('0x3d')]){_0x4babc4['where']=_[_0x976a('0x3e')](_0x4babc4[_0x976a('0x3b')],{'$or':_[_0x976a('0x2a')](_0x5581b2,function(_0x594ffa){if(_0x594ffa[_0x976a('0x2e')]!==_0x976a('0x3f')){var _0x51c7d1={};_0x51c7d1[_0x594ffa[_0x976a('0x27')]]={'$like':'%'+_0x179708['query'][_0x976a('0x3d')]+'%'};return _0x51c7d1;}})});}_0x4babc4=_[_0x976a('0x3e')]({},_0x4babc4,_0x179708['options']);var _0x293e2f={'where':_0x4babc4[_0x976a('0x3b')]};return db['AnalyticFieldReport'][_0x976a('0x1e')](_0x293e2f)[_0x976a('0x25')](function(_0x5c2a4d){_0x171dbd['count']=_0x5c2a4d;if(_0x179708['query'][_0x976a('0x40')]){_0x4babc4[_0x976a('0x41')]=[{'all':!![]}];}return db[_0x976a('0x2b')][_0x976a('0x42')](_0x4babc4);})[_0x976a('0x25')](function(_0x1fc1da){_0x171dbd[_0x976a('0x43')]=_0x1fc1da;return _0x171dbd;})[_0x976a('0x25')](respondWithFilteredResult(_0x4758ed,_0x4babc4))[_0x976a('0x44')](handleError(_0x4758ed,null));};exports[_0x976a('0x45')]=function(_0x50b8c8,_0x3c48d8){var _0x2fbe77={'raw':![],'where':{'id':_0x50b8c8[_0x976a('0x46')]['id']}},_0x55a025={};_0x55a025['model']=_[_0x976a('0x32')](db['AnalyticFieldReport'][_0x976a('0x2c')]);_0x55a025['query']=_[_0x976a('0x32')](_0x50b8c8[_0x976a('0x31')]);_0x55a025[_0x976a('0x33')]=_[_0x976a('0x34')](_0x55a025['model'],_0x55a025[_0x976a('0x31')]);_0x2fbe77[_0x976a('0x36')]=_[_0x976a('0x34')](_0x55a025[_0x976a('0x30')],qs['fields'](_0x50b8c8[_0x976a('0x31')]['fields']));_0x2fbe77[_0x976a('0x36')]=_0x2fbe77['attributes'][_0x976a('0x37')]?_0x2fbe77[_0x976a('0x36')]:_0x55a025[_0x976a('0x30')];if(_0x50b8c8[_0x976a('0x31')]['includeAll']){_0x2fbe77['include']=[{'all':!![]}];}_0x2fbe77=_['merge']({},_0x2fbe77,_0x50b8c8[_0x976a('0x47')]);return db[_0x976a('0x2b')][_0x976a('0x48')](_0x2fbe77)[_0x976a('0x25')](handleEntityNotFound(_0x3c48d8,null))[_0x976a('0x25')](respondWithResult(_0x3c48d8,null))[_0x976a('0x44')](handleError(_0x3c48d8,null));};exports['create']=function(_0x2a7a73,_0x44b942){return db['AnalyticFieldReport']['create'](_0x2a7a73[_0x976a('0x49')],{})[_0x976a('0x25')](respondWithResult(_0x44b942,0xc9))['catch'](handleError(_0x44b942,null));};exports[_0x976a('0x4a')]=function(_0x3180f7,_0x5bb6d1){return db[_0x976a('0x2b')]['bulkCreate'](_0x3180f7[_0x976a('0x49')],{'raw':![],'individualHooks':!![]})[_0x976a('0x25')](respondWithResult(_0x5bb6d1,0xc9))[_0x976a('0x44')](handleError(_0x5bb6d1,null));};exports['update']=function(_0x15c878,_0x4bef70){if(_0x15c878[_0x976a('0x49')]['id']){delete _0x15c878[_0x976a('0x49')]['id'];}return db['AnalyticFieldReport'][_0x976a('0x48')]({'where':{'id':_0x15c878[_0x976a('0x46')]['id']}})[_0x976a('0x25')](handleEntityNotFound(_0x4bef70,null))[_0x976a('0x25')](saveUpdates(_0x15c878[_0x976a('0x49')],null))[_0x976a('0x25')](respondWithResult(_0x4bef70,null))['catch'](handleError(_0x4bef70,null));};exports[_0x976a('0x4b')]=function(_0x4128f4,_0x54ba13){return db[_0x976a('0x2b')][_0x976a('0x48')]({'where':{'id':_0x4128f4['params']['id']}})[_0x976a('0x25')](handleEntityNotFound(_0x54ba13,null))[_0x976a('0x25')](removeEntity(_0x54ba13,null))[_0x976a('0x44')](handleError(_0x54ba13,null));};exports[_0x976a('0x4c')]=function(_0x1bd1f0,_0x51eb9f){return db[_0x976a('0x2b')][_0x976a('0x4b')]({'where':{'id':_0x1bd1f0[_0x976a('0x31')][_0x976a('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x976a('0x25')](respondWithResult(_0x51eb9f,0xcc))['catch'](handleError(_0x51eb9f,null));};exports[_0x976a('0x4e')]=function(_0x1568f4,_0x5c4970,_0x3a4190){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x1568f4[_0x976a('0x46')]['id']}})[_0x976a('0x25')](handleEntityNotFound(_0x5c4970,null))[_0x976a('0x25')](function(_0x4b9ead){if(_0x4b9ead){return db[_0x976a('0x4f')][_0x976a('0x50')](function(_0x522abb){return db['AnalyticFieldReport'][_0x976a('0x4b')]({'where':{'CustomReportId':_0x1568f4['params']['id']},'transaction':_0x522abb})['then'](function(_0x1166f9){var _0x2f38c3=_[_0x976a('0x2a')](_0x1568f4[_0x976a('0x49')],function(_0x322509){delete _0x322509['id'];_0x322509[_0x976a('0x51')]=_0x1568f4[_0x976a('0x46')]['id'];return _0x322509;});return db['AnalyticFieldReport'][_0x976a('0x4a')](_0x2f38c3,{'transaction':_0x522abb});});})[_0x976a('0x25')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x1568f4[_0x976a('0x46')]['id']}});});}})[_0x976a('0x25')](respondWithResult(_0x5c4970,null))[_0x976a('0x44')](handleError(_0x5c4970,null));}; \ No newline at end of file +var _0x61d0=['zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','undefined','limit','offset','status','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','AnalyticFieldReport','count','include','findAll','catch','show','params','keys','fields','includeAll','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61d0,0x18a));var _0x061d=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x61d0[_0x513f27];return _0xa316b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x061d('0x0'));var zipdir=require(_0x061d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x061d('0x2'));var Mustache=require(_0x061d('0x3'));var util=require(_0x061d('0x4'));var path=require(_0x061d('0x5'));var sox=require(_0x061d('0x6'));var csv=require(_0x061d('0x7'));var ejs=require(_0x061d('0x8'));var fs=require('fs');var fs_extra=require(_0x061d('0x9'));var _=require(_0x061d('0xa'));var squel=require('squel');var crypto=require(_0x061d('0xb'));var jsforce=require(_0x061d('0xc'));var deskjs=require(_0x061d('0xd'));var toCsv=require(_0x061d('0x7'));var querystring=require('querystring');var Papa=require(_0x061d('0xe'));var Redis=require('ioredis');var authService=require(_0x061d('0xf'));var qs=require(_0x061d('0x10'));var as=require(_0x061d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x061d('0x12'))(_0x061d('0x13'));var utils=require(_0x061d('0x14'));var config=require(_0x061d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x061d('0x16'))['db'];function respondWithStatusCode(_0x1d48db,_0x1a7bbd){_0x1a7bbd=_0x1a7bbd||0xcc;return function(_0x2802d5){if(_0x2802d5){return _0x1d48db['sendStatus'](_0x1a7bbd);}return _0x1d48db['status'](_0x1a7bbd)['end']();};}function respondWithResult(_0x5a0412,_0xa524f8){_0xa524f8=_0xa524f8||0xc8;return function(_0x25ad0a){if(_0x25ad0a){return _0x5a0412['status'](_0xa524f8)[_0x061d('0x17')](_0x25ad0a);}};}function respondWithFilteredResult(_0x4d9897,_0x4f008e){return function(_0x3d527d){if(_0x3d527d){var _0x55cc04=typeof _0x4f008e['offset']===_0x061d('0x18')&&typeof _0x4f008e[_0x061d('0x19')]===_0x061d('0x18');var _0xaa659c=_0x3d527d['count'];var _0x5ac26f=_0x55cc04?0x0:_0x4f008e[_0x061d('0x1a')];var _0x259004=_0x55cc04?_0x3d527d['count']:_0x4f008e[_0x061d('0x1a')]+_0x4f008e[_0x061d('0x19')];var _0x3a3982;if(_0x259004>=_0xaa659c){_0x259004=_0xaa659c;_0x3a3982=0xc8;}else{_0x3a3982=0xce;}_0x4d9897[_0x061d('0x1b')](_0x3a3982);return _0x4d9897[_0x061d('0x1c')](_0x061d('0x1d'),_0x5ac26f+'-'+_0x259004+'/'+_0xaa659c)[_0x061d('0x17')](_0x3d527d);}return null;};}function patchUpdates(_0x319b75){return function(_0x11f7cd){try{jsonpatch[_0x061d('0x1e')](_0x11f7cd,_0x319b75,!![]);}catch(_0x5e784d){return BPromise[_0x061d('0x1f')](_0x5e784d);}return _0x11f7cd['save']();};}function saveUpdates(_0x3d0187,_0x47821d){return function(_0x1ebd74){if(_0x1ebd74){return _0x1ebd74[_0x061d('0x20')](_0x3d0187)[_0x061d('0x21')](function(_0x3984c7){return _0x3984c7;});}return null;};}function removeEntity(_0x25387b,_0x7f79c6){return function(_0x477905){if(_0x477905){return _0x477905['destroy']()[_0x061d('0x21')](function(){_0x25387b[_0x061d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe868ef,_0x4e7f42){return function(_0x4a1f6c){if(!_0x4a1f6c){_0xe868ef[_0x061d('0x22')](0x194);}return _0x4a1f6c;};}function handleError(_0x172849,_0xf65672){_0xf65672=_0xf65672||0x1f4;return function(_0x1283a2){logger[_0x061d('0x23')](_0x1283a2[_0x061d('0x24')]);if(_0x1283a2[_0x061d('0x25')]){delete _0x1283a2[_0x061d('0x25')];}_0x172849['status'](_0xf65672)[_0x061d('0x26')](_0x1283a2);};}exports[_0x061d('0x27')]=function(_0x5465e3,_0x48b610){var _0x1c7aba={},_0x30b3c4={},_0x22a798={'count':0x0,'rows':[]};var _0x44e098=_[_0x061d('0x28')](db['AnalyticFieldReport'][_0x061d('0x29')],function(_0x139786){return{'name':_0x139786[_0x061d('0x2a')],'type':_0x139786[_0x061d('0x2b')][_0x061d('0x2c')]};});_0x30b3c4[_0x061d('0x2d')]=_[_0x061d('0x28')](_0x44e098,'name');_0x30b3c4['query']=_['keys'](_0x5465e3['query']);_0x30b3c4[_0x061d('0x2e')]=_['intersection'](_0x30b3c4[_0x061d('0x2d')],_0x30b3c4[_0x061d('0x2f')]);_0x1c7aba['attributes']=_[_0x061d('0x30')](_0x30b3c4[_0x061d('0x2d')],qs['fields'](_0x5465e3[_0x061d('0x2f')]['fields']));_0x1c7aba[_0x061d('0x31')]=_0x1c7aba[_0x061d('0x31')][_0x061d('0x32')]?_0x1c7aba[_0x061d('0x31')]:_0x30b3c4[_0x061d('0x2d')];if(!_0x5465e3[_0x061d('0x2f')][_0x061d('0x33')](_0x061d('0x34'))){_0x1c7aba[_0x061d('0x19')]=qs[_0x061d('0x19')](_0x5465e3[_0x061d('0x2f')][_0x061d('0x19')]);_0x1c7aba[_0x061d('0x1a')]=qs[_0x061d('0x1a')](_0x5465e3[_0x061d('0x2f')][_0x061d('0x1a')]);}_0x1c7aba[_0x061d('0x35')]=qs[_0x061d('0x36')](_0x5465e3[_0x061d('0x2f')][_0x061d('0x36')]);_0x1c7aba[_0x061d('0x37')]=qs['filters'](_['pick'](_0x5465e3['query'],_0x30b3c4[_0x061d('0x2e')]),_0x44e098);if(_0x5465e3['query'][_0x061d('0x38')]){_0x1c7aba['where']=_[_0x061d('0x39')](_0x1c7aba['where'],{'$or':_[_0x061d('0x28')](_0x44e098,function(_0x4b139e){if(_0x4b139e['type']!=='VIRTUAL'){var _0x3534d6={};_0x3534d6[_0x4b139e[_0x061d('0x25')]]={'$like':'%'+_0x5465e3[_0x061d('0x2f')][_0x061d('0x38')]+'%'};return _0x3534d6;}})});}_0x1c7aba=_['merge']({},_0x1c7aba,_0x5465e3[_0x061d('0x3a')]);var _0x18f0be={'where':_0x1c7aba[_0x061d('0x37')]};return db[_0x061d('0x3b')]['count'](_0x18f0be)[_0x061d('0x21')](function(_0xb95551){_0x22a798[_0x061d('0x3c')]=_0xb95551;if(_0x5465e3[_0x061d('0x2f')]['includeAll']){_0x1c7aba[_0x061d('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x061d('0x3e')](_0x1c7aba);})[_0x061d('0x21')](function(_0xc2b1b9){_0x22a798['rows']=_0xc2b1b9;return _0x22a798;})[_0x061d('0x21')](respondWithFilteredResult(_0x48b610,_0x1c7aba))[_0x061d('0x3f')](handleError(_0x48b610,null));};exports[_0x061d('0x40')]=function(_0x49a7e7,_0x56a8fe){var _0x277d4c={'raw':![],'where':{'id':_0x49a7e7[_0x061d('0x41')]['id']}},_0x540591={};_0x540591['model']=_[_0x061d('0x42')](db['AnalyticFieldReport']['rawAttributes']);_0x540591[_0x061d('0x2f')]=_['keys'](_0x49a7e7['query']);_0x540591[_0x061d('0x2e')]=_['intersection'](_0x540591[_0x061d('0x2d')],_0x540591['query']);_0x277d4c[_0x061d('0x31')]=_[_0x061d('0x30')](_0x540591[_0x061d('0x2d')],qs[_0x061d('0x43')](_0x49a7e7['query'][_0x061d('0x43')]));_0x277d4c['attributes']=_0x277d4c[_0x061d('0x31')][_0x061d('0x32')]?_0x277d4c[_0x061d('0x31')]:_0x540591[_0x061d('0x2d')];if(_0x49a7e7[_0x061d('0x2f')][_0x061d('0x44')]){_0x277d4c[_0x061d('0x3d')]=[{'all':!![]}];}_0x277d4c=_['merge']({},_0x277d4c,_0x49a7e7[_0x061d('0x3a')]);return db[_0x061d('0x3b')][_0x061d('0x45')](_0x277d4c)[_0x061d('0x21')](handleEntityNotFound(_0x56a8fe,null))[_0x061d('0x21')](respondWithResult(_0x56a8fe,null))['catch'](handleError(_0x56a8fe,null));};exports[_0x061d('0x46')]=function(_0x122648,_0x5096ef){return db[_0x061d('0x3b')][_0x061d('0x46')](_0x122648[_0x061d('0x47')],{})[_0x061d('0x21')](respondWithResult(_0x5096ef,0xc9))[_0x061d('0x3f')](handleError(_0x5096ef,null));};exports[_0x061d('0x48')]=function(_0x9a4ff,_0x1b7c7e){return db[_0x061d('0x3b')][_0x061d('0x48')](_0x9a4ff[_0x061d('0x47')],{'raw':![],'individualHooks':!![]})[_0x061d('0x21')](respondWithResult(_0x1b7c7e,0xc9))[_0x061d('0x3f')](handleError(_0x1b7c7e,null));};exports['update']=function(_0x5243c8,_0x507b59){if(_0x5243c8[_0x061d('0x47')]['id']){delete _0x5243c8[_0x061d('0x47')]['id'];}return db[_0x061d('0x3b')][_0x061d('0x45')]({'where':{'id':_0x5243c8['params']['id']}})[_0x061d('0x21')](handleEntityNotFound(_0x507b59,null))[_0x061d('0x21')](saveUpdates(_0x5243c8[_0x061d('0x47')],null))[_0x061d('0x21')](respondWithResult(_0x507b59,null))['catch'](handleError(_0x507b59,null));};exports[_0x061d('0x49')]=function(_0x20b1fd,_0x51ffa8){return db[_0x061d('0x3b')][_0x061d('0x45')]({'where':{'id':_0x20b1fd[_0x061d('0x41')]['id']}})[_0x061d('0x21')](handleEntityNotFound(_0x51ffa8,null))[_0x061d('0x21')](removeEntity(_0x51ffa8,null))[_0x061d('0x3f')](handleError(_0x51ffa8,null));};exports[_0x061d('0x4a')]=function(_0x51f2ad,_0x1da0ba){return db[_0x061d('0x3b')]['destroy']({'where':{'id':_0x51f2ad[_0x061d('0x2f')][_0x061d('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x061d('0x21')](respondWithResult(_0x1da0ba,0xcc))[_0x061d('0x3f')](handleError(_0x1da0ba,null));};exports[_0x061d('0x4c')]=function(_0x5c35fd,_0x2a3168,_0x1bd315){return db[_0x061d('0x4d')][_0x061d('0x4e')]({'where':{'id':_0x5c35fd[_0x061d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a3168,null))[_0x061d('0x21')](function(_0x51feb4){if(_0x51feb4){return db['sequelize']['transaction'](function(_0x9fd6b4){return db[_0x061d('0x3b')][_0x061d('0x49')]({'where':{'CustomReportId':_0x5c35fd[_0x061d('0x41')]['id']},'transaction':_0x9fd6b4})[_0x061d('0x21')](function(_0x447120){var _0x57a2b6=_[_0x061d('0x28')](_0x5c35fd[_0x061d('0x47')],function(_0x4be138){delete _0x4be138['id'];_0x4be138['CustomReportId']=_0x5c35fd[_0x061d('0x41')]['id'];return _0x4be138;});return db[_0x061d('0x3b')][_0x061d('0x48')](_0x57a2b6,{'transaction':_0x9fd6b4});});})[_0x061d('0x21')](function(){return db[_0x061d('0x3b')][_0x061d('0x3e')]({'where':{'CustomReportId':_0x5c35fd[_0x061d('0x41')]['id']}});});}})[_0x061d('0x21')](respondWithResult(_0x2a3168,null))[_0x061d('0x3f')](handleError(_0x2a3168,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ae2e931..f465cbf 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 _0x853f=['exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./analyticFieldReport.attributes'];(function(_0x51a28f,_0x34487b){var _0xfe487c=function(_0x4ec89e){while(--_0x4ec89e){_0x51a28f['push'](_0x51a28f['shift']());}};_0xfe487c(++_0x34487b);}(_0x853f,0x12f));var _0xf853=function(_0x579e20,_0x366677){_0x579e20=_0x579e20-0x0;var _0x2aa0fe=_0x853f[_0x579e20];return _0x2aa0fe;};'use strict';var _=require(_0xf853('0x0'));var util=require(_0xf853('0x1'));var logger=require(_0xf853('0x2'))(_0xf853('0x3'));var moment=require(_0xf853('0x4'));var BPromise=require(_0xf853('0x5'));var rp=require(_0xf853('0x6'));var fs=require('fs');var path=require(_0xf853('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf853('0x8'));module[_0xf853('0x9')]=function(_0x4b77e8,_0x207957){return _0x4b77e8[_0xf853('0xa')](_0xf853('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc62c=['define','AnalyticFieldReport','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x517950,_0xca8a59){var _0x212aeb=function(_0x10f6a9){while(--_0x10f6a9){_0x517950['push'](_0x517950['shift']());}};_0x212aeb(++_0xca8a59);}(_0xc62c,0xb2));var _0xcc62=function(_0x414e8a,_0x41f2f4){_0x414e8a=_0x414e8a-0x0;var _0x2a5a7a=_0xc62c[_0x414e8a];return _0x2a5a7a;};'use strict';var _=require(_0xcc62('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcc62('0x1'));var BPromise=require(_0xcc62('0x2'));var rp=require(_0xcc62('0x3'));var fs=require('fs');var path=require(_0xcc62('0x4'));var rimraf=require(_0xcc62('0x5'));var config=require(_0xcc62('0x6'));var attributes=require(_0xcc62('0x7'));module[_0xcc62('0x8')]=function(_0x247640,_0x5a81b4){return _0x247640[_0xcc62('0x9')](_0xcc62('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index e308d14..f909676 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 _0x151e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x8f66f3,_0x4e375c){var _0x26697b=function(_0x1ded91){while(--_0x1ded91){_0x8f66f3['push'](_0x8f66f3['shift']());}};_0x26697b(++_0x4e375c);}(_0x151e,0x1cb));var _0xe151=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x151e[_0x545fe3];return _0x480702;};'use strict';var _=require(_0xe151('0x0'));var util=require(_0xe151('0x1'));var moment=require(_0xe151('0x2'));var BPromise=require(_0xe151('0x3'));var rs=require(_0xe151('0x4'));var fs=require('fs');var Redis=require(_0xe151('0x5'));var db=require(_0xe151('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe151('0x7'))('rpc');var config=require(_0xe151('0x8'));var jayson=require(_0xe151('0x9'));var client=jayson['client'][_0xe151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f2621,_0x34feda,_0x5380d2){return new BPromise(function(_0x5e92f2,_0x547d4f){return client[_0xe151('0xb')](_0x1f2621,_0x5380d2)['then'](function(_0x58696d){logger['info'](_0xe151('0xc'),_0x34feda,_0xe151('0xd'));logger[_0xe151('0xe')](_0xe151('0xf'),_0x34feda,'request\x20sent',JSON[_0xe151('0x10')](_0x58696d));if(_0x58696d['error']){if(_0x58696d[_0xe151('0x11')][_0xe151('0x12')]===0x1f4){logger[_0xe151('0x11')](_0xe151('0xc'),_0x34feda,_0x58696d[_0xe151('0x11')]['message']);return _0x547d4f(_0x58696d[_0xe151('0x11')]['message']);}logger[_0xe151('0x11')](_0xe151('0xc'),_0x34feda,_0x58696d[_0xe151('0x11')][_0xe151('0x13')]);return _0x5e92f2(_0x58696d[_0xe151('0x11')][_0xe151('0x13')]);}else{logger['info'](_0xe151('0xc'),_0x34feda,_0xe151('0xd'));_0x5e92f2(_0x58696d[_0xe151('0x14')][_0xe151('0x13')]);}})[_0xe151('0x15')](function(_0x3524cd){logger[_0xe151('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x34feda,_0x3524cd);_0x547d4f(_0x3524cd);});});} \ No newline at end of file +var _0x5416=['info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5416,0x13d));var _0x6541=function(_0x3ade21,_0x41d4e0){_0x3ade21=_0x3ade21-0x0;var _0x114a92=_0x5416[_0x3ade21];return _0x114a92;};'use strict';var _=require(_0x6541('0x0'));var util=require(_0x6541('0x1'));var moment=require(_0x6541('0x2'));var BPromise=require(_0x6541('0x3'));var rs=require(_0x6541('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6541('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6541('0x6'))(_0x6541('0x7'));var config=require('../../config/environment');var jayson=require(_0x6541('0x8'));var client=jayson[_0x6541('0x9')][_0x6541('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38fe33,_0x176fc3,_0x327a7c){return new BPromise(function(_0x37d7cd,_0x21e1bc){return client[_0x6541('0xb')](_0x38fe33,_0x327a7c)[_0x6541('0xc')](function(_0x34270f){logger[_0x6541('0xd')](_0x6541('0xe'),_0x176fc3,'request\x20sent');logger[_0x6541('0xf')](_0x6541('0x10'),_0x176fc3,'request\x20sent',JSON['stringify'](_0x34270f));if(_0x34270f['error']){if(_0x34270f[_0x6541('0x11')][_0x6541('0x12')]===0x1f4){logger['error'](_0x6541('0xe'),_0x176fc3,_0x34270f[_0x6541('0x11')][_0x6541('0x13')]);return _0x21e1bc(_0x34270f[_0x6541('0x11')][_0x6541('0x13')]);}logger['error'](_0x6541('0xe'),_0x176fc3,_0x34270f[_0x6541('0x11')]['message']);return _0x37d7cd(_0x34270f[_0x6541('0x11')]['message']);}else{logger['info'](_0x6541('0xe'),_0x176fc3,_0x6541('0x14'));_0x37d7cd(_0x34270f[_0x6541('0x15')]['message']);}})['catch'](function(_0x20e117){logger[_0x6541('0x11')](_0x6541('0xe'),_0x176fc3,_0x20e117);_0x21e1bc(_0x20e117);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 388efd8..975d86d 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(_0x273051,_0x19511f){var _0x5b984b=function(_0x328b66){while(--_0x328b66){_0x273051['push'](_0x273051['shift']());}};_0x5b984b(++_0x19511f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x28e8fe,_0x25ecdd){var _0x594f0c=function(_0x4fc2a1){while(--_0x4fc2a1){_0x28e8fe['push'](_0x28e8fe['shift']());}};_0x594f0c(++_0x25ecdd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 7120cdc..7d10a6a 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 _0xe58a=['sequelize','exports','STRING'];(function(_0x23f1fa,_0x127e2c){var _0x4816ce=function(_0x4d6fbf){while(--_0x4d6fbf){_0x23f1fa['push'](_0x23f1fa['shift']());}};_0x4816ce(++_0x127e2c);}(_0xe58a,0x9f));var _0xae58=function(_0x262c8e,_0x4deb4a){_0x262c8e=_0x262c8e-0x0;var _0x573957=_0xe58a[_0x262c8e];return _0x573957;};'use strict';var Sequelize=require(_0xae58('0x0'));module[_0xae58('0x1')]={'name':{'type':Sequelize[_0xae58('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xae58('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7462=['sequelize','exports','STRING'];(function(_0x14e08d,_0x32d8fa){var _0x57b194=function(_0x4dcc8d){while(--_0x4dcc8d){_0x14e08d['push'](_0x14e08d['shift']());}};_0x57b194(++_0x32d8fa);}(_0x7462,0x165));var _0x2746=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x7462[_0x1ca9eb];return _0x2e284e;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2746('0x2')]},'metric':{'type':Sequelize['TEXT']},'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 076b1e5..777fb29 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','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','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x77cd04,_0x525763){var _0x8129d2=function(_0x3f81f6){while(--_0x3f81f6){_0x77cd04['push'](_0x77cd04['shift']());}};_0x8129d2(++_0x525763);}(_0x98a8,0x12c));var _0x898a=function(_0x5c6919,_0x8cf1e5){_0x5c6919=_0x5c6919-0x0;var _0x2ade4e=_0x98a8[_0x5c6919];return _0x2ade4e;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x47e453,_0x4b4fe2){var _0xa8d8cb=function(_0x53cf45){while(--_0x53cf45){_0x47e453['push'](_0x47e453['shift']());}};_0xa8d8cb(++_0x4b4fe2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xf37b8d,_0x42ce54){_0xf37b8d=_0xf37b8d-0x0;var _0x3b0b62=_0x7fbe[_0xf37b8d];return _0x3b0b62;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d87620a..3a32808 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 _0x3148=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3148,0x1d3));var _0x8314=function(_0x551597,_0x11e749){_0x551597=_0x551597-0x0;var _0x51dfed=_0x3148[_0x551597];return _0x51dfed;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var logger=require('../../config/logger')(_0x8314('0x2'));var moment=require(_0x8314('0x3'));var BPromise=require(_0x8314('0x4'));var rp=require(_0x8314('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var attributes=require(_0x8314('0x8'));module[_0x8314('0x9')]=function(_0x18a30b,_0x9cb271){return _0x18a30b[_0x8314('0xa')]('AnalyticMetric',attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf0d=['analytics_metrics','util','../../config/logger','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x18debc,_0x4ff733){var _0x3b543a=function(_0x2dc423){while(--_0x2dc423){_0x18debc['push'](_0x18debc['shift']());}};_0x3b543a(++_0x4ff733);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x1537ba,_0x14f5f4){_0x1537ba=_0x1537ba-0x0;var _0x176900=_0xaf0d[_0x1537ba];return _0x176900;};'use strict';var _=require('lodash');var util=require(_0xdaf0('0x0'));var logger=require(_0xdaf0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaf0('0x2'));var config=require(_0xdaf0('0x3'));var attributes=require(_0xdaf0('0x4'));module['exports']=function(_0x35fe4f,_0x14b19d){return _0x35fe4f['define']('AnalyticMetric',attributes,{'tableName':_0xdaf0('0x5'),'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 c82ffcd..822c668 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 _0x9e9a=['catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result'];(function(_0x2dbd99,_0x1491fb){var _0x4e60a9=function(_0x234358){while(--_0x234358){_0x2dbd99['push'](_0x2dbd99['shift']());}};_0x4e60a9(++_0x1491fb);}(_0x9e9a,0x1cc));var _0xa9e9=function(_0x58321f,_0x5730b9){_0x58321f=_0x58321f-0x0;var _0x3728ea=_0x9e9a[_0x58321f];return _0x3728ea;};'use strict';var _=require('lodash');var util=require(_0xa9e9('0x0'));var moment=require('moment');var BPromise=require(_0xa9e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9e9('0x2'));var db=require(_0xa9e9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9e9('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa9e9('0x5'));var client=jayson[_0xa9e9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3055c2,_0x4e3853,_0x6241e6){return new BPromise(function(_0x834354,_0x3ab787){return client[_0xa9e9('0x7')](_0x3055c2,_0x6241e6)['then'](function(_0x2eca63){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4e3853,'request\x20sent');logger[_0xa9e9('0x8')](_0xa9e9('0x9'),_0x4e3853,'request\x20sent',JSON[_0xa9e9('0xa')](_0x2eca63));if(_0x2eca63[_0xa9e9('0xb')]){if(_0x2eca63[_0xa9e9('0xb')]['code']===0x1f4){logger[_0xa9e9('0xb')](_0xa9e9('0xc'),_0x4e3853,_0x2eca63[_0xa9e9('0xb')]['message']);return _0x3ab787(_0x2eca63['error']['message']);}logger['error'](_0xa9e9('0xc'),_0x4e3853,_0x2eca63['error']['message']);return _0x834354(_0x2eca63[_0xa9e9('0xb')][_0xa9e9('0xd')]);}else{logger[_0xa9e9('0xe')](_0xa9e9('0xc'),_0x4e3853,'request\x20sent');_0x834354(_0x2eca63[_0xa9e9('0xf')][_0xa9e9('0xd')]);}})[_0xa9e9('0x10')](function(_0x3371b3){logger[_0xa9e9('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x4e3853,_0x3371b3);_0x3ab787(_0x3371b3);});});} \ No newline at end of file +var _0x7118=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x823a0f,_0xd424a8){var _0x8c5736=function(_0x4419dc){while(--_0x4419dc){_0x823a0f['push'](_0x823a0f['shift']());}};_0x8c5736(++_0xd424a8);}(_0x7118,0x11c));var _0x8711=function(_0x5bc302,_0xa27162){_0x5bc302=_0x5bc302-0x0;var _0x90a040=_0x7118[_0x5bc302];return _0x90a040;};'use strict';var _=require('lodash');var util=require(_0x8711('0x0'));var moment=require(_0x8711('0x1'));var BPromise=require(_0x8711('0x2'));var rs=require(_0x8711('0x3'));var fs=require('fs');var Redis=require(_0x8711('0x4'));var db=require(_0x8711('0x5'))['db'];var utils=require(_0x8711('0x6'));var logger=require('../../config/logger')(_0x8711('0x7'));var config=require(_0x8711('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfc0546,_0x15292e,_0x4cdffa){return new BPromise(function(_0x264f4b,_0x38bbff){return client[_0x8711('0x9')](_0xfc0546,_0x4cdffa)[_0x8711('0xa')](function(_0x4ff4fa){logger[_0x8711('0xb')](_0x8711('0xc'),_0x15292e,_0x8711('0xd'));logger['debug'](_0x8711('0xe'),_0x15292e,_0x8711('0xd'),JSON[_0x8711('0xf')](_0x4ff4fa));if(_0x4ff4fa[_0x8711('0x10')]){if(_0x4ff4fa[_0x8711('0x10')][_0x8711('0x11')]===0x1f4){logger[_0x8711('0x10')](_0x8711('0xc'),_0x15292e,_0x4ff4fa[_0x8711('0x10')]['message']);return _0x38bbff(_0x4ff4fa[_0x8711('0x10')]['message']);}logger[_0x8711('0x10')](_0x8711('0xc'),_0x15292e,_0x4ff4fa[_0x8711('0x10')][_0x8711('0x12')]);return _0x264f4b(_0x4ff4fa['error'][_0x8711('0x12')]);}else{logger['info'](_0x8711('0xc'),_0x15292e,_0x8711('0xd'));_0x264f4b(_0x4ff4fa['result'][_0x8711('0x12')]);}})[_0x8711('0x13')](function(_0x4fc93a){logger[_0x8711('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x15292e,_0x4fc93a);_0x38bbff(_0x4fc93a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 31f1c6a..3f5bd85 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 _0xb7a7=['isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x10dd0e,_0x14334c){var _0x1f5440=function(_0x1a53bf){while(--_0x1a53bf){_0x10dd0e['push'](_0x10dd0e['shift']());}};_0x1f5440(++_0x14334c);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x4aa8d7,_0x6152b8){_0x4aa8d7=_0x4aa8d7-0x0;var _0x23ea3b=_0xb7a7[_0x4aa8d7];return _0x23ea3b;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require(_0x7b7a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b7a('0x5'));var interaction=require(_0x7b7a('0x6'));var config=require(_0x7b7a('0x7'));var controller=require('./analyticMetric.controller');router[_0x7b7a('0x8')]('/',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xa')]);router[_0x7b7a('0x8')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0xd')]('/',auth[_0x7b7a('0x9')](),controller['create']);router[_0x7b7a('0xe')]('/:id',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xf')]);router[_0x7b7a('0x10')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef39=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x53f1de,_0x37d8d3){var _0x2fa505=function(_0x220b34){while(--_0x220b34){_0x53f1de['push'](_0x53f1de['shift']());}};_0x2fa505(++_0x37d8d3);}(_0xef39,0x92));var _0x9ef3=function(_0x579bad,_0x4501a6){_0x579bad=_0x579bad-0x0;var _0x1a3ee5=_0xef39[_0x579bad];return _0x1a3ee5;};'use strict';var multer=require('multer');var util=require(_0x9ef3('0x0'));var path=require(_0x9ef3('0x1'));var timeout=require(_0x9ef3('0x2'));var express=require(_0x9ef3('0x3'));var router=express[_0x9ef3('0x4')]();var fs_extra=require(_0x9ef3('0x5'));var auth=require(_0x9ef3('0x6'));var interaction=require(_0x9ef3('0x7'));var config=require(_0x9ef3('0x8'));var controller=require(_0x9ef3('0x9'));router[_0x9ef3('0xa')]('/',auth[_0x9ef3('0xb')](),controller['index']);router[_0x9ef3('0xa')](_0x9ef3('0xc'),auth[_0x9ef3('0xb')](),controller[_0x9ef3('0xd')]);router[_0x9ef3('0xe')]('/',auth[_0x9ef3('0xb')](),controller[_0x9ef3('0xf')]);router[_0x9ef3('0x10')](_0x9ef3('0xc'),auth[_0x9ef3('0xb')](),controller[_0x9ef3('0x11')]);router[_0x9ef3('0x12')](_0x9ef3('0xc'),auth['isAuthenticated'](),controller[_0x9ef3('0x13')]);module[_0x9ef3('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ede447e..f740c09 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 _0xd74c=['exports','TEXT'];(function(_0x13c727,_0x96a479){var _0x1fc9c9=function(_0x52df68){while(--_0x52df68){_0x13c727['push'](_0x13c727['shift']());}};_0x1fc9c9(++_0x96a479);}(_0xd74c,0xb4));var _0xcd74=function(_0x1b8456,_0x3a5bdb){_0x1b8456=_0x1b8456-0x0;var _0x166804=_0xd74c[_0x1b8456];return _0x166804;};'use strict';var Sequelize=require('sequelize');module[_0xcd74('0x0')]={'tree':{'type':Sequelize[_0xcd74('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd58d=['exports','TEXT','sequelize'];(function(_0x1a5551,_0x2e8f97){var _0x7e4fa6=function(_0x331f8c){while(--_0x331f8c){_0x1a5551['push'](_0x1a5551['shift']());}};_0x7e4fa6(++_0x2e8f97);}(_0xd58d,0x176));var _0xdd58=function(_0x5c4b9f,_0xe37aa5){_0x5c4b9f=_0x5c4b9f-0x0;var _0x8534f4=_0xd58d[_0x5c4b9f];return _0x8534f4;};'use strict';var Sequelize=require(_0xdd58('0x0'));module[_0xdd58('0x1')]={'tree':{'type':Sequelize[_0xdd58('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 5ecaadf..b73c108 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 _0x64ae=['apply','reject','update','then','destroy','end','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','create','body','catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x64ae,0x6f));var _0xe64a=function(_0xf69e1e,_0x4e2d8e){_0xf69e1e=_0xf69e1e-0x0;var _0x3a33a7=_0x64ae[_0xf69e1e];return _0x3a33a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe64a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe64a('0x1'));var rp=require(_0xe64a('0x2'));var moment=require(_0xe64a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe64a('0x4'));var util=require(_0xe64a('0x5'));var path=require(_0xe64a('0x6'));var sox=require(_0xe64a('0x7'));var csv=require(_0xe64a('0x8'));var ejs=require(_0xe64a('0x9'));var fs=require('fs');var fs_extra=require(_0xe64a('0xa'));var _=require(_0xe64a('0xb'));var squel=require(_0xe64a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe64a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe64a('0xe'));var Papa=require(_0xe64a('0xf'));var Redis=require('ioredis');var authService=require(_0xe64a('0x10'));var qs=require(_0xe64a('0x11'));var as=require(_0xe64a('0x12'));var hardwareService=require(_0xe64a('0x13'));var logger=require(_0xe64a('0x14'))(_0xe64a('0x15'));var utils=require(_0xe64a('0x16'));var config=require(_0xe64a('0x17'));var licenseUtil=require(_0xe64a('0x18'));var db=require(_0xe64a('0x19'))['db'];function respondWithStatusCode(_0x5ddd62,_0xc22e82){_0xc22e82=_0xc22e82||0xcc;return function(_0x1c949a){if(_0x1c949a){return _0x5ddd62[_0xe64a('0x1a')](_0xc22e82);}return _0x5ddd62[_0xe64a('0x1b')](_0xc22e82)['end']();};}function respondWithResult(_0x4cf708,_0x286617){_0x286617=_0x286617||0xc8;return function(_0x37f9f){if(_0x37f9f){return _0x4cf708[_0xe64a('0x1b')](_0x286617)['json'](_0x37f9f);}};}function respondWithFilteredResult(_0x3cefb3,_0x23ae55){return function(_0x22274b){if(_0x22274b){var _0x4a3203=typeof _0x23ae55[_0xe64a('0x1c')]===_0xe64a('0x1d')&&typeof _0x23ae55[_0xe64a('0x1e')]==='undefined';var _0x29eb28=_0x22274b[_0xe64a('0x1f')];var _0x5a9ee8=_0x4a3203?0x0:_0x23ae55['offset'];var _0x31034c=_0x4a3203?_0x22274b[_0xe64a('0x1f')]:_0x23ae55[_0xe64a('0x1c')]+_0x23ae55[_0xe64a('0x1e')];var _0x6eb81a;if(_0x31034c>=_0x29eb28){_0x31034c=_0x29eb28;_0x6eb81a=0xc8;}else{_0x6eb81a=0xce;}_0x3cefb3[_0xe64a('0x1b')](_0x6eb81a);return _0x3cefb3[_0xe64a('0x20')](_0xe64a('0x21'),_0x5a9ee8+'-'+_0x31034c+'/'+_0x29eb28)[_0xe64a('0x22')](_0x22274b);}return null;};}function patchUpdates(_0x4f2213){return function(_0x3d2ce4){try{jsonpatch[_0xe64a('0x23')](_0x3d2ce4,_0x4f2213,!![]);}catch(_0x1af542){return BPromise[_0xe64a('0x24')](_0x1af542);}return _0x3d2ce4['save']();};}function saveUpdates(_0x15d8df,_0x390a50){return function(_0x477846){if(_0x477846){return _0x477846[_0xe64a('0x25')](_0x15d8df)[_0xe64a('0x26')](function(_0x53e836){return _0x53e836;});}return null;};}function removeEntity(_0x133686,_0x4592c6){return function(_0x490e33){if(_0x490e33){return _0x490e33[_0xe64a('0x27')]()[_0xe64a('0x26')](function(){_0x133686[_0xe64a('0x1b')](0xcc)[_0xe64a('0x28')]();});}};}function handleEntityNotFound(_0x1e3822,_0x19250b){return function(_0x25a9dc){if(!_0x25a9dc){_0x1e3822['sendStatus'](0x194);}return _0x25a9dc;};}function handleError(_0x1da39f,_0x556983){_0x556983=_0x556983||0x1f4;return function(_0x4aba2c){logger['error'](_0x4aba2c[_0xe64a('0x29')]);if(_0x4aba2c[_0xe64a('0x2a')]){delete _0x4aba2c[_0xe64a('0x2a')];}_0x1da39f[_0xe64a('0x1b')](_0x556983)['send'](_0x4aba2c);};}exports['index']=function(_0x491552,_0x138799){var _0x5e0bcd={},_0x321eee={},_0x4562c3={'count':0x0,'rows':[]};var _0x56c6b0=_[_0xe64a('0x2b')](db[_0xe64a('0x2c')][_0xe64a('0x2d')],function(_0x16a572){return{'name':_0x16a572[_0xe64a('0x2e')],'type':_0x16a572[_0xe64a('0x2f')]['key']};});_0x321eee[_0xe64a('0x30')]=_[_0xe64a('0x2b')](_0x56c6b0,'name');_0x321eee[_0xe64a('0x31')]=_[_0xe64a('0x32')](_0x491552[_0xe64a('0x31')]);_0x321eee['filters']=_['intersection'](_0x321eee[_0xe64a('0x30')],_0x321eee[_0xe64a('0x31')]);_0x5e0bcd['attributes']=_['intersection'](_0x321eee['model'],qs[_0xe64a('0x33')](_0x491552['query'][_0xe64a('0x33')]));_0x5e0bcd[_0xe64a('0x34')]=_0x5e0bcd[_0xe64a('0x34')][_0xe64a('0x35')]?_0x5e0bcd[_0xe64a('0x34')]:_0x321eee[_0xe64a('0x30')];if(!_0x491552[_0xe64a('0x31')]['hasOwnProperty'](_0xe64a('0x36'))){_0x5e0bcd[_0xe64a('0x1e')]=qs[_0xe64a('0x1e')](_0x491552['query'][_0xe64a('0x1e')]);_0x5e0bcd[_0xe64a('0x1c')]=qs[_0xe64a('0x1c')](_0x491552[_0xe64a('0x31')][_0xe64a('0x1c')]);}_0x5e0bcd[_0xe64a('0x37')]=qs[_0xe64a('0x38')](_0x491552[_0xe64a('0x31')][_0xe64a('0x38')]);_0x5e0bcd[_0xe64a('0x39')]=qs[_0xe64a('0x3a')](_['pick'](_0x491552['query'],_0x321eee[_0xe64a('0x3a')]),_0x56c6b0);if(_0x491552[_0xe64a('0x31')][_0xe64a('0x3b')]){_0x5e0bcd[_0xe64a('0x39')]=_[_0xe64a('0x3c')](_0x5e0bcd['where'],{'$or':_[_0xe64a('0x2b')](_0x56c6b0,function(_0xd988fd){if(_0xd988fd[_0xe64a('0x2f')]!==_0xe64a('0x3d')){var _0x4aa624={};_0x4aa624[_0xd988fd['name']]={'$like':'%'+_0x491552[_0xe64a('0x31')][_0xe64a('0x3b')]+'%'};return _0x4aa624;}})});}_0x5e0bcd=_[_0xe64a('0x3c')]({},_0x5e0bcd,_0x491552[_0xe64a('0x3e')]);var _0x28429b={'where':_0x5e0bcd[_0xe64a('0x39')]};return db['AnalyticTreeReport']['count'](_0x28429b)[_0xe64a('0x26')](function(_0x31118d){_0x4562c3['count']=_0x31118d;if(_0x491552[_0xe64a('0x31')][_0xe64a('0x3f')]){_0x5e0bcd[_0xe64a('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x5e0bcd);})[_0xe64a('0x26')](function(_0x3286eb){_0x4562c3[_0xe64a('0x41')]=_0x3286eb;return _0x4562c3;})[_0xe64a('0x26')](respondWithFilteredResult(_0x138799,_0x5e0bcd))['catch'](handleError(_0x138799,null));};exports[_0xe64a('0x42')]=function(_0x233f1f,_0x5778bc){var _0x467a6d={'raw':!![],'where':{'id':_0x233f1f[_0xe64a('0x43')]['id']}},_0x4827ba={};_0x4827ba['model']=_[_0xe64a('0x32')](db['AnalyticTreeReport'][_0xe64a('0x2d')]);_0x4827ba[_0xe64a('0x31')]=_[_0xe64a('0x32')](_0x233f1f[_0xe64a('0x31')]);_0x4827ba[_0xe64a('0x3a')]=_[_0xe64a('0x44')](_0x4827ba[_0xe64a('0x30')],_0x4827ba[_0xe64a('0x31')]);_0x467a6d['attributes']=_[_0xe64a('0x44')](_0x4827ba[_0xe64a('0x30')],qs[_0xe64a('0x33')](_0x233f1f[_0xe64a('0x31')][_0xe64a('0x33')]));_0x467a6d[_0xe64a('0x34')]=_0x467a6d['attributes']['length']?_0x467a6d[_0xe64a('0x34')]:_0x4827ba[_0xe64a('0x30')];if(_0x233f1f[_0xe64a('0x31')][_0xe64a('0x3f')]){_0x467a6d[_0xe64a('0x40')]=[{'all':!![]}];}_0x467a6d=_[_0xe64a('0x3c')]({},_0x467a6d,_0x233f1f['options']);return db[_0xe64a('0x2c')][_0xe64a('0x45')](_0x467a6d)['then'](handleEntityNotFound(_0x5778bc,null))['then'](respondWithResult(_0x5778bc,null))['catch'](handleError(_0x5778bc,null));};exports[_0xe64a('0x46')]=function(_0x3a211c,_0x3dec49){return db[_0xe64a('0x2c')]['create'](_0x3a211c[_0xe64a('0x47')],{})[_0xe64a('0x26')](respondWithResult(_0x3dec49,0xc9))[_0xe64a('0x48')](handleError(_0x3dec49,null));};exports['update']=function(_0x258ad8,_0x483eac){if(_0x258ad8[_0xe64a('0x47')]['id']){delete _0x258ad8[_0xe64a('0x47')]['id'];}return db['AnalyticTreeReport'][_0xe64a('0x45')]({'where':{'id':_0x258ad8['params']['id']}})[_0xe64a('0x26')](handleEntityNotFound(_0x483eac,null))[_0xe64a('0x26')](saveUpdates(_0x258ad8[_0xe64a('0x47')],null))['then'](respondWithResult(_0x483eac,null))['catch'](handleError(_0x483eac,null));};exports[_0xe64a('0x27')]=function(_0x14af7e,_0x3d6a6e){return db['AnalyticTreeReport'][_0xe64a('0x45')]({'where':{'id':_0x14af7e[_0xe64a('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d6a6e,null))[_0xe64a('0x26')](removeEntity(_0x3d6a6e,null))[_0xe64a('0x48')](handleError(_0x3d6a6e,null));}; \ No newline at end of file +var _0x925a=['map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','length','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x164fa2,_0x1f1dbb){var _0x2e9988=function(_0x46e029){while(--_0x46e029){_0x164fa2['push'](_0x164fa2['shift']());}};_0x2e9988(++_0x1f1dbb);}(_0x925a,0x107));var _0xa925=function(_0x11dd75,_0x340f1c){_0x11dd75=_0x11dd75-0x0;var _0x21bd9b=_0x925a[_0x11dd75];return _0x21bd9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa925('0x0'));var zipdir=require(_0xa925('0x1'));var jsonpatch=require(_0xa925('0x2'));var rp=require(_0xa925('0x3'));var moment=require(_0xa925('0x4'));var BPromise=require(_0xa925('0x5'));var Mustache=require(_0xa925('0x6'));var util=require('util');var path=require(_0xa925('0x7'));var sox=require(_0xa925('0x8'));var csv=require(_0xa925('0x9'));var ejs=require(_0xa925('0xa'));var fs=require('fs');var fs_extra=require(_0xa925('0xb'));var _=require(_0xa925('0xc'));var squel=require(_0xa925('0xd'));var crypto=require(_0xa925('0xe'));var jsforce=require(_0xa925('0xf'));var deskjs=require(_0xa925('0x10'));var toCsv=require(_0xa925('0x9'));var querystring=require(_0xa925('0x11'));var Papa=require(_0xa925('0x12'));var Redis=require('ioredis');var authService=require(_0xa925('0x13'));var qs=require(_0xa925('0x14'));var as=require(_0xa925('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa925('0x16'))(_0xa925('0x17'));var utils=require(_0xa925('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa925('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32f955,_0x399452){_0x399452=_0x399452||0xcc;return function(_0x1c6690){if(_0x1c6690){return _0x32f955[_0xa925('0x1a')](_0x399452);}return _0x32f955[_0xa925('0x1b')](_0x399452)[_0xa925('0x1c')]();};}function respondWithResult(_0x8746f0,_0x3eaebc){_0x3eaebc=_0x3eaebc||0xc8;return function(_0x4583ad){if(_0x4583ad){return _0x8746f0[_0xa925('0x1b')](_0x3eaebc)['json'](_0x4583ad);}};}function respondWithFilteredResult(_0x456e6f,_0x314a2b){return function(_0x1012f9){if(_0x1012f9){var _0x48c029=typeof _0x314a2b[_0xa925('0x1d')]===_0xa925('0x1e')&&typeof _0x314a2b['limit']==='undefined';var _0xabfeb4=_0x1012f9[_0xa925('0x1f')];var _0x1a7366=_0x48c029?0x0:_0x314a2b[_0xa925('0x1d')];var _0x4adbc4=_0x48c029?_0x1012f9[_0xa925('0x1f')]:_0x314a2b[_0xa925('0x1d')]+_0x314a2b[_0xa925('0x20')];var _0x41bc13;if(_0x4adbc4>=_0xabfeb4){_0x4adbc4=_0xabfeb4;_0x41bc13=0xc8;}else{_0x41bc13=0xce;}_0x456e6f[_0xa925('0x1b')](_0x41bc13);return _0x456e6f[_0xa925('0x21')]('Content-Range',_0x1a7366+'-'+_0x4adbc4+'/'+_0xabfeb4)[_0xa925('0x22')](_0x1012f9);}return null;};}function patchUpdates(_0x169291){return function(_0x43e64e){try{jsonpatch[_0xa925('0x23')](_0x43e64e,_0x169291,!![]);}catch(_0x3b33a3){return BPromise[_0xa925('0x24')](_0x3b33a3);}return _0x43e64e[_0xa925('0x25')]();};}function saveUpdates(_0x399eed,_0x1da02a){return function(_0x21d8b5){if(_0x21d8b5){return _0x21d8b5[_0xa925('0x26')](_0x399eed)[_0xa925('0x27')](function(_0x229cd3){return _0x229cd3;});}return null;};}function removeEntity(_0x248413,_0x26dc33){return function(_0x2daf17){if(_0x2daf17){return _0x2daf17[_0xa925('0x28')]()['then'](function(){_0x248413['status'](0xcc)[_0xa925('0x1c')]();});}};}function handleEntityNotFound(_0x5406c7,_0x133223){return function(_0x1bd808){if(!_0x1bd808){_0x5406c7[_0xa925('0x1a')](0x194);}return _0x1bd808;};}function handleError(_0x33a653,_0x5d6d61){_0x5d6d61=_0x5d6d61||0x1f4;return function(_0x5b3ee3){logger[_0xa925('0x29')](_0x5b3ee3['stack']);if(_0x5b3ee3[_0xa925('0x2a')]){delete _0x5b3ee3['name'];}_0x33a653[_0xa925('0x1b')](_0x5d6d61)[_0xa925('0x2b')](_0x5b3ee3);};}exports[_0xa925('0x2c')]=function(_0x34bfa0,_0x3524c1){var _0x59fe63={},_0x149314={},_0x2edff8={'count':0x0,'rows':[]};var _0x2dfd01=_[_0xa925('0x2d')](db[_0xa925('0x2e')][_0xa925('0x2f')],function(_0x514dea){return{'name':_0x514dea[_0xa925('0x30')],'type':_0x514dea[_0xa925('0x31')]['key']};});_0x149314[_0xa925('0x32')]=_['map'](_0x2dfd01,_0xa925('0x2a'));_0x149314[_0xa925('0x33')]=_[_0xa925('0x34')](_0x34bfa0['query']);_0x149314[_0xa925('0x35')]=_[_0xa925('0x36')](_0x149314['model'],_0x149314[_0xa925('0x33')]);_0x59fe63[_0xa925('0x37')]=_[_0xa925('0x36')](_0x149314[_0xa925('0x32')],qs[_0xa925('0x38')](_0x34bfa0['query'][_0xa925('0x38')]));_0x59fe63[_0xa925('0x37')]=_0x59fe63[_0xa925('0x37')]['length']?_0x59fe63[_0xa925('0x37')]:_0x149314[_0xa925('0x32')];if(!_0x34bfa0['query'][_0xa925('0x39')](_0xa925('0x3a'))){_0x59fe63['limit']=qs[_0xa925('0x20')](_0x34bfa0[_0xa925('0x33')][_0xa925('0x20')]);_0x59fe63[_0xa925('0x1d')]=qs[_0xa925('0x1d')](_0x34bfa0[_0xa925('0x33')][_0xa925('0x1d')]);}_0x59fe63[_0xa925('0x3b')]=qs['sort'](_0x34bfa0[_0xa925('0x33')][_0xa925('0x3c')]);_0x59fe63[_0xa925('0x3d')]=qs[_0xa925('0x35')](_[_0xa925('0x3e')](_0x34bfa0[_0xa925('0x33')],_0x149314[_0xa925('0x35')]),_0x2dfd01);if(_0x34bfa0[_0xa925('0x33')][_0xa925('0x3f')]){_0x59fe63[_0xa925('0x3d')]=_[_0xa925('0x40')](_0x59fe63['where'],{'$or':_[_0xa925('0x2d')](_0x2dfd01,function(_0x339d78){if(_0x339d78[_0xa925('0x31')]!==_0xa925('0x41')){var _0x579419={};_0x579419[_0x339d78['name']]={'$like':'%'+_0x34bfa0[_0xa925('0x33')][_0xa925('0x3f')]+'%'};return _0x579419;}})});}_0x59fe63=_[_0xa925('0x40')]({},_0x59fe63,_0x34bfa0[_0xa925('0x42')]);var _0x11319f={'where':_0x59fe63['where']};return db[_0xa925('0x2e')][_0xa925('0x1f')](_0x11319f)[_0xa925('0x27')](function(_0x1f6347){_0x2edff8[_0xa925('0x1f')]=_0x1f6347;if(_0x34bfa0[_0xa925('0x33')]['includeAll']){_0x59fe63[_0xa925('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x59fe63);})[_0xa925('0x27')](function(_0x191543){_0x2edff8[_0xa925('0x44')]=_0x191543;return _0x2edff8;})[_0xa925('0x27')](respondWithFilteredResult(_0x3524c1,_0x59fe63))['catch'](handleError(_0x3524c1,null));};exports[_0xa925('0x45')]=function(_0x90d0b2,_0x113bf3){var _0x10470c={'raw':!![],'where':{'id':_0x90d0b2['params']['id']}},_0x4667e7={};_0x4667e7[_0xa925('0x32')]=_[_0xa925('0x34')](db[_0xa925('0x2e')][_0xa925('0x2f')]);_0x4667e7[_0xa925('0x33')]=_[_0xa925('0x34')](_0x90d0b2[_0xa925('0x33')]);_0x4667e7[_0xa925('0x35')]=_[_0xa925('0x36')](_0x4667e7[_0xa925('0x32')],_0x4667e7[_0xa925('0x33')]);_0x10470c[_0xa925('0x37')]=_['intersection'](_0x4667e7[_0xa925('0x32')],qs[_0xa925('0x38')](_0x90d0b2[_0xa925('0x33')][_0xa925('0x38')]));_0x10470c[_0xa925('0x37')]=_0x10470c[_0xa925('0x37')][_0xa925('0x46')]?_0x10470c[_0xa925('0x37')]:_0x4667e7[_0xa925('0x32')];if(_0x90d0b2[_0xa925('0x33')][_0xa925('0x47')]){_0x10470c[_0xa925('0x43')]=[{'all':!![]}];}_0x10470c=_[_0xa925('0x40')]({},_0x10470c,_0x90d0b2[_0xa925('0x42')]);return db['AnalyticTreeReport'][_0xa925('0x48')](_0x10470c)['then'](handleEntityNotFound(_0x113bf3,null))[_0xa925('0x27')](respondWithResult(_0x113bf3,null))[_0xa925('0x49')](handleError(_0x113bf3,null));};exports[_0xa925('0x4a')]=function(_0x4db90c,_0x11b1b8){return db[_0xa925('0x2e')]['create'](_0x4db90c[_0xa925('0x4b')],{})['then'](respondWithResult(_0x11b1b8,0xc9))[_0xa925('0x49')](handleError(_0x11b1b8,null));};exports[_0xa925('0x26')]=function(_0x42ff3e,_0x53c41b){if(_0x42ff3e[_0xa925('0x4b')]['id']){delete _0x42ff3e[_0xa925('0x4b')]['id'];}return db[_0xa925('0x2e')][_0xa925('0x48')]({'where':{'id':_0x42ff3e[_0xa925('0x4c')]['id']}})[_0xa925('0x27')](handleEntityNotFound(_0x53c41b,null))['then'](saveUpdates(_0x42ff3e[_0xa925('0x4b')],null))[_0xa925('0x27')](respondWithResult(_0x53c41b,null))[_0xa925('0x49')](handleError(_0x53c41b,null));};exports['destroy']=function(_0x1ccc1a,_0x379776){return db['AnalyticTreeReport']['find']({'where':{'id':_0x1ccc1a[_0xa925('0x4c')]['id']}})[_0xa925('0x27')](handleEntityNotFound(_0x379776,null))[_0xa925('0x27')](removeEntity(_0x379776,null))[_0xa925('0x49')](handleError(_0x379776,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0b7ceb7..a28b9bd 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 _0xe032=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x4b186e,_0x3fd096){var _0x431a8e=function(_0x2ccb6e){while(--_0x2ccb6e){_0x4b186e['push'](_0x4b186e['shift']());}};_0x431a8e(++_0x3fd096);}(_0xe032,0xed));var _0x2e03=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xe032[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x2e03('0x0'));var util=require(_0x2e03('0x1'));var logger=require(_0x2e03('0x2'))(_0x2e03('0x3'));var moment=require('moment');var BPromise=require(_0x2e03('0x4'));var rp=require(_0x2e03('0x5'));var fs=require('fs');var path=require(_0x2e03('0x6'));var rimraf=require(_0x2e03('0x7'));var config=require(_0x2e03('0x8'));var attributes=require(_0x2e03('0x9'));module[_0x2e03('0xa')]=function(_0x50fbd2,_0x233362){return _0x50fbd2[_0x2e03('0xb')](_0x2e03('0xc'),attributes,{'tableName':_0x2e03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d5c=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','api','moment','bluebird','request-promise'];(function(_0x46198f,_0x54fd8b){var _0x120254=function(_0x1a0467){while(--_0x1a0467){_0x46198f['push'](_0x46198f['shift']());}};_0x120254(++_0x54fd8b);}(_0x1d5c,0x1ea));var _0xc1d5=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0x1d5c[_0x5c84a6];return _0xb8c5f0;};'use strict';var _=require(_0xc1d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc1d5('0x1'));var moment=require(_0xc1d5('0x2'));var BPromise=require(_0xc1d5('0x3'));var rp=require(_0xc1d5('0x4'));var fs=require('fs');var path=require(_0xc1d5('0x5'));var rimraf=require(_0xc1d5('0x6'));var config=require(_0xc1d5('0x7'));var attributes=require(_0xc1d5('0x8'));module[_0xc1d5('0x9')]=function(_0x2ea00a,_0x5b0874){return _0x2ea00a['define']('AnalyticTreeReport',attributes,{'tableName':_0xc1d5('0xa'),'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 a06ff91..8b76d19 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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1b2a97,_0x16863c){_0x1b2a97=_0x1b2a97-0x0;var _0xaf59cb=_0x7a54[_0x1b2a97];return _0xaf59cb;};'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 +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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x26e3c9,_0x2068b6){_0x26e3c9=_0x26e3c9-0x0;var _0x3e7cca=_0x7a54[_0x26e3c9];return _0x3e7cca;};'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 945d085..4556e98 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 _0x8c6c=['index','/:id','post','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x5bbcfb,_0x49cfd2){var _0x2db74d=function(_0x42b41f){while(--_0x42b41f){_0x5bbcfb['push'](_0x5bbcfb['shift']());}};_0x2db74d(++_0x49cfd2);}(_0x8c6c,0x6f));var _0xc8c6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8c6c[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xc8c6('0x0'));var util=require(_0xc8c6('0x1'));var path=require(_0xc8c6('0x2'));var timeout=require(_0xc8c6('0x3'));var express=require('express');var router=express[_0xc8c6('0x4')]();var fs_extra=require(_0xc8c6('0x5'));var auth=require(_0xc8c6('0x6'));var interaction=require(_0xc8c6('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xc8c6('0x8')](),controller[_0xc8c6('0x9')]);router['get'](_0xc8c6('0xa'),auth[_0xc8c6('0x8')](),controller['show']);router[_0xc8c6('0xb')]('/',auth[_0xc8c6('0x8')](),controller['create']);router[_0xc8c6('0xc')](_0xc8c6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc8c6('0xd')]('/:id',auth[_0xc8c6('0x8')](),controller[_0xc8c6('0xe')]);module['exports']=router; \ No newline at end of file +var _0xcfb1=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','put','delete','destroy','exports'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xcfb1,0x168));var _0x1cfb=function(_0x3d5fc9,_0x48bb9f){_0x3d5fc9=_0x3d5fc9-0x0;var _0x4c5fef=_0xcfb1[_0x3d5fc9];return _0x4c5fef;};'use strict';var multer=require('multer');var util=require(_0x1cfb('0x0'));var path=require(_0x1cfb('0x1'));var timeout=require(_0x1cfb('0x2'));var express=require(_0x1cfb('0x3'));var router=express[_0x1cfb('0x4')]();var fs_extra=require(_0x1cfb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1cfb('0x6'));var config=require(_0x1cfb('0x7'));var controller=require(_0x1cfb('0x8'));router['get']('/',auth[_0x1cfb('0x9')](),controller[_0x1cfb('0xa')]);router[_0x1cfb('0xb')](_0x1cfb('0xc'),auth['isAuthenticated'](),controller[_0x1cfb('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1cfb('0xe')](_0x1cfb('0xc'),auth[_0x1cfb('0x9')](),controller['update']);router[_0x1cfb('0xf')]('/:id',auth[_0x1cfb('0x9')](),controller[_0x1cfb('0x10')]);module[_0x1cfb('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 18e293c..0d59253 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 _0x1ae3=['STRING','sequelize','exports'];(function(_0x252ab4,_0x566e7f){var _0x27ff30=function(_0x24b245){while(--_0x24b245){_0x252ab4['push'](_0x252ab4['shift']());}};_0x27ff30(++_0x566e7f);}(_0x1ae3,0x139));var _0x31ae=function(_0x26ed66,_0x3aa151){_0x26ed66=_0x26ed66-0x0;var _0x262716=_0x1ae3[_0x26ed66];return _0x262716;};'use strict';var Sequelize=require(_0x31ae('0x0'));module[_0x31ae('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x31ae('0x2')]},'type':{'type':Sequelize[_0x31ae('0x2')]}}; \ No newline at end of file +var _0x9649=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x1b706c,_0x1cd5a1){_0x1b706c=_0x1b706c-0x0;var _0x3b0cc0=_0x9649[_0x1b706c];return _0x3b0cc0;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')]},'basename':{'type':Sequelize[_0x9964('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 4a2dba7..701c291 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 _0x454d=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','Attachment','includeAll','findAll','rows','catch','params','include','options','clone','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x454d,0xf8));var _0xd454=function(_0x143368,_0x5d0b64){_0x143368=_0x143368-0x0;var _0x44c10a=_0x454d[_0x143368];return _0x44c10a;};'use strict';var emlformat=require(_0xd454('0x0'));var rimraf=require(_0xd454('0x1'));var zipdir=require(_0xd454('0x2'));var jsonpatch=require(_0xd454('0x3'));var rp=require(_0xd454('0x4'));var moment=require(_0xd454('0x5'));var BPromise=require(_0xd454('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd454('0x7'));var sox=require(_0xd454('0x8'));var csv=require(_0xd454('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd454('0xa'));var _=require('lodash');var squel=require(_0xd454('0xb'));var crypto=require(_0xd454('0xc'));var jsforce=require(_0xd454('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd454('0x9'));var querystring=require('querystring');var Papa=require(_0xd454('0xe'));var Redis=require(_0xd454('0xf'));var authService=require(_0xd454('0x10'));var qs=require(_0xd454('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd454('0x12'));var logger=require(_0xd454('0x13'))(_0xd454('0x14'));var utils=require('../../config/utils');var config=require(_0xd454('0x15'));var licenseUtil=require(_0xd454('0x16'));var db=require(_0xd454('0x17'))['db'];function respondWithStatusCode(_0x4fc86b,_0x314edc){_0x314edc=_0x314edc||0xcc;return function(_0x27f756){if(_0x27f756){return _0x4fc86b[_0xd454('0x18')](_0x314edc);}return _0x4fc86b[_0xd454('0x19')](_0x314edc)['end']();};}function respondWithResult(_0x614cf5,_0x2d6383){_0x2d6383=_0x2d6383||0xc8;return function(_0x534d89){if(_0x534d89){return _0x614cf5[_0xd454('0x19')](_0x2d6383)[_0xd454('0x1a')](_0x534d89);}};}function respondWithFilteredResult(_0x12f96b,_0x55952d){return function(_0x518dac){if(_0x518dac){var _0x6ab4c7=typeof _0x55952d['offset']==='undefined'&&typeof _0x55952d['limit']===_0xd454('0x1b');var _0x1b4453=_0x518dac['count'];var _0x18ba23=_0x6ab4c7?0x0:_0x55952d[_0xd454('0x1c')];var _0x3d2583=_0x6ab4c7?_0x518dac[_0xd454('0x1d')]:_0x55952d[_0xd454('0x1c')]+_0x55952d[_0xd454('0x1e')];var _0x4a201d;if(_0x3d2583>=_0x1b4453){_0x3d2583=_0x1b4453;_0x4a201d=0xc8;}else{_0x4a201d=0xce;}_0x12f96b[_0xd454('0x19')](_0x4a201d);return _0x12f96b[_0xd454('0x1f')](_0xd454('0x20'),_0x18ba23+'-'+_0x3d2583+'/'+_0x1b4453)[_0xd454('0x1a')](_0x518dac);}return null;};}function patchUpdates(_0x76f144){return function(_0x3c8929){try{jsonpatch[_0xd454('0x21')](_0x3c8929,_0x76f144,!![]);}catch(_0x39ce2f){return BPromise['reject'](_0x39ce2f);}return _0x3c8929['save']();};}function saveUpdates(_0x522551,_0x4d30ce){return function(_0x438a7a){if(_0x438a7a){return _0x438a7a[_0xd454('0x22')](_0x522551)[_0xd454('0x23')](function(_0x780f19){return _0x780f19;});}return null;};}function removeEntity(_0x5bc2de,_0x507a00){return function(_0x21c44e){if(_0x21c44e){return _0x21c44e[_0xd454('0x24')]()[_0xd454('0x23')](function(){_0x5bc2de[_0xd454('0x19')](0xcc)[_0xd454('0x25')]();});}};}function handleEntityNotFound(_0x4be501,_0x50a358){return function(_0xaf68ab){if(!_0xaf68ab){_0x4be501['sendStatus'](0x194);}return _0xaf68ab;};}function handleError(_0x299c1a,_0x405462){_0x405462=_0x405462||0x1f4;return function(_0x20ee5f){logger['error'](_0x20ee5f[_0xd454('0x26')]);if(_0x20ee5f['name']){delete _0x20ee5f[_0xd454('0x27')];}_0x299c1a[_0xd454('0x19')](_0x405462)[_0xd454('0x28')](_0x20ee5f);};}exports[_0xd454('0x29')]=function(_0x35efa7,_0x57b30a){var _0x92ae3e={},_0x373725={},_0x69b283={'count':0x0,'rows':[]};var _0x5edc5a=_[_0xd454('0x2a')](db['Attachment'][_0xd454('0x2b')],function(_0x17449d){return{'name':_0x17449d[_0xd454('0x2c')],'type':_0x17449d[_0xd454('0x2d')][_0xd454('0x2e')]};});_0x373725[_0xd454('0x2f')]=_[_0xd454('0x2a')](_0x5edc5a,'name');_0x373725['query']=_[_0xd454('0x30')](_0x35efa7['query']);_0x373725[_0xd454('0x31')]=_[_0xd454('0x32')](_0x373725[_0xd454('0x2f')],_0x373725[_0xd454('0x33')]);_0x92ae3e[_0xd454('0x34')]=_[_0xd454('0x32')](_0x373725[_0xd454('0x2f')],qs[_0xd454('0x35')](_0x35efa7[_0xd454('0x33')][_0xd454('0x35')]));_0x92ae3e[_0xd454('0x34')]=_0x92ae3e['attributes'][_0xd454('0x36')]?_0x92ae3e[_0xd454('0x34')]:_0x373725[_0xd454('0x2f')];if(!_0x35efa7[_0xd454('0x33')][_0xd454('0x37')]('nolimit')){_0x92ae3e[_0xd454('0x1e')]=qs[_0xd454('0x1e')](_0x35efa7['query'][_0xd454('0x1e')]);_0x92ae3e['offset']=qs[_0xd454('0x1c')](_0x35efa7[_0xd454('0x33')][_0xd454('0x1c')]);}_0x92ae3e[_0xd454('0x38')]=qs['sort'](_0x35efa7[_0xd454('0x33')]['sort']);_0x92ae3e['where']=qs[_0xd454('0x31')](_[_0xd454('0x39')](_0x35efa7['query'],_0x373725[_0xd454('0x31')]),_0x5edc5a);if(_0x35efa7[_0xd454('0x33')][_0xd454('0x3a')]){_0x92ae3e[_0xd454('0x3b')]=_[_0xd454('0x3c')](_0x92ae3e[_0xd454('0x3b')],{'$or':_[_0xd454('0x2a')](_0x5edc5a,function(_0x39113d){if(_0x39113d[_0xd454('0x2d')]!==_0xd454('0x3d')){var _0x37cf4a={};_0x37cf4a[_0x39113d['name']]={'$like':'%'+_0x35efa7['query']['filter']+'%'};return _0x37cf4a;}})});}_0x92ae3e=_[_0xd454('0x3c')]({},_0x92ae3e,_0x35efa7['options']);var _0x3ebc37={'where':_0x92ae3e['where']};return db[_0xd454('0x3e')]['count'](_0x3ebc37)[_0xd454('0x23')](function(_0x4a4aa3){_0x69b283['count']=_0x4a4aa3;if(_0x35efa7['query'][_0xd454('0x3f')]){_0x92ae3e['include']=[{'all':!![]}];}return db['Attachment'][_0xd454('0x40')](_0x92ae3e);})[_0xd454('0x23')](function(_0xba5609){_0x69b283[_0xd454('0x41')]=_0xba5609;return _0x69b283;})['then'](respondWithFilteredResult(_0x57b30a,_0x92ae3e))[_0xd454('0x42')](handleError(_0x57b30a,null));};exports['show']=function(_0x15d593,_0x443d02){var _0x46203e={'raw':!![],'where':{'id':_0x15d593[_0xd454('0x43')]['id']}},_0x506362={};_0x506362[_0xd454('0x2f')]=_[_0xd454('0x30')](db[_0xd454('0x3e')]['rawAttributes']);_0x506362[_0xd454('0x33')]=_['keys'](_0x15d593[_0xd454('0x33')]);_0x506362[_0xd454('0x31')]=_[_0xd454('0x32')](_0x506362[_0xd454('0x2f')],_0x506362[_0xd454('0x33')]);_0x46203e[_0xd454('0x34')]=_[_0xd454('0x32')](_0x506362[_0xd454('0x2f')],qs[_0xd454('0x35')](_0x15d593['query']['fields']));_0x46203e[_0xd454('0x34')]=_0x46203e[_0xd454('0x34')][_0xd454('0x36')]?_0x46203e['attributes']:_0x506362[_0xd454('0x2f')];if(_0x15d593['query'][_0xd454('0x3f')]){_0x46203e[_0xd454('0x44')]=[{'all':!![]}];}_0x46203e=_[_0xd454('0x3c')]({},_0x46203e,_0x15d593[_0xd454('0x45')]);return db['Attachment']['find'](_0x46203e)[_0xd454('0x23')](handleEntityNotFound(_0x443d02,null))[_0xd454('0x23')](respondWithResult(_0x443d02,null))['catch'](handleError(_0x443d02,null));};exports[_0xd454('0x46')]=function(_0x1413a5,_0x46def6){var _0x17dc9a={'where':{'id':_0x1413a5[_0xd454('0x43')]['id']}},_0x308a10={};_0x308a10[_0xd454('0x2f')]=_[_0xd454('0x30')](db[_0xd454('0x3e')][_0xd454('0x2b')]);_0x17dc9a[_0xd454('0x34')]=_[_0xd454('0x32')](_0x308a10[_0xd454('0x2f')],qs['fields'](_0x1413a5[_0xd454('0x33')][_0xd454('0x35')]));_0x17dc9a[_0xd454('0x34')]=_0x17dc9a['attributes'][_0xd454('0x36')]?_0x17dc9a['attributes']:_0x308a10[_0xd454('0x2f')];if(_0x1413a5['query'][_0xd454('0x3f')]){_0x17dc9a['include']=[{'all':!![]}];}_0x17dc9a=_[_0xd454('0x3c')]({},_0x17dc9a,_0x1413a5['options']);return db[_0xd454('0x3e')][_0xd454('0x47')](_0x17dc9a)[_0xd454('0x23')](handleEntityNotFound(_0x46def6,null))[_0xd454('0x23')](function(_0x37bd9f){if(_0x37bd9f){var _0x9ed64f=_0x37bd9f[_0xd454('0x48')]({'plain':!![]});_0x9ed64f=qs[_0xd454('0x49')](_0x9ed64f,['id',_0xd454('0x4a'),_0xd454('0x4b')]);_0x1413a5[_0xd454('0x4c')]=_['omit'](_0x1413a5[_0xd454('0x4c')],['id',_0xd454('0x4a'),_0xd454('0x4b')]);return db[_0xd454('0x3e')][_0xd454('0x4d')](_[_0xd454('0x3c')](_0x9ed64f,_0x1413a5[_0xd454('0x4c')]),{'include':_0x1413a5[_0xd454('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xd454('0x23')](respondWithResult(_0x46def6,0xc9))[_0xd454('0x42')](handleError(_0x46def6,null));};exports[_0xd454('0x22')]=function(_0x59df35,_0x25829c){if(_0x59df35[_0xd454('0x4c')]['id']){delete _0x59df35[_0xd454('0x4c')]['id'];}return db[_0xd454('0x3e')][_0xd454('0x47')]({'where':{'id':_0x59df35[_0xd454('0x43')]['id']}})[_0xd454('0x23')](handleEntityNotFound(_0x25829c,null))[_0xd454('0x23')](saveUpdates(_0x59df35[_0xd454('0x4c')],null))[_0xd454('0x23')](respondWithResult(_0x25829c,null))[_0xd454('0x42')](handleError(_0x25829c,null));};exports[_0xd454('0x24')]=function(_0x4aa086,_0x442c06){return db[_0xd454('0x3e')][_0xd454('0x47')]({'where':{'id':_0x4aa086[_0xd454('0x43')]['id']}})[_0xd454('0x23')](handleEntityNotFound(_0x442c06,null))[_0xd454('0x23')](removeEntity(_0x442c06,null))['catch'](handleError(_0x442c06,null));};exports[_0xd454('0x4d')]=function(_0x4c1b31,_0x226fe2,_0x4ab282){_0x4c1b31[_0xd454('0x4c')][_0xd454('0x27')]=_0x4c1b31[_0xd454('0x4e')][_0xd454('0x4f')];_0x4c1b31['body'][_0xd454('0x50')]=_0x4c1b31[_0xd454('0x4e')][_0xd454('0x51')];_0x4c1b31[_0xd454('0x4c')][_0xd454('0x2d')]=_0x4c1b31[_0xd454('0x4e')][_0xd454('0x52')];return db[_0xd454('0x3e')][_0xd454('0x4d')](_0x4c1b31['body'])[_0xd454('0x23')](respondWithResult(_0x226fe2,0xc9))[_0xd454('0x42')](handleError(_0x226fe2,null));};exports[_0xd454('0x53')]=function(_0x3cca2f,_0x230452,_0x33e361){return db['Attachment'][_0xd454('0x54')]({'where':{'id':_0x3cca2f[_0xd454('0x43')]['id']},'raw':!![]})[_0xd454('0x23')](handleEntityNotFound(_0x230452,null))[_0xd454('0x23')](function(_0xb85a0e){if(_0xb85a0e){var _0x1a75d7=_0xb85a0e[_0xd454('0x55')]!==null;var _0x2d9a20=path[_0xd454('0x56')](config[_0xd454('0x57')],_0xd454('0x58'));if(_0x1a75d7){_0x2d9a20=path[_0xd454('0x56')](_0x2d9a20,_0xd454('0x59'));}var _0x573f41=path['join'](_0x2d9a20,_0xb85a0e[_0xd454('0x50')]);return _0x230452[_0xd454('0x53')](_0x573f41);}})[_0xd454('0x42')](handleError(_0x230452,null));}; \ No newline at end of file +var _0xc097=['basename','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','options','find','clone','includeAll','omit','updatedAt','createdAt','body','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc097,0x16d));var _0x7c09=function(_0x594fe9,_0x3e0fa3){_0x594fe9=_0x594fe9-0x0;var _0xeaa78d=_0xc097[_0x594fe9];return _0xeaa78d;};'use strict';var emlformat=require(_0x7c09('0x0'));var rimraf=require(_0x7c09('0x1'));var zipdir=require(_0x7c09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c09('0x3'));var moment=require(_0x7c09('0x4'));var BPromise=require(_0x7c09('0x5'));var Mustache=require(_0x7c09('0x6'));var util=require('util');var path=require(_0x7c09('0x7'));var sox=require('sox');var csv=require(_0x7c09('0x8'));var ejs=require(_0x7c09('0x9'));var fs=require('fs');var fs_extra=require(_0x7c09('0xa'));var _=require(_0x7c09('0xb'));var squel=require('squel');var crypto=require(_0x7c09('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c09('0x8'));var querystring=require('querystring');var Papa=require(_0x7c09('0xd'));var Redis=require(_0x7c09('0xe'));var authService=require(_0x7c09('0xf'));var qs=require(_0x7c09('0x10'));var as=require(_0x7c09('0x11'));var hardwareService=require(_0x7c09('0x12'));var logger=require(_0x7c09('0x13'))(_0x7c09('0x14'));var utils=require(_0x7c09('0x15'));var config=require(_0x7c09('0x16'));var licenseUtil=require(_0x7c09('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279e4d,_0x47168d){_0x47168d=_0x47168d||0xcc;return function(_0x3985e1){if(_0x3985e1){return _0x279e4d['sendStatus'](_0x47168d);}return _0x279e4d[_0x7c09('0x18')](_0x47168d)[_0x7c09('0x19')]();};}function respondWithResult(_0x4daa0e,_0x279031){_0x279031=_0x279031||0xc8;return function(_0x265237){if(_0x265237){return _0x4daa0e[_0x7c09('0x18')](_0x279031)['json'](_0x265237);}};}function respondWithFilteredResult(_0x4beeec,_0x40ae13){return function(_0x15a3af){if(_0x15a3af){var _0x194f40=typeof _0x40ae13[_0x7c09('0x1a')]===_0x7c09('0x1b')&&typeof _0x40ae13['limit']===_0x7c09('0x1b');var _0x387a08=_0x15a3af[_0x7c09('0x1c')];var _0x3093f9=_0x194f40?0x0:_0x40ae13[_0x7c09('0x1a')];var _0xea5cfd=_0x194f40?_0x15a3af[_0x7c09('0x1c')]:_0x40ae13[_0x7c09('0x1a')]+_0x40ae13[_0x7c09('0x1d')];var _0x474834;if(_0xea5cfd>=_0x387a08){_0xea5cfd=_0x387a08;_0x474834=0xc8;}else{_0x474834=0xce;}_0x4beeec[_0x7c09('0x18')](_0x474834);return _0x4beeec['set'](_0x7c09('0x1e'),_0x3093f9+'-'+_0xea5cfd+'/'+_0x387a08)[_0x7c09('0x1f')](_0x15a3af);}return null;};}function patchUpdates(_0x28d70f){return function(_0x30f951){try{jsonpatch[_0x7c09('0x20')](_0x30f951,_0x28d70f,!![]);}catch(_0x26dd5a){return BPromise[_0x7c09('0x21')](_0x26dd5a);}return _0x30f951['save']();};}function saveUpdates(_0x1cb0e8,_0x5e1247){return function(_0x40943c){if(_0x40943c){return _0x40943c[_0x7c09('0x22')](_0x1cb0e8)[_0x7c09('0x23')](function(_0x3f7b52){return _0x3f7b52;});}return null;};}function removeEntity(_0xe6648e,_0x4aee06){return function(_0x1322eb){if(_0x1322eb){return _0x1322eb[_0x7c09('0x24')]()[_0x7c09('0x23')](function(){_0xe6648e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa025b2,_0xc71b11){return function(_0x3cf312){if(!_0x3cf312){_0xa025b2[_0x7c09('0x25')](0x194);}return _0x3cf312;};}function handleError(_0x57e20f,_0x442762){_0x442762=_0x442762||0x1f4;return function(_0x159e9f){logger[_0x7c09('0x26')](_0x159e9f[_0x7c09('0x27')]);if(_0x159e9f['name']){delete _0x159e9f[_0x7c09('0x28')];}_0x57e20f[_0x7c09('0x18')](_0x442762)[_0x7c09('0x29')](_0x159e9f);};}exports[_0x7c09('0x2a')]=function(_0xcf47b9,_0x8a22e){var _0x362e73={},_0x131020={},_0x4087f7={'count':0x0,'rows':[]};var _0x24227b=_[_0x7c09('0x2b')](db[_0x7c09('0x2c')]['rawAttributes'],function(_0x5e79aa){return{'name':_0x5e79aa[_0x7c09('0x2d')],'type':_0x5e79aa[_0x7c09('0x2e')]['key']};});_0x131020[_0x7c09('0x2f')]=_['map'](_0x24227b,_0x7c09('0x28'));_0x131020[_0x7c09('0x30')]=_[_0x7c09('0x31')](_0xcf47b9[_0x7c09('0x30')]);_0x131020[_0x7c09('0x32')]=_['intersection'](_0x131020['model'],_0x131020['query']);_0x362e73[_0x7c09('0x33')]=_[_0x7c09('0x34')](_0x131020[_0x7c09('0x2f')],qs[_0x7c09('0x35')](_0xcf47b9[_0x7c09('0x30')][_0x7c09('0x35')]));_0x362e73[_0x7c09('0x33')]=_0x362e73['attributes'][_0x7c09('0x36')]?_0x362e73[_0x7c09('0x33')]:_0x131020[_0x7c09('0x2f')];if(!_0xcf47b9[_0x7c09('0x30')][_0x7c09('0x37')](_0x7c09('0x38'))){_0x362e73['limit']=qs['limit'](_0xcf47b9['query'][_0x7c09('0x1d')]);_0x362e73['offset']=qs[_0x7c09('0x1a')](_0xcf47b9[_0x7c09('0x30')][_0x7c09('0x1a')]);}_0x362e73[_0x7c09('0x39')]=qs[_0x7c09('0x3a')](_0xcf47b9[_0x7c09('0x30')][_0x7c09('0x3a')]);_0x362e73[_0x7c09('0x3b')]=qs[_0x7c09('0x32')](_[_0x7c09('0x3c')](_0xcf47b9[_0x7c09('0x30')],_0x131020[_0x7c09('0x32')]),_0x24227b);if(_0xcf47b9[_0x7c09('0x30')][_0x7c09('0x3d')]){_0x362e73[_0x7c09('0x3b')]=_[_0x7c09('0x3e')](_0x362e73[_0x7c09('0x3b')],{'$or':_[_0x7c09('0x2b')](_0x24227b,function(_0x52c6f5){if(_0x52c6f5['type']!=='VIRTUAL'){var _0x2322c0={};_0x2322c0[_0x52c6f5[_0x7c09('0x28')]]={'$like':'%'+_0xcf47b9['query']['filter']+'%'};return _0x2322c0;}})});}_0x362e73=_[_0x7c09('0x3e')]({},_0x362e73,_0xcf47b9['options']);var _0x49335b={'where':_0x362e73[_0x7c09('0x3b')]};return db[_0x7c09('0x2c')][_0x7c09('0x1c')](_0x49335b)[_0x7c09('0x23')](function(_0x4911b9){_0x4087f7[_0x7c09('0x1c')]=_0x4911b9;if(_0xcf47b9['query']['includeAll']){_0x362e73[_0x7c09('0x3f')]=[{'all':!![]}];}return db[_0x7c09('0x2c')][_0x7c09('0x40')](_0x362e73);})[_0x7c09('0x23')](function(_0xa89464){_0x4087f7[_0x7c09('0x41')]=_0xa89464;return _0x4087f7;})[_0x7c09('0x23')](respondWithFilteredResult(_0x8a22e,_0x362e73))[_0x7c09('0x42')](handleError(_0x8a22e,null));};exports[_0x7c09('0x43')]=function(_0x2e979a,_0x29d02d){var _0x1d148f={'raw':!![],'where':{'id':_0x2e979a[_0x7c09('0x44')]['id']}},_0xebfeb6={};_0xebfeb6[_0x7c09('0x2f')]=_[_0x7c09('0x31')](db[_0x7c09('0x2c')][_0x7c09('0x45')]);_0xebfeb6[_0x7c09('0x30')]=_[_0x7c09('0x31')](_0x2e979a[_0x7c09('0x30')]);_0xebfeb6[_0x7c09('0x32')]=_[_0x7c09('0x34')](_0xebfeb6[_0x7c09('0x2f')],_0xebfeb6[_0x7c09('0x30')]);_0x1d148f[_0x7c09('0x33')]=_[_0x7c09('0x34')](_0xebfeb6[_0x7c09('0x2f')],qs[_0x7c09('0x35')](_0x2e979a[_0x7c09('0x30')][_0x7c09('0x35')]));_0x1d148f['attributes']=_0x1d148f[_0x7c09('0x33')][_0x7c09('0x36')]?_0x1d148f[_0x7c09('0x33')]:_0xebfeb6[_0x7c09('0x2f')];if(_0x2e979a[_0x7c09('0x30')]['includeAll']){_0x1d148f[_0x7c09('0x3f')]=[{'all':!![]}];}_0x1d148f=_['merge']({},_0x1d148f,_0x2e979a[_0x7c09('0x46')]);return db['Attachment'][_0x7c09('0x47')](_0x1d148f)[_0x7c09('0x23')](handleEntityNotFound(_0x29d02d,null))[_0x7c09('0x23')](respondWithResult(_0x29d02d,null))['catch'](handleError(_0x29d02d,null));};exports[_0x7c09('0x48')]=function(_0x3697fc,_0x50d441){var _0x25800e={'where':{'id':_0x3697fc[_0x7c09('0x44')]['id']}},_0x26bcc2={};_0x26bcc2[_0x7c09('0x2f')]=_[_0x7c09('0x31')](db[_0x7c09('0x2c')]['rawAttributes']);_0x25800e['attributes']=_[_0x7c09('0x34')](_0x26bcc2['model'],qs['fields'](_0x3697fc[_0x7c09('0x30')]['fields']));_0x25800e[_0x7c09('0x33')]=_0x25800e[_0x7c09('0x33')][_0x7c09('0x36')]?_0x25800e[_0x7c09('0x33')]:_0x26bcc2[_0x7c09('0x2f')];if(_0x3697fc['query'][_0x7c09('0x49')]){_0x25800e['include']=[{'all':!![]}];}_0x25800e=_[_0x7c09('0x3e')]({},_0x25800e,_0x3697fc[_0x7c09('0x46')]);return db['Attachment'][_0x7c09('0x47')](_0x25800e)['then'](handleEntityNotFound(_0x50d441,null))[_0x7c09('0x23')](function(_0x3ce688){if(_0x3ce688){var _0xda113b=_0x3ce688['get']({'plain':!![]});_0xda113b=qs[_0x7c09('0x4a')](_0xda113b,['id','createdAt',_0x7c09('0x4b')]);_0x3697fc['body']=_[_0x7c09('0x4a')](_0x3697fc['body'],['id',_0x7c09('0x4c'),_0x7c09('0x4b')]);return db[_0x7c09('0x2c')]['create'](_[_0x7c09('0x3e')](_0xda113b,_0x3697fc['body']),{'include':_0x3697fc[_0x7c09('0x30')][_0x7c09('0x49')]?[{'all':!![]}]:undefined});}})[_0x7c09('0x23')](respondWithResult(_0x50d441,0xc9))['catch'](handleError(_0x50d441,null));};exports[_0x7c09('0x22')]=function(_0x5e9e92,_0xfcc753){if(_0x5e9e92['body']['id']){delete _0x5e9e92[_0x7c09('0x4d')]['id'];}return db[_0x7c09('0x2c')][_0x7c09('0x47')]({'where':{'id':_0x5e9e92[_0x7c09('0x44')]['id']}})[_0x7c09('0x23')](handleEntityNotFound(_0xfcc753,null))[_0x7c09('0x23')](saveUpdates(_0x5e9e92[_0x7c09('0x4d')],null))[_0x7c09('0x23')](respondWithResult(_0xfcc753,null))[_0x7c09('0x42')](handleError(_0xfcc753,null));};exports['destroy']=function(_0x17a718,_0x1e70c4){return db[_0x7c09('0x2c')][_0x7c09('0x47')]({'where':{'id':_0x17a718[_0x7c09('0x44')]['id']}})[_0x7c09('0x23')](handleEntityNotFound(_0x1e70c4,null))['then'](removeEntity(_0x1e70c4,null))[_0x7c09('0x42')](handleError(_0x1e70c4,null));};exports[_0x7c09('0x4e')]=function(_0x1646aa,_0x54efde,_0x337fd8){_0x1646aa[_0x7c09('0x4d')]['name']=_0x1646aa['file'][_0x7c09('0x4f')];_0x1646aa[_0x7c09('0x4d')]['basename']=_0x1646aa[_0x7c09('0x50')][_0x7c09('0x51')];_0x1646aa['body']['type']=_0x1646aa[_0x7c09('0x50')][_0x7c09('0x52')];return db[_0x7c09('0x2c')][_0x7c09('0x4e')](_0x1646aa[_0x7c09('0x4d')])[_0x7c09('0x23')](respondWithResult(_0x54efde,0xc9))['catch'](handleError(_0x54efde,null));};exports[_0x7c09('0x53')]=function(_0x4e1e7b,_0x1bd97f,_0x28108c){return db['Attachment'][_0x7c09('0x54')]({'where':{'id':_0x4e1e7b[_0x7c09('0x44')]['id']},'raw':!![]})[_0x7c09('0x23')](handleEntityNotFound(_0x1bd97f,null))['then'](function(_0x174f7d){if(_0x174f7d){var _0x267928=_0x174f7d[_0x7c09('0x55')]!==null;var _0x36cb68=path['join'](config[_0x7c09('0x56')],_0x7c09('0x57'));if(_0x267928){_0x36cb68=path['join'](_0x36cb68,_0x7c09('0x58'));}var _0x422ab0=path[_0x7c09('0x59')](_0x36cb68,_0x174f7d[_0x7c09('0x5a')]);return _0x1bd97f['download'](_0x422ab0);}})['catch'](handleError(_0x1bd97f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index fc8ad86..aacc69c 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 _0xd682=['exports','define','Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x37e0be,_0x25469f){var _0x17dfe7=function(_0x2a548b){while(--_0x2a548b){_0x37e0be['push'](_0x37e0be['shift']());}};_0x17dfe7(++_0x25469f);}(_0xd682,0x1e4));var _0x2d68=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xd682[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0x2d68('0x0'));var util=require(_0x2d68('0x1'));var logger=require(_0x2d68('0x2'))(_0x2d68('0x3'));var moment=require(_0x2d68('0x4'));var BPromise=require(_0x2d68('0x5'));var rp=require(_0x2d68('0x6'));var fs=require('fs');var path=require(_0x2d68('0x7'));var rimraf=require('rimraf');var config=require(_0x2d68('0x8'));var attributes=require(_0x2d68('0x9'));module[_0x2d68('0xa')]=function(_0x3ae44d,_0x5a7d15){return _0x3ae44d[_0x2d68('0xb')](_0x2d68('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3362=['exports','attachments','util','api','moment','bluebird','request-promise','rimraf','./attachment.attributes'];(function(_0x278cb1,_0xfdcabf){var _0x1a12e6=function(_0x394f5f){while(--_0x394f5f){_0x278cb1['push'](_0x278cb1['shift']());}};_0x1a12e6(++_0xfdcabf);}(_0x3362,0x77));var _0x2336=function(_0x3cc4fc,_0x5a69d1){_0x3cc4fc=_0x3cc4fc-0x0;var _0x11cc8a=_0x3362[_0x3cc4fc];return _0x11cc8a;};'use strict';var _=require('lodash');var util=require(_0x2336('0x0'));var logger=require('../../config/logger')(_0x2336('0x1'));var moment=require(_0x2336('0x2'));var BPromise=require(_0x2336('0x3'));var rp=require(_0x2336('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2336('0x5'));var config=require('../../config/environment');var attributes=require(_0x2336('0x6'));module[_0x2336('0x7')]=function(_0x570460,_0x52ff64){return _0x570460['define']('Attachment',attributes,{'tableName':_0x2336('0x8'),'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 35388e5..facdc89 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 _0x3685=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateAttachment','Attachment','options','raw','catch','lodash','moment','bluebird','randomstring'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Attachment,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});}exports[_0x5368('0x17')]=function(_0x5b10e9){var _0x3fcae0=this;return new Promise(function(_0x56ac4d,_0x4baaa9){return db[_0x5368('0x18')]['create'](_0x5b10e9['body'],{'raw':_0x5b10e9['options']?_0x5b10e9[_0x5368('0x19')][_0x5368('0x1a')]===undefined?!![]:![]:!![]})[_0x5368('0xd')](function(_0x5cef40){logger['info'](_0x5368('0x17'),_0x5b10e9);logger[_0x5368('0x11')](_0x5368('0x17'),_0x5b10e9,JSON[_0x5368('0x12')](_0x5cef40));_0x56ac4d(_0x5cef40);})[_0x5368('0x1b')](function(_0x1093e2){logger[_0x5368('0x13')](_0x5368('0x17'),_0x1093e2[_0x5368('0x15')],_0x5b10e9);_0x4baaa9(_0x3fcae0[_0x5368('0x13')](0x1f4,_0x1093e2['message']));});});}; \ No newline at end of file +var _0x44a3=['create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','Attachment,\x20%s,\x20%s','catch','CreateAttachment','Attachment'];(function(_0x43789b,_0x241cb4){var _0x1b0e38=function(_0x3f6add){while(--_0x3f6add){_0x43789b['push'](_0x43789b['shift']());}};_0x1b0e38(++_0x241cb4);}(_0x44a3,0x1a9));var _0x344a=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x44a3[_0x19d24c];return _0x2fae8d;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('Attachment,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('Attachment,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('Attachment,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});}exports[_0x344a('0x17')]=function(_0x277c06){var _0x49b55f=this;return new Promise(function(_0x9fe854,_0x274016){return db[_0x344a('0x18')][_0x344a('0x19')](_0x277c06[_0x344a('0x1a')],{'raw':_0x277c06[_0x344a('0x1b')]?_0x277c06[_0x344a('0x1b')][_0x344a('0x1c')]===undefined?!![]:![]:!![]})[_0x344a('0xe')](function(_0x450922){logger['info'](_0x344a('0x17'),_0x277c06);logger[_0x344a('0x11')](_0x344a('0x17'),_0x277c06,JSON[_0x344a('0x1d')](_0x450922));_0x9fe854(_0x450922);})[_0x344a('0x16')](function(_0x80ae12){logger[_0x344a('0x12')](_0x344a('0x17'),_0x80ae12[_0x344a('0x14')],_0x277c06);_0x274016(_0x49b55f[_0x344a('0x12')](0x1f4,_0x80ae12[_0x344a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 932c911..101c95b 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x0b0e[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0xf7bdcd,_0x373cbb){var _0x4a96ef=function(_0x2f48b5){while(--_0x2f48b5){_0xf7bdcd['push'](_0xf7bdcd['shift']());}};_0x4a96ef(++_0x373cbb);}(_0x757a,0xde));var _0xa757=function(_0x11d0f4,_0x117a62){_0x11d0f4=_0x11d0f4-0x0;var _0x33bb8f=_0x757a[_0x11d0f4];return _0x33bb8f;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 5181e50..19aa833 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 _0xf809=['login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','role','disabled','blocked','blockedAt','admin','user','agent','then','add','minutes','clearBlockUser','getLicense','catch','send','message'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf809,0xf8));var _0x9f80=function(_0x565ca9,_0x2d1389){_0x565ca9=_0x565ca9-0x0;var _0x2738a7=_0xf809[_0x565ca9];return _0x2738a7;};'use strict';var passport=require(_0x9f80('0x0'));var LocalStrategy=require(_0x9f80('0x1'))[_0x9f80('0x2')];var moment=require(_0x9f80('0x3'));var ActiveDirectory=require(_0x9f80('0x4'));var BPromise=require(_0x9f80('0x5'));var util=require('util');var db=require(_0x9f80('0x6'))['db'];var authService=require(_0x9f80('0x7'));var utils=require('../../config/utils');var config=require(_0x9f80('0x8'));var logger=require(_0x9f80('0x9'))('api');function isActiveDirectoryConfigured(_0x4d8e54){var _0x16591a=![];if(typeof _0x4d8e54['activedirectory']!==_0x9f80('0xa')){_0x16591a=_0x4d8e54[_0x9f80('0xb')][_0x9f80('0xc')]&&_0x4d8e54[_0x9f80('0xb')]['url']&&_0x4d8e54[_0x9f80('0xb')][_0x9f80('0xd')];}return _0x16591a;}function adAuthenticate(_0x51d8d4,_0x13f966,_0x3138d8){return new BPromise(function(_0x1e94a2,_0x354ad3){try{var _0x31694c=new ActiveDirectory(_0x51d8d4);_0x31694c[_0x9f80('0xe')](_0x13f966,_0x3138d8,function(_0x3e02a8,_0x29d4f8){if(_0x3e02a8){logger[_0x9f80('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x13f966,util[_0x9f80('0x10')](_0x3e02a8,{'showHidden':![],'depth':null}));_0x354ad3(_0x9f80('0x11'));}else if(!_0x29d4f8){logger[_0x9f80('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x13f966);_0x354ad3(_0x9f80('0x11'));}else{_0x1e94a2(_0x29d4f8);}});}catch(_0x43ff34){_0x354ad3(_0x43ff34);}});}function ActiveDirectoryAuthenticate(_0x5bd3de,_0x4d5404,_0x15d801,_0x43f4f5){var _0x1ea0b9,_0x49a6ad;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x9f80('0x12'),_0x4d5404);return _0x43f4f5(null,![],{'message':_0x9f80('0x11')});}return db[_0x9f80('0x13')][_0x9f80('0x14')]({'where':{'id':0x1},'attributes':[_0x9f80('0x15'),_0x9f80('0x16')],'raw':!![]})['then'](function(_0x15a34c){_0x1ea0b9=_0x15a34c;if(!_0x1ea0b9[_0x9f80('0x15')]){logger[_0x9f80('0xf')](_0x9f80('0x17'),_0x4d5404);throw new Error(_0x9f80('0x11'));}return _0x5bd3de[_0x9f80('0x14')]({'attributes':['id',_0x9f80('0x18'),'password','salt',_0x9f80('0x19'),_0x9f80('0x1a'),_0x9f80('0x1b'),_0x9f80('0x1c'),'online'],'where':{'name':_0x4d5404,'role':{'$or':[_0x9f80('0x1d'),_0x9f80('0x1e'),_0x9f80('0x1f')]},'adSsoEnabled':!![]}});})[_0x9f80('0x20')](function(_0x5a6da6){if(!_0x5a6da6||_0x5a6da6&&_0x5a6da6['name']!==_0x4d5404){throw new Error(_0x9f80('0x11'));}_0x49a6ad=_0x5a6da6;var _0x1d4253=_0x49a6ad[_0x9f80('0x18')]+'@'+config[_0x9f80('0xb')][_0x9f80('0xd')];return adAuthenticate(config[_0x9f80('0xb')],_0x1d4253,_0x15d801);})['then'](function(_0x3aec59){if(_0x49a6ad['disabled']){throw new Error(_0x9f80('0x11'));}if(_0x1ea0b9['blockDuration']>0x0){if(_0x49a6ad[_0x9f80('0x1b')]){if(moment(_0x49a6ad['blockedAt'])[_0x9f80('0x21')](_0x1ea0b9[_0x9f80('0x16')],_0x9f80('0x22'))>moment()){throw new Error(_0x9f80('0x11'));}return utils[_0x9f80('0x23')](_0x49a6ad,0x0,![],null)[_0x9f80('0x20')](function(){return utils['getLicense'](_0x49a6ad);})[_0x9f80('0x20')](function(){return _0x43f4f5(null,_0x49a6ad);});}else{return utils['getLicense'](_0x49a6ad)['then'](function(){return _0x43f4f5(null,_0x49a6ad);});}}else{return utils[_0x9f80('0x24')](_0x49a6ad)[_0x9f80('0x20')](function(){return _0x43f4f5(null,_0x49a6ad);});}})[_0x9f80('0x25')](function(_0x513f72){return _0x43f4f5(null,![],_0x513f72);});}function handleError(_0x17dcd9,_0x21b354,_0x5b4fbf){return _0x17dcd9['status'](_0x21b354||0x1f4)[_0x9f80('0x26')]({'message':_0x5b4fbf?_0x5b4fbf[_0x9f80('0x27')]||_0x5b4fbf:''});}exports[_0x9f80('0x28')]=function(_0x25cf80,_0x5a3b9d,_0x4dbf09){passport[_0x9f80('0xe')](_0x9f80('0x29'),function(_0x25a9ff,_0x23566f,_0x35d7f6){var _0x265d6d=_0x25a9ff||_0x35d7f6;if(_0x265d6d){return handleError(_0x5a3b9d,0x191,_0x265d6d);}if(!_0x23566f){return handleError(_0x5a3b9d,0x194,{'message':_0x9f80('0x2a')});}else{var _0x3614b4={'payload':{'id':_0x23566f['id'],'role':_0x23566f['role']},'options':{'expiresIn':0x15180}};return authService[_0x9f80('0x2b')](_0x3614b4)['then'](function(_0x2bec14){_0x5a3b9d[_0x9f80('0x2c')]({'id':_0x23566f['id'],'token':_0x2bec14,'statusCall':'','isAlreadyLogged':_0x23566f[_0x9f80('0x2d')]});});}})(_0x25cf80,_0x5a3b9d,_0x4dbf09);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x9f80('0x18'),'passwordField':_0x9f80('0x2e')},function(_0x1ada5d,_0x2ba715,_0x5c54ee){return ActiveDirectoryAuthenticate(db[_0x9f80('0x2f')],_0x1ada5d,_0x2ba715,_0x5c54ee);})); \ No newline at end of file +var _0x8c73=['findOne','adSsoEnabled','blockDuration','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','blocked','blockedAt','user','agent','then','disabled','add','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport','passport-local','Strategy','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting'];(function(_0x12c3d1,_0x3c6ae7){var _0x282840=function(_0x4ae0d2){while(--_0x4ae0d2){_0x12c3d1['push'](_0x12c3d1['shift']());}};_0x282840(++_0x3c6ae7);}(_0x8c73,0x10d));var _0x38c7=function(_0x503e4e,_0x5e9fba){_0x503e4e=_0x503e4e-0x0;var _0x30e5fd=_0x8c73[_0x503e4e];return _0x30e5fd;};'use strict';var passport=require(_0x38c7('0x0'));var LocalStrategy=require(_0x38c7('0x1'))[_0x38c7('0x2')];var moment=require(_0x38c7('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x38c7('0x4'));var util=require('util');var db=require(_0x38c7('0x5'))['db'];var authService=require(_0x38c7('0x6'));var utils=require(_0x38c7('0x7'));var config=require(_0x38c7('0x8'));var logger=require(_0x38c7('0x9'))(_0x38c7('0xa'));function isActiveDirectoryConfigured(_0x4d2f0b){var _0x113b2e=![];if(typeof _0x4d2f0b[_0x38c7('0xb')]!==_0x38c7('0xc')){_0x113b2e=_0x4d2f0b[_0x38c7('0xb')]['baseDN']&&_0x4d2f0b[_0x38c7('0xb')][_0x38c7('0xd')]&&_0x4d2f0b[_0x38c7('0xb')][_0x38c7('0xe')];}return _0x113b2e;}function adAuthenticate(_0x3fe746,_0x4a4708,_0x2beb46){return new BPromise(function(_0x57a090,_0x175496){try{var _0x25b213=new ActiveDirectory(_0x3fe746);_0x25b213['authenticate'](_0x4a4708,_0x2beb46,function(_0x460ae3,_0x4a8bc8){if(_0x460ae3){logger['error'](_0x38c7('0xf'),_0x4a4708,util[_0x38c7('0x10')](_0x460ae3,{'showHidden':![],'depth':null}));_0x175496(_0x38c7('0x11'));}else if(!_0x4a8bc8){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4a4708);_0x175496(_0x38c7('0x11'));}else{_0x57a090(_0x4a8bc8);}});}catch(_0x38e443){_0x175496(_0x38e443);}});}function ActiveDirectoryAuthenticate(_0x57b785,_0x239400,_0xbee7c7,_0x1c169d){var _0x101d00,_0x449b76;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x239400);return _0x1c169d(null,![],{'message':_0x38c7('0x11')});}return db[_0x38c7('0x12')][_0x38c7('0x13')]({'where':{'id':0x1},'attributes':[_0x38c7('0x14'),_0x38c7('0x15')],'raw':!![]})['then'](function(_0x1e300b){_0x101d00=_0x1e300b;if(!_0x101d00['adSsoEnabled']){logger[_0x38c7('0x16')](_0x38c7('0x17'),_0x239400);throw new Error(_0x38c7('0x11'));}return _0x57b785[_0x38c7('0x13')]({'attributes':['id',_0x38c7('0x18'),'password',_0x38c7('0x19'),_0x38c7('0x1a'),'disabled',_0x38c7('0x1b'),_0x38c7('0x1c'),'online'],'where':{'name':_0x239400,'role':{'$or':['admin',_0x38c7('0x1d'),_0x38c7('0x1e')]},'adSsoEnabled':!![]}});})[_0x38c7('0x1f')](function(_0x35d40e){if(!_0x35d40e||_0x35d40e&&_0x35d40e[_0x38c7('0x18')]!==_0x239400){throw new Error(_0x38c7('0x11'));}_0x449b76=_0x35d40e;var _0x3df980=_0x449b76['name']+'@'+config[_0x38c7('0xb')][_0x38c7('0xe')];return adAuthenticate(config[_0x38c7('0xb')],_0x3df980,_0xbee7c7);})[_0x38c7('0x1f')](function(_0x2b1c0c){if(_0x449b76[_0x38c7('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x101d00['blockDuration']>0x0){if(_0x449b76[_0x38c7('0x1b')]){if(moment(_0x449b76[_0x38c7('0x1c')])[_0x38c7('0x21')](_0x101d00[_0x38c7('0x15')],'minutes')>moment()){throw new Error(_0x38c7('0x11'));}return utils[_0x38c7('0x22')](_0x449b76,0x0,![],null)[_0x38c7('0x1f')](function(){return utils['getLicense'](_0x449b76);})['then'](function(){return _0x1c169d(null,_0x449b76);});}else{return utils['getLicense'](_0x449b76)[_0x38c7('0x1f')](function(){return _0x1c169d(null,_0x449b76);});}}else{return utils[_0x38c7('0x23')](_0x449b76)[_0x38c7('0x1f')](function(){return _0x1c169d(null,_0x449b76);});}})[_0x38c7('0x24')](function(_0x2bbbb5){return _0x1c169d(null,![],_0x2bbbb5);});}function handleError(_0x58bae8,_0x408f71,_0x359df2){return _0x58bae8[_0x38c7('0x25')](_0x408f71||0x1f4)[_0x38c7('0x26')]({'message':_0x359df2?_0x359df2[_0x38c7('0x27')]||_0x359df2:''});}exports[_0x38c7('0x28')]=function(_0x2486fa,_0x5e1fbf,_0x536b20){passport[_0x38c7('0x29')](_0x38c7('0x2a'),function(_0x5a1d90,_0x24a424,_0x116ba7){var _0x4a75ee=_0x5a1d90||_0x116ba7;if(_0x4a75ee){return handleError(_0x5e1fbf,0x191,_0x4a75ee);}if(!_0x24a424){return handleError(_0x5e1fbf,0x194,{'message':_0x38c7('0x2b')});}else{var _0x503f49={'payload':{'id':_0x24a424['id'],'role':_0x24a424[_0x38c7('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x38c7('0x2c')](_0x503f49)[_0x38c7('0x1f')](function(_0x28c573){_0x5e1fbf[_0x38c7('0x2d')]({'id':_0x24a424['id'],'token':_0x28c573,'statusCall':'','isAlreadyLogged':_0x24a424[_0x38c7('0x2e')]});});}})(_0x2486fa,_0x5e1fbf,_0x536b20);};passport['use'](_0x38c7('0x2a'),new LocalStrategy({'usernameField':_0x38c7('0x18'),'passwordField':'password'},function(_0xe41919,_0x5ccbc5,_0x1be301){return ActiveDirectoryAuthenticate(db[_0x38c7('0x2f')],_0xe41919,_0x5ccbc5,_0x1be301);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 35ca412..57bed48 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 _0x0605=['./authActiveDirectory.controller','post'];(function(_0x121f89,_0x1955a7){var _0x234cde=function(_0x2af241){while(--_0x2af241){_0x121f89['push'](_0x121f89['shift']());}};_0x234cde(++_0x1955a7);}(_0x0605,0x9c));var _0x5060=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x0605[_0x18a79d];return _0x4f8848;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x5060('0x0'));router[_0x5060('0x1')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x6d2a=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6d2a,0xfd));var _0xa6d2=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x6d2a[_0x40be86];return _0xda3c3b;};'use strict';var express=require('express');var router=express[_0xa6d2('0x0')]();var controller=require(_0xa6d2('0x1'));router[_0xa6d2('0x2')]('/',controller[_0xa6d2('0x3')]);module[_0xa6d2('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1616989..4d67b14 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(_0x23a2c8,_0x54b18f){var _0x1b9078=function(_0x4bab1d){while(--_0x4bab1d){_0x23a2c8['push'](_0x23a2c8['shift']());}};_0x1b9078(++_0x54b18f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _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(_0x33b8fd,_0x5bb9e6){var _0x46bd51=function(_0x11dc50){while(--_0x11dc50){_0x33b8fd['push'](_0x33b8fd['shift']());}};_0x46bd51(++_0x5bb9e6);}(_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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 7636d1b..4d0c766 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 _0x9740=['../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x430a16,_0xff018e){var _0x3b52c3=function(_0x598973){while(--_0x598973){_0x430a16['push'](_0x430a16['shift']());}};_0x3b52c3(++_0xff018e);}(_0x9740,0x10b));var _0x0974=function(_0x17ccae,_0x3d6d37){_0x17ccae=_0x17ccae-0x0;var _0x25414e=_0x9740[_0x17ccae];return _0x25414e;};'use strict';var express=require('express');var passport=require(_0x0974('0x0'));var router=express[_0x0974('0x1')]();var controller=require(_0x0974('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x0974('0x3'));router[_0x0974('0x4')]('/',controller[_0x0974('0x5')]);router['get']('/callback',controller[_0x0974('0x6')],authService[_0x0974('0x7')],userController[_0x0974('0x5')],authService[_0x0974('0x8')]);module[_0x0974('0x9')]=router; \ No newline at end of file +var _0x564c=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','get','/callback','isMiddleware','setTokenCookie','exports'];(function(_0x586a6f,_0x3956b4){var _0x211598=function(_0x5d92d5){while(--_0x5d92d5){_0x586a6f['push'](_0x586a6f['shift']());}};_0x211598(++_0x3956b4);}(_0x564c,0xe7));var _0xc564=function(_0x52be73,_0x1b4cbd){_0x52be73=_0x52be73-0x0;var _0x26f66a=_0x564c[_0x52be73];return _0x26f66a;};'use strict';var express=require(_0xc564('0x0'));var passport=require(_0xc564('0x1'));var router=express[_0xc564('0x2')]();var controller=require(_0xc564('0x3'));var userController=require(_0xc564('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0xc564('0x5')]);router[_0xc564('0x6')](_0xc564('0x7'),controller['callback'],authService[_0xc564('0x8')],userController[_0xc564('0x5')],authService[_0xc564('0x9')]);module[_0xc564('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index cd1c47a..517da0d 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 _0x4c7e=['user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','Reset\x20Email\x20sent!','reset','params','token','now','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','role','blocked','blockedAt','loginAttempts','admin'];(function(_0x2955b3,_0x54b39e){var _0x43a188=function(_0x4499e9){while(--_0x4499e9){_0x2955b3['push'](_0x2955b3['shift']());}};_0x43a188(++_0x54b39e);}(_0x4c7e,0x1c6));var _0xe4c7=function(_0x8ea8f6,_0x4d8275){_0x8ea8f6=_0x8ea8f6-0x0;var _0x124568=_0x4c7e[_0x8ea8f6];return _0x124568;};'use strict';var util=require(_0xe4c7('0x0'));var passport=require(_0xe4c7('0x1'));var LocalStrategy=require(_0xe4c7('0x2'))['Strategy'];var jayson=require(_0xe4c7('0x3'));var _=require(_0xe4c7('0x4'));var rs=require('randomstring');var moment=require(_0xe4c7('0x5'));var db=require(_0xe4c7('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe4c7('0x7'));var client=jayson[_0xe4c7('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x11f6fe,_0x24b9ee,_0x3de5f4,_0x272552){var _0x4a90f4,_0x5c84b4;return db[_0xe4c7('0x9')][_0xe4c7('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe4c7('0xb')],'raw':!![]})[_0xe4c7('0xc')](function(_0x1cd071){_0x4a90f4=_0x1cd071;return _0x11f6fe[_0xe4c7('0xa')]({'attributes':['id',_0xe4c7('0xd'),_0xe4c7('0xe'),'salt',_0xe4c7('0xf'),'disabled',_0xe4c7('0x10'),_0xe4c7('0x11'),_0xe4c7('0x12')],'where':{'name':_0x24b9ee,'role':{'$or':[_0xe4c7('0x13'),_0xe4c7('0x14'),'agent']}}});})[_0xe4c7('0xc')](function(_0x10f442){if(!_0x10f442||_0x10f442&&_0x10f442[_0xe4c7('0xd')]!==_0x24b9ee){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5c84b4=_0x10f442;return _0x5c84b4;}})[_0xe4c7('0xc')](function(){_0x5c84b4[_0xe4c7('0x15')](_0x3de5f4,function(_0x1099e1,_0x4717e6){var _0x32513f=_0x5c84b4[_0xe4c7('0x12')]+0x1;if(_0x1099e1){return _0x272552(_0x1099e1);}else if(!_0x4717e6){if(_0x5c84b4['disabled']){return _0x272552(null,![],{'message':_0xe4c7('0x16')});}else if(_0x4a90f4[_0xe4c7('0x17')]>0x0){if(_0x5c84b4[_0xe4c7('0x10')]){if(_0x4a90f4[_0xe4c7('0xb')]>0x0){if(moment(_0x5c84b4[_0xe4c7('0x11')])[_0xe4c7('0x18')](_0x4a90f4['blockDuration'],_0xe4c7('0x19'))>moment()){return _0x272552(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe4c7('0x1a')](_0x5c84b4,_0x32513f,![],null)['then'](function(){return _0x272552(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x272552(null,![],{'message':_0xe4c7('0x16')});}}else{if(_0x32513f>=_0x4a90f4[_0xe4c7('0x17')]){return utils[_0xe4c7('0x1a')](_0x5c84b4,0x0,!![],moment())[_0xe4c7('0xc')](function(){return _0x272552(null,![],{'message':_0xe4c7('0x16')});});}else{return utils[_0xe4c7('0x1a')](_0x5c84b4,_0x32513f,![],null)[_0xe4c7('0xc')](function(){return _0x272552(null,![],{'message':_0xe4c7('0x16')});});}}}else{return _0x272552(null,![],{'message':_0xe4c7('0x16')});}}else{if(_0x5c84b4[_0xe4c7('0x1b')]){return _0x272552(null,![],{'message':_0xe4c7('0x16')});}else if(_0x4a90f4[_0xe4c7('0x17')]>0x0){if(_0x5c84b4[_0xe4c7('0x10')]){if(_0x4a90f4[_0xe4c7('0xb')]>0x0){if(moment(_0x5c84b4[_0xe4c7('0x11')])[_0xe4c7('0x18')](_0x4a90f4[_0xe4c7('0xb')],_0xe4c7('0x19'))>moment()){return _0x272552(null,![],{'message':_0xe4c7('0x16')});}else{return utils[_0xe4c7('0x1a')](_0x5c84b4,0x0,![],null)[_0xe4c7('0xc')](function(){return utils[_0xe4c7('0x1c')](_0x5c84b4);})['then'](function(){return _0x272552(null,_0x5c84b4);});}}else{return _0x272552(null,![],{'message':_0xe4c7('0x16')});}}else{return utils[_0xe4c7('0x1a')](_0x5c84b4,0x0,![],null)[_0xe4c7('0xc')](function(){return utils[_0xe4c7('0x1c')](_0x5c84b4);})[_0xe4c7('0xc')](function(){return _0x272552(null,_0x5c84b4);})[_0xe4c7('0x1d')](function(_0x5bfc41){return _0x272552(null,![],_0x5bfc41);});}}else{if(_0x5c84b4['blocked']){return _0x272552(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe4c7('0x1c')](_0x5c84b4)[_0xe4c7('0xc')](function(){return _0x272552(null,_0x5c84b4);});}}}});})[_0xe4c7('0x1d')](function(_0x43fa9e){return _0x272552(null,![],_0x43fa9e);});}function sendServiceMail(_0x51f8f3){return db[_0xe4c7('0x1e')][_0xe4c7('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xe4c7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xe4c7('0x21'),'include':[{'model':db['CloudProvider'],'as':_0xe4c7('0x22')}]}]})['then'](function(_0x3b9a2a){if(!_0x3b9a2a){throw new Error(_0xe4c7('0x23'));}var _0x565281=_0x3b9a2a[_0xe4c7('0x24')]();var _0x547713={'account':_0x565281,'message':_[_0xe4c7('0x25')]({'from':util[_0xe4c7('0x26')](_0xe4c7('0x27'),_0x3b9a2a[_0xe4c7('0xd')],_0x3b9a2a[_0xe4c7('0x20')]||_0x3b9a2a[_0xe4c7('0x21')][_0xe4c7('0x14')])},_0x51f8f3)};return client[_0xe4c7('0x28')](_0xe4c7('0x29'),_0x547713);})['then'](function(_0x4e7211){if(_0x4e7211[_0xe4c7('0x2a')]){throw new Error(util[_0xe4c7('0x26')](_0xe4c7('0x2b'),_0x4e7211[_0xe4c7('0x2a')]['message']||JSON[_0xe4c7('0x2c')](_0x4e7211[_0xe4c7('0x2a')])));}return!![];});}function handleError(_0x45a67e,_0x5256a4,_0x64a0c7){return _0x45a67e[_0xe4c7('0x2d')](_0x5256a4||0x1f4)[_0xe4c7('0x2e')]({'message':_0x64a0c7?_0x64a0c7[_0xe4c7('0x2f')]||_0x64a0c7:''});}exports[_0xe4c7('0x30')]=function(_0x493baa,_0x52977d,_0x56c7f9){passport[_0xe4c7('0x15')](_0xe4c7('0x31'),function(_0x35a23a,_0x4dad0c,_0x3730fa){var _0x4fa8ec=_0x35a23a||_0x3730fa;if(_0x4fa8ec){return handleError(_0x52977d,0x191,_0x4fa8ec);}if(!_0x4dad0c){return handleError(_0x52977d,0x194,{'message':_0xe4c7('0x32')});}else{var _0x35a096={'payload':{'id':_0x4dad0c['id'],'role':_0x4dad0c[_0xe4c7('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x35a096)[_0xe4c7('0xc')](function(_0x51047c){_0x52977d[_0xe4c7('0x33')]({'id':_0x4dad0c['id'],'token':_0x51047c,'statusCall':'','isAlreadyLogged':_0x4dad0c[_0xe4c7('0x34')]});});}})(_0x493baa,_0x52977d,_0x56c7f9);};exports[_0xe4c7('0x35')]=function(_0x1a2263,_0x2bfe5a){if(!_0x1a2263[_0xe4c7('0x36')][_0xe4c7('0x20')]){return handleError(_0x2bfe5a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2db9b8=rs['generate']();_0x1a2263[_0xe4c7('0x36')][_0xe4c7('0x20')]=_0x1a2263[_0xe4c7('0x36')][_0xe4c7('0x20')][_0xe4c7('0x37')]()[_0xe4c7('0x38')]();var _0x4ae661;return db[_0xe4c7('0x9')][_0xe4c7('0xa')]({'where':{'id':0x1},'attributes':[_0xe4c7('0x17'),'blockDuration'],'raw':!![]})['then'](function(_0x2e4139){_0x4ae661=_0x2e4139;return db[_0xe4c7('0x39')][_0xe4c7('0x1f')]({'where':{'email':_0x1a2263['body'][_0xe4c7('0x20')]}});})[_0xe4c7('0xc')](function(_0x14ff1a){if(!_0x14ff1a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x14ff1a[_0xe4c7('0x1b')]){throw new Error(_0xe4c7('0x3a'));}if(_0x14ff1a['blocked']){if(moment(_0x14ff1a[_0xe4c7('0x11')])[_0xe4c7('0x18')](_0x4ae661[_0xe4c7('0xb')],_0xe4c7('0x19'))>moment()){throw new Error(_0xe4c7('0x3b'));}else{_0x14ff1a['blocked']=![];_0x14ff1a[_0xe4c7('0x11')]=null;}}_0x14ff1a['resetPasswordToken']=_0x2db9b8;_0x14ff1a[_0xe4c7('0x3c')]=Date['now']()+0x36ee80;return _0x14ff1a['save']();})['then'](function(){return sendServiceMail({'to':_0x1a2263['body'][_0xe4c7('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe4c7('0x3d')+_0xe4c7('0x3e')+_0xe4c7('0x3f')+_0x1a2263['headers'][_0xe4c7('0x40')]+'/reset/'+_0x2db9b8+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xe4c7('0xc')](function(){_0x2bfe5a['status'](0xc8)[_0xe4c7('0x2e')]({'message':_0xe4c7('0x41')});})['catch'](function(_0x213944){return handleError(_0x2bfe5a,0x1f4,_0x213944);});};exports[_0xe4c7('0x42')]=function(_0x50af67,_0x46912f){return db[_0xe4c7('0x39')][_0xe4c7('0x1f')]({'where':{'resetPasswordToken':_0x50af67[_0xe4c7('0x43')][_0xe4c7('0x44')],'resetPasswordExpires':{'$gt':Date[_0xe4c7('0x45')]()}}})[_0xe4c7('0xc')](function(_0xf91555){if(!_0xf91555){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xe4c7('0x9')][_0xe4c7('0xa')]({'attributes':['id','securePassword',_0xe4c7('0x46'),_0xe4c7('0x47')]})[_0xe4c7('0xc')](function(_0x372ac7){if(_0x372ac7[_0xe4c7('0x48')])authService[_0xe4c7('0x49')](_0x50af67[_0xe4c7('0x36')][_0xe4c7('0xe')]);if(!_0x372ac7[_0xe4c7('0x46')]||!_0xf91555[_0xe4c7('0x4a')])return _0xf91555;authService[_0xe4c7('0x4b')](_0x50af67[_0xe4c7('0x36')][_0xe4c7('0xe')],_0xf91555['previousPasswords'],_0x372ac7[_0xe4c7('0x47')]);return _0xf91555;})[_0xe4c7('0xc')](function(){_0xf91555[_0xe4c7('0xe')]=_0x50af67[_0xe4c7('0x36')][_0xe4c7('0xe')];_0xf91555[_0xe4c7('0x4c')]=null;_0xf91555[_0xe4c7('0x3c')]=null;return _0xf91555[_0xe4c7('0x4d')]();});})[_0xe4c7('0xc')](function(){_0x46912f[_0xe4c7('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xe4c7('0x1d')](function(_0x4c3a07){return handleError(_0x46912f,0x1f4,_0x4c3a07);});};passport[_0xe4c7('0x4e')](_0xe4c7('0x31'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xcf8641,_0xf06143,_0x44f693){return localAuthenticate(db['User'],_0xcf8641,_0xf06143,_0x44f693);})); \ No newline at end of file +var _0xd07f=['trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x3e6e8a,_0x51847a){var _0x478af0=function(_0xa5ad58){while(--_0xa5ad58){_0x3e6e8a['push'](_0x3e6e8a['shift']());}};_0x478af0(++_0x51847a);}(_0xd07f,0x1af));var _0xfd07=function(_0x4f467a,_0x1ac0ad){_0x4f467a=_0x4f467a-0x0;var _0x1b4c6e=_0xd07f[_0x4f467a];return _0x1b4c6e;};'use strict';var util=require(_0xfd07('0x0'));var passport=require(_0xfd07('0x1'));var LocalStrategy=require(_0xfd07('0x2'))[_0xfd07('0x3')];var jayson=require(_0xfd07('0x4'));var _=require(_0xfd07('0x5'));var rs=require(_0xfd07('0x6'));var moment=require(_0xfd07('0x7'));var db=require(_0xfd07('0x8'))['db'];var authService=require(_0xfd07('0x9'));var utils=require('../../config/utils');var client=jayson[_0xfd07('0xa')][_0xfd07('0xb')]({'port':0x232b});function localAuthenticate(_0x515a0d,_0x5d4e09,_0x44eef8,_0x2bd88f){var _0x3cb555,_0x37aa75;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xfd07('0xc'),_0xfd07('0xd')],'raw':!![]})['then'](function(_0x562dd9){_0x3cb555=_0x562dd9;return _0x515a0d[_0xfd07('0xe')]({'attributes':['id',_0xfd07('0xf'),_0xfd07('0x10'),_0xfd07('0x11'),_0xfd07('0x12'),_0xfd07('0x13'),'blocked',_0xfd07('0x14'),_0xfd07('0x15')],'where':{'name':_0x5d4e09,'role':{'$or':[_0xfd07('0x16'),'user','agent']}}});})[_0xfd07('0x17')](function(_0x26a548){if(!_0x26a548||_0x26a548&&_0x26a548[_0xfd07('0xf')]!==_0x5d4e09){throw new Error(_0xfd07('0x18'));}else{_0x37aa75=_0x26a548;return _0x37aa75;}})[_0xfd07('0x17')](function(){_0x37aa75[_0xfd07('0x19')](_0x44eef8,function(_0x355d4b,_0x40e81b){var _0x2ab81b=_0x37aa75[_0xfd07('0x15')]+0x1;if(_0x355d4b){return _0x2bd88f(_0x355d4b);}else if(!_0x40e81b){if(_0x37aa75[_0xfd07('0x13')]){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}else if(_0x3cb555['allowedLoginAttempts']>0x0){if(_0x37aa75[_0xfd07('0x1a')]){if(_0x3cb555[_0xfd07('0xd')]>0x0){if(moment(_0x37aa75[_0xfd07('0x14')])[_0xfd07('0x1b')](_0x3cb555[_0xfd07('0xd')],_0xfd07('0x1c'))>moment()){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}else{return utils[_0xfd07('0x1d')](_0x37aa75,_0x2ab81b,![],null)[_0xfd07('0x17')](function(){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});});}}else{return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}}else{if(_0x2ab81b>=_0x3cb555['allowedLoginAttempts']){return utils[_0xfd07('0x1d')](_0x37aa75,0x0,!![],moment())[_0xfd07('0x17')](function(){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});});}else{return utils[_0xfd07('0x1d')](_0x37aa75,_0x2ab81b,![],null)[_0xfd07('0x17')](function(){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});});}}}else{return _0x2bd88f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x37aa75[_0xfd07('0x13')]){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}else if(_0x3cb555['allowedLoginAttempts']>0x0){if(_0x37aa75[_0xfd07('0x1a')]){if(_0x3cb555[_0xfd07('0xd')]>0x0){if(moment(_0x37aa75[_0xfd07('0x14')])[_0xfd07('0x1b')](_0x3cb555[_0xfd07('0xd')],_0xfd07('0x1c'))>moment()){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}else{return utils[_0xfd07('0x1d')](_0x37aa75,0x0,![],null)[_0xfd07('0x17')](function(){return utils[_0xfd07('0x1e')](_0x37aa75);})['then'](function(){return _0x2bd88f(null,_0x37aa75);});}}else{return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}}else{return utils[_0xfd07('0x1d')](_0x37aa75,0x0,![],null)[_0xfd07('0x17')](function(){return utils[_0xfd07('0x1e')](_0x37aa75);})[_0xfd07('0x17')](function(){return _0x2bd88f(null,_0x37aa75);})[_0xfd07('0x1f')](function(_0x268be9){return _0x2bd88f(null,![],_0x268be9);});}}else{if(_0x37aa75['blocked']){return _0x2bd88f(null,![],{'message':_0xfd07('0x18')});}else{return utils[_0xfd07('0x1e')](_0x37aa75)[_0xfd07('0x17')](function(){return _0x2bd88f(null,_0x37aa75);});}}}});})[_0xfd07('0x1f')](function(_0x385640){return _0x2bd88f(null,![],_0x385640);});}function sendServiceMail(_0x5899f4){return db['MailAccount'][_0xfd07('0x20')]({'where':{'service':!![]},'attributes':['id',_0xfd07('0xf'),_0xfd07('0x21')],'include':[{'model':db[_0xfd07('0x22')],'as':_0xfd07('0x23'),'include':[{'model':db[_0xfd07('0x24')],'as':_0xfd07('0x24')}]}]})['then'](function(_0x3943e3){if(!_0x3943e3){throw new Error(_0xfd07('0x25'));}var _0x250453=_0x3943e3['getSmtpOptions']();var _0x23b814={'account':_0x250453,'message':_[_0xfd07('0x26')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x3943e3['name'],_0x3943e3[_0xfd07('0x21')]||_0x3943e3[_0xfd07('0x23')]['user'])},_0x5899f4)};return client[_0xfd07('0x27')]('SendMail',_0x23b814);})['then'](function(_0x4d83a9){if(_0x4d83a9['error']){throw new Error(util[_0xfd07('0x28')](_0xfd07('0x29'),_0x4d83a9[_0xfd07('0x2a')][_0xfd07('0x2b')]||JSON[_0xfd07('0x2c')](_0x4d83a9[_0xfd07('0x2a')])));}return!![];});}function handleError(_0x57051d,_0x50fd53,_0x2fa2f1){return _0x57051d[_0xfd07('0x2d')](_0x50fd53||0x1f4)[_0xfd07('0x2e')]({'message':_0x2fa2f1?_0x2fa2f1[_0xfd07('0x2b')]||_0x2fa2f1:''});}exports[_0xfd07('0x2f')]=function(_0x5727f5,_0x54f044,_0x2496fd){passport['authenticate']('local-login',function(_0x395f13,_0x2c23cf,_0x34858f){var _0x1800bc=_0x395f13||_0x34858f;if(_0x1800bc){return handleError(_0x54f044,0x191,_0x1800bc);}if(!_0x2c23cf){return handleError(_0x54f044,0x194,{'message':_0xfd07('0x30')});}else{var _0x274531={'payload':{'id':_0x2c23cf['id'],'role':_0x2c23cf['role']},'options':{'expiresIn':0x15180}};return authService[_0xfd07('0x31')](_0x274531)[_0xfd07('0x17')](function(_0x3f05dd){_0x54f044[_0xfd07('0x32')]({'id':_0x2c23cf['id'],'token':_0x3f05dd,'statusCall':'','isAlreadyLogged':_0x2c23cf[_0xfd07('0x33')]});});}})(_0x5727f5,_0x54f044,_0x2496fd);};exports[_0xfd07('0x34')]=function(_0x52b2d0,_0x21cb06){if(!_0x52b2d0[_0xfd07('0x35')][_0xfd07('0x21')]){return handleError(_0x21cb06,0x1f4,{'message':_0xfd07('0x36')});}var _0x139c76=rs['generate']();_0x52b2d0[_0xfd07('0x35')][_0xfd07('0x21')]=_0x52b2d0['body'][_0xfd07('0x21')][_0xfd07('0x37')]()['toLowerCase']();var _0x7f6772;return db[_0xfd07('0x38')][_0xfd07('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfd07('0xd')],'raw':!![]})[_0xfd07('0x17')](function(_0x568f1a){_0x7f6772=_0x568f1a;return db[_0xfd07('0x39')][_0xfd07('0x20')]({'where':{'email':_0x52b2d0[_0xfd07('0x35')][_0xfd07('0x21')]}});})[_0xfd07('0x17')](function(_0x5b335c){if(!_0x5b335c){throw new Error(_0xfd07('0x3a'));}if(_0x5b335c[_0xfd07('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5b335c['blocked']){if(moment(_0x5b335c[_0xfd07('0x14')])[_0xfd07('0x1b')](_0x7f6772[_0xfd07('0xd')],_0xfd07('0x1c'))>moment()){throw new Error(_0xfd07('0x3b'));}else{_0x5b335c[_0xfd07('0x1a')]=![];_0x5b335c[_0xfd07('0x14')]=null;}}_0x5b335c[_0xfd07('0x3c')]=_0x139c76;_0x5b335c[_0xfd07('0x3d')]=Date[_0xfd07('0x3e')]()+0x36ee80;return _0x5b335c[_0xfd07('0x3f')]();})[_0xfd07('0x17')](function(){return sendServiceMail({'to':_0x52b2d0[_0xfd07('0x35')]['email'],'subject':_0xfd07('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xfd07('0x41')+_0xfd07('0x42')+_0x52b2d0['headers']['host']+_0xfd07('0x43')+_0x139c76+'\x0a\x0a'+_0xfd07('0x44')});})[_0xfd07('0x17')](function(){_0x21cb06[_0xfd07('0x2d')](0xc8)[_0xfd07('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0xfd07('0x1f')](function(_0x3cdd83){return handleError(_0x21cb06,0x1f4,_0x3cdd83);});};exports[_0xfd07('0x45')]=function(_0x3b06cd,_0x14f76a){return db[_0xfd07('0x39')][_0xfd07('0x20')]({'where':{'resetPasswordToken':_0x3b06cd[_0xfd07('0x46')][_0xfd07('0x47')],'resetPasswordExpires':{'$gt':Date[_0xfd07('0x3e')]()}}})[_0xfd07('0x17')](function(_0x83ac3b){if(!_0x83ac3b){throw new Error(_0xfd07('0x48'));}return db[_0xfd07('0x38')][_0xfd07('0xe')]({'attributes':['id',_0xfd07('0x49'),_0xfd07('0x4a'),_0xfd07('0x4b')]})[_0xfd07('0x17')](function(_0x12e452){if(_0x12e452['securePassword'])authService[_0xfd07('0x4c')](_0x3b06cd[_0xfd07('0x35')][_0xfd07('0x10')]);if(!_0x12e452[_0xfd07('0x4a')]||!_0x83ac3b[_0xfd07('0x4d')])return _0x83ac3b;authService['validatePasswordHistory'](_0x3b06cd['body'][_0xfd07('0x10')],_0x83ac3b[_0xfd07('0x4d')],_0x12e452[_0xfd07('0x4b')]);return _0x83ac3b;})['then'](function(){_0x83ac3b[_0xfd07('0x10')]=_0x3b06cd[_0xfd07('0x35')][_0xfd07('0x10')];_0x83ac3b[_0xfd07('0x3c')]=null;_0x83ac3b[_0xfd07('0x3d')]=null;return _0x83ac3b['save']();});})[_0xfd07('0x17')](function(){_0x14f76a[_0xfd07('0x2d')](0xc8)[_0xfd07('0x2e')]({'message':_0xfd07('0x4e')});})[_0xfd07('0x1f')](function(_0x98c607){return handleError(_0x14f76a,0x1f4,_0x98c607);});};passport[_0xfd07('0x4f')](_0xfd07('0x50'),new LocalStrategy({'usernameField':_0xfd07('0xf'),'passwordField':'password'},function(_0x41b10f,_0x4b3218,_0x411d70){return localAuthenticate(db['User'],_0x41b10f,_0x4b3218,_0x411d70);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7e55b41..fbece8e 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 _0x398d=['/reset/:token','exports','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x2986cf,_0x5371a4){var _0x411d61=function(_0x264752){while(--_0x264752){_0x2986cf['push'](_0x2986cf['shift']());}};_0x411d61(++_0x5371a4);}(_0x398d,0x1c2));var _0xd398=function(_0x43c8ed,_0x3f7a15){_0x43c8ed=_0x43c8ed-0x0;var _0x444198=_0x398d[_0x43c8ed];return _0x444198;};'use strict';var express=require('express');var router=express[_0xd398('0x0')]();var controller=require(_0xd398('0x1'));router[_0xd398('0x2')]('/',controller[_0xd398('0x3')]);router[_0xd398('0x2')](_0xd398('0x4'),controller[_0xd398('0x5')]);router['post'](_0xd398('0x6'),controller['reset']);module[_0xd398('0x7')]=router; \ No newline at end of file +var _0x3b46=['post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x28c83d,_0x5dee5a){var _0x13a169=function(_0x4a01aa){while(--_0x4a01aa){_0x28c83d['push'](_0x28c83d['shift']());}};_0x13a169(++_0x5dee5a);}(_0x3b46,0xdf));var _0x63b4=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0x3b46[_0x2e7a43];return _0x52e9e1;};'use strict';var express=require(_0x63b4('0x0'));var router=express[_0x63b4('0x1')]();var controller=require('./authLocal.controller');router[_0x63b4('0x2')]('/',controller[_0x63b4('0x3')]);router[_0x63b4('0x2')](_0x63b4('0x4'),controller[_0x63b4('0x5')]);router[_0x63b4('0x2')](_0x63b4('0x6'),controller[_0x63b4('0x7')]);module[_0x63b4('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index b80d4ba..42ef973 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 _0x382a=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x362092,_0x3e5a95){var _0x561b0d=function(_0x46d246){while(--_0x46d246){_0x362092['push'](_0x362092['shift']());}};_0x561b0d(++_0x3e5a95);}(_0x382a,0x12e));var _0xa382=function(_0x5b58ba,_0x16159f){_0x5b58ba=_0x5b58ba-0x0;var _0xc67099=_0x382a[_0x5b58ba];return _0xc67099;};'use strict';var Sequelize=require(_0xa382('0x0'));module[_0xa382('0x1')]={'name':{'type':Sequelize[_0xa382('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa382('0x2')]},'description':{'type':Sequelize[_0xa382('0x2')]},'status':{'type':Sequelize[_0xa382('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa382('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x40fc=['STRING','INTEGER','sequelize','exports'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x40fc,0xf2));var _0xc40f=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0x40fc[_0x4cf0b7];return _0x545f10;};'use strict';var Sequelize=require(_0xc40f('0x0'));module[_0xc40f('0x1')]={'name':{'type':Sequelize[_0xc40f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xc40f('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc40f('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index a98d272..0ed8751 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 _0x1c6e=['omit','getConditions','options','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','show','find','catch','create','body','params','addConditions','Condition','ids'];(function(_0x5d78ed,_0x2e7e61){var _0x1dabdd=function(_0x4cbf34){while(--_0x4cbf34){_0x5d78ed['push'](_0x5d78ed['shift']());}};_0x1dabdd(++_0x2e7e61);}(_0x1c6e,0x106));var _0xe1c6=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x1c6e[_0x1a8ff0];return _0x3588bf;};'use strict';var emlformat=require(_0xe1c6('0x0'));var rimraf=require(_0xe1c6('0x1'));var zipdir=require(_0xe1c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1c6('0x3'));var moment=require('moment');var BPromise=require(_0xe1c6('0x4'));var Mustache=require(_0xe1c6('0x5'));var util=require(_0xe1c6('0x6'));var path=require(_0xe1c6('0x7'));var sox=require(_0xe1c6('0x8'));var csv=require(_0xe1c6('0x9'));var ejs=require(_0xe1c6('0xa'));var fs=require('fs');var fs_extra=require(_0xe1c6('0xb'));var _=require(_0xe1c6('0xc'));var squel=require(_0xe1c6('0xd'));var crypto=require(_0xe1c6('0xe'));var jsforce=require(_0xe1c6('0xf'));var deskjs=require(_0xe1c6('0x10'));var toCsv=require(_0xe1c6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1c6('0x11'));var authService=require(_0xe1c6('0x12'));var qs=require(_0xe1c6('0x13'));var as=require(_0xe1c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1c6('0x15'))(_0xe1c6('0x16'));var utils=require(_0xe1c6('0x17'));var config=require(_0xe1c6('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37c349,_0xe8f2a2){_0xe8f2a2=_0xe8f2a2||0xcc;return function(_0x4d6879){if(_0x4d6879){return _0x37c349[_0xe1c6('0x19')](_0xe8f2a2);}return _0x37c349[_0xe1c6('0x1a')](_0xe8f2a2)['end']();};}function respondWithResult(_0x18aa48,_0x107b5a){_0x107b5a=_0x107b5a||0xc8;return function(_0x1b145a){if(_0x1b145a){return _0x18aa48['status'](_0x107b5a)[_0xe1c6('0x1b')](_0x1b145a);}};}function respondWithFilteredResult(_0x5ad98a,_0x309f5b){return function(_0x460550){if(_0x460550){var _0xe8b743=typeof _0x309f5b[_0xe1c6('0x1c')]==='undefined'&&typeof _0x309f5b[_0xe1c6('0x1d')]===_0xe1c6('0x1e');var _0x5ea286=_0x460550[_0xe1c6('0x1f')];var _0x3be0fc=_0xe8b743?0x0:_0x309f5b[_0xe1c6('0x1c')];var _0x29421d=_0xe8b743?_0x460550['count']:_0x309f5b[_0xe1c6('0x1c')]+_0x309f5b[_0xe1c6('0x1d')];var _0x38d581;if(_0x29421d>=_0x5ea286){_0x29421d=_0x5ea286;_0x38d581=0xc8;}else{_0x38d581=0xce;}_0x5ad98a['status'](_0x38d581);return _0x5ad98a['set'](_0xe1c6('0x20'),_0x3be0fc+'-'+_0x29421d+'/'+_0x5ea286)[_0xe1c6('0x1b')](_0x460550);}return null;};}function patchUpdates(_0x5b0c7b){return function(_0x25391f){try{jsonpatch[_0xe1c6('0x21')](_0x25391f,_0x5b0c7b,!![]);}catch(_0xf2d6eb){return BPromise['reject'](_0xf2d6eb);}return _0x25391f[_0xe1c6('0x22')]();};}function saveUpdates(_0x3475be,_0x407d10){return function(_0x6f8a3b){if(_0x6f8a3b){return _0x6f8a3b[_0xe1c6('0x23')](_0x3475be)['then'](function(_0x5ef34e){return _0x5ef34e;});}return null;};}function removeEntity(_0x346059,_0x2cfa18){return function(_0x5aa721){if(_0x5aa721){return _0x5aa721[_0xe1c6('0x24')]()[_0xe1c6('0x25')](function(){_0x346059[_0xe1c6('0x1a')](0xcc)[_0xe1c6('0x26')]();});}};}function handleEntityNotFound(_0x3f7bc1,_0x550dfe){return function(_0x42f29f){if(!_0x42f29f){_0x3f7bc1[_0xe1c6('0x19')](0x194);}return _0x42f29f;};}function handleError(_0xe112e8,_0x54dc0d){_0x54dc0d=_0x54dc0d||0x1f4;return function(_0x2e221f){logger[_0xe1c6('0x27')](_0x2e221f[_0xe1c6('0x28')]);if(_0x2e221f['name']){delete _0x2e221f[_0xe1c6('0x29')];}_0xe112e8['status'](_0x54dc0d)[_0xe1c6('0x2a')](_0x2e221f);};}exports[_0xe1c6('0x2b')]=function(_0x6dfc23,_0x112b45){var _0x332ea3={},_0x2d6174={},_0x565192={'count':0x0,'rows':[]};var _0x1cea3b=_[_0xe1c6('0x2c')](db[_0xe1c6('0x2d')][_0xe1c6('0x2e')],function(_0x1b8cd1){return{'name':_0x1b8cd1[_0xe1c6('0x2f')],'type':_0x1b8cd1[_0xe1c6('0x30')][_0xe1c6('0x31')]};});_0x2d6174[_0xe1c6('0x32')]=_['map'](_0x1cea3b,'name');_0x2d6174[_0xe1c6('0x33')]=_[_0xe1c6('0x34')](_0x6dfc23[_0xe1c6('0x33')]);_0x2d6174[_0xe1c6('0x35')]=_[_0xe1c6('0x36')](_0x2d6174[_0xe1c6('0x32')],_0x2d6174[_0xe1c6('0x33')]);_0x332ea3[_0xe1c6('0x37')]=_[_0xe1c6('0x36')](_0x2d6174[_0xe1c6('0x32')],qs[_0xe1c6('0x38')](_0x6dfc23[_0xe1c6('0x33')]['fields']));_0x332ea3[_0xe1c6('0x37')]=_0x332ea3[_0xe1c6('0x37')][_0xe1c6('0x39')]?_0x332ea3['attributes']:_0x2d6174[_0xe1c6('0x32')];if(!_0x6dfc23[_0xe1c6('0x33')][_0xe1c6('0x3a')](_0xe1c6('0x3b'))){_0x332ea3[_0xe1c6('0x1d')]=qs['limit'](_0x6dfc23['query'][_0xe1c6('0x1d')]);_0x332ea3[_0xe1c6('0x1c')]=qs[_0xe1c6('0x1c')](_0x6dfc23[_0xe1c6('0x33')][_0xe1c6('0x1c')]);}_0x332ea3[_0xe1c6('0x3c')]=qs['sort'](_0x6dfc23['query'][_0xe1c6('0x3d')]);_0x332ea3['where']=qs[_0xe1c6('0x35')](_[_0xe1c6('0x3e')](_0x6dfc23[_0xe1c6('0x33')],_0x2d6174[_0xe1c6('0x35')]),_0x1cea3b);if(_0x6dfc23[_0xe1c6('0x33')][_0xe1c6('0x3f')]){_0x332ea3['where']=_[_0xe1c6('0x40')](_0x332ea3['where'],{'$or':_[_0xe1c6('0x2c')](_0x1cea3b,function(_0x22bb45){if(_0x22bb45[_0xe1c6('0x30')]!=='VIRTUAL'){var _0x142d1a={};_0x142d1a[_0x22bb45[_0xe1c6('0x29')]]={'$like':'%'+_0x6dfc23['query']['filter']+'%'};return _0x142d1a;}})});}_0x332ea3=_[_0xe1c6('0x40')]({},_0x332ea3,_0x6dfc23['options']);var _0x44f9fb={'where':_0x332ea3[_0xe1c6('0x41')]};return db['Automation'][_0xe1c6('0x1f')](_0x44f9fb)[_0xe1c6('0x25')](function(_0x5e9e74){_0x565192['count']=_0x5e9e74;if(_0x6dfc23[_0xe1c6('0x33')][_0xe1c6('0x42')]){_0x332ea3[_0xe1c6('0x43')]=[{'all':!![]}];}return db[_0xe1c6('0x2d')]['findAll'](_0x332ea3);})[_0xe1c6('0x25')](function(_0x1eed96){_0x565192[_0xe1c6('0x44')]=_0x1eed96;return _0x565192;})[_0xe1c6('0x25')](respondWithFilteredResult(_0x112b45,_0x332ea3))['catch'](handleError(_0x112b45,null));};exports[_0xe1c6('0x45')]=function(_0x12028b,_0x3343a2){var _0x478a2a={'raw':![],'where':{'id':_0x12028b['params']['id']}},_0x56fce4={};_0x56fce4[_0xe1c6('0x32')]=_[_0xe1c6('0x34')](db[_0xe1c6('0x2d')]['rawAttributes']);_0x56fce4[_0xe1c6('0x33')]=_[_0xe1c6('0x34')](_0x12028b[_0xe1c6('0x33')]);_0x56fce4[_0xe1c6('0x35')]=_[_0xe1c6('0x36')](_0x56fce4[_0xe1c6('0x32')],_0x56fce4[_0xe1c6('0x33')]);_0x478a2a[_0xe1c6('0x37')]=_[_0xe1c6('0x36')](_0x56fce4['model'],qs[_0xe1c6('0x38')](_0x12028b['query']['fields']));_0x478a2a['attributes']=_0x478a2a['attributes'][_0xe1c6('0x39')]?_0x478a2a[_0xe1c6('0x37')]:_0x56fce4[_0xe1c6('0x32')];if(_0x12028b[_0xe1c6('0x33')][_0xe1c6('0x42')]){_0x478a2a[_0xe1c6('0x43')]=[{'all':!![]}];}_0x478a2a=_[_0xe1c6('0x40')]({},_0x478a2a,_0x12028b['options']);return db[_0xe1c6('0x2d')][_0xe1c6('0x46')](_0x478a2a)[_0xe1c6('0x25')](handleEntityNotFound(_0x3343a2,null))[_0xe1c6('0x25')](respondWithResult(_0x3343a2,null))[_0xe1c6('0x47')](handleError(_0x3343a2,null));};exports[_0xe1c6('0x48')]=function(_0x370a3e,_0xc8bc0d){return db[_0xe1c6('0x2d')][_0xe1c6('0x48')](_0x370a3e[_0xe1c6('0x49')],{})[_0xe1c6('0x25')](respondWithResult(_0xc8bc0d,0xc9))[_0xe1c6('0x47')](handleError(_0xc8bc0d,null));};exports['update']=function(_0x51dc2b,_0xe2397b){if(_0x51dc2b[_0xe1c6('0x49')]['id']){delete _0x51dc2b[_0xe1c6('0x49')]['id'];}return db['Automation'][_0xe1c6('0x46')]({'where':{'id':_0x51dc2b['params']['id']}})[_0xe1c6('0x25')](handleEntityNotFound(_0xe2397b,null))['then'](saveUpdates(_0x51dc2b[_0xe1c6('0x49')],null))[_0xe1c6('0x25')](respondWithResult(_0xe2397b,null))['catch'](handleError(_0xe2397b,null));};exports['destroy']=function(_0x1c4703,_0x4fca7e){return db[_0xe1c6('0x2d')]['find']({'where':{'id':_0x1c4703[_0xe1c6('0x4a')]['id']}})[_0xe1c6('0x25')](handleEntityNotFound(_0x4fca7e,null))['then'](removeEntity(_0x4fca7e,null))['catch'](handleError(_0x4fca7e,null));};exports[_0xe1c6('0x4b')]=function(_0x4967f0,_0x2f205d,_0x2cd3bd){return db[_0xe1c6('0x4c')][_0xe1c6('0x46')]({'where':{'id':_0x4967f0[_0xe1c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f205d,null))[_0xe1c6('0x25')](function(_0x3d22c1){if(_0x3d22c1){return _0x3d22c1['addConditions'](_0x4967f0[_0xe1c6('0x49')][_0xe1c6('0x4d')],_[_0xe1c6('0x4e')](_0x4967f0[_0xe1c6('0x49')],[_0xe1c6('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x2f205d,null))[_0xe1c6('0x47')](handleError(_0x2f205d,null));};exports[_0xe1c6('0x4f')]=function(_0x125ac5,_0x36a6fa,_0x201382){var _0x1156c0={};var _0xa56aae={};var _0x568d93;var _0x28195b;return db[_0xe1c6('0x2d')]['findOne']({'where':{'id':_0x125ac5[_0xe1c6('0x4a')]['id']}})[_0xe1c6('0x25')](handleEntityNotFound(_0x36a6fa,null))['then'](function(_0x5b24e3){if(_0x5b24e3){_0x568d93=_0x5b24e3;_0xa56aae[_0xe1c6('0x32')]=_[_0xe1c6('0x34')](db[_0xe1c6('0x4c')]['rawAttributes']);_0xa56aae['query']=_[_0xe1c6('0x34')](_0x125ac5[_0xe1c6('0x33')]);_0xa56aae[_0xe1c6('0x35')]=_[_0xe1c6('0x36')](_0xa56aae[_0xe1c6('0x32')],_0xa56aae[_0xe1c6('0x33')]);_0x1156c0[_0xe1c6('0x37')]=_[_0xe1c6('0x36')](_0xa56aae['model'],qs['fields'](_0x125ac5[_0xe1c6('0x33')][_0xe1c6('0x38')]));_0x1156c0[_0xe1c6('0x37')]=_0x1156c0[_0xe1c6('0x37')][_0xe1c6('0x39')]?_0x1156c0['attributes']:_0xa56aae['model'];_0x1156c0[_0xe1c6('0x3c')]=qs[_0xe1c6('0x3d')](_0x125ac5['query']['sort']);_0x1156c0[_0xe1c6('0x41')]=qs[_0xe1c6('0x35')](_['pick'](_0x125ac5[_0xe1c6('0x33')],_0xa56aae[_0xe1c6('0x35')]));if(_0x125ac5['query'][_0xe1c6('0x3f')]){_0x1156c0[_0xe1c6('0x41')]=_[_0xe1c6('0x40')](_0x1156c0[_0xe1c6('0x41')],{'$or':_[_0xe1c6('0x2c')](_0x1156c0[_0xe1c6('0x37')],function(_0x55f055){var _0x430c5f={};_0x430c5f[_0x55f055]={'$like':'%'+_0x125ac5[_0xe1c6('0x33')][_0xe1c6('0x3f')]+'%'};return _0x430c5f;})});}_0x1156c0=_[_0xe1c6('0x40')]({},_0x1156c0,_0x125ac5[_0xe1c6('0x50')]);return _0x568d93[_0xe1c6('0x4f')](_0x1156c0);}})[_0xe1c6('0x25')](function(_0x2a9ebb){if(_0x2a9ebb){_0x28195b=_0x2a9ebb[_0xe1c6('0x39')];if(!_0x125ac5['query'][_0xe1c6('0x3a')]('nolimit')){_0x1156c0[_0xe1c6('0x1d')]=qs['limit'](_0x125ac5[_0xe1c6('0x33')][_0xe1c6('0x1d')]);_0x1156c0['offset']=qs[_0xe1c6('0x1c')](_0x125ac5[_0xe1c6('0x33')][_0xe1c6('0x1c')]);}return _0x568d93['getConditions'](_0x1156c0);}})[_0xe1c6('0x25')](function(_0x29c6ad){if(_0x29c6ad){return _0x29c6ad?{'count':_0x28195b,'rows':_0x29c6ad}:null;}})[_0xe1c6('0x25')](respondWithResult(_0x36a6fa,null))['catch'](handleError(_0x36a6fa,null));};exports[_0xe1c6('0x51')]=function(_0x5364c1,_0x58ab32,_0x8b5627){return db[_0xe1c6('0x52')][_0xe1c6('0x46')]({'where':{'id':_0x5364c1[_0xe1c6('0x4a')]['id']}})[_0xe1c6('0x25')](handleEntityNotFound(_0x58ab32,null))[_0xe1c6('0x25')](function(_0x4ed943){if(_0x4ed943){return _0x4ed943[_0xe1c6('0x51')](_0x5364c1[_0xe1c6('0x49')]['ids'],_[_0xe1c6('0x4e')](_0x5364c1['body'],[_0xe1c6('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x58ab32,null))[_0xe1c6('0x47')](handleError(_0x58ab32,null));};exports[_0xe1c6('0x53')]=function(_0x45ddd4,_0x52c8e6,_0xab3325){var _0x385b21={};var _0x281d7f={};var _0x489080;var _0x30b682;return db['Automation'][_0xe1c6('0x54')]({'where':{'id':_0x45ddd4[_0xe1c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52c8e6,null))[_0xe1c6('0x25')](function(_0x5581a7){if(_0x5581a7){_0x489080=_0x5581a7;_0x281d7f[_0xe1c6('0x32')]=_['keys'](db[_0xe1c6('0x52')][_0xe1c6('0x2e')]);_0x281d7f[_0xe1c6('0x33')]=_[_0xe1c6('0x34')](_0x45ddd4[_0xe1c6('0x33')]);_0x281d7f[_0xe1c6('0x35')]=_[_0xe1c6('0x36')](_0x281d7f[_0xe1c6('0x32')],_0x281d7f[_0xe1c6('0x33')]);_0x385b21['attributes']=_['intersection'](_0x281d7f[_0xe1c6('0x32')],qs[_0xe1c6('0x38')](_0x45ddd4[_0xe1c6('0x33')][_0xe1c6('0x38')]));_0x385b21[_0xe1c6('0x37')]=_0x385b21[_0xe1c6('0x37')][_0xe1c6('0x39')]?_0x385b21[_0xe1c6('0x37')]:_0x281d7f['model'];_0x385b21[_0xe1c6('0x3c')]=qs[_0xe1c6('0x3d')](_0x45ddd4[_0xe1c6('0x33')]['sort']);_0x385b21[_0xe1c6('0x41')]=qs[_0xe1c6('0x35')](_[_0xe1c6('0x3e')](_0x45ddd4[_0xe1c6('0x33')],_0x281d7f[_0xe1c6('0x35')]));if(_0x45ddd4['query']['filter']){_0x385b21[_0xe1c6('0x41')]=_['merge'](_0x385b21[_0xe1c6('0x41')],{'$or':_[_0xe1c6('0x2c')](_0x385b21[_0xe1c6('0x37')],function(_0x430bcd){var _0x7b8dc9={};_0x7b8dc9[_0x430bcd]={'$like':'%'+_0x45ddd4[_0xe1c6('0x33')][_0xe1c6('0x3f')]+'%'};return _0x7b8dc9;})});}_0x385b21=_[_0xe1c6('0x40')]({},_0x385b21,_0x45ddd4['options']);return _0x489080[_0xe1c6('0x53')](_0x385b21);}})[_0xe1c6('0x25')](function(_0xcdf557){if(_0xcdf557){_0x30b682=_0xcdf557[_0xe1c6('0x39')];if(!_0x45ddd4[_0xe1c6('0x33')][_0xe1c6('0x3a')]('nolimit')){_0x385b21[_0xe1c6('0x1d')]=qs[_0xe1c6('0x1d')](_0x45ddd4[_0xe1c6('0x33')][_0xe1c6('0x1d')]);_0x385b21[_0xe1c6('0x1c')]=qs['offset'](_0x45ddd4['query'][_0xe1c6('0x1c')]);}return _0x489080[_0xe1c6('0x53')](_0x385b21);}})[_0xe1c6('0x25')](function(_0x5374b3){if(_0x5374b3){return _0x5374b3?{'count':_0x30b682,'rows':_0x5374b3}:null;}})[_0xe1c6('0x25')](respondWithResult(_0x52c8e6,null))['catch'](handleError(_0x52c8e6,null));}; \ No newline at end of file +var _0xa0d1=['error','stack','send','map','rawAttributes','fieldName','type','key','name','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Automation','count','includeAll','include','findAll','rows','catch','params','filters','create','body','find','destroy','addConditions','ids','omit','findOne','Condition','getConditions','addActions','getActions','Action','hasOwnProperty','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','offset','undefined','limit','set','json','reject','save','then'];(function(_0x5f1297,_0x110b10){var _0x3c9295=function(_0xe95f1d){while(--_0xe95f1d){_0x5f1297['push'](_0x5f1297['shift']());}};_0x3c9295(++_0x110b10);}(_0xa0d1,0x7a));var _0x1a0d=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa0d1[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a0d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0d('0x1'));var moment=require(_0x1a0d('0x2'));var BPromise=require(_0x1a0d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a0d('0x4'));var sox=require(_0x1a0d('0x5'));var csv=require(_0x1a0d('0x6'));var ejs=require(_0x1a0d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a0d('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1a0d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1a0d('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x1a0d('0xa'));var as=require(_0x1a0d('0xb'));var hardwareService=require(_0x1a0d('0xc'));var logger=require(_0x1a0d('0xd'))('api');var utils=require(_0x1a0d('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x414297,_0x4d701e){_0x4d701e=_0x4d701e||0xcc;return function(_0x396b84){if(_0x396b84){return _0x414297[_0x1a0d('0xf')](_0x4d701e);}return _0x414297[_0x1a0d('0x10')](_0x4d701e)[_0x1a0d('0x11')]();};}function respondWithResult(_0x3cebad,_0x57f2bd){_0x57f2bd=_0x57f2bd||0xc8;return function(_0x2d6743){if(_0x2d6743){return _0x3cebad[_0x1a0d('0x10')](_0x57f2bd)['json'](_0x2d6743);}};}function respondWithFilteredResult(_0x4387ae,_0x463a89){return function(_0xb9749f){if(_0xb9749f){var _0x4e064e=typeof _0x463a89[_0x1a0d('0x12')]===_0x1a0d('0x13')&&typeof _0x463a89[_0x1a0d('0x14')]===_0x1a0d('0x13');var _0x22b5a1=_0xb9749f['count'];var _0x588700=_0x4e064e?0x0:_0x463a89[_0x1a0d('0x12')];var _0x56dfdd=_0x4e064e?_0xb9749f['count']:_0x463a89[_0x1a0d('0x12')]+_0x463a89[_0x1a0d('0x14')];var _0x55798d;if(_0x56dfdd>=_0x22b5a1){_0x56dfdd=_0x22b5a1;_0x55798d=0xc8;}else{_0x55798d=0xce;}_0x4387ae[_0x1a0d('0x10')](_0x55798d);return _0x4387ae[_0x1a0d('0x15')]('Content-Range',_0x588700+'-'+_0x56dfdd+'/'+_0x22b5a1)[_0x1a0d('0x16')](_0xb9749f);}return null;};}function patchUpdates(_0x4bb126){return function(_0x1e7157){try{jsonpatch['apply'](_0x1e7157,_0x4bb126,!![]);}catch(_0x6007f){return BPromise[_0x1a0d('0x17')](_0x6007f);}return _0x1e7157[_0x1a0d('0x18')]();};}function saveUpdates(_0x5440b1,_0x908e2c){return function(_0x212a78){if(_0x212a78){return _0x212a78['update'](_0x5440b1)[_0x1a0d('0x19')](function(_0x371240){return _0x371240;});}return null;};}function removeEntity(_0x1833ff,_0x3c15d5){return function(_0x46beb5){if(_0x46beb5){return _0x46beb5['destroy']()[_0x1a0d('0x19')](function(){_0x1833ff[_0x1a0d('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17425c,_0x4600f0){return function(_0xec72c8){if(!_0xec72c8){_0x17425c[_0x1a0d('0xf')](0x194);}return _0xec72c8;};}function handleError(_0x142c11,_0x473eb7){_0x473eb7=_0x473eb7||0x1f4;return function(_0x22adb1){logger[_0x1a0d('0x1a')](_0x22adb1[_0x1a0d('0x1b')]);if(_0x22adb1['name']){delete _0x22adb1['name'];}_0x142c11[_0x1a0d('0x10')](_0x473eb7)[_0x1a0d('0x1c')](_0x22adb1);};}exports['index']=function(_0x31d3d3,_0x3caa09){var _0x302d2d={},_0x8f48d1={},_0x5ca6ad={'count':0x0,'rows':[]};var _0x28fdc1=_[_0x1a0d('0x1d')](db['Automation'][_0x1a0d('0x1e')],function(_0xc38c68){return{'name':_0xc38c68[_0x1a0d('0x1f')],'type':_0xc38c68[_0x1a0d('0x20')][_0x1a0d('0x21')]};});_0x8f48d1['model']=_[_0x1a0d('0x1d')](_0x28fdc1,_0x1a0d('0x22'));_0x8f48d1[_0x1a0d('0x23')]=_[_0x1a0d('0x24')](_0x31d3d3[_0x1a0d('0x23')]);_0x8f48d1['filters']=_[_0x1a0d('0x25')](_0x8f48d1['model'],_0x8f48d1[_0x1a0d('0x23')]);_0x302d2d[_0x1a0d('0x26')]=_['intersection'](_0x8f48d1[_0x1a0d('0x27')],qs[_0x1a0d('0x28')](_0x31d3d3[_0x1a0d('0x23')]['fields']));_0x302d2d['attributes']=_0x302d2d[_0x1a0d('0x26')][_0x1a0d('0x29')]?_0x302d2d[_0x1a0d('0x26')]:_0x8f48d1[_0x1a0d('0x27')];if(!_0x31d3d3[_0x1a0d('0x23')]['hasOwnProperty'](_0x1a0d('0x2a'))){_0x302d2d[_0x1a0d('0x14')]=qs[_0x1a0d('0x14')](_0x31d3d3['query'][_0x1a0d('0x14')]);_0x302d2d[_0x1a0d('0x12')]=qs[_0x1a0d('0x12')](_0x31d3d3[_0x1a0d('0x23')]['offset']);}_0x302d2d[_0x1a0d('0x2b')]=qs['sort'](_0x31d3d3[_0x1a0d('0x23')][_0x1a0d('0x2c')]);_0x302d2d[_0x1a0d('0x2d')]=qs['filters'](_[_0x1a0d('0x2e')](_0x31d3d3[_0x1a0d('0x23')],_0x8f48d1['filters']),_0x28fdc1);if(_0x31d3d3[_0x1a0d('0x23')][_0x1a0d('0x2f')]){_0x302d2d[_0x1a0d('0x2d')]=_['merge'](_0x302d2d['where'],{'$or':_[_0x1a0d('0x1d')](_0x28fdc1,function(_0x4cf307){if(_0x4cf307['type']!==_0x1a0d('0x30')){var _0x4bfd15={};_0x4bfd15[_0x4cf307['name']]={'$like':'%'+_0x31d3d3['query']['filter']+'%'};return _0x4bfd15;}})});}_0x302d2d=_[_0x1a0d('0x31')]({},_0x302d2d,_0x31d3d3[_0x1a0d('0x32')]);var _0x2524e0={'where':_0x302d2d['where']};return db[_0x1a0d('0x33')][_0x1a0d('0x34')](_0x2524e0)[_0x1a0d('0x19')](function(_0x2e755b){_0x5ca6ad[_0x1a0d('0x34')]=_0x2e755b;if(_0x31d3d3[_0x1a0d('0x23')][_0x1a0d('0x35')]){_0x302d2d[_0x1a0d('0x36')]=[{'all':!![]}];}return db[_0x1a0d('0x33')][_0x1a0d('0x37')](_0x302d2d);})['then'](function(_0x4dd2c3){_0x5ca6ad[_0x1a0d('0x38')]=_0x4dd2c3;return _0x5ca6ad;})[_0x1a0d('0x19')](respondWithFilteredResult(_0x3caa09,_0x302d2d))[_0x1a0d('0x39')](handleError(_0x3caa09,null));};exports['show']=function(_0x25ae1f,_0x5d9769){var _0x1395a5={'raw':![],'where':{'id':_0x25ae1f[_0x1a0d('0x3a')]['id']}},_0x385775={};_0x385775['model']=_[_0x1a0d('0x24')](db[_0x1a0d('0x33')]['rawAttributes']);_0x385775[_0x1a0d('0x23')]=_['keys'](_0x25ae1f[_0x1a0d('0x23')]);_0x385775[_0x1a0d('0x3b')]=_['intersection'](_0x385775[_0x1a0d('0x27')],_0x385775[_0x1a0d('0x23')]);_0x1395a5['attributes']=_[_0x1a0d('0x25')](_0x385775['model'],qs[_0x1a0d('0x28')](_0x25ae1f[_0x1a0d('0x23')]['fields']));_0x1395a5[_0x1a0d('0x26')]=_0x1395a5['attributes'][_0x1a0d('0x29')]?_0x1395a5[_0x1a0d('0x26')]:_0x385775[_0x1a0d('0x27')];if(_0x25ae1f['query'][_0x1a0d('0x35')]){_0x1395a5[_0x1a0d('0x36')]=[{'all':!![]}];}_0x1395a5=_[_0x1a0d('0x31')]({},_0x1395a5,_0x25ae1f[_0x1a0d('0x32')]);return db[_0x1a0d('0x33')]['find'](_0x1395a5)[_0x1a0d('0x19')](handleEntityNotFound(_0x5d9769,null))[_0x1a0d('0x19')](respondWithResult(_0x5d9769,null))['catch'](handleError(_0x5d9769,null));};exports[_0x1a0d('0x3c')]=function(_0x1a82b0,_0x27ad3d){return db['Automation']['create'](_0x1a82b0[_0x1a0d('0x3d')],{})[_0x1a0d('0x19')](respondWithResult(_0x27ad3d,0xc9))[_0x1a0d('0x39')](handleError(_0x27ad3d,null));};exports['update']=function(_0x4360a7,_0x1fe542){if(_0x4360a7['body']['id']){delete _0x4360a7['body']['id'];}return db[_0x1a0d('0x33')][_0x1a0d('0x3e')]({'where':{'id':_0x4360a7[_0x1a0d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1fe542,null))[_0x1a0d('0x19')](saveUpdates(_0x4360a7[_0x1a0d('0x3d')],null))[_0x1a0d('0x19')](respondWithResult(_0x1fe542,null))['catch'](handleError(_0x1fe542,null));};exports[_0x1a0d('0x3f')]=function(_0x20603e,_0x43e488){return db[_0x1a0d('0x33')][_0x1a0d('0x3e')]({'where':{'id':_0x20603e[_0x1a0d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x43e488,null))[_0x1a0d('0x19')](removeEntity(_0x43e488,null))[_0x1a0d('0x39')](handleError(_0x43e488,null));};exports[_0x1a0d('0x40')]=function(_0x55eb93,_0x1cba84,_0x4d8a30){return db['Condition']['find']({'where':{'id':_0x55eb93['params']['id']}})['then'](handleEntityNotFound(_0x1cba84,null))[_0x1a0d('0x19')](function(_0xc1f712){if(_0xc1f712){return _0xc1f712['addConditions'](_0x55eb93['body'][_0x1a0d('0x41')],_[_0x1a0d('0x42')](_0x55eb93[_0x1a0d('0x3d')],['ids','id'])||{});}})['then'](respondWithResult(_0x1cba84,null))[_0x1a0d('0x39')](handleError(_0x1cba84,null));};exports['getConditions']=function(_0x51bbe6,_0x4ce1b4,_0x1efb5a){var _0x468ef1={};var _0x5a0e12={};var _0x15c991;var _0x41eb9e;return db[_0x1a0d('0x33')][_0x1a0d('0x43')]({'where':{'id':_0x51bbe6[_0x1a0d('0x3a')]['id']}})[_0x1a0d('0x19')](handleEntityNotFound(_0x4ce1b4,null))[_0x1a0d('0x19')](function(_0x43b179){if(_0x43b179){_0x15c991=_0x43b179;_0x5a0e12[_0x1a0d('0x27')]=_['keys'](db[_0x1a0d('0x44')][_0x1a0d('0x1e')]);_0x5a0e12[_0x1a0d('0x23')]=_[_0x1a0d('0x24')](_0x51bbe6[_0x1a0d('0x23')]);_0x5a0e12[_0x1a0d('0x3b')]=_['intersection'](_0x5a0e12['model'],_0x5a0e12['query']);_0x468ef1[_0x1a0d('0x26')]=_['intersection'](_0x5a0e12[_0x1a0d('0x27')],qs[_0x1a0d('0x28')](_0x51bbe6[_0x1a0d('0x23')]['fields']));_0x468ef1[_0x1a0d('0x26')]=_0x468ef1['attributes'][_0x1a0d('0x29')]?_0x468ef1[_0x1a0d('0x26')]:_0x5a0e12['model'];_0x468ef1[_0x1a0d('0x2b')]=qs[_0x1a0d('0x2c')](_0x51bbe6[_0x1a0d('0x23')][_0x1a0d('0x2c')]);_0x468ef1[_0x1a0d('0x2d')]=qs['filters'](_[_0x1a0d('0x2e')](_0x51bbe6[_0x1a0d('0x23')],_0x5a0e12[_0x1a0d('0x3b')]));if(_0x51bbe6[_0x1a0d('0x23')][_0x1a0d('0x2f')]){_0x468ef1[_0x1a0d('0x2d')]=_[_0x1a0d('0x31')](_0x468ef1[_0x1a0d('0x2d')],{'$or':_[_0x1a0d('0x1d')](_0x468ef1[_0x1a0d('0x26')],function(_0x10d1d7){var _0x5bca04={};_0x5bca04[_0x10d1d7]={'$like':'%'+_0x51bbe6[_0x1a0d('0x23')][_0x1a0d('0x2f')]+'%'};return _0x5bca04;})});}_0x468ef1=_[_0x1a0d('0x31')]({},_0x468ef1,_0x51bbe6[_0x1a0d('0x32')]);return _0x15c991[_0x1a0d('0x45')](_0x468ef1);}})[_0x1a0d('0x19')](function(_0x4a2fd1){if(_0x4a2fd1){_0x41eb9e=_0x4a2fd1['length'];if(!_0x51bbe6[_0x1a0d('0x23')]['hasOwnProperty']('nolimit')){_0x468ef1[_0x1a0d('0x14')]=qs['limit'](_0x51bbe6[_0x1a0d('0x23')]['limit']);_0x468ef1[_0x1a0d('0x12')]=qs[_0x1a0d('0x12')](_0x51bbe6[_0x1a0d('0x23')][_0x1a0d('0x12')]);}return _0x15c991[_0x1a0d('0x45')](_0x468ef1);}})[_0x1a0d('0x19')](function(_0x351a86){if(_0x351a86){return _0x351a86?{'count':_0x41eb9e,'rows':_0x351a86}:null;}})[_0x1a0d('0x19')](respondWithResult(_0x4ce1b4,null))[_0x1a0d('0x39')](handleError(_0x4ce1b4,null));};exports[_0x1a0d('0x46')]=function(_0x21e388,_0x5aab56,_0x5f50a9){return db['Action'][_0x1a0d('0x3e')]({'where':{'id':_0x21e388[_0x1a0d('0x3a')]['id']}})[_0x1a0d('0x19')](handleEntityNotFound(_0x5aab56,null))[_0x1a0d('0x19')](function(_0x325612){if(_0x325612){return _0x325612[_0x1a0d('0x46')](_0x21e388[_0x1a0d('0x3d')][_0x1a0d('0x41')],_[_0x1a0d('0x42')](_0x21e388[_0x1a0d('0x3d')],[_0x1a0d('0x41'),'id'])||{});}})[_0x1a0d('0x19')](respondWithResult(_0x5aab56,null))[_0x1a0d('0x39')](handleError(_0x5aab56,null));};exports[_0x1a0d('0x47')]=function(_0x5dfdce,_0x3b6d2e,_0x38b904){var _0x36a5fc={};var _0x4c0df5={};var _0x2d30eb;var _0x25c1f3;return db[_0x1a0d('0x33')][_0x1a0d('0x43')]({'where':{'id':_0x5dfdce['params']['id']}})[_0x1a0d('0x19')](handleEntityNotFound(_0x3b6d2e,null))[_0x1a0d('0x19')](function(_0x2acaea){if(_0x2acaea){_0x2d30eb=_0x2acaea;_0x4c0df5[_0x1a0d('0x27')]=_[_0x1a0d('0x24')](db[_0x1a0d('0x48')][_0x1a0d('0x1e')]);_0x4c0df5[_0x1a0d('0x23')]=_['keys'](_0x5dfdce[_0x1a0d('0x23')]);_0x4c0df5[_0x1a0d('0x3b')]=_[_0x1a0d('0x25')](_0x4c0df5[_0x1a0d('0x27')],_0x4c0df5[_0x1a0d('0x23')]);_0x36a5fc[_0x1a0d('0x26')]=_['intersection'](_0x4c0df5[_0x1a0d('0x27')],qs['fields'](_0x5dfdce[_0x1a0d('0x23')][_0x1a0d('0x28')]));_0x36a5fc[_0x1a0d('0x26')]=_0x36a5fc[_0x1a0d('0x26')]['length']?_0x36a5fc[_0x1a0d('0x26')]:_0x4c0df5['model'];_0x36a5fc[_0x1a0d('0x2b')]=qs[_0x1a0d('0x2c')](_0x5dfdce['query'][_0x1a0d('0x2c')]);_0x36a5fc[_0x1a0d('0x2d')]=qs[_0x1a0d('0x3b')](_['pick'](_0x5dfdce['query'],_0x4c0df5[_0x1a0d('0x3b')]));if(_0x5dfdce[_0x1a0d('0x23')]['filter']){_0x36a5fc[_0x1a0d('0x2d')]=_['merge'](_0x36a5fc[_0x1a0d('0x2d')],{'$or':_[_0x1a0d('0x1d')](_0x36a5fc['attributes'],function(_0x5447a1){var _0xd6df3d={};_0xd6df3d[_0x5447a1]={'$like':'%'+_0x5dfdce[_0x1a0d('0x23')][_0x1a0d('0x2f')]+'%'};return _0xd6df3d;})});}_0x36a5fc=_[_0x1a0d('0x31')]({},_0x36a5fc,_0x5dfdce[_0x1a0d('0x32')]);return _0x2d30eb['getActions'](_0x36a5fc);}})[_0x1a0d('0x19')](function(_0x327a72){if(_0x327a72){_0x25c1f3=_0x327a72[_0x1a0d('0x29')];if(!_0x5dfdce[_0x1a0d('0x23')][_0x1a0d('0x49')](_0x1a0d('0x2a'))){_0x36a5fc[_0x1a0d('0x14')]=qs[_0x1a0d('0x14')](_0x5dfdce[_0x1a0d('0x23')][_0x1a0d('0x14')]);_0x36a5fc[_0x1a0d('0x12')]=qs[_0x1a0d('0x12')](_0x5dfdce[_0x1a0d('0x23')][_0x1a0d('0x12')]);}return _0x2d30eb[_0x1a0d('0x47')](_0x36a5fc);}})[_0x1a0d('0x19')](function(_0x6893ec){if(_0x6893ec){return _0x6893ec?{'count':_0x25c1f3,'rows':_0x6893ec}:null;}})['then'](respondWithResult(_0x3b6d2e,null))[_0x1a0d('0x39')](handleError(_0x3b6d2e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 293569b..d640178 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 _0x3501=['exports','define','Automation','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0x3501,0xc1));var _0x1350=function(_0x506cbf,_0xb7e1d8){_0x506cbf=_0x506cbf-0x0;var _0x5513f1=_0x3501[_0x506cbf];return _0x5513f1;};'use strict';var _=require(_0x1350('0x0'));var util=require(_0x1350('0x1'));var logger=require(_0x1350('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1350('0x3'));var fs=require('fs');var path=require(_0x1350('0x4'));var rimraf=require(_0x1350('0x5'));var config=require(_0x1350('0x6'));var attributes=require('./automation.attributes');module[_0x1350('0x7')]=function(_0x598cd3,_0x45f5eb){return _0x598cd3[_0x1350('0x8')](_0x1350('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb99=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x551405,_0xef90c){var _0x37c3fe=function(_0x2e2814){while(--_0x2e2814){_0x551405['push'](_0x551405['shift']());}};_0x37c3fe(++_0xef90c);}(_0xfb99,0x15f));var _0x9fb9=function(_0x9a8838,_0x163c4b){_0x9a8838=_0x9a8838-0x0;var _0x277d69=_0xfb99[_0x9a8838];return _0x277d69;};'use strict';var _=require(_0x9fb9('0x0'));var util=require(_0x9fb9('0x1'));var logger=require(_0x9fb9('0x2'))(_0x9fb9('0x3'));var moment=require(_0x9fb9('0x4'));var BPromise=require(_0x9fb9('0x5'));var rp=require(_0x9fb9('0x6'));var fs=require('fs');var path=require(_0x9fb9('0x7'));var rimraf=require('rimraf');var config=require(_0x9fb9('0x8'));var attributes=require(_0x9fb9('0x9'));module[_0x9fb9('0xa')]=function(_0xe0f498,_0x8cea59){return _0xe0f498['define'](_0x9fb9('0xb'),attributes,{'tableName':_0x9fb9('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 7361666..eed6850 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x326a44,_0x41c393){var _0x218e10=function(_0x4ef0a6){while(--_0x4ef0a6){_0x326a44['push'](_0x326a44['shift']());}};_0x218e10(++_0x41c393);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x6e1277,_0x470849){_0x6e1277=_0x6e1277-0x0;var _0x193cd1=_0xcf2f[_0x6e1277];return _0x193cd1;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});} \ No newline at end of file +var _0x5458=['rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3d0fa1,_0xd57cd6){var _0x4660bc=function(_0x5358ac){while(--_0x5358ac){_0x3d0fa1['push'](_0x3d0fa1['shift']());}};_0x4660bc(++_0xd57cd6);}(_0x5458,0x1c7));var _0x8545=function(_0x71204b,_0x352ee3){_0x71204b=_0x71204b-0x0;var _0x24d44c=_0x5458[_0x71204b];return _0x24d44c;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require(_0x8545('0x6'))(_0x8545('0x7'));var config=require('../../config/environment');var jayson=require(_0x8545('0x8'));var client=jayson[_0x8545('0x9')][_0x8545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359d01,_0x5062c7,_0x291bc9){return new BPromise(function(_0x507ed8,_0x2cc4f4){return client[_0x8545('0xb')](_0x359d01,_0x291bc9)[_0x8545('0xc')](function(_0x10931d){logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));logger[_0x8545('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x5062c7,_0x8545('0xf'),JSON[_0x8545('0x11')](_0x10931d));if(_0x10931d[_0x8545('0x12')]){if(_0x10931d['error'][_0x8545('0x13')]===0x1f4){logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);return _0x2cc4f4(_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);}logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d['error'][_0x8545('0x14')]);return _0x507ed8(_0x10931d[_0x8545('0x12')]['message']);}else{logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));_0x507ed8(_0x10931d['result'][_0x8545('0x14')]);}})[_0x8545('0x15')](function(_0x3374f7){logger['error']('Automation,\x20%s,\x20%s',_0x5062c7,_0x3374f7);_0x2cc4f4(_0x3374f7);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 88c8cca..ae40e07 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 _0xfafb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','multer'];(function(_0x3d49ab,_0x2e0e1c){var _0x3dd63f=function(_0x1152d1){while(--_0x1152d1){_0x3d49ab['push'](_0x3d49ab['shift']());}};_0x3dd63f(++_0x2e0e1c);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbfaf('0x0'));var util=require('util');var path=require(_0xbfaf('0x1'));var timeout=require(_0xbfaf('0x2'));var express=require(_0xbfaf('0x3'));var router=express[_0xbfaf('0x4')]();var fs_extra=require(_0xbfaf('0x5'));var auth=require(_0xbfaf('0x6'));var interaction=require(_0xbfaf('0x7'));var config=require(_0xbfaf('0x8'));var controller=require(_0xbfaf('0x9'));router[_0xbfaf('0xa')]('/',auth[_0xbfaf('0xb')](),controller['index']);router[_0xbfaf('0xa')]('/:id',auth[_0xbfaf('0xb')](),controller[_0xbfaf('0xc')]);router[_0xbfaf('0xa')](_0xbfaf('0xd'),auth[_0xbfaf('0xb')](),controller[_0xbfaf('0xe')]);router['get'](_0xbfaf('0xf'),auth['isAuthenticated'](),controller[_0xbfaf('0x10')]);router['post']('/',auth[_0xbfaf('0xb')](),controller[_0xbfaf('0x11')]);router[_0xbfaf('0x12')](_0xbfaf('0xd'),auth[_0xbfaf('0xb')](),controller[_0xbfaf('0x13')]);router[_0xbfaf('0x12')](_0xbfaf('0xf'),auth['isAuthenticated'](),controller[_0xbfaf('0x14')]);router[_0xbfaf('0x15')](_0xbfaf('0x16'),auth[_0xbfaf('0xb')](),controller[_0xbfaf('0x17')]);router[_0xbfaf('0x18')](_0xbfaf('0x16'),auth[_0xbfaf('0xb')](),controller[_0xbfaf('0x19')]);module[_0xbfaf('0x1a')]=router; \ No newline at end of file +var _0x8bda=['express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','post','addConditions','addActions','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3c838c,_0x29ad40){var _0x58605a=function(_0x5a8361){while(--_0x5a8361){_0x3c838c['push'](_0x3c838c['shift']());}};_0x58605a(++_0x29ad40);}(_0x8bda,0x104));var _0xa8bd=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x8bda[_0x10f68e];return _0x4c8372;};'use strict';var multer=require(_0xa8bd('0x0'));var util=require(_0xa8bd('0x1'));var path=require(_0xa8bd('0x2'));var timeout=require(_0xa8bd('0x3'));var express=require(_0xa8bd('0x4'));var router=express[_0xa8bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa8bd('0x6'));var interaction=require(_0xa8bd('0x7'));var config=require('../../config/environment');var controller=require(_0xa8bd('0x8'));router['get']('/',auth[_0xa8bd('0x9')](),controller[_0xa8bd('0xa')]);router['get'](_0xa8bd('0xb'),auth[_0xa8bd('0x9')](),controller[_0xa8bd('0xc')]);router[_0xa8bd('0xd')](_0xa8bd('0xe'),auth['isAuthenticated'](),controller[_0xa8bd('0xf')]);router[_0xa8bd('0xd')](_0xa8bd('0x10'),auth[_0xa8bd('0x9')](),controller['getActions']);router[_0xa8bd('0x11')]('/',auth[_0xa8bd('0x9')](),controller['create']);router[_0xa8bd('0x11')](_0xa8bd('0xe'),auth[_0xa8bd('0x9')](),controller[_0xa8bd('0x12')]);router[_0xa8bd('0x11')](_0xa8bd('0x10'),auth[_0xa8bd('0x9')](),controller[_0xa8bd('0x13')]);router[_0xa8bd('0x14')](_0xa8bd('0xb'),auth[_0xa8bd('0x9')](),controller[_0xa8bd('0x15')]);router[_0xa8bd('0x16')](_0xa8bd('0xb'),auth[_0xa8bd('0x9')](),controller['destroy']);module[_0xa8bd('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cfb0e20..e3a4e00 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 _0x7b1c=['#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\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)','ENUM','always','never','Active/Disactive\x20AMD'];(function(_0x208c57,_0x40db45){var _0x287671=function(_0x51c9b9){while(--_0x51c9b9){_0x208c57['push'](_0x208c57['shift']());}};_0x287671(++_0x40db45);}(_0x7b1c,0x78));var _0xc7b1=function(_0x4e6a6b,_0x2a3de1){_0x4e6a6b=_0x4e6a6b-0x0;var _0x4924da=_0x7b1c[_0x4e6a6b];return _0x4924da;};'use strict';var Sequelize=require(_0xc7b1('0x0'));module[_0xc7b1('0x1')]={'name':{'type':Sequelize[_0xc7b1('0x2')],'unique':_0xc7b1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xc7b1('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xc7b1('0x2')]},'active':{'type':Sequelize[_0xc7b1('0x5')],'defaultValue':0x0,'comment':_0xc7b1('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc7b1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc7b1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc7b1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc7b1('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc7b1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc7b1('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc7b1('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'comment':_0xc7b1('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc7b1('0xf')},'dialTimezone':{'type':Sequelize[_0xc7b1('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc7b1('0x10')](_0xc7b1('0x11'),_0xc7b1('0x12'),'onlyIfOpen'),'defaultValue':_0xc7b1('0x11')},'dialAMDActive':{'type':Sequelize[_0xc7b1('0x5')],'defaultValue':0x0,'comment':_0xc7b1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc7b1('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc7b1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc7b1('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc7b1('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc7b1('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc7b1('0xa')](0x9)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc7b1('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc7b1('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc7b1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc7b1('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xc7b1('0x1a')},'dialPrefix':{'type':Sequelize[_0xc7b1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc7b1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc7b1('0x1b')},'dialCutDigit':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc7b1('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc7b1('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc7b1('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc7b1('0xa')](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc7b1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc7b1('0xa')](0x5)[_0xc7b1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc7b1('0x22')}}; \ No newline at end of file +var _0x1c72=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','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)','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','STRING','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER'];(function(_0x4c9bab,_0x1fe01f){var _0x3ff8da=function(_0x462124){while(--_0x462124){_0x4c9bab['push'](_0x4c9bab['shift']());}};_0x3ff8da(++_0x1fe01f);}(_0x1c72,0xca));var _0x21c7=function(_0x353562,_0x19c137){_0x353562=_0x353562-0x0;var _0x2d0320=_0x1c72[_0x353562];return _0x2d0320;};'use strict';var Sequelize=require(_0x21c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x21c7('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x21c7('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x21c7('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x21c7('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x21c7('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x21c7('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x21c7('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x21c7('0x7')](0x3)[_0x21c7('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21c7('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x21c7('0x7')](0x5)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21c7('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x21c7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x21c7('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x21c7('0xe')},'dialTimezone':{'type':Sequelize[_0x21c7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x21c7('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x21c7('0xf'),_0x21c7('0x10'),_0x21c7('0x11')),'defaultValue':_0x21c7('0xf')},'dialAMDActive':{'type':Sequelize[_0x21c7('0x4')],'defaultValue':0x0,'comment':_0x21c7('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x21c7('0x7')](0x9)[_0x21c7('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x21c7('0x7')](0x9)[_0x21c7('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x21c7('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x21c7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x21c7('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x21c7('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x21c7('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x21c7('0x7')](0x9)[_0x21c7('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x21c7('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x21c7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x21c7('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x21c7('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x21c7('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x21c7('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x21c7('0x2')](_0x21c7('0x1a'),'ASC'),'defaultValue':_0x21c7('0x1a')},'dialPrefix':{'type':Sequelize[_0x21c7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x21c7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x21c7('0x1b')},'dialCutDigit':{'type':Sequelize[_0x21c7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x21c7('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x21c7('0x7')](0x5)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x21c7('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x21c7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x21c7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x21c7('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x21c7('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x21c7('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x21c7('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 3b7df8b..798ad4f 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 _0x3f9b=['spread','removeBlackLists','zip-dir','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','Campaign','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','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','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','nolimit','order','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','toString','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','cm_hopper','insert','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x286e6f,_0x5d917a){var _0x3c1f2a=function(_0x1eb5d1){while(--_0x1eb5d1){_0x286e6f['push'](_0x286e6f['shift']());}};_0x3c1f2a(++_0x5d917a);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x2d9867,_0x450202){_0x2d9867=_0x2d9867-0x0;var _0x144613=_0x3f9b[_0x2d9867];return _0x144613;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb3f9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3f9('0x1'));var moment=require(_0xb3f9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb3f9('0x3'));var sox=require(_0xb3f9('0x4'));var csv=require(_0xb3f9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3f9('0x6'));var _=require(_0xb3f9('0x7'));var squel=require(_0xb3f9('0x8'));var crypto=require(_0xb3f9('0x9'));var jsforce=require(_0xb3f9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3f9('0xb'));var Papa=require(_0xb3f9('0xc'));var Redis=require('ioredis');var authService=require(_0xb3f9('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3f9('0xe'));var logger=require(_0xb3f9('0xf'))(_0xb3f9('0x10'));var utils=require(_0xb3f9('0x11'));var config=require(_0xb3f9('0x12'));var licenseUtil=require(_0xb3f9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cdce2,_0xbbc1cb){_0xbbc1cb=_0xbbc1cb||0xcc;return function(_0x395561){if(_0x395561){return _0x1cdce2[_0xb3f9('0x14')](_0xbbc1cb);}return _0x1cdce2[_0xb3f9('0x15')](_0xbbc1cb)[_0xb3f9('0x16')]();};}function respondWithResult(_0x36c56c,_0x67f3ee){_0x67f3ee=_0x67f3ee||0xc8;return function(_0x590d44){if(_0x590d44){return _0x36c56c[_0xb3f9('0x15')](_0x67f3ee)['json'](_0x590d44);}};}function respondWithFilteredResult(_0x55256c,_0x214c4b){return function(_0x86b55c){if(_0x86b55c){var _0x171378=typeof _0x214c4b[_0xb3f9('0x17')]===_0xb3f9('0x18')&&typeof _0x214c4b[_0xb3f9('0x19')]===_0xb3f9('0x18');var _0x3f89e5=_0x86b55c['count'];var _0x2c69d4=_0x171378?0x0:_0x214c4b['offset'];var _0x5e7e42=_0x171378?_0x86b55c[_0xb3f9('0x1a')]:_0x214c4b['offset']+_0x214c4b[_0xb3f9('0x19')];var _0x33cf23;if(_0x5e7e42>=_0x3f89e5){_0x5e7e42=_0x3f89e5;_0x33cf23=0xc8;}else{_0x33cf23=0xce;}_0x55256c[_0xb3f9('0x15')](_0x33cf23);return _0x55256c[_0xb3f9('0x1b')](_0xb3f9('0x1c'),_0x2c69d4+'-'+_0x5e7e42+'/'+_0x3f89e5)[_0xb3f9('0x1d')](_0x86b55c);}return null;};}function patchUpdates(_0x4b7da0){return function(_0x51b607){try{jsonpatch['apply'](_0x51b607,_0x4b7da0,!![]);}catch(_0xb17d2e){return BPromise[_0xb3f9('0x1e')](_0xb17d2e);}return _0x51b607[_0xb3f9('0x1f')]();};}function saveUpdates(_0x4bffc7,_0x53f664){return function(_0x3446ea){if(_0x3446ea){return _0x3446ea[_0xb3f9('0x20')](_0x4bffc7)[_0xb3f9('0x21')](function(_0x560077){return _0x560077;});}return null;};}function removeEntity(_0x3b8738,_0x503ba7){return function(_0x20e804){if(_0x20e804){return _0x20e804[_0xb3f9('0x22')]()[_0xb3f9('0x21')](function(){var _0x539f7a=_0x20e804[_0xb3f9('0x23')]({'plain':!![]});var _0x1ffd67=_0xb3f9('0x24');return db['UserProfileResource'][_0xb3f9('0x22')]({'where':{'type':_0x1ffd67,'resourceId':_0x539f7a['id']}})[_0xb3f9('0x21')](function(){return _0x20e804;});})['then'](function(){_0x3b8738[_0xb3f9('0x15')](0xcc)[_0xb3f9('0x16')]();});}};}function handleEntityNotFound(_0x138f3d,_0x2bcb3e){return function(_0x1f65df){if(!_0x1f65df){_0x138f3d['sendStatus'](0x194);}return _0x1f65df;};}function handleError(_0x73d0a3,_0x35912b){_0x35912b=_0x35912b||0x1f4;return function(_0x2939f8){logger[_0xb3f9('0x25')](_0x2939f8[_0xb3f9('0x26')]);if(_0x2939f8[_0xb3f9('0x27')]){delete _0x2939f8[_0xb3f9('0x27')];}_0x73d0a3[_0xb3f9('0x15')](_0x35912b)[_0xb3f9('0x28')](_0x2939f8);};}exports[_0xb3f9('0x29')]=function(_0x2752c5,_0xacbe01){var _0x3e990d={},_0x564977={},_0x5d7762={'count':0x0,'rows':[]};var _0x4ccacb=_[_0xb3f9('0x2a')](db['Campaign']['rawAttributes'],function(_0x5c810c){return{'name':_0x5c810c[_0xb3f9('0x2b')],'type':_0x5c810c[_0xb3f9('0x2c')]['key']};});_0x564977[_0xb3f9('0x2d')]=_[_0xb3f9('0x2a')](_0x4ccacb,_0xb3f9('0x27'));_0x564977['query']=_['keys'](_0x2752c5[_0xb3f9('0x2e')]);_0x564977['filters']=_[_0xb3f9('0x2f')](_0x564977[_0xb3f9('0x2d')],_0x564977[_0xb3f9('0x2e')]);_0x3e990d['attributes']=_[_0xb3f9('0x2f')](_0x564977[_0xb3f9('0x2d')],qs[_0xb3f9('0x30')](_0x2752c5['query'][_0xb3f9('0x30')]));_0x3e990d[_0xb3f9('0x31')]=_0x3e990d['attributes'][_0xb3f9('0x32')]?_0x3e990d['attributes']:_0x564977['model'];if(!_0x2752c5[_0xb3f9('0x2e')][_0xb3f9('0x33')]('nolimit')){_0x3e990d['limit']=qs[_0xb3f9('0x19')](_0x2752c5['query'][_0xb3f9('0x19')]);_0x3e990d[_0xb3f9('0x17')]=qs[_0xb3f9('0x17')](_0x2752c5[_0xb3f9('0x2e')]['offset']);}_0x3e990d['order']=qs[_0xb3f9('0x34')](_0x2752c5['query'][_0xb3f9('0x34')]);_0x3e990d['where']=qs[_0xb3f9('0x35')](_[_0xb3f9('0x36')](_0x2752c5[_0xb3f9('0x2e')],_0x564977[_0xb3f9('0x35')]),_0x4ccacb);if(_0x2752c5[_0xb3f9('0x2e')][_0xb3f9('0x37')]){_0x3e990d[_0xb3f9('0x38')]=_[_0xb3f9('0x39')](_0x3e990d[_0xb3f9('0x38')],{'$or':_['map'](_0x4ccacb,function(_0x169b66){if(_0x169b66[_0xb3f9('0x2c')]!==_0xb3f9('0x3a')){var _0x912986={};_0x912986[_0x169b66[_0xb3f9('0x27')]]={'$like':'%'+_0x2752c5[_0xb3f9('0x2e')][_0xb3f9('0x37')]+'%'};return _0x912986;}})});}_0x3e990d=_['merge']({},_0x3e990d,_0x2752c5[_0xb3f9('0x3b')]);var _0x65a948={'where':_0x3e990d[_0xb3f9('0x38')]};return db[_0xb3f9('0x3c')][_0xb3f9('0x1a')](_0x65a948)[_0xb3f9('0x21')](function(_0x3388b7){_0x5d7762[_0xb3f9('0x1a')]=_0x3388b7;if(_0x2752c5['query'][_0xb3f9('0x3d')]){_0x3e990d[_0xb3f9('0x3e')]=[{'all':!![]}];}return db[_0xb3f9('0x3c')]['findAll'](_0x3e990d);})[_0xb3f9('0x21')](function(_0x25d4e7){_0x5d7762[_0xb3f9('0x3f')]=_0x25d4e7;return _0x5d7762;})[_0xb3f9('0x21')](respondWithFilteredResult(_0xacbe01,_0x3e990d))['catch'](handleError(_0xacbe01,null));};exports[_0xb3f9('0x40')]=function(_0x52fe89,_0x1f5616){var _0x81235c={'raw':![],'where':{'id':_0x52fe89[_0xb3f9('0x41')]['id']}},_0xbdc4eb={};_0xbdc4eb[_0xb3f9('0x2d')]=_[_0xb3f9('0x42')](db[_0xb3f9('0x3c')][_0xb3f9('0x43')]);_0xbdc4eb[_0xb3f9('0x2e')]=_['keys'](_0x52fe89['query']);_0xbdc4eb[_0xb3f9('0x35')]=_[_0xb3f9('0x2f')](_0xbdc4eb['model'],_0xbdc4eb[_0xb3f9('0x2e')]);_0x81235c[_0xb3f9('0x31')]=_[_0xb3f9('0x2f')](_0xbdc4eb['model'],qs[_0xb3f9('0x30')](_0x52fe89['query'][_0xb3f9('0x30')]));_0x81235c['attributes']=_0x81235c[_0xb3f9('0x31')][_0xb3f9('0x32')]?_0x81235c[_0xb3f9('0x31')]:_0xbdc4eb[_0xb3f9('0x2d')];if(_0x52fe89[_0xb3f9('0x2e')][_0xb3f9('0x3d')]){_0x81235c['include']=[{'all':!![]}];}_0x81235c=_[_0xb3f9('0x39')]({},_0x81235c,_0x52fe89[_0xb3f9('0x3b')]);return db[_0xb3f9('0x3c')][_0xb3f9('0x44')](_0x81235c)[_0xb3f9('0x21')](handleEntityNotFound(_0x1f5616,null))[_0xb3f9('0x21')](respondWithResult(_0x1f5616,null))[_0xb3f9('0x45')](handleError(_0x1f5616,null));};exports[_0xb3f9('0x46')]=function(_0x245ddd,_0x5d0e91){return db[_0xb3f9('0x3c')][_0xb3f9('0x46')](_0x245ddd[_0xb3f9('0x47')],{})['then'](function(_0x1715af){var _0x555e29=_0x245ddd[_0xb3f9('0x48')][_0xb3f9('0x23')]({'plain':!![]});if(!_0x555e29)throw new Error(_0xb3f9('0x49'));if(_0x555e29[_0xb3f9('0x4a')]==='user'){var _0x184f7b=_0x1715af[_0xb3f9('0x23')]({'plain':!![]});var _0x2a3a6b=_0xb3f9('0x24');return db[_0xb3f9('0x4b')]['find']({'where':{'name':_0x2a3a6b,'userProfileId':_0x555e29[_0xb3f9('0x4c')]},'raw':!![]})[_0xb3f9('0x21')](function(_0x254846){if(_0x254846&&_0x254846[_0xb3f9('0x4d')]===0x0){return db[_0xb3f9('0x4e')][_0xb3f9('0x46')]({'name':_0x184f7b[_0xb3f9('0x27')],'resourceId':_0x184f7b['id'],'type':_0x254846['name'],'sectionId':_0x254846['id']},{})[_0xb3f9('0x21')](function(){return _0x1715af;});}else{return _0x1715af;}})[_0xb3f9('0x45')](function(_0x136362){logger[_0xb3f9('0x25')](_0xb3f9('0x4f'),_0x136362);throw _0x136362;});}return _0x1715af;})['then'](respondWithResult(_0x5d0e91,0xc9))[_0xb3f9('0x45')](handleError(_0x5d0e91,null));};exports[_0xb3f9('0x50')]=function(_0x30579e,_0x1214ce){var _0x565513={'where':{'id':_0x30579e[_0xb3f9('0x41')]['id']}},_0x3fa7b0={};_0x3fa7b0[_0xb3f9('0x2d')]=_['keys'](db[_0xb3f9('0x3c')][_0xb3f9('0x43')]);_0x565513[_0xb3f9('0x31')]=_[_0xb3f9('0x2f')](_0x3fa7b0[_0xb3f9('0x2d')],qs[_0xb3f9('0x30')](_0x30579e[_0xb3f9('0x2e')][_0xb3f9('0x30')]));_0x565513[_0xb3f9('0x31')]=_0x565513[_0xb3f9('0x31')][_0xb3f9('0x32')]?_0x565513[_0xb3f9('0x31')]:_0x3fa7b0[_0xb3f9('0x2d')];if(_0x30579e[_0xb3f9('0x2e')]['includeAll']){_0x565513[_0xb3f9('0x3e')]=[{'all':!![]}];}_0x565513=_[_0xb3f9('0x39')]({},_0x565513,_0x30579e[_0xb3f9('0x3b')]);return db[_0xb3f9('0x3c')][_0xb3f9('0x44')](_0x565513)[_0xb3f9('0x21')](handleEntityNotFound(_0x1214ce,null))[_0xb3f9('0x21')](function(_0x5a8bfb){if(_0x5a8bfb){var _0x165840=_0x5a8bfb[_0xb3f9('0x23')]({'plain':!![]});_0x165840=qs[_0xb3f9('0x51')](_0x165840,['id',_0xb3f9('0x52'),_0xb3f9('0x53')]);_0x30579e['body']=_[_0xb3f9('0x51')](_0x30579e['body'],['id',_0xb3f9('0x52'),_0xb3f9('0x53')]);return db[_0xb3f9('0x3c')][_0xb3f9('0x46')](_[_0xb3f9('0x39')](_0x165840,_0x30579e[_0xb3f9('0x47')]),{'include':_0x30579e['query'][_0xb3f9('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x23a3b6){var _0x3e3775=_0x30579e[_0xb3f9('0x48')][_0xb3f9('0x23')]({'plain':!![]});if(!_0x3e3775)throw new Error(_0xb3f9('0x49'));if(_0x3e3775[_0xb3f9('0x4a')]===_0xb3f9('0x48')){var _0x4c7335=_0x23a3b6[_0xb3f9('0x23')]({'plain':!![]});var _0x20f128=_0xb3f9('0x24');return db['UserProfileSection'][_0xb3f9('0x44')]({'where':{'name':_0x20f128,'userProfileId':_0x3e3775[_0xb3f9('0x4c')]},'raw':!![]})[_0xb3f9('0x21')](function(_0x2d287b){if(_0x2d287b&&_0x2d287b[_0xb3f9('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c7335[_0xb3f9('0x27')],'resourceId':_0x4c7335['id'],'type':_0x2d287b['name'],'sectionId':_0x2d287b['id']},{})['then'](function(){return _0x23a3b6;});}else{return _0x23a3b6;}})[_0xb3f9('0x45')](function(_0x552032){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x552032);throw _0x552032;});}return _0x23a3b6;});}})[_0xb3f9('0x21')](respondWithResult(_0x1214ce,0xc9))['catch'](handleError(_0x1214ce,null));};exports['update']=function(_0x533597,_0x5bd7af){if(_0x533597['body']['id']){delete _0x533597[_0xb3f9('0x47')]['id'];}return db['Campaign'][_0xb3f9('0x44')]({'where':{'id':_0x533597[_0xb3f9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5bd7af,null))[_0xb3f9('0x21')](saveUpdates(_0x533597['body'],null))[_0xb3f9('0x21')](respondWithResult(_0x5bd7af,null))[_0xb3f9('0x45')](handleError(_0x5bd7af,null));};exports[_0xb3f9('0x22')]=function(_0x1e8135,_0x199077){return db['Campaign'][_0xb3f9('0x44')]({'where':{'id':_0x1e8135['params']['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x199077,null))['then'](removeEntity(_0x199077,null))[_0xb3f9('0x45')](handleError(_0x199077,null));};exports[_0xb3f9('0x54')]=function(_0x2af8a5,_0x3d01e6,_0x4c0ac8){var _0x440c6e={'raw':!![],'where':{}};var _0x334e72={};var _0xd32eff={'count':0x0,'rows':[]};return db[_0xb3f9('0x3c')][_0xb3f9('0x55')]({'where':{'id':_0x2af8a5['params']['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x3d01e6,null))['then'](function(_0x14c39c){if(_0x14c39c){_0x334e72['model']=_[_0xb3f9('0x42')](db[_0xb3f9('0x56')][_0xb3f9('0x43')]);_0x334e72[_0xb3f9('0x2e')]=_[_0xb3f9('0x42')](_0x2af8a5[_0xb3f9('0x2e')]);_0x334e72[_0xb3f9('0x35')]=_[_0xb3f9('0x2f')](_0x334e72['model'],_0x334e72[_0xb3f9('0x2e')]);_0x440c6e[_0xb3f9('0x31')]=_['intersection'](_0x334e72['model'],qs['fields'](_0x2af8a5[_0xb3f9('0x2e')][_0xb3f9('0x30')]));_0x440c6e['attributes']=_0x440c6e[_0xb3f9('0x31')]['length']?_0x440c6e['attributes']:_0x334e72[_0xb3f9('0x2d')];if(!_0x2af8a5[_0xb3f9('0x2e')]['hasOwnProperty'](_0xb3f9('0x57'))){_0x440c6e[_0xb3f9('0x19')]=qs[_0xb3f9('0x19')](_0x2af8a5[_0xb3f9('0x2e')][_0xb3f9('0x19')]);_0x440c6e[_0xb3f9('0x17')]=qs[_0xb3f9('0x17')](_0x2af8a5[_0xb3f9('0x2e')]['offset']);}_0x440c6e[_0xb3f9('0x58')]=qs[_0xb3f9('0x34')](_0x2af8a5['query'][_0xb3f9('0x34')]);_0x440c6e[_0xb3f9('0x38')]=qs[_0xb3f9('0x35')](_[_0xb3f9('0x36')](_0x2af8a5['query'],_0x334e72[_0xb3f9('0x35')]));_0x440c6e[_0xb3f9('0x38')][_0xb3f9('0x59')]=_0x14c39c['id'];if(_0x2af8a5[_0xb3f9('0x2e')][_0xb3f9('0x37')]){_0x440c6e[_0xb3f9('0x38')]=_[_0xb3f9('0x39')](_0x440c6e['where'],{'$or':_[_0xb3f9('0x2a')](_0x440c6e['attributes'],function(_0x5840d4){var _0x1b08be={};_0x1b08be[_0x5840d4]={'$like':'%'+_0x2af8a5[_0xb3f9('0x2e')][_0xb3f9('0x37')]+'%'};return _0x1b08be;})});}_0x440c6e=_[_0xb3f9('0x39')]({},_0x440c6e,_0x2af8a5[_0xb3f9('0x3b')]);return db[_0xb3f9('0x56')][_0xb3f9('0x1a')]({'where':_0x440c6e['where']})[_0xb3f9('0x21')](function(_0x24d0ab){_0xd32eff[_0xb3f9('0x1a')]=_0x24d0ab;if(_0x2af8a5['query']['includeAll']){_0x440c6e[_0xb3f9('0x3e')]=[{'all':!![]}];}return db[_0xb3f9('0x56')][_0xb3f9('0x5a')](_0x440c6e);})['then'](function(_0x32fd02){_0xd32eff[_0xb3f9('0x3f')]=_0x32fd02;return _0xd32eff;});}})[_0xb3f9('0x21')](respondWithFilteredResult(_0x3d01e6,_0x440c6e))[_0xb3f9('0x45')](handleError(_0x3d01e6,null));};exports[_0xb3f9('0x5b')]=function(_0x3c1ac5,_0x49d328,_0x46da75){var _0x42035d={'raw':!![],'where':{}};var _0xb589a2={};var _0x35b3f2={'count':0x0,'rows':[]};return db[_0xb3f9('0x3c')][_0xb3f9('0x55')]({'where':{'id':_0x3c1ac5[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x49d328,null))[_0xb3f9('0x21')](function(_0x17d689){if(_0x17d689){_0xb589a2[_0xb3f9('0x2d')]=_['keys'](db['CmHopperHistory'][_0xb3f9('0x43')]);_0xb589a2[_0xb3f9('0x2e')]=_[_0xb3f9('0x42')](_0x3c1ac5['query']);_0xb589a2['filters']=_['intersection'](_0xb589a2[_0xb3f9('0x2d')],_0xb589a2[_0xb3f9('0x2e')]);_0x42035d['attributes']=_[_0xb3f9('0x2f')](_0xb589a2['model'],qs[_0xb3f9('0x30')](_0x3c1ac5[_0xb3f9('0x2e')]['fields']));_0x42035d[_0xb3f9('0x31')]=_0x42035d[_0xb3f9('0x31')][_0xb3f9('0x32')]?_0x42035d[_0xb3f9('0x31')]:_0xb589a2['model'];if(!_0x3c1ac5[_0xb3f9('0x2e')][_0xb3f9('0x33')]('nolimit')){_0x42035d[_0xb3f9('0x19')]=qs[_0xb3f9('0x19')](_0x3c1ac5['query'][_0xb3f9('0x19')]);_0x42035d[_0xb3f9('0x17')]=qs['offset'](_0x3c1ac5['query'][_0xb3f9('0x17')]);}_0x42035d[_0xb3f9('0x58')]=qs['sort'](_0x3c1ac5[_0xb3f9('0x2e')]['sort']);_0x42035d['where']=qs[_0xb3f9('0x35')](_[_0xb3f9('0x36')](_0x3c1ac5['query'],_0xb589a2[_0xb3f9('0x35')]));_0x42035d[_0xb3f9('0x38')][_0xb3f9('0x59')]=_0x17d689['id'];if(_0x3c1ac5['query'][_0xb3f9('0x37')]){_0x42035d[_0xb3f9('0x38')]=_['merge'](_0x42035d[_0xb3f9('0x38')],{'$or':_[_0xb3f9('0x2a')](_0x42035d[_0xb3f9('0x31')],function(_0x1b936d){var _0x2ba530={};_0x2ba530[_0x1b936d]={'$like':'%'+_0x3c1ac5[_0xb3f9('0x2e')][_0xb3f9('0x37')]+'%'};return _0x2ba530;})});}_0x42035d=_['merge']({},_0x42035d,_0x3c1ac5[_0xb3f9('0x3b')]);return db[_0xb3f9('0x5c')][_0xb3f9('0x1a')]({'where':_0x42035d['where']})[_0xb3f9('0x21')](function(_0x3c81ad){_0x35b3f2[_0xb3f9('0x1a')]=_0x3c81ad;if(_0x3c1ac5[_0xb3f9('0x2e')][_0xb3f9('0x3d')]){_0x42035d[_0xb3f9('0x3e')]=[{'all':!![]}];}return db[_0xb3f9('0x5c')][_0xb3f9('0x5a')](_0x42035d);})[_0xb3f9('0x21')](function(_0x4ee843){_0x35b3f2[_0xb3f9('0x3f')]=_0x4ee843;return _0x35b3f2;});}})['then'](respondWithFilteredResult(_0x49d328,_0x42035d))[_0xb3f9('0x45')](handleError(_0x49d328,null));};exports[_0xb3f9('0x5d')]=function(_0x1c5494,_0x5ab9d6,_0x355493){var _0x2a4495={'raw':!![],'where':{}};var _0x1b1ab2={};var _0xf9c67={'count':0x0,'rows':[]};return db[_0xb3f9('0x3c')]['findOne']({'where':{'id':_0x1c5494[_0xb3f9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ab9d6,null))['then'](function(_0x4bd595){if(_0x4bd595){_0x1b1ab2[_0xb3f9('0x2d')]=_[_0xb3f9('0x42')](db[_0xb3f9('0x5e')]['rawAttributes']);_0x1b1ab2[_0xb3f9('0x2e')]=_['keys'](_0x1c5494['query']);_0x1b1ab2[_0xb3f9('0x35')]=_['intersection'](_0x1b1ab2[_0xb3f9('0x2d')],_0x1b1ab2[_0xb3f9('0x2e')]);_0x2a4495[_0xb3f9('0x31')]=_[_0xb3f9('0x2f')](_0x1b1ab2['model'],qs[_0xb3f9('0x30')](_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x30')]));_0x2a4495[_0xb3f9('0x31')]=_0x2a4495['attributes'][_0xb3f9('0x32')]?_0x2a4495[_0xb3f9('0x31')]:_0x1b1ab2[_0xb3f9('0x2d')];if(!_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x33')](_0xb3f9('0x57'))){_0x2a4495[_0xb3f9('0x19')]=qs[_0xb3f9('0x19')](_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x19')]);_0x2a4495[_0xb3f9('0x17')]=qs[_0xb3f9('0x17')](_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x17')]);}_0x2a4495[_0xb3f9('0x58')]=qs[_0xb3f9('0x34')](_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x34')]);_0x2a4495[_0xb3f9('0x38')]=qs['filters'](_[_0xb3f9('0x36')](_0x1c5494[_0xb3f9('0x2e')],_0x1b1ab2[_0xb3f9('0x35')]));_0x2a4495[_0xb3f9('0x38')][_0xb3f9('0x59')]=_0x4bd595['id'];if(_0x1c5494[_0xb3f9('0x2e')]['filter']){_0x2a4495[_0xb3f9('0x38')]=_['merge'](_0x2a4495['where'],{'$or':_['map'](_0x2a4495[_0xb3f9('0x31')],function(_0x1b018f){var _0x230f55={};_0x230f55[_0x1b018f]={'$like':'%'+_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x37')]+'%'};return _0x230f55;})});}_0x2a4495=_['merge']({},_0x2a4495,_0x1c5494['options']);return db[_0xb3f9('0x5e')][_0xb3f9('0x1a')]({'where':_0x2a4495['where']})[_0xb3f9('0x21')](function(_0x4a0d83){_0xf9c67[_0xb3f9('0x1a')]=_0x4a0d83;if(_0x1c5494[_0xb3f9('0x2e')][_0xb3f9('0x3d')]){_0x2a4495[_0xb3f9('0x3e')]=[{'all':!![]}];}return db[_0xb3f9('0x5e')][_0xb3f9('0x5a')](_0x2a4495);})[_0xb3f9('0x21')](function(_0x3b455b){_0xf9c67[_0xb3f9('0x3f')]=_0x3b455b;return _0xf9c67;});}})[_0xb3f9('0x21')](respondWithFilteredResult(_0x5ab9d6,_0x2a4495))[_0xb3f9('0x45')](handleError(_0x5ab9d6,null));};exports[_0xb3f9('0x5f')]=function(_0x229be7,_0x10b2a6,_0x1b28b6){var _0x26fbbe={'raw':!![],'where':{}};var _0x3f8a26={};var _0x31fd4a={'count':0x0,'rows':[]};return db[_0xb3f9('0x3c')]['findOne']({'where':{'id':_0x229be7[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x10b2a6,null))[_0xb3f9('0x21')](function(_0x506812){if(_0x506812){_0x3f8a26[_0xb3f9('0x2d')]=_[_0xb3f9('0x42')](db['CmHopperBlack'][_0xb3f9('0x43')]);_0x3f8a26[_0xb3f9('0x2e')]=_[_0xb3f9('0x42')](_0x229be7['query']);_0x3f8a26[_0xb3f9('0x35')]=_['intersection'](_0x3f8a26[_0xb3f9('0x2d')],_0x3f8a26[_0xb3f9('0x2e')]);_0x26fbbe[_0xb3f9('0x31')]=_['intersection'](_0x3f8a26['model'],qs['fields'](_0x229be7[_0xb3f9('0x2e')][_0xb3f9('0x30')]));_0x26fbbe[_0xb3f9('0x31')]=_0x26fbbe[_0xb3f9('0x31')][_0xb3f9('0x32')]?_0x26fbbe[_0xb3f9('0x31')]:_0x3f8a26[_0xb3f9('0x2d')];if(!_0x229be7['query'][_0xb3f9('0x33')](_0xb3f9('0x57'))){_0x26fbbe['limit']=qs['limit'](_0x229be7[_0xb3f9('0x2e')]['limit']);_0x26fbbe[_0xb3f9('0x17')]=qs['offset'](_0x229be7[_0xb3f9('0x2e')][_0xb3f9('0x17')]);}_0x26fbbe[_0xb3f9('0x58')]=qs[_0xb3f9('0x34')](_0x229be7[_0xb3f9('0x2e')][_0xb3f9('0x34')]);_0x26fbbe[_0xb3f9('0x38')]=qs['filters'](_[_0xb3f9('0x36')](_0x229be7[_0xb3f9('0x2e')],_0x3f8a26[_0xb3f9('0x35')]));_0x26fbbe[_0xb3f9('0x38')][_0xb3f9('0x59')]=_0x506812['id'];if(_0x229be7[_0xb3f9('0x2e')][_0xb3f9('0x37')]){_0x26fbbe['where']=_[_0xb3f9('0x39')](_0x26fbbe['where'],{'$or':_[_0xb3f9('0x2a')](_0x26fbbe[_0xb3f9('0x31')],function(_0xcff849){var _0x5ed971={};_0x5ed971[_0xcff849]={'$like':'%'+_0x229be7[_0xb3f9('0x2e')]['filter']+'%'};return _0x5ed971;})});}_0x26fbbe=_['merge']({},_0x26fbbe,_0x229be7[_0xb3f9('0x3b')]);return db[_0xb3f9('0x60')][_0xb3f9('0x1a')]({'where':_0x26fbbe[_0xb3f9('0x38')]})[_0xb3f9('0x21')](function(_0x3cbd89){_0x31fd4a['count']=_0x3cbd89;if(_0x229be7[_0xb3f9('0x2e')][_0xb3f9('0x3d')]){_0x26fbbe[_0xb3f9('0x3e')]=[{'all':!![]}];}return db[_0xb3f9('0x60')][_0xb3f9('0x5a')](_0x26fbbe);})['then'](function(_0x2b592f){_0x31fd4a[_0xb3f9('0x3f')]=_0x2b592f;return _0x31fd4a;});}})[_0xb3f9('0x21')](respondWithFilteredResult(_0x10b2a6,_0x26fbbe))['catch'](handleError(_0x10b2a6,null));};exports[_0xb3f9('0x61')]=function(_0x442aae,_0x53611b,_0x59ef51){var _0x1b54b2={};var _0x8b5e65={};var _0x35b78e;var _0x35f86f;return db['Campaign'][_0xb3f9('0x55')]({'where':{'id':_0x442aae[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x53611b,null))['then'](function(_0x1f5940){if(_0x1f5940){_0x35b78e=_0x1f5940;_0x8b5e65['model']=_[_0xb3f9('0x42')](db[_0xb3f9('0x62')][_0xb3f9('0x43')]);_0x8b5e65[_0xb3f9('0x2e')]=_[_0xb3f9('0x42')](_0x442aae[_0xb3f9('0x2e')]);_0x8b5e65['filters']=_['intersection'](_0x8b5e65['model'],_0x8b5e65['query']);_0x1b54b2[_0xb3f9('0x31')]=_[_0xb3f9('0x2f')](_0x8b5e65[_0xb3f9('0x2d')],qs['fields'](_0x442aae[_0xb3f9('0x2e')][_0xb3f9('0x30')]));_0x1b54b2[_0xb3f9('0x31')]=_0x1b54b2[_0xb3f9('0x31')][_0xb3f9('0x32')]?_0x1b54b2[_0xb3f9('0x31')]:_0x8b5e65[_0xb3f9('0x2d')];_0x1b54b2[_0xb3f9('0x58')]=qs['sort'](_0x442aae[_0xb3f9('0x2e')][_0xb3f9('0x34')]);_0x1b54b2[_0xb3f9('0x38')]=qs[_0xb3f9('0x35')](_[_0xb3f9('0x36')](_0x442aae[_0xb3f9('0x2e')],_0x8b5e65[_0xb3f9('0x35')]));if(_0x442aae['query'][_0xb3f9('0x37')]){_0x1b54b2[_0xb3f9('0x38')]=_['merge'](_0x1b54b2[_0xb3f9('0x38')],{'$or':_['map'](_0x1b54b2[_0xb3f9('0x31')],function(_0x3a6ea2){var _0x51d66c={};_0x51d66c[_0x3a6ea2]={'$like':'%'+_0x442aae[_0xb3f9('0x2e')]['filter']+'%'};return _0x51d66c;})});}_0x1b54b2=_['merge']({},_0x1b54b2,_0x442aae[_0xb3f9('0x3b')]);return _0x35b78e['getLists'](_0x1b54b2);}})[_0xb3f9('0x21')](function(_0x20b7f8){if(_0x20b7f8){_0x35f86f=_0x20b7f8[_0xb3f9('0x32')];if(!_0x442aae[_0xb3f9('0x2e')]['hasOwnProperty'](_0xb3f9('0x57'))){_0x1b54b2[_0xb3f9('0x19')]=qs[_0xb3f9('0x19')](_0x442aae['query']['limit']);_0x1b54b2[_0xb3f9('0x17')]=qs[_0xb3f9('0x17')](_0x442aae[_0xb3f9('0x2e')]['offset']);}return _0x35b78e[_0xb3f9('0x61')](_0x1b54b2);}})[_0xb3f9('0x21')](function(_0x305ae7){if(_0x305ae7){return _0x305ae7?{'count':_0x35f86f,'rows':_0x305ae7}:null;}})[_0xb3f9('0x21')](respondWithResult(_0x53611b,null))[_0xb3f9('0x45')](handleError(_0x53611b,null));};exports['addLists']=function(_0x2464de,_0x4bb06e,_0x63b5ce){var _0x364dbd,_0xac4c03;var _0x537845=[];var _0x15b24e=moment()[_0xb3f9('0x63')](_0xb3f9('0x64'));return db[_0xb3f9('0x3c')][_0xb3f9('0x44')]({'where':{'id':_0x2464de['params']['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x4bb06e,null))[_0xb3f9('0x21')](function(_0x95fdb9){if(_0x95fdb9){_0xac4c03=_0x95fdb9;return _0x95fdb9['addLists'](_0x2464de['body'][_0xb3f9('0x65')],_[_0xb3f9('0x51')](_0x2464de[_0xb3f9('0x47')],[_0xb3f9('0x65'),'id'])||{});}return null;})['spread'](function(_0x47ec4a){var _0x17fea8;var _0x10acee;_0x364dbd=_0x47ec4a||[];var _0xf685f8=[];if(_0x47ec4a){for(var _0x23739a=0x0;_0x23739a<_0x47ec4a['length'];_0x23739a+=0x1){var _0x2d4034=_0x47ec4a[_0x23739a][_0xb3f9('0x23')]({'plain':!![]});_0xac4c03[_0xb3f9('0x66')]=_0x2464de[_0xb3f9('0x47')][_0xb3f9('0x66')]?_0x2464de['body'][_0xb3f9('0x66')]:_0xac4c03[_0xb3f9('0x66')];switch(_0xac4c03[_0xb3f9('0x66')]){case _0xb3f9('0x67'):_0x17fea8=squel['insert']()[_0xb3f9('0x68')]('cm_hopper')[_0xb3f9('0x69')]([_0xb3f9('0x6a'),_0xb3f9('0x6b'),_0xb3f9('0x6c'),_0xb3f9('0x6d'),_0xb3f9('0x59'),'createdAt',_0xb3f9('0x53')],squel['select']()[_0xb3f9('0x6e')](_0xb3f9('0x6a'),_0xb3f9('0x6a'))[_0xb3f9('0x6e')](_0xb3f9('0x6f'),_0xb3f9('0x6b'))['field']('id',_0xb3f9('0x6c'))[_0xb3f9('0x6e')](_0x2d4034[_0xb3f9('0x70')]['toString'](),_0xb3f9('0x6d'))[_0xb3f9('0x6e')](_0x2464de[_0xb3f9('0x41')]['id']['toString'](),_0xb3f9('0x59'))[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27','createdAt')[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27',_0xb3f9('0x53'))['from'](_0xb3f9('0x71'))['where'](_0xb3f9('0x72'))[_0xb3f9('0x38')]('ListId\x20=\x20?',_0x2d4034[_0xb3f9('0x70')][_0xb3f9('0x73')]())['where'](_0xb3f9('0x74'))[_0xb3f9('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb3f9('0x6e')](_0xb3f9('0x75'))[_0xb3f9('0x76')]('cm_hopper_final')['where'](_0xb3f9('0x77'),_0x2464de[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')]()))[_0xb3f9('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xb3f9('0x76')]('cm_hopper')['where'](_0xb3f9('0x77'),_0x2464de[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')]())))[_0xb3f9('0x73')]();break;case'onlyIfOpen':_0x17fea8=squel['insert']()[_0xb3f9('0x68')]('cm_hopper')[_0xb3f9('0x69')](['phone',_0xb3f9('0x6b'),_0xb3f9('0x6c'),_0xb3f9('0x6d'),'CampaignId','createdAt',_0xb3f9('0x53')],squel['select']()[_0xb3f9('0x6e')](_0xb3f9('0x6a'),_0xb3f9('0x6a'))[_0xb3f9('0x6e')](_0xb3f9('0x6f'),'scheduledAt')[_0xb3f9('0x6e')]('id','ContactId')['field'](_0x2d4034[_0xb3f9('0x70')][_0xb3f9('0x73')](),_0xb3f9('0x6d'))['field'](_0x2464de[_0xb3f9('0x41')]['id']['toString'](),'CampaignId')[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27',_0xb3f9('0x52'))[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27',_0xb3f9('0x53'))[_0xb3f9('0x76')](_0xb3f9('0x71'))[_0xb3f9('0x38')](_0xb3f9('0x72'))[_0xb3f9('0x38')](_0xb3f9('0x78'),_0x2d4034['CmListId'][_0xb3f9('0x73')]())[_0xb3f9('0x38')](_0xb3f9('0x74'))[_0xb3f9('0x38')](_0xb3f9('0x79'),squel[_0xb3f9('0x7a')]()['field'](_0xb3f9('0x7b'))['from'](_0xb3f9('0x7c'))[_0xb3f9('0x38')](_0xb3f9('0x77'),_0x2464de[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')]())))[_0xb3f9('0x73')]();break;default:_0x17fea8=squel[_0xb3f9('0x7d')]()[_0xb3f9('0x68')]('cm_hopper')[_0xb3f9('0x69')]([_0xb3f9('0x6a'),'scheduledAt',_0xb3f9('0x6c'),_0xb3f9('0x6d'),'CampaignId',_0xb3f9('0x52'),_0xb3f9('0x53')],squel[_0xb3f9('0x7a')]()[_0xb3f9('0x6e')](_0xb3f9('0x6a'),_0xb3f9('0x6a'))[_0xb3f9('0x6e')](_0xb3f9('0x6f'),'scheduledAt')[_0xb3f9('0x6e')]('id',_0xb3f9('0x6c'))[_0xb3f9('0x6e')](_0x2d4034[_0xb3f9('0x70')][_0xb3f9('0x73')](),_0xb3f9('0x6d'))[_0xb3f9('0x6e')](_0x2464de[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')](),_0xb3f9('0x59'))['field']('\x27'+_0x15b24e+'\x27',_0xb3f9('0x52'))[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27',_0xb3f9('0x53'))[_0xb3f9('0x76')]('cm_contacts')[_0xb3f9('0x38')](_0xb3f9('0x72'))[_0xb3f9('0x38')](_0xb3f9('0x78'),_0x2d4034[_0xb3f9('0x70')][_0xb3f9('0x73')]())[_0xb3f9('0x38')](_0xb3f9('0x74')))['toString']();}_0x10acee=squel[_0xb3f9('0x7d')]()[_0xb3f9('0x68')]('cm_hopper_additional_phones')[_0xb3f9('0x69')]([_0xb3f9('0x7e'),_0xb3f9('0x6b'),'phone','OrderBy',_0xb3f9('0x52'),_0xb3f9('0x53')],squel['select']()[_0xb3f9('0x6e')](_0xb3f9('0x7f'),'id')['field'](_0xb3f9('0x6f'),_0xb3f9('0x6b'))[_0xb3f9('0x6e')](_0xb3f9('0x80'),_0xb3f9('0x6a'))[_0xb3f9('0x6e')](_0xb3f9('0x81'),'OrderBy')['field']('\x27'+_0x15b24e+'\x27',_0xb3f9('0x52'))[_0xb3f9('0x6e')]('\x27'+_0x15b24e+'\x27',_0xb3f9('0x53'))[_0xb3f9('0x76')](_0xb3f9('0x82'),'ci')['join'](_0xb3f9('0x7c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb3f9('0x38')](_0xb3f9('0x83'),_0x2d4034[_0xb3f9('0x70')]['toString']())[_0xb3f9('0x38')](_0xb3f9('0x84'),_0x2464de[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')]())[_0xb3f9('0x38')](_0xb3f9('0x85'),_0x15b24e))['toString']();_0xf685f8[_0xb3f9('0x86')](db['sequelize']['query'](_0x17fea8));_0x537845[_0xb3f9('0x86')](db[_0xb3f9('0x87')]['query'](_0x10acee));}return BPromise[_0xb3f9('0x88')](_0xf685f8);}})[_0xb3f9('0x21')](function(){return BPromise[_0xb3f9('0x88')](_0x537845);})[_0xb3f9('0x21')](function(){return _0x364dbd;})[_0xb3f9('0x21')](respondWithResult(_0x4bb06e,null))[_0xb3f9('0x45')](handleError(_0x4bb06e,null));};exports[_0xb3f9('0x89')]=function(_0x47a72f,_0x2c58bc,_0x4781a3){return db['Campaign']['find']({'where':{'id':_0x47a72f[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x2c58bc,null))['then'](function(_0x158a16){if(_0x158a16){return _0x158a16[_0xb3f9('0x89')](_0x47a72f[_0xb3f9('0x2e')]['ids']);}})['then'](function(_0xeaf96f){if(_0xeaf96f){return db[_0xb3f9('0x56')]['destroy']({'where':{'ListId':_0x47a72f[_0xb3f9('0x2e')][_0xb3f9('0x65')],'CampaignId':_0x47a72f[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](function(){return _0xeaf96f;});}})[_0xb3f9('0x21')](respondWithStatusCode(_0x2c58bc,null))['catch'](handleError(_0x2c58bc,null));};exports[_0xb3f9('0x8a')]=function(_0x14db94,_0x36fbad,_0x5d836f){var _0x1f74f4={};var _0x2e696c={};var _0x291ccd;var _0x1914b2;return db[_0xb3f9('0x3c')][_0xb3f9('0x55')]({'where':{'id':_0x14db94[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x36fbad,null))[_0xb3f9('0x21')](function(_0x1a6b7e){if(_0x1a6b7e){_0x291ccd=_0x1a6b7e;_0x2e696c[_0xb3f9('0x2d')]=_[_0xb3f9('0x42')](db[_0xb3f9('0x62')]['rawAttributes']);_0x2e696c[_0xb3f9('0x2e')]=_[_0xb3f9('0x42')](_0x14db94[_0xb3f9('0x2e')]);_0x2e696c[_0xb3f9('0x35')]=_[_0xb3f9('0x2f')](_0x2e696c[_0xb3f9('0x2d')],_0x2e696c[_0xb3f9('0x2e')]);_0x1f74f4['attributes']=_[_0xb3f9('0x2f')](_0x2e696c[_0xb3f9('0x2d')],qs['fields'](_0x14db94['query']['fields']));_0x1f74f4[_0xb3f9('0x31')]=_0x1f74f4['attributes']['length']?_0x1f74f4[_0xb3f9('0x31')]:_0x2e696c[_0xb3f9('0x2d')];_0x1f74f4['order']=qs[_0xb3f9('0x34')](_0x14db94['query'][_0xb3f9('0x34')]);_0x1f74f4['where']=qs[_0xb3f9('0x35')](_[_0xb3f9('0x36')](_0x14db94['query'],_0x2e696c[_0xb3f9('0x35')]));if(_0x14db94[_0xb3f9('0x2e')][_0xb3f9('0x37')]){_0x1f74f4[_0xb3f9('0x38')]=_[_0xb3f9('0x39')](_0x1f74f4[_0xb3f9('0x38')],{'$or':_[_0xb3f9('0x2a')](_0x1f74f4[_0xb3f9('0x31')],function(_0x6e7c1a){var _0x10d744={};_0x10d744[_0x6e7c1a]={'$like':'%'+_0x14db94[_0xb3f9('0x2e')][_0xb3f9('0x37')]+'%'};return _0x10d744;})});}_0x1f74f4=_[_0xb3f9('0x39')]({},_0x1f74f4,_0x14db94[_0xb3f9('0x3b')]);return _0x291ccd[_0xb3f9('0x8a')](_0x1f74f4);}})[_0xb3f9('0x21')](function(_0x3d15c4){if(_0x3d15c4){_0x1914b2=_0x3d15c4[_0xb3f9('0x32')];if(!_0x14db94['query'][_0xb3f9('0x33')]('nolimit')){_0x1f74f4[_0xb3f9('0x19')]=qs[_0xb3f9('0x19')](_0x14db94[_0xb3f9('0x2e')]['limit']);_0x1f74f4['offset']=qs[_0xb3f9('0x17')](_0x14db94[_0xb3f9('0x2e')]['offset']);}return _0x291ccd[_0xb3f9('0x8a')](_0x1f74f4);}})[_0xb3f9('0x21')](function(_0x1ea8a4){if(_0x1ea8a4){return _0x1ea8a4?{'count':_0x1914b2,'rows':_0x1ea8a4}:null;}})['then'](respondWithResult(_0x36fbad,null))[_0xb3f9('0x45')](handleError(_0x36fbad,null));};exports[_0xb3f9('0x8b')]=function(_0x4a09e1,_0xa840e1,_0x59599f){var _0x3e70f9,_0x5bef3c;var _0x3d3b2c=[];var _0x233772=moment()['format'](_0xb3f9('0x64'));return db[_0xb3f9('0x3c')][_0xb3f9('0x44')]({'where':{'id':_0x4a09e1[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0xa840e1,null))[_0xb3f9('0x21')](function(_0x3e6edf){if(_0x3e6edf){_0x5bef3c=_0x3e6edf;return _0x3e6edf[_0xb3f9('0x8b')](_0x4a09e1[_0xb3f9('0x47')][_0xb3f9('0x65')],_[_0xb3f9('0x51')](_0x4a09e1['body'],['ids','id'])||{});}return null;})[_0xb3f9('0x8c')](function(_0x58a90e){var _0x5a07c4;var _0x138071;_0x3e70f9=_0x58a90e||[];var _0x22953c=[];if(_0x58a90e){for(var _0x384acc=0x0;_0x384acc<_0x58a90e[_0xb3f9('0x32')];_0x384acc+=0x1){var _0x399935=_0x58a90e[_0x384acc]['get']({'plain':!![]});_0x5a07c4=squel['insert']()[_0xb3f9('0x68')]('cm_hopper_black')[_0xb3f9('0x69')]([_0xb3f9('0x6a'),_0xb3f9('0x6c'),_0xb3f9('0x6d'),_0xb3f9('0x59'),_0xb3f9('0x52'),_0xb3f9('0x53')],squel[_0xb3f9('0x7a')]()[_0xb3f9('0x6e')](_0xb3f9('0x6a'),_0xb3f9('0x6a'))['field']('id',_0xb3f9('0x6c'))[_0xb3f9('0x6e')](_0x399935[_0xb3f9('0x70')][_0xb3f9('0x73')](),_0xb3f9('0x6d'))['field'](_0x4a09e1[_0xb3f9('0x41')]['id'][_0xb3f9('0x73')](),'CampaignId')[_0xb3f9('0x6e')]('NOW()','createdAt')[_0xb3f9('0x6e')](_0xb3f9('0x6f'),_0xb3f9('0x53'))['from'](_0xb3f9('0x71'))[_0xb3f9('0x38')](_0xb3f9('0x72'))['where'](_0xb3f9('0x78'),_0x399935[_0xb3f9('0x70')][_0xb3f9('0x73')]())[_0xb3f9('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0xb3f9('0x73')]();_0x22953c[_0xb3f9('0x86')](db['sequelize']['query'](_0x5a07c4));}return BPromise[_0xb3f9('0x88')](_0x22953c);}})[_0xb3f9('0x21')](function(){return _0x3e70f9;})['then'](respondWithResult(_0xa840e1,null))[_0xb3f9('0x45')](handleError(_0xa840e1,null));};exports['removeBlackLists']=function(_0x2f0a0c,_0x34db47,_0x1710c0){return db['Campaign'][_0xb3f9('0x44')]({'where':{'id':_0x2f0a0c[_0xb3f9('0x41')]['id']}})['then'](handleEntityNotFound(_0x34db47,null))[_0xb3f9('0x21')](function(_0x25a67e){if(_0x25a67e){return _0x25a67e[_0xb3f9('0x8d')](_0x2f0a0c[_0xb3f9('0x2e')][_0xb3f9('0x65')]);}})[_0xb3f9('0x21')](function(_0x345421){if(_0x345421){return db[_0xb3f9('0x60')][_0xb3f9('0x22')]({'where':{'ListId':_0x2f0a0c['query'][_0xb3f9('0x65')],'CampaignId':_0x2f0a0c[_0xb3f9('0x41')]['id']}})[_0xb3f9('0x21')](function(){return _0x345421;});}})[_0xb3f9('0x21')](respondWithStatusCode(_0x34db47,null))['catch'](handleError(_0x34db47,null));}; \ No newline at end of file +var _0xd64b=['CmHopperHistory','rows','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','format','addLists','ids','omit','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','ContactId','ListId','field','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','select','insert','fromQuery','NOW()','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','all','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','push','sequelize','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get','IvrCampaigns','stack','name','send','index','map','Campaign','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','getHoppers','findOne','CmHopper','sort','CampaignId','getHopperHistories'];(function(_0x3c24fc,_0x392f8b){var _0x580736=function(_0x236a7a){while(--_0x236a7a){_0x3c24fc['push'](_0x3c24fc['shift']());}};_0x580736(++_0x392f8b);}(_0xd64b,0xc1));var _0xbd64=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xd64b[_0x1fd9e7];return _0x1781f2;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['Campaign'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['Campaign'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x4b')]=function(_0x371bad,_0x44cd4f){var _0x1db94c={'where':{'id':_0x371bad[_0xbd64('0x3f')]['id']}},_0x2436c1={};_0x2436c1['model']=_['keys'](db['Campaign'][_0xbd64('0x2a')]);_0x1db94c[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x2436c1[_0xbd64('0x2c')],qs['fields'](_0x371bad[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x1db94c[_0xbd64('0x31')]=_0x1db94c[_0xbd64('0x31')][_0xbd64('0x32')]?_0x1db94c[_0xbd64('0x31')]:_0x2436c1['model'];if(_0x371bad[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x1db94c[_0xbd64('0x3c')]=[{'all':!![]}];}_0x1db94c=_[_0xbd64('0x38')]({},_0x1db94c,_0x371bad[_0xbd64('0x3a')]);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0x1db94c)[_0xbd64('0x20')](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](function(_0x1e8e1c){if(_0x1e8e1c){var _0x3812b3=_0x1e8e1c[_0xbd64('0x22')]({'plain':!![]});_0x3812b3=qs['omit'](_0x3812b3,['id','createdAt',_0xbd64('0x4c')]);_0x371bad[_0xbd64('0x4d')]=_['omit'](_0x371bad['body'],['id',_0xbd64('0x4e'),_0xbd64('0x4c')]);return db['Campaign'][_0xbd64('0x42')](_[_0xbd64('0x38')](_0x3812b3,_0x371bad[_0xbd64('0x4d')]),{'include':_0x371bad[_0xbd64('0x2f')][_0xbd64('0x3b')]?[{'all':!![]}]:undefined})[_0xbd64('0x20')](function(_0x2d788){var _0x23e602=_0x371bad[_0xbd64('0x43')]['get']({'plain':!![]});if(!_0x23e602)throw new Error(_0xbd64('0x44'));if(_0x23e602[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x5054a6=_0x2d788[_0xbd64('0x22')]({'plain':!![]});var _0x39fae9='IvrCampaigns';return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x39fae9,'userProfileId':_0x23e602[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x3615bc){if(_0x3615bc&&_0x3615bc[_0xbd64('0x48')]===0x0){return db['UserProfileResource'][_0xbd64('0x42')]({'name':_0x5054a6[_0xbd64('0x25')],'resourceId':_0x5054a6['id'],'type':_0x3615bc[_0xbd64('0x25')],'sectionId':_0x3615bc['id']},{})[_0xbd64('0x20')](function(){return _0x2d788;});}else{return _0x2d788;}})['catch'](function(_0xff862e){logger[_0xbd64('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xff862e);throw _0xff862e;});}return _0x2d788;});}})[_0xbd64('0x20')](respondWithResult(_0x44cd4f,0xc9))['catch'](handleError(_0x44cd4f,null));};exports[_0xbd64('0x1f')]=function(_0x10e269,_0x1c10df){if(_0x10e269[_0xbd64('0x4d')]['id']){delete _0x10e269['body']['id'];}return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x10e269[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1c10df,null))[_0xbd64('0x20')](saveUpdates(_0x10e269[_0xbd64('0x4d')],null))['then'](respondWithResult(_0x1c10df,null))['catch'](handleError(_0x1c10df,null));};exports['destroy']=function(_0x36f3a8,_0xd1b21f){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x36f3a8[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0xd1b21f,null))['then'](removeEntity(_0xd1b21f,null))[_0xbd64('0x3e')](handleError(_0xd1b21f,null));};exports[_0xbd64('0x4f')]=function(_0x305ffc,_0x333720,_0x12f171){var _0x463105={'raw':!![],'where':{}};var _0x2f3516={};var _0x3d7e47={'count':0x0,'rows':[]};return db[_0xbd64('0x29')][_0xbd64('0x50')]({'where':{'id':_0x305ffc[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x333720,null))['then'](function(_0x5f16fd){if(_0x5f16fd){_0x2f3516[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db[_0xbd64('0x51')]['rawAttributes']);_0x2f3516[_0xbd64('0x2f')]=_['keys'](_0x305ffc[_0xbd64('0x2f')]);_0x2f3516[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2f3516[_0xbd64('0x2c')],_0x2f3516['query']);_0x463105[_0xbd64('0x31')]=_['intersection'](_0x2f3516[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x305ffc[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x463105[_0xbd64('0x31')]=_0x463105['attributes'][_0xbd64('0x32')]?_0x463105[_0xbd64('0x31')]:_0x2f3516['model'];if(!_0x305ffc[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x463105[_0xbd64('0x35')]=qs['limit'](_0x305ffc[_0xbd64('0x2f')]['limit']);_0x463105[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x305ffc[_0xbd64('0x2f')]['offset']);}_0x463105['order']=qs['sort'](_0x305ffc['query'][_0xbd64('0x52')]);_0x463105[_0xbd64('0x36')]=qs[_0xbd64('0x40')](_[_0xbd64('0x37')](_0x305ffc[_0xbd64('0x2f')],_0x2f3516['filters']));_0x463105[_0xbd64('0x36')][_0xbd64('0x53')]=_0x5f16fd['id'];if(_0x305ffc[_0xbd64('0x2f')][_0xbd64('0x39')]){_0x463105[_0xbd64('0x36')]=_['merge'](_0x463105[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x463105[_0xbd64('0x31')],function(_0x808467){var _0x5875da={};_0x5875da[_0x808467]={'$like':'%'+_0x305ffc['query'][_0xbd64('0x39')]+'%'};return _0x5875da;})});}_0x463105=_[_0xbd64('0x38')]({},_0x463105,_0x305ffc[_0xbd64('0x3a')]);return db[_0xbd64('0x51')][_0xbd64('0x1b')]({'where':_0x463105[_0xbd64('0x36')]})[_0xbd64('0x20')](function(_0x344285){_0x3d7e47['count']=_0x344285;if(_0x305ffc[_0xbd64('0x2f')]['includeAll']){_0x463105[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x51')][_0xbd64('0x3d')](_0x463105);})['then'](function(_0x15b625){_0x3d7e47['rows']=_0x15b625;return _0x3d7e47;});}})['then'](respondWithFilteredResult(_0x333720,_0x463105))[_0xbd64('0x3e')](handleError(_0x333720,null));};exports[_0xbd64('0x54')]=function(_0x448254,_0x5b5428,_0x364af8){var _0x3a34b7={'raw':!![],'where':{}};var _0x8150bb={};var _0x35cf6a={'count':0x0,'rows':[]};return db['Campaign'][_0xbd64('0x50')]({'where':{'id':_0x448254[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x5b5428,null))[_0xbd64('0x20')](function(_0x339e52){if(_0x339e52){_0x8150bb[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db[_0xbd64('0x55')][_0xbd64('0x2a')]);_0x8150bb[_0xbd64('0x2f')]=_[_0xbd64('0x2d')](_0x448254[_0xbd64('0x2f')]);_0x8150bb[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x8150bb['model'],_0x8150bb['query']);_0x3a34b7[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x8150bb[_0xbd64('0x2c')],qs['fields'](_0x448254[_0xbd64('0x2f')]['fields']));_0x3a34b7[_0xbd64('0x31')]=_0x3a34b7[_0xbd64('0x31')][_0xbd64('0x32')]?_0x3a34b7[_0xbd64('0x31')]:_0x8150bb['model'];if(!_0x448254[_0xbd64('0x2f')][_0xbd64('0x33')]('nolimit')){_0x3a34b7[_0xbd64('0x35')]=qs['limit'](_0x448254[_0xbd64('0x2f')][_0xbd64('0x35')]);_0x3a34b7[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x448254[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x3a34b7['order']=qs[_0xbd64('0x52')](_0x448254['query'][_0xbd64('0x52')]);_0x3a34b7[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x448254['query'],_0x8150bb[_0xbd64('0x40')]));_0x3a34b7[_0xbd64('0x36')][_0xbd64('0x53')]=_0x339e52['id'];if(_0x448254['query'][_0xbd64('0x39')]){_0x3a34b7[_0xbd64('0x36')]=_[_0xbd64('0x38')](_0x3a34b7[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x3a34b7['attributes'],function(_0x58efa2){var _0x42feee={};_0x42feee[_0x58efa2]={'$like':'%'+_0x448254[_0xbd64('0x2f')][_0xbd64('0x39')]+'%'};return _0x42feee;})});}_0x3a34b7=_[_0xbd64('0x38')]({},_0x3a34b7,_0x448254[_0xbd64('0x3a')]);return db[_0xbd64('0x55')][_0xbd64('0x1b')]({'where':_0x3a34b7[_0xbd64('0x36')]})[_0xbd64('0x20')](function(_0x4224c3){_0x35cf6a[_0xbd64('0x1b')]=_0x4224c3;if(_0x448254[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x3a34b7['include']=[{'all':!![]}];}return db[_0xbd64('0x55')][_0xbd64('0x3d')](_0x3a34b7);})['then'](function(_0x3a375c){_0x35cf6a[_0xbd64('0x56')]=_0x3a375c;return _0x35cf6a;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x5b5428,_0x3a34b7))[_0xbd64('0x3e')](handleError(_0x5b5428,null));};exports['getHopperFinals']=function(_0x5c6fc0,_0x25ce1e,_0x923e5a){var _0x7f4e70={'raw':!![],'where':{}};var _0x2af19c={};var _0x46a391={'count':0x0,'rows':[]};return db[_0xbd64('0x29')][_0xbd64('0x50')]({'where':{'id':_0x5c6fc0[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x25ce1e,null))[_0xbd64('0x20')](function(_0x1c5e0a){if(_0x1c5e0a){_0x2af19c[_0xbd64('0x2c')]=_['keys'](db[_0xbd64('0x57')][_0xbd64('0x2a')]);_0x2af19c[_0xbd64('0x2f')]=_['keys'](_0x5c6fc0['query']);_0x2af19c[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2af19c['model'],_0x2af19c[_0xbd64('0x2f')]);_0x7f4e70[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x2af19c[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x5c6fc0[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x7f4e70[_0xbd64('0x31')]=_0x7f4e70[_0xbd64('0x31')][_0xbd64('0x32')]?_0x7f4e70[_0xbd64('0x31')]:_0x2af19c[_0xbd64('0x2c')];if(!_0x5c6fc0['query'][_0xbd64('0x33')]('nolimit')){_0x7f4e70[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x5c6fc0[_0xbd64('0x2f')][_0xbd64('0x35')]);_0x7f4e70[_0xbd64('0x1c')]=qs['offset'](_0x5c6fc0[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x7f4e70[_0xbd64('0x58')]=qs[_0xbd64('0x52')](_0x5c6fc0['query'][_0xbd64('0x52')]);_0x7f4e70['where']=qs[_0xbd64('0x40')](_[_0xbd64('0x37')](_0x5c6fc0[_0xbd64('0x2f')],_0x2af19c[_0xbd64('0x40')]));_0x7f4e70[_0xbd64('0x36')][_0xbd64('0x53')]=_0x1c5e0a['id'];if(_0x5c6fc0[_0xbd64('0x2f')]['filter']){_0x7f4e70[_0xbd64('0x36')]=_[_0xbd64('0x38')](_0x7f4e70[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x7f4e70['attributes'],function(_0x38b2b3){var _0x232cca={};_0x232cca[_0x38b2b3]={'$like':'%'+_0x5c6fc0[_0xbd64('0x2f')][_0xbd64('0x39')]+'%'};return _0x232cca;})});}_0x7f4e70=_[_0xbd64('0x38')]({},_0x7f4e70,_0x5c6fc0[_0xbd64('0x3a')]);return db[_0xbd64('0x57')]['count']({'where':_0x7f4e70[_0xbd64('0x36')]})['then'](function(_0x168c17){_0x46a391['count']=_0x168c17;if(_0x5c6fc0['query'][_0xbd64('0x3b')]){_0x7f4e70[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x57')]['findAll'](_0x7f4e70);})[_0xbd64('0x20')](function(_0x49d6fe){_0x46a391[_0xbd64('0x56')]=_0x49d6fe;return _0x46a391;});}})['then'](respondWithFilteredResult(_0x25ce1e,_0x7f4e70))['catch'](handleError(_0x25ce1e,null));};exports[_0xbd64('0x59')]=function(_0x680b67,_0x30a8b4,_0x310ee4){var _0x34c941={'raw':!![],'where':{}};var _0x2e67e9={};var _0x2982c2={'count':0x0,'rows':[]};return db[_0xbd64('0x29')]['findOne']({'where':{'id':_0x680b67['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x30a8b4,null))['then'](function(_0x216dd1){if(_0x216dd1){_0x2e67e9[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['CmHopperBlack'][_0xbd64('0x2a')]);_0x2e67e9[_0xbd64('0x2f')]=_['keys'](_0x680b67[_0xbd64('0x2f')]);_0x2e67e9[_0xbd64('0x40')]=_['intersection'](_0x2e67e9['model'],_0x2e67e9[_0xbd64('0x2f')]);_0x34c941[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x2e67e9[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x680b67[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x34c941[_0xbd64('0x31')]=_0x34c941[_0xbd64('0x31')][_0xbd64('0x32')]?_0x34c941[_0xbd64('0x31')]:_0x2e67e9[_0xbd64('0x2c')];if(!_0x680b67[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x34c941['limit']=qs[_0xbd64('0x35')](_0x680b67['query'][_0xbd64('0x35')]);_0x34c941[_0xbd64('0x1c')]=qs['offset'](_0x680b67[_0xbd64('0x2f')]['offset']);}_0x34c941[_0xbd64('0x58')]=qs[_0xbd64('0x52')](_0x680b67[_0xbd64('0x2f')][_0xbd64('0x52')]);_0x34c941['where']=qs[_0xbd64('0x40')](_[_0xbd64('0x37')](_0x680b67[_0xbd64('0x2f')],_0x2e67e9[_0xbd64('0x40')]));_0x34c941['where']['CampaignId']=_0x216dd1['id'];if(_0x680b67[_0xbd64('0x2f')][_0xbd64('0x39')]){_0x34c941[_0xbd64('0x36')]=_['merge'](_0x34c941[_0xbd64('0x36')],{'$or':_['map'](_0x34c941[_0xbd64('0x31')],function(_0x1bde47){var _0x21b397={};_0x21b397[_0x1bde47]={'$like':'%'+_0x680b67[_0xbd64('0x2f')][_0xbd64('0x39')]+'%'};return _0x21b397;})});}_0x34c941=_['merge']({},_0x34c941,_0x680b67['options']);return db[_0xbd64('0x5a')][_0xbd64('0x1b')]({'where':_0x34c941[_0xbd64('0x36')]})['then'](function(_0x2c805b){_0x2982c2['count']=_0x2c805b;if(_0x680b67[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x34c941[_0xbd64('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xbd64('0x3d')](_0x34c941);})[_0xbd64('0x20')](function(_0x496475){_0x2982c2['rows']=_0x496475;return _0x2982c2;});}})[_0xbd64('0x20')](respondWithFilteredResult(_0x30a8b4,_0x34c941))['catch'](handleError(_0x30a8b4,null));};exports['getLists']=function(_0x1442ee,_0x237a8c,_0x4e3663){var _0xa932c3={};var _0x540513={};var _0x4011c5;var _0x1c999a;return db[_0xbd64('0x29')]['findOne']({'where':{'id':_0x1442ee[_0xbd64('0x3f')]['id']}})['then'](handleEntityNotFound(_0x237a8c,null))['then'](function(_0x4abd1b){if(_0x4abd1b){_0x4011c5=_0x4abd1b;_0x540513[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db[_0xbd64('0x5b')]['rawAttributes']);_0x540513[_0xbd64('0x2f')]=_['keys'](_0x1442ee[_0xbd64('0x2f')]);_0x540513['filters']=_['intersection'](_0x540513['model'],_0x540513[_0xbd64('0x2f')]);_0xa932c3[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x540513[_0xbd64('0x2c')],qs['fields'](_0x1442ee[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xa932c3[_0xbd64('0x31')]=_0xa932c3['attributes'][_0xbd64('0x32')]?_0xa932c3['attributes']:_0x540513[_0xbd64('0x2c')];_0xa932c3[_0xbd64('0x58')]=qs[_0xbd64('0x52')](_0x1442ee[_0xbd64('0x2f')][_0xbd64('0x52')]);_0xa932c3[_0xbd64('0x36')]=qs[_0xbd64('0x40')](_[_0xbd64('0x37')](_0x1442ee[_0xbd64('0x2f')],_0x540513[_0xbd64('0x40')]));if(_0x1442ee[_0xbd64('0x2f')][_0xbd64('0x39')]){_0xa932c3[_0xbd64('0x36')]=_['merge'](_0xa932c3['where'],{'$or':_[_0xbd64('0x28')](_0xa932c3[_0xbd64('0x31')],function(_0x424f0f){var _0x3275d4={};_0x3275d4[_0x424f0f]={'$like':'%'+_0x1442ee['query'][_0xbd64('0x39')]+'%'};return _0x3275d4;})});}_0xa932c3=_['merge']({},_0xa932c3,_0x1442ee[_0xbd64('0x3a')]);return _0x4011c5['getLists'](_0xa932c3);}})['then'](function(_0x421cd3){if(_0x421cd3){_0x1c999a=_0x421cd3[_0xbd64('0x32')];if(!_0x1442ee['query'][_0xbd64('0x33')]('nolimit')){_0xa932c3[_0xbd64('0x35')]=qs['limit'](_0x1442ee[_0xbd64('0x2f')][_0xbd64('0x35')]);_0xa932c3[_0xbd64('0x1c')]=qs['offset'](_0x1442ee[_0xbd64('0x2f')][_0xbd64('0x1c')]);}return _0x4011c5[_0xbd64('0x5c')](_0xa932c3);}})[_0xbd64('0x20')](function(_0x21a8e6){if(_0x21a8e6){return _0x21a8e6?{'count':_0x1c999a,'rows':_0x21a8e6}:null;}})[_0xbd64('0x20')](respondWithResult(_0x237a8c,null))[_0xbd64('0x3e')](handleError(_0x237a8c,null));};exports['addLists']=function(_0x2b21d0,_0x38ed53,_0x56e59e){var _0x497b8e,_0x5de03a;var _0x20182f=[];var _0x3f3d60=moment()[_0xbd64('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xbd64('0x29')]['find']({'where':{'id':_0x2b21d0[_0xbd64('0x3f')]['id']}})['then'](handleEntityNotFound(_0x38ed53,null))[_0xbd64('0x20')](function(_0x133cb4){if(_0x133cb4){_0x5de03a=_0x133cb4;return _0x133cb4[_0xbd64('0x5e')](_0x2b21d0[_0xbd64('0x4d')][_0xbd64('0x5f')],_[_0xbd64('0x60')](_0x2b21d0[_0xbd64('0x4d')],[_0xbd64('0x5f'),'id'])||{});}return null;})[_0xbd64('0x61')](function(_0x1e9882){var _0x3792f8;var _0x4d684d;_0x497b8e=_0x1e9882||[];var _0x168b3d=[];if(_0x1e9882){for(var _0x1dad77=0x0;_0x1dad77<_0x1e9882[_0xbd64('0x32')];_0x1dad77+=0x1){var _0x23fd87=_0x1e9882[_0x1dad77][_0xbd64('0x22')]({'plain':!![]});_0x5de03a[_0xbd64('0x62')]=_0x2b21d0[_0xbd64('0x4d')][_0xbd64('0x62')]?_0x2b21d0[_0xbd64('0x4d')]['dialCheckDuplicateType']:_0x5de03a['dialCheckDuplicateType'];switch(_0x5de03a[_0xbd64('0x62')]){case _0xbd64('0x63'):_0x3792f8=squel['insert']()[_0xbd64('0x64')](_0xbd64('0x65'))['fromQuery']([_0xbd64('0x66'),'scheduledAt',_0xbd64('0x67'),_0xbd64('0x68'),_0xbd64('0x53'),_0xbd64('0x4e'),_0xbd64('0x4c')],squel['select']()['field']('phone','phone')[_0xbd64('0x69')]('NOW()',_0xbd64('0x6a'))['field']('id','ContactId')[_0xbd64('0x69')](_0x23fd87[_0xbd64('0x6b')][_0xbd64('0x6c')](),_0xbd64('0x68'))[_0xbd64('0x69')](_0x2b21d0[_0xbd64('0x3f')]['id'][_0xbd64('0x6c')](),_0xbd64('0x53'))[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27',_0xbd64('0x4e'))[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27',_0xbd64('0x4c'))['from'](_0xbd64('0x6d'))[_0xbd64('0x36')](_0xbd64('0x6e'))[_0xbd64('0x36')](_0xbd64('0x6f'),_0x23fd87[_0xbd64('0x6b')]['toString']())[_0xbd64('0x36')](_0xbd64('0x70'))[_0xbd64('0x36')](_0xbd64('0x71'),squel['select']()[_0xbd64('0x69')](_0xbd64('0x72'))[_0xbd64('0x73')](_0xbd64('0x74'))['where'](_0xbd64('0x75'),_0x2b21d0['params']['id']['toString']()))['where'](_0xbd64('0x71'),squel[_0xbd64('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0xbd64('0x73')](_0xbd64('0x65'))[_0xbd64('0x36')](_0xbd64('0x75'),_0x2b21d0['params']['id']['toString']())))[_0xbd64('0x6c')]();break;case'onlyIfOpen':_0x3792f8=squel[_0xbd64('0x77')]()['into'](_0xbd64('0x65'))[_0xbd64('0x78')]([_0xbd64('0x66'),_0xbd64('0x6a'),'ContactId',_0xbd64('0x68'),_0xbd64('0x53'),_0xbd64('0x4e'),_0xbd64('0x4c')],squel['select']()[_0xbd64('0x69')](_0xbd64('0x66'),_0xbd64('0x66'))[_0xbd64('0x69')](_0xbd64('0x79'),_0xbd64('0x6a'))[_0xbd64('0x69')]('id',_0xbd64('0x67'))[_0xbd64('0x69')](_0x23fd87['CmListId']['toString'](),_0xbd64('0x68'))['field'](_0x2b21d0[_0xbd64('0x3f')]['id'][_0xbd64('0x6c')](),_0xbd64('0x53'))['field']('\x27'+_0x3f3d60+'\x27','createdAt')[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27',_0xbd64('0x4c'))[_0xbd64('0x73')](_0xbd64('0x6d'))[_0xbd64('0x36')](_0xbd64('0x6e'))[_0xbd64('0x36')](_0xbd64('0x6f'),_0x23fd87[_0xbd64('0x6b')]['toString']())['where'](_0xbd64('0x70'))[_0xbd64('0x36')](_0xbd64('0x71'),squel[_0xbd64('0x76')]()['field'](_0xbd64('0x7a'))['from'](_0xbd64('0x65'))['where'](_0xbd64('0x75'),_0x2b21d0['params']['id'][_0xbd64('0x6c')]())))[_0xbd64('0x6c')]();break;default:_0x3792f8=squel[_0xbd64('0x77')]()[_0xbd64('0x64')](_0xbd64('0x65'))[_0xbd64('0x78')](['phone',_0xbd64('0x6a'),'ContactId',_0xbd64('0x68'),'CampaignId','createdAt',_0xbd64('0x4c')],squel[_0xbd64('0x76')]()[_0xbd64('0x69')]('phone',_0xbd64('0x66'))[_0xbd64('0x69')](_0xbd64('0x79'),_0xbd64('0x6a'))[_0xbd64('0x69')]('id','ContactId')[_0xbd64('0x69')](_0x23fd87['CmListId']['toString'](),_0xbd64('0x68'))[_0xbd64('0x69')](_0x2b21d0[_0xbd64('0x3f')]['id'][_0xbd64('0x6c')](),_0xbd64('0x53'))[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27',_0xbd64('0x4e'))[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27',_0xbd64('0x4c'))[_0xbd64('0x73')](_0xbd64('0x6d'))['where'](_0xbd64('0x6e'))[_0xbd64('0x36')](_0xbd64('0x6f'),_0x23fd87[_0xbd64('0x6b')]['toString']())[_0xbd64('0x36')](_0xbd64('0x70')))['toString']();}_0x4d684d=squel['insert']()[_0xbd64('0x64')](_0xbd64('0x7b'))[_0xbd64('0x78')]([_0xbd64('0x7c'),_0xbd64('0x6a'),_0xbd64('0x66'),'OrderBy',_0xbd64('0x4e'),_0xbd64('0x4c')],squel[_0xbd64('0x76')]()[_0xbd64('0x69')]('h.id','id')[_0xbd64('0x69')]('NOW()',_0xbd64('0x6a'))[_0xbd64('0x69')](_0xbd64('0x7d'),_0xbd64('0x66'))['field'](_0xbd64('0x7e'),'OrderBy')[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27','createdAt')[_0xbd64('0x69')]('\x27'+_0x3f3d60+'\x27','updatedAt')[_0xbd64('0x73')](_0xbd64('0x7f'),'ci')['join'](_0xbd64('0x65'),'h',_0xbd64('0x80'))['where'](_0xbd64('0x81'),_0x23fd87[_0xbd64('0x6b')][_0xbd64('0x6c')]())['where'](_0xbd64('0x82'),_0x2b21d0[_0xbd64('0x3f')]['id'][_0xbd64('0x6c')]())['where'](_0xbd64('0x83'),_0x3f3d60))[_0xbd64('0x6c')]();_0x168b3d['push'](db['sequelize'][_0xbd64('0x2f')](_0x3792f8));_0x20182f['push'](db['sequelize'][_0xbd64('0x2f')](_0x4d684d));}return BPromise[_0xbd64('0x84')](_0x168b3d);}})[_0xbd64('0x20')](function(){return BPromise['all'](_0x20182f);})[_0xbd64('0x20')](function(){return _0x497b8e;})['then'](respondWithResult(_0x38ed53,null))[_0xbd64('0x3e')](handleError(_0x38ed53,null));};exports['removeLists']=function(_0x45f692,_0x1a899a,_0x4a2067){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x45f692[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1a899a,null))[_0xbd64('0x20')](function(_0x415a60){if(_0x415a60){return _0x415a60['removeLists'](_0x45f692[_0xbd64('0x2f')][_0xbd64('0x5f')]);}})[_0xbd64('0x20')](function(_0x1a1bce){if(_0x1a1bce){return db[_0xbd64('0x51')][_0xbd64('0x21')]({'where':{'ListId':_0x45f692['query']['ids'],'CampaignId':_0x45f692[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](function(){return _0x1a1bce;});}})[_0xbd64('0x20')](respondWithStatusCode(_0x1a899a,null))['catch'](handleError(_0x1a899a,null));};exports[_0xbd64('0x85')]=function(_0x2ab4d7,_0x3067fa,_0x3a35ad){var _0xa573d0={};var _0x46c4a4={};var _0x5a0256;var _0x55170c;return db[_0xbd64('0x29')][_0xbd64('0x50')]({'where':{'id':_0x2ab4d7[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x3067fa,null))['then'](function(_0x4e7e3a){if(_0x4e7e3a){_0x5a0256=_0x4e7e3a;_0x46c4a4['model']=_[_0xbd64('0x2d')](db['CmList'][_0xbd64('0x2a')]);_0x46c4a4[_0xbd64('0x2f')]=_[_0xbd64('0x2d')](_0x2ab4d7['query']);_0x46c4a4[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x46c4a4[_0xbd64('0x2c')],_0x46c4a4[_0xbd64('0x2f')]);_0xa573d0[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x46c4a4[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x2ab4d7[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xa573d0[_0xbd64('0x31')]=_0xa573d0[_0xbd64('0x31')][_0xbd64('0x32')]?_0xa573d0['attributes']:_0x46c4a4[_0xbd64('0x2c')];_0xa573d0['order']=qs[_0xbd64('0x52')](_0x2ab4d7[_0xbd64('0x2f')][_0xbd64('0x52')]);_0xa573d0[_0xbd64('0x36')]=qs[_0xbd64('0x40')](_[_0xbd64('0x37')](_0x2ab4d7['query'],_0x46c4a4['filters']));if(_0x2ab4d7['query']['filter']){_0xa573d0[_0xbd64('0x36')]=_[_0xbd64('0x38')](_0xa573d0[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xa573d0[_0xbd64('0x31')],function(_0x35d11f){var _0x46b0dd={};_0x46b0dd[_0x35d11f]={'$like':'%'+_0x2ab4d7[_0xbd64('0x2f')]['filter']+'%'};return _0x46b0dd;})});}_0xa573d0=_[_0xbd64('0x38')]({},_0xa573d0,_0x2ab4d7[_0xbd64('0x3a')]);return _0x5a0256['getBlackLists'](_0xa573d0);}})[_0xbd64('0x20')](function(_0x41294f){if(_0x41294f){_0x55170c=_0x41294f[_0xbd64('0x32')];if(!_0x2ab4d7[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0xa573d0[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x2ab4d7[_0xbd64('0x2f')][_0xbd64('0x35')]);_0xa573d0[_0xbd64('0x1c')]=qs['offset'](_0x2ab4d7[_0xbd64('0x2f')][_0xbd64('0x1c')]);}return _0x5a0256[_0xbd64('0x85')](_0xa573d0);}})['then'](function(_0x216268){if(_0x216268){return _0x216268?{'count':_0x55170c,'rows':_0x216268}:null;}})['then'](respondWithResult(_0x3067fa,null))[_0xbd64('0x3e')](handleError(_0x3067fa,null));};exports[_0xbd64('0x86')]=function(_0x2e0988,_0x5e85b7,_0x52215e){var _0x33a01c,_0x452ff6;var _0x53fcb0=[];var _0xf28e24=moment()['format'](_0xbd64('0x87'));return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x2e0988[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x5e85b7,null))[_0xbd64('0x20')](function(_0x476e9e){if(_0x476e9e){_0x452ff6=_0x476e9e;return _0x476e9e[_0xbd64('0x86')](_0x2e0988[_0xbd64('0x4d')][_0xbd64('0x5f')],_['omit'](_0x2e0988['body'],[_0xbd64('0x5f'),'id'])||{});}return null;})[_0xbd64('0x61')](function(_0x54379f){var _0x1b88aa;var _0xeaaf4d;_0x33a01c=_0x54379f||[];var _0x136a6d=[];if(_0x54379f){for(var _0x39fb65=0x0;_0x39fb65<_0x54379f['length'];_0x39fb65+=0x1){var _0x24793e=_0x54379f[_0x39fb65][_0xbd64('0x22')]({'plain':!![]});_0x1b88aa=squel[_0xbd64('0x77')]()['into']('cm_hopper_black')[_0xbd64('0x78')]([_0xbd64('0x66'),_0xbd64('0x67'),'ListId',_0xbd64('0x53'),'createdAt',_0xbd64('0x4c')],squel['select']()[_0xbd64('0x69')]('phone',_0xbd64('0x66'))[_0xbd64('0x69')]('id',_0xbd64('0x67'))[_0xbd64('0x69')](_0x24793e['CmListId'][_0xbd64('0x6c')](),_0xbd64('0x68'))[_0xbd64('0x69')](_0x2e0988[_0xbd64('0x3f')]['id'][_0xbd64('0x6c')](),_0xbd64('0x53'))[_0xbd64('0x69')](_0xbd64('0x79'),_0xbd64('0x4e'))[_0xbd64('0x69')](_0xbd64('0x79'),'updatedAt')[_0xbd64('0x73')](_0xbd64('0x6d'))['where']('deletedAt\x20IS\x20NULL')[_0xbd64('0x36')](_0xbd64('0x6f'),_0x24793e['CmListId'][_0xbd64('0x6c')]())[_0xbd64('0x36')](_0xbd64('0x70')))['toString']();_0x136a6d[_0xbd64('0x88')](db[_0xbd64('0x89')]['query'](_0x1b88aa));}return BPromise[_0xbd64('0x84')](_0x136a6d);}})[_0xbd64('0x20')](function(){return _0x33a01c;})[_0xbd64('0x20')](respondWithResult(_0x5e85b7,null))[_0xbd64('0x3e')](handleError(_0x5e85b7,null));};exports[_0xbd64('0x8a')]=function(_0x2e5437,_0x1d759c,_0x171d75){return db[_0xbd64('0x29')]['find']({'where':{'id':_0x2e5437['params']['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1d759c,null))['then'](function(_0x2acfac){if(_0x2acfac){return _0x2acfac['removeBlackLists'](_0x2e5437[_0xbd64('0x2f')]['ids']);}})[_0xbd64('0x20')](function(_0x42f9f8){if(_0x42f9f8){return db['CmHopperBlack'][_0xbd64('0x21')]({'where':{'ListId':_0x2e5437[_0xbd64('0x2f')][_0xbd64('0x5f')],'CampaignId':_0x2e5437[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](function(){return _0x42f9f8;});}})[_0xbd64('0x20')](respondWithStatusCode(_0x1d759c,null))[_0xbd64('0x3e')](handleError(_0x1d759c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 80b1115..4856fed 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 92bcd27..d5fe382 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 _0x6c76=['moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','map','include','model','GetCampaign','debug','lodash','util'];(function(_0x4f2498,_0x6428e1){var _0xe9a958=function(_0x174154){while(--_0x174154){_0x4f2498['push'](_0x4f2498['shift']());}};_0xe9a958(++_0x6428e1);}(_0x6c76,0x184));var _0x66c7=function(_0x278ba9,_0x40e96d){_0x278ba9=_0x278ba9-0x0;var _0x1ca3d0=_0x6c76[_0x278ba9];return _0x1ca3d0;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Campaign,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Campaign,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Campaign,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetCampaign']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['Campaign'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});}; \ No newline at end of file +var _0xd240=['include','map','model','stringify','GetCampaign','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','findAll','options','where','attributes','limit'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xd240,0x1c7));var _0x0d24=function(_0x37b94c,_0x243d65){_0x37b94c=_0x37b94c-0x0;var _0x3f9746=_0xd240[_0x37b94c];return _0x3f9746;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d24('0x1'));var fs=require('fs');var Redis=require(_0x0d24('0x2'));var db=require(_0x0d24('0x3'))['db'];var utils=require(_0x0d24('0x4'));var logger=require(_0x0d24('0x5'))(_0x0d24('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d24('0x7')][_0x0d24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1005ff,_0x250141,_0x48fb91){return new BPromise(function(_0xdb2d81,_0x2fdf4a){return client[_0x0d24('0x9')](_0x1005ff,_0x48fb91)[_0x0d24('0xa')](function(_0x58b925){logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,'request\x20sent');logger[_0x0d24('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x250141,_0x0d24('0xe'),JSON['stringify'](_0x58b925));if(_0x58b925[_0x0d24('0xf')]){if(_0x58b925[_0x0d24('0xf')][_0x0d24('0x10')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x250141,_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);return _0x2fdf4a(_0x58b925[_0x0d24('0xf')]['message']);}logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x58b925['error']['message']);return _0xdb2d81(_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);}else{logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,_0x0d24('0xe'));_0xdb2d81(_0x58b925[_0x0d24('0x12')][_0x0d24('0x11')]);}})[_0x0d24('0x13')](function(_0x47ee4b){logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x47ee4b);_0x2fdf4a(_0x47ee4b);});});}exports['GetCampaign']=function(_0xacfbd6){var _0x1c5899=this;return new Promise(function(_0x12204f,_0x151030){return db['Campaign'][_0x0d24('0x14')]({'raw':_0xacfbd6[_0x0d24('0x15')]?_0xacfbd6['options']['raw']===undefined?!![]:![]:!![],'where':_0xacfbd6[_0x0d24('0x15')]?_0xacfbd6[_0x0d24('0x15')][_0x0d24('0x16')]||null:null,'attributes':_0xacfbd6[_0x0d24('0x15')]?_0xacfbd6[_0x0d24('0x15')][_0x0d24('0x17')]||null:null,'limit':_0xacfbd6[_0x0d24('0x15')]?_0xacfbd6[_0x0d24('0x15')][_0x0d24('0x18')]||null:null,'include':_0xacfbd6['options']?_0xacfbd6[_0x0d24('0x15')][_0x0d24('0x19')]?_[_0x0d24('0x1a')](_0xacfbd6[_0x0d24('0x15')]['include'],function(_0x23440c){return{'model':db[_0x23440c[_0x0d24('0x1b')]],'as':_0x23440c['as'],'attributes':_0x23440c[_0x0d24('0x17')],'include':_0x23440c['include']?_[_0x0d24('0x1a')](_0x23440c[_0x0d24('0x19')],function(_0x425dd2){return{'model':db[_0x425dd2['model']],'as':_0x425dd2['as'],'attributes':_0x425dd2[_0x0d24('0x17')],'include':_0x425dd2[_0x0d24('0x19')]?_[_0x0d24('0x1a')](_0x425dd2['include'],function(_0x2226d6){return{'model':db[_0x2226d6[_0x0d24('0x1b')]],'as':_0x2226d6['as'],'attributes':_0x2226d6[_0x0d24('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0d24('0xa')](function(_0x2b472a){logger[_0x0d24('0xb')]('GetCampaign',_0xacfbd6);logger['debug']('GetCampaign',_0xacfbd6,JSON[_0x0d24('0x1c')](_0x2b472a));_0x12204f(_0x2b472a);})[_0x0d24('0x13')](function(_0x1a1ef7){logger[_0x0d24('0xf')](_0x0d24('0x1d'),_0x1a1ef7[_0x0d24('0x11')],_0xacfbd6);_0x151030(_0x1c5899[_0x0d24('0xf')](0x1f4,_0x1a1ef7[_0x0d24('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b88b3b8..eb581a9 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 _0x5136=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','put','update','delete','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x26e0a1,_0x3de1ec){var _0x1e77d9=function(_0xb982e){while(--_0xb982e){_0x26e0a1['push'](_0x26e0a1['shift']());}};_0x1e77d9(++_0x3de1ec);}(_0x5136,0x73));var _0x6513=function(_0x279985,_0xe00898){_0x279985=_0x279985-0x0;var _0x2f5a74=_0x5136[_0x279985];return _0x2f5a74;};'use strict';var multer=require(_0x6513('0x0'));var util=require(_0x6513('0x1'));var path=require(_0x6513('0x2'));var timeout=require('connect-timeout');var express=require(_0x6513('0x3'));var router=express[_0x6513('0x4')]();var fs_extra=require(_0x6513('0x5'));var auth=require(_0x6513('0x6'));var interaction=require(_0x6513('0x7'));var config=require('../../config/environment');var controller=require(_0x6513('0x8'));router[_0x6513('0x9')]('/',auth['isAuthenticated'](),controller[_0x6513('0xa')]);router[_0x6513('0x9')](_0x6513('0xb'),auth[_0x6513('0xc')](),controller[_0x6513('0xd')]);router['get'](_0x6513('0xe'),auth[_0x6513('0xc')](),controller[_0x6513('0xf')]);router['get'](_0x6513('0x10'),auth[_0x6513('0xc')](),controller[_0x6513('0x11')]);router[_0x6513('0x9')]('/:id/hopper_finals',auth[_0x6513('0xc')](),controller[_0x6513('0x12')]);router['get'](_0x6513('0x13'),auth['isAuthenticated'](),controller[_0x6513('0x14')]);router[_0x6513('0x9')](_0x6513('0x15'),auth[_0x6513('0xc')](),controller[_0x6513('0x16')]);router[_0x6513('0x9')]('/:id/blacklists',auth[_0x6513('0xc')](),controller[_0x6513('0x17')]);router[_0x6513('0x18')]('/',auth['isAuthenticated'](),controller[_0x6513('0x19')]);router['post']('/:id/clone',auth[_0x6513('0xc')](),controller['clone']);router[_0x6513('0x18')](_0x6513('0x15'),auth[_0x6513('0xc')](),controller['addLists']);router[_0x6513('0x18')]('/:id/blacklists',auth[_0x6513('0xc')](),controller['addBlackLists']);router[_0x6513('0x1a')](_0x6513('0xb'),auth[_0x6513('0xc')](),controller[_0x6513('0x1b')]);router[_0x6513('0x1c')](_0x6513('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/lists',auth[_0x6513('0xc')](),controller[_0x6513('0x1d')]);router[_0x6513('0x1c')](_0x6513('0x1e'),auth[_0x6513('0xc')](),controller[_0x6513('0x1f')]);module[_0x6513('0x20')]=router; \ No newline at end of file +var _0xa67b=['get','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addBlackLists','put','update','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index'];(function(_0x32efdb,_0x56e38d){var _0x3c9575=function(_0x2ce5bf){while(--_0x2ce5bf){_0x32efdb['push'](_0x32efdb['shift']());}};_0x3c9575(++_0x56e38d);}(_0xa67b,0x14a));var _0xba67=function(_0x37af47,_0x401a25){_0x37af47=_0x37af47-0x0;var _0x43d015=_0xa67b[_0x37af47];return _0x43d015;};'use strict';var multer=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var path=require(_0xba67('0x2'));var timeout=require(_0xba67('0x3'));var express=require(_0xba67('0x4'));var router=express[_0xba67('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba67('0x6'));var interaction=require(_0xba67('0x7'));var config=require('../../config/environment');var controller=require(_0xba67('0x8'));router['get']('/',auth[_0xba67('0x9')](),controller[_0xba67('0xa')]);router[_0xba67('0xb')](_0xba67('0xc'),auth[_0xba67('0x9')](),controller[_0xba67('0xd')]);router[_0xba67('0xb')](_0xba67('0xe'),auth[_0xba67('0x9')](),controller['getHoppers']);router['get'](_0xba67('0xf'),auth[_0xba67('0x9')](),controller['getHopperHistories']);router[_0xba67('0xb')](_0xba67('0x10'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xba67('0xb')]('/:id/hopper_black',auth[_0xba67('0x9')](),controller[_0xba67('0x11')]);router[_0xba67('0xb')](_0xba67('0x12'),auth[_0xba67('0x9')](),controller[_0xba67('0x13')]);router['get'](_0xba67('0x14'),auth['isAuthenticated'](),controller[_0xba67('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba67('0x16')]);router[_0xba67('0x17')]('/:id/clone',auth['isAuthenticated'](),controller[_0xba67('0x18')]);router['post'](_0xba67('0x12'),auth[_0xba67('0x9')](),controller['addLists']);router[_0xba67('0x17')](_0xba67('0x14'),auth[_0xba67('0x9')](),controller[_0xba67('0x19')]);router[_0xba67('0x1a')](_0xba67('0xc'),auth['isAuthenticated'](),controller[_0xba67('0x1b')]);router['delete']('/:id',auth[_0xba67('0x9')](),controller['destroy']);router[_0xba67('0x1c')](_0xba67('0x12'),auth[_0xba67('0x9')](),controller['removeLists']);router['delete'](_0xba67('0x14'),auth['isAuthenticated'](),controller[_0xba67('0x1d')]);module[_0xba67('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e1d08ac..daefa27 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 _0x1b72=['VIRTUAL','getDataValue','sequelize','STRING','TEXT','medium'];(function(_0x138387,_0x2a16ac){var _0x45b15a=function(_0x37f412){while(--_0x37f412){_0x138387['push'](_0x138387['shift']());}};_0x45b15a(++_0x2a16ac);}(_0x1b72,0x17c));var _0x21b7=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1b72[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x21b7('0x0'));module['exports']={'key':{'type':Sequelize[_0x21b7('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x21b7('0x2')],'length':_0x21b7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x21b7('0x1')]},'name':{'type':Sequelize[_0x21b7('0x4')],'get':function(){return this[_0x21b7('0x5')]('key');}}}; \ No newline at end of file +var _0x90ea=['medium','VIRTUAL','sequelize','exports','STRING','TEXT'];(function(_0x7a4a03,_0x91417c){var _0xfe0c7a=function(_0x2bbf81){while(--_0x2bbf81){_0x7a4a03['push'](_0x7a4a03['shift']());}};_0xfe0c7a(++_0x91417c);}(_0x90ea,0x80));var _0xa90e=function(_0x532421,_0x3a77fd){_0x532421=_0x532421-0x0;var _0x1ed7db=_0x90ea[_0x532421];return _0x1ed7db;};'use strict';var Sequelize=require(_0xa90e('0x0'));module[_0xa90e('0x1')]={'key':{'type':Sequelize[_0xa90e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa90e('0x3')],'length':_0xa90e('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa90e('0x5')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1f26ec5..ab62fa1 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 _0xb5d9=['length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','util','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/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','CannedAnswer','findAll','catch','show','params','rawAttributes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb5d9,0x67));var _0x9b5d=function(_0x5a2bd9,_0x1c9de9){_0x5a2bd9=_0x5a2bd9-0x0;var _0x370032=_0xb5d9[_0x5a2bd9];return _0x370032;};'use strict';var emlformat=require(_0x9b5d('0x0'));var rimraf=require(_0x9b5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b5d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b5d('0x3'));var Mustache=require('mustache');var util=require(_0x9b5d('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9b5d('0x5'));var ejs=require(_0x9b5d('0x6'));var fs=require('fs');var fs_extra=require(_0x9b5d('0x7'));var _=require(_0x9b5d('0x8'));var squel=require(_0x9b5d('0x9'));var crypto=require(_0x9b5d('0xa'));var jsforce=require(_0x9b5d('0xb'));var deskjs=require(_0x9b5d('0xc'));var toCsv=require(_0x9b5d('0x5'));var querystring=require('querystring');var Papa=require(_0x9b5d('0xd'));var Redis=require(_0x9b5d('0xe'));var authService=require(_0x9b5d('0xf'));var qs=require(_0x9b5d('0x10'));var as=require(_0x9b5d('0x11'));var hardwareService=require(_0x9b5d('0x12'));var logger=require(_0x9b5d('0x13'))(_0x9b5d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b5d('0x15'));var db=require(_0x9b5d('0x16'))['db'];function respondWithStatusCode(_0x5b9fa3,_0x579b16){_0x579b16=_0x579b16||0xcc;return function(_0x104181){if(_0x104181){return _0x5b9fa3['sendStatus'](_0x579b16);}return _0x5b9fa3[_0x9b5d('0x17')](_0x579b16)[_0x9b5d('0x18')]();};}function respondWithResult(_0x4fba68,_0x8daeea){_0x8daeea=_0x8daeea||0xc8;return function(_0x5158b2){if(_0x5158b2){return _0x4fba68[_0x9b5d('0x17')](_0x8daeea)[_0x9b5d('0x19')](_0x5158b2);}};}function respondWithFilteredResult(_0x531d18,_0x4f30b8){return function(_0x36b8fe){if(_0x36b8fe){var _0x4dd9f6=typeof _0x4f30b8['offset']===_0x9b5d('0x1a')&&typeof _0x4f30b8[_0x9b5d('0x1b')]===_0x9b5d('0x1a');var _0x1c4a00=_0x36b8fe[_0x9b5d('0x1c')];var _0x19520b=_0x4dd9f6?0x0:_0x4f30b8[_0x9b5d('0x1d')];var _0xfb7de8=_0x4dd9f6?_0x36b8fe[_0x9b5d('0x1c')]:_0x4f30b8[_0x9b5d('0x1d')]+_0x4f30b8[_0x9b5d('0x1b')];var _0x57d96d;if(_0xfb7de8>=_0x1c4a00){_0xfb7de8=_0x1c4a00;_0x57d96d=0xc8;}else{_0x57d96d=0xce;}_0x531d18[_0x9b5d('0x17')](_0x57d96d);return _0x531d18[_0x9b5d('0x1e')](_0x9b5d('0x1f'),_0x19520b+'-'+_0xfb7de8+'/'+_0x1c4a00)[_0x9b5d('0x19')](_0x36b8fe);}return null;};}function patchUpdates(_0x53b774){return function(_0x279792){try{jsonpatch[_0x9b5d('0x20')](_0x279792,_0x53b774,!![]);}catch(_0x5b842e){return BPromise['reject'](_0x5b842e);}return _0x279792[_0x9b5d('0x21')]();};}function saveUpdates(_0x4b0cec,_0x19e449){return function(_0x3e48f7){if(_0x3e48f7){return _0x3e48f7[_0x9b5d('0x22')](_0x4b0cec)[_0x9b5d('0x23')](function(_0x3561dc){return _0x3561dc;});}return null;};}function removeEntity(_0x28ae69,_0x390987){return function(_0x32f160){if(_0x32f160){return _0x32f160[_0x9b5d('0x24')]()[_0x9b5d('0x23')](function(){var _0x331e72=_0x32f160[_0x9b5d('0x25')]({'plain':!![]});var _0xf63c13='CannedAnswers';return db[_0x9b5d('0x26')][_0x9b5d('0x24')]({'where':{'type':_0xf63c13,'resourceId':_0x331e72['id']}})[_0x9b5d('0x23')](function(){return _0x32f160;});})[_0x9b5d('0x23')](function(){_0x28ae69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10a553,_0x411b22){return function(_0x4cda24){if(!_0x4cda24){_0x10a553[_0x9b5d('0x27')](0x194);}return _0x4cda24;};}function handleError(_0x5620ee,_0x3a5ca6){_0x3a5ca6=_0x3a5ca6||0x1f4;return function(_0x2fff17){logger['error'](_0x2fff17[_0x9b5d('0x28')]);if(_0x2fff17[_0x9b5d('0x29')]){delete _0x2fff17[_0x9b5d('0x29')];}_0x5620ee[_0x9b5d('0x17')](_0x3a5ca6)[_0x9b5d('0x2a')](_0x2fff17);};}exports[_0x9b5d('0x2b')]=function(_0x399510,_0x40e885){var _0x62acad={},_0x2685da={},_0x15d75a={'count':0x0,'rows':[]};var _0x2c45f4=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x4a7713){return{'name':_0x4a7713[_0x9b5d('0x2c')],'type':_0x4a7713[_0x9b5d('0x2d')]['key']};});_0x2685da['model']=_[_0x9b5d('0x2e')](_0x2c45f4,_0x9b5d('0x29'));_0x2685da[_0x9b5d('0x2f')]=_[_0x9b5d('0x30')](_0x399510['query']);_0x2685da[_0x9b5d('0x31')]=_[_0x9b5d('0x32')](_0x2685da[_0x9b5d('0x33')],_0x2685da[_0x9b5d('0x2f')]);_0x62acad[_0x9b5d('0x34')]=_[_0x9b5d('0x32')](_0x2685da[_0x9b5d('0x33')],qs[_0x9b5d('0x35')](_0x399510[_0x9b5d('0x2f')]['fields']));_0x62acad[_0x9b5d('0x34')]=_0x62acad[_0x9b5d('0x34')]['length']?_0x62acad[_0x9b5d('0x34')]:_0x2685da['model'];if(!_0x399510[_0x9b5d('0x2f')][_0x9b5d('0x36')](_0x9b5d('0x37'))){_0x62acad[_0x9b5d('0x1b')]=qs[_0x9b5d('0x1b')](_0x399510['query'][_0x9b5d('0x1b')]);_0x62acad[_0x9b5d('0x1d')]=qs[_0x9b5d('0x1d')](_0x399510[_0x9b5d('0x2f')][_0x9b5d('0x1d')]);}_0x62acad['order']=qs[_0x9b5d('0x38')](_0x399510['query'][_0x9b5d('0x38')]);_0x62acad[_0x9b5d('0x39')]=qs['filters'](_[_0x9b5d('0x3a')](_0x399510[_0x9b5d('0x2f')],_0x2685da[_0x9b5d('0x31')]),_0x2c45f4);if(_0x399510[_0x9b5d('0x2f')][_0x9b5d('0x3b')]){_0x62acad[_0x9b5d('0x39')]=_[_0x9b5d('0x3c')](_0x62acad['where'],{'$or':[{'key':{'$like':'%'+_0x399510['query'][_0x9b5d('0x3b')]+'%'}},{'value':{'$like':'%'+_0x399510['query'][_0x9b5d('0x3b')]+'%'}}]});}_0x62acad=_[_0x9b5d('0x3c')]({},_0x62acad,_0x399510['options']);var _0x18c5af={'where':_0x62acad[_0x9b5d('0x39')]};return db['CannedAnswer'][_0x9b5d('0x1c')](_0x18c5af)[_0x9b5d('0x23')](function(_0x32ef0d){_0x15d75a[_0x9b5d('0x1c')]=_0x32ef0d;if(_0x399510[_0x9b5d('0x2f')][_0x9b5d('0x3d')]){_0x62acad[_0x9b5d('0x3e')]=[{'all':!![]}];}return db[_0x9b5d('0x3f')][_0x9b5d('0x40')](_0x62acad);})['then'](function(_0xf9d1c8){_0x15d75a['rows']=_0xf9d1c8;return _0x15d75a;})[_0x9b5d('0x23')](respondWithFilteredResult(_0x40e885,_0x62acad))[_0x9b5d('0x41')](handleError(_0x40e885,null));};exports[_0x9b5d('0x42')]=function(_0x1e70b0,_0x226ea7){var _0x2eab9a={'raw':!![],'where':{'id':_0x1e70b0[_0x9b5d('0x43')]['id']}},_0x5ef870={};_0x5ef870['model']=_['keys'](db[_0x9b5d('0x3f')][_0x9b5d('0x44')]);_0x5ef870['query']=_[_0x9b5d('0x30')](_0x1e70b0[_0x9b5d('0x2f')]);_0x5ef870['filters']=_['intersection'](_0x5ef870[_0x9b5d('0x33')],_0x5ef870['query']);_0x2eab9a[_0x9b5d('0x34')]=_[_0x9b5d('0x32')](_0x5ef870[_0x9b5d('0x33')],qs[_0x9b5d('0x35')](_0x1e70b0[_0x9b5d('0x2f')][_0x9b5d('0x35')]));_0x2eab9a['attributes']=_0x2eab9a[_0x9b5d('0x34')][_0x9b5d('0x45')]?_0x2eab9a[_0x9b5d('0x34')]:_0x5ef870['model'];if(_0x1e70b0[_0x9b5d('0x2f')][_0x9b5d('0x3d')]){_0x2eab9a[_0x9b5d('0x3e')]=[{'all':!![]}];}_0x2eab9a=_['merge']({},_0x2eab9a,_0x1e70b0['options']);return db[_0x9b5d('0x3f')][_0x9b5d('0x46')](_0x2eab9a)[_0x9b5d('0x23')](handleEntityNotFound(_0x226ea7,null))[_0x9b5d('0x23')](respondWithResult(_0x226ea7,null))[_0x9b5d('0x41')](handleError(_0x226ea7,null));};exports[_0x9b5d('0x22')]=function(_0x12c37f,_0x5b3d7a){if(_0x12c37f[_0x9b5d('0x47')]['id']){delete _0x12c37f[_0x9b5d('0x47')]['id'];}return db[_0x9b5d('0x3f')]['find']({'where':{'id':_0x12c37f['params']['id']}})[_0x9b5d('0x23')](handleEntityNotFound(_0x5b3d7a,null))['then'](saveUpdates(_0x12c37f[_0x9b5d('0x47')],null))[_0x9b5d('0x23')](respondWithResult(_0x5b3d7a,null))[_0x9b5d('0x41')](handleError(_0x5b3d7a,null));};exports[_0x9b5d('0x24')]=function(_0x527a0b,_0x47765c){return db[_0x9b5d('0x3f')][_0x9b5d('0x46')]({'where':{'id':_0x527a0b[_0x9b5d('0x43')]['id']}})[_0x9b5d('0x23')](handleEntityNotFound(_0x47765c,null))[_0x9b5d('0x23')](removeEntity(_0x47765c,null))['catch'](handleError(_0x47765c,null));};exports[_0x9b5d('0x48')]=function(_0x42f41c,_0x2a01f2){var _0x429c15={'key':_0x42f41c['body']['key']};if(_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x49')]){_0x429c15[_0x9b5d('0x49')]=_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x49')];}else if(_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x4a')]){_0x429c15['SmsAccountId']=_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x4a')];}else if(_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x4b')]){_0x429c15[_0x9b5d('0x4b')]=_0x42f41c['body']['OpenchannelAccountId'];}else if(_0x42f41c[_0x9b5d('0x47')]['ChatWebsiteId']){_0x429c15['ChatWebsiteId']=_0x42f41c[_0x9b5d('0x47')][_0x9b5d('0x4c')];}return db[_0x9b5d('0x3f')][_0x9b5d('0x46')]({'where':_0x429c15})['then'](function(_0x4e40aa){if(_0x4e40aa){throw new db[(_0x9b5d('0x4d'))][(_0x9b5d('0x4e'))](_0x9b5d('0x4f'));}return db['CannedAnswer']['create'](_0x42f41c['body']);})[_0x9b5d('0x23')](function(_0x3893c0){var _0x1c6a9d=_0x42f41c[_0x9b5d('0x50')][_0x9b5d('0x25')]({'plain':!![]});if(!_0x1c6a9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c6a9d[_0x9b5d('0x51')]===_0x9b5d('0x50')){var _0x732020=_0x3893c0['get']({'plain':!![]});return db['UserProfileSection'][_0x9b5d('0x46')]({'where':{'name':_0x9b5d('0x52'),'userProfileId':_0x1c6a9d[_0x9b5d('0x53')]},'raw':!![]})['then'](function(_0x5bfa82){if(_0x5bfa82&&_0x5bfa82[_0x9b5d('0x54')]===0x0){return db[_0x9b5d('0x26')][_0x9b5d('0x48')]({'name':_0x732020[_0x9b5d('0x29')],'resourceId':_0x732020['id'],'type':_0x5bfa82[_0x9b5d('0x29')],'sectionId':_0x5bfa82['id']},{})[_0x9b5d('0x23')](function(){return _0x3893c0;});}else{return _0x3893c0;}})[_0x9b5d('0x41')](function(_0x5b5af0){logger['error'](_0x9b5d('0x55'),_0x5b5af0);throw _0x5b5af0;});}return _0x3893c0;})[_0x9b5d('0x23')](respondWithResult(_0x2a01f2,0xc9))[_0x9b5d('0x41')](handleError(_0x2a01f2,null));}; \ No newline at end of file +var _0xa78b=['CannedAnswers','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','CannedAnswer','include','findAll','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get'];(function(_0x2ed0ef,_0x6e9249){var _0x3b9f19=function(_0x5ae518){while(--_0x5ae518){_0x2ed0ef['push'](_0x2ed0ef['shift']());}};_0x3b9f19(++_0x6e9249);}(_0xa78b,0x17f));var _0xba78=function(_0x1e3ac7,_0x2ddc83){_0x1e3ac7=_0x1e3ac7-0x0;var _0x53694b=_0xa78b[_0x1e3ac7];return _0x53694b;};'use strict';var emlformat=require(_0xba78('0x0'));var rimraf=require(_0xba78('0x1'));var zipdir=require(_0xba78('0x2'));var jsonpatch=require(_0xba78('0x3'));var rp=require(_0xba78('0x4'));var moment=require('moment');var BPromise=require(_0xba78('0x5'));var Mustache=require(_0xba78('0x6'));var util=require(_0xba78('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xba78('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba78('0x9'));var _=require(_0xba78('0xa'));var squel=require(_0xba78('0xb'));var crypto=require('crypto');var jsforce=require(_0xba78('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba78('0xd'));var Papa=require(_0xba78('0xe'));var Redis=require('ioredis');var authService=require(_0xba78('0xf'));var qs=require(_0xba78('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba78('0x11'));var logger=require(_0xba78('0x12'))(_0xba78('0x13'));var utils=require(_0xba78('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xba78('0x15'))['db'];function respondWithStatusCode(_0x236c87,_0x6e9b52){_0x6e9b52=_0x6e9b52||0xcc;return function(_0x1be644){if(_0x1be644){return _0x236c87[_0xba78('0x16')](_0x6e9b52);}return _0x236c87[_0xba78('0x17')](_0x6e9b52)[_0xba78('0x18')]();};}function respondWithResult(_0x140f43,_0x41a4a6){_0x41a4a6=_0x41a4a6||0xc8;return function(_0x3b2ab6){if(_0x3b2ab6){return _0x140f43['status'](_0x41a4a6)[_0xba78('0x19')](_0x3b2ab6);}};}function respondWithFilteredResult(_0x28e65f,_0x631930){return function(_0x32a786){if(_0x32a786){var _0x3eebe8=typeof _0x631930[_0xba78('0x1a')]===_0xba78('0x1b')&&typeof _0x631930[_0xba78('0x1c')]===_0xba78('0x1b');var _0x16684e=_0x32a786[_0xba78('0x1d')];var _0x264d24=_0x3eebe8?0x0:_0x631930[_0xba78('0x1a')];var _0x4509ba=_0x3eebe8?_0x32a786[_0xba78('0x1d')]:_0x631930[_0xba78('0x1a')]+_0x631930[_0xba78('0x1c')];var _0x3c00ec;if(_0x4509ba>=_0x16684e){_0x4509ba=_0x16684e;_0x3c00ec=0xc8;}else{_0x3c00ec=0xce;}_0x28e65f['status'](_0x3c00ec);return _0x28e65f[_0xba78('0x1e')](_0xba78('0x1f'),_0x264d24+'-'+_0x4509ba+'/'+_0x16684e)[_0xba78('0x19')](_0x32a786);}return null;};}function patchUpdates(_0x2aac56){return function(_0x108a6c){try{jsonpatch['apply'](_0x108a6c,_0x2aac56,!![]);}catch(_0x31d292){return BPromise[_0xba78('0x20')](_0x31d292);}return _0x108a6c['save']();};}function saveUpdates(_0x423430,_0x3c7340){return function(_0x2b5591){if(_0x2b5591){return _0x2b5591[_0xba78('0x21')](_0x423430)[_0xba78('0x22')](function(_0x32d6ec){return _0x32d6ec;});}return null;};}function removeEntity(_0x2ffc98,_0x43565b){return function(_0x4dae55){if(_0x4dae55){return _0x4dae55[_0xba78('0x23')]()[_0xba78('0x22')](function(){var _0x2566d1=_0x4dae55[_0xba78('0x24')]({'plain':!![]});var _0x13a8de=_0xba78('0x25');return db[_0xba78('0x26')][_0xba78('0x23')]({'where':{'type':_0x13a8de,'resourceId':_0x2566d1['id']}})[_0xba78('0x22')](function(){return _0x4dae55;});})[_0xba78('0x22')](function(){_0x2ffc98[_0xba78('0x17')](0xcc)[_0xba78('0x18')]();});}};}function handleEntityNotFound(_0x318093,_0x2f836b){return function(_0x2a6e6){if(!_0x2a6e6){_0x318093[_0xba78('0x16')](0x194);}return _0x2a6e6;};}function handleError(_0x52f805,_0x120d08){_0x120d08=_0x120d08||0x1f4;return function(_0x49c505){logger[_0xba78('0x27')](_0x49c505[_0xba78('0x28')]);if(_0x49c505['name']){delete _0x49c505[_0xba78('0x29')];}_0x52f805[_0xba78('0x17')](_0x120d08)[_0xba78('0x2a')](_0x49c505);};}exports[_0xba78('0x2b')]=function(_0x52e954,_0x1cf5da){var _0x49554e={},_0x161224={},_0xdeadd5={'count':0x0,'rows':[]};var _0xdeb6a6=_[_0xba78('0x2c')](db['CannedAnswer']['rawAttributes'],function(_0x2f43a9){return{'name':_0x2f43a9[_0xba78('0x2d')],'type':_0x2f43a9[_0xba78('0x2e')][_0xba78('0x2f')]};});_0x161224[_0xba78('0x30')]=_[_0xba78('0x2c')](_0xdeb6a6,_0xba78('0x29'));_0x161224[_0xba78('0x31')]=_[_0xba78('0x32')](_0x52e954[_0xba78('0x31')]);_0x161224['filters']=_[_0xba78('0x33')](_0x161224['model'],_0x161224[_0xba78('0x31')]);_0x49554e['attributes']=_[_0xba78('0x33')](_0x161224[_0xba78('0x30')],qs['fields'](_0x52e954[_0xba78('0x31')][_0xba78('0x34')]));_0x49554e[_0xba78('0x35')]=_0x49554e['attributes'][_0xba78('0x36')]?_0x49554e[_0xba78('0x35')]:_0x161224[_0xba78('0x30')];if(!_0x52e954[_0xba78('0x31')][_0xba78('0x37')]('nolimit')){_0x49554e['limit']=qs[_0xba78('0x1c')](_0x52e954['query'][_0xba78('0x1c')]);_0x49554e['offset']=qs[_0xba78('0x1a')](_0x52e954['query'][_0xba78('0x1a')]);}_0x49554e[_0xba78('0x38')]=qs[_0xba78('0x39')](_0x52e954['query'][_0xba78('0x39')]);_0x49554e['where']=qs[_0xba78('0x3a')](_[_0xba78('0x3b')](_0x52e954[_0xba78('0x31')],_0x161224['filters']),_0xdeb6a6);if(_0x52e954[_0xba78('0x31')]['filter']){_0x49554e[_0xba78('0x3c')]=_[_0xba78('0x3d')](_0x49554e['where'],{'$or':[{'key':{'$like':'%'+_0x52e954['query']['filter']+'%'}},{'value':{'$like':'%'+_0x52e954['query'][_0xba78('0x3e')]+'%'}}]});}_0x49554e=_[_0xba78('0x3d')]({},_0x49554e,_0x52e954[_0xba78('0x3f')]);var _0x54d339={'where':_0x49554e[_0xba78('0x3c')]};return db[_0xba78('0x40')][_0xba78('0x1d')](_0x54d339)['then'](function(_0x4280aa){_0xdeadd5[_0xba78('0x1d')]=_0x4280aa;if(_0x52e954[_0xba78('0x31')]['includeAll']){_0x49554e[_0xba78('0x41')]=[{'all':!![]}];}return db[_0xba78('0x40')][_0xba78('0x42')](_0x49554e);})[_0xba78('0x22')](function(_0x27302c){_0xdeadd5['rows']=_0x27302c;return _0xdeadd5;})[_0xba78('0x22')](respondWithFilteredResult(_0x1cf5da,_0x49554e))[_0xba78('0x43')](handleError(_0x1cf5da,null));};exports[_0xba78('0x44')]=function(_0x4b932e,_0x52e445){var _0x36e320={'raw':!![],'where':{'id':_0x4b932e[_0xba78('0x45')]['id']}},_0x520247={};_0x520247[_0xba78('0x30')]=_[_0xba78('0x32')](db['CannedAnswer'][_0xba78('0x46')]);_0x520247['query']=_['keys'](_0x4b932e[_0xba78('0x31')]);_0x520247['filters']=_[_0xba78('0x33')](_0x520247[_0xba78('0x30')],_0x520247[_0xba78('0x31')]);_0x36e320[_0xba78('0x35')]=_[_0xba78('0x33')](_0x520247['model'],qs['fields'](_0x4b932e[_0xba78('0x31')][_0xba78('0x34')]));_0x36e320[_0xba78('0x35')]=_0x36e320[_0xba78('0x35')]['length']?_0x36e320[_0xba78('0x35')]:_0x520247[_0xba78('0x30')];if(_0x4b932e[_0xba78('0x31')]['includeAll']){_0x36e320[_0xba78('0x41')]=[{'all':!![]}];}_0x36e320=_['merge']({},_0x36e320,_0x4b932e[_0xba78('0x3f')]);return db[_0xba78('0x40')][_0xba78('0x47')](_0x36e320)['then'](handleEntityNotFound(_0x52e445,null))[_0xba78('0x22')](respondWithResult(_0x52e445,null))[_0xba78('0x43')](handleError(_0x52e445,null));};exports[_0xba78('0x21')]=function(_0x50ac66,_0x334e60){if(_0x50ac66[_0xba78('0x48')]['id']){delete _0x50ac66['body']['id'];}return db[_0xba78('0x40')][_0xba78('0x47')]({'where':{'id':_0x50ac66[_0xba78('0x45')]['id']}})[_0xba78('0x22')](handleEntityNotFound(_0x334e60,null))[_0xba78('0x22')](saveUpdates(_0x50ac66[_0xba78('0x48')],null))['then'](respondWithResult(_0x334e60,null))[_0xba78('0x43')](handleError(_0x334e60,null));};exports[_0xba78('0x23')]=function(_0x3f3a93,_0xaf62b4){return db[_0xba78('0x40')][_0xba78('0x47')]({'where':{'id':_0x3f3a93['params']['id']}})[_0xba78('0x22')](handleEntityNotFound(_0xaf62b4,null))[_0xba78('0x22')](removeEntity(_0xaf62b4,null))[_0xba78('0x43')](handleError(_0xaf62b4,null));};exports[_0xba78('0x49')]=function(_0x4ca0be,_0xd4c0bb){var _0x36d237={'key':_0x4ca0be['body'][_0xba78('0x2f')]};if(_0x4ca0be[_0xba78('0x48')][_0xba78('0x4a')]){_0x36d237[_0xba78('0x4a')]=_0x4ca0be['body'][_0xba78('0x4a')];}else if(_0x4ca0be['body'][_0xba78('0x4b')]){_0x36d237[_0xba78('0x4b')]=_0x4ca0be['body'][_0xba78('0x4b')];}else if(_0x4ca0be['body'][_0xba78('0x4c')]){_0x36d237['OpenchannelAccountId']=_0x4ca0be['body'][_0xba78('0x4c')];}else if(_0x4ca0be[_0xba78('0x48')]['ChatWebsiteId']){_0x36d237[_0xba78('0x4d')]=_0x4ca0be[_0xba78('0x48')]['ChatWebsiteId'];}return db[_0xba78('0x40')]['find']({'where':_0x36d237})[_0xba78('0x22')](function(_0x2a958f){if(_0x2a958f){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xba78('0x49')](_0x4ca0be[_0xba78('0x48')]);})[_0xba78('0x22')](function(_0x219ea5){var _0x53b0f4=_0x4ca0be[_0xba78('0x4e')]['get']({'plain':!![]});if(!_0x53b0f4)throw new Error(_0xba78('0x4f'));if(_0x53b0f4[_0xba78('0x50')]===_0xba78('0x4e')){var _0x29318c=_0x219ea5[_0xba78('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xba78('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x53b0f4[_0xba78('0x51')]},'raw':!![]})['then'](function(_0x543b58){if(_0x543b58&&_0x543b58[_0xba78('0x52')]===0x0){return db['UserProfileResource'][_0xba78('0x49')]({'name':_0x29318c[_0xba78('0x29')],'resourceId':_0x29318c['id'],'type':_0x543b58[_0xba78('0x29')],'sectionId':_0x543b58['id']},{})[_0xba78('0x22')](function(){return _0x219ea5;});}else{return _0x219ea5;}})[_0xba78('0x43')](function(_0x4451cd){logger[_0xba78('0x27')](_0xba78('0x53'),_0x4451cd);throw _0x4451cd;});}return _0x219ea5;})[_0xba78('0x22')](respondWithResult(_0xd4c0bb,0xc9))[_0xba78('0x43')](handleError(_0xd4c0bb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index cd79238..a478c28 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 _0x3f59=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x35b749,_0x420370){var _0x52f313=function(_0x7cc92a){while(--_0x7cc92a){_0x35b749['push'](_0x35b749['shift']());}};_0x52f313(++_0x420370);}(_0x3f59,0x118));var _0x93f5=function(_0x507333,_0x33ce32){_0x507333=_0x507333-0x0;var _0x4a4607=_0x3f59[_0x507333];return _0x4a4607;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x93f5('0x0'))(_0x93f5('0x1'));var moment=require(_0x93f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x93f5('0x3'));var rimraf=require(_0x93f5('0x4'));var config=require(_0x93f5('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x93f5('0x6')]=function(_0x2dfa89,_0x5a223b){return _0x2dfa89[_0x93f5('0x7')]('CannedAnswer',attributes,{'tableName':_0x93f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x93f5('0x9'),'collate':_0x93f5('0xa')});}; \ No newline at end of file +var _0x3e5a=['utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x4620aa,_0x45d0cb){var _0x4a2de0=function(_0x8e264){while(--_0x8e264){_0x4620aa['push'](_0x4620aa['shift']());}};_0x4a2de0(++_0x45d0cb);}(_0x3e5a,0x1dd));var _0xa3e5=function(_0x148671,_0x1d3cd4){_0x148671=_0x148671-0x0;var _0x3d2b40=_0x3e5a[_0x148671];return _0x3d2b40;};'use strict';var _=require(_0xa3e5('0x0'));var util=require(_0xa3e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa3e5('0x2'));var BPromise=require(_0xa3e5('0x3'));var rp=require(_0xa3e5('0x4'));var fs=require('fs');var path=require(_0xa3e5('0x5'));var rimraf=require('rimraf');var config=require(_0xa3e5('0x6'));var attributes=require(_0xa3e5('0x7'));module[_0xa3e5('0x8')]=function(_0x3ef781,_0xec50a4){return _0x3ef781[_0xa3e5('0x9')](_0xa3e5('0xa'),attributes,{'tableName':_0xa3e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa3e5('0xc'),'collate':_0xa3e5('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a449ff1..b2af74f 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(_0x2bea27,_0x591cc8){var _0x1675dd=function(_0x144451){while(--_0x144451){_0x2bea27['push'](_0x2bea27['shift']());}};_0x1675dd(++_0x591cc8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x10cee3,_0x3527b8){var _0x1a1e75=function(_0x561224){while(--_0x561224){_0x10cee3['push'](_0x10cee3['shift']());}};_0x1a1e75(++_0x3527b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 3a9c48e..295d1c7 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 _0x75d4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x456cac,_0x547b06){var _0x44e12e=function(_0x3c8ab1){while(--_0x3c8ab1){_0x456cac['push'](_0x456cac['shift']());}};_0x44e12e(++_0x547b06);}(_0x75d4,0x18d));var _0x475d=function(_0x3cc274,_0x413ab0){_0x3cc274=_0x3cc274-0x0;var _0x36b8dd=_0x75d4[_0x3cc274];return _0x36b8dd;};'use strict';var multer=require(_0x475d('0x0'));var util=require(_0x475d('0x1'));var path=require('path');var timeout=require(_0x475d('0x2'));var express=require(_0x475d('0x3'));var router=express[_0x475d('0x4')]();var fs_extra=require(_0x475d('0x5'));var auth=require(_0x475d('0x6'));var interaction=require(_0x475d('0x7'));var config=require(_0x475d('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x475d('0x9')]);router[_0x475d('0xa')]('/:id',auth[_0x475d('0xb')](),controller['show']);router[_0x475d('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x475d('0xd')](_0x475d('0xe'),auth[_0x475d('0xb')](),controller[_0x475d('0xf')]);router[_0x475d('0x10')](_0x475d('0xe'),auth[_0x475d('0xb')](),controller[_0x475d('0x11')]);module[_0x475d('0x12')]=router; \ No newline at end of file +var _0xd007=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','fs-extra'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xd007,0x9d));var _0x7d00=function(_0x476f82,_0x4e96d0){_0x476f82=_0x476f82-0x0;var _0x136d2e=_0xd007[_0x476f82];return _0x136d2e;};'use strict';var multer=require('multer');var util=require(_0x7d00('0x0'));var path=require(_0x7d00('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d00('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7d00('0x3'));var config=require(_0x7d00('0x4'));var controller=require(_0x7d00('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7d00('0x6')](_0x7d00('0x7'),auth['isAuthenticated'](),controller[_0x7d00('0x8')]);router[_0x7d00('0x9')]('/',auth[_0x7d00('0xa')](),controller[_0x7d00('0xb')]);router[_0x7d00('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7d00('0xd')](_0x7d00('0x7'),auth[_0x7d00('0xa')](),controller[_0x7d00('0xe')]);module[_0x7d00('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 1abb413..0886c2b 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 _0x9567=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x535cdf,_0x2f5b72){var _0x37a2bc=function(_0x1b4664){while(--_0x1b4664){_0x535cdf['push'](_0x535cdf['shift']());}};_0x37a2bc(++_0x2f5b72);}(_0x9567,0xdc));var _0x7956=function(_0x2b324a,_0x86e65c){_0x2b324a=_0x2b324a-0x0;var _0x39945f=_0x9567[_0x2b324a];return _0x39945f;};'use strict';var Sequelize=require(_0x7956('0x0'));module[_0x7956('0x1')]={'calldate':{'type':Sequelize[_0x7956('0x2')],'allowNull':![],'defaultValue':_0x7956('0x3')},'clid':{'type':Sequelize[_0x7956('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x7956('0x4')]},'channel':{'type':Sequelize[_0x7956('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7956('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x7956('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7956('0x4')]},'amaflags':{'type':Sequelize[_0x7956('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7956('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x7956('0x4')]},'sequence':{'type':Sequelize[_0x7956('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7956('0x4')]},'tag':{'type':Sequelize[_0x7956('0x4')]}}; \ No newline at end of file +var _0x117d=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3a9193,_0x2be163){var _0x2c57d1=function(_0x17f969){while(--_0x17f969){_0x3a9193['push'](_0x3a9193['shift']());}};_0x2c57d1(++_0x2be163);}(_0x117d,0xac));var _0xd117=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x117d[_0x22093a];return _0x2f4989;};'use strict';var Sequelize=require(_0xd117('0x0'));module[_0xd117('0x1')]={'calldate':{'type':Sequelize[_0xd117('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xd117('0x3')]},'src':{'type':Sequelize[_0xd117('0x3')]},'dst':{'type':Sequelize[_0xd117('0x3')]},'dcontext':{'type':Sequelize[_0xd117('0x3')]},'channel':{'type':Sequelize[_0xd117('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd117('0x3')]},'lastdata':{'type':Sequelize[_0xd117('0x3')]},'duration':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd117('0x3')]},'userfield':{'type':Sequelize[_0xd117('0x3')]},'uniqueid':{'type':Sequelize[_0xd117('0x3')]},'linkedid':{'type':Sequelize[_0xd117('0x3')]},'sequence':{'type':Sequelize[_0xd117('0x3')]},'peeraccount':{'type':Sequelize[_0xd117('0x3')]},'type':{'type':Sequelize[_0xd117('0x3')]},'tag':{'type':Sequelize[_0xd117('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 2db27b5..195b9cd 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 _0x1c9a=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','show','params','find','catch','create','update','body','destroy','describe','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'];(function(_0x5a753d,_0x1c2a1f){var _0x5326d3=function(_0x8c4351){while(--_0x8c4351){_0x5a753d['push'](_0x5a753d['shift']());}};_0x5326d3(++_0x1c2a1f);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x23b92e,_0x2abf10){_0x23b92e=_0x23b92e-0x0;var _0xdc1dbf=_0x1c9a[_0x23b92e];return _0xdc1dbf;};'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['Cdr'][_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['Cdr'][_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){return db['Cdr'][_0xa1c9('0x4a')]()[_0xa1c9('0x26')](respondWithResult(_0xef1290,null))[_0xa1c9('0x45')](handleError(_0xef1290,null));}; \ No newline at end of file +var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x3bbd38,_0x1f451a){var _0x5e16e3=function(_0x1f699e){while(--_0x1f699e){_0x3bbd38['push'](_0x3bbd38['shift']());}};_0x5e16e3(++_0x1f451a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4e3ee6,_0x1cac16){_0x4e3ee6=_0x4e3ee6-0x0;var _0x3a1887=_0x7fbe[_0x4e3ee6];return _0x3a1887;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['Cdr'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['Cdr'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2d25559..a16d12e 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1ed50e,_0x27d74d){var _0x3fc523=function(_0x3b5866){while(--_0x3b5866){_0x1ed50e['push'](_0x1ed50e['shift']());}};_0x3fc523(++_0x27d74d);}(_0x7a54,0x106));var _0x47a5=function(_0x3c760c,_0x187de0){_0x3c760c=_0x3c760c-0x0;var _0x274e8b=_0x7a54[_0x3c760c];return _0x274e8b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2c033c,_0x37bb3c){var _0x497768=function(_0x2d9219){while(--_0x2d9219){_0x2c033c['push'](_0x2c033c['shift']());}};_0x497768(++_0x37bb3c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 49fafe8..d14a3a1 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 _0x97e6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Cdr,\x20%s,\x20%s','lodash'];(function(_0x3e6b83,_0x224b71){var _0x599977=function(_0x51b428){while(--_0x51b428){_0x3e6b83['push'](_0x3e6b83['shift']());}};_0x599977(++_0x224b71);}(_0x97e6,0xa0));var _0x697e=function(_0x26cc16,_0x4c174f){_0x26cc16=_0x26cc16-0x0;var _0x345e3e=_0x97e6[_0x26cc16];return _0x345e3e;};'use strict';var _=require(_0x697e('0x0'));var util=require(_0x697e('0x1'));var moment=require(_0x697e('0x2'));var BPromise=require(_0x697e('0x3'));var rs=require(_0x697e('0x4'));var fs=require('fs');var Redis=require(_0x697e('0x5'));var db=require(_0x697e('0x6'))['db'];var utils=require(_0x697e('0x7'));var logger=require(_0x697e('0x8'))('rpc');var config=require(_0x697e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x697e('0xa')][_0x697e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b37ce,_0x212f2f,_0x49f407){return new BPromise(function(_0x4e362a,_0x3790d2){return client[_0x697e('0xc')](_0x5b37ce,_0x49f407)[_0x697e('0xd')](function(_0x55a9e0){logger[_0x697e('0xe')]('Cdr,\x20%s,\x20%s',_0x212f2f,'request\x20sent');logger[_0x697e('0xf')](_0x697e('0x10'),_0x212f2f,_0x697e('0x11'),JSON[_0x697e('0x12')](_0x55a9e0));if(_0x55a9e0[_0x697e('0x13')]){if(_0x55a9e0[_0x697e('0x13')][_0x697e('0x14')]===0x1f4){logger[_0x697e('0x13')]('Cdr,\x20%s,\x20%s',_0x212f2f,_0x55a9e0[_0x697e('0x13')]['message']);return _0x3790d2(_0x55a9e0[_0x697e('0x13')][_0x697e('0x15')]);}logger[_0x697e('0x13')]('Cdr,\x20%s,\x20%s',_0x212f2f,_0x55a9e0[_0x697e('0x13')]['message']);return _0x4e362a(_0x55a9e0[_0x697e('0x13')][_0x697e('0x15')]);}else{logger['info'](_0x697e('0x16'),_0x212f2f,'request\x20sent');_0x4e362a(_0x55a9e0['result'][_0x697e('0x15')]);}})['catch'](function(_0xf43dec){logger[_0x697e('0x13')](_0x697e('0x16'),_0x212f2f,_0xf43dec);_0x3790d2(_0xf43dec);});});} \ No newline at end of file +var _0x0caa=['../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x0caa,0x188));var _0xa0ca=function(_0x77a3a1,_0xb5b96e){_0x77a3a1=_0x77a3a1-0x0;var _0xa0648e=_0x0caa[_0x77a3a1];return _0xa0648e;};'use strict';var _=require(_0xa0ca('0x0'));var util=require('util');var moment=require(_0xa0ca('0x1'));var BPromise=require(_0xa0ca('0x2'));var rs=require(_0xa0ca('0x3'));var fs=require('fs');var Redis=require(_0xa0ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ca('0x5'));var logger=require(_0xa0ca('0x6'))('rpc');var config=require(_0xa0ca('0x7'));var jayson=require(_0xa0ca('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1944d8,_0x47c648,_0x187b3d){return new BPromise(function(_0x28ffa1,_0x14485){return client[_0xa0ca('0x9')](_0x1944d8,_0x187b3d)[_0xa0ca('0xa')](function(_0x3e9ba0){logger[_0xa0ca('0xb')](_0xa0ca('0xc'),_0x47c648,'request\x20sent');logger[_0xa0ca('0xd')](_0xa0ca('0xe'),_0x47c648,_0xa0ca('0xf'),JSON[_0xa0ca('0x10')](_0x3e9ba0));if(_0x3e9ba0[_0xa0ca('0x11')]){if(_0x3e9ba0[_0xa0ca('0x11')][_0xa0ca('0x12')]===0x1f4){logger[_0xa0ca('0x11')](_0xa0ca('0xc'),_0x47c648,_0x3e9ba0['error']['message']);return _0x14485(_0x3e9ba0[_0xa0ca('0x11')]['message']);}logger[_0xa0ca('0x11')](_0xa0ca('0xc'),_0x47c648,_0x3e9ba0[_0xa0ca('0x11')][_0xa0ca('0x13')]);return _0x28ffa1(_0x3e9ba0[_0xa0ca('0x11')][_0xa0ca('0x13')]);}else{logger['info'](_0xa0ca('0xc'),_0x47c648,'request\x20sent');_0x28ffa1(_0x3e9ba0['result'][_0xa0ca('0x13')]);}})[_0xa0ca('0x14')](function(_0x306507){logger[_0xa0ca('0x11')](_0xa0ca('0xc'),_0x47c648,_0x306507);_0x14485(_0x306507);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 4f47d52..51a1667 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2ef2ec,_0x5a7aaf){var _0xe68c2c=function(_0x3f1357){while(--_0x3f1357){_0x2ef2ec['push'](_0x2ef2ec['shift']());}};_0xe68c2c(++_0x5a7aaf);}(_0xb10b,0x12a));var _0xbb10=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0xb10b[_0x16fe4c];return _0x9999d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x4f6856,_0x2dbb97){var _0x36cafd=function(_0x2d782b){while(--_0x2d782b){_0x4f6856['push'](_0x4f6856['shift']());}};_0x36cafd(++_0x2dbb97);}(_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'));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 10ac8b2..d0dba6b 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 _0x37c4=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1b8e8b,_0xc325b){var _0x54efe4=function(_0x10a262){while(--_0x10a262){_0x1b8e8b['push'](_0x1b8e8b['shift']());}};_0x54efe4(++_0xc325b);}(_0x37c4,0xba));var _0x437c=function(_0x9cdbf3,_0xf691a5){_0x9cdbf3=_0x9cdbf3-0x0;var _0x2c1172=_0x37c4[_0x9cdbf3];return _0x2c1172;};'use strict';var Sequelize=require(_0x437c('0x0'));module[_0x437c('0x1')]={'priority':{'type':Sequelize[_0x437c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x437c('0x3')],'allowNull':![],'defaultValue':_0x437c('0x4')},'appdata':{'type':Sequelize[_0x437c('0x5')]()},'description':{'type':Sequelize[_0x437c('0x3')]},'interval':{'type':Sequelize[_0x437c('0x3')],'defaultValue':_0x437c('0x6')}}; \ No newline at end of file +var _0x8edd=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1762c4,_0xb87aa1){var _0x1c8b14=function(_0xd5631c){while(--_0xd5631c){_0x1762c4['push'](_0x1762c4['shift']());}};_0x1c8b14(++_0xb87aa1);}(_0x8edd,0x8d));var _0xd8ed=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x8edd[_0x1f7201];return _0x289fd2;};'use strict';var Sequelize=require(_0xd8ed('0x0'));module[_0xd8ed('0x1')]={'priority':{'type':Sequelize[_0xd8ed('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd8ed('0x3')],'allowNull':![],'defaultValue':_0xd8ed('0x4')},'appdata':{'type':Sequelize[_0xd8ed('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd8ed('0x3')],'defaultValue':_0xd8ed('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5411a63..ad1e890 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 _0xd547=['to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','error','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','desk.js'];(function(_0x8bfe1b,_0x31764f){var _0x39f25a=function(_0x39969c){while(--_0x39969c){_0x8bfe1b['push'](_0x8bfe1b['shift']());}};_0x39f25a(++_0x31764f);}(_0xd547,0x1c1));var _0x7d54=function(_0x260d3f,_0x5c0c51){_0x260d3f=_0x260d3f-0x0;var _0x1bbb43=_0xd547[_0x260d3f];return _0x1bbb43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d54('0x0'));var jsonpatch=require(_0x7d54('0x1'));var rp=require(_0x7d54('0x2'));var moment=require(_0x7d54('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d54('0x4'));var path=require('path');var sox=require(_0x7d54('0x5'));var csv=require('to-csv');var ejs=require(_0x7d54('0x6'));var fs=require('fs');var fs_extra=require(_0x7d54('0x7'));var _=require(_0x7d54('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d54('0x9'));var toCsv=require(_0x7d54('0xa'));var querystring=require('querystring');var Papa=require(_0x7d54('0xb'));var Redis=require('ioredis');var authService=require(_0x7d54('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7d54('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d54('0xe'))(_0x7d54('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7d54('0x10'))['db'];function respondWithStatusCode(_0x3e8072,_0x428430){_0x428430=_0x428430||0xcc;return function(_0x4be6c5){if(_0x4be6c5){return _0x3e8072[_0x7d54('0x11')](_0x428430);}return _0x3e8072['status'](_0x428430)[_0x7d54('0x12')]();};}function respondWithResult(_0x5e46ee,_0x11c94a){_0x11c94a=_0x11c94a||0xc8;return function(_0x43718a){if(_0x43718a){return _0x5e46ee['status'](_0x11c94a)[_0x7d54('0x13')](_0x43718a);}};}function respondWithFilteredResult(_0x208b3c,_0x25b69c){return function(_0x5a6bec){if(_0x5a6bec){var _0x2b1b0f=typeof _0x25b69c[_0x7d54('0x14')]===_0x7d54('0x15')&&typeof _0x25b69c[_0x7d54('0x16')]===_0x7d54('0x15');var _0x22f27c=_0x5a6bec['count'];var _0x81971b=_0x2b1b0f?0x0:_0x25b69c[_0x7d54('0x14')];var _0x57e789=_0x2b1b0f?_0x5a6bec[_0x7d54('0x17')]:_0x25b69c['offset']+_0x25b69c['limit'];var _0x46a719;if(_0x57e789>=_0x22f27c){_0x57e789=_0x22f27c;_0x46a719=0xc8;}else{_0x46a719=0xce;}_0x208b3c[_0x7d54('0x18')](_0x46a719);return _0x208b3c[_0x7d54('0x19')](_0x7d54('0x1a'),_0x81971b+'-'+_0x57e789+'/'+_0x22f27c)['json'](_0x5a6bec);}return null;};}function patchUpdates(_0x23ea55){return function(_0x2b0770){try{jsonpatch['apply'](_0x2b0770,_0x23ea55,!![]);}catch(_0x22718f){return BPromise[_0x7d54('0x1b')](_0x22718f);}return _0x2b0770[_0x7d54('0x1c')]();};}function saveUpdates(_0x6cc88b,_0x715a4e){return function(_0x4fe2cb){if(_0x4fe2cb){return _0x4fe2cb[_0x7d54('0x1d')](_0x6cc88b)['then'](function(_0x589f93){return _0x589f93;});}return null;};}function removeEntity(_0x5e0c4b,_0x2967b0){return function(_0x299f6e){if(_0x299f6e){return _0x299f6e['destroy']()[_0x7d54('0x1e')](function(){_0x5e0c4b[_0x7d54('0x18')](0xcc)[_0x7d54('0x12')]();});}};}function handleEntityNotFound(_0x19520a,_0x3b611f){return function(_0x6d0375){if(!_0x6d0375){_0x19520a[_0x7d54('0x11')](0x194);}return _0x6d0375;};}function handleError(_0x372f14,_0x509b8f){_0x509b8f=_0x509b8f||0x1f4;return function(_0x2818b6){logger[_0x7d54('0x1f')](_0x2818b6['stack']);if(_0x2818b6['name']){delete _0x2818b6['name'];}_0x372f14['status'](_0x509b8f)[_0x7d54('0x20')](_0x2818b6);};}exports[_0x7d54('0x21')]=function(_0x57e2ce,_0x32df83){var _0x252017={'raw':!![],'where':{'id':_0x57e2ce[_0x7d54('0x22')]['id']}},_0x4a8488={};_0x4a8488[_0x7d54('0x23')]=_[_0x7d54('0x24')](db[_0x7d54('0x25')][_0x7d54('0x26')]);_0x4a8488[_0x7d54('0x27')]=_[_0x7d54('0x24')](_0x57e2ce[_0x7d54('0x27')]);_0x4a8488['filters']=_[_0x7d54('0x28')](_0x4a8488['model'],_0x4a8488['query']);_0x252017[_0x7d54('0x29')]=_[_0x7d54('0x28')](_0x4a8488['model'],qs[_0x7d54('0x2a')](_0x57e2ce[_0x7d54('0x27')][_0x7d54('0x2a')]));_0x252017[_0x7d54('0x29')]=_0x252017[_0x7d54('0x29')][_0x7d54('0x2b')]?_0x252017[_0x7d54('0x29')]:_0x4a8488['model'];if(_0x57e2ce[_0x7d54('0x27')][_0x7d54('0x2c')]){_0x252017['include']=[{'all':!![]}];}_0x252017=_[_0x7d54('0x2d')]({},_0x252017,_0x57e2ce[_0x7d54('0x2e')]);return db[_0x7d54('0x25')]['find'](_0x252017)[_0x7d54('0x1e')](handleEntityNotFound(_0x32df83,null))[_0x7d54('0x1e')](respondWithResult(_0x32df83,null))[_0x7d54('0x2f')](handleError(_0x32df83,null));};exports[_0x7d54('0x1d')]=function(_0x2ee0aa,_0x5adaf7){if(_0x2ee0aa[_0x7d54('0x30')]['id']){delete _0x2ee0aa[_0x7d54('0x30')]['id'];}return db['ChatApplication'][_0x7d54('0x31')]({'where':{'id':_0x2ee0aa[_0x7d54('0x22')]['id']}})[_0x7d54('0x1e')](handleEntityNotFound(_0x5adaf7,null))[_0x7d54('0x1e')](saveUpdates(_0x2ee0aa[_0x7d54('0x30')],null))[_0x7d54('0x1e')](respondWithResult(_0x5adaf7,null))[_0x7d54('0x2f')](handleError(_0x5adaf7,null));};exports[_0x7d54('0x32')]=function(_0x125974,_0x32b5fa){return db[_0x7d54('0x25')][_0x7d54('0x31')]({'where':{'id':_0x125974['params']['id']}})['then'](handleEntityNotFound(_0x32b5fa,null))[_0x7d54('0x1e')](removeEntity(_0x32b5fa,null))[_0x7d54('0x2f')](handleError(_0x32b5fa,null));}; \ No newline at end of file +var _0x63c6=['include','merge','options','find','body','ChatApplication','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll'];(function(_0x40c58d,_0xca539f){var _0x2a8381=function(_0x4a1f4d){while(--_0x4a1f4d){_0x40c58d['push'](_0x40c58d['shift']());}};_0x2a8381(++_0xca539f);}(_0x63c6,0xbb));var _0x663c=function(_0x3b1978,_0x1e1123){_0x3b1978=_0x3b1978-0x0;var _0x26c5a7=_0x63c6[_0x3b1978];return _0x26c5a7;};'use strict';var emlformat=require(_0x663c('0x0'));var rimraf=require(_0x663c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x663c('0x2'));var moment=require(_0x663c('0x3'));var BPromise=require(_0x663c('0x4'));var Mustache=require(_0x663c('0x5'));var util=require(_0x663c('0x6'));var path=require(_0x663c('0x7'));var sox=require(_0x663c('0x8'));var csv=require(_0x663c('0x9'));var ejs=require(_0x663c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663c('0xb'));var squel=require(_0x663c('0xc'));var crypto=require(_0x663c('0xd'));var jsforce=require(_0x663c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x663c('0x9'));var querystring=require('querystring');var Papa=require(_0x663c('0xf'));var Redis=require('ioredis');var authService=require(_0x663c('0x10'));var qs=require(_0x663c('0x11'));var as=require(_0x663c('0x12'));var hardwareService=require(_0x663c('0x13'));var logger=require(_0x663c('0x14'))(_0x663c('0x15'));var utils=require(_0x663c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x663c('0x17'))['db'];function respondWithStatusCode(_0xe80d02,_0x588da1){_0x588da1=_0x588da1||0xcc;return function(_0x20038d){if(_0x20038d){return _0xe80d02[_0x663c('0x18')](_0x588da1);}return _0xe80d02[_0x663c('0x19')](_0x588da1)[_0x663c('0x1a')]();};}function respondWithResult(_0x5ef6af,_0xa119a1){_0xa119a1=_0xa119a1||0xc8;return function(_0x165454){if(_0x165454){return _0x5ef6af['status'](_0xa119a1)[_0x663c('0x1b')](_0x165454);}};}function respondWithFilteredResult(_0x523322,_0x44ffaa){return function(_0xb1e1bf){if(_0xb1e1bf){var _0x2a7b0d=typeof _0x44ffaa[_0x663c('0x1c')]===_0x663c('0x1d')&&typeof _0x44ffaa[_0x663c('0x1e')]===_0x663c('0x1d');var _0x41cc9d=_0xb1e1bf[_0x663c('0x1f')];var _0x3c87fe=_0x2a7b0d?0x0:_0x44ffaa['offset'];var _0x2fd707=_0x2a7b0d?_0xb1e1bf[_0x663c('0x1f')]:_0x44ffaa[_0x663c('0x1c')]+_0x44ffaa['limit'];var _0x137670;if(_0x2fd707>=_0x41cc9d){_0x2fd707=_0x41cc9d;_0x137670=0xc8;}else{_0x137670=0xce;}_0x523322[_0x663c('0x19')](_0x137670);return _0x523322[_0x663c('0x20')](_0x663c('0x21'),_0x3c87fe+'-'+_0x2fd707+'/'+_0x41cc9d)[_0x663c('0x1b')](_0xb1e1bf);}return null;};}function patchUpdates(_0x54fa2f){return function(_0xcf6ced){try{jsonpatch[_0x663c('0x22')](_0xcf6ced,_0x54fa2f,!![]);}catch(_0x319224){return BPromise[_0x663c('0x23')](_0x319224);}return _0xcf6ced['save']();};}function saveUpdates(_0x5a9e96,_0x2ac148){return function(_0x34135d){if(_0x34135d){return _0x34135d[_0x663c('0x24')](_0x5a9e96)[_0x663c('0x25')](function(_0x352a21){return _0x352a21;});}return null;};}function removeEntity(_0x53986f,_0x4984dc){return function(_0x4b7213){if(_0x4b7213){return _0x4b7213[_0x663c('0x26')]()[_0x663c('0x25')](function(){_0x53986f[_0x663c('0x19')](0xcc)[_0x663c('0x1a')]();});}};}function handleEntityNotFound(_0x5e6b45,_0xd82689){return function(_0x417181){if(!_0x417181){_0x5e6b45[_0x663c('0x18')](0x194);}return _0x417181;};}function handleError(_0x20ca5,_0x3581a3){_0x3581a3=_0x3581a3||0x1f4;return function(_0x5a56cd){logger[_0x663c('0x27')](_0x5a56cd['stack']);if(_0x5a56cd[_0x663c('0x28')]){delete _0x5a56cd['name'];}_0x20ca5['status'](_0x3581a3)[_0x663c('0x29')](_0x5a56cd);};}exports['show']=function(_0x16f30b,_0x274a2a){var _0x30ff6f={'raw':!![],'where':{'id':_0x16f30b[_0x663c('0x2a')]['id']}},_0x46d722={};_0x46d722[_0x663c('0x2b')]=_[_0x663c('0x2c')](db['ChatApplication'][_0x663c('0x2d')]);_0x46d722[_0x663c('0x2e')]=_[_0x663c('0x2c')](_0x16f30b[_0x663c('0x2e')]);_0x46d722[_0x663c('0x2f')]=_[_0x663c('0x30')](_0x46d722['model'],_0x46d722[_0x663c('0x2e')]);_0x30ff6f['attributes']=_[_0x663c('0x30')](_0x46d722['model'],qs['fields'](_0x16f30b['query'][_0x663c('0x31')]));_0x30ff6f[_0x663c('0x32')]=_0x30ff6f['attributes'][_0x663c('0x33')]?_0x30ff6f[_0x663c('0x32')]:_0x46d722['model'];if(_0x16f30b[_0x663c('0x2e')][_0x663c('0x34')]){_0x30ff6f[_0x663c('0x35')]=[{'all':!![]}];}_0x30ff6f=_[_0x663c('0x36')]({},_0x30ff6f,_0x16f30b[_0x663c('0x37')]);return db['ChatApplication'][_0x663c('0x38')](_0x30ff6f)[_0x663c('0x25')](handleEntityNotFound(_0x274a2a,null))[_0x663c('0x25')](respondWithResult(_0x274a2a,null))['catch'](handleError(_0x274a2a,null));};exports[_0x663c('0x24')]=function(_0x310846,_0x136637){if(_0x310846[_0x663c('0x39')]['id']){delete _0x310846['body']['id'];}return db[_0x663c('0x3a')][_0x663c('0x38')]({'where':{'id':_0x310846[_0x663c('0x2a')]['id']}})[_0x663c('0x25')](handleEntityNotFound(_0x136637,null))['then'](saveUpdates(_0x310846['body'],null))[_0x663c('0x25')](respondWithResult(_0x136637,null))[_0x663c('0x3b')](handleError(_0x136637,null));};exports['destroy']=function(_0x27de09,_0x5d90e2){return db[_0x663c('0x3a')][_0x663c('0x38')]({'where':{'id':_0x27de09['params']['id']}})[_0x663c('0x25')](handleEntityNotFound(_0x5d90e2,null))[_0x663c('0x25')](removeEntity(_0x5d90e2,null))['catch'](handleError(_0x5d90e2,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7e73c39..a6e7e68 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 _0x4c76=['moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x4c76,0x80));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x64c7('0x0'));var logger=require('../../config/logger')(_0x64c7('0x1'));var moment=require(_0x64c7('0x2'));var BPromise=require(_0x64c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64c7('0x4'));var rimraf=require(_0x64c7('0x5'));var config=require(_0x64c7('0x6'));var attributes=require(_0x64c7('0x7'));module['exports']=function(_0x11bc78,_0x299cbf){return _0x11bc78[_0x64c7('0x8')](_0x64c7('0x9'),attributes,{'tableName':_0x64c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64c7('0xb'),'collate':_0x64c7('0xc')});}; \ No newline at end of file +var _0xbf94=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x1923e3,_0x123a69){var _0x9ca0fb=function(_0x752792){while(--_0x752792){_0x1923e3['push'](_0x1923e3['shift']());}};_0x9ca0fb(++_0x123a69);}(_0xbf94,0x146));var _0x4bf9=function(_0x1818cf,_0x3df67c){_0x1818cf=_0x1818cf-0x0;var _0xf45fd4=_0xbf94[_0x1818cf];return _0xf45fd4;};'use strict';var _=require(_0x4bf9('0x0'));var util=require(_0x4bf9('0x1'));var logger=require(_0x4bf9('0x2'))(_0x4bf9('0x3'));var moment=require('moment');var BPromise=require(_0x4bf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bf9('0x5'));var rimraf=require('rimraf');var config=require(_0x4bf9('0x6'));var attributes=require(_0x4bf9('0x7'));module['exports']=function(_0x1ef7f1,_0x5a2932){return _0x1ef7f1[_0x4bf9('0x8')](_0x4bf9('0x9'),attributes,{'tableName':_0x4bf9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bf9('0xb'),'collate':_0x4bf9('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f658884..88fde0a 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 _0xaf95=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0xaf95,0x1e4));var _0x5af9=function(_0x24eb13,_0x9bf446){_0x24eb13=_0x24eb13-0x0;var _0x36d230=_0xaf95[_0x24eb13];return _0x36d230;};'use strict';var _=require(_0x5af9('0x0'));var util=require(_0x5af9('0x1'));var moment=require(_0x5af9('0x2'));var BPromise=require(_0x5af9('0x3'));var rs=require(_0x5af9('0x4'));var fs=require('fs');var Redis=require(_0x5af9('0x5'));var db=require(_0x5af9('0x6'))['db'];var utils=require(_0x5af9('0x7'));var logger=require(_0x5af9('0x8'))(_0x5af9('0x9'));var config=require('../../config/environment');var jayson=require(_0x5af9('0xa'));var client=jayson[_0x5af9('0xb')][_0x5af9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38c506,_0x4347a0,_0x113abb){return new BPromise(function(_0x54fb25,_0x3eb511){return client['request'](_0x38c506,_0x113abb)['then'](function(_0x5a62d9){logger[_0x5af9('0xd')](_0x5af9('0xe'),_0x4347a0,_0x5af9('0xf'));logger['debug'](_0x5af9('0x10'),_0x4347a0,_0x5af9('0xf'),JSON[_0x5af9('0x11')](_0x5a62d9));if(_0x5a62d9[_0x5af9('0x12')]){if(_0x5a62d9[_0x5af9('0x12')][_0x5af9('0x13')]===0x1f4){logger[_0x5af9('0x12')](_0x5af9('0xe'),_0x4347a0,_0x5a62d9[_0x5af9('0x12')][_0x5af9('0x14')]);return _0x3eb511(_0x5a62d9['error'][_0x5af9('0x14')]);}logger[_0x5af9('0x12')]('ChatApplication,\x20%s,\x20%s',_0x4347a0,_0x5a62d9['error'][_0x5af9('0x14')]);return _0x54fb25(_0x5a62d9[_0x5af9('0x12')][_0x5af9('0x14')]);}else{logger[_0x5af9('0xd')](_0x5af9('0xe'),_0x4347a0,_0x5af9('0xf'));_0x54fb25(_0x5a62d9['result'][_0x5af9('0x14')]);}})[_0x5af9('0x15')](function(_0x927a0c){logger[_0x5af9('0x12')](_0x5af9('0xe'),_0x4347a0,_0x927a0c);_0x3eb511(_0x927a0c);});});} \ No newline at end of file +var _0xacc6=['request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5a3b91,_0x48bd35){var _0x4ba82a=function(_0x50ff14){while(--_0x50ff14){_0x5a3b91['push'](_0x5a3b91['shift']());}};_0x4ba82a(++_0x48bd35);}(_0xacc6,0x12c));var _0x6acc=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0xacc6[_0x52b24f];return _0x46ea6b;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6acc('0x4'));var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require('../../config/logger')(_0x6acc('0x7'));var config=require(_0x6acc('0x8'));var jayson=require(_0x6acc('0x9'));var client=jayson[_0x6acc('0xa')][_0x6acc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26fe9e,_0x37a920,_0x343cde){return new BPromise(function(_0x444352,_0x355037){return client[_0x6acc('0xc')](_0x26fe9e,_0x343cde)['then'](function(_0x2ebf02){logger[_0x6acc('0xd')](_0x6acc('0xe'),_0x37a920,_0x6acc('0xf'));logger[_0x6acc('0x10')](_0x6acc('0x11'),_0x37a920,'request\x20sent',JSON[_0x6acc('0x12')](_0x2ebf02));if(_0x2ebf02[_0x6acc('0x13')]){if(_0x2ebf02[_0x6acc('0x13')][_0x6acc('0x14')]===0x1f4){logger['error'](_0x6acc('0xe'),_0x37a920,_0x2ebf02[_0x6acc('0x13')]['message']);return _0x355037(_0x2ebf02['error'][_0x6acc('0x15')]);}logger[_0x6acc('0x13')](_0x6acc('0xe'),_0x37a920,_0x2ebf02['error']['message']);return _0x444352(_0x2ebf02[_0x6acc('0x13')]['message']);}else{logger['info'](_0x6acc('0xe'),_0x37a920,'request\x20sent');_0x444352(_0x2ebf02[_0x6acc('0x16')]['message']);}})[_0x6acc('0x17')](function(_0x1cb2cd){logger[_0x6acc('0x13')](_0x6acc('0xe'),_0x37a920,_0x1cb2cd);_0x355037(_0x1cb2cd);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e9a93ca..cadcac7 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 _0x4ed1=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','destroy','multer','util'];(function(_0x58efe6,_0x131061){var _0x50c36f=function(_0x876f0c){while(--_0x876f0c){_0x58efe6['push'](_0x58efe6['shift']());}};_0x50c36f(++_0x131061);}(_0x4ed1,0xdf));var _0x14ed=function(_0x2e84eb,_0x56cc67){_0x2e84eb=_0x2e84eb-0x0;var _0x36b04b=_0x4ed1[_0x2e84eb];return _0x36b04b;};'use strict';var multer=require(_0x14ed('0x0'));var util=require(_0x14ed('0x1'));var path=require(_0x14ed('0x2'));var timeout=require(_0x14ed('0x3'));var express=require(_0x14ed('0x4'));var router=express['Router']();var fs_extra=require(_0x14ed('0x5'));var auth=require(_0x14ed('0x6'));var interaction=require(_0x14ed('0x7'));var config=require(_0x14ed('0x8'));var controller=require(_0x14ed('0x9'));router['get'](_0x14ed('0xa'),auth[_0x14ed('0xb')](),controller[_0x14ed('0xc')]);router[_0x14ed('0xd')](_0x14ed('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x14ed('0xa'),auth['isAuthenticated'](),controller[_0x14ed('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb9b6=['get','/:id','isAuthenticated','show','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x42a2f4,_0x4213f6){var _0x36b9e1=function(_0x4e3aa6){while(--_0x4e3aa6){_0x42a2f4['push'](_0x42a2f4['shift']());}};_0x36b9e1(++_0x4213f6);}(_0xb9b6,0x181));var _0x6b9b=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xb9b6[_0x2e3107];return _0x833d69;};'use strict';var multer=require(_0x6b9b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6b9b('0x1'));var express=require(_0x6b9b('0x2'));var router=express[_0x6b9b('0x3')]();var fs_extra=require(_0x6b9b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6b9b('0x5'));var config=require(_0x6b9b('0x6'));var controller=require('./chatApplication.controller');router[_0x6b9b('0x7')](_0x6b9b('0x8'),auth[_0x6b9b('0x9')](),controller[_0x6b9b('0xa')]);router[_0x6b9b('0xb')](_0x6b9b('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6b9b('0xc')](_0x6b9b('0x8'),auth[_0x6b9b('0x9')](),controller['destroy']);module[_0x6b9b('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c4c067f..7e9bb6f 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 _0x34f0=['sequelize','exports','STRING'];(function(_0x3f63ae,_0x20abc9){var _0x426fd7=function(_0x59ec1d){while(--_0x59ec1d){_0x3f63ae['push'](_0x3f63ae['shift']());}};_0x426fd7(++_0x20abc9);}(_0x34f0,0x13b));var _0x034f=function(_0x1e6c1d,_0x48124c){_0x1e6c1d=_0x1e6c1d-0x0;var _0x24ce56=_0x34f0[_0x1e6c1d];return _0x24ce56;};'use strict';var Sequelize=require(_0x034f('0x0'));module[_0x034f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x034f('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5ae0=['STRING','BOOLEAN','exports'];(function(_0x2da7c6,_0x479760){var _0x334db5=function(_0x3a1268){while(--_0x3a1268){_0x2da7c6['push'](_0x2da7c6['shift']());}};_0x334db5(++_0x479760);}(_0x5ae0,0xf8));var _0x05ae=function(_0x4e422d,_0x505fc8){_0x4e422d=_0x4e422d-0x0;var _0x3d4f4d=_0x5ae0[_0x4e422d];return _0x3d4f4d;};'use strict';var Sequelize=require('sequelize');module[_0x05ae('0x0')]={'name':{'type':Sequelize[_0x05ae('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x05ae('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 7f82ad7..4e81898 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 _0xd304=['json','offset','count','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','rows','show','keys','intersection','includeAll','catch','create','body','find','params','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','options','removeMembers','ChatInternalMessage','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status'];(function(_0x245e0e,_0xcab6db){var _0xafcff4=function(_0x3ec00c){while(--_0x3ec00c){_0x245e0e['push'](_0x245e0e['shift']());}};_0xafcff4(++_0xcab6db);}(_0xd304,0xf2));var _0x4d30=function(_0x2be849,_0x6db7d2){_0x2be849=_0x2be849-0x0;var _0x7ee8f4=_0xd304[_0x2be849];return _0x7ee8f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d30('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d30('0x1'));var rp=require('request-promise');var moment=require(_0x4d30('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d30('0x3'));var path=require('path');var sox=require(_0x4d30('0x4'));var csv=require(_0x4d30('0x5'));var ejs=require(_0x4d30('0x6'));var fs=require('fs');var fs_extra=require(_0x4d30('0x7'));var _=require(_0x4d30('0x8'));var squel=require(_0x4d30('0x9'));var crypto=require(_0x4d30('0xa'));var jsforce=require(_0x4d30('0xb'));var deskjs=require(_0x4d30('0xc'));var toCsv=require(_0x4d30('0x5'));var querystring=require(_0x4d30('0xd'));var Papa=require('papaparse');var Redis=require(_0x4d30('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d30('0xf'));var hardwareService=require(_0x4d30('0x10'));var logger=require(_0x4d30('0x11'))(_0x4d30('0x12'));var utils=require(_0x4d30('0x13'));var config=require(_0x4d30('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d30('0x15'))['db'];config['redis']=_[_0x4d30('0x16')](config[_0x4d30('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d30('0x18'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x4d30('0x19')](socket);function respondWithStatusCode(_0x1212b5,_0x1303b0){_0x1303b0=_0x1303b0||0xcc;return function(_0x42aab5){if(_0x42aab5){return _0x1212b5[_0x4d30('0x1a')](_0x1303b0);}return _0x1212b5[_0x4d30('0x1b')](_0x1303b0)['end']();};}function respondWithResult(_0x302b05,_0x292bf0){_0x292bf0=_0x292bf0||0xc8;return function(_0x3ff52e){if(_0x3ff52e){return _0x302b05[_0x4d30('0x1b')](_0x292bf0)[_0x4d30('0x1c')](_0x3ff52e);}};}function respondWithFilteredResult(_0x1f0c86,_0x89de7f){return function(_0x1ea66e){if(_0x1ea66e){var _0x41e2d9=typeof _0x89de7f[_0x4d30('0x1d')]==='undefined'&&typeof _0x89de7f['limit']==='undefined';var _0xfbd952=_0x1ea66e[_0x4d30('0x1e')];var _0x5c55a3=_0x41e2d9?0x0:_0x89de7f['offset'];var _0x3cfaaf=_0x41e2d9?_0x1ea66e[_0x4d30('0x1e')]:_0x89de7f[_0x4d30('0x1d')]+_0x89de7f[_0x4d30('0x1f')];var _0x48f78c;if(_0x3cfaaf>=_0xfbd952){_0x3cfaaf=_0xfbd952;_0x48f78c=0xc8;}else{_0x48f78c=0xce;}_0x1f0c86['status'](_0x48f78c);return _0x1f0c86['set'](_0x4d30('0x20'),_0x5c55a3+'-'+_0x3cfaaf+'/'+_0xfbd952)[_0x4d30('0x1c')](_0x1ea66e);}return null;};}function patchUpdates(_0x2a65ae){return function(_0x5c5ef0){try{jsonpatch[_0x4d30('0x21')](_0x5c5ef0,_0x2a65ae,!![]);}catch(_0x289d5e){return BPromise[_0x4d30('0x22')](_0x289d5e);}return _0x5c5ef0[_0x4d30('0x23')]();};}function saveUpdates(_0xb4281,_0x1d1687){return function(_0x6e2a7){if(_0x6e2a7){return _0x6e2a7[_0x4d30('0x24')](_0xb4281)['then'](function(_0x48a6ae){return _0x48a6ae;});}return null;};}function removeEntity(_0x559bab,_0x2234a3){return function(_0x4d1759){if(_0x4d1759){return _0x4d1759['destroy']()[_0x4d30('0x25')](function(){_0x559bab[_0x4d30('0x1b')](0xcc)[_0x4d30('0x26')]();});}};}function handleEntityNotFound(_0x1333cc,_0x4501d5){return function(_0xe9b7e6){if(!_0xe9b7e6){_0x1333cc['sendStatus'](0x194);}return _0xe9b7e6;};}function handleError(_0x32cc59,_0x2feb6a){_0x2feb6a=_0x2feb6a||0x1f4;return function(_0x5362c0){logger[_0x4d30('0x27')](_0x5362c0[_0x4d30('0x28')]);if(_0x5362c0[_0x4d30('0x29')]){delete _0x5362c0[_0x4d30('0x29')];}_0x32cc59[_0x4d30('0x1b')](_0x2feb6a)['send'](_0x5362c0);};}exports[_0x4d30('0x2a')]=function(_0xa01d24,_0x20e1be){var _0x18f847={},_0x5a8189={},_0x20573c={'count':0x0,'rows':[]};var _0x3881e3=_[_0x4d30('0x2b')](db[_0x4d30('0x2c')][_0x4d30('0x2d')],function(_0x4bca45){return{'name':_0x4bca45[_0x4d30('0x2e')],'type':_0x4bca45[_0x4d30('0x2f')][_0x4d30('0x30')]};});_0x5a8189[_0x4d30('0x31')]=_[_0x4d30('0x2b')](_0x3881e3,'name');_0x5a8189[_0x4d30('0x32')]=_['keys'](_0xa01d24[_0x4d30('0x32')]);_0x5a8189[_0x4d30('0x33')]=_['intersection'](_0x5a8189[_0x4d30('0x31')],_0x5a8189[_0x4d30('0x32')]);_0x18f847['attributes']=_['intersection'](_0x5a8189['model'],qs[_0x4d30('0x34')](_0xa01d24[_0x4d30('0x32')][_0x4d30('0x34')]));_0x18f847[_0x4d30('0x35')]=_0x18f847[_0x4d30('0x35')][_0x4d30('0x36')]?_0x18f847[_0x4d30('0x35')]:_0x5a8189['model'];if(!_0xa01d24[_0x4d30('0x32')][_0x4d30('0x37')](_0x4d30('0x38'))){_0x18f847[_0x4d30('0x1f')]=qs[_0x4d30('0x1f')](_0xa01d24[_0x4d30('0x32')][_0x4d30('0x1f')]);_0x18f847[_0x4d30('0x1d')]=qs[_0x4d30('0x1d')](_0xa01d24[_0x4d30('0x32')][_0x4d30('0x1d')]);}_0x18f847[_0x4d30('0x39')]=qs[_0x4d30('0x3a')](_0xa01d24[_0x4d30('0x32')][_0x4d30('0x3a')]);_0x18f847[_0x4d30('0x3b')]=qs[_0x4d30('0x33')](_[_0x4d30('0x3c')](_0xa01d24[_0x4d30('0x32')],_0x5a8189[_0x4d30('0x33')]),_0x3881e3);if(_0xa01d24[_0x4d30('0x32')][_0x4d30('0x3d')]){_0x18f847[_0x4d30('0x3b')]=_['merge'](_0x18f847[_0x4d30('0x3b')],{'$or':_[_0x4d30('0x2b')](_0x3881e3,function(_0x17d7ce){if(_0x17d7ce[_0x4d30('0x2f')]!==_0x4d30('0x3e')){var _0x1408e6={};_0x1408e6[_0x17d7ce[_0x4d30('0x29')]]={'$like':'%'+_0xa01d24[_0x4d30('0x32')]['filter']+'%'};return _0x1408e6;}})});}_0x18f847=_[_0x4d30('0x3f')]({},_0x18f847,_0xa01d24['options']);var _0x514ea0={'where':_0x18f847[_0x4d30('0x3b')]};return db['ChatGroup'][_0x4d30('0x1e')](_0x514ea0)['then'](function(_0x652b4e){_0x20573c[_0x4d30('0x1e')]=_0x652b4e;if(_0xa01d24[_0x4d30('0x32')]['includeAll']){_0x18f847[_0x4d30('0x40')]=[{'all':!![]}];}return db[_0x4d30('0x2c')]['findAll'](_0x18f847);})['then'](function(_0x2d32ec){_0x20573c[_0x4d30('0x41')]=_0x2d32ec;return _0x20573c;})[_0x4d30('0x25')](respondWithFilteredResult(_0x20e1be,_0x18f847))['catch'](handleError(_0x20e1be,null));};exports[_0x4d30('0x42')]=function(_0x247d5,_0x13f578){var _0x18bf0d={'raw':!![],'where':{'id':_0x247d5['params']['id']}},_0xd5f628={};_0xd5f628['model']=_['keys'](db[_0x4d30('0x2c')][_0x4d30('0x2d')]);_0xd5f628[_0x4d30('0x32')]=_[_0x4d30('0x43')](_0x247d5[_0x4d30('0x32')]);_0xd5f628[_0x4d30('0x33')]=_['intersection'](_0xd5f628[_0x4d30('0x31')],_0xd5f628[_0x4d30('0x32')]);_0x18bf0d['attributes']=_[_0x4d30('0x44')](_0xd5f628['model'],qs[_0x4d30('0x34')](_0x247d5[_0x4d30('0x32')]['fields']));_0x18bf0d[_0x4d30('0x35')]=_0x18bf0d[_0x4d30('0x35')]['length']?_0x18bf0d[_0x4d30('0x35')]:_0xd5f628[_0x4d30('0x31')];if(_0x247d5[_0x4d30('0x32')][_0x4d30('0x45')]){_0x18bf0d['include']=[{'all':!![]}];}_0x18bf0d=_['merge']({},_0x18bf0d,_0x247d5['options']);return db[_0x4d30('0x2c')]['find'](_0x18bf0d)['then'](handleEntityNotFound(_0x13f578,null))[_0x4d30('0x25')](respondWithResult(_0x13f578,null))[_0x4d30('0x46')](handleError(_0x13f578,null));};exports[_0x4d30('0x47')]=function(_0x25cae0,_0x52521d){return db['ChatGroup'][_0x4d30('0x47')](_0x25cae0['body'],{})[_0x4d30('0x25')](respondWithResult(_0x52521d,0xc9))[_0x4d30('0x46')](handleError(_0x52521d,null));};exports[_0x4d30('0x24')]=function(_0x1a99c5,_0x468dbc){if(_0x1a99c5[_0x4d30('0x48')]['id']){delete _0x1a99c5[_0x4d30('0x48')]['id'];}return db['ChatGroup'][_0x4d30('0x49')]({'where':{'id':_0x1a99c5[_0x4d30('0x4a')]['id']}})['then'](handleEntityNotFound(_0x468dbc,null))[_0x4d30('0x25')](saveUpdates(_0x1a99c5[_0x4d30('0x48')],null))[_0x4d30('0x25')](respondWithResult(_0x468dbc,null))[_0x4d30('0x46')](handleError(_0x468dbc,null));};exports['destroy']=function(_0x3273b1,_0xb92abf){return db[_0x4d30('0x2c')][_0x4d30('0x49')]({'where':{'id':_0x3273b1[_0x4d30('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb92abf,null))[_0x4d30('0x25')](removeEntity(_0xb92abf,null))['catch'](handleError(_0xb92abf,null));};exports['describe']=function(_0x2e1ed0,_0x245987){return db[_0x4d30('0x2c')][_0x4d30('0x4b')]()['then'](respondWithResult(_0x245987,null))['catch'](handleError(_0x245987,null));};exports[_0x4d30('0x4c')]=function(_0x297bbd,_0x1373d6,_0x23a180){return db['ChatInternalMessage'][_0x4d30('0x1e')]({'where':{'ChatGroupId':_0x297bbd['params']['id'],'ToId':_0x297bbd[_0x4d30('0x4d')]['id'],'read':![]}})['then'](function(_0x3c20db){return{'id':_[_0x4d30('0x4e')](_0x297bbd[_0x4d30('0x4a')]['id']),'count':_0x3c20db};})[_0x4d30('0x25')](respondWithResult(_0x1373d6,null))[_0x4d30('0x46')](handleError(_0x1373d6,null));};exports[_0x4d30('0x4f')]=function(_0x4d3e6b,_0x16406b,_0xde5419){return db[_0x4d30('0x2c')]['find']({'where':{'id':_0x4d3e6b[_0x4d30('0x4a')]['id']}})[_0x4d30('0x25')](handleEntityNotFound(_0x16406b,null))[_0x4d30('0x25')](function(_0x453978){if(_0x453978){return _0x453978[_0x4d30('0x4f')](_0x4d3e6b[_0x4d30('0x48')][_0x4d30('0x50')],_['omit'](_0x4d3e6b[_0x4d30('0x48')],['ids','id'])||{});}})[_0x4d30('0x25')](respondWithResult(_0x16406b,null))['catch'](handleError(_0x16406b,null));};exports[_0x4d30('0x51')]=function(_0x3d6228,_0x35fe8e,_0x708cc7){var _0x41434e={};var _0x457ca0={};var _0x4ade6b;var _0x414cfd;return db[_0x4d30('0x2c')][_0x4d30('0x52')]({'where':{'id':_0x3d6228[_0x4d30('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35fe8e,null))[_0x4d30('0x25')](function(_0x3cf1ce){if(_0x3cf1ce){_0x4ade6b=_0x3cf1ce;_0x457ca0[_0x4d30('0x31')]=_[_0x4d30('0x43')](db['User']['rawAttributes']);_0x457ca0[_0x4d30('0x32')]=_[_0x4d30('0x43')](_0x3d6228[_0x4d30('0x32')]);_0x457ca0[_0x4d30('0x33')]=_['intersection'](_0x457ca0[_0x4d30('0x31')],_0x457ca0['query']);_0x41434e[_0x4d30('0x35')]=_[_0x4d30('0x44')](_0x457ca0[_0x4d30('0x31')],qs['fields'](_0x3d6228['query'][_0x4d30('0x34')]));_0x41434e['attributes']=_0x41434e[_0x4d30('0x35')][_0x4d30('0x36')]?_0x41434e[_0x4d30('0x35')]:_0x457ca0[_0x4d30('0x31')];_0x41434e[_0x4d30('0x39')]=qs[_0x4d30('0x3a')](_0x3d6228[_0x4d30('0x32')][_0x4d30('0x3a')]);_0x41434e[_0x4d30('0x3b')]=qs[_0x4d30('0x33')](_[_0x4d30('0x3c')](_0x3d6228[_0x4d30('0x32')],_0x457ca0[_0x4d30('0x33')]));if(_0x3d6228[_0x4d30('0x32')][_0x4d30('0x3d')]){_0x41434e[_0x4d30('0x3b')]=_[_0x4d30('0x3f')](_0x41434e[_0x4d30('0x3b')],{'$or':_[_0x4d30('0x2b')](_0x41434e[_0x4d30('0x35')],function(_0x594501){var _0x12846b={};_0x12846b[_0x594501]={'$like':'%'+_0x3d6228[_0x4d30('0x32')][_0x4d30('0x3d')]+'%'};return _0x12846b;})});}_0x41434e=_[_0x4d30('0x3f')]({},_0x41434e,_0x3d6228[_0x4d30('0x53')]);return _0x4ade6b[_0x4d30('0x51')](_0x41434e);}})['then'](function(_0x35fa7a){if(_0x35fa7a){_0x414cfd=_0x35fa7a['length'];if(!_0x3d6228[_0x4d30('0x32')][_0x4d30('0x37')](_0x4d30('0x38'))){_0x41434e['limit']=qs[_0x4d30('0x1f')](_0x3d6228[_0x4d30('0x32')][_0x4d30('0x1f')]);_0x41434e['offset']=qs[_0x4d30('0x1d')](_0x3d6228[_0x4d30('0x32')][_0x4d30('0x1d')]);}return _0x4ade6b[_0x4d30('0x51')](_0x41434e);}})[_0x4d30('0x25')](function(_0x4b64db){if(_0x4b64db){return _0x4b64db?{'count':_0x414cfd,'rows':_0x4b64db}:null;}})[_0x4d30('0x25')](respondWithResult(_0x35fe8e,null))[_0x4d30('0x46')](handleError(_0x35fe8e,null));};exports[_0x4d30('0x54')]=function(_0x58e807,_0x17b817,_0x32f31b){return db[_0x4d30('0x2c')][_0x4d30('0x49')]({'where':{'id':_0x58e807[_0x4d30('0x4a')]['id']}})['then'](handleEntityNotFound(_0x17b817,null))['then'](function(_0x551e2e){if(_0x551e2e){return _0x551e2e[_0x4d30('0x54')](_0x58e807[_0x4d30('0x32')]['ids']);}})[_0x4d30('0x25')](respondWithStatusCode(_0x17b817,null))[_0x4d30('0x46')](handleError(_0x17b817,null));};exports['addMessage']=function(_0x2e6e9b,_0x527bc7,_0x3f3a82){if(_0x2e6e9b[_0x4d30('0x48')]['id']){delete _0x2e6e9b['body']['id'];}return db[_0x4d30('0x2c')]['find']({'where':{'id':_0x2e6e9b[_0x4d30('0x4a')]['id']}})[_0x4d30('0x25')](handleEntityNotFound(_0x527bc7,null))[_0x4d30('0x25')](function(_0x52040a){if(_0x52040a){_0x2e6e9b['body']['ChatGroupId']=_0x52040a['id'];return db[_0x4d30('0x55')]['create'](_0x2e6e9b[_0x4d30('0x48')]);}})[_0x4d30('0x25')](respondWithResult(_0x527bc7,null))[_0x4d30('0x46')](handleError(_0x527bc7,null));};exports[_0x4d30('0x56')]=function(_0x4eaefc,_0x2955a3,_0x777af3){var _0x27edb7={};var _0x191d7a={};var _0x1b977e;var _0x2c862c;return db[_0x4d30('0x2c')][_0x4d30('0x52')]({'where':{'id':_0x4eaefc['params']['id']}})[_0x4d30('0x25')](handleEntityNotFound(_0x2955a3,null))['then'](function(_0x42cb9f){if(_0x42cb9f){_0x1b977e=_0x42cb9f;_0x191d7a['model']=_[_0x4d30('0x43')](db[_0x4d30('0x55')][_0x4d30('0x2d')]);_0x191d7a[_0x4d30('0x32')]=_[_0x4d30('0x43')](_0x4eaefc[_0x4d30('0x32')]);_0x191d7a['filters']=_[_0x4d30('0x44')](_0x191d7a['model'],_0x191d7a[_0x4d30('0x32')]);_0x27edb7[_0x4d30('0x35')]=_[_0x4d30('0x44')](_0x191d7a[_0x4d30('0x31')],qs[_0x4d30('0x34')](_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x34')]));_0x27edb7[_0x4d30('0x35')]=_0x27edb7[_0x4d30('0x35')]['length']?_0x27edb7[_0x4d30('0x35')]:_0x191d7a[_0x4d30('0x31')];_0x27edb7[_0x4d30('0x39')]=qs['sort'](_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x3a')]);_0x27edb7[_0x4d30('0x3b')]=qs[_0x4d30('0x33')](_[_0x4d30('0x3c')](_0x4eaefc[_0x4d30('0x32')],_0x191d7a[_0x4d30('0x33')]));if(_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x3d')]){_0x27edb7['where']=_[_0x4d30('0x3f')](_0x27edb7[_0x4d30('0x3b')],{'$or':_[_0x4d30('0x2b')](_0x27edb7['attributes'],function(_0x5a6fc1){var _0x176106={};_0x176106[_0x5a6fc1]={'$like':'%'+_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x3d')]+'%'};return _0x176106;})});}if(_0x4eaefc['query']['$gte']){var _0x3c6c3f=_0x4eaefc[_0x4d30('0x32')]['$gte'][_0x4d30('0x57')](',');var _0x55fed9={};_0x55fed9[_0x3c6c3f[0x0]]={'$gte':moment(_0x3c6c3f[0x1])[_0x4d30('0x58')](_0x4d30('0x59'))};_0x27edb7['where']=_[_0x4d30('0x3f')](_0x27edb7[_0x4d30('0x3b')],_0x55fed9);}_0x27edb7=_['merge']({},_0x27edb7,_0x4eaefc['options']);return _0x1b977e[_0x4d30('0x56')](_0x27edb7);}})['then'](function(_0x384fda){if(_0x384fda){_0x2c862c=_0x384fda[_0x4d30('0x36')];if(!_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x37')]('nolimit')){_0x27edb7[_0x4d30('0x1f')]=qs[_0x4d30('0x1f')](_0x4eaefc[_0x4d30('0x32')][_0x4d30('0x1f')]);_0x27edb7[_0x4d30('0x1d')]=qs[_0x4d30('0x1d')](_0x4eaefc[_0x4d30('0x32')]['offset']);}return _0x1b977e['getMessages'](_0x27edb7);}})[_0x4d30('0x25')](function(_0x1e75fc){if(_0x1e75fc){return _0x1e75fc?{'count':_0x2c862c,'rows':_0x1e75fc}:null;}})[_0x4d30('0x25')](respondWithResult(_0x2955a3,null))[_0x4d30('0x46')](handleError(_0x2955a3,null));}; \ No newline at end of file +var _0x660e=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','update','body','params','describe','toInteger','addMembers','omit','getMembers','findOne','User','removeMembers','ids','addMessage','ChatGroupId','ChatInternalMessage','pick','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis'];(function(_0x864853,_0x1b7287){var _0x2d1509=function(_0x3c8ed2){while(--_0x3c8ed2){_0x864853['push'](_0x864853['shift']());}};_0x2d1509(++_0x1b7287);}(_0x660e,0x1c6));var _0xe660=function(_0x1b69f5,_0x528d25){_0x1b69f5=_0x1b69f5-0x0;var _0x35fbfb=_0x660e[_0x1b69f5];return _0x35fbfb;};'use strict';var emlformat=require(_0xe660('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe660('0x1'));var jsonpatch=require(_0xe660('0x2'));var rp=require('request-promise');var moment=require(_0xe660('0x3'));var BPromise=require(_0xe660('0x4'));var Mustache=require('mustache');var util=require(_0xe660('0x5'));var path=require(_0xe660('0x6'));var sox=require(_0xe660('0x7'));var csv=require(_0xe660('0x8'));var ejs=require(_0xe660('0x9'));var fs=require('fs');var fs_extra=require(_0xe660('0xa'));var _=require(_0xe660('0xb'));var squel=require('squel');var crypto=require(_0xe660('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe660('0xd'));var toCsv=require(_0xe660('0x8'));var querystring=require(_0xe660('0xe'));var Papa=require('papaparse');var Redis=require(_0xe660('0xf'));var authService=require(_0xe660('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe660('0x11'));var logger=require(_0xe660('0x12'))(_0xe660('0x13'));var utils=require(_0xe660('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe660('0x15'));var db=require(_0xe660('0x16'))['db'];config[_0xe660('0x17')]=_['defaults'](config[_0xe660('0x17')],{'host':_0xe660('0x18'),'port':0x18eb});var socket=require(_0xe660('0x19'))(new Redis(config[_0xe660('0x17')]));require(_0xe660('0x1a'))['register'](socket);function respondWithStatusCode(_0x2fb757,_0x502c47){_0x502c47=_0x502c47||0xcc;return function(_0x156d2b){if(_0x156d2b){return _0x2fb757[_0xe660('0x1b')](_0x502c47);}return _0x2fb757[_0xe660('0x1c')](_0x502c47)['end']();};}function respondWithResult(_0x5c894f,_0x11519a){_0x11519a=_0x11519a||0xc8;return function(_0x194836){if(_0x194836){return _0x5c894f[_0xe660('0x1c')](_0x11519a)[_0xe660('0x1d')](_0x194836);}};}function respondWithFilteredResult(_0x2a0356,_0x13c3a5){return function(_0x33a32e){if(_0x33a32e){var _0x5df609=typeof _0x13c3a5['offset']===_0xe660('0x1e')&&typeof _0x13c3a5['limit']===_0xe660('0x1e');var _0x324198=_0x33a32e['count'];var _0x1df447=_0x5df609?0x0:_0x13c3a5['offset'];var _0x4eedd0=_0x5df609?_0x33a32e[_0xe660('0x1f')]:_0x13c3a5[_0xe660('0x20')]+_0x13c3a5[_0xe660('0x21')];var _0x18aff9;if(_0x4eedd0>=_0x324198){_0x4eedd0=_0x324198;_0x18aff9=0xc8;}else{_0x18aff9=0xce;}_0x2a0356['status'](_0x18aff9);return _0x2a0356[_0xe660('0x22')](_0xe660('0x23'),_0x1df447+'-'+_0x4eedd0+'/'+_0x324198)[_0xe660('0x1d')](_0x33a32e);}return null;};}function patchUpdates(_0x395870){return function(_0x30e2fa){try{jsonpatch[_0xe660('0x24')](_0x30e2fa,_0x395870,!![]);}catch(_0x38a89d){return BPromise[_0xe660('0x25')](_0x38a89d);}return _0x30e2fa[_0xe660('0x26')]();};}function saveUpdates(_0x30adad,_0x218032){return function(_0x54177a){if(_0x54177a){return _0x54177a['update'](_0x30adad)['then'](function(_0x4ca9f5){return _0x4ca9f5;});}return null;};}function removeEntity(_0x15871f,_0x18f95c){return function(_0x5412ca){if(_0x5412ca){return _0x5412ca[_0xe660('0x27')]()[_0xe660('0x28')](function(){_0x15871f[_0xe660('0x1c')](0xcc)[_0xe660('0x29')]();});}};}function handleEntityNotFound(_0x13e640,_0x1f2ac9){return function(_0x2d10e5){if(!_0x2d10e5){_0x13e640['sendStatus'](0x194);}return _0x2d10e5;};}function handleError(_0x180498,_0x1ecb7c){_0x1ecb7c=_0x1ecb7c||0x1f4;return function(_0xa1586c){logger[_0xe660('0x2a')](_0xa1586c[_0xe660('0x2b')]);if(_0xa1586c[_0xe660('0x2c')]){delete _0xa1586c[_0xe660('0x2c')];}_0x180498[_0xe660('0x1c')](_0x1ecb7c)[_0xe660('0x2d')](_0xa1586c);};}exports[_0xe660('0x2e')]=function(_0x5e7d25,_0x42dfb5){var _0x11cbb2={},_0xc0d754={},_0x2b9b06={'count':0x0,'rows':[]};var _0xb05440=_[_0xe660('0x2f')](db[_0xe660('0x30')][_0xe660('0x31')],function(_0x710911){return{'name':_0x710911[_0xe660('0x32')],'type':_0x710911[_0xe660('0x33')]['key']};});_0xc0d754['model']=_['map'](_0xb05440,_0xe660('0x2c'));_0xc0d754[_0xe660('0x34')]=_[_0xe660('0x35')](_0x5e7d25[_0xe660('0x34')]);_0xc0d754[_0xe660('0x36')]=_['intersection'](_0xc0d754['model'],_0xc0d754[_0xe660('0x34')]);_0x11cbb2['attributes']=_[_0xe660('0x37')](_0xc0d754[_0xe660('0x38')],qs['fields'](_0x5e7d25[_0xe660('0x34')][_0xe660('0x39')]));_0x11cbb2['attributes']=_0x11cbb2[_0xe660('0x3a')]['length']?_0x11cbb2[_0xe660('0x3a')]:_0xc0d754[_0xe660('0x38')];if(!_0x5e7d25[_0xe660('0x34')]['hasOwnProperty'](_0xe660('0x3b'))){_0x11cbb2[_0xe660('0x21')]=qs['limit'](_0x5e7d25[_0xe660('0x34')][_0xe660('0x21')]);_0x11cbb2['offset']=qs[_0xe660('0x20')](_0x5e7d25[_0xe660('0x34')][_0xe660('0x20')]);}_0x11cbb2[_0xe660('0x3c')]=qs[_0xe660('0x3d')](_0x5e7d25['query'][_0xe660('0x3d')]);_0x11cbb2[_0xe660('0x3e')]=qs[_0xe660('0x36')](_['pick'](_0x5e7d25[_0xe660('0x34')],_0xc0d754[_0xe660('0x36')]),_0xb05440);if(_0x5e7d25[_0xe660('0x34')][_0xe660('0x3f')]){_0x11cbb2['where']=_[_0xe660('0x40')](_0x11cbb2[_0xe660('0x3e')],{'$or':_[_0xe660('0x2f')](_0xb05440,function(_0x24dd3e){if(_0x24dd3e['type']!=='VIRTUAL'){var _0x57a5e6={};_0x57a5e6[_0x24dd3e[_0xe660('0x2c')]]={'$like':'%'+_0x5e7d25[_0xe660('0x34')][_0xe660('0x3f')]+'%'};return _0x57a5e6;}})});}_0x11cbb2=_[_0xe660('0x40')]({},_0x11cbb2,_0x5e7d25['options']);var _0x300bdd={'where':_0x11cbb2[_0xe660('0x3e')]};return db[_0xe660('0x30')]['count'](_0x300bdd)[_0xe660('0x28')](function(_0x284825){_0x2b9b06[_0xe660('0x1f')]=_0x284825;if(_0x5e7d25[_0xe660('0x34')][_0xe660('0x41')]){_0x11cbb2[_0xe660('0x42')]=[{'all':!![]}];}return db[_0xe660('0x30')][_0xe660('0x43')](_0x11cbb2);})['then'](function(_0x222b79){_0x2b9b06[_0xe660('0x44')]=_0x222b79;return _0x2b9b06;})[_0xe660('0x28')](respondWithFilteredResult(_0x42dfb5,_0x11cbb2))[_0xe660('0x45')](handleError(_0x42dfb5,null));};exports[_0xe660('0x46')]=function(_0x13fc20,_0x378fdb){var _0x3d218={'raw':!![],'where':{'id':_0x13fc20['params']['id']}},_0x596944={};_0x596944['model']=_[_0xe660('0x35')](db['ChatGroup'][_0xe660('0x31')]);_0x596944['query']=_[_0xe660('0x35')](_0x13fc20['query']);_0x596944[_0xe660('0x36')]=_['intersection'](_0x596944[_0xe660('0x38')],_0x596944['query']);_0x3d218['attributes']=_[_0xe660('0x37')](_0x596944[_0xe660('0x38')],qs[_0xe660('0x39')](_0x13fc20['query'][_0xe660('0x39')]));_0x3d218['attributes']=_0x3d218[_0xe660('0x3a')][_0xe660('0x47')]?_0x3d218[_0xe660('0x3a')]:_0x596944[_0xe660('0x38')];if(_0x13fc20[_0xe660('0x34')][_0xe660('0x41')]){_0x3d218[_0xe660('0x42')]=[{'all':!![]}];}_0x3d218=_[_0xe660('0x40')]({},_0x3d218,_0x13fc20[_0xe660('0x48')]);return db[_0xe660('0x30')][_0xe660('0x49')](_0x3d218)[_0xe660('0x28')](handleEntityNotFound(_0x378fdb,null))[_0xe660('0x28')](respondWithResult(_0x378fdb,null))[_0xe660('0x45')](handleError(_0x378fdb,null));};exports[_0xe660('0x4a')]=function(_0xeebe22,_0x476dcf){return db[_0xe660('0x30')]['create'](_0xeebe22['body'],{})['then'](respondWithResult(_0x476dcf,0xc9))[_0xe660('0x45')](handleError(_0x476dcf,null));};exports[_0xe660('0x4b')]=function(_0x3cdee6,_0x323823){if(_0x3cdee6[_0xe660('0x4c')]['id']){delete _0x3cdee6['body']['id'];}return db['ChatGroup'][_0xe660('0x49')]({'where':{'id':_0x3cdee6[_0xe660('0x4d')]['id']}})['then'](handleEntityNotFound(_0x323823,null))[_0xe660('0x28')](saveUpdates(_0x3cdee6[_0xe660('0x4c')],null))['then'](respondWithResult(_0x323823,null))[_0xe660('0x45')](handleError(_0x323823,null));};exports[_0xe660('0x27')]=function(_0x1dd58b,_0x33a59f){return db['ChatGroup'][_0xe660('0x49')]({'where':{'id':_0x1dd58b[_0xe660('0x4d')]['id']}})[_0xe660('0x28')](handleEntityNotFound(_0x33a59f,null))[_0xe660('0x28')](removeEntity(_0x33a59f,null))[_0xe660('0x45')](handleError(_0x33a59f,null));};exports[_0xe660('0x4e')]=function(_0x306115,_0x5b5c2c){return db[_0xe660('0x30')][_0xe660('0x4e')]()[_0xe660('0x28')](respondWithResult(_0x5b5c2c,null))['catch'](handleError(_0x5b5c2c,null));};exports['getUnread']=function(_0x5e00dc,_0x5a89d5,_0x2c445b){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x5e00dc[_0xe660('0x4d')]['id'],'ToId':_0x5e00dc['user']['id'],'read':![]}})[_0xe660('0x28')](function(_0x9f8567){return{'id':_[_0xe660('0x4f')](_0x5e00dc['params']['id']),'count':_0x9f8567};})[_0xe660('0x28')](respondWithResult(_0x5a89d5,null))[_0xe660('0x45')](handleError(_0x5a89d5,null));};exports[_0xe660('0x50')]=function(_0x5bf95c,_0x112963,_0x4f378b){return db[_0xe660('0x30')]['find']({'where':{'id':_0x5bf95c[_0xe660('0x4d')]['id']}})[_0xe660('0x28')](handleEntityNotFound(_0x112963,null))['then'](function(_0x24449a){if(_0x24449a){return _0x24449a['addMembers'](_0x5bf95c[_0xe660('0x4c')]['ids'],_[_0xe660('0x51')](_0x5bf95c[_0xe660('0x4c')],['ids','id'])||{});}})[_0xe660('0x28')](respondWithResult(_0x112963,null))[_0xe660('0x45')](handleError(_0x112963,null));};exports[_0xe660('0x52')]=function(_0x4ac23c,_0x18ed61,_0x34f23e){var _0x50eefb={};var _0x42f751={};var _0x3c5af6;var _0x2b6c3f;return db[_0xe660('0x30')][_0xe660('0x53')]({'where':{'id':_0x4ac23c[_0xe660('0x4d')]['id']}})[_0xe660('0x28')](handleEntityNotFound(_0x18ed61,null))[_0xe660('0x28')](function(_0x20941e){if(_0x20941e){_0x3c5af6=_0x20941e;_0x42f751[_0xe660('0x38')]=_[_0xe660('0x35')](db[_0xe660('0x54')][_0xe660('0x31')]);_0x42f751[_0xe660('0x34')]=_[_0xe660('0x35')](_0x4ac23c['query']);_0x42f751[_0xe660('0x36')]=_['intersection'](_0x42f751[_0xe660('0x38')],_0x42f751[_0xe660('0x34')]);_0x50eefb[_0xe660('0x3a')]=_[_0xe660('0x37')](_0x42f751[_0xe660('0x38')],qs[_0xe660('0x39')](_0x4ac23c['query'][_0xe660('0x39')]));_0x50eefb['attributes']=_0x50eefb['attributes'][_0xe660('0x47')]?_0x50eefb[_0xe660('0x3a')]:_0x42f751[_0xe660('0x38')];_0x50eefb[_0xe660('0x3c')]=qs[_0xe660('0x3d')](_0x4ac23c[_0xe660('0x34')][_0xe660('0x3d')]);_0x50eefb[_0xe660('0x3e')]=qs[_0xe660('0x36')](_['pick'](_0x4ac23c[_0xe660('0x34')],_0x42f751[_0xe660('0x36')]));if(_0x4ac23c['query'][_0xe660('0x3f')]){_0x50eefb[_0xe660('0x3e')]=_['merge'](_0x50eefb[_0xe660('0x3e')],{'$or':_[_0xe660('0x2f')](_0x50eefb['attributes'],function(_0x36eb45){var _0x239717={};_0x239717[_0x36eb45]={'$like':'%'+_0x4ac23c[_0xe660('0x34')]['filter']+'%'};return _0x239717;})});}_0x50eefb=_[_0xe660('0x40')]({},_0x50eefb,_0x4ac23c[_0xe660('0x48')]);return _0x3c5af6[_0xe660('0x52')](_0x50eefb);}})['then'](function(_0x541b42){if(_0x541b42){_0x2b6c3f=_0x541b42[_0xe660('0x47')];if(!_0x4ac23c[_0xe660('0x34')]['hasOwnProperty'](_0xe660('0x3b'))){_0x50eefb['limit']=qs['limit'](_0x4ac23c[_0xe660('0x34')][_0xe660('0x21')]);_0x50eefb[_0xe660('0x20')]=qs['offset'](_0x4ac23c['query'][_0xe660('0x20')]);}return _0x3c5af6[_0xe660('0x52')](_0x50eefb);}})[_0xe660('0x28')](function(_0x5191cd){if(_0x5191cd){return _0x5191cd?{'count':_0x2b6c3f,'rows':_0x5191cd}:null;}})['then'](respondWithResult(_0x18ed61,null))[_0xe660('0x45')](handleError(_0x18ed61,null));};exports[_0xe660('0x55')]=function(_0x4ad535,_0x49353f,_0x187ff6){return db[_0xe660('0x30')][_0xe660('0x49')]({'where':{'id':_0x4ad535[_0xe660('0x4d')]['id']}})[_0xe660('0x28')](handleEntityNotFound(_0x49353f,null))[_0xe660('0x28')](function(_0x553504){if(_0x553504){return _0x553504[_0xe660('0x55')](_0x4ad535[_0xe660('0x34')][_0xe660('0x56')]);}})[_0xe660('0x28')](respondWithStatusCode(_0x49353f,null))[_0xe660('0x45')](handleError(_0x49353f,null));};exports[_0xe660('0x57')]=function(_0x1f03f2,_0x1f0777,_0x2349b5){if(_0x1f03f2['body']['id']){delete _0x1f03f2[_0xe660('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1f03f2['params']['id']}})['then'](handleEntityNotFound(_0x1f0777,null))[_0xe660('0x28')](function(_0x224059){if(_0x224059){_0x1f03f2[_0xe660('0x4c')][_0xe660('0x58')]=_0x224059['id'];return db['ChatInternalMessage'][_0xe660('0x4a')](_0x1f03f2[_0xe660('0x4c')]);}})[_0xe660('0x28')](respondWithResult(_0x1f0777,null))[_0xe660('0x45')](handleError(_0x1f0777,null));};exports['getMessages']=function(_0x56f86f,_0x1dcabd,_0x3c84dc){var _0x320b91={};var _0x180e0a={};var _0x40ae18;var _0x5a8602;return db[_0xe660('0x30')][_0xe660('0x53')]({'where':{'id':_0x56f86f[_0xe660('0x4d')]['id']}})[_0xe660('0x28')](handleEntityNotFound(_0x1dcabd,null))[_0xe660('0x28')](function(_0x2ae34a){if(_0x2ae34a){_0x40ae18=_0x2ae34a;_0x180e0a[_0xe660('0x38')]=_[_0xe660('0x35')](db[_0xe660('0x59')][_0xe660('0x31')]);_0x180e0a[_0xe660('0x34')]=_[_0xe660('0x35')](_0x56f86f[_0xe660('0x34')]);_0x180e0a[_0xe660('0x36')]=_[_0xe660('0x37')](_0x180e0a[_0xe660('0x38')],_0x180e0a[_0xe660('0x34')]);_0x320b91[_0xe660('0x3a')]=_['intersection'](_0x180e0a[_0xe660('0x38')],qs[_0xe660('0x39')](_0x56f86f[_0xe660('0x34')][_0xe660('0x39')]));_0x320b91[_0xe660('0x3a')]=_0x320b91[_0xe660('0x3a')][_0xe660('0x47')]?_0x320b91['attributes']:_0x180e0a[_0xe660('0x38')];_0x320b91[_0xe660('0x3c')]=qs['sort'](_0x56f86f[_0xe660('0x34')][_0xe660('0x3d')]);_0x320b91[_0xe660('0x3e')]=qs['filters'](_[_0xe660('0x5a')](_0x56f86f['query'],_0x180e0a[_0xe660('0x36')]));if(_0x56f86f[_0xe660('0x34')][_0xe660('0x3f')]){_0x320b91[_0xe660('0x3e')]=_[_0xe660('0x40')](_0x320b91[_0xe660('0x3e')],{'$or':_[_0xe660('0x2f')](_0x320b91[_0xe660('0x3a')],function(_0x57344b){var _0x4d7ad6={};_0x4d7ad6[_0x57344b]={'$like':'%'+_0x56f86f[_0xe660('0x34')][_0xe660('0x3f')]+'%'};return _0x4d7ad6;})});}if(_0x56f86f[_0xe660('0x34')]['$gte']){var _0x25e8e2=_0x56f86f[_0xe660('0x34')]['$gte'][_0xe660('0x5b')](',');var _0x51b9a7={};_0x51b9a7[_0x25e8e2[0x0]]={'$gte':moment(_0x25e8e2[0x1])['format'](_0xe660('0x5c'))};_0x320b91[_0xe660('0x3e')]=_[_0xe660('0x40')](_0x320b91[_0xe660('0x3e')],_0x51b9a7);}_0x320b91=_[_0xe660('0x40')]({},_0x320b91,_0x56f86f[_0xe660('0x48')]);return _0x40ae18[_0xe660('0x5d')](_0x320b91);}})['then'](function(_0x4c70f0){if(_0x4c70f0){_0x5a8602=_0x4c70f0[_0xe660('0x47')];if(!_0x56f86f[_0xe660('0x34')]['hasOwnProperty'](_0xe660('0x3b'))){_0x320b91[_0xe660('0x21')]=qs['limit'](_0x56f86f['query'][_0xe660('0x21')]);_0x320b91[_0xe660('0x20')]=qs[_0xe660('0x20')](_0x56f86f[_0xe660('0x34')][_0xe660('0x20')]);}return _0x40ae18[_0xe660('0x5d')](_0x320b91);}})[_0xe660('0x28')](function(_0x239644){if(_0x239644){return _0x239644?{'count':_0x5a8602,'rows':_0x239644}:null;}})['then'](respondWithResult(_0x1dcabd,null))['catch'](handleError(_0x1dcabd,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 41b93a7..ae8aeee 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 _0x8bcf=['update','remove','emit','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x8bcf,0x1be));var _0xf8bc=function(_0x50b2c4,_0x22747a){_0x50b2c4=_0x50b2c4-0x0;var _0x6c9879=_0x8bcf[_0x50b2c4];return _0x6c9879;};'use strict';var EventEmitter=require(_0xf8bc('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xf8bc('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf8bc('0x2')](0x0);var events={'afterCreate':_0xf8bc('0x3'),'afterUpdate':_0xf8bc('0x4'),'afterDestroy':_0xf8bc('0x5')};function emitEvent(_0x3177b8){return function(_0x3f6d71,_0xfd0ffd,_0x26726a){ChatGroupEvents[_0xf8bc('0x6')](_0x3177b8+':'+_0x3f6d71['id'],_0x3f6d71);ChatGroupEvents[_0xf8bc('0x6')](_0x3177b8,_0x3f6d71);_0x26726a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf8bc('0x7')](e,emitEvent(event));}}module[_0xf8bc('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xf542=['ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf542,0x152));var _0x2f54=function(_0x23ee66,_0x1e5721){_0x23ee66=_0x23ee66-0x0;var _0xfb714d=_0xf542[_0x23ee66];return _0xfb714d;};'use strict';var EventEmitter=require(_0x2f54('0x0'));var ChatGroup=require(_0x2f54('0x1'))['db'][_0x2f54('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2f54('0x3')](0x0);var events={'afterCreate':_0x2f54('0x4'),'afterUpdate':_0x2f54('0x5'),'afterDestroy':'remove'};function emitEvent(_0x59b71f){return function(_0x1e7f22,_0x1abdd1,_0x3f4e1d){ChatGroupEvents[_0x2f54('0x6')](_0x59b71f+':'+_0x1e7f22['id'],_0x1e7f22);ChatGroupEvents[_0x2f54('0x6')](_0x59b71f,_0x1e7f22);_0x3f4e1d(null);};}for(var e in events){if(events[_0x2f54('0x7')](e)){var event=events[e];ChatGroup[_0x2f54('0x8')](e,emitEvent(event));}}module[_0x2f54('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 3131ee7..6c3960e 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 _0x8864=['./chatGroup.attributes','exports','define','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51b42e,_0x8dea09){var _0x43ed23=function(_0x2de749){while(--_0x2de749){_0x51b42e['push'](_0x51b42e['shift']());}};_0x43ed23(++_0x8dea09);}(_0x8864,0x124));var _0x4886=function(_0x33e982,_0x1d15b1){_0x33e982=_0x33e982-0x0;var _0x2d3668=_0x8864[_0x33e982];return _0x2d3668;};'use strict';var _=require(_0x4886('0x0'));var util=require('util');var logger=require(_0x4886('0x1'))(_0x4886('0x2'));var moment=require(_0x4886('0x3'));var BPromise=require(_0x4886('0x4'));var rp=require(_0x4886('0x5'));var fs=require('fs');var path=require(_0x4886('0x6'));var rimraf=require(_0x4886('0x7'));var config=require('../../config/environment');var attributes=require(_0x4886('0x8'));module[_0x4886('0x9')]=function(_0xa3dea0,_0x27b9f6){return _0xa3dea0[_0x4886('0xa')]('ChatGroup',attributes,{'tableName':_0x4886('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0803=['./chatGroup.attributes','exports','define','ChatGroup','lodash','util','moment','request-promise','path'];(function(_0x431cf2,_0x1d4456){var _0x10c9a7=function(_0x574efe){while(--_0x574efe){_0x431cf2['push'](_0x431cf2['shift']());}};_0x10c9a7(++_0x1d4456);}(_0x0803,0x16c));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3080('0x0'));var util=require(_0x3080('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3080('0x2'));var BPromise=require('bluebird');var rp=require(_0x3080('0x3'));var fs=require('fs');var path=require(_0x3080('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3080('0x5'));module[_0x3080('0x6')]=function(_0x274707,_0xc1264b){return _0x274707[_0x3080('0x7')](_0x3080('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index a571808..9c509bd 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 _0x59ce=['request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0xd535bc,_0x54c2b4){var _0x530e6d=function(_0x361050){while(--_0x361050){_0xd535bc['push'](_0xd535bc['shift']());}};_0x530e6d(++_0x54c2b4);}(_0x59ce,0x92));var _0xe59c=function(_0x226965,_0x58df8d){_0x226965=_0x226965-0x0;var _0x9476f1=_0x59ce[_0x226965];return _0x9476f1;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var moment=require(_0xe59c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe59c('0x3'));var fs=require('fs');var Redis=require(_0xe59c('0x4'));var db=require(_0xe59c('0x5'))['db'];var utils=require(_0xe59c('0x6'));var logger=require(_0xe59c('0x7'))(_0xe59c('0x8'));var config=require(_0xe59c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe59c('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xe59c('0xb')],{'host':_0xe59c('0xc'),'port':0x18eb});var socket=require(_0xe59c('0xd'))(new Redis(config[_0xe59c('0xb')]));require(_0xe59c('0xe'))[_0xe59c('0xf')](socket);function respondWithRpcPromise(_0x334538,_0x248523,_0x441793){return new BPromise(function(_0x2d897b,_0x356fab){return client[_0xe59c('0x10')](_0x334538,_0x441793)[_0xe59c('0x11')](function(_0x35f296){logger[_0xe59c('0x12')](_0xe59c('0x13'),_0x248523,_0xe59c('0x14'));logger[_0xe59c('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x248523,_0xe59c('0x14'),JSON[_0xe59c('0x16')](_0x35f296));if(_0x35f296[_0xe59c('0x17')]){if(_0x35f296[_0xe59c('0x17')]['code']===0x1f4){logger['error'](_0xe59c('0x13'),_0x248523,_0x35f296[_0xe59c('0x17')][_0xe59c('0x18')]);return _0x356fab(_0x35f296[_0xe59c('0x17')][_0xe59c('0x18')]);}logger['error'](_0xe59c('0x13'),_0x248523,_0x35f296['error']['message']);return _0x2d897b(_0x35f296[_0xe59c('0x17')][_0xe59c('0x18')]);}else{logger['info'](_0xe59c('0x13'),_0x248523,_0xe59c('0x14'));_0x2d897b(_0x35f296[_0xe59c('0x19')]['message']);}})[_0xe59c('0x1a')](function(_0x47e60b){logger[_0xe59c('0x17')](_0xe59c('0x13'),_0x248523,_0x47e60b);_0x356fab(_0x47e60b);});});} \ No newline at end of file +var _0x032e=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xfeff8d,_0x3c92f9){var _0x9e5d96=function(_0x815c4b){while(--_0x815c4b){_0xfeff8d['push'](_0xfeff8d['shift']());}};_0x9e5d96(++_0x3c92f9);}(_0x032e,0x124));var _0xe032=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x032e[_0x411add];return _0x238242;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('ChatGroup,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 291eb21..c47dca6 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 _0x4b65=['chatGroup:','./chatGroup.events','remove','emit','register','length'];(function(_0x4c6129,_0x4668c6){var _0x262eea=function(_0x54241b){while(--_0x54241b){_0x4c6129['push'](_0x4c6129['shift']());}};_0x262eea(++_0x4668c6);}(_0x4b65,0x1c3));var _0x54b6=function(_0x37901c,_0x127213){_0x37901c=_0x37901c-0x0;var _0x195c3f=_0x4b65[_0x37901c];return _0x195c3f;};'use strict';var ChatGroupEvents=require(_0x54b6('0x0'));var events=['save',_0x54b6('0x1'),'update'];function createListener(_0xb7c6e7,_0x140c86){return function(_0x41eb21){_0x140c86[_0x54b6('0x2')](_0xb7c6e7,_0x41eb21);};}function removeListener(_0xa776b5,_0x3ae1c7){return function(){ChatGroupEvents['removeListener'](_0xa776b5,_0x3ae1c7);};}exports[_0x54b6('0x3')]=function(_0x175c33){for(var _0x426eaf=0x0,_0xdb2ec1=events[_0x54b6('0x4')];_0x426eaf<_0xdb2ec1;_0x426eaf++){var _0x8d8ea7=events[_0x426eaf];var _0x12b2fc=createListener(_0x54b6('0x5')+_0x8d8ea7,_0x175c33);ChatGroupEvents['on'](_0x8d8ea7,_0x12b2fc);}}; \ No newline at end of file +var _0x3725=['remove','emit','removeListener','register','length','./chatGroup.events','save'];(function(_0x3c962a,_0x15fd3f){var _0x11170a=function(_0x22c050){while(--_0x22c050){_0x3c962a['push'](_0x3c962a['shift']());}};_0x11170a(++_0x15fd3f);}(_0x3725,0xbb));var _0x5372=function(_0x458ca4,_0x4bbd3c){_0x458ca4=_0x458ca4-0x0;var _0x45abc0=_0x3725[_0x458ca4];return _0x45abc0;};'use strict';var ChatGroupEvents=require(_0x5372('0x0'));var events=[_0x5372('0x1'),_0x5372('0x2'),'update'];function createListener(_0x5a68c4,_0x5024ef){return function(_0x56898e){_0x5024ef[_0x5372('0x3')](_0x5a68c4,_0x56898e);};}function removeListener(_0x44f145,_0x247b8f){return function(){ChatGroupEvents[_0x5372('0x4')](_0x44f145,_0x247b8f);};}exports[_0x5372('0x5')]=function(_0x2c4367){for(var _0x1b2951=0x0,_0x1f51dd=events[_0x5372('0x6')];_0x1b2951<_0x1f51dd;_0x1b2951++){var _0x4bac6d=events[_0x1b2951];var _0x498640=createListener('chatGroup:'+_0x4bac6d,_0x2c4367);ChatGroupEvents['on'](_0x4bac6d,_0x498640);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3af721a..0d022c6 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 _0x5efe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','destroy','delete','removeMembers','multer'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0x5efe,0x13e));var _0xe5ef=function(_0x47f76d,_0x342e51){_0x47f76d=_0x47f76d-0x0;var _0x20f4ef=_0x5efe[_0x47f76d];return _0x20f4ef;};'use strict';var multer=require(_0xe5ef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe5ef('0x1'));var express=require(_0xe5ef('0x2'));var router=express[_0xe5ef('0x3')]();var fs_extra=require(_0xe5ef('0x4'));var auth=require(_0xe5ef('0x5'));var interaction=require(_0xe5ef('0x6'));var config=require(_0xe5ef('0x7'));var controller=require(_0xe5ef('0x8'));router[_0xe5ef('0x9')]('/',auth[_0xe5ef('0xa')](),controller[_0xe5ef('0xb')]);router['get'](_0xe5ef('0xc'),auth['isAuthenticated'](),controller[_0xe5ef('0xd')]);router['get'](_0xe5ef('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe5ef('0x9')](_0xe5ef('0xf'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x10')]);router[_0xe5ef('0x9')](_0xe5ef('0x11'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x12')]);router[_0xe5ef('0x9')](_0xe5ef('0x13'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x14')]);router['post']('/',auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x15')]);router['post'](_0xe5ef('0x11'),auth[_0xe5ef('0xa')](),controller['addMembers']);router[_0xe5ef('0x16')](_0xe5ef('0x13'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x17')]);router[_0xe5ef('0x18')](_0xe5ef('0xe'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x19')]);router['delete'](_0xe5ef('0xe'),auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x1a')]);router[_0xe5ef('0x1b')]('/:id/members',auth[_0xe5ef('0xa')](),controller[_0xe5ef('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x92d2=['delete','removeMembers','exports','multer','util','path','express','Router','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0x92d2,0xc0));var _0x292d=function(_0x101123,_0x2c9e54){_0x101123=_0x101123-0x0;var _0x30c2d6=_0x92d2[_0x101123];return _0x30c2d6;};'use strict';var multer=require(_0x292d('0x0'));var util=require(_0x292d('0x1'));var path=require(_0x292d('0x2'));var timeout=require('connect-timeout');var express=require(_0x292d('0x3'));var router=express[_0x292d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x292d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x292d('0x6'));router[_0x292d('0x7')]('/',auth[_0x292d('0x8')](),controller['index']);router[_0x292d('0x7')](_0x292d('0x9'),auth[_0x292d('0x8')](),controller[_0x292d('0xa')]);router[_0x292d('0x7')](_0x292d('0xb'),auth[_0x292d('0x8')](),controller[_0x292d('0xc')]);router['get'](_0x292d('0xd'),auth[_0x292d('0x8')](),controller[_0x292d('0xe')]);router[_0x292d('0x7')](_0x292d('0xf'),auth['isAuthenticated'](),controller[_0x292d('0x10')]);router[_0x292d('0x7')](_0x292d('0x11'),auth[_0x292d('0x8')](),controller[_0x292d('0x12')]);router[_0x292d('0x13')]('/',auth[_0x292d('0x8')](),controller[_0x292d('0x14')]);router[_0x292d('0x13')]('/:id/members',auth['isAuthenticated'](),controller[_0x292d('0x15')]);router[_0x292d('0x13')](_0x292d('0x11'),auth[_0x292d('0x8')](),controller[_0x292d('0x16')]);router[_0x292d('0x17')](_0x292d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x292d('0x18')]('/:id',auth[_0x292d('0x8')](),controller['destroy']);router[_0x292d('0x18')](_0x292d('0xf'),auth[_0x292d('0x8')](),controller[_0x292d('0x19')]);module[_0x292d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index dd04ee6..cd285c4 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 _0x97aa=['ENUM','out','exports','BOOLEAN','INTEGER','star','TEXT','STRING','DATE','long'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0x97aa,0x19c));var _0xa97a=function(_0x164542,_0x184a16){_0x164542=_0x164542-0x0;var _0x397281=_0x97aa[_0x164542];return _0x397281;};'use strict';var Sequelize=require('sequelize');module[_0xa97a('0x0')]={'closed':{'type':Sequelize[_0xa97a('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa97a('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xa97a('0x3'),'thumb'),'defaultValue':_0xa97a('0x3')},'ratingMessage':{'type':Sequelize[_0xa97a('0x4')]},'pathTranscript':{'type':Sequelize[_0xa97a('0x4')]},'mailTranscript':{'type':Sequelize[_0xa97a('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa97a('0x6')]},'disposition':{'type':Sequelize[_0xa97a('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa97a('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xa97a('0x5')]},'osName':{'type':Sequelize[_0xa97a('0x5')]},'osVersion':{'type':Sequelize[_0xa97a('0x5')]},'deviceModel':{'type':Sequelize[_0xa97a('0x5')]},'deviceVendor':{'type':Sequelize[_0xa97a('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa97a('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xa97a('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa97a('0x8')]('in',_0xa97a('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa97a('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xa97a('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa97a('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5825=['DATE','TEXT','BOOLEAN','INTEGER','exports','ENUM','star','thumb','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5825,0x11b));var _0x5582=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5825[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x5582('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x5582('0x1')](_0x5582('0x2'),_0x5582('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x5582('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5582('0x5')]},'disposition':{'type':Sequelize[_0x5582('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5582('0x4')]},'note':{'type':Sequelize[_0x5582('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5582('0x4')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x5582('0x4')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x5582('0x4')]},'deviceType':{'type':Sequelize[_0x5582('0x4')]},'referer':{'type':Sequelize[_0x5582('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5582('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x5582('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x5582('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x5582('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x5582('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x5582('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5582('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 9428ef1..0718257 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 _0x45c5=['renderFile','views','.pdf','createPdfFromHTML','err','rimraf','zip-dir','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','update','destroy','sendStatus','stack','name','send','merge','body','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','fullname','contact','email','isNull','follow','parse','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','create','attachmentDownload','attachId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','CmContact','Messages','System','customer','%s%d','Visitor','ContactId','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','addMessage','ids','omit','getMessages','ChatMessage','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','rows','getMyMessages','include','includeAgent','push','addTags','setTags','spread','Tag','color','chatInteractionTags:save','server','tmp','files','attachments','lastName','read','Account','Owner','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','browserName','osName','referer','customerPort','N.A.','createReadStream','createWriteStream','firstName','out','value'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x45c5,0x19d));var _0x545c=function(_0x36db66,_0x5cd076){_0x36db66=_0x36db66-0x0;var _0x3e1e03=_0x45c5[_0x36db66];return _0x3e1e03;};'use strict';var rimraf=require(_0x545c('0x0'));var zipdir=require(_0x545c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x545c('0x2'));var Mustache=require(_0x545c('0x3'));var util=require('util');var path=require(_0x545c('0x4'));var ejs=require(_0x545c('0x5'));var fs=require('fs');var _=require(_0x545c('0x6'));var Redis=require(_0x545c('0x7'));var interaction=require(_0x545c('0x8'));var qs=require(_0x545c('0x9'));var pdf=require(_0x545c('0xa'));var logger=require('../../config/logger')(_0x545c('0xb'));var config=require(_0x545c('0xc'));var db=require(_0x545c('0xd'))['db'];config[_0x545c('0xe')]=_[_0x545c('0xf')](config[_0x545c('0xe')],{'host':_0x545c('0x10'),'port':0x18eb});var socket=require(_0x545c('0x11'))(new Redis(config[_0x545c('0xe')]));require(_0x545c('0x12'))[_0x545c('0x13')](socket);var jayson=require(_0x545c('0x14'));var client=jayson['client'][_0x545c('0x15')]({'port':0x232b});var client9004=jayson[_0x545c('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4d852d,_0x300767,_0x139934,_0x2e7091){return new BPromise(function(_0x34d96f,_0x12e448){var _0x400ebf=_0x2e7091||client;return _0x400ebf[_0x545c('0x17')](_0x4d852d,_0x139934)[_0x545c('0x18')](function(_0x396f1b){logger[_0x545c('0x19')](_0x545c('0x1a'),_0x300767,_0x545c('0x1b'));logger[_0x545c('0x1c')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x300767,_0x545c('0x1b'),JSON[_0x545c('0x1d')](_0x396f1b));if(_0x396f1b['error']){if(_0x396f1b['error'][_0x545c('0x1e')]===0x1f4){logger[_0x545c('0x1f')](_0x545c('0x1a'),_0x300767,_0x396f1b['error'][_0x545c('0x20')]);return _0x12e448(_0x396f1b[_0x545c('0x1f')]['message']);}logger[_0x545c('0x1f')](_0x545c('0x1a'),_0x300767,_0x396f1b['error'][_0x545c('0x20')]);return _0x34d96f(_0x396f1b[_0x545c('0x1f')]['message']);}else{logger['info'](_0x545c('0x1a'),_0x300767,_0x545c('0x1b'));_0x34d96f(_0x396f1b[_0x545c('0x21')]['message']);}})[_0x545c('0x22')](function(_0xa3c9b0){logger[_0x545c('0x1f')](_0x545c('0x1a'),_0x300767,_0xa3c9b0);_0x12e448(_0xa3c9b0);});});}function respondWithStatusCode(_0x21c3ba,_0x53269f){_0x53269f=_0x53269f||0xcc;return function(_0x12e730){if(_0x12e730){return _0x21c3ba['sendStatus'](_0x53269f);}return _0x21c3ba[_0x545c('0x23')](_0x53269f)['end']();};}function respondWithResult(_0x170092,_0x3c18e0){_0x3c18e0=_0x3c18e0||0xc8;return function(_0x671258){if(_0x671258){return _0x170092['status'](_0x3c18e0)['json'](_0x671258);}};}function respondWithFilteredResult(_0x1d502b,_0x4f6630){return function(_0x2733d5){if(_0x2733d5){var _0xcd5bd3=typeof _0x4f6630['offset']===_0x545c('0x24')&&typeof _0x4f6630[_0x545c('0x25')]===_0x545c('0x24');var _0x430a15=_0x2733d5[_0x545c('0x26')];var _0x19089f=_0xcd5bd3?0x0:_0x4f6630[_0x545c('0x27')];var _0x3bf191=_0xcd5bd3?_0x2733d5[_0x545c('0x26')]:_0x4f6630[_0x545c('0x27')]+_0x4f6630[_0x545c('0x25')];var _0x527e54;if(_0x3bf191>=_0x430a15){_0x3bf191=_0x430a15;_0x527e54=0xc8;}else{_0x527e54=0xce;}_0x1d502b[_0x545c('0x23')](_0x527e54);return _0x1d502b[_0x545c('0x28')](_0x545c('0x29'),_0x19089f+'-'+_0x3bf191+'/'+_0x430a15)[_0x545c('0x2a')](_0x2733d5);}return null;};}function saveUpdates(_0x3f4f4e){return function(_0x1a7153){if(_0x1a7153){return _0x1a7153[_0x545c('0x2b')](_0x3f4f4e)[_0x545c('0x18')](function(_0x19ccd6){return _0x19ccd6;});}return null;};}function removeEntity(_0x10ed88){return function(_0x4275e9){if(_0x4275e9){return _0x4275e9[_0x545c('0x2c')]()[_0x545c('0x18')](function(){_0x10ed88[_0x545c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f0e5e){return function(_0x305e57){if(!_0x305e57){_0x3f0e5e[_0x545c('0x2d')](0x194);}return _0x305e57;};}function handleError(_0x1567af,_0x1a3611){_0x1a3611=_0x1a3611||0x1f4;return function(_0x154aca){logger[_0x545c('0x1f')](_0x154aca[_0x545c('0x2e')]);if(_0x154aca[_0x545c('0x2f')]){delete _0x154aca[_0x545c('0x2f')];}_0x1567af[_0x545c('0x23')](_0x1a3611)[_0x545c('0x30')](_0x154aca);};}function getMustacheRender(_0x199a76,_0x13e04a){return Mustache['render'](_0x199a76,_[_0x545c('0x31')](_0x13e04a[_0x545c('0x32')],{'contact':_0x13e04a['contact'],'message':_0x13e04a[_0x545c('0x20')],'agent':_0x13e04a['agent'],'interaction':_0x13e04a['interaction'],'account':_0x13e04a[_0x545c('0x33')]}))||'';}exports[_0x545c('0x34')]=function(_0x573b3f,_0x3b0da7){var _0x2c3115={};var _0x1bd9fc=_[_0x545c('0x35')](db[_0x545c('0x36')][_0x545c('0x37')],function(_0x50212a){return{'name':_0x50212a['fieldName'],'type':_0x50212a[_0x545c('0x38')]['key']};});_0x2c3115=qs[_0x545c('0x39')](_0x1bd9fc,_0x573b3f);return interaction[_0x545c('0x3a')](_0x545c('0x3b'),_0x573b3f[_0x545c('0x3c')],_0x573b3f[_0x545c('0x3d')],_0x2c3115,_0x1bd9fc)[_0x545c('0x18')](respondWithFilteredResult(_0x3b0da7,_0x2c3115))[_0x545c('0x22')](handleError(_0x3b0da7,null));};exports[_0x545c('0x3e')]=function(_0x2232e6,_0x4b066c){var _0x5b7092={'raw':![],'where':{'id':_0x2232e6[_0x545c('0x3f')]['id']}},_0xe4294d={};_0xe4294d[_0x545c('0x40')]=_[_0x545c('0x41')](db[_0x545c('0x36')]['rawAttributes']);_0xe4294d[_0x545c('0x3c')]=_[_0x545c('0x41')](_0x2232e6[_0x545c('0x3c')]);_0xe4294d[_0x545c('0x42')]=_[_0x545c('0x43')](_0xe4294d[_0x545c('0x40')],_0xe4294d[_0x545c('0x3c')]);_0x5b7092[_0x545c('0x44')]=_['intersection'](_0xe4294d[_0x545c('0x40')],qs['fields'](_0x2232e6['query'][_0x545c('0x45')]));_0x5b7092[_0x545c('0x44')]=_0x5b7092[_0x545c('0x44')][_0x545c('0x46')]?_0x5b7092[_0x545c('0x44')]:_0xe4294d['model'];if(_0x2232e6[_0x545c('0x3c')][_0x545c('0x47')]){_0x5b7092['include']=[{'all':!![]}];}_0x5b7092=_[_0x545c('0x31')]({},_0x5b7092,_0x2232e6[_0x545c('0x48')]);return db[_0x545c('0x36')][_0x545c('0x49')](_0x5b7092)[_0x545c('0x18')](handleEntityNotFound(_0x4b066c,null))['then'](respondWithResult(_0x4b066c,null))[_0x545c('0x22')](handleError(_0x4b066c,null));};exports['create']=function(_0x55368d,_0x464beb){return db['ChatInteraction']['create'](_0x55368d[_0x545c('0x32')],{})[_0x545c('0x18')](respondWithResult(_0x464beb,0xc9))[_0x545c('0x22')](handleError(_0x464beb,null));};exports[_0x545c('0x2b')]=function(_0x52e9e7,_0x221253){if(_0x52e9e7['body']['id']){delete _0x52e9e7[_0x545c('0x32')]['id'];}return db['ChatInteraction'][_0x545c('0x49')]({'where':{'id':_0x52e9e7[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x221253,null))[_0x545c('0x18')](saveUpdates(_0x52e9e7['body'],null))[_0x545c('0x18')](respondWithResult(_0x221253,null))[_0x545c('0x22')](handleError(_0x221253,null));};exports[_0x545c('0x2c')]=function(_0x4c058e,_0x1d8ba2){return db[_0x545c('0x36')]['find']({'where':{'id':_0x4c058e[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x1d8ba2,null))[_0x545c('0x18')](removeEntity(_0x1d8ba2,null))[_0x545c('0x22')](handleError(_0x1d8ba2,null));};exports[_0x545c('0x4a')]=function(_0x56722a,_0x55b3b9){return db[_0x545c('0x36')][_0x545c('0x4a')]()[_0x545c('0x18')](respondWithResult(_0x55b3b9,null))[_0x545c('0x22')](handleError(_0x55b3b9,null));};exports[_0x545c('0x4b')]=function(_0x1e327,_0x10cfbb){var _0x44ee05=_0x1e327[_0x545c('0x3f')]['id'];var _0x14368b;var _0x10b266;var _0x3ac817;return db[_0x545c('0x36')][_0x545c('0x4c')]({'where':{'id':_0x44ee05}})[_0x545c('0x18')](function(_0x273fae){_0x14368b=_0x273fae;return db['ChatWebsite'][_0x545c('0x4c')]({'where':{'id':_0x273fae[_0x545c('0x4d')]},'attributes':['id',_0x545c('0x4e'),'vidaooEscalation',_0x545c('0x4f'),_0x545c('0x50'),_0x545c('0x51')],'raw':!![]});})[_0x545c('0x18')](function(_0x2e9073){if(_0x2e9073&&_0x2e9073[_0x545c('0x4e')]&&_0x2e9073['vidaooEscalation']){_0x10b266=_0x2e9073;var _0x22b350={'interaction':{'id':_0x44ee05},'agent':{'id':_0x1e327['user']['id'],'name':_0x1e327[_0x545c('0x3d')][_0x545c('0x2f')],'fullname':_0x1e327[_0x545c('0x3d')][_0x545c('0x52')],'email':_0x1e327['user']['email']},'contact':_0x1e327[_0x545c('0x32')][_0x545c('0x53')],'account':_0x1e327[_0x545c('0x32')][_0x545c('0x33')]};var _0x3b5473={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2e9073[_0x545c('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1e327[_0x545c('0x3d')][_0x545c('0x54')]],'buttons':null,'topic':_0x10b266[_0x545c('0x4f')],'note':_[_0x545c('0x55')](_0x10b266[_0x545c('0x50')])?null:getMustacheRender(_0x10b266[_0x545c('0x50')],_0x22b350),'metadata':null},'redirect':_0x545c('0x56'),'json':!![]};try{if(!_[_0x545c('0x55')](_0x10b266['vidaooMetadata'])){var _0x1cfa02=getMustacheRender(_0x10b266[_0x545c('0x51')],_0x22b350);var _0x364a0e=JSON[_0x545c('0x57')](_0x1cfa02);_0x3b5473[_0x545c('0x32')]['metadata']=_0x364a0e;}}catch(_0x52fb68){throw new db['Sequelize']['ValidationError'](_0x545c('0x58'));}return rp(_0x3b5473);}else{throw new db['Sequelize'][(_0x545c('0x59'))](_0x545c('0x5a'));}})[_0x545c('0x18')](function(_0x23a5ce){_0x3ac817=_0x23a5ce;if(_0x3ac817['id']){var _0x5526cf={'body':_0x3ac817[_0x545c('0x5b')],'ChatWebsiteId':_0x10b266['id'],'ChatInteractionId':_0x14368b['id'],'direction':'out','UserId':_0x1e327[_0x545c('0x3d')]['id']};return db['ChatMessage']['create'](_0x5526cf,{});}else{throw new db[(_0x545c('0x5c'))][(_0x545c('0x59'))](_0x545c('0x5d'));}})[_0x545c('0x18')](function(){return _0x14368b[_0x545c('0x5e')]({'vidaooSessionId':_0x3ac817['id']});})[_0x545c('0x18')](respondWithResult(_0x10cfbb,null))['catch'](handleError(_0x10cfbb,null));};exports['customUpdate']=function(_0x37ba70,_0x46f331){if(_0x37ba70[_0x545c('0x32')]['id']){delete _0x37ba70['body']['id'];}return db[_0x545c('0x36')][_0x545c('0x49')]({'where':{'id':_0x37ba70[_0x545c('0x3f')]['id']},'include':[{'model':db['CmContact'],'as':_0x545c('0x5f')}]})['then'](handleEntityNotFound(_0x46f331,null))[_0x545c('0x18')](saveUpdates(_0x37ba70[_0x545c('0x32')],null))[_0x545c('0x18')](respondWithResult(_0x46f331,null))['catch'](handleError(_0x46f331,null));};exports[_0x545c('0x60')]=function(_0x2483d4,_0x4e6775){if(_0x2483d4[_0x545c('0x32')]['id']){delete _0x2483d4[_0x545c('0x32')]['id'];}return db[_0x545c('0x36')]['find']({'where':{'id':_0x2483d4[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](function(_0x6ab55){if(!_0x6ab55){logger[_0x545c('0x1f')](_0x545c('0x61'),_0x545c('0x60'),0x194,_0x545c('0x62'));_0x4e6775[_0x545c('0x2d')](0x194);}else{if(_0x6ab55[_0x545c('0x63')]){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x6ab55;})[_0x545c('0x18')](function(_0x1258b7){if(_0x1258b7){return _0x1258b7[_0x545c('0x2b')]({'closed':_0x2483d4[_0x545c('0x32')][_0x545c('0x64')],'disposition':_0x2483d4[_0x545c('0x32')][_0x545c('0x65')]})['then'](function(_0x4eb7b8){return _0x4eb7b8;});}})['then'](function(){return respondWithRpcPromise(_0x545c('0x66'),_0x545c('0x60'),_0x2483d4[_0x545c('0x32')],client9004);})[_0x545c('0x18')](respondWithResult(_0x4e6775,null))['catch'](handleError(_0x4e6775,null));};exports['attachmentUpload']=function(_0x5b17db,_0x17cd8e){_0x5b17db[_0x545c('0x32')][_0x545c('0x2f')]=_0x5b17db[_0x545c('0x67')][_0x545c('0x68')];_0x5b17db[_0x545c('0x32')]['basename']=_0x5b17db[_0x545c('0x67')][_0x545c('0x69')];_0x5b17db[_0x545c('0x32')][_0x545c('0x38')]=_0x5b17db[_0x545c('0x67')][_0x545c('0x6a')];return db[_0x545c('0x6b')][_0x545c('0x6c')](_0x5b17db[_0x545c('0x32')])[_0x545c('0x18')](respondWithResult(_0x17cd8e,0xc9))[_0x545c('0x22')](handleError(_0x17cd8e,null));};exports[_0x545c('0x6d')]=function(_0x591d50,_0x239eea){return db['ChatInteraction'][_0x545c('0x4c')]({'where':{'id':_0x591d50[_0x545c('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x239eea,null))[_0x545c('0x18')](function(_0x32da78){if(_0x32da78){if(_0x32da78[_0x545c('0x64')]){return _0x239eea[_0x545c('0x23')](0x193)[_0x545c('0x2a')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x591d50[_0x545c('0x3c')][_0x545c('0x6e')]},'raw':!![]})[_0x545c('0x18')](handleEntityNotFound(_0x239eea,null));}})[_0x545c('0x18')](function(_0x23aef6){if(_0x23aef6){var _0x188f17=_0x23aef6['ChatOfflineMessageId']!==null;var _0x5d24fc=path[_0x545c('0x6f')](config[_0x545c('0x70')],_0x545c('0x71'));if(_0x188f17){_0x5d24fc=path['join'](_0x5d24fc,_0x545c('0x72'));}var _0x31ce45=path[_0x545c('0x6f')](_0x5d24fc,_0x23aef6[_0x545c('0x73')]);return _0x239eea[_0x545c('0x74')](_0x31ce45);}})[_0x545c('0x22')](handleError(_0x239eea,null));};exports[_0x545c('0x75')]=function(_0x17c1a7,_0x10ac8a){var _0x3ece4d=null;var _0x51c81d=null;var _0x49dc82=null;if(_0x17c1a7['body']['id']){delete _0x17c1a7[_0x545c('0x32')]['id'];}if(_0x17c1a7['body']['mailTranscript']){_0x49dc82=path[_0x545c('0x6f')](config['root'],_0x545c('0x76'),util[_0x545c('0x77')](_0x545c('0x78'),Date[_0x545c('0x79')]()));_0x17c1a7[_0x545c('0x32')][_0x545c('0x7a')]=_0x49dc82;}return db[_0x545c('0x36')][_0x545c('0x49')]({'where':{'id':_0x17c1a7[_0x545c('0x3f')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x545c('0x7b')],'as':_0x545c('0x7b')}]}]})[_0x545c('0x18')](handleEntityNotFound(_0x10ac8a,null))[_0x545c('0x18')](saveUpdates(_0x17c1a7['body'],null))[_0x545c('0x18')](function(_0x30971f){if(_0x30971f){_0x3ece4d=_0x30971f;return db[_0x545c('0x7c')]['find']({'where':{'id':_0x3ece4d[_0x545c('0x4d')]}});}})['then'](function(_0x3d6579){if(_0x3d6579){_0x51c81d=_0x3d6579;return db[_0x545c('0x7d')]['find']({'where':{'id':_0x3ece4d['ContactId']}});}})['then'](function(_0x2122c1){if(_0x2122c1){if(_0x49dc82){var _0x158efe=null;for(var _0x58f60a=0x1;_0x58f60a<_0x3ece4d['Messages']['length'];++_0x58f60a){_0x158efe=_0x3ece4d[_0x545c('0x7e')][_0x58f60a];var _0x495658=_0x158efe[_0x545c('0x63')]?util['format']('%s%d',_0x51c81d['agentAlias'],_0x158efe[_0x545c('0x63')]):_0x545c('0x7f');var _0xa76d97=_0x17c1a7[_0x545c('0x32')][_0x545c('0x80')]||util[_0x545c('0x77')](_0x545c('0x81'),_0x545c('0x82'),_0x158efe[_0x545c('0x83')]);switch(_0x51c81d[_0x545c('0x84')]){case _0x545c('0x85'):_0x495658=_0x158efe[_0x545c('0x63')]?util['format'](_0x545c('0x81'),_0x51c81d['agentAlias'],_0x158efe[_0x545c('0x63')]):_0x545c('0x7f');break;case _0x545c('0x86'):_0x495658=_0x158efe[_0x545c('0x63')]?_0x158efe['User'][_0x545c('0x87')]||_0x158efe[_0x545c('0x7b')][_0x545c('0x52')]:'System';break;case _0x545c('0x88'):_0x495658=_0x158efe[_0x545c('0x63')]?_0x158efe['User'][_0x545c('0x52')]:_0x545c('0x7f');break;default:_0x495658=_0x158efe['UserId']?util[_0x545c('0x77')]('%s%d',_0x51c81d['agentAlias'],_0x158efe['UserId']):_0x545c('0x7f');}var _0x47d154=util[_0x545c('0x77')]('[%s]\x20%s:\x20%s\x0a',moment(_0x158efe[_0x545c('0x89')])[_0x545c('0x77')]('MM/DD/YYYY\x20HH:mm:ss'),_0x158efe[_0x545c('0x8a')]==='in'?_0xa76d97:_0x495658,_0x158efe[_0x545c('0x32')]);if(!_0x158efe[_0x545c('0x8b')]){fs[_0x545c('0x8c')](_0x49dc82,_0x47d154);}}return db[_0x545c('0x8d')][_0x545c('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x545c('0x8e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x545c('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x545c('0x18')](function(_0xb8998c){if(!_0xb8998c||!_0xb8998c[_0x545c('0x90')]||!_0x17c1a7[_0x545c('0x32')])return _0x3ece4d;var _0x557c16=_0xb8998c[_0x545c('0x91')]();return respondWithRpcPromise(_0x545c('0x92'),_0x545c('0x93'),{'account':_0x557c16,'message':{'from':util['format'](_0x545c('0x94'),_0xb8998c[_0x545c('0x2f')],_0xb8998c[_0x545c('0x54')]||_0xb8998c[_0x545c('0x90')][_0x545c('0x3d')]),'to':_0x17c1a7['body'][_0x545c('0x95')],'subject':'Mail\x20Transcript','text':util[_0x545c('0x77')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x17c1a7[_0x545c('0x32')][_0x545c('0x95')]),'attachments':[{'path':_0x49dc82}]}})[_0x545c('0x18')](function(){return _0x3ece4d;})[_0x545c('0x22')](function(_0x1e05e7){logger[_0x545c('0x1f')](_0x1e05e7);});})[_0x545c('0x18')](respondWithStatusCode(_0x10ac8a,0xc8))[_0x545c('0x22')](handleError(_0x10ac8a,null));};exports['addMessage']=function(_0x3f68a3,_0x59adaf){return db['ChatMessage'][_0x545c('0x49')]({'where':{'id':_0x3f68a3[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x59adaf,null))[_0x545c('0x18')](function(_0x4fcef7){if(_0x4fcef7){return _0x4fcef7[_0x545c('0x96')](_0x3f68a3[_0x545c('0x32')][_0x545c('0x97')],_[_0x545c('0x98')](_0x3f68a3[_0x545c('0x32')],['ids','id'])||{});}})[_0x545c('0x18')](respondWithResult(_0x59adaf,null))[_0x545c('0x22')](handleError(_0x59adaf,null));};exports[_0x545c('0x99')]=function(_0x20269e,_0x3bc439){var _0x3f2525={'raw':![],'where':{}};var _0x2e1848={};var _0x1576e2={'count':0x0,'rows':[]};return db[_0x545c('0x36')]['findOne']({'where':{'id':_0x20269e[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x3bc439,null))[_0x545c('0x18')](function(_0x367769){if(_0x367769){_0x2e1848[_0x545c('0x40')]=_[_0x545c('0x41')](db[_0x545c('0x9a')][_0x545c('0x37')]);_0x2e1848[_0x545c('0x3c')]=_[_0x545c('0x41')](_0x20269e['query']);_0x2e1848[_0x545c('0x42')]=_[_0x545c('0x43')](_0x2e1848[_0x545c('0x40')],_0x2e1848[_0x545c('0x3c')]);_0x3f2525['attributes']=_['intersection'](_0x2e1848['model'],qs['fields'](_0x20269e[_0x545c('0x3c')][_0x545c('0x45')]));_0x3f2525[_0x545c('0x44')]=_0x3f2525[_0x545c('0x44')][_0x545c('0x46')]?_0x3f2525[_0x545c('0x44')]:_0x2e1848[_0x545c('0x40')];if(!_0x20269e[_0x545c('0x3c')][_0x545c('0x9b')](_0x545c('0x9c'))){_0x3f2525[_0x545c('0x25')]=qs['limit'](_0x20269e[_0x545c('0x3c')][_0x545c('0x25')]);_0x3f2525[_0x545c('0x27')]=qs[_0x545c('0x27')](_0x20269e[_0x545c('0x3c')][_0x545c('0x27')]);}_0x3f2525[_0x545c('0x9d')]=qs[_0x545c('0x9e')](_0x20269e['query']['sort']);_0x3f2525[_0x545c('0x9f')]=qs[_0x545c('0x42')](_[_0x545c('0xa0')](_0x20269e[_0x545c('0x3c')],_0x2e1848[_0x545c('0x42')]));_0x3f2525['where'][_0x545c('0xa1')]=_0x367769['id'];if(_0x20269e['query'][_0x545c('0xa2')]){_0x3f2525[_0x545c('0x9f')]=_[_0x545c('0x31')](_0x3f2525[_0x545c('0x9f')],{'$or':_[_0x545c('0x35')](_0x3f2525[_0x545c('0x44')],function(_0x2793da){var _0x54f33d={};_0x54f33d[_0x2793da]={'$like':'%'+_0x20269e[_0x545c('0x3c')][_0x545c('0xa2')]+'%'};return _0x54f33d;})});}if(_0x20269e['query'][_0x545c('0xa3')]){var _0x1675d5=_0x20269e[_0x545c('0x3c')]['$gte'][_0x545c('0xa4')](',');var _0x3d69e2={};_0x3d69e2[_0x1675d5[0x0]]={'$gte':moment(_0x1675d5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3f2525[_0x545c('0x9f')]=_[_0x545c('0x31')](_0x3f2525[_0x545c('0x9f')],_0x3d69e2);}_0x3f2525=_[_0x545c('0x31')]({},_0x3f2525,_0x20269e[_0x545c('0x48')]);return db['ChatMessage'][_0x545c('0x26')]({'where':_0x3f2525[_0x545c('0x9f')]})['then'](function(_0x2b000d){_0x1576e2['count']=_0x2b000d;if(_0x20269e[_0x545c('0x3c')][_0x545c('0x47')]){_0x3f2525['include']=[{'all':!![]}];}return db[_0x545c('0x9a')][_0x545c('0x3a')](_0x3f2525);})[_0x545c('0x18')](function(_0x167c1d){_0x1576e2[_0x545c('0xa5')]=_0x167c1d;return _0x1576e2;});}})[_0x545c('0x18')](respondWithFilteredResult(_0x3bc439,_0x3f2525))[_0x545c('0x22')](handleError(_0x3bc439,null));};exports[_0x545c('0xa6')]=function(_0x33bba2,_0x1f492b){var _0x2738d8={'where':{}},_0x39f308={},_0x2a030a={'count':0x0,'rows':[]};return db[_0x545c('0x36')][_0x545c('0x4c')]({'where':{'id':_0x33bba2[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x1f492b,null))[_0x545c('0x18')](function(_0x2ce874){if(_0x2ce874){_0x39f308['model']=_[_0x545c('0x41')](db[_0x545c('0x9a')][_0x545c('0x37')]);_0x39f308[_0x545c('0x3c')]=_[_0x545c('0x41')](_0x33bba2[_0x545c('0x3c')]);_0x39f308[_0x545c('0x42')]=_[_0x545c('0x43')](_0x39f308[_0x545c('0x40')],_0x39f308[_0x545c('0x3c')]);_0x2738d8['attributes']=_['intersection'](_0x39f308[_0x545c('0x40')],qs[_0x545c('0x45')](_0x33bba2[_0x545c('0x3c')][_0x545c('0x45')]));_0x2738d8['attributes']=_0x2738d8['attributes']['length']?_0x2738d8[_0x545c('0x44')]:_0x39f308[_0x545c('0x40')];if(!_0x33bba2[_0x545c('0x3c')][_0x545c('0x9b')](_0x545c('0x9c'))){_0x2738d8[_0x545c('0x25')]=qs[_0x545c('0x25')](_0x33bba2[_0x545c('0x3c')]['limit']);_0x2738d8[_0x545c('0x27')]=qs[_0x545c('0x27')](_0x33bba2[_0x545c('0x3c')][_0x545c('0x27')]);}_0x2738d8[_0x545c('0x9d')]=qs[_0x545c('0x9e')](_0x33bba2[_0x545c('0x3c')][_0x545c('0x9e')]);_0x2738d8[_0x545c('0x9f')]=qs[_0x545c('0x42')](_[_0x545c('0xa0')](_0x33bba2[_0x545c('0x3c')],_0x39f308[_0x545c('0x42')]));_0x2738d8[_0x545c('0x9f')][_0x545c('0xa1')]=_0x2ce874['id'];if(_0x33bba2[_0x545c('0x3c')][_0x545c('0xa2')]){_0x2738d8[_0x545c('0x9f')]=_['merge'](_0x2738d8['where'],{'$or':_[_0x545c('0x35')](_0x2738d8[_0x545c('0x44')],function(_0x23e92d){var _0x26253f={};_0x26253f[_0x23e92d]={'$like':'%'+_0x33bba2[_0x545c('0x3c')][_0x545c('0xa2')]+'%'};return _0x26253f;})});}_0x2738d8['where']['secret']=![];if(_0x33bba2['query']['id']){_0x2738d8[_0x545c('0x9f')]['id']={'$gt':_0x33bba2[_0x545c('0x3c')]['id']};}_0x2738d8=_[_0x545c('0x31')]({},_0x2738d8,_0x33bba2[_0x545c('0x48')]);return db[_0x545c('0x9a')][_0x545c('0x26')]({'where':_0x2738d8[_0x545c('0x9f')]})[_0x545c('0x18')](function(_0x348fc9){_0x2a030a[_0x545c('0x26')]=_0x348fc9;_0x2738d8[_0x545c('0xa7')]=[];if(_0x33bba2['query'][_0x545c('0xa8')]){_0x2738d8[_0x545c('0xa7')][_0x545c('0xa9')]({'model':db['User'],'as':_0x545c('0x7b'),'attributes':['id','fullname','alias']});}if(_0x33bba2[_0x545c('0x3c')][_0x545c('0x47')]){_0x2738d8['include']=[{'all':!![]}];}return db['ChatMessage'][_0x545c('0x3a')](_0x2738d8);})['then'](function(_0x38c2ab){_0x2a030a[_0x545c('0xa5')]=_0x38c2ab;return _0x2a030a;});}})[_0x545c('0x18')](respondWithFilteredResult(_0x1f492b,_0x2738d8))[_0x545c('0x22')](handleError(_0x1f492b,null));};exports[_0x545c('0xaa')]=function(_0x50410f,_0x3ba7c7){return db[_0x545c('0x36')][_0x545c('0x49')]({'where':{'id':_0x50410f['params']['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x3ba7c7,null))[_0x545c('0x18')](function(_0x12173b){if(_0x12173b){return _0x12173b[_0x545c('0xab')](_0x50410f[_0x545c('0x32')]['ids'],_[_0x545c('0x98')](_0x50410f['body'],['ids','id'])||{})[_0x545c('0xac')](function(){return db[_0x545c('0xad')][_0x545c('0x3a')]({'attributes':['id','name',_0x545c('0xae')],'where':{'id':_0x50410f[_0x545c('0x32')]['ids']}});})['then'](function(_0x43585e){socket['emit'](_0x545c('0xaf'),{'id':Number(_0x50410f['params']['id']),'tags':_0x43585e||[]});return{'id':Number(_0x50410f[_0x545c('0x3f')]['id']),'tags':_0x43585e||[]};});}})[_0x545c('0x18')](respondWithResult(_0x3ba7c7,null))[_0x545c('0x22')](handleError(_0x3ba7c7,null));};exports['removeTags']=function(_0x135e2b,_0x4cdeb3){return db['ChatInteraction'][_0x545c('0x49')]({'where':{'id':_0x135e2b[_0x545c('0x3f')]['id']}})[_0x545c('0x18')](handleEntityNotFound(_0x4cdeb3,null))[_0x545c('0x18')](function(_0x2b9670){if(_0x2b9670){return _0x2b9670['removeTags'](_0x135e2b[_0x545c('0x3c')][_0x545c('0x97')]);}})[_0x545c('0x18')](respondWithStatusCode(_0x4cdeb3,null))['catch'](handleError(_0x4cdeb3,null));};exports['download']=function(_0x52903d,_0x29c4c7){var _0x47fac8=moment()['unix']()['toString']();var _0x510eb5=path[_0x545c('0x6f')](config[_0x545c('0x70')],_0x545c('0xb0'),'files',_0x545c('0xb1'));var _0x265592=path[_0x545c('0x6f')](config[_0x545c('0x70')],_0x545c('0xb0'),_0x545c('0xb2'),_0x545c('0xb3'));var _0x53e27a=path[_0x545c('0x6f')](_0x510eb5,_0x47fac8);var _0x369139=util[_0x545c('0x77')]('transcript-%d-%s.zip',_0x52903d[_0x545c('0x3f')]['id'],_0x47fac8);var _0x2c0956=path['join'](_0x510eb5,_0x369139);var _0x3e6c1b=[];_0x3e6c1b[_0x545c('0xa9')]({'model':db['User'],'as':_0x545c('0x7b'),'attributes':['id',_0x545c('0x52')],'raw':!![]});_0x3e6c1b[_0x545c('0xa9')]({'model':db[_0x545c('0x7d')],'as':'Contact','attributes':['id','firstName',_0x545c('0xb4')],'raw':!![]});if(_0x52903d[_0x545c('0x3c')][_0x545c('0xb3')]){_0x3e6c1b[_0x545c('0xa9')]({'model':db[_0x545c('0x6b')],'as':_0x545c('0x6b'),'raw':!![]});}var _0x695ade=[{'model':db['ChatMessage'],'as':_0x545c('0x7e'),'attributes':['id',_0x545c('0x32'),_0x545c('0x89'),_0x545c('0x8a'),_0x545c('0x8b'),_0x545c('0xb5')],'include':_0x3e6c1b}];_0x695ade['push']({'model':db[_0x545c('0x7c')],'as':_0x545c('0xb6'),'attributes':['id',_0x545c('0x2f')]});_0x695ade[_0x545c('0xa9')]({'model':db['User'],'as':_0x545c('0xb7'),'attributes':['id',_0x545c('0x52')]});return db[_0x545c('0x36')][_0x545c('0x49')]({'where':{'id':_0x52903d['params']['id']},'include':_0x695ade})[_0x545c('0x18')](handleEntityNotFound(_0x29c4c7,null))[_0x545c('0x18')](function(_0x4ce08e){if(_0x4ce08e){var _0x1fbc19=_0x4ce08e['get']({'plain':!![]});fs[_0x545c('0xb8')](_0x53e27a);var _0x40a6d2={'channel':_0x545c('0xb9'),'account':_0x1fbc19[_0x545c('0xb6')][_0x545c('0x2f')],'agent':_0x1fbc19[_0x545c('0xb7')]?_0x1fbc19[_0x545c('0xb7')][_0x545c('0x52')]:'N.A.','createdAt':moment(_0x1fbc19[_0x545c('0x89')])[_0x545c('0x77')](_0x545c('0xba'))[_0x545c('0xbb')](),'closedAt':_0x1fbc19[_0x545c('0x64')]?moment(_0x1fbc19[_0x545c('0xbc')])[_0x545c('0x77')](_0x545c('0xba'))[_0x545c('0xbb')]():'','disposition':_0x1fbc19[_0x545c('0x65')],'chatInfo':{'browser':_0x1fbc19[_0x545c('0xbd')],'os':_0x1fbc19[_0x545c('0xbe')],'referer':_0x1fbc19[_0x545c('0xbf')],'customerIp':_0x1fbc19['customerIp'],'customerPort':_0x1fbc19[_0x545c('0xc0')]?_0x1fbc19[_0x545c('0xc0')]:_0x545c('0xc1')},'messages':_(_0x1fbc19['Messages'])['tail']()[_0x545c('0xa2')]({'secret':![]})['map'](function(_0x42118b){if(_0x42118b[_0x545c('0x6b')]){var _0x2f52c6=path['join'](_0x265592,_0x42118b[_0x545c('0x6b')][_0x545c('0x73')]);if(fs['existsSync'](_0x2f52c6)){fs[_0x545c('0xc2')](_0x2f52c6)['pipe'](fs[_0x545c('0xc3')](path[_0x545c('0x6f')](_0x53e27a,_0x42118b['Attachment'][_0x545c('0x73')])));}}return{'date':moment(_0x42118b['createdAt'])['format'](_0x545c('0xba'))['toString'](),'sender':_0x42118b[_0x545c('0x8a')]==='out'?_0x42118b[_0x545c('0x7b')]?_0x42118b[_0x545c('0x7b')][_0x545c('0x52')]:_0x545c('0x7f'):_0x42118b[_0x545c('0x5f')][_0x545c('0xc4')]+(_0x42118b['Contact']['lastName']?'\x20'+_0x42118b[_0x545c('0x5f')][_0x545c('0xb4')]:''),'body':_0x42118b[_0x545c('0x6b')]?_0x42118b[_0x545c('0x6b')][_0x545c('0x73')]:_0x42118b['body'],'direction':_0x42118b['direction']===_0x545c('0xc5')?'A':'C','secret':_0x42118b['secret'],'read':_0x42118b[_0x545c('0xb5')],'attachment':_0x42118b['Attachment']};})[_0x545c('0xc6')]()};return ejs[_0x545c('0xc7')](path['join'](config[_0x545c('0x70')],_0x545c('0xb0'),_0x545c('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x40a6d2})[_0x545c('0x18')](function(_0x14e0cf){var _0x750c45=path['join'](_0x53e27a,'transcript-'+_0x1fbc19['id']+'-'+_0x47fac8+_0x545c('0xc9'));var _0xf58f0a={'path':_0x750c45,'channel':_0x545c('0xb9'),'interactionId':_0x1fbc19['id']};return pdf[_0x545c('0xca')](_0x14e0cf,_0xf58f0a);})[_0x545c('0x18')](function(){return new Promise(function(_0x13953d,_0x5ec33a){zipdir(_0x53e27a,{'saveTo':_0x2c0956},function(_0x13388f,_0x55175b){if(_0x13388f)return _0x5ec33a(_0x13388f);return _0x13953d(_0x55175b);});})[_0x545c('0x18')](function(){return new BPromise(function(_0x5d1783,_0x445ccc){rimraf(_0x53e27a,function(_0x34127a){if(_0x34127a)_0x445ccc(_0x34127a);return _0x5d1783();});});})[_0x545c('0x18')](function(){return _0x29c4c7['download'](_0x2c0956,_0x369139,function(_0x45d9ae){if(_0x45d9ae){logger['error'](_0x545c('0xcb'),_0x45d9ae);}else{fs['unlinkSync'](_0x2c0956);}});});});}else{return _0x29c4c7[_0x545c('0x2d')](0xc8);}})[_0x545c('0x22')](handleError(_0x29c4c7,null));}; \ No newline at end of file +var _0x9479=['parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','getMyMessages','ChatInteractionId','includeAgent','addTags','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','push','createdAt','read','Account','get','mkdirSync','Chat','Owner','N.A.','toString','closedAt','browserName','osName','customerPort','tail','existsSync','createReadStream','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','name','send','render','merge','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','attributes','fields','length','options','create','update','body','destroy','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow'];(function(_0xfe96d1,_0x2f72d2){var _0x4e9b0e=function(_0xd9d76c){while(--_0xd9d76c){_0xfe96d1['push'](_0xfe96d1['shift']());}};_0x4e9b0e(++_0x2f72d2);}(_0x9479,0x15f));var _0x9947=function(_0x13a72c,_0x3f7e9d){_0x13a72c=_0x13a72c-0x0;var _0x475d01=_0x9479[_0x13a72c];return _0x475d01;};'use strict';var rimraf=require(_0x9947('0x0'));var zipdir=require(_0x9947('0x1'));var rp=require(_0x9947('0x2'));var moment=require('moment');var BPromise=require(_0x9947('0x3'));var Mustache=require('mustache');var util=require(_0x9947('0x4'));var path=require('path');var ejs=require(_0x9947('0x5'));var fs=require('fs');var _=require(_0x9947('0x6'));var Redis=require(_0x9947('0x7'));var interaction=require(_0x9947('0x8'));var qs=require(_0x9947('0x9'));var pdf=require(_0x9947('0xa'));var logger=require(_0x9947('0xb'))(_0x9947('0xc'));var config=require(_0x9947('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9947('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9947('0xf'))(new Redis(config[_0x9947('0x10')]));require(_0x9947('0x11'))[_0x9947('0x12')](socket);var jayson=require(_0x9947('0x13'));var client=jayson[_0x9947('0x14')][_0x9947('0x15')]({'port':0x232b});var client9004=jayson[_0x9947('0x14')][_0x9947('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x52f61d,_0x276cd3,_0x59bedb,_0x47017e){return new BPromise(function(_0x4a1c85,_0x3321d3){var _0x82a52b=_0x47017e||client;return _0x82a52b[_0x9947('0x16')](_0x52f61d,_0x59bedb)[_0x9947('0x17')](function(_0xbf3ae6){logger['info'](_0x9947('0x18'),_0x276cd3,'request\x20sent');logger[_0x9947('0x19')](_0x9947('0x1a'),_0x276cd3,'request\x20sent',JSON[_0x9947('0x1b')](_0xbf3ae6));if(_0xbf3ae6[_0x9947('0x1c')]){if(_0xbf3ae6[_0x9947('0x1c')][_0x9947('0x1d')]===0x1f4){logger['error'](_0x9947('0x18'),_0x276cd3,_0xbf3ae6['error'][_0x9947('0x1e')]);return _0x3321d3(_0xbf3ae6['error'][_0x9947('0x1e')]);}logger[_0x9947('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x276cd3,_0xbf3ae6[_0x9947('0x1c')][_0x9947('0x1e')]);return _0x4a1c85(_0xbf3ae6[_0x9947('0x1c')][_0x9947('0x1e')]);}else{logger[_0x9947('0x1f')](_0x9947('0x18'),_0x276cd3,_0x9947('0x20'));_0x4a1c85(_0xbf3ae6['result'][_0x9947('0x1e')]);}})[_0x9947('0x21')](function(_0x4cf8d7){logger['error'](_0x9947('0x18'),_0x276cd3,_0x4cf8d7);_0x3321d3(_0x4cf8d7);});});}function respondWithStatusCode(_0x3c19fc,_0x53242a){_0x53242a=_0x53242a||0xcc;return function(_0x59bc8f){if(_0x59bc8f){return _0x3c19fc[_0x9947('0x22')](_0x53242a);}return _0x3c19fc[_0x9947('0x23')](_0x53242a)[_0x9947('0x24')]();};}function respondWithResult(_0x3f7152,_0x32649b){_0x32649b=_0x32649b||0xc8;return function(_0x2e45a2){if(_0x2e45a2){return _0x3f7152['status'](_0x32649b)[_0x9947('0x25')](_0x2e45a2);}};}function respondWithFilteredResult(_0x504dde,_0x350b4f){return function(_0x18a4cf){if(_0x18a4cf){var _0x3d6039=typeof _0x350b4f[_0x9947('0x26')]===_0x9947('0x27')&&typeof _0x350b4f[_0x9947('0x28')]==='undefined';var _0x526176=_0x18a4cf[_0x9947('0x29')];var _0x1ba73d=_0x3d6039?0x0:_0x350b4f['offset'];var _0x484841=_0x3d6039?_0x18a4cf[_0x9947('0x29')]:_0x350b4f[_0x9947('0x26')]+_0x350b4f[_0x9947('0x28')];var _0x5e6c5e;if(_0x484841>=_0x526176){_0x484841=_0x526176;_0x5e6c5e=0xc8;}else{_0x5e6c5e=0xce;}_0x504dde['status'](_0x5e6c5e);return _0x504dde[_0x9947('0x2a')](_0x9947('0x2b'),_0x1ba73d+'-'+_0x484841+'/'+_0x526176)[_0x9947('0x25')](_0x18a4cf);}return null;};}function saveUpdates(_0x3b79c8){return function(_0x304387){if(_0x304387){return _0x304387['update'](_0x3b79c8)[_0x9947('0x17')](function(_0x418a7d){return _0x418a7d;});}return null;};}function removeEntity(_0x2eebd1){return function(_0x48579e){if(_0x48579e){return _0x48579e['destroy']()[_0x9947('0x17')](function(){_0x2eebd1[_0x9947('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32608e){return function(_0x884a0c){if(!_0x884a0c){_0x32608e[_0x9947('0x22')](0x194);}return _0x884a0c;};}function handleError(_0x574b69,_0x1c50a4){_0x1c50a4=_0x1c50a4||0x1f4;return function(_0x42c34f){logger[_0x9947('0x1c')](_0x42c34f['stack']);if(_0x42c34f['name']){delete _0x42c34f[_0x9947('0x2c')];}_0x574b69[_0x9947('0x23')](_0x1c50a4)[_0x9947('0x2d')](_0x42c34f);};}function getMustacheRender(_0x161026,_0x3d4c22){return Mustache[_0x9947('0x2e')](_0x161026,_[_0x9947('0x2f')](_0x3d4c22['body'],{'contact':_0x3d4c22[_0x9947('0x30')],'message':_0x3d4c22[_0x9947('0x1e')],'agent':_0x3d4c22[_0x9947('0x31')],'interaction':_0x3d4c22[_0x9947('0x32')],'account':_0x3d4c22[_0x9947('0x33')]}))||'';}exports[_0x9947('0x34')]=function(_0x42f9b2,_0x17cc80){var _0x192f5f={};var _0x5c7d71=_[_0x9947('0x35')](db[_0x9947('0x36')][_0x9947('0x37')],function(_0x3d841e){return{'name':_0x3d841e[_0x9947('0x38')],'type':_0x3d841e[_0x9947('0x39')][_0x9947('0x3a')]};});_0x192f5f=qs[_0x9947('0x3b')](_0x5c7d71,_0x42f9b2);return interaction[_0x9947('0x3c')](_0x9947('0x3d'),_0x42f9b2[_0x9947('0x3e')],_0x42f9b2[_0x9947('0x3f')],_0x192f5f,_0x5c7d71)[_0x9947('0x17')](respondWithFilteredResult(_0x17cc80,_0x192f5f))['catch'](handleError(_0x17cc80,null));};exports['show']=function(_0x426e88,_0x30e7bf){var _0x221ab9={'raw':![],'where':{'id':_0x426e88[_0x9947('0x40')]['id']}},_0x4bbd7a={};_0x4bbd7a[_0x9947('0x41')]=_[_0x9947('0x42')](db[_0x9947('0x36')][_0x9947('0x37')]);_0x4bbd7a[_0x9947('0x3e')]=_[_0x9947('0x42')](_0x426e88[_0x9947('0x3e')]);_0x4bbd7a[_0x9947('0x43')]=_[_0x9947('0x44')](_0x4bbd7a[_0x9947('0x41')],_0x4bbd7a[_0x9947('0x3e')]);_0x221ab9[_0x9947('0x45')]=_[_0x9947('0x44')](_0x4bbd7a[_0x9947('0x41')],qs[_0x9947('0x46')](_0x426e88[_0x9947('0x3e')]['fields']));_0x221ab9[_0x9947('0x45')]=_0x221ab9[_0x9947('0x45')][_0x9947('0x47')]?_0x221ab9['attributes']:_0x4bbd7a[_0x9947('0x41')];if(_0x426e88[_0x9947('0x3e')]['includeAll']){_0x221ab9['include']=[{'all':!![]}];}_0x221ab9=_['merge']({},_0x221ab9,_0x426e88[_0x9947('0x48')]);return db[_0x9947('0x36')]['find'](_0x221ab9)[_0x9947('0x17')](handleEntityNotFound(_0x30e7bf,null))['then'](respondWithResult(_0x30e7bf,null))[_0x9947('0x21')](handleError(_0x30e7bf,null));};exports[_0x9947('0x49')]=function(_0x414834,_0x2b2d72){return db['ChatInteraction'][_0x9947('0x49')](_0x414834['body'],{})[_0x9947('0x17')](respondWithResult(_0x2b2d72,0xc9))[_0x9947('0x21')](handleError(_0x2b2d72,null));};exports[_0x9947('0x4a')]=function(_0x496c04,_0x3a9352){if(_0x496c04[_0x9947('0x4b')]['id']){delete _0x496c04['body']['id'];}return db[_0x9947('0x36')]['find']({'where':{'id':_0x496c04[_0x9947('0x40')]['id']}})['then'](handleEntityNotFound(_0x3a9352,null))[_0x9947('0x17')](saveUpdates(_0x496c04['body'],null))[_0x9947('0x17')](respondWithResult(_0x3a9352,null))[_0x9947('0x21')](handleError(_0x3a9352,null));};exports[_0x9947('0x4c')]=function(_0x2455dd,_0x57b52d){return db['ChatInteraction'][_0x9947('0x4d')]({'where':{'id':_0x2455dd[_0x9947('0x40')]['id']}})[_0x9947('0x17')](handleEntityNotFound(_0x57b52d,null))[_0x9947('0x17')](removeEntity(_0x57b52d,null))['catch'](handleError(_0x57b52d,null));};exports[_0x9947('0x4e')]=function(_0x5c8dac,_0x4c51fb){return db[_0x9947('0x36')][_0x9947('0x4e')]()[_0x9947('0x17')](respondWithResult(_0x4c51fb,null))[_0x9947('0x21')](handleError(_0x4c51fb,null));};exports[_0x9947('0x4f')]=function(_0x56b5a4,_0x28eb45){var _0x506cb0=_0x56b5a4[_0x9947('0x40')]['id'];var _0x37313a;var _0x172fbf;var _0x2066d1;return db[_0x9947('0x36')][_0x9947('0x50')]({'where':{'id':_0x506cb0}})[_0x9947('0x17')](function(_0x4ec373){_0x37313a=_0x4ec373;return db[_0x9947('0x51')]['findOne']({'where':{'id':_0x4ec373[_0x9947('0x52')]},'attributes':['id',_0x9947('0x53'),_0x9947('0x54'),_0x9947('0x55'),'vidaooNote',_0x9947('0x56')],'raw':!![]});})[_0x9947('0x17')](function(_0x38fd3b){if(_0x38fd3b&&_0x38fd3b[_0x9947('0x53')]&&_0x38fd3b[_0x9947('0x54')]){_0x172fbf=_0x38fd3b;var _0x192f3a={'interaction':{'id':_0x506cb0},'agent':{'id':_0x56b5a4[_0x9947('0x3f')]['id'],'name':_0x56b5a4[_0x9947('0x3f')][_0x9947('0x2c')],'fullname':_0x56b5a4[_0x9947('0x3f')]['fullname'],'email':_0x56b5a4['user'][_0x9947('0x57')]},'contact':_0x56b5a4['body'][_0x9947('0x30')],'account':_0x56b5a4[_0x9947('0x4b')][_0x9947('0x33')]};var _0x5d71d0={'rejectUnauthorized':![],'method':_0x9947('0x58'),'url':_0x9947('0x59'),'headers':{'X-APIKEY':_0x38fd3b[_0x9947('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x56b5a4[_0x9947('0x3f')][_0x9947('0x57')]],'buttons':null,'topic':_0x172fbf[_0x9947('0x55')],'note':_[_0x9947('0x5a')](_0x172fbf[_0x9947('0x5b')])?null:getMustacheRender(_0x172fbf[_0x9947('0x5b')],_0x192f3a),'metadata':null},'redirect':_0x9947('0x5c'),'json':!![]};try{if(!_['isNull'](_0x172fbf[_0x9947('0x56')])){var _0x33273f=getMustacheRender(_0x172fbf['vidaooMetadata'],_0x192f3a);var _0x515483=JSON[_0x9947('0x5d')](_0x33273f);_0x5d71d0[_0x9947('0x4b')]['metadata']=_0x515483;}}catch(_0x575188){throw new db[(_0x9947('0x5e'))][(_0x9947('0x5f'))](_0x9947('0x60'));}return rp(_0x5d71d0);}else{throw new db[(_0x9947('0x5e'))][(_0x9947('0x5f'))](_0x9947('0x61'));}})[_0x9947('0x17')](function(_0x48d78c){_0x2066d1=_0x48d78c;if(_0x2066d1['id']){var _0xba435f={'body':_0x2066d1[_0x9947('0x62')],'ChatWebsiteId':_0x172fbf['id'],'ChatInteractionId':_0x37313a['id'],'direction':'out','UserId':_0x56b5a4[_0x9947('0x3f')]['id']};return db[_0x9947('0x63')]['create'](_0xba435f,{});}else{throw new db[(_0x9947('0x5e'))][(_0x9947('0x5f'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x37313a[_0x9947('0x64')]({'vidaooSessionId':_0x2066d1['id']});})['then'](respondWithResult(_0x28eb45,null))[_0x9947('0x21')](handleError(_0x28eb45,null));};exports[_0x9947('0x65')]=function(_0x38f128,_0x24bbde){if(_0x38f128[_0x9947('0x4b')]['id']){delete _0x38f128['body']['id'];}return db[_0x9947('0x36')][_0x9947('0x4d')]({'where':{'id':_0x38f128[_0x9947('0x40')]['id']},'include':[{'model':db[_0x9947('0x66')],'as':_0x9947('0x67')}]})[_0x9947('0x17')](handleEntityNotFound(_0x24bbde,null))[_0x9947('0x17')](saveUpdates(_0x38f128[_0x9947('0x4b')],null))['then'](respondWithResult(_0x24bbde,null))[_0x9947('0x21')](handleError(_0x24bbde,null));};exports['abandon']=function(_0x43fe83,_0x307954){if(_0x43fe83[_0x9947('0x4b')]['id']){delete _0x43fe83[_0x9947('0x4b')]['id'];}return db[_0x9947('0x36')][_0x9947('0x4d')]({'where':{'id':_0x43fe83[_0x9947('0x40')]['id']}})['then'](function(_0x4518c9){if(!_0x4518c9){logger[_0x9947('0x1c')](_0x9947('0x68'),_0x9947('0x69'),0x194,_0x9947('0x6a'));_0x307954[_0x9947('0x22')](0x194);}else{if(_0x4518c9['UserId']){throw new db[(_0x9947('0x5e'))][(_0x9947('0x5f'))](_0x9947('0x6b'));}}return _0x4518c9;})[_0x9947('0x17')](function(_0x1c4ada){if(_0x1c4ada){return _0x1c4ada[_0x9947('0x4a')]({'closed':_0x43fe83['body']['closed'],'disposition':_0x43fe83[_0x9947('0x4b')][_0x9947('0x6c')]})[_0x9947('0x17')](function(_0x3f0b99){return _0x3f0b99;});}})[_0x9947('0x17')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x43fe83[_0x9947('0x4b')],client9004);})[_0x9947('0x17')](respondWithResult(_0x307954,null))['catch'](handleError(_0x307954,null));};exports[_0x9947('0x6d')]=function(_0x55716d,_0x5101c4){_0x55716d[_0x9947('0x4b')][_0x9947('0x2c')]=_0x55716d[_0x9947('0x6e')][_0x9947('0x6f')];_0x55716d[_0x9947('0x4b')][_0x9947('0x70')]=_0x55716d['file'][_0x9947('0x71')];_0x55716d[_0x9947('0x4b')][_0x9947('0x39')]=_0x55716d[_0x9947('0x6e')][_0x9947('0x72')];return db[_0x9947('0x73')][_0x9947('0x49')](_0x55716d[_0x9947('0x4b')])[_0x9947('0x17')](respondWithResult(_0x5101c4,0xc9))[_0x9947('0x21')](handleError(_0x5101c4,null));};exports['attachmentDownload']=function(_0x4af2c4,_0x4accfa){return db[_0x9947('0x36')][_0x9947('0x50')]({'where':{'id':_0x4af2c4[_0x9947('0x40')]['id']},'raw':!![]})[_0x9947('0x17')](handleEntityNotFound(_0x4accfa,null))['then'](function(_0x5b91f5){if(_0x5b91f5){if(_0x5b91f5[_0x9947('0x74')]){return _0x4accfa[_0x9947('0x23')](0x193)['json']({'status':0x193,'message':_0x9947('0x75')});}return db[_0x9947('0x73')]['findOne']({'where':{'id':_0x4af2c4['query'][_0x9947('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x4accfa,null));}})[_0x9947('0x17')](function(_0x300776){if(_0x300776){var _0x187e7c=_0x300776[_0x9947('0x77')]!==null;var _0x39e4c6=path[_0x9947('0x78')](config[_0x9947('0x79')],_0x9947('0x7a'));if(_0x187e7c){_0x39e4c6=path[_0x9947('0x78')](_0x39e4c6,_0x9947('0x7b'));}var _0x1b5c56=path[_0x9947('0x78')](_0x39e4c6,_0x300776[_0x9947('0x70')]);return _0x4accfa[_0x9947('0x7c')](_0x1b5c56);}})[_0x9947('0x21')](handleError(_0x4accfa,null));};exports[_0x9947('0x7d')]=function(_0x4c1a45,_0x387e81){var _0x2e3b50=null;var _0x31958d=null;var _0x4dd501=null;if(_0x4c1a45['body']['id']){delete _0x4c1a45[_0x9947('0x4b')]['id'];}if(_0x4c1a45['body'][_0x9947('0x7e')]){_0x4dd501=path[_0x9947('0x78')](config[_0x9947('0x79')],_0x9947('0x7f'),util[_0x9947('0x80')](_0x9947('0x81'),Date['now']()));_0x4c1a45['body']['pathTranscript']=_0x4dd501;}return db[_0x9947('0x36')]['find']({'where':{'id':_0x4c1a45[_0x9947('0x40')]['id']},'include':[{'model':db[_0x9947('0x63')],'as':_0x9947('0x82'),'include':[{'model':db[_0x9947('0x83')],'as':_0x9947('0x83')}]}]})['then'](handleEntityNotFound(_0x387e81,null))[_0x9947('0x17')](saveUpdates(_0x4c1a45[_0x9947('0x4b')],null))['then'](function(_0x275df8){if(_0x275df8){_0x2e3b50=_0x275df8;return db[_0x9947('0x51')]['find']({'where':{'id':_0x2e3b50['ChatWebsiteId']}});}})[_0x9947('0x17')](function(_0x24d39c){if(_0x24d39c){_0x31958d=_0x24d39c;return db['CmContact']['find']({'where':{'id':_0x2e3b50[_0x9947('0x84')]}});}})[_0x9947('0x17')](function(_0x49800b){if(_0x49800b){if(_0x4dd501){var _0x47344e=null;for(var _0x524dc6=0x1;_0x524dc6<_0x2e3b50['Messages'][_0x9947('0x47')];++_0x524dc6){_0x47344e=_0x2e3b50[_0x9947('0x82')][_0x524dc6];var _0x113ebf=_0x47344e[_0x9947('0x85')]?util['format'](_0x9947('0x86'),_0x31958d[_0x9947('0x87')],_0x47344e['UserId']):_0x9947('0x88');var _0x3c5479=_0x4c1a45[_0x9947('0x4b')][_0x9947('0x89')]||util[_0x9947('0x80')](_0x9947('0x86'),_0x9947('0x8a'),_0x47344e[_0x9947('0x84')]);switch(_0x31958d[_0x9947('0x8b')]){case _0x9947('0x8c'):_0x113ebf=_0x47344e[_0x9947('0x85')]?util['format'](_0x9947('0x86'),_0x31958d[_0x9947('0x87')],_0x47344e['UserId']):_0x9947('0x88');break;case _0x9947('0x8d'):_0x113ebf=_0x47344e[_0x9947('0x85')]?_0x47344e['User'][_0x9947('0x8e')]||_0x47344e['User'][_0x9947('0x8f')]:_0x9947('0x88');break;case _0x9947('0x90'):_0x113ebf=_0x47344e[_0x9947('0x85')]?_0x47344e['User'][_0x9947('0x8f')]:_0x9947('0x88');break;default:_0x113ebf=_0x47344e[_0x9947('0x85')]?util[_0x9947('0x80')](_0x9947('0x86'),_0x31958d[_0x9947('0x87')],_0x47344e['UserId']):_0x9947('0x88');}var _0x17a786=util['format'](_0x9947('0x91'),moment(_0x47344e['createdAt'])[_0x9947('0x80')](_0x9947('0x92')),_0x47344e[_0x9947('0x93')]==='in'?_0x3c5479:_0x113ebf,_0x47344e[_0x9947('0x4b')]);if(!_0x47344e[_0x9947('0x94')]){fs[_0x9947('0x95')](_0x4dd501,_0x17a786);}}return db[_0x9947('0x96')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x9947('0x97')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9947('0x98'),'raw':!![]}]}]});}}})['then'](function(_0x3edc04){if(!_0x3edc04||!_0x3edc04[_0x9947('0x99')]||!_0x4c1a45[_0x9947('0x4b')])return _0x2e3b50;var _0x4d19ab=_0x3edc04[_0x9947('0x9a')]();return respondWithRpcPromise(_0x9947('0x9b'),_0x9947('0x9c'),{'account':_0x4d19ab,'message':{'from':util[_0x9947('0x80')](_0x9947('0x9d'),_0x3edc04[_0x9947('0x2c')],_0x3edc04[_0x9947('0x57')]||_0x3edc04['Smtp'][_0x9947('0x3f')]),'to':_0x4c1a45[_0x9947('0x4b')][_0x9947('0x7e')],'subject':_0x9947('0x9e'),'text':util[_0x9947('0x80')](_0x9947('0x9f'),_0x4c1a45[_0x9947('0x4b')][_0x9947('0x7e')]),'attachments':[{'path':_0x4dd501}]}})['then'](function(){return _0x2e3b50;})[_0x9947('0x21')](function(_0x5beb01){logger[_0x9947('0x1c')](_0x5beb01);});})['then'](respondWithStatusCode(_0x387e81,0xc8))['catch'](handleError(_0x387e81,null));};exports[_0x9947('0xa0')]=function(_0x3eb449,_0x1b8b1e){return db[_0x9947('0x63')][_0x9947('0x4d')]({'where':{'id':_0x3eb449[_0x9947('0x40')]['id']}})[_0x9947('0x17')](handleEntityNotFound(_0x1b8b1e,null))[_0x9947('0x17')](function(_0x46e6fc){if(_0x46e6fc){return _0x46e6fc[_0x9947('0xa0')](_0x3eb449[_0x9947('0x4b')][_0x9947('0xa1')],_[_0x9947('0xa2')](_0x3eb449[_0x9947('0x4b')],['ids','id'])||{});}})[_0x9947('0x17')](respondWithResult(_0x1b8b1e,null))[_0x9947('0x21')](handleError(_0x1b8b1e,null));};exports[_0x9947('0xa3')]=function(_0x49ca3b,_0x21e6e9){var _0x37cb08={'raw':![],'where':{}};var _0x4faa31={};var _0x6d7688={'count':0x0,'rows':[]};return db[_0x9947('0x36')][_0x9947('0x50')]({'where':{'id':_0x49ca3b[_0x9947('0x40')]['id']}})[_0x9947('0x17')](handleEntityNotFound(_0x21e6e9,null))[_0x9947('0x17')](function(_0x146f34){if(_0x146f34){_0x4faa31[_0x9947('0x41')]=_['keys'](db[_0x9947('0x63')][_0x9947('0x37')]);_0x4faa31[_0x9947('0x3e')]=_[_0x9947('0x42')](_0x49ca3b[_0x9947('0x3e')]);_0x4faa31[_0x9947('0x43')]=_['intersection'](_0x4faa31[_0x9947('0x41')],_0x4faa31['query']);_0x37cb08[_0x9947('0x45')]=_[_0x9947('0x44')](_0x4faa31[_0x9947('0x41')],qs[_0x9947('0x46')](_0x49ca3b[_0x9947('0x3e')]['fields']));_0x37cb08[_0x9947('0x45')]=_0x37cb08[_0x9947('0x45')][_0x9947('0x47')]?_0x37cb08[_0x9947('0x45')]:_0x4faa31[_0x9947('0x41')];if(!_0x49ca3b[_0x9947('0x3e')][_0x9947('0xa4')](_0x9947('0xa5'))){_0x37cb08[_0x9947('0x28')]=qs['limit'](_0x49ca3b[_0x9947('0x3e')][_0x9947('0x28')]);_0x37cb08[_0x9947('0x26')]=qs[_0x9947('0x26')](_0x49ca3b['query'][_0x9947('0x26')]);}_0x37cb08[_0x9947('0xa6')]=qs[_0x9947('0xa7')](_0x49ca3b[_0x9947('0x3e')][_0x9947('0xa7')]);_0x37cb08['where']=qs[_0x9947('0x43')](_[_0x9947('0xa8')](_0x49ca3b[_0x9947('0x3e')],_0x4faa31['filters']));_0x37cb08[_0x9947('0xa9')]['ChatInteractionId']=_0x146f34['id'];if(_0x49ca3b[_0x9947('0x3e')][_0x9947('0xaa')]){_0x37cb08['where']=_['merge'](_0x37cb08['where'],{'$or':_[_0x9947('0x35')](_0x37cb08[_0x9947('0x45')],function(_0x58833a){var _0x66f94d={};_0x66f94d[_0x58833a]={'$like':'%'+_0x49ca3b['query']['filter']+'%'};return _0x66f94d;})});}if(_0x49ca3b[_0x9947('0x3e')][_0x9947('0xab')]){var _0x5068e4=_0x49ca3b[_0x9947('0x3e')][_0x9947('0xab')][_0x9947('0xac')](',');var _0x34e7be={};_0x34e7be[_0x5068e4[0x0]]={'$gte':moment(_0x5068e4[0x1])[_0x9947('0x80')](_0x9947('0xad'))};_0x37cb08['where']=_[_0x9947('0x2f')](_0x37cb08['where'],_0x34e7be);}_0x37cb08=_[_0x9947('0x2f')]({},_0x37cb08,_0x49ca3b[_0x9947('0x48')]);return db['ChatMessage'][_0x9947('0x29')]({'where':_0x37cb08[_0x9947('0xa9')]})['then'](function(_0x165285){_0x6d7688[_0x9947('0x29')]=_0x165285;if(_0x49ca3b[_0x9947('0x3e')][_0x9947('0xae')]){_0x37cb08[_0x9947('0xaf')]=[{'all':!![]}];}return db[_0x9947('0x63')][_0x9947('0x3c')](_0x37cb08);})[_0x9947('0x17')](function(_0xcb89c1){_0x6d7688[_0x9947('0xb0')]=_0xcb89c1;return _0x6d7688;});}})['then'](respondWithFilteredResult(_0x21e6e9,_0x37cb08))[_0x9947('0x21')](handleError(_0x21e6e9,null));};exports[_0x9947('0xb1')]=function(_0x566ebc,_0x1792bf){var _0x4181c9={'where':{}},_0x8f6ad1={},_0x152a78={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9947('0x50')]({'where':{'id':_0x566ebc[_0x9947('0x40')]['id']}})[_0x9947('0x17')](handleEntityNotFound(_0x1792bf,null))[_0x9947('0x17')](function(_0x11c3f5){if(_0x11c3f5){_0x8f6ad1[_0x9947('0x41')]=_[_0x9947('0x42')](db[_0x9947('0x63')][_0x9947('0x37')]);_0x8f6ad1[_0x9947('0x3e')]=_['keys'](_0x566ebc['query']);_0x8f6ad1[_0x9947('0x43')]=_['intersection'](_0x8f6ad1[_0x9947('0x41')],_0x8f6ad1['query']);_0x4181c9['attributes']=_[_0x9947('0x44')](_0x8f6ad1['model'],qs['fields'](_0x566ebc[_0x9947('0x3e')][_0x9947('0x46')]));_0x4181c9[_0x9947('0x45')]=_0x4181c9['attributes'][_0x9947('0x47')]?_0x4181c9[_0x9947('0x45')]:_0x8f6ad1['model'];if(!_0x566ebc['query'][_0x9947('0xa4')](_0x9947('0xa5'))){_0x4181c9[_0x9947('0x28')]=qs['limit'](_0x566ebc[_0x9947('0x3e')]['limit']);_0x4181c9[_0x9947('0x26')]=qs[_0x9947('0x26')](_0x566ebc['query'][_0x9947('0x26')]);}_0x4181c9['order']=qs[_0x9947('0xa7')](_0x566ebc['query']['sort']);_0x4181c9[_0x9947('0xa9')]=qs[_0x9947('0x43')](_[_0x9947('0xa8')](_0x566ebc['query'],_0x8f6ad1[_0x9947('0x43')]));_0x4181c9[_0x9947('0xa9')][_0x9947('0xb2')]=_0x11c3f5['id'];if(_0x566ebc['query'][_0x9947('0xaa')]){_0x4181c9[_0x9947('0xa9')]=_[_0x9947('0x2f')](_0x4181c9[_0x9947('0xa9')],{'$or':_[_0x9947('0x35')](_0x4181c9[_0x9947('0x45')],function(_0x43bf45){var _0xf10586={};_0xf10586[_0x43bf45]={'$like':'%'+_0x566ebc['query'][_0x9947('0xaa')]+'%'};return _0xf10586;})});}_0x4181c9[_0x9947('0xa9')][_0x9947('0x94')]=![];if(_0x566ebc['query']['id']){_0x4181c9['where']['id']={'$gt':_0x566ebc[_0x9947('0x3e')]['id']};}_0x4181c9=_[_0x9947('0x2f')]({},_0x4181c9,_0x566ebc[_0x9947('0x48')]);return db[_0x9947('0x63')][_0x9947('0x29')]({'where':_0x4181c9[_0x9947('0xa9')]})['then'](function(_0x33de98){_0x152a78[_0x9947('0x29')]=_0x33de98;_0x4181c9[_0x9947('0xaf')]=[];if(_0x566ebc[_0x9947('0x3e')][_0x9947('0xb3')]){_0x4181c9[_0x9947('0xaf')]['push']({'model':db[_0x9947('0x83')],'as':_0x9947('0x83'),'attributes':['id',_0x9947('0x8f'),_0x9947('0x8e')]});}if(_0x566ebc['query'][_0x9947('0xae')]){_0x4181c9[_0x9947('0xaf')]=[{'all':!![]}];}return db[_0x9947('0x63')][_0x9947('0x3c')](_0x4181c9);})[_0x9947('0x17')](function(_0x4d9cd9){_0x152a78['rows']=_0x4d9cd9;return _0x152a78;});}})[_0x9947('0x17')](respondWithFilteredResult(_0x1792bf,_0x4181c9))[_0x9947('0x21')](handleError(_0x1792bf,null));};exports[_0x9947('0xb4')]=function(_0x309061,_0x3eddc6){return db['ChatInteraction'][_0x9947('0x4d')]({'where':{'id':_0x309061['params']['id']}})['then'](handleEntityNotFound(_0x3eddc6,null))[_0x9947('0x17')](function(_0xce6de6){if(_0xce6de6){return _0xce6de6[_0x9947('0xb5')](_0x309061['body'][_0x9947('0xa1')],_[_0x9947('0xa2')](_0x309061[_0x9947('0x4b')],['ids','id'])||{})[_0x9947('0xb6')](function(){return db['Tag'][_0x9947('0x3c')]({'attributes':['id',_0x9947('0x2c'),_0x9947('0xb7')],'where':{'id':_0x309061[_0x9947('0x4b')][_0x9947('0xa1')]}});})[_0x9947('0x17')](function(_0x472547){socket[_0x9947('0xb8')](_0x9947('0xb9'),{'id':Number(_0x309061['params']['id']),'tags':_0x472547||[]});return{'id':Number(_0x309061[_0x9947('0x40')]['id']),'tags':_0x472547||[]};});}})[_0x9947('0x17')](respondWithResult(_0x3eddc6,null))['catch'](handleError(_0x3eddc6,null));};exports['removeTags']=function(_0x1af205,_0x3076fa){return db[_0x9947('0x36')][_0x9947('0x4d')]({'where':{'id':_0x1af205['params']['id']}})[_0x9947('0x17')](handleEntityNotFound(_0x3076fa,null))[_0x9947('0x17')](function(_0x3a743f){if(_0x3a743f){return _0x3a743f[_0x9947('0xba')](_0x1af205[_0x9947('0x3e')][_0x9947('0xa1')]);}})['then'](respondWithStatusCode(_0x3076fa,null))['catch'](handleError(_0x3076fa,null));};exports[_0x9947('0x7c')]=function(_0x21a606,_0x565699){var _0x19e222=moment()[_0x9947('0xbb')]()['toString']();var _0x508b69=path[_0x9947('0x78')](config[_0x9947('0x79')],_0x9947('0xbc'),_0x9947('0xbd'),_0x9947('0xbe'));var _0x3586a8=path['join'](config[_0x9947('0x79')],_0x9947('0xbc'),_0x9947('0xbd'),_0x9947('0xbf'));var _0x16a7a8=path[_0x9947('0x78')](_0x508b69,_0x19e222);var _0x36e815=util[_0x9947('0x80')](_0x9947('0xc0'),_0x21a606[_0x9947('0x40')]['id'],_0x19e222);var _0xcb4cd1=path[_0x9947('0x78')](_0x508b69,_0x36e815);var _0x1f8591=[];_0x1f8591['push']({'model':db[_0x9947('0x83')],'as':_0x9947('0x83'),'attributes':['id',_0x9947('0x8f')],'raw':!![]});_0x1f8591['push']({'model':db[_0x9947('0x66')],'as':'Contact','attributes':['id',_0x9947('0xc1'),_0x9947('0xc2')],'raw':!![]});if(_0x21a606[_0x9947('0x3e')][_0x9947('0xbf')]){_0x1f8591[_0x9947('0xc3')]({'model':db['Attachment'],'as':_0x9947('0x73'),'raw':!![]});}var _0x2b6974=[{'model':db['ChatMessage'],'as':_0x9947('0x82'),'attributes':['id',_0x9947('0x4b'),_0x9947('0xc4'),_0x9947('0x93'),_0x9947('0x94'),_0x9947('0xc5')],'include':_0x1f8591}];_0x2b6974[_0x9947('0xc3')]({'model':db[_0x9947('0x51')],'as':_0x9947('0xc6'),'attributes':['id',_0x9947('0x2c')]});_0x2b6974[_0x9947('0xc3')]({'model':db[_0x9947('0x83')],'as':'Owner','attributes':['id',_0x9947('0x8f')]});return db['ChatInteraction'][_0x9947('0x4d')]({'where':{'id':_0x21a606[_0x9947('0x40')]['id']},'include':_0x2b6974})[_0x9947('0x17')](handleEntityNotFound(_0x565699,null))[_0x9947('0x17')](function(_0xc73c4){if(_0xc73c4){var _0x324bb0=_0xc73c4[_0x9947('0xc7')]({'plain':!![]});fs[_0x9947('0xc8')](_0x16a7a8);var _0xdefac4={'channel':_0x9947('0xc9'),'account':_0x324bb0[_0x9947('0xc6')][_0x9947('0x2c')],'agent':_0x324bb0[_0x9947('0xca')]?_0x324bb0[_0x9947('0xca')][_0x9947('0x8f')]:_0x9947('0xcb'),'createdAt':moment(_0x324bb0[_0x9947('0xc4')])[_0x9947('0x80')](_0x9947('0xad'))[_0x9947('0xcc')](),'closedAt':_0x324bb0[_0x9947('0x74')]?moment(_0x324bb0[_0x9947('0xcd')])[_0x9947('0x80')](_0x9947('0xad'))[_0x9947('0xcc')]():'','disposition':_0x324bb0[_0x9947('0x6c')],'chatInfo':{'browser':_0x324bb0[_0x9947('0xce')],'os':_0x324bb0[_0x9947('0xcf')],'referer':_0x324bb0['referer'],'customerIp':_0x324bb0['customerIp'],'customerPort':_0x324bb0[_0x9947('0xd0')]?_0x324bb0[_0x9947('0xd0')]:'N.A.'},'messages':_(_0x324bb0[_0x9947('0x82')])[_0x9947('0xd1')]()['filter']({'secret':![]})[_0x9947('0x35')](function(_0x4ce63c){if(_0x4ce63c[_0x9947('0x73')]){var _0x48b155=path[_0x9947('0x78')](_0x3586a8,_0x4ce63c[_0x9947('0x73')]['basename']);if(fs[_0x9947('0xd2')](_0x48b155)){fs[_0x9947('0xd3')](_0x48b155)['pipe'](fs[_0x9947('0xd4')](path['join'](_0x16a7a8,_0x4ce63c[_0x9947('0x73')]['basename'])));}}return{'date':moment(_0x4ce63c['createdAt'])[_0x9947('0x80')](_0x9947('0xad'))[_0x9947('0xcc')](),'sender':_0x4ce63c[_0x9947('0x93')]==='out'?_0x4ce63c[_0x9947('0x83')]?_0x4ce63c[_0x9947('0x83')]['fullname']:_0x9947('0x88'):_0x4ce63c['Contact']['firstName']+(_0x4ce63c[_0x9947('0x67')][_0x9947('0xc2')]?'\x20'+_0x4ce63c['Contact'][_0x9947('0xc2')]:''),'body':_0x4ce63c[_0x9947('0x73')]?_0x4ce63c[_0x9947('0x73')]['basename']:_0x4ce63c[_0x9947('0x4b')],'direction':_0x4ce63c['direction']===_0x9947('0xd5')?'A':'C','secret':_0x4ce63c['secret'],'read':_0x4ce63c[_0x9947('0xc5')],'attachment':_0x4ce63c[_0x9947('0x73')]};})[_0x9947('0xd6')]()};return ejs[_0x9947('0xd7')](path['join'](config['root'],'server',_0x9947('0xd8'),_0x9947('0xd9')),{'interaction':_0xdefac4})[_0x9947('0x17')](function(_0x49ae5e){var _0x5884f0=path[_0x9947('0x78')](_0x16a7a8,'transcript-'+_0x324bb0['id']+'-'+_0x19e222+_0x9947('0xda'));var _0x300dfd={'path':_0x5884f0,'channel':_0x9947('0xc9'),'interactionId':_0x324bb0['id']};return pdf[_0x9947('0xdb')](_0x49ae5e,_0x300dfd);})[_0x9947('0x17')](function(){return new Promise(function(_0x55c4e0,_0x164369){zipdir(_0x16a7a8,{'saveTo':_0xcb4cd1},function(_0x10f087,_0x21b7c3){if(_0x10f087)return _0x164369(_0x10f087);return _0x55c4e0(_0x21b7c3);});})[_0x9947('0x17')](function(){return new BPromise(function(_0x24f649,_0x3dc2e9){rimraf(_0x16a7a8,function(_0x3f5c6c){if(_0x3f5c6c)_0x3dc2e9(_0x3f5c6c);return _0x24f649();});});})['then'](function(){return _0x565699[_0x9947('0x7c')](_0xcb4cd1,_0x36e815,function(_0x49a2e5){if(_0x49a2e5){logger[_0x9947('0x1c')](_0x9947('0xdc'),_0x49a2e5);}else{fs[_0x9947('0xdd')](_0xcb4cd1);}});});});}else{return _0x565699[_0x9947('0x22')](0xc8);}})['catch'](handleError(_0x565699,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index e4ea888..c93df77 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 _0xe760=['update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0xe56ac4,_0x4e390f){var _0x19f84c=function(_0x2f6fc0){while(--_0x2f6fc0){_0xe56ac4['push'](_0xe56ac4['shift']());}};_0x19f84c(++_0x4e390f);}(_0xe760,0xf8));var _0x0e76=function(_0x558104,_0x6eabd3){_0x558104=_0x558104-0x0;var _0x5eba0f=_0xe760[_0x558104];return _0x5eba0f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0e76('0x0'))['db'][_0x0e76('0x1')];var ChatMessage=require(_0x0e76('0x0'))['db'][_0x0e76('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e76('0x3'),'afterUpdate':_0x0e76('0x4'),'afterDestroy':_0x0e76('0x5')};function emitEvent(_0x1eebb1){return function(_0x1e8e7c,_0x2dfc58,_0x16eb54){_0x1e8e7c[_0x0e76('0x6')]({'attributes':['id'],'raw':!![]})[_0x0e76('0x7')](function(_0x42c2d6){_0x1e8e7c['setDataValue']('Users',_0x42c2d6[_0x0e76('0x8')](function(_0x11002b){return{'id':_0x11002b['id']};}));return ChatMessage[_0x0e76('0x9')]({'where':{'ChatInteractionId':_0x1e8e7c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5e90db){_0x1e8e7c[_0x0e76('0xa')](_0x0e76('0xb'),_0x5e90db[_0x0e76('0xc')]);ChatInteractionEvents[_0x0e76('0xd')](_0x1eebb1+':'+_0x1e8e7c['id'],_0x1e8e7c);ChatInteractionEvents[_0x0e76('0xd')](_0x1eebb1,_0x1e8e7c);_0x16eb54(null);})[_0x0e76('0xe')](_0x16eb54(null));};}for(var e in events){if(events[_0x0e76('0xf')](e)){var event=events[e];ChatInteraction[_0x0e76('0x10')](e,emitEvent(event));}}module[_0x0e76('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x950c=['getUsers','then','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x950c,0x1d5));var _0xc950=function(_0x3a880f,_0x2e26ba){_0x3a880f=_0x3a880f-0x0;var _0x4418af=_0x950c[_0x3a880f];return _0x4418af;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xc950('0x0')];var ChatMessage=require(_0xc950('0x1'))['db'][_0xc950('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc950('0x3')](0x0);var events={'afterCreate':_0xc950('0x4'),'afterUpdate':_0xc950('0x5'),'afterDestroy':_0xc950('0x6')};function emitEvent(_0x10cb96){return function(_0x25ae5d,_0x315d40,_0x19facd){_0x25ae5d[_0xc950('0x7')]({'attributes':['id'],'raw':!![]})[_0xc950('0x8')](function(_0x186c8e){_0x25ae5d['setDataValue'](_0xc950('0x9'),_0x186c8e[_0xc950('0xa')](function(_0x2f9717){return{'id':_0x2f9717['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x25ae5d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc950('0x8')](function(_0x8011a3){_0x25ae5d['setDataValue'](_0xc950('0xb'),_0x8011a3[_0xc950('0xc')]);ChatInteractionEvents['emit'](_0x10cb96+':'+_0x25ae5d['id'],_0x25ae5d);ChatInteractionEvents[_0xc950('0xd')](_0x10cb96,_0x25ae5d);_0x19facd(null);})[_0xc950('0xe')](_0x19facd(null));};}for(var e in events){if(events[_0xc950('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xc950('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index c965f53..6193f1d 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 _0x1c31=['changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1c31,0x17e));var _0x11c3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1c31[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x11c3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x11c3('0x1'));var BPromise=require(_0x11c3('0x2'));var rp=require(_0x11c3('0x3'));var fs=require('fs');var path=require(_0x11c3('0x4'));var rimraf=require(_0x11c3('0x5'));var config=require(_0x11c3('0x6'));var attributes=require(_0x11c3('0x7'));module[_0x11c3('0x8')]=function(_0x2120e1,_0x37b0e1){return _0x2120e1['define'](_0x11c3('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x349f18,_0x57869a,_0x48a667){if(_0x349f18[_0x11c3('0xa')]('closed')){_0x349f18['closedAt']=moment()[_0x11c3('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x48a667(null,_0x349f18);}},'charset':_0x11c3('0xc'),'collate':_0x11c3('0xd')});}; \ No newline at end of file +var _0xf4b3=['path','../../config/environment','exports','define','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x239904,_0x4b11e2){var _0x259609=function(_0x41d52a){while(--_0x41d52a){_0x239904['push'](_0x239904['shift']());}};_0x259609(++_0x4b11e2);}(_0xf4b3,0x109));var _0x3f4b=function(_0x3baafb,_0x11761c){_0x3baafb=_0x3baafb-0x0;var _0x4d93c1=_0xf4b3[_0x3baafb];return _0x4d93c1;};'use strict';var _=require(_0x3f4b('0x0'));var util=require('util');var logger=require(_0x3f4b('0x1'))(_0x3f4b('0x2'));var moment=require(_0x3f4b('0x3'));var BPromise=require(_0x3f4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f4b('0x5'));var rimraf=require('rimraf');var config=require(_0x3f4b('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x3f4b('0x7')]=function(_0x58e502,_0x57bb31){return _0x58e502[_0x3f4b('0x8')]('ChatInteraction',attributes,{'tableName':_0x3f4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x538d6d,_0x25b6e2,_0xd9fdeb){if(_0x538d6d[_0x3f4b('0xa')](_0x3f4b('0xb'))){_0x538d6d['closedAt']=moment()[_0x3f4b('0xc')](_0x3f4b('0xd'));}_0xd9fdeb(null,_0x538d6d);}},'charset':'utf8mb4','collate':_0x3f4b('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d18383b..a5a995b 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 _0x1745=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','stringify','find','ids','omit','spread','AddTags','lodash','../../mysqldb'];(function(_0x3236be,_0x47eb9b){var _0x40a904=function(_0x14301c){while(--_0x14301c){_0x3236be['push'](_0x3236be['shift']());}};_0x40a904(++_0x47eb9b);}(_0x1745,0xd6));var _0x5174=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1745[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5174('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5174('0x1'))['db'];var utils=require(_0x5174('0x2'));var logger=require(_0x5174('0x3'))(_0x5174('0x4'));var config=require(_0x5174('0x5'));var jayson=require(_0x5174('0x6'));var client=jayson[_0x5174('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x5174('0x8')],{'host':_0x5174('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5174('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x13cdeb,_0x1c4779,_0x421d3a){return new BPromise(function(_0x30fc3d,_0x267cdb){return client[_0x5174('0xa')](_0x13cdeb,_0x421d3a)[_0x5174('0xb')](function(_0x527e98){logger[_0x5174('0xc')]('ChatInteraction,\x20%s,\x20%s',_0x1c4779,_0x5174('0xd'));logger[_0x5174('0xe')](_0x5174('0xf'),_0x1c4779,'request\x20sent',JSON['stringify'](_0x527e98));if(_0x527e98[_0x5174('0x10')]){if(_0x527e98[_0x5174('0x10')][_0x5174('0x11')]===0x1f4){logger[_0x5174('0x10')](_0x5174('0x12'),_0x1c4779,_0x527e98['error'][_0x5174('0x13')]);return _0x267cdb(_0x527e98[_0x5174('0x10')][_0x5174('0x13')]);}logger[_0x5174('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x1c4779,_0x527e98[_0x5174('0x10')][_0x5174('0x13')]);return _0x30fc3d(_0x527e98[_0x5174('0x10')][_0x5174('0x13')]);}else{logger[_0x5174('0xc')](_0x5174('0x12'),_0x1c4779,_0x5174('0xd'));_0x30fc3d(_0x527e98[_0x5174('0x14')][_0x5174('0x13')]);}})[_0x5174('0x15')](function(_0x3fb56e){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c4779,_0x3fb56e);_0x267cdb(_0x3fb56e);});});}exports[_0x5174('0x16')]=function(_0x51820e){var _0x2ac09a=this;return new Promise(function(_0x3e52f4,_0x45bbc4){return db[_0x5174('0x17')]['update'](_0x51820e[_0x5174('0x18')],{'raw':_0x51820e[_0x5174('0x19')]?_0x51820e[_0x5174('0x19')][_0x5174('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51820e[_0x5174('0x19')]?_0x51820e[_0x5174('0x19')][_0x5174('0x1b')]||null:null,'attributes':_0x51820e[_0x5174('0x19')]?_0x51820e[_0x5174('0x19')][_0x5174('0x1c')]||null:null,'limit':_0x51820e['options']?_0x51820e[_0x5174('0x19')][_0x5174('0x1d')]||null:null})['then'](function(_0x4f1d79){logger['info']('UpdateChatInteraction',_0x51820e);logger['debug'](_0x5174('0x16'),_0x51820e,JSON[_0x5174('0x1e')](_0x4f1d79));_0x3e52f4(_0x4f1d79);})['catch'](function(_0xb6e973){logger[_0x5174('0x10')](_0x5174('0x16'),_0xb6e973[_0x5174('0x13')],_0x51820e);_0x45bbc4(_0x2ac09a['error'](0x1f4,_0xb6e973['message']));});});};exports['AddTagsToChatInteraction']=function(_0x331c38){return new Promise(function(_0x17a81e,_0x3f62e9){return db[_0x5174('0x17')][_0x5174('0x1f')]({'where':_0x331c38[_0x5174('0x19')]?_0x331c38[_0x5174('0x19')][_0x5174('0x1b')]||null:null})[_0x5174('0xb')](function(_0x41326b){if(_0x41326b){return _0x41326b['addTags'](_0x331c38[_0x5174('0x18')][_0x5174('0x20')],_[_0x5174('0x21')](_0x331c38['body'],['ids','id'])||{});}})[_0x5174('0x22')](function(_0x5789b5){logger['info'](_0x5174('0x23'),_0x331c38);logger[_0x5174('0xe')](_0x5174('0x23'),_0x331c38,JSON[_0x5174('0x1e')](_0x5789b5));_0x17a81e(_0x5789b5);})[_0x5174('0x15')](function(_0x4b1e74){logger['error']('AddTags',_0x4b1e74['message'],_0x331c38);_0x3f62e9(_this[_0x5174('0x10')](0x1f4,_0x4b1e74['message']));});});}; \ No newline at end of file +var _0xf4f0=['ChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateChatInteraction'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf4f0,0x1b1));var _0x0f4f=function(_0x12926a,_0xb3be90){_0x12926a=_0x12926a-0x0;var _0x2db765=_0xf4f0[_0x12926a];return _0x2db765;};'use strict';var _=require(_0x0f4f('0x0'));var util=require(_0x0f4f('0x1'));var moment=require(_0x0f4f('0x2'));var BPromise=require(_0x0f4f('0x3'));var rs=require(_0x0f4f('0x4'));var fs=require('fs');var Redis=require(_0x0f4f('0x5'));var db=require(_0x0f4f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f4f('0x7'))(_0x0f4f('0x8'));var config=require(_0x0f4f('0x9'));var jayson=require(_0x0f4f('0xa'));var client=jayson[_0x0f4f('0xb')][_0x0f4f('0xc')]({'port':0x232a});config['redis']=_[_0x0f4f('0xd')](config[_0x0f4f('0xe')],{'host':_0x0f4f('0xf'),'port':0x18eb});var socket=require(_0x0f4f('0x10'))(new Redis(config[_0x0f4f('0xe')]));require(_0x0f4f('0x11'))['register'](socket);function respondWithRpcPromise(_0x5d9d6f,_0x4df95c,_0x33ed89){return new BPromise(function(_0x4bf337,_0x1be4f3){return client['request'](_0x5d9d6f,_0x33ed89)[_0x0f4f('0x12')](function(_0xdd0200){logger[_0x0f4f('0x13')](_0x0f4f('0x14'),_0x4df95c,_0x0f4f('0x15'));logger[_0x0f4f('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4df95c,'request\x20sent',JSON[_0x0f4f('0x17')](_0xdd0200));if(_0xdd0200['error']){if(_0xdd0200[_0x0f4f('0x18')][_0x0f4f('0x19')]===0x1f4){logger[_0x0f4f('0x18')](_0x0f4f('0x14'),_0x4df95c,_0xdd0200[_0x0f4f('0x18')][_0x0f4f('0x1a')]);return _0x1be4f3(_0xdd0200[_0x0f4f('0x18')][_0x0f4f('0x1a')]);}logger[_0x0f4f('0x18')](_0x0f4f('0x14'),_0x4df95c,_0xdd0200[_0x0f4f('0x18')][_0x0f4f('0x1a')]);return _0x4bf337(_0xdd0200[_0x0f4f('0x18')][_0x0f4f('0x1a')]);}else{logger[_0x0f4f('0x13')](_0x0f4f('0x14'),_0x4df95c,_0x0f4f('0x15'));_0x4bf337(_0xdd0200['result'][_0x0f4f('0x1a')]);}})[_0x0f4f('0x1b')](function(_0x1bd0fd){logger[_0x0f4f('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4df95c,_0x1bd0fd);_0x1be4f3(_0x1bd0fd);});});}exports[_0x0f4f('0x1c')]=function(_0x222dc8){var _0x4cfb23=this;return new Promise(function(_0x395316,_0x2d395a){return db[_0x0f4f('0x1d')][_0x0f4f('0x1e')](_0x222dc8[_0x0f4f('0x1f')],{'raw':_0x222dc8[_0x0f4f('0x20')]?_0x222dc8[_0x0f4f('0x20')][_0x0f4f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222dc8['options']?_0x222dc8[_0x0f4f('0x20')][_0x0f4f('0x22')]||null:null,'attributes':_0x222dc8[_0x0f4f('0x20')]?_0x222dc8['options'][_0x0f4f('0x23')]||null:null,'limit':_0x222dc8[_0x0f4f('0x20')]?_0x222dc8[_0x0f4f('0x20')]['limit']||null:null})[_0x0f4f('0x12')](function(_0xafa2f7){logger[_0x0f4f('0x13')](_0x0f4f('0x1c'),_0x222dc8);logger[_0x0f4f('0x16')]('UpdateChatInteraction',_0x222dc8,JSON['stringify'](_0xafa2f7));_0x395316(_0xafa2f7);})[_0x0f4f('0x1b')](function(_0x5a9205){logger[_0x0f4f('0x18')](_0x0f4f('0x1c'),_0x5a9205[_0x0f4f('0x1a')],_0x222dc8);_0x2d395a(_0x4cfb23[_0x0f4f('0x18')](0x1f4,_0x5a9205[_0x0f4f('0x1a')]));});});};exports[_0x0f4f('0x24')]=function(_0x2ca1d8){return new Promise(function(_0x2c4bea,_0x4ecf5b){return db['ChatInteraction']['find']({'where':_0x2ca1d8[_0x0f4f('0x20')]?_0x2ca1d8[_0x0f4f('0x20')]['where']||null:null})[_0x0f4f('0x12')](function(_0x5382f3){if(_0x5382f3){return _0x5382f3[_0x0f4f('0x25')](_0x2ca1d8[_0x0f4f('0x1f')]['ids'],_[_0x0f4f('0x26')](_0x2ca1d8[_0x0f4f('0x1f')],[_0x0f4f('0x27'),'id'])||{});}})[_0x0f4f('0x28')](function(_0x3803a7){logger[_0x0f4f('0x13')]('AddTags',_0x2ca1d8);logger[_0x0f4f('0x16')](_0x0f4f('0x29'),_0x2ca1d8,JSON[_0x0f4f('0x17')](_0x3803a7));_0x2c4bea(_0x3803a7);})[_0x0f4f('0x1b')](function(_0x2d345d){logger[_0x0f4f('0x18')](_0x0f4f('0x29'),_0x2d345d['message'],_0x2ca1d8);_0x4ecf5b(_this['error'](0x1f4,_0x2d345d[_0x0f4f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2586fad..432af67 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 _0x31a3=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','register'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x31a3,0x174));var _0x331a=function(_0x9d201d,_0x208b82){_0x9d201d=_0x9d201d-0x0;var _0x11b768=_0x31a3[_0x9d201d];return _0x11b768;};'use strict';var ChatInteractionEvents=require(_0x331a('0x0'));var events=[_0x331a('0x1'),_0x331a('0x2'),_0x331a('0x3')];function createListener(_0x2ec307,_0x2368af){return function(_0x48d913){_0x2368af['emit'](_0x2ec307,_0x48d913);};}function removeListener(_0x4ee47d,_0x1d1e6f){return function(){ChatInteractionEvents[_0x331a('0x4')](_0x4ee47d,_0x1d1e6f);};}exports[_0x331a('0x5')]=function(_0x328b40){for(var _0x4e14e=0x0,_0x45aeb4=events['length'];_0x4e14e<_0x45aeb4;_0x4e14e++){var _0x521b04=events[_0x4e14e];var _0x31c14a=createListener(_0x331a('0x6')+_0x521b04,_0x328b40);ChatInteractionEvents['on'](_0x521b04,_0x31c14a);}}; \ No newline at end of file +var _0xff25=['emit','removeListener','register','length','chatInteraction:'];(function(_0x2711c1,_0x3adb93){var _0x13c95c=function(_0x1de9dd){while(--_0x1de9dd){_0x2711c1['push'](_0x2711c1['shift']());}};_0x13c95c(++_0x3adb93);}(_0xff25,0x190));var _0x5ff2=function(_0x4deff1,_0x5421fc){_0x4deff1=_0x4deff1-0x0;var _0x559271=_0xff25[_0x4deff1];return _0x559271;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove','update'];function createListener(_0x30837d,_0x29b239){return function(_0x11c5a1){_0x29b239[_0x5ff2('0x0')](_0x30837d,_0x11c5a1);};}function removeListener(_0x4b4205,_0x20d430){return function(){ChatInteractionEvents[_0x5ff2('0x1')](_0x4b4205,_0x20d430);};}exports[_0x5ff2('0x2')]=function(_0x9ba150){for(var _0x5b1bba=0x0,_0x532684=events[_0x5ff2('0x3')];_0x5b1bba<_0x532684;_0x5b1bba++){var _0x14744f=events[_0x5b1bba];var _0x31afeb=createListener(_0x5ff2('0x4')+_0x14744f,_0x9ba150);ChatInteractionEvents['on'](_0x14744f,_0x31afeb);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 586448e..ddd2345 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 _0xa69d=['chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','now','replace','single','/:id/messages','addMessage','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','/:id/abandon','abandon','/:id/close','close','delete'];(function(_0x5799bc,_0x4ce175){var _0x31c75c=function(_0x43da21){while(--_0x43da21){_0x5799bc['push'](_0x5799bc['shift']());}};_0x31c75c(++_0x4ce175);}(_0xa69d,0xfa));var _0xda69=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa69d[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xda69('0x0'));var util=require(_0xda69('0x1'));var path=require(_0xda69('0x2'));var timeout=require(_0xda69('0x3'));var express=require('express');var router=express[_0xda69('0x4')]();var fs_extra=require(_0xda69('0x5'));var auth=require(_0xda69('0x6'));var interaction=require(_0xda69('0x7'));var config=require(_0xda69('0x8'));var controller=require(_0xda69('0x9'));router[_0xda69('0xa')]('/',auth[_0xda69('0xb')](),controller[_0xda69('0xc')]);router[_0xda69('0xa')]('/describe',auth[_0xda69('0xb')](),controller[_0xda69('0xd')]);router[_0xda69('0xa')](_0xda69('0xe'),auth[_0xda69('0xf')](),controller['show']);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xda69('0x10')]);router[_0xda69('0xa')]('/:id/messages',auth[_0xda69('0xb')](),controller[_0xda69('0x11')]);router['get'](_0xda69('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xda69('0xa')](_0xda69('0x13'),auth[_0xda69('0xb')](),controller['download']);router[_0xda69('0x14')]('/',auth[_0xda69('0xb')](),controller[_0xda69('0x15')]);router[_0xda69('0x14')](_0xda69('0x16'),auth[_0xda69('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xda69('0x17')]({'destination':function(_0x4d9c10,_0x4eb5f3,_0x582ec6){_0x582ec6(null,path[_0xda69('0x18')](config['root'],_0xda69('0x19')));},'filename':function(_0x59bba2,_0x5897b9,_0x15dbc9){_0x15dbc9(null,util[_0xda69('0x1a')](_0xda69('0x1b'),Date[_0xda69('0x1c')](),_0x5897b9['originalname'][_0xda69('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xda69('0x14')]('/:id/attachment_upload',upload[_0xda69('0x1e')]('file'),controller['attachmentUpload']);router[_0xda69('0x14')](_0xda69('0x1f'),auth[_0xda69('0xf')](),controller[_0xda69('0x20')]);router[_0xda69('0x14')]('/:id/tags',auth[_0xda69('0xb')](),interaction['tracked'](_0xda69('0x21'),_0xda69('0x22')),controller[_0xda69('0x23')]);router[_0xda69('0x24')](_0xda69('0xe'),auth['isAuthenticated'](),interaction[_0xda69('0x25')](_0xda69('0x21'),_0xda69('0x26')),controller['update']);router[_0xda69('0x24')]('/:id/custom_update',controller['customUpdate']);router['put'](_0xda69('0x27'),auth[_0xda69('0xf')](),controller[_0xda69('0x28')]);router[_0xda69('0x24')](_0xda69('0x29'),controller[_0xda69('0x2a')]);router[_0xda69('0x2b')](_0xda69('0xe'),auth[_0xda69('0xb')](),interaction[_0xda69('0x25')](_0xda69('0x21'),_0xda69('0x2c')),controller[_0xda69('0x2d')]);router['delete'](_0xda69('0x2e'),auth[_0xda69('0xb')](),controller[_0xda69('0x2f')]);module[_0xda69('0x30')]=router; \ No newline at end of file +var _0x36bf=['put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x36bf,0xe3));var _0xf36b=function(_0xad78b9,_0xc0d56c){_0xad78b9=_0xad78b9-0x0;var _0x204e45=_0x36bf[_0xad78b9];return _0x204e45;};'use strict';var multer=require(_0xf36b('0x0'));var util=require(_0xf36b('0x1'));var path=require(_0xf36b('0x2'));var timeout=require(_0xf36b('0x3'));var express=require(_0xf36b('0x4'));var router=express[_0xf36b('0x5')]();var fs_extra=require(_0xf36b('0x6'));var auth=require(_0xf36b('0x7'));var interaction=require(_0xf36b('0x8'));var config=require('../../config/environment');var controller=require(_0xf36b('0x9'));router[_0xf36b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf36b('0xa')](_0xf36b('0xb'),auth[_0xf36b('0xc')](),controller[_0xf36b('0xd')]);router[_0xf36b('0xa')](_0xf36b('0xe'),auth[_0xf36b('0xf')](),controller[_0xf36b('0x10')]);router['get'](_0xf36b('0x11'),auth[_0xf36b('0xf')](),controller[_0xf36b('0x12')]);router[_0xf36b('0xa')](_0xf36b('0x13'),auth[_0xf36b('0xc')](),controller[_0xf36b('0x14')]);router['get'](_0xf36b('0x15'),auth[_0xf36b('0xf')](),controller[_0xf36b('0x16')]);router[_0xf36b('0xa')](_0xf36b('0x17'),auth['isAuthenticated'](),controller[_0xf36b('0x18')]);router[_0xf36b('0x19')]('/',auth['isAuthenticated'](),controller[_0xf36b('0x1a')]);router['post'](_0xf36b('0x1b'),auth[_0xf36b('0xc')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xf36b('0x1c')]({'destination':function(_0x32fe24,_0x45be82,_0x5a8317){_0x5a8317(null,path['join'](config[_0xf36b('0x1d')],_0xf36b('0x1e')));},'filename':function(_0x3c5a72,_0x1b37ff,_0x5d975d){_0x5d975d(null,util[_0xf36b('0x1f')](_0xf36b('0x20'),Date[_0xf36b('0x21')](),_0x1b37ff[_0xf36b('0x22')][_0xf36b('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single']('file'),controller[_0xf36b('0x24')]);router[_0xf36b('0x19')](_0xf36b('0x13'),auth[_0xf36b('0xf')](),controller['addMessage']);router['post'](_0xf36b('0x25'),auth['isAuthenticated'](),interaction[_0xf36b('0x26')](_0xf36b('0x27'),_0xf36b('0x28')),controller[_0xf36b('0x29')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xf36b('0x27'),_0xf36b('0x2a')),controller['update']);router[_0xf36b('0x2b')]('/:id/custom_update',controller[_0xf36b('0x2c')]);router[_0xf36b('0x2b')](_0xf36b('0x2d'),auth[_0xf36b('0xf')](),controller[_0xf36b('0x2e')]);router[_0xf36b('0x2b')](_0xf36b('0x2f'),controller[_0xf36b('0x30')]);router[_0xf36b('0x31')](_0xf36b('0xe'),auth[_0xf36b('0xc')](),interaction[_0xf36b('0x26')](_0xf36b('0x27'),_0xf36b('0x32')),controller[_0xf36b('0x33')]);router[_0xf36b('0x31')](_0xf36b('0x25'),auth[_0xf36b('0xc')](),controller[_0xf36b('0x34')]);module[_0xf36b('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index bc1f677..c758692 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 _0xbf68=['sequelize','BOOLEAN','INTEGER'];(function(_0x2228f8,_0x1884c0){var _0x2682bd=function(_0x7846b0){while(--_0x7846b0){_0x2228f8['push'](_0x2228f8['shift']());}};_0x2682bd(++_0x1884c0);}(_0xbf68,0x1b3));var _0x8bf6=function(_0x3b30d6,_0xf98295){_0x3b30d6=_0x3b30d6-0x0;var _0x1ecef4=_0xbf68[_0x3b30d6];return _0x1ecef4;};'use strict';var Sequelize=require(_0x8bf6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8bf6('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8bf6('0x2')]}}; \ No newline at end of file +var _0xbfcd=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0xbfcd,0xd9));var _0xdbfc=function(_0x3a6a83,_0x23838a){_0x3a6a83=_0x3a6a83-0x0;var _0x34df0b=_0xbfcd[_0x3a6a83];return _0x34df0b;};'use strict';var Sequelize=require(_0xdbfc('0x0'));module[_0xdbfc('0x1')]={'body':{'type':Sequelize[_0xdbfc('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdbfc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdbfc('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0b5de68..f24a4c2 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 _0x0fab=['lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Agents','autoAssociation','isEmpty','role','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','catch','body','describe','get','messages'];(function(_0x962d46,_0x412a2c){var _0x396df3=function(_0x19afdd){while(--_0x19afdd){_0x962d46['push'](_0x962d46['shift']());}};_0x396df3(++_0x412a2c);}(_0x0fab,0xf6));var _0xb0fa=function(_0x2a3429,_0x23ba65){_0x2a3429=_0x2a3429-0x0;var _0x349565=_0x0fab[_0x2a3429];return _0x349565;};'use strict';var emlformat=require(_0xb0fa('0x0'));var rimraf=require(_0xb0fa('0x1'));var zipdir=require(_0xb0fa('0x2'));var jsonpatch=require(_0xb0fa('0x3'));var rp=require(_0xb0fa('0x4'));var moment=require(_0xb0fa('0x5'));var BPromise=require(_0xb0fa('0x6'));var Mustache=require(_0xb0fa('0x7'));var util=require(_0xb0fa('0x8'));var path=require(_0xb0fa('0x9'));var sox=require(_0xb0fa('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0fa('0xb'));var _=require(_0xb0fa('0xc'));var squel=require(_0xb0fa('0xd'));var crypto=require(_0xb0fa('0xe'));var jsforce=require(_0xb0fa('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb0fa('0x10'));var Papa=require(_0xb0fa('0x11'));var Redis=require(_0xb0fa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb0fa('0x13'));var as=require(_0xb0fa('0x14'));var hardwareService=require(_0xb0fa('0x15'));var logger=require('../../config/logger')(_0xb0fa('0x16'));var utils=require(_0xb0fa('0x17'));var config=require(_0xb0fa('0x18'));var licenseUtil=require(_0xb0fa('0x19'));var db=require(_0xb0fa('0x1a'))['db'];config[_0xb0fa('0x1b')]=_[_0xb0fa('0x1c')](config[_0xb0fa('0x1b')],{'host':_0xb0fa('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0fa('0x1b')]));require(_0xb0fa('0x1e'))['register'](socket);function respondWithStatusCode(_0x211afa,_0x492640){_0x492640=_0x492640||0xcc;return function(_0x3c2d90){if(_0x3c2d90){return _0x211afa['sendStatus'](_0x492640);}return _0x211afa[_0xb0fa('0x1f')](_0x492640)['end']();};}function respondWithResult(_0x48d8d9,_0x2eb98d){_0x2eb98d=_0x2eb98d||0xc8;return function(_0x24967f){if(_0x24967f){return _0x48d8d9[_0xb0fa('0x1f')](_0x2eb98d)[_0xb0fa('0x20')](_0x24967f);}};}function respondWithFilteredResult(_0x257df5,_0x1e2aec){return function(_0x2cf598){if(_0x2cf598){var _0x39db41=typeof _0x1e2aec['offset']==='undefined'&&typeof _0x1e2aec['limit']===_0xb0fa('0x21');var _0x333999=_0x2cf598['count'];var _0x56fc09=_0x39db41?0x0:_0x1e2aec['offset'];var _0x56c14f=_0x39db41?_0x2cf598[_0xb0fa('0x22')]:_0x1e2aec[_0xb0fa('0x23')]+_0x1e2aec[_0xb0fa('0x24')];var _0x2d8b69;if(_0x56c14f>=_0x333999){_0x56c14f=_0x333999;_0x2d8b69=0xc8;}else{_0x2d8b69=0xce;}_0x257df5[_0xb0fa('0x1f')](_0x2d8b69);return _0x257df5['set'](_0xb0fa('0x25'),_0x56fc09+'-'+_0x56c14f+'/'+_0x333999)[_0xb0fa('0x20')](_0x2cf598);}return null;};}function patchUpdates(_0x2526df){return function(_0x57c6b7){try{jsonpatch['apply'](_0x57c6b7,_0x2526df,!![]);}catch(_0x5358b7){return BPromise[_0xb0fa('0x26')](_0x5358b7);}return _0x57c6b7[_0xb0fa('0x27')]();};}function saveUpdates(_0x1ad152,_0x15a77c){return function(_0x32af11){if(_0x32af11){return _0x32af11[_0xb0fa('0x28')](_0x1ad152)['then'](function(_0xc8d6c){return _0xc8d6c;});}return null;};}function removeEntity(_0x5794c1,_0x32d3b4){return function(_0x3a8477){if(_0x3a8477){return _0x3a8477[_0xb0fa('0x29')]()[_0xb0fa('0x2a')](function(){_0x5794c1[_0xb0fa('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8dd8,_0x220739){return function(_0x1d9d1a){if(!_0x1d9d1a){_0x2f8dd8['sendStatus'](0x194);}return _0x1d9d1a;};}function handleError(_0x51eac0,_0x4680bc){_0x4680bc=_0x4680bc||0x1f4;return function(_0x1e6cf2){logger[_0xb0fa('0x2b')](_0x1e6cf2['stack']);if(_0x1e6cf2['name']){delete _0x1e6cf2[_0xb0fa('0x2c')];}_0x51eac0[_0xb0fa('0x1f')](_0x4680bc)[_0xb0fa('0x2d')](_0x1e6cf2);};}exports[_0xb0fa('0x2e')]=function(_0x23ed86,_0x1634d0){var _0x614d98={},_0x167a6d={},_0x5ef22={'count':0x0,'rows':[]};var _0x494adc=_[_0xb0fa('0x2f')](db[_0xb0fa('0x30')][_0xb0fa('0x31')],function(_0x22c582){return{'name':_0x22c582[_0xb0fa('0x32')],'type':_0x22c582['type'][_0xb0fa('0x33')]};});_0x167a6d['model']=_[_0xb0fa('0x2f')](_0x494adc,_0xb0fa('0x2c'));_0x167a6d[_0xb0fa('0x34')]=_['keys'](_0x23ed86[_0xb0fa('0x34')]);_0x167a6d[_0xb0fa('0x35')]=_[_0xb0fa('0x36')](_0x167a6d['model'],_0x167a6d[_0xb0fa('0x34')]);_0x614d98['attributes']=_[_0xb0fa('0x36')](_0x167a6d[_0xb0fa('0x37')],qs[_0xb0fa('0x38')](_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x38')]));_0x614d98[_0xb0fa('0x39')]=_0x614d98['attributes'][_0xb0fa('0x3a')]?_0x614d98[_0xb0fa('0x39')]:_0x167a6d[_0xb0fa('0x37')];if(!_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x3b')](_0xb0fa('0x3c'))){_0x614d98['limit']=qs[_0xb0fa('0x24')](_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x24')]);_0x614d98['offset']=qs['offset'](_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x23')]);}_0x614d98[_0xb0fa('0x3d')]=qs['sort'](_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x3e')]);_0x614d98['where']=qs[_0xb0fa('0x35')](_[_0xb0fa('0x3f')](_0x23ed86['query'],_0x167a6d[_0xb0fa('0x35')]),_0x494adc);if(_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x40')]){_0x614d98[_0xb0fa('0x41')]=_[_0xb0fa('0x42')](_0x614d98[_0xb0fa('0x41')],{'$or':_[_0xb0fa('0x2f')](_0x494adc,function(_0x22c644){if(_0x22c644[_0xb0fa('0x43')]!==_0xb0fa('0x44')){var _0x46cc73={};_0x46cc73[_0x22c644[_0xb0fa('0x2c')]]={'$like':'%'+_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x40')]+'%'};return _0x46cc73;}})});}_0x614d98=_[_0xb0fa('0x42')]({},_0x614d98,_0x23ed86[_0xb0fa('0x45')]);var _0x21a4c1={'where':_0x614d98[_0xb0fa('0x41')]};return db[_0xb0fa('0x30')]['count'](_0x21a4c1)['then'](function(_0x42003a){_0x5ef22['count']=_0x42003a;if(_0x23ed86[_0xb0fa('0x34')][_0xb0fa('0x46')]){_0x614d98[_0xb0fa('0x47')]=[{'all':!![]}];}return db[_0xb0fa('0x30')][_0xb0fa('0x48')](_0x614d98);})[_0xb0fa('0x2a')](function(_0x4cddbd){_0x5ef22[_0xb0fa('0x49')]=_0x4cddbd;return _0x5ef22;})[_0xb0fa('0x2a')](respondWithFilteredResult(_0x1634d0,_0x614d98))['catch'](handleError(_0x1634d0,null));};exports[_0xb0fa('0x4a')]=function(_0x57c36c,_0x6e1eb2){var _0x41d789={'raw':!![],'where':{'id':_0x57c36c[_0xb0fa('0x4b')]['id']}},_0x14bfde={};_0x14bfde[_0xb0fa('0x37')]=_[_0xb0fa('0x4c')](db[_0xb0fa('0x30')][_0xb0fa('0x31')]);_0x14bfde[_0xb0fa('0x34')]=_[_0xb0fa('0x4c')](_0x57c36c[_0xb0fa('0x34')]);_0x14bfde[_0xb0fa('0x35')]=_[_0xb0fa('0x36')](_0x14bfde[_0xb0fa('0x37')],_0x14bfde[_0xb0fa('0x34')]);_0x41d789[_0xb0fa('0x39')]=_[_0xb0fa('0x36')](_0x14bfde[_0xb0fa('0x37')],qs[_0xb0fa('0x38')](_0x57c36c[_0xb0fa('0x34')][_0xb0fa('0x38')]));_0x41d789[_0xb0fa('0x39')]=_0x41d789['attributes'][_0xb0fa('0x3a')]?_0x41d789[_0xb0fa('0x39')]:_0x14bfde[_0xb0fa('0x37')];if(_0x57c36c[_0xb0fa('0x34')]['includeAll']){_0x41d789[_0xb0fa('0x47')]=[{'all':!![]}];}_0x41d789=_[_0xb0fa('0x42')]({},_0x41d789,_0x57c36c['options']);return db[_0xb0fa('0x30')][_0xb0fa('0x4d')](_0x41d789)[_0xb0fa('0x2a')](handleEntityNotFound(_0x6e1eb2,null))[_0xb0fa('0x2a')](respondWithResult(_0x6e1eb2,null))['catch'](handleError(_0x6e1eb2,null));};exports[_0xb0fa('0x4e')]=function(_0x20e275,_0x12e0d7){return db[_0xb0fa('0x30')][_0xb0fa('0x4e')](_0x20e275['body'],{})[_0xb0fa('0x2a')](respondWithResult(_0x12e0d7,0xc9))[_0xb0fa('0x4f')](handleError(_0x12e0d7,null));};exports[_0xb0fa('0x28')]=function(_0x214f0e,_0x108ee5){if(_0x214f0e['body']['id']){delete _0x214f0e[_0xb0fa('0x50')]['id'];}return db[_0xb0fa('0x30')][_0xb0fa('0x4d')]({'where':{'id':_0x214f0e[_0xb0fa('0x4b')]['id']}})[_0xb0fa('0x2a')](handleEntityNotFound(_0x108ee5,null))['then'](saveUpdates(_0x214f0e[_0xb0fa('0x50')],null))['then'](respondWithResult(_0x108ee5,null))[_0xb0fa('0x4f')](handleError(_0x108ee5,null));};exports[_0xb0fa('0x29')]=function(_0x428f8a,_0x3c5e64){return db[_0xb0fa('0x30')][_0xb0fa('0x4d')]({'where':{'id':_0x428f8a[_0xb0fa('0x4b')]['id']}})[_0xb0fa('0x2a')](handleEntityNotFound(_0x3c5e64,null))[_0xb0fa('0x2a')](removeEntity(_0x3c5e64,null))['catch'](handleError(_0x3c5e64,null));};exports['describe']=function(_0x1f8a7c,_0xe01867){return db['ChatInternalMessage'][_0xb0fa('0x51')]()[_0xb0fa('0x2a')](respondWithResult(_0xe01867,null))['catch'](handleError(_0xe01867,null));};function wrapUser(_0x42bde4){return function(_0xfe1ca4){var _0x3ef186=_0x42bde4[_0xb0fa('0x52')]({'plain':!![]});_0x3ef186[_0xb0fa('0x53')]=[];if(_0xfe1ca4){_0x3ef186[_0xb0fa('0x54')]=_0xfe1ca4['createdAt'];_0x3ef186['lastMessage']=_0xfe1ca4;}else{_0x3ef186[_0xb0fa('0x54')]=moment(0x0)[_0xb0fa('0x55')](_0xb0fa('0x56'));_0x3ef186[_0xb0fa('0x57')]={};}return _0x3ef186;};}exports[_0xb0fa('0x58')]=function(_0xc70521,_0x278566,_0xe78cce){var _0x2c3f49=[];return db[_0xb0fa('0x59')][_0xb0fa('0x48')]({'where':{'role':[_0xb0fa('0x5a'),_0xb0fa('0x5b'),_0xb0fa('0x5c')]},'attributes':['id',_0xb0fa('0x5d'),_0xb0fa('0x2c'),'role','userpic',_0xb0fa('0x5e'),'online',_0xb0fa('0x5f'),_0xb0fa('0x60'),_0xb0fa('0x61')],'order':qs[_0xb0fa('0x3e')](_0xb0fa('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0xb0fa('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xb0fa('0x2a')](function(_0x20780a){if(_0x20780a){var _0x3f2d46=_0xc70521[_0xb0fa('0x5c')][_0xb0fa('0x52')]({'plain':!![]});if(!_0x3f2d46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f2d46['role']===_0xb0fa('0x5c')){return db['UserProfileSection'][_0xb0fa('0x4d')]({'where':{'name':_0xb0fa('0x64'),'userProfileId':_0x3f2d46['userProfileId']},'raw':!![]})[_0xb0fa('0x2a')](function(_0x1d0619){if(_0x1d0619){if(_0x1d0619[_0xb0fa('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1d0619['id']},'raw':!![]})[_0xb0fa('0x2a')](function(_0x3929a7){var _0x945b5a=[];if(_[_0xb0fa('0x66')](_0x3929a7)){_0x945b5a=_[_0xb0fa('0x40')](_0x20780a,function(_0x20005e){if(_0x20005e['role']!=='agent'){return _0x20005e;}});return _0x945b5a;}else{for(var _0x10b10b=0x0;_0x10b10b<_0x20780a[_0xb0fa('0x3a')];_0x10b10b++){var _0x4ec8ad=_0x20780a[_0x10b10b];if(_0x4ec8ad[_0xb0fa('0x67')]===_0xb0fa('0x5a')){var _0x573797=_[_0xb0fa('0x4d')](_0x3929a7,function(_0x683c68){return _0x683c68[_0xb0fa('0x68')]===_0x4ec8ad['id'];});if(_0x573797)_0x945b5a['push'](_0x4ec8ad);}else{_0x945b5a['push'](_0x4ec8ad);}}return _0x945b5a;}});}else{return _0x20780a;}}else{var _0x46a5a5=_[_0xb0fa('0x40')](_0x20780a,function(_0x30d62e){if(_0x30d62e[_0xb0fa('0x67')]!=='agent'){return _0x30d62e;}});return _0x46a5a5;}});}else{return _0x20780a;}}})[_0xb0fa('0x2a')](function(_0x4469f9){var _0x2bba5c=[];if(_0x4469f9){_0x2c3f49=_0x4469f9;for(var _0x5ccdf5=0x0;_0x5ccdf5<_0x4469f9['length'];_0x5ccdf5+=0x1){_0x2c3f49[_0x5ccdf5][_0xb0fa('0x53')]=[];_0x2bba5c[_0xb0fa('0x69')](db[_0xb0fa('0x30')]['find']({'where':{'FromId':[_0xc70521['user']['id'],_0x4469f9[_0x5ccdf5]['id']],'ToId':[_0xc70521['user']['id'],_0x4469f9[_0x5ccdf5]['id']],'ChatGroupId':null},'attributes':['id',_0xb0fa('0x6a'),'FromId','ToId',_0xb0fa('0x6b'),_0xb0fa('0x50')],'order':qs['sort'](_0xb0fa('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb0fa('0x2a')](wrapUser(_0x4469f9[_0x5ccdf5])));}return BPromise[_0xb0fa('0x6d')](_0x2bba5c);}return[];})[_0xb0fa('0x2a')](function(_0x52f6b6){return{'rows':_0x52f6b6,'count':_0x52f6b6['length']};})[_0xb0fa('0x2a')](respondWithResult(_0x278566,null))[_0xb0fa('0x4f')](handleError(_0x278566,null));}; \ No newline at end of file +var _0xf5c4=['lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','createdAt'];(function(_0x443fda,_0xb06d0a){var _0x58360d=function(_0xfb6e21){while(--_0xfb6e21){_0x443fda['push'](_0x443fda['shift']());}};_0x58360d(++_0xb06d0a);}(_0xf5c4,0x87));var _0x4f5c=function(_0x30bbdd,_0x4357ca){_0x30bbdd=_0x30bbdd-0x0;var _0x4a92d0=_0xf5c4[_0x30bbdd];return _0x4a92d0;};'use strict';var emlformat=require(_0x4f5c('0x0'));var rimraf=require(_0x4f5c('0x1'));var zipdir=require(_0x4f5c('0x2'));var jsonpatch=require(_0x4f5c('0x3'));var rp=require(_0x4f5c('0x4'));var moment=require(_0x4f5c('0x5'));var BPromise=require(_0x4f5c('0x6'));var Mustache=require(_0x4f5c('0x7'));var util=require('util');var path=require(_0x4f5c('0x8'));var sox=require(_0x4f5c('0x9'));var csv=require(_0x4f5c('0xa'));var ejs=require(_0x4f5c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4f5c('0xc'));var crypto=require(_0x4f5c('0xd'));var jsforce=require(_0x4f5c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4f5c('0xa'));var querystring=require('querystring');var Papa=require(_0x4f5c('0xf'));var Redis=require(_0x4f5c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f5c('0x11'));var as=require(_0x4f5c('0x12'));var hardwareService=require(_0x4f5c('0x13'));var logger=require(_0x4f5c('0x14'))('api');var utils=require(_0x4f5c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f5c('0x16'))['db'];config[_0x4f5c('0x17')]=_[_0x4f5c('0x18')](config[_0x4f5c('0x17')],{'host':_0x4f5c('0x19'),'port':0x18eb});var socket=require(_0x4f5c('0x1a'))(new Redis(config[_0x4f5c('0x17')]));require(_0x4f5c('0x1b'))['register'](socket);function respondWithStatusCode(_0xe08f4d,_0x1b00df){_0x1b00df=_0x1b00df||0xcc;return function(_0x4ce0bb){if(_0x4ce0bb){return _0xe08f4d['sendStatus'](_0x1b00df);}return _0xe08f4d[_0x4f5c('0x1c')](_0x1b00df)[_0x4f5c('0x1d')]();};}function respondWithResult(_0x347058,_0x4276db){_0x4276db=_0x4276db||0xc8;return function(_0x568407){if(_0x568407){return _0x347058['status'](_0x4276db)[_0x4f5c('0x1e')](_0x568407);}};}function respondWithFilteredResult(_0x190c20,_0x5700c2){return function(_0x230090){if(_0x230090){var _0x4a2f1a=typeof _0x5700c2[_0x4f5c('0x1f')]===_0x4f5c('0x20')&&typeof _0x5700c2[_0x4f5c('0x21')]==='undefined';var _0x3c5dd7=_0x230090[_0x4f5c('0x22')];var _0x514678=_0x4a2f1a?0x0:_0x5700c2[_0x4f5c('0x1f')];var _0x4ebb1=_0x4a2f1a?_0x230090[_0x4f5c('0x22')]:_0x5700c2[_0x4f5c('0x1f')]+_0x5700c2[_0x4f5c('0x21')];var _0x11db9f;if(_0x4ebb1>=_0x3c5dd7){_0x4ebb1=_0x3c5dd7;_0x11db9f=0xc8;}else{_0x11db9f=0xce;}_0x190c20[_0x4f5c('0x1c')](_0x11db9f);return _0x190c20[_0x4f5c('0x23')](_0x4f5c('0x24'),_0x514678+'-'+_0x4ebb1+'/'+_0x3c5dd7)[_0x4f5c('0x1e')](_0x230090);}return null;};}function patchUpdates(_0x4341ce){return function(_0x37b10f){try{jsonpatch['apply'](_0x37b10f,_0x4341ce,!![]);}catch(_0x3d74bf){return BPromise[_0x4f5c('0x25')](_0x3d74bf);}return _0x37b10f[_0x4f5c('0x26')]();};}function saveUpdates(_0x2bbca2,_0x3e1d26){return function(_0x2c5549){if(_0x2c5549){return _0x2c5549[_0x4f5c('0x27')](_0x2bbca2)[_0x4f5c('0x28')](function(_0x5b6e46){return _0x5b6e46;});}return null;};}function removeEntity(_0x2c5832,_0x42d22b){return function(_0xa5acf4){if(_0xa5acf4){return _0xa5acf4[_0x4f5c('0x29')]()[_0x4f5c('0x28')](function(){_0x2c5832[_0x4f5c('0x1c')](0xcc)[_0x4f5c('0x1d')]();});}};}function handleEntityNotFound(_0xe6ecaa,_0x35b3be){return function(_0xd1bbf5){if(!_0xd1bbf5){_0xe6ecaa[_0x4f5c('0x2a')](0x194);}return _0xd1bbf5;};}function handleError(_0x92af33,_0x1f0f21){_0x1f0f21=_0x1f0f21||0x1f4;return function(_0x1929a4){logger[_0x4f5c('0x2b')](_0x1929a4[_0x4f5c('0x2c')]);if(_0x1929a4[_0x4f5c('0x2d')]){delete _0x1929a4['name'];}_0x92af33[_0x4f5c('0x1c')](_0x1f0f21)[_0x4f5c('0x2e')](_0x1929a4);};}exports[_0x4f5c('0x2f')]=function(_0x3e5f44,_0x3640ca){var _0x1e6d71={},_0x52001b={},_0x312f92={'count':0x0,'rows':[]};var _0x14cb4c=_[_0x4f5c('0x30')](db[_0x4f5c('0x31')][_0x4f5c('0x32')],function(_0x11f12b){return{'name':_0x11f12b[_0x4f5c('0x33')],'type':_0x11f12b['type']['key']};});_0x52001b[_0x4f5c('0x34')]=_[_0x4f5c('0x30')](_0x14cb4c,_0x4f5c('0x2d'));_0x52001b[_0x4f5c('0x35')]=_[_0x4f5c('0x36')](_0x3e5f44['query']);_0x52001b[_0x4f5c('0x37')]=_[_0x4f5c('0x38')](_0x52001b[_0x4f5c('0x34')],_0x52001b[_0x4f5c('0x35')]);_0x1e6d71[_0x4f5c('0x39')]=_[_0x4f5c('0x38')](_0x52001b[_0x4f5c('0x34')],qs[_0x4f5c('0x3a')](_0x3e5f44[_0x4f5c('0x35')][_0x4f5c('0x3a')]));_0x1e6d71[_0x4f5c('0x39')]=_0x1e6d71[_0x4f5c('0x39')][_0x4f5c('0x3b')]?_0x1e6d71[_0x4f5c('0x39')]:_0x52001b[_0x4f5c('0x34')];if(!_0x3e5f44[_0x4f5c('0x35')]['hasOwnProperty']('nolimit')){_0x1e6d71[_0x4f5c('0x21')]=qs[_0x4f5c('0x21')](_0x3e5f44[_0x4f5c('0x35')]['limit']);_0x1e6d71[_0x4f5c('0x1f')]=qs['offset'](_0x3e5f44[_0x4f5c('0x35')]['offset']);}_0x1e6d71['order']=qs['sort'](_0x3e5f44['query'][_0x4f5c('0x3c')]);_0x1e6d71[_0x4f5c('0x3d')]=qs[_0x4f5c('0x37')](_[_0x4f5c('0x3e')](_0x3e5f44[_0x4f5c('0x35')],_0x52001b[_0x4f5c('0x37')]),_0x14cb4c);if(_0x3e5f44[_0x4f5c('0x35')]['filter']){_0x1e6d71[_0x4f5c('0x3d')]=_['merge'](_0x1e6d71[_0x4f5c('0x3d')],{'$or':_['map'](_0x14cb4c,function(_0x32ee7a){if(_0x32ee7a[_0x4f5c('0x3f')]!==_0x4f5c('0x40')){var _0x66be02={};_0x66be02[_0x32ee7a['name']]={'$like':'%'+_0x3e5f44[_0x4f5c('0x35')][_0x4f5c('0x41')]+'%'};return _0x66be02;}})});}_0x1e6d71=_['merge']({},_0x1e6d71,_0x3e5f44[_0x4f5c('0x42')]);var _0x4eb519={'where':_0x1e6d71['where']};return db[_0x4f5c('0x31')][_0x4f5c('0x22')](_0x4eb519)['then'](function(_0x1f8edf){_0x312f92['count']=_0x1f8edf;if(_0x3e5f44['query'][_0x4f5c('0x43')]){_0x1e6d71[_0x4f5c('0x44')]=[{'all':!![]}];}return db[_0x4f5c('0x31')][_0x4f5c('0x45')](_0x1e6d71);})[_0x4f5c('0x28')](function(_0x5aa944){_0x312f92[_0x4f5c('0x46')]=_0x5aa944;return _0x312f92;})['then'](respondWithFilteredResult(_0x3640ca,_0x1e6d71))[_0x4f5c('0x47')](handleError(_0x3640ca,null));};exports[_0x4f5c('0x48')]=function(_0x3f4eb1,_0x9c4b4e){var _0x21f9ff={'raw':!![],'where':{'id':_0x3f4eb1['params']['id']}},_0x14f1df={};_0x14f1df[_0x4f5c('0x34')]=_[_0x4f5c('0x36')](db['ChatInternalMessage'][_0x4f5c('0x32')]);_0x14f1df[_0x4f5c('0x35')]=_[_0x4f5c('0x36')](_0x3f4eb1[_0x4f5c('0x35')]);_0x14f1df['filters']=_['intersection'](_0x14f1df['model'],_0x14f1df[_0x4f5c('0x35')]);_0x21f9ff[_0x4f5c('0x39')]=_['intersection'](_0x14f1df[_0x4f5c('0x34')],qs[_0x4f5c('0x3a')](_0x3f4eb1[_0x4f5c('0x35')][_0x4f5c('0x3a')]));_0x21f9ff[_0x4f5c('0x39')]=_0x21f9ff[_0x4f5c('0x39')][_0x4f5c('0x3b')]?_0x21f9ff[_0x4f5c('0x39')]:_0x14f1df[_0x4f5c('0x34')];if(_0x3f4eb1[_0x4f5c('0x35')][_0x4f5c('0x43')]){_0x21f9ff[_0x4f5c('0x44')]=[{'all':!![]}];}_0x21f9ff=_['merge']({},_0x21f9ff,_0x3f4eb1['options']);return db[_0x4f5c('0x31')][_0x4f5c('0x49')](_0x21f9ff)[_0x4f5c('0x28')](handleEntityNotFound(_0x9c4b4e,null))['then'](respondWithResult(_0x9c4b4e,null))[_0x4f5c('0x47')](handleError(_0x9c4b4e,null));};exports[_0x4f5c('0x4a')]=function(_0x631757,_0x5b9d45){return db[_0x4f5c('0x31')][_0x4f5c('0x4a')](_0x631757[_0x4f5c('0x4b')],{})[_0x4f5c('0x28')](respondWithResult(_0x5b9d45,0xc9))['catch'](handleError(_0x5b9d45,null));};exports[_0x4f5c('0x27')]=function(_0x1d0356,_0x541f00){if(_0x1d0356['body']['id']){delete _0x1d0356['body']['id'];}return db[_0x4f5c('0x31')]['find']({'where':{'id':_0x1d0356[_0x4f5c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x541f00,null))[_0x4f5c('0x28')](saveUpdates(_0x1d0356[_0x4f5c('0x4b')],null))['then'](respondWithResult(_0x541f00,null))[_0x4f5c('0x47')](handleError(_0x541f00,null));};exports[_0x4f5c('0x29')]=function(_0x325b51,_0x21f161){return db[_0x4f5c('0x31')][_0x4f5c('0x49')]({'where':{'id':_0x325b51[_0x4f5c('0x4c')]['id']}})[_0x4f5c('0x28')](handleEntityNotFound(_0x21f161,null))[_0x4f5c('0x28')](removeEntity(_0x21f161,null))['catch'](handleError(_0x21f161,null));};exports[_0x4f5c('0x4d')]=function(_0x453f35,_0x46234a){return db[_0x4f5c('0x31')][_0x4f5c('0x4d')]()['then'](respondWithResult(_0x46234a,null))[_0x4f5c('0x47')](handleError(_0x46234a,null));};function wrapUser(_0x429041){return function(_0x36d819){var _0x571ef8=_0x429041[_0x4f5c('0x4e')]({'plain':!![]});_0x571ef8[_0x4f5c('0x4f')]=[];if(_0x36d819){_0x571ef8['lastMessageAt']=_0x36d819[_0x4f5c('0x50')];_0x571ef8[_0x4f5c('0x51')]=_0x36d819;}else{_0x571ef8[_0x4f5c('0x52')]=moment(0x0)[_0x4f5c('0x53')](_0x4f5c('0x54'));_0x571ef8[_0x4f5c('0x51')]={};}return _0x571ef8;};}exports[_0x4f5c('0x55')]=function(_0x51b5bd,_0x36b768,_0x1468af){var _0xb99086=[];return db[_0x4f5c('0x56')]['findAll']({'where':{'role':['agent',_0x4f5c('0x57'),_0x4f5c('0x58')]},'attributes':['id',_0x4f5c('0x59'),_0x4f5c('0x2d'),_0x4f5c('0x5a'),_0x4f5c('0x5b'),_0x4f5c('0x5c'),_0x4f5c('0x5d'),_0x4f5c('0x5e'),_0x4f5c('0x5f'),'showWebBar'],'order':qs[_0x4f5c('0x3c')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x4f5c('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x4f5c('0x28')](function(_0x2b89ca){if(_0x2b89ca){var _0x417d63=_0x51b5bd[_0x4f5c('0x58')][_0x4f5c('0x4e')]({'plain':!![]});if(!_0x417d63)throw new Error(_0x4f5c('0x60'));if(_0x417d63[_0x4f5c('0x5a')]===_0x4f5c('0x58')){return db['UserProfileSection'][_0x4f5c('0x49')]({'where':{'name':'Agents','userProfileId':_0x417d63[_0x4f5c('0x61')]},'raw':!![]})[_0x4f5c('0x28')](function(_0x3e05dc){if(_0x3e05dc){if(_0x3e05dc[_0x4f5c('0x62')]===0x0){return db[_0x4f5c('0x63')][_0x4f5c('0x45')]({'where':{'sectionId':_0x3e05dc['id']},'raw':!![]})[_0x4f5c('0x28')](function(_0x20ab12){var _0x24e057=[];if(_['isEmpty'](_0x20ab12)){_0x24e057=_[_0x4f5c('0x41')](_0x2b89ca,function(_0x56d97d){if(_0x56d97d[_0x4f5c('0x5a')]!==_0x4f5c('0x64')){return _0x56d97d;}});return _0x24e057;}else{for(var _0x1bcd4a=0x0;_0x1bcd4a<_0x2b89ca[_0x4f5c('0x3b')];_0x1bcd4a++){var _0x83d705=_0x2b89ca[_0x1bcd4a];if(_0x83d705['role']==='agent'){var _0x1f1303=_[_0x4f5c('0x49')](_0x20ab12,function(_0x614e44){return _0x614e44[_0x4f5c('0x65')]===_0x83d705['id'];});if(_0x1f1303)_0x24e057[_0x4f5c('0x66')](_0x83d705);}else{_0x24e057[_0x4f5c('0x66')](_0x83d705);}}return _0x24e057;}});}else{return _0x2b89ca;}}else{var _0x289585=_[_0x4f5c('0x41')](_0x2b89ca,function(_0x3fde13){if(_0x3fde13['role']!==_0x4f5c('0x64')){return _0x3fde13;}});return _0x289585;}});}else{return _0x2b89ca;}}})[_0x4f5c('0x28')](function(_0x18c4de){var _0x2fb489=[];if(_0x18c4de){_0xb99086=_0x18c4de;for(var _0x3ef461=0x0;_0x3ef461<_0x18c4de['length'];_0x3ef461+=0x1){_0xb99086[_0x3ef461][_0x4f5c('0x4f')]=[];_0x2fb489[_0x4f5c('0x66')](db['ChatInternalMessage'][_0x4f5c('0x49')]({'where':{'FromId':[_0x51b5bd['user']['id'],_0x18c4de[_0x3ef461]['id']],'ToId':[_0x51b5bd['user']['id'],_0x18c4de[_0x3ef461]['id']],'ChatGroupId':null},'attributes':['id',_0x4f5c('0x50'),_0x4f5c('0x67'),_0x4f5c('0x68'),_0x4f5c('0x69'),_0x4f5c('0x4b')],'order':qs[_0x4f5c('0x3c')](_0x4f5c('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4f5c('0x28')](wrapUser(_0x18c4de[_0x3ef461])));}return BPromise[_0x4f5c('0x6b')](_0x2fb489);}return[];})[_0x4f5c('0x28')](function(_0x5abd4e){return{'rows':_0x5abd4e,'count':_0x5abd4e[_0x4f5c('0x3b')]};})[_0x4f5c('0x28')](respondWithResult(_0x36b768,null))['catch'](handleError(_0x36b768,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 601ebe9..127644c 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 _0xbed6=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbed6,0x146));var _0x6bed=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xbed6[_0x5608a3];return _0x1ed50a;};'use strict';var EventEmitter=require(_0x6bed('0x0'));var ChatInternalMessage=require(_0x6bed('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6bed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bed('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21f2c3){return function(_0x2a79ec,_0x3bf377,_0x55e177){ChatInternalMessageEvents['emit'](_0x21f2c3+':'+_0x2a79ec['id'],_0x2a79ec);ChatInternalMessageEvents[_0x6bed('0x4')](_0x21f2c3,_0x2a79ec);_0x55e177(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x6bed('0x5')](e,emitEvent(event));}}module[_0x6bed('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xdca3=['setMaxListeners','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdca3,0x13d));var _0x3dca=function(_0x72c000,_0x415424){_0x72c000=_0x72c000-0x0;var _0x382f17=_0xdca3[_0x72c000];return _0x382f17;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3dca('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3dca('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3dca('0x2')};function emitEvent(_0x242242){return function(_0x248c22,_0x412297,_0x48ab04){ChatInternalMessageEvents[_0x3dca('0x3')](_0x242242+':'+_0x248c22['id'],_0x248c22);ChatInternalMessageEvents['emit'](_0x242242,_0x248c22);_0x48ab04(null);};}for(var e in events){if(events[_0x3dca('0x4')](e)){var event=events[e];ChatInternalMessage[_0x3dca('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 6916a73..227b0e0 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 _0xcb37=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0xcb37,0x1cc));var _0x7cb3=function(_0x5a3164,_0x5b454b){_0x5a3164=_0x5a3164-0x0;var _0x427786=_0xcb37[_0x5a3164];return _0x427786;};'use strict';var _=require('lodash');var util=require(_0x7cb3('0x0'));var logger=require(_0x7cb3('0x1'))(_0x7cb3('0x2'));var moment=require(_0x7cb3('0x3'));var BPromise=require(_0x7cb3('0x4'));var rp=require(_0x7cb3('0x5'));var fs=require('fs');var path=require(_0x7cb3('0x6'));var rimraf=require(_0x7cb3('0x7'));var config=require(_0x7cb3('0x8'));var attributes=require(_0x7cb3('0x9'));module[_0x7cb3('0xa')]=function(_0x57f229,_0x2bb4cb){return _0x57f229[_0x7cb3('0xb')](_0x7cb3('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7cb3('0xd'),'collate':_0x7cb3('0xe')});}; \ No newline at end of file +var _0xb29c=['exports','define','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x5153e9,_0x1e5062){var _0x3a2a85=function(_0x2e7644){while(--_0x2e7644){_0x5153e9['push'](_0x5153e9['shift']());}};_0x3a2a85(++_0x1e5062);}(_0xb29c,0x197));var _0xcb29=function(_0xef3c80,_0x36164f){_0xef3c80=_0xef3c80-0x0;var _0x27f054=_0xb29c[_0xef3c80];return _0x27f054;};'use strict';var _=require(_0xcb29('0x0'));var util=require('util');var logger=require(_0xcb29('0x1'))(_0xcb29('0x2'));var moment=require(_0xcb29('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb29('0x4'));var fs=require('fs');var path=require(_0xcb29('0x5'));var rimraf=require(_0xcb29('0x6'));var config=require(_0xcb29('0x7'));var attributes=require(_0xcb29('0x8'));module[_0xcb29('0x9')]=function(_0x42e472,_0x45f695){return _0x42e472[_0xcb29('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xcb29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb29('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 003430c..8ec0a77 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 _0x5cad=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x480e16,_0x48b190){var _0x3e75f3=function(_0x3758f8){while(--_0x3758f8){_0x480e16['push'](_0x480e16['shift']());}};_0x3e75f3(++_0x48b190);}(_0x5cad,0x8c));var _0xd5ca=function(_0x2afb28,_0x19e8b0){_0x2afb28=_0x2afb28-0x0;var _0x41d764=_0x5cad[_0x2afb28];return _0x41d764;};'use strict';var _=require(_0xd5ca('0x0'));var util=require(_0xd5ca('0x1'));var moment=require(_0xd5ca('0x2'));var BPromise=require(_0xd5ca('0x3'));var rs=require(_0xd5ca('0x4'));var fs=require('fs');var Redis=require(_0xd5ca('0x5'));var db=require(_0xd5ca('0x6'))['db'];var utils=require(_0xd5ca('0x7'));var logger=require(_0xd5ca('0x8'))(_0xd5ca('0x9'));var config=require(_0xd5ca('0xa'));var jayson=require(_0xd5ca('0xb'));var client=jayson[_0xd5ca('0xc')][_0xd5ca('0xd')]({'port':0x232a});config[_0xd5ca('0xe')]=_[_0xd5ca('0xf')](config[_0xd5ca('0xe')],{'host':_0xd5ca('0x10'),'port':0x18eb});var socket=require(_0xd5ca('0x11'))(new Redis(config[_0xd5ca('0xe')]));require(_0xd5ca('0x12'))['register'](socket);function respondWithRpcPromise(_0x29a55c,_0x5a3ae4,_0x1fbc1f){return new BPromise(function(_0x5c8a51,_0x3fcef8){return client['request'](_0x29a55c,_0x1fbc1f)[_0xd5ca('0x13')](function(_0x2bcd25){logger[_0xd5ca('0x14')](_0xd5ca('0x15'),_0x5a3ae4,_0xd5ca('0x16'));logger[_0xd5ca('0x17')](_0xd5ca('0x18'),_0x5a3ae4,'request\x20sent',JSON[_0xd5ca('0x19')](_0x2bcd25));if(_0x2bcd25[_0xd5ca('0x1a')]){if(_0x2bcd25[_0xd5ca('0x1a')][_0xd5ca('0x1b')]===0x1f4){logger['error'](_0xd5ca('0x15'),_0x5a3ae4,_0x2bcd25[_0xd5ca('0x1a')][_0xd5ca('0x1c')]);return _0x3fcef8(_0x2bcd25[_0xd5ca('0x1a')][_0xd5ca('0x1c')]);}logger[_0xd5ca('0x1a')](_0xd5ca('0x15'),_0x5a3ae4,_0x2bcd25[_0xd5ca('0x1a')]['message']);return _0x5c8a51(_0x2bcd25[_0xd5ca('0x1a')][_0xd5ca('0x1c')]);}else{logger['info'](_0xd5ca('0x15'),_0x5a3ae4,_0xd5ca('0x16'));_0x5c8a51(_0x2bcd25[_0xd5ca('0x1d')][_0xd5ca('0x1c')]);}})[_0xd5ca('0x1e')](function(_0x191b39){logger[_0xd5ca('0x1a')](_0xd5ca('0x15'),_0x5a3ae4,_0x191b39);_0x3fcef8(_0x191b39);});});} \ No newline at end of file +var _0x4502=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','debug'];(function(_0xcf6231,_0x23ab9f){var _0x3d3e43=function(_0x320499){while(--_0x320499){_0xcf6231['push'](_0xcf6231['shift']());}};_0x3d3e43(++_0x23ab9f);}(_0x4502,0x157));var _0x2450=function(_0x64a23d,_0x574253){_0x64a23d=_0x64a23d-0x0;var _0x499ac0=_0x4502[_0x64a23d];return _0x499ac0;};'use strict';var _=require(_0x2450('0x0'));var util=require('util');var moment=require(_0x2450('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2450('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2450('0x3'));var logger=require(_0x2450('0x4'))(_0x2450('0x5'));var config=require(_0x2450('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2450('0x7')]=_[_0x2450('0x8')](config['redis'],{'host':_0x2450('0x9'),'port':0x18eb});var socket=require(_0x2450('0xa'))(new Redis(config[_0x2450('0x7')]));require(_0x2450('0xb'))[_0x2450('0xc')](socket);function respondWithRpcPromise(_0x132cb,_0x4eef76,_0x8d3da0){return new BPromise(function(_0x12da53,_0x5df599){return client['request'](_0x132cb,_0x8d3da0)[_0x2450('0xd')](function(_0x1a6bcb){logger[_0x2450('0xe')](_0x2450('0xf'),_0x4eef76,'request\x20sent');logger[_0x2450('0x10')](_0x2450('0x11'),_0x4eef76,_0x2450('0x12'),JSON[_0x2450('0x13')](_0x1a6bcb));if(_0x1a6bcb[_0x2450('0x14')]){if(_0x1a6bcb[_0x2450('0x14')][_0x2450('0x15')]===0x1f4){logger[_0x2450('0x14')](_0x2450('0xf'),_0x4eef76,_0x1a6bcb[_0x2450('0x14')][_0x2450('0x16')]);return _0x5df599(_0x1a6bcb[_0x2450('0x14')]['message']);}logger[_0x2450('0x14')](_0x2450('0xf'),_0x4eef76,_0x1a6bcb[_0x2450('0x14')]['message']);return _0x12da53(_0x1a6bcb['error'][_0x2450('0x16')]);}else{logger[_0x2450('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x4eef76,_0x2450('0x12'));_0x12da53(_0x1a6bcb['result'][_0x2450('0x16')]);}})[_0x2450('0x17')](function(_0x48b2e5){logger[_0x2450('0x14')](_0x2450('0xf'),_0x4eef76,_0x48b2e5);_0x5df599(_0x48b2e5);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7a4cafa..f797a04 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 _0x686d=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x26733b,_0x51c149){var _0x48ca4b=function(_0x388c68){while(--_0x388c68){_0x26733b['push'](_0x26733b['shift']());}};_0x48ca4b(++_0x51c149);}(_0x686d,0xd0));var _0xd686=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x686d[_0x4c80d7];return _0x3c5095;};'use strict';var ChatInternalMessageEvents=require(_0xd686('0x0'));var events=['save',_0xd686('0x1'),_0xd686('0x2')];function createListener(_0x253890,_0x169554){return function(_0x75b79c){_0x169554[_0xd686('0x3')](_0x253890,_0x75b79c);};}function removeListener(_0x1c65aa,_0x518a9b){return function(){ChatInternalMessageEvents[_0xd686('0x4')](_0x1c65aa,_0x518a9b);};}exports[_0xd686('0x5')]=function(_0xdf0017){for(var _0x950775=0x0,_0xefd988=events[_0xd686('0x6')];_0x950775<_0xefd988;_0x950775++){var _0x2151fb=events[_0x950775];var _0x501ed5=createListener(_0xd686('0x7')+_0x2151fb,_0xdf0017);ChatInternalMessageEvents['on'](_0x2151fb,_0x501ed5);}}; \ No newline at end of file +var _0xcef3=['save','remove','update','removeListener','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcef3,0x125));var _0x3cef=function(_0x149013,_0x268258){_0x149013=_0x149013-0x0;var _0x502195=_0xcef3[_0x149013];return _0x502195;};'use strict';var ChatInternalMessageEvents=require(_0x3cef('0x0'));var events=[_0x3cef('0x1'),_0x3cef('0x2'),_0x3cef('0x3')];function createListener(_0x5363ac,_0x54ae1d){return function(_0x48bbe5){_0x54ae1d['emit'](_0x5363ac,_0x48bbe5);};}function removeListener(_0x59c6dc,_0x4bc044){return function(){ChatInternalMessageEvents[_0x3cef('0x4')](_0x59c6dc,_0x4bc044);};}exports['register']=function(_0x49e6e5){for(var _0x5d788c=0x0,_0x3f7a28=events[_0x3cef('0x5')];_0x5d788c<_0x3f7a28;_0x5d788c++){var _0x32c2f2=events[_0x5d788c];var _0xbaa1af=createListener(_0x3cef('0x6')+_0x32c2f2,_0x49e6e5);ChatInternalMessageEvents['on'](_0x32c2f2,_0xbaa1af);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index ea8da86..38925ca 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 _0x3543=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','index','/describe','describe','/users','isAuthenticated','getUsers','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x3543,0x1d9));var _0x3354=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x3543[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x3354('0x0'));var util=require(_0x3354('0x1'));var path=require(_0x3354('0x2'));var timeout=require(_0x3354('0x3'));var express=require(_0x3354('0x4'));var router=express[_0x3354('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3354('0x6'));var interaction=require(_0x3354('0x7'));var config=require('../../config/environment');var controller=require(_0x3354('0x8'));router[_0x3354('0x9')]('/',auth['isAuthenticated'](),controller[_0x3354('0xa')]);router[_0x3354('0x9')](_0x3354('0xb'),auth['isAuthenticated'](),controller[_0x3354('0xc')]);router[_0x3354('0x9')](_0x3354('0xd'),auth[_0x3354('0xe')](),controller[_0x3354('0xf')]);router[_0x3354('0x9')]('/:id',auth[_0x3354('0xe')](),controller[_0x3354('0x10')]);router[_0x3354('0x11')]('/',auth['isAuthenticated'](),controller[_0x3354('0x12')]);router[_0x3354('0x13')]('/:id',controller[_0x3354('0x14')]);router[_0x3354('0x15')](_0x3354('0x16'),auth[_0x3354('0xe')](),controller[_0x3354('0x17')]);module[_0x3354('0x18')]=router; \ No newline at end of file +var _0x9422=['./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24bae3,_0x52ebb4){var _0x1872d2=function(_0xacccda){while(--_0xacccda){_0x24bae3['push'](_0x24bae3['shift']());}};_0x1872d2(++_0x52ebb4);}(_0x9422,0x151));var _0x2942=function(_0xdc3a32,_0x383166){_0xdc3a32=_0xdc3a32-0x0;var _0x370e71=_0x9422[_0xdc3a32];return _0x370e71;};'use strict';var multer=require(_0x2942('0x0'));var util=require(_0x2942('0x1'));var path=require('path');var timeout=require(_0x2942('0x2'));var express=require('express');var router=express[_0x2942('0x3')]();var fs_extra=require(_0x2942('0x4'));var auth=require(_0x2942('0x5'));var interaction=require(_0x2942('0x6'));var config=require(_0x2942('0x7'));var controller=require(_0x2942('0x8'));router[_0x2942('0x9')]('/',auth['isAuthenticated'](),controller[_0x2942('0xa')]);router[_0x2942('0x9')](_0x2942('0xb'),auth[_0x2942('0xc')](),controller[_0x2942('0xd')]);router[_0x2942('0x9')](_0x2942('0xe'),auth[_0x2942('0xc')](),controller[_0x2942('0xf')]);router[_0x2942('0x9')](_0x2942('0x10'),auth[_0x2942('0xc')](),controller[_0x2942('0x11')]);router['post']('/',auth[_0x2942('0xc')](),controller[_0x2942('0x12')]);router['put'](_0x2942('0x10'),controller[_0x2942('0x13')]);router[_0x2942('0x14')](_0x2942('0x10'),auth[_0x2942('0xc')](),controller[_0x2942('0x15')]);module[_0x2942('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d2dc6ea..27d17d1 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 _0xe1e3=['DATE','STRING','TEXT','sequelize','exports','medium','ENUM','out'];(function(_0x4fdfd8,_0x24f999){var _0x2880d1=function(_0x31c795){while(--_0x31c795){_0x4fdfd8['push'](_0x4fdfd8['shift']());}};_0x2880d1(++_0x24f999);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2e0f5e,_0x45aee9){_0x2e0f5e=_0x2e0f5e-0x0;var _0x1207f8=_0xe1e3[_0x2e0f5e];return _0x1207f8;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3e1e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e1e('0x3')]('in','out'),'defaultValue':_0x3e1e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3e1e('0x5')]},'providerName':{'type':Sequelize[_0x3e1e('0x6')]},'providerResponse':{'type':Sequelize[_0x3e1e('0x7')]}}; \ No newline at end of file +var _0x93e6=['BOOLEAN','out','DATE','TEXT','sequelize','medium'];(function(_0x12236d,_0x25d8b0){var _0x19b8f5=function(_0x17f3a7){while(--_0x17f3a7){_0x12236d['push'](_0x12236d['shift']());}};_0x19b8f5(++_0x25d8b0);}(_0x93e6,0x11e));var _0x693e=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0x93e6[_0x1057cb];return _0x7fbf7e;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x693e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x693e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x693e('0x3')),'defaultValue':_0x693e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x693e('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x693e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0c21006..9b68481 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 _0x5e50=['index','map','ChatMessage','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','create','body','catch','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','email','rejectmessage','parse','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','name'];(function(_0x45df7b,_0xd2c5d1){var _0x1c1c64=function(_0x1b494b){while(--_0x1b494b){_0x45df7b['push'](_0x45df7b['shift']());}};_0x1c1c64(++_0xd2c5d1);}(_0x5e50,0x151));var _0x05e5=function(_0x42cf1d,_0x1cb6ef){_0x42cf1d=_0x42cf1d-0x0;var _0x3756f4=_0x5e50[_0x42cf1d];return _0x3756f4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x05e5('0x0'));var jsonpatch=require(_0x05e5('0x1'));var rp=require(_0x05e5('0x2'));var moment=require(_0x05e5('0x3'));var BPromise=require(_0x05e5('0x4'));var Mustache=require('mustache');var util=require(_0x05e5('0x5'));var path=require(_0x05e5('0x6'));var sox=require('sox');var csv=require(_0x05e5('0x7'));var ejs=require(_0x05e5('0x8'));var fs=require('fs');var fs_extra=require(_0x05e5('0x9'));var _=require(_0x05e5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05e5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x05e5('0x7'));var querystring=require(_0x05e5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x05e5('0xd'));var qs=require(_0x05e5('0xe'));var as=require(_0x05e5('0xf'));var hardwareService=require(_0x05e5('0x10'));var logger=require(_0x05e5('0x11'))(_0x05e5('0x12'));var utils=require(_0x05e5('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x05e5('0x14'))['db'];config[_0x05e5('0x15')]=_[_0x05e5('0x16')](config[_0x05e5('0x15')],{'host':_0x05e5('0x17'),'port':0x18eb});var socket=require(_0x05e5('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x05e5('0x19')](socket);var jayson=require(_0x05e5('0x1a'));var client=jayson[_0x05e5('0x1b')][_0x05e5('0x1c')]({'port':0x232c});var client9002=jayson[_0x05e5('0x1b')][_0x05e5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x49c3cb,_0x5c964c,_0xa7062a,_0x597cdf){return new BPromise(function(_0x332b72,_0x1b7823){var _0x45bb87=_0x597cdf||client;return _0x45bb87[_0x05e5('0x1d')](_0x49c3cb,_0xa7062a)[_0x05e5('0x1e')](function(_0x476d61){logger[_0x05e5('0x1f')](_0x05e5('0x20'),_0x5c964c,_0x05e5('0x21'));logger[_0x05e5('0x22')](_0x05e5('0x23'),_0x5c964c,'request\x20sent',JSON[_0x05e5('0x24')](_0x476d61));if(_0x476d61[_0x05e5('0x25')]){if(_0x476d61[_0x05e5('0x25')][_0x05e5('0x26')]===0x1f4){logger['error'](_0x05e5('0x20'),_0x5c964c,_0x476d61[_0x05e5('0x25')][_0x05e5('0x27')]);return _0x1b7823(_0x476d61[_0x05e5('0x25')][_0x05e5('0x27')]);}logger['error'](_0x05e5('0x20'),_0x5c964c,_0x476d61[_0x05e5('0x25')][_0x05e5('0x27')]);return _0x332b72(_0x476d61[_0x05e5('0x25')]['message']);}else{logger[_0x05e5('0x1f')](_0x05e5('0x20'),_0x5c964c,'request\x20sent');_0x332b72(_0x476d61[_0x05e5('0x28')][_0x05e5('0x27')]);}})['catch'](function(_0xb1585f){logger[_0x05e5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x5c964c,_0xb1585f);_0x1b7823(_0xb1585f);});});}function respondWithStatusCode(_0x5dc91c,_0x24abf0){_0x24abf0=_0x24abf0||0xcc;return function(_0x4c62ad){if(_0x4c62ad){return _0x5dc91c[_0x05e5('0x29')](_0x24abf0);}return _0x5dc91c[_0x05e5('0x2a')](_0x24abf0)['end']();};}function respondWithResult(_0x3d4881,_0x4433c2){_0x4433c2=_0x4433c2||0xc8;return function(_0x1cf479){if(_0x1cf479){return _0x3d4881[_0x05e5('0x2a')](_0x4433c2)[_0x05e5('0x2b')](_0x1cf479);}};}function respondWithFilteredResult(_0xdc86f0,_0x12ae24){return function(_0x1ce943){if(_0x1ce943){var _0x456b32=typeof _0x12ae24[_0x05e5('0x2c')]==='undefined'&&typeof _0x12ae24[_0x05e5('0x2d')]==='undefined';var _0x5b3b9f=_0x1ce943[_0x05e5('0x2e')];var _0xd316dd=_0x456b32?0x0:_0x12ae24[_0x05e5('0x2c')];var _0x5fcd6e=_0x456b32?_0x1ce943['count']:_0x12ae24[_0x05e5('0x2c')]+_0x12ae24['limit'];var _0x146453;if(_0x5fcd6e>=_0x5b3b9f){_0x5fcd6e=_0x5b3b9f;_0x146453=0xc8;}else{_0x146453=0xce;}_0xdc86f0[_0x05e5('0x2a')](_0x146453);return _0xdc86f0[_0x05e5('0x2f')](_0x05e5('0x30'),_0xd316dd+'-'+_0x5fcd6e+'/'+_0x5b3b9f)[_0x05e5('0x2b')](_0x1ce943);}return null;};}function patchUpdates(_0x11b82e){return function(_0x327bf7){try{jsonpatch[_0x05e5('0x31')](_0x327bf7,_0x11b82e,!![]);}catch(_0x43cbe8){return BPromise[_0x05e5('0x32')](_0x43cbe8);}return _0x327bf7[_0x05e5('0x33')]();};}function saveUpdates(_0x12f35a,_0x59eb52){return function(_0x32aaae){if(_0x32aaae){return _0x32aaae[_0x05e5('0x34')](_0x12f35a)['then'](function(_0x19021f){return _0x19021f;});}return null;};}function removeEntity(_0x292c49,_0x3c71ea){return function(_0x3fd4f5){if(_0x3fd4f5){return _0x3fd4f5[_0x05e5('0x35')]()[_0x05e5('0x1e')](function(){_0x292c49['status'](0xcc)[_0x05e5('0x36')]();});}};}function handleEntityNotFound(_0x394b53,_0x3e2622){return function(_0x3b9285){if(!_0x3b9285){_0x394b53[_0x05e5('0x29')](0x194);}return _0x3b9285;};}function handleError(_0x1dd554,_0xb3b5ba){_0xb3b5ba=_0xb3b5ba||0x1f4;return function(_0x32ae94){logger[_0x05e5('0x25')](_0x32ae94['stack']);if(_0x32ae94[_0x05e5('0x37')]){delete _0x32ae94[_0x05e5('0x37')];}_0x1dd554['status'](_0xb3b5ba)['send'](_0x32ae94);};}exports[_0x05e5('0x38')]=function(_0x2be0e0,_0x30c036){var _0x3bdd22={},_0x4c15b0={},_0x53fa41={'count':0x0,'rows':[]};var _0x3bd2f1=_[_0x05e5('0x39')](db[_0x05e5('0x3a')][_0x05e5('0x3b')],function(_0x171e8c){return{'name':_0x171e8c['fieldName'],'type':_0x171e8c[_0x05e5('0x3c')]['key']};});_0x4c15b0[_0x05e5('0x3d')]=_[_0x05e5('0x39')](_0x3bd2f1,'name');_0x4c15b0['query']=_[_0x05e5('0x3e')](_0x2be0e0[_0x05e5('0x3f')]);_0x4c15b0[_0x05e5('0x40')]=_[_0x05e5('0x41')](_0x4c15b0['model'],_0x4c15b0['query']);_0x3bdd22[_0x05e5('0x42')]=_[_0x05e5('0x41')](_0x4c15b0['model'],qs[_0x05e5('0x43')](_0x2be0e0[_0x05e5('0x3f')]['fields']));_0x3bdd22[_0x05e5('0x42')]=_0x3bdd22['attributes'][_0x05e5('0x44')]?_0x3bdd22['attributes']:_0x4c15b0[_0x05e5('0x3d')];if(!_0x2be0e0[_0x05e5('0x3f')][_0x05e5('0x45')](_0x05e5('0x46'))){_0x3bdd22[_0x05e5('0x2d')]=qs[_0x05e5('0x2d')](_0x2be0e0[_0x05e5('0x3f')][_0x05e5('0x2d')]);_0x3bdd22[_0x05e5('0x2c')]=qs[_0x05e5('0x2c')](_0x2be0e0[_0x05e5('0x3f')][_0x05e5('0x2c')]);}_0x3bdd22[_0x05e5('0x47')]=qs[_0x05e5('0x48')](_0x2be0e0[_0x05e5('0x3f')]['sort']);_0x3bdd22[_0x05e5('0x49')]=qs[_0x05e5('0x40')](_['pick'](_0x2be0e0[_0x05e5('0x3f')],_0x4c15b0[_0x05e5('0x40')]),_0x3bd2f1);if(_0x2be0e0[_0x05e5('0x3f')]['filter']){_0x3bdd22[_0x05e5('0x49')]=_[_0x05e5('0x4a')](_0x3bdd22[_0x05e5('0x49')],{'$or':_['map'](_0x3bd2f1,function(_0x5c72b8){if(_0x5c72b8[_0x05e5('0x3c')]!==_0x05e5('0x4b')){var _0x5aed85={};_0x5aed85[_0x5c72b8[_0x05e5('0x37')]]={'$like':'%'+_0x2be0e0[_0x05e5('0x3f')][_0x05e5('0x4c')]+'%'};return _0x5aed85;}})});}_0x3bdd22=_[_0x05e5('0x4a')]({},_0x3bdd22,_0x2be0e0[_0x05e5('0x4d')]);var _0x44a8fa={'where':_0x3bdd22[_0x05e5('0x49')]};return db[_0x05e5('0x3a')][_0x05e5('0x2e')](_0x44a8fa)[_0x05e5('0x1e')](function(_0x5d67ea){_0x53fa41[_0x05e5('0x2e')]=_0x5d67ea;if(_0x2be0e0['query'][_0x05e5('0x4e')]){_0x3bdd22[_0x05e5('0x4f')]=[{'all':!![]}];}return db[_0x05e5('0x3a')]['findAll'](_0x3bdd22);})[_0x05e5('0x1e')](function(_0x19ff11){_0x53fa41[_0x05e5('0x50')]=_0x19ff11;return _0x53fa41;})[_0x05e5('0x1e')](respondWithFilteredResult(_0x30c036,_0x3bdd22))['catch'](handleError(_0x30c036,null));};exports[_0x05e5('0x51')]=function(_0x2481b6,_0x13704f){var _0x6a8bec={'raw':!![],'where':{'id':_0x2481b6[_0x05e5('0x52')]['id']}},_0x3542c6={};_0x3542c6['model']=_[_0x05e5('0x3e')](db[_0x05e5('0x3a')][_0x05e5('0x3b')]);_0x3542c6[_0x05e5('0x3f')]=_[_0x05e5('0x3e')](_0x2481b6[_0x05e5('0x3f')]);_0x3542c6['filters']=_[_0x05e5('0x41')](_0x3542c6[_0x05e5('0x3d')],_0x3542c6[_0x05e5('0x3f')]);_0x6a8bec['attributes']=_['intersection'](_0x3542c6[_0x05e5('0x3d')],qs[_0x05e5('0x43')](_0x2481b6[_0x05e5('0x3f')][_0x05e5('0x43')]));_0x6a8bec[_0x05e5('0x42')]=_0x6a8bec[_0x05e5('0x42')][_0x05e5('0x44')]?_0x6a8bec['attributes']:_0x3542c6[_0x05e5('0x3d')];if(_0x2481b6['query']['includeAll']){_0x6a8bec[_0x05e5('0x4f')]=[{'all':!![]}];}_0x6a8bec=_['merge']({},_0x6a8bec,_0x2481b6[_0x05e5('0x4d')]);return db[_0x05e5('0x3a')][_0x05e5('0x53')](_0x6a8bec)[_0x05e5('0x1e')](handleEntityNotFound(_0x13704f,null))[_0x05e5('0x1e')](respondWithResult(_0x13704f,null))['catch'](handleError(_0x13704f,null));};exports[_0x05e5('0x54')]=function(_0x30124d,_0x33d393){return db[_0x05e5('0x3a')][_0x05e5('0x54')](_0x30124d[_0x05e5('0x55')],{})['then'](respondWithResult(_0x33d393,0xc9))[_0x05e5('0x56')](handleError(_0x33d393,null));};exports[_0x05e5('0x34')]=function(_0xef59a9,_0x46acff){if(_0xef59a9['body']['id']){delete _0xef59a9[_0x05e5('0x55')]['id'];}return db['ChatMessage'][_0x05e5('0x53')]({'where':{'id':_0xef59a9['params']['id']}})[_0x05e5('0x1e')](handleEntityNotFound(_0x46acff,null))[_0x05e5('0x1e')](saveUpdates(_0xef59a9[_0x05e5('0x55')],null))[_0x05e5('0x1e')](respondWithResult(_0x46acff,null))[_0x05e5('0x56')](handleError(_0x46acff,null));};exports[_0x05e5('0x35')]=function(_0x32957d,_0x59d1ef){return db[_0x05e5('0x3a')]['find']({'where':{'id':_0x32957d['params']['id']}})[_0x05e5('0x1e')](handleEntityNotFound(_0x59d1ef,null))[_0x05e5('0x1e')](removeEntity(_0x59d1ef,null))[_0x05e5('0x56')](handleError(_0x59d1ef,null));};exports['describe']=function(_0x1081bb,_0x354fb2){return db[_0x05e5('0x3a')][_0x05e5('0x57')]()[_0x05e5('0x1e')](respondWithResult(_0x354fb2,null))['catch'](handleError(_0x354fb2,null));};var interaction_log=require('../../config/logger')(_0x05e5('0x58'));exports[_0x05e5('0x59')]=function(_0x513b66,_0x2812d1,_0xfec067){var _0x2bbac3={'agent':{},'channel':_0x05e5('0x5a')};if(_0x513b66[_0x05e5('0x55')]['id']){delete _0x513b66[_0x05e5('0x55')]['id'];}_0x513b66[_0x05e5('0x55')]['read']=!![];_0x513b66[_0x05e5('0x55')][_0x05e5('0x5b')]=moment()[_0x05e5('0x5c')](_0x05e5('0x5d'));_0x513b66['body']['UserId']=_0x513b66[_0x05e5('0x55')][_0x05e5('0x5e')]||_0x513b66['user']['id'];_0x2bbac3['agent']['id']=_0x513b66[_0x05e5('0x55')]['UserId'];return db[_0x05e5('0x3a')][_0x05e5('0x53')]({'where':{'id':_0x513b66[_0x05e5('0x52')]['id'],'UserId':null}})[_0x05e5('0x1e')](handleEntityNotFound(_0x2812d1,null))['then'](saveUpdates(_0x513b66[_0x05e5('0x55')],null))[_0x05e5('0x1e')](function(_0x3a8f8a){if(_0x3a8f8a){_0x2bbac3[_0x05e5('0x27')]=_0x3a8f8a[_0x05e5('0x5f')]({'plain':!![]});return db[_0x05e5('0x60')]['find']({'where':{'id':_0x3a8f8a['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2812d1,null))[_0x05e5('0x1e')](function(_0x223a2a){if(_0x223a2a){return _0x223a2a[_0x05e5('0x34')]({'UserId':_0x513b66[_0x05e5('0x55')][_0x05e5('0x5e')],'read1stAt':_[_0x05e5('0x61')](_0x223a2a[_0x05e5('0x62')])?moment()[_0x05e5('0x5c')](_0x05e5('0x5d')):undefined});}return null;})[_0x05e5('0x1e')](function(_0x462533){if(_0x462533){_0x2bbac3[_0x05e5('0x63')]=_0x462533[_0x05e5('0x5f')]({'plain':!![]});interaction_log[_0x05e5('0x1f')](_0x05e5('0x64'),_0x513b66[_0x05e5('0x65')]['id'],_0x513b66[_0x05e5('0x65')][_0x05e5('0x37')],_0x513b66[_0x05e5('0x65')][_0x05e5('0x66')],_0x2bbac3[_0x05e5('0x63')]['id'],_0x513b66[_0x05e5('0x55')]?JSON[_0x05e5('0x24')](_0x513b66[_0x05e5('0x55')]):'null');return respondWithRpcPromise('AcceptMessage',_0x05e5('0x67'),_0x2bbac3);}return null;})[_0x05e5('0x1e')](function(_0x42d2cf){var _0xbed52=_0x05e5('0x68')+_0x42d2cf[_0x05e5('0x27')]['ContactId'];return db[_0x05e5('0x69')][_0x05e5('0x3f')](_0xbed52,{'type':db[_0x05e5('0x6a')][_0x05e5('0x6b')][_0x05e5('0x6c')],'raw':!![]})[_0x05e5('0x1e')](function(_0x2d6a6d){return _0x2d6a6d;});})[_0x05e5('0x1e')](function(_0x34d744){if(_0x34d744){_0x2bbac3['message'][_0x05e5('0x6d')]=_0x34d744[0x0];if(!_0x513b66[_0x05e5('0x55')]['UserId'])return;return db[_0x05e5('0x6e')][_0x05e5('0x53')]({'where':{'id':_0x513b66['body'][_0x05e5('0x5e')],'role':_0x05e5('0x6f')},'attributes':['id',_0x05e5('0x37'),_0x05e5('0x70'),'email',_0x05e5('0x71')],'raw':!![]});}return null;})[_0x05e5('0x1e')](function(_0x5a4bb8){if(!_0x5a4bb8)return null;_0x2bbac3[_0x05e5('0x27')]['agent']=_0x5a4bb8;return _0x2bbac3;})['then'](function(_0x250069){if(_0x250069){if(_0x513b66['body'][_0x05e5('0x72')]){_0x2bbac3[_0x05e5('0x27')][_0x05e5('0x73')]=util[_0x05e5('0x5c')](_0x05e5('0x74'),_0x513b66[_0x05e5('0x65')]['name']);_0x2bbac3[_0x05e5('0x27')]['channel']=_0x2bbac3[_0x05e5('0x75')];_0x2bbac3[_0x05e5('0x27')][_0x05e5('0x76')]=_0x2bbac3[_0x05e5('0x75')];_0x2bbac3[_0x05e5('0x27')][_0x05e5('0x77')]='accept';return respondWithRpcPromise(_0x05e5('0x78'),_0x05e5('0x78'),{'event':_0x05e5('0x79'),'message':_[_0x05e5('0x4a')](_0x2bbac3[_0x05e5('0x27')],JSON['parse'](_0x2bbac3[_0x05e5('0x63')][_0x05e5('0x7a')]))},client9002)[_0x05e5('0x1e')](function(){return _0x2bbac3;});}return _0x2bbac3;}return null;})['then'](respondWithResult(_0x2812d1,null))[_0x05e5('0x56')](handleError(_0x2812d1,null));};var interaction_log=require(_0x05e5('0x11'))(_0x05e5('0x58'));exports[_0x05e5('0x32')]=function(_0x4c00a4,_0x5301bc,_0x2a3c95){var _0x15ba6f={'agent':{},'channel':'chat'};if(_0x4c00a4[_0x05e5('0x55')]['id']){delete _0x4c00a4[_0x05e5('0x55')]['id'];}_0x4c00a4['body'][_0x05e5('0x5e')]=_0x4c00a4['body']['UserId']||_0x4c00a4[_0x05e5('0x65')]['id'];_0x15ba6f[_0x05e5('0x6f')]['id']=_0x4c00a4[_0x05e5('0x55')][_0x05e5('0x5e')];return db[_0x05e5('0x3a')][_0x05e5('0x53')]({'where':{'id':_0x4c00a4['params']['id'],'UserId':null}})[_0x05e5('0x1e')](handleEntityNotFound(_0x5301bc,null))[_0x05e5('0x1e')](function(_0x425f71){if(_0x425f71){_0x15ba6f[_0x05e5('0x27')]=_0x425f71[_0x05e5('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0x05e5('0x53')]({'where':{'id':_0x425f71[_0x05e5('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x5301bc,null))[_0x05e5('0x1e')](function(_0x1f73fa){if(_0x1f73fa){_0x15ba6f['interaction']=_0x1f73fa[_0x05e5('0x5f')]({'plain':!![]});interaction_log[_0x05e5('0x1f')](_0x05e5('0x7c'),_0x4c00a4[_0x05e5('0x65')]['id'],_0x4c00a4[_0x05e5('0x65')][_0x05e5('0x37')],_0x4c00a4['user'][_0x05e5('0x66')],_0x15ba6f[_0x05e5('0x63')]['id'],_0x4c00a4[_0x05e5('0x55')]?JSON[_0x05e5('0x24')](_0x4c00a4['body']):_0x05e5('0x7d'));return respondWithRpcPromise(_0x05e5('0x7e'),'rejectMessage',_0x15ba6f);}return null;})['then'](function(_0xc8c00c){var _0x3e472b=_0x05e5('0x68')+_0xc8c00c[_0x05e5('0x27')][_0x05e5('0x7f')];return db[_0x05e5('0x69')]['query'](_0x3e472b,{'type':db[_0x05e5('0x6a')]['QueryTypes'][_0x05e5('0x6c')],'raw':!![]})[_0x05e5('0x1e')](function(_0x438979){return _0x438979;});})[_0x05e5('0x1e')](function(_0xd73b73){if(_0xd73b73){_0x15ba6f[_0x05e5('0x27')]['contact']=_0xd73b73[0x0];if(!_0x4c00a4[_0x05e5('0x55')][_0x05e5('0x5e')])return;return db[_0x05e5('0x6e')][_0x05e5('0x53')]({'where':{'id':_0x4c00a4[_0x05e5('0x55')][_0x05e5('0x5e')],'role':_0x05e5('0x6f')},'attributes':['id','name','fullname',_0x05e5('0x80'),_0x05e5('0x71')],'raw':!![]});}return null;})['then'](function(_0x3b00f6){if(!_0x3b00f6)return null;_0x15ba6f[_0x05e5('0x27')][_0x05e5('0x6f')]=_0x3b00f6;return _0x15ba6f;})[_0x05e5('0x1e')](function(_0x4eb7b4){if(_0x4eb7b4){_0x4eb7b4[_0x05e5('0x27')]['interface']=util[_0x05e5('0x5c')](_0x05e5('0x74'),_0x4c00a4[_0x05e5('0x65')][_0x05e5('0x37')]);_0x4eb7b4[_0x05e5('0x27')][_0x05e5('0x75')]=_0x15ba6f[_0x05e5('0x75')];_0x4eb7b4['message']['motionChannel']=_0x15ba6f[_0x05e5('0x75')];_0x4eb7b4['message'][_0x05e5('0x77')]=_0x05e5('0x32');respondWithRpcPromise(_0x05e5('0x78'),_0x05e5('0x78'),{'event':_0x05e5('0x81'),'message':_[_0x05e5('0x4a')](_0x15ba6f[_0x05e5('0x27')],JSON[_0x05e5('0x82')](_0x15ba6f[_0x05e5('0x63')][_0x05e5('0x7a')]))},client9002);return _0x15ba6f;}return null;})[_0x05e5('0x1e')](respondWithResult(_0x5301bc,null))['catch'](handleError(_0x5301bc,null));}; \ No newline at end of file +var _0x6704=['keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatMessage','include','findAll','rows','params','length','find','create','body','update','destroy','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','rejectMessage','Sequelize','fullname','internal','interface','reject','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x2daf2a,_0x23acf0){var _0x50e844=function(_0x59bae2){while(--_0x59bae2){_0x2daf2a['push'](_0x2daf2a['shift']());}};_0x50e844(++_0x23acf0);}(_0x6704,0x1d8));var _0x4670=function(_0x5f5eb2,_0x3868f5){_0x5f5eb2=_0x5f5eb2-0x0;var _0x58df87=_0x6704[_0x5f5eb2];return _0x58df87;};'use strict';var emlformat=require(_0x4670('0x0'));var rimraf=require(_0x4670('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4670('0x2'));var rp=require(_0x4670('0x3'));var moment=require(_0x4670('0x4'));var BPromise=require(_0x4670('0x5'));var Mustache=require(_0x4670('0x6'));var util=require(_0x4670('0x7'));var path=require(_0x4670('0x8'));var sox=require(_0x4670('0x9'));var csv=require(_0x4670('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4670('0xb'));var _=require(_0x4670('0xc'));var squel=require('squel');var crypto=require(_0x4670('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4670('0xe'));var Papa=require(_0x4670('0xf'));var Redis=require(_0x4670('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4670('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4670('0x12'));var logger=require(_0x4670('0x13'))(_0x4670('0x14'));var utils=require('../../config/utils');var config=require(_0x4670('0x15'));var licenseUtil=require(_0x4670('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4670('0x17')](config[_0x4670('0x18')],{'host':_0x4670('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4670('0x18')]));require(_0x4670('0x1a'))[_0x4670('0x1b')](socket);var jayson=require(_0x4670('0x1c'));var client=jayson[_0x4670('0x1d')][_0x4670('0x1e')]({'port':0x232c});var client9002=jayson[_0x4670('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5567f4,_0x2243ab,_0x44688c,_0xd161bb){return new BPromise(function(_0x5db35d,_0x528060){var _0xf32b59=_0xd161bb||client;return _0xf32b59[_0x4670('0x1f')](_0x5567f4,_0x44688c)[_0x4670('0x20')](function(_0x5a9ff7){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2243ab,_0x4670('0x21'));logger[_0x4670('0x22')](_0x4670('0x23'),_0x2243ab,_0x4670('0x21'),JSON[_0x4670('0x24')](_0x5a9ff7));if(_0x5a9ff7['error']){if(_0x5a9ff7[_0x4670('0x25')]['code']===0x1f4){logger[_0x4670('0x25')](_0x4670('0x26'),_0x2243ab,_0x5a9ff7[_0x4670('0x25')][_0x4670('0x27')]);return _0x528060(_0x5a9ff7[_0x4670('0x25')][_0x4670('0x27')]);}logger[_0x4670('0x25')](_0x4670('0x26'),_0x2243ab,_0x5a9ff7[_0x4670('0x25')][_0x4670('0x27')]);return _0x5db35d(_0x5a9ff7[_0x4670('0x25')]['message']);}else{logger[_0x4670('0x28')](_0x4670('0x26'),_0x2243ab,_0x4670('0x21'));_0x5db35d(_0x5a9ff7[_0x4670('0x29')][_0x4670('0x27')]);}})[_0x4670('0x2a')](function(_0x2853f7){logger['error'](_0x4670('0x26'),_0x2243ab,_0x2853f7);_0x528060(_0x2853f7);});});}function respondWithStatusCode(_0x4a4bda,_0x218ec3){_0x218ec3=_0x218ec3||0xcc;return function(_0x14bff7){if(_0x14bff7){return _0x4a4bda[_0x4670('0x2b')](_0x218ec3);}return _0x4a4bda[_0x4670('0x2c')](_0x218ec3)['end']();};}function respondWithResult(_0x348ab2,_0xc1a112){_0xc1a112=_0xc1a112||0xc8;return function(_0x431a0b){if(_0x431a0b){return _0x348ab2[_0x4670('0x2c')](_0xc1a112)['json'](_0x431a0b);}};}function respondWithFilteredResult(_0x1cd376,_0x57b69f){return function(_0x1d0c98){if(_0x1d0c98){var _0x45f85b=typeof _0x57b69f[_0x4670('0x2d')]==='undefined'&&typeof _0x57b69f[_0x4670('0x2e')]==='undefined';var _0xcc4bda=_0x1d0c98['count'];var _0x2db437=_0x45f85b?0x0:_0x57b69f[_0x4670('0x2d')];var _0x41a2b1=_0x45f85b?_0x1d0c98[_0x4670('0x2f')]:_0x57b69f['offset']+_0x57b69f[_0x4670('0x2e')];var _0x33daad;if(_0x41a2b1>=_0xcc4bda){_0x41a2b1=_0xcc4bda;_0x33daad=0xc8;}else{_0x33daad=0xce;}_0x1cd376[_0x4670('0x2c')](_0x33daad);return _0x1cd376[_0x4670('0x30')](_0x4670('0x31'),_0x2db437+'-'+_0x41a2b1+'/'+_0xcc4bda)[_0x4670('0x32')](_0x1d0c98);}return null;};}function patchUpdates(_0x24514f){return function(_0xed1e71){try{jsonpatch[_0x4670('0x33')](_0xed1e71,_0x24514f,!![]);}catch(_0x16ceac){return BPromise['reject'](_0x16ceac);}return _0xed1e71[_0x4670('0x34')]();};}function saveUpdates(_0x1e7f61,_0x3fc1a5){return function(_0x560a5d){if(_0x560a5d){return _0x560a5d['update'](_0x1e7f61)['then'](function(_0x3ca583){return _0x3ca583;});}return null;};}function removeEntity(_0x17a9d5,_0x12343b){return function(_0x478d85){if(_0x478d85){return _0x478d85['destroy']()[_0x4670('0x20')](function(){_0x17a9d5[_0x4670('0x2c')](0xcc)[_0x4670('0x35')]();});}};}function handleEntityNotFound(_0x3c0118,_0x170ef3){return function(_0x35703c){if(!_0x35703c){_0x3c0118[_0x4670('0x2b')](0x194);}return _0x35703c;};}function handleError(_0x328198,_0x1e1481){_0x1e1481=_0x1e1481||0x1f4;return function(_0x3a95fc){logger[_0x4670('0x25')](_0x3a95fc[_0x4670('0x36')]);if(_0x3a95fc['name']){delete _0x3a95fc[_0x4670('0x37')];}_0x328198[_0x4670('0x2c')](_0x1e1481)['send'](_0x3a95fc);};}exports[_0x4670('0x38')]=function(_0x1e1ca8,_0x10cd3d){var _0x56b51b={},_0x5f330f={},_0x129346={'count':0x0,'rows':[]};var _0x7f0567=_[_0x4670('0x39')](db['ChatMessage'][_0x4670('0x3a')],function(_0x3d2667){return{'name':_0x3d2667[_0x4670('0x3b')],'type':_0x3d2667[_0x4670('0x3c')][_0x4670('0x3d')]};});_0x5f330f[_0x4670('0x3e')]=_[_0x4670('0x39')](_0x7f0567,_0x4670('0x37'));_0x5f330f[_0x4670('0x3f')]=_[_0x4670('0x40')](_0x1e1ca8[_0x4670('0x3f')]);_0x5f330f[_0x4670('0x41')]=_['intersection'](_0x5f330f[_0x4670('0x3e')],_0x5f330f[_0x4670('0x3f')]);_0x56b51b[_0x4670('0x42')]=_[_0x4670('0x43')](_0x5f330f[_0x4670('0x3e')],qs[_0x4670('0x44')](_0x1e1ca8['query'][_0x4670('0x44')]));_0x56b51b[_0x4670('0x42')]=_0x56b51b[_0x4670('0x42')]['length']?_0x56b51b[_0x4670('0x42')]:_0x5f330f['model'];if(!_0x1e1ca8[_0x4670('0x3f')][_0x4670('0x45')](_0x4670('0x46'))){_0x56b51b['limit']=qs['limit'](_0x1e1ca8['query'][_0x4670('0x2e')]);_0x56b51b[_0x4670('0x2d')]=qs[_0x4670('0x2d')](_0x1e1ca8[_0x4670('0x3f')][_0x4670('0x2d')]);}_0x56b51b[_0x4670('0x47')]=qs[_0x4670('0x48')](_0x1e1ca8[_0x4670('0x3f')][_0x4670('0x48')]);_0x56b51b[_0x4670('0x49')]=qs[_0x4670('0x41')](_[_0x4670('0x4a')](_0x1e1ca8[_0x4670('0x3f')],_0x5f330f[_0x4670('0x41')]),_0x7f0567);if(_0x1e1ca8[_0x4670('0x3f')][_0x4670('0x4b')]){_0x56b51b['where']=_[_0x4670('0x4c')](_0x56b51b['where'],{'$or':_[_0x4670('0x39')](_0x7f0567,function(_0x954e05){if(_0x954e05[_0x4670('0x3c')]!=='VIRTUAL'){var _0x301a7d={};_0x301a7d[_0x954e05[_0x4670('0x37')]]={'$like':'%'+_0x1e1ca8['query'][_0x4670('0x4b')]+'%'};return _0x301a7d;}})});}_0x56b51b=_[_0x4670('0x4c')]({},_0x56b51b,_0x1e1ca8[_0x4670('0x4d')]);var _0x2c194b={'where':_0x56b51b[_0x4670('0x49')]};return db[_0x4670('0x4e')][_0x4670('0x2f')](_0x2c194b)[_0x4670('0x20')](function(_0xe80f29){_0x129346[_0x4670('0x2f')]=_0xe80f29;if(_0x1e1ca8[_0x4670('0x3f')]['includeAll']){_0x56b51b[_0x4670('0x4f')]=[{'all':!![]}];}return db[_0x4670('0x4e')][_0x4670('0x50')](_0x56b51b);})[_0x4670('0x20')](function(_0x10eac8){_0x129346[_0x4670('0x51')]=_0x10eac8;return _0x129346;})[_0x4670('0x20')](respondWithFilteredResult(_0x10cd3d,_0x56b51b))['catch'](handleError(_0x10cd3d,null));};exports['show']=function(_0x17f40b,_0x395f98){var _0x4eaa8d={'raw':!![],'where':{'id':_0x17f40b[_0x4670('0x52')]['id']}},_0x1488cd={};_0x1488cd[_0x4670('0x3e')]=_[_0x4670('0x40')](db[_0x4670('0x4e')][_0x4670('0x3a')]);_0x1488cd[_0x4670('0x3f')]=_[_0x4670('0x40')](_0x17f40b['query']);_0x1488cd[_0x4670('0x41')]=_[_0x4670('0x43')](_0x1488cd['model'],_0x1488cd[_0x4670('0x3f')]);_0x4eaa8d['attributes']=_[_0x4670('0x43')](_0x1488cd['model'],qs[_0x4670('0x44')](_0x17f40b[_0x4670('0x3f')][_0x4670('0x44')]));_0x4eaa8d[_0x4670('0x42')]=_0x4eaa8d[_0x4670('0x42')][_0x4670('0x53')]?_0x4eaa8d[_0x4670('0x42')]:_0x1488cd['model'];if(_0x17f40b[_0x4670('0x3f')]['includeAll']){_0x4eaa8d[_0x4670('0x4f')]=[{'all':!![]}];}_0x4eaa8d=_[_0x4670('0x4c')]({},_0x4eaa8d,_0x17f40b[_0x4670('0x4d')]);return db[_0x4670('0x4e')][_0x4670('0x54')](_0x4eaa8d)[_0x4670('0x20')](handleEntityNotFound(_0x395f98,null))[_0x4670('0x20')](respondWithResult(_0x395f98,null))[_0x4670('0x2a')](handleError(_0x395f98,null));};exports[_0x4670('0x55')]=function(_0x4bd793,_0x23365e){return db['ChatMessage'][_0x4670('0x55')](_0x4bd793[_0x4670('0x56')],{})[_0x4670('0x20')](respondWithResult(_0x23365e,0xc9))[_0x4670('0x2a')](handleError(_0x23365e,null));};exports[_0x4670('0x57')]=function(_0xae5bff,_0x2bf7dd){if(_0xae5bff[_0x4670('0x56')]['id']){delete _0xae5bff[_0x4670('0x56')]['id'];}return db[_0x4670('0x4e')][_0x4670('0x54')]({'where':{'id':_0xae5bff[_0x4670('0x52')]['id']}})[_0x4670('0x20')](handleEntityNotFound(_0x2bf7dd,null))[_0x4670('0x20')](saveUpdates(_0xae5bff[_0x4670('0x56')],null))[_0x4670('0x20')](respondWithResult(_0x2bf7dd,null))[_0x4670('0x2a')](handleError(_0x2bf7dd,null));};exports[_0x4670('0x58')]=function(_0x942bcd,_0x311174){return db[_0x4670('0x4e')]['find']({'where':{'id':_0x942bcd[_0x4670('0x52')]['id']}})['then'](handleEntityNotFound(_0x311174,null))[_0x4670('0x20')](removeEntity(_0x311174,null))[_0x4670('0x2a')](handleError(_0x311174,null));};exports[_0x4670('0x59')]=function(_0x593871,_0x515d95){return db[_0x4670('0x4e')][_0x4670('0x59')]()[_0x4670('0x20')](respondWithResult(_0x515d95,null))[_0x4670('0x2a')](handleError(_0x515d95,null));};var interaction_log=require(_0x4670('0x13'))(_0x4670('0x5a'));exports[_0x4670('0x5b')]=function(_0x2d8db6,_0x3d940e,_0x33b150){var _0x342196={'agent':{},'channel':_0x4670('0x5c')};if(_0x2d8db6[_0x4670('0x56')]['id']){delete _0x2d8db6['body']['id'];}_0x2d8db6[_0x4670('0x56')][_0x4670('0x5d')]=!![];_0x2d8db6['body'][_0x4670('0x5e')]=moment()[_0x4670('0x5f')](_0x4670('0x60'));_0x2d8db6[_0x4670('0x56')]['UserId']=_0x2d8db6['body'][_0x4670('0x61')]||_0x2d8db6['user']['id'];_0x342196[_0x4670('0x62')]['id']=_0x2d8db6[_0x4670('0x56')][_0x4670('0x61')];return db[_0x4670('0x4e')][_0x4670('0x54')]({'where':{'id':_0x2d8db6['params']['id'],'UserId':null}})[_0x4670('0x20')](handleEntityNotFound(_0x3d940e,null))[_0x4670('0x20')](saveUpdates(_0x2d8db6[_0x4670('0x56')],null))[_0x4670('0x20')](function(_0x17c0d3){if(_0x17c0d3){_0x342196[_0x4670('0x27')]=_0x17c0d3[_0x4670('0x63')]({'plain':!![]});return db[_0x4670('0x64')][_0x4670('0x54')]({'where':{'id':_0x17c0d3[_0x4670('0x65')]}});}return null;})[_0x4670('0x20')](handleEntityNotFound(_0x3d940e,null))[_0x4670('0x20')](function(_0x19429a){if(_0x19429a){return _0x19429a[_0x4670('0x57')]({'UserId':_0x2d8db6['body'][_0x4670('0x61')],'read1stAt':_['isNil'](_0x19429a['read1stAt'])?moment()[_0x4670('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x37ac5a){if(_0x37ac5a){_0x342196['interaction']=_0x37ac5a['get']({'plain':!![]});interaction_log[_0x4670('0x28')](_0x4670('0x66'),_0x2d8db6['user']['id'],_0x2d8db6[_0x4670('0x67')][_0x4670('0x37')],_0x2d8db6[_0x4670('0x67')][_0x4670('0x68')],_0x342196['interaction']['id'],_0x2d8db6[_0x4670('0x56')]?JSON['stringify'](_0x2d8db6[_0x4670('0x56')]):_0x4670('0x69'));return respondWithRpcPromise(_0x4670('0x6a'),_0x4670('0x6b'),_0x342196);}return null;})[_0x4670('0x20')](function(_0x21c010){var _0x1dbb08=_0x4670('0x6c')+_0x21c010['message'][_0x4670('0x6d')];return db[_0x4670('0x6e')]['query'](_0x1dbb08,{'type':db['Sequelize'][_0x4670('0x6f')][_0x4670('0x70')],'raw':!![]})[_0x4670('0x20')](function(_0xfc885f){return _0xfc885f;});})['then'](function(_0x60c0e){if(_0x60c0e){_0x342196['message'][_0x4670('0x71')]=_0x60c0e[0x0];if(!_0x2d8db6['body'][_0x4670('0x61')])return;return db[_0x4670('0x72')][_0x4670('0x54')]({'where':{'id':_0x2d8db6['body'][_0x4670('0x61')],'role':_0x4670('0x62')},'attributes':['id','name','fullname',_0x4670('0x73'),'internal'],'raw':!![]});}return null;})[_0x4670('0x20')](function(_0x43d449){if(!_0x43d449)return null;_0x342196[_0x4670('0x27')][_0x4670('0x62')]=_0x43d449;return _0x342196;})['then'](function(_0x42300c){if(_0x42300c){if(_0x2d8db6[_0x4670('0x56')][_0x4670('0x74')]){_0x342196[_0x4670('0x27')]['interface']=util[_0x4670('0x5f')](_0x4670('0x75'),_0x2d8db6[_0x4670('0x67')]['name']);_0x342196['message'][_0x4670('0x76')]=_0x342196[_0x4670('0x76')];_0x342196[_0x4670('0x27')][_0x4670('0x77')]=_0x342196[_0x4670('0x76')];_0x342196[_0x4670('0x27')][_0x4670('0x78')]=_0x4670('0x5b');return respondWithRpcPromise(_0x4670('0x79'),'EventManager',{'event':_0x4670('0x7a'),'message':_[_0x4670('0x4c')](_0x342196[_0x4670('0x27')],JSON[_0x4670('0x7b')](_0x342196['interaction'][_0x4670('0x7c')]))},client9002)[_0x4670('0x20')](function(){return _0x342196;});}return _0x342196;}return null;})[_0x4670('0x20')](respondWithResult(_0x3d940e,null))[_0x4670('0x2a')](handleError(_0x3d940e,null));};var interaction_log=require(_0x4670('0x13'))(_0x4670('0x5a'));exports['reject']=function(_0x40b67c,_0xcd12f6,_0x55112e){var _0x5da326={'agent':{},'channel':'chat'};if(_0x40b67c[_0x4670('0x56')]['id']){delete _0x40b67c[_0x4670('0x56')]['id'];}_0x40b67c[_0x4670('0x56')][_0x4670('0x61')]=_0x40b67c[_0x4670('0x56')]['UserId']||_0x40b67c[_0x4670('0x67')]['id'];_0x5da326[_0x4670('0x62')]['id']=_0x40b67c[_0x4670('0x56')][_0x4670('0x61')];return db['ChatMessage'][_0x4670('0x54')]({'where':{'id':_0x40b67c[_0x4670('0x52')]['id'],'UserId':null}})[_0x4670('0x20')](handleEntityNotFound(_0xcd12f6,null))[_0x4670('0x20')](function(_0x48bc14){if(_0x48bc14){_0x5da326[_0x4670('0x27')]=_0x48bc14[_0x4670('0x63')]({'plain':!![]});return db[_0x4670('0x64')][_0x4670('0x54')]({'where':{'id':_0x48bc14[_0x4670('0x65')]}});}return null;})[_0x4670('0x20')](handleEntityNotFound(_0xcd12f6,null))['then'](function(_0x28b17c){if(_0x28b17c){_0x5da326['interaction']=_0x28b17c[_0x4670('0x63')]({'plain':!![]});interaction_log[_0x4670('0x28')](_0x4670('0x7d'),_0x40b67c[_0x4670('0x67')]['id'],_0x40b67c[_0x4670('0x67')][_0x4670('0x37')],_0x40b67c[_0x4670('0x67')][_0x4670('0x68')],_0x5da326[_0x4670('0x7e')]['id'],_0x40b67c['body']?JSON[_0x4670('0x24')](_0x40b67c[_0x4670('0x56')]):_0x4670('0x69'));return respondWithRpcPromise(_0x4670('0x7f'),_0x4670('0x80'),_0x5da326);}return null;})[_0x4670('0x20')](function(_0x419d7a){var _0x10f661=_0x4670('0x6c')+_0x419d7a[_0x4670('0x27')][_0x4670('0x6d')];return db[_0x4670('0x6e')][_0x4670('0x3f')](_0x10f661,{'type':db[_0x4670('0x81')][_0x4670('0x6f')][_0x4670('0x70')],'raw':!![]})[_0x4670('0x20')](function(_0x199e54){return _0x199e54;});})[_0x4670('0x20')](function(_0x47ada9){if(_0x47ada9){_0x5da326[_0x4670('0x27')][_0x4670('0x71')]=_0x47ada9[0x0];if(!_0x40b67c[_0x4670('0x56')]['UserId'])return;return db[_0x4670('0x72')]['find']({'where':{'id':_0x40b67c[_0x4670('0x56')]['UserId'],'role':_0x4670('0x62')},'attributes':['id',_0x4670('0x37'),_0x4670('0x82'),_0x4670('0x73'),_0x4670('0x83')],'raw':!![]});}return null;})[_0x4670('0x20')](function(_0x5aff6f){if(!_0x5aff6f)return null;_0x5da326[_0x4670('0x27')][_0x4670('0x62')]=_0x5aff6f;return _0x5da326;})[_0x4670('0x20')](function(_0x380b4b){if(_0x380b4b){_0x380b4b[_0x4670('0x27')][_0x4670('0x84')]=util['format'](_0x4670('0x75'),_0x40b67c[_0x4670('0x67')][_0x4670('0x37')]);_0x380b4b[_0x4670('0x27')][_0x4670('0x76')]=_0x5da326[_0x4670('0x76')];_0x380b4b[_0x4670('0x27')][_0x4670('0x77')]=_0x5da326['channel'];_0x380b4b[_0x4670('0x27')][_0x4670('0x78')]=_0x4670('0x85');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x4670('0x4c')](_0x5da326[_0x4670('0x27')],JSON[_0x4670('0x7b')](_0x5da326[_0x4670('0x7e')][_0x4670('0x7c')]))},client9002);return _0x5da326;}return null;})['then'](respondWithResult(_0xcd12f6,null))[_0x4670('0x2a')](handleError(_0xcd12f6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a37a33f..94bda23 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 _0x455e=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x58f0a1,_0x7735f9){var _0x5cad70=function(_0x1dd3c0){while(--_0x1dd3c0){_0x58f0a1['push'](_0x58f0a1['shift']());}};_0x5cad70(++_0x7735f9);}(_0x455e,0x157));var _0xe455=function(_0x29cfb5,_0x567977){_0x29cfb5=_0x29cfb5-0x0;var _0x2d336b=_0x455e[_0x29cfb5];return _0x2d336b;};'use strict';var EventEmitter=require(_0xe455('0x0'));var ChatMessage=require(_0xe455('0x1'))['db'][_0xe455('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe455('0x3')](0x0);var events={'afterCreate':_0xe455('0x4'),'afterUpdate':_0xe455('0x5'),'afterDestroy':_0xe455('0x6')};function emitEvent(_0x33aeb){return function(_0x4c8621,_0x78b6db,_0xda4b82){ChatMessageEvents[_0xe455('0x7')](_0x33aeb+':'+_0x4c8621['id'],_0x4c8621);ChatMessageEvents[_0xe455('0x7')](_0x33aeb,_0x4c8621);_0xda4b82(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xe455('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xa8dd=['ChatMessage','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x51a76a,_0x136d7d){var _0x9efc57=function(_0x16a4b8){while(--_0x16a4b8){_0x51a76a['push'](_0x51a76a['shift']());}};_0x9efc57(++_0x136d7d);}(_0xa8dd,0xca));var _0xda8d=function(_0x551646,_0x183acb){_0x551646=_0x551646-0x0;var _0x19d925=_0xa8dd[_0x551646];return _0x19d925;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xda8d('0x0'))['db'][_0xda8d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda8d('0x2'),'afterUpdate':'update','afterDestroy':_0xda8d('0x3')};function emitEvent(_0x36f531){return function(_0x10631d,_0x1881bd,_0xb8394f){ChatMessageEvents[_0xda8d('0x4')](_0x36f531+':'+_0x10631d['id'],_0x10631d);ChatMessageEvents[_0xda8d('0x4')](_0x36f531,_0x10631d);_0xb8394f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xda8d('0x5')](e,emitEvent(event));}}module[_0xda8d('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c0f0b7e..e804445 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 _0x59a5=['error','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt'];(function(_0x182a26,_0x172bd1){var _0x1f80ba=function(_0x202312){while(--_0x202312){_0x182a26['push'](_0x182a26['shift']());}};_0x1f80ba(++_0x172bd1);}(_0x59a5,0x162));var _0x559a=function(_0x3a4e05,_0xfd0e1d){_0x3a4e05=_0x3a4e05-0x0;var _0x468b7a=_0x59a5[_0x3a4e05];return _0x468b7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x559a('0x0'));var moment=require(_0x559a('0x1'));var BPromise=require(_0x559a('0x2'));var rp=require(_0x559a('0x3'));var fs=require('fs');var path=require(_0x559a('0x4'));var rimraf=require('rimraf');var config=require(_0x559a('0x5'));var attributes=require(_0x559a('0x6'));module[_0x559a('0x7')]=function(_0x4f5be4,_0x4b14ca){return _0x4f5be4[_0x559a('0x8')](_0x559a('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x559a('0xa'),'fields':['body'],'type':_0x559a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d1fed,_0x296608,_0xfedbb3){var _0x389232=_0x4f5be4[_0x559a('0xc')];var _0x3003f5=_0x2d1fed[_0x559a('0xd')]({'plain':!![]});if(_0x3003f5[_0x559a('0xe')]['toLowerCase']()==='in'||_0x3003f5['direction'][_0x559a('0xf')]()==='out'&&!_0x3003f5[_0x559a('0x10')]&&!_['isNil'](_0x3003f5[_0x559a('0x11')])){_0x389232[_0x559a('0x12')][_0x559a('0x13')]({'where':{'id':_0x3003f5[_0x559a('0x14')]}})[_0x559a('0x15')](function(_0x5cf6be){if(_0x5cf6be){_0x5cf6be[_0x559a('0x16')]({'lastMsgAt':_0x3003f5[_0x559a('0x17')],'lastMsgDirection':_0x3003f5['direction'][_0x559a('0xf')]()});}})['catch'](function(_0x3119a1){console[_0x559a('0x18')](_0x3119a1);});}_0xfedbb3();}},'charset':_0x559a('0x19'),'collate':_0x559a('0x1a')});}; \ No newline at end of file +var _0x59e7=['chat_messages','body','get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x59e7,0x103));var _0x759e=function(_0x568f74,_0x3cb5a8){_0x568f74=_0x568f74-0x0;var _0x363cdd=_0x59e7[_0x568f74];return _0x363cdd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x759e('0x0'))(_0x759e('0x1'));var moment=require(_0x759e('0x2'));var BPromise=require(_0x759e('0x3'));var rp=require(_0x759e('0x4'));var fs=require('fs');var path=require(_0x759e('0x5'));var rimraf=require(_0x759e('0x6'));var config=require(_0x759e('0x7'));var attributes=require(_0x759e('0x8'));module['exports']=function(_0x1968c8,_0x54aa41){return _0x1968c8[_0x759e('0x9')](_0x759e('0xa'),attributes,{'tableName':_0x759e('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x759e('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32f4a5,_0x578e46,_0xe3e9e6){var _0x532c44=_0x1968c8['models'];var _0x3350e9=_0x32f4a5[_0x759e('0xd')]({'plain':!![]});if(_0x3350e9[_0x759e('0xe')]['toLowerCase']()==='in'||_0x3350e9[_0x759e('0xe')][_0x759e('0xf')]()==='out'&&!_0x3350e9[_0x759e('0x10')]&&!_[_0x759e('0x11')](_0x3350e9['UserId'])){_0x532c44[_0x759e('0x12')][_0x759e('0x13')]({'where':{'id':_0x3350e9[_0x759e('0x14')]}})[_0x759e('0x15')](function(_0x5a0520){if(_0x5a0520){_0x5a0520[_0x759e('0x16')]({'lastMsgAt':_0x3350e9[_0x759e('0x17')],'lastMsgDirection':_0x3350e9['direction'][_0x759e('0xf')]()});}})[_0x759e('0x18')](function(_0x54d479){console[_0x759e('0x19')](_0x54d479);});}_0xe3e9e6();}},'charset':'utf8mb4','collate':_0x759e('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c8f22a1..052eeb7 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 _0x949c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateChatMessage','ChatMessage','create','body','options','stringify','catch','lodash','util','moment','bluebird'];(function(_0xb26465,_0x138e2c){var _0x23bc34=function(_0x2f5971){while(--_0x2f5971){_0xb26465['push'](_0xb26465['shift']());}};_0x23bc34(++_0x138e2c);}(_0x949c,0xfc));var _0xc949=function(_0x26c181,_0x532da2){_0x26c181=_0x26c181-0x0;var _0x502253=_0x949c[_0x26c181];return _0x502253;};'use strict';var _=require(_0xc949('0x0'));var util=require(_0xc949('0x1'));var moment=require(_0xc949('0x2'));var BPromise=require(_0xc949('0x3'));var rs=require(_0xc949('0x4'));var fs=require('fs');var Redis=require(_0xc949('0x5'));var db=require(_0xc949('0x6'))['db'];var utils=require(_0xc949('0x7'));var logger=require(_0xc949('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc949('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc949('0xa')],{'host':_0xc949('0xb'),'port':0x18eb});var socket=require(_0xc949('0xc'))(new Redis(config[_0xc949('0xa')]));require(_0xc949('0xd'))[_0xc949('0xe')](socket);function respondWithRpcPromise(_0x58bd1e,_0x1f7fd9,_0x10cb17){return new BPromise(function(_0x1d8835,_0x4bfbcc){return client[_0xc949('0xf')](_0x58bd1e,_0x10cb17)[_0xc949('0x10')](function(_0x550e6f){logger[_0xc949('0x11')](_0xc949('0x12'),_0x1f7fd9,_0xc949('0x13'));logger[_0xc949('0x14')](_0xc949('0x15'),_0x1f7fd9,_0xc949('0x13'),JSON['stringify'](_0x550e6f));if(_0x550e6f['error']){if(_0x550e6f[_0xc949('0x16')]['code']===0x1f4){logger[_0xc949('0x16')](_0xc949('0x12'),_0x1f7fd9,_0x550e6f[_0xc949('0x16')][_0xc949('0x17')]);return _0x4bfbcc(_0x550e6f[_0xc949('0x16')]['message']);}logger[_0xc949('0x16')](_0xc949('0x12'),_0x1f7fd9,_0x550e6f[_0xc949('0x16')][_0xc949('0x17')]);return _0x1d8835(_0x550e6f['error'][_0xc949('0x17')]);}else{logger[_0xc949('0x11')](_0xc949('0x12'),_0x1f7fd9,_0xc949('0x13'));_0x1d8835(_0x550e6f[_0xc949('0x18')][_0xc949('0x17')]);}})['catch'](function(_0x1bedf5){logger[_0xc949('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1f7fd9,_0x1bedf5);_0x4bfbcc(_0x1bedf5);});});}exports[_0xc949('0x19')]=function(_0x374f11){var _0x54fdba=this;return new Promise(function(_0x3f50c6,_0x1a4575){return db[_0xc949('0x1a')][_0xc949('0x1b')](_0x374f11[_0xc949('0x1c')],{'raw':_0x374f11[_0xc949('0x1d')]?_0x374f11[_0xc949('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3eca52){logger[_0xc949('0x11')]('CreateChatMessage',_0x374f11);logger['debug'](_0xc949('0x19'),_0x374f11,JSON[_0xc949('0x1e')](_0x3eca52));_0x3f50c6(_0x3eca52);})[_0xc949('0x1f')](function(_0x489a28){logger[_0xc949('0x16')](_0xc949('0x19'),_0x489a28[_0xc949('0x17')],_0x374f11);_0x1a4575(_0x54fdba['error'](0x1f4,_0x489a28['message']));});});}; \ No newline at end of file +var _0x59f2=['./chatMessage.socket','register','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','create','body','raw','CreateChatMessage','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter'];(function(_0x201d98,_0x56fd1f){var _0x1ae057=function(_0xb7eeab){while(--_0xb7eeab){_0x201d98['push'](_0x201d98['shift']());}};_0x1ae057(++_0x56fd1f);}(_0x59f2,0xb3));var _0x259f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x59f2[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x259f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x259f('0x1'));var db=require(_0x259f('0x2'))['db'];var utils=require(_0x259f('0x3'));var logger=require(_0x259f('0x4'))('rpc');var config=require(_0x259f('0x5'));var jayson=require(_0x259f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x259f('0x7')]=_[_0x259f('0x8')](config[_0x259f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x259f('0x9'))(new Redis(config['redis']));require(_0x259f('0xa'))[_0x259f('0xb')](socket);function respondWithRpcPromise(_0x31d5a0,_0x5bbc27,_0xe76e38){return new BPromise(function(_0x240f70,_0x2b0ca5){return client['request'](_0x31d5a0,_0xe76e38)[_0x259f('0xc')](function(_0x724824){logger[_0x259f('0xd')]('ChatMessage,\x20%s,\x20%s',_0x5bbc27,'request\x20sent');logger[_0x259f('0xe')](_0x259f('0xf'),_0x5bbc27,'request\x20sent',JSON['stringify'](_0x724824));if(_0x724824[_0x259f('0x10')]){if(_0x724824[_0x259f('0x10')][_0x259f('0x11')]===0x1f4){logger[_0x259f('0x10')](_0x259f('0x12'),_0x5bbc27,_0x724824[_0x259f('0x10')][_0x259f('0x13')]);return _0x2b0ca5(_0x724824[_0x259f('0x10')][_0x259f('0x13')]);}logger[_0x259f('0x10')](_0x259f('0x12'),_0x5bbc27,_0x724824[_0x259f('0x10')][_0x259f('0x13')]);return _0x240f70(_0x724824[_0x259f('0x10')][_0x259f('0x13')]);}else{logger[_0x259f('0xd')](_0x259f('0x12'),_0x5bbc27,_0x259f('0x14'));_0x240f70(_0x724824[_0x259f('0x15')][_0x259f('0x13')]);}})[_0x259f('0x16')](function(_0x5b49de){logger[_0x259f('0x10')](_0x259f('0x12'),_0x5bbc27,_0x5b49de);_0x2b0ca5(_0x5b49de);});});}exports['CreateChatMessage']=function(_0x46302d){var _0x4c394c=this;return new Promise(function(_0xc1796c,_0x225d21){return db['ChatMessage'][_0x259f('0x17')](_0x46302d[_0x259f('0x18')],{'raw':_0x46302d['options']?_0x46302d['options'][_0x259f('0x19')]===undefined?!![]:![]:!![]})[_0x259f('0xc')](function(_0x163d83){logger['info'](_0x259f('0x1a'),_0x46302d);logger['debug'](_0x259f('0x1a'),_0x46302d,JSON['stringify'](_0x163d83));_0xc1796c(_0x163d83);})[_0x259f('0x16')](function(_0x1562c6){logger[_0x259f('0x10')](_0x259f('0x1a'),_0x1562c6['message'],_0x46302d);_0x225d21(_0x4c394c[_0x259f('0x10')](0x1f4,_0x1562c6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ddd5da7..a280304 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 _0x49c4=['chatMessage:','./chatMessage.events','remove','update','emit','register','length'];(function(_0x4a4adc,_0x41acdd){var _0x2a5e85=function(_0x1efb2b){while(--_0x1efb2b){_0x4a4adc['push'](_0x4a4adc['shift']());}};_0x2a5e85(++_0x41acdd);}(_0x49c4,0x9b));var _0x449c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x49c4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0x449c('0x0'));var events=['save',_0x449c('0x1'),_0x449c('0x2')];function createListener(_0x17bf65,_0x1d60ee){return function(_0x2646ac){_0x1d60ee[_0x449c('0x3')](_0x17bf65,_0x2646ac);};}function removeListener(_0x23314e,_0x5b564c){return function(){ChatMessageEvents['removeListener'](_0x23314e,_0x5b564c);};}exports[_0x449c('0x4')]=function(_0x442e56){for(var _0x12586c=0x0,_0x2db09a=events[_0x449c('0x5')];_0x12586c<_0x2db09a;_0x12586c++){var _0x43cb0e=events[_0x12586c];var _0x3e6354=createListener(_0x449c('0x6')+_0x43cb0e,_0x442e56);ChatMessageEvents['on'](_0x43cb0e,_0x3e6354);}}; \ No newline at end of file +var _0x383d=['register','length','remove','update','emit','removeListener'];(function(_0x24b3a2,_0x81eb9c){var _0x236d48=function(_0x31f120){while(--_0x31f120){_0x24b3a2['push'](_0x24b3a2['shift']());}};_0x236d48(++_0x81eb9c);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xd383('0x0'),_0xd383('0x1')];function createListener(_0x35486e,_0x559dd3){return function(_0x7554ef){_0x559dd3[_0xd383('0x2')](_0x35486e,_0x7554ef);};}function removeListener(_0x319f67,_0x3439dd){return function(){ChatMessageEvents[_0xd383('0x3')](_0x319f67,_0x3439dd);};}exports[_0xd383('0x4')]=function(_0x5a0b1d){for(var _0xc64e9b=0x0,_0x30ba82=events[_0xd383('0x5')];_0xc64e9b<_0x30ba82;_0xc64e9b++){var _0x470d8d=events[_0xc64e9b];var _0xffa778=createListener('chatMessage:'+_0x470d8d,_0x5a0b1d);ChatMessageEvents['on'](_0x470d8d,_0xffa778);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 990c0da..27fd9fd 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 _0x4225=['show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x5d95ba,_0x4f4d5d){var _0x375929=function(_0x5b2728){while(--_0x5b2728){_0x5d95ba['push'](_0x5d95ba['shift']());}};_0x375929(++_0x4f4d5d);}(_0x4225,0xdd));var _0x5422=function(_0x271260,_0x1a9d06){_0x271260=_0x271260-0x0;var _0x31041b=_0x4225[_0x271260];return _0x31041b;};'use strict';var multer=require('multer');var util=require(_0x5422('0x0'));var path=require('path');var timeout=require(_0x5422('0x1'));var express=require(_0x5422('0x2'));var router=express[_0x5422('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5422('0x4'));var interaction=require(_0x5422('0x5'));var config=require(_0x5422('0x6'));var controller=require('./chatMessage.controller');router[_0x5422('0x7')]('/',auth['isAuthenticated'](),controller[_0x5422('0x8')]);router[_0x5422('0x7')](_0x5422('0x9'),auth[_0x5422('0xa')](),controller[_0x5422('0xb')]);router[_0x5422('0x7')](_0x5422('0xc'),auth['isAuthenticated'](),controller[_0x5422('0xd')]);router[_0x5422('0xe')]('/',auth[_0x5422('0xa')](),interaction[_0x5422('0xf')](_0x5422('0x10'),_0x5422('0x11')),controller[_0x5422('0x12')]);router[_0x5422('0x13')](_0x5422('0xc'),controller['update']);router['put'](_0x5422('0x14'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x5422('0x15'),auth[_0x5422('0xa')](),controller[_0x5422('0x16')]);router[_0x5422('0x17')]('/:id',auth[_0x5422('0xa')](),controller[_0x5422('0x18')]);module[_0x5422('0x19')]=router; \ No newline at end of file +var _0xa510=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','post','tracked','chatmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','exports','multer','util','path','express','Router'];(function(_0x3c43db,_0x52a979){var _0x3bdc8d=function(_0x1b6862){while(--_0x1b6862){_0x3c43db['push'](_0x3c43db['shift']());}};_0x3bdc8d(++_0x52a979);}(_0xa510,0x1c3));var _0x0a51=function(_0x4e790d,_0x5da06f){_0x4e790d=_0x4e790d-0x0;var _0x3c71e2=_0xa510[_0x4e790d];return _0x3c71e2;};'use strict';var multer=require(_0x0a51('0x0'));var util=require(_0x0a51('0x1'));var path=require(_0x0a51('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a51('0x3'));var router=express[_0x0a51('0x4')]();var fs_extra=require(_0x0a51('0x5'));var auth=require(_0x0a51('0x6'));var interaction=require(_0x0a51('0x7'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x0a51('0x8')]('/',auth[_0x0a51('0x9')](),controller['index']);router['get'](_0x0a51('0xa'),auth[_0x0a51('0x9')](),controller['describe']);router['get'](_0x0a51('0xb'),auth[_0x0a51('0x9')](),controller[_0x0a51('0xc')]);router[_0x0a51('0xd')]('/',auth[_0x0a51('0x9')](),interaction[_0x0a51('0xe')]('chat',_0x0a51('0xf')),controller[_0x0a51('0x10')]);router['put']('/:id',controller[_0x0a51('0x11')]);router[_0x0a51('0x12')](_0x0a51('0x13'),auth[_0x0a51('0x9')](),controller['accept']);router[_0x0a51('0x12')](_0x0a51('0x14'),auth[_0x0a51('0x9')](),controller[_0x0a51('0x15')]);router[_0x0a51('0x16')](_0x0a51('0xb'),auth[_0x0a51('0x9')](),controller['destroy']);module[_0x0a51('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 46ca9df..d43f1b2 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f288d,_0x3c7a97){_0x3f288d=_0x3f288d-0x0;var _0x5e8468=_0x0b0e[_0x3f288d];return _0x5e8468;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3e079f,_0x189e15){_0x3e079f=_0x3e079f-0x0;var _0x296a34=_0x0b0e[_0x3e079f];return _0x296a34;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c0e6fa1..3f20f68 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(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x656205,_0x17cf3a){_0x656205=_0x656205-0x0;var _0x4315c3=_0x7a54[_0x656205];return _0x4315c3;};'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(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x7a54,0x106));var _0x47a5=function(_0x1b30f2,_0x12a2e6){_0x1b30f2=_0x1b30f2-0x0;var _0x4961c8=_0x7a54[_0x1b30f2];return _0x4961c8;};'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 07c2e42..615c884 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 _0xe4cd=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','remove'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xe4cd,0x84));var _0xde4c=function(_0x24f664,_0x14dc5b){_0x24f664=_0x24f664-0x0;var _0x100986=_0xe4cd[_0x24f664];return _0x100986;};'use strict';var EventEmitter=require(_0xde4c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xde4c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xde4c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xde4c('0x3')};function emitEvent(_0x390ebb){return function(_0x166526,_0x5d6596,_0x483947){ChatOfflineMessageEvents[_0xde4c('0x4')](_0x390ebb+':'+_0x166526['id'],_0x166526);ChatOfflineMessageEvents[_0xde4c('0x4')](_0x390ebb,_0x166526);_0x483947(null);};}for(var e in events){if(events[_0xde4c('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xde4c('0x6')](e,emitEvent(event));}}module[_0xde4c('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x95a2=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x499086,_0x6230eb){var _0x45fa1e=function(_0x27af06){while(--_0x27af06){_0x499086['push'](_0x499086['shift']());}};_0x45fa1e(++_0x6230eb);}(_0x95a2,0x1e1));var _0x295a=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0x95a2[_0x507597];return _0x110a0f;};'use strict';var EventEmitter=require(_0x295a('0x0'));var ChatOfflineMessage=require(_0x295a('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x295a('0x2')](0x0);var events={'afterCreate':_0x295a('0x3'),'afterUpdate':_0x295a('0x4'),'afterDestroy':_0x295a('0x5')};function emitEvent(_0x5871e7){return function(_0x2734b4,_0x4b844a,_0x1625b8){ChatOfflineMessageEvents['emit'](_0x5871e7+':'+_0x2734b4['id'],_0x2734b4);ChatOfflineMessageEvents[_0x295a('0x6')](_0x5871e7,_0x2734b4);_0x1625b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x295a('0x7')](e,emitEvent(event));}}module[_0x295a('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 20bb73d..06ea494 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 _0x42bf=['define','ChatOfflineMessage','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x146d84,_0x52243b){var _0x50ae3e=function(_0x84f067){while(--_0x84f067){_0x146d84['push'](_0x146d84['shift']());}};_0x50ae3e(++_0x52243b);}(_0x42bf,0x94));var _0xf42b=function(_0x4408ff,_0x57cbdf){_0x4408ff=_0x4408ff-0x0;var _0x8edbd2=_0x42bf[_0x4408ff];return _0x8edbd2;};'use strict';var attributes=require(_0xf42b('0x0'));module[_0xf42b('0x1')]=function(_0xc2d93){return _0xc2d93[_0xf42b('0x2')](_0xf42b('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf42b('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbd19=['ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes','exports','define'];(function(_0x4474c2,_0x59cf02){var _0x435fbb=function(_0x3c86eb){while(--_0x3c86eb){_0x4474c2['push'](_0x4474c2['shift']());}};_0x435fbb(++_0x59cf02);}(_0xbd19,0x98));var _0x9bd1=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xbd19[_0x4792c8];return _0x35edb1;};'use strict';var attributes=require(_0x9bd1('0x0'));module[_0x9bd1('0x1')]=function(_0x48fae0){return _0x48fae0[_0x9bd1('0x2')](_0x9bd1('0x3'),attributes,{'tableName':_0x9bd1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 c4e403f..be17365 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 _0x8644=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x8644,0x12a));var _0x4864=function(_0x2ce0a2,_0x1529ae){_0x2ce0a2=_0x2ce0a2-0x0;var _0x201721=_0x8644[_0x2ce0a2];return _0x201721;};'use strict';var _=require(_0x4864('0x0'));var util=require(_0x4864('0x1'));var moment=require(_0x4864('0x2'));var BPromise=require(_0x4864('0x3'));var rs=require(_0x4864('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4864('0x5'));var logger=require(_0x4864('0x6'))(_0x4864('0x7'));var config=require(_0x4864('0x8'));var jayson=require(_0x4864('0x9'));var client=jayson[_0x4864('0xa')][_0x4864('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x579b83,_0x54e019,_0x28b62d){return new BPromise(function(_0x3be4fb,_0x1a40d4){return client[_0x4864('0xc')](_0x579b83,_0x28b62d)[_0x4864('0xd')](function(_0x8ff63a){logger[_0x4864('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x54e019,'request\x20sent');logger[_0x4864('0xf')](_0x4864('0x10'),_0x54e019,_0x4864('0x11'),JSON['stringify'](_0x8ff63a));if(_0x8ff63a[_0x4864('0x12')]){if(_0x8ff63a[_0x4864('0x12')][_0x4864('0x13')]===0x1f4){logger[_0x4864('0x12')](_0x4864('0x14'),_0x54e019,_0x8ff63a[_0x4864('0x12')][_0x4864('0x15')]);return _0x1a40d4(_0x8ff63a[_0x4864('0x12')]['message']);}logger[_0x4864('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x54e019,_0x8ff63a[_0x4864('0x12')][_0x4864('0x15')]);return _0x3be4fb(_0x8ff63a['error'][_0x4864('0x15')]);}else{logger[_0x4864('0xe')](_0x4864('0x14'),_0x54e019,_0x4864('0x11'));_0x3be4fb(_0x8ff63a[_0x4864('0x16')][_0x4864('0x15')]);}})['catch'](function(_0x57cd1b){logger[_0x4864('0x12')](_0x4864('0x14'),_0x54e019,_0x57cd1b);_0x1a40d4(_0x57cd1b);});});} \ No newline at end of file +var _0x810c=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0x810c,0x1a5));var _0xc810=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x810c[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0xc810('0x0'));var util=require(_0xc810('0x1'));var moment=require('moment');var BPromise=require(_0xc810('0x2'));var rs=require(_0xc810('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc810('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc810('0x5'))(_0xc810('0x6'));var config=require(_0xc810('0x7'));var jayson=require(_0xc810('0x8'));var client=jayson[_0xc810('0x9')][_0xc810('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a729,_0x567ac0,_0x227fd4){return new BPromise(function(_0x4bb524,_0x1799f8){return client[_0xc810('0xb')](_0x38a729,_0x227fd4)[_0xc810('0xc')](function(_0x39c855){logger[_0xc810('0xd')](_0xc810('0xe'),_0x567ac0,_0xc810('0xf'));logger[_0xc810('0x10')](_0xc810('0x11'),_0x567ac0,'request\x20sent',JSON[_0xc810('0x12')](_0x39c855));if(_0x39c855[_0xc810('0x13')]){if(_0x39c855[_0xc810('0x13')][_0xc810('0x14')]===0x1f4){logger[_0xc810('0x13')](_0xc810('0xe'),_0x567ac0,_0x39c855[_0xc810('0x13')][_0xc810('0x15')]);return _0x1799f8(_0x39c855[_0xc810('0x13')]['message']);}logger[_0xc810('0x13')](_0xc810('0xe'),_0x567ac0,_0x39c855[_0xc810('0x13')][_0xc810('0x15')]);return _0x4bb524(_0x39c855[_0xc810('0x13')][_0xc810('0x15')]);}else{logger['info'](_0xc810('0xe'),_0x567ac0,'request\x20sent');_0x4bb524(_0x39c855[_0xc810('0x16')][_0xc810('0x15')]);}})[_0xc810('0x17')](function(_0x278d82){logger['error'](_0xc810('0xe'),_0x567ac0,_0x278d82);_0x1799f8(_0x278d82);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3c35918..f14e71f 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 _0xe102=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete'];(function(_0x313e62,_0x51d3a1){var _0x568cdc=function(_0x3120fc){while(--_0x3120fc){_0x313e62['push'](_0x313e62['shift']());}};_0x568cdc(++_0x51d3a1);}(_0xe102,0x17b));var _0x2e10=function(_0x430389,_0xe91da5){_0x430389=_0x430389-0x0;var _0x3b613c=_0xe102[_0x430389];return _0x3b613c;};'use strict';var multer=require(_0x2e10('0x0'));var util=require(_0x2e10('0x1'));var path=require('path');var timeout=require(_0x2e10('0x2'));var express=require(_0x2e10('0x3'));var router=express[_0x2e10('0x4')]();var fs_extra=require(_0x2e10('0x5'));var auth=require(_0x2e10('0x6'));var interaction=require(_0x2e10('0x7'));var config=require(_0x2e10('0x8'));var controller=require(_0x2e10('0x9'));router[_0x2e10('0xa')]('/',auth[_0x2e10('0xb')](),controller[_0x2e10('0xc')]);router[_0x2e10('0xa')](_0x2e10('0xd'),auth[_0x2e10('0xb')](),controller[_0x2e10('0xe')]);router[_0x2e10('0xa')](_0x2e10('0xf'),auth[_0x2e10('0xb')](),controller[_0x2e10('0x10')]);router['post']('/',auth[_0x2e10('0xb')](),controller[_0x2e10('0x11')]);router['put']('/:id',auth[_0x2e10('0xb')](),controller[_0x2e10('0x12')]);router[_0x2e10('0x13')](_0x2e10('0xf'),auth['isAuthenticated'](),controller[_0x2e10('0x14')]);module['exports']=router; \ No newline at end of file +var _0xba06=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xba06,0x1e1));var _0x6ba0=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xba06[_0x2962d5];return _0x273406;};'use strict';var multer=require(_0x6ba0('0x0'));var util=require(_0x6ba0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6ba0('0x2'));var router=express[_0x6ba0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ba0('0x4'));var interaction=require(_0x6ba0('0x5'));var config=require(_0x6ba0('0x6'));var controller=require(_0x6ba0('0x7'));router[_0x6ba0('0x8')]('/',auth[_0x6ba0('0x9')](),controller[_0x6ba0('0xa')]);router[_0x6ba0('0x8')](_0x6ba0('0xb'),auth[_0x6ba0('0x9')](),controller['describe']);router[_0x6ba0('0x8')](_0x6ba0('0xc'),auth[_0x6ba0('0x9')](),controller[_0x6ba0('0xd')]);router[_0x6ba0('0xe')]('/',auth['isAuthenticated'](),controller[_0x6ba0('0xf')]);router[_0x6ba0('0x10')](_0x6ba0('0xc'),auth['isAuthenticated'](),controller[_0x6ba0('0x11')]);router[_0x6ba0('0x12')](_0x6ba0('0xc'),auth[_0x6ba0('0x9')](),controller[_0x6ba0('0x13')]);module[_0x6ba0('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 67ca624..e3336d3 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 _0x8459=['sequelize','exports','ENUM','mouseOver','INTEGER'];(function(_0x6ba0de,_0x5a0932){var _0x228528=function(_0x3b753c){while(--_0x3b753c){_0x6ba0de['push'](_0x6ba0de['shift']());}};_0x228528(++_0x5a0932);}(_0x8459,0xb9));var _0x9845=function(_0x2174dd,_0x329789){_0x2174dd=_0x2174dd-0x0;var _0x22791a=_0x8459[_0x2174dd];return _0x22791a;};'use strict';var Sequelize=require(_0x9845('0x0'));module[_0x9845('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9845('0x2')](_0x9845('0x3'),'timeout'),'defaultValue':_0x9845('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9845('0x4')]}}; \ No newline at end of file +var _0xb130=['sequelize','STRING','mouseOver','timeout','INTEGER'];(function(_0x54514c,_0xf1c84a){var _0x5cd80e=function(_0x186444){while(--_0x186444){_0x54514c['push'](_0x54514c['shift']());}};_0x5cd80e(++_0xf1c84a);}(_0xb130,0xff));var _0x0b13=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xb130[_0x3f3a47];return _0x57a682;};'use strict';var Sequelize=require(_0x0b13('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b13('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0b13('0x2'),_0x0b13('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0b13('0x1')]},'timeout':{'type':Sequelize[_0x0b13('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 51182d4..af6e172 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 _0x43f3=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','update','then','destroy','end','error','name','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','create','body','catch','params','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x48cc05,_0x99c831){var _0x5aa91f=function(_0x64b452){while(--_0x64b452){_0x48cc05['push'](_0x48cc05['shift']());}};_0x5aa91f(++_0x99c831);}(_0x43f3,0xab));var _0x343f=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x43f3[_0x270adf];return _0x29eda9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x343f('0x0'));var zipdir=require(_0x343f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x343f('0x2'));var moment=require('moment');var BPromise=require(_0x343f('0x3'));var Mustache=require('mustache');var util=require(_0x343f('0x4'));var path=require(_0x343f('0x5'));var sox=require(_0x343f('0x6'));var csv=require('to-csv');var ejs=require(_0x343f('0x7'));var fs=require('fs');var fs_extra=require(_0x343f('0x8'));var _=require(_0x343f('0x9'));var squel=require(_0x343f('0xa'));var crypto=require(_0x343f('0xb'));var jsforce=require(_0x343f('0xc'));var deskjs=require(_0x343f('0xd'));var toCsv=require(_0x343f('0xe'));var querystring=require(_0x343f('0xf'));var Papa=require(_0x343f('0x10'));var Redis=require(_0x343f('0x11'));var authService=require(_0x343f('0x12'));var qs=require(_0x343f('0x13'));var as=require(_0x343f('0x14'));var hardwareService=require(_0x343f('0x15'));var logger=require(_0x343f('0x16'))(_0x343f('0x17'));var utils=require(_0x343f('0x18'));var config=require(_0x343f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x343f('0x1a'))['db'];function respondWithStatusCode(_0x524b21,_0x47dd74){_0x47dd74=_0x47dd74||0xcc;return function(_0xa3f54){if(_0xa3f54){return _0x524b21[_0x343f('0x1b')](_0x47dd74);}return _0x524b21['status'](_0x47dd74)['end']();};}function respondWithResult(_0x3dbbd3,_0x552c07){_0x552c07=_0x552c07||0xc8;return function(_0x414029){if(_0x414029){return _0x3dbbd3['status'](_0x552c07)[_0x343f('0x1c')](_0x414029);}};}function respondWithFilteredResult(_0x950400,_0x1c399c){return function(_0x45ddab){if(_0x45ddab){var _0x189d1b=typeof _0x1c399c['offset']==='undefined'&&typeof _0x1c399c[_0x343f('0x1d')]===_0x343f('0x1e');var _0x199774=_0x45ddab[_0x343f('0x1f')];var _0x3dd83a=_0x189d1b?0x0:_0x1c399c[_0x343f('0x20')];var _0x47a6e1=_0x189d1b?_0x45ddab[_0x343f('0x1f')]:_0x1c399c[_0x343f('0x20')]+_0x1c399c[_0x343f('0x1d')];var _0x1637d9;if(_0x47a6e1>=_0x199774){_0x47a6e1=_0x199774;_0x1637d9=0xc8;}else{_0x1637d9=0xce;}_0x950400[_0x343f('0x21')](_0x1637d9);return _0x950400[_0x343f('0x22')](_0x343f('0x23'),_0x3dd83a+'-'+_0x47a6e1+'/'+_0x199774)[_0x343f('0x1c')](_0x45ddab);}return null;};}function patchUpdates(_0x48ff0){return function(_0x3a0352){try{jsonpatch[_0x343f('0x24')](_0x3a0352,_0x48ff0,!![]);}catch(_0xb3e39f){return BPromise[_0x343f('0x25')](_0xb3e39f);}return _0x3a0352['save']();};}function saveUpdates(_0x3128fd,_0x577f87){return function(_0x24d568){if(_0x24d568){return _0x24d568[_0x343f('0x26')](_0x3128fd)[_0x343f('0x27')](function(_0x302141){return _0x302141;});}return null;};}function removeEntity(_0x489eaa,_0x40c9ae){return function(_0x78a79e){if(_0x78a79e){return _0x78a79e[_0x343f('0x28')]()[_0x343f('0x27')](function(){_0x489eaa[_0x343f('0x21')](0xcc)[_0x343f('0x29')]();});}};}function handleEntityNotFound(_0x25d61b,_0x3de478){return function(_0x1f5e47){if(!_0x1f5e47){_0x25d61b[_0x343f('0x1b')](0x194);}return _0x1f5e47;};}function handleError(_0x169fdb,_0x32e79b){_0x32e79b=_0x32e79b||0x1f4;return function(_0x38f6f6){logger[_0x343f('0x2a')](_0x38f6f6['stack']);if(_0x38f6f6[_0x343f('0x2b')]){delete _0x38f6f6[_0x343f('0x2b')];}_0x169fdb[_0x343f('0x21')](_0x32e79b)['send'](_0x38f6f6);};}exports[_0x343f('0x2c')]=function(_0x2304d4,_0x3ad183){var _0x1b2023={'raw':!![],'where':{'id':_0x2304d4['params']['id']}},_0x23477a={};_0x23477a[_0x343f('0x2d')]=_[_0x343f('0x2e')](db['ChatProactiveAction']['rawAttributes']);_0x23477a['query']=_['keys'](_0x2304d4[_0x343f('0x2f')]);_0x23477a[_0x343f('0x30')]=_['intersection'](_0x23477a[_0x343f('0x2d')],_0x23477a[_0x343f('0x2f')]);_0x1b2023['attributes']=_[_0x343f('0x31')](_0x23477a['model'],qs[_0x343f('0x32')](_0x2304d4[_0x343f('0x2f')][_0x343f('0x32')]));_0x1b2023[_0x343f('0x33')]=_0x1b2023['attributes'][_0x343f('0x34')]?_0x1b2023['attributes']:_0x23477a[_0x343f('0x2d')];if(_0x2304d4[_0x343f('0x2f')][_0x343f('0x35')]){_0x1b2023[_0x343f('0x36')]=[{'all':!![]}];}_0x1b2023=_[_0x343f('0x37')]({},_0x1b2023,_0x2304d4[_0x343f('0x38')]);return db[_0x343f('0x39')][_0x343f('0x3a')](_0x1b2023)[_0x343f('0x27')](handleEntityNotFound(_0x3ad183,null))['then'](respondWithResult(_0x3ad183,null))['catch'](handleError(_0x3ad183,null));};exports[_0x343f('0x3b')]=function(_0x11df7b,_0x2d3ac8){return db[_0x343f('0x39')][_0x343f('0x3b')](_0x11df7b[_0x343f('0x3c')],{})['then'](respondWithResult(_0x2d3ac8,0xc9))[_0x343f('0x3d')](handleError(_0x2d3ac8,null));};exports[_0x343f('0x26')]=function(_0x4c1fde,_0x1803fa){if(_0x4c1fde['body']['id']){delete _0x4c1fde[_0x343f('0x3c')]['id'];}return db['ChatProactiveAction'][_0x343f('0x3a')]({'where':{'id':_0x4c1fde[_0x343f('0x3e')]['id']}})[_0x343f('0x27')](handleEntityNotFound(_0x1803fa,null))['then'](saveUpdates(_0x4c1fde[_0x343f('0x3c')],null))['then'](respondWithResult(_0x1803fa,null))[_0x343f('0x3d')](handleError(_0x1803fa,null));};exports[_0x343f('0x28')]=function(_0x57ea23,_0x1179df){return db[_0x343f('0x39')][_0x343f('0x3a')]({'where':{'id':_0x57ea23['params']['id']}})[_0x343f('0x27')](handleEntityNotFound(_0x1179df,null))['then'](removeEntity(_0x1179df,null))[_0x343f('0x3d')](handleError(_0x1179df,null));}; \ No newline at end of file +var _0xcca7=['query','keys','filters','intersection','attributes','model','length','includeAll','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','end','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','show','params','ChatProactiveAction','rawAttributes'];(function(_0x360b46,_0x48633a){var _0x5183ec=function(_0x531627){while(--_0x531627){_0x360b46['push'](_0x360b46['shift']());}};_0x5183ec(++_0x48633a);}(_0xcca7,0x1aa));var _0x7cca=function(_0x106863,_0x578c55){_0x106863=_0x106863-0x0;var _0x55b7e7=_0xcca7[_0x106863];return _0x55b7e7;};'use strict';var emlformat=require(_0x7cca('0x0'));var rimraf=require(_0x7cca('0x1'));var zipdir=require(_0x7cca('0x2'));var jsonpatch=require(_0x7cca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7cca('0x4'));var Mustache=require('mustache');var util=require(_0x7cca('0x5'));var path=require(_0x7cca('0x6'));var sox=require(_0x7cca('0x7'));var csv=require(_0x7cca('0x8'));var ejs=require(_0x7cca('0x9'));var fs=require('fs');var fs_extra=require(_0x7cca('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cca('0xb'));var jsforce=require(_0x7cca('0xc'));var deskjs=require(_0x7cca('0xd'));var toCsv=require(_0x7cca('0x8'));var querystring=require(_0x7cca('0xe'));var Papa=require(_0x7cca('0xf'));var Redis=require(_0x7cca('0x10'));var authService=require(_0x7cca('0x11'));var qs=require(_0x7cca('0x12'));var as=require(_0x7cca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cca('0x14'))(_0x7cca('0x15'));var utils=require(_0x7cca('0x16'));var config=require(_0x7cca('0x17'));var licenseUtil=require(_0x7cca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a14cc,_0x41e0a2){_0x41e0a2=_0x41e0a2||0xcc;return function(_0x2854c7){if(_0x2854c7){return _0x2a14cc['sendStatus'](_0x41e0a2);}return _0x2a14cc['status'](_0x41e0a2)[_0x7cca('0x19')]();};}function respondWithResult(_0x20c1b2,_0x27d671){_0x27d671=_0x27d671||0xc8;return function(_0x847cce){if(_0x847cce){return _0x20c1b2[_0x7cca('0x1a')](_0x27d671)[_0x7cca('0x1b')](_0x847cce);}};}function respondWithFilteredResult(_0x45143d,_0x5a357d){return function(_0x216d4b){if(_0x216d4b){var _0x533608=typeof _0x5a357d['offset']==='undefined'&&typeof _0x5a357d[_0x7cca('0x1c')]===_0x7cca('0x1d');var _0x1dd043=_0x216d4b[_0x7cca('0x1e')];var _0x44294b=_0x533608?0x0:_0x5a357d['offset'];var _0xb35e1d=_0x533608?_0x216d4b['count']:_0x5a357d['offset']+_0x5a357d['limit'];var _0x370469;if(_0xb35e1d>=_0x1dd043){_0xb35e1d=_0x1dd043;_0x370469=0xc8;}else{_0x370469=0xce;}_0x45143d[_0x7cca('0x1a')](_0x370469);return _0x45143d[_0x7cca('0x1f')](_0x7cca('0x20'),_0x44294b+'-'+_0xb35e1d+'/'+_0x1dd043)[_0x7cca('0x1b')](_0x216d4b);}return null;};}function patchUpdates(_0x45db2f){return function(_0x2e023c){try{jsonpatch[_0x7cca('0x21')](_0x2e023c,_0x45db2f,!![]);}catch(_0x4d7804){return BPromise[_0x7cca('0x22')](_0x4d7804);}return _0x2e023c[_0x7cca('0x23')]();};}function saveUpdates(_0x165d13,_0x4343a3){return function(_0x55b689){if(_0x55b689){return _0x55b689[_0x7cca('0x24')](_0x165d13)[_0x7cca('0x25')](function(_0x4367f9){return _0x4367f9;});}return null;};}function removeEntity(_0x119d76,_0x823d7d){return function(_0x3fc157){if(_0x3fc157){return _0x3fc157[_0x7cca('0x26')]()[_0x7cca('0x25')](function(){_0x119d76['status'](0xcc)[_0x7cca('0x19')]();});}};}function handleEntityNotFound(_0x1dd3b3,_0x1774fc){return function(_0xdaf07f){if(!_0xdaf07f){_0x1dd3b3[_0x7cca('0x27')](0x194);}return _0xdaf07f;};}function handleError(_0x21da68,_0x35ebe8){_0x35ebe8=_0x35ebe8||0x1f4;return function(_0x40ac86){logger['error'](_0x40ac86[_0x7cca('0x28')]);if(_0x40ac86['name']){delete _0x40ac86[_0x7cca('0x29')];}_0x21da68[_0x7cca('0x1a')](_0x35ebe8)['send'](_0x40ac86);};}exports[_0x7cca('0x2a')]=function(_0x3d91b1,_0x5533fb){var _0x249442={'raw':!![],'where':{'id':_0x3d91b1[_0x7cca('0x2b')]['id']}},_0x1cd53a={};_0x1cd53a['model']=_['keys'](db[_0x7cca('0x2c')][_0x7cca('0x2d')]);_0x1cd53a[_0x7cca('0x2e')]=_[_0x7cca('0x2f')](_0x3d91b1[_0x7cca('0x2e')]);_0x1cd53a[_0x7cca('0x30')]=_[_0x7cca('0x31')](_0x1cd53a['model'],_0x1cd53a['query']);_0x249442[_0x7cca('0x32')]=_[_0x7cca('0x31')](_0x1cd53a[_0x7cca('0x33')],qs['fields'](_0x3d91b1[_0x7cca('0x2e')]['fields']));_0x249442[_0x7cca('0x32')]=_0x249442[_0x7cca('0x32')][_0x7cca('0x34')]?_0x249442[_0x7cca('0x32')]:_0x1cd53a['model'];if(_0x3d91b1[_0x7cca('0x2e')][_0x7cca('0x35')]){_0x249442[_0x7cca('0x36')]=[{'all':!![]}];}_0x249442=_['merge']({},_0x249442,_0x3d91b1['options']);return db['ChatProactiveAction'][_0x7cca('0x37')](_0x249442)[_0x7cca('0x25')](handleEntityNotFound(_0x5533fb,null))['then'](respondWithResult(_0x5533fb,null))[_0x7cca('0x38')](handleError(_0x5533fb,null));};exports[_0x7cca('0x39')]=function(_0x193a4c,_0x1d6db0){return db[_0x7cca('0x2c')][_0x7cca('0x39')](_0x193a4c[_0x7cca('0x3a')],{})['then'](respondWithResult(_0x1d6db0,0xc9))[_0x7cca('0x38')](handleError(_0x1d6db0,null));};exports[_0x7cca('0x24')]=function(_0x4128e5,_0x147cf8){if(_0x4128e5['body']['id']){delete _0x4128e5[_0x7cca('0x3a')]['id'];}return db[_0x7cca('0x2c')][_0x7cca('0x37')]({'where':{'id':_0x4128e5['params']['id']}})[_0x7cca('0x25')](handleEntityNotFound(_0x147cf8,null))['then'](saveUpdates(_0x4128e5[_0x7cca('0x3a')],null))[_0x7cca('0x25')](respondWithResult(_0x147cf8,null))[_0x7cca('0x38')](handleError(_0x147cf8,null));};exports[_0x7cca('0x26')]=function(_0x44fbd7,_0x25b3a9){return db[_0x7cca('0x2c')][_0x7cca('0x37')]({'where':{'id':_0x44fbd7[_0x7cca('0x2b')]['id']}})['then'](handleEntityNotFound(_0x25b3a9,null))['then'](removeEntity(_0x25b3a9,null))[_0x7cca('0x38')](handleError(_0x25b3a9,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index cf6cd06..8b885cd 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 _0x1c3f=['lodash','util','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x8acfd3,_0x2d21a3){var _0x3f89da=function(_0x387acf){while(--_0x387acf){_0x8acfd3['push'](_0x8acfd3['shift']());}};_0x3f89da(++_0x2d21a3);}(_0x1c3f,0x197));var _0xf1c3=function(_0x3fb22d,_0x4d997b){_0x3fb22d=_0x3fb22d-0x0;var _0x42b188=_0x1c3f[_0x3fb22d];return _0x42b188;};'use strict';var _=require(_0xf1c3('0x0'));var util=require(_0xf1c3('0x1'));var logger=require('../../config/logger')(_0xf1c3('0x2'));var moment=require(_0xf1c3('0x3'));var BPromise=require(_0xf1c3('0x4'));var rp=require(_0xf1c3('0x5'));var fs=require('fs');var path=require(_0xf1c3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf1c3('0x7'));module[_0xf1c3('0x8')]=function(_0x69cefd,_0x234310){return _0x69cefd['define'](_0xf1c3('0x9'),attributes,{'tableName':_0xf1c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b36=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction'];(function(_0x4bc2ab,_0x504762){var _0x24d81f=function(_0x4e721d){while(--_0x4e721d){_0x4bc2ab['push'](_0x4bc2ab['shift']());}};_0x24d81f(++_0x504762);}(_0x3b36,0x79));var _0x63b3=function(_0x4fc5ad,_0x13d51d){_0x4fc5ad=_0x4fc5ad-0x0;var _0x19fca4=_0x3b36[_0x4fc5ad];return _0x19fca4;};'use strict';var _=require(_0x63b3('0x0'));var util=require(_0x63b3('0x1'));var logger=require(_0x63b3('0x2'))(_0x63b3('0x3'));var moment=require(_0x63b3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x63b3('0x5'));var attributes=require(_0x63b3('0x6'));module[_0x63b3('0x7')]=function(_0x12b7d8,_0x1f9578){return _0x12b7d8['define'](_0x63b3('0x8'),attributes,{'tableName':_0x63b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index e4a7906..ac2a5c7 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 _0xd919=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x672af5,_0x3453b6){var _0x1c4161=function(_0x26143e){while(--_0x26143e){_0x672af5['push'](_0x672af5['shift']());}};_0x1c4161(++_0x3453b6);}(_0xd919,0x68));var _0x9d91=function(_0x5e952b,_0x2a7516){_0x5e952b=_0x5e952b-0x0;var _0xffb091=_0xd919[_0x5e952b];return _0xffb091;};'use strict';var _=require(_0x9d91('0x0'));var util=require(_0x9d91('0x1'));var moment=require(_0x9d91('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d91('0x4'))['db'];var utils=require(_0x9d91('0x5'));var logger=require(_0x9d91('0x6'))(_0x9d91('0x7'));var config=require(_0x9d91('0x8'));var jayson=require(_0x9d91('0x9'));var client=jayson[_0x9d91('0xa')][_0x9d91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ae730,_0x394b6b,_0x31efbb){return new BPromise(function(_0x524fa4,_0x4c7fe0){return client['request'](_0x4ae730,_0x31efbb)[_0x9d91('0xc')](function(_0x5cddbd){logger[_0x9d91('0xd')](_0x9d91('0xe'),_0x394b6b,_0x9d91('0xf'));logger[_0x9d91('0x10')](_0x9d91('0x11'),_0x394b6b,'request\x20sent',JSON['stringify'](_0x5cddbd));if(_0x5cddbd[_0x9d91('0x12')]){if(_0x5cddbd[_0x9d91('0x12')][_0x9d91('0x13')]===0x1f4){logger[_0x9d91('0x12')](_0x9d91('0xe'),_0x394b6b,_0x5cddbd[_0x9d91('0x12')][_0x9d91('0x14')]);return _0x4c7fe0(_0x5cddbd[_0x9d91('0x12')]['message']);}logger['error'](_0x9d91('0xe'),_0x394b6b,_0x5cddbd[_0x9d91('0x12')][_0x9d91('0x14')]);return _0x524fa4(_0x5cddbd['error'][_0x9d91('0x14')]);}else{logger[_0x9d91('0xd')](_0x9d91('0xe'),_0x394b6b,_0x9d91('0xf'));_0x524fa4(_0x5cddbd['result'][_0x9d91('0x14')]);}})[_0x9d91('0x15')](function(_0x73d38b){logger['error'](_0x9d91('0xe'),_0x394b6b,_0x73d38b);_0x4c7fe0(_0x73d38b);});});} \ No newline at end of file +var _0xdbbe=['info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x43f638,_0x45397c){var _0x30d91f=function(_0x458acb){while(--_0x458acb){_0x43f638['push'](_0x43f638['shift']());}};_0x30d91f(++_0x45397c);}(_0xdbbe,0xdb));var _0xedbb=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0xdbbe[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0xedbb('0x0'));var util=require(_0xedbb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xedbb('0x2'));var fs=require('fs');var Redis=require(_0xedbb('0x3'));var db=require(_0xedbb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedbb('0x5'))(_0xedbb('0x6'));var config=require('../../config/environment');var jayson=require(_0xedbb('0x7'));var client=jayson[_0xedbb('0x8')][_0xedbb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb33,_0x3aafd0,_0x2128f3){return new BPromise(function(_0x395438,_0x370efb){return client[_0xedbb('0xa')](_0x2bdb33,_0x2128f3)[_0xedbb('0xb')](function(_0x55fc2f){logger[_0xedbb('0xc')](_0xedbb('0xd'),_0x3aafd0,'request\x20sent');logger['debug'](_0xedbb('0xe'),_0x3aafd0,'request\x20sent',JSON['stringify'](_0x55fc2f));if(_0x55fc2f[_0xedbb('0xf')]){if(_0x55fc2f[_0xedbb('0xf')][_0xedbb('0x10')]===0x1f4){logger[_0xedbb('0xf')](_0xedbb('0xd'),_0x3aafd0,_0x55fc2f[_0xedbb('0xf')]['message']);return _0x370efb(_0x55fc2f[_0xedbb('0xf')][_0xedbb('0x11')]);}logger['error'](_0xedbb('0xd'),_0x3aafd0,_0x55fc2f['error'][_0xedbb('0x11')]);return _0x395438(_0x55fc2f[_0xedbb('0xf')]['message']);}else{logger[_0xedbb('0xc')](_0xedbb('0xd'),_0x3aafd0,_0xedbb('0x12'));_0x395438(_0x55fc2f[_0xedbb('0x13')][_0xedbb('0x11')]);}})[_0xedbb('0x14')](function(_0x3a23aa){logger[_0xedbb('0xf')](_0xedbb('0xd'),_0x3aafd0,_0x3a23aa);_0x370efb(_0x3a23aa);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 10a2fcf..a5f770b 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 _0x207c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x1f13bf,_0x530bf1){var _0x1005d5=function(_0x48ca96){while(--_0x48ca96){_0x1f13bf['push'](_0x1f13bf['shift']());}};_0x1005d5(++_0x530bf1);}(_0x207c,0x1e8));var _0xc207=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x207c[_0x2c9b79];return _0x265032;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router[_0xc207('0xa')]('/',auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')](_0xc207('0xd'),auth[_0xc207('0x8')](),controller[_0xc207('0x10')]);module[_0xc207('0x11')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x530a21,_0x3c8577){_0x530a21=_0x530a21-0x0;var _0x300d32=_0xb4c7[_0x530a21];return _0x300d32;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index e4e7619..35ee4a4 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 _0xc21b=['STRING','INTEGER','ENUM','beepall'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xc21b,0xb8));var _0xbc21=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0xc21b[_0x20beae];return _0xf5725;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbc21('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbc21('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbc21('0x2')]('rrmemory',_0xbc21('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x7dda=['name','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x26c311,_0x26a54c){var _0x75f1b7=function(_0x15e470){while(--_0x15e470){_0x26c311['push'](_0x26c311['shift']());}};_0x75f1b7(++_0x26a54c);}(_0x7dda,0x14e));var _0xa7dd=function(_0x2bdecf,_0x5e9717){_0x2bdecf=_0x2bdecf-0x0;var _0x48882a=_0x7dda[_0x2bdecf];return _0x48882a;};'use strict';var Sequelize=require('sequelize');module[_0xa7dd('0x0')]={'name':{'type':Sequelize[_0xa7dd('0x1')],'unique':_0xa7dd('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7dd('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7dd('0x3')](_0xa7dd('0x4'),_0xa7dd('0x5'),_0xa7dd('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f7dd66b..37cbbbe 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 _0x402a=['get','ChatQueues','UserProfileResource','end','error','name','send','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','length','includeAll','merge','options','user','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','fields','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x402a,0x153));var _0xa402=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x402a[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0xa402('0x0'));var util=require(_0xa402('0x1'));var _=require(_0xa402('0x2'));var squel=require(_0xa402('0x3'));var Redis=require(_0xa402('0x4'));var qs=require(_0xa402('0x5'));var logger=require('../../config/logger')(_0xa402('0x6'));var config=require(_0xa402('0x7'));var db=require(_0xa402('0x8'))['db'];config[_0xa402('0x9')]=_['defaults'](config[_0xa402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa402('0xa'))[_0xa402('0xb')](socket);function respondWithStatusCode(_0x5d886e,_0x36743a){_0x36743a=_0x36743a||0xcc;return function(_0x5f0ab6){if(_0x5f0ab6){return _0x5d886e[_0xa402('0xc')](_0x36743a);}return _0x5d886e[_0xa402('0xd')](_0x36743a)['end']();};}function respondWithResult(_0x391d65,_0x5e9933){_0x5e9933=_0x5e9933||0xc8;return function(_0x5d4444){if(_0x5d4444){return _0x391d65['status'](_0x5e9933)[_0xa402('0xe')](_0x5d4444);}};}function respondWithFilteredResult(_0x561b32,_0x2c438d){return function(_0x5c64a8){if(_0x5c64a8){var _0x54c9fe=typeof _0x2c438d[_0xa402('0xf')]===_0xa402('0x10')&&typeof _0x2c438d[_0xa402('0x11')]===_0xa402('0x10');var _0x5405cf=_0x5c64a8[_0xa402('0x12')];var _0x2ca723=_0x54c9fe?0x0:_0x2c438d[_0xa402('0xf')];var _0x29255f=_0x54c9fe?_0x5c64a8[_0xa402('0x12')]:_0x2c438d[_0xa402('0xf')]+_0x2c438d[_0xa402('0x11')];var _0x57fd38;if(_0x29255f>=_0x5405cf){_0x29255f=_0x5405cf;_0x57fd38=0xc8;}else{_0x57fd38=0xce;}_0x561b32[_0xa402('0xd')](_0x57fd38);return _0x561b32[_0xa402('0x13')](_0xa402('0x14'),_0x2ca723+'-'+_0x29255f+'/'+_0x5405cf)[_0xa402('0xe')](_0x5c64a8);}return null;};}function saveUpdates(_0x355a53){return function(_0xd2ac6e){if(_0xd2ac6e){return _0xd2ac6e[_0xa402('0x15')](_0x355a53)[_0xa402('0x16')](function(_0x316f0c){return _0x316f0c;});}return null;};}function removeEntity(_0x41af7f){return function(_0x59ddf1){if(_0x59ddf1){return _0x59ddf1[_0xa402('0x17')]()[_0xa402('0x16')](function(){var _0x54b7a8=_0x59ddf1[_0xa402('0x18')]({'plain':!![]});var _0x202c04=_0xa402('0x19');return db[_0xa402('0x1a')][_0xa402('0x17')]({'where':{'type':_0x202c04,'resourceId':_0x54b7a8['id']}})['then'](function(){return _0x59ddf1;});})[_0xa402('0x16')](function(){_0x41af7f[_0xa402('0xd')](0xcc)[_0xa402('0x1b')]();});}};}function handleEntityNotFound(_0x1f792a){return function(_0x2c15db){if(!_0x2c15db){_0x1f792a[_0xa402('0xc')](0x194);}return _0x2c15db;};}function handleError(_0x3fd49a,_0x5bb1b7){_0x5bb1b7=_0x5bb1b7||0x1f4;return function(_0x3f1939){logger[_0xa402('0x1c')](_0x3f1939['stack']);if(_0x3f1939[_0xa402('0x1d')]){delete _0x3f1939[_0xa402('0x1d')];}_0x3fd49a['status'](_0x5bb1b7)[_0xa402('0x1e')](_0x3f1939);};}exports['index']=function(_0x47ddc6,_0x271b86){var _0x36bcc3={};var _0x12e71b={'count':0x0,'rows':[]};var _0x529c7a=_[_0xa402('0x1f')](db[_0xa402('0x20')][_0xa402('0x21')],function(_0x6f06ea){return{'name':_0x6f06ea[_0xa402('0x22')],'type':_0x6f06ea['type'][_0xa402('0x23')]};});_0x36bcc3=qs[_0xa402('0x24')](_0x529c7a,_0x47ddc6);var _0x40ddc8={'where':_0x36bcc3[_0xa402('0x25')]};return db['ChatQueue']['count'](_0x40ddc8)['then'](function(_0x1a9669){_0x12e71b[_0xa402('0x12')]=_0x1a9669;_0x36bcc3[_0xa402('0x26')]=qs[_0xa402('0x26')](_0x47ddc6[_0xa402('0x27')]);return db[_0xa402('0x20')][_0xa402('0x28')](_0x36bcc3);})[_0xa402('0x16')](function(_0x574c56){_0x12e71b[_0xa402('0x29')]=_0x574c56;return _0x12e71b;})[_0xa402('0x16')](respondWithFilteredResult(_0x271b86,_0x36bcc3))[_0xa402('0x2a')](handleError(_0x271b86,null));};exports[_0xa402('0x2b')]=function(_0x113cb3,_0x57b2b7){var _0x3d820c={'raw':!![],'where':{'id':_0x113cb3[_0xa402('0x2c')]['id']}},_0x892aa8={};_0x892aa8['model']=_[_0xa402('0x2d')](db[_0xa402('0x20')]['rawAttributes']);_0x892aa8[_0xa402('0x27')]=_[_0xa402('0x2d')](_0x113cb3['query']);_0x892aa8[_0xa402('0x2e')]=_[_0xa402('0x2f')](_0x892aa8[_0xa402('0x30')],_0x892aa8['query']);_0x3d820c[_0xa402('0x31')]=_[_0xa402('0x2f')](_0x892aa8['model'],qs['fields'](_0x113cb3[_0xa402('0x27')]['fields']));_0x3d820c[_0xa402('0x31')]=_0x3d820c[_0xa402('0x31')][_0xa402('0x32')]?_0x3d820c[_0xa402('0x31')]:_0x892aa8[_0xa402('0x30')];if(_0x113cb3['query'][_0xa402('0x33')]){_0x3d820c[_0xa402('0x26')]=[{'all':!![]}];}_0x3d820c=_[_0xa402('0x34')]({},_0x3d820c,_0x113cb3[_0xa402('0x35')]);return db['ChatQueue']['find'](_0x3d820c)[_0xa402('0x16')](handleEntityNotFound(_0x57b2b7,null))[_0xa402('0x16')](respondWithResult(_0x57b2b7,null))[_0xa402('0x2a')](handleError(_0x57b2b7,null));};exports['create']=function(_0x5e7d3e,_0x44becf){return db[_0xa402('0x20')]['create'](_0x5e7d3e['body'],{})[_0xa402('0x16')](function(_0xf53595){var _0x1e2dff=_0x5e7d3e[_0xa402('0x36')]['get']({'plain':!![]});if(!_0x1e2dff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e2dff['role']===_0xa402('0x36')){var _0x1ef907=_0xf53595[_0xa402('0x18')]({'plain':!![]});var _0x2d7a5b=_0xa402('0x19');return db[_0xa402('0x37')][_0xa402('0x38')]({'where':{'name':_0x2d7a5b,'userProfileId':_0x1e2dff[_0xa402('0x39')]},'raw':!![]})['then'](function(_0x251574){if(_0x251574&&_0x251574[_0xa402('0x3a')]===0x0){return db[_0xa402('0x1a')][_0xa402('0x3b')]({'name':_0x1ef907[_0xa402('0x1d')],'resourceId':_0x1ef907['id'],'type':_0x251574[_0xa402('0x1d')],'sectionId':_0x251574['id']},{})['then'](function(){return _0xf53595;});}else{return _0xf53595;}})[_0xa402('0x2a')](function(_0x5f0823){logger[_0xa402('0x1c')](_0xa402('0x3c'),_0x5f0823);throw _0x5f0823;});}return _0xf53595;})[_0xa402('0x16')](respondWithResult(_0x44becf,0xc9))[_0xa402('0x2a')](handleError(_0x44becf,null));};exports['update']=function(_0x343bc6,_0x2700e4){if(_0x343bc6[_0xa402('0x3d')]['id']){delete _0x343bc6[_0xa402('0x3d')]['id'];}return db[_0xa402('0x20')][_0xa402('0x38')]({'where':{'id':_0x343bc6[_0xa402('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2700e4,null))[_0xa402('0x16')](saveUpdates(_0x343bc6['body'],null))[_0xa402('0x16')](respondWithResult(_0x2700e4,null))[_0xa402('0x2a')](handleError(_0x2700e4,null));};exports[_0xa402('0x17')]=function(_0x9023d3,_0x5ca962){return db[_0xa402('0x20')][_0xa402('0x38')]({'where':{'id':_0x9023d3[_0xa402('0x2c')]['id']}})[_0xa402('0x16')](handleEntityNotFound(_0x5ca962,null))[_0xa402('0x16')](removeEntity(_0x5ca962,null))[_0xa402('0x2a')](handleError(_0x5ca962,null));};exports[_0xa402('0x3e')]=function(_0x38b8b8,_0x43eda0){return db[_0xa402('0x20')]['describe']()[_0xa402('0x16')](respondWithResult(_0x43eda0,null))[_0xa402('0x2a')](handleError(_0x43eda0,null));};exports[_0xa402('0x3f')]=function(_0x392bea,_0x36f706){var _0x230bcc={'raw':!![],'where':{}},_0x180131={},_0x38826f;return db[_0xa402('0x20')][_0xa402('0x40')]({'where':{'id':_0x392bea[_0xa402('0x2c')]['id']}})['then'](handleEntityNotFound(_0x36f706,null))['then'](function(_0x5137fb){if(_0x5137fb){_0x38826f=_0x5137fb['get']({'plain':!![]});_0x180131['model']=_['keys'](db[_0xa402('0x41')][_0xa402('0x21')]);_0x180131['query']=_[_0xa402('0x2d')](_0x392bea[_0xa402('0x27')]);_0x180131[_0xa402('0x2e')]=_[_0xa402('0x2f')](_0x180131[_0xa402('0x30')],_0x180131[_0xa402('0x27')]);_0x230bcc[_0xa402('0x31')]=_[_0xa402('0x2f')](_0x180131[_0xa402('0x30')],qs['fields'](_0x392bea['query'][_0xa402('0x42')]));_0x230bcc[_0xa402('0x31')]=_0x230bcc[_0xa402('0x31')]['length']?_0x230bcc[_0xa402('0x31')]:_0x180131[_0xa402('0x30')];if(!_0x392bea[_0xa402('0x27')][_0xa402('0x43')](_0xa402('0x44'))){_0x230bcc[_0xa402('0x11')]=qs[_0xa402('0x11')](_0x392bea[_0xa402('0x27')][_0xa402('0x11')]);_0x230bcc[_0xa402('0xf')]=qs[_0xa402('0xf')](_0x392bea[_0xa402('0x27')][_0xa402('0xf')]);}_0x230bcc[_0xa402('0x45')]=qs[_0xa402('0x46')](_0x392bea[_0xa402('0x27')]['sort']);_0x230bcc[_0xa402('0x25')]=qs[_0xa402('0x2e')](_[_0xa402('0x47')](_0x392bea[_0xa402('0x27')],_0x180131[_0xa402('0x2e')]));_0x230bcc[_0xa402('0x25')][_0xa402('0x48')]=_0x5137fb['id'];if(_0x392bea['query'][_0xa402('0x49')]){_0x230bcc['where']=_[_0xa402('0x34')](_0x230bcc[_0xa402('0x25')],{'$or':_[_0xa402('0x1f')](_0x230bcc['attributes'],function(_0x37de2d){var _0x2aa975={};_0x2aa975[_0x37de2d]={'$like':'%'+_0x392bea[_0xa402('0x27')]['filter']+'%'};return _0x2aa975;})});}_0x230bcc=_[_0xa402('0x34')]({},_0x230bcc,_0x392bea[_0xa402('0x35')]);return db[_0xa402('0x41')][_0xa402('0x28')](_0x230bcc);}})[_0xa402('0x16')](function(_0xda984a){if(_0xda984a){return db['User'][_0xa402('0x4a')]({'where':{'id':_[_0xa402('0x1f')](_0xda984a,_0xa402('0x4b')),'role':_0xa402('0x4c')},'attributes':['id',_0xa402('0x1d'),_0xa402('0x4d'),'updatedAt',_0xa402('0x4e')]});}})[_0xa402('0x16')](function(_0x4821e5){if(_0x4821e5){return{'count':_0x4821e5[_0xa402('0x12')],'rows':_[_0xa402('0x1f')](_0x4821e5[_0xa402('0x29')],function(_0x42ce7){return{'membername':_0x42ce7['name'],'UserId':_0x42ce7['id'],'queue_name':_0x38826f[_0xa402('0x1d')],'ChatQueueId':_0x38826f['id'],'interface':util[_0xa402('0x4f')](_0xa402('0x50'),'SIP',_0x42ce7[_0xa402('0x1d')]),'penalty':0x0,'paused':_0x42ce7[_0xa402('0x4d')],'createdAt':_0x42ce7[_0xa402('0x4e')],'updatedAt':_0x42ce7[_0xa402('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa402('0x16')](respondWithFilteredResult(_0x36f706,_0x230bcc))[_0xa402('0x2a')](handleError(_0x36f706,null));};exports[_0xa402('0x52')]=function(_0x1c4ad8,_0x4a15ac){var _0x4d0ad2={};var _0x2d9024={};var _0x4d6e7b;var _0x4d0661;return db[_0xa402('0x20')][_0xa402('0x40')]({'where':{'id':_0x1c4ad8[_0xa402('0x2c')]['id']}})[_0xa402('0x16')](handleEntityNotFound(_0x4a15ac,null))[_0xa402('0x16')](function(_0x5f370d){if(_0x5f370d){_0x4d6e7b=_0x5f370d;_0x2d9024[_0xa402('0x30')]=_['keys'](db[_0xa402('0x53')][_0xa402('0x21')]);_0x2d9024[_0xa402('0x27')]=_[_0xa402('0x2d')](_0x1c4ad8[_0xa402('0x27')]);_0x2d9024['filters']=_[_0xa402('0x2f')](_0x2d9024[_0xa402('0x30')],_0x2d9024[_0xa402('0x27')]);_0x4d0ad2['attributes']=_['intersection'](_0x2d9024[_0xa402('0x30')],qs['fields'](_0x1c4ad8['query']['fields']));_0x4d0ad2[_0xa402('0x31')]=_0x4d0ad2[_0xa402('0x31')][_0xa402('0x32')]?_0x4d0ad2[_0xa402('0x31')]:_0x2d9024[_0xa402('0x30')];_0x4d0ad2[_0xa402('0x45')]=qs[_0xa402('0x46')](_0x1c4ad8[_0xa402('0x27')][_0xa402('0x46')]);_0x4d0ad2[_0xa402('0x25')]=qs[_0xa402('0x2e')](_[_0xa402('0x47')](_0x1c4ad8[_0xa402('0x27')],_0x2d9024[_0xa402('0x2e')]));if(_0x1c4ad8['query'][_0xa402('0x49')]){_0x4d0ad2[_0xa402('0x25')]=_[_0xa402('0x34')](_0x4d0ad2['where'],{'$or':_[_0xa402('0x1f')](_0x4d0ad2[_0xa402('0x31')],function(_0x371c21){var _0x21033c={};_0x21033c[_0x371c21]={'$like':'%'+_0x1c4ad8[_0xa402('0x27')]['filter']+'%'};return _0x21033c;})});}_0x4d0ad2=_[_0xa402('0x34')]({},_0x4d0ad2,_0x1c4ad8['options']);return _0x4d6e7b['getTeams'](_0x4d0ad2);}})[_0xa402('0x16')](function(_0x12379c){if(_0x12379c){_0x4d0661=_0x12379c[_0xa402('0x32')];if(!_0x1c4ad8[_0xa402('0x27')][_0xa402('0x43')](_0xa402('0x44'))){_0x4d0ad2[_0xa402('0x11')]=qs[_0xa402('0x11')](_0x1c4ad8['query'][_0xa402('0x11')]);_0x4d0ad2['offset']=qs[_0xa402('0xf')](_0x1c4ad8[_0xa402('0x27')][_0xa402('0xf')]);}return _0x4d6e7b[_0xa402('0x52')](_0x4d0ad2);}})[_0xa402('0x16')](function(_0x1732b8){if(_0x1732b8){return _0x1732b8?{'count':_0x4d0661,'rows':_0x1732b8}:null;}})[_0xa402('0x16')](respondWithResult(_0x4a15ac,null))[_0xa402('0x2a')](handleError(_0x4a15ac,null));};exports[_0xa402('0x54')]=function(_0x2c854c,_0x379d3c){var _0x362be4=_0x2c854c['body'][_0xa402('0x55')];return db[_0xa402('0x53')][_0xa402('0x28')]({'where':{'id':_0x362be4},'attributes':['id'],'include':[{'model':db[_0xa402('0x56')],'as':'Agents','attributes':['id',_0xa402('0x1d'),_0xa402('0x57'),_0xa402('0x58'),'interface'],'raw':!![]}]})[_0xa402('0x16')](function(_0x1ae0d9){if(_0x1ae0d9){var _0x25eefa=_[_0xa402('0x59')](_0x1ae0d9,function(_0x1b4459){var _0x1cf0d1=_0x1b4459[_0xa402('0x18')]({'plain':!![]});return _0x1cf0d1[_0xa402('0x5a')];});return db[_0xa402('0x20')]['find']({'where':{'id':_0x2c854c['params']['id']}})[_0xa402('0x16')](function(_0x1c4a7f){return db[_0xa402('0x5b')][_0xa402('0x5c')](function(_0x4f8958){return _0x1c4a7f[_0xa402('0x54')](_0x362be4,{'transaction':_0x4f8958})['then'](function(){return BPromise[_0xa402('0x5d')](_0x25eefa,function(_0x135734){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x135734['id'],'ChatQueueId':_0x2c854c[_0xa402('0x2c')]['id']},'transaction':_0x4f8958});});})[_0xa402('0x16')](function(){_0x25eefa[_0xa402('0x5e')](function(_0x3df622){socket[_0xa402('0x5f')](_0xa402('0x60'),{'UserId':_0x3df622['id'],'ChatQueueId':_0x1c4a7f['id']});});});});});}})[_0xa402('0x16')](respondWithStatusCode(_0x379d3c,null))[_0xa402('0x2a')](handleError(_0x379d3c,null));};exports['removeTeams']=function(_0x2f8366,_0x4a2677){return db[_0xa402('0x53')][_0xa402('0x28')]({'where':{'id':_0x2f8366[_0xa402('0x27')][_0xa402('0x55')]},'attributes':['id'],'include':[{'model':db[_0xa402('0x56')],'as':_0xa402('0x5a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4a2677,null))['then'](function(_0x1e55a8){var _0x56e045=_[_0xa402('0x1f')](_0x1e55a8,'id');var _0x507d62=[];var _0xfe5b10=[];var _0x2fef9e=squel['select']();_0x2fef9e[_0xa402('0x61')](_0xa402('0x62'))[_0xa402('0x63')](_0xa402('0x64'),'tq')[_0xa402('0x65')]('user_has_teams','ut',_0xa402('0x66'))['where'](_0xa402('0x67'),_0x2f8366[_0xa402('0x2c')]['id']);for(var _0x3d055d=0x0;_0x3d055d<_0x1e55a8[_0xa402('0x32')];_0x3d055d+=0x1){let _0x6b46ba=_0x1e55a8[_0x3d055d];for(var _0x43e7b0=0x0;_0x43e7b0<_0x6b46ba[_0xa402('0x5a')]['length'];_0x43e7b0+=0x1){let _0x4c19a2=_0x6b46ba['Agents'][_0x43e7b0];var _0x55966b=_0x2fef9e['clone']();_0x55966b[_0xa402('0x25')](_0xa402('0x68'),_0x4c19a2['id']);_0xfe5b10[_0xa402('0x69')](db['sequelize'][_0xa402('0x27')](_0x55966b[_0xa402('0x6a')](),{'type':db[_0xa402('0x5b')][_0xa402('0x6b')]['SELECT']})[_0xa402('0x16')](function(_0x46689d){if(_0x46689d[_0xa402('0x32')]===0x1){return _0x4c19a2['id'];}else{var _0x219798=_[_0xa402('0x6c')](_[_0xa402('0x1f')](_0x46689d,_0xa402('0x6d')),function(_0x547c11){return _[_0xa402('0x6e')](_0x56e045,_0x547c11);});if(_0x219798){return _0x4c19a2['id'];}}}));}}return BPromise[_0xa402('0x6f')](_0xfe5b10)['then'](function(_0x177f6f){_0x507d62=_(_0x507d62)['union'](_0x177f6f)['compact']()[_0xa402('0x70')]();return db['ChatQueue'][_0xa402('0x38')]({'where':{'id':_0x2f8366[_0xa402('0x2c')]['id']}})[_0xa402('0x16')](function(_0x18229a){return db[_0xa402('0x5b')]['transaction'](function(_0x4b2a2a){return _0x18229a['removeTeams'](_0x2f8366[_0xa402('0x27')][_0xa402('0x55')],{'transaction':_0x4b2a2a})[_0xa402('0x16')](function(){if(!_[_0xa402('0x71')](_0x507d62)){return _0x18229a['removeAgents'](_0x507d62,{'transaction':_0x4b2a2a});}})['then'](function(){_0x507d62[_0xa402('0x5e')](function(_0x509d21){socket[_0xa402('0x5f')](_0xa402('0x72'),{'UserId':_0x509d21,'ChatQueueId':_0x18229a['id']});});});});});});})[_0xa402('0x16')](respondWithStatusCode(_0x4a2677,null))[_0xa402('0x2a')](handleError(_0x4a2677,null));};exports[_0xa402('0x73')]=function(_0x2ba629,_0x2eb079){return db['ChatQueue'][_0xa402('0x38')]({'where':{'id':_0x2ba629[_0xa402('0x2c')]['id']}})[_0xa402('0x16')](handleEntityNotFound(_0x2eb079,null))[_0xa402('0x16')](function(_0x5a7aae){if(_0x5a7aae){return _0x5a7aae[_0xa402('0x73')](_0x2ba629[_0xa402('0x3d')][_0xa402('0x55')],_[_0xa402('0x74')](_0x2ba629[_0xa402('0x3d')],[_0xa402('0x55'),'id'])||{})[_0xa402('0x75')](function(_0xaa55e9){for(var _0x4efa4d=0x0;_0x4efa4d<_0x2ba629[_0xa402('0x3d')][_0xa402('0x55')][_0xa402('0x32')];_0x4efa4d+=0x1){socket[_0xa402('0x5f')]('userChatQueue:save',{'UserId':Number(_0x2ba629[_0xa402('0x3d')][_0xa402('0x55')][_0x4efa4d]),'ChatQueueId':Number(_0x2ba629[_0xa402('0x2c')]['id'])});}return _0xaa55e9;});}})[_0xa402('0x16')](respondWithResult(_0x2eb079,null))[_0xa402('0x2a')](handleError(_0x2eb079,null));};exports[_0xa402('0x76')]=function(_0x4a7e7f,_0x331e30){return db[_0xa402('0x20')]['find']({'where':{'id':_0x4a7e7f['params']['id']}})[_0xa402('0x16')](handleEntityNotFound(_0x331e30,null))[_0xa402('0x16')](function(_0x5814b8){if(_0x5814b8){return _0x5814b8[_0xa402('0x76')](_0x4a7e7f[_0xa402('0x27')][_0xa402('0x55')])[_0xa402('0x16')](function(){if(_[_0xa402('0x77')](_0x4a7e7f[_0xa402('0x27')][_0xa402('0x55')])){for(var _0x480b60=0x0;_0x480b60<_0x4a7e7f[_0xa402('0x27')][_0xa402('0x55')][_0xa402('0x32')];_0x480b60+=0x1){socket['emit'](_0xa402('0x72'),{'UserId':Number(_0x4a7e7f[_0xa402('0x27')][_0xa402('0x55')][_0x480b60]),'ChatQueueId':Number(_0x4a7e7f[_0xa402('0x2c')]['id'])});}}else{socket[_0xa402('0x5f')](_0xa402('0x72'),{'UserId':Number(_0x4a7e7f[_0xa402('0x27')][_0xa402('0x55')]),'ChatQueueId':Number(_0x4a7e7f[_0xa402('0x2c')]['id'])});}});}})['then'](respondWithStatusCode(_0x331e30,null))[_0xa402('0x2a')](handleError(_0x331e30,null));};exports[_0xa402('0x78')]=function(_0x3180bf,_0x20ebcc){var _0x3c6a93={};var _0x40736e={};var _0x4cb2e4;var _0x270ba4;return db[_0xa402('0x20')][_0xa402('0x40')]({'where':{'id':_0x3180bf[_0xa402('0x2c')]['id']}})[_0xa402('0x16')](handleEntityNotFound(_0x20ebcc,null))[_0xa402('0x16')](function(_0x10df25){if(_0x10df25){_0x4cb2e4=_0x10df25;_0x40736e[_0xa402('0x30')]=_[_0xa402('0x2d')](db[_0xa402('0x56')][_0xa402('0x21')]);_0x40736e['query']=_['keys'](_0x3180bf['query']);_0x40736e[_0xa402('0x2e')]=_[_0xa402('0x2f')](_0x40736e[_0xa402('0x30')],_0x40736e[_0xa402('0x27')]);_0x3c6a93['attributes']=_[_0xa402('0x2f')](_0x40736e[_0xa402('0x30')],qs[_0xa402('0x42')](_0x3180bf[_0xa402('0x27')][_0xa402('0x42')]));_0x3c6a93[_0xa402('0x31')]=_0x3c6a93['attributes'][_0xa402('0x32')]?_0x3c6a93[_0xa402('0x31')]:_0x40736e[_0xa402('0x30')];_0x3c6a93[_0xa402('0x45')]=qs[_0xa402('0x46')](_0x3180bf[_0xa402('0x27')][_0xa402('0x46')]);_0x3c6a93[_0xa402('0x25')]=qs[_0xa402('0x2e')](_[_0xa402('0x47')](_0x3180bf[_0xa402('0x27')],_0x40736e[_0xa402('0x2e')]));if(_0x3180bf['query'][_0xa402('0x49')]){_0x3c6a93[_0xa402('0x25')]=_[_0xa402('0x34')](_0x3c6a93[_0xa402('0x25')],{'$or':_[_0xa402('0x1f')](_0x3c6a93[_0xa402('0x31')],function(_0x1222e3){var _0x8a002={};_0x8a002[_0x1222e3]={'$like':'%'+_0x3180bf[_0xa402('0x27')]['filter']+'%'};return _0x8a002;})});}_0x3c6a93=_['merge']({},_0x3c6a93,_0x3180bf[_0xa402('0x35')]);return _0x4cb2e4['getAgents'](_0x3c6a93);}})[_0xa402('0x16')](function(_0x339ba8){if(_0x339ba8){_0x270ba4=_0x339ba8[_0xa402('0x32')];if(!_0x3180bf[_0xa402('0x27')][_0xa402('0x43')](_0xa402('0x44'))){_0x3c6a93['limit']=qs[_0xa402('0x11')](_0x3180bf['query'][_0xa402('0x11')]);_0x3c6a93['offset']=qs['offset'](_0x3180bf['query'][_0xa402('0xf')]);}return _0x4cb2e4[_0xa402('0x78')](_0x3c6a93);}})['then'](function(_0x4a3840){if(_0x4a3840){return _0x4a3840?{'count':_0x270ba4,'rows':_0x4a3840}:null;}})[_0xa402('0x16')](respondWithResult(_0x20ebcc,null))[_0xa402('0x2a')](handleError(_0x20ebcc,null));}; \ No newline at end of file +var _0x3150=['fieldName','type','getOptions','where','include','query','rows','catch','show','model','keys','rawAttributes','filters','attributes','fields','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','params','describe','getMembers','findOne','UserChatQueue','intersection','length','nolimit','order','sort','pick','ChatQueueId','filter','findAll','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','hasOwnProperty','ids','Agents','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','includes','all','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','update','destroy','then','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue'];(function(_0x2b509a,_0x1bc946){var _0x5b933d=function(_0x3d99a4){while(--_0x3d99a4){_0x2b509a['push'](_0x2b509a['shift']());}};_0x5b933d(++_0x1bc946);}(_0x3150,0x1b8));var _0x0315=function(_0x3b0e0c,_0x5e4814){_0x3b0e0c=_0x3b0e0c-0x0;var _0x3efb86=_0x3150[_0x3b0e0c];return _0x3efb86;};'use strict';var BPromise=require(_0x0315('0x0'));var util=require(_0x0315('0x1'));var _=require(_0x0315('0x2'));var squel=require(_0x0315('0x3'));var Redis=require(_0x0315('0x4'));var qs=require(_0x0315('0x5'));var logger=require(_0x0315('0x6'))(_0x0315('0x7'));var config=require('../../config/environment');var db=require(_0x0315('0x8'))['db'];config[_0x0315('0x9')]=_['defaults'](config[_0x0315('0x9')],{'host':_0x0315('0xa'),'port':0x18eb});var socket=require(_0x0315('0xb'))(new Redis(config[_0x0315('0x9')]));require(_0x0315('0xc'))[_0x0315('0xd')](socket);function respondWithStatusCode(_0x2d7560,_0x571ece){_0x571ece=_0x571ece||0xcc;return function(_0x4419bb){if(_0x4419bb){return _0x2d7560['sendStatus'](_0x571ece);}return _0x2d7560[_0x0315('0xe')](_0x571ece)[_0x0315('0xf')]();};}function respondWithResult(_0x5ec7ca,_0x2f26a5){_0x2f26a5=_0x2f26a5||0xc8;return function(_0x2b77cb){if(_0x2b77cb){return _0x5ec7ca['status'](_0x2f26a5)[_0x0315('0x10')](_0x2b77cb);}};}function respondWithFilteredResult(_0x125e65,_0x4deeca){return function(_0x14896b){if(_0x14896b){var _0x23b10e=typeof _0x4deeca[_0x0315('0x11')]===_0x0315('0x12')&&typeof _0x4deeca[_0x0315('0x13')]===_0x0315('0x12');var _0x545089=_0x14896b[_0x0315('0x14')];var _0x2a53b8=_0x23b10e?0x0:_0x4deeca[_0x0315('0x11')];var _0x23ca70=_0x23b10e?_0x14896b[_0x0315('0x14')]:_0x4deeca['offset']+_0x4deeca[_0x0315('0x13')];var _0x555dd3;if(_0x23ca70>=_0x545089){_0x23ca70=_0x545089;_0x555dd3=0xc8;}else{_0x555dd3=0xce;}_0x125e65[_0x0315('0xe')](_0x555dd3);return _0x125e65['set']('Content-Range',_0x2a53b8+'-'+_0x23ca70+'/'+_0x545089)[_0x0315('0x10')](_0x14896b);}return null;};}function saveUpdates(_0x149ecf){return function(_0x3b695f){if(_0x3b695f){return _0x3b695f[_0x0315('0x15')](_0x149ecf)['then'](function(_0x39e93d){return _0x39e93d;});}return null;};}function removeEntity(_0x51ca7b){return function(_0x45703c){if(_0x45703c){return _0x45703c[_0x0315('0x16')]()[_0x0315('0x17')](function(){var _0x9501c3=_0x45703c[_0x0315('0x18')]({'plain':!![]});var _0x206716=_0x0315('0x19');return db[_0x0315('0x1a')][_0x0315('0x16')]({'where':{'type':_0x206716,'resourceId':_0x9501c3['id']}})[_0x0315('0x17')](function(){return _0x45703c;});})[_0x0315('0x17')](function(){_0x51ca7b[_0x0315('0xe')](0xcc)[_0x0315('0xf')]();});}};}function handleEntityNotFound(_0x558553){return function(_0x3f4ef3){if(!_0x3f4ef3){_0x558553['sendStatus'](0x194);}return _0x3f4ef3;};}function handleError(_0x1d0b8e,_0x32fce4){_0x32fce4=_0x32fce4||0x1f4;return function(_0x221dc3){logger['error'](_0x221dc3[_0x0315('0x1b')]);if(_0x221dc3[_0x0315('0x1c')]){delete _0x221dc3['name'];}_0x1d0b8e[_0x0315('0xe')](_0x32fce4)['send'](_0x221dc3);};}exports[_0x0315('0x1d')]=function(_0x1eb9e9,_0x45d5dc){var _0x563733={};var _0x55d526={'count':0x0,'rows':[]};var _0x4dbc9c=_[_0x0315('0x1e')](db[_0x0315('0x1f')]['rawAttributes'],function(_0x1baaa4){return{'name':_0x1baaa4[_0x0315('0x20')],'type':_0x1baaa4[_0x0315('0x21')]['key']};});_0x563733=qs[_0x0315('0x22')](_0x4dbc9c,_0x1eb9e9);var _0x1354c1={'where':_0x563733[_0x0315('0x23')]};return db[_0x0315('0x1f')][_0x0315('0x14')](_0x1354c1)[_0x0315('0x17')](function(_0x4d9dfd){_0x55d526[_0x0315('0x14')]=_0x4d9dfd;_0x563733[_0x0315('0x24')]=qs['include'](_0x1eb9e9[_0x0315('0x25')]);return db['ChatQueue']['findAll'](_0x563733);})[_0x0315('0x17')](function(_0x16f0e3){_0x55d526[_0x0315('0x26')]=_0x16f0e3;return _0x55d526;})[_0x0315('0x17')](respondWithFilteredResult(_0x45d5dc,_0x563733))[_0x0315('0x27')](handleError(_0x45d5dc,null));};exports[_0x0315('0x28')]=function(_0x3b9ae5,_0x4e0187){var _0x398dc9={'raw':!![],'where':{'id':_0x3b9ae5['params']['id']}},_0x7c62b9={};_0x7c62b9[_0x0315('0x29')]=_[_0x0315('0x2a')](db['ChatQueue'][_0x0315('0x2b')]);_0x7c62b9[_0x0315('0x25')]=_[_0x0315('0x2a')](_0x3b9ae5[_0x0315('0x25')]);_0x7c62b9[_0x0315('0x2c')]=_['intersection'](_0x7c62b9[_0x0315('0x29')],_0x7c62b9['query']);_0x398dc9[_0x0315('0x2d')]=_['intersection'](_0x7c62b9[_0x0315('0x29')],qs[_0x0315('0x2e')](_0x3b9ae5[_0x0315('0x25')][_0x0315('0x2e')]));_0x398dc9['attributes']=_0x398dc9['attributes']['length']?_0x398dc9[_0x0315('0x2d')]:_0x7c62b9[_0x0315('0x29')];if(_0x3b9ae5[_0x0315('0x25')]['includeAll']){_0x398dc9[_0x0315('0x24')]=[{'all':!![]}];}_0x398dc9=_[_0x0315('0x2f')]({},_0x398dc9,_0x3b9ae5[_0x0315('0x30')]);return db[_0x0315('0x1f')][_0x0315('0x31')](_0x398dc9)[_0x0315('0x17')](handleEntityNotFound(_0x4e0187,null))['then'](respondWithResult(_0x4e0187,null))[_0x0315('0x27')](handleError(_0x4e0187,null));};exports['create']=function(_0x53b204,_0x2546f5){return db[_0x0315('0x1f')][_0x0315('0x32')](_0x53b204[_0x0315('0x33')],{})[_0x0315('0x17')](function(_0x355ba9){var _0x56c284=_0x53b204[_0x0315('0x34')]['get']({'plain':!![]});if(!_0x56c284)throw new Error(_0x0315('0x35'));if(_0x56c284['role']===_0x0315('0x34')){var _0x1ed705=_0x355ba9['get']({'plain':!![]});var _0x50ab18=_0x0315('0x19');return db[_0x0315('0x36')][_0x0315('0x31')]({'where':{'name':_0x50ab18,'userProfileId':_0x56c284[_0x0315('0x37')]},'raw':!![]})[_0x0315('0x17')](function(_0x3d59bb){if(_0x3d59bb&&_0x3d59bb[_0x0315('0x38')]===0x0){return db[_0x0315('0x1a')][_0x0315('0x32')]({'name':_0x1ed705['name'],'resourceId':_0x1ed705['id'],'type':_0x3d59bb[_0x0315('0x1c')],'sectionId':_0x3d59bb['id']},{})[_0x0315('0x17')](function(){return _0x355ba9;});}else{return _0x355ba9;}})['catch'](function(_0xd0566f){logger[_0x0315('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd0566f);throw _0xd0566f;});}return _0x355ba9;})['then'](respondWithResult(_0x2546f5,0xc9))['catch'](handleError(_0x2546f5,null));};exports['update']=function(_0x481428,_0x366cac){if(_0x481428[_0x0315('0x33')]['id']){delete _0x481428['body']['id'];}return db[_0x0315('0x1f')]['find']({'where':{'id':_0x481428[_0x0315('0x3a')]['id']}})[_0x0315('0x17')](handleEntityNotFound(_0x366cac,null))[_0x0315('0x17')](saveUpdates(_0x481428[_0x0315('0x33')],null))[_0x0315('0x17')](respondWithResult(_0x366cac,null))[_0x0315('0x27')](handleError(_0x366cac,null));};exports[_0x0315('0x16')]=function(_0x19afb6,_0x3c3e2a){return db[_0x0315('0x1f')][_0x0315('0x31')]({'where':{'id':_0x19afb6[_0x0315('0x3a')]['id']}})[_0x0315('0x17')](handleEntityNotFound(_0x3c3e2a,null))[_0x0315('0x17')](removeEntity(_0x3c3e2a,null))[_0x0315('0x27')](handleError(_0x3c3e2a,null));};exports[_0x0315('0x3b')]=function(_0x4b9f4c,_0x25a50d){return db[_0x0315('0x1f')]['describe']()[_0x0315('0x17')](respondWithResult(_0x25a50d,null))[_0x0315('0x27')](handleError(_0x25a50d,null));};exports[_0x0315('0x3c')]=function(_0xd61e4b,_0x46ae76){var _0x66a0e2={'raw':!![],'where':{}},_0x170328={},_0x56027f;return db[_0x0315('0x1f')][_0x0315('0x3d')]({'where':{'id':_0xd61e4b[_0x0315('0x3a')]['id']}})[_0x0315('0x17')](handleEntityNotFound(_0x46ae76,null))[_0x0315('0x17')](function(_0x56609b){if(_0x56609b){_0x56027f=_0x56609b[_0x0315('0x18')]({'plain':!![]});_0x170328[_0x0315('0x29')]=_[_0x0315('0x2a')](db[_0x0315('0x3e')][_0x0315('0x2b')]);_0x170328[_0x0315('0x25')]=_[_0x0315('0x2a')](_0xd61e4b[_0x0315('0x25')]);_0x170328[_0x0315('0x2c')]=_[_0x0315('0x3f')](_0x170328[_0x0315('0x29')],_0x170328['query']);_0x66a0e2['attributes']=_['intersection'](_0x170328[_0x0315('0x29')],qs['fields'](_0xd61e4b[_0x0315('0x25')]['fields']));_0x66a0e2[_0x0315('0x2d')]=_0x66a0e2[_0x0315('0x2d')][_0x0315('0x40')]?_0x66a0e2[_0x0315('0x2d')]:_0x170328[_0x0315('0x29')];if(!_0xd61e4b['query']['hasOwnProperty'](_0x0315('0x41'))){_0x66a0e2[_0x0315('0x13')]=qs[_0x0315('0x13')](_0xd61e4b[_0x0315('0x25')][_0x0315('0x13')]);_0x66a0e2[_0x0315('0x11')]=qs['offset'](_0xd61e4b['query'][_0x0315('0x11')]);}_0x66a0e2[_0x0315('0x42')]=qs['sort'](_0xd61e4b[_0x0315('0x25')][_0x0315('0x43')]);_0x66a0e2[_0x0315('0x23')]=qs['filters'](_[_0x0315('0x44')](_0xd61e4b[_0x0315('0x25')],_0x170328['filters']));_0x66a0e2[_0x0315('0x23')][_0x0315('0x45')]=_0x56609b['id'];if(_0xd61e4b['query'][_0x0315('0x46')]){_0x66a0e2[_0x0315('0x23')]=_[_0x0315('0x2f')](_0x66a0e2['where'],{'$or':_[_0x0315('0x1e')](_0x66a0e2[_0x0315('0x2d')],function(_0x34eb8f){var _0x4381b4={};_0x4381b4[_0x34eb8f]={'$like':'%'+_0xd61e4b[_0x0315('0x25')][_0x0315('0x46')]+'%'};return _0x4381b4;})});}_0x66a0e2=_[_0x0315('0x2f')]({},_0x66a0e2,_0xd61e4b[_0x0315('0x30')]);return db[_0x0315('0x3e')][_0x0315('0x47')](_0x66a0e2);}})[_0x0315('0x17')](function(_0x116d47){if(_0x116d47){return db[_0x0315('0x48')][_0x0315('0x49')]({'where':{'id':_[_0x0315('0x1e')](_0x116d47,_0x0315('0x4a')),'role':_0x0315('0x4b')},'attributes':['id','name',_0x0315('0x4c'),'updatedAt',_0x0315('0x4d')]});}})[_0x0315('0x17')](function(_0x6ea4ca){if(_0x6ea4ca){return{'count':_0x6ea4ca[_0x0315('0x14')],'rows':_[_0x0315('0x1e')](_0x6ea4ca[_0x0315('0x26')],function(_0x1ba035){return{'membername':_0x1ba035[_0x0315('0x1c')],'UserId':_0x1ba035['id'],'queue_name':_0x56027f['name'],'ChatQueueId':_0x56027f['id'],'interface':util[_0x0315('0x4e')](_0x0315('0x4f'),_0x0315('0x50'),_0x1ba035[_0x0315('0x1c')]),'penalty':0x0,'paused':_0x1ba035['chatPause'],'createdAt':_0x1ba035[_0x0315('0x4d')],'updatedAt':_0x1ba035[_0x0315('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x46ae76,_0x66a0e2))[_0x0315('0x27')](handleError(_0x46ae76,null));};exports[_0x0315('0x52')]=function(_0xe1b177,_0x54c400){var _0x5c07d3={};var _0x300f8d={};var _0x31a2f0;var _0x19f454;return db[_0x0315('0x1f')]['findOne']({'where':{'id':_0xe1b177['params']['id']}})[_0x0315('0x17')](handleEntityNotFound(_0x54c400,null))[_0x0315('0x17')](function(_0x68342f){if(_0x68342f){_0x31a2f0=_0x68342f;_0x300f8d[_0x0315('0x29')]=_[_0x0315('0x2a')](db[_0x0315('0x53')]['rawAttributes']);_0x300f8d['query']=_['keys'](_0xe1b177['query']);_0x300f8d[_0x0315('0x2c')]=_[_0x0315('0x3f')](_0x300f8d[_0x0315('0x29')],_0x300f8d[_0x0315('0x25')]);_0x5c07d3[_0x0315('0x2d')]=_['intersection'](_0x300f8d['model'],qs[_0x0315('0x2e')](_0xe1b177['query'][_0x0315('0x2e')]));_0x5c07d3[_0x0315('0x2d')]=_0x5c07d3[_0x0315('0x2d')][_0x0315('0x40')]?_0x5c07d3[_0x0315('0x2d')]:_0x300f8d['model'];_0x5c07d3[_0x0315('0x42')]=qs[_0x0315('0x43')](_0xe1b177[_0x0315('0x25')][_0x0315('0x43')]);_0x5c07d3['where']=qs[_0x0315('0x2c')](_[_0x0315('0x44')](_0xe1b177['query'],_0x300f8d[_0x0315('0x2c')]));if(_0xe1b177[_0x0315('0x25')][_0x0315('0x46')]){_0x5c07d3[_0x0315('0x23')]=_['merge'](_0x5c07d3['where'],{'$or':_[_0x0315('0x1e')](_0x5c07d3[_0x0315('0x2d')],function(_0x571939){var _0x35dcc4={};_0x35dcc4[_0x571939]={'$like':'%'+_0xe1b177[_0x0315('0x25')][_0x0315('0x46')]+'%'};return _0x35dcc4;})});}_0x5c07d3=_[_0x0315('0x2f')]({},_0x5c07d3,_0xe1b177[_0x0315('0x30')]);return _0x31a2f0[_0x0315('0x52')](_0x5c07d3);}})[_0x0315('0x17')](function(_0x12f8a6){if(_0x12f8a6){_0x19f454=_0x12f8a6[_0x0315('0x40')];if(!_0xe1b177[_0x0315('0x25')][_0x0315('0x54')]('nolimit')){_0x5c07d3[_0x0315('0x13')]=qs[_0x0315('0x13')](_0xe1b177['query'][_0x0315('0x13')]);_0x5c07d3[_0x0315('0x11')]=qs[_0x0315('0x11')](_0xe1b177['query']['offset']);}return _0x31a2f0[_0x0315('0x52')](_0x5c07d3);}})[_0x0315('0x17')](function(_0xd5bf26){if(_0xd5bf26){return _0xd5bf26?{'count':_0x19f454,'rows':_0xd5bf26}:null;}})[_0x0315('0x17')](respondWithResult(_0x54c400,null))['catch'](handleError(_0x54c400,null));};exports['addTeams']=function(_0x331d92,_0x29c3c8){var _0x104ddd=_0x331d92[_0x0315('0x33')][_0x0315('0x55')];return db[_0x0315('0x53')][_0x0315('0x47')]({'where':{'id':_0x104ddd},'attributes':['id'],'include':[{'model':db[_0x0315('0x48')],'as':_0x0315('0x56'),'attributes':['id',_0x0315('0x1c'),'online','voicePause',_0x0315('0x57')],'raw':!![]}]})['then'](function(_0x11876b){if(_0x11876b){var _0x1c699b=_['flatMap'](_0x11876b,function(_0x5d7786){var _0x1dcf08=_0x5d7786['get']({'plain':!![]});return _0x1dcf08[_0x0315('0x56')];});return db[_0x0315('0x1f')]['find']({'where':{'id':_0x331d92[_0x0315('0x3a')]['id']}})['then'](function(_0x3318a9){return db[_0x0315('0x58')][_0x0315('0x59')](function(_0x861a8d){return _0x3318a9[_0x0315('0x5a')](_0x104ddd,{'transaction':_0x861a8d})[_0x0315('0x17')](function(){return BPromise[_0x0315('0x5b')](_0x1c699b,function(_0x43d35f){return db[_0x0315('0x3e')][_0x0315('0x5c')]({'where':{'UserId':_0x43d35f['id'],'ChatQueueId':_0x331d92['params']['id']},'transaction':_0x861a8d});});})[_0x0315('0x17')](function(){_0x1c699b[_0x0315('0x5d')](function(_0x12c1da){socket[_0x0315('0x5e')](_0x0315('0x5f'),{'UserId':_0x12c1da['id'],'ChatQueueId':_0x3318a9['id']});});});});});}})[_0x0315('0x17')](respondWithStatusCode(_0x29c3c8,null))[_0x0315('0x27')](handleError(_0x29c3c8,null));};exports[_0x0315('0x60')]=function(_0x421326,_0x1041e4){return db[_0x0315('0x53')][_0x0315('0x47')]({'where':{'id':_0x421326[_0x0315('0x25')][_0x0315('0x55')]},'attributes':['id'],'include':[{'model':db[_0x0315('0x48')],'as':_0x0315('0x56'),'attributes':['id'],'raw':!![]}]})[_0x0315('0x17')](handleEntityNotFound(_0x1041e4,null))[_0x0315('0x17')](function(_0x108cb0){var _0xbcd8df=_[_0x0315('0x1e')](_0x108cb0,'id');var _0x3d3685=[];var _0x518b05=[];var _0xb9ea77=squel[_0x0315('0x61')]();_0xb9ea77[_0x0315('0x62')]('tq.TeamId')[_0x0315('0x63')]('team_has_chat_queues','tq')['join'](_0x0315('0x64'),'ut',_0x0315('0x65'))[_0x0315('0x23')](_0x0315('0x66'),_0x421326[_0x0315('0x3a')]['id']);for(var _0x6d6b5a=0x0;_0x6d6b5a<_0x108cb0[_0x0315('0x40')];_0x6d6b5a+=0x1){let _0x2c7d63=_0x108cb0[_0x6d6b5a];for(var _0x23a05b=0x0;_0x23a05b<_0x2c7d63['Agents'][_0x0315('0x40')];_0x23a05b+=0x1){let _0x91078f=_0x2c7d63[_0x0315('0x56')][_0x23a05b];var _0x59e404=_0xb9ea77[_0x0315('0x67')]();_0x59e404[_0x0315('0x23')]('ut.UserId\x20=\x20?',_0x91078f['id']);_0x518b05['push'](db[_0x0315('0x58')][_0x0315('0x25')](_0x59e404[_0x0315('0x68')](),{'type':db[_0x0315('0x58')][_0x0315('0x69')]['SELECT']})[_0x0315('0x17')](function(_0x17a570){if(_0x17a570['length']===0x1){return _0x91078f['id'];}else{var _0x28b092=_[_0x0315('0x6a')](_[_0x0315('0x1e')](_0x17a570,_0x0315('0x6b')),function(_0x422bff){return _[_0x0315('0x6c')](_0xbcd8df,_0x422bff);});if(_0x28b092){return _0x91078f['id'];}}}));}}return BPromise[_0x0315('0x6d')](_0x518b05)['then'](function(_0x8059d1){_0x3d3685=_(_0x3d3685)['union'](_0x8059d1)['compact']()[_0x0315('0x6e')]();return db[_0x0315('0x1f')][_0x0315('0x31')]({'where':{'id':_0x421326[_0x0315('0x3a')]['id']}})[_0x0315('0x17')](function(_0x7fe65c){return db[_0x0315('0x58')]['transaction'](function(_0x19ee3f){return _0x7fe65c[_0x0315('0x60')](_0x421326[_0x0315('0x25')][_0x0315('0x55')],{'transaction':_0x19ee3f})['then'](function(){if(!_[_0x0315('0x6f')](_0x3d3685)){return _0x7fe65c[_0x0315('0x70')](_0x3d3685,{'transaction':_0x19ee3f});}})['then'](function(){_0x3d3685[_0x0315('0x5d')](function(_0x479205){socket[_0x0315('0x5e')](_0x0315('0x71'),{'UserId':_0x479205,'ChatQueueId':_0x7fe65c['id']});});});});});});})[_0x0315('0x17')](respondWithStatusCode(_0x1041e4,null))[_0x0315('0x27')](handleError(_0x1041e4,null));};exports[_0x0315('0x72')]=function(_0x2d5094,_0x489332){return db[_0x0315('0x1f')][_0x0315('0x31')]({'where':{'id':_0x2d5094['params']['id']}})[_0x0315('0x17')](handleEntityNotFound(_0x489332,null))[_0x0315('0x17')](function(_0x49f4d7){if(_0x49f4d7){return _0x49f4d7[_0x0315('0x72')](_0x2d5094[_0x0315('0x33')][_0x0315('0x55')],_['omit'](_0x2d5094['body'],[_0x0315('0x55'),'id'])||{})[_0x0315('0x73')](function(_0x456176){for(var _0x1ee659=0x0;_0x1ee659<_0x2d5094['body'][_0x0315('0x55')]['length'];_0x1ee659+=0x1){socket[_0x0315('0x5e')](_0x0315('0x5f'),{'UserId':Number(_0x2d5094['body'][_0x0315('0x55')][_0x1ee659]),'ChatQueueId':Number(_0x2d5094['params']['id'])});}return _0x456176;});}})[_0x0315('0x17')](respondWithResult(_0x489332,null))[_0x0315('0x27')](handleError(_0x489332,null));};exports[_0x0315('0x70')]=function(_0x4a1e3b,_0x166088){return db[_0x0315('0x1f')][_0x0315('0x31')]({'where':{'id':_0x4a1e3b[_0x0315('0x3a')]['id']}})['then'](handleEntityNotFound(_0x166088,null))[_0x0315('0x17')](function(_0x417d19){if(_0x417d19){return _0x417d19[_0x0315('0x70')](_0x4a1e3b[_0x0315('0x25')][_0x0315('0x55')])[_0x0315('0x17')](function(){if(_[_0x0315('0x74')](_0x4a1e3b[_0x0315('0x25')][_0x0315('0x55')])){for(var _0x3376e7=0x0;_0x3376e7<_0x4a1e3b[_0x0315('0x25')]['ids'][_0x0315('0x40')];_0x3376e7+=0x1){socket[_0x0315('0x5e')](_0x0315('0x71'),{'UserId':Number(_0x4a1e3b[_0x0315('0x25')][_0x0315('0x55')][_0x3376e7]),'ChatQueueId':Number(_0x4a1e3b['params']['id'])});}}else{socket[_0x0315('0x5e')](_0x0315('0x71'),{'UserId':Number(_0x4a1e3b[_0x0315('0x25')]['ids']),'ChatQueueId':Number(_0x4a1e3b[_0x0315('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x166088,null))[_0x0315('0x27')](handleError(_0x166088,null));};exports['getAgents']=function(_0x4195a1,_0x43a537){var _0x4007e4={};var _0x21a0c0={};var _0x4d68ec;var _0x36c0bd;return db[_0x0315('0x1f')][_0x0315('0x3d')]({'where':{'id':_0x4195a1[_0x0315('0x3a')]['id']}})['then'](handleEntityNotFound(_0x43a537,null))[_0x0315('0x17')](function(_0x480150){if(_0x480150){_0x4d68ec=_0x480150;_0x21a0c0[_0x0315('0x29')]=_[_0x0315('0x2a')](db[_0x0315('0x48')][_0x0315('0x2b')]);_0x21a0c0[_0x0315('0x25')]=_[_0x0315('0x2a')](_0x4195a1[_0x0315('0x25')]);_0x21a0c0[_0x0315('0x2c')]=_[_0x0315('0x3f')](_0x21a0c0['model'],_0x21a0c0['query']);_0x4007e4[_0x0315('0x2d')]=_[_0x0315('0x3f')](_0x21a0c0['model'],qs[_0x0315('0x2e')](_0x4195a1[_0x0315('0x25')][_0x0315('0x2e')]));_0x4007e4[_0x0315('0x2d')]=_0x4007e4['attributes']['length']?_0x4007e4[_0x0315('0x2d')]:_0x21a0c0[_0x0315('0x29')];_0x4007e4[_0x0315('0x42')]=qs[_0x0315('0x43')](_0x4195a1[_0x0315('0x25')][_0x0315('0x43')]);_0x4007e4[_0x0315('0x23')]=qs[_0x0315('0x2c')](_[_0x0315('0x44')](_0x4195a1[_0x0315('0x25')],_0x21a0c0[_0x0315('0x2c')]));if(_0x4195a1['query'][_0x0315('0x46')]){_0x4007e4['where']=_[_0x0315('0x2f')](_0x4007e4[_0x0315('0x23')],{'$or':_[_0x0315('0x1e')](_0x4007e4[_0x0315('0x2d')],function(_0x23036b){var _0x26295a={};_0x26295a[_0x23036b]={'$like':'%'+_0x4195a1[_0x0315('0x25')][_0x0315('0x46')]+'%'};return _0x26295a;})});}_0x4007e4=_[_0x0315('0x2f')]({},_0x4007e4,_0x4195a1['options']);return _0x4d68ec[_0x0315('0x75')](_0x4007e4);}})[_0x0315('0x17')](function(_0x12c08d){if(_0x12c08d){_0x36c0bd=_0x12c08d['length'];if(!_0x4195a1[_0x0315('0x25')]['hasOwnProperty'](_0x0315('0x41'))){_0x4007e4[_0x0315('0x13')]=qs[_0x0315('0x13')](_0x4195a1['query'][_0x0315('0x13')]);_0x4007e4[_0x0315('0x11')]=qs[_0x0315('0x11')](_0x4195a1[_0x0315('0x25')][_0x0315('0x11')]);}return _0x4d68ec[_0x0315('0x75')](_0x4007e4);}})[_0x0315('0x17')](function(_0x2aaa56){if(_0x2aaa56){return _0x2aaa56?{'count':_0x36c0bd,'rows':_0x2aaa56}:null;}})['then'](respondWithResult(_0x43a537,null))[_0x0315('0x27')](handleError(_0x43a537,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 76078bb..9b01b75 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 _0x5271=['ChatQueue','setMaxListeners','update','remove','emit','exports','events'];(function(_0x8058ce,_0x6a20f5){var _0xf5f447=function(_0x5348f6){while(--_0x5348f6){_0x8058ce['push'](_0x8058ce['shift']());}};_0xf5f447(++_0x6a20f5);}(_0x5271,0xa0));var _0x1527=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x5271[_0x307d86];return _0x361745;};'use strict';var EventEmitter=require(_0x1527('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1527('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1527('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1527('0x3'),'afterDestroy':_0x1527('0x4')};function emitEvent(_0x3976c9){return function(_0x197592,_0x561476,_0x86712){ChatQueueEvents['emit'](_0x3976c9+':'+_0x197592['id'],_0x197592);ChatQueueEvents[_0x1527('0x5')](_0x3976c9,_0x197592);_0x86712(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x1527('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x5750=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2f9bac,_0x15aac9){var _0x5da607=function(_0x48256d){while(--_0x48256d){_0x2f9bac['push'](_0x2f9bac['shift']());}};_0x5da607(++_0x15aac9);}(_0x5750,0x1bb));var _0x0575=function(_0x3dcaea,_0x2e7222){_0x3dcaea=_0x3dcaea-0x0;var _0xb6f875=_0x5750[_0x3dcaea];return _0xb6f875;};'use strict';var EventEmitter=require(_0x0575('0x0'));var ChatQueue=require(_0x0575('0x1'))['db'][_0x0575('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0575('0x3')](0x0);var events={'afterCreate':_0x0575('0x4'),'afterUpdate':_0x0575('0x5'),'afterDestroy':_0x0575('0x6')};function emitEvent(_0x4fd895){return function(_0x3f4ad5,_0x310cfe,_0x327216){ChatQueueEvents[_0x0575('0x7')](_0x4fd895+':'+_0x3f4ad5['id'],_0x3f4ad5);ChatQueueEvents['emit'](_0x4fd895,_0x3f4ad5);_0x327216(null);};}for(var e in events){if(events[_0x0575('0x8')](e)){var event=events[e];ChatQueue[_0x0575('0x9')](e,emitEvent(event));}}module[_0x0575('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index a7c4e99..7439baf 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 _0x11d3=['api','bluebird','request-promise','path','rimraf','exports','define','chat_queues','util','../../config/logger'];(function(_0x2087d7,_0x22d44f){var _0x53d302=function(_0x5411cb){while(--_0x5411cb){_0x2087d7['push'](_0x2087d7['shift']());}};_0x53d302(++_0x22d44f);}(_0x11d3,0x12a));var _0x311d=function(_0xf00f73,_0x147a86){_0xf00f73=_0xf00f73-0x0;var _0x38e363=_0x11d3[_0xf00f73];return _0x38e363;};'use strict';var _=require('lodash');var util=require(_0x311d('0x0'));var logger=require(_0x311d('0x1'))(_0x311d('0x2'));var moment=require('moment');var BPromise=require(_0x311d('0x3'));var rp=require(_0x311d('0x4'));var fs=require('fs');var path=require(_0x311d('0x5'));var rimraf=require(_0x311d('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x311d('0x7')]=function(_0x5ba715,_0x4882dd){return _0x5ba715[_0x311d('0x8')]('ChatQueue',attributes,{'tableName':_0x311d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd33e=['exports','ChatQueue','chat_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes'];(function(_0x3bacd0,_0x157dcf){var _0x2fd932=function(_0x13d4c1){while(--_0x13d4c1){_0x3bacd0['push'](_0x3bacd0['shift']());}};_0x2fd932(++_0x157dcf);}(_0xd33e,0x137));var _0xed33=function(_0x2570b1,_0x3fed7f){_0x2570b1=_0x2570b1-0x0;var _0x5b4e74=_0xd33e[_0x2570b1];return _0x5b4e74;};'use strict';var _=require(_0xed33('0x0'));var util=require(_0xed33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xed33('0x2'));var BPromise=require(_0xed33('0x3'));var rp=require(_0xed33('0x4'));var fs=require('fs');var path=require(_0xed33('0x5'));var rimraf=require(_0xed33('0x6'));var config=require('../../config/environment');var attributes=require(_0xed33('0x7'));module[_0xed33('0x8')]=function(_0x546d6e,_0x402236){return _0x546d6e['define'](_0xed33('0x9'),attributes,{'tableName':_0xed33('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 8de244e..713fd1d 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 _0x5236=['error','code','ChatQueue,\x20%s,\x20%s','message','catch','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','request','then','info','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5236,0x109));var _0x6523=function(_0x511fcf,_0x202161){_0x511fcf=_0x511fcf-0x0;var _0x3d4e4c=_0x5236[_0x511fcf];return _0x3d4e4c;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});config['redis']=_[_0x6523('0xc')](config[_0x6523('0xd')],{'host':_0x6523('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6523('0xd')]));require(_0x6523('0xf'))[_0x6523('0x10')](socket);function respondWithRpcPromise(_0x2da918,_0x5b18e5,_0x1e5f19){return new BPromise(function(_0x596ac1,_0xfc22f2){return client[_0x6523('0x11')](_0x2da918,_0x1e5f19)[_0x6523('0x12')](function(_0x35b0fb){logger[_0x6523('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5b18e5,_0x6523('0x14'));logger[_0x6523('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5b18e5,_0x6523('0x14'),JSON['stringify'](_0x35b0fb));if(_0x35b0fb['error']){if(_0x35b0fb[_0x6523('0x16')][_0x6523('0x17')]===0x1f4){logger[_0x6523('0x16')](_0x6523('0x18'),_0x5b18e5,_0x35b0fb[_0x6523('0x16')][_0x6523('0x19')]);return _0xfc22f2(_0x35b0fb['error'][_0x6523('0x19')]);}logger['error'](_0x6523('0x18'),_0x5b18e5,_0x35b0fb[_0x6523('0x16')][_0x6523('0x19')]);return _0x596ac1(_0x35b0fb[_0x6523('0x16')][_0x6523('0x19')]);}else{logger[_0x6523('0x13')](_0x6523('0x18'),_0x5b18e5,_0x6523('0x14'));_0x596ac1(_0x35b0fb['result'][_0x6523('0x19')]);}})[_0x6523('0x1a')](function(_0x79a29f){logger['error'](_0x6523('0x18'),_0x5b18e5,_0x79a29f);_0xfc22f2(_0x79a29f);});});}exports['GetChatQueue']=function(_0x5b9dbb){var _0x3b77e6=this;return new Promise(function(_0x193be6,_0x33ba44){return db[_0x6523('0x1b')][_0x6523('0x1c')]({'raw':_0x5b9dbb[_0x6523('0x1d')]?_0x5b9dbb[_0x6523('0x1d')][_0x6523('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b9dbb['options']?_0x5b9dbb['options'][_0x6523('0x1f')]||null:null,'attributes':_0x5b9dbb['options']?_0x5b9dbb[_0x6523('0x1d')][_0x6523('0x20')]||null:null,'limit':_0x5b9dbb[_0x6523('0x1d')]?_0x5b9dbb[_0x6523('0x1d')][_0x6523('0x21')]||null:null,'include':_0x5b9dbb['options']?_0x5b9dbb[_0x6523('0x1d')]['include']?_[_0x6523('0x22')](_0x5b9dbb[_0x6523('0x1d')][_0x6523('0x23')],function(_0x4dc6a9){return{'model':db[_0x4dc6a9[_0x6523('0x24')]],'as':_0x4dc6a9['as'],'attributes':_0x4dc6a9[_0x6523('0x20')],'include':_0x4dc6a9['include']?_[_0x6523('0x22')](_0x4dc6a9[_0x6523('0x23')],function(_0x2c456b){return{'model':db[_0x2c456b[_0x6523('0x24')]],'as':_0x2c456b['as'],'attributes':_0x2c456b[_0x6523('0x20')],'include':_0x2c456b[_0x6523('0x23')]?_['map'](_0x2c456b[_0x6523('0x23')],function(_0x250eed){return{'model':db[_0x250eed['model']],'as':_0x250eed['as'],'attributes':_0x250eed[_0x6523('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6523('0x12')](function(_0x5525b0){logger[_0x6523('0x13')](_0x6523('0x25'),_0x5b9dbb);logger[_0x6523('0x15')](_0x6523('0x25'),_0x5b9dbb,JSON[_0x6523('0x26')](_0x5525b0));_0x193be6(_0x5525b0);})[_0x6523('0x1a')](function(_0x197af1){logger['error'](_0x6523('0x25'),_0x197af1[_0x6523('0x19')],_0x5b9dbb);_0x33ba44(_0x3b77e6['error'](0x1f4,_0x197af1['message']));});});};exports[_0x6523('0x27')]=function(_0x54a3f3){var _0x4d948a=this;return new Promise(function(_0x20c4a4,_0x1263bc){return db[_0x6523('0x1b')][_0x6523('0x28')]({'raw':_0x54a3f3[_0x6523('0x1d')]?_0x54a3f3[_0x6523('0x1d')][_0x6523('0x1e')]===undefined?!![]:![]:!![],'where':_0x54a3f3[_0x6523('0x1d')]?_0x54a3f3[_0x6523('0x1d')]['where']||null:null,'attributes':_0x54a3f3[_0x6523('0x1d')]?_0x54a3f3[_0x6523('0x1d')][_0x6523('0x20')]||null:null,'include':_0x54a3f3['options']?_0x54a3f3[_0x6523('0x1d')][_0x6523('0x23')]?_[_0x6523('0x22')](_0x54a3f3[_0x6523('0x1d')]['include'],function(_0x45f735){return{'model':db[_0x45f735['model']],'as':_0x45f735['as'],'attributes':_0x45f735['attributes'],'include':_0x45f735['include']?_[_0x6523('0x22')](_0x45f735[_0x6523('0x23')],function(_0x295621){return{'model':db[_0x295621['model']],'as':_0x295621['as'],'attributes':_0x295621[_0x6523('0x20')],'include':_0x295621[_0x6523('0x23')]?_['map'](_0x295621[_0x6523('0x23')],function(_0xc8479a){return{'model':db[_0xc8479a[_0x6523('0x24')]],'as':_0xc8479a['as'],'attributes':_0xc8479a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6523('0x12')](function(_0x8659d0){logger['info'](_0x6523('0x27'),_0x54a3f3);logger[_0x6523('0x15')](_0x6523('0x27'),_0x54a3f3,JSON[_0x6523('0x26')](_0x8659d0));_0x20c4a4(_0x8659d0);})[_0x6523('0x1a')](function(_0xa0fa14){logger[_0x6523('0x16')](_0x6523('0x27'),_0xa0fa14[_0x6523('0x19')],_0x54a3f3);_0x1263bc(_0x4d948a[_0x6523('0x16')](0x1f4,_0xa0fa14[_0x6523('0x19')]));});});}; \ No newline at end of file +var _0x617f=['http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetChatQueue','ChatQueue','options','raw','where','attributes','map','include','model','then','catch','ShowChatQueue','find','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d869c,_0x1a903a){var _0x6855e2=function(_0x3b2b38){while(--_0x3b2b38){_0x3d869c['push'](_0x3d869c['shift']());}};_0x6855e2(++_0x1a903a);}(_0x617f,0x15e));var _0xf617=function(_0x5ce3a7,_0x1e03d2){_0x5ce3a7=_0x5ce3a7-0x0;var _0x1dafb0=_0x617f[_0x5ce3a7];return _0x1dafb0;};'use strict';var _=require('lodash');var util=require(_0xf617('0x0'));var moment=require(_0xf617('0x1'));var BPromise=require(_0xf617('0x2'));var rs=require(_0xf617('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf617('0x4'))['db'];var utils=require(_0xf617('0x5'));var logger=require(_0xf617('0x6'))(_0xf617('0x7'));var config=require(_0xf617('0x8'));var jayson=require(_0xf617('0x9'));var client=jayson['client'][_0xf617('0xa')]({'port':0x232a});config['redis']=_[_0xf617('0xb')](config[_0xf617('0xc')],{'host':_0xf617('0xd'),'port':0x18eb});var socket=require(_0xf617('0xe'))(new Redis(config[_0xf617('0xc')]));require(_0xf617('0xf'))[_0xf617('0x10')](socket);function respondWithRpcPromise(_0x2ea231,_0x426738,_0x12dfa0){return new BPromise(function(_0x569002,_0x342c2a){return client[_0xf617('0x11')](_0x2ea231,_0x12dfa0)['then'](function(_0x550350){logger[_0xf617('0x12')](_0xf617('0x13'),_0x426738,_0xf617('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x426738,_0xf617('0x14'),JSON[_0xf617('0x15')](_0x550350));if(_0x550350[_0xf617('0x16')]){if(_0x550350[_0xf617('0x16')][_0xf617('0x17')]===0x1f4){logger[_0xf617('0x16')]('ChatQueue,\x20%s,\x20%s',_0x426738,_0x550350[_0xf617('0x16')]['message']);return _0x342c2a(_0x550350['error'][_0xf617('0x18')]);}logger[_0xf617('0x16')](_0xf617('0x13'),_0x426738,_0x550350[_0xf617('0x16')][_0xf617('0x18')]);return _0x569002(_0x550350[_0xf617('0x16')]['message']);}else{logger[_0xf617('0x12')](_0xf617('0x13'),_0x426738,'request\x20sent');_0x569002(_0x550350[_0xf617('0x19')][_0xf617('0x18')]);}})['catch'](function(_0xd23d4f){logger[_0xf617('0x16')](_0xf617('0x13'),_0x426738,_0xd23d4f);_0x342c2a(_0xd23d4f);});});}exports[_0xf617('0x1a')]=function(_0xf5ae02){var _0x53dabd=this;return new Promise(function(_0x591d2e,_0x1c9f8c){return db[_0xf617('0x1b')]['findAll']({'raw':_0xf5ae02[_0xf617('0x1c')]?_0xf5ae02[_0xf617('0x1c')][_0xf617('0x1d')]===undefined?!![]:![]:!![],'where':_0xf5ae02[_0xf617('0x1c')]?_0xf5ae02['options'][_0xf617('0x1e')]||null:null,'attributes':_0xf5ae02[_0xf617('0x1c')]?_0xf5ae02[_0xf617('0x1c')][_0xf617('0x1f')]||null:null,'limit':_0xf5ae02[_0xf617('0x1c')]?_0xf5ae02[_0xf617('0x1c')]['limit']||null:null,'include':_0xf5ae02[_0xf617('0x1c')]?_0xf5ae02[_0xf617('0x1c')]['include']?_[_0xf617('0x20')](_0xf5ae02['options'][_0xf617('0x21')],function(_0x474062){return{'model':db[_0x474062[_0xf617('0x22')]],'as':_0x474062['as'],'attributes':_0x474062[_0xf617('0x1f')],'include':_0x474062[_0xf617('0x21')]?_['map'](_0x474062['include'],function(_0x13235b){return{'model':db[_0x13235b['model']],'as':_0x13235b['as'],'attributes':_0x13235b[_0xf617('0x1f')],'include':_0x13235b['include']?_[_0xf617('0x20')](_0x13235b[_0xf617('0x21')],function(_0x3c6e95){return{'model':db[_0x3c6e95[_0xf617('0x22')]],'as':_0x3c6e95['as'],'attributes':_0x3c6e95[_0xf617('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf617('0x23')](function(_0x350453){logger[_0xf617('0x12')](_0xf617('0x1a'),_0xf5ae02);logger['debug'](_0xf617('0x1a'),_0xf5ae02,JSON[_0xf617('0x15')](_0x350453));_0x591d2e(_0x350453);})[_0xf617('0x24')](function(_0x3b228b){logger[_0xf617('0x16')](_0xf617('0x1a'),_0x3b228b[_0xf617('0x18')],_0xf5ae02);_0x1c9f8c(_0x53dabd[_0xf617('0x16')](0x1f4,_0x3b228b['message']));});});};exports[_0xf617('0x25')]=function(_0x443915){var _0x538b8e=this;return new Promise(function(_0x5ba464,_0xca2772){return db[_0xf617('0x1b')][_0xf617('0x26')]({'raw':_0x443915[_0xf617('0x1c')]?_0x443915[_0xf617('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x443915[_0xf617('0x1c')]?_0x443915[_0xf617('0x1c')][_0xf617('0x1e')]||null:null,'attributes':_0x443915[_0xf617('0x1c')]?_0x443915['options'][_0xf617('0x1f')]||null:null,'include':_0x443915[_0xf617('0x1c')]?_0x443915[_0xf617('0x1c')]['include']?_[_0xf617('0x20')](_0x443915[_0xf617('0x1c')][_0xf617('0x21')],function(_0x5b8914){return{'model':db[_0x5b8914['model']],'as':_0x5b8914['as'],'attributes':_0x5b8914['attributes'],'include':_0x5b8914[_0xf617('0x21')]?_[_0xf617('0x20')](_0x5b8914[_0xf617('0x21')],function(_0xdaeb59){return{'model':db[_0xdaeb59['model']],'as':_0xdaeb59['as'],'attributes':_0xdaeb59[_0xf617('0x1f')],'include':_0xdaeb59['include']?_['map'](_0xdaeb59['include'],function(_0x220114){return{'model':db[_0x220114[_0xf617('0x22')]],'as':_0x220114['as'],'attributes':_0x220114['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x156f09){logger[_0xf617('0x12')](_0xf617('0x25'),_0x443915);logger[_0xf617('0x27')](_0xf617('0x25'),_0x443915,JSON[_0xf617('0x15')](_0x156f09));_0x5ba464(_0x156f09);})[_0xf617('0x24')](function(_0x207544){logger[_0xf617('0x16')](_0xf617('0x25'),_0x207544['message'],_0x443915);_0xca2772(_0x538b8e['error'](0x1f4,_0x207544[_0xf617('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fc485ed..e55c9c3 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x53a5b1,_0x2c876a){var _0x5a8841=function(_0x4bcdff){while(--_0x4bcdff){_0x53a5b1['push'](_0x53a5b1['shift']());}};_0x5a8841(++_0x2c876a);}(_0x22fb,0x192));var _0xb22f=function(_0x5ee1fe,_0x19641b){_0x5ee1fe=_0x5ee1fe-0x0;var _0x4318e8=_0x22fb[_0x5ee1fe];return _0x4318e8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file +var _0x4b19=['remove','update','emit','removeListener','register','chatQueue:','./chatQueue.events'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x4b19,0x195));var _0x94b1=function(_0x2464a5,_0x46e146){_0x2464a5=_0x2464a5-0x0;var _0x49c410=_0x4b19[_0x2464a5];return _0x49c410;};'use strict';var ChatQueueEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatQueueEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatQueueEvents['on'](_0x40c69c,_0x201a02);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 81cf572..700990a 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x275780,_0x11de3a){var _0x59e77b=function(_0x205d02){while(--_0x205d02){_0x275780['push'](_0x275780['shift']());}};_0x59e77b(++_0x11de3a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24a10d,_0x186056){var _0x25a80c=function(_0x106b8b){while(--_0x106b8b){_0x24a10d['push'](_0x24a10d['shift']());}};_0x25a80c(++_0x186056);}(_0x008c,0x188));var _0xc008=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x008c[_0x3cf5a3];return _0x39ba2d;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index d0bce30..0e0272b 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 _0xb209=['sequelize','exports','STRING','DATE','moment'];(function(_0x188c3d,_0x35d1b7){var _0x8bfd13=function(_0x3d6c2f){while(--_0x3d6c2f){_0x188c3d['push'](_0x188c3d['shift']());}};_0x8bfd13(++_0x35d1b7);}(_0xb209,0x6d));var _0x9b20=function(_0x4e9c7b,_0x63d7fe){_0x4e9c7b=_0x4e9c7b-0x0;var _0x24b56d=_0xb209[_0x4e9c7b];return _0x24b56d;};'use strict';var moment=require(_0x9b20('0x0'));var Sequelize=require(_0x9b20('0x1'));module[_0x9b20('0x2')]={'uniqueid':{'type':Sequelize[_0x9b20('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9b20('0x4')]},'leaveAt':{'type':Sequelize[_0x9b20('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9b20('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x793b=['moment','exports','STRING','DATE'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x793b,0xf0));var _0xb793=function(_0x4be3f9,_0x18a6b1){_0x4be3f9=_0x4be3f9-0x0;var _0x1bad41=_0x793b[_0x4be3f9];return _0x1bad41;};'use strict';var moment=require(_0xb793('0x0'));var Sequelize=require('sequelize');module[_0xb793('0x1')]={'uniqueid':{'type':Sequelize[_0xb793('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb793('0x3')]},'acceptAt':{'type':Sequelize[_0xb793('0x3')]},'exitAt':{'type':Sequelize[_0xb793('0x3')]},'reason':{'type':Sequelize[_0xb793('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 6ff4930..da1f2e5 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 _0xa498=['params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0xa498,0x179));var _0x8a49=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0xa498[_0x5a2d3f];return _0x5c65d8;};'use strict';var emlformat=require(_0x8a49('0x0'));var rimraf=require(_0x8a49('0x1'));var zipdir=require(_0x8a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a49('0x3'));var moment=require(_0x8a49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8a49('0x5'));var util=require(_0x8a49('0x6'));var path=require(_0x8a49('0x7'));var sox=require(_0x8a49('0x8'));var csv=require(_0x8a49('0x9'));var ejs=require(_0x8a49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a49('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a49('0xc'));var deskjs=require(_0x8a49('0xd'));var toCsv=require(_0x8a49('0x9'));var querystring=require(_0x8a49('0xe'));var Papa=require(_0x8a49('0xf'));var Redis=require(_0x8a49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x11'));var as=require(_0x8a49('0x12'));var hardwareService=require(_0x8a49('0x13'));var logger=require(_0x8a49('0x14'))(_0x8a49('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a49('0x16'))['db'];function respondWithStatusCode(_0x5b7fe8,_0x408ca9){_0x408ca9=_0x408ca9||0xcc;return function(_0x5c7d24){if(_0x5c7d24){return _0x5b7fe8['sendStatus'](_0x408ca9);}return _0x5b7fe8[_0x8a49('0x17')](_0x408ca9)[_0x8a49('0x18')]();};}function respondWithResult(_0x57bcb3,_0x45b414){_0x45b414=_0x45b414||0xc8;return function(_0x3e4e73){if(_0x3e4e73){return _0x57bcb3['status'](_0x45b414)[_0x8a49('0x19')](_0x3e4e73);}};}function respondWithFilteredResult(_0x424925,_0x4a6aec){return function(_0x1fdaf4){if(_0x1fdaf4){var _0x50a72d=typeof _0x4a6aec[_0x8a49('0x1a')]==='undefined'&&typeof _0x4a6aec['limit']==='undefined';var _0x18f466=_0x1fdaf4[_0x8a49('0x1b')];var _0x563bbc=_0x50a72d?0x0:_0x4a6aec[_0x8a49('0x1a')];var _0x22f569=_0x50a72d?_0x1fdaf4[_0x8a49('0x1b')]:_0x4a6aec[_0x8a49('0x1a')]+_0x4a6aec[_0x8a49('0x1c')];var _0x42c2a5;if(_0x22f569>=_0x18f466){_0x22f569=_0x18f466;_0x42c2a5=0xc8;}else{_0x42c2a5=0xce;}_0x424925['status'](_0x42c2a5);return _0x424925[_0x8a49('0x1d')]('Content-Range',_0x563bbc+'-'+_0x22f569+'/'+_0x18f466)[_0x8a49('0x19')](_0x1fdaf4);}return null;};}function patchUpdates(_0x254d6e){return function(_0x49526a){try{jsonpatch['apply'](_0x49526a,_0x254d6e,!![]);}catch(_0x14bfb2){return BPromise[_0x8a49('0x1e')](_0x14bfb2);}return _0x49526a[_0x8a49('0x1f')]();};}function saveUpdates(_0x3659da,_0xcebf3e){return function(_0x4e0bf1){if(_0x4e0bf1){return _0x4e0bf1[_0x8a49('0x20')](_0x3659da)[_0x8a49('0x21')](function(_0x19f79b){return _0x19f79b;});}return null;};}function removeEntity(_0x2d47f4,_0x4b895f){return function(_0x19431c){if(_0x19431c){return _0x19431c[_0x8a49('0x22')]()[_0x8a49('0x21')](function(){_0x2d47f4[_0x8a49('0x17')](0xcc)[_0x8a49('0x18')]();});}};}function handleEntityNotFound(_0x493380,_0x4d177a){return function(_0x4304d4){if(!_0x4304d4){_0x493380[_0x8a49('0x23')](0x194);}return _0x4304d4;};}function handleError(_0x5de9a2,_0x385a06){_0x385a06=_0x385a06||0x1f4;return function(_0x1a8e0b){logger[_0x8a49('0x24')](_0x1a8e0b[_0x8a49('0x25')]);if(_0x1a8e0b['name']){delete _0x1a8e0b[_0x8a49('0x26')];}_0x5de9a2[_0x8a49('0x17')](_0x385a06)[_0x8a49('0x27')](_0x1a8e0b);};}exports[_0x8a49('0x28')]=function(_0x59e4a9,_0x1dc14a){var _0x31673a={},_0x3eadad={},_0x1b181b={'count':0x0,'rows':[]};var _0x477c36=_[_0x8a49('0x29')](db[_0x8a49('0x2a')]['rawAttributes'],function(_0x4f256e){return{'name':_0x4f256e[_0x8a49('0x2b')],'type':_0x4f256e[_0x8a49('0x2c')][_0x8a49('0x2d')]};});_0x3eadad[_0x8a49('0x2e')]=_['map'](_0x477c36,_0x8a49('0x26'));_0x3eadad[_0x8a49('0x2f')]=_[_0x8a49('0x30')](_0x59e4a9[_0x8a49('0x2f')]);_0x3eadad[_0x8a49('0x31')]=_['intersection'](_0x3eadad[_0x8a49('0x2e')],_0x3eadad['query']);_0x31673a[_0x8a49('0x32')]=_[_0x8a49('0x33')](_0x3eadad[_0x8a49('0x2e')],qs[_0x8a49('0x34')](_0x59e4a9['query'][_0x8a49('0x34')]));_0x31673a[_0x8a49('0x32')]=_0x31673a[_0x8a49('0x32')][_0x8a49('0x35')]?_0x31673a[_0x8a49('0x32')]:_0x3eadad['model'];if(!_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x36')](_0x8a49('0x37'))){_0x31673a[_0x8a49('0x1c')]=qs['limit'](_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x1c')]);_0x31673a['offset']=qs['offset'](_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x1a')]);}_0x31673a[_0x8a49('0x38')]=qs[_0x8a49('0x39')](_0x59e4a9['query'][_0x8a49('0x39')]);_0x31673a['where']=qs[_0x8a49('0x31')](_[_0x8a49('0x3a')](_0x59e4a9[_0x8a49('0x2f')],_0x3eadad[_0x8a49('0x31')]),_0x477c36);if(_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x3b')]){_0x31673a[_0x8a49('0x3c')]=_[_0x8a49('0x3d')](_0x31673a[_0x8a49('0x3c')],{'$or':_[_0x8a49('0x29')](_0x477c36,function(_0x4c08a5){if(_0x4c08a5[_0x8a49('0x2c')]!==_0x8a49('0x3e')){var _0x34d9f7={};_0x34d9f7[_0x4c08a5[_0x8a49('0x26')]]={'$like':'%'+_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x3b')]+'%'};return _0x34d9f7;}})});}_0x31673a=_[_0x8a49('0x3d')]({},_0x31673a,_0x59e4a9[_0x8a49('0x3f')]);var _0x63271b={'where':_0x31673a[_0x8a49('0x3c')]};return db[_0x8a49('0x2a')]['count'](_0x63271b)[_0x8a49('0x21')](function(_0x5dc751){_0x1b181b[_0x8a49('0x1b')]=_0x5dc751;if(_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x40')]){_0x31673a[_0x8a49('0x41')]=[{'all':!![]}];}return db[_0x8a49('0x2a')][_0x8a49('0x42')](_0x31673a);})[_0x8a49('0x21')](function(_0xfad17b){_0x1b181b[_0x8a49('0x43')]=_0xfad17b;return _0x1b181b;})[_0x8a49('0x21')](respondWithFilteredResult(_0x1dc14a,_0x31673a))[_0x8a49('0x44')](handleError(_0x1dc14a,null));};exports[_0x8a49('0x45')]=function(_0xa8fbc2,_0xde8f5d){var _0x42225f={'raw':!![],'where':{'id':_0xa8fbc2['params']['id']}},_0x5d1d55={};_0x5d1d55[_0x8a49('0x2e')]=_[_0x8a49('0x30')](db[_0x8a49('0x2a')]['rawAttributes']);_0x5d1d55[_0x8a49('0x2f')]=_['keys'](_0xa8fbc2[_0x8a49('0x2f')]);_0x5d1d55[_0x8a49('0x31')]=_[_0x8a49('0x33')](_0x5d1d55[_0x8a49('0x2e')],_0x5d1d55[_0x8a49('0x2f')]);_0x42225f[_0x8a49('0x32')]=_[_0x8a49('0x33')](_0x5d1d55[_0x8a49('0x2e')],qs[_0x8a49('0x34')](_0xa8fbc2[_0x8a49('0x2f')][_0x8a49('0x34')]));_0x42225f['attributes']=_0x42225f[_0x8a49('0x32')][_0x8a49('0x35')]?_0x42225f[_0x8a49('0x32')]:_0x5d1d55[_0x8a49('0x2e')];if(_0xa8fbc2[_0x8a49('0x2f')]['includeAll']){_0x42225f[_0x8a49('0x41')]=[{'all':!![]}];}_0x42225f=_[_0x8a49('0x3d')]({},_0x42225f,_0xa8fbc2[_0x8a49('0x3f')]);return db['ChatQueueReport']['find'](_0x42225f)[_0x8a49('0x21')](handleEntityNotFound(_0xde8f5d,null))[_0x8a49('0x21')](respondWithResult(_0xde8f5d,null))['catch'](handleError(_0xde8f5d,null));};exports[_0x8a49('0x46')]=function(_0x34aeb9,_0x3c7b36){return db[_0x8a49('0x2a')][_0x8a49('0x46')](_0x34aeb9[_0x8a49('0x47')],{})[_0x8a49('0x21')](respondWithResult(_0x3c7b36,0xc9))[_0x8a49('0x44')](handleError(_0x3c7b36,null));};exports[_0x8a49('0x20')]=function(_0x362d8f,_0x5e727e){if(_0x362d8f['body']['id']){delete _0x362d8f[_0x8a49('0x47')]['id'];}return db[_0x8a49('0x2a')][_0x8a49('0x48')]({'where':{'id':_0x362d8f[_0x8a49('0x49')]['id']}})[_0x8a49('0x21')](handleEntityNotFound(_0x5e727e,null))[_0x8a49('0x21')](saveUpdates(_0x362d8f[_0x8a49('0x47')],null))[_0x8a49('0x21')](respondWithResult(_0x5e727e,null))[_0x8a49('0x44')](handleError(_0x5e727e,null));};exports[_0x8a49('0x22')]=function(_0x5d2dbb,_0x1923a5){return db[_0x8a49('0x2a')][_0x8a49('0x48')]({'where':{'id':_0x5d2dbb[_0x8a49('0x49')]['id']}})['then'](handleEntityNotFound(_0x1923a5,null))[_0x8a49('0x21')](removeEntity(_0x1923a5,null))[_0x8a49('0x44')](handleError(_0x1923a5,null));};exports[_0x8a49('0x4a')]=function(_0xa78845,_0x458b26){return db[_0x8a49('0x2a')][_0x8a49('0x4a')]()['then'](respondWithResult(_0x458b26,null))['catch'](handleError(_0x458b26,null));}; \ No newline at end of file +var _0x01db=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1b8be9,_0x49dce5){var _0x5a544f=function(_0x4cd533){while(--_0x4cd533){_0x1b8be9['push'](_0x1b8be9['shift']());}};_0x5a544f(++_0x49dce5);}(_0x01db,0x171));var _0xb01d=function(_0x1e2d59,_0x58a35f){_0x1e2d59=_0x1e2d59-0x0;var _0x2cffb6=_0x01db[_0x1e2d59];return _0x2cffb6;};'use strict';var emlformat=require(_0xb01d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb01d('0x1'));var rp=require(_0xb01d('0x2'));var moment=require(_0xb01d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb01d('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb01d('0x5'));var csv=require(_0xb01d('0x6'));var ejs=require(_0xb01d('0x7'));var fs=require('fs');var fs_extra=require(_0xb01d('0x8'));var _=require(_0xb01d('0x9'));var squel=require(_0xb01d('0xa'));var crypto=require(_0xb01d('0xb'));var jsforce=require(_0xb01d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb01d('0xd'));var Papa=require(_0xb01d('0xe'));var Redis=require(_0xb01d('0xf'));var authService=require(_0xb01d('0x10'));var qs=require(_0xb01d('0x11'));var as=require(_0xb01d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb01d('0x13'));var utils=require(_0xb01d('0x14'));var config=require(_0xb01d('0x15'));var licenseUtil=require(_0xb01d('0x16'));var db=require(_0xb01d('0x17'))['db'];function respondWithStatusCode(_0x447479,_0xbcc293){_0xbcc293=_0xbcc293||0xcc;return function(_0x48b905){if(_0x48b905){return _0x447479['sendStatus'](_0xbcc293);}return _0x447479[_0xb01d('0x18')](_0xbcc293)['end']();};}function respondWithResult(_0x246537,_0x2e1ec7){_0x2e1ec7=_0x2e1ec7||0xc8;return function(_0x4a7641){if(_0x4a7641){return _0x246537[_0xb01d('0x18')](_0x2e1ec7)[_0xb01d('0x19')](_0x4a7641);}};}function respondWithFilteredResult(_0x286c13,_0x219327){return function(_0x515789){if(_0x515789){var _0x135604=typeof _0x219327['offset']===_0xb01d('0x1a')&&typeof _0x219327[_0xb01d('0x1b')]===_0xb01d('0x1a');var _0x2009a2=_0x515789['count'];var _0xe47874=_0x135604?0x0:_0x219327[_0xb01d('0x1c')];var _0x39eaaf=_0x135604?_0x515789['count']:_0x219327[_0xb01d('0x1c')]+_0x219327['limit'];var _0x42961b;if(_0x39eaaf>=_0x2009a2){_0x39eaaf=_0x2009a2;_0x42961b=0xc8;}else{_0x42961b=0xce;}_0x286c13[_0xb01d('0x18')](_0x42961b);return _0x286c13[_0xb01d('0x1d')](_0xb01d('0x1e'),_0xe47874+'-'+_0x39eaaf+'/'+_0x2009a2)[_0xb01d('0x19')](_0x515789);}return null;};}function patchUpdates(_0x4d517e){return function(_0x2528ac){try{jsonpatch[_0xb01d('0x1f')](_0x2528ac,_0x4d517e,!![]);}catch(_0x149b50){return BPromise[_0xb01d('0x20')](_0x149b50);}return _0x2528ac[_0xb01d('0x21')]();};}function saveUpdates(_0x7de0a2,_0x28f643){return function(_0x42064d){if(_0x42064d){return _0x42064d[_0xb01d('0x22')](_0x7de0a2)[_0xb01d('0x23')](function(_0x1151ea){return _0x1151ea;});}return null;};}function removeEntity(_0x19ef37,_0x515d52){return function(_0x446824){if(_0x446824){return _0x446824['destroy']()[_0xb01d('0x23')](function(){_0x19ef37[_0xb01d('0x18')](0xcc)[_0xb01d('0x24')]();});}};}function handleEntityNotFound(_0x3ce3f8,_0xf92ae7){return function(_0x1d8f04){if(!_0x1d8f04){_0x3ce3f8[_0xb01d('0x25')](0x194);}return _0x1d8f04;};}function handleError(_0x1dcbcd,_0xe9e66e){_0xe9e66e=_0xe9e66e||0x1f4;return function(_0x1236c2){logger[_0xb01d('0x26')](_0x1236c2['stack']);if(_0x1236c2[_0xb01d('0x27')]){delete _0x1236c2[_0xb01d('0x27')];}_0x1dcbcd[_0xb01d('0x18')](_0xe9e66e)['send'](_0x1236c2);};}exports[_0xb01d('0x28')]=function(_0x1bd8d2,_0x1659fa){var _0x58b452={},_0x29b32c={},_0x5007d1={'count':0x0,'rows':[]};var _0x13345a=_[_0xb01d('0x29')](db[_0xb01d('0x2a')]['rawAttributes'],function(_0x2f3046){return{'name':_0x2f3046[_0xb01d('0x2b')],'type':_0x2f3046[_0xb01d('0x2c')][_0xb01d('0x2d')]};});_0x29b32c[_0xb01d('0x2e')]=_[_0xb01d('0x29')](_0x13345a,'name');_0x29b32c[_0xb01d('0x2f')]=_[_0xb01d('0x30')](_0x1bd8d2[_0xb01d('0x2f')]);_0x29b32c['filters']=_[_0xb01d('0x31')](_0x29b32c['model'],_0x29b32c['query']);_0x58b452[_0xb01d('0x32')]=_[_0xb01d('0x31')](_0x29b32c['model'],qs['fields'](_0x1bd8d2[_0xb01d('0x2f')][_0xb01d('0x33')]));_0x58b452[_0xb01d('0x32')]=_0x58b452[_0xb01d('0x32')][_0xb01d('0x34')]?_0x58b452[_0xb01d('0x32')]:_0x29b32c[_0xb01d('0x2e')];if(!_0x1bd8d2[_0xb01d('0x2f')][_0xb01d('0x35')]('nolimit')){_0x58b452[_0xb01d('0x1b')]=qs[_0xb01d('0x1b')](_0x1bd8d2[_0xb01d('0x2f')][_0xb01d('0x1b')]);_0x58b452['offset']=qs[_0xb01d('0x1c')](_0x1bd8d2['query'][_0xb01d('0x1c')]);}_0x58b452[_0xb01d('0x36')]=qs[_0xb01d('0x37')](_0x1bd8d2[_0xb01d('0x2f')]['sort']);_0x58b452[_0xb01d('0x38')]=qs[_0xb01d('0x39')](_[_0xb01d('0x3a')](_0x1bd8d2[_0xb01d('0x2f')],_0x29b32c[_0xb01d('0x39')]),_0x13345a);if(_0x1bd8d2['query'][_0xb01d('0x3b')]){_0x58b452[_0xb01d('0x38')]=_[_0xb01d('0x3c')](_0x58b452[_0xb01d('0x38')],{'$or':_[_0xb01d('0x29')](_0x13345a,function(_0x25c283){if(_0x25c283[_0xb01d('0x2c')]!=='VIRTUAL'){var _0x4b93f0={};_0x4b93f0[_0x25c283[_0xb01d('0x27')]]={'$like':'%'+_0x1bd8d2['query'][_0xb01d('0x3b')]+'%'};return _0x4b93f0;}})});}_0x58b452=_[_0xb01d('0x3c')]({},_0x58b452,_0x1bd8d2['options']);var _0x847853={'where':_0x58b452[_0xb01d('0x38')]};return db[_0xb01d('0x2a')][_0xb01d('0x3d')](_0x847853)['then'](function(_0x459f4a){_0x5007d1[_0xb01d('0x3d')]=_0x459f4a;if(_0x1bd8d2['query'][_0xb01d('0x3e')]){_0x58b452['include']=[{'all':!![]}];}return db[_0xb01d('0x2a')][_0xb01d('0x3f')](_0x58b452);})[_0xb01d('0x23')](function(_0x59023b){_0x5007d1[_0xb01d('0x40')]=_0x59023b;return _0x5007d1;})['then'](respondWithFilteredResult(_0x1659fa,_0x58b452))[_0xb01d('0x41')](handleError(_0x1659fa,null));};exports[_0xb01d('0x42')]=function(_0x2d29ad,_0x2f582f){var _0x5087cb={'raw':!![],'where':{'id':_0x2d29ad[_0xb01d('0x43')]['id']}},_0x502880={};_0x502880[_0xb01d('0x2e')]=_[_0xb01d('0x30')](db[_0xb01d('0x2a')][_0xb01d('0x44')]);_0x502880[_0xb01d('0x2f')]=_[_0xb01d('0x30')](_0x2d29ad[_0xb01d('0x2f')]);_0x502880[_0xb01d('0x39')]=_['intersection'](_0x502880['model'],_0x502880['query']);_0x5087cb[_0xb01d('0x32')]=_[_0xb01d('0x31')](_0x502880['model'],qs[_0xb01d('0x33')](_0x2d29ad['query']['fields']));_0x5087cb[_0xb01d('0x32')]=_0x5087cb[_0xb01d('0x32')]['length']?_0x5087cb[_0xb01d('0x32')]:_0x502880[_0xb01d('0x2e')];if(_0x2d29ad[_0xb01d('0x2f')][_0xb01d('0x3e')]){_0x5087cb[_0xb01d('0x45')]=[{'all':!![]}];}_0x5087cb=_[_0xb01d('0x3c')]({},_0x5087cb,_0x2d29ad[_0xb01d('0x46')]);return db['ChatQueueReport']['find'](_0x5087cb)[_0xb01d('0x23')](handleEntityNotFound(_0x2f582f,null))['then'](respondWithResult(_0x2f582f,null))['catch'](handleError(_0x2f582f,null));};exports[_0xb01d('0x47')]=function(_0x75b2e7,_0x361acb){return db['ChatQueueReport'][_0xb01d('0x47')](_0x75b2e7[_0xb01d('0x48')],{})[_0xb01d('0x23')](respondWithResult(_0x361acb,0xc9))['catch'](handleError(_0x361acb,null));};exports[_0xb01d('0x22')]=function(_0x500bff,_0x494b9c){if(_0x500bff[_0xb01d('0x48')]['id']){delete _0x500bff[_0xb01d('0x48')]['id'];}return db[_0xb01d('0x2a')][_0xb01d('0x49')]({'where':{'id':_0x500bff[_0xb01d('0x43')]['id']}})[_0xb01d('0x23')](handleEntityNotFound(_0x494b9c,null))[_0xb01d('0x23')](saveUpdates(_0x500bff[_0xb01d('0x48')],null))[_0xb01d('0x23')](respondWithResult(_0x494b9c,null))[_0xb01d('0x41')](handleError(_0x494b9c,null));};exports[_0xb01d('0x4a')]=function(_0x403786,_0xe9e895){return db[_0xb01d('0x2a')][_0xb01d('0x49')]({'where':{'id':_0x403786['params']['id']}})[_0xb01d('0x23')](handleEntityNotFound(_0xe9e895,null))[_0xb01d('0x23')](removeEntity(_0xe9e895,null))[_0xb01d('0x41')](handleError(_0xe9e895,null));};exports[_0xb01d('0x4b')]=function(_0x128512,_0x1332a3){return db['ChatQueueReport'][_0xb01d('0x4b')]()[_0xb01d('0x23')](respondWithResult(_0x1332a3,null))[_0xb01d('0x41')](handleError(_0x1332a3,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 36d7383..30769a5 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x398d0c,_0x14a070){var _0x216f09=function(_0x33ed85){while(--_0x33ed85){_0x398d0c['push'](_0x398d0c['shift']());}};_0x216f09(++_0x14a070);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x43121f,_0x39d303){var _0x114067=function(_0x3b6b12){while(--_0x3b6b12){_0x43121f['push'](_0x43121f['shift']());}};_0x114067(++_0x39d303);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b055971..87713be 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 _0xb22d=['catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0xc56635,_0x3815ac){var _0x258825=function(_0x2ccde7){while(--_0x2ccde7){_0xc56635['push'](_0xc56635['shift']());}};_0x258825(++_0x3815ac);}(_0xb22d,0x8e));var _0xdb22=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0xb22d[_0x4f32de];return _0x149821;};'use strict';var _=require(_0xdb22('0x0'));var util=require(_0xdb22('0x1'));var moment=require(_0xdb22('0x2'));var BPromise=require(_0xdb22('0x3'));var rs=require(_0xdb22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb22('0x5'))['db'];var utils=require(_0xdb22('0x6'));var logger=require(_0xdb22('0x7'))(_0xdb22('0x8'));var config=require(_0xdb22('0x9'));var jayson=require(_0xdb22('0xa'));var client=jayson[_0xdb22('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44e187,_0x2b39d6,_0x426061){return new BPromise(function(_0x42fabf,_0x1151f6){return client['request'](_0x44e187,_0x426061)[_0xdb22('0xc')](function(_0x36d629){logger[_0xdb22('0xd')](_0xdb22('0xe'),_0x2b39d6,'request\x20sent');logger[_0xdb22('0xf')](_0xdb22('0x10'),_0x2b39d6,_0xdb22('0x11'),JSON[_0xdb22('0x12')](_0x36d629));if(_0x36d629[_0xdb22('0x13')]){if(_0x36d629[_0xdb22('0x13')][_0xdb22('0x14')]===0x1f4){logger[_0xdb22('0x13')](_0xdb22('0xe'),_0x2b39d6,_0x36d629[_0xdb22('0x13')][_0xdb22('0x15')]);return _0x1151f6(_0x36d629['error'][_0xdb22('0x15')]);}logger[_0xdb22('0x13')](_0xdb22('0xe'),_0x2b39d6,_0x36d629['error'][_0xdb22('0x15')]);return _0x42fabf(_0x36d629['error'][_0xdb22('0x15')]);}else{logger[_0xdb22('0xd')](_0xdb22('0xe'),_0x2b39d6,_0xdb22('0x11'));_0x42fabf(_0x36d629[_0xdb22('0x16')][_0xdb22('0x15')]);}})[_0xdb22('0x17')](function(_0x2602a5){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2b39d6,_0x2602a5);_0x1151f6(_0x2602a5);});});}exports[_0xdb22('0x18')]=function(_0x103398){var _0x47e48e=this;return new Promise(function(_0x1b3815,_0x1c8935){return db[_0xdb22('0x19')]['create'](_0x103398['body'],{'raw':_0x103398[_0xdb22('0x1a')]?_0x103398[_0xdb22('0x1a')][_0xdb22('0x1b')]===undefined?!![]:![]:!![]})[_0xdb22('0xc')](function(_0x54d940){logger['info'](_0xdb22('0x18'),_0x103398);logger[_0xdb22('0xf')](_0xdb22('0x18'),_0x103398,JSON[_0xdb22('0x12')](_0x54d940));_0x1b3815(_0x54d940);})['catch'](function(_0x575118){logger['error']('CreateChatQueueReport',_0x575118[_0xdb22('0x15')],_0x103398);_0x1c8935(_0x47e48e[_0xdb22('0x13')](0x1f4,_0x575118[_0xdb22('0x15')]));});});};exports[_0xdb22('0x1c')]=function(_0x8f3d20){var _0x5c6911=this;return new Promise(function(_0x4b34ae,_0x1c3da8){return db[_0xdb22('0x19')][_0xdb22('0x1d')](_0x8f3d20[_0xdb22('0x1e')],{'raw':_0x8f3d20['options']?_0x8f3d20[_0xdb22('0x1a')][_0xdb22('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8f3d20[_0xdb22('0x1a')]?_0x8f3d20[_0xdb22('0x1a')]['where']||null:null,'attributes':_0x8f3d20[_0xdb22('0x1a')]?_0x8f3d20[_0xdb22('0x1a')][_0xdb22('0x1f')]||null:null,'limit':_0x8f3d20[_0xdb22('0x1a')]?_0x8f3d20[_0xdb22('0x1a')][_0xdb22('0x20')]||null:null})['then'](function(_0x5af514){logger[_0xdb22('0xd')](_0xdb22('0x1c'),_0x8f3d20);logger[_0xdb22('0xf')](_0xdb22('0x1c'),_0x8f3d20,JSON[_0xdb22('0x12')](_0x5af514));_0x4b34ae(_0x5af514);})[_0xdb22('0x17')](function(_0x50c17f){logger[_0xdb22('0x13')]('UpdateChatQueueReport',_0x50c17f['message'],_0x8f3d20);_0x1c3da8(_0x5c6911['error'](0x1f4,_0x50c17f[_0xdb22('0x15')]));});});}; \ No newline at end of file +var _0xf264=['UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','update','attributes','limit'];(function(_0x17cdf0,_0x3b96f4){var _0x4721d1=function(_0xf69011){while(--_0xf69011){_0x17cdf0['push'](_0x17cdf0['shift']());}};_0x4721d1(++_0x3b96f4);}(_0xf264,0x1d2));var _0x4f26=function(_0x42c17c,_0x35a3e8){_0x42c17c=_0x42c17c-0x0;var _0xc75bb7=_0xf264[_0x42c17c];return _0xc75bb7;};'use strict';var _=require(_0x4f26('0x0'));var util=require(_0x4f26('0x1'));var moment=require(_0x4f26('0x2'));var BPromise=require(_0x4f26('0x3'));var rs=require(_0x4f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f26('0x5'));var config=require('../../config/environment');var jayson=require(_0x4f26('0x6'));var client=jayson[_0x4f26('0x7')][_0x4f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1078da,_0x4f3d59,_0x5b574b){return new BPromise(function(_0x3f16fe,_0x486c92){return client[_0x4f26('0x9')](_0x1078da,_0x5b574b)[_0x4f26('0xa')](function(_0x2c7815){logger[_0x4f26('0xb')](_0x4f26('0xc'),_0x4f3d59,_0x4f26('0xd'));logger[_0x4f26('0xe')](_0x4f26('0xf'),_0x4f3d59,_0x4f26('0xd'),JSON[_0x4f26('0x10')](_0x2c7815));if(_0x2c7815[_0x4f26('0x11')]){if(_0x2c7815['error']['code']===0x1f4){logger[_0x4f26('0x11')](_0x4f26('0xc'),_0x4f3d59,_0x2c7815[_0x4f26('0x11')][_0x4f26('0x12')]);return _0x486c92(_0x2c7815[_0x4f26('0x11')][_0x4f26('0x12')]);}logger[_0x4f26('0x11')](_0x4f26('0xc'),_0x4f3d59,_0x2c7815[_0x4f26('0x11')]['message']);return _0x3f16fe(_0x2c7815['error']['message']);}else{logger[_0x4f26('0xb')](_0x4f26('0xc'),_0x4f3d59,_0x4f26('0xd'));_0x3f16fe(_0x2c7815[_0x4f26('0x13')][_0x4f26('0x12')]);}})[_0x4f26('0x14')](function(_0x3b217b){logger[_0x4f26('0x11')](_0x4f26('0xc'),_0x4f3d59,_0x3b217b);_0x486c92(_0x3b217b);});});}exports['CreateChatQueueReport']=function(_0x5d8560){var _0x151db9=this;return new Promise(function(_0x4faa22,_0x526f31){return db[_0x4f26('0x15')][_0x4f26('0x16')](_0x5d8560[_0x4f26('0x17')],{'raw':_0x5d8560[_0x4f26('0x18')]?_0x5d8560[_0x4f26('0x18')][_0x4f26('0x19')]===undefined?!![]:![]:!![]})[_0x4f26('0xa')](function(_0x43cdb5){logger['info'](_0x4f26('0x1a'),_0x5d8560);logger[_0x4f26('0xe')]('CreateChatQueueReport',_0x5d8560,JSON[_0x4f26('0x10')](_0x43cdb5));_0x4faa22(_0x43cdb5);})['catch'](function(_0x308196){logger[_0x4f26('0x11')](_0x4f26('0x1a'),_0x308196['message'],_0x5d8560);_0x526f31(_0x151db9[_0x4f26('0x11')](0x1f4,_0x308196[_0x4f26('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x4f3043){var _0x281eac=this;return new Promise(function(_0x819634,_0x2ea2fc){return db['ChatQueueReport'][_0x4f26('0x1b')](_0x4f3043[_0x4f26('0x17')],{'raw':_0x4f3043[_0x4f26('0x18')]?_0x4f3043['options'][_0x4f26('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f3043[_0x4f26('0x18')]?_0x4f3043[_0x4f26('0x18')]['where']||null:null,'attributes':_0x4f3043[_0x4f26('0x18')]?_0x4f3043[_0x4f26('0x18')][_0x4f26('0x1c')]||null:null,'limit':_0x4f3043['options']?_0x4f3043[_0x4f26('0x18')][_0x4f26('0x1d')]||null:null})[_0x4f26('0xa')](function(_0x2b1235){logger['info'](_0x4f26('0x1e'),_0x4f3043);logger[_0x4f26('0xe')](_0x4f26('0x1e'),_0x4f3043,JSON[_0x4f26('0x10')](_0x2b1235));_0x819634(_0x2b1235);})[_0x4f26('0x14')](function(_0x2fca5e){logger[_0x4f26('0x11')](_0x4f26('0x1e'),_0x2fca5e['message'],_0x4f3043);_0x2ea2fc(_0x281eac[_0x4f26('0x11')](0x1f4,_0x2fca5e[_0x4f26('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 93ff046..1e82539 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 _0x1524=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','/:id','show','post','isAuthenticated','create','update'];(function(_0x3be03d,_0x31fadc){var _0x14f7c5=function(_0x110e61){while(--_0x110e61){_0x3be03d['push'](_0x3be03d['shift']());}};_0x14f7c5(++_0x31fadc);}(_0x1524,0x1ba));var _0x4152=function(_0x1a3625,_0x3c9158){_0x1a3625=_0x1a3625-0x0;var _0x1adcbc=_0x1524[_0x1a3625];return _0x1adcbc;};'use strict';var multer=require(_0x4152('0x0'));var util=require(_0x4152('0x1'));var path=require(_0x4152('0x2'));var timeout=require(_0x4152('0x3'));var express=require('express');var router=express[_0x4152('0x4')]();var fs_extra=require(_0x4152('0x5'));var auth=require(_0x4152('0x6'));var interaction=require(_0x4152('0x7'));var config=require('../../config/environment');var controller=require(_0x4152('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4152('0x9')]);router[_0x4152('0xa')](_0x4152('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4152('0xa')](_0x4152('0xc'),auth['isAuthenticated'](),controller[_0x4152('0xd')]);router[_0x4152('0xe')]('/',auth[_0x4152('0xf')](),controller[_0x4152('0x10')]);router['put'](_0x4152('0xc'),auth['isAuthenticated'](),controller[_0x4152('0x11')]);router[_0x4152('0x12')]('/:id',auth[_0x4152('0xf')](),controller[_0x4152('0x13')]);module['exports']=router; \ No newline at end of file +var _0xef30=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1b2d57,_0x2bfccd){var _0x492dab=function(_0x43d883){while(--_0x43d883){_0x1b2d57['push'](_0x1b2d57['shift']());}};_0x492dab(++_0x2bfccd);}(_0xef30,0xee));var _0x0ef3=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xef30[_0x57975f];return _0x4793b8;};'use strict';var multer=require('multer');var util=require(_0x0ef3('0x0'));var path=require(_0x0ef3('0x1'));var timeout=require(_0x0ef3('0x2'));var express=require(_0x0ef3('0x3'));var router=express[_0x0ef3('0x4')]();var fs_extra=require(_0x0ef3('0x5'));var auth=require(_0x0ef3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0ef3('0x7'));var controller=require(_0x0ef3('0x8'));router[_0x0ef3('0x9')]('/',auth[_0x0ef3('0xa')](),controller[_0x0ef3('0xb')]);router[_0x0ef3('0x9')](_0x0ef3('0xc'),auth[_0x0ef3('0xa')](),controller[_0x0ef3('0xd')]);router[_0x0ef3('0x9')](_0x0ef3('0xe'),auth[_0x0ef3('0xa')](),controller[_0x0ef3('0xf')]);router[_0x0ef3('0x10')]('/',auth[_0x0ef3('0xa')](),controller[_0x0ef3('0x11')]);router[_0x0ef3('0x12')](_0x0ef3('0xe'),auth[_0x0ef3('0xa')](),controller['update']);router[_0x0ef3('0x13')]('/:id',auth[_0x0ef3('0xa')](),controller[_0x0ef3('0x14')]);module[_0x0ef3('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index bbbbd8c..69d6588 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xdf9fd9,_0x257664){var _0xe38fdd=function(_0x1db6b1){while(--_0x1db6b1){_0xdf9fd9['push'](_0xdf9fd9['shift']());}};_0xe38fdd(++_0x257664);}(_0xaa88,0x137));var _0x8aa8=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xaa88[_0x4d7f3f];return _0x5d67cc;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x31aac8,_0x1ac0e3){var _0x55448d=function(_0x396c5f){while(--_0x396c5f){_0x31aac8['push'](_0x31aac8['shift']());}};_0x55448d(++_0x1ac0e3);}(_0x54ef,0x112));var _0xf54e=function(_0x496097,_0xfbb2da){_0x496097=_0x496097-0x0;var _0x51b1d2=_0x54ef[_0x496097];return _0x51b1d2;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 0efb90a..5d9e16b 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 _0xeacd=['json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','includeAll','include','findAll','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x26a382,_0x3d54db){var _0x14f9c8=function(_0x1b69f6){while(--_0x1b69f6){_0x26a382['push'](_0x26a382['shift']());}};_0x14f9c8(++_0x3d54db);}(_0xeacd,0xc7));var _0xdeac=function(_0x2f94ff,_0x5e8d2d){_0x2f94ff=_0x2f94ff-0x0;var _0x48212f=_0xeacd[_0x2f94ff];return _0x48212f;};'use strict';var emlformat=require(_0xdeac('0x0'));var rimraf=require(_0xdeac('0x1'));var zipdir=require(_0xdeac('0x2'));var jsonpatch=require(_0xdeac('0x3'));var rp=require(_0xdeac('0x4'));var moment=require(_0xdeac('0x5'));var BPromise=require(_0xdeac('0x6'));var Mustache=require(_0xdeac('0x7'));var util=require(_0xdeac('0x8'));var path=require(_0xdeac('0x9'));var sox=require(_0xdeac('0xa'));var csv=require(_0xdeac('0xb'));var ejs=require(_0xdeac('0xc'));var fs=require('fs');var fs_extra=require(_0xdeac('0xd'));var _=require('lodash');var squel=require(_0xdeac('0xe'));var crypto=require(_0xdeac('0xf'));var jsforce=require(_0xdeac('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xdeac('0xb'));var querystring=require(_0xdeac('0x11'));var Papa=require('papaparse');var Redis=require(_0xdeac('0x12'));var authService=require(_0xdeac('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdeac('0x14'));var hardwareService=require(_0xdeac('0x15'));var logger=require(_0xdeac('0x16'))(_0xdeac('0x17'));var utils=require('../../config/utils');var config=require(_0xdeac('0x18'));var licenseUtil=require(_0xdeac('0x19'));var db=require(_0xdeac('0x1a'))['db'];function respondWithStatusCode(_0x3a5e4c,_0x36600e){_0x36600e=_0x36600e||0xcc;return function(_0x3f0504){if(_0x3f0504){return _0x3a5e4c[_0xdeac('0x1b')](_0x36600e);}return _0x3a5e4c[_0xdeac('0x1c')](_0x36600e)['end']();};}function respondWithResult(_0x744acb,_0x28c856){_0x28c856=_0x28c856||0xc8;return function(_0x39f7eb){if(_0x39f7eb){return _0x744acb[_0xdeac('0x1c')](_0x28c856)[_0xdeac('0x1d')](_0x39f7eb);}};}function respondWithFilteredResult(_0x575430,_0x12aa65){return function(_0x29315b){if(_0x29315b){var _0x440e83=typeof _0x12aa65[_0xdeac('0x1e')]===_0xdeac('0x1f')&&typeof _0x12aa65['limit']==='undefined';var _0x537970=_0x29315b[_0xdeac('0x20')];var _0x42fcb0=_0x440e83?0x0:_0x12aa65[_0xdeac('0x1e')];var _0x147595=_0x440e83?_0x29315b[_0xdeac('0x20')]:_0x12aa65[_0xdeac('0x1e')]+_0x12aa65[_0xdeac('0x21')];var _0xd7528f;if(_0x147595>=_0x537970){_0x147595=_0x537970;_0xd7528f=0xc8;}else{_0xd7528f=0xce;}_0x575430[_0xdeac('0x1c')](_0xd7528f);return _0x575430[_0xdeac('0x22')](_0xdeac('0x23'),_0x42fcb0+'-'+_0x147595+'/'+_0x537970)['json'](_0x29315b);}return null;};}function patchUpdates(_0x46c993){return function(_0xd8fb){try{jsonpatch['apply'](_0xd8fb,_0x46c993,!![]);}catch(_0x5e75ca){return BPromise[_0xdeac('0x24')](_0x5e75ca);}return _0xd8fb[_0xdeac('0x25')]();};}function saveUpdates(_0xe22567,_0x1b422d){return function(_0x1a30da){if(_0x1a30da){return _0x1a30da[_0xdeac('0x26')](_0xe22567)[_0xdeac('0x27')](function(_0x27c224){return _0x27c224;});}return null;};}function removeEntity(_0x55a6fe,_0x254510){return function(_0x3a066a){if(_0x3a066a){return _0x3a066a[_0xdeac('0x28')]()[_0xdeac('0x27')](function(){_0x55a6fe[_0xdeac('0x1c')](0xcc)[_0xdeac('0x29')]();});}};}function handleEntityNotFound(_0x4dfaee,_0x3ce757){return function(_0x338596){if(!_0x338596){_0x4dfaee['sendStatus'](0x194);}return _0x338596;};}function handleError(_0x3592f5,_0x298c70){_0x298c70=_0x298c70||0x1f4;return function(_0x1107aa){logger[_0xdeac('0x2a')](_0x1107aa[_0xdeac('0x2b')]);if(_0x1107aa['name']){delete _0x1107aa[_0xdeac('0x2c')];}_0x3592f5['status'](_0x298c70)[_0xdeac('0x2d')](_0x1107aa);};}exports['index']=function(_0x2a759f,_0xa0da23){var _0x59c8fe={},_0x491cdb={},_0x3cddf1={'count':0x0,'rows':[]};var _0x151e0e=_[_0xdeac('0x2e')](db[_0xdeac('0x2f')][_0xdeac('0x30')],function(_0xd81cf7){return{'name':_0xd81cf7[_0xdeac('0x31')],'type':_0xd81cf7['type'][_0xdeac('0x32')]};});_0x491cdb[_0xdeac('0x33')]=_[_0xdeac('0x2e')](_0x151e0e,_0xdeac('0x2c'));_0x491cdb[_0xdeac('0x34')]=_[_0xdeac('0x35')](_0x2a759f[_0xdeac('0x34')]);_0x491cdb[_0xdeac('0x36')]=_[_0xdeac('0x37')](_0x491cdb['model'],_0x491cdb['query']);_0x59c8fe[_0xdeac('0x38')]=_[_0xdeac('0x37')](_0x491cdb[_0xdeac('0x33')],qs[_0xdeac('0x39')](_0x2a759f[_0xdeac('0x34')][_0xdeac('0x39')]));_0x59c8fe[_0xdeac('0x38')]=_0x59c8fe[_0xdeac('0x38')][_0xdeac('0x3a')]?_0x59c8fe[_0xdeac('0x38')]:_0x491cdb[_0xdeac('0x33')];if(!_0x2a759f[_0xdeac('0x34')][_0xdeac('0x3b')](_0xdeac('0x3c'))){_0x59c8fe[_0xdeac('0x21')]=qs['limit'](_0x2a759f['query'][_0xdeac('0x21')]);_0x59c8fe['offset']=qs[_0xdeac('0x1e')](_0x2a759f[_0xdeac('0x34')]['offset']);}_0x59c8fe[_0xdeac('0x3d')]=qs[_0xdeac('0x3e')](_0x2a759f[_0xdeac('0x34')]['sort']);_0x59c8fe['where']=qs[_0xdeac('0x36')](_['pick'](_0x2a759f[_0xdeac('0x34')],_0x491cdb[_0xdeac('0x36')]),_0x151e0e);if(_0x2a759f[_0xdeac('0x34')]['filter']){_0x59c8fe[_0xdeac('0x3f')]=_[_0xdeac('0x40')](_0x59c8fe[_0xdeac('0x3f')],{'$or':_[_0xdeac('0x2e')](_0x151e0e,function(_0x4211e1){if(_0x4211e1[_0xdeac('0x41')]!=='VIRTUAL'){var _0x18230a={};_0x18230a[_0x4211e1[_0xdeac('0x2c')]]={'$like':'%'+_0x2a759f['query']['filter']+'%'};return _0x18230a;}})});}_0x59c8fe=_['merge']({},_0x59c8fe,_0x2a759f['options']);var _0x5c124a={'where':_0x59c8fe[_0xdeac('0x3f')]};return db[_0xdeac('0x2f')][_0xdeac('0x20')](_0x5c124a)[_0xdeac('0x27')](function(_0x2218b6){_0x3cddf1[_0xdeac('0x20')]=_0x2218b6;if(_0x2a759f[_0xdeac('0x34')][_0xdeac('0x42')]){_0x59c8fe[_0xdeac('0x43')]=[{'all':!![]}];}return db[_0xdeac('0x2f')][_0xdeac('0x44')](_0x59c8fe);})[_0xdeac('0x27')](function(_0x1c35b8){_0x3cddf1['rows']=_0x1c35b8;return _0x3cddf1;})[_0xdeac('0x27')](respondWithFilteredResult(_0xa0da23,_0x59c8fe))[_0xdeac('0x45')](handleError(_0xa0da23,null));};exports['show']=function(_0x2827a6,_0x12650a){var _0x129ca2={'raw':!![],'where':{'id':_0x2827a6[_0xdeac('0x46')]['id']}},_0x3fbb5f={};_0x3fbb5f[_0xdeac('0x33')]=_[_0xdeac('0x35')](db['ChatTransferReport']['rawAttributes']);_0x3fbb5f[_0xdeac('0x34')]=_[_0xdeac('0x35')](_0x2827a6[_0xdeac('0x34')]);_0x3fbb5f[_0xdeac('0x36')]=_['intersection'](_0x3fbb5f['model'],_0x3fbb5f[_0xdeac('0x34')]);_0x129ca2[_0xdeac('0x38')]=_[_0xdeac('0x37')](_0x3fbb5f[_0xdeac('0x33')],qs['fields'](_0x2827a6[_0xdeac('0x34')][_0xdeac('0x39')]));_0x129ca2[_0xdeac('0x38')]=_0x129ca2[_0xdeac('0x38')][_0xdeac('0x3a')]?_0x129ca2[_0xdeac('0x38')]:_0x3fbb5f[_0xdeac('0x33')];if(_0x2827a6[_0xdeac('0x34')][_0xdeac('0x42')]){_0x129ca2['include']=[{'all':!![]}];}_0x129ca2=_[_0xdeac('0x40')]({},_0x129ca2,_0x2827a6[_0xdeac('0x47')]);return db[_0xdeac('0x2f')][_0xdeac('0x48')](_0x129ca2)['then'](handleEntityNotFound(_0x12650a,null))['then'](respondWithResult(_0x12650a,null))['catch'](handleError(_0x12650a,null));};exports[_0xdeac('0x49')]=function(_0x273a1b,_0x53224b){return db[_0xdeac('0x2f')][_0xdeac('0x49')](_0x273a1b[_0xdeac('0x4a')],{})['then'](respondWithResult(_0x53224b,0xc9))['catch'](handleError(_0x53224b,null));};exports[_0xdeac('0x26')]=function(_0xf1007d,_0x404a35){if(_0xf1007d[_0xdeac('0x4a')]['id']){delete _0xf1007d[_0xdeac('0x4a')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0xf1007d['params']['id']}})[_0xdeac('0x27')](handleEntityNotFound(_0x404a35,null))[_0xdeac('0x27')](saveUpdates(_0xf1007d[_0xdeac('0x4a')],null))[_0xdeac('0x27')](respondWithResult(_0x404a35,null))['catch'](handleError(_0x404a35,null));};exports['destroy']=function(_0x21c44c,_0x5730f5){return db[_0xdeac('0x2f')][_0xdeac('0x48')]({'where':{'id':_0x21c44c[_0xdeac('0x46')]['id']}})[_0xdeac('0x27')](handleEntityNotFound(_0x5730f5,null))[_0xdeac('0x27')](removeEntity(_0x5730f5,null))[_0xdeac('0x45')](handleError(_0x5730f5,null));};exports[_0xdeac('0x4b')]=function(_0x140c85,_0x3fcaaa){return db[_0xdeac('0x2f')]['describe']()[_0xdeac('0x27')](respondWithResult(_0x3fcaaa,null))[_0xdeac('0x45')](handleError(_0x3fcaaa,null));}; \ No newline at end of file +var _0xa072=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','ChatTransferReport','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','eml-format'];(function(_0x9c43f,_0x576181){var _0xdf8bd4=function(_0x150986){while(--_0x150986){_0x9c43f['push'](_0x9c43f['shift']());}};_0xdf8bd4(++_0x576181);}(_0xa072,0x18f));var _0x2a07=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0xa072[_0x3dc68d];return _0xdf7f94;};'use strict';var emlformat=require(_0x2a07('0x0'));var rimraf=require(_0x2a07('0x1'));var zipdir=require(_0x2a07('0x2'));var jsonpatch=require(_0x2a07('0x3'));var rp=require(_0x2a07('0x4'));var moment=require(_0x2a07('0x5'));var BPromise=require(_0x2a07('0x6'));var Mustache=require(_0x2a07('0x7'));var util=require('util');var path=require(_0x2a07('0x8'));var sox=require(_0x2a07('0x9'));var csv=require(_0x2a07('0xa'));var ejs=require(_0x2a07('0xb'));var fs=require('fs');var fs_extra=require(_0x2a07('0xc'));var _=require(_0x2a07('0xd'));var squel=require(_0x2a07('0xe'));var crypto=require(_0x2a07('0xf'));var jsforce=require(_0x2a07('0x10'));var deskjs=require(_0x2a07('0x11'));var toCsv=require(_0x2a07('0xa'));var querystring=require('querystring');var Papa=require(_0x2a07('0x12'));var Redis=require(_0x2a07('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a07('0x14'));var hardwareService=require(_0x2a07('0x15'));var logger=require(_0x2a07('0x16'))(_0x2a07('0x17'));var utils=require(_0x2a07('0x18'));var config=require(_0x2a07('0x19'));var licenseUtil=require(_0x2a07('0x1a'));var db=require(_0x2a07('0x1b'))['db'];function respondWithStatusCode(_0x6355ed,_0x3208d8){_0x3208d8=_0x3208d8||0xcc;return function(_0x59b39e){if(_0x59b39e){return _0x6355ed[_0x2a07('0x1c')](_0x3208d8);}return _0x6355ed[_0x2a07('0x1d')](_0x3208d8)[_0x2a07('0x1e')]();};}function respondWithResult(_0x38eb28,_0xfbea6b){_0xfbea6b=_0xfbea6b||0xc8;return function(_0x44bc65){if(_0x44bc65){return _0x38eb28[_0x2a07('0x1d')](_0xfbea6b)[_0x2a07('0x1f')](_0x44bc65);}};}function respondWithFilteredResult(_0x325136,_0x502728){return function(_0x3df8ae){if(_0x3df8ae){var _0x399879=typeof _0x502728['offset']===_0x2a07('0x20')&&typeof _0x502728['limit']===_0x2a07('0x20');var _0x4214a0=_0x3df8ae['count'];var _0x4aae39=_0x399879?0x0:_0x502728[_0x2a07('0x21')];var _0x351ef7=_0x399879?_0x3df8ae['count']:_0x502728['offset']+_0x502728[_0x2a07('0x22')];var _0x38f52c;if(_0x351ef7>=_0x4214a0){_0x351ef7=_0x4214a0;_0x38f52c=0xc8;}else{_0x38f52c=0xce;}_0x325136[_0x2a07('0x1d')](_0x38f52c);return _0x325136['set'](_0x2a07('0x23'),_0x4aae39+'-'+_0x351ef7+'/'+_0x4214a0)[_0x2a07('0x1f')](_0x3df8ae);}return null;};}function patchUpdates(_0x378d8c){return function(_0x1aa6cb){try{jsonpatch[_0x2a07('0x24')](_0x1aa6cb,_0x378d8c,!![]);}catch(_0x36993a){return BPromise[_0x2a07('0x25')](_0x36993a);}return _0x1aa6cb['save']();};}function saveUpdates(_0x52df5e,_0x29895c){return function(_0x55508d){if(_0x55508d){return _0x55508d[_0x2a07('0x26')](_0x52df5e)[_0x2a07('0x27')](function(_0x34a65e){return _0x34a65e;});}return null;};}function removeEntity(_0x1c3b6d,_0x1fdd3f){return function(_0x4df89b){if(_0x4df89b){return _0x4df89b['destroy']()[_0x2a07('0x27')](function(){_0x1c3b6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5866df,_0x230204){return function(_0x2becfc){if(!_0x2becfc){_0x5866df['sendStatus'](0x194);}return _0x2becfc;};}function handleError(_0x1d5ed1,_0x44a5bb){_0x44a5bb=_0x44a5bb||0x1f4;return function(_0xe6803){logger[_0x2a07('0x28')](_0xe6803[_0x2a07('0x29')]);if(_0xe6803[_0x2a07('0x2a')]){delete _0xe6803[_0x2a07('0x2a')];}_0x1d5ed1[_0x2a07('0x1d')](_0x44a5bb)[_0x2a07('0x2b')](_0xe6803);};}exports[_0x2a07('0x2c')]=function(_0x46a6fc,_0x383ad3){var _0x4ccf72={},_0x4f0663={},_0x379d22={'count':0x0,'rows':[]};var _0x118e7e=_['map'](db['ChatTransferReport'][_0x2a07('0x2d')],function(_0x564c3b){return{'name':_0x564c3b['fieldName'],'type':_0x564c3b[_0x2a07('0x2e')]['key']};});_0x4f0663[_0x2a07('0x2f')]=_[_0x2a07('0x30')](_0x118e7e,'name');_0x4f0663[_0x2a07('0x31')]=_[_0x2a07('0x32')](_0x46a6fc[_0x2a07('0x31')]);_0x4f0663[_0x2a07('0x33')]=_[_0x2a07('0x34')](_0x4f0663[_0x2a07('0x2f')],_0x4f0663[_0x2a07('0x31')]);_0x4ccf72[_0x2a07('0x35')]=_[_0x2a07('0x34')](_0x4f0663[_0x2a07('0x2f')],qs[_0x2a07('0x36')](_0x46a6fc[_0x2a07('0x31')][_0x2a07('0x36')]));_0x4ccf72[_0x2a07('0x35')]=_0x4ccf72[_0x2a07('0x35')][_0x2a07('0x37')]?_0x4ccf72[_0x2a07('0x35')]:_0x4f0663[_0x2a07('0x2f')];if(!_0x46a6fc['query'][_0x2a07('0x38')](_0x2a07('0x39'))){_0x4ccf72[_0x2a07('0x22')]=qs[_0x2a07('0x22')](_0x46a6fc[_0x2a07('0x31')][_0x2a07('0x22')]);_0x4ccf72[_0x2a07('0x21')]=qs['offset'](_0x46a6fc[_0x2a07('0x31')]['offset']);}_0x4ccf72[_0x2a07('0x3a')]=qs[_0x2a07('0x3b')](_0x46a6fc[_0x2a07('0x31')]['sort']);_0x4ccf72['where']=qs['filters'](_[_0x2a07('0x3c')](_0x46a6fc[_0x2a07('0x31')],_0x4f0663[_0x2a07('0x33')]),_0x118e7e);if(_0x46a6fc[_0x2a07('0x31')][_0x2a07('0x3d')]){_0x4ccf72[_0x2a07('0x3e')]=_['merge'](_0x4ccf72[_0x2a07('0x3e')],{'$or':_[_0x2a07('0x30')](_0x118e7e,function(_0x42be2b){if(_0x42be2b[_0x2a07('0x2e')]!==_0x2a07('0x3f')){var _0x455e32={};_0x455e32[_0x42be2b[_0x2a07('0x2a')]]={'$like':'%'+_0x46a6fc[_0x2a07('0x31')][_0x2a07('0x3d')]+'%'};return _0x455e32;}})});}_0x4ccf72=_[_0x2a07('0x40')]({},_0x4ccf72,_0x46a6fc[_0x2a07('0x41')]);var _0x517bb9={'where':_0x4ccf72[_0x2a07('0x3e')]};return db[_0x2a07('0x42')][_0x2a07('0x43')](_0x517bb9)['then'](function(_0x35fc2e){_0x379d22[_0x2a07('0x43')]=_0x35fc2e;if(_0x46a6fc[_0x2a07('0x31')][_0x2a07('0x44')]){_0x4ccf72[_0x2a07('0x45')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x2a07('0x46')](_0x4ccf72);})[_0x2a07('0x27')](function(_0x362ead){_0x379d22[_0x2a07('0x47')]=_0x362ead;return _0x379d22;})[_0x2a07('0x27')](respondWithFilteredResult(_0x383ad3,_0x4ccf72))[_0x2a07('0x48')](handleError(_0x383ad3,null));};exports[_0x2a07('0x49')]=function(_0x554723,_0x33fc84){var _0x5e9c50={'raw':!![],'where':{'id':_0x554723['params']['id']}},_0x5ad35b={};_0x5ad35b[_0x2a07('0x2f')]=_[_0x2a07('0x32')](db['ChatTransferReport'][_0x2a07('0x2d')]);_0x5ad35b[_0x2a07('0x31')]=_[_0x2a07('0x32')](_0x554723[_0x2a07('0x31')]);_0x5ad35b[_0x2a07('0x33')]=_[_0x2a07('0x34')](_0x5ad35b[_0x2a07('0x2f')],_0x5ad35b[_0x2a07('0x31')]);_0x5e9c50['attributes']=_['intersection'](_0x5ad35b[_0x2a07('0x2f')],qs[_0x2a07('0x36')](_0x554723[_0x2a07('0x31')][_0x2a07('0x36')]));_0x5e9c50[_0x2a07('0x35')]=_0x5e9c50['attributes']['length']?_0x5e9c50[_0x2a07('0x35')]:_0x5ad35b[_0x2a07('0x2f')];if(_0x554723['query'][_0x2a07('0x44')]){_0x5e9c50[_0x2a07('0x45')]=[{'all':!![]}];}_0x5e9c50=_[_0x2a07('0x40')]({},_0x5e9c50,_0x554723['options']);return db['ChatTransferReport'][_0x2a07('0x4a')](_0x5e9c50)['then'](handleEntityNotFound(_0x33fc84,null))[_0x2a07('0x27')](respondWithResult(_0x33fc84,null))['catch'](handleError(_0x33fc84,null));};exports[_0x2a07('0x4b')]=function(_0x40afa2,_0x3ca209){return db['ChatTransferReport']['create'](_0x40afa2[_0x2a07('0x4c')],{})[_0x2a07('0x27')](respondWithResult(_0x3ca209,0xc9))['catch'](handleError(_0x3ca209,null));};exports[_0x2a07('0x26')]=function(_0x54cae1,_0x5cda1f){if(_0x54cae1[_0x2a07('0x4c')]['id']){delete _0x54cae1[_0x2a07('0x4c')]['id'];}return db[_0x2a07('0x42')][_0x2a07('0x4a')]({'where':{'id':_0x54cae1[_0x2a07('0x4d')]['id']}})[_0x2a07('0x27')](handleEntityNotFound(_0x5cda1f,null))[_0x2a07('0x27')](saveUpdates(_0x54cae1[_0x2a07('0x4c')],null))['then'](respondWithResult(_0x5cda1f,null))[_0x2a07('0x48')](handleError(_0x5cda1f,null));};exports[_0x2a07('0x4e')]=function(_0x3f4461,_0x53a233){return db[_0x2a07('0x42')][_0x2a07('0x4a')]({'where':{'id':_0x3f4461[_0x2a07('0x4d')]['id']}})[_0x2a07('0x27')](handleEntityNotFound(_0x53a233,null))[_0x2a07('0x27')](removeEntity(_0x53a233,null))['catch'](handleError(_0x53a233,null));};exports[_0x2a07('0x4f')]=function(_0x3ca6e7,_0x468c7b){return db[_0x2a07('0x42')][_0x2a07('0x4f')]()[_0x2a07('0x27')](respondWithResult(_0x468c7b,null))[_0x2a07('0x48')](handleError(_0x468c7b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 6dbfaaf..c63d9b3 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 _0xb277=['api','path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb277,0x126));var _0x7b27=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xb277[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7b27('0x0'));var util=require(_0x7b27('0x1'));var logger=require(_0x7b27('0x2'))(_0x7b27('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b27('0x4'));var rimraf=require('rimraf');var config=require(_0x7b27('0x5'));var attributes=require(_0x7b27('0x6'));module[_0x7b27('0x7')]=function(_0x7d0b8f,_0x1c5495){return _0x7d0b8f['define'](_0x7b27('0x8'),attributes,{'tableName':_0x7b27('0x9'),'paranoid':![],'indexes':[{'name':_0x7b27('0xa'),'fields':[_0x7b27('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9a1=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','uniqueid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a1,0x10c));var _0x1b9a=function(_0x523fe2,_0x3efec3){_0x523fe2=_0x523fe2-0x0;var _0x4e0c21=_0xb9a1[_0x523fe2];return _0x4e0c21;};'use strict';var _=require(_0x1b9a('0x0'));var util=require(_0x1b9a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b9a('0x2'));var fs=require('fs');var path=require(_0x1b9a('0x3'));var rimraf=require(_0x1b9a('0x4'));var config=require(_0x1b9a('0x5'));var attributes=require(_0x1b9a('0x6'));module['exports']=function(_0x195146,_0x49f28e){return _0x195146['define'](_0x1b9a('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1b9a('0x8'),'fields':[_0x1b9a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8af6997..938a44c 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 _0x9eb6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash'];(function(_0x203b5c,_0x2384f1){var _0x20a057=function(_0x511230){while(--_0x511230){_0x203b5c['push'](_0x203b5c['shift']());}};_0x20a057(++_0x2384f1);}(_0x9eb6,0xd7));var _0x69eb=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x9eb6[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x69eb('0x0'));var util=require(_0x69eb('0x1'));var moment=require(_0x69eb('0x2'));var BPromise=require(_0x69eb('0x3'));var rs=require(_0x69eb('0x4'));var fs=require('fs');var Redis=require(_0x69eb('0x5'));var db=require(_0x69eb('0x6'))['db'];var utils=require(_0x69eb('0x7'));var logger=require(_0x69eb('0x8'))(_0x69eb('0x9'));var config=require(_0x69eb('0xa'));var jayson=require(_0x69eb('0xb'));var client=jayson[_0x69eb('0xc')][_0x69eb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x382bf9,_0x106ef1,_0x404d41){return new BPromise(function(_0x4107fe,_0x10de22){return client[_0x69eb('0xe')](_0x382bf9,_0x404d41)[_0x69eb('0xf')](function(_0x58112b){logger['info'](_0x69eb('0x10'),_0x106ef1,_0x69eb('0x11'));logger[_0x69eb('0x12')](_0x69eb('0x13'),_0x106ef1,_0x69eb('0x11'),JSON[_0x69eb('0x14')](_0x58112b));if(_0x58112b[_0x69eb('0x15')]){if(_0x58112b[_0x69eb('0x15')]['code']===0x1f4){logger[_0x69eb('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x106ef1,_0x58112b['error']['message']);return _0x10de22(_0x58112b[_0x69eb('0x15')][_0x69eb('0x16')]);}logger[_0x69eb('0x15')](_0x69eb('0x10'),_0x106ef1,_0x58112b['error'][_0x69eb('0x16')]);return _0x4107fe(_0x58112b[_0x69eb('0x15')]['message']);}else{logger[_0x69eb('0x17')](_0x69eb('0x10'),_0x106ef1,_0x69eb('0x11'));_0x4107fe(_0x58112b['result'][_0x69eb('0x16')]);}})['catch'](function(_0x364441){logger[_0x69eb('0x15')](_0x69eb('0x10'),_0x106ef1,_0x364441);_0x10de22(_0x364441);});});} \ No newline at end of file +var _0x22ec=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5dfdf9,_0x343aef){var _0x3ecc78=function(_0x39a65a){while(--_0x39a65a){_0x5dfdf9['push'](_0x5dfdf9['shift']());}};_0x3ecc78(++_0x343aef);}(_0x22ec,0xb8));var _0xc22e=function(_0x1a0160,_0x5ef2bd){_0x1a0160=_0x1a0160-0x0;var _0x39c78a=_0x22ec[_0x1a0160];return _0x39c78a;};'use strict';var _=require(_0xc22e('0x0'));var util=require(_0xc22e('0x1'));var moment=require(_0xc22e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc22e('0x3'));var fs=require('fs');var Redis=require(_0xc22e('0x4'));var db=require(_0xc22e('0x5'))['db'];var utils=require(_0xc22e('0x6'));var logger=require(_0xc22e('0x7'))(_0xc22e('0x8'));var config=require(_0xc22e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc22e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7ca8f5,_0x11a058,_0x4f8177){return new BPromise(function(_0x16e71a,_0x3ed4ef){return client['request'](_0x7ca8f5,_0x4f8177)['then'](function(_0x4d073d){logger[_0xc22e('0xb')](_0xc22e('0xc'),_0x11a058,'request\x20sent');logger['debug'](_0xc22e('0xd'),_0x11a058,_0xc22e('0xe'),JSON['stringify'](_0x4d073d));if(_0x4d073d['error']){if(_0x4d073d[_0xc22e('0xf')][_0xc22e('0x10')]===0x1f4){logger[_0xc22e('0xf')](_0xc22e('0xc'),_0x11a058,_0x4d073d['error'][_0xc22e('0x11')]);return _0x3ed4ef(_0x4d073d[_0xc22e('0xf')][_0xc22e('0x11')]);}logger[_0xc22e('0xf')](_0xc22e('0xc'),_0x11a058,_0x4d073d['error'][_0xc22e('0x11')]);return _0x16e71a(_0x4d073d[_0xc22e('0xf')][_0xc22e('0x11')]);}else{logger[_0xc22e('0xb')](_0xc22e('0xc'),_0x11a058,_0xc22e('0xe'));_0x16e71a(_0x4d073d[_0xc22e('0x12')][_0xc22e('0x11')]);}})[_0xc22e('0x13')](function(_0x3dafcc){logger[_0xc22e('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x11a058,_0x3dafcc);_0x3ed4ef(_0x3dafcc);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 35dd943..da0cd89 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 _0x9d88=['get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller'];(function(_0x450e05,_0x298fe4){var _0x5d56f1=function(_0x4a2406){while(--_0x4a2406){_0x450e05['push'](_0x450e05['shift']());}};_0x5d56f1(++_0x298fe4);}(_0x9d88,0x8a));var _0x89d8=function(_0x4644f8,_0x54af45){_0x4644f8=_0x4644f8-0x0;var _0x5e82d6=_0x9d88[_0x4644f8];return _0x5e82d6;};'use strict';var multer=require(_0x89d8('0x0'));var util=require(_0x89d8('0x1'));var path=require(_0x89d8('0x2'));var timeout=require(_0x89d8('0x3'));var express=require(_0x89d8('0x4'));var router=express[_0x89d8('0x5')]();var fs_extra=require(_0x89d8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x89d8('0x7'));var config=require('../../config/environment');var controller=require(_0x89d8('0x8'));router[_0x89d8('0x9')]('/',auth[_0x89d8('0xa')](),controller[_0x89d8('0xb')]);router[_0x89d8('0x9')](_0x89d8('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x89d8('0x9')](_0x89d8('0xd'),auth[_0x89d8('0xa')](),controller['show']);router[_0x89d8('0xe')]('/',auth[_0x89d8('0xa')](),controller[_0x89d8('0xf')]);router[_0x89d8('0x10')]('/:id',auth[_0x89d8('0xa')](),controller[_0x89d8('0x11')]);router[_0x89d8('0x12')](_0x89d8('0xd'),auth[_0x89d8('0xa')](),controller[_0x89d8('0x13')]);module[_0x89d8('0x14')]=router; \ No newline at end of file +var _0x01fd=['describe','post','create','put','/:id','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3e034d,_0x2bb46f){var _0x1d751c=function(_0x3ee4da){while(--_0x3ee4da){_0x3e034d['push'](_0x3e034d['shift']());}};_0x1d751c(++_0x2bb46f);}(_0x01fd,0x136));var _0xd01f=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0x01fd[_0x4d67b8];return _0x55af3b;};'use strict';var multer=require('multer');var util=require(_0xd01f('0x0'));var path=require(_0xd01f('0x1'));var timeout=require(_0xd01f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd01f('0x3'));var auth=require(_0xd01f('0x4'));var interaction=require(_0xd01f('0x5'));var config=require(_0xd01f('0x6'));var controller=require('./chatTransferReport.controller');router[_0xd01f('0x7')]('/',auth[_0xd01f('0x8')](),controller[_0xd01f('0x9')]);router[_0xd01f('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd01f('0xa')]);router[_0xd01f('0x7')]('/:id',auth[_0xd01f('0x8')](),controller['show']);router[_0xd01f('0xb')]('/',auth[_0xd01f('0x8')](),controller[_0xd01f('0xc')]);router[_0xd01f('0xd')](_0xd01f('0xe'),auth[_0xd01f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xd01f('0x8')](),controller[_0xd01f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7e6ef79..528de39 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 _0xeb81=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','input','name','onlineForm','parse','getDataValue','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xeb81,0x13d));var _0x1eb8=function(_0x109d07,_0x493a0f){_0x109d07=_0x109d07-0x0;var _0x549773=_0xeb81[_0x109d07];return _0x549773;};'use strict';var Sequelize=require(_0x1eb8('0x0'));var rs=require(_0x1eb8('0x1'));module['exports']={'name':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'unique':_0x1eb8('0x3')},'description':{'type':Sequelize[_0x1eb8('0x2')]},'mapKey':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':_0x1eb8('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':_0x1eb8('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':_0x1eb8('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':_0x1eb8('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1eb8('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x1eb8('0x9'),_0x1eb8('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xb')},'start_chat_button':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xc')},'offline_chat_button':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xd')},'header_offline':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xe')},'download_transcript':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1eb8('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1eb8('0x10')]},'closingQuestion':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x13')},'closingMessage':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x14')},'closingMessageButton':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1eb8('0x15')},'conditionAgreement':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x16')},'ratingType':{'type':Sequelize[_0x1eb8('0x17')](_0x1eb8('0x18'),_0x1eb8('0x19')),'defaultValue':_0x1eb8('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x1eb8('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1eb8('0x1a'),'variable':null,'config':{'placeholder':_0x1eb8('0x1b'),'type':'text','required':!![]},'props':{'title':_0x1eb8('0x1b'),'helpText':''}},{'type':_0x1eb8('0x1a'),'props':{'title':_0x1eb8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1eb8('0x4'),'type':_0x1eb8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1eb8('0x1c'))?JSON[_0x1eb8('0x1d')](this[_0x1eb8('0x1e')](_0x1eb8('0x1c'))):{};},'set':function(_0x338925){return this[_0x1eb8('0x1f')]('onlineForm',JSON[_0x1eb8('0x20')](_0x338925));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1eb8('0x20')]({'items':[{'type':_0x1eb8('0x1a'),'props':{'title':_0x1eb8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1eb8('0x4'),'type':_0x1eb8('0x4')},'variable':null},{'type':_0x1eb8('0x21'),'config':{'placeholder':_0x1eb8('0x22')},'props':{'title':_0x1eb8('0x22'),'helpText':_0x1eb8('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x1eb8('0x24'))?JSON[_0x1eb8('0x1d')](this[_0x1eb8('0x1e')]('offlineForm')):{};},'set':function(_0xdfd2df){return this[_0x1eb8('0x1f')](_0x1eb8('0x24'),JSON[_0x1eb8('0x20')](_0xdfd2df));}},'token':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1eb8('0x2')]},'waitingTitle':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x25')},'waitingMessage':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x1eb8('0x27')},'offlineMessageBody':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1eb8('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1eb8('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1eb8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1eb8('0x10')],'defaultValue':function(){return _0x1eb8('0x29');}},'notificationSound':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x1eb8('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1eb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1eb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x2b')},'verticalAlignment':{'type':Sequelize[_0x1eb8('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x2d')},'defaultTitle':{'type':Sequelize[_0x1eb8('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1eb8('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1eb8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1eb8('0x2')],'defaultValue':_0x1eb8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1eb8('0x7')],'comment':_0x1eb8('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![],'comment':_0x1eb8('0x30'),'set':function(_0x1d2099){if(!_0x1d2099)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x1eb8('0x1f')](_0x1eb8('0x31'),_0x1d2099);}},'vidaooEscalation':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1eb8('0x2')]},'vidaooTopic':{'type':Sequelize[_0x1eb8('0x2')],'allowNull':![],'defaultValue':_0x1eb8('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1eb8('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1eb8('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1eb8('0x10')]}}; \ No newline at end of file +var _0xeb07=['email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING'];(function(_0x22942f,_0x56e2ae){var _0x17dde5=function(_0x47de28){while(--_0x47de28){_0x22942f['push'](_0x22942f['shift']());}};_0x17dde5(++_0x56e2ae);}(_0xeb07,0x130));var _0x7eb0=function(_0x3342fc,_0x333631){_0x3342fc=_0x3342fc-0x0;var _0x3ab19f=_0xeb07[_0x3342fc];return _0x3ab19f;};'use strict';var Sequelize=require(_0x7eb0('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x2')},'mapKeyOffline':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x2')},'key':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x3')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7eb0('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![],'defaultValue':_0x7eb0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7eb0('0x1')],'allowNull':![],'defaultValue':_0x7eb0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7eb0('0x7')](_0x7eb0('0x8'),_0x7eb0('0x9')),'defaultValue':_0x7eb0('0x8')},'header_online':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7eb0('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7eb0('0xb')},'header_offline':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0xc')},'download_transcript':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7eb0('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7eb0('0xf')]},'closingQuestion':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7eb0('0x11')},'placeholderMessage':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x12')},'closingMessage':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x13')},'closingMessageButton':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x14')},'conditionAgreement':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x7eb0('0x7')](_0x7eb0('0x15'),_0x7eb0('0x16')),'defaultValue':_0x7eb0('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x7eb0('0x17')]({'items':[{'type':_0x7eb0('0x18'),'variable':null,'config':{'placeholder':_0x7eb0('0x19'),'type':_0x7eb0('0x1a'),'required':!![]},'props':{'title':_0x7eb0('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x7eb0('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0x7eb0('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7eb0('0x1b')]('onlineForm')?JSON[_0x7eb0('0x1c')](this[_0x7eb0('0x1b')](_0x7eb0('0x1d'))):{};},'set':function(_0xf7d307){return this[_0x7eb0('0x1e')](_0x7eb0('0x1d'),JSON[_0x7eb0('0x17')](_0xf7d307));}},'offlineForm':{'type':Sequelize[_0x7eb0('0xf')],'defaultValue':function(){return JSON[_0x7eb0('0x17')]({'items':[{'type':_0x7eb0('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x7eb0('0x2'),'type':_0x7eb0('0x2')},'variable':null},{'type':'textarea','config':{'placeholder':_0x7eb0('0x1f')},'props':{'title':'Comments','helpText':_0x7eb0('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x7eb0('0x1b')](_0x7eb0('0x21'))?JSON[_0x7eb0('0x1c')](this[_0x7eb0('0x1b')](_0x7eb0('0x21'))):{};},'set':function(_0x1870a2){return this['setDataValue'](_0x7eb0('0x21'),JSON[_0x7eb0('0x17')](_0x1870a2));}},'token':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':function(){return rs[_0x7eb0('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7eb0('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x23')},'waitingMessage':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x25')},'offlineMessageBody':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7eb0('0x14')},'sendUnmanaged':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7eb0('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7eb0('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7eb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x29')},'verticalAlignment':{'type':Sequelize[_0x7eb0('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7eb0('0x2a')},'defaultTitle':{'type':Sequelize[_0x7eb0('0x1')]},'customerAvatar':{'type':Sequelize[_0x7eb0('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7eb0('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7eb0('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7eb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':_0x7eb0('0x2c')},'systemAvatar':{'type':Sequelize[_0x7eb0('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7eb0('0xd')],'comment':_0x7eb0('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![],'comment':_0x7eb0('0x2e'),'set':function(_0x59e4d8){if(!_0x59e4d8)this['setDataValue'](_0x7eb0('0x2f'),null);this['setDataValue'](_0x7eb0('0x30'),_0x59e4d8);}},'vidaooEscalation':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7eb0('0x31')},'vidaooNote':{'type':Sequelize[_0x7eb0('0x1')],'defaultValue':function(){return _0x7eb0('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x7eb0('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7eb0('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7eb0('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index bc6f06a..276929a 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 _0x82f6=['CmList','List','Contacts','DESC','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','asc','list','defaults','CmContact','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','unmanaged','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','timezone','ifTime','server/files/chat/iframe.ejs','3.9.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','replace','render','alignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','querystring','jayson/promise','../../components/parsers/qs','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','url','URL','../../mysqldb','redis','localhost','./chatWebsite.socket','register','client','http','request','then','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','catch','status','end','json','offset','limit','count','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','model','type','stringify','index','mandatoryDispositionPause','ChatWebsite','fieldName','map','keys','filters','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','create','body','address','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Pause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','../../config/license/util','custom','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','isNil','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from'];(function(_0x3ad272,_0x369adf){var _0x5f14bd=function(_0x505cb4){while(--_0x505cb4){_0x3ad272['push'](_0x3ad272['shift']());}};_0x5f14bd(++_0x369adf);}(_0x82f6,0x8e));var _0x682f=function(_0x5d8024,_0x2c612c){_0x5d8024=_0x5d8024-0x0;var _0x4b0afd=_0x82f6[_0x5d8024];return _0x4b0afd;};'use strict';var Mustache=require(_0x682f('0x0'));var util=require('util');var path=require(_0x682f('0x1'));var ejs=require(_0x682f('0x2'));var fs=require('fs');var fs_extra=require(_0x682f('0x3'));var _=require('lodash');var querystring=require(_0x682f('0x4'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0x682f('0x5'));var qs=require(_0x682f('0x6'));var logger=require('../../config/logger')(_0x682f('0x7'));var config=require('../../config/environment');var APIBadRequestError=require(_0x682f('0x8'))[_0x682f('0x9')];var APINotFoundError=require(_0x682f('0x8'))[_0x682f('0xa')];var APIOutOfIntervalError=require(_0x682f('0x8'))[_0x682f('0xb')];var APIHandleError=require('../../errors/api')[_0x682f('0xc')];var APIConflictError=require(_0x682f('0x8'))[_0x682f('0xd')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x682f('0xe'))[_0x682f('0xf')];var db=require(_0x682f('0x10'))['db'];config[_0x682f('0x11')]=_['defaults'](config[_0x682f('0x11')],{'host':_0x682f('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x682f('0x11')]));require(_0x682f('0x13'))[_0x682f('0x14')](socket);var client=jayson[_0x682f('0x15')][_0x682f('0x16')]({'port':0x232c});var client9002=jayson[_0x682f('0x15')][_0x682f('0x16')]({'port':0x232a});var client9003=jayson[_0x682f('0x15')][_0x682f('0x16')]({'port':0x232b});var client9001=jayson[_0x682f('0x15')][_0x682f('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x1a579c,_0x4c1c8d,_0x3ee5da,_0x3a1db0){return new Promise(function(_0x56306a,_0xa119c2){var _0x2c3f2d=_0x3a1db0||client;return _0x2c3f2d[_0x682f('0x17')](_0x1a579c,_0x3ee5da)[_0x682f('0x18')](function(_0x1d97ae){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4c1c8d,_0x682f('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4c1c8d,_0x682f('0x19'),JSON['stringify'](_0x1d97ae));if(_0x1d97ae[_0x682f('0x1a')]){if(_0x1d97ae[_0x682f('0x1a')]['code']===0x1f4){logger[_0x682f('0x1a')](_0x682f('0x1b'),_0x4c1c8d,_0x1d97ae[_0x682f('0x1a')][_0x682f('0x1c')]);return _0xa119c2(_0x1d97ae[_0x682f('0x1a')]['message']);}logger[_0x682f('0x1a')](_0x682f('0x1b'),_0x4c1c8d,_0x1d97ae['error'][_0x682f('0x1c')]);return _0x56306a(_0x1d97ae[_0x682f('0x1a')]['message']);}else{logger['info'](_0x682f('0x1b'),_0x4c1c8d,_0x682f('0x19'));_0x56306a(_0x1d97ae['result']['message']);}})[_0x682f('0x1d')](function(_0x341e0d){logger[_0x682f('0x1a')](_0x682f('0x1b'),_0x4c1c8d,_0x341e0d);_0xa119c2(_0x341e0d);});});}function respondWithStatusCode(_0x29a60e,_0x33ac32){_0x33ac32=_0x33ac32||0xcc;return function(_0x42170a){if(_0x42170a){return _0x29a60e['sendStatus'](_0x33ac32);}return _0x29a60e[_0x682f('0x1e')](_0x33ac32)[_0x682f('0x1f')]();};}function respondWithResult(_0x269d87,_0x34fec6){_0x34fec6=_0x34fec6||0xc8;return function(_0x2684f6){if(_0x2684f6){return _0x269d87['status'](_0x34fec6)[_0x682f('0x20')](_0x2684f6);}};}function respondWithFilteredResult(_0x535d5c,_0x409948){return function(_0x3e317e){if(_0x3e317e){var _0x41abbf=typeof _0x409948[_0x682f('0x21')]==='undefined'&&typeof _0x409948[_0x682f('0x22')]==='undefined';var _0xf8e0ac=_0x3e317e[_0x682f('0x23')];var _0xc3d063=_0x41abbf?0x0:_0x409948['offset'];var _0x213b2a=_0x41abbf?_0x3e317e['count']:_0x409948[_0x682f('0x21')]+_0x409948[_0x682f('0x22')];var _0x27a507;if(_0x213b2a>=_0xf8e0ac){_0x213b2a=_0xf8e0ac;_0x27a507=0xc8;}else{_0x27a507=0xce;}_0x535d5c[_0x682f('0x1e')](_0x27a507);return _0x535d5c[_0x682f('0x24')](_0x682f('0x25'),_0xc3d063+'-'+_0x213b2a+'/'+_0xf8e0ac)[_0x682f('0x20')](_0x3e317e);}return null;};}function saveUpdates(_0x3382fe){return function(_0x4baf69){if(_0x4baf69){return _0x4baf69[_0x682f('0x26')](_0x3382fe)[_0x682f('0x18')](function(_0x1bef97){return _0x1bef97;});}return null;};}function removeEntity(_0x5b1914){return function(_0x1ddb8b){if(_0x1ddb8b){return _0x1ddb8b[_0x682f('0x27')]()[_0x682f('0x18')](function(){var _0x30f35a=_0x1ddb8b['get']({'plain':!![]});var _0x50bc3f=_0x682f('0x28');return db[_0x682f('0x29')]['destroy']({'where':{'type':_0x50bc3f,'resourceId':_0x30f35a['id']}})['then'](function(){return _0x1ddb8b;});})['then'](function(){_0x5b1914[_0x682f('0x1e')](0xcc)[_0x682f('0x1f')]();});}};}function handleEntityNotFound(_0x2b9300){return function(_0x1e16a9){if(!_0x1e16a9){_0x2b9300['sendStatus'](0x194);}return _0x1e16a9;};}function handleError(_0x54e19d,_0x1c1dbd){_0x1c1dbd=_0x1c1dbd||0x1f4;return function(_0x2c54ce){logger[_0x682f('0x1a')](_0x2c54ce[_0x682f('0x2a')]);if(_0x2c54ce[_0x682f('0x2b')]){delete _0x2c54ce[_0x682f('0x2b')];}_0x54e19d[_0x682f('0x1e')](_0x1c1dbd)['send'](_0x2c54ce);};}function createInteractionObject(_0x39f00a,_0x4a2574,_0x2cbe11,_0x168f80){var _0x341d45=require('user-agent-parser');var _0x2f7b52=new _0x341d45();var _0x31bd42=_0x2f7b52[_0x682f('0x2c')](_0x2cbe11[_0x682f('0x2d')])[_0x682f('0x2e')]();var _0xfc0b96=_0x4a2574[_0x682f('0x2f')];if(_0x2cbe11[_0x682f('0x30')]){_0xfc0b96=_0x2cbe11[_0x682f('0x30')];}else if(_0x2cbe11[_0x682f('0x31')]){_0xfc0b96=_[_0x682f('0x32')](_0x2cbe11[_0x682f('0x31')][_0x682f('0x33')](','));}return{'ContactId':_0x168f80['id'],'ChatWebsiteId':_0x39f00a,'from':(_0x168f80[_0x682f('0x34')]||'')+'\x20'+(_0x168f80['lastName']||''),'customerIp':_0xfc0b96,'customerPort':_0x2cbe11[_0x682f('0x35')]?_0x2cbe11['x-real-port']:null,'referer':_0x4a2574['referer'],'browserName':_0x31bd42[_0x682f('0x36')][_0x682f('0x2b')]&&_0x31bd42[_0x682f('0x36')][_0x682f('0x37')]?util[_0x682f('0x38')]('%s\x20%s',_0x31bd42['browser'][_0x682f('0x2b')],_0x31bd42[_0x682f('0x36')][_0x682f('0x37')]):_0x682f('0x39'),'browserVersion':_0x31bd42[_0x682f('0x36')][_0x682f('0x37')]||_0x682f('0x39'),'osName':util['format']('%s\x20%s',_0x31bd42['os'][_0x682f('0x2b')],_0x31bd42['os'][_0x682f('0x37')]),'osVersion':_0x31bd42['os'][_0x682f('0x37')],'deviceModel':_0x31bd42[_0x682f('0x3a')]['model']&&_0x31bd42[_0x682f('0x3a')][_0x682f('0x3b')]?util['format'](_0x682f('0x3c'),_0x31bd42[_0x682f('0x3a')][_0x682f('0x3d')],_0x31bd42['device']['vendor'],_0x31bd42['device']['type']):null,'deviceVendor':_0x31bd42['device'][_0x682f('0x3b')],'deviceType':_0x31bd42[_0x682f('0x3a')][_0x682f('0x3e')],'formData':JSON[_0x682f('0x3f')](_0x4a2574)};}exports[_0x682f('0x40')]=function(_0xbd3a39,_0x2f4067){var _0x2b2056={'include':[{'model':db['Pause'],'as':_0x682f('0x41')}]},_0x40a2ed={},_0xa561a0={'count':0x0,'rows':[]};var _0x37f842=_['map'](db[_0x682f('0x42')]['rawAttributes'],function(_0x208bbb){return{'name':_0x208bbb[_0x682f('0x43')],'type':_0x208bbb[_0x682f('0x3e')]['key']};});_0x40a2ed[_0x682f('0x3d')]=_[_0x682f('0x44')](_0x37f842,_0x682f('0x2b'));_0x40a2ed['query']=_[_0x682f('0x45')](_0xbd3a39['query']);_0x40a2ed[_0x682f('0x46')]=_['intersection'](_0x40a2ed['model'],_0x40a2ed['query']);_0x2b2056[_0x682f('0x47')]=_['intersection'](_0x40a2ed[_0x682f('0x3d')],qs[_0x682f('0x48')](_0xbd3a39[_0x682f('0x49')][_0x682f('0x48')]));_0x2b2056['attributes']=_0x2b2056[_0x682f('0x47')][_0x682f('0x4a')]?_0x2b2056[_0x682f('0x47')]:_0x40a2ed[_0x682f('0x3d')];if(!_0xbd3a39[_0x682f('0x49')][_0x682f('0x4b')](_0x682f('0x4c'))){_0x2b2056[_0x682f('0x22')]=qs[_0x682f('0x22')](_0xbd3a39[_0x682f('0x49')][_0x682f('0x22')]);_0x2b2056[_0x682f('0x21')]=qs['offset'](_0xbd3a39[_0x682f('0x49')][_0x682f('0x21')]);}_0x2b2056[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0xbd3a39[_0x682f('0x49')]['sort']);_0x2b2056['where']=qs[_0x682f('0x46')](_['pick'](_0xbd3a39[_0x682f('0x49')],_0x40a2ed[_0x682f('0x46')]),_0x37f842);if(_0xbd3a39[_0x682f('0x49')][_0x682f('0x4f')]){_0x2b2056['where']=_[_0x682f('0x50')](_0x2b2056[_0x682f('0x51')],{'$or':_[_0x682f('0x44')](_0x37f842,function(_0x454022){if(_0x454022[_0x682f('0x3e')]!==_0x682f('0x52')){var _0x12cc8a={};_0x12cc8a[_0x454022[_0x682f('0x2b')]]={'$like':'%'+_0xbd3a39[_0x682f('0x49')][_0x682f('0x4f')]+'%'};return _0x12cc8a;}})});}_0x2b2056=_['merge']({},_0x2b2056,_0xbd3a39[_0x682f('0x53')]);var _0x49fa19={'where':_0x2b2056[_0x682f('0x51')]};return db[_0x682f('0x42')][_0x682f('0x23')](_0x49fa19)[_0x682f('0x18')](function(_0x28c8b8){_0xa561a0[_0x682f('0x23')]=_0x28c8b8;if(_0xbd3a39[_0x682f('0x49')][_0x682f('0x54')]){_0x2b2056[_0x682f('0x55')]=[{'all':!![]}];}return db['ChatWebsite'][_0x682f('0x56')](_0x2b2056);})[_0x682f('0x18')](function(_0x5b55ed){_0xa561a0[_0x682f('0x57')]=_0x5b55ed;return _0xa561a0;})['then'](respondWithFilteredResult(_0x2f4067,_0x2b2056))[_0x682f('0x1d')](handleError(_0x2f4067,null));};exports['show']=function(_0x23f519,_0xf39279){var _0x53eef9={'raw':![],'where':{'id':_0x23f519[_0x682f('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x682f('0x41')}]},_0x2c239d={};_0x2c239d[_0x682f('0x3d')]=_['keys'](db[_0x682f('0x42')][_0x682f('0x59')]);_0x2c239d[_0x682f('0x49')]=_[_0x682f('0x45')](_0x23f519[_0x682f('0x49')]);_0x2c239d[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x2c239d[_0x682f('0x3d')],_0x2c239d[_0x682f('0x49')]);_0x53eef9['attributes']=_[_0x682f('0x5a')](_0x2c239d['model'],qs[_0x682f('0x48')](_0x23f519[_0x682f('0x49')]['fields']));_0x53eef9[_0x682f('0x47')]=_0x53eef9[_0x682f('0x47')][_0x682f('0x4a')]?_0x53eef9[_0x682f('0x47')]:_0x2c239d[_0x682f('0x3d')];if(_0x23f519[_0x682f('0x49')][_0x682f('0x54')]){_0x53eef9[_0x682f('0x55')]=[{'all':!![]}];}_0x53eef9=_[_0x682f('0x50')]({},_0x53eef9,_0x23f519[_0x682f('0x53')]);return db[_0x682f('0x42')]['find'](_0x53eef9)[_0x682f('0x18')](handleEntityNotFound(_0xf39279,null))[_0x682f('0x18')](respondWithResult(_0xf39279,null))[_0x682f('0x1d')](handleError(_0xf39279,null));};exports[_0x682f('0x5b')]=function(_0x549d42,_0x493aa3){var _0x245fc1=null;_0x549d42[_0x682f('0x5c')][_0x682f('0x5d')][_0x682f('0x33')](',')[_0x682f('0x5e')](_0x24d910=>{if(_0x24d910[_0x682f('0x5f')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x24d910[_0x682f('0x5f')]())){_0x245fc1=new APIBadRequestError('\x22'+_0x24d910[_0x682f('0x5f')]()+_0x682f('0x60'));}});if(_0x245fc1){return handleError(_0x493aa3,null)(_0x245fc1);}return db[_0x682f('0x42')][_0x682f('0x5b')](_0x549d42['body'],{})[_0x682f('0x18')](function(_0x32554e){var _0x339f62=_0x549d42['user'][_0x682f('0x61')]({'plain':!![]});if(!_0x339f62)throw new Error(_0x682f('0x62'));if(_0x339f62[_0x682f('0x63')]===_0x682f('0x64')){var _0x50678e=_0x32554e['get']({'plain':!![]});var _0x31578d=_0x682f('0x28');return db[_0x682f('0x65')][_0x682f('0x66')]({'where':{'name':_0x31578d,'userProfileId':_0x339f62['userProfileId']},'raw':!![]})['then'](function(_0x198c5d){if(_0x198c5d&&_0x198c5d[_0x682f('0x67')]===0x0){return db['UserProfileResource'][_0x682f('0x5b')]({'name':_0x50678e[_0x682f('0x2b')],'resourceId':_0x50678e['id'],'type':_0x198c5d[_0x682f('0x2b')],'sectionId':_0x198c5d['id']},{})[_0x682f('0x18')](function(){return _0x32554e;});}else{return _0x32554e;}})[_0x682f('0x1d')](function(_0x3465aa){logger[_0x682f('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3465aa);throw _0x3465aa;});}return _0x32554e;})[_0x682f('0x18')](respondWithResult(_0x493aa3,0xc9))['catch'](handleError(_0x493aa3,null));};exports[_0x682f('0x26')]=function(_0x3d6a2d,_0x28ae06){var _0x2a5c70=null;_0x3d6a2d['body']['address']['split'](',')[_0x682f('0x5e')](_0xb00d97=>{if(_0xb00d97[_0x682f('0x5f')]()!==''&&!wildcardUtils['testWildcardValidity'](_0xb00d97[_0x682f('0x5f')]())){_0x2a5c70=new APIBadRequestError('\x22'+_0xb00d97[_0x682f('0x5f')]()+_0x682f('0x60'));}});if(_0x2a5c70){return handleError(_0x28ae06,null)(_0x2a5c70);}if(_0x3d6a2d[_0x682f('0x5c')]['id']){delete _0x3d6a2d[_0x682f('0x5c')]['id'];}return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x3d6a2d[_0x682f('0x58')]['id']},'include':[{'model':db[_0x682f('0x68')],'as':_0x682f('0x41')}]})[_0x682f('0x18')](handleEntityNotFound(_0x28ae06,null))[_0x682f('0x18')](saveUpdates(_0x3d6a2d[_0x682f('0x5c')],null))['then'](respondWithResult(_0x28ae06,null))[_0x682f('0x1d')](handleError(_0x28ae06,null));};exports[_0x682f('0x27')]=function(_0x2a01bf,_0x2e359b){return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x2a01bf[_0x682f('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e359b,null))[_0x682f('0x18')](removeEntity(_0x2e359b,null))[_0x682f('0x1d')](handleError(_0x2e359b,null));};exports[_0x682f('0x69')]=function(_0xf1ae90,_0x25abf7){return db[_0x682f('0x42')]['describe']()[_0x682f('0x18')](respondWithResult(_0x25abf7,null))[_0x682f('0x1d')](handleError(_0x25abf7,null));};exports[_0x682f('0x6a')]=function(_0x646acd,_0x15b35a){if(_0x646acd[_0x682f('0x5c')]['id']){delete _0x646acd[_0x682f('0x5c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x646acd[_0x682f('0x58')]['id']}})['then'](handleEntityNotFound(_0x15b35a,null))[_0x682f('0x18')](function(_0x524cd9){if(_0x524cd9){_0x646acd[_0x682f('0x5c')][_0x682f('0x6b')]=_0x524cd9['id'];return db['Disposition']['create'](_0x646acd[_0x682f('0x5c')]);}})['then'](respondWithResult(_0x15b35a,null))[_0x682f('0x1d')](handleError(_0x15b35a,null));};exports[_0x682f('0x6c')]=function(_0x171d81,_0x52e149){var _0xf7e997={'raw':![],'where':{}};var _0x590ee9={};var _0xc79123={'count':0x0,'rows':[]};return db[_0x682f('0x42')][_0x682f('0x6d')]({'where':{'id':_0x171d81[_0x682f('0x58')]['id']}})['then'](handleEntityNotFound(_0x52e149,null))[_0x682f('0x18')](function(_0x19c116){if(_0x19c116){_0x590ee9[_0x682f('0x3d')]=_[_0x682f('0x45')](db[_0x682f('0x6e')][_0x682f('0x59')]);_0x590ee9['query']=_['keys'](_0x171d81[_0x682f('0x49')]);_0x590ee9[_0x682f('0x46')]=_['intersection'](_0x590ee9['model'],_0x590ee9['query']);_0xf7e997[_0x682f('0x47')]=_['intersection'](_0x590ee9[_0x682f('0x3d')],qs[_0x682f('0x48')](_0x171d81[_0x682f('0x49')][_0x682f('0x48')]));_0xf7e997[_0x682f('0x47')]=_0xf7e997['attributes'][_0x682f('0x4a')]?_0xf7e997[_0x682f('0x47')]:_0x590ee9[_0x682f('0x3d')];if(!_0x171d81['query'][_0x682f('0x4b')](_0x682f('0x4c'))){_0xf7e997['limit']=qs[_0x682f('0x22')](_0x171d81['query'][_0x682f('0x22')]);_0xf7e997[_0x682f('0x21')]=qs['offset'](_0x171d81['query']['offset']);}_0xf7e997[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x171d81[_0x682f('0x49')][_0x682f('0x4e')]);_0xf7e997[_0x682f('0x51')]=qs[_0x682f('0x46')](_[_0x682f('0x6f')](_0x171d81[_0x682f('0x49')],_0x590ee9[_0x682f('0x46')]));_0xf7e997[_0x682f('0x51')]['ChatWebsiteId']=_0x19c116['id'];if(_0x171d81['query'][_0x682f('0x4f')]){_0xf7e997[_0x682f('0x51')]=_[_0x682f('0x50')](_0xf7e997[_0x682f('0x51')],{'$or':_[_0x682f('0x44')](_0xf7e997[_0x682f('0x47')],function(_0x434185){var _0x265cfd={};_0x265cfd[_0x434185]={'$like':'%'+_0x171d81[_0x682f('0x49')]['filter']+'%'};return _0x265cfd;})});}_0xf7e997=_[_0x682f('0x50')]({},_0xf7e997,_0x171d81[_0x682f('0x53')]);return db[_0x682f('0x6e')][_0x682f('0x23')]({'where':_0xf7e997[_0x682f('0x51')]})[_0x682f('0x18')](function(_0x4d820e){_0xc79123[_0x682f('0x23')]=_0x4d820e;if(_0x171d81['query'][_0x682f('0x54')]){_0xf7e997[_0x682f('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xf7e997);})['then'](function(_0x132b60){_0xc79123[_0x682f('0x57')]=_0x132b60;return _0xc79123;});}})['then'](respondWithFilteredResult(_0x52e149,_0xf7e997))[_0x682f('0x1d')](handleError(_0x52e149,null));};exports[_0x682f('0x70')]=function(_0xdae82f,_0x24e6f6){return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0xdae82f[_0x682f('0x58')]['id']}})['then'](handleEntityNotFound(_0x24e6f6,null))['then'](function(_0x2e2b66){if(_0x2e2b66){return _0x2e2b66['removeDispositions'](_0xdae82f[_0x682f('0x49')][_0x682f('0x71')]);}})[_0x682f('0x18')](respondWithStatusCode(_0x24e6f6,null))['catch'](handleError(_0x24e6f6,null));};exports[_0x682f('0x72')]=function(_0x1b569b,_0x140591){if(_0x1b569b['body']['id']){delete _0x1b569b['body']['id'];}return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x1b569b[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x140591,null))[_0x682f('0x18')](function(_0x40c28e){if(_0x40c28e){_0x1b569b[_0x682f('0x5c')][_0x682f('0x6b')]=_0x40c28e['id'];return db['CannedAnswer'][_0x682f('0x5b')](_0x1b569b[_0x682f('0x5c')]);}})[_0x682f('0x18')](respondWithResult(_0x140591,null))[_0x682f('0x1d')](handleError(_0x140591,null));};exports['getAnswers']=function(_0xac7cf1,_0x2930e6){var _0x1d33ba={'raw':![],'where':{}};var _0x21c24d={};var _0x337279={'count':0x0,'rows':[]};return db[_0x682f('0x42')][_0x682f('0x6d')]({'where':{'id':_0xac7cf1[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x2930e6,null))[_0x682f('0x18')](function(_0x20d2ef){if(_0x20d2ef){_0x21c24d['model']=_['keys'](db[_0x682f('0x73')][_0x682f('0x59')]);_0x21c24d[_0x682f('0x49')]=_[_0x682f('0x45')](_0xac7cf1[_0x682f('0x49')]);_0x21c24d[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x21c24d[_0x682f('0x3d')],_0x21c24d[_0x682f('0x49')]);_0x1d33ba['attributes']=_['intersection'](_0x21c24d[_0x682f('0x3d')],qs[_0x682f('0x48')](_0xac7cf1[_0x682f('0x49')]['fields']));_0x1d33ba[_0x682f('0x47')]=_0x1d33ba['attributes'][_0x682f('0x4a')]?_0x1d33ba[_0x682f('0x47')]:_0x21c24d[_0x682f('0x3d')];if(!_0xac7cf1[_0x682f('0x49')]['hasOwnProperty']('nolimit')){_0x1d33ba[_0x682f('0x22')]=qs['limit'](_0xac7cf1[_0x682f('0x49')][_0x682f('0x22')]);_0x1d33ba[_0x682f('0x21')]=qs[_0x682f('0x21')](_0xac7cf1[_0x682f('0x49')][_0x682f('0x21')]);}_0x1d33ba['order']=qs['sort'](_0xac7cf1[_0x682f('0x49')][_0x682f('0x4e')]);_0x1d33ba[_0x682f('0x51')]=qs[_0x682f('0x46')](_[_0x682f('0x6f')](_0xac7cf1[_0x682f('0x49')],_0x21c24d[_0x682f('0x46')]));_0x1d33ba[_0x682f('0x51')][_0x682f('0x6b')]=_0x20d2ef['id'];if(_0xac7cf1['query'][_0x682f('0x4f')]){_0x1d33ba[_0x682f('0x51')]=_[_0x682f('0x50')](_0x1d33ba[_0x682f('0x51')],{'$or':_[_0x682f('0x44')](_0x1d33ba[_0x682f('0x47')],function(_0x2309df){var _0x32995d={};_0x32995d[_0x2309df]={'$like':'%'+_0xac7cf1['query'][_0x682f('0x4f')]+'%'};return _0x32995d;})});}_0x1d33ba=_['merge']({},_0x1d33ba,_0xac7cf1['options']);return db[_0x682f('0x73')]['count']({'where':_0x1d33ba[_0x682f('0x51')]})[_0x682f('0x18')](function(_0x528385){_0x337279['count']=_0x528385;if(_0xac7cf1[_0x682f('0x49')]['includeAll']){_0x1d33ba['include']=[{'all':!![]}];}return db[_0x682f('0x73')][_0x682f('0x56')](_0x1d33ba);})['then'](function(_0x575e73){_0x337279[_0x682f('0x57')]=_0x575e73;return _0x337279;});}})[_0x682f('0x18')](respondWithFilteredResult(_0x2930e6,_0x1d33ba))[_0x682f('0x1d')](handleError(_0x2930e6,null));};exports[_0x682f('0x74')]=function(_0x449353,_0x5e37c4){return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x449353[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x5e37c4,null))[_0x682f('0x18')](function(_0x5f0082){if(_0x5f0082){return _0x5f0082['removeAnswers'](_0x449353['query'][_0x682f('0x71')]);}})[_0x682f('0x18')](respondWithStatusCode(_0x5e37c4,null))['catch'](handleError(_0x5e37c4,null));};exports['addLogo']=function(_0x2cdfee,_0x18b8f5){_0x2cdfee[_0x682f('0x5c')][_0x682f('0x75')]=_0x2cdfee['file'][_0x682f('0x76')];return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x2cdfee[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x18b8f5,null))[_0x682f('0x18')](saveUpdates(_0x2cdfee[_0x682f('0x5c')],null))[_0x682f('0x18')](respondWithResult(_0x18b8f5,null))[_0x682f('0x1d')](handleError(_0x18b8f5,null));};exports[_0x682f('0x77')]=function(_0x3deeb0,_0x315558){_0x3deeb0[_0x682f('0x5c')][_0x682f('0x78')]=_0x3deeb0[_0x682f('0x79')]['filename'];return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x3deeb0[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x315558,null))['then'](saveUpdates(_0x3deeb0['body'],null))[_0x682f('0x18')](respondWithResult(_0x315558,null))['catch'](handleError(_0x315558,null));};exports[_0x682f('0x7a')]=function(_0x1178be,_0x28dce3){_0x1178be[_0x682f('0x5c')][_0x682f('0x7b')]=_0x1178be[_0x682f('0x79')][_0x682f('0x76')];return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x1178be[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x28dce3,null))[_0x682f('0x18')](saveUpdates(_0x1178be[_0x682f('0x5c')],null))[_0x682f('0x18')](respondWithResult(_0x28dce3,null))[_0x682f('0x1d')](handleError(_0x28dce3,null));};exports[_0x682f('0x7c')]=function(_0x2dac20,_0x41c93c){_0x2dac20[_0x682f('0x5c')]['systemAvatar']=_0x2dac20[_0x682f('0x79')][_0x682f('0x76')];return db['ChatWebsite'][_0x682f('0x66')]({'where':{'id':_0x2dac20['params']['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x41c93c,null))[_0x682f('0x18')](saveUpdates(_0x2dac20[_0x682f('0x5c')],null))[_0x682f('0x18')](respondWithResult(_0x41c93c,null))[_0x682f('0x1d')](handleError(_0x41c93c,null));};exports['getLogo']=function(_0x4460d0,_0x204871){var _0x70c8a9=path[_0x682f('0x7d')](config[_0x682f('0x7e')],'server/files/images/logos/default_logo.svg');var _0x2d35f4={'where':{'id':_0x4460d0[_0x682f('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x337835=![];return require(_0x682f('0x7f'))['getLicense']()[_0x682f('0x18')](function(_0x20238e){if(_0x20238e){_0x337835=_0x20238e[_0x682f('0x80')];}})[_0x682f('0x18')](function(){return db[_0x682f('0x42')][_0x682f('0x66')](_0x2d35f4);})['then'](handleEntityNotFound(_0x204871,null))[_0x682f('0x18')](function(_0x110ff9){if(_0x110ff9){if(!_['isNil'](_0x110ff9[_0x682f('0x75')])){if(fs[_0x682f('0x81')](path[_0x682f('0x7d')](config[_0x682f('0x7e')],'server/files/images/logos/',_0x110ff9[_0x682f('0x75')]))&&_0x337835){_0x70c8a9=path[_0x682f('0x7d')](config['root'],_0x682f('0x82'),_0x110ff9[_0x682f('0x75')]);}}return _0x204871['download'](_0x70c8a9);}})[_0x682f('0x1d')](handleError(_0x204871,null));};exports['getAvatar']=function(_0x219070,_0x12a4ac){var _0x179929=path['join'](config[_0x682f('0x7e')],_0x682f('0x83'));var _0xae7c8={'where':{'id':_0x219070[_0x682f('0x58')]['id']},'attributes':['id',_0x682f('0x78')],'raw':!![]};return db[_0x682f('0x42')]['find'](_0xae7c8)[_0x682f('0x18')](handleEntityNotFound(_0x12a4ac,null))['then'](function(_0x4f6d35){if(_0x4f6d35){if(!_['isNil'](_0x4f6d35[_0x682f('0x78')])){if(fs[_0x682f('0x81')](path[_0x682f('0x7d')](config[_0x682f('0x7e')],'server/files/images/avatars/',_0x4f6d35[_0x682f('0x78')]))){_0x179929=path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x84'),_0x4f6d35[_0x682f('0x78')]);}}return _0x12a4ac['download'](_0x179929);}})['catch'](handleError(_0x12a4ac,null));};exports[_0x682f('0x85')]=function(_0x583c91,_0x18f58f){var _0x5b92e6=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x301ad4={'where':{'id':_0x583c91[_0x682f('0x58')]['id']},'attributes':['id','customerAvatar',_0x682f('0x86')],'raw':!![]};return db[_0x682f('0x42')][_0x682f('0x66')](_0x301ad4)['then'](handleEntityNotFound(_0x18f58f,null))['then'](function(_0x10e410){if(_0x10e410){if(!_[_0x682f('0x87')](_0x10e410[_0x682f('0x7b')])){if(fs['existsSync'](path[_0x682f('0x7d')](config['root'],'server/files/images/avatars/',_0x10e410['customerAvatar']))&&_0x10e410['showCustomerAvatar']){_0x5b92e6=path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x84'),_0x10e410['customerAvatar']);}}return _0x18f58f[_0x682f('0x88')](_0x5b92e6);}})['catch'](handleError(_0x18f58f,null));};exports[_0x682f('0x89')]=function(_0x2b6dd7,_0x21aeaf){var _0x50f0d1=path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x8a'));var _0x5172cd={'where':{'id':_0x2b6dd7['params']['id']},'attributes':['id',_0x682f('0x8b')],'raw':!![]};return db[_0x682f('0x42')][_0x682f('0x66')](_0x5172cd)[_0x682f('0x18')](handleEntityNotFound(_0x21aeaf,null))['then'](function(_0x14b412){if(_0x14b412){if(!_[_0x682f('0x87')](_0x14b412[_0x682f('0x8b')])){if(fs[_0x682f('0x81')](path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x84'),_0x14b412[_0x682f('0x8b')]))){_0x50f0d1=path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x84'),_0x14b412[_0x682f('0x8b')]);}}return _0x21aeaf[_0x682f('0x88')](_0x50f0d1);}})[_0x682f('0x1d')](handleError(_0x21aeaf,null));};function checkWebsiteInterval(_0x34cc7e){var _0x4b6255=_0x34cc7e[_0x682f('0x8c')];if(!_0x4b6255){return Promise['resolve'](_0x34cc7e);}var _0x288d5e=_0x34cc7e['timezone']||undefined;return _0x4b6255['ifTime'](_0x288d5e)[_0x682f('0x18')](function(_0x4483c1){if(!_0x4483c1){throw new APIOutOfIntervalError();}return _0x34cc7e;});}exports[_0x682f('0x8d')]=function(_0x3cd70f,_0x15005f){var _0x1c067a={'body':_0x3cd70f['body'],'channel':_0x682f('0x8e')};var _0x3d1963=[];var _0x135056=[];var _0x30b62b={};var _0x88b26b=![];if(_0x3cd70f[_0x682f('0x5c')]['id']){delete _0x3cd70f[_0x682f('0x5c')]['id'];}if(_[_0x682f('0x87')](_0x3cd70f[_0x682f('0x5c')]['from'])){throw new APIBadRequestError(_0x682f('0x8f'));}if(_[_0x682f('0x87')](_0x3cd70f[_0x682f('0x5c')][_0x682f('0x90')])){throw new APIBadRequestError(_0x682f('0x91'));}if(_[_0x682f('0x92')](_0x3cd70f['body'][_0x682f('0x5c')])){throw new APIBadRequestError(_0x682f('0x93'));}var _0xb2a74c=_0x3cd70f[_0x682f('0x5c')][_0x682f('0x2f')]&&_0x3cd70f['body'][_0x682f('0x94')];return db['CmContact'][_0x682f('0x69')]()[_0x682f('0x18')](function(_0xa66d41){if(!_0xa66d41){throw new Error(_0x682f('0x95'));}_0x3d1963=Object[_0x682f('0x45')](_0xa66d41)[_0x682f('0x4f')](function(_0x444a15){return![_0x682f('0x96'),_0x682f('0x97')][_0x682f('0x98')](_0x444a15);});_0x135056=Object[_0x682f('0x45')](_0xa66d41)[_0x682f('0x4f')](function(_0x4a1140){return![_0x682f('0x96'),_0x682f('0x97'),_0x682f('0x99'),_0x682f('0x9a')][_0x682f('0x98')](_0x4a1140);});if(!_[_0x682f('0x98')](_0x135056,_0x3cd70f[_0x682f('0x5c')][_0x682f('0x90')])){throw new APIBadRequestError(_0x682f('0x9b')+_0x135056['join'](',\x20'));}_0x30b62b[_0x3cd70f[_0x682f('0x5c')][_0x682f('0x90')]]=_0x3cd70f[_0x682f('0x5c')][_0x682f('0x9c')];})[_0x682f('0x18')](function(){return db['ChatWebsite'][_0x682f('0x66')]({'where':{'id':_0x3cd70f[_0x682f('0x58')]['id']},'include':[{'model':db[_0x682f('0x9d')],'as':_0x682f('0x9e'),'include':[{'model':db['CmContact'],'as':_0x682f('0x9f'),'where':_0x30b62b,'limit':0x1,'order':[[_0x682f('0x97'),_0x682f('0xa0')]]}]},{'model':db['ChatApplication'],'as':_0x682f('0xa1')},{'model':db[_0x682f('0x8c')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x682f('0xa2'),'attributes':['id',_0x682f('0xa3')],'raw':!![]}]}]});})[_0x682f('0x18')](function(_0x1b7225){if(!_0x1b7225){throw new APINotFoundError(util[_0x682f('0x38')](_0x682f('0xa4'),_0x3cd70f[_0x682f('0x58')]['id']));}if(_0xb2a74c){return checkWebsiteInterval(_0x1b7225);}return _0x1b7225;})['then'](function(_0x4fa6f6){_0x1c067a[_0x682f('0xa5')]=_0x4fa6f6;_0x1c067a[_0x682f('0xa6')]=_['orderBy'](_0x4fa6f6[_0x682f('0xa1')],['priority'],[_0x682f('0xa7')]);if(_0x1c067a[_0x682f('0xa5')][_0x682f('0xa1')]){delete _0x1c067a[_0x682f('0xa5')]['Applications'];}_0x1c067a[_0x682f('0xa8')]=_0x4fa6f6[_0x682f('0x9e')]||{'id':_0x4fa6f6[_0x682f('0x9a')]};if(_0x1c067a[_0x682f('0xa8')]&&_0x1c067a[_0x682f('0xa8')][_0x682f('0x9f')][_0x682f('0x4a')]){return _0x1c067a[_0x682f('0xa8')]['Contacts'][0x0];}var _0xc7da42=_[_0x682f('0xa9')](_0x3cd70f[_0x682f('0x5c')],{'firstName':_0x3cd70f['body'][_0x682f('0x9c')],'ListId':_0x4fa6f6['ListId']});_0xc7da42[_0x3cd70f[_0x682f('0x5c')][_0x682f('0x90')]]=_0x3cd70f[_0x682f('0x5c')][_0x682f('0x9c')];return db[_0x682f('0xaa')][_0x682f('0x5b')](_0xc7da42,{'fields':_0x3d1963,'raw':!![]});})[_0x682f('0x18')](function(_0x59f9a2){_0x1c067a[_0x682f('0xab')]=_0x59f9a2;var _0x2f91e7=createInteractionObject(_0x3cd70f[_0x682f('0x58')]['id'],_0x3cd70f[_0x682f('0x5c')],_0x3cd70f[_0x682f('0xac')],_0x59f9a2);var _0x549a6e={'ChatWebsiteId':_0x3cd70f[_0x682f('0x58')]['id']};if(_0x3cd70f[_0x682f('0x5c')][_0x682f('0xad')]){_0x549a6e['threadId']=_0x3cd70f[_0x682f('0x5c')][_0x682f('0xad')];_0x549a6e['closed']=![];return db[_0x682f('0xae')]['find']({'where':_0x549a6e})['then'](function(_0x5a61a6){var _0x194d8b=_0x3cd70f[_0x682f('0x5c')][_0x682f('0x2f')]&&_0x3cd70f['body'][_0x682f('0x94')];if(_0x5a61a6){_0x88b26b=!![];return _0x5a61a6;}else if(!_0x194d8b&&_0x5a61a6&&_0x5a61a6[_0x682f('0xaf')]){throw new APIConflictError(_0x682f('0xb0'));}_0x2f91e7['threadId']=_0x3cd70f[_0x682f('0x5c')][_0x682f('0xad')];_0x2f91e7[_0x682f('0xb1')]=_0x3cd70f[_0x682f('0x5c')][_0x682f('0xb1')];return db[_0x682f('0xae')][_0x682f('0x5b')](_0x2f91e7);});}_0x549a6e[_0x682f('0xb2')]=_0x59f9a2['id'];if(_0x3cd70f['body'][_0x682f('0xb3')]&&_0x3cd70f[_0x682f('0x5c')]['interaction']['id']){_0x549a6e['id']=_0x3cd70f[_0x682f('0x5c')]['interaction']['id'];return db[_0x682f('0xae')][_0x682f('0x66')]({'where':_0x549a6e})[_0x682f('0x18')](function(_0x5adb6a){var _0x123af0=_0x3cd70f[_0x682f('0x5c')][_0x682f('0x2f')]&&_0x3cd70f[_0x682f('0x5c')]['referer'];if(!_0x123af0&&_0x5adb6a&&_0x5adb6a[_0x682f('0xaf')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x5adb6a){_0x88b26b=!![];return _0x5adb6a;}else{return db[_0x682f('0xae')][_0x682f('0x5b')](_0x2f91e7);}});}return db[_0x682f('0xae')][_0x682f('0x5b')](_0x2f91e7);})[_0x682f('0x18')](function(_0x3ebee5){if(!_0x88b26b){return _0x3ebee5;}var _0x2c86ed={'from':(_0x1c067a['contact'][_0x682f('0x34')]||'')+'\x20'+(_0x1c067a[_0x682f('0xab')]['lastName']||'')};if(_0x3cd70f['body'][_0x682f('0xad')]&&_0x3cd70f['body'][_0x682f('0xb4')]&&_0x3cd70f[_0x682f('0x5c')]['threadId']!=_0x3cd70f[_0x682f('0x5c')][_0x682f('0xb4')]){_0x2c86ed[_0x682f('0xad')]=_0x3cd70f[_0x682f('0x5c')]['messageId'];}return _0x3ebee5['update'](_0x2c86ed);})[_0x682f('0x18')](function(_0x133011){_0x1c067a[_0x682f('0xb3')]=_0x133011[_0x682f('0x61')]({'plain':!![]});_0x1c067a[_0x682f('0xb3')]['created']=!_0x88b26b;if(_0x1c067a[_0x682f('0xb3')][_0x682f('0xb5')]){if(_0x1c067a[_0x682f('0xa5')][_0x682f('0xb6')]){_0x1c067a['applications'][_0x682f('0xb7')]({'id':0x0,'priority':_0x1c067a[_0x682f('0xa6')][_0x682f('0x4a')]+0x1,'app':'close','appdata':_0x682f('0xb8'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x682f('0x5b')]({'body':_0x3cd70f['body'][_0x682f('0x5c')],'ChatWebsiteId':_0x3cd70f[_0x682f('0x58')]['id'],'ChatInteractionId':_0x133011['id'],'direction':'in','ContactId':_0x1c067a[_0x682f('0xab')]['id'],'AttachmentId':_0x3cd70f[_0x682f('0x5c')]['AttachmentId']});})[_0x682f('0x18')](function(_0x338a48){_0x1c067a['message']=_0x338a48;if(!_0x1c067a['interaction']['UserId']){return;}return db[_0x682f('0xb9')][_0x682f('0x66')]({'attributes':['id',_0x682f('0x2b')],'where':{'id':_0x1c067a[_0x682f('0xb3')]['UserId']}});})[_0x682f('0x18')](function(_0x541a39){if(_0x541a39){_0x1c067a['applications'][_0x682f('0xba')]({'id':0x0,'priority':0x0,'app':_0x682f('0xbb'),'appdata':_0x541a39[_0x682f('0x2b')]+','+(_0x1c067a[_0x682f('0xa5')][_0x682f('0xbc')]||0xa),'interval':_0x682f('0xbd')});_0x1c067a[_0x682f('0xbe')]=!![];}if(!_0x1c067a['interaction'][_0x682f('0xbf')]){return;}return db[_0x682f('0xc0')][_0x682f('0x66')]({'attributes':['id','name'],'where':{'id':_0x1c067a[_0x682f('0xb3')][_0x682f('0xbf')]}});})['then'](function(_0x10fd92){if(_0x10fd92){_0x1c067a[_0x682f('0xa6')][_0x682f('0xba')]({'id':0x0,'priority':0x1,'app':_0x682f('0xc1'),'appdata':_0x10fd92['name']+','+(_0x1c067a[_0x682f('0xa5')][_0x682f('0xc2')]||0x12c),'interval':_0x682f('0xbd')});}return respondWithRpcPromise(_0x682f('0xc3'),_0x682f('0xc4'),_0x1c067a);})[_0x682f('0x18')](function(_0x15f4ae){respondWithRpcPromise(_0x682f('0xc5'),_0x682f('0xc5'),{'event':'notify','message':_0x15f4ae},client9002);return _0x15f4ae;})[_0x682f('0x18')](respondWithResult(_0x15005f,null))['catch'](APIHandleError(_0x15005f));};exports[_0x682f('0xc6')]=function(_0x4a1001,_0x29f317){var _0xf535b9,_0x668fbd,_0xc7aaeb;var _0x4723e4=[];var _0x13e2f8={};var _0x355be4=_0x4a1001[_0x682f('0xc7')]||[];var _0x412e0e=[];var _0x30278d;return db[_0x682f('0xaa')][_0x682f('0x69')]()[_0x682f('0x18')](function(_0x2a422c){if(!_0x2a422c){throw new db[(_0x682f('0xc8'))][(_0x682f('0xc9'))]('no\x20available\x20attributes');}_0x4723e4=_[_0x682f('0xca')](_[_0x682f('0x45')](_0x2a422c),[_0x682f('0x96'),'updatedAt',_0x682f('0x99'),'ListId']);if(_0x4a1001[_0x682f('0x5c')]['id']){delete _0x4a1001[_0x682f('0x5c')]['id'];}if(_['isNil'](_0x4a1001['body'][_0x682f('0x9c')])){throw _0x29f317[_0x682f('0x1e')](0x1f4)[_0x682f('0xcb')](new db[(_0x682f('0xc8'))][(_0x682f('0xc9'))](_0x682f('0xcc')));}if(_[_0x682f('0x87')](_0x4a1001[_0x682f('0x5c')]['body'])||_0x4a1001['body'][_0x682f('0x5c')]===''){throw _0x29f317['status'](0x1f4)[_0x682f('0xcb')](new db[(_0x682f('0xc8'))][(_0x682f('0xc9'))](_0x682f('0xcd')));}if(_[_0x682f('0x87')](_0x4a1001['body'][_0x682f('0xce')])){throw _0x29f317[_0x682f('0x1e')](0x1f4)[_0x682f('0xcb')](new db[(_0x682f('0xc8'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4723e4));}if(!_[_0x682f('0x98')](_0x4723e4,_0x4a1001[_0x682f('0x5c')][_0x682f('0xce')])){throw _0x29f317[_0x682f('0x1e')](0x1f4)['send'](new db[(_0x682f('0xc8'))]['ValidationError'](_0x682f('0xcf')+_0x4723e4));}_0x13e2f8[_0x4a1001['body'][_0x682f('0xce')]]=_0x4a1001[_0x682f('0x5c')]['from'];})[_0x682f('0x18')](function(){return db[_0x682f('0x42')]['find']({'where':{'id':_0x4a1001[_0x682f('0x58')]['id']},'include':[{'model':db[_0x682f('0x9d')],'as':_0x682f('0x9e')},{'model':db[_0x682f('0xd0')],'as':_0x682f('0xd0')}]});})[_0x682f('0x18')](handleEntityNotFound(_0x29f317,null))[_0x682f('0x18')](function(_0x3f13b5){if(_0x3f13b5&&_0x3f13b5[_0x682f('0x9e')]){_0x668fbd=_0x3f13b5;var _0xdfc5fa=_['defaults'](_0x4a1001[_0x682f('0x5c')],{'firstName':_0x4a1001['body'][_0x682f('0x9c')],'phone':_0x4a1001[_0x682f('0x5c')][_0x682f('0x9c')],'ListId':_0x3f13b5[_0x682f('0x9a')]});_0xdfc5fa[_0x4a1001[_0x682f('0x5c')][_0x682f('0xce')]]=_0x4a1001[_0x682f('0x5c')][_0x682f('0x9c')];return db[_0x682f('0xaa')][_0x682f('0xd1')]({'where':_0x13e2f8,'defaults':_0xdfc5fa});}})[_0x682f('0xd2')](function(_0x5bb27e){if(_0x5bb27e){_0xc7aaeb=_0x5bb27e;var _0x2bd064=fs[_0x682f('0xd3')](path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0xd4')),_0x682f('0xd5'));var _0x2e4495=ejs['render'](_0x2bd064,{'body':_[_0x682f('0xd6')](_0x4a1001[_0x682f('0x5c')][_0x682f('0x5c')]),'bodyTitle':_0x668fbd[_0x682f('0xd7')]});return db[_0x682f('0xd8')][_0x682f('0x5b')]({'body':_0x2e4495,'plainBody':htmlToText[_0x682f('0xd9')](_0x2e4495),'ContactId':_0x5bb27e['id'],'ChatWebsiteId':_0x668fbd['id']});}})[_0x682f('0x18')](function(_0x1fd2f9){_0x30278d=_0x1fd2f9;if(_0x355be4[_0x682f('0x4a')]){var _0x398a87=_0x355be4[_0x682f('0x44')](function(_0x479a19){return{'name':_0x479a19[_0x682f('0xda')],'basename':_0x479a19[_0x682f('0x76')],'type':_0x479a19[_0x682f('0xdb')],'ChatOfflineMessageId':_0x1fd2f9['id']};});_0x412e0e=_0x398a87[_0x682f('0x44')](_0x480579=>{var _0x4d0848={'filename':_0x480579[_0x682f('0x2b')],'path':path[_0x682f('0x7d')](config[_0x682f('0x7e')],'server',_0x682f('0xc7'),_0x682f('0xdc'),_0x682f('0xdd'),_0x480579['basename'])};return _0x4d0848;});if(!_0x668fbd[_0x682f('0xde')]){return db['sequelize'][_0x682f('0xdf')](function(_0x24e84d){return db['Attachment'][_0x682f('0xe0')](_0x398a87,{'transaction':_0x24e84d});});}}})[_0x682f('0x18')](function(){if(_0x30278d){_0xf535b9=_0x30278d;return db[_0x682f('0xd0')][_0x682f('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0x682f('0xe1')],'as':_0x682f('0xe2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x682f('0xe3'),'raw':!![]}]}]});}})[_0x682f('0x18')](function(_0x3df8a1){if(_0x3df8a1&&_0x3df8a1[_0x682f('0xe2')]&&_0x668fbd['forwardOffline']&&_0x668fbd['forwardOfflineAddress']){var _0x207712=_0x3df8a1[_0x682f('0xe4')]();return respondWithRpcPromise(_0x682f('0xe5'),_0x682f('0xe6'),{'account':_0x207712,'message':{'from':util[_0x682f('0x38')]('\x22%s\x22\x20<%s>',_0x3df8a1[_0x682f('0x2b')],_0x3df8a1[_0x682f('0xe7')]||_0x3df8a1[_0x682f('0xe2')][_0x682f('0x64')]),'to':_0x668fbd[_0x682f('0xe8')],'subject':_0x668fbd['offlineMessageSubject'],'html':_0xf535b9[_0x682f('0x5c')],'attachments':_0x412e0e}},client9003)['then'](function(){return _0xf535b9;})[_0x682f('0x1d')](function(_0x285c0a){logger[_0x682f('0x1a')](_0x285c0a);});}})[_0x682f('0x18')](function(){if(_0x668fbd&&_0x668fbd[_0x682f('0xde')]&&_0x668fbd[_0x682f('0xe9')]){var _0x1bb19f=[];if(_0x355be4['length']){_0x1bb19f=_0x355be4['map'](function(_0x1cbc44){return{'name':_0x1cbc44[_0x682f('0xda')],'basename':_0x1cbc44['filename'],'type':_0x1cbc44[_0x682f('0xdb')],'ChatOfflineMessageId':_0x30278d['id']};});}var _0xdc9f50;if(!_[_0x682f('0x87')](_0x668fbd[_0x682f('0xea')])){var _0x338133=_['map'](_0x4a1001[_0x682f('0x5c')],function(_0x247fa8){return _0x247fa8;});var _0x2162ec=_[_0x682f('0xeb')](_0x338133)[0x0];var _0x3ec17f=_[_0x682f('0xec')](_0x2162ec,function(_0x4e5e2d){return _0x4e5e2d;});_0xdc9f50=_0x3ec17f[0x1][_0x668fbd['subjectOffline']];}var _0xf03c11={'from':_0xc7aaeb[_0x682f('0xe7')],'firstName':_0xc7aaeb['firstName'],'lastName':_0xc7aaeb['lastName'],'mapKey':_0x682f('0xe7'),'message':{'from':_0xc7aaeb[_0x682f('0xe7')],'to':_0x668fbd[_0x682f('0xd0')][_0x682f('0xe7')],'cc':'','subject':_[_0x682f('0x87')](_0xdc9f50)?_0x668fbd['offlineMessageSubject']:_0xdc9f50,'messageId':'','sentAt':new Date(),'attach':_0x1bb19f[_0x682f('0x4a')],'attachments':_0x1bb19f,'originChannel':_0x682f('0xed'),'ChatWebsiteId':_0x668fbd['id'],'ChatOfflineMessageId':_0xf535b9['id'],'originTo':_0x668fbd[_0x682f('0xd0')][_0x682f('0xe7')]},'body':_0xf535b9['body']};var _0x55ac14={'account':{'id':_0x668fbd[_0x682f('0xe9')]},'body':_0xf03c11,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x682f('0xee'),_0x682f('0xef'),_0x55ac14,client9001)[_0x682f('0x18')](function(){return _0xf535b9;})[_0x682f('0x1d')](function(_0x1765e2){logger['error'](_0x1765e2);});}return;})[_0x682f('0x18')](function(){if(_0xf535b9){return _0xf535b9;}})[_0x682f('0x18')](respondWithResult(_0x29f317,null))[_0x682f('0x1d')](function(){for(var _0x30f954 of _0x355be4){var _0x24ac42=path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0xf0'),_0x682f('0xc7'),_0x682f('0xdc'),_0x682f('0xdd'),_0x30f954[_0x682f('0x76')]);fs_extra[_0x682f('0xf1')](_0x24ac42)['catch'](function(_0x3fa89c){logger[_0x682f('0x1a')](_0x682f('0xf2'),_0x24ac42,_0x3fa89c);});}});};exports[_0x682f('0xf3')]=function(_0x2f5e2f,_0x311a99){return db[_0x682f('0xae')][_0x682f('0x66')]({'where':{'id':_0x2f5e2f[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x311a99,null))['then'](function(_0x12fdc5){if(_0x12fdc5){return _0x12fdc5[_0x682f('0xf3')](_0x2f5e2f[_0x682f('0x5c')][_0x682f('0x71')],_[_0x682f('0xf4')](_0x2f5e2f['body'],[_0x682f('0x71'),'id'])||{});}})[_0x682f('0x18')](respondWithResult(_0x311a99,null))[_0x682f('0x1d')](handleError(_0x311a99,null));};exports[_0x682f('0xf5')]=function(_0x12ac6c,_0x1a6cba){var _0x3bb4ea={'raw':![],'where':{}};var _0x2358ef={};var _0x23b971={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x12ac6c['params']['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x1a6cba,null))[_0x682f('0x18')](function(_0x43f2e5){if(_0x43f2e5){_0x2358ef[_0x682f('0x3d')]=_[_0x682f('0x45')](db[_0x682f('0xae')][_0x682f('0x59')]);_0x2358ef[_0x682f('0x49')]=_[_0x682f('0x45')](_0x12ac6c[_0x682f('0x49')]);_0x2358ef[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x2358ef[_0x682f('0x3d')],_0x2358ef[_0x682f('0x49')]);_0x3bb4ea[_0x682f('0x47')]=_[_0x682f('0x5a')](_0x2358ef[_0x682f('0x3d')],qs[_0x682f('0x48')](_0x12ac6c[_0x682f('0x49')][_0x682f('0x48')]));_0x3bb4ea[_0x682f('0x47')]=_0x3bb4ea['attributes'][_0x682f('0x4a')]?_0x3bb4ea[_0x682f('0x47')]:_0x2358ef['model'];if(!_0x12ac6c[_0x682f('0x49')][_0x682f('0x4b')]('nolimit')){_0x3bb4ea[_0x682f('0x22')]=qs[_0x682f('0x22')](_0x12ac6c[_0x682f('0x49')][_0x682f('0x22')]);_0x3bb4ea[_0x682f('0x21')]=qs[_0x682f('0x21')](_0x12ac6c[_0x682f('0x49')][_0x682f('0x21')]);}_0x3bb4ea[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x12ac6c[_0x682f('0x49')][_0x682f('0x4e')]);_0x3bb4ea['where']=qs['filters'](_['pick'](_0x12ac6c[_0x682f('0x49')],_0x2358ef['filters']));_0x3bb4ea[_0x682f('0x51')]['ChatWebsiteId']=_0x43f2e5['id'];if(_0x12ac6c['query'][_0x682f('0x4f')]){_0x3bb4ea[_0x682f('0x51')]=_[_0x682f('0x50')](_0x3bb4ea[_0x682f('0x51')],{'$or':_[_0x682f('0x44')](_0x3bb4ea[_0x682f('0x47')],function(_0x46b60b){var _0x4262c9={};_0x4262c9[_0x46b60b]={'$like':'%'+_0x12ac6c[_0x682f('0x49')][_0x682f('0x4f')]+'%'};return _0x4262c9;})});}_0x3bb4ea=_[_0x682f('0x50')]({},_0x3bb4ea,_0x12ac6c[_0x682f('0x53')]);return db['ChatInteraction'][_0x682f('0x23')]({'where':_0x3bb4ea[_0x682f('0x51')]})[_0x682f('0x18')](function(_0x3578aa){_0x23b971[_0x682f('0x23')]=_0x3578aa;if(_0x12ac6c[_0x682f('0x49')][_0x682f('0x54')]){_0x3bb4ea['include']=[{'model':db[_0x682f('0xaa')],'as':'Contact','required':![]},{'model':db[_0x682f('0xb9')],'as':_0x682f('0xf6'),'attributes':['name',_0x682f('0xf7'),_0x682f('0xf8')],'required':![]},{'model':db[_0x682f('0xf9')],'as':_0x682f('0xfa'),'attributes':['id','name',_0x682f('0xfb')],'where':_0x12ac6c[_0x682f('0x49')][_0x682f('0xfc')]?{'id':_0x12ac6c['query'][_0x682f('0xfc')]}:undefined,'required':_0x12ac6c[_0x682f('0x49')][_0x682f('0xfc')]?!![]:![]}];}return db[_0x682f('0xae')][_0x682f('0x56')](_0x3bb4ea);})[_0x682f('0x18')](function(_0x122a7c){_0x23b971[_0x682f('0x57')]=_0x122a7c;return _0x23b971;});}})[_0x682f('0x18')](respondWithFilteredResult(_0x1a6cba,_0x3bb4ea))[_0x682f('0x1d')](handleError(_0x1a6cba,null));};exports[_0x682f('0xfd')]=function(_0x2adf46,_0x2ddbb0){var _0x342ec0=0x0;var _0x162e17=0x0;var _0x225e6c=![];var _0x164193;var _0x49ae97;return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x2adf46['params']['id']},'include':[{'model':db[_0x682f('0x8c')],'as':_0x682f('0x8c'),'include':[{'model':db[_0x682f('0x8c')],'as':'Intervals','attributes':['id',_0x682f('0xa3')]}]}]})['then'](handleEntityNotFound(_0x2ddbb0,null))['then'](function(_0x4bf470){if(_0x4bf470){_0x164193=_0x4bf470;return _0x4bf470[_0x682f('0xfe')]({'raw':!![]});}})[_0x682f('0x18')](function(_0x29206d){if(_0x164193){if(_0x29206d){_0x49ae97=_0x29206d;}}return require(_0x682f('0x7f'))[_0x682f('0xff')]();})[_0x682f('0x18')](function(_0x4e2c90){if(_0x4e2c90){_0x162e17=_0x4e2c90[_0x682f('0x100')];_0x225e6c=_0x4e2c90[_0x682f('0x80')];}})[_0x682f('0x18')](function(){return db[_0x682f('0xae')]['count']({'where':{'closed':![]}});})['then'](function(_0x214839){_0x342ec0=_0x214839;if(_0x162e17&&_0x214839>_0x162e17){return db[_0x682f('0x101')]['findOne']({'where':{'id':0x1}})[_0x682f('0x18')](function(_0x11e476){if(_0x11e476){_0x11e476['increment'](_0x682f('0x102'));}});}})['then'](function(){var _0x1f8485=_0x164193[_0x682f('0x8c')];var _0x572cc0=_0x164193[_0x682f('0x103')]||undefined;return _0x1f8485?_0x1f8485[_0x682f('0x104')](_0x572cc0):!![];})[_0x682f('0x18')](function(_0x27f045){var _0x14968f=fs[_0x682f('0xd3')](path[_0x682f('0x7d')](config[_0x682f('0x7e')],_0x682f('0x105')),_0x682f('0xd5'));var _0x40a3a2=_0x682f('0x106');var _0x507513=![];var _0x4eb026,_0x2aaefb;if(_0x2adf46[_0x682f('0xac')][_0x682f('0x94')]){_0x4eb026=new URL(_0x2adf46[_0x682f('0xac')][_0x682f('0x94')])['origin'];}else if(_0x2adf46[_0x682f('0xac')]['origin']){_0x4eb026=new URL(_0x2adf46[_0x682f('0xac')][_0x682f('0x107')])[_0x682f('0x107')];}else{_0x4eb026=_0x682f('0x108');}_0x2aaefb=typeof _0x164193[_0x682f('0x5d')][_0x682f('0x33')](',')[_0x682f('0x66')](function(_0x2d2569){return wildcardUtils[_0x682f('0x109')](_0x2d2569,_0x4eb026);})!=='undefined';var _0x56de6d={'chatVersion':_0x40a3a2,'chatWebsiteAddressOrigin':_0x2aaefb?_0x4eb026:_0x164193[_0x682f('0x5d')],'remote':_0x164193[_0x682f('0x10a')],'query':querystring[_0x682f('0x3f')](_[_0x682f('0x50')](_0x164193[_0x682f('0x61')]({'plain':!![]}),{'customerIp':_0x2adf46[_0x682f('0xac')]['x-forwarded-for']||_0x2adf46[_0x682f('0xac')][_0x682f('0x10b')]||_0x2adf46[_0x682f('0x10c')]['remoteAddress']||_0x2adf46['ip'],'referer':_0x2adf46['headers']['referer'],'openedInteractions':_0x342ec0,'maxInteractions':_0x162e17,'virtual':_0x225e6c[_0x682f('0x100')],'online':_0x27f045,'custom':_0x225e6c,'address':_0x2aaefb?_0x4eb026:null}))[_0x682f('0x10d')](/'/g,'\x5c\x27')};_0x2ddbb0[_0x682f('0xcb')](ejs['render'](Mustache[_0x682f('0x10e')](_0x14968f,_0x56de6d),{'proactiveActions':_0x49ae97,'alignment':_0x164193[_0x682f('0x10f')],'verticalAlignment':_0x164193['verticalAlignment'],'div_color':_0x164193[_0x682f('0xfb')],'labelText':_0x164193[_0x682f('0x110')],'text_color':_0x164193['textColor'],'text_button_color':_0x164193[_0x682f('0x111')],'button_color':_0x164193[_0x682f('0x112')],'background_color':_0x164193[_0x682f('0x113')],'hideWhenOffline':_0x164193[_0x682f('0x114')],'intervalId':_0x164193['IntervalId'],'isDevelopment':_0x507513,'chatVersion':_0x40a3a2}));})[_0x682f('0x1d')](handleError(_0x2ddbb0,null));};exports['addApplications']=function(_0x1b9bac,_0x25f766){var _0x536de2=_0x1b9bac['params']['id'];var _0x132661=_0x1b9bac['body'];var _0x33e279=0xc8;var _0x2ece48=null;return db[_0x682f('0x115')][_0x682f('0xdf')]({'isolationLevel':db[_0x682f('0x115')][_0x682f('0x116')][_0x682f('0x117')][_0x682f('0x118')]},function(_0x4b2ac7){return db[_0x682f('0x42')][_0x682f('0x6d')]({'where':{'id':_0x536de2},'transaction':_0x4b2ac7})[_0x682f('0x18')](function(_0x6d7f0){if(_0x6d7f0){return db['ChatApplication'][_0x682f('0x27')]({'where':{'ChatWebsiteId':_0x536de2},'transaction':_0x4b2ac7})['then'](function(){var _0x8bc72b=_['map'](_0x132661,function(_0x2e6062){_0x2e6062[_0x682f('0x6b')]=_0x536de2;return _0x2e6062;});return db[_0x682f('0x119')][_0x682f('0xe0')](_0x8bc72b,{'transaction':_0x4b2ac7});});}else{_0x33e279=0x194;_0x2ece48=[];}});})['then'](function(){if(_0x33e279!==0x194){return db[_0x682f('0x119')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x536de2},'order':_0x682f('0x11a')})[_0x682f('0x18')](function(_0x15b839){_0x2ece48=_0x15b839;});}})[_0x682f('0x1d')](function(_0x2bccdf){_0x33e279=0x1f4;logger['error'](_0x2bccdf[_0x682f('0x2a')]);if(_0x2bccdf[_0x682f('0x2b')]){delete _0x2bccdf[_0x682f('0x2b')];}_0x2ece48=_0x2bccdf;})['finally'](function(){if(_0x2ece48===null){_0x25f766['sendStatus'](_0x33e279);}else{if(_0x33e279===0x1f4){_0x25f766['status'](_0x33e279)[_0x682f('0xcb')](_0x2ece48);}else{_0x25f766['status'](_0x33e279)[_0x682f('0x20')](_0x2ece48);}}});};exports[_0x682f('0x11b')]=function(_0x2682ed,_0x212311){var _0x73543f={};var _0x1b084a={};var _0x247af7;var _0x2135ef;return db[_0x682f('0x42')][_0x682f('0x6d')]({'where':{'id':_0x2682ed[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x212311,null))['then'](function(_0x4e1468){if(_0x4e1468){_0x247af7=_0x4e1468;_0x1b084a[_0x682f('0x3d')]=_[_0x682f('0x45')](db[_0x682f('0x119')]['rawAttributes']);_0x1b084a[_0x682f('0x49')]=_[_0x682f('0x45')](_0x2682ed[_0x682f('0x49')]);_0x1b084a[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x1b084a[_0x682f('0x3d')],_0x1b084a[_0x682f('0x49')]);_0x73543f[_0x682f('0x47')]=_[_0x682f('0x5a')](_0x1b084a[_0x682f('0x3d')],qs['fields'](_0x2682ed[_0x682f('0x49')][_0x682f('0x48')]));_0x73543f[_0x682f('0x47')]=_0x73543f['attributes']['length']?_0x73543f[_0x682f('0x47')]:_0x1b084a[_0x682f('0x3d')];_0x73543f[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x2682ed['query'][_0x682f('0x4e')]);_0x73543f[_0x682f('0x51')]=qs[_0x682f('0x46')](_['pick'](_0x2682ed[_0x682f('0x49')],_0x1b084a['filters']));if(_0x2682ed[_0x682f('0x49')][_0x682f('0x4f')]){_0x73543f['where']=_[_0x682f('0x50')](_0x73543f['where'],{'$or':_[_0x682f('0x44')](_0x73543f[_0x682f('0x47')],function(_0x276939){var _0x946d6b={};_0x946d6b[_0x276939]={'$like':'%'+_0x2682ed[_0x682f('0x49')]['filter']+'%'};return _0x946d6b;})});}_0x73543f=_[_0x682f('0x50')]({},_0x73543f,_0x2682ed['options']);return _0x247af7[_0x682f('0x11b')](_0x73543f);}})[_0x682f('0x18')](function(_0x4f6475){if(_0x4f6475){_0x2135ef=_0x4f6475[_0x682f('0x4a')];if(!_0x2682ed[_0x682f('0x49')]['hasOwnProperty']('nolimit')){_0x73543f[_0x682f('0x22')]=qs[_0x682f('0x22')](_0x2682ed[_0x682f('0x49')][_0x682f('0x22')]);_0x73543f[_0x682f('0x21')]=qs[_0x682f('0x21')](_0x2682ed[_0x682f('0x49')][_0x682f('0x21')]);}return _0x247af7[_0x682f('0x11b')](_0x73543f);}})[_0x682f('0x18')](function(_0x416999){if(_0x416999){return _0x416999?{'count':_0x2135ef,'rows':_0x416999}:null;}})[_0x682f('0x18')](respondWithResult(_0x212311,null))[_0x682f('0x1d')](handleError(_0x212311,null));};exports[_0x682f('0x11c')]=function(_0x1607de,_0x12d2d6){return db[_0x682f('0x11d')]['find']({'where':{'id':_0x1607de['params']['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x12d2d6,null))[_0x682f('0x18')](function(_0x287114){if(_0x287114){return _0x287114[_0x682f('0x11c')](_0x1607de['body']['ids'],_[_0x682f('0xf4')](_0x1607de['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x12d2d6,null))['catch'](handleError(_0x12d2d6,null));};exports[_0x682f('0xfe')]=function(_0x639f31,_0xecf276){var _0xf9b153={};var _0x1b4eb7={};var _0x49f21a;var _0x1031f2;return db['ChatWebsite'][_0x682f('0x6d')]({'where':{'id':_0x639f31['params']['id']}})[_0x682f('0x18')](handleEntityNotFound(_0xecf276,null))[_0x682f('0x18')](function(_0x499793){if(_0x499793){_0x49f21a=_0x499793;_0x1b4eb7[_0x682f('0x3d')]=_['keys'](db[_0x682f('0x11e')]['rawAttributes']);_0x1b4eb7[_0x682f('0x49')]=_['keys'](_0x639f31['query']);_0x1b4eb7[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x1b4eb7[_0x682f('0x3d')],_0x1b4eb7['query']);_0xf9b153[_0x682f('0x47')]=_[_0x682f('0x5a')](_0x1b4eb7[_0x682f('0x3d')],qs[_0x682f('0x48')](_0x639f31[_0x682f('0x49')][_0x682f('0x48')]));_0xf9b153[_0x682f('0x47')]=_0xf9b153[_0x682f('0x47')][_0x682f('0x4a')]?_0xf9b153[_0x682f('0x47')]:_0x1b4eb7[_0x682f('0x3d')];_0xf9b153[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x639f31[_0x682f('0x49')][_0x682f('0x4e')]);_0xf9b153['where']=qs[_0x682f('0x46')](_[_0x682f('0x6f')](_0x639f31['query'],_0x1b4eb7['filters']));if(_0x639f31[_0x682f('0x49')][_0x682f('0x4f')]){_0xf9b153[_0x682f('0x51')]=_[_0x682f('0x50')](_0xf9b153['where'],{'$or':_['map'](_0xf9b153[_0x682f('0x47')],function(_0x321569){var _0x41fadf={};_0x41fadf[_0x321569]={'$like':'%'+_0x639f31[_0x682f('0x49')][_0x682f('0x4f')]+'%'};return _0x41fadf;})});}_0xf9b153=_[_0x682f('0x50')]({},_0xf9b153,_0x639f31[_0x682f('0x53')]);return _0x49f21a[_0x682f('0xfe')](_0xf9b153);}})['then'](function(_0x2ac0f5){if(_0x2ac0f5){_0x1031f2=_0x2ac0f5[_0x682f('0x4a')];if(!_0x639f31[_0x682f('0x49')][_0x682f('0x4b')](_0x682f('0x4c'))){_0xf9b153[_0x682f('0x22')]=qs[_0x682f('0x22')](_0x639f31['query']['limit']);_0xf9b153[_0x682f('0x21')]=qs[_0x682f('0x21')](_0x639f31[_0x682f('0x49')][_0x682f('0x21')]);}return _0x49f21a['getProactiveActions'](_0xf9b153);}})['then'](function(_0x4e852d){if(_0x4e852d){return _0x4e852d?{'count':_0x1031f2,'rows':_0x4e852d}:null;}})[_0x682f('0x18')](respondWithResult(_0xecf276,null))[_0x682f('0x1d')](handleError(_0xecf276,null));};exports[_0x682f('0x11f')]=function(_0x44f105,_0x2e9be6){var _0x56f51c=_0x44f105[_0x682f('0x49')][_0x682f('0x120')]==='false'?'offlineForm':'onlineForm';return db[_0x682f('0x42')][_0x682f('0x66')]({'attributes':['id',_0x56f51c],'where':{'id':_0x44f105[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x2e9be6,null))[_0x682f('0x18')](function(_0x11a478){if(_0x11a478){var _0x54e2f0=_0x11a478[_0x56f51c];var _0x5a3c33=_0x54e2f0&&_0x54e2f0[_0x682f('0x121')]?_0x54e2f0[_0x682f('0x121')]:[];_0x2e9be6[_0x682f('0xcb')]({'fromKey':_[_0x682f('0x87')](_0x54e2f0[_0x682f('0x122')])?undefined:_0x54e2f0['fromKey'],'count':_0x5a3c33[_0x682f('0x4a')],'rows':_0x5a3c33});}})[_0x682f('0x1d')](handleError(_0x2e9be6,null));};exports[_0x682f('0x123')]=function(_0x444f6a,_0x5ba6e8){var _0x50e130={'raw':![],'where':{}};var _0x13a4da={};var _0x646914={'count':0x0,'rows':[]};return db[_0x682f('0x42')][_0x682f('0x6d')]({'where':{'id':_0x444f6a[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x5ba6e8,null))[_0x682f('0x18')](function(_0x4e9920){if(_0x4e9920){_0x13a4da[_0x682f('0x3d')]=_[_0x682f('0x45')](db['ChatOfflineMessage'][_0x682f('0x59')]);_0x13a4da[_0x682f('0x49')]=_['keys'](_0x444f6a[_0x682f('0x49')]);_0x13a4da[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x13a4da[_0x682f('0x3d')],_0x13a4da['query']);_0x50e130['attributes']=_[_0x682f('0x5a')](_0x13a4da[_0x682f('0x3d')],qs[_0x682f('0x48')](_0x444f6a[_0x682f('0x49')][_0x682f('0x48')]));_0x50e130[_0x682f('0x47')]=_0x50e130[_0x682f('0x47')][_0x682f('0x4a')]?_0x50e130[_0x682f('0x47')]:_0x13a4da[_0x682f('0x3d')];if(!_0x444f6a['query'][_0x682f('0x4b')](_0x682f('0x4c'))){_0x50e130['limit']=qs[_0x682f('0x22')](_0x444f6a[_0x682f('0x49')][_0x682f('0x22')]);_0x50e130['offset']=qs[_0x682f('0x21')](_0x444f6a[_0x682f('0x49')]['offset']);}_0x50e130[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x444f6a[_0x682f('0x49')][_0x682f('0x4e')]);_0x50e130[_0x682f('0x51')]=qs[_0x682f('0x46')](_[_0x682f('0x6f')](_0x444f6a[_0x682f('0x49')],_0x13a4da[_0x682f('0x46')]));_0x50e130[_0x682f('0x51')][_0x682f('0x6b')]=_0x4e9920['id'];if(_0x444f6a[_0x682f('0x49')][_0x682f('0x4f')]){_0x50e130[_0x682f('0x51')]=_[_0x682f('0x50')](_0x50e130['where'],{'$or':_['map'](_0x50e130[_0x682f('0x47')],function(_0xe046f4){var _0x567810={};_0x567810[_0xe046f4]={'$like':'%'+_0x444f6a[_0x682f('0x49')][_0x682f('0x4f')]+'%'};return _0x567810;})});}_0x50e130=_[_0x682f('0x50')]({},_0x50e130,_0x444f6a[_0x682f('0x53')]);return db[_0x682f('0xd8')]['count']({'where':_0x50e130[_0x682f('0x51')]})[_0x682f('0x18')](function(_0x46bf75){_0x646914[_0x682f('0x23')]=_0x46bf75;if(_0x444f6a[_0x682f('0x49')]['includeAll']){_0x50e130[_0x682f('0x55')]=[{'all':!![]}];}else{_0x50e130[_0x682f('0x55')]=[{'model':db[_0x682f('0xaa')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x682f('0xd8')][_0x682f('0x56')](_0x50e130);})[_0x682f('0x18')](function(_0x19dbb0){_0x646914[_0x682f('0x57')]=_0x19dbb0;return _0x646914;});}})['then'](respondWithFilteredResult(_0x5ba6e8,_0x50e130))['catch'](handleError(_0x5ba6e8,null));};exports[_0x682f('0x124')]=function(_0x509472,_0x14d2b1){return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x509472[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x14d2b1,null))['then'](function(_0x43f276){if(_0x43f276){return _0x43f276[_0x682f('0x124')](_0x509472[_0x682f('0x5c')][_0x682f('0x71')],_['omit'](_0x509472['body'],['ids','id'])||{})[_0x682f('0xd2')](function(_0x9210f0){for(var _0x1fa9ca=0x0;_0x1fa9ca<_0x509472[_0x682f('0x5c')]['ids'][_0x682f('0x4a')];_0x1fa9ca+=0x1){socket[_0x682f('0x125')](_0x682f('0x126'),{'UserId':Number(_0x509472['body'][_0x682f('0x71')][_0x1fa9ca]),'ChatWebsiteId':Number(_0x509472['params']['id'])});}return _0x9210f0;});}})['then'](respondWithResult(_0x14d2b1,null))[_0x682f('0x1d')](handleError(_0x14d2b1,null));};exports[_0x682f('0x127')]=function(_0x2887ee,_0x205f5d){return db[_0x682f('0x42')][_0x682f('0x66')]({'where':{'id':_0x2887ee[_0x682f('0x58')]['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x205f5d,null))[_0x682f('0x18')](function(_0x15a485){if(_0x15a485){return _0x15a485[_0x682f('0x127')](_0x2887ee[_0x682f('0x49')]['ids'])[_0x682f('0x18')](function(){if(_[_0x682f('0x128')](_0x2887ee[_0x682f('0x49')][_0x682f('0x71')])){for(var _0x268d41=0x0;_0x268d41<_0x2887ee[_0x682f('0x49')][_0x682f('0x71')]['length'];_0x268d41+=0x1){socket[_0x682f('0x125')](_0x682f('0x129'),{'UserId':Number(_0x2887ee[_0x682f('0x49')][_0x682f('0x71')][_0x268d41]),'ChatWebsiteId':Number(_0x2887ee[_0x682f('0x58')]['id'])});}}else{socket[_0x682f('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x2887ee[_0x682f('0x49')][_0x682f('0x71')]),'ChatWebsiteId':Number(_0x2887ee[_0x682f('0x58')]['id'])});}});}})[_0x682f('0x18')](respondWithStatusCode(_0x205f5d,null))[_0x682f('0x1d')](handleError(_0x205f5d,null));};exports[_0x682f('0x12a')]=function(_0x1cab99,_0x40d337){var _0x5b3429={};var _0x5d1d0c={};var _0x251151;var _0x4f9081;return db['ChatWebsite'][_0x682f('0x6d')]({'where':{'id':_0x1cab99['params']['id']}})[_0x682f('0x18')](handleEntityNotFound(_0x40d337,null))['then'](function(_0x1be946){if(_0x1be946){_0x251151=_0x1be946;_0x5d1d0c['model']=_[_0x682f('0x45')](db['User']['rawAttributes']);_0x5d1d0c['query']=_[_0x682f('0x45')](_0x1cab99[_0x682f('0x49')]);_0x5d1d0c[_0x682f('0x46')]=_[_0x682f('0x5a')](_0x5d1d0c[_0x682f('0x3d')],_0x5d1d0c[_0x682f('0x49')]);_0x5b3429[_0x682f('0x47')]=_['intersection'](_0x5d1d0c['model'],qs[_0x682f('0x48')](_0x1cab99[_0x682f('0x49')][_0x682f('0x48')]));_0x5b3429[_0x682f('0x47')]=_0x5b3429[_0x682f('0x47')][_0x682f('0x4a')]?_0x5b3429[_0x682f('0x47')]:_0x5d1d0c[_0x682f('0x3d')];_0x5b3429[_0x682f('0x4d')]=qs[_0x682f('0x4e')](_0x1cab99[_0x682f('0x49')][_0x682f('0x4e')]);_0x5b3429[_0x682f('0x51')]=qs[_0x682f('0x46')](_[_0x682f('0x6f')](_0x1cab99['query'],_0x5d1d0c[_0x682f('0x46')]));if(_0x1cab99[_0x682f('0x49')]['filter']){_0x5b3429[_0x682f('0x51')]=_[_0x682f('0x50')](_0x5b3429['where'],{'$or':_[_0x682f('0x44')](_0x5b3429[_0x682f('0x47')],function(_0x1550ed){var _0x47052e={};_0x47052e[_0x1550ed]={'$like':'%'+_0x1cab99[_0x682f('0x49')][_0x682f('0x4f')]+'%'};return _0x47052e;})});}_0x5b3429=_[_0x682f('0x50')]({},_0x5b3429,_0x1cab99[_0x682f('0x53')]);return _0x251151['getAgents'](_0x5b3429);}})[_0x682f('0x18')](function(_0x406785){if(_0x406785){_0x4f9081=_0x406785[_0x682f('0x4a')];if(!_0x1cab99[_0x682f('0x49')][_0x682f('0x4b')]('nolimit')){_0x5b3429['limit']=qs[_0x682f('0x22')](_0x1cab99[_0x682f('0x49')]['limit']);_0x5b3429[_0x682f('0x21')]=qs[_0x682f('0x21')](_0x1cab99[_0x682f('0x49')][_0x682f('0x21')]);}return _0x251151[_0x682f('0x12a')](_0x5b3429);}})['then'](function(_0x3c5ebc){if(_0x3c5ebc){return _0x3c5ebc?{'count':_0x4f9081,'rows':_0x3c5ebc}:null;}})[_0x682f('0x18')](respondWithResult(_0x40d337,null))['catch'](handleError(_0x40d337,null));}; \ No newline at end of file +var _0x398b=['transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','firstName','Chat','NotifyMailAccount','notifyMail','server','remove','addInteraction','ids','omit','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','interval','getProactiveActions','virtual','License','increment','timezone','readFileSync','server/files/chat/iframe.ejs','3.9.0','origin','http://localhost:9000','undefined','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','color','textColor','color_button','hideWhenOffline','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','spread','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','ChatWebsites','stack','name','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','unknown','format','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','mandatoryDispositionPause','ChatWebsite','length','options','find','create','body','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','address','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','root','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','resolve','ifTime','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','attachments','offline-chat','basename','openNewInteraction'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x398b,0x188));var _0xb398=function(_0x22d19d,_0x379051){_0x22d19d=_0x22d19d-0x0;var _0x103fc2=_0x398b[_0x22d19d];return _0x103fc2;};'use strict';var Mustache=require(_0xb398('0x0'));var util=require(_0xb398('0x1'));var path=require(_0xb398('0x2'));var ejs=require(_0xb398('0x3'));var fs=require('fs');var fs_extra=require(_0xb398('0x4'));var _=require(_0xb398('0x5'));var querystring=require('querystring');var htmlToText=require(_0xb398('0x6'));var Redis=require(_0xb398('0x7'));var jayson=require('jayson/promise');var qs=require(_0xb398('0x8'));var logger=require(_0xb398('0x9'))('api');var config=require('../../config/environment');var APIBadRequestError=require(_0xb398('0xa'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xb398('0xb')];var APIOutOfIntervalError=require(_0xb398('0xa'))[_0xb398('0xc')];var APIHandleError=require(_0xb398('0xa'))[_0xb398('0xd')];var APIConflictError=require(_0xb398('0xa'))['APIConflictError'];var wildcardUtils=require(_0xb398('0xe'));var URL=require(_0xb398('0xf'))['URL'];var db=require(_0xb398('0x10'))['db'];config[_0xb398('0x11')]=_[_0xb398('0x12')](config[_0xb398('0x11')],{'host':_0xb398('0x13'),'port':0x18eb});var socket=require(_0xb398('0x14'))(new Redis(config[_0xb398('0x11')]));require(_0xb398('0x15'))[_0xb398('0x16')](socket);var client=jayson[_0xb398('0x17')][_0xb398('0x18')]({'port':0x232c});var client9002=jayson[_0xb398('0x17')]['http']({'port':0x232a});var client9003=jayson[_0xb398('0x17')][_0xb398('0x18')]({'port':0x232b});var client9001=jayson['client'][_0xb398('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x56942e,_0x3eda3a,_0x82fc5,_0x416f11){return new Promise(function(_0x36f175,_0x542f95){var _0x26947b=_0x416f11||client;return _0x26947b[_0xb398('0x19')](_0x56942e,_0x82fc5)[_0xb398('0x1a')](function(_0x10976f){logger[_0xb398('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x3eda3a,_0xb398('0x1c'));logger[_0xb398('0x1d')](_0xb398('0x1e'),_0x3eda3a,_0xb398('0x1c'),JSON['stringify'](_0x10976f));if(_0x10976f[_0xb398('0x1f')]){if(_0x10976f['error'][_0xb398('0x20')]===0x1f4){logger[_0xb398('0x1f')](_0xb398('0x21'),_0x3eda3a,_0x10976f[_0xb398('0x1f')][_0xb398('0x22')]);return _0x542f95(_0x10976f[_0xb398('0x1f')][_0xb398('0x22')]);}logger[_0xb398('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x3eda3a,_0x10976f[_0xb398('0x1f')][_0xb398('0x22')]);return _0x36f175(_0x10976f[_0xb398('0x1f')][_0xb398('0x22')]);}else{logger[_0xb398('0x1b')](_0xb398('0x21'),_0x3eda3a,_0xb398('0x1c'));_0x36f175(_0x10976f[_0xb398('0x23')]['message']);}})['catch'](function(_0x965ba7){logger[_0xb398('0x1f')](_0xb398('0x21'),_0x3eda3a,_0x965ba7);_0x542f95(_0x965ba7);});});}function respondWithStatusCode(_0x4e8d77,_0x3f8409){_0x3f8409=_0x3f8409||0xcc;return function(_0x36a6c4){if(_0x36a6c4){return _0x4e8d77[_0xb398('0x24')](_0x3f8409);}return _0x4e8d77[_0xb398('0x25')](_0x3f8409)[_0xb398('0x26')]();};}function respondWithResult(_0x374809,_0x11c7de){_0x11c7de=_0x11c7de||0xc8;return function(_0x5b715b){if(_0x5b715b){return _0x374809[_0xb398('0x25')](_0x11c7de)[_0xb398('0x27')](_0x5b715b);}};}function respondWithFilteredResult(_0x10c1e6,_0x593108){return function(_0x4e186f){if(_0x4e186f){var _0x40e7bf=typeof _0x593108[_0xb398('0x28')]==='undefined'&&typeof _0x593108[_0xb398('0x29')]==='undefined';var _0x40f0b1=_0x4e186f[_0xb398('0x2a')];var _0x2b6897=_0x40e7bf?0x0:_0x593108['offset'];var _0xca52a5=_0x40e7bf?_0x4e186f[_0xb398('0x2a')]:_0x593108[_0xb398('0x28')]+_0x593108[_0xb398('0x29')];var _0x2762ff;if(_0xca52a5>=_0x40f0b1){_0xca52a5=_0x40f0b1;_0x2762ff=0xc8;}else{_0x2762ff=0xce;}_0x10c1e6[_0xb398('0x25')](_0x2762ff);return _0x10c1e6[_0xb398('0x2b')](_0xb398('0x2c'),_0x2b6897+'-'+_0xca52a5+'/'+_0x40f0b1)['json'](_0x4e186f);}return null;};}function saveUpdates(_0x59f764){return function(_0x27f43c){if(_0x27f43c){return _0x27f43c[_0xb398('0x2d')](_0x59f764)[_0xb398('0x1a')](function(_0x2d22eb){return _0x2d22eb;});}return null;};}function removeEntity(_0x14a4ce){return function(_0x2c8bc3){if(_0x2c8bc3){return _0x2c8bc3['destroy']()[_0xb398('0x1a')](function(){var _0x115f57=_0x2c8bc3['get']({'plain':!![]});var _0x450b42=_0xb398('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x450b42,'resourceId':_0x115f57['id']}})[_0xb398('0x1a')](function(){return _0x2c8bc3;});})[_0xb398('0x1a')](function(){_0x14a4ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc0706){return function(_0x44997a){if(!_0x44997a){_0xfc0706[_0xb398('0x24')](0x194);}return _0x44997a;};}function handleError(_0x121cdb,_0x5b9925){_0x5b9925=_0x5b9925||0x1f4;return function(_0x499c94){logger['error'](_0x499c94[_0xb398('0x2f')]);if(_0x499c94[_0xb398('0x30')]){delete _0x499c94[_0xb398('0x30')];}_0x121cdb[_0xb398('0x25')](_0x5b9925)[_0xb398('0x31')](_0x499c94);};}function createInteractionObject(_0x185553,_0x37d5b6,_0x115660,_0x5acc28){var _0xe51cad=require(_0xb398('0x32'));var _0x57cdce=new _0xe51cad();var _0x18a4a4=_0x57cdce[_0xb398('0x33')](_0x115660[_0xb398('0x34')])[_0xb398('0x35')]();var _0x2ad02d=_0x37d5b6[_0xb398('0x36')];if(_0x115660[_0xb398('0x37')]){_0x2ad02d=_0x115660[_0xb398('0x37')];}else if(_0x115660[_0xb398('0x38')]){_0x2ad02d=_[_0xb398('0x39')](_0x115660[_0xb398('0x38')][_0xb398('0x3a')](','));}return{'ContactId':_0x5acc28['id'],'ChatWebsiteId':_0x185553,'from':(_0x5acc28['firstName']||'')+'\x20'+(_0x5acc28[_0xb398('0x3b')]||''),'customerIp':_0x2ad02d,'customerPort':_0x115660[_0xb398('0x3c')]?_0x115660['x-real-port']:null,'referer':_0x37d5b6['referer'],'browserName':_0x18a4a4['browser'][_0xb398('0x30')]&&_0x18a4a4[_0xb398('0x3d')][_0xb398('0x3e')]?util['format']('%s\x20%s',_0x18a4a4[_0xb398('0x3d')][_0xb398('0x30')],_0x18a4a4[_0xb398('0x3d')][_0xb398('0x3e')]):_0xb398('0x3f'),'browserVersion':_0x18a4a4[_0xb398('0x3d')][_0xb398('0x3e')]||_0xb398('0x3f'),'osName':util[_0xb398('0x40')]('%s\x20%s',_0x18a4a4['os']['name'],_0x18a4a4['os'][_0xb398('0x3e')]),'osVersion':_0x18a4a4['os'][_0xb398('0x3e')],'deviceModel':_0x18a4a4[_0xb398('0x41')][_0xb398('0x42')]&&_0x18a4a4['device'][_0xb398('0x43')]?util[_0xb398('0x40')](_0xb398('0x44'),_0x18a4a4['device'][_0xb398('0x42')],_0x18a4a4['device'][_0xb398('0x43')],_0x18a4a4[_0xb398('0x41')][_0xb398('0x45')]):null,'deviceVendor':_0x18a4a4[_0xb398('0x41')][_0xb398('0x43')],'deviceType':_0x18a4a4[_0xb398('0x41')][_0xb398('0x45')],'formData':JSON[_0xb398('0x46')](_0x37d5b6)};}exports[_0xb398('0x47')]=function(_0x42bc4b,_0x531af1){var _0x2227f4={'include':[{'model':db[_0xb398('0x48')],'as':'mandatoryDispositionPause'}]},_0x2d5d04={},_0x10cd9f={'count':0x0,'rows':[]};var _0x131b96=_['map'](db['ChatWebsite'][_0xb398('0x49')],function(_0x16134a){return{'name':_0x16134a[_0xb398('0x4a')],'type':_0x16134a[_0xb398('0x45')][_0xb398('0x4b')]};});_0x2d5d04[_0xb398('0x42')]=_[_0xb398('0x4c')](_0x131b96,_0xb398('0x30'));_0x2d5d04[_0xb398('0x4d')]=_[_0xb398('0x4e')](_0x42bc4b[_0xb398('0x4d')]);_0x2d5d04[_0xb398('0x4f')]=_[_0xb398('0x50')](_0x2d5d04[_0xb398('0x42')],_0x2d5d04[_0xb398('0x4d')]);_0x2227f4[_0xb398('0x51')]=_[_0xb398('0x50')](_0x2d5d04[_0xb398('0x42')],qs[_0xb398('0x52')](_0x42bc4b[_0xb398('0x4d')][_0xb398('0x52')]));_0x2227f4[_0xb398('0x51')]=_0x2227f4[_0xb398('0x51')]['length']?_0x2227f4[_0xb398('0x51')]:_0x2d5d04['model'];if(!_0x42bc4b[_0xb398('0x4d')]['hasOwnProperty']('nolimit')){_0x2227f4[_0xb398('0x29')]=qs['limit'](_0x42bc4b[_0xb398('0x4d')][_0xb398('0x29')]);_0x2227f4[_0xb398('0x28')]=qs[_0xb398('0x28')](_0x42bc4b['query'][_0xb398('0x28')]);}_0x2227f4[_0xb398('0x53')]=qs[_0xb398('0x54')](_0x42bc4b['query'][_0xb398('0x54')]);_0x2227f4[_0xb398('0x55')]=qs['filters'](_[_0xb398('0x56')](_0x42bc4b[_0xb398('0x4d')],_0x2d5d04[_0xb398('0x4f')]),_0x131b96);if(_0x42bc4b[_0xb398('0x4d')]['filter']){_0x2227f4[_0xb398('0x55')]=_[_0xb398('0x57')](_0x2227f4[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0x131b96,function(_0x44d522){if(_0x44d522['type']!==_0xb398('0x58')){var _0xf26d15={};_0xf26d15[_0x44d522['name']]={'$like':'%'+_0x42bc4b[_0xb398('0x4d')][_0xb398('0x59')]+'%'};return _0xf26d15;}})});}_0x2227f4=_['merge']({},_0x2227f4,_0x42bc4b['options']);var _0x25e496={'where':_0x2227f4[_0xb398('0x55')]};return db['ChatWebsite']['count'](_0x25e496)[_0xb398('0x1a')](function(_0x202435){_0x10cd9f[_0xb398('0x2a')]=_0x202435;if(_0x42bc4b[_0xb398('0x4d')][_0xb398('0x5a')]){_0x2227f4[_0xb398('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0xb398('0x5c')](_0x2227f4);})[_0xb398('0x1a')](function(_0xe520cd){_0x10cd9f['rows']=_0xe520cd;return _0x10cd9f;})['then'](respondWithFilteredResult(_0x531af1,_0x2227f4))[_0xb398('0x5d')](handleError(_0x531af1,null));};exports[_0xb398('0x5e')]=function(_0x3c3476,_0x3bd328){var _0x16cd3b={'raw':![],'where':{'id':_0x3c3476['params']['id']},'include':[{'model':db['Pause'],'as':_0xb398('0x5f')}]},_0x10af75={};_0x10af75['model']=_['keys'](db[_0xb398('0x60')][_0xb398('0x49')]);_0x10af75[_0xb398('0x4d')]=_[_0xb398('0x4e')](_0x3c3476[_0xb398('0x4d')]);_0x10af75[_0xb398('0x4f')]=_['intersection'](_0x10af75['model'],_0x10af75[_0xb398('0x4d')]);_0x16cd3b[_0xb398('0x51')]=_[_0xb398('0x50')](_0x10af75['model'],qs[_0xb398('0x52')](_0x3c3476[_0xb398('0x4d')][_0xb398('0x52')]));_0x16cd3b['attributes']=_0x16cd3b[_0xb398('0x51')][_0xb398('0x61')]?_0x16cd3b['attributes']:_0x10af75[_0xb398('0x42')];if(_0x3c3476[_0xb398('0x4d')]['includeAll']){_0x16cd3b[_0xb398('0x5b')]=[{'all':!![]}];}_0x16cd3b=_[_0xb398('0x57')]({},_0x16cd3b,_0x3c3476[_0xb398('0x62')]);return db['ChatWebsite'][_0xb398('0x63')](_0x16cd3b)['then'](handleEntityNotFound(_0x3bd328,null))[_0xb398('0x1a')](respondWithResult(_0x3bd328,null))[_0xb398('0x5d')](handleError(_0x3bd328,null));};exports[_0xb398('0x64')]=function(_0x3ebc84,_0x14d617){var _0x515499=null;_0x3ebc84[_0xb398('0x65')]['address'][_0xb398('0x3a')](',')[_0xb398('0x66')](_0x3f6238=>{if(_0x3f6238[_0xb398('0x67')]()!==''&&!wildcardUtils[_0xb398('0x68')](_0x3f6238[_0xb398('0x67')]())){_0x515499=new APIBadRequestError('\x22'+_0x3f6238[_0xb398('0x67')]()+_0xb398('0x69'));}});if(_0x515499){return handleError(_0x14d617,null)(_0x515499);}return db[_0xb398('0x60')][_0xb398('0x64')](_0x3ebc84[_0xb398('0x65')],{})[_0xb398('0x1a')](function(_0x4f21e6){var _0x296ef0=_0x3ebc84[_0xb398('0x6a')][_0xb398('0x6b')]({'plain':!![]});if(!_0x296ef0)throw new Error(_0xb398('0x6c'));if(_0x296ef0[_0xb398('0x6d')]===_0xb398('0x6a')){var _0x15fca5=_0x4f21e6[_0xb398('0x6b')]({'plain':!![]});var _0x155487=_0xb398('0x2e');return db[_0xb398('0x6e')]['find']({'where':{'name':_0x155487,'userProfileId':_0x296ef0[_0xb398('0x6f')]},'raw':!![]})[_0xb398('0x1a')](function(_0x4cad91){if(_0x4cad91&&_0x4cad91[_0xb398('0x70')]===0x0){return db['UserProfileResource'][_0xb398('0x64')]({'name':_0x15fca5[_0xb398('0x30')],'resourceId':_0x15fca5['id'],'type':_0x4cad91[_0xb398('0x30')],'sectionId':_0x4cad91['id']},{})[_0xb398('0x1a')](function(){return _0x4f21e6;});}else{return _0x4f21e6;}})[_0xb398('0x5d')](function(_0x1e48a0){logger[_0xb398('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e48a0);throw _0x1e48a0;});}return _0x4f21e6;})[_0xb398('0x1a')](respondWithResult(_0x14d617,0xc9))[_0xb398('0x5d')](handleError(_0x14d617,null));};exports[_0xb398('0x2d')]=function(_0x2b6c41,_0x32dd35){var _0x65fc69=null;_0x2b6c41[_0xb398('0x65')][_0xb398('0x71')]['split'](',')[_0xb398('0x66')](_0x37f5e9=>{if(_0x37f5e9[_0xb398('0x67')]()!==''&&!wildcardUtils[_0xb398('0x68')](_0x37f5e9[_0xb398('0x67')]())){_0x65fc69=new APIBadRequestError('\x22'+_0x37f5e9[_0xb398('0x67')]()+_0xb398('0x69'));}});if(_0x65fc69){return handleError(_0x32dd35,null)(_0x65fc69);}if(_0x2b6c41[_0xb398('0x65')]['id']){delete _0x2b6c41[_0xb398('0x65')]['id'];}return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x2b6c41['params']['id']},'include':[{'model':db[_0xb398('0x48')],'as':_0xb398('0x5f')}]})[_0xb398('0x1a')](handleEntityNotFound(_0x32dd35,null))['then'](saveUpdates(_0x2b6c41[_0xb398('0x65')],null))[_0xb398('0x1a')](respondWithResult(_0x32dd35,null))[_0xb398('0x5d')](handleError(_0x32dd35,null));};exports['destroy']=function(_0x346a70,_0xe83537){return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x346a70[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0xe83537,null))[_0xb398('0x1a')](removeEntity(_0xe83537,null))[_0xb398('0x5d')](handleError(_0xe83537,null));};exports['describe']=function(_0x523036,_0x20df31){return db['ChatWebsite'][_0xb398('0x73')]()[_0xb398('0x1a')](respondWithResult(_0x20df31,null))[_0xb398('0x5d')](handleError(_0x20df31,null));};exports[_0xb398('0x74')]=function(_0x1c3e50,_0x2787c8){if(_0x1c3e50[_0xb398('0x65')]['id']){delete _0x1c3e50[_0xb398('0x65')]['id'];}return db[_0xb398('0x60')]['find']({'where':{'id':_0x1c3e50['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x2787c8,null))[_0xb398('0x1a')](function(_0x43d1dc){if(_0x43d1dc){_0x1c3e50[_0xb398('0x65')][_0xb398('0x75')]=_0x43d1dc['id'];return db[_0xb398('0x76')]['create'](_0x1c3e50[_0xb398('0x65')]);}})[_0xb398('0x1a')](respondWithResult(_0x2787c8,null))[_0xb398('0x5d')](handleError(_0x2787c8,null));};exports[_0xb398('0x77')]=function(_0x5288c4,_0xa80f30){var _0x74479f={'raw':![],'where':{}};var _0x46f1d9={};var _0x365002={'count':0x0,'rows':[]};return db[_0xb398('0x60')][_0xb398('0x78')]({'where':{'id':_0x5288c4[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0xa80f30,null))['then'](function(_0x5b6ec5){if(_0x5b6ec5){_0x46f1d9[_0xb398('0x42')]=_[_0xb398('0x4e')](db[_0xb398('0x76')]['rawAttributes']);_0x46f1d9['query']=_[_0xb398('0x4e')](_0x5288c4[_0xb398('0x4d')]);_0x46f1d9[_0xb398('0x4f')]=_[_0xb398('0x50')](_0x46f1d9[_0xb398('0x42')],_0x46f1d9['query']);_0x74479f[_0xb398('0x51')]=_[_0xb398('0x50')](_0x46f1d9['model'],qs[_0xb398('0x52')](_0x5288c4[_0xb398('0x4d')][_0xb398('0x52')]));_0x74479f[_0xb398('0x51')]=_0x74479f[_0xb398('0x51')][_0xb398('0x61')]?_0x74479f['attributes']:_0x46f1d9['model'];if(!_0x5288c4[_0xb398('0x4d')][_0xb398('0x79')](_0xb398('0x7a'))){_0x74479f[_0xb398('0x29')]=qs[_0xb398('0x29')](_0x5288c4[_0xb398('0x4d')][_0xb398('0x29')]);_0x74479f['offset']=qs[_0xb398('0x28')](_0x5288c4[_0xb398('0x4d')][_0xb398('0x28')]);}_0x74479f[_0xb398('0x53')]=qs[_0xb398('0x54')](_0x5288c4[_0xb398('0x4d')]['sort']);_0x74479f[_0xb398('0x55')]=qs[_0xb398('0x4f')](_[_0xb398('0x56')](_0x5288c4[_0xb398('0x4d')],_0x46f1d9[_0xb398('0x4f')]));_0x74479f[_0xb398('0x55')][_0xb398('0x75')]=_0x5b6ec5['id'];if(_0x5288c4[_0xb398('0x4d')][_0xb398('0x59')]){_0x74479f[_0xb398('0x55')]=_[_0xb398('0x57')](_0x74479f[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0x74479f[_0xb398('0x51')],function(_0x316560){var _0x51c03f={};_0x51c03f[_0x316560]={'$like':'%'+_0x5288c4['query'][_0xb398('0x59')]+'%'};return _0x51c03f;})});}_0x74479f=_[_0xb398('0x57')]({},_0x74479f,_0x5288c4[_0xb398('0x62')]);return db[_0xb398('0x76')]['count']({'where':_0x74479f['where']})['then'](function(_0x5636c0){_0x365002[_0xb398('0x2a')]=_0x5636c0;if(_0x5288c4[_0xb398('0x4d')][_0xb398('0x5a')]){_0x74479f[_0xb398('0x5b')]=[{'all':!![]}];}return db[_0xb398('0x76')]['findAll'](_0x74479f);})[_0xb398('0x1a')](function(_0x3c8d53){_0x365002[_0xb398('0x7b')]=_0x3c8d53;return _0x365002;});}})[_0xb398('0x1a')](respondWithFilteredResult(_0xa80f30,_0x74479f))[_0xb398('0x5d')](handleError(_0xa80f30,null));};exports[_0xb398('0x7c')]=function(_0x3be3d7,_0x4845f5){return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x3be3d7['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x4845f5,null))['then'](function(_0x291fca){if(_0x291fca){return _0x291fca[_0xb398('0x7c')](_0x3be3d7[_0xb398('0x4d')]['ids']);}})[_0xb398('0x1a')](respondWithStatusCode(_0x4845f5,null))[_0xb398('0x5d')](handleError(_0x4845f5,null));};exports[_0xb398('0x7d')]=function(_0x1a7688,_0x5a172f){if(_0x1a7688['body']['id']){delete _0x1a7688[_0xb398('0x65')]['id'];}return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x1a7688[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x5a172f,null))[_0xb398('0x1a')](function(_0x5f3745){if(_0x5f3745){_0x1a7688['body']['ChatWebsiteId']=_0x5f3745['id'];return db[_0xb398('0x7e')]['create'](_0x1a7688[_0xb398('0x65')]);}})[_0xb398('0x1a')](respondWithResult(_0x5a172f,null))['catch'](handleError(_0x5a172f,null));};exports[_0xb398('0x7f')]=function(_0x1ea912,_0x3f1b5e){var _0x1ea40a={'raw':![],'where':{}};var _0x1be5c6={};var _0x1a80eb={'count':0x0,'rows':[]};return db[_0xb398('0x60')][_0xb398('0x78')]({'where':{'id':_0x1ea912['params']['id']}})['then'](handleEntityNotFound(_0x3f1b5e,null))['then'](function(_0x52f016){if(_0x52f016){_0x1be5c6[_0xb398('0x42')]=_[_0xb398('0x4e')](db['CannedAnswer'][_0xb398('0x49')]);_0x1be5c6[_0xb398('0x4d')]=_['keys'](_0x1ea912[_0xb398('0x4d')]);_0x1be5c6['filters']=_[_0xb398('0x50')](_0x1be5c6[_0xb398('0x42')],_0x1be5c6['query']);_0x1ea40a['attributes']=_[_0xb398('0x50')](_0x1be5c6['model'],qs[_0xb398('0x52')](_0x1ea912['query'][_0xb398('0x52')]));_0x1ea40a[_0xb398('0x51')]=_0x1ea40a['attributes'][_0xb398('0x61')]?_0x1ea40a['attributes']:_0x1be5c6[_0xb398('0x42')];if(!_0x1ea912['query'][_0xb398('0x79')](_0xb398('0x7a'))){_0x1ea40a[_0xb398('0x29')]=qs[_0xb398('0x29')](_0x1ea912[_0xb398('0x4d')][_0xb398('0x29')]);_0x1ea40a[_0xb398('0x28')]=qs['offset'](_0x1ea912[_0xb398('0x4d')][_0xb398('0x28')]);}_0x1ea40a[_0xb398('0x53')]=qs['sort'](_0x1ea912['query'][_0xb398('0x54')]);_0x1ea40a['where']=qs['filters'](_[_0xb398('0x56')](_0x1ea912[_0xb398('0x4d')],_0x1be5c6[_0xb398('0x4f')]));_0x1ea40a[_0xb398('0x55')][_0xb398('0x75')]=_0x52f016['id'];if(_0x1ea912[_0xb398('0x4d')]['filter']){_0x1ea40a['where']=_['merge'](_0x1ea40a['where'],{'$or':_[_0xb398('0x4c')](_0x1ea40a['attributes'],function(_0xc4b4e5){var _0x4057a9={};_0x4057a9[_0xc4b4e5]={'$like':'%'+_0x1ea912[_0xb398('0x4d')][_0xb398('0x59')]+'%'};return _0x4057a9;})});}_0x1ea40a=_[_0xb398('0x57')]({},_0x1ea40a,_0x1ea912[_0xb398('0x62')]);return db[_0xb398('0x7e')][_0xb398('0x2a')]({'where':_0x1ea40a['where']})[_0xb398('0x1a')](function(_0x51d8e7){_0x1a80eb[_0xb398('0x2a')]=_0x51d8e7;if(_0x1ea912['query']['includeAll']){_0x1ea40a[_0xb398('0x5b')]=[{'all':!![]}];}return db[_0xb398('0x7e')][_0xb398('0x5c')](_0x1ea40a);})[_0xb398('0x1a')](function(_0x2cf95d){_0x1a80eb[_0xb398('0x7b')]=_0x2cf95d;return _0x1a80eb;});}})['then'](respondWithFilteredResult(_0x3f1b5e,_0x1ea40a))[_0xb398('0x5d')](handleError(_0x3f1b5e,null));};exports['removeAnswers']=function(_0x13ab4c,_0x54883d){return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x13ab4c[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x54883d,null))['then'](function(_0x5230d5){if(_0x5230d5){return _0x5230d5['removeAnswers'](_0x13ab4c[_0xb398('0x4d')]['ids']);}})[_0xb398('0x1a')](respondWithStatusCode(_0x54883d,null))[_0xb398('0x5d')](handleError(_0x54883d,null));};exports[_0xb398('0x80')]=function(_0x3b0136,_0x22b24d){_0x3b0136[_0xb398('0x65')][_0xb398('0x81')]=_0x3b0136[_0xb398('0x82')]['filename'];return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x3b0136['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x22b24d,null))[_0xb398('0x1a')](saveUpdates(_0x3b0136[_0xb398('0x65')],null))[_0xb398('0x1a')](respondWithResult(_0x22b24d,null))[_0xb398('0x5d')](handleError(_0x22b24d,null));};exports[_0xb398('0x83')]=function(_0x522f6d,_0xf87c55){_0x522f6d['body'][_0xb398('0x84')]=_0x522f6d[_0xb398('0x82')][_0xb398('0x85')];return db[_0xb398('0x60')]['find']({'where':{'id':_0x522f6d[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0xf87c55,null))[_0xb398('0x1a')](saveUpdates(_0x522f6d['body'],null))[_0xb398('0x1a')](respondWithResult(_0xf87c55,null))[_0xb398('0x5d')](handleError(_0xf87c55,null));};exports[_0xb398('0x86')]=function(_0x37dd30,_0x33001e){_0x37dd30[_0xb398('0x65')][_0xb398('0x87')]=_0x37dd30['file'][_0xb398('0x85')];return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x37dd30['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x33001e,null))[_0xb398('0x1a')](saveUpdates(_0x37dd30[_0xb398('0x65')],null))['then'](respondWithResult(_0x33001e,null))[_0xb398('0x5d')](handleError(_0x33001e,null));};exports[_0xb398('0x88')]=function(_0x446737,_0x1791ba){_0x446737[_0xb398('0x65')]['systemAvatar']=_0x446737[_0xb398('0x82')]['filename'];return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x446737[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x1791ba,null))[_0xb398('0x1a')](saveUpdates(_0x446737[_0xb398('0x65')],null))[_0xb398('0x1a')](respondWithResult(_0x1791ba,null))[_0xb398('0x5d')](handleError(_0x1791ba,null));};exports[_0xb398('0x89')]=function(_0x5773bf,_0x5874a9){var _0x3603bb=path[_0xb398('0x8a')](config['root'],_0xb398('0x8b'));var _0x12ce45={'where':{'id':_0x5773bf[_0xb398('0x72')]['id']},'attributes':['id',_0xb398('0x81')],'raw':!![]};var _0x2e5434=![];return require(_0xb398('0x8c'))[_0xb398('0x8d')]()['then'](function(_0x4d5e46){if(_0x4d5e46){_0x2e5434=_0x4d5e46[_0xb398('0x8e')];}})[_0xb398('0x1a')](function(){return db[_0xb398('0x60')]['find'](_0x12ce45);})[_0xb398('0x1a')](handleEntityNotFound(_0x5874a9,null))[_0xb398('0x1a')](function(_0x3b7830){if(_0x3b7830){if(!_[_0xb398('0x8f')](_0x3b7830[_0xb398('0x81')])){if(fs[_0xb398('0x90')](path[_0xb398('0x8a')](config['root'],'server/files/images/logos/',_0x3b7830[_0xb398('0x81')]))&&_0x2e5434){_0x3603bb=path['join'](config['root'],_0xb398('0x91'),_0x3b7830[_0xb398('0x81')]);}}return _0x5874a9[_0xb398('0x92')](_0x3603bb);}})[_0xb398('0x5d')](handleError(_0x5874a9,null));};exports[_0xb398('0x93')]=function(_0x429cff,_0x4b823c){var _0x24fcbf=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x95'));var _0x28962d={'where':{'id':_0x429cff[_0xb398('0x72')]['id']},'attributes':['id',_0xb398('0x84')],'raw':!![]};return db['ChatWebsite'][_0xb398('0x63')](_0x28962d)[_0xb398('0x1a')](handleEntityNotFound(_0x4b823c,null))[_0xb398('0x1a')](function(_0x48d8b1){if(_0x48d8b1){if(!_[_0xb398('0x8f')](_0x48d8b1[_0xb398('0x84')])){if(fs[_0xb398('0x90')](path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x96'),_0x48d8b1['agentAvatar']))){_0x24fcbf=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x96'),_0x48d8b1['agentAvatar']);}}return _0x4b823c[_0xb398('0x92')](_0x24fcbf);}})[_0xb398('0x5d')](handleError(_0x4b823c,null));};exports[_0xb398('0x97')]=function(_0x436569,_0x3708e7){var _0x44eca6=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x98'));var _0x1f9597={'where':{'id':_0x436569[_0xb398('0x72')]['id']},'attributes':['id','customerAvatar',_0xb398('0x99')],'raw':!![]};return db['ChatWebsite'][_0xb398('0x63')](_0x1f9597)[_0xb398('0x1a')](handleEntityNotFound(_0x3708e7,null))[_0xb398('0x1a')](function(_0x4d7baf){if(_0x4d7baf){if(!_[_0xb398('0x8f')](_0x4d7baf[_0xb398('0x87')])){if(fs[_0xb398('0x90')](path[_0xb398('0x8a')](config['root'],_0xb398('0x96'),_0x4d7baf['customerAvatar']))&&_0x4d7baf[_0xb398('0x99')]){_0x44eca6=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x96'),_0x4d7baf['customerAvatar']);}}return _0x3708e7[_0xb398('0x92')](_0x44eca6);}})[_0xb398('0x5d')](handleError(_0x3708e7,null));};exports[_0xb398('0x9a')]=function(_0x24e09a,_0x3a0e3d){var _0x540ac6=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x9b'));var _0x2a46a7={'where':{'id':_0x24e09a[_0xb398('0x72')]['id']},'attributes':['id',_0xb398('0x9c')],'raw':!![]};return db[_0xb398('0x60')]['find'](_0x2a46a7)[_0xb398('0x1a')](handleEntityNotFound(_0x3a0e3d,null))[_0xb398('0x1a')](function(_0x92011c){if(_0x92011c){if(!_[_0xb398('0x8f')](_0x92011c[_0xb398('0x9c')])){if(fs[_0xb398('0x90')](path['join'](config[_0xb398('0x94')],'server/files/images/avatars/',_0x92011c[_0xb398('0x9c')]))){_0x540ac6=path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x96'),_0x92011c[_0xb398('0x9c')]);}}return _0x3a0e3d['download'](_0x540ac6);}})[_0xb398('0x5d')](handleError(_0x3a0e3d,null));};function checkWebsiteInterval(_0x1c68c3){var _0x309f25=_0x1c68c3['Interval'];if(!_0x309f25){return Promise[_0xb398('0x9d')](_0x1c68c3);}var _0x23f7c5=_0x1c68c3['timezone']||undefined;return _0x309f25[_0xb398('0x9e')](_0x23f7c5)[_0xb398('0x1a')](function(_0x2093f3){if(!_0x2093f3){throw new APIOutOfIntervalError();}return _0x1c68c3;});}exports[_0xb398('0x9f')]=function(_0x31175b,_0x389910){var _0x116558={'body':_0x31175b[_0xb398('0x65')],'channel':'chat'};var _0x58a972=[];var _0x28c448=[];var _0x4a499c={};var _0x2437b0=![];if(_0x31175b[_0xb398('0x65')]['id']){delete _0x31175b['body']['id'];}if(_[_0xb398('0x8f')](_0x31175b[_0xb398('0x65')][_0xb398('0xa0')])){throw new APIBadRequestError(_0xb398('0xa1'));}if(_[_0xb398('0x8f')](_0x31175b[_0xb398('0x65')][_0xb398('0xa2')])){throw new APIBadRequestError(_0xb398('0xa3'));}if(_[_0xb398('0xa4')](_0x31175b[_0xb398('0x65')][_0xb398('0x65')])){throw new APIBadRequestError(_0xb398('0xa5'));}var _0x4efa55=_0x31175b[_0xb398('0x65')][_0xb398('0x36')]&&_0x31175b['body'][_0xb398('0xa6')];return db[_0xb398('0xa7')][_0xb398('0x73')]()[_0xb398('0x1a')](function(_0x3efb64){if(!_0x3efb64){throw new Error('No\x20available\x20attributes');}_0x58a972=Object['keys'](_0x3efb64)[_0xb398('0x59')](function(_0x822c8f){return!['createdAt',_0xb398('0xa8')][_0xb398('0xa9')](_0x822c8f);});_0x28c448=Object[_0xb398('0x4e')](_0x3efb64)[_0xb398('0x59')](function(_0x7b984b){return!['createdAt',_0xb398('0xa8'),_0xb398('0xaa'),_0xb398('0xab')][_0xb398('0xa9')](_0x7b984b);});if(!_[_0xb398('0xa9')](_0x28c448,_0x31175b[_0xb398('0x65')]['mapKey'])){throw new APIBadRequestError(_0xb398('0xac')+_0x28c448[_0xb398('0x8a')](',\x20'));}_0x4a499c[_0x31175b[_0xb398('0x65')][_0xb398('0xa2')]]=_0x31175b[_0xb398('0x65')][_0xb398('0xa0')];})[_0xb398('0x1a')](function(){return db['ChatWebsite'][_0xb398('0x63')]({'where':{'id':_0x31175b[_0xb398('0x72')]['id']},'include':[{'model':db[_0xb398('0xad')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb398('0xae'),'where':_0x4a499c,'limit':0x1,'order':[[_0xb398('0xa8'),_0xb398('0xaf')]]}]},{'model':db[_0xb398('0xb0')],'as':_0xb398('0xb1')},{'model':db[_0xb398('0xb2')],'as':_0xb398('0xb2'),'include':[{'model':db[_0xb398('0xb2')],'as':_0xb398('0xb3'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x4446e3){if(!_0x4446e3){throw new APINotFoundError(util[_0xb398('0x40')](_0xb398('0xb4'),_0x31175b[_0xb398('0x72')]['id']));}if(_0x4efa55){return checkWebsiteInterval(_0x4446e3);}return _0x4446e3;})['then'](function(_0x1d378e){_0x116558[_0xb398('0xb5')]=_0x1d378e;_0x116558[_0xb398('0xb6')]=_[_0xb398('0xb7')](_0x1d378e[_0xb398('0xb1')],[_0xb398('0xb8')],[_0xb398('0xb9')]);if(_0x116558[_0xb398('0xb5')][_0xb398('0xb1')]){delete _0x116558[_0xb398('0xb5')][_0xb398('0xb1')];}_0x116558[_0xb398('0xba')]=_0x1d378e['List']||{'id':_0x1d378e['ListId']};if(_0x116558['list']&&_0x116558[_0xb398('0xba')][_0xb398('0xae')][_0xb398('0x61')]){return _0x116558[_0xb398('0xba')][_0xb398('0xae')][0x0];}var _0x22f5a5=_[_0xb398('0x12')](_0x31175b[_0xb398('0x65')],{'firstName':_0x31175b[_0xb398('0x65')][_0xb398('0xa0')],'ListId':_0x1d378e[_0xb398('0xab')]});_0x22f5a5[_0x31175b[_0xb398('0x65')][_0xb398('0xa2')]]=_0x31175b[_0xb398('0x65')]['from'];return db[_0xb398('0xa7')][_0xb398('0x64')](_0x22f5a5,{'fields':_0x58a972,'raw':!![]});})[_0xb398('0x1a')](function(_0x2d2140){_0x116558['contact']=_0x2d2140;var _0x1c8398=createInteractionObject(_0x31175b[_0xb398('0x72')]['id'],_0x31175b['body'],_0x31175b[_0xb398('0xbb')],_0x2d2140);var _0x3519a3={'ChatWebsiteId':_0x31175b[_0xb398('0x72')]['id']};if(_0x31175b['body'][_0xb398('0xbc')]){_0x3519a3['threadId']=_0x31175b[_0xb398('0x65')][_0xb398('0xbc')];_0x3519a3['closed']=![];return db[_0xb398('0xbd')][_0xb398('0x63')]({'where':_0x3519a3})['then'](function(_0x4d8408){var _0x406bee=_0x31175b[_0xb398('0x65')][_0xb398('0x36')]&&_0x31175b[_0xb398('0x65')][_0xb398('0xa6')];if(_0x4d8408){_0x2437b0=!![];return _0x4d8408;}else if(!_0x406bee&&_0x4d8408&&_0x4d8408[_0xb398('0xbe')]){throw new APIConflictError(_0xb398('0xbf'));}_0x1c8398[_0xb398('0xbc')]=_0x31175b[_0xb398('0x65')][_0xb398('0xbc')];_0x1c8398[_0xb398('0xc0')]=_0x31175b['body'][_0xb398('0xc0')];return db[_0xb398('0xbd')][_0xb398('0x64')](_0x1c8398);});}_0x3519a3[_0xb398('0xc1')]=_0x2d2140['id'];if(_0x31175b[_0xb398('0x65')][_0xb398('0xc2')]&&_0x31175b[_0xb398('0x65')][_0xb398('0xc2')]['id']){_0x3519a3['id']=_0x31175b[_0xb398('0x65')][_0xb398('0xc2')]['id'];return db[_0xb398('0xbd')][_0xb398('0x63')]({'where':_0x3519a3})[_0xb398('0x1a')](function(_0x1cc65e){var _0x5e6454=_0x31175b['body'][_0xb398('0x36')]&&_0x31175b[_0xb398('0x65')][_0xb398('0xa6')];if(!_0x5e6454&&_0x1cc65e&&_0x1cc65e[_0xb398('0xbe')]){throw new APIConflictError(_0xb398('0xbf'));}else if(_0x1cc65e){_0x2437b0=!![];return _0x1cc65e;}else{return db[_0xb398('0xbd')][_0xb398('0x64')](_0x1c8398);}});}return db['ChatInteraction'][_0xb398('0x64')](_0x1c8398);})['then'](function(_0x32d654){if(!_0x2437b0){return _0x32d654;}var _0x3fcbe1={'from':(_0x116558[_0xb398('0xc3')]['firstName']||'')+'\x20'+(_0x116558[_0xb398('0xc3')][_0xb398('0x3b')]||'')};if(_0x31175b[_0xb398('0x65')][_0xb398('0xbc')]&&_0x31175b[_0xb398('0x65')]['messageId']&&_0x31175b[_0xb398('0x65')][_0xb398('0xbc')]!=_0x31175b['body']['messageId']){_0x3fcbe1['threadId']=_0x31175b['body'][_0xb398('0xc4')];}return _0x32d654[_0xb398('0x2d')](_0x3fcbe1);})[_0xb398('0x1a')](function(_0x3ba739){_0x116558[_0xb398('0xc2')]=_0x3ba739[_0xb398('0x6b')]({'plain':!![]});_0x116558[_0xb398('0xc2')]['created']=!_0x2437b0;if(_0x116558[_0xb398('0xc2')][_0xb398('0xc5')]){if(_0x116558['account']['autoclose']){_0x116558[_0xb398('0xb6')][_0xb398('0xc6')]({'id':0x0,'priority':_0x116558[_0xb398('0xb6')][_0xb398('0x61')]+0x1,'app':_0xb398('0xc7'),'appdata':_0xb398('0xc8'),'interval':_0xb398('0xc9')});}}return db['ChatMessage'][_0xb398('0x64')]({'body':_0x31175b['body'][_0xb398('0x65')],'ChatWebsiteId':_0x31175b['params']['id'],'ChatInteractionId':_0x3ba739['id'],'direction':'in','ContactId':_0x116558['contact']['id'],'AttachmentId':_0x31175b[_0xb398('0x65')][_0xb398('0xca')]});})[_0xb398('0x1a')](function(_0x168d71){_0x116558[_0xb398('0x22')]=_0x168d71;if(!_0x116558[_0xb398('0xc2')][_0xb398('0xcb')]){return;}return db[_0xb398('0xcc')][_0xb398('0x63')]({'attributes':['id','name'],'where':{'id':_0x116558[_0xb398('0xc2')][_0xb398('0xcb')]}});})[_0xb398('0x1a')](function(_0x5f1e29){if(_0x5f1e29){_0x116558[_0xb398('0xb6')][_0xb398('0xcd')]({'id':0x0,'priority':0x0,'app':_0xb398('0xce'),'appdata':_0x5f1e29[_0xb398('0x30')]+','+(_0x116558[_0xb398('0xb5')][_0xb398('0xcf')]||0xa),'interval':_0xb398('0xc9')});_0x116558[_0xb398('0xd0')]=!![];}if(!_0x116558[_0xb398('0xc2')][_0xb398('0xd1')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0xb398('0x30')],'where':{'id':_0x116558[_0xb398('0xc2')][_0xb398('0xd1')]}});})[_0xb398('0x1a')](function(_0x503cd1){if(_0x503cd1){_0x116558[_0xb398('0xb6')][_0xb398('0xcd')]({'id':0x0,'priority':0x1,'app':_0xb398('0xd2'),'appdata':_0x503cd1[_0xb398('0x30')]+','+(_0x116558[_0xb398('0xb5')][_0xb398('0xd3')]||0x12c),'interval':_0xb398('0xc9')});}return respondWithRpcPromise('Start',_0xb398('0xd4'),_0x116558);})[_0xb398('0x1a')](function(_0x31875d){respondWithRpcPromise(_0xb398('0xd5'),_0xb398('0xd5'),{'event':_0xb398('0x9f'),'message':_0x31875d},client9002);return _0x31875d;})['then'](respondWithResult(_0x389910,null))[_0xb398('0x5d')](APIHandleError(_0x389910));};exports[_0xb398('0xd6')]=function(_0x574aaa,_0x227c93){var _0x10063f,_0x3bcd25,_0x4dce35;var _0x5b3113=[];var _0x135d08={};var _0x24e9e=_0x574aaa[_0xb398('0xd7')]||[];var _0x320cb5=[];var _0x37285f;return db['CmContact'][_0xb398('0x73')]()[_0xb398('0x1a')](function(_0x1b8bb0){if(!_0x1b8bb0){throw new db[(_0xb398('0xd8'))][(_0xb398('0xd9'))](_0xb398('0xda'));}_0x5b3113=_[_0xb398('0xdb')](_[_0xb398('0x4e')](_0x1b8bb0),[_0xb398('0xdc'),_0xb398('0xa8'),_0xb398('0xaa'),_0xb398('0xab')]);if(_0x574aaa['body']['id']){delete _0x574aaa['body']['id'];}if(_[_0xb398('0x8f')](_0x574aaa[_0xb398('0x65')]['from'])){throw _0x227c93[_0xb398('0x25')](0x1f4)[_0xb398('0x31')](new db[(_0xb398('0xd8'))][(_0xb398('0xd9'))](_0xb398('0xdd')));}if(_[_0xb398('0x8f')](_0x574aaa[_0xb398('0x65')]['body'])||_0x574aaa['body']['body']===''){throw _0x227c93[_0xb398('0x25')](0x1f4)[_0xb398('0x31')](new db[(_0xb398('0xd8'))][(_0xb398('0xd9'))](_0xb398('0xde')));}if(_[_0xb398('0x8f')](_0x574aaa[_0xb398('0x65')][_0xb398('0xdf')])){throw _0x227c93[_0xb398('0x25')](0x1f4)[_0xb398('0x31')](new db[(_0xb398('0xd8'))][(_0xb398('0xd9'))](_0xb398('0xe0')+_0x5b3113));}if(!_[_0xb398('0xa9')](_0x5b3113,_0x574aaa[_0xb398('0x65')][_0xb398('0xdf')])){throw _0x227c93['status'](0x1f4)['send'](new db[(_0xb398('0xd8'))][(_0xb398('0xd9'))](_0xb398('0xe1')+_0x5b3113));}_0x135d08[_0x574aaa[_0xb398('0x65')][_0xb398('0xdf')]]=_0x574aaa[_0xb398('0x65')][_0xb398('0xa0')];})[_0xb398('0x1a')](function(){return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x574aaa[_0xb398('0x72')]['id']},'include':[{'model':db[_0xb398('0xad')],'as':_0xb398('0xe2')},{'model':db[_0xb398('0xe3')],'as':_0xb398('0xe3')}]});})[_0xb398('0x1a')](handleEntityNotFound(_0x227c93,null))[_0xb398('0x1a')](function(_0x4ac3d5){if(_0x4ac3d5&&_0x4ac3d5[_0xb398('0xe2')]){_0x3bcd25=_0x4ac3d5;var _0x2afbe9=_[_0xb398('0x12')](_0x574aaa[_0xb398('0x65')],{'firstName':_0x574aaa['body'][_0xb398('0xa0')],'phone':_0x574aaa[_0xb398('0x65')][_0xb398('0xa0')],'ListId':_0x4ac3d5[_0xb398('0xab')]});_0x2afbe9[_0x574aaa[_0xb398('0x65')]['mapKeyOffline']]=_0x574aaa['body'][_0xb398('0xa0')];return db[_0xb398('0xa7')][_0xb398('0xe4')]({'where':_0x135d08,'defaults':_0x2afbe9});}})['spread'](function(_0x2588c3){if(_0x2588c3){_0x4dce35=_0x2588c3;var _0x19cb55=fs['readFileSync'](path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0xe5')),_0xb398('0xe6'));var _0x3ec4f1=ejs[_0xb398('0xe7')](_0x19cb55,{'body':_[_0xb398('0xe8')](_0x574aaa[_0xb398('0x65')][_0xb398('0x65')]),'bodyTitle':_0x3bcd25['offlineMessageBody']});return db[_0xb398('0xe9')]['create']({'body':_0x3ec4f1,'plainBody':htmlToText[_0xb398('0xea')](_0x3ec4f1),'ContactId':_0x2588c3['id'],'ChatWebsiteId':_0x3bcd25['id']});}})[_0xb398('0x1a')](function(_0xbc82df){_0x37285f=_0xbc82df;if(_0x24e9e[_0xb398('0x61')]){var _0x10a4c1=_0x24e9e['map'](function(_0x2e9435){return{'name':_0x2e9435['originalname'],'basename':_0x2e9435['filename'],'type':_0x2e9435[_0xb398('0xeb')],'ChatOfflineMessageId':_0xbc82df['id']};});_0x320cb5=_0x10a4c1['map'](_0x2fe4cc=>{var _0x3118f7={'filename':_0x2fe4cc[_0xb398('0x30')],'path':path['join'](config[_0xb398('0x94')],'server','files',_0xb398('0xec'),_0xb398('0xed'),_0x2fe4cc[_0xb398('0xee')])};return _0x3118f7;});if(!_0x3bcd25[_0xb398('0xef')]){return db['sequelize'][_0xb398('0xf0')](function(_0x2b2799){return db['Attachment'][_0xb398('0xf1')](_0x10a4c1,{'transaction':_0x2b2799});});}}})['then'](function(){if(_0x37285f){_0x10063f=_0x37285f;return db[_0xb398('0xe3')][_0xb398('0x78')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb398('0xf2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb398('0xf3'),'raw':!![]}]}]});}})[_0xb398('0x1a')](function(_0x2447ab){if(_0x2447ab&&_0x2447ab[_0xb398('0xf2')]&&_0x3bcd25[_0xb398('0xf4')]&&_0x3bcd25['forwardOfflineAddress']){var _0x522430=_0x2447ab[_0xb398('0xf5')]();return respondWithRpcPromise(_0xb398('0xf6'),'sendMail',{'account':_0x522430,'message':{'from':util[_0xb398('0x40')]('\x22%s\x22\x20<%s>',_0x2447ab['name'],_0x2447ab[_0xb398('0xf7')]||_0x2447ab[_0xb398('0xf2')][_0xb398('0x6a')]),'to':_0x3bcd25['forwardOfflineAddress'],'subject':_0x3bcd25[_0xb398('0xf8')],'html':_0x10063f['body'],'attachments':_0x320cb5}},client9003)['then'](function(){return _0x10063f;})[_0xb398('0x5d')](function(_0x410a56){logger[_0xb398('0x1f')](_0x410a56);});}})[_0xb398('0x1a')](function(){if(_0x3bcd25&&_0x3bcd25[_0xb398('0xef')]&&_0x3bcd25[_0xb398('0xf9')]){var _0x3a6daa=[];if(_0x24e9e[_0xb398('0x61')]){_0x3a6daa=_0x24e9e[_0xb398('0x4c')](function(_0x5e2f5f){return{'name':_0x5e2f5f['originalname'],'basename':_0x5e2f5f[_0xb398('0x85')],'type':_0x5e2f5f[_0xb398('0xeb')],'ChatOfflineMessageId':_0x37285f['id']};});}var _0x19f60f;if(!_[_0xb398('0x8f')](_0x3bcd25[_0xb398('0xfa')])){var _0x29101c=_[_0xb398('0x4c')](_0x574aaa[_0xb398('0x65')],function(_0xcd191){return _0xcd191;});var _0x158ad3=_['toPairsIn'](_0x29101c)[0x0];var _0x1508ce=_[_0xb398('0xfb')](_0x158ad3,function(_0x5702f5){return _0x5702f5;});_0x19f60f=_0x1508ce[0x1][_0x3bcd25[_0xb398('0xfa')]];}var _0x1ed1f9={'from':_0x4dce35[_0xb398('0xf7')],'firstName':_0x4dce35[_0xb398('0xfc')],'lastName':_0x4dce35['lastName'],'mapKey':_0xb398('0xf7'),'message':{'from':_0x4dce35[_0xb398('0xf7')],'to':_0x3bcd25[_0xb398('0xe3')][_0xb398('0xf7')],'cc':'','subject':_[_0xb398('0x8f')](_0x19f60f)?_0x3bcd25['offlineMessageSubject']:_0x19f60f,'messageId':'','sentAt':new Date(),'attach':_0x3a6daa['length'],'attachments':_0x3a6daa,'originChannel':_0xb398('0xfd'),'ChatWebsiteId':_0x3bcd25['id'],'ChatOfflineMessageId':_0x10063f['id'],'originTo':_0x3bcd25[_0xb398('0xe3')]['email']},'body':_0x10063f[_0xb398('0x65')]};var _0x4d15f5={'account':{'id':_0x3bcd25['MailAccountId']},'body':_0x1ed1f9,'log':_0xb398('0xfe')};return respondWithRpcPromise(_0xb398('0xfe'),_0xb398('0xff'),_0x4d15f5,client9001)['then'](function(){return _0x10063f;})[_0xb398('0x5d')](function(_0x577ea8){logger[_0xb398('0x1f')](_0x577ea8);});}return;})[_0xb398('0x1a')](function(){if(_0x10063f){return _0x10063f;}})[_0xb398('0x1a')](respondWithResult(_0x227c93,null))[_0xb398('0x5d')](function(){for(var _0x3daac9 of _0x24e9e){var _0x458e5c=path[_0xb398('0x8a')](config['root'],_0xb398('0x100'),_0xb398('0xd7'),_0xb398('0xec'),_0xb398('0xed'),_0x3daac9[_0xb398('0x85')]);fs_extra[_0xb398('0x101')](_0x458e5c)[_0xb398('0x5d')](function(_0x2818c0){logger[_0xb398('0x1f')]('Could\x20not\x20remove\x20attachment\x20file',_0x458e5c,_0x2818c0);});}});};exports[_0xb398('0x102')]=function(_0x3b8d1a,_0x5e6773){return db[_0xb398('0xbd')][_0xb398('0x63')]({'where':{'id':_0x3b8d1a[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x5e6773,null))[_0xb398('0x1a')](function(_0x1618d3){if(_0x1618d3){return _0x1618d3[_0xb398('0x102')](_0x3b8d1a['body'][_0xb398('0x103')],_[_0xb398('0x104')](_0x3b8d1a['body'],[_0xb398('0x103'),'id'])||{});}})[_0xb398('0x1a')](respondWithResult(_0x5e6773,null))[_0xb398('0x5d')](handleError(_0x5e6773,null));};exports['getInteractions']=function(_0x47a9c8,_0x3f4499){var _0x296723={'raw':![],'where':{}};var _0x3f10db={};var _0xe016cd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb398('0x78')]({'where':{'id':_0x47a9c8[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x3f4499,null))[_0xb398('0x1a')](function(_0x205291){if(_0x205291){_0x3f10db[_0xb398('0x42')]=_['keys'](db[_0xb398('0xbd')][_0xb398('0x49')]);_0x3f10db[_0xb398('0x4d')]=_[_0xb398('0x4e')](_0x47a9c8[_0xb398('0x4d')]);_0x3f10db[_0xb398('0x4f')]=_[_0xb398('0x50')](_0x3f10db['model'],_0x3f10db['query']);_0x296723['attributes']=_[_0xb398('0x50')](_0x3f10db[_0xb398('0x42')],qs['fields'](_0x47a9c8[_0xb398('0x4d')][_0xb398('0x52')]));_0x296723[_0xb398('0x51')]=_0x296723[_0xb398('0x51')]['length']?_0x296723[_0xb398('0x51')]:_0x3f10db[_0xb398('0x42')];if(!_0x47a9c8[_0xb398('0x4d')]['hasOwnProperty'](_0xb398('0x7a'))){_0x296723[_0xb398('0x29')]=qs['limit'](_0x47a9c8[_0xb398('0x4d')]['limit']);_0x296723['offset']=qs['offset'](_0x47a9c8['query'][_0xb398('0x28')]);}_0x296723[_0xb398('0x53')]=qs[_0xb398('0x54')](_0x47a9c8[_0xb398('0x4d')]['sort']);_0x296723[_0xb398('0x55')]=qs[_0xb398('0x4f')](_['pick'](_0x47a9c8[_0xb398('0x4d')],_0x3f10db[_0xb398('0x4f')]));_0x296723[_0xb398('0x55')][_0xb398('0x75')]=_0x205291['id'];if(_0x47a9c8[_0xb398('0x4d')][_0xb398('0x59')]){_0x296723[_0xb398('0x55')]=_[_0xb398('0x57')](_0x296723['where'],{'$or':_[_0xb398('0x4c')](_0x296723[_0xb398('0x51')],function(_0x535c94){var _0x5d08f3={};_0x5d08f3[_0x535c94]={'$like':'%'+_0x47a9c8[_0xb398('0x4d')][_0xb398('0x59')]+'%'};return _0x5d08f3;})});}_0x296723=_[_0xb398('0x57')]({},_0x296723,_0x47a9c8[_0xb398('0x62')]);return db[_0xb398('0xbd')]['count']({'where':_0x296723[_0xb398('0x55')]})[_0xb398('0x1a')](function(_0x5705ff){_0xe016cd[_0xb398('0x2a')]=_0x5705ff;if(_0x47a9c8[_0xb398('0x4d')][_0xb398('0x5a')]){_0x296723[_0xb398('0x5b')]=[{'model':db[_0xb398('0xa7')],'as':_0xb398('0x105'),'required':![]},{'model':db[_0xb398('0xcc')],'as':_0xb398('0x106'),'attributes':['name',_0xb398('0x107'),'internal'],'required':![]},{'model':db[_0xb398('0x108')],'as':_0xb398('0x109'),'attributes':['id','name','color'],'where':_0x47a9c8[_0xb398('0x4d')][_0xb398('0x10a')]?{'id':_0x47a9c8['query'][_0xb398('0x10a')]}:undefined,'required':_0x47a9c8[_0xb398('0x4d')][_0xb398('0x10a')]?!![]:![]}];}return db[_0xb398('0xbd')][_0xb398('0x5c')](_0x296723);})['then'](function(_0x17519e){_0xe016cd['rows']=_0x17519e;return _0xe016cd;});}})[_0xb398('0x1a')](respondWithFilteredResult(_0x3f4499,_0x296723))[_0xb398('0x5d')](handleError(_0x3f4499,null));};exports[_0xb398('0x10b')]=function(_0x32b1fb,_0x37bf38){var _0x483022=0x0;var _0x2d7a4d=0x0;var _0x4472cb=![];var _0x4db47b;var _0x468e5b;return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x32b1fb[_0xb398('0x72')]['id']},'include':[{'model':db['Interval'],'as':_0xb398('0xb2'),'include':[{'model':db[_0xb398('0xb2')],'as':_0xb398('0xb3'),'attributes':['id',_0xb398('0x10c')]}]}]})[_0xb398('0x1a')](handleEntityNotFound(_0x37bf38,null))[_0xb398('0x1a')](function(_0x269a7e){if(_0x269a7e){_0x4db47b=_0x269a7e;return _0x269a7e[_0xb398('0x10d')]({'raw':!![]});}})[_0xb398('0x1a')](function(_0x407042){if(_0x4db47b){if(_0x407042){_0x468e5b=_0x407042;}}return require(_0xb398('0x8c'))[_0xb398('0x8d')]();})[_0xb398('0x1a')](function(_0x44f718){if(_0x44f718){_0x2d7a4d=_0x44f718[_0xb398('0x10e')];_0x4472cb=_0x44f718['custom'];}})[_0xb398('0x1a')](function(){return db[_0xb398('0xbd')][_0xb398('0x2a')]({'where':{'closed':![]}});})[_0xb398('0x1a')](function(_0x3d6e48){_0x483022=_0x3d6e48;if(_0x2d7a4d&&_0x3d6e48>_0x2d7a4d){return db[_0xb398('0x10f')][_0xb398('0x78')]({'where':{'id':0x1}})[_0xb398('0x1a')](function(_0xbe7b51){if(_0xbe7b51){_0xbe7b51[_0xb398('0x110')]('chatLicenseExceeded');}});}})[_0xb398('0x1a')](function(){var _0x1a6d55=_0x4db47b[_0xb398('0xb2')];var _0x29c385=_0x4db47b[_0xb398('0x111')]||undefined;return _0x1a6d55?_0x1a6d55[_0xb398('0x9e')](_0x29c385):!![];})[_0xb398('0x1a')](function(_0xf8b050){var _0x308e4b=fs[_0xb398('0x112')](path[_0xb398('0x8a')](config[_0xb398('0x94')],_0xb398('0x113')),'utf8');var _0xcbbb51=_0xb398('0x114');var _0x314911=![];var _0x1208f9,_0xfde7f2;if(_0x32b1fb[_0xb398('0xbb')][_0xb398('0xa6')]){_0x1208f9=new URL(_0x32b1fb[_0xb398('0xbb')][_0xb398('0xa6')])[_0xb398('0x115')];}else if(_0x32b1fb['headers']['origin']){_0x1208f9=new URL(_0x32b1fb[_0xb398('0xbb')][_0xb398('0x115')])[_0xb398('0x115')];}else{_0x1208f9=_0xb398('0x116');}_0xfde7f2=typeof _0x4db47b[_0xb398('0x71')][_0xb398('0x3a')](',')[_0xb398('0x63')](function(_0x58c56f){return wildcardUtils['testWebsiteWithWildcard'](_0x58c56f,_0x1208f9);})!==_0xb398('0x117');var _0x69fa89={'chatVersion':_0xcbbb51,'chatWebsiteAddressOrigin':_0xfde7f2?_0x1208f9:_0x4db47b[_0xb398('0x71')],'remote':_0x4db47b[_0xb398('0x118')],'query':querystring[_0xb398('0x46')](_['merge'](_0x4db47b[_0xb398('0x6b')]({'plain':!![]}),{'customerIp':_0x32b1fb[_0xb398('0xbb')][_0xb398('0x38')]||_0x32b1fb['headers'][_0xb398('0x119')]||_0x32b1fb[_0xb398('0x11a')][_0xb398('0x11b')]||_0x32b1fb['ip'],'referer':_0x32b1fb['headers'][_0xb398('0xa6')],'openedInteractions':_0x483022,'maxInteractions':_0x2d7a4d,'virtual':_0x4472cb[_0xb398('0x10e')],'online':_0xf8b050,'custom':_0x4472cb,'address':_0xfde7f2?_0x1208f9:null}))[_0xb398('0x11c')](/'/g,'\x5c\x27')};_0x37bf38[_0xb398('0x31')](ejs['render'](Mustache[_0xb398('0xe7')](_0x308e4b,_0x69fa89),{'proactiveActions':_0x468e5b,'alignment':_0x4db47b['alignment'],'verticalAlignment':_0x4db47b[_0xb398('0x11d')],'div_color':_0x4db47b[_0xb398('0x11e')],'labelText':_0x4db47b['labelText'],'text_color':_0x4db47b[_0xb398('0x11f')],'text_button_color':_0x4db47b['textButtonColor'],'button_color':_0x4db47b[_0xb398('0x120')],'background_color':_0x4db47b['backgroundColor'],'hideWhenOffline':_0x4db47b[_0xb398('0x121')],'intervalId':_0x4db47b['IntervalId'],'isDevelopment':_0x314911,'chatVersion':_0xcbbb51}));})[_0xb398('0x5d')](handleError(_0x37bf38,null));};exports[_0xb398('0x122')]=function(_0x1d34f7,_0x1d0f4d){var _0x2089af=_0x1d34f7[_0xb398('0x72')]['id'];var _0x114fe0=_0x1d34f7['body'];var _0x2e20c3=0xc8;var _0x10e863=null;return db[_0xb398('0x123')]['transaction']({'isolationLevel':db[_0xb398('0x123')]['Transaction'][_0xb398('0x124')][_0xb398('0x125')]},function(_0x55c8dd){return db[_0xb398('0x60')][_0xb398('0x78')]({'where':{'id':_0x2089af},'transaction':_0x55c8dd})['then'](function(_0xf699bc){if(_0xf699bc){return db[_0xb398('0xb0')]['destroy']({'where':{'ChatWebsiteId':_0x2089af},'transaction':_0x55c8dd})[_0xb398('0x1a')](function(){var _0x230b33=_[_0xb398('0x4c')](_0x114fe0,function(_0xab4aa4){_0xab4aa4[_0xb398('0x75')]=_0x2089af;return _0xab4aa4;});return db[_0xb398('0xb0')][_0xb398('0xf1')](_0x230b33,{'transaction':_0x55c8dd});});}else{_0x2e20c3=0x194;_0x10e863=[];}});})[_0xb398('0x1a')](function(){if(_0x2e20c3!==0x194){return db[_0xb398('0xb0')][_0xb398('0x126')]({'where':{'ChatWebsiteId':_0x2089af},'order':_0xb398('0xb8')})[_0xb398('0x1a')](function(_0x343086){_0x10e863=_0x343086;});}})[_0xb398('0x5d')](function(_0x5d6bbf){_0x2e20c3=0x1f4;logger[_0xb398('0x1f')](_0x5d6bbf[_0xb398('0x2f')]);if(_0x5d6bbf[_0xb398('0x30')]){delete _0x5d6bbf[_0xb398('0x30')];}_0x10e863=_0x5d6bbf;})[_0xb398('0x127')](function(){if(_0x10e863===null){_0x1d0f4d[_0xb398('0x24')](_0x2e20c3);}else{if(_0x2e20c3===0x1f4){_0x1d0f4d[_0xb398('0x25')](_0x2e20c3)['send'](_0x10e863);}else{_0x1d0f4d[_0xb398('0x25')](_0x2e20c3)[_0xb398('0x27')](_0x10e863);}}});};exports['getApplications']=function(_0x24b673,_0x4b1823){var _0x39eb42={};var _0x515627={};var _0x3b570e;var _0x517f28;return db['ChatWebsite'][_0xb398('0x78')]({'where':{'id':_0x24b673['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x4b1823,null))[_0xb398('0x1a')](function(_0x2ddf5a){if(_0x2ddf5a){_0x3b570e=_0x2ddf5a;_0x515627[_0xb398('0x42')]=_['keys'](db[_0xb398('0xb0')][_0xb398('0x49')]);_0x515627[_0xb398('0x4d')]=_[_0xb398('0x4e')](_0x24b673[_0xb398('0x4d')]);_0x515627['filters']=_[_0xb398('0x50')](_0x515627[_0xb398('0x42')],_0x515627[_0xb398('0x4d')]);_0x39eb42['attributes']=_[_0xb398('0x50')](_0x515627['model'],qs['fields'](_0x24b673[_0xb398('0x4d')][_0xb398('0x52')]));_0x39eb42[_0xb398('0x51')]=_0x39eb42[_0xb398('0x51')][_0xb398('0x61')]?_0x39eb42['attributes']:_0x515627[_0xb398('0x42')];_0x39eb42[_0xb398('0x53')]=qs['sort'](_0x24b673['query'][_0xb398('0x54')]);_0x39eb42[_0xb398('0x55')]=qs[_0xb398('0x4f')](_['pick'](_0x24b673[_0xb398('0x4d')],_0x515627[_0xb398('0x4f')]));if(_0x24b673[_0xb398('0x4d')][_0xb398('0x59')]){_0x39eb42['where']=_[_0xb398('0x57')](_0x39eb42[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0x39eb42[_0xb398('0x51')],function(_0x46d2bf){var _0x535244={};_0x535244[_0x46d2bf]={'$like':'%'+_0x24b673[_0xb398('0x4d')][_0xb398('0x59')]+'%'};return _0x535244;})});}_0x39eb42=_[_0xb398('0x57')]({},_0x39eb42,_0x24b673['options']);return _0x3b570e[_0xb398('0x128')](_0x39eb42);}})[_0xb398('0x1a')](function(_0x3941a0){if(_0x3941a0){_0x517f28=_0x3941a0[_0xb398('0x61')];if(!_0x24b673[_0xb398('0x4d')][_0xb398('0x79')](_0xb398('0x7a'))){_0x39eb42['limit']=qs[_0xb398('0x29')](_0x24b673[_0xb398('0x4d')][_0xb398('0x29')]);_0x39eb42[_0xb398('0x28')]=qs['offset'](_0x24b673[_0xb398('0x4d')][_0xb398('0x28')]);}return _0x3b570e['getApplications'](_0x39eb42);}})[_0xb398('0x1a')](function(_0x516eb5){if(_0x516eb5){return _0x516eb5?{'count':_0x517f28,'rows':_0x516eb5}:null;}})[_0xb398('0x1a')](respondWithResult(_0x4b1823,null))['catch'](handleError(_0x4b1823,null));};exports[_0xb398('0x129')]=function(_0x1b953b,_0x36dce1){return db[_0xb398('0x12a')]['find']({'where':{'id':_0x1b953b[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x36dce1,null))[_0xb398('0x1a')](function(_0x4bc05a){if(_0x4bc05a){return _0x4bc05a[_0xb398('0x129')](_0x1b953b[_0xb398('0x65')][_0xb398('0x103')],_[_0xb398('0x104')](_0x1b953b['body'],[_0xb398('0x103'),'id'])||{});}})[_0xb398('0x1a')](respondWithResult(_0x36dce1,null))[_0xb398('0x5d')](handleError(_0x36dce1,null));};exports[_0xb398('0x10d')]=function(_0x38b072,_0x4a5d07){var _0x5dcc59={};var _0x377637={};var _0x3bf936;var _0x40d343;return db['ChatWebsite'][_0xb398('0x78')]({'where':{'id':_0x38b072['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x4a5d07,null))['then'](function(_0x4e29ec){if(_0x4e29ec){_0x3bf936=_0x4e29ec;_0x377637[_0xb398('0x42')]=_[_0xb398('0x4e')](db[_0xb398('0x12b')][_0xb398('0x49')]);_0x377637[_0xb398('0x4d')]=_['keys'](_0x38b072['query']);_0x377637['filters']=_[_0xb398('0x50')](_0x377637['model'],_0x377637[_0xb398('0x4d')]);_0x5dcc59[_0xb398('0x51')]=_[_0xb398('0x50')](_0x377637['model'],qs[_0xb398('0x52')](_0x38b072[_0xb398('0x4d')][_0xb398('0x52')]));_0x5dcc59[_0xb398('0x51')]=_0x5dcc59[_0xb398('0x51')][_0xb398('0x61')]?_0x5dcc59[_0xb398('0x51')]:_0x377637['model'];_0x5dcc59['order']=qs[_0xb398('0x54')](_0x38b072[_0xb398('0x4d')]['sort']);_0x5dcc59[_0xb398('0x55')]=qs[_0xb398('0x4f')](_[_0xb398('0x56')](_0x38b072[_0xb398('0x4d')],_0x377637['filters']));if(_0x38b072['query'][_0xb398('0x59')]){_0x5dcc59[_0xb398('0x55')]=_[_0xb398('0x57')](_0x5dcc59[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0x5dcc59['attributes'],function(_0x1fea42){var _0x21e85b={};_0x21e85b[_0x1fea42]={'$like':'%'+_0x38b072[_0xb398('0x4d')][_0xb398('0x59')]+'%'};return _0x21e85b;})});}_0x5dcc59=_['merge']({},_0x5dcc59,_0x38b072['options']);return _0x3bf936[_0xb398('0x10d')](_0x5dcc59);}})['then'](function(_0x1267c9){if(_0x1267c9){_0x40d343=_0x1267c9[_0xb398('0x61')];if(!_0x38b072[_0xb398('0x4d')][_0xb398('0x79')](_0xb398('0x7a'))){_0x5dcc59[_0xb398('0x29')]=qs['limit'](_0x38b072[_0xb398('0x4d')]['limit']);_0x5dcc59['offset']=qs[_0xb398('0x28')](_0x38b072['query'][_0xb398('0x28')]);}return _0x3bf936[_0xb398('0x10d')](_0x5dcc59);}})[_0xb398('0x1a')](function(_0x36ae4d){if(_0x36ae4d){return _0x36ae4d?{'count':_0x40d343,'rows':_0x36ae4d}:null;}})[_0xb398('0x1a')](respondWithResult(_0x4a5d07,null))['catch'](handleError(_0x4a5d07,null));};exports[_0xb398('0x12c')]=function(_0x51db68,_0x4373c0){var _0x344390=_0x51db68[_0xb398('0x4d')][_0xb398('0x12d')]===_0xb398('0x12e')?_0xb398('0x12f'):_0xb398('0x130');return db[_0xb398('0x60')]['find']({'attributes':['id',_0x344390],'where':{'id':_0x51db68[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x4373c0,null))['then'](function(_0x5bb843){if(_0x5bb843){var _0x3918ec=_0x5bb843[_0x344390];var _0x2135ea=_0x3918ec&&_0x3918ec[_0xb398('0x131')]?_0x3918ec[_0xb398('0x131')]:[];_0x4373c0[_0xb398('0x31')]({'fromKey':_[_0xb398('0x8f')](_0x3918ec[_0xb398('0x132')])?undefined:_0x3918ec[_0xb398('0x132')],'count':_0x2135ea['length'],'rows':_0x2135ea});}})[_0xb398('0x5d')](handleError(_0x4373c0,null));};exports[_0xb398('0x133')]=function(_0x149c4b,_0x2c6a57){var _0x43e299={'raw':![],'where':{}};var _0x4e272b={};var _0x332c16={'count':0x0,'rows':[]};return db[_0xb398('0x60')][_0xb398('0x78')]({'where':{'id':_0x149c4b['params']['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x2c6a57,null))[_0xb398('0x1a')](function(_0x3609f2){if(_0x3609f2){_0x4e272b[_0xb398('0x42')]=_[_0xb398('0x4e')](db['ChatOfflineMessage'][_0xb398('0x49')]);_0x4e272b[_0xb398('0x4d')]=_['keys'](_0x149c4b[_0xb398('0x4d')]);_0x4e272b[_0xb398('0x4f')]=_[_0xb398('0x50')](_0x4e272b['model'],_0x4e272b[_0xb398('0x4d')]);_0x43e299[_0xb398('0x51')]=_[_0xb398('0x50')](_0x4e272b[_0xb398('0x42')],qs['fields'](_0x149c4b[_0xb398('0x4d')][_0xb398('0x52')]));_0x43e299[_0xb398('0x51')]=_0x43e299[_0xb398('0x51')]['length']?_0x43e299[_0xb398('0x51')]:_0x4e272b['model'];if(!_0x149c4b[_0xb398('0x4d')][_0xb398('0x79')](_0xb398('0x7a'))){_0x43e299['limit']=qs[_0xb398('0x29')](_0x149c4b[_0xb398('0x4d')][_0xb398('0x29')]);_0x43e299['offset']=qs[_0xb398('0x28')](_0x149c4b[_0xb398('0x4d')]['offset']);}_0x43e299[_0xb398('0x53')]=qs['sort'](_0x149c4b[_0xb398('0x4d')][_0xb398('0x54')]);_0x43e299[_0xb398('0x55')]=qs[_0xb398('0x4f')](_['pick'](_0x149c4b[_0xb398('0x4d')],_0x4e272b[_0xb398('0x4f')]));_0x43e299[_0xb398('0x55')][_0xb398('0x75')]=_0x3609f2['id'];if(_0x149c4b[_0xb398('0x4d')][_0xb398('0x59')]){_0x43e299['where']=_[_0xb398('0x57')](_0x43e299[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0x43e299['attributes'],function(_0x21451a){var _0x5c7cdc={};_0x5c7cdc[_0x21451a]={'$like':'%'+_0x149c4b[_0xb398('0x4d')]['filter']+'%'};return _0x5c7cdc;})});}_0x43e299=_[_0xb398('0x57')]({},_0x43e299,_0x149c4b['options']);return db[_0xb398('0xe9')][_0xb398('0x2a')]({'where':_0x43e299['where']})[_0xb398('0x1a')](function(_0x39485c){_0x332c16['count']=_0x39485c;if(_0x149c4b[_0xb398('0x4d')][_0xb398('0x5a')]){_0x43e299[_0xb398('0x5b')]=[{'all':!![]}];}else{_0x43e299['include']=[{'model':db[_0xb398('0xa7')],'as':_0xb398('0x105'),'required':![]},{'model':db['Attachment'],'as':_0xb398('0x134'),'required':![]}];}return db[_0xb398('0xe9')][_0xb398('0x5c')](_0x43e299);})[_0xb398('0x1a')](function(_0xe5cef6){_0x332c16['rows']=_0xe5cef6;return _0x332c16;});}})[_0xb398('0x1a')](respondWithFilteredResult(_0x2c6a57,_0x43e299))[_0xb398('0x5d')](handleError(_0x2c6a57,null));};exports['addAgents']=function(_0x3d18d,_0x29d122){return db[_0xb398('0x60')][_0xb398('0x63')]({'where':{'id':_0x3d18d[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x29d122,null))['then'](function(_0x3e6531){if(_0x3e6531){return _0x3e6531[_0xb398('0x135')](_0x3d18d[_0xb398('0x65')][_0xb398('0x103')],_[_0xb398('0x104')](_0x3d18d[_0xb398('0x65')],[_0xb398('0x103'),'id'])||{})[_0xb398('0x136')](function(_0x20fbec){for(var _0x3a9c9f=0x0;_0x3a9c9f<_0x3d18d[_0xb398('0x65')][_0xb398('0x103')][_0xb398('0x61')];_0x3a9c9f+=0x1){socket[_0xb398('0x137')]('userChatWebsite:save',{'UserId':Number(_0x3d18d['body'][_0xb398('0x103')][_0x3a9c9f]),'ChatWebsiteId':Number(_0x3d18d[_0xb398('0x72')]['id'])});}return _0x20fbec;});}})[_0xb398('0x1a')](respondWithResult(_0x29d122,null))['catch'](handleError(_0x29d122,null));};exports[_0xb398('0x138')]=function(_0x3417e4,_0x46e1dd){return db[_0xb398('0x60')]['find']({'where':{'id':_0x3417e4[_0xb398('0x72')]['id']}})[_0xb398('0x1a')](handleEntityNotFound(_0x46e1dd,null))[_0xb398('0x1a')](function(_0x4d3114){if(_0x4d3114){return _0x4d3114[_0xb398('0x138')](_0x3417e4[_0xb398('0x4d')][_0xb398('0x103')])[_0xb398('0x1a')](function(){if(_[_0xb398('0x139')](_0x3417e4[_0xb398('0x4d')]['ids'])){for(var _0x3fb664=0x0;_0x3fb664<_0x3417e4['query'][_0xb398('0x103')]['length'];_0x3fb664+=0x1){socket[_0xb398('0x137')](_0xb398('0x13a'),{'UserId':Number(_0x3417e4['query'][_0xb398('0x103')][_0x3fb664]),'ChatWebsiteId':Number(_0x3417e4[_0xb398('0x72')]['id'])});}}else{socket[_0xb398('0x137')](_0xb398('0x13a'),{'UserId':Number(_0x3417e4[_0xb398('0x4d')][_0xb398('0x103')]),'ChatWebsiteId':Number(_0x3417e4[_0xb398('0x72')]['id'])});}});}})[_0xb398('0x1a')](respondWithStatusCode(_0x46e1dd,null))[_0xb398('0x5d')](handleError(_0x46e1dd,null));};exports[_0xb398('0x13b')]=function(_0x175876,_0x507769){var _0xe82584={};var _0x1e533a={};var _0x445be1;var _0x3f48ed;return db[_0xb398('0x60')]['findOne']({'where':{'id':_0x175876['params']['id']}})['then'](handleEntityNotFound(_0x507769,null))[_0xb398('0x1a')](function(_0x28a35a){if(_0x28a35a){_0x445be1=_0x28a35a;_0x1e533a[_0xb398('0x42')]=_[_0xb398('0x4e')](db[_0xb398('0xcc')]['rawAttributes']);_0x1e533a['query']=_[_0xb398('0x4e')](_0x175876[_0xb398('0x4d')]);_0x1e533a[_0xb398('0x4f')]=_['intersection'](_0x1e533a[_0xb398('0x42')],_0x1e533a['query']);_0xe82584[_0xb398('0x51')]=_[_0xb398('0x50')](_0x1e533a[_0xb398('0x42')],qs['fields'](_0x175876['query'][_0xb398('0x52')]));_0xe82584[_0xb398('0x51')]=_0xe82584[_0xb398('0x51')][_0xb398('0x61')]?_0xe82584[_0xb398('0x51')]:_0x1e533a[_0xb398('0x42')];_0xe82584[_0xb398('0x53')]=qs[_0xb398('0x54')](_0x175876[_0xb398('0x4d')]['sort']);_0xe82584[_0xb398('0x55')]=qs['filters'](_[_0xb398('0x56')](_0x175876['query'],_0x1e533a[_0xb398('0x4f')]));if(_0x175876['query'][_0xb398('0x59')]){_0xe82584[_0xb398('0x55')]=_[_0xb398('0x57')](_0xe82584[_0xb398('0x55')],{'$or':_[_0xb398('0x4c')](_0xe82584[_0xb398('0x51')],function(_0x1b58f5){var _0x399818={};_0x399818[_0x1b58f5]={'$like':'%'+_0x175876[_0xb398('0x4d')]['filter']+'%'};return _0x399818;})});}_0xe82584=_[_0xb398('0x57')]({},_0xe82584,_0x175876['options']);return _0x445be1[_0xb398('0x13b')](_0xe82584);}})[_0xb398('0x1a')](function(_0x203002){if(_0x203002){_0x3f48ed=_0x203002[_0xb398('0x61')];if(!_0x175876['query']['hasOwnProperty'](_0xb398('0x7a'))){_0xe82584[_0xb398('0x29')]=qs['limit'](_0x175876[_0xb398('0x4d')][_0xb398('0x29')]);_0xe82584[_0xb398('0x28')]=qs[_0xb398('0x28')](_0x175876[_0xb398('0x4d')][_0xb398('0x28')]);}return _0x445be1['getAgents'](_0xe82584);}})[_0xb398('0x1a')](function(_0x4f613c){if(_0x4f613c){return _0x4f613c?{'count':_0x3f48ed,'rows':_0x4f613c}:null;}})[_0xb398('0x1a')](respondWithResult(_0x507769,null))[_0xb398('0x5d')](handleError(_0x507769,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b0c379c..51800dd 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 _0x207d=['../../mysqldb','ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4fdbf2,_0x152a6e){var _0x12c62d=function(_0x4b668a){while(--_0x4b668a){_0x4fdbf2['push'](_0x4fdbf2['shift']());}};_0x12c62d(++_0x152a6e);}(_0x207d,0x10d));var _0xd207=function(_0x48c2ea,_0x40f59d){_0x48c2ea=_0x48c2ea-0x0;var _0x33874d=_0x207d[_0x48c2ea];return _0x33874d;};'use strict';var EventEmitter=require(_0xd207('0x0'));var ChatWebsite=require(_0xd207('0x1'))['db'][_0xd207('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd207('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd207('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4505f2){return function(_0x422501,_0x5351ed,_0x36e4cf){ChatWebsiteEvents[_0xd207('0x5')](_0x4505f2+':'+_0x422501['id'],_0x422501);ChatWebsiteEvents[_0xd207('0x5')](_0x4505f2,_0x422501);_0x36e4cf(null);};}for(var e in events){if(events[_0xd207('0x6')](e)){var event=events[e];ChatWebsite[_0xd207('0x7')](e,emitEvent(event));}}module[_0xd207('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xf29c=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x49fcd7,_0x15a6c0){var _0x451f00=function(_0x27698c){while(--_0x27698c){_0x49fcd7['push'](_0x49fcd7['shift']());}};_0x451f00(++_0x15a6c0);}(_0xf29c,0xc7));var _0xcf29=function(_0x5b7fb2,_0x4baf8b){_0x5b7fb2=_0x5b7fb2-0x0;var _0x58b71f=_0xf29c[_0x5b7fb2];return _0x58b71f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xcf29('0x0'))['db'][_0xcf29('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcf29('0x2')](0x0);var events={'afterCreate':_0xcf29('0x3'),'afterUpdate':_0xcf29('0x4'),'afterDestroy':_0xcf29('0x5')};function emitEvent(_0x46fd65){return function(_0x148004,_0x1f2b5d,_0x1a85d7){ChatWebsiteEvents[_0xcf29('0x6')](_0x46fd65+':'+_0x148004['id'],_0x148004);ChatWebsiteEvents[_0xcf29('0x6')](_0x46fd65,_0x148004);_0x1a85d7(null);};}for(var e in events){if(events[_0xcf29('0x7')](e)){var event=events[e];ChatWebsite[_0xcf29('0x8')](e,emitEvent(event));}}module[_0xcf29('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index f64c1ec..fdd4bbb 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 _0x9e05=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','api'];(function(_0x3bbe0a,_0x552745){var _0x3e5737=function(_0x21f7ad){while(--_0x21f7ad){_0x3bbe0a['push'](_0x3bbe0a['shift']());}};_0x3e5737(++_0x552745);}(_0x9e05,0x8d));var _0x59e0=function(_0x1464f5,_0x8eef1d){_0x1464f5=_0x1464f5-0x0;var _0x31d036=_0x9e05[_0x1464f5];return _0x31d036;};'use strict';var _=require(_0x59e0('0x0'));var util=require(_0x59e0('0x1'));var logger=require('../../config/logger')(_0x59e0('0x2'));var moment=require('moment');var BPromise=require(_0x59e0('0x3'));var rp=require(_0x59e0('0x4'));var fs=require('fs');var path=require(_0x59e0('0x5'));var rimraf=require(_0x59e0('0x6'));var config=require(_0x59e0('0x7'));var attributes=require(_0x59e0('0x8'));module['exports']=function(_0x283399,_0x38f10){return _0x283399[_0x59e0('0x9')](_0x59e0('0xa'),attributes,{'tableName':_0x59e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x085f=['./chatWebsite.attributes','chat_websites','lodash','../../config/logger','bluebird','path','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x085f,0x12f));var _0xf085=function(_0x45447c,_0x447cb8){_0x45447c=_0x45447c-0x0;var _0x20bd49=_0x085f[_0x45447c];return _0x20bd49;};'use strict';var _=require(_0xf085('0x0'));var util=require('util');var logger=require(_0xf085('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf085('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf085('0x3'));var rimraf=require('rimraf');var config=require(_0xf085('0x4'));var attributes=require(_0xf085('0x5'));module['exports']=function(_0x538b52,_0x4069de){return _0x538b52['define']('ChatWebsite',attributes,{'tableName':_0xf085('0x6'),'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 b17a093..59fd53a 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 _0x23d4=['redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x23d4,0x91));var _0x423d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x423d('0x0'));var util=require(_0x423d('0x1'));var moment=require('moment');var BPromise=require(_0x423d('0x2'));var rs=require(_0x423d('0x3'));var fs=require('fs');var Redis=require(_0x423d('0x4'));var db=require(_0x423d('0x5'))['db'];var utils=require(_0x423d('0x6'));var logger=require('../../config/logger')(_0x423d('0x7'));var config=require('../../config/environment');var jayson=require(_0x423d('0x8'));var client=jayson[_0x423d('0x9')][_0x423d('0xa')]({'port':0x232a});config[_0x423d('0xb')]=_[_0x423d('0xc')](config['redis'],{'host':_0x423d('0xd'),'port':0x18eb});var socket=require(_0x423d('0xe'))(new Redis(config[_0x423d('0xb')]));require(_0x423d('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ec8ee,_0x41e799,_0x2bb701){return new BPromise(function(_0x3941df,_0x259458){return client[_0x423d('0x10')](_0x5ec8ee,_0x2bb701)['then'](function(_0x7f39e3){logger[_0x423d('0x11')](_0x423d('0x12'),_0x41e799,_0x423d('0x13'));logger['debug'](_0x423d('0x14'),_0x41e799,'request\x20sent',JSON[_0x423d('0x15')](_0x7f39e3));if(_0x7f39e3[_0x423d('0x16')]){if(_0x7f39e3['error']['code']===0x1f4){logger[_0x423d('0x16')](_0x423d('0x12'),_0x41e799,_0x7f39e3[_0x423d('0x16')][_0x423d('0x17')]);return _0x259458(_0x7f39e3['error'][_0x423d('0x17')]);}logger[_0x423d('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x41e799,_0x7f39e3[_0x423d('0x16')]['message']);return _0x3941df(_0x7f39e3[_0x423d('0x16')][_0x423d('0x17')]);}else{logger[_0x423d('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x41e799,_0x423d('0x13'));_0x3941df(_0x7f39e3[_0x423d('0x18')][_0x423d('0x17')]);}})[_0x423d('0x19')](function(_0x3ea7ce){logger['error'](_0x423d('0x12'),_0x41e799,_0x3ea7ce);_0x259458(_0x3ea7ce);});});} \ No newline at end of file +var _0x8f71=['request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register'];(function(_0x502ffb,_0x39df5c){var _0x5e80d3=function(_0xc6c5e9){while(--_0xc6c5e9){_0x502ffb['push'](_0x502ffb['shift']());}};_0x5e80d3(++_0x39df5c);}(_0x8f71,0xba));var _0x18f7=function(_0x19a6d4,_0x445a4e){_0x19a6d4=_0x19a6d4-0x0;var _0x1d056b=_0x8f71[_0x19a6d4];return _0x1d056b;};'use strict';var _=require(_0x18f7('0x0'));var util=require(_0x18f7('0x1'));var moment=require('moment');var BPromise=require(_0x18f7('0x2'));var rs=require(_0x18f7('0x3'));var fs=require('fs');var Redis=require(_0x18f7('0x4'));var db=require(_0x18f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x18f7('0x6'));var config=require(_0x18f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x18f7('0x8')][_0x18f7('0x9')]({'port':0x232a});config[_0x18f7('0xa')]=_[_0x18f7('0xb')](config[_0x18f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x18f7('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x18f7('0xd')](socket);function respondWithRpcPromise(_0x12f78b,_0xfd81e7,_0xb7499b){return new BPromise(function(_0x13e7dd,_0x43afa2){return client[_0x18f7('0xe')](_0x12f78b,_0xb7499b)['then'](function(_0x3f061c){logger[_0x18f7('0xf')](_0x18f7('0x10'),_0xfd81e7,'request\x20sent');logger['debug'](_0x18f7('0x11'),_0xfd81e7,'request\x20sent',JSON[_0x18f7('0x12')](_0x3f061c));if(_0x3f061c[_0x18f7('0x13')]){if(_0x3f061c['error'][_0x18f7('0x14')]===0x1f4){logger[_0x18f7('0x13')](_0x18f7('0x10'),_0xfd81e7,_0x3f061c[_0x18f7('0x13')][_0x18f7('0x15')]);return _0x43afa2(_0x3f061c[_0x18f7('0x13')][_0x18f7('0x15')]);}logger[_0x18f7('0x13')](_0x18f7('0x10'),_0xfd81e7,_0x3f061c['error'][_0x18f7('0x15')]);return _0x13e7dd(_0x3f061c['error']['message']);}else{logger[_0x18f7('0xf')](_0x18f7('0x10'),_0xfd81e7,_0x18f7('0x16'));_0x13e7dd(_0x3f061c[_0x18f7('0x17')][_0x18f7('0x15')]);}})[_0x18f7('0x18')](function(_0x1ec19b){logger[_0x18f7('0x13')](_0x18f7('0x10'),_0xfd81e7,_0x1ec19b);_0x43afa2(_0x1ec19b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7a2c4ca..adf6154 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 _0xace0=['removeListener','length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x536104,_0x223dcc){var _0x395726=function(_0x3ffdd8){while(--_0x3ffdd8){_0x536104['push'](_0x536104['shift']());}};_0x395726(++_0x223dcc);}(_0xace0,0x1d8));var _0x0ace=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xace0[_0x18f152];return _0xa10b34;};'use strict';var ChatWebsiteEvents=require(_0x0ace('0x0'));var events=[_0x0ace('0x1'),'remove',_0x0ace('0x2')];function createListener(_0xf85e41,_0x14c63f){return function(_0x464fc8){_0x14c63f[_0x0ace('0x3')](_0xf85e41,_0x464fc8);};}function removeListener(_0x17affe,_0x540018){return function(){ChatWebsiteEvents[_0x0ace('0x4')](_0x17affe,_0x540018);};}exports['register']=function(_0x25d231){for(var _0x11bffd=0x0,_0x4c3291=events[_0x0ace('0x5')];_0x11bffd<_0x4c3291;_0x11bffd++){var _0x3999fa=events[_0x11bffd];var _0x23d476=createListener(_0x0ace('0x6')+_0x3999fa,_0x25d231);ChatWebsiteEvents['on'](_0x3999fa,_0x23d476);}}; \ No newline at end of file +var _0xbf32=['removeListener','length','chatWebsite:','save','remove'];(function(_0x37af6f,_0x36e415){var _0x1cb977=function(_0x160d3a){while(--_0x160d3a){_0x37af6f['push'](_0x37af6f['shift']());}};_0x1cb977(++_0x36e415);}(_0xbf32,0x14d));var _0x2bf3=function(_0x28e255,_0x4a8144){_0x28e255=_0x28e255-0x0;var _0x1146db=_0xbf32[_0x28e255];return _0x1146db;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x2bf3('0x0'),_0x2bf3('0x1'),'update'];function createListener(_0x59e580,_0xe00d5c){return function(_0x3dc606){_0xe00d5c['emit'](_0x59e580,_0x3dc606);};}function removeListener(_0x533781,_0x2fc49a){return function(){ChatWebsiteEvents[_0x2bf3('0x2')](_0x533781,_0x2fc49a);};}exports['register']=function(_0x467ae){for(var _0x1871da=0x0,_0x39beee=events[_0x2bf3('0x3')];_0x1871da<_0x39beee;_0x1871da++){var _0x418704=events[_0x1871da];var _0x3c0124=createListener(_0x2bf3('0x4')+_0x418704,_0x467ae);ChatWebsiteEvents['on'](_0x418704,_0x3c0124);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 3999d96..c70876a 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['url','URL','replace','localhost','test','([\x5cw]+)','../../../utils/misc','escapeRegExp'];(function(_0xd77fa2,_0x489a23){var _0x101679=function(_0xebb241){while(--_0xebb241){_0xd77fa2['push'](_0xd77fa2['shift']());}};_0x101679(++_0x489a23);}(_0xdb28,0x106));var _0x8db2=function(_0x5f1939,_0x54005b){_0x5f1939=_0x5f1939-0x0;var _0x694f4f=_0xdb28[_0x5f1939];return _0x694f4f;};var escapeRegExp=require(_0x8db2('0x0'))[_0x8db2('0x1')];var URL=require(_0x8db2('0x2'))[_0x8db2('0x3')];function testWildcardValidity(_0x585da1){var _0x1f4c45=!![];try{new URL(_0x585da1[_0x8db2('0x4')]('*',_0x8db2('0x5')));}catch(_0x4426fe){_0x1f4c45=![];}return _0x1f4c45&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x8db2('0x6')](_0x585da1);}function testWebsiteWithWildcard(_0x52bf99,_0x21a03e){var _0x1d2dd3;var _0x5f42ee=escapeRegExp(_0x52bf99['trim']()[_0x8db2('0x4')](/\/$/,''))[_0x8db2('0x4')]('\x5c*',_0x8db2('0x7'));try{new URL(_0x52bf99[_0x8db2('0x4')]('\x5c*',_0x8db2('0x5')));_0x1d2dd3=new RegExp(_0x5f42ee)[_0x8db2('0x6')](_0x21a03e);}catch(_0x126c78){_0x1d2dd3=![];}return _0x1d2dd3;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x7d14=['replace','test','localhost','exports','../../../utils/misc','escapeRegExp','URL'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x7d14,0x6d));var _0x47d1=function(_0x1aa47a,_0x2ca5bb){_0x1aa47a=_0x1aa47a-0x0;var _0xcac733=_0x7d14[_0x1aa47a];return _0xcac733;};var escapeRegExp=require(_0x47d1('0x0'))[_0x47d1('0x1')];var URL=require('url')[_0x47d1('0x2')];function testWildcardValidity(_0x325761){var _0x21f244=!![];try{new URL(_0x325761[_0x47d1('0x3')]('*','localhost'));}catch(_0x37d8f2){_0x21f244=![];}return _0x21f244&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x47d1('0x4')](_0x325761);}function testWebsiteWithWildcard(_0x8f3654,_0x244bbf){var _0x1b2f47;var _0x550ee2=escapeRegExp(_0x8f3654['trim']()['replace'](/\/$/,''))[_0x47d1('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x8f3654[_0x47d1('0x3')]('\x5c*',_0x47d1('0x5')));_0x1b2f47=new RegExp(_0x550ee2)[_0x47d1('0x4')](_0x244bbf);}catch(_0x175dd2){_0x1b2f47=![];}return _0x1b2f47;}module[_0x47d1('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index e177879..b33ccf7 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 _0xba8b=['getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','root','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x151fbd,_0x235580){var _0x450f5f=function(_0x41b697){while(--_0x41b697){_0x151fbd['push'](_0x151fbd['shift']());}};_0x450f5f(++_0x235580);}(_0xba8b,0x165));var _0xbba8=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xba8b[_0x5a776b];return _0xbbef59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbba8('0x0'));var timeout=require(_0xbba8('0x1'));var express=require(_0xbba8('0x2'));var router=express[_0xbba8('0x3')]();var fs_extra=require(_0xbba8('0x4'));var auth=require(_0xbba8('0x5'));var interaction=require(_0xbba8('0x6'));var config=require(_0xbba8('0x7'));var controller=require(_0xbba8('0x8'));router[_0xbba8('0x9')]('/',auth[_0xbba8('0xa')](),controller['index']);router['get'](_0xbba8('0xb'),auth['isAuthenticated'](),controller[_0xbba8('0xc')]);router[_0xbba8('0x9')](_0xbba8('0xd'),auth[_0xbba8('0xa')](),controller[_0xbba8('0xe')]);router['get'](_0xbba8('0xf'),auth['isAuthenticated'](),controller[_0xbba8('0x10')]);router[_0xbba8('0x9')](_0xbba8('0x11'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x12')]);router[_0xbba8('0x9')]('/:id/logo',controller[_0xbba8('0x13')]);router['get'](_0xbba8('0x14'),controller[_0xbba8('0x15')]);router[_0xbba8('0x9')]('/:id/customer_avatar',controller[_0xbba8('0x16')]);router['get'](_0xbba8('0x17'),controller['getSystemAvatar']);router[_0xbba8('0x9')](_0xbba8('0x18'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x19')]);router['get'](_0xbba8('0x1a'),controller[_0xbba8('0x1b')]);router[_0xbba8('0x9')](_0xbba8('0x1c'),auth['isAuthenticated'](),controller['getApplications']);router[_0xbba8('0x9')](_0xbba8('0x1d'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x1e')]);router[_0xbba8('0x9')](_0xbba8('0x1f'),controller[_0xbba8('0x20')]);router[_0xbba8('0x9')](_0xbba8('0x21'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x22')]);router['get'](_0xbba8('0x23'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x24')]);router[_0xbba8('0x25')]('/',auth[_0xbba8('0xa')](),controller[_0xbba8('0x26')]);router[_0xbba8('0x25')](_0xbba8('0xf'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x27')]);router[_0xbba8('0x25')](_0xbba8('0x11'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x28')]);var upload=multer({'storage':multer[_0xbba8('0x29')]({'destination':function(_0x52b8e9,_0x2282c5,_0x45303a){_0x45303a(null,path[_0xbba8('0x2a')](config['root'],_0xbba8('0x2b')));},'filename':function(_0x296ee6,_0x21e616,_0x3ab44b){_0x3ab44b(null,util[_0xbba8('0x2c')](_0xbba8('0x2d'),Date[_0xbba8('0x2e')](),_0x21e616[_0xbba8('0x2f')]));}})});router[_0xbba8('0x25')]('/:id/logo',upload[_0xbba8('0x30')](_0xbba8('0x31')),controller[_0xbba8('0x32')]);var upload=multer({'storage':multer[_0xbba8('0x29')]({'destination':function(_0x11b1b6,_0x81a21c,_0x40c53d){_0x40c53d(null,path['join'](config[_0xbba8('0x33')],'server/files/images/avatars/'));},'filename':function(_0x384ad3,_0x446cc2,_0x3fa6a9){_0x3fa6a9(null,util['format'](_0xbba8('0x2d'),Date[_0xbba8('0x2e')](),_0x446cc2[_0xbba8('0x2f')]));}})});router[_0xbba8('0x25')]('/:id/avatar',upload[_0xbba8('0x30')](_0xbba8('0x31')),controller[_0xbba8('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15a22d,_0x4a71a2,_0x569781){_0x569781(null,path['join'](config['root'],_0xbba8('0x35')));},'filename':function(_0x220907,_0x187dd4,_0x412cc8){_0x412cc8(null,util[_0xbba8('0x2c')](_0xbba8('0x2d'),Date[_0xbba8('0x2e')](),_0x187dd4[_0xbba8('0x2f')]));}})});router[_0xbba8('0x25')](_0xbba8('0x36'),upload['single'](_0xbba8('0x31')),controller[_0xbba8('0x37')]);var upload=multer({'storage':multer[_0xbba8('0x29')]({'destination':function(_0x248383,_0x491827,_0x419bcb){_0x419bcb(null,path[_0xbba8('0x2a')](config[_0xbba8('0x33')],'server/files/images/avatars/'));},'filename':function(_0x53107c,_0x3ef6ba,_0x3ff368){_0x3ff368(null,util[_0xbba8('0x2c')](_0xbba8('0x2d'),Date[_0xbba8('0x2e')](),_0x3ef6ba['originalname']));}})});router[_0xbba8('0x25')](_0xbba8('0x17'),upload[_0xbba8('0x30')](_0xbba8('0x31')),controller[_0xbba8('0x38')]);router[_0xbba8('0x25')](_0xbba8('0x39'),controller[_0xbba8('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xbba8('0x29')]({'destination':function(_0x27f182,_0x382413,_0x3fca2f){const _0x201eff=path['join'](config[_0xbba8('0x33')],_0xbba8('0x3b'),'attachments',_0xbba8('0x3c'));fs_extra[_0xbba8('0x3d')](_0x201eff,function(){_0x3fca2f(null,_0x201eff);});},'filename':function(_0x542bbd,_0x163b33,_0x12d3e8){const _0x2b4c51=_0x163b33[_0xbba8('0x2f')][_0xbba8('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x48b3d2=path['extname'](_0x2b4c51);const _0x2efaae=Date['now']()+'-'+_0x2b4c51[_0xbba8('0x3e')](_0x48b3d2,'')+_0x48b3d2;_0x12d3e8(null,_0x2efaae);}})});router[_0xbba8('0x25')](_0xbba8('0x3f'),offlineUploadMulter[_0xbba8('0x40')](),controller['offline']);router['post'](_0xbba8('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xbba8('0x25')](_0xbba8('0x1c'),auth['isAuthenticated'](),controller[_0xbba8('0x41')]);router[_0xbba8('0x25')](_0xbba8('0x1d'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x42')]);router[_0xbba8('0x25')](_0xbba8('0x23'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x43')]);router[_0xbba8('0x44')]('/:id',auth[_0xbba8('0xa')](),controller[_0xbba8('0x45')]);router['delete'](_0xbba8('0xd'),auth[_0xbba8('0xa')](),controller[_0xbba8('0x46')]);router[_0xbba8('0x47')](_0xbba8('0xf'),auth[_0xbba8('0xa')](),controller['removeDispositions']);router[_0xbba8('0x47')](_0xbba8('0x11'),auth['isAuthenticated'](),controller[_0xbba8('0x48')]);router['delete']('/:id/users',auth[_0xbba8('0xa')](),controller[_0xbba8('0x49')]);module[_0xbba8('0x4a')]=router; \ No newline at end of file +var _0x8ec9=['addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','offline','addApplications','addProactiveActions','update','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','diskStorage','join','root','format','now','originalname','file','addLogo','server/files/images/avatars/','%s-%s','single'];(function(_0x17cac9,_0x5284ed){var _0x810776=function(_0xec593c){while(--_0xec593c){_0x17cac9['push'](_0x17cac9['shift']());}};_0x810776(++_0x5284ed);}(_0x8ec9,0xa7));var _0x98ec=function(_0x5e9279,_0x5b2465){_0x5e9279=_0x5e9279-0x0;var _0x108262=_0x8ec9[_0x5e9279];return _0x108262;};'use strict';var multer=require(_0x98ec('0x0'));var util=require(_0x98ec('0x1'));var path=require(_0x98ec('0x2'));var timeout=require(_0x98ec('0x3'));var express=require(_0x98ec('0x4'));var router=express[_0x98ec('0x5')]();var fs_extra=require(_0x98ec('0x6'));var auth=require(_0x98ec('0x7'));var interaction=require(_0x98ec('0x8'));var config=require(_0x98ec('0x9'));var controller=require(_0x98ec('0xa'));router[_0x98ec('0xb')]('/',auth[_0x98ec('0xc')](),controller[_0x98ec('0xd')]);router['get']('/describe',auth[_0x98ec('0xc')](),controller[_0x98ec('0xe')]);router[_0x98ec('0xb')](_0x98ec('0xf'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x10')]);router['get'](_0x98ec('0x11'),auth['isAuthenticated'](),controller[_0x98ec('0x12')]);router[_0x98ec('0xb')](_0x98ec('0x13'),auth[_0x98ec('0xc')](),controller['getAnswers']);router[_0x98ec('0xb')](_0x98ec('0x14'),controller[_0x98ec('0x15')]);router['get']('/:id/avatar',controller[_0x98ec('0x16')]);router[_0x98ec('0xb')](_0x98ec('0x17'),controller[_0x98ec('0x18')]);router[_0x98ec('0xb')](_0x98ec('0x19'),controller[_0x98ec('0x1a')]);router['get'](_0x98ec('0x1b'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x1c')]);router['get'](_0x98ec('0x1d'),controller[_0x98ec('0x1e')]);router[_0x98ec('0xb')](_0x98ec('0x1f'),auth[_0x98ec('0xc')](),controller['getApplications']);router[_0x98ec('0xb')](_0x98ec('0x20'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x21')]);router[_0x98ec('0xb')](_0x98ec('0x22'),controller['getFields']);router[_0x98ec('0xb')](_0x98ec('0x23'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x24')]);router['get']('/:id/users',auth[_0x98ec('0xc')](),controller[_0x98ec('0x25')]);router[_0x98ec('0x26')]('/',auth[_0x98ec('0xc')](),controller[_0x98ec('0x27')]);router['post'](_0x98ec('0x11'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x28')]);router[_0x98ec('0x26')]('/:id/canned_answers',auth[_0x98ec('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x98ec('0x29')]({'destination':function(_0x281f45,_0x380542,_0x203c40){_0x203c40(null,path[_0x98ec('0x2a')](config[_0x98ec('0x2b')],'server/files/images/logos/'));},'filename':function(_0x47463c,_0x23a936,_0x325922){_0x325922(null,util[_0x98ec('0x2c')]('%s-%s',Date[_0x98ec('0x2d')](),_0x23a936[_0x98ec('0x2e')]));}})});router[_0x98ec('0x26')](_0x98ec('0x14'),upload['single'](_0x98ec('0x2f')),controller[_0x98ec('0x30')]);var upload=multer({'storage':multer[_0x98ec('0x29')]({'destination':function(_0x41f34c,_0x47cf53,_0x434ea8){_0x434ea8(null,path[_0x98ec('0x2a')](config['root'],_0x98ec('0x31')));},'filename':function(_0x122774,_0x310af9,_0x4ca92b){_0x4ca92b(null,util['format'](_0x98ec('0x32'),Date[_0x98ec('0x2d')](),_0x310af9[_0x98ec('0x2e')]));}})});router[_0x98ec('0x26')]('/:id/avatar',upload[_0x98ec('0x33')](_0x98ec('0x2f')),controller[_0x98ec('0x34')]);var upload=multer({'storage':multer[_0x98ec('0x29')]({'destination':function(_0x36f2d8,_0x5c9f65,_0x3d8421){_0x3d8421(null,path[_0x98ec('0x2a')](config[_0x98ec('0x2b')],_0x98ec('0x31')));},'filename':function(_0x2f9bc9,_0x408081,_0x36fe53){_0x36fe53(null,util['format']('%s-%s',Date['now'](),_0x408081['originalname']));}})});router[_0x98ec('0x26')]('/:id/customer_avatar',upload[_0x98ec('0x33')](_0x98ec('0x2f')),controller[_0x98ec('0x35')]);var upload=multer({'storage':multer[_0x98ec('0x29')]({'destination':function(_0x2dd92d,_0x14eee5,_0x42ac9a){_0x42ac9a(null,path[_0x98ec('0x2a')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x559bc4,_0x37f47d,_0x571ee7){_0x571ee7(null,util[_0x98ec('0x2c')](_0x98ec('0x32'),Date[_0x98ec('0x2d')](),_0x37f47d[_0x98ec('0x2e')]));}})});router[_0x98ec('0x26')](_0x98ec('0x19'),upload[_0x98ec('0x33')](_0x98ec('0x2f')),controller[_0x98ec('0x36')]);router['post'](_0x98ec('0x37'),controller[_0x98ec('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x98ec('0x29')]({'destination':function(_0x1b5e14,_0x10dbb8,_0x1b001e){const _0x5297c2=path[_0x98ec('0x2a')](config['root'],_0x98ec('0x39'),_0x98ec('0x3a'),_0x98ec('0x3b'));fs_extra['ensureDir'](_0x5297c2,function(){_0x1b001e(null,_0x5297c2);});},'filename':function(_0x28daaf,_0xcb725f,_0xb92b23){const _0x213521=_0xcb725f['originalname'][_0x98ec('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x477395=path[_0x98ec('0x3d')](_0x213521);const _0x43d70d=Date[_0x98ec('0x2d')]()+'-'+_0x213521[_0x98ec('0x3c')](_0x477395,'')+_0x477395;_0xb92b23(null,_0x43d70d);}})});router['post'](_0x98ec('0x3e'),offlineUploadMulter['any'](),controller[_0x98ec('0x3f')]);router[_0x98ec('0x26')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x98ec('0x26')]('/:id/applications',auth[_0x98ec('0xc')](),controller[_0x98ec('0x40')]);router[_0x98ec('0x26')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x98ec('0x41')]);router['post']('/:id/users',auth[_0x98ec('0xc')](),controller['addAgents']);router['put'](_0x98ec('0xf'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x42')]);router[_0x98ec('0x43')]('/:id',auth['isAuthenticated'](),controller[_0x98ec('0x44')]);router['delete'](_0x98ec('0x11'),auth[_0x98ec('0xc')](),controller[_0x98ec('0x45')]);router[_0x98ec('0x43')](_0x98ec('0x13'),auth[_0x98ec('0xc')](),controller['removeAnswers']);router[_0x98ec('0x43')](_0x98ec('0x46'),auth['isAuthenticated'](),controller[_0x98ec('0x47')]);module[_0x98ec('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index fa3308b..52119cb 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 _0x129c=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x50fbb3,_0x44146c){var _0x2f8b5e=function(_0x114958){while(--_0x114958){_0x50fbb3['push'](_0x50fbb3['shift']());}};_0x2f8b5e(++_0x44146c);}(_0x129c,0x15a));var _0xc129=function(_0x53c78e,_0x288d3d){_0x53c78e=_0x53c78e-0x0;var _0x57eee6=_0x129c[_0x53c78e];return _0x57eee6;};var beaverLogger=require(_0xc129('0x0'));var express=require(_0xc129('0x1'));var auth=require(_0xc129('0x2'));var config=require(_0xc129('0x3'));var router=express[_0xc129('0x4')]();var isProduction=config[_0xc129('0x5')]===_0xc129('0x6')||![];function clientSideLogs(_0x34b9a2,_0x284667,_0x22e71c){var _0x530b03=_0x34b9a2[_0xc129('0x7')][_0xc129('0x8')](_0xc129('0x9'));if(!_0x530b03){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc129('0xa')]({'uri':_0xc129('0xb'),'logger':_0x530b03,'enableCors':!isProduction})(_0x34b9a2,_0x284667,_0x22e71c);}router[_0xc129('0xc')](auth[_0xc129('0xd')](),clientSideLogs);module[_0xc129('0xe')]=router; \ No newline at end of file +var _0x1efd=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x376f50,_0x1b6855){var _0x1c5f2e=function(_0x50adf8){while(--_0x50adf8){_0x376f50['push'](_0x376f50['shift']());}};_0x1c5f2e(++_0x1b6855);}(_0x1efd,0x1b1));var _0xd1ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1efd[_0x321bb2];return _0x9c12ed;};var beaverLogger=require(_0xd1ef('0x0'));var express=require(_0xd1ef('0x1'));var auth=require(_0xd1ef('0x2'));var config=require(_0xd1ef('0x3'));var router=express[_0xd1ef('0x4')]();var isProduction=config[_0xd1ef('0x5')]===_0xd1ef('0x6')||![];function clientSideLogs(_0x3b65c5,_0x84acd2,_0x29a935){var _0x5abd43=_0x3b65c5['app']['get'](_0xd1ef('0x7'));if(!_0x5abd43){throw new Error(_0xd1ef('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xd1ef('0x9'),'logger':_0x5abd43,'enableCors':!isProduction})(_0x3b65c5,_0x84acd2,_0x29a935);}router[_0xd1ef('0xa')](auth[_0xd1ef('0xb')](),clientSideLogs);module[_0xd1ef('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 66564df..7e95244 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 _0x2a14=['TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x29e886,_0x3cebe3){var _0x342d00=function(_0x2e96d8){while(--_0x2e96d8){_0x29e886['push'](_0x29e886['shift']());}};_0x342d00(++_0x3cebe3);}(_0x2a14,0x1e6));var _0x42a1=function(_0x54e08f,_0x509b63){_0x54e08f=_0x54e08f-0x0;var _0xf17f75=_0x2a14[_0x54e08f];return _0xf17f75;};'use strict';var Sequelize=require(_0x42a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x42a1('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x42a1('0x2'),_0x42a1('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x42a1('0x4')](_0x42a1('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x42a1('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x42a1('0x1')],'comment':_0x42a1('0x6')},'data3':{'type':Sequelize[_0x42a1('0x1')],'comment':_0x42a1('0x7')},'data4':{'type':Sequelize[_0x42a1('0x1')],'comment':_0x42a1('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x42a1('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x42a1('0x9')],'comment':_0x42a1('0xa')}}; \ No newline at end of file +var _0x5f54=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0xb44dbb,_0x3f0bd3){var _0x46f99c=function(_0x145809){while(--_0x145809){_0xb44dbb['push'](_0xb44dbb['shift']());}};_0x46f99c(++_0x3f0bd3);}(_0x5f54,0x1c5));var _0x45f5=function(_0x38f11,_0x1c486d){_0x38f11=_0x38f11-0x0;var _0x57fab9=_0x5f54[_0x38f11];return _0x57fab9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x45f5('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x45f5('0x1')]('AmazonAWS',_0x45f5('0x2'),_0x45f5('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x45f5('0x1')](_0x45f5('0x4'),_0x45f5('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x45f5('0x6')},'data2':{'type':Sequelize[_0x45f5('0x0')],'comment':_0x45f5('0x7')},'data3':{'type':Sequelize[_0x45f5('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x45f5('0x0')],'comment':_0x45f5('0x8')},'data5':{'type':Sequelize[_0x45f5('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x45f5('0x9')],'comment':_0x45f5('0xa')},'data7':{'type':Sequelize[_0x45f5('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c14265f..8f0107c 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 _0xe977=['id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','limit','set','Content-Range','update','then','error','stack','name','send','slice','index','CloudProvider','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','count','rows','service','data3','show','includeAll','include','merge','find','MicrosoftAzure','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','body','encryptString','params','catch','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','parse','state','base64','toString','ascii','isValidIdToken'];(function(_0x5bf35e,_0x4ccc17){var _0x35b3d7=function(_0xefa9e4){while(--_0xefa9e4){_0x5bf35e['push'](_0x5bf35e['shift']());}};_0x35b3d7(++_0x4ccc17);}(_0xe977,0xc9));var _0x7e97=function(_0x5201f3,_0x202dea){_0x5201f3=_0x5201f3-0x0;var _0x2c7b1c=_0xe977[_0x5201f3];return _0x2c7b1c;};'use strict';var _=require(_0x7e97('0x0'));var Redis=require(_0x7e97('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x7e97('0x2'));var config=require(_0x7e97('0x3'));var logger=require(_0x7e97('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x7e97('0x5'));config['redis']=_[_0x7e97('0x6')](config[_0x7e97('0x7')],{'host':_0x7e97('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x7e97('0x7')]);function respondWithStatusCode(_0x248ec1,_0x41c340){_0x41c340=_0x41c340||0xcc;return function(_0x484b8d){if(_0x484b8d){return _0x248ec1[_0x7e97('0x9')](_0x41c340);}return _0x248ec1[_0x7e97('0xa')](_0x41c340)[_0x7e97('0xb')]();};}function respondWithResult(_0x38f3c1,_0x531ee5){_0x531ee5=_0x531ee5||0xc8;return function(_0x506fe9){if(_0x506fe9){return _0x38f3c1[_0x7e97('0xa')](_0x531ee5)[_0x7e97('0xc')](_0x506fe9);}};}function respondWithFilteredResult(_0x747d36,_0x92d5f0){return function(_0x4d5967){if(_0x4d5967){var _0x45467e=typeof _0x92d5f0[_0x7e97('0xd')]==='undefined'&&typeof _0x92d5f0[_0x7e97('0xe')]==='undefined';var _0x3475bc=_0x4d5967['count'];var _0x3b6221=_0x45467e?0x0:_0x92d5f0['offset'];var _0x3275ec=_0x45467e?_0x4d5967['count']:_0x92d5f0[_0x7e97('0xd')]+_0x92d5f0[_0x7e97('0xe')];var _0x41c180;if(_0x3275ec>=_0x3475bc){_0x3275ec=_0x3475bc;_0x41c180=0xc8;}else{_0x41c180=0xce;}_0x747d36[_0x7e97('0xa')](_0x41c180);return _0x747d36[_0x7e97('0xf')](_0x7e97('0x10'),_0x3b6221+'-'+_0x3275ec+'/'+_0x3475bc)[_0x7e97('0xc')](_0x4d5967);}return null;};}function saveUpdates(_0x515820){return function(_0xe5c9){if(_0xe5c9){return _0xe5c9[_0x7e97('0x11')](_0x515820)[_0x7e97('0x12')](function(_0x2d96c2){return _0x2d96c2;});}return null;};}function removeEntity(_0x1e3a57){return function(_0x101b3f){if(_0x101b3f){return _0x101b3f['destroy']()[_0x7e97('0x12')](function(){_0x1e3a57[_0x7e97('0xa')](0xcc)[_0x7e97('0xb')]();});}};}function handleEntityNotFound(_0x5d1888){return function(_0x4430a6){if(!_0x4430a6){_0x5d1888[_0x7e97('0x9')](0x194);}return _0x4430a6;};}function handleError(_0x10b48c,_0x1393c6){_0x1393c6=_0x1393c6||0x1f4;return function(_0x146846){logger[_0x7e97('0x13')](_0x146846[_0x7e97('0x14')]);if(_0x146846[_0x7e97('0x15')]){delete _0x146846['name'];}_0x10b48c[_0x7e97('0xa')](_0x1393c6)[_0x7e97('0x16')](_0x146846);};}function maskClientSecret(_0x1126f7){return _['padEnd'](_0x1126f7[_0x7e97('0x17')](0x0,0x3),0x14,'*');}exports[_0x7e97('0x18')]=function(_0x365a52,_0x18702a){var _0x537711={},_0x20cd34={},_0x21287a={'count':0x0,'rows':[]};var _0x3d0db3=_['map'](db[_0x7e97('0x19')][_0x7e97('0x1a')],function(_0x588b5b){return{'name':_0x588b5b['fieldName'],'type':_0x588b5b[_0x7e97('0x1b')][_0x7e97('0x1c')]};});_0x20cd34[_0x7e97('0x1d')]=_[_0x7e97('0x1e')](_0x3d0db3,_0x7e97('0x15'));_0x20cd34[_0x7e97('0x1f')]=_[_0x7e97('0x20')](_0x365a52[_0x7e97('0x1f')]);_0x20cd34[_0x7e97('0x21')]=_[_0x7e97('0x22')](_0x20cd34[_0x7e97('0x1d')],_0x20cd34[_0x7e97('0x1f')]);_0x537711[_0x7e97('0x23')]=_[_0x7e97('0x22')](_0x20cd34[_0x7e97('0x1d')],qs[_0x7e97('0x24')](_0x365a52[_0x7e97('0x1f')]['fields']));_0x537711[_0x7e97('0x23')]=_0x537711[_0x7e97('0x23')][_0x7e97('0x25')]?_0x537711[_0x7e97('0x23')]:_0x20cd34[_0x7e97('0x1d')];if(!_0x365a52[_0x7e97('0x1f')][_0x7e97('0x26')](_0x7e97('0x27'))){_0x537711['limit']=qs[_0x7e97('0xe')](_0x365a52[_0x7e97('0x1f')][_0x7e97('0xe')]);_0x537711[_0x7e97('0xd')]=qs[_0x7e97('0xd')](_0x365a52[_0x7e97('0x1f')][_0x7e97('0xd')]);}_0x537711[_0x7e97('0x28')]=qs[_0x7e97('0x29')](_0x365a52['query'][_0x7e97('0x29')]);_0x537711[_0x7e97('0x2a')]=qs[_0x7e97('0x21')](_[_0x7e97('0x2b')](_0x365a52['query'],_0x20cd34[_0x7e97('0x21')]),_0x3d0db3);if(_0x365a52[_0x7e97('0x1f')][_0x7e97('0x2c')]){_0x537711['where']=_['merge'](_0x537711[_0x7e97('0x2a')],{'$or':_['map'](_0x3d0db3,function(_0xb943de){if(_0xb943de[_0x7e97('0x1b')]!=='VIRTUAL'){var _0x59ad0c={};_0x59ad0c[_0xb943de[_0x7e97('0x15')]]={'$like':'%'+_0x365a52[_0x7e97('0x1f')]['filter']+'%'};return _0x59ad0c;}})});}_0x537711=_['merge']({},_0x537711,_0x365a52[_0x7e97('0x2d')]);var _0x26882b={'where':_0x537711['where']};return db[_0x7e97('0x19')][_0x7e97('0x2e')](_0x26882b)['then'](function(_0x145ba0){_0x21287a[_0x7e97('0x2e')]=_0x145ba0;if(_0x365a52[_0x7e97('0x1f')]['includeAll']){_0x537711['include']=[{'all':!![]}];}return db[_0x7e97('0x19')]['findAll'](_0x537711);})[_0x7e97('0x12')](function(_0x4aeae5){_0x21287a[_0x7e97('0x2f')]=_[_0x7e97('0x1e')](_0x4aeae5,function(_0x29e70d){if(_0x29e70d[_0x7e97('0x30')]==='MicrosoftAzure'){var _0x20909e=encryptor['decryptString'](_0x29e70d[_0x7e97('0x31')]);_0x29e70d[_0x7e97('0x31')]=maskClientSecret(_0x20909e);}return _0x29e70d;});return _0x21287a;})[_0x7e97('0x12')](respondWithFilteredResult(_0x18702a,_0x537711))['catch'](handleError(_0x18702a,null));};exports[_0x7e97('0x32')]=function(_0x2aa948,_0x184d55){var _0x3f6c03={'raw':!![],'where':{'id':_0x2aa948['params']['id']}},_0x558c2e={};_0x558c2e[_0x7e97('0x1d')]=_[_0x7e97('0x20')](db['CloudProvider']['rawAttributes']);_0x558c2e[_0x7e97('0x1f')]=_[_0x7e97('0x20')](_0x2aa948[_0x7e97('0x1f')]);_0x558c2e[_0x7e97('0x21')]=_[_0x7e97('0x22')](_0x558c2e[_0x7e97('0x1d')],_0x558c2e[_0x7e97('0x1f')]);_0x3f6c03['attributes']=_[_0x7e97('0x22')](_0x558c2e['model'],qs['fields'](_0x2aa948[_0x7e97('0x1f')][_0x7e97('0x24')]));_0x3f6c03['attributes']=_0x3f6c03[_0x7e97('0x23')][_0x7e97('0x25')]?_0x3f6c03[_0x7e97('0x23')]:_0x558c2e['model'];if(_0x2aa948['query'][_0x7e97('0x33')]){_0x3f6c03[_0x7e97('0x34')]=[{'all':!![]}];}_0x3f6c03=_[_0x7e97('0x35')]({},_0x3f6c03,_0x2aa948[_0x7e97('0x2d')]);return db[_0x7e97('0x19')][_0x7e97('0x36')](_0x3f6c03)['then'](handleEntityNotFound(_0x184d55,null))[_0x7e97('0x12')](function(_0x11a087){if(_0x11a087['service']===_0x7e97('0x37')){var _0x510eec=encryptor['decryptString'](_0x11a087[_0x7e97('0x31')]);_0x11a087[_0x7e97('0x31')]=maskClientSecret(_0x510eec);}return _0x11a087;})[_0x7e97('0x12')](respondWithResult(_0x184d55,null))['catch'](handleError(_0x184d55,null));};exports[_0x7e97('0x38')]=function(_0x266dd5,_0x1ccd3d){if(!_0x266dd5['body'][_0x7e97('0x15')])throw new Error(_0x7e97('0x39'));if(!_0x266dd5['body'][_0x7e97('0x30')])throw new Error(_0x7e97('0x3a'));var _0x1eec96=db['CloudProvider'][_0x7e97('0x1a')]['service'][_0x7e97('0x3b')];if(!_0x1eec96[_0x7e97('0x3c')](_0x266dd5['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x1eec96[_0x7e97('0x3d')](',\x20'));if(_0x266dd5['body'][_0x7e97('0x30')]===_0x7e97('0x37')&&_0x266dd5[_0x7e97('0x3e')]['data3']){_0x266dd5['body'][_0x7e97('0x31')]=encryptor[_0x7e97('0x3f')](_0x266dd5['body'][_0x7e97('0x31')]);}return db[_0x7e97('0x19')]['create'](_0x266dd5[_0x7e97('0x3e')],{})['then'](respondWithResult(_0x1ccd3d,0xc9))['catch'](handleError(_0x1ccd3d,null));};exports[_0x7e97('0x11')]=function(_0x41c20c,_0x4a2e95){if(_0x41c20c[_0x7e97('0x3e')]['id']){delete _0x41c20c[_0x7e97('0x3e')]['id'];}return db[_0x7e97('0x19')][_0x7e97('0x36')]({'where':{'id':_0x41c20c[_0x7e97('0x40')]['id']}})[_0x7e97('0x12')](handleEntityNotFound(_0x4a2e95,null))[_0x7e97('0x12')](function(_0x3e51b8){if(_0x3e51b8[_0x7e97('0x30')]===_0x7e97('0x37')&&_0x41c20c[_0x7e97('0x3e')]['data3']){_0x41c20c[_0x7e97('0x3e')][_0x7e97('0x31')]=encryptor[_0x7e97('0x3f')](_0x41c20c[_0x7e97('0x3e')][_0x7e97('0x31')]);}return _0x3e51b8;})[_0x7e97('0x12')](saveUpdates(_0x41c20c[_0x7e97('0x3e')],null))[_0x7e97('0x12')](respondWithResult(_0x4a2e95,null))[_0x7e97('0x41')](handleError(_0x4a2e95,null));};exports[_0x7e97('0x42')]=function(_0x3cd7e6,_0x2a88a0){return db[_0x7e97('0x19')][_0x7e97('0x36')]({'where':{'id':_0x3cd7e6['params']['id']}})[_0x7e97('0x12')](handleEntityNotFound(_0x2a88a0,null))['then'](removeEntity(_0x2a88a0,null))['catch'](handleError(_0x2a88a0,null));};exports[_0x7e97('0x43')]=function(_0x53706c,_0x290207){return db['CloudProvider'][_0x7e97('0x44')]({'where':{'id':_0x53706c[_0x7e97('0x40')]['id']},'raw':!![]})[_0x7e97('0x12')](function(_0x116265){if(!_0x116265)return _0x290207[_0x7e97('0x9')](0x194);return{'url':oauth[_0x7e97('0x45')](_0x116265,_0x53706c[_0x7e97('0x46')]['id'])};})[_0x7e97('0x12')](respondWithResult(_0x290207,null))[_0x7e97('0x41')](handleError(_0x290207,null));};exports['oauth2MicrosoftCallback']=function(_0xb86340,_0x3e3673){var _0x529999=_0xb86340[_0x7e97('0x3e')];var _0x5c0d31;var _0x56c9b3;if(_0x529999[_0x7e97('0x13')])throw _0x529999;redis[_0x7e97('0x47')](_0x529999['state'])[_0x7e97('0x12')](function(_0x3ef634){if(!_0x3ef634)throw new Error('Invalid\x20state\x20parameter');_0x5c0d31=JSON[_0x7e97('0x48')](_0x3ef634);var _0x3bf18=Buffer['from'](_0x529999[_0x7e97('0x49')],_0x7e97('0x4a'))[_0x7e97('0x4b')](_0x7e97('0x4c'));_0x56c9b3=JSON[_0x7e97('0x48')](_0x3bf18);if(!oauth[_0x7e97('0x4d')](_0x529999[_0x7e97('0x4e')],_0x5c0d31[_0x7e97('0x4f')]))throw new Error(_0x7e97('0x50'));redis['del'](_0x529999[_0x7e97('0x49')]);return oauth[_0x7e97('0x51')](_0x529999[_0x7e97('0x52')],_0x5c0d31);})[_0x7e97('0x12')](function(_0x2ac8cd){_0x5c0d31[_0x7e97('0x53')]=_0x2ac8cd[_0x7e97('0x54')];_0x5c0d31['data6']=_0x2ac8cd['refresh_token'];return db['CloudProvider'][_0x7e97('0x11')]({'data5':_0x5c0d31[_0x7e97('0x53')],'data6':_0x5c0d31[_0x7e97('0x55')]},{'where':{'id':_0x5c0d31['id']}});})['then'](function(){oauth[_0x7e97('0x56')](_0x5c0d31);socket[_0x7e97('0x57')]('microsoftAuthorization:success',{'id':_0x56c9b3['id']});return;})['then'](respondWithStatusCode(_0x3e3673,null))[_0x7e97('0x41')](function(_0xbe4433){if(_0x56c9b3){socket[_0x7e97('0x57')](_0x7e97('0x58'),{'id':_0x56c9b3['id']});}if(!_0x5c0d31){logger[_0x7e97('0x13')](_0x7e97('0x59'),_0xbe4433);return _0x3e3673[_0x7e97('0xa')](0x1f4)[_0x7e97('0x16')](_0xbe4433[_0x7e97('0x5a')]);}logger[_0x7e97('0x13')](_0x7e97('0x5b'),_0x5c0d31['id'],JSON[_0x7e97('0x5c')](_0xbe4433));});}; \ No newline at end of file +var _0xd666=['filter','merge','VIRTUAL','CloudProvider','count','includeAll','MicrosoftAzure','decryptString','data3','show','params','keys','include','find','service','catch','body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','update','then','destroy','stack','name','send','padEnd','slice','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick'];(function(_0x4ec8d2,_0x2bd974){var _0x4bf615=function(_0x326098){while(--_0x326098){_0x4ec8d2['push'](_0x4ec8d2['shift']());}};_0x4bf615(++_0x2bd974);}(_0xd666,0xeb));var _0x6d66=function(_0x5b6a86,_0x59489c){_0x5b6a86=_0x5b6a86-0x0;var _0x425888=_0xd666[_0x5b6a86];return _0x425888;};'use strict';var _=require(_0x6d66('0x0'));var Redis=require('ioredis');var qs=require(_0x6d66('0x1'));var encryptor=require(_0x6d66('0x2'));var config=require(_0x6d66('0x3'));var logger=require(_0x6d66('0x4'))(_0x6d66('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x6d66('0x6'));config['redis']=_[_0x6d66('0x7')](config['redis'],{'host':_0x6d66('0x8'),'port':0x18eb});var socket=require(_0x6d66('0x9'))(new Redis(config[_0x6d66('0xa')]));var redis=new Redis(config[_0x6d66('0xa')]);function respondWithStatusCode(_0x1da666,_0x47fbdf){_0x47fbdf=_0x47fbdf||0xcc;return function(_0x19ca6e){if(_0x19ca6e){return _0x1da666[_0x6d66('0xb')](_0x47fbdf);}return _0x1da666['status'](_0x47fbdf)[_0x6d66('0xc')]();};}function respondWithResult(_0x261b10,_0x1dfb75){_0x1dfb75=_0x1dfb75||0xc8;return function(_0x4722a3){if(_0x4722a3){return _0x261b10[_0x6d66('0xd')](_0x1dfb75)[_0x6d66('0xe')](_0x4722a3);}};}function respondWithFilteredResult(_0x2ec9d3,_0x28167d){return function(_0x5ca3e8){if(_0x5ca3e8){var _0x3f3025=typeof _0x28167d['offset']===_0x6d66('0xf')&&typeof _0x28167d[_0x6d66('0x10')]===_0x6d66('0xf');var _0x3b0115=_0x5ca3e8['count'];var _0xc4d885=_0x3f3025?0x0:_0x28167d[_0x6d66('0x11')];var _0x5b81e0=_0x3f3025?_0x5ca3e8['count']:_0x28167d[_0x6d66('0x11')]+_0x28167d[_0x6d66('0x10')];var _0x48c274;if(_0x5b81e0>=_0x3b0115){_0x5b81e0=_0x3b0115;_0x48c274=0xc8;}else{_0x48c274=0xce;}_0x2ec9d3[_0x6d66('0xd')](_0x48c274);return _0x2ec9d3[_0x6d66('0x12')](_0x6d66('0x13'),_0xc4d885+'-'+_0x5b81e0+'/'+_0x3b0115)['json'](_0x5ca3e8);}return null;};}function saveUpdates(_0xe7f5ec){return function(_0x43f75d){if(_0x43f75d){return _0x43f75d[_0x6d66('0x14')](_0xe7f5ec)[_0x6d66('0x15')](function(_0x726fd6){return _0x726fd6;});}return null;};}function removeEntity(_0x2992f9){return function(_0x3f52ed){if(_0x3f52ed){return _0x3f52ed[_0x6d66('0x16')]()['then'](function(){_0x2992f9[_0x6d66('0xd')](0xcc)[_0x6d66('0xc')]();});}};}function handleEntityNotFound(_0x5343c2){return function(_0x5cb30c){if(!_0x5cb30c){_0x5343c2[_0x6d66('0xb')](0x194);}return _0x5cb30c;};}function handleError(_0x36683e,_0x3f3e0a){_0x3f3e0a=_0x3f3e0a||0x1f4;return function(_0xa76e5c){logger['error'](_0xa76e5c[_0x6d66('0x17')]);if(_0xa76e5c[_0x6d66('0x18')]){delete _0xa76e5c[_0x6d66('0x18')];}_0x36683e[_0x6d66('0xd')](_0x3f3e0a)[_0x6d66('0x19')](_0xa76e5c);};}function maskClientSecret(_0x4e1282){return _[_0x6d66('0x1a')](_0x4e1282[_0x6d66('0x1b')](0x0,0x3),0x14,'*');}exports[_0x6d66('0x1c')]=function(_0x4694a9,_0x36b96c){var _0x33ab08={},_0x45c33b={},_0x2c1d08={'count':0x0,'rows':[]};var _0x969e85=_['map'](db['CloudProvider'][_0x6d66('0x1d')],function(_0x1b48af){return{'name':_0x1b48af[_0x6d66('0x1e')],'type':_0x1b48af[_0x6d66('0x1f')]['key']};});_0x45c33b[_0x6d66('0x20')]=_[_0x6d66('0x21')](_0x969e85,_0x6d66('0x18'));_0x45c33b[_0x6d66('0x22')]=_['keys'](_0x4694a9[_0x6d66('0x22')]);_0x45c33b[_0x6d66('0x23')]=_[_0x6d66('0x24')](_0x45c33b['model'],_0x45c33b[_0x6d66('0x22')]);_0x33ab08[_0x6d66('0x25')]=_[_0x6d66('0x24')](_0x45c33b[_0x6d66('0x20')],qs[_0x6d66('0x26')](_0x4694a9['query'][_0x6d66('0x26')]));_0x33ab08[_0x6d66('0x25')]=_0x33ab08[_0x6d66('0x25')][_0x6d66('0x27')]?_0x33ab08[_0x6d66('0x25')]:_0x45c33b[_0x6d66('0x20')];if(!_0x4694a9['query']['hasOwnProperty']('nolimit')){_0x33ab08[_0x6d66('0x10')]=qs[_0x6d66('0x10')](_0x4694a9[_0x6d66('0x22')]['limit']);_0x33ab08['offset']=qs['offset'](_0x4694a9[_0x6d66('0x22')][_0x6d66('0x11')]);}_0x33ab08[_0x6d66('0x28')]=qs[_0x6d66('0x29')](_0x4694a9[_0x6d66('0x22')][_0x6d66('0x29')]);_0x33ab08[_0x6d66('0x2a')]=qs[_0x6d66('0x23')](_[_0x6d66('0x2b')](_0x4694a9['query'],_0x45c33b[_0x6d66('0x23')]),_0x969e85);if(_0x4694a9['query'][_0x6d66('0x2c')]){_0x33ab08[_0x6d66('0x2a')]=_[_0x6d66('0x2d')](_0x33ab08['where'],{'$or':_['map'](_0x969e85,function(_0x163a72){if(_0x163a72[_0x6d66('0x1f')]!==_0x6d66('0x2e')){var _0x558eb3={};_0x558eb3[_0x163a72[_0x6d66('0x18')]]={'$like':'%'+_0x4694a9[_0x6d66('0x22')][_0x6d66('0x2c')]+'%'};return _0x558eb3;}})});}_0x33ab08=_[_0x6d66('0x2d')]({},_0x33ab08,_0x4694a9['options']);var _0x23b721={'where':_0x33ab08[_0x6d66('0x2a')]};return db[_0x6d66('0x2f')][_0x6d66('0x30')](_0x23b721)['then'](function(_0x55d3c6){_0x2c1d08['count']=_0x55d3c6;if(_0x4694a9[_0x6d66('0x22')][_0x6d66('0x31')]){_0x33ab08['include']=[{'all':!![]}];}return db[_0x6d66('0x2f')]['findAll'](_0x33ab08);})[_0x6d66('0x15')](function(_0x54638d){_0x2c1d08['rows']=_[_0x6d66('0x21')](_0x54638d,function(_0x12881){if(_0x12881['service']===_0x6d66('0x32')){var _0x4df646=encryptor[_0x6d66('0x33')](_0x12881[_0x6d66('0x34')]);_0x12881[_0x6d66('0x34')]=maskClientSecret(_0x4df646);}return _0x12881;});return _0x2c1d08;})['then'](respondWithFilteredResult(_0x36b96c,_0x33ab08))['catch'](handleError(_0x36b96c,null));};exports[_0x6d66('0x35')]=function(_0x599f2e,_0x3c8807){var _0x28da24={'raw':!![],'where':{'id':_0x599f2e[_0x6d66('0x36')]['id']}},_0x213034={};_0x213034[_0x6d66('0x20')]=_[_0x6d66('0x37')](db['CloudProvider'][_0x6d66('0x1d')]);_0x213034[_0x6d66('0x22')]=_[_0x6d66('0x37')](_0x599f2e[_0x6d66('0x22')]);_0x213034['filters']=_['intersection'](_0x213034[_0x6d66('0x20')],_0x213034[_0x6d66('0x22')]);_0x28da24['attributes']=_[_0x6d66('0x24')](_0x213034[_0x6d66('0x20')],qs['fields'](_0x599f2e['query'][_0x6d66('0x26')]));_0x28da24['attributes']=_0x28da24[_0x6d66('0x25')][_0x6d66('0x27')]?_0x28da24[_0x6d66('0x25')]:_0x213034[_0x6d66('0x20')];if(_0x599f2e[_0x6d66('0x22')][_0x6d66('0x31')]){_0x28da24[_0x6d66('0x38')]=[{'all':!![]}];}_0x28da24=_[_0x6d66('0x2d')]({},_0x28da24,_0x599f2e['options']);return db[_0x6d66('0x2f')][_0x6d66('0x39')](_0x28da24)['then'](handleEntityNotFound(_0x3c8807,null))[_0x6d66('0x15')](function(_0x33d542){if(_0x33d542[_0x6d66('0x3a')]===_0x6d66('0x32')){var _0x41aca6=encryptor['decryptString'](_0x33d542[_0x6d66('0x34')]);_0x33d542[_0x6d66('0x34')]=maskClientSecret(_0x41aca6);}return _0x33d542;})[_0x6d66('0x15')](respondWithResult(_0x3c8807,null))[_0x6d66('0x3b')](handleError(_0x3c8807,null));};exports['create']=function(_0x12be56,_0x17aed6){if(!_0x12be56['body'][_0x6d66('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x12be56[_0x6d66('0x3c')][_0x6d66('0x3a')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1f75f0=db[_0x6d66('0x2f')][_0x6d66('0x1d')]['service'][_0x6d66('0x3d')];if(!_0x1f75f0['includes'](_0x12be56[_0x6d66('0x3c')][_0x6d66('0x3a')]))throw new Error(_0x6d66('0x3e')+_0x1f75f0[_0x6d66('0x3f')](',\x20'));if(_0x12be56[_0x6d66('0x3c')][_0x6d66('0x3a')]==='MicrosoftAzure'&&_0x12be56[_0x6d66('0x3c')]['data3']){_0x12be56[_0x6d66('0x3c')][_0x6d66('0x34')]=encryptor[_0x6d66('0x40')](_0x12be56[_0x6d66('0x3c')][_0x6d66('0x34')]);}return db[_0x6d66('0x2f')]['create'](_0x12be56['body'],{})['then'](respondWithResult(_0x17aed6,0xc9))[_0x6d66('0x3b')](handleError(_0x17aed6,null));};exports[_0x6d66('0x14')]=function(_0x6a044d,_0x24a1a6){if(_0x6a044d['body']['id']){delete _0x6a044d[_0x6d66('0x3c')]['id'];}return db[_0x6d66('0x2f')][_0x6d66('0x39')]({'where':{'id':_0x6a044d[_0x6d66('0x36')]['id']}})[_0x6d66('0x15')](handleEntityNotFound(_0x24a1a6,null))['then'](function(_0x4daf35){if(_0x4daf35[_0x6d66('0x3a')]===_0x6d66('0x32')&&_0x6a044d['body'][_0x6d66('0x34')]){_0x6a044d[_0x6d66('0x3c')]['data3']=encryptor[_0x6d66('0x40')](_0x6a044d[_0x6d66('0x3c')][_0x6d66('0x34')]);}return _0x4daf35;})['then'](saveUpdates(_0x6a044d['body'],null))[_0x6d66('0x15')](respondWithResult(_0x24a1a6,null))['catch'](handleError(_0x24a1a6,null));};exports['destroy']=function(_0x2738d1,_0x37cb0a){return db[_0x6d66('0x2f')][_0x6d66('0x39')]({'where':{'id':_0x2738d1['params']['id']}})['then'](handleEntityNotFound(_0x37cb0a,null))[_0x6d66('0x15')](removeEntity(_0x37cb0a,null))[_0x6d66('0x3b')](handleError(_0x37cb0a,null));};exports[_0x6d66('0x41')]=function(_0x835d45,_0x5e79ec){return db[_0x6d66('0x2f')]['findOne']({'where':{'id':_0x835d45[_0x6d66('0x36')]['id']},'raw':!![]})['then'](function(_0x9a4f78){if(!_0x9a4f78)return _0x5e79ec[_0x6d66('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x9a4f78,_0x835d45[_0x6d66('0x42')]['id'])};})[_0x6d66('0x15')](respondWithResult(_0x5e79ec,null))[_0x6d66('0x3b')](handleError(_0x5e79ec,null));};exports[_0x6d66('0x43')]=function(_0x4fde6c,_0x3ebe94){var _0x5aeb67=_0x4fde6c[_0x6d66('0x3c')];var _0x2c5500;var _0x4a70ab;if(_0x5aeb67[_0x6d66('0x44')])throw _0x5aeb67;redis[_0x6d66('0x45')](_0x5aeb67[_0x6d66('0x46')])[_0x6d66('0x15')](function(_0x366eb4){if(!_0x366eb4)throw new Error(_0x6d66('0x47'));_0x2c5500=JSON[_0x6d66('0x48')](_0x366eb4);var _0x3a40ab=Buffer[_0x6d66('0x49')](_0x5aeb67[_0x6d66('0x46')],_0x6d66('0x4a'))[_0x6d66('0x4b')](_0x6d66('0x4c'));_0x4a70ab=JSON[_0x6d66('0x48')](_0x3a40ab);if(!oauth[_0x6d66('0x4d')](_0x5aeb67[_0x6d66('0x4e')],_0x2c5500[_0x6d66('0x4f')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x5aeb67['state']);return oauth[_0x6d66('0x50')](_0x5aeb67[_0x6d66('0x51')],_0x2c5500);})[_0x6d66('0x15')](function(_0x7ed3b4){_0x2c5500[_0x6d66('0x52')]=_0x7ed3b4[_0x6d66('0x53')];_0x2c5500[_0x6d66('0x54')]=_0x7ed3b4[_0x6d66('0x55')];return db[_0x6d66('0x2f')][_0x6d66('0x14')]({'data5':_0x2c5500[_0x6d66('0x52')],'data6':_0x2c5500[_0x6d66('0x54')]},{'where':{'id':_0x2c5500['id']}});})[_0x6d66('0x15')](function(){oauth[_0x6d66('0x56')](_0x2c5500);socket[_0x6d66('0x57')](_0x6d66('0x58'),{'id':_0x4a70ab['id']});return;})[_0x6d66('0x15')](respondWithStatusCode(_0x3ebe94,null))['catch'](function(_0x3d6f0d){if(_0x4a70ab){socket['emit'](_0x6d66('0x59'),{'id':_0x4a70ab['id']});}if(!_0x2c5500){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x3d6f0d);return _0x3ebe94[_0x6d66('0xd')](0x1f4)[_0x6d66('0x19')](_0x3d6f0d[_0x6d66('0x5a')]);}logger[_0x6d66('0x44')](_0x6d66('0x5b'),_0x2c5500['id'],JSON[_0x6d66('0x5c')](_0x3d6f0d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f426843..e6bd1c3 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 _0x8337=['../../config/environment','define','cloud_providers','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x215997,_0x1ac597){var _0x240031=function(_0x212363){while(--_0x212363){_0x215997['push'](_0x215997['shift']());}};_0x240031(++_0x1ac597);}(_0x8337,0x13e));var _0x7833=function(_0x2c58e6,_0x207043){_0x2c58e6=_0x2c58e6-0x0;var _0x5aa073=_0x8337[_0x2c58e6];return _0x5aa073;};'use strict';var _=require(_0x7833('0x0'));var util=require('util');var logger=require(_0x7833('0x1'))(_0x7833('0x2'));var moment=require(_0x7833('0x3'));var BPromise=require('bluebird');var rp=require(_0x7833('0x4'));var fs=require('fs');var path=require(_0x7833('0x5'));var rimraf=require('rimraf');var config=require(_0x7833('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x31bebe,_0x55aec9){return _0x31bebe[_0x7833('0x7')]('CloudProvider',attributes,{'tableName':_0x7833('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7901=['exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x25079d,_0x1aca2b){var _0xf3f2a5=function(_0x2f1ad0){while(--_0x2f1ad0){_0x25079d['push'](_0x25079d['shift']());}};_0xf3f2a5(++_0x1aca2b);}(_0x7901,0xb8));var _0x1790=function(_0x45d123,_0x5bad15){_0x45d123=_0x45d123-0x0;var _0x4ee572=_0x7901[_0x45d123];return _0x4ee572;};'use strict';var _=require(_0x1790('0x0'));var util=require('util');var logger=require(_0x1790('0x1'))(_0x1790('0x2'));var moment=require(_0x1790('0x3'));var BPromise=require(_0x1790('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1790('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x1790('0x6')]=function(_0xaf6c1b,_0x20fffb){return _0xaf6c1b[_0x1790('0x7')](_0x1790('0x8'),attributes,{'tableName':_0x1790('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 966950a..2ace7d9 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 _0x9ac3=['localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','push','data7','join','type','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','id_token','from','base64','toString','hex','client_id','data1','response_type','redirect_uri','nonce','prompt','login','key','oauth2Claims','oauth2/','set','stringify','decode','payload','issuer','isAfter','unix','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','access_token','update','data5','catch','authorization_code','data4','intervals','bind','all','inspect','error','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis'];(function(_0x973ff9,_0x199e9f){var _0x3e42c0=function(_0xf472ed){while(--_0xf472ed){_0x973ff9['push'](_0x973ff9['shift']());}};_0x3e42c0(++_0x199e9f);}(_0x9ac3,0x11d));var _0x39ac=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x9ac3[_0x2f32c4];return _0x95b5dc;};'use strict';var _=require(_0x39ac('0x0'));var crypto=require(_0x39ac('0x1'));var jwt=require(_0x39ac('0x2'));var moment=require(_0x39ac('0x3'));var Redis=require(_0x39ac('0x4'));var rp=require(_0x39ac('0x5'));var util=require(_0x39ac('0x6'));var encryptor=require(_0x39ac('0x7'));var config=require(_0x39ac('0x8'));var logger=require(_0x39ac('0x9'))(_0x39ac('0xa'));var schedule=require(_0x39ac('0xb'));var db=require(_0x39ac('0xc'))['db'];config['redis']=_[_0x39ac('0xd')](config[_0x39ac('0xe')],{'host':_0x39ac('0xf'),'port':0x18eb});var redis=new Redis(config[_0x39ac('0xe')]);var MICROSOFT_AUTH_URL=_0x39ac('0x10');var AZURE_AUTH_SCOPES={'Outlook365':[_0x39ac('0x11'),_0x39ac('0x12'),'email',_0x39ac('0x13'),_0x39ac('0x14'),_0x39ac('0x15'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x39ac('0x11'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x39ac('0x16');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x18aaf5){var _0x27ecbf=_[_0x39ac('0x17')](AZURE_AUTH_SCOPES[_0x18aaf5['type']]);if(_0x18aaf5['type']==='Dynamics365')_0x27ecbf[_0x39ac('0x18')](_0x18aaf5[_0x39ac('0x19')]+'/.default');return _0x27ecbf[_0x39ac('0x1a')]('\x20');}function getAccessTokenScope(_0x17f4c8){if(_0x17f4c8[_0x39ac('0x1b')]===_0x39ac('0x1c'))return _0x39ac('0x14');if(_0x17f4c8[_0x39ac('0x1b')]===_0x39ac('0x1d'))return _0x17f4c8[_0x39ac('0x19')]+_0x39ac('0x1e');}function generateMicrosoftAuthorizationUrl(_0xeb4f45,_0x54d4c9){var _0x1bcb21=MICROSOFT_AUTH_URL[_0x39ac('0x1f')](_0x39ac('0x20'),_0xeb4f45[_0x39ac('0x21')]);var _0x1d4546=['code',_0x39ac('0x22')];var _0x3b9cad=Buffer[_0x39ac('0x23')](JSON['stringify']({'id':_0x54d4c9}))['toString'](_0x39ac('0x24'));var _0xe02cd3=crypto['randomBytes'](0x10)[_0x39ac('0x25')](_0x39ac('0x26'));var _0x34f487=getAuthorizationScopes(_0xeb4f45);var _0x202cc3=[{'key':_0x39ac('0x27'),'value':_0xeb4f45[_0x39ac('0x28')]},{'key':_0x39ac('0x29'),'value':encodeURIComponent(_0x1d4546[_0x39ac('0x1a')]('\x20'))},{'key':_0x39ac('0x2a'),'value':_0xeb4f45['data4']},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x34f487)},{'key':'state','value':_0x3b9cad},{'key':_0x39ac('0x2b'),'value':_0xe02cd3},{'key':_0x39ac('0x2c'),'value':_0x39ac('0x2d')}];var _0x214de3=_0x1bcb21+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x39ac('0x17')](_0x202cc3,function(_0x4bc610){return _0x4bc610[_0x39ac('0x2e')]+'='+_0x4bc610['value'];})[_0x39ac('0x1a')]('&');_0xeb4f45[_0x39ac('0x2f')]={'issuer':_0x1bcb21['replace'](_0x39ac('0x30'),''),'audience':_0xeb4f45['data1'],'state':_0x3b9cad,'nonce':_0xe02cd3};redis[_0x39ac('0x31')](_0x3b9cad,JSON[_0x39ac('0x32')](_0xeb4f45));return _0x214de3;}function isValidIdToken(_0x63e2a2,_0x20b444){try{var _0x1a43cc=jwt[_0x39ac('0x33')](_0x63e2a2,{'complete':!![]});var _0xf5a6f5=_0x1a43cc[_0x39ac('0x34')];if(_0xf5a6f5['iss']!==_0x20b444[_0x39ac('0x35')])return![];if(_0xf5a6f5['aud']!==_0x20b444['audience'])return![];if(_0xf5a6f5['nonce']!==_0x20b444['nonce'])return![];if(moment()[_0x39ac('0x36')](moment[_0x39ac('0x37')](_0xf5a6f5['exp'])))return![];return!![];}catch(_0x1cd634){throw _0x1cd634;}}function refreshOauth2MicrosoftAccessToken(_0x1b677b){return Promise['resolve']()[_0x39ac('0x38')](function(){if(_0x1b677b[_0x39ac('0x39')])return _0x1b677b;return db[_0x39ac('0x3a')][_0x39ac('0x3b')]({'where':{'id':_0x1b677b['id']},'raw':!![]});})[_0x39ac('0x38')](function(_0x25e084){var _0x5be8a1={'grant_type':_0x39ac('0x3c'),'refresh_token':_0x25e084[_0x39ac('0x3d')],'scope':getAccessTokenScope(_0x25e084),'redirect_uri':_0x25e084['data4'],'client_id':_0x25e084[_0x39ac('0x28')],'client_secret':encryptor[_0x39ac('0x3e')](_0x25e084['data3'])};var _0x48d1b5={'method':_0x39ac('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x39ac('0x1f')](_0x39ac('0x20'),_0x25e084[_0x39ac('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5be8a1,'json':!![]};return rp(_0x48d1b5);})[_0x39ac('0x38')](function(_0x270571){_0x1b677b['data5']=_0x270571[_0x39ac('0x40')];_0x1b677b['data6']=_0x270571[_0x39ac('0x3c')];return db[_0x39ac('0x3a')][_0x39ac('0x41')]({'data5':_0x1b677b[_0x39ac('0x42')],'data6':_0x1b677b[_0x39ac('0x3d')]},{'where':{'id':_0x1b677b['id']}});})[_0x39ac('0x38')](function(){return _0x1b677b;})[_0x39ac('0x43')](function(_0x59d3f5){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1b677b['id'],_0x59d3f5);});}function getOauth2MicrosoftAccessToken(_0x5bcdf6,_0x5ead7b){var _0x1d8e0f={'grant_type':_0x39ac('0x44'),'code':_0x5bcdf6,'scope':getAccessTokenScope(_0x5ead7b),'redirect_uri':_0x5ead7b[_0x39ac('0x45')],'client_id':_0x5ead7b[_0x39ac('0x28')],'client_secret':encryptor[_0x39ac('0x3e')](_0x5ead7b['data3'])};var _0x716329={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x39ac('0x1f')]('{TENANT_ID}',_0x5ead7b['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d8e0f,'json':!![]};return rp(_0x716329);}function startRefreshInterval(_0x541655){var _0x5a03a3=schedule[_0x39ac('0x46')];if(_0x5a03a3[_0x541655['id']])clearInterval(_0x5a03a3[_0x541655['id']]);_0x5a03a3[_0x541655['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x39ac('0x47')](this,{'id':_0x541655['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x39ac('0x46')]=_0x5a03a3;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x59b353){var _0x5c7cc5=_0x59b353[_0x39ac('0x17')](function(_0x6f710b){return refreshOauth2MicrosoftAccessToken(_0x6f710b)[_0x39ac('0x38')](function(_0x47d26b){startRefreshInterval(_0x47d26b);});});return Promise[_0x39ac('0x48')](_0x5c7cc5);})[_0x39ac('0x43')](function(_0x454372){var _0x24c2b9=_0x454372?util[_0x39ac('0x49')](_0x454372,{'showHidden':![],'depth':null}):'';logger[_0x39ac('0x4a')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x24c2b9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x6007=['openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','map','Dynamics365','push','data7','/.default','join','type','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','redirect_uri','data4','scope','state','nonce','login','key','oauth2Claims','replace','oauth2/','decode','payload','issuer','aud','resolve','then','CloudProvider','findOne','refresh_token','decryptString','data3','POST','data5','access_token','data6','error','authorization_code','intervals','bind','findAll','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x1d103e,_0x58fbe1){var _0x429026=function(_0x34c60e){while(--_0x34c60e){_0x1d103e['push'](_0x1d103e['shift']());}};_0x429026(++_0x58fbe1);}(_0x6007,0x168));var _0x7600=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x6007[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x7600('0x0'));var crypto=require('crypto');var jwt=require(_0x7600('0x1'));var moment=require(_0x7600('0x2'));var Redis=require('ioredis');var rp=require(_0x7600('0x3'));var util=require(_0x7600('0x4'));var encryptor=require(_0x7600('0x5'));var config=require(_0x7600('0x6'));var logger=require(_0x7600('0x7'))(_0x7600('0x8'));var schedule=require(_0x7600('0x9'));var db=require(_0x7600('0xa'))['db'];config[_0x7600('0xb')]=_[_0x7600('0xc')](config[_0x7600('0xb')],{'host':_0x7600('0xd'),'port':0x18eb});var redis=new Redis(config[_0x7600('0xb')]);var MICROSOFT_AUTH_URL=_0x7600('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7600('0xf'),_0x7600('0x10'),_0x7600('0x11'),_0x7600('0x12'),_0x7600('0x13'),_0x7600('0x14'),_0x7600('0x15')],'Dynamics365':[_0x7600('0xf'),_0x7600('0x12')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x33d21f){var _0x22dc93=_[_0x7600('0x16')](AZURE_AUTH_SCOPES[_0x33d21f['type']]);if(_0x33d21f['type']===_0x7600('0x17'))_0x22dc93[_0x7600('0x18')](_0x33d21f[_0x7600('0x19')]+_0x7600('0x1a'));return _0x22dc93[_0x7600('0x1b')]('\x20');}function getAccessTokenScope(_0x34ad9f){if(_0x34ad9f[_0x7600('0x1c')]===_0x7600('0x1d'))return _0x7600('0x13');if(_0x34ad9f[_0x7600('0x1c')]==='Dynamics365')return _0x34ad9f[_0x7600('0x19')]+_0x7600('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1cf026,_0x52323f){var _0x1c9123=MICROSOFT_AUTH_URL['replace'](_0x7600('0x1e'),_0x1cf026[_0x7600('0x1f')]);var _0x3dcf2b=[_0x7600('0x20'),_0x7600('0x21')];var _0x249b29=Buffer[_0x7600('0x22')](JSON[_0x7600('0x23')]({'id':_0x52323f}))[_0x7600('0x24')](_0x7600('0x25'));var _0x558963=crypto[_0x7600('0x26')](0x10)[_0x7600('0x24')](_0x7600('0x27'));var _0x4f3182=getAuthorizationScopes(_0x1cf026);var _0x2fa36c=[{'key':'client_id','value':_0x1cf026[_0x7600('0x28')]},{'key':'response_type','value':encodeURIComponent(_0x3dcf2b[_0x7600('0x1b')]('\x20'))},{'key':_0x7600('0x29'),'value':_0x1cf026[_0x7600('0x2a')]},{'key':'response_mode','value':'form_post'},{'key':_0x7600('0x2b'),'value':encodeURIComponent(_0x4f3182)},{'key':_0x7600('0x2c'),'value':_0x249b29},{'key':_0x7600('0x2d'),'value':_0x558963},{'key':'prompt','value':_0x7600('0x2e')}];var _0x474a2d=_0x1c9123+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2fa36c,function(_0x133c39){return _0x133c39[_0x7600('0x2f')]+'='+_0x133c39['value'];})['join']('&');_0x1cf026[_0x7600('0x30')]={'issuer':_0x1c9123[_0x7600('0x31')](_0x7600('0x32'),''),'audience':_0x1cf026[_0x7600('0x28')],'state':_0x249b29,'nonce':_0x558963};redis['set'](_0x249b29,JSON['stringify'](_0x1cf026));return _0x474a2d;}function isValidIdToken(_0x1c221d,_0x4d65e2){try{var _0x29d508=jwt[_0x7600('0x33')](_0x1c221d,{'complete':!![]});var _0x1c3a58=_0x29d508[_0x7600('0x34')];if(_0x1c3a58['iss']!==_0x4d65e2[_0x7600('0x35')])return![];if(_0x1c3a58[_0x7600('0x36')]!==_0x4d65e2['audience'])return![];if(_0x1c3a58[_0x7600('0x2d')]!==_0x4d65e2[_0x7600('0x2d')])return![];if(moment()['isAfter'](moment['unix'](_0x1c3a58['exp'])))return![];return!![];}catch(_0x3029bb){throw _0x3029bb;}}function refreshOauth2MicrosoftAccessToken(_0x55d806){return Promise[_0x7600('0x37')]()[_0x7600('0x38')](function(){if(_0x55d806['data3'])return _0x55d806;return db[_0x7600('0x39')][_0x7600('0x3a')]({'where':{'id':_0x55d806['id']},'raw':!![]});})['then'](function(_0x3f51ed){var _0x4cd269={'grant_type':_0x7600('0x3b'),'refresh_token':_0x3f51ed['data6'],'scope':getAccessTokenScope(_0x3f51ed),'redirect_uri':_0x3f51ed[_0x7600('0x2a')],'client_id':_0x3f51ed['data1'],'client_secret':encryptor[_0x7600('0x3c')](_0x3f51ed[_0x7600('0x3d')])};var _0x69fa3a={'method':_0x7600('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x7600('0x31')](_0x7600('0x1e'),_0x3f51ed[_0x7600('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4cd269,'json':!![]};return rp(_0x69fa3a);})[_0x7600('0x38')](function(_0x17a2cc){_0x55d806[_0x7600('0x3f')]=_0x17a2cc[_0x7600('0x40')];_0x55d806[_0x7600('0x41')]=_0x17a2cc['refresh_token'];return db[_0x7600('0x39')]['update']({'data5':_0x55d806['data5'],'data6':_0x55d806[_0x7600('0x41')]},{'where':{'id':_0x55d806['id']}});})[_0x7600('0x38')](function(){return _0x55d806;})['catch'](function(_0x25a0d7){logger[_0x7600('0x42')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x55d806['id'],_0x25a0d7);});}function getOauth2MicrosoftAccessToken(_0x1b37b3,_0x2ebefd){var _0xa5901b={'grant_type':_0x7600('0x43'),'code':_0x1b37b3,'scope':getAccessTokenScope(_0x2ebefd),'redirect_uri':_0x2ebefd[_0x7600('0x2a')],'client_id':_0x2ebefd[_0x7600('0x28')],'client_secret':encryptor[_0x7600('0x3c')](_0x2ebefd['data3'])};var _0x27a998={'method':_0x7600('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x7600('0x31')]('{TENANT_ID}',_0x2ebefd[_0x7600('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa5901b,'json':!![]};return rp(_0x27a998);}function startRefreshInterval(_0x256314){var _0x14e51a=schedule[_0x7600('0x44')];if(_0x14e51a[_0x256314['id']])clearInterval(_0x14e51a[_0x256314['id']]);_0x14e51a[_0x256314['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7600('0x45')](this,{'id':_0x256314['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7600('0x44')]=_0x14e51a;}function startAllRefreshIntervals(){return db[_0x7600('0x39')][_0x7600('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xb73be3){var _0x55597d=_0xb73be3[_0x7600('0x16')](function(_0x537abc){return refreshOauth2MicrosoftAccessToken(_0x537abc)[_0x7600('0x38')](function(_0x5675b1){startRefreshInterval(_0x5675b1);});});return Promise['all'](_0x55597d);})[_0x7600('0x47')](function(_0x3ec3fb){var _0x2221f6=_0x3ec3fb?util[_0x7600('0x48')](_0x3ec3fb,{'showHidden':![],'depth':null}):'';logger[_0x7600('0x42')](_0x7600('0x49'),_0x2221f6);});}module[_0x7600('0x4a')]={'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 716c224..5b16b01 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 _0x5b6e=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x485a34,_0x4423d1){var _0x517add=function(_0x3fe348){while(--_0x3fe348){_0x485a34['push'](_0x485a34['shift']());}};_0x517add(++_0x4423d1);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x4c8ea,_0x30ad0f){_0x4c8ea=_0x4c8ea-0x0;var _0x1f25c7=_0x5b6e[_0x4c8ea];return _0x1f25c7;};'use strict';var _=require(_0xe5b6('0x0'));var util=require(_0xe5b6('0x1'));var moment=require('moment');var BPromise=require(_0xe5b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5b6('0x3'));var db=require(_0xe5b6('0x4'))['db'];var utils=require(_0xe5b6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe5b6('0x6'));var jayson=require(_0xe5b6('0x7'));var client=jayson[_0xe5b6('0x8')][_0xe5b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x554d53,_0x17ec5f,_0x326502){return new BPromise(function(_0x2bde31,_0x587efe){return client[_0xe5b6('0xa')](_0x554d53,_0x326502)['then'](function(_0x3f908a){logger[_0xe5b6('0xb')]('CloudProvider,\x20%s,\x20%s',_0x17ec5f,_0xe5b6('0xc'));logger[_0xe5b6('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x17ec5f,_0xe5b6('0xc'),JSON[_0xe5b6('0xe')](_0x3f908a));if(_0x3f908a['error']){if(_0x3f908a[_0xe5b6('0xf')][_0xe5b6('0x10')]===0x1f4){logger['error'](_0xe5b6('0x11'),_0x17ec5f,_0x3f908a[_0xe5b6('0xf')][_0xe5b6('0x12')]);return _0x587efe(_0x3f908a[_0xe5b6('0xf')][_0xe5b6('0x12')]);}logger['error'](_0xe5b6('0x11'),_0x17ec5f,_0x3f908a[_0xe5b6('0xf')][_0xe5b6('0x12')]);return _0x2bde31(_0x3f908a[_0xe5b6('0xf')][_0xe5b6('0x12')]);}else{logger[_0xe5b6('0xb')](_0xe5b6('0x11'),_0x17ec5f,_0xe5b6('0xc'));_0x2bde31(_0x3f908a[_0xe5b6('0x13')][_0xe5b6('0x12')]);}})[_0xe5b6('0x14')](function(_0x5dd731){logger[_0xe5b6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x17ec5f,_0x5dd731);_0x587efe(_0x5dd731);});});} \ No newline at end of file +var _0x5942=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x335d24,_0x33b159){var _0x24e5a3=function(_0x41f721){while(--_0x41f721){_0x335d24['push'](_0x335d24['shift']());}};_0x24e5a3(++_0x33b159);}(_0x5942,0x16a));var _0x2594=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0x5942[_0x7f3667];return _0x2c4c24;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381472,_0xd0ada5,_0x3d20aa){return new BPromise(function(_0x5707a0,_0x2b42d3){return client[_0x2594('0xc')](_0x381472,_0x3d20aa)['then'](function(_0x29517f){logger['info'](_0x2594('0xd'),_0xd0ada5,_0x2594('0xe'));logger[_0x2594('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xd0ada5,_0x2594('0xe'),JSON[_0x2594('0x10')](_0x29517f));if(_0x29517f[_0x2594('0x11')]){if(_0x29517f[_0x2594('0x11')]['code']===0x1f4){logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);return _0x2b42d3(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')]['message']);return _0x5707a0(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}else{logger['info'](_0x2594('0xd'),_0xd0ada5,'request\x20sent');_0x5707a0(_0x29517f[_0x2594('0x13')][_0x2594('0x12')]);}})[_0x2594('0x14')](function(_0x33b4bc){logger[_0x2594('0x11')]('CloudProvider,\x20%s,\x20%s',_0xd0ada5,_0x33b4bc);_0x2b42d3(_0x33b4bc);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index fd912e6..488fc9b 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7a54,0x106));var _0x47a5=function(_0x355f18,_0x15d585){_0x355f18=_0x355f18-0x0;var _0x34ad55=_0x7a54[_0x355f18];return _0x34ad55;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x6486c2,_0x24e1c9){var _0x3a9ed2=function(_0x5c6a04){while(--_0x5c6a04){_0x6486c2['push'](_0x6486c2['shift']());}};_0x3a9ed2(++_0x24e1c9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3b9af4f..8a0338a 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 _0xc99d=['name','sequelize','exports','STRING'];(function(_0x4549fd,_0x1fc304){var _0x4cfc22=function(_0x3a404a){while(--_0x3a404a){_0x4549fd['push'](_0x4549fd['shift']());}};_0x4cfc22(++_0x1fc304);}(_0xc99d,0x175));var _0xdc99=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xc99d[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xdc99('0x0'));module[_0xdc99('0x1')]={'name':{'type':Sequelize[_0xdc99('0x2')],'unique':_0xdc99('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdc99('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xdc99('0x2')]},'phone':{'type':Sequelize[_0xdc99('0x2')]},'fax':{'type':Sequelize[_0xdc99('0x2')]},'type':{'type':Sequelize[_0xdc99('0x2')]},'street':{'type':Sequelize[_0xdc99('0x2')]},'postalCode':{'type':Sequelize[_0xdc99('0x2')]},'city':{'type':Sequelize[_0xdc99('0x2')]},'country':{'type':Sequelize[_0xdc99('0x2')]},'email':{'type':Sequelize[_0xdc99('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdc99('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xdc99('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xdc99('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa915=['exports','STRING','name'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa915,0x1d7));var _0x5a91=function(_0xc22821,_0x48d7ec){_0xc22821=_0xc22821-0x0;var _0x8715fe=_0xa915[_0xc22821];return _0x8715fe;};'use strict';var Sequelize=require('sequelize');module[_0x5a91('0x0')]={'name':{'type':Sequelize[_0x5a91('0x1')],'unique':_0x5a91('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5a91('0x1')]},'phone':{'type':Sequelize[_0x5a91('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5a91('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5a91('0x1')]},'city':{'type':Sequelize[_0x5a91('0x1')]},'country':{'type':Sequelize[_0x5a91('0x1')]},'email':{'type':Sequelize[_0x5a91('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5a91('0x1')]},'sStreet':{'type':Sequelize[_0x5a91('0x1')]},'sPostalCode':{'type':Sequelize[_0x5a91('0x1')]},'sCity':{'type':Sequelize[_0x5a91('0x1')]},'sCountry':{'type':Sequelize[_0x5a91('0x1')]},'description':{'type':Sequelize[_0x5a91('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 8470717..caa706e 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 _0xe8e2=['ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','Companies','UserProfileResource','end','stack','CmCompany','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','rows','show','params','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','pick','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv'];(function(_0x489bfc,_0x5242d9){var _0x158da3=function(_0xae8a98){while(--_0xae8a98){_0x489bfc['push'](_0x489bfc['shift']());}};_0x158da3(++_0x5242d9);}(_0xe8e2,0x148));var _0x2e8e=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xe8e2[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0x2e8e('0x0'));var rimraf=require(_0x2e8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e8e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e8e('0x3'));var Mustache=require(_0x2e8e('0x4'));var util=require('util');var path=require(_0x2e8e('0x5'));var sox=require(_0x2e8e('0x6'));var csv=require(_0x2e8e('0x7'));var ejs=require(_0x2e8e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2e8e('0x9'));var crypto=require('crypto');var jsforce=require(_0x2e8e('0xa'));var deskjs=require(_0x2e8e('0xb'));var toCsv=require(_0x2e8e('0x7'));var querystring=require(_0x2e8e('0xc'));var Papa=require(_0x2e8e('0xd'));var Redis=require('ioredis');var authService=require(_0x2e8e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2e8e('0xf'));var hardwareService=require(_0x2e8e('0x10'));var logger=require(_0x2e8e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2e8e('0x12'));var licenseUtil=require(_0x2e8e('0x13'));var db=require(_0x2e8e('0x14'))['db'];function respondWithStatusCode(_0x18f402,_0x3b7e94){_0x3b7e94=_0x3b7e94||0xcc;return function(_0x72f2eb){if(_0x72f2eb){return _0x18f402[_0x2e8e('0x15')](_0x3b7e94);}return _0x18f402[_0x2e8e('0x16')](_0x3b7e94)['end']();};}function respondWithResult(_0x517403,_0x4dd023){_0x4dd023=_0x4dd023||0xc8;return function(_0x2e9a95){if(_0x2e9a95){return _0x517403[_0x2e8e('0x16')](_0x4dd023)[_0x2e8e('0x17')](_0x2e9a95);}};}function respondWithFilteredResult(_0x26ceb4,_0x374933){return function(_0x4880bd){if(_0x4880bd){var _0x4ebfb4=typeof _0x374933[_0x2e8e('0x18')]===_0x2e8e('0x19')&&typeof _0x374933['limit']==='undefined';var _0x339fbc=_0x4880bd[_0x2e8e('0x1a')];var _0x45cae7=_0x4ebfb4?0x0:_0x374933[_0x2e8e('0x18')];var _0x8e1a6d=_0x4ebfb4?_0x4880bd['count']:_0x374933[_0x2e8e('0x18')]+_0x374933[_0x2e8e('0x1b')];var _0x599e59;if(_0x8e1a6d>=_0x339fbc){_0x8e1a6d=_0x339fbc;_0x599e59=0xc8;}else{_0x599e59=0xce;}_0x26ceb4[_0x2e8e('0x16')](_0x599e59);return _0x26ceb4[_0x2e8e('0x1c')](_0x2e8e('0x1d'),_0x45cae7+'-'+_0x8e1a6d+'/'+_0x339fbc)['json'](_0x4880bd);}return null;};}function patchUpdates(_0x82da65){return function(_0x3fee15){try{jsonpatch['apply'](_0x3fee15,_0x82da65,!![]);}catch(_0x2fd3dc){return BPromise[_0x2e8e('0x1e')](_0x2fd3dc);}return _0x3fee15[_0x2e8e('0x1f')]();};}function saveUpdates(_0x1f4fb8,_0xbe4cc0){return function(_0xce28be){if(_0xce28be){return _0xce28be[_0x2e8e('0x20')](_0x1f4fb8)[_0x2e8e('0x21')](function(_0x57df44){return _0x57df44;});}return null;};}function removeEntity(_0x53f789,_0x235c98){return function(_0x206177){if(_0x206177){return _0x206177[_0x2e8e('0x22')]()[_0x2e8e('0x21')](function(){var _0x103fcf=_0x206177['get']({'plain':!![]});var _0x29380e=_0x2e8e('0x23');return db[_0x2e8e('0x24')][_0x2e8e('0x22')]({'where':{'type':_0x29380e,'resourceId':_0x103fcf['id']}})[_0x2e8e('0x21')](function(){return _0x206177;});})[_0x2e8e('0x21')](function(){_0x53f789[_0x2e8e('0x16')](0xcc)[_0x2e8e('0x25')]();});}};}function handleEntityNotFound(_0x444546,_0x46746f){return function(_0x28638c){if(!_0x28638c){_0x444546[_0x2e8e('0x15')](0x194);}return _0x28638c;};}function handleError(_0x3e3ac6,_0x328079){_0x328079=_0x328079||0x1f4;return function(_0x59d7fd){logger['error'](_0x59d7fd[_0x2e8e('0x26')]);if(_0x59d7fd['name']){delete _0x59d7fd['name'];}_0x3e3ac6[_0x2e8e('0x16')](_0x328079)['send'](_0x59d7fd);};}exports['index']=function(_0x26d08d,_0x131e45){var _0x6ec4aa={},_0x13707b={},_0x4a8c55={'count':0x0,'rows':[]};return db[_0x2e8e('0x27')]['describe']()[_0x2e8e('0x21')](function(_0x510924){_0x13707b['model']=_['keys'](_0x510924);_0x13707b[_0x2e8e('0x28')]=_[_0x2e8e('0x29')](_0x26d08d[_0x2e8e('0x28')]);_0x13707b[_0x2e8e('0x2a')]=_[_0x2e8e('0x2b')](_0x13707b[_0x2e8e('0x2c')],_0x13707b[_0x2e8e('0x28')]);_0x6ec4aa[_0x2e8e('0x2d')]=_[_0x2e8e('0x2b')](_0x13707b[_0x2e8e('0x2c')],qs['fields'](_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x2e')]));_0x6ec4aa['attributes']=_0x6ec4aa[_0x2e8e('0x2d')]['length']?_0x6ec4aa['attributes']:_0x13707b['model'];if(!_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x2f')](_0x2e8e('0x30'))){_0x6ec4aa[_0x2e8e('0x1b')]=qs[_0x2e8e('0x1b')](_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x1b')]);_0x6ec4aa[_0x2e8e('0x18')]=qs['offset'](_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x18')]);}_0x6ec4aa[_0x2e8e('0x31')]=qs['sort'](_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x32')]);_0x6ec4aa[_0x2e8e('0x33')]=qs[_0x2e8e('0x2a')](_['pick'](_0x26d08d[_0x2e8e('0x28')],_0x13707b[_0x2e8e('0x2a')]),_0x510924);if(_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x34')]){_0x6ec4aa[_0x2e8e('0x33')]=_[_0x2e8e('0x35')](_0x6ec4aa['where'],{'$or':_[_0x2e8e('0x36')](_0x6ec4aa[_0x2e8e('0x2d')],function(_0x389e19){var _0x168ba6={};_0x168ba6[_0x389e19]={'$like':'%'+_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x34')]+'%'};return _0x168ba6;})});}_0x6ec4aa=_[_0x2e8e('0x35')]({},_0x6ec4aa,_0x26d08d[_0x2e8e('0x37')]);var _0xc1c59b={'where':_0x6ec4aa[_0x2e8e('0x33')]};return db[_0x2e8e('0x27')][_0x2e8e('0x1a')](_0xc1c59b)[_0x2e8e('0x21')](function(_0x58389e){_0x4a8c55['count']=_0x58389e;if(_0x26d08d[_0x2e8e('0x28')][_0x2e8e('0x38')]){_0x6ec4aa[_0x2e8e('0x39')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x6ec4aa);})[_0x2e8e('0x21')](function(_0x330e56){_0x4a8c55[_0x2e8e('0x3a')]=_0x330e56;return _0x4a8c55;})[_0x2e8e('0x21')](respondWithFilteredResult(_0x131e45,_0x6ec4aa))['catch'](handleError(_0x131e45,null));})['catch'](handleError(_0x131e45,null));};exports[_0x2e8e('0x3b')]=function(_0x524ff2,_0x1fa575){var _0x36c733={'raw':![],'where':{'id':_0x524ff2[_0x2e8e('0x3c')]['id']}},_0x1e2c7b={};_0x1e2c7b[_0x2e8e('0x2c')]=_[_0x2e8e('0x29')](db[_0x2e8e('0x27')]['rawAttributes']);_0x1e2c7b[_0x2e8e('0x28')]=_['keys'](_0x524ff2[_0x2e8e('0x28')]);_0x1e2c7b[_0x2e8e('0x2a')]=_['intersection'](_0x1e2c7b[_0x2e8e('0x2c')],_0x1e2c7b['query']);_0x36c733[_0x2e8e('0x2d')]=_[_0x2e8e('0x2b')](_0x1e2c7b[_0x2e8e('0x2c')],qs[_0x2e8e('0x2e')](_0x524ff2[_0x2e8e('0x28')][_0x2e8e('0x2e')]));_0x36c733['attributes']=_0x36c733[_0x2e8e('0x2d')][_0x2e8e('0x3d')]?_0x36c733[_0x2e8e('0x2d')]:_0x1e2c7b[_0x2e8e('0x2c')];if(_0x524ff2[_0x2e8e('0x28')][_0x2e8e('0x38')]){_0x36c733['include']=[{'all':!![]}];}_0x36c733=_[_0x2e8e('0x35')]({},_0x36c733,_0x524ff2[_0x2e8e('0x37')]);return db[_0x2e8e('0x27')][_0x2e8e('0x3e')](_0x36c733)[_0x2e8e('0x21')](handleEntityNotFound(_0x1fa575,null))[_0x2e8e('0x21')](respondWithResult(_0x1fa575,null))[_0x2e8e('0x3f')](handleError(_0x1fa575,null));};exports[_0x2e8e('0x40')]=function(_0x82f615,_0x1c64aa){return db[_0x2e8e('0x27')]['create'](_0x82f615[_0x2e8e('0x41')],{})[_0x2e8e('0x21')](function(_0x5ba115){var _0x2ea207=_0x82f615[_0x2e8e('0x42')][_0x2e8e('0x43')]({'plain':!![]});if(!_0x2ea207)throw new Error(_0x2e8e('0x44'));if(_0x2ea207[_0x2e8e('0x45')]==='user'){var _0x11a5df=_0x5ba115[_0x2e8e('0x43')]({'plain':!![]});var _0x5b1734=_0x2e8e('0x23');return db[_0x2e8e('0x46')]['find']({'where':{'name':_0x5b1734,'userProfileId':_0x2ea207['userProfileId']},'raw':!![]})[_0x2e8e('0x21')](function(_0x31b9b1){if(_0x31b9b1&&_0x31b9b1[_0x2e8e('0x47')]===0x0){return db[_0x2e8e('0x24')][_0x2e8e('0x40')]({'name':_0x11a5df[_0x2e8e('0x48')],'resourceId':_0x11a5df['id'],'type':_0x31b9b1[_0x2e8e('0x48')],'sectionId':_0x31b9b1['id']},{})['then'](function(){return _0x5ba115;});}else{return _0x5ba115;}})[_0x2e8e('0x3f')](function(_0x3f68e6){logger[_0x2e8e('0x49')](_0x2e8e('0x4a'),_0x3f68e6);throw _0x3f68e6;});}return _0x5ba115;})['then'](respondWithResult(_0x1c64aa,0xc9))[_0x2e8e('0x3f')](handleError(_0x1c64aa,null));};exports[_0x2e8e('0x20')]=function(_0x1bd4b5,_0x4042ac){if(_0x1bd4b5[_0x2e8e('0x41')]['id']){delete _0x1bd4b5[_0x2e8e('0x41')]['id'];}return db[_0x2e8e('0x27')][_0x2e8e('0x3e')]({'where':{'id':_0x1bd4b5['params']['id']}})[_0x2e8e('0x21')](handleEntityNotFound(_0x4042ac,null))[_0x2e8e('0x21')](saveUpdates(_0x1bd4b5[_0x2e8e('0x41')],null))[_0x2e8e('0x21')](respondWithResult(_0x4042ac,null))[_0x2e8e('0x3f')](handleError(_0x4042ac,null));};exports[_0x2e8e('0x22')]=function(_0x1d2f17,_0x349728){return db[_0x2e8e('0x27')][_0x2e8e('0x3e')]({'where':{'id':_0x1d2f17['params']['id']}})[_0x2e8e('0x21')](handleEntityNotFound(_0x349728,null))[_0x2e8e('0x21')](removeEntity(_0x349728,null))[_0x2e8e('0x3f')](handleError(_0x349728,null));};exports[_0x2e8e('0x4b')]=function(_0x4e839d,_0x6cae0e){return db[_0x2e8e('0x27')]['describe']()['then'](respondWithResult(_0x6cae0e,null))[_0x2e8e('0x3f')](handleError(_0x6cae0e,null));};exports[_0x2e8e('0x4c')]=function(_0x2c8409,_0x716e03,_0x595e33){return db[_0x2e8e('0x4d')][_0x2e8e('0x3e')]({'where':{'id':_0x2c8409[_0x2e8e('0x3c')]['id']}})[_0x2e8e('0x21')](handleEntityNotFound(_0x716e03,null))['then'](function(_0x494b92){if(_0x494b92){return _0x494b92['addContacts'](_0x2c8409[_0x2e8e('0x41')][_0x2e8e('0x4e')],_[_0x2e8e('0x4f')](_0x2c8409['body'],[_0x2e8e('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x716e03,null))[_0x2e8e('0x3f')](handleError(_0x716e03,null));};exports[_0x2e8e('0x50')]=function(_0x21bc99,_0xf6cc81,_0x52a93e){var _0x5f4614={};var _0x708747={};var _0x14bd9f;var _0x56b2e2;return db[_0x2e8e('0x27')][_0x2e8e('0x51')]({'where':{'id':_0x21bc99[_0x2e8e('0x3c')]['id']}})['then'](handleEntityNotFound(_0xf6cc81,null))[_0x2e8e('0x21')](function(_0x437ffc){if(_0x437ffc){_0x14bd9f=_0x437ffc;_0x708747[_0x2e8e('0x2c')]=_['keys'](db[_0x2e8e('0x4d')][_0x2e8e('0x52')]);_0x708747[_0x2e8e('0x28')]=_[_0x2e8e('0x29')](_0x21bc99[_0x2e8e('0x28')]);_0x708747[_0x2e8e('0x2a')]=_[_0x2e8e('0x2b')](_0x708747[_0x2e8e('0x2c')],_0x708747[_0x2e8e('0x28')]);_0x5f4614[_0x2e8e('0x2d')]=_[_0x2e8e('0x2b')](_0x708747[_0x2e8e('0x2c')],qs[_0x2e8e('0x2e')](_0x21bc99[_0x2e8e('0x28')][_0x2e8e('0x2e')]));_0x5f4614[_0x2e8e('0x2d')]=_0x5f4614['attributes'][_0x2e8e('0x3d')]?_0x5f4614[_0x2e8e('0x2d')]:_0x708747['model'];_0x5f4614[_0x2e8e('0x31')]=qs[_0x2e8e('0x32')](_0x21bc99[_0x2e8e('0x28')][_0x2e8e('0x32')]);_0x5f4614['where']=qs['filters'](_[_0x2e8e('0x53')](_0x21bc99[_0x2e8e('0x28')],_0x708747[_0x2e8e('0x2a')]));if(_0x21bc99[_0x2e8e('0x28')][_0x2e8e('0x34')]){_0x5f4614[_0x2e8e('0x33')]=_['merge'](_0x5f4614[_0x2e8e('0x33')],{'$or':_[_0x2e8e('0x36')](_0x5f4614[_0x2e8e('0x2d')],function(_0x5c6cd9){var _0x4bf902={};_0x4bf902[_0x5c6cd9]={'$like':'%'+_0x21bc99['query'][_0x2e8e('0x34')]+'%'};return _0x4bf902;})});}_0x5f4614=_[_0x2e8e('0x35')]({},_0x5f4614,_0x21bc99[_0x2e8e('0x37')]);return _0x14bd9f[_0x2e8e('0x50')](_0x5f4614);}})['then'](function(_0x162544){if(_0x162544){_0x56b2e2=_0x162544['length'];if(!_0x21bc99['query'][_0x2e8e('0x2f')](_0x2e8e('0x30'))){_0x5f4614[_0x2e8e('0x1b')]=qs[_0x2e8e('0x1b')](_0x21bc99['query'][_0x2e8e('0x1b')]);_0x5f4614[_0x2e8e('0x18')]=qs[_0x2e8e('0x18')](_0x21bc99[_0x2e8e('0x28')][_0x2e8e('0x18')]);}return _0x14bd9f[_0x2e8e('0x50')](_0x5f4614);}})[_0x2e8e('0x21')](function(_0xcca00e){if(_0xcca00e){return _0xcca00e?{'count':_0x56b2e2,'rows':_0xcca00e}:null;}})[_0x2e8e('0x21')](respondWithResult(_0xf6cc81,null))[_0x2e8e('0x3f')](handleError(_0xf6cc81,null));}; \ No newline at end of file +var _0x8850=['params','rawAttributes','length','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','addContacts','omit','getContacts','findOne','hasOwnProperty','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Companies','end','error','stack','name','CmCompany','describe','keys','query','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','map','filter','merge','options','includeAll','include','findAll','catch','show'];(function(_0x3e6aed,_0x97a2f1){var _0x3220dd=function(_0x252cd2){while(--_0x252cd2){_0x3e6aed['push'](_0x3e6aed['shift']());}};_0x3220dd(++_0x97a2f1);}(_0x8850,0x173));var _0x0885=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8850[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0885('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0885('0x1'));var rp=require('request-promise');var moment=require(_0x0885('0x2'));var BPromise=require(_0x0885('0x3'));var Mustache=require(_0x0885('0x4'));var util=require(_0x0885('0x5'));var path=require(_0x0885('0x6'));var sox=require('sox');var csv=require(_0x0885('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0885('0x8'));var _=require('lodash');var squel=require(_0x0885('0x9'));var crypto=require(_0x0885('0xa'));var jsforce=require(_0x0885('0xb'));var deskjs=require(_0x0885('0xc'));var toCsv=require(_0x0885('0x7'));var querystring=require(_0x0885('0xd'));var Papa=require(_0x0885('0xe'));var Redis=require(_0x0885('0xf'));var authService=require(_0x0885('0x10'));var qs=require(_0x0885('0x11'));var as=require(_0x0885('0x12'));var hardwareService=require(_0x0885('0x13'));var logger=require(_0x0885('0x14'))(_0x0885('0x15'));var utils=require(_0x0885('0x16'));var config=require(_0x0885('0x17'));var licenseUtil=require(_0x0885('0x18'));var db=require(_0x0885('0x19'))['db'];function respondWithStatusCode(_0x1f4b52,_0x5998b5){_0x5998b5=_0x5998b5||0xcc;return function(_0x3cb0b0){if(_0x3cb0b0){return _0x1f4b52[_0x0885('0x1a')](_0x5998b5);}return _0x1f4b52[_0x0885('0x1b')](_0x5998b5)['end']();};}function respondWithResult(_0x22dcac,_0x544f86){_0x544f86=_0x544f86||0xc8;return function(_0x5b1615){if(_0x5b1615){return _0x22dcac['status'](_0x544f86)[_0x0885('0x1c')](_0x5b1615);}};}function respondWithFilteredResult(_0x3250cc,_0x31214d){return function(_0x2adf67){if(_0x2adf67){var _0x1bc080=typeof _0x31214d['offset']===_0x0885('0x1d')&&typeof _0x31214d[_0x0885('0x1e')]==='undefined';var _0x1e81ae=_0x2adf67[_0x0885('0x1f')];var _0x57b50b=_0x1bc080?0x0:_0x31214d[_0x0885('0x20')];var _0x1f34b1=_0x1bc080?_0x2adf67[_0x0885('0x1f')]:_0x31214d[_0x0885('0x20')]+_0x31214d[_0x0885('0x1e')];var _0x29c437;if(_0x1f34b1>=_0x1e81ae){_0x1f34b1=_0x1e81ae;_0x29c437=0xc8;}else{_0x29c437=0xce;}_0x3250cc[_0x0885('0x1b')](_0x29c437);return _0x3250cc[_0x0885('0x21')](_0x0885('0x22'),_0x57b50b+'-'+_0x1f34b1+'/'+_0x1e81ae)[_0x0885('0x1c')](_0x2adf67);}return null;};}function patchUpdates(_0x111c11){return function(_0x1223d1){try{jsonpatch[_0x0885('0x23')](_0x1223d1,_0x111c11,!![]);}catch(_0x3a270b){return BPromise['reject'](_0x3a270b);}return _0x1223d1[_0x0885('0x24')]();};}function saveUpdates(_0x28586f,_0x2399fd){return function(_0x37e7b5){if(_0x37e7b5){return _0x37e7b5[_0x0885('0x25')](_0x28586f)[_0x0885('0x26')](function(_0x3a44a3){return _0x3a44a3;});}return null;};}function removeEntity(_0x2e5554,_0x5ce26d){return function(_0x828d6d){if(_0x828d6d){return _0x828d6d[_0x0885('0x27')]()[_0x0885('0x26')](function(){var _0x122eff=_0x828d6d[_0x0885('0x28')]({'plain':!![]});var _0x44911d=_0x0885('0x29');return db['UserProfileResource'][_0x0885('0x27')]({'where':{'type':_0x44911d,'resourceId':_0x122eff['id']}})['then'](function(){return _0x828d6d;});})['then'](function(){_0x2e5554['status'](0xcc)[_0x0885('0x2a')]();});}};}function handleEntityNotFound(_0x17ca87,_0x326934){return function(_0x229b5c){if(!_0x229b5c){_0x17ca87[_0x0885('0x1a')](0x194);}return _0x229b5c;};}function handleError(_0x4e14b2,_0x49950f){_0x49950f=_0x49950f||0x1f4;return function(_0xc5c2d4){logger[_0x0885('0x2b')](_0xc5c2d4[_0x0885('0x2c')]);if(_0xc5c2d4['name']){delete _0xc5c2d4[_0x0885('0x2d')];}_0x4e14b2['status'](_0x49950f)['send'](_0xc5c2d4);};}exports['index']=function(_0x4781c2,_0x2cfb20){var _0x4a9e70={},_0x4661ee={},_0x484992={'count':0x0,'rows':[]};return db[_0x0885('0x2e')][_0x0885('0x2f')]()[_0x0885('0x26')](function(_0x2df2f4){_0x4661ee['model']=_[_0x0885('0x30')](_0x2df2f4);_0x4661ee['query']=_['keys'](_0x4781c2[_0x0885('0x31')]);_0x4661ee['filters']=_['intersection'](_0x4661ee[_0x0885('0x32')],_0x4661ee[_0x0885('0x31')]);_0x4a9e70[_0x0885('0x33')]=_[_0x0885('0x34')](_0x4661ee[_0x0885('0x32')],qs[_0x0885('0x35')](_0x4781c2['query'][_0x0885('0x35')]));_0x4a9e70['attributes']=_0x4a9e70[_0x0885('0x33')]['length']?_0x4a9e70[_0x0885('0x33')]:_0x4661ee[_0x0885('0x32')];if(!_0x4781c2[_0x0885('0x31')]['hasOwnProperty'](_0x0885('0x36'))){_0x4a9e70[_0x0885('0x1e')]=qs[_0x0885('0x1e')](_0x4781c2[_0x0885('0x31')][_0x0885('0x1e')]);_0x4a9e70[_0x0885('0x20')]=qs[_0x0885('0x20')](_0x4781c2[_0x0885('0x31')][_0x0885('0x20')]);}_0x4a9e70[_0x0885('0x37')]=qs[_0x0885('0x38')](_0x4781c2[_0x0885('0x31')][_0x0885('0x38')]);_0x4a9e70[_0x0885('0x39')]=qs[_0x0885('0x3a')](_[_0x0885('0x3b')](_0x4781c2['query'],_0x4661ee[_0x0885('0x3a')]),_0x2df2f4);if(_0x4781c2[_0x0885('0x31')]['filter']){_0x4a9e70[_0x0885('0x39')]=_['merge'](_0x4a9e70['where'],{'$or':_[_0x0885('0x3c')](_0x4a9e70[_0x0885('0x33')],function(_0xabdcb9){var _0x127333={};_0x127333[_0xabdcb9]={'$like':'%'+_0x4781c2[_0x0885('0x31')][_0x0885('0x3d')]+'%'};return _0x127333;})});}_0x4a9e70=_[_0x0885('0x3e')]({},_0x4a9e70,_0x4781c2[_0x0885('0x3f')]);var _0x103306={'where':_0x4a9e70['where']};return db[_0x0885('0x2e')][_0x0885('0x1f')](_0x103306)[_0x0885('0x26')](function(_0x2c7732){_0x484992[_0x0885('0x1f')]=_0x2c7732;if(_0x4781c2['query'][_0x0885('0x40')]){_0x4a9e70[_0x0885('0x41')]=[{'all':!![]}];}return db[_0x0885('0x2e')][_0x0885('0x42')](_0x4a9e70);})[_0x0885('0x26')](function(_0x27211f){_0x484992['rows']=_0x27211f;return _0x484992;})['then'](respondWithFilteredResult(_0x2cfb20,_0x4a9e70))[_0x0885('0x43')](handleError(_0x2cfb20,null));})[_0x0885('0x43')](handleError(_0x2cfb20,null));};exports[_0x0885('0x44')]=function(_0x26c7cc,_0x380326){var _0x578bd0={'raw':![],'where':{'id':_0x26c7cc[_0x0885('0x45')]['id']}},_0x3cd015={};_0x3cd015[_0x0885('0x32')]=_['keys'](db[_0x0885('0x2e')][_0x0885('0x46')]);_0x3cd015[_0x0885('0x31')]=_[_0x0885('0x30')](_0x26c7cc[_0x0885('0x31')]);_0x3cd015['filters']=_[_0x0885('0x34')](_0x3cd015['model'],_0x3cd015[_0x0885('0x31')]);_0x578bd0[_0x0885('0x33')]=_[_0x0885('0x34')](_0x3cd015[_0x0885('0x32')],qs[_0x0885('0x35')](_0x26c7cc[_0x0885('0x31')][_0x0885('0x35')]));_0x578bd0['attributes']=_0x578bd0[_0x0885('0x33')][_0x0885('0x47')]?_0x578bd0[_0x0885('0x33')]:_0x3cd015[_0x0885('0x32')];if(_0x26c7cc[_0x0885('0x31')][_0x0885('0x40')]){_0x578bd0[_0x0885('0x41')]=[{'all':!![]}];}_0x578bd0=_['merge']({},_0x578bd0,_0x26c7cc[_0x0885('0x3f')]);return db['CmCompany'][_0x0885('0x48')](_0x578bd0)['then'](handleEntityNotFound(_0x380326,null))['then'](respondWithResult(_0x380326,null))[_0x0885('0x43')](handleError(_0x380326,null));};exports['create']=function(_0x4d7b81,_0x593582){return db[_0x0885('0x2e')][_0x0885('0x49')](_0x4d7b81[_0x0885('0x4a')],{})[_0x0885('0x26')](function(_0x35d936){var _0x3b8352=_0x4d7b81[_0x0885('0x4b')][_0x0885('0x28')]({'plain':!![]});if(!_0x3b8352)throw new Error(_0x0885('0x4c'));if(_0x3b8352[_0x0885('0x4d')]===_0x0885('0x4b')){var _0x42d073=_0x35d936['get']({'plain':!![]});var _0x4f6fc4=_0x0885('0x29');return db[_0x0885('0x4e')][_0x0885('0x48')]({'where':{'name':_0x4f6fc4,'userProfileId':_0x3b8352[_0x0885('0x4f')]},'raw':!![]})[_0x0885('0x26')](function(_0x1850e0){if(_0x1850e0&&_0x1850e0[_0x0885('0x50')]===0x0){return db[_0x0885('0x51')][_0x0885('0x49')]({'name':_0x42d073[_0x0885('0x2d')],'resourceId':_0x42d073['id'],'type':_0x1850e0[_0x0885('0x2d')],'sectionId':_0x1850e0['id']},{})[_0x0885('0x26')](function(){return _0x35d936;});}else{return _0x35d936;}})[_0x0885('0x43')](function(_0x5d2056){logger[_0x0885('0x2b')](_0x0885('0x52'),_0x5d2056);throw _0x5d2056;});}return _0x35d936;})[_0x0885('0x26')](respondWithResult(_0x593582,0xc9))[_0x0885('0x43')](handleError(_0x593582,null));};exports[_0x0885('0x25')]=function(_0x69f16d,_0x2ac08b){if(_0x69f16d[_0x0885('0x4a')]['id']){delete _0x69f16d['body']['id'];}return db['CmCompany'][_0x0885('0x48')]({'where':{'id':_0x69f16d[_0x0885('0x45')]['id']}})[_0x0885('0x26')](handleEntityNotFound(_0x2ac08b,null))[_0x0885('0x26')](saveUpdates(_0x69f16d[_0x0885('0x4a')],null))[_0x0885('0x26')](respondWithResult(_0x2ac08b,null))[_0x0885('0x43')](handleError(_0x2ac08b,null));};exports['destroy']=function(_0x584662,_0x296205){return db[_0x0885('0x2e')][_0x0885('0x48')]({'where':{'id':_0x584662[_0x0885('0x45')]['id']}})[_0x0885('0x26')](handleEntityNotFound(_0x296205,null))[_0x0885('0x26')](removeEntity(_0x296205,null))[_0x0885('0x43')](handleError(_0x296205,null));};exports['describe']=function(_0x4b000d,_0x440bf8){return db[_0x0885('0x2e')]['describe']()['then'](respondWithResult(_0x440bf8,null))[_0x0885('0x43')](handleError(_0x440bf8,null));};exports[_0x0885('0x53')]=function(_0x2742b3,_0x4a1d0c,_0x488ae0){return db['CmContact'][_0x0885('0x48')]({'where':{'id':_0x2742b3[_0x0885('0x45')]['id']}})[_0x0885('0x26')](handleEntityNotFound(_0x4a1d0c,null))[_0x0885('0x26')](function(_0x5984fa){if(_0x5984fa){return _0x5984fa['addContacts'](_0x2742b3['body']['ids'],_[_0x0885('0x54')](_0x2742b3['body'],['ids','id'])||{});}})[_0x0885('0x26')](respondWithResult(_0x4a1d0c,null))[_0x0885('0x43')](handleError(_0x4a1d0c,null));};exports[_0x0885('0x55')]=function(_0x45d01d,_0x58cc9d,_0x298976){var _0x32eb23={};var _0xe1ac2e={};var _0x1728f0;var _0x5cac40;return db[_0x0885('0x2e')][_0x0885('0x56')]({'where':{'id':_0x45d01d['params']['id']}})[_0x0885('0x26')](handleEntityNotFound(_0x58cc9d,null))['then'](function(_0x4356a3){if(_0x4356a3){_0x1728f0=_0x4356a3;_0xe1ac2e[_0x0885('0x32')]=_[_0x0885('0x30')](db['CmContact']['rawAttributes']);_0xe1ac2e[_0x0885('0x31')]=_[_0x0885('0x30')](_0x45d01d['query']);_0xe1ac2e[_0x0885('0x3a')]=_[_0x0885('0x34')](_0xe1ac2e[_0x0885('0x32')],_0xe1ac2e[_0x0885('0x31')]);_0x32eb23['attributes']=_[_0x0885('0x34')](_0xe1ac2e[_0x0885('0x32')],qs[_0x0885('0x35')](_0x45d01d[_0x0885('0x31')][_0x0885('0x35')]));_0x32eb23[_0x0885('0x33')]=_0x32eb23[_0x0885('0x33')][_0x0885('0x47')]?_0x32eb23[_0x0885('0x33')]:_0xe1ac2e['model'];_0x32eb23[_0x0885('0x37')]=qs['sort'](_0x45d01d['query'][_0x0885('0x38')]);_0x32eb23['where']=qs['filters'](_['pick'](_0x45d01d[_0x0885('0x31')],_0xe1ac2e[_0x0885('0x3a')]));if(_0x45d01d[_0x0885('0x31')][_0x0885('0x3d')]){_0x32eb23[_0x0885('0x39')]=_['merge'](_0x32eb23[_0x0885('0x39')],{'$or':_[_0x0885('0x3c')](_0x32eb23[_0x0885('0x33')],function(_0x5ac70f){var _0x15cc45={};_0x15cc45[_0x5ac70f]={'$like':'%'+_0x45d01d[_0x0885('0x31')]['filter']+'%'};return _0x15cc45;})});}_0x32eb23=_['merge']({},_0x32eb23,_0x45d01d['options']);return _0x1728f0['getContacts'](_0x32eb23);}})[_0x0885('0x26')](function(_0x31efb3){if(_0x31efb3){_0x5cac40=_0x31efb3[_0x0885('0x47')];if(!_0x45d01d[_0x0885('0x31')][_0x0885('0x57')](_0x0885('0x36'))){_0x32eb23['limit']=qs[_0x0885('0x1e')](_0x45d01d[_0x0885('0x31')]['limit']);_0x32eb23['offset']=qs[_0x0885('0x20')](_0x45d01d['query'][_0x0885('0x20')]);}return _0x1728f0[_0x0885('0x55')](_0x32eb23);}})[_0x0885('0x26')](function(_0x4f7bd8){if(_0x4f7bd8){return _0x4f7bd8?{'count':_0x5cac40,'rows':_0x4f7bd8}:null;}})[_0x0885('0x26')](respondWithResult(_0x58cc9d,null))['catch'](handleError(_0x58cc9d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 24cd359..df29224 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 _0xf9e9=['rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4bfd95,_0x1c3b3b){var _0x1484cd=function(_0x2c622b){while(--_0x2c622b){_0x4bfd95['push'](_0x4bfd95['shift']());}};_0x1484cd(++_0x1c3b3b);}(_0xf9e9,0xde));var _0x9f9e=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xf9e9[_0x506172];return _0x2723c0;};'use strict';var _=require(_0x9f9e('0x0'));var util=require(_0x9f9e('0x1'));var logger=require(_0x9f9e('0x2'))(_0x9f9e('0x3'));var moment=require(_0x9f9e('0x4'));var BPromise=require('bluebird');var rp=require(_0x9f9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f9e('0x6'));var config=require(_0x9f9e('0x7'));var attributes=require(_0x9f9e('0x8'));module[_0x9f9e('0x9')]=function(_0x38471f,_0xdf21e0){return _0x38471f[_0x9f9e('0xa')]('CmCompany',attributes,{'tableName':_0x9f9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x280f=['define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x20a4b5,_0x59ccb5){var _0x461de7=function(_0x24b857){while(--_0x24b857){_0x20a4b5['push'](_0x20a4b5['shift']());}};_0x461de7(++_0x59ccb5);}(_0x280f,0xb9));var _0xf280=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0x280f[_0x395bfe];return _0x35c81c;};'use strict';var _=require(_0xf280('0x0'));var util=require(_0xf280('0x1'));var logger=require(_0xf280('0x2'))('api');var moment=require(_0xf280('0x3'));var BPromise=require(_0xf280('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf280('0x5'));var rimraf=require(_0xf280('0x6'));var config=require(_0xf280('0x7'));var attributes=require(_0xf280('0x8'));module[_0xf280('0x9')]=function(_0x41815e,_0x737dd1){return _0x41815e[_0xf280('0xa')](_0xf280('0xb'),attributes,{'tableName':_0xf280('0xc'),'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 f718cf1..25ee1d3 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 _0x27ba=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x353cd6,_0xc795f6){var _0x55712a=function(_0x3b83e1){while(--_0x3b83e1){_0x353cd6['push'](_0x353cd6['shift']());}};_0x55712a(++_0xc795f6);}(_0x27ba,0x80));var _0xa27b=function(_0x2f4efe,_0x1f3be5){_0x2f4efe=_0x2f4efe-0x0;var _0x4e1668=_0x27ba[_0x2f4efe];return _0x4e1668;};'use strict';var _=require('lodash');var util=require(_0xa27b('0x0'));var moment=require('moment');var BPromise=require(_0xa27b('0x1'));var rs=require(_0xa27b('0x2'));var fs=require('fs');var Redis=require(_0xa27b('0x3'));var db=require(_0xa27b('0x4'))['db'];var utils=require(_0xa27b('0x5'));var logger=require(_0xa27b('0x6'))(_0xa27b('0x7'));var config=require(_0xa27b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa27b('0x9')][_0xa27b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348375,_0x1b75c8,_0x1d3114){return new BPromise(function(_0x432771,_0x578302){return client[_0xa27b('0xb')](_0x348375,_0x1d3114)[_0xa27b('0xc')](function(_0x5188b2){logger[_0xa27b('0xd')](_0xa27b('0xe'),_0x1b75c8,_0xa27b('0xf'));logger[_0xa27b('0x10')](_0xa27b('0x11'),_0x1b75c8,_0xa27b('0xf'),JSON[_0xa27b('0x12')](_0x5188b2));if(_0x5188b2['error']){if(_0x5188b2['error'][_0xa27b('0x13')]===0x1f4){logger[_0xa27b('0x14')]('CmCompany,\x20%s,\x20%s',_0x1b75c8,_0x5188b2[_0xa27b('0x14')][_0xa27b('0x15')]);return _0x578302(_0x5188b2[_0xa27b('0x14')][_0xa27b('0x15')]);}logger[_0xa27b('0x14')](_0xa27b('0xe'),_0x1b75c8,_0x5188b2[_0xa27b('0x14')][_0xa27b('0x15')]);return _0x432771(_0x5188b2['error']['message']);}else{logger['info'](_0xa27b('0xe'),_0x1b75c8,_0xa27b('0xf'));_0x432771(_0x5188b2[_0xa27b('0x16')]['message']);}})[_0xa27b('0x17')](function(_0x20b104){logger[_0xa27b('0x14')](_0xa27b('0xe'),_0x1b75c8,_0x20b104);_0x578302(_0x20b104);});});} \ No newline at end of file +var _0x26e8=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x260c31,_0x982e07){var _0x3e09c2=function(_0x1101e7){while(--_0x1101e7){_0x260c31['push'](_0x260c31['shift']());}};_0x3e09c2(++_0x982e07);}(_0x26e8,0x13a));var _0x826e=function(_0x1337c6,_0x3e8010){_0x1337c6=_0x1337c6-0x0;var _0x28bcf4=_0x26e8[_0x1337c6];return _0x28bcf4;};'use strict';var _=require(_0x826e('0x0'));var util=require(_0x826e('0x1'));var moment=require(_0x826e('0x2'));var BPromise=require(_0x826e('0x3'));var rs=require(_0x826e('0x4'));var fs=require('fs');var Redis=require(_0x826e('0x5'));var db=require(_0x826e('0x6'))['db'];var utils=require(_0x826e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x826e('0x8'));var jayson=require(_0x826e('0x9'));var client=jayson['client'][_0x826e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x500fcd,_0x3e9735,_0x24a631){return new BPromise(function(_0xb5f895,_0x2f5a16){return client['request'](_0x500fcd,_0x24a631)[_0x826e('0xb')](function(_0x1d4e5c){logger['info'](_0x826e('0xc'),_0x3e9735,_0x826e('0xd'));logger[_0x826e('0xe')](_0x826e('0xf'),_0x3e9735,_0x826e('0xd'),JSON['stringify'](_0x1d4e5c));if(_0x1d4e5c[_0x826e('0x10')]){if(_0x1d4e5c[_0x826e('0x10')][_0x826e('0x11')]===0x1f4){logger[_0x826e('0x10')](_0x826e('0xc'),_0x3e9735,_0x1d4e5c[_0x826e('0x10')][_0x826e('0x12')]);return _0x2f5a16(_0x1d4e5c[_0x826e('0x10')][_0x826e('0x12')]);}logger[_0x826e('0x10')]('CmCompany,\x20%s,\x20%s',_0x3e9735,_0x1d4e5c[_0x826e('0x10')][_0x826e('0x12')]);return _0xb5f895(_0x1d4e5c[_0x826e('0x10')]['message']);}else{logger[_0x826e('0x13')](_0x826e('0xc'),_0x3e9735,_0x826e('0xd'));_0xb5f895(_0x1d4e5c[_0x826e('0x14')][_0x826e('0x12')]);}})[_0x826e('0x15')](function(_0x2b82bd){logger[_0x826e('0x10')]('CmCompany,\x20%s,\x20%s',_0x3e9735,_0x2b82bd);_0x2f5a16(_0x2b82bd);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index cd5b1f4..704d6ea 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 _0xa038=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','create','addContacts','put','update','delete','destroy','exports','multer'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0xa038,0x197));var _0x8a03=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xa038[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0x8a03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a03('0x1'));var express=require(_0x8a03('0x2'));var router=express[_0x8a03('0x3')]();var fs_extra=require(_0x8a03('0x4'));var auth=require(_0x8a03('0x5'));var interaction=require(_0x8a03('0x6'));var config=require(_0x8a03('0x7'));var controller=require(_0x8a03('0x8'));router[_0x8a03('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a03('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x8a03('0xb')]);router[_0x8a03('0x9')](_0x8a03('0xc'),auth[_0x8a03('0xd')](),controller[_0x8a03('0xe')]);router[_0x8a03('0x9')](_0x8a03('0xf'),auth[_0x8a03('0xd')](),controller[_0x8a03('0x10')]);router['post']('/',auth[_0x8a03('0xd')](),controller[_0x8a03('0x11')]);router['post'](_0x8a03('0xf'),auth['isAuthenticated'](),controller[_0x8a03('0x12')]);router[_0x8a03('0x13')](_0x8a03('0xc'),auth['isAuthenticated'](),controller[_0x8a03('0x14')]);router[_0x8a03('0x15')]('/:id',auth[_0x8a03('0xd')](),controller[_0x8a03('0x16')]);module[_0x8a03('0x17')]=router; \ No newline at end of file +var _0x8fc1=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','/describe','describe','isAuthenticated','/:id/contacts','getContacts','create','addContacts','put','/:id','update'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0x8fc1,0x1a0));var _0x18fc=function(_0x52e6ae,_0x502a68){_0x52e6ae=_0x52e6ae-0x0;var _0x4322d7=_0x8fc1[_0x52e6ae];return _0x4322d7;};'use strict';var multer=require(_0x18fc('0x0'));var util=require(_0x18fc('0x1'));var path=require(_0x18fc('0x2'));var timeout=require(_0x18fc('0x3'));var express=require(_0x18fc('0x4'));var router=express[_0x18fc('0x5')]();var fs_extra=require(_0x18fc('0x6'));var auth=require(_0x18fc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x18fc('0x8'));var controller=require(_0x18fc('0x9'));router[_0x18fc('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x18fc('0xa')](_0x18fc('0xb'),auth['isAuthenticated'](),controller[_0x18fc('0xc')]);router[_0x18fc('0xa')]('/:id',auth[_0x18fc('0xd')](),controller['show']);router[_0x18fc('0xa')](_0x18fc('0xe'),auth[_0x18fc('0xd')](),controller[_0x18fc('0xf')]);router['post']('/',auth[_0x18fc('0xd')](),controller[_0x18fc('0x10')]);router['post'](_0x18fc('0xe'),auth[_0x18fc('0xd')](),controller[_0x18fc('0x11')]);router[_0x18fc('0x12')](_0x18fc('0x13'),auth[_0x18fc('0xd')](),controller[_0x18fc('0x14')]);router[_0x18fc('0x15')](_0x18fc('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x18fc('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 ff14d74..4c0a505 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 _0xd25e=['UNSIGNED','DATE','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x35e83a,_0x2c6e73){var _0x511947=function(_0x2c4c3e){while(--_0x2c4c3e){_0x35e83a['push'](_0x35e83a['shift']());}};_0x511947(++_0x2c6e73);}(_0xd25e,0x175));var _0xed25=function(_0x3a7110,_0x3492ab){_0x3a7110=_0x3a7110-0x0;var _0x486cb4=_0xd25e[_0x3a7110];return _0x486cb4;};'use strict';var _=require(_0xed25('0x0'));var Sequelize=require('sequelize');module[_0xed25('0x1')]={'firstName':{'type':Sequelize[_0xed25('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xed25('0x2')]},'street':{'type':Sequelize[_0xed25('0x2')]},'postalCode':{'type':Sequelize[_0xed25('0x2')]},'city':{'type':Sequelize[_0xed25('0x2')]},'country':{'type':Sequelize[_0xed25('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xed25('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xed25('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xed25('0x2')]},'twitter':{'type':Sequelize[_0xed25('0x2')]},'skype':{'type':Sequelize[_0xed25('0x2')]},'teams':{'type':Sequelize[_0xed25('0x2')]},'viber':{'type':Sequelize[_0xed25('0x2')]},'line':{'type':Sequelize[_0xed25('0x2')]},'wechat':{'type':Sequelize[_0xed25('0x2')]},'telegram':{'type':Sequelize[_0xed25('0x2')]},'UserId':{'type':Sequelize[_0xed25('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xed25('0x2')]},'priority':{'type':Sequelize[_0xed25('0x4')](0x2)[_0xed25('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xed25('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xed25('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x18c5=['INTEGER','DATE','NOW','sequelize','exports','STRING','TEXT'];(function(_0x484e24,_0x28111d){var _0xc7d3b1=function(_0x2040e1){while(--_0x2040e1){_0x484e24['push'](_0x484e24['shift']());}};_0xc7d3b1(++_0x28111d);}(_0x18c5,0xf8));var _0x518c=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x18c5[_0x5e77db];return _0x34b675;};'use strict';var _=require('lodash');var Sequelize=require(_0x518c('0x0'));module[_0x518c('0x1')]={'firstName':{'type':Sequelize[_0x518c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x518c('0x2')]},'postalCode':{'type':Sequelize[_0x518c('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x518c('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x518c('0x3')]},'phone':{'type':Sequelize[_0x518c('0x2')]},'mobile':{'type':Sequelize[_0x518c('0x2')]},'fax':{'type':Sequelize[_0x518c('0x2')]},'email':{'type':Sequelize[_0x518c('0x2')]},'url':{'type':Sequelize[_0x518c('0x2')]},'facebook':{'type':Sequelize[_0x518c('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x518c('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x518c('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x518c('0x2')]},'wechat':{'type':Sequelize[_0x518c('0x2')]},'telegram':{'type':Sequelize[_0x518c('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x518c('0x2')]},'priority':{'type':Sequelize[_0x518c('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x518c('0x5')],'defaultValue':Sequelize[_0x518c('0x6')]},'dialTimezone':{'type':Sequelize[_0x518c('0x2')]},'utcOffset':{'type':Sequelize[_0x518c('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 051a306..f801cd3 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 _0xd023=['ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','flatten','sortBy','reverse','value','moment','bluebird','path','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','undefined','limit','count','offset','status','set','Content-Range','update','then','end','sendStatus','error','stack','name','index','describe','getOptions','catch','destroy','CmContact','find','keys','length','cf_','displayName','analytics','query','findAll','alias','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','body','from','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','isArray','isNil','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','hasOwnProperty','additionalPhones','contact','all','show','params','Tags','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','CmCustomField','omit','map','format','cf_%d','pickBy','startsWith','table','id\x20=\x20?','sequelize','text','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','merge','options','getTags','nolimit','setTags','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','fromContactId','CmContactId','toContactId','hopperId','pick','ContactId','includeAll','include','rows','getHopperHistories','CmHopperHistory','getJscriptySessions','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','meta','import','User','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','importUpdates','binding','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','fax','voice','-createdAt','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','Tag','customerIp','customerPort','deviceModel','osName'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0xd023,0x10e));var _0x3d02=function(_0x26ae05,_0x53e7ea){_0x26ae05=_0x26ae05-0x0;var _0x1e8338=_0xd023[_0x26ae05];return _0x1e8338;};'use strict';var moment=require(_0x3d02('0x0'));var BPromise=require(_0x3d02('0x1'));var util=require('util');var path=require(_0x3d02('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d02('0x3'));var Papa=require(_0x3d02('0x4'));var Redis=require(_0x3d02('0x5'));var contacts=require(_0x3d02('0x6'));var qs=require(_0x3d02('0x7'));var logger=require('../../config/logger')(_0x3d02('0x8'));var config=require(_0x3d02('0x9'));var shared=require(_0x3d02('0xa'));var db=require(_0x3d02('0xb'))['db'];config[_0x3d02('0xc')]=_[_0x3d02('0xd')](config[_0x3d02('0xc')],{'host':_0x3d02('0xe'),'port':0x18eb});var socket=require(_0x3d02('0xf'))(new Redis(config[_0x3d02('0xc')]));require(_0x3d02('0x10'))[_0x3d02('0x11')](socket);function respondWithResult(_0x3cfcc1,_0x154ea8){_0x154ea8=_0x154ea8||0xc8;return function(_0x36a453){if(_0x36a453){return _0x3cfcc1['status'](_0x154ea8)[_0x3d02('0x12')](_0x36a453);}};}function respondWithFilteredResult(_0x47ce3f,_0x825067){return function(_0x28001f){if(_0x28001f){var _0x38e774=typeof _0x825067['offset']===_0x3d02('0x13')&&typeof _0x825067[_0x3d02('0x14')]==='undefined';var _0x1e344d=_0x28001f[_0x3d02('0x15')];var _0x532ab6=_0x38e774?0x0:_0x825067[_0x3d02('0x16')];var _0x421a3f=_0x38e774?_0x28001f['count']:_0x825067[_0x3d02('0x16')]+_0x825067[_0x3d02('0x14')];var _0xa0f80f;if(_0x421a3f>=_0x1e344d){_0x421a3f=_0x1e344d;_0xa0f80f=0xc8;}else{_0xa0f80f=0xce;}_0x47ce3f[_0x3d02('0x17')](_0xa0f80f);return _0x47ce3f[_0x3d02('0x18')](_0x3d02('0x19'),_0x532ab6+'-'+_0x421a3f+'/'+_0x1e344d)[_0x3d02('0x12')](_0x28001f);}return null;};}function saveUpdates(_0x3dc31f){return function(_0x37e9d0){if(_0x37e9d0){return _0x37e9d0[_0x3d02('0x1a')](_0x3dc31f)[_0x3d02('0x1b')](function(_0x11e5d9){return _0x11e5d9;});}return null;};}function removeEntity(_0x22e8b0){return function(_0x2f504a){if(_0x2f504a){return _0x2f504a['destroy']()[_0x3d02('0x1b')](function(){_0x22e8b0[_0x3d02('0x17')](0xcc)[_0x3d02('0x1c')]();});}};}function handleEntityNotFound(_0x3eef27){return function(_0x4eb89f){if(!_0x4eb89f){_0x3eef27[_0x3d02('0x1d')](0x194);}return _0x4eb89f;};}function handleError(_0x2d8b38,_0x2a5e8c){_0x2a5e8c=_0x2a5e8c||0x1f4;return function(_0x54d869){logger[_0x3d02('0x1e')](_0x54d869[_0x3d02('0x1f')]);if(_0x54d869[_0x3d02('0x20')]){delete _0x54d869['name'];}_0x2d8b38[_0x3d02('0x17')](_0x2a5e8c)['send'](_0x54d869);};}exports[_0x3d02('0x21')]=function(_0x10c85a,_0x4a4c04){var _0x6e25b={};return contacts[_0x3d02('0x22')]()[_0x3d02('0x1b')](function(_0x5b7e9e){_0x6e25b=qs[_0x3d02('0x23')](_0x5b7e9e,_0x10c85a);return contacts['findAll'](_0x10c85a['query'],_0x10c85a['user'],_0x6e25b,_0x5b7e9e);})[_0x3d02('0x1b')](respondWithFilteredResult(_0x4a4c04,_0x6e25b))[_0x3d02('0x24')](handleError(_0x4a4c04,null));};exports[_0x3d02('0x25')]=function(_0x2322ed,_0x48f9b9){return db[_0x3d02('0x26')][_0x3d02('0x27')]({'where':{'id':_0x2322ed['params']['id']}})[_0x3d02('0x1b')](handleEntityNotFound(_0x48f9b9,null))[_0x3d02('0x1b')](removeEntity(_0x48f9b9,null))['catch'](handleError(_0x48f9b9,null));};exports[_0x3d02('0x22')]=function(_0x5ebfc4,_0x9740e0){return db['CmContact'][_0x3d02('0x22')]()[_0x3d02('0x1b')](function(_0x51553c){delete _0x51553c['tags'];for(var _0x1e5f09=0x0;_0x1e5f090x0){return new Promise(function(_0x4ff2c0){var _0x339dc9=[];for(var _0x55fee5=0x0;_0x55fee5<_0x2c73f3['length'];_0x55fee5++){_0x339dc9[_0x3d02('0x5d')](insertAdditionalPhones(_0x2c73f3[_0x55fee5][_0x3d02('0x63')],_0x2c73f3[_0x55fee5][_0x3d02('0x62')]));}Promise[_0x3d02('0x64')](_0x339dc9)[_0x3d02('0x1b')](function(){_0x4ff2c0(0x1);});})[_0x3d02('0x1b')](function(){return{'success':_0x1568a4,'failure':_0x43dafb,'duplicates':_0x3f7c19};});}else{return{'success':_0x1568a4,'failure':_0x43dafb,'duplicates':_0x3f7c19};}}})[_0x3d02('0x1b')](respondWithResult(_0x22f7e9,0xc9))['catch'](handleError(_0x22f7e9,null));};exports[_0x3d02('0x65')]=function(_0x4d9dd3,_0x23a969){var _0x1e6cf3;return db['CmContact']['describe']()[_0x3d02('0x1b')](function(_0x135b97){return db[_0x3d02('0x26')][_0x3d02('0x27')]({'where':{'id':_0x4d9dd3[_0x3d02('0x66')]['id']},'include':[{'model':db['Tag'],'as':_0x3d02('0x67'),'attributes':['id',_0x3d02('0x20'),'color'],'required':_0x4d9dd3[_0x3d02('0x2d')][_0x3d02('0x68')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x3d02('0x69'),'where':{'CmContactId':_0x4d9dd3[_0x3d02('0x66')]['id']},'required':![],'include':[{'model':db[_0x3d02('0x6a')],'as':_0x3d02('0x6b')}]}],'order':[db['sequelize'][_0x3d02('0x6c')](_0x3d02('0x6d'))],'attributes':_[_0x3d02('0x28')](_0x135b97)});})[_0x3d02('0x1b')](function(_0x39311a){if(!_[_0x3d02('0x54')](_0x39311a)){_0x1e6cf3=_0x39311a[_0x3d02('0x37')]({'plain':!![]});var _0x4d1978={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x39311a&&_0x39311a['ListId']){if(_0x39311a[_0x3d02('0x5e')]){_0x4d1978[_0x3d02('0x5b')][_0x3d02('0x6e')][_0x3d02('0x5d')]({'ListId':{'$ne':_0x39311a[_0x3d02('0x5e')]}});}}return db[_0x3d02('0x6f')]['findAll'](_0x4d1978);}})['then'](function(_0x229bc5){if(!_[_0x3d02('0x54')](_0x229bc5)){return _[_0x3d02('0x70')](_0x1e6cf3,_[_0x3d02('0x71')](_0x229bc5,function(_0x3a8cc3){return util[_0x3d02('0x72')](_0x3d02('0x73'),_0x3a8cc3['id']);}));}})[_0x3d02('0x1b')](handleEntityNotFound(_0x23a969,null))[_0x3d02('0x1b')](respondWithResult(_0x23a969,null))[_0x3d02('0x24')](handleError(_0x23a969,null));};exports['update']=function(_0x5883a7,_0x2779fd){var _0x55335b;if(_0x5883a7[_0x3d02('0x35')]['id']){delete _0x5883a7[_0x3d02('0x35')]['id'];}if(!_['isNil'](_0x5883a7[_0x3d02('0x35')][_0x3d02('0x55')])){var _0x596f05=_0x5883a7[_0x3d02('0x35')]['dialTimezone'];if(!_[_0x3d02('0x54')](shared['timezones'][_0x596f05]))_0x5883a7[_0x3d02('0x35')][_0x3d02('0x57')]=shared[_0x3d02('0x56')][_0x596f05][_0x3d02('0x57')];}return db[_0x3d02('0x26')][_0x3d02('0x27')]({'where':{'id':_0x5883a7['params']['id']}})[_0x3d02('0x1b')](handleEntityNotFound(_0x2779fd,null))[_0x3d02('0x1b')](saveUpdates(_0x5883a7[_0x3d02('0x35')],null))[_0x3d02('0x1b')](function(_0x204653){_0x55335b=_0x204653;var _0x19d9cf={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x204653&&_0x204653[_0x3d02('0x5e')]){if(_0x204653[_0x3d02('0x5e')]){_0x19d9cf[_0x3d02('0x5b')]['$and'][_0x3d02('0x5d')]({'ListId':{'$ne':_0x204653[_0x3d02('0x5e')]}});}}return db[_0x3d02('0x6f')]['findAll'](_0x19d9cf);})[_0x3d02('0x1b')](function(_0x220775){if(_0x220775){return _[_0x3d02('0x70')](_[_0x3d02('0x74')](_0x5883a7[_0x3d02('0x35')],function(_0x1fb7e2,_0x2ac9fe){return _[_0x3d02('0x75')](_0x2ac9fe,_0x3d02('0x2a'));}),_[_0x3d02('0x71')](_0x220775,function(_0x2a40c9){return util[_0x3d02('0x72')](_0x3d02('0x73'),_0x2a40c9['id']);}));}})['then'](function(_0x138a61){if(_0x138a61&&!_['isEmpty'](_0x138a61)){var _0x1a1439=squel[_0x3d02('0x1a')]()[_0x3d02('0x76')]('cm_contacts')['setFields'](_0x138a61)[_0x3d02('0x5b')](_0x3d02('0x77'),_0x5883a7['params']['id'])['toParam']();return db[_0x3d02('0x78')][_0x3d02('0x2d')](_0x1a1439[_0x3d02('0x79')],{'replacements':_0x1a1439['values']});}})[_0x3d02('0x1b')](function(){if(_0x5883a7['body'][_0x3d02('0x7a')]&&_0x55335b){return db[_0x3d02('0x3c')][_0x3d02('0x1a')]({'phone':_0x5883a7['body'][_0x3d02('0x7a')],'OrderBy':0x0},{'where':{'ContactId':_0x55335b['id']}});}})[_0x3d02('0x1b')](function(){return _0x55335b;})[_0x3d02('0x1b')](respondWithResult(_0x2779fd,null))[_0x3d02('0x24')](handleError(_0x2779fd,null));};exports['getTags']=function(_0x460dad,_0x1ef3ed){var _0x2006d8={};var _0x5cb148={};var _0x153086;var _0x341665;return db['CmContact'][_0x3d02('0x7b')]({'where':{'id':_0x460dad['params']['id']}})[_0x3d02('0x1b')](handleEntityNotFound(_0x1ef3ed,null))['then'](function(_0x575bed){if(_0x575bed){_0x153086=_0x575bed;_0x5cb148[_0x3d02('0x7c')]=_[_0x3d02('0x28')](db['Tag'][_0x3d02('0x7d')]);_0x5cb148[_0x3d02('0x2d')]=_[_0x3d02('0x28')](_0x460dad[_0x3d02('0x2d')]);_0x5cb148[_0x3d02('0x7e')]=_[_0x3d02('0x7f')](_0x5cb148[_0x3d02('0x7c')],_0x5cb148['query']);_0x2006d8[_0x3d02('0x80')]=_[_0x3d02('0x7f')](_0x5cb148[_0x3d02('0x7c')],qs['fields'](_0x460dad[_0x3d02('0x2d')][_0x3d02('0x81')]));_0x2006d8[_0x3d02('0x80')]=_0x2006d8[_0x3d02('0x80')]['length']?_0x2006d8[_0x3d02('0x80')]:_0x5cb148['model'];_0x2006d8[_0x3d02('0x82')]=qs[_0x3d02('0x83')](_0x460dad[_0x3d02('0x2d')][_0x3d02('0x83')]);_0x2006d8[_0x3d02('0x5b')]=qs[_0x3d02('0x7e')](_['pick'](_0x460dad[_0x3d02('0x2d')],_0x5cb148[_0x3d02('0x7e')]));if(_0x460dad[_0x3d02('0x2d')][_0x3d02('0x84')]){_0x2006d8[_0x3d02('0x5b')]=_[_0x3d02('0x85')](_0x2006d8[_0x3d02('0x5b')],{'$or':_[_0x3d02('0x71')](_0x2006d8[_0x3d02('0x80')],function(_0x1eb397){var _0x4067fe={};_0x4067fe[_0x1eb397]={'$like':'%'+_0x460dad['query']['filter']+'%'};return _0x4067fe;})});}_0x2006d8=_[_0x3d02('0x85')]({},_0x2006d8,_0x460dad[_0x3d02('0x86')]);return _0x153086[_0x3d02('0x87')](_0x2006d8);}})['then'](function(_0x165b42){if(_0x165b42){_0x341665=_0x165b42[_0x3d02('0x29')];if(!_0x460dad[_0x3d02('0x2d')][_0x3d02('0x61')](_0x3d02('0x88'))){_0x2006d8[_0x3d02('0x14')]=qs[_0x3d02('0x14')](_0x460dad[_0x3d02('0x2d')][_0x3d02('0x14')]);_0x2006d8['offset']=qs[_0x3d02('0x16')](_0x460dad[_0x3d02('0x2d')][_0x3d02('0x16')]);}return _0x153086[_0x3d02('0x87')](_0x2006d8);}})[_0x3d02('0x1b')](function(_0x531899){if(_0x531899){return _0x531899?{'count':_0x341665,'rows':_0x531899}:null;}})[_0x3d02('0x1b')](respondWithResult(_0x1ef3ed,null))[_0x3d02('0x24')](handleError(_0x1ef3ed,null));};exports['setTags']=function(_0x5eb774,_0x58b8af){if(_0x5eb774[_0x3d02('0x35')]['id']){delete _0x5eb774[_0x3d02('0x35')]['id'];}return db['CmContact'][_0x3d02('0x7b')]({'where':{'id':_0x5eb774[_0x3d02('0x66')]['id']}})[_0x3d02('0x1b')](handleEntityNotFound(_0x58b8af,null))[_0x3d02('0x1b')](function(_0x55223d){if(_0x55223d){return _0x55223d[_0x3d02('0x89')](_0x5eb774[_0x3d02('0x35')]['ids']||[]);}return null;})[_0x3d02('0x1b')](respondWithResult(_0x58b8af,null))[_0x3d02('0x24')](handleError(_0x58b8af,null));};exports[_0x3d02('0x8a')]=function(_0x19be2e,_0x2af5d0){var _0x1963e3=[];_0x1963e3[_0x3d02('0x5d')](addAdditionalPhones(_0x19be2e[_0x3d02('0x35')]));Promise[_0x3d02('0x64')](_0x1963e3)['then'](function(){_0x1963e3=[];_0x1963e3[_0x3d02('0x5d')](deleteCmHopperPhones(_0x19be2e[_0x3d02('0x35')]['id']));_0x1963e3[_0x3d02('0x5d')](addCmHopperPhones(_0x19be2e[_0x3d02('0x35')]['id']));Promise[_0x3d02('0x64')](_0x1963e3)[_0x3d02('0x1b')](function(){return[0x1];})[_0x3d02('0x1b')](respondWithResult(_0x2af5d0,null));});};function addAdditionalPhones(_0x66ad00){var _0x586472;return new Promise(function(_0x5d3762){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x66ad00['id']}})['then'](function(){db['ContactItemType'][_0x3d02('0x2e')]({'raw':!![],'attributes':['id',_0x3d02('0x8b')]})[_0x3d02('0x1b')](function(_0x5598eb){var _0x3e7a00=[];for(var _0x3c6d96=0x0;_0x3c6d96<_0x66ad00['items']['length'];_0x3c6d96++){var _0x5f5555=_0x66ad00[_0x3d02('0x8c')]?_[_0x3d02('0x54')](_0x66ad00['item_types'][_0x3c6d96])?'':_0x66ad00[_0x3d02('0x8c')][_0x3c6d96]:_0x66ad00[_0x3d02('0x8d')][_0x3c6d96]['ItemTypeId']?_0x66ad00['items'][_0x3c6d96][_0x3d02('0x8e')]:'';var _0x64ba60=_[_0x3d02('0x54')](_0x66ad00[_0x3d02('0x8d')][_0x3c6d96][_0x3d02('0x8f')])?'':_0x66ad00[_0x3d02('0x8d')][_0x3c6d96][_0x3d02('0x8f')];var _0x165eb4=_0x5f5555+':'+_0x66ad00['items'][_0x3c6d96][_0x3d02('0x7a')]+'§'+_0x64ba60;if(_[_0x3d02('0x54')](_0x586472))_0x586472=_0x165eb4;else _0x586472+=';'+_0x165eb4;var _0x3b165=null;var _0x37ec61=null;if(_0x66ad00[_0x3d02('0x8c')]){if(!_[_0x3d02('0x54')](_0x66ad00[_0x3d02('0x8c')][_0x3c6d96])){_0x37ec61=_['find'](_0x5598eb,function(_0x1e6743){return _0x1e6743['id']===_0x66ad00[_0x3d02('0x8c')][_0x3c6d96];});if(!_[_0x3d02('0x54')](_0x37ec61)){_0x3b165=_0x37ec61[_0x3d02('0x8b')];}}}else{if(!_['isNil'](_0x66ad00[_0x3d02('0x8d')][_0x3c6d96])){_0x37ec61=_['find'](_0x5598eb,function(_0x33aefc){return _0x33aefc['id']===_0x66ad00[_0x3d02('0x8d')][_0x3c6d96][_0x3d02('0x8e')];});if(!_[_0x3d02('0x54')](_0x37ec61)){_0x3b165=_0x3c6d96;}}}if(_['isNil'](_0x3b165)){_0x3b165=0x64;}_0x3e7a00[_0x3d02('0x5d')](addAdditionalPhone(_0x66ad00['id'],_0x66ad00[_0x3d02('0x8d')][_0x3c6d96]['phone'],_0x66ad00['item_types']?_[_0x3d02('0x54')](_0x66ad00[_0x3d02('0x8c')][_0x3c6d96])?null:_0x66ad00[_0x3d02('0x8c')][_0x3c6d96]:_0x66ad00['items'][_0x3c6d96][_0x3d02('0x8e')]?_0x66ad00[_0x3d02('0x8d')][_0x3c6d96][_0x3d02('0x8e')]:null,_0x3b165,_0x64ba60));}Promise[_0x3d02('0x64')](_0x3e7a00)['then'](function(){db[_0x3d02('0x26')]['update']({'AdditionalPhones':_0x586472},{'where':{'id':_0x66ad00['id']}})['then'](function(){_0x5d3762(0x1);});});});});});}function addAdditionalPhone(_0x6bdce1,_0x475223,_0x24b6d8,_0x15429a,_0x27023e){return db['CmContactHasItem'][_0x3d02('0x27')]({'where':{'CmContactId':_0x6bdce1,'item':_0x475223}})[_0x3d02('0x1b')](function(_0x4f8e27){if(_0x4f8e27)logger[_0x3d02('0x32')](_0x3d02('0x90'),_0x4f8e27);else{db[_0x3d02('0x48')][_0x3d02('0x3f')]({'CmContactId':_0x6bdce1,'item':_0x475223,'ItemTypeId':_0x24b6d8,'OrderBy':_0x15429a,'ItemClass':_0x3d02('0x91'),'description':_0x27023e});}});}function deleteCmHopperPhones(_0xe04e93){return new Promise(function(_0x1ed800){return db[_0x3d02('0x3c')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xe04e93}})[_0x3d02('0x1b')](function(_0x5f3f8e){db[_0x3d02('0x92')][_0x3d02('0x25')]({'where':{'CmHopperId':{'$in':_[_0x3d02('0x71')](_0x5f3f8e,'id')}}});})['then'](function(){_0x1ed800(0x1);});});}function addCmHopperPhones(_0x4f6e25){return new Promise(function(_0x2389c2){return db[_0x3d02('0x3c')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4f6e25}})['then'](function(_0x2530b3){var _0x1b5bbd=[];_[_0x3d02('0x71')](_0x2530b3,function(_0x4bee27){_0x1b5bbd[_0x3d02('0x5d')](createCmHopperPhone(_0x4f6e25,_0x4bee27['id']));});Promise[_0x3d02('0x64')](_0x1b5bbd)[_0x3d02('0x1b')](function(){_0x2389c2(0x1);});});});}function createCmHopperPhone(_0x444477,_0x6fd894){return new Promise(function(_0x30346b){db[_0x3d02('0x48')]['findAll']({'raw':!![],'attributes':['item',_0x3d02('0x8b')],'where':{'CmContactId':_0x444477,'ItemClass':_0x3d02('0x91')},'include':[{'model':db['ContactItemType'],'attributes':[_0x3d02('0x8b')],'as':_0x3d02('0x6b')}],'order':[_0x3d02('0x8b'),db[_0x3d02('0x78')]['literal']('`ItemType`.OrderBy')]})[_0x3d02('0x1b')](function(_0x3fd7aa){var _0x4a23f5=0x1;var _0x427d94=_[_0x3d02('0x71')](_0x3fd7aa,function(_0x594c4c){_0x594c4c[_0x3d02('0x93')]=_0x6fd894;_0x594c4c[_0x3d02('0x7a')]=_0x594c4c[_0x3d02('0x94')];_0x594c4c[_0x3d02('0x8b')]=_0x4a23f5;delete _0x594c4c[_0x3d02('0x95')];_0x4a23f5=_0x4a23f5+0x1;return _0x594c4c;});return db[_0x3d02('0x92')]['bulkCreate'](_0x427d94,{});})[_0x3d02('0x1b')](function(){_0x30346b(0x1);});});}function insertAdditionalPhones(_0x1cc6f6,_0x6a602e){return new Promise(function(_0x5e6b4f){var _0x2a8f32=[];for(var _0xf9598f=0x0;_0xf9598f<_0x6a602e[_0x3d02('0x29')];_0xf9598f++){var _0x47298d=_0x6a602e[_0xf9598f];_0x2a8f32[_0x3d02('0x5d')](parseContactItemType(_0x47298d));}Promise['all'](_0x2a8f32)['then'](function(){var _0x1c0204={'id':_0x1cc6f6['id'],'items':_0x6a602e};return addAdditionalPhones(_0x1c0204)[_0x3d02('0x1b')](function(){return addCmHopperPhones(_0x1cc6f6['id']);});})[_0x3d02('0x1b')](function(){_0x5e6b4f(_0x1cc6f6);});});}function parseContactItemType(_0x4f59ee){return new Promise(function(_0x2e0cac){if(_0x4f59ee[_0x3d02('0x61')]('ItemTypeId')){_0x2e0cac(_0x4f59ee);}else{return db[_0x3d02('0x6a')][_0x3d02('0x27')]({'where':{'name':_0x4f59ee[_0x3d02('0x6b')]}})[_0x3d02('0x1b')](function(_0x2f0c43){if(_[_0x3d02('0x54')](_0x2f0c43))_0x4f59ee[_0x3d02('0x8e')]=null;else _0x4f59ee[_0x3d02('0x8e')]=_0x2f0c43['id'];_0x2e0cac(_0x4f59ee);});}});}exports[_0x3d02('0x96')]=function(_0x508d58,_0x288f5c){return db[_0x3d02('0x48')][_0x3d02('0x2e')]({'raw':!![],'where':{'CmContactId':_0x508d58['params']['id'],'ItemClass':_0x3d02('0x91')},'include':[{'model':db['ContactItemType'],'as':_0x3d02('0x6b')}],'order':[['OrderBy'],[db[_0x3d02('0x78')][_0x3d02('0x6c')](_0x3d02('0x97'))]]})[_0x3d02('0x1b')](function(_0x3ebb36){return _0x3ebb36;})[_0x3d02('0x1b')](respondWithResult(_0x288f5c,null))[_0x3d02('0x24')](handleError(_0x288f5c,null));};exports['duplicateAdditionalPhones']=function(_0x5aaa03,_0x18daf2){return db['CmContactHasItem'][_0x3d02('0x2e')]({'raw':!![],'where':{'CmContactId':_0x5aaa03[_0x3d02('0x35')][_0x3d02('0x98')]}})[_0x3d02('0x1b')](function(_0x46722d){var _0x5b0b93=_[_0x3d02('0x71')](_0x46722d,function(_0x298b12){_0x298b12[_0x3d02('0x99')]=_0x5aaa03[_0x3d02('0x35')][_0x3d02('0x9a')];return _0x298b12;});return db[_0x3d02('0x48')][_0x3d02('0x58')](_0x5b0b93,{});})[_0x3d02('0x1b')](function(){return addCmHopperPhones(_0x5aaa03[_0x3d02('0x35')][_0x3d02('0x9a')]);})['then'](function(){return['ok'];})[_0x3d02('0x1b')](respondWithResult(_0x18daf2,null))[_0x3d02('0x24')](handleError(_0x18daf2,null));};exports['rescheduleAdditionalPhones']=function(_0x5420ff,_0x46a8a7){var _0x1888b3=[];_0x1888b3[_0x3d02('0x5d')](createCmHopperPhone(_0x5420ff[_0x3d02('0x35')]['id'],_0x5420ff[_0x3d02('0x35')][_0x3d02('0x9b')]));Promise[_0x3d02('0x64')](_0x1888b3)[_0x3d02('0x1b')](function(){return[0x1];})[_0x3d02('0x1b')](respondWithResult(_0x46a8a7,null));};exports['getHoppers']=function(_0x5a2364,_0x22e396){var _0x1c2915={'raw':![],'where':{}};var _0xbde99e={};var _0x285a16={'count':0x0,'rows':[]};return db[_0x3d02('0x26')][_0x3d02('0x7b')]({'where':{'id':_0x5a2364[_0x3d02('0x66')]['id']}})['then'](handleEntityNotFound(_0x22e396,null))[_0x3d02('0x1b')](function(_0xaa3bf){if(_0xaa3bf){_0xbde99e[_0x3d02('0x7c')]=_[_0x3d02('0x28')](db[_0x3d02('0x3c')][_0x3d02('0x7d')]);_0xbde99e['query']=_[_0x3d02('0x28')](_0x5a2364['query']);_0xbde99e[_0x3d02('0x7e')]=_[_0x3d02('0x7f')](_0xbde99e['model'],_0xbde99e[_0x3d02('0x2d')]);_0x1c2915[_0x3d02('0x80')]=_[_0x3d02('0x7f')](_0xbde99e[_0x3d02('0x7c')],qs['fields'](_0x5a2364[_0x3d02('0x2d')][_0x3d02('0x81')]));_0x1c2915[_0x3d02('0x80')]=_0x1c2915[_0x3d02('0x80')][_0x3d02('0x29')]?_0x1c2915[_0x3d02('0x80')]:_0xbde99e[_0x3d02('0x7c')];if(!_0x5a2364[_0x3d02('0x2d')][_0x3d02('0x61')](_0x3d02('0x88'))){_0x1c2915['limit']=qs['limit'](_0x5a2364[_0x3d02('0x2d')][_0x3d02('0x14')]);_0x1c2915['offset']=qs['offset'](_0x5a2364[_0x3d02('0x2d')]['offset']);}_0x1c2915[_0x3d02('0x82')]=qs[_0x3d02('0x83')](_0x5a2364['query'][_0x3d02('0x83')]);_0x1c2915['where']=qs[_0x3d02('0x7e')](_[_0x3d02('0x9c')](_0x5a2364[_0x3d02('0x2d')],_0xbde99e[_0x3d02('0x7e')]));_0x1c2915['where'][_0x3d02('0x9d')]=_0xaa3bf['id'];if(_0x5a2364[_0x3d02('0x2d')][_0x3d02('0x84')]){_0x1c2915[_0x3d02('0x5b')]=_['merge'](_0x1c2915[_0x3d02('0x5b')],{'$or':_[_0x3d02('0x71')](_0x1c2915[_0x3d02('0x80')],function(_0x347797){var _0x5d102e={};_0x5d102e[_0x347797]={'$like':'%'+_0x5a2364[_0x3d02('0x2d')]['filter']+'%'};return _0x5d102e;})});}_0x1c2915=_[_0x3d02('0x85')]({},_0x1c2915,_0x5a2364[_0x3d02('0x86')]);return db[_0x3d02('0x3c')]['count']({'where':_0x1c2915[_0x3d02('0x5b')]})[_0x3d02('0x1b')](function(_0x4d0dfb){_0x285a16[_0x3d02('0x15')]=_0x4d0dfb;if(_0x5a2364[_0x3d02('0x2d')][_0x3d02('0x9e')]){_0x1c2915[_0x3d02('0x9f')]=[{'all':!![]}];}return db['CmHopper'][_0x3d02('0x2e')](_0x1c2915);})['then'](function(_0x3c31e9){_0x285a16[_0x3d02('0xa0')]=_0x3c31e9;return _0x285a16;});}})['then'](respondWithFilteredResult(_0x22e396,_0x1c2915))['catch'](handleError(_0x22e396,null));};exports[_0x3d02('0xa1')]=function(_0x3dbeeb,_0x5e77aa){var _0x2dc13f={'raw':!![],'where':{}};var _0x34beff={};var _0x506915={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x3dbeeb[_0x3d02('0x66')]['id']}})[_0x3d02('0x1b')](handleEntityNotFound(_0x5e77aa,null))[_0x3d02('0x1b')](function(_0x35c141){if(_0x35c141){_0x34beff[_0x3d02('0x7c')]=_[_0x3d02('0x28')](db[_0x3d02('0xa2')][_0x3d02('0x7d')]);_0x34beff[_0x3d02('0x2d')]=_[_0x3d02('0x28')](_0x3dbeeb[_0x3d02('0x2d')]);_0x34beff[_0x3d02('0x7e')]=_[_0x3d02('0x7f')](_0x34beff[_0x3d02('0x7c')],_0x34beff['query']);_0x2dc13f[_0x3d02('0x80')]=_['intersection'](_0x34beff[_0x3d02('0x7c')],qs[_0x3d02('0x81')](_0x3dbeeb[_0x3d02('0x2d')][_0x3d02('0x81')]));_0x2dc13f[_0x3d02('0x80')]=_0x2dc13f[_0x3d02('0x80')][_0x3d02('0x29')]?_0x2dc13f[_0x3d02('0x80')]:_0x34beff[_0x3d02('0x7c')];if(!_0x3dbeeb[_0x3d02('0x2d')][_0x3d02('0x61')](_0x3d02('0x88'))){_0x2dc13f[_0x3d02('0x14')]=qs[_0x3d02('0x14')](_0x3dbeeb[_0x3d02('0x2d')]['limit']);_0x2dc13f[_0x3d02('0x16')]=qs[_0x3d02('0x16')](_0x3dbeeb[_0x3d02('0x2d')][_0x3d02('0x16')]);}_0x2dc13f[_0x3d02('0x82')]=qs['sort'](_0x3dbeeb[_0x3d02('0x2d')][_0x3d02('0x83')]);_0x2dc13f['where']=qs[_0x3d02('0x7e')](_[_0x3d02('0x9c')](_0x3dbeeb[_0x3d02('0x2d')],_0x34beff[_0x3d02('0x7e')]));_0x2dc13f[_0x3d02('0x5b')][_0x3d02('0x9d')]=_0x35c141['id'];if(_0x3dbeeb['query'][_0x3d02('0x84')]){_0x2dc13f[_0x3d02('0x5b')]=_['merge'](_0x2dc13f[_0x3d02('0x5b')],{'$or':_[_0x3d02('0x71')](_0x2dc13f[_0x3d02('0x80')],function(_0x241d84){var _0x195447={};_0x195447[_0x241d84]={'$like':'%'+_0x3dbeeb[_0x3d02('0x2d')]['filter']+'%'};return _0x195447;})});}_0x2dc13f=_[_0x3d02('0x85')]({},_0x2dc13f,_0x3dbeeb[_0x3d02('0x86')]);return db['CmHopperHistory'][_0x3d02('0x15')]({'where':_0x2dc13f[_0x3d02('0x5b')]})[_0x3d02('0x1b')](function(_0xc09b8a){_0x506915[_0x3d02('0x15')]=_0xc09b8a;if(_0x3dbeeb['query']['includeAll']){_0x2dc13f[_0x3d02('0x9f')]=[{'all':!![]}];}return db[_0x3d02('0xa2')]['findAll'](_0x2dc13f);})[_0x3d02('0x1b')](function(_0x403ca0){_0x506915[_0x3d02('0xa0')]=_0x403ca0;return _0x506915;});}})['then'](respondWithFilteredResult(_0x5e77aa,_0x2dc13f))['catch'](handleError(_0x5e77aa,null));};exports['getHopperFinals']=function(_0x43f9b3,_0x541bca){var _0x337664={'raw':!![],'where':{}};var _0x2295ae={};var _0x262682={'count':0x0,'rows':[]};return db[_0x3d02('0x26')][_0x3d02('0x7b')]({'where':{'id':_0x43f9b3[_0x3d02('0x66')]['id']}})['then'](handleEntityNotFound(_0x541bca,null))[_0x3d02('0x1b')](function(_0x203043){if(_0x203043){_0x2295ae[_0x3d02('0x7c')]=_[_0x3d02('0x28')](db[_0x3d02('0x49')][_0x3d02('0x7d')]);_0x2295ae[_0x3d02('0x2d')]=_[_0x3d02('0x28')](_0x43f9b3[_0x3d02('0x2d')]);_0x2295ae[_0x3d02('0x7e')]=_['intersection'](_0x2295ae[_0x3d02('0x7c')],_0x2295ae[_0x3d02('0x2d')]);_0x337664['attributes']=_['intersection'](_0x2295ae[_0x3d02('0x7c')],qs[_0x3d02('0x81')](_0x43f9b3['query'][_0x3d02('0x81')]));_0x337664['attributes']=_0x337664['attributes'][_0x3d02('0x29')]?_0x337664[_0x3d02('0x80')]:_0x2295ae['model'];if(!_0x43f9b3[_0x3d02('0x2d')][_0x3d02('0x61')](_0x3d02('0x88'))){_0x337664[_0x3d02('0x14')]=qs[_0x3d02('0x14')](_0x43f9b3[_0x3d02('0x2d')][_0x3d02('0x14')]);_0x337664['offset']=qs[_0x3d02('0x16')](_0x43f9b3['query']['offset']);}_0x337664['order']=qs[_0x3d02('0x83')](_0x43f9b3['query'][_0x3d02('0x83')]);_0x337664[_0x3d02('0x5b')]=qs[_0x3d02('0x7e')](_['pick'](_0x43f9b3['query'],_0x2295ae[_0x3d02('0x7e')]));_0x337664[_0x3d02('0x5b')][_0x3d02('0x9d')]=_0x203043['id'];if(_0x43f9b3['query'][_0x3d02('0x84')]){_0x337664[_0x3d02('0x5b')]=_[_0x3d02('0x85')](_0x337664[_0x3d02('0x5b')],{'$or':_['map'](_0x337664['attributes'],function(_0x5ca92c){var _0x4cf556={};_0x4cf556[_0x5ca92c]={'$like':'%'+_0x43f9b3[_0x3d02('0x2d')][_0x3d02('0x84')]+'%'};return _0x4cf556;})});}_0x337664=_[_0x3d02('0x85')]({},_0x337664,_0x43f9b3[_0x3d02('0x86')]);return db[_0x3d02('0x49')][_0x3d02('0x15')]({'where':_0x337664[_0x3d02('0x5b')]})[_0x3d02('0x1b')](function(_0x11905f){_0x262682[_0x3d02('0x15')]=_0x11905f;if(_0x43f9b3['query'][_0x3d02('0x9e')]){_0x337664[_0x3d02('0x9f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3d02('0x2e')](_0x337664);})[_0x3d02('0x1b')](function(_0x28abb5){_0x262682[_0x3d02('0xa0')]=_0x28abb5;return _0x262682;});}})[_0x3d02('0x1b')](respondWithFilteredResult(_0x541bca,_0x337664))[_0x3d02('0x24')](handleError(_0x541bca,null));};exports[_0x3d02('0xa3')]=function(_0x5b41f7,_0x479f93){var _0x163fbc={'raw':!![],'where':{}};var _0x340713={};var _0x240b35={'count':0x0,'rows':[]};return db[_0x3d02('0x26')][_0x3d02('0x7b')]({'where':{'id':_0x5b41f7['params']['id']}})['then'](handleEntityNotFound(_0x479f93,null))[_0x3d02('0x1b')](function(_0x132659){if(_0x132659){_0x340713[_0x3d02('0x7c')]=_[_0x3d02('0x28')](db[_0x3d02('0xa4')][_0x3d02('0x7d')]);_0x340713[_0x3d02('0x2d')]=_[_0x3d02('0x28')](_0x5b41f7['query']);_0x340713[_0x3d02('0x7e')]=_[_0x3d02('0x7f')](_0x340713[_0x3d02('0x7c')],_0x340713[_0x3d02('0x2d')]);_0x163fbc[_0x3d02('0x80')]=_['intersection'](_0x340713['model'],qs[_0x3d02('0x81')](_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x81')]));_0x163fbc[_0x3d02('0x80')]=_0x163fbc[_0x3d02('0x80')]['length']?_0x163fbc[_0x3d02('0x80')]:_0x340713[_0x3d02('0x7c')];if(!_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x61')](_0x3d02('0x88'))){_0x163fbc[_0x3d02('0x14')]=qs['limit'](_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x14')]);_0x163fbc[_0x3d02('0x16')]=qs[_0x3d02('0x16')](_0x5b41f7[_0x3d02('0x2d')]['offset']);}_0x163fbc[_0x3d02('0x82')]=qs[_0x3d02('0x83')](_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x83')]);_0x163fbc['where']=qs[_0x3d02('0x7e')](_[_0x3d02('0x9c')](_0x5b41f7[_0x3d02('0x2d')],_0x340713[_0x3d02('0x7e')]));_0x163fbc['where'][_0x3d02('0x9d')]=_0x132659['id'];if(_0x5b41f7[_0x3d02('0x2d')]['filter']){_0x163fbc[_0x3d02('0x5b')]=_[_0x3d02('0x85')](_0x163fbc[_0x3d02('0x5b')],{'$or':_['map'](_0x163fbc[_0x3d02('0x80')],function(_0x50c39b){var _0x1da032={};_0x1da032[_0x50c39b]={'$like':'%'+_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x84')]+'%'};return _0x1da032;})});}_0x163fbc=_['merge']({},_0x163fbc,_0x5b41f7[_0x3d02('0x86')]);return db[_0x3d02('0xa4')][_0x3d02('0x15')]({'where':_0x163fbc[_0x3d02('0x5b')]})['then'](function(_0x276891){_0x240b35[_0x3d02('0x15')]=_0x276891;if(_0x5b41f7[_0x3d02('0x2d')][_0x3d02('0x9e')]){_0x163fbc[_0x3d02('0x9f')]=[{'all':!![]}];}return db[_0x3d02('0xa4')][_0x3d02('0x2e')](_0x163fbc);})[_0x3d02('0x1b')](function(_0x4152f5){_0x240b35[_0x3d02('0xa0')]=_0x4152f5;return _0x240b35;});}})['then'](respondWithFilteredResult(_0x479f93,_0x163fbc))[_0x3d02('0x24')](handleError(_0x479f93,null));};exports['uploadCsv']=function(_0x361435,_0x27bb9c){try{if(!_0x361435[_0x3d02('0x35')][_0x3d02('0x5e')]){throw new Error(_0x3d02('0xa5'));}if(!_0x361435[_0x3d02('0x35')][_0x3d02('0xa6')]){throw new Error(_0x3d02('0xa7'));}if(!_0x361435[_0x3d02('0x35')][_0x3d02('0xa8')]){throw new Error(_0x3d02('0xa9'));}if(!_0x361435[_0x3d02('0x35')]['socket_timestamp']){throw new Error(_0x3d02('0xaa'));}var _0x33ded4=_0x361435[_0x3d02('0x35')]['binding_keys']['split'](',');var _0x17bcf6=_0x361435['body']['binding_values'][_0x3d02('0xab')](',');if(!_0x33ded4[_0x3d02('0x29')]||!_0x17bcf6[_0x3d02('0x29')]||_0x33ded4[_0x3d02('0x29')]!==_0x17bcf6['length']){throw new Error(_0x3d02('0xac'));}_0x361435[_0x3d02('0x35')][_0x3d02('0x81')]=_['zipObject'](_0x33ded4,_0x17bcf6);if(!_0x361435[_0x3d02('0x35')][_0x3d02('0x81')]['phone']){throw new Error(_0x3d02('0xad'));}if(!_0x361435[_0x3d02('0x35')]['fields'][_0x3d02('0xae')]){throw new Error(_0x3d02('0xaf'));}var _0x4db434=path[_0x3d02('0x3a')](config[_0x3d02('0xb0')],_0x3d02('0xb1'),_0x361435[_0x3d02('0xb2')][_0x3d02('0xb3')]);fs[_0x3d02('0xb4')](_0x4db434,parseInt(_0x3d02('0xb5'),0x8));var _0x2cf2f7=require(_0x3d02('0xb6'))[_0x3d02('0xb7')](path[_0x3d02('0x3a')](__dirname,'../../components/import/cm/csv'),[_0x4db434,_0x361435['body'][_0x3d02('0xa6')],_0x361435[_0x3d02('0x35')][_0x3d02('0xa8')],_0x361435['body']['ListId'],_0x361435[_0x3d02('0x35')]['CompanyId'],_0x361435['body'][_0x3d02('0x5a')],_0x361435['body'][_0x3d02('0xb8')]]);return _0x27bb9c['status'](0xc8)[_0x3d02('0x12')]({'message':_0x3d02('0xb9'),'pid':_0x2cf2f7[_0x3d02('0xba')]});}catch(_0x2ba0d4){return _0x27bb9c[_0x3d02('0x17')](0x1f4)[_0x3d02('0xbb')](_0x2ba0d4);}};exports[_0x3d02('0xbc')]=function(_0x3fdf70,_0x3df09a){var _0x16af0d=fs[_0x3d02('0xbd')](_0x3fdf70[_0x3d02('0xb2')][_0x3d02('0x2')]);Papa[_0x3d02('0xbe')](_0x16af0d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x251016){return _0x3df09a[_0x3d02('0x17')](0xc8)[_0x3d02('0x12')]({'file':_0x3fdf70['file'],'fields':_0x251016[_0x3d02('0xbf')][_0x3d02('0x81')]});}});};exports[_0x3d02('0xc0')]=function(_0x214bb8,_0x2731f7){return db[_0x3d02('0xc1')][_0x3d02('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x3d02('0x1b')](function(_0x13c1e3){var _0x172cf9=![];if(!_0x214bb8[_0x3d02('0x35')]['ListId']){throw new Error(_0x3d02('0xa5'));}if(!_0x214bb8[_0x3d02('0x35')]['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x214bb8[_0x3d02('0x35')]['binding'][_0x3d02('0xae')]){throw new Error(_0x3d02('0xaf'));}if(!_0x214bb8[_0x3d02('0x35')][_0x3d02('0xb8')]){throw new Error(_0x3d02('0xaa'));}var _0xdca99b=require('child_process')[_0x3d02('0xb7')](path[_0x3d02('0x3a')](__dirname,_0x3d02('0xc2')),[_0x214bb8['params']['id'],JSON[_0x3d02('0xc3')](_0x214bb8[_0x3d02('0x35')]),JSON[_0x3d02('0xc3')](_0x13c1e3)]);_0xdca99b['on'](_0x3d02('0xc4'),function(){_0x172cf9=!![];return _0x2731f7[_0x3d02('0x17')](0xc8)[_0x3d02('0x12')]({'message':'start\x20child\x20process\x20correctly!','pid':_0xdca99b[_0x3d02('0xba')]});});_0xdca99b['on'](_0x3d02('0xc5'),function(_0x5f0878){if(_0x5f0878&&!_0x172cf9){return _0x2731f7[_0x3d02('0x17')](0x1f4)[_0x3d02('0x12')]({'message':_0x3d02('0xc6'),'pid':_0xdca99b[_0x3d02('0xba')]});}});})[_0x3d02('0x24')](handleError(_0x2731f7,null));};exports[_0x3d02('0xc7')]=function(_0x1cd3b7,_0x4019b1){return db[_0x3d02('0xc1')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x3d02('0x1b')](function(_0x147a94){var _0x191882=![];if(!_0x1cd3b7[_0x3d02('0x35')][_0x3d02('0x5e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1cd3b7[_0x3d02('0x35')][_0x3d02('0xc8')][_0x3d02('0x7a')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1cd3b7[_0x3d02('0x35')][_0x3d02('0xc8')]['firstName']){throw new Error(_0x3d02('0xaf'));}if(!_0x1cd3b7['body'][_0x3d02('0xb8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xbc1720=require(_0x3d02('0xb6'))['fork'](path[_0x3d02('0x3a')](__dirname,_0x3d02('0xc9')),[_0x1cd3b7[_0x3d02('0x66')]['id'],JSON['stringify'](_0x1cd3b7['body']),JSON[_0x3d02('0xc3')](_0x147a94)]);_0xbc1720['on'](_0x3d02('0xc4'),function(){_0x191882=!![];return _0x4019b1['status'](0xc8)[_0x3d02('0x12')]({'message':_0x3d02('0xca'),'pid':_0xbc1720[_0x3d02('0xba')]});});_0xbc1720['on'](_0x3d02('0xc5'),function(_0x4cf68b){if(_0x4cf68b&&!_0x191882){return _0x4019b1[_0x3d02('0x17')](0x1f4)[_0x3d02('0x12')]({'message':_0x3d02('0xc6'),'pid':_0xbc1720[_0x3d02('0xba')]});}});})['catch'](handleError(_0x4019b1,null));};exports[_0x3d02('0xcb')]=function(_0x330490,_0x5824dd){var _0x477f44=[_0x3d02('0xcc'),_0x3d02('0xcd'),_0x3d02('0xce'),_0x3d02('0xcf'),_0x3d02('0xd0'),'whatsapp',_0x3d02('0xd1')];var _0x3f1c62={'offset':0x0,'order':qs[_0x3d02('0x83')](_0x3d02('0xd2'))},_0x4715c2={'count':0x0,'rows':[]};Promise[_0x3d02('0xd3')]()[_0x3d02('0x1b')](function(){if(_0x330490['query'][_0x3d02('0xd4')]){if(!_[_0x3d02('0xd5')](_0x477f44,_0x330490['query']['channel']['toLowerCase']())){throw new Error('Invalid\x20channel');}_0x477f44=[_0x330490[_0x3d02('0x2d')]['channel'][_0x3d02('0xd6')]()];}if(_0x330490[_0x3d02('0x2d')][_0x3d02('0xd7')]){try{var _0x5b40c6=JSON['parse'](_0x330490[_0x3d02('0x2d')][_0x3d02('0xd7')]);if(!moment(_0x5b40c6['from'])[_0x3d02('0xd8')]()){throw new Error(_0x3d02('0xd9'));}if(!moment(_0x5b40c6['to'])[_0x3d02('0xd8')]()){throw new Error(_0x3d02('0xda'));}}catch(_0x29a683){throw new Error(_0x3d02('0xdb'));}}if(!_0x330490[_0x3d02('0x2d')]['hasOwnProperty'](_0x3d02('0x88'))){_0x3f1c62[_0x3d02('0x14')]=qs[_0x3d02('0x14')](_0x330490[_0x3d02('0x2d')][_0x3d02('0x14')]||0xa);_0x3f1c62[_0x3d02('0x16')]=qs[_0x3d02('0x16')](_0x330490['query'][_0x3d02('0x16')]);}var _0x3117a8=_0x477f44[_0x3d02('0x71')](function(_0x51d05a){if(_0x51d05a==='voice'){var _0x5c6eac={'attributes':['id','uniqueid',_0x3d02('0x31'),'source',_0x3d02('0xdc'),_0x3d02('0xdd'),_0x3d02('0xde'),_0x3d02('0xdf'),_0x3d02('0xe0'),'note',_0x3d02('0xe1'),_0x3d02('0xe2'),_0x3d02('0xe3'),_0x3d02('0xe4'),_0x3d02('0xe5')],'where':{'ContactId':_0x330490[_0x3d02('0x66')]['id']},'include':[{'model':db[_0x3d02('0xc1')],'as':_0x3d02('0xc1'),'attributes':['id',_0x3d02('0x20'),_0x3d02('0xe6'),_0x3d02('0x2f')]}],'order':[[_0x3d02('0xe1'),_0x3d02('0xe7')]]};if(_0x330490[_0x3d02('0x2d')][_0x3d02('0xd7')]){_0x5c6eac[_0x3d02('0x5b')]['createdAt']={'$gte':_0x5b40c6[_0x3d02('0x36')],'$lte':_0x5b40c6['to']};}return db[_0x3d02('0x4b')][_0x3d02('0xe8')](_0x5c6eac)[_0x3d02('0x1b')](function(_0x459093){_0x4715c2['count']+=_0x459093[_0x3d02('0x15')];return _['map'](_0x459093[_0x3d02('0xa0')],function(_0x52ccd7){var _0x23080c=_0x52ccd7[_0x3d02('0x37')]({'plain':!![]});_0x23080c[_0x3d02('0xd4')]=_0x51d05a;if(_0x23080c['User']){_0x23080c['User']={'id':_0x23080c[_0x3d02('0xc1')]['id'],'name':_0x23080c[_0x3d02('0xc1')]['name'],'fullname':_0x23080c['User'][_0x3d02('0xe6')],'alias':_0x23080c['User'][_0x3d02('0x2f')]};}return _0x23080c;});});}else{var _0x39c2fc=_['startCase'](_0x51d05a)+(_0x51d05a==='chat'?_0x3d02('0xe9'):_0x3d02('0xea'));var _0x41324f={'attributes':['id',_0x3d02('0xeb'),_0x3d02('0xec'),_0x3d02('0xe1'),_0x3d02('0xed'),_0x3d02('0xee'),_0x3d02('0xef'),_0x3d02('0xf0'),_0x3d02('0xe5'),_0x39c2fc+'Id'],'where':{'ContactId':_0x330490[_0x3d02('0x66')]['id']},'include':[{'model':db[_0x39c2fc],'as':_0x3d02('0xea'),'attributes':['id','name',_0x3d02('0xf1')]},{'model':db[_0x3d02('0xc1')],'as':_0x3d02('0xf2'),'attributes':['id','name',_0x3d02('0xe6')]},{'model':db[_0x3d02('0xf3')],'as':_0x3d02('0x67'),'attributes':['id',_0x3d02('0x20'),'color'],'through':{'attributes':[]}}],'order':[[_0x3d02('0xe1'),_0x3d02('0xe7')]]};if(_0x330490[_0x3d02('0x2d')][_0x3d02('0xd7')]){_0x41324f[_0x3d02('0x5b')]['createdAt']={'$gte':_0x5b40c6[_0x3d02('0x36')],'$lte':_0x5b40c6['to']};}switch(_0x51d05a){case'chat':_0x41324f['attributes'][_0x3d02('0x5d')]('browserName',_0x3d02('0xf4'),_0x3d02('0xf5'),_0x3d02('0xf6'),_0x3d02('0xf7'),_0x3d02('0xf8'),_0x3d02('0xf9'),_0x3d02('0xfa'),_0x3d02('0xfb'));break;case _0x3d02('0xcc'):_0x41324f[_0x3d02('0x80')][_0x3d02('0x5d')](_0x3d02('0xfc'),_0x3d02('0xfd'));break;case _0x3d02('0xcf'):_0x41324f[_0x3d02('0x80')][_0x3d02('0x5d')](_0x3d02('0xfe'),'threadId');break;}return db[_['startCase'](_0x51d05a)+'Interaction']['findAndCountAll'](_0x41324f)['then'](function(_0x2588fc){_0x4715c2[_0x3d02('0x15')]+=_0x2588fc[_0x3d02('0x15')];return _[_0x3d02('0x71')](_0x2588fc[_0x3d02('0xa0')],function(_0x332fae){var _0x72475d=_0x332fae[_0x3d02('0x37')]({'plain':!![]});_0x72475d[_0x3d02('0xd4')]=_0x51d05a;if(_0x72475d[_0x3d02('0xf2')]){_0x72475d[_0x3d02('0xf2')]={'id':_0x72475d[_0x3d02('0xf2')]['id'],'name':_0x72475d[_0x3d02('0xf2')]['name'],'fullname':_0x72475d[_0x3d02('0xf2')][_0x3d02('0xe6')]};}return _0x72475d;});});}});return Promise['all'](_0x3117a8);})['then'](function(_0x56e049){return _(_0x56e049)[_0x3d02('0xff')]()[_0x3d02('0x100')]('createdAt')[_0x3d02('0x101')]()[_0x3d02('0x102')]();})[_0x3d02('0x1b')](function(_0x183664){_0x4715c2['rows']=_0x3f1c62[_0x3d02('0x14')]?_0x183664['slice'](_0x3f1c62[_0x3d02('0x16')],_0x3f1c62[_0x3d02('0x16')]+_0x3f1c62['limit']):_0x183664;return _0x4715c2;})[_0x3d02('0x1b')](respondWithFilteredResult(_0x5824dd,_0x3f1c62))[_0x3d02('0x24')](handleError(_0x5824dd,null));}; \ No newline at end of file +var _0x44c2=['FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','catch','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','show','Tag','Tags','color','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','CmCustomField','omit','cf_%d','pickBy','map','isEmpty','cm_contacts','setFields','toParam','text','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','nolimit','limit','getTags','setTags','ids','setAdditionalPhones','all','items','item_types','ItemTypeId','description','find','OrderBy','PHONE','literal','`ItemType`.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','includeAll','include','rows','ContactId','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','meta','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','start\x20child\x20process\x20correctly!','getJourney','mail','chat','fax','voice','resolve','channel','includes','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','note','createdAt','fullname','DESC','findAndCountAll','startCase','Website','Account','thirdDisposition','UserId','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','openchannel','externalUrl','threadId','Owner','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','undefined','count','offset','set','update','destroy','then','end','sendStatus','error','stack','name','send','describe','getOptions','findAll','query','user','CmContact','params','tags','keys','length','startsWith','cf_','displayName','analytics','columnName','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport'];(function(_0x524c12,_0x58ec1d){var _0x7649a2=function(_0x3fa4ae){while(--_0x3fa4ae){_0x524c12['push'](_0x524c12['shift']());}};_0x7649a2(++_0x58ec1d);}(_0x44c2,0x1a3));var _0x244c=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x44c2[_0x36bfe3];return _0x9b0436;};'use strict';var moment=require(_0x244c('0x0'));var BPromise=require(_0x244c('0x1'));var util=require(_0x244c('0x2'));var path=require(_0x244c('0x3'));var fs=require('fs');var _=require(_0x244c('0x4'));var squel=require(_0x244c('0x5'));var Papa=require('papaparse');var Redis=require(_0x244c('0x6'));var contacts=require(_0x244c('0x7'));var qs=require(_0x244c('0x8'));var logger=require(_0x244c('0x9'))(_0x244c('0xa'));var config=require(_0x244c('0xb'));var shared=require('../../config/environment/shared');var db=require(_0x244c('0xc'))['db'];config['redis']=_[_0x244c('0xd')](config[_0x244c('0xe')],{'host':_0x244c('0xf'),'port':0x18eb});var socket=require(_0x244c('0x10'))(new Redis(config['redis']));require(_0x244c('0x11'))[_0x244c('0x12')](socket);function respondWithResult(_0x741d02,_0x1ca202){_0x1ca202=_0x1ca202||0xc8;return function(_0x75d950){if(_0x75d950){return _0x741d02[_0x244c('0x13')](_0x1ca202)[_0x244c('0x14')](_0x75d950);}};}function respondWithFilteredResult(_0x3f1592,_0x3dd0f0){return function(_0x39f961){if(_0x39f961){var _0x2b31d1=typeof _0x3dd0f0['offset']===_0x244c('0x15')&&typeof _0x3dd0f0['limit']===_0x244c('0x15');var _0x1f825b=_0x39f961[_0x244c('0x16')];var _0x5b41dc=_0x2b31d1?0x0:_0x3dd0f0['offset'];var _0x40bcb0=_0x2b31d1?_0x39f961[_0x244c('0x16')]:_0x3dd0f0[_0x244c('0x17')]+_0x3dd0f0['limit'];var _0x390c1a;if(_0x40bcb0>=_0x1f825b){_0x40bcb0=_0x1f825b;_0x390c1a=0xc8;}else{_0x390c1a=0xce;}_0x3f1592[_0x244c('0x13')](_0x390c1a);return _0x3f1592[_0x244c('0x18')]('Content-Range',_0x5b41dc+'-'+_0x40bcb0+'/'+_0x1f825b)[_0x244c('0x14')](_0x39f961);}return null;};}function saveUpdates(_0x43fe97){return function(_0x2fdab1){if(_0x2fdab1){return _0x2fdab1[_0x244c('0x19')](_0x43fe97)['then'](function(_0x27ce6d){return _0x27ce6d;});}return null;};}function removeEntity(_0x2d2bab){return function(_0x277202){if(_0x277202){return _0x277202[_0x244c('0x1a')]()[_0x244c('0x1b')](function(){_0x2d2bab['status'](0xcc)[_0x244c('0x1c')]();});}};}function handleEntityNotFound(_0x65442a){return function(_0x1ee2cd){if(!_0x1ee2cd){_0x65442a[_0x244c('0x1d')](0x194);}return _0x1ee2cd;};}function handleError(_0x54ab04,_0x280f3a){_0x280f3a=_0x280f3a||0x1f4;return function(_0x48e80a){logger[_0x244c('0x1e')](_0x48e80a[_0x244c('0x1f')]);if(_0x48e80a[_0x244c('0x20')]){delete _0x48e80a['name'];}_0x54ab04['status'](_0x280f3a)[_0x244c('0x21')](_0x48e80a);};}exports['index']=function(_0x3c12c7,_0x52d434){var _0x5e7dac={};return contacts[_0x244c('0x22')]()[_0x244c('0x1b')](function(_0x5853e0){_0x5e7dac=qs[_0x244c('0x23')](_0x5853e0,_0x3c12c7);return contacts[_0x244c('0x24')](_0x3c12c7[_0x244c('0x25')],_0x3c12c7[_0x244c('0x26')],_0x5e7dac,_0x5853e0);})[_0x244c('0x1b')](respondWithFilteredResult(_0x52d434,_0x5e7dac))['catch'](handleError(_0x52d434,null));};exports['destroy']=function(_0x131601,_0x3990e1){return db[_0x244c('0x27')]['find']({'where':{'id':_0x131601[_0x244c('0x28')]['id']}})[_0x244c('0x1b')](handleEntityNotFound(_0x3990e1,null))[_0x244c('0x1b')](removeEntity(_0x3990e1,null))['catch'](handleError(_0x3990e1,null));};exports['describe']=function(_0x38ac7e,_0xa70b0b){return db[_0x244c('0x27')][_0x244c('0x22')]()[_0x244c('0x1b')](function(_0x17b648){delete _0x17b648[_0x244c('0x29')];for(var _0x2d4c33=0x0;_0x2d4c330x0){return new Promise(function(_0x112230){var _0x32cd85=[];for(var _0x3fa0f1=0x0;_0x3fa0f1<_0x3f7274[_0x244c('0x2b')];_0x3fa0f1++){_0x32cd85[_0x244c('0x68')](insertAdditionalPhones(_0x3f7274[_0x3fa0f1]['contact'],_0x3f7274[_0x3fa0f1][_0x244c('0x62')]));}Promise['all'](_0x32cd85)[_0x244c('0x1b')](function(){_0x112230(0x1);});})[_0x244c('0x1b')](function(){return{'success':_0x35ce33,'failure':_0x21dbcf,'duplicates':_0x5ae0b1};});}else{return{'success':_0x35ce33,'failure':_0x21dbcf,'duplicates':_0x5ae0b1};}}})[_0x244c('0x1b')](respondWithResult(_0x370b6a,0xc9))[_0x244c('0x5d')](handleError(_0x370b6a,null));};exports[_0x244c('0x6c')]=function(_0x4336a7,_0x31b8e4){var _0x154cc1;return db[_0x244c('0x27')][_0x244c('0x22')]()['then'](function(_0x299b62){return db[_0x244c('0x27')]['find']({'where':{'id':_0x4336a7[_0x244c('0x28')]['id']},'include':[{'model':db[_0x244c('0x6d')],'as':_0x244c('0x6e'),'attributes':['id',_0x244c('0x20'),_0x244c('0x6f')],'required':_0x4336a7['query']['tag']?!![]:![]},{'model':db[_0x244c('0x4f')],'as':_0x244c('0x70'),'where':{'CmContactId':_0x4336a7[_0x244c('0x28')]['id']},'required':![],'include':[{'model':db[_0x244c('0x71')],'as':_0x244c('0x72')}]}],'order':[db[_0x244c('0x73')]['literal'](_0x244c('0x74'))],'attributes':_[_0x244c('0x2a')](_0x299b62)});})[_0x244c('0x1b')](function(_0x21d860){if(!_[_0x244c('0x5f')](_0x21d860)){_0x154cc1=_0x21d860[_0x244c('0x3b')]({'plain':!![]});var _0x50cc9b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x21d860&&_0x21d860[_0x244c('0x69')]){if(_0x21d860[_0x244c('0x69')]){_0x50cc9b[_0x244c('0x66')][_0x244c('0x75')][_0x244c('0x68')]({'ListId':{'$ne':_0x21d860['ListId']}});}}return db[_0x244c('0x76')]['findAll'](_0x50cc9b);}})[_0x244c('0x1b')](function(_0x18004e){if(!_[_0x244c('0x5f')](_0x18004e)){return _[_0x244c('0x77')](_0x154cc1,_['map'](_0x18004e,function(_0x188941){return util['format'](_0x244c('0x78'),_0x188941['id']);}));}})[_0x244c('0x1b')](handleEntityNotFound(_0x31b8e4,null))['then'](respondWithResult(_0x31b8e4,null))[_0x244c('0x5d')](handleError(_0x31b8e4,null));};exports['update']=function(_0x1403fb,_0x43f288){var _0x2a13d0;if(_0x1403fb['body']['id']){delete _0x1403fb['body']['id'];}if(!_[_0x244c('0x5f')](_0x1403fb['body'][_0x244c('0x5e')])){var _0x4b88f4=_0x1403fb[_0x244c('0x39')][_0x244c('0x5e')];if(!_[_0x244c('0x5f')](shared['timezones'][_0x4b88f4]))_0x1403fb[_0x244c('0x39')]['utcOffset']=shared['timezones'][_0x4b88f4][_0x244c('0x61')];}return db[_0x244c('0x27')]['find']({'where':{'id':_0x1403fb[_0x244c('0x28')]['id']}})[_0x244c('0x1b')](handleEntityNotFound(_0x43f288,null))['then'](saveUpdates(_0x1403fb[_0x244c('0x39')],null))[_0x244c('0x1b')](function(_0x37c83b){_0x2a13d0=_0x37c83b;var _0x2564db={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x37c83b&&_0x37c83b[_0x244c('0x69')]){if(_0x37c83b[_0x244c('0x69')]){_0x2564db[_0x244c('0x66')]['$and'][_0x244c('0x68')]({'ListId':{'$ne':_0x37c83b[_0x244c('0x69')]}});}}return db[_0x244c('0x76')]['findAll'](_0x2564db);})[_0x244c('0x1b')](function(_0x1e8f04){if(_0x1e8f04){return _[_0x244c('0x77')](_[_0x244c('0x79')](_0x1403fb[_0x244c('0x39')],function(_0x1c02c7,_0xa5f736){return _[_0x244c('0x2c')](_0xa5f736,_0x244c('0x2d'));}),_[_0x244c('0x7a')](_0x1e8f04,function(_0x51bf79){return util['format'](_0x244c('0x78'),_0x51bf79['id']);}));}})[_0x244c('0x1b')](function(_0x1f1948){if(_0x1f1948&&!_[_0x244c('0x7b')](_0x1f1948)){var _0x42ff59=squel['update']()['table'](_0x244c('0x7c'))[_0x244c('0x7d')](_0x1f1948)[_0x244c('0x66')]('id\x20=\x20?',_0x1403fb[_0x244c('0x28')]['id'])[_0x244c('0x7e')]();return db[_0x244c('0x73')][_0x244c('0x25')](_0x42ff59[_0x244c('0x7f')],{'replacements':_0x42ff59[_0x244c('0x34')]});}})[_0x244c('0x1b')](function(){if(_0x1403fb[_0x244c('0x39')][_0x244c('0x80')]&&_0x2a13d0){return db['CmHopper'][_0x244c('0x19')]({'phone':_0x1403fb[_0x244c('0x39')][_0x244c('0x80')],'OrderBy':0x0},{'where':{'ContactId':_0x2a13d0['id']}});}})[_0x244c('0x1b')](function(){return _0x2a13d0;})[_0x244c('0x1b')](respondWithResult(_0x43f288,null))[_0x244c('0x5d')](handleError(_0x43f288,null));};exports['getTags']=function(_0x289675,_0x55f864){var _0x3fa6f5={};var _0x35c6cd={};var _0x478522;var _0x23b357;return db[_0x244c('0x27')][_0x244c('0x81')]({'where':{'id':_0x289675[_0x244c('0x28')]['id']}})[_0x244c('0x1b')](handleEntityNotFound(_0x55f864,null))[_0x244c('0x1b')](function(_0xdc8988){if(_0xdc8988){_0x478522=_0xdc8988;_0x35c6cd[_0x244c('0x82')]=_[_0x244c('0x2a')](db[_0x244c('0x6d')][_0x244c('0x83')]);_0x35c6cd[_0x244c('0x25')]=_[_0x244c('0x2a')](_0x289675[_0x244c('0x25')]);_0x35c6cd[_0x244c('0x84')]=_[_0x244c('0x85')](_0x35c6cd[_0x244c('0x82')],_0x35c6cd[_0x244c('0x25')]);_0x3fa6f5[_0x244c('0x86')]=_[_0x244c('0x85')](_0x35c6cd[_0x244c('0x82')],qs[_0x244c('0x87')](_0x289675[_0x244c('0x25')]['fields']));_0x3fa6f5['attributes']=_0x3fa6f5[_0x244c('0x86')]['length']?_0x3fa6f5[_0x244c('0x86')]:_0x35c6cd[_0x244c('0x82')];_0x3fa6f5[_0x244c('0x88')]=qs[_0x244c('0x89')](_0x289675[_0x244c('0x25')][_0x244c('0x89')]);_0x3fa6f5[_0x244c('0x66')]=qs[_0x244c('0x84')](_[_0x244c('0x8a')](_0x289675[_0x244c('0x25')],_0x35c6cd[_0x244c('0x84')]));if(_0x289675[_0x244c('0x25')][_0x244c('0x8b')]){_0x3fa6f5[_0x244c('0x66')]=_[_0x244c('0x8c')](_0x3fa6f5[_0x244c('0x66')],{'$or':_[_0x244c('0x7a')](_0x3fa6f5[_0x244c('0x86')],function(_0x32e233){var _0x25c8b5={};_0x25c8b5[_0x32e233]={'$like':'%'+_0x289675[_0x244c('0x25')]['filter']+'%'};return _0x25c8b5;})});}_0x3fa6f5=_[_0x244c('0x8c')]({},_0x3fa6f5,_0x289675[_0x244c('0x8d')]);return _0x478522['getTags'](_0x3fa6f5);}})['then'](function(_0x469a7c){if(_0x469a7c){_0x23b357=_0x469a7c[_0x244c('0x2b')];if(!_0x289675[_0x244c('0x25')][_0x244c('0x38')](_0x244c('0x8e'))){_0x3fa6f5[_0x244c('0x8f')]=qs['limit'](_0x289675[_0x244c('0x25')]['limit']);_0x3fa6f5[_0x244c('0x17')]=qs[_0x244c('0x17')](_0x289675['query']['offset']);}return _0x478522[_0x244c('0x90')](_0x3fa6f5);}})[_0x244c('0x1b')](function(_0x36700e){if(_0x36700e){return _0x36700e?{'count':_0x23b357,'rows':_0x36700e}:null;}})[_0x244c('0x1b')](respondWithResult(_0x55f864,null))[_0x244c('0x5d')](handleError(_0x55f864,null));};exports[_0x244c('0x91')]=function(_0x396a9c,_0xdda361){if(_0x396a9c['body']['id']){delete _0x396a9c[_0x244c('0x39')]['id'];}return db[_0x244c('0x27')]['findOne']({'where':{'id':_0x396a9c['params']['id']}})['then'](handleEntityNotFound(_0xdda361,null))[_0x244c('0x1b')](function(_0x1209d6){if(_0x1209d6){return _0x1209d6['setTags'](_0x396a9c['body'][_0x244c('0x92')]||[]);}return null;})[_0x244c('0x1b')](respondWithResult(_0xdda361,null))[_0x244c('0x5d')](handleError(_0xdda361,null));};exports[_0x244c('0x93')]=function(_0x49dadb,_0x58f78a){var _0x550382=[];_0x550382[_0x244c('0x68')](addAdditionalPhones(_0x49dadb[_0x244c('0x39')]));Promise[_0x244c('0x94')](_0x550382)['then'](function(){_0x550382=[];_0x550382['push'](deleteCmHopperPhones(_0x49dadb[_0x244c('0x39')]['id']));_0x550382['push'](addCmHopperPhones(_0x49dadb[_0x244c('0x39')]['id']));Promise['all'](_0x550382)[_0x244c('0x1b')](function(){return[0x1];})['then'](respondWithResult(_0x58f78a,null));});};function addAdditionalPhones(_0x2ba417){var _0x130be1;return new Promise(function(_0x4a546e){return db[_0x244c('0x4f')][_0x244c('0x1a')]({'where':{'CmContactId':_0x2ba417['id']}})[_0x244c('0x1b')](function(){db[_0x244c('0x71')][_0x244c('0x24')]({'raw':!![],'attributes':['id','OrderBy']})[_0x244c('0x1b')](function(_0x370e26){var _0x1936d4=[];for(var _0x3ae0f3=0x0;_0x3ae0f3<_0x2ba417[_0x244c('0x95')][_0x244c('0x2b')];_0x3ae0f3++){var _0x3026d5=_0x2ba417[_0x244c('0x96')]?_['isNil'](_0x2ba417['item_types'][_0x3ae0f3])?'':_0x2ba417[_0x244c('0x96')][_0x3ae0f3]:_0x2ba417['items'][_0x3ae0f3][_0x244c('0x97')]?_0x2ba417['items'][_0x3ae0f3]['ItemTypeId']:'';var _0x42e78e=_['isNil'](_0x2ba417[_0x244c('0x95')][_0x3ae0f3][_0x244c('0x98')])?'':_0x2ba417['items'][_0x3ae0f3]['description'];var _0x3079f5=_0x3026d5+':'+_0x2ba417[_0x244c('0x95')][_0x3ae0f3][_0x244c('0x80')]+'§'+_0x42e78e;if(_['isNil'](_0x130be1))_0x130be1=_0x3079f5;else _0x130be1+=';'+_0x3079f5;var _0xc1958f=null;var _0x811f71=null;if(_0x2ba417[_0x244c('0x96')]){if(!_['isNil'](_0x2ba417[_0x244c('0x96')][_0x3ae0f3])){_0x811f71=_[_0x244c('0x99')](_0x370e26,function(_0x52dcf0){return _0x52dcf0['id']===_0x2ba417[_0x244c('0x96')][_0x3ae0f3];});if(!_[_0x244c('0x5f')](_0x811f71)){_0xc1958f=_0x811f71[_0x244c('0x9a')];}}}else{if(!_[_0x244c('0x5f')](_0x2ba417[_0x244c('0x95')][_0x3ae0f3])){_0x811f71=_[_0x244c('0x99')](_0x370e26,function(_0x2b0dbb){return _0x2b0dbb['id']===_0x2ba417[_0x244c('0x95')][_0x3ae0f3][_0x244c('0x97')];});if(!_[_0x244c('0x5f')](_0x811f71)){_0xc1958f=_0x3ae0f3;}}}if(_[_0x244c('0x5f')](_0xc1958f)){_0xc1958f=0x64;}_0x1936d4[_0x244c('0x68')](addAdditionalPhone(_0x2ba417['id'],_0x2ba417[_0x244c('0x95')][_0x3ae0f3][_0x244c('0x80')],_0x2ba417[_0x244c('0x96')]?_[_0x244c('0x5f')](_0x2ba417[_0x244c('0x96')][_0x3ae0f3])?null:_0x2ba417[_0x244c('0x96')][_0x3ae0f3]:_0x2ba417['items'][_0x3ae0f3]['ItemTypeId']?_0x2ba417[_0x244c('0x95')][_0x3ae0f3]['ItemTypeId']:null,_0xc1958f,_0x42e78e));}Promise[_0x244c('0x94')](_0x1936d4)[_0x244c('0x1b')](function(){db[_0x244c('0x27')][_0x244c('0x19')]({'AdditionalPhones':_0x130be1},{'where':{'id':_0x2ba417['id']}})[_0x244c('0x1b')](function(){_0x4a546e(0x1);});});});});});}function addAdditionalPhone(_0x4d0697,_0xbe4be8,_0x881316,_0x9f16f7,_0x212787){return db[_0x244c('0x4f')][_0x244c('0x99')]({'where':{'CmContactId':_0x4d0697,'item':_0xbe4be8}})[_0x244c('0x1b')](function(_0x2cfdcb){if(_0x2cfdcb)logger['info']('contact\x20phone\x20exists',_0x2cfdcb);else{db[_0x244c('0x4f')][_0x244c('0x44')]({'CmContactId':_0x4d0697,'item':_0xbe4be8,'ItemTypeId':_0x881316,'OrderBy':_0x9f16f7,'ItemClass':_0x244c('0x9b'),'description':_0x212787});}});}function deleteCmHopperPhones(_0x8f1545){return new Promise(function(_0x2fba19){return db[_0x244c('0x40')][_0x244c('0x24')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x8f1545}})['then'](function(_0x3f053b){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0x244c('0x7a')](_0x3f053b,'id')}}});})[_0x244c('0x1b')](function(){_0x2fba19(0x1);});});}function addCmHopperPhones(_0x5dab0d){return new Promise(function(_0x1c0659){return db[_0x244c('0x40')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5dab0d}})['then'](function(_0xd29648){var _0x38b3b8=[];_[_0x244c('0x7a')](_0xd29648,function(_0x122e83){_0x38b3b8['push'](createCmHopperPhone(_0x5dab0d,_0x122e83['id']));});Promise[_0x244c('0x94')](_0x38b3b8)['then'](function(){_0x1c0659(0x1);});});});}function createCmHopperPhone(_0x19f2b3,_0x53892e){return new Promise(function(_0x215274){db['CmContactHasItem'][_0x244c('0x24')]({'raw':!![],'attributes':['item',_0x244c('0x9a')],'where':{'CmContactId':_0x19f2b3,'ItemClass':_0x244c('0x9b')},'include':[{'model':db['ContactItemType'],'attributes':['OrderBy'],'as':_0x244c('0x72')}],'order':[_0x244c('0x9a'),db[_0x244c('0x73')][_0x244c('0x9c')](_0x244c('0x9d'))]})[_0x244c('0x1b')](function(_0x49f2cb){var _0x52d058=0x1;var _0x2d18a9=_['map'](_0x49f2cb,function(_0x4bf3f2){_0x4bf3f2['CmHopperId']=_0x53892e;_0x4bf3f2[_0x244c('0x80')]=_0x4bf3f2['item'];_0x4bf3f2[_0x244c('0x9a')]=_0x52d058;delete _0x4bf3f2['ItemType.OrderBy'];_0x52d058=_0x52d058+0x1;return _0x4bf3f2;});return db[_0x244c('0x9e')][_0x244c('0x63')](_0x2d18a9,{});})[_0x244c('0x1b')](function(){_0x215274(0x1);});});}function insertAdditionalPhones(_0xa8039f,_0x158b64){return new Promise(function(_0xa6f2e){var _0x4437d8=[];for(var _0x2780cd=0x0;_0x2780cd<_0x158b64[_0x244c('0x2b')];_0x2780cd++){var _0x3a9a42=_0x158b64[_0x2780cd];_0x4437d8[_0x244c('0x68')](parseContactItemType(_0x3a9a42));}Promise[_0x244c('0x94')](_0x4437d8)[_0x244c('0x1b')](function(){var _0x22c606={'id':_0xa8039f['id'],'items':_0x158b64};return addAdditionalPhones(_0x22c606)[_0x244c('0x1b')](function(){return addCmHopperPhones(_0xa8039f['id']);});})[_0x244c('0x1b')](function(){_0xa6f2e(_0xa8039f);});});}function parseContactItemType(_0x5ef4ab){return new Promise(function(_0x17f5c4){if(_0x5ef4ab[_0x244c('0x38')](_0x244c('0x97'))){_0x17f5c4(_0x5ef4ab);}else{return db[_0x244c('0x71')][_0x244c('0x99')]({'where':{'name':_0x5ef4ab[_0x244c('0x72')]}})[_0x244c('0x1b')](function(_0x3888f0){if(_[_0x244c('0x5f')](_0x3888f0))_0x5ef4ab[_0x244c('0x97')]=null;else _0x5ef4ab[_0x244c('0x97')]=_0x3888f0['id'];_0x17f5c4(_0x5ef4ab);});}});}exports[_0x244c('0x9f')]=function(_0x169d8f,_0x173541){return db[_0x244c('0x4f')][_0x244c('0x24')]({'raw':!![],'where':{'CmContactId':_0x169d8f[_0x244c('0x28')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x244c('0x71')],'as':_0x244c('0x72')}],'order':[['OrderBy'],[db[_0x244c('0x73')]['literal'](_0x244c('0x9d'))]]})[_0x244c('0x1b')](function(_0x5760d3){return _0x5760d3;})[_0x244c('0x1b')](respondWithResult(_0x173541,null))[_0x244c('0x5d')](handleError(_0x173541,null));};exports[_0x244c('0xa0')]=function(_0x4be330,_0x4d5313){return db[_0x244c('0x4f')][_0x244c('0x24')]({'raw':!![],'where':{'CmContactId':_0x4be330[_0x244c('0x39')][_0x244c('0xa1')]}})[_0x244c('0x1b')](function(_0x13a060){var _0x206429=_['map'](_0x13a060,function(_0x22527a){_0x22527a[_0x244c('0xa2')]=_0x4be330[_0x244c('0x39')][_0x244c('0xa3')];return _0x22527a;});return db[_0x244c('0x4f')]['bulkCreate'](_0x206429,{});})[_0x244c('0x1b')](function(){return addCmHopperPhones(_0x4be330[_0x244c('0x39')][_0x244c('0xa3')]);})['then'](function(){return['ok'];})[_0x244c('0x1b')](respondWithResult(_0x4d5313,null))['catch'](handleError(_0x4d5313,null));};exports[_0x244c('0xa4')]=function(_0x5174f2,_0x49c521){var _0x81e86f=[];_0x81e86f[_0x244c('0x68')](createCmHopperPhone(_0x5174f2[_0x244c('0x39')]['id'],_0x5174f2[_0x244c('0x39')][_0x244c('0xa5')]));Promise['all'](_0x81e86f)[_0x244c('0x1b')](function(){return[0x1];})[_0x244c('0x1b')](respondWithResult(_0x49c521,null));};exports['getHoppers']=function(_0x30d3d3,_0x3de529){var _0x19b636={'raw':![],'where':{}};var _0x841c27={};var _0x337fab={'count':0x0,'rows':[]};return db['CmContact'][_0x244c('0x81')]({'where':{'id':_0x30d3d3['params']['id']}})[_0x244c('0x1b')](handleEntityNotFound(_0x3de529,null))[_0x244c('0x1b')](function(_0x38ee28){if(_0x38ee28){_0x841c27[_0x244c('0x82')]=_[_0x244c('0x2a')](db[_0x244c('0x40')][_0x244c('0x83')]);_0x841c27[_0x244c('0x25')]=_[_0x244c('0x2a')](_0x30d3d3[_0x244c('0x25')]);_0x841c27['filters']=_[_0x244c('0x85')](_0x841c27[_0x244c('0x82')],_0x841c27[_0x244c('0x25')]);_0x19b636['attributes']=_['intersection'](_0x841c27['model'],qs[_0x244c('0x87')](_0x30d3d3[_0x244c('0x25')][_0x244c('0x87')]));_0x19b636[_0x244c('0x86')]=_0x19b636[_0x244c('0x86')][_0x244c('0x2b')]?_0x19b636[_0x244c('0x86')]:_0x841c27[_0x244c('0x82')];if(!_0x30d3d3[_0x244c('0x25')][_0x244c('0x38')](_0x244c('0x8e'))){_0x19b636[_0x244c('0x8f')]=qs['limit'](_0x30d3d3[_0x244c('0x25')][_0x244c('0x8f')]);_0x19b636[_0x244c('0x17')]=qs[_0x244c('0x17')](_0x30d3d3['query'][_0x244c('0x17')]);}_0x19b636[_0x244c('0x88')]=qs[_0x244c('0x89')](_0x30d3d3['query'][_0x244c('0x89')]);_0x19b636['where']=qs[_0x244c('0x84')](_['pick'](_0x30d3d3[_0x244c('0x25')],_0x841c27['filters']));_0x19b636[_0x244c('0x66')]['ContactId']=_0x38ee28['id'];if(_0x30d3d3[_0x244c('0x25')]['filter']){_0x19b636['where']=_[_0x244c('0x8c')](_0x19b636['where'],{'$or':_[_0x244c('0x7a')](_0x19b636[_0x244c('0x86')],function(_0x2ea803){var _0x178703={};_0x178703[_0x2ea803]={'$like':'%'+_0x30d3d3[_0x244c('0x25')][_0x244c('0x8b')]+'%'};return _0x178703;})});}_0x19b636=_[_0x244c('0x8c')]({},_0x19b636,_0x30d3d3[_0x244c('0x8d')]);return db[_0x244c('0x40')][_0x244c('0x16')]({'where':_0x19b636['where']})['then'](function(_0x597f0b){_0x337fab[_0x244c('0x16')]=_0x597f0b;if(_0x30d3d3[_0x244c('0x25')][_0x244c('0xa6')]){_0x19b636[_0x244c('0xa7')]=[{'all':!![]}];}return db[_0x244c('0x40')][_0x244c('0x24')](_0x19b636);})[_0x244c('0x1b')](function(_0x54fefc){_0x337fab[_0x244c('0xa8')]=_0x54fefc;return _0x337fab;});}})[_0x244c('0x1b')](respondWithFilteredResult(_0x3de529,_0x19b636))['catch'](handleError(_0x3de529,null));};exports['getHopperHistories']=function(_0x484629,_0x462f13){var _0x107dc5={'raw':!![],'where':{}};var _0x49e31f={};var _0x79f40c={'count':0x0,'rows':[]};return db[_0x244c('0x27')][_0x244c('0x81')]({'where':{'id':_0x484629['params']['id']}})[_0x244c('0x1b')](handleEntityNotFound(_0x462f13,null))[_0x244c('0x1b')](function(_0x5193c8){if(_0x5193c8){_0x49e31f[_0x244c('0x82')]=_['keys'](db[_0x244c('0x51')][_0x244c('0x83')]);_0x49e31f[_0x244c('0x25')]=_[_0x244c('0x2a')](_0x484629[_0x244c('0x25')]);_0x49e31f[_0x244c('0x84')]=_[_0x244c('0x85')](_0x49e31f[_0x244c('0x82')],_0x49e31f[_0x244c('0x25')]);_0x107dc5[_0x244c('0x86')]=_['intersection'](_0x49e31f[_0x244c('0x82')],qs[_0x244c('0x87')](_0x484629['query'][_0x244c('0x87')]));_0x107dc5[_0x244c('0x86')]=_0x107dc5[_0x244c('0x86')][_0x244c('0x2b')]?_0x107dc5[_0x244c('0x86')]:_0x49e31f['model'];if(!_0x484629['query']['hasOwnProperty'](_0x244c('0x8e'))){_0x107dc5[_0x244c('0x8f')]=qs[_0x244c('0x8f')](_0x484629[_0x244c('0x25')][_0x244c('0x8f')]);_0x107dc5['offset']=qs['offset'](_0x484629[_0x244c('0x25')][_0x244c('0x17')]);}_0x107dc5[_0x244c('0x88')]=qs[_0x244c('0x89')](_0x484629[_0x244c('0x25')]['sort']);_0x107dc5['where']=qs[_0x244c('0x84')](_[_0x244c('0x8a')](_0x484629['query'],_0x49e31f[_0x244c('0x84')]));_0x107dc5[_0x244c('0x66')][_0x244c('0xa9')]=_0x5193c8['id'];if(_0x484629[_0x244c('0x25')][_0x244c('0x8b')]){_0x107dc5['where']=_['merge'](_0x107dc5[_0x244c('0x66')],{'$or':_[_0x244c('0x7a')](_0x107dc5[_0x244c('0x86')],function(_0x525b02){var _0x713e00={};_0x713e00[_0x525b02]={'$like':'%'+_0x484629['query'][_0x244c('0x8b')]+'%'};return _0x713e00;})});}_0x107dc5=_[_0x244c('0x8c')]({},_0x107dc5,_0x484629['options']);return db[_0x244c('0x51')][_0x244c('0x16')]({'where':_0x107dc5[_0x244c('0x66')]})['then'](function(_0x1ddc5a){_0x79f40c['count']=_0x1ddc5a;if(_0x484629[_0x244c('0x25')][_0x244c('0xa6')]){_0x107dc5['include']=[{'all':!![]}];}return db[_0x244c('0x51')][_0x244c('0x24')](_0x107dc5);})['then'](function(_0x276776){_0x79f40c[_0x244c('0xa8')]=_0x276776;return _0x79f40c;});}})[_0x244c('0x1b')](respondWithFilteredResult(_0x462f13,_0x107dc5))['catch'](handleError(_0x462f13,null));};exports['getHopperFinals']=function(_0x4b04d4,_0x22fc03){var _0x3decdb={'raw':!![],'where':{}};var _0x1e58fd={};var _0x1c4b11={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x4b04d4[_0x244c('0x28')]['id']}})['then'](handleEntityNotFound(_0x22fc03,null))['then'](function(_0xf46e92){if(_0xf46e92){_0x1e58fd[_0x244c('0x82')]=_[_0x244c('0x2a')](db[_0x244c('0x50')]['rawAttributes']);_0x1e58fd[_0x244c('0x25')]=_['keys'](_0x4b04d4['query']);_0x1e58fd[_0x244c('0x84')]=_['intersection'](_0x1e58fd[_0x244c('0x82')],_0x1e58fd[_0x244c('0x25')]);_0x3decdb[_0x244c('0x86')]=_[_0x244c('0x85')](_0x1e58fd[_0x244c('0x82')],qs[_0x244c('0x87')](_0x4b04d4[_0x244c('0x25')]['fields']));_0x3decdb[_0x244c('0x86')]=_0x3decdb['attributes'][_0x244c('0x2b')]?_0x3decdb[_0x244c('0x86')]:_0x1e58fd[_0x244c('0x82')];if(!_0x4b04d4[_0x244c('0x25')][_0x244c('0x38')](_0x244c('0x8e'))){_0x3decdb['limit']=qs['limit'](_0x4b04d4['query']['limit']);_0x3decdb[_0x244c('0x17')]=qs[_0x244c('0x17')](_0x4b04d4['query'][_0x244c('0x17')]);}_0x3decdb['order']=qs['sort'](_0x4b04d4[_0x244c('0x25')][_0x244c('0x89')]);_0x3decdb[_0x244c('0x66')]=qs[_0x244c('0x84')](_[_0x244c('0x8a')](_0x4b04d4[_0x244c('0x25')],_0x1e58fd['filters']));_0x3decdb[_0x244c('0x66')][_0x244c('0xa9')]=_0xf46e92['id'];if(_0x4b04d4[_0x244c('0x25')][_0x244c('0x8b')]){_0x3decdb['where']=_[_0x244c('0x8c')](_0x3decdb['where'],{'$or':_[_0x244c('0x7a')](_0x3decdb[_0x244c('0x86')],function(_0x40ca7e){var _0x5b2fb2={};_0x5b2fb2[_0x40ca7e]={'$like':'%'+_0x4b04d4[_0x244c('0x25')]['filter']+'%'};return _0x5b2fb2;})});}_0x3decdb=_[_0x244c('0x8c')]({},_0x3decdb,_0x4b04d4[_0x244c('0x8d')]);return db[_0x244c('0x50')][_0x244c('0x16')]({'where':_0x3decdb[_0x244c('0x66')]})[_0x244c('0x1b')](function(_0x16e8ad){_0x1c4b11[_0x244c('0x16')]=_0x16e8ad;if(_0x4b04d4['query']['includeAll']){_0x3decdb[_0x244c('0xa7')]=[{'all':!![]}];}return db[_0x244c('0x50')]['findAll'](_0x3decdb);})[_0x244c('0x1b')](function(_0xbedb2d){_0x1c4b11[_0x244c('0xa8')]=_0xbedb2d;return _0x1c4b11;});}})[_0x244c('0x1b')](respondWithFilteredResult(_0x22fc03,_0x3decdb))['catch'](handleError(_0x22fc03,null));};exports[_0x244c('0xaa')]=function(_0x1b0525,_0x5aa76d){var _0x497ff0={'raw':!![],'where':{}};var _0x4bdf56={};var _0x47f74f={'count':0x0,'rows':[]};return db[_0x244c('0x27')][_0x244c('0x81')]({'where':{'id':_0x1b0525[_0x244c('0x28')]['id']}})['then'](handleEntityNotFound(_0x5aa76d,null))['then'](function(_0x1fd1a7){if(_0x1fd1a7){_0x4bdf56[_0x244c('0x82')]=_[_0x244c('0x2a')](db[_0x244c('0x59')][_0x244c('0x83')]);_0x4bdf56[_0x244c('0x25')]=_['keys'](_0x1b0525['query']);_0x4bdf56['filters']=_[_0x244c('0x85')](_0x4bdf56[_0x244c('0x82')],_0x4bdf56['query']);_0x497ff0[_0x244c('0x86')]=_[_0x244c('0x85')](_0x4bdf56[_0x244c('0x82')],qs[_0x244c('0x87')](_0x1b0525['query']['fields']));_0x497ff0[_0x244c('0x86')]=_0x497ff0[_0x244c('0x86')]['length']?_0x497ff0[_0x244c('0x86')]:_0x4bdf56[_0x244c('0x82')];if(!_0x1b0525['query'][_0x244c('0x38')](_0x244c('0x8e'))){_0x497ff0[_0x244c('0x8f')]=qs[_0x244c('0x8f')](_0x1b0525['query'][_0x244c('0x8f')]);_0x497ff0[_0x244c('0x17')]=qs[_0x244c('0x17')](_0x1b0525[_0x244c('0x25')]['offset']);}_0x497ff0[_0x244c('0x88')]=qs['sort'](_0x1b0525[_0x244c('0x25')][_0x244c('0x89')]);_0x497ff0[_0x244c('0x66')]=qs['filters'](_[_0x244c('0x8a')](_0x1b0525[_0x244c('0x25')],_0x4bdf56['filters']));_0x497ff0[_0x244c('0x66')]['ContactId']=_0x1fd1a7['id'];if(_0x1b0525[_0x244c('0x25')][_0x244c('0x8b')]){_0x497ff0[_0x244c('0x66')]=_[_0x244c('0x8c')](_0x497ff0[_0x244c('0x66')],{'$or':_[_0x244c('0x7a')](_0x497ff0[_0x244c('0x86')],function(_0x1af9a4){var _0x8d3418={};_0x8d3418[_0x1af9a4]={'$like':'%'+_0x1b0525['query'][_0x244c('0x8b')]+'%'};return _0x8d3418;})});}_0x497ff0=_[_0x244c('0x8c')]({},_0x497ff0,_0x1b0525['options']);return db['JscriptySessionReport'][_0x244c('0x16')]({'where':_0x497ff0['where']})['then'](function(_0x1b009e){_0x47f74f[_0x244c('0x16')]=_0x1b009e;if(_0x1b0525[_0x244c('0x25')]['includeAll']){_0x497ff0[_0x244c('0xa7')]=[{'all':!![]}];}return db[_0x244c('0x59')][_0x244c('0x24')](_0x497ff0);})[_0x244c('0x1b')](function(_0x3299aa){_0x47f74f[_0x244c('0xa8')]=_0x3299aa;return _0x47f74f;});}})['then'](respondWithFilteredResult(_0x5aa76d,_0x497ff0))['catch'](handleError(_0x5aa76d,null));};exports[_0x244c('0xab')]=function(_0xa11160,_0x2d9dcf){try{if(!_0xa11160['body'][_0x244c('0x69')]){throw new Error(_0x244c('0xac'));}if(!_0xa11160[_0x244c('0x39')][_0x244c('0xad')]){throw new Error(_0x244c('0xae'));}if(!_0xa11160[_0x244c('0x39')]['binding_values']){throw new Error(_0x244c('0xaf'));}if(!_0xa11160[_0x244c('0x39')]['socket_timestamp']){throw new Error(_0x244c('0xb0'));}var _0x50032c=_0xa11160[_0x244c('0x39')]['binding_keys']['split'](',');var _0x526a3d=_0xa11160[_0x244c('0x39')][_0x244c('0xb1')]['split'](',');if(!_0x50032c[_0x244c('0x2b')]||!_0x526a3d['length']||_0x50032c[_0x244c('0x2b')]!==_0x526a3d[_0x244c('0x2b')]){throw new Error(_0x244c('0xb2'));}_0xa11160[_0x244c('0x39')][_0x244c('0x87')]=_['zipObject'](_0x50032c,_0x526a3d);if(!_0xa11160['body'][_0x244c('0x87')]['phone']){throw new Error(_0x244c('0xb3'));}if(!_0xa11160[_0x244c('0x39')]['fields'][_0x244c('0xb4')]){throw new Error(_0x244c('0xb5'));}var _0x9af0a6=path[_0x244c('0x3e')](config[_0x244c('0xb6')],_0x244c('0xb7'),_0xa11160[_0x244c('0xb8')]['filename']);fs[_0x244c('0xb9')](_0x9af0a6,parseInt('0777',0x8));var _0x2fc812=require(_0x244c('0xba'))[_0x244c('0xbb')](path[_0x244c('0x3e')](__dirname,_0x244c('0xbc')),[_0x9af0a6,_0xa11160[_0x244c('0x39')][_0x244c('0xad')],_0xa11160[_0x244c('0x39')][_0x244c('0xb1')],_0xa11160[_0x244c('0x39')]['ListId'],_0xa11160['body'][_0x244c('0xbd')],_0xa11160[_0x244c('0x39')][_0x244c('0x65')],_0xa11160[_0x244c('0x39')][_0x244c('0xbe')]]);return _0x2d9dcf[_0x244c('0x13')](0xc8)[_0x244c('0x14')]({'message':_0x244c('0xbf'),'pid':_0x2fc812['pid']});}catch(_0x4b3b35){return _0x2d9dcf[_0x244c('0x13')](0x1f4)['send'](_0x4b3b35);}};exports[_0x244c('0xc0')]=function(_0x572757,_0x5d5bcf){var _0x3bee69=fs[_0x244c('0xc1')](_0x572757[_0x244c('0xb8')][_0x244c('0x3')]);Papa['parse'](_0x3bee69,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4545c7){return _0x5d5bcf['status'](0xc8)[_0x244c('0x14')]({'file':_0x572757[_0x244c('0xb8')],'fields':_0x4545c7[_0x244c('0xc2')]['fields']});}});};exports[_0x244c('0xc3')]=function(_0x381bc7,_0xd282d5){return db[_0x244c('0xc4')][_0x244c('0x24')]({'raw':!![],'attributes':['id'],'where':{'role':_0x244c('0xc5')}})['then'](function(_0x3dadd7){var _0x51940b=![];if(!_0x381bc7[_0x244c('0x39')]['ListId']){throw new Error(_0x244c('0xac'));}if(!_0x381bc7[_0x244c('0x39')]['binding'][_0x244c('0x80')]){throw new Error(_0x244c('0xb3'));}if(!_0x381bc7[_0x244c('0x39')][_0x244c('0xc6')][_0x244c('0xb4')]){throw new Error(_0x244c('0xb5'));}if(!_0x381bc7[_0x244c('0x39')]['socket_timestamp']){throw new Error(_0x244c('0xb0'));}var _0x1f1e5a=require(_0x244c('0xba'))['fork'](path[_0x244c('0x3e')](__dirname,_0x244c('0xc7')),[_0x381bc7['params']['id'],JSON['stringify'](_0x381bc7[_0x244c('0x39')]),JSON[_0x244c('0xc8')](_0x3dadd7)]);_0x1f1e5a['on'](_0x244c('0xc9'),function(){_0x51940b=!![];return _0xd282d5[_0x244c('0x13')](0xc8)[_0x244c('0x14')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x1f1e5a[_0x244c('0xca')]});});_0x1f1e5a['on'](_0x244c('0xcb'),function(_0x13f09e){if(_0x13f09e&&!_0x51940b){return _0xd282d5[_0x244c('0x13')](0x1f4)[_0x244c('0x14')]({'message':_0x244c('0xcc'),'pid':_0x1f1e5a[_0x244c('0xca')]});}});})[_0x244c('0x5d')](handleError(_0xd282d5,null));};exports['importUpdates']=function(_0x1ee305,_0x1bad29){return db[_0x244c('0xc4')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x244c('0xc5')}})[_0x244c('0x1b')](function(_0x166f4d){var _0x3ce597=![];if(!_0x1ee305[_0x244c('0x39')]['ListId']){throw new Error(_0x244c('0xac'));}if(!_0x1ee305[_0x244c('0x39')][_0x244c('0xc6')][_0x244c('0x80')]){throw new Error(_0x244c('0xb3'));}if(!_0x1ee305[_0x244c('0x39')]['binding'][_0x244c('0xb4')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1ee305[_0x244c('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x316597=require(_0x244c('0xba'))[_0x244c('0xbb')](path[_0x244c('0x3e')](__dirname,'../../components/import/cm/csvUpdates'),[_0x1ee305[_0x244c('0x28')]['id'],JSON[_0x244c('0xc8')](_0x1ee305['body']),JSON[_0x244c('0xc8')](_0x166f4d)]);_0x316597['on']('message',function(){_0x3ce597=!![];return _0x1bad29[_0x244c('0x13')](0xc8)[_0x244c('0x14')]({'message':_0x244c('0xcd'),'pid':_0x316597[_0x244c('0xca')]});});_0x316597['on']('exit',function(_0x22bb5e){if(_0x22bb5e&&!_0x3ce597){return _0x1bad29['status'](0x1f4)[_0x244c('0x14')]({'message':_0x244c('0xcc'),'pid':_0x316597['pid']});}});})[_0x244c('0x5d')](handleError(_0x1bad29,null));};exports[_0x244c('0xce')]=function(_0x4d8ff9,_0x56dcf9){var _0x58fdcf=[_0x244c('0xcf'),_0x244c('0xd0'),'sms','openchannel',_0x244c('0xd1'),'whatsapp',_0x244c('0xd2')];var _0x23fc09={'offset':0x0,'order':qs[_0x244c('0x89')]('-createdAt')},_0x191e66={'count':0x0,'rows':[]};Promise[_0x244c('0xd3')]()['then'](function(){if(_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd4')]){if(!_[_0x244c('0xd5')](_0x58fdcf,_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd4')][_0x244c('0xd6')]())){throw new Error('Invalid\x20channel');}_0x58fdcf=[_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd4')][_0x244c('0xd6')]()];}if(_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd7')]){try{var _0x4297ea=JSON[_0x244c('0xd8')](_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd7')]);if(!moment(_0x4297ea[_0x244c('0x3a')])[_0x244c('0xd9')]()){throw new Error(_0x244c('0xda'));}if(!moment(_0x4297ea['to'])[_0x244c('0xd9')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x33637f){throw new Error(_0x244c('0xdb'));}}if(!_0x4d8ff9[_0x244c('0x25')]['hasOwnProperty'](_0x244c('0x8e'))){_0x23fc09[_0x244c('0x8f')]=qs[_0x244c('0x8f')](_0x4d8ff9[_0x244c('0x25')][_0x244c('0x8f')]||0xa);_0x23fc09['offset']=qs['offset'](_0x4d8ff9['query']['offset']);}var _0x19f485=_0x58fdcf[_0x244c('0x7a')](function(_0x52d189){if(_0x52d189===_0x244c('0xd2')){var _0x4149d3={'attributes':['id',_0x244c('0xdc'),_0x244c('0x33'),_0x244c('0xdd'),_0x244c('0xde'),_0x244c('0xdf'),_0x244c('0xe0'),'endtime','duration',_0x244c('0xe1'),_0x244c('0xe2'),'userDisposition','userSecondDisposition','userThirdDisposition','UserId'],'where':{'ContactId':_0x4d8ff9['params']['id']},'include':[{'model':db[_0x244c('0xc4')],'as':_0x244c('0xc4'),'attributes':['id',_0x244c('0x20'),_0x244c('0xe3'),_0x244c('0x31')]}],'order':[[_0x244c('0xe2'),_0x244c('0xe4')]]};if(_0x4d8ff9[_0x244c('0x25')][_0x244c('0xd7')]){_0x4149d3[_0x244c('0x66')]['createdAt']={'$gte':_0x4297ea[_0x244c('0x3a')],'$lte':_0x4297ea['to']};}return db['VoiceCallReport'][_0x244c('0xe5')](_0x4149d3)[_0x244c('0x1b')](function(_0x159b7d){_0x191e66[_0x244c('0x16')]+=_0x159b7d[_0x244c('0x16')];return _[_0x244c('0x7a')](_0x159b7d[_0x244c('0xa8')],function(_0x56b606){var _0xf6a500=_0x56b606[_0x244c('0x3b')]({'plain':!![]});_0xf6a500[_0x244c('0xd4')]=_0x52d189;if(_0xf6a500['User']){_0xf6a500[_0x244c('0xc4')]={'id':_0xf6a500[_0x244c('0xc4')]['id'],'name':_0xf6a500[_0x244c('0xc4')][_0x244c('0x20')],'fullname':_0xf6a500[_0x244c('0xc4')][_0x244c('0xe3')],'alias':_0xf6a500['User'][_0x244c('0x31')]};}return _0xf6a500;});});}else{var _0x33a986=_[_0x244c('0xe6')](_0x52d189)+(_0x52d189===_0x244c('0xd0')?_0x244c('0xe7'):_0x244c('0xe8'));var _0x558c2b={'attributes':['id','closed','closedAt',_0x244c('0xe2'),'note','disposition','secondDisposition',_0x244c('0xe9'),_0x244c('0xea'),_0x33a986+'Id'],'where':{'ContactId':_0x4d8ff9['params']['id']},'include':[{'model':db[_0x33a986],'as':_0x244c('0xe8'),'attributes':['id',_0x244c('0x20'),'key']},{'model':db[_0x244c('0xc4')],'as':'Owner','attributes':['id',_0x244c('0x20'),'fullname']},{'model':db[_0x244c('0x6d')],'as':_0x244c('0x6e'),'attributes':['id',_0x244c('0x20'),_0x244c('0x6f')],'through':{'attributes':[]}}],'order':[[_0x244c('0xe2'),_0x244c('0xe4')]]};if(_0x4d8ff9[_0x244c('0x25')]['range']){_0x558c2b['where'][_0x244c('0xe2')]={'$gte':_0x4297ea['from'],'$lte':_0x4297ea['to']};}switch(_0x52d189){case _0x244c('0xd0'):_0x558c2b[_0x244c('0x86')][_0x244c('0x68')](_0x244c('0xeb'),_0x244c('0xec'),_0x244c('0xed'),_0x244c('0xee'),_0x244c('0xef'),_0x244c('0xf0'),_0x244c('0xf1'),'ratingValue',_0x244c('0xf2'));break;case _0x244c('0xcf'):_0x558c2b[_0x244c('0x86')][_0x244c('0x68')](_0x244c('0xf3'),'substatus');break;case _0x244c('0xf4'):_0x558c2b['attributes'][_0x244c('0x68')](_0x244c('0xf5'),_0x244c('0xf6'));break;}return db[_['startCase'](_0x52d189)+'Interaction'][_0x244c('0xe5')](_0x558c2b)[_0x244c('0x1b')](function(_0x275511){_0x191e66[_0x244c('0x16')]+=_0x275511[_0x244c('0x16')];return _[_0x244c('0x7a')](_0x275511[_0x244c('0xa8')],function(_0x2cbf99){var _0x287ebc=_0x2cbf99['get']({'plain':!![]});_0x287ebc[_0x244c('0xd4')]=_0x52d189;if(_0x287ebc[_0x244c('0xf7')]){_0x287ebc[_0x244c('0xf7')]={'id':_0x287ebc[_0x244c('0xf7')]['id'],'name':_0x287ebc['Owner']['name'],'fullname':_0x287ebc[_0x244c('0xf7')][_0x244c('0xe3')]};}return _0x287ebc;});});}});return Promise[_0x244c('0x94')](_0x19f485);})['then'](function(_0x2c40e1){return _(_0x2c40e1)['flatten']()[_0x244c('0xf8')](_0x244c('0xe2'))[_0x244c('0xf9')]()[_0x244c('0xfa')]();})['then'](function(_0x17be17){_0x191e66['rows']=_0x23fc09[_0x244c('0x8f')]?_0x17be17[_0x244c('0xfb')](_0x23fc09[_0x244c('0x17')],_0x23fc09['offset']+_0x23fc09[_0x244c('0x8f')]):_0x17be17;return _0x191e66;})[_0x244c('0x1b')](respondWithFilteredResult(_0x56dcf9,_0x23fc09))[_0x244c('0x5d')](handleError(_0x56dcf9,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 25a92e5..2fa9c5e 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd091=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x55291a,_0x814018){var _0x3c870c=function(_0x1fd787){while(--_0x1fd787){_0x55291a['push'](_0x55291a['shift']());}};_0x3c870c(++_0x814018);}(_0xd091,0xea));var _0x1d09=function(_0x495f0b,_0x499f83){_0x495f0b=_0x495f0b-0x0;var _0xef44be=_0xd091[_0x495f0b];return _0xef44be;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x1d09('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1d09('0x1')](0x0);var events={'afterCreate':_0x1d09('0x2'),'afterUpdate':'update','afterDestroy':_0x1d09('0x3')};function emitEvent(_0x37138f){return function(_0x5e1e6c,_0x188dd0,_0x5b7d4a){CmContactEvents[_0x1d09('0x4')](_0x37138f+':'+_0x5e1e6c['id'],_0x5e1e6c);CmContactEvents[_0x1d09('0x4')](_0x37138f,_0x5e1e6c);_0x5b7d4a(null);};}for(var e in events){if(events[_0x1d09('0x5')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x1d09('0x6')]=CmContactEvents; \ No newline at end of file +var _0xd1e8=['CmContact','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x160c42,_0x383a96){var _0xcc4c25=function(_0x6e66fd){while(--_0x6e66fd){_0x160c42['push'](_0x160c42['shift']());}};_0xcc4c25(++_0x383a96);}(_0xd1e8,0x131));var _0x8d1e=function(_0x31d98a,_0x292465){_0x31d98a=_0x31d98a-0x0;var _0x56e10e=_0xd1e8[_0x31d98a];return _0x56e10e;};'use strict';var EventEmitter=require(_0x8d1e('0x0'));var CmContact=require('../../mysqldb')['db'][_0x8d1e('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8d1e('0x2')](0x0);var events={'afterCreate':_0x8d1e('0x3'),'afterUpdate':'update','afterDestroy':_0x8d1e('0x4')};function emitEvent(_0xd00f4e){return function(_0x176f0c,_0x328c1c,_0x212803){CmContactEvents[_0x8d1e('0x5')](_0xd00f4e+':'+_0x176f0c['id'],_0x176f0c);CmContactEvents[_0x8d1e('0x5')](_0xd00f4e,_0x176f0c);_0x212803(null);};}for(var e in events){if(events[_0x8d1e('0x6')](e)){var event=events[e];CmContact[_0x8d1e('0x7')](e,emitEvent(event));}}module[_0x8d1e('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index b06ae8a..25c4444 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf35c=['[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','../../config/environment/shared','./cmContact.attributes','Campaign','VoiceQueue','scheduledat','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','resolve','findOne','then','isNil','utcOffset','add','minutes','format','phone','ListId','priority','callbackUniqueid','assign','CmHopper','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','VoiceQueueId','create','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','always','onlyIfOpen','findAll','outbound','dialCheckDuplicateType','CmList','map','all','Lists','BlackLists','CmHopperBlack','exports','CmContact','fti_cm_contacts','firstName','email','FULLTEXT','utf8mb4','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','[cmContact][afterCreate]','message','models','get','ContactId','push','info','[CmContact][afterDestroy][Succesfull]','inspect','catch'];(function(_0x69cd50,_0x153cff){var _0x4ccac3=function(_0x11e33e){while(--_0x11e33e){_0x69cd50['push'](_0x69cd50['shift']());}};_0x4ccac3(++_0x153cff);}(_0xf35c,0x1c1));var _0xcf35=function(_0x16f22c,_0x28d1a4){_0x16f22c=_0x16f22c-0x0;var _0x5e8a12=_0xf35c[_0x16f22c];return _0x5e8a12;};'use strict';var _=require(_0xcf35('0x0'));var util=require(_0xcf35('0x1'));var logger=require(_0xcf35('0x2'))('api');var moment=require(_0xcf35('0x3'));var shared=require(_0xcf35('0x4'));var attributes=require(_0xcf35('0x5'));function getTimezoneCallbackAt(_0x293515,_0x5c4714,_0xfb6e2b,_0x2ec7a0){var _0x24b494=_0x2ec7a0?_0xcf35('0x6'):_0xcf35('0x7');var _0x41afe6=_0xfb6e2b[_0xcf35('0x8')]?_0xfb6e2b[_0xcf35('0x8')]:moment()['format'](_0xcf35('0x9'));if(_['isNil'](_0xfb6e2b[_0xcf35('0xa')])){return Promise[_0xcf35('0xb')](_0x41afe6);}return _0x293515[_0x24b494][_0xcf35('0xc')]({'where':{'id':_0x5c4714}})[_0xcf35('0xd')](function(_0x304e36){if(_[_0xcf35('0xe')](_0x304e36)||_[_0xcf35('0xe')](_0x304e36['dialTimezone'])){return Promise[_0xcf35('0xb')](_0x41afe6);}var _0x142812=shared['timezones'];var _0x1191dd=_0x142812[_0x304e36[_0xcf35('0xa')]];var _0x3dad91=_0x142812[_0xfb6e2b[_0xcf35('0xa')]];if(_['isNil'](_0x1191dd)&&_[_0xcf35('0xe')](_0x3dad91)){return Promise[_0xcf35('0xb')](_0x41afe6);}var _0x194f0b=_0x1191dd[_0xcf35('0xf')]-_0x3dad91[_0xcf35('0xf')];var _0x489614=_0xfb6e2b['scheduledat']?_0xfb6e2b['scheduledat']:moment();_0x41afe6=moment(_0x489614)[_0xcf35('0x10')](_0x194f0b,_0xcf35('0x11'))[_0xcf35('0x12')](_0xcf35('0x9'));return Promise[_0xcf35('0xb')](_0x41afe6);});}function getNewHopperPayload(_0x4c87ca){return{'phone':_0x4c87ca[_0xcf35('0x13')],'ContactId':_0x4c87ca['id'],'ListId':_0x4c87ca[_0xcf35('0x14')],'scheduledat':_0x4c87ca[_0xcf35('0x8')]?_0x4c87ca[_0xcf35('0x8')]:moment()[_0xcf35('0x12')](_0xcf35('0x9')),'priority':_0x4c87ca[_0xcf35('0x15')]?_0x4c87ca[_0xcf35('0x15')]:0x2,'callback':_0x4c87ca[_0xcf35('0x16')]?!![]:![],'callbackuniqueid':_0x4c87ca[_0xcf35('0x16')]?_0x4c87ca[_0xcf35('0x16')]:undefined,'callbackat':_0x4c87ca[_0xcf35('0x16')]?moment()['format'](_0xcf35('0x9')):undefined};}function handleAlwaysCheckDuplicate(_0x4e80ea,_0x4dce17,_0x3bf03f,_0x179a8b){var _0x3e8753={'phone':_0x3bf03f['phone']};var _0x1e1bf3={'calleridnum':_0x3bf03f['phone']};if(_0x179a8b){Object['assign'](_0x3e8753,{'CampaignId':_0x4dce17['id']});Object['assign'](_0x1e1bf3,{'CampaignId':_0x4dce17['id']});}else{Object['assign'](_0x3e8753,{'VoiceQueueId':_0x4dce17['id']});Object[_0xcf35('0x17')](_0x1e1bf3,{'VoiceQueueId':_0x4dce17['id']});}return _0x4e80ea[_0xcf35('0x18')][_0xcf35('0xc')]({'where':_0x3e8753})[_0xcf35('0xd')](function(_0x1e4190){if(_0x1e4190){throw new Error(_0xcf35('0x19')+_0x3bf03f[_0xcf35('0x13')]+_0xcf35('0x1a')+_0x4dce17['id']);}return _0x4e80ea[_0xcf35('0x1b')]['findOne']({'where':_0x1e1bf3});})['then'](function(_0x34cc3b){if(_0x34cc3b){throw new Error(_0xcf35('0x1c')+_0x3bf03f[_0xcf35('0x13')]+_0xcf35('0x1a')+_0x4dce17['id']);}var _0x571a29=getNewHopperPayload(_0x3bf03f);if(_0x179a8b){_0x571a29['CampaignId']=_0x4dce17['id'];}else{_0x571a29[_0xcf35('0x1d')]=_0x4dce17['id'];}return _0x4e80ea[_0xcf35('0x18')][_0xcf35('0x1e')](_0x571a29);});}function handleOnlyIfOpenCheckDuplicate(_0x2d0bf7,_0xdd1d1,_0x48606a,_0x535f36){var _0x22a1d9={'phone':_0x48606a[_0xcf35('0x13')]};if(_0x535f36){Object[_0xcf35('0x17')](_0x22a1d9,{'CampaignId':_0xdd1d1['id']});}else{Object[_0xcf35('0x17')](_0x22a1d9,{'VoiceQueueId':_0xdd1d1['id']});}return _0x2d0bf7[_0xcf35('0x18')]['findOne']({'where':_0x22a1d9})['then'](function(_0x11e6de){if(_0x11e6de){throw new Error(_0xcf35('0x1f')+_0x48606a['phone']+_0xcf35('0x1a')+_0xdd1d1['id']);}var _0x2683d0=getNewHopperPayload(_0x48606a);if(_0x535f36){_0x2683d0[_0xcf35('0x20')]=_0xdd1d1['id'];}else{_0x2683d0[_0xcf35('0x1d')]=_0xdd1d1['id'];}return _0x2d0bf7[_0xcf35('0x18')][_0xcf35('0x1e')](_0x2683d0);});}function handleNeverCheckDuplicate(_0x4b4481,_0x263f7a,_0x3157e4){var _0x47ddbf=getNewHopperPayload(_0x3157e4);_0x47ddbf['VoiceQueueId']=_0x263f7a['id'];return _0x4b4481[_0xcf35('0x18')][_0xcf35('0x1e')](_0x47ddbf);}function handleCheckDuplicate(_0x4e09bf,_0x1d3692,_0x3d44e9,_0x185cff){return getTimezoneCallbackAt(_0x4e09bf,_0x1d3692,_0x3d44e9,_0x185cff)[_0xcf35('0xd')](function(_0x399b47){_0x3d44e9[_0xcf35('0x8')]=_0x399b47;switch(_0x1d3692['dialCheckDuplicateType']){case _0xcf35('0x21'):return handleAlwaysCheckDuplicate(_0x4e09bf,_0x1d3692,_0x3d44e9,_0x185cff);case _0xcf35('0x22'):return handleOnlyIfOpenCheckDuplicate(_0x4e09bf,_0x1d3692,_0x3d44e9,_0x185cff);default:return handleNeverCheckDuplicate(_0x4e09bf,_0x1d3692,_0x3d44e9);}});}function createHopperForVoiceQueues(_0xf941f2,_0x3a3c22){return _0xf941f2[_0xcf35('0x7')][_0xcf35('0x23')]({'where':{'type':_0xcf35('0x24')},'attributes':['id',_0xcf35('0x25'),_0xcf35('0xa')],'include':[{'model':_0xf941f2[_0xcf35('0x26')],'as':'Lists','where':{'id':_0x3a3c22[_0xcf35('0x14')]}}],'raw':!![]})[_0xcf35('0xd')](function(_0x2f8ee4){var _0x5bdaa0=_0x2f8ee4[_0xcf35('0x27')](function(_0x43f174){return handleCheckDuplicate(_0xf941f2,_0x43f174,_0x3a3c22,![]);});return Promise[_0xcf35('0x28')](_0x5bdaa0);});}function createHopperForCampaigns(_0x50199b,_0x4b2548){return _0x50199b[_0xcf35('0x6')]['findAll']({'attributes':['id',_0xcf35('0x25'),_0xcf35('0xa')],'include':[{'model':_0x50199b[_0xcf35('0x26')],'as':_0xcf35('0x29'),'where':{'id':_0x4b2548[_0xcf35('0x14')]}}],'raw':!![]})[_0xcf35('0xd')](function(_0x54f0e1){var _0xf78759=_0x54f0e1[_0xcf35('0x27')](function(_0xe9ae15){return handleCheckDuplicate(_0x50199b,_0xe9ae15,_0x4b2548,!![]);});return Promise[_0xcf35('0x28')](_0xf78759);});}function createHopperBlackForVoiceQueues(_0x375fa5,_0xa6df75){return _0x375fa5[_0xcf35('0x7')]['findAll']({'where':{'type':_0xcf35('0x24')},'attributes':['id'],'include':[{'model':_0x375fa5['CmList'],'as':_0xcf35('0x2a'),'where':{'id':_0xa6df75[_0xcf35('0x14')]}}],'raw':!![]})['then'](function(_0x2fe587){var _0x44fe69=_0x2fe587[_0xcf35('0x27')](function(_0x39534d){return _0x375fa5[_0xcf35('0x2b')][_0xcf35('0x1e')]({'phone':_0xa6df75[_0xcf35('0x13')],'ContactId':_0xa6df75['id'],'ListId':_0xa6df75[_0xcf35('0x14')],'VoiceQueueId':_0x39534d['id']});});return Promise[_0xcf35('0x28')](_0x44fe69);});}function createHopperBlackForCampaigns(_0x2117a0,_0x8f2564){return _0x2117a0[_0xcf35('0x6')][_0xcf35('0x23')]({'attributes':['id'],'include':[{'model':_0x2117a0[_0xcf35('0x26')],'as':'BlackLists','where':{'id':_0x8f2564[_0xcf35('0x14')]}}],'raw':!![]})[_0xcf35('0xd')](function(_0x177732){var _0x3a2bc1=_0x177732['map'](function(_0x2bb4b7){return _0x2117a0[_0xcf35('0x2b')]['create']({'phone':_0x8f2564[_0xcf35('0x13')],'ContactId':_0x8f2564['id'],'ListId':_0x8f2564[_0xcf35('0x14')],'CampaignId':_0x2bb4b7['id']});});return Promise[_0xcf35('0x28')](_0x3a2bc1);});}module[_0xcf35('0x2c')]=function(_0x520cc0){return _0x520cc0['define'](_0xcf35('0x2d'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xcf35('0x13'),'fields':[_0xcf35('0x13')]},{'name':_0xcf35('0x2e'),'fields':[_0xcf35('0x2f'),'lastName',_0xcf35('0x13'),'mobile','fax',_0xcf35('0x30')],'type':_0xcf35('0x31')}],'timestamps':!![],'charset':_0xcf35('0x32'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x3ba92b,_0x947e4b,_0x47fa71){var _0x5c63fd=_0x520cc0['models'];var _0x43d2d9=_0x3ba92b['get']({'plain':!![]});if(!_0x43d2d9[_0xcf35('0x14')]){logger[_0xcf35('0x33')](_0xcf35('0x34')+_0x43d2d9['id']);return _0x47fa71();}if(!_0x43d2d9[_0xcf35('0x13')]){return _0x47fa71();}return createHopperForVoiceQueues(_0x5c63fd,_0x43d2d9)[_0xcf35('0xd')](function(){return createHopperBlackForVoiceQueues(_0x5c63fd,_0x43d2d9);})[_0xcf35('0xd')](function(){return createHopperForCampaigns(_0x5c63fd,_0x43d2d9);})[_0xcf35('0xd')](function(){return createHopperBlackForCampaigns(_0x5c63fd,_0x43d2d9);})[_0xcf35('0xd')](function(){return _0x47fa71();})['catch'](function(_0x27bdf){logger[_0xcf35('0x33')](_0xcf35('0x35'),_0x27bdf[_0xcf35('0x36')]);_0x47fa71();});},'afterDestroy':function(_0x1d1cbe,_0x5b1acb,_0x15c1c7){var _0x44fc23=_0x520cc0[_0xcf35('0x37')];var _0x494c37=_0x1d1cbe[_0xcf35('0x38')]({'plain':!![]});return _0x44fc23['CmHopper'][_0xcf35('0x23')]({'raw':!![],'where':{'ListId':_0x494c37[_0xcf35('0x14')],'ContactId':_0x494c37['id']}})['then'](function(_0x5f33bc){if(!_['isEmpty'](_0x5f33bc)){var _0x203caf=[];for(var _0x3ba7db=0x0;_0x3ba7db<_0x5f33bc['length'];_0x3ba7db+=0x1){var _0xa258bb=_0x44fc23[_0xcf35('0x18')]['destroy']({'where':{'ListId':_0x5f33bc[_0x3ba7db][_0xcf35('0x14')],'ContactId':_0x5f33bc[_0x3ba7db][_0xcf35('0x39')],'VoiceQueueId':_0x5f33bc[_0x3ba7db][_0xcf35('0x1d')],'CampaignId':_0x5f33bc[_0x3ba7db][_0xcf35('0x20')]}});_0x203caf[_0xcf35('0x3a')](_0xa258bb);}return Promise[_0xcf35('0x28')](_0x203caf);}})[_0xcf35('0xd')](function(_0x390587){logger[_0xcf35('0x3b')](_0xcf35('0x3c'),util[_0xcf35('0x3d')](_0x390587,{'showHidden':![],'depth':null}));_0x15c1c7();})[_0xcf35('0x3e')](function(_0x403c1e){logger[_0xcf35('0x33')](_0xcf35('0x3f'),util['inspect'](_0x403c1e,{'showHidden':![],'depth':null}));_0x15c1c7(_0x403c1e);});}}});}; \ No newline at end of file +var _0x3bb0=['cm_contacts','fti_cm_contacts','firstName','mobile','fax','FULLTEXT','utf8mb4','models','get','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','message','isEmpty','length','destroy','ContactId','push','[CmContact][afterDestroy][Succesfull]','inspect','[CmContact][afterDestroy][Error]','lodash','../../config/logger','../../config/environment/shared','./cmContact.attributes','VoiceQueue','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','then','resolve','timezones','utcOffset','scheduledat','add','minutes','format','phone','ListId','priority','callbackUniqueid','assign','CmHopper','findOne','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','create','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','VoiceQueueId','dialCheckDuplicateType','always','findAll','outbound','CmList','Lists','map','Campaign','all','CmHopperBlack','CmContact'];(function(_0x27c338,_0x2e1a70){var _0x1aab26=function(_0x871b8){while(--_0x871b8){_0x27c338['push'](_0x27c338['shift']());}};_0x1aab26(++_0x2e1a70);}(_0x3bb0,0x145));var _0x03bb=function(_0x3044ce,_0x2b06a9){_0x3044ce=_0x3044ce-0x0;var _0x343615=_0x3bb0[_0x3044ce];return _0x343615;};'use strict';var _=require(_0x03bb('0x0'));var util=require('util');var logger=require(_0x03bb('0x1'))('api');var moment=require('moment');var shared=require(_0x03bb('0x2'));var attributes=require(_0x03bb('0x3'));function getTimezoneCallbackAt(_0x5ab85c,_0xd6412b,_0x4b31b9,_0x278498){var _0x1acd4d=_0x278498?'Campaign':_0x03bb('0x4');var _0x2906b4=_0x4b31b9['scheduledat']?_0x4b31b9['scheduledat']:moment()['format'](_0x03bb('0x5'));if(_[_0x03bb('0x6')](_0x4b31b9[_0x03bb('0x7')])){return Promise['resolve'](_0x2906b4);}return _0x5ab85c[_0x1acd4d]['findOne']({'where':{'id':_0xd6412b}})[_0x03bb('0x8')](function(_0x42ae87){if(_[_0x03bb('0x6')](_0x42ae87)||_[_0x03bb('0x6')](_0x42ae87[_0x03bb('0x7')])){return Promise[_0x03bb('0x9')](_0x2906b4);}var _0x130855=shared[_0x03bb('0xa')];var _0x5f0f65=_0x130855[_0x42ae87[_0x03bb('0x7')]];var _0x29d6dc=_0x130855[_0x4b31b9[_0x03bb('0x7')]];if(_[_0x03bb('0x6')](_0x5f0f65)&&_[_0x03bb('0x6')](_0x29d6dc)){return Promise[_0x03bb('0x9')](_0x2906b4);}var _0x45a085=_0x5f0f65[_0x03bb('0xb')]-_0x29d6dc[_0x03bb('0xb')];var _0x367a97=_0x4b31b9[_0x03bb('0xc')]?_0x4b31b9[_0x03bb('0xc')]:moment();_0x2906b4=moment(_0x367a97)[_0x03bb('0xd')](_0x45a085,_0x03bb('0xe'))[_0x03bb('0xf')](_0x03bb('0x5'));return Promise[_0x03bb('0x9')](_0x2906b4);});}function getNewHopperPayload(_0x7d1622){return{'phone':_0x7d1622[_0x03bb('0x10')],'ContactId':_0x7d1622['id'],'ListId':_0x7d1622[_0x03bb('0x11')],'scheduledat':_0x7d1622[_0x03bb('0xc')]?_0x7d1622[_0x03bb('0xc')]:moment()[_0x03bb('0xf')](_0x03bb('0x5')),'priority':_0x7d1622['priority']?_0x7d1622[_0x03bb('0x12')]:0x2,'callback':_0x7d1622[_0x03bb('0x13')]?!![]:![],'callbackuniqueid':_0x7d1622['callbackUniqueid']?_0x7d1622[_0x03bb('0x13')]:undefined,'callbackat':_0x7d1622['callbackUniqueid']?moment()['format'](_0x03bb('0x5')):undefined};}function handleAlwaysCheckDuplicate(_0xde9b03,_0x5bff93,_0x54ede2,_0x1c6706){var _0x31b782={'phone':_0x54ede2[_0x03bb('0x10')]};var _0x260354={'calleridnum':_0x54ede2[_0x03bb('0x10')]};if(_0x1c6706){Object[_0x03bb('0x14')](_0x31b782,{'CampaignId':_0x5bff93['id']});Object[_0x03bb('0x14')](_0x260354,{'CampaignId':_0x5bff93['id']});}else{Object[_0x03bb('0x14')](_0x31b782,{'VoiceQueueId':_0x5bff93['id']});Object[_0x03bb('0x14')](_0x260354,{'VoiceQueueId':_0x5bff93['id']});}return _0xde9b03[_0x03bb('0x15')][_0x03bb('0x16')]({'where':_0x31b782})['then'](function(_0x40733a){if(_0x40733a){throw new Error(_0x03bb('0x17')+_0x54ede2[_0x03bb('0x10')]+_0x03bb('0x18')+_0x5bff93['id']);}return _0xde9b03['CmHopperFinal'][_0x03bb('0x16')]({'where':_0x260354});})[_0x03bb('0x8')](function(_0x344df6){if(_0x344df6){throw new Error(_0x03bb('0x19')+_0x54ede2[_0x03bb('0x10')]+_0x03bb('0x18')+_0x5bff93['id']);}var _0x4b9c91=getNewHopperPayload(_0x54ede2);if(_0x1c6706){_0x4b9c91[_0x03bb('0x1a')]=_0x5bff93['id'];}else{_0x4b9c91['VoiceQueueId']=_0x5bff93['id'];}return _0xde9b03[_0x03bb('0x15')][_0x03bb('0x1b')](_0x4b9c91);});}function handleOnlyIfOpenCheckDuplicate(_0x25c05f,_0x3ac015,_0x3f5fd2,_0x5630a1){var _0x15ca01={'phone':_0x3f5fd2[_0x03bb('0x10')]};if(_0x5630a1){Object[_0x03bb('0x14')](_0x15ca01,{'CampaignId':_0x3ac015['id']});}else{Object[_0x03bb('0x14')](_0x15ca01,{'VoiceQueueId':_0x3ac015['id']});}return _0x25c05f['CmHopper'][_0x03bb('0x16')]({'where':_0x15ca01})[_0x03bb('0x8')](function(_0x146cc1){if(_0x146cc1){throw new Error(_0x03bb('0x1c')+_0x3f5fd2[_0x03bb('0x10')]+_0x03bb('0x18')+_0x3ac015['id']);}var _0x5448c5=getNewHopperPayload(_0x3f5fd2);if(_0x5630a1){_0x5448c5[_0x03bb('0x1a')]=_0x3ac015['id'];}else{_0x5448c5[_0x03bb('0x1d')]=_0x3ac015['id'];}return _0x25c05f[_0x03bb('0x15')][_0x03bb('0x1b')](_0x5448c5);});}function handleNeverCheckDuplicate(_0x48461a,_0x4824b9,_0x474b79){var _0x49c7ad=getNewHopperPayload(_0x474b79);_0x49c7ad[_0x03bb('0x1d')]=_0x4824b9['id'];return _0x48461a[_0x03bb('0x15')][_0x03bb('0x1b')](_0x49c7ad);}function handleCheckDuplicate(_0x33d554,_0x3bb30e,_0x184530,_0x4e622d){return getTimezoneCallbackAt(_0x33d554,_0x3bb30e,_0x184530,_0x4e622d)[_0x03bb('0x8')](function(_0x1fda5d){_0x184530[_0x03bb('0xc')]=_0x1fda5d;switch(_0x3bb30e[_0x03bb('0x1e')]){case _0x03bb('0x1f'):return handleAlwaysCheckDuplicate(_0x33d554,_0x3bb30e,_0x184530,_0x4e622d);case'onlyIfOpen':return handleOnlyIfOpenCheckDuplicate(_0x33d554,_0x3bb30e,_0x184530,_0x4e622d);default:return handleNeverCheckDuplicate(_0x33d554,_0x3bb30e,_0x184530);}});}function createHopperForVoiceQueues(_0x49516a,_0x5a00e1){return _0x49516a[_0x03bb('0x4')][_0x03bb('0x20')]({'where':{'type':_0x03bb('0x21')},'attributes':['id',_0x03bb('0x1e'),_0x03bb('0x7')],'include':[{'model':_0x49516a[_0x03bb('0x22')],'as':_0x03bb('0x23'),'where':{'id':_0x5a00e1[_0x03bb('0x11')]}}],'raw':!![]})[_0x03bb('0x8')](function(_0x43bb97){var _0x470bfb=_0x43bb97[_0x03bb('0x24')](function(_0x593e2e){return handleCheckDuplicate(_0x49516a,_0x593e2e,_0x5a00e1,![]);});return Promise['all'](_0x470bfb);});}function createHopperForCampaigns(_0x2eed85,_0x448551){return _0x2eed85[_0x03bb('0x25')]['findAll']({'attributes':['id',_0x03bb('0x1e'),_0x03bb('0x7')],'include':[{'model':_0x2eed85[_0x03bb('0x22')],'as':_0x03bb('0x23'),'where':{'id':_0x448551[_0x03bb('0x11')]}}],'raw':!![]})['then'](function(_0x40f03c){var _0x263e66=_0x40f03c['map'](function(_0x2cb93d){return handleCheckDuplicate(_0x2eed85,_0x2cb93d,_0x448551,!![]);});return Promise[_0x03bb('0x26')](_0x263e66);});}function createHopperBlackForVoiceQueues(_0x3202e6,_0x4212bb){return _0x3202e6[_0x03bb('0x4')][_0x03bb('0x20')]({'where':{'type':_0x03bb('0x21')},'attributes':['id'],'include':[{'model':_0x3202e6[_0x03bb('0x22')],'as':'BlackLists','where':{'id':_0x4212bb[_0x03bb('0x11')]}}],'raw':!![]})[_0x03bb('0x8')](function(_0x137511){var _0x3457da=_0x137511['map'](function(_0x3591d9){return _0x3202e6[_0x03bb('0x27')][_0x03bb('0x1b')]({'phone':_0x4212bb[_0x03bb('0x10')],'ContactId':_0x4212bb['id'],'ListId':_0x4212bb['ListId'],'VoiceQueueId':_0x3591d9['id']});});return Promise['all'](_0x3457da);});}function createHopperBlackForCampaigns(_0x3858eb,_0x947be5){return _0x3858eb['Campaign'][_0x03bb('0x20')]({'attributes':['id'],'include':[{'model':_0x3858eb[_0x03bb('0x22')],'as':'BlackLists','where':{'id':_0x947be5[_0x03bb('0x11')]}}],'raw':!![]})[_0x03bb('0x8')](function(_0x32f681){var _0x2dfaba=_0x32f681[_0x03bb('0x24')](function(_0x5b682b){return _0x3858eb[_0x03bb('0x27')][_0x03bb('0x1b')]({'phone':_0x947be5[_0x03bb('0x10')],'ContactId':_0x947be5['id'],'ListId':_0x947be5[_0x03bb('0x11')],'CampaignId':_0x5b682b['id']});});return Promise[_0x03bb('0x26')](_0x2dfaba);});}module['exports']=function(_0x14f2a4){return _0x14f2a4['define'](_0x03bb('0x28'),attributes,{'tableName':_0x03bb('0x29'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x03bb('0x10')]},{'name':_0x03bb('0x2a'),'fields':[_0x03bb('0x2b'),'lastName','phone',_0x03bb('0x2c'),_0x03bb('0x2d'),'email'],'type':_0x03bb('0x2e')}],'timestamps':!![],'charset':_0x03bb('0x2f'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x28020b,_0x599ad5,_0x3cf781){var _0x4ad610=_0x14f2a4[_0x03bb('0x30')];var _0x2c9e5b=_0x28020b[_0x03bb('0x31')]({'plain':!![]});if(!_0x2c9e5b['ListId']){logger[_0x03bb('0x32')](_0x03bb('0x33')+_0x2c9e5b['id']);return _0x3cf781();}if(!_0x2c9e5b['phone']){return _0x3cf781();}return createHopperForVoiceQueues(_0x4ad610,_0x2c9e5b)[_0x03bb('0x8')](function(){return createHopperBlackForVoiceQueues(_0x4ad610,_0x2c9e5b);})[_0x03bb('0x8')](function(){return createHopperForCampaigns(_0x4ad610,_0x2c9e5b);})[_0x03bb('0x8')](function(){return createHopperBlackForCampaigns(_0x4ad610,_0x2c9e5b);})[_0x03bb('0x8')](function(){return _0x3cf781();})['catch'](function(_0xc4c4d1){logger['error']('[cmContact][afterCreate]',_0xc4c4d1[_0x03bb('0x34')]);_0x3cf781();});},'afterDestroy':function(_0x3791ca,_0x2b0d70,_0x33e7ae){var _0x44826f=_0x14f2a4['models'];var _0x5c6b79=_0x3791ca[_0x03bb('0x31')]({'plain':!![]});return _0x44826f[_0x03bb('0x15')][_0x03bb('0x20')]({'raw':!![],'where':{'ListId':_0x5c6b79[_0x03bb('0x11')],'ContactId':_0x5c6b79['id']}})[_0x03bb('0x8')](function(_0x1a7552){if(!_[_0x03bb('0x35')](_0x1a7552)){var _0x3e6bb3=[];for(var _0x387183=0x0;_0x387183<_0x1a7552[_0x03bb('0x36')];_0x387183+=0x1){var _0x10d4b3=_0x44826f[_0x03bb('0x15')][_0x03bb('0x37')]({'where':{'ListId':_0x1a7552[_0x387183][_0x03bb('0x11')],'ContactId':_0x1a7552[_0x387183][_0x03bb('0x38')],'VoiceQueueId':_0x1a7552[_0x387183][_0x03bb('0x1d')],'CampaignId':_0x1a7552[_0x387183][_0x03bb('0x1a')]}});_0x3e6bb3[_0x03bb('0x39')](_0x10d4b3);}return Promise[_0x03bb('0x26')](_0x3e6bb3);}})[_0x03bb('0x8')](function(_0x40565c){logger['info'](_0x03bb('0x3a'),util[_0x03bb('0x3b')](_0x40565c,{'showHidden':![],'depth':null}));_0x33e7ae();})['catch'](function(_0x2aadbf){logger[_0x03bb('0x32')](_0x03bb('0x3c'),util[_0x03bb('0x3b')](_0x2aadbf,{'showHidden':![],'depth':null}));_0x33e7ae(_0x2aadbf);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 820ea73..7112767 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0xcb94da,_0x57f2a7){var _0x3fc2f3=function(_0x3e21ad){while(--_0x3e21ad){_0xcb94da['push'](_0xcb94da['shift']());}};_0x3fc2f3(++_0x57f2a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 5bb0ac5..c9a5aaf 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65b3=['INTEGER','STRING','sequelize','exports'];(function(_0x419d75,_0x17ec6d){var _0x3f1c92=function(_0x3aac14){while(--_0x3aac14){_0x419d75['push'](_0x419d75['shift']());}};_0x3f1c92(++_0x17ec6d);}(_0x65b3,0xc6));var _0x365b=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0x65b3[_0x500785];return _0x1f8bcc;};'use strict';var Sequelize=require(_0x365b('0x0'));module[_0x365b('0x1')]={'CmContactId':{'type':Sequelize[_0x365b('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x365b('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x365b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x365b('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x365b('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x365b('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x04d0=['STRING','PHONE','INTEGER'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x04d0,0x10a));var _0x004d=function(_0x498554,_0x49933a){_0x498554=_0x498554-0x0;var _0x8aede0=_0x04d0[_0x498554];return _0x8aede0;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x004d('0x0')],'primaryKey':!![]},'item':{'type':Sequelize[_0x004d('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x004d('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x004d('0x1')],'defaultValue':_0x004d('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 10bfb65..de09ce1 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf56c=['rimraf','zip-dir','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','index','CmContactHasItem','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format'];(function(_0x390452,_0x2ff10f){var _0x236fb9=function(_0x49cf8c){while(--_0x49cf8c){_0x390452['push'](_0x390452['shift']());}};_0x236fb9(++_0x2ff10f);}(_0xf56c,0xec));var _0xcf56=function(_0x397f7e,_0x329335){_0x397f7e=_0x397f7e-0x0;var _0x2dd9be=_0xf56c[_0x397f7e];return _0x2dd9be;};'use strict';var emlformat=require(_0xcf56('0x0'));var rimraf=require(_0xcf56('0x1'));var zipdir=require(_0xcf56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcf56('0x3'));var BPromise=require(_0xcf56('0x4'));var Mustache=require('mustache');var util=require(_0xcf56('0x5'));var path=require('path');var sox=require(_0xcf56('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf56('0x7'));var _=require(_0xcf56('0x8'));var squel=require(_0xcf56('0x9'));var crypto=require(_0xcf56('0xa'));var jsforce=require(_0xcf56('0xb'));var deskjs=require(_0xcf56('0xc'));var toCsv=require(_0xcf56('0xd'));var querystring=require(_0xcf56('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf56('0xf'));var qs=require(_0xcf56('0x10'));var as=require(_0xcf56('0x11'));var hardwareService=require(_0xcf56('0x12'));var logger=require('../../config/logger')(_0xcf56('0x13'));var utils=require('../../config/utils');var config=require(_0xcf56('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf56('0x15'))['db'];function respondWithStatusCode(_0x4571d2,_0x2934a1){_0x2934a1=_0x2934a1||0xcc;return function(_0x97c59d){if(_0x97c59d){return _0x4571d2[_0xcf56('0x16')](_0x2934a1);}return _0x4571d2[_0xcf56('0x17')](_0x2934a1)[_0xcf56('0x18')]();};}function respondWithResult(_0x3865d7,_0x471737){_0x471737=_0x471737||0xc8;return function(_0x44bd7b){if(_0x44bd7b){return _0x3865d7['status'](_0x471737)['json'](_0x44bd7b);}};}function respondWithFilteredResult(_0x331b26,_0x1615b2){return function(_0x4fc40d){if(_0x4fc40d){var _0x31f41e=typeof _0x1615b2[_0xcf56('0x19')]===_0xcf56('0x1a')&&typeof _0x1615b2[_0xcf56('0x1b')]===_0xcf56('0x1a');var _0x2d4c1f=_0x4fc40d['count'];var _0x4e0a03=_0x31f41e?0x0:_0x1615b2[_0xcf56('0x19')];var _0x9a832c=_0x31f41e?_0x4fc40d['count']:_0x1615b2[_0xcf56('0x19')]+_0x1615b2[_0xcf56('0x1b')];var _0x3d1345;if(_0x9a832c>=_0x2d4c1f){_0x9a832c=_0x2d4c1f;_0x3d1345=0xc8;}else{_0x3d1345=0xce;}_0x331b26[_0xcf56('0x17')](_0x3d1345);return _0x331b26[_0xcf56('0x1c')](_0xcf56('0x1d'),_0x4e0a03+'-'+_0x9a832c+'/'+_0x2d4c1f)['json'](_0x4fc40d);}return null;};}function patchUpdates(_0x107eea){return function(_0x320f74){try{jsonpatch['apply'](_0x320f74,_0x107eea,!![]);}catch(_0x26ef37){return BPromise[_0xcf56('0x1e')](_0x26ef37);}return _0x320f74[_0xcf56('0x1f')]();};}function saveUpdates(_0x22079d,_0x26d374){return function(_0x4f035a){if(_0x4f035a){return _0x4f035a['update'](_0x22079d)[_0xcf56('0x20')](function(_0xc20efc){return _0xc20efc;});}return null;};}function removeEntity(_0x41e0bd,_0x1e8915){return function(_0x2d9baf){if(_0x2d9baf){return _0x2d9baf[_0xcf56('0x21')]()[_0xcf56('0x20')](function(){var _0x417a61=_0x2d9baf[_0xcf56('0x22')]({'plain':!![]});var _0x305702=_0xcf56('0x23');return db[_0xcf56('0x24')][_0xcf56('0x21')]({'where':{'type':_0x305702,'resourceId':_0x417a61['id']}})[_0xcf56('0x20')](function(){return _0x2d9baf;});})[_0xcf56('0x20')](function(){_0x41e0bd['status'](0xcc)[_0xcf56('0x18')]();});}};}function handleEntityNotFound(_0xad3f48,_0x183247){return function(_0x1230c0){if(!_0x1230c0){_0xad3f48[_0xcf56('0x16')](0x194);}return _0x1230c0;};}function handleError(_0x24b73f,_0x5a4ddd){_0x5a4ddd=_0x5a4ddd||0x1f4;return function(_0x229f17){logger[_0xcf56('0x25')](_0x229f17[_0xcf56('0x26')]);if(_0x229f17['name']){delete _0x229f17['name'];}_0x24b73f[_0xcf56('0x17')](_0x5a4ddd)[_0xcf56('0x27')](_0x229f17);};}exports[_0xcf56('0x28')]=function(_0x315742,_0x49789e){var _0x4cba98={},_0x3e8fb1={},_0x5e4ed6={'count':0x0,'rows':[]};var _0x16645b=_['map'](db[_0xcf56('0x29')][_0xcf56('0x2a')],function(_0x1a03cc){return{'name':_0x1a03cc[_0xcf56('0x2b')],'type':_0x1a03cc[_0xcf56('0x2c')][_0xcf56('0x2d')]};});_0x3e8fb1[_0xcf56('0x2e')]=_[_0xcf56('0x2f')](_0x16645b,_0xcf56('0x30'));_0x3e8fb1[_0xcf56('0x31')]=_[_0xcf56('0x32')](_0x315742['query']);_0x3e8fb1[_0xcf56('0x33')]=_['intersection'](_0x3e8fb1['model'],_0x3e8fb1[_0xcf56('0x31')]);_0x4cba98[_0xcf56('0x34')]=_['intersection'](_0x3e8fb1['model'],qs[_0xcf56('0x35')](_0x315742[_0xcf56('0x31')][_0xcf56('0x35')]));_0x4cba98[_0xcf56('0x34')]=_0x4cba98[_0xcf56('0x34')][_0xcf56('0x36')]?_0x4cba98[_0xcf56('0x34')]:_0x3e8fb1[_0xcf56('0x2e')];if(!_0x315742[_0xcf56('0x31')]['hasOwnProperty']('nolimit')){_0x4cba98[_0xcf56('0x1b')]=qs[_0xcf56('0x1b')](_0x315742[_0xcf56('0x31')]['limit']);_0x4cba98[_0xcf56('0x19')]=qs[_0xcf56('0x19')](_0x315742['query']['offset']);}_0x4cba98[_0xcf56('0x37')]=qs[_0xcf56('0x38')](_0x315742['query']['sort']);_0x4cba98[_0xcf56('0x39')]=qs[_0xcf56('0x33')](_[_0xcf56('0x3a')](_0x315742[_0xcf56('0x31')],_0x3e8fb1['filters']),_0x16645b);if(_0x315742[_0xcf56('0x31')]['filter']){_0x4cba98[_0xcf56('0x39')]=_[_0xcf56('0x3b')](_0x4cba98['where'],{'$or':_['map'](_0x16645b,function(_0x5c9e4b){if(_0x5c9e4b[_0xcf56('0x2c')]!==_0xcf56('0x3c')){var _0x573e9e={};_0x573e9e[_0x5c9e4b[_0xcf56('0x30')]]={'$like':'%'+_0x315742['query']['filter']+'%'};return _0x573e9e;}})});}_0x4cba98=_[_0xcf56('0x3b')]({},_0x4cba98,_0x315742[_0xcf56('0x3d')]);var _0x5a0d41={'where':_0x4cba98['where']};return db[_0xcf56('0x29')]['count'](_0x5a0d41)[_0xcf56('0x20')](function(_0x32af52){_0x5e4ed6['count']=_0x32af52;if(_0x315742['query'][_0xcf56('0x3e')]){_0x4cba98[_0xcf56('0x3f')]=[{'all':!![]}];}return db[_0xcf56('0x29')][_0xcf56('0x40')](_0x4cba98);})[_0xcf56('0x20')](function(_0x1aef00){_0x5e4ed6[_0xcf56('0x41')]=_0x1aef00;return _0x5e4ed6;})[_0xcf56('0x20')](respondWithFilteredResult(_0x49789e,_0x4cba98))[_0xcf56('0x42')](handleError(_0x49789e,null));};exports['show']=function(_0x3a20b5,_0x2d9530){var _0x303533={'raw':!![],'where':{'id':_0x3a20b5[_0xcf56('0x43')]['id']}},_0x58fcc0={};_0x58fcc0[_0xcf56('0x2e')]=_[_0xcf56('0x32')](db['CmContactHasItem'][_0xcf56('0x2a')]);_0x58fcc0['query']=_[_0xcf56('0x32')](_0x3a20b5[_0xcf56('0x31')]);_0x58fcc0[_0xcf56('0x33')]=_['intersection'](_0x58fcc0[_0xcf56('0x2e')],_0x58fcc0[_0xcf56('0x31')]);_0x303533[_0xcf56('0x34')]=_['intersection'](_0x58fcc0[_0xcf56('0x2e')],qs[_0xcf56('0x35')](_0x3a20b5['query'][_0xcf56('0x35')]));_0x303533[_0xcf56('0x34')]=_0x303533[_0xcf56('0x34')][_0xcf56('0x36')]?_0x303533[_0xcf56('0x34')]:_0x58fcc0[_0xcf56('0x2e')];if(_0x3a20b5['query']['includeAll']){_0x303533[_0xcf56('0x3f')]=[{'all':!![]}];}_0x303533=_[_0xcf56('0x3b')]({},_0x303533,_0x3a20b5[_0xcf56('0x3d')]);return db[_0xcf56('0x29')][_0xcf56('0x44')](_0x303533)[_0xcf56('0x20')](handleEntityNotFound(_0x2d9530,null))[_0xcf56('0x20')](respondWithResult(_0x2d9530,null))[_0xcf56('0x42')](handleError(_0x2d9530,null));};exports[_0xcf56('0x45')]=function(_0x284c5b,_0x47c037){return db[_0xcf56('0x29')][_0xcf56('0x45')](_0x284c5b[_0xcf56('0x46')],{})[_0xcf56('0x20')](function(_0x557b1d){var _0x36c61c=_0x284c5b[_0xcf56('0x47')]['get']({'plain':!![]});if(!_0x36c61c)throw new Error(_0xcf56('0x48'));if(_0x36c61c[_0xcf56('0x49')]==='user'){var _0xd1c868=_0x557b1d[_0xcf56('0x22')]({'plain':!![]});var _0x4208ad=_0xcf56('0x23');return db[_0xcf56('0x4a')][_0xcf56('0x44')]({'where':{'name':_0x4208ad,'userProfileId':_0x36c61c[_0xcf56('0x4b')]},'raw':!![]})[_0xcf56('0x20')](function(_0x56e89e){if(_0x56e89e&&_0x56e89e[_0xcf56('0x4c')]===0x0){return db['UserProfileResource'][_0xcf56('0x45')]({'name':_0xd1c868['name'],'resourceId':_0xd1c868['id'],'type':_0x56e89e[_0xcf56('0x30')],'sectionId':_0x56e89e['id']},{})[_0xcf56('0x20')](function(){return _0x557b1d;});}else{return _0x557b1d;}})[_0xcf56('0x42')](function(_0x4903e1){logger['error'](_0xcf56('0x4d'),_0x4903e1);throw _0x4903e1;});}return _0x557b1d;})[_0xcf56('0x20')](respondWithResult(_0x47c037,0xc9))[_0xcf56('0x42')](handleError(_0x47c037,null));};exports[_0xcf56('0x4e')]=function(_0x824290,_0x3437f7){if(_0x824290[_0xcf56('0x46')]['id']){delete _0x824290[_0xcf56('0x46')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x824290[_0xcf56('0x43')]['id']}})[_0xcf56('0x20')](handleEntityNotFound(_0x3437f7,null))[_0xcf56('0x20')](saveUpdates(_0x824290[_0xcf56('0x46')],null))[_0xcf56('0x20')](respondWithResult(_0x3437f7,null))[_0xcf56('0x42')](handleError(_0x3437f7,null));};exports[_0xcf56('0x21')]=function(_0x2da8e3,_0x246674){return db[_0xcf56('0x29')][_0xcf56('0x44')]({'where':{'id':_0x2da8e3['params']['id']}})[_0xcf56('0x20')](handleEntityNotFound(_0x246674,null))[_0xcf56('0x20')](removeEntity(_0x246674,null))['catch'](handleError(_0x246674,null));}; \ No newline at end of file +var _0x29ce=['to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x518fcd,_0x13e1d1){var _0x5572a1=function(_0x4bd923){while(--_0x4bd923){_0x518fcd['push'](_0x518fcd['shift']());}};_0x5572a1(++_0x13e1d1);}(_0x29ce,0x1e3));var _0xe29c=function(_0x19cac0,_0x1bbeba){_0x19cac0=_0x19cac0-0x0;var _0x8242e8=_0x29ce[_0x19cac0];return _0x8242e8;};'use strict';var emlformat=require(_0xe29c('0x0'));var rimraf=require(_0xe29c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe29c('0x2'));var rp=require(_0xe29c('0x3'));var moment=require(_0xe29c('0x4'));var BPromise=require(_0xe29c('0x5'));var Mustache=require(_0xe29c('0x6'));var util=require(_0xe29c('0x7'));var path=require(_0xe29c('0x8'));var sox=require('sox');var csv=require(_0xe29c('0x9'));var ejs=require(_0xe29c('0xa'));var fs=require('fs');var fs_extra=require(_0xe29c('0xb'));var _=require(_0xe29c('0xc'));var squel=require(_0xe29c('0xd'));var crypto=require('crypto');var jsforce=require(_0xe29c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe29c('0x9'));var querystring=require('querystring');var Papa=require(_0xe29c('0xf'));var Redis=require(_0xe29c('0x10'));var authService=require(_0xe29c('0x11'));var qs=require(_0xe29c('0x12'));var as=require(_0xe29c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe29c('0x14'));var config=require(_0xe29c('0x15'));var licenseUtil=require(_0xe29c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1742cd,_0x482fc3){_0x482fc3=_0x482fc3||0xcc;return function(_0x551c96){if(_0x551c96){return _0x1742cd[_0xe29c('0x17')](_0x482fc3);}return _0x1742cd[_0xe29c('0x18')](_0x482fc3)[_0xe29c('0x19')]();};}function respondWithResult(_0x3c69cc,_0x165ffe){_0x165ffe=_0x165ffe||0xc8;return function(_0x5a6211){if(_0x5a6211){return _0x3c69cc['status'](_0x165ffe)[_0xe29c('0x1a')](_0x5a6211);}};}function respondWithFilteredResult(_0x12253f,_0x2bdf86){return function(_0x43785d){if(_0x43785d){var _0x53287f=typeof _0x2bdf86[_0xe29c('0x1b')]===_0xe29c('0x1c')&&typeof _0x2bdf86['limit']===_0xe29c('0x1c');var _0xe5c066=_0x43785d[_0xe29c('0x1d')];var _0x955ffe=_0x53287f?0x0:_0x2bdf86[_0xe29c('0x1b')];var _0x2b3435=_0x53287f?_0x43785d['count']:_0x2bdf86[_0xe29c('0x1b')]+_0x2bdf86['limit'];var _0x51a393;if(_0x2b3435>=_0xe5c066){_0x2b3435=_0xe5c066;_0x51a393=0xc8;}else{_0x51a393=0xce;}_0x12253f['status'](_0x51a393);return _0x12253f[_0xe29c('0x1e')]('Content-Range',_0x955ffe+'-'+_0x2b3435+'/'+_0xe5c066)['json'](_0x43785d);}return null;};}function patchUpdates(_0x3eecee){return function(_0xe6f4b5){try{jsonpatch[_0xe29c('0x1f')](_0xe6f4b5,_0x3eecee,!![]);}catch(_0x49e069){return BPromise['reject'](_0x49e069);}return _0xe6f4b5[_0xe29c('0x20')]();};}function saveUpdates(_0x172961,_0x507947){return function(_0x102614){if(_0x102614){return _0x102614[_0xe29c('0x21')](_0x172961)[_0xe29c('0x22')](function(_0x1b8b9d){return _0x1b8b9d;});}return null;};}function removeEntity(_0x88ef40,_0x15052c){return function(_0x25242a){if(_0x25242a){return _0x25242a[_0xe29c('0x23')]()['then'](function(){var _0x25d407=_0x25242a[_0xe29c('0x24')]({'plain':!![]});var _0x316ce7=_0xe29c('0x25');return db[_0xe29c('0x26')][_0xe29c('0x23')]({'where':{'type':_0x316ce7,'resourceId':_0x25d407['id']}})[_0xe29c('0x22')](function(){return _0x25242a;});})[_0xe29c('0x22')](function(){_0x88ef40[_0xe29c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a40d6,_0x193c80){return function(_0x3a58e8){if(!_0x3a58e8){_0x9a40d6['sendStatus'](0x194);}return _0x3a58e8;};}function handleError(_0x20bafd,_0x2916bf){_0x2916bf=_0x2916bf||0x1f4;return function(_0x2f9dc0){logger[_0xe29c('0x27')](_0x2f9dc0[_0xe29c('0x28')]);if(_0x2f9dc0[_0xe29c('0x29')]){delete _0x2f9dc0[_0xe29c('0x29')];}_0x20bafd[_0xe29c('0x18')](_0x2916bf)['send'](_0x2f9dc0);};}exports[_0xe29c('0x2a')]=function(_0x3a066e,_0x462845){var _0x1b2480={},_0x5ddd0b={},_0x47c8b1={'count':0x0,'rows':[]};var _0x2bfeac=_[_0xe29c('0x2b')](db[_0xe29c('0x2c')][_0xe29c('0x2d')],function(_0x35287f){return{'name':_0x35287f[_0xe29c('0x2e')],'type':_0x35287f['type']['key']};});_0x5ddd0b[_0xe29c('0x2f')]=_[_0xe29c('0x2b')](_0x2bfeac,_0xe29c('0x29'));_0x5ddd0b[_0xe29c('0x30')]=_[_0xe29c('0x31')](_0x3a066e[_0xe29c('0x30')]);_0x5ddd0b[_0xe29c('0x32')]=_['intersection'](_0x5ddd0b[_0xe29c('0x2f')],_0x5ddd0b[_0xe29c('0x30')]);_0x1b2480[_0xe29c('0x33')]=_[_0xe29c('0x34')](_0x5ddd0b[_0xe29c('0x2f')],qs[_0xe29c('0x35')](_0x3a066e[_0xe29c('0x30')]['fields']));_0x1b2480['attributes']=_0x1b2480[_0xe29c('0x33')][_0xe29c('0x36')]?_0x1b2480['attributes']:_0x5ddd0b[_0xe29c('0x2f')];if(!_0x3a066e[_0xe29c('0x30')][_0xe29c('0x37')](_0xe29c('0x38'))){_0x1b2480[_0xe29c('0x39')]=qs[_0xe29c('0x39')](_0x3a066e[_0xe29c('0x30')][_0xe29c('0x39')]);_0x1b2480['offset']=qs['offset'](_0x3a066e[_0xe29c('0x30')][_0xe29c('0x1b')]);}_0x1b2480[_0xe29c('0x3a')]=qs[_0xe29c('0x3b')](_0x3a066e['query'][_0xe29c('0x3b')]);_0x1b2480['where']=qs[_0xe29c('0x32')](_[_0xe29c('0x3c')](_0x3a066e['query'],_0x5ddd0b[_0xe29c('0x32')]),_0x2bfeac);if(_0x3a066e[_0xe29c('0x30')][_0xe29c('0x3d')]){_0x1b2480[_0xe29c('0x3e')]=_[_0xe29c('0x3f')](_0x1b2480[_0xe29c('0x3e')],{'$or':_['map'](_0x2bfeac,function(_0x38fc41){if(_0x38fc41[_0xe29c('0x40')]!==_0xe29c('0x41')){var _0x5c1f7b={};_0x5c1f7b[_0x38fc41[_0xe29c('0x29')]]={'$like':'%'+_0x3a066e[_0xe29c('0x30')][_0xe29c('0x3d')]+'%'};return _0x5c1f7b;}})});}_0x1b2480=_[_0xe29c('0x3f')]({},_0x1b2480,_0x3a066e[_0xe29c('0x42')]);var _0x4134a8={'where':_0x1b2480[_0xe29c('0x3e')]};return db['CmContactHasItem'][_0xe29c('0x1d')](_0x4134a8)[_0xe29c('0x22')](function(_0x45c3e2){_0x47c8b1[_0xe29c('0x1d')]=_0x45c3e2;if(_0x3a066e[_0xe29c('0x30')][_0xe29c('0x43')]){_0x1b2480[_0xe29c('0x44')]=[{'all':!![]}];}return db[_0xe29c('0x2c')][_0xe29c('0x45')](_0x1b2480);})[_0xe29c('0x22')](function(_0x431e63){_0x47c8b1[_0xe29c('0x46')]=_0x431e63;return _0x47c8b1;})[_0xe29c('0x22')](respondWithFilteredResult(_0x462845,_0x1b2480))['catch'](handleError(_0x462845,null));};exports['show']=function(_0x105024,_0x5b7797){var _0x405992={'raw':!![],'where':{'id':_0x105024['params']['id']}},_0x1181f2={};_0x1181f2[_0xe29c('0x2f')]=_[_0xe29c('0x31')](db['CmContactHasItem'][_0xe29c('0x2d')]);_0x1181f2[_0xe29c('0x30')]=_[_0xe29c('0x31')](_0x105024[_0xe29c('0x30')]);_0x1181f2['filters']=_[_0xe29c('0x34')](_0x1181f2[_0xe29c('0x2f')],_0x1181f2['query']);_0x405992['attributes']=_[_0xe29c('0x34')](_0x1181f2[_0xe29c('0x2f')],qs[_0xe29c('0x35')](_0x105024[_0xe29c('0x30')][_0xe29c('0x35')]));_0x405992['attributes']=_0x405992[_0xe29c('0x33')][_0xe29c('0x36')]?_0x405992[_0xe29c('0x33')]:_0x1181f2['model'];if(_0x105024[_0xe29c('0x30')]['includeAll']){_0x405992['include']=[{'all':!![]}];}_0x405992=_[_0xe29c('0x3f')]({},_0x405992,_0x105024[_0xe29c('0x42')]);return db[_0xe29c('0x2c')][_0xe29c('0x47')](_0x405992)[_0xe29c('0x22')](handleEntityNotFound(_0x5b7797,null))[_0xe29c('0x22')](respondWithResult(_0x5b7797,null))[_0xe29c('0x48')](handleError(_0x5b7797,null));};exports['create']=function(_0x273e29,_0x1dcb97){return db[_0xe29c('0x2c')][_0xe29c('0x49')](_0x273e29[_0xe29c('0x4a')],{})[_0xe29c('0x22')](function(_0xc0b4e0){var _0x4aefd2=_0x273e29['user'][_0xe29c('0x24')]({'plain':!![]});if(!_0x4aefd2)throw new Error(_0xe29c('0x4b'));if(_0x4aefd2[_0xe29c('0x4c')]===_0xe29c('0x4d')){var _0x4a1294=_0xc0b4e0['get']({'plain':!![]});var _0x1f27ad='CmContactHasItems';return db[_0xe29c('0x4e')]['find']({'where':{'name':_0x1f27ad,'userProfileId':_0x4aefd2[_0xe29c('0x4f')]},'raw':!![]})[_0xe29c('0x22')](function(_0x29a686){if(_0x29a686&&_0x29a686[_0xe29c('0x50')]===0x0){return db[_0xe29c('0x26')][_0xe29c('0x49')]({'name':_0x4a1294[_0xe29c('0x29')],'resourceId':_0x4a1294['id'],'type':_0x29a686['name'],'sectionId':_0x29a686['id']},{})[_0xe29c('0x22')](function(){return _0xc0b4e0;});}else{return _0xc0b4e0;}})[_0xe29c('0x48')](function(_0x4e772d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e772d);throw _0x4e772d;});}return _0xc0b4e0;})[_0xe29c('0x22')](respondWithResult(_0x1dcb97,0xc9))['catch'](handleError(_0x1dcb97,null));};exports[_0xe29c('0x21')]=function(_0x41faca,_0x53f3e5){if(_0x41faca[_0xe29c('0x4a')]['id']){delete _0x41faca[_0xe29c('0x4a')]['id'];}return db[_0xe29c('0x2c')][_0xe29c('0x47')]({'where':{'id':_0x41faca['params']['id']}})['then'](handleEntityNotFound(_0x53f3e5,null))['then'](saveUpdates(_0x41faca[_0xe29c('0x4a')],null))[_0xe29c('0x22')](respondWithResult(_0x53f3e5,null))[_0xe29c('0x48')](handleError(_0x53f3e5,null));};exports[_0xe29c('0x23')]=function(_0x51048a,_0x14b9b8){return db[_0xe29c('0x2c')][_0xe29c('0x47')]({'where':{'id':_0x51048a[_0xe29c('0x51')]['id']}})[_0xe29c('0x22')](handleEntityNotFound(_0x14b9b8,null))['then'](removeEntity(_0x14b9b8,null))['catch'](handleError(_0x14b9b8,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ed29176..7ab78a1 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b51=['util','../../config/logger','api','moment','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items'];(function(_0x86284e,_0x36a75c){var _0x502cfb=function(_0x1607dd){while(--_0x1607dd){_0x86284e['push'](_0x86284e['shift']());}};_0x502cfb(++_0x36a75c);}(_0x3b51,0x19a));var _0x13b5=function(_0x923e53,_0x2cc867){_0x923e53=_0x923e53-0x0;var _0x4d0120=_0x3b51[_0x923e53];return _0x4d0120;};'use strict';var _=require('lodash');var util=require(_0x13b5('0x0'));var logger=require(_0x13b5('0x1'))(_0x13b5('0x2'));var moment=require(_0x13b5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x13b5('0x4'));var config=require('../../config/environment');var attributes=require(_0x13b5('0x5'));module[_0x13b5('0x6')]=function(_0x4cede5,_0x2c68f0){return _0x4cede5[_0x13b5('0x7')](_0x13b5('0x8'),attributes,{'tableName':_0x13b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x577b=['moment','request-promise','path','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api'];(function(_0x114c09,_0x573192){var _0x501b05=function(_0x25a96b){while(--_0x25a96b){_0x114c09['push'](_0x114c09['shift']());}};_0x501b05(++_0x573192);}(_0x577b,0xa4));var _0xb577=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x577b[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xb577('0x0'));var util=require(_0xb577('0x1'));var logger=require(_0xb577('0x2'))(_0xb577('0x3'));var moment=require(_0xb577('0x4'));var BPromise=require('bluebird');var rp=require(_0xb577('0x5'));var fs=require('fs');var path=require(_0xb577('0x6'));var rimraf=require('rimraf');var config=require(_0xb577('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0xb577('0x8')]=function(_0xdfa83f,_0x30d730){return _0xdfa83f[_0xb577('0x9')](_0xb577('0xa'),attributes,{'tableName':_0xb577('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index cfb564c..2a18f8b 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0088=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error'];(function(_0x578452,_0x2970a6){var _0x667777=function(_0x25909f){while(--_0x25909f){_0x578452['push'](_0x578452['shift']());}};_0x667777(++_0x2970a6);}(_0x0088,0x1e5));var _0x8008=function(_0x4fffd0,_0x4b20dd){_0x4fffd0=_0x4fffd0-0x0;var _0x22fe32=_0x0088[_0x4fffd0];return _0x22fe32;};'use strict';var _=require(_0x8008('0x0'));var util=require(_0x8008('0x1'));var moment=require(_0x8008('0x2'));var BPromise=require(_0x8008('0x3'));var rs=require(_0x8008('0x4'));var fs=require('fs');var Redis=require(_0x8008('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8008('0x6'));var logger=require(_0x8008('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8008('0x8'));var client=jayson[_0x8008('0x9')][_0x8008('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331525,_0x3ded34,_0x3bcf59){return new BPromise(function(_0x1e5c4c,_0xd889b7){return client[_0x8008('0xb')](_0x331525,_0x3bcf59)[_0x8008('0xc')](function(_0xc2c7e6){logger[_0x8008('0xd')](_0x8008('0xe'),_0x3ded34,_0x8008('0xf'));logger[_0x8008('0x10')](_0x8008('0x11'),_0x3ded34,_0x8008('0xf'),JSON['stringify'](_0xc2c7e6));if(_0xc2c7e6[_0x8008('0x12')]){if(_0xc2c7e6['error'][_0x8008('0x13')]===0x1f4){logger[_0x8008('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x3ded34,_0xc2c7e6[_0x8008('0x12')][_0x8008('0x14')]);return _0xd889b7(_0xc2c7e6[_0x8008('0x12')][_0x8008('0x14')]);}logger[_0x8008('0x12')](_0x8008('0xe'),_0x3ded34,_0xc2c7e6[_0x8008('0x12')][_0x8008('0x14')]);return _0x1e5c4c(_0xc2c7e6[_0x8008('0x12')][_0x8008('0x14')]);}else{logger[_0x8008('0xd')](_0x8008('0xe'),_0x3ded34,_0x8008('0xf'));_0x1e5c4c(_0xc2c7e6['result'][_0x8008('0x14')]);}})['catch'](function(_0x47a837){logger[_0x8008('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x3ded34,_0x47a837);_0xd889b7(_0x47a837);});});} \ No newline at end of file +var _0x754b=['request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x754b,0x94));var _0xb754=function(_0x616fb8,_0x177e11){_0x616fb8=_0x616fb8-0x0;var _0x739e20=_0x754b[_0x616fb8];return _0x739e20;};'use strict';var _=require('lodash');var util=require(_0xb754('0x0'));var moment=require(_0xb754('0x1'));var BPromise=require(_0xb754('0x2'));var rs=require(_0xb754('0x3'));var fs=require('fs');var Redis=require(_0xb754('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb754('0x5'));var logger=require(_0xb754('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb754('0x7'));var client=jayson[_0xb754('0x8')][_0xb754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a9bfc,_0x4f3ff1,_0x5f2b15){return new BPromise(function(_0x58e2a6,_0x54232b){return client[_0xb754('0xa')](_0x3a9bfc,_0x5f2b15)[_0xb754('0xb')](function(_0x88c2eb){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x4f3ff1,_0xb754('0xc'));logger[_0xb754('0xd')](_0xb754('0xe'),_0x4f3ff1,_0xb754('0xc'),JSON[_0xb754('0xf')](_0x88c2eb));if(_0x88c2eb[_0xb754('0x10')]){if(_0x88c2eb[_0xb754('0x10')][_0xb754('0x11')]===0x1f4){logger[_0xb754('0x10')](_0xb754('0x12'),_0x4f3ff1,_0x88c2eb[_0xb754('0x10')][_0xb754('0x13')]);return _0x54232b(_0x88c2eb[_0xb754('0x10')]['message']);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4f3ff1,_0x88c2eb[_0xb754('0x10')]['message']);return _0x58e2a6(_0x88c2eb[_0xb754('0x10')]['message']);}else{logger['info'](_0xb754('0x12'),_0x4f3ff1,_0xb754('0xc'));_0x58e2a6(_0x88c2eb['result'][_0xb754('0x13')]);}})['catch'](function(_0x34ab3d){logger[_0xb754('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x4f3ff1,_0x34ab3d);_0x54232b(_0x34ab3d);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index fb72d7e..6bc1e97 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6785=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x1d5a62,_0x416319){var _0x59f074=function(_0x375fd4){while(--_0x375fd4){_0x1d5a62['push'](_0x1d5a62['shift']());}};_0x59f074(++_0x416319);}(_0x6785,0xa6));var _0x5678=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x6785[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0x5678('0x0'));var util=require(_0x5678('0x1'));var path=require(_0x5678('0x2'));var timeout=require(_0x5678('0x3'));var express=require(_0x5678('0x4'));var router=express[_0x5678('0x5')]();var fs_extra=require(_0x5678('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5678('0x7'));var config=require(_0x5678('0x8'));var controller=require(_0x5678('0x9'));router[_0x5678('0xa')]('/',auth['isAuthenticated'](),controller[_0x5678('0xb')]);router['get'](_0x5678('0xc'),auth[_0x5678('0xd')](),controller[_0x5678('0xe')]);router[_0x5678('0xf')]('/',auth[_0x5678('0xd')](),controller['create']);router[_0x5678('0x10')]('/:id',auth[_0x5678('0xd')](),controller[_0x5678('0x11')]);router[_0x5678('0x12')](_0x5678('0xc'),auth[_0x5678('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbb8e=['post','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','get','/:id','show'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0xbb8e,0x164));var _0xebb8=function(_0x242e38,_0x5433ca){_0x242e38=_0x242e38-0x0;var _0x58ce8d=_0xbb8e[_0x242e38];return _0x58ce8d;};'use strict';var multer=require(_0xebb8('0x0'));var util=require(_0xebb8('0x1'));var path=require(_0xebb8('0x2'));var timeout=require(_0xebb8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xebb8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xebb8('0x5'));var config=require(_0xebb8('0x6'));var controller=require(_0xebb8('0x7'));router['get']('/',auth[_0xebb8('0x8')](),controller['index']);router[_0xebb8('0x9')](_0xebb8('0xa'),auth[_0xebb8('0x8')](),controller[_0xebb8('0xb')]);router[_0xebb8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xebb8('0xa'),auth[_0xebb8('0x8')](),controller[_0xebb8('0xd')]);router[_0xebb8('0xe')](_0xebb8('0xa'),auth[_0xebb8('0x8')](),controller[_0xebb8('0xf')]);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 095b659..4bbdc84 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 _0x68ee=['alias','setDataValue','getDataValue','name','STRING','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL'];(function(_0xbf91b8,_0x4fb747){var _0x2909ee=function(_0x3bcd14){while(--_0x3bcd14){_0xbf91b8['push'](_0xbf91b8['shift']());}};_0x2909ee(++_0x4fb747);}(_0x68ee,0x13f));var _0xe68e=function(_0xb77d4e,_0x4c3344){_0xb77d4e=_0xb77d4e-0x0;var _0x1cc66d=_0x68ee[_0xb77d4e];return _0x1cc66d;};'use strict';var Sequelize=require(_0xe68e('0x0'));var _=require(_0xe68e('0x1'));module[_0xe68e('0x2')]={'name':{'type':Sequelize[_0xe68e('0x3')],'get':function(_0x73508f){return this['getDataValue'](_0xe68e('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x546bea){this[_0xe68e('0x5')](_0xe68e('0x4'),_0x546bea?_0x546bea:this[_0xe68e('0x6')](_0xe68e('0x7')));}},'type':{'type':Sequelize[_0xe68e('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0xe68e('0x9')](_0xe68e('0xa')),'get':function(){if(this[_0xe68e('0x6')](_0xe68e('0xb'))===_0xe68e('0xc')){return JSON[_0xe68e('0xd')](this[_0xe68e('0x6')](_0xe68e('0xe')));}else{return this[_0xe68e('0x6')](_0xe68e('0xe'));}},'set':function(_0x3017a5){if(Array[_0xe68e('0xf')](_0x3017a5)){this[_0xe68e('0x5')](_0xe68e('0xe'),JSON[_0xe68e('0x10')](_0x3017a5));}else{this['setDataValue'](_0xe68e('0xe'),_0x3017a5);}}},'required':{'type':Sequelize[_0xe68e('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe68e('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xe68e('0x12'))}}; \ No newline at end of file +var _0x7e4a=['getDataValue','alias','STRING','name','TEXT','long','type','values','isArray','setDataValue','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL'];(function(_0x3607a3,_0x18b07b){var _0x2e8f5e=function(_0x30245b){while(--_0x30245b){_0x3607a3['push'](_0x3607a3['shift']());}};_0x2e8f5e(++_0x18b07b);}(_0x7e4a,0xea));var _0xa7e4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7e4a[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xa7e4('0x0'));var _=require(_0xa7e4('0x1'));module[_0xa7e4('0x2')]={'name':{'type':Sequelize[_0xa7e4('0x3')],'get':function(_0x2073bb){return this[_0xa7e4('0x4')](_0xa7e4('0x5'));}},'alias':{'type':Sequelize[_0xa7e4('0x6')],'allowNull':![],'set':function(_0x949f2a){this['setDataValue']('alias',_0x949f2a?_0x949f2a:this[_0xa7e4('0x4')](_0xa7e4('0x7')));}},'type':{'type':Sequelize[_0xa7e4('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xa7e4('0x8')](_0xa7e4('0x9')),'get':function(){if(this[_0xa7e4('0x4')](_0xa7e4('0xa'))==='select'){return JSON['parse'](this[_0xa7e4('0x4')](_0xa7e4('0xb')));}else{return this['getDataValue']('values');}},'set':function(_0x444cfc){if(Array[_0xa7e4('0xc')](_0x444cfc)){this[_0xa7e4('0xd')]('values',JSON[_0xa7e4('0xe')](_0x444cfc));}else{this[_0xa7e4('0xd')](_0xa7e4('0xb'),_0x444cfc);}}},'required':{'type':Sequelize[_0xa7e4('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa7e4('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xa7e4('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index bd90923..547394e 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 _0x255d=['include','find','update','body','create','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','CmCustomField','fieldName','key','model','differenceBy','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','rawAttributes'];(function(_0x4cf404,_0xf9262c){var _0x5c1eb2=function(_0x5ce714){while(--_0x5ce714){_0x4cf404['push'](_0x4cf404['shift']());}};_0x5c1eb2(++_0xf9262c);}(_0x255d,0x181));var _0xd255=function(_0x58cf2f,_0x91e4ed){_0x58cf2f=_0x58cf2f-0x0;var _0x3646b2=_0x255d[_0x58cf2f];return _0x3646b2;};'use strict';var emlformat=require(_0xd255('0x0'));var rimraf=require(_0xd255('0x1'));var zipdir=require(_0xd255('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd255('0x3'));var moment=require(_0xd255('0x4'));var BPromise=require(_0xd255('0x5'));var Mustache=require(_0xd255('0x6'));var util=require(_0xd255('0x7'));var path=require('path');var sox=require(_0xd255('0x8'));var csv=require(_0xd255('0x9'));var ejs=require(_0xd255('0xa'));var fs=require('fs');var fs_extra=require(_0xd255('0xb'));var _=require(_0xd255('0xc'));var squel=require('squel');var crypto=require(_0xd255('0xd'));var jsforce=require(_0xd255('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd255('0x9'));var querystring=require(_0xd255('0xf'));var Papa=require(_0xd255('0x10'));var Redis=require(_0xd255('0x11'));var authService=require(_0xd255('0x12'));var qs=require(_0xd255('0x13'));var as=require(_0xd255('0x14'));var hardwareService=require(_0xd255('0x15'));var logger=require(_0xd255('0x16'))('api');var utils=require(_0xd255('0x17'));var config=require(_0xd255('0x18'));var licenseUtil=require(_0xd255('0x19'));var db=require(_0xd255('0x1a'))['db'];function respondWithStatusCode(_0x1de923,_0x4b69bf){_0x4b69bf=_0x4b69bf||0xcc;return function(_0x1f53a8){if(_0x1f53a8){return _0x1de923['sendStatus'](_0x4b69bf);}return _0x1de923['status'](_0x4b69bf)[_0xd255('0x1b')]();};}function respondWithResult(_0x232c0c,_0xd765d5){_0xd765d5=_0xd765d5||0xc8;return function(_0x161dfd){if(_0x161dfd){return _0x232c0c[_0xd255('0x1c')](_0xd765d5)[_0xd255('0x1d')](_0x161dfd);}};}function respondWithFilteredResult(_0x113754,_0x2a25a2){return function(_0x10a5c7){if(_0x10a5c7){var _0x24b592=typeof _0x2a25a2[_0xd255('0x1e')]===_0xd255('0x1f')&&typeof _0x2a25a2[_0xd255('0x20')]===_0xd255('0x1f');var _0x4ec100=_0x10a5c7[_0xd255('0x21')];var _0x20ceb4=_0x24b592?0x0:_0x2a25a2[_0xd255('0x1e')];var _0x5b060f=_0x24b592?_0x10a5c7[_0xd255('0x21')]:_0x2a25a2[_0xd255('0x1e')]+_0x2a25a2[_0xd255('0x20')];var _0x4f17c4;if(_0x5b060f>=_0x4ec100){_0x5b060f=_0x4ec100;_0x4f17c4=0xc8;}else{_0x4f17c4=0xce;}_0x113754[_0xd255('0x1c')](_0x4f17c4);return _0x113754[_0xd255('0x22')](_0xd255('0x23'),_0x20ceb4+'-'+_0x5b060f+'/'+_0x4ec100)[_0xd255('0x1d')](_0x10a5c7);}return null;};}function patchUpdates(_0x566f88){return function(_0x5a3eb9){try{jsonpatch[_0xd255('0x24')](_0x5a3eb9,_0x566f88,!![]);}catch(_0x5a7c51){return BPromise[_0xd255('0x25')](_0x5a7c51);}return _0x5a3eb9[_0xd255('0x26')]();};}function saveUpdates(_0x33f854,_0xa31353){return function(_0x2763da){if(_0x2763da){return _0x2763da['update'](_0x33f854)[_0xd255('0x27')](function(_0x45d761){return _0x45d761;});}return null;};}function removeEntity(_0x97bd14,_0x1385c2){return function(_0x31175c){if(_0x31175c){return _0x31175c[_0xd255('0x28')]()[_0xd255('0x27')](function(){_0x97bd14[_0xd255('0x1c')](0xcc)[_0xd255('0x1b')]();});}};}function handleEntityNotFound(_0x233581,_0x320b4d){return function(_0x31d611){if(!_0x31d611){_0x233581[_0xd255('0x29')](0x194);}return _0x31d611;};}function handleError(_0x381560,_0x3a77c9){_0x3a77c9=_0x3a77c9||0x1f4;return function(_0x4da3b0){logger[_0xd255('0x2a')](_0x4da3b0['stack']);if(_0x4da3b0[_0xd255('0x2b')]){delete _0x4da3b0[_0xd255('0x2b')];}_0x381560[_0xd255('0x1c')](_0x3a77c9)[_0xd255('0x2c')](_0x4da3b0);};}exports['index']=function(_0x30236e,_0x376089){var _0x543a53={},_0x17ecf4={},_0x5afb16={'count':0x0,'rows':[]};var _0x1dc242=_[_0xd255('0x2d')](db[_0xd255('0x2e')]['rawAttributes'],function(_0x25435b){return{'name':_0x25435b[_0xd255('0x2f')],'type':_0x25435b['type'][_0xd255('0x30')]};});_0x17ecf4[_0xd255('0x31')]=_[_0xd255('0x32')](_[_0xd255('0x2d')](_0x1dc242,'name'),[_0xd255('0x2b')]);_0x17ecf4[_0xd255('0x33')]=_['keys'](_0x30236e[_0xd255('0x33')]);_0x17ecf4['filters']=_[_0xd255('0x34')](_0x17ecf4[_0xd255('0x31')],_0x17ecf4[_0xd255('0x33')]);_0x543a53['attributes']=_['intersection'](_0x17ecf4['model'],qs[_0xd255('0x35')](_0x30236e[_0xd255('0x33')][_0xd255('0x35')]));_0x543a53['attributes']=_0x543a53['attributes'][_0xd255('0x36')]?_0x543a53[_0xd255('0x37')]:_0x17ecf4[_0xd255('0x31')];if(!_0x30236e[_0xd255('0x33')][_0xd255('0x38')](_0xd255('0x39'))){_0x543a53['limit']=qs['limit'](_0x30236e['query']['limit']);_0x543a53[_0xd255('0x1e')]=qs[_0xd255('0x1e')](_0x30236e[_0xd255('0x33')][_0xd255('0x1e')]);}_0x543a53[_0xd255('0x3a')]=qs[_0xd255('0x3b')](_0x30236e[_0xd255('0x33')]['sort']);_0x543a53[_0xd255('0x3c')]=qs[_0xd255('0x3d')](_[_0xd255('0x3e')](_0x30236e['query'],_0x17ecf4[_0xd255('0x3d')]),_0x1dc242);if(_0x30236e['query']['filter']){_0x543a53[_0xd255('0x3c')]=_[_0xd255('0x3f')](_0x543a53[_0xd255('0x3c')],{'$or':_[_0xd255('0x2d')](_0x1dc242,function(_0x3dafce){if(_0x3dafce[_0xd255('0x40')]!==_0xd255('0x41')){var _0x200e7a={};_0x200e7a[_0x3dafce[_0xd255('0x2b')]]={'$like':'%'+_0x30236e[_0xd255('0x33')][_0xd255('0x42')]+'%'};return _0x200e7a;}})});}_0x543a53=_['merge']({},_0x543a53,_0x30236e[_0xd255('0x43')]);var _0x1ae738={'where':_0x543a53[_0xd255('0x3c')]};return db[_0xd255('0x2e')]['count'](_0x1ae738)['then'](function(_0x4642fd){_0x5afb16[_0xd255('0x21')]=_0x4642fd;if(_0x30236e[_0xd255('0x33')][_0xd255('0x44')]){_0x543a53['include']=[{'all':!![]}];}return db[_0xd255('0x2e')][_0xd255('0x45')](_0x543a53);})[_0xd255('0x27')](function(_0x18ad0f){_0x5afb16['rows']=_0x18ad0f;return _0x5afb16;})[_0xd255('0x27')](respondWithFilteredResult(_0x376089,_0x543a53))[_0xd255('0x46')](handleError(_0x376089,null));};exports[_0xd255('0x47')]=function(_0x450333,_0x2591dd){var _0x4ef15f={'raw':!![],'where':{'id':_0x450333[_0xd255('0x48')]['id']}},_0x5cc1c4={};_0x5cc1c4[_0xd255('0x31')]=_[_0xd255('0x49')](db[_0xd255('0x2e')][_0xd255('0x4a')]);_0x5cc1c4[_0xd255('0x33')]=_[_0xd255('0x49')](_0x450333[_0xd255('0x33')]);_0x5cc1c4['filters']=_[_0xd255('0x34')](_0x5cc1c4[_0xd255('0x31')],_0x5cc1c4[_0xd255('0x33')]);_0x4ef15f[_0xd255('0x37')]=_[_0xd255('0x34')](_0x5cc1c4[_0xd255('0x31')],qs[_0xd255('0x35')](_0x450333[_0xd255('0x33')]['fields']));_0x4ef15f[_0xd255('0x37')]=_0x4ef15f[_0xd255('0x37')]['length']?_0x4ef15f[_0xd255('0x37')]:_0x5cc1c4[_0xd255('0x31')];if(_0x450333[_0xd255('0x33')][_0xd255('0x44')]){_0x4ef15f[_0xd255('0x4b')]=[{'all':!![]}];}_0x4ef15f=_[_0xd255('0x3f')]({},_0x4ef15f,_0x450333[_0xd255('0x43')]);return db[_0xd255('0x2e')][_0xd255('0x4c')](_0x4ef15f)[_0xd255('0x27')](handleEntityNotFound(_0x2591dd,null))[_0xd255('0x27')](respondWithResult(_0x2591dd,null))[_0xd255('0x46')](handleError(_0x2591dd,null));};exports[_0xd255('0x4d')]=function(_0x21406c,_0x589a09){if(_0x21406c[_0xd255('0x4e')]['id']){delete _0x21406c[_0xd255('0x4e')]['id'];}return db[_0xd255('0x2e')]['find']({'where':{'id':_0x21406c[_0xd255('0x48')]['id']}})[_0xd255('0x27')](handleEntityNotFound(_0x589a09,null))[_0xd255('0x27')](saveUpdates(_0x21406c[_0xd255('0x4e')],null))[_0xd255('0x27')](respondWithResult(_0x589a09,null))[_0xd255('0x46')](handleError(_0x589a09,null));};exports[_0xd255('0x28')]=function(_0x85148a,_0x31551a){return db[_0xd255('0x2e')][_0xd255('0x4c')]({'where':{'id':_0x85148a[_0xd255('0x48')]['id']}})[_0xd255('0x27')](handleEntityNotFound(_0x31551a,null))[_0xd255('0x27')](removeEntity(_0x31551a,null))['catch'](handleError(_0x31551a,null));};exports[_0xd255('0x4f')]=function(_0x3c429f,_0x8c1473){var _0x2af928;return db['sequelize'][_0xd255('0x50')](function(_0x54689c){return db[_0xd255('0x2e')][_0xd255('0x4f')](_0x3c429f['body'],{'transaction':_0x54689c})[_0xd255('0x27')](function(_0x116f35){_0x2af928=_0x116f35;var _0x542c62={'type':db[_0xd255('0x51')][_0xd255('0x52')],'transaction':_0x54689c};switch(_0x3c429f['body'][_0xd255('0x40')]){case _0xd255('0x53'):_0x542c62[_0xd255('0x40')]=db[_0xd255('0x51')][_0xd255('0x52')];break;case'number':_0x542c62[_0xd255('0x40')]=db['Sequelize']['INTEGER'];break;case _0xd255('0x54'):_0x542c62[_0xd255('0x40')]=db[_0xd255('0x51')][_0xd255('0x55')];_0x542c62[_0xd255('0x56')]=![];break;default:}return db[_0xd255('0x57')][_0xd255('0x58')][_0xd255('0x59')](_0xd255('0x5a'),util[_0xd255('0x5b')]('cf_%d',_0x2af928['id']),_0x542c62);})['then'](function(){return _0x2af928;});})[_0xd255('0x27')](respondWithResult(_0x8c1473,0xc9))['catch'](handleError(_0x8c1473,null));}; \ No newline at end of file +var _0x3808=['addColumn','format','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','update','then','destroy','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','keys','include','body','find','params','sequelize','create','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN'];(function(_0x1e5d84,_0x4de4b7){var _0x2b602f=function(_0x2d06ee){while(--_0x2d06ee){_0x1e5d84['push'](_0x1e5d84['shift']());}};_0x2b602f(++_0x4de4b7);}(_0x3808,0x1a2));var _0x8380=function(_0x9090bb,_0x120d1f){_0x9090bb=_0x9090bb-0x0;var _0x229b07=_0x3808[_0x9090bb];return _0x229b07;};'use strict';var emlformat=require(_0x8380('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8380('0x1'));var jsonpatch=require(_0x8380('0x2'));var rp=require('request-promise');var moment=require(_0x8380('0x3'));var BPromise=require(_0x8380('0x4'));var Mustache=require(_0x8380('0x5'));var util=require(_0x8380('0x6'));var path=require(_0x8380('0x7'));var sox=require(_0x8380('0x8'));var csv=require(_0x8380('0x9'));var ejs=require(_0x8380('0xa'));var fs=require('fs');var fs_extra=require(_0x8380('0xb'));var _=require('lodash');var squel=require(_0x8380('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8380('0xd'));var toCsv=require(_0x8380('0x9'));var querystring=require(_0x8380('0xe'));var Papa=require(_0x8380('0xf'));var Redis=require(_0x8380('0x10'));var authService=require(_0x8380('0x11'));var qs=require(_0x8380('0x12'));var as=require(_0x8380('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8380('0x14'))('api');var utils=require(_0x8380('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8380('0x16'));var db=require(_0x8380('0x17'))['db'];function respondWithStatusCode(_0x371412,_0xcc5711){_0xcc5711=_0xcc5711||0xcc;return function(_0x4c7d38){if(_0x4c7d38){return _0x371412[_0x8380('0x18')](_0xcc5711);}return _0x371412['status'](_0xcc5711)[_0x8380('0x19')]();};}function respondWithResult(_0x5c466b,_0x557c65){_0x557c65=_0x557c65||0xc8;return function(_0x177b62){if(_0x177b62){return _0x5c466b[_0x8380('0x1a')](_0x557c65)[_0x8380('0x1b')](_0x177b62);}};}function respondWithFilteredResult(_0x3ae137,_0x14d150){return function(_0x489d71){if(_0x489d71){var _0x2273f2=typeof _0x14d150[_0x8380('0x1c')]===_0x8380('0x1d')&&typeof _0x14d150['limit']===_0x8380('0x1d');var _0x22ccda=_0x489d71[_0x8380('0x1e')];var _0x562e1f=_0x2273f2?0x0:_0x14d150[_0x8380('0x1c')];var _0x99aca3=_0x2273f2?_0x489d71[_0x8380('0x1e')]:_0x14d150[_0x8380('0x1c')]+_0x14d150[_0x8380('0x1f')];var _0x13709a;if(_0x99aca3>=_0x22ccda){_0x99aca3=_0x22ccda;_0x13709a=0xc8;}else{_0x13709a=0xce;}_0x3ae137[_0x8380('0x1a')](_0x13709a);return _0x3ae137['set']('Content-Range',_0x562e1f+'-'+_0x99aca3+'/'+_0x22ccda)['json'](_0x489d71);}return null;};}function patchUpdates(_0x19f3f0){return function(_0x4537ee){try{jsonpatch['apply'](_0x4537ee,_0x19f3f0,!![]);}catch(_0x39b81a){return BPromise[_0x8380('0x20')](_0x39b81a);}return _0x4537ee[_0x8380('0x21')]();};}function saveUpdates(_0x1ced0c,_0x33eccb){return function(_0x9cf3a1){if(_0x9cf3a1){return _0x9cf3a1[_0x8380('0x22')](_0x1ced0c)[_0x8380('0x23')](function(_0x220e6e){return _0x220e6e;});}return null;};}function removeEntity(_0x3ddff3,_0x1b486f){return function(_0x20475a){if(_0x20475a){return _0x20475a[_0x8380('0x24')]()['then'](function(){_0x3ddff3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a50cb,_0x1a64f2){return function(_0x6861dd){if(!_0x6861dd){_0x4a50cb[_0x8380('0x18')](0x194);}return _0x6861dd;};}function handleError(_0x4294cb,_0x5227b0){_0x5227b0=_0x5227b0||0x1f4;return function(_0xa46b05){logger['error'](_0xa46b05[_0x8380('0x25')]);if(_0xa46b05[_0x8380('0x26')]){delete _0xa46b05[_0x8380('0x26')];}_0x4294cb['status'](_0x5227b0)[_0x8380('0x27')](_0xa46b05);};}exports[_0x8380('0x28')]=function(_0x44022c,_0x42c5b8){var _0x4835b1={},_0x8a0b3c={},_0x313eff={'count':0x0,'rows':[]};var _0x2c1802=_[_0x8380('0x29')](db[_0x8380('0x2a')][_0x8380('0x2b')],function(_0x296129){return{'name':_0x296129[_0x8380('0x2c')],'type':_0x296129[_0x8380('0x2d')][_0x8380('0x2e')]};});_0x8a0b3c[_0x8380('0x2f')]=_[_0x8380('0x30')](_[_0x8380('0x29')](_0x2c1802,_0x8380('0x26')),[_0x8380('0x26')]);_0x8a0b3c[_0x8380('0x31')]=_['keys'](_0x44022c[_0x8380('0x31')]);_0x8a0b3c[_0x8380('0x32')]=_[_0x8380('0x33')](_0x8a0b3c['model'],_0x8a0b3c[_0x8380('0x31')]);_0x4835b1['attributes']=_[_0x8380('0x33')](_0x8a0b3c[_0x8380('0x2f')],qs[_0x8380('0x34')](_0x44022c[_0x8380('0x31')][_0x8380('0x34')]));_0x4835b1['attributes']=_0x4835b1[_0x8380('0x35')][_0x8380('0x36')]?_0x4835b1[_0x8380('0x35')]:_0x8a0b3c['model'];if(!_0x44022c[_0x8380('0x31')]['hasOwnProperty'](_0x8380('0x37'))){_0x4835b1[_0x8380('0x1f')]=qs[_0x8380('0x1f')](_0x44022c[_0x8380('0x31')]['limit']);_0x4835b1[_0x8380('0x1c')]=qs[_0x8380('0x1c')](_0x44022c[_0x8380('0x31')]['offset']);}_0x4835b1[_0x8380('0x38')]=qs['sort'](_0x44022c['query'][_0x8380('0x39')]);_0x4835b1['where']=qs[_0x8380('0x32')](_[_0x8380('0x3a')](_0x44022c[_0x8380('0x31')],_0x8a0b3c[_0x8380('0x32')]),_0x2c1802);if(_0x44022c[_0x8380('0x31')][_0x8380('0x3b')]){_0x4835b1[_0x8380('0x3c')]=_[_0x8380('0x3d')](_0x4835b1['where'],{'$or':_['map'](_0x2c1802,function(_0x41aa1a){if(_0x41aa1a['type']!==_0x8380('0x3e')){var _0x56dba6={};_0x56dba6[_0x41aa1a[_0x8380('0x26')]]={'$like':'%'+_0x44022c['query'][_0x8380('0x3b')]+'%'};return _0x56dba6;}})});}_0x4835b1=_[_0x8380('0x3d')]({},_0x4835b1,_0x44022c['options']);var _0x2ee43a={'where':_0x4835b1[_0x8380('0x3c')]};return db[_0x8380('0x2a')][_0x8380('0x1e')](_0x2ee43a)[_0x8380('0x23')](function(_0x514599){_0x313eff['count']=_0x514599;if(_0x44022c[_0x8380('0x31')][_0x8380('0x3f')]){_0x4835b1['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x4835b1);})['then'](function(_0x2b09d5){_0x313eff[_0x8380('0x40')]=_0x2b09d5;return _0x313eff;})[_0x8380('0x23')](respondWithFilteredResult(_0x42c5b8,_0x4835b1))[_0x8380('0x41')](handleError(_0x42c5b8,null));};exports[_0x8380('0x42')]=function(_0x352058,_0x1288c3){var _0x37a0d1={'raw':!![],'where':{'id':_0x352058['params']['id']}},_0x29d11d={};_0x29d11d[_0x8380('0x2f')]=_['keys'](db[_0x8380('0x2a')][_0x8380('0x2b')]);_0x29d11d[_0x8380('0x31')]=_[_0x8380('0x43')](_0x352058['query']);_0x29d11d['filters']=_['intersection'](_0x29d11d['model'],_0x29d11d[_0x8380('0x31')]);_0x37a0d1[_0x8380('0x35')]=_[_0x8380('0x33')](_0x29d11d['model'],qs[_0x8380('0x34')](_0x352058[_0x8380('0x31')]['fields']));_0x37a0d1[_0x8380('0x35')]=_0x37a0d1['attributes'][_0x8380('0x36')]?_0x37a0d1[_0x8380('0x35')]:_0x29d11d[_0x8380('0x2f')];if(_0x352058[_0x8380('0x31')]['includeAll']){_0x37a0d1[_0x8380('0x44')]=[{'all':!![]}];}_0x37a0d1=_[_0x8380('0x3d')]({},_0x37a0d1,_0x352058['options']);return db[_0x8380('0x2a')]['find'](_0x37a0d1)['then'](handleEntityNotFound(_0x1288c3,null))[_0x8380('0x23')](respondWithResult(_0x1288c3,null))[_0x8380('0x41')](handleError(_0x1288c3,null));};exports[_0x8380('0x22')]=function(_0x2c896d,_0x3d4481){if(_0x2c896d['body']['id']){delete _0x2c896d[_0x8380('0x45')]['id'];}return db[_0x8380('0x2a')][_0x8380('0x46')]({'where':{'id':_0x2c896d[_0x8380('0x47')]['id']}})[_0x8380('0x23')](handleEntityNotFound(_0x3d4481,null))[_0x8380('0x23')](saveUpdates(_0x2c896d['body'],null))[_0x8380('0x23')](respondWithResult(_0x3d4481,null))[_0x8380('0x41')](handleError(_0x3d4481,null));};exports[_0x8380('0x24')]=function(_0x3c83eb,_0x25e88a){return db['CmCustomField'][_0x8380('0x46')]({'where':{'id':_0x3c83eb['params']['id']}})[_0x8380('0x23')](handleEntityNotFound(_0x25e88a,null))['then'](removeEntity(_0x25e88a,null))[_0x8380('0x41')](handleError(_0x25e88a,null));};exports['create']=function(_0x14de2e,_0xe8cfcc){var _0x11555d;return db[_0x8380('0x48')]['transaction'](function(_0x5a0385){return db[_0x8380('0x2a')][_0x8380('0x49')](_0x14de2e[_0x8380('0x45')],{'transaction':_0x5a0385})[_0x8380('0x23')](function(_0x5cde94){_0x11555d=_0x5cde94;var _0x35a8b3={'type':db[_0x8380('0x4a')]['TEXT'],'transaction':_0x5a0385};switch(_0x14de2e[_0x8380('0x45')][_0x8380('0x2d')]){case _0x8380('0x4b'):_0x35a8b3['type']=db[_0x8380('0x4a')][_0x8380('0x4c')];break;case'number':_0x35a8b3[_0x8380('0x2d')]=db['Sequelize'][_0x8380('0x4d')];break;case _0x8380('0x4e'):_0x35a8b3['type']=db[_0x8380('0x4a')][_0x8380('0x4f')];_0x35a8b3['defaultValue']=![];break;default:}return db[_0x8380('0x48')]['queryInterface'][_0x8380('0x50')]('cm_contacts',util[_0x8380('0x51')](_0x8380('0x52'),_0x11555d['id']),_0x35a8b3);})[_0x8380('0x23')](function(){return _0x11555d;});})['then'](respondWithResult(_0xe8cfcc,0xc9))[_0x8380('0x41')](handleError(_0xe8cfcc,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 99503f4..8ea6604 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 _0x6eac=['api','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x1b4dd5,_0x31ceda){var _0x49f462=function(_0xf82e4c){while(--_0xf82e4c){_0x1b4dd5['push'](_0x1b4dd5['shift']());}};_0x49f462(++_0x31ceda);}(_0x6eac,0xa5));var _0xc6ea=function(_0x39e0ad,_0x3c07d2){_0x39e0ad=_0x39e0ad-0x0;var _0x36db24=_0x6eac[_0x39e0ad];return _0x36db24;};'use strict';var _=require(_0xc6ea('0x0'));var util=require(_0xc6ea('0x1'));var logger=require(_0xc6ea('0x2'))(_0xc6ea('0x3'));var moment=require('moment');var BPromise=require(_0xc6ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ea('0x5'));var rimraf=require(_0xc6ea('0x6'));var config=require(_0xc6ea('0x7'));var attributes=require(_0xc6ea('0x8'));module['exports']=function(_0x33cac7,_0x2ef11f){return _0x33cac7[_0xc6ea('0x9')](_0xc6ea('0xa'),attributes,{'tableName':_0xc6ea('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde50=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','cm_custom_fields','util','../../config/logger','api','moment'];(function(_0x2ad32d,_0x3c5689){var _0x52a37e=function(_0x3c9cfa){while(--_0x3c9cfa){_0x2ad32d['push'](_0x2ad32d['shift']());}};_0x52a37e(++_0x3c5689);}(_0xde50,0xcd));var _0x0de5=function(_0x5c9d9e,_0x5ee2bf){_0x5c9d9e=_0x5c9d9e-0x0;var _0x31ddf8=_0xde50[_0x5c9d9e];return _0x31ddf8;};'use strict';var _=require('lodash');var util=require(_0x0de5('0x0'));var logger=require(_0x0de5('0x1'))(_0x0de5('0x2'));var moment=require(_0x0de5('0x3'));var BPromise=require(_0x0de5('0x4'));var rp=require(_0x0de5('0x5'));var fs=require('fs');var path=require(_0x0de5('0x6'));var rimraf=require(_0x0de5('0x7'));var config=require(_0x0de5('0x8'));var attributes=require(_0x0de5('0x9'));module['exports']=function(_0x51dad4,_0xff10ed){return _0x51dad4['define']('CmCustomField',attributes,{'tableName':_0x0de5('0xa'),'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 55565b6..a0aee55 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 _0xdb79=['code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb79,0x1e4));var _0x9db7=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xdb79[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x9db7('0x0'));var util=require(_0x9db7('0x1'));var moment=require(_0x9db7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9db7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9db7('0x4'));var logger=require('../../config/logger')(_0x9db7('0x5'));var config=require(_0x9db7('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43912d,_0x11987f,_0x330ad5){return new BPromise(function(_0x596e0a,_0x2f180c){return client[_0x9db7('0x7')](_0x43912d,_0x330ad5)[_0x9db7('0x8')](function(_0x31d8ab){logger[_0x9db7('0x9')](_0x9db7('0xa'),_0x11987f,'request\x20sent');logger[_0x9db7('0xb')](_0x9db7('0xc'),_0x11987f,_0x9db7('0xd'),JSON[_0x9db7('0xe')](_0x31d8ab));if(_0x31d8ab[_0x9db7('0xf')]){if(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x10')]===0x1f4){logger['error'](_0x9db7('0xa'),_0x11987f,_0x31d8ab[_0x9db7('0xf')]['message']);return _0x2f180c(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);}logger[_0x9db7('0xf')]('CmCustomField,\x20%s,\x20%s',_0x11987f,_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);return _0x596e0a(_0x31d8ab[_0x9db7('0xf')][_0x9db7('0x11')]);}else{logger[_0x9db7('0x9')]('CmCustomField,\x20%s,\x20%s',_0x11987f,_0x9db7('0xd'));_0x596e0a(_0x31d8ab[_0x9db7('0x12')]['message']);}})[_0x9db7('0x13')](function(_0x5b6433){logger[_0x9db7('0xf')](_0x9db7('0xa'),_0x11987f,_0x5b6433);_0x2f180c(_0x5b6433);});});} \ No newline at end of file +var _0x2979=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x338b8d,_0x36a3d4){var _0x4a2ccb=function(_0x531e44){while(--_0x531e44){_0x338b8d['push'](_0x338b8d['shift']());}};_0x4a2ccb(++_0x36a3d4);}(_0x2979,0x88));var _0x9297=function(_0x2199f1,_0x10c734){_0x2199f1=_0x2199f1-0x0;var _0x43436b=_0x2979[_0x2199f1];return _0x43436b;};'use strict';var _=require(_0x9297('0x0'));var util=require(_0x9297('0x1'));var moment=require('moment');var BPromise=require(_0x9297('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9297('0x3'));var db=require(_0x9297('0x4'))['db'];var utils=require(_0x9297('0x5'));var logger=require(_0x9297('0x6'))('rpc');var config=require(_0x9297('0x7'));var jayson=require(_0x9297('0x8'));var client=jayson[_0x9297('0x9')][_0x9297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b5b38,_0x58d4bb,_0x199b25){return new BPromise(function(_0x2722ce,_0x44de96){return client[_0x9297('0xb')](_0x9b5b38,_0x199b25)['then'](function(_0x171b85){logger[_0x9297('0xc')]('CmCustomField,\x20%s,\x20%s',_0x58d4bb,_0x9297('0xd'));logger[_0x9297('0xe')](_0x9297('0xf'),_0x58d4bb,_0x9297('0xd'),JSON[_0x9297('0x10')](_0x171b85));if(_0x171b85[_0x9297('0x11')]){if(_0x171b85[_0x9297('0x11')][_0x9297('0x12')]===0x1f4){logger[_0x9297('0x11')](_0x9297('0x13'),_0x58d4bb,_0x171b85[_0x9297('0x11')]['message']);return _0x44de96(_0x171b85[_0x9297('0x11')]['message']);}logger[_0x9297('0x11')](_0x9297('0x13'),_0x58d4bb,_0x171b85['error']['message']);return _0x2722ce(_0x171b85[_0x9297('0x11')][_0x9297('0x14')]);}else{logger[_0x9297('0xc')]('CmCustomField,\x20%s,\x20%s',_0x58d4bb,'request\x20sent');_0x2722ce(_0x171b85[_0x9297('0x15')][_0x9297('0x14')]);}})[_0x9297('0x16')](function(_0x106733){logger['error']('CmCustomField,\x20%s,\x20%s',_0x58d4bb,_0x106733);_0x44de96(_0x106733);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index cf61bae..6adfac1 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 _0x812d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','post','put','delete','destroy','util','path'];(function(_0x7aee55,_0x37c8d7){var _0x30b28e=function(_0x5cbc42){while(--_0x5cbc42){_0x7aee55['push'](_0x7aee55['shift']());}};_0x30b28e(++_0x37c8d7);}(_0x812d,0x6e));var _0xd812=function(_0x2dc8c1,_0x23bae2){_0x2dc8c1=_0x2dc8c1-0x0;var _0x6ee4a7=_0x812d[_0x2dc8c1];return _0x6ee4a7;};'use strict';var multer=require('multer');var util=require(_0xd812('0x0'));var path=require(_0xd812('0x1'));var timeout=require(_0xd812('0x2'));var express=require(_0xd812('0x3'));var router=express[_0xd812('0x4')]();var fs_extra=require(_0xd812('0x5'));var auth=require(_0xd812('0x6'));var interaction=require(_0xd812('0x7'));var config=require('../../config/environment');var controller=require(_0xd812('0x8'));router[_0xd812('0x9')]('/',auth[_0xd812('0xa')](),controller['index']);router['get'](_0xd812('0xb'),auth[_0xd812('0xa')](),controller['show']);router[_0xd812('0xc')]('/',auth[_0xd812('0xa')](),controller['create']);router[_0xd812('0xd')](_0xd812('0xb'),auth[_0xd812('0xa')](),controller['update']);router[_0xd812('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd812('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe57d=['get','show','create','put','delete','/:id','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','isAuthenticated','index'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0xe57d,0xd7));var _0xde57=function(_0x182648,_0x2a7b01){_0x182648=_0x182648-0x0;var _0x10d106=_0xe57d[_0x182648];return _0x10d106;};'use strict';var multer=require(_0xde57('0x0'));var util=require('util');var path=require(_0xde57('0x1'));var timeout=require(_0xde57('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde57('0x3'));var auth=require(_0xde57('0x4'));var interaction=require(_0xde57('0x5'));var config=require('../../config/environment');var controller=require(_0xde57('0x6'));router['get']('/',auth[_0xde57('0x7')](),controller[_0xde57('0x8')]);router[_0xde57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xde57('0xa')]);router['post']('/',auth[_0xde57('0x7')](),controller[_0xde57('0xb')]);router[_0xde57('0xc')]('/:id',auth[_0xde57('0x7')](),controller['update']);router[_0xde57('0xd')](_0xde57('0xe'),auth[_0xde57('0x7')](),controller[_0xde57('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 16e06c1..2a500ce 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 _0xe607=['UNSIGNED','BOOLEAN','contactListQueue','moment','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x2190d4,_0x5b8c6d){var _0x396e4d=function(_0x22a4d5){while(--_0x22a4d5){_0x2190d4['push'](_0x2190d4['shift']());}};_0x396e4d(++_0x5b8c6d);}(_0xe607,0xf6));var _0x7e60=function(_0x188d29,_0x2ead5e){_0x188d29=_0x188d29-0x0;var _0x32a02d=_0xe607[_0x188d29];return _0x32a02d;};'use strict';var moment=require(_0x7e60('0x0'));var Sequelize=require('sequelize');module[_0x7e60('0x1')]={'phone':{'type':Sequelize[_0x7e60('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7e60('0x3')],'defaultValue':moment()['format'](_0x7e60('0x4'))},'countbusyretry':{'type':Sequelize[_0x7e60('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7e60('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7e60('0x3')]},'priority':{'type':Sequelize[_0x7e60('0x5')](0x2)[_0x7e60('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7e60('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7e60('0x5')],'unique':_0x7e60('0x8')},'ListId':{'type':Sequelize[_0x7e60('0x5')],'unique':_0x7e60('0x8')},'UserId':{'type':Sequelize[_0x7e60('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x7e60('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7e60('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7e60('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7e60('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7e60('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7e60('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7e60('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x61ae=['contactListQueue','DATE','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x4bb0de,_0x33057c){var _0xd8649=function(_0x493365){while(--_0x493365){_0x4bb0de['push'](_0x4bb0de['shift']());}};_0xd8649(++_0x33057c);}(_0x61ae,0x7b));var _0xe61a=function(_0x27fa65,_0x4e02ee){_0x27fa65=_0x27fa65-0x0;var _0x456594=_0x61ae[_0x27fa65];return _0x456594;};'use strict';var moment=require(_0xe61a('0x0'));var Sequelize=require(_0xe61a('0x1'));module[_0xe61a('0x2')]={'phone':{'type':Sequelize[_0xe61a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xe61a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xe61a('0x5')](_0xe61a('0x6'))},'countbusyretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe61a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe61a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xe61a('0x7')](0x2)[_0xe61a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe61a('0x7')],'unique':_0xe61a('0x9')},'ListId':{'type':Sequelize[_0xe61a('0x7')],'unique':_0xe61a('0x9')},'UserId':{'type':Sequelize[_0xe61a('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xe61a('0x7')],'unique':_0xe61a('0x9')},'CampaignId':{'type':Sequelize[_0xe61a('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe61a('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe61a('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe61a('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xe61a('0xa')],'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 62883b5..a11a6b5 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 _0x1af3=['deletedat','format','YYYY-MM-DD\x20HH:mm:ss','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','isEmpty','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList','dialActive','CmCompany','List','Queue','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','concat','$and','$or','$gt','$ne','$eq','$between','$notBetween','$notIn','$like','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','CmHopper','then','includeAll','include','findAll','rows','catch','find','create','params','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','merge','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId'];(function(_0x5d4554,_0x3336ba){var _0x1fd075=function(_0x4b20e6){while(--_0x4b20e6){_0x5d4554['push'](_0x5d4554['shift']());}};_0x1fd075(++_0x3336ba);}(_0x1af3,0x1ca));var _0x31af=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x1af3[_0x1a8f86];return _0x20d876;};'use strict';var moment=require(_0x31af('0x0'));var _=require(_0x31af('0x1'));var qs=require(_0x31af('0x2'));var logger=require(_0x31af('0x3'))(_0x31af('0x4'));var shared=require(_0x31af('0x5'));var db=require(_0x31af('0x6'))['db'];function respondWithResult(_0x1a6ea6,_0x3d64ae){_0x3d64ae=_0x3d64ae||0xc8;return function(_0xc098ee){if(_0xc098ee){return _0x1a6ea6['status'](_0x3d64ae)[_0x31af('0x7')](_0xc098ee);}};}function respondWithFilteredResult(_0x416162,_0x1ac3f6){return function(_0x21ddc5){if(_0x21ddc5){var _0x485717=typeof _0x1ac3f6[_0x31af('0x8')]===_0x31af('0x9')&&typeof _0x1ac3f6[_0x31af('0xa')]==='undefined';var _0x21c951=_0x21ddc5[_0x31af('0xb')];var _0x1cfcf6=_0x485717?0x0:_0x1ac3f6[_0x31af('0x8')];var _0x2888dd=_0x485717?_0x21ddc5[_0x31af('0xb')]:_0x1ac3f6[_0x31af('0x8')]+_0x1ac3f6[_0x31af('0xa')];var _0x570cfd;if(_0x2888dd>=_0x21c951){_0x2888dd=_0x21c951;_0x570cfd=0xc8;}else{_0x570cfd=0xce;}_0x416162[_0x31af('0xc')](_0x570cfd);return _0x416162[_0x31af('0xd')](_0x31af('0xe'),_0x1cfcf6+'-'+_0x2888dd+'/'+_0x21c951)[_0x31af('0x7')](_0x21ddc5);}return null;};}function saveUpdates(_0x144406,_0x481f20){return function(_0x358fb4){if(_0x358fb4){return _0x358fb4[_0x31af('0xf')](_0x144406)['then'](function(_0x4b801f){return _0x4b801f;});}return null;};}function handleEntityNotFound(_0x2a4727,_0x46a494){return function(_0x14c57e){if(!_0x14c57e){_0x2a4727[_0x31af('0x10')](0x194);}return _0x14c57e;};}function handleError(_0xe7e29b,_0x1d35fa){_0x1d35fa=_0x1d35fa||0x1f4;return function(_0x369934){logger[_0x31af('0x11')](_0x369934[_0x31af('0x12')]);if(_0x369934[_0x31af('0x13')]){delete _0x369934[_0x31af('0x13')];}_0xe7e29b['status'](_0x1d35fa)[_0x31af('0x14')](_0x369934);};}exports[_0x31af('0x15')]=function(_0x3a2305,_0x477ada){var _0x3d5942={},_0x30a112={},_0x38e3ab={'count':0x0,'rows':[]};var _0x1684d5=_[_0x31af('0x16')](db['CmHopper'][_0x31af('0x17')],function(_0x230002){return{'name':_0x230002[_0x31af('0x18')],'type':_0x230002[_0x31af('0x19')][_0x31af('0x1a')]};});_0x30a112['model']=_[_0x31af('0x16')](_0x1684d5,_0x31af('0x13'));_0x30a112[_0x31af('0x1b')]=_[_0x31af('0x1c')](_0x3a2305[_0x31af('0x1b')]);_0x30a112[_0x31af('0x1d')]=_[_0x31af('0x1e')](_0x30a112[_0x31af('0x1f')],_0x30a112[_0x31af('0x1b')]);_0x30a112[_0x31af('0x1d')]=_[_0x31af('0x20')](_0x30a112[_0x31af('0x1d')],[_0x31af('0x21'),_0x31af('0x22'),_0x31af('0x23'),'$gte','$lt','$lte',_0x31af('0x24'),_0x31af('0x25'),'$not',_0x31af('0x26'),_0x31af('0x27'),'$in',_0x31af('0x28'),_0x31af('0x29'),'$notLike',_0x31af('0x2a'),_0x31af('0x2b'),_0x31af('0x29'),_0x31af('0x2c'),_0x31af('0x2d'),'$contained',_0x31af('0x2e')]);_0x3d5942[_0x31af('0x2f')]=_[_0x31af('0x1e')](_0x30a112[_0x31af('0x1f')],qs[_0x31af('0x30')](_0x3a2305[_0x31af('0x1b')][_0x31af('0x30')]));_0x3d5942[_0x31af('0x2f')]=_0x3d5942[_0x31af('0x2f')][_0x31af('0x31')]?_0x3d5942[_0x31af('0x2f')]:_0x30a112[_0x31af('0x1f')];if(!_0x3a2305['query'][_0x31af('0x32')](_0x31af('0x33'))){_0x3d5942['limit']=qs['limit'](_0x3a2305['query'][_0x31af('0xa')]);_0x3d5942['offset']=qs[_0x31af('0x8')](_0x3a2305[_0x31af('0x1b')][_0x31af('0x8')]);}_0x3d5942[_0x31af('0x34')]=qs[_0x31af('0x35')](_0x3a2305[_0x31af('0x1b')]['sort']);_0x3d5942[_0x31af('0x36')]=qs[_0x31af('0x1d')](_[_0x31af('0x37')](_0x3a2305[_0x31af('0x1b')],_0x30a112[_0x31af('0x1d')]),_0x1684d5);if(_0x3a2305[_0x31af('0x1b')][_0x31af('0x38')]){_0x3d5942[_0x31af('0x36')]=_['merge'](_0x3d5942[_0x31af('0x36')],{'$or':_['map'](_0x1684d5,function(_0x442b20){if(_0x442b20[_0x31af('0x19')]!==_0x31af('0x39')){var _0x1e3755={};_0x1e3755[_0x442b20[_0x31af('0x13')]]={'$like':'%'+_0x3a2305['query']['filter']+'%'};return _0x1e3755;}})});}_0x3d5942=_['merge']({},_0x3d5942,_0x3a2305[_0x31af('0x3a')]);var _0x1ce300={'where':_0x3d5942[_0x31af('0x36')]};return db[_0x31af('0x3b')][_0x31af('0xb')](_0x1ce300)[_0x31af('0x3c')](function(_0x3c52ce){_0x38e3ab[_0x31af('0xb')]=_0x3c52ce;if(_0x3a2305['query'][_0x31af('0x3d')]){_0x3d5942[_0x31af('0x3e')]=[{'all':!![]}];}return db[_0x31af('0x3b')][_0x31af('0x3f')](_0x3d5942);})[_0x31af('0x3c')](function(_0x42d916){_0x38e3ab[_0x31af('0x40')]=_0x42d916;return _0x38e3ab;})[_0x31af('0x3c')](respondWithFilteredResult(_0x477ada,_0x3d5942))[_0x31af('0x41')](handleError(_0x477ada,null));};exports['show']=function(_0x268ae5,_0x596ee5){var _0x447a01={'raw':!![],'where':{'id':_0x268ae5['params']['id']}},_0x5405e3={};_0x5405e3[_0x31af('0x1f')]=_[_0x31af('0x1c')](db[_0x31af('0x3b')][_0x31af('0x17')]);_0x5405e3[_0x31af('0x1b')]=_[_0x31af('0x1c')](_0x268ae5[_0x31af('0x1b')]);_0x5405e3['filters']=_[_0x31af('0x1e')](_0x5405e3[_0x31af('0x1f')],_0x5405e3[_0x31af('0x1b')]);_0x447a01['attributes']=_[_0x31af('0x1e')](_0x5405e3[_0x31af('0x1f')],qs[_0x31af('0x30')](_0x268ae5[_0x31af('0x1b')][_0x31af('0x30')]));_0x447a01['attributes']=_0x447a01[_0x31af('0x2f')][_0x31af('0x31')]?_0x447a01[_0x31af('0x2f')]:_0x5405e3[_0x31af('0x1f')];if(_0x268ae5['query'][_0x31af('0x3d')]){_0x447a01[_0x31af('0x3e')]=[{'all':!![]}];}_0x447a01=_['merge']({},_0x447a01,_0x268ae5[_0x31af('0x3a')]);return db[_0x31af('0x3b')][_0x31af('0x42')](_0x447a01)[_0x31af('0x3c')](handleEntityNotFound(_0x596ee5,null))[_0x31af('0x3c')](respondWithResult(_0x596ee5,null))[_0x31af('0x41')](handleError(_0x596ee5,null));};exports[_0x31af('0x43')]=function(_0x3a349f,_0x2f6e07){return db[_0x31af('0x3b')]['create'](_0x3a349f['body'],{})[_0x31af('0x3c')](respondWithResult(_0x2f6e07,0xc9))['catch'](handleError(_0x2f6e07,null));};exports[_0x31af('0xf')]=function(_0x406fe5,_0x1f858a){if(_0x406fe5['body']['id']){delete _0x406fe5['body']['id'];}return db[_0x31af('0x3b')]['find']({'where':{'id':_0x406fe5[_0x31af('0x44')]['id']}})[_0x31af('0x3c')](handleEntityNotFound(_0x1f858a,null))[_0x31af('0x3c')](saveUpdates(_0x406fe5[_0x31af('0x45')],null))['then'](respondWithResult(_0x1f858a,null))['catch'](handleError(_0x1f858a,null));};exports[_0x31af('0x46')]=function(_0x3acff1,_0x44096b){return db[_0x31af('0x3b')]['describe']()[_0x31af('0x3c')](respondWithResult(_0x44096b,null))[_0x31af('0x41')](handleError(_0x44096b,null));};exports[_0x31af('0x47')]=function(_0x4ad7a6,_0x5a1cbe){var _0x3aaac8;var _0xdccf27=_0x4ad7a6[_0x31af('0x44')]['id'];return db[_0x31af('0x3b')][_0x31af('0x42')]({'where':{'id':_0x4ad7a6[_0x31af('0x44')]['id']}})[_0x31af('0x3c')](handleEntityNotFound(_0x5a1cbe,null))[_0x31af('0x3c')](function(_0x1ac4ae){if(_0x1ac4ae){return _0x1ac4ae[_0x31af('0x47')]()['then'](function(_0x441362){return _0x441362;});}})[_0x31af('0x3c')](function(_0x5b7f9d){_0x3aaac8=_0x5b7f9d;if(_0x5b7f9d){if(_0x5b7f9d[_0x31af('0x48')]||_0x5b7f9d[_0x31af('0x49')]){return db[_0x5b7f9d[_0x31af('0x48')]?_0x31af('0x4a'):_0x31af('0x4b')][_0x31af('0x42')]({'where':{'id':_0x5b7f9d[_0x31af('0x48')]?_0x5b7f9d[_0x31af('0x48')]:_0x5b7f9d[_0x31af('0x49')]},'attributes':['id',_0x31af('0x13')],'raw':!![]});}}})[_0x31af('0x3c')](function(_0x5a4699){var _0x46a75a={};if(_0x5a4699){_[_0x31af('0x4c')](_0x46a75a,_[_0x31af('0x4d')](_0x3aaac8['dataValues'],[_0x31af('0x4e'),_0x31af('0x4f'),'id']));_0x46a75a[_0x31af('0x50')]=0x15;_0x46a75a['statedesc']=_0x31af('0x51');_0x46a75a[_0x31af('0x52')]=_0x5a4699[_0x31af('0x13')];_0x46a75a[_0x31af('0x53')]=_0x4ad7a6[_0x31af('0x54')][_0x31af('0x13')];_0x46a75a[_0x31af('0x55')]=_0x4ad7a6['user']['id'];_0x46a75a[_0x31af('0x51')]=!![];_0x46a75a[_0x31af('0x56')]=moment()[_0x31af('0x57')](_0x31af('0x58'));_0x46a75a['calleridnum']=_0x3aaac8['phone'];_0x46a75a['campaigntype']=_0x3aaac8['VoiceQueueId']?_0x31af('0x59'):_0x31af('0x5a');return db[_0x31af('0x5b')][_0x31af('0x42')]({'where':{'id':_0x46a75a[_0x31af('0x5c')]},'attributes':[_0x31af('0x5d'),'lastName']})[_0x31af('0x3c')](function(_0x4fc84d){if(!_[_0x31af('0x5e')](_0x5a1cbe)&&!_[_0x31af('0x5e')](_0x4fc84d['firstName'])){_0x46a75a[_0x31af('0x5f')]=_0x4fc84d[_0x31af('0x5d')];if(!_['isNil'](_0x4fc84d[_0x31af('0x60')])){_0x46a75a[_0x31af('0x5f')]+='\x20'+_0x4fc84d[_0x31af('0x60')];}}})[_0x31af('0x61')](function(){return db['CmHopperFinal']['create'](_0x46a75a);});}})[_0x31af('0x3c')](function(_0x9e3d74){return db['CmHopperAdditionalPhone'][_0x31af('0x47')]({'where':{'CmHopperId':_0xdccf27}});})[_0x31af('0x3c')](function(){return _0x5a1cbe[_0x31af('0xc')](0xcc)[_0x31af('0x62')]();})[_0x31af('0x41')](handleError(_0x5a1cbe,null));};exports[_0x31af('0x63')]=function(_0x5a2367,_0x28f6ee){var _0x45e195=[];return db[_0x31af('0x5b')][_0x31af('0x46')]()[_0x31af('0x3c')](function(_0x46e0f0){_0x45e195=_[_0x31af('0x1c')](_0x46e0f0);return _0x5a2367['user'][_0x31af('0x64')]({'where':{'type':_0x31af('0x65'),'dialActive':!![],'dialMethod':_0x31af('0x66')},'attributes':['id',_0x31af('0x67'),_0x31af('0x68')],'raw':!![]});})[_0x31af('0x3c')](function(_0x4959d3){if(_0x4959d3&&_0x4959d3[_0x31af('0x31')]){return db['sequelize'][_0x31af('0x69')](function(_0x441679){var _0xc8acf0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x31af('0x57')](_0x31af('0x58'))},'VoiceQueueId':{'$in':_[_0x31af('0x16')](_0x4959d3,'id')},'$or':[{'UserId':null},{'UserId':_0x5a2367[_0x31af('0x54')]['id']}]};var _0x4576dd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4959d3)[_0x31af('0x38')]([_0x31af('0x68'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5a2367[_0x31af('0x54')]['id']}]};var _0x3e7693={'$or':[_0xc8acf0,_0x4576dd]};var _0x4afd98=[];if(_0x5a2367[_0x31af('0x45')][_0x31af('0x6a')]&&_0x5a2367['body'][_0x31af('0x6a')]===_0x31af('0x6b')){if(!_['isEmpty'](_0x5a2367[_0x31af('0x45')][_0x31af('0x6c')])){_0x3e7693['id']={'$in':_0x5a2367[_0x31af('0x45')]['hopperIds']};}_0x4afd98=[[_0x31af('0x6d'),_0x31af('0x6e')],[_0x31af('0x6f'),_0x4959d3[0x0][_0x31af('0x67')]===_0x31af('0x6e')?_0x31af('0x70'):'ASC'],db[_0x31af('0x71')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x31af('0x70')]];}else{if(!_[_0x31af('0x72')](_0x5a2367[_0x31af('0x45')]['hopperIds'])){_0x3e7693['id']={'$notIn':_0x5a2367[_0x31af('0x45')][_0x31af('0x6c')]};}_0x4afd98=[[_0x31af('0x6d'),_0x31af('0x70')],[_0x31af('0x6f'),_0x4959d3[0x0][_0x31af('0x67')]],db[_0x31af('0x71')][_0x31af('0x73')](_0x31af('0x74')),['id',_0x31af('0x6e')]];}return db[_0x31af('0x3b')][_0x31af('0x75')]({'attributes':['id',_0x31af('0x76'),'phone',_0x31af('0x77')],'where':_0x3e7693,'order':_0x4afd98,'transaction':_0x441679,'lock':_0x441679[_0x31af('0x78')][_0x31af('0x79')],'include':[{'model':db[_0x31af('0x5b')],'as':_0x31af('0x7a'),'attributes':_0x45e195,'include':[{'model':db['CmCompany'],'as':_0x31af('0x7b'),'attributes':['id',_0x31af('0x13')]}]},{'model':db[_0x31af('0x7c')],'as':'List','attributes':['id',_0x31af('0x13')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x31af('0x7d')]}]})[_0x31af('0x3c')](function(_0x442574){if(_0x442574){return _0x442574[_0x31af('0xf')]({'UserId':_0x5a2367[_0x31af('0x54')]['id']},{'transaction':_0x441679});}});});}})[_0x31af('0x3c')](handleEntityNotFound(_0x28f6ee,null))[_0x31af('0x3c')](respondWithResult(_0x28f6ee,null))[_0x31af('0x41')](handleError(_0x28f6ee,null));};exports['getPreviewRecall']=function(_0x33e8aa,_0x5e954c,_0x20ded5){var _0x443ad5=[];var _0x251e98=_0x33e8aa[_0x31af('0x44')]['id'];var _0x11876b=_0x33e8aa['user']['id'];return db[_0x31af('0x5b')]['describe']()['then'](function(_0x5a59bd){_0x443ad5=_[_0x31af('0x1c')](_0x5a59bd);return db[_0x31af('0x71')][_0x31af('0x69')](function(_0x460482){const _0x34c531={'id':_0x251e98};return db[_0x31af('0x3b')][_0x31af('0x75')]({'attributes':['id','scheduledat',_0x31af('0x77')],'where':_0x34c531,'transaction':_0x460482,'lock':_0x460482[_0x31af('0x78')][_0x31af('0x79')],'include':[{'model':db[_0x31af('0x5b')],'as':_0x31af('0x7a'),'attributes':_0x443ad5,'include':[{'model':db[_0x31af('0x7e')],'as':_0x31af('0x7b'),'attributes':['id',_0x31af('0x13')]}]},{'model':db[_0x31af('0x7c')],'as':_0x31af('0x7f'),'attributes':['id',_0x31af('0x13')]},{'model':db[_0x31af('0x4a')],'as':_0x31af('0x80'),'attributes':['id',_0x31af('0x13'),'dialActive']}]})[_0x31af('0x3c')](function(_0x5e81ec){if(_0x5e81ec){return _0x5e81ec[_0x31af('0xf')]({'UserId':_0x11876b},{'transaction':_0x460482});}});});})['then'](handleEntityNotFound(_0x5e954c,null))[_0x31af('0x3c')](respondWithResult(_0x5e954c,null))['catch'](handleError(_0x5e954c,null));};exports['getOpenContacts']=function(_0x17f957,_0x288c5b){return _0x17f957[_0x31af('0x54')][_0x31af('0x64')]({'where':{'type':_0x31af('0x65'),'dialActive':!![],'dialMethod':_0x31af('0x66')},'attributes':['id'],'raw':!![]})[_0x31af('0x3c')](function(_0x17a278){if(_0x17a278&&_0x17a278['length']){return db['CmHopper'][_0x31af('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x31af('0x57')](_0x31af('0x58'))},'VoiceQueueId':{'$in':_[_0x31af('0x16')](_0x17a278,'id')},'$or':[{'UserId':null},{'UserId':_0x17f957[_0x31af('0x54')]['id']}]}});}return 0x0;})[_0x31af('0x3c')](function(_0x163a9b){if(!_['isNil'](_0x163a9b)&&_[_0x31af('0x81')](_0x163a9b)){return _0x288c5b[_0x31af('0xc')](0xc8)[_0x31af('0x7')]({'contacts':_0x163a9b});}else{logger['error'](_0x31af('0x82'),_0x31af('0x83'),0x194,'entity\x20not\x20found');_0x288c5b[_0x31af('0x10')](0x194);}})[_0x31af('0x41')](handleError(_0x288c5b,null));};exports[_0x31af('0x84')]=function(_0x5cb6ea,_0x58db8e){var _0x68efb7=shared[_0x31af('0x85')];var _0x47f729=[];_[_0x31af('0x16')](_0x68efb7,function(_0x18035d){_0x47f729['push']({'id':_0x18035d[_0x31af('0x13')],'name':_0x18035d['name'],'utcOffset':_0x18035d[_0x31af('0x86')]});});return _0x58db8e['status'](0xc8)[_0x31af('0x7')]({'tz':_0x47f729});};exports[_0x31af('0x87')]=function(_0x3bf3d8,_0x3dc355){var _0x5bcd7b=shared['timezones'];var _0x1bf6d1={};if(!_[_0x31af('0x5e')](_0x5bcd7b[_0x3bf3d8[_0x31af('0x45')]['id']]))_0x1bf6d1=_0x5bcd7b[_0x3bf3d8['body']['id']];return _0x3dc355[_0x31af('0xc')](0xc8)['json'](_0x1bf6d1);}; \ No newline at end of file +var _0x8819=['dialActive','getPreviewRecall','transaction','findOne','CmCompany','List','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','getTimezone','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','limit','count','offset','set','sendStatus','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','$and','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find','body','update','describe','destroy','params','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','create','CmHopperAdditionalPhone','getPreview','CmContact','getVoiceQueues','preview','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList'];(function(_0x21bad5,_0x23a39d){var _0x235106=function(_0x281b1f){while(--_0x281b1f){_0x21bad5['push'](_0x21bad5['shift']());}};_0x235106(++_0x23a39d);}(_0x8819,0x94));var _0x9881=function(_0x1f6dab,_0x409f44){_0x1f6dab=_0x1f6dab-0x0;var _0x26ba8c=_0x8819[_0x1f6dab];return _0x26ba8c;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x9881('0x0'));var logger=require(_0x9881('0x1'))(_0x9881('0x2'));var shared=require(_0x9881('0x3'));var db=require(_0x9881('0x4'))['db'];function respondWithResult(_0x5e52c5,_0x333d6f){_0x333d6f=_0x333d6f||0xc8;return function(_0x446deb){if(_0x446deb){return _0x5e52c5[_0x9881('0x5')](_0x333d6f)[_0x9881('0x6')](_0x446deb);}};}function respondWithFilteredResult(_0x1791fd,_0x2a3664){return function(_0x5f1d45){if(_0x5f1d45){var _0x353966=typeof _0x2a3664['offset']==='undefined'&&typeof _0x2a3664[_0x9881('0x7')]==='undefined';var _0x5c2c0f=_0x5f1d45[_0x9881('0x8')];var _0x4adf62=_0x353966?0x0:_0x2a3664[_0x9881('0x9')];var _0x39122e=_0x353966?_0x5f1d45[_0x9881('0x8')]:_0x2a3664['offset']+_0x2a3664[_0x9881('0x7')];var _0x1327e8;if(_0x39122e>=_0x5c2c0f){_0x39122e=_0x5c2c0f;_0x1327e8=0xc8;}else{_0x1327e8=0xce;}_0x1791fd[_0x9881('0x5')](_0x1327e8);return _0x1791fd[_0x9881('0xa')]('Content-Range',_0x4adf62+'-'+_0x39122e+'/'+_0x5c2c0f)[_0x9881('0x6')](_0x5f1d45);}return null;};}function saveUpdates(_0x26ee3f,_0x5c6d2d){return function(_0x42850e){if(_0x42850e){return _0x42850e['update'](_0x26ee3f)['then'](function(_0x48cfe1){return _0x48cfe1;});}return null;};}function handleEntityNotFound(_0x58f526,_0x12794f){return function(_0x3178d7){if(!_0x3178d7){_0x58f526[_0x9881('0xb')](0x194);}return _0x3178d7;};}function handleError(_0x1947e8,_0x39d127){_0x39d127=_0x39d127||0x1f4;return function(_0x1d57ea){logger['error'](_0x1d57ea[_0x9881('0xc')]);if(_0x1d57ea[_0x9881('0xd')]){delete _0x1d57ea[_0x9881('0xd')];}_0x1947e8['status'](_0x39d127)['send'](_0x1d57ea);};}exports['index']=function(_0x280ea2,_0x4c3493){var _0x620a9a={},_0x5a9848={},_0x59ff56={'count':0x0,'rows':[]};var _0x1f6e20=_[_0x9881('0xe')](db[_0x9881('0xf')][_0x9881('0x10')],function(_0x43f8a2){return{'name':_0x43f8a2[_0x9881('0x11')],'type':_0x43f8a2[_0x9881('0x12')][_0x9881('0x13')]};});_0x5a9848[_0x9881('0x14')]=_[_0x9881('0xe')](_0x1f6e20,_0x9881('0xd'));_0x5a9848[_0x9881('0x15')]=_[_0x9881('0x16')](_0x280ea2[_0x9881('0x15')]);_0x5a9848[_0x9881('0x17')]=_['intersection'](_0x5a9848['model'],_0x5a9848[_0x9881('0x15')]);_0x5a9848['filters']=_['concat'](_0x5a9848[_0x9881('0x17')],[_0x9881('0x18'),'$or','$gt',_0x9881('0x19'),'$lt',_0x9881('0x1a'),_0x9881('0x1b'),_0x9881('0x1c'),_0x9881('0x1d'),_0x9881('0x1e'),_0x9881('0x1f'),_0x9881('0x20'),_0x9881('0x21'),_0x9881('0x22'),_0x9881('0x23'),_0x9881('0x24'),_0x9881('0x25'),_0x9881('0x22'),'$overlap',_0x9881('0x26'),_0x9881('0x27'),'$any']);_0x620a9a[_0x9881('0x28')]=_[_0x9881('0x29')](_0x5a9848['model'],qs[_0x9881('0x2a')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2a')]));_0x620a9a[_0x9881('0x28')]=_0x620a9a[_0x9881('0x28')][_0x9881('0x2b')]?_0x620a9a[_0x9881('0x28')]:_0x5a9848[_0x9881('0x14')];if(!_0x280ea2['query'][_0x9881('0x2c')](_0x9881('0x2d'))){_0x620a9a[_0x9881('0x7')]=qs[_0x9881('0x7')](_0x280ea2[_0x9881('0x15')][_0x9881('0x7')]);_0x620a9a['offset']=qs[_0x9881('0x9')](_0x280ea2[_0x9881('0x15')]['offset']);}_0x620a9a[_0x9881('0x2e')]=qs[_0x9881('0x2f')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2f')]);_0x620a9a[_0x9881('0x30')]=qs['filters'](_[_0x9881('0x31')](_0x280ea2[_0x9881('0x15')],_0x5a9848[_0x9881('0x17')]),_0x1f6e20);if(_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]){_0x620a9a[_0x9881('0x30')]=_[_0x9881('0x33')](_0x620a9a[_0x9881('0x30')],{'$or':_[_0x9881('0xe')](_0x1f6e20,function(_0x26c829){if(_0x26c829[_0x9881('0x12')]!==_0x9881('0x34')){var _0xfff6a5={};_0xfff6a5[_0x26c829[_0x9881('0xd')]]={'$like':'%'+_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]+'%'};return _0xfff6a5;}})});}_0x620a9a=_['merge']({},_0x620a9a,_0x280ea2[_0x9881('0x35')]);var _0x5f14d5={'where':_0x620a9a[_0x9881('0x30')]};return db['CmHopper'][_0x9881('0x8')](_0x5f14d5)[_0x9881('0x36')](function(_0x4c865e){_0x59ff56[_0x9881('0x8')]=_0x4c865e;if(_0x280ea2['query'][_0x9881('0x37')]){_0x620a9a[_0x9881('0x38')]=[{'all':!![]}];}return db[_0x9881('0xf')][_0x9881('0x39')](_0x620a9a);})['then'](function(_0x2b2a0b){_0x59ff56[_0x9881('0x3a')]=_0x2b2a0b;return _0x59ff56;})[_0x9881('0x36')](respondWithFilteredResult(_0x4c3493,_0x620a9a))[_0x9881('0x3b')](handleError(_0x4c3493,null));};exports[_0x9881('0x3c')]=function(_0x201dcd,_0x100139){var _0x4feb70={'raw':!![],'where':{'id':_0x201dcd['params']['id']}},_0x3f25db={};_0x3f25db[_0x9881('0x14')]=_[_0x9881('0x16')](db[_0x9881('0xf')]['rawAttributes']);_0x3f25db[_0x9881('0x15')]=_[_0x9881('0x16')](_0x201dcd[_0x9881('0x15')]);_0x3f25db['filters']=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],_0x3f25db['query']);_0x4feb70[_0x9881('0x28')]=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],qs[_0x9881('0x2a')](_0x201dcd[_0x9881('0x15')][_0x9881('0x2a')]));_0x4feb70[_0x9881('0x28')]=_0x4feb70[_0x9881('0x28')][_0x9881('0x2b')]?_0x4feb70[_0x9881('0x28')]:_0x3f25db['model'];if(_0x201dcd[_0x9881('0x15')][_0x9881('0x37')]){_0x4feb70[_0x9881('0x38')]=[{'all':!![]}];}_0x4feb70=_[_0x9881('0x33')]({},_0x4feb70,_0x201dcd[_0x9881('0x35')]);return db['CmHopper'][_0x9881('0x3d')](_0x4feb70)[_0x9881('0x36')](handleEntityNotFound(_0x100139,null))[_0x9881('0x36')](respondWithResult(_0x100139,null))[_0x9881('0x3b')](handleError(_0x100139,null));};exports['create']=function(_0x28f0c0,_0xc9713c){return db[_0x9881('0xf')]['create'](_0x28f0c0[_0x9881('0x3e')],{})[_0x9881('0x36')](respondWithResult(_0xc9713c,0xc9))[_0x9881('0x3b')](handleError(_0xc9713c,null));};exports[_0x9881('0x3f')]=function(_0x193c45,_0x391777){if(_0x193c45[_0x9881('0x3e')]['id']){delete _0x193c45[_0x9881('0x3e')]['id'];}return db[_0x9881('0xf')][_0x9881('0x3d')]({'where':{'id':_0x193c45['params']['id']}})[_0x9881('0x36')](handleEntityNotFound(_0x391777,null))[_0x9881('0x36')](saveUpdates(_0x193c45[_0x9881('0x3e')],null))['then'](respondWithResult(_0x391777,null))[_0x9881('0x3b')](handleError(_0x391777,null));};exports[_0x9881('0x40')]=function(_0x1e1f0f,_0x573b4f){return db['CmHopper'][_0x9881('0x40')]()[_0x9881('0x36')](respondWithResult(_0x573b4f,null))[_0x9881('0x3b')](handleError(_0x573b4f,null));};exports[_0x9881('0x41')]=function(_0x49c478,_0x514263){var _0x3689d7;var _0x355357=_0x49c478[_0x9881('0x42')]['id'];return db['CmHopper'][_0x9881('0x3d')]({'where':{'id':_0x49c478[_0x9881('0x42')]['id']}})['then'](handleEntityNotFound(_0x514263,null))[_0x9881('0x36')](function(_0x262b8b){if(_0x262b8b){return _0x262b8b[_0x9881('0x41')]()[_0x9881('0x36')](function(_0x21720a){return _0x21720a;});}})[_0x9881('0x36')](function(_0x43f17d){_0x3689d7=_0x43f17d;if(_0x43f17d){if(_0x43f17d['VoiceQueueId']||_0x43f17d[_0x9881('0x43')]){return db[_0x43f17d['VoiceQueueId']?_0x9881('0x44'):_0x9881('0x45')][_0x9881('0x3d')]({'where':{'id':_0x43f17d[_0x9881('0x46')]?_0x43f17d['VoiceQueueId']:_0x43f17d['CampaignId']},'attributes':['id',_0x9881('0xd')],'raw':!![]});}}})[_0x9881('0x36')](function(_0x2fdba2){var _0x49d8b6={};if(_0x2fdba2){_[_0x9881('0x33')](_0x49d8b6,_[_0x9881('0x47')](_0x3689d7[_0x9881('0x48')],[_0x9881('0x49'),_0x9881('0x4a'),'id']));_0x49d8b6[_0x9881('0x4b')]=0x15;_0x49d8b6['statedesc']=_0x9881('0x4c');_0x49d8b6[_0x9881('0x4d')]=_0x2fdba2[_0x9881('0xd')];_0x49d8b6[_0x9881('0x4e')]=_0x49c478[_0x9881('0x4f')]['name'];_0x49d8b6['UserId']=_0x49c478['user']['id'];_0x49d8b6[_0x9881('0x4c')]=!![];_0x49d8b6[_0x9881('0x50')]=moment()[_0x9881('0x51')](_0x9881('0x52'));_0x49d8b6[_0x9881('0x53')]=_0x3689d7[_0x9881('0x54')];_0x49d8b6['campaigntype']=_0x3689d7['VoiceQueueId']?_0x9881('0x55'):_0x9881('0x56');return db['CmContact'][_0x9881('0x3d')]({'where':{'id':_0x49d8b6[_0x9881('0x57')]},'attributes':[_0x9881('0x58'),_0x9881('0x59')]})['then'](function(_0x3efda3){if(!_['isNil'](_0x514263)&&!_[_0x9881('0x5a')](_0x3efda3[_0x9881('0x58')])){_0x49d8b6[_0x9881('0x5b')]=_0x3efda3['firstName'];if(!_['isNil'](_0x3efda3['lastName'])){_0x49d8b6[_0x9881('0x5b')]+='\x20'+_0x3efda3[_0x9881('0x59')];}}})['finally'](function(){return db[_0x9881('0x5c')][_0x9881('0x5d')](_0x49d8b6);});}})[_0x9881('0x36')](function(_0x165274){return db[_0x9881('0x5e')][_0x9881('0x41')]({'where':{'CmHopperId':_0x355357}});})[_0x9881('0x36')](function(){return _0x514263[_0x9881('0x5')](0xcc)['end']();})['catch'](handleError(_0x514263,null));};exports[_0x9881('0x5f')]=function(_0x4012d9,_0xb9d0ac){var _0x12f6eb=[];return db[_0x9881('0x60')][_0x9881('0x40')]()['then'](function(_0x438a14){_0x12f6eb=_[_0x9881('0x16')](_0x438a14);return _0x4012d9[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9881('0x62')},'attributes':['id','dialOrderByScheduledAt',_0x9881('0x63')],'raw':!![]});})[_0x9881('0x36')](function(_0xc1fd9b){if(_0xc1fd9b&&_0xc1fd9b[_0x9881('0x2b')]){return db['sequelize']['transaction'](function(_0x23f6cf){var _0x5d218e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0xc1fd9b,'id')},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4b5491={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xc1fd9b)[_0x9881('0x32')]([_0x9881('0x63'),0x0])['map']('id')[_0x9881('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4d5ea0={'$or':[_0x5d218e,_0x4b5491]};var _0x21503c=[];if(_0x4012d9['body'][_0x9881('0x65')]&&_0x4012d9[_0x9881('0x3e')][_0x9881('0x65')]===_0x9881('0x66')){if(!_[_0x9881('0x67')](_0x4012d9[_0x9881('0x3e')]['hopperIds'])){_0x4d5ea0['id']={'$in':_0x4012d9[_0x9881('0x3e')][_0x9881('0x68')]};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6a')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]===_0x9881('0x6a')?_0x9881('0x6d'):_0x9881('0x6a')],db[_0x9881('0x6e')][_0x9881('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x9881('0x6d')]];}else{if(!_[_0x9881('0x67')](_0x4012d9['body'][_0x9881('0x68')])){_0x4d5ea0['id']={'$notIn':_0x4012d9[_0x9881('0x3e')]['hopperIds']};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6d')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]],db[_0x9881('0x6e')]['literal'](_0x9881('0x70')),['id',_0x9881('0x6a')]];}return db[_0x9881('0xf')]['findOne']({'attributes':['id',_0x9881('0x71'),_0x9881('0x54'),_0x9881('0x72')],'where':_0x4d5ea0,'order':_0x21503c,'transaction':_0x23f6cf,'lock':_0x23f6cf[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db['CmContact'],'as':_0x9881('0x75'),'attributes':_0x12f6eb,'include':[{'model':db['CmCompany'],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':'List','attributes':['id',_0x9881('0xd')]},{'model':db[_0x9881('0x44')],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x4263ac){if(_0x4263ac){return _0x4263ac[_0x9881('0x3f')]({'UserId':_0x4012d9[_0x9881('0x4f')]['id']},{'transaction':_0x23f6cf});}});});}})['then'](handleEntityNotFound(_0xb9d0ac,null))[_0x9881('0x36')](respondWithResult(_0xb9d0ac,null))[_0x9881('0x3b')](handleError(_0xb9d0ac,null));};exports[_0x9881('0x79')]=function(_0x15f887,_0x578ac5,_0x1489cf){var _0x30bd50=[];var _0x5125c1=_0x15f887[_0x9881('0x42')]['id'];var _0x30a343=_0x15f887[_0x9881('0x4f')]['id'];return db['CmContact']['describe']()['then'](function(_0x57c931){_0x30bd50=_[_0x9881('0x16')](_0x57c931);return db[_0x9881('0x6e')][_0x9881('0x7a')](function(_0x237757){const _0x47739f={'id':_0x5125c1};return db[_0x9881('0xf')][_0x9881('0x7b')]({'attributes':['id',_0x9881('0x71'),'recallme'],'where':_0x47739f,'transaction':_0x237757,'lock':_0x237757[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db[_0x9881('0x60')],'as':'Contact','attributes':_0x30bd50,'include':[{'model':db[_0x9881('0x7c')],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':_0x9881('0x7d'),'attributes':['id',_0x9881('0xd')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x54af49){if(_0x54af49){return _0x54af49[_0x9881('0x3f')]({'UserId':_0x30a343},{'transaction':_0x237757});}});});})[_0x9881('0x36')](handleEntityNotFound(_0x578ac5,null))[_0x9881('0x36')](respondWithResult(_0x578ac5,null))['catch'](handleError(_0x578ac5,null));};exports[_0x9881('0x7e')]=function(_0x13dc4d,_0x2f654f){return _0x13dc4d[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':_0x9881('0x7f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x21bc73){if(_0x21bc73&&_0x21bc73[_0x9881('0x2b')]){return db['CmHopper'][_0x9881('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9881('0x51')](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0x21bc73,'id')},'$or':[{'UserId':null},{'UserId':_0x13dc4d['user']['id']}]}});}return 0x0;})[_0x9881('0x36')](function(_0x569561){if(!_[_0x9881('0x5a')](_0x569561)&&_[_0x9881('0x80')](_0x569561)){return _0x2f654f[_0x9881('0x5')](0xc8)['json']({'contacts':_0x569561});}else{logger['error'](_0x9881('0x81'),_0x9881('0x7e'),0x194,_0x9881('0x82'));_0x2f654f['sendStatus'](0x194);}})[_0x9881('0x3b')](handleError(_0x2f654f,null));};exports[_0x9881('0x83')]=function(_0x942159,_0x1c8218){var _0x19937d=shared[_0x9881('0x84')];var _0x5f26da=[];_[_0x9881('0xe')](_0x19937d,function(_0x487668){_0x5f26da['push']({'id':_0x487668[_0x9881('0xd')],'name':_0x487668[_0x9881('0xd')],'utcOffset':_0x487668['utcOffset']});});return _0x1c8218[_0x9881('0x5')](0xc8)['json']({'tz':_0x5f26da});};exports[_0x9881('0x85')]=function(_0x21a524,_0x2d598b){var _0x5e8c3a=shared[_0x9881('0x84')];var _0x49ea3d={};if(!_[_0x9881('0x5a')](_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']]))_0x49ea3d=_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']];return _0x2d598b[_0x9881('0x5')](0xc8)[_0x9881('0x6')](_0x49ea3d);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f8785dd..7eedcde 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 _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0xee6242,_0x53b587){var _0x1a75da=function(_0x1dc2dd){while(--_0x1dc2dd){_0xee6242['push'](_0xee6242['shift']());}};_0x1a75da(++_0x53b587);}(_0x31f0,0xb7));var _0x031f=function(_0x5a3842,_0x5c065e){_0x5a3842=_0x5a3842-0x0;var _0x365c24=_0x31f0[_0x5a3842];return _0x365c24;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x5cba8f,_0x2834bb){var _0x2f218a=function(_0x3a0a56){while(--_0x3a0a56){_0x5cba8f['push'](_0x5cba8f['shift']());}};_0x2f218a(++_0x2834bb);}(_0xfcf0,0x138));var _0x0fcf=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xfcf0[_0xa4928c];return _0x27cc29;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index fb4b7ef..05df2b0 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 _0x050d=['Agent','voicePause','length','UserId','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','push','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','\x20MINUTE','NOW()','User','name','CmList','List','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','where','limit','include','model','attributes','map','then','info','GetCmHopper','debug','stringify','catch','error','message','ShowCmHopper','find','raw','create','body','CreateCmHopper','UpdateCmHopper','update','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','LOCK','UPDATE','Contact','keys'];(function(_0x59a917,_0x11c0bc){var _0x3183a5=function(_0x373396){while(--_0x373396){_0x59a917['push'](_0x59a917['shift']());}};_0x3183a5(++_0x11c0bc);}(_0x050d,0x11a));var _0xd050=function(_0x1f8126,_0x3038a4){_0x1f8126=_0x1f8126-0x0;var _0x25af01=_0x050d[_0x1f8126];return _0x25af01;};'use strict';var _=require(_0xd050('0x0'));var util=require('util');var moment=require(_0xd050('0x1'));var BPromise=require(_0xd050('0x2'));var db=require(_0xd050('0x3'))['db'];var logger=require(_0xd050('0x4'))(_0xd050('0x5'));exports['GetCmHopper']=function(_0x1f88a0){var _0x59b98c=this;return new Promise(function(_0x4b22ee,_0x3df64b){return db[_0xd050('0x6')][_0xd050('0x7')]({'raw':_0x1f88a0[_0xd050('0x8')]?_0x1f88a0[_0xd050('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x1f88a0['options']?_0x1f88a0[_0xd050('0x8')][_0xd050('0x9')]||null:null,'attributes':_0x1f88a0[_0xd050('0x8')]?_0x1f88a0[_0xd050('0x8')]['attributes']||null:null,'limit':_0x1f88a0[_0xd050('0x8')]?_0x1f88a0[_0xd050('0x8')][_0xd050('0xa')]||null:null,'include':_0x1f88a0['options']?_0x1f88a0[_0xd050('0x8')][_0xd050('0xb')]?_['map'](_0x1f88a0[_0xd050('0x8')][_0xd050('0xb')],function(_0xaa4cb5){return{'model':db[_0xaa4cb5[_0xd050('0xc')]],'as':_0xaa4cb5['as'],'attributes':_0xaa4cb5[_0xd050('0xd')],'include':_0xaa4cb5[_0xd050('0xb')]?_['map'](_0xaa4cb5[_0xd050('0xb')],function(_0x930a67){return{'model':db[_0x930a67[_0xd050('0xc')]],'as':_0x930a67['as'],'attributes':_0x930a67['attributes'],'include':_0x930a67[_0xd050('0xb')]?_[_0xd050('0xe')](_0x930a67['include'],function(_0x38accc){return{'model':db[_0x38accc[_0xd050('0xc')]],'as':_0x38accc['as'],'attributes':_0x38accc[_0xd050('0xd')]};}):[]};}):[]};}):[]:[]})[_0xd050('0xf')](function(_0x172173){logger[_0xd050('0x10')](_0xd050('0x11'),_0x1f88a0);logger[_0xd050('0x12')](_0xd050('0x11'),_0x1f88a0,JSON[_0xd050('0x13')](_0x172173));_0x4b22ee(_0x172173);})[_0xd050('0x14')](function(_0x4515a2){logger[_0xd050('0x15')](_0xd050('0x11'),_0x4515a2[_0xd050('0x16')],_0x1f88a0);_0x3df64b(_0x59b98c['error'](0x1f4,_0x4515a2[_0xd050('0x16')]));});});};exports[_0xd050('0x17')]=function(_0x1b41fc){var _0x58bc3a=this;return new Promise(function(_0x449fc3,_0x5e9e5d){return db[_0xd050('0x6')][_0xd050('0x18')]({'raw':_0x1b41fc['options']?_0x1b41fc[_0xd050('0x8')][_0xd050('0x19')]===undefined?!![]:![]:!![],'where':_0x1b41fc[_0xd050('0x8')]?_0x1b41fc[_0xd050('0x8')]['where']||null:null,'attributes':_0x1b41fc[_0xd050('0x8')]?_0x1b41fc['options'][_0xd050('0xd')]||null:null,'include':_0x1b41fc['options']?_0x1b41fc['options'][_0xd050('0xb')]?_['map'](_0x1b41fc[_0xd050('0x8')][_0xd050('0xb')],function(_0x1a2d7a){return{'model':db[_0x1a2d7a[_0xd050('0xc')]],'as':_0x1a2d7a['as'],'attributes':_0x1a2d7a[_0xd050('0xd')],'include':_0x1a2d7a['include']?_[_0xd050('0xe')](_0x1a2d7a[_0xd050('0xb')],function(_0x38ab8d){return{'model':db[_0x38ab8d['model']],'as':_0x38ab8d['as'],'attributes':_0x38ab8d[_0xd050('0xd')],'include':_0x38ab8d['include']?_[_0xd050('0xe')](_0x38ab8d[_0xd050('0xb')],function(_0x29efc7){return{'model':db[_0x29efc7['model']],'as':_0x29efc7['as'],'attributes':_0x29efc7[_0xd050('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe14000){logger[_0xd050('0x10')](_0xd050('0x17'),_0x1b41fc);logger[_0xd050('0x12')](_0xd050('0x17'),_0x1b41fc,JSON[_0xd050('0x13')](_0xe14000));_0x449fc3(_0xe14000);})[_0xd050('0x14')](function(_0xdbded){logger[_0xd050('0x15')](_0xd050('0x17'),_0xdbded[_0xd050('0x16')],_0x1b41fc);_0x5e9e5d(_0x58bc3a[_0xd050('0x15')](0x1f4,_0xdbded[_0xd050('0x16')]));});});};exports['CreateCmHopper']=function(_0x4612c7){var _0x1a6717=this;return new Promise(function(_0x3e2a9d,_0xe0350a){return db[_0xd050('0x6')][_0xd050('0x1a')](_0x4612c7[_0xd050('0x1b')],{'raw':_0x4612c7['options']?_0x4612c7['options'][_0xd050('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x39516e){logger[_0xd050('0x10')](_0xd050('0x1c'),_0x4612c7);logger[_0xd050('0x12')](_0xd050('0x1c'),_0x4612c7,JSON[_0xd050('0x13')](_0x39516e));_0x3e2a9d(_0x39516e);})[_0xd050('0x14')](function(_0xff852c){logger[_0xd050('0x15')](_0xd050('0x1c'),_0xff852c[_0xd050('0x16')],_0x4612c7);_0xe0350a(_0x1a6717[_0xd050('0x15')](0x1f4,_0xff852c['message']));});});};exports[_0xd050('0x1d')]=function(_0x40dad0){var _0xe0ce05=this;return new Promise(function(_0x4cd16c,_0x370d22){return db['CmHopper'][_0xd050('0x1e')](_0x40dad0['body'],{'raw':_0x40dad0['options']?_0x40dad0[_0xd050('0x8')][_0xd050('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40dad0['options']?_0x40dad0['options']['where']||null:null,'attributes':_0x40dad0[_0xd050('0x8')]?_0x40dad0[_0xd050('0x8')][_0xd050('0xd')]||null:null,'limit':_0x40dad0['options']?_0x40dad0['options']['limit']||null:null})['then'](function(_0x29feaf){logger[_0xd050('0x10')](_0xd050('0x1d'),_0x40dad0);logger[_0xd050('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xd050('0x13')](_0x40dad0[_0xd050('0x8')][_0xd050('0x9')]),_0x40dad0[_0xd050('0x1b')][_0xd050('0x1f')]);logger[_0xd050('0x12')]('UpdateCmHopper',_0x40dad0,JSON['stringify'](_0x29feaf));_0x4cd16c(_0x29feaf);})[_0xd050('0x14')](function(_0x4fbf10){logger[_0xd050('0x15')](_0xd050('0x1d'),_0x4fbf10[_0xd050('0x16')],_0x40dad0);_0x370d22(_0xe0ce05[_0xd050('0x15')](0x1f4,_0x4fbf10[_0xd050('0x16')]));});});};exports['DestroyCmHopper']=function(_0x58a4a9){var _0x3cba3c=this;return new Promise(function(_0x24de92,_0x136bc8){return db[_0xd050('0x6')][_0xd050('0x20')]({'where':_0x58a4a9[_0xd050('0x8')]?_0x58a4a9['options'][_0xd050('0x9')]||null:null})[_0xd050('0xf')](function(_0x22cd91){logger[_0xd050('0x10')](_0xd050('0x21'),_0x58a4a9);logger[_0xd050('0x12')]('DestroyCmHopper',_0x58a4a9,JSON[_0xd050('0x13')](_0x22cd91));_0x24de92(_0x22cd91);})[_0xd050('0x14')](function(_0x3c2570){logger['error'](_0xd050('0x21'),_0x3c2570[_0xd050('0x16')],_0x58a4a9);_0x136bc8(_0x3cba3c[_0xd050('0x15')](0x1f4,_0x3c2570[_0xd050('0x16')]));});});};exports[_0xd050('0x22')]=function(_0x5733da){var _0x41e4b0=this;return new Promise(function(_0x9d0241,_0x42fe3e){return db[_0xd050('0x23')][_0xd050('0x24')]()[_0xd050('0xf')](function(_0x5af575){return db['sequelize'][_0xd050('0x25')](function(_0x3e9abb){return db[_0xd050('0x6')][_0xd050('0x7')]({'where':_0x5733da[_0xd050('0x8')]?_0x5733da[_0xd050('0x8')][_0xd050('0x9')]||null:null,'attributes':_0x5733da['options']?_0x5733da['options']['attributes']||null:null,'limit':_0x5733da[_0xd050('0x8')]?_0x5733da[_0xd050('0x8')][_0xd050('0xa')]||null:null,'order':_0x5733da[_0xd050('0x8')]?_0x5733da[_0xd050('0x8')]['order']||null:null,'transaction':_0x3e9abb,'lock':_0x3e9abb[_0xd050('0x26')][_0xd050('0x27')],'include':[{'model':db['CmContact'],'as':_0xd050('0x28'),'attributes':_[_0xd050('0x29')](_0x5af575)},{'model':db['User'],'as':_0xd050('0x2a'),'attributes':['id','name',_0xd050('0x2b')]}]})[_0xd050('0xf')](function(_0xcf93b5){var _0x357cee=[];var _0xa08cea=[];for(var _0x38d35a=0x0;_0x38d35a<_0xcf93b5[_0xd050('0x2c')];_0x38d35a+=0x1){var _0x4eba2b=_0xcf93b5[_0x38d35a][_0xd050('0x2d')];if(_0x4eba2b===null){_0x357cee['push'](_0xcf93b5[_0x38d35a]['update'](_0x5733da['body'],{'transaction':_0x3e9abb}));}else if(!_0xa08cea[_0xd050('0x2e')](_0x4eba2b)){_0xa08cea['push'](_0x4eba2b);_0x357cee['push'](_0xcf93b5[_0x38d35a][_0xd050('0x1e')](_0x5733da[_0xd050('0x1b')],{'transaction':_0x3e9abb}));}}return BPromise[_0xd050('0x2f')](_0x357cee);});})[_0xd050('0xf')](function(_0x5880d1){logger[_0xd050('0x10')](_0xd050('0x22'),_0x5733da);if(_0x5880d1[_0xd050('0x2c')]>0x0){logger[_0xd050('0x10')](_0xd050('0x30'),_0x5880d1[0x0][_0xd050('0x31')]['id'],_0x5880d1[0x0][_0xd050('0x31')][_0xd050('0x32')],_0x5880d1[0x0]['dataValues'][_0xd050('0x1f')]);}logger['debug'](_0xd050('0x22'),_0x5733da,JSON[_0xd050('0x13')](_0x5880d1));_0x9d0241(_0x5880d1);})[_0xd050('0x14')](function(_0x25c623){logger[_0xd050('0x15')](_0xd050('0x22'),_0x25c623['message'],_0x5733da);_0x42fe3e(_0x41e4b0['error'](0x1f4,_0x25c623[_0xd050('0x16')]));});});});};exports['MoveContactManagedDialer']=function(_0x3fe617){var _0x571660=this;return new Promise(function(_0x1744b0,_0x18774f){return db[_0xd050('0x33')][_0xd050('0x25')](function(_0x56bec9){return db['CmHopperFinal']['create'](_0x3fe617['body'],{'raw':_0x3fe617[_0xd050('0x8')]?_0x3fe617['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x56bec9})['then'](function(){logger[_0xd050('0x10')](_0xd050('0x34'),JSON['stringify'](_0x3fe617[_0xd050('0x8')]['where']),_0x3fe617['options']['where']['active']);return db[_0xd050('0x6')][_0xd050('0x20')]({'where':_0x3fe617[_0xd050('0x8')]?_0x3fe617['options'][_0xd050('0x9')]||null:null,'transaction':_0x56bec9});});})[_0xd050('0xf')](function(_0x18dd09){logger[_0xd050('0x10')](_0xd050('0x35'),_0x3fe617);logger[_0xd050('0x12')](_0xd050('0x35'),_0x3fe617,JSON[_0xd050('0x13')](_0x18dd09));_0x1744b0(_0x18dd09);})['catch'](function(_0x48504b){logger[_0xd050('0x15')]('MoveContactManagedDialer',_0x48504b[_0xd050('0x16')],_0x3fe617);_0x18774f(_0x571660[_0xd050('0x15')](0x1f4,_0x48504b['message']));});});};exports['CountReScheduled']=function(_0x40a5a3){var _0x1a2cdc=this;return new Promise(function(_0x2ebd05,_0x158422){return db['CmHopper'][_0xd050('0x7')]({'raw':_0x40a5a3[_0xd050('0x8')]?_0x40a5a3['options'][_0xd050('0x19')]===undefined?!![]:![]:!![],'where':_0x40a5a3['options']?_0x40a5a3[_0xd050('0x8')]['where']||null:null,'attributes':[[db[_0xd050('0x33')]['fn'](_0xd050('0x36'),db[_0xd050('0x33')]['fn']('IF',db['sequelize'][_0xd050('0x37')](_0xd050('0x38')+util[_0xd050('0x39')](_0xd050('0x3a'),moment()['format'](_0xd050('0x3b')))+_0xd050('0x3c')))),_0xd050('0x3d')]]})[_0xd050('0xf')](function(_0x3a092a){logger[_0xd050('0x10')](_0xd050('0x3e'),_0x40a5a3);logger[_0xd050('0x12')](_0xd050('0x3e'),_0x40a5a3,JSON[_0xd050('0x13')](_0x3a092a));_0x2ebd05(_0x3a092a);})[_0xd050('0x14')](function(_0x145070){logger[_0xd050('0x15')](_0xd050('0x3e'),_0x145070[_0xd050('0x16')],_0x40a5a3);_0x158422(_0x1a2cdc[_0xd050('0x15')](0x1f4,_0x145070['message']));});});};exports[_0xd050('0x3f')]=function(_0x4fb768){var _0x49987d=this;return new Promise(function(_0x5ac05f,_0x3dc829){return db[_0xd050('0x23')][_0xd050('0x24')]()[_0xd050('0xf')](function(){return db[_0xd050('0x33')][_0xd050('0x25')](function(_0x2772d7){return db[_0xd050('0x6')][_0xd050('0x7')]({'where':_0x4fb768['options']?_0x4fb768[_0xd050('0x8')][_0xd050('0x9')]||null:null,'attributes':_0x4fb768[_0xd050('0x8')]?_0x4fb768['options'][_0xd050('0xd')]||null:null,'limit':0x1,'order':_0x4fb768[_0xd050('0x8')]?_0x4fb768[_0xd050('0x8')][_0xd050('0x40')]||null:null,'group':db[_0xd050('0x6')]['UserId'],'transaction':_0x2772d7,'lock':_0x2772d7[_0xd050('0x26')][_0xd050('0x27')],'include':_0x4fb768['options']?_0x4fb768[_0xd050('0x8')][_0xd050('0xb')]?_[_0xd050('0xe')](_0x4fb768[_0xd050('0x8')][_0xd050('0xb')],function(_0xdb6ef3){return{'model':db[_0xdb6ef3[_0xd050('0xc')]],'as':_0xdb6ef3['as'],'attributes':_0xdb6ef3[_0xd050('0xd')],'include':_0xdb6ef3[_0xd050('0xb')]?_[_0xd050('0xe')](_0xdb6ef3['include'],function(_0x4fa171){return{'model':db[_0x4fa171[_0xd050('0xc')]],'as':_0x4fa171['as'],'attributes':_0x4fa171[_0xd050('0xd')],'include':_0x4fa171[_0xd050('0xb')]?_[_0xd050('0xe')](_0x4fa171[_0xd050('0xb')],function(_0x997b2c){return{'model':db[_0x997b2c[_0xd050('0xc')]],'as':_0x997b2c['as'],'attributes':_0x997b2c[_0xd050('0xd')]};}):[]};}):[]};}):[]:[]})[_0xd050('0xf')](function(_0x5ed5ae){var _0x478391=[];for(var _0x19af45=0x0;_0x19af45<_0x5ed5ae[_0xd050('0x2c')];_0x19af45+=0x1){_0x478391[_0xd050('0x41')](_0x5ed5ae[_0x19af45][_0xd050('0x1e')](_0x4fb768[_0xd050('0x1b')],{'transaction':_0x2772d7}));}return BPromise[_0xd050('0x2f')](_0x478391);});})[_0xd050('0xf')](function(_0x572f63){logger[_0xd050('0x10')]('GetContactRecallMe',_0x4fb768);logger[_0xd050('0x12')](_0xd050('0x3f'),_0x4fb768,JSON[_0xd050('0x13')](_0x572f63));_0x5ac05f(_0x572f63);})['catch'](function(_0x57dfbb){logger[_0xd050('0x15')](_0xd050('0x3f'),_0x57dfbb[_0xd050('0x16')],_0x4fb768);_0x3dc829(_0x49987d[_0xd050('0x15')](0x1f4,_0x57dfbb[_0xd050('0x16')]));});});});};exports['GetCmHopperPreview']=function(_0x227a22){var _0x3e2abc=this;return new Promise(function(_0xc97f50,_0x837a6f){db[_0xd050('0x23')][_0xd050('0x24')]()[_0xd050('0xf')](function(_0x22c5c0){return db[_0xd050('0x6')]['findAll']({'raw':_0x227a22[_0xd050('0x8')]?_0x227a22[_0xd050('0x8')][_0xd050('0x19')]===undefined?!![]:![]:!![],'where':_0x227a22[_0xd050('0x8')]?_0x227a22[_0xd050('0x8')][_0xd050('0x9')]||null:null,'attributes':_0x227a22[_0xd050('0x8')]?_0x227a22[_0xd050('0x8')]['attributes']||null:null,'limit':_0x227a22[_0xd050('0x8')]?_0x227a22['options'][_0xd050('0xa')]||null:null,'include':_0x227a22[_0xd050('0x8')]?_0x227a22[_0xd050('0x8')][_0xd050('0xb')]?_[_0xd050('0xe')](_0x227a22[_0xd050('0x8')][_0xd050('0xb')],function(_0x1105a0){return{'model':db[_0x1105a0['model']],'as':_0x1105a0['as'],'attributes':_0x1105a0['as']===_0xd050('0x28')?_[_0xd050('0x29')](_0x22c5c0):_0x1105a0[_0xd050('0xd')],'include':_0x1105a0[_0xd050('0xb')]?_[_0xd050('0xe')](_0x1105a0['include'],function(_0x708cbf){return{'model':db[_0x708cbf['model']],'as':_0x708cbf['as'],'attributes':_0x708cbf[_0xd050('0xd')],'include':_0x708cbf[_0xd050('0xb')]?_[_0xd050('0xe')](_0x708cbf[_0xd050('0xb')],function(_0x616e69){return{'model':db[_0x616e69[_0xd050('0xc')]],'as':_0x616e69['as'],'attributes':_0x616e69['attributes']};}):[]};}):[]};}):[]:[]})[_0xd050('0xf')](function(_0x3a74eb){logger[_0xd050('0x10')](_0xd050('0x11'),_0x227a22);logger[_0xd050('0x12')]('GetCmHopper',_0x227a22,JSON['stringify'](_0x3a74eb));_0xc97f50(_0x3a74eb);})['catch'](function(_0x1262ee){logger[_0xd050('0x15')](_0xd050('0x11'),_0x1262ee['message'],_0x227a22);_0x837a6f(_0x3e2abc[_0xd050('0x15')](0x1f4,_0x1262ee['message']));});});});};exports[_0xd050('0x42')]=function(_0x3401d9){var _0x18b616=this;return new Promise(function(_0x42b92f,_0x166dc9){return db[_0xd050('0x23')][_0xd050('0x43')]({'raw':!![],'where':{'phone':_0x3401d9[_0xd050('0x8')][_0xd050('0x9')]['phone']},'attributes':['id',_0xd050('0x44')],'order':[['id',_0xd050('0x45')]]})[_0xd050('0xf')](function(_0x5da7b2){logger[_0xd050('0x10')](_0xd050('0x46'),_0x3401d9);logger['debug'](_0xd050('0x46'),_0x3401d9,JSON[_0xd050('0x13')](_0x5da7b2));_0x42b92f(_0x5da7b2);})[_0xd050('0x14')](function(_0x1cd2ec){logger['error'](_0xd050('0x46'),_0x1cd2ec[_0xd050('0x16')],_0x3401d9);_0x166dc9(_0x18b616[_0xd050('0x15')](0x1f4,_0x1cd2ec['message']));});});};exports[_0xd050('0x47')]=function(_0x509dfc){var _0x15331a=this;return new Promise(function(_0x200d44,_0x5ab670){return db[_0xd050('0x33')][_0xd050('0x25')](function(_0x1d125b){var _0x57012c=_0x509dfc[_0xd050('0x8')]&&_0x509dfc[_0xd050('0x8')][_0xd050('0x9')]?_0x509dfc['options']['where']:{};return db[_0xd050('0x6')][_0xd050('0x1e')](_0x509dfc[_0xd050('0x1b')],{'where':_0x57012c,'transaction':_0x1d125b})[_0xd050('0xf')](function(_0x3c8e03){logger['info'](_0xd050('0x47'),_0x509dfc);logger[_0xd050('0x12')](_0xd050('0x47'),_0x509dfc,JSON[_0xd050('0x13')](_0x3c8e03));_0x200d44(_0x3c8e03);})['catch'](function(_0x5a7464){logger[_0xd050('0x15')](_0xd050('0x47'),_0x5a7464[_0xd050('0x16')],_0x509dfc);_0x5ab670(_0x15331a[_0xd050('0x15')](0x1f4,_0x5a7464['message']));});});});};exports[_0xd050('0x48')]=function(_0x33f5b9){var _0x1b1567=this;var _0x5c24d6=_0x33f5b9[_0xd050('0x1b')][_0xd050('0x9')][_0xd050('0x49')];var _0x5eb3e2=_0x33f5b9['body'][_0xd050('0x9')]['interval'];var _0x5acb6a=_0x33f5b9['body'][_0xd050('0x9')][_0xd050('0x4a')];return new Promise(function(_0x486099,_0x59752f){return db[_0xd050('0x6')][_0xd050('0x7')]({'where':{'voiceQueueId':{'$in':_0x5c24d6},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd050('0x33')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x5eb3e2+_0xd050('0x4b')),'$gt':db[_0xd050('0x33')][_0xd050('0x37')](_0xd050('0x4c'))}},'UserId':{'$in':_0x5acb6a}},'include':[{'model':db[_0xd050('0x23')],'as':_0xd050('0x28')},{'model':db[_0xd050('0x4d')],'as':_0xd050('0x2a'),'attributes':['id',_0xd050('0x4e'),_0xd050('0x2b')]},{'model':db[_0xd050('0x4f')],'as':_0xd050('0x50')}]})[_0xd050('0xf')](function(_0xc8a752){if(_0xc8a752[_0xd050('0x2c')]>0x0){return db[_0xd050('0x33')][_0xd050('0x25')](function(_0x22ae64){return db['CmHopper'][_0xd050('0x1e')]({'recallmeNotifiedDate':db[_0xd050('0x33')][_0xd050('0x37')](_0xd050('0x4c'))},{'where':{'id':{'$in':_['map'](_0xc8a752,'id')}},'transaction':_0x22ae64})[_0xd050('0xf')](function(){_0x486099(_0xc8a752);})[_0xd050('0x14')](function(_0x4a15e){logger[_0xd050('0x15')](_0xd050('0x48'),_0x4a15e[_0xd050('0x16')],_0x33f5b9);_0x59752f(_0x1b1567[_0xd050('0x15')](0x1f4,_0x4a15e[_0xd050('0x16')]));});})['catch'](function(_0x552f33){logger['error'](_0xd050('0x48'),_0x552f33[_0xd050('0x16')],_0x33f5b9);_0x59752f(_0x1b1567['error'](0x1f4,_0x552f33['message']));});}else{_0x486099(_0xc8a752);}});});}; \ No newline at end of file +var _0xbbfd=['include','model','map','info','debug','stringify','catch','message','then','ShowCmHopper','error','create','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','keys','Agent','length','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','util','moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xbbfd,0x86));var _0xdbbf=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbbfd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xdbbf('0x0'));var moment=require(_0xdbbf('0x1'));var BPromise=require(_0xdbbf('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xdbbf('0x3'))('rpc');exports[_0xdbbf('0x4')]=function(_0x3d5295){var _0x45046c=this;return new Promise(function(_0x136c8b,_0x5b460d){return db[_0xdbbf('0x5')][_0xdbbf('0x6')]({'raw':_0x3d5295[_0xdbbf('0x7')]?_0x3d5295[_0xdbbf('0x7')][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'where':_0x3d5295['options']?_0x3d5295[_0xdbbf('0x7')][_0xdbbf('0x9')]||null:null,'attributes':_0x3d5295['options']?_0x3d5295[_0xdbbf('0x7')][_0xdbbf('0xa')]||null:null,'limit':_0x3d5295[_0xdbbf('0x7')]?_0x3d5295[_0xdbbf('0x7')][_0xdbbf('0xb')]||null:null,'include':_0x3d5295[_0xdbbf('0x7')]?_0x3d5295[_0xdbbf('0x7')][_0xdbbf('0xc')]?_['map'](_0x3d5295['options'][_0xdbbf('0xc')],function(_0x42a19b){return{'model':db[_0x42a19b[_0xdbbf('0xd')]],'as':_0x42a19b['as'],'attributes':_0x42a19b['attributes'],'include':_0x42a19b[_0xdbbf('0xc')]?_[_0xdbbf('0xe')](_0x42a19b[_0xdbbf('0xc')],function(_0x1b8368){return{'model':db[_0x1b8368[_0xdbbf('0xd')]],'as':_0x1b8368['as'],'attributes':_0x1b8368[_0xdbbf('0xa')],'include':_0x1b8368['include']?_[_0xdbbf('0xe')](_0x1b8368['include'],function(_0x3421aa){return{'model':db[_0x3421aa['model']],'as':_0x3421aa['as'],'attributes':_0x3421aa[_0xdbbf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fb66b){logger[_0xdbbf('0xf')]('GetCmHopper',_0x3d5295);logger[_0xdbbf('0x10')](_0xdbbf('0x4'),_0x3d5295,JSON[_0xdbbf('0x11')](_0x2fb66b));_0x136c8b(_0x2fb66b);})[_0xdbbf('0x12')](function(_0x1bb79b){logger['error'](_0xdbbf('0x4'),_0x1bb79b[_0xdbbf('0x13')],_0x3d5295);_0x5b460d(_0x45046c['error'](0x1f4,_0x1bb79b[_0xdbbf('0x13')]));});});};exports['ShowCmHopper']=function(_0x39555f){var _0x537cd3=this;return new Promise(function(_0x31c95d,_0x2bbfc9){return db[_0xdbbf('0x5')]['find']({'raw':_0x39555f[_0xdbbf('0x7')]?_0x39555f[_0xdbbf('0x7')][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'where':_0x39555f[_0xdbbf('0x7')]?_0x39555f[_0xdbbf('0x7')][_0xdbbf('0x9')]||null:null,'attributes':_0x39555f[_0xdbbf('0x7')]?_0x39555f['options']['attributes']||null:null,'include':_0x39555f[_0xdbbf('0x7')]?_0x39555f[_0xdbbf('0x7')][_0xdbbf('0xc')]?_['map'](_0x39555f[_0xdbbf('0x7')][_0xdbbf('0xc')],function(_0xc7adcb){return{'model':db[_0xc7adcb[_0xdbbf('0xd')]],'as':_0xc7adcb['as'],'attributes':_0xc7adcb[_0xdbbf('0xa')],'include':_0xc7adcb[_0xdbbf('0xc')]?_['map'](_0xc7adcb['include'],function(_0x49bbe1){return{'model':db[_0x49bbe1[_0xdbbf('0xd')]],'as':_0x49bbe1['as'],'attributes':_0x49bbe1[_0xdbbf('0xa')],'include':_0x49bbe1[_0xdbbf('0xc')]?_[_0xdbbf('0xe')](_0x49bbe1[_0xdbbf('0xc')],function(_0x35ba15){return{'model':db[_0x35ba15[_0xdbbf('0xd')]],'as':_0x35ba15['as'],'attributes':_0x35ba15[_0xdbbf('0xa')]};}):[]};}):[]};}):[]:[]})[_0xdbbf('0x14')](function(_0x1dac6c){logger[_0xdbbf('0xf')](_0xdbbf('0x15'),_0x39555f);logger[_0xdbbf('0x10')](_0xdbbf('0x15'),_0x39555f,JSON[_0xdbbf('0x11')](_0x1dac6c));_0x31c95d(_0x1dac6c);})[_0xdbbf('0x12')](function(_0x5415e0){logger[_0xdbbf('0x16')](_0xdbbf('0x15'),_0x5415e0['message'],_0x39555f);_0x2bbfc9(_0x537cd3['error'](0x1f4,_0x5415e0[_0xdbbf('0x13')]));});});};exports['CreateCmHopper']=function(_0x4a5792){var _0x573f72=this;return new Promise(function(_0xb5116f,_0x5038a5){return db['CmHopper'][_0xdbbf('0x17')](_0x4a5792[_0xdbbf('0x18')],{'raw':_0x4a5792['options']?_0x4a5792['options'][_0xdbbf('0x8')]===undefined?!![]:![]:!![]})[_0xdbbf('0x14')](function(_0x287694){logger['info'](_0xdbbf('0x19'),_0x4a5792);logger[_0xdbbf('0x10')](_0xdbbf('0x19'),_0x4a5792,JSON[_0xdbbf('0x11')](_0x287694));_0xb5116f(_0x287694);})['catch'](function(_0x5ab0c5){logger[_0xdbbf('0x16')](_0xdbbf('0x19'),_0x5ab0c5[_0xdbbf('0x13')],_0x4a5792);_0x5038a5(_0x573f72[_0xdbbf('0x16')](0x1f4,_0x5ab0c5[_0xdbbf('0x13')]));});});};exports[_0xdbbf('0x1a')]=function(_0x2d541d){var _0x55cb71=this;return new Promise(function(_0x1e8059,_0x3a2f2e){return db[_0xdbbf('0x5')]['update'](_0x2d541d[_0xdbbf('0x18')],{'raw':_0x2d541d[_0xdbbf('0x7')]?_0x2d541d[_0xdbbf('0x7')][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d541d[_0xdbbf('0x7')]?_0x2d541d[_0xdbbf('0x7')]['where']||null:null,'attributes':_0x2d541d[_0xdbbf('0x7')]?_0x2d541d[_0xdbbf('0x7')]['attributes']||null:null,'limit':_0x2d541d[_0xdbbf('0x7')]?_0x2d541d['options']['limit']||null:null})[_0xdbbf('0x14')](function(_0x3123f8){logger[_0xdbbf('0xf')](_0xdbbf('0x1a'),_0x2d541d);logger[_0xdbbf('0xf')](_0xdbbf('0x1b'),JSON[_0xdbbf('0x11')](_0x2d541d[_0xdbbf('0x7')][_0xdbbf('0x9')]),_0x2d541d[_0xdbbf('0x18')]['active']);logger[_0xdbbf('0x10')]('UpdateCmHopper',_0x2d541d,JSON['stringify'](_0x3123f8));_0x1e8059(_0x3123f8);})[_0xdbbf('0x12')](function(_0x2894b2){logger[_0xdbbf('0x16')]('UpdateCmHopper',_0x2894b2['message'],_0x2d541d);_0x3a2f2e(_0x55cb71['error'](0x1f4,_0x2894b2[_0xdbbf('0x13')]));});});};exports[_0xdbbf('0x1c')]=function(_0x2afcd3){var _0x270aa0=this;return new Promise(function(_0x5158ee,_0x204446){return db[_0xdbbf('0x5')][_0xdbbf('0x1d')]({'where':_0x2afcd3['options']?_0x2afcd3['options'][_0xdbbf('0x9')]||null:null})[_0xdbbf('0x14')](function(_0x280b37){logger[_0xdbbf('0xf')](_0xdbbf('0x1c'),_0x2afcd3);logger[_0xdbbf('0x10')](_0xdbbf('0x1c'),_0x2afcd3,JSON[_0xdbbf('0x11')](_0x280b37));_0x5158ee(_0x280b37);})[_0xdbbf('0x12')](function(_0x183e73){logger[_0xdbbf('0x16')](_0xdbbf('0x1c'),_0x183e73[_0xdbbf('0x13')],_0x2afcd3);_0x204446(_0x270aa0[_0xdbbf('0x16')](0x1f4,_0x183e73[_0xdbbf('0x13')]));});});};exports[_0xdbbf('0x1e')]=function(_0xbcff38){var _0xa9a7d4=this;return new Promise(function(_0x205993,_0x597fca){return db[_0xdbbf('0x1f')][_0xdbbf('0x20')]()[_0xdbbf('0x14')](function(_0x31e7e8){return db[_0xdbbf('0x21')][_0xdbbf('0x22')](function(_0x43d808){return db[_0xdbbf('0x5')][_0xdbbf('0x6')]({'where':_0xbcff38[_0xdbbf('0x7')]?_0xbcff38['options'][_0xdbbf('0x9')]||null:null,'attributes':_0xbcff38[_0xdbbf('0x7')]?_0xbcff38[_0xdbbf('0x7')][_0xdbbf('0xa')]||null:null,'limit':_0xbcff38[_0xdbbf('0x7')]?_0xbcff38[_0xdbbf('0x7')][_0xdbbf('0xb')]||null:null,'order':_0xbcff38[_0xdbbf('0x7')]?_0xbcff38[_0xdbbf('0x7')]['order']||null:null,'transaction':_0x43d808,'lock':_0x43d808[_0xdbbf('0x23')]['UPDATE'],'include':[{'model':db[_0xdbbf('0x1f')],'as':'Contact','attributes':_[_0xdbbf('0x24')](_0x31e7e8)},{'model':db['User'],'as':_0xdbbf('0x25'),'attributes':['id','name','voicePause']}]})[_0xdbbf('0x14')](function(_0x50388a){var _0x1027e9=[];var _0x15f34f=[];for(var _0x1600ee=0x0;_0x1600ee<_0x50388a[_0xdbbf('0x26')];_0x1600ee+=0x1){var _0x1d45d6=_0x50388a[_0x1600ee]['UserId'];if(_0x1d45d6===null){_0x1027e9[_0xdbbf('0x27')](_0x50388a[_0x1600ee][_0xdbbf('0x28')](_0xbcff38[_0xdbbf('0x18')],{'transaction':_0x43d808}));}else if(!_0x15f34f[_0xdbbf('0x29')](_0x1d45d6)){_0x15f34f[_0xdbbf('0x27')](_0x1d45d6);_0x1027e9['push'](_0x50388a[_0x1600ee]['update'](_0xbcff38[_0xdbbf('0x18')],{'transaction':_0x43d808}));}}return BPromise[_0xdbbf('0x2a')](_0x1027e9);});})['then'](function(_0x3c7099){logger[_0xdbbf('0xf')]('GetContactDialer',_0xbcff38);if(_0x3c7099[_0xdbbf('0x26')]>0x0){logger[_0xdbbf('0xf')](_0xdbbf('0x2b'),_0x3c7099[0x0][_0xdbbf('0x2c')]['id'],_0x3c7099[0x0][_0xdbbf('0x2c')]['ContactId'],_0x3c7099[0x0][_0xdbbf('0x2c')][_0xdbbf('0x2d')]);}logger['debug'](_0xdbbf('0x1e'),_0xbcff38,JSON[_0xdbbf('0x11')](_0x3c7099));_0x205993(_0x3c7099);})[_0xdbbf('0x12')](function(_0x19e4bb){logger[_0xdbbf('0x16')](_0xdbbf('0x1e'),_0x19e4bb['message'],_0xbcff38);_0x597fca(_0xa9a7d4[_0xdbbf('0x16')](0x1f4,_0x19e4bb[_0xdbbf('0x13')]));});});});};exports[_0xdbbf('0x2e')]=function(_0x266cce){var _0x3a2bf=this;return new Promise(function(_0x49cbd2,_0x4fe7c0){return db[_0xdbbf('0x21')]['transaction'](function(_0x271be7){return db[_0xdbbf('0x2f')][_0xdbbf('0x17')](_0x266cce[_0xdbbf('0x18')],{'raw':_0x266cce['options']?_0x266cce[_0xdbbf('0x7')][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'transaction':_0x271be7})[_0xdbbf('0x14')](function(){logger[_0xdbbf('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xdbbf('0x11')](_0x266cce[_0xdbbf('0x7')][_0xdbbf('0x9')]),_0x266cce[_0xdbbf('0x7')][_0xdbbf('0x9')]['active']);return db[_0xdbbf('0x5')][_0xdbbf('0x1d')]({'where':_0x266cce[_0xdbbf('0x7')]?_0x266cce[_0xdbbf('0x7')][_0xdbbf('0x9')]||null:null,'transaction':_0x271be7});});})[_0xdbbf('0x14')](function(_0x4b4367){logger['info'](_0xdbbf('0x2e'),_0x266cce);logger[_0xdbbf('0x10')](_0xdbbf('0x2e'),_0x266cce,JSON['stringify'](_0x4b4367));_0x49cbd2(_0x4b4367);})[_0xdbbf('0x12')](function(_0xecba6){logger[_0xdbbf('0x16')]('MoveContactManagedDialer',_0xecba6[_0xdbbf('0x13')],_0x266cce);_0x4fe7c0(_0x3a2bf[_0xdbbf('0x16')](0x1f4,_0xecba6[_0xdbbf('0x13')]));});});};exports[_0xdbbf('0x30')]=function(_0x26021a){var _0x36c036=this;return new Promise(function(_0x503e25,_0x594cd8){return db[_0xdbbf('0x5')]['findAll']({'raw':_0x26021a[_0xdbbf('0x7')]?_0x26021a['options'][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'where':_0x26021a[_0xdbbf('0x7')]?_0x26021a['options'][_0xdbbf('0x9')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xdbbf('0x21')]['fn']('IF',db[_0xdbbf('0x21')][_0xdbbf('0x31')](_0xdbbf('0x32')+util[_0xdbbf('0x33')]('\x22%s\x22',moment()[_0xdbbf('0x33')](_0xdbbf('0x34')))+_0xdbbf('0x35')))),'contactsRescheduled']]})[_0xdbbf('0x14')](function(_0x481d40){logger[_0xdbbf('0xf')](_0xdbbf('0x30'),_0x26021a);logger[_0xdbbf('0x10')]('CountReScheduled',_0x26021a,JSON['stringify'](_0x481d40));_0x503e25(_0x481d40);})[_0xdbbf('0x12')](function(_0x329173){logger[_0xdbbf('0x16')](_0xdbbf('0x30'),_0x329173[_0xdbbf('0x13')],_0x26021a);_0x594cd8(_0x36c036[_0xdbbf('0x16')](0x1f4,_0x329173[_0xdbbf('0x13')]));});});};exports[_0xdbbf('0x36')]=function(_0x172bf8){var _0x3be5c1=this;return new Promise(function(_0x3bc1b1,_0x58f38b){return db[_0xdbbf('0x1f')][_0xdbbf('0x20')]()[_0xdbbf('0x14')](function(){return db[_0xdbbf('0x21')][_0xdbbf('0x22')](function(_0x4a2db5){return db[_0xdbbf('0x5')][_0xdbbf('0x6')]({'where':_0x172bf8[_0xdbbf('0x7')]?_0x172bf8['options'][_0xdbbf('0x9')]||null:null,'attributes':_0x172bf8[_0xdbbf('0x7')]?_0x172bf8[_0xdbbf('0x7')][_0xdbbf('0xa')]||null:null,'limit':0x1,'order':_0x172bf8[_0xdbbf('0x7')]?_0x172bf8[_0xdbbf('0x7')]['order']||null:null,'group':db['CmHopper'][_0xdbbf('0x37')],'transaction':_0x4a2db5,'lock':_0x4a2db5['LOCK'][_0xdbbf('0x38')],'include':_0x172bf8[_0xdbbf('0x7')]?_0x172bf8['options']['include']?_[_0xdbbf('0xe')](_0x172bf8[_0xdbbf('0x7')][_0xdbbf('0xc')],function(_0x17790b){return{'model':db[_0x17790b[_0xdbbf('0xd')]],'as':_0x17790b['as'],'attributes':_0x17790b[_0xdbbf('0xa')],'include':_0x17790b[_0xdbbf('0xc')]?_[_0xdbbf('0xe')](_0x17790b[_0xdbbf('0xc')],function(_0x1ac17d){return{'model':db[_0x1ac17d[_0xdbbf('0xd')]],'as':_0x1ac17d['as'],'attributes':_0x1ac17d['attributes'],'include':_0x1ac17d[_0xdbbf('0xc')]?_[_0xdbbf('0xe')](_0x1ac17d[_0xdbbf('0xc')],function(_0x271dfb){return{'model':db[_0x271dfb['model']],'as':_0x271dfb['as'],'attributes':_0x271dfb[_0xdbbf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17c8a4){var _0x4a13dc=[];for(var _0x56670a=0x0;_0x56670a<_0x17c8a4['length'];_0x56670a+=0x1){_0x4a13dc[_0xdbbf('0x27')](_0x17c8a4[_0x56670a]['update'](_0x172bf8[_0xdbbf('0x18')],{'transaction':_0x4a2db5}));}return BPromise[_0xdbbf('0x2a')](_0x4a13dc);});})['then'](function(_0xf14df5){logger[_0xdbbf('0xf')](_0xdbbf('0x36'),_0x172bf8);logger[_0xdbbf('0x10')](_0xdbbf('0x36'),_0x172bf8,JSON[_0xdbbf('0x11')](_0xf14df5));_0x3bc1b1(_0xf14df5);})[_0xdbbf('0x12')](function(_0x4a47d8){logger['error'](_0xdbbf('0x36'),_0x4a47d8['message'],_0x172bf8);_0x58f38b(_0x3be5c1['error'](0x1f4,_0x4a47d8[_0xdbbf('0x13')]));});});});};exports[_0xdbbf('0x39')]=function(_0x98ece0){var _0x34e400=this;return new Promise(function(_0x959c4a,_0x5cbe20){db['CmContact'][_0xdbbf('0x20')]()['then'](function(_0x1d4425){return db[_0xdbbf('0x5')]['findAll']({'raw':_0x98ece0[_0xdbbf('0x7')]?_0x98ece0[_0xdbbf('0x7')][_0xdbbf('0x8')]===undefined?!![]:![]:!![],'where':_0x98ece0[_0xdbbf('0x7')]?_0x98ece0[_0xdbbf('0x7')][_0xdbbf('0x9')]||null:null,'attributes':_0x98ece0[_0xdbbf('0x7')]?_0x98ece0['options'][_0xdbbf('0xa')]||null:null,'limit':_0x98ece0[_0xdbbf('0x7')]?_0x98ece0['options'][_0xdbbf('0xb')]||null:null,'include':_0x98ece0[_0xdbbf('0x7')]?_0x98ece0[_0xdbbf('0x7')]['include']?_[_0xdbbf('0xe')](_0x98ece0['options'][_0xdbbf('0xc')],function(_0x57238b){return{'model':db[_0x57238b[_0xdbbf('0xd')]],'as':_0x57238b['as'],'attributes':_0x57238b['as']===_0xdbbf('0x3a')?_['keys'](_0x1d4425):_0x57238b[_0xdbbf('0xa')],'include':_0x57238b['include']?_['map'](_0x57238b['include'],function(_0xbefa5){return{'model':db[_0xbefa5['model']],'as':_0xbefa5['as'],'attributes':_0xbefa5[_0xdbbf('0xa')],'include':_0xbefa5[_0xdbbf('0xc')]?_[_0xdbbf('0xe')](_0xbefa5[_0xdbbf('0xc')],function(_0xb9f9f8){return{'model':db[_0xb9f9f8[_0xdbbf('0xd')]],'as':_0xb9f9f8['as'],'attributes':_0xb9f9f8[_0xdbbf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x356606){logger[_0xdbbf('0xf')]('GetCmHopper',_0x98ece0);logger[_0xdbbf('0x10')](_0xdbbf('0x4'),_0x98ece0,JSON['stringify'](_0x356606));_0x959c4a(_0x356606);})[_0xdbbf('0x12')](function(_0x1034f1){logger[_0xdbbf('0x16')]('GetCmHopper',_0x1034f1[_0xdbbf('0x13')],_0x98ece0);_0x5cbe20(_0x34e400['error'](0x1f4,_0x1034f1['message']));});});});};exports[_0xdbbf('0x3b')]=function(_0x14880e){var _0x51db9f=this;return new Promise(function(_0x480b18,_0x39fb9b){return db[_0xdbbf('0x1f')][_0xdbbf('0x3c')]({'raw':!![],'where':{'phone':_0x14880e[_0xdbbf('0x7')][_0xdbbf('0x9')]['phone']},'attributes':['id',_0xdbbf('0x3d')],'order':[['id',_0xdbbf('0x3e')]]})[_0xdbbf('0x14')](function(_0x4a25e3){logger['info']('getContactByPhone',_0x14880e);logger[_0xdbbf('0x10')](_0xdbbf('0x3f'),_0x14880e,JSON['stringify'](_0x4a25e3));_0x480b18(_0x4a25e3);})[_0xdbbf('0x12')](function(_0x142e97){logger[_0xdbbf('0x16')](_0xdbbf('0x3f'),_0x142e97['message'],_0x14880e);_0x39fb9b(_0x51db9f[_0xdbbf('0x16')](0x1f4,_0x142e97['message']));});});};exports[_0xdbbf('0x40')]=function(_0x515149){var _0xc8874a=this;return new Promise(function(_0x1721b1,_0x45b9b9){return db[_0xdbbf('0x21')]['transaction'](function(_0x10bbec){var _0x137755=_0x515149['options']&&_0x515149[_0xdbbf('0x7')][_0xdbbf('0x9')]?_0x515149[_0xdbbf('0x7')][_0xdbbf('0x9')]:{};return db[_0xdbbf('0x5')][_0xdbbf('0x28')](_0x515149[_0xdbbf('0x18')],{'where':_0x137755,'transaction':_0x10bbec})[_0xdbbf('0x14')](function(_0x8275eb){logger[_0xdbbf('0xf')](_0xdbbf('0x40'),_0x515149);logger['debug'](_0xdbbf('0x40'),_0x515149,JSON[_0xdbbf('0x11')](_0x8275eb));_0x1721b1(_0x8275eb);})[_0xdbbf('0x12')](function(_0x28206d){logger[_0xdbbf('0x16')](_0xdbbf('0x40'),_0x28206d[_0xdbbf('0x13')],_0x515149);_0x45b9b9(_0xc8874a[_0xdbbf('0x16')](0x1f4,_0x28206d[_0xdbbf('0x13')]));});});});};exports[_0xdbbf('0x41')]=function(_0xd9ca2b){var _0x47b7c6=this;var _0xd48f5c=_0xd9ca2b[_0xdbbf('0x18')][_0xdbbf('0x9')][_0xdbbf('0x42')];var _0x3dc80d=_0xd9ca2b[_0xdbbf('0x18')][_0xdbbf('0x9')]['interval'];var _0x17b542=_0xd9ca2b['body'][_0xdbbf('0x9')][_0xdbbf('0x43')];return new Promise(function(_0x4a4968,_0x3667bb){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0xd48f5c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xdbbf('0x21')][_0xdbbf('0x31')](_0xdbbf('0x44')+_0x3dc80d+_0xdbbf('0x45')),'$gt':db[_0xdbbf('0x21')]['literal'](_0xdbbf('0x46'))}},'UserId':{'$in':_0x17b542}},'include':[{'model':db[_0xdbbf('0x1f')],'as':_0xdbbf('0x3a')},{'model':db[_0xdbbf('0x47')],'as':_0xdbbf('0x25'),'attributes':['id','name','voicePause']},{'model':db[_0xdbbf('0x48')],'as':'List'}]})[_0xdbbf('0x14')](function(_0x2b5b79){if(_0x2b5b79[_0xdbbf('0x26')]>0x0){return db[_0xdbbf('0x21')]['transaction'](function(_0x235b32){return db[_0xdbbf('0x5')][_0xdbbf('0x28')]({'recallmeNotifiedDate':db[_0xdbbf('0x21')][_0xdbbf('0x31')](_0xdbbf('0x46'))},{'where':{'id':{'$in':_[_0xdbbf('0xe')](_0x2b5b79,'id')}},'transaction':_0x235b32})[_0xdbbf('0x14')](function(){_0x4a4968(_0x2b5b79);})[_0xdbbf('0x12')](function(_0x494cd3){logger[_0xdbbf('0x16')]('CmHopperHandlePreviewRecallNotifications',_0x494cd3['message'],_0xd9ca2b);_0x3667bb(_0x47b7c6[_0xdbbf('0x16')](0x1f4,_0x494cd3[_0xdbbf('0x13')]));});})[_0xdbbf('0x12')](function(_0x44132f){logger[_0xdbbf('0x16')](_0xdbbf('0x41'),_0x44132f[_0xdbbf('0x13')],_0xd9ca2b);_0x3667bb(_0x47b7c6['error'](0x1f4,_0x44132f[_0xdbbf('0x13')]));});}else{_0x4a4968(_0x2b5b79);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 1d05f28..014040c 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 _0xb77a=['getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','/:id','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','describe','getOpenContacts'];(function(_0xb2c1d6,_0x327bb9){var _0x5beff4=function(_0x2fc009){while(--_0x2fc009){_0xb2c1d6['push'](_0xb2c1d6['shift']());}};_0x5beff4(++_0x327bb9);}(_0xb77a,0x133));var _0xab77=function(_0x26d353,_0x1623f9){_0x26d353=_0x26d353-0x0;var _0x40847a=_0xb77a[_0x26d353];return _0x40847a;};'use strict';var express=require(_0xab77('0x0'));var router=express[_0xab77('0x1')]();var auth=require(_0xab77('0x2'));var controller=require('./cmHopper.controller');router[_0xab77('0x3')]('/',auth[_0xab77('0x4')](),controller[_0xab77('0x5')]);router[_0xab77('0x3')]('/describe',auth[_0xab77('0x4')](),controller[_0xab77('0x6')]);router[_0xab77('0x3')]('/opencontacts',auth[_0xab77('0x4')](),controller[_0xab77('0x7')]);router[_0xab77('0x3')]('/timezones',auth[_0xab77('0x4')](),controller[_0xab77('0x8')]);router[_0xab77('0x3')]('/:id',auth['isAuthenticated'](),controller[_0xab77('0x9')]);router[_0xab77('0x3')](_0xab77('0xa'),auth[_0xab77('0x4')](),controller[_0xab77('0xb')]);router[_0xab77('0xc')]('/',auth[_0xab77('0x4')](),controller[_0xab77('0xd')]);router['post'](_0xab77('0xe'),auth['isAuthenticated'](),controller[_0xab77('0xf')]);router[_0xab77('0xc')](_0xab77('0x10'),auth[_0xab77('0x4')](),controller[_0xab77('0x11')]);router['put'](_0xab77('0x12'),auth[_0xab77('0x4')](),controller['update']);router['delete'](_0xab77('0x12'),auth['isAuthenticated'](),controller[_0xab77('0x13')]);module[_0xab77('0x14')]=router; \ No newline at end of file +var _0x8945=['describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','../../components/auth/service','./cmHopper.controller','get','index','isAuthenticated'];(function(_0x31d87a,_0x40dcba){var _0x245c35=function(_0x475e6e){while(--_0x475e6e){_0x31d87a['push'](_0x31d87a['shift']());}};_0x245c35(++_0x40dcba);}(_0x8945,0x16a));var _0x5894=function(_0x2418eb,_0xfdb4fa){_0x2418eb=_0x2418eb-0x0;var _0x2d1720=_0x8945[_0x2418eb];return _0x2d1720;};'use strict';var express=require(_0x5894('0x0'));var router=express['Router']();var auth=require(_0x5894('0x1'));var controller=require(_0x5894('0x2'));router[_0x5894('0x3')]('/',auth['isAuthenticated'](),controller[_0x5894('0x4')]);router['get']('/describe',auth[_0x5894('0x5')](),controller[_0x5894('0x6')]);router[_0x5894('0x3')](_0x5894('0x7'),auth[_0x5894('0x5')](),controller[_0x5894('0x8')]);router[_0x5894('0x3')]('/timezones',auth['isAuthenticated'](),controller[_0x5894('0x9')]);router[_0x5894('0x3')](_0x5894('0xa'),auth[_0x5894('0x5')](),controller[_0x5894('0xb')]);router[_0x5894('0x3')]('/:id/previewrecall',auth[_0x5894('0x5')](),controller[_0x5894('0xc')]);router[_0x5894('0xd')]('/',auth[_0x5894('0x5')](),controller[_0x5894('0xe')]);router['post']('/preview',auth[_0x5894('0x5')](),controller[_0x5894('0xf')]);router['post'](_0x5894('0x10'),auth['isAuthenticated'](),controller[_0x5894('0x11')]);router[_0x5894('0x12')]('/:id',auth[_0x5894('0x5')](),controller[_0x5894('0x13')]);router[_0x5894('0x14')](_0x5894('0xa'),auth[_0x5894('0x5')](),controller[_0x5894('0x15')]);module[_0x5894('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 9ee8367..75e0fdc 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbef9=['moment','exports','STRING','INTEGER','DATE','format'];(function(_0x53b6ae,_0x3cb9f4){var _0x34f4b2=function(_0x4b3169){while(--_0x4b3169){_0x53b6ae['push'](_0x53b6ae['shift']());}};_0x34f4b2(++_0x3cb9f4);}(_0xbef9,0x66));var _0x9bef=function(_0x3fc5b1,_0x5d9c43){_0x3fc5b1=_0x3fc5b1-0x0;var _0x143de8=_0xbef9[_0x3fc5b1];return _0x143de8;};'use strict';var moment=require(_0x9bef('0x0'));var Sequelize=require('sequelize');module[_0x9bef('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9bef('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9bef('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9bef('0x4')],'defaultValue':moment()[_0x9bef('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9bef('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9bef('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9bef('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9bef('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x49f3=['moment','sequelize','exports','INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x49f3,0x150));var _0x349f=function(_0x457c41,_0x320aad){_0x457c41=_0x457c41-0x0;var _0x2f7a46=_0x49f3[_0x457c41];return _0x2f7a46;};'use strict';var moment=require(_0x349f('0x0'));var Sequelize=require(_0x349f('0x1'));module[_0x349f('0x2')]={'CmHopperId':{'type':Sequelize[_0x349f('0x3')]},'phone':{'type':Sequelize[_0x349f('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x349f('0x5')](_0x349f('0x6'))},'countbusyretry':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x349f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 61fceb6..95d487f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaab2=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','CmHopperAdditionalPhone','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0x530a37,_0x524809){var _0x1b19f8=function(_0x5a834e){while(--_0x5a834e){_0x530a37['push'](_0x530a37['shift']());}};_0x1b19f8(++_0x524809);}(_0xaab2,0x197));var _0x2aab=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xaab2[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x2aab('0x0'));var rimraf=require(_0x2aab('0x1'));var zipdir=require(_0x2aab('0x2'));var jsonpatch=require(_0x2aab('0x3'));var rp=require('request-promise');var moment=require(_0x2aab('0x4'));var BPromise=require(_0x2aab('0x5'));var Mustache=require('mustache');var util=require(_0x2aab('0x6'));var path=require(_0x2aab('0x7'));var sox=require(_0x2aab('0x8'));var csv=require(_0x2aab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2aab('0xa'));var _=require(_0x2aab('0xb'));var squel=require(_0x2aab('0xc'));var crypto=require(_0x2aab('0xd'));var jsforce=require(_0x2aab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2aab('0x9'));var querystring=require(_0x2aab('0xf'));var Papa=require('papaparse');var Redis=require(_0x2aab('0x10'));var authService=require(_0x2aab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2aab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2aab('0x13'))(_0x2aab('0x14'));var utils=require('../../config/utils');var config=require(_0x2aab('0x15'));var licenseUtil=require(_0x2aab('0x16'));var db=require(_0x2aab('0x17'))['db'];function respondWithStatusCode(_0x2cac62,_0x4c256c){_0x4c256c=_0x4c256c||0xcc;return function(_0x47823e){if(_0x47823e){return _0x2cac62[_0x2aab('0x18')](_0x4c256c);}return _0x2cac62[_0x2aab('0x19')](_0x4c256c)[_0x2aab('0x1a')]();};}function respondWithResult(_0xfd98f7,_0x3716ef){_0x3716ef=_0x3716ef||0xc8;return function(_0x4fc410){if(_0x4fc410){return _0xfd98f7[_0x2aab('0x19')](_0x3716ef)['json'](_0x4fc410);}};}function respondWithFilteredResult(_0x4b41c7,_0x18b11a){return function(_0x297d76){if(_0x297d76){var _0x2ff672=typeof _0x18b11a['offset']===_0x2aab('0x1b')&&typeof _0x18b11a[_0x2aab('0x1c')]===_0x2aab('0x1b');var _0x3b8363=_0x297d76['count'];var _0x1e0765=_0x2ff672?0x0:_0x18b11a[_0x2aab('0x1d')];var _0x5660fa=_0x2ff672?_0x297d76[_0x2aab('0x1e')]:_0x18b11a[_0x2aab('0x1d')]+_0x18b11a[_0x2aab('0x1c')];var _0x37f667;if(_0x5660fa>=_0x3b8363){_0x5660fa=_0x3b8363;_0x37f667=0xc8;}else{_0x37f667=0xce;}_0x4b41c7['status'](_0x37f667);return _0x4b41c7['set'](_0x2aab('0x1f'),_0x1e0765+'-'+_0x5660fa+'/'+_0x3b8363)[_0x2aab('0x20')](_0x297d76);}return null;};}function patchUpdates(_0x2d590b){return function(_0x656674){try{jsonpatch['apply'](_0x656674,_0x2d590b,!![]);}catch(_0x177f50){return BPromise[_0x2aab('0x21')](_0x177f50);}return _0x656674['save']();};}function saveUpdates(_0x22d7ca,_0x239896){return function(_0x6afd77){if(_0x6afd77){return _0x6afd77[_0x2aab('0x22')](_0x22d7ca)[_0x2aab('0x23')](function(_0x5ff3dd){return _0x5ff3dd;});}return null;};}function removeEntity(_0x5e9f3a,_0x2ad182){return function(_0x1e91a6){if(_0x1e91a6){return _0x1e91a6[_0x2aab('0x24')]()[_0x2aab('0x23')](function(){var _0x8e01e9=_0x1e91a6[_0x2aab('0x25')]({'plain':!![]});var _0x32e151=_0x2aab('0x26');return db[_0x2aab('0x27')]['destroy']({'where':{'type':_0x32e151,'resourceId':_0x8e01e9['id']}})[_0x2aab('0x23')](function(){return _0x1e91a6;});})[_0x2aab('0x23')](function(){_0x5e9f3a[_0x2aab('0x19')](0xcc)[_0x2aab('0x1a')]();});}};}function handleEntityNotFound(_0x433509,_0xe6b7ae){return function(_0x2d4d4f){if(!_0x2d4d4f){_0x433509[_0x2aab('0x18')](0x194);}return _0x2d4d4f;};}function handleError(_0x5e527d,_0xcb07dc){_0xcb07dc=_0xcb07dc||0x1f4;return function(_0x5b2e3d){logger[_0x2aab('0x28')](_0x5b2e3d[_0x2aab('0x29')]);if(_0x5b2e3d[_0x2aab('0x2a')]){delete _0x5b2e3d[_0x2aab('0x2a')];}_0x5e527d[_0x2aab('0x19')](_0xcb07dc)[_0x2aab('0x2b')](_0x5b2e3d);};}exports['index']=function(_0xba61ad,_0x419ecf){var _0xded95c={},_0x536936={},_0x1a7936={'count':0x0,'rows':[]};var _0x4283a9=_[_0x2aab('0x2c')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x949578){return{'name':_0x949578[_0x2aab('0x2d')],'type':_0x949578[_0x2aab('0x2e')][_0x2aab('0x2f')]};});_0x536936[_0x2aab('0x30')]=_['map'](_0x4283a9,_0x2aab('0x2a'));_0x536936[_0x2aab('0x31')]=_['keys'](_0xba61ad[_0x2aab('0x31')]);_0x536936['filters']=_[_0x2aab('0x32')](_0x536936['model'],_0x536936[_0x2aab('0x31')]);_0xded95c[_0x2aab('0x33')]=_[_0x2aab('0x32')](_0x536936[_0x2aab('0x30')],qs[_0x2aab('0x34')](_0xba61ad[_0x2aab('0x31')][_0x2aab('0x34')]));_0xded95c['attributes']=_0xded95c[_0x2aab('0x33')][_0x2aab('0x35')]?_0xded95c[_0x2aab('0x33')]:_0x536936[_0x2aab('0x30')];if(!_0xba61ad[_0x2aab('0x31')][_0x2aab('0x36')](_0x2aab('0x37'))){_0xded95c[_0x2aab('0x1c')]=qs[_0x2aab('0x1c')](_0xba61ad[_0x2aab('0x31')]['limit']);_0xded95c[_0x2aab('0x1d')]=qs[_0x2aab('0x1d')](_0xba61ad[_0x2aab('0x31')][_0x2aab('0x1d')]);}_0xded95c[_0x2aab('0x38')]=qs[_0x2aab('0x39')](_0xba61ad[_0x2aab('0x31')][_0x2aab('0x39')]);_0xded95c[_0x2aab('0x3a')]=qs['filters'](_['pick'](_0xba61ad[_0x2aab('0x31')],_0x536936[_0x2aab('0x3b')]),_0x4283a9);if(_0xba61ad[_0x2aab('0x31')][_0x2aab('0x3c')]){_0xded95c[_0x2aab('0x3a')]=_[_0x2aab('0x3d')](_0xded95c[_0x2aab('0x3a')],{'$or':_[_0x2aab('0x2c')](_0x4283a9,function(_0x1d7dcf){if(_0x1d7dcf[_0x2aab('0x2e')]!==_0x2aab('0x3e')){var _0x32ae91={};_0x32ae91[_0x1d7dcf[_0x2aab('0x2a')]]={'$like':'%'+_0xba61ad['query'][_0x2aab('0x3c')]+'%'};return _0x32ae91;}})});}_0xded95c=_['merge']({},_0xded95c,_0xba61ad[_0x2aab('0x3f')]);var _0x1f2ed0={'where':_0xded95c[_0x2aab('0x3a')]};return db[_0x2aab('0x40')]['count'](_0x1f2ed0)[_0x2aab('0x23')](function(_0x800adb){_0x1a7936['count']=_0x800adb;if(_0xba61ad['query']['includeAll']){_0xded95c['include']=[{'all':!![]}];}return db[_0x2aab('0x40')][_0x2aab('0x41')](_0xded95c);})[_0x2aab('0x23')](function(_0x21589e){_0x1a7936[_0x2aab('0x42')]=_0x21589e;return _0x1a7936;})['then'](respondWithFilteredResult(_0x419ecf,_0xded95c))[_0x2aab('0x43')](handleError(_0x419ecf,null));};exports[_0x2aab('0x44')]=function(_0x16b1b9,_0x94a6b2){var _0x196699={'raw':!![],'where':{'id':_0x16b1b9[_0x2aab('0x45')]['id']}},_0x3e76a8={};_0x3e76a8[_0x2aab('0x30')]=_['keys'](db[_0x2aab('0x40')][_0x2aab('0x46')]);_0x3e76a8[_0x2aab('0x31')]=_[_0x2aab('0x47')](_0x16b1b9[_0x2aab('0x31')]);_0x3e76a8[_0x2aab('0x3b')]=_[_0x2aab('0x32')](_0x3e76a8[_0x2aab('0x30')],_0x3e76a8[_0x2aab('0x31')]);_0x196699[_0x2aab('0x33')]=_[_0x2aab('0x32')](_0x3e76a8[_0x2aab('0x30')],qs[_0x2aab('0x34')](_0x16b1b9[_0x2aab('0x31')]['fields']));_0x196699['attributes']=_0x196699[_0x2aab('0x33')]['length']?_0x196699[_0x2aab('0x33')]:_0x3e76a8[_0x2aab('0x30')];if(_0x16b1b9[_0x2aab('0x31')][_0x2aab('0x48')]){_0x196699['include']=[{'all':!![]}];}_0x196699=_[_0x2aab('0x3d')]({},_0x196699,_0x16b1b9[_0x2aab('0x3f')]);return db[_0x2aab('0x40')][_0x2aab('0x49')](_0x196699)['then'](handleEntityNotFound(_0x94a6b2,null))['then'](respondWithResult(_0x94a6b2,null))[_0x2aab('0x43')](handleError(_0x94a6b2,null));};exports['create']=function(_0x1c137b,_0x2ccbee){return db[_0x2aab('0x40')][_0x2aab('0x4a')](_0x1c137b[_0x2aab('0x4b')],{})[_0x2aab('0x23')](function(_0x1044c8){var _0x45c37e=_0x1c137b[_0x2aab('0x4c')]['get']({'plain':!![]});if(!_0x45c37e)throw new Error(_0x2aab('0x4d'));if(_0x45c37e[_0x2aab('0x4e')]===_0x2aab('0x4c')){var _0x1b0e94=_0x1044c8[_0x2aab('0x25')]({'plain':!![]});var _0x1a59c1=_0x2aab('0x26');return db[_0x2aab('0x4f')]['find']({'where':{'name':_0x1a59c1,'userProfileId':_0x45c37e[_0x2aab('0x50')]},'raw':!![]})[_0x2aab('0x23')](function(_0x17187f){if(_0x17187f&&_0x17187f[_0x2aab('0x51')]===0x0){return db['UserProfileResource'][_0x2aab('0x4a')]({'name':_0x1b0e94['name'],'resourceId':_0x1b0e94['id'],'type':_0x17187f['name'],'sectionId':_0x17187f['id']},{})['then'](function(){return _0x1044c8;});}else{return _0x1044c8;}})[_0x2aab('0x43')](function(_0x60a52b){logger['error'](_0x2aab('0x52'),_0x60a52b);throw _0x60a52b;});}return _0x1044c8;})[_0x2aab('0x23')](respondWithResult(_0x2ccbee,0xc9))['catch'](handleError(_0x2ccbee,null));};exports[_0x2aab('0x22')]=function(_0x129ab1,_0x4922d7){if(_0x129ab1[_0x2aab('0x4b')]['id']){delete _0x129ab1[_0x2aab('0x4b')]['id'];}return db[_0x2aab('0x40')][_0x2aab('0x49')]({'where':{'id':_0x129ab1[_0x2aab('0x45')]['id']}})['then'](handleEntityNotFound(_0x4922d7,null))['then'](saveUpdates(_0x129ab1[_0x2aab('0x4b')],null))[_0x2aab('0x23')](respondWithResult(_0x4922d7,null))[_0x2aab('0x43')](handleError(_0x4922d7,null));};exports[_0x2aab('0x24')]=function(_0x3d9a1d,_0x28da03){return db[_0x2aab('0x40')][_0x2aab('0x49')]({'where':{'id':_0x3d9a1d[_0x2aab('0x45')]['id']}})[_0x2aab('0x23')](handleEntityNotFound(_0x28da03,null))['then'](removeEntity(_0x28da03,null))[_0x2aab('0x43')](handleError(_0x28da03,null));}; \ No newline at end of file +var _0x797a=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','error','stack','name','send','CmHopperAdditionalPhone','fieldName','type','key','model','map','query','intersection','fields','attributes','length','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CmHopperAdditionalPhones','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2b5994,_0x1bf6e7){var _0x2f6a2c=function(_0x458593){while(--_0x458593){_0x2b5994['push'](_0x2b5994['shift']());}};_0x2f6a2c(++_0x1bf6e7);}(_0x797a,0x1d9));var _0xa797=function(_0x1d01e1,_0x42f4a3){_0x1d01e1=_0x1d01e1-0x0;var _0x204cc1=_0x797a[_0x1d01e1];return _0x204cc1;};'use strict';var emlformat=require(_0xa797('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa797('0x1'));var jsonpatch=require(_0xa797('0x2'));var rp=require('request-promise');var moment=require(_0xa797('0x3'));var BPromise=require(_0xa797('0x4'));var Mustache=require(_0xa797('0x5'));var util=require(_0xa797('0x6'));var path=require(_0xa797('0x7'));var sox=require(_0xa797('0x8'));var csv=require(_0xa797('0x9'));var ejs=require(_0xa797('0xa'));var fs=require('fs');var fs_extra=require(_0xa797('0xb'));var _=require(_0xa797('0xc'));var squel=require(_0xa797('0xd'));var crypto=require(_0xa797('0xe'));var jsforce=require(_0xa797('0xf'));var deskjs=require(_0xa797('0x10'));var toCsv=require(_0xa797('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa797('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa797('0x12'));var as=require(_0xa797('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa797('0x14'))(_0xa797('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa797('0x16'));var db=require(_0xa797('0x17'))['db'];function respondWithStatusCode(_0x3fb1b0,_0x44e034){_0x44e034=_0x44e034||0xcc;return function(_0x2c0470){if(_0x2c0470){return _0x3fb1b0[_0xa797('0x18')](_0x44e034);}return _0x3fb1b0[_0xa797('0x19')](_0x44e034)[_0xa797('0x1a')]();};}function respondWithResult(_0x2c4026,_0x403efd){_0x403efd=_0x403efd||0xc8;return function(_0x361048){if(_0x361048){return _0x2c4026[_0xa797('0x19')](_0x403efd)[_0xa797('0x1b')](_0x361048);}};}function respondWithFilteredResult(_0x4333cd,_0x142011){return function(_0x39e63e){if(_0x39e63e){var _0x5a831a=typeof _0x142011[_0xa797('0x1c')]==='undefined'&&typeof _0x142011[_0xa797('0x1d')]==='undefined';var _0x4da649=_0x39e63e[_0xa797('0x1e')];var _0x391c10=_0x5a831a?0x0:_0x142011['offset'];var _0x3ce94a=_0x5a831a?_0x39e63e['count']:_0x142011['offset']+_0x142011[_0xa797('0x1d')];var _0x394b33;if(_0x3ce94a>=_0x4da649){_0x3ce94a=_0x4da649;_0x394b33=0xc8;}else{_0x394b33=0xce;}_0x4333cd[_0xa797('0x19')](_0x394b33);return _0x4333cd[_0xa797('0x1f')](_0xa797('0x20'),_0x391c10+'-'+_0x3ce94a+'/'+_0x4da649)[_0xa797('0x1b')](_0x39e63e);}return null;};}function patchUpdates(_0x207fa7){return function(_0x49750e){try{jsonpatch[_0xa797('0x21')](_0x49750e,_0x207fa7,!![]);}catch(_0x3d4988){return BPromise[_0xa797('0x22')](_0x3d4988);}return _0x49750e[_0xa797('0x23')]();};}function saveUpdates(_0x503537,_0x3751c8){return function(_0x10b666){if(_0x10b666){return _0x10b666[_0xa797('0x24')](_0x503537)[_0xa797('0x25')](function(_0x3fe8d2){return _0x3fe8d2;});}return null;};}function removeEntity(_0x15346d,_0x5e883f){return function(_0x9dbec8){if(_0x9dbec8){return _0x9dbec8['destroy']()[_0xa797('0x25')](function(){var _0x2187c6=_0x9dbec8[_0xa797('0x26')]({'plain':!![]});var _0x2eeb22='CmHopperAdditionalPhones';return db['UserProfileResource'][_0xa797('0x27')]({'where':{'type':_0x2eeb22,'resourceId':_0x2187c6['id']}})[_0xa797('0x25')](function(){return _0x9dbec8;});})[_0xa797('0x25')](function(){_0x15346d[_0xa797('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27a9f9,_0x1bc781){return function(_0x41e8e5){if(!_0x41e8e5){_0x27a9f9['sendStatus'](0x194);}return _0x41e8e5;};}function handleError(_0x24bbd6,_0x4340f5){_0x4340f5=_0x4340f5||0x1f4;return function(_0x478837){logger[_0xa797('0x28')](_0x478837[_0xa797('0x29')]);if(_0x478837[_0xa797('0x2a')]){delete _0x478837[_0xa797('0x2a')];}_0x24bbd6[_0xa797('0x19')](_0x4340f5)[_0xa797('0x2b')](_0x478837);};}exports['index']=function(_0x38fab8,_0x55f47f){var _0x14f1b9={},_0x5efd35={},_0x55b221={'count':0x0,'rows':[]};var _0x17cbfa=_['map'](db[_0xa797('0x2c')]['rawAttributes'],function(_0x13a086){return{'name':_0x13a086[_0xa797('0x2d')],'type':_0x13a086[_0xa797('0x2e')][_0xa797('0x2f')]};});_0x5efd35[_0xa797('0x30')]=_[_0xa797('0x31')](_0x17cbfa,_0xa797('0x2a'));_0x5efd35[_0xa797('0x32')]=_['keys'](_0x38fab8['query']);_0x5efd35['filters']=_[_0xa797('0x33')](_0x5efd35[_0xa797('0x30')],_0x5efd35[_0xa797('0x32')]);_0x14f1b9['attributes']=_[_0xa797('0x33')](_0x5efd35[_0xa797('0x30')],qs[_0xa797('0x34')](_0x38fab8[_0xa797('0x32')][_0xa797('0x34')]));_0x14f1b9[_0xa797('0x35')]=_0x14f1b9['attributes'][_0xa797('0x36')]?_0x14f1b9[_0xa797('0x35')]:_0x5efd35['model'];if(!_0x38fab8['query']['hasOwnProperty']('nolimit')){_0x14f1b9[_0xa797('0x1d')]=qs[_0xa797('0x1d')](_0x38fab8['query'][_0xa797('0x1d')]);_0x14f1b9[_0xa797('0x1c')]=qs['offset'](_0x38fab8[_0xa797('0x32')][_0xa797('0x1c')]);}_0x14f1b9[_0xa797('0x37')]=qs['sort'](_0x38fab8['query'][_0xa797('0x38')]);_0x14f1b9[_0xa797('0x39')]=qs[_0xa797('0x3a')](_['pick'](_0x38fab8[_0xa797('0x32')],_0x5efd35[_0xa797('0x3a')]),_0x17cbfa);if(_0x38fab8[_0xa797('0x32')]['filter']){_0x14f1b9[_0xa797('0x39')]=_[_0xa797('0x3b')](_0x14f1b9[_0xa797('0x39')],{'$or':_[_0xa797('0x31')](_0x17cbfa,function(_0x4d965f){if(_0x4d965f[_0xa797('0x2e')]!==_0xa797('0x3c')){var _0x56db34={};_0x56db34[_0x4d965f['name']]={'$like':'%'+_0x38fab8[_0xa797('0x32')][_0xa797('0x3d')]+'%'};return _0x56db34;}})});}_0x14f1b9=_[_0xa797('0x3b')]({},_0x14f1b9,_0x38fab8['options']);var _0x473ca5={'where':_0x14f1b9[_0xa797('0x39')]};return db[_0xa797('0x2c')][_0xa797('0x1e')](_0x473ca5)[_0xa797('0x25')](function(_0xeeafcc){_0x55b221[_0xa797('0x1e')]=_0xeeafcc;if(_0x38fab8[_0xa797('0x32')][_0xa797('0x3e')]){_0x14f1b9[_0xa797('0x3f')]=[{'all':!![]}];}return db[_0xa797('0x2c')]['findAll'](_0x14f1b9);})[_0xa797('0x25')](function(_0x15b383){_0x55b221[_0xa797('0x40')]=_0x15b383;return _0x55b221;})[_0xa797('0x25')](respondWithFilteredResult(_0x55f47f,_0x14f1b9))[_0xa797('0x41')](handleError(_0x55f47f,null));};exports[_0xa797('0x42')]=function(_0x3281ed,_0x6c83a6){var _0x2d8f69={'raw':!![],'where':{'id':_0x3281ed[_0xa797('0x43')]['id']}},_0x571312={};_0x571312[_0xa797('0x30')]=_[_0xa797('0x44')](db[_0xa797('0x2c')][_0xa797('0x45')]);_0x571312[_0xa797('0x32')]=_[_0xa797('0x44')](_0x3281ed['query']);_0x571312[_0xa797('0x3a')]=_[_0xa797('0x33')](_0x571312[_0xa797('0x30')],_0x571312[_0xa797('0x32')]);_0x2d8f69['attributes']=_[_0xa797('0x33')](_0x571312[_0xa797('0x30')],qs['fields'](_0x3281ed[_0xa797('0x32')][_0xa797('0x34')]));_0x2d8f69[_0xa797('0x35')]=_0x2d8f69[_0xa797('0x35')][_0xa797('0x36')]?_0x2d8f69[_0xa797('0x35')]:_0x571312[_0xa797('0x30')];if(_0x3281ed['query'][_0xa797('0x3e')]){_0x2d8f69[_0xa797('0x3f')]=[{'all':!![]}];}_0x2d8f69=_[_0xa797('0x3b')]({},_0x2d8f69,_0x3281ed[_0xa797('0x46')]);return db[_0xa797('0x2c')][_0xa797('0x47')](_0x2d8f69)[_0xa797('0x25')](handleEntityNotFound(_0x6c83a6,null))[_0xa797('0x25')](respondWithResult(_0x6c83a6,null))[_0xa797('0x41')](handleError(_0x6c83a6,null));};exports[_0xa797('0x48')]=function(_0x425949,_0x437e78){return db[_0xa797('0x2c')][_0xa797('0x48')](_0x425949[_0xa797('0x49')],{})[_0xa797('0x25')](function(_0x196dc7){var _0x57a21f=_0x425949['user']['get']({'plain':!![]});if(!_0x57a21f)throw new Error(_0xa797('0x4a'));if(_0x57a21f['role']===_0xa797('0x4b')){var _0x4e8175=_0x196dc7['get']({'plain':!![]});var _0xf08c4a=_0xa797('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0xf08c4a,'userProfileId':_0x57a21f['userProfileId']},'raw':!![]})[_0xa797('0x25')](function(_0x277851){if(_0x277851&&_0x277851[_0xa797('0x4d')]===0x0){return db[_0xa797('0x4e')][_0xa797('0x48')]({'name':_0x4e8175['name'],'resourceId':_0x4e8175['id'],'type':_0x277851[_0xa797('0x2a')],'sectionId':_0x277851['id']},{})[_0xa797('0x25')](function(){return _0x196dc7;});}else{return _0x196dc7;}})[_0xa797('0x41')](function(_0x47745f){logger[_0xa797('0x28')](_0xa797('0x4f'),_0x47745f);throw _0x47745f;});}return _0x196dc7;})[_0xa797('0x25')](respondWithResult(_0x437e78,0xc9))['catch'](handleError(_0x437e78,null));};exports['update']=function(_0x44bbfc,_0x49825d){if(_0x44bbfc[_0xa797('0x49')]['id']){delete _0x44bbfc['body']['id'];}return db['CmHopperAdditionalPhone'][_0xa797('0x47')]({'where':{'id':_0x44bbfc[_0xa797('0x43')]['id']}})[_0xa797('0x25')](handleEntityNotFound(_0x49825d,null))[_0xa797('0x25')](saveUpdates(_0x44bbfc[_0xa797('0x49')],null))['then'](respondWithResult(_0x49825d,null))[_0xa797('0x41')](handleError(_0x49825d,null));};exports[_0xa797('0x27')]=function(_0x42451c,_0x5e1796){return db['CmHopperAdditionalPhone'][_0xa797('0x47')]({'where':{'id':_0x42451c['params']['id']}})[_0xa797('0x25')](handleEntityNotFound(_0x5e1796,null))[_0xa797('0x25')](removeEntity(_0x5e1796,null))[_0xa797('0x41')](handleError(_0x5e1796,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 508878b..4d6bfbc 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e53=['define','cm_hopper_additional_phones','lodash','util','api','bluebird','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports'];(function(_0xa4e762,_0x2c7616){var _0x30cec8=function(_0xf7617b){while(--_0xf7617b){_0xa4e762['push'](_0xa4e762['shift']());}};_0x30cec8(++_0x2c7616);}(_0x5e53,0xa7));var _0x35e5=function(_0x24af27,_0x4bae47){_0x24af27=_0x24af27-0x0;var _0x490a7e=_0x5e53[_0x24af27];return _0x490a7e;};'use strict';var _=require(_0x35e5('0x0'));var util=require(_0x35e5('0x1'));var logger=require('../../config/logger')(_0x35e5('0x2'));var moment=require('moment');var BPromise=require(_0x35e5('0x3'));var rp=require(_0x35e5('0x4'));var fs=require('fs');var path=require(_0x35e5('0x5'));var rimraf=require('rimraf');var config=require(_0x35e5('0x6'));var attributes=require(_0x35e5('0x7'));module[_0x35e5('0x8')]=function(_0x375b07,_0x5bc794){return _0x375b07[_0x35e5('0x9')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x35e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0504=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0504,0x147));var _0x4050=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0504[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0x4050('0x0'));var logger=require(_0x4050('0x1'))(_0x4050('0x2'));var moment=require(_0x4050('0x3'));var BPromise=require(_0x4050('0x4'));var rp=require(_0x4050('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4050('0x6'));var config=require(_0x4050('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x4050('0x8')]=function(_0x26da81,_0x2fd317){return _0x26da81['define'](_0x4050('0x9'),attributes,{'tableName':_0x4050('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 1e8b013..563e8aa 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbae7=['countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','ASC','entity','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x42835a,_0x5259a7){var _0xa4f23b=function(_0xcb787d){while(--_0xcb787d){_0x42835a['push'](_0x42835a['shift']());}};_0xa4f23b(++_0x5259a7);}(_0xbae7,0x146));var _0x7bae=function(_0x2ceaff,_0x3574b2){_0x2ceaff=_0x2ceaff-0x0;var _0x2db04a=_0xbae7[_0x2ceaff];return _0x2db04a;};'use strict';var _=require(_0x7bae('0x0'));var util=require(_0x7bae('0x1'));var moment=require(_0x7bae('0x2'));var BPromise=require(_0x7bae('0x3'));var rs=require(_0x7bae('0x4'));var fs=require('fs');var Redis=require(_0x7bae('0x5'));var db=require(_0x7bae('0x6'))['db'];var utils=require(_0x7bae('0x7'));var logger=require(_0x7bae('0x8'))(_0x7bae('0x9'));var config=require(_0x7bae('0xa'));var jayson=require(_0x7bae('0xb'));var client=jayson[_0x7bae('0xc')][_0x7bae('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x277b87,_0xb11d90,_0x4c69f3){return new BPromise(function(_0x4c1ed5,_0xf7a7b3){return client[_0x7bae('0xe')](_0x277b87,_0x4c69f3)[_0x7bae('0xf')](function(_0x97c524){logger[_0x7bae('0x10')](_0x7bae('0x11'),_0xb11d90,_0x7bae('0x12'));logger[_0x7bae('0x13')](_0x7bae('0x14'),_0xb11d90,_0x7bae('0x12'),JSON[_0x7bae('0x15')](_0x97c524));if(_0x97c524[_0x7bae('0x16')]){if(_0x97c524['error'][_0x7bae('0x17')]===0x1f4){logger[_0x7bae('0x16')](_0x7bae('0x11'),_0xb11d90,_0x97c524['error'][_0x7bae('0x18')]);return _0xf7a7b3(_0x97c524[_0x7bae('0x16')][_0x7bae('0x18')]);}logger[_0x7bae('0x16')](_0x7bae('0x11'),_0xb11d90,_0x97c524['error'][_0x7bae('0x18')]);return _0x4c1ed5(_0x97c524['error'][_0x7bae('0x18')]);}else{logger[_0x7bae('0x10')](_0x7bae('0x11'),_0xb11d90,'request\x20sent');_0x4c1ed5(_0x97c524['result'][_0x7bae('0x18')]);}})[_0x7bae('0x19')](function(_0x375c5b){logger[_0x7bae('0x16')](_0x7bae('0x11'),_0xb11d90,_0x375c5b);_0xf7a7b3(_0x375c5b);});});}exports['VerifyAdditionalPhones']=function(_0x4b672c){var _0x1deb11=this;return new Promise(function(_0x346db8,_0x45c394){return db[_0x7bae('0x1a')][_0x7bae('0x1b')]({'raw':!![],'where':{'ContactId':_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x1d')],'ListId':_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x1e')],'VoiceQueueId':_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x1f')]===undefined?null:_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x1f')],'CampaignId':_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x20')]===undefined?null:_0x4b672c[_0x7bae('0x1c')][_0x7bae('0x20')]}})[_0x7bae('0xf')](function(_0x425ef8){if(_0x425ef8!=null){return db[_0x7bae('0x21')][_0x7bae('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x425ef8['id'],'OrderBy':{'$gt':_0x425ef8[_0x7bae('0x22')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x50ae15){var _0x164ac0=0x0;if(_0x50ae15){if(_0x50ae15[_0x7bae('0x23')]+_0x50ae15[_0x7bae('0x24')]+_0x50ae15[_0x7bae('0x25')]+_0x50ae15[_0x7bae('0x26')]+_0x50ae15[_0x7bae('0x27')]+_0x50ae15[_0x7bae('0x28')]+_0x50ae15[_0x7bae('0x29')]+_0x50ae15[_0x7bae('0x2a')]<_0x4b672c['entity'][_0x7bae('0x2b')])_0x164ac0=0x1;_0x346db8({'additional':_0x164ac0});}else{return db['CmHopperAdditionalPhone'][_0x7bae('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x425ef8['id']},'order':[['OrderBy',_0x7bae('0x2c')]]})[_0x7bae('0xf')](function(_0xd0fde){var _0x2388f1=0x0;if(_0xd0fde){if(_0xd0fde[_0x7bae('0x23')]+_0xd0fde[_0x7bae('0x24')]+_0xd0fde['countnoanswerretry']+_0xd0fde[_0x7bae('0x26')]+_0xd0fde[_0x7bae('0x27')]+_0xd0fde[_0x7bae('0x28')]+_0xd0fde[_0x7bae('0x29')]+_0xd0fde[_0x7bae('0x2a')]<_0x4b672c[_0x7bae('0x2d')][_0x7bae('0x2b')])_0x2388f1=0x1;_0x346db8({'additional':_0x2388f1});}else{_0x346db8({'additional':0x0});}})[_0x7bae('0x19')](function(_0x57b8ba){logger[_0x7bae('0x16')](_0x7bae('0x2e'),_0x57b8ba['message']);_0x45c394(_0x1deb11[_0x7bae('0x16')](0x1f4,_0x57b8ba[_0x7bae('0x18')]));});}})[_0x7bae('0x19')](function(_0x118db8){logger[_0x7bae('0x16')]('VerifyAdditionalPhones',_0x118db8[_0x7bae('0x18')]);_0x45c394(_0x1deb11[_0x7bae('0x16')](0x1f4,_0x118db8[_0x7bae('0x18')]));});}else _0x346db8({'additional':0x0});});});};exports[_0x7bae('0x2f')]=function(_0x46017f){var _0xd96271=this;return new Promise(function(_0xd426da,_0x28062c){return db['CmHopper'][_0x7bae('0x1b')]({'raw':!![],'where':{'ContactId':_0x46017f['body']['ContactId'],'ListId':_0x46017f[_0x7bae('0x1c')][_0x7bae('0x1e')],'VoiceQueueId':_0x46017f[_0x7bae('0x1c')][_0x7bae('0x1f')]===undefined?null:_0x46017f[_0x7bae('0x1c')][_0x7bae('0x1f')],'CampaignId':_0x46017f[_0x7bae('0x1c')][_0x7bae('0x20')]===undefined?null:_0x46017f['body'][_0x7bae('0x20')]}})['then'](function(_0x32cc2b){if(_0x32cc2b!=null){return db[_0x7bae('0x21')][_0x7bae('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x32cc2b['id'],'OrderBy':{'$gte':_0x32cc2b[_0x7bae('0x22')]}},'order':[[_0x7bae('0x22'),_0x7bae('0x2c')]]})[_0x7bae('0xf')](function(_0x578e99){if(_0x578e99)return activateAdditionalPhone(_0x32cc2b,_0x46017f[_0x7bae('0x1c')],_0x578e99,_0x46017f[_0x7bae('0x30')],_0x46017f['waitTime'])[_0x7bae('0xf')](function(_0x91a7c8){_0xd426da(_0x91a7c8);});else{return db[_0x7bae('0x21')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x32cc2b['id']},'order':[[_0x7bae('0x22'),_0x7bae('0x2c')]]})['then'](function(_0x10f3d1){if(_0x10f3d1)return activateAdditionalPhone(_0x32cc2b,_0x46017f['body'],_0x10f3d1,_0x46017f[_0x7bae('0x30')],_0x46017f[_0x7bae('0x31')])['then'](function(_0x27342a){_0xd426da(_0x27342a);});else{_0xd426da({'id':_0x32cc2b['id'],'phone':''});}})[_0x7bae('0x19')](function(_0x3f279b){logger[_0x7bae('0x16')](_0x7bae('0x2e'),_0x3f279b[_0x7bae('0x18')]);_0x28062c(_0xd96271[_0x7bae('0x16')](0x1f4,_0x3f279b[_0x7bae('0x18')]));});}})[_0x7bae('0x19')](function(_0x5b60f3){logger[_0x7bae('0x16')](_0x7bae('0x2e'),_0x5b60f3[_0x7bae('0x18')]);_0x28062c(_0xd96271[_0x7bae('0x16')](0x1f4,_0x5b60f3[_0x7bae('0x18')]));});}else _0xd426da(0x1);});});};function activateAdditionalPhone(_0x3bac3b,_0x327ea2,_0x2c3742,_0x56875b,_0x387305){return new Promise(function(_0x2361d7,_0x43d21d){var _0x3741e4;if(_[_0x7bae('0x32')](_0x2c3742[_0x7bae('0x33')])){_0x2c3742[_0x7bae('0x33')]=moment();}if(moment()>moment(_0x2c3742[_0x7bae('0x33')])){_0x3741e4=moment()[_0x7bae('0x34')](_0x387305||0x3,_0x7bae('0x35'));}else{if(_0x2c3742[_0x7bae('0x22')]==0x0){_0x3741e4=moment(_0x2c3742[_0x7bae('0x33')]);}else{_0x3741e4=moment()['add'](_0x387305||0x3,_0x7bae('0x35'));}}if(_[_0x7bae('0x32')](_0x3741e4)){_0x3741e4=moment()['add'](_0x387305||0x3,'minutes');}var _0x2e807c={'phone':_0x3bac3b['phone'],'active':0x0,'OrderBy':_[_0x7bae('0x32')](_0x3bac3b['OrderBy'])?0x0:_0x3bac3b[_0x7bae('0x22')],'scheduledat':moment()[_0x7bae('0x34')](_0x56875b||0x1,_0x7bae('0x35')),'countbusyretry':_0x327ea2[_0x7bae('0x23')],'countcongestionretry':_0x327ea2[_0x7bae('0x24')],'countnoanswerretry':_0x327ea2[_0x7bae('0x25')],'countnosuchnumberretry':_0x327ea2[_0x7bae('0x26')],'countdropretry':_0x327ea2[_0x7bae('0x27')],'countabandonedretry':_0x327ea2['countabandonedretry'],'countmachineretry':_0x327ea2['countmachineretry'],'countagentrejectretry':_0x327ea2[_0x7bae('0x2a')],'createdAt':_0x327ea2[_0x7bae('0x36')],'updatedAt':_0x327ea2['updatedAt']};var _0x1fabdc={'CmHopperId':_0x3bac3b['id'],'phone':_0x2c3742['phone'],'active':0x0,'OrderBy':_[_0x7bae('0x32')](_0x2c3742[_0x7bae('0x22')])?0x0:_0x2c3742[_0x7bae('0x22')],'scheduledat':_0x3741e4,'countbusyretry':_0x2c3742[_0x7bae('0x23')],'countcongestionretry':_0x2c3742['countcongestionretry'],'countnoanswerretry':_0x2c3742[_0x7bae('0x25')],'countnosuchnumberretry':_0x2c3742[_0x7bae('0x26')],'countdropretry':_0x2c3742[_0x7bae('0x27')],'countabandonedretry':_0x2c3742['countabandonedretry'],'countmachineretry':_0x2c3742['countmachineretry'],'countagentrejectretry':_0x2c3742[_0x7bae('0x2a')],'createdAt':_0x2c3742['createdAt'],'updatedAt':_0x2c3742[_0x7bae('0x37')]};return db['sequelize']['transaction'](function(_0x3fd983){return db[_0x7bae('0x21')][_0x7bae('0x38')](_0x2e807c,{'where':{'id':_0x2c3742['id']}},{'transaction':_0x3fd983})[_0x7bae('0xf')](function(){return db['CmHopper'][_0x7bae('0x38')](_0x1fabdc,{'where':{'id':_0x3bac3b['id']}},{'transaction':_0x3fd983});});})[_0x7bae('0xf')](function(_0x3763f5){_0x2361d7({'id':_0x3bac3b['id'],'phone':_0x2c3742[_0x7bae('0x39')]});})[_0x7bae('0x19')](function(_0x3f0d28){logger[_0x7bae('0x16')](_0x7bae('0x3a'),_0x3f0d28[_0x7bae('0x18')]);_0x43d21d({'error':_0x3f0d28['message']});});});}exports[_0x7bae('0x3b')]=function(_0x44ea2d){var _0x4c47f8=this;return new Promise(function(_0x319de8,_0xb39331){return db[_0x7bae('0x1a')]['update'](_0x44ea2d[_0x7bae('0x1c')][_0x7bae('0x3c')],{'where':{'id':_0x44ea2d[_0x7bae('0x1c')]['id']}})[_0x7bae('0xf')](function(_0x4d0470){_0x319de8(_0x4d0470);})['catch'](function(_0x487e54){logger[_0x7bae('0x16')](_0x7bae('0x3b'),_0x487e54[_0x7bae('0x18')]);_0xb39331(_0x4c47f8[_0x7bae('0x16')](0x1f4,_0x487e54['message']));});});}; \ No newline at end of file +var _0x828c=['CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','countabandonedretry','countagentrejectretry','VerifyAdditionalPhones','catch','duration','waitTime','scheduledat','add','minutes','isNil','updatedAt','createdAt','sequelize','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmHopper','body','ContactId','ListId','VoiceQueueId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x828c,0x17b));var _0xc828=function(_0x2631f6,_0x552ce5){_0x2631f6=_0x2631f6-0x0;var _0x45917c=_0x828c[_0x2631f6];return _0x45917c;};'use strict';var _=require(_0xc828('0x0'));var util=require(_0xc828('0x1'));var moment=require(_0xc828('0x2'));var BPromise=require(_0xc828('0x3'));var rs=require(_0xc828('0x4'));var fs=require('fs');var Redis=require(_0xc828('0x5'));var db=require(_0xc828('0x6'))['db'];var utils=require(_0xc828('0x7'));var logger=require(_0xc828('0x8'))(_0xc828('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc828('0xa')][_0xc828('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55aa9d,_0x16d648,_0x454f43){return new BPromise(function(_0x227851,_0x472246){return client['request'](_0x55aa9d,_0x454f43)[_0xc828('0xc')](function(_0x125528){logger[_0xc828('0xd')](_0xc828('0xe'),_0x16d648,_0xc828('0xf'));logger[_0xc828('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x16d648,_0xc828('0xf'),JSON[_0xc828('0x11')](_0x125528));if(_0x125528['error']){if(_0x125528[_0xc828('0x12')][_0xc828('0x13')]===0x1f4){logger['error'](_0xc828('0xe'),_0x16d648,_0x125528[_0xc828('0x12')]['message']);return _0x472246(_0x125528[_0xc828('0x12')]['message']);}logger[_0xc828('0x12')](_0xc828('0xe'),_0x16d648,_0x125528[_0xc828('0x12')][_0xc828('0x14')]);return _0x227851(_0x125528[_0xc828('0x12')][_0xc828('0x14')]);}else{logger[_0xc828('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x16d648,_0xc828('0xf'));_0x227851(_0x125528[_0xc828('0x15')]['message']);}})['catch'](function(_0x407ccf){logger[_0xc828('0x12')](_0xc828('0xe'),_0x16d648,_0x407ccf);_0x472246(_0x407ccf);});});}exports['VerifyAdditionalPhones']=function(_0x3f2ee1){var _0x39dc17=this;return new Promise(function(_0x22f027,_0x1294f3){return db[_0xc828('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x3f2ee1[_0xc828('0x17')][_0xc828('0x18')],'ListId':_0x3f2ee1[_0xc828('0x17')][_0xc828('0x19')],'VoiceQueueId':_0x3f2ee1[_0xc828('0x17')][_0xc828('0x1a')]===undefined?null:_0x3f2ee1[_0xc828('0x17')][_0xc828('0x1a')],'CampaignId':_0x3f2ee1[_0xc828('0x17')][_0xc828('0x1b')]===undefined?null:_0x3f2ee1[_0xc828('0x17')][_0xc828('0x1b')]}})['then'](function(_0x432a18){if(_0x432a18!=null){return db[_0xc828('0x1c')][_0xc828('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x432a18['id'],'OrderBy':{'$gt':_0x432a18[_0xc828('0x1e')]}},'order':[['OrderBy',_0xc828('0x1f')]]})['then'](function(_0x245f7b){var _0x51c64b=0x0;if(_0x245f7b){if(_0x245f7b[_0xc828('0x20')]+_0x245f7b[_0xc828('0x21')]+_0x245f7b[_0xc828('0x22')]+_0x245f7b[_0xc828('0x23')]+_0x245f7b[_0xc828('0x24')]+_0x245f7b['countabandonedretry']+_0x245f7b[_0xc828('0x25')]+_0x245f7b['countagentrejectretry']<_0x3f2ee1[_0xc828('0x26')][_0xc828('0x27')])_0x51c64b=0x1;_0x22f027({'additional':_0x51c64b});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x432a18['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x375526){var _0x35f3dd=0x0;if(_0x375526){if(_0x375526[_0xc828('0x20')]+_0x375526['countcongestionretry']+_0x375526[_0xc828('0x22')]+_0x375526['countnosuchnumberretry']+_0x375526['countdropretry']+_0x375526[_0xc828('0x28')]+_0x375526[_0xc828('0x25')]+_0x375526[_0xc828('0x29')]<_0x3f2ee1['entity'][_0xc828('0x27')])_0x35f3dd=0x1;_0x22f027({'additional':_0x35f3dd});}else{_0x22f027({'additional':0x0});}})['catch'](function(_0x5ade94){logger['error'](_0xc828('0x2a'),_0x5ade94[_0xc828('0x14')]);_0x1294f3(_0x39dc17[_0xc828('0x12')](0x1f4,_0x5ade94[_0xc828('0x14')]));});}})[_0xc828('0x2b')](function(_0x4cf0d7){logger[_0xc828('0x12')](_0xc828('0x2a'),_0x4cf0d7[_0xc828('0x14')]);_0x1294f3(_0x39dc17[_0xc828('0x12')](0x1f4,_0x4cf0d7['message']));});}else _0x22f027({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x5de1f8){var _0x5bcd9c=this;return new Promise(function(_0x24c468,_0x252e02){return db[_0xc828('0x16')][_0xc828('0x1d')]({'raw':!![],'where':{'ContactId':_0x5de1f8[_0xc828('0x17')][_0xc828('0x18')],'ListId':_0x5de1f8[_0xc828('0x17')][_0xc828('0x19')],'VoiceQueueId':_0x5de1f8[_0xc828('0x17')][_0xc828('0x1a')]===undefined?null:_0x5de1f8[_0xc828('0x17')][_0xc828('0x1a')],'CampaignId':_0x5de1f8[_0xc828('0x17')][_0xc828('0x1b')]===undefined?null:_0x5de1f8[_0xc828('0x17')][_0xc828('0x1b')]}})[_0xc828('0xc')](function(_0xeab96d){if(_0xeab96d!=null){return db['CmHopperAdditionalPhone'][_0xc828('0x1d')]({'raw':!![],'where':{'CmHopperId':_0xeab96d['id'],'OrderBy':{'$gte':_0xeab96d[_0xc828('0x1e')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x55b040){if(_0x55b040)return activateAdditionalPhone(_0xeab96d,_0x5de1f8[_0xc828('0x17')],_0x55b040,_0x5de1f8[_0xc828('0x2c')],_0x5de1f8['waitTime'])[_0xc828('0xc')](function(_0x571c05){_0x24c468(_0x571c05);});else{return db[_0xc828('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xeab96d['id']},'order':[['OrderBy','ASC']]})[_0xc828('0xc')](function(_0x579f3e){if(_0x579f3e)return activateAdditionalPhone(_0xeab96d,_0x5de1f8['body'],_0x579f3e,_0x5de1f8[_0xc828('0x2c')],_0x5de1f8[_0xc828('0x2d')])[_0xc828('0xc')](function(_0x150233){_0x24c468(_0x150233);});else{_0x24c468({'id':_0xeab96d['id'],'phone':''});}})['catch'](function(_0xe22511){logger[_0xc828('0x12')]('VerifyAdditionalPhones',_0xe22511['message']);_0x252e02(_0x5bcd9c[_0xc828('0x12')](0x1f4,_0xe22511[_0xc828('0x14')]));});}})['catch'](function(_0x2e3275){logger[_0xc828('0x12')](_0xc828('0x2a'),_0x2e3275[_0xc828('0x14')]);_0x252e02(_0x5bcd9c['error'](0x1f4,_0x2e3275[_0xc828('0x14')]));});}else _0x24c468(0x1);});});};function activateAdditionalPhone(_0x54d5d4,_0x276f21,_0x1d5c12,_0x4a6471,_0x5e0644){return new Promise(function(_0x234f9f,_0x1ffd60){var _0x4978af;if(_['isNil'](_0x1d5c12[_0xc828('0x2e')])){_0x1d5c12[_0xc828('0x2e')]=moment();}if(moment()>moment(_0x1d5c12[_0xc828('0x2e')])){_0x4978af=moment()[_0xc828('0x2f')](_0x5e0644||0x3,_0xc828('0x30'));}else{if(_0x1d5c12[_0xc828('0x1e')]==0x0){_0x4978af=moment(_0x1d5c12['scheduledat']);}else{_0x4978af=moment()[_0xc828('0x2f')](_0x5e0644||0x3,_0xc828('0x30'));}}if(_['isNil'](_0x4978af)){_0x4978af=moment()[_0xc828('0x2f')](_0x5e0644||0x3,'minutes');}var _0x1c04b4={'phone':_0x54d5d4['phone'],'active':0x0,'OrderBy':_[_0xc828('0x31')](_0x54d5d4[_0xc828('0x1e')])?0x0:_0x54d5d4['OrderBy'],'scheduledat':moment()[_0xc828('0x2f')](_0x4a6471||0x1,_0xc828('0x30')),'countbusyretry':_0x276f21['countbusyretry'],'countcongestionretry':_0x276f21[_0xc828('0x21')],'countnoanswerretry':_0x276f21[_0xc828('0x22')],'countnosuchnumberretry':_0x276f21[_0xc828('0x23')],'countdropretry':_0x276f21[_0xc828('0x24')],'countabandonedretry':_0x276f21[_0xc828('0x28')],'countmachineretry':_0x276f21[_0xc828('0x25')],'countagentrejectretry':_0x276f21[_0xc828('0x29')],'createdAt':_0x276f21['createdAt'],'updatedAt':_0x276f21[_0xc828('0x32')]};var _0x19373a={'CmHopperId':_0x54d5d4['id'],'phone':_0x1d5c12['phone'],'active':0x0,'OrderBy':_[_0xc828('0x31')](_0x1d5c12[_0xc828('0x1e')])?0x0:_0x1d5c12[_0xc828('0x1e')],'scheduledat':_0x4978af,'countbusyretry':_0x1d5c12['countbusyretry'],'countcongestionretry':_0x1d5c12['countcongestionretry'],'countnoanswerretry':_0x1d5c12['countnoanswerretry'],'countnosuchnumberretry':_0x1d5c12['countnosuchnumberretry'],'countdropretry':_0x1d5c12[_0xc828('0x24')],'countabandonedretry':_0x1d5c12['countabandonedretry'],'countmachineretry':_0x1d5c12['countmachineretry'],'countagentrejectretry':_0x1d5c12['countagentrejectretry'],'createdAt':_0x1d5c12[_0xc828('0x33')],'updatedAt':_0x1d5c12[_0xc828('0x32')]};return db[_0xc828('0x34')]['transaction'](function(_0x307189){return db[_0xc828('0x1c')][_0xc828('0x35')](_0x1c04b4,{'where':{'id':_0x1d5c12['id']}},{'transaction':_0x307189})[_0xc828('0xc')](function(){return db[_0xc828('0x16')][_0xc828('0x35')](_0x19373a,{'where':{'id':_0x54d5d4['id']}},{'transaction':_0x307189});});})[_0xc828('0xc')](function(_0x1dfb92){_0x234f9f({'id':_0x54d5d4['id'],'phone':_0x1d5c12[_0xc828('0x36')]});})[_0xc828('0x2b')](function(_0x120892){logger[_0xc828('0x12')](_0xc828('0x37'),_0x120892[_0xc828('0x14')]);_0x1ffd60({'error':_0x120892[_0xc828('0x14')]});});});}exports[_0xc828('0x38')]=function(_0xbfa423){var _0x5268f1=this;return new Promise(function(_0x2bace3,_0x365e4a){return db['CmHopper'][_0xc828('0x35')](_0xbfa423[_0xc828('0x17')][_0xc828('0x39')],{'where':{'id':_0xbfa423['body']['id']}})['then'](function(_0x2ac47d){_0x2bace3(_0x2ac47d);})[_0xc828('0x2b')](function(_0x43b381){logger[_0xc828('0x12')](_0xc828('0x38'),_0x43b381[_0xc828('0x14')]);_0x365e4a(_0x5268f1[_0xc828('0x12')](0x1f4,_0x43b381[_0xc828('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index a2ea9a6..8456484 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x645d=['express','Router','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x17ae6d,_0x2fd339){var _0x17924d=function(_0x1a711a){while(--_0x1a711a){_0x17ae6d['push'](_0x17ae6d['shift']());}};_0x17924d(++_0x2fd339);}(_0x645d,0x6e));var _0xd645=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x645d[_0x2bf1d6];return _0x1be08a;};'use strict';var multer=require(_0xd645('0x0'));var util=require(_0xd645('0x1'));var path=require(_0xd645('0x2'));var timeout=require(_0xd645('0x3'));var express=require(_0xd645('0x4'));var router=express[_0xd645('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd645('0x7'));var controller=require(_0xd645('0x8'));router[_0xd645('0x9')]('/',auth[_0xd645('0xa')](),controller[_0xd645('0xb')]);router[_0xd645('0x9')](_0xd645('0xc'),auth['isAuthenticated'](),controller[_0xd645('0xd')]);router[_0xd645('0xe')]('/',auth[_0xd645('0xa')](),controller[_0xd645('0xf')]);router[_0xd645('0x10')]('/:id',auth[_0xd645('0xa')](),controller['update']);router[_0xd645('0x11')](_0xd645('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd645('0x12')]=router; \ No newline at end of file +var _0xf263=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','exports','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf263,0x141));var _0x3f26=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0xf263[_0x44ae0b];return _0x69232a;};'use strict';var multer=require(_0x3f26('0x0'));var util=require('util');var path=require(_0x3f26('0x1'));var timeout=require(_0x3f26('0x2'));var express=require(_0x3f26('0x3'));var router=express[_0x3f26('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f26('0x5'));var interaction=require(_0x3f26('0x6'));var config=require(_0x3f26('0x7'));var controller=require(_0x3f26('0x8'));router['get']('/',auth[_0x3f26('0x9')](),controller[_0x3f26('0xa')]);router[_0x3f26('0xb')]('/:id',auth[_0x3f26('0x9')](),controller[_0x3f26('0xc')]);router[_0x3f26('0xd')]('/',auth[_0x3f26('0x9')](),controller[_0x3f26('0xe')]);router[_0x3f26('0xf')](_0x3f26('0x10'),auth[_0x3f26('0x9')](),controller['update']);router[_0x3f26('0x11')](_0x3f26('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3f26('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0b44e66..8cc1e06 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 _0xc15b=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x2fad66,_0xd12863){var _0x476505=function(_0x56badf){while(--_0x56badf){_0x2fad66['push'](_0x2fad66['shift']());}};_0x476505(++_0xd12863);}(_0xc15b,0xe4));var _0xbc15=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xc15b[_0x2ae2ad];return _0x26dbd7;};'use strict';var moment=require(_0xbc15('0x0'));var Sequelize=require('sequelize');module[_0xbc15('0x1')]={'phone':{'type':Sequelize[_0xbc15('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xbc15('0x3')],'unique':_0xbc15('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xbc15('0x3')],'unique':_0xbc15('0x4')}}; \ No newline at end of file +var _0x83f7=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x83f7,0x84));var _0x783f=function(_0x1e7565,_0x5c0f3a){_0x1e7565=_0x1e7565-0x0;var _0x5cc1d6=_0x83f7[_0x1e7565];return _0x5cc1d6;};'use strict';var moment=require(_0x783f('0x0'));var Sequelize=require(_0x783f('0x1'));module[_0x783f('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x783f('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x783f('0x4')},'VoiceQueueId':{'type':Sequelize[_0x783f('0x3')],'unique':_0x783f('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index bd6d5f8..0478efe 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 _0x2dad=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperBlack','then','includeAll','include','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty'];(function(_0x5510c4,_0x9d3037){var _0x111d8f=function(_0x328f3f){while(--_0x328f3f){_0x5510c4['push'](_0x5510c4['shift']());}};_0x111d8f(++_0x9d3037);}(_0x2dad,0x1cf));var _0xd2da=function(_0x5aea34,_0x1925a3){_0x5aea34=_0x5aea34-0x0;var _0x27ce80=_0x2dad[_0x5aea34];return _0x27ce80;};'use strict';var emlformat=require(_0xd2da('0x0'));var rimraf=require(_0xd2da('0x1'));var zipdir=require(_0xd2da('0x2'));var jsonpatch=require(_0xd2da('0x3'));var rp=require(_0xd2da('0x4'));var moment=require(_0xd2da('0x5'));var BPromise=require(_0xd2da('0x6'));var Mustache=require(_0xd2da('0x7'));var util=require(_0xd2da('0x8'));var path=require(_0xd2da('0x9'));var sox=require('sox');var csv=require(_0xd2da('0xa'));var ejs=require(_0xd2da('0xb'));var fs=require('fs');var fs_extra=require(_0xd2da('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd2da('0xd'));var jsforce=require(_0xd2da('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd2da('0xa'));var querystring=require(_0xd2da('0xf'));var Papa=require(_0xd2da('0x10'));var Redis=require(_0xd2da('0x11'));var authService=require(_0xd2da('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd2da('0x13'));var hardwareService=require(_0xd2da('0x14'));var logger=require(_0xd2da('0x15'))(_0xd2da('0x16'));var utils=require(_0xd2da('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd2da('0x18'))['db'];function respondWithStatusCode(_0x4d3e63,_0x18087e){_0x18087e=_0x18087e||0xcc;return function(_0x53d05e){if(_0x53d05e){return _0x4d3e63[_0xd2da('0x19')](_0x18087e);}return _0x4d3e63[_0xd2da('0x1a')](_0x18087e)[_0xd2da('0x1b')]();};}function respondWithResult(_0xa3d204,_0x5ef94b){_0x5ef94b=_0x5ef94b||0xc8;return function(_0xacf44){if(_0xacf44){return _0xa3d204['status'](_0x5ef94b)[_0xd2da('0x1c')](_0xacf44);}};}function respondWithFilteredResult(_0x32408e,_0x2d1334){return function(_0x265e76){if(_0x265e76){var _0x2a5932=typeof _0x2d1334['offset']===_0xd2da('0x1d')&&typeof _0x2d1334[_0xd2da('0x1e')]==='undefined';var _0x179814=_0x265e76[_0xd2da('0x1f')];var _0x3fc188=_0x2a5932?0x0:_0x2d1334[_0xd2da('0x20')];var _0x56e049=_0x2a5932?_0x265e76[_0xd2da('0x1f')]:_0x2d1334[_0xd2da('0x20')]+_0x2d1334[_0xd2da('0x1e')];var _0x22124a;if(_0x56e049>=_0x179814){_0x56e049=_0x179814;_0x22124a=0xc8;}else{_0x22124a=0xce;}_0x32408e[_0xd2da('0x1a')](_0x22124a);return _0x32408e[_0xd2da('0x21')](_0xd2da('0x22'),_0x3fc188+'-'+_0x56e049+'/'+_0x179814)[_0xd2da('0x1c')](_0x265e76);}return null;};}function patchUpdates(_0xf6e421){return function(_0x188ee1){try{jsonpatch[_0xd2da('0x23')](_0x188ee1,_0xf6e421,!![]);}catch(_0xa37e78){return BPromise['reject'](_0xa37e78);}return _0x188ee1['save']();};}function saveUpdates(_0x1f5398,_0x35da29){return function(_0x5889eb){if(_0x5889eb){return _0x5889eb[_0xd2da('0x24')](_0x1f5398)['then'](function(_0x575d17){return _0x575d17;});}return null;};}function removeEntity(_0xb0ea3,_0x5f016d){return function(_0x5bbcfd){if(_0x5bbcfd){return _0x5bbcfd[_0xd2da('0x25')]()['then'](function(){_0xb0ea3[_0xd2da('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d6c8,_0x5c6a1d){return function(_0x8947da){if(!_0x8947da){_0x51d6c8[_0xd2da('0x19')](0x194);}return _0x8947da;};}function handleError(_0x73cc2e,_0x50797d){_0x50797d=_0x50797d||0x1f4;return function(_0x57f743){logger['error'](_0x57f743[_0xd2da('0x26')]);if(_0x57f743[_0xd2da('0x27')]){delete _0x57f743[_0xd2da('0x27')];}_0x73cc2e[_0xd2da('0x1a')](_0x50797d)[_0xd2da('0x28')](_0x57f743);};}exports[_0xd2da('0x29')]=function(_0xdaf898,_0x4932c7){var _0x411510={},_0x45d8c1={},_0x36408d={'count':0x0,'rows':[]};var _0x2a673d=_[_0xd2da('0x2a')](db['CmHopperBlack'][_0xd2da('0x2b')],function(_0x44cbf3){return{'name':_0x44cbf3['fieldName'],'type':_0x44cbf3[_0xd2da('0x2c')][_0xd2da('0x2d')]};});_0x45d8c1[_0xd2da('0x2e')]=_[_0xd2da('0x2a')](_0x2a673d,'name');_0x45d8c1['query']=_[_0xd2da('0x2f')](_0xdaf898['query']);_0x45d8c1[_0xd2da('0x30')]=_[_0xd2da('0x31')](_0x45d8c1[_0xd2da('0x2e')],_0x45d8c1[_0xd2da('0x32')]);_0x411510[_0xd2da('0x33')]=_[_0xd2da('0x31')](_0x45d8c1['model'],qs[_0xd2da('0x34')](_0xdaf898[_0xd2da('0x32')][_0xd2da('0x34')]));_0x411510['attributes']=_0x411510['attributes'][_0xd2da('0x35')]?_0x411510['attributes']:_0x45d8c1[_0xd2da('0x2e')];if(!_0xdaf898['query'][_0xd2da('0x36')](_0xd2da('0x37'))){_0x411510[_0xd2da('0x1e')]=qs[_0xd2da('0x1e')](_0xdaf898[_0xd2da('0x32')]['limit']);_0x411510[_0xd2da('0x20')]=qs[_0xd2da('0x20')](_0xdaf898[_0xd2da('0x32')][_0xd2da('0x20')]);}_0x411510[_0xd2da('0x38')]=qs['sort'](_0xdaf898[_0xd2da('0x32')][_0xd2da('0x39')]);_0x411510[_0xd2da('0x3a')]=qs[_0xd2da('0x30')](_[_0xd2da('0x3b')](_0xdaf898[_0xd2da('0x32')],_0x45d8c1[_0xd2da('0x30')]),_0x2a673d);if(_0xdaf898[_0xd2da('0x32')][_0xd2da('0x3c')]){_0x411510['where']=_['merge'](_0x411510[_0xd2da('0x3a')],{'$or':_[_0xd2da('0x2a')](_0x2a673d,function(_0x45b293){if(_0x45b293[_0xd2da('0x2c')]!==_0xd2da('0x3d')){var _0x1cfceb={};_0x1cfceb[_0x45b293[_0xd2da('0x27')]]={'$like':'%'+_0xdaf898['query'][_0xd2da('0x3c')]+'%'};return _0x1cfceb;}})});}_0x411510=_[_0xd2da('0x3e')]({},_0x411510,_0xdaf898[_0xd2da('0x3f')]);var _0x37fce6={'where':_0x411510[_0xd2da('0x3a')]};return db[_0xd2da('0x40')][_0xd2da('0x1f')](_0x37fce6)[_0xd2da('0x41')](function(_0x4f07c5){_0x36408d[_0xd2da('0x1f')]=_0x4f07c5;if(_0xdaf898[_0xd2da('0x32')][_0xd2da('0x42')]){_0x411510[_0xd2da('0x43')]=[{'all':!![]}];}return db[_0xd2da('0x40')]['findAll'](_0x411510);})[_0xd2da('0x41')](function(_0x1d5bf4){_0x36408d['rows']=_0x1d5bf4;return _0x36408d;})[_0xd2da('0x41')](respondWithFilteredResult(_0x4932c7,_0x411510))[_0xd2da('0x44')](handleError(_0x4932c7,null));};exports[_0xd2da('0x45')]=function(_0x54eba9,_0x4b9d18){var _0x1631f1={'raw':!![],'where':{'id':_0x54eba9['params']['id']}},_0x37fb7f={};_0x37fb7f['model']=_['keys'](db['CmHopperBlack'][_0xd2da('0x2b')]);_0x37fb7f[_0xd2da('0x32')]=_[_0xd2da('0x2f')](_0x54eba9['query']);_0x37fb7f[_0xd2da('0x30')]=_[_0xd2da('0x31')](_0x37fb7f[_0xd2da('0x2e')],_0x37fb7f[_0xd2da('0x32')]);_0x1631f1[_0xd2da('0x33')]=_['intersection'](_0x37fb7f['model'],qs[_0xd2da('0x34')](_0x54eba9['query'][_0xd2da('0x34')]));_0x1631f1[_0xd2da('0x33')]=_0x1631f1[_0xd2da('0x33')]['length']?_0x1631f1[_0xd2da('0x33')]:_0x37fb7f[_0xd2da('0x2e')];if(_0x54eba9[_0xd2da('0x32')][_0xd2da('0x42')]){_0x1631f1[_0xd2da('0x43')]=[{'all':!![]}];}_0x1631f1=_[_0xd2da('0x3e')]({},_0x1631f1,_0x54eba9[_0xd2da('0x3f')]);return db[_0xd2da('0x40')][_0xd2da('0x46')](_0x1631f1)[_0xd2da('0x41')](handleEntityNotFound(_0x4b9d18,null))['then'](respondWithResult(_0x4b9d18,null))[_0xd2da('0x44')](handleError(_0x4b9d18,null));};exports[_0xd2da('0x24')]=function(_0x214124,_0x76150){if(_0x214124['body']['id']){delete _0x214124[_0xd2da('0x47')]['id'];}return db[_0xd2da('0x40')][_0xd2da('0x46')]({'where':{'id':_0x214124['params']['id']}})[_0xd2da('0x41')](handleEntityNotFound(_0x76150,null))[_0xd2da('0x41')](saveUpdates(_0x214124['body'],null))[_0xd2da('0x41')](respondWithResult(_0x76150,null))[_0xd2da('0x44')](handleError(_0x76150,null));};exports[_0xd2da('0x25')]=function(_0x3ff677,_0x2944bf){return db[_0xd2da('0x40')][_0xd2da('0x46')]({'where':{'id':_0x3ff677[_0xd2da('0x48')]['id']}})[_0xd2da('0x41')](handleEntityNotFound(_0x2944bf,null))[_0xd2da('0x41')](removeEntity(_0x2944bf,null))[_0xd2da('0x44')](handleError(_0x2944bf,null));};exports['describe']=function(_0x328eb8,_0xe80864){return db[_0xd2da('0x40')][_0xd2da('0x49')]()[_0xd2da('0x41')](respondWithResult(_0xe80864,null))[_0xd2da('0x44')](handleError(_0xe80864,null));}; \ No newline at end of file +var _0xc4b3=['merge','map','name','options','where','include','findAll','rows','catch','keys','rawAttributes','length','includeAll','find','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','send','index','CmHopperBlack','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xc4b3,0x179));var _0x3c4b=function(_0x2d9c60,_0x166110){_0x2d9c60=_0x2d9c60-0x0;var _0x4d33e0=_0xc4b3[_0x2d9c60];return _0x4d33e0;};'use strict';var emlformat=require(_0x3c4b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c4b('0x1'));var rp=require(_0x3c4b('0x2'));var moment=require(_0x3c4b('0x3'));var BPromise=require(_0x3c4b('0x4'));var Mustache=require('mustache');var util=require(_0x3c4b('0x5'));var path=require('path');var sox=require(_0x3c4b('0x6'));var csv=require(_0x3c4b('0x7'));var ejs=require(_0x3c4b('0x8'));var fs=require('fs');var fs_extra=require(_0x3c4b('0x9'));var _=require(_0x3c4b('0xa'));var squel=require(_0x3c4b('0xb'));var crypto=require(_0x3c4b('0xc'));var jsforce=require(_0x3c4b('0xd'));var deskjs=require(_0x3c4b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c4b('0xf'));var Papa=require(_0x3c4b('0x10'));var Redis=require(_0x3c4b('0x11'));var authService=require(_0x3c4b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c4b('0x13'));var logger=require(_0x3c4b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3c4b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42000c,_0x4d635d){_0x4d635d=_0x4d635d||0xcc;return function(_0x3e9d1d){if(_0x3e9d1d){return _0x42000c[_0x3c4b('0x16')](_0x4d635d);}return _0x42000c[_0x3c4b('0x17')](_0x4d635d)['end']();};}function respondWithResult(_0x1a9e48,_0x19e5a6){_0x19e5a6=_0x19e5a6||0xc8;return function(_0xd685ee){if(_0xd685ee){return _0x1a9e48[_0x3c4b('0x17')](_0x19e5a6)[_0x3c4b('0x18')](_0xd685ee);}};}function respondWithFilteredResult(_0x33039b,_0x54dd17){return function(_0x363438){if(_0x363438){var _0x18f283=typeof _0x54dd17['offset']===_0x3c4b('0x19')&&typeof _0x54dd17['limit']===_0x3c4b('0x19');var _0x5330f3=_0x363438['count'];var _0x56b786=_0x18f283?0x0:_0x54dd17[_0x3c4b('0x1a')];var _0x243fc5=_0x18f283?_0x363438[_0x3c4b('0x1b')]:_0x54dd17[_0x3c4b('0x1a')]+_0x54dd17[_0x3c4b('0x1c')];var _0x471e48;if(_0x243fc5>=_0x5330f3){_0x243fc5=_0x5330f3;_0x471e48=0xc8;}else{_0x471e48=0xce;}_0x33039b[_0x3c4b('0x17')](_0x471e48);return _0x33039b[_0x3c4b('0x1d')](_0x3c4b('0x1e'),_0x56b786+'-'+_0x243fc5+'/'+_0x5330f3)[_0x3c4b('0x18')](_0x363438);}return null;};}function patchUpdates(_0x2f32f7){return function(_0x19a5be){try{jsonpatch[_0x3c4b('0x1f')](_0x19a5be,_0x2f32f7,!![]);}catch(_0x5d4d5d){return BPromise[_0x3c4b('0x20')](_0x5d4d5d);}return _0x19a5be[_0x3c4b('0x21')]();};}function saveUpdates(_0x55a78b,_0x191e7a){return function(_0x2e5a94){if(_0x2e5a94){return _0x2e5a94[_0x3c4b('0x22')](_0x55a78b)['then'](function(_0x285b10){return _0x285b10;});}return null;};}function removeEntity(_0x46e1c6,_0x337392){return function(_0x5ae128){if(_0x5ae128){return _0x5ae128[_0x3c4b('0x23')]()[_0x3c4b('0x24')](function(){_0x46e1c6[_0x3c4b('0x17')](0xcc)[_0x3c4b('0x25')]();});}};}function handleEntityNotFound(_0x5371bd,_0x42f186){return function(_0x2b8aac){if(!_0x2b8aac){_0x5371bd[_0x3c4b('0x16')](0x194);}return _0x2b8aac;};}function handleError(_0x4fb975,_0x38fc8d){_0x38fc8d=_0x38fc8d||0x1f4;return function(_0x3f6e7a){logger[_0x3c4b('0x26')](_0x3f6e7a['stack']);if(_0x3f6e7a['name']){delete _0x3f6e7a['name'];}_0x4fb975['status'](_0x38fc8d)[_0x3c4b('0x27')](_0x3f6e7a);};}exports[_0x3c4b('0x28')]=function(_0x1056d0,_0x13cfd8){var _0x486c81={},_0x536cd5={},_0x376183={'count':0x0,'rows':[]};var _0x39c5a7=_['map'](db[_0x3c4b('0x29')]['rawAttributes'],function(_0x28e9f5){return{'name':_0x28e9f5['fieldName'],'type':_0x28e9f5[_0x3c4b('0x2a')][_0x3c4b('0x2b')]};});_0x536cd5[_0x3c4b('0x2c')]=_['map'](_0x39c5a7,'name');_0x536cd5['query']=_['keys'](_0x1056d0[_0x3c4b('0x2d')]);_0x536cd5[_0x3c4b('0x2e')]=_[_0x3c4b('0x2f')](_0x536cd5[_0x3c4b('0x2c')],_0x536cd5[_0x3c4b('0x2d')]);_0x486c81[_0x3c4b('0x30')]=_[_0x3c4b('0x2f')](_0x536cd5[_0x3c4b('0x2c')],qs[_0x3c4b('0x31')](_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x31')]));_0x486c81[_0x3c4b('0x30')]=_0x486c81[_0x3c4b('0x30')]['length']?_0x486c81[_0x3c4b('0x30')]:_0x536cd5[_0x3c4b('0x2c')];if(!_0x1056d0['query'][_0x3c4b('0x32')](_0x3c4b('0x33'))){_0x486c81[_0x3c4b('0x1c')]=qs[_0x3c4b('0x1c')](_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x1c')]);_0x486c81[_0x3c4b('0x1a')]=qs['offset'](_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x1a')]);}_0x486c81[_0x3c4b('0x34')]=qs[_0x3c4b('0x35')](_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x35')]);_0x486c81['where']=qs[_0x3c4b('0x2e')](_['pick'](_0x1056d0[_0x3c4b('0x2d')],_0x536cd5[_0x3c4b('0x2e')]),_0x39c5a7);if(_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x36')]){_0x486c81['where']=_[_0x3c4b('0x37')](_0x486c81['where'],{'$or':_[_0x3c4b('0x38')](_0x39c5a7,function(_0xdbcb33){if(_0xdbcb33['type']!=='VIRTUAL'){var _0x3c3a83={};_0x3c3a83[_0xdbcb33[_0x3c4b('0x39')]]={'$like':'%'+_0x1056d0[_0x3c4b('0x2d')][_0x3c4b('0x36')]+'%'};return _0x3c3a83;}})});}_0x486c81=_[_0x3c4b('0x37')]({},_0x486c81,_0x1056d0[_0x3c4b('0x3a')]);var _0x54b4a1={'where':_0x486c81[_0x3c4b('0x3b')]};return db['CmHopperBlack'][_0x3c4b('0x1b')](_0x54b4a1)[_0x3c4b('0x24')](function(_0x5479d5){_0x376183[_0x3c4b('0x1b')]=_0x5479d5;if(_0x1056d0[_0x3c4b('0x2d')]['includeAll']){_0x486c81[_0x3c4b('0x3c')]=[{'all':!![]}];}return db[_0x3c4b('0x29')][_0x3c4b('0x3d')](_0x486c81);})[_0x3c4b('0x24')](function(_0x18ecd3){_0x376183[_0x3c4b('0x3e')]=_0x18ecd3;return _0x376183;})[_0x3c4b('0x24')](respondWithFilteredResult(_0x13cfd8,_0x486c81))[_0x3c4b('0x3f')](handleError(_0x13cfd8,null));};exports['show']=function(_0x512bef,_0x44bb91){var _0x1d5ef8={'raw':!![],'where':{'id':_0x512bef['params']['id']}},_0x462b3a={};_0x462b3a[_0x3c4b('0x2c')]=_[_0x3c4b('0x40')](db['CmHopperBlack'][_0x3c4b('0x41')]);_0x462b3a[_0x3c4b('0x2d')]=_[_0x3c4b('0x40')](_0x512bef[_0x3c4b('0x2d')]);_0x462b3a[_0x3c4b('0x2e')]=_[_0x3c4b('0x2f')](_0x462b3a[_0x3c4b('0x2c')],_0x462b3a[_0x3c4b('0x2d')]);_0x1d5ef8[_0x3c4b('0x30')]=_[_0x3c4b('0x2f')](_0x462b3a[_0x3c4b('0x2c')],qs[_0x3c4b('0x31')](_0x512bef[_0x3c4b('0x2d')]['fields']));_0x1d5ef8[_0x3c4b('0x30')]=_0x1d5ef8[_0x3c4b('0x30')][_0x3c4b('0x42')]?_0x1d5ef8[_0x3c4b('0x30')]:_0x462b3a[_0x3c4b('0x2c')];if(_0x512bef[_0x3c4b('0x2d')][_0x3c4b('0x43')]){_0x1d5ef8[_0x3c4b('0x3c')]=[{'all':!![]}];}_0x1d5ef8=_[_0x3c4b('0x37')]({},_0x1d5ef8,_0x512bef[_0x3c4b('0x3a')]);return db[_0x3c4b('0x29')][_0x3c4b('0x44')](_0x1d5ef8)[_0x3c4b('0x24')](handleEntityNotFound(_0x44bb91,null))[_0x3c4b('0x24')](respondWithResult(_0x44bb91,null))[_0x3c4b('0x3f')](handleError(_0x44bb91,null));};exports[_0x3c4b('0x22')]=function(_0x4ade73,_0x771e6a){if(_0x4ade73[_0x3c4b('0x45')]['id']){delete _0x4ade73['body']['id'];}return db[_0x3c4b('0x29')][_0x3c4b('0x44')]({'where':{'id':_0x4ade73[_0x3c4b('0x46')]['id']}})[_0x3c4b('0x24')](handleEntityNotFound(_0x771e6a,null))[_0x3c4b('0x24')](saveUpdates(_0x4ade73[_0x3c4b('0x45')],null))[_0x3c4b('0x24')](respondWithResult(_0x771e6a,null))[_0x3c4b('0x3f')](handleError(_0x771e6a,null));};exports['destroy']=function(_0x1aef13,_0x3b26f6){return db[_0x3c4b('0x29')][_0x3c4b('0x44')]({'where':{'id':_0x1aef13[_0x3c4b('0x46')]['id']}})[_0x3c4b('0x24')](handleEntityNotFound(_0x3b26f6,null))[_0x3c4b('0x24')](removeEntity(_0x3b26f6,null))[_0x3c4b('0x3f')](handleError(_0x3b26f6,null));};exports[_0x3c4b('0x47')]=function(_0xb165d4,_0x5e6044){return db['CmHopperBlack']['describe']()[_0x3c4b('0x24')](respondWithResult(_0x5e6044,null))[_0x3c4b('0x3f')](handleError(_0x5e6044,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9e403ff..911ce7e 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 _0xbcc0=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','lodash','util','api','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbcc0,0x177));var _0x0bcc=function(_0x1d8e0d,_0x2f2553){_0x1d8e0d=_0x1d8e0d-0x0;var _0x58d175=_0xbcc0[_0x1d8e0d];return _0x58d175;};'use strict';var _=require(_0x0bcc('0x0'));var util=require(_0x0bcc('0x1'));var logger=require('../../config/logger')(_0x0bcc('0x2'));var moment=require('moment');var BPromise=require(_0x0bcc('0x3'));var rp=require(_0x0bcc('0x4'));var fs=require('fs');var path=require(_0x0bcc('0x5'));var rimraf=require(_0x0bcc('0x6'));var config=require(_0x0bcc('0x7'));var attributes=require(_0x0bcc('0x8'));module[_0x0bcc('0x9')]=function(_0x861e1a,_0x790614){return _0x861e1a['define']('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ec8=['path','rimraf','../../config/environment','exports','define','CmHopperBlack','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5065b6,_0x35f46a){var _0x244227=function(_0x30f3b4){while(--_0x30f3b4){_0x5065b6['push'](_0x5065b6['shift']());}};_0x244227(++_0x35f46a);}(_0x8ec8,0x8a));var _0x88ec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8ec8[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x88ec('0x0'));var util=require('util');var logger=require(_0x88ec('0x1'))(_0x88ec('0x2'));var moment=require('moment');var BPromise=require(_0x88ec('0x3'));var rp=require(_0x88ec('0x4'));var fs=require('fs');var path=require(_0x88ec('0x5'));var rimraf=require(_0x88ec('0x6'));var config=require(_0x88ec('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x88ec('0x8')]=function(_0x4c6426,_0x27d313){return _0x4c6426[_0x88ec('0x9')](_0x88ec('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index cb8e359..95ffc19 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 _0xc5bf=['destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0xc5bf,0x10b));var _0xfc5b=function(_0x557742,_0x25ea92){_0x557742=_0x557742-0x0;var _0x164aea=_0xc5bf[_0x557742];return _0x164aea;};'use strict';var _=require(_0xfc5b('0x0'));var util=require(_0xfc5b('0x1'));var moment=require(_0xfc5b('0x2'));var BPromise=require(_0xfc5b('0x3'));var rs=require(_0xfc5b('0x4'));var fs=require('fs');var Redis=require(_0xfc5b('0x5'));var db=require(_0xfc5b('0x6'))['db'];var utils=require(_0xfc5b('0x7'));var logger=require('../../config/logger')(_0xfc5b('0x8'));var config=require(_0xfc5b('0x9'));var jayson=require(_0xfc5b('0xa'));var client=jayson[_0xfc5b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9c1af2,_0x69eaf8,_0x2f9b2f){return new BPromise(function(_0x2f5fe5,_0x26928c){return client['request'](_0x9c1af2,_0x2f9b2f)[_0xfc5b('0xc')](function(_0x3441f9){logger[_0xfc5b('0xd')](_0xfc5b('0xe'),_0x69eaf8,_0xfc5b('0xf'));logger[_0xfc5b('0x10')](_0xfc5b('0x11'),_0x69eaf8,_0xfc5b('0xf'),JSON[_0xfc5b('0x12')](_0x3441f9));if(_0x3441f9['error']){if(_0x3441f9[_0xfc5b('0x13')][_0xfc5b('0x14')]===0x1f4){logger[_0xfc5b('0x13')](_0xfc5b('0xe'),_0x69eaf8,_0x3441f9['error'][_0xfc5b('0x15')]);return _0x26928c(_0x3441f9[_0xfc5b('0x13')]['message']);}logger[_0xfc5b('0x13')](_0xfc5b('0xe'),_0x69eaf8,_0x3441f9['error'][_0xfc5b('0x15')]);return _0x2f5fe5(_0x3441f9[_0xfc5b('0x13')][_0xfc5b('0x15')]);}else{logger[_0xfc5b('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x69eaf8,_0xfc5b('0xf'));_0x2f5fe5(_0x3441f9[_0xfc5b('0x16')][_0xfc5b('0x15')]);}})[_0xfc5b('0x17')](function(_0x4805c1){logger[_0xfc5b('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x69eaf8,_0x4805c1);_0x26928c(_0x4805c1);});});}exports[_0xfc5b('0x18')]=function(_0x3f5b14){var _0x234cfc=this;return new Promise(function(_0x2ff5b2,_0x1ba339){return db[_0xfc5b('0x19')]['findAll']({'raw':_0x3f5b14[_0xfc5b('0x1a')]?_0x3f5b14['options'][_0xfc5b('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f5b14[_0xfc5b('0x1a')]?_0x3f5b14[_0xfc5b('0x1a')][_0xfc5b('0x1c')]||null:null,'attributes':_0x3f5b14[_0xfc5b('0x1a')]?_0x3f5b14[_0xfc5b('0x1a')][_0xfc5b('0x1d')]||null:null,'limit':_0x3f5b14[_0xfc5b('0x1a')]?_0x3f5b14['options'][_0xfc5b('0x1e')]||null:null,'include':_0x3f5b14[_0xfc5b('0x1a')]?_0x3f5b14[_0xfc5b('0x1a')][_0xfc5b('0x1f')]?_[_0xfc5b('0x20')](_0x3f5b14[_0xfc5b('0x1a')][_0xfc5b('0x1f')],function(_0x5dd207){return{'model':db[_0x5dd207['model']],'as':_0x5dd207['as'],'attributes':_0x5dd207[_0xfc5b('0x1d')],'include':_0x5dd207[_0xfc5b('0x1f')]?_[_0xfc5b('0x20')](_0x5dd207['include'],function(_0x483d5f){return{'model':db[_0x483d5f['model']],'as':_0x483d5f['as'],'attributes':_0x483d5f[_0xfc5b('0x1d')],'include':_0x483d5f['include']?_[_0xfc5b('0x20')](_0x483d5f['include'],function(_0x39ac50){return{'model':db[_0x39ac50['model']],'as':_0x39ac50['as'],'attributes':_0x39ac50[_0xfc5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfc5b('0xc')](function(_0x272b7b){logger[_0xfc5b('0xd')](_0xfc5b('0x18'),_0x3f5b14);logger[_0xfc5b('0x10')](_0xfc5b('0x18'),_0x3f5b14,JSON[_0xfc5b('0x12')](_0x272b7b));_0x2ff5b2(_0x272b7b);})['catch'](function(_0x5df509){logger['error'](_0xfc5b('0x18'),_0x5df509[_0xfc5b('0x15')],_0x3f5b14);_0x1ba339(_0x234cfc[_0xfc5b('0x13')](0x1f4,_0x5df509[_0xfc5b('0x15')]));});});};exports[_0xfc5b('0x21')]=function(_0x1657d3){var _0x3ac91a=this;return new Promise(function(_0x2535bf,_0x3aa9ca){return db[_0xfc5b('0x19')][_0xfc5b('0x22')](_0x1657d3[_0xfc5b('0x23')],{'raw':_0x1657d3[_0xfc5b('0x1a')]?_0x1657d3[_0xfc5b('0x1a')][_0xfc5b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1657d3[_0xfc5b('0x1a')]?_0x1657d3[_0xfc5b('0x1a')][_0xfc5b('0x1c')]||null:null,'attributes':_0x1657d3['options']?_0x1657d3[_0xfc5b('0x1a')][_0xfc5b('0x1d')]||null:null,'limit':_0x1657d3[_0xfc5b('0x1a')]?_0x1657d3['options']['limit']||null:null})[_0xfc5b('0xc')](function(_0x26f3cd){logger[_0xfc5b('0xd')]('UpdateCmHopperBlack',_0x1657d3);logger[_0xfc5b('0x10')](_0xfc5b('0x21'),_0x1657d3,JSON[_0xfc5b('0x12')](_0x26f3cd));_0x2535bf(_0x26f3cd);})['catch'](function(_0x3da845){logger['error'](_0xfc5b('0x21'),_0x3da845[_0xfc5b('0x15')],_0x1657d3);_0x3aa9ca(_0x3ac91a[_0xfc5b('0x13')](0x1f4,_0x3da845['message']));});});};exports[_0xfc5b('0x24')]=function(_0x33189f){var _0x5dc110=this;return new Promise(function(_0xde9fa6,_0x255165){return db['CmHopperBlack'][_0xfc5b('0x25')]({'where':_0x33189f[_0xfc5b('0x1a')]?_0x33189f[_0xfc5b('0x1a')][_0xfc5b('0x1c')]||null:null})[_0xfc5b('0xc')](function(_0x378617){logger[_0xfc5b('0xd')](_0xfc5b('0x24'),_0x33189f);logger[_0xfc5b('0x10')](_0xfc5b('0x24'),_0x33189f,JSON['stringify'](_0x378617));_0xde9fa6(_0x378617);})[_0xfc5b('0x17')](function(_0x4b52d3){logger[_0xfc5b('0x13')]('DestroyCmHopperBlack',_0x4b52d3[_0xfc5b('0x15')],_0x33189f);_0x255165(_0x5dc110[_0xfc5b('0x13')](0x1f4,_0x4b52d3['message']));});});}; \ No newline at end of file +var _0x5611=['attributes','GetCmHopperBlack','stringify','catch','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','destroy','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','findAll','options','limit','include','map','model'];(function(_0x3ace04,_0x2e2afb){var _0x51ffea=function(_0x29a8f){while(--_0x29a8f){_0x3ace04['push'](_0x3ace04['shift']());}};_0x51ffea(++_0x2e2afb);}(_0x5611,0x106));var _0x1561=function(_0x261da8,_0x469e93){_0x261da8=_0x261da8-0x0;var _0x13fddc=_0x5611[_0x261da8];return _0x13fddc;};'use strict';var _=require(_0x1561('0x0'));var util=require(_0x1561('0x1'));var moment=require(_0x1561('0x2'));var BPromise=require(_0x1561('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1561('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1561('0x5'));var logger=require(_0x1561('0x6'))(_0x1561('0x7'));var config=require(_0x1561('0x8'));var jayson=require(_0x1561('0x9'));var client=jayson['client'][_0x1561('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49771b,_0x249c1b,_0x36d454){return new BPromise(function(_0x148953,_0x25bc7a){return client['request'](_0x49771b,_0x36d454)[_0x1561('0xb')](function(_0x16c74f){logger[_0x1561('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x249c1b,_0x1561('0xd'));logger[_0x1561('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x249c1b,'request\x20sent',JSON['stringify'](_0x16c74f));if(_0x16c74f['error']){if(_0x16c74f[_0x1561('0xf')][_0x1561('0x10')]===0x1f4){logger[_0x1561('0xf')](_0x1561('0x11'),_0x249c1b,_0x16c74f[_0x1561('0xf')]['message']);return _0x25bc7a(_0x16c74f['error'][_0x1561('0x12')]);}logger[_0x1561('0xf')](_0x1561('0x11'),_0x249c1b,_0x16c74f['error'][_0x1561('0x12')]);return _0x148953(_0x16c74f[_0x1561('0xf')]['message']);}else{logger['info'](_0x1561('0x11'),_0x249c1b,'request\x20sent');_0x148953(_0x16c74f[_0x1561('0x13')][_0x1561('0x12')]);}})['catch'](function(_0x44fd70){logger[_0x1561('0xf')](_0x1561('0x11'),_0x249c1b,_0x44fd70);_0x25bc7a(_0x44fd70);});});}exports['GetCmHopperBlack']=function(_0x292056){var _0x246147=this;return new Promise(function(_0x296c4c,_0x13aee2){return db['CmHopperBlack'][_0x1561('0x14')]({'raw':_0x292056['options']?_0x292056['options']['raw']===undefined?!![]:![]:!![],'where':_0x292056[_0x1561('0x15')]?_0x292056[_0x1561('0x15')]['where']||null:null,'attributes':_0x292056['options']?_0x292056[_0x1561('0x15')]['attributes']||null:null,'limit':_0x292056['options']?_0x292056[_0x1561('0x15')][_0x1561('0x16')]||null:null,'include':_0x292056[_0x1561('0x15')]?_0x292056[_0x1561('0x15')][_0x1561('0x17')]?_[_0x1561('0x18')](_0x292056[_0x1561('0x15')][_0x1561('0x17')],function(_0x1d7a46){return{'model':db[_0x1d7a46[_0x1561('0x19')]],'as':_0x1d7a46['as'],'attributes':_0x1d7a46['attributes'],'include':_0x1d7a46['include']?_[_0x1561('0x18')](_0x1d7a46[_0x1561('0x17')],function(_0x195bef){return{'model':db[_0x195bef['model']],'as':_0x195bef['as'],'attributes':_0x195bef[_0x1561('0x1a')],'include':_0x195bef[_0x1561('0x17')]?_[_0x1561('0x18')](_0x195bef[_0x1561('0x17')],function(_0x21b185){return{'model':db[_0x21b185[_0x1561('0x19')]],'as':_0x21b185['as'],'attributes':_0x21b185[_0x1561('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1561('0xb')](function(_0x5127fc){logger[_0x1561('0xc')](_0x1561('0x1b'),_0x292056);logger['debug'](_0x1561('0x1b'),_0x292056,JSON[_0x1561('0x1c')](_0x5127fc));_0x296c4c(_0x5127fc);})[_0x1561('0x1d')](function(_0x267c09){logger['error'](_0x1561('0x1b'),_0x267c09['message'],_0x292056);_0x13aee2(_0x246147[_0x1561('0xf')](0x1f4,_0x267c09[_0x1561('0x12')]));});});};exports[_0x1561('0x1e')]=function(_0x3c8af6){var _0x469fdb=this;return new Promise(function(_0x1c8533,_0x4140cc){return db[_0x1561('0x1f')]['update'](_0x3c8af6[_0x1561('0x20')],{'raw':_0x3c8af6['options']?_0x3c8af6[_0x1561('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8af6['options']?_0x3c8af6['options']['where']||null:null,'attributes':_0x3c8af6[_0x1561('0x15')]?_0x3c8af6[_0x1561('0x15')][_0x1561('0x1a')]||null:null,'limit':_0x3c8af6[_0x1561('0x15')]?_0x3c8af6[_0x1561('0x15')]['limit']||null:null})[_0x1561('0xb')](function(_0x3363cf){logger['info'](_0x1561('0x1e'),_0x3c8af6);logger['debug'](_0x1561('0x1e'),_0x3c8af6,JSON[_0x1561('0x1c')](_0x3363cf));_0x1c8533(_0x3363cf);})[_0x1561('0x1d')](function(_0x286c9b){logger[_0x1561('0xf')](_0x1561('0x1e'),_0x286c9b['message'],_0x3c8af6);_0x4140cc(_0x469fdb[_0x1561('0xf')](0x1f4,_0x286c9b[_0x1561('0x12')]));});});};exports[_0x1561('0x21')]=function(_0x4b19fb){var _0x62be6c=this;return new Promise(function(_0x5818fa,_0x5234c8){return db[_0x1561('0x1f')][_0x1561('0x22')]({'where':_0x4b19fb[_0x1561('0x15')]?_0x4b19fb['options'][_0x1561('0x23')]||null:null})[_0x1561('0xb')](function(_0x59f101){logger[_0x1561('0xc')](_0x1561('0x21'),_0x4b19fb);logger[_0x1561('0xe')](_0x1561('0x21'),_0x4b19fb,JSON[_0x1561('0x1c')](_0x59f101));_0x5818fa(_0x59f101);})[_0x1561('0x1d')](function(_0x7d95be){logger[_0x1561('0xf')](_0x1561('0x21'),_0x7d95be[_0x1561('0x12')],_0x4b19fb);_0x5234c8(_0x62be6c['error'](0x1f4,_0x7d95be['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6a0231d..39960f7 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 _0x4bd3=['put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x4bd3,0x174));var _0x34bd=function(_0x2a02be,_0x416952){_0x2a02be=_0x2a02be-0x0;var _0x21ef15=_0x4bd3[_0x2a02be];return _0x21ef15;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./cmHopperBlack.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/:id',auth[_0x34bd('0x7')](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file +var _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x241e93,_0x595ec4){var _0x61940d=function(_0x29d379){while(--_0x29d379){_0x241e93['push'](_0x241e93['shift']());}};_0x61940d(++_0x595ec4);}(_0x1623,0xab));var _0x3162=function(_0x8ab09c,_0xa64565){_0x8ab09c=_0x8ab09c-0x0;var _0x2fd7df=_0x1623[_0x8ab09c];return _0x2fd7df;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 94ce67c..410657b 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 _0x2b38=['DATE','getDataValue','endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x58cee8,_0xa6daaa){var _0x22d03a=function(_0x22e364){while(--_0x22e364){_0x58cee8['push'](_0x58cee8['shift']());}};_0x22d03a(++_0xa6daaa);}(_0x2b38,0x163));var _0x82b3=function(_0x12a022,_0x23259e){_0x12a022=_0x12a022-0x0;var _0x4ddf9c=_0x2b38[_0x12a022];return _0x4ddf9c;};'use strict';var Sequelize=require(_0x82b3('0x0'));var moment=require(_0x82b3('0x1'));module[_0x82b3('0x2')]={'state':{'type':Sequelize[_0x82b3('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x82b3('0x4')]},'scheduledat':{'type':Sequelize[_0x82b3('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x82b3('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x82b3('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x82b3('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x82b3('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x82b3('0x5')]},'droptime':{'type':Sequelize[_0x82b3('0x5')]},'endtime':{'type':Sequelize[_0x82b3('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x82b3('0x4')]},'campaign':{'type':Sequelize[_0x82b3('0x4')]},'campaigntype':{'type':Sequelize[_0x82b3('0x4')]},'membername':{'type':Sequelize[_0x82b3('0x4')]},'reason':{'type':Sequelize[_0x82b3('0x4')]},'disposition':{'type':Sequelize[_0x82b3('0x4')]},'secondDisposition':{'type':Sequelize[_0x82b3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x82b3('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x1d3d18){var _0x508f3d=this[_0x82b3('0x6')](_0x82b3('0x7'));if(_0x508f3d&&_0x1d3d18){this['setDataValue'](_0x82b3('0x8'),moment(_0x1d3d18)[_0x82b3('0x9')](moment(_0x508f3d),_0x82b3('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x82b3('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x82b3('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x82b3('0x5')]},'callback':{'type':Sequelize[_0x82b3('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x82b3('0x5')]},'deleted':{'type':Sequelize[_0x82b3('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x82b3('0x5')]},'recallme':{'type':Sequelize[_0x82b3('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x82b3('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x82b3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd845=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x49a57f,_0x405f38){var _0x2fa2a5=function(_0x359a98){while(--_0x359a98){_0x49a57f['push'](_0x49a57f['shift']());}};_0x2fa2a5(++_0x405f38);}(_0xd845,0xa1));var _0x5d84=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xd845[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x5d84('0x0'));var moment=require(_0x5d84('0x1'));module['exports']={'state':{'type':Sequelize[_0x5d84('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5d84('0x3')]},'scheduledat':{'type':Sequelize[_0x5d84('0x4')]},'countbusyretry':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5d84('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5d84('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5d84('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5d84('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5d84('0x4')]},'droptime':{'type':Sequelize[_0x5d84('0x4')]},'endtime':{'type':Sequelize[_0x5d84('0x4')]},'ringtime':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5d84('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5d84('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5d84('0x3')]},'secondDisposition':{'type':Sequelize[_0x5d84('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5d84('0x3')]},'dispositionat':{'type':Sequelize[_0x5d84('0x4')],'set':function(_0x3919a8){var _0x57c875=this[_0x5d84('0x5')](_0x5d84('0x6'));if(_0x57c875&&_0x3919a8){this[_0x5d84('0x7')](_0x5d84('0x8'),moment(_0x3919a8)[_0x5d84('0x9')](moment(_0x57c875),_0x5d84('0xa')));}}},'amd':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5d84('0x4')]},'callback':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5d84('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5d84('0x4')]},'deleted':{'type':Sequelize[_0x5d84('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5d84('0x4')]},'recallme':{'type':Sequelize[_0x5d84('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5d84('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1fb8fc4..385f929 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 _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','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','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x49ccb8,_0x54b01a){var _0x16ec6c=function(_0x44c526){while(--_0x44c526){_0x49ccb8['push'](_0x49ccb8['shift']());}};_0x16ec6c(++_0x54b01a);}(_0x1623,0xab));var _0x3162=function(_0x32b597,_0x9c3c09){_0x32b597=_0x32b597-0x0;var _0x34677c=_0x1623[_0x32b597];return _0x34677c;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file +var _0xdb28=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','CmHopperFinal','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','insert','into','cm_hopper','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(CampaignId)','state','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf'];(function(_0x1c3863,_0x2bd7c0){var _0x341c19=function(_0x21603e){while(--_0x21603e){_0x1c3863['push'](_0x1c3863['shift']());}};_0x341c19(++_0x2bd7c0);}(_0xdb28,0x106));var _0x8db2=function(_0x3e848c,_0x2f43c0){_0x3e848c=_0x3e848c-0x0;var _0x39e8c5=_0xdb28[_0x3e848c];return _0x39e8c5;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['describe']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')]()['then'](respondWithResult(_0x2ada52,null))['catch'](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x2e46d4,_0x164020){if(_0x2e46d4['body']['uniqueid']){delete _0x2e46d4['body'][_0x8db2('0x4a')];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'uniqueid':_0x2e46d4[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x164020,null))[_0x8db2('0x24')](saveUpdates(_0x2e46d4[_0x8db2('0x4b')],null))['then'](respondWithResult(_0x164020,null))['catch'](handleError(_0x164020,null));};exports[_0x8db2('0x4c')]=function(_0x18c6ef,_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x18c6ef[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x54')))),_0x8db2('0x55')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x56')))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8db2('0x58')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5d')))),_0x8db2('0x5e')]]})['then'](handleEntityNotFound(_0x2908e4,null))[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x42')](handleError(_0x2908e4,null));};exports[_0x8db2('0x5f')]=function(_0xc27a7e,_0x349db0,_0x53b2dc){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'CampaignId':_0xc27a7e[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db['sequelize'][_0x8db2('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x8db2('0x55')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x60')))),_0x8db2('0x58')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5d')))),'answeringMachine']]})[_0x8db2('0x24')](handleEntityNotFound(_0x349db0,null))[_0x8db2('0x24')](respondWithResult(_0x349db0,null))[_0x8db2('0x42')](handleError(_0x349db0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x26523b,_0x291375,_0x2cf731){return db['VoiceQueue'][_0x8db2('0x48')]({'where':{'id':_0x26523b[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x291375,null))[_0x8db2('0x24')](function(_0x3a0946){var _0x5923b3;if(_0x3a0946){_0x5923b3=squel[_0x8db2('0x61')]()[_0x8db2('0x62')](_0x8db2('0x63'))['fromQuery'](['phone',_0x8db2('0x64'),_0x8db2('0x65'),'ListId',_0x8db2('0x66'),_0x8db2('0x67'),_0x8db2('0x68')],squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))[_0x8db2('0x6a')](_0x8db2('0x6e'),_0x8db2('0x65'))['field'](_0x8db2('0x6f'),'ListId')[_0x8db2('0x6a')](_0x8db2('0x70'),'VoiceQueueId')[_0x8db2('0x6a')](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())['where']('state\x20=\x20?',_0x26523b[_0x8db2('0x4b')]['state'][_0x8db2('0x74')]())[_0x8db2('0x3b')](_0x8db2('0x75'))['where'](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')]('phone')[_0x8db2('0x71')](_0x8db2('0x63'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b['params']['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id']['toString']())[_0x8db2('0x3b')](_0x8db2('0x78')))[_0x8db2('0x79')]('ContactId'))['toString']();return db['sequelize'][_0x8db2('0x30')](_0x5923b3);}return[];})[_0x8db2('0x24')](respondWithResult(_0x291375,null))[_0x8db2('0x42')](handleError(_0x291375,null));};exports[_0x8db2('0x7a')]=function(_0x2ad024,_0x313918,_0x339d09){return db[_0x8db2('0x7b')][_0x8db2('0x48')]({'where':{'id':_0x2ad024[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x313918,null))['then'](function(_0x360a06){var _0xa2e293;if(_0x360a06){_0xa2e293=squel[_0x8db2('0x61')]()[_0x8db2('0x62')]('cm_hopper')['fromQuery']([_0x8db2('0x6c'),_0x8db2('0x64'),'ContactId',_0x8db2('0x7c'),_0x8db2('0x7d'),_0x8db2('0x67'),'updatedAt'],squel['select']()['field'](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))['field'](_0x8db2('0x6e'),'ContactId')[_0x8db2('0x6a')](_0x8db2('0x6f'),_0x8db2('0x7c'))[_0x8db2('0x6a')](_0x8db2('0x7e'),'CampaignId')['field'](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')]('CampaignId\x20=\x20?',_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x20?',_0x2ad024[_0x8db2('0x4b')][_0x8db2('0x7f')]['toString']())[_0x8db2('0x3b')](_0x8db2('0x75'))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6c'))[_0x8db2('0x71')](_0x8db2('0x63'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x204'))[_0x8db2('0x79')](_0x8db2('0x65')))[_0x8db2('0x74')]();return db['sequelize']['query'](_0xa2e293);}return[];})[_0x8db2('0x24')](respondWithResult(_0x313918,null))[_0x8db2('0x42')](handleError(_0x313918,null));};exports[_0x8db2('0x81')]=function(_0xc83913,_0x4f9ce4,_0xaa2661){return db[_0x8db2('0x82')][_0x8db2('0x83')]({'where':{'VoiceQueueId':_0xc83913[_0x8db2('0x4b')]['VoiceQueueId'],'CampaignId':_0xc83913[_0x8db2('0x4b')][_0x8db2('0x7d')],'ContactId':_0xc83913[_0x8db2('0x4b')]['ContactId']}})['then'](handleEntityNotFound(_0x4f9ce4,null))['then'](function(_0x1ba097){if(_0x1ba097){return _0x1ba097;}return null;})[_0x8db2('0x24')](respondWithResult(_0x4f9ce4,null))[_0x8db2('0x42')](handleError(_0x4f9ce4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 7d9b43d..190bcb2 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 _0x4147=['api','moment','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger'];(function(_0x32b8a9,_0x59d62b){var _0x40105c=function(_0x54c048){while(--_0x54c048){_0x32b8a9['push'](_0x32b8a9['shift']());}};_0x40105c(++_0x59d62b);}(_0x4147,0x184));var _0x7414=function(_0x45f3a8,_0x6b4b21){_0x45f3a8=_0x45f3a8-0x0;var _0x366d49=_0x4147[_0x45f3a8];return _0x366d49;};'use strict';var _=require('lodash');var util=require(_0x7414('0x0'));var logger=require(_0x7414('0x1'))(_0x7414('0x2'));var moment=require(_0x7414('0x3'));var BPromise=require('bluebird');var rp=require(_0x7414('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7414('0x5'));var config=require(_0x7414('0x6'));var attributes=require(_0x7414('0x7'));module['exports']=function(_0x1c2f1b,_0x35ac5d){return _0x1c2f1b[_0x7414('0x8')](_0x7414('0x9'),attributes,{'tableName':_0x7414('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x7414('0xb')]},{'name':_0x7414('0xc'),'fields':[_0x7414('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe575=['uniqueid','lodash','util','api','moment','request-promise','rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x12a023,_0x284fd2){var _0x14e19a=function(_0x2c1b75){while(--_0x2c1b75){_0x12a023['push'](_0x12a023['shift']());}};_0x14e19a(++_0x284fd2);}(_0xe575,0x91));var _0x5e57=function(_0x22fc72,_0x3bf728){_0x22fc72=_0x22fc72-0x0;var _0x33ca79=_0xe575[_0x22fc72];return _0x33ca79;};'use strict';var _=require(_0x5e57('0x0'));var util=require(_0x5e57('0x1'));var logger=require('../../config/logger')(_0x5e57('0x2'));var moment=require(_0x5e57('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e57('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e57('0x5'));var config=require('../../config/environment');var attributes=require(_0x5e57('0x6'));module['exports']=function(_0x6b563b,_0x14a797){return _0x6b563b[_0x5e57('0x7')](_0x5e57('0x8'),attributes,{'tableName':_0x5e57('0x9'),'paranoid':![],'indexes':[{'name':_0x5e57('0xa'),'fields':[_0x5e57('0xa')]},{'name':_0x5e57('0xb'),'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 62a89de..024480a 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x273dff,_0x18cde1){var _0x5be8c9=function(_0x39ff85){while(--_0x39ff85){_0x273dff['push'](_0x273dff['shift']());}};_0x5be8c9(++_0x18cde1);}(_0x7a54,0x106));var _0x47a5=function(_0x3e0648,_0x3f0a82){_0x3e0648=_0x3e0648-0x0;var _0x1f291d=_0x7a54[_0x3e0648];return _0x1f291d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x2c0cdd,_0xce5add){var _0x2aa500=function(_0x2aeea2){while(--_0x2aeea2){_0x2c0cdd['push'](_0x2c0cdd['shift']());}};_0x2aa500(++_0xce5add);}(_0xb10b,0x12a));var _0xbb10=function(_0x1833dc,_0x121d9d){_0x1833dc=_0x1833dc-0x0;var _0x77da96=_0xb10b[_0x1833dc];return _0x77da96;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index ca8ea3d..647dc4a 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 _0x33f8=['show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x5366b9,_0x5d0942){var _0xaf9b86=function(_0x40883a){while(--_0x40883a){_0x5366b9['push'](_0x5366b9['shift']());}};_0xaf9b86(++_0x5d0942);}(_0x33f8,0x1f4));var _0x833f=function(_0x5c5dd5,_0xf4997e){_0x5c5dd5=_0x5c5dd5-0x0;var _0x1a96ee=_0x33f8[_0x5c5dd5];return _0x1a96ee;};'use strict';var multer=require(_0x833f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x833f('0x1'));var express=require(_0x833f('0x2'));var router=express['Router']();var fs_extra=require(_0x833f('0x3'));var auth=require(_0x833f('0x4'));var interaction=require(_0x833f('0x5'));var config=require(_0x833f('0x6'));var controller=require(_0x833f('0x7'));router[_0x833f('0x8')]('/',auth[_0x833f('0x9')](),controller['index']);router[_0x833f('0x8')](_0x833f('0xa'),auth[_0x833f('0x9')](),controller[_0x833f('0xb')]);router[_0x833f('0x8')](_0x833f('0xc'),auth['isAuthenticated'](),controller[_0x833f('0xd')]);router[_0x833f('0x8')](_0x833f('0xe'),auth[_0x833f('0x9')](),controller[_0x833f('0xf')]);router['get'](_0x833f('0x10'),auth['isAuthenticated'](),controller[_0x833f('0x11')]);router['post'](_0x833f('0x12'),auth[_0x833f('0x9')](),controller[_0x833f('0x13')]);router[_0x833f('0x14')](_0x833f('0x15'),auth[_0x833f('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x833f('0x14')](_0x833f('0x16'),auth[_0x833f('0x9')](),controller[_0x833f('0x17')]);router[_0x833f('0x18')](_0x833f('0xc'),auth[_0x833f('0x9')](),controller[_0x833f('0x19')]);module[_0x833f('0x1a')]=router; \ No newline at end of file +var _0xa0d5=['/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x231453,_0x544e0a){var _0x394a0b=function(_0x303413){while(--_0x303413){_0x231453['push'](_0x231453['shift']());}};_0x394a0b(++_0x544e0a);}(_0xa0d5,0xab));var _0x5a0d=function(_0x2384bb,_0x12f81b){_0x2384bb=_0x2384bb-0x0;var _0x3f2bac=_0xa0d5[_0x2384bb];return _0x3f2bac;};'use strict';var multer=require('multer');var util=require(_0x5a0d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5a0d('0x1'));var auth=require(_0x5a0d('0x2'));var interaction=require(_0x5a0d('0x3'));var config=require(_0x5a0d('0x4'));var controller=require(_0x5a0d('0x5'));router[_0x5a0d('0x6')]('/',auth['isAuthenticated'](),controller[_0x5a0d('0x7')]);router['get'](_0x5a0d('0x8'),auth[_0x5a0d('0x9')](),controller[_0x5a0d('0xa')]);router['get'](_0x5a0d('0xb'),auth[_0x5a0d('0x9')](),controller[_0x5a0d('0xc')]);router[_0x5a0d('0x6')](_0x5a0d('0xd'),auth[_0x5a0d('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x5a0d('0x6')](_0x5a0d('0xe'),auth[_0x5a0d('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x5a0d('0xf'),auth[_0x5a0d('0x9')](),controller[_0x5a0d('0x10')]);router[_0x5a0d('0x11')](_0x5a0d('0x12'),auth[_0x5a0d('0x9')](),controller[_0x5a0d('0x13')]);router[_0x5a0d('0x11')]('/checkContactHopper',auth[_0x5a0d('0x9')](),controller[_0x5a0d('0x14')]);router[_0x5a0d('0x15')]('/:id',auth[_0x5a0d('0x9')](),controller['update']);module[_0x5a0d('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 6068c99..75bbb2b 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 _0x85c5=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x21d242,_0xa4e7af){var _0x2b65a8=function(_0x252651){while(--_0x252651){_0x21d242['push'](_0x21d242['shift']());}};_0x2b65a8(++_0xa4e7af);}(_0x85c5,0xe0));var _0x585c=function(_0x284bb4,_0x5f3a59){_0x284bb4=_0x284bb4-0x0;var _0x2e4c2e=_0x85c5[_0x284bb4];return _0x2e4c2e;};'use strict';var Sequelize=require(_0x585c('0x0'));module[_0x585c('0x1')]={'state':{'type':Sequelize[_0x585c('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x585c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x585c('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x585c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x585c('0x4')]},'answertime':{'type':Sequelize[_0x585c('0x4')]},'droptime':{'type':Sequelize[_0x585c('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x585c('0x3')]},'campaign':{'type':Sequelize[_0x585c('0x3')]},'campaigntype':{'type':Sequelize[_0x585c('0x3')]},'membername':{'type':Sequelize[_0x585c('0x3')]},'reason':{'type':Sequelize[_0x585c('0x3')]},'amd':{'type':Sequelize[_0x585c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x585c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x585c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x585c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x585c('0x4')]},'recallme':{'type':Sequelize[_0x585c('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x585c('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x585c('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x585c('0x3')]}}; \ No newline at end of file +var _0xbf25=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4e9d4d,_0x4877d2){var _0x217393=function(_0x4477a7){while(--_0x4477a7){_0x4e9d4d['push'](_0x4e9d4d['shift']());}};_0x217393(++_0x4877d2);}(_0xbf25,0x12d));var _0x5bf2=function(_0x1b5b1a,_0x146780){_0x1b5b1a=_0x1b5b1a-0x0;var _0x74e9ec=_0xbf25[_0x1b5b1a];return _0x74e9ec;};'use strict';var Sequelize=require(_0x5bf2('0x0'));module[_0x5bf2('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5bf2('0x2')]},'scheduledat':{'type':Sequelize[_0x5bf2('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5bf2('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5bf2('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5bf2('0x2')]},'calleridnum':{'type':Sequelize[_0x5bf2('0x2')]},'calleridname':{'type':Sequelize[_0x5bf2('0x2')]},'starttime':{'type':Sequelize[_0x5bf2('0x3')]},'responsetime':{'type':Sequelize[_0x5bf2('0x3')]},'answertime':{'type':Sequelize[_0x5bf2('0x3')]},'droptime':{'type':Sequelize[_0x5bf2('0x3')]},'endtime':{'type':Sequelize[_0x5bf2('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5bf2('0x2')]},'campaign':{'type':Sequelize[_0x5bf2('0x2')]},'campaigntype':{'type':Sequelize[_0x5bf2('0x2')]},'membername':{'type':Sequelize[_0x5bf2('0x2')]},'reason':{'type':Sequelize[_0x5bf2('0x2')]},'amd':{'type':Sequelize[_0x5bf2('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5bf2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5bf2('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5bf2('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5bf2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5bf2('0x3')]},'edited':{'type':Sequelize[_0x5bf2('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5bf2('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5bf2('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 7d69330..7f5a472 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 _0x6a8a=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','map','VIRTUAL','name','merge','count','includeAll','rows','show','params','include','options','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','status','send','index','CmHopperHistory','rawAttributes','type','key','model','query','keys'];(function(_0x19818c,_0xf59330){var _0x4ee5f2=function(_0x2fb524){while(--_0x2fb524){_0x19818c['push'](_0x19818c['shift']());}};_0x4ee5f2(++_0xf59330);}(_0x6a8a,0xb9));var _0xa6a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a8a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa6a8('0x0'));var rimraf=require(_0xa6a8('0x1'));var zipdir=require(_0xa6a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6a8('0x3'));var moment=require(_0xa6a8('0x4'));var BPromise=require(_0xa6a8('0x5'));var Mustache=require(_0xa6a8('0x6'));var util=require(_0xa6a8('0x7'));var path=require(_0xa6a8('0x8'));var sox=require('sox');var csv=require(_0xa6a8('0x9'));var ejs=require(_0xa6a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa6a8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6a8('0xc'));var jsforce=require(_0xa6a8('0xd'));var deskjs=require(_0xa6a8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa6a8('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6a8('0x11'));var as=require(_0xa6a8('0x12'));var hardwareService=require(_0xa6a8('0x13'));var logger=require(_0xa6a8('0x14'))('api');var utils=require(_0xa6a8('0x15'));var config=require(_0xa6a8('0x16'));var licenseUtil=require(_0xa6a8('0x17'));var db=require(_0xa6a8('0x18'))['db'];function respondWithStatusCode(_0x797c17,_0x475fc1){_0x475fc1=_0x475fc1||0xcc;return function(_0x4531e8){if(_0x4531e8){return _0x797c17[_0xa6a8('0x19')](_0x475fc1);}return _0x797c17['status'](_0x475fc1)['end']();};}function respondWithResult(_0x13a5b8,_0x37ee82){_0x37ee82=_0x37ee82||0xc8;return function(_0x3d522f){if(_0x3d522f){return _0x13a5b8['status'](_0x37ee82)[_0xa6a8('0x1a')](_0x3d522f);}};}function respondWithFilteredResult(_0x5c1cdf,_0x4f7b3a){return function(_0x2ce08a){if(_0x2ce08a){var _0x23150f=typeof _0x4f7b3a[_0xa6a8('0x1b')]==='undefined'&&typeof _0x4f7b3a['limit']===_0xa6a8('0x1c');var _0x3f25c0=_0x2ce08a['count'];var _0x40666f=_0x23150f?0x0:_0x4f7b3a[_0xa6a8('0x1b')];var _0x2b9d9f=_0x23150f?_0x2ce08a['count']:_0x4f7b3a[_0xa6a8('0x1b')]+_0x4f7b3a['limit'];var _0x1f7c56;if(_0x2b9d9f>=_0x3f25c0){_0x2b9d9f=_0x3f25c0;_0x1f7c56=0xc8;}else{_0x1f7c56=0xce;}_0x5c1cdf['status'](_0x1f7c56);return _0x5c1cdf['set'](_0xa6a8('0x1d'),_0x40666f+'-'+_0x2b9d9f+'/'+_0x3f25c0)['json'](_0x2ce08a);}return null;};}function patchUpdates(_0x698ccb){return function(_0x4f745c){try{jsonpatch[_0xa6a8('0x1e')](_0x4f745c,_0x698ccb,!![]);}catch(_0x33e9bf){return BPromise[_0xa6a8('0x1f')](_0x33e9bf);}return _0x4f745c[_0xa6a8('0x20')]();};}function saveUpdates(_0x5431f1,_0x404ac2){return function(_0x353789){if(_0x353789){return _0x353789[_0xa6a8('0x21')](_0x5431f1)[_0xa6a8('0x22')](function(_0x38bec1){return _0x38bec1;});}return null;};}function removeEntity(_0x523d01,_0x53e95a){return function(_0x2bf88c){if(_0x2bf88c){return _0x2bf88c[_0xa6a8('0x23')]()[_0xa6a8('0x22')](function(){_0x523d01['status'](0xcc)[_0xa6a8('0x24')]();});}};}function handleEntityNotFound(_0xbcb563,_0x82279c){return function(_0x2b5b6c){if(!_0x2b5b6c){_0xbcb563['sendStatus'](0x194);}return _0x2b5b6c;};}function handleError(_0x57e756,_0x116927){_0x116927=_0x116927||0x1f4;return function(_0x5421ab){logger[_0xa6a8('0x25')](_0x5421ab[_0xa6a8('0x26')]);if(_0x5421ab['name']){delete _0x5421ab['name'];}_0x57e756[_0xa6a8('0x27')](_0x116927)[_0xa6a8('0x28')](_0x5421ab);};}exports[_0xa6a8('0x29')]=function(_0xfbc613,_0x3f6268){var _0x4f2575={},_0x28a728={},_0x13dadc={'count':0x0,'rows':[]};var _0xd5a7f7=_['map'](db[_0xa6a8('0x2a')][_0xa6a8('0x2b')],function(_0x41c4a6){return{'name':_0x41c4a6['fieldName'],'type':_0x41c4a6[_0xa6a8('0x2c')][_0xa6a8('0x2d')]};});_0x28a728[_0xa6a8('0x2e')]=_['map'](_0xd5a7f7,'name');_0x28a728[_0xa6a8('0x2f')]=_[_0xa6a8('0x30')](_0xfbc613[_0xa6a8('0x2f')]);_0x28a728[_0xa6a8('0x31')]=_[_0xa6a8('0x32')](_0x28a728['model'],_0x28a728[_0xa6a8('0x2f')]);_0x4f2575[_0xa6a8('0x33')]=_[_0xa6a8('0x32')](_0x28a728['model'],qs[_0xa6a8('0x34')](_0xfbc613['query']['fields']));_0x4f2575['attributes']=_0x4f2575['attributes'][_0xa6a8('0x35')]?_0x4f2575[_0xa6a8('0x33')]:_0x28a728[_0xa6a8('0x2e')];if(!_0xfbc613[_0xa6a8('0x2f')][_0xa6a8('0x36')](_0xa6a8('0x37'))){_0x4f2575[_0xa6a8('0x38')]=qs['limit'](_0xfbc613['query'][_0xa6a8('0x38')]);_0x4f2575[_0xa6a8('0x1b')]=qs['offset'](_0xfbc613[_0xa6a8('0x2f')][_0xa6a8('0x1b')]);}_0x4f2575[_0xa6a8('0x39')]=qs['sort'](_0xfbc613[_0xa6a8('0x2f')]['sort']);_0x4f2575[_0xa6a8('0x3a')]=qs['filters'](_[_0xa6a8('0x3b')](_0xfbc613['query'],_0x28a728[_0xa6a8('0x31')]),_0xd5a7f7);if(_0xfbc613[_0xa6a8('0x2f')][_0xa6a8('0x3c')]){_0x4f2575['where']=_['merge'](_0x4f2575[_0xa6a8('0x3a')],{'$or':_[_0xa6a8('0x3d')](_0xd5a7f7,function(_0x2e6cdf){if(_0x2e6cdf['type']!==_0xa6a8('0x3e')){var _0xc46c36={};_0xc46c36[_0x2e6cdf[_0xa6a8('0x3f')]]={'$like':'%'+_0xfbc613[_0xa6a8('0x2f')][_0xa6a8('0x3c')]+'%'};return _0xc46c36;}})});}_0x4f2575=_[_0xa6a8('0x40')]({},_0x4f2575,_0xfbc613['options']);var _0x4bc11b={'where':_0x4f2575[_0xa6a8('0x3a')]};return db['CmHopperHistory'][_0xa6a8('0x41')](_0x4bc11b)[_0xa6a8('0x22')](function(_0x30fd50){_0x13dadc[_0xa6a8('0x41')]=_0x30fd50;if(_0xfbc613[_0xa6a8('0x2f')][_0xa6a8('0x42')]){_0x4f2575['include']=[{'all':!![]}];}return db[_0xa6a8('0x2a')]['findAll'](_0x4f2575);})['then'](function(_0xba5edc){_0x13dadc[_0xa6a8('0x43')]=_0xba5edc;return _0x13dadc;})['then'](respondWithFilteredResult(_0x3f6268,_0x4f2575))['catch'](handleError(_0x3f6268,null));};exports[_0xa6a8('0x44')]=function(_0x5f4e07,_0x1e1730){var _0x335587={'raw':!![],'where':{'id':_0x5f4e07[_0xa6a8('0x45')]['id']}},_0x4804fe={};_0x4804fe[_0xa6a8('0x2e')]=_['keys'](db[_0xa6a8('0x2a')]['rawAttributes']);_0x4804fe[_0xa6a8('0x2f')]=_[_0xa6a8('0x30')](_0x5f4e07[_0xa6a8('0x2f')]);_0x4804fe[_0xa6a8('0x31')]=_[_0xa6a8('0x32')](_0x4804fe[_0xa6a8('0x2e')],_0x4804fe[_0xa6a8('0x2f')]);_0x335587['attributes']=_[_0xa6a8('0x32')](_0x4804fe[_0xa6a8('0x2e')],qs[_0xa6a8('0x34')](_0x5f4e07[_0xa6a8('0x2f')][_0xa6a8('0x34')]));_0x335587[_0xa6a8('0x33')]=_0x335587['attributes'][_0xa6a8('0x35')]?_0x335587['attributes']:_0x4804fe[_0xa6a8('0x2e')];if(_0x5f4e07['query'][_0xa6a8('0x42')]){_0x335587[_0xa6a8('0x46')]=[{'all':!![]}];}_0x335587=_[_0xa6a8('0x40')]({},_0x335587,_0x5f4e07[_0xa6a8('0x47')]);return db[_0xa6a8('0x2a')][_0xa6a8('0x48')](_0x335587)[_0xa6a8('0x22')](handleEntityNotFound(_0x1e1730,null))[_0xa6a8('0x22')](respondWithResult(_0x1e1730,null))[_0xa6a8('0x49')](handleError(_0x1e1730,null));};exports[_0xa6a8('0x4a')]=function(_0x3abd1e,_0x34aead){return db[_0xa6a8('0x2a')]['create'](_0x3abd1e[_0xa6a8('0x4b')],{})[_0xa6a8('0x22')](respondWithResult(_0x34aead,0xc9))['catch'](handleError(_0x34aead,null));};exports[_0xa6a8('0x4c')]=function(_0x313907,_0x31d431){return db[_0xa6a8('0x2a')]['describe']()['then'](respondWithResult(_0x31d431,null))[_0xa6a8('0x49')](handleError(_0x31d431,null));};exports[_0xa6a8('0x21')]=function(_0x3a399d,_0x46caae){if(_0x3a399d['body'][_0xa6a8('0x4d')]){delete _0x3a399d['body'][_0xa6a8('0x4d')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x3a399d[_0xa6a8('0x45')]['id']}})[_0xa6a8('0x22')](handleEntityNotFound(_0x46caae,null))['then'](saveUpdates(_0x3a399d[_0xa6a8('0x4b')],null))[_0xa6a8('0x22')](respondWithResult(_0x46caae,null))[_0xa6a8('0x49')](handleError(_0x46caae,null));}; \ No newline at end of file +var _0x60ec=['intersection','attributes','fields','query','order','sort','where','filter','merge','VIRTUAL','options','includeAll','CmHopperHistory','rows','catch','show','params','include','find','describe','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x60ec,0x13d));var _0xc60e=function(_0x4d4aa4,_0xe06314){_0x4d4aa4=_0x4d4aa4-0x0;var _0x5daf18=_0x60ec[_0x4d4aa4];return _0x5daf18;};'use strict';var emlformat=require(_0xc60e('0x0'));var rimraf=require(_0xc60e('0x1'));var zipdir=require(_0xc60e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc60e('0x3'));var moment=require(_0xc60e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc60e('0x5'));var util=require('util');var path=require(_0xc60e('0x6'));var sox=require(_0xc60e('0x7'));var csv=require(_0xc60e('0x8'));var ejs=require(_0xc60e('0x9'));var fs=require('fs');var fs_extra=require(_0xc60e('0xa'));var _=require(_0xc60e('0xb'));var squel=require(_0xc60e('0xc'));var crypto=require(_0xc60e('0xd'));var jsforce=require(_0xc60e('0xe'));var deskjs=require(_0xc60e('0xf'));var toCsv=require(_0xc60e('0x8'));var querystring=require(_0xc60e('0x10'));var Papa=require(_0xc60e('0x11'));var Redis=require('ioredis');var authService=require(_0xc60e('0x12'));var qs=require(_0xc60e('0x13'));var as=require(_0xc60e('0x14'));var hardwareService=require(_0xc60e('0x15'));var logger=require(_0xc60e('0x16'))(_0xc60e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc60e('0x18'))['db'];function respondWithStatusCode(_0x197301,_0x4ee1d8){_0x4ee1d8=_0x4ee1d8||0xcc;return function(_0xca8598){if(_0xca8598){return _0x197301[_0xc60e('0x19')](_0x4ee1d8);}return _0x197301[_0xc60e('0x1a')](_0x4ee1d8)[_0xc60e('0x1b')]();};}function respondWithResult(_0x3129ef,_0x5d01f0){_0x5d01f0=_0x5d01f0||0xc8;return function(_0x3bb529){if(_0x3bb529){return _0x3129ef[_0xc60e('0x1a')](_0x5d01f0)['json'](_0x3bb529);}};}function respondWithFilteredResult(_0xe48847,_0x36b326){return function(_0x16a886){if(_0x16a886){var _0x21eae1=typeof _0x36b326[_0xc60e('0x1c')]===_0xc60e('0x1d')&&typeof _0x36b326['limit']===_0xc60e('0x1d');var _0x2d26ee=_0x16a886[_0xc60e('0x1e')];var _0xfb3d3f=_0x21eae1?0x0:_0x36b326[_0xc60e('0x1c')];var _0x23e77b=_0x21eae1?_0x16a886[_0xc60e('0x1e')]:_0x36b326[_0xc60e('0x1c')]+_0x36b326[_0xc60e('0x1f')];var _0x4ce1d7;if(_0x23e77b>=_0x2d26ee){_0x23e77b=_0x2d26ee;_0x4ce1d7=0xc8;}else{_0x4ce1d7=0xce;}_0xe48847[_0xc60e('0x1a')](_0x4ce1d7);return _0xe48847[_0xc60e('0x20')](_0xc60e('0x21'),_0xfb3d3f+'-'+_0x23e77b+'/'+_0x2d26ee)[_0xc60e('0x22')](_0x16a886);}return null;};}function patchUpdates(_0xf0e5d1){return function(_0x4f6abe){try{jsonpatch[_0xc60e('0x23')](_0x4f6abe,_0xf0e5d1,!![]);}catch(_0x270b46){return BPromise[_0xc60e('0x24')](_0x270b46);}return _0x4f6abe[_0xc60e('0x25')]();};}function saveUpdates(_0x3fb972,_0x40c6bf){return function(_0xbb57ff){if(_0xbb57ff){return _0xbb57ff[_0xc60e('0x26')](_0x3fb972)['then'](function(_0x5d4379){return _0x5d4379;});}return null;};}function removeEntity(_0x1739e1,_0x4585a8){return function(_0x257ca6){if(_0x257ca6){return _0x257ca6[_0xc60e('0x27')]()[_0xc60e('0x28')](function(){_0x1739e1[_0xc60e('0x1a')](0xcc)[_0xc60e('0x1b')]();});}};}function handleEntityNotFound(_0xf2c8ec,_0x1b2b41){return function(_0x3e9ad1){if(!_0x3e9ad1){_0xf2c8ec[_0xc60e('0x19')](0x194);}return _0x3e9ad1;};}function handleError(_0x212d46,_0x571f17){_0x571f17=_0x571f17||0x1f4;return function(_0x3d923b){logger[_0xc60e('0x29')](_0x3d923b[_0xc60e('0x2a')]);if(_0x3d923b[_0xc60e('0x2b')]){delete _0x3d923b['name'];}_0x212d46[_0xc60e('0x1a')](_0x571f17)[_0xc60e('0x2c')](_0x3d923b);};}exports['index']=function(_0x2d426b,_0x173441){var _0x41e3d1={},_0x4ad044={},_0x57d3e1={'count':0x0,'rows':[]};var _0x19ca5a=_[_0xc60e('0x2d')](db['CmHopperHistory'][_0xc60e('0x2e')],function(_0x1aac56){return{'name':_0x1aac56[_0xc60e('0x2f')],'type':_0x1aac56[_0xc60e('0x30')][_0xc60e('0x31')]};});_0x4ad044[_0xc60e('0x32')]=_[_0xc60e('0x2d')](_0x19ca5a,'name');_0x4ad044['query']=_[_0xc60e('0x33')](_0x2d426b['query']);_0x4ad044[_0xc60e('0x34')]=_[_0xc60e('0x35')](_0x4ad044[_0xc60e('0x32')],_0x4ad044['query']);_0x41e3d1[_0xc60e('0x36')]=_[_0xc60e('0x35')](_0x4ad044[_0xc60e('0x32')],qs[_0xc60e('0x37')](_0x2d426b[_0xc60e('0x38')][_0xc60e('0x37')]));_0x41e3d1['attributes']=_0x41e3d1[_0xc60e('0x36')]['length']?_0x41e3d1[_0xc60e('0x36')]:_0x4ad044[_0xc60e('0x32')];if(!_0x2d426b[_0xc60e('0x38')]['hasOwnProperty']('nolimit')){_0x41e3d1[_0xc60e('0x1f')]=qs[_0xc60e('0x1f')](_0x2d426b[_0xc60e('0x38')]['limit']);_0x41e3d1[_0xc60e('0x1c')]=qs[_0xc60e('0x1c')](_0x2d426b[_0xc60e('0x38')][_0xc60e('0x1c')]);}_0x41e3d1[_0xc60e('0x39')]=qs[_0xc60e('0x3a')](_0x2d426b['query'][_0xc60e('0x3a')]);_0x41e3d1[_0xc60e('0x3b')]=qs['filters'](_['pick'](_0x2d426b[_0xc60e('0x38')],_0x4ad044[_0xc60e('0x34')]),_0x19ca5a);if(_0x2d426b[_0xc60e('0x38')][_0xc60e('0x3c')]){_0x41e3d1[_0xc60e('0x3b')]=_[_0xc60e('0x3d')](_0x41e3d1[_0xc60e('0x3b')],{'$or':_['map'](_0x19ca5a,function(_0xdb481a){if(_0xdb481a[_0xc60e('0x30')]!==_0xc60e('0x3e')){var _0x1fb26e={};_0x1fb26e[_0xdb481a[_0xc60e('0x2b')]]={'$like':'%'+_0x2d426b['query'][_0xc60e('0x3c')]+'%'};return _0x1fb26e;}})});}_0x41e3d1=_[_0xc60e('0x3d')]({},_0x41e3d1,_0x2d426b[_0xc60e('0x3f')]);var _0x39942a={'where':_0x41e3d1[_0xc60e('0x3b')]};return db['CmHopperHistory'][_0xc60e('0x1e')](_0x39942a)[_0xc60e('0x28')](function(_0x3a09ba){_0x57d3e1['count']=_0x3a09ba;if(_0x2d426b[_0xc60e('0x38')][_0xc60e('0x40')]){_0x41e3d1['include']=[{'all':!![]}];}return db[_0xc60e('0x41')]['findAll'](_0x41e3d1);})['then'](function(_0xd71abd){_0x57d3e1[_0xc60e('0x42')]=_0xd71abd;return _0x57d3e1;})[_0xc60e('0x28')](respondWithFilteredResult(_0x173441,_0x41e3d1))[_0xc60e('0x43')](handleError(_0x173441,null));};exports[_0xc60e('0x44')]=function(_0x2dc48a,_0x3353fc){var _0x1f2d9b={'raw':!![],'where':{'id':_0x2dc48a[_0xc60e('0x45')]['id']}},_0x4e4d69={};_0x4e4d69[_0xc60e('0x32')]=_[_0xc60e('0x33')](db[_0xc60e('0x41')][_0xc60e('0x2e')]);_0x4e4d69[_0xc60e('0x38')]=_[_0xc60e('0x33')](_0x2dc48a['query']);_0x4e4d69[_0xc60e('0x34')]=_[_0xc60e('0x35')](_0x4e4d69[_0xc60e('0x32')],_0x4e4d69[_0xc60e('0x38')]);_0x1f2d9b['attributes']=_[_0xc60e('0x35')](_0x4e4d69[_0xc60e('0x32')],qs[_0xc60e('0x37')](_0x2dc48a[_0xc60e('0x38')][_0xc60e('0x37')]));_0x1f2d9b[_0xc60e('0x36')]=_0x1f2d9b[_0xc60e('0x36')]['length']?_0x1f2d9b[_0xc60e('0x36')]:_0x4e4d69['model'];if(_0x2dc48a['query']['includeAll']){_0x1f2d9b[_0xc60e('0x46')]=[{'all':!![]}];}_0x1f2d9b=_['merge']({},_0x1f2d9b,_0x2dc48a['options']);return db[_0xc60e('0x41')][_0xc60e('0x47')](_0x1f2d9b)[_0xc60e('0x28')](handleEntityNotFound(_0x3353fc,null))[_0xc60e('0x28')](respondWithResult(_0x3353fc,null))[_0xc60e('0x43')](handleError(_0x3353fc,null));};exports['create']=function(_0x469d35,_0x145702){return db['CmHopperHistory']['create'](_0x469d35['body'],{})[_0xc60e('0x28')](respondWithResult(_0x145702,0xc9))['catch'](handleError(_0x145702,null));};exports[_0xc60e('0x48')]=function(_0x4bea87,_0x263c58){return db[_0xc60e('0x41')][_0xc60e('0x48')]()[_0xc60e('0x28')](respondWithResult(_0x263c58,null))['catch'](handleError(_0x263c58,null));};exports['update']=function(_0xb635e2,_0x578513){if(_0xb635e2[_0xc60e('0x49')]['uniqueid']){delete _0xb635e2[_0xc60e('0x49')]['uniqueid'];}return db[_0xc60e('0x41')][_0xc60e('0x47')]({'where':{'uniqueid':_0xb635e2[_0xc60e('0x45')]['id']}})[_0xc60e('0x28')](handleEntityNotFound(_0x578513,null))[_0xc60e('0x28')](saveUpdates(_0xb635e2[_0xc60e('0x49')],null))[_0xc60e('0x28')](respondWithResult(_0x578513,null))[_0xc60e('0x43')](handleError(_0x578513,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 27106f3..a41884d 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 _0x1921=['endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history'];(function(_0x5eb778,_0x568885){var _0x3591a3=function(_0xbdf695){while(--_0xbdf695){_0x5eb778['push'](_0x5eb778['shift']());}};_0x3591a3(++_0x568885);}(_0x1921,0xf2));var _0x1192=function(_0x1bf92a,_0x4793e4){_0x1bf92a=_0x1bf92a-0x0;var _0x8b4040=_0x1921[_0x1bf92a];return _0x8b4040;};'use strict';var _=require(_0x1192('0x0'));var util=require('util');var logger=require(_0x1192('0x1'))(_0x1192('0x2'));var moment=require(_0x1192('0x3'));var BPromise=require(_0x1192('0x4'));var rp=require(_0x1192('0x5'));var fs=require('fs');var path=require(_0x1192('0x6'));var rimraf=require(_0x1192('0x7'));var config=require(_0x1192('0x8'));var attributes=require(_0x1192('0x9'));module[_0x1192('0xa')]=function(_0x56cb6f,_0x5be2d2){return _0x56cb6f['define'](_0x1192('0xb'),attributes,{'tableName':_0x1192('0xc'),'paranoid':![],'indexes':[{'name':_0x1192('0xd'),'fields':[_0x1192('0xd')]},{'name':_0x1192('0xe'),'fields':[_0x1192('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8969=['./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8969,0x130));var _0x9896=function(_0x5d5eed,_0x266c09){_0x5d5eed=_0x5d5eed-0x0;var _0x3200d2=_0x8969[_0x5d5eed];return _0x3200d2;};'use strict';var _=require(_0x9896('0x0'));var util=require('util');var logger=require(_0x9896('0x1'))(_0x9896('0x2'));var moment=require(_0x9896('0x3'));var BPromise=require(_0x9896('0x4'));var rp=require(_0x9896('0x5'));var fs=require('fs');var path=require(_0x9896('0x6'));var rimraf=require(_0x9896('0x7'));var config=require('../../config/environment');var attributes=require(_0x9896('0x8'));module['exports']=function(_0x4d1a83,_0xd26a8b){return _0x4d1a83[_0x9896('0x9')](_0x9896('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x9896('0xb'),'fields':[_0x9896('0xb')]},{'name':_0x9896('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 693b38c..e84ea5e 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 _0xc224=['request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','then','GetVoiceQueueHopperHistory','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x2f7270,_0x307af1){var _0xe1d89a=function(_0x1ba203){while(--_0x1ba203){_0x2f7270['push'](_0x2f7270['shift']());}};_0xe1d89a(++_0x307af1);}(_0xc224,0x15c));var _0x4c22=function(_0x2ced4a,_0x2eee03){_0x2ced4a=_0x2ced4a-0x0;var _0x334dbb=_0xc224[_0x2ced4a];return _0x334dbb;};'use strict';var _=require(_0x4c22('0x0'));var util=require(_0x4c22('0x1'));var moment=require(_0x4c22('0x2'));var BPromise=require(_0x4c22('0x3'));var rs=require(_0x4c22('0x4'));var fs=require('fs');var Redis=require(_0x4c22('0x5'));var db=require(_0x4c22('0x6'))['db'];var utils=require(_0x4c22('0x7'));var logger=require('../../config/logger')(_0x4c22('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c22('0x9'));var client=jayson[_0x4c22('0xa')][_0x4c22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1f05,_0x20a45c,_0x1a1267){return new BPromise(function(_0x30389a,_0x584797){return client[_0x4c22('0xc')](_0x3a1f05,_0x1a1267)['then'](function(_0x3a31d6){logger['info'](_0x4c22('0xd'),_0x20a45c,_0x4c22('0xe'));logger[_0x4c22('0xf')](_0x4c22('0x10'),_0x20a45c,'request\x20sent',JSON[_0x4c22('0x11')](_0x3a31d6));if(_0x3a31d6[_0x4c22('0x12')]){if(_0x3a31d6['error']['code']===0x1f4){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);return _0x584797(_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);}logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6['error'][_0x4c22('0x13')]);return _0x30389a(_0x3a31d6[_0x4c22('0x12')]['message']);}else{logger[_0x4c22('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x20a45c,_0x4c22('0xe'));_0x30389a(_0x3a31d6[_0x4c22('0x15')][_0x4c22('0x13')]);}})[_0x4c22('0x16')](function(_0x4229a1){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x4229a1);_0x584797(_0x4229a1);});});}exports[_0x4c22('0x17')]=function(_0x1b9ee6){var _0x15c52e=this;return new Promise(function(_0x45de17,_0xab6ff9){return db[_0x4c22('0x18')][_0x4c22('0x19')](_0x1b9ee6[_0x4c22('0x1a')],{'raw':_0x1b9ee6[_0x4c22('0x1b')]?_0x1b9ee6[_0x4c22('0x1b')][_0x4c22('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x302307){logger[_0x4c22('0x14')](_0x4c22('0x17'),_0x1b9ee6);logger[_0x4c22('0xf')]('CreateCmHopperHistory',_0x1b9ee6,JSON[_0x4c22('0x11')](_0x302307));_0x45de17(_0x302307);})[_0x4c22('0x16')](function(_0x4bfc36){logger[_0x4c22('0x12')](_0x4c22('0x17'),_0x4bfc36[_0x4c22('0x13')],_0x1b9ee6);_0xab6ff9(_0x15c52e['error'](0x1f4,_0x4bfc36['message']));});});};exports['AvgHandleTime']=function(_0x81b495){var _0x4fcf29=this;return new Promise(function(_0xcac4bc,_0x53e5f3){return db['CmHopperHistory'][_0x4c22('0x1d')]({'raw':_0x81b495[_0x4c22('0x1b')]?_0x81b495[_0x4c22('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x81b495[_0x4c22('0x1b')]?_0x81b495[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')][_0x4c22('0x21')]('id')),'predictiveIntervalTotalCalls'],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x4c22('0x20'),db['sequelize']['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x23')))),_0x4c22('0x24')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x25')))),_0x4c22('0x26')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x27'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x27'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x28')))),_0x4c22('0x29')]]})['then'](function(_0x5d6857){logger[_0x4c22('0x14')]('AvgHandleTime',_0x81b495);logger['debug']('AvgHandleTime',_0x81b495,JSON['stringify'](_0x5d6857));_0xcac4bc(_0x5d6857);})['catch'](function(_0x289d2a){logger[_0x4c22('0x12')](_0x4c22('0x2a'),_0x289d2a['message'],_0x81b495);_0x53e5f3(_0x4fcf29[_0x4c22('0x12')](0x1f4,_0x289d2a['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1904f1){var _0x2cef36=this;return new Promise(function(_0x255d4e,_0x433780){return db[_0x4c22('0x18')]['findAll']({'raw':_0x1904f1[_0x4c22('0x1b')]?_0x1904f1[_0x4c22('0x1b')][_0x4c22('0x1c')]===undefined?!![]:![]:!![],'where':_0x1904f1[_0x4c22('0x1b')]?_0x1904f1[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[['campaign',_0x4c22('0x2b')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x2c')))),_0x4c22('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x4c22('0x2f')))),_0x4c22('0x30')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x31')))),_0x4c22('0x32')],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db['sequelize'][_0x4c22('0x22')](_0x4c22('0x33')))),_0x4c22('0x34')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db['sequelize'][_0x4c22('0x22')](_0x4c22('0x35')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x36')))),_0x4c22('0x37')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x38')))),_0x4c22('0x39')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')]['literal'](_0x4c22('0x3a')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3b')))),_0x4c22('0x3c')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3d')))),'outboundRejectCallsDay'],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x3e')))),_0x4c22('0x3f')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x4c22('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x4c22('0x40')],[db[_0x4c22('0x1f')]['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x41')))),'outboundReCallsDay']],'group':['campaign']})[_0x4c22('0x42')](function(_0x14e56d){logger[_0x4c22('0x14')](_0x4c22('0x43'),_0x1904f1);logger[_0x4c22('0xf')]('GetVoiceQueueHopperHistory',_0x1904f1,JSON[_0x4c22('0x11')](_0x14e56d));_0x255d4e(_0x14e56d);})[_0x4c22('0x16')](function(_0x765fca){logger[_0x4c22('0x12')]('GetVoiceQueueHopperHistory',_0x765fca['message'],_0x1904f1);_0x433780(_0x2cef36[_0x4c22('0x12')](0x1f4,_0x765fca['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5b559b){var _0x2f316d=this;return new Promise(function(_0x1c4fda,_0x17e356){return db['CmHopperHistory'][_0x4c22('0x1d')]({'raw':_0x5b559b['options']?_0x5b559b[_0x4c22('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b559b['options']?_0x5b559b[_0x4c22('0x1b')][_0x4c22('0x1e')]||null:null,'attributes':[[_0x4c22('0x44'),_0x4c22('0x2b')],[db[_0x4c22('0x1f')]['fn']('COUNT',db[_0x4c22('0x1f')]['col']('id')),_0x4c22('0x45')],[db['sequelize']['fn'](_0x4c22('0x20'),db[_0x4c22('0x1f')]['fn']('IF',db[_0x4c22('0x1f')][_0x4c22('0x22')](_0x4c22('0x2f')))),_0x4c22('0x46')]],'group':['campaign']})[_0x4c22('0x42')](function(_0x3f1f9a){logger[_0x4c22('0x14')]('GetCampaignHopperHistory',_0x5b559b);logger[_0x4c22('0xf')]('GetCampaignHopperHistory',_0x5b559b,JSON[_0x4c22('0x11')](_0x3f1f9a));_0x1c4fda(_0x3f1f9a);})[_0x4c22('0x16')](function(_0x1fa825){logger[_0x4c22('0x12')](_0x4c22('0x47'),_0x1fa825[_0x4c22('0x13')],_0x5b559b);_0x17e356(_0x2f316d['error'](0x1f4,_0x1fa825[_0x4c22('0x13')]));});});}; \ No newline at end of file +var _0x8581=['`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','col','ivrTotalCallsDays','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','where','sequelize','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','info','GetVoiceQueueHopperHistory','findAll','campaign'];(function(_0x311333,_0x2b92e4){var _0x620938=function(_0x2f3084){while(--_0x2f3084){_0x311333['push'](_0x311333['shift']());}};_0x620938(++_0x2b92e4);}(_0x8581,0x163));var _0x1858=function(_0x24e64a,_0x22af59){_0x24e64a=_0x24e64a-0x0;var _0x3827d2=_0x8581[_0x24e64a];return _0x3827d2;};'use strict';var _=require('lodash');var util=require(_0x1858('0x0'));var moment=require(_0x1858('0x1'));var BPromise=require('bluebird');var rs=require(_0x1858('0x2'));var fs=require('fs');var Redis=require(_0x1858('0x3'));var db=require(_0x1858('0x4'))['db'];var utils=require(_0x1858('0x5'));var logger=require(_0x1858('0x6'))(_0x1858('0x7'));var config=require(_0x1858('0x8'));var jayson=require(_0x1858('0x9'));var client=jayson[_0x1858('0xa')][_0x1858('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fcb0b,_0x1d4663,_0x3c0f4c){return new BPromise(function(_0x5c8ba0,_0x39a962){return client[_0x1858('0xc')](_0x3fcb0b,_0x3c0f4c)[_0x1858('0xd')](function(_0x569366){logger['info'](_0x1858('0xe'),_0x1d4663,'request\x20sent');logger[_0x1858('0xf')](_0x1858('0x10'),_0x1d4663,_0x1858('0x11'),JSON[_0x1858('0x12')](_0x569366));if(_0x569366['error']){if(_0x569366[_0x1858('0x13')][_0x1858('0x14')]===0x1f4){logger[_0x1858('0x13')](_0x1858('0xe'),_0x1d4663,_0x569366[_0x1858('0x13')][_0x1858('0x15')]);return _0x39a962(_0x569366['error']['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1d4663,_0x569366['error']['message']);return _0x5c8ba0(_0x569366[_0x1858('0x13')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x1d4663,_0x1858('0x11'));_0x5c8ba0(_0x569366[_0x1858('0x16')][_0x1858('0x15')]);}})[_0x1858('0x17')](function(_0x25a40d){logger[_0x1858('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1d4663,_0x25a40d);_0x39a962(_0x25a40d);});});}exports[_0x1858('0x18')]=function(_0x3508b3){var _0x9f3106=this;return new Promise(function(_0x44d64a,_0x37f559){return db[_0x1858('0x19')]['create'](_0x3508b3[_0x1858('0x1a')],{'raw':_0x3508b3[_0x1858('0x1b')]?_0x3508b3[_0x1858('0x1b')][_0x1858('0x1c')]===undefined?!![]:![]:!![]})[_0x1858('0xd')](function(_0x52cc41){logger['info']('CreateCmHopperHistory',_0x3508b3);logger[_0x1858('0xf')](_0x1858('0x18'),_0x3508b3,JSON[_0x1858('0x12')](_0x52cc41));_0x44d64a(_0x52cc41);})['catch'](function(_0x3aad8f){logger[_0x1858('0x13')](_0x1858('0x18'),_0x3aad8f[_0x1858('0x15')],_0x3508b3);_0x37f559(_0x9f3106[_0x1858('0x13')](0x1f4,_0x3aad8f['message']));});});};exports[_0x1858('0x1d')]=function(_0x459c84){var _0x3f3b8c=this;return new Promise(function(_0xf153c1,_0x48aac9){return db[_0x1858('0x19')]['findAll']({'raw':_0x459c84['options']?_0x459c84['options'][_0x1858('0x1c')]===undefined?!![]:![]:!![],'where':_0x459c84[_0x1858('0x1b')]?_0x459c84[_0x1858('0x1b')][_0x1858('0x1e')]||null:null,'attributes':[[db[_0x1858('0x1f')]['fn']('COUNT',db['sequelize']['col']('id')),_0x1858('0x20')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal'](_0x1858('0x22')))),_0x1858('0x23')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize'][_0x1858('0x24')](_0x1858('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal'](_0x1858('0x26')))),_0x1858('0x27')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x28'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x1858('0x29')))),_0x1858('0x2a')],[db['sequelize']['fn'](_0x1858('0x28'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize'][_0x1858('0x24')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x1858('0xd')](function(_0x265390){logger[_0x1858('0x2b')](_0x1858('0x1d'),_0x459c84);logger[_0x1858('0xf')]('AvgHandleTime',_0x459c84,JSON[_0x1858('0x12')](_0x265390));_0xf153c1(_0x265390);})['catch'](function(_0xf5ba35){logger[_0x1858('0x13')](_0x1858('0x1d'),_0xf5ba35[_0x1858('0x15')],_0x459c84);_0x48aac9(_0x3f3b8c[_0x1858('0x13')](0x1f4,_0xf5ba35[_0x1858('0x15')]));});});};exports[_0x1858('0x2c')]=function(_0x3517c2){var _0x289e7c=this;return new Promise(function(_0x3e69ff,_0x47067d){return db[_0x1858('0x19')][_0x1858('0x2d')]({'raw':_0x3517c2[_0x1858('0x1b')]?_0x3517c2['options'][_0x1858('0x1c')]===undefined?!![]:![]:!![],'where':_0x3517c2['options']?_0x3517c2[_0x1858('0x1b')][_0x1858('0x1e')]||null:null,'attributes':[[_0x1858('0x2e'),'name'],[db[_0x1858('0x1f')]['fn']('COUNT',db[_0x1858('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x1858('0x2f')))),_0x1858('0x30')],[db['sequelize']['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x1858('0x31')))),_0x1858('0x32')],[db['sequelize']['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x1858('0x22')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')][_0x1858('0x24')](_0x1858('0x33')))),_0x1858('0x34')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')][_0x1858('0x24')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')][_0x1858('0x24')](_0x1858('0x35')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x1858('0x24')](_0x1858('0x36')))),_0x1858('0x37')],[db['sequelize']['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal'](_0x1858('0x38')))),_0x1858('0x39')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal'](_0x1858('0x3a')))),_0x1858('0x3b')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x1858('0x24')](_0x1858('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0x1858('0x1f')]['fn']('COUNT',db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal'](_0x1858('0x3d')))),'outboundRejectCallsDay'],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')][_0x1858('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db[_0x1858('0x1f')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize'][_0x1858('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x1858('0x3e')]],'group':[_0x1858('0x2e')]})[_0x1858('0xd')](function(_0x12686b){logger['info'](_0x1858('0x2c'),_0x3517c2);logger['debug'](_0x1858('0x2c'),_0x3517c2,JSON['stringify'](_0x12686b));_0x3e69ff(_0x12686b);})[_0x1858('0x17')](function(_0x28f4ee){logger[_0x1858('0x13')](_0x1858('0x2c'),_0x28f4ee['message'],_0x3517c2);_0x47067d(_0x289e7c[_0x1858('0x13')](0x1f4,_0x28f4ee[_0x1858('0x15')]));});});};exports[_0x1858('0x3f')]=function(_0x203ef4){var _0x550a02=this;return new Promise(function(_0x18df7f,_0x48ab05){return db[_0x1858('0x19')][_0x1858('0x2d')]({'raw':_0x203ef4[_0x1858('0x1b')]?_0x203ef4[_0x1858('0x1b')][_0x1858('0x1c')]===undefined?!![]:![]:!![],'where':_0x203ef4[_0x1858('0x1b')]?_0x203ef4['options'][_0x1858('0x1e')]||null:null,'attributes':[[_0x1858('0x2e'),_0x1858('0x40')],[db[_0x1858('0x1f')]['fn'](_0x1858('0x21'),db[_0x1858('0x1f')][_0x1858('0x41')]('id')),_0x1858('0x42')],[db['sequelize']['fn'](_0x1858('0x21'),db[_0x1858('0x1f')]['fn']('IF',db['sequelize'][_0x1858('0x24')](_0x1858('0x22')))),'ivrAnswerCallsDay']],'group':[_0x1858('0x2e')]})[_0x1858('0xd')](function(_0x14c449){logger[_0x1858('0x2b')](_0x1858('0x3f'),_0x203ef4);logger['debug']('GetCampaignHopperHistory',_0x203ef4,JSON[_0x1858('0x12')](_0x14c449));_0x18df7f(_0x14c449);})[_0x1858('0x17')](function(_0x365643){logger['error'](_0x1858('0x3f'),_0x365643[_0x1858('0x15')],_0x203ef4);_0x48ab05(_0x550a02[_0x1858('0x13')](0x1f4,_0x365643[_0x1858('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8387d41..8bbefa6 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 _0x7e48=['fs-extra','../../components/interaction/service','./cmHopperHistory.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x40f46f,_0x16bba2){var _0x9d21a=function(_0x2ad948){while(--_0x2ad948){_0x40f46f['push'](_0x40f46f['shift']());}};_0x9d21a(++_0x16bba2);}(_0x7e48,0x176));var _0x87e4=function(_0xdf0cee,_0x5227ae){_0xdf0cee=_0xdf0cee-0x0;var _0x265ee3=_0x7e48[_0xdf0cee];return _0x265ee3;};'use strict';var multer=require(_0x87e4('0x0'));var util=require(_0x87e4('0x1'));var path=require(_0x87e4('0x2'));var timeout=require(_0x87e4('0x3'));var express=require(_0x87e4('0x4'));var router=express[_0x87e4('0x5')]();var fs_extra=require(_0x87e4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x87e4('0x7'));var config=require('../../config/environment');var controller=require(_0x87e4('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x87e4('0x9')]);router['get'](_0x87e4('0xa'),auth[_0x87e4('0xb')](),controller[_0x87e4('0xc')]);router[_0x87e4('0xd')](_0x87e4('0xe'),auth[_0x87e4('0xb')](),controller[_0x87e4('0xf')]);router[_0x87e4('0x10')]('/',auth[_0x87e4('0xb')](),controller[_0x87e4('0x11')]);router['put'](_0x87e4('0xe'),auth[_0x87e4('0xb')](),controller['update']);module[_0x87e4('0x12')]=router; \ No newline at end of file +var _0x71de=['./cmHopperHistory.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x71de,0xb6));var _0xe71d=function(_0x5036b1,_0x2441bd){_0x5036b1=_0x5036b1-0x0;var _0x20e38a=_0x71de[_0x5036b1];return _0x20e38a;};'use strict';var multer=require(_0xe71d('0x0'));var util=require('util');var path=require(_0xe71d('0x1'));var timeout=require(_0xe71d('0x2'));var express=require(_0xe71d('0x3'));var router=express[_0xe71d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe71d('0x5'));var interaction=require(_0xe71d('0x6'));var config=require(_0xe71d('0x7'));var controller=require(_0xe71d('0x8'));router['get']('/',auth[_0xe71d('0x9')](),controller[_0xe71d('0xa')]);router['get']('/describe',auth[_0xe71d('0x9')](),controller[_0xe71d('0xb')]);router[_0xe71d('0xc')](_0xe71d('0xd'),auth['isAuthenticated'](),controller[_0xe71d('0xe')]);router[_0xe71d('0xf')]('/',auth['isAuthenticated'](),controller[_0xe71d('0x10')]);router[_0xe71d('0x11')](_0xe71d('0xd'),auth[_0xe71d('0x9')](),controller[_0xe71d('0x12')]);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 dcf9c3e..4027924 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 _0xd0bb=['exports','STRING','sequelize'];(function(_0x53bb91,_0x457ae3){var _0x167794=function(_0x24ea30){while(--_0x24ea30){_0x53bb91['push'](_0x53bb91['shift']());}};_0x167794(++_0x457ae3);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x30e0f5,_0x5e4826){_0x30e0f5=_0x30e0f5-0x0;var _0x3b5800=_0xd0bb[_0x30e0f5];return _0x3b5800;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbd0b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb205=['sequelize','exports','STRING','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb205,0xf0));var _0x5b20=function(_0xd77e0b,_0x1d1daf){_0xd77e0b=_0xd77e0b-0x0;var _0x1e8c7b=_0xb205[_0xd77e0b];return _0x1e8c7b;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'name':{'type':Sequelize[_0x5b20('0x2')],'unique':_0x5b20('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5b20('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index bd5b580..458d936 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 _0xc25e=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','Lists','UserProfileResource','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','describe','addDisposition','ListId','Disposition','getDispositions','findOne','intersection','order','removeDispositions','ids','CmContact','tags','join','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','OrderBy','alias','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','select','item','from','additionalPhone_','field','cm_contact_has_items','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','User'];(function(_0x15590f,_0x520d76){var _0x459dab=function(_0x7bbdaa){while(--_0x7bbdaa){_0x15590f['push'](_0x15590f['shift']());}};_0x459dab(++_0x520d76);}(_0xc25e,0x1f0));var _0xec25=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xc25e[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xec25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec25('0x1'));var jsonpatch=require(_0xec25('0x2'));var rp=require(_0xec25('0x3'));var moment=require('moment');var BPromise=require(_0xec25('0x4'));var Mustache=require(_0xec25('0x5'));var util=require(_0xec25('0x6'));var path=require(_0xec25('0x7'));var sox=require(_0xec25('0x8'));var csv=require(_0xec25('0x9'));var ejs=require(_0xec25('0xa'));var fs=require('fs');var fs_extra=require(_0xec25('0xb'));var _=require(_0xec25('0xc'));var squel=require(_0xec25('0xd'));var crypto=require(_0xec25('0xe'));var jsforce=require(_0xec25('0xf'));var deskjs=require(_0xec25('0x10'));var toCsv=require('to-csv');var querystring=require(_0xec25('0x11'));var Papa=require(_0xec25('0x12'));var Redis=require(_0xec25('0x13'));var authService=require(_0xec25('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xec25('0x15'));var hardwareService=require(_0xec25('0x16'));var logger=require('../../config/logger')(_0xec25('0x17'));var utils=require(_0xec25('0x18'));var config=require(_0xec25('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xec25('0x1a'))['db'];var csv_results;config[_0xec25('0x1b')]=_[_0xec25('0x1c')](config[_0xec25('0x1b')],{'host':_0xec25('0x1d'),'port':0x18eb});var socket=require(_0xec25('0x1e'))(new Redis(config['redis']));require(_0xec25('0x1f'))[_0xec25('0x20')](socket);function respondWithStatusCode(_0x10c266,_0x15d001){_0x15d001=_0x15d001||0xcc;return function(_0x1d1165){if(_0x1d1165){return _0x10c266[_0xec25('0x21')](_0x15d001);}return _0x10c266[_0xec25('0x22')](_0x15d001)[_0xec25('0x23')]();};}function respondWithResult(_0x4f0aad,_0x1e5626){_0x1e5626=_0x1e5626||0xc8;return function(_0x408cb7){if(_0x408cb7){return _0x4f0aad['status'](_0x1e5626)[_0xec25('0x24')](_0x408cb7);}};}function respondWithFilteredResult(_0x4ffa1f,_0x1778fb){return function(_0x5701d7){if(_0x5701d7){var _0x26c9d7=typeof _0x1778fb['offset']===_0xec25('0x25')&&typeof _0x1778fb[_0xec25('0x26')]===_0xec25('0x25');var _0x3506cd=_0x5701d7[_0xec25('0x27')];var _0x47db40=_0x26c9d7?0x0:_0x1778fb['offset'];var _0x5139f4=_0x26c9d7?_0x5701d7['count']:_0x1778fb[_0xec25('0x28')]+_0x1778fb[_0xec25('0x26')];var _0x1d28f8;if(_0x5139f4>=_0x3506cd){_0x5139f4=_0x3506cd;_0x1d28f8=0xc8;}else{_0x1d28f8=0xce;}_0x4ffa1f[_0xec25('0x22')](_0x1d28f8);return _0x4ffa1f[_0xec25('0x29')](_0xec25('0x2a'),_0x47db40+'-'+_0x5139f4+'/'+_0x3506cd)['json'](_0x5701d7);}return null;};}function patchUpdates(_0x3bdec4){return function(_0x3744fd){try{jsonpatch['apply'](_0x3744fd,_0x3bdec4,!![]);}catch(_0x1c8053){return BPromise[_0xec25('0x2b')](_0x1c8053);}return _0x3744fd['save']();};}function saveUpdates(_0x356172,_0x513b59){return function(_0x2ce66b){if(_0x2ce66b){return _0x2ce66b[_0xec25('0x2c')](_0x356172)[_0xec25('0x2d')](function(_0x181a7f){return _0x181a7f;});}return null;};}function removeEntity(_0x2b80d1,_0x117b8f){return function(_0x164c5c){if(_0x164c5c){return _0x164c5c[_0xec25('0x2e')]()['then'](function(){var _0x19f76e=_0x164c5c['get']({'plain':!![]});var _0xe68f4a=_0xec25('0x2f');return db[_0xec25('0x30')][_0xec25('0x2e')]({'where':{'type':_0xe68f4a,'resourceId':_0x19f76e['id']}})['then'](function(){return _0x164c5c;});})[_0xec25('0x2d')](function(){_0x2b80d1[_0xec25('0x22')](0xcc)[_0xec25('0x23')]();});}};}function handleEntityNotFound(_0x360122,_0x5728d1){return function(_0x2fbd2d){if(!_0x2fbd2d){_0x360122[_0xec25('0x21')](0x194);}return _0x2fbd2d;};}function handleError(_0xfe909e,_0xd3ad8a){_0xd3ad8a=_0xd3ad8a||0x1f4;return function(_0x3a57f3){logger['error'](_0x3a57f3['stack']);if(_0x3a57f3['name']){delete _0x3a57f3[_0xec25('0x31')];}_0xfe909e[_0xec25('0x22')](_0xd3ad8a)[_0xec25('0x32')](_0x3a57f3);};}exports[_0xec25('0x33')]=function(_0x5e5575,_0x4f5dff){var _0x106e42={},_0xb5d8b2={},_0x438dac={'count':0x0,'rows':[]};var _0x172453=_[_0xec25('0x34')](db[_0xec25('0x35')][_0xec25('0x36')],function(_0x1fca47){return{'name':_0x1fca47[_0xec25('0x37')],'type':_0x1fca47[_0xec25('0x38')][_0xec25('0x39')]};});_0xb5d8b2[_0xec25('0x3a')]=_[_0xec25('0x34')](_0x172453,'name');_0xb5d8b2[_0xec25('0x3b')]=_['keys'](_0x5e5575[_0xec25('0x3b')]);_0xb5d8b2[_0xec25('0x3c')]=_['intersection'](_0xb5d8b2[_0xec25('0x3a')],_0xb5d8b2[_0xec25('0x3b')]);_0x106e42['attributes']=_['intersection'](_0xb5d8b2['model'],qs[_0xec25('0x3d')](_0x5e5575[_0xec25('0x3b')][_0xec25('0x3d')]));_0x106e42[_0xec25('0x3e')]=_0x106e42['attributes'][_0xec25('0x3f')]?_0x106e42[_0xec25('0x3e')]:_0xb5d8b2[_0xec25('0x3a')];if(!_0x5e5575[_0xec25('0x3b')][_0xec25('0x40')](_0xec25('0x41'))){_0x106e42[_0xec25('0x26')]=qs[_0xec25('0x26')](_0x5e5575[_0xec25('0x3b')][_0xec25('0x26')]);_0x106e42[_0xec25('0x28')]=qs[_0xec25('0x28')](_0x5e5575['query'][_0xec25('0x28')]);}_0x106e42['order']=qs[_0xec25('0x42')](_0x5e5575[_0xec25('0x3b')]['sort']);_0x106e42[_0xec25('0x43')]=qs['filters'](_[_0xec25('0x44')](_0x5e5575['query'],_0xb5d8b2[_0xec25('0x3c')]),_0x172453);if(_0x5e5575[_0xec25('0x3b')][_0xec25('0x45')]){_0x106e42['where']=_[_0xec25('0x46')](_0x106e42[_0xec25('0x43')],{'$or':_['map'](_0x172453,function(_0x5b5971){if(_0x5b5971[_0xec25('0x38')]!==_0xec25('0x47')){var _0x480739={};_0x480739[_0x5b5971[_0xec25('0x31')]]={'$like':'%'+_0x5e5575[_0xec25('0x3b')]['filter']+'%'};return _0x480739;}})});}_0x106e42=_[_0xec25('0x46')]({},_0x106e42,_0x5e5575[_0xec25('0x48')]);var _0x37463f={'where':_0x106e42[_0xec25('0x43')]};return db['CmList'][_0xec25('0x27')](_0x37463f)['then'](function(_0x1f36e8){_0x438dac[_0xec25('0x27')]=_0x1f36e8;if(_0x5e5575[_0xec25('0x3b')]['includeAll']){_0x106e42[_0xec25('0x49')]=[{'all':!![]}];}return db[_0xec25('0x35')][_0xec25('0x4a')](_0x106e42);})[_0xec25('0x2d')](function(_0x4e3f84){_0x438dac[_0xec25('0x4b')]=_0x4e3f84;return _0x438dac;})['then'](respondWithFilteredResult(_0x4f5dff,_0x106e42))[_0xec25('0x4c')](handleError(_0x4f5dff,null));};exports[_0xec25('0x4d')]=function(_0x377860,_0x4ea2dd){var _0x523223={'raw':![],'where':{'id':_0x377860[_0xec25('0x4e')]['id']}},_0x364023={};_0x364023[_0xec25('0x3a')]=_[_0xec25('0x4f')](db[_0xec25('0x35')][_0xec25('0x36')]);_0x364023['query']=_['keys'](_0x377860[_0xec25('0x3b')]);_0x364023['filters']=_['intersection'](_0x364023[_0xec25('0x3a')],_0x364023[_0xec25('0x3b')]);_0x523223['attributes']=_['intersection'](_0x364023[_0xec25('0x3a')],qs[_0xec25('0x3d')](_0x377860[_0xec25('0x3b')]['fields']));_0x523223[_0xec25('0x3e')]=_0x523223[_0xec25('0x3e')]['length']?_0x523223[_0xec25('0x3e')]:_0x364023[_0xec25('0x3a')];if(_0x377860['query'][_0xec25('0x50')]){_0x523223['include']=[{'all':!![]}];}_0x523223=_[_0xec25('0x46')]({},_0x523223,_0x377860[_0xec25('0x48')]);return db[_0xec25('0x35')][_0xec25('0x51')](_0x523223)[_0xec25('0x2d')](handleEntityNotFound(_0x4ea2dd,null))['then'](respondWithResult(_0x4ea2dd,null))[_0xec25('0x4c')](handleError(_0x4ea2dd,null));};exports[_0xec25('0x52')]=function(_0x55add5,_0x4f8f94){return db[_0xec25('0x35')]['create'](_0x55add5[_0xec25('0x53')],{})['then'](function(_0x3428d0){var _0x4ca1dd=_0x55add5['user'][_0xec25('0x54')]({'plain':!![]});if(!_0x4ca1dd)throw new Error(_0xec25('0x55'));if(_0x4ca1dd[_0xec25('0x56')]===_0xec25('0x57')){var _0x41afcf=_0x3428d0[_0xec25('0x54')]({'plain':!![]});var _0x3ed3e7='Lists';return db[_0xec25('0x58')][_0xec25('0x51')]({'where':{'name':_0x3ed3e7,'userProfileId':_0x4ca1dd['userProfileId']},'raw':!![]})[_0xec25('0x2d')](function(_0x2d259b){if(_0x2d259b&&_0x2d259b['autoAssociation']===0x0){return db[_0xec25('0x30')][_0xec25('0x52')]({'name':_0x41afcf['name'],'resourceId':_0x41afcf['id'],'type':_0x2d259b['name'],'sectionId':_0x2d259b['id']},{})[_0xec25('0x2d')](function(){return _0x3428d0;});}else{return _0x3428d0;}})[_0xec25('0x4c')](function(_0x595827){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x595827);throw _0x595827;});}return _0x3428d0;})['then'](respondWithResult(_0x4f8f94,0xc9))[_0xec25('0x4c')](handleError(_0x4f8f94,null));};exports[_0xec25('0x2c')]=function(_0xada79e,_0xa39f7e){if(_0xada79e['body']['id']){delete _0xada79e[_0xec25('0x53')]['id'];}return db['CmList'][_0xec25('0x51')]({'where':{'id':_0xada79e[_0xec25('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa39f7e,null))['then'](saveUpdates(_0xada79e[_0xec25('0x53')],null))[_0xec25('0x2d')](respondWithResult(_0xa39f7e,null))[_0xec25('0x4c')](handleError(_0xa39f7e,null));};exports[_0xec25('0x2e')]=function(_0x4629ce,_0x27af0e){return db[_0xec25('0x35')][_0xec25('0x51')]({'where':{'id':_0x4629ce['params']['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x27af0e,null))['then'](removeEntity(_0x27af0e,null))['catch'](handleError(_0x27af0e,null));};exports[_0xec25('0x59')]=function(_0x22c59a,_0x3a6eb9){return db['CmList'][_0xec25('0x59')]()[_0xec25('0x2d')](respondWithResult(_0x3a6eb9,null))[_0xec25('0x4c')](handleError(_0x3a6eb9,null));};exports[_0xec25('0x5a')]=function(_0x2e650a,_0x202492,_0x3fd676){if(_0x2e650a[_0xec25('0x53')]['id']){delete _0x2e650a[_0xec25('0x53')]['id'];}return db[_0xec25('0x35')][_0xec25('0x51')]({'where':{'id':_0x2e650a[_0xec25('0x4e')]['id']}})['then'](handleEntityNotFound(_0x202492,null))[_0xec25('0x2d')](function(_0x481926){if(_0x481926){_0x2e650a[_0xec25('0x53')][_0xec25('0x5b')]=_0x481926['id'];return db[_0xec25('0x5c')]['create'](_0x2e650a[_0xec25('0x53')]);}})[_0xec25('0x2d')](respondWithResult(_0x202492,null))['catch'](handleError(_0x202492,null));};exports[_0xec25('0x5d')]=function(_0x5b6185,_0xa112a8,_0x1aa3b1){var _0x4a3f61={'raw':![],'where':{}};var _0x192f9b={};var _0x25157e={'count':0x0,'rows':[]};return db['CmList'][_0xec25('0x5e')]({'where':{'id':_0x5b6185['params']['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0xa112a8,null))[_0xec25('0x2d')](function(_0x32da23){if(_0x32da23){_0x192f9b['model']=_[_0xec25('0x4f')](db[_0xec25('0x5c')][_0xec25('0x36')]);_0x192f9b[_0xec25('0x3b')]=_['keys'](_0x5b6185['query']);_0x192f9b['filters']=_[_0xec25('0x5f')](_0x192f9b[_0xec25('0x3a')],_0x192f9b[_0xec25('0x3b')]);_0x4a3f61[_0xec25('0x3e')]=_[_0xec25('0x5f')](_0x192f9b[_0xec25('0x3a')],qs['fields'](_0x5b6185[_0xec25('0x3b')]['fields']));_0x4a3f61[_0xec25('0x3e')]=_0x4a3f61['attributes'][_0xec25('0x3f')]?_0x4a3f61[_0xec25('0x3e')]:_0x192f9b[_0xec25('0x3a')];if(!_0x5b6185[_0xec25('0x3b')][_0xec25('0x40')](_0xec25('0x41'))){_0x4a3f61[_0xec25('0x26')]=qs[_0xec25('0x26')](_0x5b6185[_0xec25('0x3b')][_0xec25('0x26')]);_0x4a3f61[_0xec25('0x28')]=qs['offset'](_0x5b6185[_0xec25('0x3b')][_0xec25('0x28')]);}_0x4a3f61[_0xec25('0x60')]=qs[_0xec25('0x42')](_0x5b6185['query']['sort']);_0x4a3f61[_0xec25('0x43')]=qs[_0xec25('0x3c')](_[_0xec25('0x44')](_0x5b6185[_0xec25('0x3b')],_0x192f9b[_0xec25('0x3c')]));_0x4a3f61['where'][_0xec25('0x5b')]=_0x32da23['id'];if(_0x5b6185[_0xec25('0x3b')]['filter']){_0x4a3f61[_0xec25('0x43')]=_[_0xec25('0x46')](_0x4a3f61[_0xec25('0x43')],{'$or':_[_0xec25('0x34')](_0x4a3f61['attributes'],function(_0x3e945b){var _0x108114={};_0x108114[_0x3e945b]={'$like':'%'+_0x5b6185[_0xec25('0x3b')]['filter']+'%'};return _0x108114;})});}_0x4a3f61=_[_0xec25('0x46')]({},_0x4a3f61,_0x5b6185[_0xec25('0x48')]);return db[_0xec25('0x5c')]['count']({'where':_0x4a3f61[_0xec25('0x43')]})[_0xec25('0x2d')](function(_0xa7dcc4){_0x25157e['count']=_0xa7dcc4;if(_0x5b6185[_0xec25('0x3b')]['includeAll']){_0x4a3f61[_0xec25('0x49')]=[{'all':!![]}];}return db[_0xec25('0x5c')][_0xec25('0x4a')](_0x4a3f61);})[_0xec25('0x2d')](function(_0x3d6f17){_0x25157e[_0xec25('0x4b')]=_0x3d6f17;return _0x25157e;});}})[_0xec25('0x2d')](respondWithFilteredResult(_0xa112a8,_0x4a3f61))[_0xec25('0x4c')](handleError(_0xa112a8,null));};exports[_0xec25('0x61')]=function(_0x2331e0,_0x541eea,_0x357ebd){return db[_0xec25('0x35')]['find']({'where':{'id':_0x2331e0['params']['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x541eea,null))['then'](function(_0x3af5a1){if(_0x3af5a1){return _0x3af5a1[_0xec25('0x61')](_0x2331e0['query'][_0xec25('0x62')]);}})[_0xec25('0x2d')](respondWithStatusCode(_0x541eea,null))[_0xec25('0x4c')](handleError(_0x541eea,null));};exports['addContacts']=function(_0xd0f12e,_0x1e72f7,_0x16386c){return db[_0xec25('0x35')][_0xec25('0x51')]({'where':{'id':_0xd0f12e[_0xec25('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e72f7,null))[_0xec25('0x2d')](function(_0xce50cc){if(_0xce50cc){var _0xbfed66=[];var _0x48ba31={'success':[],'errors':[]};return db[_0xec25('0x63')][_0xec25('0x59')]()[_0xec25('0x2d')](function(_0x339552){if(_0xd0f12e['body'][_0xec25('0x64')]&&_['isArray'](_0xd0f12e['body'][_0xec25('0x64')])){if(_0xd0f12e['body'][_0xec25('0x64')][_0xec25('0x3f')]){_0xd0f12e[_0xec25('0x53')]['tags']=_0xd0f12e[_0xec25('0x53')]['tags'][_0xec25('0x65')](';')+';';}else{_0xd0f12e[_0xec25('0x53')][_0xec25('0x64')]=null;}}else{_0xd0f12e['body'][_0xec25('0x64')]=null;}if(_0xd0f12e[_0xec25('0x53')]&&_['isArray'](_0xd0f12e[_0xec25('0x53')])){for(var _0x3f6b67=0x0;_0x3f6b67<_0xd0f12e[_0xec25('0x53')]['length'];_0x3f6b67+=0x1){_0xd0f12e[_0xec25('0x53')][_0x3f6b67][_0xec25('0x5b')]=_0xd0f12e['params']['id'];_0xbfed66['push'](_0xd0f12e['body'][_0x3f6b67]);}return BPromise[_0xec25('0x66')](_0xbfed66,function(_0x2e9770){return db['CmContact'][_0xec25('0x52')](_[_0xec25('0x67')](_0x2e9770,[_0xec25('0x62'),'id'])||{},{'fields':_[_0xec25('0x4f')](_0x339552),'raw':!![]})['then'](function(_0x453d6b){_0x48ba31[_0xec25('0x68')][_0xec25('0x69')](_0x453d6b[_0xec25('0x6a')]);})['catch'](function(_0xea3200){_0x48ba31['errors'][_0xec25('0x69')]({'data':_0x2e9770,'error':_0xea3200[_0xec25('0x6b')]});});})['then'](function(_0x1ad574){return _0x48ba31;})['catch'](function(_0x2f9f59){return _0x2f9f59;});}else{_0x1e72f7[_0xec25('0x22')](0x190)[_0xec25('0x24')]({'message':_0xec25('0x6c')});}});}})[_0xec25('0x2d')](respondWithResult(_0x1e72f7,null))['catch'](handleError(_0x1e72f7,null));};exports[_0xec25('0x6d')]=function(_0x34d77b,_0x4bc2ac,_0xd1b86c){var _0x5acde1;return db[_0xec25('0x35')][_0xec25('0x51')]({'where':{'id':_0x34d77b['params']['id']},'include':[{'model':db[_0xec25('0x6e')],'as':_0xec25('0x6f')}]})[_0xec25('0x2d')](handleEntityNotFound(_0x4bc2ac,null))['then'](function(_0x192f13){if(_0x192f13){_0x5acde1=_0x192f13;return db[_0xec25('0x63')]['rawAttributes'];}})['then'](function(_0x2b4bb5){if(_0x2b4bb5){var _0x10826b={};var _0x5b110c={};_0x5b110c[_0xec25('0x3a')]=_[_0xec25('0x70')](_[_0xec25('0x4f')](_0x2b4bb5),_[_0xec25('0x34')](_0x5acde1[_0xec25('0x6f')],function(_0x44975a){return util[_0xec25('0x71')]('cf_%d',_0x44975a['id']);}));_0x5b110c['query']=_[_0xec25('0x4f')](_0x34d77b[_0xec25('0x3b')]);_0x5b110c[_0xec25('0x3c')]=_['intersection'](_0x5b110c['model'],_0x5b110c[_0xec25('0x3b')]);_0x10826b[_0xec25('0x3e')]=_[_0xec25('0x5f')](_0x5b110c[_0xec25('0x3a')],qs[_0xec25('0x3d')](_0x34d77b['query'][_0xec25('0x3d')]));_0x10826b['attributes']=_0x10826b[_0xec25('0x3e')][_0xec25('0x3f')]?_0x10826b[_0xec25('0x3e')]:_0x5b110c[_0xec25('0x3a')];if(!_0x34d77b[_0xec25('0x3b')]['hasOwnProperty'](_0xec25('0x41'))){_0x10826b[_0xec25('0x26')]=qs[_0xec25('0x26')](_0x34d77b[_0xec25('0x3b')][_0xec25('0x26')]);_0x10826b[_0xec25('0x28')]=qs['offset'](_0x34d77b[_0xec25('0x3b')][_0xec25('0x28')]);}_0x10826b['order']=qs['sort'](_0x34d77b['query'][_0xec25('0x42')]);_0x10826b[_0xec25('0x43')]=qs[_0xec25('0x3c')](_[_0xec25('0x44')](_0x34d77b[_0xec25('0x3b')],_0x5b110c[_0xec25('0x3c')]));_0x10826b[_0xec25('0x72')]=!![];if(_0x34d77b[_0xec25('0x3b')]['filter']){_0x10826b['where']=_['merge'](_0x10826b[_0xec25('0x43')],{'$or':_[_0xec25('0x34')](_0x10826b[_0xec25('0x3e')],function(_0x2ee395){var _0x34c389={};_0x34c389[_0x2ee395]={'$like':'%'+_0x34d77b[_0xec25('0x3b')][_0xec25('0x45')]+'%'};return _0x34c389;})});}_0x10826b=_[_0xec25('0x46')]({},_0x10826b,_0x34d77b[_0xec25('0x48')]);return _0x5acde1[_0xec25('0x6d')](_0x10826b);}})[_0xec25('0x2d')](respondWithResult(_0x4bc2ac,null))[_0xec25('0x4c')](handleError(_0x4bc2ac,null));};exports[_0xec25('0x73')]=function(_0x2f9d3d,_0x469479,_0x5effe9){var _0x11994a;var _0x1fd96a;var _0x1e3fa7;var _0x366794=_0x2f9d3d[_0xec25('0x4e')]['id'];csv_results=[];return db['ContactItemType'][_0xec25('0x4a')]({'attributes':['id',_0xec25('0x31')],'raw':!![],'order':[_0xec25('0x74')]})[_0xec25('0x2d')](function(_0xfa2782){_0x11994a=_0xfa2782;var _0xc6a92f=_[_0xec25('0x4f')](db['CmContact'][_0xec25('0x36')]);return db[_0xec25('0x6e')][_0xec25('0x4a')]({'raw':!![],'attributes':['id',_0xec25('0x75')]})[_0xec25('0x2d')](function(_0x18b5f3){_0x1fd96a=_0x18b5f3;var _0x2dbd02=squel['select']()[_0xec25('0x3d')](_0xc6a92f)['from'](_0xec25('0x76'),'c')[_0xec25('0x43')](_0xec25('0x77'),_0x366794)[_0xec25('0x43')](_0xec25('0x78'))[_0xec25('0x79')]();for(var _0x2a1e08=0x0;_0x2a1e08<_0x1fd96a['length'];_0x2a1e08++){_0x2dbd02['field'](_0xec25('0x7a')+_0x1fd96a[_0x2a1e08]['id'],_0xec25('0x7b')+_0x1fd96a[_0x2a1e08][_0xec25('0x75')]);}for(var _0x2a1e08=0x0;_0x2a1e08<_0x11994a[_0xec25('0x3f')];_0x2a1e08++){_0x2dbd02['field'](squel[_0xec25('0x7c')]()['field'](_0xec25('0x7d'))[_0xec25('0x7e')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x11994a[_0x2a1e08]['id'])[_0xec25('0x43')]('CmContactId\x20=\x20c.id'),_0xec25('0x7f')+_0x11994a[_0x2a1e08][_0xec25('0x31')]);_0x2dbd02[_0xec25('0x80')](squel[_0xec25('0x7c')]()[_0xec25('0x80')]('description')['from'](_0xec25('0x81'))['where']('ItemTypeId\x20=\x20?',_0x11994a[_0x2a1e08]['id'])[_0xec25('0x43')](_0xec25('0x82')),_0xec25('0x83')+_0x11994a[_0x2a1e08][_0xec25('0x31')]);}var _0x4210f1=[];_0x4210f1[_0xec25('0x69')](_0x2dbd02[_0xec25('0x84')]());BPromise['each'](_0x4210f1,handleQuery)[_0xec25('0x2d')](function(_0x1eea42){handleQuery(_0x2dbd02[_0xec25('0x84')]());var _0x470dc4=csv_results[0x0];if(!_['isEmpty'](_0x470dc4)){var _0x5c8998=toCsv(_0x470dc4);var _0x151002=Date['now']();fs[_0xec25('0x85')](util[_0xec25('0x71')](_0xec25('0x86'),_0x366794,_0x151002),_0x5c8998);_0x469479[_0xec25('0x87')](_0xec25('0x88'),_0xec25('0x89')+util[_0xec25('0x71')]('list_%d_%s.csv',_0x366794,_0x151002));_0x469479[_0xec25('0x87')](_0xec25('0x8a'),'text/csv');return _0x469479[_0xec25('0x8b')](util[_0xec25('0x71')](_0xec25('0x86'),_0x366794,_0x151002));}else{return _0x469479[_0xec25('0x21')](0xcc);}});});});};exports[_0xec25('0x8c')]=function(_0x3ec3f9,_0x1d2e9a,_0x51309b){var _0x2368a4;delete _0x3ec3f9[_0xec25('0x53')]['id'];return db[_0xec25('0x35')][_0xec25('0x5e')]({'where':{'id':_0x3ec3f9[_0xec25('0x4e')]['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x1d2e9a,null))[_0xec25('0x2d')](function(_0x2fd62d){if(_0x2fd62d){return db[_0xec25('0x8d')][_0xec25('0x8e')](function(_0x400d7e){return db[_0xec25('0x6e')]['create'](_0x3ec3f9[_0xec25('0x53')],{'transaction':_0x400d7e})[_0xec25('0x2d')](function(_0x4e150e){_0x2368a4=_0x4e150e;return _0x2fd62d[_0xec25('0x8f')](_0x4e150e,{'transaction':_0x400d7e});})['then'](function(){var _0x4dd0ad={'type':db['Sequelize'][_0xec25('0x90')],'transaction':_0x400d7e};switch(_0x3ec3f9['body'][_0xec25('0x38')]){case _0xec25('0x91'):_0x4dd0ad[_0xec25('0x38')]=db[_0xec25('0x92')][_0xec25('0x90')];break;case _0xec25('0x93'):_0x4dd0ad[_0xec25('0x38')]=db[_0xec25('0x92')][_0xec25('0x94')];break;case _0xec25('0x95'):_0x4dd0ad[_0xec25('0x38')]=db[_0xec25('0x92')][_0xec25('0x96')];_0x4dd0ad[_0xec25('0x97')]=![];break;default:}return db['sequelize']['queryInterface'][_0xec25('0x98')](_0xec25('0x76'),util[_0xec25('0x71')](_0xec25('0x99'),_0x2368a4['id']),_0x4dd0ad);})[_0xec25('0x2d')](function(){return _0x2368a4;});});}})[_0xec25('0x2d')](respondWithResult(_0x1d2e9a,null))[_0xec25('0x4c')](handleError(_0x1d2e9a,null));};exports['getCustomFields']=function(_0x3f6581,_0x783ead,_0x4cac44){var _0x5686c6={};var _0x52e123={};var _0x865d01;var _0x1ab9b0;return db[_0xec25('0x35')][_0xec25('0x5e')]({'where':{'id':_0x3f6581['params']['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x783ead,null))[_0xec25('0x2d')](function(_0x395c07){if(_0x395c07){_0x865d01=_0x395c07;_0x52e123[_0xec25('0x3a')]=_[_0xec25('0x4f')](db[_0xec25('0x6e')][_0xec25('0x36')]);_0x52e123[_0xec25('0x3b')]=_[_0xec25('0x4f')](_0x3f6581[_0xec25('0x3b')]);_0x52e123[_0xec25('0x3c')]=_['intersection'](_0x52e123[_0xec25('0x3a')],_0x52e123[_0xec25('0x3b')]);_0x5686c6[_0xec25('0x3e')]=_[_0xec25('0x5f')](_0x52e123[_0xec25('0x3a')],qs[_0xec25('0x3d')](_0x3f6581[_0xec25('0x3b')]['fields']));_0x5686c6['attributes']=_0x5686c6[_0xec25('0x3e')][_0xec25('0x3f')]?_0x5686c6['attributes']:_0x52e123[_0xec25('0x3a')];_0x5686c6['order']=qs[_0xec25('0x42')](_0x3f6581[_0xec25('0x3b')]['sort']);_0x5686c6[_0xec25('0x43')]=qs[_0xec25('0x3c')](_[_0xec25('0x44')](_0x3f6581[_0xec25('0x3b')],_0x52e123[_0xec25('0x3c')]));_0x5686c6[_0xec25('0x43')]=_[_0xec25('0x46')](_0x5686c6[_0xec25('0x43')],{'$or':[{'ListId':_0x395c07['id']},{'ListId':null}]});if(_0x3f6581[_0xec25('0x3b')][_0xec25('0x45')]){_0x5686c6[_0xec25('0x43')]=_[_0xec25('0x46')](_0x5686c6['where'],{'$or':_[_0xec25('0x34')](_0x5686c6[_0xec25('0x3e')],function(_0x30128f){var _0x1af634={};_0x1af634[_0x30128f]={'$like':'%'+_0x3f6581[_0xec25('0x3b')][_0xec25('0x45')]+'%'};return _0x1af634;})});}_0x5686c6=_[_0xec25('0x46')]({},_0x5686c6,_0x3f6581[_0xec25('0x48')]);return db['CmCustomField'][_0xec25('0x9a')](_0x5686c6);}})['then'](respondWithResult(_0x783ead,null))[_0xec25('0x4c')](handleError(_0x783ead,null));};exports[_0xec25('0x9b')]=function(_0x3ec81e,_0x5860c6){return db[_0xec25('0x6e')][_0xec25('0x9a')]({'where':{'ListId':null}})[_0xec25('0x2d')](handleEntityNotFound(_0x5860c6,null))[_0xec25('0x2d')](function(_0x2b201d){return _0x2b201d;})[_0xec25('0x2d')](respondWithResult(_0x5860c6,null))[_0xec25('0x4c')](handleError(_0x5860c6,null));};exports[_0xec25('0x9c')]=function(_0x2fe13d,_0x19c93e,_0x2f51b2){return db[_0xec25('0x35')]['find']({'where':{'id':_0x2fe13d[_0xec25('0x4e')]['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x19c93e,null))['then'](function(_0x15af50){if(_0x15af50){return _0x15af50[_0xec25('0x9c')](_0x2fe13d['body'][_0xec25('0x62')],_[_0xec25('0x67')](_0x2fe13d[_0xec25('0x53')],[_0xec25('0x62'),'id'])||{})[_0xec25('0x9d')](function(_0x5c3e29){for(var _0x2ef126=0x0;_0x2ef126<_0x2fe13d[_0xec25('0x53')][_0xec25('0x62')][_0xec25('0x3f')];_0x2ef126+=0x1){socket[_0xec25('0x9e')](_0xec25('0x9f'),{'UserId':Number(_0x2fe13d['body'][_0xec25('0x62')][_0x2ef126]),'CmListId':Number(_0x2fe13d[_0xec25('0x4e')]['id'])});}return _0x5c3e29;});}})[_0xec25('0x2d')](respondWithResult(_0x19c93e,null))[_0xec25('0x4c')](handleError(_0x19c93e,null));};exports[_0xec25('0xa0')]=function(_0x498fa0,_0x13505e,_0x300420){return db[_0xec25('0x35')]['find']({'where':{'id':_0x498fa0[_0xec25('0x4e')]['id']}})[_0xec25('0x2d')](handleEntityNotFound(_0x13505e,null))['then'](function(_0x410d47){if(_0x410d47){return _0x410d47[_0xec25('0xa0')](_0x498fa0[_0xec25('0x3b')][_0xec25('0x62')])[_0xec25('0x2d')](function(){if(_[_0xec25('0xa1')](_0x498fa0['query']['ids'])){for(var _0x16d385=0x0;_0x16d385<_0x498fa0[_0xec25('0x3b')][_0xec25('0x62')][_0xec25('0x3f')];_0x16d385+=0x1){socket[_0xec25('0x9e')](_0xec25('0xa2'),{'UserId':Number(_0x498fa0[_0xec25('0x3b')][_0xec25('0x62')][_0x16d385]),'CmListId':Number(_0x498fa0['params']['id'])});}}else{socket[_0xec25('0x9e')]('userCmList:remove',{'UserId':Number(_0x498fa0[_0xec25('0x3b')][_0xec25('0x62')]),'CmListId':Number(_0x498fa0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x13505e,null))[_0xec25('0x4c')](handleError(_0x13505e,null));};exports['getAgents']=function(_0x3e5959,_0x4534a8,_0x259555){var _0x3ba6a0={};var _0x3a04a9={};var _0x2d48fa;var _0x297daa;return db[_0xec25('0x35')]['findOne']({'where':{'id':_0x3e5959[_0xec25('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4534a8,null))['then'](function(_0x3b732a){if(_0x3b732a){_0x2d48fa=_0x3b732a;_0x3a04a9[_0xec25('0x3a')]=_[_0xec25('0x4f')](db[_0xec25('0xa3')][_0xec25('0x36')]);_0x3a04a9['query']=_[_0xec25('0x4f')](_0x3e5959[_0xec25('0x3b')]);_0x3a04a9['filters']=_[_0xec25('0x5f')](_0x3a04a9[_0xec25('0x3a')],_0x3a04a9[_0xec25('0x3b')]);_0x3ba6a0[_0xec25('0x3e')]=_['intersection'](_0x3a04a9[_0xec25('0x3a')],qs[_0xec25('0x3d')](_0x3e5959[_0xec25('0x3b')]['fields']));_0x3ba6a0[_0xec25('0x3e')]=_0x3ba6a0[_0xec25('0x3e')][_0xec25('0x3f')]?_0x3ba6a0['attributes']:_0x3a04a9[_0xec25('0x3a')];_0x3ba6a0[_0xec25('0x60')]=qs[_0xec25('0x42')](_0x3e5959[_0xec25('0x3b')][_0xec25('0x42')]);_0x3ba6a0[_0xec25('0x43')]=qs['filters'](_[_0xec25('0x44')](_0x3e5959['query'],_0x3a04a9[_0xec25('0x3c')]));if(_0x3e5959[_0xec25('0x3b')]['filter']){_0x3ba6a0[_0xec25('0x43')]=_[_0xec25('0x46')](_0x3ba6a0[_0xec25('0x43')],{'$or':_['map'](_0x3ba6a0[_0xec25('0x3e')],function(_0x162789){var _0x5f2f25={};_0x5f2f25[_0x162789]={'$like':'%'+_0x3e5959[_0xec25('0x3b')][_0xec25('0x45')]+'%'};return _0x5f2f25;})});}_0x3ba6a0=_[_0xec25('0x46')]({},_0x3ba6a0,_0x3e5959[_0xec25('0x48')]);return _0x2d48fa[_0xec25('0xa4')](_0x3ba6a0);}})['then'](function(_0x36440a){if(_0x36440a){_0x297daa=_0x36440a[_0xec25('0x3f')];if(!_0x3e5959[_0xec25('0x3b')][_0xec25('0x40')](_0xec25('0x41'))){_0x3ba6a0[_0xec25('0x26')]=qs[_0xec25('0x26')](_0x3e5959[_0xec25('0x3b')][_0xec25('0x26')]);_0x3ba6a0['offset']=qs[_0xec25('0x28')](_0x3e5959[_0xec25('0x3b')][_0xec25('0x28')]);}return _0x2d48fa[_0xec25('0xa4')](_0x3ba6a0);}})[_0xec25('0x2d')](function(_0x50319c){if(_0x50319c){return _0x50319c?{'count':_0x297daa,'rows':_0x50319c}:null;}})[_0xec25('0x2d')](respondWithResult(_0x4534a8,null))[_0xec25('0x4c')](handleError(_0x4534a8,null));};function handleQuery(_0x23b3ec){logger['info'](_0x23b3ec);return db[_0xec25('0x8d')][_0xec25('0x3b')](_0x23b3ec)[_0xec25('0x9d')](function(_0x56da98){csv_results[_0xec25('0x69')](_0x56da98);})[_0xec25('0x4c')](function(_0x1438bb){logger['error'](_0x1438bb['message']);});} \ No newline at end of file +var _0x937c=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','index','CmList','type','key','model','query','keys','intersection','attributes','fields','length','sort','pick','filters','filter','merge','map','VIRTUAL','where','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','removeDispositions','addContacts','CmContact','tags','join','isArray','push','each','ids','success','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','item','from','cm_contact_has_items','CmContactId\x20=\x20c.id','description','ItemTypeId\x20=\x20?','description_additionalPhone_','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','cf_%s','getGlobalCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','message','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x99203d,_0x2ada85){var _0x2899e3=function(_0x8e1ef0){while(--_0x8e1ef0){_0x99203d['push'](_0x99203d['shift']());}};_0x2899e3(++_0x2ada85);}(_0x937c,0x135));var _0xc937=function(_0x1b5fff,_0x21d5e5){_0x1b5fff=_0x1b5fff-0x0;var _0x1536a4=_0x937c[_0x1b5fff];return _0x1536a4;};'use strict';var emlformat=require(_0xc937('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc937('0x1'));var jsonpatch=require(_0xc937('0x2'));var rp=require(_0xc937('0x3'));var moment=require(_0xc937('0x4'));var BPromise=require(_0xc937('0x5'));var Mustache=require(_0xc937('0x6'));var util=require(_0xc937('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc937('0x8'));var fs=require('fs');var fs_extra=require(_0xc937('0x9'));var _=require(_0xc937('0xa'));var squel=require(_0xc937('0xb'));var crypto=require(_0xc937('0xc'));var jsforce=require(_0xc937('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc937('0xe'));var Redis=require(_0xc937('0xf'));var authService=require(_0xc937('0x10'));var qs=require(_0xc937('0x11'));var as=require(_0xc937('0x12'));var hardwareService=require(_0xc937('0x13'));var logger=require('../../config/logger')(_0xc937('0x14'));var utils=require(_0xc937('0x15'));var config=require(_0xc937('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc937('0x17'))['db'];var csv_results;config[_0xc937('0x18')]=_[_0xc937('0x19')](config[_0xc937('0x18')],{'host':_0xc937('0x1a'),'port':0x18eb});var socket=require(_0xc937('0x1b'))(new Redis(config[_0xc937('0x18')]));require(_0xc937('0x1c'))[_0xc937('0x1d')](socket);function respondWithStatusCode(_0x5dff75,_0x3d3c5e){_0x3d3c5e=_0x3d3c5e||0xcc;return function(_0x326233){if(_0x326233){return _0x5dff75[_0xc937('0x1e')](_0x3d3c5e);}return _0x5dff75[_0xc937('0x1f')](_0x3d3c5e)['end']();};}function respondWithResult(_0x461da5,_0x409d69){_0x409d69=_0x409d69||0xc8;return function(_0x536c67){if(_0x536c67){return _0x461da5[_0xc937('0x1f')](_0x409d69)['json'](_0x536c67);}};}function respondWithFilteredResult(_0x371f30,_0x389a18){return function(_0x304b63){if(_0x304b63){var _0x1132e1=typeof _0x389a18[_0xc937('0x20')]===_0xc937('0x21')&&typeof _0x389a18[_0xc937('0x22')]===_0xc937('0x21');var _0x14cc02=_0x304b63[_0xc937('0x23')];var _0x35834e=_0x1132e1?0x0:_0x389a18[_0xc937('0x20')];var _0x3bbd86=_0x1132e1?_0x304b63[_0xc937('0x23')]:_0x389a18[_0xc937('0x20')]+_0x389a18[_0xc937('0x22')];var _0x2840a7;if(_0x3bbd86>=_0x14cc02){_0x3bbd86=_0x14cc02;_0x2840a7=0xc8;}else{_0x2840a7=0xce;}_0x371f30[_0xc937('0x1f')](_0x2840a7);return _0x371f30[_0xc937('0x24')]('Content-Range',_0x35834e+'-'+_0x3bbd86+'/'+_0x14cc02)[_0xc937('0x25')](_0x304b63);}return null;};}function patchUpdates(_0xebb436){return function(_0x522446){try{jsonpatch['apply'](_0x522446,_0xebb436,!![]);}catch(_0x115541){return BPromise[_0xc937('0x26')](_0x115541);}return _0x522446[_0xc937('0x27')]();};}function saveUpdates(_0x224f49,_0x359a1c){return function(_0x28b1bb){if(_0x28b1bb){return _0x28b1bb[_0xc937('0x28')](_0x224f49)[_0xc937('0x29')](function(_0x62683d){return _0x62683d;});}return null;};}function removeEntity(_0x2e3826,_0x4ac17f){return function(_0x18a1af){if(_0x18a1af){return _0x18a1af[_0xc937('0x2a')]()[_0xc937('0x29')](function(){var _0x137487=_0x18a1af['get']({'plain':!![]});var _0x19e509='Lists';return db[_0xc937('0x2b')]['destroy']({'where':{'type':_0x19e509,'resourceId':_0x137487['id']}})[_0xc937('0x29')](function(){return _0x18a1af;});})[_0xc937('0x29')](function(){_0x2e3826['status'](0xcc)[_0xc937('0x2c')]();});}};}function handleEntityNotFound(_0x383143,_0x2a1cd8){return function(_0xfac41){if(!_0xfac41){_0x383143[_0xc937('0x1e')](0x194);}return _0xfac41;};}function handleError(_0x5d203f,_0x5e0210){_0x5e0210=_0x5e0210||0x1f4;return function(_0x4c22ad){logger[_0xc937('0x2d')](_0x4c22ad[_0xc937('0x2e')]);if(_0x4c22ad['name']){delete _0x4c22ad[_0xc937('0x2f')];}_0x5d203f[_0xc937('0x1f')](_0x5e0210)['send'](_0x4c22ad);};}exports[_0xc937('0x30')]=function(_0x5598e5,_0x566371){var _0x16e0d1={},_0x8a9350={},_0x53ba10={'count':0x0,'rows':[]};var _0x3f27d5=_['map'](db[_0xc937('0x31')]['rawAttributes'],function(_0x499765){return{'name':_0x499765['fieldName'],'type':_0x499765[_0xc937('0x32')][_0xc937('0x33')]};});_0x8a9350[_0xc937('0x34')]=_['map'](_0x3f27d5,_0xc937('0x2f'));_0x8a9350[_0xc937('0x35')]=_[_0xc937('0x36')](_0x5598e5['query']);_0x8a9350['filters']=_[_0xc937('0x37')](_0x8a9350[_0xc937('0x34')],_0x8a9350[_0xc937('0x35')]);_0x16e0d1[_0xc937('0x38')]=_['intersection'](_0x8a9350['model'],qs[_0xc937('0x39')](_0x5598e5[_0xc937('0x35')][_0xc937('0x39')]));_0x16e0d1[_0xc937('0x38')]=_0x16e0d1[_0xc937('0x38')][_0xc937('0x3a')]?_0x16e0d1['attributes']:_0x8a9350['model'];if(!_0x5598e5[_0xc937('0x35')]['hasOwnProperty']('nolimit')){_0x16e0d1['limit']=qs[_0xc937('0x22')](_0x5598e5[_0xc937('0x35')]['limit']);_0x16e0d1[_0xc937('0x20')]=qs[_0xc937('0x20')](_0x5598e5[_0xc937('0x35')]['offset']);}_0x16e0d1['order']=qs[_0xc937('0x3b')](_0x5598e5['query']['sort']);_0x16e0d1['where']=qs['filters'](_[_0xc937('0x3c')](_0x5598e5[_0xc937('0x35')],_0x8a9350[_0xc937('0x3d')]),_0x3f27d5);if(_0x5598e5[_0xc937('0x35')][_0xc937('0x3e')]){_0x16e0d1['where']=_[_0xc937('0x3f')](_0x16e0d1['where'],{'$or':_[_0xc937('0x40')](_0x3f27d5,function(_0x52a67f){if(_0x52a67f['type']!==_0xc937('0x41')){var _0x1d39d2={};_0x1d39d2[_0x52a67f[_0xc937('0x2f')]]={'$like':'%'+_0x5598e5[_0xc937('0x35')][_0xc937('0x3e')]+'%'};return _0x1d39d2;}})});}_0x16e0d1=_[_0xc937('0x3f')]({},_0x16e0d1,_0x5598e5['options']);var _0x3ea8b3={'where':_0x16e0d1[_0xc937('0x42')]};return db[_0xc937('0x31')][_0xc937('0x23')](_0x3ea8b3)[_0xc937('0x29')](function(_0x4473f9){_0x53ba10['count']=_0x4473f9;if(_0x5598e5[_0xc937('0x35')][_0xc937('0x43')]){_0x16e0d1[_0xc937('0x44')]=[{'all':!![]}];}return db[_0xc937('0x31')][_0xc937('0x45')](_0x16e0d1);})['then'](function(_0x1c4048){_0x53ba10[_0xc937('0x46')]=_0x1c4048;return _0x53ba10;})[_0xc937('0x29')](respondWithFilteredResult(_0x566371,_0x16e0d1))['catch'](handleError(_0x566371,null));};exports[_0xc937('0x47')]=function(_0x363ed6,_0x380e4e){var _0x19a39b={'raw':![],'where':{'id':_0x363ed6[_0xc937('0x48')]['id']}},_0x400604={};_0x400604[_0xc937('0x34')]=_[_0xc937('0x36')](db['CmList'][_0xc937('0x49')]);_0x400604[_0xc937('0x35')]=_['keys'](_0x363ed6['query']);_0x400604[_0xc937('0x3d')]=_[_0xc937('0x37')](_0x400604[_0xc937('0x34')],_0x400604[_0xc937('0x35')]);_0x19a39b[_0xc937('0x38')]=_[_0xc937('0x37')](_0x400604[_0xc937('0x34')],qs['fields'](_0x363ed6[_0xc937('0x35')][_0xc937('0x39')]));_0x19a39b[_0xc937('0x38')]=_0x19a39b[_0xc937('0x38')][_0xc937('0x3a')]?_0x19a39b[_0xc937('0x38')]:_0x400604[_0xc937('0x34')];if(_0x363ed6[_0xc937('0x35')]['includeAll']){_0x19a39b[_0xc937('0x44')]=[{'all':!![]}];}_0x19a39b=_[_0xc937('0x3f')]({},_0x19a39b,_0x363ed6[_0xc937('0x4a')]);return db['CmList'][_0xc937('0x4b')](_0x19a39b)[_0xc937('0x29')](handleEntityNotFound(_0x380e4e,null))['then'](respondWithResult(_0x380e4e,null))[_0xc937('0x4c')](handleError(_0x380e4e,null));};exports[_0xc937('0x4d')]=function(_0x205d0d,_0x3db9bf){return db[_0xc937('0x31')][_0xc937('0x4d')](_0x205d0d[_0xc937('0x4e')],{})['then'](function(_0x8cb9ef){var _0x562b3d=_0x205d0d[_0xc937('0x4f')][_0xc937('0x50')]({'plain':!![]});if(!_0x562b3d)throw new Error(_0xc937('0x51'));if(_0x562b3d[_0xc937('0x52')]===_0xc937('0x4f')){var _0xb44170=_0x8cb9ef[_0xc937('0x50')]({'plain':!![]});var _0x4bf1f0=_0xc937('0x53');return db[_0xc937('0x54')][_0xc937('0x4b')]({'where':{'name':_0x4bf1f0,'userProfileId':_0x562b3d[_0xc937('0x55')]},'raw':!![]})['then'](function(_0x3c0ffd){if(_0x3c0ffd&&_0x3c0ffd['autoAssociation']===0x0){return db[_0xc937('0x2b')][_0xc937('0x4d')]({'name':_0xb44170[_0xc937('0x2f')],'resourceId':_0xb44170['id'],'type':_0x3c0ffd[_0xc937('0x2f')],'sectionId':_0x3c0ffd['id']},{})[_0xc937('0x29')](function(){return _0x8cb9ef;});}else{return _0x8cb9ef;}})[_0xc937('0x4c')](function(_0x555d54){logger[_0xc937('0x2d')](_0xc937('0x56'),_0x555d54);throw _0x555d54;});}return _0x8cb9ef;})[_0xc937('0x29')](respondWithResult(_0x3db9bf,0xc9))[_0xc937('0x4c')](handleError(_0x3db9bf,null));};exports[_0xc937('0x28')]=function(_0x495d34,_0xe0b8e5){if(_0x495d34['body']['id']){delete _0x495d34['body']['id'];}return db['CmList'][_0xc937('0x4b')]({'where':{'id':_0x495d34[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0xe0b8e5,null))[_0xc937('0x29')](saveUpdates(_0x495d34[_0xc937('0x4e')],null))[_0xc937('0x29')](respondWithResult(_0xe0b8e5,null))[_0xc937('0x4c')](handleError(_0xe0b8e5,null));};exports[_0xc937('0x2a')]=function(_0x26a748,_0x5ad03e){return db[_0xc937('0x31')][_0xc937('0x4b')]({'where':{'id':_0x26a748[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x5ad03e,null))['then'](removeEntity(_0x5ad03e,null))[_0xc937('0x4c')](handleError(_0x5ad03e,null));};exports['describe']=function(_0xc4563,_0x1935c4){return db[_0xc937('0x31')]['describe']()['then'](respondWithResult(_0x1935c4,null))[_0xc937('0x4c')](handleError(_0x1935c4,null));};exports[_0xc937('0x57')]=function(_0x392dd8,_0x430a49,_0x283605){if(_0x392dd8[_0xc937('0x4e')]['id']){delete _0x392dd8[_0xc937('0x4e')]['id'];}return db[_0xc937('0x31')]['find']({'where':{'id':_0x392dd8[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x430a49,null))[_0xc937('0x29')](function(_0x5061fe){if(_0x5061fe){_0x392dd8[_0xc937('0x4e')][_0xc937('0x58')]=_0x5061fe['id'];return db[_0xc937('0x59')][_0xc937('0x4d')](_0x392dd8[_0xc937('0x4e')]);}})[_0xc937('0x29')](respondWithResult(_0x430a49,null))[_0xc937('0x4c')](handleError(_0x430a49,null));};exports[_0xc937('0x5a')]=function(_0x30cc61,_0x2ef83d,_0x1e272d){var _0x2e18c8={'raw':![],'where':{}};var _0x505f8c={};var _0x361fa0={'count':0x0,'rows':[]};return db[_0xc937('0x31')][_0xc937('0x5b')]({'where':{'id':_0x30cc61[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x2ef83d,null))['then'](function(_0x2b877a){if(_0x2b877a){_0x505f8c[_0xc937('0x34')]=_['keys'](db[_0xc937('0x59')][_0xc937('0x49')]);_0x505f8c[_0xc937('0x35')]=_[_0xc937('0x36')](_0x30cc61[_0xc937('0x35')]);_0x505f8c['filters']=_['intersection'](_0x505f8c[_0xc937('0x34')],_0x505f8c[_0xc937('0x35')]);_0x2e18c8[_0xc937('0x38')]=_[_0xc937('0x37')](_0x505f8c['model'],qs[_0xc937('0x39')](_0x30cc61['query'][_0xc937('0x39')]));_0x2e18c8[_0xc937('0x38')]=_0x2e18c8[_0xc937('0x38')][_0xc937('0x3a')]?_0x2e18c8['attributes']:_0x505f8c[_0xc937('0x34')];if(!_0x30cc61[_0xc937('0x35')][_0xc937('0x5c')](_0xc937('0x5d'))){_0x2e18c8[_0xc937('0x22')]=qs['limit'](_0x30cc61[_0xc937('0x35')][_0xc937('0x22')]);_0x2e18c8[_0xc937('0x20')]=qs[_0xc937('0x20')](_0x30cc61['query'][_0xc937('0x20')]);}_0x2e18c8[_0xc937('0x5e')]=qs[_0xc937('0x3b')](_0x30cc61[_0xc937('0x35')][_0xc937('0x3b')]);_0x2e18c8['where']=qs[_0xc937('0x3d')](_['pick'](_0x30cc61[_0xc937('0x35')],_0x505f8c[_0xc937('0x3d')]));_0x2e18c8[_0xc937('0x42')][_0xc937('0x58')]=_0x2b877a['id'];if(_0x30cc61[_0xc937('0x35')]['filter']){_0x2e18c8['where']=_[_0xc937('0x3f')](_0x2e18c8['where'],{'$or':_[_0xc937('0x40')](_0x2e18c8[_0xc937('0x38')],function(_0x509200){var _0x1bb6e2={};_0x1bb6e2[_0x509200]={'$like':'%'+_0x30cc61[_0xc937('0x35')][_0xc937('0x3e')]+'%'};return _0x1bb6e2;})});}_0x2e18c8=_[_0xc937('0x3f')]({},_0x2e18c8,_0x30cc61[_0xc937('0x4a')]);return db[_0xc937('0x59')][_0xc937('0x23')]({'where':_0x2e18c8[_0xc937('0x42')]})[_0xc937('0x29')](function(_0x4fe668){_0x361fa0[_0xc937('0x23')]=_0x4fe668;if(_0x30cc61[_0xc937('0x35')][_0xc937('0x43')]){_0x2e18c8[_0xc937('0x44')]=[{'all':!![]}];}return db[_0xc937('0x59')][_0xc937('0x45')](_0x2e18c8);})['then'](function(_0x4e76d2){_0x361fa0[_0xc937('0x46')]=_0x4e76d2;return _0x361fa0;});}})[_0xc937('0x29')](respondWithFilteredResult(_0x2ef83d,_0x2e18c8))['catch'](handleError(_0x2ef83d,null));};exports[_0xc937('0x5f')]=function(_0x15aa8b,_0x12191f,_0x2830ae){return db['CmList']['find']({'where':{'id':_0x15aa8b['params']['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x12191f,null))[_0xc937('0x29')](function(_0x462b01){if(_0x462b01){return _0x462b01['removeDispositions'](_0x15aa8b[_0xc937('0x35')]['ids']);}})[_0xc937('0x29')](respondWithStatusCode(_0x12191f,null))[_0xc937('0x4c')](handleError(_0x12191f,null));};exports[_0xc937('0x60')]=function(_0x302218,_0x3c06a5,_0x2d58a8){return db['CmList'][_0xc937('0x4b')]({'where':{'id':_0x302218[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x3c06a5,null))['then'](function(_0x54c996){if(_0x54c996){var _0x564822=[];var _0x130b2c={'success':[],'errors':[]};return db[_0xc937('0x61')]['describe']()[_0xc937('0x29')](function(_0x4393ad){if(_0x302218[_0xc937('0x4e')][_0xc937('0x62')]&&_['isArray'](_0x302218[_0xc937('0x4e')]['tags'])){if(_0x302218[_0xc937('0x4e')]['tags'][_0xc937('0x3a')]){_0x302218['body']['tags']=_0x302218['body'][_0xc937('0x62')][_0xc937('0x63')](';')+';';}else{_0x302218[_0xc937('0x4e')][_0xc937('0x62')]=null;}}else{_0x302218[_0xc937('0x4e')][_0xc937('0x62')]=null;}if(_0x302218[_0xc937('0x4e')]&&_[_0xc937('0x64')](_0x302218[_0xc937('0x4e')])){for(var _0x5076f3=0x0;_0x5076f3<_0x302218[_0xc937('0x4e')]['length'];_0x5076f3+=0x1){_0x302218['body'][_0x5076f3]['ListId']=_0x302218['params']['id'];_0x564822[_0xc937('0x65')](_0x302218[_0xc937('0x4e')][_0x5076f3]);}return BPromise[_0xc937('0x66')](_0x564822,function(_0x21a0c6){return db[_0xc937('0x61')][_0xc937('0x4d')](_['omit'](_0x21a0c6,[_0xc937('0x67'),'id'])||{},{'fields':_[_0xc937('0x36')](_0x4393ad),'raw':!![]})['then'](function(_0x4f0436){_0x130b2c[_0xc937('0x68')][_0xc937('0x65')](_0x4f0436[_0xc937('0x69')]);})[_0xc937('0x4c')](function(_0xbe46ac){_0x130b2c['errors'][_0xc937('0x65')]({'data':_0x21a0c6,'error':_0xbe46ac['message']});});})[_0xc937('0x29')](function(_0x1db0be){return _0x130b2c;})['catch'](function(_0x54e3cd){return _0x54e3cd;});}else{_0x3c06a5[_0xc937('0x1f')](0x190)[_0xc937('0x25')]({'message':_0xc937('0x6a')});}});}})[_0xc937('0x29')](respondWithResult(_0x3c06a5,null))[_0xc937('0x4c')](handleError(_0x3c06a5,null));};exports[_0xc937('0x6b')]=function(_0x3717b2,_0x4c97cb,_0x533d92){var _0xa8e7e7;return db['CmList'][_0xc937('0x4b')]({'where':{'id':_0x3717b2[_0xc937('0x48')]['id']},'include':[{'model':db[_0xc937('0x6c')],'as':'CustomFields'}]})[_0xc937('0x29')](handleEntityNotFound(_0x4c97cb,null))[_0xc937('0x29')](function(_0x5ae82f){if(_0x5ae82f){_0xa8e7e7=_0x5ae82f;return db[_0xc937('0x61')][_0xc937('0x49')];}})[_0xc937('0x29')](function(_0x5c3133){if(_0x5c3133){var _0x341450={};var _0x421a83={};_0x421a83[_0xc937('0x34')]=_[_0xc937('0x6d')](_[_0xc937('0x36')](_0x5c3133),_[_0xc937('0x40')](_0xa8e7e7[_0xc937('0x6e')],function(_0x1bb7cf){return util[_0xc937('0x6f')](_0xc937('0x70'),_0x1bb7cf['id']);}));_0x421a83['query']=_[_0xc937('0x36')](_0x3717b2[_0xc937('0x35')]);_0x421a83['filters']=_[_0xc937('0x37')](_0x421a83[_0xc937('0x34')],_0x421a83[_0xc937('0x35')]);_0x341450['attributes']=_[_0xc937('0x37')](_0x421a83[_0xc937('0x34')],qs['fields'](_0x3717b2[_0xc937('0x35')][_0xc937('0x39')]));_0x341450[_0xc937('0x38')]=_0x341450[_0xc937('0x38')]['length']?_0x341450[_0xc937('0x38')]:_0x421a83['model'];if(!_0x3717b2[_0xc937('0x35')][_0xc937('0x5c')](_0xc937('0x5d'))){_0x341450[_0xc937('0x22')]=qs['limit'](_0x3717b2[_0xc937('0x35')][_0xc937('0x22')]);_0x341450[_0xc937('0x20')]=qs[_0xc937('0x20')](_0x3717b2['query'][_0xc937('0x20')]);}_0x341450['order']=qs['sort'](_0x3717b2['query'][_0xc937('0x3b')]);_0x341450[_0xc937('0x42')]=qs[_0xc937('0x3d')](_[_0xc937('0x3c')](_0x3717b2['query'],_0x421a83[_0xc937('0x3d')]));_0x341450[_0xc937('0x71')]=!![];if(_0x3717b2[_0xc937('0x35')][_0xc937('0x3e')]){_0x341450[_0xc937('0x42')]=_[_0xc937('0x3f')](_0x341450[_0xc937('0x42')],{'$or':_[_0xc937('0x40')](_0x341450[_0xc937('0x38')],function(_0x51083c){var _0x384582={};_0x384582[_0x51083c]={'$like':'%'+_0x3717b2[_0xc937('0x35')][_0xc937('0x3e')]+'%'};return _0x384582;})});}_0x341450=_[_0xc937('0x3f')]({},_0x341450,_0x3717b2['options']);return _0xa8e7e7[_0xc937('0x6b')](_0x341450);}})[_0xc937('0x29')](respondWithResult(_0x4c97cb,null))[_0xc937('0x4c')](handleError(_0x4c97cb,null));};exports[_0xc937('0x72')]=function(_0x6303d,_0x45eb03,_0x41bd8a){var _0x30bc46;var _0x46c689;var _0x14266d;var _0xfa36c1=_0x6303d[_0xc937('0x48')]['id'];csv_results=[];return db[_0xc937('0x73')][_0xc937('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0xc937('0x74')]})[_0xc937('0x29')](function(_0xd68ae7){_0x30bc46=_0xd68ae7;var _0xbdb3b8=_[_0xc937('0x36')](db[_0xc937('0x61')][_0xc937('0x49')]);return db[_0xc937('0x6c')][_0xc937('0x45')]({'raw':!![],'attributes':['id',_0xc937('0x75')]})['then'](function(_0x3ab004){_0x46c689=_0x3ab004;var _0x4e5d08=squel[_0xc937('0x76')]()['fields'](_0xbdb3b8)['from'](_0xc937('0x77'),'c')[_0xc937('0x42')]('c.ListId\x20=\x20?',_0xfa36c1)['where'](_0xc937('0x78'))['distinct']();for(var _0x288022=0x0;_0x288022<_0x46c689[_0xc937('0x3a')];_0x288022++){_0x4e5d08[_0xc937('0x79')](_0xc937('0x7a')+_0x46c689[_0x288022]['id'],'customField_'+_0x46c689[_0x288022][_0xc937('0x75')]);}for(var _0x288022=0x0;_0x288022<_0x30bc46[_0xc937('0x3a')];_0x288022++){_0x4e5d08[_0xc937('0x79')](squel[_0xc937('0x76')]()[_0xc937('0x79')](_0xc937('0x7b'))[_0xc937('0x7c')](_0xc937('0x7d'))[_0xc937('0x42')]('ItemTypeId\x20=\x20?',_0x30bc46[_0x288022]['id'])[_0xc937('0x42')](_0xc937('0x7e')),'additionalPhone_'+_0x30bc46[_0x288022][_0xc937('0x2f')]);_0x4e5d08['field'](squel[_0xc937('0x76')]()[_0xc937('0x79')](_0xc937('0x7f'))['from']('cm_contact_has_items')[_0xc937('0x42')](_0xc937('0x80'),_0x30bc46[_0x288022]['id'])[_0xc937('0x42')](_0xc937('0x7e')),_0xc937('0x81')+_0x30bc46[_0x288022][_0xc937('0x2f')]);}var _0x53fb11=[];_0x53fb11[_0xc937('0x65')](_0x4e5d08['toString']());BPromise[_0xc937('0x66')](_0x53fb11,handleQuery)[_0xc937('0x29')](function(_0x49764a){handleQuery(_0x4e5d08['toString']());var _0x28bb05=csv_results[0x0];if(!_['isEmpty'](_0x28bb05)){var _0x5daa73=toCsv(_0x28bb05);var _0x4e827a=Date[_0xc937('0x82')]();fs[_0xc937('0x83')](util[_0xc937('0x6f')](_0xc937('0x84'),_0xfa36c1,_0x4e827a),_0x5daa73);_0x45eb03[_0xc937('0x85')](_0xc937('0x86'),_0xc937('0x87')+util[_0xc937('0x6f')]('list_%d_%s.csv',_0xfa36c1,_0x4e827a));_0x45eb03['setHeader'](_0xc937('0x88'),_0xc937('0x89'));return _0x45eb03[_0xc937('0x8a')](util[_0xc937('0x6f')]('/tmp/list_%d_%s.csv',_0xfa36c1,_0x4e827a));}else{return _0x45eb03['sendStatus'](0xcc);}});});});};exports[_0xc937('0x8b')]=function(_0x4209c9,_0x394445,_0x1ab42a){var _0x220082;delete _0x4209c9[_0xc937('0x4e')]['id'];return db[_0xc937('0x31')][_0xc937('0x5b')]({'where':{'id':_0x4209c9['params']['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x394445,null))[_0xc937('0x29')](function(_0x1bd99b){if(_0x1bd99b){return db[_0xc937('0x8c')][_0xc937('0x8d')](function(_0x3ec26d){return db[_0xc937('0x6c')][_0xc937('0x4d')](_0x4209c9[_0xc937('0x4e')],{'transaction':_0x3ec26d})[_0xc937('0x29')](function(_0x7b0869){_0x220082=_0x7b0869;return _0x1bd99b[_0xc937('0x8e')](_0x7b0869,{'transaction':_0x3ec26d});})[_0xc937('0x29')](function(){var _0x22be87={'type':db[_0xc937('0x8f')]['TEXT'],'transaction':_0x3ec26d};switch(_0x4209c9[_0xc937('0x4e')]['type']){case _0xc937('0x90'):_0x22be87[_0xc937('0x32')]=db[_0xc937('0x8f')][_0xc937('0x91')];break;case _0xc937('0x92'):_0x22be87[_0xc937('0x32')]=db[_0xc937('0x8f')]['INTEGER'];break;case _0xc937('0x93'):_0x22be87['type']=db[_0xc937('0x8f')][_0xc937('0x94')];_0x22be87[_0xc937('0x95')]=![];break;default:}return db[_0xc937('0x8c')]['queryInterface']['addColumn'](_0xc937('0x77'),util[_0xc937('0x6f')](_0xc937('0x96'),_0x220082['id']),_0x22be87);})['then'](function(){return _0x220082;});});}})[_0xc937('0x29')](respondWithResult(_0x394445,null))[_0xc937('0x4c')](handleError(_0x394445,null));};exports['getCustomFields']=function(_0x5f1295,_0x465c3c,_0x24ae66){var _0xe54f36={};var _0x3fe87b={};var _0x37cedf;var _0x5a42d4;return db[_0xc937('0x31')]['findOne']({'where':{'id':_0x5f1295[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x465c3c,null))['then'](function(_0x234050){if(_0x234050){_0x37cedf=_0x234050;_0x3fe87b[_0xc937('0x34')]=_[_0xc937('0x36')](db[_0xc937('0x6c')]['rawAttributes']);_0x3fe87b['query']=_[_0xc937('0x36')](_0x5f1295['query']);_0x3fe87b['filters']=_[_0xc937('0x37')](_0x3fe87b[_0xc937('0x34')],_0x3fe87b[_0xc937('0x35')]);_0xe54f36[_0xc937('0x38')]=_[_0xc937('0x37')](_0x3fe87b['model'],qs['fields'](_0x5f1295[_0xc937('0x35')][_0xc937('0x39')]));_0xe54f36[_0xc937('0x38')]=_0xe54f36[_0xc937('0x38')][_0xc937('0x3a')]?_0xe54f36[_0xc937('0x38')]:_0x3fe87b['model'];_0xe54f36[_0xc937('0x5e')]=qs[_0xc937('0x3b')](_0x5f1295[_0xc937('0x35')]['sort']);_0xe54f36[_0xc937('0x42')]=qs[_0xc937('0x3d')](_[_0xc937('0x3c')](_0x5f1295[_0xc937('0x35')],_0x3fe87b[_0xc937('0x3d')]));_0xe54f36[_0xc937('0x42')]=_['merge'](_0xe54f36[_0xc937('0x42')],{'$or':[{'ListId':_0x234050['id']},{'ListId':null}]});if(_0x5f1295[_0xc937('0x35')][_0xc937('0x3e')]){_0xe54f36[_0xc937('0x42')]=_[_0xc937('0x3f')](_0xe54f36[_0xc937('0x42')],{'$or':_[_0xc937('0x40')](_0xe54f36[_0xc937('0x38')],function(_0x57f8a8){var _0x54162c={};_0x54162c[_0x57f8a8]={'$like':'%'+_0x5f1295[_0xc937('0x35')][_0xc937('0x3e')]+'%'};return _0x54162c;})});}_0xe54f36=_[_0xc937('0x3f')]({},_0xe54f36,_0x5f1295['options']);return db[_0xc937('0x6c')]['findAndCountAll'](_0xe54f36);}})[_0xc937('0x29')](respondWithResult(_0x465c3c,null))[_0xc937('0x4c')](handleError(_0x465c3c,null));};exports[_0xc937('0x97')]=function(_0x288ee2,_0x41e069){return db[_0xc937('0x6c')][_0xc937('0x98')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x41e069,null))['then'](function(_0x24d532){return _0x24d532;})[_0xc937('0x29')](respondWithResult(_0x41e069,null))[_0xc937('0x4c')](handleError(_0x41e069,null));};exports[_0xc937('0x99')]=function(_0x21c027,_0x34e7dc,_0x3bd99b){return db[_0xc937('0x31')][_0xc937('0x4b')]({'where':{'id':_0x21c027[_0xc937('0x48')]['id']}})[_0xc937('0x29')](handleEntityNotFound(_0x34e7dc,null))[_0xc937('0x29')](function(_0x57c092){if(_0x57c092){return _0x57c092[_0xc937('0x99')](_0x21c027['body'][_0xc937('0x67')],_[_0xc937('0x9a')](_0x21c027['body'],[_0xc937('0x67'),'id'])||{})[_0xc937('0x9b')](function(_0x10c629){for(var _0x116132=0x0;_0x116132<_0x21c027[_0xc937('0x4e')][_0xc937('0x67')][_0xc937('0x3a')];_0x116132+=0x1){socket['emit'](_0xc937('0x9c'),{'UserId':Number(_0x21c027[_0xc937('0x4e')]['ids'][_0x116132]),'CmListId':Number(_0x21c027[_0xc937('0x48')]['id'])});}return _0x10c629;});}})[_0xc937('0x29')](respondWithResult(_0x34e7dc,null))[_0xc937('0x4c')](handleError(_0x34e7dc,null));};exports[_0xc937('0x9d')]=function(_0x119b9a,_0x1e2bc1,_0x2568dd){return db[_0xc937('0x31')]['find']({'where':{'id':_0x119b9a[_0xc937('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e2bc1,null))[_0xc937('0x29')](function(_0x42fcdd){if(_0x42fcdd){return _0x42fcdd[_0xc937('0x9d')](_0x119b9a[_0xc937('0x35')]['ids'])[_0xc937('0x29')](function(){if(_['isArray'](_0x119b9a[_0xc937('0x35')]['ids'])){for(var _0x2568da=0x0;_0x2568da<_0x119b9a[_0xc937('0x35')][_0xc937('0x67')][_0xc937('0x3a')];_0x2568da+=0x1){socket[_0xc937('0x9e')]('userCmList:remove',{'UserId':Number(_0x119b9a[_0xc937('0x35')][_0xc937('0x67')][_0x2568da]),'CmListId':Number(_0x119b9a[_0xc937('0x48')]['id'])});}}else{socket[_0xc937('0x9e')](_0xc937('0x9f'),{'UserId':Number(_0x119b9a[_0xc937('0x35')][_0xc937('0x67')]),'CmListId':Number(_0x119b9a[_0xc937('0x48')]['id'])});}});}})[_0xc937('0x29')](respondWithStatusCode(_0x1e2bc1,null))[_0xc937('0x4c')](handleError(_0x1e2bc1,null));};exports[_0xc937('0xa0')]=function(_0x5e0465,_0x5a909b,_0x2338a9){var _0x179ee4={};var _0x28ad84={};var _0x3dd45d;var _0x22dae5;return db[_0xc937('0x31')][_0xc937('0x5b')]({'where':{'id':_0x5e0465['params']['id']}})['then'](handleEntityNotFound(_0x5a909b,null))[_0xc937('0x29')](function(_0x369ffc){if(_0x369ffc){_0x3dd45d=_0x369ffc;_0x28ad84['model']=_['keys'](db[_0xc937('0xa1')][_0xc937('0x49')]);_0x28ad84['query']=_[_0xc937('0x36')](_0x5e0465[_0xc937('0x35')]);_0x28ad84['filters']=_[_0xc937('0x37')](_0x28ad84[_0xc937('0x34')],_0x28ad84[_0xc937('0x35')]);_0x179ee4[_0xc937('0x38')]=_[_0xc937('0x37')](_0x28ad84[_0xc937('0x34')],qs[_0xc937('0x39')](_0x5e0465['query']['fields']));_0x179ee4[_0xc937('0x38')]=_0x179ee4['attributes'][_0xc937('0x3a')]?_0x179ee4['attributes']:_0x28ad84[_0xc937('0x34')];_0x179ee4[_0xc937('0x5e')]=qs[_0xc937('0x3b')](_0x5e0465[_0xc937('0x35')]['sort']);_0x179ee4[_0xc937('0x42')]=qs[_0xc937('0x3d')](_[_0xc937('0x3c')](_0x5e0465[_0xc937('0x35')],_0x28ad84[_0xc937('0x3d')]));if(_0x5e0465[_0xc937('0x35')][_0xc937('0x3e')]){_0x179ee4[_0xc937('0x42')]=_[_0xc937('0x3f')](_0x179ee4[_0xc937('0x42')],{'$or':_['map'](_0x179ee4[_0xc937('0x38')],function(_0xfb6a2a){var _0x574d9d={};_0x574d9d[_0xfb6a2a]={'$like':'%'+_0x5e0465[_0xc937('0x35')][_0xc937('0x3e')]+'%'};return _0x574d9d;})});}_0x179ee4=_[_0xc937('0x3f')]({},_0x179ee4,_0x5e0465[_0xc937('0x4a')]);return _0x3dd45d[_0xc937('0xa0')](_0x179ee4);}})[_0xc937('0x29')](function(_0x1df533){if(_0x1df533){_0x22dae5=_0x1df533[_0xc937('0x3a')];if(!_0x5e0465[_0xc937('0x35')][_0xc937('0x5c')](_0xc937('0x5d'))){_0x179ee4[_0xc937('0x22')]=qs[_0xc937('0x22')](_0x5e0465[_0xc937('0x35')][_0xc937('0x22')]);_0x179ee4[_0xc937('0x20')]=qs[_0xc937('0x20')](_0x5e0465[_0xc937('0x35')]['offset']);}return _0x3dd45d[_0xc937('0xa0')](_0x179ee4);}})[_0xc937('0x29')](function(_0x28d6d9){if(_0x28d6d9){return _0x28d6d9?{'count':_0x22dae5,'rows':_0x28d6d9}:null;}})[_0xc937('0x29')](respondWithResult(_0x5a909b,null))['catch'](handleError(_0x5a909b,null));};function handleQuery(_0x3e75f8){logger[_0xc937('0xa2')](_0x3e75f8);return db[_0xc937('0x8c')][_0xc937('0x35')](_0x3e75f8)[_0xc937('0x9b')](function(_0x33daed){csv_results[_0xc937('0x65')](_0x33daed);})[_0xc937('0x4c')](function(_0x253da7){logger[_0xc937('0x2d')](_0x253da7[_0xc937('0xa3')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 19f5c23..b0fa0b1 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x55ca,0x126));var _0xa55c=function(_0x302a64,_0x191bf6){_0x302a64=_0x302a64-0x0;var _0xc4c71e=_0x55ca[_0x302a64];return _0xc4c71e;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5fc3[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 53a46d8..68c1e62 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x37e723,_0x5b70fe){var _0x13151b=function(_0x59a1ef){while(--_0x59a1ef){_0x37e723['push'](_0x37e723['shift']());}};_0x13151b(++_0x5b70fe);}(_0x54ef,0x112));var _0xf54e=function(_0x14e20,_0x1702a0){_0x14e20=_0x14e20-0x0;var _0x3d9563=_0x54ef[_0x14e20];return _0x3d9563;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','CmList','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x230489,_0x320811){var _0x414f3d=function(_0x42c9e9){while(--_0x42c9e9){_0x230489['push'](_0x230489['shift']());}};_0x414f3d(++_0x320811);}(_0x5b02,0xe9));var _0x25b0=function(_0x2ad185,_0x27cdff){_0x2ad185=_0x2ad185-0x0;var _0x3b5164=_0x5b02[_0x2ad185];return _0x3b5164;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'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 e0220fe..fd0edfa 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 _0xff89=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./cmList.socket','register','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xff89,0x16d));var _0x9ff8=function(_0xcf2bfe,_0x559aab){_0xcf2bfe=_0xcf2bfe-0x0;var _0xfbeab7=_0xff89[_0xcf2bfe];return _0xfbeab7;};'use strict';var _=require(_0x9ff8('0x0'));var util=require('util');var moment=require(_0x9ff8('0x1'));var BPromise=require(_0x9ff8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ff8('0x3'));var db=require(_0x9ff8('0x4'))['db'];var utils=require(_0x9ff8('0x5'));var logger=require(_0x9ff8('0x6'))(_0x9ff8('0x7'));var config=require(_0x9ff8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9ff8('0x9')]({'port':0x232a});config[_0x9ff8('0xa')]=_[_0x9ff8('0xb')](config[_0x9ff8('0xa')],{'host':_0x9ff8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9ff8('0xd'))[_0x9ff8('0xe')](socket);function respondWithRpcPromise(_0x50e4d0,_0x1ae046,_0x5b8ae5){return new BPromise(function(_0x27e9dd,_0x8d31fa){return client['request'](_0x50e4d0,_0x5b8ae5)[_0x9ff8('0xf')](function(_0x879a7){logger[_0x9ff8('0x10')]('CmList,\x20%s,\x20%s',_0x1ae046,_0x9ff8('0x11'));logger[_0x9ff8('0x12')](_0x9ff8('0x13'),_0x1ae046,'request\x20sent',JSON[_0x9ff8('0x14')](_0x879a7));if(_0x879a7[_0x9ff8('0x15')]){if(_0x879a7['error'][_0x9ff8('0x16')]===0x1f4){logger[_0x9ff8('0x15')]('CmList,\x20%s,\x20%s',_0x1ae046,_0x879a7[_0x9ff8('0x15')][_0x9ff8('0x17')]);return _0x8d31fa(_0x879a7['error'][_0x9ff8('0x17')]);}logger[_0x9ff8('0x15')]('CmList,\x20%s,\x20%s',_0x1ae046,_0x879a7[_0x9ff8('0x15')][_0x9ff8('0x17')]);return _0x27e9dd(_0x879a7[_0x9ff8('0x15')][_0x9ff8('0x17')]);}else{logger[_0x9ff8('0x10')](_0x9ff8('0x18'),_0x1ae046,_0x9ff8('0x11'));_0x27e9dd(_0x879a7['result']['message']);}})[_0x9ff8('0x19')](function(_0x55b4db){logger[_0x9ff8('0x15')](_0x9ff8('0x18'),_0x1ae046,_0x55b4db);_0x8d31fa(_0x55b4db);});});} \ No newline at end of file +var _0xcd6c=['client','http','redis','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd6c,0x119));var _0xccd6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcd6c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xccd6('0x0'));var moment=require(_0xccd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xccd6('0x2'));var fs=require('fs');var Redis=require(_0xccd6('0x3'));var db=require(_0xccd6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xccd6('0x5'));var jayson=require(_0xccd6('0x6'));var client=jayson[_0xccd6('0x7')][_0xccd6('0x8')]({'port':0x232a});config[_0xccd6('0x9')]=_['defaults'](config[_0xccd6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xccd6('0xa'))(new Redis(config[_0xccd6('0x9')]));require(_0xccd6('0xb'))['register'](socket);function respondWithRpcPromise(_0x245928,_0x3365e4,_0x1bb510){return new BPromise(function(_0x450053,_0x5319c8){return client[_0xccd6('0xc')](_0x245928,_0x1bb510)[_0xccd6('0xd')](function(_0x2aa81){logger[_0xccd6('0xe')](_0xccd6('0xf'),_0x3365e4,_0xccd6('0x10'));logger[_0xccd6('0x11')](_0xccd6('0x12'),_0x3365e4,_0xccd6('0x10'),JSON[_0xccd6('0x13')](_0x2aa81));if(_0x2aa81['error']){if(_0x2aa81['error']['code']===0x1f4){logger[_0xccd6('0x14')](_0xccd6('0xf'),_0x3365e4,_0x2aa81[_0xccd6('0x14')]['message']);return _0x5319c8(_0x2aa81['error'][_0xccd6('0x15')]);}logger[_0xccd6('0x14')](_0xccd6('0xf'),_0x3365e4,_0x2aa81[_0xccd6('0x14')][_0xccd6('0x15')]);return _0x450053(_0x2aa81[_0xccd6('0x14')][_0xccd6('0x15')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x3365e4,_0xccd6('0x10'));_0x450053(_0x2aa81[_0xccd6('0x16')]['message']);}})[_0xccd6('0x17')](function(_0x4e42e3){logger['error'](_0xccd6('0xf'),_0x3365e4,_0x4e42e3);_0x5319c8(_0x4e42e3);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 0e57171..4eb9cb2 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 _0xfa74=['remove','removeListener','register','cmList:'];(function(_0x5eff86,_0x1614d4){var _0x5c091f=function(_0x5a539b){while(--_0x5a539b){_0x5eff86['push'](_0x5eff86['shift']());}};_0x5c091f(++_0x1614d4);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x41fc3e,_0x4f5da0){_0x41fc3e=_0x41fc3e-0x0;var _0x31caff=_0xfa74[_0x41fc3e];return _0x31caff;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x4fa7('0x0'),'update'];function createListener(_0x3ea87d,_0x699cbc){return function(_0x3dc8ce){_0x699cbc['emit'](_0x3ea87d,_0x3dc8ce);};}function removeListener(_0x3296c3,_0x1ba5b9){return function(){CmListEvents[_0x4fa7('0x1')](_0x3296c3,_0x1ba5b9);};}exports[_0x4fa7('0x2')]=function(_0x5bd85b){for(var _0x49d88b=0x0,_0x53d1d5=events['length'];_0x49d88b<_0x53d1d5;_0x49d88b++){var _0x2a7de8=events[_0x49d88b];var _0x51cfe6=createListener(_0x4fa7('0x3')+_0x2a7de8,_0x5bd85b);CmListEvents['on'](_0x2a7de8,_0x51cfe6);}}; \ No newline at end of file +var _0x55e8=['emit','removeListener','register','length','cmList:','update'];(function(_0x4655f1,_0x41821d){var _0x4ba294=function(_0x2c2f78){while(--_0x2c2f78){_0x4655f1['push'](_0x4655f1['shift']());}};_0x4ba294(++_0x41821d);}(_0x55e8,0xe9));var _0x855e=function(_0x5c4bdb,_0x17668e){_0x5c4bdb=_0x5c4bdb-0x0;var _0x2b3bd3=_0x55e8[_0x5c4bdb];return _0x2b3bd3;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove',_0x855e('0x0')];function createListener(_0x252f25,_0x2d564e){return function(_0x3d1022){_0x2d564e[_0x855e('0x1')](_0x252f25,_0x3d1022);};}function removeListener(_0x3e8802,_0x4d590f){return function(){CmListEvents[_0x855e('0x2')](_0x3e8802,_0x4d590f);};}exports[_0x855e('0x3')]=function(_0x5b9fd3){for(var _0x1fcf5a=0x0,_0x1b47e5=events[_0x855e('0x4')];_0x1fcf5a<_0x1b47e5;_0x1fcf5a++){var _0x54d208=events[_0x1fcf5a];var _0x744bb6=createListener(_0x855e('0x5')+_0x54d208,_0x5b9fd3);CmListEvents['on'](_0x54d208,_0x744bb6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 7bd7241..d7d3363 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 _0x6343=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','create','post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util'];(function(_0x54ea7f,_0x4e1276){var _0xa30f95=function(_0x47e5e0){while(--_0x47e5e0){_0x54ea7f['push'](_0x54ea7f['shift']());}};_0xa30f95(++_0x4e1276);}(_0x6343,0x1e9));var _0x3634=function(_0x1d9907,_0x4c080c){_0x1d9907=_0x1d9907-0x0;var _0x3b7aca=_0x6343[_0x1d9907];return _0x3b7aca;};'use strict';var multer=require('multer');var util=require(_0x3634('0x0'));var path=require(_0x3634('0x1'));var timeout=require(_0x3634('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3634('0x3'));var auth=require(_0x3634('0x4'));var interaction=require(_0x3634('0x5'));var config=require('../../config/environment');var controller=require(_0x3634('0x6'));router[_0x3634('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3634('0x8'),auth[_0x3634('0x9')](),controller[_0x3634('0xa')]);router[_0x3634('0x7')](_0x3634('0xb'),auth[_0x3634('0x9')](),controller[_0x3634('0xc')]);router[_0x3634('0x7')](_0x3634('0xd'),auth[_0x3634('0x9')](),controller[_0x3634('0xe')]);router[_0x3634('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x3634('0xf'),auth['isAuthenticated'](),controller[_0x3634('0x10')]);router[_0x3634('0x7')](_0x3634('0x11'),auth[_0x3634('0x9')](),controller[_0x3634('0x12')]);router[_0x3634('0x7')](_0x3634('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x3634('0x9')](),controller[_0x3634('0x14')]);router['post']('/',auth[_0x3634('0x9')](),controller[_0x3634('0x15')]);router[_0x3634('0x16')](_0x3634('0x17'),auth[_0x3634('0x9')](),controller[_0x3634('0x18')]);router['post'](_0x3634('0xf'),auth['isAuthenticated'](),controller[_0x3634('0x19')]);router[_0x3634('0x16')](_0x3634('0x13'),auth[_0x3634('0x9')](),controller[_0x3634('0x1a')]);router[_0x3634('0x16')]('/:id/users',auth[_0x3634('0x9')](),controller[_0x3634('0x1b')]);router[_0x3634('0x1c')](_0x3634('0xd'),auth[_0x3634('0x9')](),controller[_0x3634('0x1d')]);router[_0x3634('0x1e')]('/:id',auth[_0x3634('0x9')](),controller[_0x3634('0x1f')]);router[_0x3634('0x1e')](_0x3634('0x17'),auth['isAuthenticated'](),controller[_0x3634('0x20')]);router[_0x3634('0x1e')]('/:id/users',auth['isAuthenticated'](),controller[_0x3634('0x21')]);module[_0x3634('0x22')]=router; \ No newline at end of file +var _0xfcee=['getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id','update','delete','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xfcee,0x160));var _0xefce=function(_0xb9e33f,_0x47aef9){_0xb9e33f=_0xb9e33f-0x0;var _0x43572b=_0xfcee[_0xb9e33f];return _0x43572b;};'use strict';var multer=require(_0xefce('0x0'));var util=require('util');var path=require(_0xefce('0x1'));var timeout=require('connect-timeout');var express=require(_0xefce('0x2'));var router=express[_0xefce('0x3')]();var fs_extra=require(_0xefce('0x4'));var auth=require(_0xefce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefce('0x6'));var controller=require(_0xefce('0x7'));router[_0xefce('0x8')]('/',auth[_0xefce('0x9')](),controller[_0xefce('0xa')]);router[_0xefce('0x8')](_0xefce('0xb'),auth['isAuthenticated'](),controller[_0xefce('0xc')]);router[_0xefce('0x8')](_0xefce('0xd'),auth[_0xefce('0x9')](),controller['getGlobalCustomFields']);router[_0xefce('0x8')]('/:id',auth[_0xefce('0x9')](),controller[_0xefce('0xe')]);router[_0xefce('0x8')](_0xefce('0xf'),auth[_0xefce('0x9')](),controller[_0xefce('0x10')]);router[_0xefce('0x8')](_0xefce('0x11'),auth[_0xefce('0x9')](),controller[_0xefce('0x12')]);router['get'](_0xefce('0x13'),auth[_0xefce('0x9')](),controller[_0xefce('0x14')]);router[_0xefce('0x8')]('/:id/fields',auth[_0xefce('0x9')](),controller['getCustomFields']);router[_0xefce('0x8')](_0xefce('0x15'),auth[_0xefce('0x9')](),controller[_0xefce('0x16')]);router[_0xefce('0x17')]('/',auth[_0xefce('0x9')](),controller[_0xefce('0x18')]);router[_0xefce('0x17')](_0xefce('0xf'),auth[_0xefce('0x9')](),controller[_0xefce('0x19')]);router[_0xefce('0x17')](_0xefce('0x11'),auth[_0xefce('0x9')](),controller[_0xefce('0x1a')]);router[_0xefce('0x17')](_0xefce('0x1b'),auth[_0xefce('0x9')](),controller[_0xefce('0x1c')]);router[_0xefce('0x17')](_0xefce('0x15'),auth[_0xefce('0x9')](),controller['addAgents']);router['put'](_0xefce('0x1d'),auth[_0xefce('0x9')](),controller[_0xefce('0x1e')]);router[_0xefce('0x1f')](_0xefce('0x1d'),auth[_0xefce('0x9')](),controller['destroy']);router[_0xefce('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xefce('0x1f')](_0xefce('0x15'),auth['isAuthenticated'](),controller[_0xefce('0x20')]);module[_0xefce('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c38792d..a971e0d 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 _0x8a63=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x8a63,0x83));var _0x38a6=function(_0x1349ce,_0x228a0f){_0x1349ce=_0x1349ce-0x0;var _0x476cbf=_0x8a63[_0x1349ce];return _0x476cbf;};'use strict';var Sequelize=require(_0x38a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x38a6('0x1')],'get':function(_0x11cf20){return this[_0x38a6('0x2')](_0x38a6('0x3'));}},'field':{'type':Sequelize[_0x38a6('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x38a6('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x38a6('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xb6ca=['field','STRING','exports','VIRTUAL'];(function(_0x57f878,_0x4200ad){var _0x431868=function(_0xde6a64){while(--_0xde6a64){_0x57f878['push'](_0x57f878['shift']());}};_0x431868(++_0x4200ad);}(_0xb6ca,0xea));var _0xab6c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb6ca[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require('sequelize');module[_0xab6c('0x0')]={'name':{'type':Sequelize[_0xab6c('0x1')],'get':function(_0x627daf){return this['getDataValue'](_0xab6c('0x2'));}},'field':{'type':Sequelize[_0xab6c('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xab6c('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 9ea39f8..0def511 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(_0x5985fe,_0x34a2da){var _0x740bfb=function(_0x28b8a3){while(--_0x28b8a3){_0x5985fe['push'](_0x5985fe['shift']());}};_0x740bfb(++_0x34a2da);}(_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(_0x214003,_0x5c1ef3){var _0x585d22=function(_0x354a51){while(--_0x354a51){_0x214003['push'](_0x214003['shift']());}};_0x585d22(++_0x5c1ef3);}(_0x7a54,0x106));var _0x47a5=function(_0x340cd3,_0x2d75b8){_0x340cd3=_0x340cd3-0x0;var _0x444aa9=_0x7a54[_0x340cd3];return _0x444aa9;};'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 23863ba..ef1849b 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 _0x8ee0=['define','Condition','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8ee0,0xc0));var _0x08ee=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x8ee0[_0x18abd2];return _0x1dcad6;};'use strict';var _=require('lodash');var util=require(_0x08ee('0x0'));var logger=require('../../config/logger')(_0x08ee('0x1'));var moment=require(_0x08ee('0x2'));var BPromise=require(_0x08ee('0x3'));var rp=require(_0x08ee('0x4'));var fs=require('fs');var path=require(_0x08ee('0x5'));var rimraf=require(_0x08ee('0x6'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x08ee('0x7')]=function(_0x58db98,_0x33f88a){return _0x58db98[_0x08ee('0x8')](_0x08ee('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23a0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util'];(function(_0x415894,_0x835797){var _0x475cad=function(_0x5326f8){while(--_0x5326f8){_0x415894['push'](_0x415894['shift']());}};_0x475cad(++_0x835797);}(_0x23a0,0x143));var _0x023a=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x23a0[_0x44454f];return _0x475150;};'use strict';var _=require(_0x023a('0x0'));var util=require(_0x023a('0x1'));var logger=require(_0x023a('0x2'))(_0x023a('0x3'));var moment=require(_0x023a('0x4'));var BPromise=require(_0x023a('0x5'));var rp=require(_0x023a('0x6'));var fs=require('fs');var path=require(_0x023a('0x7'));var rimraf=require('rimraf');var config=require(_0x023a('0x8'));var attributes=require(_0x023a('0x9'));module[_0x023a('0xa')]=function(_0x21c98e,_0x47a9c2){return _0x21c98e['define'](_0x023a('0xb'),attributes,{'tableName':_0x023a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 1fe6480..51b52df 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 _0xd030=['Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2632e8,_0x405a53){var _0x4db2b3=function(_0x59b061){while(--_0x59b061){_0x2632e8['push'](_0x2632e8['shift']());}};_0x4db2b3(++_0x405a53);}(_0xd030,0x7b));var _0x0d03=function(_0x295d30,_0x5e1bd3){_0x295d30=_0x295d30-0x0;var _0x24ee20=_0xd030[_0x295d30];return _0x24ee20;};'use strict';var _=require(_0x0d03('0x0'));var util=require(_0x0d03('0x1'));var moment=require(_0x0d03('0x2'));var BPromise=require(_0x0d03('0x3'));var rs=require(_0x0d03('0x4'));var fs=require('fs');var Redis=require(_0x0d03('0x5'));var db=require(_0x0d03('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d03('0x7'))(_0x0d03('0x8'));var config=require(_0x0d03('0x9'));var jayson=require(_0x0d03('0xa'));var client=jayson[_0x0d03('0xb')][_0x0d03('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x539adf,_0x5011cc,_0x57c01d){return new BPromise(function(_0xd16272,_0x12e7ac){return client[_0x0d03('0xd')](_0x539adf,_0x57c01d)['then'](function(_0x3218c6){logger[_0x0d03('0xe')](_0x0d03('0xf'),_0x5011cc,_0x0d03('0x10'));logger[_0x0d03('0x11')](_0x0d03('0x12'),_0x5011cc,'request\x20sent',JSON['stringify'](_0x3218c6));if(_0x3218c6[_0x0d03('0x13')]){if(_0x3218c6[_0x0d03('0x13')][_0x0d03('0x14')]===0x1f4){logger[_0x0d03('0x13')](_0x0d03('0xf'),_0x5011cc,_0x3218c6['error'][_0x0d03('0x15')]);return _0x12e7ac(_0x3218c6['error'][_0x0d03('0x15')]);}logger['error'](_0x0d03('0xf'),_0x5011cc,_0x3218c6[_0x0d03('0x13')][_0x0d03('0x15')]);return _0xd16272(_0x3218c6[_0x0d03('0x13')][_0x0d03('0x15')]);}else{logger['info'](_0x0d03('0xf'),_0x5011cc,'request\x20sent');_0xd16272(_0x3218c6[_0x0d03('0x16')][_0x0d03('0x15')]);}})['catch'](function(_0x410450){logger['error']('Condition,\x20%s,\x20%s',_0x5011cc,_0x410450);_0x12e7ac(_0x410450);});});} \ No newline at end of file +var _0xa39a=['rpc','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3f5a50,_0x37ba35){var _0x302147=function(_0x28f9a){while(--_0x28f9a){_0x3f5a50['push'](_0x3f5a50['shift']());}};_0x302147(++_0x37ba35);}(_0xa39a,0x162));var _0xaa39=function(_0x47ef1c,_0x346649){_0x47ef1c=_0x47ef1c-0x0;var _0x176f31=_0xa39a[_0x47ef1c];return _0x176f31;};'use strict';var _=require(_0xaa39('0x0'));var util=require(_0xaa39('0x1'));var moment=require(_0xaa39('0x2'));var BPromise=require(_0xaa39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa39('0x4'));var db=require(_0xaa39('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa39('0x6'))(_0xaa39('0x7'));var config=require(_0xaa39('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaa39('0x9')][_0xaa39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c3a7,_0x479d5f,_0x393111){return new BPromise(function(_0x3a7a44,_0x1f9d91){return client['request'](_0x89c3a7,_0x393111)[_0xaa39('0xb')](function(_0x38a8b0){logger[_0xaa39('0xc')](_0xaa39('0xd'),_0x479d5f,'request\x20sent');logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x479d5f,_0xaa39('0xe'),JSON['stringify'](_0x38a8b0));if(_0x38a8b0[_0xaa39('0xf')]){if(_0x38a8b0[_0xaa39('0xf')]['code']===0x1f4){logger['error'](_0xaa39('0xd'),_0x479d5f,_0x38a8b0[_0xaa39('0xf')][_0xaa39('0x10')]);return _0x1f9d91(_0x38a8b0[_0xaa39('0xf')][_0xaa39('0x10')]);}logger[_0xaa39('0xf')](_0xaa39('0xd'),_0x479d5f,_0x38a8b0[_0xaa39('0xf')]['message']);return _0x3a7a44(_0x38a8b0[_0xaa39('0xf')][_0xaa39('0x10')]);}else{logger[_0xaa39('0xc')](_0xaa39('0xd'),_0x479d5f,_0xaa39('0xe'));_0x3a7a44(_0x38a8b0[_0xaa39('0x11')][_0xaa39('0x10')]);}})[_0xaa39('0x12')](function(_0x146ce8){logger[_0xaa39('0xf')](_0xaa39('0xd'),_0x479d5f,_0x146ce8);_0x1f9d91(_0x146ce8);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4a4bc72..3fc585d 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 _0x544e=['isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','/:id','update'];(function(_0x48d5eb,_0xe1bd01){var _0xa14b15=function(_0x5c1273){while(--_0x5c1273){_0x48d5eb['push'](_0x48d5eb['shift']());}};_0xa14b15(++_0xe1bd01);}(_0x544e,0x1e3));var _0xe544=function(_0xc56ca9,_0x981085){_0xc56ca9=_0xc56ca9-0x0;var _0x46da5c=_0x544e[_0xc56ca9];return _0x46da5c;};'use strict';var multer=require(_0xe544('0x0'));var util=require(_0xe544('0x1'));var path=require(_0xe544('0x2'));var timeout=require(_0xe544('0x3'));var express=require(_0xe544('0x4'));var router=express[_0xe544('0x5')]();var fs_extra=require(_0xe544('0x6'));var auth=require(_0xe544('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe544('0x8'));var controller=require(_0xe544('0x9'));router['put'](_0xe544('0xa'),auth['isAuthenticated'](),controller[_0xe544('0xb')]);router['delete'](_0xe544('0xa'),auth[_0xe544('0xc')](),controller[_0xe544('0xd')]);module[_0xe544('0xe')]=router; \ No newline at end of file +var _0x198c=['./condition.controller','put','/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x198c,0x19c));var _0xc198=function(_0x24d80d,_0x2f7a65){_0x24d80d=_0x24d80d-0x0;var _0x151ea7=_0x198c[_0x24d80d];return _0x151ea7;};'use strict';var multer=require(_0xc198('0x0'));var util=require('util');var path=require(_0xc198('0x1'));var timeout=require(_0xc198('0x2'));var express=require(_0xc198('0x3'));var router=express[_0xc198('0x4')]();var fs_extra=require(_0xc198('0x5'));var auth=require(_0xc198('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc198('0x7'));var controller=require(_0xc198('0x8'));router[_0xc198('0x9')](_0xc198('0xa'),auth[_0xc198('0xb')](),controller[_0xc198('0xc')]);router[_0xc198('0xd')](_0xc198('0xa'),auth[_0xc198('0xb')](),controller['destroy']);module[_0xc198('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index cdfc7d5..8392b42 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8320=['exports','STRING','name','sequelize'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x8320,0x87));var _0x0832=function(_0x5f0305,_0x4bdfa8){_0x5f0305=_0x5f0305-0x0;var _0x344ecf=_0x8320[_0x5f0305];return _0x344ecf;};'use strict';var Sequelize=require(_0x0832('0x0'));module[_0x0832('0x1')]={'name':{'type':Sequelize[_0x0832('0x2')],'allowNull':![],'unique':_0x0832('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0832('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc174=['name','INTEGER','STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc174,0x1e8));var _0x4c17=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0xc174[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require(_0x4c17('0x0'));module[_0x4c17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4c17('0x2')},'OrderBy':{'type':Sequelize[_0x4c17('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x4c17('0x4')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 1f00a91..58dbfb8 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ce=['role','UserProfileSection','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','get'];(function(_0x1ff085,_0xa5d361){var _0x229856=function(_0x5aea49){while(--_0x5aea49){_0x1ff085['push'](_0x1ff085['shift']());}};_0x229856(++_0xa5d361);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3682fa,_0xecb039){_0x3682fa=_0x3682fa-0x0;var _0x5a3849=_0x02ce[_0x3682fa];return _0x5a3849;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){var _0x60b65e=_0xf41d4c['get']({'plain':!![]});var _0xefd882=_0xe02c('0x2a');return db[_0xe02c('0x2b')][_0xe02c('0x29')]({'where':{'type':_0xefd882,'resourceId':_0x60b65e['id']}})[_0xe02c('0x28')](function(){return _0xf41d4c;});})[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)[_0xe02c('0x2c')]();});}};}function handleEntityNotFound(_0x55ef2a,_0x55e475){return function(_0x3790eb){if(!_0x3790eb){_0x55ef2a[_0xe02c('0x1c')](0x194);}return _0x3790eb;};}function handleError(_0x481e02,_0x18b572){_0x18b572=_0x18b572||0x1f4;return function(_0x2d1d98){logger[_0xe02c('0x2d')](_0x2d1d98[_0xe02c('0x2e')]);if(_0x2d1d98[_0xe02c('0x2f')]){delete _0x2d1d98[_0xe02c('0x2f')];}_0x481e02[_0xe02c('0x22')](_0x18b572)[_0xe02c('0x30')](_0x2d1d98);};}exports[_0xe02c('0x31')]=function(_0x288004,_0x17d5b3){var _0x5a2da0={},_0x3c3d2c={},_0x3c1858={'count':0x0,'rows':[]};var _0x22b783=_[_0xe02c('0x32')](db[_0xe02c('0x33')][_0xe02c('0x34')],function(_0x58bf16){return{'name':_0x58bf16[_0xe02c('0x35')],'type':_0x58bf16[_0xe02c('0x36')]['key']};});_0x3c3d2c[_0xe02c('0x37')]=_[_0xe02c('0x32')](_0x22b783,_0xe02c('0x2f'));_0x3c3d2c[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x288004['query']);_0x3c3d2c['filters']=_[_0xe02c('0x3a')](_0x3c3d2c[_0xe02c('0x37')],_0x3c3d2c['query']);_0x5a2da0[_0xe02c('0x3b')]=_['intersection'](_0x3c3d2c[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x288004[_0xe02c('0x38')][_0xe02c('0x3c')]));_0x5a2da0[_0xe02c('0x3b')]=_0x5a2da0['attributes'][_0xe02c('0x3d')]?_0x5a2da0['attributes']:_0x3c3d2c[_0xe02c('0x37')];if(!_0x288004[_0xe02c('0x38')][_0xe02c('0x3e')](_0xe02c('0x3f'))){_0x5a2da0[_0xe02c('0x21')]=qs[_0xe02c('0x21')](_0x288004['query'][_0xe02c('0x21')]);_0x5a2da0[_0xe02c('0x1e')]=qs['offset'](_0x288004[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x5a2da0['order']=qs[_0xe02c('0x40')](_0x288004['query'][_0xe02c('0x40')]);_0x5a2da0[_0xe02c('0x41')]=qs['filters'](_[_0xe02c('0x42')](_0x288004[_0xe02c('0x38')],_0x3c3d2c[_0xe02c('0x43')]),_0x22b783);if(_0x288004[_0xe02c('0x38')][_0xe02c('0x44')]){_0x5a2da0[_0xe02c('0x41')]=_['merge'](_0x5a2da0[_0xe02c('0x41')],{'$or':_['map'](_0x22b783,function(_0x5ae8cd){if(_0x5ae8cd[_0xe02c('0x36')]!==_0xe02c('0x45')){var _0x42fbac={};_0x42fbac[_0x5ae8cd[_0xe02c('0x2f')]]={'$like':'%'+_0x288004['query'][_0xe02c('0x44')]+'%'};return _0x42fbac;}})});}_0x5a2da0=_[_0xe02c('0x46')]({},_0x5a2da0,_0x288004[_0xe02c('0x47')]);var _0x5baef6={'where':_0x5a2da0['where']};return db[_0xe02c('0x33')][_0xe02c('0x20')](_0x5baef6)[_0xe02c('0x28')](function(_0x2313d2){_0x3c1858[_0xe02c('0x20')]=_0x2313d2;if(_0x288004[_0xe02c('0x38')][_0xe02c('0x48')]){_0x5a2da0[_0xe02c('0x49')]=[{'all':!![]}];}return db[_0xe02c('0x33')]['findAll'](_0x5a2da0);})[_0xe02c('0x28')](function(_0x5ef4a1){_0x3c1858['rows']=_0x5ef4a1;return _0x3c1858;})[_0xe02c('0x28')](respondWithFilteredResult(_0x17d5b3,_0x5a2da0))[_0xe02c('0x4a')](handleError(_0x17d5b3,null));};exports[_0xe02c('0x4b')]=function(_0x1719cf,_0x24d506){var _0x12ca0e={'raw':!![],'where':{'id':_0x1719cf[_0xe02c('0x4c')]['id']}},_0x165f4a={};_0x165f4a['model']=_['keys'](db[_0xe02c('0x33')][_0xe02c('0x34')]);_0x165f4a[_0xe02c('0x38')]=_['keys'](_0x1719cf[_0xe02c('0x38')]);_0x165f4a[_0xe02c('0x43')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],_0x165f4a[_0xe02c('0x38')]);_0x12ca0e[_0xe02c('0x3b')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x1719cf[_0xe02c('0x38')]['fields']));_0x12ca0e[_0xe02c('0x3b')]=_0x12ca0e[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x12ca0e[_0xe02c('0x3b')]:_0x165f4a[_0xe02c('0x37')];if(_0x1719cf[_0xe02c('0x38')][_0xe02c('0x48')]){_0x12ca0e[_0xe02c('0x49')]=[{'all':!![]}];}_0x12ca0e=_[_0xe02c('0x46')]({},_0x12ca0e,_0x1719cf[_0xe02c('0x47')]);return db[_0xe02c('0x33')][_0xe02c('0x4d')](_0x12ca0e)[_0xe02c('0x28')](handleEntityNotFound(_0x24d506,null))['then'](respondWithResult(_0x24d506,null))[_0xe02c('0x4a')](handleError(_0x24d506,null));};exports['create']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x33')][_0xe02c('0x4e')](_0x15b05c[_0xe02c('0x4f')],{})[_0xe02c('0x28')](function(_0x160969){var _0xc2b5dd=_0x15b05c[_0xe02c('0x50')][_0xe02c('0x51')]({'plain':!![]});if(!_0xc2b5dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc2b5dd[_0xe02c('0x52')]===_0xe02c('0x50')){var _0xeb4214=_0x160969['get']({'plain':!![]});var _0xdab6cb='ContactItemTypes';return db[_0xe02c('0x53')]['find']({'where':{'name':_0xdab6cb,'userProfileId':_0xc2b5dd['userProfileId']},'raw':!![]})['then'](function(_0x55cf99){if(_0x55cf99&&_0x55cf99['autoAssociation']===0x0){return db['UserProfileResource'][_0xe02c('0x4e')]({'name':_0xeb4214[_0xe02c('0x2f')],'resourceId':_0xeb4214['id'],'type':_0x55cf99[_0xe02c('0x2f')],'sectionId':_0x55cf99['id']},{})[_0xe02c('0x28')](function(){return _0x160969;});}else{return _0x160969;}})['catch'](function(_0x274beb){logger[_0xe02c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x274beb);throw _0x274beb;});}return _0x160969;})[_0xe02c('0x28')](respondWithResult(_0x324911,0xc9))[_0xe02c('0x4a')](handleError(_0x324911,null));};exports[_0xe02c('0x27')]=function(_0x51f940,_0x57a00f){if(_0x51f940[_0xe02c('0x4f')]['id']){delete _0x51f940[_0xe02c('0x4f')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x51f940[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57a00f,null))['then'](saveUpdates(_0x51f940[_0xe02c('0x4f')],null))[_0xe02c('0x28')](respondWithResult(_0x57a00f,null))['catch'](handleError(_0x57a00f,null));};exports[_0xe02c('0x29')]=function(_0x849eea,_0x1ead72){return db['ContactItemType'][_0xe02c('0x4d')]({'where':{'id':_0x849eea[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ead72,null))[_0xe02c('0x28')](db[_0xe02c('0x54')][_0xe02c('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x849eea[_0xe02c('0x4c')]['id']}}))[_0xe02c('0x28')](removeEntity(_0x1ead72,null))[_0xe02c('0x4a')](handleError(_0x1ead72,null));}; \ No newline at end of file +var _0x1a85=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','ContactItemTypes','UserProfileResource','destroy','end','error','stack','name','index','ContactItemType','rawAttributes','type','model','map','query','keys','filters','attributes','fields','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','intersection','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','body','CmContactHasItem','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0xc2100d,_0x3c552c){var _0x4bce11=function(_0x522e2a){while(--_0x522e2a){_0xc2100d['push'](_0xc2100d['shift']());}};_0x4bce11(++_0x3c552c);}(_0x1a85,0x178));var _0x51a8=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x1a85[_0x15ec4e];return _0xb5e5dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){var _0x78d3d6=_0x23d26a[_0x51a8('0x24')]({'plain':!![]});var _0x18e2f3=_0x51a8('0x25');return db[_0x51a8('0x26')][_0x51a8('0x27')]({'where':{'type':_0x18e2f3,'resourceId':_0x78d3d6['id']}})[_0x51a8('0x23')](function(){return _0x23d26a;});})['then'](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x28')]();});}};}function handleEntityNotFound(_0xca5746,_0x3da187){return function(_0x1c150d){if(!_0x1c150d){_0xca5746[_0x51a8('0x17')](0x194);}return _0x1c150d;};}function handleError(_0x1a886f,_0x2742f5){_0x2742f5=_0x2742f5||0x1f4;return function(_0xec08ae){logger[_0x51a8('0x29')](_0xec08ae[_0x51a8('0x2a')]);if(_0xec08ae[_0x51a8('0x2b')]){delete _0xec08ae['name'];}_0x1a886f[_0x51a8('0x18')](_0x2742f5)['send'](_0xec08ae);};}exports[_0x51a8('0x2c')]=function(_0x3bc19a,_0x143f46){var _0x41df56={},_0x2136b4={},_0x4ea271={'count':0x0,'rows':[]};var _0x10c19b=_['map'](db[_0x51a8('0x2d')][_0x51a8('0x2e')],function(_0x253a59){return{'name':_0x253a59['fieldName'],'type':_0x253a59[_0x51a8('0x2f')]['key']};});_0x2136b4[_0x51a8('0x30')]=_[_0x51a8('0x31')](_0x10c19b,_0x51a8('0x2b'));_0x2136b4[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x3bc19a['query']);_0x2136b4[_0x51a8('0x34')]=_['intersection'](_0x2136b4[_0x51a8('0x30')],_0x2136b4[_0x51a8('0x32')]);_0x41df56[_0x51a8('0x35')]=_['intersection'](_0x2136b4[_0x51a8('0x30')],qs[_0x51a8('0x36')](_0x3bc19a[_0x51a8('0x32')][_0x51a8('0x36')]));_0x41df56[_0x51a8('0x35')]=_0x41df56['attributes']['length']?_0x41df56['attributes']:_0x2136b4[_0x51a8('0x30')];if(!_0x3bc19a[_0x51a8('0x32')]['hasOwnProperty'](_0x51a8('0x37'))){_0x41df56['limit']=qs[_0x51a8('0x1c')](_0x3bc19a[_0x51a8('0x32')][_0x51a8('0x1c')]);_0x41df56[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0x3bc19a[_0x51a8('0x32')]['offset']);}_0x41df56['order']=qs[_0x51a8('0x38')](_0x3bc19a['query']['sort']);_0x41df56['where']=qs[_0x51a8('0x34')](_[_0x51a8('0x39')](_0x3bc19a[_0x51a8('0x32')],_0x2136b4['filters']),_0x10c19b);if(_0x3bc19a[_0x51a8('0x32')][_0x51a8('0x3a')]){_0x41df56[_0x51a8('0x3b')]=_[_0x51a8('0x3c')](_0x41df56['where'],{'$or':_[_0x51a8('0x31')](_0x10c19b,function(_0xe6a86a){if(_0xe6a86a[_0x51a8('0x2f')]!=='VIRTUAL'){var _0xb96200={};_0xb96200[_0xe6a86a['name']]={'$like':'%'+_0x3bc19a[_0x51a8('0x32')][_0x51a8('0x3a')]+'%'};return _0xb96200;}})});}_0x41df56=_[_0x51a8('0x3c')]({},_0x41df56,_0x3bc19a[_0x51a8('0x3d')]);var _0x5c44a9={'where':_0x41df56[_0x51a8('0x3b')]};return db[_0x51a8('0x2d')][_0x51a8('0x1d')](_0x5c44a9)[_0x51a8('0x23')](function(_0xa33fc){_0x4ea271[_0x51a8('0x1d')]=_0xa33fc;if(_0x3bc19a[_0x51a8('0x32')][_0x51a8('0x3e')]){_0x41df56[_0x51a8('0x3f')]=[{'all':!![]}];}return db['ContactItemType'][_0x51a8('0x40')](_0x41df56);})[_0x51a8('0x23')](function(_0x4c7c67){_0x4ea271['rows']=_0x4c7c67;return _0x4ea271;})[_0x51a8('0x23')](respondWithFilteredResult(_0x143f46,_0x41df56))[_0x51a8('0x41')](handleError(_0x143f46,null));};exports[_0x51a8('0x42')]=function(_0x27b8e5,_0x311574){var _0x157a51={'raw':!![],'where':{'id':_0x27b8e5[_0x51a8('0x43')]['id']}},_0x28f5b3={};_0x28f5b3[_0x51a8('0x30')]=_[_0x51a8('0x33')](db['ContactItemType'][_0x51a8('0x2e')]);_0x28f5b3[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x27b8e5[_0x51a8('0x32')]);_0x28f5b3[_0x51a8('0x34')]=_[_0x51a8('0x44')](_0x28f5b3['model'],_0x28f5b3[_0x51a8('0x32')]);_0x157a51['attributes']=_[_0x51a8('0x44')](_0x28f5b3[_0x51a8('0x30')],qs[_0x51a8('0x36')](_0x27b8e5[_0x51a8('0x32')][_0x51a8('0x36')]));_0x157a51['attributes']=_0x157a51['attributes'][_0x51a8('0x45')]?_0x157a51[_0x51a8('0x35')]:_0x28f5b3[_0x51a8('0x30')];if(_0x27b8e5[_0x51a8('0x32')][_0x51a8('0x3e')]){_0x157a51['include']=[{'all':!![]}];}_0x157a51=_['merge']({},_0x157a51,_0x27b8e5[_0x51a8('0x3d')]);return db[_0x51a8('0x2d')][_0x51a8('0x46')](_0x157a51)[_0x51a8('0x23')](handleEntityNotFound(_0x311574,null))[_0x51a8('0x23')](respondWithResult(_0x311574,null))[_0x51a8('0x41')](handleError(_0x311574,null));};exports[_0x51a8('0x47')]=function(_0x1103a3,_0x301578){return db['ContactItemType']['create'](_0x1103a3['body'],{})[_0x51a8('0x23')](function(_0x279cb1){var _0x103897=_0x1103a3['user'][_0x51a8('0x24')]({'plain':!![]});if(!_0x103897)throw new Error(_0x51a8('0x48'));if(_0x103897['role']===_0x51a8('0x49')){var _0x4fb93c=_0x279cb1['get']({'plain':!![]});var _0xbf828b=_0x51a8('0x25');return db[_0x51a8('0x4a')]['find']({'where':{'name':_0xbf828b,'userProfileId':_0x103897['userProfileId']},'raw':!![]})[_0x51a8('0x23')](function(_0x5b0398){if(_0x5b0398&&_0x5b0398[_0x51a8('0x4b')]===0x0){return db[_0x51a8('0x26')][_0x51a8('0x47')]({'name':_0x4fb93c[_0x51a8('0x2b')],'resourceId':_0x4fb93c['id'],'type':_0x5b0398[_0x51a8('0x2b')],'sectionId':_0x5b0398['id']},{})[_0x51a8('0x23')](function(){return _0x279cb1;});}else{return _0x279cb1;}})[_0x51a8('0x41')](function(_0x406a87){logger[_0x51a8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x406a87);throw _0x406a87;});}return _0x279cb1;})[_0x51a8('0x23')](respondWithResult(_0x301578,0xc9))[_0x51a8('0x41')](handleError(_0x301578,null));};exports[_0x51a8('0x22')]=function(_0xd3c4,_0x533cfa){if(_0xd3c4[_0x51a8('0x4c')]['id']){delete _0xd3c4['body']['id'];}return db[_0x51a8('0x2d')][_0x51a8('0x46')]({'where':{'id':_0xd3c4['params']['id']}})['then'](handleEntityNotFound(_0x533cfa,null))[_0x51a8('0x23')](saveUpdates(_0xd3c4[_0x51a8('0x4c')],null))[_0x51a8('0x23')](respondWithResult(_0x533cfa,null))[_0x51a8('0x41')](handleError(_0x533cfa,null));};exports[_0x51a8('0x27')]=function(_0x52f60f,_0x43b79a){return db[_0x51a8('0x2d')][_0x51a8('0x46')]({'where':{'id':_0x52f60f[_0x51a8('0x43')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x43b79a,null))['then'](db[_0x51a8('0x4d')][_0x51a8('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x52f60f[_0x51a8('0x43')]['id']}}))[_0x51a8('0x23')](removeEntity(_0x43b79a,null))[_0x51a8('0x41')](handleError(_0x43b79a,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 99c9d93..f2516ca 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7244=['request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','define','tools_contact_item_types','util','api','moment'];(function(_0x3114ea,_0x135f62){var _0x1e85c0=function(_0x4ee1a5){while(--_0x4ee1a5){_0x3114ea['push'](_0x3114ea['shift']());}};_0x1e85c0(++_0x135f62);}(_0x7244,0xf7));var _0x4724=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7244[_0x35885a];return _0xe86249;};'use strict';var _=require('lodash');var util=require(_0x4724('0x0'));var logger=require('../../config/logger')(_0x4724('0x1'));var moment=require(_0x4724('0x2'));var BPromise=require('bluebird');var rp=require(_0x4724('0x3'));var fs=require('fs');var path=require(_0x4724('0x4'));var rimraf=require(_0x4724('0x5'));var config=require(_0x4724('0x6'));var attributes=require(_0x4724('0x7'));module['exports']=function(_0x1f1346,_0x18f455){return _0x1f1346[_0x4724('0x8')]('ContactItemType',attributes,{'tableName':_0x4724('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc90e=['bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','util','../../config/logger','api'];(function(_0x5d80aa,_0x3644aa){var _0x19f340=function(_0x56c826){while(--_0x56c826){_0x5d80aa['push'](_0x5d80aa['shift']());}};_0x19f340(++_0x3644aa);}(_0xc90e,0x1d0));var _0xec90=function(_0x4c35c3,_0x3ef78a){_0x4c35c3=_0x4c35c3-0x0;var _0x339d8f=_0xc90e[_0x4c35c3];return _0x339d8f;};'use strict';var _=require(_0xec90('0x0'));var util=require(_0xec90('0x1'));var logger=require(_0xec90('0x2'))(_0xec90('0x3'));var moment=require('moment');var BPromise=require(_0xec90('0x4'));var rp=require(_0xec90('0x5'));var fs=require('fs');var path=require(_0xec90('0x6'));var rimraf=require(_0xec90('0x7'));var config=require(_0xec90('0x8'));var attributes=require(_0xec90('0x9'));module[_0xec90('0xa')]=function(_0x45a52c,_0x578efe){return _0x45a52c[_0xec90('0xb')](_0xec90('0xc'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 1977d19..78e53e6 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50d1=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0x50d1,0xf3));var _0x150d=function(_0x599fe8,_0xda4cf8){_0x599fe8=_0x599fe8-0x0;var _0x34f968=_0x50d1[_0x599fe8];return _0x34f968;};'use strict';var _=require('lodash');var util=require(_0x150d('0x0'));var moment=require(_0x150d('0x1'));var BPromise=require(_0x150d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x150d('0x3'));var db=require(_0x150d('0x4'))['db'];var utils=require(_0x150d('0x5'));var logger=require(_0x150d('0x6'))(_0x150d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x150d('0x8')][_0x150d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43215f,_0x1842cd,_0x1a0cb3){return new BPromise(function(_0x17811d,_0x1dbe2b){return client[_0x150d('0xa')](_0x43215f,_0x1a0cb3)[_0x150d('0xb')](function(_0x410438){logger['info'](_0x150d('0xc'),_0x1842cd,'request\x20sent');logger[_0x150d('0xd')](_0x150d('0xe'),_0x1842cd,_0x150d('0xf'),JSON[_0x150d('0x10')](_0x410438));if(_0x410438[_0x150d('0x11')]){if(_0x410438[_0x150d('0x11')]['code']===0x1f4){logger[_0x150d('0x11')](_0x150d('0xc'),_0x1842cd,_0x410438[_0x150d('0x11')][_0x150d('0x12')]);return _0x1dbe2b(_0x410438[_0x150d('0x11')][_0x150d('0x12')]);}logger['error'](_0x150d('0xc'),_0x1842cd,_0x410438[_0x150d('0x11')][_0x150d('0x12')]);return _0x17811d(_0x410438['error'][_0x150d('0x12')]);}else{logger[_0x150d('0x13')](_0x150d('0xc'),_0x1842cd,'request\x20sent');_0x17811d(_0x410438[_0x150d('0x14')][_0x150d('0x12')]);}})[_0x150d('0x15')](function(_0x3e7ac0){logger[_0x150d('0x11')](_0x150d('0xc'),_0x1842cd,_0x3e7ac0);_0x1dbe2b(_0x3e7ac0);});});} \ No newline at end of file +var _0x4266=['jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b1330,_0x41fa6d){var _0x277c66=function(_0x42bfb9){while(--_0x42bfb9){_0x1b1330['push'](_0x1b1330['shift']());}};_0x277c66(++_0x41fa6d);}(_0x4266,0xa4));var _0x6426=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x4266[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x6426('0x0'));var util=require(_0x6426('0x1'));var moment=require(_0x6426('0x2'));var BPromise=require(_0x6426('0x3'));var rs=require(_0x6426('0x4'));var fs=require('fs');var Redis=require(_0x6426('0x5'));var db=require(_0x6426('0x6'))['db'];var utils=require(_0x6426('0x7'));var logger=require(_0x6426('0x8'))(_0x6426('0x9'));var config=require(_0x6426('0xa'));var jayson=require(_0x6426('0xb'));var client=jayson[_0x6426('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32a8fc,_0x55dcd2,_0x58fb5c){return new BPromise(function(_0x4219f8,_0x18acec){return client[_0x6426('0xd')](_0x32a8fc,_0x58fb5c)[_0x6426('0xe')](function(_0x220885){logger[_0x6426('0xf')](_0x6426('0x10'),_0x55dcd2,_0x6426('0x11'));logger['debug'](_0x6426('0x12'),_0x55dcd2,'request\x20sent',JSON[_0x6426('0x13')](_0x220885));if(_0x220885[_0x6426('0x14')]){if(_0x220885[_0x6426('0x14')][_0x6426('0x15')]===0x1f4){logger['error'](_0x6426('0x10'),_0x55dcd2,_0x220885[_0x6426('0x14')]['message']);return _0x18acec(_0x220885[_0x6426('0x14')][_0x6426('0x16')]);}logger[_0x6426('0x14')](_0x6426('0x10'),_0x55dcd2,_0x220885['error'][_0x6426('0x16')]);return _0x4219f8(_0x220885[_0x6426('0x14')]['message']);}else{logger['info'](_0x6426('0x10'),_0x55dcd2,_0x6426('0x11'));_0x4219f8(_0x220885[_0x6426('0x17')][_0x6426('0x16')]);}})[_0x6426('0x18')](function(_0x42dd46){logger[_0x6426('0x14')](_0x6426('0x10'),_0x55dcd2,_0x42dd46);_0x18acec(_0x42dd46);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ffe36e9..4ffd8ff 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87dd=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x489555,_0x518bd5){var _0x4021fd=function(_0x32ae57){while(--_0x32ae57){_0x489555['push'](_0x489555['shift']());}};_0x4021fd(++_0x518bd5);}(_0x87dd,0x156));var _0xd87d=function(_0x1ffd67,_0x1c18ba){_0x1ffd67=_0x1ffd67-0x0;var _0xce170f=_0x87dd[_0x1ffd67];return _0xce170f;};'use strict';var multer=require(_0xd87d('0x0'));var util=require(_0xd87d('0x1'));var path=require('path');var timeout=require(_0xd87d('0x2'));var express=require('express');var router=express[_0xd87d('0x3')]();var fs_extra=require(_0xd87d('0x4'));var auth=require(_0xd87d('0x5'));var interaction=require(_0xd87d('0x6'));var config=require(_0xd87d('0x7'));var controller=require('./contactItemType.controller');router[_0xd87d('0x8')]('/',auth[_0xd87d('0x9')](),controller[_0xd87d('0xa')]);router[_0xd87d('0x8')](_0xd87d('0xb'),auth['isAuthenticated'](),controller[_0xd87d('0xc')]);router[_0xd87d('0xd')]('/',auth[_0xd87d('0x9')](),controller[_0xd87d('0xe')]);router[_0xd87d('0xf')]('/:id',auth[_0xd87d('0x9')](),controller[_0xd87d('0x10')]);router['delete'](_0xd87d('0xb'),auth[_0xd87d('0x9')](),controller[_0xd87d('0x11')]);module[_0xd87d('0x12')]=router; \ No newline at end of file +var _0x7abd=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create','put','update','delete','exports','util','path','express','Router','../../components/auth/service'];(function(_0x2b3f84,_0x3fc9b3){var _0x104ec3=function(_0x264cd4){while(--_0x264cd4){_0x2b3f84['push'](_0x2b3f84['shift']());}};_0x104ec3(++_0x3fc9b3);}(_0x7abd,0xbb));var _0xd7ab=function(_0x3125f8,_0x19e5a8){_0x3125f8=_0x3125f8-0x0;var _0x1465fc=_0x7abd[_0x3125f8];return _0x1465fc;};'use strict';var multer=require('multer');var util=require(_0xd7ab('0x0'));var path=require(_0xd7ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xd7ab('0x2'));var router=express[_0xd7ab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd7ab('0x4'));var interaction=require(_0xd7ab('0x5'));var config=require(_0xd7ab('0x6'));var controller=require('./contactItemType.controller');router[_0xd7ab('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd7ab('0x7')](_0xd7ab('0x8'),auth[_0xd7ab('0x9')](),controller[_0xd7ab('0xa')]);router['post']('/',auth[_0xd7ab('0x9')](),controller[_0xd7ab('0xb')]);router[_0xd7ab('0xc')](_0xd7ab('0x8'),auth[_0xd7ab('0x9')](),controller[_0xd7ab('0xd')]);router[_0xd7ab('0xe')](_0xd7ab('0x8'),auth[_0xd7ab('0x9')](),controller['destroy']);module[_0xd7ab('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index fada932..ce0f967 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 _0x2032=['name','exports','STRING'];(function(_0x4fd6c6,_0x44590b){var _0x27532e=function(_0x5cbdcc){while(--_0x5cbdcc){_0x4fd6c6['push'](_0x4fd6c6['shift']());}};_0x27532e(++_0x44590b);}(_0x2032,0xd9));var _0x2203=function(_0x10e007,_0x5c03cb){_0x10e007=_0x10e007-0x0;var _0x446318=_0x2032[_0x10e007];return _0x446318;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x444001,_0x240e89){var _0x542469=function(_0x27492d){while(--_0x27492d){_0x444001['push'](_0x444001['shift']());}};_0x542469(++_0x240e89);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0xb10b[_0x4b7b9b];return _0x3be710;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a9cd5e2..3c1714d 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 _0x8f87=['attrSerie3','attrEmailAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','rawAttributes','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','sendStatus','status','json','offset','undefined','limit','set','apply','save','update','then','CustomDashboards','UserProfileResource','end','stack','name','map','Dashboard','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','length','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','destroy','params','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2'];(function(_0x4d6024,_0x5ac3a9){var _0x115bb9=function(_0x486a08){while(--_0x486a08){_0x4d6024['push'](_0x4d6024['shift']());}};_0x115bb9(++_0x5ac3a9);}(_0x8f87,0xfd));var _0x78f8=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x8f87[_0x1f99a0];return _0x1e0849;};'use strict';var emlformat=require(_0x78f8('0x0'));var rimraf=require(_0x78f8('0x1'));var zipdir=require(_0x78f8('0x2'));var jsonpatch=require(_0x78f8('0x3'));var rp=require(_0x78f8('0x4'));var moment=require(_0x78f8('0x5'));var BPromise=require(_0x78f8('0x6'));var Mustache=require('mustache');var util=require(_0x78f8('0x7'));var path=require(_0x78f8('0x8'));var sox=require('sox');var csv=require(_0x78f8('0x9'));var ejs=require(_0x78f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78f8('0xb'));var crypto=require(_0x78f8('0xc'));var jsforce=require(_0x78f8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x78f8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78f8('0xe'));var authService=require(_0x78f8('0xf'));var qs=require(_0x78f8('0x10'));var as=require(_0x78f8('0x11'));var hardwareService=require(_0x78f8('0x12'));var logger=require(_0x78f8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x78f8('0x14'));var db=require(_0x78f8('0x15'))['db'];config[_0x78f8('0x16')]=_[_0x78f8('0x17')](config[_0x78f8('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78f8('0x16')]));require(_0x78f8('0x18'))['register'](socket);function respondWithStatusCode(_0xcd79d6,_0x31def1){_0x31def1=_0x31def1||0xcc;return function(_0x545f61){if(_0x545f61){return _0xcd79d6[_0x78f8('0x19')](_0x31def1);}return _0xcd79d6[_0x78f8('0x1a')](_0x31def1)['end']();};}function respondWithResult(_0x422ea7,_0xa8d00b){_0xa8d00b=_0xa8d00b||0xc8;return function(_0x3f28b0){if(_0x3f28b0){return _0x422ea7[_0x78f8('0x1a')](_0xa8d00b)[_0x78f8('0x1b')](_0x3f28b0);}};}function respondWithFilteredResult(_0x261a5b,_0x1b80db){return function(_0x57507e){if(_0x57507e){var _0x28a4e6=typeof _0x1b80db[_0x78f8('0x1c')]===_0x78f8('0x1d')&&typeof _0x1b80db[_0x78f8('0x1e')]===_0x78f8('0x1d');var _0xa91c57=_0x57507e['count'];var _0x5bf91c=_0x28a4e6?0x0:_0x1b80db['offset'];var _0x1af6a4=_0x28a4e6?_0x57507e['count']:_0x1b80db[_0x78f8('0x1c')]+_0x1b80db[_0x78f8('0x1e')];var _0x4124c6;if(_0x1af6a4>=_0xa91c57){_0x1af6a4=_0xa91c57;_0x4124c6=0xc8;}else{_0x4124c6=0xce;}_0x261a5b[_0x78f8('0x1a')](_0x4124c6);return _0x261a5b[_0x78f8('0x1f')]('Content-Range',_0x5bf91c+'-'+_0x1af6a4+'/'+_0xa91c57)[_0x78f8('0x1b')](_0x57507e);}return null;};}function patchUpdates(_0x10174a){return function(_0x3f51d7){try{jsonpatch[_0x78f8('0x20')](_0x3f51d7,_0x10174a,!![]);}catch(_0x35fa28){return BPromise['reject'](_0x35fa28);}return _0x3f51d7[_0x78f8('0x21')]();};}function saveUpdates(_0x39b784,_0x51db1a){return function(_0x18bc0f){if(_0x18bc0f){return _0x18bc0f[_0x78f8('0x22')](_0x39b784)[_0x78f8('0x23')](function(_0x510732){return _0x510732;});}return null;};}function removeEntity(_0x264ed1,_0xde8f16){return function(_0x31266e){if(_0x31266e){return _0x31266e['destroy']()['then'](function(){var _0x101177=_0x31266e['get']({'plain':!![]});var _0x5c5855=_0x78f8('0x24');return db[_0x78f8('0x25')]['destroy']({'where':{'type':_0x5c5855,'resourceId':_0x101177['id']}})[_0x78f8('0x23')](function(){return _0x31266e;});})['then'](function(){_0x264ed1[_0x78f8('0x1a')](0xcc)[_0x78f8('0x26')]();});}};}function handleEntityNotFound(_0x5626e6,_0x5897bf){return function(_0x9f9dc){if(!_0x9f9dc){_0x5626e6[_0x78f8('0x19')](0x194);}return _0x9f9dc;};}function handleError(_0xfe4ac3,_0x3ae738){_0x3ae738=_0x3ae738||0x1f4;return function(_0x1b5aab){logger['error'](_0x1b5aab[_0x78f8('0x27')]);if(_0x1b5aab[_0x78f8('0x28')]){delete _0x1b5aab[_0x78f8('0x28')];}_0xfe4ac3[_0x78f8('0x1a')](_0x3ae738)['send'](_0x1b5aab);};}exports['index']=function(_0x25dc00,_0x243aa8){var _0xf62f96={},_0x24c74a={},_0x3f5d3f={'count':0x0,'rows':[]};var _0x5d97a9=_[_0x78f8('0x29')](db[_0x78f8('0x2a')]['rawAttributes'],function(_0x26a6ef){return{'name':_0x26a6ef['fieldName'],'type':_0x26a6ef['type']['key']};});_0x24c74a[_0x78f8('0x2b')]=_[_0x78f8('0x29')](_0x5d97a9,_0x78f8('0x28'));_0x24c74a[_0x78f8('0x2c')]=_['keys'](_0x25dc00['query']);_0x24c74a[_0x78f8('0x2d')]=_[_0x78f8('0x2e')](_0x24c74a[_0x78f8('0x2b')],_0x24c74a[_0x78f8('0x2c')]);_0xf62f96['attributes']=_[_0x78f8('0x2e')](_0x24c74a[_0x78f8('0x2b')],qs[_0x78f8('0x2f')](_0x25dc00[_0x78f8('0x2c')][_0x78f8('0x2f')]));_0xf62f96['attributes']=_0xf62f96[_0x78f8('0x30')]['length']?_0xf62f96[_0x78f8('0x30')]:_0x24c74a[_0x78f8('0x2b')];if(!_0x25dc00[_0x78f8('0x2c')][_0x78f8('0x31')]('nolimit')){_0xf62f96[_0x78f8('0x1e')]=qs[_0x78f8('0x1e')](_0x25dc00['query']['limit']);_0xf62f96['offset']=qs[_0x78f8('0x1c')](_0x25dc00['query'][_0x78f8('0x1c')]);}_0xf62f96[_0x78f8('0x32')]=qs[_0x78f8('0x33')](_0x25dc00[_0x78f8('0x2c')][_0x78f8('0x33')]);_0xf62f96[_0x78f8('0x34')]=qs[_0x78f8('0x2d')](_[_0x78f8('0x35')](_0x25dc00[_0x78f8('0x2c')],_0x24c74a['filters']),_0x5d97a9);if(_0x25dc00[_0x78f8('0x2c')][_0x78f8('0x36')]){_0xf62f96[_0x78f8('0x34')]=_[_0x78f8('0x37')](_0xf62f96[_0x78f8('0x34')],{'$or':_[_0x78f8('0x29')](_0x5d97a9,function(_0x368032){if(_0x368032[_0x78f8('0x38')]!==_0x78f8('0x39')){var _0x2dbeed={};_0x2dbeed[_0x368032['name']]={'$like':'%'+_0x25dc00['query'][_0x78f8('0x36')]+'%'};return _0x2dbeed;}})});}_0xf62f96=_[_0x78f8('0x37')]({},_0xf62f96,_0x25dc00[_0x78f8('0x3a')]);var _0x2e647a={'where':_0xf62f96[_0x78f8('0x34')]};return db[_0x78f8('0x2a')]['count'](_0x2e647a)[_0x78f8('0x23')](function(_0x59302a){_0x3f5d3f['count']=_0x59302a;if(_0x25dc00['query']['includeAll']){_0xf62f96['include']=[{'all':!![]}];}return db[_0x78f8('0x2a')][_0x78f8('0x3b')](_0xf62f96);})[_0x78f8('0x23')](function(_0x56c421){_0x3f5d3f['rows']=_0x56c421;return _0x3f5d3f;})[_0x78f8('0x23')](respondWithFilteredResult(_0x243aa8,_0xf62f96))[_0x78f8('0x3c')](handleError(_0x243aa8,null));};exports[_0x78f8('0x3d')]=function(_0x306a42,_0x2a5e59){var _0x177440={'raw':![],'where':{'id':_0x306a42['params']['id']}},_0x3677d8={};_0x3677d8[_0x78f8('0x2b')]=_['keys'](db[_0x78f8('0x2a')]['rawAttributes']);_0x3677d8['query']=_['keys'](_0x306a42['query']);_0x3677d8[_0x78f8('0x2d')]=_['intersection'](_0x3677d8[_0x78f8('0x2b')],_0x3677d8[_0x78f8('0x2c')]);_0x177440['attributes']=_[_0x78f8('0x2e')](_0x3677d8['model'],qs['fields'](_0x306a42[_0x78f8('0x2c')][_0x78f8('0x2f')]));_0x177440['attributes']=_0x177440['attributes'][_0x78f8('0x3e')]?_0x177440['attributes']:_0x3677d8[_0x78f8('0x2b')];if(_0x306a42['query'][_0x78f8('0x3f')]){_0x177440[_0x78f8('0x40')]=[{'all':!![]}];}_0x177440=_[_0x78f8('0x37')]({},_0x177440,_0x306a42['options']);return db['Dashboard'][_0x78f8('0x41')](_0x177440)[_0x78f8('0x23')](handleEntityNotFound(_0x2a5e59,null))['then'](respondWithResult(_0x2a5e59,null))[_0x78f8('0x3c')](handleError(_0x2a5e59,null));};exports['create']=function(_0x3dd56a,_0x3f6080){return db[_0x78f8('0x2a')][_0x78f8('0x42')](_0x3dd56a[_0x78f8('0x43')],{})['then'](function(_0x31b471){var _0x6265fe=_0x3dd56a['user'][_0x78f8('0x44')]({'plain':!![]});if(!_0x6265fe)throw new Error(_0x78f8('0x45'));if(_0x6265fe[_0x78f8('0x46')]===_0x78f8('0x47')){var _0x28dddb=_0x31b471['get']({'plain':!![]});var _0x27444c='CustomDashboards';return db[_0x78f8('0x48')][_0x78f8('0x41')]({'where':{'name':_0x27444c,'userProfileId':_0x6265fe[_0x78f8('0x49')]},'raw':!![]})[_0x78f8('0x23')](function(_0x28233f){if(_0x28233f&&_0x28233f[_0x78f8('0x4a')]===0x0){return db[_0x78f8('0x25')]['create']({'name':_0x28dddb[_0x78f8('0x28')],'resourceId':_0x28dddb['id'],'type':_0x28233f[_0x78f8('0x28')],'sectionId':_0x28233f['id']},{})[_0x78f8('0x23')](function(){return _0x31b471;});}else{return _0x31b471;}})['catch'](function(_0x4d7eeb){logger[_0x78f8('0x4b')](_0x78f8('0x4c'),_0x4d7eeb);throw _0x4d7eeb;});}return _0x31b471;})[_0x78f8('0x23')](respondWithResult(_0x3f6080,0xc9))['catch'](handleError(_0x3f6080,null));};exports[_0x78f8('0x4d')]=function(_0xceccb8,_0x343b4e){var _0xfb10c1={'where':{'id':_0xceccb8['params']['id']}},_0x380dba={};_0x380dba[_0x78f8('0x2b')]=_[_0x78f8('0x4e')](db[_0x78f8('0x2a')]['rawAttributes']);_0xfb10c1['attributes']=_['intersection'](_0x380dba[_0x78f8('0x2b')],qs[_0x78f8('0x2f')](_0xceccb8['query'][_0x78f8('0x2f')]));_0xfb10c1[_0x78f8('0x30')]=_0xfb10c1[_0x78f8('0x30')][_0x78f8('0x3e')]?_0xfb10c1[_0x78f8('0x30')]:_0x380dba[_0x78f8('0x2b')];if(_0xceccb8[_0x78f8('0x2c')]['includeAll']){_0xfb10c1[_0x78f8('0x40')]=[{'all':!![]}];}_0xfb10c1=_[_0x78f8('0x37')]({},_0xfb10c1,_0xceccb8['options']);return db['Dashboard']['find'](_0xfb10c1)[_0x78f8('0x23')](handleEntityNotFound(_0x343b4e,null))['then'](function(_0x58df4b){if(_0x58df4b){var _0x3cd00e=_0x58df4b[_0x78f8('0x44')]({'plain':!![]});_0x3cd00e=qs[_0x78f8('0x4f')](_0x3cd00e,['id',_0x78f8('0x50'),'updatedAt']);_0xceccb8['body']=_[_0x78f8('0x4f')](_0xceccb8['body'],['id','createdAt',_0x78f8('0x51')]);return db[_0x78f8('0x2a')]['create'](_['merge'](_0x3cd00e,_0xceccb8[_0x78f8('0x43')]),{'include':_0xceccb8['query'][_0x78f8('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x4cdcb8){var _0x3302c0=_0xceccb8['user'][_0x78f8('0x44')]({'plain':!![]});if(!_0x3302c0)throw new Error(_0x78f8('0x45'));if(_0x3302c0['role']===_0x78f8('0x47')){var _0x537fd3=_0x4cdcb8[_0x78f8('0x44')]({'plain':!![]});var _0xce3630=_0x78f8('0x24');return db[_0x78f8('0x48')][_0x78f8('0x41')]({'where':{'name':_0xce3630,'userProfileId':_0x3302c0['userProfileId']},'raw':!![]})[_0x78f8('0x23')](function(_0xd08ca5){if(_0xd08ca5&&_0xd08ca5['autoAssociation']===0x0){return db['UserProfileResource'][_0x78f8('0x42')]({'name':_0x537fd3[_0x78f8('0x28')],'resourceId':_0x537fd3['id'],'type':_0xd08ca5[_0x78f8('0x28')],'sectionId':_0xd08ca5['id']},{})[_0x78f8('0x23')](function(){return _0x4cdcb8;});}else{return _0x4cdcb8;}})[_0x78f8('0x3c')](function(_0x373beb){logger[_0x78f8('0x4b')](_0x78f8('0x4c'),_0x373beb);throw _0x373beb;});}return _0x4cdcb8;});}})[_0x78f8('0x23')](respondWithResult(_0x343b4e,0xc9))[_0x78f8('0x3c')](handleError(_0x343b4e,null));};exports[_0x78f8('0x22')]=function(_0x3af8a1,_0x62fdeb){if(_0x3af8a1[_0x78f8('0x43')]['id']){delete _0x3af8a1[_0x78f8('0x43')]['id'];}return db[_0x78f8('0x2a')][_0x78f8('0x41')]({'where':{'id':_0x3af8a1['params']['id']}})[_0x78f8('0x23')](handleEntityNotFound(_0x62fdeb,null))[_0x78f8('0x23')](saveUpdates(_0x3af8a1[_0x78f8('0x43')],null))[_0x78f8('0x23')](respondWithResult(_0x62fdeb,null))['catch'](handleError(_0x62fdeb,null));};exports[_0x78f8('0x52')]=function(_0x4bc6a9,_0x55608f){return db[_0x78f8('0x2a')][_0x78f8('0x41')]({'where':{'id':_0x4bc6a9[_0x78f8('0x53')]['id']}})[_0x78f8('0x23')](handleEntityNotFound(_0x55608f,null))[_0x78f8('0x23')](removeEntity(_0x55608f,null))[_0x78f8('0x3c')](handleError(_0x55608f,null));};function widgetAttributes(_0xcebee0){try{switch(_0xcebee0['type']){case _0x78f8('0x54'):return[{'name':_0x78f8('0x55'),'value':_0xcebee0[_0x78f8('0x55')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x0]?_0xcebee0['attrs'][0x0][_0x78f8('0x57')]:undefined)||'https://'}];case _0x78f8('0x58'):return[{'name':_0x78f8('0x59'),'value':_0xcebee0[_0x78f8('0x59')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x0]?_0xcebee0[_0x78f8('0x56')][0x0][_0x78f8('0x57')]:undefined)||''}];case _0x78f8('0x5a'):return[{'name':_0x78f8('0x5b'),'value':_0xcebee0[_0x78f8('0x5b')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x0]?_0xcebee0[_0x78f8('0x56')][0x0][_0x78f8('0x57')]:undefined)||_0x78f8('0x5c')},{'name':_0x78f8('0x5d'),'value':_0xcebee0[_0x78f8('0x5d')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x1]?_0xcebee0[_0x78f8('0x56')][0x1]['value']:undefined)||'0.00'},{'name':_0x78f8('0x5e'),'value':_0xcebee0['attrFontSize']||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x2]?_0xcebee0[_0x78f8('0x56')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x78f8('0x5f'),'value':_0xcebee0[_0x78f8('0x5f')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x0]?_0xcebee0[_0x78f8('0x56')][0x0][_0x78f8('0x57')]:undefined)||_0x78f8('0x60')},{'name':_0x78f8('0x61'),'value':_0xcebee0[_0x78f8('0x61')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x1]?_0xcebee0['attrs'][0x1]['value']:undefined)||[]},{'name':_0x78f8('0x5e'),'value':_0xcebee0[_0x78f8('0x5e')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x2]?_0xcebee0[_0x78f8('0x56')][0x2][_0x78f8('0x57')]:undefined)||0x14},{'name':_0x78f8('0x62'),'value':_0xcebee0['attrChannel']||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x3]?_0xcebee0[_0x78f8('0x56')][0x3][_0x78f8('0x57')]:undefined)||_0x78f8('0x63')},{'name':'attrEmailAccounts','value':_0xcebee0['attrEmailAccounts']||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x4]?_0xcebee0[_0x78f8('0x56')][0x4][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x64'),'value':_0xcebee0[_0x78f8('0x64')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x5]?_0xcebee0[_0x78f8('0x56')][0x5][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x65'),'value':_0xcebee0[_0x78f8('0x65')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x6]?_0xcebee0[_0x78f8('0x56')][0x6][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x66'),'value':_0xcebee0[_0x78f8('0x66')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x7]?_0xcebee0[_0x78f8('0x56')][0x7][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x67'),'value':_0xcebee0[_0x78f8('0x67')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x8]?_0xcebee0[_0x78f8('0x56')][0x8][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x68'),'value':_0xcebee0[_0x78f8('0x68')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x9]?_0xcebee0[_0x78f8('0x56')][0x9][_0x78f8('0x57')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x78f8('0x69'),'value':_0xcebee0[_0x78f8('0x69')]||(_0xcebee0['attrs']&&_0xcebee0['attrs'][0x0]?_0xcebee0[_0x78f8('0x56')][0x0][_0x78f8('0x57')]:undefined)||_0x78f8('0x60')},{'name':'attrSerie2','value':_0xcebee0[_0x78f8('0x6a')]||(_0xcebee0['attrs']&&_0xcebee0['attrs'][0x1]?_0xcebee0['attrs'][0x1][_0x78f8('0x57')]:undefined)||null},{'name':'attrSerie3','value':_0xcebee0[_0x78f8('0x6b')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x2]?_0xcebee0[_0x78f8('0x56')][0x2][_0x78f8('0x57')]:undefined)||null},{'name':_0x78f8('0x61'),'value':_0xcebee0[_0x78f8('0x61')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x3]?_0xcebee0[_0x78f8('0x56')][0x3][_0x78f8('0x57')]:undefined)||[]},{'name':_0x78f8('0x62'),'value':_0xcebee0[_0x78f8('0x62')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x4]?_0xcebee0[_0x78f8('0x56')][0x4]['value']:undefined)||'voice'},{'name':_0x78f8('0x6c'),'value':_0xcebee0[_0x78f8('0x6c')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x5]?_0xcebee0[_0x78f8('0x56')][0x5][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x64'),'value':_0xcebee0[_0x78f8('0x64')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x6]?_0xcebee0[_0x78f8('0x56')][0x6]['value']:undefined)||''},{'name':_0x78f8('0x65'),'value':_0xcebee0[_0x78f8('0x65')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x7]?_0xcebee0[_0x78f8('0x56')][0x7][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x66'),'value':_0xcebee0['attrOpenchannelAccounts']||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x8]?_0xcebee0[_0x78f8('0x56')][0x8][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x67'),'value':_0xcebee0['attrWhatsappAccounts']||(_0xcebee0['attrs']&&_0xcebee0[_0x78f8('0x56')][0x9]?_0xcebee0[_0x78f8('0x56')][0x9][_0x78f8('0x57')]:undefined)||''},{'name':_0x78f8('0x68'),'value':_0xcebee0[_0x78f8('0x68')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0xa]?_0xcebee0['attrs'][0xa]['value']:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0xcebee0['reportType']||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x0]?_0xcebee0['attrs'][0x0][_0x78f8('0x38')]:undefined)||null,'value':_0xcebee0[_0x78f8('0x6d')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0['attrs'][0x0]?_0xcebee0['attrs'][0x0][_0x78f8('0x57')]:undefined)||null},{'name':_0x78f8('0x6e'),'value':_0xcebee0[_0x78f8('0x6e')]||(_0xcebee0[_0x78f8('0x56')]&&_0xcebee0[_0x78f8('0x56')][0x1]?_0xcebee0['attrs'][0x1][_0x78f8('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x27c781){logger['error'](_0x78f8('0x6f'),JSON[_0x78f8('0x70')](_0x27c781));return[];}}exports[_0x78f8('0x71')]=function(_0x1ff3e2,_0x8981dc,_0x203e49){if(_0x1ff3e2['body']['id']){delete _0x1ff3e2[_0x78f8('0x43')]['id'];}return db[_0x78f8('0x2a')][_0x78f8('0x41')]({'where':{'id':_0x1ff3e2[_0x78f8('0x53')]['id']}})['then'](handleEntityNotFound(_0x8981dc,null))[_0x78f8('0x23')](function(_0x56d59c){if(_0x56d59c){_0x1ff3e2[_0x78f8('0x43')][_0x78f8('0x72')]=_0x56d59c['id'];_0x1ff3e2[_0x78f8('0x43')]['attrs']=widgetAttributes(_0x1ff3e2[_0x78f8('0x43')]);return db[_0x78f8('0x73')][_0x78f8('0x42')](_0x1ff3e2[_0x78f8('0x43')]);}})[_0x78f8('0x23')](respondWithResult(_0x8981dc,null))[_0x78f8('0x3c')](handleError(_0x8981dc,null));};exports[_0x78f8('0x74')]=function(_0x2ee804,_0x3c37e8,_0x48da99){var _0x55bd5d={};var _0x498a32={};var _0xe8ad16;var _0x59b2ed;return db['Dashboard'][_0x78f8('0x75')]({'where':{'id':_0x2ee804[_0x78f8('0x53')]['id']}})[_0x78f8('0x23')](handleEntityNotFound(_0x3c37e8,null))[_0x78f8('0x23')](function(_0x11387e){if(_0x11387e){_0xe8ad16=_0x11387e;_0x498a32[_0x78f8('0x2b')]=_[_0x78f8('0x4e')](db[_0x78f8('0x73')][_0x78f8('0x76')]);_0x498a32[_0x78f8('0x2c')]=_[_0x78f8('0x4e')](_0x2ee804[_0x78f8('0x2c')]);_0x498a32[_0x78f8('0x2d')]=_['intersection'](_0x498a32[_0x78f8('0x2b')],_0x498a32[_0x78f8('0x2c')]);_0x55bd5d[_0x78f8('0x30')]=_['intersection'](_0x498a32[_0x78f8('0x2b')],qs[_0x78f8('0x2f')](_0x2ee804[_0x78f8('0x2c')][_0x78f8('0x2f')]));_0x55bd5d[_0x78f8('0x30')]=_0x55bd5d[_0x78f8('0x30')][_0x78f8('0x3e')]?_0x55bd5d[_0x78f8('0x30')]:_0x498a32[_0x78f8('0x2b')];_0x55bd5d[_0x78f8('0x32')]=qs[_0x78f8('0x33')](_0x2ee804[_0x78f8('0x2c')][_0x78f8('0x33')]);_0x55bd5d[_0x78f8('0x34')]=qs[_0x78f8('0x2d')](_[_0x78f8('0x35')](_0x2ee804[_0x78f8('0x2c')],_0x498a32[_0x78f8('0x2d')]));if(_0x2ee804['query'][_0x78f8('0x36')]){_0x55bd5d[_0x78f8('0x34')]=_[_0x78f8('0x37')](_0x55bd5d[_0x78f8('0x34')],{'$or':_[_0x78f8('0x29')](_0x55bd5d[_0x78f8('0x30')],function(_0x3b26c2){var _0x5d76a8={};_0x5d76a8[_0x3b26c2]={'$like':'%'+_0x2ee804[_0x78f8('0x2c')][_0x78f8('0x36')]+'%'};return _0x5d76a8;})});}_0x55bd5d=_[_0x78f8('0x37')]({},_0x55bd5d,_0x2ee804[_0x78f8('0x3a')]);return _0xe8ad16[_0x78f8('0x74')](_0x55bd5d);}})[_0x78f8('0x23')](function(_0x11453d){if(_0x11453d){_0x59b2ed=_0x11453d[_0x78f8('0x3e')];if(!_0x2ee804[_0x78f8('0x2c')][_0x78f8('0x31')](_0x78f8('0x77'))){_0x55bd5d['limit']=qs['limit'](_0x2ee804[_0x78f8('0x2c')][_0x78f8('0x1e')]);_0x55bd5d[_0x78f8('0x1c')]=qs['offset'](_0x2ee804[_0x78f8('0x2c')]['offset']);}return _0xe8ad16['getItems'](_0x55bd5d);}})[_0x78f8('0x23')](function(_0x43c51b){if(_0x43c51b){return _0x43c51b?{'count':_0x59b2ed,'rows':_0x43c51b}:null;}})[_0x78f8('0x23')](respondWithResult(_0x3c37e8,null))[_0x78f8('0x3c')](handleError(_0x3c37e8,null));}; \ No newline at end of file +var _0x8454=['model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','DashboardItem','getItems','findOne','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','type'];(function(_0x2e7a81,_0x5a74bb){var _0x3474ef=function(_0x31d6e2){while(--_0x31d6e2){_0x2e7a81['push'](_0x2e7a81['shift']());}};_0x3474ef(++_0x5a74bb);}(_0x8454,0x1ca));var _0x4845=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8454[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4845('0x0'));var rimraf=require(_0x4845('0x1'));var zipdir=require(_0x4845('0x2'));var jsonpatch=require(_0x4845('0x3'));var rp=require(_0x4845('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4845('0x5'));var util=require(_0x4845('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4845('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4845('0x8'));var squel=require(_0x4845('0x9'));var crypto=require(_0x4845('0xa'));var jsforce=require(_0x4845('0xb'));var deskjs=require(_0x4845('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4845('0xd'));var Papa=require(_0x4845('0xe'));var Redis=require(_0x4845('0xf'));var authService=require(_0x4845('0x10'));var qs=require(_0x4845('0x11'));var as=require(_0x4845('0x12'));var hardwareService=require(_0x4845('0x13'));var logger=require(_0x4845('0x14'))(_0x4845('0x15'));var utils=require(_0x4845('0x16'));var config=require(_0x4845('0x17'));var licenseUtil=require(_0x4845('0x18'));var db=require(_0x4845('0x19'))['db'];config['redis']=_[_0x4845('0x1a')](config['redis'],{'host':_0x4845('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4845('0x1c')]));require(_0x4845('0x1d'))[_0x4845('0x1e')](socket);function respondWithStatusCode(_0x98f09f,_0x4e24ce){_0x4e24ce=_0x4e24ce||0xcc;return function(_0x3ddcd7){if(_0x3ddcd7){return _0x98f09f[_0x4845('0x1f')](_0x4e24ce);}return _0x98f09f[_0x4845('0x20')](_0x4e24ce)[_0x4845('0x21')]();};}function respondWithResult(_0x5500c2,_0x18dd3c){_0x18dd3c=_0x18dd3c||0xc8;return function(_0xcadb8a){if(_0xcadb8a){return _0x5500c2[_0x4845('0x20')](_0x18dd3c)[_0x4845('0x22')](_0xcadb8a);}};}function respondWithFilteredResult(_0x5dbbde,_0x39ca8d){return function(_0x32a827){if(_0x32a827){var _0x11d0fa=typeof _0x39ca8d[_0x4845('0x23')]===_0x4845('0x24')&&typeof _0x39ca8d[_0x4845('0x25')]===_0x4845('0x24');var _0x357597=_0x32a827['count'];var _0x595d1a=_0x11d0fa?0x0:_0x39ca8d[_0x4845('0x23')];var _0xef9517=_0x11d0fa?_0x32a827[_0x4845('0x26')]:_0x39ca8d[_0x4845('0x23')]+_0x39ca8d[_0x4845('0x25')];var _0x2b35c5;if(_0xef9517>=_0x357597){_0xef9517=_0x357597;_0x2b35c5=0xc8;}else{_0x2b35c5=0xce;}_0x5dbbde[_0x4845('0x20')](_0x2b35c5);return _0x5dbbde['set'](_0x4845('0x27'),_0x595d1a+'-'+_0xef9517+'/'+_0x357597)[_0x4845('0x22')](_0x32a827);}return null;};}function patchUpdates(_0x463bcc){return function(_0x4d3d2e){try{jsonpatch['apply'](_0x4d3d2e,_0x463bcc,!![]);}catch(_0x3dccbd){return BPromise[_0x4845('0x28')](_0x3dccbd);}return _0x4d3d2e[_0x4845('0x29')]();};}function saveUpdates(_0x20d834,_0x9f2862){return function(_0x3c1b0f){if(_0x3c1b0f){return _0x3c1b0f['update'](_0x20d834)[_0x4845('0x2a')](function(_0x3e1c18){return _0x3e1c18;});}return null;};}function removeEntity(_0x4f894d,_0x250dbd){return function(_0x43975d){if(_0x43975d){return _0x43975d[_0x4845('0x2b')]()[_0x4845('0x2a')](function(){var _0x3cdd8c=_0x43975d[_0x4845('0x2c')]({'plain':!![]});var _0x15a80f='CustomDashboards';return db[_0x4845('0x2d')][_0x4845('0x2b')]({'where':{'type':_0x15a80f,'resourceId':_0x3cdd8c['id']}})[_0x4845('0x2a')](function(){return _0x43975d;});})['then'](function(){_0x4f894d[_0x4845('0x20')](0xcc)[_0x4845('0x21')]();});}};}function handleEntityNotFound(_0x9c06,_0x20f0d7){return function(_0x3ccd97){if(!_0x3ccd97){_0x9c06[_0x4845('0x1f')](0x194);}return _0x3ccd97;};}function handleError(_0x44dce5,_0x14efdc){_0x14efdc=_0x14efdc||0x1f4;return function(_0x1ef1fa){logger[_0x4845('0x2e')](_0x1ef1fa['stack']);if(_0x1ef1fa[_0x4845('0x2f')]){delete _0x1ef1fa['name'];}_0x44dce5[_0x4845('0x20')](_0x14efdc)[_0x4845('0x30')](_0x1ef1fa);};}exports[_0x4845('0x31')]=function(_0x267eb4,_0x121666){var _0x1eee17={},_0x3b263e={},_0x149fe9={'count':0x0,'rows':[]};var _0x17a8ca=_[_0x4845('0x32')](db[_0x4845('0x33')][_0x4845('0x34')],function(_0x54e3d4){return{'name':_0x54e3d4['fieldName'],'type':_0x54e3d4[_0x4845('0x35')]['key']};});_0x3b263e[_0x4845('0x36')]=_[_0x4845('0x32')](_0x17a8ca,_0x4845('0x2f'));_0x3b263e['query']=_[_0x4845('0x37')](_0x267eb4[_0x4845('0x38')]);_0x3b263e[_0x4845('0x39')]=_['intersection'](_0x3b263e[_0x4845('0x36')],_0x3b263e[_0x4845('0x38')]);_0x1eee17[_0x4845('0x3a')]=_[_0x4845('0x3b')](_0x3b263e[_0x4845('0x36')],qs[_0x4845('0x3c')](_0x267eb4[_0x4845('0x38')][_0x4845('0x3c')]));_0x1eee17['attributes']=_0x1eee17[_0x4845('0x3a')][_0x4845('0x3d')]?_0x1eee17[_0x4845('0x3a')]:_0x3b263e['model'];if(!_0x267eb4[_0x4845('0x38')][_0x4845('0x3e')]('nolimit')){_0x1eee17[_0x4845('0x25')]=qs[_0x4845('0x25')](_0x267eb4['query']['limit']);_0x1eee17[_0x4845('0x23')]=qs['offset'](_0x267eb4[_0x4845('0x38')][_0x4845('0x23')]);}_0x1eee17[_0x4845('0x3f')]=qs[_0x4845('0x40')](_0x267eb4[_0x4845('0x38')]['sort']);_0x1eee17[_0x4845('0x41')]=qs[_0x4845('0x39')](_['pick'](_0x267eb4[_0x4845('0x38')],_0x3b263e[_0x4845('0x39')]),_0x17a8ca);if(_0x267eb4[_0x4845('0x38')][_0x4845('0x42')]){_0x1eee17[_0x4845('0x41')]=_[_0x4845('0x43')](_0x1eee17['where'],{'$or':_[_0x4845('0x32')](_0x17a8ca,function(_0x42c03e){if(_0x42c03e[_0x4845('0x35')]!==_0x4845('0x44')){var _0x2c0fd6={};_0x2c0fd6[_0x42c03e[_0x4845('0x2f')]]={'$like':'%'+_0x267eb4[_0x4845('0x38')][_0x4845('0x42')]+'%'};return _0x2c0fd6;}})});}_0x1eee17=_[_0x4845('0x43')]({},_0x1eee17,_0x267eb4[_0x4845('0x45')]);var _0x3f012d={'where':_0x1eee17[_0x4845('0x41')]};return db['Dashboard'][_0x4845('0x26')](_0x3f012d)['then'](function(_0x1f7315){_0x149fe9[_0x4845('0x26')]=_0x1f7315;if(_0x267eb4[_0x4845('0x38')][_0x4845('0x46')]){_0x1eee17[_0x4845('0x47')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x1eee17);})[_0x4845('0x2a')](function(_0x5342cb){_0x149fe9[_0x4845('0x48')]=_0x5342cb;return _0x149fe9;})['then'](respondWithFilteredResult(_0x121666,_0x1eee17))[_0x4845('0x49')](handleError(_0x121666,null));};exports[_0x4845('0x4a')]=function(_0x15f243,_0x4d3ea4){var _0x1b35b6={'raw':![],'where':{'id':_0x15f243[_0x4845('0x4b')]['id']}},_0xf7eb3c={};_0xf7eb3c[_0x4845('0x36')]=_['keys'](db[_0x4845('0x33')]['rawAttributes']);_0xf7eb3c[_0x4845('0x38')]=_[_0x4845('0x37')](_0x15f243[_0x4845('0x38')]);_0xf7eb3c['filters']=_[_0x4845('0x3b')](_0xf7eb3c[_0x4845('0x36')],_0xf7eb3c['query']);_0x1b35b6[_0x4845('0x3a')]=_[_0x4845('0x3b')](_0xf7eb3c[_0x4845('0x36')],qs['fields'](_0x15f243[_0x4845('0x38')][_0x4845('0x3c')]));_0x1b35b6[_0x4845('0x3a')]=_0x1b35b6[_0x4845('0x3a')][_0x4845('0x3d')]?_0x1b35b6[_0x4845('0x3a')]:_0xf7eb3c[_0x4845('0x36')];if(_0x15f243[_0x4845('0x38')]['includeAll']){_0x1b35b6[_0x4845('0x47')]=[{'all':!![]}];}_0x1b35b6=_[_0x4845('0x43')]({},_0x1b35b6,_0x15f243[_0x4845('0x45')]);return db[_0x4845('0x33')][_0x4845('0x4c')](_0x1b35b6)[_0x4845('0x2a')](handleEntityNotFound(_0x4d3ea4,null))[_0x4845('0x2a')](respondWithResult(_0x4d3ea4,null))[_0x4845('0x49')](handleError(_0x4d3ea4,null));};exports['create']=function(_0x3dc074,_0x1e4239){return db['Dashboard'][_0x4845('0x4d')](_0x3dc074[_0x4845('0x4e')],{})[_0x4845('0x2a')](function(_0x306344){var _0x1ea22d=_0x3dc074['user']['get']({'plain':!![]});if(!_0x1ea22d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ea22d['role']===_0x4845('0x4f')){var _0x5267bb=_0x306344[_0x4845('0x2c')]({'plain':!![]});var _0x5610e5=_0x4845('0x50');return db[_0x4845('0x51')][_0x4845('0x4c')]({'where':{'name':_0x5610e5,'userProfileId':_0x1ea22d['userProfileId']},'raw':!![]})[_0x4845('0x2a')](function(_0x1a1180){if(_0x1a1180&&_0x1a1180[_0x4845('0x52')]===0x0){return db['UserProfileResource'][_0x4845('0x4d')]({'name':_0x5267bb[_0x4845('0x2f')],'resourceId':_0x5267bb['id'],'type':_0x1a1180['name'],'sectionId':_0x1a1180['id']},{})['then'](function(){return _0x306344;});}else{return _0x306344;}})[_0x4845('0x49')](function(_0x7014fd){logger[_0x4845('0x2e')](_0x4845('0x53'),_0x7014fd);throw _0x7014fd;});}return _0x306344;})[_0x4845('0x2a')](respondWithResult(_0x1e4239,0xc9))[_0x4845('0x49')](handleError(_0x1e4239,null));};exports[_0x4845('0x54')]=function(_0x8199f2,_0x204828){var _0x165cb8={'where':{'id':_0x8199f2[_0x4845('0x4b')]['id']}},_0x38fc95={};_0x38fc95[_0x4845('0x36')]=_[_0x4845('0x37')](db[_0x4845('0x33')][_0x4845('0x34')]);_0x165cb8[_0x4845('0x3a')]=_[_0x4845('0x3b')](_0x38fc95['model'],qs[_0x4845('0x3c')](_0x8199f2[_0x4845('0x38')][_0x4845('0x3c')]));_0x165cb8[_0x4845('0x3a')]=_0x165cb8['attributes'][_0x4845('0x3d')]?_0x165cb8[_0x4845('0x3a')]:_0x38fc95[_0x4845('0x36')];if(_0x8199f2['query'][_0x4845('0x46')]){_0x165cb8['include']=[{'all':!![]}];}_0x165cb8=_['merge']({},_0x165cb8,_0x8199f2[_0x4845('0x45')]);return db['Dashboard'][_0x4845('0x4c')](_0x165cb8)[_0x4845('0x2a')](handleEntityNotFound(_0x204828,null))[_0x4845('0x2a')](function(_0x2edc98){if(_0x2edc98){var _0x1ae023=_0x2edc98[_0x4845('0x2c')]({'plain':!![]});_0x1ae023=qs[_0x4845('0x55')](_0x1ae023,['id',_0x4845('0x56'),_0x4845('0x57')]);_0x8199f2[_0x4845('0x4e')]=_['omit'](_0x8199f2['body'],['id',_0x4845('0x56'),_0x4845('0x57')]);return db['Dashboard'][_0x4845('0x4d')](_['merge'](_0x1ae023,_0x8199f2[_0x4845('0x4e')]),{'include':_0x8199f2['query'][_0x4845('0x46')]?[{'all':!![]}]:undefined})[_0x4845('0x2a')](function(_0x5be364){var _0xc9c3e7=_0x8199f2['user'][_0x4845('0x2c')]({'plain':!![]});if(!_0xc9c3e7)throw new Error(_0x4845('0x58'));if(_0xc9c3e7['role']==='user'){var _0x5562cd=_0x5be364[_0x4845('0x2c')]({'plain':!![]});var _0xba9871=_0x4845('0x50');return db[_0x4845('0x51')][_0x4845('0x4c')]({'where':{'name':_0xba9871,'userProfileId':_0xc9c3e7['userProfileId']},'raw':!![]})[_0x4845('0x2a')](function(_0x5cfac1){if(_0x5cfac1&&_0x5cfac1[_0x4845('0x52')]===0x0){return db[_0x4845('0x2d')][_0x4845('0x4d')]({'name':_0x5562cd[_0x4845('0x2f')],'resourceId':_0x5562cd['id'],'type':_0x5cfac1['name'],'sectionId':_0x5cfac1['id']},{})[_0x4845('0x2a')](function(){return _0x5be364;});}else{return _0x5be364;}})[_0x4845('0x49')](function(_0x19c82f){logger['error'](_0x4845('0x53'),_0x19c82f);throw _0x19c82f;});}return _0x5be364;});}})['then'](respondWithResult(_0x204828,0xc9))[_0x4845('0x49')](handleError(_0x204828,null));};exports[_0x4845('0x59')]=function(_0x24641e,_0x499752){if(_0x24641e[_0x4845('0x4e')]['id']){delete _0x24641e[_0x4845('0x4e')]['id'];}return db[_0x4845('0x33')]['find']({'where':{'id':_0x24641e[_0x4845('0x4b')]['id']}})['then'](handleEntityNotFound(_0x499752,null))[_0x4845('0x2a')](saveUpdates(_0x24641e['body'],null))[_0x4845('0x2a')](respondWithResult(_0x499752,null))[_0x4845('0x49')](handleError(_0x499752,null));};exports[_0x4845('0x2b')]=function(_0x9a6244,_0x2dd5c6){return db[_0x4845('0x33')]['find']({'where':{'id':_0x9a6244[_0x4845('0x4b')]['id']}})[_0x4845('0x2a')](handleEntityNotFound(_0x2dd5c6,null))[_0x4845('0x2a')](removeEntity(_0x2dd5c6,null))[_0x4845('0x49')](handleError(_0x2dd5c6,null));};function widgetAttributes(_0x46b211){try{switch(_0x46b211[_0x4845('0x35')]){case _0x4845('0x5a'):return[{'name':'attrUrl','value':_0x46b211[_0x4845('0x5b')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x0]?_0x46b211[_0x4845('0x5c')][0x0][_0x4845('0x5d')]:undefined)||_0x4845('0x5e')}];case _0x4845('0x5f'):return[{'name':_0x4845('0x60'),'value':_0x46b211[_0x4845('0x60')]||(_0x46b211['attrs']&&_0x46b211['attrs'][0x0]?_0x46b211[_0x4845('0x5c')][0x0][_0x4845('0x5d')]:undefined)||''}];case _0x4845('0x61'):return[{'name':_0x4845('0x62'),'value':_0x46b211[_0x4845('0x62')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x0]?_0x46b211[_0x4845('0x5c')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x4845('0x63'),'value':_0x46b211['attrTimezone']||(_0x46b211['attrs']&&_0x46b211['attrs'][0x1]?_0x46b211[_0x4845('0x5c')][0x1][_0x4845('0x5d')]:undefined)||_0x4845('0x64')},{'name':_0x4845('0x65'),'value':_0x46b211[_0x4845('0x65')]||(_0x46b211['attrs']&&_0x46b211[_0x4845('0x5c')][0x2]?_0x46b211[_0x4845('0x5c')][0x2][_0x4845('0x5d')]:undefined)||0xc}];case _0x4845('0x66'):return[{'name':_0x4845('0x67'),'value':_0x46b211[_0x4845('0x67')]||(_0x46b211['attrs']&&_0x46b211[_0x4845('0x5c')][0x0]?_0x46b211[_0x4845('0x5c')][0x0]['value']:undefined)||_0x4845('0x68')},{'name':'attrVoiceQueues','value':_0x46b211[_0x4845('0x69')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x1]?_0x46b211[_0x4845('0x5c')][0x1][_0x4845('0x5d')]:undefined)||[]},{'name':_0x4845('0x65'),'value':_0x46b211[_0x4845('0x65')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x2]?_0x46b211[_0x4845('0x5c')][0x2][_0x4845('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x46b211[_0x4845('0x6a')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x3]?_0x46b211['attrs'][0x3][_0x4845('0x5d')]:undefined)||_0x4845('0x6b')},{'name':_0x4845('0x6c'),'value':_0x46b211[_0x4845('0x6c')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x4]?_0x46b211[_0x4845('0x5c')][0x4][_0x4845('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x46b211[_0x4845('0x6d')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x5]?_0x46b211['attrs'][0x5][_0x4845('0x5d')]:undefined)||''},{'name':_0x4845('0x6e'),'value':_0x46b211['attrSmsAccounts']||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x6]?_0x46b211[_0x4845('0x5c')][0x6][_0x4845('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x46b211['attrOpenchannelAccounts']||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x7]?_0x46b211[_0x4845('0x5c')][0x7][_0x4845('0x5d')]:undefined)||''},{'name':_0x4845('0x6f'),'value':_0x46b211[_0x4845('0x6f')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x8]?_0x46b211['attrs'][0x8][_0x4845('0x5d')]:undefined)||''},{'name':_0x4845('0x70'),'value':_0x46b211[_0x4845('0x70')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x9]?_0x46b211['attrs'][0x9][_0x4845('0x5d')]:undefined)||''}];case _0x4845('0x71'):case _0x4845('0x72'):return[{'name':_0x4845('0x73'),'value':_0x46b211['attrSerie1']||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x0]?_0x46b211['attrs'][0x0]['value']:undefined)||_0x4845('0x68')},{'name':_0x4845('0x74'),'value':_0x46b211[_0x4845('0x74')]||(_0x46b211['attrs']&&_0x46b211['attrs'][0x1]?_0x46b211[_0x4845('0x5c')][0x1][_0x4845('0x5d')]:undefined)||null},{'name':_0x4845('0x75'),'value':_0x46b211[_0x4845('0x75')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x2]?_0x46b211[_0x4845('0x5c')][0x2][_0x4845('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x46b211[_0x4845('0x69')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x3]?_0x46b211[_0x4845('0x5c')][0x3][_0x4845('0x5d')]:undefined)||[]},{'name':_0x4845('0x6a'),'value':_0x46b211[_0x4845('0x6a')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x4]?_0x46b211[_0x4845('0x5c')][0x4]['value']:undefined)||_0x4845('0x6b')},{'name':_0x4845('0x6c'),'value':_0x46b211[_0x4845('0x6c')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x5]?_0x46b211[_0x4845('0x5c')][0x5]['value']:undefined)||''},{'name':_0x4845('0x6d'),'value':_0x46b211['attrFaxAccounts']||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x6]?_0x46b211[_0x4845('0x5c')][0x6][_0x4845('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x46b211[_0x4845('0x6e')]||(_0x46b211['attrs']&&_0x46b211['attrs'][0x7]?_0x46b211[_0x4845('0x5c')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x46b211[_0x4845('0x76')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x8]?_0x46b211[_0x4845('0x5c')][0x8]['value']:undefined)||''},{'name':_0x4845('0x6f'),'value':_0x46b211['attrWhatsappAccounts']||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x9]?_0x46b211[_0x4845('0x5c')][0x9][_0x4845('0x5d')]:undefined)||''},{'name':_0x4845('0x70'),'value':_0x46b211[_0x4845('0x70')]||(_0x46b211['attrs']&&_0x46b211['attrs'][0xa]?_0x46b211[_0x4845('0x5c')][0xa][_0x4845('0x5d')]:undefined)||''}];case _0x4845('0x77'):return[{'name':_0x4845('0x78'),'type':_0x46b211['reportType']||(_0x46b211['attrs']&&_0x46b211['attrs'][0x0]?_0x46b211['attrs'][0x0][_0x4845('0x35')]:undefined)||null,'value':_0x46b211[_0x4845('0x78')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211['attrs'][0x0]?_0x46b211[_0x4845('0x5c')][0x0][_0x4845('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x46b211[_0x4845('0x79')]||(_0x46b211[_0x4845('0x5c')]&&_0x46b211[_0x4845('0x5c')][0x1]?_0x46b211[_0x4845('0x5c')][0x1][_0x4845('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x333e11){logger[_0x4845('0x2e')](_0x4845('0x7a'),JSON['stringify'](_0x333e11));return[];}}exports['addItem']=function(_0x483685,_0x24b690,_0x4a7c66){if(_0x483685[_0x4845('0x4e')]['id']){delete _0x483685[_0x4845('0x4e')]['id'];}return db[_0x4845('0x33')]['find']({'where':{'id':_0x483685[_0x4845('0x4b')]['id']}})['then'](handleEntityNotFound(_0x24b690,null))[_0x4845('0x2a')](function(_0x1e30aa){if(_0x1e30aa){_0x483685[_0x4845('0x4e')]['DashboardId']=_0x1e30aa['id'];_0x483685[_0x4845('0x4e')]['attrs']=widgetAttributes(_0x483685[_0x4845('0x4e')]);return db[_0x4845('0x7b')]['create'](_0x483685[_0x4845('0x4e')]);}})[_0x4845('0x2a')](respondWithResult(_0x24b690,null))[_0x4845('0x49')](handleError(_0x24b690,null));};exports[_0x4845('0x7c')]=function(_0x3f2df9,_0x5b8dcd,_0x536f3f){var _0x3ac20b={};var _0x21b960={};var _0x34f410;var _0x340fad;return db[_0x4845('0x33')][_0x4845('0x7d')]({'where':{'id':_0x3f2df9[_0x4845('0x4b')]['id']}})[_0x4845('0x2a')](handleEntityNotFound(_0x5b8dcd,null))[_0x4845('0x2a')](function(_0x3d8384){if(_0x3d8384){_0x34f410=_0x3d8384;_0x21b960[_0x4845('0x36')]=_[_0x4845('0x37')](db[_0x4845('0x7b')][_0x4845('0x34')]);_0x21b960[_0x4845('0x38')]=_['keys'](_0x3f2df9[_0x4845('0x38')]);_0x21b960['filters']=_[_0x4845('0x3b')](_0x21b960['model'],_0x21b960[_0x4845('0x38')]);_0x3ac20b[_0x4845('0x3a')]=_[_0x4845('0x3b')](_0x21b960[_0x4845('0x36')],qs[_0x4845('0x3c')](_0x3f2df9[_0x4845('0x38')][_0x4845('0x3c')]));_0x3ac20b[_0x4845('0x3a')]=_0x3ac20b[_0x4845('0x3a')][_0x4845('0x3d')]?_0x3ac20b['attributes']:_0x21b960[_0x4845('0x36')];_0x3ac20b[_0x4845('0x3f')]=qs[_0x4845('0x40')](_0x3f2df9[_0x4845('0x38')][_0x4845('0x40')]);_0x3ac20b[_0x4845('0x41')]=qs[_0x4845('0x39')](_[_0x4845('0x7e')](_0x3f2df9[_0x4845('0x38')],_0x21b960[_0x4845('0x39')]));if(_0x3f2df9[_0x4845('0x38')][_0x4845('0x42')]){_0x3ac20b[_0x4845('0x41')]=_[_0x4845('0x43')](_0x3ac20b['where'],{'$or':_[_0x4845('0x32')](_0x3ac20b['attributes'],function(_0x56897b){var _0x1f4603={};_0x1f4603[_0x56897b]={'$like':'%'+_0x3f2df9[_0x4845('0x38')][_0x4845('0x42')]+'%'};return _0x1f4603;})});}_0x3ac20b=_[_0x4845('0x43')]({},_0x3ac20b,_0x3f2df9[_0x4845('0x45')]);return _0x34f410[_0x4845('0x7c')](_0x3ac20b);}})[_0x4845('0x2a')](function(_0x5582e9){if(_0x5582e9){_0x340fad=_0x5582e9['length'];if(!_0x3f2df9[_0x4845('0x38')][_0x4845('0x3e')](_0x4845('0x7f'))){_0x3ac20b[_0x4845('0x25')]=qs[_0x4845('0x25')](_0x3f2df9['query']['limit']);_0x3ac20b[_0x4845('0x23')]=qs[_0x4845('0x23')](_0x3f2df9[_0x4845('0x38')][_0x4845('0x23')]);}return _0x34f410['getItems'](_0x3ac20b);}})[_0x4845('0x2a')](function(_0x3ab64b){if(_0x3ab64b){return _0x3ab64b?{'count':_0x340fad,'rows':_0x3ab64b}:null;}})[_0x4845('0x2a')](respondWithResult(_0x5b8dcd,null))[_0x4845('0x49')](handleError(_0x5b8dcd,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 763ab8f..f4e41c6 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 _0xafdf=['update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x26758e,_0x1b698c){var _0x27f103=function(_0xc787){while(--_0xc787){_0x26758e['push'](_0x26758e['shift']());}};_0x27f103(++_0x1b698c);}(_0xafdf,0x15c));var _0xfafd=function(_0x58a34f,_0x1708d3){_0x58a34f=_0x58a34f-0x0;var _0x361e87=_0xafdf[_0x58a34f];return _0x361e87;};'use strict';var EventEmitter=require(_0xfafd('0x0'));var Dashboard=require(_0xfafd('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfafd('0x2'),'afterDestroy':_0xfafd('0x3')};function emitEvent(_0x23b633){return function(_0x35b203,_0x5edea2,_0x36b452){DashboardEvents[_0xfafd('0x4')](_0x23b633+':'+_0x35b203['id'],_0x35b203);DashboardEvents[_0xfafd('0x4')](_0x23b633,_0x35b203);_0x36b452(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xfafd('0x5')](e,emitEvent(event));}}module[_0xfafd('0x6')]=DashboardEvents; \ No newline at end of file +var _0x7d8a=['remove','emit','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x466fa7,_0x565305){var _0x1b8ca8=function(_0x511175){while(--_0x511175){_0x466fa7['push'](_0x466fa7['shift']());}};_0x1b8ca8(++_0x565305);}(_0x7d8a,0x1e1));var _0xa7d8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7d8a[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0xa7d8('0x0'));var Dashboard=require(_0xa7d8('0x1'))['db'][_0xa7d8('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa7d8('0x3')](0x0);var events={'afterCreate':_0xa7d8('0x4'),'afterUpdate':'update','afterDestroy':_0xa7d8('0x5')};function emitEvent(_0x56174a){return function(_0x2a159d,_0x5bd17c,_0x46cdf2){DashboardEvents[_0xa7d8('0x6')](_0x56174a+':'+_0x2a159d['id'],_0x2a159d);DashboardEvents[_0xa7d8('0x6')](_0x56174a,_0x2a159d);_0x46cdf2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa7d8('0x7')](e,emitEvent(event));}}module[_0xa7d8('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 3d32ae5..ff26ce6 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 _0x5b30=['dashboards','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0x165f7d,_0x55dbcb){var _0x1bda89=function(_0x3e85dc){while(--_0x3e85dc){_0x165f7d['push'](_0x165f7d['shift']());}};_0x1bda89(++_0x55dbcb);}(_0x5b30,0xe8));var _0x05b3=function(_0x4dfa20,_0x35afb5){_0x4dfa20=_0x4dfa20-0x0;var _0x146afc=_0x5b30[_0x4dfa20];return _0x146afc;};'use strict';var _=require('lodash');var util=require(_0x05b3('0x0'));var logger=require(_0x05b3('0x1'))('api');var moment=require(_0x05b3('0x2'));var BPromise=require(_0x05b3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05b3('0x4'));var rimraf=require(_0x05b3('0x5'));var config=require(_0x05b3('0x6'));var attributes=require(_0x05b3('0x7'));module[_0x05b3('0x8')]=function(_0x371e3f,_0x5ed78c){return _0x371e3f[_0x05b3('0x9')]('Dashboard',attributes,{'tableName':_0x05b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2b0=['./dashboard.attributes','exports','define','Dashboard','dashboards','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xe2b0,0x185));var _0x0e2b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe2b0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0e2b('0x0'));var logger=require(_0x0e2b('0x1'))(_0x0e2b('0x2'));var moment=require(_0x0e2b('0x3'));var BPromise=require(_0x0e2b('0x4'));var rp=require(_0x0e2b('0x5'));var fs=require('fs');var path=require(_0x0e2b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0e2b('0x7'));module[_0x0e2b('0x8')]=function(_0x1a2aa1,_0x5a0a2a){return _0x1a2aa1[_0x0e2b('0x9')](_0x0e2b('0xa'),attributes,{'tableName':_0x0e2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 7c331d4..6d3f15c 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 _0x7d9f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x7d9f,0x135));var _0xf7d9=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x7d9f[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require('lodash');var util=require(_0xf7d9('0x0'));var moment=require(_0xf7d9('0x1'));var BPromise=require(_0xf7d9('0x2'));var rs=require(_0xf7d9('0x3'));var fs=require('fs');var Redis=require(_0xf7d9('0x4'));var db=require(_0xf7d9('0x5'))['db'];var utils=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var jayson=require(_0xf7d9('0xa'));var client=jayson[_0xf7d9('0xb')][_0xf7d9('0xc')]({'port':0x232a});config[_0xf7d9('0xd')]=_[_0xf7d9('0xe')](config[_0xf7d9('0xd')],{'host':_0xf7d9('0xf'),'port':0x18eb});var socket=require(_0xf7d9('0x10'))(new Redis(config[_0xf7d9('0xd')]));require(_0xf7d9('0x11'))[_0xf7d9('0x12')](socket);function respondWithRpcPromise(_0x2a4c9f,_0x322303,_0x54f5ef){return new BPromise(function(_0x3a93c5,_0x4dea3d){return client[_0xf7d9('0x13')](_0x2a4c9f,_0x54f5ef)[_0xf7d9('0x14')](function(_0x5afdae){logger[_0xf7d9('0x15')](_0xf7d9('0x16'),_0x322303,_0xf7d9('0x17'));logger[_0xf7d9('0x18')](_0xf7d9('0x19'),_0x322303,_0xf7d9('0x17'),JSON[_0xf7d9('0x1a')](_0x5afdae));if(_0x5afdae[_0xf7d9('0x1b')]){if(_0x5afdae['error']['code']===0x1f4){logger[_0xf7d9('0x1b')]('Dashboard,\x20%s,\x20%s',_0x322303,_0x5afdae[_0xf7d9('0x1b')][_0xf7d9('0x1c')]);return _0x4dea3d(_0x5afdae[_0xf7d9('0x1b')]['message']);}logger[_0xf7d9('0x1b')](_0xf7d9('0x16'),_0x322303,_0x5afdae[_0xf7d9('0x1b')][_0xf7d9('0x1c')]);return _0x3a93c5(_0x5afdae[_0xf7d9('0x1b')][_0xf7d9('0x1c')]);}else{logger[_0xf7d9('0x15')](_0xf7d9('0x16'),_0x322303,_0xf7d9('0x17'));_0x3a93c5(_0x5afdae[_0xf7d9('0x1d')][_0xf7d9('0x1c')]);}})[_0xf7d9('0x1e')](function(_0x495212){logger[_0xf7d9('0x1b')](_0xf7d9('0x16'),_0x322303,_0x495212);_0x4dea3d(_0x495212);});});} \ No newline at end of file +var _0x5daa=['http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x299ca1,_0x596808){var _0x5322d7=function(_0x1618d7){while(--_0x1618d7){_0x299ca1['push'](_0x299ca1['shift']());}};_0x5322d7(++_0x596808);}(_0x5daa,0x18c));var _0xa5da=function(_0x269286,_0x4e4ac2){_0x269286=_0x269286-0x0;var _0x4c95d0=_0x5daa[_0x269286];return _0x4c95d0;};'use strict';var _=require('lodash');var util=require(_0xa5da('0x0'));var moment=require('moment');var BPromise=require(_0xa5da('0x1'));var rs=require(_0xa5da('0x2'));var fs=require('fs');var Redis=require(_0xa5da('0x3'));var db=require(_0xa5da('0x4'))['db'];var utils=require(_0xa5da('0x5'));var logger=require(_0xa5da('0x6'))(_0xa5da('0x7'));var config=require(_0xa5da('0x8'));var jayson=require(_0xa5da('0x9'));var client=jayson['client'][_0xa5da('0xa')]({'port':0x232a});config[_0xa5da('0xb')]=_[_0xa5da('0xc')](config[_0xa5da('0xb')],{'host':_0xa5da('0xd'),'port':0x18eb});var socket=require(_0xa5da('0xe'))(new Redis(config[_0xa5da('0xb')]));require(_0xa5da('0xf'))[_0xa5da('0x10')](socket);function respondWithRpcPromise(_0x220d9b,_0x16dfc8,_0x18ed8d){return new BPromise(function(_0x3848d,_0x287102){return client[_0xa5da('0x11')](_0x220d9b,_0x18ed8d)[_0xa5da('0x12')](function(_0x111295){logger[_0xa5da('0x13')](_0xa5da('0x14'),_0x16dfc8,_0xa5da('0x15'));logger[_0xa5da('0x16')](_0xa5da('0x17'),_0x16dfc8,_0xa5da('0x15'),JSON['stringify'](_0x111295));if(_0x111295[_0xa5da('0x18')]){if(_0x111295[_0xa5da('0x18')][_0xa5da('0x19')]===0x1f4){logger[_0xa5da('0x18')](_0xa5da('0x14'),_0x16dfc8,_0x111295[_0xa5da('0x18')]['message']);return _0x287102(_0x111295[_0xa5da('0x18')]['message']);}logger['error'](_0xa5da('0x14'),_0x16dfc8,_0x111295[_0xa5da('0x18')][_0xa5da('0x1a')]);return _0x3848d(_0x111295['error'][_0xa5da('0x1a')]);}else{logger[_0xa5da('0x13')](_0xa5da('0x14'),_0x16dfc8,_0xa5da('0x15'));_0x3848d(_0x111295[_0xa5da('0x1b')]['message']);}})[_0xa5da('0x1c')](function(_0x407bdb){logger[_0xa5da('0x18')]('Dashboard,\x20%s,\x20%s',_0x16dfc8,_0x407bdb);_0x287102(_0x407bdb);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index fa107a6..2910055 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 _0x3958=['remove','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3958,0xf6));var _0x8395=function(_0x38b258,_0xd0fb64){_0x38b258=_0x38b258-0x0;var _0x147cba=_0x3958[_0x38b258];return _0x147cba;};'use strict';var DashboardEvents=require(_0x8395('0x0'));var events=[_0x8395('0x1'),_0x8395('0x2'),'update'];function createListener(_0x9c2f5d,_0x21cab7){return function(_0x8090c1){_0x21cab7[_0x8395('0x3')](_0x9c2f5d,_0x8090c1);};}function removeListener(_0x17093c,_0x559d09){return function(){DashboardEvents[_0x8395('0x4')](_0x17093c,_0x559d09);};}exports[_0x8395('0x5')]=function(_0x5428e1){for(var _0x443359=0x0,_0x3af88d=events[_0x8395('0x6')];_0x443359<_0x3af88d;_0x443359++){var _0x510725=events[_0x443359];var _0x2be8e5=createListener(_0x8395('0x7')+_0x510725,_0x5428e1);DashboardEvents['on'](_0x510725,_0x2be8e5);}}; \ No newline at end of file +var _0x42a2=['removeListener','dashboard:','./dashboard.events','save','update','emit'];(function(_0x20480a,_0x137a6f){var _0x406718=function(_0x352d9c){while(--_0x352d9c){_0x20480a['push'](_0x20480a['shift']());}};_0x406718(++_0x137a6f);}(_0x42a2,0xd4));var _0x242a=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x42a2[_0x8a969d];return _0x1d8dc7;};'use strict';var DashboardEvents=require(_0x242a('0x0'));var events=[_0x242a('0x1'),'remove',_0x242a('0x2')];function createListener(_0xaaa4e,_0x59a9e4){return function(_0x19f6de){_0x59a9e4[_0x242a('0x3')](_0xaaa4e,_0x19f6de);};}function removeListener(_0x5761d1,_0x4404e6){return function(){DashboardEvents[_0x242a('0x4')](_0x5761d1,_0x4404e6);};}exports['register']=function(_0x37d997){for(var _0x2d6948=0x0,_0x2e3b57=events['length'];_0x2d6948<_0x2e3b57;_0x2d6948++){var _0x112da5=events[_0x2d6948];var _0x26399d=createListener(_0x242a('0x5')+_0x112da5,_0x37d997);DashboardEvents['on'](_0x112da5,_0x26399d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4fd8321..6193105 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 _0xcae1=['addItem','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x3b1d81,_0x5dba17){var _0x379a9d=function(_0x55881a){while(--_0x55881a){_0x3b1d81['push'](_0x3b1d81['shift']());}};_0x379a9d(++_0x5dba17);}(_0xcae1,0x191));var _0x1cae=function(_0x3bca2d,_0x1af8f4){_0x3bca2d=_0x3bca2d-0x0;var _0x144a7c=_0xcae1[_0x3bca2d];return _0x144a7c;};'use strict';var multer=require(_0x1cae('0x0'));var util=require(_0x1cae('0x1'));var path=require(_0x1cae('0x2'));var timeout=require(_0x1cae('0x3'));var express=require('express');var router=express[_0x1cae('0x4')]();var fs_extra=require(_0x1cae('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1cae('0x6'));router[_0x1cae('0x7')]('/',auth[_0x1cae('0x8')](),controller['index']);router[_0x1cae('0x7')](_0x1cae('0x9'),auth[_0x1cae('0x8')](),controller[_0x1cae('0xa')]);router['get'](_0x1cae('0xb'),auth[_0x1cae('0x8')](),controller[_0x1cae('0xc')]);router[_0x1cae('0xd')]('/',auth[_0x1cae('0x8')](),controller[_0x1cae('0xe')]);router[_0x1cae('0xd')](_0x1cae('0xf'),auth[_0x1cae('0x8')](),controller[_0x1cae('0x10')]);router[_0x1cae('0xd')](_0x1cae('0xb'),auth[_0x1cae('0x8')](),controller[_0x1cae('0x11')]);router['put']('/:id',auth[_0x1cae('0x8')](),controller[_0x1cae('0x12')]);router[_0x1cae('0x13')]('/:id',auth[_0x1cae('0x8')](),controller[_0x1cae('0x14')]);module[_0x1cae('0x15')]=router; \ No newline at end of file +var _0xcff5=['getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','isAuthenticated','index','/:id','show'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xcff5,0x8e));var _0x5cff=function(_0x2eda7d,_0x162382){_0x2eda7d=_0x2eda7d-0x0;var _0x2fd21d=_0xcff5[_0x2eda7d];return _0x2fd21d;};'use strict';var multer=require(_0x5cff('0x0'));var util=require('util');var path=require(_0x5cff('0x1'));var timeout=require('connect-timeout');var express=require(_0x5cff('0x2'));var router=express[_0x5cff('0x3')]();var fs_extra=require(_0x5cff('0x4'));var auth=require(_0x5cff('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5cff('0x6'));router[_0x5cff('0x7')]('/',auth[_0x5cff('0x8')](),controller[_0x5cff('0x9')]);router[_0x5cff('0x7')](_0x5cff('0xa'),auth[_0x5cff('0x8')](),controller[_0x5cff('0xb')]);router['get']('/:id/items',auth[_0x5cff('0x8')](),controller[_0x5cff('0xc')]);router[_0x5cff('0xd')]('/',auth[_0x5cff('0x8')](),controller[_0x5cff('0xe')]);router[_0x5cff('0xd')](_0x5cff('0xf'),auth[_0x5cff('0x8')](),controller[_0x5cff('0x10')]);router[_0x5cff('0xd')]('/:id/items',auth[_0x5cff('0x8')](),controller[_0x5cff('0x11')]);router[_0x5cff('0x12')](_0x5cff('0xa'),auth[_0x5cff('0x8')](),controller[_0x5cff('0x13')]);router[_0x5cff('0x14')](_0x5cff('0xa'),auth[_0x5cff('0x8')](),controller[_0x5cff('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index bf2d6d5..667d07b 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 _0xdbf5=['squel','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x3e516a,_0x3de7b9){var _0x2296d6=function(_0x5c743c){while(--_0x5c743c){_0x3e516a['push'](_0x3e516a['shift']());}};_0x2296d6(++_0x3de7b9);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5b2d57,_0x2f3f49){_0x5b2d57=_0x5b2d57-0x0;var _0x4ce9e5=_0xdbf5[_0x5b2d57];return _0x4ce9e5;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5dbf('0x0'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dbf('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5dbf('0x2')](_0x5dbf('0x3')),'get':function(){try{return JSON[_0x5dbf('0x4')](this[_0x5dbf('0x5')](_0x5dbf('0x6')));}catch(_0x1decd2){return[];}},'set':function(_0x3f8628){try{this[_0x5dbf('0x7')](_0x5dbf('0x6'),JSON[_0x5dbf('0x8')](_0x3f8628));}catch(_0x93e657){this['setDataValue'](_0x5dbf('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5dbf('0x9')]},'col':{'type':Sequelize[_0x5dbf('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dbf('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5dbf('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xfcf0=['sequelize','squel','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0xfcf0[_0x1f4b18];return _0xde3957;};'use strict';var Sequelize=require(_0x0fcf('0x0'));var squel=require(_0x0fcf('0x1'));var _=require('lodash');module[_0x0fcf('0x2')]={'title':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0fcf('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0fcf('0x4')]('long'),'get':function(){try{return JSON[_0x0fcf('0x5')](this[_0x0fcf('0x6')](_0x0fcf('0x7')));}catch(_0x3af316){return[];}},'set':function(_0x1bace8){try{this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')](_0x1bace8));}catch(_0x50c575){this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0fcf('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0fcf('0xa')]},'col':{'type':Sequelize[_0x0fcf('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0fcf('0x3')]},'titleFontSize':{'type':Sequelize[_0x0fcf('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 63fdba2..3b0a30d 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 _0xe953=['localhost','socket.io-emitter','register','sendStatus','status','end','undefined','offset','set','apply','save','update','then','error','stack','name','send','show','model','DashboardItem','rawAttributes','query','filters','intersection','attributes','includeAll','include','merge','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0xe550f7,_0x13064a){var _0x54f8e6=function(_0x4cc8bc){while(--_0x4cc8bc){_0xe550f7['push'](_0xe550f7['shift']());}};_0x54f8e6(++_0x13064a);}(_0xe953,0xf9));var _0x3e95=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xe953[_0x1c34e7];return _0x378cb1;};'use strict';var emlformat=require(_0x3e95('0x0'));var rimraf=require(_0x3e95('0x1'));var zipdir=require(_0x3e95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e95('0x3'));var moment=require(_0x3e95('0x4'));var BPromise=require(_0x3e95('0x5'));var Mustache=require(_0x3e95('0x6'));var util=require(_0x3e95('0x7'));var path=require(_0x3e95('0x8'));var sox=require(_0x3e95('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e95('0xa'));var _=require('lodash');var squel=require(_0x3e95('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e95('0xc'));var deskjs=require(_0x3e95('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3e95('0xe'));var Redis=require('ioredis');var authService=require(_0x3e95('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e95('0x10'));var logger=require(_0x3e95('0x11'))(_0x3e95('0x12'));var utils=require('../../config/utils');var config=require(_0x3e95('0x13'));var licenseUtil=require(_0x3e95('0x14'));var db=require(_0x3e95('0x15'))['db'];config[_0x3e95('0x16')]=_[_0x3e95('0x17')](config['redis'],{'host':_0x3e95('0x18'),'port':0x18eb});var socket=require(_0x3e95('0x19'))(new Redis(config[_0x3e95('0x16')]));require('./dashboardItem.socket')[_0x3e95('0x1a')](socket);function respondWithStatusCode(_0x6be4fa,_0x456bab){_0x456bab=_0x456bab||0xcc;return function(_0x449d94){if(_0x449d94){return _0x6be4fa[_0x3e95('0x1b')](_0x456bab);}return _0x6be4fa[_0x3e95('0x1c')](_0x456bab)[_0x3e95('0x1d')]();};}function respondWithResult(_0x4b4a6a,_0x2ae3c9){_0x2ae3c9=_0x2ae3c9||0xc8;return function(_0x109055){if(_0x109055){return _0x4b4a6a[_0x3e95('0x1c')](_0x2ae3c9)['json'](_0x109055);}};}function respondWithFilteredResult(_0x2ca38c,_0x141385){return function(_0x13c486){if(_0x13c486){var _0x4a5402=typeof _0x141385['offset']===_0x3e95('0x1e')&&typeof _0x141385['limit']==='undefined';var _0xef8818=_0x13c486['count'];var _0x3d5cef=_0x4a5402?0x0:_0x141385[_0x3e95('0x1f')];var _0x14d68f=_0x4a5402?_0x13c486['count']:_0x141385[_0x3e95('0x1f')]+_0x141385['limit'];var _0x35e98c;if(_0x14d68f>=_0xef8818){_0x14d68f=_0xef8818;_0x35e98c=0xc8;}else{_0x35e98c=0xce;}_0x2ca38c[_0x3e95('0x1c')](_0x35e98c);return _0x2ca38c[_0x3e95('0x20')]('Content-Range',_0x3d5cef+'-'+_0x14d68f+'/'+_0xef8818)['json'](_0x13c486);}return null;};}function patchUpdates(_0x13c2c5){return function(_0x48d29d){try{jsonpatch[_0x3e95('0x21')](_0x48d29d,_0x13c2c5,!![]);}catch(_0x307a75){return BPromise['reject'](_0x307a75);}return _0x48d29d[_0x3e95('0x22')]();};}function saveUpdates(_0x51b673,_0xf9a829){return function(_0x1cfdbc){if(_0x1cfdbc){return _0x1cfdbc[_0x3e95('0x23')](_0x51b673)[_0x3e95('0x24')](function(_0x421498){return _0x421498;});}return null;};}function removeEntity(_0x3b474c,_0x296991){return function(_0x252765){if(_0x252765){return _0x252765['destroy']()['then'](function(){_0x3b474c[_0x3e95('0x1c')](0xcc)[_0x3e95('0x1d')]();});}};}function handleEntityNotFound(_0x5eb794,_0x19e583){return function(_0x2207ef){if(!_0x2207ef){_0x5eb794[_0x3e95('0x1b')](0x194);}return _0x2207ef;};}function handleError(_0x40a2b7,_0x3f83ce){_0x3f83ce=_0x3f83ce||0x1f4;return function(_0x456ac3){logger[_0x3e95('0x25')](_0x456ac3[_0x3e95('0x26')]);if(_0x456ac3[_0x3e95('0x27')]){delete _0x456ac3[_0x3e95('0x27')];}_0x40a2b7[_0x3e95('0x1c')](_0x3f83ce)[_0x3e95('0x28')](_0x456ac3);};}exports[_0x3e95('0x29')]=function(_0x34b6d6,_0x21e1aa){var _0x3b8b94={'raw':![],'where':{'id':_0x34b6d6['params']['id']}},_0xeb20={};_0xeb20[_0x3e95('0x2a')]=_['keys'](db[_0x3e95('0x2b')][_0x3e95('0x2c')]);_0xeb20[_0x3e95('0x2d')]=_['keys'](_0x34b6d6['query']);_0xeb20[_0x3e95('0x2e')]=_[_0x3e95('0x2f')](_0xeb20[_0x3e95('0x2a')],_0xeb20['query']);_0x3b8b94['attributes']=_[_0x3e95('0x2f')](_0xeb20[_0x3e95('0x2a')],qs['fields'](_0x34b6d6[_0x3e95('0x2d')]['fields']));_0x3b8b94[_0x3e95('0x30')]=_0x3b8b94[_0x3e95('0x30')]['length']?_0x3b8b94[_0x3e95('0x30')]:_0xeb20[_0x3e95('0x2a')];if(_0x34b6d6[_0x3e95('0x2d')][_0x3e95('0x31')]){_0x3b8b94[_0x3e95('0x32')]=[{'all':!![]}];}_0x3b8b94=_[_0x3e95('0x33')]({},_0x3b8b94,_0x34b6d6[_0x3e95('0x34')]);return db[_0x3e95('0x2b')][_0x3e95('0x35')](_0x3b8b94)[_0x3e95('0x24')](handleEntityNotFound(_0x21e1aa,null))[_0x3e95('0x24')](respondWithResult(_0x21e1aa,null))[_0x3e95('0x36')](handleError(_0x21e1aa,null));};exports[_0x3e95('0x37')]=function(_0x5c2f56,_0xc238f5){return db[_0x3e95('0x2b')][_0x3e95('0x35')]({'where':{'id':_0x5c2f56['params']['id']}})[_0x3e95('0x24')](handleEntityNotFound(_0xc238f5,null))[_0x3e95('0x24')](removeEntity(_0xc238f5,null))[_0x3e95('0x36')](handleError(_0xc238f5,null));};function widgetAttributes(_0x5a3395){try{switch(_0x5a3395[_0x3e95('0x38')]){case _0x3e95('0x39'):return[{'name':'attrUrl','value':_0x5a3395[_0x3e95('0x3a')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x0]?_0x5a3395[_0x3e95('0x3b')][0x0][_0x3e95('0x3c')]:undefined)||_0x3e95('0x3d')}];case _0x3e95('0x3e'):return[{'name':'attrPath','value':_0x5a3395['attrPath']||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x0]?_0x5a3395[_0x3e95('0x3b')][0x0][_0x3e95('0x3c')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x5a3395[_0x3e95('0x3f')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395['attrs'][0x0]?_0x5a3395[_0x3e95('0x3b')][0x0][_0x3e95('0x3c')]:undefined)||_0x3e95('0x40')},{'name':_0x3e95('0x41'),'value':_0x5a3395[_0x3e95('0x41')]||(_0x5a3395['attrs']&&_0x5a3395['attrs'][0x1]?_0x5a3395[_0x3e95('0x3b')][0x1][_0x3e95('0x3c')]:undefined)||_0x3e95('0x42')},{'name':_0x3e95('0x43'),'value':_0x5a3395[_0x3e95('0x43')]||(_0x5a3395['attrs']&&_0x5a3395[_0x3e95('0x3b')][0x2]?_0x5a3395[_0x3e95('0x3b')][0x2][_0x3e95('0x3c')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5a3395['attrMetric']||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x0]?_0x5a3395[_0x3e95('0x3b')][0x0]['value']:undefined)||_0x3e95('0x44')},{'name':_0x3e95('0x45'),'value':_0x5a3395[_0x3e95('0x45')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x1]?_0x5a3395[_0x3e95('0x3b')][0x1][_0x3e95('0x3c')]:undefined)||[]},{'name':_0x3e95('0x43'),'value':_0x5a3395[_0x3e95('0x43')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x2]?_0x5a3395[_0x3e95('0x3b')][0x2][_0x3e95('0x3c')]:undefined)||0x14},{'name':_0x3e95('0x46'),'value':_0x5a3395[_0x3e95('0x46')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x3]?_0x5a3395['attrs'][0x3][_0x3e95('0x3c')]:undefined)||_0x3e95('0x47')},{'name':_0x3e95('0x48'),'value':_0x5a3395[_0x3e95('0x48')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x4]?_0x5a3395[_0x3e95('0x3b')][0x4][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x49'),'value':_0x5a3395[_0x3e95('0x49')]||(_0x5a3395['attrs']&&_0x5a3395[_0x3e95('0x3b')][0x5]?_0x5a3395[_0x3e95('0x3b')][0x5][_0x3e95('0x3c')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x5a3395['attrSmsAccounts']||(_0x5a3395['attrs']&&_0x5a3395['attrs'][0x6]?_0x5a3395[_0x3e95('0x3b')][0x6][_0x3e95('0x3c')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5a3395['attrOpenchannelAccounts']||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x7]?_0x5a3395[_0x3e95('0x3b')][0x7][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x4a'),'value':_0x5a3395['attrWhatsappAccounts']||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395['attrs'][0x8]?_0x5a3395[_0x3e95('0x3b')][0x8][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x4b'),'value':_0x5a3395[_0x3e95('0x4b')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x9]?_0x5a3395[_0x3e95('0x3b')][0x9][_0x3e95('0x3c')]:undefined)||''}];case _0x3e95('0x4c'):case _0x3e95('0x4d'):return[{'name':_0x3e95('0x4e'),'value':_0x5a3395[_0x3e95('0x4e')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395['attrs'][0x0]?_0x5a3395[_0x3e95('0x3b')][0x0][_0x3e95('0x3c')]:undefined)||_0x3e95('0x44')},{'name':'attrSerie2','value':_0x5a3395[_0x3e95('0x4f')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x1]?_0x5a3395[_0x3e95('0x3b')][0x1][_0x3e95('0x3c')]:undefined)||null},{'name':'attrSerie3','value':_0x5a3395[_0x3e95('0x50')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x2]?_0x5a3395[_0x3e95('0x3b')][0x2][_0x3e95('0x3c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5a3395[_0x3e95('0x45')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x3]?_0x5a3395[_0x3e95('0x3b')][0x3]['value']:undefined)||[]},{'name':_0x3e95('0x46'),'value':_0x5a3395[_0x3e95('0x46')]||(_0x5a3395['attrs']&&_0x5a3395[_0x3e95('0x3b')][0x4]?_0x5a3395['attrs'][0x4][_0x3e95('0x3c')]:undefined)||_0x3e95('0x47')},{'name':'attrEmailAccounts','value':_0x5a3395[_0x3e95('0x48')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x5]?_0x5a3395[_0x3e95('0x3b')][0x5][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x49'),'value':_0x5a3395[_0x3e95('0x49')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x6]?_0x5a3395[_0x3e95('0x3b')][0x6][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x51'),'value':_0x5a3395[_0x3e95('0x51')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x7]?_0x5a3395[_0x3e95('0x3b')][0x7]['value']:undefined)||''},{'name':_0x3e95('0x52'),'value':_0x5a3395[_0x3e95('0x52')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x8]?_0x5a3395['attrs'][0x8][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x4a'),'value':_0x5a3395['attrWhatsappAccounts']||(_0x5a3395['attrs']&&_0x5a3395[_0x3e95('0x3b')][0x9]?_0x5a3395[_0x3e95('0x3b')][0x9][_0x3e95('0x3c')]:undefined)||''},{'name':_0x3e95('0x4b'),'value':_0x5a3395[_0x3e95('0x4b')]||(_0x5a3395['attrs']&&_0x5a3395[_0x3e95('0x3b')][0xa]?_0x5a3395[_0x3e95('0x3b')][0xa][_0x3e95('0x3c')]:undefined)||''}];case _0x3e95('0x53'):return[{'name':_0x3e95('0x54'),'type':_0x5a3395[_0x3e95('0x55')]||(_0x5a3395['attrs']&&_0x5a3395['attrs'][0x0]?_0x5a3395['attrs'][0x0][_0x3e95('0x38')]:undefined)||null,'value':_0x5a3395['attrReport']||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x0]?_0x5a3395['attrs'][0x0]['value']:undefined)||null},{'name':_0x3e95('0x56'),'value':_0x5a3395[_0x3e95('0x56')]||(_0x5a3395[_0x3e95('0x3b')]&&_0x5a3395[_0x3e95('0x3b')][0x1]?_0x5a3395['attrs'][0x1][_0x3e95('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x4c072c){logger['error'](_0x3e95('0x57'),JSON[_0x3e95('0x58')](_0x4c072c));return[];}}exports[_0x3e95('0x59')]=function(_0x1354bc,_0x16aec4){if(_0x1354bc[_0x3e95('0x5a')]){_0x1354bc[_0x3e95('0x5a')]['attrs']=widgetAttributes(_0x1354bc[_0x3e95('0x5a')]);}return db[_0x3e95('0x2b')][_0x3e95('0x59')](_0x1354bc[_0x3e95('0x5a')],{})[_0x3e95('0x24')](respondWithResult(_0x16aec4,0xc9))[_0x3e95('0x36')](handleError(_0x16aec4,null));};exports['update']=function(_0x334352,_0x52da84){if(_0x334352[_0x3e95('0x5a')]['id']){delete _0x334352[_0x3e95('0x5a')]['id'];}_0x334352[_0x3e95('0x5a')][_0x3e95('0x3b')]=widgetAttributes(_0x334352[_0x3e95('0x5a')]);return db[_0x3e95('0x2b')]['find']({'where':{'id':_0x334352['params']['id']}})[_0x3e95('0x24')](handleEntityNotFound(_0x52da84,null))[_0x3e95('0x24')](saveUpdates(_0x334352['body'],null))[_0x3e95('0x24')](respondWithResult(_0x52da84,null))[_0x3e95('0x36')](handleError(_0x52da84,null));}; \ No newline at end of file +var _0x06ae=['api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','DashboardItem','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x24c363,_0x53a389){var _0x1b351f=function(_0x156d8e){while(--_0x156d8e){_0x24c363['push'](_0x24c363['shift']());}};_0x1b351f(++_0x53a389);}(_0x06ae,0x16e));var _0xe06a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06ae[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06a('0x0'));var zipdir=require(_0xe06a('0x1'));var jsonpatch=require(_0xe06a('0x2'));var rp=require(_0xe06a('0x3'));var moment=require(_0xe06a('0x4'));var BPromise=require(_0xe06a('0x5'));var Mustache=require(_0xe06a('0x6'));var util=require(_0xe06a('0x7'));var path=require(_0xe06a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe06a('0x9'));var _=require(_0xe06a('0xa'));var squel=require(_0xe06a('0xb'));var crypto=require(_0xe06a('0xc'));var jsforce=require(_0xe06a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe06a('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe06a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe06a('0x11'))(_0xe06a('0x12'));var utils=require('../../config/utils');var config=require(_0xe06a('0x13'));var licenseUtil=require(_0xe06a('0x14'));var db=require('../../mysqldb')['db'];config[_0xe06a('0x15')]=_[_0xe06a('0x16')](config[_0xe06a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe06a('0x17'))(new Redis(config[_0xe06a('0x15')]));require(_0xe06a('0x18'))[_0xe06a('0x19')](socket);function respondWithStatusCode(_0x335c0d,_0x49decd){_0x49decd=_0x49decd||0xcc;return function(_0x1284bf){if(_0x1284bf){return _0x335c0d[_0xe06a('0x1a')](_0x49decd);}return _0x335c0d[_0xe06a('0x1b')](_0x49decd)[_0xe06a('0x1c')]();};}function respondWithResult(_0x4d0e41,_0x403a92){_0x403a92=_0x403a92||0xc8;return function(_0x57b590){if(_0x57b590){return _0x4d0e41[_0xe06a('0x1b')](_0x403a92)['json'](_0x57b590);}};}function respondWithFilteredResult(_0x534380,_0x4941ce){return function(_0x7a5a6f){if(_0x7a5a6f){var _0x43ce7b=typeof _0x4941ce[_0xe06a('0x1d')]==='undefined'&&typeof _0x4941ce[_0xe06a('0x1e')]===_0xe06a('0x1f');var _0x5806b6=_0x7a5a6f[_0xe06a('0x20')];var _0x5382a6=_0x43ce7b?0x0:_0x4941ce[_0xe06a('0x1d')];var _0x4a2681=_0x43ce7b?_0x7a5a6f['count']:_0x4941ce[_0xe06a('0x1d')]+_0x4941ce[_0xe06a('0x1e')];var _0x1e7f25;if(_0x4a2681>=_0x5806b6){_0x4a2681=_0x5806b6;_0x1e7f25=0xc8;}else{_0x1e7f25=0xce;}_0x534380[_0xe06a('0x1b')](_0x1e7f25);return _0x534380[_0xe06a('0x21')](_0xe06a('0x22'),_0x5382a6+'-'+_0x4a2681+'/'+_0x5806b6)[_0xe06a('0x23')](_0x7a5a6f);}return null;};}function patchUpdates(_0x2c30c7){return function(_0x275668){try{jsonpatch[_0xe06a('0x24')](_0x275668,_0x2c30c7,!![]);}catch(_0x5970d9){return BPromise[_0xe06a('0x25')](_0x5970d9);}return _0x275668[_0xe06a('0x26')]();};}function saveUpdates(_0xf13325,_0x82ba72){return function(_0x352434){if(_0x352434){return _0x352434[_0xe06a('0x27')](_0xf13325)[_0xe06a('0x28')](function(_0x19a7e0){return _0x19a7e0;});}return null;};}function removeEntity(_0x456d2d,_0x4ef4ca){return function(_0x53bdca){if(_0x53bdca){return _0x53bdca[_0xe06a('0x29')]()['then'](function(){_0x456d2d[_0xe06a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afa75,_0x5e0b56){return function(_0x37ff49){if(!_0x37ff49){_0x4afa75[_0xe06a('0x1a')](0x194);}return _0x37ff49;};}function handleError(_0x58525a,_0x217f24){_0x217f24=_0x217f24||0x1f4;return function(_0x1613d8){logger[_0xe06a('0x2a')](_0x1613d8[_0xe06a('0x2b')]);if(_0x1613d8[_0xe06a('0x2c')]){delete _0x1613d8[_0xe06a('0x2c')];}_0x58525a[_0xe06a('0x1b')](_0x217f24)[_0xe06a('0x2d')](_0x1613d8);};}exports[_0xe06a('0x2e')]=function(_0x50aded,_0x4bee48){var _0x177d3e={'raw':![],'where':{'id':_0x50aded[_0xe06a('0x2f')]['id']}},_0x1f985b={};_0x1f985b[_0xe06a('0x30')]=_['keys'](db[_0xe06a('0x31')]['rawAttributes']);_0x1f985b[_0xe06a('0x32')]=_[_0xe06a('0x33')](_0x50aded[_0xe06a('0x32')]);_0x1f985b[_0xe06a('0x34')]=_['intersection'](_0x1f985b[_0xe06a('0x30')],_0x1f985b[_0xe06a('0x32')]);_0x177d3e[_0xe06a('0x35')]=_[_0xe06a('0x36')](_0x1f985b['model'],qs['fields'](_0x50aded[_0xe06a('0x32')][_0xe06a('0x37')]));_0x177d3e[_0xe06a('0x35')]=_0x177d3e[_0xe06a('0x35')][_0xe06a('0x38')]?_0x177d3e[_0xe06a('0x35')]:_0x1f985b['model'];if(_0x50aded['query'][_0xe06a('0x39')]){_0x177d3e['include']=[{'all':!![]}];}_0x177d3e=_[_0xe06a('0x3a')]({},_0x177d3e,_0x50aded['options']);return db[_0xe06a('0x31')][_0xe06a('0x3b')](_0x177d3e)[_0xe06a('0x28')](handleEntityNotFound(_0x4bee48,null))['then'](respondWithResult(_0x4bee48,null))['catch'](handleError(_0x4bee48,null));};exports[_0xe06a('0x29')]=function(_0xb0e44c,_0xefd764){return db[_0xe06a('0x31')][_0xe06a('0x3b')]({'where':{'id':_0xb0e44c[_0xe06a('0x2f')]['id']}})['then'](handleEntityNotFound(_0xefd764,null))['then'](removeEntity(_0xefd764,null))['catch'](handleError(_0xefd764,null));};function widgetAttributes(_0x598caf){try{switch(_0x598caf[_0xe06a('0x3c')]){case _0xe06a('0x3d'):return[{'name':_0xe06a('0x3e'),'value':_0x598caf[_0xe06a('0x3e')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf['attrs'][0x0]?_0x598caf[_0xe06a('0x3f')][0x0][_0xe06a('0x40')]:undefined)||_0xe06a('0x41')}];case'custom':return[{'name':_0xe06a('0x42'),'value':_0x598caf[_0xe06a('0x42')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x0]?_0x598caf[_0xe06a('0x3f')][0x0][_0xe06a('0x40')]:undefined)||''}];case _0xe06a('0x43'):return[{'name':_0xe06a('0x44'),'value':_0x598caf['attrHourFormat']||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x0]?_0x598caf['attrs'][0x0]['value']:undefined)||_0xe06a('0x45')},{'name':_0xe06a('0x46'),'value':_0x598caf[_0xe06a('0x46')]||(_0x598caf['attrs']&&_0x598caf['attrs'][0x1]?_0x598caf[_0xe06a('0x3f')][0x1][_0xe06a('0x40')]:undefined)||_0xe06a('0x47')},{'name':_0xe06a('0x48'),'value':_0x598caf['attrFontSize']||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf['attrs'][0x2]?_0x598caf[_0xe06a('0x3f')][0x2][_0xe06a('0x40')]:undefined)||0xc}];case'counter':return[{'name':_0xe06a('0x49'),'value':_0x598caf[_0xe06a('0x49')]||(_0x598caf['attrs']&&_0x598caf['attrs'][0x0]?_0x598caf['attrs'][0x0]['value']:undefined)||_0xe06a('0x4a')},{'name':'attrVoiceQueues','value':_0x598caf['attrVoiceQueues']||(_0x598caf['attrs']&&_0x598caf['attrs'][0x1]?_0x598caf[_0xe06a('0x3f')][0x1][_0xe06a('0x40')]:undefined)||[]},{'name':_0xe06a('0x48'),'value':_0x598caf[_0xe06a('0x48')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x2]?_0x598caf['attrs'][0x2][_0xe06a('0x40')]:undefined)||0x14},{'name':_0xe06a('0x4b'),'value':_0x598caf[_0xe06a('0x4b')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x3]?_0x598caf['attrs'][0x3]['value']:undefined)||_0xe06a('0x4c')},{'name':_0xe06a('0x4d'),'value':_0x598caf[_0xe06a('0x4d')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf['attrs'][0x4]?_0x598caf[_0xe06a('0x3f')][0x4][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x4e'),'value':_0x598caf['attrFaxAccounts']||(_0x598caf['attrs']&&_0x598caf['attrs'][0x5]?_0x598caf[_0xe06a('0x3f')][0x5][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x4f'),'value':_0x598caf[_0xe06a('0x4f')]||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x6]?_0x598caf[_0xe06a('0x3f')][0x6][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x50'),'value':_0x598caf[_0xe06a('0x50')]||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x7]?_0x598caf[_0xe06a('0x3f')][0x7][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x51'),'value':_0x598caf['attrWhatsappAccounts']||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x8]?_0x598caf[_0xe06a('0x3f')][0x8][_0xe06a('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x598caf[_0xe06a('0x52')]||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x9]?_0x598caf['attrs'][0x9]['value']:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0xe06a('0x53'),'value':_0x598caf['attrSerie1']||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x0]?_0x598caf[_0xe06a('0x3f')][0x0][_0xe06a('0x40')]:undefined)||_0xe06a('0x4a')},{'name':'attrSerie2','value':_0x598caf[_0xe06a('0x54')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x1]?_0x598caf[_0xe06a('0x3f')][0x1]['value']:undefined)||null},{'name':_0xe06a('0x55'),'value':_0x598caf[_0xe06a('0x55')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x2]?_0x598caf[_0xe06a('0x3f')][0x2][_0xe06a('0x40')]:undefined)||null},{'name':_0xe06a('0x56'),'value':_0x598caf[_0xe06a('0x56')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x3]?_0x598caf[_0xe06a('0x3f')][0x3][_0xe06a('0x40')]:undefined)||[]},{'name':_0xe06a('0x4b'),'value':_0x598caf[_0xe06a('0x4b')]||(_0x598caf['attrs']&&_0x598caf['attrs'][0x4]?_0x598caf[_0xe06a('0x3f')][0x4]['value']:undefined)||_0xe06a('0x4c')},{'name':_0xe06a('0x4d'),'value':_0x598caf[_0xe06a('0x4d')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x5]?_0x598caf[_0xe06a('0x3f')][0x5][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x4e'),'value':_0x598caf[_0xe06a('0x4e')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x6]?_0x598caf[_0xe06a('0x3f')][0x6]['value']:undefined)||''},{'name':_0xe06a('0x4f'),'value':_0x598caf[_0xe06a('0x4f')]||(_0x598caf['attrs']&&_0x598caf['attrs'][0x7]?_0x598caf[_0xe06a('0x3f')][0x7]['value']:undefined)||''},{'name':_0xe06a('0x50'),'value':_0x598caf[_0xe06a('0x50')]||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x8]?_0x598caf[_0xe06a('0x3f')][0x8]['value']:undefined)||''},{'name':_0xe06a('0x51'),'value':_0x598caf[_0xe06a('0x51')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x9]?_0x598caf[_0xe06a('0x3f')][0x9][_0xe06a('0x40')]:undefined)||''},{'name':_0xe06a('0x52'),'value':_0x598caf[_0xe06a('0x52')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0xa]?_0x598caf[_0xe06a('0x3f')][0xa][_0xe06a('0x40')]:undefined)||''}];case _0xe06a('0x57'):return[{'name':_0xe06a('0x58'),'type':_0x598caf[_0xe06a('0x59')]||(_0x598caf['attrs']&&_0x598caf[_0xe06a('0x3f')][0x0]?_0x598caf[_0xe06a('0x3f')][0x0]['type']:undefined)||null,'value':_0x598caf[_0xe06a('0x58')]||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x0]?_0x598caf[_0xe06a('0x3f')][0x0][_0xe06a('0x40')]:undefined)||null},{'name':_0xe06a('0x5a'),'value':_0x598caf['attrRefresh']||(_0x598caf[_0xe06a('0x3f')]&&_0x598caf[_0xe06a('0x3f')][0x1]?_0x598caf[_0xe06a('0x3f')][0x1][_0xe06a('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x33c033){logger[_0xe06a('0x2a')](_0xe06a('0x5b'),JSON[_0xe06a('0x5c')](_0x33c033));return[];}}exports['create']=function(_0x23a8da,_0x1895da){if(_0x23a8da[_0xe06a('0x5d')]){_0x23a8da[_0xe06a('0x5d')][_0xe06a('0x3f')]=widgetAttributes(_0x23a8da[_0xe06a('0x5d')]);}return db[_0xe06a('0x31')][_0xe06a('0x5e')](_0x23a8da[_0xe06a('0x5d')],{})[_0xe06a('0x28')](respondWithResult(_0x1895da,0xc9))[_0xe06a('0x5f')](handleError(_0x1895da,null));};exports['update']=function(_0x2d0340,_0x3c6704){if(_0x2d0340[_0xe06a('0x5d')]['id']){delete _0x2d0340[_0xe06a('0x5d')]['id'];}_0x2d0340[_0xe06a('0x5d')][_0xe06a('0x3f')]=widgetAttributes(_0x2d0340[_0xe06a('0x5d')]);return db[_0xe06a('0x31')][_0xe06a('0x3b')]({'where':{'id':_0x2d0340[_0xe06a('0x2f')]['id']}})[_0xe06a('0x28')](handleEntityNotFound(_0x3c6704,null))[_0xe06a('0x28')](saveUpdates(_0x2d0340[_0xe06a('0x5d')],null))[_0xe06a('0x28')](respondWithResult(_0x3c6704,null))['catch'](handleError(_0x3c6704,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a9bba11..0c27619 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 _0x2414=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x2414,0xc2));var _0x4241=function(_0xdeafdd,_0x26e6f4){_0xdeafdd=_0xdeafdd-0x0;var _0x18be12=_0x2414[_0xdeafdd];return _0x18be12;};'use strict';var EventEmitter=require(_0x4241('0x0'));var DashboardItem=require(_0x4241('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4241('0x2')](0x0);var events={'afterCreate':_0x4241('0x3'),'afterUpdate':_0x4241('0x4'),'afterDestroy':_0x4241('0x5')};function emitEvent(_0x4f44ab){return function(_0x29869a,_0x553239,_0x4b0fc3){DashboardItemEvents['emit'](_0x4f44ab+':'+_0x29869a['id'],_0x29869a);DashboardItemEvents[_0x4241('0x6')](_0x4f44ab,_0x29869a);_0x4b0fc3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x4241('0x7')](e,emitEvent(event));}}module[_0x4241('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x2581=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2581,0x72));var _0x1258=function(_0x18891b,_0x2c7042){_0x18891b=_0x18891b-0x0;var _0x3ac3d2=_0x2581[_0x18891b];return _0x3ac3d2;};'use strict';var EventEmitter=require(_0x1258('0x0'));var DashboardItem=require(_0x1258('0x1'))['db'][_0x1258('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1258('0x3')](0x0);var events={'afterCreate':_0x1258('0x4'),'afterUpdate':_0x1258('0x5'),'afterDestroy':_0x1258('0x6')};function emitEvent(_0xcda1e8){return function(_0x3e019c,_0x11675f,_0x555cba){DashboardItemEvents[_0x1258('0x7')](_0xcda1e8+':'+_0x3e019c['id'],_0x3e019c);DashboardItemEvents[_0x1258('0x7')](_0xcda1e8,_0x3e019c);_0x555cba(null);};}for(var e in events){if(events[_0x1258('0x8')](e)){var event=events[e];DashboardItem[_0x1258('0x9')](e,emitEvent(event));}}module[_0x1258('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d2de9d4..6dfdc0f 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 _0x3e32=['moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','util','../../config/logger','api'];(function(_0x151e0b,_0x3bec86){var _0x5d4a5c=function(_0x1567f4){while(--_0x1567f4){_0x151e0b['push'](_0x151e0b['shift']());}};_0x5d4a5c(++_0x3bec86);}(_0x3e32,0x194));var _0x23e3=function(_0x415edb,_0x79581d){_0x415edb=_0x415edb-0x0;var _0x357ece=_0x3e32[_0x415edb];return _0x357ece;};'use strict';var _=require(_0x23e3('0x0'));var util=require(_0x23e3('0x1'));var logger=require(_0x23e3('0x2'))(_0x23e3('0x3'));var moment=require(_0x23e3('0x4'));var BPromise=require(_0x23e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23e3('0x6'));var rimraf=require(_0x23e3('0x7'));var config=require(_0x23e3('0x8'));var attributes=require(_0x23e3('0x9'));module['exports']=function(_0x10732a,_0x2c236a){return _0x10732a[_0x23e3('0xa')](_0x23e3('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6597=['../../config/logger','moment','request-promise','./dashboardItem.attributes','exports','define','lodash','util'];(function(_0x5b008f,_0x163307){var _0x5e1a66=function(_0x1e56dd){while(--_0x1e56dd){_0x5b008f['push'](_0x5b008f['shift']());}};_0x5e1a66(++_0x163307);}(_0x6597,0x16e));var _0x7659=function(_0x4396b6,_0x3c975c){_0x4396b6=_0x4396b6-0x0;var _0x8906d=_0x6597[_0x4396b6];return _0x8906d;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var logger=require(_0x7659('0x2'))('api');var moment=require(_0x7659('0x3'));var BPromise=require('bluebird');var rp=require(_0x7659('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7659('0x5'));module[_0x7659('0x6')]=function(_0x4e09cc,_0xb90fa2){return _0x4e09cc[_0x7659('0x7')]('DashboardItem',attributes,{'tableName':'dashboard_items','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 ff9cb24..540ba43 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 _0x2c53=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x2c53,0x1cb));var _0x32c5=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x2c53[_0x3aaf97];return _0xeba75e;};'use strict';var _=require('lodash');var util=require(_0x32c5('0x0'));var moment=require(_0x32c5('0x1'));var BPromise=require(_0x32c5('0x2'));var rs=require(_0x32c5('0x3'));var fs=require('fs');var Redis=require(_0x32c5('0x4'));var db=require(_0x32c5('0x5'))['db'];var utils=require(_0x32c5('0x6'));var logger=require(_0x32c5('0x7'))(_0x32c5('0x8'));var config=require(_0x32c5('0x9'));var jayson=require(_0x32c5('0xa'));var client=jayson[_0x32c5('0xb')][_0x32c5('0xc')]({'port':0x232a});config[_0x32c5('0xd')]=_[_0x32c5('0xe')](config[_0x32c5('0xd')],{'host':_0x32c5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32c5('0xd')]));require(_0x32c5('0x10'))[_0x32c5('0x11')](socket);function respondWithRpcPromise(_0x1bed0f,_0x332a76,_0x6b9737){return new BPromise(function(_0x31af92,_0x3b0b0d){return client[_0x32c5('0x12')](_0x1bed0f,_0x6b9737)[_0x32c5('0x13')](function(_0x2e5550){logger[_0x32c5('0x14')](_0x32c5('0x15'),_0x332a76,_0x32c5('0x16'));logger[_0x32c5('0x17')](_0x32c5('0x18'),_0x332a76,_0x32c5('0x16'),JSON[_0x32c5('0x19')](_0x2e5550));if(_0x2e5550[_0x32c5('0x1a')]){if(_0x2e5550[_0x32c5('0x1a')][_0x32c5('0x1b')]===0x1f4){logger['error'](_0x32c5('0x15'),_0x332a76,_0x2e5550[_0x32c5('0x1a')]['message']);return _0x3b0b0d(_0x2e5550['error']['message']);}logger[_0x32c5('0x1a')](_0x32c5('0x15'),_0x332a76,_0x2e5550[_0x32c5('0x1a')][_0x32c5('0x1c')]);return _0x31af92(_0x2e5550['error'][_0x32c5('0x1c')]);}else{logger['info'](_0x32c5('0x15'),_0x332a76,_0x32c5('0x16'));_0x31af92(_0x2e5550['result'][_0x32c5('0x1c')]);}})[_0x32c5('0x1d')](function(_0x551db2){logger[_0x32c5('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x332a76,_0x551db2);_0x3b0b0d(_0x551db2);});});} \ No newline at end of file +var _0x778e=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','code','DashboardItem,\x20%s,\x20%s','message','error','lodash','moment','bluebird','randomstring','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent'];(function(_0x44d48d,_0xf539fd){var _0x2b6985=function(_0x1f3c72){while(--_0x1f3c72){_0x44d48d['push'](_0x44d48d['shift']());}};_0x2b6985(++_0xf539fd);}(_0x778e,0xcc));var _0xe778=function(_0x50b308,_0x3cf522){_0x50b308=_0x50b308-0x0;var _0x5a5dc2=_0x778e[_0x50b308];return _0x5a5dc2;};'use strict';var _=require(_0xe778('0x0'));var util=require('util');var moment=require(_0xe778('0x1'));var BPromise=require(_0xe778('0x2'));var rs=require(_0xe778('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe778('0x4'));var logger=require('../../config/logger')(_0xe778('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xe778('0x6')]=_[_0xe778('0x7')](config[_0xe778('0x6')],{'host':_0xe778('0x8'),'port':0x18eb});var socket=require(_0xe778('0x9'))(new Redis(config[_0xe778('0x6')]));require(_0xe778('0xa'))[_0xe778('0xb')](socket);function respondWithRpcPromise(_0xa7c858,_0x1f89e1,_0x122a9a){return new BPromise(function(_0x34ba38,_0x45b0ed){return client[_0xe778('0xc')](_0xa7c858,_0x122a9a)[_0xe778('0xd')](function(_0xa8eb24){logger[_0xe778('0xe')]('DashboardItem,\x20%s,\x20%s',_0x1f89e1,_0xe778('0xf'));logger[_0xe778('0x10')](_0xe778('0x11'),_0x1f89e1,_0xe778('0xf'),JSON['stringify'](_0xa8eb24));if(_0xa8eb24['error']){if(_0xa8eb24['error'][_0xe778('0x12')]===0x1f4){logger['error'](_0xe778('0x13'),_0x1f89e1,_0xa8eb24['error'][_0xe778('0x14')]);return _0x45b0ed(_0xa8eb24[_0xe778('0x15')][_0xe778('0x14')]);}logger[_0xe778('0x15')](_0xe778('0x13'),_0x1f89e1,_0xa8eb24['error']['message']);return _0x34ba38(_0xa8eb24[_0xe778('0x15')][_0xe778('0x14')]);}else{logger[_0xe778('0xe')](_0xe778('0x13'),_0x1f89e1,_0xe778('0xf'));_0x34ba38(_0xa8eb24['result'][_0xe778('0x14')]);}})['catch'](function(_0x279a94){logger[_0xe778('0x15')](_0xe778('0x13'),_0x1f89e1,_0x279a94);_0x45b0ed(_0x279a94);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 018b4f3..8df65ab 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 _0x9b07=['removeListener','register','length','dashboardItem:','save','emit'];(function(_0x534ae6,_0x469a73){var _0x3af274=function(_0x3aa385){while(--_0x3aa385){_0x534ae6['push'](_0x534ae6['shift']());}};_0x3af274(++_0x469a73);}(_0x9b07,0x106));var _0x79b0=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9b07[_0x2dea24];return _0x309d58;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x79b0('0x0'),'remove','update'];function createListener(_0x128070,_0x251a75){return function(_0x108705){_0x251a75[_0x79b0('0x1')](_0x128070,_0x108705);};}function removeListener(_0x2ecf9c,_0x45c92d){return function(){DashboardItemEvents[_0x79b0('0x2')](_0x2ecf9c,_0x45c92d);};}exports[_0x79b0('0x3')]=function(_0x3f7a32){for(var _0x300a67=0x0,_0x5a688c=events[_0x79b0('0x4')];_0x300a67<_0x5a688c;_0x300a67++){var _0x3e23fc=events[_0x300a67];var _0xcb2d16=createListener(_0x79b0('0x5')+_0x3e23fc,_0x3f7a32);DashboardItemEvents['on'](_0x3e23fc,_0xcb2d16);}}; \ No newline at end of file +var _0x9e5d=['register','length','dashboardItem:','save','remove','update','emit'];(function(_0x75fb3c,_0x10e0da){var _0x1a2837=function(_0xcec616){while(--_0xcec616){_0x75fb3c['push'](_0x75fb3c['shift']());}};_0x1a2837(++_0x10e0da);}(_0x9e5d,0x65));var _0xd9e5=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x9e5d[_0x3a1ea5];return _0xfac9b2;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xd9e5('0x0'),_0xd9e5('0x1'),_0xd9e5('0x2')];function createListener(_0x2401f4,_0x1f850e){return function(_0x31972f){_0x1f850e[_0xd9e5('0x3')](_0x2401f4,_0x31972f);};}function removeListener(_0x529dd5,_0x4a62f0){return function(){DashboardItemEvents['removeListener'](_0x529dd5,_0x4a62f0);};}exports[_0xd9e5('0x4')]=function(_0x12c8ae){for(var _0x4adb65=0x0,_0x54e5ef=events[_0xd9e5('0x5')];_0x4adb65<_0x54e5ef;_0x4adb65++){var _0x537fea=events[_0x4adb65];var _0x46d932=createListener(_0xd9e5('0x6')+_0x537fea,_0x12c8ae);DashboardItemEvents['on'](_0x537fea,_0x46d932);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 82e5f29..ba1f387 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 _0x176b=['../../config/environment','get','isAuthenticated','show','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x36ba44,_0x1560ac){var _0x3eb97d=function(_0xea12c4){while(--_0xea12c4){_0x36ba44['push'](_0x36ba44['shift']());}};_0x3eb97d(++_0x1560ac);}(_0x176b,0xcf));var _0xb176=function(_0x2c0a00,_0x3548e4){_0x2c0a00=_0x2c0a00-0x0;var _0x119901=_0x176b[_0x2c0a00];return _0x119901;};'use strict';var multer=require(_0xb176('0x0'));var util=require(_0xb176('0x1'));var path=require(_0xb176('0x2'));var timeout=require(_0xb176('0x3'));var express=require(_0xb176('0x4'));var router=express[_0xb176('0x5')]();var fs_extra=require(_0xb176('0x6'));var auth=require(_0xb176('0x7'));var interaction=require(_0xb176('0x8'));var config=require(_0xb176('0x9'));var controller=require('./dashboardItem.controller');router[_0xb176('0xa')]('/:id',auth[_0xb176('0xb')](),controller[_0xb176('0xc')]);router[_0xb176('0xd')]('/',auth[_0xb176('0xb')](),controller['create']);router['put'](_0xb176('0xe'),auth['isAuthenticated'](),controller[_0xb176('0xf')]);router['delete'](_0xb176('0xe'),auth[_0xb176('0xb')](),controller[_0xb176('0x10')]);module[_0xb176('0x11')]=router; \ No newline at end of file +var _0x0dbc=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x0dbc,0x1a5));var _0xc0db=function(_0x462fcb,_0x6f1e04){_0x462fcb=_0x462fcb-0x0;var _0xf39de5=_0x0dbc[_0x462fcb];return _0xf39de5;};'use strict';var multer=require(_0xc0db('0x0'));var util=require(_0xc0db('0x1'));var path=require(_0xc0db('0x2'));var timeout=require(_0xc0db('0x3'));var express=require('express');var router=express[_0xc0db('0x4')]();var fs_extra=require(_0xc0db('0x5'));var auth=require(_0xc0db('0x6'));var interaction=require(_0xc0db('0x7'));var config=require(_0xc0db('0x8'));var controller=require('./dashboardItem.controller');router[_0xc0db('0x9')](_0xc0db('0xa'),auth[_0xc0db('0xb')](),controller[_0xc0db('0xc')]);router[_0xc0db('0xd')]('/',auth[_0xc0db('0xb')](),controller[_0xc0db('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc0db('0xf')]);router[_0xc0db('0x10')](_0xc0db('0xa'),auth[_0xc0db('0xb')](),controller[_0xc0db('0x11')]);module[_0xc0db('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 468193e..c064c74 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 _0x8831=['third','sequelize','exports','STRING','ENUM','first'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x8831,0x145));var _0x1883=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0x8831[_0x3d11be];return _0x4b657b;};'use strict';var Sequelize=require(_0x1883('0x0'));module[_0x1883('0x1')]={'name':{'type':Sequelize[_0x1883('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1883('0x3')](_0x1883('0x4'),'second',_0x1883('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0caf=['second','third','sequelize','STRING','first'];(function(_0x397ddb,_0x271caf){var _0xc80b9b=function(_0xc8974e){while(--_0xc8974e){_0x397ddb['push'](_0x397ddb['shift']());}};_0xc80b9b(++_0x271caf);}(_0x0caf,0x16a));var _0xf0ca=function(_0x4fe372,_0x340562){_0x4fe372=_0x4fe372-0x0;var _0x3425dc=_0x0caf[_0x4fe372];return _0x3425dc;};'use strict';var Sequelize=require(_0xf0ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0ca('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xf0ca('0x2'),_0xf0ca('0x3'),_0xf0ca('0x4')),'allowNull':![],'defaultValue':_0xf0ca('0x2')},'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 f1bb913..237fca3 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 _0x7f86=['mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','Dispositions','error','stack','name','send','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x349000,_0x184e05){var _0x188207=function(_0x104ed5){while(--_0x104ed5){_0x349000['push'](_0x349000['shift']());}};_0x188207(++_0x184e05);}(_0x7f86,0xea));var _0x67f8=function(_0x5aeda2,_0x141511){_0x5aeda2=_0x5aeda2-0x0;var _0x214921=_0x7f86[_0x5aeda2];return _0x214921;};'use strict';var emlformat=require(_0x67f8('0x0'));var rimraf=require(_0x67f8('0x1'));var zipdir=require(_0x67f8('0x2'));var jsonpatch=require(_0x67f8('0x3'));var rp=require(_0x67f8('0x4'));var moment=require('moment');var BPromise=require(_0x67f8('0x5'));var Mustache=require(_0x67f8('0x6'));var util=require(_0x67f8('0x7'));var path=require(_0x67f8('0x8'));var sox=require('sox');var csv=require(_0x67f8('0x9'));var ejs=require(_0x67f8('0xa'));var fs=require('fs');var fs_extra=require(_0x67f8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x67f8('0xc'));var jsforce=require(_0x67f8('0xd'));var deskjs=require(_0x67f8('0xe'));var toCsv=require(_0x67f8('0x9'));var querystring=require('querystring');var Papa=require(_0x67f8('0xf'));var Redis=require(_0x67f8('0x10'));var authService=require(_0x67f8('0x11'));var qs=require(_0x67f8('0x12'));var as=require(_0x67f8('0x13'));var hardwareService=require(_0x67f8('0x14'));var logger=require('../../config/logger')(_0x67f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x67f8('0x16'))['db'];function respondWithStatusCode(_0x1e8c3f,_0x24906b){_0x24906b=_0x24906b||0xcc;return function(_0x596b62){if(_0x596b62){return _0x1e8c3f[_0x67f8('0x17')](_0x24906b);}return _0x1e8c3f[_0x67f8('0x18')](_0x24906b)[_0x67f8('0x19')]();};}function respondWithResult(_0x373bd2,_0x3cbc67){_0x3cbc67=_0x3cbc67||0xc8;return function(_0x1139f2){if(_0x1139f2){return _0x373bd2[_0x67f8('0x18')](_0x3cbc67)['json'](_0x1139f2);}};}function respondWithFilteredResult(_0x5c9778,_0xbc99bf){return function(_0x4219e4){if(_0x4219e4){var _0x13c7ad=typeof _0xbc99bf[_0x67f8('0x1a')]==='undefined'&&typeof _0xbc99bf[_0x67f8('0x1b')]===_0x67f8('0x1c');var _0x562645=_0x4219e4[_0x67f8('0x1d')];var _0x8e0c98=_0x13c7ad?0x0:_0xbc99bf[_0x67f8('0x1a')];var _0x40fc36=_0x13c7ad?_0x4219e4[_0x67f8('0x1d')]:_0xbc99bf['offset']+_0xbc99bf[_0x67f8('0x1b')];var _0x45f4ba;if(_0x40fc36>=_0x562645){_0x40fc36=_0x562645;_0x45f4ba=0xc8;}else{_0x45f4ba=0xce;}_0x5c9778[_0x67f8('0x18')](_0x45f4ba);return _0x5c9778[_0x67f8('0x1e')](_0x67f8('0x1f'),_0x8e0c98+'-'+_0x40fc36+'/'+_0x562645)[_0x67f8('0x20')](_0x4219e4);}return null;};}function patchUpdates(_0x315db2){return function(_0x520566){try{jsonpatch[_0x67f8('0x21')](_0x520566,_0x315db2,!![]);}catch(_0x13b7fc){return BPromise['reject'](_0x13b7fc);}return _0x520566['save']();};}function saveUpdates(_0x347a2d,_0xe9c0cc){return function(_0x2e6a0b){if(_0x2e6a0b){return _0x2e6a0b[_0x67f8('0x22')](_0x347a2d)[_0x67f8('0x23')](function(_0x4b18d4){return _0x4b18d4;});}return null;};}function removeEntity(_0x2beae2,_0x27979f){return function(_0x463e74){if(_0x463e74){return _0x463e74[_0x67f8('0x24')]()[_0x67f8('0x23')](function(){var _0x5c06ae=_0x463e74['get']({'plain':!![]});var _0x48ae2a=_0x67f8('0x25');return db['UserProfileResource'][_0x67f8('0x24')]({'where':{'type':_0x48ae2a,'resourceId':_0x5c06ae['id']}})[_0x67f8('0x23')](function(){return _0x463e74;});})['then'](function(){_0x2beae2['status'](0xcc)[_0x67f8('0x19')]();});}};}function handleEntityNotFound(_0x4cb67d,_0x1c2422){return function(_0x1093c6){if(!_0x1093c6){_0x4cb67d[_0x67f8('0x17')](0x194);}return _0x1093c6;};}function handleError(_0x50adaf,_0x218d4c){_0x218d4c=_0x218d4c||0x1f4;return function(_0x9615be){logger[_0x67f8('0x26')](_0x9615be[_0x67f8('0x27')]);if(_0x9615be[_0x67f8('0x28')]){delete _0x9615be[_0x67f8('0x28')];}_0x50adaf[_0x67f8('0x18')](_0x218d4c)[_0x67f8('0x29')](_0x9615be);};}exports['index']=function(_0x5290c6,_0x501197){var _0x557f78={},_0x499029={},_0x138ea9={'count':0x0,'rows':[]};var _0x125c3b=_[_0x67f8('0x2a')](db['Disposition'][_0x67f8('0x2b')],function(_0x241933){return{'name':_0x241933['fieldName'],'type':_0x241933[_0x67f8('0x2c')]['key']};});_0x499029[_0x67f8('0x2d')]=_[_0x67f8('0x2a')](_0x125c3b,_0x67f8('0x28'));_0x499029[_0x67f8('0x2e')]=_[_0x67f8('0x2f')](_0x5290c6[_0x67f8('0x2e')]);_0x499029['filters']=_[_0x67f8('0x30')](_0x499029['model'],_0x499029['query']);_0x557f78[_0x67f8('0x31')]=_[_0x67f8('0x30')](_0x499029['model'],qs[_0x67f8('0x32')](_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x32')]));_0x557f78['attributes']=_0x557f78[_0x67f8('0x31')]['length']?_0x557f78[_0x67f8('0x31')]:_0x499029[_0x67f8('0x2d')];if(!_0x5290c6['query'][_0x67f8('0x33')](_0x67f8('0x34'))){_0x557f78[_0x67f8('0x1b')]=qs[_0x67f8('0x1b')](_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x1b')]);_0x557f78[_0x67f8('0x1a')]=qs[_0x67f8('0x1a')](_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x1a')]);}_0x557f78['order']=qs['sort'](_0x5290c6[_0x67f8('0x2e')]['sort']);_0x557f78[_0x67f8('0x35')]=qs[_0x67f8('0x36')](_[_0x67f8('0x37')](_0x5290c6[_0x67f8('0x2e')],_0x499029[_0x67f8('0x36')]),_0x125c3b);if(_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x38')]){_0x557f78[_0x67f8('0x35')]=_[_0x67f8('0x39')](_0x557f78[_0x67f8('0x35')],{'$or':_[_0x67f8('0x2a')](_0x125c3b,function(_0x5537bf){if(_0x5537bf[_0x67f8('0x2c')]!==_0x67f8('0x3a')){var _0x240365={};_0x240365[_0x5537bf[_0x67f8('0x28')]]={'$like':'%'+_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x38')]+'%'};return _0x240365;}})});}_0x557f78=_[_0x67f8('0x39')]({},_0x557f78,_0x5290c6[_0x67f8('0x3b')]);var _0x2af060={'where':_0x557f78['where']};return db[_0x67f8('0x3c')]['count'](_0x2af060)[_0x67f8('0x23')](function(_0x111c09){_0x138ea9[_0x67f8('0x1d')]=_0x111c09;if(_0x5290c6[_0x67f8('0x2e')][_0x67f8('0x3d')]){_0x557f78[_0x67f8('0x3e')]=[{'all':!![]}];}return db[_0x67f8('0x3c')][_0x67f8('0x3f')](_0x557f78);})[_0x67f8('0x23')](function(_0x3ea373){_0x138ea9[_0x67f8('0x40')]=_0x3ea373;return _0x138ea9;})[_0x67f8('0x23')](respondWithFilteredResult(_0x501197,_0x557f78))[_0x67f8('0x41')](handleError(_0x501197,null));};exports[_0x67f8('0x42')]=function(_0x15075e,_0x117d8b){var _0x17f249={'raw':!![],'where':{'id':_0x15075e[_0x67f8('0x43')]['id']}},_0x252da4={};_0x252da4['model']=_[_0x67f8('0x2f')](db[_0x67f8('0x3c')]['rawAttributes']);_0x252da4[_0x67f8('0x2e')]=_[_0x67f8('0x2f')](_0x15075e[_0x67f8('0x2e')]);_0x252da4[_0x67f8('0x36')]=_[_0x67f8('0x30')](_0x252da4['model'],_0x252da4[_0x67f8('0x2e')]);_0x17f249[_0x67f8('0x31')]=_[_0x67f8('0x30')](_0x252da4['model'],qs[_0x67f8('0x32')](_0x15075e[_0x67f8('0x2e')]['fields']));_0x17f249[_0x67f8('0x31')]=_0x17f249[_0x67f8('0x31')][_0x67f8('0x44')]?_0x17f249[_0x67f8('0x31')]:_0x252da4['model'];if(_0x15075e['query'][_0x67f8('0x3d')]){_0x17f249[_0x67f8('0x3e')]=[{'all':!![]}];}_0x17f249=_['merge']({},_0x17f249,_0x15075e[_0x67f8('0x3b')]);return db['Disposition']['find'](_0x17f249)[_0x67f8('0x23')](handleEntityNotFound(_0x117d8b,null))[_0x67f8('0x23')](respondWithResult(_0x117d8b,null))[_0x67f8('0x41')](handleError(_0x117d8b,null));};exports[_0x67f8('0x45')]=function(_0x2f8844,_0x52c925){return db['Disposition'][_0x67f8('0x45')](_0x2f8844[_0x67f8('0x46')],{})[_0x67f8('0x23')](function(_0x75989e){var _0xd76b54=_0x2f8844[_0x67f8('0x47')]['get']({'plain':!![]});if(!_0xd76b54)throw new Error(_0x67f8('0x48'));if(_0xd76b54[_0x67f8('0x49')]===_0x67f8('0x47')){var _0x119c96=_0x75989e[_0x67f8('0x4a')]({'plain':!![]});var _0x5ee7b2='Dispositions';return db[_0x67f8('0x4b')]['find']({'where':{'name':_0x5ee7b2,'userProfileId':_0xd76b54[_0x67f8('0x4c')]},'raw':!![]})[_0x67f8('0x23')](function(_0x30dbea){if(_0x30dbea&&_0x30dbea['autoAssociation']===0x0){return db[_0x67f8('0x4d')][_0x67f8('0x45')]({'name':_0x119c96[_0x67f8('0x28')],'resourceId':_0x119c96['id'],'type':_0x30dbea[_0x67f8('0x28')],'sectionId':_0x30dbea['id']},{})[_0x67f8('0x23')](function(){return _0x75989e;});}else{return _0x75989e;}})[_0x67f8('0x41')](function(_0x5a63b9){logger[_0x67f8('0x26')](_0x67f8('0x4e'),_0x5a63b9);throw _0x5a63b9;});}return _0x75989e;})[_0x67f8('0x23')](respondWithResult(_0x52c925,0xc9))[_0x67f8('0x41')](handleError(_0x52c925,null));};exports[_0x67f8('0x22')]=function(_0xd4251,_0x38ed8b){if(_0xd4251[_0x67f8('0x46')]['id']){delete _0xd4251[_0x67f8('0x46')]['id'];}return db[_0x67f8('0x3c')][_0x67f8('0x4f')]({'where':{'id':_0xd4251[_0x67f8('0x43')]['id']}})[_0x67f8('0x23')](handleEntityNotFound(_0x38ed8b,null))[_0x67f8('0x23')](saveUpdates(_0xd4251[_0x67f8('0x46')],null))[_0x67f8('0x23')](respondWithResult(_0x38ed8b,null))[_0x67f8('0x41')](handleError(_0x38ed8b,null));};exports[_0x67f8('0x24')]=function(_0x481987,_0x227e47){return db[_0x67f8('0x3c')]['find']({'where':{'id':_0x481987['params']['id']}})[_0x67f8('0x23')](handleEntityNotFound(_0x227e47,null))[_0x67f8('0x23')](removeEntity(_0x227e47,null))[_0x67f8('0x41')](handleError(_0x227e47,null));}; \ No newline at end of file +var _0xbd54=['nolimit','sort','where','pick','filter','merge','options','rows','catch','params','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0xe5495f,_0x36e9af){var _0x584c6e=function(_0x4c1cb7){while(--_0x4c1cb7){_0xe5495f['push'](_0xe5495f['shift']());}};_0x584c6e(++_0x36e9af);}(_0xbd54,0x67));var _0x4bd5=function(_0x44a59b,_0x18f8a5){_0x44a59b=_0x44a59b-0x0;var _0x5382c5=_0xbd54[_0x44a59b];return _0x5382c5;};'use strict';var emlformat=require(_0x4bd5('0x0'));var rimraf=require(_0x4bd5('0x1'));var zipdir=require(_0x4bd5('0x2'));var jsonpatch=require(_0x4bd5('0x3'));var rp=require(_0x4bd5('0x4'));var moment=require(_0x4bd5('0x5'));var BPromise=require(_0x4bd5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4bd5('0x7'));var sox=require(_0x4bd5('0x8'));var csv=require(_0x4bd5('0x9'));var ejs=require(_0x4bd5('0xa'));var fs=require('fs');var fs_extra=require(_0x4bd5('0xb'));var _=require(_0x4bd5('0xc'));var squel=require(_0x4bd5('0xd'));var crypto=require(_0x4bd5('0xe'));var jsforce=require(_0x4bd5('0xf'));var deskjs=require(_0x4bd5('0x10'));var toCsv=require(_0x4bd5('0x9'));var querystring=require(_0x4bd5('0x11'));var Papa=require(_0x4bd5('0x12'));var Redis=require(_0x4bd5('0x13'));var authService=require(_0x4bd5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4bd5('0x15'));var hardwareService=require(_0x4bd5('0x16'));var logger=require(_0x4bd5('0x17'))(_0x4bd5('0x18'));var utils=require(_0x4bd5('0x19'));var config=require(_0x4bd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4bd5('0x1b'))['db'];function respondWithStatusCode(_0x9c7468,_0xecfc8){_0xecfc8=_0xecfc8||0xcc;return function(_0x4db062){if(_0x4db062){return _0x9c7468[_0x4bd5('0x1c')](_0xecfc8);}return _0x9c7468[_0x4bd5('0x1d')](_0xecfc8)[_0x4bd5('0x1e')]();};}function respondWithResult(_0x40d0dd,_0x43551f){_0x43551f=_0x43551f||0xc8;return function(_0x59364f){if(_0x59364f){return _0x40d0dd[_0x4bd5('0x1d')](_0x43551f)[_0x4bd5('0x1f')](_0x59364f);}};}function respondWithFilteredResult(_0x507d19,_0xce1797){return function(_0x3f234f){if(_0x3f234f){var _0x564bb7=typeof _0xce1797[_0x4bd5('0x20')]===_0x4bd5('0x21')&&typeof _0xce1797[_0x4bd5('0x22')]===_0x4bd5('0x21');var _0x45ff3c=_0x3f234f[_0x4bd5('0x23')];var _0x780db5=_0x564bb7?0x0:_0xce1797[_0x4bd5('0x20')];var _0x84f9a6=_0x564bb7?_0x3f234f['count']:_0xce1797[_0x4bd5('0x20')]+_0xce1797[_0x4bd5('0x22')];var _0x5f52d8;if(_0x84f9a6>=_0x45ff3c){_0x84f9a6=_0x45ff3c;_0x5f52d8=0xc8;}else{_0x5f52d8=0xce;}_0x507d19[_0x4bd5('0x1d')](_0x5f52d8);return _0x507d19[_0x4bd5('0x24')](_0x4bd5('0x25'),_0x780db5+'-'+_0x84f9a6+'/'+_0x45ff3c)[_0x4bd5('0x1f')](_0x3f234f);}return null;};}function patchUpdates(_0x2d925f){return function(_0xf1629){try{jsonpatch[_0x4bd5('0x26')](_0xf1629,_0x2d925f,!![]);}catch(_0x3b2907){return BPromise[_0x4bd5('0x27')](_0x3b2907);}return _0xf1629[_0x4bd5('0x28')]();};}function saveUpdates(_0x412eb2,_0x13d17d){return function(_0x5972d3){if(_0x5972d3){return _0x5972d3[_0x4bd5('0x29')](_0x412eb2)[_0x4bd5('0x2a')](function(_0x2c245b){return _0x2c245b;});}return null;};}function removeEntity(_0x3bbf1e,_0x4bd602){return function(_0x211d72){if(_0x211d72){return _0x211d72[_0x4bd5('0x2b')]()[_0x4bd5('0x2a')](function(){var _0x4f344d=_0x211d72[_0x4bd5('0x2c')]({'plain':!![]});var _0x55556c=_0x4bd5('0x2d');return db[_0x4bd5('0x2e')][_0x4bd5('0x2b')]({'where':{'type':_0x55556c,'resourceId':_0x4f344d['id']}})[_0x4bd5('0x2a')](function(){return _0x211d72;});})[_0x4bd5('0x2a')](function(){_0x3bbf1e[_0x4bd5('0x1d')](0xcc)[_0x4bd5('0x1e')]();});}};}function handleEntityNotFound(_0x35bb1f,_0x53c7b5){return function(_0x2daf10){if(!_0x2daf10){_0x35bb1f[_0x4bd5('0x1c')](0x194);}return _0x2daf10;};}function handleError(_0x252b87,_0x7d4441){_0x7d4441=_0x7d4441||0x1f4;return function(_0x427639){logger[_0x4bd5('0x2f')](_0x427639['stack']);if(_0x427639[_0x4bd5('0x30')]){delete _0x427639['name'];}_0x252b87['status'](_0x7d4441)[_0x4bd5('0x31')](_0x427639);};}exports[_0x4bd5('0x32')]=function(_0xbac5ac,_0x372c04){var _0x12723a={},_0x573bc0={},_0x29a913={'count':0x0,'rows':[]};var _0x1c4b6f=_[_0x4bd5('0x33')](db[_0x4bd5('0x34')][_0x4bd5('0x35')],function(_0x198e0f){return{'name':_0x198e0f[_0x4bd5('0x36')],'type':_0x198e0f[_0x4bd5('0x37')][_0x4bd5('0x38')]};});_0x573bc0[_0x4bd5('0x39')]=_[_0x4bd5('0x33')](_0x1c4b6f,_0x4bd5('0x30'));_0x573bc0[_0x4bd5('0x3a')]=_[_0x4bd5('0x3b')](_0xbac5ac[_0x4bd5('0x3a')]);_0x573bc0[_0x4bd5('0x3c')]=_['intersection'](_0x573bc0[_0x4bd5('0x39')],_0x573bc0['query']);_0x12723a[_0x4bd5('0x3d')]=_[_0x4bd5('0x3e')](_0x573bc0[_0x4bd5('0x39')],qs[_0x4bd5('0x3f')](_0xbac5ac[_0x4bd5('0x3a')][_0x4bd5('0x3f')]));_0x12723a[_0x4bd5('0x3d')]=_0x12723a[_0x4bd5('0x3d')]['length']?_0x12723a[_0x4bd5('0x3d')]:_0x573bc0[_0x4bd5('0x39')];if(!_0xbac5ac[_0x4bd5('0x3a')][_0x4bd5('0x40')](_0x4bd5('0x41'))){_0x12723a[_0x4bd5('0x22')]=qs[_0x4bd5('0x22')](_0xbac5ac['query'][_0x4bd5('0x22')]);_0x12723a[_0x4bd5('0x20')]=qs['offset'](_0xbac5ac[_0x4bd5('0x3a')]['offset']);}_0x12723a['order']=qs['sort'](_0xbac5ac['query'][_0x4bd5('0x42')]);_0x12723a[_0x4bd5('0x43')]=qs[_0x4bd5('0x3c')](_[_0x4bd5('0x44')](_0xbac5ac[_0x4bd5('0x3a')],_0x573bc0['filters']),_0x1c4b6f);if(_0xbac5ac[_0x4bd5('0x3a')][_0x4bd5('0x45')]){_0x12723a[_0x4bd5('0x43')]=_[_0x4bd5('0x46')](_0x12723a['where'],{'$or':_[_0x4bd5('0x33')](_0x1c4b6f,function(_0xe3855d){if(_0xe3855d[_0x4bd5('0x37')]!=='VIRTUAL'){var _0x1691a0={};_0x1691a0[_0xe3855d[_0x4bd5('0x30')]]={'$like':'%'+_0xbac5ac['query']['filter']+'%'};return _0x1691a0;}})});}_0x12723a=_[_0x4bd5('0x46')]({},_0x12723a,_0xbac5ac[_0x4bd5('0x47')]);var _0x6a3266={'where':_0x12723a[_0x4bd5('0x43')]};return db[_0x4bd5('0x34')][_0x4bd5('0x23')](_0x6a3266)[_0x4bd5('0x2a')](function(_0x1d97e6){_0x29a913[_0x4bd5('0x23')]=_0x1d97e6;if(_0xbac5ac['query']['includeAll']){_0x12723a['include']=[{'all':!![]}];}return db[_0x4bd5('0x34')]['findAll'](_0x12723a);})[_0x4bd5('0x2a')](function(_0x395d60){_0x29a913[_0x4bd5('0x48')]=_0x395d60;return _0x29a913;})[_0x4bd5('0x2a')](respondWithFilteredResult(_0x372c04,_0x12723a))[_0x4bd5('0x49')](handleError(_0x372c04,null));};exports['show']=function(_0x49d0ec,_0x5934ff){var _0x50988e={'raw':!![],'where':{'id':_0x49d0ec[_0x4bd5('0x4a')]['id']}},_0x1a332f={};_0x1a332f[_0x4bd5('0x39')]=_[_0x4bd5('0x3b')](db[_0x4bd5('0x34')][_0x4bd5('0x35')]);_0x1a332f[_0x4bd5('0x3a')]=_[_0x4bd5('0x3b')](_0x49d0ec[_0x4bd5('0x3a')]);_0x1a332f[_0x4bd5('0x3c')]=_[_0x4bd5('0x3e')](_0x1a332f[_0x4bd5('0x39')],_0x1a332f[_0x4bd5('0x3a')]);_0x50988e[_0x4bd5('0x3d')]=_['intersection'](_0x1a332f[_0x4bd5('0x39')],qs[_0x4bd5('0x3f')](_0x49d0ec[_0x4bd5('0x3a')][_0x4bd5('0x3f')]));_0x50988e[_0x4bd5('0x3d')]=_0x50988e[_0x4bd5('0x3d')][_0x4bd5('0x4b')]?_0x50988e['attributes']:_0x1a332f['model'];if(_0x49d0ec[_0x4bd5('0x3a')]['includeAll']){_0x50988e[_0x4bd5('0x4c')]=[{'all':!![]}];}_0x50988e=_[_0x4bd5('0x46')]({},_0x50988e,_0x49d0ec['options']);return db['Disposition'][_0x4bd5('0x4d')](_0x50988e)[_0x4bd5('0x2a')](handleEntityNotFound(_0x5934ff,null))['then'](respondWithResult(_0x5934ff,null))['catch'](handleError(_0x5934ff,null));};exports[_0x4bd5('0x4e')]=function(_0x46a80c,_0x3dfb04){return db[_0x4bd5('0x34')]['create'](_0x46a80c[_0x4bd5('0x4f')],{})['then'](function(_0x221501){var _0x1aeef4=_0x46a80c['user'][_0x4bd5('0x2c')]({'plain':!![]});if(!_0x1aeef4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aeef4['role']===_0x4bd5('0x50')){var _0x2c5e86=_0x221501[_0x4bd5('0x2c')]({'plain':!![]});var _0x5903a6=_0x4bd5('0x2d');return db[_0x4bd5('0x51')][_0x4bd5('0x4d')]({'where':{'name':_0x5903a6,'userProfileId':_0x1aeef4[_0x4bd5('0x52')]},'raw':!![]})[_0x4bd5('0x2a')](function(_0x514c8a){if(_0x514c8a&&_0x514c8a[_0x4bd5('0x53')]===0x0){return db[_0x4bd5('0x2e')][_0x4bd5('0x4e')]({'name':_0x2c5e86[_0x4bd5('0x30')],'resourceId':_0x2c5e86['id'],'type':_0x514c8a[_0x4bd5('0x30')],'sectionId':_0x514c8a['id']},{})[_0x4bd5('0x2a')](function(){return _0x221501;});}else{return _0x221501;}})[_0x4bd5('0x49')](function(_0x28e01c){logger[_0x4bd5('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28e01c);throw _0x28e01c;});}return _0x221501;})[_0x4bd5('0x2a')](respondWithResult(_0x3dfb04,0xc9))[_0x4bd5('0x49')](handleError(_0x3dfb04,null));};exports['update']=function(_0x2dab02,_0x567188){if(_0x2dab02[_0x4bd5('0x4f')]['id']){delete _0x2dab02[_0x4bd5('0x4f')]['id'];}return db[_0x4bd5('0x34')]['find']({'where':{'id':_0x2dab02['params']['id']}})[_0x4bd5('0x2a')](handleEntityNotFound(_0x567188,null))[_0x4bd5('0x2a')](saveUpdates(_0x2dab02[_0x4bd5('0x4f')],null))[_0x4bd5('0x2a')](respondWithResult(_0x567188,null))[_0x4bd5('0x49')](handleError(_0x567188,null));};exports[_0x4bd5('0x2b')]=function(_0x3e469f,_0x100663){return db[_0x4bd5('0x34')][_0x4bd5('0x4d')]({'where':{'id':_0x3e469f[_0x4bd5('0x4a')]['id']}})[_0x4bd5('0x2a')](handleEntityNotFound(_0x100663,null))[_0x4bd5('0x2a')](removeEntity(_0x100663,null))['catch'](handleError(_0x100663,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f77d045..0f8f39d 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 _0x4c36=['WhatsappAccountId','lodash','util','api','moment','bluebird','../../config/environment','./disposition.attributes','exports','define','name_voice','ListId','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x5e8e66,_0x190c0d){var _0x555d57=function(_0x593a8d){while(--_0x593a8d){_0x5e8e66['push'](_0x5e8e66['shift']());}};_0x555d57(++_0x190c0d);}(_0x4c36,0x190));var _0x64c3=function(_0x2a6596,_0x3e2807){_0x2a6596=_0x2a6596-0x0;var _0x5ef636=_0x4c36[_0x2a6596];return _0x5ef636;};'use strict';var _=require(_0x64c3('0x0'));var util=require(_0x64c3('0x1'));var logger=require('../../config/logger')(_0x64c3('0x2'));var moment=require(_0x64c3('0x3'));var BPromise=require(_0x64c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64c3('0x5'));var attributes=require(_0x64c3('0x6'));module[_0x64c3('0x7')]=function(_0x204f3a,_0x209198){return _0x204f3a[_0x64c3('0x8')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x64c3('0x9'),'fields':['name',_0x64c3('0xa')]},{'unique':!![],'name':_0x64c3('0xb'),'fields':[_0x64c3('0xc'),_0x64c3('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x64c3('0xc'),_0x64c3('0xe')]},{'unique':!![],'name':_0x64c3('0xf'),'fields':[_0x64c3('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x64c3('0xc'),_0x64c3('0x10')]},{'unique':!![],'name':_0x64c3('0x11'),'fields':[_0x64c3('0xc'),_0x64c3('0x12')]},{'unique':!![],'name':_0x64c3('0x13'),'fields':[_0x64c3('0xc'),_0x64c3('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ae8=['util','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x23f58d,_0x22b11c){var _0x515d10=function(_0x18fe4a){while(--_0x18fe4a){_0x23f58d['push'](_0x23f58d['shift']());}};_0x515d10(++_0x22b11c);}(_0x7ae8,0x142));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x87ae('0x0'));var logger=require('../../config/logger')(_0x87ae('0x1'));var moment=require(_0x87ae('0x2'));var BPromise=require(_0x87ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87ae('0x4'));var rimraf=require(_0x87ae('0x5'));var config=require(_0x87ae('0x6'));var attributes=require(_0x87ae('0x7'));module[_0x87ae('0x8')]=function(_0x1930fa,_0x1c3d83){return _0x1930fa[_0x87ae('0x9')](_0x87ae('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x87ae('0xb'),'fields':['name',_0x87ae('0xc')]},{'unique':!![],'name':_0x87ae('0xd'),'fields':[_0x87ae('0xe'),_0x87ae('0xf')]},{'unique':!![],'name':_0x87ae('0x10'),'fields':['name',_0x87ae('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x87ae('0xe'),_0x87ae('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x87ae('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x87ae('0x13'),'fields':[_0x87ae('0xe'),_0x87ae('0x14')]},{'unique':!![],'name':_0x87ae('0x15'),'fields':[_0x87ae('0xe'),_0x87ae('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 21bae47..1ef2772 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(_0x371a7b,_0xdb8bac){var _0x30265f=function(_0x463b4e){while(--_0x463b4e){_0x371a7b['push'](_0x371a7b['shift']());}};_0x30265f(++_0xdb8bac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x5bdaef,_0x40e16c){var _0x143171=function(_0x16b13f){while(--_0x16b13f){_0x5bdaef['push'](_0x5bdaef['shift']());}};_0x143171(++_0x40e16c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 2b05d45..6223a02 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 _0x6662=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x56bce4,_0x176888){var _0x4eca32=function(_0x54cae9){while(--_0x54cae9){_0x56bce4['push'](_0x56bce4['shift']());}};_0x4eca32(++_0x176888);}(_0x6662,0xec));var _0x2666=function(_0x561098,_0xdd1933){_0x561098=_0x561098-0x0;var _0x42701a=_0x6662[_0x561098];return _0x42701a;};'use strict';var multer=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var path=require(_0x2666('0x2'));var timeout=require(_0x2666('0x3'));var express=require('express');var router=express[_0x2666('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2666('0x5'));var interaction=require(_0x2666('0x6'));var config=require(_0x2666('0x7'));var controller=require(_0x2666('0x8'));router[_0x2666('0x9')]('/',auth[_0x2666('0xa')](),controller['index']);router[_0x2666('0x9')](_0x2666('0xb'),auth['isAuthenticated'](),controller[_0x2666('0xc')]);router[_0x2666('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2666('0xe')](_0x2666('0xb'),auth['isAuthenticated'](),controller[_0x2666('0xf')]);router[_0x2666('0x10')](_0x2666('0xb'),auth[_0x2666('0xa')](),controller[_0x2666('0x11')]);module[_0x2666('0x12')]=router; \ No newline at end of file +var _0xe06e=['/:id','isAuthenticated','post','create','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller'];(function(_0x26229f,_0x1efcff){var _0xbc198c=function(_0xd4b910){while(--_0xd4b910){_0x26229f['push'](_0x26229f['shift']());}};_0xbc198c(++_0x1efcff);}(_0xe06e,0x132));var _0xee06=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xe06e[_0x277107];return _0x1da046;};'use strict';var multer=require(_0xee06('0x0'));var util=require(_0xee06('0x1'));var path=require(_0xee06('0x2'));var timeout=require('connect-timeout');var express=require(_0xee06('0x3'));var router=express[_0xee06('0x4')]();var fs_extra=require(_0xee06('0x5'));var auth=require(_0xee06('0x6'));var interaction=require(_0xee06('0x7'));var config=require('../../config/environment');var controller=require(_0xee06('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xee06('0x9'),auth[_0xee06('0xa')](),controller['show']);router[_0xee06('0xb')]('/',auth['isAuthenticated'](),controller[_0xee06('0xc')]);router['put'](_0xee06('0x9'),auth[_0xee06('0xa')](),controller[_0xee06('0xd')]);router['delete'](_0xee06('0x9'),auth[_0xee06('0xa')](),controller['destroy']);module[_0xee06('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 4d6bc71..4e088fb 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 _0xf9d5=['xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','14400','4800','12000','v17,v27,v29','SIP','IAX','DADHI','TEXT','BOOLEAN','INTEGER','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes'];(function(_0x2ffbde,_0x2f07af){var _0x2cdf1c=function(_0x387853){while(--_0x387853){_0x2ffbde['push'](_0x2ffbde['shift']());}};_0x2cdf1c(++_0x2f07af);}(_0xf9d5,0x122));var _0x5f9d=function(_0x39f4e1,_0x23fcdf){_0x39f4e1=_0x39f4e1-0x0;var _0x2f74d9=_0xf9d5[_0x39f4e1];return _0x2f74d9;};'use strict';var Sequelize=require('sequelize');module[_0x5f9d('0x0')]={'name':{'type':Sequelize[_0x5f9d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5f9d('0x2')](_0x5f9d('0x3'),'no'),'defaultValue':_0x5f9d('0x3')},'headerinfo':{'type':Sequelize[_0x5f9d('0x1')],'defaultValue':_0x5f9d('0x4')},'localstationid':{'type':Sequelize[_0x5f9d('0x1')],'unique':_0x5f9d('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x5f9d('0x6'),'4800',_0x5f9d('0x7'),_0x5f9d('0x8'),'12000',_0x5f9d('0x9')),'defaultValue':_0x5f9d('0xa')},'maxrate':{'type':Sequelize[_0x5f9d('0x2')](_0x5f9d('0x6'),_0x5f9d('0xa'),_0x5f9d('0x7'),'9600',_0x5f9d('0xb'),_0x5f9d('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5f9d('0xc')},'gateway':{'type':Sequelize[_0x5f9d('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5f9d('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5f9d('0x2')](_0x5f9d('0xd'),_0x5f9d('0xe'),_0x5f9d('0xf'),'KHOMP'),'defaultValue':_0x5f9d('0xd')},'key':{'type':Sequelize[_0x5f9d('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5f9d('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5f9d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f9d('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f9d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f9d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5f9d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f9d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5f9d('0x12')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d8370){if(!_0x3d8370)this['setDataValue'](_0x5f9d('0x13'),null);this['setDataValue'](_0x5f9d('0x14'),_0x3d8370);}}}; \ No newline at end of file +var _0xa1f6=['SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','2400','4800','7200','9600','12000','14400','v17,v27,v29'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0xa1f6[_0x151334];return _0x3d03da;};'use strict';var Sequelize=require(_0x6a1f('0x0'));module[_0x6a1f('0x1')]={'name':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6a1f('0x2')]},'ecm':{'type':Sequelize[_0x6a1f('0x3')](_0x6a1f('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x6a1f('0x3')](_0x6a1f('0x5'),_0x6a1f('0x6'),_0x6a1f('0x7'),_0x6a1f('0x8'),_0x6a1f('0x9'),_0x6a1f('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x6a1f('0x3')](_0x6a1f('0x5'),_0x6a1f('0x6'),_0x6a1f('0x7'),_0x6a1f('0x8'),'12000',_0x6a1f('0xa')),'defaultValue':_0x6a1f('0xa')},'modem':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':_0x6a1f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6a1f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6a1f('0x3')](_0x6a1f('0xc'),_0x6a1f('0xd'),_0x6a1f('0xe'),_0x6a1f('0xf')),'defaultValue':_0x6a1f('0xc')},'key':{'type':Sequelize[_0x6a1f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6a1f('0x10')],'defaultValue':function(){return _0x6a1f('0x11');}},'notificationSound':{'type':Sequelize[_0x6a1f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6a1f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6a1f('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6a1f('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6a1f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6a1f('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6a1f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6a1f('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6a1f('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x6a1f('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6a1f('0x15'),'set':function(_0x45e6f0){if(!_0x45e6f0)this[_0x6a1f('0x16')](_0x6a1f('0x17'),null);this[_0x6a1f('0x16')](_0x6a1f('0x18'),_0x45e6f0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 03599fd..7f825da 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 _0x598c=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','http','client','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','destroy','describe','FaxAccountId','Disposition','getDispositions','options','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','ecm','gateway','faxdetect','headerinfo','minrate','modem','FAXOPT(','Set','VoiceExtension','updateAccountApplications','transaction','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch'];(function(_0x3537fd,_0x385a59){var _0x3fef0c=function(_0x43d9db){while(--_0x43d9db){_0x3537fd['push'](_0x3537fd['shift']());}};_0x3fef0c(++_0x385a59);}(_0x598c,0xc2));var _0xc598=function(_0xa4407a,_0xe93d90){_0xa4407a=_0xa4407a-0x0;var _0x51c628=_0x598c[_0xa4407a];return _0x51c628;};'use strict';var emlformat=require(_0xc598('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc598('0x1'));var jsonpatch=require(_0xc598('0x2'));var rp=require(_0xc598('0x3'));var moment=require(_0xc598('0x4'));var BPromise=require(_0xc598('0x5'));var Mustache=require(_0xc598('0x6'));var util=require(_0xc598('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc598('0x8'));var ejs=require(_0xc598('0x9'));var fs=require('fs');var fs_extra=require(_0xc598('0xa'));var _=require(_0xc598('0xb'));var squel=require('squel');var crypto=require(_0xc598('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc598('0xd'));var toCsv=require(_0xc598('0x8'));var querystring=require(_0xc598('0xe'));var Papa=require(_0xc598('0xf'));var Redis=require(_0xc598('0x10'));var authService=require(_0xc598('0x11'));var qs=require(_0xc598('0x12'));var as=require(_0xc598('0x13'));var hardwareService=require(_0xc598('0x14'));var logger=require(_0xc598('0x15'))(_0xc598('0x16'));var utils=require(_0xc598('0x17'));var config=require(_0xc598('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc598('0x19'))['db'];config[_0xc598('0x1a')]=_[_0xc598('0x1b')](config['redis'],{'host':_0xc598('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc598('0x1a')]));require(_0xc598('0x1d'))['register'](socket);var jayson=require(_0xc598('0x1e'));var client=jayson['client'][_0xc598('0x1f')]({'port':0x232c});var client9002=jayson[_0xc598('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ebaf0,_0x12c910,_0x5cf589,_0x26da17){return new BPromise(function(_0x344d40,_0x4b3a1e){var _0x564aef=_0x26da17||client;return _0x564aef['request'](_0x1ebaf0,_0x5cf589)[_0xc598('0x21')](function(_0x4e3368){logger['info']('FaxAccount,\x20%s,\x20%s',_0x12c910,_0xc598('0x22'));logger[_0xc598('0x23')](_0xc598('0x24'),_0x12c910,_0xc598('0x22'),JSON[_0xc598('0x25')](_0x4e3368));if(_0x4e3368['error']){if(_0x4e3368['error']['code']===0x1f4){logger[_0xc598('0x26')](_0xc598('0x27'),_0x12c910,_0x4e3368[_0xc598('0x26')][_0xc598('0x28')]);return _0x4b3a1e(_0x4e3368[_0xc598('0x26')][_0xc598('0x28')]);}logger['error'](_0xc598('0x27'),_0x12c910,_0x4e3368[_0xc598('0x26')][_0xc598('0x28')]);return _0x344d40(_0x4e3368['error'][_0xc598('0x28')]);}else{logger[_0xc598('0x29')](_0xc598('0x27'),_0x12c910,_0xc598('0x22'));_0x344d40(_0x4e3368[_0xc598('0x2a')]['message']);}})[_0xc598('0x2b')](function(_0x51dbbc){logger[_0xc598('0x26')](_0xc598('0x27'),_0x12c910,_0x51dbbc);_0x4b3a1e(_0x51dbbc);});});}function respondWithStatusCode(_0x93e4ea,_0x51221a){_0x51221a=_0x51221a||0xcc;return function(_0x62b72f){if(_0x62b72f){return _0x93e4ea[_0xc598('0x2c')](_0x51221a);}return _0x93e4ea[_0xc598('0x2d')](_0x51221a)[_0xc598('0x2e')]();};}function respondWithResult(_0xe10e60,_0x191844){_0x191844=_0x191844||0xc8;return function(_0x3a1b3e){if(_0x3a1b3e){return _0xe10e60['status'](_0x191844)[_0xc598('0x2f')](_0x3a1b3e);}};}function respondWithFilteredResult(_0x358564,_0x391d4a){return function(_0x286415){if(_0x286415){var _0x426984=typeof _0x391d4a[_0xc598('0x30')]===_0xc598('0x31')&&typeof _0x391d4a[_0xc598('0x32')]===_0xc598('0x31');var _0x4b30ac=_0x286415[_0xc598('0x33')];var _0x2409cc=_0x426984?0x0:_0x391d4a[_0xc598('0x30')];var _0x1be3d3=_0x426984?_0x286415['count']:_0x391d4a[_0xc598('0x30')]+_0x391d4a[_0xc598('0x32')];var _0x45a1bc;if(_0x1be3d3>=_0x4b30ac){_0x1be3d3=_0x4b30ac;_0x45a1bc=0xc8;}else{_0x45a1bc=0xce;}_0x358564['status'](_0x45a1bc);return _0x358564[_0xc598('0x34')](_0xc598('0x35'),_0x2409cc+'-'+_0x1be3d3+'/'+_0x4b30ac)['json'](_0x286415);}return null;};}function patchUpdates(_0x4542bc){return function(_0xf3896e){try{jsonpatch[_0xc598('0x36')](_0xf3896e,_0x4542bc,!![]);}catch(_0x4ec896){return BPromise[_0xc598('0x37')](_0x4ec896);}return _0xf3896e[_0xc598('0x38')]();};}function saveUpdates(_0x5c8cb9,_0x1507bc){return function(_0x55a85f){if(_0x55a85f){return _0x55a85f[_0xc598('0x39')](_0x5c8cb9)[_0xc598('0x21')](function(_0x483e95){return _0x483e95;});}return null;};}function removeEntity(_0x1ffa13,_0xf2275e){return function(_0x5ef92d){if(_0x5ef92d){return _0x5ef92d['destroy']()['then'](function(){var _0x3a1d37=_0x5ef92d[_0xc598('0x3a')]({'plain':!![]});var _0x1876ee=_0xc598('0x3b');return db[_0xc598('0x3c')]['destroy']({'where':{'type':_0x1876ee,'resourceId':_0x3a1d37['id']}})[_0xc598('0x21')](function(){return _0x5ef92d;});})[_0xc598('0x21')](function(){_0x1ffa13[_0xc598('0x2d')](0xcc)[_0xc598('0x2e')]();});}};}function handleEntityNotFound(_0x4e7374,_0x18ddcd){return function(_0x3cbe41){if(!_0x3cbe41){_0x4e7374[_0xc598('0x2c')](0x194);}return _0x3cbe41;};}function handleError(_0x2a58db,_0x1137c0){_0x1137c0=_0x1137c0||0x1f4;return function(_0x51ff61){logger[_0xc598('0x26')](_0x51ff61[_0xc598('0x3d')]);if(_0x51ff61[_0xc598('0x3e')]){delete _0x51ff61[_0xc598('0x3e')];}_0x2a58db[_0xc598('0x2d')](_0x1137c0)[_0xc598('0x3f')](_0x51ff61);};}exports[_0xc598('0x40')]=function(_0x4f9961,_0x483bb0){var _0xce8159={'include':[{'model':db[_0xc598('0x41')],'as':_0xc598('0x42')}]},_0x1ee07f={},_0x5481fa={'count':0x0,'rows':[]};var _0x559b9b=_[_0xc598('0x43')](db[_0xc598('0x44')][_0xc598('0x45')],function(_0x4f5d4a){return{'name':_0x4f5d4a[_0xc598('0x46')],'type':_0x4f5d4a[_0xc598('0x47')]['key']};});_0x1ee07f[_0xc598('0x48')]=_[_0xc598('0x43')](_0x559b9b,_0xc598('0x3e'));_0x1ee07f[_0xc598('0x49')]=_[_0xc598('0x4a')](_0x4f9961['query']);_0x1ee07f[_0xc598('0x4b')]=_[_0xc598('0x4c')](_0x1ee07f[_0xc598('0x48')],_0x1ee07f['query']);_0xce8159[_0xc598('0x4d')]=_[_0xc598('0x4c')](_0x1ee07f[_0xc598('0x48')],qs[_0xc598('0x4e')](_0x4f9961[_0xc598('0x49')][_0xc598('0x4e')]));_0xce8159[_0xc598('0x4d')]=_0xce8159[_0xc598('0x4d')][_0xc598('0x4f')]?_0xce8159[_0xc598('0x4d')]:_0x1ee07f['model'];if(!_0x4f9961[_0xc598('0x49')][_0xc598('0x50')](_0xc598('0x51'))){_0xce8159[_0xc598('0x32')]=qs['limit'](_0x4f9961['query'][_0xc598('0x32')]);_0xce8159[_0xc598('0x30')]=qs['offset'](_0x4f9961[_0xc598('0x49')][_0xc598('0x30')]);}_0xce8159[_0xc598('0x52')]=qs[_0xc598('0x53')](_0x4f9961[_0xc598('0x49')][_0xc598('0x53')]);_0xce8159['where']=qs[_0xc598('0x4b')](_[_0xc598('0x54')](_0x4f9961['query'],_0x1ee07f[_0xc598('0x4b')]),_0x559b9b);if(_0x4f9961[_0xc598('0x49')][_0xc598('0x55')]){_0xce8159[_0xc598('0x56')]=_[_0xc598('0x57')](_0xce8159[_0xc598('0x56')],{'$or':_[_0xc598('0x43')](_0x559b9b,function(_0x5d8d09){if(_0x5d8d09[_0xc598('0x47')]!==_0xc598('0x58')){var _0x36c8e8={};_0x36c8e8[_0x5d8d09[_0xc598('0x3e')]]={'$like':'%'+_0x4f9961[_0xc598('0x49')][_0xc598('0x55')]+'%'};return _0x36c8e8;}})});}_0xce8159=_[_0xc598('0x57')]({},_0xce8159,_0x4f9961['options']);var _0x4295a3={'where':_0xce8159['where']};return db[_0xc598('0x44')][_0xc598('0x33')](_0x4295a3)[_0xc598('0x21')](function(_0x7c58a6){_0x5481fa[_0xc598('0x33')]=_0x7c58a6;if(_0x4f9961[_0xc598('0x49')][_0xc598('0x59')]){_0xce8159['include']=[{'all':!![]}];}return db[_0xc598('0x44')]['findAll'](_0xce8159);})[_0xc598('0x21')](function(_0x544343){_0x5481fa[_0xc598('0x5a')]=_0x544343;return _0x5481fa;})[_0xc598('0x21')](respondWithFilteredResult(_0x483bb0,_0xce8159))['catch'](handleError(_0x483bb0,null));};exports[_0xc598('0x5b')]=function(_0xafef07,_0x5270da){var _0x5a972d={'raw':![],'where':{'id':_0xafef07[_0xc598('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xc598('0x42')}]},_0x266449={};_0x266449[_0xc598('0x48')]=_[_0xc598('0x4a')](db[_0xc598('0x44')]['rawAttributes']);_0x266449[_0xc598('0x49')]=_[_0xc598('0x4a')](_0xafef07[_0xc598('0x49')]);_0x266449[_0xc598('0x4b')]=_[_0xc598('0x4c')](_0x266449[_0xc598('0x48')],_0x266449[_0xc598('0x49')]);_0x5a972d[_0xc598('0x4d')]=_[_0xc598('0x4c')](_0x266449[_0xc598('0x48')],qs[_0xc598('0x4e')](_0xafef07[_0xc598('0x49')][_0xc598('0x4e')]));_0x5a972d['attributes']=_0x5a972d[_0xc598('0x4d')][_0xc598('0x4f')]?_0x5a972d[_0xc598('0x4d')]:_0x266449[_0xc598('0x48')];if(_0xafef07[_0xc598('0x49')][_0xc598('0x59')]){_0x5a972d[_0xc598('0x5d')]=[{'all':!![]}];}_0x5a972d=_[_0xc598('0x57')]({},_0x5a972d,_0xafef07['options']);return db['FaxAccount']['find'](_0x5a972d)[_0xc598('0x21')](handleEntityNotFound(_0x5270da,null))[_0xc598('0x21')](respondWithResult(_0x5270da,null))['catch'](handleError(_0x5270da,null));};exports[_0xc598('0x5e')]=function(_0x5f2771,_0x56c2ee){return db['FaxAccount'][_0xc598('0x5e')](_0x5f2771[_0xc598('0x5f')],{})[_0xc598('0x21')](function(_0x1e9926){var _0x3cbf26=_0x5f2771[_0xc598('0x60')][_0xc598('0x3a')]({'plain':!![]});if(!_0x3cbf26)throw new Error(_0xc598('0x61'));if(_0x3cbf26[_0xc598('0x62')]==='user'){var _0x4ca078=_0x1e9926[_0xc598('0x3a')]({'plain':!![]});var _0x44d299=_0xc598('0x3b');return db['UserProfileSection'][_0xc598('0x63')]({'where':{'name':_0x44d299,'userProfileId':_0x3cbf26[_0xc598('0x64')]},'raw':!![]})['then'](function(_0x148f12){if(_0x148f12&&_0x148f12['autoAssociation']===0x0){return db[_0xc598('0x3c')][_0xc598('0x5e')]({'name':_0x4ca078[_0xc598('0x3e')],'resourceId':_0x4ca078['id'],'type':_0x148f12[_0xc598('0x3e')],'sectionId':_0x148f12['id']},{})[_0xc598('0x21')](function(){return _0x1e9926;});}else{return _0x1e9926;}})['catch'](function(_0x106f9e){logger[_0xc598('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x106f9e);throw _0x106f9e;});}return _0x1e9926;})[_0xc598('0x21')](respondWithResult(_0x56c2ee,0xc9))[_0xc598('0x2b')](handleError(_0x56c2ee,null));};exports['update']=function(_0x34b793,_0x17af25){if(_0x34b793['body']['id']){delete _0x34b793[_0xc598('0x5f')]['id'];}return db[_0xc598('0x44')][_0xc598('0x63')]({'where':{'id':_0x34b793[_0xc598('0x5c')]['id']},'include':[{'model':db[_0xc598('0x41')],'as':_0xc598('0x42')}]})['then'](handleEntityNotFound(_0x17af25,null))[_0xc598('0x21')](saveUpdates(_0x34b793[_0xc598('0x5f')],null))[_0xc598('0x21')](respondWithResult(_0x17af25,null))['catch'](handleError(_0x17af25,null));};exports[_0xc598('0x65')]=function(_0x26f336,_0x4ba456){return db[_0xc598('0x44')]['find']({'where':{'id':_0x26f336[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x4ba456,null))[_0xc598('0x21')](removeEntity(_0x4ba456,null))[_0xc598('0x2b')](handleError(_0x4ba456,null));};exports[_0xc598('0x66')]=function(_0x944371,_0x461706){return db[_0xc598('0x44')][_0xc598('0x66')]()['then'](respondWithResult(_0x461706,null))[_0xc598('0x2b')](handleError(_0x461706,null));};exports['addDisposition']=function(_0x40a747,_0x35a915,_0x4b66d5){if(_0x40a747[_0xc598('0x5f')]['id']){delete _0x40a747[_0xc598('0x5f')]['id'];}return db[_0xc598('0x44')]['find']({'where':{'id':_0x40a747[_0xc598('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35a915,null))[_0xc598('0x21')](function(_0x3f92eb){if(_0x3f92eb){_0x40a747[_0xc598('0x5f')][_0xc598('0x67')]=_0x3f92eb['id'];return db[_0xc598('0x68')]['create'](_0x40a747['body']);}})[_0xc598('0x21')](respondWithResult(_0x35a915,null))[_0xc598('0x2b')](handleError(_0x35a915,null));};exports[_0xc598('0x69')]=function(_0x21d18e,_0x4e18bb,_0x1978b8){var _0x1adcf6={'raw':![],'where':{}};var _0x172ef1={};var _0x23be66={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x21d18e[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x4e18bb,null))[_0xc598('0x21')](function(_0x52e95b){if(_0x52e95b){_0x172ef1[_0xc598('0x48')]=_[_0xc598('0x4a')](db['Disposition'][_0xc598('0x45')]);_0x172ef1[_0xc598('0x49')]=_['keys'](_0x21d18e[_0xc598('0x49')]);_0x172ef1[_0xc598('0x4b')]=_[_0xc598('0x4c')](_0x172ef1[_0xc598('0x48')],_0x172ef1[_0xc598('0x49')]);_0x1adcf6[_0xc598('0x4d')]=_['intersection'](_0x172ef1[_0xc598('0x48')],qs[_0xc598('0x4e')](_0x21d18e[_0xc598('0x49')][_0xc598('0x4e')]));_0x1adcf6[_0xc598('0x4d')]=_0x1adcf6[_0xc598('0x4d')][_0xc598('0x4f')]?_0x1adcf6['attributes']:_0x172ef1[_0xc598('0x48')];if(!_0x21d18e[_0xc598('0x49')][_0xc598('0x50')](_0xc598('0x51'))){_0x1adcf6[_0xc598('0x32')]=qs[_0xc598('0x32')](_0x21d18e[_0xc598('0x49')][_0xc598('0x32')]);_0x1adcf6[_0xc598('0x30')]=qs[_0xc598('0x30')](_0x21d18e[_0xc598('0x49')][_0xc598('0x30')]);}_0x1adcf6[_0xc598('0x52')]=qs['sort'](_0x21d18e[_0xc598('0x49')][_0xc598('0x53')]);_0x1adcf6[_0xc598('0x56')]=qs[_0xc598('0x4b')](_[_0xc598('0x54')](_0x21d18e[_0xc598('0x49')],_0x172ef1['filters']));_0x1adcf6[_0xc598('0x56')]['FaxAccountId']=_0x52e95b['id'];if(_0x21d18e['query'][_0xc598('0x55')]){_0x1adcf6[_0xc598('0x56')]=_[_0xc598('0x57')](_0x1adcf6[_0xc598('0x56')],{'$or':_[_0xc598('0x43')](_0x1adcf6[_0xc598('0x4d')],function(_0x5b2e9b){var _0x1d7526={};_0x1d7526[_0x5b2e9b]={'$like':'%'+_0x21d18e[_0xc598('0x49')][_0xc598('0x55')]+'%'};return _0x1d7526;})});}_0x1adcf6=_['merge']({},_0x1adcf6,_0x21d18e[_0xc598('0x6a')]);return db[_0xc598('0x68')][_0xc598('0x33')]({'where':_0x1adcf6[_0xc598('0x56')]})[_0xc598('0x21')](function(_0x401b19){_0x23be66[_0xc598('0x33')]=_0x401b19;if(_0x21d18e[_0xc598('0x49')][_0xc598('0x59')]){_0x1adcf6[_0xc598('0x5d')]=[{'all':!![]}];}return db[_0xc598('0x68')][_0xc598('0x6b')](_0x1adcf6);})['then'](function(_0x4eb0cd){_0x23be66[_0xc598('0x5a')]=_0x4eb0cd;return _0x23be66;});}})[_0xc598('0x21')](respondWithFilteredResult(_0x4e18bb,_0x1adcf6))[_0xc598('0x2b')](handleError(_0x4e18bb,null));};exports[_0xc598('0x6c')]=function(_0x1c4268,_0x2f405a,_0x26a354){return db['FaxAccount'][_0xc598('0x63')]({'where':{'id':_0x1c4268[_0xc598('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f405a,null))[_0xc598('0x21')](function(_0x5c42af){if(_0x5c42af){return _0x5c42af[_0xc598('0x6c')](_0x1c4268[_0xc598('0x49')][_0xc598('0x6d')]);}})[_0xc598('0x21')](respondWithStatusCode(_0x2f405a,null))[_0xc598('0x2b')](handleError(_0x2f405a,null));};exports[_0xc598('0x6e')]=function(_0x290533,_0x25d759,_0x51df57){if(_0x290533['body']['id']){delete _0x290533[_0xc598('0x5f')]['id'];}return db[_0xc598('0x44')][_0xc598('0x63')]({'where':{'id':_0x290533[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x25d759,null))['then'](function(_0x3661f9){if(_0x3661f9){_0x290533['body'][_0xc598('0x67')]=_0x3661f9['id'];return db['CannedAnswer'][_0xc598('0x5e')](_0x290533[_0xc598('0x5f')]);}})['then'](respondWithResult(_0x25d759,null))[_0xc598('0x2b')](handleError(_0x25d759,null));};exports[_0xc598('0x6f')]=function(_0x44d3bb,_0x1d320d,_0x1c7bec){var _0x48dcc8={'raw':![],'where':{}};var _0x4c4041={};var _0x3dec83={'count':0x0,'rows':[]};return db[_0xc598('0x44')][_0xc598('0x70')]({'where':{'id':_0x44d3bb['params']['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x1d320d,null))[_0xc598('0x21')](function(_0xe7a966){if(_0xe7a966){_0x4c4041['model']=_[_0xc598('0x4a')](db['CannedAnswer']['rawAttributes']);_0x4c4041[_0xc598('0x49')]=_[_0xc598('0x4a')](_0x44d3bb[_0xc598('0x49')]);_0x4c4041[_0xc598('0x4b')]=_[_0xc598('0x4c')](_0x4c4041['model'],_0x4c4041[_0xc598('0x49')]);_0x48dcc8[_0xc598('0x4d')]=_[_0xc598('0x4c')](_0x4c4041['model'],qs[_0xc598('0x4e')](_0x44d3bb['query'][_0xc598('0x4e')]));_0x48dcc8[_0xc598('0x4d')]=_0x48dcc8[_0xc598('0x4d')]['length']?_0x48dcc8[_0xc598('0x4d')]:_0x4c4041['model'];if(!_0x44d3bb[_0xc598('0x49')][_0xc598('0x50')](_0xc598('0x51'))){_0x48dcc8['limit']=qs[_0xc598('0x32')](_0x44d3bb[_0xc598('0x49')][_0xc598('0x32')]);_0x48dcc8['offset']=qs['offset'](_0x44d3bb[_0xc598('0x49')][_0xc598('0x30')]);}_0x48dcc8['order']=qs[_0xc598('0x53')](_0x44d3bb['query'][_0xc598('0x53')]);_0x48dcc8['where']=qs[_0xc598('0x4b')](_[_0xc598('0x54')](_0x44d3bb[_0xc598('0x49')],_0x4c4041[_0xc598('0x4b')]));_0x48dcc8['where']['FaxAccountId']=_0xe7a966['id'];if(_0x44d3bb['query'][_0xc598('0x55')]){_0x48dcc8[_0xc598('0x56')]=_['merge'](_0x48dcc8['where'],{'$or':_[_0xc598('0x43')](_0x48dcc8[_0xc598('0x4d')],function(_0xead124){var _0x2887aa={};_0x2887aa[_0xead124]={'$like':'%'+_0x44d3bb['query'][_0xc598('0x55')]+'%'};return _0x2887aa;})});}_0x48dcc8=_[_0xc598('0x57')]({},_0x48dcc8,_0x44d3bb['options']);return db['CannedAnswer']['count']({'where':_0x48dcc8['where']})[_0xc598('0x21')](function(_0x4ad609){_0x3dec83[_0xc598('0x33')]=_0x4ad609;if(_0x44d3bb[_0xc598('0x49')][_0xc598('0x59')]){_0x48dcc8[_0xc598('0x5d')]=[{'all':!![]}];}return db[_0xc598('0x71')][_0xc598('0x6b')](_0x48dcc8);})[_0xc598('0x21')](function(_0x21dada){_0x3dec83[_0xc598('0x5a')]=_0x21dada;return _0x3dec83;});}})[_0xc598('0x21')](respondWithFilteredResult(_0x1d320d,_0x48dcc8))['catch'](handleError(_0x1d320d,null));};exports[_0xc598('0x72')]=function(_0x57023c,_0x19425a,_0x278cbf){return db['FaxAccount'][_0xc598('0x63')]({'where':{'id':_0x57023c['params']['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x19425a,null))['then'](function(_0x218417){if(_0x218417){return _0x218417[_0xc598('0x72')](_0x57023c['query'][_0xc598('0x6d')]);}})[_0xc598('0x21')](respondWithStatusCode(_0x19425a,null))['catch'](handleError(_0x19425a,null));};exports['addInteraction']=function(_0x55baf9,_0x56a24d,_0x573d76){return db['FaxInteraction'][_0xc598('0x63')]({'where':{'id':_0x55baf9['params']['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x56a24d,null))['then'](function(_0xd06f88){if(_0xd06f88){return _0xd06f88[_0xc598('0x73')](_0x55baf9['body'][_0xc598('0x6d')],_[_0xc598('0x74')](_0x55baf9[_0xc598('0x5f')],['ids','id'])||{});}})[_0xc598('0x21')](respondWithResult(_0x56a24d,null))[_0xc598('0x2b')](handleError(_0x56a24d,null));};exports['getInteractions']=function(_0x39d301,_0x5010bc,_0x2572b4){var _0x22c291={'raw':![],'where':{}};var _0xc20f50={};var _0x3d938c={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc598('0x70')]({'where':{'id':_0x39d301[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x5010bc,null))['then'](function(_0x5e2914){if(_0x5e2914){_0xc20f50[_0xc598('0x48')]=_[_0xc598('0x4a')](db[_0xc598('0x75')][_0xc598('0x45')]);_0xc20f50[_0xc598('0x49')]=_[_0xc598('0x4a')](_0x39d301[_0xc598('0x49')]);_0xc20f50[_0xc598('0x4b')]=_['intersection'](_0xc20f50[_0xc598('0x48')],_0xc20f50[_0xc598('0x49')]);_0x22c291['attributes']=_[_0xc598('0x4c')](_0xc20f50[_0xc598('0x48')],qs['fields'](_0x39d301['query'][_0xc598('0x4e')]));_0x22c291['attributes']=_0x22c291[_0xc598('0x4d')]['length']?_0x22c291[_0xc598('0x4d')]:_0xc20f50['model'];if(!_0x39d301[_0xc598('0x49')]['hasOwnProperty']('nolimit')){_0x22c291[_0xc598('0x32')]=qs['limit'](_0x39d301[_0xc598('0x49')]['limit']);_0x22c291[_0xc598('0x30')]=qs[_0xc598('0x30')](_0x39d301[_0xc598('0x49')]['offset']);}_0x22c291[_0xc598('0x52')]=qs[_0xc598('0x53')](_0x39d301[_0xc598('0x49')][_0xc598('0x53')]);_0x22c291[_0xc598('0x56')]=qs[_0xc598('0x4b')](_[_0xc598('0x54')](_0x39d301[_0xc598('0x49')],_0xc20f50[_0xc598('0x4b')]));_0x22c291[_0xc598('0x56')][_0xc598('0x67')]=_0x5e2914['id'];if(_0x39d301[_0xc598('0x49')]['filter']){_0x22c291[_0xc598('0x56')]=_[_0xc598('0x57')](_0x22c291[_0xc598('0x56')],{'$or':_[_0xc598('0x43')](_0x22c291['attributes'],function(_0x490e13){var _0x4ba7a9={};_0x4ba7a9[_0x490e13]={'$like':'%'+_0x39d301[_0xc598('0x49')][_0xc598('0x55')]+'%'};return _0x4ba7a9;})});}_0x22c291=_[_0xc598('0x57')]({},_0x22c291,_0x39d301[_0xc598('0x6a')]);return db[_0xc598('0x75')][_0xc598('0x33')]({'where':_0x22c291['where']})['then'](function(_0x45c83d){_0x3d938c[_0xc598('0x33')]=_0x45c83d;if(_0x39d301[_0xc598('0x49')][_0xc598('0x59')]){_0x22c291['include']=[{'model':db['CmContact'],'as':_0xc598('0x76'),'required':![]},{'model':db[_0xc598('0x77')],'as':_0xc598('0x78'),'attributes':[_0xc598('0x3e'),_0xc598('0x79'),'internal'],'required':![]},{'model':db[_0xc598('0x7a')],'as':_0xc598('0x7b'),'attributes':['id',_0xc598('0x3e'),_0xc598('0x7c')],'where':_0x39d301[_0xc598('0x49')][_0xc598('0x7d')]?{'id':_0x39d301[_0xc598('0x49')]['tag']}:undefined,'required':_0x39d301[_0xc598('0x49')][_0xc598('0x7d')]?!![]:![]}];}return db[_0xc598('0x75')][_0xc598('0x6b')](_0x22c291);})['then'](function(_0x1a5deb){_0x3d938c[_0xc598('0x5a')]=_0x1a5deb;return _0x3d938c;});}})[_0xc598('0x21')](respondWithFilteredResult(_0x5010bc,_0x22c291))[_0xc598('0x2b')](handleError(_0x5010bc,null));};exports['addApplications']=function(_0x512cc7,_0x5057a7){var _0x22924a=_0x512cc7[_0xc598('0x5c')]['id'];var _0x4436cc=_0x512cc7[_0xc598('0x5f')];var _0x13d66f=0xc8;var _0x28cb5b=null;return db[_0xc598('0x7e')]['transaction']({'isolationLevel':db[_0xc598('0x7e')][_0xc598('0x7f')][_0xc598('0x80')]['READ_COMMITTED']},function(_0x6daf90){return db[_0xc598('0x44')][_0xc598('0x70')]({'where':{'id':_0x22924a},'transaction':_0x6daf90})[_0xc598('0x21')](function(_0xa80952){if(_0xa80952){return db[_0xc598('0x81')][_0xc598('0x65')]({'where':{'FaxAccountId':_0x22924a},'transaction':_0x6daf90})[_0xc598('0x21')](function(){var _0x2b3fbc=_[_0xc598('0x43')](_0x4436cc,function(_0x505278){_0x505278['FaxAccountId']=_0x22924a;return _0x505278;});return db['FaxApplication'][_0xc598('0x82')](_0x2b3fbc,{'transaction':_0x6daf90});});}else{_0x13d66f=0x194;_0x28cb5b=[];}});})['then'](function(){if(_0x13d66f!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x22924a},'order':_0xc598('0x83')})[_0xc598('0x21')](function(_0x2e77e8){_0x28cb5b=_0x2e77e8;});}})['catch'](function(_0x24c267){_0x13d66f=0x1f4;logger[_0xc598('0x26')](_0x24c267[_0xc598('0x3d')]);if(_0x24c267[_0xc598('0x3e')]){delete _0x24c267[_0xc598('0x3e')];}_0x28cb5b=_0x24c267;})['finally'](function(){if(_0x28cb5b===null){_0x5057a7[_0xc598('0x2c')](_0x13d66f);}else{if(_0x13d66f===0x1f4){_0x5057a7[_0xc598('0x2d')](_0x13d66f)[_0xc598('0x3f')](_0x28cb5b);}else{_0x5057a7[_0xc598('0x2d')](_0x13d66f)['json'](_0x28cb5b);}}});};exports[_0xc598('0x84')]=function(_0x5e0e4a,_0x5333cf,_0x525743){var _0x4a58c2={};var _0xd623f7={};var _0x58cc90;var _0xf8d12d;return db[_0xc598('0x44')]['findOne']({'where':{'id':_0x5e0e4a[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x5333cf,null))[_0xc598('0x21')](function(_0x2ed073){if(_0x2ed073){_0x58cc90=_0x2ed073;_0xd623f7[_0xc598('0x48')]=_[_0xc598('0x4a')](db[_0xc598('0x81')][_0xc598('0x45')]);_0xd623f7['query']=_[_0xc598('0x4a')](_0x5e0e4a[_0xc598('0x49')]);_0xd623f7[_0xc598('0x4b')]=_['intersection'](_0xd623f7[_0xc598('0x48')],_0xd623f7['query']);_0x4a58c2[_0xc598('0x4d')]=_[_0xc598('0x4c')](_0xd623f7['model'],qs[_0xc598('0x4e')](_0x5e0e4a[_0xc598('0x49')][_0xc598('0x4e')]));_0x4a58c2[_0xc598('0x4d')]=_0x4a58c2[_0xc598('0x4d')][_0xc598('0x4f')]?_0x4a58c2['attributes']:_0xd623f7[_0xc598('0x48')];_0x4a58c2[_0xc598('0x52')]=qs[_0xc598('0x53')](_0x5e0e4a[_0xc598('0x49')][_0xc598('0x53')]);_0x4a58c2[_0xc598('0x56')]=qs[_0xc598('0x4b')](_['pick'](_0x5e0e4a[_0xc598('0x49')],_0xd623f7[_0xc598('0x4b')]));if(_0x5e0e4a['query']['filter']){_0x4a58c2[_0xc598('0x56')]=_[_0xc598('0x57')](_0x4a58c2['where'],{'$or':_[_0xc598('0x43')](_0x4a58c2[_0xc598('0x4d')],function(_0x206eee){var _0x268463={};_0x268463[_0x206eee]={'$like':'%'+_0x5e0e4a[_0xc598('0x49')]['filter']+'%'};return _0x268463;})});}_0x4a58c2=_[_0xc598('0x57')]({},_0x4a58c2,_0x5e0e4a[_0xc598('0x6a')]);return _0x58cc90[_0xc598('0x84')](_0x4a58c2);}})[_0xc598('0x21')](function(_0x2f820d){if(_0x2f820d){_0xf8d12d=_0x2f820d[_0xc598('0x4f')];if(!_0x5e0e4a[_0xc598('0x49')][_0xc598('0x50')]('nolimit')){_0x4a58c2[_0xc598('0x32')]=qs[_0xc598('0x32')](_0x5e0e4a[_0xc598('0x49')][_0xc598('0x32')]);_0x4a58c2[_0xc598('0x30')]=qs[_0xc598('0x30')](_0x5e0e4a[_0xc598('0x49')][_0xc598('0x30')]);}return _0x58cc90[_0xc598('0x84')](_0x4a58c2);}})[_0xc598('0x21')](function(_0xab309e){if(_0xab309e){return _0xab309e?{'count':_0xf8d12d,'rows':_0xab309e}:null;}})[_0xc598('0x21')](respondWithResult(_0x5333cf,null))[_0xc598('0x2b')](handleError(_0x5333cf,null));};function Extension(_0x485ac1,_0x475af7,_0xb6a7bf,_0x31c7ad){this[_0xc598('0x85')]=_0xc598('0x86');this[_0xc598('0x87')]=_0x485ac1[_0xc598('0x88')];this[_0xc598('0x89')]=_0x31c7ad;this[_0xc598('0x47')]='system';this[_0xc598('0x8a')]=_0xc598('0x8b');this[_0xc598('0x67')]=_0x485ac1['id'];this[_0xc598('0x83')]=_0x475af7;this[_0xc598('0x8c')]=_0xb6a7bf;}function createExtensionsReciveFax(_0xcec7e4){var _0xc9aa75=0x1;var _0x1ed163=[];_0x1ed163[_0xc598('0x8d')](new Extension(_0xcec7e4,_0xc9aa75,'',_0xc598('0x8e')));_0xc9aa75+=0x1;_0x1ed163['push'](new Extension(_0xcec7e4,_0xc9aa75,'CDR(type)=inbound-fax','Set'));_0xc9aa75+=0x1;for(var _0x206dad in _0xcec7e4){if(_0xcec7e4[_0xc598('0x50')](_0x206dad)&&(_0x206dad===_0xc598('0x8f')||_0x206dad===_0xc598('0x88')||_0x206dad===_0xc598('0x90')||_0x206dad===_0xc598('0x91')||_0x206dad===_0xc598('0x92')||_0x206dad==='maxrate'||_0x206dad===_0xc598('0x93')||_0x206dad===_0xc598('0x94')||_0x206dad==='t38timeout')){_0x1ed163['push'](new Extension(_0xcec7e4,_0xc9aa75,_0xc598('0x95')+_0x206dad+')='+_0xcec7e4[_0x206dad],_0xc598('0x96')));_0xc9aa75+=0x1;}}_0x1ed163[_0xc598('0x8d')](new Extension(_0xcec7e4,_0xc9aa75,'6','Wait'));_0xc9aa75+=0x1;_0x1ed163[_0xc598('0x8d')](new Extension(_0xcec7e4,_0xc9aa75,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0xc9aa75=0x0;return _0x1ed163;}exports['addAccountApplications']=function(_0x2ffbb7,_0x5a5635,_0x4b36b9){var _0xb37b4b;return db[_0xc598('0x7e')]['transaction'](function(_0x42480f){return db['FaxAccount'][_0xc598('0x5e')](_0x2ffbb7[_0xc598('0x5f')],{'transaction':_0x42480f})['then'](function(_0x5cb24e){_0xb37b4b=_0x5cb24e['get']({'plain':!![]});return db[_0xc598('0x97')]['bulkCreate'](createExtensionsReciveFax(_0xb37b4b),{'transaction':_0x42480f});});})[_0xc598('0x21')](function(){return _0xb37b4b;})[_0xc598('0x21')](respondWithResult(_0x5a5635,null))[_0xc598('0x2b')](handleError(_0x5a5635,null));};exports[_0xc598('0x98')]=function(_0x4ed70a,_0x1b8bca,_0x3cd81f){var _0x4e9cd3;return db['sequelize'][_0xc598('0x99')](function(_0xc9dba7){return db[_0xc598('0x44')][_0xc598('0x39')](_0x4ed70a[_0xc598('0x5f')],{'where':{'id':_0x4ed70a[_0xc598('0x5f')]['id']},'transaction':_0xc9dba7})['then'](function(_0x5b4576){return db[_0xc598('0x97')]['destroy']({'where':{'FaxAccountId':_0x4ed70a[_0xc598('0x5f')]['id']},'transaction':_0xc9dba7})[_0xc598('0x21')](function(_0x402407){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xc598('0x74')](_0x4ed70a[_0xc598('0x5f')],['tech',_0xc598('0x9a'),_0xc598('0x9b'),_0xc598('0x9c'),_0xc598('0x9d'),_0xc598('0x9e')])),{'transaction':_0xc9dba7});});});})[_0xc598('0x21')](function(){return db[_0xc598('0x44')][_0xc598('0x9f')](_0x4ed70a[_0xc598('0x5f')]['id']);})[_0xc598('0x21')](respondWithResult(_0x1b8bca,null))['catch'](handleError(_0x1b8bca,null));};exports[_0xc598('0xa0')]=function(_0x454a00,_0x23b966,_0x2eef80){var _0x5263d6={'raw':!![],'where':{}};var _0x218384={};var _0x115592={'count':0x0,'rows':[]};return db[_0xc598('0x44')][_0xc598('0x70')]({'where':{'id':_0x454a00[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x23b966,null))[_0xc598('0x21')](function(_0x2fea31){if(_0x2fea31){_0x218384['model']=_[_0xc598('0x4a')](db[_0xc598('0xa1')]['rawAttributes']);_0x218384[_0xc598('0x49')]=_[_0xc598('0x4a')](_0x454a00['query']);_0x218384['filters']=_[_0xc598('0x4c')](_0x218384[_0xc598('0x48')],_0x218384[_0xc598('0x49')]);_0x5263d6['attributes']=_[_0xc598('0x4c')](_0x218384[_0xc598('0x48')],qs[_0xc598('0x4e')](_0x454a00[_0xc598('0x49')][_0xc598('0x4e')]));_0x5263d6[_0xc598('0x4d')]=_0x5263d6[_0xc598('0x4d')][_0xc598('0x4f')]?_0x5263d6['attributes']:_0x218384[_0xc598('0x48')];if(!_0x454a00[_0xc598('0x49')][_0xc598('0x50')](_0xc598('0x51'))){_0x5263d6['limit']=qs[_0xc598('0x32')](_0x454a00[_0xc598('0x49')][_0xc598('0x32')]);_0x5263d6[_0xc598('0x30')]=qs[_0xc598('0x30')](_0x454a00[_0xc598('0x49')][_0xc598('0x30')]);}_0x5263d6[_0xc598('0x52')]=qs[_0xc598('0x53')](_0x454a00[_0xc598('0x49')]['sort']);_0x5263d6[_0xc598('0x56')]=qs['filters'](_[_0xc598('0x54')](_0x454a00[_0xc598('0x49')],_0x218384['filters']));_0x5263d6[_0xc598('0x56')]['FaxAccountId']=_0x2fea31['id'];if(_0x454a00['query'][_0xc598('0x55')]){_0x5263d6[_0xc598('0x56')]=_['merge'](_0x5263d6[_0xc598('0x56')],{'$or':_[_0xc598('0x43')](_0x5263d6[_0xc598('0x4d')],function(_0x26b87a){var _0x155e70={};_0x155e70[_0x26b87a]={'$like':'%'+_0x454a00[_0xc598('0x49')]['filter']+'%'};return _0x155e70;})});}if(_0x454a00[_0xc598('0x49')][_0xc598('0xa2')]){var _0x2aaf42=_0x454a00[_0xc598('0x49')]['$gte'][_0xc598('0xa3')](',');var _0x1030b8={};_0x1030b8[_0x2aaf42[0x0]]={'$gte':moment(_0x2aaf42[0x1])[_0xc598('0xa4')](_0xc598('0xa5'))};_0x5263d6[_0xc598('0x56')]=_[_0xc598('0x57')](_0x5263d6[_0xc598('0x56')],_0x1030b8);}_0x5263d6=_[_0xc598('0x57')]({},_0x5263d6,_0x454a00[_0xc598('0x6a')]);return db[_0xc598('0xa1')][_0xc598('0x33')]({'where':_0x5263d6[_0xc598('0x56')]})[_0xc598('0x21')](function(_0x57ac94){_0x115592[_0xc598('0x33')]=_0x57ac94;if(_0x454a00[_0xc598('0x49')][_0xc598('0x59')]){_0x5263d6[_0xc598('0x5d')]=[{'all':!![]}];}return db[_0xc598('0xa1')][_0xc598('0x6b')](_0x5263d6);})['then'](function(_0x2c81b3){_0x115592['rows']=_0x2c81b3;return _0x115592;});}})[_0xc598('0x21')](respondWithFilteredResult(_0x23b966,_0x5263d6))[_0xc598('0x2b')](handleError(_0x23b966,null));};exports[_0xc598('0x3f')]=function(_0x3d92cc,_0x13ccbe,_0x4b3d5a){var _0x81bbfa,_0x3279f9={},_0x1f782e;if(_0x3d92cc['body']['to']){_0x1f782e=_0x3d92cc[_0xc598('0x5f')]['to'][0x0];}return db['FaxAccount'][_0xc598('0x63')]({'where':{'id':_0x3d92cc[_0xc598('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xc598('0xa6'),'include':[{'model':db[_0xc598('0xa7')],'as':_0xc598('0xa8'),'where':{'fax':_0x1f782e},'limit':0x1,'order':[[_0xc598('0x9c'),_0xc598('0xa9')]]}]}]})[_0xc598('0x21')](handleEntityNotFound(_0x13ccbe,null))[_0xc598('0x21')](function(_0x2d3d6e){_0x81bbfa=_0x2d3d6e;if(_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')]&&_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')]['length']){for(var _0x59c52b=0x0;_0x59c52b<_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][_0xc598('0x4f')];_0x59c52b+=0x1){_0x3d92cc['body'][_0xc598('0xaa')][_0x59c52b]={'filename':_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][_0x59c52b][_0xc598('0x3e')],'id':_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][_0x59c52b]['id'],'path':path['join'](config[_0xc598('0xab')],_0xc598('0xac'),_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][_0x59c52b][_0xc598('0xad')])};}}return respondWithRpcPromise(_0xc598('0xae'),'CheckAfterSend',{'FaxAccountId':_[_0xc598('0xaf')](_0x3d92cc['params']['id'])?undefined:_0x3d92cc['params']['id'],'path':_[_0xc598('0xaf')](_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0]['path'])?undefined:_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0][_0xc598('0xb0')],'fax':_['isNil'](_0x3d92cc[_0xc598('0x5f')]['to'][0x0])?undefined:_0x3d92cc['body']['to'][0x0]},client9002);})[_0xc598('0x21')](function(){if(_0x81bbfa){if(_[_0xc598('0xaf')](_0x3d92cc['body'][_0xc598('0xb1')])){_0x3d92cc[_0xc598('0x5f')][_0xc598('0xb1')]=util[_0xc598('0xa4')](_0xc598('0xb2'),_0x81bbfa[_0xc598('0x3e')],_0x81bbfa[_0xc598('0xb3')]);}if(_0x81bbfa['List']){if(_0x81bbfa['List'][_0xc598('0xa8')]['length']){return _0x81bbfa[_0xc598('0xa6')]['Contacts'][0x0];}else{return db[_0xc598('0xa7')][_0xc598('0x5e')](_[_0xc598('0x1b')](_0x3d92cc['body'],{'firstName':_0x3d92cc['body']['to'][0x0],'phone':_0x3d92cc[_0xc598('0x5f')]['to'][0x0],'fax':_0x3d92cc[_0xc598('0x5f')]['to'][0x0],'ListId':_0x81bbfa[_0xc598('0x9e')]}));}}else{throw new Error(_0xc598('0xb4'));}}else{throw new Error(_0xc598('0xb5'));}})[_0xc598('0x21')](function(_0x4e4d86){if(_0x4e4d86){return db[_0xc598('0x75')]['find']({'where':{'ContactId':_0x4e4d86['id'],'closed':![],'FaxAccountId':_0x81bbfa['id']}})[_0xc598('0x21')](function(_0x4b80da){if(_0x4b80da){return[_0x4b80da,![]];}return db[_0xc598('0x75')][_0xc598('0x5e')]({'UserId':_0x3d92cc[_0xc598('0x60')]['id'],'ContactId':_0x4e4d86['id'],'FaxAccountId':_0x81bbfa['id'],'fax':_0x3d92cc[_0xc598('0x5f')]['to'][0x0],'firstMsgDirection':_0xc598('0xb6'),'Messages':[_[_0xc598('0x57')](_0x3d92cc[_0xc598('0x5f')],{'read':![],'body':_0x3d92cc['body'][_0xc598('0xaa')][0x0][_0xc598('0xb7')],'FaxAccountId':_0x81bbfa['id'],'UserId':_0x3d92cc[_0xc598('0x60')]['id'],'ContactId':_0x4e4d86['id'],'AttachmentId':_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xc598('0xb8')}]})[_0xc598('0x21')](function(_0x51ce58){return[_0x51ce58,!![]];});});}else{throw new Error(_0xc598('0xb9'));}})[_0xc598('0xba')](function(_0x3ba0f0,_0x23088e){if(_0x23088e){return _0x3ba0f0;}return db['FaxMessage']['create']({'direction':'out','read':![],'body':_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0][_0xc598('0xb7')],'FaxAccountId':_0x81bbfa['id'],'FaxInteractionId':_0x3ba0f0['id'],'UserId':_0x3d92cc[_0xc598('0x60')]['id'],'ContactId':_0x3ba0f0[_0xc598('0xbb')],'AttachmentId':_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0]['id']})[_0xc598('0x21')](function(_0x31a1ba){_0x3ba0f0[_0xc598('0xbc')]['Messages']=[];_0x3ba0f0[_0xc598('0xbc')][_0xc598('0xb8')][_0xc598('0x8d')](_0x31a1ba[_0xc598('0xbc')]);return _0x3ba0f0;});})['then'](function(_0x4bb2fc){respondWithRpcPromise(_0xc598('0xbd'),_0xc598('0xbd'),{'FaxAccountId':_[_0xc598('0xaf')](_0x3d92cc['params']['id'])?undefined:_0x3d92cc[_0xc598('0x5c')]['id'],'path':_[_0xc598('0xaf')](_0x3d92cc[_0xc598('0x5f')][_0xc598('0xaa')][0x0][_0xc598('0xb0')])?undefined:_0x3d92cc['body'][_0xc598('0xaa')][0x0][_0xc598('0xb0')],'fax':_[_0xc598('0xaf')](_0x3d92cc['body']['to'][0x0])?undefined:_0x3d92cc['body']['to'][0x0],'AttachmentId':_0x3d92cc[_0xc598('0x5f')]['attachments'][0x0]['id']},client9002)[_0xc598('0x21')](function(_0x19e9fb){logger[_0xc598('0x29')]('SendFaxRpc,\x20%s',_0x19e9fb);})[_0xc598('0x2b')](function(_0x1f3699){logger[_0xc598('0x29')](_0xc598('0xbe'),_0x1f3699);});return _0x4bb2fc;})['then'](respondWithResult(_0x13ccbe,null))[_0xc598('0x2b')](handleError(_0x13ccbe,null));};exports['addAgents']=function(_0x5a56cf,_0x4bc5d4,_0x55da18){return db['FaxAccount'][_0xc598('0x63')]({'where':{'id':_0x5a56cf['params']['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x4bc5d4,null))[_0xc598('0x21')](function(_0x296f42){if(_0x296f42){return _0x296f42['addAgents'](_0x5a56cf[_0xc598('0x5f')]['ids'],_[_0xc598('0x74')](_0x5a56cf[_0xc598('0x5f')],[_0xc598('0x6d'),'id'])||{})['spread'](function(_0x26ce56){for(var _0xb31ee2=0x0;_0xb31ee2<_0x5a56cf[_0xc598('0x5f')][_0xc598('0x6d')]['length'];_0xb31ee2+=0x1){socket['emit'](_0xc598('0xbf'),{'UserId':Number(_0x5a56cf['body'][_0xc598('0x6d')][_0xb31ee2]),'FaxAccountId':Number(_0x5a56cf[_0xc598('0x5c')]['id'])});}return _0x26ce56;});}})[_0xc598('0x21')](respondWithResult(_0x4bc5d4,null))['catch'](handleError(_0x4bc5d4,null));};exports['removeAgents']=function(_0x459bbf,_0x20dbc0,_0x261907){return db[_0xc598('0x44')][_0xc598('0x63')]({'where':{'id':_0x459bbf[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x20dbc0,null))[_0xc598('0x21')](function(_0x518065){if(_0x518065){return _0x518065[_0xc598('0xc0')](_0x459bbf['query'][_0xc598('0x6d')])[_0xc598('0x21')](function(){if(_[_0xc598('0xc1')](_0x459bbf[_0xc598('0x49')][_0xc598('0x6d')])){for(var _0x271eea=0x0;_0x271eea<_0x459bbf[_0xc598('0x49')][_0xc598('0x6d')][_0xc598('0x4f')];_0x271eea+=0x1){socket[_0xc598('0xc2')](_0xc598('0xc3'),{'UserId':Number(_0x459bbf[_0xc598('0x49')][_0xc598('0x6d')][_0x271eea]),'FaxAccountId':Number(_0x459bbf[_0xc598('0x5c')]['id'])});}}else{socket[_0xc598('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x459bbf['query'][_0xc598('0x6d')]),'FaxAccountId':Number(_0x459bbf[_0xc598('0x5c')]['id'])});}});}})[_0xc598('0x21')](respondWithStatusCode(_0x20dbc0,null))['catch'](handleError(_0x20dbc0,null));};exports[_0xc598('0xc4')]=function(_0x1397e7,_0x50bce6,_0x152a45){var _0x2d51ad={};var _0x5c3aad={};var _0x10c3b7;var _0x3955d8;return db['FaxAccount'][_0xc598('0x70')]({'where':{'id':_0x1397e7[_0xc598('0x5c')]['id']}})[_0xc598('0x21')](handleEntityNotFound(_0x50bce6,null))['then'](function(_0x554d3f){if(_0x554d3f){_0x10c3b7=_0x554d3f;_0x5c3aad[_0xc598('0x48')]=_[_0xc598('0x4a')](db[_0xc598('0x77')][_0xc598('0x45')]);_0x5c3aad[_0xc598('0x49')]=_[_0xc598('0x4a')](_0x1397e7[_0xc598('0x49')]);_0x5c3aad[_0xc598('0x4b')]=_[_0xc598('0x4c')](_0x5c3aad['model'],_0x5c3aad[_0xc598('0x49')]);_0x2d51ad[_0xc598('0x4d')]=_[_0xc598('0x4c')](_0x5c3aad[_0xc598('0x48')],qs[_0xc598('0x4e')](_0x1397e7[_0xc598('0x49')][_0xc598('0x4e')]));_0x2d51ad[_0xc598('0x4d')]=_0x2d51ad[_0xc598('0x4d')][_0xc598('0x4f')]?_0x2d51ad[_0xc598('0x4d')]:_0x5c3aad[_0xc598('0x48')];_0x2d51ad[_0xc598('0x52')]=qs[_0xc598('0x53')](_0x1397e7[_0xc598('0x49')][_0xc598('0x53')]);_0x2d51ad[_0xc598('0x56')]=qs[_0xc598('0x4b')](_[_0xc598('0x54')](_0x1397e7[_0xc598('0x49')],_0x5c3aad['filters']));if(_0x1397e7['query'][_0xc598('0x55')]){_0x2d51ad['where']=_[_0xc598('0x57')](_0x2d51ad[_0xc598('0x56')],{'$or':_[_0xc598('0x43')](_0x2d51ad[_0xc598('0x4d')],function(_0xb743e3){var _0x67c7cc={};_0x67c7cc[_0xb743e3]={'$like':'%'+_0x1397e7[_0xc598('0x49')][_0xc598('0x55')]+'%'};return _0x67c7cc;})});}_0x2d51ad=_[_0xc598('0x57')]({},_0x2d51ad,_0x1397e7['options']);return _0x10c3b7['getAgents'](_0x2d51ad);}})[_0xc598('0x21')](function(_0x5e0d5a){if(_0x5e0d5a){_0x3955d8=_0x5e0d5a[_0xc598('0x4f')];if(!_0x1397e7[_0xc598('0x49')][_0xc598('0x50')]('nolimit')){_0x2d51ad['limit']=qs[_0xc598('0x32')](_0x1397e7['query'][_0xc598('0x32')]);_0x2d51ad[_0xc598('0x30')]=qs[_0xc598('0x30')](_0x1397e7[_0xc598('0x49')][_0xc598('0x30')]);}return _0x10c3b7[_0xc598('0xc4')](_0x2d51ad);}})[_0xc598('0x21')](function(_0x311fd2){if(_0x311fd2){return _0x311fd2?{'count':_0x3955d8,'rows':_0x311fd2}:null;}})[_0xc598('0x21')](respondWithResult(_0x50bce6,null))[_0xc598('0x2b')](handleError(_0x50bce6,null));}; \ No newline at end of file +var _0x8580=['update','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','pick','filter','options','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','push','Answer','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','key','createdAt','TrunkId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','filename','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./faxAccount.socket','register','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x3ec31f,_0x35d8dc){var _0x3e5d42=function(_0x50a1a0){while(--_0x50a1a0){_0x3ec31f['push'](_0x3ec31f['shift']());}};_0x3e5d42(++_0x35d8dc);}(_0x8580,0x92));var _0x0858=function(_0xa22b12,_0x490f3b){_0xa22b12=_0xa22b12-0x0;var _0x13a707=_0x8580[_0xa22b12];return _0x13a707;};'use strict';var emlformat=require(_0x0858('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0858('0x1'));var jsonpatch=require(_0x0858('0x2'));var rp=require(_0x0858('0x3'));var moment=require(_0x0858('0x4'));var BPromise=require(_0x0858('0x5'));var Mustache=require(_0x0858('0x6'));var util=require(_0x0858('0x7'));var path=require(_0x0858('0x8'));var sox=require(_0x0858('0x9'));var csv=require(_0x0858('0xa'));var ejs=require(_0x0858('0xb'));var fs=require('fs');var fs_extra=require(_0x0858('0xc'));var _=require(_0x0858('0xd'));var squel=require('squel');var crypto=require(_0x0858('0xe'));var jsforce=require(_0x0858('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0858('0xa'));var querystring=require('querystring');var Papa=require(_0x0858('0x10'));var Redis=require(_0x0858('0x11'));var authService=require(_0x0858('0x12'));var qs=require(_0x0858('0x13'));var as=require(_0x0858('0x14'));var hardwareService=require(_0x0858('0x15'));var logger=require('../../config/logger')(_0x0858('0x16'));var utils=require(_0x0858('0x17'));var config=require(_0x0858('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x0858('0x19')](config[_0x0858('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0858('0x1b'))(new Redis(config[_0x0858('0x1a')]));require(_0x0858('0x1c'))[_0x0858('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0858('0x1e')][_0x0858('0x1f')]({'port':0x232c});var client9002=jayson[_0x0858('0x1e')][_0x0858('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x42ad68,_0x597370,_0x302f95,_0x1875e0){return new BPromise(function(_0x1054cb,_0x24e142){var _0x2a1fc0=_0x1875e0||client;return _0x2a1fc0['request'](_0x42ad68,_0x302f95)['then'](function(_0x158c0c){logger[_0x0858('0x20')](_0x0858('0x21'),_0x597370,_0x0858('0x22'));logger[_0x0858('0x23')](_0x0858('0x24'),_0x597370,_0x0858('0x22'),JSON['stringify'](_0x158c0c));if(_0x158c0c[_0x0858('0x25')]){if(_0x158c0c[_0x0858('0x25')][_0x0858('0x26')]===0x1f4){logger['error'](_0x0858('0x21'),_0x597370,_0x158c0c[_0x0858('0x25')][_0x0858('0x27')]);return _0x24e142(_0x158c0c[_0x0858('0x25')]['message']);}logger[_0x0858('0x25')](_0x0858('0x21'),_0x597370,_0x158c0c[_0x0858('0x25')][_0x0858('0x27')]);return _0x1054cb(_0x158c0c[_0x0858('0x25')][_0x0858('0x27')]);}else{logger[_0x0858('0x20')](_0x0858('0x21'),_0x597370,_0x0858('0x22'));_0x1054cb(_0x158c0c['result'][_0x0858('0x27')]);}})['catch'](function(_0x124f2b){logger[_0x0858('0x25')]('FaxAccount,\x20%s,\x20%s',_0x597370,_0x124f2b);_0x24e142(_0x124f2b);});});}function respondWithStatusCode(_0x5f5bc0,_0x16426f){_0x16426f=_0x16426f||0xcc;return function(_0xf2c02a){if(_0xf2c02a){return _0x5f5bc0[_0x0858('0x28')](_0x16426f);}return _0x5f5bc0[_0x0858('0x29')](_0x16426f)[_0x0858('0x2a')]();};}function respondWithResult(_0x5a4151,_0x4fee82){_0x4fee82=_0x4fee82||0xc8;return function(_0x4b6a49){if(_0x4b6a49){return _0x5a4151[_0x0858('0x29')](_0x4fee82)[_0x0858('0x2b')](_0x4b6a49);}};}function respondWithFilteredResult(_0x31aec5,_0x5ae161){return function(_0x5d4605){if(_0x5d4605){var _0x12f06d=typeof _0x5ae161[_0x0858('0x2c')]===_0x0858('0x2d')&&typeof _0x5ae161['limit']==='undefined';var _0x113d06=_0x5d4605[_0x0858('0x2e')];var _0x2b05c7=_0x12f06d?0x0:_0x5ae161[_0x0858('0x2c')];var _0x305157=_0x12f06d?_0x5d4605[_0x0858('0x2e')]:_0x5ae161['offset']+_0x5ae161['limit'];var _0x3263ea;if(_0x305157>=_0x113d06){_0x305157=_0x113d06;_0x3263ea=0xc8;}else{_0x3263ea=0xce;}_0x31aec5['status'](_0x3263ea);return _0x31aec5[_0x0858('0x2f')](_0x0858('0x30'),_0x2b05c7+'-'+_0x305157+'/'+_0x113d06)[_0x0858('0x2b')](_0x5d4605);}return null;};}function patchUpdates(_0x4def47){return function(_0x57f463){try{jsonpatch[_0x0858('0x31')](_0x57f463,_0x4def47,!![]);}catch(_0xcf07e){return BPromise[_0x0858('0x32')](_0xcf07e);}return _0x57f463[_0x0858('0x33')]();};}function saveUpdates(_0x4a0342,_0x3c5418){return function(_0xf5ce2d){if(_0xf5ce2d){return _0xf5ce2d[_0x0858('0x34')](_0x4a0342)[_0x0858('0x35')](function(_0x404f49){return _0x404f49;});}return null;};}function removeEntity(_0x3f0f1e,_0x34f527){return function(_0x1e9b3d){if(_0x1e9b3d){return _0x1e9b3d[_0x0858('0x36')]()[_0x0858('0x35')](function(){var _0x5c4367=_0x1e9b3d['get']({'plain':!![]});var _0x4a20c7=_0x0858('0x37');return db[_0x0858('0x38')][_0x0858('0x36')]({'where':{'type':_0x4a20c7,'resourceId':_0x5c4367['id']}})[_0x0858('0x35')](function(){return _0x1e9b3d;});})[_0x0858('0x35')](function(){_0x3f0f1e[_0x0858('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10c897,_0x1b0db3){return function(_0x38a1e0){if(!_0x38a1e0){_0x10c897[_0x0858('0x28')](0x194);}return _0x38a1e0;};}function handleError(_0x5b2077,_0x232980){_0x232980=_0x232980||0x1f4;return function(_0x1f3a8e){logger[_0x0858('0x25')](_0x1f3a8e[_0x0858('0x39')]);if(_0x1f3a8e['name']){delete _0x1f3a8e[_0x0858('0x3a')];}_0x5b2077['status'](_0x232980)[_0x0858('0x3b')](_0x1f3a8e);};}exports[_0x0858('0x3c')]=function(_0x1e09ae,_0x57736b){var _0x20479a={'include':[{'model':db[_0x0858('0x3d')],'as':_0x0858('0x3e')}]},_0x299268={},_0x569e44={'count':0x0,'rows':[]};var _0x2cc67d=_['map'](db[_0x0858('0x3f')][_0x0858('0x40')],function(_0x3569fa){return{'name':_0x3569fa[_0x0858('0x41')],'type':_0x3569fa[_0x0858('0x42')]['key']};});_0x299268[_0x0858('0x43')]=_[_0x0858('0x44')](_0x2cc67d,_0x0858('0x3a'));_0x299268[_0x0858('0x45')]=_[_0x0858('0x46')](_0x1e09ae[_0x0858('0x45')]);_0x299268['filters']=_[_0x0858('0x47')](_0x299268['model'],_0x299268['query']);_0x20479a[_0x0858('0x48')]=_[_0x0858('0x47')](_0x299268[_0x0858('0x43')],qs[_0x0858('0x49')](_0x1e09ae['query']['fields']));_0x20479a[_0x0858('0x48')]=_0x20479a['attributes'][_0x0858('0x4a')]?_0x20479a['attributes']:_0x299268[_0x0858('0x43')];if(!_0x1e09ae['query'][_0x0858('0x4b')]('nolimit')){_0x20479a[_0x0858('0x4c')]=qs[_0x0858('0x4c')](_0x1e09ae[_0x0858('0x45')][_0x0858('0x4c')]);_0x20479a[_0x0858('0x2c')]=qs['offset'](_0x1e09ae[_0x0858('0x45')][_0x0858('0x2c')]);}_0x20479a[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x1e09ae[_0x0858('0x45')][_0x0858('0x4e')]);_0x20479a[_0x0858('0x4f')]=qs[_0x0858('0x50')](_['pick'](_0x1e09ae[_0x0858('0x45')],_0x299268[_0x0858('0x50')]),_0x2cc67d);if(_0x1e09ae[_0x0858('0x45')]['filter']){_0x20479a['where']=_[_0x0858('0x51')](_0x20479a['where'],{'$or':_[_0x0858('0x44')](_0x2cc67d,function(_0x417a96){if(_0x417a96[_0x0858('0x42')]!==_0x0858('0x52')){var _0x12acca={};_0x12acca[_0x417a96[_0x0858('0x3a')]]={'$like':'%'+_0x1e09ae[_0x0858('0x45')]['filter']+'%'};return _0x12acca;}})});}_0x20479a=_['merge']({},_0x20479a,_0x1e09ae['options']);var _0x50906={'where':_0x20479a[_0x0858('0x4f')]};return db[_0x0858('0x3f')][_0x0858('0x2e')](_0x50906)[_0x0858('0x35')](function(_0x3ee338){_0x569e44[_0x0858('0x2e')]=_0x3ee338;if(_0x1e09ae[_0x0858('0x45')][_0x0858('0x53')]){_0x20479a[_0x0858('0x54')]=[{'all':!![]}];}return db[_0x0858('0x3f')][_0x0858('0x55')](_0x20479a);})['then'](function(_0x8cf49a){_0x569e44[_0x0858('0x56')]=_0x8cf49a;return _0x569e44;})['then'](respondWithFilteredResult(_0x57736b,_0x20479a))[_0x0858('0x57')](handleError(_0x57736b,null));};exports['show']=function(_0x397103,_0x13342){var _0x4426fb={'raw':![],'where':{'id':_0x397103[_0x0858('0x58')]['id']},'include':[{'model':db[_0x0858('0x3d')],'as':_0x0858('0x3e')}]},_0x4a0ebf={};_0x4a0ebf[_0x0858('0x43')]=_[_0x0858('0x46')](db[_0x0858('0x3f')][_0x0858('0x40')]);_0x4a0ebf[_0x0858('0x45')]=_[_0x0858('0x46')](_0x397103[_0x0858('0x45')]);_0x4a0ebf[_0x0858('0x50')]=_[_0x0858('0x47')](_0x4a0ebf['model'],_0x4a0ebf[_0x0858('0x45')]);_0x4426fb[_0x0858('0x48')]=_['intersection'](_0x4a0ebf['model'],qs[_0x0858('0x49')](_0x397103['query'][_0x0858('0x49')]));_0x4426fb[_0x0858('0x48')]=_0x4426fb['attributes']['length']?_0x4426fb[_0x0858('0x48')]:_0x4a0ebf[_0x0858('0x43')];if(_0x397103[_0x0858('0x45')][_0x0858('0x53')]){_0x4426fb[_0x0858('0x54')]=[{'all':!![]}];}_0x4426fb=_[_0x0858('0x51')]({},_0x4426fb,_0x397103['options']);return db[_0x0858('0x3f')]['find'](_0x4426fb)['then'](handleEntityNotFound(_0x13342,null))['then'](respondWithResult(_0x13342,null))['catch'](handleError(_0x13342,null));};exports[_0x0858('0x59')]=function(_0x304790,_0x17e5e6){return db['FaxAccount'][_0x0858('0x59')](_0x304790[_0x0858('0x5a')],{})[_0x0858('0x35')](function(_0x397fb0){var _0x2464de=_0x304790[_0x0858('0x5b')][_0x0858('0x5c')]({'plain':!![]});if(!_0x2464de)throw new Error(_0x0858('0x5d'));if(_0x2464de[_0x0858('0x5e')]===_0x0858('0x5b')){var _0x1b4990=_0x397fb0['get']({'plain':!![]});var _0x216ec9='FaxAccounts';return db[_0x0858('0x5f')][_0x0858('0x60')]({'where':{'name':_0x216ec9,'userProfileId':_0x2464de[_0x0858('0x61')]},'raw':!![]})[_0x0858('0x35')](function(_0x6b87b9){if(_0x6b87b9&&_0x6b87b9[_0x0858('0x62')]===0x0){return db[_0x0858('0x38')][_0x0858('0x59')]({'name':_0x1b4990[_0x0858('0x3a')],'resourceId':_0x1b4990['id'],'type':_0x6b87b9[_0x0858('0x3a')],'sectionId':_0x6b87b9['id']},{})['then'](function(){return _0x397fb0;});}else{return _0x397fb0;}})['catch'](function(_0x45fabb){logger[_0x0858('0x25')](_0x0858('0x63'),_0x45fabb);throw _0x45fabb;});}return _0x397fb0;})['then'](respondWithResult(_0x17e5e6,0xc9))[_0x0858('0x57')](handleError(_0x17e5e6,null));};exports[_0x0858('0x34')]=function(_0xa8e3b3,_0x235b1f){if(_0xa8e3b3['body']['id']){delete _0xa8e3b3[_0x0858('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0xa8e3b3[_0x0858('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x235b1f,null))[_0x0858('0x35')](saveUpdates(_0xa8e3b3[_0x0858('0x5a')],null))['then'](respondWithResult(_0x235b1f,null))[_0x0858('0x57')](handleError(_0x235b1f,null));};exports[_0x0858('0x36')]=function(_0x2801c8,_0x57c910){return db[_0x0858('0x3f')][_0x0858('0x60')]({'where':{'id':_0x2801c8[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x57c910,null))[_0x0858('0x35')](removeEntity(_0x57c910,null))[_0x0858('0x57')](handleError(_0x57c910,null));};exports[_0x0858('0x64')]=function(_0x9a14af,_0x110d7a){return db[_0x0858('0x3f')]['describe']()[_0x0858('0x35')](respondWithResult(_0x110d7a,null))[_0x0858('0x57')](handleError(_0x110d7a,null));};exports[_0x0858('0x65')]=function(_0xda4c0b,_0x1248ac,_0x565b65){if(_0xda4c0b['body']['id']){delete _0xda4c0b[_0x0858('0x5a')]['id'];}return db['FaxAccount'][_0x0858('0x60')]({'where':{'id':_0xda4c0b[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x1248ac,null))[_0x0858('0x35')](function(_0x1c1495){if(_0x1c1495){_0xda4c0b['body'][_0x0858('0x66')]=_0x1c1495['id'];return db[_0x0858('0x67')][_0x0858('0x59')](_0xda4c0b['body']);}})[_0x0858('0x35')](respondWithResult(_0x1248ac,null))[_0x0858('0x57')](handleError(_0x1248ac,null));};exports['getDispositions']=function(_0x4ebf5b,_0x478b21,_0x526b0f){var _0x1163ba={'raw':![],'where':{}};var _0x511472={};var _0x5c2540={'count':0x0,'rows':[]};return db[_0x0858('0x3f')][_0x0858('0x68')]({'where':{'id':_0x4ebf5b[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x478b21,null))[_0x0858('0x35')](function(_0x266b40){if(_0x266b40){_0x511472[_0x0858('0x43')]=_['keys'](db[_0x0858('0x67')]['rawAttributes']);_0x511472[_0x0858('0x45')]=_[_0x0858('0x46')](_0x4ebf5b['query']);_0x511472[_0x0858('0x50')]=_[_0x0858('0x47')](_0x511472['model'],_0x511472[_0x0858('0x45')]);_0x1163ba[_0x0858('0x48')]=_['intersection'](_0x511472['model'],qs[_0x0858('0x49')](_0x4ebf5b[_0x0858('0x45')]['fields']));_0x1163ba[_0x0858('0x48')]=_0x1163ba[_0x0858('0x48')][_0x0858('0x4a')]?_0x1163ba['attributes']:_0x511472['model'];if(!_0x4ebf5b['query'][_0x0858('0x4b')](_0x0858('0x69'))){_0x1163ba[_0x0858('0x4c')]=qs[_0x0858('0x4c')](_0x4ebf5b['query'][_0x0858('0x4c')]);_0x1163ba[_0x0858('0x2c')]=qs['offset'](_0x4ebf5b[_0x0858('0x45')][_0x0858('0x2c')]);}_0x1163ba[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x4ebf5b[_0x0858('0x45')][_0x0858('0x4e')]);_0x1163ba[_0x0858('0x4f')]=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x4ebf5b[_0x0858('0x45')],_0x511472[_0x0858('0x50')]));_0x1163ba['where'][_0x0858('0x66')]=_0x266b40['id'];if(_0x4ebf5b[_0x0858('0x45')][_0x0858('0x6b')]){_0x1163ba['where']=_[_0x0858('0x51')](_0x1163ba['where'],{'$or':_[_0x0858('0x44')](_0x1163ba[_0x0858('0x48')],function(_0x11db83){var _0x243f43={};_0x243f43[_0x11db83]={'$like':'%'+_0x4ebf5b[_0x0858('0x45')][_0x0858('0x6b')]+'%'};return _0x243f43;})});}_0x1163ba=_[_0x0858('0x51')]({},_0x1163ba,_0x4ebf5b[_0x0858('0x6c')]);return db[_0x0858('0x67')][_0x0858('0x2e')]({'where':_0x1163ba['where']})[_0x0858('0x35')](function(_0x3e2a50){_0x5c2540[_0x0858('0x2e')]=_0x3e2a50;if(_0x4ebf5b['query']['includeAll']){_0x1163ba[_0x0858('0x54')]=[{'all':!![]}];}return db[_0x0858('0x67')][_0x0858('0x55')](_0x1163ba);})[_0x0858('0x35')](function(_0x3e5da5){_0x5c2540['rows']=_0x3e5da5;return _0x5c2540;});}})[_0x0858('0x35')](respondWithFilteredResult(_0x478b21,_0x1163ba))[_0x0858('0x57')](handleError(_0x478b21,null));};exports[_0x0858('0x6d')]=function(_0x4cdc3b,_0x59da5f,_0x6a4691){return db['FaxAccount'][_0x0858('0x60')]({'where':{'id':_0x4cdc3b[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x59da5f,null))[_0x0858('0x35')](function(_0x15601a){if(_0x15601a){return _0x15601a[_0x0858('0x6d')](_0x4cdc3b['query']['ids']);}})[_0x0858('0x35')](respondWithStatusCode(_0x59da5f,null))['catch'](handleError(_0x59da5f,null));};exports[_0x0858('0x6e')]=function(_0x393028,_0x513c52,_0x22b0fb){if(_0x393028[_0x0858('0x5a')]['id']){delete _0x393028[_0x0858('0x5a')]['id'];}return db[_0x0858('0x3f')][_0x0858('0x60')]({'where':{'id':_0x393028['params']['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x513c52,null))[_0x0858('0x35')](function(_0x5c1518){if(_0x5c1518){_0x393028[_0x0858('0x5a')][_0x0858('0x66')]=_0x5c1518['id'];return db['CannedAnswer'][_0x0858('0x59')](_0x393028['body']);}})[_0x0858('0x35')](respondWithResult(_0x513c52,null))[_0x0858('0x57')](handleError(_0x513c52,null));};exports['getAnswers']=function(_0x9d956d,_0x18ee47,_0x27246a){var _0x4e8a78={'raw':![],'where':{}};var _0x491316={};var _0x1f85de={'count':0x0,'rows':[]};return db[_0x0858('0x3f')][_0x0858('0x68')]({'where':{'id':_0x9d956d[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x18ee47,null))['then'](function(_0x5c5882){if(_0x5c5882){_0x491316['model']=_[_0x0858('0x46')](db['CannedAnswer']['rawAttributes']);_0x491316[_0x0858('0x45')]=_[_0x0858('0x46')](_0x9d956d['query']);_0x491316[_0x0858('0x50')]=_[_0x0858('0x47')](_0x491316[_0x0858('0x43')],_0x491316[_0x0858('0x45')]);_0x4e8a78['attributes']=_[_0x0858('0x47')](_0x491316[_0x0858('0x43')],qs['fields'](_0x9d956d['query'][_0x0858('0x49')]));_0x4e8a78[_0x0858('0x48')]=_0x4e8a78['attributes'][_0x0858('0x4a')]?_0x4e8a78[_0x0858('0x48')]:_0x491316['model'];if(!_0x9d956d[_0x0858('0x45')][_0x0858('0x4b')](_0x0858('0x69'))){_0x4e8a78['limit']=qs[_0x0858('0x4c')](_0x9d956d[_0x0858('0x45')]['limit']);_0x4e8a78[_0x0858('0x2c')]=qs[_0x0858('0x2c')](_0x9d956d[_0x0858('0x45')][_0x0858('0x2c')]);}_0x4e8a78['order']=qs[_0x0858('0x4e')](_0x9d956d[_0x0858('0x45')][_0x0858('0x4e')]);_0x4e8a78[_0x0858('0x4f')]=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x9d956d['query'],_0x491316[_0x0858('0x50')]));_0x4e8a78[_0x0858('0x4f')][_0x0858('0x66')]=_0x5c5882['id'];if(_0x9d956d['query'][_0x0858('0x6b')]){_0x4e8a78['where']=_['merge'](_0x4e8a78[_0x0858('0x4f')],{'$or':_[_0x0858('0x44')](_0x4e8a78[_0x0858('0x48')],function(_0x1bf3d2){var _0x4b1b1e={};_0x4b1b1e[_0x1bf3d2]={'$like':'%'+_0x9d956d[_0x0858('0x45')][_0x0858('0x6b')]+'%'};return _0x4b1b1e;})});}_0x4e8a78=_[_0x0858('0x51')]({},_0x4e8a78,_0x9d956d['options']);return db['CannedAnswer']['count']({'where':_0x4e8a78[_0x0858('0x4f')]})[_0x0858('0x35')](function(_0x1223e4){_0x1f85de[_0x0858('0x2e')]=_0x1223e4;if(_0x9d956d[_0x0858('0x45')]['includeAll']){_0x4e8a78[_0x0858('0x54')]=[{'all':!![]}];}return db[_0x0858('0x6f')]['findAll'](_0x4e8a78);})[_0x0858('0x35')](function(_0x308e68){_0x1f85de[_0x0858('0x56')]=_0x308e68;return _0x1f85de;});}})[_0x0858('0x35')](respondWithFilteredResult(_0x18ee47,_0x4e8a78))[_0x0858('0x57')](handleError(_0x18ee47,null));};exports['removeAnswers']=function(_0x56f7b9,_0x250a62,_0x364ad6){return db[_0x0858('0x3f')][_0x0858('0x60')]({'where':{'id':_0x56f7b9[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x250a62,null))[_0x0858('0x35')](function(_0x467c9e){if(_0x467c9e){return _0x467c9e[_0x0858('0x70')](_0x56f7b9[_0x0858('0x45')][_0x0858('0x71')]);}})['then'](respondWithStatusCode(_0x250a62,null))[_0x0858('0x57')](handleError(_0x250a62,null));};exports['addInteraction']=function(_0x23ab8a,_0xd939d4,_0x3c6978){return db[_0x0858('0x72')][_0x0858('0x60')]({'where':{'id':_0x23ab8a['params']['id']}})[_0x0858('0x35')](handleEntityNotFound(_0xd939d4,null))['then'](function(_0x1d7c71){if(_0x1d7c71){return _0x1d7c71[_0x0858('0x73')](_0x23ab8a[_0x0858('0x5a')][_0x0858('0x71')],_[_0x0858('0x74')](_0x23ab8a[_0x0858('0x5a')],[_0x0858('0x71'),'id'])||{});}})[_0x0858('0x35')](respondWithResult(_0xd939d4,null))[_0x0858('0x57')](handleError(_0xd939d4,null));};exports[_0x0858('0x75')]=function(_0x2e0ae4,_0x19be54,_0x43c89c){var _0x93df76={'raw':![],'where':{}};var _0x4b1d1a={};var _0x482fd4={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0858('0x68')]({'where':{'id':_0x2e0ae4[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x19be54,null))[_0x0858('0x35')](function(_0x5ae497){if(_0x5ae497){_0x4b1d1a[_0x0858('0x43')]=_[_0x0858('0x46')](db[_0x0858('0x72')][_0x0858('0x40')]);_0x4b1d1a[_0x0858('0x45')]=_['keys'](_0x2e0ae4[_0x0858('0x45')]);_0x4b1d1a[_0x0858('0x50')]=_['intersection'](_0x4b1d1a[_0x0858('0x43')],_0x4b1d1a['query']);_0x93df76[_0x0858('0x48')]=_['intersection'](_0x4b1d1a[_0x0858('0x43')],qs[_0x0858('0x49')](_0x2e0ae4['query']['fields']));_0x93df76['attributes']=_0x93df76[_0x0858('0x48')][_0x0858('0x4a')]?_0x93df76[_0x0858('0x48')]:_0x4b1d1a[_0x0858('0x43')];if(!_0x2e0ae4['query'][_0x0858('0x4b')](_0x0858('0x69'))){_0x93df76['limit']=qs['limit'](_0x2e0ae4[_0x0858('0x45')][_0x0858('0x4c')]);_0x93df76[_0x0858('0x2c')]=qs[_0x0858('0x2c')](_0x2e0ae4['query'][_0x0858('0x2c')]);}_0x93df76[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x2e0ae4[_0x0858('0x45')][_0x0858('0x4e')]);_0x93df76[_0x0858('0x4f')]=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x2e0ae4[_0x0858('0x45')],_0x4b1d1a[_0x0858('0x50')]));_0x93df76[_0x0858('0x4f')]['FaxAccountId']=_0x5ae497['id'];if(_0x2e0ae4['query']['filter']){_0x93df76[_0x0858('0x4f')]=_[_0x0858('0x51')](_0x93df76[_0x0858('0x4f')],{'$or':_[_0x0858('0x44')](_0x93df76[_0x0858('0x48')],function(_0x53f716){var _0x20d551={};_0x20d551[_0x53f716]={'$like':'%'+_0x2e0ae4[_0x0858('0x45')]['filter']+'%'};return _0x20d551;})});}_0x93df76=_['merge']({},_0x93df76,_0x2e0ae4['options']);return db['FaxInteraction']['count']({'where':_0x93df76[_0x0858('0x4f')]})['then'](function(_0x4bbd18){_0x482fd4['count']=_0x4bbd18;if(_0x2e0ae4[_0x0858('0x45')][_0x0858('0x53')]){_0x93df76['include']=[{'model':db['CmContact'],'as':_0x0858('0x76'),'required':![]},{'model':db[_0x0858('0x77')],'as':_0x0858('0x78'),'attributes':[_0x0858('0x3a'),_0x0858('0x79'),_0x0858('0x7a')],'required':![]},{'model':db[_0x0858('0x7b')],'as':_0x0858('0x7c'),'attributes':['id',_0x0858('0x3a'),_0x0858('0x7d')],'where':_0x2e0ae4['query'][_0x0858('0x7e')]?{'id':_0x2e0ae4[_0x0858('0x45')]['tag']}:undefined,'required':_0x2e0ae4[_0x0858('0x45')][_0x0858('0x7e')]?!![]:![]}];}return db[_0x0858('0x72')][_0x0858('0x55')](_0x93df76);})[_0x0858('0x35')](function(_0x4a09c9){_0x482fd4[_0x0858('0x56')]=_0x4a09c9;return _0x482fd4;});}})[_0x0858('0x35')](respondWithFilteredResult(_0x19be54,_0x93df76))['catch'](handleError(_0x19be54,null));};exports[_0x0858('0x7f')]=function(_0x4d8387,_0x29d209){var _0x5667f7=_0x4d8387['params']['id'];var _0x413938=_0x4d8387[_0x0858('0x5a')];var _0x4d108e=0xc8;var _0x3583db=null;return db['sequelize'][_0x0858('0x80')]({'isolationLevel':db[_0x0858('0x81')][_0x0858('0x82')]['ISOLATION_LEVELS'][_0x0858('0x83')]},function(_0x35fccd){return db[_0x0858('0x3f')][_0x0858('0x68')]({'where':{'id':_0x5667f7},'transaction':_0x35fccd})[_0x0858('0x35')](function(_0x5d76f9){if(_0x5d76f9){return db['FaxApplication'][_0x0858('0x36')]({'where':{'FaxAccountId':_0x5667f7},'transaction':_0x35fccd})[_0x0858('0x35')](function(){var _0x2c0c97=_[_0x0858('0x44')](_0x413938,function(_0xc5d0a2){_0xc5d0a2['FaxAccountId']=_0x5667f7;return _0xc5d0a2;});return db[_0x0858('0x84')][_0x0858('0x85')](_0x2c0c97,{'transaction':_0x35fccd});});}else{_0x4d108e=0x194;_0x3583db=[];}});})['then'](function(){if(_0x4d108e!==0x194){return db[_0x0858('0x84')][_0x0858('0x86')]({'where':{'FaxAccountId':_0x5667f7},'order':_0x0858('0x87')})[_0x0858('0x35')](function(_0x576c73){_0x3583db=_0x576c73;});}})[_0x0858('0x57')](function(_0x45df78){_0x4d108e=0x1f4;logger['error'](_0x45df78['stack']);if(_0x45df78['name']){delete _0x45df78['name'];}_0x3583db=_0x45df78;})[_0x0858('0x88')](function(){if(_0x3583db===null){_0x29d209['sendStatus'](_0x4d108e);}else{if(_0x4d108e===0x1f4){_0x29d209['status'](_0x4d108e)[_0x0858('0x3b')](_0x3583db);}else{_0x29d209['status'](_0x4d108e)['json'](_0x3583db);}}});};exports[_0x0858('0x89')]=function(_0x20f0c3,_0x3a036,_0x18347f){var _0x398edf={};var _0x40b437={};var _0x5cb7f7;var _0x4fdbb1;return db[_0x0858('0x3f')]['findOne']({'where':{'id':_0x20f0c3[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x3a036,null))['then'](function(_0x25c924){if(_0x25c924){_0x5cb7f7=_0x25c924;_0x40b437['model']=_[_0x0858('0x46')](db[_0x0858('0x84')]['rawAttributes']);_0x40b437[_0x0858('0x45')]=_[_0x0858('0x46')](_0x20f0c3[_0x0858('0x45')]);_0x40b437[_0x0858('0x50')]=_[_0x0858('0x47')](_0x40b437['model'],_0x40b437[_0x0858('0x45')]);_0x398edf[_0x0858('0x48')]=_['intersection'](_0x40b437[_0x0858('0x43')],qs[_0x0858('0x49')](_0x20f0c3[_0x0858('0x45')][_0x0858('0x49')]));_0x398edf[_0x0858('0x48')]=_0x398edf[_0x0858('0x48')][_0x0858('0x4a')]?_0x398edf[_0x0858('0x48')]:_0x40b437['model'];_0x398edf[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x20f0c3[_0x0858('0x45')][_0x0858('0x4e')]);_0x398edf['where']=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x20f0c3[_0x0858('0x45')],_0x40b437[_0x0858('0x50')]));if(_0x20f0c3[_0x0858('0x45')]['filter']){_0x398edf['where']=_[_0x0858('0x51')](_0x398edf[_0x0858('0x4f')],{'$or':_[_0x0858('0x44')](_0x398edf[_0x0858('0x48')],function(_0x52d1a8){var _0x9c28bd={};_0x9c28bd[_0x52d1a8]={'$like':'%'+_0x20f0c3[_0x0858('0x45')][_0x0858('0x6b')]+'%'};return _0x9c28bd;})});}_0x398edf=_[_0x0858('0x51')]({},_0x398edf,_0x20f0c3[_0x0858('0x6c')]);return _0x5cb7f7[_0x0858('0x89')](_0x398edf);}})[_0x0858('0x35')](function(_0x5f0435){if(_0x5f0435){_0x4fdbb1=_0x5f0435[_0x0858('0x4a')];if(!_0x20f0c3[_0x0858('0x45')][_0x0858('0x4b')](_0x0858('0x69'))){_0x398edf['limit']=qs[_0x0858('0x4c')](_0x20f0c3['query'][_0x0858('0x4c')]);_0x398edf[_0x0858('0x2c')]=qs[_0x0858('0x2c')](_0x20f0c3[_0x0858('0x45')]['offset']);}return _0x5cb7f7['getApplications'](_0x398edf);}})[_0x0858('0x35')](function(_0x170eda){if(_0x170eda){return _0x170eda?{'count':_0x4fdbb1,'rows':_0x170eda}:null;}})[_0x0858('0x35')](respondWithResult(_0x3a036,null))[_0x0858('0x57')](handleError(_0x3a036,null));};function Extension(_0x13cbd2,_0x202dd5,_0x5a1e91,_0x4911f0){this[_0x0858('0x8a')]=_0x0858('0x8b');this[_0x0858('0x8c')]=_0x13cbd2[_0x0858('0x8d')];this['app']=_0x4911f0;this[_0x0858('0x42')]=_0x0858('0x8e');this[_0x0858('0x8f')]='Fax\x20Extension';this[_0x0858('0x66')]=_0x13cbd2['id'];this[_0x0858('0x87')]=_0x202dd5;this['appdata']=_0x5a1e91;}function createExtensionsReciveFax(_0x45f981){var _0xdbb535=0x1;var _0x29758b=[];_0x29758b[_0x0858('0x90')](new Extension(_0x45f981,_0xdbb535,'',_0x0858('0x91')));_0xdbb535+=0x1;_0x29758b[_0x0858('0x90')](new Extension(_0x45f981,_0xdbb535,'CDR(type)=inbound-fax',_0x0858('0x92')));_0xdbb535+=0x1;for(var _0x1346e7 in _0x45f981){if(_0x45f981[_0x0858('0x4b')](_0x1346e7)&&(_0x1346e7===_0x0858('0x93')||_0x1346e7===_0x0858('0x8d')||_0x1346e7===_0x0858('0x94')||_0x1346e7===_0x0858('0x95')||_0x1346e7==='headerinfo'||_0x1346e7===_0x0858('0x96')||_0x1346e7===_0x0858('0x97')||_0x1346e7==='modem'||_0x1346e7===_0x0858('0x98'))){_0x29758b[_0x0858('0x90')](new Extension(_0x45f981,_0xdbb535,_0x0858('0x99')+_0x1346e7+')='+_0x45f981[_0x1346e7],_0x0858('0x92')));_0xdbb535+=0x1;}}_0x29758b[_0x0858('0x90')](new Extension(_0x45f981,_0xdbb535,'6','Wait'));_0xdbb535+=0x1;_0x29758b[_0x0858('0x90')](new Extension(_0x45f981,_0xdbb535,_0x0858('0x9a'),_0x0858('0x9b')));_0xdbb535=0x0;return _0x29758b;}exports['addAccountApplications']=function(_0x54d4f0,_0x3dc409,_0x3c2462){var _0x3faa40;return db[_0x0858('0x81')]['transaction'](function(_0x1450ab){return db[_0x0858('0x3f')][_0x0858('0x59')](_0x54d4f0[_0x0858('0x5a')],{'transaction':_0x1450ab})[_0x0858('0x35')](function(_0x201a4c){_0x3faa40=_0x201a4c[_0x0858('0x5c')]({'plain':!![]});return db[_0x0858('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x3faa40),{'transaction':_0x1450ab});});})[_0x0858('0x35')](function(){return _0x3faa40;})[_0x0858('0x35')](respondWithResult(_0x3dc409,null))[_0x0858('0x57')](handleError(_0x3dc409,null));};exports[_0x0858('0x9d')]=function(_0x48e679,_0x2d7922,_0x562fc3){var _0x1b4226;return db[_0x0858('0x81')][_0x0858('0x80')](function(_0x14cba4){return db[_0x0858('0x3f')]['update'](_0x48e679['body'],{'where':{'id':_0x48e679['body']['id']},'transaction':_0x14cba4})[_0x0858('0x35')](function(_0x4438dd){return db[_0x0858('0x9c')][_0x0858('0x36')]({'where':{'FaxAccountId':_0x48e679[_0x0858('0x5a')]['id']},'transaction':_0x14cba4})['then'](function(_0x471933){return db[_0x0858('0x9c')][_0x0858('0x85')](createExtensionsReciveFax(_[_0x0858('0x74')](_0x48e679['body'],[_0x0858('0x9e'),_0x0858('0x9f'),_0x0858('0xa0'),'updatedAt',_0x0858('0xa1'),'ListId'])),{'transaction':_0x14cba4});});});})[_0x0858('0x35')](function(){return db['FaxAccount'][_0x0858('0xa2')](_0x48e679[_0x0858('0x5a')]['id']);})[_0x0858('0x35')](respondWithResult(_0x2d7922,null))['catch'](handleError(_0x2d7922,null));};exports['getMessages']=function(_0x1a9891,_0x2e3eb0,_0x7db0a6){var _0x475032={'raw':!![],'where':{}};var _0x58ee12={};var _0x34dccf={'count':0x0,'rows':[]};return db[_0x0858('0x3f')][_0x0858('0x68')]({'where':{'id':_0x1a9891[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x2e3eb0,null))['then'](function(_0x2f3764){if(_0x2f3764){_0x58ee12['model']=_[_0x0858('0x46')](db[_0x0858('0xa3')][_0x0858('0x40')]);_0x58ee12[_0x0858('0x45')]=_['keys'](_0x1a9891['query']);_0x58ee12[_0x0858('0x50')]=_['intersection'](_0x58ee12[_0x0858('0x43')],_0x58ee12[_0x0858('0x45')]);_0x475032[_0x0858('0x48')]=_[_0x0858('0x47')](_0x58ee12[_0x0858('0x43')],qs[_0x0858('0x49')](_0x1a9891[_0x0858('0x45')][_0x0858('0x49')]));_0x475032[_0x0858('0x48')]=_0x475032[_0x0858('0x48')][_0x0858('0x4a')]?_0x475032[_0x0858('0x48')]:_0x58ee12[_0x0858('0x43')];if(!_0x1a9891[_0x0858('0x45')][_0x0858('0x4b')](_0x0858('0x69'))){_0x475032[_0x0858('0x4c')]=qs[_0x0858('0x4c')](_0x1a9891['query'][_0x0858('0x4c')]);_0x475032[_0x0858('0x2c')]=qs[_0x0858('0x2c')](_0x1a9891[_0x0858('0x45')][_0x0858('0x2c')]);}_0x475032[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x1a9891['query'][_0x0858('0x4e')]);_0x475032[_0x0858('0x4f')]=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x1a9891[_0x0858('0x45')],_0x58ee12[_0x0858('0x50')]));_0x475032[_0x0858('0x4f')][_0x0858('0x66')]=_0x2f3764['id'];if(_0x1a9891['query'][_0x0858('0x6b')]){_0x475032[_0x0858('0x4f')]=_[_0x0858('0x51')](_0x475032[_0x0858('0x4f')],{'$or':_[_0x0858('0x44')](_0x475032[_0x0858('0x48')],function(_0x1d2dbf){var _0x1a28ff={};_0x1a28ff[_0x1d2dbf]={'$like':'%'+_0x1a9891[_0x0858('0x45')]['filter']+'%'};return _0x1a28ff;})});}if(_0x1a9891[_0x0858('0x45')]['$gte']){var _0x38521a=_0x1a9891[_0x0858('0x45')][_0x0858('0xa4')][_0x0858('0xa5')](',');var _0x2089fa={};_0x2089fa[_0x38521a[0x0]]={'$gte':moment(_0x38521a[0x1])[_0x0858('0xa6')](_0x0858('0xa7'))};_0x475032[_0x0858('0x4f')]=_[_0x0858('0x51')](_0x475032['where'],_0x2089fa);}_0x475032=_[_0x0858('0x51')]({},_0x475032,_0x1a9891[_0x0858('0x6c')]);return db[_0x0858('0xa3')][_0x0858('0x2e')]({'where':_0x475032[_0x0858('0x4f')]})[_0x0858('0x35')](function(_0x3d2b94){_0x34dccf[_0x0858('0x2e')]=_0x3d2b94;if(_0x1a9891[_0x0858('0x45')][_0x0858('0x53')]){_0x475032[_0x0858('0x54')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x475032);})[_0x0858('0x35')](function(_0x381976){_0x34dccf[_0x0858('0x56')]=_0x381976;return _0x34dccf;});}})[_0x0858('0x35')](respondWithFilteredResult(_0x2e3eb0,_0x475032))[_0x0858('0x57')](handleError(_0x2e3eb0,null));};exports['send']=function(_0x5a7e0d,_0x1e56b9,_0xee1180){var _0x403ef6,_0x1c7b74={},_0x2ed20e;if(_0x5a7e0d[_0x0858('0x5a')]['to']){_0x2ed20e=_0x5a7e0d[_0x0858('0x5a')]['to'][0x0];}return db[_0x0858('0x3f')][_0x0858('0x60')]({'where':{'id':_0x5a7e0d[_0x0858('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x0858('0xa8'),'include':[{'model':db[_0x0858('0xa9')],'as':_0x0858('0xaa'),'where':{'fax':_0x2ed20e},'limit':0x1,'order':[[_0x0858('0xab'),_0x0858('0xac')]]}]}]})[_0x0858('0x35')](handleEntityNotFound(_0x1e56b9,null))[_0x0858('0x35')](function(_0x5110a8){_0x403ef6=_0x5110a8;if(_0x5a7e0d[_0x0858('0x5a')]['attachments']&&_0x5a7e0d[_0x0858('0x5a')]['attachments'][_0x0858('0x4a')]){for(var _0x21c207=0x0;_0x21c207<_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][_0x0858('0x4a')];_0x21c207+=0x1){_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][_0x21c207]={'filename':_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][_0x21c207]['name'],'id':_0x5a7e0d['body']['attachments'][_0x21c207]['id'],'path':path[_0x0858('0xae')](config['root'],_0x0858('0xaf'),_0x5a7e0d[_0x0858('0x5a')]['attachments'][_0x21c207][_0x0858('0xb0')])};}}return respondWithRpcPromise(_0x0858('0xb1'),_0x0858('0xb1'),{'FaxAccountId':_[_0x0858('0xb2')](_0x5a7e0d[_0x0858('0x58')]['id'])?undefined:_0x5a7e0d[_0x0858('0x58')]['id'],'path':_['isNil'](_0x5a7e0d['body']['attachments'][0x0]['path'])?undefined:_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][0x0][_0x0858('0x8')],'fax':_[_0x0858('0xb2')](_0x5a7e0d[_0x0858('0x5a')]['to'][0x0])?undefined:_0x5a7e0d[_0x0858('0x5a')]['to'][0x0]},client9002);})[_0x0858('0x35')](function(){if(_0x403ef6){if(_['isNil'](_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xb3')])){_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xb3')]=util[_0x0858('0xa6')](_0x0858('0xb4'),_0x403ef6['name'],_0x403ef6[_0x0858('0xb5')]);}if(_0x403ef6['List']){if(_0x403ef6[_0x0858('0xa8')][_0x0858('0xaa')]['length']){return _0x403ef6[_0x0858('0xa8')][_0x0858('0xaa')][0x0];}else{return db[_0x0858('0xa9')][_0x0858('0x59')](_[_0x0858('0x19')](_0x5a7e0d['body'],{'firstName':_0x5a7e0d[_0x0858('0x5a')]['to'][0x0],'phone':_0x5a7e0d['body']['to'][0x0],'fax':_0x5a7e0d['body']['to'][0x0],'ListId':_0x403ef6[_0x0858('0xb6')]}));}}else{throw new Error(_0x0858('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x0858('0x35')](function(_0x4c634b){if(_0x4c634b){return db['FaxInteraction']['find']({'where':{'ContactId':_0x4c634b['id'],'closed':![],'FaxAccountId':_0x403ef6['id']}})[_0x0858('0x35')](function(_0x2e5a28){if(_0x2e5a28){return[_0x2e5a28,![]];}return db['FaxInteraction']['create']({'UserId':_0x5a7e0d['user']['id'],'ContactId':_0x4c634b['id'],'FaxAccountId':_0x403ef6['id'],'fax':_0x5a7e0d[_0x0858('0x5a')]['to'][0x0],'firstMsgDirection':_0x0858('0xb8'),'Messages':[_[_0x0858('0x51')](_0x5a7e0d['body'],{'read':![],'body':_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][0x0][_0x0858('0xb9')],'FaxAccountId':_0x403ef6['id'],'UserId':_0x5a7e0d[_0x0858('0x5b')]['id'],'ContactId':_0x4c634b['id'],'AttachmentId':_0x5a7e0d[_0x0858('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x0858('0xa3')],'as':_0x0858('0xba')}]})[_0x0858('0x35')](function(_0x38dc94){return[_0x38dc94,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x25dae2,_0xe87c0){if(_0xe87c0){return _0x25dae2;}return db['FaxMessage'][_0x0858('0x59')]({'direction':_0x0858('0xb8'),'read':![],'body':_0x5a7e0d[_0x0858('0x5a')]['attachments'][0x0]['filename'],'FaxAccountId':_0x403ef6['id'],'FaxInteractionId':_0x25dae2['id'],'UserId':_0x5a7e0d['user']['id'],'ContactId':_0x25dae2[_0x0858('0xbb')],'AttachmentId':_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][0x0]['id']})[_0x0858('0x35')](function(_0x14ad59){_0x25dae2['dataValues']['Messages']=[];_0x25dae2['dataValues'][_0x0858('0xba')]['push'](_0x14ad59[_0x0858('0xbc')]);return _0x25dae2;});})[_0x0858('0x35')](function(_0x1be974){respondWithRpcPromise(_0x0858('0xbd'),_0x0858('0xbd'),{'FaxAccountId':_[_0x0858('0xb2')](_0x5a7e0d[_0x0858('0x58')]['id'])?undefined:_0x5a7e0d[_0x0858('0x58')]['id'],'path':_['isNil'](_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][0x0][_0x0858('0x8')])?undefined:_0x5a7e0d[_0x0858('0x5a')]['attachments'][0x0][_0x0858('0x8')],'fax':_[_0x0858('0xb2')](_0x5a7e0d['body']['to'][0x0])?undefined:_0x5a7e0d[_0x0858('0x5a')]['to'][0x0],'AttachmentId':_0x5a7e0d[_0x0858('0x5a')][_0x0858('0xad')][0x0]['id']},client9002)['then'](function(_0x3c31b3){logger[_0x0858('0x20')](_0x0858('0xbe'),_0x3c31b3);})[_0x0858('0x57')](function(_0x6f9ae7){logger[_0x0858('0x20')]('SendFaxRpc,\x20%s',_0x6f9ae7);});return _0x1be974;})['then'](respondWithResult(_0x1e56b9,null))[_0x0858('0x57')](handleError(_0x1e56b9,null));};exports['addAgents']=function(_0xe0b3aa,_0x29ff05,_0x43d220){return db[_0x0858('0x3f')]['find']({'where':{'id':_0xe0b3aa[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x29ff05,null))['then'](function(_0x2ad134){if(_0x2ad134){return _0x2ad134['addAgents'](_0xe0b3aa[_0x0858('0x5a')][_0x0858('0x71')],_[_0x0858('0x74')](_0xe0b3aa[_0x0858('0x5a')],[_0x0858('0x71'),'id'])||{})[_0x0858('0xbf')](function(_0x23a3c4){for(var _0xc95b15=0x0;_0xc95b15<_0xe0b3aa['body'][_0x0858('0x71')][_0x0858('0x4a')];_0xc95b15+=0x1){socket[_0x0858('0xc0')](_0x0858('0xc1'),{'UserId':Number(_0xe0b3aa['body'][_0x0858('0x71')][_0xc95b15]),'FaxAccountId':Number(_0xe0b3aa[_0x0858('0x58')]['id'])});}return _0x23a3c4;});}})[_0x0858('0x35')](respondWithResult(_0x29ff05,null))[_0x0858('0x57')](handleError(_0x29ff05,null));};exports[_0x0858('0xc2')]=function(_0x232112,_0x503c4b,_0x51b478){return db['FaxAccount']['find']({'where':{'id':_0x232112[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x503c4b,null))[_0x0858('0x35')](function(_0x3803fb){if(_0x3803fb){return _0x3803fb[_0x0858('0xc2')](_0x232112[_0x0858('0x45')][_0x0858('0x71')])[_0x0858('0x35')](function(){if(_[_0x0858('0xc3')](_0x232112['query'][_0x0858('0x71')])){for(var _0xf86407=0x0;_0xf86407<_0x232112['query']['ids'][_0x0858('0x4a')];_0xf86407+=0x1){socket[_0x0858('0xc0')](_0x0858('0xc4'),{'UserId':Number(_0x232112['query'][_0x0858('0x71')][_0xf86407]),'FaxAccountId':Number(_0x232112['params']['id'])});}}else{socket[_0x0858('0xc0')](_0x0858('0xc4'),{'UserId':Number(_0x232112[_0x0858('0x45')][_0x0858('0x71')]),'FaxAccountId':Number(_0x232112[_0x0858('0x58')]['id'])});}});}})[_0x0858('0x35')](respondWithStatusCode(_0x503c4b,null))[_0x0858('0x57')](handleError(_0x503c4b,null));};exports[_0x0858('0xc5')]=function(_0x5db512,_0x4459fc,_0x55a3b0){var _0x37e251={};var _0x10e58f={};var _0x159840;var _0x3bbce4;return db['FaxAccount']['findOne']({'where':{'id':_0x5db512[_0x0858('0x58')]['id']}})[_0x0858('0x35')](handleEntityNotFound(_0x4459fc,null))[_0x0858('0x35')](function(_0x2c4fa9){if(_0x2c4fa9){_0x159840=_0x2c4fa9;_0x10e58f['model']=_[_0x0858('0x46')](db[_0x0858('0x77')]['rawAttributes']);_0x10e58f[_0x0858('0x45')]=_['keys'](_0x5db512[_0x0858('0x45')]);_0x10e58f[_0x0858('0x50')]=_[_0x0858('0x47')](_0x10e58f['model'],_0x10e58f['query']);_0x37e251['attributes']=_[_0x0858('0x47')](_0x10e58f[_0x0858('0x43')],qs['fields'](_0x5db512['query'][_0x0858('0x49')]));_0x37e251[_0x0858('0x48')]=_0x37e251[_0x0858('0x48')][_0x0858('0x4a')]?_0x37e251[_0x0858('0x48')]:_0x10e58f[_0x0858('0x43')];_0x37e251[_0x0858('0x4d')]=qs[_0x0858('0x4e')](_0x5db512[_0x0858('0x45')]['sort']);_0x37e251[_0x0858('0x4f')]=qs[_0x0858('0x50')](_[_0x0858('0x6a')](_0x5db512['query'],_0x10e58f['filters']));if(_0x5db512['query'][_0x0858('0x6b')]){_0x37e251[_0x0858('0x4f')]=_[_0x0858('0x51')](_0x37e251['where'],{'$or':_['map'](_0x37e251[_0x0858('0x48')],function(_0x4ed565){var _0x3383aa={};_0x3383aa[_0x4ed565]={'$like':'%'+_0x5db512[_0x0858('0x45')][_0x0858('0x6b')]+'%'};return _0x3383aa;})});}_0x37e251=_[_0x0858('0x51')]({},_0x37e251,_0x5db512[_0x0858('0x6c')]);return _0x159840['getAgents'](_0x37e251);}})[_0x0858('0x35')](function(_0x40945b){if(_0x40945b){_0x3bbce4=_0x40945b[_0x0858('0x4a')];if(!_0x5db512[_0x0858('0x45')]['hasOwnProperty'](_0x0858('0x69'))){_0x37e251[_0x0858('0x4c')]=qs[_0x0858('0x4c')](_0x5db512[_0x0858('0x45')][_0x0858('0x4c')]);_0x37e251[_0x0858('0x2c')]=qs[_0x0858('0x2c')](_0x5db512[_0x0858('0x45')][_0x0858('0x2c')]);}return _0x159840[_0x0858('0xc5')](_0x37e251);}})['then'](function(_0x27549e){if(_0x27549e){return _0x27549e?{'count':_0x3bbce4,'rows':_0x27549e}:null;}})[_0x0858('0x35')](respondWithResult(_0x4459fc,null))[_0x0858('0x57')](handleError(_0x4459fc,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index f3b4e4e..3f85e4c 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 _0x11d1=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount'];(function(_0x5d189b,_0x5c9919){var _0x497617=function(_0x292dfd){while(--_0x292dfd){_0x5d189b['push'](_0x5d189b['shift']());}};_0x497617(++_0x5c9919);}(_0x11d1,0x130));var _0x111d=function(_0x48bdbf,_0x566109){_0x48bdbf=_0x48bdbf-0x0;var _0x14a046=_0x11d1[_0x48bdbf];return _0x14a046;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x111d('0x0'))['db'][_0x111d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x111d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x111d('0x3'),'afterDestroy':_0x111d('0x4')};function emitEvent(_0x4ef537){return function(_0x38430f,_0x3f3daa,_0x467eb0){FaxAccountEvents[_0x111d('0x5')](_0x4ef537+':'+_0x38430f['id'],_0x38430f);FaxAccountEvents['emit'](_0x4ef537,_0x38430f);_0x467eb0(null);};}for(var e in events){if(events[_0x111d('0x6')](e)){var event=events[e];FaxAccount[_0x111d('0x7')](e,emitEvent(event));}}module[_0x111d('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xf628=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','emit','hasOwnProperty'];(function(_0x1e05e9,_0x40472c){var _0x27b537=function(_0x422781){while(--_0x422781){_0x1e05e9['push'](_0x1e05e9['shift']());}};_0x27b537(++_0x40472c);}(_0xf628,0x7f));var _0x8f62=function(_0x19086c,_0xd17244){_0x19086c=_0x19086c-0x0;var _0x9fba73=_0xf628[_0x19086c];return _0x9fba73;};'use strict';var EventEmitter=require(_0x8f62('0x0'));var FaxAccount=require(_0x8f62('0x1'))['db'][_0x8f62('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8f62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393c04){return function(_0x18593f,_0x1706d2,_0x2377a5){FaxAccountEvents[_0x8f62('0x4')](_0x393c04+':'+_0x18593f['id'],_0x18593f);FaxAccountEvents['emit'](_0x393c04,_0x18593f);_0x2377a5(null);};}for(var e in events){if(events[_0x8f62('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x8f62('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2e6b200..9bd3205 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 _0xbc62=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','api','moment'];(function(_0xc9df45,_0x52cc5a){var _0x4c0640=function(_0x54791b){while(--_0x54791b){_0xc9df45['push'](_0xc9df45['shift']());}};_0x4c0640(++_0x52cc5a);}(_0xbc62,0x1c5));var _0x2bc6=function(_0x30dd54,_0x435436){_0x30dd54=_0x30dd54-0x0;var _0x8aa6a1=_0xbc62[_0x30dd54];return _0x8aa6a1;};'use strict';var _=require(_0x2bc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bc6('0x1'));var moment=require(_0x2bc6('0x2'));var BPromise=require(_0x2bc6('0x3'));var rp=require(_0x2bc6('0x4'));var fs=require('fs');var path=require(_0x2bc6('0x5'));var rimraf=require(_0x2bc6('0x6'));var config=require(_0x2bc6('0x7'));var attributes=require('./faxAccount.attributes');module[_0x2bc6('0x8')]=function(_0x2908c0,_0x1c51bb){return _0x2908c0[_0x2bc6('0x9')](_0x2bc6('0xa'),attributes,{'tableName':_0x2bc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc168=['fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc168,0xb5));var _0x8c16=function(_0x5243bb,_0x4641fb){_0x5243bb=_0x5243bb-0x0;var _0xadaa18=_0xc168[_0x5243bb];return _0xadaa18;};'use strict';var _=require(_0x8c16('0x0'));var util=require(_0x8c16('0x1'));var logger=require(_0x8c16('0x2'))(_0x8c16('0x3'));var moment=require(_0x8c16('0x4'));var BPromise=require('bluebird');var rp=require(_0x8c16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c16('0x6'));var config=require(_0x8c16('0x7'));var attributes=require(_0x8c16('0x8'));module[_0x8c16('0x9')]=function(_0x118ea2,_0x21e558){return _0x118ea2['define'](_0x8c16('0xa'),attributes,{'tableName':_0x8c16('0xb'),'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 3c7d42c..d8cd410 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 _0x1291=['FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','FaxMessage','create','ContactId','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','queueId','FaxQueue','queue','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','Contacts','DESC','FaxApplication','List','get','applications','Applications','list','priority','length'];(function(_0x42a791,_0x16ab08){var _0x28349b=function(_0xcdd279){while(--_0xcdd279){_0x42a791['push'](_0x42a791['shift']());}};_0x28349b(++_0x16ab08);}(_0x1291,0x77));var _0x1129=function(_0x47dea0,_0x1bb20e){_0x47dea0=_0x47dea0-0x0;var _0x1a8948=_0x1291[_0x47dea0];return _0x1a8948;};'use strict';var _=require(_0x1129('0x0'));var util=require('util');var moment=require(_0x1129('0x1'));var BPromise=require(_0x1129('0x2'));var rs=require(_0x1129('0x3'));var fs=require('fs');var Redis=require(_0x1129('0x4'));var db=require(_0x1129('0x5'))['db'];var utils=require(_0x1129('0x6'));var logger=require(_0x1129('0x7'))(_0x1129('0x8'));var config=require(_0x1129('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1129('0xa')][_0x1129('0xb')]({'port':0x232c});config[_0x1129('0xc')]=_[_0x1129('0xd')](config[_0x1129('0xc')],{'host':_0x1129('0xe'),'port':0x18eb});var socket=require(_0x1129('0xf'))(new Redis(config[_0x1129('0xc')]));require(_0x1129('0x10'))['register'](socket);function respondWithRpcPromise(_0x5e4630,_0x45e587,_0x4085cb){return new BPromise(function(_0x24192a,_0x17f469){return client[_0x1129('0x11')](_0x5e4630,_0x4085cb)['then'](function(_0x3aef5e){logger[_0x1129('0x12')]('FaxAccount,\x20%s,\x20%s',_0x45e587,_0x1129('0x13'));logger[_0x1129('0x14')](_0x1129('0x15'),_0x45e587,'request\x20sent',JSON[_0x1129('0x16')](_0x3aef5e));if(_0x3aef5e[_0x1129('0x17')]){if(_0x3aef5e['error'][_0x1129('0x18')]===0x1f4){logger[_0x1129('0x17')]('FaxAccount,\x20%s,\x20%s',_0x45e587,_0x3aef5e['error'][_0x1129('0x19')]);return _0x17f469(_0x3aef5e[_0x1129('0x17')]['message']);}logger[_0x1129('0x17')](_0x1129('0x1a'),_0x45e587,_0x3aef5e['error'][_0x1129('0x19')]);return _0x24192a(_0x3aef5e['error']['message']);}else{logger[_0x1129('0x12')](_0x1129('0x1a'),_0x45e587,_0x1129('0x13'));_0x24192a(_0x3aef5e[_0x1129('0x1b')][_0x1129('0x19')]);}})[_0x1129('0x1c')](function(_0x186fda){logger[_0x1129('0x17')](_0x1129('0x1a'),_0x45e587,_0x186fda);_0x17f469(_0x186fda);});});}exports[_0x1129('0x1d')]=function(_0x3838c7){var _0xfa8f54=this;return new Promise(function(_0x8f42c2,_0x1f8d15){return db[_0x1129('0x1e')][_0x1129('0x1f')]({'raw':_0x3838c7['options']?_0x3838c7[_0x1129('0x20')][_0x1129('0x21')]===undefined?!![]:![]:!![],'where':_0x3838c7[_0x1129('0x20')]?_0x3838c7[_0x1129('0x20')][_0x1129('0x22')]||null:null,'attributes':_0x3838c7[_0x1129('0x20')]?_0x3838c7[_0x1129('0x20')][_0x1129('0x23')]||null:null,'limit':_0x3838c7[_0x1129('0x20')]?_0x3838c7[_0x1129('0x20')][_0x1129('0x24')]||null:null,'include':_0x3838c7[_0x1129('0x20')]?_0x3838c7[_0x1129('0x20')][_0x1129('0x25')]?_[_0x1129('0x26')](_0x3838c7[_0x1129('0x20')][_0x1129('0x25')],function(_0x3cec12){return{'model':db[_0x3cec12['model']],'as':_0x3cec12['as'],'attributes':_0x3cec12[_0x1129('0x23')],'include':_0x3cec12[_0x1129('0x25')]?_[_0x1129('0x26')](_0x3cec12[_0x1129('0x25')],function(_0x3b12ff){return{'model':db[_0x3b12ff[_0x1129('0x27')]],'as':_0x3b12ff['as'],'attributes':_0x3b12ff[_0x1129('0x23')],'include':_0x3b12ff[_0x1129('0x25')]?_[_0x1129('0x26')](_0x3b12ff['include'],function(_0x4e3fba){return{'model':db[_0x4e3fba[_0x1129('0x27')]],'as':_0x4e3fba['as'],'attributes':_0x4e3fba[_0x1129('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1129('0x28')](function(_0x301108){logger[_0x1129('0x12')]('GetFaxAccount',_0x3838c7);logger[_0x1129('0x14')](_0x1129('0x1d'),_0x3838c7,JSON[_0x1129('0x16')](_0x301108));_0x8f42c2(_0x301108);})['catch'](function(_0xc8f0b8){logger['error'](_0x1129('0x1d'),_0xc8f0b8[_0x1129('0x19')],_0x3838c7);_0x1f8d15(_0xfa8f54[_0x1129('0x17')](0x1f4,_0xc8f0b8[_0x1129('0x19')]));});});};exports[_0x1129('0x29')]=function(_0x1d4ca6,_0x40bd4b,_0x544a1e){var _0x362fb0=this;return new Promise(function(_0x1ae034,_0x2e4402){var _0xe8ba0c={'body':_0x1d4ca6[_0x1129('0x2a')],'channel':_0x1129('0x2b')};var _0x598271=[];var _0x1998a7=[];var _0xa2a240={};return db[_0x1129('0x2c')]['describe']()[_0x1129('0x28')](function(_0x3e1515){if(!_0x3e1515){throw new db['Sequelize'][(_0x1129('0x2d'))](_0x1129('0x2e'));}_0x598271=_[_0x1129('0x2f')](_[_0x1129('0x30')](_0x3e1515),[_0x1129('0x31'),_0x1129('0x32')]);_0x1998a7=_[_0x1129('0x2f')](_[_0x1129('0x30')](_0x3e1515),[_0x1129('0x31'),'updatedAt','CompanyId',_0x1129('0x33')]);if(_0x1d4ca6['body']['id']){delete _0x1d4ca6['body']['id'];}if(_[_0x1129('0x34')](_0x1d4ca6[_0x1129('0x2a')]['from'])){throw new db['Sequelize'][(_0x1129('0x2d'))](_0x1129('0x35'));}if(_[_0x1129('0x34')](_0x1d4ca6[_0x1129('0x2a')][_0x1129('0x2a')])||_0x1d4ca6['body']['body']===''){throw new db[(_0x1129('0x36'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1129('0x34')](_0x1d4ca6['body'][_0x1129('0x37')])){throw new db['Sequelize']['ValidationError'](_0x1129('0x38')+_0x1998a7);}if(!_[_0x1129('0x39')](_0x1998a7,_0x1d4ca6[_0x1129('0x2a')]['mapKey'])){throw new db['Sequelize'][(_0x1129('0x2d'))](_0x1129('0x3a')+_0x1998a7);}_0xa2a240[_0x1d4ca6[_0x1129('0x2a')]['mapKey']]=_0x1d4ca6[_0x1129('0x2a')][_0x1129('0x3b')];})[_0x1129('0x28')](function(){return db[_0x1129('0x1e')][_0x1129('0x3c')]({'where':{'id':_0x1d4ca6[_0x1129('0x3d')]['id']},'include':[{'model':db[_0x1129('0x3e')],'as':'List','include':[{'model':db[_0x1129('0x2c')],'as':_0x1129('0x3f'),'where':_0xa2a240,'limit':0x1,'order':[['updatedAt',_0x1129('0x40')]]}]},{'model':db[_0x1129('0x41')],'as':'Applications'}]});})[_0x1129('0x28')](function(_0x426df4){if(_0x426df4&&_0x426df4[_0x1129('0x42')]){var _0x213238=_0x426df4[_0x1129('0x43')]({'plain':!![]});_0xe8ba0c[_0x1129('0x3d')]=_0x213238;_0xe8ba0c[_0x1129('0x44')]=_0x213238[_0x1129('0x45')];_0xe8ba0c[_0x1129('0x46')]=_0x213238[_0x1129('0x42')];_0xe8ba0c['applications']=_['orderBy'](_0xe8ba0c[_0x1129('0x44')],[_0x1129('0x47')],['asc']);if(_0xe8ba0c[_0x1129('0x3d')]['Applications']){delete _0xe8ba0c['account']['Applications'];}if(_0xe8ba0c['account'][_0x1129('0x42')]&&_0xe8ba0c[_0x1129('0x3d')]['List'][_0x1129('0x3f')][_0x1129('0x48')]){return _0xe8ba0c[_0x1129('0x3d')][_0x1129('0x42')][_0x1129('0x3f')][0x0];}var _0x410879=_[_0x1129('0xd')](_0x1d4ca6[_0x1129('0x2a')],{'firstName':_0x1d4ca6[_0x1129('0x2a')][_0x1129('0x3b')],'ListId':_0x213238[_0x1129('0x33')]});_0x410879[_0x1d4ca6['body'][_0x1129('0x37')]]=_0x1d4ca6[_0x1129('0x2a')][_0x1129('0x3b')];return db[_0x1129('0x2c')]['create'](_0x410879,{'fields':_0x598271,'raw':!![]});}})[_0x1129('0x28')](function(_0x41c7c6){_0xe8ba0c['contact']=_0x41c7c6;if(_0x41c7c6){var _0x588498={'ContactId':_0x41c7c6['id'],'FaxAccountId':_0x1d4ca6['account']['id'],'fax':_0x41c7c6['fax']};return db[_0x1129('0x49')][_0x1129('0x3c')]({'where':{'ContactId':_0x41c7c6['id'],'closed':![],'FaxAccountId':_0x1d4ca6[_0x1129('0x3d')]['id']}})[_0x1129('0x28')](function(_0x335f62){if(_0x335f62){return[_0x335f62,![]];}return db[_0x1129('0x49')]['create'](_0x588498)[_0x1129('0x28')](function(_0x3963fe){return[_0x3963fe,!![]];});});}else{throw new Error(_0x1129('0x4a'));}})[_0x1129('0x4b')](function(_0x4f1eaa,_0x2db42c){var _0x3e7cfd=_0x4f1eaa['get']({'plain':!![]});if(_0x2db42c){if(_0xe8ba0c[_0x1129('0x3d')][_0x1129('0x4c')]){_0xe8ba0c[_0x1129('0x44')][_0x1129('0x4d')]({'id':0x0,'priority':_0xe8ba0c[_0x1129('0x44')]['length']+0x1,'app':_0x1129('0x4e'),'appdata':_0x1129('0x4f'),'interval':_0x1129('0x50')});}_0x3e7cfd['created']=!![];}else{_0x3e7cfd['created']=![];}_0xe8ba0c[_0x1129('0x51')]=_0x3e7cfd;return db[_0x1129('0x52')][_0x1129('0x53')]({'body':_0x1d4ca6[_0x1129('0x2a')][_0x1129('0x2a')],'FaxAccountId':_0x1d4ca6[_0x1129('0x3d')]['id'],'FaxInteractionId':_0x4f1eaa['id'],'direction':'in','ContactId':_0x4f1eaa[_0x1129('0x54')],'AttachmentId':_0x1d4ca6['body'][_0x1129('0x55')]});})[_0x1129('0x28')](function(_0xb5d4ef){_0xe8ba0c[_0x1129('0x19')]=_0xb5d4ef;if(!_0xe8ba0c[_0x1129('0x51')]['UserId'])return;return db[_0x1129('0x56')][_0x1129('0x3c')]({'attributes':['id','name'],'where':{'id':_0xe8ba0c[_0x1129('0x51')][_0x1129('0x57')]}});})[_0x1129('0x28')](function(_0x1cc1c1){if(_0x1cc1c1){_0xe8ba0c['applications'][_0x1129('0x58')]({'id':0x0,'priority':0x0,'app':_0x1129('0x59'),'appdata':_0x1cc1c1[_0x1129('0x5a')]+','+(_0xe8ba0c['account'][_0x1129('0x5b')]||0xa),'interval':_0x1129('0x50')});}if(!_0xe8ba0c[_0x1129('0x51')][_0x1129('0x5c')])return;return db[_0x1129('0x5d')][_0x1129('0x3c')]({'attributes':['id',_0x1129('0x5a')],'where':{'id':_0xe8ba0c['interaction'][_0x1129('0x5c')]}});})[_0x1129('0x28')](function(_0x414cb0){if(_0x414cb0){_0xe8ba0c[_0x1129('0x44')][_0x1129('0x58')]({'id':0x0,'priority':0x1,'app':_0x1129('0x5e'),'appdata':_0x414cb0[_0x1129('0x5a')]+','+(_0xe8ba0c[_0x1129('0x3d')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x1129('0x5f'),_0xe8ba0c);})['then'](function(_0x5269c0){_0x1ae034(_0x5269c0);})[_0x1129('0x1c')](function(_0x54a9b9){_0x2e4402(_0x362fb0[_0x1129('0x17')](0x1f4,_0x54a9b9[_0x1129('0x19')]));});});}; \ No newline at end of file +var _0xde8d=['map','model','attributes','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','Contacts','applications','list','orderBy','priority','asc','Applications','length','create','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include'];(function(_0x370c46,_0x838a5d){var _0x7bfe4e=function(_0xe0d0dd){while(--_0xe0d0dd){_0x370c46['push'](_0x370c46['shift']());}};_0x7bfe4e(++_0x838a5d);}(_0xde8d,0x15f));var _0xdde8=function(_0x46c9f8,_0x299670){_0x46c9f8=_0x46c9f8-0x0;var _0xcaef7e=_0xde8d[_0x46c9f8];return _0xcaef7e;};'use strict';var _=require(_0xdde8('0x0'));var util=require(_0xdde8('0x1'));var moment=require(_0xdde8('0x2'));var BPromise=require('bluebird');var rs=require(_0xdde8('0x3'));var fs=require('fs');var Redis=require(_0xdde8('0x4'));var db=require(_0xdde8('0x5'))['db'];var utils=require(_0xdde8('0x6'));var logger=require(_0xdde8('0x7'))(_0xdde8('0x8'));var config=require(_0xdde8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdde8('0xa')][_0xdde8('0xb')]({'port':0x232c});config[_0xdde8('0xc')]=_[_0xdde8('0xd')](config['redis'],{'host':_0xdde8('0xe'),'port':0x18eb});var socket=require(_0xdde8('0xf'))(new Redis(config['redis']));require(_0xdde8('0x10'))[_0xdde8('0x11')](socket);function respondWithRpcPromise(_0xb598d7,_0x49c995,_0x45ac27){return new BPromise(function(_0x4c85ec,_0xe1ee3a){return client[_0xdde8('0x12')](_0xb598d7,_0x45ac27)[_0xdde8('0x13')](function(_0x4fa83d){logger[_0xdde8('0x14')](_0xdde8('0x15'),_0x49c995,_0xdde8('0x16'));logger[_0xdde8('0x17')](_0xdde8('0x18'),_0x49c995,_0xdde8('0x16'),JSON['stringify'](_0x4fa83d));if(_0x4fa83d[_0xdde8('0x19')]){if(_0x4fa83d[_0xdde8('0x19')][_0xdde8('0x1a')]===0x1f4){logger[_0xdde8('0x19')]('FaxAccount,\x20%s,\x20%s',_0x49c995,_0x4fa83d['error']['message']);return _0xe1ee3a(_0x4fa83d[_0xdde8('0x19')]['message']);}logger[_0xdde8('0x19')](_0xdde8('0x15'),_0x49c995,_0x4fa83d[_0xdde8('0x19')][_0xdde8('0x1b')]);return _0x4c85ec(_0x4fa83d[_0xdde8('0x19')][_0xdde8('0x1b')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x49c995,'request\x20sent');_0x4c85ec(_0x4fa83d['result'][_0xdde8('0x1b')]);}})[_0xdde8('0x1c')](function(_0x4f93d7){logger[_0xdde8('0x19')](_0xdde8('0x15'),_0x49c995,_0x4f93d7);_0xe1ee3a(_0x4f93d7);});});}exports[_0xdde8('0x1d')]=function(_0x3832c2){var _0x1b94b1=this;return new Promise(function(_0x56152d,_0x2fab64){return db[_0xdde8('0x1e')][_0xdde8('0x1f')]({'raw':_0x3832c2['options']?_0x3832c2[_0xdde8('0x20')][_0xdde8('0x21')]===undefined?!![]:![]:!![],'where':_0x3832c2['options']?_0x3832c2[_0xdde8('0x20')][_0xdde8('0x22')]||null:null,'attributes':_0x3832c2[_0xdde8('0x20')]?_0x3832c2[_0xdde8('0x20')]['attributes']||null:null,'limit':_0x3832c2['options']?_0x3832c2[_0xdde8('0x20')][_0xdde8('0x23')]||null:null,'include':_0x3832c2[_0xdde8('0x20')]?_0x3832c2[_0xdde8('0x20')][_0xdde8('0x24')]?_[_0xdde8('0x25')](_0x3832c2['options'][_0xdde8('0x24')],function(_0x28bb75){return{'model':db[_0x28bb75[_0xdde8('0x26')]],'as':_0x28bb75['as'],'attributes':_0x28bb75['attributes'],'include':_0x28bb75[_0xdde8('0x24')]?_[_0xdde8('0x25')](_0x28bb75[_0xdde8('0x24')],function(_0x3bb0a7){return{'model':db[_0x3bb0a7[_0xdde8('0x26')]],'as':_0x3bb0a7['as'],'attributes':_0x3bb0a7['attributes'],'include':_0x3bb0a7[_0xdde8('0x24')]?_['map'](_0x3bb0a7[_0xdde8('0x24')],function(_0x37255a){return{'model':db[_0x37255a['model']],'as':_0x37255a['as'],'attributes':_0x37255a[_0xdde8('0x27')]};}):[]};}):[]};}):[]:[]})[_0xdde8('0x13')](function(_0x456e63){logger['info'](_0xdde8('0x1d'),_0x3832c2);logger['debug'](_0xdde8('0x1d'),_0x3832c2,JSON[_0xdde8('0x28')](_0x456e63));_0x56152d(_0x456e63);})[_0xdde8('0x1c')](function(_0x3d28ed){logger[_0xdde8('0x19')]('GetFaxAccount',_0x3d28ed[_0xdde8('0x1b')],_0x3832c2);_0x2fab64(_0x1b94b1[_0xdde8('0x19')](0x1f4,_0x3d28ed[_0xdde8('0x1b')]));});});};exports[_0xdde8('0x29')]=function(_0x32b4b3,_0x853b65,_0x154bce){var _0x161ff7=this;return new Promise(function(_0x563456,_0x43b851){var _0x38b190={'body':_0x32b4b3[_0xdde8('0x2a')],'channel':_0xdde8('0x2b')};var _0x86f765=[];var _0x145730=[];var _0x57ddae={};return db['CmContact'][_0xdde8('0x2c')]()[_0xdde8('0x13')](function(_0xdce0b0){if(!_0xdce0b0){throw new db[(_0xdde8('0x2d'))][(_0xdde8('0x2e'))](_0xdde8('0x2f'));}_0x86f765=_['difference'](_[_0xdde8('0x30')](_0xdce0b0),['createdAt',_0xdde8('0x31')]);_0x145730=_[_0xdde8('0x32')](_[_0xdde8('0x30')](_0xdce0b0),['createdAt',_0xdde8('0x31'),'CompanyId',_0xdde8('0x33')]);if(_0x32b4b3['body']['id']){delete _0x32b4b3[_0xdde8('0x2a')]['id'];}if(_[_0xdde8('0x34')](_0x32b4b3[_0xdde8('0x2a')][_0xdde8('0x35')])){throw new db[(_0xdde8('0x2d'))][(_0xdde8('0x2e'))](_0xdde8('0x36'));}if(_[_0xdde8('0x34')](_0x32b4b3[_0xdde8('0x2a')]['body'])||_0x32b4b3[_0xdde8('0x2a')]['body']===''){throw new db[(_0xdde8('0x2d'))][(_0xdde8('0x2e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x32b4b3[_0xdde8('0x2a')][_0xdde8('0x37')])){throw new db[(_0xdde8('0x2d'))][(_0xdde8('0x2e'))](_0xdde8('0x38')+_0x145730);}if(!_[_0xdde8('0x39')](_0x145730,_0x32b4b3[_0xdde8('0x2a')][_0xdde8('0x37')])){throw new db['Sequelize'][(_0xdde8('0x2e'))](_0xdde8('0x3a')+_0x145730);}_0x57ddae[_0x32b4b3[_0xdde8('0x2a')]['mapKey']]=_0x32b4b3[_0xdde8('0x2a')][_0xdde8('0x35')];})['then'](function(){return db[_0xdde8('0x1e')][_0xdde8('0x3b')]({'where':{'id':_0x32b4b3[_0xdde8('0x3c')]['id']},'include':[{'model':db[_0xdde8('0x3d')],'as':_0xdde8('0x3e'),'include':[{'model':db[_0xdde8('0x3f')],'as':_0xdde8('0x40'),'where':_0x57ddae,'limit':0x1,'order':[[_0xdde8('0x31'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xdde8('0x13')](function(_0x37a1d4){if(_0x37a1d4&&_0x37a1d4[_0xdde8('0x3e')]){var _0x445caf=_0x37a1d4['get']({'plain':!![]});_0x38b190['account']=_0x445caf;_0x38b190[_0xdde8('0x41')]=_0x445caf['Applications'];_0x38b190[_0xdde8('0x42')]=_0x445caf['List'];_0x38b190[_0xdde8('0x41')]=_[_0xdde8('0x43')](_0x38b190[_0xdde8('0x41')],[_0xdde8('0x44')],[_0xdde8('0x45')]);if(_0x38b190[_0xdde8('0x3c')][_0xdde8('0x46')]){delete _0x38b190[_0xdde8('0x3c')]['Applications'];}if(_0x38b190[_0xdde8('0x3c')][_0xdde8('0x3e')]&&_0x38b190[_0xdde8('0x3c')][_0xdde8('0x3e')][_0xdde8('0x40')][_0xdde8('0x47')]){return _0x38b190['account']['List']['Contacts'][0x0];}var _0x347393=_['defaults'](_0x32b4b3[_0xdde8('0x2a')],{'firstName':_0x32b4b3['body'][_0xdde8('0x35')],'ListId':_0x445caf[_0xdde8('0x33')]});_0x347393[_0x32b4b3['body'][_0xdde8('0x37')]]=_0x32b4b3['body'][_0xdde8('0x35')];return db[_0xdde8('0x3f')][_0xdde8('0x48')](_0x347393,{'fields':_0x86f765,'raw':!![]});}})[_0xdde8('0x13')](function(_0x2e5780){_0x38b190['contact']=_0x2e5780;if(_0x2e5780){var _0x27d177={'ContactId':_0x2e5780['id'],'FaxAccountId':_0x32b4b3['account']['id'],'fax':_0x2e5780[_0xdde8('0x2b')]};return db[_0xdde8('0x49')]['find']({'where':{'ContactId':_0x2e5780['id'],'closed':![],'FaxAccountId':_0x32b4b3[_0xdde8('0x3c')]['id']}})[_0xdde8('0x13')](function(_0x311625){if(_0x311625){return[_0x311625,![]];}return db[_0xdde8('0x49')]['create'](_0x27d177)[_0xdde8('0x13')](function(_0x3b9afb){return[_0x3b9afb,!![]];});});}else{throw new Error(_0xdde8('0x4a'));}})[_0xdde8('0x4b')](function(_0x5adec4,_0x4b3370){var _0x23a147=_0x5adec4[_0xdde8('0x4c')]({'plain':!![]});if(_0x4b3370){if(_0x38b190[_0xdde8('0x3c')]['autoclose']){_0x38b190[_0xdde8('0x41')][_0xdde8('0x4d')]({'id':0x0,'priority':_0x38b190['applications'][_0xdde8('0x47')]+0x1,'app':_0xdde8('0x4e'),'appdata':_0xdde8('0x4f'),'interval':_0xdde8('0x50')});}_0x23a147[_0xdde8('0x51')]=!![];}else{_0x23a147['created']=![];}_0x38b190[_0xdde8('0x52')]=_0x23a147;return db[_0xdde8('0x53')][_0xdde8('0x48')]({'body':_0x32b4b3[_0xdde8('0x2a')]['body'],'FaxAccountId':_0x32b4b3[_0xdde8('0x3c')]['id'],'FaxInteractionId':_0x5adec4['id'],'direction':'in','ContactId':_0x5adec4[_0xdde8('0x54')],'AttachmentId':_0x32b4b3[_0xdde8('0x2a')][_0xdde8('0x55')]});})[_0xdde8('0x13')](function(_0x4f114f){_0x38b190[_0xdde8('0x1b')]=_0x4f114f;if(!_0x38b190[_0xdde8('0x52')][_0xdde8('0x56')])return;return db['User']['find']({'attributes':['id',_0xdde8('0x57')],'where':{'id':_0x38b190[_0xdde8('0x52')][_0xdde8('0x56')]}});})[_0xdde8('0x13')](function(_0x29a8d4){if(_0x29a8d4){_0x38b190['applications'][_0xdde8('0x58')]({'id':0x0,'priority':0x0,'app':_0xdde8('0x59'),'appdata':_0x29a8d4[_0xdde8('0x57')]+','+(_0x38b190[_0xdde8('0x3c')][_0xdde8('0x5a')]||0xa),'interval':_0xdde8('0x50')});}if(!_0x38b190['interaction'][_0xdde8('0x5b')])return;return db[_0xdde8('0x5c')][_0xdde8('0x3b')]({'attributes':['id',_0xdde8('0x57')],'where':{'id':_0x38b190['interaction'][_0xdde8('0x5b')]}});})[_0xdde8('0x13')](function(_0x5468a2){if(_0x5468a2){_0x38b190[_0xdde8('0x41')][_0xdde8('0x58')]({'id':0x0,'priority':0x1,'app':_0xdde8('0x5d'),'appdata':_0x5468a2['name']+','+(_0x38b190['account'][_0xdde8('0x5e')]||0x12c),'interval':_0xdde8('0x50')});}return respondWithRpcPromise(_0xdde8('0x5f'),_0xdde8('0x60'),_0x38b190);})[_0xdde8('0x13')](function(_0x247311){_0x563456(_0x247311);})[_0xdde8('0x1c')](function(_0x1f21b5){_0x43b851(_0x161ff7['error'](0x1f4,_0x1f21b5[_0xdde8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 4864946..a3e100d 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 _0x5557=['faxAccount:','./faxAccount.events','update','emit','removeListener','length'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x5557,0x115));var _0x7555=function(_0x45952b,_0x562ce3){_0x45952b=_0x45952b-0x0;var _0x5bf906=_0x5557[_0x45952b];return _0x5bf906;};'use strict';var FaxAccountEvents=require(_0x7555('0x0'));var events=['save','remove',_0x7555('0x1')];function createListener(_0x5c8564,_0x299f2c){return function(_0x1f235b){_0x299f2c[_0x7555('0x2')](_0x5c8564,_0x1f235b);};}function removeListener(_0x427f04,_0x188984){return function(){FaxAccountEvents[_0x7555('0x3')](_0x427f04,_0x188984);};}exports['register']=function(_0x18376e){for(var _0x509918=0x0,_0x1c1bb3=events[_0x7555('0x4')];_0x509918<_0x1c1bb3;_0x509918++){var _0x2c688f=events[_0x509918];var _0x246496=createListener(_0x7555('0x5')+_0x2c688f,_0x18376e);FaxAccountEvents['on'](_0x2c688f,_0x246496);}}; \ No newline at end of file +var _0x9f68=['./faxAccount.events','save','remove','update','emit','removeListener','length','faxAccount:'];(function(_0x303401,_0xb09078){var _0x3a753d=function(_0x50ac59){while(--_0x50ac59){_0x303401['push'](_0x303401['shift']());}};_0x3a753d(++_0xb09078);}(_0x9f68,0x1c8));var _0x89f6=function(_0x346fc2,_0x4d3f8f){_0x346fc2=_0x346fc2-0x0;var _0x385a5e=_0x9f68[_0x346fc2];return _0x385a5e;};'use strict';var FaxAccountEvents=require(_0x89f6('0x0'));var events=[_0x89f6('0x1'),_0x89f6('0x2'),_0x89f6('0x3')];function createListener(_0x50ee25,_0x390710){return function(_0x43f449){_0x390710[_0x89f6('0x4')](_0x50ee25,_0x43f449);};}function removeListener(_0x12ae4a,_0x1d87d4){return function(){FaxAccountEvents[_0x89f6('0x5')](_0x12ae4a,_0x1d87d4);};}exports['register']=function(_0x31616d){for(var _0x5f515f=0x0,_0x4d9013=events[_0x89f6('0x6')];_0x5f515f<_0x4d9013;_0x5f515f++){var _0x1b627e=events[_0x5f515f];var _0x1fd6a0=createListener(_0x89f6('0x7')+_0x1b627e,_0x31616d);FaxAccountEvents['on'](_0x1b627e,_0x1fd6a0);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 92a2011..14ba910 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 _0x5c28=['getAgents','post','create','addDisposition','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/users'];(function(_0x3c0ccd,_0x1e1335){var _0x23231c=function(_0x38d8e6){while(--_0x38d8e6){_0x3c0ccd['push'](_0x3c0ccd['shift']());}};_0x23231c(++_0x1e1335);}(_0x5c28,0xe4));var _0x85c2=function(_0x17d5d5,_0x481de7){_0x17d5d5=_0x17d5d5-0x0;var _0x5618d0=_0x5c28[_0x17d5d5];return _0x5618d0;};'use strict';var multer=require(_0x85c2('0x0'));var util=require(_0x85c2('0x1'));var path=require(_0x85c2('0x2'));var timeout=require(_0x85c2('0x3'));var express=require('express');var router=express[_0x85c2('0x4')]();var fs_extra=require(_0x85c2('0x5'));var auth=require(_0x85c2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x85c2('0x7'));router[_0x85c2('0x8')]('/',auth[_0x85c2('0x9')](),controller[_0x85c2('0xa')]);router['get'](_0x85c2('0xb'),auth[_0x85c2('0x9')](),controller[_0x85c2('0xc')]);router[_0x85c2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x85c2('0xd')]);router[_0x85c2('0x8')](_0x85c2('0xe'),auth['isAuthenticated'](),controller[_0x85c2('0xf')]);router['get'](_0x85c2('0x10'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x11')]);router[_0x85c2('0x8')](_0x85c2('0x12'),auth['isAuthenticated'](),controller[_0x85c2('0x13')]);router[_0x85c2('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x85c2('0x14')]);router[_0x85c2('0x8')](_0x85c2('0x15'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x16')]);router[_0x85c2('0x8')](_0x85c2('0x17'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x18')]);router[_0x85c2('0x19')]('/',auth[_0x85c2('0x9')](),controller[_0x85c2('0x1a')]);router[_0x85c2('0x19')](_0x85c2('0xe'),auth['isAuthenticated'](),controller[_0x85c2('0x1b')]);router[_0x85c2('0x19')](_0x85c2('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/:id/interactions',auth[_0x85c2('0x9')](),controller['addInteraction']);router[_0x85c2('0x19')]('/:id/applications',auth[_0x85c2('0x9')](),controller['addApplications']);router['post'](_0x85c2('0x1c'),auth['isAuthenticated'](),controller[_0x85c2('0x1d')]);router[_0x85c2('0x19')]('/updateaccountapplications',auth[_0x85c2('0x9')](),controller[_0x85c2('0x1e')]);router[_0x85c2('0x19')](_0x85c2('0x1f'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x20')]);router['post'](_0x85c2('0x17'),auth['isAuthenticated'](),controller[_0x85c2('0x21')]);router[_0x85c2('0x22')](_0x85c2('0x23'),auth['isAuthenticated'](),controller['update']);router[_0x85c2('0x24')](_0x85c2('0x23'),auth['isAuthenticated'](),controller[_0x85c2('0x25')]);router[_0x85c2('0x24')](_0x85c2('0xe'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x26')]);router[_0x85c2('0x24')](_0x85c2('0x10'),auth[_0x85c2('0x9')](),controller[_0x85c2('0x27')]);router[_0x85c2('0x24')](_0x85c2('0x17'),auth['isAuthenticated'](),controller[_0x85c2('0x28')]);module[_0x85c2('0x29')]=router; \ No newline at end of file +var _0x0188=['getAgents','post','create','/:id/dispositions','/:id/interactions','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users'];(function(_0x7543a1,_0x11659f){var _0xd420a0=function(_0x360fb5){while(--_0x360fb5){_0x7543a1['push'](_0x7543a1['shift']());}};_0xd420a0(++_0x11659f);}(_0x0188,0xfd));var _0x8018=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x0188[_0x13ce0c];return _0x4388fb;};'use strict';var multer=require(_0x8018('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8018('0x1'));var router=express[_0x8018('0x2')]();var fs_extra=require(_0x8018('0x3'));var auth=require(_0x8018('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8018('0x5'));router[_0x8018('0x6')]('/',auth['isAuthenticated'](),controller[_0x8018('0x7')]);router['get'](_0x8018('0x8'),auth[_0x8018('0x9')](),controller[_0x8018('0xa')]);router[_0x8018('0x6')](_0x8018('0xb'),auth[_0x8018('0x9')](),controller[_0x8018('0xc')]);router[_0x8018('0x6')]('/:id/dispositions',auth[_0x8018('0x9')](),controller[_0x8018('0xd')]);router[_0x8018('0x6')](_0x8018('0xe'),auth[_0x8018('0x9')](),controller['getAnswers']);router[_0x8018('0x6')]('/:id/interactions',auth[_0x8018('0x9')](),controller['getInteractions']);router[_0x8018('0x6')](_0x8018('0xf'),auth['isAuthenticated'](),controller[_0x8018('0x10')]);router[_0x8018('0x6')](_0x8018('0x11'),auth[_0x8018('0x9')](),controller[_0x8018('0x12')]);router[_0x8018('0x6')](_0x8018('0x13'),auth[_0x8018('0x9')](),controller[_0x8018('0x14')]);router[_0x8018('0x15')]('/',auth['isAuthenticated'](),controller[_0x8018('0x16')]);router['post'](_0x8018('0x17'),auth[_0x8018('0x9')](),controller['addDisposition']);router['post'](_0x8018('0xe'),auth[_0x8018('0x9')](),controller['addAnswer']);router['post'](_0x8018('0x18'),auth[_0x8018('0x9')](),controller[_0x8018('0x19')]);router[_0x8018('0x15')](_0x8018('0xf'),auth['isAuthenticated'](),controller[_0x8018('0x1a')]);router[_0x8018('0x15')](_0x8018('0x1b'),auth[_0x8018('0x9')](),controller[_0x8018('0x1c')]);router[_0x8018('0x15')](_0x8018('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router['post']('/:id/send',auth[_0x8018('0x9')](),controller[_0x8018('0x1e')]);router[_0x8018('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x8018('0x1f')]);router[_0x8018('0x20')](_0x8018('0xb'),auth[_0x8018('0x9')](),controller[_0x8018('0x21')]);router[_0x8018('0x22')](_0x8018('0xb'),auth[_0x8018('0x9')](),controller[_0x8018('0x23')]);router[_0x8018('0x22')]('/:id/dispositions',auth[_0x8018('0x9')](),controller[_0x8018('0x24')]);router[_0x8018('0x22')](_0x8018('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8018('0x22')](_0x8018('0x13'),auth[_0x8018('0x9')](),controller[_0x8018('0x25')]);module[_0x8018('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 903f32a..708834e 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 _0x820c=['sequelize','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x820c,0x8c));var _0xc820=function(_0x53843e,_0x5a91f5){_0x53843e=_0x53843e-0x0;var _0x188c68=_0x820c[_0x53843e];return _0x188c68;};'use strict';var Sequelize=require(_0xc820('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc820('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc820('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc820('0x3')],'defaultValue':_0xc820('0x4')}}; \ No newline at end of file +var _0x6df1=['TEXT','sequelize','STRING','noop'];(function(_0x29c047,_0x45c350){var _0x2cbd8a=function(_0x1e133b){while(--_0x1e133b){_0x29c047['push'](_0x29c047['shift']());}};_0x2cbd8a(++_0x45c350);}(_0x6df1,0x1a1));var _0x16df=function(_0x25e7ee,_0x4d8966){_0x25e7ee=_0x25e7ee-0x0;var _0x1251f2=_0x6df1[_0x25e7ee];return _0x1251f2;};'use strict';var Sequelize=require(_0x16df('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x16df('0x1')],'allowNull':![],'defaultValue':_0x16df('0x2')},'appdata':{'type':Sequelize[_0x16df('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x16df('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 525f45f..f7d0da6 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 _0x1041=['then','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','map','FaxApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL'];(function(_0x5b116a,_0x4396ac){var _0x28629f=function(_0x3964cd){while(--_0x3964cd){_0x5b116a['push'](_0x5b116a['shift']());}};_0x28629f(++_0x4396ac);}(_0x1041,0x9c));var _0x1104=function(_0x21bb01,_0x4988f2){_0x21bb01=_0x21bb01-0x0;var _0x4a8035=_0x1041[_0x21bb01];return _0x4a8035;};'use strict';var emlformat=require(_0x1104('0x0'));var rimraf=require(_0x1104('0x1'));var zipdir=require(_0x1104('0x2'));var jsonpatch=require(_0x1104('0x3'));var rp=require(_0x1104('0x4'));var moment=require(_0x1104('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1104('0x6'));var util=require(_0x1104('0x7'));var path=require(_0x1104('0x8'));var sox=require(_0x1104('0x9'));var csv=require('to-csv');var ejs=require(_0x1104('0xa'));var fs=require('fs');var fs_extra=require(_0x1104('0xb'));var _=require(_0x1104('0xc'));var squel=require(_0x1104('0xd'));var crypto=require('crypto');var jsforce=require(_0x1104('0xe'));var deskjs=require(_0x1104('0xf'));var toCsv=require(_0x1104('0x10'));var querystring=require(_0x1104('0x11'));var Papa=require(_0x1104('0x12'));var Redis=require(_0x1104('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1104('0x14'));var as=require(_0x1104('0x15'));var hardwareService=require(_0x1104('0x16'));var logger=require(_0x1104('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1104('0x18'))['db'];function respondWithStatusCode(_0x482f40,_0x118eb9){_0x118eb9=_0x118eb9||0xcc;return function(_0x2305c3){if(_0x2305c3){return _0x482f40['sendStatus'](_0x118eb9);}return _0x482f40[_0x1104('0x19')](_0x118eb9)[_0x1104('0x1a')]();};}function respondWithResult(_0x24a7dd,_0x47b095){_0x47b095=_0x47b095||0xc8;return function(_0x4a15c7){if(_0x4a15c7){return _0x24a7dd[_0x1104('0x19')](_0x47b095)[_0x1104('0x1b')](_0x4a15c7);}};}function respondWithFilteredResult(_0x313ff3,_0x2679eb){return function(_0x2350a0){if(_0x2350a0){var _0x39b354=typeof _0x2679eb[_0x1104('0x1c')]===_0x1104('0x1d')&&typeof _0x2679eb[_0x1104('0x1e')]===_0x1104('0x1d');var _0x58abfb=_0x2350a0[_0x1104('0x1f')];var _0x4e359e=_0x39b354?0x0:_0x2679eb[_0x1104('0x1c')];var _0x3e0a0b=_0x39b354?_0x2350a0['count']:_0x2679eb['offset']+_0x2679eb[_0x1104('0x1e')];var _0xd93c32;if(_0x3e0a0b>=_0x58abfb){_0x3e0a0b=_0x58abfb;_0xd93c32=0xc8;}else{_0xd93c32=0xce;}_0x313ff3[_0x1104('0x19')](_0xd93c32);return _0x313ff3[_0x1104('0x20')](_0x1104('0x21'),_0x4e359e+'-'+_0x3e0a0b+'/'+_0x58abfb)['json'](_0x2350a0);}return null;};}function patchUpdates(_0x418a09){return function(_0x20c7e4){try{jsonpatch[_0x1104('0x22')](_0x20c7e4,_0x418a09,!![]);}catch(_0x922346){return BPromise[_0x1104('0x23')](_0x922346);}return _0x20c7e4['save']();};}function saveUpdates(_0x5d197b,_0x58af14){return function(_0x248c9e){if(_0x248c9e){return _0x248c9e[_0x1104('0x24')](_0x5d197b)['then'](function(_0xfe116){return _0xfe116;});}return null;};}function removeEntity(_0x3ef180,_0x5a8460){return function(_0x295bda){if(_0x295bda){return _0x295bda[_0x1104('0x25')]()['then'](function(){_0x3ef180[_0x1104('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x421814,_0x16a523){return function(_0x5acfdb){if(!_0x5acfdb){_0x421814[_0x1104('0x26')](0x194);}return _0x5acfdb;};}function handleError(_0x46f323,_0x7ffa95){_0x7ffa95=_0x7ffa95||0x1f4;return function(_0x4e8951){logger['error'](_0x4e8951[_0x1104('0x27')]);if(_0x4e8951[_0x1104('0x28')]){delete _0x4e8951[_0x1104('0x28')];}_0x46f323['status'](_0x7ffa95)['send'](_0x4e8951);};}exports[_0x1104('0x29')]=function(_0x1c9e88,_0x783e63){var _0x52e1e1={},_0x3ae821={},_0x183244={'count':0x0,'rows':[]};var _0x5a8813=_[_0x1104('0x2a')](db[_0x1104('0x2b')]['rawAttributes'],function(_0x315e93){return{'name':_0x315e93[_0x1104('0x2c')],'type':_0x315e93[_0x1104('0x2d')]['key']};});_0x3ae821[_0x1104('0x2e')]=_[_0x1104('0x2a')](_0x5a8813,_0x1104('0x28'));_0x3ae821[_0x1104('0x2f')]=_[_0x1104('0x30')](_0x1c9e88['query']);_0x3ae821[_0x1104('0x31')]=_[_0x1104('0x32')](_0x3ae821[_0x1104('0x2e')],_0x3ae821['query']);_0x52e1e1[_0x1104('0x33')]=_[_0x1104('0x32')](_0x3ae821[_0x1104('0x2e')],qs[_0x1104('0x34')](_0x1c9e88[_0x1104('0x2f')]['fields']));_0x52e1e1[_0x1104('0x33')]=_0x52e1e1['attributes'][_0x1104('0x35')]?_0x52e1e1[_0x1104('0x33')]:_0x3ae821[_0x1104('0x2e')];if(!_0x1c9e88[_0x1104('0x2f')]['hasOwnProperty']('nolimit')){_0x52e1e1[_0x1104('0x1e')]=qs[_0x1104('0x1e')](_0x1c9e88['query'][_0x1104('0x1e')]);_0x52e1e1['offset']=qs['offset'](_0x1c9e88[_0x1104('0x2f')][_0x1104('0x1c')]);}_0x52e1e1[_0x1104('0x36')]=qs[_0x1104('0x37')](_0x1c9e88[_0x1104('0x2f')][_0x1104('0x37')]);_0x52e1e1[_0x1104('0x38')]=qs[_0x1104('0x31')](_['pick'](_0x1c9e88['query'],_0x3ae821[_0x1104('0x31')]),_0x5a8813);if(_0x1c9e88[_0x1104('0x2f')][_0x1104('0x39')]){_0x52e1e1[_0x1104('0x38')]=_[_0x1104('0x3a')](_0x52e1e1[_0x1104('0x38')],{'$or':_[_0x1104('0x2a')](_0x5a8813,function(_0x38f5d1){if(_0x38f5d1[_0x1104('0x2d')]!==_0x1104('0x3b')){var _0x556f31={};_0x556f31[_0x38f5d1[_0x1104('0x28')]]={'$like':'%'+_0x1c9e88[_0x1104('0x2f')][_0x1104('0x39')]+'%'};return _0x556f31;}})});}_0x52e1e1=_[_0x1104('0x3a')]({},_0x52e1e1,_0x1c9e88['options']);var _0x419fee={'where':_0x52e1e1[_0x1104('0x38')]};return db[_0x1104('0x2b')][_0x1104('0x1f')](_0x419fee)[_0x1104('0x3c')](function(_0x4e7405){_0x183244[_0x1104('0x1f')]=_0x4e7405;if(_0x1c9e88[_0x1104('0x2f')][_0x1104('0x3d')]){_0x52e1e1[_0x1104('0x3e')]=[{'all':!![]}];}return db['FaxApplication'][_0x1104('0x3f')](_0x52e1e1);})[_0x1104('0x3c')](function(_0x2cd881){_0x183244[_0x1104('0x40')]=_0x2cd881;return _0x183244;})[_0x1104('0x3c')](respondWithFilteredResult(_0x783e63,_0x52e1e1))[_0x1104('0x41')](handleError(_0x783e63,null));};exports['show']=function(_0x2f9ede,_0x52d2ae){var _0x39ae03={'raw':!![],'where':{'id':_0x2f9ede[_0x1104('0x42')]['id']}},_0x588137={};_0x588137[_0x1104('0x2e')]=_[_0x1104('0x30')](db[_0x1104('0x2b')][_0x1104('0x43')]);_0x588137[_0x1104('0x2f')]=_[_0x1104('0x30')](_0x2f9ede['query']);_0x588137[_0x1104('0x31')]=_[_0x1104('0x32')](_0x588137['model'],_0x588137[_0x1104('0x2f')]);_0x39ae03[_0x1104('0x33')]=_[_0x1104('0x32')](_0x588137[_0x1104('0x2e')],qs[_0x1104('0x34')](_0x2f9ede[_0x1104('0x2f')][_0x1104('0x34')]));_0x39ae03['attributes']=_0x39ae03[_0x1104('0x33')][_0x1104('0x35')]?_0x39ae03[_0x1104('0x33')]:_0x588137[_0x1104('0x2e')];if(_0x2f9ede[_0x1104('0x2f')][_0x1104('0x3d')]){_0x39ae03[_0x1104('0x3e')]=[{'all':!![]}];}_0x39ae03=_[_0x1104('0x3a')]({},_0x39ae03,_0x2f9ede[_0x1104('0x44')]);return db[_0x1104('0x2b')][_0x1104('0x45')](_0x39ae03)[_0x1104('0x3c')](handleEntityNotFound(_0x52d2ae,null))[_0x1104('0x3c')](respondWithResult(_0x52d2ae,null))[_0x1104('0x41')](handleError(_0x52d2ae,null));};exports[_0x1104('0x46')]=function(_0x32fd09,_0x5a703d){return db['FaxApplication'][_0x1104('0x46')](_0x32fd09[_0x1104('0x47')],{})[_0x1104('0x3c')](respondWithResult(_0x5a703d,0xc9))[_0x1104('0x41')](handleError(_0x5a703d,null));};exports[_0x1104('0x24')]=function(_0x1f7bc1,_0x5dbbad){if(_0x1f7bc1['body']['id']){delete _0x1f7bc1[_0x1104('0x47')]['id'];}return db[_0x1104('0x2b')][_0x1104('0x45')]({'where':{'id':_0x1f7bc1[_0x1104('0x42')]['id']}})[_0x1104('0x3c')](handleEntityNotFound(_0x5dbbad,null))[_0x1104('0x3c')](saveUpdates(_0x1f7bc1['body'],null))[_0x1104('0x3c')](respondWithResult(_0x5dbbad,null))[_0x1104('0x41')](handleError(_0x5dbbad,null));};exports[_0x1104('0x25')]=function(_0x5232d5,_0x47468d){return db[_0x1104('0x2b')][_0x1104('0x45')]({'where':{'id':_0x5232d5[_0x1104('0x42')]['id']}})[_0x1104('0x3c')](handleEntityNotFound(_0x47468d,null))[_0x1104('0x3c')](removeEntity(_0x47468d,null))['catch'](handleError(_0x47468d,null));}; \ No newline at end of file +var _0xdbe6=['offset','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5bf609,_0x5c1e35){var _0x3c3a74=function(_0x538a50){while(--_0x538a50){_0x5bf609['push'](_0x5bf609['shift']());}};_0x3c3a74(++_0x5c1e35);}(_0xdbe6,0x11b));var _0x6dbe=function(_0x7853aa,_0x340aa6){_0x7853aa=_0x7853aa-0x0;var _0x59c9f7=_0xdbe6[_0x7853aa];return _0x59c9f7;};'use strict';var emlformat=require(_0x6dbe('0x0'));var rimraf=require(_0x6dbe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dbe('0x2'));var rp=require(_0x6dbe('0x3'));var moment=require('moment');var BPromise=require(_0x6dbe('0x4'));var Mustache=require(_0x6dbe('0x5'));var util=require(_0x6dbe('0x6'));var path=require(_0x6dbe('0x7'));var sox=require(_0x6dbe('0x8'));var csv=require(_0x6dbe('0x9'));var ejs=require(_0x6dbe('0xa'));var fs=require('fs');var fs_extra=require(_0x6dbe('0xb'));var _=require(_0x6dbe('0xc'));var squel=require('squel');var crypto=require(_0x6dbe('0xd'));var jsforce=require(_0x6dbe('0xe'));var deskjs=require(_0x6dbe('0xf'));var toCsv=require(_0x6dbe('0x9'));var querystring=require(_0x6dbe('0x10'));var Papa=require(_0x6dbe('0x11'));var Redis=require(_0x6dbe('0x12'));var authService=require(_0x6dbe('0x13'));var qs=require(_0x6dbe('0x14'));var as=require(_0x6dbe('0x15'));var hardwareService=require(_0x6dbe('0x16'));var logger=require(_0x6dbe('0x17'))(_0x6dbe('0x18'));var utils=require(_0x6dbe('0x19'));var config=require(_0x6dbe('0x1a'));var licenseUtil=require(_0x6dbe('0x1b'));var db=require(_0x6dbe('0x1c'))['db'];function respondWithStatusCode(_0x4df248,_0x41e47b){_0x41e47b=_0x41e47b||0xcc;return function(_0x354c1c){if(_0x354c1c){return _0x4df248[_0x6dbe('0x1d')](_0x41e47b);}return _0x4df248[_0x6dbe('0x1e')](_0x41e47b)[_0x6dbe('0x1f')]();};}function respondWithResult(_0x56f576,_0x53db6c){_0x53db6c=_0x53db6c||0xc8;return function(_0x2e98ff){if(_0x2e98ff){return _0x56f576['status'](_0x53db6c)[_0x6dbe('0x20')](_0x2e98ff);}};}function respondWithFilteredResult(_0x19e2d4,_0x499832){return function(_0x440efb){if(_0x440efb){var _0x37e4a4=typeof _0x499832['offset']==='undefined'&&typeof _0x499832['limit']==='undefined';var _0x424be2=_0x440efb['count'];var _0x402287=_0x37e4a4?0x0:_0x499832[_0x6dbe('0x21')];var _0x393ef7=_0x37e4a4?_0x440efb[_0x6dbe('0x22')]:_0x499832[_0x6dbe('0x21')]+_0x499832[_0x6dbe('0x23')];var _0xf123e5;if(_0x393ef7>=_0x424be2){_0x393ef7=_0x424be2;_0xf123e5=0xc8;}else{_0xf123e5=0xce;}_0x19e2d4[_0x6dbe('0x1e')](_0xf123e5);return _0x19e2d4[_0x6dbe('0x24')](_0x6dbe('0x25'),_0x402287+'-'+_0x393ef7+'/'+_0x424be2)[_0x6dbe('0x20')](_0x440efb);}return null;};}function patchUpdates(_0x2112e8){return function(_0x31c74d){try{jsonpatch[_0x6dbe('0x26')](_0x31c74d,_0x2112e8,!![]);}catch(_0x172516){return BPromise[_0x6dbe('0x27')](_0x172516);}return _0x31c74d[_0x6dbe('0x28')]();};}function saveUpdates(_0x3df44a,_0x5a1a98){return function(_0x47bdbe){if(_0x47bdbe){return _0x47bdbe[_0x6dbe('0x29')](_0x3df44a)[_0x6dbe('0x2a')](function(_0x2a18a7){return _0x2a18a7;});}return null;};}function removeEntity(_0x53cc91,_0x17ab53){return function(_0x40eb86){if(_0x40eb86){return _0x40eb86['destroy']()[_0x6dbe('0x2a')](function(){_0x53cc91[_0x6dbe('0x1e')](0xcc)[_0x6dbe('0x1f')]();});}};}function handleEntityNotFound(_0x2025ae,_0x712f3e){return function(_0x5b84e1){if(!_0x5b84e1){_0x2025ae['sendStatus'](0x194);}return _0x5b84e1;};}function handleError(_0x454557,_0x2b4c7c){_0x2b4c7c=_0x2b4c7c||0x1f4;return function(_0x32633f){logger[_0x6dbe('0x2b')](_0x32633f['stack']);if(_0x32633f[_0x6dbe('0x2c')]){delete _0x32633f[_0x6dbe('0x2c')];}_0x454557['status'](_0x2b4c7c)['send'](_0x32633f);};}exports[_0x6dbe('0x2d')]=function(_0x27f931,_0x391237){var _0x4fdabd={},_0x55b3c9={},_0x36337c={'count':0x0,'rows':[]};var _0x1c031a=_['map'](db[_0x6dbe('0x2e')][_0x6dbe('0x2f')],function(_0x370bcf){return{'name':_0x370bcf[_0x6dbe('0x30')],'type':_0x370bcf[_0x6dbe('0x31')][_0x6dbe('0x32')]};});_0x55b3c9['model']=_[_0x6dbe('0x33')](_0x1c031a,_0x6dbe('0x2c'));_0x55b3c9[_0x6dbe('0x34')]=_[_0x6dbe('0x35')](_0x27f931[_0x6dbe('0x34')]);_0x55b3c9['filters']=_['intersection'](_0x55b3c9[_0x6dbe('0x36')],_0x55b3c9[_0x6dbe('0x34')]);_0x4fdabd[_0x6dbe('0x37')]=_[_0x6dbe('0x38')](_0x55b3c9[_0x6dbe('0x36')],qs[_0x6dbe('0x39')](_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x39')]));_0x4fdabd['attributes']=_0x4fdabd[_0x6dbe('0x37')][_0x6dbe('0x3a')]?_0x4fdabd[_0x6dbe('0x37')]:_0x55b3c9['model'];if(!_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x3b')](_0x6dbe('0x3c'))){_0x4fdabd[_0x6dbe('0x23')]=qs[_0x6dbe('0x23')](_0x27f931[_0x6dbe('0x34')]['limit']);_0x4fdabd[_0x6dbe('0x21')]=qs[_0x6dbe('0x21')](_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x21')]);}_0x4fdabd[_0x6dbe('0x3d')]=qs[_0x6dbe('0x3e')](_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x3e')]);_0x4fdabd[_0x6dbe('0x3f')]=qs[_0x6dbe('0x40')](_['pick'](_0x27f931['query'],_0x55b3c9['filters']),_0x1c031a);if(_0x27f931['query'][_0x6dbe('0x41')]){_0x4fdabd[_0x6dbe('0x3f')]=_['merge'](_0x4fdabd[_0x6dbe('0x3f')],{'$or':_[_0x6dbe('0x33')](_0x1c031a,function(_0x1054a1){if(_0x1054a1['type']!==_0x6dbe('0x42')){var _0x58db23={};_0x58db23[_0x1054a1[_0x6dbe('0x2c')]]={'$like':'%'+_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x41')]+'%'};return _0x58db23;}})});}_0x4fdabd=_[_0x6dbe('0x43')]({},_0x4fdabd,_0x27f931['options']);var _0xbacb7={'where':_0x4fdabd[_0x6dbe('0x3f')]};return db[_0x6dbe('0x2e')][_0x6dbe('0x22')](_0xbacb7)['then'](function(_0x5a9050){_0x36337c['count']=_0x5a9050;if(_0x27f931[_0x6dbe('0x34')][_0x6dbe('0x44')]){_0x4fdabd['include']=[{'all':!![]}];}return db['FaxApplication'][_0x6dbe('0x45')](_0x4fdabd);})[_0x6dbe('0x2a')](function(_0x1a0b75){_0x36337c[_0x6dbe('0x46')]=_0x1a0b75;return _0x36337c;})[_0x6dbe('0x2a')](respondWithFilteredResult(_0x391237,_0x4fdabd))['catch'](handleError(_0x391237,null));};exports[_0x6dbe('0x47')]=function(_0x5f0516,_0x40edf3){var _0x3cb211={'raw':!![],'where':{'id':_0x5f0516[_0x6dbe('0x48')]['id']}},_0x1c132f={};_0x1c132f[_0x6dbe('0x36')]=_[_0x6dbe('0x35')](db[_0x6dbe('0x2e')][_0x6dbe('0x2f')]);_0x1c132f[_0x6dbe('0x34')]=_[_0x6dbe('0x35')](_0x5f0516[_0x6dbe('0x34')]);_0x1c132f[_0x6dbe('0x40')]=_[_0x6dbe('0x38')](_0x1c132f[_0x6dbe('0x36')],_0x1c132f[_0x6dbe('0x34')]);_0x3cb211[_0x6dbe('0x37')]=_[_0x6dbe('0x38')](_0x1c132f['model'],qs[_0x6dbe('0x39')](_0x5f0516['query'][_0x6dbe('0x39')]));_0x3cb211['attributes']=_0x3cb211[_0x6dbe('0x37')][_0x6dbe('0x3a')]?_0x3cb211[_0x6dbe('0x37')]:_0x1c132f['model'];if(_0x5f0516['query']['includeAll']){_0x3cb211[_0x6dbe('0x49')]=[{'all':!![]}];}_0x3cb211=_[_0x6dbe('0x43')]({},_0x3cb211,_0x5f0516[_0x6dbe('0x4a')]);return db[_0x6dbe('0x2e')]['find'](_0x3cb211)[_0x6dbe('0x2a')](handleEntityNotFound(_0x40edf3,null))[_0x6dbe('0x2a')](respondWithResult(_0x40edf3,null))[_0x6dbe('0x4b')](handleError(_0x40edf3,null));};exports[_0x6dbe('0x4c')]=function(_0x159eda,_0x546bca){return db[_0x6dbe('0x2e')][_0x6dbe('0x4c')](_0x159eda[_0x6dbe('0x4d')],{})['then'](respondWithResult(_0x546bca,0xc9))['catch'](handleError(_0x546bca,null));};exports[_0x6dbe('0x29')]=function(_0x3d4906,_0x39365a){if(_0x3d4906[_0x6dbe('0x4d')]['id']){delete _0x3d4906[_0x6dbe('0x4d')]['id'];}return db[_0x6dbe('0x2e')]['find']({'where':{'id':_0x3d4906[_0x6dbe('0x48')]['id']}})[_0x6dbe('0x2a')](handleEntityNotFound(_0x39365a,null))[_0x6dbe('0x2a')](saveUpdates(_0x3d4906[_0x6dbe('0x4d')],null))[_0x6dbe('0x2a')](respondWithResult(_0x39365a,null))[_0x6dbe('0x4b')](handleError(_0x39365a,null));};exports['destroy']=function(_0x24cea7,_0x48f4af){return db[_0x6dbe('0x2e')][_0x6dbe('0x4e')]({'where':{'id':_0x24cea7[_0x6dbe('0x48')]['id']}})[_0x6dbe('0x2a')](handleEntityNotFound(_0x48f4af,null))[_0x6dbe('0x2a')](removeEntity(_0x48f4af,null))[_0x6dbe('0x4b')](handleError(_0x48f4af,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9659152..b51ac6a 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 _0x8365=['../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x5cd815,_0x37b2ea){var _0x284e2e=function(_0x11170c){while(--_0x11170c){_0x5cd815['push'](_0x5cd815['shift']());}};_0x284e2e(++_0x37b2ea);}(_0x8365,0xc9));var _0x5836=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x8365[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x5836('0x0'));var util=require(_0x5836('0x1'));var logger=require('../../config/logger')(_0x5836('0x2'));var moment=require(_0x5836('0x3'));var BPromise=require('bluebird');var rp=require(_0x5836('0x4'));var fs=require('fs');var path=require(_0x5836('0x5'));var rimraf=require(_0x5836('0x6'));var config=require(_0x5836('0x7'));var attributes=require(_0x5836('0x8'));module[_0x5836('0x9')]=function(_0x46ed05,_0x17bec1){return _0x46ed05['define'](_0x5836('0xa'),attributes,{'tableName':_0x5836('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5836('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x34d1=['bluebird','path','rimraf','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1a84d5,_0xa631a1){var _0x1740cd=function(_0x207554){while(--_0x207554){_0x1a84d5['push'](_0x1a84d5['shift']());}};_0x1740cd(++_0xa631a1);}(_0x34d1,0x1e9));var _0x134d=function(_0x42d278,_0x196838){_0x42d278=_0x42d278-0x0;var _0x4fe99b=_0x34d1[_0x42d278];return _0x4fe99b;};'use strict';var _=require(_0x134d('0x0'));var util=require(_0x134d('0x1'));var logger=require(_0x134d('0x2'))(_0x134d('0x3'));var moment=require(_0x134d('0x4'));var BPromise=require(_0x134d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x134d('0x6'));var rimraf=require(_0x134d('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x28b597,_0x30a19b){return _0x28b597[_0x134d('0x8')](_0x134d('0x9'),attributes,{'tableName':_0x134d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x134d('0xb'),'collate':_0x134d('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index edd67d7..0cbc82b 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 _0xfa6f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','limit','stringify','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x39f14a,_0x373f64){var _0x4199bb=function(_0x90b848){while(--_0x90b848){_0x39f14a['push'](_0x39f14a['shift']());}};_0x4199bb(++_0x373f64);}(_0xfa6f,0xdb));var _0xffa6=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xfa6f[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xffa6('0x0'));var util=require(_0xffa6('0x1'));var moment=require(_0xffa6('0x2'));var BPromise=require('bluebird');var rs=require(_0xffa6('0x3'));var fs=require('fs');var Redis=require(_0xffa6('0x4'));var db=require(_0xffa6('0x5'))['db'];var utils=require(_0xffa6('0x6'));var logger=require(_0xffa6('0x7'))(_0xffa6('0x8'));var config=require('../../config/environment');var jayson=require(_0xffa6('0x9'));var client=jayson[_0xffa6('0xa')][_0xffa6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ee498,_0x5a9fdf,_0x5168c2){return new BPromise(function(_0x1a75f1,_0x38db91){return client[_0xffa6('0xc')](_0x4ee498,_0x5168c2)[_0xffa6('0xd')](function(_0x375da4){logger[_0xffa6('0xe')](_0xffa6('0xf'),_0x5a9fdf,'request\x20sent');logger[_0xffa6('0x10')](_0xffa6('0x11'),_0x5a9fdf,_0xffa6('0x12'),JSON['stringify'](_0x375da4));if(_0x375da4['error']){if(_0x375da4[_0xffa6('0x13')][_0xffa6('0x14')]===0x1f4){logger[_0xffa6('0x13')]('FaxApplication,\x20%s,\x20%s',_0x5a9fdf,_0x375da4[_0xffa6('0x13')][_0xffa6('0x15')]);return _0x38db91(_0x375da4[_0xffa6('0x13')][_0xffa6('0x15')]);}logger[_0xffa6('0x13')](_0xffa6('0xf'),_0x5a9fdf,_0x375da4[_0xffa6('0x13')][_0xffa6('0x15')]);return _0x1a75f1(_0x375da4['error'][_0xffa6('0x15')]);}else{logger[_0xffa6('0xe')](_0xffa6('0xf'),_0x5a9fdf,_0xffa6('0x12'));_0x1a75f1(_0x375da4[_0xffa6('0x16')][_0xffa6('0x15')]);}})['catch'](function(_0x547796){logger[_0xffa6('0x13')](_0xffa6('0xf'),_0x5a9fdf,_0x547796);_0x38db91(_0x547796);});});}exports[_0xffa6('0x17')]=function(_0x3e68bc){var _0x27e6be=this;return new Promise(function(_0x5d48d4,_0x42dbf5){return db[_0xffa6('0x18')]['update'](_0x3e68bc['body'],{'raw':_0x3e68bc[_0xffa6('0x19')]?_0x3e68bc[_0xffa6('0x19')][_0xffa6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e68bc[_0xffa6('0x19')]?_0x3e68bc[_0xffa6('0x19')][_0xffa6('0x1b')]||null:null,'attributes':_0x3e68bc[_0xffa6('0x19')]?_0x3e68bc[_0xffa6('0x19')][_0xffa6('0x1c')]||null:null,'limit':_0x3e68bc['options']?_0x3e68bc['options'][_0xffa6('0x1d')]||null:null})[_0xffa6('0xd')](function(_0x515619){logger[_0xffa6('0xe')](_0xffa6('0x17'),_0x3e68bc);logger[_0xffa6('0x10')](_0xffa6('0x17'),_0x3e68bc,JSON[_0xffa6('0x1e')](_0x515619));_0x5d48d4(_0x515619);})[_0xffa6('0x1f')](function(_0xd40bd2){logger[_0xffa6('0x13')](_0xffa6('0x17'),_0xd40bd2['message'],_0x3e68bc);_0x42dbf5(_0x27e6be[_0xffa6('0x13')](0x1f4,_0xd40bd2[_0xffa6('0x15')]));});});}; \ No newline at end of file +var _0x2279=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','FaxApplication,\x20%s,\x20%s','message','info','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x523fb2,_0x1085c1){var _0x308995=function(_0x462b7f){while(--_0x462b7f){_0x523fb2['push'](_0x523fb2['shift']());}};_0x308995(++_0x1085c1);}(_0x2279,0x90));var _0x9227=function(_0x4753c6,_0x3ff8c4){_0x4753c6=_0x4753c6-0x0;var _0x34e20a=_0x2279[_0x4753c6];return _0x34e20a;};'use strict';var _=require('lodash');var util=require(_0x9227('0x0'));var moment=require('moment');var BPromise=require(_0x9227('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9227('0x2'));var db=require(_0x9227('0x3'))['db'];var utils=require(_0x9227('0x4'));var logger=require(_0x9227('0x5'))(_0x9227('0x6'));var config=require(_0x9227('0x7'));var jayson=require(_0x9227('0x8'));var client=jayson[_0x9227('0x9')][_0x9227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55c9db,_0x357534,_0x1ee9c6){return new BPromise(function(_0x37d022,_0x5f4cd3){return client[_0x9227('0xb')](_0x55c9db,_0x1ee9c6)[_0x9227('0xc')](function(_0x58f8a8){logger['info']('FaxApplication,\x20%s,\x20%s',_0x357534,_0x9227('0xd'));logger[_0x9227('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x357534,_0x9227('0xd'),JSON['stringify'](_0x58f8a8));if(_0x58f8a8['error']){if(_0x58f8a8[_0x9227('0xf')][_0x9227('0x10')]===0x1f4){logger[_0x9227('0xf')](_0x9227('0x11'),_0x357534,_0x58f8a8[_0x9227('0xf')][_0x9227('0x12')]);return _0x5f4cd3(_0x58f8a8[_0x9227('0xf')][_0x9227('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x357534,_0x58f8a8[_0x9227('0xf')][_0x9227('0x12')]);return _0x37d022(_0x58f8a8[_0x9227('0xf')][_0x9227('0x12')]);}else{logger[_0x9227('0x13')](_0x9227('0x11'),_0x357534,_0x9227('0xd'));_0x37d022(_0x58f8a8['result']['message']);}})[_0x9227('0x14')](function(_0x4319df){logger['error'](_0x9227('0x11'),_0x357534,_0x4319df);_0x5f4cd3(_0x4319df);});});}exports[_0x9227('0x15')]=function(_0x16217f){var _0x7077f6=this;return new Promise(function(_0x3f5fcc,_0x584d02){return db[_0x9227('0x16')][_0x9227('0x17')](_0x16217f[_0x9227('0x18')],{'raw':_0x16217f[_0x9227('0x19')]?_0x16217f[_0x9227('0x19')][_0x9227('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16217f['options']?_0x16217f[_0x9227('0x19')][_0x9227('0x1b')]||null:null,'attributes':_0x16217f[_0x9227('0x19')]?_0x16217f['options']['attributes']||null:null,'limit':_0x16217f[_0x9227('0x19')]?_0x16217f['options'][_0x9227('0x1c')]||null:null})[_0x9227('0xc')](function(_0x6b7776){logger[_0x9227('0x13')](_0x9227('0x15'),_0x16217f);logger[_0x9227('0xe')](_0x9227('0x15'),_0x16217f,JSON[_0x9227('0x1d')](_0x6b7776));_0x3f5fcc(_0x6b7776);})[_0x9227('0x14')](function(_0x3db7ca){logger[_0x9227('0xf')]('UpdateFaxApplication',_0x3db7ca['message'],_0x16217f);_0x584d02(_0x7077f6[_0x9227('0xf')](0x1f4,_0x3db7ca[_0x9227('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 51780ce..7cbafe6 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 _0x8f4c=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x447f6d,_0x36fc29){var _0x56a9b8=function(_0x16444e){while(--_0x16444e){_0x447f6d['push'](_0x447f6d['shift']());}};_0x56a9b8(++_0x36fc29);}(_0x8f4c,0x113));var _0xc8f4=function(_0x529185,_0x5f5ef5){_0x529185=_0x529185-0x0;var _0x541314=_0x8f4c[_0x529185];return _0x541314;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./faxApplication.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0xc')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router[_0xc8f4('0xf')]('/:id',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x11')](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0xd4e013,_0x42b259){var _0x47aa83=function(_0x55c7de){while(--_0x55c7de){_0xd4e013['push'](_0xd4e013['shift']());}};_0x47aa83(++_0x42b259);}(_0x5c00,0x17e));var _0x05c0=function(_0x2d48fa,_0x103065){_0x2d48fa=_0x2d48fa-0x0;var _0x4645b7=_0x5c00[_0x2d48fa];return _0x4645b7;};'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('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index b119c57..acabab9 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 _0xe820=['sequelize','BOOLEAN','STRING','out','DATE','ENUM','INTEGER'];(function(_0x1b8f80,_0x571671){var _0x144706=function(_0x189e31){while(--_0x189e31){_0x1b8f80['push'](_0x1b8f80['shift']());}};_0x144706(++_0x571671);}(_0xe820,0xd2));var _0x0e82=function(_0x2bfe1e,_0x2fc050){_0x2bfe1e=_0x2bfe1e-0x0;var _0x407d8c=_0xe820[_0x2bfe1e];return _0x407d8c;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0e82('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0e82('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0e82('0x2')]},'note':{'type':Sequelize[_0x0e82('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x0e82('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0e82('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0e82('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0e82('0x5')]('in',_0x0e82('0x3')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x0e82('0x6')]}}; \ No newline at end of file +var _0x32f4=['STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x36744a,_0x1ae1a8){var _0x3a957=function(_0x5ab871){while(--_0x5ab871){_0x36744a['push'](_0x36744a['shift']());}};_0x3a957(++_0x1ae1a8);}(_0x32f4,0x154));var _0x432f=function(_0x13c80d,_0x52cdc8){_0x13c80d=_0x13c80d-0x0;var _0x29b74c=_0x32f4[_0x13c80d];return _0x29b74c;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'closed':{'type':Sequelize[_0x432f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x432f('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x432f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x432f('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x432f('0x3')]},'fax':{'type':Sequelize[_0x432f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x432f('0x5')]('in',_0x432f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x432f('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x432f('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 7f40aeb..ba7f691 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 _0x4e24=['merge','$gte','split','format','FaxMessage','count','include','rows','addTags','setTags','Tag','color','emit','faxInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','sendStatus','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','localhost','./faxInteraction.socket','status','end','offset','undefined','limit','set','Content-Range','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','findAll','query','user','model','keys','FaxInteraction','filters','intersection','attributes','fields','length','includeAll','find','create','body','catch','params','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x4e24,0x86));var _0x44e2=function(_0x413286,_0x1b849a){_0x413286=_0x413286-0x0;var _0x45dd5e=_0x4e24[_0x413286];return _0x45dd5e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x44e2('0x0'));var moment=require(_0x44e2('0x1'));var BPromise=require(_0x44e2('0x2'));var util=require(_0x44e2('0x3'));var path=require(_0x44e2('0x4'));var fs=require('fs');var _=require(_0x44e2('0x5'));var Redis=require('ioredis');var interaction=require(_0x44e2('0x6'));var qs=require(_0x44e2('0x7'));var logger=require(_0x44e2('0x8'))(_0x44e2('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x44e2('0xa')]=_['defaults'](config[_0x44e2('0xa')],{'host':_0x44e2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44e2('0xa')]));require(_0x44e2('0xc'))['register'](socket);function respondWithStatusCode(_0x1dd92f,_0x224fb5){_0x224fb5=_0x224fb5||0xcc;return function(_0x3e5544){if(_0x3e5544){return _0x1dd92f['sendStatus'](_0x224fb5);}return _0x1dd92f[_0x44e2('0xd')](_0x224fb5)[_0x44e2('0xe')]();};}function respondWithResult(_0x2143dd,_0x59e5d2){_0x59e5d2=_0x59e5d2||0xc8;return function(_0x32e281){if(_0x32e281){return _0x2143dd[_0x44e2('0xd')](_0x59e5d2)['json'](_0x32e281);}};}function respondWithFilteredResult(_0x584309,_0x48fd14){return function(_0x5b45f2){if(_0x5b45f2){var _0x28dd5f=typeof _0x48fd14[_0x44e2('0xf')]===_0x44e2('0x10')&&typeof _0x48fd14['limit']===_0x44e2('0x10');var _0x37a031=_0x5b45f2['count'];var _0xec5619=_0x28dd5f?0x0:_0x48fd14[_0x44e2('0xf')];var _0x82ab8c=_0x28dd5f?_0x5b45f2['count']:_0x48fd14[_0x44e2('0xf')]+_0x48fd14[_0x44e2('0x11')];var _0x51b4fe;if(_0x82ab8c>=_0x37a031){_0x82ab8c=_0x37a031;_0x51b4fe=0xc8;}else{_0x51b4fe=0xce;}_0x584309[_0x44e2('0xd')](_0x51b4fe);return _0x584309[_0x44e2('0x12')](_0x44e2('0x13'),_0xec5619+'-'+_0x82ab8c+'/'+_0x37a031)['json'](_0x5b45f2);}return null;};}function saveUpdates(_0xe76b64){return function(_0x5c0b96){if(_0x5c0b96){return _0x5c0b96[_0x44e2('0x14')](_0xe76b64)[_0x44e2('0x15')](function(_0x393d73){return _0x393d73;});}return null;};}function removeEntity(_0x4b3518){return function(_0x4fa22c){if(_0x4fa22c){return _0x4fa22c[_0x44e2('0x16')]()[_0x44e2('0x15')](function(){_0x4b3518[_0x44e2('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17cf5a){return function(_0xc71f72){if(!_0xc71f72){_0x17cf5a['sendStatus'](0x194);}return _0xc71f72;};}function handleError(_0x2f789d,_0x110858){_0x110858=_0x110858||0x1f4;return function(_0x5cafd3){logger['error'](_0x5cafd3[_0x44e2('0x17')]);if(_0x5cafd3[_0x44e2('0x18')]){delete _0x5cafd3[_0x44e2('0x18')];}_0x2f789d['status'](_0x110858)[_0x44e2('0x19')](_0x5cafd3);};}exports[_0x44e2('0x1a')]=function(_0x2facda,_0x3df5ed){var _0x4701b5={};var _0xa585f2=_[_0x44e2('0x1b')](db['FaxInteraction'][_0x44e2('0x1c')],function(_0x320f09){return{'name':_0x320f09[_0x44e2('0x1d')],'type':_0x320f09[_0x44e2('0x1e')]['key']};});_0x4701b5=qs[_0x44e2('0x1f')](_0xa585f2,_0x2facda);return interaction[_0x44e2('0x20')]('fax',_0x2facda[_0x44e2('0x21')],_0x2facda[_0x44e2('0x22')],_0x4701b5,_0xa585f2)[_0x44e2('0x15')](respondWithFilteredResult(_0x3df5ed,_0x4701b5))['catch'](handleError(_0x3df5ed,null));};exports['show']=function(_0x597c98,_0x246992){var _0x4dfe06={'raw':![],'where':{'id':_0x597c98['params']['id']}},_0x5dc2ab={};_0x5dc2ab[_0x44e2('0x23')]=_[_0x44e2('0x24')](db[_0x44e2('0x25')][_0x44e2('0x1c')]);_0x5dc2ab[_0x44e2('0x21')]=_['keys'](_0x597c98[_0x44e2('0x21')]);_0x5dc2ab[_0x44e2('0x26')]=_[_0x44e2('0x27')](_0x5dc2ab['model'],_0x5dc2ab['query']);_0x4dfe06[_0x44e2('0x28')]=_[_0x44e2('0x27')](_0x5dc2ab[_0x44e2('0x23')],qs[_0x44e2('0x29')](_0x597c98[_0x44e2('0x21')][_0x44e2('0x29')]));_0x4dfe06[_0x44e2('0x28')]=_0x4dfe06[_0x44e2('0x28')][_0x44e2('0x2a')]?_0x4dfe06[_0x44e2('0x28')]:_0x5dc2ab['model'];if(_0x597c98[_0x44e2('0x21')][_0x44e2('0x2b')]){_0x4dfe06['include']=[{'all':!![]}];}_0x4dfe06=_['merge']({},_0x4dfe06,_0x597c98['options']);return db[_0x44e2('0x25')][_0x44e2('0x2c')](_0x4dfe06)['then'](handleEntityNotFound(_0x246992,null))[_0x44e2('0x15')](respondWithResult(_0x246992,null))['catch'](handleError(_0x246992,null));};exports[_0x44e2('0x2d')]=function(_0x150c02,_0x1961ff){return db[_0x44e2('0x25')][_0x44e2('0x2d')](_0x150c02[_0x44e2('0x2e')],{})[_0x44e2('0x15')](respondWithResult(_0x1961ff,0xc9))[_0x44e2('0x2f')](handleError(_0x1961ff,null));};exports[_0x44e2('0x14')]=function(_0x46a444,_0x3dbf6f){if(_0x46a444[_0x44e2('0x2e')]['id']){delete _0x46a444['body']['id'];}return db[_0x44e2('0x25')][_0x44e2('0x2c')]({'where':{'id':_0x46a444[_0x44e2('0x30')]['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x3dbf6f,null))[_0x44e2('0x15')](saveUpdates(_0x46a444[_0x44e2('0x2e')],null))[_0x44e2('0x15')](respondWithResult(_0x3dbf6f,null))[_0x44e2('0x2f')](handleError(_0x3dbf6f,null));};exports[_0x44e2('0x16')]=function(_0x5b7fa5,_0x2637bc){return db[_0x44e2('0x25')]['find']({'where':{'id':_0x5b7fa5['params']['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x2637bc,null))[_0x44e2('0x15')](removeEntity(_0x2637bc,null))[_0x44e2('0x2f')](handleError(_0x2637bc,null));};exports[_0x44e2('0x31')]=function(_0x140903,_0x4bd6f2){return db[_0x44e2('0x25')][_0x44e2('0x31')]()[_0x44e2('0x15')](respondWithResult(_0x4bd6f2,null))['catch'](handleError(_0x4bd6f2,null));};exports['addMessage']=function(_0x5a98c7,_0x4d7da6){return db['FaxMessage'][_0x44e2('0x2c')]({'where':{'id':_0x5a98c7[_0x44e2('0x30')]['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x4d7da6,null))[_0x44e2('0x15')](function(_0x1eaa85){if(_0x1eaa85){return _0x1eaa85[_0x44e2('0x32')](_0x5a98c7[_0x44e2('0x2e')][_0x44e2('0x33')],_[_0x44e2('0x34')](_0x5a98c7[_0x44e2('0x2e')],[_0x44e2('0x33'),'id'])||{});}})[_0x44e2('0x15')](respondWithResult(_0x4d7da6,null))[_0x44e2('0x2f')](handleError(_0x4d7da6,null));};exports[_0x44e2('0x35')]=function(_0x16b086,_0x5b003e){var _0x2e58cb={'raw':![],'where':{}};var _0x530690={};var _0x41f5af={'count':0x0,'rows':[]};return db[_0x44e2('0x25')][_0x44e2('0x36')]({'where':{'id':_0x16b086[_0x44e2('0x30')]['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x5b003e,null))[_0x44e2('0x15')](function(_0x472bd5){if(_0x472bd5){_0x530690[_0x44e2('0x23')]=_[_0x44e2('0x24')](db['FaxMessage'][_0x44e2('0x1c')]);_0x530690[_0x44e2('0x21')]=_['keys'](_0x16b086[_0x44e2('0x21')]);_0x530690[_0x44e2('0x26')]=_[_0x44e2('0x27')](_0x530690['model'],_0x530690[_0x44e2('0x21')]);_0x2e58cb[_0x44e2('0x28')]=_[_0x44e2('0x27')](_0x530690['model'],qs[_0x44e2('0x29')](_0x16b086[_0x44e2('0x21')][_0x44e2('0x29')]));_0x2e58cb[_0x44e2('0x28')]=_0x2e58cb[_0x44e2('0x28')]['length']?_0x2e58cb[_0x44e2('0x28')]:_0x530690[_0x44e2('0x23')];if(!_0x16b086[_0x44e2('0x21')][_0x44e2('0x37')](_0x44e2('0x38'))){_0x2e58cb[_0x44e2('0x11')]=qs['limit'](_0x16b086['query'][_0x44e2('0x11')]);_0x2e58cb['offset']=qs['offset'](_0x16b086['query'][_0x44e2('0xf')]);}_0x2e58cb[_0x44e2('0x39')]=qs[_0x44e2('0x3a')](_0x16b086[_0x44e2('0x21')]['sort']);_0x2e58cb[_0x44e2('0x3b')]=qs['filters'](_['pick'](_0x16b086['query'],_0x530690[_0x44e2('0x26')]));_0x2e58cb[_0x44e2('0x3b')][_0x44e2('0x3c')]=_0x472bd5['id'];if(_0x16b086[_0x44e2('0x21')][_0x44e2('0x3d')]){_0x2e58cb[_0x44e2('0x3b')]=_[_0x44e2('0x3e')](_0x2e58cb[_0x44e2('0x3b')],{'$or':_[_0x44e2('0x1b')](_0x2e58cb[_0x44e2('0x28')],function(_0x363944){var _0x5b54f5={};_0x5b54f5[_0x363944]={'$like':'%'+_0x16b086[_0x44e2('0x21')][_0x44e2('0x3d')]+'%'};return _0x5b54f5;})});}if(_0x16b086[_0x44e2('0x21')][_0x44e2('0x3f')]){var _0x1feafa=_0x16b086['query']['$gte'][_0x44e2('0x40')](',');var _0x4b1995={};_0x4b1995[_0x1feafa[0x0]]={'$gte':moment(_0x1feafa[0x1])[_0x44e2('0x41')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e58cb[_0x44e2('0x3b')]=_[_0x44e2('0x3e')](_0x2e58cb[_0x44e2('0x3b')],_0x4b1995);}_0x2e58cb=_[_0x44e2('0x3e')]({},_0x2e58cb,_0x16b086['options']);return db[_0x44e2('0x42')]['count']({'where':_0x2e58cb[_0x44e2('0x3b')]})[_0x44e2('0x15')](function(_0x2d9656){_0x41f5af[_0x44e2('0x43')]=_0x2d9656;if(_0x16b086[_0x44e2('0x21')]['includeAll']){_0x2e58cb[_0x44e2('0x44')]=[{'all':!![]}];}return db['FaxMessage'][_0x44e2('0x20')](_0x2e58cb);})[_0x44e2('0x15')](function(_0x1026b8){_0x41f5af[_0x44e2('0x45')]=_0x1026b8;return _0x41f5af;});}})['then'](respondWithFilteredResult(_0x5b003e,_0x2e58cb))[_0x44e2('0x2f')](handleError(_0x5b003e,null));};exports[_0x44e2('0x46')]=function(_0x10b802,_0x1e4c83){return db[_0x44e2('0x25')][_0x44e2('0x2c')]({'where':{'id':_0x10b802[_0x44e2('0x30')]['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x1e4c83,null))[_0x44e2('0x15')](function(_0x3d5c3f){if(_0x3d5c3f){return _0x3d5c3f[_0x44e2('0x47')](_0x10b802[_0x44e2('0x2e')][_0x44e2('0x33')],_[_0x44e2('0x34')](_0x10b802[_0x44e2('0x2e')],[_0x44e2('0x33'),'id'])||{})['spread'](function(){return db[_0x44e2('0x48')][_0x44e2('0x20')]({'attributes':['id','name',_0x44e2('0x49')],'where':{'id':_0x10b802[_0x44e2('0x2e')][_0x44e2('0x33')]}});})[_0x44e2('0x15')](function(_0x22e8d8){socket[_0x44e2('0x4a')](_0x44e2('0x4b'),{'id':Number(_0x10b802[_0x44e2('0x30')]['id']),'tags':_0x22e8d8||[]});return{'id':Number(_0x10b802[_0x44e2('0x30')]['id']),'tags':_0x22e8d8||[]};});}})['then'](respondWithResult(_0x1e4c83,null))[_0x44e2('0x2f')](handleError(_0x1e4c83,null));};exports[_0x44e2('0x4c')]=function(_0x3dae52,_0x476c16){return db[_0x44e2('0x25')][_0x44e2('0x2c')]({'where':{'id':_0x3dae52[_0x44e2('0x30')]['id']}})[_0x44e2('0x15')](handleEntityNotFound(_0x476c16,null))['then'](function(_0x42fd07){if(_0x42fd07){return _0x42fd07[_0x44e2('0x4c')](_0x3dae52['query'][_0x44e2('0x33')]);}})['then'](respondWithStatusCode(_0x476c16,null))['catch'](handleError(_0x476c16,null));};exports[_0x44e2('0x4d')]=function(_0x1d4e78,_0x1fa0bf){var _0x5f0073=moment()['unix']()[_0x44e2('0x4e')]();var _0x385d02=path[_0x44e2('0x4f')](config[_0x44e2('0x50')],_0x44e2('0x51'),_0x44e2('0x52'),_0x44e2('0x53'));var _0x29ecb3=path[_0x44e2('0x4f')](config[_0x44e2('0x50')],'server','files',_0x44e2('0x54'));var _0x498a47=path['join'](_0x385d02,_0x5f0073);var _0x450cd1=util[_0x44e2('0x41')](_0x44e2('0x55'),_0x1d4e78[_0x44e2('0x30')]['id'],_0x5f0073);var _0x89c8ff=path['join'](_0x385d02,_0x450cd1);var _0x1ec246=[];_0x1ec246[_0x44e2('0x56')]({'model':db['Attachment'],'as':_0x44e2('0x57'),'raw':!![]});var _0xc02604=[{'model':db[_0x44e2('0x42')],'as':_0x44e2('0x58'),'attributes':['id',_0x44e2('0x2e'),'createdAt'],'include':_0x1ec246}];return db['FaxInteraction']['find']({'where':{'id':_0x1d4e78[_0x44e2('0x30')]['id']},'include':_0xc02604})[_0x44e2('0x15')](handleEntityNotFound(_0x1fa0bf,null))[_0x44e2('0x15')](function(_0xd5c2c4){if(_0xd5c2c4&&_0xd5c2c4[_0x44e2('0x58')]){var _0x2f519b=_0xd5c2c4['get']({'plain':!![]});fs[_0x44e2('0x59')](_0x498a47);for(var _0x10c842=0x0;_0x10c842<_0x2f519b['Messages'][_0x44e2('0x2a')];_0x10c842++){var _0x197272=_0x2f519b[_0x44e2('0x58')][_0x10c842][_0x44e2('0x57')];if(_0x197272){var _0x208e2c=path[_0x44e2('0x4f')](_0x29ecb3,_0x197272[_0x44e2('0x5a')]);if(fs['existsSync'](_0x208e2c)){fs[_0x44e2('0x5b')](_0x208e2c)[_0x44e2('0x5c')](fs[_0x44e2('0x5d')](path[_0x44e2('0x4f')](_0x498a47,_0x197272[_0x44e2('0x5a')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x159944,_0x54b19a){zipdir(_0x498a47,{'saveTo':_0x89c8ff},function(_0x27594f,_0x4d772d){if(_0x27594f)return _0x54b19a(_0x27594f);return _0x159944(_0x4d772d);});})['then'](function(){return new BPromise(function(_0x3202c0,_0x3769bf){rimraf(_0x498a47,function(_0x44fa36){if(_0x44fa36)_0x3769bf(_0x44fa36);return _0x3202c0();});});})['then'](function(){return _0x1fa0bf[_0x44e2('0x4d')](_0x89c8ff,_0x450cd1,function(_0x50613d){if(_0x50613d){console[_0x44e2('0x5e')](_0x44e2('0x5f'),_0x50613d);}else{fs[_0x44e2('0x60')](_0x89c8ff);}});});});}else{return _0x1fa0bf[_0x44e2('0x61')](0xc8);}})[_0x44e2('0x2f')](handleError(_0x1fa0bf,null));}; \ No newline at end of file +var _0xf9a0=['./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','destroy','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','show','params','model','keys','query','attributes','fields','length','includeAll','include','merge','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','filters','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','spread','Tag','findAll','color','emit','faxInteractionTags:save','removeTags','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','log','unlinkSync','zip-dir','moment','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','localhost','redis'];(function(_0x49e6db,_0x1a4546){var _0x5a6137=function(_0xcf3ed9){while(--_0xcf3ed9){_0x49e6db['push'](_0x49e6db['shift']());}};_0x5a6137(++_0x1a4546);}(_0xf9a0,0x1e8));var _0x0f9a=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xf9a0[_0x350182];return _0x4a0892;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x0f9a('0x0'));var moment=require(_0x0f9a('0x1'));var BPromise=require('bluebird');var util=require(_0x0f9a('0x2'));var path=require(_0x0f9a('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0f9a('0x4'));var interaction=require(_0x0f9a('0x5'));var qs=require(_0x0f9a('0x6'));var logger=require('../../config/logger')(_0x0f9a('0x7'));var config=require(_0x0f9a('0x8'));var db=require(_0x0f9a('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0f9a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f9a('0xb')]));require(_0x0f9a('0xc'))[_0x0f9a('0xd')](socket);function respondWithStatusCode(_0x34c98f,_0x346b69){_0x346b69=_0x346b69||0xcc;return function(_0x31fa0f){if(_0x31fa0f){return _0x34c98f[_0x0f9a('0xe')](_0x346b69);}return _0x34c98f[_0x0f9a('0xf')](_0x346b69)[_0x0f9a('0x10')]();};}function respondWithResult(_0x489217,_0x36e66){_0x36e66=_0x36e66||0xc8;return function(_0x161f52){if(_0x161f52){return _0x489217[_0x0f9a('0xf')](_0x36e66)['json'](_0x161f52);}};}function respondWithFilteredResult(_0x16266a,_0x4b298c){return function(_0x1ccade){if(_0x1ccade){var _0x1caf60=typeof _0x4b298c[_0x0f9a('0x11')]===_0x0f9a('0x12')&&typeof _0x4b298c[_0x0f9a('0x13')]===_0x0f9a('0x12');var _0x10aa47=_0x1ccade['count'];var _0x1c781b=_0x1caf60?0x0:_0x4b298c['offset'];var _0x4b98ca=_0x1caf60?_0x1ccade[_0x0f9a('0x14')]:_0x4b298c[_0x0f9a('0x11')]+_0x4b298c[_0x0f9a('0x13')];var _0x8e5d5e;if(_0x4b98ca>=_0x10aa47){_0x4b98ca=_0x10aa47;_0x8e5d5e=0xc8;}else{_0x8e5d5e=0xce;}_0x16266a['status'](_0x8e5d5e);return _0x16266a[_0x0f9a('0x15')]('Content-Range',_0x1c781b+'-'+_0x4b98ca+'/'+_0x10aa47)[_0x0f9a('0x16')](_0x1ccade);}return null;};}function saveUpdates(_0x32123f){return function(_0x537084){if(_0x537084){return _0x537084[_0x0f9a('0x17')](_0x32123f)[_0x0f9a('0x18')](function(_0x39f7bf){return _0x39f7bf;});}return null;};}function removeEntity(_0x229741){return function(_0x490c9a){if(_0x490c9a){return _0x490c9a[_0x0f9a('0x19')]()[_0x0f9a('0x18')](function(){_0x229741[_0x0f9a('0xf')](0xcc)[_0x0f9a('0x10')]();});}};}function handleEntityNotFound(_0x563e57){return function(_0x38e6fb){if(!_0x38e6fb){_0x563e57[_0x0f9a('0xe')](0x194);}return _0x38e6fb;};}function handleError(_0x29c866,_0x1f4b9d){_0x1f4b9d=_0x1f4b9d||0x1f4;return function(_0x901fa1){logger['error'](_0x901fa1['stack']);if(_0x901fa1['name']){delete _0x901fa1[_0x0f9a('0x1a')];}_0x29c866[_0x0f9a('0xf')](_0x1f4b9d)[_0x0f9a('0x1b')](_0x901fa1);};}exports[_0x0f9a('0x1c')]=function(_0x552d07,_0x2aab85){var _0x84acac={};var _0x3cb0a6=_[_0x0f9a('0x1d')](db[_0x0f9a('0x1e')][_0x0f9a('0x1f')],function(_0x468b94){return{'name':_0x468b94[_0x0f9a('0x20')],'type':_0x468b94[_0x0f9a('0x21')][_0x0f9a('0x22')]};});_0x84acac=qs[_0x0f9a('0x23')](_0x3cb0a6,_0x552d07);return interaction['findAll']('fax',_0x552d07['query'],_0x552d07['user'],_0x84acac,_0x3cb0a6)[_0x0f9a('0x18')](respondWithFilteredResult(_0x2aab85,_0x84acac))['catch'](handleError(_0x2aab85,null));};exports[_0x0f9a('0x24')]=function(_0x25d8a3,_0x26f468){var _0xec478f={'raw':![],'where':{'id':_0x25d8a3[_0x0f9a('0x25')]['id']}},_0x189ffd={};_0x189ffd[_0x0f9a('0x26')]=_[_0x0f9a('0x27')](db[_0x0f9a('0x1e')][_0x0f9a('0x1f')]);_0x189ffd[_0x0f9a('0x28')]=_[_0x0f9a('0x27')](_0x25d8a3['query']);_0x189ffd['filters']=_['intersection'](_0x189ffd[_0x0f9a('0x26')],_0x189ffd['query']);_0xec478f[_0x0f9a('0x29')]=_['intersection'](_0x189ffd[_0x0f9a('0x26')],qs[_0x0f9a('0x2a')](_0x25d8a3[_0x0f9a('0x28')][_0x0f9a('0x2a')]));_0xec478f[_0x0f9a('0x29')]=_0xec478f['attributes'][_0x0f9a('0x2b')]?_0xec478f[_0x0f9a('0x29')]:_0x189ffd[_0x0f9a('0x26')];if(_0x25d8a3[_0x0f9a('0x28')][_0x0f9a('0x2c')]){_0xec478f[_0x0f9a('0x2d')]=[{'all':!![]}];}_0xec478f=_[_0x0f9a('0x2e')]({},_0xec478f,_0x25d8a3['options']);return db[_0x0f9a('0x1e')][_0x0f9a('0x2f')](_0xec478f)[_0x0f9a('0x18')](handleEntityNotFound(_0x26f468,null))[_0x0f9a('0x18')](respondWithResult(_0x26f468,null))[_0x0f9a('0x30')](handleError(_0x26f468,null));};exports['create']=function(_0x1723ca,_0x53b825){return db[_0x0f9a('0x1e')][_0x0f9a('0x31')](_0x1723ca[_0x0f9a('0x32')],{})[_0x0f9a('0x18')](respondWithResult(_0x53b825,0xc9))[_0x0f9a('0x30')](handleError(_0x53b825,null));};exports[_0x0f9a('0x17')]=function(_0x1e171b,_0x3219c6){if(_0x1e171b[_0x0f9a('0x32')]['id']){delete _0x1e171b['body']['id'];}return db[_0x0f9a('0x1e')]['find']({'where':{'id':_0x1e171b[_0x0f9a('0x25')]['id']}})[_0x0f9a('0x18')](handleEntityNotFound(_0x3219c6,null))[_0x0f9a('0x18')](saveUpdates(_0x1e171b[_0x0f9a('0x32')],null))[_0x0f9a('0x18')](respondWithResult(_0x3219c6,null))[_0x0f9a('0x30')](handleError(_0x3219c6,null));};exports['destroy']=function(_0x15b97c,_0xf735c9){return db[_0x0f9a('0x1e')][_0x0f9a('0x2f')]({'where':{'id':_0x15b97c['params']['id']}})[_0x0f9a('0x18')](handleEntityNotFound(_0xf735c9,null))[_0x0f9a('0x18')](removeEntity(_0xf735c9,null))[_0x0f9a('0x30')](handleError(_0xf735c9,null));};exports['describe']=function(_0x2ef1b4,_0x5bb88e){return db['FaxInteraction'][_0x0f9a('0x33')]()[_0x0f9a('0x18')](respondWithResult(_0x5bb88e,null))['catch'](handleError(_0x5bb88e,null));};exports[_0x0f9a('0x34')]=function(_0x331b53,_0x12fc62){return db[_0x0f9a('0x35')][_0x0f9a('0x2f')]({'where':{'id':_0x331b53[_0x0f9a('0x25')]['id']}})['then'](handleEntityNotFound(_0x12fc62,null))[_0x0f9a('0x18')](function(_0x5bfba5){if(_0x5bfba5){return _0x5bfba5[_0x0f9a('0x34')](_0x331b53[_0x0f9a('0x32')][_0x0f9a('0x36')],_[_0x0f9a('0x37')](_0x331b53[_0x0f9a('0x32')],[_0x0f9a('0x36'),'id'])||{});}})['then'](respondWithResult(_0x12fc62,null))['catch'](handleError(_0x12fc62,null));};exports[_0x0f9a('0x38')]=function(_0x5e77ce,_0x5224d4){var _0x3548ec={'raw':![],'where':{}};var _0x2b0640={};var _0x12560c={'count':0x0,'rows':[]};return db[_0x0f9a('0x1e')][_0x0f9a('0x39')]({'where':{'id':_0x5e77ce['params']['id']}})[_0x0f9a('0x18')](handleEntityNotFound(_0x5224d4,null))[_0x0f9a('0x18')](function(_0x5a7934){if(_0x5a7934){_0x2b0640['model']=_[_0x0f9a('0x27')](db[_0x0f9a('0x35')][_0x0f9a('0x1f')]);_0x2b0640[_0x0f9a('0x28')]=_[_0x0f9a('0x27')](_0x5e77ce[_0x0f9a('0x28')]);_0x2b0640[_0x0f9a('0x3a')]=_[_0x0f9a('0x3b')](_0x2b0640[_0x0f9a('0x26')],_0x2b0640[_0x0f9a('0x28')]);_0x3548ec[_0x0f9a('0x29')]=_[_0x0f9a('0x3b')](_0x2b0640[_0x0f9a('0x26')],qs['fields'](_0x5e77ce['query'][_0x0f9a('0x2a')]));_0x3548ec['attributes']=_0x3548ec[_0x0f9a('0x29')]['length']?_0x3548ec[_0x0f9a('0x29')]:_0x2b0640[_0x0f9a('0x26')];if(!_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x3c')](_0x0f9a('0x3d'))){_0x3548ec[_0x0f9a('0x13')]=qs[_0x0f9a('0x13')](_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x13')]);_0x3548ec['offset']=qs[_0x0f9a('0x11')](_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x11')]);}_0x3548ec[_0x0f9a('0x3e')]=qs[_0x0f9a('0x3f')](_0x5e77ce[_0x0f9a('0x28')]['sort']);_0x3548ec[_0x0f9a('0x40')]=qs[_0x0f9a('0x3a')](_[_0x0f9a('0x41')](_0x5e77ce[_0x0f9a('0x28')],_0x2b0640[_0x0f9a('0x3a')]));_0x3548ec['where']['FaxInteractionId']=_0x5a7934['id'];if(_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x42')]){_0x3548ec['where']=_[_0x0f9a('0x2e')](_0x3548ec[_0x0f9a('0x40')],{'$or':_[_0x0f9a('0x1d')](_0x3548ec[_0x0f9a('0x29')],function(_0xde7b4e){var _0x352964={};_0x352964[_0xde7b4e]={'$like':'%'+_0x5e77ce[_0x0f9a('0x28')]['filter']+'%'};return _0x352964;})});}if(_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x43')]){var _0x5adc5e=_0x5e77ce['query'][_0x0f9a('0x43')][_0x0f9a('0x44')](',');var _0xa33a8b={};_0xa33a8b[_0x5adc5e[0x0]]={'$gte':moment(_0x5adc5e[0x1])[_0x0f9a('0x45')](_0x0f9a('0x46'))};_0x3548ec[_0x0f9a('0x40')]=_['merge'](_0x3548ec['where'],_0xa33a8b);}_0x3548ec=_['merge']({},_0x3548ec,_0x5e77ce[_0x0f9a('0x47')]);return db[_0x0f9a('0x35')][_0x0f9a('0x14')]({'where':_0x3548ec[_0x0f9a('0x40')]})['then'](function(_0x59c72c){_0x12560c[_0x0f9a('0x14')]=_0x59c72c;if(_0x5e77ce[_0x0f9a('0x28')][_0x0f9a('0x2c')]){_0x3548ec[_0x0f9a('0x2d')]=[{'all':!![]}];}return db[_0x0f9a('0x35')]['findAll'](_0x3548ec);})[_0x0f9a('0x18')](function(_0x4142e5){_0x12560c[_0x0f9a('0x48')]=_0x4142e5;return _0x12560c;});}})[_0x0f9a('0x18')](respondWithFilteredResult(_0x5224d4,_0x3548ec))[_0x0f9a('0x30')](handleError(_0x5224d4,null));};exports[_0x0f9a('0x49')]=function(_0x534da1,_0x5a28dd){return db['FaxInteraction']['find']({'where':{'id':_0x534da1['params']['id']}})[_0x0f9a('0x18')](handleEntityNotFound(_0x5a28dd,null))['then'](function(_0x5331c5){if(_0x5331c5){return _0x5331c5['setTags'](_0x534da1[_0x0f9a('0x32')][_0x0f9a('0x36')],_['omit'](_0x534da1[_0x0f9a('0x32')],[_0x0f9a('0x36'),'id'])||{})[_0x0f9a('0x4a')](function(){return db[_0x0f9a('0x4b')][_0x0f9a('0x4c')]({'attributes':['id',_0x0f9a('0x1a'),_0x0f9a('0x4d')],'where':{'id':_0x534da1[_0x0f9a('0x32')][_0x0f9a('0x36')]}});})[_0x0f9a('0x18')](function(_0x49d07b){socket[_0x0f9a('0x4e')](_0x0f9a('0x4f'),{'id':Number(_0x534da1[_0x0f9a('0x25')]['id']),'tags':_0x49d07b||[]});return{'id':Number(_0x534da1[_0x0f9a('0x25')]['id']),'tags':_0x49d07b||[]};});}})[_0x0f9a('0x18')](respondWithResult(_0x5a28dd,null))[_0x0f9a('0x30')](handleError(_0x5a28dd,null));};exports[_0x0f9a('0x50')]=function(_0x501336,_0x39afe7){return db['FaxInteraction']['find']({'where':{'id':_0x501336[_0x0f9a('0x25')]['id']}})[_0x0f9a('0x18')](handleEntityNotFound(_0x39afe7,null))[_0x0f9a('0x18')](function(_0x2ad550){if(_0x2ad550){return _0x2ad550['removeTags'](_0x501336[_0x0f9a('0x28')][_0x0f9a('0x36')]);}})[_0x0f9a('0x18')](respondWithStatusCode(_0x39afe7,null))[_0x0f9a('0x30')](handleError(_0x39afe7,null));};exports['download']=function(_0x40456f,_0x4e8f43){var _0x8248a1=moment()['unix']()[_0x0f9a('0x51')]();var _0x5baeee=path[_0x0f9a('0x52')](config['root'],_0x0f9a('0x53'),_0x0f9a('0x54'),_0x0f9a('0x55'));var _0x1fbb3a=path[_0x0f9a('0x52')](config['root'],_0x0f9a('0x53'),_0x0f9a('0x54'),_0x0f9a('0x56'));var _0x4d6cd6=path[_0x0f9a('0x52')](_0x5baeee,_0x8248a1);var _0x5dc084=util[_0x0f9a('0x45')](_0x0f9a('0x57'),_0x40456f[_0x0f9a('0x25')]['id'],_0x8248a1);var _0x5556e0=path[_0x0f9a('0x52')](_0x5baeee,_0x5dc084);var _0x54d721=[];_0x54d721['push']({'model':db[_0x0f9a('0x58')],'as':_0x0f9a('0x58'),'raw':!![]});var _0x43f428=[{'model':db['FaxMessage'],'as':_0x0f9a('0x59'),'attributes':['id',_0x0f9a('0x32'),_0x0f9a('0x5a')],'include':_0x54d721}];return db[_0x0f9a('0x1e')][_0x0f9a('0x2f')]({'where':{'id':_0x40456f[_0x0f9a('0x25')]['id']},'include':_0x43f428})[_0x0f9a('0x18')](handleEntityNotFound(_0x4e8f43,null))[_0x0f9a('0x18')](function(_0x11bad6){if(_0x11bad6&&_0x11bad6[_0x0f9a('0x59')]){var _0x44b12f=_0x11bad6[_0x0f9a('0x5b')]({'plain':!![]});fs[_0x0f9a('0x5c')](_0x4d6cd6);for(var _0x2b6086=0x0;_0x2b6086<_0x44b12f[_0x0f9a('0x59')]['length'];_0x2b6086++){var _0x2fbee0=_0x44b12f[_0x0f9a('0x59')][_0x2b6086][_0x0f9a('0x58')];if(_0x2fbee0){var _0x2f84e2=path[_0x0f9a('0x52')](_0x1fbb3a,_0x2fbee0[_0x0f9a('0x5d')]);if(fs[_0x0f9a('0x5e')](_0x2f84e2)){fs[_0x0f9a('0x5f')](_0x2f84e2)['pipe'](fs[_0x0f9a('0x60')](path[_0x0f9a('0x52')](_0x4d6cd6,_0x2fbee0[_0x0f9a('0x5d')])));}}}return BPromise[_0x0f9a('0x61')]()['then'](function(){return new BPromise(function(_0x283d8a,_0x181bac){zipdir(_0x4d6cd6,{'saveTo':_0x5556e0},function(_0x7ca6b4,_0x50ab48){if(_0x7ca6b4)return _0x181bac(_0x7ca6b4);return _0x283d8a(_0x50ab48);});})[_0x0f9a('0x18')](function(){return new BPromise(function(_0xa2d66e,_0x3b7c69){rimraf(_0x4d6cd6,function(_0x2ff2ff){if(_0x2ff2ff)_0x3b7c69(_0x2ff2ff);return _0xa2d66e();});});})[_0x0f9a('0x18')](function(){return _0x4e8f43['download'](_0x5556e0,_0x5dc084,function(_0x4f0da7){if(_0x4f0da7){console[_0x0f9a('0x62')]('err',_0x4f0da7);}else{fs[_0x0f9a('0x63')](_0x5556e0);}});});});}else{return _0x4e8f43[_0x0f9a('0xe')](0xc8);}})[_0x0f9a('0x30')](handleError(_0x4e8f43,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 2317463..eca871d 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 _0xf664=['emit','hasOwnProperty','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x5dd143,_0x5b1a08){var _0x3fb802=function(_0x4ddb7d){while(--_0x4ddb7d){_0x5dd143['push'](_0x5dd143['shift']());}};_0x3fb802(++_0x5b1a08);}(_0xf664,0x182));var _0x4f66=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0xf664[_0x81dcac];return _0xc7803b;};'use strict';var EventEmitter=require(_0x4f66('0x0'));var FaxInteraction=require(_0x4f66('0x1'))['db'][_0x4f66('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x4f66('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f66('0x4'),'afterUpdate':_0x4f66('0x5'),'afterDestroy':_0x4f66('0x6')};function emitEvent(_0xb7cff1){return function(_0x3ebf4e,_0x3f4217,_0x2c1720){_0x3ebf4e[_0x4f66('0x7')]({'attributes':['id'],'raw':!![]})[_0x4f66('0x8')](function(_0x47ebf6){_0x3ebf4e[_0x4f66('0x9')](_0x4f66('0xa'),_0x47ebf6[_0x4f66('0xb')](function(_0x4ea0d2){return{'id':_0x4ea0d2['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3ebf4e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f66('0x8')](function(_0x317ece){_0x3ebf4e['setDataValue'](_0x4f66('0xc'),_0x317ece[_0x4f66('0xd')]);FaxInteractionEvents[_0x4f66('0xe')](_0xb7cff1+':'+_0x3ebf4e['id'],_0x3ebf4e);FaxInteractionEvents[_0x4f66('0xe')](_0xb7cff1,_0x3ebf4e);_0x2c1720(null);})['catch'](_0x2c1720(null));};}for(var e in events){if(events[_0x4f66('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x67df=['catch','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x25ccbe,_0xc935c0){var _0x289529=function(_0x478776){while(--_0x478776){_0x25ccbe['push'](_0x25ccbe['shift']());}};_0x289529(++_0xc935c0);}(_0x67df,0x17d));var _0xf67d=function(_0x48c943,_0xb3a774){_0x48c943=_0x48c943-0x0;var _0x36507c=_0x67df[_0x48c943];return _0x36507c;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xf67d('0x0'))['db'][_0xf67d('0x1')];var FaxMessage=require(_0xf67d('0x0'))['db'][_0xf67d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf67d('0x3')](0x0);var events={'afterCreate':_0xf67d('0x4'),'afterUpdate':'update','afterDestroy':_0xf67d('0x5')};function emitEvent(_0x19e2fb){return function(_0x3da3e4,_0x54a9de,_0x239959){_0x3da3e4[_0xf67d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30bb3c){_0x3da3e4[_0xf67d('0x7')](_0xf67d('0x8'),_0x30bb3c[_0xf67d('0x9')](function(_0x33763d){return{'id':_0x33763d['id']};}));return FaxMessage[_0xf67d('0xa')]({'where':{'FaxInteractionId':_0x3da3e4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf67d('0xb')](function(_0x5c9beb){_0x3da3e4[_0xf67d('0x7')](_0xf67d('0xc'),_0x5c9beb[_0xf67d('0xd')]);FaxInteractionEvents[_0xf67d('0xe')](_0x19e2fb+':'+_0x3da3e4['id'],_0x3da3e4);FaxInteractionEvents[_0xf67d('0xe')](_0x19e2fb,_0x3da3e4);_0x239959(null);})[_0xf67d('0xf')](_0x239959(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf67d('0x10')](e,emitEvent(event));}}module[_0xf67d('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e2ca094..6294a3e 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 _0x222a=['api','moment','request-promise','path','rimraf','./faxInteraction.attributes','exports','fax_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x3c19f8,_0x26d606){var _0x426384=function(_0x336c38){while(--_0x336c38){_0x3c19f8['push'](_0x3c19f8['shift']());}};_0x426384(++_0x26d606);}(_0x222a,0xb3));var _0xa222=function(_0x1c0152,_0x5cfdc5){_0x1c0152=_0x1c0152-0x0;var _0x564809=_0x222a[_0x1c0152];return _0x564809;};'use strict';var _=require(_0xa222('0x0'));var util=require(_0xa222('0x1'));var logger=require(_0xa222('0x2'))(_0xa222('0x3'));var moment=require(_0xa222('0x4'));var BPromise=require('bluebird');var rp=require(_0xa222('0x5'));var fs=require('fs');var path=require(_0xa222('0x6'));var rimraf=require(_0xa222('0x7'));var config=require('../../config/environment');var attributes=require(_0xa222('0x8'));module[_0xa222('0x9')]=function(_0x4f055,_0x99567a){return _0x4f055['define']('FaxInteraction',attributes,{'tableName':_0xa222('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4315e7,_0x3e2a35,_0x2f90f2){if(_0x4315e7[_0xa222('0xb')]('closed')){_0x4315e7[_0xa222('0xc')]=moment()['format'](_0xa222('0xd'));}_0x2f90f2(null,_0x4315e7);}}});}; \ No newline at end of file +var _0xc337=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0xad142b,_0x43aa90){var _0x2f8e8a=function(_0x31c786){while(--_0x31c786){_0xad142b['push'](_0xad142b['shift']());}};_0x2f8e8a(++_0x43aa90);}(_0xc337,0x150));var _0x7c33=function(_0x2a100a,_0x6ca0a6){_0x2a100a=_0x2a100a-0x0;var _0x57850f=_0xc337[_0x2a100a];return _0x57850f;};'use strict';var _=require(_0x7c33('0x0'));var util=require('util');var logger=require(_0x7c33('0x1'))('api');var moment=require(_0x7c33('0x2'));var BPromise=require(_0x7c33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c33('0x4'));var config=require(_0x7c33('0x5'));var attributes=require(_0x7c33('0x6'));module[_0x7c33('0x7')]=function(_0x275067,_0x5146b0){return _0x275067['define'](_0x7c33('0x8'),attributes,{'tableName':_0x7c33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30bf3e,_0x5c95bf,_0x5ad445){if(_0x30bf3e[_0x7c33('0xa')](_0x7c33('0xb'))){_0x30bf3e[_0x7c33('0xc')]=moment()[_0x7c33('0xd')](_0x7c33('0xe'));}_0x5ad445(null,_0x30bf3e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index fc7724a..14ef65e 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 _0xe9fa=['update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','ids','omit','spread','stringify','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxInteraction'];(function(_0x4390b5,_0x3d5732){var _0x40466f=function(_0x2a7d75){while(--_0x2a7d75){_0x4390b5['push'](_0x4390b5['shift']());}};_0x40466f(++_0x3d5732);}(_0xe9fa,0x1d1));var _0xae9f=function(_0x3b15d9,_0xb0a261){_0x3b15d9=_0x3b15d9-0x0;var _0x5d02c3=_0xe9fa[_0x3b15d9];return _0x5d02c3;};'use strict';var _=require(_0xae9f('0x0'));var util=require(_0xae9f('0x1'));var moment=require(_0xae9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xae9f('0x3'));var fs=require('fs');var Redis=require(_0xae9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae9f('0x5'));var logger=require('../../config/logger')(_0xae9f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae9f('0x7')][_0xae9f('0x8')]({'port':0x232a});config['redis']=_[_0xae9f('0x9')](config[_0xae9f('0xa')],{'host':_0xae9f('0xb'),'port':0x18eb});var socket=require(_0xae9f('0xc'))(new Redis(config[_0xae9f('0xa')]));require(_0xae9f('0xd'))[_0xae9f('0xe')](socket);function respondWithRpcPromise(_0x2f6477,_0x554568,_0x4c03d8){return new BPromise(function(_0xf5f088,_0x576657){return client['request'](_0x2f6477,_0x4c03d8)[_0xae9f('0xf')](function(_0x181360){logger[_0xae9f('0x10')](_0xae9f('0x11'),_0x554568,_0xae9f('0x12'));logger[_0xae9f('0x13')](_0xae9f('0x14'),_0x554568,_0xae9f('0x12'),JSON['stringify'](_0x181360));if(_0x181360[_0xae9f('0x15')]){if(_0x181360['error'][_0xae9f('0x16')]===0x1f4){logger[_0xae9f('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x554568,_0x181360[_0xae9f('0x15')][_0xae9f('0x17')]);return _0x576657(_0x181360[_0xae9f('0x15')][_0xae9f('0x17')]);}logger[_0xae9f('0x15')](_0xae9f('0x11'),_0x554568,_0x181360[_0xae9f('0x15')]['message']);return _0xf5f088(_0x181360[_0xae9f('0x15')]['message']);}else{logger[_0xae9f('0x10')](_0xae9f('0x11'),_0x554568,'request\x20sent');_0xf5f088(_0x181360[_0xae9f('0x18')]['message']);}})[_0xae9f('0x19')](function(_0x2115b7){logger[_0xae9f('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x554568,_0x2115b7);_0x576657(_0x2115b7);});});}exports['UpdateFaxInteraction']=function(_0x23d8e8){var _0x3bb3c4=this;return new Promise(function(_0x1aafde,_0x573d7a){return db[_0xae9f('0x1a')][_0xae9f('0x1b')](_0x23d8e8[_0xae9f('0x1c')],{'raw':_0x23d8e8[_0xae9f('0x1d')]?_0x23d8e8[_0xae9f('0x1d')][_0xae9f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d8e8[_0xae9f('0x1d')]?_0x23d8e8[_0xae9f('0x1d')][_0xae9f('0x1f')]||null:null,'attributes':_0x23d8e8[_0xae9f('0x1d')]?_0x23d8e8[_0xae9f('0x1d')][_0xae9f('0x20')]||null:null,'limit':_0x23d8e8['options']?_0x23d8e8['options'][_0xae9f('0x21')]||null:null})[_0xae9f('0xf')](function(_0x565201){logger[_0xae9f('0x10')](_0xae9f('0x22'),_0x23d8e8);logger[_0xae9f('0x13')](_0xae9f('0x22'),_0x23d8e8,JSON['stringify'](_0x565201));_0x1aafde(_0x565201);})[_0xae9f('0x19')](function(_0x153a3b){logger[_0xae9f('0x15')](_0xae9f('0x22'),_0x153a3b[_0xae9f('0x17')],_0x23d8e8);_0x573d7a(_0x3bb3c4[_0xae9f('0x15')](0x1f4,_0x153a3b['message']));});});};exports[_0xae9f('0x23')]=function(_0xa6979){return new Promise(function(_0x2b4e09,_0x2d99a2){return db[_0xae9f('0x1a')]['find']({'where':_0xa6979[_0xae9f('0x1d')]?_0xa6979[_0xae9f('0x1d')][_0xae9f('0x1f')]||null:null})[_0xae9f('0xf')](function(_0x4d1d04){if(_0x4d1d04){return _0x4d1d04['addTags'](_0xa6979[_0xae9f('0x1c')][_0xae9f('0x24')],_[_0xae9f('0x25')](_0xa6979[_0xae9f('0x1c')],[_0xae9f('0x24'),'id'])||{});}})[_0xae9f('0x26')](function(_0x6cadee){logger['info']('AddTags',_0xa6979);logger[_0xae9f('0x13')]('AddTags',_0xa6979,JSON[_0xae9f('0x27')](_0x6cadee));_0x2b4e09(_0x6cadee);})[_0xae9f('0x19')](function(_0x401e85){logger[_0xae9f('0x15')](_0xae9f('0x28'),_0x401e85[_0xae9f('0x17')],_0xa6979);_0x2d99a2(_this['error'](0x1f4,_0x401e85[_0xae9f('0x17')]));});});}; \ No newline at end of file +var _0x8c85=['client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','then','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8ae7f5,_0x55396e){var _0x19cd92=function(_0x14ff9e){while(--_0x14ff9e){_0x8ae7f5['push'](_0x8ae7f5['shift']());}};_0x19cd92(++_0x55396e);}(_0x8c85,0x13e));var _0x58c8=function(_0x17b6b5,_0x426a32){_0x17b6b5=_0x17b6b5-0x0;var _0x579061=_0x8c85[_0x17b6b5];return _0x579061;};'use strict';var _=require(_0x58c8('0x0'));var util=require(_0x58c8('0x1'));var moment=require(_0x58c8('0x2'));var BPromise=require(_0x58c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58c8('0x4'));var db=require(_0x58c8('0x5'))['db'];var utils=require(_0x58c8('0x6'));var logger=require(_0x58c8('0x7'))(_0x58c8('0x8'));var config=require(_0x58c8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58c8('0xa')]['http']({'port':0x232a});config[_0x58c8('0xb')]=_[_0x58c8('0xc')](config[_0x58c8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x58c8('0xd'))(new Redis(config[_0x58c8('0xb')]));require(_0x58c8('0xe'))[_0x58c8('0xf')](socket);function respondWithRpcPromise(_0x207fec,_0x5e8a10,_0x3289ba){return new BPromise(function(_0x13e3df,_0xaead31){return client[_0x58c8('0x10')](_0x207fec,_0x3289ba)['then'](function(_0x4261d1){logger['info'](_0x58c8('0x11'),_0x5e8a10,'request\x20sent');logger[_0x58c8('0x12')](_0x58c8('0x13'),_0x5e8a10,_0x58c8('0x14'),JSON[_0x58c8('0x15')](_0x4261d1));if(_0x4261d1[_0x58c8('0x16')]){if(_0x4261d1[_0x58c8('0x16')][_0x58c8('0x17')]===0x1f4){logger[_0x58c8('0x16')](_0x58c8('0x11'),_0x5e8a10,_0x4261d1[_0x58c8('0x16')][_0x58c8('0x18')]);return _0xaead31(_0x4261d1['error'][_0x58c8('0x18')]);}logger['error'](_0x58c8('0x11'),_0x5e8a10,_0x4261d1[_0x58c8('0x16')]['message']);return _0x13e3df(_0x4261d1[_0x58c8('0x16')][_0x58c8('0x18')]);}else{logger[_0x58c8('0x19')](_0x58c8('0x11'),_0x5e8a10,'request\x20sent');_0x13e3df(_0x4261d1[_0x58c8('0x1a')]['message']);}})[_0x58c8('0x1b')](function(_0x304a7f){logger['error'](_0x58c8('0x11'),_0x5e8a10,_0x304a7f);_0xaead31(_0x304a7f);});});}exports[_0x58c8('0x1c')]=function(_0x340e7a){var _0x412eb6=this;return new Promise(function(_0x284e2a,_0x1414ba){return db[_0x58c8('0x1d')][_0x58c8('0x1e')](_0x340e7a[_0x58c8('0x1f')],{'raw':_0x340e7a['options']?_0x340e7a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x340e7a[_0x58c8('0x20')]?_0x340e7a['options'][_0x58c8('0x21')]||null:null,'attributes':_0x340e7a[_0x58c8('0x20')]?_0x340e7a['options'][_0x58c8('0x22')]||null:null,'limit':_0x340e7a['options']?_0x340e7a[_0x58c8('0x20')][_0x58c8('0x23')]||null:null})['then'](function(_0x44aa6d){logger[_0x58c8('0x19')]('UpdateFaxInteraction',_0x340e7a);logger['debug'](_0x58c8('0x1c'),_0x340e7a,JSON['stringify'](_0x44aa6d));_0x284e2a(_0x44aa6d);})[_0x58c8('0x1b')](function(_0x54cb1b){logger[_0x58c8('0x16')](_0x58c8('0x1c'),_0x54cb1b[_0x58c8('0x18')],_0x340e7a);_0x1414ba(_0x412eb6['error'](0x1f4,_0x54cb1b[_0x58c8('0x18')]));});});};exports[_0x58c8('0x24')]=function(_0x13a74b){return new Promise(function(_0x2a15a2,_0x2526e2){return db[_0x58c8('0x1d')][_0x58c8('0x25')]({'where':_0x13a74b[_0x58c8('0x20')]?_0x13a74b[_0x58c8('0x20')][_0x58c8('0x21')]||null:null})[_0x58c8('0x26')](function(_0x2ed044){if(_0x2ed044){return _0x2ed044['addTags'](_0x13a74b['body'][_0x58c8('0x27')],_['omit'](_0x13a74b[_0x58c8('0x1f')],['ids','id'])||{});}})['spread'](function(_0x4844d9){logger[_0x58c8('0x19')](_0x58c8('0x28'),_0x13a74b);logger['debug'](_0x58c8('0x28'),_0x13a74b,JSON[_0x58c8('0x15')](_0x4844d9));_0x2a15a2(_0x4844d9);})['catch'](function(_0x22b4e3){logger[_0x58c8('0x16')](_0x58c8('0x28'),_0x22b4e3[_0x58c8('0x18')],_0x13a74b);_0x2526e2(_this[_0x58c8('0x16')](0x1f4,_0x22b4e3[_0x58c8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a8c26af..3c33965 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 _0xa6e4=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x72c0b2,_0x1d7119){var _0xc44a49=function(_0x284f45){while(--_0x284f45){_0x72c0b2['push'](_0x72c0b2['shift']());}};_0xc44a49(++_0x1d7119);}(_0xa6e4,0x166));var _0x4a6e=function(_0x1be03a,_0x2bb41b){_0x1be03a=_0x1be03a-0x0;var _0x1b3268=_0xa6e4[_0x1be03a];return _0x1b3268;};'use strict';var FaxInteractionEvents=require(_0x4a6e('0x0'));var events=[_0x4a6e('0x1'),_0x4a6e('0x2'),_0x4a6e('0x3')];function createListener(_0x19b1ea,_0x80bd1f){return function(_0x36769e){_0x80bd1f[_0x4a6e('0x4')](_0x19b1ea,_0x36769e);};}function removeListener(_0x51db58,_0x1887c4){return function(){FaxInteractionEvents[_0x4a6e('0x5')](_0x51db58,_0x1887c4);};}exports[_0x4a6e('0x6')]=function(_0x2ae9a5){for(var _0x386c91=0x0,_0x5d3521=events[_0x4a6e('0x7')];_0x386c91<_0x5d3521;_0x386c91++){var _0x4e70bc=events[_0x386c91];var _0x1fa6f4=createListener(_0x4a6e('0x8')+_0x4e70bc,_0x2ae9a5);FaxInteractionEvents['on'](_0x4e70bc,_0x1fa6f4);}}; \ No newline at end of file +var _0x0fdf=['update','emit','removeListener','register','length','./faxInteraction.events','save','remove'];(function(_0x312205,_0x540acb){var _0x1805bc=function(_0xe86b59){while(--_0xe86b59){_0x312205['push'](_0x312205['shift']());}};_0x1805bc(++_0x540acb);}(_0x0fdf,0x1ed));var _0xf0fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fdf[_0x321bb2];return _0x9c12ed;};'use strict';var FaxInteractionEvents=require(_0xf0fd('0x0'));var events=[_0xf0fd('0x1'),_0xf0fd('0x2'),_0xf0fd('0x3')];function createListener(_0xb70ce9,_0x1ea0b8){return function(_0x41a1ae){_0x1ea0b8[_0xf0fd('0x4')](_0xb70ce9,_0x41a1ae);};}function removeListener(_0x925227,_0x4ec3ba){return function(){FaxInteractionEvents[_0xf0fd('0x5')](_0x925227,_0x4ec3ba);};}exports[_0xf0fd('0x6')]=function(_0x3e0fcd){for(var _0x5a7f1b=0x0,_0x583ca6=events[_0xf0fd('0x7')];_0x5a7f1b<_0x583ca6;_0x5a7f1b++){var _0x888ccc=events[_0x5a7f1b];var _0x1a7c08=createListener('faxInteraction:'+_0x888ccc,_0x3e0fcd);FaxInteractionEvents['on'](_0x888ccc,_0x1a7c08);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 94bb5ee..42d48e6 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 _0xd3e7=['destroy','delete','removeTags','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','put','faxinteraction:update','update'];(function(_0x47b14c,_0x19885f){var _0x43234f=function(_0x15437c){while(--_0x15437c){_0x47b14c['push'](_0x47b14c['shift']());}};_0x43234f(++_0x19885f);}(_0xd3e7,0x130));var _0x7d3e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3e7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7d3e('0x0'));var util=require(_0x7d3e('0x1'));var path=require('path');var timeout=require(_0x7d3e('0x2'));var express=require(_0x7d3e('0x3'));var router=express['Router']();var fs_extra=require(_0x7d3e('0x4'));var auth=require(_0x7d3e('0x5'));var interaction=require(_0x7d3e('0x6'));var config=require(_0x7d3e('0x7'));var controller=require('./faxInteraction.controller');router[_0x7d3e('0x8')]('/',auth[_0x7d3e('0x9')](),controller[_0x7d3e('0xa')]);router[_0x7d3e('0x8')](_0x7d3e('0xb'),auth[_0x7d3e('0x9')](),controller['describe']);router[_0x7d3e('0x8')](_0x7d3e('0xc'),auth[_0x7d3e('0x9')](),controller[_0x7d3e('0xd')]);router[_0x7d3e('0x8')]('/:id/messages',auth[_0x7d3e('0x9')](),controller[_0x7d3e('0xe')]);router[_0x7d3e('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x7d3e('0xf')]);router[_0x7d3e('0x10')]('/',auth['isAuthenticated'](),controller[_0x7d3e('0x11')]);router[_0x7d3e('0x10')](_0x7d3e('0x12'),auth[_0x7d3e('0x9')](),controller[_0x7d3e('0x13')]);router['post'](_0x7d3e('0x14'),auth[_0x7d3e('0x9')](),interaction[_0x7d3e('0x15')](_0x7d3e('0x16'),'faxinteraction:addtags'),controller['addTags']);router[_0x7d3e('0x17')](_0x7d3e('0xc'),auth[_0x7d3e('0x9')](),interaction[_0x7d3e('0x15')](_0x7d3e('0x16'),_0x7d3e('0x18')),controller[_0x7d3e('0x19')]);router['delete'](_0x7d3e('0xc'),auth[_0x7d3e('0x9')](),interaction[_0x7d3e('0x15')]('fax','faxinteraction:destroy'),controller[_0x7d3e('0x1a')]);router[_0x7d3e('0x1b')](_0x7d3e('0x14'),auth[_0x7d3e('0x9')](),controller[_0x7d3e('0x1c')]);module[_0x7d3e('0x1d')]=router; \ No newline at end of file +var _0xf186=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0xf186,0xea));var _0x6f18=function(_0x39e6f9,_0x155795){_0x39e6f9=_0x39e6f9-0x0;var _0x31a2f4=_0xf186[_0x39e6f9];return _0x31a2f4;};'use strict';var multer=require(_0x6f18('0x0'));var util=require(_0x6f18('0x1'));var path=require(_0x6f18('0x2'));var timeout=require(_0x6f18('0x3'));var express=require(_0x6f18('0x4'));var router=express[_0x6f18('0x5')]();var fs_extra=require(_0x6f18('0x6'));var auth=require(_0x6f18('0x7'));var interaction=require(_0x6f18('0x8'));var config=require(_0x6f18('0x9'));var controller=require('./faxInteraction.controller');router[_0x6f18('0xa')]('/',auth[_0x6f18('0xb')](),controller[_0x6f18('0xc')]);router[_0x6f18('0xa')](_0x6f18('0xd'),auth['isAuthenticated'](),controller[_0x6f18('0xe')]);router['get'](_0x6f18('0xf'),auth['isAuthenticated'](),controller[_0x6f18('0x10')]);router[_0x6f18('0xa')]('/:id/messages',auth[_0x6f18('0xb')](),controller['getMessages']);router[_0x6f18('0xa')](_0x6f18('0x11'),auth[_0x6f18('0xb')](),controller[_0x6f18('0x12')]);router[_0x6f18('0x13')]('/',auth[_0x6f18('0xb')](),controller[_0x6f18('0x14')]);router['post']('/:id/messages',auth[_0x6f18('0xb')](),controller['addMessage']);router['post'](_0x6f18('0x15'),auth[_0x6f18('0xb')](),interaction[_0x6f18('0x16')](_0x6f18('0x17'),'faxinteraction:addtags'),controller[_0x6f18('0x18')]);router['put'](_0x6f18('0xf'),auth['isAuthenticated'](),interaction['tracked']('fax',_0x6f18('0x19')),controller[_0x6f18('0x1a')]);router[_0x6f18('0x1b')](_0x6f18('0xf'),auth['isAuthenticated'](),interaction[_0x6f18('0x16')](_0x6f18('0x17'),_0x6f18('0x1c')),controller['destroy']);router[_0x6f18('0x1b')](_0x6f18('0x15'),auth['isAuthenticated'](),controller[_0x6f18('0x1d')]);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 b5a75d8..2410daa 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 _0x8ece=['medium','out','DATE','sequelize','exports','TEXT'];(function(_0x2d6e66,_0x3de933){var _0x42af90=function(_0x1cf6df){while(--_0x1cf6df){_0x2d6e66['push'](_0x2d6e66['shift']());}};_0x42af90(++_0x3de933);}(_0x8ece,0x195));var _0xe8ec=function(_0x90d801,_0x5e10e5){_0x90d801=_0x90d801-0x0;var _0x136d39=_0x8ece[_0x90d801];return _0x136d39;};'use strict';var Sequelize=require(_0xe8ec('0x0'));module[_0xe8ec('0x1')]={'body':{'type':Sequelize[_0xe8ec('0x2')](_0xe8ec('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe8ec('0x4')),'defaultValue':_0xe8ec('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe8ec('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe8ec('0x5')]}}; \ No newline at end of file +var _0xb2b3=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0xb2b3,0x71));var _0x3b2b=function(_0x3c6654,_0x396840){_0x3c6654=_0x3c6654-0x0;var _0x1357f7=_0xb2b3[_0x3c6654];return _0x1357f7;};'use strict';var Sequelize=require(_0x3b2b('0x0'));module[_0x3b2b('0x1')]={'body':{'type':Sequelize[_0x3b2b('0x2')](_0x3b2b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3b2b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b2b('0x5')]('in',_0x3b2b('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x3b2b('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3b2b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 08bb253..2a9c2c2 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 _0xeaba=['query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','find','body','params','describe','../../config/logger','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','acceptMessage','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','User','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','stack','name','send','map','FaxMessage','type','model'];(function(_0x39b68b,_0x4ad96d){var _0xae091f=function(_0x13b5e1){while(--_0x13b5e1){_0x39b68b['push'](_0x39b68b['shift']());}};_0xae091f(++_0x4ad96d);}(_0xeaba,0xdb));var _0xaeab=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xeaba[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0xaeab('0x0'));var rimraf=require(_0xaeab('0x1'));var zipdir=require(_0xaeab('0x2'));var jsonpatch=require(_0xaeab('0x3'));var rp=require(_0xaeab('0x4'));var moment=require('moment');var BPromise=require(_0xaeab('0x5'));var Mustache=require('mustache');var util=require(_0xaeab('0x6'));var path=require(_0xaeab('0x7'));var sox=require(_0xaeab('0x8'));var csv=require(_0xaeab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaeab('0xa'));var _=require('lodash');var squel=require(_0xaeab('0xb'));var crypto=require(_0xaeab('0xc'));var jsforce=require(_0xaeab('0xd'));var deskjs=require(_0xaeab('0xe'));var toCsv=require(_0xaeab('0x9'));var querystring=require(_0xaeab('0xf'));var Papa=require(_0xaeab('0x10'));var Redis=require(_0xaeab('0x11'));var authService=require(_0xaeab('0x12'));var qs=require(_0xaeab('0x13'));var as=require(_0xaeab('0x14'));var hardwareService=require(_0xaeab('0x15'));var logger=require('../../config/logger')(_0xaeab('0x16'));var utils=require('../../config/utils');var config=require(_0xaeab('0x17'));var licenseUtil=require(_0xaeab('0x18'));var db=require(_0xaeab('0x19'))['db'];config['redis']=_[_0xaeab('0x1a')](config[_0xaeab('0x1b')],{'host':_0xaeab('0x1c'),'port':0x18eb});var socket=require(_0xaeab('0x1d'))(new Redis(config[_0xaeab('0x1b')]));require(_0xaeab('0x1e'))[_0xaeab('0x1f')](socket);var jayson=require(_0xaeab('0x20'));var client=jayson[_0xaeab('0x21')][_0xaeab('0x22')]({'port':0x232c});var client9002=jayson[_0xaeab('0x21')][_0xaeab('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x24943f,_0xdbe635,_0x272e1f,_0xe0174d){return new BPromise(function(_0x424d17,_0x50479d){var _0x253d48=_0xe0174d||client;return _0x253d48['request'](_0x24943f,_0x272e1f)['then'](function(_0x376c4f){logger[_0xaeab('0x23')]('FaxMessage,\x20%s,\x20%s',_0xdbe635,_0xaeab('0x24'));logger[_0xaeab('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xdbe635,_0xaeab('0x24'),JSON[_0xaeab('0x26')](_0x376c4f));if(_0x376c4f[_0xaeab('0x27')]){if(_0x376c4f['error']['code']===0x1f4){logger[_0xaeab('0x27')](_0xaeab('0x28'),_0xdbe635,_0x376c4f[_0xaeab('0x27')]['message']);return _0x50479d(_0x376c4f['error']['message']);}logger[_0xaeab('0x27')](_0xaeab('0x28'),_0xdbe635,_0x376c4f[_0xaeab('0x27')][_0xaeab('0x29')]);return _0x424d17(_0x376c4f[_0xaeab('0x27')][_0xaeab('0x29')]);}else{logger[_0xaeab('0x23')](_0xaeab('0x28'),_0xdbe635,_0xaeab('0x24'));_0x424d17(_0x376c4f[_0xaeab('0x2a')]['message']);}})['catch'](function(_0x1c31b9){logger[_0xaeab('0x27')](_0xaeab('0x28'),_0xdbe635,_0x1c31b9);_0x50479d(_0x1c31b9);});});}function respondWithStatusCode(_0x1a5869,_0x52d185){_0x52d185=_0x52d185||0xcc;return function(_0x39e0a5){if(_0x39e0a5){return _0x1a5869['sendStatus'](_0x52d185);}return _0x1a5869['status'](_0x52d185)['end']();};}function respondWithResult(_0x3dcc8a,_0x5a7477){_0x5a7477=_0x5a7477||0xc8;return function(_0x4588be){if(_0x4588be){return _0x3dcc8a[_0xaeab('0x2b')](_0x5a7477)[_0xaeab('0x2c')](_0x4588be);}};}function respondWithFilteredResult(_0x12481b,_0x3ae62e){return function(_0x311de2){if(_0x311de2){var _0x63511e=typeof _0x3ae62e[_0xaeab('0x2d')]===_0xaeab('0x2e')&&typeof _0x3ae62e['limit']===_0xaeab('0x2e');var _0x1c6edc=_0x311de2[_0xaeab('0x2f')];var _0x346dc4=_0x63511e?0x0:_0x3ae62e[_0xaeab('0x2d')];var _0x3d5e02=_0x63511e?_0x311de2[_0xaeab('0x2f')]:_0x3ae62e[_0xaeab('0x2d')]+_0x3ae62e[_0xaeab('0x30')];var _0x45a7a2;if(_0x3d5e02>=_0x1c6edc){_0x3d5e02=_0x1c6edc;_0x45a7a2=0xc8;}else{_0x45a7a2=0xce;}_0x12481b[_0xaeab('0x2b')](_0x45a7a2);return _0x12481b[_0xaeab('0x31')]('Content-Range',_0x346dc4+'-'+_0x3d5e02+'/'+_0x1c6edc)[_0xaeab('0x2c')](_0x311de2);}return null;};}function patchUpdates(_0x583403){return function(_0x304cf4){try{jsonpatch[_0xaeab('0x32')](_0x304cf4,_0x583403,!![]);}catch(_0xf5da6b){return BPromise[_0xaeab('0x33')](_0xf5da6b);}return _0x304cf4[_0xaeab('0x34')]();};}function saveUpdates(_0x2f9f1e,_0x2141ac){return function(_0x285e6f){if(_0x285e6f){return _0x285e6f['update'](_0x2f9f1e)[_0xaeab('0x35')](function(_0x3eb0b1){return _0x3eb0b1;});}return null;};}function removeEntity(_0x408caf,_0x3d3195){return function(_0x5afcb4){if(_0x5afcb4){return _0x5afcb4[_0xaeab('0x36')]()[_0xaeab('0x35')](function(){_0x408caf[_0xaeab('0x2b')](0xcc)[_0xaeab('0x37')]();});}};}function handleEntityNotFound(_0x53f4e3,_0x1489c3){return function(_0x552227){if(!_0x552227){_0x53f4e3['sendStatus'](0x194);}return _0x552227;};}function handleError(_0x17a40f,_0x1ceb78){_0x1ceb78=_0x1ceb78||0x1f4;return function(_0x58aaef){logger[_0xaeab('0x27')](_0x58aaef[_0xaeab('0x38')]);if(_0x58aaef['name']){delete _0x58aaef[_0xaeab('0x39')];}_0x17a40f[_0xaeab('0x2b')](_0x1ceb78)[_0xaeab('0x3a')](_0x58aaef);};}exports['index']=function(_0x3e28c8,_0x5a3bcc){var _0x1d57b0={},_0x2fafc5={},_0x233314={'count':0x0,'rows':[]};var _0x41d548=_[_0xaeab('0x3b')](db[_0xaeab('0x3c')]['rawAttributes'],function(_0x2f9c4c){return{'name':_0x2f9c4c['fieldName'],'type':_0x2f9c4c[_0xaeab('0x3d')]['key']};});_0x2fafc5[_0xaeab('0x3e')]=_['map'](_0x41d548,_0xaeab('0x39'));_0x2fafc5[_0xaeab('0x3f')]=_[_0xaeab('0x40')](_0x3e28c8['query']);_0x2fafc5['filters']=_[_0xaeab('0x41')](_0x2fafc5[_0xaeab('0x3e')],_0x2fafc5[_0xaeab('0x3f')]);_0x1d57b0[_0xaeab('0x42')]=_[_0xaeab('0x41')](_0x2fafc5[_0xaeab('0x3e')],qs[_0xaeab('0x43')](_0x3e28c8[_0xaeab('0x3f')][_0xaeab('0x43')]));_0x1d57b0[_0xaeab('0x42')]=_0x1d57b0[_0xaeab('0x42')]['length']?_0x1d57b0[_0xaeab('0x42')]:_0x2fafc5[_0xaeab('0x3e')];if(!_0x3e28c8[_0xaeab('0x3f')][_0xaeab('0x44')]('nolimit')){_0x1d57b0['limit']=qs[_0xaeab('0x30')](_0x3e28c8['query']['limit']);_0x1d57b0[_0xaeab('0x2d')]=qs[_0xaeab('0x2d')](_0x3e28c8[_0xaeab('0x3f')]['offset']);}_0x1d57b0[_0xaeab('0x45')]=qs[_0xaeab('0x46')](_0x3e28c8[_0xaeab('0x3f')]['sort']);_0x1d57b0[_0xaeab('0x47')]=qs[_0xaeab('0x48')](_[_0xaeab('0x49')](_0x3e28c8['query'],_0x2fafc5['filters']),_0x41d548);if(_0x3e28c8[_0xaeab('0x3f')][_0xaeab('0x4a')]){_0x1d57b0[_0xaeab('0x47')]=_[_0xaeab('0x4b')](_0x1d57b0['where'],{'$or':_['map'](_0x41d548,function(_0x52e771){if(_0x52e771[_0xaeab('0x3d')]!=='VIRTUAL'){var _0x5b889e={};_0x5b889e[_0x52e771[_0xaeab('0x39')]]={'$like':'%'+_0x3e28c8['query'][_0xaeab('0x4a')]+'%'};return _0x5b889e;}})});}_0x1d57b0=_[_0xaeab('0x4b')]({},_0x1d57b0,_0x3e28c8[_0xaeab('0x4c')]);var _0x32b211={'where':_0x1d57b0['where']};return db['FaxMessage'][_0xaeab('0x2f')](_0x32b211)[_0xaeab('0x35')](function(_0x3df136){_0x233314[_0xaeab('0x2f')]=_0x3df136;if(_0x3e28c8[_0xaeab('0x3f')]['includeAll']){_0x1d57b0[_0xaeab('0x4d')]=[{'all':!![]}];}return db['FaxMessage'][_0xaeab('0x4e')](_0x1d57b0);})['then'](function(_0x44b75e){_0x233314[_0xaeab('0x4f')]=_0x44b75e;return _0x233314;})[_0xaeab('0x35')](respondWithFilteredResult(_0x5a3bcc,_0x1d57b0))[_0xaeab('0x50')](handleError(_0x5a3bcc,null));};exports[_0xaeab('0x51')]=function(_0x4edf83,_0x2690ea){var _0x2c2da5={'raw':!![],'where':{'id':_0x4edf83['params']['id']}},_0x1511dc={};_0x1511dc[_0xaeab('0x3e')]=_[_0xaeab('0x40')](db[_0xaeab('0x3c')][_0xaeab('0x52')]);_0x1511dc['query']=_[_0xaeab('0x40')](_0x4edf83[_0xaeab('0x3f')]);_0x1511dc['filters']=_[_0xaeab('0x41')](_0x1511dc[_0xaeab('0x3e')],_0x1511dc[_0xaeab('0x3f')]);_0x2c2da5[_0xaeab('0x42')]=_[_0xaeab('0x41')](_0x1511dc['model'],qs['fields'](_0x4edf83['query'][_0xaeab('0x43')]));_0x2c2da5[_0xaeab('0x42')]=_0x2c2da5[_0xaeab('0x42')]['length']?_0x2c2da5['attributes']:_0x1511dc['model'];if(_0x4edf83[_0xaeab('0x3f')]['includeAll']){_0x2c2da5[_0xaeab('0x4d')]=[{'all':!![]}];}_0x2c2da5=_[_0xaeab('0x4b')]({},_0x2c2da5,_0x4edf83['options']);return db[_0xaeab('0x3c')][_0xaeab('0x53')](_0x2c2da5)[_0xaeab('0x35')](handleEntityNotFound(_0x2690ea,null))[_0xaeab('0x35')](respondWithResult(_0x2690ea,null))[_0xaeab('0x50')](handleError(_0x2690ea,null));};exports['update']=function(_0x149b91,_0x187b6e){if(_0x149b91[_0xaeab('0x54')]['id']){delete _0x149b91[_0xaeab('0x54')]['id'];}return db[_0xaeab('0x3c')][_0xaeab('0x53')]({'where':{'id':_0x149b91['params']['id']}})[_0xaeab('0x35')](handleEntityNotFound(_0x187b6e,null))[_0xaeab('0x35')](saveUpdates(_0x149b91['body'],null))[_0xaeab('0x35')](respondWithResult(_0x187b6e,null))[_0xaeab('0x50')](handleError(_0x187b6e,null));};exports[_0xaeab('0x36')]=function(_0x107986,_0x4b0d52){return db[_0xaeab('0x3c')]['find']({'where':{'id':_0x107986[_0xaeab('0x55')]['id']}})[_0xaeab('0x35')](handleEntityNotFound(_0x4b0d52,null))[_0xaeab('0x35')](removeEntity(_0x4b0d52,null))[_0xaeab('0x50')](handleError(_0x4b0d52,null));};exports[_0xaeab('0x56')]=function(_0x780b07,_0x231a2f){return db[_0xaeab('0x3c')][_0xaeab('0x56')]()[_0xaeab('0x35')](respondWithResult(_0x231a2f,null))['catch'](handleError(_0x231a2f,null));};var interaction_log=require(_0xaeab('0x57'))('fax-interactions');exports[_0xaeab('0x58')]=function(_0x1de83d,_0xa53820,_0x215be9){var _0x9c33a2={'agent':{},'channel':_0xaeab('0x59')};if(_0x1de83d[_0xaeab('0x54')]['id']){delete _0x1de83d[_0xaeab('0x54')]['id'];}_0x1de83d[_0xaeab('0x54')][_0xaeab('0x5a')]=!![];_0x1de83d[_0xaeab('0x54')]['readAt']=moment()['format'](_0xaeab('0x5b'));_0x1de83d[_0xaeab('0x54')]['UserId']=_0x1de83d['body'][_0xaeab('0x5c')]||_0x1de83d[_0xaeab('0x5d')]['id'];_0x9c33a2[_0xaeab('0x5e')]['id']=_0x1de83d['body'][_0xaeab('0x5c')];return db[_0xaeab('0x3c')][_0xaeab('0x53')]({'where':{'id':_0x1de83d[_0xaeab('0x55')]['id'],'UserId':null}})[_0xaeab('0x35')](handleEntityNotFound(_0xa53820,null))['then'](saveUpdates(_0x1de83d['body'],null))[_0xaeab('0x35')](function(_0x510bf5){if(_0x510bf5){_0x9c33a2[_0xaeab('0x29')]=_0x510bf5[_0xaeab('0x5f')]({'plain':!![]});return db[_0xaeab('0x60')][_0xaeab('0x53')]({'where':{'id':_0x510bf5[_0xaeab('0x61')]}});}return null;})[_0xaeab('0x35')](handleEntityNotFound(_0xa53820,null))[_0xaeab('0x35')](function(_0x463d0c){if(_0x463d0c){return _0x463d0c['update']({'UserId':_0x1de83d[_0xaeab('0x54')][_0xaeab('0x5c')],'read1stAt':_[_0xaeab('0x62')](_0x463d0c['read1stAt'])?moment()['format'](_0xaeab('0x5b')):undefined});}return null;})[_0xaeab('0x35')](function(_0x2a5dfe){if(_0x2a5dfe){_0x9c33a2['interaction']=_0x2a5dfe[_0xaeab('0x5f')]({'plain':!![]});interaction_log['info'](_0xaeab('0x63'),_0x1de83d[_0xaeab('0x5d')]['id'],_0x1de83d[_0xaeab('0x5d')][_0xaeab('0x39')],_0x1de83d[_0xaeab('0x5d')]['role'],_0x9c33a2[_0xaeab('0x64')]['id'],_0x1de83d[_0xaeab('0x54')]?JSON[_0xaeab('0x26')](_0x1de83d[_0xaeab('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0xaeab('0x65'),_0x9c33a2);}return null;})['then'](function(_0x351e8e){var _0x5b060e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x351e8e[_0xaeab('0x29')][_0xaeab('0x66')];return db['sequelize'][_0xaeab('0x3f')](_0x5b060e,{'type':db[_0xaeab('0x67')][_0xaeab('0x68')]['SELECT'],'raw':!![]})[_0xaeab('0x35')](function(_0x3c2f60){return _0x3c2f60;});})['then'](function(_0x4a7930){if(_0x4a7930){_0x9c33a2['message'][_0xaeab('0x69')]=_0x4a7930[0x0];if(!_0x1de83d[_0xaeab('0x54')]['UserId'])return;return db['User'][_0xaeab('0x53')]({'where':{'id':_0x1de83d['body'][_0xaeab('0x5c')],'role':_0xaeab('0x5e')},'attributes':['id',_0xaeab('0x39'),_0xaeab('0x6a'),_0xaeab('0x6b'),_0xaeab('0x6c')],'raw':!![]});}return null;})['then'](function(_0x4d96bd){if(!_0x4d96bd)return null;_0x9c33a2[_0xaeab('0x29')][_0xaeab('0x5e')]=_0x4d96bd;return _0x9c33a2;})[_0xaeab('0x35')](function(_0x146e62){if(_0x146e62){if(_0x1de83d['body'][_0xaeab('0x6d')]){_0x9c33a2[_0xaeab('0x29')][_0xaeab('0x6e')]=util[_0xaeab('0x6f')](_0xaeab('0x70'),_0x1de83d[_0xaeab('0x5d')][_0xaeab('0x39')]);_0x9c33a2[_0xaeab('0x29')]['channel']=_0x9c33a2[_0xaeab('0x71')];_0x9c33a2['message'][_0xaeab('0x72')]=_0x9c33a2['channel'];_0x9c33a2['message'][_0xaeab('0x73')]=_0xaeab('0x58');return respondWithRpcPromise(_0xaeab('0x74'),_0xaeab('0x74'),{'event':_0xaeab('0x75'),'message':_0x9c33a2['message']},client9002)['then'](function(){return _0x9c33a2;});}return _0x9c33a2;}return null;})[_0xaeab('0x35')](respondWithResult(_0xa53820,null))[_0xaeab('0x50')](handleError(_0xa53820,null));};var interaction_log=require(_0xaeab('0x57'))(_0xaeab('0x76'));exports[_0xaeab('0x33')]=function(_0xb38ea9,_0x295156,_0x2135d0){var _0x36a3bd={'agent':{},'channel':'fax'};if(_0xb38ea9['body']['id']){delete _0xb38ea9[_0xaeab('0x54')]['id'];}_0xb38ea9[_0xaeab('0x54')]['UserId']=_0xb38ea9['body'][_0xaeab('0x5c')]||_0xb38ea9[_0xaeab('0x5d')]['id'];_0x36a3bd[_0xaeab('0x5e')]['id']=_0xb38ea9[_0xaeab('0x54')][_0xaeab('0x5c')];return db[_0xaeab('0x3c')][_0xaeab('0x53')]({'where':{'id':_0xb38ea9[_0xaeab('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x295156,null))[_0xaeab('0x35')](function(_0x5d3aaa){if(_0x5d3aaa){_0x36a3bd['message']=_0x5d3aaa['get']({'plain':!![]});return db[_0xaeab('0x60')][_0xaeab('0x53')]({'where':{'id':_0x5d3aaa[_0xaeab('0x61')]}});}return null;})[_0xaeab('0x35')](handleEntityNotFound(_0x295156,null))['then'](function(_0x2eeab1){if(_0x2eeab1){_0x36a3bd[_0xaeab('0x64')]=_0x2eeab1[_0xaeab('0x5f')]({'plain':!![]});interaction_log[_0xaeab('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb38ea9['user']['id'],_0xb38ea9['user'][_0xaeab('0x39')],_0xb38ea9[_0xaeab('0x5d')][_0xaeab('0x77')],_0x36a3bd[_0xaeab('0x64')]['id'],_0xb38ea9['body']?JSON[_0xaeab('0x26')](_0xb38ea9[_0xaeab('0x54')]):_0xaeab('0x78'));return respondWithRpcPromise(_0xaeab('0x79'),_0xaeab('0x7a'),_0x36a3bd);}return null;})['then'](function(_0x26ee8b){var _0x4b38b3=_0xaeab('0x7b')+_0x26ee8b[_0xaeab('0x29')]['ContactId'];return db[_0xaeab('0x7c')]['query'](_0x4b38b3,{'type':db['Sequelize'][_0xaeab('0x68')][_0xaeab('0x7d')],'raw':!![]})[_0xaeab('0x35')](function(_0x133060){return _0x133060;});})[_0xaeab('0x35')](function(_0x58dc85){if(_0x58dc85){_0x36a3bd[_0xaeab('0x29')][_0xaeab('0x69')]=_0x58dc85[0x0];if(!_0xb38ea9[_0xaeab('0x54')][_0xaeab('0x5c')])return;return db[_0xaeab('0x7e')][_0xaeab('0x53')]({'where':{'id':_0xb38ea9[_0xaeab('0x54')][_0xaeab('0x5c')],'role':_0xaeab('0x5e')},'attributes':['id','name',_0xaeab('0x6a'),_0xaeab('0x6b'),'internal'],'raw':!![]});}return null;})[_0xaeab('0x35')](function(_0x2908f6){if(!_0x2908f6)return null;_0x36a3bd[_0xaeab('0x29')][_0xaeab('0x5e')]=_0x2908f6;return _0x36a3bd;})['then'](function(_0x164eb1){if(_0x164eb1){_0x164eb1[_0xaeab('0x29')][_0xaeab('0x6e')]=util[_0xaeab('0x6f')](_0xaeab('0x70'),_0xb38ea9[_0xaeab('0x5d')][_0xaeab('0x39')]);_0x164eb1[_0xaeab('0x29')][_0xaeab('0x71')]=_0x36a3bd['channel'];_0x164eb1[_0xaeab('0x29')]['motionChannel']=_0x36a3bd['channel'];_0x164eb1[_0xaeab('0x29')][_0xaeab('0x73')]=_0xaeab('0x33');respondWithRpcPromise(_0xaeab('0x74'),'EventManager',{'event':'rejectmessage','message':_0x164eb1[_0xaeab('0x29')]},client9002);return _0x36a3bd;}return null;})[_0xaeab('0x35')](respondWithResult(_0x295156,null))[_0xaeab('0x50')](handleError(_0x295156,null));};exports[_0xaeab('0x7f')]=function(_0x34e418,_0x45be9b){var _0x53b2b7;return db[_0xaeab('0x3c')][_0xaeab('0x7f')](_0x34e418[_0xaeab('0x54')],{})[_0xaeab('0x35')](function(_0x57ca61){_0x53b2b7=_0x57ca61;return db[_0xaeab('0x80')][_0xaeab('0x81')]({'where':{'id':_0x53b2b7[_0xaeab('0x66')]}});})[_0xaeab('0x35')](function(_0x3ef932){if(_[_0xaeab('0x62')](_0x3ef932)){return;}else{_0x53b2b7[_0xaeab('0x59')]=_0x3ef932[_0xaeab('0x59')];return db[_0xaeab('0x82')][_0xaeab('0x81')]({'where':{'id':_0x53b2b7[_0xaeab('0x83')]}});}})[_0xaeab('0x35')](function(_0xffc388){return respondWithRpcPromise(_0xaeab('0x84'),_0xaeab('0x84'),{'FaxAccountId':_['isNil'](_0x34e418[_0xaeab('0x54')])?undefined:_0x34e418[_0xaeab('0x54')][_0xaeab('0x85')],'path':_[_0xaeab('0x62')](_0xffc388)?undefined:util[_0xaeab('0x6f')](_0xaeab('0x86'),_0xffc388[_0xaeab('0x87')]),'fax':_['isNil'](_0x53b2b7['fax'])?undefined:_0x53b2b7[_0xaeab('0x59')],'AttachmentId':_0x53b2b7['AttachmentId']},client9002);})['then'](respondWithResult(_0x45be9b,0xc9))[_0xaeab('0x50')](handleError(_0x45be9b,null));};exports['download']=function(_0x48a164,_0x378e8d){var _0x4a2630=path[_0xaeab('0x88')](config[_0xaeab('0x89')],_0xaeab('0x8a'),_0xaeab('0x8b'),_0xaeab('0x8c'));return db[_0xaeab('0x3c')]['find']({'where':{'id':_0x48a164[_0xaeab('0x55')]['id']},'include':[{'model':db[_0xaeab('0x82')],'as':'Attachment'}]})[_0xaeab('0x35')](handleEntityNotFound(_0x378e8d,null))[_0xaeab('0x35')](function(_0x934620){if(_0x934620){return _0x378e8d['download'](path['join'](_0x4a2630,_0x934620[_0xaeab('0x82')][_0xaeab('0x87')]));}})['catch'](handleError(_0x378e8d,null));}; \ No newline at end of file +var _0x10ad=['find','body','describe','../../config/logger','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','reject','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','User','EventManager','rejectmessage','create','CmContact','fax','findOne','AttachmentId','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','Attachment','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','intersection','includeAll'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x10ad,0x160));var _0xd10a=function(_0xeee344,_0x291948){_0xeee344=_0xeee344-0x0;var _0x2ad583=_0x10ad[_0xeee344];return _0x2ad583;};'use strict';var emlformat=require(_0xd10a('0x0'));var rimraf=require(_0xd10a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd10a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd10a('0x3'));var Mustache=require(_0xd10a('0x4'));var util=require(_0xd10a('0x5'));var path=require(_0xd10a('0x6'));var sox=require('sox');var csv=require(_0xd10a('0x7'));var ejs=require(_0xd10a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd10a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd10a('0xa'));var deskjs=require(_0xd10a('0xb'));var toCsv=require(_0xd10a('0x7'));var querystring=require(_0xd10a('0xc'));var Papa=require(_0xd10a('0xd'));var Redis=require(_0xd10a('0xe'));var authService=require(_0xd10a('0xf'));var qs=require(_0xd10a('0x10'));var as=require(_0xd10a('0x11'));var hardwareService=require(_0xd10a('0x12'));var logger=require('../../config/logger')(_0xd10a('0x13'));var utils=require(_0xd10a('0x14'));var config=require(_0xd10a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd10a('0x16'))['db'];config[_0xd10a('0x17')]=_[_0xd10a('0x18')](config['redis'],{'host':_0xd10a('0x19'),'port':0x18eb});var socket=require(_0xd10a('0x1a'))(new Redis(config[_0xd10a('0x17')]));require(_0xd10a('0x1b'))[_0xd10a('0x1c')](socket);var jayson=require(_0xd10a('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xd10a('0x1e')][_0xd10a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x139b37,_0x1ee8fa,_0x44e9f3,_0x215943){return new BPromise(function(_0x58d2f6,_0x59940a){var _0xca7476=_0x215943||client;return _0xca7476['request'](_0x139b37,_0x44e9f3)['then'](function(_0x499e28){logger[_0xd10a('0x20')](_0xd10a('0x21'),_0x1ee8fa,_0xd10a('0x22'));logger['debug'](_0xd10a('0x23'),_0x1ee8fa,'request\x20sent',JSON[_0xd10a('0x24')](_0x499e28));if(_0x499e28[_0xd10a('0x25')]){if(_0x499e28[_0xd10a('0x25')]['code']===0x1f4){logger[_0xd10a('0x25')](_0xd10a('0x21'),_0x1ee8fa,_0x499e28[_0xd10a('0x25')]['message']);return _0x59940a(_0x499e28[_0xd10a('0x25')][_0xd10a('0x26')]);}logger[_0xd10a('0x25')](_0xd10a('0x21'),_0x1ee8fa,_0x499e28[_0xd10a('0x25')][_0xd10a('0x26')]);return _0x58d2f6(_0x499e28['error']['message']);}else{logger[_0xd10a('0x20')]('FaxMessage,\x20%s,\x20%s',_0x1ee8fa,_0xd10a('0x22'));_0x58d2f6(_0x499e28[_0xd10a('0x27')][_0xd10a('0x26')]);}})[_0xd10a('0x28')](function(_0x3ab8ea){logger[_0xd10a('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1ee8fa,_0x3ab8ea);_0x59940a(_0x3ab8ea);});});}function respondWithStatusCode(_0x512c2a,_0x5b2598){_0x5b2598=_0x5b2598||0xcc;return function(_0x2a0e71){if(_0x2a0e71){return _0x512c2a[_0xd10a('0x29')](_0x5b2598);}return _0x512c2a['status'](_0x5b2598)[_0xd10a('0x2a')]();};}function respondWithResult(_0x2b4499,_0x1a89a5){_0x1a89a5=_0x1a89a5||0xc8;return function(_0x23d2e6){if(_0x23d2e6){return _0x2b4499[_0xd10a('0x2b')](_0x1a89a5)['json'](_0x23d2e6);}};}function respondWithFilteredResult(_0x541ec6,_0x28858d){return function(_0x3aebf3){if(_0x3aebf3){var _0x3f3d67=typeof _0x28858d[_0xd10a('0x2c')]===_0xd10a('0x2d')&&typeof _0x28858d[_0xd10a('0x2e')]==='undefined';var _0x56b863=_0x3aebf3[_0xd10a('0x2f')];var _0x8c52cd=_0x3f3d67?0x0:_0x28858d['offset'];var _0x39dcd0=_0x3f3d67?_0x3aebf3[_0xd10a('0x2f')]:_0x28858d[_0xd10a('0x2c')]+_0x28858d[_0xd10a('0x2e')];var _0x2f28c0;if(_0x39dcd0>=_0x56b863){_0x39dcd0=_0x56b863;_0x2f28c0=0xc8;}else{_0x2f28c0=0xce;}_0x541ec6['status'](_0x2f28c0);return _0x541ec6['set'](_0xd10a('0x30'),_0x8c52cd+'-'+_0x39dcd0+'/'+_0x56b863)[_0xd10a('0x31')](_0x3aebf3);}return null;};}function patchUpdates(_0x32dfac){return function(_0x20b9ad){try{jsonpatch['apply'](_0x20b9ad,_0x32dfac,!![]);}catch(_0x1231be){return BPromise['reject'](_0x1231be);}return _0x20b9ad[_0xd10a('0x32')]();};}function saveUpdates(_0x11ed89,_0xbd2f1c){return function(_0x57951c){if(_0x57951c){return _0x57951c[_0xd10a('0x33')](_0x11ed89)['then'](function(_0x3a0687){return _0x3a0687;});}return null;};}function removeEntity(_0x317216,_0x357516){return function(_0x392a4e){if(_0x392a4e){return _0x392a4e[_0xd10a('0x34')]()[_0xd10a('0x35')](function(){_0x317216['status'](0xcc)[_0xd10a('0x2a')]();});}};}function handleEntityNotFound(_0x4353c5,_0x232e6a){return function(_0x49b143){if(!_0x49b143){_0x4353c5[_0xd10a('0x29')](0x194);}return _0x49b143;};}function handleError(_0x37f8a5,_0x5f3b63){_0x5f3b63=_0x5f3b63||0x1f4;return function(_0x497516){logger['error'](_0x497516[_0xd10a('0x36')]);if(_0x497516['name']){delete _0x497516[_0xd10a('0x37')];}_0x37f8a5[_0xd10a('0x2b')](_0x5f3b63)[_0xd10a('0x38')](_0x497516);};}exports['index']=function(_0x16f801,_0x2debec){var _0x3b68f8={},_0x559864={},_0x12c250={'count':0x0,'rows':[]};var _0x22f674=_[_0xd10a('0x39')](db[_0xd10a('0x3a')][_0xd10a('0x3b')],function(_0x1821b4){return{'name':_0x1821b4[_0xd10a('0x3c')],'type':_0x1821b4[_0xd10a('0x3d')][_0xd10a('0x3e')]};});_0x559864['model']=_[_0xd10a('0x39')](_0x22f674,_0xd10a('0x37'));_0x559864[_0xd10a('0x3f')]=_[_0xd10a('0x40')](_0x16f801[_0xd10a('0x3f')]);_0x559864[_0xd10a('0x41')]=_['intersection'](_0x559864[_0xd10a('0x42')],_0x559864[_0xd10a('0x3f')]);_0x3b68f8[_0xd10a('0x43')]=_['intersection'](_0x559864[_0xd10a('0x42')],qs[_0xd10a('0x44')](_0x16f801[_0xd10a('0x3f')][_0xd10a('0x44')]));_0x3b68f8[_0xd10a('0x43')]=_0x3b68f8['attributes'][_0xd10a('0x45')]?_0x3b68f8[_0xd10a('0x43')]:_0x559864[_0xd10a('0x42')];if(!_0x16f801[_0xd10a('0x3f')][_0xd10a('0x46')](_0xd10a('0x47'))){_0x3b68f8[_0xd10a('0x2e')]=qs['limit'](_0x16f801['query'][_0xd10a('0x2e')]);_0x3b68f8[_0xd10a('0x2c')]=qs['offset'](_0x16f801[_0xd10a('0x3f')]['offset']);}_0x3b68f8[_0xd10a('0x48')]=qs[_0xd10a('0x49')](_0x16f801['query'][_0xd10a('0x49')]);_0x3b68f8[_0xd10a('0x4a')]=qs[_0xd10a('0x41')](_[_0xd10a('0x4b')](_0x16f801['query'],_0x559864['filters']),_0x22f674);if(_0x16f801[_0xd10a('0x3f')]['filter']){_0x3b68f8['where']=_[_0xd10a('0x4c')](_0x3b68f8['where'],{'$or':_['map'](_0x22f674,function(_0x1e4f41){if(_0x1e4f41[_0xd10a('0x3d')]!==_0xd10a('0x4d')){var _0x20a487={};_0x20a487[_0x1e4f41[_0xd10a('0x37')]]={'$like':'%'+_0x16f801[_0xd10a('0x3f')][_0xd10a('0x4e')]+'%'};return _0x20a487;}})});}_0x3b68f8=_[_0xd10a('0x4c')]({},_0x3b68f8,_0x16f801[_0xd10a('0x4f')]);var _0x3e2c34={'where':_0x3b68f8[_0xd10a('0x4a')]};return db['FaxMessage'][_0xd10a('0x2f')](_0x3e2c34)[_0xd10a('0x35')](function(_0x1a5d4f){_0x12c250[_0xd10a('0x2f')]=_0x1a5d4f;if(_0x16f801[_0xd10a('0x3f')]['includeAll']){_0x3b68f8[_0xd10a('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xd10a('0x51')](_0x3b68f8);})[_0xd10a('0x35')](function(_0x511195){_0x12c250['rows']=_0x511195;return _0x12c250;})[_0xd10a('0x35')](respondWithFilteredResult(_0x2debec,_0x3b68f8))[_0xd10a('0x28')](handleError(_0x2debec,null));};exports[_0xd10a('0x52')]=function(_0x3c2614,_0x4ee89a){var _0x27f9b3={'raw':!![],'where':{'id':_0x3c2614[_0xd10a('0x53')]['id']}},_0x1bb823={};_0x1bb823[_0xd10a('0x42')]=_[_0xd10a('0x40')](db[_0xd10a('0x3a')][_0xd10a('0x3b')]);_0x1bb823[_0xd10a('0x3f')]=_[_0xd10a('0x40')](_0x3c2614['query']);_0x1bb823['filters']=_[_0xd10a('0x54')](_0x1bb823[_0xd10a('0x42')],_0x1bb823[_0xd10a('0x3f')]);_0x27f9b3[_0xd10a('0x43')]=_[_0xd10a('0x54')](_0x1bb823[_0xd10a('0x42')],qs[_0xd10a('0x44')](_0x3c2614[_0xd10a('0x3f')][_0xd10a('0x44')]));_0x27f9b3[_0xd10a('0x43')]=_0x27f9b3['attributes'][_0xd10a('0x45')]?_0x27f9b3[_0xd10a('0x43')]:_0x1bb823[_0xd10a('0x42')];if(_0x3c2614[_0xd10a('0x3f')][_0xd10a('0x55')]){_0x27f9b3['include']=[{'all':!![]}];}_0x27f9b3=_[_0xd10a('0x4c')]({},_0x27f9b3,_0x3c2614['options']);return db[_0xd10a('0x3a')][_0xd10a('0x56')](_0x27f9b3)['then'](handleEntityNotFound(_0x4ee89a,null))[_0xd10a('0x35')](respondWithResult(_0x4ee89a,null))[_0xd10a('0x28')](handleError(_0x4ee89a,null));};exports[_0xd10a('0x33')]=function(_0x4e0f12,_0x2d8aa3){if(_0x4e0f12['body']['id']){delete _0x4e0f12[_0xd10a('0x57')]['id'];}return db[_0xd10a('0x3a')][_0xd10a('0x56')]({'where':{'id':_0x4e0f12[_0xd10a('0x53')]['id']}})[_0xd10a('0x35')](handleEntityNotFound(_0x2d8aa3,null))[_0xd10a('0x35')](saveUpdates(_0x4e0f12['body'],null))[_0xd10a('0x35')](respondWithResult(_0x2d8aa3,null))[_0xd10a('0x28')](handleError(_0x2d8aa3,null));};exports['destroy']=function(_0x37a16e,_0x193595){return db[_0xd10a('0x3a')][_0xd10a('0x56')]({'where':{'id':_0x37a16e[_0xd10a('0x53')]['id']}})[_0xd10a('0x35')](handleEntityNotFound(_0x193595,null))[_0xd10a('0x35')](removeEntity(_0x193595,null))[_0xd10a('0x28')](handleError(_0x193595,null));};exports['describe']=function(_0x485083,_0x11aa74){return db[_0xd10a('0x3a')][_0xd10a('0x58')]()[_0xd10a('0x35')](respondWithResult(_0x11aa74,null))['catch'](handleError(_0x11aa74,null));};var interaction_log=require(_0xd10a('0x59'))(_0xd10a('0x5a'));exports[_0xd10a('0x5b')]=function(_0x193f3d,_0x135355,_0x4073a0){var _0x1f877b={'agent':{},'channel':'fax'};if(_0x193f3d[_0xd10a('0x57')]['id']){delete _0x193f3d[_0xd10a('0x57')]['id'];}_0x193f3d[_0xd10a('0x57')][_0xd10a('0x5c')]=!![];_0x193f3d[_0xd10a('0x57')][_0xd10a('0x5d')]=moment()[_0xd10a('0x5e')](_0xd10a('0x5f'));_0x193f3d[_0xd10a('0x57')][_0xd10a('0x60')]=_0x193f3d[_0xd10a('0x57')][_0xd10a('0x60')]||_0x193f3d[_0xd10a('0x61')]['id'];_0x1f877b[_0xd10a('0x62')]['id']=_0x193f3d['body'][_0xd10a('0x60')];return db[_0xd10a('0x3a')]['find']({'where':{'id':_0x193f3d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x135355,null))[_0xd10a('0x35')](saveUpdates(_0x193f3d[_0xd10a('0x57')],null))[_0xd10a('0x35')](function(_0x48f362){if(_0x48f362){_0x1f877b[_0xd10a('0x26')]=_0x48f362[_0xd10a('0x63')]({'plain':!![]});return db[_0xd10a('0x64')][_0xd10a('0x56')]({'where':{'id':_0x48f362[_0xd10a('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x135355,null))[_0xd10a('0x35')](function(_0x5901ed){if(_0x5901ed){return _0x5901ed[_0xd10a('0x33')]({'UserId':_0x193f3d[_0xd10a('0x57')][_0xd10a('0x60')],'read1stAt':_['isNil'](_0x5901ed[_0xd10a('0x66')])?moment()[_0xd10a('0x5e')](_0xd10a('0x5f')):undefined});}return null;})[_0xd10a('0x35')](function(_0x4fa265){if(_0x4fa265){_0x1f877b['interaction']=_0x4fa265[_0xd10a('0x63')]({'plain':!![]});interaction_log[_0xd10a('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x193f3d[_0xd10a('0x61')]['id'],_0x193f3d['user']['name'],_0x193f3d[_0xd10a('0x61')]['role'],_0x1f877b['interaction']['id'],_0x193f3d[_0xd10a('0x57')]?JSON[_0xd10a('0x24')](_0x193f3d[_0xd10a('0x57')]):_0xd10a('0x67'));return respondWithRpcPromise(_0xd10a('0x68'),'acceptMessage',_0x1f877b);}return null;})[_0xd10a('0x35')](function(_0x22008f){var _0x53c820=_0xd10a('0x69')+_0x22008f[_0xd10a('0x26')][_0xd10a('0x6a')];return db['sequelize']['query'](_0x53c820,{'type':db[_0xd10a('0x6b')]['QueryTypes'][_0xd10a('0x6c')],'raw':!![]})[_0xd10a('0x35')](function(_0x304667){return _0x304667;});})['then'](function(_0x39531f){if(_0x39531f){_0x1f877b[_0xd10a('0x26')][_0xd10a('0x6d')]=_0x39531f[0x0];if(!_0x193f3d['body'][_0xd10a('0x60')])return;return db['User'][_0xd10a('0x56')]({'where':{'id':_0x193f3d['body'][_0xd10a('0x60')],'role':_0xd10a('0x62')},'attributes':['id',_0xd10a('0x37'),_0xd10a('0x6e'),_0xd10a('0x6f'),_0xd10a('0x70')],'raw':!![]});}return null;})['then'](function(_0x1e87af){if(!_0x1e87af)return null;_0x1f877b[_0xd10a('0x26')]['agent']=_0x1e87af;return _0x1f877b;})['then'](function(_0x2fd5c5){if(_0x2fd5c5){if(_0x193f3d['body'][_0xd10a('0x71')]){_0x1f877b[_0xd10a('0x26')][_0xd10a('0x72')]=util[_0xd10a('0x5e')](_0xd10a('0x73'),_0x193f3d[_0xd10a('0x61')][_0xd10a('0x37')]);_0x1f877b[_0xd10a('0x26')][_0xd10a('0x74')]=_0x1f877b[_0xd10a('0x74')];_0x1f877b[_0xd10a('0x26')][_0xd10a('0x75')]=_0x1f877b[_0xd10a('0x74')];_0x1f877b[_0xd10a('0x26')][_0xd10a('0x76')]=_0xd10a('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xd10a('0x77'),'message':_0x1f877b[_0xd10a('0x26')]},client9002)[_0xd10a('0x35')](function(){return _0x1f877b;});}return _0x1f877b;}return null;})[_0xd10a('0x35')](respondWithResult(_0x135355,null))[_0xd10a('0x28')](handleError(_0x135355,null));};var interaction_log=require(_0xd10a('0x59'))('fax-interactions');exports[_0xd10a('0x78')]=function(_0x5b34c1,_0xbb384c,_0x4f2bdf){var _0x22441f={'agent':{},'channel':'fax'};if(_0x5b34c1[_0xd10a('0x57')]['id']){delete _0x5b34c1[_0xd10a('0x57')]['id'];}_0x5b34c1[_0xd10a('0x57')][_0xd10a('0x60')]=_0x5b34c1[_0xd10a('0x57')][_0xd10a('0x60')]||_0x5b34c1['user']['id'];_0x22441f['agent']['id']=_0x5b34c1['body'][_0xd10a('0x60')];return db['FaxMessage'][_0xd10a('0x56')]({'where':{'id':_0x5b34c1[_0xd10a('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xbb384c,null))['then'](function(_0x381a8d){if(_0x381a8d){_0x22441f[_0xd10a('0x26')]=_0x381a8d[_0xd10a('0x63')]({'plain':!![]});return db['FaxInteraction'][_0xd10a('0x56')]({'where':{'id':_0x381a8d[_0xd10a('0x65')]}});}return null;})[_0xd10a('0x35')](handleEntityNotFound(_0xbb384c,null))['then'](function(_0x2d6eea){if(_0x2d6eea){_0x22441f[_0xd10a('0x79')]=_0x2d6eea['get']({'plain':!![]});interaction_log[_0xd10a('0x20')](_0xd10a('0x7a'),_0x5b34c1[_0xd10a('0x61')]['id'],_0x5b34c1[_0xd10a('0x61')][_0xd10a('0x37')],_0x5b34c1[_0xd10a('0x61')][_0xd10a('0x7b')],_0x22441f[_0xd10a('0x79')]['id'],_0x5b34c1['body']?JSON[_0xd10a('0x24')](_0x5b34c1[_0xd10a('0x57')]):_0xd10a('0x67'));return respondWithRpcPromise(_0xd10a('0x7c'),_0xd10a('0x7d'),_0x22441f);}return null;})[_0xd10a('0x35')](function(_0x5e1b15){var _0x1958a6=_0xd10a('0x69')+_0x5e1b15[_0xd10a('0x26')][_0xd10a('0x6a')];return db[_0xd10a('0x7e')]['query'](_0x1958a6,{'type':db['Sequelize']['QueryTypes'][_0xd10a('0x6c')],'raw':!![]})[_0xd10a('0x35')](function(_0x14c954){return _0x14c954;});})[_0xd10a('0x35')](function(_0x21b2b4){if(_0x21b2b4){_0x22441f[_0xd10a('0x26')][_0xd10a('0x6d')]=_0x21b2b4[0x0];if(!_0x5b34c1['body'][_0xd10a('0x60')])return;return db[_0xd10a('0x7f')][_0xd10a('0x56')]({'where':{'id':_0x5b34c1['body'][_0xd10a('0x60')],'role':_0xd10a('0x62')},'attributes':['id',_0xd10a('0x37'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x57e6fc){if(!_0x57e6fc)return null;_0x22441f['message']['agent']=_0x57e6fc;return _0x22441f;})[_0xd10a('0x35')](function(_0x14122c){if(_0x14122c){_0x14122c['message'][_0xd10a('0x72')]=util[_0xd10a('0x5e')]('SIP/%s',_0x5b34c1[_0xd10a('0x61')][_0xd10a('0x37')]);_0x14122c[_0xd10a('0x26')][_0xd10a('0x74')]=_0x22441f[_0xd10a('0x74')];_0x14122c['message']['motionChannel']=_0x22441f['channel'];_0x14122c['message'][_0xd10a('0x76')]='reject';respondWithRpcPromise('EventManager',_0xd10a('0x80'),{'event':_0xd10a('0x81'),'message':_0x14122c[_0xd10a('0x26')]},client9002);return _0x22441f;}return null;})[_0xd10a('0x35')](respondWithResult(_0xbb384c,null))[_0xd10a('0x28')](handleError(_0xbb384c,null));};exports[_0xd10a('0x82')]=function(_0x200c9c,_0xb4a10){var _0x593d4b;return db['FaxMessage'][_0xd10a('0x82')](_0x200c9c[_0xd10a('0x57')],{})[_0xd10a('0x35')](function(_0x5e7803){_0x593d4b=_0x5e7803;return db[_0xd10a('0x83')]['findOne']({'where':{'id':_0x593d4b[_0xd10a('0x6a')]}});})[_0xd10a('0x35')](function(_0x2d3631){if(_['isNil'](_0x2d3631)){return;}else{_0x593d4b[_0xd10a('0x84')]=_0x2d3631[_0xd10a('0x84')];return db['Attachment'][_0xd10a('0x85')]({'where':{'id':_0x593d4b[_0xd10a('0x86')]}});}})[_0xd10a('0x35')](function(_0x163775){return respondWithRpcPromise(_0xd10a('0x87'),_0xd10a('0x87'),{'FaxAccountId':_[_0xd10a('0x88')](_0x200c9c[_0xd10a('0x57')])?undefined:_0x200c9c[_0xd10a('0x57')][_0xd10a('0x89')],'path':_[_0xd10a('0x88')](_0x163775)?undefined:util[_0xd10a('0x5e')](_0xd10a('0x8a'),_0x163775[_0xd10a('0x8b')]),'fax':_[_0xd10a('0x88')](_0x593d4b[_0xd10a('0x84')])?undefined:_0x593d4b[_0xd10a('0x84')],'AttachmentId':_0x593d4b['AttachmentId']},client9002);})[_0xd10a('0x35')](respondWithResult(_0xb4a10,0xc9))['catch'](handleError(_0xb4a10,null));};exports[_0xd10a('0x8c')]=function(_0x13a001,_0x67f3f7){var _0x374224=path[_0xd10a('0x8d')](config[_0xd10a('0x8e')],_0xd10a('0x8f'),'files',_0xd10a('0x90'));return db[_0xd10a('0x3a')][_0xd10a('0x56')]({'where':{'id':_0x13a001[_0xd10a('0x53')]['id']},'include':[{'model':db[_0xd10a('0x91')],'as':_0xd10a('0x91')}]})['then'](handleEntityNotFound(_0x67f3f7,null))['then'](function(_0x5c2c35){if(_0x5c2c35){return _0x67f3f7[_0xd10a('0x8c')](path[_0xd10a('0x8d')](_0x374224,_0x5c2c35[_0xd10a('0x91')][_0xd10a('0x8b')]));}})['catch'](handleError(_0x67f3f7,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index aa80edb..32a453e 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 _0x4cb5=['../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3edefa,_0xcea16a){var _0x1e8699=function(_0x480eba){while(--_0x480eba){_0x3edefa['push'](_0x3edefa['shift']());}};_0x1e8699(++_0xcea16a);}(_0x4cb5,0x8f));var _0x54cb=function(_0x2164e8,_0xbe5587){_0x2164e8=_0x2164e8-0x0;var _0x58a022=_0x4cb5[_0x2164e8];return _0x58a022;};'use strict';var EventEmitter=require(_0x54cb('0x0'));var FaxMessage=require(_0x54cb('0x1'))['db'][_0x54cb('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x54cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54cb('0x4'),'afterDestroy':_0x54cb('0x5')};function emitEvent(_0x240a36){return function(_0xe3fc36,_0x297dd8,_0xf3461f){FaxMessageEvents[_0x54cb('0x6')](_0x240a36+':'+_0xe3fc36['id'],_0xe3fc36);FaxMessageEvents['emit'](_0x240a36,_0xe3fc36);_0xf3461f(null);};}for(var e in events){if(events[_0x54cb('0x7')](e)){var event=events[e];FaxMessage[_0x54cb('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x79bf=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xbd0517,_0x35451f){var _0x142eee=function(_0x1fc812){while(--_0x1fc812){_0xbd0517['push'](_0xbd0517['shift']());}};_0x142eee(++_0x35451f);}(_0x79bf,0x1df));var _0xf79b=function(_0x2c2a81,_0x1d63e5){_0x2c2a81=_0x2c2a81-0x0;var _0x4e337c=_0x79bf[_0x2c2a81];return _0x4e337c;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf79b('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf79b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf79b('0x2'),'afterDestroy':_0xf79b('0x3')};function emitEvent(_0x917960){return function(_0x193fad,_0x44bff1,_0x8b298){FaxMessageEvents[_0xf79b('0x4')](_0x917960+':'+_0x193fad['id'],_0x193fad);FaxMessageEvents['emit'](_0x917960,_0x193fad);_0x8b298(null);};}for(var e in events){if(events[_0xf79b('0x5')](e)){var event=events[e];FaxMessage[_0xf79b('0x6')](e,emitEvent(event));}}module[_0xf79b('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 6acfc78..297b9f7 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 _0xf37e=['exports','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','../../config/environment','./faxMessage.attributes'];(function(_0x3ebcab,_0x482df2){var _0x4074d3=function(_0x43ec1a){while(--_0x43ec1a){_0x3ebcab['push'](_0x3ebcab['shift']());}};_0x4074d3(++_0x482df2);}(_0xf37e,0x166));var _0xef37=function(_0x168f26,_0x36e3bd){_0x168f26=_0x168f26-0x0;var _0x59a471=_0xf37e[_0x168f26];return _0x59a471;};'use strict';var _=require('lodash');var util=require(_0xef37('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xef37('0x1'));var BPromise=require(_0xef37('0x2'));var rp=require(_0xef37('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef37('0x4'));var attributes=require(_0xef37('0x5'));module[_0xef37('0x6')]=function(_0x2cae3f,_0x593ae4){return _0x2cae3f['define']('FaxMessage',attributes,{'tableName':_0xef37('0x7'),'paranoid':![],'indexes':[{'name':_0xef37('0x8'),'fields':[_0xef37('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fb7f4,_0x2ce697,_0x215fac){var _0x46737e=_0x2cae3f[_0xef37('0xa')];var _0x541393=_0x1fb7f4[_0xef37('0xb')]({'plain':!![]});if(_0x541393[_0xef37('0xc')]['toLowerCase']()==='in'||_0x541393[_0xef37('0xc')][_0xef37('0xd')]()==='out'&&!_0x541393[_0xef37('0xe')]&&!_[_0xef37('0xf')](_0x541393[_0xef37('0x10')])){_0x46737e[_0xef37('0x11')][_0xef37('0x12')]({'where':{'id':_0x541393[_0xef37('0x13')]}})[_0xef37('0x14')](function(_0x34f8fc){if(_0x34f8fc){_0x34f8fc[_0xef37('0x15')]({'lastMsgAt':_0x541393[_0xef37('0x16')],'lastMsgDirection':_0x541393['direction'][_0xef37('0xd')]()});}})['catch'](function(_0x4c445c){console[_0xef37('0x17')](_0x4c445c);});}_0x215fac();}},'charset':_0xef37('0x18'),'collate':_0xef37('0x19')});}; \ No newline at end of file +var _0x80ca=['moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','FaxInteraction','update','createdAt','catch','utf8mb4','util','../../config/logger'];(function(_0x5c0151,_0x59aa3c){var _0x20bcb2=function(_0x3dbfde){while(--_0x3dbfde){_0x5c0151['push'](_0x5c0151['shift']());}};_0x20bcb2(++_0x59aa3c);}(_0x80ca,0x1c0));var _0xa80c=function(_0x32759d,_0x42fae9){_0x32759d=_0x32759d-0x0;var _0xf1b695=_0x80ca[_0x32759d];return _0xf1b695;};'use strict';var _=require('lodash');var util=require(_0xa80c('0x0'));var logger=require(_0xa80c('0x1'))('api');var moment=require(_0xa80c('0x2'));var BPromise=require('bluebird');var rp=require(_0xa80c('0x3'));var fs=require('fs');var path=require(_0xa80c('0x4'));var rimraf=require(_0xa80c('0x5'));var config=require(_0xa80c('0x6'));var attributes=require(_0xa80c('0x7'));module['exports']=function(_0x228039,_0xd359f6){return _0x228039[_0xa80c('0x8')](_0xa80c('0x9'),attributes,{'tableName':_0xa80c('0xa'),'paranoid':![],'indexes':[{'name':_0xa80c('0xb'),'fields':['body'],'type':_0xa80c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5270fb,_0x4e7b8b,_0x56b764){var _0x2e8e87=_0x228039[_0xa80c('0xd')];var _0x58355e=_0x5270fb[_0xa80c('0xe')]({'plain':!![]});if(_0x58355e['direction'][_0xa80c('0xf')]()==='in'||_0x58355e[_0xa80c('0x10')][_0xa80c('0xf')]()===_0xa80c('0x11')&&!_0x58355e['secret']&&!_[_0xa80c('0x12')](_0x58355e[_0xa80c('0x13')])){_0x2e8e87[_0xa80c('0x14')]['findOne']({'where':{'id':_0x58355e['FaxInteractionId']}})['then'](function(_0x2239a4){if(_0x2239a4){_0x2239a4[_0xa80c('0x15')]({'lastMsgAt':_0x58355e[_0xa80c('0x16')],'lastMsgDirection':_0x58355e[_0xa80c('0x10')][_0xa80c('0xf')]()});}})[_0xa80c('0x17')](function(_0x249043){console['error'](_0x249043);});}_0x56b764();}},'charset':_0xa80c('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 244b549..084f385 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 _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0xa426d7,_0x21c3b4){var _0x4dc3ec=function(_0x5ecbc8){while(--_0x5ecbc8){_0xa426d7['push'](_0xa426d7['shift']());}};_0x4dc3ec(++_0x21c3b4);}(_0x55e0,0xdc));var _0x055e=function(_0x58b961,_0x57776a){_0x58b961=_0x58b961-0x0;var _0x432a84=_0x55e0[_0x58b961];return _0x432a84;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file +var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x59227e,_0x20fa18){var _0x5508bb=function(_0x5161ff){while(--_0x5161ff){_0x59227e['push'](_0x59227e['shift']());}};_0x5508bb(++_0x20fa18);}(_0x032e,0x124));var _0xe032=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x032e[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 27a5b83..f53b852 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 _0xbdba=['emit','removeListener','register','length','./faxMessage.events','update'];(function(_0x484ac7,_0x534f38){var _0x2d2a77=function(_0x173a0c){while(--_0x173a0c){_0x484ac7['push'](_0x484ac7['shift']());}};_0x2d2a77(++_0x534f38);}(_0xbdba,0x88));var _0xabdb=function(_0x531b21,_0x28ecb4){_0x531b21=_0x531b21-0x0;var _0x516cfe=_0xbdba[_0x531b21];return _0x516cfe;};'use strict';var FaxMessageEvents=require(_0xabdb('0x0'));var events=['save','remove',_0xabdb('0x1')];function createListener(_0x49b1a1,_0x70168a){return function(_0x564f0e){_0x70168a[_0xabdb('0x2')](_0x49b1a1,_0x564f0e);};}function removeListener(_0x4bfafc,_0x14720c){return function(){FaxMessageEvents[_0xabdb('0x3')](_0x4bfafc,_0x14720c);};}exports[_0xabdb('0x4')]=function(_0x226714){for(var _0x4961c5=0x0,_0x4253fe=events[_0xabdb('0x5')];_0x4961c5<_0x4253fe;_0x4961c5++){var _0x39ac3a=events[_0x4961c5];var _0x5163bb=createListener('faxMessage:'+_0x39ac3a,_0x226714);FaxMessageEvents['on'](_0x39ac3a,_0x5163bb);}}; \ No newline at end of file +var _0x0ab9=['emit','removeListener','length','faxMessage:','./faxMessage.events','save','update'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x0ab9,0xcf));var _0x90ab=function(_0x52cec5,_0x2b0cd9){_0x52cec5=_0x52cec5-0x0;var _0x2673c8=_0x0ab9[_0x52cec5];return _0x2673c8;};'use strict';var FaxMessageEvents=require(_0x90ab('0x0'));var events=[_0x90ab('0x1'),'remove',_0x90ab('0x2')];function createListener(_0x27b2e5,_0x24ddb7){return function(_0x205640){_0x24ddb7[_0x90ab('0x3')](_0x27b2e5,_0x205640);};}function removeListener(_0x44f58a,_0x206c20){return function(){FaxMessageEvents[_0x90ab('0x4')](_0x44f58a,_0x206c20);};}exports['register']=function(_0x1cf1ff){for(var _0x2bb662=0x0,_0x3d68cb=events[_0x90ab('0x5')];_0x2bb662<_0x3d68cb;_0x2bb662++){var _0x2dd55a=events[_0x2bb662];var _0x3e31b9=createListener(_0x90ab('0x6')+_0x2dd55a,_0x1cf1ff);FaxMessageEvents['on'](_0x2dd55a,_0x3e31b9);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3f28c3b..c23acd3 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 _0xd3d1=['put','update','accept','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create'];(function(_0x5f019f,_0xafe9b7){var _0x5b2ff5=function(_0x617ce0){while(--_0x617ce0){_0x5f019f['push'](_0x5f019f['shift']());}};_0x5b2ff5(++_0xafe9b7);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd3d1[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var fs_extra=require(_0x1d3d('0x4'));var auth=require(_0x1d3d('0x5'));var interaction=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var controller=require(_0x1d3d('0x8'));router[_0x1d3d('0x9')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0x9')](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0x9')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller['show']);router[_0x1d3d('0x9')](_0x1d3d('0xf'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x10')]);router[_0x1d3d('0x11')]('/',auth[_0x1d3d('0xa')](),interaction[_0x1d3d('0x12')](_0x1d3d('0x13'),_0x1d3d('0x14')),controller[_0x1d3d('0x15')]);router[_0x1d3d('0x16')]('/:id',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x17')]);router['put']('/:id/accept',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x18')]);router[_0x1d3d('0x16')]('/:id/reject',auth[_0x1d3d('0xa')](),controller['reject']);router[_0x1d3d('0x19')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x1a')]);module[_0x1d3d('0x1b')]=router; \ No newline at end of file +var _0x91a7=['isAuthenticated','/:id','show','download','tracked','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./faxMessage.controller','get','index','/describe'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x91a7,0xe7));var _0x791a=function(_0x3d039f,_0x2533bd){_0x3d039f=_0x3d039f-0x0;var _0x1ddddc=_0x91a7[_0x3d039f];return _0x1ddddc;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/download',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['post']('/',auth[_0x791a('0x9')](),interaction[_0x791a('0xd')](_0x791a('0xe'),_0x791a('0xf')),controller[_0x791a('0x10')]);router[_0x791a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x791a('0x12')]);router[_0x791a('0x11')]('/:id/accept',auth[_0x791a('0x9')](),controller[_0x791a('0x13')]);router['put'](_0x791a('0x14'),auth[_0x791a('0x9')](),controller[_0x791a('0x15')]);router[_0x791a('0x16')]('/:id',auth[_0x791a('0x9')](),controller['destroy']);module[_0x791a('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 7875d02..68025c0 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 _0xb778=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x324e58,_0x5667bf){var _0x41bda1=function(_0x370b04){while(--_0x370b04){_0x324e58['push'](_0x324e58['shift']());}};_0x41bda1(++_0x5667bf);}(_0xb778,0x1c8));var _0x8b77=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0xb778[_0x294726];return _0x39e2e3;};'use strict';var Sequelize=require(_0x8b77('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b77('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8b77('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b77('0x3')](_0x8b77('0x4'),_0x8b77('0x5'),_0x8b77('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8b77('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x33ec=['ENUM','rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x2bc61b,_0x3bb067){var _0x50b180=function(_0x5bebde){while(--_0x5bebde){_0x2bc61b['push'](_0x2bc61b['shift']());}};_0x50b180(++_0x3bb067);}(_0x33ec,0x96));var _0xc33e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc33e('0x0')]={'name':{'type':Sequelize[_0xc33e('0x1')],'unique':_0xc33e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc33e('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc33e('0x4')](_0xc33e('0x5'),'beepall',_0xc33e('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc33e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index b7f1e49..bcab285 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 _0xa423=['all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','order','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','error','name','send','index','map','rawAttributes','type','getOptions','where','FaxQueue','include','query','findAll','rows','catch','show','model','keys','filters','intersection','fields','length','attributes','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','findOne','UserFaxQueue','nolimit','sort','pick','FaxQueueId','filter','options','User','UserId','agent','faxPause','updatedAt','format','%s/%s','getTeams','hasOwnProperty','ids','Agents','online','voicePause','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Team','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','TeamId','includes'];(function(_0x44d797,_0x276017){var _0x4005c2=function(_0x3d3b5b){while(--_0x3d3b5b){_0x44d797['push'](_0x44d797['shift']());}};_0x4005c2(++_0x276017);}(_0xa423,0x16c));var _0x3a42=function(_0x270739,_0x165001){_0x270739=_0x270739-0x0;var _0x1258c4=_0xa423[_0x270739];return _0x1258c4;};'use strict';var BPromise=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var _=require(_0x3a42('0x2'));var squel=require(_0x3a42('0x3'));var Redis=require(_0x3a42('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x3a42('0x5'))(_0x3a42('0x6'));var config=require('../../config/environment');var db=require(_0x3a42('0x7'))['db'];config[_0x3a42('0x8')]=_[_0x3a42('0x9')](config[_0x3a42('0x8')],{'host':_0x3a42('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a42('0x8')]));require(_0x3a42('0xb'))[_0x3a42('0xc')](socket);function respondWithStatusCode(_0x3a08a1,_0x1be0b7){_0x1be0b7=_0x1be0b7||0xcc;return function(_0x30f605){if(_0x30f605){return _0x3a08a1[_0x3a42('0xd')](_0x1be0b7);}return _0x3a08a1[_0x3a42('0xe')](_0x1be0b7)[_0x3a42('0xf')]();};}function respondWithResult(_0x2a25c0,_0x397559){_0x397559=_0x397559||0xc8;return function(_0x4b2df6){if(_0x4b2df6){return _0x2a25c0[_0x3a42('0xe')](_0x397559)[_0x3a42('0x10')](_0x4b2df6);}};}function respondWithFilteredResult(_0x1f50f4,_0x168835){return function(_0x578a1d){if(_0x578a1d){var _0x55ffa5=typeof _0x168835[_0x3a42('0x11')]==='undefined'&&typeof _0x168835[_0x3a42('0x12')]===_0x3a42('0x13');var _0x198bf1=_0x578a1d[_0x3a42('0x14')];var _0x891963=_0x55ffa5?0x0:_0x168835[_0x3a42('0x11')];var _0x5f5244=_0x55ffa5?_0x578a1d[_0x3a42('0x14')]:_0x168835['offset']+_0x168835[_0x3a42('0x12')];var _0x4b1d68;if(_0x5f5244>=_0x198bf1){_0x5f5244=_0x198bf1;_0x4b1d68=0xc8;}else{_0x4b1d68=0xce;}_0x1f50f4[_0x3a42('0xe')](_0x4b1d68);return _0x1f50f4[_0x3a42('0x15')](_0x3a42('0x16'),_0x891963+'-'+_0x5f5244+'/'+_0x198bf1)['json'](_0x578a1d);}return null;};}function saveUpdates(_0x486c74){return function(_0x4eae89){if(_0x4eae89){return _0x4eae89[_0x3a42('0x17')](_0x486c74)[_0x3a42('0x18')](function(_0x438cf1){return _0x438cf1;});}return null;};}function removeEntity(_0x39e620){return function(_0x318526){if(_0x318526){return _0x318526['destroy']()[_0x3a42('0x18')](function(){var _0x2e5e64=_0x318526[_0x3a42('0x19')]({'plain':!![]});var _0x151835=_0x3a42('0x1a');return db[_0x3a42('0x1b')]['destroy']({'where':{'type':_0x151835,'resourceId':_0x2e5e64['id']}})[_0x3a42('0x18')](function(){return _0x318526;});})[_0x3a42('0x18')](function(){_0x39e620[_0x3a42('0xe')](0xcc)[_0x3a42('0xf')]();});}};}function handleEntityNotFound(_0x6f49b4){return function(_0x526d7c){if(!_0x526d7c){_0x6f49b4[_0x3a42('0xd')](0x194);}return _0x526d7c;};}function handleError(_0x42b40f,_0x379fe6){_0x379fe6=_0x379fe6||0x1f4;return function(_0x434283){logger[_0x3a42('0x1c')](_0x434283['stack']);if(_0x434283[_0x3a42('0x1d')]){delete _0x434283[_0x3a42('0x1d')];}_0x42b40f[_0x3a42('0xe')](_0x379fe6)[_0x3a42('0x1e')](_0x434283);};}exports[_0x3a42('0x1f')]=function(_0x258917,_0x2ee4b8){var _0x434044={};var _0x2c4b3a={'count':0x0,'rows':[]};var _0x3a3f87=_[_0x3a42('0x20')](db['FaxQueue'][_0x3a42('0x21')],function(_0x468ea8){return{'name':_0x468ea8['fieldName'],'type':_0x468ea8[_0x3a42('0x22')]['key']};});_0x434044=qs[_0x3a42('0x23')](_0x3a3f87,_0x258917);var _0x2a4878={'where':_0x434044[_0x3a42('0x24')]};return db[_0x3a42('0x25')][_0x3a42('0x14')](_0x2a4878)[_0x3a42('0x18')](function(_0x4b8fe7){_0x2c4b3a[_0x3a42('0x14')]=_0x4b8fe7;_0x434044[_0x3a42('0x26')]=qs[_0x3a42('0x26')](_0x258917[_0x3a42('0x27')]);return db[_0x3a42('0x25')][_0x3a42('0x28')](_0x434044);})[_0x3a42('0x18')](function(_0x56ee5d){_0x2c4b3a[_0x3a42('0x29')]=_0x56ee5d;return _0x2c4b3a;})[_0x3a42('0x18')](respondWithFilteredResult(_0x2ee4b8,_0x434044))[_0x3a42('0x2a')](handleError(_0x2ee4b8,null));};exports[_0x3a42('0x2b')]=function(_0x158f02,_0x50ece0){var _0x4d9701={'raw':!![],'where':{'id':_0x158f02['params']['id']}},_0x1032eb={};_0x1032eb[_0x3a42('0x2c')]=_[_0x3a42('0x2d')](db[_0x3a42('0x25')][_0x3a42('0x21')]);_0x1032eb[_0x3a42('0x27')]=_[_0x3a42('0x2d')](_0x158f02['query']);_0x1032eb[_0x3a42('0x2e')]=_[_0x3a42('0x2f')](_0x1032eb[_0x3a42('0x2c')],_0x1032eb['query']);_0x4d9701['attributes']=_[_0x3a42('0x2f')](_0x1032eb[_0x3a42('0x2c')],qs[_0x3a42('0x30')](_0x158f02[_0x3a42('0x27')][_0x3a42('0x30')]));_0x4d9701['attributes']=_0x4d9701['attributes'][_0x3a42('0x31')]?_0x4d9701[_0x3a42('0x32')]:_0x1032eb[_0x3a42('0x2c')];if(_0x158f02[_0x3a42('0x27')]['includeAll']){_0x4d9701[_0x3a42('0x26')]=[{'all':!![]}];}_0x4d9701=_[_0x3a42('0x33')]({},_0x4d9701,_0x158f02['options']);return db['FaxQueue']['find'](_0x4d9701)[_0x3a42('0x18')](handleEntityNotFound(_0x50ece0,null))['then'](respondWithResult(_0x50ece0,null))[_0x3a42('0x2a')](handleError(_0x50ece0,null));};exports[_0x3a42('0x34')]=function(_0x29312e,_0x1fcbcb){return db[_0x3a42('0x25')][_0x3a42('0x34')](_0x29312e[_0x3a42('0x35')],{})[_0x3a42('0x18')](function(_0x1db96b){var _0x54004c=_0x29312e[_0x3a42('0x36')][_0x3a42('0x19')]({'plain':!![]});if(!_0x54004c)throw new Error(_0x3a42('0x37'));if(_0x54004c[_0x3a42('0x38')]===_0x3a42('0x36')){var _0x567043=_0x1db96b[_0x3a42('0x19')]({'plain':!![]});var _0x542335='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x542335,'userProfileId':_0x54004c[_0x3a42('0x39')]},'raw':!![]})['then'](function(_0x56e32b){if(_0x56e32b&&_0x56e32b['autoAssociation']===0x0){return db[_0x3a42('0x1b')]['create']({'name':_0x567043['name'],'resourceId':_0x567043['id'],'type':_0x56e32b[_0x3a42('0x1d')],'sectionId':_0x56e32b['id']},{})[_0x3a42('0x18')](function(){return _0x1db96b;});}else{return _0x1db96b;}})[_0x3a42('0x2a')](function(_0x1f49e9){logger[_0x3a42('0x1c')](_0x3a42('0x3a'),_0x1f49e9);throw _0x1f49e9;});}return _0x1db96b;})['then'](respondWithResult(_0x1fcbcb,0xc9))[_0x3a42('0x2a')](handleError(_0x1fcbcb,null));};exports[_0x3a42('0x17')]=function(_0x3e5f89,_0x52a21c){if(_0x3e5f89[_0x3a42('0x35')]['id']){delete _0x3e5f89[_0x3a42('0x35')]['id'];}return db['FaxQueue'][_0x3a42('0x3b')]({'where':{'id':_0x3e5f89[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](handleEntityNotFound(_0x52a21c,null))[_0x3a42('0x18')](saveUpdates(_0x3e5f89[_0x3a42('0x35')],null))[_0x3a42('0x18')](respondWithResult(_0x52a21c,null))[_0x3a42('0x2a')](handleError(_0x52a21c,null));};exports['destroy']=function(_0x384758,_0x2b2190){return db[_0x3a42('0x25')][_0x3a42('0x3b')]({'where':{'id':_0x384758[_0x3a42('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2b2190,null))[_0x3a42('0x18')](removeEntity(_0x2b2190,null))[_0x3a42('0x2a')](handleError(_0x2b2190,null));};exports[_0x3a42('0x3d')]=function(_0x4ec596,_0x432387){return db[_0x3a42('0x25')][_0x3a42('0x3d')]()[_0x3a42('0x18')](respondWithResult(_0x432387,null))[_0x3a42('0x2a')](handleError(_0x432387,null));};exports['getMembers']=function(_0x40c746,_0x33209c){var _0x3a3293={'raw':!![],'where':{}},_0xa46b2a={},_0x52ab00;return db[_0x3a42('0x25')][_0x3a42('0x3e')]({'where':{'id':_0x40c746[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](handleEntityNotFound(_0x33209c,null))[_0x3a42('0x18')](function(_0x9799a){if(_0x9799a){_0x52ab00=_0x9799a[_0x3a42('0x19')]({'plain':!![]});_0xa46b2a['model']=_[_0x3a42('0x2d')](db[_0x3a42('0x3f')][_0x3a42('0x21')]);_0xa46b2a[_0x3a42('0x27')]=_[_0x3a42('0x2d')](_0x40c746[_0x3a42('0x27')]);_0xa46b2a['filters']=_[_0x3a42('0x2f')](_0xa46b2a['model'],_0xa46b2a[_0x3a42('0x27')]);_0x3a3293[_0x3a42('0x32')]=_[_0x3a42('0x2f')](_0xa46b2a[_0x3a42('0x2c')],qs[_0x3a42('0x30')](_0x40c746[_0x3a42('0x27')][_0x3a42('0x30')]));_0x3a3293[_0x3a42('0x32')]=_0x3a3293[_0x3a42('0x32')]['length']?_0x3a3293[_0x3a42('0x32')]:_0xa46b2a[_0x3a42('0x2c')];if(!_0x40c746['query']['hasOwnProperty'](_0x3a42('0x40'))){_0x3a3293[_0x3a42('0x12')]=qs['limit'](_0x40c746[_0x3a42('0x27')][_0x3a42('0x12')]);_0x3a3293[_0x3a42('0x11')]=qs['offset'](_0x40c746[_0x3a42('0x27')][_0x3a42('0x11')]);}_0x3a3293['order']=qs[_0x3a42('0x41')](_0x40c746['query'][_0x3a42('0x41')]);_0x3a3293[_0x3a42('0x24')]=qs['filters'](_[_0x3a42('0x42')](_0x40c746[_0x3a42('0x27')],_0xa46b2a[_0x3a42('0x2e')]));_0x3a3293[_0x3a42('0x24')][_0x3a42('0x43')]=_0x9799a['id'];if(_0x40c746[_0x3a42('0x27')][_0x3a42('0x44')]){_0x3a3293[_0x3a42('0x24')]=_[_0x3a42('0x33')](_0x3a3293[_0x3a42('0x24')],{'$or':_['map'](_0x3a3293[_0x3a42('0x32')],function(_0x2545e6){var _0x32ea5e={};_0x32ea5e[_0x2545e6]={'$like':'%'+_0x40c746[_0x3a42('0x27')][_0x3a42('0x44')]+'%'};return _0x32ea5e;})});}_0x3a3293=_['merge']({},_0x3a3293,_0x40c746[_0x3a42('0x45')]);return db[_0x3a42('0x3f')][_0x3a42('0x28')](_0x3a3293);}})['then'](function(_0x3b08b6){if(_0x3b08b6){return db[_0x3a42('0x46')]['findAndCountAll']({'where':{'id':_[_0x3a42('0x20')](_0x3b08b6,_0x3a42('0x47')),'role':_0x3a42('0x48')},'attributes':['id',_0x3a42('0x1d'),_0x3a42('0x49'),_0x3a42('0x4a'),'createdAt']});}})['then'](function(_0x4c20f4){if(_0x4c20f4){return{'count':_0x4c20f4[_0x3a42('0x14')],'rows':_[_0x3a42('0x20')](_0x4c20f4[_0x3a42('0x29')],function(_0x46cd72){return{'membername':_0x46cd72['name'],'UserId':_0x46cd72['id'],'queue_name':_0x52ab00[_0x3a42('0x1d')],'FaxQueueId':_0x52ab00['id'],'interface':util[_0x3a42('0x4b')](_0x3a42('0x4c'),'SIP',_0x46cd72[_0x3a42('0x1d')]),'penalty':0x0,'paused':_0x46cd72[_0x3a42('0x49')],'createdAt':_0x46cd72['createdAt'],'updatedAt':_0x46cd72[_0x3a42('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3a42('0x18')](respondWithFilteredResult(_0x33209c,_0x3a3293))[_0x3a42('0x2a')](handleError(_0x33209c,null));};exports[_0x3a42('0x4d')]=function(_0x30636d,_0x3349e8){var _0x297a39={};var _0x3fbf45={};var _0x319402;var _0x55541b;return db[_0x3a42('0x25')][_0x3a42('0x3e')]({'where':{'id':_0x30636d[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](handleEntityNotFound(_0x3349e8,null))[_0x3a42('0x18')](function(_0x106246){if(_0x106246){_0x319402=_0x106246;_0x3fbf45[_0x3a42('0x2c')]=_[_0x3a42('0x2d')](db['Team'][_0x3a42('0x21')]);_0x3fbf45[_0x3a42('0x27')]=_[_0x3a42('0x2d')](_0x30636d['query']);_0x3fbf45['filters']=_['intersection'](_0x3fbf45[_0x3a42('0x2c')],_0x3fbf45[_0x3a42('0x27')]);_0x297a39[_0x3a42('0x32')]=_[_0x3a42('0x2f')](_0x3fbf45[_0x3a42('0x2c')],qs[_0x3a42('0x30')](_0x30636d[_0x3a42('0x27')]['fields']));_0x297a39[_0x3a42('0x32')]=_0x297a39[_0x3a42('0x32')]['length']?_0x297a39[_0x3a42('0x32')]:_0x3fbf45[_0x3a42('0x2c')];_0x297a39['order']=qs[_0x3a42('0x41')](_0x30636d['query'][_0x3a42('0x41')]);_0x297a39['where']=qs[_0x3a42('0x2e')](_[_0x3a42('0x42')](_0x30636d[_0x3a42('0x27')],_0x3fbf45[_0x3a42('0x2e')]));if(_0x30636d[_0x3a42('0x27')][_0x3a42('0x44')]){_0x297a39[_0x3a42('0x24')]=_['merge'](_0x297a39[_0x3a42('0x24')],{'$or':_[_0x3a42('0x20')](_0x297a39['attributes'],function(_0x9c3224){var _0x176aba={};_0x176aba[_0x9c3224]={'$like':'%'+_0x30636d['query'][_0x3a42('0x44')]+'%'};return _0x176aba;})});}_0x297a39=_[_0x3a42('0x33')]({},_0x297a39,_0x30636d[_0x3a42('0x45')]);return _0x319402[_0x3a42('0x4d')](_0x297a39);}})[_0x3a42('0x18')](function(_0x5a1844){if(_0x5a1844){_0x55541b=_0x5a1844['length'];if(!_0x30636d[_0x3a42('0x27')][_0x3a42('0x4e')](_0x3a42('0x40'))){_0x297a39['limit']=qs['limit'](_0x30636d['query'][_0x3a42('0x12')]);_0x297a39['offset']=qs[_0x3a42('0x11')](_0x30636d['query'][_0x3a42('0x11')]);}return _0x319402['getTeams'](_0x297a39);}})['then'](function(_0xc3ad1f){if(_0xc3ad1f){return _0xc3ad1f?{'count':_0x55541b,'rows':_0xc3ad1f}:null;}})['then'](respondWithResult(_0x3349e8,null))[_0x3a42('0x2a')](handleError(_0x3349e8,null));};exports['addTeams']=function(_0x579e6c,_0x3958fc){var _0x3b92a5=_0x579e6c[_0x3a42('0x35')][_0x3a42('0x4f')];return db['Team'][_0x3a42('0x28')]({'where':{'id':_0x3b92a5},'attributes':['id'],'include':[{'model':db[_0x3a42('0x46')],'as':_0x3a42('0x50'),'attributes':['id','name',_0x3a42('0x51'),_0x3a42('0x52'),'interface'],'raw':!![]}]})[_0x3a42('0x18')](function(_0x3212b7){if(_0x3212b7){var _0x15648d=_[_0x3a42('0x53')](_0x3212b7,function(_0x317061){var _0x123c77=_0x317061['get']({'plain':!![]});return _0x123c77[_0x3a42('0x50')];});return db['FaxQueue'][_0x3a42('0x3b')]({'where':{'id':_0x579e6c[_0x3a42('0x3c')]['id']}})['then'](function(_0x3fefc9){return db['sequelize'][_0x3a42('0x54')](function(_0x375db3){return _0x3fefc9[_0x3a42('0x55')](_0x3b92a5,{'transaction':_0x375db3})[_0x3a42('0x18')](function(){return BPromise['each'](_0x15648d,function(_0x31b83c){return db[_0x3a42('0x3f')][_0x3a42('0x56')]({'where':{'UserId':_0x31b83c['id'],'FaxQueueId':_0x579e6c['params']['id']},'transaction':_0x375db3});});})[_0x3a42('0x18')](function(){_0x15648d[_0x3a42('0x57')](function(_0x2a1c5d){socket[_0x3a42('0x58')](_0x3a42('0x59'),{'UserId':_0x2a1c5d['id'],'FaxQueueId':_0x3fefc9['id']});});});});});}})[_0x3a42('0x18')](respondWithStatusCode(_0x3958fc,null))['catch'](handleError(_0x3958fc,null));};exports[_0x3a42('0x5a')]=function(_0xd7db09,_0x541a15){return db[_0x3a42('0x5b')][_0x3a42('0x28')]({'where':{'id':_0xd7db09[_0x3a42('0x27')][_0x3a42('0x4f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3a42('0x50'),'attributes':['id'],'raw':!![]}]})[_0x3a42('0x18')](handleEntityNotFound(_0x541a15,null))[_0x3a42('0x18')](function(_0x2e36af){var _0x997202=_[_0x3a42('0x20')](_0x2e36af,'id');var _0x188436=[];var _0x2b9798=[];var _0x3727c8=squel[_0x3a42('0x5c')]();_0x3727c8['field'](_0x3a42('0x5d'))['from'](_0x3a42('0x5e'),'tq')['join'](_0x3a42('0x5f'),'ut',_0x3a42('0x60'))[_0x3a42('0x24')]('FaxQueueId\x20=\x20?',_0xd7db09[_0x3a42('0x3c')]['id']);for(var _0xe03cc8=0x0;_0xe03cc8<_0x2e36af[_0x3a42('0x31')];_0xe03cc8+=0x1){let _0x38d342=_0x2e36af[_0xe03cc8];for(var _0x1896f2=0x0;_0x1896f2<_0x38d342[_0x3a42('0x50')][_0x3a42('0x31')];_0x1896f2+=0x1){let _0x55ded0=_0x38d342[_0x3a42('0x50')][_0x1896f2];var _0x9e9a0e=_0x3727c8['clone']();_0x9e9a0e[_0x3a42('0x24')](_0x3a42('0x61'),_0x55ded0['id']);_0x2b9798[_0x3a42('0x62')](db['sequelize'][_0x3a42('0x27')](_0x9e9a0e[_0x3a42('0x63')](),{'type':db[_0x3a42('0x64')][_0x3a42('0x65')]['SELECT']})[_0x3a42('0x18')](function(_0x3b6984){if(_0x3b6984[_0x3a42('0x31')]===0x1){return _0x55ded0['id'];}else{var _0x118d23=_['every'](_[_0x3a42('0x20')](_0x3b6984,_0x3a42('0x66')),function(_0x24740d){return _[_0x3a42('0x67')](_0x997202,_0x24740d);});if(_0x118d23){return _0x55ded0['id'];}}}));}}return BPromise[_0x3a42('0x68')](_0x2b9798)[_0x3a42('0x18')](function(_0x2cd983){_0x188436=_(_0x188436)[_0x3a42('0x69')](_0x2cd983)[_0x3a42('0x6a')]()[_0x3a42('0x6b')]();return db[_0x3a42('0x25')][_0x3a42('0x3b')]({'where':{'id':_0xd7db09[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](function(_0x54150c){return db[_0x3a42('0x64')]['transaction'](function(_0x41e00b){return _0x54150c[_0x3a42('0x5a')](_0xd7db09[_0x3a42('0x27')]['ids'],{'transaction':_0x41e00b})['then'](function(){if(!_[_0x3a42('0x6c')](_0x188436)){return _0x54150c['removeAgents'](_0x188436,{'transaction':_0x41e00b});}})[_0x3a42('0x18')](function(){_0x188436[_0x3a42('0x57')](function(_0x2fc6d2){socket['emit'](_0x3a42('0x6d'),{'UserId':_0x2fc6d2,'FaxQueueId':_0x54150c['id']});});});});});});})[_0x3a42('0x18')](respondWithStatusCode(_0x541a15,null))['catch'](handleError(_0x541a15,null));};exports[_0x3a42('0x6e')]=function(_0x549ef4,_0x2985d2){return db[_0x3a42('0x25')][_0x3a42('0x3b')]({'where':{'id':_0x549ef4[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](handleEntityNotFound(_0x2985d2,null))[_0x3a42('0x18')](function(_0x5c699e){if(_0x5c699e){return _0x5c699e['addAgents'](_0x549ef4[_0x3a42('0x35')]['ids'],_[_0x3a42('0x6f')](_0x549ef4['body'],['ids','id'])||{})[_0x3a42('0x70')](function(_0x575f61){for(var _0x525022=0x0;_0x525022<_0x549ef4[_0x3a42('0x35')][_0x3a42('0x4f')][_0x3a42('0x31')];_0x525022+=0x1){socket[_0x3a42('0x58')]('userFaxQueue:save',{'UserId':Number(_0x549ef4['body'][_0x3a42('0x4f')][_0x525022]),'FaxQueueId':Number(_0x549ef4[_0x3a42('0x3c')]['id'])});}return _0x575f61;});}})['then'](respondWithResult(_0x2985d2,null))['catch'](handleError(_0x2985d2,null));};exports[_0x3a42('0x71')]=function(_0x4175fc,_0x2c6950){return db[_0x3a42('0x25')][_0x3a42('0x3b')]({'where':{'id':_0x4175fc[_0x3a42('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2c6950,null))['then'](function(_0x108185){if(_0x108185){return _0x108185[_0x3a42('0x71')](_0x4175fc[_0x3a42('0x27')][_0x3a42('0x4f')])['then'](function(){if(_[_0x3a42('0x72')](_0x4175fc[_0x3a42('0x27')]['ids'])){for(var _0x1bba4e=0x0;_0x1bba4e<_0x4175fc[_0x3a42('0x27')][_0x3a42('0x4f')][_0x3a42('0x31')];_0x1bba4e+=0x1){socket['emit'](_0x3a42('0x6d'),{'UserId':Number(_0x4175fc[_0x3a42('0x27')][_0x3a42('0x4f')][_0x1bba4e]),'FaxQueueId':Number(_0x4175fc['params']['id'])});}}else{socket[_0x3a42('0x58')](_0x3a42('0x6d'),{'UserId':Number(_0x4175fc['query'][_0x3a42('0x4f')]),'FaxQueueId':Number(_0x4175fc[_0x3a42('0x3c')]['id'])});}});}})[_0x3a42('0x18')](respondWithStatusCode(_0x2c6950,null))['catch'](handleError(_0x2c6950,null));};exports[_0x3a42('0x73')]=function(_0x48ea2f,_0x35b712){var _0xcce2d1={};var _0x6dfb47={};var _0x31b165;var _0xd68556;return db[_0x3a42('0x25')][_0x3a42('0x3e')]({'where':{'id':_0x48ea2f[_0x3a42('0x3c')]['id']}})[_0x3a42('0x18')](handleEntityNotFound(_0x35b712,null))[_0x3a42('0x18')](function(_0x36cf4a){if(_0x36cf4a){_0x31b165=_0x36cf4a;_0x6dfb47[_0x3a42('0x2c')]=_[_0x3a42('0x2d')](db[_0x3a42('0x46')][_0x3a42('0x21')]);_0x6dfb47[_0x3a42('0x27')]=_['keys'](_0x48ea2f['query']);_0x6dfb47['filters']=_[_0x3a42('0x2f')](_0x6dfb47[_0x3a42('0x2c')],_0x6dfb47[_0x3a42('0x27')]);_0xcce2d1[_0x3a42('0x32')]=_[_0x3a42('0x2f')](_0x6dfb47[_0x3a42('0x2c')],qs[_0x3a42('0x30')](_0x48ea2f[_0x3a42('0x27')][_0x3a42('0x30')]));_0xcce2d1[_0x3a42('0x32')]=_0xcce2d1[_0x3a42('0x32')][_0x3a42('0x31')]?_0xcce2d1[_0x3a42('0x32')]:_0x6dfb47[_0x3a42('0x2c')];_0xcce2d1[_0x3a42('0x74')]=qs[_0x3a42('0x41')](_0x48ea2f['query'][_0x3a42('0x41')]);_0xcce2d1[_0x3a42('0x24')]=qs[_0x3a42('0x2e')](_[_0x3a42('0x42')](_0x48ea2f[_0x3a42('0x27')],_0x6dfb47[_0x3a42('0x2e')]));if(_0x48ea2f['query'][_0x3a42('0x44')]){_0xcce2d1[_0x3a42('0x24')]=_[_0x3a42('0x33')](_0xcce2d1[_0x3a42('0x24')],{'$or':_[_0x3a42('0x20')](_0xcce2d1[_0x3a42('0x32')],function(_0xc4ac3f){var _0x123537={};_0x123537[_0xc4ac3f]={'$like':'%'+_0x48ea2f[_0x3a42('0x27')]['filter']+'%'};return _0x123537;})});}_0xcce2d1=_[_0x3a42('0x33')]({},_0xcce2d1,_0x48ea2f[_0x3a42('0x45')]);return _0x31b165[_0x3a42('0x73')](_0xcce2d1);}})[_0x3a42('0x18')](function(_0x44fb0a){if(_0x44fb0a){_0xd68556=_0x44fb0a['length'];if(!_0x48ea2f[_0x3a42('0x27')][_0x3a42('0x4e')](_0x3a42('0x40'))){_0xcce2d1[_0x3a42('0x12')]=qs[_0x3a42('0x12')](_0x48ea2f[_0x3a42('0x27')][_0x3a42('0x12')]);_0xcce2d1['offset']=qs['offset'](_0x48ea2f['query']['offset']);}return _0x31b165[_0x3a42('0x73')](_0xcce2d1);}})['then'](function(_0x755115){if(_0x755115){return _0x755115?{'count':_0xd68556,'rows':_0x755115}:null;}})[_0x3a42('0x18')](respondWithResult(_0x35b712,null))[_0x3a42('0x2a')](handleError(_0x35b712,null));}; \ No newline at end of file +var _0x444e=['addAgents','omit','spread','getAgents','bluebird','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','offset','limit','count','set','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','FaxQueue','include','query','findAll','rows','catch','params','model','keys','filters','attributes','includeAll','merge','options','create','body','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','intersection','fields','length','nolimit','order','sort','where','FaxQueueId','filter','User','UserId','faxPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','pick','hasOwnProperty','addTeams','ids','Agents','online','interface','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Team','select','field','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','every','all','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove'];(function(_0x2c71de,_0x12e964){var _0x51cb86=function(_0x2c765b){while(--_0x2c765b){_0x2c71de['push'](_0x2c71de['shift']());}};_0x51cb86(++_0x12e964);}(_0x444e,0xe8));var _0xe444=function(_0x40f186,_0x9ed0d3){_0x40f186=_0x40f186-0x0;var _0x49d2bd=_0x444e[_0x40f186];return _0x49d2bd;};'use strict';var BPromise=require(_0xe444('0x0'));var util=require('util');var _=require(_0xe444('0x1'));var squel=require('squel');var Redis=require(_0xe444('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xe444('0x3'))('api');var config=require(_0xe444('0x4'));var db=require(_0xe444('0x5'))['db'];config[_0xe444('0x6')]=_[_0xe444('0x7')](config[_0xe444('0x6')],{'host':_0xe444('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe444('0x6')]));require('./faxQueue.socket')[_0xe444('0x9')](socket);function respondWithStatusCode(_0x482b98,_0x3199dd){_0x3199dd=_0x3199dd||0xcc;return function(_0x4b5e34){if(_0x4b5e34){return _0x482b98[_0xe444('0xa')](_0x3199dd);}return _0x482b98['status'](_0x3199dd)['end']();};}function respondWithResult(_0x36c8a5,_0x1f41ff){_0x1f41ff=_0x1f41ff||0xc8;return function(_0x5e53cb){if(_0x5e53cb){return _0x36c8a5[_0xe444('0xb')](_0x1f41ff)['json'](_0x5e53cb);}};}function respondWithFilteredResult(_0x5f0f7f,_0x390347){return function(_0x4cb1b6){if(_0x4cb1b6){var _0x2a6bf8=typeof _0x390347[_0xe444('0xc')]==='undefined'&&typeof _0x390347[_0xe444('0xd')]==='undefined';var _0x5ba044=_0x4cb1b6[_0xe444('0xe')];var _0x3e3b9f=_0x2a6bf8?0x0:_0x390347['offset'];var _0x192c1a=_0x2a6bf8?_0x4cb1b6['count']:_0x390347[_0xe444('0xc')]+_0x390347[_0xe444('0xd')];var _0x18f7cf;if(_0x192c1a>=_0x5ba044){_0x192c1a=_0x5ba044;_0x18f7cf=0xc8;}else{_0x18f7cf=0xce;}_0x5f0f7f[_0xe444('0xb')](_0x18f7cf);return _0x5f0f7f[_0xe444('0xf')](_0xe444('0x10'),_0x3e3b9f+'-'+_0x192c1a+'/'+_0x5ba044)[_0xe444('0x11')](_0x4cb1b6);}return null;};}function saveUpdates(_0x3e1b57){return function(_0x11129b){if(_0x11129b){return _0x11129b[_0xe444('0x12')](_0x3e1b57)[_0xe444('0x13')](function(_0x3d9066){return _0x3d9066;});}return null;};}function removeEntity(_0x38879b){return function(_0x4e2711){if(_0x4e2711){return _0x4e2711[_0xe444('0x14')]()[_0xe444('0x13')](function(){var _0x12eb54=_0x4e2711[_0xe444('0x15')]({'plain':!![]});var _0x58fd40=_0xe444('0x16');return db[_0xe444('0x17')][_0xe444('0x14')]({'where':{'type':_0x58fd40,'resourceId':_0x12eb54['id']}})[_0xe444('0x13')](function(){return _0x4e2711;});})[_0xe444('0x13')](function(){_0x38879b['status'](0xcc)[_0xe444('0x18')]();});}};}function handleEntityNotFound(_0x5ecdff){return function(_0x529336){if(!_0x529336){_0x5ecdff[_0xe444('0xa')](0x194);}return _0x529336;};}function handleError(_0x5ef1a4,_0x13108c){_0x13108c=_0x13108c||0x1f4;return function(_0x5c5b8){logger[_0xe444('0x19')](_0x5c5b8[_0xe444('0x1a')]);if(_0x5c5b8[_0xe444('0x1b')]){delete _0x5c5b8['name'];}_0x5ef1a4['status'](_0x13108c)[_0xe444('0x1c')](_0x5c5b8);};}exports[_0xe444('0x1d')]=function(_0x1ac266,_0x1ff6d2){var _0x2a03a2={};var _0x5e0311={'count':0x0,'rows':[]};var _0x3c9cf7=_[_0xe444('0x1e')](db['FaxQueue'][_0xe444('0x1f')],function(_0x4f4412){return{'name':_0x4f4412[_0xe444('0x20')],'type':_0x4f4412[_0xe444('0x21')][_0xe444('0x22')]};});_0x2a03a2=qs[_0xe444('0x23')](_0x3c9cf7,_0x1ac266);var _0x16915c={'where':_0x2a03a2['where']};return db[_0xe444('0x24')][_0xe444('0xe')](_0x16915c)[_0xe444('0x13')](function(_0x304b33){_0x5e0311['count']=_0x304b33;_0x2a03a2['include']=qs[_0xe444('0x25')](_0x1ac266[_0xe444('0x26')]);return db[_0xe444('0x24')][_0xe444('0x27')](_0x2a03a2);})['then'](function(_0x26e233){_0x5e0311[_0xe444('0x28')]=_0x26e233;return _0x5e0311;})[_0xe444('0x13')](respondWithFilteredResult(_0x1ff6d2,_0x2a03a2))[_0xe444('0x29')](handleError(_0x1ff6d2,null));};exports['show']=function(_0x5a1269,_0x5c37b6){var _0x1e2d04={'raw':!![],'where':{'id':_0x5a1269[_0xe444('0x2a')]['id']}},_0xd4df5={};_0xd4df5[_0xe444('0x2b')]=_[_0xe444('0x2c')](db['FaxQueue'][_0xe444('0x1f')]);_0xd4df5[_0xe444('0x26')]=_[_0xe444('0x2c')](_0x5a1269['query']);_0xd4df5[_0xe444('0x2d')]=_['intersection'](_0xd4df5['model'],_0xd4df5[_0xe444('0x26')]);_0x1e2d04[_0xe444('0x2e')]=_['intersection'](_0xd4df5[_0xe444('0x2b')],qs['fields'](_0x5a1269[_0xe444('0x26')]['fields']));_0x1e2d04['attributes']=_0x1e2d04[_0xe444('0x2e')]['length']?_0x1e2d04[_0xe444('0x2e')]:_0xd4df5[_0xe444('0x2b')];if(_0x5a1269[_0xe444('0x26')][_0xe444('0x2f')]){_0x1e2d04['include']=[{'all':!![]}];}_0x1e2d04=_[_0xe444('0x30')]({},_0x1e2d04,_0x5a1269[_0xe444('0x31')]);return db[_0xe444('0x24')]['find'](_0x1e2d04)[_0xe444('0x13')](handleEntityNotFound(_0x5c37b6,null))['then'](respondWithResult(_0x5c37b6,null))[_0xe444('0x29')](handleError(_0x5c37b6,null));};exports[_0xe444('0x32')]=function(_0x40df20,_0x4dc4c9){return db['FaxQueue'][_0xe444('0x32')](_0x40df20[_0xe444('0x33')],{})[_0xe444('0x13')](function(_0x238b2b){var _0xec1e35=_0x40df20[_0xe444('0x34')][_0xe444('0x15')]({'plain':!![]});if(!_0xec1e35)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xec1e35['role']===_0xe444('0x34')){var _0x495c9d=_0x238b2b[_0xe444('0x15')]({'plain':!![]});var _0x5cfdaa=_0xe444('0x16');return db[_0xe444('0x35')][_0xe444('0x36')]({'where':{'name':_0x5cfdaa,'userProfileId':_0xec1e35[_0xe444('0x37')]},'raw':!![]})[_0xe444('0x13')](function(_0x2b1e25){if(_0x2b1e25&&_0x2b1e25['autoAssociation']===0x0){return db[_0xe444('0x17')][_0xe444('0x32')]({'name':_0x495c9d[_0xe444('0x1b')],'resourceId':_0x495c9d['id'],'type':_0x2b1e25[_0xe444('0x1b')],'sectionId':_0x2b1e25['id']},{})['then'](function(){return _0x238b2b;});}else{return _0x238b2b;}})[_0xe444('0x29')](function(_0x19283c){logger[_0xe444('0x19')](_0xe444('0x38'),_0x19283c);throw _0x19283c;});}return _0x238b2b;})[_0xe444('0x13')](respondWithResult(_0x4dc4c9,0xc9))[_0xe444('0x29')](handleError(_0x4dc4c9,null));};exports[_0xe444('0x12')]=function(_0x390ba0,_0x16c249){if(_0x390ba0['body']['id']){delete _0x390ba0['body']['id'];}return db['FaxQueue'][_0xe444('0x36')]({'where':{'id':_0x390ba0[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](handleEntityNotFound(_0x16c249,null))[_0xe444('0x13')](saveUpdates(_0x390ba0[_0xe444('0x33')],null))['then'](respondWithResult(_0x16c249,null))['catch'](handleError(_0x16c249,null));};exports[_0xe444('0x14')]=function(_0x1674e9,_0x2f0d8a){return db['FaxQueue'][_0xe444('0x36')]({'where':{'id':_0x1674e9[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](handleEntityNotFound(_0x2f0d8a,null))[_0xe444('0x13')](removeEntity(_0x2f0d8a,null))[_0xe444('0x29')](handleError(_0x2f0d8a,null));};exports[_0xe444('0x39')]=function(_0x563ca2,_0x595f81){return db[_0xe444('0x24')][_0xe444('0x39')]()[_0xe444('0x13')](respondWithResult(_0x595f81,null))[_0xe444('0x29')](handleError(_0x595f81,null));};exports['getMembers']=function(_0x13b92d,_0x3f96bb){var _0x3549d0={'raw':!![],'where':{}},_0x394665={},_0xbbd474;return db[_0xe444('0x24')][_0xe444('0x3a')]({'where':{'id':_0x13b92d[_0xe444('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3f96bb,null))[_0xe444('0x13')](function(_0x1c584d){if(_0x1c584d){_0xbbd474=_0x1c584d[_0xe444('0x15')]({'plain':!![]});_0x394665['model']=_[_0xe444('0x2c')](db['UserFaxQueue']['rawAttributes']);_0x394665['query']=_[_0xe444('0x2c')](_0x13b92d[_0xe444('0x26')]);_0x394665['filters']=_['intersection'](_0x394665[_0xe444('0x2b')],_0x394665[_0xe444('0x26')]);_0x3549d0['attributes']=_[_0xe444('0x3b')](_0x394665[_0xe444('0x2b')],qs[_0xe444('0x3c')](_0x13b92d['query'][_0xe444('0x3c')]));_0x3549d0['attributes']=_0x3549d0[_0xe444('0x2e')][_0xe444('0x3d')]?_0x3549d0['attributes']:_0x394665['model'];if(!_0x13b92d[_0xe444('0x26')]['hasOwnProperty'](_0xe444('0x3e'))){_0x3549d0[_0xe444('0xd')]=qs['limit'](_0x13b92d[_0xe444('0x26')][_0xe444('0xd')]);_0x3549d0[_0xe444('0xc')]=qs[_0xe444('0xc')](_0x13b92d[_0xe444('0x26')][_0xe444('0xc')]);}_0x3549d0[_0xe444('0x3f')]=qs[_0xe444('0x40')](_0x13b92d[_0xe444('0x26')][_0xe444('0x40')]);_0x3549d0[_0xe444('0x41')]=qs[_0xe444('0x2d')](_['pick'](_0x13b92d[_0xe444('0x26')],_0x394665[_0xe444('0x2d')]));_0x3549d0['where'][_0xe444('0x42')]=_0x1c584d['id'];if(_0x13b92d['query'][_0xe444('0x43')]){_0x3549d0['where']=_[_0xe444('0x30')](_0x3549d0['where'],{'$or':_[_0xe444('0x1e')](_0x3549d0[_0xe444('0x2e')],function(_0x16aee3){var _0x2abc49={};_0x2abc49[_0x16aee3]={'$like':'%'+_0x13b92d[_0xe444('0x26')]['filter']+'%'};return _0x2abc49;})});}_0x3549d0=_[_0xe444('0x30')]({},_0x3549d0,_0x13b92d[_0xe444('0x31')]);return db['UserFaxQueue'][_0xe444('0x27')](_0x3549d0);}})[_0xe444('0x13')](function(_0x35da1f){if(_0x35da1f){return db[_0xe444('0x44')]['findAndCountAll']({'where':{'id':_[_0xe444('0x1e')](_0x35da1f,_0xe444('0x45')),'role':'agent'},'attributes':['id',_0xe444('0x1b'),_0xe444('0x46'),'updatedAt','createdAt']});}})[_0xe444('0x13')](function(_0x35793c){if(_0x35793c){return{'count':_0x35793c[_0xe444('0xe')],'rows':_[_0xe444('0x1e')](_0x35793c['rows'],function(_0xc4daf7){return{'membername':_0xc4daf7['name'],'UserId':_0xc4daf7['id'],'queue_name':_0xbbd474[_0xe444('0x1b')],'FaxQueueId':_0xbbd474['id'],'interface':util[_0xe444('0x47')](_0xe444('0x48'),_0xe444('0x49'),_0xc4daf7[_0xe444('0x1b')]),'penalty':0x0,'paused':_0xc4daf7['faxPause'],'createdAt':_0xc4daf7[_0xe444('0x4a')],'updatedAt':_0xc4daf7[_0xe444('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3f96bb,_0x3549d0))[_0xe444('0x29')](handleError(_0x3f96bb,null));};exports[_0xe444('0x4c')]=function(_0x3a9acf,_0x211d70){var _0x20796f={};var _0x273d54={};var _0x1c744e;var _0x410311;return db[_0xe444('0x24')][_0xe444('0x3a')]({'where':{'id':_0x3a9acf[_0xe444('0x2a')]['id']}})['then'](handleEntityNotFound(_0x211d70,null))[_0xe444('0x13')](function(_0x2d0b20){if(_0x2d0b20){_0x1c744e=_0x2d0b20;_0x273d54['model']=_[_0xe444('0x2c')](db['Team'][_0xe444('0x1f')]);_0x273d54[_0xe444('0x26')]=_[_0xe444('0x2c')](_0x3a9acf[_0xe444('0x26')]);_0x273d54['filters']=_[_0xe444('0x3b')](_0x273d54[_0xe444('0x2b')],_0x273d54['query']);_0x20796f[_0xe444('0x2e')]=_[_0xe444('0x3b')](_0x273d54['model'],qs[_0xe444('0x3c')](_0x3a9acf[_0xe444('0x26')][_0xe444('0x3c')]));_0x20796f['attributes']=_0x20796f[_0xe444('0x2e')][_0xe444('0x3d')]?_0x20796f['attributes']:_0x273d54[_0xe444('0x2b')];_0x20796f[_0xe444('0x3f')]=qs[_0xe444('0x40')](_0x3a9acf[_0xe444('0x26')][_0xe444('0x40')]);_0x20796f[_0xe444('0x41')]=qs[_0xe444('0x2d')](_[_0xe444('0x4d')](_0x3a9acf['query'],_0x273d54[_0xe444('0x2d')]));if(_0x3a9acf[_0xe444('0x26')][_0xe444('0x43')]){_0x20796f[_0xe444('0x41')]=_['merge'](_0x20796f[_0xe444('0x41')],{'$or':_[_0xe444('0x1e')](_0x20796f[_0xe444('0x2e')],function(_0x4b7f07){var _0x3d85a0={};_0x3d85a0[_0x4b7f07]={'$like':'%'+_0x3a9acf[_0xe444('0x26')][_0xe444('0x43')]+'%'};return _0x3d85a0;})});}_0x20796f=_[_0xe444('0x30')]({},_0x20796f,_0x3a9acf[_0xe444('0x31')]);return _0x1c744e[_0xe444('0x4c')](_0x20796f);}})[_0xe444('0x13')](function(_0x365d7f){if(_0x365d7f){_0x410311=_0x365d7f[_0xe444('0x3d')];if(!_0x3a9acf[_0xe444('0x26')][_0xe444('0x4e')]('nolimit')){_0x20796f[_0xe444('0xd')]=qs[_0xe444('0xd')](_0x3a9acf[_0xe444('0x26')]['limit']);_0x20796f[_0xe444('0xc')]=qs[_0xe444('0xc')](_0x3a9acf['query'][_0xe444('0xc')]);}return _0x1c744e[_0xe444('0x4c')](_0x20796f);}})[_0xe444('0x13')](function(_0x4b6ed4){if(_0x4b6ed4){return _0x4b6ed4?{'count':_0x410311,'rows':_0x4b6ed4}:null;}})[_0xe444('0x13')](respondWithResult(_0x211d70,null))[_0xe444('0x29')](handleError(_0x211d70,null));};exports[_0xe444('0x4f')]=function(_0x17ed5c,_0xa26b2){var _0x558190=_0x17ed5c['body'][_0xe444('0x50')];return db['Team'][_0xe444('0x27')]({'where':{'id':_0x558190},'attributes':['id'],'include':[{'model':db[_0xe444('0x44')],'as':_0xe444('0x51'),'attributes':['id','name',_0xe444('0x52'),'voicePause',_0xe444('0x53')],'raw':!![]}]})[_0xe444('0x13')](function(_0x4d3dfa){if(_0x4d3dfa){var _0x5e7e4b=_['flatMap'](_0x4d3dfa,function(_0x2ac3a1){var _0x57344f=_0x2ac3a1[_0xe444('0x15')]({'plain':!![]});return _0x57344f['Agents'];});return db['FaxQueue'][_0xe444('0x36')]({'where':{'id':_0x17ed5c[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](function(_0x936b6d){return db['sequelize']['transaction'](function(_0x10f7b0){return _0x936b6d['addTeams'](_0x558190,{'transaction':_0x10f7b0})[_0xe444('0x13')](function(){return BPromise[_0xe444('0x54')](_0x5e7e4b,function(_0x4ff543){return db['UserFaxQueue'][_0xe444('0x55')]({'where':{'UserId':_0x4ff543['id'],'FaxQueueId':_0x17ed5c[_0xe444('0x2a')]['id']},'transaction':_0x10f7b0});});})[_0xe444('0x13')](function(){_0x5e7e4b[_0xe444('0x56')](function(_0x10d76f){socket[_0xe444('0x57')](_0xe444('0x58'),{'UserId':_0x10d76f['id'],'FaxQueueId':_0x936b6d['id']});});});});});}})[_0xe444('0x13')](respondWithStatusCode(_0xa26b2,null))['catch'](handleError(_0xa26b2,null));};exports[_0xe444('0x59')]=function(_0x4fc53a,_0x395707){return db[_0xe444('0x5a')][_0xe444('0x27')]({'where':{'id':_0x4fc53a[_0xe444('0x26')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe444('0x44')],'as':_0xe444('0x51'),'attributes':['id'],'raw':!![]}]})[_0xe444('0x13')](handleEntityNotFound(_0x395707,null))[_0xe444('0x13')](function(_0x2e33e0){var _0x5001fa=_[_0xe444('0x1e')](_0x2e33e0,'id');var _0x433304=[];var _0x1d7b58=[];var _0x466c5c=squel[_0xe444('0x5b')]();_0x466c5c[_0xe444('0x5c')]('tq.TeamId')[_0xe444('0x5d')](_0xe444('0x5e'),'tq')[_0xe444('0x5f')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe444('0x41')](_0xe444('0x60'),_0x4fc53a[_0xe444('0x2a')]['id']);for(var _0x1675c8=0x0;_0x1675c8<_0x2e33e0[_0xe444('0x3d')];_0x1675c8+=0x1){let _0x2b8de6=_0x2e33e0[_0x1675c8];for(var _0xb5039a=0x0;_0xb5039a<_0x2b8de6['Agents'][_0xe444('0x3d')];_0xb5039a+=0x1){let _0x42789d=_0x2b8de6[_0xe444('0x51')][_0xb5039a];var _0x5027da=_0x466c5c[_0xe444('0x61')]();_0x5027da[_0xe444('0x41')]('ut.UserId\x20=\x20?',_0x42789d['id']);_0x1d7b58[_0xe444('0x62')](db['sequelize']['query'](_0x5027da[_0xe444('0x63')](),{'type':db[_0xe444('0x64')][_0xe444('0x65')]['SELECT']})[_0xe444('0x13')](function(_0x3b5d9c){if(_0x3b5d9c[_0xe444('0x3d')]===0x1){return _0x42789d['id'];}else{var _0x51b876=_[_0xe444('0x66')](_[_0xe444('0x1e')](_0x3b5d9c,'TeamId'),function(_0xb20f20){return _['includes'](_0x5001fa,_0xb20f20);});if(_0x51b876){return _0x42789d['id'];}}}));}}return BPromise[_0xe444('0x67')](_0x1d7b58)['then'](function(_0x1372a7){_0x433304=_(_0x433304)['union'](_0x1372a7)[_0xe444('0x68')]()[_0xe444('0x69')]();return db[_0xe444('0x24')][_0xe444('0x36')]({'where':{'id':_0x4fc53a[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](function(_0x517f69){return db[_0xe444('0x64')][_0xe444('0x6a')](function(_0xb30cb6){return _0x517f69[_0xe444('0x59')](_0x4fc53a[_0xe444('0x26')][_0xe444('0x50')],{'transaction':_0xb30cb6})['then'](function(){if(!_[_0xe444('0x6b')](_0x433304)){return _0x517f69[_0xe444('0x6c')](_0x433304,{'transaction':_0xb30cb6});}})[_0xe444('0x13')](function(){_0x433304[_0xe444('0x56')](function(_0x4cda77){socket[_0xe444('0x57')](_0xe444('0x6d'),{'UserId':_0x4cda77,'FaxQueueId':_0x517f69['id']});});});});});});})['then'](respondWithStatusCode(_0x395707,null))[_0xe444('0x29')](handleError(_0x395707,null));};exports[_0xe444('0x6e')]=function(_0x356445,_0x5b863c){return db[_0xe444('0x24')]['find']({'where':{'id':_0x356445[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](handleEntityNotFound(_0x5b863c,null))[_0xe444('0x13')](function(_0x3f1842){if(_0x3f1842){return _0x3f1842[_0xe444('0x6e')](_0x356445[_0xe444('0x33')][_0xe444('0x50')],_[_0xe444('0x6f')](_0x356445[_0xe444('0x33')],[_0xe444('0x50'),'id'])||{})[_0xe444('0x70')](function(_0x103ed0){for(var _0x34deff=0x0;_0x34deff<_0x356445['body'][_0xe444('0x50')]['length'];_0x34deff+=0x1){socket[_0xe444('0x57')](_0xe444('0x58'),{'UserId':Number(_0x356445[_0xe444('0x33')][_0xe444('0x50')][_0x34deff]),'FaxQueueId':Number(_0x356445[_0xe444('0x2a')]['id'])});}return _0x103ed0;});}})[_0xe444('0x13')](respondWithResult(_0x5b863c,null))[_0xe444('0x29')](handleError(_0x5b863c,null));};exports[_0xe444('0x6c')]=function(_0x5a7c24,_0x32d87f){return db[_0xe444('0x24')][_0xe444('0x36')]({'where':{'id':_0x5a7c24[_0xe444('0x2a')]['id']}})[_0xe444('0x13')](handleEntityNotFound(_0x32d87f,null))['then'](function(_0x1fa6fa){if(_0x1fa6fa){return _0x1fa6fa['removeAgents'](_0x5a7c24[_0xe444('0x26')][_0xe444('0x50')])['then'](function(){if(_['isArray'](_0x5a7c24[_0xe444('0x26')][_0xe444('0x50')])){for(var _0x592b5a=0x0;_0x592b5a<_0x5a7c24[_0xe444('0x26')][_0xe444('0x50')][_0xe444('0x3d')];_0x592b5a+=0x1){socket[_0xe444('0x57')]('userFaxQueue:remove',{'UserId':Number(_0x5a7c24[_0xe444('0x26')]['ids'][_0x592b5a]),'FaxQueueId':Number(_0x5a7c24[_0xe444('0x2a')]['id'])});}}else{socket[_0xe444('0x57')]('userFaxQueue:remove',{'UserId':Number(_0x5a7c24[_0xe444('0x26')][_0xe444('0x50')]),'FaxQueueId':Number(_0x5a7c24[_0xe444('0x2a')]['id'])});}});}})[_0xe444('0x13')](respondWithStatusCode(_0x32d87f,null))[_0xe444('0x29')](handleError(_0x32d87f,null));};exports[_0xe444('0x71')]=function(_0x1bc594,_0x15279f){var _0x4692b5={};var _0x40d8e4={};var _0x2d5a9c;var _0x281db5;return db[_0xe444('0x24')][_0xe444('0x3a')]({'where':{'id':_0x1bc594[_0xe444('0x2a')]['id']}})['then'](handleEntityNotFound(_0x15279f,null))[_0xe444('0x13')](function(_0x106383){if(_0x106383){_0x2d5a9c=_0x106383;_0x40d8e4[_0xe444('0x2b')]=_[_0xe444('0x2c')](db[_0xe444('0x44')][_0xe444('0x1f')]);_0x40d8e4[_0xe444('0x26')]=_['keys'](_0x1bc594[_0xe444('0x26')]);_0x40d8e4[_0xe444('0x2d')]=_[_0xe444('0x3b')](_0x40d8e4[_0xe444('0x2b')],_0x40d8e4[_0xe444('0x26')]);_0x4692b5['attributes']=_[_0xe444('0x3b')](_0x40d8e4[_0xe444('0x2b')],qs['fields'](_0x1bc594[_0xe444('0x26')][_0xe444('0x3c')]));_0x4692b5[_0xe444('0x2e')]=_0x4692b5[_0xe444('0x2e')]['length']?_0x4692b5[_0xe444('0x2e')]:_0x40d8e4[_0xe444('0x2b')];_0x4692b5[_0xe444('0x3f')]=qs[_0xe444('0x40')](_0x1bc594['query'][_0xe444('0x40')]);_0x4692b5[_0xe444('0x41')]=qs[_0xe444('0x2d')](_['pick'](_0x1bc594[_0xe444('0x26')],_0x40d8e4['filters']));if(_0x1bc594[_0xe444('0x26')][_0xe444('0x43')]){_0x4692b5[_0xe444('0x41')]=_[_0xe444('0x30')](_0x4692b5[_0xe444('0x41')],{'$or':_[_0xe444('0x1e')](_0x4692b5[_0xe444('0x2e')],function(_0x232d08){var _0xb32dd0={};_0xb32dd0[_0x232d08]={'$like':'%'+_0x1bc594[_0xe444('0x26')][_0xe444('0x43')]+'%'};return _0xb32dd0;})});}_0x4692b5=_[_0xe444('0x30')]({},_0x4692b5,_0x1bc594[_0xe444('0x31')]);return _0x2d5a9c[_0xe444('0x71')](_0x4692b5);}})['then'](function(_0x18a436){if(_0x18a436){_0x281db5=_0x18a436[_0xe444('0x3d')];if(!_0x1bc594[_0xe444('0x26')][_0xe444('0x4e')](_0xe444('0x3e'))){_0x4692b5[_0xe444('0xd')]=qs[_0xe444('0xd')](_0x1bc594[_0xe444('0x26')]['limit']);_0x4692b5[_0xe444('0xc')]=qs[_0xe444('0xc')](_0x1bc594[_0xe444('0x26')][_0xe444('0xc')]);}return _0x2d5a9c['getAgents'](_0x4692b5);}})[_0xe444('0x13')](function(_0x43d40d){if(_0x43d40d){return _0x43d40d?{'count':_0x281db5,'rows':_0x43d40d}:null;}})['then'](respondWithResult(_0x15279f,null))[_0xe444('0x29')](handleError(_0x15279f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fd4b2c2..31002cc 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 _0xa90d=['events','../../mysqldb','FaxQueue','save','emit','hook','exports'];(function(_0x384a8b,_0xbe5a16){var _0x338518=function(_0x3c56db){while(--_0x3c56db){_0x384a8b['push'](_0x384a8b['shift']());}};_0x338518(++_0xbe5a16);}(_0xa90d,0xbd));var _0xda90=function(_0x288628,_0x5ea07f){_0x288628=_0x288628-0x0;var _0x1545fc=_0xa90d[_0x288628];return _0x1545fc;};'use strict';var EventEmitter=require(_0xda90('0x0'));var FaxQueue=require(_0xda90('0x1'))['db'][_0xda90('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda90('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x172516){return function(_0x5954d1,_0x2a1eb6,_0x5bda8e){FaxQueueEvents[_0xda90('0x4')](_0x172516+':'+_0x5954d1['id'],_0x5954d1);FaxQueueEvents[_0xda90('0x4')](_0x172516,_0x5954d1);_0x5bda8e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xda90('0x5')](e,emitEvent(event));}}module[_0xda90('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x24f8=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x374710,_0x5b0774){var _0x51063f=function(_0xf40937){while(--_0xf40937){_0x374710['push'](_0x374710['shift']());}};_0x51063f(++_0x5b0774);}(_0x24f8,0x64));var _0x824f=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x24f8[_0x42bc91];return _0x3f5507;};'use strict';var EventEmitter=require(_0x824f('0x0'));var FaxQueue=require(_0x824f('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x824f('0x2'),'afterUpdate':_0x824f('0x3'),'afterDestroy':_0x824f('0x4')};function emitEvent(_0x282354){return function(_0x2cec67,_0x4a6a67,_0x339d3b){FaxQueueEvents[_0x824f('0x5')](_0x282354+':'+_0x2cec67['id'],_0x2cec67);FaxQueueEvents[_0x824f('0x5')](_0x282354,_0x2cec67);_0x339d3b(null);};}for(var e in events){if(events[_0x824f('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x824f('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 29f481b..6dfccd0 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 _0x8933=['../../config/logger','api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports'];(function(_0x425501,_0x4f80ed){var _0x59c6d1=function(_0x40a386){while(--_0x40a386){_0x425501['push'](_0x425501['shift']());}};_0x59c6d1(++_0x4f80ed);}(_0x8933,0xa8));var _0x3893=function(_0x462ca1,_0x3183a6){_0x462ca1=_0x462ca1-0x0;var _0x3462ee=_0x8933[_0x462ca1];return _0x3462ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3893('0x0'))(_0x3893('0x1'));var moment=require(_0x3893('0x2'));var BPromise=require(_0x3893('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3893('0x4'));var rimraf=require('rimraf');var config=require(_0x3893('0x5'));var attributes=require(_0x3893('0x6'));module[_0x3893('0x7')]=function(_0x3e2250,_0x298db3){return _0x3e2250['define']('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54d8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x54d8,0x159));var _0x854d=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x54d8[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0x854d('0x0'));var util=require(_0x854d('0x1'));var logger=require(_0x854d('0x2'))(_0x854d('0x3'));var moment=require(_0x854d('0x4'));var BPromise=require(_0x854d('0x5'));var rp=require(_0x854d('0x6'));var fs=require('fs');var path=require(_0x854d('0x7'));var rimraf=require(_0x854d('0x8'));var config=require(_0x854d('0x9'));var attributes=require(_0x854d('0xa'));module[_0x854d('0xb')]=function(_0x487950,_0x410849){return _0x487950[_0x854d('0xc')](_0x854d('0xd'),attributes,{'tableName':_0x854d('0xe'),'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 68470d8..0cbd51e 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 _0x42b5=['then','GetFaxQueue','ShowFaxQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x5f58a1,_0x234450){var _0x362706=function(_0x2e0af6){while(--_0x2e0af6){_0x5f58a1['push'](_0x5f58a1['shift']());}};_0x362706(++_0x234450);}(_0x42b5,0x1b2));var _0x542b=function(_0x4a14a3,_0x44ee62){_0x4a14a3=_0x4a14a3-0x0;var _0x611b22=_0x42b5[_0x4a14a3];return _0x611b22;};'use strict';var _=require(_0x542b('0x0'));var util=require('util');var moment=require(_0x542b('0x1'));var BPromise=require(_0x542b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x542b('0x3'));var db=require(_0x542b('0x4'))['db'];var utils=require(_0x542b('0x5'));var logger=require(_0x542b('0x6'))(_0x542b('0x7'));var config=require(_0x542b('0x8'));var jayson=require(_0x542b('0x9'));var client=jayson['client'][_0x542b('0xa')]({'port':0x232a});config[_0x542b('0xb')]=_[_0x542b('0xc')](config[_0x542b('0xb')],{'host':_0x542b('0xd'),'port':0x18eb});var socket=require(_0x542b('0xe'))(new Redis(config['redis']));require(_0x542b('0xf'))[_0x542b('0x10')](socket);function respondWithRpcPromise(_0x4fb3e9,_0x560675,_0x264dc9){return new BPromise(function(_0x47a394,_0x133f60){return client[_0x542b('0x11')](_0x4fb3e9,_0x264dc9)['then'](function(_0xc0aff8){logger[_0x542b('0x12')](_0x542b('0x13'),_0x560675,'request\x20sent');logger[_0x542b('0x14')](_0x542b('0x15'),_0x560675,_0x542b('0x16'),JSON[_0x542b('0x17')](_0xc0aff8));if(_0xc0aff8['error']){if(_0xc0aff8[_0x542b('0x18')][_0x542b('0x19')]===0x1f4){logger[_0x542b('0x18')](_0x542b('0x13'),_0x560675,_0xc0aff8[_0x542b('0x18')][_0x542b('0x1a')]);return _0x133f60(_0xc0aff8['error'][_0x542b('0x1a')]);}logger[_0x542b('0x18')](_0x542b('0x13'),_0x560675,_0xc0aff8['error'][_0x542b('0x1a')]);return _0x47a394(_0xc0aff8[_0x542b('0x18')][_0x542b('0x1a')]);}else{logger['info'](_0x542b('0x13'),_0x560675,'request\x20sent');_0x47a394(_0xc0aff8[_0x542b('0x1b')][_0x542b('0x1a')]);}})[_0x542b('0x1c')](function(_0x2a2bc5){logger[_0x542b('0x18')](_0x542b('0x13'),_0x560675,_0x2a2bc5);_0x133f60(_0x2a2bc5);});});}exports['GetFaxQueue']=function(_0xd3a426){var _0x190700=this;return new Promise(function(_0x59a8a9,_0x3b822b){return db[_0x542b('0x1d')][_0x542b('0x1e')]({'raw':_0xd3a426[_0x542b('0x1f')]?_0xd3a426[_0x542b('0x1f')][_0x542b('0x20')]===undefined?!![]:![]:!![],'where':_0xd3a426[_0x542b('0x1f')]?_0xd3a426[_0x542b('0x1f')][_0x542b('0x21')]||null:null,'attributes':_0xd3a426['options']?_0xd3a426[_0x542b('0x1f')][_0x542b('0x22')]||null:null,'limit':_0xd3a426[_0x542b('0x1f')]?_0xd3a426[_0x542b('0x1f')][_0x542b('0x23')]||null:null,'include':_0xd3a426[_0x542b('0x1f')]?_0xd3a426[_0x542b('0x1f')]['include']?_[_0x542b('0x24')](_0xd3a426[_0x542b('0x1f')][_0x542b('0x25')],function(_0x497167){return{'model':db[_0x497167['model']],'as':_0x497167['as'],'attributes':_0x497167[_0x542b('0x22')],'include':_0x497167['include']?_['map'](_0x497167['include'],function(_0x30468f){return{'model':db[_0x30468f[_0x542b('0x26')]],'as':_0x30468f['as'],'attributes':_0x30468f[_0x542b('0x22')],'include':_0x30468f[_0x542b('0x25')]?_[_0x542b('0x24')](_0x30468f[_0x542b('0x25')],function(_0x71f96a){return{'model':db[_0x71f96a[_0x542b('0x26')]],'as':_0x71f96a['as'],'attributes':_0x71f96a['attributes']};}):[]};}):[]};}):[]:[]})[_0x542b('0x27')](function(_0x151108){logger['info'](_0x542b('0x28'),_0xd3a426);logger['debug']('GetFaxQueue',_0xd3a426,JSON[_0x542b('0x17')](_0x151108));_0x59a8a9(_0x151108);})['catch'](function(_0x12d31c){logger[_0x542b('0x18')](_0x542b('0x28'),_0x12d31c[_0x542b('0x1a')],_0xd3a426);_0x3b822b(_0x190700['error'](0x1f4,_0x12d31c[_0x542b('0x1a')]));});});};exports[_0x542b('0x29')]=function(_0x27cd71){var _0x2fb11a=this;return new Promise(function(_0x3fb88a,_0x1b7f09){return db[_0x542b('0x1d')][_0x542b('0x2a')]({'raw':_0x27cd71[_0x542b('0x1f')]?_0x27cd71['options'][_0x542b('0x20')]===undefined?!![]:![]:!![],'where':_0x27cd71[_0x542b('0x1f')]?_0x27cd71['options'][_0x542b('0x21')]||null:null,'attributes':_0x27cd71[_0x542b('0x1f')]?_0x27cd71[_0x542b('0x1f')][_0x542b('0x22')]||null:null,'include':_0x27cd71[_0x542b('0x1f')]?_0x27cd71['options']['include']?_[_0x542b('0x24')](_0x27cd71[_0x542b('0x1f')][_0x542b('0x25')],function(_0x327510){return{'model':db[_0x327510['model']],'as':_0x327510['as'],'attributes':_0x327510[_0x542b('0x22')],'include':_0x327510[_0x542b('0x25')]?_[_0x542b('0x24')](_0x327510[_0x542b('0x25')],function(_0x1855f2){return{'model':db[_0x1855f2[_0x542b('0x26')]],'as':_0x1855f2['as'],'attributes':_0x1855f2[_0x542b('0x22')],'include':_0x1855f2[_0x542b('0x25')]?_[_0x542b('0x24')](_0x1855f2[_0x542b('0x25')],function(_0x33a464){return{'model':db[_0x33a464['model']],'as':_0x33a464['as'],'attributes':_0x33a464['attributes']};}):[]};}):[]};}):[]:[]})[_0x542b('0x27')](function(_0x152332){logger[_0x542b('0x12')]('ShowFaxQueue',_0x27cd71);logger[_0x542b('0x14')](_0x542b('0x29'),_0x27cd71,JSON[_0x542b('0x17')](_0x152332));_0x3fb88a(_0x152332);})[_0x542b('0x1c')](function(_0x3e5602){logger[_0x542b('0x18')](_0x542b('0x29'),_0x3e5602['message'],_0x27cd71);_0x1b7f09(_0x2fb11a[_0x542b('0x18')](0x1f4,_0x3e5602[_0x542b('0x1a')]));});});}; \ No newline at end of file +var _0x0fff=['../../config/utils','../../config/logger','rpc','client','defaults','redis','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','include','map','model','attributes','find','ShowFaxQueue','lodash','moment','bluebird','../../mysqldb'];(function(_0x1fcc72,_0x191471){var _0x77731c=function(_0x36c407){while(--_0x36c407){_0x1fcc72['push'](_0x1fcc72['shift']());}};_0x77731c(++_0x191471);}(_0x0fff,0x65));var _0xf0ff=function(_0x217e15,_0x11734b){_0x217e15=_0x217e15-0x0;var _0x1e45bf=_0x0fff[_0x217e15];return _0x1e45bf;};'use strict';var _=require(_0xf0ff('0x0'));var util=require('util');var moment=require(_0xf0ff('0x1'));var BPromise=require(_0xf0ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ff('0x3'))['db'];var utils=require(_0xf0ff('0x4'));var logger=require(_0xf0ff('0x5'))(_0xf0ff('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0ff('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf0ff('0x8')](config[_0xf0ff('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0ff('0xa'))[_0xf0ff('0xb')](socket);function respondWithRpcPromise(_0x35d27f,_0x40c309,_0x1bc330){return new BPromise(function(_0x31340e,_0x375fa9){return client['request'](_0x35d27f,_0x1bc330)[_0xf0ff('0xc')](function(_0x10531e){logger[_0xf0ff('0xd')](_0xf0ff('0xe'),_0x40c309,_0xf0ff('0xf'));logger[_0xf0ff('0x10')](_0xf0ff('0x11'),_0x40c309,_0xf0ff('0xf'),JSON[_0xf0ff('0x12')](_0x10531e));if(_0x10531e[_0xf0ff('0x13')]){if(_0x10531e['error'][_0xf0ff('0x14')]===0x1f4){logger[_0xf0ff('0x13')](_0xf0ff('0xe'),_0x40c309,_0x10531e[_0xf0ff('0x13')][_0xf0ff('0x15')]);return _0x375fa9(_0x10531e[_0xf0ff('0x13')]['message']);}logger[_0xf0ff('0x13')](_0xf0ff('0xe'),_0x40c309,_0x10531e[_0xf0ff('0x13')]['message']);return _0x31340e(_0x10531e[_0xf0ff('0x13')][_0xf0ff('0x15')]);}else{logger[_0xf0ff('0xd')]('FaxQueue,\x20%s,\x20%s',_0x40c309,'request\x20sent');_0x31340e(_0x10531e[_0xf0ff('0x16')][_0xf0ff('0x15')]);}})[_0xf0ff('0x17')](function(_0x1cbf45){logger[_0xf0ff('0x13')](_0xf0ff('0xe'),_0x40c309,_0x1cbf45);_0x375fa9(_0x1cbf45);});});}exports[_0xf0ff('0x18')]=function(_0x52f214){var _0x45a22e=this;return new Promise(function(_0x4a6282,_0xbb9763){return db[_0xf0ff('0x19')]['findAll']({'raw':_0x52f214['options']?_0x52f214[_0xf0ff('0x1a')][_0xf0ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x52f214[_0xf0ff('0x1a')]?_0x52f214['options'][_0xf0ff('0x1c')]||null:null,'attributes':_0x52f214['options']?_0x52f214[_0xf0ff('0x1a')]['attributes']||null:null,'limit':_0x52f214['options']?_0x52f214[_0xf0ff('0x1a')]['limit']||null:null,'include':_0x52f214[_0xf0ff('0x1a')]?_0x52f214[_0xf0ff('0x1a')][_0xf0ff('0x1d')]?_[_0xf0ff('0x1e')](_0x52f214[_0xf0ff('0x1a')]['include'],function(_0x2265b3){return{'model':db[_0x2265b3[_0xf0ff('0x1f')]],'as':_0x2265b3['as'],'attributes':_0x2265b3[_0xf0ff('0x20')],'include':_0x2265b3[_0xf0ff('0x1d')]?_[_0xf0ff('0x1e')](_0x2265b3[_0xf0ff('0x1d')],function(_0x2da4cb){return{'model':db[_0x2da4cb[_0xf0ff('0x1f')]],'as':_0x2da4cb['as'],'attributes':_0x2da4cb[_0xf0ff('0x20')],'include':_0x2da4cb[_0xf0ff('0x1d')]?_[_0xf0ff('0x1e')](_0x2da4cb[_0xf0ff('0x1d')],function(_0x6d02f2){return{'model':db[_0x6d02f2[_0xf0ff('0x1f')]],'as':_0x6d02f2['as'],'attributes':_0x6d02f2[_0xf0ff('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf0ff('0xc')](function(_0x150df0){logger[_0xf0ff('0xd')](_0xf0ff('0x18'),_0x52f214);logger[_0xf0ff('0x10')](_0xf0ff('0x18'),_0x52f214,JSON[_0xf0ff('0x12')](_0x150df0));_0x4a6282(_0x150df0);})[_0xf0ff('0x17')](function(_0x516696){logger[_0xf0ff('0x13')](_0xf0ff('0x18'),_0x516696[_0xf0ff('0x15')],_0x52f214);_0xbb9763(_0x45a22e['error'](0x1f4,_0x516696['message']));});});};exports['ShowFaxQueue']=function(_0x5d7639){var _0x144773=this;return new Promise(function(_0x2b4382,_0x316f84){return db[_0xf0ff('0x19')][_0xf0ff('0x21')]({'raw':_0x5d7639[_0xf0ff('0x1a')]?_0x5d7639[_0xf0ff('0x1a')][_0xf0ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d7639['options']?_0x5d7639[_0xf0ff('0x1a')][_0xf0ff('0x1c')]||null:null,'attributes':_0x5d7639[_0xf0ff('0x1a')]?_0x5d7639[_0xf0ff('0x1a')][_0xf0ff('0x20')]||null:null,'include':_0x5d7639[_0xf0ff('0x1a')]?_0x5d7639[_0xf0ff('0x1a')]['include']?_[_0xf0ff('0x1e')](_0x5d7639[_0xf0ff('0x1a')][_0xf0ff('0x1d')],function(_0x346c62){return{'model':db[_0x346c62[_0xf0ff('0x1f')]],'as':_0x346c62['as'],'attributes':_0x346c62[_0xf0ff('0x20')],'include':_0x346c62[_0xf0ff('0x1d')]?_['map'](_0x346c62['include'],function(_0x37e3b0){return{'model':db[_0x37e3b0['model']],'as':_0x37e3b0['as'],'attributes':_0x37e3b0[_0xf0ff('0x20')],'include':_0x37e3b0['include']?_[_0xf0ff('0x1e')](_0x37e3b0['include'],function(_0x1885de){return{'model':db[_0x1885de[_0xf0ff('0x1f')]],'as':_0x1885de['as'],'attributes':_0x1885de[_0xf0ff('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf0ff('0xc')](function(_0x453a71){logger['info'](_0xf0ff('0x22'),_0x5d7639);logger[_0xf0ff('0x10')]('ShowFaxQueue',_0x5d7639,JSON[_0xf0ff('0x12')](_0x453a71));_0x2b4382(_0x453a71);})[_0xf0ff('0x17')](function(_0x1392b1){logger[_0xf0ff('0x13')]('ShowFaxQueue',_0x1392b1[_0xf0ff('0x15')],_0x5d7639);_0x316f84(_0x144773[_0xf0ff('0x13')](0x1f4,_0x1392b1[_0xf0ff('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 18fe051..04cce58 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 _0xf206=['remove','update','emit','removeListener','length','faxQueue:','save'];(function(_0x5e2334,_0xa1e5f1){var _0x4fb38e=function(_0x45bd8d){while(--_0x45bd8d){_0x5e2334['push'](_0x5e2334['shift']());}};_0x4fb38e(++_0xa1e5f1);}(_0xf206,0x1f0));var _0x6f20=function(_0x111692,_0x3ec491){_0x111692=_0x111692-0x0;var _0x17bd01=_0xf206[_0x111692];return _0x17bd01;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x6f20('0x0'),_0x6f20('0x1'),_0x6f20('0x2')];function createListener(_0x1d2613,_0x1a6a21){return function(_0x4e03a5){_0x1a6a21[_0x6f20('0x3')](_0x1d2613,_0x4e03a5);};}function removeListener(_0x58fa58,_0x39b904){return function(){FaxQueueEvents[_0x6f20('0x4')](_0x58fa58,_0x39b904);};}exports['register']=function(_0x14ae0e){for(var _0xc6c9c9=0x0,_0x108954=events[_0x6f20('0x5')];_0xc6c9c9<_0x108954;_0xc6c9c9++){var _0x441598=events[_0xc6c9c9];var _0x2f5a47=createListener(_0x6f20('0x6')+_0x441598,_0x14ae0e);FaxQueueEvents['on'](_0x441598,_0x2f5a47);}}; \ No newline at end of file +var _0x045e=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x315889,_0x26c977){var _0x203f38=function(_0x56cd30){while(--_0x56cd30){_0x315889['push'](_0x315889['shift']());}};_0x203f38(++_0x26c977);}(_0x045e,0xfb));var _0xe045=function(_0x108c5b,_0x52c0fb){_0x108c5b=_0x108c5b-0x0;var _0x2afb52=_0x045e[_0x108c5b];return _0x2afb52;};'use strict';var FaxQueueEvents=require(_0xe045('0x0'));var events=[_0xe045('0x1'),_0xe045('0x2'),'update'];function createListener(_0x25b44b,_0x1c59d6){return function(_0x2f1373){_0x1c59d6[_0xe045('0x3')](_0x25b44b,_0x2f1373);};}function removeListener(_0xc4ebdf,_0x3b160d){return function(){FaxQueueEvents[_0xe045('0x4')](_0xc4ebdf,_0x3b160d);};}exports['register']=function(_0x3a0980){for(var _0x338862=0x0,_0xf9c791=events[_0xe045('0x5')];_0x338862<_0xf9c791;_0x338862++){var _0x3219c2=events[_0x338862];var _0x46390f=createListener(_0xe045('0x6')+_0x3219c2,_0x3a0980);FaxQueueEvents['on'](_0x3219c2,_0x46390f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 30bbf40..1924b72 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 _0x0295=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','getMembers','getTeams','getAgents','/:id/teams','addTeams','post','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0x0295,0x1f0));var _0x5029=function(_0x401a4d,_0x4bb835){_0x401a4d=_0x401a4d-0x0;var _0x1faaff=_0x0295[_0x401a4d];return _0x1faaff;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/members',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/teams',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x11')]);router[_0x5029('0x12')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router[_0x5029('0x15')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router['delete'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0x17')]);router[_0x5029('0x15')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x18')]);module['exports']=router; \ No newline at end of file +var _0xaa3f=['getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x5122f5,_0x3a19ec){_0x5122f5=_0x5122f5-0x0;var _0x33e9a2=_0xaa3f[_0x5122f5];return _0x33e9a2;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xfaa3('0x10')]);router[_0xfaa3('0x9')](_0xfaa3('0x11'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x12')]);router[_0xfaa3('0x9')]('/:id/users',auth[_0xfaa3('0xc')](),controller['getAgents']);router[_0xfaa3('0x13')]('/',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x14')]);router['post'](_0xfaa3('0x11'),auth['isAuthenticated'](),controller[_0xfaa3('0x15')]);router[_0xfaa3('0x13')](_0xfaa3('0x16'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x17')]);router[_0xfaa3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xfaa3('0x19')]);router[_0xfaa3('0x1a')](_0xfaa3('0xe'),auth[_0xfaa3('0xc')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xfaa3('0x1a')]('/:id/users',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x1b')]);module[_0xfaa3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 5df3911..14a33d9 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 _0x44e6=['STRING','DATE','moment','sequelize'];(function(_0x29a620,_0x2b4353){var _0x410f7d=function(_0x463e47){while(--_0x463e47){_0x29a620['push'](_0x29a620['shift']());}};_0x410f7d(++_0x2b4353);}(_0x44e6,0xda));var _0x644e=function(_0x9ad1e6,_0x1de9b3){_0x9ad1e6=_0x9ad1e6-0x0;var _0x3df6d1=_0x44e6[_0x9ad1e6];return _0x3df6d1;};'use strict';var moment=require(_0x644e('0x0'));var Sequelize=require(_0x644e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x644e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x644e('0x2')]},'joinAt':{'type':Sequelize[_0x644e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x644e('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x644e('0x2')]}}; \ No newline at end of file +var _0xb2f1=['STRING','DATE','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2f1,0xee));var _0x1b2f=function(_0x54b893,_0x123df2){_0x54b893=_0x54b893-0x0;var _0x6557c3=_0xb2f1[_0x54b893];return _0x6557c3;};'use strict';var moment=require(_0x1b2f('0x0'));var Sequelize=require(_0x1b2f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1b2f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1b2f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1b2f('0x3')]},'acceptAt':{'type':Sequelize[_0x1b2f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b91abab..d24503a 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 _0xdb76=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','send','index','FaxQueueReport','fieldName','type','key','map','name','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','create','update','body','find','describe','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'];(function(_0x117f87,_0x4a1be5){var _0x3b46ad=function(_0x36e7e0){while(--_0x36e7e0){_0x117f87['push'](_0x117f87['shift']());}};_0x3b46ad(++_0x4a1be5);}(_0xdb76,0x1be));var _0x6db7=function(_0x3b8b65,_0x4cd046){_0x3b8b65=_0x3b8b65-0x0;var _0xbd5f84=_0xdb76[_0x3b8b65];return _0xbd5f84;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require('moment');var BPromise=require(_0x6db7('0x5'));var Mustache=require(_0x6db7('0x6'));var util=require(_0x6db7('0x7'));var path=require(_0x6db7('0x8'));var sox=require('sox');var csv=require(_0x6db7('0x9'));var ejs=require(_0x6db7('0xa'));var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6db7('0xe'));var deskjs=require(_0x6db7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0x10'));var Papa=require(_0x6db7('0x11'));var Redis=require(_0x6db7('0x12'));var authService=require(_0x6db7('0x13'));var qs=require(_0x6db7('0x14'));var as=require(_0x6db7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6db7('0x16'));var utils=require(_0x6db7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db7('0x18'));var db=require(_0x6db7('0x19'))['db'];function respondWithStatusCode(_0x421d28,_0x1658dd){_0x1658dd=_0x1658dd||0xcc;return function(_0x375f4a){if(_0x375f4a){return _0x421d28[_0x6db7('0x1a')](_0x1658dd);}return _0x421d28['status'](_0x1658dd)['end']();};}function respondWithResult(_0x426d31,_0x348ccf){_0x348ccf=_0x348ccf||0xc8;return function(_0x167384){if(_0x167384){return _0x426d31[_0x6db7('0x1b')](_0x348ccf)[_0x6db7('0x1c')](_0x167384);}};}function respondWithFilteredResult(_0x28dd67,_0x144684){return function(_0x43f66c){if(_0x43f66c){var _0x1432ac=typeof _0x144684[_0x6db7('0x1d')]===_0x6db7('0x1e')&&typeof _0x144684[_0x6db7('0x1f')]==='undefined';var _0x3c97b2=_0x43f66c[_0x6db7('0x20')];var _0x331e92=_0x1432ac?0x0:_0x144684[_0x6db7('0x1d')];var _0x37ffe3=_0x1432ac?_0x43f66c[_0x6db7('0x20')]:_0x144684[_0x6db7('0x1d')]+_0x144684[_0x6db7('0x1f')];var _0x3f8575;if(_0x37ffe3>=_0x3c97b2){_0x37ffe3=_0x3c97b2;_0x3f8575=0xc8;}else{_0x3f8575=0xce;}_0x28dd67[_0x6db7('0x1b')](_0x3f8575);return _0x28dd67[_0x6db7('0x21')](_0x6db7('0x22'),_0x331e92+'-'+_0x37ffe3+'/'+_0x3c97b2)['json'](_0x43f66c);}return null;};}function patchUpdates(_0x1cae66){return function(_0x206aa2){try{jsonpatch[_0x6db7('0x23')](_0x206aa2,_0x1cae66,!![]);}catch(_0x46a383){return BPromise[_0x6db7('0x24')](_0x46a383);}return _0x206aa2[_0x6db7('0x25')]();};}function saveUpdates(_0x4a78f7,_0x1b0f04){return function(_0x2795ab){if(_0x2795ab){return _0x2795ab['update'](_0x4a78f7)[_0x6db7('0x26')](function(_0x1ba956){return _0x1ba956;});}return null;};}function removeEntity(_0x7ca54f,_0x48e3af){return function(_0x24d818){if(_0x24d818){return _0x24d818[_0x6db7('0x27')]()['then'](function(){_0x7ca54f[_0x6db7('0x1b')](0xcc)[_0x6db7('0x28')]();});}};}function handleEntityNotFound(_0x2d6fca,_0x558d58){return function(_0x559e14){if(!_0x559e14){_0x2d6fca[_0x6db7('0x1a')](0x194);}return _0x559e14;};}function handleError(_0x105b81,_0xdbd9f1){_0xdbd9f1=_0xdbd9f1||0x1f4;return function(_0x4f28e9){logger[_0x6db7('0x29')](_0x4f28e9[_0x6db7('0x2a')]);if(_0x4f28e9['name']){delete _0x4f28e9['name'];}_0x105b81[_0x6db7('0x1b')](_0xdbd9f1)[_0x6db7('0x2b')](_0x4f28e9);};}exports[_0x6db7('0x2c')]=function(_0x3890f0,_0x11185d){var _0xc4f615={},_0x4fb6dd={},_0x81d08b={'count':0x0,'rows':[]};var _0x3856d5=_['map'](db[_0x6db7('0x2d')]['rawAttributes'],function(_0xbff04f){return{'name':_0xbff04f[_0x6db7('0x2e')],'type':_0xbff04f[_0x6db7('0x2f')][_0x6db7('0x30')]};});_0x4fb6dd['model']=_[_0x6db7('0x31')](_0x3856d5,_0x6db7('0x32'));_0x4fb6dd[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x3890f0[_0x6db7('0x33')]);_0x4fb6dd['filters']=_[_0x6db7('0x35')](_0x4fb6dd[_0x6db7('0x36')],_0x4fb6dd[_0x6db7('0x33')]);_0xc4f615['attributes']=_[_0x6db7('0x35')](_0x4fb6dd[_0x6db7('0x36')],qs[_0x6db7('0x37')](_0x3890f0['query'][_0x6db7('0x37')]));_0xc4f615['attributes']=_0xc4f615[_0x6db7('0x38')]['length']?_0xc4f615['attributes']:_0x4fb6dd[_0x6db7('0x36')];if(!_0x3890f0[_0x6db7('0x33')][_0x6db7('0x39')](_0x6db7('0x3a'))){_0xc4f615['limit']=qs['limit'](_0x3890f0[_0x6db7('0x33')][_0x6db7('0x1f')]);_0xc4f615['offset']=qs[_0x6db7('0x1d')](_0x3890f0['query'][_0x6db7('0x1d')]);}_0xc4f615['order']=qs[_0x6db7('0x3b')](_0x3890f0['query']['sort']);_0xc4f615[_0x6db7('0x3c')]=qs[_0x6db7('0x3d')](_[_0x6db7('0x3e')](_0x3890f0[_0x6db7('0x33')],_0x4fb6dd[_0x6db7('0x3d')]),_0x3856d5);if(_0x3890f0['query'][_0x6db7('0x3f')]){_0xc4f615[_0x6db7('0x3c')]=_[_0x6db7('0x40')](_0xc4f615[_0x6db7('0x3c')],{'$or':_[_0x6db7('0x31')](_0x3856d5,function(_0x4ff457){if(_0x4ff457['type']!==_0x6db7('0x41')){var _0x465ac7={};_0x465ac7[_0x4ff457[_0x6db7('0x32')]]={'$like':'%'+_0x3890f0['query'][_0x6db7('0x3f')]+'%'};return _0x465ac7;}})});}_0xc4f615=_['merge']({},_0xc4f615,_0x3890f0[_0x6db7('0x42')]);var _0x3fb6c5={'where':_0xc4f615['where']};return db[_0x6db7('0x2d')]['count'](_0x3fb6c5)[_0x6db7('0x26')](function(_0x497c1f){_0x81d08b[_0x6db7('0x20')]=_0x497c1f;if(_0x3890f0['query'][_0x6db7('0x43')]){_0xc4f615['include']=[{'all':!![]}];}return db[_0x6db7('0x2d')]['findAll'](_0xc4f615);})[_0x6db7('0x26')](function(_0xf9fb55){_0x81d08b[_0x6db7('0x44')]=_0xf9fb55;return _0x81d08b;})['then'](respondWithFilteredResult(_0x11185d,_0xc4f615))[_0x6db7('0x45')](handleError(_0x11185d,null));};exports[_0x6db7('0x46')]=function(_0x288c58,_0x4d82c7){var _0xe0f5aa={'raw':!![],'where':{'id':_0x288c58[_0x6db7('0x47')]['id']}},_0x1c495b={};_0x1c495b[_0x6db7('0x36')]=_[_0x6db7('0x34')](db[_0x6db7('0x2d')]['rawAttributes']);_0x1c495b[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x288c58['query']);_0x1c495b['filters']=_[_0x6db7('0x35')](_0x1c495b[_0x6db7('0x36')],_0x1c495b[_0x6db7('0x33')]);_0xe0f5aa['attributes']=_[_0x6db7('0x35')](_0x1c495b[_0x6db7('0x36')],qs[_0x6db7('0x37')](_0x288c58[_0x6db7('0x33')][_0x6db7('0x37')]));_0xe0f5aa['attributes']=_0xe0f5aa[_0x6db7('0x38')][_0x6db7('0x48')]?_0xe0f5aa[_0x6db7('0x38')]:_0x1c495b['model'];if(_0x288c58['query'][_0x6db7('0x43')]){_0xe0f5aa['include']=[{'all':!![]}];}_0xe0f5aa=_[_0x6db7('0x40')]({},_0xe0f5aa,_0x288c58[_0x6db7('0x42')]);return db['FaxQueueReport']['find'](_0xe0f5aa)[_0x6db7('0x26')](handleEntityNotFound(_0x4d82c7,null))[_0x6db7('0x26')](respondWithResult(_0x4d82c7,null))[_0x6db7('0x45')](handleError(_0x4d82c7,null));};exports[_0x6db7('0x49')]=function(_0x283a2c,_0x980eaa){return db[_0x6db7('0x2d')][_0x6db7('0x49')](_0x283a2c['body'],{})[_0x6db7('0x26')](respondWithResult(_0x980eaa,0xc9))[_0x6db7('0x45')](handleError(_0x980eaa,null));};exports[_0x6db7('0x4a')]=function(_0x4a8c78,_0x48b8a7){if(_0x4a8c78[_0x6db7('0x4b')]['id']){delete _0x4a8c78[_0x6db7('0x4b')]['id'];}return db[_0x6db7('0x2d')][_0x6db7('0x4c')]({'where':{'id':_0x4a8c78[_0x6db7('0x47')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x48b8a7,null))[_0x6db7('0x26')](saveUpdates(_0x4a8c78['body'],null))[_0x6db7('0x26')](respondWithResult(_0x48b8a7,null))[_0x6db7('0x45')](handleError(_0x48b8a7,null));};exports[_0x6db7('0x27')]=function(_0x3ca942,_0x4f8fb1){return db[_0x6db7('0x2d')][_0x6db7('0x4c')]({'where':{'id':_0x3ca942[_0x6db7('0x47')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x4f8fb1,null))['then'](removeEntity(_0x4f8fb1,null))[_0x6db7('0x45')](handleError(_0x4f8fb1,null));};exports[_0x6db7('0x4d')]=function(_0x57640a,_0x599090){return db[_0x6db7('0x2d')]['describe']()[_0x6db7('0x26')](respondWithResult(_0x599090,null))['catch'](handleError(_0x599090,null));}; \ No newline at end of file +var _0x1da6=['update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0x1da6,0x7c));var _0x61da=function(_0x4ed37d,_0x1a84c9){_0x4ed37d=_0x4ed37d-0x0;var _0x4fb2c5=_0x1da6[_0x4ed37d];return _0x4fb2c5;};'use strict';var emlformat=require(_0x61da('0x0'));var rimraf=require(_0x61da('0x1'));var zipdir=require(_0x61da('0x2'));var jsonpatch=require(_0x61da('0x3'));var rp=require(_0x61da('0x4'));var moment=require(_0x61da('0x5'));var BPromise=require(_0x61da('0x6'));var Mustache=require(_0x61da('0x7'));var util=require(_0x61da('0x8'));var path=require(_0x61da('0x9'));var sox=require(_0x61da('0xa'));var csv=require(_0x61da('0xb'));var ejs=require(_0x61da('0xc'));var fs=require('fs');var fs_extra=require(_0x61da('0xd'));var _=require(_0x61da('0xe'));var squel=require(_0x61da('0xf'));var crypto=require(_0x61da('0x10'));var jsforce=require(_0x61da('0x11'));var deskjs=require(_0x61da('0x12'));var toCsv=require(_0x61da('0xb'));var querystring=require('querystring');var Papa=require(_0x61da('0x13'));var Redis=require(_0x61da('0x14'));var authService=require(_0x61da('0x15'));var qs=require(_0x61da('0x16'));var as=require(_0x61da('0x17'));var hardwareService=require(_0x61da('0x18'));var logger=require(_0x61da('0x19'))(_0x61da('0x1a'));var utils=require(_0x61da('0x1b'));var config=require(_0x61da('0x1c'));var licenseUtil=require(_0x61da('0x1d'));var db=require(_0x61da('0x1e'))['db'];function respondWithStatusCode(_0x1eb368,_0x1036e4){_0x1036e4=_0x1036e4||0xcc;return function(_0x43ec70){if(_0x43ec70){return _0x1eb368['sendStatus'](_0x1036e4);}return _0x1eb368[_0x61da('0x1f')](_0x1036e4)[_0x61da('0x20')]();};}function respondWithResult(_0x191033,_0x472abc){_0x472abc=_0x472abc||0xc8;return function(_0x55eef1){if(_0x55eef1){return _0x191033[_0x61da('0x1f')](_0x472abc)['json'](_0x55eef1);}};}function respondWithFilteredResult(_0x21a5fc,_0x6d24b7){return function(_0x4a0aea){if(_0x4a0aea){var _0x53f3a4=typeof _0x6d24b7[_0x61da('0x21')]===_0x61da('0x22')&&typeof _0x6d24b7[_0x61da('0x23')]===_0x61da('0x22');var _0x2ac3aa=_0x4a0aea[_0x61da('0x24')];var _0x505b1c=_0x53f3a4?0x0:_0x6d24b7[_0x61da('0x21')];var _0x34a678=_0x53f3a4?_0x4a0aea[_0x61da('0x24')]:_0x6d24b7[_0x61da('0x21')]+_0x6d24b7['limit'];var _0x1a0e6e;if(_0x34a678>=_0x2ac3aa){_0x34a678=_0x2ac3aa;_0x1a0e6e=0xc8;}else{_0x1a0e6e=0xce;}_0x21a5fc[_0x61da('0x1f')](_0x1a0e6e);return _0x21a5fc[_0x61da('0x25')](_0x61da('0x26'),_0x505b1c+'-'+_0x34a678+'/'+_0x2ac3aa)['json'](_0x4a0aea);}return null;};}function patchUpdates(_0x22b8bc){return function(_0x5c0363){try{jsonpatch[_0x61da('0x27')](_0x5c0363,_0x22b8bc,!![]);}catch(_0x172066){return BPromise[_0x61da('0x28')](_0x172066);}return _0x5c0363[_0x61da('0x29')]();};}function saveUpdates(_0x1868af,_0x129bb0){return function(_0x30c6f8){if(_0x30c6f8){return _0x30c6f8[_0x61da('0x2a')](_0x1868af)[_0x61da('0x2b')](function(_0x325e28){return _0x325e28;});}return null;};}function removeEntity(_0x56f5d2,_0x2c9e83){return function(_0x35550a){if(_0x35550a){return _0x35550a[_0x61da('0x2c')]()[_0x61da('0x2b')](function(){_0x56f5d2[_0x61da('0x1f')](0xcc)[_0x61da('0x20')]();});}};}function handleEntityNotFound(_0x4860d4,_0x2c5d97){return function(_0xe37079){if(!_0xe37079){_0x4860d4[_0x61da('0x2d')](0x194);}return _0xe37079;};}function handleError(_0x100ba1,_0x351241){_0x351241=_0x351241||0x1f4;return function(_0x262e32){logger[_0x61da('0x2e')](_0x262e32[_0x61da('0x2f')]);if(_0x262e32['name']){delete _0x262e32[_0x61da('0x30')];}_0x100ba1[_0x61da('0x1f')](_0x351241)[_0x61da('0x31')](_0x262e32);};}exports[_0x61da('0x32')]=function(_0x52f486,_0x275aa6){var _0x591efe={},_0x2c9a1d={},_0x2cc862={'count':0x0,'rows':[]};var _0x3a31a2=_[_0x61da('0x33')](db[_0x61da('0x34')][_0x61da('0x35')],function(_0xb97400){return{'name':_0xb97400['fieldName'],'type':_0xb97400[_0x61da('0x36')]['key']};});_0x2c9a1d['model']=_[_0x61da('0x33')](_0x3a31a2,_0x61da('0x30'));_0x2c9a1d[_0x61da('0x37')]=_[_0x61da('0x38')](_0x52f486[_0x61da('0x37')]);_0x2c9a1d['filters']=_[_0x61da('0x39')](_0x2c9a1d[_0x61da('0x3a')],_0x2c9a1d[_0x61da('0x37')]);_0x591efe[_0x61da('0x3b')]=_['intersection'](_0x2c9a1d[_0x61da('0x3a')],qs[_0x61da('0x3c')](_0x52f486['query'][_0x61da('0x3c')]));_0x591efe['attributes']=_0x591efe['attributes']['length']?_0x591efe['attributes']:_0x2c9a1d['model'];if(!_0x52f486[_0x61da('0x37')][_0x61da('0x3d')](_0x61da('0x3e'))){_0x591efe[_0x61da('0x23')]=qs[_0x61da('0x23')](_0x52f486['query'][_0x61da('0x23')]);_0x591efe[_0x61da('0x21')]=qs[_0x61da('0x21')](_0x52f486['query'][_0x61da('0x21')]);}_0x591efe[_0x61da('0x3f')]=qs[_0x61da('0x40')](_0x52f486['query'][_0x61da('0x40')]);_0x591efe[_0x61da('0x41')]=qs[_0x61da('0x42')](_[_0x61da('0x43')](_0x52f486[_0x61da('0x37')],_0x2c9a1d['filters']),_0x3a31a2);if(_0x52f486[_0x61da('0x37')][_0x61da('0x44')]){_0x591efe[_0x61da('0x41')]=_[_0x61da('0x45')](_0x591efe[_0x61da('0x41')],{'$or':_['map'](_0x3a31a2,function(_0x4e6512){if(_0x4e6512['type']!==_0x61da('0x46')){var _0x278732={};_0x278732[_0x4e6512[_0x61da('0x30')]]={'$like':'%'+_0x52f486[_0x61da('0x37')][_0x61da('0x44')]+'%'};return _0x278732;}})});}_0x591efe=_[_0x61da('0x45')]({},_0x591efe,_0x52f486[_0x61da('0x47')]);var _0x522aeb={'where':_0x591efe[_0x61da('0x41')]};return db[_0x61da('0x34')]['count'](_0x522aeb)[_0x61da('0x2b')](function(_0x1a430f){_0x2cc862[_0x61da('0x24')]=_0x1a430f;if(_0x52f486['query'][_0x61da('0x48')]){_0x591efe['include']=[{'all':!![]}];}return db[_0x61da('0x34')][_0x61da('0x49')](_0x591efe);})[_0x61da('0x2b')](function(_0x40d4a2){_0x2cc862['rows']=_0x40d4a2;return _0x2cc862;})[_0x61da('0x2b')](respondWithFilteredResult(_0x275aa6,_0x591efe))[_0x61da('0x4a')](handleError(_0x275aa6,null));};exports[_0x61da('0x4b')]=function(_0x47e1a5,_0x18e2da){var _0x36d744={'raw':!![],'where':{'id':_0x47e1a5[_0x61da('0x4c')]['id']}},_0x1dd879={};_0x1dd879[_0x61da('0x3a')]=_[_0x61da('0x38')](db['FaxQueueReport'][_0x61da('0x35')]);_0x1dd879[_0x61da('0x37')]=_[_0x61da('0x38')](_0x47e1a5[_0x61da('0x37')]);_0x1dd879[_0x61da('0x42')]=_[_0x61da('0x39')](_0x1dd879[_0x61da('0x3a')],_0x1dd879[_0x61da('0x37')]);_0x36d744['attributes']=_['intersection'](_0x1dd879[_0x61da('0x3a')],qs[_0x61da('0x3c')](_0x47e1a5[_0x61da('0x37')][_0x61da('0x3c')]));_0x36d744[_0x61da('0x3b')]=_0x36d744['attributes'][_0x61da('0x4d')]?_0x36d744[_0x61da('0x3b')]:_0x1dd879[_0x61da('0x3a')];if(_0x47e1a5[_0x61da('0x37')][_0x61da('0x48')]){_0x36d744[_0x61da('0x4e')]=[{'all':!![]}];}_0x36d744=_[_0x61da('0x45')]({},_0x36d744,_0x47e1a5[_0x61da('0x47')]);return db[_0x61da('0x34')]['find'](_0x36d744)[_0x61da('0x2b')](handleEntityNotFound(_0x18e2da,null))[_0x61da('0x2b')](respondWithResult(_0x18e2da,null))[_0x61da('0x4a')](handleError(_0x18e2da,null));};exports[_0x61da('0x4f')]=function(_0x5bf90a,_0x1b5ebf){return db[_0x61da('0x34')][_0x61da('0x4f')](_0x5bf90a[_0x61da('0x50')],{})[_0x61da('0x2b')](respondWithResult(_0x1b5ebf,0xc9))['catch'](handleError(_0x1b5ebf,null));};exports[_0x61da('0x2a')]=function(_0x5b3dee,_0x584ddd){if(_0x5b3dee[_0x61da('0x50')]['id']){delete _0x5b3dee[_0x61da('0x50')]['id'];}return db['FaxQueueReport'][_0x61da('0x51')]({'where':{'id':_0x5b3dee[_0x61da('0x4c')]['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x584ddd,null))['then'](saveUpdates(_0x5b3dee[_0x61da('0x50')],null))[_0x61da('0x2b')](respondWithResult(_0x584ddd,null))[_0x61da('0x4a')](handleError(_0x584ddd,null));};exports[_0x61da('0x2c')]=function(_0x4dd6fb,_0x19ec8a){return db['FaxQueueReport'][_0x61da('0x51')]({'where':{'id':_0x4dd6fb['params']['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x19ec8a,null))[_0x61da('0x2b')](removeEntity(_0x19ec8a,null))[_0x61da('0x4a')](handleError(_0x19ec8a,null));};exports[_0x61da('0x52')]=function(_0x47b335,_0xc5c8a6){return db[_0x61da('0x34')][_0x61da('0x52')]()[_0x61da('0x2b')](respondWithResult(_0xc5c8a6,null))[_0x61da('0x4a')](handleError(_0xc5c8a6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e138569..502c60b 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x1cb9,0x14e));var _0x91cb=function(_0x352afd,_0x185b96){_0x352afd=_0x352afd-0x0;var _0x528648=_0x1cb9[_0x352afd];return _0x528648;};'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 +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x814b,0x1a2));var _0xb814=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0x814b[_0x4e21ba];return _0x55b94b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7a297e7..9203e63 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 _0x636a=['UpdateFaxQueueReport','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateFaxQueueReport','body','options','raw','FaxQueueReport','where','attributes','limit'];(function(_0x510872,_0x5cfffd){var _0x498a2e=function(_0x29fc0e){while(--_0x29fc0e){_0x510872['push'](_0x510872['shift']());}};_0x498a2e(++_0x5cfffd);}(_0x636a,0x156));var _0xa636=function(_0x7f870e,_0x393b9c){_0x7f870e=_0x7f870e-0x0;var _0x752210=_0x636a[_0x7f870e];return _0x752210;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa636('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa636('0x1'));var db=require(_0xa636('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa636('0x3'))(_0xa636('0x4'));var config=require(_0xa636('0x5'));var jayson=require(_0xa636('0x6'));var client=jayson[_0xa636('0x7')][_0xa636('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d8ab0,_0x2a5e58,_0x37a088){return new BPromise(function(_0x163298,_0x861b01){return client[_0xa636('0x9')](_0x2d8ab0,_0x37a088)[_0xa636('0xa')](function(_0x31fd48){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2a5e58,'request\x20sent');logger[_0xa636('0xb')](_0xa636('0xc'),_0x2a5e58,'request\x20sent',JSON[_0xa636('0xd')](_0x31fd48));if(_0x31fd48[_0xa636('0xe')]){if(_0x31fd48[_0xa636('0xe')][_0xa636('0xf')]===0x1f4){logger[_0xa636('0xe')](_0xa636('0x10'),_0x2a5e58,_0x31fd48[_0xa636('0xe')][_0xa636('0x11')]);return _0x861b01(_0x31fd48[_0xa636('0xe')][_0xa636('0x11')]);}logger['error'](_0xa636('0x10'),_0x2a5e58,_0x31fd48[_0xa636('0xe')][_0xa636('0x11')]);return _0x163298(_0x31fd48[_0xa636('0xe')]['message']);}else{logger[_0xa636('0x12')](_0xa636('0x10'),_0x2a5e58,_0xa636('0x13'));_0x163298(_0x31fd48[_0xa636('0x14')][_0xa636('0x11')]);}})[_0xa636('0x15')](function(_0x3b8b6e){logger[_0xa636('0xe')](_0xa636('0x10'),_0x2a5e58,_0x3b8b6e);_0x861b01(_0x3b8b6e);});});}exports[_0xa636('0x16')]=function(_0x267912){var _0x56bc1a=this;return new Promise(function(_0x41ba43,_0x129ee0){return db['FaxQueueReport']['create'](_0x267912[_0xa636('0x17')],{'raw':_0x267912[_0xa636('0x18')]?_0x267912[_0xa636('0x18')][_0xa636('0x19')]===undefined?!![]:![]:!![]})[_0xa636('0xa')](function(_0x1c4986){logger[_0xa636('0x12')]('CreateFaxQueueReport',_0x267912);logger['debug']('CreateFaxQueueReport',_0x267912,JSON['stringify'](_0x1c4986));_0x41ba43(_0x1c4986);})[_0xa636('0x15')](function(_0x4c057d){logger[_0xa636('0xe')](_0xa636('0x16'),_0x4c057d[_0xa636('0x11')],_0x267912);_0x129ee0(_0x56bc1a[_0xa636('0xe')](0x1f4,_0x4c057d[_0xa636('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x5eec0c){var _0x22d0f3=this;return new Promise(function(_0xc5d8d8,_0x41d791){return db[_0xa636('0x1a')]['update'](_0x5eec0c[_0xa636('0x17')],{'raw':_0x5eec0c[_0xa636('0x18')]?_0x5eec0c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eec0c[_0xa636('0x18')]?_0x5eec0c['options'][_0xa636('0x1b')]||null:null,'attributes':_0x5eec0c[_0xa636('0x18')]?_0x5eec0c['options'][_0xa636('0x1c')]||null:null,'limit':_0x5eec0c['options']?_0x5eec0c[_0xa636('0x18')][_0xa636('0x1d')]||null:null})[_0xa636('0xa')](function(_0x3212f5){logger['info'](_0xa636('0x1e'),_0x5eec0c);logger['debug'](_0xa636('0x1e'),_0x5eec0c,JSON[_0xa636('0xd')](_0x3212f5));_0xc5d8d8(_0x3212f5);})[_0xa636('0x15')](function(_0x3fa8f2){logger[_0xa636('0xe')](_0xa636('0x1e'),_0x3fa8f2['message'],_0x5eec0c);_0x41d791(_0x22d0f3[_0xa636('0xe')](0x1f4,_0x3fa8f2[_0xa636('0x11')]));});});}; \ No newline at end of file +var _0x4d56=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','attributes'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x4d56,0x117));var _0x64d5=function(_0x2ab4fa,_0xf90b71){_0x2ab4fa=_0x2ab4fa-0x0;var _0x5f31aa=_0x4d56[_0x2ab4fa];return _0x5f31aa;};'use strict';var _=require(_0x64d5('0x0'));var util=require(_0x64d5('0x1'));var moment=require(_0x64d5('0x2'));var BPromise=require(_0x64d5('0x3'));var rs=require(_0x64d5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64d5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64d5('0x7'));var client=jayson[_0x64d5('0x8')][_0x64d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ec6f,_0x1b242d,_0x1177ed){return new BPromise(function(_0x5bb9df,_0x4ec5e9){return client[_0x64d5('0xa')](_0x50ec6f,_0x1177ed)[_0x64d5('0xb')](function(_0x42c593){logger[_0x64d5('0xc')](_0x64d5('0xd'),_0x1b242d,_0x64d5('0xe'));logger[_0x64d5('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1b242d,_0x64d5('0xe'),JSON[_0x64d5('0x10')](_0x42c593));if(_0x42c593['error']){if(_0x42c593[_0x64d5('0x11')][_0x64d5('0x12')]===0x1f4){logger[_0x64d5('0x11')](_0x64d5('0xd'),_0x1b242d,_0x42c593[_0x64d5('0x11')][_0x64d5('0x13')]);return _0x4ec5e9(_0x42c593['error'][_0x64d5('0x13')]);}logger[_0x64d5('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1b242d,_0x42c593[_0x64d5('0x11')][_0x64d5('0x13')]);return _0x5bb9df(_0x42c593['error'][_0x64d5('0x13')]);}else{logger[_0x64d5('0xc')](_0x64d5('0xd'),_0x1b242d,_0x64d5('0xe'));_0x5bb9df(_0x42c593[_0x64d5('0x14')][_0x64d5('0x13')]);}})[_0x64d5('0x15')](function(_0x3b766b){logger[_0x64d5('0x11')](_0x64d5('0xd'),_0x1b242d,_0x3b766b);_0x4ec5e9(_0x3b766b);});});}exports['CreateFaxQueueReport']=function(_0x411c13){var _0x336354=this;return new Promise(function(_0x54b25b,_0x43c7c9){return db['FaxQueueReport'][_0x64d5('0x16')](_0x411c13[_0x64d5('0x17')],{'raw':_0x411c13[_0x64d5('0x18')]?_0x411c13[_0x64d5('0x18')][_0x64d5('0x19')]===undefined?!![]:![]:!![]})[_0x64d5('0xb')](function(_0x22cc89){logger[_0x64d5('0xc')](_0x64d5('0x1a'),_0x411c13);logger[_0x64d5('0xf')](_0x64d5('0x1a'),_0x411c13,JSON[_0x64d5('0x10')](_0x22cc89));_0x54b25b(_0x22cc89);})[_0x64d5('0x15')](function(_0xb2dfcf){logger['error'](_0x64d5('0x1a'),_0xb2dfcf[_0x64d5('0x13')],_0x411c13);_0x43c7c9(_0x336354['error'](0x1f4,_0xb2dfcf[_0x64d5('0x13')]));});});};exports[_0x64d5('0x1b')]=function(_0x55316e){var _0xc48bf1=this;return new Promise(function(_0x4f2f2d,_0x176feb){return db[_0x64d5('0x1c')][_0x64d5('0x1d')](_0x55316e[_0x64d5('0x17')],{'raw':_0x55316e[_0x64d5('0x18')]?_0x55316e['options'][_0x64d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55316e['options']?_0x55316e[_0x64d5('0x18')]['where']||null:null,'attributes':_0x55316e['options']?_0x55316e['options'][_0x64d5('0x1e')]||null:null,'limit':_0x55316e[_0x64d5('0x18')]?_0x55316e['options']['limit']||null:null})[_0x64d5('0xb')](function(_0x5bda27){logger[_0x64d5('0xc')](_0x64d5('0x1b'),_0x55316e);logger[_0x64d5('0xf')](_0x64d5('0x1b'),_0x55316e,JSON['stringify'](_0x5bda27));_0x4f2f2d(_0x5bda27);})[_0x64d5('0x15')](function(_0x63e8de){logger[_0x64d5('0x11')](_0x64d5('0x1b'),_0x63e8de[_0x64d5('0x13')],_0x55316e);_0x176feb(_0xc48bf1['error'](0x1f4,_0x63e8de[_0x64d5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e5f5a8e..8026195 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 _0x0a48=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update'];(function(_0x1bf754,_0x51820a){var _0x5dc91f=function(_0x4ae6c3){while(--_0x4ae6c3){_0x1bf754['push'](_0x1bf754['shift']());}};_0x5dc91f(++_0x51820a);}(_0x0a48,0x66));var _0x80a4=function(_0xbe69e9,_0x2bd781){_0xbe69e9=_0xbe69e9-0x0;var _0x1b1eb8=_0x0a48[_0xbe69e9];return _0x1b1eb8;};'use strict';var multer=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var path=require(_0x80a4('0x2'));var timeout=require(_0x80a4('0x3'));var express=require(_0x80a4('0x4'));var router=express[_0x80a4('0x5')]();var fs_extra=require(_0x80a4('0x6'));var auth=require(_0x80a4('0x7'));var interaction=require(_0x80a4('0x8'));var config=require('../../config/environment');var controller=require(_0x80a4('0x9'));router[_0x80a4('0xa')]('/',auth[_0x80a4('0xb')](),controller['index']);router[_0x80a4('0xa')](_0x80a4('0xc'),auth[_0x80a4('0xb')](),controller[_0x80a4('0xd')]);router[_0x80a4('0xa')](_0x80a4('0xe'),auth[_0x80a4('0xb')](),controller[_0x80a4('0xf')]);router[_0x80a4('0x10')]('/',auth[_0x80a4('0xb')](),controller['create']);router['put'](_0x80a4('0xe'),auth[_0x80a4('0xb')](),controller[_0x80a4('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x80a4('0x12')]);module[_0x80a4('0x13')]=router; \ No newline at end of file +var _0x5634=['express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5634,0xf4));var _0x4563=function(_0x5aed1e,_0x45b4f2){_0x5aed1e=_0x5aed1e-0x0;var _0x51e7a7=_0x5634[_0x5aed1e];return _0x51e7a7;};'use strict';var multer=require('multer');var util=require(_0x4563('0x0'));var path=require(_0x4563('0x1'));var timeout=require(_0x4563('0x2'));var express=require(_0x4563('0x3'));var router=express[_0x4563('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4563('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4563('0x6'));var controller=require(_0x4563('0x7'));router[_0x4563('0x8')]('/',auth[_0x4563('0x9')](),controller[_0x4563('0xa')]);router[_0x4563('0x8')](_0x4563('0xb'),auth[_0x4563('0x9')](),controller[_0x4563('0xc')]);router[_0x4563('0x8')](_0x4563('0xd'),auth[_0x4563('0x9')](),controller[_0x4563('0xe')]);router[_0x4563('0xf')]('/',auth[_0x4563('0x9')](),controller['create']);router[_0x4563('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4563('0x11')]);router[_0x4563('0x12')](_0x4563('0xd'),auth[_0x4563('0x9')](),controller['destroy']);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 5c9542d..f3416a3 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xdaf404,_0x255ee0){var _0x53d93c=function(_0x484c61){while(--_0x484c61){_0xdaf404['push'](_0xdaf404['shift']());}};_0x53d93c(++_0x255ee0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x372129,_0x539547){_0x372129=_0x372129-0x0;var _0x2385b4=_0xf3cd[_0x372129];return _0x2385b4;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xf823d,_0x177494){var _0x282e50=function(_0x3797d7){while(--_0x3797d7){_0xf823d['push'](_0xf823d['shift']());}};_0x282e50(++_0x177494);}(_0xedd9,0xfc));var _0x9edd=function(_0x562202,_0x325483){_0x562202=_0x562202-0x0;var _0x1e322f=_0xedd9[_0x562202];return _0x1e322f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 5827336..fd78c33 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 _0x4f10=['describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy'];(function(_0x5849ec,_0xc175cd){var _0x30b81c=function(_0x5cbd65){while(--_0x5cbd65){_0x5849ec['push'](_0x5849ec['shift']());}};_0x30b81c(++_0xc175cd);}(_0x4f10,0x13d));var _0x04f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4f10[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x04f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04f1('0x2'));var moment=require(_0x04f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x04f1('0x4'));var util=require(_0x04f1('0x5'));var path=require(_0x04f1('0x6'));var sox=require(_0x04f1('0x7'));var csv=require(_0x04f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04f1('0x9'));var _=require(_0x04f1('0xa'));var squel=require(_0x04f1('0xb'));var crypto=require(_0x04f1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x04f1('0xd'));var toCsv=require(_0x04f1('0x8'));var querystring=require(_0x04f1('0xe'));var Papa=require(_0x04f1('0xf'));var Redis=require('ioredis');var authService=require(_0x04f1('0x10'));var qs=require(_0x04f1('0x11'));var as=require(_0x04f1('0x12'));var hardwareService=require(_0x04f1('0x13'));var logger=require(_0x04f1('0x14'))(_0x04f1('0x15'));var utils=require(_0x04f1('0x16'));var config=require(_0x04f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x04f1('0x18'))['db'];function respondWithStatusCode(_0x91493f,_0x50d070){_0x50d070=_0x50d070||0xcc;return function(_0x17c004){if(_0x17c004){return _0x91493f['sendStatus'](_0x50d070);}return _0x91493f['status'](_0x50d070)[_0x04f1('0x19')]();};}function respondWithResult(_0x3e77d1,_0x2f4d58){_0x2f4d58=_0x2f4d58||0xc8;return function(_0x4f60bc){if(_0x4f60bc){return _0x3e77d1[_0x04f1('0x1a')](_0x2f4d58)[_0x04f1('0x1b')](_0x4f60bc);}};}function respondWithFilteredResult(_0x351487,_0x3df477){return function(_0x32b538){if(_0x32b538){var _0x3f264f=typeof _0x3df477[_0x04f1('0x1c')]===_0x04f1('0x1d')&&typeof _0x3df477['limit']===_0x04f1('0x1d');var _0x4d2319=_0x32b538[_0x04f1('0x1e')];var _0x5f048b=_0x3f264f?0x0:_0x3df477['offset'];var _0x2a048c=_0x3f264f?_0x32b538['count']:_0x3df477['offset']+_0x3df477[_0x04f1('0x1f')];var _0x58922e;if(_0x2a048c>=_0x4d2319){_0x2a048c=_0x4d2319;_0x58922e=0xc8;}else{_0x58922e=0xce;}_0x351487[_0x04f1('0x1a')](_0x58922e);return _0x351487[_0x04f1('0x20')](_0x04f1('0x21'),_0x5f048b+'-'+_0x2a048c+'/'+_0x4d2319)[_0x04f1('0x1b')](_0x32b538);}return null;};}function patchUpdates(_0x227ccf){return function(_0x3fa173){try{jsonpatch[_0x04f1('0x22')](_0x3fa173,_0x227ccf,!![]);}catch(_0x52922a){return BPromise[_0x04f1('0x23')](_0x52922a);}return _0x3fa173['save']();};}function saveUpdates(_0x4c1c27,_0x26597f){return function(_0x81881c){if(_0x81881c){return _0x81881c[_0x04f1('0x24')](_0x4c1c27)[_0x04f1('0x25')](function(_0x1a33de){return _0x1a33de;});}return null;};}function removeEntity(_0x418f2d,_0x120643){return function(_0x3938ea){if(_0x3938ea){return _0x3938ea['destroy']()[_0x04f1('0x25')](function(){_0x418f2d[_0x04f1('0x1a')](0xcc)[_0x04f1('0x19')]();});}};}function handleEntityNotFound(_0x27ddf,_0x94c497){return function(_0x1da92a){if(!_0x1da92a){_0x27ddf[_0x04f1('0x26')](0x194);}return _0x1da92a;};}function handleError(_0x371ea0,_0x2d9867){_0x2d9867=_0x2d9867||0x1f4;return function(_0x2d6875){logger[_0x04f1('0x27')](_0x2d6875[_0x04f1('0x28')]);if(_0x2d6875[_0x04f1('0x29')]){delete _0x2d6875['name'];}_0x371ea0[_0x04f1('0x1a')](_0x2d9867)[_0x04f1('0x2a')](_0x2d6875);};}exports['index']=function(_0x5cb7d0,_0x1a38d7){var _0xd6bf01={},_0x4f14a4={},_0x423420={'count':0x0,'rows':[]};var _0x13f268=_[_0x04f1('0x2b')](db[_0x04f1('0x2c')][_0x04f1('0x2d')],function(_0x348a54){return{'name':_0x348a54[_0x04f1('0x2e')],'type':_0x348a54['type'][_0x04f1('0x2f')]};});_0x4f14a4[_0x04f1('0x30')]=_[_0x04f1('0x2b')](_0x13f268,_0x04f1('0x29'));_0x4f14a4[_0x04f1('0x31')]=_[_0x04f1('0x32')](_0x5cb7d0[_0x04f1('0x31')]);_0x4f14a4[_0x04f1('0x33')]=_[_0x04f1('0x34')](_0x4f14a4[_0x04f1('0x30')],_0x4f14a4[_0x04f1('0x31')]);_0xd6bf01[_0x04f1('0x35')]=_['intersection'](_0x4f14a4['model'],qs[_0x04f1('0x36')](_0x5cb7d0[_0x04f1('0x31')][_0x04f1('0x36')]));_0xd6bf01['attributes']=_0xd6bf01['attributes'][_0x04f1('0x37')]?_0xd6bf01[_0x04f1('0x35')]:_0x4f14a4[_0x04f1('0x30')];if(!_0x5cb7d0[_0x04f1('0x31')][_0x04f1('0x38')](_0x04f1('0x39'))){_0xd6bf01[_0x04f1('0x1f')]=qs[_0x04f1('0x1f')](_0x5cb7d0['query'][_0x04f1('0x1f')]);_0xd6bf01[_0x04f1('0x1c')]=qs[_0x04f1('0x1c')](_0x5cb7d0[_0x04f1('0x31')]['offset']);}_0xd6bf01[_0x04f1('0x3a')]=qs['sort'](_0x5cb7d0[_0x04f1('0x31')][_0x04f1('0x3b')]);_0xd6bf01[_0x04f1('0x3c')]=qs[_0x04f1('0x33')](_[_0x04f1('0x3d')](_0x5cb7d0[_0x04f1('0x31')],_0x4f14a4[_0x04f1('0x33')]),_0x13f268);if(_0x5cb7d0[_0x04f1('0x31')][_0x04f1('0x3e')]){_0xd6bf01[_0x04f1('0x3c')]=_[_0x04f1('0x3f')](_0xd6bf01[_0x04f1('0x3c')],{'$or':_[_0x04f1('0x2b')](_0x13f268,function(_0x238abc){if(_0x238abc[_0x04f1('0x40')]!==_0x04f1('0x41')){var _0x74df00={};_0x74df00[_0x238abc['name']]={'$like':'%'+_0x5cb7d0['query'][_0x04f1('0x3e')]+'%'};return _0x74df00;}})});}_0xd6bf01=_[_0x04f1('0x3f')]({},_0xd6bf01,_0x5cb7d0[_0x04f1('0x42')]);var _0x5c0c31={'where':_0xd6bf01[_0x04f1('0x3c')]};return db['FaxTransferReport'][_0x04f1('0x1e')](_0x5c0c31)['then'](function(_0xe95ae8){_0x423420[_0x04f1('0x1e')]=_0xe95ae8;if(_0x5cb7d0[_0x04f1('0x31')][_0x04f1('0x43')]){_0xd6bf01[_0x04f1('0x44')]=[{'all':!![]}];}return db[_0x04f1('0x2c')][_0x04f1('0x45')](_0xd6bf01);})[_0x04f1('0x25')](function(_0x272391){_0x423420[_0x04f1('0x46')]=_0x272391;return _0x423420;})[_0x04f1('0x25')](respondWithFilteredResult(_0x1a38d7,_0xd6bf01))[_0x04f1('0x47')](handleError(_0x1a38d7,null));};exports[_0x04f1('0x48')]=function(_0x57118d,_0x368235){var _0x50152f={'raw':!![],'where':{'id':_0x57118d[_0x04f1('0x49')]['id']}},_0x5be0c5={};_0x5be0c5[_0x04f1('0x30')]=_[_0x04f1('0x32')](db['FaxTransferReport'][_0x04f1('0x2d')]);_0x5be0c5[_0x04f1('0x31')]=_[_0x04f1('0x32')](_0x57118d['query']);_0x5be0c5[_0x04f1('0x33')]=_['intersection'](_0x5be0c5[_0x04f1('0x30')],_0x5be0c5[_0x04f1('0x31')]);_0x50152f[_0x04f1('0x35')]=_[_0x04f1('0x34')](_0x5be0c5['model'],qs[_0x04f1('0x36')](_0x57118d[_0x04f1('0x31')]['fields']));_0x50152f[_0x04f1('0x35')]=_0x50152f[_0x04f1('0x35')]['length']?_0x50152f[_0x04f1('0x35')]:_0x5be0c5[_0x04f1('0x30')];if(_0x57118d[_0x04f1('0x31')]['includeAll']){_0x50152f[_0x04f1('0x44')]=[{'all':!![]}];}_0x50152f=_[_0x04f1('0x3f')]({},_0x50152f,_0x57118d[_0x04f1('0x42')]);return db['FaxTransferReport'][_0x04f1('0x4a')](_0x50152f)[_0x04f1('0x25')](handleEntityNotFound(_0x368235,null))[_0x04f1('0x25')](respondWithResult(_0x368235,null))[_0x04f1('0x47')](handleError(_0x368235,null));};exports[_0x04f1('0x4b')]=function(_0x1870a1,_0x1ca878){return db[_0x04f1('0x2c')][_0x04f1('0x4b')](_0x1870a1['body'],{})[_0x04f1('0x25')](respondWithResult(_0x1ca878,0xc9))[_0x04f1('0x47')](handleError(_0x1ca878,null));};exports[_0x04f1('0x24')]=function(_0xa105d0,_0xde5e02){if(_0xa105d0['body']['id']){delete _0xa105d0[_0x04f1('0x4c')]['id'];}return db['FaxTransferReport'][_0x04f1('0x4a')]({'where':{'id':_0xa105d0['params']['id']}})['then'](handleEntityNotFound(_0xde5e02,null))[_0x04f1('0x25')](saveUpdates(_0xa105d0[_0x04f1('0x4c')],null))[_0x04f1('0x25')](respondWithResult(_0xde5e02,null))['catch'](handleError(_0xde5e02,null));};exports[_0x04f1('0x4d')]=function(_0x440199,_0x4b7f44){return db[_0x04f1('0x2c')]['find']({'where':{'id':_0x440199[_0x04f1('0x49')]['id']}})[_0x04f1('0x25')](handleEntityNotFound(_0x4b7f44,null))[_0x04f1('0x25')](removeEntity(_0x4b7f44,null))['catch'](handleError(_0x4b7f44,null));};exports['describe']=function(_0x122988,_0x15b609){return db[_0x04f1('0x2c')][_0x04f1('0x4e')]()['then'](respondWithResult(_0x15b609,null))[_0x04f1('0x47')](handleError(_0x15b609,null));}; \ No newline at end of file +var _0x9fd0=['../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','sendStatus','stack','name','send','index','FaxTransferReport','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x177b55,_0x36e116){var _0x51b579=function(_0x2832f4){while(--_0x2832f4){_0x177b55['push'](_0x177b55['shift']());}};_0x51b579(++_0x36e116);}(_0x9fd0,0x11d));var _0x09fd=function(_0x8143aa,_0x2bd86d){_0x8143aa=_0x8143aa-0x0;var _0x25924c=_0x9fd0[_0x8143aa];return _0x25924c;};'use strict';var emlformat=require(_0x09fd('0x0'));var rimraf=require(_0x09fd('0x1'));var zipdir=require(_0x09fd('0x2'));var jsonpatch=require(_0x09fd('0x3'));var rp=require('request-promise');var moment=require(_0x09fd('0x4'));var BPromise=require(_0x09fd('0x5'));var Mustache=require(_0x09fd('0x6'));var util=require(_0x09fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x09fd('0x8'));var ejs=require(_0x09fd('0x9'));var fs=require('fs');var fs_extra=require(_0x09fd('0xa'));var _=require(_0x09fd('0xb'));var squel=require(_0x09fd('0xc'));var crypto=require(_0x09fd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x09fd('0xe'));var toCsv=require(_0x09fd('0x8'));var querystring=require(_0x09fd('0xf'));var Papa=require('papaparse');var Redis=require(_0x09fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x09fd('0x11'));var as=require(_0x09fd('0x12'));var hardwareService=require(_0x09fd('0x13'));var logger=require('../../config/logger')(_0x09fd('0x14'));var utils=require(_0x09fd('0x15'));var config=require(_0x09fd('0x16'));var licenseUtil=require(_0x09fd('0x17'));var db=require(_0x09fd('0x18'))['db'];function respondWithStatusCode(_0xc542ca,_0x556e24){_0x556e24=_0x556e24||0xcc;return function(_0x5e9a90){if(_0x5e9a90){return _0xc542ca['sendStatus'](_0x556e24);}return _0xc542ca[_0x09fd('0x19')](_0x556e24)[_0x09fd('0x1a')]();};}function respondWithResult(_0x548379,_0x179e6d){_0x179e6d=_0x179e6d||0xc8;return function(_0x37cf9a){if(_0x37cf9a){return _0x548379[_0x09fd('0x19')](_0x179e6d)[_0x09fd('0x1b')](_0x37cf9a);}};}function respondWithFilteredResult(_0x5f2737,_0x5ea0f0){return function(_0x3759ac){if(_0x3759ac){var _0x350a74=typeof _0x5ea0f0['offset']===_0x09fd('0x1c')&&typeof _0x5ea0f0[_0x09fd('0x1d')]==='undefined';var _0x32f496=_0x3759ac[_0x09fd('0x1e')];var _0x46772c=_0x350a74?0x0:_0x5ea0f0[_0x09fd('0x1f')];var _0x4ef47a=_0x350a74?_0x3759ac[_0x09fd('0x1e')]:_0x5ea0f0[_0x09fd('0x1f')]+_0x5ea0f0[_0x09fd('0x1d')];var _0x187084;if(_0x4ef47a>=_0x32f496){_0x4ef47a=_0x32f496;_0x187084=0xc8;}else{_0x187084=0xce;}_0x5f2737['status'](_0x187084);return _0x5f2737[_0x09fd('0x20')](_0x09fd('0x21'),_0x46772c+'-'+_0x4ef47a+'/'+_0x32f496)[_0x09fd('0x1b')](_0x3759ac);}return null;};}function patchUpdates(_0x465ba9){return function(_0x4535d2){try{jsonpatch['apply'](_0x4535d2,_0x465ba9,!![]);}catch(_0x25692b){return BPromise[_0x09fd('0x22')](_0x25692b);}return _0x4535d2[_0x09fd('0x23')]();};}function saveUpdates(_0x424a46,_0x284ae5){return function(_0x390b7e){if(_0x390b7e){return _0x390b7e['update'](_0x424a46)['then'](function(_0x35f6f1){return _0x35f6f1;});}return null;};}function removeEntity(_0xdf620f,_0x2a53aa){return function(_0xfa0afd){if(_0xfa0afd){return _0xfa0afd[_0x09fd('0x24')]()[_0x09fd('0x25')](function(){_0xdf620f['status'](0xcc)[_0x09fd('0x1a')]();});}};}function handleEntityNotFound(_0x3e01b9,_0x51f97e){return function(_0x2678cd){if(!_0x2678cd){_0x3e01b9[_0x09fd('0x26')](0x194);}return _0x2678cd;};}function handleError(_0xdbeebe,_0x3321d6){_0x3321d6=_0x3321d6||0x1f4;return function(_0x5c42af){logger['error'](_0x5c42af[_0x09fd('0x27')]);if(_0x5c42af['name']){delete _0x5c42af[_0x09fd('0x28')];}_0xdbeebe[_0x09fd('0x19')](_0x3321d6)[_0x09fd('0x29')](_0x5c42af);};}exports[_0x09fd('0x2a')]=function(_0x51180d,_0x3184fc){var _0x3e0fc3={},_0x397531={},_0x28f7fd={'count':0x0,'rows':[]};var _0xd8c7e7=_['map'](db[_0x09fd('0x2b')][_0x09fd('0x2c')],function(_0x3a61f0){return{'name':_0x3a61f0['fieldName'],'type':_0x3a61f0[_0x09fd('0x2d')][_0x09fd('0x2e')]};});_0x397531[_0x09fd('0x2f')]=_[_0x09fd('0x30')](_0xd8c7e7,_0x09fd('0x28'));_0x397531[_0x09fd('0x31')]=_['keys'](_0x51180d[_0x09fd('0x31')]);_0x397531[_0x09fd('0x32')]=_['intersection'](_0x397531[_0x09fd('0x2f')],_0x397531[_0x09fd('0x31')]);_0x3e0fc3['attributes']=_[_0x09fd('0x33')](_0x397531[_0x09fd('0x2f')],qs[_0x09fd('0x34')](_0x51180d[_0x09fd('0x31')][_0x09fd('0x34')]));_0x3e0fc3[_0x09fd('0x35')]=_0x3e0fc3[_0x09fd('0x35')]['length']?_0x3e0fc3['attributes']:_0x397531[_0x09fd('0x2f')];if(!_0x51180d['query'][_0x09fd('0x36')]('nolimit')){_0x3e0fc3[_0x09fd('0x1d')]=qs[_0x09fd('0x1d')](_0x51180d[_0x09fd('0x31')][_0x09fd('0x1d')]);_0x3e0fc3[_0x09fd('0x1f')]=qs[_0x09fd('0x1f')](_0x51180d[_0x09fd('0x31')][_0x09fd('0x1f')]);}_0x3e0fc3[_0x09fd('0x37')]=qs[_0x09fd('0x38')](_0x51180d[_0x09fd('0x31')]['sort']);_0x3e0fc3['where']=qs[_0x09fd('0x32')](_[_0x09fd('0x39')](_0x51180d[_0x09fd('0x31')],_0x397531[_0x09fd('0x32')]),_0xd8c7e7);if(_0x51180d['query'][_0x09fd('0x3a')]){_0x3e0fc3[_0x09fd('0x3b')]=_['merge'](_0x3e0fc3[_0x09fd('0x3b')],{'$or':_['map'](_0xd8c7e7,function(_0x480362){if(_0x480362[_0x09fd('0x2d')]!==_0x09fd('0x3c')){var _0xff2d3a={};_0xff2d3a[_0x480362[_0x09fd('0x28')]]={'$like':'%'+_0x51180d[_0x09fd('0x31')][_0x09fd('0x3a')]+'%'};return _0xff2d3a;}})});}_0x3e0fc3=_[_0x09fd('0x3d')]({},_0x3e0fc3,_0x51180d[_0x09fd('0x3e')]);var _0x4726ed={'where':_0x3e0fc3[_0x09fd('0x3b')]};return db['FaxTransferReport'][_0x09fd('0x1e')](_0x4726ed)[_0x09fd('0x25')](function(_0x2fb371){_0x28f7fd[_0x09fd('0x1e')]=_0x2fb371;if(_0x51180d[_0x09fd('0x31')][_0x09fd('0x3f')]){_0x3e0fc3[_0x09fd('0x40')]=[{'all':!![]}];}return db[_0x09fd('0x2b')][_0x09fd('0x41')](_0x3e0fc3);})[_0x09fd('0x25')](function(_0x1f7944){_0x28f7fd[_0x09fd('0x42')]=_0x1f7944;return _0x28f7fd;})[_0x09fd('0x25')](respondWithFilteredResult(_0x3184fc,_0x3e0fc3))[_0x09fd('0x43')](handleError(_0x3184fc,null));};exports[_0x09fd('0x44')]=function(_0x120fa2,_0xcb4a41){var _0x2fcddc={'raw':!![],'where':{'id':_0x120fa2[_0x09fd('0x45')]['id']}},_0x18df08={};_0x18df08[_0x09fd('0x2f')]=_['keys'](db['FaxTransferReport'][_0x09fd('0x2c')]);_0x18df08[_0x09fd('0x31')]=_[_0x09fd('0x46')](_0x120fa2['query']);_0x18df08[_0x09fd('0x32')]=_['intersection'](_0x18df08[_0x09fd('0x2f')],_0x18df08['query']);_0x2fcddc['attributes']=_[_0x09fd('0x33')](_0x18df08[_0x09fd('0x2f')],qs[_0x09fd('0x34')](_0x120fa2['query'][_0x09fd('0x34')]));_0x2fcddc['attributes']=_0x2fcddc[_0x09fd('0x35')][_0x09fd('0x47')]?_0x2fcddc[_0x09fd('0x35')]:_0x18df08[_0x09fd('0x2f')];if(_0x120fa2[_0x09fd('0x31')][_0x09fd('0x3f')]){_0x2fcddc[_0x09fd('0x40')]=[{'all':!![]}];}_0x2fcddc=_['merge']({},_0x2fcddc,_0x120fa2[_0x09fd('0x3e')]);return db[_0x09fd('0x2b')][_0x09fd('0x48')](_0x2fcddc)[_0x09fd('0x25')](handleEntityNotFound(_0xcb4a41,null))[_0x09fd('0x25')](respondWithResult(_0xcb4a41,null))[_0x09fd('0x43')](handleError(_0xcb4a41,null));};exports[_0x09fd('0x49')]=function(_0x4c518d,_0x1076d0){return db[_0x09fd('0x2b')][_0x09fd('0x49')](_0x4c518d[_0x09fd('0x4a')],{})['then'](respondWithResult(_0x1076d0,0xc9))[_0x09fd('0x43')](handleError(_0x1076d0,null));};exports[_0x09fd('0x4b')]=function(_0x3307a1,_0x3e16f6){if(_0x3307a1[_0x09fd('0x4a')]['id']){delete _0x3307a1[_0x09fd('0x4a')]['id'];}return db[_0x09fd('0x2b')]['find']({'where':{'id':_0x3307a1[_0x09fd('0x45')]['id']}})[_0x09fd('0x25')](handleEntityNotFound(_0x3e16f6,null))[_0x09fd('0x25')](saveUpdates(_0x3307a1[_0x09fd('0x4a')],null))[_0x09fd('0x25')](respondWithResult(_0x3e16f6,null))[_0x09fd('0x43')](handleError(_0x3e16f6,null));};exports[_0x09fd('0x24')]=function(_0x3404bb,_0x6e0f75){return db[_0x09fd('0x2b')][_0x09fd('0x48')]({'where':{'id':_0x3404bb[_0x09fd('0x45')]['id']}})[_0x09fd('0x25')](handleEntityNotFound(_0x6e0f75,null))[_0x09fd('0x25')](removeEntity(_0x6e0f75,null))[_0x09fd('0x43')](handleError(_0x6e0f75,null));};exports[_0x09fd('0x4c')]=function(_0x29682e,_0x450188){return db[_0x09fd('0x2b')][_0x09fd('0x4c')]()[_0x09fd('0x25')](respondWithResult(_0x450188,null))[_0x09fd('0x43')](handleError(_0x450188,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 04c9d64..c31888b 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 _0x2caf=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x4975f2,_0xeb682c){var _0x26bdfd=function(_0x35c309){while(--_0x35c309){_0x4975f2['push'](_0x4975f2['shift']());}};_0x26bdfd(++_0xeb682c);}(_0x2caf,0x10a));var _0xf2ca=function(_0x182dbd,_0x5dec8f){_0x182dbd=_0x182dbd-0x0;var _0x5ab635=_0x2caf[_0x182dbd];return _0x5ab635;};'use strict';var _=require(_0xf2ca('0x0'));var util=require(_0xf2ca('0x1'));var logger=require(_0xf2ca('0x2'))(_0xf2ca('0x3'));var moment=require(_0xf2ca('0x4'));var BPromise=require(_0xf2ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2ca('0x6'));var rimraf=require(_0xf2ca('0x7'));var config=require('../../config/environment');var attributes=require(_0xf2ca('0x8'));module[_0xf2ca('0x9')]=function(_0x318859,_0x5675bc){return _0x318859[_0xf2ca('0xa')](_0xf2ca('0xb'),attributes,{'tableName':_0xf2ca('0xc'),'paranoid':![],'indexes':[{'name':_0xf2ca('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9b2a=['exports','define','report_fax_transfer','lodash','../../config/logger','api','request-promise','path','./faxTransferReport.attributes'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0x9b2a,0x8a));var _0xa9b2=function(_0x270ff3,_0x13751c){_0x270ff3=_0x270ff3-0x0;var _0x220388=_0x9b2a[_0x270ff3];return _0x220388;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var logger=require(_0xa9b2('0x1'))(_0xa9b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9b2('0x3'));var fs=require('fs');var path=require(_0xa9b2('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b2('0x5'));module[_0xa9b2('0x6')]=function(_0x4539ae,_0x56a3f7){return _0x4539ae[_0xa9b2('0x7')]('FaxTransferReport',attributes,{'tableName':_0xa9b2('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 555376f..4f707ed 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 _0xf5e6=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21324c,_0x50878b){var _0x1bd54c=function(_0x27354d){while(--_0x27354d){_0x21324c['push'](_0x21324c['shift']());}};_0x1bd54c(++_0x50878b);}(_0xf5e6,0x191));var _0x6f5e=function(_0x485e5e,_0x1a8c73){_0x485e5e=_0x485e5e-0x0;var _0x344420=_0xf5e6[_0x485e5e];return _0x344420;};'use strict';var _=require(_0x6f5e('0x0'));var util=require(_0x6f5e('0x1'));var moment=require(_0x6f5e('0x2'));var BPromise=require(_0x6f5e('0x3'));var rs=require(_0x6f5e('0x4'));var fs=require('fs');var Redis=require(_0x6f5e('0x5'));var db=require(_0x6f5e('0x6'))['db'];var utils=require(_0x6f5e('0x7'));var logger=require(_0x6f5e('0x8'))(_0x6f5e('0x9'));var config=require('../../config/environment');var jayson=require(_0x6f5e('0xa'));var client=jayson[_0x6f5e('0xb')][_0x6f5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfbb46e,_0x2a33b7,_0x42253c){return new BPromise(function(_0x164ef5,_0x1cb67e){return client['request'](_0xfbb46e,_0x42253c)[_0x6f5e('0xd')](function(_0x5ddac0){logger[_0x6f5e('0xe')](_0x6f5e('0xf'),_0x2a33b7,'request\x20sent');logger[_0x6f5e('0x10')](_0x6f5e('0x11'),_0x2a33b7,_0x6f5e('0x12'),JSON[_0x6f5e('0x13')](_0x5ddac0));if(_0x5ddac0[_0x6f5e('0x14')]){if(_0x5ddac0[_0x6f5e('0x14')][_0x6f5e('0x15')]===0x1f4){logger['error'](_0x6f5e('0xf'),_0x2a33b7,_0x5ddac0['error'][_0x6f5e('0x16')]);return _0x1cb67e(_0x5ddac0['error'][_0x6f5e('0x16')]);}logger['error'](_0x6f5e('0xf'),_0x2a33b7,_0x5ddac0['error'][_0x6f5e('0x16')]);return _0x164ef5(_0x5ddac0[_0x6f5e('0x14')][_0x6f5e('0x16')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2a33b7,_0x6f5e('0x12'));_0x164ef5(_0x5ddac0['result'][_0x6f5e('0x16')]);}})[_0x6f5e('0x17')](function(_0x579aeb){logger[_0x6f5e('0x14')](_0x6f5e('0xf'),_0x2a33b7,_0x579aeb);_0x1cb67e(_0x579aeb);});});} \ No newline at end of file +var _0x73a0=['jayson/promise','client','http','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1ba71b,_0xfa5ab){var _0x386eed=function(_0x380f24){while(--_0x380f24){_0x1ba71b['push'](_0x1ba71b['shift']());}};_0x386eed(++_0xfa5ab);}(_0x73a0,0x118));var _0x073a=function(_0x13e0f0,_0x142ea5){_0x13e0f0=_0x13e0f0-0x0;var _0x107047=_0x73a0[_0x13e0f0];return _0x107047;};'use strict';var _=require(_0x073a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x073a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x073a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x073a('0x3'))(_0x073a('0x4'));var config=require(_0x073a('0x5'));var jayson=require(_0x073a('0x6'));var client=jayson[_0x073a('0x7')][_0x073a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bf023,_0x10f134,_0x557931){return new BPromise(function(_0x3b357f,_0xcd6a57){return client[_0x073a('0x9')](_0x5bf023,_0x557931)[_0x073a('0xa')](function(_0x2c4109){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x10f134,_0x073a('0xb'));logger[_0x073a('0xc')](_0x073a('0xd'),_0x10f134,'request\x20sent',JSON[_0x073a('0xe')](_0x2c4109));if(_0x2c4109[_0x073a('0xf')]){if(_0x2c4109[_0x073a('0xf')][_0x073a('0x10')]===0x1f4){logger['error'](_0x073a('0x11'),_0x10f134,_0x2c4109['error'][_0x073a('0x12')]);return _0xcd6a57(_0x2c4109[_0x073a('0xf')][_0x073a('0x12')]);}logger[_0x073a('0xf')](_0x073a('0x11'),_0x10f134,_0x2c4109['error'][_0x073a('0x12')]);return _0x3b357f(_0x2c4109['error'][_0x073a('0x12')]);}else{logger[_0x073a('0x13')](_0x073a('0x11'),_0x10f134,_0x073a('0xb'));_0x3b357f(_0x2c4109[_0x073a('0x14')]['message']);}})[_0x073a('0x15')](function(_0x51d3a7){logger[_0x073a('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x10f134,_0x51d3a7);_0xcd6a57(_0x51d3a7);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 3dbafb7..43b88ac 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 _0x5066=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update'];(function(_0x275d4b,_0x53a574){var _0x13f34b=function(_0x100ff9){while(--_0x100ff9){_0x275d4b['push'](_0x275d4b['shift']());}};_0x13f34b(++_0x53a574);}(_0x5066,0xbf));var _0x6506=function(_0x390556,_0x5b64bd){_0x390556=_0x390556-0x0;var _0x11868e=_0x5066[_0x390556];return _0x11868e;};'use strict';var multer=require(_0x6506('0x0'));var util=require(_0x6506('0x1'));var path=require(_0x6506('0x2'));var timeout=require(_0x6506('0x3'));var express=require('express');var router=express[_0x6506('0x4')]();var fs_extra=require(_0x6506('0x5'));var auth=require(_0x6506('0x6'));var interaction=require(_0x6506('0x7'));var config=require(_0x6506('0x8'));var controller=require(_0x6506('0x9'));router['get']('/',auth[_0x6506('0xa')](),controller[_0x6506('0xb')]);router[_0x6506('0xc')]('/describe',auth[_0x6506('0xa')](),controller[_0x6506('0xd')]);router[_0x6506('0xc')](_0x6506('0xe'),auth[_0x6506('0xa')](),controller[_0x6506('0xf')]);router[_0x6506('0x10')]('/',auth[_0x6506('0xa')](),controller['create']);router[_0x6506('0x11')](_0x6506('0xe'),auth[_0x6506('0xa')](),controller[_0x6506('0x12')]);router[_0x6506('0x13')]('/:id',auth[_0x6506('0xa')](),controller['destroy']);module[_0x6506('0x14')]=router; \ No newline at end of file +var _0xbe0b=['/:id','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x4947a7,_0x210ba5){var _0x4ec91f=function(_0x5cb999){while(--_0x5cb999){_0x4947a7['push'](_0x4947a7['shift']());}};_0x4ec91f(++_0x210ba5);}(_0xbe0b,0xeb));var _0xbbe0=function(_0x4160d2,_0x30cafa){_0x4160d2=_0x4160d2-0x0;var _0x5841fb=_0xbe0b[_0x4160d2];return _0x5841fb;};'use strict';var multer=require('multer');var util=require(_0xbbe0('0x0'));var path=require(_0xbbe0('0x1'));var timeout=require(_0xbbe0('0x2'));var express=require(_0xbbe0('0x3'));var router=express['Router']();var fs_extra=require(_0xbbe0('0x4'));var auth=require(_0xbbe0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbbe0('0x6'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xbbe0('0x7')](),controller[_0xbbe0('0x8')]);router[_0xbbe0('0x9')](_0xbbe0('0xa'),auth[_0xbbe0('0x7')](),controller[_0xbbe0('0xb')]);router[_0xbbe0('0x9')](_0xbbe0('0xc'),auth[_0xbbe0('0x7')](),controller['show']);router[_0xbbe0('0xd')]('/',auth[_0xbbe0('0x7')](),controller['create']);router[_0xbbe0('0xe')](_0xbbe0('0xc'),auth[_0xbbe0('0x7')](),controller[_0xbbe0('0xf')]);router[_0xbbe0('0x10')](_0xbbe0('0xc'),auth[_0xbbe0('0x7')](),controller[_0xbbe0('0x11')]);module[_0xbbe0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b46783b..9de4e25 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 _0xfbd2=['create','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x352faf,_0x9dd90c){var _0x184db4=function(_0x207715){while(--_0x207715){_0x352faf['push'](_0x352faf['shift']());}};_0x184db4(++_0x9dd90c);}(_0xfbd2,0x1a4));var _0x2fbd=function(_0x272ea6,_0x3f0673){_0x272ea6=_0x272ea6-0x0;var _0x43ef03=_0xfbd2[_0x272ea6];return _0x43ef03;};'use strict';var multer=require('multer');var util=require(_0x2fbd('0x0'));var path=require(_0x2fbd('0x1'));var timeout=require(_0x2fbd('0x2'));var express=require(_0x2fbd('0x3'));var router=express['Router']();var fs_extra=require(_0x2fbd('0x4'));var auth=require(_0x2fbd('0x5'));var interaction=require(_0x2fbd('0x6'));var config=require(_0x2fbd('0x7'));var controller=require(_0x2fbd('0x8'));router[_0x2fbd('0x9')]('/',auth[_0x2fbd('0xa')](),controller[_0x2fbd('0xb')]);router['get'](_0x2fbd('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2fbd('0xd'),auth[_0x2fbd('0xa')](),controller['getConfigurations']);router[_0x2fbd('0x9')](_0x2fbd('0xe'),auth[_0x2fbd('0xa')](),controller[_0x2fbd('0xf')]);router[_0x2fbd('0x10')]('/',auth[_0x2fbd('0xa')](),controller[_0x2fbd('0x11')]);router[_0x2fbd('0x10')](_0x2fbd('0xd'),auth[_0x2fbd('0xa')](),controller[_0x2fbd('0x12')]);router[_0x2fbd('0x13')](_0x2fbd('0xc'),auth[_0x2fbd('0xa')](),controller[_0x2fbd('0x14')]);router[_0x2fbd('0x15')](_0x2fbd('0xc'),auth['isAuthenticated'](),controller[_0x2fbd('0x16')]);module['exports']=router; \ No newline at end of file +var _0x399c=['fs-extra','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','create','/:id/configurations','put','/:id','multer','path','connect-timeout','express','Router'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x399c,0x12d));var _0xc399=function(_0x3ca3a9,_0x55127c){_0x3ca3a9=_0x3ca3a9-0x0;var _0x38ce44=_0x399c[_0x3ca3a9];return _0x38ce44;};'use strict';var multer=require(_0xc399('0x0'));var util=require('util');var path=require(_0xc399('0x1'));var timeout=require(_0xc399('0x2'));var express=require(_0xc399('0x3'));var router=express[_0xc399('0x4')]();var fs_extra=require(_0xc399('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc399('0x6'));var controller=require(_0xc399('0x7'));router[_0xc399('0x8')]('/',auth[_0xc399('0x9')](),controller[_0xc399('0xa')]);router[_0xc399('0x8')]('/:id',auth[_0xc399('0x9')](),controller['show']);router[_0xc399('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xc399('0xb')]);router[_0xc399('0x8')](_0xc399('0xc'),auth['isAuthenticated'](),controller[_0xc399('0xd')]);router['post']('/',auth[_0xc399('0x9')](),controller[_0xc399('0xe')]);router['post'](_0xc399('0xf'),auth[_0xc399('0x9')](),controller['addConfiguration']);router[_0xc399('0x10')](_0xc399('0x11'),auth[_0xc399('0x9')](),controller['update']);router['delete'](_0xc399('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ae7a911..52c9647 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 _0x2dd5=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0xd45112,_0x68c8b4){var _0x2cddb8=function(_0x399d25){while(--_0x399d25){_0xd45112['push'](_0xd45112['shift']());}};_0x2cddb8(++_0x68c8b4);}(_0x2dd5,0x11f));var _0x52dd=function(_0x2e9a7e,_0x2c55a3){_0x2e9a7e=_0x2e9a7e-0x0;var _0x314d05=_0x2dd5[_0x2e9a7e];return _0x314d05;};'use strict';var Sequelize=require('sequelize');module[_0x52dd('0x0')]={'name':{'type':Sequelize[_0x52dd('0x1')]},'description':{'type':Sequelize[_0x52dd('0x1')]},'username':{'type':Sequelize[_0x52dd('0x1')]},'remoteUri':{'type':Sequelize[_0x52dd('0x1')]},'authType':{'type':Sequelize[_0x52dd('0x2')]('basic'),'defaultValue':_0x52dd('0x3')},'password':{'type':Sequelize[_0x52dd('0x1')]},'consumerKey':{'type':Sequelize[_0x52dd('0x1')]},'consumerSecret':{'type':Sequelize[_0x52dd('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x52dd('0x1')]},'serverUrl':{'type':Sequelize[_0x52dd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x52dd('0x4'),_0x52dd('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x84f2=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x5cb6f3,_0x4085bc){var _0x225ffe=function(_0x1f1406){while(--_0x1f1406){_0x5cb6f3['push'](_0x5cb6f3['shift']());}};_0x225ffe(++_0x4085bc);}(_0x84f2,0x14a));var _0x284f=function(_0x260b6f,_0x1edc36){_0x260b6f=_0x260b6f-0x0;var _0x3f672e=_0x84f2[_0x260b6f];return _0x3f672e;};'use strict';var Sequelize=require(_0x284f('0x0'));module[_0x284f('0x1')]={'name':{'type':Sequelize[_0x284f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x284f('0x2')]},'remoteUri':{'type':Sequelize[_0x284f('0x2')]},'authType':{'type':Sequelize[_0x284f('0x3')](_0x284f('0x4')),'defaultValue':_0x284f('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x284f('0x2')]},'consumerSecret':{'type':Sequelize[_0x284f('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x284f('0x2')]},'serverUrl':{'type':Sequelize[_0x284f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x284f('0x3')](_0x284f('0x5'),_0x284f('0x6')),'defaultValue':_0x284f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 59489aa..6f7349c 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 _0xae08=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','DeskAccount','includeAll','rows','catch','show','create','body','find','params','options','getConfigurations','findOne','AccountId','getDescriptions','channel','DeskConfiguration','DeskField','Subjects','Descriptions','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','username','toString','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x5441d0,_0x3bda88){var _0x40db0c=function(_0x33f1ed){while(--_0x33f1ed){_0x5441d0['push'](_0x5441d0['shift']());}};_0x40db0c(++_0x3bda88);}(_0xae08,0x1ad));var _0x8ae0=function(_0x399c83,_0x359c0f){_0x399c83=_0x399c83-0x0;var _0x839476=_0xae08[_0x399c83];return _0x839476;};'use strict';var emlformat=require(_0x8ae0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ae0('0x1'));var jsonpatch=require(_0x8ae0('0x2'));var rp=require(_0x8ae0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8ae0('0x4'));var util=require(_0x8ae0('0x5'));var path=require(_0x8ae0('0x6'));var sox=require(_0x8ae0('0x7'));var csv=require(_0x8ae0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ae0('0x9'));var squel=require(_0x8ae0('0xa'));var crypto=require(_0x8ae0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8ae0('0xc'));var toCsv=require(_0x8ae0('0x8'));var querystring=require(_0x8ae0('0xd'));var Papa=require(_0x8ae0('0xe'));var Redis=require(_0x8ae0('0xf'));var authService=require(_0x8ae0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ae0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ae0('0x12'))(_0x8ae0('0x13'));var utils=require(_0x8ae0('0x14'));var config=require(_0x8ae0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ae0('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e5202,_0x8437e9){_0x8437e9=_0x8437e9||0xcc;return function(_0x304c10){if(_0x304c10){return _0x2e5202[_0x8ae0('0x17')](_0x8437e9);}return _0x2e5202[_0x8ae0('0x18')](_0x8437e9)[_0x8ae0('0x19')]();};}function respondWithResult(_0x2179b4,_0x203e51){_0x203e51=_0x203e51||0xc8;return function(_0x2c3fed){if(_0x2c3fed){return _0x2179b4['status'](_0x203e51)[_0x8ae0('0x1a')](_0x2c3fed);}};}function respondWithFilteredResult(_0x2eaf0b,_0x35d458){return function(_0x4d0724){if(_0x4d0724){var _0x52c704=typeof _0x35d458['offset']===_0x8ae0('0x1b')&&typeof _0x35d458[_0x8ae0('0x1c')]===_0x8ae0('0x1b');var _0x52a170=_0x4d0724['count'];var _0x5af0a7=_0x52c704?0x0:_0x35d458[_0x8ae0('0x1d')];var _0x1f68b1=_0x52c704?_0x4d0724[_0x8ae0('0x1e')]:_0x35d458['offset']+_0x35d458['limit'];var _0x1b0e53;if(_0x1f68b1>=_0x52a170){_0x1f68b1=_0x52a170;_0x1b0e53=0xc8;}else{_0x1b0e53=0xce;}_0x2eaf0b[_0x8ae0('0x18')](_0x1b0e53);return _0x2eaf0b[_0x8ae0('0x1f')](_0x8ae0('0x20'),_0x5af0a7+'-'+_0x1f68b1+'/'+_0x52a170)[_0x8ae0('0x1a')](_0x4d0724);}return null;};}function patchUpdates(_0x283304){return function(_0x5ba58a){try{jsonpatch[_0x8ae0('0x21')](_0x5ba58a,_0x283304,!![]);}catch(_0x3d96d4){return BPromise[_0x8ae0('0x22')](_0x3d96d4);}return _0x5ba58a[_0x8ae0('0x23')]();};}function saveUpdates(_0x526c2c,_0x246fda){return function(_0x3bf29d){if(_0x3bf29d){return _0x3bf29d[_0x8ae0('0x24')](_0x526c2c)[_0x8ae0('0x25')](function(_0x56937b){return _0x56937b;});}return null;};}function removeEntity(_0x1b60ca,_0xf5d2f3){return function(_0x198f02){if(_0x198f02){return _0x198f02['destroy']()[_0x8ae0('0x25')](function(){_0x1b60ca[_0x8ae0('0x18')](0xcc)[_0x8ae0('0x19')]();});}};}function handleEntityNotFound(_0x5a4cf4,_0x3dbd35){return function(_0x2a96ff){if(!_0x2a96ff){_0x5a4cf4[_0x8ae0('0x17')](0x194);}return _0x2a96ff;};}function handleError(_0x593e1b,_0x3b546e){_0x3b546e=_0x3b546e||0x1f4;return function(_0x3b42d1){logger[_0x8ae0('0x26')](_0x3b42d1[_0x8ae0('0x27')]);if(_0x3b42d1['name']){delete _0x3b42d1[_0x8ae0('0x28')];}_0x593e1b['status'](_0x3b546e)[_0x8ae0('0x29')](_0x3b42d1);};}exports[_0x8ae0('0x2a')]=function(_0x2f85d7,_0x1622d2){var _0x164bbf={},_0x3adae3={},_0x59e984={'count':0x0,'rows':[]};var _0x1f941e=_[_0x8ae0('0x2b')](db['DeskAccount'][_0x8ae0('0x2c')],function(_0x500ccc){return{'name':_0x500ccc['fieldName'],'type':_0x500ccc[_0x8ae0('0x2d')][_0x8ae0('0x2e')]};});_0x3adae3[_0x8ae0('0x2f')]=_[_0x8ae0('0x2b')](_0x1f941e,_0x8ae0('0x28'));_0x3adae3[_0x8ae0('0x30')]=_[_0x8ae0('0x31')](_0x2f85d7['query']);_0x3adae3[_0x8ae0('0x32')]=_[_0x8ae0('0x33')](_0x3adae3[_0x8ae0('0x2f')],_0x3adae3['query']);_0x164bbf[_0x8ae0('0x34')]=_[_0x8ae0('0x33')](_0x3adae3[_0x8ae0('0x2f')],qs[_0x8ae0('0x35')](_0x2f85d7[_0x8ae0('0x30')][_0x8ae0('0x35')]));_0x164bbf[_0x8ae0('0x34')]=_0x164bbf[_0x8ae0('0x34')][_0x8ae0('0x36')]?_0x164bbf['attributes']:_0x3adae3[_0x8ae0('0x2f')];if(!_0x2f85d7['query'][_0x8ae0('0x37')](_0x8ae0('0x38'))){_0x164bbf[_0x8ae0('0x1c')]=qs[_0x8ae0('0x1c')](_0x2f85d7['query'][_0x8ae0('0x1c')]);_0x164bbf[_0x8ae0('0x1d')]=qs[_0x8ae0('0x1d')](_0x2f85d7[_0x8ae0('0x30')][_0x8ae0('0x1d')]);}_0x164bbf[_0x8ae0('0x39')]=qs[_0x8ae0('0x3a')](_0x2f85d7['query'][_0x8ae0('0x3a')]);_0x164bbf[_0x8ae0('0x3b')]=qs['filters'](_[_0x8ae0('0x3c')](_0x2f85d7[_0x8ae0('0x30')],_0x3adae3[_0x8ae0('0x32')]),_0x1f941e);if(_0x2f85d7[_0x8ae0('0x30')]['filter']){_0x164bbf[_0x8ae0('0x3b')]=_[_0x8ae0('0x3d')](_0x164bbf['where'],{'$or':_[_0x8ae0('0x2b')](_0x1f941e,function(_0x50722e){if(_0x50722e[_0x8ae0('0x2d')]!==_0x8ae0('0x3e')){var _0x26935e={};_0x26935e[_0x50722e[_0x8ae0('0x28')]]={'$like':'%'+_0x2f85d7[_0x8ae0('0x30')][_0x8ae0('0x3f')]+'%'};return _0x26935e;}})});}_0x164bbf=_['merge']({},_0x164bbf,_0x2f85d7['options']);var _0x4dbd15={'where':_0x164bbf['where']};return db[_0x8ae0('0x40')]['count'](_0x4dbd15)[_0x8ae0('0x25')](function(_0x160809){_0x59e984[_0x8ae0('0x1e')]=_0x160809;if(_0x2f85d7['query'][_0x8ae0('0x41')]){_0x164bbf['include']=[{'all':!![]}];}return db[_0x8ae0('0x40')]['findAll'](_0x164bbf);})[_0x8ae0('0x25')](function(_0x3a3861){_0x59e984[_0x8ae0('0x42')]=_0x3a3861;return _0x59e984;})[_0x8ae0('0x25')](respondWithFilteredResult(_0x1622d2,_0x164bbf))[_0x8ae0('0x43')](handleError(_0x1622d2,null));};exports[_0x8ae0('0x44')]=function(_0x15a8b2,_0x1e12c8){var _0x985ae7={'raw':![],'where':{'id':_0x15a8b2['params']['id']}},_0x598a54={};_0x598a54['model']=_[_0x8ae0('0x31')](db['DeskAccount'][_0x8ae0('0x2c')]);_0x598a54[_0x8ae0('0x30')]=_[_0x8ae0('0x31')](_0x15a8b2[_0x8ae0('0x30')]);_0x598a54[_0x8ae0('0x32')]=_[_0x8ae0('0x33')](_0x598a54['model'],_0x598a54[_0x8ae0('0x30')]);_0x985ae7[_0x8ae0('0x34')]=_[_0x8ae0('0x33')](_0x598a54[_0x8ae0('0x2f')],qs['fields'](_0x15a8b2['query']['fields']));_0x985ae7[_0x8ae0('0x34')]=_0x985ae7[_0x8ae0('0x34')][_0x8ae0('0x36')]?_0x985ae7[_0x8ae0('0x34')]:_0x598a54[_0x8ae0('0x2f')];if(_0x15a8b2[_0x8ae0('0x30')]['includeAll']){_0x985ae7['include']=[{'all':!![]}];}_0x985ae7=_['merge']({},_0x985ae7,_0x15a8b2['options']);return db[_0x8ae0('0x40')]['find'](_0x985ae7)['then'](handleEntityNotFound(_0x1e12c8,null))[_0x8ae0('0x25')](respondWithResult(_0x1e12c8,null))['catch'](handleError(_0x1e12c8,null));};exports[_0x8ae0('0x45')]=function(_0x3b3bef,_0x1c58fd){return db['DeskAccount'][_0x8ae0('0x45')](_0x3b3bef[_0x8ae0('0x46')],{})[_0x8ae0('0x25')](respondWithResult(_0x1c58fd,0xc9))[_0x8ae0('0x43')](handleError(_0x1c58fd,null));};exports[_0x8ae0('0x24')]=function(_0x1538d9,_0x2c141d){if(_0x1538d9[_0x8ae0('0x46')]['id']){delete _0x1538d9['body']['id'];}return db['DeskAccount'][_0x8ae0('0x47')]({'where':{'id':_0x1538d9[_0x8ae0('0x48')]['id']}})[_0x8ae0('0x25')](handleEntityNotFound(_0x2c141d,null))[_0x8ae0('0x25')](saveUpdates(_0x1538d9['body'],null))[_0x8ae0('0x25')](respondWithResult(_0x2c141d,null))[_0x8ae0('0x43')](handleError(_0x2c141d,null));};exports['destroy']=function(_0xf62002,_0x4826ad){return db[_0x8ae0('0x40')][_0x8ae0('0x47')]({'where':{'id':_0xf62002['params']['id']}})[_0x8ae0('0x25')](handleEntityNotFound(_0x4826ad,null))[_0x8ae0('0x25')](removeEntity(_0x4826ad,null))[_0x8ae0('0x43')](handleError(_0x4826ad,null));};exports['getConfigurations']=function(_0x6ed5ed,_0x21d15d,_0x1eea12){var _0x4bed4c={};var _0x23860e={};var _0x27b7e0;var _0x51db29;return db[_0x8ae0('0x40')]['findOne']({'where':{'id':_0x6ed5ed[_0x8ae0('0x48')]['id']}})[_0x8ae0('0x25')](handleEntityNotFound(_0x21d15d,null))[_0x8ae0('0x25')](function(_0x4bec8d){if(_0x4bec8d){_0x27b7e0=_0x4bec8d;_0x23860e[_0x8ae0('0x2f')]=_[_0x8ae0('0x31')](db['DeskConfiguration']['rawAttributes']);_0x23860e['query']=_['keys'](_0x6ed5ed[_0x8ae0('0x30')]);_0x23860e[_0x8ae0('0x32')]=_['intersection'](_0x23860e[_0x8ae0('0x2f')],_0x23860e[_0x8ae0('0x30')]);_0x4bed4c['attributes']=_[_0x8ae0('0x33')](_0x23860e[_0x8ae0('0x2f')],qs[_0x8ae0('0x35')](_0x6ed5ed[_0x8ae0('0x30')][_0x8ae0('0x35')]));_0x4bed4c[_0x8ae0('0x34')]=_0x4bed4c[_0x8ae0('0x34')][_0x8ae0('0x36')]?_0x4bed4c['attributes']:_0x23860e[_0x8ae0('0x2f')];_0x4bed4c[_0x8ae0('0x39')]=qs['sort'](_0x6ed5ed[_0x8ae0('0x30')][_0x8ae0('0x3a')]);_0x4bed4c[_0x8ae0('0x3b')]=qs[_0x8ae0('0x32')](_['pick'](_0x6ed5ed[_0x8ae0('0x30')],_0x23860e[_0x8ae0('0x32')]));if(_0x6ed5ed['query'][_0x8ae0('0x3f')]){_0x4bed4c[_0x8ae0('0x3b')]=_[_0x8ae0('0x3d')](_0x4bed4c[_0x8ae0('0x3b')],{'$or':_[_0x8ae0('0x2b')](_0x4bed4c[_0x8ae0('0x34')],function(_0x5218ec){var _0x18eba6={};_0x18eba6[_0x5218ec]={'$like':'%'+_0x6ed5ed[_0x8ae0('0x30')][_0x8ae0('0x3f')]+'%'};return _0x18eba6;})});}_0x4bed4c=_[_0x8ae0('0x3d')]({},_0x4bed4c,_0x6ed5ed[_0x8ae0('0x49')]);return _0x27b7e0[_0x8ae0('0x4a')](_0x4bed4c);}})[_0x8ae0('0x25')](function(_0x490334){if(_0x490334){_0x51db29=_0x490334[_0x8ae0('0x36')];if(!_0x6ed5ed[_0x8ae0('0x30')][_0x8ae0('0x37')](_0x8ae0('0x38'))){_0x4bed4c[_0x8ae0('0x1c')]=qs[_0x8ae0('0x1c')](_0x6ed5ed[_0x8ae0('0x30')]['limit']);_0x4bed4c[_0x8ae0('0x1d')]=qs[_0x8ae0('0x1d')](_0x6ed5ed['query']['offset']);}return _0x27b7e0[_0x8ae0('0x4a')](_0x4bed4c);}})['then'](function(_0x1bed41){if(_0x1bed41){return _0x1bed41?{'count':_0x51db29,'rows':_0x1bed41}:null;}})[_0x8ae0('0x25')](respondWithResult(_0x21d15d,null))[_0x8ae0('0x43')](handleError(_0x21d15d,null));};exports['addConfiguration']=function(_0x3e8903,_0x402f47,_0x51ed49){if(_0x3e8903['body']['id']){delete _0x3e8903[_0x8ae0('0x46')]['id'];}return db[_0x8ae0('0x40')][_0x8ae0('0x4b')]({'where':{'id':_0x3e8903['params']['id']}})[_0x8ae0('0x25')](handleEntityNotFound(_0x402f47,null))[_0x8ae0('0x25')](function(_0x2b5ce0){if(_0x2b5ce0){_0x3e8903[_0x8ae0('0x46')][_0x8ae0('0x4c')]=_0x2b5ce0['id'];_0x3e8903[_0x8ae0('0x46')]['Subjects']=integrations['getSubjects'](_0x3e8903[_0x8ae0('0x46')]['channel'],_0x3e8903[_0x8ae0('0x46')][_0x8ae0('0x2d')]);_0x3e8903[_0x8ae0('0x46')]['Descriptions']=integrations[_0x8ae0('0x4d')](_0x3e8903[_0x8ae0('0x46')][_0x8ae0('0x4e')],_0x3e8903['body']['type']);return db[_0x8ae0('0x4f')][_0x8ae0('0x45')](_0x3e8903[_0x8ae0('0x46')],{'include':[{'model':db[_0x8ae0('0x50')],'as':_0x8ae0('0x51')},{'model':db[_0x8ae0('0x50')],'as':_0x8ae0('0x52')}]});}return null;})[_0x8ae0('0x25')](respondWithResult(_0x402f47,null))[_0x8ae0('0x43')](handleError(_0x402f47,null));};exports[_0x8ae0('0x53')]=function(_0x3027b1,_0x399a80,_0x4f4011){var _0x507607=[{'name':_0x8ae0('0x54'),'label':_0x8ae0('0x54'),'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 _0x32db48='';return db[_0x8ae0('0x40')]['findOne']({'where':{'id':_0x3027b1['params']['id']},'attributes':['id',_0x8ae0('0x55'),_0x8ae0('0x56'),'username',_0x8ae0('0x57'),_0x8ae0('0x58'),_0x8ae0('0x59'),_0x8ae0('0x5a'),_0x8ae0('0x5b')]})[_0x8ae0('0x25')](handleEntityNotFound(_0x399a80,null))[_0x8ae0('0x25')](function(_0x16ba67){if(_0x16ba67){_0x32db48=_0x16ba67[_0x8ae0('0x55')];var _0x2be1a2=_0x32db48['slice'](-0x1);if(_0x2be1a2==='/'){_0x32db48=_0x32db48['substring'](0x0,_0x32db48[_0x8ae0('0x5c')](_0x2be1a2));}var _0x89fae1={'method':'GET','uri':util[_0x8ae0('0x5d')](_0x8ae0('0x5e'),_0x32db48),'headers':{'Content-Type':_0x8ae0('0x5f'),'Accept':_0x8ae0('0x5f')},'json':!![]};if(_0x16ba67[_0x8ae0('0x56')]===_0x8ae0('0x60')){_0x89fae1[_0x8ae0('0x61')][_0x8ae0('0x62')]=util['format']('Basic\x20%s',new Buffer(util[_0x8ae0('0x5d')]('%s:%s',_0x16ba67[_0x8ae0('0x63')],_0x16ba67[_0x8ae0('0x57')]))[_0x8ae0('0x64')](_0x8ae0('0x65')));}return rp(_0x89fae1)['then'](function(_0x55d415){return _0x507607[_0x8ae0('0x66')](_[_0x8ae0('0x2b')](_0x55d415[_0x8ae0('0x67')][_0x8ae0('0x68')],function(_0x1ca7a4){return{'id':_0x1ca7a4[_0x8ae0('0x28')],'name':_0x1ca7a4['name'],'type':_0x1ca7a4['type'],'active':_0x1ca7a4['active'],'label':_0x1ca7a4[_0x8ae0('0x69')],'custom':!![]};}));});}})['then'](function(_0x3fc675){return{'count':_0x3fc675[_0x8ae0('0x36')],'rows':_0x3fc675};})[_0x8ae0('0x25')](respondWithResult(_0x399a80,null))[_0x8ae0('0x43')](function(_0x2b2c0f){var _0x311d31=_0x3027b1['query'][_0x8ae0('0x6a')]?0x1f4:_0x2b2c0f[_0x8ae0('0x6b')]||0x1f4;logger['error'](_0x8ae0('0x6c'),_0x8ae0('0x53'),_0x311d31,JSON['stringify'](_0x2b2c0f));delete _0x2b2c0f[_0x8ae0('0x28')];if(_0x311d31===0x191){_0x311d31=0x190;}_0x399a80[_0x8ae0('0x18')](_0x311d31)[_0x8ae0('0x29')](_0x3027b1['query'][_0x8ae0('0x6a')]?{'message':_0x8ae0('0x6d'),'statusCode':_0x2b2c0f[_0x8ae0('0x6b')]}:_0x2b2c0f);});}; \ No newline at end of file +var _0xd5d8=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','DeskAccount','findAll','rows','params','includeAll','find','create','body','catch','getConfigurations','findOne','DeskConfiguration','AccountId','getSubjects','channel','Descriptions','getFields','priority','authType','username','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','application/json','basic','Basic\x20%s','%s:%s','password','toString','concat','_embedded','entries','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','model','keys','query'];(function(_0x3588b9,_0x287026){var _0x316d56=function(_0x5086d3){while(--_0x5086d3){_0x3588b9['push'](_0x3588b9['shift']());}};_0x316d56(++_0x287026);}(_0xd5d8,0x11f));var _0x8d5d=function(_0xba1147,_0x19d76a){_0xba1147=_0xba1147-0x0;var _0x42147e=_0xd5d8[_0xba1147];return _0x42147e;};'use strict';var emlformat=require(_0x8d5d('0x0'));var rimraf=require(_0x8d5d('0x1'));var zipdir=require(_0x8d5d('0x2'));var jsonpatch=require(_0x8d5d('0x3'));var rp=require(_0x8d5d('0x4'));var moment=require(_0x8d5d('0x5'));var BPromise=require(_0x8d5d('0x6'));var Mustache=require(_0x8d5d('0x7'));var util=require('util');var path=require(_0x8d5d('0x8'));var sox=require(_0x8d5d('0x9'));var csv=require(_0x8d5d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d5d('0xb'));var _=require(_0x8d5d('0xc'));var squel=require(_0x8d5d('0xd'));var crypto=require(_0x8d5d('0xe'));var jsforce=require(_0x8d5d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8d5d('0xa'));var querystring=require(_0x8d5d('0x10'));var Papa=require(_0x8d5d('0x11'));var Redis=require(_0x8d5d('0x12'));var authService=require(_0x8d5d('0x13'));var qs=require(_0x8d5d('0x14'));var as=require(_0x8d5d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d5d('0x16'))(_0x8d5d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d5d('0x18'))['db'];var integrations=require(_0x8d5d('0x19'));function respondWithStatusCode(_0x41b1d8,_0x2654b9){_0x2654b9=_0x2654b9||0xcc;return function(_0x169e1e){if(_0x169e1e){return _0x41b1d8[_0x8d5d('0x1a')](_0x2654b9);}return _0x41b1d8[_0x8d5d('0x1b')](_0x2654b9)[_0x8d5d('0x1c')]();};}function respondWithResult(_0x1a85f3,_0x362ee4){_0x362ee4=_0x362ee4||0xc8;return function(_0x3bfd8d){if(_0x3bfd8d){return _0x1a85f3['status'](_0x362ee4)['json'](_0x3bfd8d);}};}function respondWithFilteredResult(_0x239463,_0x195c1c){return function(_0xd75c40){if(_0xd75c40){var _0xb34d2b=typeof _0x195c1c['offset']==='undefined'&&typeof _0x195c1c[_0x8d5d('0x1d')]===_0x8d5d('0x1e');var _0x9fedac=_0xd75c40[_0x8d5d('0x1f')];var _0x319bee=_0xb34d2b?0x0:_0x195c1c[_0x8d5d('0x20')];var _0xe7ee30=_0xb34d2b?_0xd75c40[_0x8d5d('0x1f')]:_0x195c1c[_0x8d5d('0x20')]+_0x195c1c[_0x8d5d('0x1d')];var _0x47c6da;if(_0xe7ee30>=_0x9fedac){_0xe7ee30=_0x9fedac;_0x47c6da=0xc8;}else{_0x47c6da=0xce;}_0x239463[_0x8d5d('0x1b')](_0x47c6da);return _0x239463[_0x8d5d('0x21')]('Content-Range',_0x319bee+'-'+_0xe7ee30+'/'+_0x9fedac)[_0x8d5d('0x22')](_0xd75c40);}return null;};}function patchUpdates(_0xdbedc9){return function(_0x20bf5c){try{jsonpatch[_0x8d5d('0x23')](_0x20bf5c,_0xdbedc9,!![]);}catch(_0x4e4811){return BPromise[_0x8d5d('0x24')](_0x4e4811);}return _0x20bf5c[_0x8d5d('0x25')]();};}function saveUpdates(_0x769b71,_0x3bb4bb){return function(_0x1c470f){if(_0x1c470f){return _0x1c470f[_0x8d5d('0x26')](_0x769b71)[_0x8d5d('0x27')](function(_0x3cc7f1){return _0x3cc7f1;});}return null;};}function removeEntity(_0x5dfc6a,_0x30d210){return function(_0x3e99b5){if(_0x3e99b5){return _0x3e99b5[_0x8d5d('0x28')]()[_0x8d5d('0x27')](function(){_0x5dfc6a[_0x8d5d('0x1b')](0xcc)[_0x8d5d('0x1c')]();});}};}function handleEntityNotFound(_0x560b69,_0x24cab4){return function(_0x3be129){if(!_0x3be129){_0x560b69[_0x8d5d('0x1a')](0x194);}return _0x3be129;};}function handleError(_0x18ac71,_0x164c6a){_0x164c6a=_0x164c6a||0x1f4;return function(_0x74cf20){logger['error'](_0x74cf20['stack']);if(_0x74cf20[_0x8d5d('0x29')]){delete _0x74cf20[_0x8d5d('0x29')];}_0x18ac71[_0x8d5d('0x1b')](_0x164c6a)['send'](_0x74cf20);};}exports[_0x8d5d('0x2a')]=function(_0xdd5ed2,_0x58e169){var _0x412d38={},_0x303931={},_0x140fd2={'count':0x0,'rows':[]};var _0x2c7651=_[_0x8d5d('0x2b')](db['DeskAccount'][_0x8d5d('0x2c')],function(_0x4a7d83){return{'name':_0x4a7d83[_0x8d5d('0x2d')],'type':_0x4a7d83['type']['key']};});_0x303931[_0x8d5d('0x2e')]=_['map'](_0x2c7651,'name');_0x303931['query']=_[_0x8d5d('0x2f')](_0xdd5ed2[_0x8d5d('0x30')]);_0x303931['filters']=_[_0x8d5d('0x31')](_0x303931[_0x8d5d('0x2e')],_0x303931['query']);_0x412d38[_0x8d5d('0x32')]=_[_0x8d5d('0x31')](_0x303931['model'],qs[_0x8d5d('0x33')](_0xdd5ed2[_0x8d5d('0x30')]['fields']));_0x412d38[_0x8d5d('0x32')]=_0x412d38[_0x8d5d('0x32')][_0x8d5d('0x34')]?_0x412d38[_0x8d5d('0x32')]:_0x303931['model'];if(!_0xdd5ed2['query'][_0x8d5d('0x35')](_0x8d5d('0x36'))){_0x412d38['limit']=qs[_0x8d5d('0x1d')](_0xdd5ed2[_0x8d5d('0x30')][_0x8d5d('0x1d')]);_0x412d38['offset']=qs[_0x8d5d('0x20')](_0xdd5ed2[_0x8d5d('0x30')]['offset']);}_0x412d38[_0x8d5d('0x37')]=qs[_0x8d5d('0x38')](_0xdd5ed2[_0x8d5d('0x30')][_0x8d5d('0x38')]);_0x412d38[_0x8d5d('0x39')]=qs[_0x8d5d('0x3a')](_[_0x8d5d('0x3b')](_0xdd5ed2[_0x8d5d('0x30')],_0x303931[_0x8d5d('0x3a')]),_0x2c7651);if(_0xdd5ed2[_0x8d5d('0x30')][_0x8d5d('0x3c')]){_0x412d38[_0x8d5d('0x39')]=_[_0x8d5d('0x3d')](_0x412d38[_0x8d5d('0x39')],{'$or':_[_0x8d5d('0x2b')](_0x2c7651,function(_0x540468){if(_0x540468[_0x8d5d('0x3e')]!==_0x8d5d('0x3f')){var _0x39aba0={};_0x39aba0[_0x540468[_0x8d5d('0x29')]]={'$like':'%'+_0xdd5ed2[_0x8d5d('0x30')][_0x8d5d('0x3c')]+'%'};return _0x39aba0;}})});}_0x412d38=_[_0x8d5d('0x3d')]({},_0x412d38,_0xdd5ed2[_0x8d5d('0x40')]);var _0x89d333={'where':_0x412d38['where']};return db['DeskAccount'][_0x8d5d('0x1f')](_0x89d333)[_0x8d5d('0x27')](function(_0x3284bd){_0x140fd2[_0x8d5d('0x1f')]=_0x3284bd;if(_0xdd5ed2['query']['includeAll']){_0x412d38[_0x8d5d('0x41')]=[{'all':!![]}];}return db[_0x8d5d('0x42')][_0x8d5d('0x43')](_0x412d38);})[_0x8d5d('0x27')](function(_0x774af6){_0x140fd2[_0x8d5d('0x44')]=_0x774af6;return _0x140fd2;})[_0x8d5d('0x27')](respondWithFilteredResult(_0x58e169,_0x412d38))['catch'](handleError(_0x58e169,null));};exports['show']=function(_0x3e4352,_0x27ab39){var _0x3fd54b={'raw':![],'where':{'id':_0x3e4352[_0x8d5d('0x45')]['id']}},_0xe54e17={};_0xe54e17[_0x8d5d('0x2e')]=_['keys'](db['DeskAccount']['rawAttributes']);_0xe54e17[_0x8d5d('0x30')]=_[_0x8d5d('0x2f')](_0x3e4352['query']);_0xe54e17[_0x8d5d('0x3a')]=_[_0x8d5d('0x31')](_0xe54e17['model'],_0xe54e17[_0x8d5d('0x30')]);_0x3fd54b[_0x8d5d('0x32')]=_[_0x8d5d('0x31')](_0xe54e17[_0x8d5d('0x2e')],qs[_0x8d5d('0x33')](_0x3e4352[_0x8d5d('0x30')][_0x8d5d('0x33')]));_0x3fd54b[_0x8d5d('0x32')]=_0x3fd54b['attributes']['length']?_0x3fd54b['attributes']:_0xe54e17[_0x8d5d('0x2e')];if(_0x3e4352[_0x8d5d('0x30')][_0x8d5d('0x46')]){_0x3fd54b[_0x8d5d('0x41')]=[{'all':!![]}];}_0x3fd54b=_['merge']({},_0x3fd54b,_0x3e4352[_0x8d5d('0x40')]);return db[_0x8d5d('0x42')][_0x8d5d('0x47')](_0x3fd54b)[_0x8d5d('0x27')](handleEntityNotFound(_0x27ab39,null))[_0x8d5d('0x27')](respondWithResult(_0x27ab39,null))['catch'](handleError(_0x27ab39,null));};exports['create']=function(_0x4e3603,_0x329254){return db[_0x8d5d('0x42')][_0x8d5d('0x48')](_0x4e3603[_0x8d5d('0x49')],{})[_0x8d5d('0x27')](respondWithResult(_0x329254,0xc9))['catch'](handleError(_0x329254,null));};exports['update']=function(_0x13f0c6,_0x1ef99d){if(_0x13f0c6[_0x8d5d('0x49')]['id']){delete _0x13f0c6[_0x8d5d('0x49')]['id'];}return db['DeskAccount'][_0x8d5d('0x47')]({'where':{'id':_0x13f0c6[_0x8d5d('0x45')]['id']}})[_0x8d5d('0x27')](handleEntityNotFound(_0x1ef99d,null))[_0x8d5d('0x27')](saveUpdates(_0x13f0c6[_0x8d5d('0x49')],null))[_0x8d5d('0x27')](respondWithResult(_0x1ef99d,null))[_0x8d5d('0x4a')](handleError(_0x1ef99d,null));};exports[_0x8d5d('0x28')]=function(_0x4230df,_0x5b8f75){return db[_0x8d5d('0x42')][_0x8d5d('0x47')]({'where':{'id':_0x4230df['params']['id']}})[_0x8d5d('0x27')](handleEntityNotFound(_0x5b8f75,null))['then'](removeEntity(_0x5b8f75,null))['catch'](handleError(_0x5b8f75,null));};exports[_0x8d5d('0x4b')]=function(_0x2dc38d,_0x108876,_0x27cb93){var _0x3ce70e={};var _0x13f20d={};var _0x62db37;var _0x482b78;return db[_0x8d5d('0x42')][_0x8d5d('0x4c')]({'where':{'id':_0x2dc38d[_0x8d5d('0x45')]['id']}})['then'](handleEntityNotFound(_0x108876,null))[_0x8d5d('0x27')](function(_0x252db4){if(_0x252db4){_0x62db37=_0x252db4;_0x13f20d[_0x8d5d('0x2e')]=_[_0x8d5d('0x2f')](db[_0x8d5d('0x4d')][_0x8d5d('0x2c')]);_0x13f20d[_0x8d5d('0x30')]=_['keys'](_0x2dc38d[_0x8d5d('0x30')]);_0x13f20d['filters']=_[_0x8d5d('0x31')](_0x13f20d['model'],_0x13f20d[_0x8d5d('0x30')]);_0x3ce70e['attributes']=_[_0x8d5d('0x31')](_0x13f20d[_0x8d5d('0x2e')],qs[_0x8d5d('0x33')](_0x2dc38d[_0x8d5d('0x30')][_0x8d5d('0x33')]));_0x3ce70e['attributes']=_0x3ce70e[_0x8d5d('0x32')][_0x8d5d('0x34')]?_0x3ce70e[_0x8d5d('0x32')]:_0x13f20d[_0x8d5d('0x2e')];_0x3ce70e[_0x8d5d('0x37')]=qs[_0x8d5d('0x38')](_0x2dc38d[_0x8d5d('0x30')]['sort']);_0x3ce70e[_0x8d5d('0x39')]=qs['filters'](_[_0x8d5d('0x3b')](_0x2dc38d[_0x8d5d('0x30')],_0x13f20d[_0x8d5d('0x3a')]));if(_0x2dc38d['query'][_0x8d5d('0x3c')]){_0x3ce70e[_0x8d5d('0x39')]=_[_0x8d5d('0x3d')](_0x3ce70e[_0x8d5d('0x39')],{'$or':_[_0x8d5d('0x2b')](_0x3ce70e[_0x8d5d('0x32')],function(_0x4c8ba4){var _0x428481={};_0x428481[_0x4c8ba4]={'$like':'%'+_0x2dc38d[_0x8d5d('0x30')][_0x8d5d('0x3c')]+'%'};return _0x428481;})});}_0x3ce70e=_['merge']({},_0x3ce70e,_0x2dc38d['options']);return _0x62db37[_0x8d5d('0x4b')](_0x3ce70e);}})[_0x8d5d('0x27')](function(_0x280adb){if(_0x280adb){_0x482b78=_0x280adb['length'];if(!_0x2dc38d[_0x8d5d('0x30')]['hasOwnProperty']('nolimit')){_0x3ce70e[_0x8d5d('0x1d')]=qs[_0x8d5d('0x1d')](_0x2dc38d[_0x8d5d('0x30')][_0x8d5d('0x1d')]);_0x3ce70e[_0x8d5d('0x20')]=qs[_0x8d5d('0x20')](_0x2dc38d[_0x8d5d('0x30')][_0x8d5d('0x20')]);}return _0x62db37[_0x8d5d('0x4b')](_0x3ce70e);}})[_0x8d5d('0x27')](function(_0x52e715){if(_0x52e715){return _0x52e715?{'count':_0x482b78,'rows':_0x52e715}:null;}})[_0x8d5d('0x27')](respondWithResult(_0x108876,null))['catch'](handleError(_0x108876,null));};exports['addConfiguration']=function(_0x4c447c,_0x4e1a74,_0x8fcf64){if(_0x4c447c[_0x8d5d('0x49')]['id']){delete _0x4c447c[_0x8d5d('0x49')]['id'];}return db['DeskAccount'][_0x8d5d('0x4c')]({'where':{'id':_0x4c447c['params']['id']}})[_0x8d5d('0x27')](handleEntityNotFound(_0x4e1a74,null))[_0x8d5d('0x27')](function(_0x4fc7b8){if(_0x4fc7b8){_0x4c447c[_0x8d5d('0x49')][_0x8d5d('0x4e')]=_0x4fc7b8['id'];_0x4c447c['body']['Subjects']=integrations[_0x8d5d('0x4f')](_0x4c447c[_0x8d5d('0x49')][_0x8d5d('0x50')],_0x4c447c['body']['type']);_0x4c447c[_0x8d5d('0x49')]['Descriptions']=integrations['getDescriptions'](_0x4c447c[_0x8d5d('0x49')][_0x8d5d('0x50')],_0x4c447c[_0x8d5d('0x49')][_0x8d5d('0x3e')]);return db['DeskConfiguration'][_0x8d5d('0x48')](_0x4c447c[_0x8d5d('0x49')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0x8d5d('0x51')}]});}return null;})[_0x8d5d('0x27')](respondWithResult(_0x4e1a74,null))[_0x8d5d('0x4a')](handleError(_0x4e1a74,null));};exports[_0x8d5d('0x52')]=function(_0x48c4e9,_0x491c2e,_0x2dc6d9){var _0x321268=[{'name':_0x8d5d('0x53'),'label':_0x8d5d('0x53'),'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 _0x4f8882='';return db[_0x8d5d('0x42')]['findOne']({'where':{'id':_0x48c4e9['params']['id']},'attributes':['id','remoteUri',_0x8d5d('0x54'),_0x8d5d('0x55'),'password',_0x8d5d('0x56'),_0x8d5d('0x57'),_0x8d5d('0x58'),_0x8d5d('0x59')]})[_0x8d5d('0x27')](handleEntityNotFound(_0x491c2e,null))['then'](function(_0x2901fb){if(_0x2901fb){_0x4f8882=_0x2901fb[_0x8d5d('0x5a')];var _0xc8f4b7=_0x4f8882[_0x8d5d('0x5b')](-0x1);if(_0xc8f4b7==='/'){_0x4f8882=_0x4f8882[_0x8d5d('0x5c')](0x0,_0x4f8882[_0x8d5d('0x5d')](_0xc8f4b7));}var _0x2f15fc={'method':'GET','uri':util[_0x8d5d('0x5e')]('%s/custom_fields',_0x4f8882),'headers':{'Content-Type':'application/json','Accept':_0x8d5d('0x5f')},'json':!![]};if(_0x2901fb['authType']===_0x8d5d('0x60')){_0x2f15fc['headers']['Authorization']=util['format'](_0x8d5d('0x61'),new Buffer(util[_0x8d5d('0x5e')](_0x8d5d('0x62'),_0x2901fb[_0x8d5d('0x55')],_0x2901fb[_0x8d5d('0x63')]))[_0x8d5d('0x64')]('base64'));}return rp(_0x2f15fc)[_0x8d5d('0x27')](function(_0x3e936d){return _0x321268[_0x8d5d('0x65')](_[_0x8d5d('0x2b')](_0x3e936d[_0x8d5d('0x66')][_0x8d5d('0x67')],function(_0x21fdcb){return{'id':_0x21fdcb[_0x8d5d('0x29')],'name':_0x21fdcb[_0x8d5d('0x29')],'type':_0x21fdcb[_0x8d5d('0x3e')],'active':_0x21fdcb[_0x8d5d('0x68')],'label':_0x21fdcb['label'],'custom':!![]};}));});}})[_0x8d5d('0x27')](function(_0x50ab06){return{'count':_0x50ab06[_0x8d5d('0x34')],'rows':_0x50ab06};})[_0x8d5d('0x27')](respondWithResult(_0x491c2e,null))[_0x8d5d('0x4a')](function(_0x8905ee){var _0x4f61d8=_0x48c4e9[_0x8d5d('0x30')][_0x8d5d('0x69')]?0x1f4:_0x8905ee['statusCode']||0x1f4;logger[_0x8d5d('0x6a')](_0x8d5d('0x6b'),_0x8d5d('0x52'),_0x4f61d8,JSON[_0x8d5d('0x6c')](_0x8905ee));delete _0x8905ee[_0x8d5d('0x29')];if(_0x4f61d8===0x191){_0x4f61d8=0x190;}_0x491c2e['status'](_0x4f61d8)[_0x8d5d('0x6d')](_0x48c4e9[_0x8d5d('0x30')][_0x8d5d('0x69')]?{'message':_0x8d5d('0x6e'),'statusCode':_0x8905ee[_0x8d5d('0x6f')]}:_0x8905ee);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 51389a6..eae0a5e 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 _0xddec=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x324d02,_0x6d9c0b){var _0x3d4f59=function(_0x279f6b){while(--_0x279f6b){_0x324d02['push'](_0x324d02['shift']());}};_0x3d4f59(++_0x6d9c0b);}(_0xddec,0x18f));var _0xcdde=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xddec[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xcdde('0x0'));var util=require(_0xcdde('0x1'));var logger=require('../../config/logger')(_0xcdde('0x2'));var moment=require(_0xcdde('0x3'));var BPromise=require(_0xcdde('0x4'));var rp=require(_0xcdde('0x5'));var fs=require('fs');var path=require(_0xcdde('0x6'));var rimraf=require(_0xcdde('0x7'));var config=require(_0xcdde('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xcdde('0x9'));module[_0xcdde('0xa')]=function(_0x27e572,_0x4ad87d){return _0x27e572[_0xcdde('0xb')](_0xcdde('0xc'),attributes,{'tableName':_0xcdde('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08a4=['moment','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','../../config/logger'];(function(_0xf7e687,_0x2159a6){var _0x2a37d8=function(_0x35011a){while(--_0x35011a){_0xf7e687['push'](_0xf7e687['shift']());}};_0x2a37d8(++_0x2159a6);}(_0x08a4,0xdb));var _0x408a=function(_0x68af18,_0x58cabf){_0x68af18=_0x68af18-0x0;var _0x58414b=_0x08a4[_0x68af18];return _0x58414b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x408a('0x0'))('api');var moment=require(_0x408a('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x408a('0x2'));var rimraf=require(_0x408a('0x3'));var config=require('../../config/environment');var attributes=require(_0x408a('0x4'));var integrations=require(_0x408a('0x5'));module[_0x408a('0x6')]=function(_0x2764d4,_0xb0fb81){return _0x2764d4[_0x408a('0x7')](_0x408a('0x8'),attributes,{'tableName':_0x408a('0x9'),'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 dc8ba09..aaf4567 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 _0x9474=['limit','include','model','attributes','map','ShowDeskAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','raw','options','where'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x9474,0x103));var _0x4947=function(_0x404eff,_0x4ef653){_0x404eff=_0x404eff-0x0;var _0x46cc25=_0x9474[_0x404eff];return _0x46cc25;};'use strict';var _=require('lodash');var util=require(_0x4947('0x0'));var moment=require(_0x4947('0x1'));var BPromise=require(_0x4947('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4947('0x3'));var db=require(_0x4947('0x4'))['db'];var utils=require(_0x4947('0x5'));var logger=require(_0x4947('0x6'))('rpc');var config=require(_0x4947('0x7'));var jayson=require(_0x4947('0x8'));var client=jayson[_0x4947('0x9')][_0x4947('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ccc70,_0x154cc3,_0x5b8be1){return new BPromise(function(_0x463d5a,_0x1e3879){return client[_0x4947('0xb')](_0x5ccc70,_0x5b8be1)[_0x4947('0xc')](function(_0x22ac7b){logger[_0x4947('0xd')]('DeskAccount,\x20%s,\x20%s',_0x154cc3,_0x4947('0xe'));logger[_0x4947('0xf')](_0x4947('0x10'),_0x154cc3,_0x4947('0xe'),JSON[_0x4947('0x11')](_0x22ac7b));if(_0x22ac7b[_0x4947('0x12')]){if(_0x22ac7b[_0x4947('0x12')]['code']===0x1f4){logger[_0x4947('0x12')](_0x4947('0x13'),_0x154cc3,_0x22ac7b[_0x4947('0x12')][_0x4947('0x14')]);return _0x1e3879(_0x22ac7b[_0x4947('0x12')][_0x4947('0x14')]);}logger[_0x4947('0x12')](_0x4947('0x13'),_0x154cc3,_0x22ac7b[_0x4947('0x12')][_0x4947('0x14')]);return _0x463d5a(_0x22ac7b[_0x4947('0x12')][_0x4947('0x14')]);}else{logger[_0x4947('0xd')](_0x4947('0x13'),_0x154cc3,_0x4947('0xe'));_0x463d5a(_0x22ac7b[_0x4947('0x15')][_0x4947('0x14')]);}})[_0x4947('0x16')](function(_0x507ea5){logger[_0x4947('0x12')]('DeskAccount,\x20%s,\x20%s',_0x154cc3,_0x507ea5);_0x1e3879(_0x507ea5);});});}exports[_0x4947('0x17')]=function(_0x2cc9f5){var _0x50fa73=this;return new Promise(function(_0x11c824,_0x34dcd7){return db[_0x4947('0x18')][_0x4947('0x19')]({'raw':_0x2cc9f5['options']?_0x2cc9f5['options'][_0x4947('0x1a')]===undefined?!![]:![]:!![],'where':_0x2cc9f5[_0x4947('0x1b')]?_0x2cc9f5[_0x4947('0x1b')][_0x4947('0x1c')]||null:null,'attributes':_0x2cc9f5[_0x4947('0x1b')]?_0x2cc9f5[_0x4947('0x1b')]['attributes']||null:null,'limit':_0x2cc9f5[_0x4947('0x1b')]?_0x2cc9f5['options'][_0x4947('0x1d')]||null:null,'include':_0x2cc9f5[_0x4947('0x1b')]?_0x2cc9f5[_0x4947('0x1b')][_0x4947('0x1e')]?_['map'](_0x2cc9f5[_0x4947('0x1b')][_0x4947('0x1e')],function(_0x4f4dd7){return{'model':db[_0x4f4dd7[_0x4947('0x1f')]],'as':_0x4f4dd7['as'],'attributes':_0x4f4dd7[_0x4947('0x20')],'include':_0x4f4dd7['include']?_[_0x4947('0x21')](_0x4f4dd7[_0x4947('0x1e')],function(_0x4b14ca){return{'model':db[_0x4b14ca[_0x4947('0x1f')]],'as':_0x4b14ca['as'],'attributes':_0x4b14ca[_0x4947('0x20')],'include':_0x4b14ca['include']?_['map'](_0x4b14ca[_0x4947('0x1e')],function(_0x6a008a){return{'model':db[_0x6a008a[_0x4947('0x1f')]],'as':_0x6a008a['as'],'attributes':_0x6a008a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe1568e){logger[_0x4947('0xd')](_0x4947('0x17'),_0x2cc9f5);logger[_0x4947('0xf')](_0x4947('0x17'),_0x2cc9f5,JSON[_0x4947('0x11')](_0xe1568e));_0x11c824(_0xe1568e);})[_0x4947('0x16')](function(_0xa22083){logger['error'](_0x4947('0x17'),_0xa22083[_0x4947('0x14')],_0x2cc9f5);_0x34dcd7(_0x50fa73['error'](0x1f4,_0xa22083[_0x4947('0x14')]));});});};exports[_0x4947('0x22')]=function(_0x87efae){var _0x1b5c27=this;return new Promise(function(_0x4be722,_0x407ffa){return db[_0x4947('0x18')][_0x4947('0x23')]({'raw':_0x87efae['options']?_0x87efae[_0x4947('0x1b')][_0x4947('0x1a')]===undefined?!![]:![]:!![],'where':_0x87efae[_0x4947('0x1b')]?_0x87efae[_0x4947('0x1b')][_0x4947('0x1c')]||null:null,'attributes':_0x87efae[_0x4947('0x1b')]?_0x87efae['options']['attributes']||null:null,'include':_0x87efae['options']?_0x87efae[_0x4947('0x1b')][_0x4947('0x1e')]?_['map'](_0x87efae['options'][_0x4947('0x1e')],function(_0x42d776){return{'model':db[_0x42d776[_0x4947('0x1f')]],'as':_0x42d776['as'],'attributes':_0x42d776[_0x4947('0x20')],'include':_0x42d776['include']?_[_0x4947('0x21')](_0x42d776['include'],function(_0x3429bb){return{'model':db[_0x3429bb[_0x4947('0x1f')]],'as':_0x3429bb['as'],'attributes':_0x3429bb[_0x4947('0x20')],'include':_0x3429bb['include']?_[_0x4947('0x21')](_0x3429bb['include'],function(_0x21e307){return{'model':db[_0x21e307[_0x4947('0x1f')]],'as':_0x21e307['as'],'attributes':_0x21e307['attributes']};}):[]};}):[]};}):[]:[]})[_0x4947('0xc')](function(_0x38fe74){logger['info'](_0x4947('0x22'),_0x87efae);logger[_0x4947('0xf')](_0x4947('0x22'),_0x87efae,JSON[_0x4947('0x11')](_0x38fe74));_0x4be722(_0x38fe74);})[_0x4947('0x16')](function(_0x34251c){logger[_0x4947('0x12')](_0x4947('0x22'),_0x34251c[_0x4947('0x14')],_0x87efae);_0x407ffa(_0x1b5c27[_0x4947('0x12')](0x1f4,_0x34251c[_0x4947('0x14')]));});});}; \ No newline at end of file +var _0x9779=['DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetDeskAccount','options','raw','where','attributes','map','include','model','DeskAccount','find','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x62276f,_0x57685b){var _0x6af9e1=function(_0x3d586c){while(--_0x3d586c){_0x62276f['push'](_0x62276f['shift']());}};_0x6af9e1(++_0x57685b);}(_0x9779,0x1d9));var _0x9977=function(_0x5f4768,_0x4f9443){_0x5f4768=_0x5f4768-0x0;var _0x20a5d5=_0x9779[_0x5f4768];return _0x20a5d5;};'use strict';var _=require('lodash');var util=require(_0x9977('0x0'));var moment=require(_0x9977('0x1'));var BPromise=require(_0x9977('0x2'));var rs=require(_0x9977('0x3'));var fs=require('fs');var Redis=require(_0x9977('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9977('0x5'));var logger=require(_0x9977('0x6'))(_0x9977('0x7'));var config=require(_0x9977('0x8'));var jayson=require(_0x9977('0x9'));var client=jayson[_0x9977('0xa')][_0x9977('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492804,_0x4fc845,_0x1188e6){return new BPromise(function(_0x1f464c,_0x184979){return client[_0x9977('0xc')](_0x492804,_0x1188e6)[_0x9977('0xd')](function(_0x4494a0){logger['info'](_0x9977('0xe'),_0x4fc845,_0x9977('0xf'));logger[_0x9977('0x10')](_0x9977('0x11'),_0x4fc845,_0x9977('0xf'),JSON[_0x9977('0x12')](_0x4494a0));if(_0x4494a0['error']){if(_0x4494a0[_0x9977('0x13')][_0x9977('0x14')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x4fc845,_0x4494a0['error']['message']);return _0x184979(_0x4494a0['error'][_0x9977('0x15')]);}logger['error'](_0x9977('0xe'),_0x4fc845,_0x4494a0['error'][_0x9977('0x15')]);return _0x1f464c(_0x4494a0[_0x9977('0x13')][_0x9977('0x15')]);}else{logger[_0x9977('0x16')](_0x9977('0xe'),_0x4fc845,_0x9977('0xf'));_0x1f464c(_0x4494a0['result'][_0x9977('0x15')]);}})[_0x9977('0x17')](function(_0x1ace76){logger[_0x9977('0x13')](_0x9977('0xe'),_0x4fc845,_0x1ace76);_0x184979(_0x1ace76);});});}exports[_0x9977('0x18')]=function(_0x18b0b4){var _0x3b5884=this;return new Promise(function(_0x2aadcc,_0x450a63){return db['DeskAccount']['findAll']({'raw':_0x18b0b4['options']?_0x18b0b4[_0x9977('0x19')][_0x9977('0x1a')]===undefined?!![]:![]:!![],'where':_0x18b0b4[_0x9977('0x19')]?_0x18b0b4[_0x9977('0x19')][_0x9977('0x1b')]||null:null,'attributes':_0x18b0b4[_0x9977('0x19')]?_0x18b0b4[_0x9977('0x19')][_0x9977('0x1c')]||null:null,'limit':_0x18b0b4[_0x9977('0x19')]?_0x18b0b4[_0x9977('0x19')]['limit']||null:null,'include':_0x18b0b4[_0x9977('0x19')]?_0x18b0b4[_0x9977('0x19')]['include']?_[_0x9977('0x1d')](_0x18b0b4[_0x9977('0x19')][_0x9977('0x1e')],function(_0x2974b8){return{'model':db[_0x2974b8[_0x9977('0x1f')]],'as':_0x2974b8['as'],'attributes':_0x2974b8[_0x9977('0x1c')],'include':_0x2974b8['include']?_[_0x9977('0x1d')](_0x2974b8['include'],function(_0x49f614){return{'model':db[_0x49f614[_0x9977('0x1f')]],'as':_0x49f614['as'],'attributes':_0x49f614['attributes'],'include':_0x49f614[_0x9977('0x1e')]?_['map'](_0x49f614[_0x9977('0x1e')],function(_0x3889d3){return{'model':db[_0x3889d3[_0x9977('0x1f')]],'as':_0x3889d3['as'],'attributes':_0x3889d3[_0x9977('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b9fb){logger['info'](_0x9977('0x18'),_0x18b0b4);logger[_0x9977('0x10')](_0x9977('0x18'),_0x18b0b4,JSON['stringify'](_0x53b9fb));_0x2aadcc(_0x53b9fb);})['catch'](function(_0x5a4d8c){logger['error'](_0x9977('0x18'),_0x5a4d8c[_0x9977('0x15')],_0x18b0b4);_0x450a63(_0x3b5884[_0x9977('0x13')](0x1f4,_0x5a4d8c[_0x9977('0x15')]));});});};exports['ShowDeskAccount']=function(_0x4ffcae){var _0x45b796=this;return new Promise(function(_0x1f62f1,_0x35ee02){return db[_0x9977('0x20')][_0x9977('0x21')]({'raw':_0x4ffcae['options']?_0x4ffcae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ffcae['options']?_0x4ffcae['options'][_0x9977('0x1b')]||null:null,'attributes':_0x4ffcae[_0x9977('0x19')]?_0x4ffcae[_0x9977('0x19')][_0x9977('0x1c')]||null:null,'include':_0x4ffcae[_0x9977('0x19')]?_0x4ffcae[_0x9977('0x19')]['include']?_[_0x9977('0x1d')](_0x4ffcae[_0x9977('0x19')]['include'],function(_0x14af61){return{'model':db[_0x14af61[_0x9977('0x1f')]],'as':_0x14af61['as'],'attributes':_0x14af61[_0x9977('0x1c')],'include':_0x14af61[_0x9977('0x1e')]?_[_0x9977('0x1d')](_0x14af61[_0x9977('0x1e')],function(_0x2a72e8){return{'model':db[_0x2a72e8[_0x9977('0x1f')]],'as':_0x2a72e8['as'],'attributes':_0x2a72e8[_0x9977('0x1c')],'include':_0x2a72e8[_0x9977('0x1e')]?_[_0x9977('0x1d')](_0x2a72e8[_0x9977('0x1e')],function(_0x5b9ff8){return{'model':db[_0x5b9ff8[_0x9977('0x1f')]],'as':_0x5b9ff8['as'],'attributes':_0x5b9ff8[_0x9977('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9977('0xd')](function(_0x36e0b1){logger[_0x9977('0x16')](_0x9977('0x22'),_0x4ffcae);logger[_0x9977('0x10')](_0x9977('0x22'),_0x4ffcae,JSON[_0x9977('0x12')](_0x36e0b1));_0x1f62f1(_0x36e0b1);})['catch'](function(_0x287014){logger[_0x9977('0x13')](_0x9977('0x22'),_0x287014[_0x9977('0x15')],_0x4ffcae);_0x35ee02(_0x45b796[_0x9977('0x13')](0x1f4,_0x287014[_0x9977('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 2277c9c..1da4004 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(_0x39418a,_0x4a474b){var _0x2be20d=function(_0x497350){while(--_0x497350){_0x39418a['push'](_0x39418a['shift']());}};_0x2be20d(++_0x4a474b);}(_0x34e8,0x12c));var _0x834e=function(_0x4e3b21,_0x2222ad){_0x4e3b21=_0x4e3b21-0x0;var _0x11c72f=_0x34e8[_0x4e3b21];return _0x11c72f;};'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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x4c7c47,_0x386c06){var _0x5b9df4=function(_0x1dddb8){while(--_0x1dddb8){_0x4c7c47['push'](_0x4c7c47['shift']());}};_0x5b9df4(++_0x386c06);}(_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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ebcf4b5..c223ae9 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 _0xd194=['sequelize','exports','STRING'];(function(_0x2e57f9,_0x3ef15c){var _0xd23db7=function(_0x1c58ec){while(--_0x1c58ec){_0x2e57f9['push'](_0x2e57f9['shift']());}};_0xd23db7(++_0x3ef15c);}(_0xd194,0x168));var _0x4d19=function(_0x44812e,_0x2d2e5e){_0x44812e=_0x44812e-0x0;var _0x3978a5=_0xd194[_0x44812e];return _0x3978a5;};'use strict';var Sequelize=require(_0x4d19('0x0'));module[_0x4d19('0x1')]={'name':{'type':Sequelize[_0x4d19('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdcab=['sequelize','exports'];(function(_0x2f705e,_0x3864c8){var _0x4ee780=function(_0x3d0008){while(--_0x3d0008){_0x2f705e['push'](_0x2f705e['shift']());}};_0x4ee780(++_0x3864c8);}(_0xdcab,0x174));var _0xbdca=function(_0xda770a,_0x5c8e8f){_0xda770a=_0xda770a-0x0;var _0x1607b8=_0xdcab[_0xda770a];return _0x1607b8;};'use strict';var Sequelize=require(_0xbdca('0x0'));module[_0xbdca('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 39dbd38..e64d4dd 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 _0x3fe3=['count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','length','hasOwnProperty','nolimit','limit','sort','filters','merge','where','VIRTUAL','filter','includeAll','include','catch','show','params','keys','fields','options','find','create','body','destroy','getFields','DeskField','order','findOne','pick','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','util','ejs','fs-extra','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','status','offset','undefined'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0x3fe3,0xe4));var _0x33fe=function(_0x1b9e76,_0x5a30b2){_0x1b9e76=_0x1b9e76-0x0;var _0x4a222d=_0x3fe3[_0x1b9e76];return _0x4a222d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33fe('0x0'));var zipdir=require(_0x33fe('0x1'));var jsonpatch=require(_0x33fe('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33fe('0x3'));var Mustache=require('mustache');var util=require(_0x33fe('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x33fe('0x5'));var fs=require('fs');var fs_extra=require(_0x33fe('0x6'));var _=require(_0x33fe('0x7'));var squel=require(_0x33fe('0x8'));var crypto=require(_0x33fe('0x9'));var jsforce=require(_0x33fe('0xa'));var deskjs=require(_0x33fe('0xb'));var toCsv=require(_0x33fe('0xc'));var querystring=require(_0x33fe('0xd'));var Papa=require(_0x33fe('0xe'));var Redis=require(_0x33fe('0xf'));var authService=require(_0x33fe('0x10'));var qs=require(_0x33fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33fe('0x12'));var logger=require(_0x33fe('0x13'))('api');var utils=require(_0x33fe('0x14'));var config=require(_0x33fe('0x15'));var licenseUtil=require(_0x33fe('0x16'));var db=require(_0x33fe('0x17'))['db'];function respondWithStatusCode(_0x5e44f5,_0x14f132){_0x14f132=_0x14f132||0xcc;return function(_0x561b50){if(_0x561b50){return _0x5e44f5['sendStatus'](_0x14f132);}return _0x5e44f5[_0x33fe('0x18')](_0x14f132)['end']();};}function respondWithResult(_0x519634,_0x59bb64){_0x59bb64=_0x59bb64||0xc8;return function(_0x175638){if(_0x175638){return _0x519634[_0x33fe('0x18')](_0x59bb64)['json'](_0x175638);}};}function respondWithFilteredResult(_0x2c5083,_0x1aae06){return function(_0xe61aa){if(_0xe61aa){var _0x39a9df=typeof _0x1aae06[_0x33fe('0x19')]===_0x33fe('0x1a')&&typeof _0x1aae06['limit']===_0x33fe('0x1a');var _0x59b05f=_0xe61aa[_0x33fe('0x1b')];var _0x454500=_0x39a9df?0x0:_0x1aae06['offset'];var _0x13a233=_0x39a9df?_0xe61aa[_0x33fe('0x1b')]:_0x1aae06[_0x33fe('0x19')]+_0x1aae06['limit'];var _0x39706d;if(_0x13a233>=_0x59b05f){_0x13a233=_0x59b05f;_0x39706d=0xc8;}else{_0x39706d=0xce;}_0x2c5083['status'](_0x39706d);return _0x2c5083[_0x33fe('0x1c')](_0x33fe('0x1d'),_0x454500+'-'+_0x13a233+'/'+_0x59b05f)[_0x33fe('0x1e')](_0xe61aa);}return null;};}function patchUpdates(_0x4c3494){return function(_0x4c7021){try{jsonpatch[_0x33fe('0x1f')](_0x4c7021,_0x4c3494,!![]);}catch(_0x3f1e24){return BPromise[_0x33fe('0x20')](_0x3f1e24);}return _0x4c7021[_0x33fe('0x21')]();};}function saveUpdates(_0x5d650d,_0x561ce6){return function(_0x38e1dc){if(_0x38e1dc){return _0x38e1dc[_0x33fe('0x22')](_0x5d650d)[_0x33fe('0x23')](function(_0x3ad71b){return _0x3ad71b;});}return null;};}function removeEntity(_0x197487,_0x313645){return function(_0x14c713){if(_0x14c713){return _0x14c713['destroy']()['then'](function(){_0x197487[_0x33fe('0x18')](0xcc)[_0x33fe('0x24')]();});}};}function handleEntityNotFound(_0x30364c,_0x54a1dd){return function(_0x4e6c6c){if(!_0x4e6c6c){_0x30364c[_0x33fe('0x25')](0x194);}return _0x4e6c6c;};}function handleError(_0x4fce39,_0x4327d7){_0x4327d7=_0x4327d7||0x1f4;return function(_0x416b2b){logger[_0x33fe('0x26')](_0x416b2b[_0x33fe('0x27')]);if(_0x416b2b['name']){delete _0x416b2b[_0x33fe('0x28')];}_0x4fce39[_0x33fe('0x18')](_0x4327d7)[_0x33fe('0x29')](_0x416b2b);};}exports[_0x33fe('0x2a')]=function(_0x365c43,_0x22e1e6){var _0x1891f0={},_0x3b0b34={},_0x432df2={'count':0x0,'rows':[]};var _0x176dfa=_['map'](db[_0x33fe('0x2b')][_0x33fe('0x2c')],function(_0x54637f){return{'name':_0x54637f[_0x33fe('0x2d')],'type':_0x54637f[_0x33fe('0x2e')][_0x33fe('0x2f')]};});_0x3b0b34[_0x33fe('0x30')]=_[_0x33fe('0x31')](_0x176dfa,_0x33fe('0x28'));_0x3b0b34[_0x33fe('0x32')]=_['keys'](_0x365c43[_0x33fe('0x32')]);_0x3b0b34['filters']=_['intersection'](_0x3b0b34[_0x33fe('0x30')],_0x3b0b34[_0x33fe('0x32')]);_0x1891f0[_0x33fe('0x33')]=_[_0x33fe('0x34')](_0x3b0b34['model'],qs['fields'](_0x365c43[_0x33fe('0x32')]['fields']));_0x1891f0[_0x33fe('0x33')]=_0x1891f0[_0x33fe('0x33')][_0x33fe('0x35')]?_0x1891f0[_0x33fe('0x33')]:_0x3b0b34[_0x33fe('0x30')];if(!_0x365c43[_0x33fe('0x32')][_0x33fe('0x36')](_0x33fe('0x37'))){_0x1891f0['limit']=qs[_0x33fe('0x38')](_0x365c43[_0x33fe('0x32')][_0x33fe('0x38')]);_0x1891f0[_0x33fe('0x19')]=qs[_0x33fe('0x19')](_0x365c43['query']['offset']);}_0x1891f0['order']=qs[_0x33fe('0x39')](_0x365c43[_0x33fe('0x32')]['sort']);_0x1891f0['where']=qs[_0x33fe('0x3a')](_['pick'](_0x365c43[_0x33fe('0x32')],_0x3b0b34['filters']),_0x176dfa);if(_0x365c43[_0x33fe('0x32')]['filter']){_0x1891f0['where']=_[_0x33fe('0x3b')](_0x1891f0[_0x33fe('0x3c')],{'$or':_['map'](_0x176dfa,function(_0x26c8ee){if(_0x26c8ee['type']!==_0x33fe('0x3d')){var _0x437f70={};_0x437f70[_0x26c8ee[_0x33fe('0x28')]]={'$like':'%'+_0x365c43[_0x33fe('0x32')][_0x33fe('0x3e')]+'%'};return _0x437f70;}})});}_0x1891f0=_[_0x33fe('0x3b')]({},_0x1891f0,_0x365c43['options']);var _0x3a283b={'where':_0x1891f0['where']};return db[_0x33fe('0x2b')][_0x33fe('0x1b')](_0x3a283b)[_0x33fe('0x23')](function(_0x153702){_0x432df2[_0x33fe('0x1b')]=_0x153702;if(_0x365c43[_0x33fe('0x32')][_0x33fe('0x3f')]){_0x1891f0[_0x33fe('0x40')]=[{'all':!![]}];}return db[_0x33fe('0x2b')]['findAll'](_0x1891f0);})[_0x33fe('0x23')](function(_0x4187bb){_0x432df2['rows']=_0x4187bb;return _0x432df2;})[_0x33fe('0x23')](respondWithFilteredResult(_0x22e1e6,_0x1891f0))[_0x33fe('0x41')](handleError(_0x22e1e6,null));};exports[_0x33fe('0x42')]=function(_0x49c232,_0x47b9c0){var _0x4c59b3={'raw':![],'where':{'id':_0x49c232[_0x33fe('0x43')]['id']}},_0xff032b={};_0xff032b['model']=_[_0x33fe('0x44')](db['DeskConfiguration'][_0x33fe('0x2c')]);_0xff032b[_0x33fe('0x32')]=_['keys'](_0x49c232[_0x33fe('0x32')]);_0xff032b[_0x33fe('0x3a')]=_[_0x33fe('0x34')](_0xff032b['model'],_0xff032b[_0x33fe('0x32')]);_0x4c59b3['attributes']=_[_0x33fe('0x34')](_0xff032b[_0x33fe('0x30')],qs['fields'](_0x49c232['query'][_0x33fe('0x45')]));_0x4c59b3[_0x33fe('0x33')]=_0x4c59b3[_0x33fe('0x33')][_0x33fe('0x35')]?_0x4c59b3[_0x33fe('0x33')]:_0xff032b['model'];if(_0x49c232[_0x33fe('0x32')]['includeAll']){_0x4c59b3[_0x33fe('0x40')]=[{'all':!![]}];}_0x4c59b3=_[_0x33fe('0x3b')]({},_0x4c59b3,_0x49c232[_0x33fe('0x46')]);return db[_0x33fe('0x2b')][_0x33fe('0x47')](_0x4c59b3)['then'](handleEntityNotFound(_0x47b9c0,null))[_0x33fe('0x23')](respondWithResult(_0x47b9c0,null))[_0x33fe('0x41')](handleError(_0x47b9c0,null));};exports[_0x33fe('0x48')]=function(_0x162f3d,_0x1904d8){return db['DeskConfiguration'][_0x33fe('0x48')](_0x162f3d['body'],{})[_0x33fe('0x23')](respondWithResult(_0x1904d8,0xc9))[_0x33fe('0x41')](handleError(_0x1904d8,null));};exports['update']=function(_0xb7347d,_0x44aa0e){if(_0xb7347d[_0x33fe('0x49')]['id']){delete _0xb7347d['body']['id'];}return db[_0x33fe('0x2b')][_0x33fe('0x47')]({'where':{'id':_0xb7347d[_0x33fe('0x43')]['id']}})[_0x33fe('0x23')](handleEntityNotFound(_0x44aa0e,null))[_0x33fe('0x23')](saveUpdates(_0xb7347d[_0x33fe('0x49')],null))['then'](respondWithResult(_0x44aa0e,null))['catch'](handleError(_0x44aa0e,null));};exports[_0x33fe('0x4a')]=function(_0x9e89d2,_0x366999){return db['DeskConfiguration'][_0x33fe('0x47')]({'where':{'id':_0x9e89d2[_0x33fe('0x43')]['id']}})[_0x33fe('0x23')](handleEntityNotFound(_0x366999,null))['then'](removeEntity(_0x366999,null))[_0x33fe('0x41')](handleError(_0x366999,null));};exports[_0x33fe('0x4b')]=function(_0x2e2e09,_0x3d8a77,_0x4cab90){var _0x5edff5={};var _0x2bacfd={};var _0x5878fb;var _0x7101d1;return db[_0x33fe('0x2b')]['findOne']({'where':{'id':_0x2e2e09[_0x33fe('0x43')]['id']}})[_0x33fe('0x23')](handleEntityNotFound(_0x3d8a77,null))[_0x33fe('0x23')](function(_0x11ab65){if(_0x11ab65){_0x5878fb=_0x11ab65;_0x2bacfd[_0x33fe('0x30')]=_[_0x33fe('0x44')](db[_0x33fe('0x4c')][_0x33fe('0x2c')]);_0x2bacfd['query']=_[_0x33fe('0x44')](_0x2e2e09[_0x33fe('0x32')]);_0x2bacfd[_0x33fe('0x3a')]=_[_0x33fe('0x34')](_0x2bacfd[_0x33fe('0x30')],_0x2bacfd[_0x33fe('0x32')]);_0x5edff5['attributes']=_['intersection'](_0x2bacfd[_0x33fe('0x30')],qs[_0x33fe('0x45')](_0x2e2e09[_0x33fe('0x32')][_0x33fe('0x45')]));_0x5edff5['attributes']=_0x5edff5['attributes'][_0x33fe('0x35')]?_0x5edff5[_0x33fe('0x33')]:_0x2bacfd[_0x33fe('0x30')];_0x5edff5[_0x33fe('0x4d')]=qs[_0x33fe('0x39')](_0x2e2e09[_0x33fe('0x32')]['sort']);_0x5edff5[_0x33fe('0x3c')]=qs['filters'](_['pick'](_0x2e2e09[_0x33fe('0x32')],_0x2bacfd[_0x33fe('0x3a')]));if(_0x2e2e09[_0x33fe('0x32')][_0x33fe('0x3e')]){_0x5edff5[_0x33fe('0x3c')]=_[_0x33fe('0x3b')](_0x5edff5['where'],{'$or':_[_0x33fe('0x31')](_0x5edff5['attributes'],function(_0x3fee31){var _0x4066b8={};_0x4066b8[_0x3fee31]={'$like':'%'+_0x2e2e09[_0x33fe('0x32')][_0x33fe('0x3e')]+'%'};return _0x4066b8;})});}_0x5edff5=_[_0x33fe('0x3b')]({},_0x5edff5,_0x2e2e09[_0x33fe('0x46')]);return _0x5878fb[_0x33fe('0x4b')](_0x5edff5);}})['then'](function(_0x4676fa){if(_0x4676fa){_0x7101d1=_0x4676fa['length'];if(!_0x2e2e09['query']['hasOwnProperty'](_0x33fe('0x37'))){_0x5edff5[_0x33fe('0x38')]=qs[_0x33fe('0x38')](_0x2e2e09['query'][_0x33fe('0x38')]);_0x5edff5[_0x33fe('0x19')]=qs['offset'](_0x2e2e09[_0x33fe('0x32')][_0x33fe('0x19')]);}return _0x5878fb[_0x33fe('0x4b')](_0x5edff5);}})[_0x33fe('0x23')](function(_0x38d378){if(_0x38d378){return _0x38d378?{'count':_0x7101d1,'rows':_0x38d378}:null;}})[_0x33fe('0x23')](respondWithResult(_0x3d8a77,null))[_0x33fe('0x41')](handleError(_0x3d8a77,null));};exports['getSubjects']=function(_0x6286b6,_0x2daa21,_0xb76ead){var _0xd67637={};var _0x4af119={};var _0x5393e8;var _0x5a851c;return db[_0x33fe('0x2b')][_0x33fe('0x4e')]({'where':{'id':_0x6286b6[_0x33fe('0x43')]['id']}})[_0x33fe('0x23')](handleEntityNotFound(_0x2daa21,null))[_0x33fe('0x23')](function(_0x2cd5cd){if(_0x2cd5cd){_0x5393e8=_0x2cd5cd;_0x4af119[_0x33fe('0x30')]=_[_0x33fe('0x44')](db[_0x33fe('0x4c')][_0x33fe('0x2c')]);_0x4af119['query']=_[_0x33fe('0x44')](_0x6286b6[_0x33fe('0x32')]);_0x4af119['filters']=_['intersection'](_0x4af119[_0x33fe('0x30')],_0x4af119[_0x33fe('0x32')]);_0xd67637[_0x33fe('0x33')]=_[_0x33fe('0x34')](_0x4af119[_0x33fe('0x30')],qs[_0x33fe('0x45')](_0x6286b6['query'][_0x33fe('0x45')]));_0xd67637[_0x33fe('0x33')]=_0xd67637[_0x33fe('0x33')]['length']?_0xd67637[_0x33fe('0x33')]:_0x4af119['model'];_0xd67637['order']=qs[_0x33fe('0x39')](_0x6286b6[_0x33fe('0x32')]['sort']);_0xd67637['where']=qs[_0x33fe('0x3a')](_[_0x33fe('0x4f')](_0x6286b6[_0x33fe('0x32')],_0x4af119['filters']));if(_0x6286b6[_0x33fe('0x32')][_0x33fe('0x3e')]){_0xd67637['where']=_[_0x33fe('0x3b')](_0xd67637[_0x33fe('0x3c')],{'$or':_[_0x33fe('0x31')](_0xd67637[_0x33fe('0x33')],function(_0x13e3e7){var _0x2a33e9={};_0x2a33e9[_0x13e3e7]={'$like':'%'+_0x6286b6['query'][_0x33fe('0x3e')]+'%'};return _0x2a33e9;})});}_0xd67637=_[_0x33fe('0x3b')]({},_0xd67637,_0x6286b6[_0x33fe('0x46')]);return _0x5393e8[_0x33fe('0x50')](_0xd67637);}})[_0x33fe('0x23')](function(_0x5bd591){if(_0x5bd591){_0x5a851c=_0x5bd591[_0x33fe('0x35')];if(!_0x6286b6[_0x33fe('0x32')][_0x33fe('0x36')]('nolimit')){_0xd67637[_0x33fe('0x38')]=qs[_0x33fe('0x38')](_0x6286b6[_0x33fe('0x32')][_0x33fe('0x38')]);_0xd67637[_0x33fe('0x19')]=qs[_0x33fe('0x19')](_0x6286b6['query']['offset']);}return _0x5393e8[_0x33fe('0x50')](_0xd67637);}})[_0x33fe('0x23')](function(_0x3cdd97){if(_0x3cdd97){return _0x3cdd97?{'count':_0x5a851c,'rows':_0x3cdd97}:null;}})[_0x33fe('0x23')](respondWithResult(_0x2daa21,null))['catch'](handleError(_0x2daa21,null));};exports[_0x33fe('0x51')]=function(_0x2906a6,_0x335108,_0x202648){var _0x4d6e40={};var _0x3b40f4={};var _0x202903;var _0x1dbf47;return db['DeskConfiguration'][_0x33fe('0x4e')]({'where':{'id':_0x2906a6[_0x33fe('0x43')]['id']}})['then'](handleEntityNotFound(_0x335108,null))[_0x33fe('0x23')](function(_0x6def9d){if(_0x6def9d){_0x202903=_0x6def9d;_0x3b40f4[_0x33fe('0x30')]=_[_0x33fe('0x44')](db[_0x33fe('0x4c')]['rawAttributes']);_0x3b40f4[_0x33fe('0x32')]=_['keys'](_0x2906a6[_0x33fe('0x32')]);_0x3b40f4['filters']=_[_0x33fe('0x34')](_0x3b40f4[_0x33fe('0x30')],_0x3b40f4[_0x33fe('0x32')]);_0x4d6e40[_0x33fe('0x33')]=_[_0x33fe('0x34')](_0x3b40f4[_0x33fe('0x30')],qs[_0x33fe('0x45')](_0x2906a6[_0x33fe('0x32')]['fields']));_0x4d6e40[_0x33fe('0x33')]=_0x4d6e40[_0x33fe('0x33')][_0x33fe('0x35')]?_0x4d6e40['attributes']:_0x3b40f4[_0x33fe('0x30')];_0x4d6e40[_0x33fe('0x4d')]=qs[_0x33fe('0x39')](_0x2906a6['query'][_0x33fe('0x39')]);_0x4d6e40[_0x33fe('0x3c')]=qs['filters'](_['pick'](_0x2906a6[_0x33fe('0x32')],_0x3b40f4[_0x33fe('0x3a')]));if(_0x2906a6[_0x33fe('0x32')][_0x33fe('0x3e')]){_0x4d6e40[_0x33fe('0x3c')]=_[_0x33fe('0x3b')](_0x4d6e40[_0x33fe('0x3c')],{'$or':_['map'](_0x4d6e40[_0x33fe('0x33')],function(_0x27fc3c){var _0x4d5fb7={};_0x4d5fb7[_0x27fc3c]={'$like':'%'+_0x2906a6[_0x33fe('0x32')]['filter']+'%'};return _0x4d5fb7;})});}_0x4d6e40=_[_0x33fe('0x3b')]({},_0x4d6e40,_0x2906a6[_0x33fe('0x46')]);return _0x202903[_0x33fe('0x51')](_0x4d6e40);}})['then'](function(_0x323682){if(_0x323682){_0x1dbf47=_0x323682[_0x33fe('0x35')];if(!_0x2906a6[_0x33fe('0x32')][_0x33fe('0x36')](_0x33fe('0x37'))){_0x4d6e40[_0x33fe('0x38')]=qs[_0x33fe('0x38')](_0x2906a6[_0x33fe('0x32')][_0x33fe('0x38')]);_0x4d6e40[_0x33fe('0x19')]=qs[_0x33fe('0x19')](_0x2906a6[_0x33fe('0x32')][_0x33fe('0x19')]);}return _0x202903[_0x33fe('0x51')](_0x4d6e40);}})[_0x33fe('0x23')](function(_0x4fe3f){if(_0x4fe3f){return _0x4fe3f?{'count':_0x1dbf47,'rows':_0x4fe3f}:null;}})[_0x33fe('0x23')](respondWithResult(_0x335108,null))['catch'](handleError(_0x335108,null));};exports['getTags']=function(_0x3511b4,_0x53232a,_0x36c6e7){var _0x177053={};var _0x2eab9a={};var _0x574bea;var _0xb33aa4;return db[_0x33fe('0x2b')][_0x33fe('0x4e')]({'where':{'id':_0x3511b4[_0x33fe('0x43')]['id']}})[_0x33fe('0x23')](handleEntityNotFound(_0x53232a,null))[_0x33fe('0x23')](function(_0x4e048f){if(_0x4e048f){_0x574bea=_0x4e048f;_0x2eab9a['model']=_[_0x33fe('0x44')](db['Tag']['rawAttributes']);_0x2eab9a[_0x33fe('0x32')]=_['keys'](_0x3511b4[_0x33fe('0x32')]);_0x2eab9a[_0x33fe('0x3a')]=_[_0x33fe('0x34')](_0x2eab9a[_0x33fe('0x30')],_0x2eab9a[_0x33fe('0x32')]);_0x177053[_0x33fe('0x33')]=_[_0x33fe('0x34')](_0x2eab9a[_0x33fe('0x30')],qs[_0x33fe('0x45')](_0x3511b4[_0x33fe('0x32')][_0x33fe('0x45')]));_0x177053['attributes']=_0x177053['attributes'][_0x33fe('0x35')]?_0x177053['attributes']:_0x2eab9a['model'];_0x177053['order']=qs[_0x33fe('0x39')](_0x3511b4[_0x33fe('0x32')][_0x33fe('0x39')]);_0x177053[_0x33fe('0x3c')]=qs[_0x33fe('0x3a')](_[_0x33fe('0x4f')](_0x3511b4[_0x33fe('0x32')],_0x2eab9a[_0x33fe('0x3a')]));if(_0x3511b4[_0x33fe('0x32')][_0x33fe('0x3e')]){_0x177053[_0x33fe('0x3c')]=_[_0x33fe('0x3b')](_0x177053[_0x33fe('0x3c')],{'$or':_[_0x33fe('0x31')](_0x177053[_0x33fe('0x33')],function(_0x206ecb){var _0x13efed={};_0x13efed[_0x206ecb]={'$like':'%'+_0x3511b4[_0x33fe('0x32')][_0x33fe('0x3e')]+'%'};return _0x13efed;})});}_0x177053=_[_0x33fe('0x3b')]({},_0x177053,_0x3511b4[_0x33fe('0x46')]);return _0x574bea['getTags'](_0x177053);}})['then'](function(_0x4fc872){if(_0x4fc872){_0xb33aa4=_0x4fc872[_0x33fe('0x35')];if(!_0x3511b4[_0x33fe('0x32')][_0x33fe('0x36')](_0x33fe('0x37'))){_0x177053[_0x33fe('0x38')]=qs['limit'](_0x3511b4[_0x33fe('0x32')][_0x33fe('0x38')]);_0x177053[_0x33fe('0x19')]=qs[_0x33fe('0x19')](_0x3511b4['query'][_0x33fe('0x19')]);}return _0x574bea[_0x33fe('0x52')](_0x177053);}})[_0x33fe('0x23')](function(_0x237bb7){if(_0x237bb7){return _0x237bb7?{'count':_0xb33aa4,'rows':_0x237bb7}:null;}})[_0x33fe('0x23')](respondWithResult(_0x53232a,null))[_0x33fe('0x41')](handleError(_0x53232a,null));};exports[_0x33fe('0x53')]=function(_0x3df734,_0xe942fe,_0x37ec81){if(_0x3df734[_0x33fe('0x49')]['id']){delete _0x3df734['body']['id'];}return db[_0x33fe('0x2b')][_0x33fe('0x4e')]({'where':{'id':_0x3df734['params']['id']}})['then'](handleEntityNotFound(_0xe942fe,null))['then'](function(_0x129d8b){if(_0x129d8b){return _0x129d8b['setTags'](_0x3df734[_0x33fe('0x49')][_0x33fe('0x54')]||[]);}return null;})[_0x33fe('0x23')](respondWithResult(_0xe942fe,null))[_0x33fe('0x41')](handleError(_0xe942fe,null));}; \ No newline at end of file +var _0x423d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getFields','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x423d,0x1e8));var _0xd423=function(_0xe6d0e4,_0x498b77){_0xe6d0e4=_0xe6d0e4-0x0;var _0x3f7e55=_0x423d[_0xe6d0e4];return _0x3f7e55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd423('0x0'));var zipdir=require(_0xd423('0x1'));var jsonpatch=require(_0xd423('0x2'));var rp=require(_0xd423('0x3'));var moment=require(_0xd423('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd423('0x5'));var util=require('util');var path=require(_0xd423('0x6'));var sox=require(_0xd423('0x7'));var csv=require('to-csv');var ejs=require(_0xd423('0x8'));var fs=require('fs');var fs_extra=require(_0xd423('0x9'));var _=require(_0xd423('0xa'));var squel=require(_0xd423('0xb'));var crypto=require(_0xd423('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd423('0xd'));var querystring=require(_0xd423('0xe'));var Papa=require(_0xd423('0xf'));var Redis=require(_0xd423('0x10'));var authService=require(_0xd423('0x11'));var qs=require(_0xd423('0x12'));var as=require(_0xd423('0x13'));var hardwareService=require(_0xd423('0x14'));var logger=require(_0xd423('0x15'))('api');var utils=require(_0xd423('0x16'));var config=require(_0xd423('0x17'));var licenseUtil=require(_0xd423('0x18'));var db=require(_0xd423('0x19'))['db'];function respondWithStatusCode(_0x2b1e81,_0x2b39b0){_0x2b39b0=_0x2b39b0||0xcc;return function(_0x46e7f0){if(_0x46e7f0){return _0x2b1e81['sendStatus'](_0x2b39b0);}return _0x2b1e81[_0xd423('0x1a')](_0x2b39b0)[_0xd423('0x1b')]();};}function respondWithResult(_0x363fb9,_0x3895dd){_0x3895dd=_0x3895dd||0xc8;return function(_0x99d319){if(_0x99d319){return _0x363fb9[_0xd423('0x1a')](_0x3895dd)[_0xd423('0x1c')](_0x99d319);}};}function respondWithFilteredResult(_0x1bb456,_0x152751){return function(_0x1612d6){if(_0x1612d6){var _0x1b1c1e=typeof _0x152751['offset']===_0xd423('0x1d')&&typeof _0x152751[_0xd423('0x1e')]===_0xd423('0x1d');var _0x477c17=_0x1612d6['count'];var _0x217e7a=_0x1b1c1e?0x0:_0x152751[_0xd423('0x1f')];var _0x42edcd=_0x1b1c1e?_0x1612d6[_0xd423('0x20')]:_0x152751[_0xd423('0x1f')]+_0x152751[_0xd423('0x1e')];var _0x52e762;if(_0x42edcd>=_0x477c17){_0x42edcd=_0x477c17;_0x52e762=0xc8;}else{_0x52e762=0xce;}_0x1bb456[_0xd423('0x1a')](_0x52e762);return _0x1bb456[_0xd423('0x21')](_0xd423('0x22'),_0x217e7a+'-'+_0x42edcd+'/'+_0x477c17)['json'](_0x1612d6);}return null;};}function patchUpdates(_0x5cb1e2){return function(_0x3d26e0){try{jsonpatch['apply'](_0x3d26e0,_0x5cb1e2,!![]);}catch(_0x437cca){return BPromise[_0xd423('0x23')](_0x437cca);}return _0x3d26e0[_0xd423('0x24')]();};}function saveUpdates(_0x1ee113,_0x3dde70){return function(_0x3aa9b0){if(_0x3aa9b0){return _0x3aa9b0[_0xd423('0x25')](_0x1ee113)[_0xd423('0x26')](function(_0x44ad37){return _0x44ad37;});}return null;};}function removeEntity(_0x3ae61b,_0x591fa6){return function(_0x9e4731){if(_0x9e4731){return _0x9e4731[_0xd423('0x27')]()[_0xd423('0x26')](function(){_0x3ae61b[_0xd423('0x1a')](0xcc)[_0xd423('0x1b')]();});}};}function handleEntityNotFound(_0x556728,_0x944cee){return function(_0xea47b3){if(!_0xea47b3){_0x556728['sendStatus'](0x194);}return _0xea47b3;};}function handleError(_0x13d3d6,_0x3cddb2){_0x3cddb2=_0x3cddb2||0x1f4;return function(_0x46304f){logger['error'](_0x46304f[_0xd423('0x28')]);if(_0x46304f[_0xd423('0x29')]){delete _0x46304f['name'];}_0x13d3d6['status'](_0x3cddb2)[_0xd423('0x2a')](_0x46304f);};}exports[_0xd423('0x2b')]=function(_0x11b40c,_0x59c0a5){var _0x12599d={},_0x53977e={},_0xfe481e={'count':0x0,'rows':[]};var _0x38cc9c=_[_0xd423('0x2c')](db['DeskConfiguration'][_0xd423('0x2d')],function(_0x26df77){return{'name':_0x26df77[_0xd423('0x2e')],'type':_0x26df77[_0xd423('0x2f')][_0xd423('0x30')]};});_0x53977e[_0xd423('0x31')]=_[_0xd423('0x2c')](_0x38cc9c,_0xd423('0x29'));_0x53977e[_0xd423('0x32')]=_['keys'](_0x11b40c['query']);_0x53977e['filters']=_[_0xd423('0x33')](_0x53977e[_0xd423('0x31')],_0x53977e[_0xd423('0x32')]);_0x12599d[_0xd423('0x34')]=_[_0xd423('0x33')](_0x53977e[_0xd423('0x31')],qs[_0xd423('0x35')](_0x11b40c['query'][_0xd423('0x35')]));_0x12599d['attributes']=_0x12599d[_0xd423('0x34')][_0xd423('0x36')]?_0x12599d[_0xd423('0x34')]:_0x53977e[_0xd423('0x31')];if(!_0x11b40c['query'][_0xd423('0x37')](_0xd423('0x38'))){_0x12599d[_0xd423('0x1e')]=qs[_0xd423('0x1e')](_0x11b40c['query'][_0xd423('0x1e')]);_0x12599d['offset']=qs[_0xd423('0x1f')](_0x11b40c[_0xd423('0x32')][_0xd423('0x1f')]);}_0x12599d[_0xd423('0x39')]=qs['sort'](_0x11b40c['query'][_0xd423('0x3a')]);_0x12599d[_0xd423('0x3b')]=qs[_0xd423('0x3c')](_[_0xd423('0x3d')](_0x11b40c[_0xd423('0x32')],_0x53977e['filters']),_0x38cc9c);if(_0x11b40c[_0xd423('0x32')]['filter']){_0x12599d[_0xd423('0x3b')]=_[_0xd423('0x3e')](_0x12599d[_0xd423('0x3b')],{'$or':_[_0xd423('0x2c')](_0x38cc9c,function(_0x709b93){if(_0x709b93[_0xd423('0x2f')]!=='VIRTUAL'){var _0x23115c={};_0x23115c[_0x709b93[_0xd423('0x29')]]={'$like':'%'+_0x11b40c[_0xd423('0x32')][_0xd423('0x3f')]+'%'};return _0x23115c;}})});}_0x12599d=_[_0xd423('0x3e')]({},_0x12599d,_0x11b40c[_0xd423('0x40')]);var _0x2692f0={'where':_0x12599d[_0xd423('0x3b')]};return db[_0xd423('0x41')][_0xd423('0x20')](_0x2692f0)[_0xd423('0x26')](function(_0x2ba207){_0xfe481e['count']=_0x2ba207;if(_0x11b40c[_0xd423('0x32')][_0xd423('0x42')]){_0x12599d[_0xd423('0x43')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd423('0x44')](_0x12599d);})['then'](function(_0x394fd8){_0xfe481e[_0xd423('0x45')]=_0x394fd8;return _0xfe481e;})[_0xd423('0x26')](respondWithFilteredResult(_0x59c0a5,_0x12599d))[_0xd423('0x46')](handleError(_0x59c0a5,null));};exports[_0xd423('0x47')]=function(_0xc6e65d,_0x2deb9c){var _0x4bbeb2={'raw':![],'where':{'id':_0xc6e65d['params']['id']}},_0xdd348c={};_0xdd348c[_0xd423('0x31')]=_['keys'](db[_0xd423('0x41')]['rawAttributes']);_0xdd348c[_0xd423('0x32')]=_[_0xd423('0x48')](_0xc6e65d[_0xd423('0x32')]);_0xdd348c['filters']=_[_0xd423('0x33')](_0xdd348c[_0xd423('0x31')],_0xdd348c['query']);_0x4bbeb2[_0xd423('0x34')]=_['intersection'](_0xdd348c[_0xd423('0x31')],qs[_0xd423('0x35')](_0xc6e65d[_0xd423('0x32')]['fields']));_0x4bbeb2[_0xd423('0x34')]=_0x4bbeb2[_0xd423('0x34')][_0xd423('0x36')]?_0x4bbeb2[_0xd423('0x34')]:_0xdd348c['model'];if(_0xc6e65d[_0xd423('0x32')][_0xd423('0x42')]){_0x4bbeb2[_0xd423('0x43')]=[{'all':!![]}];}_0x4bbeb2=_['merge']({},_0x4bbeb2,_0xc6e65d[_0xd423('0x40')]);return db['DeskConfiguration'][_0xd423('0x49')](_0x4bbeb2)[_0xd423('0x26')](handleEntityNotFound(_0x2deb9c,null))[_0xd423('0x26')](respondWithResult(_0x2deb9c,null))['catch'](handleError(_0x2deb9c,null));};exports[_0xd423('0x4a')]=function(_0x1f3e3d,_0xece2a6){return db['DeskConfiguration'][_0xd423('0x4a')](_0x1f3e3d[_0xd423('0x4b')],{})['then'](respondWithResult(_0xece2a6,0xc9))[_0xd423('0x46')](handleError(_0xece2a6,null));};exports[_0xd423('0x25')]=function(_0x111a4b,_0x39e271){if(_0x111a4b[_0xd423('0x4b')]['id']){delete _0x111a4b['body']['id'];}return db[_0xd423('0x41')][_0xd423('0x49')]({'where':{'id':_0x111a4b[_0xd423('0x4c')]['id']}})[_0xd423('0x26')](handleEntityNotFound(_0x39e271,null))[_0xd423('0x26')](saveUpdates(_0x111a4b[_0xd423('0x4b')],null))[_0xd423('0x26')](respondWithResult(_0x39e271,null))[_0xd423('0x46')](handleError(_0x39e271,null));};exports['destroy']=function(_0x3fc3b6,_0xc83710){return db[_0xd423('0x41')][_0xd423('0x49')]({'where':{'id':_0x3fc3b6['params']['id']}})[_0xd423('0x26')](handleEntityNotFound(_0xc83710,null))[_0xd423('0x26')](removeEntity(_0xc83710,null))[_0xd423('0x46')](handleError(_0xc83710,null));};exports[_0xd423('0x4d')]=function(_0x39c901,_0x2843ce,_0x534c6f){var _0x2dd160={};var _0x38dc91={};var _0x366769;var _0x5db0fb;return db[_0xd423('0x41')][_0xd423('0x4e')]({'where':{'id':_0x39c901[_0xd423('0x4c')]['id']}})[_0xd423('0x26')](handleEntityNotFound(_0x2843ce,null))[_0xd423('0x26')](function(_0x475f03){if(_0x475f03){_0x366769=_0x475f03;_0x38dc91[_0xd423('0x31')]=_[_0xd423('0x48')](db['DeskField'][_0xd423('0x2d')]);_0x38dc91['query']=_[_0xd423('0x48')](_0x39c901['query']);_0x38dc91[_0xd423('0x3c')]=_[_0xd423('0x33')](_0x38dc91[_0xd423('0x31')],_0x38dc91[_0xd423('0x32')]);_0x2dd160[_0xd423('0x34')]=_[_0xd423('0x33')](_0x38dc91[_0xd423('0x31')],qs[_0xd423('0x35')](_0x39c901[_0xd423('0x32')][_0xd423('0x35')]));_0x2dd160[_0xd423('0x34')]=_0x2dd160[_0xd423('0x34')][_0xd423('0x36')]?_0x2dd160['attributes']:_0x38dc91[_0xd423('0x31')];_0x2dd160['order']=qs[_0xd423('0x3a')](_0x39c901[_0xd423('0x32')][_0xd423('0x3a')]);_0x2dd160['where']=qs['filters'](_[_0xd423('0x3d')](_0x39c901[_0xd423('0x32')],_0x38dc91['filters']));if(_0x39c901[_0xd423('0x32')][_0xd423('0x3f')]){_0x2dd160[_0xd423('0x3b')]=_[_0xd423('0x3e')](_0x2dd160['where'],{'$or':_[_0xd423('0x2c')](_0x2dd160[_0xd423('0x34')],function(_0x4794d){var _0xedd581={};_0xedd581[_0x4794d]={'$like':'%'+_0x39c901[_0xd423('0x32')][_0xd423('0x3f')]+'%'};return _0xedd581;})});}_0x2dd160=_['merge']({},_0x2dd160,_0x39c901[_0xd423('0x40')]);return _0x366769['getFields'](_0x2dd160);}})['then'](function(_0x3ffb34){if(_0x3ffb34){_0x5db0fb=_0x3ffb34[_0xd423('0x36')];if(!_0x39c901[_0xd423('0x32')][_0xd423('0x37')](_0xd423('0x38'))){_0x2dd160[_0xd423('0x1e')]=qs['limit'](_0x39c901['query'][_0xd423('0x1e')]);_0x2dd160[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x39c901[_0xd423('0x32')][_0xd423('0x1f')]);}return _0x366769[_0xd423('0x4d')](_0x2dd160);}})[_0xd423('0x26')](function(_0x1d33d8){if(_0x1d33d8){return _0x1d33d8?{'count':_0x5db0fb,'rows':_0x1d33d8}:null;}})[_0xd423('0x26')](respondWithResult(_0x2843ce,null))['catch'](handleError(_0x2843ce,null));};exports[_0xd423('0x4f')]=function(_0xdcf8a8,_0x36081a,_0x3e3d7f){var _0xee920d={};var _0x400f2f={};var _0x5590b6;var _0x3dbed7;return db[_0xd423('0x41')][_0xd423('0x4e')]({'where':{'id':_0xdcf8a8[_0xd423('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36081a,null))[_0xd423('0x26')](function(_0x5c05e5){if(_0x5c05e5){_0x5590b6=_0x5c05e5;_0x400f2f[_0xd423('0x31')]=_[_0xd423('0x48')](db['DeskField'][_0xd423('0x2d')]);_0x400f2f[_0xd423('0x32')]=_[_0xd423('0x48')](_0xdcf8a8[_0xd423('0x32')]);_0x400f2f[_0xd423('0x3c')]=_['intersection'](_0x400f2f['model'],_0x400f2f[_0xd423('0x32')]);_0xee920d[_0xd423('0x34')]=_[_0xd423('0x33')](_0x400f2f[_0xd423('0x31')],qs[_0xd423('0x35')](_0xdcf8a8['query'][_0xd423('0x35')]));_0xee920d[_0xd423('0x34')]=_0xee920d[_0xd423('0x34')][_0xd423('0x36')]?_0xee920d[_0xd423('0x34')]:_0x400f2f[_0xd423('0x31')];_0xee920d['order']=qs['sort'](_0xdcf8a8['query']['sort']);_0xee920d[_0xd423('0x3b')]=qs[_0xd423('0x3c')](_[_0xd423('0x3d')](_0xdcf8a8[_0xd423('0x32')],_0x400f2f['filters']));if(_0xdcf8a8[_0xd423('0x32')]['filter']){_0xee920d[_0xd423('0x3b')]=_['merge'](_0xee920d[_0xd423('0x3b')],{'$or':_[_0xd423('0x2c')](_0xee920d['attributes'],function(_0x3f7a7a){var _0x14c20f={};_0x14c20f[_0x3f7a7a]={'$like':'%'+_0xdcf8a8[_0xd423('0x32')]['filter']+'%'};return _0x14c20f;})});}_0xee920d=_[_0xd423('0x3e')]({},_0xee920d,_0xdcf8a8['options']);return _0x5590b6['getSubjects'](_0xee920d);}})[_0xd423('0x26')](function(_0x20ad38){if(_0x20ad38){_0x3dbed7=_0x20ad38[_0xd423('0x36')];if(!_0xdcf8a8[_0xd423('0x32')]['hasOwnProperty'](_0xd423('0x38'))){_0xee920d['limit']=qs[_0xd423('0x1e')](_0xdcf8a8[_0xd423('0x32')]['limit']);_0xee920d[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0xdcf8a8['query']['offset']);}return _0x5590b6[_0xd423('0x4f')](_0xee920d);}})[_0xd423('0x26')](function(_0x6b28c3){if(_0x6b28c3){return _0x6b28c3?{'count':_0x3dbed7,'rows':_0x6b28c3}:null;}})['then'](respondWithResult(_0x36081a,null))['catch'](handleError(_0x36081a,null));};exports[_0xd423('0x50')]=function(_0x3c34c4,_0x364ff8,_0x556b5e){var _0x5ea9b8={};var _0x1cd1b5={};var _0x4d29fa;var _0x38676b;return db[_0xd423('0x41')]['findOne']({'where':{'id':_0x3c34c4[_0xd423('0x4c')]['id']}})[_0xd423('0x26')](handleEntityNotFound(_0x364ff8,null))[_0xd423('0x26')](function(_0x57b10f){if(_0x57b10f){_0x4d29fa=_0x57b10f;_0x1cd1b5[_0xd423('0x31')]=_['keys'](db['DeskField'][_0xd423('0x2d')]);_0x1cd1b5[_0xd423('0x32')]=_[_0xd423('0x48')](_0x3c34c4[_0xd423('0x32')]);_0x1cd1b5[_0xd423('0x3c')]=_['intersection'](_0x1cd1b5[_0xd423('0x31')],_0x1cd1b5[_0xd423('0x32')]);_0x5ea9b8[_0xd423('0x34')]=_[_0xd423('0x33')](_0x1cd1b5[_0xd423('0x31')],qs[_0xd423('0x35')](_0x3c34c4['query'][_0xd423('0x35')]));_0x5ea9b8[_0xd423('0x34')]=_0x5ea9b8[_0xd423('0x34')][_0xd423('0x36')]?_0x5ea9b8['attributes']:_0x1cd1b5['model'];_0x5ea9b8[_0xd423('0x39')]=qs[_0xd423('0x3a')](_0x3c34c4[_0xd423('0x32')][_0xd423('0x3a')]);_0x5ea9b8[_0xd423('0x3b')]=qs[_0xd423('0x3c')](_[_0xd423('0x3d')](_0x3c34c4[_0xd423('0x32')],_0x1cd1b5[_0xd423('0x3c')]));if(_0x3c34c4[_0xd423('0x32')][_0xd423('0x3f')]){_0x5ea9b8['where']=_['merge'](_0x5ea9b8[_0xd423('0x3b')],{'$or':_['map'](_0x5ea9b8[_0xd423('0x34')],function(_0x2d65e7){var _0x1af24a={};_0x1af24a[_0x2d65e7]={'$like':'%'+_0x3c34c4[_0xd423('0x32')][_0xd423('0x3f')]+'%'};return _0x1af24a;})});}_0x5ea9b8=_[_0xd423('0x3e')]({},_0x5ea9b8,_0x3c34c4[_0xd423('0x40')]);return _0x4d29fa[_0xd423('0x50')](_0x5ea9b8);}})['then'](function(_0x132043){if(_0x132043){_0x38676b=_0x132043['length'];if(!_0x3c34c4['query'][_0xd423('0x37')](_0xd423('0x38'))){_0x5ea9b8['limit']=qs[_0xd423('0x1e')](_0x3c34c4[_0xd423('0x32')][_0xd423('0x1e')]);_0x5ea9b8[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x3c34c4['query'][_0xd423('0x1f')]);}return _0x4d29fa[_0xd423('0x50')](_0x5ea9b8);}})[_0xd423('0x26')](function(_0x31c948){if(_0x31c948){return _0x31c948?{'count':_0x38676b,'rows':_0x31c948}:null;}})['then'](respondWithResult(_0x364ff8,null))[_0xd423('0x46')](handleError(_0x364ff8,null));};exports[_0xd423('0x51')]=function(_0x307e2a,_0x2234eb,_0x15c075){var _0x2fb5de={};var _0x4f8e90={};var _0x56f3a3;var _0x42d776;return db[_0xd423('0x41')][_0xd423('0x4e')]({'where':{'id':_0x307e2a[_0xd423('0x4c')]['id']}})[_0xd423('0x26')](handleEntityNotFound(_0x2234eb,null))[_0xd423('0x26')](function(_0x33397f){if(_0x33397f){_0x56f3a3=_0x33397f;_0x4f8e90[_0xd423('0x31')]=_[_0xd423('0x48')](db[_0xd423('0x52')]['rawAttributes']);_0x4f8e90[_0xd423('0x32')]=_[_0xd423('0x48')](_0x307e2a[_0xd423('0x32')]);_0x4f8e90[_0xd423('0x3c')]=_['intersection'](_0x4f8e90['model'],_0x4f8e90[_0xd423('0x32')]);_0x2fb5de[_0xd423('0x34')]=_[_0xd423('0x33')](_0x4f8e90[_0xd423('0x31')],qs[_0xd423('0x35')](_0x307e2a[_0xd423('0x32')][_0xd423('0x35')]));_0x2fb5de[_0xd423('0x34')]=_0x2fb5de[_0xd423('0x34')][_0xd423('0x36')]?_0x2fb5de[_0xd423('0x34')]:_0x4f8e90[_0xd423('0x31')];_0x2fb5de[_0xd423('0x39')]=qs[_0xd423('0x3a')](_0x307e2a[_0xd423('0x32')][_0xd423('0x3a')]);_0x2fb5de[_0xd423('0x3b')]=qs[_0xd423('0x3c')](_[_0xd423('0x3d')](_0x307e2a['query'],_0x4f8e90[_0xd423('0x3c')]));if(_0x307e2a['query'][_0xd423('0x3f')]){_0x2fb5de['where']=_[_0xd423('0x3e')](_0x2fb5de[_0xd423('0x3b')],{'$or':_['map'](_0x2fb5de[_0xd423('0x34')],function(_0x52f0e9){var _0x225598={};_0x225598[_0x52f0e9]={'$like':'%'+_0x307e2a[_0xd423('0x32')][_0xd423('0x3f')]+'%'};return _0x225598;})});}_0x2fb5de=_['merge']({},_0x2fb5de,_0x307e2a[_0xd423('0x40')]);return _0x56f3a3[_0xd423('0x51')](_0x2fb5de);}})['then'](function(_0x2ff492){if(_0x2ff492){_0x42d776=_0x2ff492[_0xd423('0x36')];if(!_0x307e2a[_0xd423('0x32')][_0xd423('0x37')](_0xd423('0x38'))){_0x2fb5de[_0xd423('0x1e')]=qs[_0xd423('0x1e')](_0x307e2a[_0xd423('0x32')][_0xd423('0x1e')]);_0x2fb5de[_0xd423('0x1f')]=qs['offset'](_0x307e2a[_0xd423('0x32')][_0xd423('0x1f')]);}return _0x56f3a3[_0xd423('0x51')](_0x2fb5de);}})[_0xd423('0x26')](function(_0x29b0b1){if(_0x29b0b1){return _0x29b0b1?{'count':_0x42d776,'rows':_0x29b0b1}:null;}})[_0xd423('0x26')](respondWithResult(_0x2234eb,null))[_0xd423('0x46')](handleError(_0x2234eb,null));};exports[_0xd423('0x53')]=function(_0x1e1d62,_0x497dc6,_0x2d9e36){if(_0x1e1d62[_0xd423('0x4b')]['id']){delete _0x1e1d62['body']['id'];}return db[_0xd423('0x41')][_0xd423('0x4e')]({'where':{'id':_0x1e1d62[_0xd423('0x4c')]['id']}})[_0xd423('0x26')](handleEntityNotFound(_0x497dc6,null))[_0xd423('0x26')](function(_0x927d10){if(_0x927d10){return _0x927d10[_0xd423('0x53')](_0x1e1d62[_0xd423('0x4b')][_0xd423('0x54')]||[]);}return null;})[_0xd423('0x26')](respondWithResult(_0x497dc6,null))['catch'](handleError(_0x497dc6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2a471c2..8295d48 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 _0x57a1=['../../config/environment','./intDeskConfiguration.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x13afe5,_0x30ae3a){var _0x41e8d9=function(_0x14e1ca){while(--_0x14e1ca){_0x13afe5['push'](_0x13afe5['shift']());}};_0x41e8d9(++_0x30ae3a);}(_0x57a1,0x93));var _0x157a=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0x57a1[_0x28ef4e];return _0x1aa097;};'use strict';var _=require(_0x157a('0x0'));var util=require('util');var logger=require(_0x157a('0x1'))('api');var moment=require(_0x157a('0x2'));var BPromise=require(_0x157a('0x3'));var rp=require(_0x157a('0x4'));var fs=require('fs');var path=require(_0x157a('0x5'));var rimraf=require(_0x157a('0x6'));var config=require(_0x157a('0x7'));var attributes=require(_0x157a('0x8'));module[_0x157a('0x9')]=function(_0x569c47,_0x16ae8b){return _0x569c47[_0x157a('0xa')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdacd=['request-promise','path','rimraf','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x1b9ba5,_0x44b731){var _0x55bc1a=function(_0x5b1cbc){while(--_0x5b1cbc){_0x1b9ba5['push'](_0x1b9ba5['shift']());}};_0x55bc1a(++_0x44b731);}(_0xdacd,0xab));var _0xddac=function(_0x1918c9,_0x602a17){_0x1918c9=_0x1918c9-0x0;var _0x2d01a8=_0xdacd[_0x1918c9];return _0x2d01a8;};'use strict';var _=require('lodash');var util=require(_0xddac('0x0'));var logger=require(_0xddac('0x1'))(_0xddac('0x2'));var moment=require(_0xddac('0x3'));var BPromise=require(_0xddac('0x4'));var rp=require(_0xddac('0x5'));var fs=require('fs');var path=require(_0xddac('0x6'));var rimraf=require(_0xddac('0x7'));var config=require('../../config/environment');var attributes=require(_0xddac('0x8'));module['exports']=function(_0x28438d,_0x3d4e83){return _0x28438d['define'](_0xddac('0x9'),attributes,{'tableName':_0xddac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5ceb6ac..07e1f31 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 _0x7cd6=['../../config/logger','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x3a9707,_0x3d19c8){var _0x2fb6aa=function(_0x51947b){while(--_0x51947b){_0x3a9707['push'](_0x3a9707['shift']());}};_0x2fb6aa(++_0x3d19c8);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x5cf1f1,_0x51cf60){_0x5cf1f1=_0x5cf1f1-0x0;var _0x4b3ad9=_0x7cd6[_0x5cf1f1];return _0x4b3ad9;};'use strict';var _=require(_0x67cd('0x0'));var util=require(_0x67cd('0x1'));var moment=require(_0x67cd('0x2'));var BPromise=require(_0x67cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67cd('0x4'))['db'];var utils=require(_0x67cd('0x5'));var logger=require(_0x67cd('0x6'))('rpc');var config=require(_0x67cd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x67cd('0x8')][_0x67cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcdc210,_0x2bb791,_0x48bdf5){return new BPromise(function(_0x509ba6,_0x55c3dc){return client[_0x67cd('0xa')](_0xcdc210,_0x48bdf5)[_0x67cd('0xb')](function(_0x4a92b3){logger[_0x67cd('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x2bb791,'request\x20sent');logger['debug'](_0x67cd('0xd'),_0x2bb791,_0x67cd('0xe'),JSON[_0x67cd('0xf')](_0x4a92b3));if(_0x4a92b3[_0x67cd('0x10')]){if(_0x4a92b3[_0x67cd('0x10')][_0x67cd('0x11')]===0x1f4){logger['error'](_0x67cd('0x12'),_0x2bb791,_0x4a92b3[_0x67cd('0x10')][_0x67cd('0x13')]);return _0x55c3dc(_0x4a92b3[_0x67cd('0x10')][_0x67cd('0x13')]);}logger[_0x67cd('0x10')](_0x67cd('0x12'),_0x2bb791,_0x4a92b3[_0x67cd('0x10')][_0x67cd('0x13')]);return _0x509ba6(_0x4a92b3[_0x67cd('0x10')][_0x67cd('0x13')]);}else{logger[_0x67cd('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x2bb791,_0x67cd('0xe'));_0x509ba6(_0x4a92b3[_0x67cd('0x14')][_0x67cd('0x13')]);}})[_0x67cd('0x15')](function(_0xe82a4f){logger['error'](_0x67cd('0x12'),_0x2bb791,_0xe82a4f);_0x55c3dc(_0xe82a4f);});});} \ No newline at end of file +var _0xb6ff=['info','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x4100d1,_0x209f80){var _0x2f235c=function(_0x5ee350){while(--_0x5ee350){_0x4100d1['push'](_0x4100d1['shift']());}};_0x2f235c(++_0x209f80);}(_0xb6ff,0x185));var _0xfb6f=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xb6ff[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xfb6f('0x0'));var util=require(_0xfb6f('0x1'));var moment=require(_0xfb6f('0x2'));var BPromise=require(_0xfb6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb6f('0x4'));var db=require(_0xfb6f('0x5'))['db'];var utils=require(_0xfb6f('0x6'));var logger=require('../../config/logger')(_0xfb6f('0x7'));var config=require(_0xfb6f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfb6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4172,_0x3de2f9,_0x35636c){return new BPromise(function(_0x54cebf,_0x2123fe){return client[_0xfb6f('0xa')](_0x2b4172,_0x35636c)['then'](function(_0x7bb352){logger[_0xfb6f('0xb')](_0xfb6f('0xc'),_0x3de2f9,'request\x20sent');logger[_0xfb6f('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3de2f9,_0xfb6f('0xe'),JSON['stringify'](_0x7bb352));if(_0x7bb352[_0xfb6f('0xf')]){if(_0x7bb352[_0xfb6f('0xf')][_0xfb6f('0x10')]===0x1f4){logger[_0xfb6f('0xf')](_0xfb6f('0xc'),_0x3de2f9,_0x7bb352[_0xfb6f('0xf')][_0xfb6f('0x11')]);return _0x2123fe(_0x7bb352[_0xfb6f('0xf')][_0xfb6f('0x11')]);}logger[_0xfb6f('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x3de2f9,_0x7bb352[_0xfb6f('0xf')]['message']);return _0x54cebf(_0x7bb352['error'][_0xfb6f('0x11')]);}else{logger['info'](_0xfb6f('0xc'),_0x3de2f9,'request\x20sent');_0x54cebf(_0x7bb352[_0xfb6f('0x12')]['message']);}})[_0xfb6f('0x13')](function(_0x2b1eec){logger[_0xfb6f('0xf')](_0xfb6f('0xc'),_0x3de2f9,_0x2b1eec);_0x2123fe(_0x2b1eec);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e312bf7..d51f0c9 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 _0x5b93=['../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b93,0x13b));var _0x35b9=function(_0x56f844,_0x249cbf){_0x56f844=_0x56f844-0x0;var _0x356dc0=_0x5b93[_0x56f844];return _0x356dc0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x35b9('0x0'));var timeout=require(_0x35b9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x35b9('0x2'));var auth=require(_0x35b9('0x3'));var interaction=require(_0x35b9('0x4'));var config=require(_0x35b9('0x5'));var controller=require(_0x35b9('0x6'));router[_0x35b9('0x7')]('/',auth[_0x35b9('0x8')](),controller['index']);router[_0x35b9('0x7')](_0x35b9('0x9'),auth[_0x35b9('0x8')](),controller[_0x35b9('0xa')]);router[_0x35b9('0xb')]('/',auth[_0x35b9('0x8')](),controller[_0x35b9('0xc')]);router['put'](_0x35b9('0x9'),auth[_0x35b9('0x8')](),controller[_0x35b9('0xd')]);router['delete'](_0x35b9('0x9'),auth[_0x35b9('0x8')](),controller[_0x35b9('0xe')]);module[_0x35b9('0xf')]=router; \ No newline at end of file +var _0x659c=['/:id','post','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x659c,0x1aa));var _0xc659=function(_0x1ca66c,_0x3e3868){_0x1ca66c=_0x1ca66c-0x0;var _0x5a78ce=_0x659c[_0x1ca66c];return _0x5a78ce;};'use strict';var multer=require(_0xc659('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc659('0x1'));var express=require(_0xc659('0x2'));var router=express['Router']();var fs_extra=require(_0xc659('0x3'));var auth=require(_0xc659('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc659('0x5'));router[_0xc659('0x6')]('/',auth[_0xc659('0x7')](),controller[_0xc659('0x8')]);router[_0xc659('0x6')](_0xc659('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc659('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc659('0x9'),auth[_0xc659('0x7')](),controller[_0xc659('0xb')]);router[_0xc659('0xc')](_0xc659('0x9'),auth[_0xc659('0x7')](),controller[_0xc659('0xd')]);module[_0xc659('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index ec92137..0285235 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 _0xfc76=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x5a8ac2,_0x293417){var _0x2b6a31=function(_0xaf6085){while(--_0xaf6085){_0x5a8ac2['push'](_0x5a8ac2['shift']());}};_0x2b6a31(++_0x293417);}(_0xfc76,0x10b));var _0x6fc7=function(_0x240de7,_0x3aba3f){_0x240de7=_0x240de7-0x0;var _0x1c099d=_0xfc76[_0x240de7];return _0x1c099d;};'use strict';var Sequelize=require(_0x6fc7('0x0'));module['exports']={'type':{'type':Sequelize[_0x6fc7('0x1')](_0x6fc7('0x2'),'variable',_0x6fc7('0x3'),_0x6fc7('0x4'),_0x6fc7('0x5')),'defaultValue':_0x6fc7('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6fc7('0x6')]},'keyType':{'type':Sequelize[_0x6fc7('0x1')](_0x6fc7('0x2'),'variable',_0x6fc7('0x3'))},'keyContent':{'type':Sequelize[_0x6fc7('0x6')]},'idField':{'type':Sequelize[_0x6fc7('0x6')]},'nameField':{'type':Sequelize[_0x6fc7('0x6')]},'customField':{'type':Sequelize[_0x6fc7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fc7('0x6')]}}; \ No newline at end of file +var _0xaf42=['BOOLEAN','exports','ENUM','string','customVariable','STRING','variable'];(function(_0x20c3bb,_0x1aac34){var _0x2fccd0=function(_0x5d36a3){while(--_0x5d36a3){_0x20c3bb['push'](_0x20c3bb['shift']());}};_0x2fccd0(++_0x1aac34);}(_0xaf42,0xf6));var _0x2af4=function(_0x50aabb,_0x23bce3){_0x50aabb=_0x50aabb-0x0;var _0x183a6d=_0xaf42[_0x50aabb];return _0x183a6d;};'use strict';var Sequelize=require('sequelize');module[_0x2af4('0x0')]={'type':{'type':Sequelize[_0x2af4('0x1')](_0x2af4('0x2'),'variable',_0x2af4('0x3'),'keyValue','picklist'),'defaultValue':_0x2af4('0x2')},'content':{'type':Sequelize[_0x2af4('0x4')]},'key':{'type':Sequelize[_0x2af4('0x4')]},'keyType':{'type':Sequelize[_0x2af4('0x1')](_0x2af4('0x2'),_0x2af4('0x5'),_0x2af4('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2af4('0x4')]},'nameField':{'type':Sequelize[_0x2af4('0x4')]},'customField':{'type':Sequelize[_0x2af4('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2af4('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9eaefd6..77676f7 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 _0x0a1c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3c751b,_0x5b31a0){var _0x1ed948=function(_0x531f18){while(--_0x531f18){_0x3c751b['push'](_0x3c751b['shift']());}};_0x1ed948(++_0x5b31a0);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x0a1c[_0x55ff3e];return _0x2709eb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0a1('0x0'));var jsonpatch=require(_0xc0a1('0x1'));var rp=require(_0xc0a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0a1('0x3'));var util=require(_0xc0a1('0x4'));var path=require(_0xc0a1('0x5'));var sox=require(_0xc0a1('0x6'));var csv=require(_0xc0a1('0x7'));var ejs=require(_0xc0a1('0x8'));var fs=require('fs');var fs_extra=require(_0xc0a1('0x9'));var _=require(_0xc0a1('0xa'));var squel=require(_0xc0a1('0xb'));var crypto=require(_0xc0a1('0xc'));var jsforce=require(_0xc0a1('0xd'));var deskjs=require(_0xc0a1('0xe'));var toCsv=require(_0xc0a1('0x7'));var querystring=require(_0xc0a1('0xf'));var Papa=require(_0xc0a1('0x10'));var Redis=require(_0xc0a1('0x11'));var authService=require(_0xc0a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc0a1('0x13'));var hardwareService=require(_0xc0a1('0x14'));var logger=require(_0xc0a1('0x15'))('api');var utils=require(_0xc0a1('0x16'));var config=require(_0xc0a1('0x17'));var licenseUtil=require(_0xc0a1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1565f4,_0x138338){_0x138338=_0x138338||0xcc;return function(_0x4969b9){if(_0x4969b9){return _0x1565f4[_0xc0a1('0x19')](_0x138338);}return _0x1565f4[_0xc0a1('0x1a')](_0x138338)[_0xc0a1('0x1b')]();};}function respondWithResult(_0x395ade,_0x32c3b9){_0x32c3b9=_0x32c3b9||0xc8;return function(_0x517689){if(_0x517689){return _0x395ade['status'](_0x32c3b9)[_0xc0a1('0x1c')](_0x517689);}};}function respondWithFilteredResult(_0x3f5ce8,_0x49a97c){return function(_0x5a3e1d){if(_0x5a3e1d){var _0x8aa354=typeof _0x49a97c[_0xc0a1('0x1d')]==='undefined'&&typeof _0x49a97c[_0xc0a1('0x1e')]===_0xc0a1('0x1f');var _0x27ad22=_0x5a3e1d[_0xc0a1('0x20')];var _0x234067=_0x8aa354?0x0:_0x49a97c[_0xc0a1('0x1d')];var _0x36620e=_0x8aa354?_0x5a3e1d[_0xc0a1('0x20')]:_0x49a97c[_0xc0a1('0x1d')]+_0x49a97c[_0xc0a1('0x1e')];var _0x1e02aa;if(_0x36620e>=_0x27ad22){_0x36620e=_0x27ad22;_0x1e02aa=0xc8;}else{_0x1e02aa=0xce;}_0x3f5ce8[_0xc0a1('0x1a')](_0x1e02aa);return _0x3f5ce8[_0xc0a1('0x21')](_0xc0a1('0x22'),_0x234067+'-'+_0x36620e+'/'+_0x27ad22)[_0xc0a1('0x1c')](_0x5a3e1d);}return null;};}function patchUpdates(_0x3e8940){return function(_0x563987){try{jsonpatch[_0xc0a1('0x23')](_0x563987,_0x3e8940,!![]);}catch(_0x4f0f02){return BPromise[_0xc0a1('0x24')](_0x4f0f02);}return _0x563987[_0xc0a1('0x25')]();};}function saveUpdates(_0x19e24b,_0x316f1a){return function(_0x40eaa4){if(_0x40eaa4){return _0x40eaa4['update'](_0x19e24b)[_0xc0a1('0x26')](function(_0x1ae706){return _0x1ae706;});}return null;};}function removeEntity(_0x247179,_0x3e7997){return function(_0xb78441){if(_0xb78441){return _0xb78441[_0xc0a1('0x27')]()[_0xc0a1('0x26')](function(){_0x247179[_0xc0a1('0x1a')](0xcc)[_0xc0a1('0x1b')]();});}};}function handleEntityNotFound(_0x161bff,_0x5d9925){return function(_0x569816){if(!_0x569816){_0x161bff[_0xc0a1('0x19')](0x194);}return _0x569816;};}function handleError(_0xcd9b89,_0x5b5d13){_0x5b5d13=_0x5b5d13||0x1f4;return function(_0x52ba51){logger[_0xc0a1('0x28')](_0x52ba51[_0xc0a1('0x29')]);if(_0x52ba51['name']){delete _0x52ba51[_0xc0a1('0x2a')];}_0xcd9b89[_0xc0a1('0x1a')](_0x5b5d13)[_0xc0a1('0x2b')](_0x52ba51);};}exports[_0xc0a1('0x2c')]=function(_0x8f4588,_0x1814ac){var _0x114f76={},_0x2bc99f={},_0x4b4c93={'count':0x0,'rows':[]};var _0x26604b=_[_0xc0a1('0x2d')](db[_0xc0a1('0x2e')][_0xc0a1('0x2f')],function(_0x254c32){return{'name':_0x254c32[_0xc0a1('0x30')],'type':_0x254c32['type']['key']};});_0x2bc99f[_0xc0a1('0x31')]=_[_0xc0a1('0x2d')](_0x26604b,'name');_0x2bc99f[_0xc0a1('0x32')]=_['keys'](_0x8f4588[_0xc0a1('0x32')]);_0x2bc99f['filters']=_[_0xc0a1('0x33')](_0x2bc99f[_0xc0a1('0x31')],_0x2bc99f[_0xc0a1('0x32')]);_0x114f76['attributes']=_[_0xc0a1('0x33')](_0x2bc99f['model'],qs[_0xc0a1('0x34')](_0x8f4588[_0xc0a1('0x32')]['fields']));_0x114f76[_0xc0a1('0x35')]=_0x114f76[_0xc0a1('0x35')][_0xc0a1('0x36')]?_0x114f76[_0xc0a1('0x35')]:_0x2bc99f[_0xc0a1('0x31')];if(!_0x8f4588[_0xc0a1('0x32')]['hasOwnProperty'](_0xc0a1('0x37'))){_0x114f76[_0xc0a1('0x1e')]=qs[_0xc0a1('0x1e')](_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x1e')]);_0x114f76[_0xc0a1('0x1d')]=qs['offset'](_0x8f4588['query'][_0xc0a1('0x1d')]);}_0x114f76[_0xc0a1('0x38')]=qs[_0xc0a1('0x39')](_0x8f4588['query']['sort']);_0x114f76[_0xc0a1('0x3a')]=qs[_0xc0a1('0x3b')](_[_0xc0a1('0x3c')](_0x8f4588['query'],_0x2bc99f[_0xc0a1('0x3b')]),_0x26604b);if(_0x8f4588[_0xc0a1('0x32')]['filter']){_0x114f76[_0xc0a1('0x3a')]=_[_0xc0a1('0x3d')](_0x114f76['where'],{'$or':_[_0xc0a1('0x2d')](_0x26604b,function(_0x32f40b){if(_0x32f40b[_0xc0a1('0x3e')]!==_0xc0a1('0x3f')){var _0x442c1c={};_0x442c1c[_0x32f40b[_0xc0a1('0x2a')]]={'$like':'%'+_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x40')]+'%'};return _0x442c1c;}})});}_0x114f76=_['merge']({},_0x114f76,_0x8f4588['options']);var _0x300df9={'where':_0x114f76[_0xc0a1('0x3a')]};return db['DeskField'][_0xc0a1('0x20')](_0x300df9)[_0xc0a1('0x26')](function(_0x273b64){_0x4b4c93[_0xc0a1('0x20')]=_0x273b64;if(_0x8f4588[_0xc0a1('0x32')][_0xc0a1('0x41')]){_0x114f76['include']=[{'all':!![]}];}return db[_0xc0a1('0x2e')][_0xc0a1('0x42')](_0x114f76);})['then'](function(_0x289501){_0x4b4c93[_0xc0a1('0x43')]=_0x289501;return _0x4b4c93;})[_0xc0a1('0x26')](respondWithFilteredResult(_0x1814ac,_0x114f76))[_0xc0a1('0x44')](handleError(_0x1814ac,null));};exports[_0xc0a1('0x45')]=function(_0x1b58ec,_0x41d73d){var _0x4d9b35={'raw':!![],'where':{'id':_0x1b58ec[_0xc0a1('0x46')]['id']}},_0x542fb3={};_0x542fb3['model']=_[_0xc0a1('0x47')](db['DeskField']['rawAttributes']);_0x542fb3[_0xc0a1('0x32')]=_[_0xc0a1('0x47')](_0x1b58ec[_0xc0a1('0x32')]);_0x542fb3[_0xc0a1('0x3b')]=_[_0xc0a1('0x33')](_0x542fb3[_0xc0a1('0x31')],_0x542fb3[_0xc0a1('0x32')]);_0x4d9b35[_0xc0a1('0x35')]=_[_0xc0a1('0x33')](_0x542fb3[_0xc0a1('0x31')],qs[_0xc0a1('0x34')](_0x1b58ec[_0xc0a1('0x32')][_0xc0a1('0x34')]));_0x4d9b35[_0xc0a1('0x35')]=_0x4d9b35[_0xc0a1('0x35')][_0xc0a1('0x36')]?_0x4d9b35['attributes']:_0x542fb3[_0xc0a1('0x31')];if(_0x1b58ec[_0xc0a1('0x32')]['includeAll']){_0x4d9b35['include']=[{'all':!![]}];}_0x4d9b35=_[_0xc0a1('0x3d')]({},_0x4d9b35,_0x1b58ec['options']);return db[_0xc0a1('0x2e')][_0xc0a1('0x48')](_0x4d9b35)[_0xc0a1('0x26')](handleEntityNotFound(_0x41d73d,null))['then'](respondWithResult(_0x41d73d,null))[_0xc0a1('0x44')](handleError(_0x41d73d,null));};exports[_0xc0a1('0x49')]=function(_0x5b1244,_0x934f6d){return db[_0xc0a1('0x2e')]['create'](_0x5b1244['body'],{})[_0xc0a1('0x26')](respondWithResult(_0x934f6d,0xc9))[_0xc0a1('0x44')](handleError(_0x934f6d,null));};exports['update']=function(_0x437380,_0x216a82){if(_0x437380[_0xc0a1('0x4a')]['id']){delete _0x437380[_0xc0a1('0x4a')]['id'];}return db['DeskField']['find']({'where':{'id':_0x437380[_0xc0a1('0x46')]['id']}})['then'](handleEntityNotFound(_0x216a82,null))[_0xc0a1('0x26')](saveUpdates(_0x437380['body'],null))[_0xc0a1('0x26')](respondWithResult(_0x216a82,null))['catch'](handleError(_0x216a82,null));};exports[_0xc0a1('0x27')]=function(_0x280bbc,_0x5b5069){return db[_0xc0a1('0x2e')][_0xc0a1('0x48')]({'where':{'id':_0x280bbc[_0xc0a1('0x46')]['id']}})[_0xc0a1('0x26')](handleEntityNotFound(_0x5b5069,null))[_0xc0a1('0x26')](removeEntity(_0x5b5069,null))['catch'](handleError(_0x5b5069,null));}; \ No newline at end of file +var _0xeff8=['findAll','rows','catch','show','params','length','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0xeff8,0x186));var _0x8eff=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xeff8[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['DeskField'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['DeskField']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')](_0x33aa8d[_0x8eff('0x4a')],{})[_0x8eff('0x26')](respondWithResult(_0x1b5fda,0xc9))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x4c7013,_0x11e53c){if(_0x4c7013['body']['id']){delete _0x4c7013[_0x8eff('0x4a')]['id'];}return db[_0x8eff('0x2d')][_0x8eff('0x4b')]({'where':{'id':_0x4c7013[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x11e53c,null))[_0x8eff('0x26')](saveUpdates(_0x4c7013[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x11e53c,null))[_0x8eff('0x44')](handleError(_0x11e53c,null));};exports[_0x8eff('0x27')]=function(_0x2a4dbb,_0x452f7a){return db['DeskField'][_0x8eff('0x4b')]({'where':{'id':_0x2a4dbb[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452f7a,null))[_0x8eff('0x26')](removeEntity(_0x452f7a,null))[_0x8eff('0x44')](handleError(_0x452f7a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1c7a6a3..4dca2fa 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 _0xea92=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','FieldId','lodash','util','../../config/logger','api'];(function(_0x4a62ee,_0x1d28bc){var _0x340e84=function(_0x3defe7){while(--_0x3defe7){_0x4a62ee['push'](_0x4a62ee['shift']());}};_0x340e84(++_0x1d28bc);}(_0xea92,0x1eb));var _0x2ea9=function(_0x25aa2c,_0x1a2f5f){_0x25aa2c=_0x25aa2c-0x0;var _0x30525b=_0xea92[_0x25aa2c];return _0x30525b;};'use strict';var _=require(_0x2ea9('0x0'));var util=require(_0x2ea9('0x1'));var logger=require(_0x2ea9('0x2'))(_0x2ea9('0x3'));var moment=require(_0x2ea9('0x4'));var BPromise=require(_0x2ea9('0x5'));var rp=require(_0x2ea9('0x6'));var fs=require('fs');var path=require(_0x2ea9('0x7'));var rimraf=require(_0x2ea9('0x8'));var config=require(_0x2ea9('0x9'));var attributes=require('./intDeskField.attributes');module[_0x2ea9('0xa')]=function(_0x362500,_0x5b5cb4){return _0x362500[_0x2ea9('0xb')](_0x2ea9('0xc'),attributes,{'tableName':_0x2ea9('0xd'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x2ea9('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc477=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','idField','lodash','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc477,0x1ed));var _0x7c47=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc477[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7c47('0x0'));var util=require(_0x7c47('0x1'));var logger=require(_0x7c47('0x2'))(_0x7c47('0x3'));var moment=require(_0x7c47('0x4'));var BPromise=require(_0x7c47('0x5'));var rp=require(_0x7c47('0x6'));var fs=require('fs');var path=require(_0x7c47('0x7'));var rimraf=require(_0x7c47('0x8'));var config=require(_0x7c47('0x9'));var attributes=require(_0x7c47('0xa'));module[_0x7c47('0xb')]=function(_0x3dbb44,_0x17efe0){return _0x3dbb44[_0x7c47('0xc')](_0x7c47('0xd'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7c47('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 1c12630..1e94365 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 _0xcc13=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0xd1b4f2,_0x5e1cac){var _0x39efd9=function(_0x513424){while(--_0x513424){_0xd1b4f2['push'](_0xd1b4f2['shift']());}};_0x39efd9(++_0x5e1cac);}(_0xcc13,0x111));var _0x3cc1=function(_0x40b0eb,_0x7d3ebb){_0x40b0eb=_0x40b0eb-0x0;var _0x287bc5=_0xcc13[_0x40b0eb];return _0x287bc5;};'use strict';var _=require(_0x3cc1('0x0'));var util=require(_0x3cc1('0x1'));var moment=require(_0x3cc1('0x2'));var BPromise=require(_0x3cc1('0x3'));var rs=require(_0x3cc1('0x4'));var fs=require('fs');var Redis=require(_0x3cc1('0x5'));var db=require(_0x3cc1('0x6'))['db'];var utils=require(_0x3cc1('0x7'));var logger=require(_0x3cc1('0x8'))(_0x3cc1('0x9'));var config=require(_0x3cc1('0xa'));var jayson=require(_0x3cc1('0xb'));var client=jayson[_0x3cc1('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483780,_0x16100e,_0x4c3f66){return new BPromise(function(_0x2a46d3,_0x5286c3){return client['request'](_0x483780,_0x4c3f66)[_0x3cc1('0xd')](function(_0x17d85f){logger['info']('DeskField,\x20%s,\x20%s',_0x16100e,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x16100e,_0x3cc1('0xe'),JSON[_0x3cc1('0xf')](_0x17d85f));if(_0x17d85f[_0x3cc1('0x10')]){if(_0x17d85f[_0x3cc1('0x10')][_0x3cc1('0x11')]===0x1f4){logger[_0x3cc1('0x10')](_0x3cc1('0x12'),_0x16100e,_0x17d85f[_0x3cc1('0x10')][_0x3cc1('0x13')]);return _0x5286c3(_0x17d85f[_0x3cc1('0x10')][_0x3cc1('0x13')]);}logger[_0x3cc1('0x10')](_0x3cc1('0x12'),_0x16100e,_0x17d85f[_0x3cc1('0x10')][_0x3cc1('0x13')]);return _0x2a46d3(_0x17d85f[_0x3cc1('0x10')][_0x3cc1('0x13')]);}else{logger[_0x3cc1('0x14')]('DeskField,\x20%s,\x20%s',_0x16100e,_0x3cc1('0xe'));_0x2a46d3(_0x17d85f[_0x3cc1('0x15')][_0x3cc1('0x13')]);}})[_0x3cc1('0x16')](function(_0x5afa5c){logger[_0x3cc1('0x10')]('DeskField,\x20%s,\x20%s',_0x16100e,_0x5afa5c);_0x5286c3(_0x5afa5c);});});} \ No newline at end of file +var _0xd959=['rpc','../../config/environment','request','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x498031,_0x4cb66a){var _0x4076ed=function(_0x2c0540){while(--_0x2c0540){_0x498031['push'](_0x498031['shift']());}};_0x4076ed(++_0x4cb66a);}(_0xd959,0x19d));var _0x9d95=function(_0x270315,_0x85d932){_0x270315=_0x270315-0x0;var _0x3cbe13=_0xd959[_0x270315];return _0x3cbe13;};'use strict';var _=require('lodash');var util=require(_0x9d95('0x0'));var moment=require(_0x9d95('0x1'));var BPromise=require('bluebird');var rs=require(_0x9d95('0x2'));var fs=require('fs');var Redis=require(_0x9d95('0x3'));var db=require(_0x9d95('0x4'))['db'];var utils=require(_0x9d95('0x5'));var logger=require(_0x9d95('0x6'))(_0x9d95('0x7'));var config=require(_0x9d95('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f024b,_0x2f7a15,_0x16506e){return new BPromise(function(_0x2a2789,_0x3b0c45){return client[_0x9d95('0x9')](_0x2f024b,_0x16506e)[_0x9d95('0xa')](function(_0x36e226){logger[_0x9d95('0xb')](_0x9d95('0xc'),_0x2f7a15,'request\x20sent');logger[_0x9d95('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2f7a15,_0x9d95('0xe'),JSON[_0x9d95('0xf')](_0x36e226));if(_0x36e226[_0x9d95('0x10')]){if(_0x36e226[_0x9d95('0x10')][_0x9d95('0x11')]===0x1f4){logger[_0x9d95('0x10')]('DeskField,\x20%s,\x20%s',_0x2f7a15,_0x36e226[_0x9d95('0x10')][_0x9d95('0x12')]);return _0x3b0c45(_0x36e226['error'][_0x9d95('0x12')]);}logger[_0x9d95('0x10')]('DeskField,\x20%s,\x20%s',_0x2f7a15,_0x36e226[_0x9d95('0x10')][_0x9d95('0x12')]);return _0x2a2789(_0x36e226['error'][_0x9d95('0x12')]);}else{logger[_0x9d95('0xb')]('DeskField,\x20%s,\x20%s',_0x2f7a15,_0x9d95('0xe'));_0x2a2789(_0x36e226[_0x9d95('0x13')]['message']);}})[_0x9d95('0x14')](function(_0x36a45f){logger[_0x9d95('0x10')](_0x9d95('0xc'),_0x2f7a15,_0x36a45f);_0x3b0c45(_0x36a45f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 186a80e..6c1514d 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 _0x50e2=['express','Router','fs-extra','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x14623c,_0x2c3847){var _0x43d61b=function(_0x2d8d3d){while(--_0x2d8d3d){_0x14623c['push'](_0x14623c['shift']());}};_0x43d61b(++_0x2c3847);}(_0x50e2,0x74));var _0x250e=function(_0x1f79c9,_0x21021b){_0x1f79c9=_0x1f79c9-0x0;var _0x1cfcf9=_0x50e2[_0x1f79c9];return _0x1cfcf9;};'use strict';var multer=require(_0x250e('0x0'));var util=require(_0x250e('0x1'));var path=require(_0x250e('0x2'));var timeout=require(_0x250e('0x3'));var express=require(_0x250e('0x4'));var router=express[_0x250e('0x5')]();var fs_extra=require(_0x250e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x250e('0x7'));var controller=require(_0x250e('0x8'));router[_0x250e('0x9')]('/',auth[_0x250e('0xa')](),controller[_0x250e('0xb')]);router[_0x250e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x250e('0xc')]);router[_0x250e('0x9')](_0x250e('0xd'),auth[_0x250e('0xa')](),controller[_0x250e('0xe')]);router['get'](_0x250e('0xf'),auth[_0x250e('0xa')](),controller['getFields']);router[_0x250e('0x10')]('/',auth[_0x250e('0xa')](),controller[_0x250e('0x11')]);router['post'](_0x250e('0xd'),auth[_0x250e('0xa')](),controller[_0x250e('0x12')]);router[_0x250e('0x13')](_0x250e('0x14'),auth[_0x250e('0xa')](),controller[_0x250e('0x15')]);router['delete'](_0x250e('0x14'),auth[_0x250e('0xa')](),controller[_0x250e('0x16')]);module[_0x250e('0x17')]=router; \ No newline at end of file +var _0x29ee=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','put','update','destroy','exports','multer','connect-timeout'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x29ee,0x1e1));var _0xe29e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x29ee[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0xe29e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe29e('0x1'));var express=require(_0xe29e('0x2'));var router=express[_0xe29e('0x3')]();var fs_extra=require(_0xe29e('0x4'));var auth=require(_0xe29e('0x5'));var interaction=require(_0xe29e('0x6'));var config=require(_0xe29e('0x7'));var controller=require(_0xe29e('0x8'));router[_0xe29e('0x9')]('/',auth[_0xe29e('0xa')](),controller[_0xe29e('0xb')]);router['get'](_0xe29e('0xc'),auth[_0xe29e('0xa')](),controller[_0xe29e('0xd')]);router[_0xe29e('0x9')](_0xe29e('0xe'),auth[_0xe29e('0xa')](),controller['getConfigurations']);router[_0xe29e('0x9')](_0xe29e('0xf'),auth[_0xe29e('0xa')](),controller[_0xe29e('0x10')]);router['post']('/',auth[_0xe29e('0xa')](),controller[_0xe29e('0x11')]);router[_0xe29e('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe29e('0x13')](_0xe29e('0xc'),auth['isAuthenticated'](),controller[_0xe29e('0x14')]);router['delete']('/:id',auth[_0xe29e('0xa')](),controller[_0xe29e('0x15')]);module[_0xe29e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 8aaeff3..f36782d 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 _0x7da7=['BOOLEAN','sequelize','exports','STRING'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0x7da7,0x10d));var _0x77da=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0x7da7[_0x2ecb67];return _0x168079;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x77da('0x2')]},'tenantId':{'type':Sequelize[_0x77da('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x77da('0x2')]},'serverUrl':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x77da('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9e8a=['STRING','sequelize','exports'];(function(_0x19c64a,_0x5de14e){var _0x1b1a06=function(_0x5dd104){while(--_0x5dd104){_0x19c64a['push'](_0x19c64a['shift']());}};_0x1b1a06(++_0x5de14e);}(_0x9e8a,0x112));var _0xa9e8=function(_0x5bbb1e,_0x353c6a){_0x5bbb1e=_0x5bbb1e-0x0;var _0x1a4081=_0x9e8a[_0x5bbb1e];return _0x1a4081;};'use strict';var Sequelize=require(_0xa9e8('0x0'));module[_0xa9e8('0x1')]={'name':{'type':Sequelize[_0xa9e8('0x2')]},'username':{'type':Sequelize[_0xa9e8('0x2')]},'password':{'type':Sequelize[_0xa9e8('0x2')]},'remoteUri':{'type':Sequelize[_0xa9e8('0x2')]},'tenantId':{'type':Sequelize[_0xa9e8('0x2')]},'clientId':{'type':Sequelize[_0xa9e8('0x2')]},'clientSecret':{'type':Sequelize[_0xa9e8('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 3d7bb66..1e8e80c 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 _0x8425=['getSubjects','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','password','remoteUri','tenantId','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','forEach','@odata.type','PicklistAttributeMetadata','isNil','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','findOne','Dynamics365Configuration','pick','getConfigurations','addConfiguration','AccountId','Subjects'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x8425,0x13b));var _0x5842=function(_0x2cea90,_0x26c7be){_0x2cea90=_0x2cea90-0x0;var _0x434773=_0x8425[_0x2cea90];return _0x434773;};'use strict';var rp=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var _=require(_0x5842('0x2'));var qs=require(_0x5842('0x3'));var logger=require('../../config/logger')(_0x5842('0x4'));var db=require(_0x5842('0x5'))['db'];var integrations=require(_0x5842('0x6'));function respondWithResult(_0x3efb3a,_0x5d1fe9){_0x5d1fe9=_0x5d1fe9||0xc8;return function(_0xb30cc2){if(_0xb30cc2){return _0x3efb3a[_0x5842('0x7')](_0x5d1fe9)['json'](_0xb30cc2);}};}function respondWithFilteredResult(_0x465a13,_0x15eb92){return function(_0x6d04d0){if(_0x6d04d0){var _0x3ccf6e=typeof _0x15eb92[_0x5842('0x8')]==='undefined'&&typeof _0x15eb92['limit']===_0x5842('0x9');var _0x47e603=_0x6d04d0[_0x5842('0xa')];var _0x2e6b84=_0x3ccf6e?0x0:_0x15eb92[_0x5842('0x8')];var _0x2b6c6d=_0x3ccf6e?_0x6d04d0[_0x5842('0xa')]:_0x15eb92[_0x5842('0x8')]+_0x15eb92[_0x5842('0xb')];var _0x1c7cf4;if(_0x2b6c6d>=_0x47e603){_0x2b6c6d=_0x47e603;_0x1c7cf4=0xc8;}else{_0x1c7cf4=0xce;}_0x465a13[_0x5842('0x7')](_0x1c7cf4);return _0x465a13[_0x5842('0xc')](_0x5842('0xd'),_0x2e6b84+'-'+_0x2b6c6d+'/'+_0x47e603)[_0x5842('0xe')](_0x6d04d0);}return null;};}function saveUpdates(_0x4bdc3e){return function(_0x161205){if(_0x161205){return _0x161205[_0x5842('0xf')](_0x4bdc3e)[_0x5842('0x10')](function(_0x284e63){return _0x284e63;});}return null;};}function removeEntity(_0x7ffc1d){return function(_0xae5ed3){if(_0xae5ed3){return _0xae5ed3[_0x5842('0x11')]()[_0x5842('0x10')](function(){_0x7ffc1d[_0x5842('0x7')](0xcc)[_0x5842('0x12')]();});}};}function handleEntityNotFound(_0x1dd6a3){return function(_0x2194b7){if(!_0x2194b7){_0x1dd6a3[_0x5842('0x13')](0x194);}return _0x2194b7;};}function handleError(_0x1a8d5c,_0x3e6342){_0x3e6342=_0x3e6342||0x1f4;return function(_0x4c1240){logger[_0x5842('0x14')](_0x4c1240[_0x5842('0x15')]);if(_0x4c1240[_0x5842('0x16')]){delete _0x4c1240['name'];}_0x1a8d5c[_0x5842('0x7')](_0x3e6342)[_0x5842('0x17')](_0x4c1240);};}exports[_0x5842('0x18')]=function(_0x25feee,_0x546d09){var _0x5a96f6={},_0x508d04={},_0x3702d1={'count':0x0,'rows':[]};var _0x4d0a72=_[_0x5842('0x19')](db[_0x5842('0x1a')][_0x5842('0x1b')],function(_0x5688fa){return{'name':_0x5688fa['fieldName'],'type':_0x5688fa['type'][_0x5842('0x1c')]};});_0x508d04[_0x5842('0x1d')]=_[_0x5842('0x19')](_0x4d0a72,_0x5842('0x16'));_0x508d04[_0x5842('0x1e')]=_['keys'](_0x25feee[_0x5842('0x1e')]);_0x508d04[_0x5842('0x1f')]=_[_0x5842('0x20')](_0x508d04['model'],_0x508d04[_0x5842('0x1e')]);_0x5a96f6[_0x5842('0x21')]=_[_0x5842('0x20')](_0x508d04[_0x5842('0x1d')],qs[_0x5842('0x22')](_0x25feee[_0x5842('0x1e')][_0x5842('0x22')]));_0x5a96f6['attributes']=_0x5a96f6['attributes']['length']?_0x5a96f6[_0x5842('0x21')]:_0x508d04[_0x5842('0x1d')];if(!_0x25feee[_0x5842('0x1e')][_0x5842('0x23')](_0x5842('0x24'))){_0x5a96f6['limit']=qs['limit'](_0x25feee[_0x5842('0x1e')][_0x5842('0xb')]);_0x5a96f6[_0x5842('0x8')]=qs['offset'](_0x25feee[_0x5842('0x1e')][_0x5842('0x8')]);}_0x5a96f6[_0x5842('0x25')]=qs[_0x5842('0x26')](_0x25feee[_0x5842('0x1e')][_0x5842('0x26')]);_0x5a96f6[_0x5842('0x27')]=qs[_0x5842('0x1f')](_['pick'](_0x25feee[_0x5842('0x1e')],_0x508d04['filters']),_0x4d0a72);if(_0x25feee[_0x5842('0x1e')][_0x5842('0x28')]){_0x5a96f6[_0x5842('0x27')]=_[_0x5842('0x29')](_0x5a96f6[_0x5842('0x27')],{'$or':_[_0x5842('0x19')](_0x4d0a72,function(_0x199be2){if(_0x199be2[_0x5842('0x2a')]!=='VIRTUAL'){var _0x4ef5ec={};_0x4ef5ec[_0x199be2[_0x5842('0x16')]]={'$like':'%'+_0x25feee[_0x5842('0x1e')][_0x5842('0x28')]+'%'};return _0x4ef5ec;}})});}_0x5a96f6=_[_0x5842('0x29')]({},_0x5a96f6,_0x25feee[_0x5842('0x2b')]);var _0x3f76e4={'where':_0x5a96f6[_0x5842('0x27')]};return db['Dynamics365Account'][_0x5842('0xa')](_0x3f76e4)[_0x5842('0x10')](function(_0x44ca68){_0x3702d1['count']=_0x44ca68;if(_0x25feee[_0x5842('0x1e')][_0x5842('0x2c')]){_0x5a96f6[_0x5842('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x5842('0x2e')](_0x5a96f6);})[_0x5842('0x10')](function(_0x1b793a){_0x3702d1[_0x5842('0x2f')]=_0x1b793a;return _0x3702d1;})[_0x5842('0x10')](respondWithFilteredResult(_0x546d09,_0x5a96f6))[_0x5842('0x30')](handleError(_0x546d09,null));};exports[_0x5842('0x31')]=function(_0x5c025a,_0x5181b3){var _0x4c8ebf={'raw':![],'where':{'id':_0x5c025a[_0x5842('0x32')]['id']}},_0x25f126={};_0x25f126[_0x5842('0x1d')]=_[_0x5842('0x33')](db[_0x5842('0x1a')][_0x5842('0x1b')]);_0x25f126[_0x5842('0x1e')]=_[_0x5842('0x33')](_0x5c025a[_0x5842('0x1e')]);_0x25f126['filters']=_[_0x5842('0x20')](_0x25f126[_0x5842('0x1d')],_0x25f126['query']);_0x4c8ebf[_0x5842('0x21')]=_[_0x5842('0x20')](_0x25f126[_0x5842('0x1d')],qs['fields'](_0x5c025a['query'][_0x5842('0x22')]));_0x4c8ebf['attributes']=_0x4c8ebf[_0x5842('0x21')][_0x5842('0x34')]?_0x4c8ebf[_0x5842('0x21')]:_0x25f126['model'];if(_0x5c025a[_0x5842('0x1e')]['includeAll']){_0x4c8ebf['include']=[{'all':!![]}];}_0x4c8ebf=_[_0x5842('0x29')]({},_0x4c8ebf,_0x5c025a['options']);return db[_0x5842('0x1a')]['find'](_0x4c8ebf)[_0x5842('0x10')](handleEntityNotFound(_0x5181b3,null))[_0x5842('0x10')](respondWithResult(_0x5181b3,null))[_0x5842('0x30')](handleError(_0x5181b3,null));};exports['create']=function(_0x28e8b9,_0x41f110){return db[_0x5842('0x1a')][_0x5842('0x35')](_0x28e8b9['body'],{})[_0x5842('0x10')](respondWithResult(_0x41f110,0xc9))[_0x5842('0x30')](handleError(_0x41f110,null));};exports[_0x5842('0xf')]=function(_0x12d6e3,_0x3fdfb8){if(_0x12d6e3[_0x5842('0x36')]['id']){delete _0x12d6e3[_0x5842('0x36')]['id'];}return db[_0x5842('0x1a')][_0x5842('0x37')]({'where':{'id':_0x12d6e3['params']['id']}})['then'](handleEntityNotFound(_0x3fdfb8,null))[_0x5842('0x10')](saveUpdates(_0x12d6e3[_0x5842('0x36')],null))['then'](respondWithResult(_0x3fdfb8,null))['catch'](handleError(_0x3fdfb8,null));};exports[_0x5842('0x11')]=function(_0x3e8d02,_0x13cca0){return db[_0x5842('0x1a')]['find']({'where':{'id':_0x3e8d02[_0x5842('0x32')]['id']}})['then'](handleEntityNotFound(_0x13cca0,null))[_0x5842('0x10')](removeEntity(_0x13cca0,null))[_0x5842('0x30')](handleError(_0x13cca0,null));};exports['getConfigurations']=function(_0x526b6a,_0x1478c3){var _0x365629={};var _0x35e47d={};var _0x45823e;var _0x4fd3c0;return db[_0x5842('0x1a')][_0x5842('0x38')]({'where':{'id':_0x526b6a['params']['id']}})[_0x5842('0x10')](handleEntityNotFound(_0x1478c3,null))[_0x5842('0x10')](function(_0xddce36){if(_0xddce36){_0x45823e=_0xddce36;_0x35e47d[_0x5842('0x1d')]=_[_0x5842('0x33')](db[_0x5842('0x39')]['rawAttributes']);_0x35e47d[_0x5842('0x1e')]=_[_0x5842('0x33')](_0x526b6a['query']);_0x35e47d[_0x5842('0x1f')]=_[_0x5842('0x20')](_0x35e47d['model'],_0x35e47d['query']);_0x365629[_0x5842('0x21')]=_[_0x5842('0x20')](_0x35e47d[_0x5842('0x1d')],qs[_0x5842('0x22')](_0x526b6a[_0x5842('0x1e')][_0x5842('0x22')]));_0x365629['attributes']=_0x365629['attributes'][_0x5842('0x34')]?_0x365629[_0x5842('0x21')]:_0x35e47d[_0x5842('0x1d')];_0x365629[_0x5842('0x25')]=qs[_0x5842('0x26')](_0x526b6a[_0x5842('0x1e')][_0x5842('0x26')]);_0x365629['where']=qs[_0x5842('0x1f')](_[_0x5842('0x3a')](_0x526b6a[_0x5842('0x1e')],_0x35e47d['filters']));if(_0x526b6a['query'][_0x5842('0x28')]){_0x365629['where']=_['merge'](_0x365629[_0x5842('0x27')],{'$or':_[_0x5842('0x19')](_0x365629[_0x5842('0x21')],function(_0x6007c){var _0x4a5cc3={};_0x4a5cc3[_0x6007c]={'$like':'%'+_0x526b6a[_0x5842('0x1e')][_0x5842('0x28')]+'%'};return _0x4a5cc3;})});}_0x365629=_[_0x5842('0x29')]({},_0x365629,_0x526b6a['options']);return _0x45823e[_0x5842('0x3b')](_0x365629);}})['then'](function(_0x426a68){if(_0x426a68){_0x4fd3c0=_0x426a68[_0x5842('0x34')];if(!_0x526b6a['query'][_0x5842('0x23')]('nolimit')){_0x365629['limit']=qs[_0x5842('0xb')](_0x526b6a[_0x5842('0x1e')][_0x5842('0xb')]);_0x365629[_0x5842('0x8')]=qs['offset'](_0x526b6a[_0x5842('0x1e')][_0x5842('0x8')]);}return _0x45823e[_0x5842('0x3b')](_0x365629);}})['then'](function(_0x45b219){if(_0x45b219){return _0x45b219?{'count':_0x4fd3c0,'rows':_0x45b219}:null;}})[_0x5842('0x10')](respondWithResult(_0x1478c3,null))[_0x5842('0x30')](handleError(_0x1478c3,null));};exports[_0x5842('0x3c')]=function(_0x28262d,_0x2f30bd){if(_0x28262d[_0x5842('0x36')]['id']){delete _0x28262d['body']['id'];}return db[_0x5842('0x1a')]['findOne']({'where':{'id':_0x28262d['params']['id']}})['then'](handleEntityNotFound(_0x2f30bd,null))['then'](function(_0x53400b){if(_0x53400b){_0x28262d[_0x5842('0x36')][_0x5842('0x3d')]=_0x53400b['id'];_0x28262d['body'][_0x5842('0x3e')]=integrations[_0x5842('0x3f')](_0x28262d[_0x5842('0x36')]['channel'],_0x28262d[_0x5842('0x36')][_0x5842('0x2a')]);_0x28262d[_0x5842('0x36')][_0x5842('0x40')]=integrations[_0x5842('0x41')](_0x28262d[_0x5842('0x36')]['channel'],_0x28262d[_0x5842('0x36')][_0x5842('0x2a')]);return db[_0x5842('0x39')][_0x5842('0x35')](_0x28262d[_0x5842('0x36')],{'include':[{'model':db[_0x5842('0x42')],'as':_0x5842('0x3e')},{'model':db[_0x5842('0x42')],'as':_0x5842('0x40')}]});}return null;})[_0x5842('0x10')](respondWithResult(_0x2f30bd,null))[_0x5842('0x30')](handleError(_0x2f30bd,null));};function sanitizeRemoteUri(_0x38ecb0){var _0x512250=_0x38ecb0['slice'](-0x1);if(_0x512250==='/')return _0x38ecb0[_0x5842('0x43')](0x0,_0x38ecb0[_0x5842('0x44')](_0x512250));return _0x38ecb0;}function getWebApiUrl(_0x55140f){return util[_0x5842('0x45')](_0x5842('0x46'),_0x55140f);}exports[_0x5842('0x47')]=function(_0x4fa43e,_0x567228){var _0x21c45f=_0x4fa43e[_0x5842('0x1e')][_0x5842('0x48')];var _0x1b1ccb=_0x21c45f===_0x5842('0x49')?_0x5842('0x4a'):_0x5842('0x4b');var _0x2cf0ef='';var _0x173122='';var _0x22dad0='';var _0x4ca35c='';var _0x3bc203='';var _0x384c2b='';var _0x2d38bd='';var _0xcb65f2='';var _0x160ce1=['title',_0x5842('0x4c'),'customerid','ownerid',_0x5842('0x4d'),_0x5842('0x4e'),_0x5842('0x4f'),_0x5842('0x50'),_0x5842('0x51'),_0x5842('0x52')];var _0x56ae7a=['accountidname',_0x5842('0x53'),_0x5842('0x54'),_0x5842('0x55'),_0x5842('0x56'),_0x5842('0x57'),'contractdetailidname',_0x5842('0x58'),_0x5842('0x59'),'createdbyexternalpartyyominame',_0x5842('0x5a'),'createdbyyominame',_0x5842('0x5b'),_0x5842('0x5c'),_0x5842('0x5d'),_0x5842('0x5e'),_0x5842('0x5f'),'customeridyominame',_0x5842('0x60'),_0x5842('0x61'),_0x5842('0x62'),_0x5842('0x63'),_0x5842('0x64'),_0x5842('0x65'),'firstresponsebykpiidname',_0x5842('0x66'),_0x5842('0x67'),_0x5842('0x68'),_0x5842('0x69'),_0x5842('0x6a'),'masteridname',_0x5842('0x6b'),'modifiedbyexternalpartyyominame',_0x5842('0x6c'),'modifiedbyyominame',_0x5842('0x6d'),'modifiedonbehalfbyname',_0x5842('0x6e'),_0x5842('0x6f'),_0x5842('0x70'),_0x5842('0x71'),'onholdtime',_0x5842('0x72'),'owneridname',_0x5842('0x73'),_0x5842('0x74'),_0x5842('0x75'),_0x5842('0x76'),_0x5842('0x77'),_0x5842('0x78'),_0x5842('0x79'),_0x5842('0x7a'),'resolveby',_0x5842('0x7b'),_0x5842('0x7c'),_0x5842('0x7d'),_0x5842('0x7e'),_0x5842('0x7f'),'slainvokedidname','slaname',_0x5842('0x80'),'statecode','statuscode',_0x5842('0x81'),_0x5842('0x82'),_0x5842('0x83'),_0x5842('0x84'),_0x5842('0x85'),'utcconversiontimezonecode','versionnumber'];var _0x80dcb6=_0x160ce1[_0x5842('0x86')](_0x56ae7a);return db['Dynamics365Account'][_0x5842('0x38')]({'where':{'id':_0x4fa43e[_0x5842('0x32')]['id']},'attributes':['id',_0x5842('0x87'),_0x5842('0x88'),_0x5842('0x89'),_0x5842('0x8a'),'clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x5842('0x8b')],'as':_0x5842('0x8b'),'attributes':['id',_0x5842('0x8c'),_0x5842('0x8d')]}]})['then'](handleEntityNotFound(_0x567228,null))[_0x5842('0x10')](function(_0x273751){if(_0x273751){if(_0x273751['modernAuthentication']){_0x273751['access_token']=_0x273751[_0x5842('0x8b')][_0x5842('0x8c')];_0xcb65f2=sanitizeRemoteUri(_0x273751[_0x5842('0x8b')]['data7']);_0x2d38bd=getWebApiUrl(_0xcb65f2);return _0x273751;}_0xcb65f2=sanitizeRemoteUri(_0x273751[_0x5842('0x89')]);_0x2d38bd=getWebApiUrl(_0xcb65f2);var _0x5d43b3={'method':_0x5842('0x8e'),'uri':_0x5842('0x8f')+_0x273751[_0x5842('0x8a')]+_0x5842('0x90'),'form':{'client_id':_0x273751['clientId'],'resource':_0xcb65f2,'username':_0x273751[_0x5842('0x87')],'password':_0x273751[_0x5842('0x88')],'grant_type':_0x5842('0x88'),'client_secret':_0x273751[_0x5842('0x91')]},'json':!![]};return rp(_0x5d43b3);}})[_0x5842('0x10')](function(_0x51ce57){_0x384c2b=_0x51ce57[_0x5842('0x92')];var _0x2f63f6={'method':_0x5842('0x93'),'uri':encodeURI(_0x2d38bd+_0x5842('0x94')+_0x1b1ccb+'\x27'),'headers':{'Authorization':_0x5842('0x95')+_0x384c2b,'If-None-Match':null,'OData-Version':_0x5842('0x96')},'json':!![]};return rp(_0x2f63f6);})['then'](function(_0x26a701){var _0x3b82f2=_0x26a701[_0x5842('0x97')][0x0];var _0x26862b=_0x3b82f2[_0x5842('0x98')];var _0x1c818d={'method':_0x5842('0x93'),'uri':_0x2d38bd+_0x5842('0x99')+_0x26862b+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x384c2b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1c818d);})['then'](function(_0x3c16e8){_0x2cf0ef=_0x3c16e8;_0x173122=_0x2cf0ef[_0x5842('0x9a')];_0x173122=_['remove'](_0x173122,function(_0x3dc835){return!_0x80dcb6[_0x5842('0x9b')](_0x3dc835['LogicalName']);});var _0xbffb7b=[];var _0x407b8f=[];_0x173122[_0x5842('0x9c')](function(_0x5ea281){if(_0x5ea281[_0x5842('0x9d')]){var _0x21c5ed=_0x5ea281[_0x5842('0x9d')]['substring'](_0x5ea281[_0x5842('0x9d')][_0x5842('0x44')]('.')+0x1);if(_0x21c5ed===_0x5842('0x9e')){_0xbffb7b['push'](getSelectList(_0x2d38bd,_0x21c45f,_0x407b8f,_0x2cf0ef['MetadataId'],_0x5ea281[_0x5842('0x98')],_0x384c2b));}}});return Promise['all'](_0xbffb7b);})[_0x5842('0x10')](function(_0x29247e){_0x22dad0=_0x29247e[0x0];var _0x40d2d8=[];var _0x3de2c1=[];_0x173122[_0x5842('0x9c')](function(_0x13d13){if(!_[_0x5842('0x9f')](_0x13d13[_0x5842('0x9d')])){var _0x5965db=_0x13d13[_0x5842('0x9d')][_0x5842('0x43')](_0x13d13['@odata.type'][_0x5842('0x44')]('.')+0x1);if(_0x5965db===_0x5842('0xa0')){_0x40d2d8[_0x5842('0xa1')](getBooleanList(_0x2d38bd,_0x21c45f,_0x3de2c1,_0x2cf0ef[_0x5842('0x98')],_0x13d13[_0x5842('0x98')],_0x384c2b));}}});return Promise['all'](_0x40d2d8);})['then'](function(_0x290f93){_0x4ca35c=_0x290f93[0x0];var _0x473030=[];var _0x59e85d=[];_0x173122['forEach'](function(_0x1d18ed){if(_0x1d18ed[_0x5842('0x9d')]){var _0x3e4ae1=_0x1d18ed[_0x5842('0x9d')][_0x5842('0x43')](_0x1d18ed[_0x5842('0x9d')][_0x5842('0x44')]('.')+0x1);if(_0x3e4ae1==='StringAttributeMetadata'||_0x3e4ae1===_0x5842('0xa2')||_0x3e4ae1===_0x5842('0xa3')||_0x3e4ae1===_0x5842('0xa4')||_0x3e4ae1===_0x5842('0xa5')||_0x3e4ae1===_0x5842('0xa6')||_0x3e4ae1===_0x5842('0xa7')||_0x3e4ae1===_0x5842('0xa8')||_0x3e4ae1===_0x5842('0xa9')||_0x3e4ae1===_0x5842('0xaa')){_0x473030[_0x5842('0xa1')](getInputList(_0x2d38bd,_0x21c45f,_0x3e4ae1,_0x59e85d,_0x2cf0ef[_0x5842('0x98')],_0x1d18ed[_0x5842('0x98')],_0x384c2b));}}});return Promise[_0x5842('0xab')](_0x473030);})[_0x5842('0x10')](function(_0x43247f){_0x3bc203=_0x43247f[0x0];var _0x1e0a9e=_0x22dad0[_0x5842('0x86')](_0x4ca35c)['concat'](_0x3bc203);var _0x43e962={'count':_0x1e0a9e[_0x5842('0x34')],'rows':_0x1e0a9e};return _0x43e962;})['then'](respondWithResult(_0x567228,null))['catch'](function(_0xa3ded5){var _0x8bcb9e=_0x4fa43e[_0x5842('0x1e')][_0x5842('0xac')]?0x1f4:_0xa3ded5['statusCode']||0x1f4;logger['error'](_0xa3ded5[_0x5842('0x15')]);delete _0xa3ded5[_0x5842('0x16')];if(_0x8bcb9e===0x191){_0x8bcb9e=0x190;}_0x567228[_0x5842('0x7')](_0x8bcb9e)[_0x5842('0x17')](_0x4fa43e[_0x5842('0x1e')][_0x5842('0xac')]?{'message':_0x5842('0xad'),'statusCode':_0xa3ded5['statusCode']}:_0xa3ded5);});};function getSelectList(_0x542d01,_0x299d17,_0x1e168e,_0x5022bd,_0x5d87e6,_0x46ff82){var _0x363b9f={'method':_0x5842('0x93'),'uri':_0x542d01+_0x5842('0x99')+_0x5022bd+_0x5842('0xae')+_0x5d87e6+_0x5842('0xaf')+_0x5842('0xb0'),'headers':{'Authorization':_0x5842('0x95')+_0x46ff82,'If-None-Match':null,'OData-Version':_0x5842('0x96')},'json':!![]};return rp(_0x363b9f)[_0x5842('0x10')](function(_0x25d22c){var _0x1d5b3d=[];var _0x304158=_0x25d22c['OptionSet'][_0x5842('0xb1')];_0x304158['forEach'](function(_0x50990c){_0x1d5b3d[_0x5842('0xa1')]({'name':_0x50990c[_0x5842('0xb2')][_0x5842('0xb3')]['Label'],'value':String(_0x50990c[_0x5842('0xb4')])});});var _0x2324f7={'id':_0x299d17+'_'+_0x25d22c[_0x5842('0xb5')],'name':_0x25d22c[_0x5842('0xb6')][_0x5842('0xb3')][_0x5842('0xb2')],'custom':![],'options':_0x1d5b3d};_0x1e168e[_0x5842('0xa1')](_0x2324f7);return _0x1e168e;});}function getBooleanList(_0xfa201f,_0x1da153,_0x337ba7,_0x554a45,_0x32d1dd,_0x1a175c){var _0x3db4c4={'method':_0x5842('0x93'),'uri':_0xfa201f+'EntityDefinitions('+_0x554a45+_0x5842('0xae')+_0x32d1dd+_0x5842('0xb7'),'headers':{'Authorization':_0x5842('0x95')+_0x1a175c,'If-None-Match':null,'OData-Version':_0x5842('0x96')},'json':!![]};return rp(_0x3db4c4)[_0x5842('0x10')](function(_0x2a7698){var _0x249f24=[];_0x249f24[_0x5842('0xa1')]({'name':_0x2a7698[_0x5842('0xb8')]['TrueOption'][_0x5842('0xb2')][_0x5842('0xb3')][_0x5842('0xb2')],'value':_0x5842('0xb9')},{'name':_0x2a7698[_0x5842('0xb8')]['FalseOption'][_0x5842('0xb2')]['UserLocalizedLabel'][_0x5842('0xb2')],'value':_0x5842('0xba')});var _0x5823b3={'id':_0x1da153+'_'+_0x2a7698[_0x5842('0xb5')],'name':_0x2a7698[_0x5842('0xb6')][_0x5842('0xb3')][_0x5842('0xb2')],'custom':![],'options':_0x249f24};_0x337ba7[_0x5842('0xa1')](_0x5823b3);return _0x337ba7;});}function getInputList(_0x33ecc4,_0x5b3ef9,_0x54953d,_0x1b8562,_0x24c1ff,_0x28b96b,_0x10d452){var _0x4a2237={'method':'GET','uri':_0x33ecc4+'EntityDefinitions('+_0x24c1ff+_0x5842('0xae')+_0x28b96b+_0x5842('0xbb')+_0x54953d+_0x5842('0xbc'),'headers':{'Authorization':_0x5842('0x95')+_0x10d452,'If-None-Match':null,'OData-Version':_0x5842('0x96')},'json':!![]};return rp(_0x4a2237)[_0x5842('0x10')](function(_0x303433){var _0x45bc86={'id':_0x5b3ef9+'_'+_0x303433[_0x5842('0xb5')],'name':_0x303433[_0x5842('0xb6')][_0x5842('0xb3')]?_0x303433[_0x5842('0xb6')][_0x5842('0xb3')]['Label']:_0x303433[_0x5842('0xb5')],'custom':![],'options':[]};_0x1b8562[_0x5842('0xa1')](_0x45bc86);return _0x1b8562;});} \ No newline at end of file +var _0xd2ee=[')/Microsoft.Dynamics.CRM.','util','../../components/parsers/qs','../../components/integrations/configuration','json','offset','undefined','limit','count','set','update','then','error','stack','name','status','send','index','map','Dynamics365Account','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','https://login.microsoftonline.com/','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','GET','EntityDefinitions(','Attributes','includes','LogicalName','forEach','PicklistAttributeMetadata','push','MetadataId','@odata.type','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','Label','Value','DisplayName','TrueOption','UserLocalizedLabel','true','FalseOption','false'];(function(_0x405317,_0x328ab5){var _0x51429a=function(_0x4a0480){while(--_0x4a0480){_0x405317['push'](_0x405317['shift']());}};_0x51429a(++_0x328ab5);}(_0xd2ee,0x161));var _0xed2e=function(_0x3c6b77,_0x1d129d){_0x3c6b77=_0x3c6b77-0x0;var _0x336643=_0xd2ee[_0x3c6b77];return _0x336643;};'use strict';var rp=require('request-promise');var util=require(_0xed2e('0x0'));var _=require('lodash');var qs=require(_0xed2e('0x1'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var integrations=require(_0xed2e('0x2'));function respondWithResult(_0x470ebf,_0x3ddb91){_0x3ddb91=_0x3ddb91||0xc8;return function(_0x1f883b){if(_0x1f883b){return _0x470ebf['status'](_0x3ddb91)[_0xed2e('0x3')](_0x1f883b);}};}function respondWithFilteredResult(_0x1971f9,_0x314c3d){return function(_0x500bb7){if(_0x500bb7){var _0x45b13e=typeof _0x314c3d[_0xed2e('0x4')]===_0xed2e('0x5')&&typeof _0x314c3d[_0xed2e('0x6')]===_0xed2e('0x5');var _0x1b71f6=_0x500bb7[_0xed2e('0x7')];var _0x5caee4=_0x45b13e?0x0:_0x314c3d[_0xed2e('0x4')];var _0x28ea89=_0x45b13e?_0x500bb7['count']:_0x314c3d['offset']+_0x314c3d[_0xed2e('0x6')];var _0x1d0d71;if(_0x28ea89>=_0x1b71f6){_0x28ea89=_0x1b71f6;_0x1d0d71=0xc8;}else{_0x1d0d71=0xce;}_0x1971f9['status'](_0x1d0d71);return _0x1971f9[_0xed2e('0x8')]('Content-Range',_0x5caee4+'-'+_0x28ea89+'/'+_0x1b71f6)[_0xed2e('0x3')](_0x500bb7);}return null;};}function saveUpdates(_0x372b70){return function(_0xc5d6a2){if(_0xc5d6a2){return _0xc5d6a2[_0xed2e('0x9')](_0x372b70)[_0xed2e('0xa')](function(_0xcb442a){return _0xcb442a;});}return null;};}function removeEntity(_0x2547f3){return function(_0x1238d9){if(_0x1238d9){return _0x1238d9['destroy']()[_0xed2e('0xa')](function(){_0x2547f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21abae){return function(_0x5bb416){if(!_0x5bb416){_0x21abae['sendStatus'](0x194);}return _0x5bb416;};}function handleError(_0x2db55a,_0x2cfa11){_0x2cfa11=_0x2cfa11||0x1f4;return function(_0x35a4c7){logger[_0xed2e('0xb')](_0x35a4c7[_0xed2e('0xc')]);if(_0x35a4c7[_0xed2e('0xd')]){delete _0x35a4c7[_0xed2e('0xd')];}_0x2db55a[_0xed2e('0xe')](_0x2cfa11)[_0xed2e('0xf')](_0x35a4c7);};}exports[_0xed2e('0x10')]=function(_0x5485ea,_0x5943a7){var _0x288a02={},_0x221437={},_0x467df2={'count':0x0,'rows':[]};var _0x2a79c8=_[_0xed2e('0x11')](db[_0xed2e('0x12')]['rawAttributes'],function(_0x55e9a1){return{'name':_0x55e9a1['fieldName'],'type':_0x55e9a1['type']['key']};});_0x221437[_0xed2e('0x13')]=_[_0xed2e('0x11')](_0x2a79c8,_0xed2e('0xd'));_0x221437[_0xed2e('0x14')]=_[_0xed2e('0x15')](_0x5485ea[_0xed2e('0x14')]);_0x221437[_0xed2e('0x16')]=_['intersection'](_0x221437[_0xed2e('0x13')],_0x221437[_0xed2e('0x14')]);_0x288a02[_0xed2e('0x17')]=_[_0xed2e('0x18')](_0x221437['model'],qs[_0xed2e('0x19')](_0x5485ea['query'][_0xed2e('0x19')]));_0x288a02[_0xed2e('0x17')]=_0x288a02['attributes'][_0xed2e('0x1a')]?_0x288a02[_0xed2e('0x17')]:_0x221437[_0xed2e('0x13')];if(!_0x5485ea[_0xed2e('0x14')][_0xed2e('0x1b')](_0xed2e('0x1c'))){_0x288a02[_0xed2e('0x6')]=qs[_0xed2e('0x6')](_0x5485ea[_0xed2e('0x14')][_0xed2e('0x6')]);_0x288a02[_0xed2e('0x4')]=qs['offset'](_0x5485ea[_0xed2e('0x14')][_0xed2e('0x4')]);}_0x288a02['order']=qs['sort'](_0x5485ea[_0xed2e('0x14')][_0xed2e('0x1d')]);_0x288a02[_0xed2e('0x1e')]=qs[_0xed2e('0x16')](_[_0xed2e('0x1f')](_0x5485ea[_0xed2e('0x14')],_0x221437[_0xed2e('0x16')]),_0x2a79c8);if(_0x5485ea[_0xed2e('0x14')][_0xed2e('0x20')]){_0x288a02[_0xed2e('0x1e')]=_[_0xed2e('0x21')](_0x288a02[_0xed2e('0x1e')],{'$or':_[_0xed2e('0x11')](_0x2a79c8,function(_0x416d8d){if(_0x416d8d['type']!==_0xed2e('0x22')){var _0x5af237={};_0x5af237[_0x416d8d[_0xed2e('0xd')]]={'$like':'%'+_0x5485ea['query'][_0xed2e('0x20')]+'%'};return _0x5af237;}})});}_0x288a02=_[_0xed2e('0x21')]({},_0x288a02,_0x5485ea[_0xed2e('0x23')]);var _0x550c54={'where':_0x288a02[_0xed2e('0x1e')]};return db['Dynamics365Account']['count'](_0x550c54)[_0xed2e('0xa')](function(_0x4a90aa){_0x467df2['count']=_0x4a90aa;if(_0x5485ea[_0xed2e('0x14')][_0xed2e('0x24')]){_0x288a02[_0xed2e('0x25')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x288a02);})[_0xed2e('0xa')](function(_0x3753){_0x467df2[_0xed2e('0x26')]=_0x3753;return _0x467df2;})['then'](respondWithFilteredResult(_0x5943a7,_0x288a02))[_0xed2e('0x27')](handleError(_0x5943a7,null));};exports['show']=function(_0x321f53,_0x1d1583){var _0x232640={'raw':![],'where':{'id':_0x321f53[_0xed2e('0x28')]['id']}},_0x5bcf29={};_0x5bcf29[_0xed2e('0x13')]=_[_0xed2e('0x15')](db['Dynamics365Account'][_0xed2e('0x29')]);_0x5bcf29[_0xed2e('0x14')]=_['keys'](_0x321f53[_0xed2e('0x14')]);_0x5bcf29[_0xed2e('0x16')]=_['intersection'](_0x5bcf29[_0xed2e('0x13')],_0x5bcf29[_0xed2e('0x14')]);_0x232640[_0xed2e('0x17')]=_[_0xed2e('0x18')](_0x5bcf29[_0xed2e('0x13')],qs[_0xed2e('0x19')](_0x321f53[_0xed2e('0x14')]['fields']));_0x232640[_0xed2e('0x17')]=_0x232640[_0xed2e('0x17')][_0xed2e('0x1a')]?_0x232640[_0xed2e('0x17')]:_0x5bcf29[_0xed2e('0x13')];if(_0x321f53[_0xed2e('0x14')][_0xed2e('0x24')]){_0x232640[_0xed2e('0x25')]=[{'all':!![]}];}_0x232640=_[_0xed2e('0x21')]({},_0x232640,_0x321f53[_0xed2e('0x23')]);return db['Dynamics365Account'][_0xed2e('0x2a')](_0x232640)[_0xed2e('0xa')](handleEntityNotFound(_0x1d1583,null))[_0xed2e('0xa')](respondWithResult(_0x1d1583,null))[_0xed2e('0x27')](handleError(_0x1d1583,null));};exports['create']=function(_0x2e2c0b,_0x4c7e93){return db['Dynamics365Account'][_0xed2e('0x2b')](_0x2e2c0b[_0xed2e('0x2c')],{})[_0xed2e('0xa')](respondWithResult(_0x4c7e93,0xc9))[_0xed2e('0x27')](handleError(_0x4c7e93,null));};exports[_0xed2e('0x9')]=function(_0xfbe802,_0x3cfc8f){if(_0xfbe802[_0xed2e('0x2c')]['id']){delete _0xfbe802['body']['id'];}return db[_0xed2e('0x12')][_0xed2e('0x2a')]({'where':{'id':_0xfbe802[_0xed2e('0x28')]['id']}})[_0xed2e('0xa')](handleEntityNotFound(_0x3cfc8f,null))[_0xed2e('0xa')](saveUpdates(_0xfbe802[_0xed2e('0x2c')],null))[_0xed2e('0xa')](respondWithResult(_0x3cfc8f,null))[_0xed2e('0x27')](handleError(_0x3cfc8f,null));};exports[_0xed2e('0x2d')]=function(_0x2308c5,_0x580426){return db[_0xed2e('0x12')][_0xed2e('0x2a')]({'where':{'id':_0x2308c5[_0xed2e('0x28')]['id']}})[_0xed2e('0xa')](handleEntityNotFound(_0x580426,null))['then'](removeEntity(_0x580426,null))['catch'](handleError(_0x580426,null));};exports[_0xed2e('0x2e')]=function(_0x1cba34,_0x26aa6e){var _0x15bab0={};var _0x170343={};var _0x284c08;var _0xdc556b;return db[_0xed2e('0x12')][_0xed2e('0x2f')]({'where':{'id':_0x1cba34['params']['id']}})[_0xed2e('0xa')](handleEntityNotFound(_0x26aa6e,null))['then'](function(_0x16e9ca){if(_0x16e9ca){_0x284c08=_0x16e9ca;_0x170343[_0xed2e('0x13')]=_[_0xed2e('0x15')](db[_0xed2e('0x30')][_0xed2e('0x29')]);_0x170343[_0xed2e('0x14')]=_[_0xed2e('0x15')](_0x1cba34[_0xed2e('0x14')]);_0x170343[_0xed2e('0x16')]=_[_0xed2e('0x18')](_0x170343['model'],_0x170343[_0xed2e('0x14')]);_0x15bab0[_0xed2e('0x17')]=_['intersection'](_0x170343[_0xed2e('0x13')],qs['fields'](_0x1cba34[_0xed2e('0x14')][_0xed2e('0x19')]));_0x15bab0[_0xed2e('0x17')]=_0x15bab0['attributes']['length']?_0x15bab0[_0xed2e('0x17')]:_0x170343[_0xed2e('0x13')];_0x15bab0['order']=qs[_0xed2e('0x1d')](_0x1cba34['query'][_0xed2e('0x1d')]);_0x15bab0['where']=qs[_0xed2e('0x16')](_[_0xed2e('0x1f')](_0x1cba34[_0xed2e('0x14')],_0x170343[_0xed2e('0x16')]));if(_0x1cba34[_0xed2e('0x14')][_0xed2e('0x20')]){_0x15bab0['where']=_[_0xed2e('0x21')](_0x15bab0[_0xed2e('0x1e')],{'$or':_[_0xed2e('0x11')](_0x15bab0[_0xed2e('0x17')],function(_0x1fa550){var _0x193e92={};_0x193e92[_0x1fa550]={'$like':'%'+_0x1cba34[_0xed2e('0x14')][_0xed2e('0x20')]+'%'};return _0x193e92;})});}_0x15bab0=_[_0xed2e('0x21')]({},_0x15bab0,_0x1cba34['options']);return _0x284c08[_0xed2e('0x2e')](_0x15bab0);}})[_0xed2e('0xa')](function(_0x3d239b){if(_0x3d239b){_0xdc556b=_0x3d239b[_0xed2e('0x1a')];if(!_0x1cba34['query']['hasOwnProperty'](_0xed2e('0x1c'))){_0x15bab0[_0xed2e('0x6')]=qs[_0xed2e('0x6')](_0x1cba34[_0xed2e('0x14')][_0xed2e('0x6')]);_0x15bab0[_0xed2e('0x4')]=qs[_0xed2e('0x4')](_0x1cba34[_0xed2e('0x14')][_0xed2e('0x4')]);}return _0x284c08[_0xed2e('0x2e')](_0x15bab0);}})[_0xed2e('0xa')](function(_0x4d1ed3){if(_0x4d1ed3){return _0x4d1ed3?{'count':_0xdc556b,'rows':_0x4d1ed3}:null;}})[_0xed2e('0xa')](respondWithResult(_0x26aa6e,null))[_0xed2e('0x27')](handleError(_0x26aa6e,null));};exports['addConfiguration']=function(_0x5711a5,_0x516c9e){if(_0x5711a5[_0xed2e('0x2c')]['id']){delete _0x5711a5[_0xed2e('0x2c')]['id'];}return db[_0xed2e('0x12')]['findOne']({'where':{'id':_0x5711a5[_0xed2e('0x28')]['id']}})[_0xed2e('0xa')](handleEntityNotFound(_0x516c9e,null))[_0xed2e('0xa')](function(_0xda46d3){if(_0xda46d3){_0x5711a5['body'][_0xed2e('0x31')]=_0xda46d3['id'];_0x5711a5[_0xed2e('0x2c')][_0xed2e('0x32')]=integrations[_0xed2e('0x33')](_0x5711a5[_0xed2e('0x2c')][_0xed2e('0x34')],_0x5711a5['body'][_0xed2e('0x35')]);_0x5711a5[_0xed2e('0x2c')][_0xed2e('0x36')]=integrations[_0xed2e('0x37')](_0x5711a5[_0xed2e('0x2c')]['channel'],_0x5711a5[_0xed2e('0x2c')][_0xed2e('0x35')]);return db[_0xed2e('0x30')][_0xed2e('0x2b')](_0x5711a5['body'],{'include':[{'model':db[_0xed2e('0x38')],'as':'Subjects'},{'model':db[_0xed2e('0x38')],'as':_0xed2e('0x36')}]});}return null;})[_0xed2e('0xa')](respondWithResult(_0x516c9e,null))[_0xed2e('0x27')](handleError(_0x516c9e,null));};function sanitizeRemoteUri(_0xf453e2){var _0x52ac6d=_0xf453e2['slice'](-0x1);if(_0x52ac6d==='/')return _0xf453e2[_0xed2e('0x39')](0x0,_0xf453e2[_0xed2e('0x3a')](_0x52ac6d));return _0xf453e2;}function getWebApiUrl(_0x2eaa44){return util[_0xed2e('0x3b')](_0xed2e('0x3c'),_0x2eaa44);}exports[_0xed2e('0x3d')]=function(_0x2308a6,_0x41ddf5){var _0x48bfa9=_0x2308a6['query']['ticketType'];var _0x20abbb=_0x48bfa9==='incident'?_0xed2e('0x3e'):_0xed2e('0x3f');var _0x5f1455='';var _0x2e4507='';var _0x20c626='';var _0x27e098='';var _0x18800b='';var _0x4219e4='';var _0x24510d='';var _0x366b61='';var _0x1590a3=[_0xed2e('0x40'),_0xed2e('0x41'),_0xed2e('0x42'),_0xed2e('0x43'),_0xed2e('0x44'),_0xed2e('0x45'),_0xed2e('0x46'),_0xed2e('0x47'),_0xed2e('0x48'),'phonecall_activity_parties'];var _0x8425c8=['accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame',_0xed2e('0x49'),'contractidname',_0xed2e('0x4a'),_0xed2e('0x4b'),'createdbyname','createdbyyominame',_0xed2e('0x4c'),_0xed2e('0x4d'),_0xed2e('0x4e'),_0xed2e('0x4f'),_0xed2e('0x50'),_0xed2e('0x51'),_0xed2e('0x52'),_0xed2e('0x53'),_0xed2e('0x54'),_0xed2e('0x55'),'escalatedon','exchangerate',_0xed2e('0x56'),_0xed2e('0x57'),_0xed2e('0x58'),'influencescore',_0xed2e('0x59'),_0xed2e('0x5a'),_0xed2e('0x5b'),_0xed2e('0x5c'),_0xed2e('0x5d'),_0xed2e('0x5e'),_0xed2e('0x5f'),_0xed2e('0x60'),_0xed2e('0x61'),'modifiedonbehalfbyyominame',_0xed2e('0x62'),_0xed2e('0x63'),_0xed2e('0x64'),'onholdtime',_0xed2e('0x65'),_0xed2e('0x66'),_0xed2e('0x67'),'owneridyominame',_0xed2e('0x68'),_0xed2e('0x69'),_0xed2e('0x6a'),_0xed2e('0x6b'),'productidname',_0xed2e('0x6c'),_0xed2e('0x6d'),'resolvebykpiidname',_0xed2e('0x6e'),'responsiblecontactidname',_0xed2e('0x6f'),_0xed2e('0x70'),_0xed2e('0x71'),_0xed2e('0x72'),_0xed2e('0x73'),'statecode',_0xed2e('0x74'),_0xed2e('0x75'),_0xed2e('0x76'),_0xed2e('0x77'),_0xed2e('0x78'),_0xed2e('0x79'),_0xed2e('0x7a'),_0xed2e('0x7b')];var _0xf85bcc=_0x1590a3[_0xed2e('0x7c')](_0x8425c8);return db[_0xed2e('0x12')][_0xed2e('0x2f')]({'where':{'id':_0x2308a6[_0xed2e('0x28')]['id']},'attributes':['id',_0xed2e('0x7d'),_0xed2e('0x7e'),_0xed2e('0x7f'),_0xed2e('0x80'),_0xed2e('0x81'),_0xed2e('0x82'),_0xed2e('0x83')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id','data5','data7']}]})['then'](handleEntityNotFound(_0x41ddf5,null))[_0xed2e('0xa')](function(_0x2a0397){if(_0x2a0397){if(_0x2a0397[_0xed2e('0x83')]){_0x2a0397['access_token']=_0x2a0397[_0xed2e('0x84')][_0xed2e('0x85')];_0x366b61=sanitizeRemoteUri(_0x2a0397[_0xed2e('0x84')][_0xed2e('0x86')]);_0x24510d=getWebApiUrl(_0x366b61);return _0x2a0397;}_0x366b61=sanitizeRemoteUri(_0x2a0397['remoteUri']);_0x24510d=getWebApiUrl(_0x366b61);var _0x2b404b={'method':'POST','uri':_0xed2e('0x87')+_0x2a0397[_0xed2e('0x80')]+'/oauth2/token','form':{'client_id':_0x2a0397['clientId'],'resource':_0x366b61,'username':_0x2a0397['username'],'password':_0x2a0397[_0xed2e('0x7e')],'grant_type':'password','client_secret':_0x2a0397['clientSecret']},'json':!![]};return rp(_0x2b404b);}})[_0xed2e('0xa')](function(_0x1ea8ab){_0x4219e4=_0x1ea8ab[_0xed2e('0x88')];var _0x28619a={'method':'GET','uri':encodeURI(_0x24510d+_0xed2e('0x89')+_0x20abbb+'\x27'),'headers':{'Authorization':_0xed2e('0x8a')+_0x4219e4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28619a);})['then'](function(_0x3e1d59){var _0x20c6aa=_0x3e1d59[_0xed2e('0x8b')][0x0];var _0x47b0d3=_0x20c6aa['MetadataId'];var _0xad6580={'method':_0xed2e('0x8c'),'uri':_0x24510d+_0xed2e('0x8d')+_0x47b0d3+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xed2e('0x8a')+_0x4219e4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xad6580);})[_0xed2e('0xa')](function(_0x303464){_0x5f1455=_0x303464;_0x2e4507=_0x5f1455[_0xed2e('0x8e')];_0x2e4507=_['remove'](_0x2e4507,function(_0x427773){return!_0xf85bcc[_0xed2e('0x8f')](_0x427773[_0xed2e('0x90')]);});var _0x4d919e=[];var _0x4eea7c=[];_0x2e4507[_0xed2e('0x91')](function(_0x201ddd){if(_0x201ddd['@odata.type']){var _0xf731dc=_0x201ddd['@odata.type'][_0xed2e('0x39')](_0x201ddd['@odata.type'][_0xed2e('0x3a')]('.')+0x1);if(_0xf731dc===_0xed2e('0x92')){_0x4d919e[_0xed2e('0x93')](getSelectList(_0x24510d,_0x48bfa9,_0x4eea7c,_0x5f1455[_0xed2e('0x94')],_0x201ddd[_0xed2e('0x94')],_0x4219e4));}}});return Promise['all'](_0x4d919e);})[_0xed2e('0xa')](function(_0x19f21a){_0x20c626=_0x19f21a[0x0];var _0x8e9450=[];var _0xf9d0c5=[];_0x2e4507[_0xed2e('0x91')](function(_0x282741){if(!_['isNil'](_0x282741[_0xed2e('0x95')])){var _0x27afdc=_0x282741['@odata.type'][_0xed2e('0x39')](_0x282741['@odata.type'][_0xed2e('0x3a')]('.')+0x1);if(_0x27afdc===_0xed2e('0x96')){_0x8e9450[_0xed2e('0x93')](getBooleanList(_0x24510d,_0x48bfa9,_0xf9d0c5,_0x5f1455[_0xed2e('0x94')],_0x282741[_0xed2e('0x94')],_0x4219e4));}}});return Promise[_0xed2e('0x97')](_0x8e9450);})[_0xed2e('0xa')](function(_0x5164d1){_0x27e098=_0x5164d1[0x0];var _0x1e1761=[];var _0x5f2574=[];_0x2e4507[_0xed2e('0x91')](function(_0x93a9b8){if(_0x93a9b8['@odata.type']){var _0x6b8e49=_0x93a9b8[_0xed2e('0x95')]['substring'](_0x93a9b8[_0xed2e('0x95')][_0xed2e('0x3a')]('.')+0x1);if(_0x6b8e49===_0xed2e('0x98')||_0x6b8e49===_0xed2e('0x99')||_0x6b8e49===_0xed2e('0x9a')||_0x6b8e49===_0xed2e('0x9b')||_0x6b8e49==='MemoAttributeMetadata'||_0x6b8e49==='DateTimeAttributeMetadata'||_0x6b8e49==='StatusAttributeMetadata'||_0x6b8e49===_0xed2e('0x9c')||_0x6b8e49===_0xed2e('0x9d')||_0x6b8e49===_0xed2e('0x9e')){_0x1e1761['push'](getInputList(_0x24510d,_0x48bfa9,_0x6b8e49,_0x5f2574,_0x5f1455[_0xed2e('0x94')],_0x93a9b8[_0xed2e('0x94')],_0x4219e4));}}});return Promise[_0xed2e('0x97')](_0x1e1761);})[_0xed2e('0xa')](function(_0x8c2226){_0x18800b=_0x8c2226[0x0];var _0x161fc3=_0x20c626['concat'](_0x27e098)[_0xed2e('0x7c')](_0x18800b);var _0x5df614={'count':_0x161fc3[_0xed2e('0x1a')],'rows':_0x161fc3};return _0x5df614;})[_0xed2e('0xa')](respondWithResult(_0x41ddf5,null))[_0xed2e('0x27')](function(_0xc52e8a){var _0x463695=_0x2308a6[_0xed2e('0x14')][_0xed2e('0x9f')]?0x1f4:_0xc52e8a[_0xed2e('0xa0')]||0x1f4;logger[_0xed2e('0xb')](_0xc52e8a[_0xed2e('0xc')]);delete _0xc52e8a[_0xed2e('0xd')];if(_0x463695===0x191){_0x463695=0x190;}_0x41ddf5['status'](_0x463695)[_0xed2e('0xf')](_0x2308a6[_0xed2e('0x14')][_0xed2e('0x9f')]?{'message':'Wrong\x20credentials','statusCode':_0xc52e8a['statusCode']}:_0xc52e8a);});};function getSelectList(_0x1cd6d3,_0x57ddfc,_0x54e6a3,_0x2d6a78,_0x104ab5,_0x54050d){var _0x40965c={'method':_0xed2e('0x8c'),'uri':_0x1cd6d3+_0xed2e('0x8d')+_0x2d6a78+_0xed2e('0xa1')+_0x104ab5+_0xed2e('0xa2')+_0xed2e('0xa3'),'headers':{'Authorization':_0xed2e('0x8a')+_0x54050d,'If-None-Match':null,'OData-Version':_0xed2e('0xa4')},'json':!![]};return rp(_0x40965c)[_0xed2e('0xa')](function(_0x18783e){var _0x578010=[];var _0x3dc580=_0x18783e[_0xed2e('0xa5')][_0xed2e('0xa6')];_0x3dc580[_0xed2e('0x91')](function(_0x7db73f){_0x578010[_0xed2e('0x93')]({'name':_0x7db73f[_0xed2e('0xa7')]['UserLocalizedLabel'][_0xed2e('0xa7')],'value':String(_0x7db73f[_0xed2e('0xa8')])});});var _0x25602c={'id':_0x57ddfc+'_'+_0x18783e['LogicalName'],'name':_0x18783e[_0xed2e('0xa9')]['UserLocalizedLabel'][_0xed2e('0xa7')],'custom':![],'options':_0x578010};_0x54e6a3['push'](_0x25602c);return _0x54e6a3;});}function getBooleanList(_0x219f22,_0x30851f,_0x1a9385,_0x3ec777,_0x48930a,_0x34817a){var _0x62b56b={'method':_0xed2e('0x8c'),'uri':_0x219f22+_0xed2e('0x8d')+_0x3ec777+_0xed2e('0xa1')+_0x48930a+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x34817a,'If-None-Match':null,'OData-Version':_0xed2e('0xa4')},'json':!![]};return rp(_0x62b56b)[_0xed2e('0xa')](function(_0x19f5c1){var _0x1ff8f5=[];_0x1ff8f5[_0xed2e('0x93')]({'name':_0x19f5c1[_0xed2e('0xa5')][_0xed2e('0xaa')][_0xed2e('0xa7')][_0xed2e('0xab')][_0xed2e('0xa7')],'value':_0xed2e('0xac')},{'name':_0x19f5c1[_0xed2e('0xa5')][_0xed2e('0xad')][_0xed2e('0xa7')][_0xed2e('0xab')][_0xed2e('0xa7')],'value':_0xed2e('0xae')});var _0x351e4a={'id':_0x30851f+'_'+_0x19f5c1[_0xed2e('0x90')],'name':_0x19f5c1[_0xed2e('0xa9')][_0xed2e('0xab')][_0xed2e('0xa7')],'custom':![],'options':_0x1ff8f5};_0x1a9385['push'](_0x351e4a);return _0x1a9385;});}function getInputList(_0x3ed84e,_0x53f04d,_0x5cc442,_0x2bfef3,_0x44a464,_0x3682fb,_0x259a58){var _0x3a98b1={'method':_0xed2e('0x8c'),'uri':_0x3ed84e+'EntityDefinitions('+_0x44a464+_0xed2e('0xa1')+_0x3682fb+_0xed2e('0xaf')+_0x5cc442+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x259a58,'If-None-Match':null,'OData-Version':_0xed2e('0xa4')},'json':!![]};return rp(_0x3a98b1)[_0xed2e('0xa')](function(_0x6a018c){var _0x340991={'id':_0x53f04d+'_'+_0x6a018c[_0xed2e('0x90')],'name':_0x6a018c[_0xed2e('0xa9')][_0xed2e('0xab')]?_0x6a018c['DisplayName'][_0xed2e('0xab')][_0xed2e('0xa7')]:_0x6a018c['LogicalName'],'custom':![],'options':[]};_0x2bfef3[_0xed2e('0x93')](_0x340991);return _0x2bfef3;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a4c932b..dab8113 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(_0x112b0b,_0x570e1a){var _0x3b1c1f=function(_0x4920e6){while(--_0x4920e6){_0x112b0b['push'](_0x112b0b['shift']());}};_0x3b1c1f(++_0x570e1a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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(_0x1a349a,_0x7a9fd0){var _0x5b0fb7=function(_0x2acd52){while(--_0x2acd52){_0x1a349a['push'](_0x1a349a['shift']());}};_0x5b0fb7(++_0x7a9fd0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'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 e836107..d870640 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 _0x070b=['info','catch','GetDynamics365Account','Dynamics365Account','findAll','options','limit','map','include','model','attributes','stringify','ShowDynamics365Account','find','raw','where','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Account,\x20%s,\x20%s'];(function(_0x562dac,_0x3c616c){var _0xc73875=function(_0x684592){while(--_0x684592){_0x562dac['push'](_0x562dac['shift']());}};_0xc73875(++_0x3c616c);}(_0x070b,0x1bd));var _0xb070=function(_0x2ca832,_0x1f3da7){_0x2ca832=_0x2ca832-0x0;var _0x32f690=_0x070b[_0x2ca832];return _0x32f690;};'use strict';var _=require(_0xb070('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb070('0x1'));var fs=require('fs');var Redis=require(_0xb070('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb070('0x3'));var logger=require(_0xb070('0x4'))(_0xb070('0x5'));var config=require(_0xb070('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb070('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x589915,_0x58c895,_0x3d1453){return new BPromise(function(_0x1f49b0,_0x3926ea){return client[_0xb070('0x8')](_0x589915,_0x3d1453)[_0xb070('0x9')](function(_0x3981cb){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x58c895,_0xb070('0xa'));logger[_0xb070('0xb')](_0xb070('0xc'),_0x58c895,_0xb070('0xa'),JSON['stringify'](_0x3981cb));if(_0x3981cb['error']){if(_0x3981cb[_0xb070('0xd')][_0xb070('0xe')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x58c895,_0x3981cb[_0xb070('0xd')][_0xb070('0xf')]);return _0x3926ea(_0x3981cb[_0xb070('0xd')][_0xb070('0xf')]);}logger[_0xb070('0xd')](_0xb070('0x10'),_0x58c895,_0x3981cb[_0xb070('0xd')][_0xb070('0xf')]);return _0x1f49b0(_0x3981cb[_0xb070('0xd')]['message']);}else{logger[_0xb070('0x11')](_0xb070('0x10'),_0x58c895,_0xb070('0xa'));_0x1f49b0(_0x3981cb['result'][_0xb070('0xf')]);}})[_0xb070('0x12')](function(_0x1b8ef9){logger['error'](_0xb070('0x10'),_0x58c895,_0x1b8ef9);_0x3926ea(_0x1b8ef9);});});}exports[_0xb070('0x13')]=function(_0x332aa4){var _0x7bde78=this;return new Promise(function(_0xd1fbfc,_0x264781){return db[_0xb070('0x14')][_0xb070('0x15')]({'raw':_0x332aa4[_0xb070('0x16')]?_0x332aa4[_0xb070('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x332aa4[_0xb070('0x16')]?_0x332aa4[_0xb070('0x16')]['where']||null:null,'attributes':_0x332aa4[_0xb070('0x16')]?_0x332aa4[_0xb070('0x16')]['attributes']||null:null,'limit':_0x332aa4[_0xb070('0x16')]?_0x332aa4[_0xb070('0x16')][_0xb070('0x17')]||null:null,'include':_0x332aa4['options']?_0x332aa4[_0xb070('0x16')]['include']?_[_0xb070('0x18')](_0x332aa4['options'][_0xb070('0x19')],function(_0x1740da){return{'model':db[_0x1740da[_0xb070('0x1a')]],'as':_0x1740da['as'],'attributes':_0x1740da[_0xb070('0x1b')],'include':_0x1740da[_0xb070('0x19')]?_[_0xb070('0x18')](_0x1740da[_0xb070('0x19')],function(_0x3b99b3){return{'model':db[_0x3b99b3['model']],'as':_0x3b99b3['as'],'attributes':_0x3b99b3[_0xb070('0x1b')],'include':_0x3b99b3['include']?_[_0xb070('0x18')](_0x3b99b3[_0xb070('0x19')],function(_0x4fe921){return{'model':db[_0x4fe921[_0xb070('0x1a')]],'as':_0x4fe921['as'],'attributes':_0x4fe921[_0xb070('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb070('0x9')](function(_0x3368ab){logger['info'](_0xb070('0x13'),_0x332aa4);logger[_0xb070('0xb')](_0xb070('0x13'),_0x332aa4,JSON[_0xb070('0x1c')](_0x3368ab));_0xd1fbfc(_0x3368ab);})[_0xb070('0x12')](function(_0x25380f){logger['error'](_0xb070('0x13'),_0x25380f[_0xb070('0xf')],_0x332aa4);_0x264781(_0x7bde78[_0xb070('0xd')](0x1f4,_0x25380f['message']));});});};exports[_0xb070('0x1d')]=function(_0x8c8c06){var _0x8363ba=this;return new Promise(function(_0x3d391d,_0x35097d){return db[_0xb070('0x14')][_0xb070('0x1e')]({'raw':_0x8c8c06[_0xb070('0x16')]?_0x8c8c06[_0xb070('0x16')][_0xb070('0x1f')]===undefined?!![]:![]:!![],'where':_0x8c8c06[_0xb070('0x16')]?_0x8c8c06[_0xb070('0x16')][_0xb070('0x20')]||null:null,'attributes':_0x8c8c06['options']?_0x8c8c06[_0xb070('0x16')][_0xb070('0x1b')]||null:null,'include':_0x8c8c06[_0xb070('0x16')]?_0x8c8c06[_0xb070('0x16')][_0xb070('0x19')]?_[_0xb070('0x18')](_0x8c8c06[_0xb070('0x16')][_0xb070('0x19')],function(_0x42c465){return{'model':db[_0x42c465['model']],'as':_0x42c465['as'],'attributes':_0x42c465['attributes'],'include':_0x42c465['include']?_['map'](_0x42c465[_0xb070('0x19')],function(_0xc5451){return{'model':db[_0xc5451[_0xb070('0x1a')]],'as':_0xc5451['as'],'attributes':_0xc5451[_0xb070('0x1b')],'include':_0xc5451[_0xb070('0x19')]?_[_0xb070('0x18')](_0xc5451[_0xb070('0x19')],function(_0x33dc16){return{'model':db[_0x33dc16[_0xb070('0x1a')]],'as':_0x33dc16['as'],'attributes':_0x33dc16[_0xb070('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb070('0x9')](function(_0x5dd0c0){logger[_0xb070('0x11')](_0xb070('0x1d'),_0x8c8c06);logger[_0xb070('0xb')](_0xb070('0x1d'),_0x8c8c06,JSON[_0xb070('0x1c')](_0x5dd0c0));_0x3d391d(_0x5dd0c0);})[_0xb070('0x12')](function(_0xb7fb3a){logger[_0xb070('0xd')](_0xb070('0x1d'),_0xb7fb3a[_0xb070('0xf')],_0x8c8c06);_0x35097d(_0x8363ba[_0xb070('0xd')](0x1f4,_0xb7fb3a[_0xb070('0xf')]));});});}; \ No newline at end of file +var _0xa093=['message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','model','map','stringify','ShowDynamics365Account','Dynamics365Account','find','raw','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x280b2c,_0x39e3c0){var _0x2c240c=function(_0x59ae47){while(--_0x59ae47){_0x280b2c['push'](_0x280b2c['shift']());}};_0x2c240c(++_0x39e3c0);}(_0xa093,0xb6));var _0x3a09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa093[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a09('0x0'));var BPromise=require('bluebird');var rs=require(_0x3a09('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a09('0x2'))['db'];var utils=require(_0x3a09('0x3'));var logger=require(_0x3a09('0x4'))('rpc');var config=require(_0x3a09('0x5'));var jayson=require(_0x3a09('0x6'));var client=jayson['client'][_0x3a09('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44d478,_0x5838fd,_0x52c59e){return new BPromise(function(_0x53bcff,_0x36b765){return client[_0x3a09('0x8')](_0x44d478,_0x52c59e)[_0x3a09('0x9')](function(_0x1e4d75){logger[_0x3a09('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x5838fd,_0x3a09('0xb'));logger[_0x3a09('0xc')](_0x3a09('0xd'),_0x5838fd,_0x3a09('0xb'),JSON['stringify'](_0x1e4d75));if(_0x1e4d75[_0x3a09('0xe')]){if(_0x1e4d75[_0x3a09('0xe')][_0x3a09('0xf')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5838fd,_0x1e4d75['error'][_0x3a09('0x10')]);return _0x36b765(_0x1e4d75[_0x3a09('0xe')][_0x3a09('0x10')]);}logger[_0x3a09('0xe')](_0x3a09('0x11'),_0x5838fd,_0x1e4d75[_0x3a09('0xe')][_0x3a09('0x10')]);return _0x53bcff(_0x1e4d75['error'][_0x3a09('0x10')]);}else{logger[_0x3a09('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x5838fd,_0x3a09('0xb'));_0x53bcff(_0x1e4d75['result'][_0x3a09('0x10')]);}})[_0x3a09('0x12')](function(_0x1238c6){logger[_0x3a09('0xe')](_0x3a09('0x11'),_0x5838fd,_0x1238c6);_0x36b765(_0x1238c6);});});}exports[_0x3a09('0x13')]=function(_0x492439){var _0x249adf=this;return new Promise(function(_0x4c8274,_0xaff68f){return db['Dynamics365Account'][_0x3a09('0x14')]({'raw':_0x492439[_0x3a09('0x15')]?_0x492439['options']['raw']===undefined?!![]:![]:!![],'where':_0x492439[_0x3a09('0x15')]?_0x492439['options'][_0x3a09('0x16')]||null:null,'attributes':_0x492439[_0x3a09('0x15')]?_0x492439[_0x3a09('0x15')][_0x3a09('0x17')]||null:null,'limit':_0x492439[_0x3a09('0x15')]?_0x492439[_0x3a09('0x15')][_0x3a09('0x18')]||null:null,'include':_0x492439[_0x3a09('0x15')]?_0x492439['options'][_0x3a09('0x19')]?_['map'](_0x492439[_0x3a09('0x15')][_0x3a09('0x19')],function(_0x34a465){return{'model':db[_0x34a465[_0x3a09('0x1a')]],'as':_0x34a465['as'],'attributes':_0x34a465['attributes'],'include':_0x34a465[_0x3a09('0x19')]?_['map'](_0x34a465[_0x3a09('0x19')],function(_0x557a4d){return{'model':db[_0x557a4d[_0x3a09('0x1a')]],'as':_0x557a4d['as'],'attributes':_0x557a4d[_0x3a09('0x17')],'include':_0x557a4d[_0x3a09('0x19')]?_[_0x3a09('0x1b')](_0x557a4d[_0x3a09('0x19')],function(_0x21ac47){return{'model':db[_0x21ac47[_0x3a09('0x1a')]],'as':_0x21ac47['as'],'attributes':_0x21ac47[_0x3a09('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3a09('0x9')](function(_0x5cb8cf){logger[_0x3a09('0xa')](_0x3a09('0x13'),_0x492439);logger[_0x3a09('0xc')]('GetDynamics365Account',_0x492439,JSON[_0x3a09('0x1c')](_0x5cb8cf));_0x4c8274(_0x5cb8cf);})[_0x3a09('0x12')](function(_0x2fb1bf){logger[_0x3a09('0xe')](_0x3a09('0x13'),_0x2fb1bf[_0x3a09('0x10')],_0x492439);_0xaff68f(_0x249adf[_0x3a09('0xe')](0x1f4,_0x2fb1bf['message']));});});};exports[_0x3a09('0x1d')]=function(_0x6e287d){var _0x313881=this;return new Promise(function(_0x2d8c3e,_0x1f4fe9){return db[_0x3a09('0x1e')][_0x3a09('0x1f')]({'raw':_0x6e287d[_0x3a09('0x15')]?_0x6e287d[_0x3a09('0x15')][_0x3a09('0x20')]===undefined?!![]:![]:!![],'where':_0x6e287d['options']?_0x6e287d[_0x3a09('0x15')][_0x3a09('0x16')]||null:null,'attributes':_0x6e287d[_0x3a09('0x15')]?_0x6e287d['options'][_0x3a09('0x17')]||null:null,'include':_0x6e287d['options']?_0x6e287d[_0x3a09('0x15')][_0x3a09('0x19')]?_[_0x3a09('0x1b')](_0x6e287d[_0x3a09('0x15')][_0x3a09('0x19')],function(_0x3d4236){return{'model':db[_0x3d4236[_0x3a09('0x1a')]],'as':_0x3d4236['as'],'attributes':_0x3d4236[_0x3a09('0x17')],'include':_0x3d4236['include']?_[_0x3a09('0x1b')](_0x3d4236[_0x3a09('0x19')],function(_0x432455){return{'model':db[_0x432455[_0x3a09('0x1a')]],'as':_0x432455['as'],'attributes':_0x432455[_0x3a09('0x17')],'include':_0x432455[_0x3a09('0x19')]?_[_0x3a09('0x1b')](_0x432455[_0x3a09('0x19')],function(_0x159304){return{'model':db[_0x159304[_0x3a09('0x1a')]],'as':_0x159304['as'],'attributes':_0x159304[_0x3a09('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3a09('0x9')](function(_0x3f0c01){logger[_0x3a09('0xa')](_0x3a09('0x1d'),_0x6e287d);logger['debug'](_0x3a09('0x1d'),_0x6e287d,JSON[_0x3a09('0x1c')](_0x3f0c01));_0x2d8c3e(_0x3f0c01);})[_0x3a09('0x12')](function(_0x32d49c){logger[_0x3a09('0xe')](_0x3a09('0x1d'),_0x32d49c[_0x3a09('0x10')],_0x6e287d);_0x1f4fe9(_0x313881[_0x3a09('0xe')](0x1f4,_0x32d49c[_0x3a09('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 168b177..487a98c 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 _0x08e2=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x32209b,_0x2286d5){var _0x274735=function(_0x142c66){while(--_0x142c66){_0x32209b['push'](_0x32209b['shift']());}};_0x274735(++_0x2286d5);}(_0x08e2,0xe0));var _0x208e=function(_0x1a2628,_0x6f8e5d){_0x1a2628=_0x1a2628-0x0;var _0x323853=_0x08e2[_0x1a2628];return _0x323853;};'use strict';var multer=require(_0x208e('0x0'));var util=require(_0x208e('0x1'));var path=require(_0x208e('0x2'));var timeout=require(_0x208e('0x3'));var express=require(_0x208e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x208e('0x5'));var interaction=require(_0x208e('0x6'));var config=require(_0x208e('0x7'));var controller=require(_0x208e('0x8'));router[_0x208e('0x9')]('/',auth[_0x208e('0xa')](),controller[_0x208e('0xb')]);router[_0x208e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x208e('0xc')]);router[_0x208e('0x9')](_0x208e('0xd'),auth[_0x208e('0xa')](),controller[_0x208e('0xe')]);router['get'](_0x208e('0xf'),auth[_0x208e('0xa')](),controller[_0x208e('0x10')]);router[_0x208e('0x9')](_0x208e('0x11'),auth[_0x208e('0xa')](),controller[_0x208e('0x12')]);router[_0x208e('0x13')]('/',auth[_0x208e('0xa')](),controller[_0x208e('0x14')]);router[_0x208e('0x15')](_0x208e('0x16'),auth[_0x208e('0xa')](),controller[_0x208e('0x17')]);router[_0x208e('0x18')](_0x208e('0x16'),auth[_0x208e('0xa')](),controller[_0x208e('0x19')]);module[_0x208e('0x1a')]=router; \ No newline at end of file +var _0x701c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','exports','multer'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x701c,0x167));var _0xc701=function(_0x3b69e9,_0x26d81d){_0x3b69e9=_0x3b69e9-0x0;var _0x2bf555=_0x701c[_0x3b69e9];return _0x2bf555;};'use strict';var multer=require(_0xc701('0x0'));var util=require('util');var path=require(_0xc701('0x1'));var timeout=require(_0xc701('0x2'));var express=require(_0xc701('0x3'));var router=express[_0xc701('0x4')]();var fs_extra=require(_0xc701('0x5'));var auth=require(_0xc701('0x6'));var interaction=require(_0xc701('0x7'));var config=require('../../config/environment');var controller=require(_0xc701('0x8'));router['get']('/',auth[_0xc701('0x9')](),controller[_0xc701('0xa')]);router[_0xc701('0xb')](_0xc701('0xc'),auth['isAuthenticated'](),controller[_0xc701('0xd')]);router[_0xc701('0xb')]('/:id/fields',auth[_0xc701('0x9')](),controller[_0xc701('0xe')]);router[_0xc701('0xb')](_0xc701('0xf'),auth[_0xc701('0x9')](),controller[_0xc701('0x10')]);router['get']('/:id/descriptions',auth[_0xc701('0x9')](),controller[_0xc701('0x11')]);router[_0xc701('0x12')]('/',auth[_0xc701('0x9')](),controller[_0xc701('0x13')]);router['put']('/:id',auth[_0xc701('0x9')](),controller[_0xc701('0x14')]);router[_0xc701('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc701('0x16')]);module[_0xc701('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f9caf6f..6daea11 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 _0x21d9=['ENUM','contact','nothing','BOOLEAN','sequelize','STRING','incident','phonecall'];(function(_0x1bc2c4,_0x20faf4){var _0x278021=function(_0x117b69){while(--_0x117b69){_0x1bc2c4['push'](_0x1bc2c4['shift']());}};_0x278021(++_0x20faf4);}(_0x21d9,0x64));var _0x921d=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x21d9[_0x2307fa];return _0x496486;};'use strict';var Sequelize=require(_0x921d('0x0'));module['exports']={'name':{'type':Sequelize[_0x921d('0x1')]},'description':{'type':Sequelize[_0x921d('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x921d('0x2'),_0x921d('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x921d('0x4')](_0x921d('0x5'),_0x921d('0x6')),'defaultValue':_0x921d('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x921d('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x921d('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa984=['ENUM','incident','phonecall','contact','sequelize','STRING'];(function(_0x660f4e,_0xf6e9c0){var _0x1bb90b=function(_0x3bdcfb){while(--_0x3bdcfb){_0x660f4e['push'](_0x660f4e['shift']());}};_0x1bb90b(++_0xf6e9c0);}(_0xa984,0xa0));var _0x4a98=function(_0x1ba865,_0x110d26){_0x1ba865=_0x1ba865-0x0;var _0x35a964=_0xa984[_0x1ba865];return _0x35a964;};'use strict';var Sequelize=require(_0x4a98('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a98('0x1')]},'description':{'type':Sequelize[_0x4a98('0x1')]},'ticketType':{'type':Sequelize[_0x4a98('0x2')](_0x4a98('0x3'),_0x4a98('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x4a98('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e83b42f..c97950c 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 _0xa229=['intersection','model','query','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','attributes','length','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','key','keys','filters'];(function(_0x15ad6e,_0x1d118c){var _0x7eccad=function(_0x13c5e4){while(--_0x13c5e4){_0x15ad6e['push'](_0x15ad6e['shift']());}};_0x7eccad(++_0x1d118c);}(_0xa229,0x1b5));var _0x9a22=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa229[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9a22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a22('0x1'));var jsonpatch=require(_0x9a22('0x2'));var rp=require(_0x9a22('0x3'));var moment=require(_0x9a22('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a22('0x5'));var util=require(_0x9a22('0x6'));var path=require('path');var sox=require(_0x9a22('0x7'));var csv=require(_0x9a22('0x8'));var ejs=require(_0x9a22('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a22('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9a22('0xb'));var deskjs=require(_0x9a22('0xc'));var toCsv=require(_0x9a22('0x8'));var querystring=require(_0x9a22('0xd'));var Papa=require(_0x9a22('0xe'));var Redis=require(_0x9a22('0xf'));var authService=require(_0x9a22('0x10'));var qs=require(_0x9a22('0x11'));var as=require(_0x9a22('0x12'));var hardwareService=require(_0x9a22('0x13'));var logger=require(_0x9a22('0x14'))(_0x9a22('0x15'));var utils=require(_0x9a22('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9a22('0x17'));var db=require(_0x9a22('0x18'))['db'];function respondWithStatusCode(_0x4a8b4a,_0x51e34a){_0x51e34a=_0x51e34a||0xcc;return function(_0x453be3){if(_0x453be3){return _0x4a8b4a[_0x9a22('0x19')](_0x51e34a);}return _0x4a8b4a[_0x9a22('0x1a')](_0x51e34a)[_0x9a22('0x1b')]();};}function respondWithResult(_0x5e3c96,_0x40cf9a){_0x40cf9a=_0x40cf9a||0xc8;return function(_0x9b5431){if(_0x9b5431){return _0x5e3c96[_0x9a22('0x1a')](_0x40cf9a)[_0x9a22('0x1c')](_0x9b5431);}};}function respondWithFilteredResult(_0x5f3c26,_0x416f29){return function(_0x581cb3){if(_0x581cb3){var _0x77fdb4=typeof _0x416f29[_0x9a22('0x1d')]==='undefined'&&typeof _0x416f29['limit']===_0x9a22('0x1e');var _0x20d582=_0x581cb3[_0x9a22('0x1f')];var _0x1048f7=_0x77fdb4?0x0:_0x416f29[_0x9a22('0x1d')];var _0x3eee77=_0x77fdb4?_0x581cb3[_0x9a22('0x1f')]:_0x416f29['offset']+_0x416f29['limit'];var _0x56c9a4;if(_0x3eee77>=_0x20d582){_0x3eee77=_0x20d582;_0x56c9a4=0xc8;}else{_0x56c9a4=0xce;}_0x5f3c26['status'](_0x56c9a4);return _0x5f3c26[_0x9a22('0x20')]('Content-Range',_0x1048f7+'-'+_0x3eee77+'/'+_0x20d582)['json'](_0x581cb3);}return null;};}function patchUpdates(_0x5294fd){return function(_0x2f3f4e){try{jsonpatch['apply'](_0x2f3f4e,_0x5294fd,!![]);}catch(_0x3569e9){return BPromise[_0x9a22('0x21')](_0x3569e9);}return _0x2f3f4e[_0x9a22('0x22')]();};}function saveUpdates(_0x4ff652,_0x15ad16){return function(_0x10b2e9){if(_0x10b2e9){return _0x10b2e9[_0x9a22('0x23')](_0x4ff652)[_0x9a22('0x24')](function(_0x502a6f){return _0x502a6f;});}return null;};}function removeEntity(_0x26a6fb,_0x56d94d){return function(_0x232739){if(_0x232739){return _0x232739[_0x9a22('0x25')]()[_0x9a22('0x24')](function(){_0x26a6fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2932cc,_0x5e1e7f){return function(_0x6c3f30){if(!_0x6c3f30){_0x2932cc['sendStatus'](0x194);}return _0x6c3f30;};}function handleError(_0x2b16b2,_0x18ce38){_0x18ce38=_0x18ce38||0x1f4;return function(_0x3fbbba){logger[_0x9a22('0x26')](_0x3fbbba[_0x9a22('0x27')]);if(_0x3fbbba[_0x9a22('0x28')]){delete _0x3fbbba[_0x9a22('0x28')];}_0x2b16b2['status'](_0x18ce38)[_0x9a22('0x29')](_0x3fbbba);};}exports[_0x9a22('0x2a')]=function(_0x152548,_0x3a1169){var _0x12329a={},_0x256bab={},_0x83c596={'count':0x0,'rows':[]};var _0x224046=_['map'](db[_0x9a22('0x2b')][_0x9a22('0x2c')],function(_0x413c53){return{'name':_0x413c53[_0x9a22('0x2d')],'type':_0x413c53['type'][_0x9a22('0x2e')]};});_0x256bab['model']=_['map'](_0x224046,'name');_0x256bab['query']=_[_0x9a22('0x2f')](_0x152548['query']);_0x256bab[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0x256bab[_0x9a22('0x32')],_0x256bab[_0x9a22('0x33')]);_0x12329a['attributes']=_['intersection'](_0x256bab[_0x9a22('0x32')],qs[_0x9a22('0x34')](_0x152548[_0x9a22('0x33')][_0x9a22('0x34')]));_0x12329a['attributes']=_0x12329a['attributes']['length']?_0x12329a['attributes']:_0x256bab[_0x9a22('0x32')];if(!_0x152548[_0x9a22('0x33')][_0x9a22('0x35')](_0x9a22('0x36'))){_0x12329a['limit']=qs[_0x9a22('0x37')](_0x152548[_0x9a22('0x33')]['limit']);_0x12329a[_0x9a22('0x1d')]=qs[_0x9a22('0x1d')](_0x152548['query'][_0x9a22('0x1d')]);}_0x12329a[_0x9a22('0x38')]=qs[_0x9a22('0x39')](_0x152548[_0x9a22('0x33')][_0x9a22('0x39')]);_0x12329a['where']=qs[_0x9a22('0x30')](_[_0x9a22('0x3a')](_0x152548[_0x9a22('0x33')],_0x256bab[_0x9a22('0x30')]),_0x224046);if(_0x152548[_0x9a22('0x33')][_0x9a22('0x3b')]){_0x12329a[_0x9a22('0x3c')]=_[_0x9a22('0x3d')](_0x12329a['where'],{'$or':_['map'](_0x224046,function(_0x5e3dd4){if(_0x5e3dd4['type']!=='VIRTUAL'){var _0x4a218f={};_0x4a218f[_0x5e3dd4[_0x9a22('0x28')]]={'$like':'%'+_0x152548[_0x9a22('0x33')][_0x9a22('0x3b')]+'%'};return _0x4a218f;}})});}_0x12329a=_[_0x9a22('0x3d')]({},_0x12329a,_0x152548[_0x9a22('0x3e')]);var _0x357003={'where':_0x12329a[_0x9a22('0x3c')]};return db['Dynamics365Configuration'][_0x9a22('0x1f')](_0x357003)[_0x9a22('0x24')](function(_0x433491){_0x83c596[_0x9a22('0x1f')]=_0x433491;if(_0x152548[_0x9a22('0x33')][_0x9a22('0x3f')]){_0x12329a[_0x9a22('0x40')]=[{'all':!![]}];}return db[_0x9a22('0x2b')][_0x9a22('0x41')](_0x12329a);})[_0x9a22('0x24')](function(_0x1041eb){_0x83c596[_0x9a22('0x42')]=_0x1041eb;return _0x83c596;})[_0x9a22('0x24')](respondWithFilteredResult(_0x3a1169,_0x12329a))[_0x9a22('0x43')](handleError(_0x3a1169,null));};exports[_0x9a22('0x44')]=function(_0x2af902,_0x47f587){var _0x36ec1b={'raw':![],'where':{'id':_0x2af902[_0x9a22('0x45')]['id']}},_0xe690b0={};_0xe690b0[_0x9a22('0x32')]=_[_0x9a22('0x2f')](db[_0x9a22('0x2b')][_0x9a22('0x2c')]);_0xe690b0['query']=_[_0x9a22('0x2f')](_0x2af902[_0x9a22('0x33')]);_0xe690b0[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0xe690b0[_0x9a22('0x32')],_0xe690b0['query']);_0x36ec1b['attributes']=_['intersection'](_0xe690b0[_0x9a22('0x32')],qs['fields'](_0x2af902[_0x9a22('0x33')][_0x9a22('0x34')]));_0x36ec1b[_0x9a22('0x46')]=_0x36ec1b[_0x9a22('0x46')][_0x9a22('0x47')]?_0x36ec1b[_0x9a22('0x46')]:_0xe690b0[_0x9a22('0x32')];if(_0x2af902[_0x9a22('0x33')][_0x9a22('0x3f')]){_0x36ec1b['include']=[{'all':!![]}];}_0x36ec1b=_['merge']({},_0x36ec1b,_0x2af902['options']);return db['Dynamics365Configuration']['find'](_0x36ec1b)[_0x9a22('0x24')](handleEntityNotFound(_0x47f587,null))['then'](respondWithResult(_0x47f587,null))[_0x9a22('0x43')](handleError(_0x47f587,null));};exports[_0x9a22('0x48')]=function(_0x48f94e,_0x352280){return db['Dynamics365Configuration'][_0x9a22('0x48')](_0x48f94e[_0x9a22('0x49')],{})['then'](respondWithResult(_0x352280,0xc9))[_0x9a22('0x43')](handleError(_0x352280,null));};exports[_0x9a22('0x23')]=function(_0x35b5d2,_0x574295){if(_0x35b5d2['body']['id']){delete _0x35b5d2[_0x9a22('0x49')]['id'];}return db[_0x9a22('0x2b')]['find']({'where':{'id':_0x35b5d2[_0x9a22('0x45')]['id']}})[_0x9a22('0x24')](handleEntityNotFound(_0x574295,null))[_0x9a22('0x24')](saveUpdates(_0x35b5d2[_0x9a22('0x49')],null))[_0x9a22('0x24')](respondWithResult(_0x574295,null))[_0x9a22('0x43')](handleError(_0x574295,null));};exports[_0x9a22('0x25')]=function(_0xb45c6c,_0x418441){return db['Dynamics365Configuration'][_0x9a22('0x4a')]({'where':{'id':_0xb45c6c[_0x9a22('0x45')]['id']}})[_0x9a22('0x24')](handleEntityNotFound(_0x418441,null))[_0x9a22('0x24')](removeEntity(_0x418441,null))[_0x9a22('0x43')](handleError(_0x418441,null));};exports[_0x9a22('0x4b')]=function(_0x17b435,_0x17d8bc,_0x4824d3){var _0x4f181b={};var _0x882a80={};var _0x6f0354;var _0x537e89;return db[_0x9a22('0x2b')][_0x9a22('0x4c')]({'where':{'id':_0x17b435['params']['id']}})[_0x9a22('0x24')](handleEntityNotFound(_0x17d8bc,null))[_0x9a22('0x24')](function(_0x112807){if(_0x112807){_0x6f0354=_0x112807;_0x882a80[_0x9a22('0x32')]=_[_0x9a22('0x2f')](db[_0x9a22('0x4d')]['rawAttributes']);_0x882a80['query']=_[_0x9a22('0x2f')](_0x17b435[_0x9a22('0x33')]);_0x882a80[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0x882a80[_0x9a22('0x32')],_0x882a80[_0x9a22('0x33')]);_0x4f181b[_0x9a22('0x46')]=_[_0x9a22('0x31')](_0x882a80['model'],qs['fields'](_0x17b435[_0x9a22('0x33')][_0x9a22('0x34')]));_0x4f181b[_0x9a22('0x46')]=_0x4f181b[_0x9a22('0x46')][_0x9a22('0x47')]?_0x4f181b[_0x9a22('0x46')]:_0x882a80['model'];_0x4f181b[_0x9a22('0x38')]=qs['sort'](_0x17b435['query'][_0x9a22('0x39')]);_0x4f181b[_0x9a22('0x3c')]=qs[_0x9a22('0x30')](_[_0x9a22('0x3a')](_0x17b435[_0x9a22('0x33')],_0x882a80[_0x9a22('0x30')]));if(_0x17b435[_0x9a22('0x33')]['filter']){_0x4f181b['where']=_[_0x9a22('0x3d')](_0x4f181b[_0x9a22('0x3c')],{'$or':_['map'](_0x4f181b[_0x9a22('0x46')],function(_0x41cc90){var _0x276edb={};_0x276edb[_0x41cc90]={'$like':'%'+_0x17b435[_0x9a22('0x33')][_0x9a22('0x3b')]+'%'};return _0x276edb;})});}_0x4f181b=_[_0x9a22('0x3d')]({},_0x4f181b,_0x17b435['options']);return _0x6f0354[_0x9a22('0x4b')](_0x4f181b);}})[_0x9a22('0x24')](function(_0x50a783){if(_0x50a783){_0x537e89=_0x50a783[_0x9a22('0x47')];if(!_0x17b435[_0x9a22('0x33')]['hasOwnProperty'](_0x9a22('0x36'))){_0x4f181b[_0x9a22('0x37')]=qs[_0x9a22('0x37')](_0x17b435[_0x9a22('0x33')][_0x9a22('0x37')]);_0x4f181b[_0x9a22('0x1d')]=qs[_0x9a22('0x1d')](_0x17b435[_0x9a22('0x33')][_0x9a22('0x1d')]);}return _0x6f0354[_0x9a22('0x4b')](_0x4f181b);}})[_0x9a22('0x24')](function(_0x21a22b){if(_0x21a22b){return _0x21a22b?{'count':_0x537e89,'rows':_0x21a22b}:null;}})[_0x9a22('0x24')](respondWithResult(_0x17d8bc,null))[_0x9a22('0x43')](handleError(_0x17d8bc,null));};exports[_0x9a22('0x4e')]=function(_0x6bdca2,_0x313f3f,_0x2324ae){var _0x3c29ff={};var _0x5c2bae={};var _0x213b05;var _0x575ad1;return db['Dynamics365Configuration'][_0x9a22('0x4c')]({'where':{'id':_0x6bdca2['params']['id']}})[_0x9a22('0x24')](handleEntityNotFound(_0x313f3f,null))['then'](function(_0x22ec64){if(_0x22ec64){_0x213b05=_0x22ec64;_0x5c2bae['model']=_[_0x9a22('0x2f')](db['Dynamics365Field'][_0x9a22('0x2c')]);_0x5c2bae['query']=_[_0x9a22('0x2f')](_0x6bdca2['query']);_0x5c2bae[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0x5c2bae[_0x9a22('0x32')],_0x5c2bae[_0x9a22('0x33')]);_0x3c29ff[_0x9a22('0x46')]=_[_0x9a22('0x31')](_0x5c2bae[_0x9a22('0x32')],qs['fields'](_0x6bdca2[_0x9a22('0x33')][_0x9a22('0x34')]));_0x3c29ff[_0x9a22('0x46')]=_0x3c29ff[_0x9a22('0x46')][_0x9a22('0x47')]?_0x3c29ff[_0x9a22('0x46')]:_0x5c2bae[_0x9a22('0x32')];_0x3c29ff[_0x9a22('0x38')]=qs['sort'](_0x6bdca2[_0x9a22('0x33')]['sort']);_0x3c29ff[_0x9a22('0x3c')]=qs['filters'](_[_0x9a22('0x3a')](_0x6bdca2['query'],_0x5c2bae[_0x9a22('0x30')]));if(_0x6bdca2[_0x9a22('0x33')][_0x9a22('0x3b')]){_0x3c29ff[_0x9a22('0x3c')]=_[_0x9a22('0x3d')](_0x3c29ff[_0x9a22('0x3c')],{'$or':_['map'](_0x3c29ff[_0x9a22('0x46')],function(_0x8cc56){var _0x4c472a={};_0x4c472a[_0x8cc56]={'$like':'%'+_0x6bdca2[_0x9a22('0x33')][_0x9a22('0x3b')]+'%'};return _0x4c472a;})});}_0x3c29ff=_[_0x9a22('0x3d')]({},_0x3c29ff,_0x6bdca2[_0x9a22('0x3e')]);return _0x213b05['getSubjects'](_0x3c29ff);}})[_0x9a22('0x24')](function(_0x556518){if(_0x556518){_0x575ad1=_0x556518['length'];if(!_0x6bdca2['query'][_0x9a22('0x35')](_0x9a22('0x36'))){_0x3c29ff[_0x9a22('0x37')]=qs[_0x9a22('0x37')](_0x6bdca2[_0x9a22('0x33')]['limit']);_0x3c29ff[_0x9a22('0x1d')]=qs[_0x9a22('0x1d')](_0x6bdca2[_0x9a22('0x33')][_0x9a22('0x1d')]);}return _0x213b05['getSubjects'](_0x3c29ff);}})['then'](function(_0x19df45){if(_0x19df45){return _0x19df45?{'count':_0x575ad1,'rows':_0x19df45}:null;}})[_0x9a22('0x24')](respondWithResult(_0x313f3f,null))[_0x9a22('0x43')](handleError(_0x313f3f,null));};exports[_0x9a22('0x4f')]=function(_0x232ad7,_0x2fe01f,_0x56d5d8){var _0x32eed0={};var _0xba05e0={};var _0x290157;var _0x4a4c20;return db['Dynamics365Configuration'][_0x9a22('0x4c')]({'where':{'id':_0x232ad7[_0x9a22('0x45')]['id']}})[_0x9a22('0x24')](handleEntityNotFound(_0x2fe01f,null))[_0x9a22('0x24')](function(_0x30ef95){if(_0x30ef95){_0x290157=_0x30ef95;_0xba05e0['model']=_[_0x9a22('0x2f')](db[_0x9a22('0x4d')]['rawAttributes']);_0xba05e0['query']=_['keys'](_0x232ad7[_0x9a22('0x33')]);_0xba05e0[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0xba05e0[_0x9a22('0x32')],_0xba05e0[_0x9a22('0x33')]);_0x32eed0['attributes']=_['intersection'](_0xba05e0[_0x9a22('0x32')],qs[_0x9a22('0x34')](_0x232ad7[_0x9a22('0x33')]['fields']));_0x32eed0[_0x9a22('0x46')]=_0x32eed0[_0x9a22('0x46')][_0x9a22('0x47')]?_0x32eed0[_0x9a22('0x46')]:_0xba05e0[_0x9a22('0x32')];_0x32eed0[_0x9a22('0x38')]=qs[_0x9a22('0x39')](_0x232ad7[_0x9a22('0x33')][_0x9a22('0x39')]);_0x32eed0[_0x9a22('0x3c')]=qs['filters'](_[_0x9a22('0x3a')](_0x232ad7[_0x9a22('0x33')],_0xba05e0[_0x9a22('0x30')]));if(_0x232ad7[_0x9a22('0x33')][_0x9a22('0x3b')]){_0x32eed0[_0x9a22('0x3c')]=_[_0x9a22('0x3d')](_0x32eed0[_0x9a22('0x3c')],{'$or':_[_0x9a22('0x50')](_0x32eed0[_0x9a22('0x46')],function(_0x208748){var _0x1e53fe={};_0x1e53fe[_0x208748]={'$like':'%'+_0x232ad7['query'][_0x9a22('0x3b')]+'%'};return _0x1e53fe;})});}_0x32eed0=_[_0x9a22('0x3d')]({},_0x32eed0,_0x232ad7[_0x9a22('0x3e')]);return _0x290157[_0x9a22('0x4f')](_0x32eed0);}})['then'](function(_0x292d2d){if(_0x292d2d){_0x4a4c20=_0x292d2d['length'];if(!_0x232ad7[_0x9a22('0x33')][_0x9a22('0x35')](_0x9a22('0x36'))){_0x32eed0[_0x9a22('0x37')]=qs[_0x9a22('0x37')](_0x232ad7['query'][_0x9a22('0x37')]);_0x32eed0['offset']=qs[_0x9a22('0x1d')](_0x232ad7[_0x9a22('0x33')][_0x9a22('0x1d')]);}return _0x290157[_0x9a22('0x4f')](_0x32eed0);}})[_0x9a22('0x24')](function(_0x4e2e7a){if(_0x4e2e7a){return _0x4e2e7a?{'count':_0x4a4c20,'rows':_0x4e2e7a}:null;}})[_0x9a22('0x24')](respondWithResult(_0x2fe01f,null))[_0x9a22('0x43')](handleError(_0x2fe01f,null));}; \ No newline at end of file +var _0x11cf=['query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','length','include','find','create','body','getFields','findOne','sort','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x11cf,0x10e));var _0xf11c=function(_0x16884c,_0x508220){_0x16884c=_0x16884c-0x0;var _0x1c1d13=_0x11cf[_0x16884c];return _0x1c1d13;};'use strict';var emlformat=require(_0xf11c('0x0'));var rimraf=require(_0xf11c('0x1'));var zipdir=require(_0xf11c('0x2'));var jsonpatch=require(_0xf11c('0x3'));var rp=require('request-promise');var moment=require(_0xf11c('0x4'));var BPromise=require(_0xf11c('0x5'));var Mustache=require(_0xf11c('0x6'));var util=require(_0xf11c('0x7'));var path=require(_0xf11c('0x8'));var sox=require(_0xf11c('0x9'));var csv=require(_0xf11c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf11c('0xb'));var _=require(_0xf11c('0xc'));var squel=require(_0xf11c('0xd'));var crypto=require(_0xf11c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf11c('0xa'));var querystring=require(_0xf11c('0xf'));var Papa=require(_0xf11c('0x10'));var Redis=require(_0xf11c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf11c('0x12'));var as=require(_0xf11c('0x13'));var hardwareService=require(_0xf11c('0x14'));var logger=require('../../config/logger')(_0xf11c('0x15'));var utils=require('../../config/utils');var config=require(_0xf11c('0x16'));var licenseUtil=require(_0xf11c('0x17'));var db=require(_0xf11c('0x18'))['db'];function respondWithStatusCode(_0x575c82,_0x582f59){_0x582f59=_0x582f59||0xcc;return function(_0x4aaa78){if(_0x4aaa78){return _0x575c82[_0xf11c('0x19')](_0x582f59);}return _0x575c82['status'](_0x582f59)['end']();};}function respondWithResult(_0x5024d9,_0x369cfb){_0x369cfb=_0x369cfb||0xc8;return function(_0x4dfd63){if(_0x4dfd63){return _0x5024d9[_0xf11c('0x1a')](_0x369cfb)[_0xf11c('0x1b')](_0x4dfd63);}};}function respondWithFilteredResult(_0x2b7c21,_0x402ad4){return function(_0x379f60){if(_0x379f60){var _0x5edbd3=typeof _0x402ad4['offset']===_0xf11c('0x1c')&&typeof _0x402ad4[_0xf11c('0x1d')]==='undefined';var _0x5f4d13=_0x379f60[_0xf11c('0x1e')];var _0xde2fc0=_0x5edbd3?0x0:_0x402ad4['offset'];var _0x2a1571=_0x5edbd3?_0x379f60[_0xf11c('0x1e')]:_0x402ad4['offset']+_0x402ad4[_0xf11c('0x1d')];var _0x406bc7;if(_0x2a1571>=_0x5f4d13){_0x2a1571=_0x5f4d13;_0x406bc7=0xc8;}else{_0x406bc7=0xce;}_0x2b7c21[_0xf11c('0x1a')](_0x406bc7);return _0x2b7c21[_0xf11c('0x1f')]('Content-Range',_0xde2fc0+'-'+_0x2a1571+'/'+_0x5f4d13)['json'](_0x379f60);}return null;};}function patchUpdates(_0x25a844){return function(_0x5d7726){try{jsonpatch[_0xf11c('0x20')](_0x5d7726,_0x25a844,!![]);}catch(_0xe2f71b){return BPromise[_0xf11c('0x21')](_0xe2f71b);}return _0x5d7726[_0xf11c('0x22')]();};}function saveUpdates(_0x1e63d1,_0xe3f0cb){return function(_0x3f25b4){if(_0x3f25b4){return _0x3f25b4[_0xf11c('0x23')](_0x1e63d1)[_0xf11c('0x24')](function(_0x4ff70b){return _0x4ff70b;});}return null;};}function removeEntity(_0x41eb16,_0x4be484){return function(_0x3a743b){if(_0x3a743b){return _0x3a743b[_0xf11c('0x25')]()['then'](function(){_0x41eb16[_0xf11c('0x1a')](0xcc)[_0xf11c('0x26')]();});}};}function handleEntityNotFound(_0x2ee712,_0x297c28){return function(_0x44c8bb){if(!_0x44c8bb){_0x2ee712[_0xf11c('0x19')](0x194);}return _0x44c8bb;};}function handleError(_0x5dca04,_0x5318be){_0x5318be=_0x5318be||0x1f4;return function(_0x2a0815){logger['error'](_0x2a0815['stack']);if(_0x2a0815[_0xf11c('0x27')]){delete _0x2a0815[_0xf11c('0x27')];}_0x5dca04[_0xf11c('0x1a')](_0x5318be)[_0xf11c('0x28')](_0x2a0815);};}exports['index']=function(_0x381fb3,_0x2c7b35){var _0x5b6cc9={},_0x1b2c76={},_0x2f4b0e={'count':0x0,'rows':[]};var _0x1063fd=_[_0xf11c('0x29')](db[_0xf11c('0x2a')][_0xf11c('0x2b')],function(_0x30e841){return{'name':_0x30e841[_0xf11c('0x2c')],'type':_0x30e841[_0xf11c('0x2d')]['key']};});_0x1b2c76['model']=_[_0xf11c('0x29')](_0x1063fd,'name');_0x1b2c76[_0xf11c('0x2e')]=_[_0xf11c('0x2f')](_0x381fb3[_0xf11c('0x2e')]);_0x1b2c76[_0xf11c('0x30')]=_['intersection'](_0x1b2c76[_0xf11c('0x31')],_0x1b2c76[_0xf11c('0x2e')]);_0x5b6cc9[_0xf11c('0x32')]=_['intersection'](_0x1b2c76[_0xf11c('0x31')],qs[_0xf11c('0x33')](_0x381fb3[_0xf11c('0x2e')][_0xf11c('0x33')]));_0x5b6cc9[_0xf11c('0x32')]=_0x5b6cc9[_0xf11c('0x32')]['length']?_0x5b6cc9['attributes']:_0x1b2c76[_0xf11c('0x31')];if(!_0x381fb3[_0xf11c('0x2e')][_0xf11c('0x34')](_0xf11c('0x35'))){_0x5b6cc9[_0xf11c('0x1d')]=qs['limit'](_0x381fb3[_0xf11c('0x2e')][_0xf11c('0x1d')]);_0x5b6cc9[_0xf11c('0x36')]=qs[_0xf11c('0x36')](_0x381fb3['query']['offset']);}_0x5b6cc9[_0xf11c('0x37')]=qs['sort'](_0x381fb3[_0xf11c('0x2e')]['sort']);_0x5b6cc9[_0xf11c('0x38')]=qs[_0xf11c('0x30')](_[_0xf11c('0x39')](_0x381fb3[_0xf11c('0x2e')],_0x1b2c76[_0xf11c('0x30')]),_0x1063fd);if(_0x381fb3[_0xf11c('0x2e')][_0xf11c('0x3a')]){_0x5b6cc9[_0xf11c('0x38')]=_[_0xf11c('0x3b')](_0x5b6cc9[_0xf11c('0x38')],{'$or':_[_0xf11c('0x29')](_0x1063fd,function(_0x3086c6){if(_0x3086c6[_0xf11c('0x2d')]!==_0xf11c('0x3c')){var _0x14f54a={};_0x14f54a[_0x3086c6[_0xf11c('0x27')]]={'$like':'%'+_0x381fb3[_0xf11c('0x2e')]['filter']+'%'};return _0x14f54a;}})});}_0x5b6cc9=_['merge']({},_0x5b6cc9,_0x381fb3[_0xf11c('0x3d')]);var _0x39e2a7={'where':_0x5b6cc9['where']};return db[_0xf11c('0x2a')][_0xf11c('0x1e')](_0x39e2a7)[_0xf11c('0x24')](function(_0x5b799e){_0x2f4b0e[_0xf11c('0x1e')]=_0x5b799e;if(_0x381fb3[_0xf11c('0x2e')][_0xf11c('0x3e')]){_0x5b6cc9['include']=[{'all':!![]}];}return db[_0xf11c('0x2a')][_0xf11c('0x3f')](_0x5b6cc9);})[_0xf11c('0x24')](function(_0x525dcd){_0x2f4b0e['rows']=_0x525dcd;return _0x2f4b0e;})[_0xf11c('0x24')](respondWithFilteredResult(_0x2c7b35,_0x5b6cc9))[_0xf11c('0x40')](handleError(_0x2c7b35,null));};exports[_0xf11c('0x41')]=function(_0x35061e,_0xedff32){var _0x3d7bef={'raw':![],'where':{'id':_0x35061e[_0xf11c('0x42')]['id']}},_0x5ee44d={};_0x5ee44d[_0xf11c('0x31')]=_['keys'](db[_0xf11c('0x2a')][_0xf11c('0x2b')]);_0x5ee44d[_0xf11c('0x2e')]=_[_0xf11c('0x2f')](_0x35061e['query']);_0x5ee44d['filters']=_[_0xf11c('0x43')](_0x5ee44d[_0xf11c('0x31')],_0x5ee44d[_0xf11c('0x2e')]);_0x3d7bef[_0xf11c('0x32')]=_[_0xf11c('0x43')](_0x5ee44d['model'],qs[_0xf11c('0x33')](_0x35061e[_0xf11c('0x2e')]['fields']));_0x3d7bef[_0xf11c('0x32')]=_0x3d7bef[_0xf11c('0x32')][_0xf11c('0x44')]?_0x3d7bef[_0xf11c('0x32')]:_0x5ee44d['model'];if(_0x35061e[_0xf11c('0x2e')][_0xf11c('0x3e')]){_0x3d7bef[_0xf11c('0x45')]=[{'all':!![]}];}_0x3d7bef=_[_0xf11c('0x3b')]({},_0x3d7bef,_0x35061e[_0xf11c('0x3d')]);return db[_0xf11c('0x2a')][_0xf11c('0x46')](_0x3d7bef)['then'](handleEntityNotFound(_0xedff32,null))[_0xf11c('0x24')](respondWithResult(_0xedff32,null))[_0xf11c('0x40')](handleError(_0xedff32,null));};exports[_0xf11c('0x47')]=function(_0x43c094,_0x2a3079){return db[_0xf11c('0x2a')][_0xf11c('0x47')](_0x43c094[_0xf11c('0x48')],{})[_0xf11c('0x24')](respondWithResult(_0x2a3079,0xc9))['catch'](handleError(_0x2a3079,null));};exports[_0xf11c('0x23')]=function(_0x48c4fb,_0x204b81){if(_0x48c4fb['body']['id']){delete _0x48c4fb['body']['id'];}return db[_0xf11c('0x2a')][_0xf11c('0x46')]({'where':{'id':_0x48c4fb['params']['id']}})[_0xf11c('0x24')](handleEntityNotFound(_0x204b81,null))['then'](saveUpdates(_0x48c4fb[_0xf11c('0x48')],null))[_0xf11c('0x24')](respondWithResult(_0x204b81,null))[_0xf11c('0x40')](handleError(_0x204b81,null));};exports[_0xf11c('0x25')]=function(_0x3dc044,_0x3507bd){return db[_0xf11c('0x2a')]['find']({'where':{'id':_0x3dc044[_0xf11c('0x42')]['id']}})['then'](handleEntityNotFound(_0x3507bd,null))[_0xf11c('0x24')](removeEntity(_0x3507bd,null))[_0xf11c('0x40')](handleError(_0x3507bd,null));};exports[_0xf11c('0x49')]=function(_0x21db37,_0x4e8ea5,_0x17358e){var _0x1ed761={};var _0x33f853={};var _0xde5e39;var _0x12e475;return db['Dynamics365Configuration'][_0xf11c('0x4a')]({'where':{'id':_0x21db37[_0xf11c('0x42')]['id']}})[_0xf11c('0x24')](handleEntityNotFound(_0x4e8ea5,null))[_0xf11c('0x24')](function(_0x343e30){if(_0x343e30){_0xde5e39=_0x343e30;_0x33f853[_0xf11c('0x31')]=_[_0xf11c('0x2f')](db['Dynamics365Field'][_0xf11c('0x2b')]);_0x33f853['query']=_[_0xf11c('0x2f')](_0x21db37[_0xf11c('0x2e')]);_0x33f853[_0xf11c('0x30')]=_[_0xf11c('0x43')](_0x33f853['model'],_0x33f853['query']);_0x1ed761['attributes']=_['intersection'](_0x33f853[_0xf11c('0x31')],qs[_0xf11c('0x33')](_0x21db37[_0xf11c('0x2e')][_0xf11c('0x33')]));_0x1ed761[_0xf11c('0x32')]=_0x1ed761['attributes'][_0xf11c('0x44')]?_0x1ed761[_0xf11c('0x32')]:_0x33f853[_0xf11c('0x31')];_0x1ed761[_0xf11c('0x37')]=qs[_0xf11c('0x4b')](_0x21db37[_0xf11c('0x2e')]['sort']);_0x1ed761[_0xf11c('0x38')]=qs[_0xf11c('0x30')](_[_0xf11c('0x39')](_0x21db37[_0xf11c('0x2e')],_0x33f853[_0xf11c('0x30')]));if(_0x21db37[_0xf11c('0x2e')][_0xf11c('0x3a')]){_0x1ed761[_0xf11c('0x38')]=_[_0xf11c('0x3b')](_0x1ed761['where'],{'$or':_['map'](_0x1ed761[_0xf11c('0x32')],function(_0x2a3210){var _0x1893b1={};_0x1893b1[_0x2a3210]={'$like':'%'+_0x21db37['query']['filter']+'%'};return _0x1893b1;})});}_0x1ed761=_[_0xf11c('0x3b')]({},_0x1ed761,_0x21db37[_0xf11c('0x3d')]);return _0xde5e39[_0xf11c('0x49')](_0x1ed761);}})['then'](function(_0x4c61d9){if(_0x4c61d9){_0x12e475=_0x4c61d9[_0xf11c('0x44')];if(!_0x21db37[_0xf11c('0x2e')][_0xf11c('0x34')](_0xf11c('0x35'))){_0x1ed761['limit']=qs[_0xf11c('0x1d')](_0x21db37['query'][_0xf11c('0x1d')]);_0x1ed761[_0xf11c('0x36')]=qs[_0xf11c('0x36')](_0x21db37[_0xf11c('0x2e')]['offset']);}return _0xde5e39[_0xf11c('0x49')](_0x1ed761);}})['then'](function(_0x173676){if(_0x173676){return _0x173676?{'count':_0x12e475,'rows':_0x173676}:null;}})[_0xf11c('0x24')](respondWithResult(_0x4e8ea5,null))[_0xf11c('0x40')](handleError(_0x4e8ea5,null));};exports[_0xf11c('0x4c')]=function(_0x397f67,_0x1df0d4,_0x19752c){var _0xbe75e6={};var _0x4dba9b={};var _0x108994;var _0x1024fc;return db[_0xf11c('0x2a')][_0xf11c('0x4a')]({'where':{'id':_0x397f67['params']['id']}})[_0xf11c('0x24')](handleEntityNotFound(_0x1df0d4,null))[_0xf11c('0x24')](function(_0x2b9952){if(_0x2b9952){_0x108994=_0x2b9952;_0x4dba9b[_0xf11c('0x31')]=_['keys'](db[_0xf11c('0x4d')][_0xf11c('0x2b')]);_0x4dba9b[_0xf11c('0x2e')]=_[_0xf11c('0x2f')](_0x397f67[_0xf11c('0x2e')]);_0x4dba9b[_0xf11c('0x30')]=_[_0xf11c('0x43')](_0x4dba9b['model'],_0x4dba9b[_0xf11c('0x2e')]);_0xbe75e6[_0xf11c('0x32')]=_[_0xf11c('0x43')](_0x4dba9b[_0xf11c('0x31')],qs[_0xf11c('0x33')](_0x397f67[_0xf11c('0x2e')][_0xf11c('0x33')]));_0xbe75e6[_0xf11c('0x32')]=_0xbe75e6[_0xf11c('0x32')][_0xf11c('0x44')]?_0xbe75e6[_0xf11c('0x32')]:_0x4dba9b[_0xf11c('0x31')];_0xbe75e6[_0xf11c('0x37')]=qs[_0xf11c('0x4b')](_0x397f67['query'][_0xf11c('0x4b')]);_0xbe75e6[_0xf11c('0x38')]=qs[_0xf11c('0x30')](_['pick'](_0x397f67[_0xf11c('0x2e')],_0x4dba9b[_0xf11c('0x30')]));if(_0x397f67[_0xf11c('0x2e')][_0xf11c('0x3a')]){_0xbe75e6['where']=_[_0xf11c('0x3b')](_0xbe75e6[_0xf11c('0x38')],{'$or':_[_0xf11c('0x29')](_0xbe75e6[_0xf11c('0x32')],function(_0x224ba2){var _0x10da46={};_0x10da46[_0x224ba2]={'$like':'%'+_0x397f67[_0xf11c('0x2e')][_0xf11c('0x3a')]+'%'};return _0x10da46;})});}_0xbe75e6=_[_0xf11c('0x3b')]({},_0xbe75e6,_0x397f67['options']);return _0x108994[_0xf11c('0x4c')](_0xbe75e6);}})[_0xf11c('0x24')](function(_0x72d1e8){if(_0x72d1e8){_0x1024fc=_0x72d1e8[_0xf11c('0x44')];if(!_0x397f67['query'][_0xf11c('0x34')](_0xf11c('0x35'))){_0xbe75e6[_0xf11c('0x1d')]=qs['limit'](_0x397f67['query'][_0xf11c('0x1d')]);_0xbe75e6[_0xf11c('0x36')]=qs[_0xf11c('0x36')](_0x397f67['query'][_0xf11c('0x36')]);}return _0x108994[_0xf11c('0x4c')](_0xbe75e6);}})[_0xf11c('0x24')](function(_0x13bf14){if(_0x13bf14){return _0x13bf14?{'count':_0x1024fc,'rows':_0x13bf14}:null;}})[_0xf11c('0x24')](respondWithResult(_0x1df0d4,null))[_0xf11c('0x40')](handleError(_0x1df0d4,null));};exports['getDescriptions']=function(_0x114750,_0x3fbcb4,_0x10ea9d){var _0x3e47a7={};var _0x46bbbe={};var _0x1250e5;var _0x13088c;return db[_0xf11c('0x2a')]['findOne']({'where':{'id':_0x114750[_0xf11c('0x42')]['id']}})[_0xf11c('0x24')](handleEntityNotFound(_0x3fbcb4,null))['then'](function(_0x17ce87){if(_0x17ce87){_0x1250e5=_0x17ce87;_0x46bbbe['model']=_[_0xf11c('0x2f')](db[_0xf11c('0x4d')]['rawAttributes']);_0x46bbbe[_0xf11c('0x2e')]=_[_0xf11c('0x2f')](_0x114750[_0xf11c('0x2e')]);_0x46bbbe[_0xf11c('0x30')]=_[_0xf11c('0x43')](_0x46bbbe['model'],_0x46bbbe[_0xf11c('0x2e')]);_0x3e47a7[_0xf11c('0x32')]=_[_0xf11c('0x43')](_0x46bbbe[_0xf11c('0x31')],qs[_0xf11c('0x33')](_0x114750[_0xf11c('0x2e')][_0xf11c('0x33')]));_0x3e47a7[_0xf11c('0x32')]=_0x3e47a7[_0xf11c('0x32')][_0xf11c('0x44')]?_0x3e47a7[_0xf11c('0x32')]:_0x46bbbe[_0xf11c('0x31')];_0x3e47a7[_0xf11c('0x37')]=qs[_0xf11c('0x4b')](_0x114750['query'][_0xf11c('0x4b')]);_0x3e47a7[_0xf11c('0x38')]=qs[_0xf11c('0x30')](_['pick'](_0x114750[_0xf11c('0x2e')],_0x46bbbe[_0xf11c('0x30')]));if(_0x114750[_0xf11c('0x2e')][_0xf11c('0x3a')]){_0x3e47a7[_0xf11c('0x38')]=_[_0xf11c('0x3b')](_0x3e47a7[_0xf11c('0x38')],{'$or':_['map'](_0x3e47a7[_0xf11c('0x32')],function(_0x1805be){var _0x466862={};_0x466862[_0x1805be]={'$like':'%'+_0x114750[_0xf11c('0x2e')][_0xf11c('0x3a')]+'%'};return _0x466862;})});}_0x3e47a7=_['merge']({},_0x3e47a7,_0x114750[_0xf11c('0x3d')]);return _0x1250e5[_0xf11c('0x4e')](_0x3e47a7);}})[_0xf11c('0x24')](function(_0x394a17){if(_0x394a17){_0x13088c=_0x394a17[_0xf11c('0x44')];if(!_0x114750[_0xf11c('0x2e')]['hasOwnProperty'](_0xf11c('0x35'))){_0x3e47a7[_0xf11c('0x1d')]=qs[_0xf11c('0x1d')](_0x114750[_0xf11c('0x2e')][_0xf11c('0x1d')]);_0x3e47a7['offset']=qs['offset'](_0x114750[_0xf11c('0x2e')]['offset']);}return _0x1250e5[_0xf11c('0x4e')](_0x3e47a7);}})[_0xf11c('0x24')](function(_0x2dc941){if(_0x2dc941){return _0x2dc941?{'count':_0x13088c,'rows':_0x2dc941}:null;}})['then'](respondWithResult(_0x3fbcb4,null))[_0xf11c('0x40')](handleError(_0x3fbcb4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 034aba9..23a8cd5 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 _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x1fd437,_0x2c0b47){var _0x40d9e6=function(_0x1668a1){while(--_0x1668a1){_0x1fd437['push'](_0x1fd437['shift']());}};_0x40d9e6(++_0x2c0b47);}(_0x3e74,0x175));var _0x43e7=function(_0xf2f27a,_0x23f2d4){_0xf2f27a=_0xf2f27a-0x0;var _0x28e898=_0x3e74[_0xf2f27a];return _0x28e898;};'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 _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0xc3aae7,_0x3bfa91){var _0x1f365a=function(_0x465838){while(--_0x465838){_0xc3aae7['push'](_0xc3aae7['shift']());}};_0x1f365a(++_0x3bfa91);}(_0x3e74,0x175));var _0x43e7=function(_0x58d80f,_0x470203){_0x58d80f=_0x58d80f-0x0;var _0xc867d6=_0x3e74[_0x58d80f];return _0xc867d6;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 620c89f..6e03e04 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 _0x33a1=['code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x33a1,0x18c));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var moment=require(_0x133a('0x2'));var BPromise=require('bluebird');var rs=require(_0x133a('0x3'));var fs=require('fs');var Redis=require(_0x133a('0x4'));var db=require(_0x133a('0x5'))['db'];var utils=require(_0x133a('0x6'));var logger=require(_0x133a('0x7'))(_0x133a('0x8'));var config=require(_0x133a('0x9'));var jayson=require(_0x133a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3496c8,_0x4a6ac5,_0x53d316){return new BPromise(function(_0x97f062,_0x13cadf){return client[_0x133a('0xb')](_0x3496c8,_0x53d316)[_0x133a('0xc')](function(_0x1b7563){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4a6ac5,_0x133a('0xd'));logger[_0x133a('0xe')](_0x133a('0xf'),_0x4a6ac5,_0x133a('0xd'),JSON[_0x133a('0x10')](_0x1b7563));if(_0x1b7563[_0x133a('0x11')]){if(_0x1b7563[_0x133a('0x11')][_0x133a('0x12')]===0x1f4){logger[_0x133a('0x11')](_0x133a('0x13'),_0x4a6ac5,_0x1b7563[_0x133a('0x11')]['message']);return _0x13cadf(_0x1b7563[_0x133a('0x11')][_0x133a('0x14')]);}logger[_0x133a('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a6ac5,_0x1b7563[_0x133a('0x11')][_0x133a('0x14')]);return _0x97f062(_0x1b7563['error']['message']);}else{logger[_0x133a('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a6ac5,_0x133a('0xd'));_0x97f062(_0x1b7563[_0x133a('0x16')][_0x133a('0x14')]);}})['catch'](function(_0x215aba){logger['error'](_0x133a('0x13'),_0x4a6ac5,_0x215aba);_0x13cadf(_0x215aba);});});} \ No newline at end of file +var _0x42c2=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch'];(function(_0x23dc0a,_0xcb2d56){var _0x344b73=function(_0x1cda4d){while(--_0x1cda4d){_0x23dc0a['push'](_0x23dc0a['shift']());}};_0x344b73(++_0xcb2d56);}(_0x42c2,0xdc));var _0x242c=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x42c2[_0x43dc7e];return _0x21e12d;};'use strict';var _=require(_0x242c('0x0'));var util=require(_0x242c('0x1'));var moment=require('moment');var BPromise=require(_0x242c('0x2'));var rs=require(_0x242c('0x3'));var fs=require('fs');var Redis=require(_0x242c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x242c('0x5'));var logger=require(_0x242c('0x6'))(_0x242c('0x7'));var config=require(_0x242c('0x8'));var jayson=require(_0x242c('0x9'));var client=jayson[_0x242c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x260edd,_0x4286b1,_0x4f2e65){return new BPromise(function(_0x4664b1,_0x30d01c){return client[_0x242c('0xb')](_0x260edd,_0x4f2e65)[_0x242c('0xc')](function(_0xf35c04){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4286b1,_0x242c('0xd'));logger['debug'](_0x242c('0xe'),_0x4286b1,_0x242c('0xd'),JSON[_0x242c('0xf')](_0xf35c04));if(_0xf35c04['error']){if(_0xf35c04['error'][_0x242c('0x10')]===0x1f4){logger[_0x242c('0x11')](_0x242c('0x12'),_0x4286b1,_0xf35c04[_0x242c('0x11')]['message']);return _0x30d01c(_0xf35c04[_0x242c('0x11')][_0x242c('0x13')]);}logger[_0x242c('0x11')](_0x242c('0x12'),_0x4286b1,_0xf35c04[_0x242c('0x11')][_0x242c('0x13')]);return _0x4664b1(_0xf35c04[_0x242c('0x11')][_0x242c('0x13')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4286b1,'request\x20sent');_0x4664b1(_0xf35c04[_0x242c('0x14')][_0x242c('0x13')]);}})[_0x242c('0x15')](function(_0x28e9b7){logger['error'](_0x242c('0x12'),_0x4286b1,_0x28e9b7);_0x30d01c(_0x28e9b7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 407ebc5..5ceaefc 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 _0x031f=['index','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated'];(function(_0x4cfaca,_0x477428){var _0x33d40f=function(_0x52d342){while(--_0x52d342){_0x4cfaca['push'](_0x4cfaca['shift']());}};_0x33d40f(++_0x477428);}(_0x031f,0x15d));var _0xf031=function(_0xbbe55a,_0x2f90dc){_0xbbe55a=_0xbbe55a-0x0;var _0x3265b2=_0x031f[_0xbbe55a];return _0x3265b2;};'use strict';var multer=require(_0xf031('0x0'));var util=require(_0xf031('0x1'));var path=require(_0xf031('0x2'));var timeout=require(_0xf031('0x3'));var express=require(_0xf031('0x4'));var router=express[_0xf031('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf031('0x6'));var interaction=require(_0xf031('0x7'));var config=require(_0xf031('0x8'));var controller=require(_0xf031('0x9'));router['get']('/',auth[_0xf031('0xa')](),controller[_0xf031('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf031('0xc')]('/',auth[_0xf031('0xa')](),controller[_0xf031('0xd')]);router['put'](_0xf031('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xf031('0xf')](_0xf031('0xe'),auth['isAuthenticated'](),controller[_0xf031('0x10')]);module[_0xf031('0x11')]=router; \ No newline at end of file +var _0x3052=['update','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','show','post','create'];(function(_0x2f7650,_0x16d848){var _0x3beecf=function(_0x320ea7){while(--_0x320ea7){_0x2f7650['push'](_0x2f7650['shift']());}};_0x3beecf(++_0x16d848);}(_0x3052,0xd5));var _0x2305=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3052[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x2305('0x0'));var path=require(_0x2305('0x1'));var timeout=require(_0x2305('0x2'));var express=require(_0x2305('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2305('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x2305('0x5')]('/',auth[_0x2305('0x6')](),controller[_0x2305('0x7')]);router[_0x2305('0x5')]('/:id',auth[_0x2305('0x6')](),controller[_0x2305('0x8')]);router[_0x2305('0x9')]('/',auth[_0x2305('0x6')](),controller[_0x2305('0xa')]);router['put']('/:id',auth[_0x2305('0x6')](),controller[_0x2305('0xb')]);router[_0x2305('0xc')](_0x2305('0xd'),auth[_0x2305('0x6')](),controller[_0x2305('0xe')]);module[_0x2305('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 10326e9..083a7b2 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 _0xa388=['STRING','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa388,0x19f));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8a38('0x0'),_0x8a38('0x1'),_0x8a38('0x2'),_0x8a38('0x3'),_0x8a38('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8a38('0x5')]},'key':{'type':Sequelize[_0x8a38('0x5')]},'keyType':{'type':Sequelize[_0x8a38('0x6')](_0x8a38('0x0'),_0x8a38('0x1'),_0x8a38('0x2'))},'keyContent':{'type':Sequelize[_0x8a38('0x5')]},'idField':{'type':Sequelize[_0x8a38('0x5')]},'nameField':{'type':Sequelize[_0x8a38('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a38('0x5')]}}; \ No newline at end of file +var _0xb851=['keyValue','string','STRING','customVariable','sequelize','exports','ENUM','variable'];(function(_0x59ad17,_0x4bf7cc){var _0x11178c=function(_0x5641d3){while(--_0x5641d3){_0x59ad17['push'](_0x59ad17['shift']());}};_0x11178c(++_0x4bf7cc);}(_0xb851,0x114));var _0x1b85=function(_0x1e8bfb,_0x49c12b){_0x1e8bfb=_0x1e8bfb-0x0;var _0x2d70c9=_0xb851[_0x1e8bfb];return _0x2d70c9;};'use strict';var Sequelize=require(_0x1b85('0x0'));module[_0x1b85('0x1')]={'type':{'type':Sequelize[_0x1b85('0x2')]('string',_0x1b85('0x3'),'customVariable',_0x1b85('0x4'),'picklist'),'defaultValue':_0x1b85('0x5')},'content':{'type':Sequelize[_0x1b85('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1b85('0x2')](_0x1b85('0x5'),_0x1b85('0x3'),_0x1b85('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1b85('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index b199783..ed1c044 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 _0xcfba=['keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','update','body','destroy','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','end','error','stack','name','index','map','Dynamics365Field','rawAttributes','key','model'];(function(_0x4c63ac,_0x27778f){var _0x59627b=function(_0x1841f3){while(--_0x1841f3){_0x4c63ac['push'](_0x4c63ac['shift']());}};_0x59627b(++_0x27778f);}(_0xcfba,0x183));var _0xacfb=function(_0xf1c314,_0x1eb23b){_0xf1c314=_0xf1c314-0x0;var _0x1b5e72=_0xcfba[_0xf1c314];return _0x1b5e72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacfb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacfb('0x1'));var rp=require(_0xacfb('0x2'));var moment=require('moment');var BPromise=require(_0xacfb('0x3'));var Mustache=require(_0xacfb('0x4'));var util=require(_0xacfb('0x5'));var path=require('path');var sox=require(_0xacfb('0x6'));var csv=require(_0xacfb('0x7'));var ejs=require(_0xacfb('0x8'));var fs=require('fs');var fs_extra=require(_0xacfb('0x9'));var _=require(_0xacfb('0xa'));var squel=require('squel');var crypto=require(_0xacfb('0xb'));var jsforce=require(_0xacfb('0xc'));var deskjs=require(_0xacfb('0xd'));var toCsv=require(_0xacfb('0x7'));var querystring=require(_0xacfb('0xe'));var Papa=require(_0xacfb('0xf'));var Redis=require(_0xacfb('0x10'));var authService=require(_0xacfb('0x11'));var qs=require(_0xacfb('0x12'));var as=require(_0xacfb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacfb('0x14'))(_0xacfb('0x15'));var utils=require(_0xacfb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e7494,_0x511cc6){_0x511cc6=_0x511cc6||0xcc;return function(_0x371640){if(_0x371640){return _0x2e7494[_0xacfb('0x17')](_0x511cc6);}return _0x2e7494[_0xacfb('0x18')](_0x511cc6)['end']();};}function respondWithResult(_0x79d588,_0x318000){_0x318000=_0x318000||0xc8;return function(_0x4da12d){if(_0x4da12d){return _0x79d588[_0xacfb('0x18')](_0x318000)['json'](_0x4da12d);}};}function respondWithFilteredResult(_0x18c857,_0x3778c3){return function(_0x9bd882){if(_0x9bd882){var _0x5b5241=typeof _0x3778c3[_0xacfb('0x19')]===_0xacfb('0x1a')&&typeof _0x3778c3[_0xacfb('0x1b')]===_0xacfb('0x1a');var _0x1a873d=_0x9bd882[_0xacfb('0x1c')];var _0x55d1c8=_0x5b5241?0x0:_0x3778c3['offset'];var _0x15024f=_0x5b5241?_0x9bd882[_0xacfb('0x1c')]:_0x3778c3[_0xacfb('0x19')]+_0x3778c3[_0xacfb('0x1b')];var _0x107f05;if(_0x15024f>=_0x1a873d){_0x15024f=_0x1a873d;_0x107f05=0xc8;}else{_0x107f05=0xce;}_0x18c857['status'](_0x107f05);return _0x18c857['set'](_0xacfb('0x1d'),_0x55d1c8+'-'+_0x15024f+'/'+_0x1a873d)[_0xacfb('0x1e')](_0x9bd882);}return null;};}function patchUpdates(_0x2eebb3){return function(_0x17d7ec){try{jsonpatch[_0xacfb('0x1f')](_0x17d7ec,_0x2eebb3,!![]);}catch(_0x3b7e95){return BPromise[_0xacfb('0x20')](_0x3b7e95);}return _0x17d7ec[_0xacfb('0x21')]();};}function saveUpdates(_0x186bad,_0x290751){return function(_0x4300f4){if(_0x4300f4){return _0x4300f4['update'](_0x186bad)[_0xacfb('0x22')](function(_0x37f238){return _0x37f238;});}return null;};}function removeEntity(_0x4eb4b6,_0x15503d){return function(_0x353311){if(_0x353311){return _0x353311['destroy']()[_0xacfb('0x22')](function(){_0x4eb4b6[_0xacfb('0x18')](0xcc)[_0xacfb('0x23')]();});}};}function handleEntityNotFound(_0x43cdd0,_0xfe30d3){return function(_0x2dfcd8){if(!_0x2dfcd8){_0x43cdd0[_0xacfb('0x17')](0x194);}return _0x2dfcd8;};}function handleError(_0x224bcf,_0x25baa1){_0x25baa1=_0x25baa1||0x1f4;return function(_0x305b19){logger[_0xacfb('0x24')](_0x305b19[_0xacfb('0x25')]);if(_0x305b19[_0xacfb('0x26')]){delete _0x305b19[_0xacfb('0x26')];}_0x224bcf[_0xacfb('0x18')](_0x25baa1)['send'](_0x305b19);};}exports[_0xacfb('0x27')]=function(_0xff01ef,_0x228971){var _0x4e761b={},_0x2f18a9={},_0x4e7852={'count':0x0,'rows':[]};var _0x30d3e7=_[_0xacfb('0x28')](db[_0xacfb('0x29')][_0xacfb('0x2a')],function(_0x233e36){return{'name':_0x233e36['fieldName'],'type':_0x233e36['type'][_0xacfb('0x2b')]};});_0x2f18a9[_0xacfb('0x2c')]=_[_0xacfb('0x28')](_0x30d3e7,_0xacfb('0x26'));_0x2f18a9['query']=_[_0xacfb('0x2d')](_0xff01ef[_0xacfb('0x2e')]);_0x2f18a9[_0xacfb('0x2f')]=_[_0xacfb('0x30')](_0x2f18a9[_0xacfb('0x2c')],_0x2f18a9[_0xacfb('0x2e')]);_0x4e761b['attributes']=_[_0xacfb('0x30')](_0x2f18a9[_0xacfb('0x2c')],qs[_0xacfb('0x31')](_0xff01ef[_0xacfb('0x2e')][_0xacfb('0x31')]));_0x4e761b[_0xacfb('0x32')]=_0x4e761b[_0xacfb('0x32')][_0xacfb('0x33')]?_0x4e761b[_0xacfb('0x32')]:_0x2f18a9[_0xacfb('0x2c')];if(!_0xff01ef[_0xacfb('0x2e')]['hasOwnProperty'](_0xacfb('0x34'))){_0x4e761b[_0xacfb('0x1b')]=qs[_0xacfb('0x1b')](_0xff01ef[_0xacfb('0x2e')][_0xacfb('0x1b')]);_0x4e761b[_0xacfb('0x19')]=qs[_0xacfb('0x19')](_0xff01ef['query']['offset']);}_0x4e761b['order']=qs[_0xacfb('0x35')](_0xff01ef[_0xacfb('0x2e')][_0xacfb('0x35')]);_0x4e761b[_0xacfb('0x36')]=qs['filters'](_[_0xacfb('0x37')](_0xff01ef['query'],_0x2f18a9[_0xacfb('0x2f')]),_0x30d3e7);if(_0xff01ef[_0xacfb('0x2e')]['filter']){_0x4e761b[_0xacfb('0x36')]=_['merge'](_0x4e761b[_0xacfb('0x36')],{'$or':_[_0xacfb('0x28')](_0x30d3e7,function(_0x41bffd){if(_0x41bffd[_0xacfb('0x38')]!==_0xacfb('0x39')){var _0x4a9b70={};_0x4a9b70[_0x41bffd[_0xacfb('0x26')]]={'$like':'%'+_0xff01ef[_0xacfb('0x2e')][_0xacfb('0x3a')]+'%'};return _0x4a9b70;}})});}_0x4e761b=_[_0xacfb('0x3b')]({},_0x4e761b,_0xff01ef[_0xacfb('0x3c')]);var _0x30cebb={'where':_0x4e761b[_0xacfb('0x36')]};return db[_0xacfb('0x29')][_0xacfb('0x1c')](_0x30cebb)[_0xacfb('0x22')](function(_0x1b97dc){_0x4e7852['count']=_0x1b97dc;if(_0xff01ef[_0xacfb('0x2e')]['includeAll']){_0x4e761b[_0xacfb('0x3d')]=[{'all':!![]}];}return db[_0xacfb('0x29')]['findAll'](_0x4e761b);})[_0xacfb('0x22')](function(_0x1235a7){_0x4e7852[_0xacfb('0x3e')]=_0x1235a7;return _0x4e7852;})[_0xacfb('0x22')](respondWithFilteredResult(_0x228971,_0x4e761b))[_0xacfb('0x3f')](handleError(_0x228971,null));};exports[_0xacfb('0x40')]=function(_0x400178,_0x1baf10){var _0x4f70a5={'raw':!![],'where':{'id':_0x400178[_0xacfb('0x41')]['id']}},_0x260524={};_0x260524[_0xacfb('0x2c')]=_['keys'](db[_0xacfb('0x29')][_0xacfb('0x2a')]);_0x260524[_0xacfb('0x2e')]=_['keys'](_0x400178['query']);_0x260524[_0xacfb('0x2f')]=_['intersection'](_0x260524[_0xacfb('0x2c')],_0x260524[_0xacfb('0x2e')]);_0x4f70a5[_0xacfb('0x32')]=_['intersection'](_0x260524[_0xacfb('0x2c')],qs[_0xacfb('0x31')](_0x400178['query'][_0xacfb('0x31')]));_0x4f70a5[_0xacfb('0x32')]=_0x4f70a5[_0xacfb('0x32')]['length']?_0x4f70a5['attributes']:_0x260524[_0xacfb('0x2c')];if(_0x400178['query'][_0xacfb('0x42')]){_0x4f70a5[_0xacfb('0x3d')]=[{'all':!![]}];}_0x4f70a5=_[_0xacfb('0x3b')]({},_0x4f70a5,_0x400178[_0xacfb('0x3c')]);return db[_0xacfb('0x29')][_0xacfb('0x43')](_0x4f70a5)['then'](handleEntityNotFound(_0x1baf10,null))[_0xacfb('0x22')](respondWithResult(_0x1baf10,null))['catch'](handleError(_0x1baf10,null));};exports['create']=function(_0x170585,_0x2a0b23){return db[_0xacfb('0x29')][_0xacfb('0x44')](_0x170585['body'],{})[_0xacfb('0x22')](respondWithResult(_0x2a0b23,0xc9))['catch'](handleError(_0x2a0b23,null));};exports[_0xacfb('0x45')]=function(_0x364ca6,_0x20155d){if(_0x364ca6[_0xacfb('0x46')]['id']){delete _0x364ca6[_0xacfb('0x46')]['id'];}return db[_0xacfb('0x29')]['find']({'where':{'id':_0x364ca6[_0xacfb('0x41')]['id']}})['then'](handleEntityNotFound(_0x20155d,null))['then'](saveUpdates(_0x364ca6[_0xacfb('0x46')],null))['then'](respondWithResult(_0x20155d,null))['catch'](handleError(_0x20155d,null));};exports[_0xacfb('0x47')]=function(_0x4d2578,_0x18fbc6){return db[_0xacfb('0x29')][_0xacfb('0x43')]({'where':{'id':_0x4d2578['params']['id']}})[_0xacfb('0x22')](handleEntityNotFound(_0x18fbc6,null))[_0xacfb('0x22')](removeEntity(_0x18fbc6,null))[_0xacfb('0x3f')](handleError(_0x18fbc6,null));}; \ No newline at end of file +var _0x47fb=['index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Dynamics365Field','includeAll','include','findAll','catch','show','keys','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','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','../../mysqldb','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x47fb,0xb3));var _0xb47f=function(_0x3d21fb,_0x4fa5ec){_0x3d21fb=_0x3d21fb-0x0;var _0x1f649a=_0x47fb[_0x3d21fb];return _0x1f649a;};'use strict';var emlformat=require(_0xb47f('0x0'));var rimraf=require(_0xb47f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb47f('0x2'));var rp=require(_0xb47f('0x3'));var moment=require(_0xb47f('0x4'));var BPromise=require(_0xb47f('0x5'));var Mustache=require('mustache');var util=require(_0xb47f('0x6'));var path=require(_0xb47f('0x7'));var sox=require(_0xb47f('0x8'));var csv=require('to-csv');var ejs=require(_0xb47f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb47f('0xa'));var squel=require('squel');var crypto=require(_0xb47f('0xb'));var jsforce=require(_0xb47f('0xc'));var deskjs=require(_0xb47f('0xd'));var toCsv=require(_0xb47f('0xe'));var querystring=require(_0xb47f('0xf'));var Papa=require(_0xb47f('0x10'));var Redis=require(_0xb47f('0x11'));var authService=require(_0xb47f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb47f('0x13'));var hardwareService=require(_0xb47f('0x14'));var logger=require(_0xb47f('0x15'))(_0xb47f('0x16'));var utils=require(_0xb47f('0x17'));var config=require(_0xb47f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb47f('0x19'))['db'];function respondWithStatusCode(_0x4bf257,_0x4d71df){_0x4d71df=_0x4d71df||0xcc;return function(_0x866fa9){if(_0x866fa9){return _0x4bf257['sendStatus'](_0x4d71df);}return _0x4bf257['status'](_0x4d71df)[_0xb47f('0x1a')]();};}function respondWithResult(_0x1bc2d4,_0x502b15){_0x502b15=_0x502b15||0xc8;return function(_0x55086a){if(_0x55086a){return _0x1bc2d4['status'](_0x502b15)['json'](_0x55086a);}};}function respondWithFilteredResult(_0x5b783f,_0x478b7f){return function(_0x3939e2){if(_0x3939e2){var _0x2f5682=typeof _0x478b7f['offset']===_0xb47f('0x1b')&&typeof _0x478b7f[_0xb47f('0x1c')]===_0xb47f('0x1b');var _0x432830=_0x3939e2[_0xb47f('0x1d')];var _0x48c5ce=_0x2f5682?0x0:_0x478b7f[_0xb47f('0x1e')];var _0xe6aec6=_0x2f5682?_0x3939e2[_0xb47f('0x1d')]:_0x478b7f['offset']+_0x478b7f[_0xb47f('0x1c')];var _0x3f76ff;if(_0xe6aec6>=_0x432830){_0xe6aec6=_0x432830;_0x3f76ff=0xc8;}else{_0x3f76ff=0xce;}_0x5b783f[_0xb47f('0x1f')](_0x3f76ff);return _0x5b783f[_0xb47f('0x20')](_0xb47f('0x21'),_0x48c5ce+'-'+_0xe6aec6+'/'+_0x432830)[_0xb47f('0x22')](_0x3939e2);}return null;};}function patchUpdates(_0x202768){return function(_0xe55196){try{jsonpatch[_0xb47f('0x23')](_0xe55196,_0x202768,!![]);}catch(_0x181d64){return BPromise[_0xb47f('0x24')](_0x181d64);}return _0xe55196[_0xb47f('0x25')]();};}function saveUpdates(_0x54c1ab,_0x2d6b49){return function(_0xeaf8b3){if(_0xeaf8b3){return _0xeaf8b3[_0xb47f('0x26')](_0x54c1ab)[_0xb47f('0x27')](function(_0x11cd86){return _0x11cd86;});}return null;};}function removeEntity(_0x19d79b,_0x277a31){return function(_0x1ac91f){if(_0x1ac91f){return _0x1ac91f[_0xb47f('0x28')]()[_0xb47f('0x27')](function(){_0x19d79b[_0xb47f('0x1f')](0xcc)[_0xb47f('0x1a')]();});}};}function handleEntityNotFound(_0x168a83,_0x41fdff){return function(_0x810bf){if(!_0x810bf){_0x168a83[_0xb47f('0x29')](0x194);}return _0x810bf;};}function handleError(_0x4de307,_0x2c95ce){_0x2c95ce=_0x2c95ce||0x1f4;return function(_0x4cf9e6){logger[_0xb47f('0x2a')](_0x4cf9e6[_0xb47f('0x2b')]);if(_0x4cf9e6[_0xb47f('0x2c')]){delete _0x4cf9e6['name'];}_0x4de307[_0xb47f('0x1f')](_0x2c95ce)[_0xb47f('0x2d')](_0x4cf9e6);};}exports[_0xb47f('0x2e')]=function(_0x263888,_0x4a01a7){var _0x302b1d={},_0x15bd31={},_0x49d7c2={'count':0x0,'rows':[]};var _0x1cdc8e=_[_0xb47f('0x2f')](db['Dynamics365Field'][_0xb47f('0x30')],function(_0x45d7bf){return{'name':_0x45d7bf['fieldName'],'type':_0x45d7bf[_0xb47f('0x31')]['key']};});_0x15bd31[_0xb47f('0x32')]=_['map'](_0x1cdc8e,'name');_0x15bd31[_0xb47f('0x33')]=_['keys'](_0x263888[_0xb47f('0x33')]);_0x15bd31[_0xb47f('0x34')]=_[_0xb47f('0x35')](_0x15bd31[_0xb47f('0x32')],_0x15bd31[_0xb47f('0x33')]);_0x302b1d[_0xb47f('0x36')]=_['intersection'](_0x15bd31['model'],qs[_0xb47f('0x37')](_0x263888[_0xb47f('0x33')][_0xb47f('0x37')]));_0x302b1d[_0xb47f('0x36')]=_0x302b1d[_0xb47f('0x36')]['length']?_0x302b1d[_0xb47f('0x36')]:_0x15bd31[_0xb47f('0x32')];if(!_0x263888[_0xb47f('0x33')][_0xb47f('0x38')](_0xb47f('0x39'))){_0x302b1d[_0xb47f('0x1c')]=qs[_0xb47f('0x1c')](_0x263888['query'][_0xb47f('0x1c')]);_0x302b1d[_0xb47f('0x1e')]=qs[_0xb47f('0x1e')](_0x263888[_0xb47f('0x33')][_0xb47f('0x1e')]);}_0x302b1d['order']=qs[_0xb47f('0x3a')](_0x263888[_0xb47f('0x33')][_0xb47f('0x3a')]);_0x302b1d[_0xb47f('0x3b')]=qs[_0xb47f('0x34')](_[_0xb47f('0x3c')](_0x263888['query'],_0x15bd31[_0xb47f('0x34')]),_0x1cdc8e);if(_0x263888['query'][_0xb47f('0x3d')]){_0x302b1d[_0xb47f('0x3b')]=_[_0xb47f('0x3e')](_0x302b1d[_0xb47f('0x3b')],{'$or':_[_0xb47f('0x2f')](_0x1cdc8e,function(_0x6c39ba){if(_0x6c39ba[_0xb47f('0x31')]!=='VIRTUAL'){var _0x128b9b={};_0x128b9b[_0x6c39ba[_0xb47f('0x2c')]]={'$like':'%'+_0x263888[_0xb47f('0x33')]['filter']+'%'};return _0x128b9b;}})});}_0x302b1d=_[_0xb47f('0x3e')]({},_0x302b1d,_0x263888[_0xb47f('0x3f')]);var _0x8e4114={'where':_0x302b1d['where']};return db[_0xb47f('0x40')][_0xb47f('0x1d')](_0x8e4114)[_0xb47f('0x27')](function(_0x955d36){_0x49d7c2['count']=_0x955d36;if(_0x263888[_0xb47f('0x33')][_0xb47f('0x41')]){_0x302b1d[_0xb47f('0x42')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xb47f('0x43')](_0x302b1d);})['then'](function(_0x424961){_0x49d7c2['rows']=_0x424961;return _0x49d7c2;})[_0xb47f('0x27')](respondWithFilteredResult(_0x4a01a7,_0x302b1d))[_0xb47f('0x44')](handleError(_0x4a01a7,null));};exports[_0xb47f('0x45')]=function(_0xabad31,_0x5052cb){var _0x5bb7f7={'raw':!![],'where':{'id':_0xabad31['params']['id']}},_0x5017df={};_0x5017df[_0xb47f('0x32')]=_[_0xb47f('0x46')](db['Dynamics365Field'][_0xb47f('0x30')]);_0x5017df['query']=_[_0xb47f('0x46')](_0xabad31[_0xb47f('0x33')]);_0x5017df['filters']=_[_0xb47f('0x35')](_0x5017df[_0xb47f('0x32')],_0x5017df['query']);_0x5bb7f7[_0xb47f('0x36')]=_[_0xb47f('0x35')](_0x5017df[_0xb47f('0x32')],qs[_0xb47f('0x37')](_0xabad31[_0xb47f('0x33')][_0xb47f('0x37')]));_0x5bb7f7[_0xb47f('0x36')]=_0x5bb7f7['attributes']['length']?_0x5bb7f7[_0xb47f('0x36')]:_0x5017df[_0xb47f('0x32')];if(_0xabad31['query'][_0xb47f('0x41')]){_0x5bb7f7[_0xb47f('0x42')]=[{'all':!![]}];}_0x5bb7f7=_[_0xb47f('0x3e')]({},_0x5bb7f7,_0xabad31[_0xb47f('0x3f')]);return db[_0xb47f('0x40')][_0xb47f('0x47')](_0x5bb7f7)[_0xb47f('0x27')](handleEntityNotFound(_0x5052cb,null))['then'](respondWithResult(_0x5052cb,null))[_0xb47f('0x44')](handleError(_0x5052cb,null));};exports[_0xb47f('0x48')]=function(_0x58f29d,_0x2ab2f0){return db['Dynamics365Field'][_0xb47f('0x48')](_0x58f29d[_0xb47f('0x49')],{})[_0xb47f('0x27')](respondWithResult(_0x2ab2f0,0xc9))['catch'](handleError(_0x2ab2f0,null));};exports[_0xb47f('0x26')]=function(_0x23798e,_0x486094){if(_0x23798e[_0xb47f('0x49')]['id']){delete _0x23798e[_0xb47f('0x49')]['id'];}return db[_0xb47f('0x40')][_0xb47f('0x47')]({'where':{'id':_0x23798e[_0xb47f('0x4a')]['id']}})[_0xb47f('0x27')](handleEntityNotFound(_0x486094,null))[_0xb47f('0x27')](saveUpdates(_0x23798e['body'],null))[_0xb47f('0x27')](respondWithResult(_0x486094,null))['catch'](handleError(_0x486094,null));};exports['destroy']=function(_0xc0ca29,_0x22406c){return db[_0xb47f('0x40')]['find']({'where':{'id':_0xc0ca29['params']['id']}})[_0xb47f('0x27')](handleEntityNotFound(_0x22406c,null))[_0xb47f('0x27')](removeEntity(_0x22406c,null))[_0xb47f('0x44')](handleError(_0x22406c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 56a8422..0379383 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 _0xe418=['dynamics365_unique_index','idField','FieldId','api','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields'];(function(_0x524c1c,_0x1b8a33){var _0x4e2560=function(_0x5ef4f6){while(--_0x5ef4f6){_0x524c1c['push'](_0x524c1c['shift']());}};_0x4e2560(++_0x1b8a33);}(_0xe418,0xf3));var _0x8e41=function(_0x4e8c2e,_0x55bcf4){_0x4e8c2e=_0x4e8c2e-0x0;var _0x5c1ecc=_0xe418[_0x4e8c2e];return _0x5c1ecc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8e41('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e41('0x1'));var fs=require('fs');var path=require(_0x8e41('0x2'));var rimraf=require(_0x8e41('0x3'));var config=require(_0x8e41('0x4'));var attributes=require(_0x8e41('0x5'));module[_0x8e41('0x6')]=function(_0x1c6c27,_0x2f9b1a){return _0x1c6c27['define'](_0x8e41('0x7'),attributes,{'tableName':_0x8e41('0x8'),'paranoid':![],'indexes':[{'name':_0x8e41('0x9'),'fields':[_0x8e41('0xa'),_0x8e41('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2915=['path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2611c7,_0x33f9c8){var _0xfbe54d=function(_0xcee2aa){while(--_0xcee2aa){_0x2611c7['push'](_0x2611c7['shift']());}};_0xfbe54d(++_0x33f9c8);}(_0x2915,0x14d));var _0x5291=function(_0x13239e,_0x1ff4d4){_0x13239e=_0x13239e-0x0;var _0x558aef=_0x2915[_0x13239e];return _0x558aef;};'use strict';var _=require(_0x5291('0x0'));var util=require(_0x5291('0x1'));var logger=require(_0x5291('0x2'))(_0x5291('0x3'));var moment=require(_0x5291('0x4'));var BPromise=require(_0x5291('0x5'));var rp=require(_0x5291('0x6'));var fs=require('fs');var path=require(_0x5291('0x7'));var rimraf=require('rimraf');var config=require(_0x5291('0x8'));var attributes=require(_0x5291('0x9'));module[_0x5291('0xa')]=function(_0x3cf39e,_0x58d9b2){return _0x3cf39e[_0x5291('0xb')](_0x5291('0xc'),attributes,{'tableName':_0x5291('0xd'),'paranoid':![],'indexes':[{'name':_0x5291('0xe'),'fields':[_0x5291('0xf'),_0x5291('0x10')],'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 7d490b6..a37b4ff 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 _0xbaef=['client','http','request','then','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xa650fb,_0x104a00){var _0x99f4de=function(_0x5f4d31){while(--_0x5f4d31){_0xa650fb['push'](_0xa650fb['shift']());}};_0x99f4de(++_0x104a00);}(_0xbaef,0x187));var _0xfbae=function(_0x17bf4e,_0x43e95b){_0x17bf4e=_0x17bf4e-0x0;var _0x3156ce=_0xbaef[_0x17bf4e];return _0x3156ce;};'use strict';var _=require(_0xfbae('0x0'));var util=require('util');var moment=require(_0xfbae('0x1'));var BPromise=require(_0xfbae('0x2'));var rs=require(_0xfbae('0x3'));var fs=require('fs');var Redis=require(_0xfbae('0x4'));var db=require(_0xfbae('0x5'))['db'];var utils=require(_0xfbae('0x6'));var logger=require('../../config/logger')(_0xfbae('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfbae('0x8')][_0xfbae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf53cf0,_0x16cd65,_0x438e06){return new BPromise(function(_0x41a8e6,_0x3c458e){return client[_0xfbae('0xa')](_0xf53cf0,_0x438e06)[_0xfbae('0xb')](function(_0x44ac40){logger['info'](_0xfbae('0xc'),_0x16cd65,'request\x20sent');logger['debug'](_0xfbae('0xd'),_0x16cd65,'request\x20sent',JSON['stringify'](_0x44ac40));if(_0x44ac40['error']){if(_0x44ac40[_0xfbae('0xe')][_0xfbae('0xf')]===0x1f4){logger[_0xfbae('0xe')](_0xfbae('0xc'),_0x16cd65,_0x44ac40[_0xfbae('0xe')][_0xfbae('0x10')]);return _0x3c458e(_0x44ac40['error']['message']);}logger[_0xfbae('0xe')](_0xfbae('0xc'),_0x16cd65,_0x44ac40[_0xfbae('0xe')]['message']);return _0x41a8e6(_0x44ac40[_0xfbae('0xe')][_0xfbae('0x10')]);}else{logger[_0xfbae('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x16cd65,_0xfbae('0x12'));_0x41a8e6(_0x44ac40['result']['message']);}})['catch'](function(_0x1d3575){logger[_0xfbae('0xe')](_0xfbae('0xc'),_0x16cd65,_0x1d3575);_0x3c458e(_0x1d3575);});});} \ No newline at end of file +var _0x3b98=['../../config/logger','rpc','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','../../mysqldb','../../config/utils'];(function(_0x521435,_0x36c7a3){var _0x533b57=function(_0x514c21){while(--_0x514c21){_0x521435['push'](_0x521435['shift']());}};_0x533b57(++_0x36c7a3);}(_0x3b98,0xd4));var _0x83b9=function(_0x70f71,_0x2689e1){_0x70f71=_0x70f71-0x0;var _0x5c37dc=_0x3b98[_0x70f71];return _0x5c37dc;};'use strict';var _=require(_0x83b9('0x0'));var util=require('util');var moment=require(_0x83b9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83b9('0x2'))['db'];var utils=require(_0x83b9('0x3'));var logger=require(_0x83b9('0x4'))(_0x83b9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x83b9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x28033c,_0x5ce91e,_0x2d4c65){return new BPromise(function(_0x4cdbf5,_0x47d0e3){return client[_0x83b9('0x7')](_0x28033c,_0x2d4c65)[_0x83b9('0x8')](function(_0x1a6116){logger[_0x83b9('0x9')](_0x83b9('0xa'),_0x5ce91e,_0x83b9('0xb'));logger[_0x83b9('0xc')](_0x83b9('0xd'),_0x5ce91e,_0x83b9('0xb'),JSON[_0x83b9('0xe')](_0x1a6116));if(_0x1a6116[_0x83b9('0xf')]){if(_0x1a6116['error']['code']===0x1f4){logger[_0x83b9('0xf')](_0x83b9('0xa'),_0x5ce91e,_0x1a6116['error'][_0x83b9('0x10')]);return _0x47d0e3(_0x1a6116['error'][_0x83b9('0x10')]);}logger[_0x83b9('0xf')](_0x83b9('0xa'),_0x5ce91e,_0x1a6116[_0x83b9('0xf')]['message']);return _0x4cdbf5(_0x1a6116[_0x83b9('0xf')][_0x83b9('0x10')]);}else{logger[_0x83b9('0x9')](_0x83b9('0xa'),_0x5ce91e,_0x83b9('0xb'));_0x4cdbf5(_0x1a6116[_0x83b9('0x11')][_0x83b9('0x10')]);}})['catch'](function(_0x4134b8){logger[_0x83b9('0xf')](_0x83b9('0xa'),_0x5ce91e,_0x4134b8);_0x47d0e3(_0x4134b8);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b844bdd..b1d07c7 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 _0x2776=['getFields','post','/:id/configurations','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','/:id/fields'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x2776,0x12e));var _0x6277=function(_0x5ca5d3,_0x532add){_0x5ca5d3=_0x5ca5d3-0x0;var _0xb1712d=_0x2776[_0x5ca5d3];return _0xb1712d;};'use strict';var multer=require('multer');var util=require(_0x6277('0x0'));var path=require(_0x6277('0x1'));var timeout=require(_0x6277('0x2'));var express=require(_0x6277('0x3'));var router=express['Router']();var fs_extra=require(_0x6277('0x4'));var auth=require(_0x6277('0x5'));var interaction=require(_0x6277('0x6'));var config=require('../../config/environment');var controller=require(_0x6277('0x7'));router[_0x6277('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6277('0x9'),auth[_0x6277('0xa')](),controller[_0x6277('0xb')]);router[_0x6277('0x8')]('/:id/configurations',auth[_0x6277('0xa')](),controller['getConfigurations']);router[_0x6277('0x8')](_0x6277('0xc'),auth['isAuthenticated'](),controller[_0x6277('0xd')]);router['post']('/',auth[_0x6277('0xa')](),controller['create']);router[_0x6277('0xe')](_0x6277('0xf'),auth[_0x6277('0xa')](),controller[_0x6277('0x10')]);router[_0x6277('0x11')](_0x6277('0x9'),auth['isAuthenticated'](),controller[_0x6277('0x12')]);router[_0x6277('0x13')]('/:id',auth[_0x6277('0xa')](),controller['destroy']);module[_0x6277('0x14')]=router; \ No newline at end of file +var _0x76a4=['put','update','delete','destroy','util','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x859ed8,_0x35c6b9){var _0x428843=function(_0x5496a0){while(--_0x5496a0){_0x859ed8['push'](_0x859ed8['shift']());}};_0x428843(++_0x35c6b9);}(_0x76a4,0x72));var _0x476a=function(_0x48b9ba,_0x5cd940){_0x48b9ba=_0x48b9ba-0x0;var _0x38bd5a=_0x76a4[_0x48b9ba];return _0x38bd5a;};'use strict';var multer=require('multer');var util=require(_0x476a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x476a('0x1'));var router=express[_0x476a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x476a('0x3'));var config=require(_0x476a('0x4'));var controller=require(_0x476a('0x5'));router[_0x476a('0x6')]('/',auth[_0x476a('0x7')](),controller[_0x476a('0x8')]);router[_0x476a('0x6')](_0x476a('0x9'),auth[_0x476a('0x7')](),controller[_0x476a('0xa')]);router[_0x476a('0x6')](_0x476a('0xb'),auth['isAuthenticated'](),controller[_0x476a('0xc')]);router[_0x476a('0x6')](_0x476a('0xd'),auth['isAuthenticated'](),controller[_0x476a('0xe')]);router[_0x476a('0xf')]('/',auth[_0x476a('0x7')](),controller[_0x476a('0x10')]);router[_0x476a('0xf')]('/:id/configurations',auth[_0x476a('0x7')](),controller[_0x476a('0x11')]);router[_0x476a('0x12')](_0x476a('0x9'),auth['isAuthenticated'](),controller[_0x476a('0x13')]);router[_0x476a('0x14')](_0x476a('0x9'),auth['isAuthenticated'](),controller[_0x476a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3533f1a..4080b86 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5430,0x10c));var _0x0543=function(_0x12b25e,_0x586b4c){_0x12b25e=_0x12b25e-0x0;var _0x5b29c5=_0x5430[_0x12b25e];return _0x5b29c5;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x5430,0x10c));var _0x0543=function(_0x4a505c,_0x38816b){_0x4a505c=_0x4a505c-0x0;var _0x23046c=_0x5430[_0x4a505c];return _0x23046c;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0948f5e..63b7056 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 _0x7834=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','map','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','name','options','FreshdeskAccount','includeAll','include','catch','show','params','keys','find','body','findOne','sort','getConfigurations','Subjects','channel','FreshdeskConfiguration','create','FreshdeskField','Descriptions','getFields','remoteUri','slice','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','remove','custom_text','custom_dropdown','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch'];(function(_0x37032f,_0x1e8527){var _0x29dfe5=function(_0x2f9d59){while(--_0x2f9d59){_0x37032f['push'](_0x37032f['shift']());}};_0x29dfe5(++_0x1e8527);}(_0x7834,0x13f));var _0x4783=function(_0x443cef,_0x2cd289){_0x443cef=_0x443cef-0x0;var _0x147c47=_0x7834[_0x443cef];return _0x147c47;};'use strict';var emlformat=require(_0x4783('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4783('0x1'));var rp=require('request-promise');var moment=require(_0x4783('0x2'));var BPromise=require(_0x4783('0x3'));var Mustache=require(_0x4783('0x4'));var util=require(_0x4783('0x5'));var path=require(_0x4783('0x6'));var sox=require(_0x4783('0x7'));var csv=require(_0x4783('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4783('0x9'));var _=require(_0x4783('0xa'));var squel=require('squel');var crypto=require(_0x4783('0xb'));var jsforce=require(_0x4783('0xc'));var deskjs=require(_0x4783('0xd'));var toCsv=require(_0x4783('0x8'));var querystring=require(_0x4783('0xe'));var Papa=require(_0x4783('0xf'));var Redis=require('ioredis');var authService=require(_0x4783('0x10'));var qs=require(_0x4783('0x11'));var as=require(_0x4783('0x12'));var hardwareService=require(_0x4783('0x13'));var logger=require(_0x4783('0x14'))(_0x4783('0x15'));var utils=require(_0x4783('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4783('0x17'))['db'];var integrations=require(_0x4783('0x18'));function respondWithStatusCode(_0x4ce944,_0x2afbdc){_0x2afbdc=_0x2afbdc||0xcc;return function(_0x5c7d51){if(_0x5c7d51){return _0x4ce944[_0x4783('0x19')](_0x2afbdc);}return _0x4ce944[_0x4783('0x1a')](_0x2afbdc)[_0x4783('0x1b')]();};}function respondWithResult(_0xecb9f9,_0x230ae6){_0x230ae6=_0x230ae6||0xc8;return function(_0x4ceae1){if(_0x4ceae1){return _0xecb9f9[_0x4783('0x1a')](_0x230ae6)[_0x4783('0x1c')](_0x4ceae1);}};}function respondWithFilteredResult(_0x11e996,_0x20788f){return function(_0x3cb485){if(_0x3cb485){var _0x216fbb=typeof _0x20788f[_0x4783('0x1d')]===_0x4783('0x1e')&&typeof _0x20788f[_0x4783('0x1f')]===_0x4783('0x1e');var _0x1bcc3d=_0x3cb485[_0x4783('0x20')];var _0x513074=_0x216fbb?0x0:_0x20788f[_0x4783('0x1d')];var _0xcda581=_0x216fbb?_0x3cb485['count']:_0x20788f[_0x4783('0x1d')]+_0x20788f['limit'];var _0x3064a;if(_0xcda581>=_0x1bcc3d){_0xcda581=_0x1bcc3d;_0x3064a=0xc8;}else{_0x3064a=0xce;}_0x11e996[_0x4783('0x1a')](_0x3064a);return _0x11e996[_0x4783('0x21')](_0x4783('0x22'),_0x513074+'-'+_0xcda581+'/'+_0x1bcc3d)[_0x4783('0x1c')](_0x3cb485);}return null;};}function patchUpdates(_0x2772b3){return function(_0x3a8220){try{jsonpatch['apply'](_0x3a8220,_0x2772b3,!![]);}catch(_0x20acac){return BPromise['reject'](_0x20acac);}return _0x3a8220[_0x4783('0x23')]();};}function saveUpdates(_0x2d592f,_0x46ada4){return function(_0x44aaf3){if(_0x44aaf3){return _0x44aaf3[_0x4783('0x24')](_0x2d592f)['then'](function(_0x2633e6){return _0x2633e6;});}return null;};}function removeEntity(_0x16ee3a,_0xba686e){return function(_0x30ac45){if(_0x30ac45){return _0x30ac45[_0x4783('0x25')]()[_0x4783('0x26')](function(){_0x16ee3a[_0x4783('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d276,_0x3e45d2){return function(_0x5d33f5){if(!_0x5d33f5){_0x22d276['sendStatus'](0x194);}return _0x5d33f5;};}function handleError(_0x1d3e22,_0xb5f71c){_0xb5f71c=_0xb5f71c||0x1f4;return function(_0x4ead16){logger[_0x4783('0x27')](_0x4ead16['stack']);if(_0x4ead16['name']){delete _0x4ead16['name'];}_0x1d3e22['status'](_0xb5f71c)['send'](_0x4ead16);};}exports['index']=function(_0x250b9d,_0x589082){var _0x3a996c={},_0x455559={},_0x424806={'count':0x0,'rows':[]};var _0x3455e=_[_0x4783('0x28')](db['FreshdeskAccount'][_0x4783('0x29')],function(_0x2e8ede){return{'name':_0x2e8ede['fieldName'],'type':_0x2e8ede[_0x4783('0x2a')][_0x4783('0x2b')]};});_0x455559['model']=_[_0x4783('0x28')](_0x3455e,'name');_0x455559[_0x4783('0x2c')]=_['keys'](_0x250b9d[_0x4783('0x2c')]);_0x455559[_0x4783('0x2d')]=_['intersection'](_0x455559[_0x4783('0x2e')],_0x455559[_0x4783('0x2c')]);_0x3a996c[_0x4783('0x2f')]=_[_0x4783('0x30')](_0x455559['model'],qs[_0x4783('0x31')](_0x250b9d[_0x4783('0x2c')][_0x4783('0x31')]));_0x3a996c[_0x4783('0x2f')]=_0x3a996c['attributes'][_0x4783('0x32')]?_0x3a996c[_0x4783('0x2f')]:_0x455559['model'];if(!_0x250b9d[_0x4783('0x2c')][_0x4783('0x33')](_0x4783('0x34'))){_0x3a996c[_0x4783('0x1f')]=qs[_0x4783('0x1f')](_0x250b9d['query'][_0x4783('0x1f')]);_0x3a996c['offset']=qs['offset'](_0x250b9d[_0x4783('0x2c')][_0x4783('0x1d')]);}_0x3a996c[_0x4783('0x35')]=qs['sort'](_0x250b9d[_0x4783('0x2c')]['sort']);_0x3a996c[_0x4783('0x36')]=qs['filters'](_[_0x4783('0x37')](_0x250b9d[_0x4783('0x2c')],_0x455559[_0x4783('0x2d')]),_0x3455e);if(_0x250b9d['query'][_0x4783('0x38')]){_0x3a996c['where']=_[_0x4783('0x39')](_0x3a996c[_0x4783('0x36')],{'$or':_[_0x4783('0x28')](_0x3455e,function(_0x3f484b){if(_0x3f484b['type']!==_0x4783('0x3a')){var _0x1cc4f5={};_0x1cc4f5[_0x3f484b[_0x4783('0x3b')]]={'$like':'%'+_0x250b9d['query'][_0x4783('0x38')]+'%'};return _0x1cc4f5;}})});}_0x3a996c=_[_0x4783('0x39')]({},_0x3a996c,_0x250b9d[_0x4783('0x3c')]);var _0x50c1c3={'where':_0x3a996c['where']};return db[_0x4783('0x3d')][_0x4783('0x20')](_0x50c1c3)[_0x4783('0x26')](function(_0xbb6755){_0x424806[_0x4783('0x20')]=_0xbb6755;if(_0x250b9d[_0x4783('0x2c')][_0x4783('0x3e')]){_0x3a996c[_0x4783('0x3f')]=[{'all':!![]}];}return db[_0x4783('0x3d')]['findAll'](_0x3a996c);})['then'](function(_0x12fa5d){_0x424806['rows']=_0x12fa5d;return _0x424806;})[_0x4783('0x26')](respondWithFilteredResult(_0x589082,_0x3a996c))[_0x4783('0x40')](handleError(_0x589082,null));};exports[_0x4783('0x41')]=function(_0x3df302,_0x5e5bc7){var _0x409ac6={'raw':![],'where':{'id':_0x3df302[_0x4783('0x42')]['id']}},_0xa29d9c={};_0xa29d9c['model']=_['keys'](db[_0x4783('0x3d')][_0x4783('0x29')]);_0xa29d9c['query']=_[_0x4783('0x43')](_0x3df302['query']);_0xa29d9c[_0x4783('0x2d')]=_[_0x4783('0x30')](_0xa29d9c[_0x4783('0x2e')],_0xa29d9c[_0x4783('0x2c')]);_0x409ac6[_0x4783('0x2f')]=_[_0x4783('0x30')](_0xa29d9c[_0x4783('0x2e')],qs[_0x4783('0x31')](_0x3df302['query']['fields']));_0x409ac6[_0x4783('0x2f')]=_0x409ac6['attributes'][_0x4783('0x32')]?_0x409ac6[_0x4783('0x2f')]:_0xa29d9c[_0x4783('0x2e')];if(_0x3df302[_0x4783('0x2c')][_0x4783('0x3e')]){_0x409ac6[_0x4783('0x3f')]=[{'all':!![]}];}_0x409ac6=_[_0x4783('0x39')]({},_0x409ac6,_0x3df302[_0x4783('0x3c')]);return db[_0x4783('0x3d')][_0x4783('0x44')](_0x409ac6)[_0x4783('0x26')](handleEntityNotFound(_0x5e5bc7,null))[_0x4783('0x26')](respondWithResult(_0x5e5bc7,null))['catch'](handleError(_0x5e5bc7,null));};exports['create']=function(_0xb416de,_0x200fdc){return db['FreshdeskAccount']['create'](_0xb416de[_0x4783('0x45')],{})[_0x4783('0x26')](respondWithResult(_0x200fdc,0xc9))[_0x4783('0x40')](handleError(_0x200fdc,null));};exports['update']=function(_0x3dbd65,_0x56d50c){if(_0x3dbd65[_0x4783('0x45')]['id']){delete _0x3dbd65[_0x4783('0x45')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x3dbd65['params']['id']}})[_0x4783('0x26')](handleEntityNotFound(_0x56d50c,null))[_0x4783('0x26')](saveUpdates(_0x3dbd65['body'],null))[_0x4783('0x26')](respondWithResult(_0x56d50c,null))[_0x4783('0x40')](handleError(_0x56d50c,null));};exports['destroy']=function(_0x447ab9,_0x4c2b3a){return db[_0x4783('0x3d')]['find']({'where':{'id':_0x447ab9[_0x4783('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c2b3a,null))[_0x4783('0x26')](removeEntity(_0x4c2b3a,null))['catch'](handleError(_0x4c2b3a,null));};exports['getConfigurations']=function(_0x525b5a,_0x125c9d,_0x481078){var _0x44e3fb={};var _0x50592a={};var _0x1104f8;var _0xac3410;return db[_0x4783('0x3d')][_0x4783('0x46')]({'where':{'id':_0x525b5a['params']['id']}})['then'](handleEntityNotFound(_0x125c9d,null))[_0x4783('0x26')](function(_0x366a80){if(_0x366a80){_0x1104f8=_0x366a80;_0x50592a[_0x4783('0x2e')]=_[_0x4783('0x43')](db['FreshdeskConfiguration'][_0x4783('0x29')]);_0x50592a[_0x4783('0x2c')]=_[_0x4783('0x43')](_0x525b5a[_0x4783('0x2c')]);_0x50592a[_0x4783('0x2d')]=_[_0x4783('0x30')](_0x50592a[_0x4783('0x2e')],_0x50592a['query']);_0x44e3fb['attributes']=_[_0x4783('0x30')](_0x50592a[_0x4783('0x2e')],qs[_0x4783('0x31')](_0x525b5a[_0x4783('0x2c')][_0x4783('0x31')]));_0x44e3fb[_0x4783('0x2f')]=_0x44e3fb[_0x4783('0x2f')][_0x4783('0x32')]?_0x44e3fb[_0x4783('0x2f')]:_0x50592a[_0x4783('0x2e')];_0x44e3fb[_0x4783('0x35')]=qs['sort'](_0x525b5a[_0x4783('0x2c')][_0x4783('0x47')]);_0x44e3fb[_0x4783('0x36')]=qs[_0x4783('0x2d')](_[_0x4783('0x37')](_0x525b5a[_0x4783('0x2c')],_0x50592a[_0x4783('0x2d')]));if(_0x525b5a['query'][_0x4783('0x38')]){_0x44e3fb[_0x4783('0x36')]=_[_0x4783('0x39')](_0x44e3fb[_0x4783('0x36')],{'$or':_[_0x4783('0x28')](_0x44e3fb[_0x4783('0x2f')],function(_0x4f22d6){var _0x47fda0={};_0x47fda0[_0x4f22d6]={'$like':'%'+_0x525b5a[_0x4783('0x2c')][_0x4783('0x38')]+'%'};return _0x47fda0;})});}_0x44e3fb=_[_0x4783('0x39')]({},_0x44e3fb,_0x525b5a[_0x4783('0x3c')]);return _0x1104f8['getConfigurations'](_0x44e3fb);}})[_0x4783('0x26')](function(_0x1c5b0f){if(_0x1c5b0f){_0xac3410=_0x1c5b0f[_0x4783('0x32')];if(!_0x525b5a['query'][_0x4783('0x33')](_0x4783('0x34'))){_0x44e3fb[_0x4783('0x1f')]=qs['limit'](_0x525b5a[_0x4783('0x2c')][_0x4783('0x1f')]);_0x44e3fb['offset']=qs['offset'](_0x525b5a[_0x4783('0x2c')][_0x4783('0x1d')]);}return _0x1104f8[_0x4783('0x48')](_0x44e3fb);}})[_0x4783('0x26')](function(_0x33755f){if(_0x33755f){return _0x33755f?{'count':_0xac3410,'rows':_0x33755f}:null;}})[_0x4783('0x26')](respondWithResult(_0x125c9d,null))[_0x4783('0x40')](handleError(_0x125c9d,null));};exports['addConfiguration']=function(_0x527909,_0x2a7296,_0x21e0ca){if(_0x527909[_0x4783('0x45')]['id']){delete _0x527909['body']['id'];}return db[_0x4783('0x3d')][_0x4783('0x46')]({'where':{'id':_0x527909[_0x4783('0x42')]['id']}})[_0x4783('0x26')](handleEntityNotFound(_0x2a7296,null))['then'](function(_0x3828a0){if(_0x3828a0){_0x527909[_0x4783('0x45')]['AccountId']=_0x3828a0['id'];_0x527909[_0x4783('0x45')][_0x4783('0x49')]=integrations['getSubjects'](_0x527909['body'][_0x4783('0x4a')],_0x527909[_0x4783('0x45')][_0x4783('0x2a')]);_0x527909[_0x4783('0x45')]['Descriptions']=integrations['getDescriptions'](_0x527909[_0x4783('0x45')]['channel'],_0x527909[_0x4783('0x45')][_0x4783('0x2a')]);return db[_0x4783('0x4b')][_0x4783('0x4c')](_0x527909[_0x4783('0x45')],{'include':[{'model':db[_0x4783('0x4d')],'as':_0x4783('0x49')},{'model':db[_0x4783('0x4d')],'as':_0x4783('0x4e')}]});}return null;})['then'](respondWithResult(_0x2a7296,null))[_0x4783('0x40')](handleError(_0x2a7296,null));};exports[_0x4783('0x4f')]=function(_0x477e77,_0xf39703,_0x4985cd){var _0x5d905b='';return db['FreshdeskAccount'][_0x4783('0x46')]({'where':{'id':_0x477e77[_0x4783('0x42')]['id']},'attributes':['id',_0x4783('0x50'),'apiKey']})['then'](handleEntityNotFound(_0xf39703,null))[_0x4783('0x26')](function(_0x45fb65){if(_0x45fb65){_0x5d905b=_0x45fb65['remoteUri'];var _0x16819d=_0x5d905b[_0x4783('0x51')](-0x1);if(_0x16819d==='/'){_0x5d905b=_0x5d905b['substring'](0x0,_0x5d905b[_0x4783('0x52')](_0x16819d));}return rp({'method':'GET','uri':util[_0x4783('0x53')]('%s/%s',_0x5d905b,_0x4783('0x54')),'headers':{'Authorization':util[_0x4783('0x53')](_0x4783('0x55'),new Buffer(util[_0x4783('0x53')](_0x4783('0x56'),_0x45fb65[_0x4783('0x57')]))['toString'](_0x4783('0x58')))},'json':!![]});}})['then'](function(_0x212483){if(_0x212483){var _0xcb232c=[_0x4783('0x59'),_0x4783('0x5a'),_0x4783('0x5b'),_0x4783('0x5c'),_0x4783('0x1a'),_0x4783('0x5d'),'group',_0x4783('0x5e'),_0x4783('0x5f'),_0x4783('0x60'),_0x4783('0x61')];_[_0x4783('0x62')](_0x212483,function(_0x48b388){return _0xcb232c['includes'](_0x48b388[_0x4783('0x3b')])||!_0x48b388['default']&&_0x48b388['type']!==_0x4783('0x63')&&_0x48b388[_0x4783('0x2a')]!==_0x4783('0x64');});return{'count':_0x212483['length'],'rows':_[_0x4783('0x28')](_0x212483,function(_0x2474db){return{'id':_0x2474db[_0x4783('0x3b')],'name':_0x2474db['label'],'custom':!_0x2474db['default'],'options':_0x2474db['choices']?_[_0x4783('0x28')](_0x2474db[_0x4783('0x65')],function(_0x12d654){return{'name':_[_0x4783('0x66')](_0x12d654),'value':_0x12d654};}):[]};})};}})[_0x4783('0x26')](respondWithResult(_0xf39703,null))[_0x4783('0x40')](function(_0x530d5a){var _0xed3abd=_0x477e77[_0x4783('0x2c')][_0x4783('0x67')]?0x1f4:_0x530d5a['statusCode']||0x1f4;logger[_0x4783('0x27')](_0x4783('0x68'),_0x4783('0x4f'),_0xed3abd,JSON[_0x4783('0x69')](_0x530d5a));delete _0x530d5a[_0x4783('0x3b')];if(_0xed3abd===0x191){_0xed3abd=0x190;}_0xf39703['status'](_0xed3abd)['send'](_0x477e77['query']['test']?{'message':_0x4783('0x6a'),'statusCode':_0x530d5a['statusCode']}:_0x530d5a);});}; \ No newline at end of file +var _0x6594=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','FreshdeskAccount','rawAttributes','options','find','create','body','update','params','findOne','FreshdeskConfiguration','length','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','Basic\x20%s','format','%s:X','requester','subject','ticket_type','group','company','remove','includes','default','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6594,0xcb));var _0x4659=function(_0x16cfae,_0x3c3596){_0x16cfae=_0x16cfae-0x0;var _0x5a04cf=_0x6594[_0x16cfae];return _0x5a04cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require(_0x4659('0x2'));var Mustache=require(_0x4659('0x3'));var util=require(_0x4659('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4659('0x5'));var ejs=require(_0x4659('0x6'));var fs=require('fs');var fs_extra=require(_0x4659('0x7'));var _=require(_0x4659('0x8'));var squel=require('squel');var crypto=require(_0x4659('0x9'));var jsforce=require(_0x4659('0xa'));var deskjs=require(_0x4659('0xb'));var toCsv=require(_0x4659('0x5'));var querystring=require(_0x4659('0xc'));var Papa=require(_0x4659('0xd'));var Redis=require('ioredis');var authService=require(_0x4659('0xe'));var qs=require(_0x4659('0xf'));var as=require(_0x4659('0x10'));var hardwareService=require(_0x4659('0x11'));var logger=require(_0x4659('0x12'))(_0x4659('0x13'));var utils=require(_0x4659('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4659('0x15'))['db'];var integrations=require(_0x4659('0x16'));function respondWithStatusCode(_0x1f89cf,_0x5389a0){_0x5389a0=_0x5389a0||0xcc;return function(_0x40f043){if(_0x40f043){return _0x1f89cf[_0x4659('0x17')](_0x5389a0);}return _0x1f89cf['status'](_0x5389a0)['end']();};}function respondWithResult(_0x1a9e9c,_0x4c3c05){_0x4c3c05=_0x4c3c05||0xc8;return function(_0x39d8ba){if(_0x39d8ba){return _0x1a9e9c[_0x4659('0x18')](_0x4c3c05)[_0x4659('0x19')](_0x39d8ba);}};}function respondWithFilteredResult(_0x5c099c,_0x3d9a17){return function(_0x429b72){if(_0x429b72){var _0x1d78a5=typeof _0x3d9a17[_0x4659('0x1a')]==='undefined'&&typeof _0x3d9a17[_0x4659('0x1b')]===_0x4659('0x1c');var _0x73f3f5=_0x429b72[_0x4659('0x1d')];var _0x4c8820=_0x1d78a5?0x0:_0x3d9a17[_0x4659('0x1a')];var _0x3049ba=_0x1d78a5?_0x429b72['count']:_0x3d9a17[_0x4659('0x1a')]+_0x3d9a17[_0x4659('0x1b')];var _0x6b8d07;if(_0x3049ba>=_0x73f3f5){_0x3049ba=_0x73f3f5;_0x6b8d07=0xc8;}else{_0x6b8d07=0xce;}_0x5c099c[_0x4659('0x18')](_0x6b8d07);return _0x5c099c['set']('Content-Range',_0x4c8820+'-'+_0x3049ba+'/'+_0x73f3f5)[_0x4659('0x19')](_0x429b72);}return null;};}function patchUpdates(_0x157f1a){return function(_0x1fce1d){try{jsonpatch[_0x4659('0x1e')](_0x1fce1d,_0x157f1a,!![]);}catch(_0x288cdf){return BPromise[_0x4659('0x1f')](_0x288cdf);}return _0x1fce1d[_0x4659('0x20')]();};}function saveUpdates(_0x2e773b,_0x1a016e){return function(_0x494631){if(_0x494631){return _0x494631['update'](_0x2e773b)[_0x4659('0x21')](function(_0x4c40b3){return _0x4c40b3;});}return null;};}function removeEntity(_0x1e9c93,_0x47c73d){return function(_0x1715ba){if(_0x1715ba){return _0x1715ba[_0x4659('0x22')]()[_0x4659('0x21')](function(){_0x1e9c93[_0x4659('0x18')](0xcc)[_0x4659('0x23')]();});}};}function handleEntityNotFound(_0x1fe661,_0x2b4ad8){return function(_0x1d1cba){if(!_0x1d1cba){_0x1fe661[_0x4659('0x17')](0x194);}return _0x1d1cba;};}function handleError(_0x507598,_0x428dd5){_0x428dd5=_0x428dd5||0x1f4;return function(_0x1bd579){logger[_0x4659('0x24')](_0x1bd579[_0x4659('0x25')]);if(_0x1bd579[_0x4659('0x26')]){delete _0x1bd579[_0x4659('0x26')];}_0x507598[_0x4659('0x18')](_0x428dd5)[_0x4659('0x27')](_0x1bd579);};}exports[_0x4659('0x28')]=function(_0x479a2e,_0x5d0c89){var _0xde3c49={},_0x26d67f={},_0x5c5a31={'count':0x0,'rows':[]};var _0x507fc1=_[_0x4659('0x29')](db['FreshdeskAccount']['rawAttributes'],function(_0x34d817){return{'name':_0x34d817[_0x4659('0x2a')],'type':_0x34d817['type'][_0x4659('0x2b')]};});_0x26d67f[_0x4659('0x2c')]=_[_0x4659('0x29')](_0x507fc1,_0x4659('0x26'));_0x26d67f[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x479a2e[_0x4659('0x2d')]);_0x26d67f['filters']=_[_0x4659('0x2f')](_0x26d67f[_0x4659('0x2c')],_0x26d67f[_0x4659('0x2d')]);_0xde3c49[_0x4659('0x30')]=_['intersection'](_0x26d67f[_0x4659('0x2c')],qs[_0x4659('0x31')](_0x479a2e[_0x4659('0x2d')][_0x4659('0x31')]));_0xde3c49[_0x4659('0x30')]=_0xde3c49[_0x4659('0x30')]['length']?_0xde3c49['attributes']:_0x26d67f['model'];if(!_0x479a2e[_0x4659('0x2d')][_0x4659('0x32')]('nolimit')){_0xde3c49[_0x4659('0x1b')]=qs[_0x4659('0x1b')](_0x479a2e['query'][_0x4659('0x1b')]);_0xde3c49[_0x4659('0x1a')]=qs['offset'](_0x479a2e['query'][_0x4659('0x1a')]);}_0xde3c49[_0x4659('0x33')]=qs[_0x4659('0x34')](_0x479a2e[_0x4659('0x2d')][_0x4659('0x34')]);_0xde3c49[_0x4659('0x35')]=qs[_0x4659('0x36')](_[_0x4659('0x37')](_0x479a2e[_0x4659('0x2d')],_0x26d67f['filters']),_0x507fc1);if(_0x479a2e[_0x4659('0x2d')][_0x4659('0x38')]){_0xde3c49['where']=_['merge'](_0xde3c49['where'],{'$or':_['map'](_0x507fc1,function(_0xb4a62d){if(_0xb4a62d[_0x4659('0x39')]!==_0x4659('0x3a')){var _0x5406ae={};_0x5406ae[_0xb4a62d[_0x4659('0x26')]]={'$like':'%'+_0x479a2e[_0x4659('0x2d')]['filter']+'%'};return _0x5406ae;}})});}_0xde3c49=_[_0x4659('0x3b')]({},_0xde3c49,_0x479a2e['options']);var _0x1f5298={'where':_0xde3c49[_0x4659('0x35')]};return db['FreshdeskAccount']['count'](_0x1f5298)[_0x4659('0x21')](function(_0x391879){_0x5c5a31[_0x4659('0x1d')]=_0x391879;if(_0x479a2e['query'][_0x4659('0x3c')]){_0xde3c49[_0x4659('0x3d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x4659('0x3e')](_0xde3c49);})[_0x4659('0x21')](function(_0xd78633){_0x5c5a31[_0x4659('0x3f')]=_0xd78633;return _0x5c5a31;})[_0x4659('0x21')](respondWithFilteredResult(_0x5d0c89,_0xde3c49))[_0x4659('0x40')](handleError(_0x5d0c89,null));};exports['show']=function(_0x11e413,_0x22e2bb){var _0xd38f94={'raw':![],'where':{'id':_0x11e413['params']['id']}},_0x9f120a={};_0x9f120a['model']=_[_0x4659('0x2e')](db[_0x4659('0x41')][_0x4659('0x42')]);_0x9f120a[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x11e413[_0x4659('0x2d')]);_0x9f120a[_0x4659('0x36')]=_['intersection'](_0x9f120a[_0x4659('0x2c')],_0x9f120a[_0x4659('0x2d')]);_0xd38f94[_0x4659('0x30')]=_[_0x4659('0x2f')](_0x9f120a['model'],qs[_0x4659('0x31')](_0x11e413['query']['fields']));_0xd38f94['attributes']=_0xd38f94['attributes']['length']?_0xd38f94[_0x4659('0x30')]:_0x9f120a[_0x4659('0x2c')];if(_0x11e413[_0x4659('0x2d')][_0x4659('0x3c')]){_0xd38f94[_0x4659('0x3d')]=[{'all':!![]}];}_0xd38f94=_['merge']({},_0xd38f94,_0x11e413[_0x4659('0x43')]);return db[_0x4659('0x41')][_0x4659('0x44')](_0xd38f94)[_0x4659('0x21')](handleEntityNotFound(_0x22e2bb,null))['then'](respondWithResult(_0x22e2bb,null))[_0x4659('0x40')](handleError(_0x22e2bb,null));};exports[_0x4659('0x45')]=function(_0x374df3,_0x1d3876){return db[_0x4659('0x41')]['create'](_0x374df3[_0x4659('0x46')],{})[_0x4659('0x21')](respondWithResult(_0x1d3876,0xc9))['catch'](handleError(_0x1d3876,null));};exports[_0x4659('0x47')]=function(_0x51e4ad,_0x452154){if(_0x51e4ad['body']['id']){delete _0x51e4ad[_0x4659('0x46')]['id'];}return db['FreshdeskAccount'][_0x4659('0x44')]({'where':{'id':_0x51e4ad[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x452154,null))[_0x4659('0x21')](saveUpdates(_0x51e4ad[_0x4659('0x46')],null))[_0x4659('0x21')](respondWithResult(_0x452154,null))[_0x4659('0x40')](handleError(_0x452154,null));};exports[_0x4659('0x22')]=function(_0x722dea,_0x4a39a2){return db[_0x4659('0x41')][_0x4659('0x44')]({'where':{'id':_0x722dea[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x4a39a2,null))['then'](removeEntity(_0x4a39a2,null))[_0x4659('0x40')](handleError(_0x4a39a2,null));};exports['getConfigurations']=function(_0x1d8b61,_0x105369,_0x3dbb46){var _0x42bd7e={};var _0x4f62ac={};var _0xc62155;var _0x225f98;return db[_0x4659('0x41')][_0x4659('0x49')]({'where':{'id':_0x1d8b61['params']['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x105369,null))[_0x4659('0x21')](function(_0x9df1b2){if(_0x9df1b2){_0xc62155=_0x9df1b2;_0x4f62ac[_0x4659('0x2c')]=_[_0x4659('0x2e')](db[_0x4659('0x4a')][_0x4659('0x42')]);_0x4f62ac[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x1d8b61[_0x4659('0x2d')]);_0x4f62ac[_0x4659('0x36')]=_[_0x4659('0x2f')](_0x4f62ac[_0x4659('0x2c')],_0x4f62ac[_0x4659('0x2d')]);_0x42bd7e['attributes']=_[_0x4659('0x2f')](_0x4f62ac[_0x4659('0x2c')],qs['fields'](_0x1d8b61[_0x4659('0x2d')][_0x4659('0x31')]));_0x42bd7e[_0x4659('0x30')]=_0x42bd7e[_0x4659('0x30')][_0x4659('0x4b')]?_0x42bd7e[_0x4659('0x30')]:_0x4f62ac[_0x4659('0x2c')];_0x42bd7e['order']=qs[_0x4659('0x34')](_0x1d8b61[_0x4659('0x2d')][_0x4659('0x34')]);_0x42bd7e[_0x4659('0x35')]=qs[_0x4659('0x36')](_[_0x4659('0x37')](_0x1d8b61[_0x4659('0x2d')],_0x4f62ac['filters']));if(_0x1d8b61[_0x4659('0x2d')][_0x4659('0x38')]){_0x42bd7e['where']=_[_0x4659('0x3b')](_0x42bd7e[_0x4659('0x35')],{'$or':_[_0x4659('0x29')](_0x42bd7e['attributes'],function(_0x36d2cc){var _0x20f7ec={};_0x20f7ec[_0x36d2cc]={'$like':'%'+_0x1d8b61['query'][_0x4659('0x38')]+'%'};return _0x20f7ec;})});}_0x42bd7e=_['merge']({},_0x42bd7e,_0x1d8b61[_0x4659('0x43')]);return _0xc62155[_0x4659('0x4c')](_0x42bd7e);}})[_0x4659('0x21')](function(_0x517921){if(_0x517921){_0x225f98=_0x517921['length'];if(!_0x1d8b61[_0x4659('0x2d')]['hasOwnProperty'](_0x4659('0x4d'))){_0x42bd7e[_0x4659('0x1b')]=qs[_0x4659('0x1b')](_0x1d8b61['query']['limit']);_0x42bd7e[_0x4659('0x1a')]=qs[_0x4659('0x1a')](_0x1d8b61[_0x4659('0x2d')]['offset']);}return _0xc62155['getConfigurations'](_0x42bd7e);}})[_0x4659('0x21')](function(_0x41785f){if(_0x41785f){return _0x41785f?{'count':_0x225f98,'rows':_0x41785f}:null;}})[_0x4659('0x21')](respondWithResult(_0x105369,null))[_0x4659('0x40')](handleError(_0x105369,null));};exports[_0x4659('0x4e')]=function(_0x2746dc,_0x1b874d,_0x4dd4a8){if(_0x2746dc[_0x4659('0x46')]['id']){delete _0x2746dc['body']['id'];}return db[_0x4659('0x41')]['findOne']({'where':{'id':_0x2746dc[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x1b874d,null))[_0x4659('0x21')](function(_0x57343a){if(_0x57343a){_0x2746dc['body'][_0x4659('0x4f')]=_0x57343a['id'];_0x2746dc[_0x4659('0x46')][_0x4659('0x50')]=integrations[_0x4659('0x51')](_0x2746dc[_0x4659('0x46')][_0x4659('0x52')],_0x2746dc[_0x4659('0x46')][_0x4659('0x39')]);_0x2746dc[_0x4659('0x46')][_0x4659('0x53')]=integrations[_0x4659('0x54')](_0x2746dc[_0x4659('0x46')]['channel'],_0x2746dc[_0x4659('0x46')]['type']);return db[_0x4659('0x4a')][_0x4659('0x45')](_0x2746dc['body'],{'include':[{'model':db[_0x4659('0x55')],'as':_0x4659('0x50')},{'model':db[_0x4659('0x55')],'as':'Descriptions'}]});}return null;})[_0x4659('0x21')](respondWithResult(_0x1b874d,null))[_0x4659('0x40')](handleError(_0x1b874d,null));};exports[_0x4659('0x56')]=function(_0x5e840f,_0x28bb1b,_0x4825a4){var _0x332658='';return db[_0x4659('0x41')]['findOne']({'where':{'id':_0x5e840f[_0x4659('0x48')]['id']},'attributes':['id',_0x4659('0x57'),_0x4659('0x58')]})[_0x4659('0x21')](handleEntityNotFound(_0x28bb1b,null))[_0x4659('0x21')](function(_0x482dc9){if(_0x482dc9){_0x332658=_0x482dc9[_0x4659('0x57')];var _0x249eb1=_0x332658[_0x4659('0x59')](-0x1);if(_0x249eb1==='/'){_0x332658=_0x332658[_0x4659('0x5a')](0x0,_0x332658[_0x4659('0x5b')](_0x249eb1));}return rp({'method':_0x4659('0x5c'),'uri':util['format']('%s/%s',_0x332658,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x4659('0x5d'),new Buffer(util[_0x4659('0x5e')](_0x4659('0x5f'),_0x482dc9['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x4659('0x21')](function(_0x2cef6b){if(_0x2cef6b){var _0x15d709=[_0x4659('0x60'),_0x4659('0x61'),'agent','description','status','priority','group','source',_0x4659('0x62'),_0x4659('0x63'),_0x4659('0x64')];_[_0x4659('0x65')](_0x2cef6b,function(_0x35ce47){return _0x15d709[_0x4659('0x66')](_0x35ce47['name'])||!_0x35ce47[_0x4659('0x67')]&&_0x35ce47[_0x4659('0x39')]!=='custom_text'&&_0x35ce47[_0x4659('0x39')]!==_0x4659('0x68');});return{'count':_0x2cef6b['length'],'rows':_[_0x4659('0x29')](_0x2cef6b,function(_0x56d500){return{'id':_0x56d500[_0x4659('0x26')],'name':_0x56d500['label'],'custom':!_0x56d500[_0x4659('0x67')],'options':_0x56d500[_0x4659('0x69')]?_[_0x4659('0x29')](_0x56d500[_0x4659('0x69')],function(_0x59d3be){return{'name':_['capitalize'](_0x59d3be),'value':_0x59d3be};}):[]};})};}})[_0x4659('0x21')](respondWithResult(_0x28bb1b,null))[_0x4659('0x40')](function(_0x320028){var _0x95642f=_0x5e840f[_0x4659('0x2d')][_0x4659('0x6a')]?0x1f4:_0x320028[_0x4659('0x6b')]||0x1f4;logger[_0x4659('0x24')](_0x4659('0x6c'),'getFields',_0x95642f,JSON[_0x4659('0x6d')](_0x320028));delete _0x320028[_0x4659('0x26')];if(_0x95642f===0x191){_0x95642f=0x190;}_0x28bb1b['status'](_0x95642f)[_0x4659('0x27')](_0x5e840f[_0x4659('0x2d')][_0x4659('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x320028[_0x4659('0x6b')]}:_0x320028);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c03a04f..07cb5ae 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 _0xbb35=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','../../config/logger'];(function(_0x5d34b7,_0x213aa6){var _0x202303=function(_0x4ac90a){while(--_0x4ac90a){_0x5d34b7['push'](_0x5d34b7['shift']());}};_0x202303(++_0x213aa6);}(_0xbb35,0xfa));var _0x5bb3=function(_0x279f97,_0x2aa360){_0x279f97=_0x279f97-0x0;var _0xef8d57=_0xbb35[_0x279f97];return _0xef8d57;};'use strict';var _=require(_0x5bb3('0x0'));var util=require('util');var logger=require(_0x5bb3('0x1'))('api');var moment=require(_0x5bb3('0x2'));var BPromise=require(_0x5bb3('0x3'));var rp=require(_0x5bb3('0x4'));var fs=require('fs');var path=require(_0x5bb3('0x5'));var rimraf=require(_0x5bb3('0x6'));var config=require(_0x5bb3('0x7'));var attributes=require(_0x5bb3('0x8'));var integrations=require(_0x5bb3('0x9'));module['exports']=function(_0x2084a1,_0x93d612){return _0x2084a1[_0x5bb3('0xa')](_0x5bb3('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52ba=['../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x4fa9b6,_0x5dbc8){var _0x423a19=function(_0x593cde){while(--_0x593cde){_0x4fa9b6['push'](_0x4fa9b6['shift']());}};_0x423a19(++_0x5dbc8);}(_0x52ba,0x1c6));var _0xa52b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x52ba[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xa52b('0x0'));var util=require(_0xa52b('0x1'));var logger=require(_0xa52b('0x2'))(_0xa52b('0x3'));var moment=require(_0xa52b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa52b('0x5'));var config=require(_0xa52b('0x6'));var attributes=require(_0xa52b('0x7'));var integrations=require(_0xa52b('0x8'));module['exports']=function(_0x5312f3,_0x52c67d){return _0x5312f3['define'](_0xa52b('0x9'),attributes,{'tableName':_0xa52b('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 8de9c1c..6c3af79 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 _0xd5a1=['rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xd5a1,0x162));var _0x1d5a=function(_0x2184d5,_0x154076){_0x2184d5=_0x2184d5-0x0;var _0x8999b5=_0xd5a1[_0x2184d5];return _0x8999b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d5a('0x0'));var BPromise=require(_0x1d5a('0x1'));var rs=require(_0x1d5a('0x2'));var fs=require('fs');var Redis=require(_0x1d5a('0x3'));var db=require(_0x1d5a('0x4'))['db'];var utils=require(_0x1d5a('0x5'));var logger=require('../../config/logger')(_0x1d5a('0x6'));var config=require(_0x1d5a('0x7'));var jayson=require(_0x1d5a('0x8'));var client=jayson['client'][_0x1d5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50b41d,_0x4e3071,_0x4a33a1){return new BPromise(function(_0x18337b,_0x38b91d){return client[_0x1d5a('0xa')](_0x50b41d,_0x4a33a1)[_0x1d5a('0xb')](function(_0x1658df){logger[_0x1d5a('0xc')](_0x1d5a('0xd'),_0x4e3071,_0x1d5a('0xe'));logger['debug'](_0x1d5a('0xf'),_0x4e3071,_0x1d5a('0xe'),JSON[_0x1d5a('0x10')](_0x1658df));if(_0x1658df[_0x1d5a('0x11')]){if(_0x1658df[_0x1d5a('0x11')][_0x1d5a('0x12')]===0x1f4){logger[_0x1d5a('0x11')](_0x1d5a('0xd'),_0x4e3071,_0x1658df[_0x1d5a('0x11')][_0x1d5a('0x13')]);return _0x38b91d(_0x1658df[_0x1d5a('0x11')][_0x1d5a('0x13')]);}logger['error'](_0x1d5a('0xd'),_0x4e3071,_0x1658df['error']['message']);return _0x18337b(_0x1658df['error'][_0x1d5a('0x13')]);}else{logger[_0x1d5a('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x4e3071,_0x1d5a('0xe'));_0x18337b(_0x1658df[_0x1d5a('0x14')][_0x1d5a('0x13')]);}})[_0x1d5a('0x15')](function(_0x10b5df){logger['error'](_0x1d5a('0xd'),_0x4e3071,_0x10b5df);_0x38b91d(_0x10b5df);});});}exports['GetFreshdeskAccount']=function(_0x5f066d){var _0x4e480f=this;return new Promise(function(_0xd5a2a6,_0x2ae7a2){return db[_0x1d5a('0x16')][_0x1d5a('0x17')]({'raw':_0x5f066d[_0x1d5a('0x18')]?_0x5f066d['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f066d[_0x1d5a('0x18')]?_0x5f066d[_0x1d5a('0x18')][_0x1d5a('0x19')]||null:null,'attributes':_0x5f066d[_0x1d5a('0x18')]?_0x5f066d[_0x1d5a('0x18')][_0x1d5a('0x1a')]||null:null,'limit':_0x5f066d[_0x1d5a('0x18')]?_0x5f066d['options'][_0x1d5a('0x1b')]||null:null,'include':_0x5f066d[_0x1d5a('0x18')]?_0x5f066d['options'][_0x1d5a('0x1c')]?_[_0x1d5a('0x1d')](_0x5f066d[_0x1d5a('0x18')][_0x1d5a('0x1c')],function(_0x3d1c8e){return{'model':db[_0x3d1c8e[_0x1d5a('0x1e')]],'as':_0x3d1c8e['as'],'attributes':_0x3d1c8e[_0x1d5a('0x1a')],'include':_0x3d1c8e[_0x1d5a('0x1c')]?_[_0x1d5a('0x1d')](_0x3d1c8e['include'],function(_0x4e1114){return{'model':db[_0x4e1114[_0x1d5a('0x1e')]],'as':_0x4e1114['as'],'attributes':_0x4e1114[_0x1d5a('0x1a')],'include':_0x4e1114[_0x1d5a('0x1c')]?_[_0x1d5a('0x1d')](_0x4e1114[_0x1d5a('0x1c')],function(_0x1c2776){return{'model':db[_0x1c2776['model']],'as':_0x1c2776['as'],'attributes':_0x1c2776[_0x1d5a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1d5a('0xb')](function(_0x57ba29){logger[_0x1d5a('0xc')](_0x1d5a('0x1f'),_0x5f066d);logger[_0x1d5a('0x20')]('GetFreshdeskAccount',_0x5f066d,JSON[_0x1d5a('0x10')](_0x57ba29));_0xd5a2a6(_0x57ba29);})[_0x1d5a('0x15')](function(_0x4cb42c){logger['error'](_0x1d5a('0x1f'),_0x4cb42c[_0x1d5a('0x13')],_0x5f066d);_0x2ae7a2(_0x4e480f[_0x1d5a('0x11')](0x1f4,_0x4cb42c[_0x1d5a('0x13')]));});});};exports[_0x1d5a('0x21')]=function(_0x332681){var _0x14cd9f=this;return new Promise(function(_0x4df569,_0x4863be){return db[_0x1d5a('0x16')][_0x1d5a('0x22')]({'raw':_0x332681['options']?_0x332681[_0x1d5a('0x18')][_0x1d5a('0x23')]===undefined?!![]:![]:!![],'where':_0x332681[_0x1d5a('0x18')]?_0x332681[_0x1d5a('0x18')][_0x1d5a('0x19')]||null:null,'attributes':_0x332681[_0x1d5a('0x18')]?_0x332681[_0x1d5a('0x18')][_0x1d5a('0x1a')]||null:null,'include':_0x332681[_0x1d5a('0x18')]?_0x332681[_0x1d5a('0x18')][_0x1d5a('0x1c')]?_[_0x1d5a('0x1d')](_0x332681['options'][_0x1d5a('0x1c')],function(_0x365db7){return{'model':db[_0x365db7[_0x1d5a('0x1e')]],'as':_0x365db7['as'],'attributes':_0x365db7[_0x1d5a('0x1a')],'include':_0x365db7[_0x1d5a('0x1c')]?_[_0x1d5a('0x1d')](_0x365db7[_0x1d5a('0x1c')],function(_0x34a805){return{'model':db[_0x34a805['model']],'as':_0x34a805['as'],'attributes':_0x34a805[_0x1d5a('0x1a')],'include':_0x34a805[_0x1d5a('0x1c')]?_['map'](_0x34a805[_0x1d5a('0x1c')],function(_0x7e53c0){return{'model':db[_0x7e53c0['model']],'as':_0x7e53c0['as'],'attributes':_0x7e53c0['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d5a('0xb')](function(_0x3e4f3f){logger[_0x1d5a('0xc')](_0x1d5a('0x21'),_0x332681);logger[_0x1d5a('0x20')](_0x1d5a('0x21'),_0x332681,JSON[_0x1d5a('0x10')](_0x3e4f3f));_0x4df569(_0x3e4f3f);})[_0x1d5a('0x15')](function(_0x561268){logger[_0x1d5a('0x11')](_0x1d5a('0x21'),_0x561268[_0x1d5a('0x13')],_0x332681);_0x4863be(_0x14cd9f[_0x1d5a('0x11')](0x1f4,_0x561268[_0x1d5a('0x13')]));});});}; \ No newline at end of file +var _0x5d30=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FreshdeskAccount','findAll','options','where','attributes','map','model','include','GetFreshdeskAccount','stringify','catch','find','raw','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x14bb2f,_0x3c8ed0){var _0x5e2041=function(_0x44c46e){while(--_0x44c46e){_0x14bb2f['push'](_0x14bb2f['shift']());}};_0x5e2041(++_0x3c8ed0);}(_0x5d30,0x186));var _0x05d3=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x5d30[_0x38c699];return _0x3b1ded;};'use strict';var _=require(_0x05d3('0x0'));var util=require(_0x05d3('0x1'));var moment=require(_0x05d3('0x2'));var BPromise=require(_0x05d3('0x3'));var rs=require(_0x05d3('0x4'));var fs=require('fs');var Redis=require(_0x05d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x05d3('0x6'));var logger=require(_0x05d3('0x7'))(_0x05d3('0x8'));var config=require(_0x05d3('0x9'));var jayson=require(_0x05d3('0xa'));var client=jayson['client'][_0x05d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x533efc,_0xb46dad,_0x465375){return new BPromise(function(_0x3fbb1c,_0x4c65ee){return client[_0x05d3('0xc')](_0x533efc,_0x465375)[_0x05d3('0xd')](function(_0xa19fa5){logger[_0x05d3('0xe')](_0x05d3('0xf'),_0xb46dad,'request\x20sent');logger[_0x05d3('0x10')](_0x05d3('0x11'),_0xb46dad,_0x05d3('0x12'),JSON['stringify'](_0xa19fa5));if(_0xa19fa5[_0x05d3('0x13')]){if(_0xa19fa5['error'][_0x05d3('0x14')]===0x1f4){logger['error'](_0x05d3('0xf'),_0xb46dad,_0xa19fa5[_0x05d3('0x13')][_0x05d3('0x15')]);return _0x4c65ee(_0xa19fa5[_0x05d3('0x13')][_0x05d3('0x15')]);}logger[_0x05d3('0x13')](_0x05d3('0xf'),_0xb46dad,_0xa19fa5[_0x05d3('0x13')][_0x05d3('0x15')]);return _0x3fbb1c(_0xa19fa5[_0x05d3('0x13')][_0x05d3('0x15')]);}else{logger[_0x05d3('0xe')](_0x05d3('0xf'),_0xb46dad,'request\x20sent');_0x3fbb1c(_0xa19fa5['result'][_0x05d3('0x15')]);}})['catch'](function(_0x286726){logger[_0x05d3('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0xb46dad,_0x286726);_0x4c65ee(_0x286726);});});}exports['GetFreshdeskAccount']=function(_0x53fde3){var _0x3164e4=this;return new Promise(function(_0x32eba5,_0x1f9780){return db[_0x05d3('0x16')][_0x05d3('0x17')]({'raw':_0x53fde3['options']?_0x53fde3[_0x05d3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x53fde3['options']?_0x53fde3['options'][_0x05d3('0x19')]||null:null,'attributes':_0x53fde3[_0x05d3('0x18')]?_0x53fde3[_0x05d3('0x18')][_0x05d3('0x1a')]||null:null,'limit':_0x53fde3[_0x05d3('0x18')]?_0x53fde3['options']['limit']||null:null,'include':_0x53fde3['options']?_0x53fde3[_0x05d3('0x18')]['include']?_['map'](_0x53fde3[_0x05d3('0x18')]['include'],function(_0x5d247d){return{'model':db[_0x5d247d['model']],'as':_0x5d247d['as'],'attributes':_0x5d247d[_0x05d3('0x1a')],'include':_0x5d247d['include']?_[_0x05d3('0x1b')](_0x5d247d['include'],function(_0x52f0d5){return{'model':db[_0x52f0d5[_0x05d3('0x1c')]],'as':_0x52f0d5['as'],'attributes':_0x52f0d5[_0x05d3('0x1a')],'include':_0x52f0d5[_0x05d3('0x1d')]?_[_0x05d3('0x1b')](_0x52f0d5[_0x05d3('0x1d')],function(_0x31b90e){return{'model':db[_0x31b90e[_0x05d3('0x1c')]],'as':_0x31b90e['as'],'attributes':_0x31b90e['attributes']};}):[]};}):[]};}):[]:[]})[_0x05d3('0xd')](function(_0x384f31){logger['info'](_0x05d3('0x1e'),_0x53fde3);logger['debug'](_0x05d3('0x1e'),_0x53fde3,JSON[_0x05d3('0x1f')](_0x384f31));_0x32eba5(_0x384f31);})[_0x05d3('0x20')](function(_0x5e8b13){logger[_0x05d3('0x13')](_0x05d3('0x1e'),_0x5e8b13[_0x05d3('0x15')],_0x53fde3);_0x1f9780(_0x3164e4[_0x05d3('0x13')](0x1f4,_0x5e8b13['message']));});});};exports['ShowFreshdeskAccount']=function(_0x1caad6){var _0x3b737a=this;return new Promise(function(_0x1844e5,_0xfb1c94){return db[_0x05d3('0x16')][_0x05d3('0x21')]({'raw':_0x1caad6['options']?_0x1caad6[_0x05d3('0x18')][_0x05d3('0x22')]===undefined?!![]:![]:!![],'where':_0x1caad6[_0x05d3('0x18')]?_0x1caad6['options'][_0x05d3('0x19')]||null:null,'attributes':_0x1caad6[_0x05d3('0x18')]?_0x1caad6[_0x05d3('0x18')][_0x05d3('0x1a')]||null:null,'include':_0x1caad6[_0x05d3('0x18')]?_0x1caad6[_0x05d3('0x18')][_0x05d3('0x1d')]?_['map'](_0x1caad6['options'][_0x05d3('0x1d')],function(_0x553900){return{'model':db[_0x553900[_0x05d3('0x1c')]],'as':_0x553900['as'],'attributes':_0x553900[_0x05d3('0x1a')],'include':_0x553900[_0x05d3('0x1d')]?_[_0x05d3('0x1b')](_0x553900[_0x05d3('0x1d')],function(_0x23fa86){return{'model':db[_0x23fa86[_0x05d3('0x1c')]],'as':_0x23fa86['as'],'attributes':_0x23fa86['attributes'],'include':_0x23fa86[_0x05d3('0x1d')]?_[_0x05d3('0x1b')](_0x23fa86[_0x05d3('0x1d')],function(_0x8f5597){return{'model':db[_0x8f5597[_0x05d3('0x1c')]],'as':_0x8f5597['as'],'attributes':_0x8f5597[_0x05d3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x05d3('0xd')](function(_0x2ad71c){logger[_0x05d3('0xe')]('ShowFreshdeskAccount',_0x1caad6);logger[_0x05d3('0x10')](_0x05d3('0x23'),_0x1caad6,JSON[_0x05d3('0x1f')](_0x2ad71c));_0x1844e5(_0x2ad71c);})['catch'](function(_0xb9ed22){logger[_0x05d3('0x13')](_0x05d3('0x23'),_0xb9ed22[_0x05d3('0x15')],_0x1caad6);_0xfb1c94(_0x3b737a[_0x05d3('0x13')](0x1f4,_0xb9ed22[_0x05d3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 1dc0dc8..02ca81d 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 _0x859f=['express','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','getTags','post','/:id/tags','setTags','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0x859f,0x1ac));var _0xf859=function(_0x8af881,_0x4c54d1){_0x8af881=_0x8af881-0x0;var _0x15f54c=_0x859f[_0x8af881];return _0x15f54c;};'use strict';var multer=require(_0xf859('0x0'));var util=require(_0xf859('0x1'));var path=require(_0xf859('0x2'));var timeout=require(_0xf859('0x3'));var express=require(_0xf859('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf859('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf859('0x6'));var controller=require(_0xf859('0x7'));router[_0xf859('0x8')]('/',auth[_0xf859('0x9')](),controller['index']);router[_0xf859('0x8')](_0xf859('0xa'),auth[_0xf859('0x9')](),controller[_0xf859('0xb')]);router[_0xf859('0x8')](_0xf859('0xc'),auth[_0xf859('0x9')](),controller['getFields']);router[_0xf859('0x8')](_0xf859('0xd'),auth[_0xf859('0x9')](),controller[_0xf859('0xe')]);router[_0xf859('0x8')]('/:id/descriptions',auth[_0xf859('0x9')](),controller[_0xf859('0xf')]);router['get']('/:id/tags',auth[_0xf859('0x9')](),controller[_0xf859('0x10')]);router[_0xf859('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf859('0x11')](_0xf859('0x12'),auth['isAuthenticated'](),controller[_0xf859('0x13')]);router[_0xf859('0x14')](_0xf859('0xa'),auth[_0xf859('0x9')](),controller[_0xf859('0x15')]);router[_0xf859('0x16')](_0xf859('0xa'),auth['isAuthenticated'](),controller[_0xf859('0x17')]);module['exports']=router; \ No newline at end of file +var _0xfacd=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id/fields','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','put','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x5a4372,_0x1a8f1c){var _0x51ed54=function(_0x2e94e7){while(--_0x2e94e7){_0x5a4372['push'](_0x5a4372['shift']());}};_0x51ed54(++_0x1a8f1c);}(_0xfacd,0x177));var _0xdfac=function(_0x51061e,_0x5e7d8b){_0x51061e=_0x51061e-0x0;var _0x27e83d=_0xfacd[_0x51061e];return _0x27e83d;};'use strict';var multer=require(_0xdfac('0x0'));var util=require('util');var path=require(_0xdfac('0x1'));var timeout=require(_0xdfac('0x2'));var express=require('express');var router=express[_0xdfac('0x3')]();var fs_extra=require(_0xdfac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfac('0x5'));var config=require(_0xdfac('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xdfac('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfac('0x8')]);router[_0xdfac('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdfac('0x7')](_0xdfac('0x9'),auth[_0xdfac('0xa')](),controller['getFields']);router[_0xdfac('0x7')]('/:id/subjects',auth[_0xdfac('0xa')](),controller[_0xdfac('0xb')]);router[_0xdfac('0x7')](_0xdfac('0xc'),auth[_0xdfac('0xa')](),controller[_0xdfac('0xd')]);router['get'](_0xdfac('0xe'),auth[_0xdfac('0xa')](),controller[_0xdfac('0xf')]);router['post']('/',auth[_0xdfac('0xa')](),controller['create']);router['post'](_0xdfac('0xe'),auth[_0xdfac('0xa')](),controller['setTags']);router[_0xdfac('0x10')]('/:id',auth[_0xdfac('0xa')](),controller[_0xdfac('0x11')]);router['delete'](_0xdfac('0x12'),auth['isAuthenticated'](),controller[_0xdfac('0x13')]);module[_0xdfac('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6d80272..ac0336d 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 _0x7527=['STRING','exports'];(function(_0x31b350,_0x5be290){var _0x1870dc=function(_0xbae48d){while(--_0xbae48d){_0x31b350['push'](_0x31b350['shift']());}};_0x1870dc(++_0x5be290);}(_0x7527,0x83));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7752('0x0')]={'name':{'type':Sequelize[_0x7752('0x1')]},'description':{'type':Sequelize[_0x7752('0x1')]}}; \ No newline at end of file +var _0xfc8e=['STRING','exports'];(function(_0x1ff346,_0x4e79c3){var _0x4ef062=function(_0x4c9309){while(--_0x4c9309){_0x1ff346['push'](_0x1ff346['shift']());}};_0x4ef062(++_0x4e79c3);}(_0xfc8e,0x97));var _0xefc8=function(_0x2b0dcf,_0x594cb8){_0x2b0dcf=_0x2b0dcf-0x0;var _0x3a3601=_0xfc8e[_0x2b0dcf];return _0x3a3601;};'use strict';var Sequelize=require('sequelize');module[_0xefc8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefc8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 72b7fea..3edd247 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 _0xf43d=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','fields','find','catch','create','body','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x40be1a,_0x13b843){var _0x4e6f36=function(_0x85771f){while(--_0x85771f){_0x40be1a['push'](_0x40be1a['shift']());}};_0x4e6f36(++_0x13b843);}(_0xf43d,0x18d));var _0xdf43=function(_0x3d09a6,_0x50b2e4){_0x3d09a6=_0x3d09a6-0x0;var _0x2d6c20=_0xf43d[_0x3d09a6];return _0x2d6c20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf43('0x0'));var zipdir=require(_0xdf43('0x1'));var jsonpatch=require(_0xdf43('0x2'));var rp=require(_0xdf43('0x3'));var moment=require(_0xdf43('0x4'));var BPromise=require(_0xdf43('0x5'));var Mustache=require('mustache');var util=require(_0xdf43('0x6'));var path=require('path');var sox=require(_0xdf43('0x7'));var csv=require(_0xdf43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf43('0x9'));var squel=require(_0xdf43('0xa'));var crypto=require('crypto');var jsforce=require(_0xdf43('0xb'));var deskjs=require(_0xdf43('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdf43('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf43('0xe'));var authService=require(_0xdf43('0xf'));var qs=require(_0xdf43('0x10'));var as=require(_0xdf43('0x11'));var hardwareService=require(_0xdf43('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xdf43('0x13'));var config=require(_0xdf43('0x14'));var licenseUtil=require(_0xdf43('0x15'));var db=require(_0xdf43('0x16'))['db'];function respondWithStatusCode(_0x58ad4a,_0x4ab6dc){_0x4ab6dc=_0x4ab6dc||0xcc;return function(_0x2b4776){if(_0x2b4776){return _0x58ad4a[_0xdf43('0x17')](_0x4ab6dc);}return _0x58ad4a[_0xdf43('0x18')](_0x4ab6dc)[_0xdf43('0x19')]();};}function respondWithResult(_0x1c4927,_0x186358){_0x186358=_0x186358||0xc8;return function(_0x4e7687){if(_0x4e7687){return _0x1c4927[_0xdf43('0x18')](_0x186358)[_0xdf43('0x1a')](_0x4e7687);}};}function respondWithFilteredResult(_0x3d855c,_0xc6b829){return function(_0x28a43f){if(_0x28a43f){var _0x2fb30e=typeof _0xc6b829[_0xdf43('0x1b')]==='undefined'&&typeof _0xc6b829['limit']===_0xdf43('0x1c');var _0x375989=_0x28a43f['count'];var _0x2ae9dc=_0x2fb30e?0x0:_0xc6b829[_0xdf43('0x1b')];var _0x5a41c3=_0x2fb30e?_0x28a43f[_0xdf43('0x1d')]:_0xc6b829[_0xdf43('0x1b')]+_0xc6b829[_0xdf43('0x1e')];var _0x1a386c;if(_0x5a41c3>=_0x375989){_0x5a41c3=_0x375989;_0x1a386c=0xc8;}else{_0x1a386c=0xce;}_0x3d855c[_0xdf43('0x18')](_0x1a386c);return _0x3d855c[_0xdf43('0x1f')](_0xdf43('0x20'),_0x2ae9dc+'-'+_0x5a41c3+'/'+_0x375989)[_0xdf43('0x1a')](_0x28a43f);}return null;};}function patchUpdates(_0x3af1df){return function(_0x433f92){try{jsonpatch[_0xdf43('0x21')](_0x433f92,_0x3af1df,!![]);}catch(_0x3a1868){return BPromise['reject'](_0x3a1868);}return _0x433f92[_0xdf43('0x22')]();};}function saveUpdates(_0x1926a3,_0x1ee71c){return function(_0x4ce855){if(_0x4ce855){return _0x4ce855[_0xdf43('0x23')](_0x1926a3)[_0xdf43('0x24')](function(_0x3e1c8b){return _0x3e1c8b;});}return null;};}function removeEntity(_0x260a78,_0x2e3970){return function(_0x11a84e){if(_0x11a84e){return _0x11a84e[_0xdf43('0x25')]()[_0xdf43('0x24')](function(){_0x260a78[_0xdf43('0x18')](0xcc)[_0xdf43('0x19')]();});}};}function handleEntityNotFound(_0x99ccaf,_0x1b768d){return function(_0x4a49c1){if(!_0x4a49c1){_0x99ccaf['sendStatus'](0x194);}return _0x4a49c1;};}function handleError(_0x38e0e1,_0x37e93e){_0x37e93e=_0x37e93e||0x1f4;return function(_0x38a7c1){logger[_0xdf43('0x26')](_0x38a7c1[_0xdf43('0x27')]);if(_0x38a7c1[_0xdf43('0x28')]){delete _0x38a7c1['name'];}_0x38e0e1[_0xdf43('0x18')](_0x37e93e)[_0xdf43('0x29')](_0x38a7c1);};}exports[_0xdf43('0x2a')]=function(_0x133c41,_0xa12a17){var _0x10dfbb={},_0x5c5dc8={},_0xf2e2ef={'count':0x0,'rows':[]};var _0x2cab3b=_['map'](db[_0xdf43('0x2b')][_0xdf43('0x2c')],function(_0x560469){return{'name':_0x560469[_0xdf43('0x2d')],'type':_0x560469['type']['key']};});_0x5c5dc8[_0xdf43('0x2e')]=_[_0xdf43('0x2f')](_0x2cab3b,_0xdf43('0x28'));_0x5c5dc8[_0xdf43('0x30')]=_[_0xdf43('0x31')](_0x133c41[_0xdf43('0x30')]);_0x5c5dc8['filters']=_[_0xdf43('0x32')](_0x5c5dc8[_0xdf43('0x2e')],_0x5c5dc8['query']);_0x10dfbb[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x5c5dc8[_0xdf43('0x2e')],qs['fields'](_0x133c41[_0xdf43('0x30')]['fields']));_0x10dfbb['attributes']=_0x10dfbb['attributes'][_0xdf43('0x34')]?_0x10dfbb[_0xdf43('0x33')]:_0x5c5dc8['model'];if(!_0x133c41[_0xdf43('0x30')]['hasOwnProperty'](_0xdf43('0x35'))){_0x10dfbb[_0xdf43('0x1e')]=qs['limit'](_0x133c41['query'][_0xdf43('0x1e')]);_0x10dfbb[_0xdf43('0x1b')]=qs['offset'](_0x133c41[_0xdf43('0x30')][_0xdf43('0x1b')]);}_0x10dfbb[_0xdf43('0x36')]=qs['sort'](_0x133c41[_0xdf43('0x30')][_0xdf43('0x37')]);_0x10dfbb[_0xdf43('0x38')]=qs[_0xdf43('0x39')](_[_0xdf43('0x3a')](_0x133c41[_0xdf43('0x30')],_0x5c5dc8[_0xdf43('0x39')]),_0x2cab3b);if(_0x133c41['query']['filter']){_0x10dfbb['where']=_[_0xdf43('0x3b')](_0x10dfbb[_0xdf43('0x38')],{'$or':_[_0xdf43('0x2f')](_0x2cab3b,function(_0xe05b7b){if(_0xe05b7b[_0xdf43('0x3c')]!==_0xdf43('0x3d')){var _0x43097d={};_0x43097d[_0xe05b7b['name']]={'$like':'%'+_0x133c41[_0xdf43('0x30')][_0xdf43('0x3e')]+'%'};return _0x43097d;}})});}_0x10dfbb=_[_0xdf43('0x3b')]({},_0x10dfbb,_0x133c41[_0xdf43('0x3f')]);var _0x15b35f={'where':_0x10dfbb[_0xdf43('0x38')]};return db['FreshdeskConfiguration'][_0xdf43('0x1d')](_0x15b35f)[_0xdf43('0x24')](function(_0x188999){_0xf2e2ef[_0xdf43('0x1d')]=_0x188999;if(_0x133c41[_0xdf43('0x30')][_0xdf43('0x40')]){_0x10dfbb[_0xdf43('0x41')]=[{'all':!![]}];}return db[_0xdf43('0x2b')][_0xdf43('0x42')](_0x10dfbb);})[_0xdf43('0x24')](function(_0x5ce681){_0xf2e2ef['rows']=_0x5ce681;return _0xf2e2ef;})[_0xdf43('0x24')](respondWithFilteredResult(_0xa12a17,_0x10dfbb))['catch'](handleError(_0xa12a17,null));};exports[_0xdf43('0x43')]=function(_0x31edf1,_0x236266){var _0x78d4de={'raw':![],'where':{'id':_0x31edf1[_0xdf43('0x44')]['id']}},_0x865aed={};_0x865aed['model']=_[_0xdf43('0x31')](db[_0xdf43('0x2b')]['rawAttributes']);_0x865aed['query']=_[_0xdf43('0x31')](_0x31edf1[_0xdf43('0x30')]);_0x865aed[_0xdf43('0x39')]=_[_0xdf43('0x32')](_0x865aed[_0xdf43('0x2e')],_0x865aed['query']);_0x78d4de[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x865aed[_0xdf43('0x2e')],qs['fields'](_0x31edf1[_0xdf43('0x30')][_0xdf43('0x45')]));_0x78d4de[_0xdf43('0x33')]=_0x78d4de[_0xdf43('0x33')][_0xdf43('0x34')]?_0x78d4de[_0xdf43('0x33')]:_0x865aed[_0xdf43('0x2e')];if(_0x31edf1[_0xdf43('0x30')][_0xdf43('0x40')]){_0x78d4de['include']=[{'all':!![]}];}_0x78d4de=_['merge']({},_0x78d4de,_0x31edf1[_0xdf43('0x3f')]);return db[_0xdf43('0x2b')][_0xdf43('0x46')](_0x78d4de)[_0xdf43('0x24')](handleEntityNotFound(_0x236266,null))[_0xdf43('0x24')](respondWithResult(_0x236266,null))[_0xdf43('0x47')](handleError(_0x236266,null));};exports[_0xdf43('0x48')]=function(_0x5258b6,_0x1179d0){return db[_0xdf43('0x2b')][_0xdf43('0x48')](_0x5258b6[_0xdf43('0x49')],{})[_0xdf43('0x24')](respondWithResult(_0x1179d0,0xc9))['catch'](handleError(_0x1179d0,null));};exports[_0xdf43('0x23')]=function(_0x3df2b2,_0x52b5fa){if(_0x3df2b2[_0xdf43('0x49')]['id']){delete _0x3df2b2[_0xdf43('0x49')]['id'];}return db[_0xdf43('0x2b')][_0xdf43('0x46')]({'where':{'id':_0x3df2b2['params']['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0x52b5fa,null))[_0xdf43('0x24')](saveUpdates(_0x3df2b2[_0xdf43('0x49')],null))[_0xdf43('0x24')](respondWithResult(_0x52b5fa,null))['catch'](handleError(_0x52b5fa,null));};exports[_0xdf43('0x25')]=function(_0x31981f,_0x53604f){return db['FreshdeskConfiguration'][_0xdf43('0x46')]({'where':{'id':_0x31981f[_0xdf43('0x44')]['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0x53604f,null))[_0xdf43('0x24')](removeEntity(_0x53604f,null))[_0xdf43('0x47')](handleError(_0x53604f,null));};exports[_0xdf43('0x4a')]=function(_0x1584ad,_0x4a32cf,_0xdeb9){var _0x32d65c={};var _0x4230b9={};var _0x545cd5;var _0x11ec8b;return db['FreshdeskConfiguration'][_0xdf43('0x4b')]({'where':{'id':_0x1584ad['params']['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0x4a32cf,null))[_0xdf43('0x24')](function(_0x3c3619){if(_0x3c3619){_0x545cd5=_0x3c3619;_0x4230b9[_0xdf43('0x2e')]=_[_0xdf43('0x31')](db[_0xdf43('0x4c')]['rawAttributes']);_0x4230b9[_0xdf43('0x30')]=_[_0xdf43('0x31')](_0x1584ad[_0xdf43('0x30')]);_0x4230b9[_0xdf43('0x39')]=_['intersection'](_0x4230b9[_0xdf43('0x2e')],_0x4230b9[_0xdf43('0x30')]);_0x32d65c[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x4230b9[_0xdf43('0x2e')],qs['fields'](_0x1584ad['query'][_0xdf43('0x45')]));_0x32d65c['attributes']=_0x32d65c[_0xdf43('0x33')][_0xdf43('0x34')]?_0x32d65c[_0xdf43('0x33')]:_0x4230b9[_0xdf43('0x2e')];_0x32d65c[_0xdf43('0x36')]=qs[_0xdf43('0x37')](_0x1584ad[_0xdf43('0x30')][_0xdf43('0x37')]);_0x32d65c[_0xdf43('0x38')]=qs[_0xdf43('0x39')](_[_0xdf43('0x3a')](_0x1584ad[_0xdf43('0x30')],_0x4230b9['filters']));if(_0x1584ad[_0xdf43('0x30')][_0xdf43('0x3e')]){_0x32d65c[_0xdf43('0x38')]=_[_0xdf43('0x3b')](_0x32d65c[_0xdf43('0x38')],{'$or':_[_0xdf43('0x2f')](_0x32d65c[_0xdf43('0x33')],function(_0x39d86e){var _0x4d3bd3={};_0x4d3bd3[_0x39d86e]={'$like':'%'+_0x1584ad[_0xdf43('0x30')][_0xdf43('0x3e')]+'%'};return _0x4d3bd3;})});}_0x32d65c=_[_0xdf43('0x3b')]({},_0x32d65c,_0x1584ad[_0xdf43('0x3f')]);return _0x545cd5['getFields'](_0x32d65c);}})[_0xdf43('0x24')](function(_0x2f226c){if(_0x2f226c){_0x11ec8b=_0x2f226c[_0xdf43('0x34')];if(!_0x1584ad[_0xdf43('0x30')][_0xdf43('0x4d')]('nolimit')){_0x32d65c[_0xdf43('0x1e')]=qs['limit'](_0x1584ad[_0xdf43('0x30')][_0xdf43('0x1e')]);_0x32d65c[_0xdf43('0x1b')]=qs[_0xdf43('0x1b')](_0x1584ad['query']['offset']);}return _0x545cd5[_0xdf43('0x4a')](_0x32d65c);}})[_0xdf43('0x24')](function(_0x43a40b){if(_0x43a40b){return _0x43a40b?{'count':_0x11ec8b,'rows':_0x43a40b}:null;}})[_0xdf43('0x24')](respondWithResult(_0x4a32cf,null))[_0xdf43('0x47')](handleError(_0x4a32cf,null));};exports[_0xdf43('0x4e')]=function(_0x459e11,_0xbb1040,_0x341e11){var _0x2554e9={};var _0x2d81fe={};var _0x5027c0;var _0x2e0488;return db[_0xdf43('0x2b')][_0xdf43('0x4b')]({'where':{'id':_0x459e11['params']['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0xbb1040,null))[_0xdf43('0x24')](function(_0x5cfef9){if(_0x5cfef9){_0x5027c0=_0x5cfef9;_0x2d81fe[_0xdf43('0x2e')]=_[_0xdf43('0x31')](db[_0xdf43('0x4c')][_0xdf43('0x2c')]);_0x2d81fe[_0xdf43('0x30')]=_[_0xdf43('0x31')](_0x459e11[_0xdf43('0x30')]);_0x2d81fe[_0xdf43('0x39')]=_[_0xdf43('0x32')](_0x2d81fe[_0xdf43('0x2e')],_0x2d81fe[_0xdf43('0x30')]);_0x2554e9[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x2d81fe[_0xdf43('0x2e')],qs[_0xdf43('0x45')](_0x459e11[_0xdf43('0x30')][_0xdf43('0x45')]));_0x2554e9[_0xdf43('0x33')]=_0x2554e9['attributes']['length']?_0x2554e9[_0xdf43('0x33')]:_0x2d81fe[_0xdf43('0x2e')];_0x2554e9['order']=qs['sort'](_0x459e11['query'][_0xdf43('0x37')]);_0x2554e9[_0xdf43('0x38')]=qs[_0xdf43('0x39')](_[_0xdf43('0x3a')](_0x459e11[_0xdf43('0x30')],_0x2d81fe[_0xdf43('0x39')]));if(_0x459e11[_0xdf43('0x30')][_0xdf43('0x3e')]){_0x2554e9[_0xdf43('0x38')]=_[_0xdf43('0x3b')](_0x2554e9[_0xdf43('0x38')],{'$or':_[_0xdf43('0x2f')](_0x2554e9[_0xdf43('0x33')],function(_0x5934c9){var _0x5fb3e={};_0x5fb3e[_0x5934c9]={'$like':'%'+_0x459e11[_0xdf43('0x30')][_0xdf43('0x3e')]+'%'};return _0x5fb3e;})});}_0x2554e9=_['merge']({},_0x2554e9,_0x459e11[_0xdf43('0x3f')]);return _0x5027c0[_0xdf43('0x4e')](_0x2554e9);}})[_0xdf43('0x24')](function(_0x921244){if(_0x921244){_0x2e0488=_0x921244[_0xdf43('0x34')];if(!_0x459e11[_0xdf43('0x30')]['hasOwnProperty'](_0xdf43('0x35'))){_0x2554e9[_0xdf43('0x1e')]=qs[_0xdf43('0x1e')](_0x459e11[_0xdf43('0x30')]['limit']);_0x2554e9[_0xdf43('0x1b')]=qs[_0xdf43('0x1b')](_0x459e11[_0xdf43('0x30')]['offset']);}return _0x5027c0[_0xdf43('0x4e')](_0x2554e9);}})[_0xdf43('0x24')](function(_0x1e97eb){if(_0x1e97eb){return _0x1e97eb?{'count':_0x2e0488,'rows':_0x1e97eb}:null;}})[_0xdf43('0x24')](respondWithResult(_0xbb1040,null))[_0xdf43('0x47')](handleError(_0xbb1040,null));};exports['getDescriptions']=function(_0x2f1d6e,_0x2a9b48,_0x246c72){var _0x4f4f9a={};var _0x1f6ad4={};var _0x5f2667;var _0x43d637;return db['FreshdeskConfiguration'][_0xdf43('0x4b')]({'where':{'id':_0x2f1d6e[_0xdf43('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a9b48,null))[_0xdf43('0x24')](function(_0x2512d6){if(_0x2512d6){_0x5f2667=_0x2512d6;_0x1f6ad4[_0xdf43('0x2e')]=_[_0xdf43('0x31')](db['FreshdeskField'][_0xdf43('0x2c')]);_0x1f6ad4[_0xdf43('0x30')]=_[_0xdf43('0x31')](_0x2f1d6e['query']);_0x1f6ad4[_0xdf43('0x39')]=_[_0xdf43('0x32')](_0x1f6ad4[_0xdf43('0x2e')],_0x1f6ad4['query']);_0x4f4f9a[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x1f6ad4['model'],qs[_0xdf43('0x45')](_0x2f1d6e[_0xdf43('0x30')][_0xdf43('0x45')]));_0x4f4f9a[_0xdf43('0x33')]=_0x4f4f9a['attributes']['length']?_0x4f4f9a[_0xdf43('0x33')]:_0x1f6ad4[_0xdf43('0x2e')];_0x4f4f9a[_0xdf43('0x36')]=qs['sort'](_0x2f1d6e[_0xdf43('0x30')]['sort']);_0x4f4f9a[_0xdf43('0x38')]=qs[_0xdf43('0x39')](_[_0xdf43('0x3a')](_0x2f1d6e[_0xdf43('0x30')],_0x1f6ad4[_0xdf43('0x39')]));if(_0x2f1d6e[_0xdf43('0x30')][_0xdf43('0x3e')]){_0x4f4f9a[_0xdf43('0x38')]=_[_0xdf43('0x3b')](_0x4f4f9a[_0xdf43('0x38')],{'$or':_[_0xdf43('0x2f')](_0x4f4f9a[_0xdf43('0x33')],function(_0x5eaeae){var _0x418f25={};_0x418f25[_0x5eaeae]={'$like':'%'+_0x2f1d6e[_0xdf43('0x30')][_0xdf43('0x3e')]+'%'};return _0x418f25;})});}_0x4f4f9a=_[_0xdf43('0x3b')]({},_0x4f4f9a,_0x2f1d6e['options']);return _0x5f2667[_0xdf43('0x4f')](_0x4f4f9a);}})[_0xdf43('0x24')](function(_0x591abe){if(_0x591abe){_0x43d637=_0x591abe['length'];if(!_0x2f1d6e[_0xdf43('0x30')]['hasOwnProperty'](_0xdf43('0x35'))){_0x4f4f9a['limit']=qs['limit'](_0x2f1d6e[_0xdf43('0x30')][_0xdf43('0x1e')]);_0x4f4f9a[_0xdf43('0x1b')]=qs[_0xdf43('0x1b')](_0x2f1d6e[_0xdf43('0x30')][_0xdf43('0x1b')]);}return _0x5f2667[_0xdf43('0x4f')](_0x4f4f9a);}})[_0xdf43('0x24')](function(_0x284e26){if(_0x284e26){return _0x284e26?{'count':_0x43d637,'rows':_0x284e26}:null;}})[_0xdf43('0x24')](respondWithResult(_0x2a9b48,null))[_0xdf43('0x47')](handleError(_0x2a9b48,null));};exports[_0xdf43('0x50')]=function(_0x5786ae,_0x342059,_0x18180b){var _0x2be4e4={};var _0x32b243={};var _0x47e1d4;var _0x1ab4bd;return db['FreshdeskConfiguration'][_0xdf43('0x4b')]({'where':{'id':_0x5786ae[_0xdf43('0x44')]['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0x342059,null))['then'](function(_0x3c568f){if(_0x3c568f){_0x47e1d4=_0x3c568f;_0x32b243[_0xdf43('0x2e')]=_[_0xdf43('0x31')](db[_0xdf43('0x51')]['rawAttributes']);_0x32b243[_0xdf43('0x30')]=_['keys'](_0x5786ae[_0xdf43('0x30')]);_0x32b243[_0xdf43('0x39')]=_[_0xdf43('0x32')](_0x32b243['model'],_0x32b243[_0xdf43('0x30')]);_0x2be4e4[_0xdf43('0x33')]=_[_0xdf43('0x32')](_0x32b243[_0xdf43('0x2e')],qs['fields'](_0x5786ae[_0xdf43('0x30')][_0xdf43('0x45')]));_0x2be4e4[_0xdf43('0x33')]=_0x2be4e4[_0xdf43('0x33')][_0xdf43('0x34')]?_0x2be4e4[_0xdf43('0x33')]:_0x32b243[_0xdf43('0x2e')];_0x2be4e4[_0xdf43('0x36')]=qs[_0xdf43('0x37')](_0x5786ae[_0xdf43('0x30')][_0xdf43('0x37')]);_0x2be4e4['where']=qs[_0xdf43('0x39')](_[_0xdf43('0x3a')](_0x5786ae['query'],_0x32b243[_0xdf43('0x39')]));if(_0x5786ae[_0xdf43('0x30')][_0xdf43('0x3e')]){_0x2be4e4['where']=_[_0xdf43('0x3b')](_0x2be4e4['where'],{'$or':_[_0xdf43('0x2f')](_0x2be4e4[_0xdf43('0x33')],function(_0x550cf9){var _0x64c872={};_0x64c872[_0x550cf9]={'$like':'%'+_0x5786ae['query']['filter']+'%'};return _0x64c872;})});}_0x2be4e4=_[_0xdf43('0x3b')]({},_0x2be4e4,_0x5786ae[_0xdf43('0x3f')]);return _0x47e1d4[_0xdf43('0x50')](_0x2be4e4);}})['then'](function(_0x4c4a7a){if(_0x4c4a7a){_0x1ab4bd=_0x4c4a7a[_0xdf43('0x34')];if(!_0x5786ae[_0xdf43('0x30')][_0xdf43('0x4d')](_0xdf43('0x35'))){_0x2be4e4['limit']=qs[_0xdf43('0x1e')](_0x5786ae[_0xdf43('0x30')]['limit']);_0x2be4e4[_0xdf43('0x1b')]=qs['offset'](_0x5786ae[_0xdf43('0x30')][_0xdf43('0x1b')]);}return _0x47e1d4[_0xdf43('0x50')](_0x2be4e4);}})[_0xdf43('0x24')](function(_0x5ccb59){if(_0x5ccb59){return _0x5ccb59?{'count':_0x1ab4bd,'rows':_0x5ccb59}:null;}})[_0xdf43('0x24')](respondWithResult(_0x342059,null))[_0xdf43('0x47')](handleError(_0x342059,null));};exports[_0xdf43('0x52')]=function(_0x4a8380,_0x35ee9b,_0xd01a4e){if(_0x4a8380['body']['id']){delete _0x4a8380[_0xdf43('0x49')]['id'];}return db['FreshdeskConfiguration'][_0xdf43('0x4b')]({'where':{'id':_0x4a8380['params']['id']}})[_0xdf43('0x24')](handleEntityNotFound(_0x35ee9b,null))[_0xdf43('0x24')](function(_0x55c59a){if(_0x55c59a){return _0x55c59a[_0xdf43('0x52')](_0x4a8380[_0xdf43('0x49')]['ids']||[]);}return null;})[_0xdf43('0x24')](respondWithResult(_0x35ee9b,null))[_0xdf43('0x47')](handleError(_0x35ee9b,null));}; \ No newline at end of file +var _0x766a=['setTags','ids','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','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','end','undefined','limit','count','offset','set','json','apply','reject','save','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x766a,0xb4));var _0xa766=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x766a[_0x384231];return _0x2480bf;};'use strict';var emlformat=require(_0xa766('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa766('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa766('0x2'));var moment=require(_0xa766('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa766('0x4'));var util=require(_0xa766('0x5'));var path=require(_0xa766('0x6'));var sox=require(_0xa766('0x7'));var csv=require('to-csv');var ejs=require(_0xa766('0x8'));var fs=require('fs');var fs_extra=require(_0xa766('0x9'));var _=require(_0xa766('0xa'));var squel=require('squel');var crypto=require(_0xa766('0xb'));var jsforce=require(_0xa766('0xc'));var deskjs=require(_0xa766('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa766('0xe'));var Papa=require('papaparse');var Redis=require(_0xa766('0xf'));var authService=require(_0xa766('0x10'));var qs=require(_0xa766('0x11'));var as=require(_0xa766('0x12'));var hardwareService=require(_0xa766('0x13'));var logger=require(_0xa766('0x14'))(_0xa766('0x15'));var utils=require(_0xa766('0x16'));var config=require(_0xa766('0x17'));var licenseUtil=require(_0xa766('0x18'));var db=require(_0xa766('0x19'))['db'];function respondWithStatusCode(_0x49ef7e,_0x4ed269){_0x4ed269=_0x4ed269||0xcc;return function(_0x2f2948){if(_0x2f2948){return _0x49ef7e[_0xa766('0x1a')](_0x4ed269);}return _0x49ef7e[_0xa766('0x1b')](_0x4ed269)[_0xa766('0x1c')]();};}function respondWithResult(_0x1e8783,_0x5ed22e){_0x5ed22e=_0x5ed22e||0xc8;return function(_0x393c6a){if(_0x393c6a){return _0x1e8783[_0xa766('0x1b')](_0x5ed22e)['json'](_0x393c6a);}};}function respondWithFilteredResult(_0xabc66c,_0x16800d){return function(_0x44dafc){if(_0x44dafc){var _0x4684c3=typeof _0x16800d['offset']===_0xa766('0x1d')&&typeof _0x16800d[_0xa766('0x1e')]===_0xa766('0x1d');var _0x25cf63=_0x44dafc[_0xa766('0x1f')];var _0x350c9f=_0x4684c3?0x0:_0x16800d[_0xa766('0x20')];var _0x15ba6f=_0x4684c3?_0x44dafc[_0xa766('0x1f')]:_0x16800d['offset']+_0x16800d[_0xa766('0x1e')];var _0x504183;if(_0x15ba6f>=_0x25cf63){_0x15ba6f=_0x25cf63;_0x504183=0xc8;}else{_0x504183=0xce;}_0xabc66c[_0xa766('0x1b')](_0x504183);return _0xabc66c[_0xa766('0x21')]('Content-Range',_0x350c9f+'-'+_0x15ba6f+'/'+_0x25cf63)[_0xa766('0x22')](_0x44dafc);}return null;};}function patchUpdates(_0x1c0aae){return function(_0xf0a2d5){try{jsonpatch[_0xa766('0x23')](_0xf0a2d5,_0x1c0aae,!![]);}catch(_0x380ba2){return BPromise[_0xa766('0x24')](_0x380ba2);}return _0xf0a2d5[_0xa766('0x25')]();};}function saveUpdates(_0x4b870e,_0x526d99){return function(_0xb039dc){if(_0xb039dc){return _0xb039dc['update'](_0x4b870e)[_0xa766('0x26')](function(_0x3c63db){return _0x3c63db;});}return null;};}function removeEntity(_0x2b2977,_0x60a12c){return function(_0x15186b){if(_0x15186b){return _0x15186b['destroy']()['then'](function(){_0x2b2977[_0xa766('0x1b')](0xcc)[_0xa766('0x1c')]();});}};}function handleEntityNotFound(_0x1be2fe,_0x11ae97){return function(_0x51db56){if(!_0x51db56){_0x1be2fe[_0xa766('0x1a')](0x194);}return _0x51db56;};}function handleError(_0x442885,_0x30604e){_0x30604e=_0x30604e||0x1f4;return function(_0x1dfadc){logger[_0xa766('0x27')](_0x1dfadc[_0xa766('0x28')]);if(_0x1dfadc[_0xa766('0x29')]){delete _0x1dfadc[_0xa766('0x29')];}_0x442885[_0xa766('0x1b')](_0x30604e)[_0xa766('0x2a')](_0x1dfadc);};}exports[_0xa766('0x2b')]=function(_0x38bc25,_0x587ead){var _0x48020f={},_0x5e2767={},_0x36ac27={'count':0x0,'rows':[]};var _0x860f72=_[_0xa766('0x2c')](db[_0xa766('0x2d')][_0xa766('0x2e')],function(_0x286636){return{'name':_0x286636[_0xa766('0x2f')],'type':_0x286636['type'][_0xa766('0x30')]};});_0x5e2767[_0xa766('0x31')]=_['map'](_0x860f72,_0xa766('0x29'));_0x5e2767['query']=_[_0xa766('0x32')](_0x38bc25[_0xa766('0x33')]);_0x5e2767[_0xa766('0x34')]=_[_0xa766('0x35')](_0x5e2767[_0xa766('0x31')],_0x5e2767['query']);_0x48020f[_0xa766('0x36')]=_[_0xa766('0x35')](_0x5e2767[_0xa766('0x31')],qs[_0xa766('0x37')](_0x38bc25[_0xa766('0x33')][_0xa766('0x37')]));_0x48020f[_0xa766('0x36')]=_0x48020f[_0xa766('0x36')][_0xa766('0x38')]?_0x48020f['attributes']:_0x5e2767['model'];if(!_0x38bc25[_0xa766('0x33')]['hasOwnProperty'](_0xa766('0x39'))){_0x48020f['limit']=qs[_0xa766('0x1e')](_0x38bc25[_0xa766('0x33')][_0xa766('0x1e')]);_0x48020f[_0xa766('0x20')]=qs[_0xa766('0x20')](_0x38bc25['query'][_0xa766('0x20')]);}_0x48020f[_0xa766('0x3a')]=qs[_0xa766('0x3b')](_0x38bc25[_0xa766('0x33')][_0xa766('0x3b')]);_0x48020f['where']=qs['filters'](_[_0xa766('0x3c')](_0x38bc25['query'],_0x5e2767['filters']),_0x860f72);if(_0x38bc25['query'][_0xa766('0x3d')]){_0x48020f['where']=_['merge'](_0x48020f['where'],{'$or':_[_0xa766('0x2c')](_0x860f72,function(_0x5ed9ca){if(_0x5ed9ca[_0xa766('0x3e')]!==_0xa766('0x3f')){var _0x28c33e={};_0x28c33e[_0x5ed9ca[_0xa766('0x29')]]={'$like':'%'+_0x38bc25[_0xa766('0x33')][_0xa766('0x3d')]+'%'};return _0x28c33e;}})});}_0x48020f=_[_0xa766('0x40')]({},_0x48020f,_0x38bc25[_0xa766('0x41')]);var _0x57cd07={'where':_0x48020f[_0xa766('0x42')]};return db[_0xa766('0x2d')][_0xa766('0x1f')](_0x57cd07)['then'](function(_0x36c4ce){_0x36ac27[_0xa766('0x1f')]=_0x36c4ce;if(_0x38bc25['query'][_0xa766('0x43')]){_0x48020f[_0xa766('0x44')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xa766('0x45')](_0x48020f);})[_0xa766('0x26')](function(_0x4c8d30){_0x36ac27[_0xa766('0x46')]=_0x4c8d30;return _0x36ac27;})[_0xa766('0x26')](respondWithFilteredResult(_0x587ead,_0x48020f))[_0xa766('0x47')](handleError(_0x587ead,null));};exports[_0xa766('0x48')]=function(_0x4cf5b2,_0x349f37){var _0x44c73f={'raw':![],'where':{'id':_0x4cf5b2[_0xa766('0x49')]['id']}},_0x5de944={};_0x5de944[_0xa766('0x31')]=_[_0xa766('0x32')](db[_0xa766('0x2d')][_0xa766('0x2e')]);_0x5de944[_0xa766('0x33')]=_['keys'](_0x4cf5b2[_0xa766('0x33')]);_0x5de944[_0xa766('0x34')]=_[_0xa766('0x35')](_0x5de944[_0xa766('0x31')],_0x5de944[_0xa766('0x33')]);_0x44c73f[_0xa766('0x36')]=_['intersection'](_0x5de944['model'],qs[_0xa766('0x37')](_0x4cf5b2[_0xa766('0x33')][_0xa766('0x37')]));_0x44c73f[_0xa766('0x36')]=_0x44c73f[_0xa766('0x36')][_0xa766('0x38')]?_0x44c73f[_0xa766('0x36')]:_0x5de944['model'];if(_0x4cf5b2['query'][_0xa766('0x43')]){_0x44c73f[_0xa766('0x44')]=[{'all':!![]}];}_0x44c73f=_[_0xa766('0x40')]({},_0x44c73f,_0x4cf5b2[_0xa766('0x41')]);return db[_0xa766('0x2d')]['find'](_0x44c73f)[_0xa766('0x26')](handleEntityNotFound(_0x349f37,null))['then'](respondWithResult(_0x349f37,null))[_0xa766('0x47')](handleError(_0x349f37,null));};exports[_0xa766('0x4a')]=function(_0x306271,_0x4cf713){return db[_0xa766('0x2d')]['create'](_0x306271[_0xa766('0x4b')],{})[_0xa766('0x26')](respondWithResult(_0x4cf713,0xc9))['catch'](handleError(_0x4cf713,null));};exports[_0xa766('0x4c')]=function(_0x3f1789,_0x28c2fb){if(_0x3f1789['body']['id']){delete _0x3f1789[_0xa766('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xa766('0x4d')]({'where':{'id':_0x3f1789[_0xa766('0x49')]['id']}})[_0xa766('0x26')](handleEntityNotFound(_0x28c2fb,null))[_0xa766('0x26')](saveUpdates(_0x3f1789[_0xa766('0x4b')],null))['then'](respondWithResult(_0x28c2fb,null))[_0xa766('0x47')](handleError(_0x28c2fb,null));};exports[_0xa766('0x4e')]=function(_0xa55311,_0xf3c23){return db[_0xa766('0x2d')]['find']({'where':{'id':_0xa55311[_0xa766('0x49')]['id']}})['then'](handleEntityNotFound(_0xf3c23,null))[_0xa766('0x26')](removeEntity(_0xf3c23,null))[_0xa766('0x47')](handleError(_0xf3c23,null));};exports[_0xa766('0x4f')]=function(_0x42995b,_0x4c2cd5,_0x3cfb54){var _0x5151df={};var _0x2f740d={};var _0x144a9f;var _0x828c64;return db[_0xa766('0x2d')][_0xa766('0x50')]({'where':{'id':_0x42995b[_0xa766('0x49')]['id']}})[_0xa766('0x26')](handleEntityNotFound(_0x4c2cd5,null))[_0xa766('0x26')](function(_0x223e05){if(_0x223e05){_0x144a9f=_0x223e05;_0x2f740d['model']=_[_0xa766('0x32')](db[_0xa766('0x51')][_0xa766('0x2e')]);_0x2f740d['query']=_[_0xa766('0x32')](_0x42995b[_0xa766('0x33')]);_0x2f740d[_0xa766('0x34')]=_[_0xa766('0x35')](_0x2f740d[_0xa766('0x31')],_0x2f740d[_0xa766('0x33')]);_0x5151df[_0xa766('0x36')]=_[_0xa766('0x35')](_0x2f740d[_0xa766('0x31')],qs[_0xa766('0x37')](_0x42995b['query'][_0xa766('0x37')]));_0x5151df[_0xa766('0x36')]=_0x5151df[_0xa766('0x36')][_0xa766('0x38')]?_0x5151df[_0xa766('0x36')]:_0x2f740d[_0xa766('0x31')];_0x5151df[_0xa766('0x3a')]=qs[_0xa766('0x3b')](_0x42995b['query']['sort']);_0x5151df[_0xa766('0x42')]=qs[_0xa766('0x34')](_[_0xa766('0x3c')](_0x42995b[_0xa766('0x33')],_0x2f740d[_0xa766('0x34')]));if(_0x42995b[_0xa766('0x33')][_0xa766('0x3d')]){_0x5151df[_0xa766('0x42')]=_[_0xa766('0x40')](_0x5151df[_0xa766('0x42')],{'$or':_[_0xa766('0x2c')](_0x5151df['attributes'],function(_0x457bda){var _0x43d202={};_0x43d202[_0x457bda]={'$like':'%'+_0x42995b[_0xa766('0x33')][_0xa766('0x3d')]+'%'};return _0x43d202;})});}_0x5151df=_[_0xa766('0x40')]({},_0x5151df,_0x42995b[_0xa766('0x41')]);return _0x144a9f[_0xa766('0x4f')](_0x5151df);}})[_0xa766('0x26')](function(_0x415895){if(_0x415895){_0x828c64=_0x415895[_0xa766('0x38')];if(!_0x42995b['query'][_0xa766('0x52')](_0xa766('0x39'))){_0x5151df[_0xa766('0x1e')]=qs[_0xa766('0x1e')](_0x42995b[_0xa766('0x33')][_0xa766('0x1e')]);_0x5151df[_0xa766('0x20')]=qs[_0xa766('0x20')](_0x42995b[_0xa766('0x33')][_0xa766('0x20')]);}return _0x144a9f[_0xa766('0x4f')](_0x5151df);}})[_0xa766('0x26')](function(_0x519daf){if(_0x519daf){return _0x519daf?{'count':_0x828c64,'rows':_0x519daf}:null;}})[_0xa766('0x26')](respondWithResult(_0x4c2cd5,null))['catch'](handleError(_0x4c2cd5,null));};exports['getSubjects']=function(_0x5535f6,_0x13d088,_0x2d9691){var _0x524a24={};var _0x276217={};var _0x129a2f;var _0x57f6f3;return db[_0xa766('0x2d')]['findOne']({'where':{'id':_0x5535f6[_0xa766('0x49')]['id']}})[_0xa766('0x26')](handleEntityNotFound(_0x13d088,null))['then'](function(_0xbb91e9){if(_0xbb91e9){_0x129a2f=_0xbb91e9;_0x276217['model']=_[_0xa766('0x32')](db[_0xa766('0x51')][_0xa766('0x2e')]);_0x276217[_0xa766('0x33')]=_[_0xa766('0x32')](_0x5535f6['query']);_0x276217['filters']=_['intersection'](_0x276217[_0xa766('0x31')],_0x276217[_0xa766('0x33')]);_0x524a24[_0xa766('0x36')]=_[_0xa766('0x35')](_0x276217[_0xa766('0x31')],qs[_0xa766('0x37')](_0x5535f6[_0xa766('0x33')]['fields']));_0x524a24[_0xa766('0x36')]=_0x524a24[_0xa766('0x36')][_0xa766('0x38')]?_0x524a24[_0xa766('0x36')]:_0x276217[_0xa766('0x31')];_0x524a24[_0xa766('0x3a')]=qs[_0xa766('0x3b')](_0x5535f6[_0xa766('0x33')][_0xa766('0x3b')]);_0x524a24[_0xa766('0x42')]=qs[_0xa766('0x34')](_['pick'](_0x5535f6[_0xa766('0x33')],_0x276217[_0xa766('0x34')]));if(_0x5535f6['query']['filter']){_0x524a24[_0xa766('0x42')]=_[_0xa766('0x40')](_0x524a24[_0xa766('0x42')],{'$or':_[_0xa766('0x2c')](_0x524a24[_0xa766('0x36')],function(_0x43179e){var _0x25321f={};_0x25321f[_0x43179e]={'$like':'%'+_0x5535f6[_0xa766('0x33')][_0xa766('0x3d')]+'%'};return _0x25321f;})});}_0x524a24=_[_0xa766('0x40')]({},_0x524a24,_0x5535f6[_0xa766('0x41')]);return _0x129a2f[_0xa766('0x53')](_0x524a24);}})[_0xa766('0x26')](function(_0x344416){if(_0x344416){_0x57f6f3=_0x344416[_0xa766('0x38')];if(!_0x5535f6[_0xa766('0x33')]['hasOwnProperty'](_0xa766('0x39'))){_0x524a24[_0xa766('0x1e')]=qs[_0xa766('0x1e')](_0x5535f6[_0xa766('0x33')]['limit']);_0x524a24['offset']=qs[_0xa766('0x20')](_0x5535f6['query'][_0xa766('0x20')]);}return _0x129a2f[_0xa766('0x53')](_0x524a24);}})[_0xa766('0x26')](function(_0x28bf84){if(_0x28bf84){return _0x28bf84?{'count':_0x57f6f3,'rows':_0x28bf84}:null;}})[_0xa766('0x26')](respondWithResult(_0x13d088,null))[_0xa766('0x47')](handleError(_0x13d088,null));};exports[_0xa766('0x54')]=function(_0x45bd14,_0x460a17,_0x125918){var _0x45f9bf={};var _0x17b8cc={};var _0x31facd;var _0x42b237;return db[_0xa766('0x2d')][_0xa766('0x50')]({'where':{'id':_0x45bd14[_0xa766('0x49')]['id']}})['then'](handleEntityNotFound(_0x460a17,null))[_0xa766('0x26')](function(_0xd54e24){if(_0xd54e24){_0x31facd=_0xd54e24;_0x17b8cc['model']=_[_0xa766('0x32')](db[_0xa766('0x51')][_0xa766('0x2e')]);_0x17b8cc[_0xa766('0x33')]=_[_0xa766('0x32')](_0x45bd14[_0xa766('0x33')]);_0x17b8cc[_0xa766('0x34')]=_['intersection'](_0x17b8cc[_0xa766('0x31')],_0x17b8cc[_0xa766('0x33')]);_0x45f9bf['attributes']=_['intersection'](_0x17b8cc[_0xa766('0x31')],qs[_0xa766('0x37')](_0x45bd14[_0xa766('0x33')]['fields']));_0x45f9bf['attributes']=_0x45f9bf[_0xa766('0x36')][_0xa766('0x38')]?_0x45f9bf[_0xa766('0x36')]:_0x17b8cc['model'];_0x45f9bf[_0xa766('0x3a')]=qs[_0xa766('0x3b')](_0x45bd14[_0xa766('0x33')][_0xa766('0x3b')]);_0x45f9bf['where']=qs['filters'](_[_0xa766('0x3c')](_0x45bd14[_0xa766('0x33')],_0x17b8cc[_0xa766('0x34')]));if(_0x45bd14[_0xa766('0x33')]['filter']){_0x45f9bf[_0xa766('0x42')]=_[_0xa766('0x40')](_0x45f9bf[_0xa766('0x42')],{'$or':_[_0xa766('0x2c')](_0x45f9bf['attributes'],function(_0x4b1694){var _0x44cdee={};_0x44cdee[_0x4b1694]={'$like':'%'+_0x45bd14[_0xa766('0x33')][_0xa766('0x3d')]+'%'};return _0x44cdee;})});}_0x45f9bf=_[_0xa766('0x40')]({},_0x45f9bf,_0x45bd14[_0xa766('0x41')]);return _0x31facd[_0xa766('0x54')](_0x45f9bf);}})[_0xa766('0x26')](function(_0x2f849e){if(_0x2f849e){_0x42b237=_0x2f849e[_0xa766('0x38')];if(!_0x45bd14['query'][_0xa766('0x52')](_0xa766('0x39'))){_0x45f9bf[_0xa766('0x1e')]=qs[_0xa766('0x1e')](_0x45bd14[_0xa766('0x33')][_0xa766('0x1e')]);_0x45f9bf[_0xa766('0x20')]=qs[_0xa766('0x20')](_0x45bd14[_0xa766('0x33')][_0xa766('0x20')]);}return _0x31facd[_0xa766('0x54')](_0x45f9bf);}})[_0xa766('0x26')](function(_0x211861){if(_0x211861){return _0x211861?{'count':_0x42b237,'rows':_0x211861}:null;}})['then'](respondWithResult(_0x460a17,null))[_0xa766('0x47')](handleError(_0x460a17,null));};exports['getTags']=function(_0x74acf7,_0x38b046,_0x4b85b6){var _0x49cf92={};var _0x1ba1f0={};var _0x18482c;var _0x3354f1;return db[_0xa766('0x2d')][_0xa766('0x50')]({'where':{'id':_0x74acf7['params']['id']}})[_0xa766('0x26')](handleEntityNotFound(_0x38b046,null))[_0xa766('0x26')](function(_0x35c720){if(_0x35c720){_0x18482c=_0x35c720;_0x1ba1f0[_0xa766('0x31')]=_[_0xa766('0x32')](db[_0xa766('0x55')][_0xa766('0x2e')]);_0x1ba1f0['query']=_[_0xa766('0x32')](_0x74acf7[_0xa766('0x33')]);_0x1ba1f0['filters']=_[_0xa766('0x35')](_0x1ba1f0[_0xa766('0x31')],_0x1ba1f0[_0xa766('0x33')]);_0x49cf92['attributes']=_[_0xa766('0x35')](_0x1ba1f0[_0xa766('0x31')],qs[_0xa766('0x37')](_0x74acf7[_0xa766('0x33')][_0xa766('0x37')]));_0x49cf92[_0xa766('0x36')]=_0x49cf92['attributes']['length']?_0x49cf92[_0xa766('0x36')]:_0x1ba1f0['model'];_0x49cf92[_0xa766('0x3a')]=qs[_0xa766('0x3b')](_0x74acf7[_0xa766('0x33')]['sort']);_0x49cf92[_0xa766('0x42')]=qs[_0xa766('0x34')](_[_0xa766('0x3c')](_0x74acf7[_0xa766('0x33')],_0x1ba1f0[_0xa766('0x34')]));if(_0x74acf7[_0xa766('0x33')][_0xa766('0x3d')]){_0x49cf92[_0xa766('0x42')]=_['merge'](_0x49cf92[_0xa766('0x42')],{'$or':_[_0xa766('0x2c')](_0x49cf92[_0xa766('0x36')],function(_0x36ad74){var _0x50a860={};_0x50a860[_0x36ad74]={'$like':'%'+_0x74acf7['query'][_0xa766('0x3d')]+'%'};return _0x50a860;})});}_0x49cf92=_[_0xa766('0x40')]({},_0x49cf92,_0x74acf7[_0xa766('0x41')]);return _0x18482c[_0xa766('0x56')](_0x49cf92);}})['then'](function(_0x49ba2a){if(_0x49ba2a){_0x3354f1=_0x49ba2a[_0xa766('0x38')];if(!_0x74acf7[_0xa766('0x33')][_0xa766('0x52')](_0xa766('0x39'))){_0x49cf92['limit']=qs[_0xa766('0x1e')](_0x74acf7[_0xa766('0x33')][_0xa766('0x1e')]);_0x49cf92[_0xa766('0x20')]=qs[_0xa766('0x20')](_0x74acf7[_0xa766('0x33')]['offset']);}return _0x18482c[_0xa766('0x56')](_0x49cf92);}})[_0xa766('0x26')](function(_0x4c80e2){if(_0x4c80e2){return _0x4c80e2?{'count':_0x3354f1,'rows':_0x4c80e2}:null;}})['then'](respondWithResult(_0x38b046,null))['catch'](handleError(_0x38b046,null));};exports[_0xa766('0x57')]=function(_0x3542f4,_0x11a76e,_0x24b6bc){if(_0x3542f4[_0xa766('0x4b')]['id']){delete _0x3542f4[_0xa766('0x4b')]['id'];}return db[_0xa766('0x2d')][_0xa766('0x50')]({'where':{'id':_0x3542f4[_0xa766('0x49')]['id']}})['then'](handleEntityNotFound(_0x11a76e,null))[_0xa766('0x26')](function(_0x4548dc){if(_0x4548dc){return _0x4548dc[_0xa766('0x57')](_0x3542f4[_0xa766('0x4b')][_0xa766('0x58')]||[]);}return null;})[_0xa766('0x26')](respondWithResult(_0x11a76e,null))[_0xa766('0x47')](handleError(_0x11a76e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b53153d..588c316 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 _0xccb1=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xccb1,0xff));var _0x1ccb=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xccb1[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x1ccb('0x0'));var util=require('util');var logger=require(_0x1ccb('0x1'))(_0x1ccb('0x2'));var moment=require(_0x1ccb('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ccb('0x4'));var fs=require('fs');var path=require(_0x1ccb('0x5'));var rimraf=require(_0x1ccb('0x6'));var config=require(_0x1ccb('0x7'));var attributes=require(_0x1ccb('0x8'));module[_0x1ccb('0x9')]=function(_0x2017dc,_0x31f00e){return _0x2017dc[_0x1ccb('0xa')](_0x1ccb('0xb'),attributes,{'tableName':_0x1ccb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x097c=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0x097c,0x104));var _0xc097=function(_0x1bd9dc,_0x33425a){_0x1bd9dc=_0x1bd9dc-0x0;var _0x42be88=_0x097c[_0x1bd9dc];return _0x42be88;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require('../../config/logger')(_0xc097('0x2'));var moment=require(_0xc097('0x3'));var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc097('0x6'));var config=require(_0xc097('0x7'));var attributes=require(_0xc097('0x8'));module[_0xc097('0x9')]=function(_0x51baf9,_0x3f45b2){return _0x51baf9[_0xc097('0xa')](_0xc097('0xb'),attributes,{'tableName':_0xc097('0xc'),'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 c7e2eca..264a7bb 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 _0x3713=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x36975e,_0x103ce0){var _0x51ded9=function(_0x5e81c5){while(--_0x5e81c5){_0x36975e['push'](_0x36975e['shift']());}};_0x51ded9(++_0x103ce0);}(_0x3713,0x132));var _0x3371=function(_0x1690f2,_0x1497a2){_0x1690f2=_0x1690f2-0x0;var _0x1f806b=_0x3713[_0x1690f2];return _0x1f806b;};'use strict';var _=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var moment=require(_0x3371('0x2'));var BPromise=require(_0x3371('0x3'));var rs=require(_0x3371('0x4'));var fs=require('fs');var Redis=require(_0x3371('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3371('0x6'));var logger=require(_0x3371('0x7'))(_0x3371('0x8'));var config=require(_0x3371('0x9'));var jayson=require(_0x3371('0xa'));var client=jayson[_0x3371('0xb')][_0x3371('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15d166,_0x4c9d9b,_0x192ed4){return new BPromise(function(_0x422787,_0x1c361b){return client[_0x3371('0xd')](_0x15d166,_0x192ed4)[_0x3371('0xe')](function(_0x12fabb){logger[_0x3371('0xf')](_0x3371('0x10'),_0x4c9d9b,_0x3371('0x11'));logger[_0x3371('0x12')](_0x3371('0x13'),_0x4c9d9b,_0x3371('0x11'),JSON[_0x3371('0x14')](_0x12fabb));if(_0x12fabb[_0x3371('0x15')]){if(_0x12fabb[_0x3371('0x15')]['code']===0x1f4){logger[_0x3371('0x15')](_0x3371('0x10'),_0x4c9d9b,_0x12fabb[_0x3371('0x15')][_0x3371('0x16')]);return _0x1c361b(_0x12fabb[_0x3371('0x15')][_0x3371('0x16')]);}logger[_0x3371('0x15')](_0x3371('0x10'),_0x4c9d9b,_0x12fabb['error']['message']);return _0x422787(_0x12fabb['error'][_0x3371('0x16')]);}else{logger[_0x3371('0xf')](_0x3371('0x10'),_0x4c9d9b,_0x3371('0x11'));_0x422787(_0x12fabb[_0x3371('0x17')][_0x3371('0x16')]);}})[_0x3371('0x18')](function(_0x55ecb1){logger[_0x3371('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c9d9b,_0x55ecb1);_0x1c361b(_0x55ecb1);});});} \ No newline at end of file +var _0x004c=['info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1b44b9,_0x2191fd){var _0x55b73c=function(_0x508d5b){while(--_0x508d5b){_0x1b44b9['push'](_0x1b44b9['shift']());}};_0x55b73c(++_0x2191fd);}(_0x004c,0x1bb));var _0xc004=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x004c[_0x725b8e];return _0x43ac45;};'use strict';var _=require('lodash');var util=require(_0xc004('0x0'));var moment=require('moment');var BPromise=require(_0xc004('0x1'));var rs=require(_0xc004('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc004('0x3'))['db'];var utils=require(_0xc004('0x4'));var logger=require('../../config/logger')(_0xc004('0x5'));var config=require(_0xc004('0x6'));var jayson=require(_0xc004('0x7'));var client=jayson[_0xc004('0x8')][_0xc004('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2edf4a,_0x578c13,_0x46f8f5){return new BPromise(function(_0x2234a8,_0x1d2831){return client['request'](_0x2edf4a,_0x46f8f5)[_0xc004('0xa')](function(_0xcca61f){logger['info'](_0xc004('0xb'),_0x578c13,_0xc004('0xc'));logger[_0xc004('0xd')](_0xc004('0xe'),_0x578c13,_0xc004('0xc'),JSON[_0xc004('0xf')](_0xcca61f));if(_0xcca61f['error']){if(_0xcca61f[_0xc004('0x10')][_0xc004('0x11')]===0x1f4){logger[_0xc004('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x578c13,_0xcca61f[_0xc004('0x10')][_0xc004('0x12')]);return _0x1d2831(_0xcca61f[_0xc004('0x10')][_0xc004('0x12')]);}logger[_0xc004('0x10')](_0xc004('0xb'),_0x578c13,_0xcca61f[_0xc004('0x10')][_0xc004('0x12')]);return _0x2234a8(_0xcca61f[_0xc004('0x10')]['message']);}else{logger[_0xc004('0x13')](_0xc004('0xb'),_0x578c13,'request\x20sent');_0x2234a8(_0xcca61f[_0xc004('0x14')][_0xc004('0x12')]);}})[_0xc004('0x15')](function(_0xde2857){logger[_0xc004('0x10')](_0xc004('0xb'),_0x578c13,_0xde2857);_0x1d2831(_0xde2857);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4c23f24..144e1d2 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 _0xd263=['./intFreshdeskField.controller','index','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x1cbf43,_0x2b4977){var _0xda3dcb=function(_0xef0e43){while(--_0xef0e43){_0x1cbf43['push'](_0x1cbf43['shift']());}};_0xda3dcb(++_0x2b4977);}(_0xd263,0x1ba));var _0x3d26=function(_0x2168e5,_0x23e4d8){_0x2168e5=_0x2168e5-0x0;var _0x3f040a=_0xd263[_0x2168e5];return _0x3f040a;};'use strict';var multer=require(_0x3d26('0x0'));var util=require(_0x3d26('0x1'));var path=require(_0x3d26('0x2'));var timeout=require(_0x3d26('0x3'));var express=require(_0x3d26('0x4'));var router=express[_0x3d26('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3d26('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3d26('0x7'));var controller=require(_0x3d26('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d26('0x9')]);router[_0x3d26('0xa')](_0x3d26('0xb'),auth[_0x3d26('0xc')](),controller[_0x3d26('0xd')]);router['post']('/',auth[_0x3d26('0xc')](),controller['create']);router[_0x3d26('0xe')](_0x3d26('0xb'),auth[_0x3d26('0xc')](),controller[_0x3d26('0xf')]);router['delete'](_0x3d26('0xb'),auth[_0x3d26('0xc')](),controller[_0x3d26('0x10')]);module[_0x3d26('0x11')]=router; \ No newline at end of file +var _0x1b5d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x4cd3e3,_0x10f7fc){var _0x4c4f1d=function(_0x27a98b){while(--_0x27a98b){_0x4cd3e3['push'](_0x4cd3e3['shift']());}};_0x4c4f1d(++_0x10f7fc);}(_0x1b5d,0xd2));var _0xd1b5=function(_0x307c85,_0x2d6aee){_0x307c85=_0x307c85-0x0;var _0x2d1933=_0x1b5d[_0x307c85];return _0x2d1933;};'use strict';var multer=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var path=require(_0xd1b5('0x2'));var timeout=require(_0xd1b5('0x3'));var express=require(_0xd1b5('0x4'));var router=express[_0xd1b5('0x5')]();var fs_extra=require(_0xd1b5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd1b5('0x7'));var config=require(_0xd1b5('0x8'));var controller=require(_0xd1b5('0x9'));router[_0xd1b5('0xa')]('/',auth[_0xd1b5('0xb')](),controller[_0xd1b5('0xc')]);router['get'](_0xd1b5('0xd'),auth[_0xd1b5('0xb')](),controller[_0xd1b5('0xe')]);router[_0xd1b5('0xf')]('/',auth[_0xd1b5('0xb')](),controller['create']);router[_0xd1b5('0x10')]('/:id',auth[_0xd1b5('0xb')](),controller[_0xd1b5('0x11')]);router['delete'](_0xd1b5('0xd'),auth[_0xd1b5('0xb')](),controller['destroy']);module[_0xd1b5('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 e6dbe26..3b50059 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 _0x0e21=['BOOLEAN','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x4c7ee1,_0xdd33ba){var _0x3576fb=function(_0xc96c4b){while(--_0xc96c4b){_0x4c7ee1['push'](_0x4c7ee1['shift']());}};_0x3576fb(++_0xdd33ba);}(_0x0e21,0x99));var _0x10e2=function(_0x3739b1,_0x4bc226){_0x3739b1=_0x3739b1-0x0;var _0x114bf2=_0x0e21[_0x3739b1];return _0x114bf2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x10e2('0x0'),_0x10e2('0x1'),_0x10e2('0x2'),_0x10e2('0x3'),_0x10e2('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x10e2('0x5')]},'keyType':{'type':Sequelize[_0x10e2('0x6')](_0x10e2('0x0'),_0x10e2('0x1'),_0x10e2('0x2'))},'keyContent':{'type':Sequelize[_0x10e2('0x5')]},'idField':{'type':Sequelize[_0x10e2('0x5')]},'nameField':{'type':Sequelize[_0x10e2('0x5')]},'customField':{'type':Sequelize[_0x10e2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x10e2('0x5')]}}; \ No newline at end of file +var _0x5a87=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x1f0731,_0x312963){var _0x137e06=function(_0x294772){while(--_0x294772){_0x1f0731['push'](_0x1f0731['shift']());}};_0x137e06(++_0x312963);}(_0x5a87,0x17a));var _0x75a8=function(_0x43cf8f,_0x1c436c){_0x43cf8f=_0x43cf8f-0x0;var _0x928a69=_0x5a87[_0x43cf8f];return _0x928a69;};'use strict';var Sequelize=require(_0x75a8('0x0'));module[_0x75a8('0x1')]={'type':{'type':Sequelize[_0x75a8('0x2')](_0x75a8('0x3'),_0x75a8('0x4'),_0x75a8('0x5'),_0x75a8('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x75a8('0x2')]('string',_0x75a8('0x4'),_0x75a8('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x75a8('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x75a8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x75a8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6f8c510..e674cf4 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 _0xd52d=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshdeskField','findAll','rows','catch','params','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','index','map','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','order','sort'];(function(_0x43e7b,_0x46f5fa){var _0x46106f=function(_0x34b3f1){while(--_0x34b3f1){_0x43e7b['push'](_0x43e7b['shift']());}};_0x46106f(++_0x46f5fa);}(_0xd52d,0x1c7));var _0xdd52=function(_0x5ccc8a,_0x335651){_0x5ccc8a=_0x5ccc8a-0x0;var _0x5d6dac=_0xd52d[_0x5ccc8a];return _0x5d6dac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x592f15,_0x1156cc){return function(_0x353fde){if(!_0x353fde){_0x592f15[_0xdd52('0x26')](0x194);}return _0x353fde;};}function handleError(_0x2f2dfa,_0x4ee66d){_0x4ee66d=_0x4ee66d||0x1f4;return function(_0x41c7e5){logger[_0xdd52('0x27')](_0x41c7e5[_0xdd52('0x28')]);if(_0x41c7e5['name']){delete _0x41c7e5['name'];}_0x2f2dfa[_0xdd52('0x1a')](_0x4ee66d)['send'](_0x41c7e5);};}exports[_0xdd52('0x29')]=function(_0x3f96bd,_0xeb81a0){var _0x539418={},_0x499e14={},_0x2a0a2d={'count':0x0,'rows':[]};var _0x3a0e0d=_[_0xdd52('0x2a')](db['FreshdeskField']['rawAttributes'],function(_0x9b6070){return{'name':_0x9b6070['fieldName'],'type':_0x9b6070[_0xdd52('0x2b')][_0xdd52('0x2c')]};});_0x499e14[_0xdd52('0x2d')]=_[_0xdd52('0x2a')](_0x3a0e0d,_0xdd52('0x2e'));_0x499e14[_0xdd52('0x2f')]=_[_0xdd52('0x30')](_0x3f96bd[_0xdd52('0x2f')]);_0x499e14[_0xdd52('0x31')]=_[_0xdd52('0x32')](_0x499e14[_0xdd52('0x2d')],_0x499e14[_0xdd52('0x2f')]);_0x539418[_0xdd52('0x33')]=_[_0xdd52('0x32')](_0x499e14[_0xdd52('0x2d')],qs[_0xdd52('0x34')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x34')]));_0x539418[_0xdd52('0x33')]=_0x539418[_0xdd52('0x33')][_0xdd52('0x35')]?_0x539418['attributes']:_0x499e14[_0xdd52('0x2d')];if(!_0x3f96bd[_0xdd52('0x2f')]['hasOwnProperty']('nolimit')){_0x539418['limit']=qs[_0xdd52('0x1e')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x1e')]);_0x539418[_0xdd52('0x1d')]=qs[_0xdd52('0x1d')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x1d')]);}_0x539418[_0xdd52('0x36')]=qs[_0xdd52('0x37')](_0x3f96bd[_0xdd52('0x2f')]['sort']);_0x539418[_0xdd52('0x38')]=qs[_0xdd52('0x31')](_[_0xdd52('0x39')](_0x3f96bd[_0xdd52('0x2f')],_0x499e14[_0xdd52('0x31')]),_0x3a0e0d);if(_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3a')]){_0x539418[_0xdd52('0x38')]=_[_0xdd52('0x3b')](_0x539418[_0xdd52('0x38')],{'$or':_[_0xdd52('0x2a')](_0x3a0e0d,function(_0x16deae){if(_0x16deae[_0xdd52('0x2b')]!==_0xdd52('0x3c')){var _0x2e1c23={};_0x2e1c23[_0x16deae[_0xdd52('0x2e')]]={'$like':'%'+_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3a')]+'%'};return _0x2e1c23;}})});}_0x539418=_[_0xdd52('0x3b')]({},_0x539418,_0x3f96bd[_0xdd52('0x3d')]);var _0x2112cb={'where':_0x539418['where']};return db['FreshdeskField'][_0xdd52('0x1f')](_0x2112cb)[_0xdd52('0x24')](function(_0x1462b0){_0x2a0a2d[_0xdd52('0x1f')]=_0x1462b0;if(_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3e')]){_0x539418[_0xdd52('0x3f')]=[{'all':!![]}];}return db[_0xdd52('0x40')][_0xdd52('0x41')](_0x539418);})[_0xdd52('0x24')](function(_0x4efd40){_0x2a0a2d[_0xdd52('0x42')]=_0x4efd40;return _0x2a0a2d;})[_0xdd52('0x24')](respondWithFilteredResult(_0xeb81a0,_0x539418))[_0xdd52('0x43')](handleError(_0xeb81a0,null));};exports['show']=function(_0x220587,_0x1857d1){var _0x1949d6={'raw':!![],'where':{'id':_0x220587[_0xdd52('0x44')]['id']}},_0x2968b5={};_0x2968b5[_0xdd52('0x2d')]=_['keys'](db[_0xdd52('0x40')][_0xdd52('0x45')]);_0x2968b5[_0xdd52('0x2f')]=_['keys'](_0x220587[_0xdd52('0x2f')]);_0x2968b5[_0xdd52('0x31')]=_['intersection'](_0x2968b5[_0xdd52('0x2d')],_0x2968b5['query']);_0x1949d6[_0xdd52('0x33')]=_['intersection'](_0x2968b5['model'],qs['fields'](_0x220587[_0xdd52('0x2f')][_0xdd52('0x34')]));_0x1949d6[_0xdd52('0x33')]=_0x1949d6[_0xdd52('0x33')][_0xdd52('0x35')]?_0x1949d6[_0xdd52('0x33')]:_0x2968b5['model'];if(_0x220587[_0xdd52('0x2f')][_0xdd52('0x3e')]){_0x1949d6[_0xdd52('0x3f')]=[{'all':!![]}];}_0x1949d6=_['merge']({},_0x1949d6,_0x220587[_0xdd52('0x3d')]);return db[_0xdd52('0x40')][_0xdd52('0x46')](_0x1949d6)[_0xdd52('0x24')](handleEntityNotFound(_0x1857d1,null))['then'](respondWithResult(_0x1857d1,null))[_0xdd52('0x43')](handleError(_0x1857d1,null));};exports[_0xdd52('0x47')]=function(_0x579377,_0x299def){return db[_0xdd52('0x40')][_0xdd52('0x47')](_0x579377['body'],{})['then'](respondWithResult(_0x299def,0xc9))[_0xdd52('0x43')](handleError(_0x299def,null));};exports[_0xdd52('0x23')]=function(_0x1017d6,_0x5adb59){if(_0x1017d6[_0xdd52('0x48')]['id']){delete _0x1017d6['body']['id'];}return db[_0xdd52('0x40')][_0xdd52('0x46')]({'where':{'id':_0x1017d6[_0xdd52('0x44')]['id']}})['then'](handleEntityNotFound(_0x5adb59,null))['then'](saveUpdates(_0x1017d6[_0xdd52('0x48')],null))['then'](respondWithResult(_0x5adb59,null))[_0xdd52('0x43')](handleError(_0x5adb59,null));};exports[_0xdd52('0x25')]=function(_0x1ff2c3,_0x45e052){return db[_0xdd52('0x40')][_0xdd52('0x46')]({'where':{'id':_0x1ff2c3['params']['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x45e052,null))[_0xdd52('0x24')](removeEntity(_0x45e052,null))[_0xdd52('0x43')](handleError(_0x45e052,null));}; \ No newline at end of file +var _0x2bc6=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','rawAttributes','fields','find','create','body','eml-format','rimraf','zip-dir','mustache','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3e2ca4,_0x4b8ec1){var _0x1659c0=function(_0x2a0a2f){while(--_0x2a0a2f){_0x3e2ca4['push'](_0x3e2ca4['shift']());}};_0x1659c0(++_0x4b8ec1);}(_0x2bc6,0x163));var _0x62bc=function(_0x13daeb,_0x1858f6){_0x13daeb=_0x13daeb-0x0;var _0x2922e6=_0x2bc6[_0x13daeb];return _0x2922e6;};'use strict';var emlformat=require(_0x62bc('0x0'));var rimraf=require(_0x62bc('0x1'));var zipdir=require(_0x62bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62bc('0x3'));var util=require('util');var path=require(_0x62bc('0x4'));var sox=require(_0x62bc('0x5'));var csv=require('to-csv');var ejs=require(_0x62bc('0x6'));var fs=require('fs');var fs_extra=require(_0x62bc('0x7'));var _=require(_0x62bc('0x8'));var squel=require(_0x62bc('0x9'));var crypto=require(_0x62bc('0xa'));var jsforce=require(_0x62bc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x62bc('0xc'));var querystring=require(_0x62bc('0xd'));var Papa=require(_0x62bc('0xe'));var Redis=require(_0x62bc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x62bc('0x10'));var as=require(_0x62bc('0x11'));var hardwareService=require(_0x62bc('0x12'));var logger=require('../../config/logger')(_0x62bc('0x13'));var utils=require(_0x62bc('0x14'));var config=require(_0x62bc('0x15'));var licenseUtil=require(_0x62bc('0x16'));var db=require(_0x62bc('0x17'))['db'];function respondWithStatusCode(_0x2a9309,_0x414a08){_0x414a08=_0x414a08||0xcc;return function(_0x4f92f7){if(_0x4f92f7){return _0x2a9309[_0x62bc('0x18')](_0x414a08);}return _0x2a9309[_0x62bc('0x19')](_0x414a08)['end']();};}function respondWithResult(_0x314358,_0x10230f){_0x10230f=_0x10230f||0xc8;return function(_0xc14ac9){if(_0xc14ac9){return _0x314358['status'](_0x10230f)[_0x62bc('0x1a')](_0xc14ac9);}};}function respondWithFilteredResult(_0x94b649,_0x56eade){return function(_0x515c80){if(_0x515c80){var _0x39c5e0=typeof _0x56eade[_0x62bc('0x1b')]==='undefined'&&typeof _0x56eade[_0x62bc('0x1c')]===_0x62bc('0x1d');var _0xc1211c=_0x515c80[_0x62bc('0x1e')];var _0xc95407=_0x39c5e0?0x0:_0x56eade[_0x62bc('0x1b')];var _0x1d3d8f=_0x39c5e0?_0x515c80[_0x62bc('0x1e')]:_0x56eade[_0x62bc('0x1b')]+_0x56eade['limit'];var _0x5dd6f0;if(_0x1d3d8f>=_0xc1211c){_0x1d3d8f=_0xc1211c;_0x5dd6f0=0xc8;}else{_0x5dd6f0=0xce;}_0x94b649[_0x62bc('0x19')](_0x5dd6f0);return _0x94b649[_0x62bc('0x1f')](_0x62bc('0x20'),_0xc95407+'-'+_0x1d3d8f+'/'+_0xc1211c)['json'](_0x515c80);}return null;};}function patchUpdates(_0x380621){return function(_0x495f99){try{jsonpatch[_0x62bc('0x21')](_0x495f99,_0x380621,!![]);}catch(_0x37ab87){return BPromise[_0x62bc('0x22')](_0x37ab87);}return _0x495f99['save']();};}function saveUpdates(_0x3b8644,_0x28757d){return function(_0xae87bf){if(_0xae87bf){return _0xae87bf[_0x62bc('0x23')](_0x3b8644)[_0x62bc('0x24')](function(_0x3b2eb0){return _0x3b2eb0;});}return null;};}function removeEntity(_0x5b2e16,_0x70e428){return function(_0xb0d0fb){if(_0xb0d0fb){return _0xb0d0fb[_0x62bc('0x25')]()[_0x62bc('0x24')](function(){_0x5b2e16[_0x62bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ca86,_0xcd4b0){return function(_0x58e76a){if(!_0x58e76a){_0x52ca86[_0x62bc('0x18')](0x194);}return _0x58e76a;};}function handleError(_0x36af97,_0x1e046d){_0x1e046d=_0x1e046d||0x1f4;return function(_0x4a72d6){logger[_0x62bc('0x26')](_0x4a72d6[_0x62bc('0x27')]);if(_0x4a72d6[_0x62bc('0x28')]){delete _0x4a72d6['name'];}_0x36af97['status'](_0x1e046d)[_0x62bc('0x29')](_0x4a72d6);};}exports[_0x62bc('0x2a')]=function(_0x23817c,_0x4df640){var _0x4313ba={},_0x1f2985={},_0x44600f={'count':0x0,'rows':[]};var _0x444267=_['map'](db[_0x62bc('0x2b')]['rawAttributes'],function(_0x26701b){return{'name':_0x26701b[_0x62bc('0x2c')],'type':_0x26701b[_0x62bc('0x2d')][_0x62bc('0x2e')]};});_0x1f2985[_0x62bc('0x2f')]=_[_0x62bc('0x30')](_0x444267,_0x62bc('0x28'));_0x1f2985[_0x62bc('0x31')]=_[_0x62bc('0x32')](_0x23817c[_0x62bc('0x31')]);_0x1f2985[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],_0x1f2985[_0x62bc('0x31')]);_0x4313ba[_0x62bc('0x35')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],qs['fields'](_0x23817c[_0x62bc('0x31')]['fields']));_0x4313ba['attributes']=_0x4313ba[_0x62bc('0x35')]['length']?_0x4313ba['attributes']:_0x1f2985['model'];if(!_0x23817c[_0x62bc('0x31')][_0x62bc('0x36')](_0x62bc('0x37'))){_0x4313ba['limit']=qs['limit'](_0x23817c['query'][_0x62bc('0x1c')]);_0x4313ba[_0x62bc('0x1b')]=qs['offset'](_0x23817c['query'][_0x62bc('0x1b')]);}_0x4313ba[_0x62bc('0x38')]=qs[_0x62bc('0x39')](_0x23817c['query'][_0x62bc('0x39')]);_0x4313ba[_0x62bc('0x3a')]=qs[_0x62bc('0x33')](_[_0x62bc('0x3b')](_0x23817c['query'],_0x1f2985[_0x62bc('0x33')]),_0x444267);if(_0x23817c[_0x62bc('0x31')]['filter']){_0x4313ba[_0x62bc('0x3a')]=_[_0x62bc('0x3c')](_0x4313ba[_0x62bc('0x3a')],{'$or':_[_0x62bc('0x30')](_0x444267,function(_0x599aed){if(_0x599aed[_0x62bc('0x2d')]!=='VIRTUAL'){var _0x38230a={};_0x38230a[_0x599aed[_0x62bc('0x28')]]={'$like':'%'+_0x23817c[_0x62bc('0x31')][_0x62bc('0x3d')]+'%'};return _0x38230a;}})});}_0x4313ba=_['merge']({},_0x4313ba,_0x23817c[_0x62bc('0x3e')]);var _0x5c806b={'where':_0x4313ba[_0x62bc('0x3a')]};return db[_0x62bc('0x2b')][_0x62bc('0x1e')](_0x5c806b)[_0x62bc('0x24')](function(_0x9011f2){_0x44600f[_0x62bc('0x1e')]=_0x9011f2;if(_0x23817c[_0x62bc('0x31')][_0x62bc('0x3f')]){_0x4313ba[_0x62bc('0x40')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x4313ba);})[_0x62bc('0x24')](function(_0x400779){_0x44600f['rows']=_0x400779;return _0x44600f;})[_0x62bc('0x24')](respondWithFilteredResult(_0x4df640,_0x4313ba))[_0x62bc('0x41')](handleError(_0x4df640,null));};exports[_0x62bc('0x42')]=function(_0xedc9f3,_0xbd8c7e){var _0x5f3752={'raw':!![],'where':{'id':_0xedc9f3[_0x62bc('0x43')]['id']}},_0x3bf043={};_0x3bf043['model']=_['keys'](db[_0x62bc('0x2b')][_0x62bc('0x44')]);_0x3bf043[_0x62bc('0x31')]=_['keys'](_0xedc9f3[_0x62bc('0x31')]);_0x3bf043[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x3bf043[_0x62bc('0x2f')],_0x3bf043[_0x62bc('0x31')]);_0x5f3752[_0x62bc('0x35')]=_['intersection'](_0x3bf043[_0x62bc('0x2f')],qs['fields'](_0xedc9f3[_0x62bc('0x31')][_0x62bc('0x45')]));_0x5f3752[_0x62bc('0x35')]=_0x5f3752['attributes']['length']?_0x5f3752['attributes']:_0x3bf043[_0x62bc('0x2f')];if(_0xedc9f3['query'][_0x62bc('0x3f')]){_0x5f3752[_0x62bc('0x40')]=[{'all':!![]}];}_0x5f3752=_['merge']({},_0x5f3752,_0xedc9f3['options']);return db['FreshdeskField'][_0x62bc('0x46')](_0x5f3752)[_0x62bc('0x24')](handleEntityNotFound(_0xbd8c7e,null))[_0x62bc('0x24')](respondWithResult(_0xbd8c7e,null))[_0x62bc('0x41')](handleError(_0xbd8c7e,null));};exports[_0x62bc('0x47')]=function(_0x49389f,_0x3834b2){return db[_0x62bc('0x2b')]['create'](_0x49389f[_0x62bc('0x48')],{})['then'](respondWithResult(_0x3834b2,0xc9))[_0x62bc('0x41')](handleError(_0x3834b2,null));};exports[_0x62bc('0x23')]=function(_0x17e0ec,_0xca6190){if(_0x17e0ec[_0x62bc('0x48')]['id']){delete _0x17e0ec[_0x62bc('0x48')]['id'];}return db[_0x62bc('0x2b')]['find']({'where':{'id':_0x17e0ec[_0x62bc('0x43')]['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0xca6190,null))['then'](saveUpdates(_0x17e0ec[_0x62bc('0x48')],null))['then'](respondWithResult(_0xca6190,null))[_0x62bc('0x41')](handleError(_0xca6190,null));};exports[_0x62bc('0x25')]=function(_0x4bec08,_0x6c2969){return db[_0x62bc('0x2b')][_0x62bc('0x46')]({'where':{'id':_0x4bec08['params']['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0x6c2969,null))[_0x62bc('0x24')](removeEntity(_0x6c2969,null))[_0x62bc('0x41')](handleError(_0x6c2969,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 04b40aa..932727e 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 _0x2e3d=['idField','FieldId','lodash','api','moment','bluebird','request-promise','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields'];(function(_0x2b11e0,_0x9e9ad0){var _0x1a2071=function(_0x4a8bdd){while(--_0x4a8bdd){_0x2b11e0['push'](_0x2b11e0['shift']());}};_0x1a2071(++_0x9e9ad0);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x109ad3,_0x3845ac){_0x109ad3=_0x109ad3-0x0;var _0x27ca71=_0x2e3d[_0x109ad3];return _0x27ca71;};'use strict';var _=require(_0xd2e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2e3('0x1'));var moment=require(_0xd2e3('0x2'));var BPromise=require(_0xd2e3('0x3'));var rp=require(_0xd2e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2e3('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0xd2e3('0x6')]=function(_0x2ba133,_0x3beebf){return _0x2ba133[_0xd2e3('0x7')](_0xd2e3('0x8'),attributes,{'tableName':_0xd2e3('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xd2e3('0xa'),_0xd2e3('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c94=['define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','moment','bluebird','path','../../config/environment','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0c94,0x71));var _0x40c9=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x0c94[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x40c9('0x0'));var util=require(_0x40c9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x40c9('0x2'));var BPromise=require(_0x40c9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40c9('0x4'));var rimraf=require('rimraf');var config=require(_0x40c9('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0x40c9('0x6')]=function(_0x52d1b8,_0x10fcab){return _0x52d1b8[_0x40c9('0x7')]('FreshdeskField',attributes,{'tableName':_0x40c9('0x8'),'paranoid':![],'indexes':[{'name':_0x40c9('0x9'),'fields':[_0x40c9('0xa'),_0x40c9('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 6c0ee2e..88ed47c 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 _0x0dfd=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2b2c29,_0x4fb2eb){var _0x4ce514=function(_0x26f06c){while(--_0x26f06c){_0x2b2c29['push'](_0x2b2c29['shift']());}};_0x4ce514(++_0x4fb2eb);}(_0x0dfd,0xdf));var _0xd0df=function(_0x315c9a,_0x31089b){_0x315c9a=_0x315c9a-0x0;var _0x43a34c=_0x0dfd[_0x315c9a];return _0x43a34c;};'use strict';var _=require(_0xd0df('0x0'));var util=require(_0xd0df('0x1'));var moment=require(_0xd0df('0x2'));var BPromise=require(_0xd0df('0x3'));var rs=require(_0xd0df('0x4'));var fs=require('fs');var Redis=require(_0xd0df('0x5'));var db=require(_0xd0df('0x6'))['db'];var utils=require(_0xd0df('0x7'));var logger=require('../../config/logger')(_0xd0df('0x8'));var config=require(_0xd0df('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd0df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256ec8,_0x15d9d1,_0x349164){return new BPromise(function(_0xd53640,_0x3f5a59){return client[_0xd0df('0xb')](_0x256ec8,_0x349164)['then'](function(_0x47cfa1){logger[_0xd0df('0xc')](_0xd0df('0xd'),_0x15d9d1,'request\x20sent');logger[_0xd0df('0xe')](_0xd0df('0xf'),_0x15d9d1,_0xd0df('0x10'),JSON[_0xd0df('0x11')](_0x47cfa1));if(_0x47cfa1[_0xd0df('0x12')]){if(_0x47cfa1[_0xd0df('0x12')][_0xd0df('0x13')]===0x1f4){logger[_0xd0df('0x12')](_0xd0df('0xd'),_0x15d9d1,_0x47cfa1[_0xd0df('0x12')][_0xd0df('0x14')]);return _0x3f5a59(_0x47cfa1['error'][_0xd0df('0x14')]);}logger[_0xd0df('0x12')](_0xd0df('0xd'),_0x15d9d1,_0x47cfa1[_0xd0df('0x12')][_0xd0df('0x14')]);return _0xd53640(_0x47cfa1['error'][_0xd0df('0x14')]);}else{logger[_0xd0df('0xc')](_0xd0df('0xd'),_0x15d9d1,_0xd0df('0x10'));_0xd53640(_0x47cfa1[_0xd0df('0x15')]['message']);}})['catch'](function(_0x763b2d){logger['error'](_0xd0df('0xd'),_0x15d9d1,_0x763b2d);_0x3f5a59(_0x763b2d);});});} \ No newline at end of file +var _0xc23b=['client','request','info','debug','request\x20sent','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc23b,0x88));var _0xbc23=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xc23b[_0x49052b];return _0x48c045;};'use strict';var _=require(_0xbc23('0x0'));var util=require(_0xbc23('0x1'));var moment=require('moment');var BPromise=require(_0xbc23('0x2'));var rs=require(_0xbc23('0x3'));var fs=require('fs');var Redis=require(_0xbc23('0x4'));var db=require(_0xbc23('0x5'))['db'];var utils=require(_0xbc23('0x6'));var logger=require(_0xbc23('0x7'))(_0xbc23('0x8'));var config=require(_0xbc23('0x9'));var jayson=require(_0xbc23('0xa'));var client=jayson[_0xbc23('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x345af9,_0x5aac16,_0x2fff72){return new BPromise(function(_0xef2137,_0xe8e8a7){return client[_0xbc23('0xc')](_0x345af9,_0x2fff72)['then'](function(_0x5961a5){logger[_0xbc23('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x5aac16,'request\x20sent');logger[_0xbc23('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5aac16,_0xbc23('0xf'),JSON['stringify'](_0x5961a5));if(_0x5961a5['error']){if(_0x5961a5[_0xbc23('0x10')][_0xbc23('0x11')]===0x1f4){logger[_0xbc23('0x10')](_0xbc23('0x12'),_0x5aac16,_0x5961a5['error'][_0xbc23('0x13')]);return _0xe8e8a7(_0x5961a5['error'][_0xbc23('0x13')]);}logger[_0xbc23('0x10')](_0xbc23('0x12'),_0x5aac16,_0x5961a5[_0xbc23('0x10')][_0xbc23('0x13')]);return _0xef2137(_0x5961a5['error'][_0xbc23('0x13')]);}else{logger[_0xbc23('0xd')](_0xbc23('0x12'),_0x5aac16,_0xbc23('0xf'));_0xef2137(_0x5961a5['result'][_0xbc23('0x13')]);}})[_0xbc23('0x14')](function(_0x2b35e1){logger['error'](_0xbc23('0x12'),_0x5aac16,_0x2b35e1);_0xe8e8a7(_0x2b35e1);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1063e15..82997b3 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 _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x2db101,_0x117eeb){var _0x14e10e=function(_0x5b5a42){while(--_0x5b5a42){_0x2db101['push'](_0x2db101['shift']());}};_0x14e10e(++_0x117eeb);}(_0x7334,0x184));var _0x4733=function(_0x5e5e18,_0x44ad19){_0x5e5e18=_0x5e5e18-0x0;var _0x582973=_0x7334[_0x5e5e18];return _0x582973;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router; \ No newline at end of file +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(_0x26c0c8,_0x272361){var _0x2c6303=function(_0x2c2dae){while(--_0x2c2dae){_0x26c0c8['push'](_0x26c0c8['shift']());}};_0x2c6303(++_0x272361);}(_0x80ed,0x11c));var _0xd80e=function(_0x153ee8,_0x1f0a5a){_0x153ee8=_0x153ee8-0x0;var _0x1e31e8=_0x80ed[_0x153ee8];return _0x1e31e8;};'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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index cc2ff58..760a6ce 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 _0x4b17=['username','sequelize','STRING'];(function(_0xe83875,_0xf820d3){var _0x4ca809=function(_0x26882a){while(--_0x26882a){_0xe83875['push'](_0xe83875['shift']());}};_0x4ca809(++_0xf820d3);}(_0x4b17,0x10f));var _0x74b1=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x4b17[_0x158da6];return _0x429c30;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc2c7=['exports','STRING','username','remoteUri'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3c3e1e,_0x46d407){_0x3c3e1e=_0x3c3e1e-0x0;var _0x32a2e9=_0xc2c7[_0x3c3e1e];return _0x32a2e9;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'name':{'type':Sequelize[_0x7c2c('0x1')]},'description':{'type':Sequelize[_0x7c2c('0x1')]},'username':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x2')},'apiKey':{'type':Sequelize[_0x7c2c('0x1')]},'remoteUri':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index b9cbb68..064534e 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 _0x320b=['squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','params','getConfigurations','findOne','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','apiKey','remoteUri','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2e1dbb,_0x45d0b7){var _0x14acb3=function(_0x2d6ecd){while(--_0x2d6ecd){_0x2e1dbb['push'](_0x2e1dbb['shift']());}};_0x14acb3(++_0x45d0b7);}(_0x320b,0x1ee));var _0xb320=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0x320b[_0x5e1b91];return _0x59b52f;};'use strict';var emlformat=require(_0xb320('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb320('0x1'));var rp=require(_0xb320('0x2'));var moment=require('moment');var BPromise=require(_0xb320('0x3'));var Mustache=require(_0xb320('0x4'));var util=require(_0xb320('0x5'));var path=require(_0xb320('0x6'));var sox=require(_0xb320('0x7'));var csv=require(_0xb320('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb320('0x9'));var _=require(_0xb320('0xa'));var squel=require(_0xb320('0xb'));var crypto=require(_0xb320('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb320('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb320('0xe'));var Redis=require('ioredis');var authService=require(_0xb320('0xf'));var qs=require(_0xb320('0x10'));var as=require(_0xb320('0x11'));var hardwareService=require(_0xb320('0x12'));var logger=require('../../config/logger')(_0xb320('0x13'));var utils=require('../../config/utils');var config=require(_0xb320('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb320('0x15'))['db'];var integrations=require(_0xb320('0x16'));function respondWithStatusCode(_0x113f66,_0x3c1f6b){_0x3c1f6b=_0x3c1f6b||0xcc;return function(_0x4b8a8e){if(_0x4b8a8e){return _0x113f66[_0xb320('0x17')](_0x3c1f6b);}return _0x113f66[_0xb320('0x18')](_0x3c1f6b)[_0xb320('0x19')]();};}function respondWithResult(_0x45cf23,_0x30b15c){_0x30b15c=_0x30b15c||0xc8;return function(_0x5659ba){if(_0x5659ba){return _0x45cf23[_0xb320('0x18')](_0x30b15c)[_0xb320('0x1a')](_0x5659ba);}};}function respondWithFilteredResult(_0x2738b7,_0x3b3f9d){return function(_0x5f55fb){if(_0x5f55fb){var _0x90b2e6=typeof _0x3b3f9d['offset']===_0xb320('0x1b')&&typeof _0x3b3f9d[_0xb320('0x1c')]===_0xb320('0x1b');var _0x510fc3=_0x5f55fb[_0xb320('0x1d')];var _0x2fe83b=_0x90b2e6?0x0:_0x3b3f9d[_0xb320('0x1e')];var _0x355924=_0x90b2e6?_0x5f55fb[_0xb320('0x1d')]:_0x3b3f9d[_0xb320('0x1e')]+_0x3b3f9d[_0xb320('0x1c')];var _0x3187d1;if(_0x355924>=_0x510fc3){_0x355924=_0x510fc3;_0x3187d1=0xc8;}else{_0x3187d1=0xce;}_0x2738b7[_0xb320('0x18')](_0x3187d1);return _0x2738b7[_0xb320('0x1f')](_0xb320('0x20'),_0x2fe83b+'-'+_0x355924+'/'+_0x510fc3)[_0xb320('0x1a')](_0x5f55fb);}return null;};}function patchUpdates(_0x4e0542){return function(_0x4d08cb){try{jsonpatch['apply'](_0x4d08cb,_0x4e0542,!![]);}catch(_0x8b4d8){return BPromise[_0xb320('0x21')](_0x8b4d8);}return _0x4d08cb[_0xb320('0x22')]();};}function saveUpdates(_0x4eb7c1,_0x5e4375){return function(_0x5c6365){if(_0x5c6365){return _0x5c6365[_0xb320('0x23')](_0x4eb7c1)[_0xb320('0x24')](function(_0x424fac){return _0x424fac;});}return null;};}function removeEntity(_0x72a96b,_0x70da30){return function(_0xcde25){if(_0xcde25){return _0xcde25[_0xb320('0x25')]()['then'](function(){_0x72a96b[_0xb320('0x18')](0xcc)[_0xb320('0x19')]();});}};}function handleEntityNotFound(_0x3b5b53,_0x4d3be4){return function(_0x4febfa){if(!_0x4febfa){_0x3b5b53[_0xb320('0x17')](0x194);}return _0x4febfa;};}function handleError(_0x4efd53,_0x4ba3f1){_0x4ba3f1=_0x4ba3f1||0x1f4;return function(_0x5dc3b5){logger[_0xb320('0x26')](_0x5dc3b5[_0xb320('0x27')]);if(_0x5dc3b5[_0xb320('0x28')]){delete _0x5dc3b5[_0xb320('0x28')];}_0x4efd53[_0xb320('0x18')](_0x4ba3f1)[_0xb320('0x29')](_0x5dc3b5);};}exports[_0xb320('0x2a')]=function(_0x584443,_0x328ed4){var _0x2875dc={},_0xea3f42={},_0x45568f={'count':0x0,'rows':[]};var _0x5a7343=_['map'](db[_0xb320('0x2b')]['rawAttributes'],function(_0x10d825){return{'name':_0x10d825[_0xb320('0x2c')],'type':_0x10d825[_0xb320('0x2d')][_0xb320('0x2e')]};});_0xea3f42['model']=_[_0xb320('0x2f')](_0x5a7343,_0xb320('0x28'));_0xea3f42[_0xb320('0x30')]=_['keys'](_0x584443[_0xb320('0x30')]);_0xea3f42[_0xb320('0x31')]=_[_0xb320('0x32')](_0xea3f42[_0xb320('0x33')],_0xea3f42['query']);_0x2875dc['attributes']=_['intersection'](_0xea3f42[_0xb320('0x33')],qs[_0xb320('0x34')](_0x584443[_0xb320('0x30')][_0xb320('0x34')]));_0x2875dc[_0xb320('0x35')]=_0x2875dc[_0xb320('0x35')][_0xb320('0x36')]?_0x2875dc[_0xb320('0x35')]:_0xea3f42[_0xb320('0x33')];if(!_0x584443[_0xb320('0x30')][_0xb320('0x37')](_0xb320('0x38'))){_0x2875dc['limit']=qs[_0xb320('0x1c')](_0x584443[_0xb320('0x30')][_0xb320('0x1c')]);_0x2875dc[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x584443[_0xb320('0x30')]['offset']);}_0x2875dc[_0xb320('0x39')]=qs[_0xb320('0x3a')](_0x584443[_0xb320('0x30')][_0xb320('0x3a')]);_0x2875dc[_0xb320('0x3b')]=qs[_0xb320('0x31')](_['pick'](_0x584443['query'],_0xea3f42[_0xb320('0x31')]),_0x5a7343);if(_0x584443[_0xb320('0x30')]['filter']){_0x2875dc[_0xb320('0x3b')]=_['merge'](_0x2875dc[_0xb320('0x3b')],{'$or':_[_0xb320('0x2f')](_0x5a7343,function(_0xff1ba2){if(_0xff1ba2['type']!==_0xb320('0x3c')){var _0x585703={};_0x585703[_0xff1ba2['name']]={'$like':'%'+_0x584443[_0xb320('0x30')][_0xb320('0x3d')]+'%'};return _0x585703;}})});}_0x2875dc=_[_0xb320('0x3e')]({},_0x2875dc,_0x584443[_0xb320('0x3f')]);var _0x160121={'where':_0x2875dc[_0xb320('0x3b')]};return db[_0xb320('0x2b')][_0xb320('0x1d')](_0x160121)['then'](function(_0x46065f){_0x45568f[_0xb320('0x1d')]=_0x46065f;if(_0x584443[_0xb320('0x30')]['includeAll']){_0x2875dc[_0xb320('0x40')]=[{'all':!![]}];}return db[_0xb320('0x2b')][_0xb320('0x41')](_0x2875dc);})[_0xb320('0x24')](function(_0x2cbff6){_0x45568f[_0xb320('0x42')]=_0x2cbff6;return _0x45568f;})['then'](respondWithFilteredResult(_0x328ed4,_0x2875dc))[_0xb320('0x43')](handleError(_0x328ed4,null));};exports[_0xb320('0x44')]=function(_0xe3f902,_0x2b4ab3){var _0xa7d273={'raw':![],'where':{'id':_0xe3f902['params']['id']}},_0x4b82f6={};_0x4b82f6[_0xb320('0x33')]=_[_0xb320('0x45')](db[_0xb320('0x2b')][_0xb320('0x46')]);_0x4b82f6[_0xb320('0x30')]=_[_0xb320('0x45')](_0xe3f902[_0xb320('0x30')]);_0x4b82f6['filters']=_[_0xb320('0x32')](_0x4b82f6[_0xb320('0x33')],_0x4b82f6[_0xb320('0x30')]);_0xa7d273[_0xb320('0x35')]=_['intersection'](_0x4b82f6[_0xb320('0x33')],qs[_0xb320('0x34')](_0xe3f902[_0xb320('0x30')][_0xb320('0x34')]));_0xa7d273[_0xb320('0x35')]=_0xa7d273[_0xb320('0x35')]['length']?_0xa7d273[_0xb320('0x35')]:_0x4b82f6[_0xb320('0x33')];if(_0xe3f902['query'][_0xb320('0x47')]){_0xa7d273[_0xb320('0x40')]=[{'all':!![]}];}_0xa7d273=_[_0xb320('0x3e')]({},_0xa7d273,_0xe3f902[_0xb320('0x3f')]);return db[_0xb320('0x2b')][_0xb320('0x48')](_0xa7d273)[_0xb320('0x24')](handleEntityNotFound(_0x2b4ab3,null))[_0xb320('0x24')](respondWithResult(_0x2b4ab3,null))[_0xb320('0x43')](handleError(_0x2b4ab3,null));};exports[_0xb320('0x49')]=function(_0x4b2f4b,_0x3d6d4a){return db[_0xb320('0x2b')][_0xb320('0x49')](_0x4b2f4b[_0xb320('0x4a')],{})['then'](respondWithResult(_0x3d6d4a,0xc9))[_0xb320('0x43')](handleError(_0x3d6d4a,null));};exports['update']=function(_0x5f2616,_0x2e4ec3){if(_0x5f2616['body']['id']){delete _0x5f2616[_0xb320('0x4a')]['id'];}return db['FreshsalesAccount'][_0xb320('0x48')]({'where':{'id':_0x5f2616[_0xb320('0x4b')]['id']}})[_0xb320('0x24')](handleEntityNotFound(_0x2e4ec3,null))[_0xb320('0x24')](saveUpdates(_0x5f2616[_0xb320('0x4a')],null))[_0xb320('0x24')](respondWithResult(_0x2e4ec3,null))['catch'](handleError(_0x2e4ec3,null));};exports[_0xb320('0x25')]=function(_0x1e213f,_0x270651){return db[_0xb320('0x2b')][_0xb320('0x48')]({'where':{'id':_0x1e213f['params']['id']}})[_0xb320('0x24')](handleEntityNotFound(_0x270651,null))[_0xb320('0x24')](removeEntity(_0x270651,null))[_0xb320('0x43')](handleError(_0x270651,null));};exports[_0xb320('0x4c')]=function(_0x1a0f93,_0x45b406,_0x57a4ed){var _0x286ee5={};var _0x418a48={};var _0x10b571;var _0x1577b1;return db[_0xb320('0x2b')][_0xb320('0x4d')]({'where':{'id':_0x1a0f93[_0xb320('0x4b')]['id']}})[_0xb320('0x24')](handleEntityNotFound(_0x45b406,null))[_0xb320('0x24')](function(_0x1916f8){if(_0x1916f8){_0x10b571=_0x1916f8;_0x418a48['model']=_[_0xb320('0x45')](db['FreshsalesConfiguration']['rawAttributes']);_0x418a48[_0xb320('0x30')]=_[_0xb320('0x45')](_0x1a0f93[_0xb320('0x30')]);_0x418a48[_0xb320('0x31')]=_[_0xb320('0x32')](_0x418a48['model'],_0x418a48[_0xb320('0x30')]);_0x286ee5['attributes']=_[_0xb320('0x32')](_0x418a48[_0xb320('0x33')],qs[_0xb320('0x34')](_0x1a0f93['query']['fields']));_0x286ee5[_0xb320('0x35')]=_0x286ee5[_0xb320('0x35')][_0xb320('0x36')]?_0x286ee5[_0xb320('0x35')]:_0x418a48[_0xb320('0x33')];_0x286ee5[_0xb320('0x39')]=qs['sort'](_0x1a0f93[_0xb320('0x30')]['sort']);_0x286ee5[_0xb320('0x3b')]=qs[_0xb320('0x31')](_[_0xb320('0x4e')](_0x1a0f93['query'],_0x418a48['filters']));if(_0x1a0f93[_0xb320('0x30')][_0xb320('0x3d')]){_0x286ee5[_0xb320('0x3b')]=_['merge'](_0x286ee5[_0xb320('0x3b')],{'$or':_['map'](_0x286ee5['attributes'],function(_0x1879a4){var _0x2a0017={};_0x2a0017[_0x1879a4]={'$like':'%'+_0x1a0f93[_0xb320('0x30')][_0xb320('0x3d')]+'%'};return _0x2a0017;})});}_0x286ee5=_[_0xb320('0x3e')]({},_0x286ee5,_0x1a0f93[_0xb320('0x3f')]);return _0x10b571[_0xb320('0x4c')](_0x286ee5);}})['then'](function(_0xd7d751){if(_0xd7d751){_0x1577b1=_0xd7d751['length'];if(!_0x1a0f93['query'][_0xb320('0x37')](_0xb320('0x38'))){_0x286ee5['limit']=qs['limit'](_0x1a0f93[_0xb320('0x30')][_0xb320('0x1c')]);_0x286ee5['offset']=qs[_0xb320('0x1e')](_0x1a0f93[_0xb320('0x30')][_0xb320('0x1e')]);}return _0x10b571[_0xb320('0x4c')](_0x286ee5);}})[_0xb320('0x24')](function(_0x5c11b0){if(_0x5c11b0){return _0x5c11b0?{'count':_0x1577b1,'rows':_0x5c11b0}:null;}})[_0xb320('0x24')](respondWithResult(_0x45b406,null))['catch'](handleError(_0x45b406,null));};exports['addConfiguration']=function(_0xe1f2a7,_0x141af6,_0x138e09){if(_0xe1f2a7[_0xb320('0x4a')]['id']){delete _0xe1f2a7['body']['id'];}return db[_0xb320('0x2b')][_0xb320('0x4d')]({'where':{'id':_0xe1f2a7[_0xb320('0x4b')]['id']}})[_0xb320('0x24')](handleEntityNotFound(_0x141af6,null))[_0xb320('0x24')](function(_0x478ff7){if(_0x478ff7){_0xe1f2a7[_0xb320('0x4a')][_0xb320('0x4f')]=_0x478ff7['id'];_0xe1f2a7[_0xb320('0x4a')][_0xb320('0x50')]=integrations[_0xb320('0x51')](_0xe1f2a7[_0xb320('0x4a')][_0xb320('0x52')],_0xe1f2a7[_0xb320('0x4a')][_0xb320('0x2d')]);_0xe1f2a7[_0xb320('0x4a')]['Descriptions']=integrations[_0xb320('0x53')](_0xe1f2a7[_0xb320('0x4a')][_0xb320('0x52')],_0xe1f2a7[_0xb320('0x4a')]['type']);return db['FreshsalesConfiguration']['create'](_0xe1f2a7[_0xb320('0x4a')],{'include':[{'model':db[_0xb320('0x54')],'as':'Subjects'},{'model':db[_0xb320('0x54')],'as':_0xb320('0x55')}]});}return null;})[_0xb320('0x24')](respondWithResult(_0x141af6,null))[_0xb320('0x43')](handleError(_0x141af6,null));};exports[_0xb320('0x56')]=function(_0x17ed3e,_0x365e00,_0xc63007){var _0x2fc6f1='';var _0x496b7b='';return db[_0xb320('0x2b')][_0xb320('0x4d')]({'where':{'id':_0x17ed3e['params']['id']},'attributes':['id','username','remoteUri',_0xb320('0x57')]})[_0xb320('0x24')](handleEntityNotFound(_0x365e00,null))['then'](function(_0x2d1ee9){if(_0x2d1ee9){_0x496b7b=_0x2d1ee9['username'];_0x2fc6f1=_0x2d1ee9['remoteUri'];var _0x2de6dd=_0x2d1ee9[_0xb320('0x58')]['slice'](-0x1);if(_0x2de6dd==='/'){_0x2fc6f1=_0x2fc6f1['substring'](0x0,_0x2fc6f1[_0xb320('0x59')](_0x2de6dd));}return rp({'method':_0xb320('0x5a'),'uri':util[_0xb320('0x5b')](_0xb320('0x5c'),_0x2fc6f1,_0xb320('0x5d')),'headers':{'Authorization':_0xb320('0x5e')+_0x2d1ee9[_0xb320('0x57')]},'json':!![]});}})['then'](function(_0x12b3b3){if(_0x12b3b3){var _0x1f28e8=_0x12b3b3[_0xb320('0x5f')];var _0x5a7114=![];var _0x1d2a03=null;for(_0x1d2a03=0x0;_0x1d2a03<_0x1f28e8[_0xb320('0x36')];_0x1d2a03++){if(_0x1f28e8[_0x1d2a03]['email']===_0x496b7b){_0x5a7114=!![];}}if(_0x5a7114){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb320('0x60')});}}})[_0xb320('0x24')](respondWithResult(_0x365e00,null))['catch'](function(_0xaea2a5){var _0x5e6627=_0x17ed3e['query']['test']?0x1f4:_0xaea2a5[_0xb320('0x61')]||0x1f4;logger[_0xb320('0x26')](_0xb320('0x62'),'getFields',_0x5e6627,JSON[_0xb320('0x63')](_0xaea2a5));delete _0xaea2a5[_0xb320('0x28')];if(_0x5e6627===0x191){_0x5e6627=0x190;}_0x365e00[_0xb320('0x18')](_0x5e6627)[_0xb320('0x29')](_0x17ed3e[_0xb320('0x30')]['test']?{'message':_0xb320('0x64'),'statusCode':_0xaea2a5[_0xb320('0x61')]}:_0xaea2a5);});}; \ No newline at end of file +var _0xcfc1=['getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','send','index','fieldName','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','FreshsalesAccount','findAll','catch','show','params','rawAttributes','include','find','create','body','destroy','FreshsalesConfiguration'];(function(_0x358b77,_0x22c9b4){var _0xdac979=function(_0x5213a9){while(--_0x5213a9){_0x358b77['push'](_0x358b77['shift']());}};_0xdac979(++_0x22c9b4);}(_0xcfc1,0xef));var _0x1cfc=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xcfc1[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require(_0x1cfc('0x0'));var rimraf=require(_0x1cfc('0x1'));var zipdir=require(_0x1cfc('0x2'));var jsonpatch=require(_0x1cfc('0x3'));var rp=require('request-promise');var moment=require(_0x1cfc('0x4'));var BPromise=require(_0x1cfc('0x5'));var Mustache=require(_0x1cfc('0x6'));var util=require(_0x1cfc('0x7'));var path=require(_0x1cfc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1cfc('0x9'));var fs=require('fs');var fs_extra=require(_0x1cfc('0xa'));var _=require(_0x1cfc('0xb'));var squel=require(_0x1cfc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1cfc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1cfc('0xe'));var Papa=require(_0x1cfc('0xf'));var Redis=require(_0x1cfc('0x10'));var authService=require(_0x1cfc('0x11'));var qs=require(_0x1cfc('0x12'));var as=require(_0x1cfc('0x13'));var hardwareService=require(_0x1cfc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1cfc('0x15'));var licenseUtil=require(_0x1cfc('0x16'));var db=require(_0x1cfc('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e0aea,_0x5f30d7){_0x5f30d7=_0x5f30d7||0xcc;return function(_0x50b685){if(_0x50b685){return _0x4e0aea[_0x1cfc('0x18')](_0x5f30d7);}return _0x4e0aea[_0x1cfc('0x19')](_0x5f30d7)[_0x1cfc('0x1a')]();};}function respondWithResult(_0x50a6ba,_0x27539d){_0x27539d=_0x27539d||0xc8;return function(_0x27ed44){if(_0x27ed44){return _0x50a6ba[_0x1cfc('0x19')](_0x27539d)[_0x1cfc('0x1b')](_0x27ed44);}};}function respondWithFilteredResult(_0x4870f7,_0x1d43a3){return function(_0x2b75d1){if(_0x2b75d1){var _0x49578a=typeof _0x1d43a3[_0x1cfc('0x1c')]==='undefined'&&typeof _0x1d43a3[_0x1cfc('0x1d')]===_0x1cfc('0x1e');var _0x3d5817=_0x2b75d1[_0x1cfc('0x1f')];var _0x58e682=_0x49578a?0x0:_0x1d43a3[_0x1cfc('0x1c')];var _0x5aa3f0=_0x49578a?_0x2b75d1[_0x1cfc('0x1f')]:_0x1d43a3['offset']+_0x1d43a3[_0x1cfc('0x1d')];var _0x4fcbf7;if(_0x5aa3f0>=_0x3d5817){_0x5aa3f0=_0x3d5817;_0x4fcbf7=0xc8;}else{_0x4fcbf7=0xce;}_0x4870f7[_0x1cfc('0x19')](_0x4fcbf7);return _0x4870f7[_0x1cfc('0x20')]('Content-Range',_0x58e682+'-'+_0x5aa3f0+'/'+_0x3d5817)[_0x1cfc('0x1b')](_0x2b75d1);}return null;};}function patchUpdates(_0x2b0246){return function(_0x4e41db){try{jsonpatch[_0x1cfc('0x21')](_0x4e41db,_0x2b0246,!![]);}catch(_0x2637e3){return BPromise[_0x1cfc('0x22')](_0x2637e3);}return _0x4e41db[_0x1cfc('0x23')]();};}function saveUpdates(_0x4ebfbc,_0x56cc40){return function(_0x4e3130){if(_0x4e3130){return _0x4e3130[_0x1cfc('0x24')](_0x4ebfbc)['then'](function(_0x11a663){return _0x11a663;});}return null;};}function removeEntity(_0x3654d4,_0x2f4e2b){return function(_0x575569){if(_0x575569){return _0x575569['destroy']()[_0x1cfc('0x25')](function(){_0x3654d4[_0x1cfc('0x19')](0xcc)[_0x1cfc('0x1a')]();});}};}function handleEntityNotFound(_0x59dbda,_0x3b17a2){return function(_0x2edb6c){if(!_0x2edb6c){_0x59dbda['sendStatus'](0x194);}return _0x2edb6c;};}function handleError(_0x61c458,_0x37c2e2){_0x37c2e2=_0x37c2e2||0x1f4;return function(_0x327f7a){logger[_0x1cfc('0x26')](_0x327f7a[_0x1cfc('0x27')]);if(_0x327f7a['name']){delete _0x327f7a['name'];}_0x61c458[_0x1cfc('0x19')](_0x37c2e2)[_0x1cfc('0x28')](_0x327f7a);};}exports[_0x1cfc('0x29')]=function(_0x5deed4,_0x11e4bf){var _0x330a61={},_0x4c70c6={},_0x1a2e89={'count':0x0,'rows':[]};var _0x21b845=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x1b940b){return{'name':_0x1b940b[_0x1cfc('0x2a')],'type':_0x1b940b['type']['key']};});_0x4c70c6[_0x1cfc('0x2b')]=_[_0x1cfc('0x2c')](_0x21b845,_0x1cfc('0x2d'));_0x4c70c6['query']=_[_0x1cfc('0x2e')](_0x5deed4[_0x1cfc('0x2f')]);_0x4c70c6[_0x1cfc('0x30')]=_[_0x1cfc('0x31')](_0x4c70c6[_0x1cfc('0x2b')],_0x4c70c6[_0x1cfc('0x2f')]);_0x330a61[_0x1cfc('0x32')]=_[_0x1cfc('0x31')](_0x4c70c6['model'],qs['fields'](_0x5deed4[_0x1cfc('0x2f')][_0x1cfc('0x33')]));_0x330a61[_0x1cfc('0x32')]=_0x330a61[_0x1cfc('0x32')][_0x1cfc('0x34')]?_0x330a61[_0x1cfc('0x32')]:_0x4c70c6[_0x1cfc('0x2b')];if(!_0x5deed4[_0x1cfc('0x2f')]['hasOwnProperty'](_0x1cfc('0x35'))){_0x330a61[_0x1cfc('0x1d')]=qs[_0x1cfc('0x1d')](_0x5deed4['query'][_0x1cfc('0x1d')]);_0x330a61[_0x1cfc('0x1c')]=qs['offset'](_0x5deed4['query'][_0x1cfc('0x1c')]);}_0x330a61[_0x1cfc('0x36')]=qs[_0x1cfc('0x37')](_0x5deed4['query'][_0x1cfc('0x37')]);_0x330a61['where']=qs[_0x1cfc('0x30')](_[_0x1cfc('0x38')](_0x5deed4[_0x1cfc('0x2f')],_0x4c70c6[_0x1cfc('0x30')]),_0x21b845);if(_0x5deed4['query'][_0x1cfc('0x39')]){_0x330a61[_0x1cfc('0x3a')]=_[_0x1cfc('0x3b')](_0x330a61[_0x1cfc('0x3a')],{'$or':_[_0x1cfc('0x2c')](_0x21b845,function(_0x3729e8){if(_0x3729e8[_0x1cfc('0x3c')]!==_0x1cfc('0x3d')){var _0x2cf1e9={};_0x2cf1e9[_0x3729e8['name']]={'$like':'%'+_0x5deed4[_0x1cfc('0x2f')][_0x1cfc('0x39')]+'%'};return _0x2cf1e9;}})});}_0x330a61=_['merge']({},_0x330a61,_0x5deed4[_0x1cfc('0x3e')]);var _0x56bb1f={'where':_0x330a61[_0x1cfc('0x3a')]};return db['FreshsalesAccount'][_0x1cfc('0x1f')](_0x56bb1f)[_0x1cfc('0x25')](function(_0x597ca5){_0x1a2e89[_0x1cfc('0x1f')]=_0x597ca5;if(_0x5deed4['query'][_0x1cfc('0x3f')]){_0x330a61['include']=[{'all':!![]}];}return db[_0x1cfc('0x40')][_0x1cfc('0x41')](_0x330a61);})['then'](function(_0x24e2da){_0x1a2e89['rows']=_0x24e2da;return _0x1a2e89;})[_0x1cfc('0x25')](respondWithFilteredResult(_0x11e4bf,_0x330a61))[_0x1cfc('0x42')](handleError(_0x11e4bf,null));};exports[_0x1cfc('0x43')]=function(_0x3259a0,_0x14ad89){var _0x50c38b={'raw':![],'where':{'id':_0x3259a0[_0x1cfc('0x44')]['id']}},_0x44705d={};_0x44705d[_0x1cfc('0x2b')]=_[_0x1cfc('0x2e')](db[_0x1cfc('0x40')][_0x1cfc('0x45')]);_0x44705d[_0x1cfc('0x2f')]=_[_0x1cfc('0x2e')](_0x3259a0['query']);_0x44705d['filters']=_['intersection'](_0x44705d['model'],_0x44705d[_0x1cfc('0x2f')]);_0x50c38b[_0x1cfc('0x32')]=_[_0x1cfc('0x31')](_0x44705d['model'],qs[_0x1cfc('0x33')](_0x3259a0[_0x1cfc('0x2f')][_0x1cfc('0x33')]));_0x50c38b[_0x1cfc('0x32')]=_0x50c38b[_0x1cfc('0x32')][_0x1cfc('0x34')]?_0x50c38b[_0x1cfc('0x32')]:_0x44705d[_0x1cfc('0x2b')];if(_0x3259a0['query'][_0x1cfc('0x3f')]){_0x50c38b[_0x1cfc('0x46')]=[{'all':!![]}];}_0x50c38b=_[_0x1cfc('0x3b')]({},_0x50c38b,_0x3259a0['options']);return db[_0x1cfc('0x40')][_0x1cfc('0x47')](_0x50c38b)['then'](handleEntityNotFound(_0x14ad89,null))[_0x1cfc('0x25')](respondWithResult(_0x14ad89,null))['catch'](handleError(_0x14ad89,null));};exports[_0x1cfc('0x48')]=function(_0x313eaf,_0x3ed5bc){return db[_0x1cfc('0x40')]['create'](_0x313eaf['body'],{})[_0x1cfc('0x25')](respondWithResult(_0x3ed5bc,0xc9))[_0x1cfc('0x42')](handleError(_0x3ed5bc,null));};exports[_0x1cfc('0x24')]=function(_0x261af0,_0x417fa0){if(_0x261af0[_0x1cfc('0x49')]['id']){delete _0x261af0[_0x1cfc('0x49')]['id'];}return db['FreshsalesAccount'][_0x1cfc('0x47')]({'where':{'id':_0x261af0[_0x1cfc('0x44')]['id']}})[_0x1cfc('0x25')](handleEntityNotFound(_0x417fa0,null))[_0x1cfc('0x25')](saveUpdates(_0x261af0[_0x1cfc('0x49')],null))['then'](respondWithResult(_0x417fa0,null))['catch'](handleError(_0x417fa0,null));};exports[_0x1cfc('0x4a')]=function(_0x230dbb,_0x3d0d4b){return db[_0x1cfc('0x40')]['find']({'where':{'id':_0x230dbb['params']['id']}})['then'](handleEntityNotFound(_0x3d0d4b,null))[_0x1cfc('0x25')](removeEntity(_0x3d0d4b,null))['catch'](handleError(_0x3d0d4b,null));};exports['getConfigurations']=function(_0x28c37c,_0x5136ea,_0x4ef32b){var _0x2e4697={};var _0x56d810={};var _0x2d52bd;var _0x5cdaef;return db[_0x1cfc('0x40')]['findOne']({'where':{'id':_0x28c37c[_0x1cfc('0x44')]['id']}})[_0x1cfc('0x25')](handleEntityNotFound(_0x5136ea,null))[_0x1cfc('0x25')](function(_0x1ab5ec){if(_0x1ab5ec){_0x2d52bd=_0x1ab5ec;_0x56d810['model']=_[_0x1cfc('0x2e')](db[_0x1cfc('0x4b')][_0x1cfc('0x45')]);_0x56d810[_0x1cfc('0x2f')]=_[_0x1cfc('0x2e')](_0x28c37c[_0x1cfc('0x2f')]);_0x56d810[_0x1cfc('0x30')]=_[_0x1cfc('0x31')](_0x56d810['model'],_0x56d810[_0x1cfc('0x2f')]);_0x2e4697['attributes']=_[_0x1cfc('0x31')](_0x56d810[_0x1cfc('0x2b')],qs['fields'](_0x28c37c[_0x1cfc('0x2f')][_0x1cfc('0x33')]));_0x2e4697[_0x1cfc('0x32')]=_0x2e4697[_0x1cfc('0x32')]['length']?_0x2e4697[_0x1cfc('0x32')]:_0x56d810[_0x1cfc('0x2b')];_0x2e4697['order']=qs[_0x1cfc('0x37')](_0x28c37c[_0x1cfc('0x2f')][_0x1cfc('0x37')]);_0x2e4697[_0x1cfc('0x3a')]=qs[_0x1cfc('0x30')](_['pick'](_0x28c37c[_0x1cfc('0x2f')],_0x56d810[_0x1cfc('0x30')]));if(_0x28c37c[_0x1cfc('0x2f')][_0x1cfc('0x39')]){_0x2e4697['where']=_[_0x1cfc('0x3b')](_0x2e4697[_0x1cfc('0x3a')],{'$or':_[_0x1cfc('0x2c')](_0x2e4697[_0x1cfc('0x32')],function(_0x2416b4){var _0x80c886={};_0x80c886[_0x2416b4]={'$like':'%'+_0x28c37c[_0x1cfc('0x2f')][_0x1cfc('0x39')]+'%'};return _0x80c886;})});}_0x2e4697=_[_0x1cfc('0x3b')]({},_0x2e4697,_0x28c37c[_0x1cfc('0x3e')]);return _0x2d52bd[_0x1cfc('0x4c')](_0x2e4697);}})[_0x1cfc('0x25')](function(_0x2d80d2){if(_0x2d80d2){_0x5cdaef=_0x2d80d2['length'];if(!_0x28c37c['query'][_0x1cfc('0x4d')](_0x1cfc('0x35'))){_0x2e4697[_0x1cfc('0x1d')]=qs[_0x1cfc('0x1d')](_0x28c37c[_0x1cfc('0x2f')]['limit']);_0x2e4697[_0x1cfc('0x1c')]=qs['offset'](_0x28c37c[_0x1cfc('0x2f')][_0x1cfc('0x1c')]);}return _0x2d52bd[_0x1cfc('0x4c')](_0x2e4697);}})[_0x1cfc('0x25')](function(_0x3239d9){if(_0x3239d9){return _0x3239d9?{'count':_0x5cdaef,'rows':_0x3239d9}:null;}})[_0x1cfc('0x25')](respondWithResult(_0x5136ea,null))[_0x1cfc('0x42')](handleError(_0x5136ea,null));};exports[_0x1cfc('0x4e')]=function(_0x2673f4,_0x31be02,_0x2712e6){if(_0x2673f4[_0x1cfc('0x49')]['id']){delete _0x2673f4['body']['id'];}return db[_0x1cfc('0x40')][_0x1cfc('0x4f')]({'where':{'id':_0x2673f4[_0x1cfc('0x44')]['id']}})[_0x1cfc('0x25')](handleEntityNotFound(_0x31be02,null))[_0x1cfc('0x25')](function(_0x5c16d3){if(_0x5c16d3){_0x2673f4[_0x1cfc('0x49')][_0x1cfc('0x50')]=_0x5c16d3['id'];_0x2673f4['body']['Subjects']=integrations[_0x1cfc('0x51')](_0x2673f4[_0x1cfc('0x49')][_0x1cfc('0x52')],_0x2673f4['body']['type']);_0x2673f4[_0x1cfc('0x49')][_0x1cfc('0x53')]=integrations['getDescriptions'](_0x2673f4['body'][_0x1cfc('0x52')],_0x2673f4[_0x1cfc('0x49')]['type']);return db['FreshsalesConfiguration'][_0x1cfc('0x48')](_0x2673f4['body'],{'include':[{'model':db[_0x1cfc('0x54')],'as':_0x1cfc('0x55')},{'model':db[_0x1cfc('0x54')],'as':_0x1cfc('0x53')}]});}return null;})[_0x1cfc('0x25')](respondWithResult(_0x31be02,null))[_0x1cfc('0x42')](handleError(_0x31be02,null));};exports[_0x1cfc('0x56')]=function(_0x662447,_0x31becf,_0x4d31ad){var _0x4a4494='';var _0x291b37='';return db['FreshsalesAccount'][_0x1cfc('0x4f')]({'where':{'id':_0x662447['params']['id']},'attributes':['id',_0x1cfc('0x57'),_0x1cfc('0x58'),_0x1cfc('0x59')]})['then'](handleEntityNotFound(_0x31becf,null))[_0x1cfc('0x25')](function(_0x5f2eee){if(_0x5f2eee){_0x291b37=_0x5f2eee[_0x1cfc('0x57')];_0x4a4494=_0x5f2eee['remoteUri'];var _0x317688=_0x5f2eee['remoteUri'][_0x1cfc('0x5a')](-0x1);if(_0x317688==='/'){_0x4a4494=_0x4a4494[_0x1cfc('0x5b')](0x0,_0x4a4494[_0x1cfc('0x5c')](_0x317688));}return rp({'method':'GET','uri':util[_0x1cfc('0x5d')](_0x1cfc('0x5e'),_0x4a4494,_0x1cfc('0x5f')),'headers':{'Authorization':_0x1cfc('0x60')+_0x5f2eee[_0x1cfc('0x59')]},'json':!![]});}})[_0x1cfc('0x25')](function(_0x3fdfbe){if(_0x3fdfbe){var _0x1c66be=_0x3fdfbe[_0x1cfc('0x61')];var _0xa3e6fe=![];var _0x34becf=null;for(_0x34becf=0x0;_0x34becf<_0x1c66be[_0x1cfc('0x34')];_0x34becf++){if(_0x1c66be[_0x34becf][_0x1cfc('0x62')]===_0x291b37){_0xa3e6fe=!![];}}if(_0xa3e6fe){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1cfc('0x63')});}}})['then'](respondWithResult(_0x31becf,null))['catch'](function(_0x360329){var _0x231c19=_0x662447[_0x1cfc('0x2f')][_0x1cfc('0x64')]?0x1f4:_0x360329[_0x1cfc('0x65')]||0x1f4;logger['error'](_0x1cfc('0x66'),_0x1cfc('0x56'),_0x231c19,JSON[_0x1cfc('0x67')](_0x360329));delete _0x360329['name'];if(_0x231c19===0x191){_0x231c19=0x190;}_0x31becf[_0x1cfc('0x19')](_0x231c19)['send'](_0x662447[_0x1cfc('0x2f')][_0x1cfc('0x64')]?{'message':_0x1cfc('0x68'),'statusCode':_0x360329[_0x1cfc('0x65')]}:_0x360329);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 8173b1a..44a7b90 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 _0x68b3=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0xb68721,_0x3359f7){var _0xa54960=function(_0x463b67){while(--_0x463b67){_0xb68721['push'](_0xb68721['shift']());}};_0xa54960(++_0x3359f7);}(_0x68b3,0x1d8));var _0x368b=function(_0x9bf5e8,_0xc17099){_0x9bf5e8=_0x9bf5e8-0x0;var _0x1efe7d=_0x68b3[_0x9bf5e8];return _0x1efe7d;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x368b('0x9'));module[_0x368b('0xa')]=function(_0x104dad,_0x23584a){return _0x104dad[_0x368b('0xb')](_0x368b('0xc'),attributes,{'tableName':_0x368b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47c5=['rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x21fff4,_0x4c3785){var _0x5475ef=function(_0x56b0ca){while(--_0x56b0ca){_0x21fff4['push'](_0x21fff4['shift']());}};_0x5475ef(++_0x4c3785);}(_0x47c5,0x165));var _0x547c=function(_0x53aecd,_0x3d159f){_0x53aecd=_0x53aecd-0x0;var _0x13992c=_0x47c5[_0x53aecd];return _0x13992c;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));var integrations=require(_0x547c('0x9'));module['exports']=function(_0x2e5b57,_0x439f25){return _0x2e5b57[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'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 0b578cf..49a956c 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 _0x8e3f=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2135a8,_0x2d5706){var _0x3dd593=function(_0x3c4c5d){while(--_0x3c4c5d){_0x2135a8['push'](_0x2135a8['shift']());}};_0x3dd593(++_0x2d5706);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});}; \ No newline at end of file +var _0xd117=['message','request\x20sent','catch','FreshsalesAccount','options','raw','where','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','code','error'];(function(_0x4c2e2b,_0x176274){var _0x84ea2d=function(_0x3de9cf){while(--_0x3de9cf){_0x4c2e2b['push'](_0x4c2e2b['shift']());}};_0x84ea2d(++_0x176274);}(_0xd117,0x182));var _0x7d11=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0xd117[_0x20cc29];return _0x28d513;};'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')]('FreshsalesAccount,\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);});});}exports['GetFreshsalesAccount']=function(_0x456cb9){var _0x49a34b=this;return new Promise(function(_0x4d1306,_0x5459df){return db[_0x7d11('0x18')]['findAll']({'raw':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1b')]||null:null,'attributes':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1c')]||null:null,'limit':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1d')]||null:null,'include':_0x456cb9['options']?_0x456cb9['options']['include']?_[_0x7d11('0x1e')](_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1f')],function(_0x1a7853){return{'model':db[_0x1a7853[_0x7d11('0x20')]],'as':_0x1a7853['as'],'attributes':_0x1a7853[_0x7d11('0x1c')],'include':_0x1a7853[_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0x1a7853['include'],function(_0x36c2b4){return{'model':db[_0x36c2b4['model']],'as':_0x36c2b4['as'],'attributes':_0x36c2b4['attributes'],'include':_0x36c2b4['include']?_[_0x7d11('0x1e')](_0x36c2b4['include'],function(_0x180e1e){return{'model':db[_0x180e1e[_0x7d11('0x20')]],'as':_0x180e1e['as'],'attributes':_0x180e1e[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46f76a){logger[_0x7d11('0xf')](_0x7d11('0x21'),_0x456cb9);logger['debug'](_0x7d11('0x21'),_0x456cb9,JSON[_0x7d11('0x12')](_0x46f76a));_0x4d1306(_0x46f76a);})[_0x7d11('0x17')](function(_0x38f1be){logger['error'](_0x7d11('0x21'),_0x38f1be['message'],_0x456cb9);_0x5459df(_0x49a34b[_0x7d11('0x14')](0x1f4,_0x38f1be['message']));});});};exports[_0x7d11('0x22')]=function(_0xba4e80){var _0x1e32f6=this;return new Promise(function(_0x4831ed,_0x5e721f){return db[_0x7d11('0x18')][_0x7d11('0x23')]({'raw':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0xba4e80[_0x7d11('0x19')]?_0xba4e80['options'][_0x7d11('0x1b')]||null:null,'attributes':_0xba4e80['options']?_0xba4e80['options'][_0x7d11('0x1c')]||null:null,'include':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0xba4e80[_0x7d11('0x19')]['include'],function(_0x11d9e2){return{'model':db[_0x11d9e2[_0x7d11('0x20')]],'as':_0x11d9e2['as'],'attributes':_0x11d9e2['attributes'],'include':_0x11d9e2['include']?_[_0x7d11('0x1e')](_0x11d9e2[_0x7d11('0x1f')],function(_0x5b7d3a){return{'model':db[_0x5b7d3a[_0x7d11('0x20')]],'as':_0x5b7d3a['as'],'attributes':_0x5b7d3a['attributes'],'include':_0x5b7d3a['include']?_[_0x7d11('0x1e')](_0x5b7d3a['include'],function(_0x4e53be){return{'model':db[_0x4e53be[_0x7d11('0x20')]],'as':_0x4e53be['as'],'attributes':_0x4e53be[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d11('0x24')](function(_0x2e426b){logger[_0x7d11('0xf')](_0x7d11('0x22'),_0xba4e80);logger[_0x7d11('0x11')](_0x7d11('0x22'),_0xba4e80,JSON[_0x7d11('0x12')](_0x2e426b));_0x4831ed(_0x2e426b);})[_0x7d11('0x17')](function(_0x1a9f18){logger[_0x7d11('0x14')]('ShowFreshsalesAccount',_0x1a9f18[_0x7d11('0x15')],_0xba4e80);_0x5e721f(_0x1e32f6['error'](0x1f4,_0x1a9f18[_0x7d11('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0c54c59..6bcef10 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 _0xc21d=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put'];(function(_0x16465a,_0x1fe25d){var _0x5ca7da=function(_0xf987f1){while(--_0xf987f1){_0x16465a['push'](_0x16465a['shift']());}};_0x5ca7da(++_0x1fe25d);}(_0xc21d,0x9a));var _0xdc21=function(_0x5d949f,_0x3ee36e){_0x5d949f=_0x5d949f-0x0;var _0x4dfb48=_0xc21d[_0x5d949f];return _0x4dfb48;};'use strict';var multer=require(_0xdc21('0x0'));var util=require('util');var path=require(_0xdc21('0x1'));var timeout=require(_0xdc21('0x2'));var express=require('express');var router=express[_0xdc21('0x3')]();var fs_extra=require(_0xdc21('0x4'));var auth=require(_0xdc21('0x5'));var interaction=require(_0xdc21('0x6'));var config=require(_0xdc21('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xdc21('0x8')]('/',auth[_0xdc21('0x9')](),controller[_0xdc21('0xa')]);router[_0xdc21('0x8')](_0xdc21('0xb'),auth['isAuthenticated'](),controller[_0xdc21('0xc')]);router[_0xdc21('0x8')](_0xdc21('0xd'),auth[_0xdc21('0x9')](),controller[_0xdc21('0xe')]);router[_0xdc21('0x8')]('/:id/descriptions',auth[_0xdc21('0x9')](),controller[_0xdc21('0xf')]);router[_0xdc21('0x8')](_0xdc21('0x10'),auth['isAuthenticated'](),controller[_0xdc21('0x11')]);router[_0xdc21('0x12')]('/',auth[_0xdc21('0x9')](),controller[_0xdc21('0x13')]);router[_0xdc21('0x14')](_0xdc21('0xb'),auth[_0xdc21('0x9')](),controller[_0xdc21('0x15')]);router[_0xdc21('0x16')](_0xdc21('0xb'),auth[_0xdc21('0x9')](),controller[_0xdc21('0x17')]);module[_0xdc21('0x18')]=router; \ No newline at end of file +var _0xb854=['./intFreshsalesConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb854,0x1c4));var _0x4b85=function(_0x358abb,_0x31eaa0){_0x358abb=_0x358abb-0x0;var _0x2d3a2a=_0xb854[_0x358abb];return _0x2d3a2a;};'use strict';var multer=require('multer');var util=require(_0x4b85('0x0'));var path=require(_0x4b85('0x1'));var timeout=require(_0x4b85('0x2'));var express=require(_0x4b85('0x3'));var router=express[_0x4b85('0x4')]();var fs_extra=require(_0x4b85('0x5'));var auth=require(_0x4b85('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b85('0x7'));var controller=require(_0x4b85('0x8'));router['get']('/',auth[_0x4b85('0x9')](),controller[_0x4b85('0xa')]);router['get'](_0x4b85('0xb'),auth['isAuthenticated'](),controller[_0x4b85('0xc')]);router[_0x4b85('0xd')](_0x4b85('0xe'),auth[_0x4b85('0x9')](),controller['getSubjects']);router['get'](_0x4b85('0xf'),auth[_0x4b85('0x9')](),controller[_0x4b85('0x10')]);router[_0x4b85('0xd')](_0x4b85('0x11'),auth[_0x4b85('0x9')](),controller[_0x4b85('0x12')]);router[_0x4b85('0x13')]('/',auth[_0x4b85('0x9')](),controller[_0x4b85('0x14')]);router['put'](_0x4b85('0xb'),auth[_0x4b85('0x9')](),controller[_0x4b85('0x15')]);router['delete'](_0x4b85('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4b85('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index fbb9661..0b7a283 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 _0x819a=['exports','STRING','sequelize'];(function(_0x37c7c4,_0x2e1003){var _0x5cab50=function(_0x753511){while(--_0x753511){_0x37c7c4['push'](_0x37c7c4['shift']());}};_0x5cab50(++_0x2e1003);}(_0x819a,0x146));var _0xa819=function(_0x727dfa,_0x2327cf){_0x727dfa=_0x727dfa-0x0;var _0x1562ad=_0x819a[_0x727dfa];return _0x1562ad;};'use strict';var Sequelize=require(_0xa819('0x0'));module[_0xa819('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa819('0x2')]}}; \ No newline at end of file +var _0xda05=['STRING','sequelize','exports'];(function(_0x106dc8,_0x4e9648){var _0x51c5d1=function(_0x54ec7a){while(--_0x54ec7a){_0x106dc8['push'](_0x106dc8['shift']());}};_0x51c5d1(++_0x4e9648);}(_0xda05,0x106));var _0x5da0=function(_0x5a38ec,_0x718e94){_0x5a38ec=_0x5a38ec-0x0;var _0xd2ffb1=_0xda05[_0x5a38ec];return _0xd2ffb1;};'use strict';var Sequelize=require(_0x5da0('0x0'));module[_0x5da0('0x1')]={'name':{'type':Sequelize[_0x5da0('0x2')]},'description':{'type':Sequelize[_0x5da0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 63e54da..19e070c 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 _0x745b=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','error','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','getSubjects','FreshsalesField','pick','getDescriptions','getFields','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x745b,0x12a));var _0xb745=function(_0x1b2c9f,_0x3026d5){_0x1b2c9f=_0x1b2c9f-0x0;var _0x5e22cd=_0x745b[_0x1b2c9f];return _0x5e22cd;};'use strict';var emlformat=require(_0xb745('0x0'));var rimraf=require(_0xb745('0x1'));var zipdir=require(_0xb745('0x2'));var jsonpatch=require(_0xb745('0x3'));var rp=require(_0xb745('0x4'));var moment=require(_0xb745('0x5'));var BPromise=require(_0xb745('0x6'));var Mustache=require(_0xb745('0x7'));var util=require(_0xb745('0x8'));var path=require(_0xb745('0x9'));var sox=require('sox');var csv=require(_0xb745('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb745('0xb'));var _=require(_0xb745('0xc'));var squel=require(_0xb745('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb745('0xe'));var toCsv=require(_0xb745('0xa'));var querystring=require(_0xb745('0xf'));var Papa=require(_0xb745('0x10'));var Redis=require('ioredis');var authService=require(_0xb745('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb745('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb745('0x13'))('api');var utils=require(_0xb745('0x14'));var config=require(_0xb745('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb745('0x16'))['db'];function respondWithStatusCode(_0x1fabc7,_0x450edf){_0x450edf=_0x450edf||0xcc;return function(_0x11a5d8){if(_0x11a5d8){return _0x1fabc7[_0xb745('0x17')](_0x450edf);}return _0x1fabc7[_0xb745('0x18')](_0x450edf)[_0xb745('0x19')]();};}function respondWithResult(_0x396e51,_0x43ade9){_0x43ade9=_0x43ade9||0xc8;return function(_0x3f12a4){if(_0x3f12a4){return _0x396e51[_0xb745('0x18')](_0x43ade9)[_0xb745('0x1a')](_0x3f12a4);}};}function respondWithFilteredResult(_0x57f3eb,_0x3ff3e5){return function(_0x57e568){if(_0x57e568){var _0x2ab38f=typeof _0x3ff3e5['offset']===_0xb745('0x1b')&&typeof _0x3ff3e5[_0xb745('0x1c')]===_0xb745('0x1b');var _0x1f2132=_0x57e568[_0xb745('0x1d')];var _0x2a5ab3=_0x2ab38f?0x0:_0x3ff3e5['offset'];var _0x23c730=_0x2ab38f?_0x57e568[_0xb745('0x1d')]:_0x3ff3e5[_0xb745('0x1e')]+_0x3ff3e5[_0xb745('0x1c')];var _0xb059c9;if(_0x23c730>=_0x1f2132){_0x23c730=_0x1f2132;_0xb059c9=0xc8;}else{_0xb059c9=0xce;}_0x57f3eb[_0xb745('0x18')](_0xb059c9);return _0x57f3eb[_0xb745('0x1f')](_0xb745('0x20'),_0x2a5ab3+'-'+_0x23c730+'/'+_0x1f2132)[_0xb745('0x1a')](_0x57e568);}return null;};}function patchUpdates(_0x13be82){return function(_0x354e31){try{jsonpatch['apply'](_0x354e31,_0x13be82,!![]);}catch(_0x3a9ca){return BPromise[_0xb745('0x21')](_0x3a9ca);}return _0x354e31[_0xb745('0x22')]();};}function saveUpdates(_0x2cba88,_0x8e6442){return function(_0x4ca3e6){if(_0x4ca3e6){return _0x4ca3e6[_0xb745('0x23')](_0x2cba88)['then'](function(_0x1450df){return _0x1450df;});}return null;};}function removeEntity(_0x52de1f,_0x348caf){return function(_0x35a3ea){if(_0x35a3ea){return _0x35a3ea[_0xb745('0x24')]()[_0xb745('0x25')](function(){_0x52de1f[_0xb745('0x18')](0xcc)[_0xb745('0x19')]();});}};}function handleEntityNotFound(_0x56a23f,_0x14b748){return function(_0x2d7500){if(!_0x2d7500){_0x56a23f['sendStatus'](0x194);}return _0x2d7500;};}function handleError(_0x1dd6b9,_0xcb94bc){_0xcb94bc=_0xcb94bc||0x1f4;return function(_0x17580b){logger[_0xb745('0x26')](_0x17580b['stack']);if(_0x17580b['name']){delete _0x17580b['name'];}_0x1dd6b9[_0xb745('0x18')](_0xcb94bc)[_0xb745('0x27')](_0x17580b);};}exports[_0xb745('0x28')]=function(_0x26505a,_0x4a1971){var _0x5ba066={},_0x4e099e={},_0x531199={'count':0x0,'rows':[]};var _0x4b7853=_[_0xb745('0x29')](db[_0xb745('0x2a')]['rawAttributes'],function(_0x14dc08){return{'name':_0x14dc08[_0xb745('0x2b')],'type':_0x14dc08[_0xb745('0x2c')][_0xb745('0x2d')]};});_0x4e099e[_0xb745('0x2e')]=_[_0xb745('0x29')](_0x4b7853,_0xb745('0x2f'));_0x4e099e[_0xb745('0x30')]=_[_0xb745('0x31')](_0x26505a['query']);_0x4e099e[_0xb745('0x32')]=_['intersection'](_0x4e099e['model'],_0x4e099e['query']);_0x5ba066[_0xb745('0x33')]=_[_0xb745('0x34')](_0x4e099e[_0xb745('0x2e')],qs[_0xb745('0x35')](_0x26505a[_0xb745('0x30')][_0xb745('0x35')]));_0x5ba066['attributes']=_0x5ba066[_0xb745('0x33')][_0xb745('0x36')]?_0x5ba066[_0xb745('0x33')]:_0x4e099e[_0xb745('0x2e')];if(!_0x26505a[_0xb745('0x30')][_0xb745('0x37')](_0xb745('0x38'))){_0x5ba066['limit']=qs[_0xb745('0x1c')](_0x26505a[_0xb745('0x30')]['limit']);_0x5ba066[_0xb745('0x1e')]=qs[_0xb745('0x1e')](_0x26505a[_0xb745('0x30')]['offset']);}_0x5ba066[_0xb745('0x39')]=qs[_0xb745('0x3a')](_0x26505a['query'][_0xb745('0x3a')]);_0x5ba066[_0xb745('0x3b')]=qs[_0xb745('0x32')](_['pick'](_0x26505a['query'],_0x4e099e[_0xb745('0x32')]),_0x4b7853);if(_0x26505a[_0xb745('0x30')]['filter']){_0x5ba066['where']=_['merge'](_0x5ba066['where'],{'$or':_['map'](_0x4b7853,function(_0x536ac9){if(_0x536ac9[_0xb745('0x2c')]!==_0xb745('0x3c')){var _0xd37f31={};_0xd37f31[_0x536ac9[_0xb745('0x2f')]]={'$like':'%'+_0x26505a[_0xb745('0x30')][_0xb745('0x3d')]+'%'};return _0xd37f31;}})});}_0x5ba066=_[_0xb745('0x3e')]({},_0x5ba066,_0x26505a[_0xb745('0x3f')]);var _0x306e58={'where':_0x5ba066[_0xb745('0x3b')]};return db[_0xb745('0x2a')][_0xb745('0x1d')](_0x306e58)[_0xb745('0x25')](function(_0x299f9b){_0x531199[_0xb745('0x1d')]=_0x299f9b;if(_0x26505a[_0xb745('0x30')][_0xb745('0x40')]){_0x5ba066[_0xb745('0x41')]=[{'all':!![]}];}return db[_0xb745('0x2a')]['findAll'](_0x5ba066);})['then'](function(_0x1f032c){_0x531199[_0xb745('0x42')]=_0x1f032c;return _0x531199;})[_0xb745('0x25')](respondWithFilteredResult(_0x4a1971,_0x5ba066))[_0xb745('0x43')](handleError(_0x4a1971,null));};exports[_0xb745('0x44')]=function(_0x2a8ab5,_0x200e1b){var _0x455fbc={'raw':![],'where':{'id':_0x2a8ab5[_0xb745('0x45')]['id']}},_0x10ecfd={};_0x10ecfd[_0xb745('0x2e')]=_[_0xb745('0x31')](db['FreshsalesConfiguration'][_0xb745('0x46')]);_0x10ecfd[_0xb745('0x30')]=_[_0xb745('0x31')](_0x2a8ab5[_0xb745('0x30')]);_0x10ecfd['filters']=_[_0xb745('0x34')](_0x10ecfd[_0xb745('0x2e')],_0x10ecfd[_0xb745('0x30')]);_0x455fbc[_0xb745('0x33')]=_[_0xb745('0x34')](_0x10ecfd[_0xb745('0x2e')],qs['fields'](_0x2a8ab5[_0xb745('0x30')][_0xb745('0x35')]));_0x455fbc[_0xb745('0x33')]=_0x455fbc[_0xb745('0x33')][_0xb745('0x36')]?_0x455fbc[_0xb745('0x33')]:_0x10ecfd[_0xb745('0x2e')];if(_0x2a8ab5[_0xb745('0x30')]['includeAll']){_0x455fbc['include']=[{'all':!![]}];}_0x455fbc=_[_0xb745('0x3e')]({},_0x455fbc,_0x2a8ab5[_0xb745('0x3f')]);return db[_0xb745('0x2a')][_0xb745('0x47')](_0x455fbc)[_0xb745('0x25')](handleEntityNotFound(_0x200e1b,null))['then'](respondWithResult(_0x200e1b,null))['catch'](handleError(_0x200e1b,null));};exports['create']=function(_0x141c1b,_0x14b705){return db[_0xb745('0x2a')]['create'](_0x141c1b[_0xb745('0x48')],{})[_0xb745('0x25')](respondWithResult(_0x14b705,0xc9))[_0xb745('0x43')](handleError(_0x14b705,null));};exports[_0xb745('0x23')]=function(_0x341557,_0x181c9d){if(_0x341557[_0xb745('0x48')]['id']){delete _0x341557['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x341557[_0xb745('0x45')]['id']}})[_0xb745('0x25')](handleEntityNotFound(_0x181c9d,null))[_0xb745('0x25')](saveUpdates(_0x341557[_0xb745('0x48')],null))['then'](respondWithResult(_0x181c9d,null))[_0xb745('0x43')](handleError(_0x181c9d,null));};exports[_0xb745('0x24')]=function(_0x3b050f,_0x760a6){return db[_0xb745('0x2a')][_0xb745('0x47')]({'where':{'id':_0x3b050f['params']['id']}})[_0xb745('0x25')](handleEntityNotFound(_0x760a6,null))[_0xb745('0x25')](removeEntity(_0x760a6,null))[_0xb745('0x43')](handleError(_0x760a6,null));};exports[_0xb745('0x49')]=function(_0x50a619,_0x51e196,_0x306753){var _0x564d8c={};var _0x29682d={};var _0x42264a;var _0x431e6b;return db[_0xb745('0x2a')]['findOne']({'where':{'id':_0x50a619[_0xb745('0x45')]['id']}})['then'](handleEntityNotFound(_0x51e196,null))[_0xb745('0x25')](function(_0x503892){if(_0x503892){_0x42264a=_0x503892;_0x29682d[_0xb745('0x2e')]=_[_0xb745('0x31')](db[_0xb745('0x4a')]['rawAttributes']);_0x29682d['query']=_[_0xb745('0x31')](_0x50a619[_0xb745('0x30')]);_0x29682d['filters']=_[_0xb745('0x34')](_0x29682d[_0xb745('0x2e')],_0x29682d[_0xb745('0x30')]);_0x564d8c[_0xb745('0x33')]=_['intersection'](_0x29682d['model'],qs[_0xb745('0x35')](_0x50a619['query'][_0xb745('0x35')]));_0x564d8c['attributes']=_0x564d8c[_0xb745('0x33')][_0xb745('0x36')]?_0x564d8c['attributes']:_0x29682d[_0xb745('0x2e')];_0x564d8c[_0xb745('0x39')]=qs[_0xb745('0x3a')](_0x50a619[_0xb745('0x30')][_0xb745('0x3a')]);_0x564d8c[_0xb745('0x3b')]=qs['filters'](_[_0xb745('0x4b')](_0x50a619[_0xb745('0x30')],_0x29682d['filters']));if(_0x50a619[_0xb745('0x30')][_0xb745('0x3d')]){_0x564d8c['where']=_['merge'](_0x564d8c[_0xb745('0x3b')],{'$or':_[_0xb745('0x29')](_0x564d8c[_0xb745('0x33')],function(_0x2aed1e){var _0x1015e5={};_0x1015e5[_0x2aed1e]={'$like':'%'+_0x50a619[_0xb745('0x30')][_0xb745('0x3d')]+'%'};return _0x1015e5;})});}_0x564d8c=_[_0xb745('0x3e')]({},_0x564d8c,_0x50a619[_0xb745('0x3f')]);return _0x42264a['getSubjects'](_0x564d8c);}})['then'](function(_0x41e06a){if(_0x41e06a){_0x431e6b=_0x41e06a['length'];if(!_0x50a619[_0xb745('0x30')]['hasOwnProperty'](_0xb745('0x38'))){_0x564d8c[_0xb745('0x1c')]=qs[_0xb745('0x1c')](_0x50a619[_0xb745('0x30')][_0xb745('0x1c')]);_0x564d8c[_0xb745('0x1e')]=qs[_0xb745('0x1e')](_0x50a619[_0xb745('0x30')][_0xb745('0x1e')]);}return _0x42264a[_0xb745('0x49')](_0x564d8c);}})[_0xb745('0x25')](function(_0x59cc45){if(_0x59cc45){return _0x59cc45?{'count':_0x431e6b,'rows':_0x59cc45}:null;}})[_0xb745('0x25')](respondWithResult(_0x51e196,null))['catch'](handleError(_0x51e196,null));};exports[_0xb745('0x4c')]=function(_0x5daa89,_0x868c9a,_0x3d8474){var _0x24db69={};var _0x58c127={};var _0x356f1e;var _0x3eb954;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x5daa89[_0xb745('0x45')]['id']}})[_0xb745('0x25')](handleEntityNotFound(_0x868c9a,null))[_0xb745('0x25')](function(_0x2502bb){if(_0x2502bb){_0x356f1e=_0x2502bb;_0x58c127[_0xb745('0x2e')]=_[_0xb745('0x31')](db[_0xb745('0x4a')][_0xb745('0x46')]);_0x58c127[_0xb745('0x30')]=_[_0xb745('0x31')](_0x5daa89[_0xb745('0x30')]);_0x58c127['filters']=_[_0xb745('0x34')](_0x58c127['model'],_0x58c127[_0xb745('0x30')]);_0x24db69[_0xb745('0x33')]=_['intersection'](_0x58c127[_0xb745('0x2e')],qs[_0xb745('0x35')](_0x5daa89[_0xb745('0x30')][_0xb745('0x35')]));_0x24db69[_0xb745('0x33')]=_0x24db69[_0xb745('0x33')][_0xb745('0x36')]?_0x24db69[_0xb745('0x33')]:_0x58c127[_0xb745('0x2e')];_0x24db69[_0xb745('0x39')]=qs[_0xb745('0x3a')](_0x5daa89[_0xb745('0x30')][_0xb745('0x3a')]);_0x24db69[_0xb745('0x3b')]=qs['filters'](_[_0xb745('0x4b')](_0x5daa89[_0xb745('0x30')],_0x58c127[_0xb745('0x32')]));if(_0x5daa89[_0xb745('0x30')]['filter']){_0x24db69['where']=_['merge'](_0x24db69[_0xb745('0x3b')],{'$or':_['map'](_0x24db69['attributes'],function(_0x19c419){var _0x47f94f={};_0x47f94f[_0x19c419]={'$like':'%'+_0x5daa89['query'][_0xb745('0x3d')]+'%'};return _0x47f94f;})});}_0x24db69=_[_0xb745('0x3e')]({},_0x24db69,_0x5daa89[_0xb745('0x3f')]);return _0x356f1e[_0xb745('0x4c')](_0x24db69);}})[_0xb745('0x25')](function(_0x1936b3){if(_0x1936b3){_0x3eb954=_0x1936b3['length'];if(!_0x5daa89['query'][_0xb745('0x37')](_0xb745('0x38'))){_0x24db69[_0xb745('0x1c')]=qs['limit'](_0x5daa89['query']['limit']);_0x24db69[_0xb745('0x1e')]=qs[_0xb745('0x1e')](_0x5daa89[_0xb745('0x30')][_0xb745('0x1e')]);}return _0x356f1e[_0xb745('0x4c')](_0x24db69);}})[_0xb745('0x25')](function(_0x11ae34){if(_0x11ae34){return _0x11ae34?{'count':_0x3eb954,'rows':_0x11ae34}:null;}})[_0xb745('0x25')](respondWithResult(_0x868c9a,null))[_0xb745('0x43')](handleError(_0x868c9a,null));};exports[_0xb745('0x4d')]=function(_0x89c9d5,_0x31b73e,_0x2b89a8){var _0x2b93ea={};var _0x33dee5={};var _0x4d69cc;var _0xa57399;return db[_0xb745('0x2a')][_0xb745('0x4e')]({'where':{'id':_0x89c9d5[_0xb745('0x45')]['id']}})[_0xb745('0x25')](handleEntityNotFound(_0x31b73e,null))[_0xb745('0x25')](function(_0x4884c8){if(_0x4884c8){_0x4d69cc=_0x4884c8;_0x33dee5[_0xb745('0x2e')]=_[_0xb745('0x31')](db['FreshsalesField']['rawAttributes']);_0x33dee5[_0xb745('0x30')]=_['keys'](_0x89c9d5[_0xb745('0x30')]);_0x33dee5['filters']=_[_0xb745('0x34')](_0x33dee5[_0xb745('0x2e')],_0x33dee5[_0xb745('0x30')]);_0x2b93ea[_0xb745('0x33')]=_[_0xb745('0x34')](_0x33dee5['model'],qs[_0xb745('0x35')](_0x89c9d5[_0xb745('0x30')]['fields']));_0x2b93ea[_0xb745('0x33')]=_0x2b93ea[_0xb745('0x33')][_0xb745('0x36')]?_0x2b93ea[_0xb745('0x33')]:_0x33dee5[_0xb745('0x2e')];_0x2b93ea[_0xb745('0x39')]=qs['sort'](_0x89c9d5[_0xb745('0x30')]['sort']);_0x2b93ea[_0xb745('0x3b')]=qs[_0xb745('0x32')](_[_0xb745('0x4b')](_0x89c9d5[_0xb745('0x30')],_0x33dee5[_0xb745('0x32')]));if(_0x89c9d5[_0xb745('0x30')][_0xb745('0x3d')]){_0x2b93ea[_0xb745('0x3b')]=_[_0xb745('0x3e')](_0x2b93ea[_0xb745('0x3b')],{'$or':_[_0xb745('0x29')](_0x2b93ea[_0xb745('0x33')],function(_0x3a2557){var _0x33e6ea={};_0x33e6ea[_0x3a2557]={'$like':'%'+_0x89c9d5[_0xb745('0x30')][_0xb745('0x3d')]+'%'};return _0x33e6ea;})});}_0x2b93ea=_['merge']({},_0x2b93ea,_0x89c9d5[_0xb745('0x3f')]);return _0x4d69cc['getFields'](_0x2b93ea);}})[_0xb745('0x25')](function(_0x3638e8){if(_0x3638e8){_0xa57399=_0x3638e8[_0xb745('0x36')];if(!_0x89c9d5[_0xb745('0x30')][_0xb745('0x37')](_0xb745('0x38'))){_0x2b93ea[_0xb745('0x1c')]=qs[_0xb745('0x1c')](_0x89c9d5[_0xb745('0x30')][_0xb745('0x1c')]);_0x2b93ea['offset']=qs[_0xb745('0x1e')](_0x89c9d5[_0xb745('0x30')][_0xb745('0x1e')]);}return _0x4d69cc['getFields'](_0x2b93ea);}})[_0xb745('0x25')](function(_0x38c276){if(_0x38c276){return _0x38c276?{'count':_0xa57399,'rows':_0x38c276}:null;}})[_0xb745('0x25')](respondWithResult(_0x31b73e,null))[_0xb745('0x43')](handleError(_0x31b73e,null));}; \ No newline at end of file +var _0x9b75=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','rows','show','params','find','catch','create','body','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x9b75,0x1b5));var _0x59b7=function(_0x110111,_0x5bd611){_0x110111=_0x110111-0x0;var _0x1b3440=_0x9b75[_0x110111];return _0x1b3440;};'use strict';var emlformat=require(_0x59b7('0x0'));var rimraf=require(_0x59b7('0x1'));var zipdir=require(_0x59b7('0x2'));var jsonpatch=require(_0x59b7('0x3'));var rp=require(_0x59b7('0x4'));var moment=require('moment');var BPromise=require(_0x59b7('0x5'));var Mustache=require(_0x59b7('0x6'));var util=require(_0x59b7('0x7'));var path=require(_0x59b7('0x8'));var sox=require(_0x59b7('0x9'));var csv=require('to-csv');var ejs=require(_0x59b7('0xa'));var fs=require('fs');var fs_extra=require(_0x59b7('0xb'));var _=require(_0x59b7('0xc'));var squel=require(_0x59b7('0xd'));var crypto=require(_0x59b7('0xe'));var jsforce=require(_0x59b7('0xf'));var deskjs=require(_0x59b7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x59b7('0x11'));var Papa=require(_0x59b7('0x12'));var Redis=require(_0x59b7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x59b7('0x14'));var as=require(_0x59b7('0x15'));var hardwareService=require(_0x59b7('0x16'));var logger=require('../../config/logger')(_0x59b7('0x17'));var utils=require(_0x59b7('0x18'));var config=require(_0x59b7('0x19'));var licenseUtil=require(_0x59b7('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aee16,_0x5a7cc9){_0x5a7cc9=_0x5a7cc9||0xcc;return function(_0x4d59eb){if(_0x4d59eb){return _0x4aee16[_0x59b7('0x1b')](_0x5a7cc9);}return _0x4aee16[_0x59b7('0x1c')](_0x5a7cc9)['end']();};}function respondWithResult(_0x354222,_0x4ffec0){_0x4ffec0=_0x4ffec0||0xc8;return function(_0x21066a){if(_0x21066a){return _0x354222[_0x59b7('0x1c')](_0x4ffec0)[_0x59b7('0x1d')](_0x21066a);}};}function respondWithFilteredResult(_0x58ad8e,_0x33ddc5){return function(_0x5c6b9f){if(_0x5c6b9f){var _0x18821a=typeof _0x33ddc5[_0x59b7('0x1e')]==='undefined'&&typeof _0x33ddc5[_0x59b7('0x1f')]===_0x59b7('0x20');var _0x244af7=_0x5c6b9f[_0x59b7('0x21')];var _0x1d330a=_0x18821a?0x0:_0x33ddc5[_0x59b7('0x1e')];var _0x102836=_0x18821a?_0x5c6b9f[_0x59b7('0x21')]:_0x33ddc5[_0x59b7('0x1e')]+_0x33ddc5[_0x59b7('0x1f')];var _0x146aa1;if(_0x102836>=_0x244af7){_0x102836=_0x244af7;_0x146aa1=0xc8;}else{_0x146aa1=0xce;}_0x58ad8e[_0x59b7('0x1c')](_0x146aa1);return _0x58ad8e[_0x59b7('0x22')](_0x59b7('0x23'),_0x1d330a+'-'+_0x102836+'/'+_0x244af7)[_0x59b7('0x1d')](_0x5c6b9f);}return null;};}function patchUpdates(_0x5500be){return function(_0x4fb863){try{jsonpatch[_0x59b7('0x24')](_0x4fb863,_0x5500be,!![]);}catch(_0x37f325){return BPromise['reject'](_0x37f325);}return _0x4fb863['save']();};}function saveUpdates(_0x2358a2,_0x5e2ae6){return function(_0x566347){if(_0x566347){return _0x566347[_0x59b7('0x25')](_0x2358a2)[_0x59b7('0x26')](function(_0xb73654){return _0xb73654;});}return null;};}function removeEntity(_0x2ea5a3,_0x3fde9f){return function(_0xa4d81){if(_0xa4d81){return _0xa4d81['destroy']()['then'](function(){_0x2ea5a3[_0x59b7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4830ec,_0x4be5d5){return function(_0x3904d1){if(!_0x3904d1){_0x4830ec[_0x59b7('0x1b')](0x194);}return _0x3904d1;};}function handleError(_0x6fe1bc,_0x3d62f3){_0x3d62f3=_0x3d62f3||0x1f4;return function(_0x5a8aaf){logger[_0x59b7('0x27')](_0x5a8aaf['stack']);if(_0x5a8aaf[_0x59b7('0x28')]){delete _0x5a8aaf[_0x59b7('0x28')];}_0x6fe1bc[_0x59b7('0x1c')](_0x3d62f3)[_0x59b7('0x29')](_0x5a8aaf);};}exports[_0x59b7('0x2a')]=function(_0x18ef8c,_0x35eace){var _0x4fa72e={},_0x4d72b7={},_0x3632a7={'count':0x0,'rows':[]};var _0x26abad=_[_0x59b7('0x2b')](db['FreshsalesConfiguration'][_0x59b7('0x2c')],function(_0x4ee562){return{'name':_0x4ee562[_0x59b7('0x2d')],'type':_0x4ee562[_0x59b7('0x2e')][_0x59b7('0x2f')]};});_0x4d72b7['model']=_[_0x59b7('0x2b')](_0x26abad,_0x59b7('0x28'));_0x4d72b7[_0x59b7('0x30')]=_[_0x59b7('0x31')](_0x18ef8c[_0x59b7('0x30')]);_0x4d72b7[_0x59b7('0x32')]=_['intersection'](_0x4d72b7[_0x59b7('0x33')],_0x4d72b7['query']);_0x4fa72e['attributes']=_[_0x59b7('0x34')](_0x4d72b7[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x18ef8c['query'][_0x59b7('0x35')]));_0x4fa72e['attributes']=_0x4fa72e[_0x59b7('0x36')][_0x59b7('0x37')]?_0x4fa72e[_0x59b7('0x36')]:_0x4d72b7[_0x59b7('0x33')];if(!_0x18ef8c[_0x59b7('0x30')][_0x59b7('0x38')](_0x59b7('0x39'))){_0x4fa72e[_0x59b7('0x1f')]=qs[_0x59b7('0x1f')](_0x18ef8c[_0x59b7('0x30')][_0x59b7('0x1f')]);_0x4fa72e[_0x59b7('0x1e')]=qs['offset'](_0x18ef8c[_0x59b7('0x30')][_0x59b7('0x1e')]);}_0x4fa72e[_0x59b7('0x3a')]=qs[_0x59b7('0x3b')](_0x18ef8c['query'][_0x59b7('0x3b')]);_0x4fa72e[_0x59b7('0x3c')]=qs[_0x59b7('0x32')](_[_0x59b7('0x3d')](_0x18ef8c[_0x59b7('0x30')],_0x4d72b7[_0x59b7('0x32')]),_0x26abad);if(_0x18ef8c['query'][_0x59b7('0x3e')]){_0x4fa72e['where']=_[_0x59b7('0x3f')](_0x4fa72e[_0x59b7('0x3c')],{'$or':_[_0x59b7('0x2b')](_0x26abad,function(_0x17f3fb){if(_0x17f3fb[_0x59b7('0x2e')]!==_0x59b7('0x40')){var _0x5081e0={};_0x5081e0[_0x17f3fb[_0x59b7('0x28')]]={'$like':'%'+_0x18ef8c['query'][_0x59b7('0x3e')]+'%'};return _0x5081e0;}})});}_0x4fa72e=_[_0x59b7('0x3f')]({},_0x4fa72e,_0x18ef8c[_0x59b7('0x41')]);var _0x48790c={'where':_0x4fa72e[_0x59b7('0x3c')]};return db[_0x59b7('0x42')][_0x59b7('0x21')](_0x48790c)[_0x59b7('0x26')](function(_0x58b52a){_0x3632a7[_0x59b7('0x21')]=_0x58b52a;if(_0x18ef8c[_0x59b7('0x30')][_0x59b7('0x43')]){_0x4fa72e[_0x59b7('0x44')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x59b7('0x45')](_0x4fa72e);})[_0x59b7('0x26')](function(_0x5bf414){_0x3632a7[_0x59b7('0x46')]=_0x5bf414;return _0x3632a7;})[_0x59b7('0x26')](respondWithFilteredResult(_0x35eace,_0x4fa72e))['catch'](handleError(_0x35eace,null));};exports[_0x59b7('0x47')]=function(_0x203ca9,_0x35c928){var _0x3ce0f2={'raw':![],'where':{'id':_0x203ca9[_0x59b7('0x48')]['id']}},_0x42bc1b={};_0x42bc1b[_0x59b7('0x33')]=_[_0x59b7('0x31')](db[_0x59b7('0x42')][_0x59b7('0x2c')]);_0x42bc1b['query']=_[_0x59b7('0x31')](_0x203ca9['query']);_0x42bc1b[_0x59b7('0x32')]=_[_0x59b7('0x34')](_0x42bc1b['model'],_0x42bc1b['query']);_0x3ce0f2[_0x59b7('0x36')]=_[_0x59b7('0x34')](_0x42bc1b['model'],qs[_0x59b7('0x35')](_0x203ca9[_0x59b7('0x30')][_0x59b7('0x35')]));_0x3ce0f2[_0x59b7('0x36')]=_0x3ce0f2[_0x59b7('0x36')]['length']?_0x3ce0f2[_0x59b7('0x36')]:_0x42bc1b[_0x59b7('0x33')];if(_0x203ca9[_0x59b7('0x30')][_0x59b7('0x43')]){_0x3ce0f2[_0x59b7('0x44')]=[{'all':!![]}];}_0x3ce0f2=_['merge']({},_0x3ce0f2,_0x203ca9[_0x59b7('0x41')]);return db[_0x59b7('0x42')][_0x59b7('0x49')](_0x3ce0f2)['then'](handleEntityNotFound(_0x35c928,null))[_0x59b7('0x26')](respondWithResult(_0x35c928,null))[_0x59b7('0x4a')](handleError(_0x35c928,null));};exports['create']=function(_0x401dfb,_0x5d57d6){return db[_0x59b7('0x42')][_0x59b7('0x4b')](_0x401dfb[_0x59b7('0x4c')],{})[_0x59b7('0x26')](respondWithResult(_0x5d57d6,0xc9))['catch'](handleError(_0x5d57d6,null));};exports[_0x59b7('0x25')]=function(_0x4b71a7,_0x49f750){if(_0x4b71a7[_0x59b7('0x4c')]['id']){delete _0x4b71a7[_0x59b7('0x4c')]['id'];}return db[_0x59b7('0x42')][_0x59b7('0x49')]({'where':{'id':_0x4b71a7[_0x59b7('0x48')]['id']}})[_0x59b7('0x26')](handleEntityNotFound(_0x49f750,null))[_0x59b7('0x26')](saveUpdates(_0x4b71a7[_0x59b7('0x4c')],null))['then'](respondWithResult(_0x49f750,null))['catch'](handleError(_0x49f750,null));};exports['destroy']=function(_0x23bdfa,_0x9f7baf){return db[_0x59b7('0x42')][_0x59b7('0x49')]({'where':{'id':_0x23bdfa['params']['id']}})['then'](handleEntityNotFound(_0x9f7baf,null))[_0x59b7('0x26')](removeEntity(_0x9f7baf,null))['catch'](handleError(_0x9f7baf,null));};exports[_0x59b7('0x4d')]=function(_0xc2aef3,_0x1dc11b,_0x31ba27){var _0xc0fe0a={};var _0x30af50={};var _0x1fd921;var _0x2e5328;return db[_0x59b7('0x42')]['findOne']({'where':{'id':_0xc2aef3[_0x59b7('0x48')]['id']}})[_0x59b7('0x26')](handleEntityNotFound(_0x1dc11b,null))[_0x59b7('0x26')](function(_0x8d7609){if(_0x8d7609){_0x1fd921=_0x8d7609;_0x30af50['model']=_['keys'](db[_0x59b7('0x4e')][_0x59b7('0x2c')]);_0x30af50[_0x59b7('0x30')]=_[_0x59b7('0x31')](_0xc2aef3[_0x59b7('0x30')]);_0x30af50[_0x59b7('0x32')]=_[_0x59b7('0x34')](_0x30af50[_0x59b7('0x33')],_0x30af50['query']);_0xc0fe0a[_0x59b7('0x36')]=_[_0x59b7('0x34')](_0x30af50['model'],qs['fields'](_0xc2aef3['query'][_0x59b7('0x35')]));_0xc0fe0a['attributes']=_0xc0fe0a[_0x59b7('0x36')][_0x59b7('0x37')]?_0xc0fe0a[_0x59b7('0x36')]:_0x30af50['model'];_0xc0fe0a['order']=qs['sort'](_0xc2aef3[_0x59b7('0x30')][_0x59b7('0x3b')]);_0xc0fe0a[_0x59b7('0x3c')]=qs[_0x59b7('0x32')](_[_0x59b7('0x3d')](_0xc2aef3[_0x59b7('0x30')],_0x30af50[_0x59b7('0x32')]));if(_0xc2aef3[_0x59b7('0x30')][_0x59b7('0x3e')]){_0xc0fe0a[_0x59b7('0x3c')]=_[_0x59b7('0x3f')](_0xc0fe0a[_0x59b7('0x3c')],{'$or':_[_0x59b7('0x2b')](_0xc0fe0a[_0x59b7('0x36')],function(_0x303a9b){var _0x37c70e={};_0x37c70e[_0x303a9b]={'$like':'%'+_0xc2aef3[_0x59b7('0x30')][_0x59b7('0x3e')]+'%'};return _0x37c70e;})});}_0xc0fe0a=_[_0x59b7('0x3f')]({},_0xc0fe0a,_0xc2aef3[_0x59b7('0x41')]);return _0x1fd921['getSubjects'](_0xc0fe0a);}})[_0x59b7('0x26')](function(_0x5ca61a){if(_0x5ca61a){_0x2e5328=_0x5ca61a['length'];if(!_0xc2aef3[_0x59b7('0x30')][_0x59b7('0x38')](_0x59b7('0x39'))){_0xc0fe0a[_0x59b7('0x1f')]=qs[_0x59b7('0x1f')](_0xc2aef3[_0x59b7('0x30')]['limit']);_0xc0fe0a['offset']=qs[_0x59b7('0x1e')](_0xc2aef3[_0x59b7('0x30')][_0x59b7('0x1e')]);}return _0x1fd921['getSubjects'](_0xc0fe0a);}})[_0x59b7('0x26')](function(_0x5726ba){if(_0x5726ba){return _0x5726ba?{'count':_0x2e5328,'rows':_0x5726ba}:null;}})['then'](respondWithResult(_0x1dc11b,null))['catch'](handleError(_0x1dc11b,null));};exports[_0x59b7('0x4f')]=function(_0x2d2ed8,_0x3a946e,_0x5c83b0){var _0x52bc8f={};var _0x15fa20={};var _0x382023;var _0x3b3ec9;return db[_0x59b7('0x42')][_0x59b7('0x50')]({'where':{'id':_0x2d2ed8[_0x59b7('0x48')]['id']}})[_0x59b7('0x26')](handleEntityNotFound(_0x3a946e,null))[_0x59b7('0x26')](function(_0x5610bd){if(_0x5610bd){_0x382023=_0x5610bd;_0x15fa20[_0x59b7('0x33')]=_['keys'](db['FreshsalesField'][_0x59b7('0x2c')]);_0x15fa20[_0x59b7('0x30')]=_[_0x59b7('0x31')](_0x2d2ed8[_0x59b7('0x30')]);_0x15fa20[_0x59b7('0x32')]=_[_0x59b7('0x34')](_0x15fa20[_0x59b7('0x33')],_0x15fa20[_0x59b7('0x30')]);_0x52bc8f['attributes']=_[_0x59b7('0x34')](_0x15fa20[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x2d2ed8[_0x59b7('0x30')]['fields']));_0x52bc8f[_0x59b7('0x36')]=_0x52bc8f[_0x59b7('0x36')][_0x59b7('0x37')]?_0x52bc8f[_0x59b7('0x36')]:_0x15fa20['model'];_0x52bc8f['order']=qs['sort'](_0x2d2ed8[_0x59b7('0x30')][_0x59b7('0x3b')]);_0x52bc8f[_0x59b7('0x3c')]=qs[_0x59b7('0x32')](_['pick'](_0x2d2ed8[_0x59b7('0x30')],_0x15fa20['filters']));if(_0x2d2ed8[_0x59b7('0x30')]['filter']){_0x52bc8f[_0x59b7('0x3c')]=_['merge'](_0x52bc8f[_0x59b7('0x3c')],{'$or':_[_0x59b7('0x2b')](_0x52bc8f[_0x59b7('0x36')],function(_0x3859e1){var _0x51efd4={};_0x51efd4[_0x3859e1]={'$like':'%'+_0x2d2ed8[_0x59b7('0x30')]['filter']+'%'};return _0x51efd4;})});}_0x52bc8f=_['merge']({},_0x52bc8f,_0x2d2ed8[_0x59b7('0x41')]);return _0x382023['getDescriptions'](_0x52bc8f);}})[_0x59b7('0x26')](function(_0x255584){if(_0x255584){_0x3b3ec9=_0x255584[_0x59b7('0x37')];if(!_0x2d2ed8[_0x59b7('0x30')][_0x59b7('0x38')](_0x59b7('0x39'))){_0x52bc8f[_0x59b7('0x1f')]=qs[_0x59b7('0x1f')](_0x2d2ed8['query'][_0x59b7('0x1f')]);_0x52bc8f[_0x59b7('0x1e')]=qs[_0x59b7('0x1e')](_0x2d2ed8[_0x59b7('0x30')]['offset']);}return _0x382023[_0x59b7('0x4f')](_0x52bc8f);}})['then'](function(_0xcd149f){if(_0xcd149f){return _0xcd149f?{'count':_0x3b3ec9,'rows':_0xcd149f}:null;}})['then'](respondWithResult(_0x3a946e,null))[_0x59b7('0x4a')](handleError(_0x3a946e,null));};exports[_0x59b7('0x51')]=function(_0x1982b9,_0x1235df,_0x3f1712){var _0x5b72b0={};var _0x1824d0={};var _0x25f52d;var _0x5ee2e0;return db['FreshsalesConfiguration'][_0x59b7('0x50')]({'where':{'id':_0x1982b9[_0x59b7('0x48')]['id']}})[_0x59b7('0x26')](handleEntityNotFound(_0x1235df,null))[_0x59b7('0x26')](function(_0x5467cf){if(_0x5467cf){_0x25f52d=_0x5467cf;_0x1824d0[_0x59b7('0x33')]=_[_0x59b7('0x31')](db[_0x59b7('0x4e')][_0x59b7('0x2c')]);_0x1824d0['query']=_[_0x59b7('0x31')](_0x1982b9[_0x59b7('0x30')]);_0x1824d0[_0x59b7('0x32')]=_[_0x59b7('0x34')](_0x1824d0['model'],_0x1824d0[_0x59b7('0x30')]);_0x5b72b0['attributes']=_[_0x59b7('0x34')](_0x1824d0[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x1982b9['query']['fields']));_0x5b72b0[_0x59b7('0x36')]=_0x5b72b0['attributes'][_0x59b7('0x37')]?_0x5b72b0[_0x59b7('0x36')]:_0x1824d0[_0x59b7('0x33')];_0x5b72b0[_0x59b7('0x3a')]=qs[_0x59b7('0x3b')](_0x1982b9[_0x59b7('0x30')][_0x59b7('0x3b')]);_0x5b72b0[_0x59b7('0x3c')]=qs[_0x59b7('0x32')](_[_0x59b7('0x3d')](_0x1982b9[_0x59b7('0x30')],_0x1824d0[_0x59b7('0x32')]));if(_0x1982b9['query'][_0x59b7('0x3e')]){_0x5b72b0[_0x59b7('0x3c')]=_['merge'](_0x5b72b0[_0x59b7('0x3c')],{'$or':_[_0x59b7('0x2b')](_0x5b72b0[_0x59b7('0x36')],function(_0x4e1b61){var _0x4b9202={};_0x4b9202[_0x4e1b61]={'$like':'%'+_0x1982b9['query'][_0x59b7('0x3e')]+'%'};return _0x4b9202;})});}_0x5b72b0=_['merge']({},_0x5b72b0,_0x1982b9[_0x59b7('0x41')]);return _0x25f52d[_0x59b7('0x51')](_0x5b72b0);}})[_0x59b7('0x26')](function(_0x28c5d9){if(_0x28c5d9){_0x5ee2e0=_0x28c5d9['length'];if(!_0x1982b9[_0x59b7('0x30')][_0x59b7('0x38')](_0x59b7('0x39'))){_0x5b72b0['limit']=qs[_0x59b7('0x1f')](_0x1982b9['query'][_0x59b7('0x1f')]);_0x5b72b0[_0x59b7('0x1e')]=qs['offset'](_0x1982b9[_0x59b7('0x30')][_0x59b7('0x1e')]);}return _0x25f52d[_0x59b7('0x51')](_0x5b72b0);}})[_0x59b7('0x26')](function(_0x1a659){if(_0x1a659){return _0x1a659?{'count':_0x5ee2e0,'rows':_0x1a659}:null;}})['then'](respondWithResult(_0x1235df,null))['catch'](handleError(_0x1235df,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 079eeca..0b33e16 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 _0xb55b=['define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb55b,0x189));var _0xbb55=function(_0x163705,_0xc6498f){_0x163705=_0x163705-0x0;var _0x53ad0f=_0xb55b[_0x163705];return _0x53ad0f;};'use strict';var _=require(_0xbb55('0x0'));var util=require(_0xbb55('0x1'));var logger=require(_0xbb55('0x2'))('api');var moment=require(_0xbb55('0x3'));var BPromise=require(_0xbb55('0x4'));var rp=require(_0xbb55('0x5'));var fs=require('fs');var path=require(_0xbb55('0x6'));var rimraf=require('rimraf');var config=require(_0xbb55('0x7'));var attributes=require(_0xbb55('0x8'));module[_0xbb55('0x9')]=function(_0x2aac53,_0x2c7c01){return _0x2aac53[_0xbb55('0xa')](_0xbb55('0xb'),attributes,{'tableName':_0xbb55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x133b=['moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x133b,0xcd));var _0xb133=function(_0xf989bb,_0xf66855){_0xf989bb=_0xf989bb-0x0;var _0xe97ff3=_0x133b[_0xf989bb];return _0xe97ff3;};'use strict';var _=require(_0xb133('0x0'));var util=require('util');var logger=require(_0xb133('0x1'))(_0xb133('0x2'));var moment=require(_0xb133('0x3'));var BPromise=require(_0xb133('0x4'));var rp=require(_0xb133('0x5'));var fs=require('fs');var path=require(_0xb133('0x6'));var rimraf=require('rimraf');var config=require(_0xb133('0x7'));var attributes=require(_0xb133('0x8'));module[_0xb133('0x9')]=function(_0x3ccb87,_0x18a072){return _0x3ccb87[_0xb133('0xa')](_0xb133('0xb'),attributes,{'tableName':_0xb133('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 61df821..5c617ef 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 _0x2555=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x442ccd,_0x415d61){var _0x1a2c10=function(_0x4ddd45){while(--_0x4ddd45){_0x442ccd['push'](_0x442ccd['shift']());}};_0x1a2c10(++_0x415d61);}(_0x2555,0xf8));var _0x5255=function(_0x2af61a,_0x5c7f76){_0x2af61a=_0x2af61a-0x0;var _0x1ae3b0=_0x2555[_0x2af61a];return _0x1ae3b0;};'use strict';var _=require(_0x5255('0x0'));var util=require(_0x5255('0x1'));var moment=require('moment');var BPromise=require(_0x5255('0x2'));var rs=require(_0x5255('0x3'));var fs=require('fs');var Redis=require(_0x5255('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5255('0x5'));var logger=require(_0x5255('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5255('0x7')][_0x5255('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x185e8d,_0x214fb4,_0x1ca019){return new BPromise(function(_0x51e8e9,_0x321caa){return client[_0x5255('0x9')](_0x185e8d,_0x1ca019)['then'](function(_0x5c6c82){logger[_0x5255('0xa')](_0x5255('0xb'),_0x214fb4,_0x5255('0xc'));logger['debug'](_0x5255('0xd'),_0x214fb4,_0x5255('0xc'),JSON[_0x5255('0xe')](_0x5c6c82));if(_0x5c6c82[_0x5255('0xf')]){if(_0x5c6c82[_0x5255('0xf')][_0x5255('0x10')]===0x1f4){logger['error'](_0x5255('0xb'),_0x214fb4,_0x5c6c82[_0x5255('0xf')][_0x5255('0x11')]);return _0x321caa(_0x5c6c82['error'][_0x5255('0x11')]);}logger[_0x5255('0xf')](_0x5255('0xb'),_0x214fb4,_0x5c6c82[_0x5255('0xf')][_0x5255('0x11')]);return _0x51e8e9(_0x5c6c82[_0x5255('0xf')][_0x5255('0x11')]);}else{logger[_0x5255('0xa')](_0x5255('0xb'),_0x214fb4,_0x5255('0xc'));_0x51e8e9(_0x5c6c82['result'][_0x5255('0x11')]);}})[_0x5255('0x12')](function(_0x3da8a3){logger['error'](_0x5255('0xb'),_0x214fb4,_0x3da8a3);_0x321caa(_0x3da8a3);});});} \ No newline at end of file +var _0xe1ed=['jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xe1ed,0x7b));var _0xde1e=function(_0x29b8c1,_0x20140f){_0x29b8c1=_0x29b8c1-0x0;var _0xda1c47=_0xe1ed[_0x29b8c1];return _0xda1c47;};'use strict';var _=require(_0xde1e('0x0'));var util=require(_0xde1e('0x1'));var moment=require('moment');var BPromise=require(_0xde1e('0x2'));var rs=require(_0xde1e('0x3'));var fs=require('fs');var Redis=require(_0xde1e('0x4'));var db=require(_0xde1e('0x5'))['db'];var utils=require(_0xde1e('0x6'));var logger=require(_0xde1e('0x7'))('rpc');var config=require(_0xde1e('0x8'));var jayson=require(_0xde1e('0x9'));var client=jayson[_0xde1e('0xa')][_0xde1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b9160,_0xd0e9d5,_0x113611){return new BPromise(function(_0x57f4f0,_0xab0971){return client[_0xde1e('0xc')](_0x1b9160,_0x113611)[_0xde1e('0xd')](function(_0x2342a1){logger[_0xde1e('0xe')](_0xde1e('0xf'),_0xd0e9d5,_0xde1e('0x10'));logger['debug'](_0xde1e('0x11'),_0xd0e9d5,_0xde1e('0x10'),JSON[_0xde1e('0x12')](_0x2342a1));if(_0x2342a1['error']){if(_0x2342a1[_0xde1e('0x13')][_0xde1e('0x14')]===0x1f4){logger[_0xde1e('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xd0e9d5,_0x2342a1['error'][_0xde1e('0x15')]);return _0xab0971(_0x2342a1[_0xde1e('0x13')][_0xde1e('0x15')]);}logger[_0xde1e('0x13')](_0xde1e('0xf'),_0xd0e9d5,_0x2342a1['error']['message']);return _0x57f4f0(_0x2342a1[_0xde1e('0x13')][_0xde1e('0x15')]);}else{logger[_0xde1e('0xe')](_0xde1e('0xf'),_0xd0e9d5,'request\x20sent');_0x57f4f0(_0x2342a1['result'][_0xde1e('0x15')]);}})['catch'](function(_0x3295c9){logger[_0xde1e('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xd0e9d5,_0x3295c9);_0xab0971(_0x3295c9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 17f5060..506493e 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 _0x0434=['./intFreshsalesField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15929e,_0x4bdde5){var _0x5ecb1d=function(_0x9cfaa3){while(--_0x9cfaa3){_0x15929e['push'](_0x15929e['shift']());}};_0x5ecb1d(++_0x4bdde5);}(_0x0434,0x1ad));var _0x4043=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x0434[_0x40822a];return _0x357420;};'use strict';var multer=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var path=require(_0x4043('0x2'));var timeout=require(_0x4043('0x3'));var express=require(_0x4043('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4043('0x5'));var interaction=require(_0x4043('0x6'));var config=require(_0x4043('0x7'));var controller=require(_0x4043('0x8'));router[_0x4043('0x9')]('/',auth[_0x4043('0xa')](),controller['index']);router[_0x4043('0x9')](_0x4043('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4043('0xc')]('/',auth[_0x4043('0xa')](),controller[_0x4043('0xd')]);router[_0x4043('0xe')](_0x4043('0xb'),auth[_0x4043('0xa')](),controller[_0x4043('0xf')]);router[_0x4043('0x10')]('/:id',auth[_0x4043('0xa')](),controller[_0x4043('0x11')]);module[_0x4043('0x12')]=router; \ No newline at end of file +var _0x44f8=['path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','put','update','exports','multer','util'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x44f8,0x1de));var _0x844f=function(_0x1c3019,_0x181b03){_0x1c3019=_0x1c3019-0x0;var _0x58823f=_0x44f8[_0x1c3019];return _0x58823f;};'use strict';var multer=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var path=require(_0x844f('0x2'));var timeout=require(_0x844f('0x3'));var express=require(_0x844f('0x4'));var router=express[_0x844f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x844f('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x844f('0x7')](),controller[_0x844f('0x8')]);router[_0x844f('0x9')](_0x844f('0xa'),auth[_0x844f('0x7')](),controller[_0x844f('0xb')]);router[_0x844f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x844f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x844f('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x844f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0c7b37c..9eadbfe 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 _0x7da9=['exports','ENUM','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x7da9,0x133));var _0x97da=function(_0x12f15f,_0x523b43){_0x12f15f=_0x12f15f-0x0;var _0x3faa6a=_0x7da9[_0x12f15f];return _0x3faa6a;};'use strict';var Sequelize=require(_0x97da('0x0'));module[_0x97da('0x1')]={'type':{'type':Sequelize[_0x97da('0x2')]('string','variable',_0x97da('0x3'),_0x97da('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x97da('0x5')]},'key':{'type':Sequelize[_0x97da('0x5')]},'keyType':{'type':Sequelize[_0x97da('0x2')]('string','variable',_0x97da('0x3'))},'keyContent':{'type':Sequelize[_0x97da('0x5')]},'idField':{'type':Sequelize[_0x97da('0x5')]},'nameField':{'type':Sequelize[_0x97da('0x5')]},'customField':{'type':Sequelize[_0x97da('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97da('0x5')]}}; \ No newline at end of file +var _0x5bc2=['customVariable','picklist','STRING','variable','BOOLEAN','ENUM','string'];(function(_0x1a8cdf,_0x55b49a){var _0x5e5684=function(_0x556c4f){while(--_0x556c4f){_0x1a8cdf['push'](_0x1a8cdf['shift']());}};_0x5e5684(++_0x55b49a);}(_0x5bc2,0xd0));var _0x25bc=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x5bc2[_0x4bfade];return _0x272465;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x25bc('0x0')](_0x25bc('0x1'),'variable',_0x25bc('0x2'),'keyValue',_0x25bc('0x3')),'defaultValue':_0x25bc('0x1')},'content':{'type':Sequelize[_0x25bc('0x4')]},'key':{'type':Sequelize[_0x25bc('0x4')]},'keyType':{'type':Sequelize[_0x25bc('0x0')](_0x25bc('0x1'),_0x25bc('0x5'),_0x25bc('0x2'))},'keyContent':{'type':Sequelize[_0x25bc('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25bc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25bc('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index a6bb807..e7198c2 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 _0x094c=['offset','limit','undefined','set','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x1f05a8,_0x195e47){var _0x51cb4e=function(_0x27367d){while(--_0x27367d){_0x1f05a8['push'](_0x1f05a8['shift']());}};_0x51cb4e(++_0x195e47);}(_0x094c,0x16a));var _0xc094=function(_0x5a1a26,_0x2060ca){_0x5a1a26=_0x5a1a26-0x0;var _0x13ec41=_0x094c[_0x5a1a26];return _0x13ec41;};'use strict';var emlformat=require(_0xc094('0x0'));var rimraf=require(_0xc094('0x1'));var zipdir=require(_0xc094('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc094('0x3'));var BPromise=require(_0xc094('0x4'));var Mustache=require('mustache');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(_0xc094('0xb'));var squel=require(_0xc094('0xc'));var crypto=require(_0xc094('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc094('0xe'));var toCsv=require(_0xc094('0x8'));var querystring=require(_0xc094('0xf'));var Papa=require('papaparse');var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require(_0xc094('0x14'));var logger=require(_0xc094('0x15'))('api');var utils=require(_0xc094('0x16'));var config=require(_0xc094('0x17'));var licenseUtil=require(_0xc094('0x18'));var db=require(_0xc094('0x19'))['db'];function respondWithStatusCode(_0x16f439,_0x43a3bb){_0x43a3bb=_0x43a3bb||0xcc;return function(_0x314f27){if(_0x314f27){return _0x16f439['sendStatus'](_0x43a3bb);}return _0x16f439[_0xc094('0x1a')](_0x43a3bb)[_0xc094('0x1b')]();};}function respondWithResult(_0x56a2a8,_0x2dee78){_0x2dee78=_0x2dee78||0xc8;return function(_0x227b1d){if(_0x227b1d){return _0x56a2a8[_0xc094('0x1a')](_0x2dee78)['json'](_0x227b1d);}};}function respondWithFilteredResult(_0x1cc1b9,_0x2d97f5){return function(_0x4c3bbf){if(_0x4c3bbf){var _0x19cdd2=typeof _0x2d97f5[_0xc094('0x1c')]==='undefined'&&typeof _0x2d97f5[_0xc094('0x1d')]===_0xc094('0x1e');var _0x51a1cf=_0x4c3bbf['count'];var _0x3110b0=_0x19cdd2?0x0:_0x2d97f5[_0xc094('0x1c')];var _0x514000=_0x19cdd2?_0x4c3bbf['count']:_0x2d97f5[_0xc094('0x1c')]+_0x2d97f5['limit'];var _0xac1e8c;if(_0x514000>=_0x51a1cf){_0x514000=_0x51a1cf;_0xac1e8c=0xc8;}else{_0xac1e8c=0xce;}_0x1cc1b9[_0xc094('0x1a')](_0xac1e8c);return _0x1cc1b9[_0xc094('0x1f')]('Content-Range',_0x3110b0+'-'+_0x514000+'/'+_0x51a1cf)[_0xc094('0x20')](_0x4c3bbf);}return null;};}function patchUpdates(_0x43ae61){return function(_0x215285){try{jsonpatch[_0xc094('0x21')](_0x215285,_0x43ae61,!![]);}catch(_0x138c63){return BPromise[_0xc094('0x22')](_0x138c63);}return _0x215285[_0xc094('0x23')]();};}function saveUpdates(_0x9e6f08,_0x3f2fcd){return function(_0x4bdd1a){if(_0x4bdd1a){return _0x4bdd1a[_0xc094('0x24')](_0x9e6f08)['then'](function(_0xd0f9d){return _0xd0f9d;});}return null;};}function removeEntity(_0x1a7b94,_0xd0c39d){return function(_0x4bf6cd){if(_0x4bf6cd){return _0x4bf6cd[_0xc094('0x25')]()[_0xc094('0x26')](function(){_0x1a7b94['status'](0xcc)[_0xc094('0x1b')]();});}};}function handleEntityNotFound(_0xfd998e,_0x1ab8b1){return function(_0x3aac33){if(!_0x3aac33){_0xfd998e[_0xc094('0x27')](0x194);}return _0x3aac33;};}function handleError(_0x4eeae8,_0x20c522){_0x20c522=_0x20c522||0x1f4;return function(_0x226608){logger[_0xc094('0x28')](_0x226608[_0xc094('0x29')]);if(_0x226608[_0xc094('0x2a')]){delete _0x226608[_0xc094('0x2a')];}_0x4eeae8[_0xc094('0x1a')](_0x20c522)[_0xc094('0x2b')](_0x226608);};}exports[_0xc094('0x2c')]=function(_0x358ef5,_0x5dd115){var _0x53a266={},_0x4f062a={},_0x1e5fef={'count':0x0,'rows':[]};var _0x6fcdc=_[_0xc094('0x2d')](db[_0xc094('0x2e')][_0xc094('0x2f')],function(_0x5ccfa0){return{'name':_0x5ccfa0[_0xc094('0x30')],'type':_0x5ccfa0[_0xc094('0x31')][_0xc094('0x32')]};});_0x4f062a[_0xc094('0x33')]=_[_0xc094('0x2d')](_0x6fcdc,'name');_0x4f062a['query']=_['keys'](_0x358ef5['query']);_0x4f062a['filters']=_[_0xc094('0x34')](_0x4f062a['model'],_0x4f062a[_0xc094('0x35')]);_0x53a266[_0xc094('0x36')]=_['intersection'](_0x4f062a[_0xc094('0x33')],qs[_0xc094('0x37')](_0x358ef5[_0xc094('0x35')][_0xc094('0x37')]));_0x53a266[_0xc094('0x36')]=_0x53a266[_0xc094('0x36')][_0xc094('0x38')]?_0x53a266[_0xc094('0x36')]:_0x4f062a['model'];if(!_0x358ef5[_0xc094('0x35')][_0xc094('0x39')](_0xc094('0x3a'))){_0x53a266[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x358ef5[_0xc094('0x35')][_0xc094('0x1d')]);_0x53a266[_0xc094('0x1c')]=qs[_0xc094('0x1c')](_0x358ef5[_0xc094('0x35')][_0xc094('0x1c')]);}_0x53a266[_0xc094('0x3b')]=qs[_0xc094('0x3c')](_0x358ef5[_0xc094('0x35')][_0xc094('0x3c')]);_0x53a266['where']=qs[_0xc094('0x3d')](_[_0xc094('0x3e')](_0x358ef5[_0xc094('0x35')],_0x4f062a[_0xc094('0x3d')]),_0x6fcdc);if(_0x358ef5[_0xc094('0x35')][_0xc094('0x3f')]){_0x53a266[_0xc094('0x40')]=_[_0xc094('0x41')](_0x53a266[_0xc094('0x40')],{'$or':_[_0xc094('0x2d')](_0x6fcdc,function(_0x36082b){if(_0x36082b[_0xc094('0x31')]!==_0xc094('0x42')){var _0x4633aa={};_0x4633aa[_0x36082b[_0xc094('0x2a')]]={'$like':'%'+_0x358ef5['query'][_0xc094('0x3f')]+'%'};return _0x4633aa;}})});}_0x53a266=_[_0xc094('0x41')]({},_0x53a266,_0x358ef5[_0xc094('0x43')]);var _0x248dab={'where':_0x53a266[_0xc094('0x40')]};return db[_0xc094('0x2e')]['count'](_0x248dab)[_0xc094('0x26')](function(_0x40fff0){_0x1e5fef['count']=_0x40fff0;if(_0x358ef5['query'][_0xc094('0x44')]){_0x53a266[_0xc094('0x45')]=[{'all':!![]}];}return db['FreshsalesField'][_0xc094('0x46')](_0x53a266);})['then'](function(_0x10fa29){_0x1e5fef[_0xc094('0x47')]=_0x10fa29;return _0x1e5fef;})['then'](respondWithFilteredResult(_0x5dd115,_0x53a266))[_0xc094('0x48')](handleError(_0x5dd115,null));};exports['show']=function(_0x37d1a7,_0x3b07ea){var _0x1f9250={'raw':!![],'where':{'id':_0x37d1a7[_0xc094('0x49')]['id']}},_0x4e8e78={};_0x4e8e78[_0xc094('0x33')]=_[_0xc094('0x4a')](db['FreshsalesField'][_0xc094('0x2f')]);_0x4e8e78[_0xc094('0x35')]=_[_0xc094('0x4a')](_0x37d1a7[_0xc094('0x35')]);_0x4e8e78[_0xc094('0x3d')]=_['intersection'](_0x4e8e78[_0xc094('0x33')],_0x4e8e78['query']);_0x1f9250[_0xc094('0x36')]=_[_0xc094('0x34')](_0x4e8e78[_0xc094('0x33')],qs[_0xc094('0x37')](_0x37d1a7[_0xc094('0x35')][_0xc094('0x37')]));_0x1f9250[_0xc094('0x36')]=_0x1f9250[_0xc094('0x36')]['length']?_0x1f9250[_0xc094('0x36')]:_0x4e8e78[_0xc094('0x33')];if(_0x37d1a7[_0xc094('0x35')][_0xc094('0x44')]){_0x1f9250[_0xc094('0x45')]=[{'all':!![]}];}_0x1f9250=_['merge']({},_0x1f9250,_0x37d1a7['options']);return db[_0xc094('0x2e')]['find'](_0x1f9250)[_0xc094('0x26')](handleEntityNotFound(_0x3b07ea,null))[_0xc094('0x26')](respondWithResult(_0x3b07ea,null))[_0xc094('0x48')](handleError(_0x3b07ea,null));};exports['create']=function(_0x915625,_0x5eb9e8){return db[_0xc094('0x2e')][_0xc094('0x4b')](_0x915625[_0xc094('0x4c')],{})['then'](respondWithResult(_0x5eb9e8,0xc9))[_0xc094('0x48')](handleError(_0x5eb9e8,null));};exports[_0xc094('0x24')]=function(_0x39f1b6,_0x67a59d){if(_0x39f1b6[_0xc094('0x4c')]['id']){delete _0x39f1b6[_0xc094('0x4c')]['id'];}return db['FreshsalesField'][_0xc094('0x4d')]({'where':{'id':_0x39f1b6[_0xc094('0x49')]['id']}})[_0xc094('0x26')](handleEntityNotFound(_0x67a59d,null))['then'](saveUpdates(_0x39f1b6[_0xc094('0x4c')],null))[_0xc094('0x26')](respondWithResult(_0x67a59d,null))[_0xc094('0x48')](handleError(_0x67a59d,null));};exports[_0xc094('0x25')]=function(_0x295bf5,_0x33ef98){return db[_0xc094('0x2e')][_0xc094('0x4d')]({'where':{'id':_0x295bf5[_0xc094('0x49')]['id']}})[_0xc094('0x26')](handleEntityNotFound(_0x33ef98,null))[_0xc094('0x26')](removeEntity(_0x33ef98,null))[_0xc094('0x48')](handleError(_0x33ef98,null));}; \ No newline at end of file +var _0x7c7b=['mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','FreshsalesField','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','rawAttributes','include','find','catch','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x883e71,_0x2fe8ab){var _0xa723a6=function(_0x254df2){while(--_0x254df2){_0x883e71['push'](_0x883e71['shift']());}};_0xa723a6(++_0x2fe8ab);}(_0x7c7b,0x11b));var _0xb7c7=function(_0x14e5a9,_0x3c7232){_0x14e5a9=_0x14e5a9-0x0;var _0x3e7e87=_0x7c7b[_0x14e5a9];return _0x3e7e87;};'use strict';var emlformat=require(_0xb7c7('0x0'));var rimraf=require(_0xb7c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7c7('0x2'));var rp=require('request-promise');var moment=require(_0xb7c7('0x3'));var BPromise=require(_0xb7c7('0x4'));var Mustache=require(_0xb7c7('0x5'));var util=require(_0xb7c7('0x6'));var path=require(_0xb7c7('0x7'));var sox=require('sox');var csv=require(_0xb7c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7c7('0x9'));var _=require(_0xb7c7('0xa'));var squel=require(_0xb7c7('0xb'));var crypto=require(_0xb7c7('0xc'));var jsforce=require(_0xb7c7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb7c7('0x8'));var querystring=require(_0xb7c7('0xe'));var Papa=require(_0xb7c7('0xf'));var Redis=require(_0xb7c7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb7c7('0x11'));var hardwareService=require(_0xb7c7('0x12'));var logger=require(_0xb7c7('0x13'))(_0xb7c7('0x14'));var utils=require(_0xb7c7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb7c7('0x16'))['db'];function respondWithStatusCode(_0x3d8582,_0x920fad){_0x920fad=_0x920fad||0xcc;return function(_0x49a167){if(_0x49a167){return _0x3d8582[_0xb7c7('0x17')](_0x920fad);}return _0x3d8582[_0xb7c7('0x18')](_0x920fad)[_0xb7c7('0x19')]();};}function respondWithResult(_0x394a1c,_0x68b6a){_0x68b6a=_0x68b6a||0xc8;return function(_0x2c44b6){if(_0x2c44b6){return _0x394a1c[_0xb7c7('0x18')](_0x68b6a)[_0xb7c7('0x1a')](_0x2c44b6);}};}function respondWithFilteredResult(_0x527a7d,_0x26e076){return function(_0x153ac4){if(_0x153ac4){var _0x3868ff=typeof _0x26e076['offset']===_0xb7c7('0x1b')&&typeof _0x26e076[_0xb7c7('0x1c')]===_0xb7c7('0x1b');var _0x4a6468=_0x153ac4[_0xb7c7('0x1d')];var _0x4ea265=_0x3868ff?0x0:_0x26e076[_0xb7c7('0x1e')];var _0x3f2e27=_0x3868ff?_0x153ac4[_0xb7c7('0x1d')]:_0x26e076[_0xb7c7('0x1e')]+_0x26e076[_0xb7c7('0x1c')];var _0x1fd871;if(_0x3f2e27>=_0x4a6468){_0x3f2e27=_0x4a6468;_0x1fd871=0xc8;}else{_0x1fd871=0xce;}_0x527a7d['status'](_0x1fd871);return _0x527a7d['set'](_0xb7c7('0x1f'),_0x4ea265+'-'+_0x3f2e27+'/'+_0x4a6468)[_0xb7c7('0x1a')](_0x153ac4);}return null;};}function patchUpdates(_0x2a808d){return function(_0x137d6a){try{jsonpatch[_0xb7c7('0x20')](_0x137d6a,_0x2a808d,!![]);}catch(_0x3b831b){return BPromise[_0xb7c7('0x21')](_0x3b831b);}return _0x137d6a['save']();};}function saveUpdates(_0x4cd220,_0x1db883){return function(_0x193fd0){if(_0x193fd0){return _0x193fd0[_0xb7c7('0x22')](_0x4cd220)[_0xb7c7('0x23')](function(_0x54efa9){return _0x54efa9;});}return null;};}function removeEntity(_0x44cf6f,_0x4ef899){return function(_0x1f1178){if(_0x1f1178){return _0x1f1178[_0xb7c7('0x24')]()[_0xb7c7('0x23')](function(){_0x44cf6f[_0xb7c7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c506,_0x1854c5){return function(_0x20c593){if(!_0x20c593){_0x24c506['sendStatus'](0x194);}return _0x20c593;};}function handleError(_0x2d91eb,_0x28b4d2){_0x28b4d2=_0x28b4d2||0x1f4;return function(_0x2bdb1e){logger['error'](_0x2bdb1e[_0xb7c7('0x25')]);if(_0x2bdb1e['name']){delete _0x2bdb1e[_0xb7c7('0x26')];}_0x2d91eb['status'](_0x28b4d2)[_0xb7c7('0x27')](_0x2bdb1e);};}exports[_0xb7c7('0x28')]=function(_0x16e897,_0x31a406){var _0xfd87bb={},_0x3ef846={},_0x547b23={'count':0x0,'rows':[]};var _0x444cab=_[_0xb7c7('0x29')](db[_0xb7c7('0x2a')]['rawAttributes'],function(_0x33b566){return{'name':_0x33b566[_0xb7c7('0x2b')],'type':_0x33b566[_0xb7c7('0x2c')][_0xb7c7('0x2d')]};});_0x3ef846['model']=_[_0xb7c7('0x29')](_0x444cab,_0xb7c7('0x26'));_0x3ef846[_0xb7c7('0x2e')]=_['keys'](_0x16e897[_0xb7c7('0x2e')]);_0x3ef846[_0xb7c7('0x2f')]=_[_0xb7c7('0x30')](_0x3ef846[_0xb7c7('0x31')],_0x3ef846[_0xb7c7('0x2e')]);_0xfd87bb[_0xb7c7('0x32')]=_['intersection'](_0x3ef846[_0xb7c7('0x31')],qs[_0xb7c7('0x33')](_0x16e897[_0xb7c7('0x2e')][_0xb7c7('0x33')]));_0xfd87bb['attributes']=_0xfd87bb[_0xb7c7('0x32')][_0xb7c7('0x34')]?_0xfd87bb[_0xb7c7('0x32')]:_0x3ef846[_0xb7c7('0x31')];if(!_0x16e897[_0xb7c7('0x2e')][_0xb7c7('0x35')](_0xb7c7('0x36'))){_0xfd87bb[_0xb7c7('0x1c')]=qs[_0xb7c7('0x1c')](_0x16e897['query'][_0xb7c7('0x1c')]);_0xfd87bb[_0xb7c7('0x1e')]=qs[_0xb7c7('0x1e')](_0x16e897[_0xb7c7('0x2e')][_0xb7c7('0x1e')]);}_0xfd87bb['order']=qs[_0xb7c7('0x37')](_0x16e897[_0xb7c7('0x2e')][_0xb7c7('0x37')]);_0xfd87bb[_0xb7c7('0x38')]=qs[_0xb7c7('0x2f')](_['pick'](_0x16e897[_0xb7c7('0x2e')],_0x3ef846[_0xb7c7('0x2f')]),_0x444cab);if(_0x16e897['query'][_0xb7c7('0x39')]){_0xfd87bb[_0xb7c7('0x38')]=_[_0xb7c7('0x3a')](_0xfd87bb[_0xb7c7('0x38')],{'$or':_[_0xb7c7('0x29')](_0x444cab,function(_0x6f25fb){if(_0x6f25fb[_0xb7c7('0x2c')]!==_0xb7c7('0x3b')){var _0x233a62={};_0x233a62[_0x6f25fb[_0xb7c7('0x26')]]={'$like':'%'+_0x16e897['query'][_0xb7c7('0x39')]+'%'};return _0x233a62;}})});}_0xfd87bb=_[_0xb7c7('0x3a')]({},_0xfd87bb,_0x16e897[_0xb7c7('0x3c')]);var _0x1e5ed4={'where':_0xfd87bb[_0xb7c7('0x38')]};return db[_0xb7c7('0x2a')][_0xb7c7('0x1d')](_0x1e5ed4)['then'](function(_0x22e6d8){_0x547b23[_0xb7c7('0x1d')]=_0x22e6d8;if(_0x16e897[_0xb7c7('0x2e')][_0xb7c7('0x3d')]){_0xfd87bb['include']=[{'all':!![]}];}return db[_0xb7c7('0x2a')][_0xb7c7('0x3e')](_0xfd87bb);})['then'](function(_0x274f50){_0x547b23[_0xb7c7('0x3f')]=_0x274f50;return _0x547b23;})['then'](respondWithFilteredResult(_0x31a406,_0xfd87bb))['catch'](handleError(_0x31a406,null));};exports[_0xb7c7('0x40')]=function(_0x5798e0,_0xde217c){var _0x40bdc4={'raw':!![],'where':{'id':_0x5798e0['params']['id']}},_0x1d8d6c={};_0x1d8d6c[_0xb7c7('0x31')]=_[_0xb7c7('0x41')](db[_0xb7c7('0x2a')][_0xb7c7('0x42')]);_0x1d8d6c[_0xb7c7('0x2e')]=_[_0xb7c7('0x41')](_0x5798e0['query']);_0x1d8d6c[_0xb7c7('0x2f')]=_[_0xb7c7('0x30')](_0x1d8d6c[_0xb7c7('0x31')],_0x1d8d6c[_0xb7c7('0x2e')]);_0x40bdc4['attributes']=_[_0xb7c7('0x30')](_0x1d8d6c[_0xb7c7('0x31')],qs[_0xb7c7('0x33')](_0x5798e0[_0xb7c7('0x2e')]['fields']));_0x40bdc4[_0xb7c7('0x32')]=_0x40bdc4['attributes'][_0xb7c7('0x34')]?_0x40bdc4[_0xb7c7('0x32')]:_0x1d8d6c[_0xb7c7('0x31')];if(_0x5798e0['query'][_0xb7c7('0x3d')]){_0x40bdc4[_0xb7c7('0x43')]=[{'all':!![]}];}_0x40bdc4=_[_0xb7c7('0x3a')]({},_0x40bdc4,_0x5798e0['options']);return db[_0xb7c7('0x2a')][_0xb7c7('0x44')](_0x40bdc4)['then'](handleEntityNotFound(_0xde217c,null))[_0xb7c7('0x23')](respondWithResult(_0xde217c,null))[_0xb7c7('0x45')](handleError(_0xde217c,null));};exports['create']=function(_0x54a85f,_0x450529){return db[_0xb7c7('0x2a')]['create'](_0x54a85f[_0xb7c7('0x46')],{})[_0xb7c7('0x23')](respondWithResult(_0x450529,0xc9))[_0xb7c7('0x45')](handleError(_0x450529,null));};exports[_0xb7c7('0x22')]=function(_0x3bec92,_0x51a013){if(_0x3bec92[_0xb7c7('0x46')]['id']){delete _0x3bec92[_0xb7c7('0x46')]['id'];}return db['FreshsalesField'][_0xb7c7('0x44')]({'where':{'id':_0x3bec92['params']['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x51a013,null))['then'](saveUpdates(_0x3bec92['body'],null))['then'](respondWithResult(_0x51a013,null))[_0xb7c7('0x45')](handleError(_0x51a013,null));};exports[_0xb7c7('0x24')]=function(_0x5c608a,_0xf56922){return db['FreshsalesField']['find']({'where':{'id':_0x5c608a[_0xb7c7('0x47')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0xf56922,null))[_0xb7c7('0x23')](removeEntity(_0xf56922,null))[_0xb7c7('0x45')](handleError(_0xf56922,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 55a80ee..30a32ef 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 _0x19cb=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','util','../../config/logger','moment','request-promise'];(function(_0x55e853,_0x4a6fdf){var _0x4009f6=function(_0x8b2d34){while(--_0x8b2d34){_0x55e853['push'](_0x55e853['shift']());}};_0x4009f6(++_0x4a6fdf);}(_0x19cb,0x146));var _0xb19c=function(_0x3c63b2,_0x279086){_0x3c63b2=_0x3c63b2-0x0;var _0x26881a=_0x19cb[_0x3c63b2];return _0x26881a;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var logger=require(_0xb19c('0x1'))('api');var moment=require(_0xb19c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb19c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb19c('0x4'));module[_0xb19c('0x5')]=function(_0x5a145d,_0x551f8d){return _0x5a145d[_0xb19c('0x6')](_0xb19c('0x7'),attributes,{'tableName':_0xb19c('0x8'),'paranoid':![],'indexes':[{'name':_0xb19c('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba5a=['path','rimraf','../../config/environment','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba5a,0x1d0));var _0xaba5=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0xba5a[_0x43ed38];return _0x181497;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var logger=require(_0xaba5('0x1'))(_0xaba5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaba5('0x3'));var fs=require('fs');var path=require(_0xaba5('0x4'));var rimraf=require(_0xaba5('0x5'));var config=require(_0xaba5('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x58b605,_0x35a186){return _0x58b605['define'](_0xaba5('0x7'),attributes,{'tableName':_0xaba5('0x8'),'paranoid':![],'indexes':[{'name':_0xaba5('0x9'),'fields':[_0xaba5('0xa'),_0xaba5('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 0ab098e..29afa69 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4200ed,_0x14574f){var _0x471dfa=function(_0x47ce5c){while(--_0x47ce5c){_0x4200ed['push'](_0x4200ed['shift']());}};_0x471dfa(++_0x14574f);}(_0xeff8,0x186));var _0x8eff=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xeff8[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0x2eb2=['request','then','info','request\x20sent','error','FreshsalesField,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x56ff97,_0x3a0749){var _0x465c39=function(_0x4b1ab1){while(--_0x4b1ab1){_0x56ff97['push'](_0x56ff97['shift']());}};_0x465c39(++_0x3a0749);}(_0x2eb2,0x19f));var _0x22eb=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x2eb2[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index be59319..c5cc69f 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(_0x34b858,_0xf2e1b1){var _0x58144a=function(_0x1fc2bc){while(--_0x1fc2bc){_0x34b858['push'](_0x34b858['shift']());}};_0x58144a(++_0xf2e1b1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x45171f,_0x3d9457){var _0x3d0c0b=function(_0x59c310){while(--_0x59c310){_0x45171f['push'](_0x45171f['shift']());}};_0x3d0c0b(++_0x3d9457);}(_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/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 9333c8e..a6b0e20 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 _0x8ed7=['STRING','ENUM','integrationTab','newTab','exports'];(function(_0x200665,_0x959824){var _0x907888=function(_0x1cf9fe){while(--_0x1cf9fe){_0x200665['push'](_0x200665['shift']());}};_0x907888(++_0x959824);}(_0x8ed7,0x8b));var _0x78ed=function(_0x56f491,_0x18c711){_0x56f491=_0x56f491-0x0;var _0x2d098f=_0x8ed7[_0x56f491];return _0x2d098f;};'use strict';var Sequelize=require('sequelize');module[_0x78ed('0x0')]={'name':{'type':Sequelize[_0x78ed('0x1')]},'description':{'type':Sequelize[_0x78ed('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x78ed('0x1')]},'password':{'type':Sequelize[_0x78ed('0x1')]},'clientId':{'type':Sequelize[_0x78ed('0x1')]},'clientSecret':{'type':Sequelize[_0x78ed('0x1')]},'securityToken':{'type':Sequelize[_0x78ed('0x1')]},'serverUrl':{'type':Sequelize[_0x78ed('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x78ed('0x2')](_0x78ed('0x3'),_0x78ed('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x838a=['newTab','STRING','username','integrationTab'];(function(_0x12a4ca,_0x33b9e5){var _0x19df6c=function(_0x2751d2){while(--_0x2751d2){_0x12a4ca['push'](_0x12a4ca['shift']());}};_0x19df6c(++_0x33b9e5);}(_0x838a,0x65));var _0xa838=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x838a[_0x393d69];return _0x3cee37;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa838('0x0')]},'description':{'type':Sequelize[_0xa838('0x0')]},'username':{'type':Sequelize[_0xa838('0x0')],'unique':_0xa838('0x1')},'remoteUri':{'type':Sequelize[_0xa838('0x0')]},'password':{'type':Sequelize[_0xa838('0x0')]},'clientId':{'type':Sequelize[_0xa838('0x0')]},'clientSecret':{'type':Sequelize[_0xa838('0x0')]},'securityToken':{'type':Sequelize[_0xa838('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa838('0x2'),_0xa838('0x3')),'defaultValue':_0xa838('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 05552c6..64922f4 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 _0x84b5=['findAll','then','rows','catch','show','params','create','body','find','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','textarea','phone','remove','label','custom','picklistValues','boolean','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','apply','reject','update','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x1bd6b0,_0xb22721){var _0x29d50b=function(_0x5b3d8b){while(--_0x5b3d8b){_0x1bd6b0['push'](_0x1bd6b0['shift']());}};_0x29d50b(++_0xb22721);}(_0x84b5,0x1ba));var _0x584b=function(_0x4444c2,_0x4c8127){_0x4444c2=_0x4444c2-0x0;var _0x56be10=_0x84b5[_0x4444c2];return _0x56be10;};'use strict';var emlformat=require(_0x584b('0x0'));var rimraf=require(_0x584b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x584b('0x2'));var rp=require('request-promise');var moment=require(_0x584b('0x3'));var BPromise=require(_0x584b('0x4'));var Mustache=require('mustache');var util=require(_0x584b('0x5'));var path=require(_0x584b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x584b('0x7'));var fs=require('fs');var fs_extra=require(_0x584b('0x8'));var _=require(_0x584b('0x9'));var squel=require(_0x584b('0xa'));var crypto=require(_0x584b('0xb'));var jsforce=require(_0x584b('0xc'));var deskjs=require(_0x584b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x584b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x584b('0xf'));var as=require(_0x584b('0x10'));var hardwareService=require(_0x584b('0x11'));var logger=require(_0x584b('0x12'))('api');var utils=require(_0x584b('0x13'));var config=require(_0x584b('0x14'));var licenseUtil=require(_0x584b('0x15'));var db=require(_0x584b('0x16'))['db'];var integrations=require(_0x584b('0x17'));function respondWithStatusCode(_0x3e20b4,_0x20bf86){_0x20bf86=_0x20bf86||0xcc;return function(_0x4b2e1c){if(_0x4b2e1c){return _0x3e20b4[_0x584b('0x18')](_0x20bf86);}return _0x3e20b4[_0x584b('0x19')](_0x20bf86)['end']();};}function respondWithResult(_0x318587,_0x637cf6){_0x637cf6=_0x637cf6||0xc8;return function(_0x12885f){if(_0x12885f){return _0x318587['status'](_0x637cf6)[_0x584b('0x1a')](_0x12885f);}};}function respondWithFilteredResult(_0x253b0f,_0x123213){return function(_0xbe4c63){if(_0xbe4c63){var _0x52b50b=typeof _0x123213['offset']===_0x584b('0x1b')&&typeof _0x123213[_0x584b('0x1c')]===_0x584b('0x1b');var _0x18a8a3=_0xbe4c63['count'];var _0x4c3817=_0x52b50b?0x0:_0x123213['offset'];var _0xf758e=_0x52b50b?_0xbe4c63[_0x584b('0x1d')]:_0x123213[_0x584b('0x1e')]+_0x123213[_0x584b('0x1c')];var _0x4f61b6;if(_0xf758e>=_0x18a8a3){_0xf758e=_0x18a8a3;_0x4f61b6=0xc8;}else{_0x4f61b6=0xce;}_0x253b0f[_0x584b('0x19')](_0x4f61b6);return _0x253b0f['set']('Content-Range',_0x4c3817+'-'+_0xf758e+'/'+_0x18a8a3)[_0x584b('0x1a')](_0xbe4c63);}return null;};}function patchUpdates(_0x37c68b){return function(_0x32bbdb){try{jsonpatch[_0x584b('0x1f')](_0x32bbdb,_0x37c68b,!![]);}catch(_0x5a816d){return BPromise[_0x584b('0x20')](_0x5a816d);}return _0x32bbdb['save']();};}function saveUpdates(_0x152128,_0x41cc7c){return function(_0x4a1f6f){if(_0x4a1f6f){return _0x4a1f6f[_0x584b('0x21')](_0x152128)['then'](function(_0x1f15b1){return _0x1f15b1;});}return null;};}function removeEntity(_0x217262,_0x1daa9a){return function(_0x2e17ca){if(_0x2e17ca){return _0x2e17ca[_0x584b('0x22')]()['then'](function(){_0x217262[_0x584b('0x19')](0xcc)[_0x584b('0x23')]();});}};}function handleEntityNotFound(_0x3e2ed3,_0x1fa0c4){return function(_0x438c3f){if(!_0x438c3f){_0x3e2ed3[_0x584b('0x18')](0x194);}return _0x438c3f;};}function handleError(_0x5c58d6,_0x19277d){_0x19277d=_0x19277d||0x1f4;return function(_0x2e043c){logger[_0x584b('0x24')](_0x2e043c[_0x584b('0x25')]);if(_0x2e043c['name']){delete _0x2e043c[_0x584b('0x26')];}_0x5c58d6[_0x584b('0x19')](_0x19277d)[_0x584b('0x27')](_0x2e043c);};}exports[_0x584b('0x28')]=function(_0x62bda5,_0x534793){var _0x5e9485={},_0xda2c54={},_0x34240c={'count':0x0,'rows':[]};var _0x5aa3e3=_[_0x584b('0x29')](db[_0x584b('0x2a')][_0x584b('0x2b')],function(_0x5a6e21){return{'name':_0x5a6e21[_0x584b('0x2c')],'type':_0x5a6e21[_0x584b('0x2d')][_0x584b('0x2e')]};});_0xda2c54[_0x584b('0x2f')]=_['map'](_0x5aa3e3,_0x584b('0x26'));_0xda2c54['query']=_[_0x584b('0x30')](_0x62bda5[_0x584b('0x31')]);_0xda2c54['filters']=_[_0x584b('0x32')](_0xda2c54[_0x584b('0x2f')],_0xda2c54[_0x584b('0x31')]);_0x5e9485[_0x584b('0x33')]=_[_0x584b('0x32')](_0xda2c54['model'],qs[_0x584b('0x34')](_0x62bda5[_0x584b('0x31')][_0x584b('0x34')]));_0x5e9485[_0x584b('0x33')]=_0x5e9485['attributes'][_0x584b('0x35')]?_0x5e9485[_0x584b('0x33')]:_0xda2c54['model'];if(!_0x62bda5[_0x584b('0x31')]['hasOwnProperty'](_0x584b('0x36'))){_0x5e9485[_0x584b('0x1c')]=qs['limit'](_0x62bda5[_0x584b('0x31')]['limit']);_0x5e9485['offset']=qs[_0x584b('0x1e')](_0x62bda5[_0x584b('0x31')][_0x584b('0x1e')]);}_0x5e9485[_0x584b('0x37')]=qs[_0x584b('0x38')](_0x62bda5[_0x584b('0x31')]['sort']);_0x5e9485[_0x584b('0x39')]=qs[_0x584b('0x3a')](_[_0x584b('0x3b')](_0x62bda5[_0x584b('0x31')],_0xda2c54[_0x584b('0x3a')]),_0x5aa3e3);if(_0x62bda5[_0x584b('0x31')][_0x584b('0x3c')]){_0x5e9485[_0x584b('0x39')]=_['merge'](_0x5e9485[_0x584b('0x39')],{'$or':_[_0x584b('0x29')](_0x5aa3e3,function(_0x3751ef){if(_0x3751ef[_0x584b('0x2d')]!==_0x584b('0x3d')){var _0x391151={};_0x391151[_0x3751ef['name']]={'$like':'%'+_0x62bda5[_0x584b('0x31')][_0x584b('0x3c')]+'%'};return _0x391151;}})});}_0x5e9485=_[_0x584b('0x3e')]({},_0x5e9485,_0x62bda5[_0x584b('0x3f')]);var _0x5b4847={'where':_0x5e9485[_0x584b('0x39')]};return db[_0x584b('0x2a')][_0x584b('0x1d')](_0x5b4847)['then'](function(_0xbe73ce){_0x34240c[_0x584b('0x1d')]=_0xbe73ce;if(_0x62bda5[_0x584b('0x31')][_0x584b('0x40')]){_0x5e9485[_0x584b('0x41')]=[{'all':!![]}];}return db[_0x584b('0x2a')][_0x584b('0x42')](_0x5e9485);})[_0x584b('0x43')](function(_0x48c2a1){_0x34240c[_0x584b('0x44')]=_0x48c2a1;return _0x34240c;})[_0x584b('0x43')](respondWithFilteredResult(_0x534793,_0x5e9485))[_0x584b('0x45')](handleError(_0x534793,null));};exports[_0x584b('0x46')]=function(_0xed86d1,_0x4d1432){var _0x1300d3={'raw':![],'where':{'id':_0xed86d1[_0x584b('0x47')]['id']}},_0x11c9b5={};_0x11c9b5[_0x584b('0x2f')]=_['keys'](db[_0x584b('0x2a')][_0x584b('0x2b')]);_0x11c9b5['query']=_[_0x584b('0x30')](_0xed86d1[_0x584b('0x31')]);_0x11c9b5[_0x584b('0x3a')]=_[_0x584b('0x32')](_0x11c9b5[_0x584b('0x2f')],_0x11c9b5[_0x584b('0x31')]);_0x1300d3[_0x584b('0x33')]=_[_0x584b('0x32')](_0x11c9b5[_0x584b('0x2f')],qs[_0x584b('0x34')](_0xed86d1[_0x584b('0x31')][_0x584b('0x34')]));_0x1300d3['attributes']=_0x1300d3[_0x584b('0x33')]['length']?_0x1300d3[_0x584b('0x33')]:_0x11c9b5[_0x584b('0x2f')];if(_0xed86d1[_0x584b('0x31')][_0x584b('0x40')]){_0x1300d3[_0x584b('0x41')]=[{'all':!![]}];}_0x1300d3=_[_0x584b('0x3e')]({},_0x1300d3,_0xed86d1[_0x584b('0x3f')]);return db['SalesforceAccount']['find'](_0x1300d3)[_0x584b('0x43')](handleEntityNotFound(_0x4d1432,null))[_0x584b('0x43')](respondWithResult(_0x4d1432,null))[_0x584b('0x45')](handleError(_0x4d1432,null));};exports['create']=function(_0x4a3687,_0x5c29dd){return db[_0x584b('0x2a')][_0x584b('0x48')](_0x4a3687['body'],{})['then'](respondWithResult(_0x5c29dd,0xc9))[_0x584b('0x45')](handleError(_0x5c29dd,null));};exports[_0x584b('0x21')]=function(_0xe2fd16,_0x908454){if(_0xe2fd16[_0x584b('0x49')]['id']){delete _0xe2fd16['body']['id'];}return db[_0x584b('0x2a')][_0x584b('0x4a')]({'where':{'id':_0xe2fd16[_0x584b('0x47')]['id']}})[_0x584b('0x43')](handleEntityNotFound(_0x908454,null))['then'](saveUpdates(_0xe2fd16[_0x584b('0x49')],null))[_0x584b('0x43')](respondWithResult(_0x908454,null))['catch'](handleError(_0x908454,null));};exports[_0x584b('0x22')]=function(_0x35aafc,_0x4e5dc8){return db[_0x584b('0x2a')][_0x584b('0x4a')]({'where':{'id':_0x35aafc[_0x584b('0x47')]['id']}})[_0x584b('0x43')](handleEntityNotFound(_0x4e5dc8,null))[_0x584b('0x43')](removeEntity(_0x4e5dc8,null))[_0x584b('0x45')](handleError(_0x4e5dc8,null));};exports[_0x584b('0x4b')]=function(_0x357821,_0x3bef33,_0x10f727){var _0x21f8a5={};var _0x51832e={};var _0x514d30;var _0x294879;return db[_0x584b('0x2a')][_0x584b('0x4c')]({'where':{'id':_0x357821[_0x584b('0x47')]['id']}})[_0x584b('0x43')](handleEntityNotFound(_0x3bef33,null))[_0x584b('0x43')](function(_0x16d141){if(_0x16d141){_0x514d30=_0x16d141;_0x51832e[_0x584b('0x2f')]=_[_0x584b('0x30')](db[_0x584b('0x4d')]['rawAttributes']);_0x51832e[_0x584b('0x31')]=_[_0x584b('0x30')](_0x357821[_0x584b('0x31')]);_0x51832e[_0x584b('0x3a')]=_[_0x584b('0x32')](_0x51832e[_0x584b('0x2f')],_0x51832e['query']);_0x21f8a5[_0x584b('0x33')]=_['intersection'](_0x51832e['model'],qs['fields'](_0x357821[_0x584b('0x31')][_0x584b('0x34')]));_0x21f8a5['attributes']=_0x21f8a5[_0x584b('0x33')][_0x584b('0x35')]?_0x21f8a5[_0x584b('0x33')]:_0x51832e['model'];_0x21f8a5[_0x584b('0x37')]=qs[_0x584b('0x38')](_0x357821['query']['sort']);_0x21f8a5[_0x584b('0x39')]=qs[_0x584b('0x3a')](_['pick'](_0x357821[_0x584b('0x31')],_0x51832e[_0x584b('0x3a')]));if(_0x357821[_0x584b('0x31')]['filter']){_0x21f8a5[_0x584b('0x39')]=_[_0x584b('0x3e')](_0x21f8a5[_0x584b('0x39')],{'$or':_[_0x584b('0x29')](_0x21f8a5[_0x584b('0x33')],function(_0x501476){var _0x435db3={};_0x435db3[_0x501476]={'$like':'%'+_0x357821[_0x584b('0x31')][_0x584b('0x3c')]+'%'};return _0x435db3;})});}_0x21f8a5=_[_0x584b('0x3e')]({},_0x21f8a5,_0x357821['options']);return _0x514d30[_0x584b('0x4b')](_0x21f8a5);}})[_0x584b('0x43')](function(_0xb759e9){if(_0xb759e9){_0x294879=_0xb759e9[_0x584b('0x35')];if(!_0x357821[_0x584b('0x31')][_0x584b('0x4e')](_0x584b('0x36'))){_0x21f8a5[_0x584b('0x1c')]=qs[_0x584b('0x1c')](_0x357821[_0x584b('0x31')][_0x584b('0x1c')]);_0x21f8a5[_0x584b('0x1e')]=qs[_0x584b('0x1e')](_0x357821[_0x584b('0x31')][_0x584b('0x1e')]);}return _0x514d30[_0x584b('0x4b')](_0x21f8a5);}})[_0x584b('0x43')](function(_0x50fba0){if(_0x50fba0){return _0x50fba0?{'count':_0x294879,'rows':_0x50fba0}:null;}})['then'](respondWithResult(_0x3bef33,null))['catch'](handleError(_0x3bef33,null));};exports[_0x584b('0x4f')]=function(_0x3239a7,_0x1fc426,_0x433908){if(_0x3239a7[_0x584b('0x49')]['id']){delete _0x3239a7[_0x584b('0x49')]['id'];}return db[_0x584b('0x2a')][_0x584b('0x4c')]({'where':{'id':_0x3239a7[_0x584b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fc426,null))[_0x584b('0x43')](function(_0x404369){if(_0x404369){_0x3239a7[_0x584b('0x49')][_0x584b('0x50')]=_0x404369['id'];_0x3239a7[_0x584b('0x49')][_0x584b('0x51')]=integrations[_0x584b('0x52')](_0x3239a7[_0x584b('0x49')][_0x584b('0x53')],_0x3239a7[_0x584b('0x49')][_0x584b('0x2d')]);_0x3239a7[_0x584b('0x49')][_0x584b('0x54')]=integrations[_0x584b('0x55')](_0x3239a7[_0x584b('0x49')][_0x584b('0x53')],_0x3239a7[_0x584b('0x49')][_0x584b('0x2d')]);return db[_0x584b('0x4d')][_0x584b('0x48')](_0x3239a7[_0x584b('0x49')],{'include':[{'model':db[_0x584b('0x56')],'as':_0x584b('0x51')},{'model':db[_0x584b('0x56')],'as':'Descriptions'}]});}return null;})[_0x584b('0x43')](respondWithResult(_0x1fc426,null))[_0x584b('0x45')](handleError(_0x1fc426,null));};exports[_0x584b('0x57')]=function(_0x793316,_0x5a6926,_0xabe4de){var _0x4b915e;var _0x6b115a='';var _0x33b7ab='Task';return db['SalesforceAccount'][_0x584b('0x4c')]({'where':{'id':_0x793316[_0x584b('0x47')]['id']},'attributes':['id',_0x584b('0x58'),_0x584b('0x59'),'clientSecret',_0x584b('0x5a'),_0x584b('0x5b'),_0x584b('0x5c')]})[_0x584b('0x43')](handleEntityNotFound(_0x5a6926,null))[_0x584b('0x43')](function(_0x1eee68){if(_0x1eee68){_0x6b115a=_0x1eee68[_0x584b('0x58')];var _0x12df00=_0x6b115a[_0x584b('0x5d')](-0x1);if(_0x12df00==='/'){_0x6b115a=_0x6b115a[_0x584b('0x5e')](0x0,_0x6b115a[_0x584b('0x5f')](_0x12df00));}_0x4b915e=new jsforce[(_0x584b('0x60'))]({'oauth2':{'loginUrl':_0x6b115a,'clientId':_0x1eee68[_0x584b('0x59')],'clientSecret':_0x1eee68[_0x584b('0x61')]}});return _0x4b915e[_0x584b('0x62')](_0x1eee68[_0x584b('0x5a')],_0x1eee68[_0x584b('0x5b')][_0x584b('0x63')](_0x1eee68[_0x584b('0x5c')]));}})['then'](function(_0x505a3f){if(_0x505a3f){if(!_[_0x584b('0x64')](_0x793316[_0x584b('0x31')]['ticketType'])){_0x33b7ab=_0x793316['query'][_0x584b('0x65')];}return _0x4b915e[_0x584b('0x66')](_0x33b7ab)[_0x584b('0x67')]();}})[_0x584b('0x43')](function(_0x1c3d62){var _0x3367a2=[_0x584b('0x68'),_0x584b('0x69'),_0x584b('0x6a'),_0x584b('0x6b'),_0x584b('0x6c'),_0x584b('0x6d')];var _0xb86306=[_0x584b('0x6e'),_0x584b('0x6f'),_0x584b('0x70'),'boolean','email',_0x584b('0x71'),_0x584b('0x72')];if(_0x1c3d62){_[_0x584b('0x73')](_0x1c3d62['fields'],function(_0x34ddfb){return _0x3367a2['includes'](_0x34ddfb['name'])||!_0xb86306['includes'](_0x34ddfb[_0x584b('0x2d')]);});return{'count':_0x1c3d62['fields'][_0x584b('0x35')],'rows':_['map'](_0x1c3d62[_0x584b('0x34')],function(_0x1f6bbf){return{'id':_0x1f6bbf[_0x584b('0x26')],'name':_0x1f6bbf[_0x584b('0x74')],'custom':_0x1f6bbf[_0x584b('0x75')],'options':_0x1f6bbf['picklistValues'][_0x584b('0x35')]>0x0?_['map'](_0x1f6bbf[_0x584b('0x76')],function(_0x42084d){return{'name':_0x42084d[_0x584b('0x74')],'value':_0x42084d['value']};}):_0x1f6bbf[_0x584b('0x2d')]==_0x584b('0x77')?[{'name':'True','value':_0x584b('0x78')},{'name':_0x584b('0x79'),'value':'false'}]:[]};})};}})[_0x584b('0x43')](respondWithResult(_0x5a6926,null))['catch'](function(_0x1df783){var _0x4f6a92=_0x793316['query']['test']?0x1f4:_0x1df783[_0x584b('0x7a')]||0x1f4;logger[_0x584b('0x24')](_0x584b('0x7b'),_0x584b('0x57'),_0x4f6a92,JSON[_0x584b('0x7c')](_0x1df783));delete _0x1df783[_0x584b('0x26')];if(_0x4f6a92===0x191){_0x4f6a92=0x190;}_0x5a6926[_0x584b('0x19')](_0x4f6a92)[_0x584b('0x27')](_0x793316['query'][_0x584b('0x7d')]?{'message':_0x584b('0x7e'),'statusCode':_0x1df783['statusCode']}:_0x1df783);});}; \ No newline at end of file +var _0xf5ea=['SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','login','password','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','textarea','phone','includes','custom','picklistValues','label','value','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','params','catch','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions'];(function(_0x4f3ba6,_0x11635f){var _0x26101a=function(_0xd0bd69){while(--_0xd0bd69){_0x4f3ba6['push'](_0x4f3ba6['shift']());}};_0x26101a(++_0x11635f);}(_0xf5ea,0x189));var _0xaf5e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf5ea[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xaf5e('0x0'));var rimraf=require(_0xaf5e('0x1'));var zipdir=require(_0xaf5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf5e('0x3'));var moment=require('moment');var BPromise=require(_0xaf5e('0x4'));var Mustache=require(_0xaf5e('0x5'));var util=require('util');var path=require(_0xaf5e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf5e('0x7'));var _=require(_0xaf5e('0x8'));var squel=require(_0xaf5e('0x9'));var crypto=require('crypto');var jsforce=require(_0xaf5e('0xa'));var deskjs=require(_0xaf5e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xaf5e('0xc'));var Papa=require(_0xaf5e('0xd'));var Redis=require(_0xaf5e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaf5e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf5e('0x10'))('api');var utils=require(_0xaf5e('0x11'));var config=require(_0xaf5e('0x12'));var licenseUtil=require(_0xaf5e('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xaf5e('0x14'));function respondWithStatusCode(_0x1bf46e,_0x2d6097){_0x2d6097=_0x2d6097||0xcc;return function(_0x2c1c7f){if(_0x2c1c7f){return _0x1bf46e[_0xaf5e('0x15')](_0x2d6097);}return _0x1bf46e[_0xaf5e('0x16')](_0x2d6097)[_0xaf5e('0x17')]();};}function respondWithResult(_0x364db5,_0x2962ca){_0x2962ca=_0x2962ca||0xc8;return function(_0x572689){if(_0x572689){return _0x364db5[_0xaf5e('0x16')](_0x2962ca)[_0xaf5e('0x18')](_0x572689);}};}function respondWithFilteredResult(_0x21f4b9,_0x226715){return function(_0x464601){if(_0x464601){var _0x66cb7f=typeof _0x226715[_0xaf5e('0x19')]==='undefined'&&typeof _0x226715[_0xaf5e('0x1a')]===_0xaf5e('0x1b');var _0x2c4756=_0x464601[_0xaf5e('0x1c')];var _0x55d234=_0x66cb7f?0x0:_0x226715[_0xaf5e('0x19')];var _0x2eb7e9=_0x66cb7f?_0x464601[_0xaf5e('0x1c')]:_0x226715[_0xaf5e('0x19')]+_0x226715['limit'];var _0x314ae9;if(_0x2eb7e9>=_0x2c4756){_0x2eb7e9=_0x2c4756;_0x314ae9=0xc8;}else{_0x314ae9=0xce;}_0x21f4b9[_0xaf5e('0x16')](_0x314ae9);return _0x21f4b9[_0xaf5e('0x1d')](_0xaf5e('0x1e'),_0x55d234+'-'+_0x2eb7e9+'/'+_0x2c4756)['json'](_0x464601);}return null;};}function patchUpdates(_0x4f6231){return function(_0x2dda18){try{jsonpatch['apply'](_0x2dda18,_0x4f6231,!![]);}catch(_0xca4207){return BPromise[_0xaf5e('0x1f')](_0xca4207);}return _0x2dda18[_0xaf5e('0x20')]();};}function saveUpdates(_0x5980d7,_0x4aaf48){return function(_0x3456bf){if(_0x3456bf){return _0x3456bf[_0xaf5e('0x21')](_0x5980d7)[_0xaf5e('0x22')](function(_0x497064){return _0x497064;});}return null;};}function removeEntity(_0x3ba585,_0x516675){return function(_0x532ac8){if(_0x532ac8){return _0x532ac8[_0xaf5e('0x23')]()['then'](function(){_0x3ba585[_0xaf5e('0x16')](0xcc)[_0xaf5e('0x17')]();});}};}function handleEntityNotFound(_0x132641,_0x39b8b1){return function(_0x372951){if(!_0x372951){_0x132641[_0xaf5e('0x15')](0x194);}return _0x372951;};}function handleError(_0x3c07eb,_0x4258aa){_0x4258aa=_0x4258aa||0x1f4;return function(_0x24235a){logger[_0xaf5e('0x24')](_0x24235a[_0xaf5e('0x25')]);if(_0x24235a[_0xaf5e('0x26')]){delete _0x24235a[_0xaf5e('0x26')];}_0x3c07eb[_0xaf5e('0x16')](_0x4258aa)[_0xaf5e('0x27')](_0x24235a);};}exports[_0xaf5e('0x28')]=function(_0x45933d,_0x57cd2a){var _0x5b1ba2={},_0x5addb5={},_0x58b3e2={'count':0x0,'rows':[]};var _0x23e550=_[_0xaf5e('0x29')](db[_0xaf5e('0x2a')]['rawAttributes'],function(_0x499d9f){return{'name':_0x499d9f[_0xaf5e('0x2b')],'type':_0x499d9f[_0xaf5e('0x2c')][_0xaf5e('0x2d')]};});_0x5addb5[_0xaf5e('0x2e')]=_['map'](_0x23e550,'name');_0x5addb5['query']=_[_0xaf5e('0x2f')](_0x45933d[_0xaf5e('0x30')]);_0x5addb5[_0xaf5e('0x31')]=_[_0xaf5e('0x32')](_0x5addb5['model'],_0x5addb5['query']);_0x5b1ba2[_0xaf5e('0x33')]=_[_0xaf5e('0x32')](_0x5addb5[_0xaf5e('0x2e')],qs[_0xaf5e('0x34')](_0x45933d[_0xaf5e('0x30')][_0xaf5e('0x34')]));_0x5b1ba2[_0xaf5e('0x33')]=_0x5b1ba2[_0xaf5e('0x33')][_0xaf5e('0x35')]?_0x5b1ba2[_0xaf5e('0x33')]:_0x5addb5[_0xaf5e('0x2e')];if(!_0x45933d[_0xaf5e('0x30')][_0xaf5e('0x36')](_0xaf5e('0x37'))){_0x5b1ba2['limit']=qs['limit'](_0x45933d['query'][_0xaf5e('0x1a')]);_0x5b1ba2[_0xaf5e('0x19')]=qs[_0xaf5e('0x19')](_0x45933d['query'][_0xaf5e('0x19')]);}_0x5b1ba2[_0xaf5e('0x38')]=qs[_0xaf5e('0x39')](_0x45933d[_0xaf5e('0x30')][_0xaf5e('0x39')]);_0x5b1ba2[_0xaf5e('0x3a')]=qs[_0xaf5e('0x31')](_[_0xaf5e('0x3b')](_0x45933d[_0xaf5e('0x30')],_0x5addb5[_0xaf5e('0x31')]),_0x23e550);if(_0x45933d['query']['filter']){_0x5b1ba2[_0xaf5e('0x3a')]=_[_0xaf5e('0x3c')](_0x5b1ba2['where'],{'$or':_[_0xaf5e('0x29')](_0x23e550,function(_0x4aece3){if(_0x4aece3[_0xaf5e('0x2c')]!==_0xaf5e('0x3d')){var _0x392f5e={};_0x392f5e[_0x4aece3[_0xaf5e('0x26')]]={'$like':'%'+_0x45933d[_0xaf5e('0x30')][_0xaf5e('0x3e')]+'%'};return _0x392f5e;}})});}_0x5b1ba2=_[_0xaf5e('0x3c')]({},_0x5b1ba2,_0x45933d[_0xaf5e('0x3f')]);var _0x1ee043={'where':_0x5b1ba2['where']};return db['SalesforceAccount']['count'](_0x1ee043)[_0xaf5e('0x22')](function(_0x3b631a){_0x58b3e2[_0xaf5e('0x1c')]=_0x3b631a;if(_0x45933d[_0xaf5e('0x30')]['includeAll']){_0x5b1ba2[_0xaf5e('0x40')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xaf5e('0x41')](_0x5b1ba2);})['then'](function(_0x5122d5){_0x58b3e2[_0xaf5e('0x42')]=_0x5122d5;return _0x58b3e2;})['then'](respondWithFilteredResult(_0x57cd2a,_0x5b1ba2))['catch'](handleError(_0x57cd2a,null));};exports[_0xaf5e('0x43')]=function(_0x4a9adb,_0x3d03e4){var _0x45ea00={'raw':![],'where':{'id':_0x4a9adb['params']['id']}},_0x1ab3b3={};_0x1ab3b3[_0xaf5e('0x2e')]=_[_0xaf5e('0x2f')](db[_0xaf5e('0x2a')][_0xaf5e('0x44')]);_0x1ab3b3[_0xaf5e('0x30')]=_[_0xaf5e('0x2f')](_0x4a9adb[_0xaf5e('0x30')]);_0x1ab3b3[_0xaf5e('0x31')]=_['intersection'](_0x1ab3b3[_0xaf5e('0x2e')],_0x1ab3b3[_0xaf5e('0x30')]);_0x45ea00[_0xaf5e('0x33')]=_[_0xaf5e('0x32')](_0x1ab3b3[_0xaf5e('0x2e')],qs[_0xaf5e('0x34')](_0x4a9adb[_0xaf5e('0x30')][_0xaf5e('0x34')]));_0x45ea00['attributes']=_0x45ea00[_0xaf5e('0x33')][_0xaf5e('0x35')]?_0x45ea00['attributes']:_0x1ab3b3[_0xaf5e('0x2e')];if(_0x4a9adb[_0xaf5e('0x30')][_0xaf5e('0x45')]){_0x45ea00['include']=[{'all':!![]}];}_0x45ea00=_[_0xaf5e('0x3c')]({},_0x45ea00,_0x4a9adb[_0xaf5e('0x3f')]);return db[_0xaf5e('0x2a')][_0xaf5e('0x46')](_0x45ea00)[_0xaf5e('0x22')](handleEntityNotFound(_0x3d03e4,null))['then'](respondWithResult(_0x3d03e4,null))['catch'](handleError(_0x3d03e4,null));};exports[_0xaf5e('0x47')]=function(_0x1689e7,_0x59689a){return db[_0xaf5e('0x2a')][_0xaf5e('0x47')](_0x1689e7[_0xaf5e('0x48')],{})['then'](respondWithResult(_0x59689a,0xc9))['catch'](handleError(_0x59689a,null));};exports[_0xaf5e('0x21')]=function(_0x304817,_0x42ade7){if(_0x304817[_0xaf5e('0x48')]['id']){delete _0x304817[_0xaf5e('0x48')]['id'];}return db[_0xaf5e('0x2a')][_0xaf5e('0x46')]({'where':{'id':_0x304817[_0xaf5e('0x49')]['id']}})['then'](handleEntityNotFound(_0x42ade7,null))[_0xaf5e('0x22')](saveUpdates(_0x304817['body'],null))['then'](respondWithResult(_0x42ade7,null))[_0xaf5e('0x4a')](handleError(_0x42ade7,null));};exports[_0xaf5e('0x23')]=function(_0x2ec83c,_0x34a0ec){return db['SalesforceAccount'][_0xaf5e('0x46')]({'where':{'id':_0x2ec83c[_0xaf5e('0x49')]['id']}})['then'](handleEntityNotFound(_0x34a0ec,null))[_0xaf5e('0x22')](removeEntity(_0x34a0ec,null))[_0xaf5e('0x4a')](handleError(_0x34a0ec,null));};exports[_0xaf5e('0x4b')]=function(_0x400b89,_0x57013d,_0x31865e){var _0x2c8cb9={};var _0x4d055c={};var _0x5490cf;var _0x41c880;return db['SalesforceAccount'][_0xaf5e('0x4c')]({'where':{'id':_0x400b89[_0xaf5e('0x49')]['id']}})[_0xaf5e('0x22')](handleEntityNotFound(_0x57013d,null))[_0xaf5e('0x22')](function(_0xbb6fda){if(_0xbb6fda){_0x5490cf=_0xbb6fda;_0x4d055c['model']=_[_0xaf5e('0x2f')](db[_0xaf5e('0x4d')][_0xaf5e('0x44')]);_0x4d055c[_0xaf5e('0x30')]=_['keys'](_0x400b89[_0xaf5e('0x30')]);_0x4d055c['filters']=_['intersection'](_0x4d055c[_0xaf5e('0x2e')],_0x4d055c[_0xaf5e('0x30')]);_0x2c8cb9[_0xaf5e('0x33')]=_[_0xaf5e('0x32')](_0x4d055c['model'],qs[_0xaf5e('0x34')](_0x400b89[_0xaf5e('0x30')]['fields']));_0x2c8cb9[_0xaf5e('0x33')]=_0x2c8cb9[_0xaf5e('0x33')][_0xaf5e('0x35')]?_0x2c8cb9[_0xaf5e('0x33')]:_0x4d055c['model'];_0x2c8cb9[_0xaf5e('0x38')]=qs['sort'](_0x400b89['query'][_0xaf5e('0x39')]);_0x2c8cb9[_0xaf5e('0x3a')]=qs[_0xaf5e('0x31')](_[_0xaf5e('0x3b')](_0x400b89[_0xaf5e('0x30')],_0x4d055c[_0xaf5e('0x31')]));if(_0x400b89['query']['filter']){_0x2c8cb9[_0xaf5e('0x3a')]=_[_0xaf5e('0x3c')](_0x2c8cb9[_0xaf5e('0x3a')],{'$or':_['map'](_0x2c8cb9[_0xaf5e('0x33')],function(_0x165ac3){var _0x4513f8={};_0x4513f8[_0x165ac3]={'$like':'%'+_0x400b89[_0xaf5e('0x30')][_0xaf5e('0x3e')]+'%'};return _0x4513f8;})});}_0x2c8cb9=_[_0xaf5e('0x3c')]({},_0x2c8cb9,_0x400b89[_0xaf5e('0x3f')]);return _0x5490cf[_0xaf5e('0x4b')](_0x2c8cb9);}})['then'](function(_0x42dab2){if(_0x42dab2){_0x41c880=_0x42dab2[_0xaf5e('0x35')];if(!_0x400b89[_0xaf5e('0x30')]['hasOwnProperty'](_0xaf5e('0x37'))){_0x2c8cb9[_0xaf5e('0x1a')]=qs[_0xaf5e('0x1a')](_0x400b89[_0xaf5e('0x30')][_0xaf5e('0x1a')]);_0x2c8cb9[_0xaf5e('0x19')]=qs['offset'](_0x400b89[_0xaf5e('0x30')][_0xaf5e('0x19')]);}return _0x5490cf[_0xaf5e('0x4b')](_0x2c8cb9);}})[_0xaf5e('0x22')](function(_0xf6fe8b){if(_0xf6fe8b){return _0xf6fe8b?{'count':_0x41c880,'rows':_0xf6fe8b}:null;}})[_0xaf5e('0x22')](respondWithResult(_0x57013d,null))[_0xaf5e('0x4a')](handleError(_0x57013d,null));};exports['addConfiguration']=function(_0x55cbb4,_0x456121,_0xcf19c1){if(_0x55cbb4[_0xaf5e('0x48')]['id']){delete _0x55cbb4[_0xaf5e('0x48')]['id'];}return db[_0xaf5e('0x2a')][_0xaf5e('0x4c')]({'where':{'id':_0x55cbb4[_0xaf5e('0x49')]['id']}})[_0xaf5e('0x22')](handleEntityNotFound(_0x456121,null))['then'](function(_0x2321e1){if(_0x2321e1){_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x4e')]=_0x2321e1['id'];_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x4f')]=integrations['getSubjects'](_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x50')],_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x2c')]);_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x51')]=integrations[_0xaf5e('0x52')](_0x55cbb4['body'][_0xaf5e('0x50')],_0x55cbb4[_0xaf5e('0x48')][_0xaf5e('0x2c')]);return db['SalesforceConfiguration'][_0xaf5e('0x47')](_0x55cbb4['body'],{'include':[{'model':db[_0xaf5e('0x53')],'as':_0xaf5e('0x4f')},{'model':db[_0xaf5e('0x53')],'as':_0xaf5e('0x51')}]});}return null;})['then'](respondWithResult(_0x456121,null))[_0xaf5e('0x4a')](handleError(_0x456121,null));};exports[_0xaf5e('0x54')]=function(_0x4e9cc7,_0x3fc3b2,_0x284e75){var _0x3271a5;var _0x50f3ba='';var _0x2ad854=_0xaf5e('0x55');return db[_0xaf5e('0x2a')][_0xaf5e('0x4c')]({'where':{'id':_0x4e9cc7[_0xaf5e('0x49')]['id']},'attributes':['id',_0xaf5e('0x56'),_0xaf5e('0x57'),_0xaf5e('0x58'),_0xaf5e('0x59'),'password',_0xaf5e('0x5a')]})['then'](handleEntityNotFound(_0x3fc3b2,null))[_0xaf5e('0x22')](function(_0x19d632){if(_0x19d632){_0x50f3ba=_0x19d632[_0xaf5e('0x56')];var _0x3a623e=_0x50f3ba[_0xaf5e('0x5b')](-0x1);if(_0x3a623e==='/'){_0x50f3ba=_0x50f3ba['substring'](0x0,_0x50f3ba['lastIndexOf'](_0x3a623e));}_0x3271a5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x50f3ba,'clientId':_0x19d632[_0xaf5e('0x57')],'clientSecret':_0x19d632[_0xaf5e('0x58')]}});return _0x3271a5[_0xaf5e('0x5c')](_0x19d632['username'],_0x19d632[_0xaf5e('0x5d')]['concat'](_0x19d632[_0xaf5e('0x5a')]));}})[_0xaf5e('0x22')](function(_0x49dcac){if(_0x49dcac){if(!_[_0xaf5e('0x5e')](_0x4e9cc7['query'][_0xaf5e('0x5f')])){_0x2ad854=_0x4e9cc7[_0xaf5e('0x30')][_0xaf5e('0x5f')];}return _0x3271a5[_0xaf5e('0x60')](_0x2ad854)[_0xaf5e('0x61')]();}})[_0xaf5e('0x22')](function(_0x382187){var _0x18aa92=['OwnerId','ActivityDate',_0xaf5e('0x62'),_0xaf5e('0x63'),'Subject',_0xaf5e('0x64')];var _0x824c50=[_0xaf5e('0x65'),_0xaf5e('0x66'),_0xaf5e('0x67'),_0xaf5e('0x68'),'email',_0xaf5e('0x69'),_0xaf5e('0x6a')];if(_0x382187){_['remove'](_0x382187[_0xaf5e('0x34')],function(_0xb26798){return _0x18aa92['includes'](_0xb26798[_0xaf5e('0x26')])||!_0x824c50[_0xaf5e('0x6b')](_0xb26798[_0xaf5e('0x2c')]);});return{'count':_0x382187[_0xaf5e('0x34')]['length'],'rows':_[_0xaf5e('0x29')](_0x382187[_0xaf5e('0x34')],function(_0x47dafa){return{'id':_0x47dafa[_0xaf5e('0x26')],'name':_0x47dafa['label'],'custom':_0x47dafa[_0xaf5e('0x6c')],'options':_0x47dafa[_0xaf5e('0x6d')][_0xaf5e('0x35')]>0x0?_['map'](_0x47dafa[_0xaf5e('0x6d')],function(_0x163ac6){return{'name':_0x163ac6[_0xaf5e('0x6e')],'value':_0x163ac6[_0xaf5e('0x6f')]};}):_0x47dafa[_0xaf5e('0x2c')]==_0xaf5e('0x68')?[{'name':_0xaf5e('0x70'),'value':_0xaf5e('0x71')},{'name':_0xaf5e('0x72'),'value':'false'}]:[]};})};}})[_0xaf5e('0x22')](respondWithResult(_0x3fc3b2,null))['catch'](function(_0x291edb){var _0x1102e1=_0x4e9cc7[_0xaf5e('0x30')][_0xaf5e('0x73')]?0x1f4:_0x291edb['statusCode']||0x1f4;logger[_0xaf5e('0x24')](_0xaf5e('0x74'),_0xaf5e('0x54'),_0x1102e1,JSON[_0xaf5e('0x75')](_0x291edb));delete _0x291edb[_0xaf5e('0x26')];if(_0x1102e1===0x191){_0x1102e1=0x190;}_0x3fc3b2[_0xaf5e('0x16')](_0x1102e1)['send'](_0x4e9cc7[_0xaf5e('0x30')][_0xaf5e('0x73')]?{'message':_0xaf5e('0x76'),'statusCode':_0x291edb['statusCode']}:_0x291edb);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4caeb6e..abbdcb0 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 _0xa68b=['path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x55c114,_0x131136){var _0x5f0288=function(_0x23c1f7){while(--_0x23c1f7){_0x55c114['push'](_0x55c114['shift']());}};_0x5f0288(++_0x131136);}(_0xa68b,0xf6));var _0xba68=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xa68b[_0x50e40b];return _0x2608b7;};'use strict';var _=require('lodash');var util=require(_0xba68('0x0'));var logger=require(_0xba68('0x1'))(_0xba68('0x2'));var moment=require(_0xba68('0x3'));var BPromise=require(_0xba68('0x4'));var rp=require(_0xba68('0x5'));var fs=require('fs');var path=require(_0xba68('0x6'));var rimraf=require('rimraf');var config=require(_0xba68('0x7'));var attributes=require(_0xba68('0x8'));var integrations=require(_0xba68('0x9'));module[_0xba68('0xa')]=function(_0x384c96,_0x461319){return _0x384c96[_0xba68('0xb')](_0xba68('0xc'),attributes,{'tableName':_0xba68('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2670=['../../components/integrations/configuration','exports','define','int_salesforce_accounts','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x3b670b,_0x4fde17){var _0x1929da=function(_0x241a5a){while(--_0x241a5a){_0x3b670b['push'](_0x3b670b['shift']());}};_0x1929da(++_0x4fde17);}(_0x2670,0x180));var _0x0267=function(_0x43af10,_0xb68ed0){_0x43af10=_0x43af10-0x0;var _0x4a75c6=_0x2670[_0x43af10];return _0x4a75c6;};'use strict';var _=require('lodash');var util=require(_0x0267('0x0'));var logger=require(_0x0267('0x1'))(_0x0267('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0267('0x3'));var rimraf=require(_0x0267('0x4'));var config=require(_0x0267('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x0267('0x6'));module[_0x0267('0x7')]=function(_0x486b4b,_0x3724ea){return _0x486b4b[_0x0267('0x8')]('SalesforceAccount',attributes,{'tableName':_0x0267('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 2d09634..695ef1f 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 _0x745f=['attributes','include','map','model','then','ShowSalesforceAccount','raw','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x745f,0x68));var _0xf745=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x745f[_0x21f9c2];return _0x3da17f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf745('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf745('0x1'));var db=require(_0xf745('0x2'))['db'];var utils=require(_0xf745('0x3'));var logger=require(_0xf745('0x4'))(_0xf745('0x5'));var config=require(_0xf745('0x6'));var jayson=require(_0xf745('0x7'));var client=jayson[_0xf745('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f431b,_0x35ac10,_0x1d292b){return new BPromise(function(_0x2f19eb,_0x1aabc3){return client['request'](_0x2f431b,_0x1d292b)['then'](function(_0x159d08){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x35ac10,_0xf745('0x9'));logger[_0xf745('0xa')](_0xf745('0xb'),_0x35ac10,'request\x20sent',JSON[_0xf745('0xc')](_0x159d08));if(_0x159d08['error']){if(_0x159d08[_0xf745('0xd')][_0xf745('0xe')]===0x1f4){logger[_0xf745('0xd')](_0xf745('0xf'),_0x35ac10,_0x159d08[_0xf745('0xd')][_0xf745('0x10')]);return _0x1aabc3(_0x159d08[_0xf745('0xd')][_0xf745('0x10')]);}logger[_0xf745('0xd')](_0xf745('0xf'),_0x35ac10,_0x159d08[_0xf745('0xd')][_0xf745('0x10')]);return _0x2f19eb(_0x159d08['error'][_0xf745('0x10')]);}else{logger[_0xf745('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x35ac10,_0xf745('0x9'));_0x2f19eb(_0x159d08[_0xf745('0x12')]['message']);}})['catch'](function(_0x3471e4){logger['error'](_0xf745('0xf'),_0x35ac10,_0x3471e4);_0x1aabc3(_0x3471e4);});});}exports[_0xf745('0x13')]=function(_0x3063b6){var _0x191763=this;return new Promise(function(_0x26528c,_0x432a36){return db[_0xf745('0x14')][_0xf745('0x15')]({'raw':_0x3063b6['options']?_0x3063b6[_0xf745('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3063b6[_0xf745('0x16')]?_0x3063b6[_0xf745('0x16')][_0xf745('0x17')]||null:null,'attributes':_0x3063b6['options']?_0x3063b6['options'][_0xf745('0x18')]||null:null,'limit':_0x3063b6[_0xf745('0x16')]?_0x3063b6['options']['limit']||null:null,'include':_0x3063b6['options']?_0x3063b6[_0xf745('0x16')][_0xf745('0x19')]?_[_0xf745('0x1a')](_0x3063b6['options'][_0xf745('0x19')],function(_0x12e1d1){return{'model':db[_0x12e1d1['model']],'as':_0x12e1d1['as'],'attributes':_0x12e1d1[_0xf745('0x18')],'include':_0x12e1d1[_0xf745('0x19')]?_[_0xf745('0x1a')](_0x12e1d1[_0xf745('0x19')],function(_0x55c396){return{'model':db[_0x55c396[_0xf745('0x1b')]],'as':_0x55c396['as'],'attributes':_0x55c396[_0xf745('0x18')],'include':_0x55c396[_0xf745('0x19')]?_[_0xf745('0x1a')](_0x55c396[_0xf745('0x19')],function(_0x5d3de8){return{'model':db[_0x5d3de8[_0xf745('0x1b')]],'as':_0x5d3de8['as'],'attributes':_0x5d3de8['attributes']};}):[]};}):[]};}):[]:[]})[_0xf745('0x1c')](function(_0x54c5b3){logger[_0xf745('0x11')]('GetSalesforceAccount',_0x3063b6);logger[_0xf745('0xa')]('GetSalesforceAccount',_0x3063b6,JSON[_0xf745('0xc')](_0x54c5b3));_0x26528c(_0x54c5b3);})['catch'](function(_0x269d8a){logger[_0xf745('0xd')](_0xf745('0x13'),_0x269d8a[_0xf745('0x10')],_0x3063b6);_0x432a36(_0x191763['error'](0x1f4,_0x269d8a[_0xf745('0x10')]));});});};exports[_0xf745('0x1d')]=function(_0x29e884){var _0x7b4324=this;return new Promise(function(_0x3849bf,_0x3c48c0){return db['SalesforceAccount']['find']({'raw':_0x29e884['options']?_0x29e884[_0xf745('0x16')][_0xf745('0x1e')]===undefined?!![]:![]:!![],'where':_0x29e884['options']?_0x29e884['options'][_0xf745('0x17')]||null:null,'attributes':_0x29e884[_0xf745('0x16')]?_0x29e884[_0xf745('0x16')][_0xf745('0x18')]||null:null,'include':_0x29e884[_0xf745('0x16')]?_0x29e884[_0xf745('0x16')][_0xf745('0x19')]?_[_0xf745('0x1a')](_0x29e884[_0xf745('0x16')][_0xf745('0x19')],function(_0x5eea29){return{'model':db[_0x5eea29[_0xf745('0x1b')]],'as':_0x5eea29['as'],'attributes':_0x5eea29[_0xf745('0x18')],'include':_0x5eea29[_0xf745('0x19')]?_[_0xf745('0x1a')](_0x5eea29[_0xf745('0x19')],function(_0x399dbf){return{'model':db[_0x399dbf[_0xf745('0x1b')]],'as':_0x399dbf['as'],'attributes':_0x399dbf[_0xf745('0x18')],'include':_0x399dbf[_0xf745('0x19')]?_[_0xf745('0x1a')](_0x399dbf['include'],function(_0x217e0f){return{'model':db[_0x217e0f[_0xf745('0x1b')]],'as':_0x217e0f['as'],'attributes':_0x217e0f[_0xf745('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf745('0x1c')](function(_0xc7053f){logger[_0xf745('0x11')](_0xf745('0x1d'),_0x29e884);logger[_0xf745('0xa')](_0xf745('0x1d'),_0x29e884,JSON[_0xf745('0xc')](_0xc7053f));_0x3849bf(_0xc7053f);})[_0xf745('0x1f')](function(_0x3a2d1b){logger[_0xf745('0xd')](_0xf745('0x1d'),_0x3a2d1b['message'],_0x29e884);_0x3c48c0(_0x7b4324[_0xf745('0xd')](0x1f4,_0x3a2d1b[_0xf745('0x10')]));});});}; \ No newline at end of file +var _0x8115=['model','then','GetSalesforceAccount','find','ShowSalesforceAccount','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x8115,0x1c0));var _0x5811=function(_0x5e2d05,_0x2550ef){_0x5e2d05=_0x5e2d05-0x0;var _0x6d2786=_0x8115[_0x5e2d05];return _0x6d2786;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require(_0x5811('0x2'));var BPromise=require(_0x5811('0x3'));var rs=require(_0x5811('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x5'))['db'];var utils=require(_0x5811('0x6'));var logger=require(_0x5811('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5811('0x8'));var client=jayson[_0x5811('0x9')][_0x5811('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc835e1,_0x4461ea,_0x17a1f6){return new BPromise(function(_0xcdc844,_0x4a5146){return client['request'](_0xc835e1,_0x17a1f6)['then'](function(_0x769a11){logger[_0x5811('0xb')](_0x5811('0xc'),_0x4461ea,_0x5811('0xd'));logger[_0x5811('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4461ea,'request\x20sent',JSON[_0x5811('0xf')](_0x769a11));if(_0x769a11[_0x5811('0x10')]){if(_0x769a11['error']['code']===0x1f4){logger['error'](_0x5811('0xc'),_0x4461ea,_0x769a11['error']['message']);return _0x4a5146(_0x769a11[_0x5811('0x10')]['message']);}logger[_0x5811('0x10')](_0x5811('0xc'),_0x4461ea,_0x769a11['error'][_0x5811('0x11')]);return _0xcdc844(_0x769a11['error'][_0x5811('0x11')]);}else{logger[_0x5811('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x4461ea,'request\x20sent');_0xcdc844(_0x769a11[_0x5811('0x12')]['message']);}})['catch'](function(_0x4bfa28){logger['error'](_0x5811('0xc'),_0x4461ea,_0x4bfa28);_0x4a5146(_0x4bfa28);});});}exports['GetSalesforceAccount']=function(_0x285f85){var _0x4da2b9=this;return new Promise(function(_0x127ee4,_0x2bc28d){return db[_0x5811('0x13')][_0x5811('0x14')]({'raw':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')][_0x5811('0x16')]===undefined?!![]:![]:!![],'where':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')][_0x5811('0x17')]||null:null,'attributes':_0x285f85['options']?_0x285f85[_0x5811('0x15')][_0x5811('0x18')]||null:null,'limit':_0x285f85[_0x5811('0x15')]?_0x285f85['options'][_0x5811('0x19')]||null:null,'include':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')]['include']?_[_0x5811('0x1a')](_0x285f85[_0x5811('0x15')][_0x5811('0x1b')],function(_0x5620c3){return{'model':db[_0x5620c3['model']],'as':_0x5620c3['as'],'attributes':_0x5620c3['attributes'],'include':_0x5620c3['include']?_['map'](_0x5620c3[_0x5811('0x1b')],function(_0x1226b0){return{'model':db[_0x1226b0[_0x5811('0x1c')]],'as':_0x1226b0['as'],'attributes':_0x1226b0[_0x5811('0x18')],'include':_0x1226b0['include']?_[_0x5811('0x1a')](_0x1226b0['include'],function(_0x3fca28){return{'model':db[_0x3fca28[_0x5811('0x1c')]],'as':_0x3fca28['as'],'attributes':_0x3fca28[_0x5811('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5811('0x1d')](function(_0xc4a18b){logger[_0x5811('0xb')]('GetSalesforceAccount',_0x285f85);logger['debug']('GetSalesforceAccount',_0x285f85,JSON[_0x5811('0xf')](_0xc4a18b));_0x127ee4(_0xc4a18b);})['catch'](function(_0x2e6333){logger[_0x5811('0x10')](_0x5811('0x1e'),_0x2e6333[_0x5811('0x11')],_0x285f85);_0x2bc28d(_0x4da2b9['error'](0x1f4,_0x2e6333[_0x5811('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x626526){var _0x136772=this;return new Promise(function(_0x468c90,_0x3d8223){return db[_0x5811('0x13')][_0x5811('0x1f')]({'raw':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x626526[_0x5811('0x15')]?_0x626526['options'][_0x5811('0x17')]||null:null,'attributes':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')][_0x5811('0x18')]||null:null,'include':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')][_0x5811('0x1b')]?_['map'](_0x626526[_0x5811('0x15')]['include'],function(_0x1ac580){return{'model':db[_0x1ac580['model']],'as':_0x1ac580['as'],'attributes':_0x1ac580['attributes'],'include':_0x1ac580['include']?_[_0x5811('0x1a')](_0x1ac580[_0x5811('0x1b')],function(_0x15a39b){return{'model':db[_0x15a39b[_0x5811('0x1c')]],'as':_0x15a39b['as'],'attributes':_0x15a39b['attributes'],'include':_0x15a39b['include']?_['map'](_0x15a39b[_0x5811('0x1b')],function(_0x15856d){return{'model':db[_0x15856d['model']],'as':_0x15856d['as'],'attributes':_0x15856d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5811('0x1d')](function(_0x356447){logger['info'](_0x5811('0x20'),_0x626526);logger[_0x5811('0xe')](_0x5811('0x20'),_0x626526,JSON['stringify'](_0x356447));_0x468c90(_0x356447);})[_0x5811('0x21')](function(_0x3d0fa1){logger[_0x5811('0x10')](_0x5811('0x20'),_0x3d0fa1[_0x5811('0x11')],_0x626526);_0x3d8223(_0x136772[_0x5811('0x10')](0x1f4,_0x3d0fa1[_0x5811('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index b4bcf2f..f35535c 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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xdb28,0x106));var _0x8db2=function(_0x292776,_0x14bdfa){_0x292776=_0x292776-0x0;var _0x4b4bdd=_0xdb28[_0x292776];return _0x4b4bdd;};'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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x12047b,_0x3b5a28){var _0x1c4dc7=function(_0x3f6ffc){while(--_0x3f6ffc){_0x12047b['push'](_0x12047b['shift']());}};_0x1c4dc7(++_0x3b5a28);}(_0xadb5,0xad));var _0x5adb=function(_0x5a6e97,_0x2bc426){_0x5a6e97=_0x5a6e97-0x0;var _0x561fdc=_0xadb5[_0x5a6e97];return _0x561fdc;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b6d94cc..4124bb1 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 _0x3ff1=['account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x3ff1,0x19a));var _0x13ff=function(_0xbfa54f,_0x5896e4){_0xbfa54f=_0xbfa54f-0x0;var _0x192f42=_0x3ff1[_0xbfa54f];return _0x192f42;};'use strict';var Sequelize=require(_0x13ff('0x0'));module[_0x13ff('0x1')]={'name':{'type':Sequelize[_0x13ff('0x2')]},'description':{'type':Sequelize[_0x13ff('0x2')]},'ticketType':{'type':Sequelize[_0x13ff('0x3')](_0x13ff('0x4'),_0x13ff('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x13ff('0x3')](_0x13ff('0x6'),_0x13ff('0x7'),_0x13ff('0x8'),_0x13ff('0x9'),_0x13ff('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x13ff('0x3')](_0x13ff('0xb'),_0x13ff('0x7'),'lead',_0x13ff('0xa')),'defaultValue':_0x13ff('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x13ff('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x13ff('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x13ff('0x2')]}}; \ No newline at end of file +var _0x5746=['sequelize','exports','STRING','ENUM','Task','contact_lead','contact','lead','account'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x5746,0xd8));var _0x6574=function(_0x2cc8bc,_0x2bea91){_0x2cc8bc=_0x2cc8bc-0x0;var _0x5823d1=_0x5746[_0x2cc8bc];return _0x5823d1;};'use strict';var Sequelize=require(_0x6574('0x0'));module[_0x6574('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6574('0x2')]},'ticketType':{'type':Sequelize[_0x6574('0x3')]('Task','Case'),'defaultValue':_0x6574('0x4')},'moduleSearch':{'type':Sequelize[_0x6574('0x3')](_0x6574('0x5'),_0x6574('0x6'),_0x6574('0x7'),'account_contact_lead','account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6574('0x3')]('nothing',_0x6574('0x6'),_0x6574('0x7'),_0x6574('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x6574('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x6574('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 7fa29b8..8da3832 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 _0x35b6=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','SalesforceConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','includeAll','include','findAll','rows','catch','keys','options','create','body','find','params','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','squel','papaparse','ioredis'];(function(_0x327eed,_0x4c7d26){var _0x370724=function(_0x2f7cb7){while(--_0x2f7cb7){_0x327eed['push'](_0x327eed['shift']());}};_0x370724(++_0x4c7d26);}(_0x35b6,0x8e));var _0x635b=function(_0x35b842,_0x1ebda6){_0x35b842=_0x35b842-0x0;var _0x313074=_0x35b6[_0x35b842];return _0x313074;};'use strict';var emlformat=require(_0x635b('0x0'));var rimraf=require(_0x635b('0x1'));var zipdir=require(_0x635b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x635b('0x3'));var moment=require(_0x635b('0x4'));var BPromise=require(_0x635b('0x5'));var Mustache=require(_0x635b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x635b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x635b('0x8'));var _=require('lodash');var squel=require(_0x635b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x635b('0x7'));var querystring=require('querystring');var Papa=require(_0x635b('0xa'));var Redis=require(_0x635b('0xb'));var authService=require(_0x635b('0xc'));var qs=require(_0x635b('0xd'));var as=require(_0x635b('0xe'));var hardwareService=require(_0x635b('0xf'));var logger=require(_0x635b('0x10'))(_0x635b('0x11'));var utils=require(_0x635b('0x12'));var config=require(_0x635b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x635b('0x14'))['db'];function respondWithStatusCode(_0x35533d,_0x19163a){_0x19163a=_0x19163a||0xcc;return function(_0x48d655){if(_0x48d655){return _0x35533d['sendStatus'](_0x19163a);}return _0x35533d[_0x635b('0x15')](_0x19163a)[_0x635b('0x16')]();};}function respondWithResult(_0x436d0e,_0x37d4a1){_0x37d4a1=_0x37d4a1||0xc8;return function(_0x53aa04){if(_0x53aa04){return _0x436d0e[_0x635b('0x15')](_0x37d4a1)[_0x635b('0x17')](_0x53aa04);}};}function respondWithFilteredResult(_0x26cbbc,_0x440cf0){return function(_0x30ec6a){if(_0x30ec6a){var _0x14554f=typeof _0x440cf0[_0x635b('0x18')]===_0x635b('0x19')&&typeof _0x440cf0[_0x635b('0x1a')]===_0x635b('0x19');var _0x3af6b5=_0x30ec6a[_0x635b('0x1b')];var _0x36d1bd=_0x14554f?0x0:_0x440cf0[_0x635b('0x18')];var _0x340475=_0x14554f?_0x30ec6a[_0x635b('0x1b')]:_0x440cf0[_0x635b('0x18')]+_0x440cf0[_0x635b('0x1a')];var _0x1111c4;if(_0x340475>=_0x3af6b5){_0x340475=_0x3af6b5;_0x1111c4=0xc8;}else{_0x1111c4=0xce;}_0x26cbbc[_0x635b('0x15')](_0x1111c4);return _0x26cbbc[_0x635b('0x1c')](_0x635b('0x1d'),_0x36d1bd+'-'+_0x340475+'/'+_0x3af6b5)[_0x635b('0x17')](_0x30ec6a);}return null;};}function patchUpdates(_0x2f9061){return function(_0x2ae863){try{jsonpatch[_0x635b('0x1e')](_0x2ae863,_0x2f9061,!![]);}catch(_0x3c8b4d){return BPromise[_0x635b('0x1f')](_0x3c8b4d);}return _0x2ae863[_0x635b('0x20')]();};}function saveUpdates(_0x21c86c,_0xa4ac2d){return function(_0x221b88){if(_0x221b88){return _0x221b88[_0x635b('0x21')](_0x21c86c)['then'](function(_0xab2a3c){return _0xab2a3c;});}return null;};}function removeEntity(_0x31a548,_0x399ba3){return function(_0x3fde53){if(_0x3fde53){return _0x3fde53[_0x635b('0x22')]()[_0x635b('0x23')](function(){_0x31a548[_0x635b('0x15')](0xcc)[_0x635b('0x16')]();});}};}function handleEntityNotFound(_0x527b5d,_0x34fb55){return function(_0x5d44f1){if(!_0x5d44f1){_0x527b5d[_0x635b('0x24')](0x194);}return _0x5d44f1;};}function handleError(_0x553624,_0x23c2ae){_0x23c2ae=_0x23c2ae||0x1f4;return function(_0x31a891){logger['error'](_0x31a891[_0x635b('0x25')]);if(_0x31a891[_0x635b('0x26')]){delete _0x31a891[_0x635b('0x26')];}_0x553624[_0x635b('0x15')](_0x23c2ae)[_0x635b('0x27')](_0x31a891);};}exports[_0x635b('0x28')]=function(_0xcb4e19,_0x281538){var _0x29572d={},_0x3cf079={},_0x2b42f2={'count':0x0,'rows':[]};var _0x40c9c8=_['map'](db[_0x635b('0x29')][_0x635b('0x2a')],function(_0x461042){return{'name':_0x461042['fieldName'],'type':_0x461042[_0x635b('0x2b')][_0x635b('0x2c')]};});_0x3cf079[_0x635b('0x2d')]=_['map'](_0x40c9c8,_0x635b('0x26'));_0x3cf079[_0x635b('0x2e')]=_['keys'](_0xcb4e19[_0x635b('0x2e')]);_0x3cf079[_0x635b('0x2f')]=_[_0x635b('0x30')](_0x3cf079[_0x635b('0x2d')],_0x3cf079[_0x635b('0x2e')]);_0x29572d[_0x635b('0x31')]=_[_0x635b('0x30')](_0x3cf079[_0x635b('0x2d')],qs['fields'](_0xcb4e19[_0x635b('0x2e')][_0x635b('0x32')]));_0x29572d[_0x635b('0x31')]=_0x29572d[_0x635b('0x31')][_0x635b('0x33')]?_0x29572d[_0x635b('0x31')]:_0x3cf079[_0x635b('0x2d')];if(!_0xcb4e19[_0x635b('0x2e')][_0x635b('0x34')](_0x635b('0x35'))){_0x29572d[_0x635b('0x1a')]=qs['limit'](_0xcb4e19['query']['limit']);_0x29572d[_0x635b('0x18')]=qs[_0x635b('0x18')](_0xcb4e19[_0x635b('0x2e')]['offset']);}_0x29572d[_0x635b('0x36')]=qs[_0x635b('0x37')](_0xcb4e19[_0x635b('0x2e')][_0x635b('0x37')]);_0x29572d[_0x635b('0x38')]=qs[_0x635b('0x2f')](_['pick'](_0xcb4e19[_0x635b('0x2e')],_0x3cf079[_0x635b('0x2f')]),_0x40c9c8);if(_0xcb4e19[_0x635b('0x2e')][_0x635b('0x39')]){_0x29572d[_0x635b('0x38')]=_[_0x635b('0x3a')](_0x29572d['where'],{'$or':_[_0x635b('0x3b')](_0x40c9c8,function(_0x429f55){if(_0x429f55['type']!=='VIRTUAL'){var _0x50bd8={};_0x50bd8[_0x429f55[_0x635b('0x26')]]={'$like':'%'+_0xcb4e19[_0x635b('0x2e')][_0x635b('0x39')]+'%'};return _0x50bd8;}})});}_0x29572d=_[_0x635b('0x3a')]({},_0x29572d,_0xcb4e19['options']);var _0x2003a7={'where':_0x29572d['where']};return db[_0x635b('0x29')][_0x635b('0x1b')](_0x2003a7)[_0x635b('0x23')](function(_0x52869f){_0x2b42f2[_0x635b('0x1b')]=_0x52869f;if(_0xcb4e19[_0x635b('0x2e')][_0x635b('0x3c')]){_0x29572d[_0x635b('0x3d')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x635b('0x3e')](_0x29572d);})[_0x635b('0x23')](function(_0x30fbc2){_0x2b42f2[_0x635b('0x3f')]=_0x30fbc2;return _0x2b42f2;})[_0x635b('0x23')](respondWithFilteredResult(_0x281538,_0x29572d))[_0x635b('0x40')](handleError(_0x281538,null));};exports['show']=function(_0x27f91d,_0x1aa04b){var _0x4614e0={'raw':![],'where':{'id':_0x27f91d['params']['id']}},_0x5dbe13={};_0x5dbe13[_0x635b('0x2d')]=_[_0x635b('0x41')](db[_0x635b('0x29')]['rawAttributes']);_0x5dbe13[_0x635b('0x2e')]=_[_0x635b('0x41')](_0x27f91d[_0x635b('0x2e')]);_0x5dbe13[_0x635b('0x2f')]=_['intersection'](_0x5dbe13[_0x635b('0x2d')],_0x5dbe13['query']);_0x4614e0[_0x635b('0x31')]=_[_0x635b('0x30')](_0x5dbe13[_0x635b('0x2d')],qs['fields'](_0x27f91d[_0x635b('0x2e')][_0x635b('0x32')]));_0x4614e0['attributes']=_0x4614e0[_0x635b('0x31')]['length']?_0x4614e0[_0x635b('0x31')]:_0x5dbe13['model'];if(_0x27f91d[_0x635b('0x2e')]['includeAll']){_0x4614e0['include']=[{'all':!![]}];}_0x4614e0=_['merge']({},_0x4614e0,_0x27f91d[_0x635b('0x42')]);return db[_0x635b('0x29')]['find'](_0x4614e0)[_0x635b('0x23')](handleEntityNotFound(_0x1aa04b,null))['then'](respondWithResult(_0x1aa04b,null))[_0x635b('0x40')](handleError(_0x1aa04b,null));};exports[_0x635b('0x43')]=function(_0x451f17,_0x39f4d5){return db['SalesforceConfiguration'][_0x635b('0x43')](_0x451f17['body'],{})[_0x635b('0x23')](respondWithResult(_0x39f4d5,0xc9))['catch'](handleError(_0x39f4d5,null));};exports[_0x635b('0x21')]=function(_0x4aad8b,_0x5d0182){if(_0x4aad8b[_0x635b('0x44')]['id']){delete _0x4aad8b[_0x635b('0x44')]['id'];}return db[_0x635b('0x29')][_0x635b('0x45')]({'where':{'id':_0x4aad8b[_0x635b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d0182,null))[_0x635b('0x23')](saveUpdates(_0x4aad8b['body'],null))[_0x635b('0x23')](respondWithResult(_0x5d0182,null))[_0x635b('0x40')](handleError(_0x5d0182,null));};exports['destroy']=function(_0x3b0d15,_0x49f050){return db[_0x635b('0x29')][_0x635b('0x45')]({'where':{'id':_0x3b0d15[_0x635b('0x46')]['id']}})['then'](handleEntityNotFound(_0x49f050,null))[_0x635b('0x23')](removeEntity(_0x49f050,null))[_0x635b('0x40')](handleError(_0x49f050,null));};exports[_0x635b('0x47')]=function(_0x431924,_0x19b6ce,_0xf386a0){var _0x3429ea={};var _0x37bec5={};var _0x53b8de;var _0x2a7451;return db['SalesforceConfiguration'][_0x635b('0x48')]({'where':{'id':_0x431924[_0x635b('0x46')]['id']}})[_0x635b('0x23')](handleEntityNotFound(_0x19b6ce,null))[_0x635b('0x23')](function(_0x567a21){if(_0x567a21){_0x53b8de=_0x567a21;_0x37bec5[_0x635b('0x2d')]=_[_0x635b('0x41')](db[_0x635b('0x49')][_0x635b('0x2a')]);_0x37bec5[_0x635b('0x2e')]=_[_0x635b('0x41')](_0x431924[_0x635b('0x2e')]);_0x37bec5[_0x635b('0x2f')]=_[_0x635b('0x30')](_0x37bec5['model'],_0x37bec5[_0x635b('0x2e')]);_0x3429ea['attributes']=_[_0x635b('0x30')](_0x37bec5[_0x635b('0x2d')],qs['fields'](_0x431924[_0x635b('0x2e')][_0x635b('0x32')]));_0x3429ea[_0x635b('0x31')]=_0x3429ea[_0x635b('0x31')][_0x635b('0x33')]?_0x3429ea[_0x635b('0x31')]:_0x37bec5[_0x635b('0x2d')];_0x3429ea[_0x635b('0x36')]=qs['sort'](_0x431924[_0x635b('0x2e')][_0x635b('0x37')]);_0x3429ea[_0x635b('0x38')]=qs[_0x635b('0x2f')](_[_0x635b('0x4a')](_0x431924['query'],_0x37bec5['filters']));if(_0x431924[_0x635b('0x2e')][_0x635b('0x39')]){_0x3429ea[_0x635b('0x38')]=_['merge'](_0x3429ea[_0x635b('0x38')],{'$or':_[_0x635b('0x3b')](_0x3429ea[_0x635b('0x31')],function(_0x4163f9){var _0x4751a0={};_0x4751a0[_0x4163f9]={'$like':'%'+_0x431924[_0x635b('0x2e')][_0x635b('0x39')]+'%'};return _0x4751a0;})});}_0x3429ea=_[_0x635b('0x3a')]({},_0x3429ea,_0x431924[_0x635b('0x42')]);return _0x53b8de[_0x635b('0x47')](_0x3429ea);}})[_0x635b('0x23')](function(_0x475574){if(_0x475574){_0x2a7451=_0x475574['length'];if(!_0x431924['query'][_0x635b('0x34')]('nolimit')){_0x3429ea[_0x635b('0x1a')]=qs['limit'](_0x431924[_0x635b('0x2e')]['limit']);_0x3429ea[_0x635b('0x18')]=qs['offset'](_0x431924[_0x635b('0x2e')]['offset']);}return _0x53b8de[_0x635b('0x47')](_0x3429ea);}})[_0x635b('0x23')](function(_0x35685a){if(_0x35685a){return _0x35685a?{'count':_0x2a7451,'rows':_0x35685a}:null;}})[_0x635b('0x23')](respondWithResult(_0x19b6ce,null))[_0x635b('0x40')](handleError(_0x19b6ce,null));};exports['getSubjects']=function(_0xc4bb66,_0x373b95,_0x394603){var _0x28f2b3={};var _0x158c33={};var _0x2f4fef;var _0xa9fa39;return db[_0x635b('0x29')][_0x635b('0x48')]({'where':{'id':_0xc4bb66['params']['id']}})['then'](handleEntityNotFound(_0x373b95,null))['then'](function(_0x9990fb){if(_0x9990fb){_0x2f4fef=_0x9990fb;_0x158c33[_0x635b('0x2d')]=_[_0x635b('0x41')](db[_0x635b('0x49')][_0x635b('0x2a')]);_0x158c33[_0x635b('0x2e')]=_[_0x635b('0x41')](_0xc4bb66['query']);_0x158c33[_0x635b('0x2f')]=_['intersection'](_0x158c33[_0x635b('0x2d')],_0x158c33['query']);_0x28f2b3['attributes']=_[_0x635b('0x30')](_0x158c33[_0x635b('0x2d')],qs['fields'](_0xc4bb66[_0x635b('0x2e')][_0x635b('0x32')]));_0x28f2b3[_0x635b('0x31')]=_0x28f2b3[_0x635b('0x31')]['length']?_0x28f2b3[_0x635b('0x31')]:_0x158c33[_0x635b('0x2d')];_0x28f2b3[_0x635b('0x36')]=qs[_0x635b('0x37')](_0xc4bb66[_0x635b('0x2e')]['sort']);_0x28f2b3[_0x635b('0x38')]=qs['filters'](_[_0x635b('0x4a')](_0xc4bb66[_0x635b('0x2e')],_0x158c33[_0x635b('0x2f')]));if(_0xc4bb66['query'][_0x635b('0x39')]){_0x28f2b3[_0x635b('0x38')]=_[_0x635b('0x3a')](_0x28f2b3[_0x635b('0x38')],{'$or':_[_0x635b('0x3b')](_0x28f2b3[_0x635b('0x31')],function(_0x520a78){var _0x2b8b42={};_0x2b8b42[_0x520a78]={'$like':'%'+_0xc4bb66[_0x635b('0x2e')][_0x635b('0x39')]+'%'};return _0x2b8b42;})});}_0x28f2b3=_[_0x635b('0x3a')]({},_0x28f2b3,_0xc4bb66['options']);return _0x2f4fef[_0x635b('0x4b')](_0x28f2b3);}})[_0x635b('0x23')](function(_0x2bcf91){if(_0x2bcf91){_0xa9fa39=_0x2bcf91[_0x635b('0x33')];if(!_0xc4bb66[_0x635b('0x2e')][_0x635b('0x34')]('nolimit')){_0x28f2b3[_0x635b('0x1a')]=qs[_0x635b('0x1a')](_0xc4bb66[_0x635b('0x2e')][_0x635b('0x1a')]);_0x28f2b3['offset']=qs[_0x635b('0x18')](_0xc4bb66[_0x635b('0x2e')][_0x635b('0x18')]);}return _0x2f4fef[_0x635b('0x4b')](_0x28f2b3);}})[_0x635b('0x23')](function(_0x5dab70){if(_0x5dab70){return _0x5dab70?{'count':_0xa9fa39,'rows':_0x5dab70}:null;}})[_0x635b('0x23')](respondWithResult(_0x373b95,null))[_0x635b('0x40')](handleError(_0x373b95,null));};exports['getDescriptions']=function(_0x11f53f,_0x12a5f3,_0x1ba501){var _0x5f2be={};var _0xc1b949={};var _0xaa50;var _0x359106;return db[_0x635b('0x29')][_0x635b('0x48')]({'where':{'id':_0x11f53f['params']['id']}})[_0x635b('0x23')](handleEntityNotFound(_0x12a5f3,null))[_0x635b('0x23')](function(_0xdc75bb){if(_0xdc75bb){_0xaa50=_0xdc75bb;_0xc1b949[_0x635b('0x2d')]=_['keys'](db['SalesforceField'][_0x635b('0x2a')]);_0xc1b949[_0x635b('0x2e')]=_[_0x635b('0x41')](_0x11f53f[_0x635b('0x2e')]);_0xc1b949['filters']=_['intersection'](_0xc1b949[_0x635b('0x2d')],_0xc1b949[_0x635b('0x2e')]);_0x5f2be['attributes']=_[_0x635b('0x30')](_0xc1b949[_0x635b('0x2d')],qs['fields'](_0x11f53f[_0x635b('0x2e')][_0x635b('0x32')]));_0x5f2be[_0x635b('0x31')]=_0x5f2be[_0x635b('0x31')][_0x635b('0x33')]?_0x5f2be[_0x635b('0x31')]:_0xc1b949['model'];_0x5f2be[_0x635b('0x36')]=qs[_0x635b('0x37')](_0x11f53f['query'][_0x635b('0x37')]);_0x5f2be['where']=qs[_0x635b('0x2f')](_[_0x635b('0x4a')](_0x11f53f['query'],_0xc1b949[_0x635b('0x2f')]));if(_0x11f53f[_0x635b('0x2e')][_0x635b('0x39')]){_0x5f2be['where']=_[_0x635b('0x3a')](_0x5f2be[_0x635b('0x38')],{'$or':_[_0x635b('0x3b')](_0x5f2be['attributes'],function(_0x5a4423){var _0x8c632f={};_0x8c632f[_0x5a4423]={'$like':'%'+_0x11f53f[_0x635b('0x2e')][_0x635b('0x39')]+'%'};return _0x8c632f;})});}_0x5f2be=_[_0x635b('0x3a')]({},_0x5f2be,_0x11f53f['options']);return _0xaa50[_0x635b('0x4c')](_0x5f2be);}})[_0x635b('0x23')](function(_0x311d77){if(_0x311d77){_0x359106=_0x311d77[_0x635b('0x33')];if(!_0x11f53f[_0x635b('0x2e')][_0x635b('0x34')](_0x635b('0x35'))){_0x5f2be[_0x635b('0x1a')]=qs[_0x635b('0x1a')](_0x11f53f[_0x635b('0x2e')][_0x635b('0x1a')]);_0x5f2be[_0x635b('0x18')]=qs[_0x635b('0x18')](_0x11f53f[_0x635b('0x2e')][_0x635b('0x18')]);}return _0xaa50[_0x635b('0x4c')](_0x5f2be);}})['then'](function(_0x1ba404){if(_0x1ba404){return _0x1ba404?{'count':_0x359106,'rows':_0x1ba404}:null;}})[_0x635b('0x23')](respondWithResult(_0x12a5f3,null))['catch'](handleError(_0x12a5f3,null));}; \ No newline at end of file +var _0xfb10=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','SalesforceField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x15cb50,_0x49587b){var _0x423caa=function(_0x501371){while(--_0x501371){_0x15cb50['push'](_0x15cb50['shift']());}};_0x423caa(++_0x49587b);}(_0xfb10,0x13c));var _0x0fb1=function(_0x28e6bd,_0x209fd7){_0x28e6bd=_0x28e6bd-0x0;var _0x3ef264=_0xfb10[_0x28e6bd];return _0x3ef264;};'use strict';var emlformat=require(_0x0fb1('0x0'));var rimraf=require(_0x0fb1('0x1'));var zipdir=require(_0x0fb1('0x2'));var jsonpatch=require(_0x0fb1('0x3'));var rp=require(_0x0fb1('0x4'));var moment=require(_0x0fb1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fb1('0x6'));var util=require(_0x0fb1('0x7'));var path=require(_0x0fb1('0x8'));var sox=require('sox');var csv=require(_0x0fb1('0x9'));var ejs=require(_0x0fb1('0xa'));var fs=require('fs');var fs_extra=require(_0x0fb1('0xb'));var _=require('lodash');var squel=require(_0x0fb1('0xc'));var crypto=require(_0x0fb1('0xd'));var jsforce=require(_0x0fb1('0xe'));var deskjs=require(_0x0fb1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0fb1('0x10'));var Papa=require(_0x0fb1('0x11'));var Redis=require('ioredis');var authService=require(_0x0fb1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fb1('0x13'));var hardwareService=require(_0x0fb1('0x14'));var logger=require(_0x0fb1('0x15'))(_0x0fb1('0x16'));var utils=require(_0x0fb1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0fb1('0x18'));var db=require(_0x0fb1('0x19'))['db'];function respondWithStatusCode(_0x5d5636,_0x33fd70){_0x33fd70=_0x33fd70||0xcc;return function(_0x1158d0){if(_0x1158d0){return _0x5d5636[_0x0fb1('0x1a')](_0x33fd70);}return _0x5d5636[_0x0fb1('0x1b')](_0x33fd70)[_0x0fb1('0x1c')]();};}function respondWithResult(_0x548a43,_0x7d5bff){_0x7d5bff=_0x7d5bff||0xc8;return function(_0x4f81dc){if(_0x4f81dc){return _0x548a43[_0x0fb1('0x1b')](_0x7d5bff)[_0x0fb1('0x1d')](_0x4f81dc);}};}function respondWithFilteredResult(_0x131ba5,_0x39a4a4){return function(_0x117521){if(_0x117521){var _0x31b872=typeof _0x39a4a4[_0x0fb1('0x1e')]===_0x0fb1('0x1f')&&typeof _0x39a4a4['limit']===_0x0fb1('0x1f');var _0x5d8ed6=_0x117521[_0x0fb1('0x20')];var _0x328a5d=_0x31b872?0x0:_0x39a4a4[_0x0fb1('0x1e')];var _0x4d2821=_0x31b872?_0x117521[_0x0fb1('0x20')]:_0x39a4a4[_0x0fb1('0x1e')]+_0x39a4a4['limit'];var _0x703a82;if(_0x4d2821>=_0x5d8ed6){_0x4d2821=_0x5d8ed6;_0x703a82=0xc8;}else{_0x703a82=0xce;}_0x131ba5[_0x0fb1('0x1b')](_0x703a82);return _0x131ba5['set'](_0x0fb1('0x21'),_0x328a5d+'-'+_0x4d2821+'/'+_0x5d8ed6)['json'](_0x117521);}return null;};}function patchUpdates(_0x2ce3f3){return function(_0x196506){try{jsonpatch[_0x0fb1('0x22')](_0x196506,_0x2ce3f3,!![]);}catch(_0x24b61f){return BPromise['reject'](_0x24b61f);}return _0x196506[_0x0fb1('0x23')]();};}function saveUpdates(_0x347b6c,_0x26953d){return function(_0x7922b9){if(_0x7922b9){return _0x7922b9['update'](_0x347b6c)[_0x0fb1('0x24')](function(_0x73aca4){return _0x73aca4;});}return null;};}function removeEntity(_0x401590,_0x38dfd3){return function(_0x1d97f5){if(_0x1d97f5){return _0x1d97f5[_0x0fb1('0x25')]()['then'](function(){_0x401590['status'](0xcc)[_0x0fb1('0x1c')]();});}};}function handleEntityNotFound(_0x398801,_0x5300ed){return function(_0xfa58ff){if(!_0xfa58ff){_0x398801[_0x0fb1('0x1a')](0x194);}return _0xfa58ff;};}function handleError(_0x5c7064,_0x5ca8d1){_0x5ca8d1=_0x5ca8d1||0x1f4;return function(_0x44f29f){logger[_0x0fb1('0x26')](_0x44f29f[_0x0fb1('0x27')]);if(_0x44f29f[_0x0fb1('0x28')]){delete _0x44f29f[_0x0fb1('0x28')];}_0x5c7064['status'](_0x5ca8d1)[_0x0fb1('0x29')](_0x44f29f);};}exports[_0x0fb1('0x2a')]=function(_0x5c11d1,_0x339162){var _0x328a05={},_0x147e78={},_0x12ff27={'count':0x0,'rows':[]};var _0x2ab8db=_[_0x0fb1('0x2b')](db[_0x0fb1('0x2c')][_0x0fb1('0x2d')],function(_0x46afb0){return{'name':_0x46afb0[_0x0fb1('0x2e')],'type':_0x46afb0['type']['key']};});_0x147e78[_0x0fb1('0x2f')]=_[_0x0fb1('0x2b')](_0x2ab8db,_0x0fb1('0x28'));_0x147e78[_0x0fb1('0x30')]=_[_0x0fb1('0x31')](_0x5c11d1['query']);_0x147e78[_0x0fb1('0x32')]=_[_0x0fb1('0x33')](_0x147e78[_0x0fb1('0x2f')],_0x147e78['query']);_0x328a05['attributes']=_[_0x0fb1('0x33')](_0x147e78['model'],qs['fields'](_0x5c11d1[_0x0fb1('0x30')][_0x0fb1('0x34')]));_0x328a05[_0x0fb1('0x35')]=_0x328a05['attributes'][_0x0fb1('0x36')]?_0x328a05['attributes']:_0x147e78[_0x0fb1('0x2f')];if(!_0x5c11d1['query'][_0x0fb1('0x37')](_0x0fb1('0x38'))){_0x328a05['limit']=qs[_0x0fb1('0x39')](_0x5c11d1['query'][_0x0fb1('0x39')]);_0x328a05[_0x0fb1('0x1e')]=qs[_0x0fb1('0x1e')](_0x5c11d1[_0x0fb1('0x30')][_0x0fb1('0x1e')]);}_0x328a05[_0x0fb1('0x3a')]=qs[_0x0fb1('0x3b')](_0x5c11d1['query'][_0x0fb1('0x3b')]);_0x328a05['where']=qs[_0x0fb1('0x32')](_[_0x0fb1('0x3c')](_0x5c11d1[_0x0fb1('0x30')],_0x147e78[_0x0fb1('0x32')]),_0x2ab8db);if(_0x5c11d1['query'][_0x0fb1('0x3d')]){_0x328a05[_0x0fb1('0x3e')]=_[_0x0fb1('0x3f')](_0x328a05[_0x0fb1('0x3e')],{'$or':_['map'](_0x2ab8db,function(_0x5c8ed1){if(_0x5c8ed1[_0x0fb1('0x40')]!=='VIRTUAL'){var _0x19a4a0={};_0x19a4a0[_0x5c8ed1[_0x0fb1('0x28')]]={'$like':'%'+_0x5c11d1['query'][_0x0fb1('0x3d')]+'%'};return _0x19a4a0;}})});}_0x328a05=_[_0x0fb1('0x3f')]({},_0x328a05,_0x5c11d1[_0x0fb1('0x41')]);var _0x3082c1={'where':_0x328a05['where']};return db['SalesforceConfiguration'][_0x0fb1('0x20')](_0x3082c1)[_0x0fb1('0x24')](function(_0x2682e9){_0x12ff27[_0x0fb1('0x20')]=_0x2682e9;if(_0x5c11d1[_0x0fb1('0x30')][_0x0fb1('0x42')]){_0x328a05[_0x0fb1('0x43')]=[{'all':!![]}];}return db[_0x0fb1('0x2c')][_0x0fb1('0x44')](_0x328a05);})[_0x0fb1('0x24')](function(_0x2c5301){_0x12ff27[_0x0fb1('0x45')]=_0x2c5301;return _0x12ff27;})['then'](respondWithFilteredResult(_0x339162,_0x328a05))[_0x0fb1('0x46')](handleError(_0x339162,null));};exports[_0x0fb1('0x47')]=function(_0x192e53,_0x544e59){var _0x2c97dc={'raw':![],'where':{'id':_0x192e53[_0x0fb1('0x48')]['id']}},_0x1eca3b={};_0x1eca3b[_0x0fb1('0x2f')]=_['keys'](db[_0x0fb1('0x2c')][_0x0fb1('0x2d')]);_0x1eca3b['query']=_['keys'](_0x192e53[_0x0fb1('0x30')]);_0x1eca3b[_0x0fb1('0x32')]=_['intersection'](_0x1eca3b[_0x0fb1('0x2f')],_0x1eca3b[_0x0fb1('0x30')]);_0x2c97dc[_0x0fb1('0x35')]=_[_0x0fb1('0x33')](_0x1eca3b[_0x0fb1('0x2f')],qs[_0x0fb1('0x34')](_0x192e53[_0x0fb1('0x30')]['fields']));_0x2c97dc['attributes']=_0x2c97dc['attributes'][_0x0fb1('0x36')]?_0x2c97dc[_0x0fb1('0x35')]:_0x1eca3b[_0x0fb1('0x2f')];if(_0x192e53[_0x0fb1('0x30')][_0x0fb1('0x42')]){_0x2c97dc[_0x0fb1('0x43')]=[{'all':!![]}];}_0x2c97dc=_[_0x0fb1('0x3f')]({},_0x2c97dc,_0x192e53[_0x0fb1('0x41')]);return db[_0x0fb1('0x2c')][_0x0fb1('0x49')](_0x2c97dc)[_0x0fb1('0x24')](handleEntityNotFound(_0x544e59,null))[_0x0fb1('0x24')](respondWithResult(_0x544e59,null))['catch'](handleError(_0x544e59,null));};exports[_0x0fb1('0x4a')]=function(_0x4f5f76,_0x8644f2){return db[_0x0fb1('0x2c')]['create'](_0x4f5f76[_0x0fb1('0x4b')],{})['then'](respondWithResult(_0x8644f2,0xc9))[_0x0fb1('0x46')](handleError(_0x8644f2,null));};exports[_0x0fb1('0x4c')]=function(_0x272cd2,_0x14a6ae){if(_0x272cd2['body']['id']){delete _0x272cd2[_0x0fb1('0x4b')]['id'];}return db[_0x0fb1('0x2c')][_0x0fb1('0x49')]({'where':{'id':_0x272cd2[_0x0fb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x14a6ae,null))[_0x0fb1('0x24')](saveUpdates(_0x272cd2['body'],null))[_0x0fb1('0x24')](respondWithResult(_0x14a6ae,null))[_0x0fb1('0x46')](handleError(_0x14a6ae,null));};exports['destroy']=function(_0x24f62a,_0x3c5c5e){return db['SalesforceConfiguration'][_0x0fb1('0x49')]({'where':{'id':_0x24f62a[_0x0fb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c5c5e,null))['then'](removeEntity(_0x3c5c5e,null))[_0x0fb1('0x46')](handleError(_0x3c5c5e,null));};exports[_0x0fb1('0x4d')]=function(_0x1e2f60,_0x3a9ffd,_0x20d86b){var _0x525ce7={};var _0x3cdaae={};var _0x3039cc;var _0x1672b6;return db[_0x0fb1('0x2c')]['findOne']({'where':{'id':_0x1e2f60[_0x0fb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9ffd,null))[_0x0fb1('0x24')](function(_0x159334){if(_0x159334){_0x3039cc=_0x159334;_0x3cdaae[_0x0fb1('0x2f')]=_[_0x0fb1('0x31')](db[_0x0fb1('0x4e')]['rawAttributes']);_0x3cdaae[_0x0fb1('0x30')]=_[_0x0fb1('0x31')](_0x1e2f60[_0x0fb1('0x30')]);_0x3cdaae[_0x0fb1('0x32')]=_[_0x0fb1('0x33')](_0x3cdaae[_0x0fb1('0x2f')],_0x3cdaae[_0x0fb1('0x30')]);_0x525ce7[_0x0fb1('0x35')]=_[_0x0fb1('0x33')](_0x3cdaae[_0x0fb1('0x2f')],qs[_0x0fb1('0x34')](_0x1e2f60['query'][_0x0fb1('0x34')]));_0x525ce7[_0x0fb1('0x35')]=_0x525ce7['attributes'][_0x0fb1('0x36')]?_0x525ce7[_0x0fb1('0x35')]:_0x3cdaae[_0x0fb1('0x2f')];_0x525ce7['order']=qs[_0x0fb1('0x3b')](_0x1e2f60[_0x0fb1('0x30')][_0x0fb1('0x3b')]);_0x525ce7[_0x0fb1('0x3e')]=qs['filters'](_[_0x0fb1('0x3c')](_0x1e2f60[_0x0fb1('0x30')],_0x3cdaae[_0x0fb1('0x32')]));if(_0x1e2f60[_0x0fb1('0x30')][_0x0fb1('0x3d')]){_0x525ce7[_0x0fb1('0x3e')]=_['merge'](_0x525ce7[_0x0fb1('0x3e')],{'$or':_[_0x0fb1('0x2b')](_0x525ce7[_0x0fb1('0x35')],function(_0x27d0c8){var _0x48e4ac={};_0x48e4ac[_0x27d0c8]={'$like':'%'+_0x1e2f60['query'][_0x0fb1('0x3d')]+'%'};return _0x48e4ac;})});}_0x525ce7=_[_0x0fb1('0x3f')]({},_0x525ce7,_0x1e2f60[_0x0fb1('0x41')]);return _0x3039cc[_0x0fb1('0x4d')](_0x525ce7);}})[_0x0fb1('0x24')](function(_0x50ba14){if(_0x50ba14){_0x1672b6=_0x50ba14['length'];if(!_0x1e2f60[_0x0fb1('0x30')]['hasOwnProperty'](_0x0fb1('0x38'))){_0x525ce7[_0x0fb1('0x39')]=qs[_0x0fb1('0x39')](_0x1e2f60[_0x0fb1('0x30')][_0x0fb1('0x39')]);_0x525ce7['offset']=qs[_0x0fb1('0x1e')](_0x1e2f60[_0x0fb1('0x30')][_0x0fb1('0x1e')]);}return _0x3039cc[_0x0fb1('0x4d')](_0x525ce7);}})[_0x0fb1('0x24')](function(_0x56abc7){if(_0x56abc7){return _0x56abc7?{'count':_0x1672b6,'rows':_0x56abc7}:null;}})[_0x0fb1('0x24')](respondWithResult(_0x3a9ffd,null))[_0x0fb1('0x46')](handleError(_0x3a9ffd,null));};exports[_0x0fb1('0x4f')]=function(_0x16849e,_0x2555ef,_0x5ca211){var _0x30f0bb={};var _0xaca4fe={};var _0x41ed88;var _0x2cbbc5;return db[_0x0fb1('0x2c')][_0x0fb1('0x50')]({'where':{'id':_0x16849e['params']['id']}})[_0x0fb1('0x24')](handleEntityNotFound(_0x2555ef,null))[_0x0fb1('0x24')](function(_0x207af3){if(_0x207af3){_0x41ed88=_0x207af3;_0xaca4fe[_0x0fb1('0x2f')]=_[_0x0fb1('0x31')](db[_0x0fb1('0x4e')]['rawAttributes']);_0xaca4fe['query']=_[_0x0fb1('0x31')](_0x16849e[_0x0fb1('0x30')]);_0xaca4fe[_0x0fb1('0x32')]=_[_0x0fb1('0x33')](_0xaca4fe[_0x0fb1('0x2f')],_0xaca4fe['query']);_0x30f0bb[_0x0fb1('0x35')]=_[_0x0fb1('0x33')](_0xaca4fe[_0x0fb1('0x2f')],qs[_0x0fb1('0x34')](_0x16849e['query'][_0x0fb1('0x34')]));_0x30f0bb[_0x0fb1('0x35')]=_0x30f0bb[_0x0fb1('0x35')][_0x0fb1('0x36')]?_0x30f0bb[_0x0fb1('0x35')]:_0xaca4fe['model'];_0x30f0bb['order']=qs['sort'](_0x16849e[_0x0fb1('0x30')]['sort']);_0x30f0bb[_0x0fb1('0x3e')]=qs[_0x0fb1('0x32')](_[_0x0fb1('0x3c')](_0x16849e['query'],_0xaca4fe['filters']));if(_0x16849e[_0x0fb1('0x30')]['filter']){_0x30f0bb[_0x0fb1('0x3e')]=_[_0x0fb1('0x3f')](_0x30f0bb[_0x0fb1('0x3e')],{'$or':_[_0x0fb1('0x2b')](_0x30f0bb[_0x0fb1('0x35')],function(_0x133e57){var _0x4606b7={};_0x4606b7[_0x133e57]={'$like':'%'+_0x16849e[_0x0fb1('0x30')][_0x0fb1('0x3d')]+'%'};return _0x4606b7;})});}_0x30f0bb=_['merge']({},_0x30f0bb,_0x16849e[_0x0fb1('0x41')]);return _0x41ed88[_0x0fb1('0x4f')](_0x30f0bb);}})[_0x0fb1('0x24')](function(_0x360927){if(_0x360927){_0x2cbbc5=_0x360927[_0x0fb1('0x36')];if(!_0x16849e['query']['hasOwnProperty'](_0x0fb1('0x38'))){_0x30f0bb[_0x0fb1('0x39')]=qs[_0x0fb1('0x39')](_0x16849e['query'][_0x0fb1('0x39')]);_0x30f0bb[_0x0fb1('0x1e')]=qs['offset'](_0x16849e['query'][_0x0fb1('0x1e')]);}return _0x41ed88[_0x0fb1('0x4f')](_0x30f0bb);}})[_0x0fb1('0x24')](function(_0x181c2d){if(_0x181c2d){return _0x181c2d?{'count':_0x2cbbc5,'rows':_0x181c2d}:null;}})[_0x0fb1('0x24')](respondWithResult(_0x2555ef,null))[_0x0fb1('0x46')](handleError(_0x2555ef,null));};exports['getDescriptions']=function(_0x10b6ca,_0x3ccd89,_0x103de1){var _0x1afaa1={};var _0x56066c={};var _0x3167fb;var _0x14fe9c;return db[_0x0fb1('0x2c')][_0x0fb1('0x50')]({'where':{'id':_0x10b6ca[_0x0fb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ccd89,null))['then'](function(_0x570daa){if(_0x570daa){_0x3167fb=_0x570daa;_0x56066c['model']=_['keys'](db[_0x0fb1('0x4e')][_0x0fb1('0x2d')]);_0x56066c[_0x0fb1('0x30')]=_[_0x0fb1('0x31')](_0x10b6ca[_0x0fb1('0x30')]);_0x56066c['filters']=_['intersection'](_0x56066c[_0x0fb1('0x2f')],_0x56066c[_0x0fb1('0x30')]);_0x1afaa1['attributes']=_[_0x0fb1('0x33')](_0x56066c[_0x0fb1('0x2f')],qs[_0x0fb1('0x34')](_0x10b6ca['query'][_0x0fb1('0x34')]));_0x1afaa1[_0x0fb1('0x35')]=_0x1afaa1[_0x0fb1('0x35')]['length']?_0x1afaa1['attributes']:_0x56066c[_0x0fb1('0x2f')];_0x1afaa1[_0x0fb1('0x3a')]=qs[_0x0fb1('0x3b')](_0x10b6ca['query'][_0x0fb1('0x3b')]);_0x1afaa1[_0x0fb1('0x3e')]=qs[_0x0fb1('0x32')](_[_0x0fb1('0x3c')](_0x10b6ca[_0x0fb1('0x30')],_0x56066c[_0x0fb1('0x32')]));if(_0x10b6ca[_0x0fb1('0x30')]['filter']){_0x1afaa1[_0x0fb1('0x3e')]=_[_0x0fb1('0x3f')](_0x1afaa1[_0x0fb1('0x3e')],{'$or':_[_0x0fb1('0x2b')](_0x1afaa1['attributes'],function(_0x52de32){var _0x511b02={};_0x511b02[_0x52de32]={'$like':'%'+_0x10b6ca['query']['filter']+'%'};return _0x511b02;})});}_0x1afaa1=_[_0x0fb1('0x3f')]({},_0x1afaa1,_0x10b6ca[_0x0fb1('0x41')]);return _0x3167fb[_0x0fb1('0x51')](_0x1afaa1);}})[_0x0fb1('0x24')](function(_0x10ad39){if(_0x10ad39){_0x14fe9c=_0x10ad39['length'];if(!_0x10b6ca[_0x0fb1('0x30')][_0x0fb1('0x37')](_0x0fb1('0x38'))){_0x1afaa1['limit']=qs['limit'](_0x10b6ca[_0x0fb1('0x30')][_0x0fb1('0x39')]);_0x1afaa1[_0x0fb1('0x1e')]=qs['offset'](_0x10b6ca[_0x0fb1('0x30')][_0x0fb1('0x1e')]);}return _0x3167fb[_0x0fb1('0x51')](_0x1afaa1);}})[_0x0fb1('0x24')](function(_0x120d6f){if(_0x120d6f){return _0x120d6f?{'count':_0x14fe9c,'rows':_0x120d6f}:null;}})[_0x0fb1('0x24')](respondWithResult(_0x3ccd89,null))[_0x0fb1('0x46')](handleError(_0x3ccd89,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 64fe6b9..179a1fc 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 _0x477b=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0x1b338e,_0x25ac31){var _0x3ae2f4=function(_0x229fc5){while(--_0x229fc5){_0x1b338e['push'](_0x1b338e['shift']());}};_0x3ae2f4(++_0x25ac31);}(_0x477b,0x18c));var _0xb477=function(_0x4ae6a2,_0x1eca45){_0x4ae6a2=_0x4ae6a2-0x0;var _0x4ae07c=_0x477b[_0x4ae6a2];return _0x4ae07c;};'use strict';var _=require(_0xb477('0x0'));var util=require('util');var logger=require(_0xb477('0x1'))(_0xb477('0x2'));var moment=require('moment');var BPromise=require(_0xb477('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb477('0x4'));var rimraf=require(_0xb477('0x5'));var config=require(_0xb477('0x6'));var attributes=require(_0xb477('0x7'));module[_0xb477('0x8')]=function(_0x4b8f4a,_0x619188){return _0x4b8f4a[_0xb477('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xb477('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b35=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x156b07,_0x131d73){var _0xa1d674=function(_0x3b9616){while(--_0x3b9616){_0x156b07['push'](_0x156b07['shift']());}};_0xa1d674(++_0x131d73);}(_0x8b35,0xb8));var _0x58b3=function(_0x3a3d23,_0x9dacfa){_0x3a3d23=_0x3a3d23-0x0;var _0x337899=_0x8b35[_0x3a3d23];return _0x337899;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x58b3('0x0'))('api');var moment=require(_0x58b3('0x1'));var BPromise=require(_0x58b3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58b3('0x3'));var rimraf=require(_0x58b3('0x4'));var config=require(_0x58b3('0x5'));var attributes=require(_0x58b3('0x6'));module[_0x58b3('0x7')]=function(_0x45ace5,_0x2dd9cb){return _0x45ace5[_0x58b3('0x8')](_0x58b3('0x9'),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 f4df1ca..aea02e6 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 _0xc677=['bluebird','../../mysqldb','../../config/logger','rpc','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment'];(function(_0x34ada8,_0x393fd4){var _0x1adcf8=function(_0x506250){while(--_0x506250){_0x34ada8['push'](_0x34ada8['shift']());}};_0x1adcf8(++_0x393fd4);}(_0xc677,0xe7));var _0x7c67=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc677[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7c67('0x0'));var util=require(_0x7c67('0x1'));var moment=require(_0x7c67('0x2'));var BPromise=require(_0x7c67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c67('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c67('0x5'))(_0x7c67('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c67('0x7')][_0x7c67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15ac38,_0x372312,_0x49b7bc){return new BPromise(function(_0x46fa1b,_0x83b82b){return client['request'](_0x15ac38,_0x49b7bc)[_0x7c67('0x9')](function(_0x135582){logger[_0x7c67('0xa')](_0x7c67('0xb'),_0x372312,'request\x20sent');logger['debug'](_0x7c67('0xc'),_0x372312,'request\x20sent',JSON['stringify'](_0x135582));if(_0x135582[_0x7c67('0xd')]){if(_0x135582[_0x7c67('0xd')][_0x7c67('0xe')]===0x1f4){logger[_0x7c67('0xd')](_0x7c67('0xb'),_0x372312,_0x135582['error'][_0x7c67('0xf')]);return _0x83b82b(_0x135582['error']['message']);}logger['error'](_0x7c67('0xb'),_0x372312,_0x135582[_0x7c67('0xd')][_0x7c67('0xf')]);return _0x46fa1b(_0x135582[_0x7c67('0xd')][_0x7c67('0xf')]);}else{logger[_0x7c67('0xa')](_0x7c67('0xb'),_0x372312,_0x7c67('0x10'));_0x46fa1b(_0x135582['result'][_0x7c67('0xf')]);}})[_0x7c67('0x11')](function(_0x2f872e){logger[_0x7c67('0xd')](_0x7c67('0xb'),_0x372312,_0x2f872e);_0x83b82b(_0x2f872e);});});} \ No newline at end of file +var _0xc001=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x118e77,_0x5d9158){var _0x494a22=function(_0x22b04e){while(--_0x22b04e){_0x118e77['push'](_0x118e77['shift']());}};_0x494a22(++_0x5d9158);}(_0xc001,0x1d8));var _0x1c00=function(_0x16cdfd,_0x3180cc){_0x16cdfd=_0x16cdfd-0x0;var _0x2d8581=_0xc001[_0x16cdfd];return _0x2d8581;};'use strict';var _=require('lodash');var util=require(_0x1c00('0x0'));var moment=require(_0x1c00('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c00('0x2'));var db=require(_0x1c00('0x3'))['db'];var utils=require(_0x1c00('0x4'));var logger=require(_0x1c00('0x5'))('rpc');var config=require(_0x1c00('0x6'));var jayson=require(_0x1c00('0x7'));var client=jayson[_0x1c00('0x8')][_0x1c00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2871bc,_0xf7d5df,_0x34855b){return new BPromise(function(_0x373eca,_0x24bc31){return client['request'](_0x2871bc,_0x34855b)[_0x1c00('0xa')](function(_0x4401f0){logger['info'](_0x1c00('0xb'),_0xf7d5df,_0x1c00('0xc'));logger[_0x1c00('0xd')](_0x1c00('0xe'),_0xf7d5df,'request\x20sent',JSON[_0x1c00('0xf')](_0x4401f0));if(_0x4401f0[_0x1c00('0x10')]){if(_0x4401f0[_0x1c00('0x10')][_0x1c00('0x11')]===0x1f4){logger[_0x1c00('0x10')](_0x1c00('0xb'),_0xf7d5df,_0x4401f0[_0x1c00('0x10')][_0x1c00('0x12')]);return _0x24bc31(_0x4401f0[_0x1c00('0x10')]['message']);}logger[_0x1c00('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0xf7d5df,_0x4401f0['error'][_0x1c00('0x12')]);return _0x373eca(_0x4401f0[_0x1c00('0x10')][_0x1c00('0x12')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0xf7d5df,_0x1c00('0xc'));_0x373eca(_0x4401f0[_0x1c00('0x13')][_0x1c00('0x12')]);}})[_0x1c00('0x14')](function(_0x4e32b7){logger['error'](_0x1c00('0xb'),_0xf7d5df,_0x4e32b7);_0x24bc31(_0x4e32b7);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index bb5a50c..776d3c2 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 _0x5996=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5996,0x14f));var _0x6599=function(_0xb27f58,_0x2e655b){_0xb27f58=_0xb27f58-0x0;var _0x522a13=_0x5996[_0xb27f58];return _0x522a13;};'use strict';var multer=require(_0x6599('0x0'));var util=require(_0x6599('0x1'));var path=require(_0x6599('0x2'));var timeout=require(_0x6599('0x3'));var express=require(_0x6599('0x4'));var router=express[_0x6599('0x5')]();var fs_extra=require(_0x6599('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6599('0x7'));var config=require('../../config/environment');var controller=require(_0x6599('0x8'));router[_0x6599('0x9')]('/',auth['isAuthenticated'](),controller[_0x6599('0xa')]);router[_0x6599('0x9')]('/:id',auth[_0x6599('0xb')](),controller[_0x6599('0xc')]);router[_0x6599('0xd')]('/',auth[_0x6599('0xb')](),controller[_0x6599('0xe')]);router[_0x6599('0xf')]('/:id',auth[_0x6599('0xb')](),controller[_0x6599('0x10')]);router[_0x6599('0x11')](_0x6599('0x12'),auth['isAuthenticated'](),controller[_0x6599('0x13')]);module[_0x6599('0x14')]=router; \ No newline at end of file +var _0x1a09=['exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post','put','destroy'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1a09,0x1eb));var _0x91a0=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1a09[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91a0('0x0'));var express=require(_0x91a0('0x1'));var router=express[_0x91a0('0x2')]();var fs_extra=require(_0x91a0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x91a0('0x4'));var config=require(_0x91a0('0x5'));var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x91a0('0x6')]);router[_0x91a0('0x7')](_0x91a0('0x8'),auth[_0x91a0('0x9')](),controller['show']);router[_0x91a0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x91a0('0xb')](_0x91a0('0x8'),auth[_0x91a0('0x9')](),controller['update']);router['delete'](_0x91a0('0x8'),auth[_0x91a0('0x9')](),controller[_0x91a0('0xc')]);module[_0x91a0('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 12adc58..777ad31 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 _0xb7fe=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb7fe,0x65));var _0xeb7f=function(_0x4d1c57,_0x17bbff){_0x4d1c57=_0x4d1c57-0x0;var _0x2f76dd=_0xb7fe[_0x4d1c57];return _0x2f76dd;};'use strict';var Sequelize=require(_0xeb7f('0x0'));module[_0xeb7f('0x1')]={'type':{'type':Sequelize[_0xeb7f('0x2')](_0xeb7f('0x3'),_0xeb7f('0x4'),_0xeb7f('0x5'),_0xeb7f('0x6'),_0xeb7f('0x7')),'defaultValue':_0xeb7f('0x3')},'content':{'type':Sequelize[_0xeb7f('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xeb7f('0x4'),_0xeb7f('0x5'))},'keyContent':{'type':Sequelize[_0xeb7f('0x8')]},'idField':{'type':Sequelize[_0xeb7f('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfac2=['picklist','STRING','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0xb84057,_0x22ad92){var _0x11c875=function(_0x312b19){while(--_0x312b19){_0xb84057['push'](_0xb84057['shift']());}};_0x11c875(++_0x22ad92);}(_0xfac2,0xfa));var _0x2fac=function(_0x263d88,_0x5cd913){_0x263d88=_0x263d88-0x0;var _0x212585=_0xfac2[_0x263d88];return _0x212585;};'use strict';var Sequelize=require(_0x2fac('0x0'));module[_0x2fac('0x1')]={'type':{'type':Sequelize[_0x2fac('0x2')](_0x2fac('0x3'),_0x2fac('0x4'),'customVariable',_0x2fac('0x5'),_0x2fac('0x6')),'defaultValue':_0x2fac('0x3')},'content':{'type':Sequelize[_0x2fac('0x7')]},'key':{'type':Sequelize[_0x2fac('0x7')]},'keyType':{'type':Sequelize[_0x2fac('0x2')](_0x2fac('0x3'),_0x2fac('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2fac('0x7')]},'idField':{'type':Sequelize[_0x2fac('0x7')]},'variableName':{'type':Sequelize[_0x2fac('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5564cd5..611fd1c 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 _0xbaf2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','stack','index','map','SalesforceField','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbaf2,0x7c));var _0x2baf=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbaf2[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2baf('0x0'));var zipdir=require(_0x2baf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2baf('0x2'));var Mustache=require(_0x2baf('0x3'));var util=require(_0x2baf('0x4'));var path=require('path');var sox=require(_0x2baf('0x5'));var csv=require(_0x2baf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2baf('0x7'));var _=require('lodash');var squel=require(_0x2baf('0x8'));var crypto=require('crypto');var jsforce=require(_0x2baf('0x9'));var deskjs=require(_0x2baf('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2baf('0xb'));var Papa=require(_0x2baf('0xc'));var Redis=require(_0x2baf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2baf('0xe'));var as=require(_0x2baf('0xf'));var hardwareService=require(_0x2baf('0x10'));var logger=require(_0x2baf('0x11'))(_0x2baf('0x12'));var utils=require(_0x2baf('0x13'));var config=require(_0x2baf('0x14'));var licenseUtil=require(_0x2baf('0x15'));var db=require(_0x2baf('0x16'))['db'];function respondWithStatusCode(_0x5d1598,_0x2b0083){_0x2b0083=_0x2b0083||0xcc;return function(_0x4688bc){if(_0x4688bc){return _0x5d1598['sendStatus'](_0x2b0083);}return _0x5d1598['status'](_0x2b0083)[_0x2baf('0x17')]();};}function respondWithResult(_0x536fa7,_0x2a7551){_0x2a7551=_0x2a7551||0xc8;return function(_0x266846){if(_0x266846){return _0x536fa7[_0x2baf('0x18')](_0x2a7551)[_0x2baf('0x19')](_0x266846);}};}function respondWithFilteredResult(_0xeb1d96,_0x710ffb){return function(_0x284744){if(_0x284744){var _0x417c17=typeof _0x710ffb[_0x2baf('0x1a')]===_0x2baf('0x1b')&&typeof _0x710ffb[_0x2baf('0x1c')]===_0x2baf('0x1b');var _0x429f9e=_0x284744[_0x2baf('0x1d')];var _0x1f2513=_0x417c17?0x0:_0x710ffb[_0x2baf('0x1a')];var _0x2eaea5=_0x417c17?_0x284744[_0x2baf('0x1d')]:_0x710ffb[_0x2baf('0x1a')]+_0x710ffb[_0x2baf('0x1c')];var _0x5d27ac;if(_0x2eaea5>=_0x429f9e){_0x2eaea5=_0x429f9e;_0x5d27ac=0xc8;}else{_0x5d27ac=0xce;}_0xeb1d96[_0x2baf('0x18')](_0x5d27ac);return _0xeb1d96[_0x2baf('0x1e')]('Content-Range',_0x1f2513+'-'+_0x2eaea5+'/'+_0x429f9e)[_0x2baf('0x19')](_0x284744);}return null;};}function patchUpdates(_0x5b7e8a){return function(_0x369dee){try{jsonpatch[_0x2baf('0x1f')](_0x369dee,_0x5b7e8a,!![]);}catch(_0xaaf96f){return BPromise[_0x2baf('0x20')](_0xaaf96f);}return _0x369dee['save']();};}function saveUpdates(_0x46994f,_0x53ba1d){return function(_0x3d01d8){if(_0x3d01d8){return _0x3d01d8['update'](_0x46994f)[_0x2baf('0x21')](function(_0x355c8e){return _0x355c8e;});}return null;};}function removeEntity(_0x39748a,_0xf96d0c){return function(_0x2c961f){if(_0x2c961f){return _0x2c961f[_0x2baf('0x22')]()[_0x2baf('0x21')](function(){_0x39748a[_0x2baf('0x18')](0xcc)[_0x2baf('0x17')]();});}};}function handleEntityNotFound(_0x57c0ed,_0x36be29){return function(_0x3edd3a){if(!_0x3edd3a){_0x57c0ed[_0x2baf('0x23')](0x194);}return _0x3edd3a;};}function handleError(_0x426c98,_0x1de373){_0x1de373=_0x1de373||0x1f4;return function(_0x2221ce){logger[_0x2baf('0x24')](_0x2221ce[_0x2baf('0x25')]);if(_0x2221ce['name']){delete _0x2221ce['name'];}_0x426c98[_0x2baf('0x18')](_0x1de373)['send'](_0x2221ce);};}exports[_0x2baf('0x26')]=function(_0x27c100,_0x3587bb){var _0x16bf49={},_0x58e81d={},_0x3fe18a={'count':0x0,'rows':[]};var _0x45c2bf=_[_0x2baf('0x27')](db[_0x2baf('0x28')]['rawAttributes'],function(_0x560945){return{'name':_0x560945[_0x2baf('0x29')],'type':_0x560945['type'][_0x2baf('0x2a')]};});_0x58e81d[_0x2baf('0x2b')]=_['map'](_0x45c2bf,'name');_0x58e81d[_0x2baf('0x2c')]=_[_0x2baf('0x2d')](_0x27c100[_0x2baf('0x2c')]);_0x58e81d[_0x2baf('0x2e')]=_['intersection'](_0x58e81d[_0x2baf('0x2b')],_0x58e81d[_0x2baf('0x2c')]);_0x16bf49[_0x2baf('0x2f')]=_['intersection'](_0x58e81d[_0x2baf('0x2b')],qs[_0x2baf('0x30')](_0x27c100['query'][_0x2baf('0x30')]));_0x16bf49[_0x2baf('0x2f')]=_0x16bf49[_0x2baf('0x2f')][_0x2baf('0x31')]?_0x16bf49['attributes']:_0x58e81d[_0x2baf('0x2b')];if(!_0x27c100[_0x2baf('0x2c')][_0x2baf('0x32')]('nolimit')){_0x16bf49[_0x2baf('0x1c')]=qs[_0x2baf('0x1c')](_0x27c100[_0x2baf('0x2c')][_0x2baf('0x1c')]);_0x16bf49['offset']=qs['offset'](_0x27c100['query'][_0x2baf('0x1a')]);}_0x16bf49[_0x2baf('0x33')]=qs['sort'](_0x27c100[_0x2baf('0x2c')][_0x2baf('0x34')]);_0x16bf49[_0x2baf('0x35')]=qs[_0x2baf('0x2e')](_[_0x2baf('0x36')](_0x27c100[_0x2baf('0x2c')],_0x58e81d[_0x2baf('0x2e')]),_0x45c2bf);if(_0x27c100[_0x2baf('0x2c')][_0x2baf('0x37')]){_0x16bf49[_0x2baf('0x35')]=_[_0x2baf('0x38')](_0x16bf49[_0x2baf('0x35')],{'$or':_[_0x2baf('0x27')](_0x45c2bf,function(_0x5c498d){if(_0x5c498d[_0x2baf('0x39')]!==_0x2baf('0x3a')){var _0x58d9d5={};_0x58d9d5[_0x5c498d['name']]={'$like':'%'+_0x27c100[_0x2baf('0x2c')][_0x2baf('0x37')]+'%'};return _0x58d9d5;}})});}_0x16bf49=_[_0x2baf('0x38')]({},_0x16bf49,_0x27c100[_0x2baf('0x3b')]);var _0x2d6d0f={'where':_0x16bf49['where']};return db[_0x2baf('0x28')][_0x2baf('0x1d')](_0x2d6d0f)[_0x2baf('0x21')](function(_0x5230c8){_0x3fe18a['count']=_0x5230c8;if(_0x27c100[_0x2baf('0x2c')][_0x2baf('0x3c')]){_0x16bf49['include']=[{'all':!![]}];}return db[_0x2baf('0x28')]['findAll'](_0x16bf49);})[_0x2baf('0x21')](function(_0x1b69f0){_0x3fe18a[_0x2baf('0x3d')]=_0x1b69f0;return _0x3fe18a;})[_0x2baf('0x21')](respondWithFilteredResult(_0x3587bb,_0x16bf49))[_0x2baf('0x3e')](handleError(_0x3587bb,null));};exports[_0x2baf('0x3f')]=function(_0x3a5b0e,_0xa20789){var _0x1e256e={'raw':!![],'where':{'id':_0x3a5b0e[_0x2baf('0x40')]['id']}},_0xdba24={};_0xdba24[_0x2baf('0x2b')]=_['keys'](db['SalesforceField'][_0x2baf('0x41')]);_0xdba24[_0x2baf('0x2c')]=_[_0x2baf('0x2d')](_0x3a5b0e[_0x2baf('0x2c')]);_0xdba24[_0x2baf('0x2e')]=_['intersection'](_0xdba24[_0x2baf('0x2b')],_0xdba24[_0x2baf('0x2c')]);_0x1e256e[_0x2baf('0x2f')]=_['intersection'](_0xdba24['model'],qs[_0x2baf('0x30')](_0x3a5b0e['query'][_0x2baf('0x30')]));_0x1e256e['attributes']=_0x1e256e[_0x2baf('0x2f')][_0x2baf('0x31')]?_0x1e256e[_0x2baf('0x2f')]:_0xdba24[_0x2baf('0x2b')];if(_0x3a5b0e[_0x2baf('0x2c')][_0x2baf('0x3c')]){_0x1e256e[_0x2baf('0x42')]=[{'all':!![]}];}_0x1e256e=_[_0x2baf('0x38')]({},_0x1e256e,_0x3a5b0e[_0x2baf('0x3b')]);return db[_0x2baf('0x28')][_0x2baf('0x43')](_0x1e256e)['then'](handleEntityNotFound(_0xa20789,null))[_0x2baf('0x21')](respondWithResult(_0xa20789,null))[_0x2baf('0x3e')](handleError(_0xa20789,null));};exports[_0x2baf('0x44')]=function(_0x299e42,_0x4054aa){return db['SalesforceField'][_0x2baf('0x44')](_0x299e42[_0x2baf('0x45')],{})[_0x2baf('0x21')](respondWithResult(_0x4054aa,0xc9))[_0x2baf('0x3e')](handleError(_0x4054aa,null));};exports[_0x2baf('0x46')]=function(_0x4dcdc6,_0x4f5dea){if(_0x4dcdc6['body']['id']){delete _0x4dcdc6[_0x2baf('0x45')]['id'];}return db[_0x2baf('0x28')][_0x2baf('0x43')]({'where':{'id':_0x4dcdc6[_0x2baf('0x40')]['id']}})[_0x2baf('0x21')](handleEntityNotFound(_0x4f5dea,null))[_0x2baf('0x21')](saveUpdates(_0x4dcdc6[_0x2baf('0x45')],null))[_0x2baf('0x21')](respondWithResult(_0x4f5dea,null))['catch'](handleError(_0x4f5dea,null));};exports[_0x2baf('0x22')]=function(_0x4877fc,_0x559450){return db[_0x2baf('0x28')][_0x2baf('0x43')]({'where':{'id':_0x4877fc[_0x2baf('0x40')]['id']}})[_0x2baf('0x21')](handleEntityNotFound(_0x559450,null))[_0x2baf('0x21')](removeEntity(_0x559450,null))['catch'](handleError(_0x559450,null));}; \ No newline at end of file +var _0xd8c0=['options','rows','show','params','keys','include','find','catch','create','body','update','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','apply','reject','save','then','destroy','end','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL'];(function(_0x3e79a1,_0x4aae6d){var _0x37c668=function(_0x28474b){while(--_0x28474b){_0x3e79a1['push'](_0x3e79a1['shift']());}};_0x37c668(++_0x4aae6d);}(_0xd8c0,0x93));var _0x0d8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8c0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d8c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d8c('0x1'));var Mustache=require(_0x0d8c('0x2'));var util=require(_0x0d8c('0x3'));var path=require('path');var sox=require(_0x0d8c('0x4'));var csv=require(_0x0d8c('0x5'));var ejs=require(_0x0d8c('0x6'));var fs=require('fs');var fs_extra=require(_0x0d8c('0x7'));var _=require(_0x0d8c('0x8'));var squel=require('squel');var crypto=require(_0x0d8c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0d8c('0xa'));var toCsv=require(_0x0d8c('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0d8c('0xb'));var authService=require(_0x0d8c('0xc'));var qs=require(_0x0d8c('0xd'));var as=require(_0x0d8c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d8c('0xf'))(_0x0d8c('0x10'));var utils=require(_0x0d8c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x0d8c('0x12'));var db=require(_0x0d8c('0x13'))['db'];function respondWithStatusCode(_0x829368,_0x3efa55){_0x3efa55=_0x3efa55||0xcc;return function(_0x2f33ba){if(_0x2f33ba){return _0x829368[_0x0d8c('0x14')](_0x3efa55);}return _0x829368[_0x0d8c('0x15')](_0x3efa55)['end']();};}function respondWithResult(_0xd4ceb0,_0x3f974b){_0x3f974b=_0x3f974b||0xc8;return function(_0x2af878){if(_0x2af878){return _0xd4ceb0[_0x0d8c('0x15')](_0x3f974b)[_0x0d8c('0x16')](_0x2af878);}};}function respondWithFilteredResult(_0x53e3dc,_0x3b83e8){return function(_0x2ce4d3){if(_0x2ce4d3){var _0x4a68f4=typeof _0x3b83e8['offset']===_0x0d8c('0x17')&&typeof _0x3b83e8['limit']===_0x0d8c('0x17');var _0x52eb73=_0x2ce4d3[_0x0d8c('0x18')];var _0x3b7240=_0x4a68f4?0x0:_0x3b83e8[_0x0d8c('0x19')];var _0x260d1a=_0x4a68f4?_0x2ce4d3[_0x0d8c('0x18')]:_0x3b83e8[_0x0d8c('0x19')]+_0x3b83e8['limit'];var _0x237e0b;if(_0x260d1a>=_0x52eb73){_0x260d1a=_0x52eb73;_0x237e0b=0xc8;}else{_0x237e0b=0xce;}_0x53e3dc['status'](_0x237e0b);return _0x53e3dc[_0x0d8c('0x1a')]('Content-Range',_0x3b7240+'-'+_0x260d1a+'/'+_0x52eb73)[_0x0d8c('0x16')](_0x2ce4d3);}return null;};}function patchUpdates(_0x429062){return function(_0x23e85b){try{jsonpatch[_0x0d8c('0x1b')](_0x23e85b,_0x429062,!![]);}catch(_0x4af652){return BPromise[_0x0d8c('0x1c')](_0x4af652);}return _0x23e85b[_0x0d8c('0x1d')]();};}function saveUpdates(_0xcd5b78,_0x54f85c){return function(_0x320d06){if(_0x320d06){return _0x320d06['update'](_0xcd5b78)[_0x0d8c('0x1e')](function(_0x2b0974){return _0x2b0974;});}return null;};}function removeEntity(_0x415f1a,_0x49b6f9){return function(_0x314261){if(_0x314261){return _0x314261[_0x0d8c('0x1f')]()[_0x0d8c('0x1e')](function(){_0x415f1a[_0x0d8c('0x15')](0xcc)[_0x0d8c('0x20')]();});}};}function handleEntityNotFound(_0x12682f,_0x496aaa){return function(_0x1ef551){if(!_0x1ef551){_0x12682f[_0x0d8c('0x14')](0x194);}return _0x1ef551;};}function handleError(_0x24e989,_0x2b69db){_0x2b69db=_0x2b69db||0x1f4;return function(_0x3608fe){logger[_0x0d8c('0x21')](_0x3608fe['stack']);if(_0x3608fe[_0x0d8c('0x22')]){delete _0x3608fe[_0x0d8c('0x22')];}_0x24e989['status'](_0x2b69db)[_0x0d8c('0x23')](_0x3608fe);};}exports[_0x0d8c('0x24')]=function(_0x56753c,_0x192586){var _0x4e9319={},_0xc24f7c={},_0x18e046={'count':0x0,'rows':[]};var _0x706892=_[_0x0d8c('0x25')](db[_0x0d8c('0x26')][_0x0d8c('0x27')],function(_0x188293){return{'name':_0x188293[_0x0d8c('0x28')],'type':_0x188293[_0x0d8c('0x29')][_0x0d8c('0x2a')]};});_0xc24f7c['model']=_['map'](_0x706892,_0x0d8c('0x22'));_0xc24f7c[_0x0d8c('0x2b')]=_['keys'](_0x56753c['query']);_0xc24f7c[_0x0d8c('0x2c')]=_['intersection'](_0xc24f7c[_0x0d8c('0x2d')],_0xc24f7c['query']);_0x4e9319['attributes']=_[_0x0d8c('0x2e')](_0xc24f7c[_0x0d8c('0x2d')],qs[_0x0d8c('0x2f')](_0x56753c[_0x0d8c('0x2b')][_0x0d8c('0x2f')]));_0x4e9319[_0x0d8c('0x30')]=_0x4e9319[_0x0d8c('0x30')][_0x0d8c('0x31')]?_0x4e9319[_0x0d8c('0x30')]:_0xc24f7c[_0x0d8c('0x2d')];if(!_0x56753c['query'][_0x0d8c('0x32')](_0x0d8c('0x33'))){_0x4e9319[_0x0d8c('0x34')]=qs[_0x0d8c('0x34')](_0x56753c[_0x0d8c('0x2b')]['limit']);_0x4e9319[_0x0d8c('0x19')]=qs[_0x0d8c('0x19')](_0x56753c['query'][_0x0d8c('0x19')]);}_0x4e9319['order']=qs[_0x0d8c('0x35')](_0x56753c['query'][_0x0d8c('0x35')]);_0x4e9319[_0x0d8c('0x36')]=qs[_0x0d8c('0x2c')](_['pick'](_0x56753c[_0x0d8c('0x2b')],_0xc24f7c[_0x0d8c('0x2c')]),_0x706892);if(_0x56753c['query']['filter']){_0x4e9319[_0x0d8c('0x36')]=_[_0x0d8c('0x37')](_0x4e9319[_0x0d8c('0x36')],{'$or':_[_0x0d8c('0x25')](_0x706892,function(_0x289aa2){if(_0x289aa2[_0x0d8c('0x29')]!==_0x0d8c('0x38')){var _0x39f207={};_0x39f207[_0x289aa2['name']]={'$like':'%'+_0x56753c[_0x0d8c('0x2b')]['filter']+'%'};return _0x39f207;}})});}_0x4e9319=_[_0x0d8c('0x37')]({},_0x4e9319,_0x56753c[_0x0d8c('0x39')]);var _0x415e1d={'where':_0x4e9319[_0x0d8c('0x36')]};return db[_0x0d8c('0x26')][_0x0d8c('0x18')](_0x415e1d)['then'](function(_0x2fdc18){_0x18e046['count']=_0x2fdc18;if(_0x56753c[_0x0d8c('0x2b')]['includeAll']){_0x4e9319['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x4e9319);})['then'](function(_0x58ed75){_0x18e046[_0x0d8c('0x3a')]=_0x58ed75;return _0x18e046;})[_0x0d8c('0x1e')](respondWithFilteredResult(_0x192586,_0x4e9319))['catch'](handleError(_0x192586,null));};exports[_0x0d8c('0x3b')]=function(_0xa002c1,_0x26c26c){var _0x1e2b6e={'raw':!![],'where':{'id':_0xa002c1[_0x0d8c('0x3c')]['id']}},_0x378acb={};_0x378acb[_0x0d8c('0x2d')]=_[_0x0d8c('0x3d')](db[_0x0d8c('0x26')]['rawAttributes']);_0x378acb['query']=_['keys'](_0xa002c1[_0x0d8c('0x2b')]);_0x378acb[_0x0d8c('0x2c')]=_[_0x0d8c('0x2e')](_0x378acb[_0x0d8c('0x2d')],_0x378acb['query']);_0x1e2b6e[_0x0d8c('0x30')]=_[_0x0d8c('0x2e')](_0x378acb[_0x0d8c('0x2d')],qs[_0x0d8c('0x2f')](_0xa002c1[_0x0d8c('0x2b')][_0x0d8c('0x2f')]));_0x1e2b6e[_0x0d8c('0x30')]=_0x1e2b6e[_0x0d8c('0x30')][_0x0d8c('0x31')]?_0x1e2b6e[_0x0d8c('0x30')]:_0x378acb['model'];if(_0xa002c1[_0x0d8c('0x2b')]['includeAll']){_0x1e2b6e[_0x0d8c('0x3e')]=[{'all':!![]}];}_0x1e2b6e=_[_0x0d8c('0x37')]({},_0x1e2b6e,_0xa002c1[_0x0d8c('0x39')]);return db[_0x0d8c('0x26')][_0x0d8c('0x3f')](_0x1e2b6e)[_0x0d8c('0x1e')](handleEntityNotFound(_0x26c26c,null))['then'](respondWithResult(_0x26c26c,null))[_0x0d8c('0x40')](handleError(_0x26c26c,null));};exports['create']=function(_0x5ea02c,_0x15af20){return db[_0x0d8c('0x26')][_0x0d8c('0x41')](_0x5ea02c[_0x0d8c('0x42')],{})[_0x0d8c('0x1e')](respondWithResult(_0x15af20,0xc9))[_0x0d8c('0x40')](handleError(_0x15af20,null));};exports[_0x0d8c('0x43')]=function(_0x2a4000,_0x1d0442){if(_0x2a4000['body']['id']){delete _0x2a4000[_0x0d8c('0x42')]['id'];}return db[_0x0d8c('0x26')][_0x0d8c('0x3f')]({'where':{'id':_0x2a4000[_0x0d8c('0x3c')]['id']}})[_0x0d8c('0x1e')](handleEntityNotFound(_0x1d0442,null))[_0x0d8c('0x1e')](saveUpdates(_0x2a4000[_0x0d8c('0x42')],null))[_0x0d8c('0x1e')](respondWithResult(_0x1d0442,null))[_0x0d8c('0x40')](handleError(_0x1d0442,null));};exports['destroy']=function(_0x14b2bf,_0x2c4bda){return db[_0x0d8c('0x26')][_0x0d8c('0x3f')]({'where':{'id':_0x14b2bf['params']['id']}})[_0x0d8c('0x1e')](handleEntityNotFound(_0x2c4bda,null))['then'](removeEntity(_0x2c4bda,null))[_0x0d8c('0x40')](handleError(_0x2c4bda,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 333a162..89e842c 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 _0xbe0f=['../../config/environment','./intSalesforceField.attributes','exports','define','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4a752a,_0x1bdc2d){var _0x2e30f6=function(_0x1cb346){while(--_0x1cb346){_0x4a752a['push'](_0x4a752a['shift']());}};_0x2e30f6(++_0x1bdc2d);}(_0xbe0f,0x1c1));var _0xfbe0=function(_0x25909c,_0x54e567){_0x25909c=_0x25909c-0x0;var _0x18ac7b=_0xbe0f[_0x25909c];return _0x18ac7b;};'use strict';var _=require(_0xfbe0('0x0'));var util=require('util');var logger=require(_0xfbe0('0x1'))(_0xfbe0('0x2'));var moment=require('moment');var BPromise=require(_0xfbe0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbe0('0x4'));var rimraf=require(_0xfbe0('0x5'));var config=require(_0xfbe0('0x6'));var attributes=require(_0xfbe0('0x7'));module[_0xfbe0('0x8')]=function(_0x156963,_0xbc1c6d){return _0x156963[_0xfbe0('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xfbe0('0xa'),'fields':[_0xfbe0('0xb'),_0xfbe0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3481=['request-promise','path','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0x3481,0xb2));var _0x1348=function(_0x3f2a5d,_0x5cb200){_0x3f2a5d=_0x3f2a5d-0x0;var _0x3e29e0=_0x3481[_0x3f2a5d];return _0x3e29e0;};'use strict';var _=require(_0x1348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1348('0x1'));var moment=require(_0x1348('0x2'));var BPromise=require(_0x1348('0x3'));var rp=require(_0x1348('0x4'));var fs=require('fs');var path=require(_0x1348('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1348('0x6'));module[_0x1348('0x7')]=function(_0x6e5683,_0x14c33b){return _0x6e5683['define'](_0x1348('0x8'),attributes,{'tableName':_0x1348('0x9'),'paranoid':![],'indexes':[{'name':_0x1348('0xa'),'fields':[_0x1348('0xb'),_0x1348('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 6c60138..edb980b 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 _0x40f8=['../../config/environment','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0xfbce65,_0x3f2d34){var _0x596900=function(_0x2495a4){while(--_0x2495a4){_0xfbce65['push'](_0xfbce65['shift']());}};_0x596900(++_0x3f2d34);}(_0x40f8,0x161));var _0x840f=function(_0x42b391,_0x6dbea3){_0x42b391=_0x42b391-0x0;var _0x461d22=_0x40f8[_0x42b391];return _0x461d22;};'use strict';var _=require('lodash');var util=require(_0x840f('0x0'));var moment=require(_0x840f('0x1'));var BPromise=require(_0x840f('0x2'));var rs=require(_0x840f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x840f('0x4'));var logger=require(_0x840f('0x5'))(_0x840f('0x6'));var config=require(_0x840f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x840f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44a341,_0x2340b1,_0x4a37a4){return new BPromise(function(_0x4be058,_0x1b3c9c){return client[_0x840f('0x9')](_0x44a341,_0x4a37a4)[_0x840f('0xa')](function(_0x1c5906){logger[_0x840f('0xb')](_0x840f('0xc'),_0x2340b1,_0x840f('0xd'));logger[_0x840f('0xe')](_0x840f('0xf'),_0x2340b1,_0x840f('0xd'),JSON['stringify'](_0x1c5906));if(_0x1c5906[_0x840f('0x10')]){if(_0x1c5906['error'][_0x840f('0x11')]===0x1f4){logger['error'](_0x840f('0xc'),_0x2340b1,_0x1c5906['error'][_0x840f('0x12')]);return _0x1b3c9c(_0x1c5906[_0x840f('0x10')]['message']);}logger[_0x840f('0x10')](_0x840f('0xc'),_0x2340b1,_0x1c5906[_0x840f('0x10')][_0x840f('0x12')]);return _0x4be058(_0x1c5906['error'][_0x840f('0x12')]);}else{logger['info'](_0x840f('0xc'),_0x2340b1,'request\x20sent');_0x4be058(_0x1c5906['result'][_0x840f('0x12')]);}})[_0x840f('0x13')](function(_0x246acf){logger[_0x840f('0x10')](_0x840f('0xc'),_0x2340b1,_0x246acf);_0x1b3c9c(_0x246acf);});});} \ No newline at end of file +var _0xa955=['SalesforceField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x415784,_0xc874f7){var _0x29db4c=function(_0x38f7e4){while(--_0x38f7e4){_0x415784['push'](_0x415784['shift']());}};_0x29db4c(++_0xc874f7);}(_0xa955,0x86));var _0x5a95=function(_0x3f973f,_0x2def19){_0x3f973f=_0x3f973f-0x0;var _0x13ff94=_0xa955[_0x3f973f];return _0x13ff94;};'use strict';var _=require(_0x5a95('0x0'));var util=require(_0x5a95('0x1'));var moment=require(_0x5a95('0x2'));var BPromise=require(_0x5a95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a95('0x4'));var db=require(_0x5a95('0x5'))['db'];var utils=require(_0x5a95('0x6'));var logger=require(_0x5a95('0x7'))('rpc');var config=require(_0x5a95('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5a95('0x9')][_0x5a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ef9b,_0xfed18b,_0x41e220){return new BPromise(function(_0x5806ed,_0x579178){return client[_0x5a95('0xb')](_0x33ef9b,_0x41e220)['then'](function(_0x4ad419){logger[_0x5a95('0xc')](_0x5a95('0xd'),_0xfed18b,'request\x20sent');logger[_0x5a95('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xfed18b,_0x5a95('0xf'),JSON[_0x5a95('0x10')](_0x4ad419));if(_0x4ad419['error']){if(_0x4ad419[_0x5a95('0x11')][_0x5a95('0x12')]===0x1f4){logger[_0x5a95('0x11')]('SalesforceField,\x20%s,\x20%s',_0xfed18b,_0x4ad419[_0x5a95('0x11')][_0x5a95('0x13')]);return _0x579178(_0x4ad419[_0x5a95('0x11')]['message']);}logger[_0x5a95('0x11')]('SalesforceField,\x20%s,\x20%s',_0xfed18b,_0x4ad419[_0x5a95('0x11')][_0x5a95('0x13')]);return _0x5806ed(_0x4ad419['error'][_0x5a95('0x13')]);}else{logger[_0x5a95('0xc')]('SalesforceField,\x20%s,\x20%s',_0xfed18b,_0x5a95('0xf'));_0x5806ed(_0x4ad419[_0x5a95('0x14')][_0x5a95('0x13')]);}})['catch'](function(_0x3fc6c3){logger[_0x5a95('0x11')](_0x5a95('0xd'),_0xfed18b,_0x3fc6c3);_0x579178(_0x3fc6c3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7ac7648..b58c96b 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 _0x9f94=['/:id/configurations','addConfiguration','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9f94,0x1e7));var _0x49f9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9f94[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var path=require(_0x49f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49f9('0x3')]();var fs_extra=require(_0x49f9('0x4'));var auth=require(_0x49f9('0x5'));var interaction=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x49f9('0x8')]('/',auth[_0x49f9('0x9')](),controller[_0x49f9('0xa')]);router[_0x49f9('0x8')](_0x49f9('0xb'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xc')]);router[_0x49f9('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x49f9('0xd')]);router['get'](_0x49f9('0xe'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xf')]);router['post']('/',auth[_0x49f9('0x9')](),controller['create']);router[_0x49f9('0x10')](_0x49f9('0x11'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x12')]);router['put']('/:id',auth[_0x49f9('0x9')](),controller[_0x49f9('0x13')]);router[_0x49f9('0x14')](_0x49f9('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c0e=['post','create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','get','show','getConfigurations','/:id/fields','getFields'];(function(_0x24dc31,_0x268d9e){var _0x17ecd5=function(_0x14b9bc){while(--_0x14b9bc){_0x24dc31['push'](_0x24dc31['shift']());}};_0x17ecd5(++_0x268d9e);}(_0x4c0e,0x128));var _0xe4c0=function(_0x110cbb,_0x186ee7){_0x110cbb=_0x110cbb-0x0;var _0x145f91=_0x4c0e[_0x110cbb];return _0x145f91;};'use strict';var multer=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var path=require(_0xe4c0('0x2'));var timeout=require(_0xe4c0('0x3'));var express=require(_0xe4c0('0x4'));var router=express[_0xe4c0('0x5')]();var fs_extra=require(_0xe4c0('0x6'));var auth=require(_0xe4c0('0x7'));var interaction=require(_0xe4c0('0x8'));var config=require('../../config/environment');var controller=require(_0xe4c0('0x9'));router['get']('/',auth[_0xe4c0('0xa')](),controller['index']);router[_0xe4c0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe4c0('0xc')]);router[_0xe4c0('0xb')]('/:id/configurations',auth[_0xe4c0('0xa')](),controller[_0xe4c0('0xd')]);router[_0xe4c0('0xb')](_0xe4c0('0xe'),auth['isAuthenticated'](),controller[_0xe4c0('0xf')]);router[_0xe4c0('0x10')]('/',auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x11')]);router[_0xe4c0('0x10')](_0xe4c0('0x12'),auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x13')]);router[_0xe4c0('0x14')](_0xe4c0('0x15'),auth[_0xe4c0('0xa')](),controller['update']);router[_0xe4c0('0x16')](_0xe4c0('0x15'),auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0138cd0..1e6ea72 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 _0xe4c3=['sequelize','exports','STRING','username'];(function(_0x5778f9,_0x527dda){var _0xe8dcaa=function(_0x452f95){while(--_0x452f95){_0x5778f9['push'](_0x5778f9['shift']());}};_0xe8dcaa(++_0x527dda);}(_0xe4c3,0x1cc));var _0x3e4c=function(_0x597c5d,_0x427255){_0x597c5d=_0x597c5d-0x0;var _0x15e531=_0xe4c3[_0x597c5d];return _0x15e531;};'use strict';var Sequelize=require(_0x3e4c('0x0'));module[_0x3e4c('0x1')]={'name':{'type':Sequelize[_0x3e4c('0x2')]},'description':{'type':Sequelize[_0x3e4c('0x2')]},'username':{'type':Sequelize[_0x3e4c('0x2')],'unique':_0x3e4c('0x3')},'password':{'type':Sequelize[_0x3e4c('0x2')]},'email':{'type':Sequelize[_0x3e4c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x3e4c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x634d=['remoteUri','sequelize','exports','STRING'];(function(_0xcf861a,_0x4d8d92){var _0x1cd963=function(_0x143f06){while(--_0x143f06){_0xcf861a['push'](_0xcf861a['shift']());}};_0x1cd963(++_0x4d8d92);}(_0x634d,0x169));var _0xd634=function(_0x38a920,_0x532cda){_0x38a920=_0x38a920-0x0;var _0x263dd8=_0x634d[_0x38a920];return _0x263dd8;};'use strict';var Sequelize=require(_0xd634('0x0'));module[_0xd634('0x1')]={'name':{'type':Sequelize[_0xd634('0x2')]},'description':{'type':Sequelize[_0xd634('0x2')]},'username':{'type':Sequelize[_0xd634('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd634('0x2')]},'remoteUri':{'type':Sequelize[_0xd634('0x2')],'unique':_0xd634('0x3')},'serverUrl':{'type':Sequelize[_0xd634('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 e512254..1dc1bb3 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 _0xcaf0=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','ServicenowAccount','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','body','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','activity_due','assigned_to','sla_due','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaf0,0x15c));var _0x0caf=function(_0x5e3236,_0x34e9be){_0x5e3236=_0x5e3236-0x0;var _0x5a9fc6=_0xcaf0[_0x5e3236];return _0x5a9fc6;};'use strict';var emlformat=require(_0x0caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0caf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0caf('0x2'));var moment=require(_0x0caf('0x3'));var BPromise=require(_0x0caf('0x4'));var Mustache=require('mustache');var util=require(_0x0caf('0x5'));var path=require(_0x0caf('0x6'));var sox=require(_0x0caf('0x7'));var csv=require(_0x0caf('0x8'));var ejs=require(_0x0caf('0x9'));var fs=require('fs');var fs_extra=require(_0x0caf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0caf('0xb'));var jsforce=require(_0x0caf('0xc'));var deskjs=require(_0x0caf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0caf('0xe'));var Papa=require(_0x0caf('0xf'));var Redis=require(_0x0caf('0x10'));var authService=require(_0x0caf('0x11'));var qs=require(_0x0caf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0caf('0x13'))(_0x0caf('0x14'));var utils=require(_0x0caf('0x15'));var config=require(_0x0caf('0x16'));var licenseUtil=require(_0x0caf('0x17'));var db=require(_0x0caf('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x489da6,_0xe7b804){_0xe7b804=_0xe7b804||0xcc;return function(_0x273d95){if(_0x273d95){return _0x489da6['sendStatus'](_0xe7b804);}return _0x489da6[_0x0caf('0x19')](_0xe7b804)[_0x0caf('0x1a')]();};}function respondWithResult(_0x1b99e4,_0xa0730e){_0xa0730e=_0xa0730e||0xc8;return function(_0x1db737){if(_0x1db737){return _0x1b99e4[_0x0caf('0x19')](_0xa0730e)[_0x0caf('0x1b')](_0x1db737);}};}function respondWithFilteredResult(_0x1ecc95,_0x56fb31){return function(_0x4897e2){if(_0x4897e2){var _0x4a5221=typeof _0x56fb31[_0x0caf('0x1c')]===_0x0caf('0x1d')&&typeof _0x56fb31[_0x0caf('0x1e')]===_0x0caf('0x1d');var _0x405301=_0x4897e2[_0x0caf('0x1f')];var _0x4dbcd0=_0x4a5221?0x0:_0x56fb31[_0x0caf('0x1c')];var _0x583ee0=_0x4a5221?_0x4897e2['count']:_0x56fb31[_0x0caf('0x1c')]+_0x56fb31['limit'];var _0x21748f;if(_0x583ee0>=_0x405301){_0x583ee0=_0x405301;_0x21748f=0xc8;}else{_0x21748f=0xce;}_0x1ecc95[_0x0caf('0x19')](_0x21748f);return _0x1ecc95['set'](_0x0caf('0x20'),_0x4dbcd0+'-'+_0x583ee0+'/'+_0x405301)[_0x0caf('0x1b')](_0x4897e2);}return null;};}function patchUpdates(_0x5a1bbd){return function(_0x57286e){try{jsonpatch[_0x0caf('0x21')](_0x57286e,_0x5a1bbd,!![]);}catch(_0x12f77c){return BPromise['reject'](_0x12f77c);}return _0x57286e[_0x0caf('0x22')]();};}function saveUpdates(_0x560918,_0x2f3167){return function(_0x804d12){if(_0x804d12){return _0x804d12[_0x0caf('0x23')](_0x560918)[_0x0caf('0x24')](function(_0x3e1fd5){return _0x3e1fd5;});}return null;};}function removeEntity(_0x5bf7bd,_0x3a6ad5){return function(_0x335347){if(_0x335347){return _0x335347[_0x0caf('0x25')]()[_0x0caf('0x24')](function(){_0x5bf7bd[_0x0caf('0x19')](0xcc)[_0x0caf('0x1a')]();});}};}function handleEntityNotFound(_0x23a99e,_0x5671b4){return function(_0x328dcc){if(!_0x328dcc){_0x23a99e[_0x0caf('0x26')](0x194);}return _0x328dcc;};}function handleError(_0x597ad4,_0x1f3f32){_0x1f3f32=_0x1f3f32||0x1f4;return function(_0x508936){logger[_0x0caf('0x27')](_0x508936[_0x0caf('0x28')]);if(_0x508936['name']){delete _0x508936['name'];}_0x597ad4['status'](_0x1f3f32)[_0x0caf('0x29')](_0x508936);};}exports[_0x0caf('0x2a')]=function(_0x2e0935,_0x15fac2){var _0x506f14={},_0x7a9bec={},_0x532778={'count':0x0,'rows':[]};var _0x324439=_[_0x0caf('0x2b')](db[_0x0caf('0x2c')]['rawAttributes'],function(_0x2d1d90){return{'name':_0x2d1d90[_0x0caf('0x2d')],'type':_0x2d1d90[_0x0caf('0x2e')][_0x0caf('0x2f')]};});_0x7a9bec['model']=_[_0x0caf('0x2b')](_0x324439,'name');_0x7a9bec[_0x0caf('0x30')]=_[_0x0caf('0x31')](_0x2e0935[_0x0caf('0x30')]);_0x7a9bec[_0x0caf('0x32')]=_[_0x0caf('0x33')](_0x7a9bec['model'],_0x7a9bec[_0x0caf('0x30')]);_0x506f14[_0x0caf('0x34')]=_[_0x0caf('0x33')](_0x7a9bec['model'],qs[_0x0caf('0x35')](_0x2e0935['query'][_0x0caf('0x35')]));_0x506f14[_0x0caf('0x34')]=_0x506f14['attributes'][_0x0caf('0x36')]?_0x506f14[_0x0caf('0x34')]:_0x7a9bec[_0x0caf('0x37')];if(!_0x2e0935['query']['hasOwnProperty'](_0x0caf('0x38'))){_0x506f14[_0x0caf('0x1e')]=qs[_0x0caf('0x1e')](_0x2e0935[_0x0caf('0x30')][_0x0caf('0x1e')]);_0x506f14[_0x0caf('0x1c')]=qs['offset'](_0x2e0935[_0x0caf('0x30')]['offset']);}_0x506f14[_0x0caf('0x39')]=qs[_0x0caf('0x3a')](_0x2e0935[_0x0caf('0x30')][_0x0caf('0x3a')]);_0x506f14[_0x0caf('0x3b')]=qs[_0x0caf('0x32')](_[_0x0caf('0x3c')](_0x2e0935[_0x0caf('0x30')],_0x7a9bec['filters']),_0x324439);if(_0x2e0935[_0x0caf('0x30')]['filter']){_0x506f14[_0x0caf('0x3b')]=_['merge'](_0x506f14[_0x0caf('0x3b')],{'$or':_[_0x0caf('0x2b')](_0x324439,function(_0x2298d5){if(_0x2298d5[_0x0caf('0x2e')]!==_0x0caf('0x3d')){var _0x428bcd={};_0x428bcd[_0x2298d5[_0x0caf('0x3e')]]={'$like':'%'+_0x2e0935[_0x0caf('0x30')][_0x0caf('0x3f')]+'%'};return _0x428bcd;}})});}_0x506f14=_['merge']({},_0x506f14,_0x2e0935[_0x0caf('0x40')]);var _0x2914fb={'where':_0x506f14[_0x0caf('0x3b')]};return db['ServicenowAccount'][_0x0caf('0x1f')](_0x2914fb)['then'](function(_0x111ae5){_0x532778[_0x0caf('0x1f')]=_0x111ae5;if(_0x2e0935[_0x0caf('0x30')][_0x0caf('0x41')]){_0x506f14[_0x0caf('0x42')]=[{'all':!![]}];}return db[_0x0caf('0x2c')][_0x0caf('0x43')](_0x506f14);})[_0x0caf('0x24')](function(_0x9b5dae){_0x532778[_0x0caf('0x44')]=_0x9b5dae;return _0x532778;})[_0x0caf('0x24')](respondWithFilteredResult(_0x15fac2,_0x506f14))[_0x0caf('0x45')](handleError(_0x15fac2,null));};exports['show']=function(_0x1fb5c3,_0x5ee3da){var _0x1e483a={'raw':![],'where':{'id':_0x1fb5c3[_0x0caf('0x46')]['id']}},_0x37e976={};_0x37e976[_0x0caf('0x37')]=_[_0x0caf('0x31')](db[_0x0caf('0x2c')][_0x0caf('0x47')]);_0x37e976['query']=_[_0x0caf('0x31')](_0x1fb5c3[_0x0caf('0x30')]);_0x37e976['filters']=_[_0x0caf('0x33')](_0x37e976[_0x0caf('0x37')],_0x37e976[_0x0caf('0x30')]);_0x1e483a[_0x0caf('0x34')]=_[_0x0caf('0x33')](_0x37e976['model'],qs['fields'](_0x1fb5c3[_0x0caf('0x30')][_0x0caf('0x35')]));_0x1e483a[_0x0caf('0x34')]=_0x1e483a[_0x0caf('0x34')]['length']?_0x1e483a['attributes']:_0x37e976[_0x0caf('0x37')];if(_0x1fb5c3[_0x0caf('0x30')][_0x0caf('0x41')]){_0x1e483a[_0x0caf('0x42')]=[{'all':!![]}];}_0x1e483a=_[_0x0caf('0x48')]({},_0x1e483a,_0x1fb5c3[_0x0caf('0x40')]);return db[_0x0caf('0x2c')][_0x0caf('0x49')](_0x1e483a)[_0x0caf('0x24')](handleEntityNotFound(_0x5ee3da,null))['then'](respondWithResult(_0x5ee3da,null))[_0x0caf('0x45')](handleError(_0x5ee3da,null));};exports[_0x0caf('0x4a')]=function(_0x5259d9,_0x38724b){return db[_0x0caf('0x2c')][_0x0caf('0x4a')](_0x5259d9[_0x0caf('0x4b')],{})[_0x0caf('0x24')](respondWithResult(_0x38724b,0xc9))[_0x0caf('0x45')](handleError(_0x38724b,null));};exports[_0x0caf('0x23')]=function(_0x87b2da,_0x55deae){if(_0x87b2da[_0x0caf('0x4b')]['id']){delete _0x87b2da[_0x0caf('0x4b')]['id'];}return db[_0x0caf('0x2c')][_0x0caf('0x49')]({'where':{'id':_0x87b2da['params']['id']}})[_0x0caf('0x24')](handleEntityNotFound(_0x55deae,null))['then'](saveUpdates(_0x87b2da[_0x0caf('0x4b')],null))['then'](respondWithResult(_0x55deae,null))[_0x0caf('0x45')](handleError(_0x55deae,null));};exports[_0x0caf('0x25')]=function(_0x35a6b7,_0xfdc633){return db['ServicenowAccount'][_0x0caf('0x49')]({'where':{'id':_0x35a6b7[_0x0caf('0x46')]['id']}})[_0x0caf('0x24')](handleEntityNotFound(_0xfdc633,null))['then'](removeEntity(_0xfdc633,null))['catch'](handleError(_0xfdc633,null));};exports[_0x0caf('0x4c')]=function(_0x2a3132,_0x34f04f,_0x48a038){var _0x36d4d8={};var _0x3541fb={};var _0x355024;var _0x58abf5;return db['ServicenowAccount'][_0x0caf('0x4d')]({'where':{'id':_0x2a3132[_0x0caf('0x46')]['id']}})['then'](handleEntityNotFound(_0x34f04f,null))[_0x0caf('0x24')](function(_0x24a175){if(_0x24a175){_0x355024=_0x24a175;_0x3541fb['model']=_[_0x0caf('0x31')](db[_0x0caf('0x4e')][_0x0caf('0x47')]);_0x3541fb[_0x0caf('0x30')]=_['keys'](_0x2a3132['query']);_0x3541fb['filters']=_[_0x0caf('0x33')](_0x3541fb[_0x0caf('0x37')],_0x3541fb[_0x0caf('0x30')]);_0x36d4d8['attributes']=_['intersection'](_0x3541fb[_0x0caf('0x37')],qs[_0x0caf('0x35')](_0x2a3132['query'][_0x0caf('0x35')]));_0x36d4d8['attributes']=_0x36d4d8[_0x0caf('0x34')][_0x0caf('0x36')]?_0x36d4d8[_0x0caf('0x34')]:_0x3541fb[_0x0caf('0x37')];_0x36d4d8[_0x0caf('0x39')]=qs[_0x0caf('0x3a')](_0x2a3132[_0x0caf('0x30')]['sort']);_0x36d4d8['where']=qs[_0x0caf('0x32')](_['pick'](_0x2a3132[_0x0caf('0x30')],_0x3541fb[_0x0caf('0x32')]));if(_0x2a3132[_0x0caf('0x30')]['filter']){_0x36d4d8[_0x0caf('0x3b')]=_[_0x0caf('0x48')](_0x36d4d8[_0x0caf('0x3b')],{'$or':_[_0x0caf('0x2b')](_0x36d4d8['attributes'],function(_0x1a14e3){var _0x3add36={};_0x3add36[_0x1a14e3]={'$like':'%'+_0x2a3132['query'][_0x0caf('0x3f')]+'%'};return _0x3add36;})});}_0x36d4d8=_[_0x0caf('0x48')]({},_0x36d4d8,_0x2a3132['options']);return _0x355024[_0x0caf('0x4c')](_0x36d4d8);}})[_0x0caf('0x24')](function(_0x4f1008){if(_0x4f1008){_0x58abf5=_0x4f1008[_0x0caf('0x36')];if(!_0x2a3132[_0x0caf('0x30')][_0x0caf('0x4f')](_0x0caf('0x38'))){_0x36d4d8[_0x0caf('0x1e')]=qs[_0x0caf('0x1e')](_0x2a3132[_0x0caf('0x30')][_0x0caf('0x1e')]);_0x36d4d8[_0x0caf('0x1c')]=qs['offset'](_0x2a3132[_0x0caf('0x30')][_0x0caf('0x1c')]);}return _0x355024[_0x0caf('0x4c')](_0x36d4d8);}})['then'](function(_0xb551db){if(_0xb551db){return _0xb551db?{'count':_0x58abf5,'rows':_0xb551db}:null;}})[_0x0caf('0x24')](respondWithResult(_0x34f04f,null))['catch'](handleError(_0x34f04f,null));};exports[_0x0caf('0x50')]=function(_0x177869,_0x50d7e8,_0x2aede4){if(_0x177869[_0x0caf('0x4b')]['id']){delete _0x177869[_0x0caf('0x4b')]['id'];}return db[_0x0caf('0x2c')]['findOne']({'where':{'id':_0x177869[_0x0caf('0x46')]['id']}})[_0x0caf('0x24')](handleEntityNotFound(_0x50d7e8,null))['then'](function(_0x3b149c){if(_0x3b149c){_0x177869['body'][_0x0caf('0x51')]=_0x3b149c['id'];_0x177869[_0x0caf('0x4b')][_0x0caf('0x52')]=integrations[_0x0caf('0x53')](_0x177869[_0x0caf('0x4b')][_0x0caf('0x54')],_0x177869['body'][_0x0caf('0x2e')]);_0x177869[_0x0caf('0x4b')][_0x0caf('0x55')]=integrations['getDescriptions'](_0x177869[_0x0caf('0x4b')][_0x0caf('0x54')],_0x177869[_0x0caf('0x4b')][_0x0caf('0x2e')]);return db['ServicenowConfiguration']['create'](_0x177869[_0x0caf('0x4b')],{'include':[{'model':db[_0x0caf('0x56')],'as':_0x0caf('0x52')},{'model':db[_0x0caf('0x56')],'as':_0x0caf('0x55')}]});}return null;})[_0x0caf('0x24')](respondWithResult(_0x50d7e8,null))['catch'](handleError(_0x50d7e8,null));};exports[_0x0caf('0x57')]=function(_0x2056b7,_0x24bb4a,_0x2fb6b8){var _0x7812aa=[_0x0caf('0x58'),_0x0caf('0x59'),_0x0caf('0x5a'),_0x0caf('0x5b'),'close_code',_0x0caf('0x5c'),_0x0caf('0x5d'),_0x0caf('0x5e'),_0x0caf('0x5f')];var _0x1c62cc=[_0x0caf('0x60'),'made_sla','caused_by',_0x0caf('0x61'),'upon_reject',_0x0caf('0x62'),_0x0caf('0x63'),_0x0caf('0x59'),_0x0caf('0x64'),_0x0caf('0x65'),_0x0caf('0x66'),_0x0caf('0x67'),_0x0caf('0x68'),'user_input',_0x0caf('0x69'),_0x0caf('0x6a'),_0x0caf('0x6b'),'sys_created_by',_0x0caf('0x5a'),_0x0caf('0x39'),_0x0caf('0x6c'),_0x0caf('0x6d'),_0x0caf('0x6e'),_0x0caf('0x6f'),'impact',_0x0caf('0x70'),_0x0caf('0x71'),'business_service',_0x0caf('0x72'),_0x0caf('0x73'),_0x0caf('0x74'),_0x0caf('0x75'),'expected_start','opened_at','business_duration',_0x0caf('0x76'),_0x0caf('0x77'),_0x0caf('0x78'),_0x0caf('0x79'),_0x0caf('0x7a'),_0x0caf('0x7b'),_0x0caf('0x5b'),_0x0caf('0x7c'),_0x0caf('0x7d'),'close_code',_0x0caf('0x7e'),_0x0caf('0x7f'),_0x0caf('0x80'),'assignment_group',_0x0caf('0x81'),_0x0caf('0x82'),_0x0caf('0x83'),_0x0caf('0x84'),_0x0caf('0x5c'),_0x0caf('0x85'),'close_notes','closed_by',_0x0caf('0x86'),_0x0caf('0x87'),_0x0caf('0x88'),_0x0caf('0x89'),'reopened_by',_0x0caf('0x5d'),_0x0caf('0x8a'),_0x0caf('0x8b'),_0x0caf('0x8c'),'reassignment_count',_0x0caf('0x8d'),_0x0caf('0x8e'),'severity','comments',_0x0caf('0x8f'),'approval','comments_and_work_notes','due_date',_0x0caf('0x90'),_0x0caf('0x91'),_0x0caf('0x92'),_0x0caf('0x93'),'upon_approval',_0x0caf('0x94'),_0x0caf('0x95'),_0x0caf('0x5f')];var _0x1a5017='';var _0x5cab6c='';var _0x9dbafc=[];var _0x145a6e='';var _0x1ed1be='';var _0x5e9c98=[];var _0x22bbc0='';var _0x5d2f41='';var _0x31767f={};var _0xcc37f8='';return db[_0x0caf('0x2c')]['findOne']({'where':{'id':_0x2056b7[_0x0caf('0x46')]['id']},'attributes':['id',_0x0caf('0x96'),_0x0caf('0x97'),_0x0caf('0x98'),_0x0caf('0x99'),'serverUrl']})[_0x0caf('0x24')](handleEntityNotFound(_0x24bb4a,null))[_0x0caf('0x24')](function(_0x395df6){if(_0x395df6){_0xcc37f8=_0x395df6[_0x0caf('0x99')];var _0x41b32c=_0xcc37f8['slice'](-0x1);if(_0x41b32c==='/'){_0xcc37f8=_0xcc37f8['substring'](0x0,_0xcc37f8[_0x0caf('0x9a')](_0x41b32c));}_0x5d2f41=util['format']('%s/api/now/doc/table/schema/',_0xcc37f8);_0x22bbc0=util[_0x0caf('0x9b')](_0x0caf('0x9c'),_0xcc37f8);_0x31767f={'user':_0x395df6[_0x0caf('0x96')],'pass':_0x395df6[_0x0caf('0x97')]};var _0x5667fa={'method':'GET','uri':_0x5d2f41+_0x0caf('0x9d'),'auth':_0x31767f,'json':!![]};return rp(_0x5667fa);}})['then'](function(_0x521fb7){if(_0x521fb7['result']['length']>0x0){_0x1a5017=_0x521fb7['result'];}console[_0x0caf('0x9e')](_0x0caf('0x9f'),_0x1a5017);_0x5e9c98=[];_0x5cab6c=Object[_0x0caf('0xa0')]([],_0x1a5017);_[_0x0caf('0xa1')](_0x5cab6c,function(_0x18ded9){return!_0x7812aa[_0x0caf('0xa2')](_0x18ded9['name']);});_0x5cab6c[_0x0caf('0xa3')](function(_0x46504b){var _0x277711=createFieldObject(_0x22bbc0,_0x31767f,_0x46504b[_0x0caf('0xa4')],_0x46504b['name'],_0x46504b[_0x0caf('0xa5')],![]);_0x5e9c98[_0x0caf('0xa6')](_0x277711);});return Promise[_0x0caf('0xa7')](_0x5e9c98);})[_0x0caf('0x24')](function(_0x35c395){_0x9dbafc=_0x35c395;_0x145a6e=Object[_0x0caf('0xa0')]([],_0x1a5017);console[_0x0caf('0x9e')](_0x0caf('0xa8'),_0x1a5017);_[_0x0caf('0xa1')](_0x145a6e,function(_0x4ae83c){return _0x1c62cc['includes'](_0x4ae83c[_0x0caf('0x3e')]);});console[_0x0caf('0x9e')](_0x0caf('0xa9'),_0x145a6e);_0x5e9c98=[];_0x145a6e[_0x0caf('0xa3')](function(_0xe4867b){var _0x323d09=createFieldObject(_0x22bbc0,_0x31767f,_0xe4867b[_0x0caf('0xa4')],_0xe4867b[_0x0caf('0x3e')],_0xe4867b[_0x0caf('0xa5')],!![]);_0x5e9c98['push'](_0x323d09);});return Promise['all'](_0x5e9c98);})[_0x0caf('0x24')](function(_0x463f0b){_0x1ed1be=_0x463f0b;var _0x1cfc9f=_0x9dbafc[_0x0caf('0xaa')](_0x1ed1be);return{'count':_0x1cfc9f[_0x0caf('0x36')],'rows':_0x1cfc9f};})[_0x0caf('0x24')](respondWithResult(_0x24bb4a,null))['catch'](function(_0x57ade5){console['log']('ServiceNow\x20error:\x20'+_0x57ade5);var _0x4359e5=_0x2056b7[_0x0caf('0x30')][_0x0caf('0xab')]?0x1f4:_0x57ade5[_0x0caf('0xac')]||0x1f4;logger[_0x0caf('0x27')](_0x57ade5[_0x0caf('0x28')]);delete _0x57ade5[_0x0caf('0x3e')];if(_0x4359e5===0x191){_0x4359e5=0x190;}_0x24bb4a[_0x0caf('0x19')](_0x4359e5)[_0x0caf('0x29')](_0x2056b7[_0x0caf('0x30')][_0x0caf('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x57ade5[_0x0caf('0xac')]}:_0x57ade5);});};function createFieldObject(_0x24bc92,_0x196dbe,_0x228fd3,_0x14ee47,_0x5410cd,_0x2c3a97){return new Promise(function(_0x5a3eee,_0x270eb2){var _0x4a2b2a={'id':_0x14ee47,'name':_0x5410cd,'custom':_0x2c3a97};if(_0x228fd3===_0x0caf('0xad')){_0x4a2b2a['options']=[{'name':_0x0caf('0xae'),'value':_0x0caf('0xaf')},{'name':_0x0caf('0xb0'),'value':_0x0caf('0xb1')}];_0x5a3eee(_0x4a2b2a);}else{var _0x17695c={'method':_0x0caf('0xb2'),'uri':_0x24bc92+_0x0caf('0xb3')+_0x14ee47,'auth':_0x196dbe,'json':!![]};return rp(_0x17695c)['then'](function(_0x27c8a1){var _0x4dd778=[];if(_0x27c8a1[_0x0caf('0xb4')][_0x0caf('0x36')]>0x0){_0x27c8a1['result'][_0x0caf('0xa3')](function(_0x1df5f9){if(_0x1df5f9[_0x0caf('0xb5')]===_0x0caf('0xb1')){var _0x1d1bf0={'name':_0x1df5f9[_0x0caf('0xa5')],'value':_0x1df5f9[_0x0caf('0xb6')]};_0x4dd778[_0x0caf('0xa6')](_0x1d1bf0);}});}_0x4a2b2a[_0x0caf('0x40')]=_0x4dd778;if(_0x4a2b2a[_0x0caf('0x40')][_0x0caf('0x36')]>0x0){_0x5a3eee(_0x4a2b2a);}else{if(_0x2c3a97==![]){_0x5a3eee();}else{_0x5a3eee(_0x4a2b2a);}}});}});} \ No newline at end of file +var _0xb718=['filters','where','merge','options','ServicenowAccount','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','filter','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','work_notes_list','rfc','time_worked','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','includes','forEach','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','sys_choice?sysparm_query=name=incident^element=','inactive','false','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x13d905,_0x4093f6){var _0x308b2f=function(_0x2baa70){while(--_0x2baa70){_0x13d905['push'](_0x13d905['shift']());}};_0x308b2f(++_0x4093f6);}(_0xb718,0x1df));var _0x8b71=function(_0x39dfd3,_0x4f7173){_0x39dfd3=_0x39dfd3-0x0;var _0x4fcd65=_0xb718[_0x39dfd3];return _0x4fcd65;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b71('0x0'));var rp=require(_0x8b71('0x1'));var moment=require(_0x8b71('0x2'));var BPromise=require(_0x8b71('0x3'));var Mustache=require(_0x8b71('0x4'));var util=require('util');var path=require(_0x8b71('0x5'));var sox=require(_0x8b71('0x6'));var csv=require(_0x8b71('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b71('0x8'));var _=require('lodash');var squel=require(_0x8b71('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b71('0xa'));var toCsv=require(_0x8b71('0x7'));var querystring=require(_0x8b71('0xb'));var Papa=require(_0x8b71('0xc'));var Redis=require(_0x8b71('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8b71('0xe'));var hardwareService=require(_0x8b71('0xf'));var logger=require(_0x8b71('0x10'))(_0x8b71('0x11'));var utils=require(_0x8b71('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8b71('0x13'));var db=require(_0x8b71('0x14'))['db'];var integrations=require(_0x8b71('0x15'));function respondWithStatusCode(_0x444cec,_0x99709b){_0x99709b=_0x99709b||0xcc;return function(_0x4fb409){if(_0x4fb409){return _0x444cec[_0x8b71('0x16')](_0x99709b);}return _0x444cec['status'](_0x99709b)[_0x8b71('0x17')]();};}function respondWithResult(_0x301538,_0x2cff57){_0x2cff57=_0x2cff57||0xc8;return function(_0xaa00a9){if(_0xaa00a9){return _0x301538[_0x8b71('0x18')](_0x2cff57)[_0x8b71('0x19')](_0xaa00a9);}};}function respondWithFilteredResult(_0x4acbad,_0x1d9da3){return function(_0x52aeda){if(_0x52aeda){var _0x2eb0e8=typeof _0x1d9da3['offset']===_0x8b71('0x1a')&&typeof _0x1d9da3[_0x8b71('0x1b')]===_0x8b71('0x1a');var _0x453ac9=_0x52aeda[_0x8b71('0x1c')];var _0x25aa4b=_0x2eb0e8?0x0:_0x1d9da3[_0x8b71('0x1d')];var _0x14c372=_0x2eb0e8?_0x52aeda[_0x8b71('0x1c')]:_0x1d9da3[_0x8b71('0x1d')]+_0x1d9da3[_0x8b71('0x1b')];var _0xffe7d8;if(_0x14c372>=_0x453ac9){_0x14c372=_0x453ac9;_0xffe7d8=0xc8;}else{_0xffe7d8=0xce;}_0x4acbad[_0x8b71('0x18')](_0xffe7d8);return _0x4acbad[_0x8b71('0x1e')](_0x8b71('0x1f'),_0x25aa4b+'-'+_0x14c372+'/'+_0x453ac9)[_0x8b71('0x19')](_0x52aeda);}return null;};}function patchUpdates(_0x3ce6b0){return function(_0x1d0645){try{jsonpatch[_0x8b71('0x20')](_0x1d0645,_0x3ce6b0,!![]);}catch(_0x5dbc75){return BPromise[_0x8b71('0x21')](_0x5dbc75);}return _0x1d0645[_0x8b71('0x22')]();};}function saveUpdates(_0x18d477,_0x5bfc5b){return function(_0xf46ace){if(_0xf46ace){return _0xf46ace[_0x8b71('0x23')](_0x18d477)['then'](function(_0x4bb5a9){return _0x4bb5a9;});}return null;};}function removeEntity(_0x49102b,_0x52d5b8){return function(_0x77911){if(_0x77911){return _0x77911[_0x8b71('0x24')]()[_0x8b71('0x25')](function(){_0x49102b['status'](0xcc)[_0x8b71('0x17')]();});}};}function handleEntityNotFound(_0x250e9b,_0x8706e5){return function(_0x37a925){if(!_0x37a925){_0x250e9b[_0x8b71('0x16')](0x194);}return _0x37a925;};}function handleError(_0x1c17c4,_0x1eb041){_0x1eb041=_0x1eb041||0x1f4;return function(_0x43abd3){logger[_0x8b71('0x26')](_0x43abd3[_0x8b71('0x27')]);if(_0x43abd3[_0x8b71('0x28')]){delete _0x43abd3[_0x8b71('0x28')];}_0x1c17c4['status'](_0x1eb041)['send'](_0x43abd3);};}exports[_0x8b71('0x29')]=function(_0x186bcf,_0x369b1b){var _0x2be47b={},_0x2b7759={},_0x33c51e={'count':0x0,'rows':[]};var _0x328bd6=_[_0x8b71('0x2a')](db['ServicenowAccount'][_0x8b71('0x2b')],function(_0x25e8e0){return{'name':_0x25e8e0[_0x8b71('0x2c')],'type':_0x25e8e0[_0x8b71('0x2d')][_0x8b71('0x2e')]};});_0x2b7759[_0x8b71('0x2f')]=_['map'](_0x328bd6,_0x8b71('0x28'));_0x2b7759[_0x8b71('0x30')]=_[_0x8b71('0x31')](_0x186bcf['query']);_0x2b7759['filters']=_[_0x8b71('0x32')](_0x2b7759[_0x8b71('0x2f')],_0x2b7759[_0x8b71('0x30')]);_0x2be47b[_0x8b71('0x33')]=_[_0x8b71('0x32')](_0x2b7759[_0x8b71('0x2f')],qs[_0x8b71('0x34')](_0x186bcf['query'][_0x8b71('0x34')]));_0x2be47b[_0x8b71('0x33')]=_0x2be47b[_0x8b71('0x33')]['length']?_0x2be47b[_0x8b71('0x33')]:_0x2b7759['model'];if(!_0x186bcf[_0x8b71('0x30')][_0x8b71('0x35')](_0x8b71('0x36'))){_0x2be47b[_0x8b71('0x1b')]=qs['limit'](_0x186bcf[_0x8b71('0x30')][_0x8b71('0x1b')]);_0x2be47b['offset']=qs['offset'](_0x186bcf[_0x8b71('0x30')][_0x8b71('0x1d')]);}_0x2be47b[_0x8b71('0x37')]=qs['sort'](_0x186bcf[_0x8b71('0x30')][_0x8b71('0x38')]);_0x2be47b['where']=qs['filters'](_[_0x8b71('0x39')](_0x186bcf['query'],_0x2b7759[_0x8b71('0x3a')]),_0x328bd6);if(_0x186bcf['query']['filter']){_0x2be47b[_0x8b71('0x3b')]=_[_0x8b71('0x3c')](_0x2be47b['where'],{'$or':_[_0x8b71('0x2a')](_0x328bd6,function(_0x28cfa2){if(_0x28cfa2[_0x8b71('0x2d')]!=='VIRTUAL'){var _0x194f43={};_0x194f43[_0x28cfa2[_0x8b71('0x28')]]={'$like':'%'+_0x186bcf[_0x8b71('0x30')]['filter']+'%'};return _0x194f43;}})});}_0x2be47b=_[_0x8b71('0x3c')]({},_0x2be47b,_0x186bcf[_0x8b71('0x3d')]);var _0x52ec0a={'where':_0x2be47b[_0x8b71('0x3b')]};return db[_0x8b71('0x3e')][_0x8b71('0x1c')](_0x52ec0a)[_0x8b71('0x25')](function(_0x24b46a){_0x33c51e['count']=_0x24b46a;if(_0x186bcf['query'][_0x8b71('0x3f')]){_0x2be47b[_0x8b71('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x8b71('0x41')](_0x2be47b);})['then'](function(_0x5c8af1){_0x33c51e[_0x8b71('0x42')]=_0x5c8af1;return _0x33c51e;})['then'](respondWithFilteredResult(_0x369b1b,_0x2be47b))[_0x8b71('0x43')](handleError(_0x369b1b,null));};exports[_0x8b71('0x44')]=function(_0x4022e4,_0x115639){var _0x961358={'raw':![],'where':{'id':_0x4022e4['params']['id']}},_0x57800b={};_0x57800b[_0x8b71('0x2f')]=_[_0x8b71('0x31')](db[_0x8b71('0x3e')]['rawAttributes']);_0x57800b[_0x8b71('0x30')]=_[_0x8b71('0x31')](_0x4022e4['query']);_0x57800b['filters']=_['intersection'](_0x57800b[_0x8b71('0x2f')],_0x57800b[_0x8b71('0x30')]);_0x961358[_0x8b71('0x33')]=_[_0x8b71('0x32')](_0x57800b[_0x8b71('0x2f')],qs[_0x8b71('0x34')](_0x4022e4[_0x8b71('0x30')][_0x8b71('0x34')]));_0x961358[_0x8b71('0x33')]=_0x961358[_0x8b71('0x33')][_0x8b71('0x45')]?_0x961358[_0x8b71('0x33')]:_0x57800b[_0x8b71('0x2f')];if(_0x4022e4[_0x8b71('0x30')][_0x8b71('0x3f')]){_0x961358[_0x8b71('0x40')]=[{'all':!![]}];}_0x961358=_[_0x8b71('0x3c')]({},_0x961358,_0x4022e4[_0x8b71('0x3d')]);return db['ServicenowAccount'][_0x8b71('0x46')](_0x961358)[_0x8b71('0x25')](handleEntityNotFound(_0x115639,null))[_0x8b71('0x25')](respondWithResult(_0x115639,null))[_0x8b71('0x43')](handleError(_0x115639,null));};exports[_0x8b71('0x47')]=function(_0x3ed6e0,_0x486765){return db[_0x8b71('0x3e')][_0x8b71('0x47')](_0x3ed6e0[_0x8b71('0x48')],{})[_0x8b71('0x25')](respondWithResult(_0x486765,0xc9))[_0x8b71('0x43')](handleError(_0x486765,null));};exports[_0x8b71('0x23')]=function(_0x9a7055,_0x2c78a3){if(_0x9a7055[_0x8b71('0x48')]['id']){delete _0x9a7055[_0x8b71('0x48')]['id'];}return db[_0x8b71('0x3e')]['find']({'where':{'id':_0x9a7055[_0x8b71('0x49')]['id']}})[_0x8b71('0x25')](handleEntityNotFound(_0x2c78a3,null))[_0x8b71('0x25')](saveUpdates(_0x9a7055[_0x8b71('0x48')],null))['then'](respondWithResult(_0x2c78a3,null))[_0x8b71('0x43')](handleError(_0x2c78a3,null));};exports[_0x8b71('0x24')]=function(_0x112a52,_0x3d00ac){return db['ServicenowAccount'][_0x8b71('0x46')]({'where':{'id':_0x112a52[_0x8b71('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d00ac,null))['then'](removeEntity(_0x3d00ac,null))['catch'](handleError(_0x3d00ac,null));};exports[_0x8b71('0x4a')]=function(_0x29d3c9,_0x5c3361,_0x4a5c67){var _0x2b3024={};var _0x310f6a={};var _0x8c8ef9;var _0x334177;return db[_0x8b71('0x3e')][_0x8b71('0x4b')]({'where':{'id':_0x29d3c9[_0x8b71('0x49')]['id']}})[_0x8b71('0x25')](handleEntityNotFound(_0x5c3361,null))['then'](function(_0x5322f5){if(_0x5322f5){_0x8c8ef9=_0x5322f5;_0x310f6a[_0x8b71('0x2f')]=_[_0x8b71('0x31')](db[_0x8b71('0x4c')][_0x8b71('0x2b')]);_0x310f6a[_0x8b71('0x30')]=_['keys'](_0x29d3c9[_0x8b71('0x30')]);_0x310f6a[_0x8b71('0x3a')]=_[_0x8b71('0x32')](_0x310f6a[_0x8b71('0x2f')],_0x310f6a[_0x8b71('0x30')]);_0x2b3024[_0x8b71('0x33')]=_[_0x8b71('0x32')](_0x310f6a[_0x8b71('0x2f')],qs[_0x8b71('0x34')](_0x29d3c9[_0x8b71('0x30')][_0x8b71('0x34')]));_0x2b3024[_0x8b71('0x33')]=_0x2b3024[_0x8b71('0x33')]['length']?_0x2b3024[_0x8b71('0x33')]:_0x310f6a[_0x8b71('0x2f')];_0x2b3024['order']=qs['sort'](_0x29d3c9[_0x8b71('0x30')][_0x8b71('0x38')]);_0x2b3024[_0x8b71('0x3b')]=qs[_0x8b71('0x3a')](_[_0x8b71('0x39')](_0x29d3c9[_0x8b71('0x30')],_0x310f6a[_0x8b71('0x3a')]));if(_0x29d3c9['query'][_0x8b71('0x4d')]){_0x2b3024[_0x8b71('0x3b')]=_[_0x8b71('0x3c')](_0x2b3024['where'],{'$or':_['map'](_0x2b3024[_0x8b71('0x33')],function(_0x41eed3){var _0x2c18ea={};_0x2c18ea[_0x41eed3]={'$like':'%'+_0x29d3c9[_0x8b71('0x30')][_0x8b71('0x4d')]+'%'};return _0x2c18ea;})});}_0x2b3024=_[_0x8b71('0x3c')]({},_0x2b3024,_0x29d3c9[_0x8b71('0x3d')]);return _0x8c8ef9[_0x8b71('0x4a')](_0x2b3024);}})[_0x8b71('0x25')](function(_0x30c7f8){if(_0x30c7f8){_0x334177=_0x30c7f8[_0x8b71('0x45')];if(!_0x29d3c9[_0x8b71('0x30')]['hasOwnProperty'](_0x8b71('0x36'))){_0x2b3024['limit']=qs['limit'](_0x29d3c9[_0x8b71('0x30')][_0x8b71('0x1b')]);_0x2b3024[_0x8b71('0x1d')]=qs[_0x8b71('0x1d')](_0x29d3c9['query']['offset']);}return _0x8c8ef9['getConfigurations'](_0x2b3024);}})[_0x8b71('0x25')](function(_0x5aaabe){if(_0x5aaabe){return _0x5aaabe?{'count':_0x334177,'rows':_0x5aaabe}:null;}})[_0x8b71('0x25')](respondWithResult(_0x5c3361,null))[_0x8b71('0x43')](handleError(_0x5c3361,null));};exports[_0x8b71('0x4e')]=function(_0x3c58b4,_0x389c70,_0x1e0a00){if(_0x3c58b4[_0x8b71('0x48')]['id']){delete _0x3c58b4[_0x8b71('0x48')]['id'];}return db[_0x8b71('0x3e')][_0x8b71('0x4b')]({'where':{'id':_0x3c58b4[_0x8b71('0x49')]['id']}})[_0x8b71('0x25')](handleEntityNotFound(_0x389c70,null))[_0x8b71('0x25')](function(_0x180efb){if(_0x180efb){_0x3c58b4[_0x8b71('0x48')]['AccountId']=_0x180efb['id'];_0x3c58b4[_0x8b71('0x48')][_0x8b71('0x4f')]=integrations['getSubjects'](_0x3c58b4[_0x8b71('0x48')][_0x8b71('0x50')],_0x3c58b4['body']['type']);_0x3c58b4[_0x8b71('0x48')][_0x8b71('0x51')]=integrations[_0x8b71('0x52')](_0x3c58b4[_0x8b71('0x48')]['channel'],_0x3c58b4[_0x8b71('0x48')][_0x8b71('0x2d')]);return db['ServicenowConfiguration'][_0x8b71('0x47')](_0x3c58b4[_0x8b71('0x48')],{'include':[{'model':db[_0x8b71('0x53')],'as':_0x8b71('0x4f')},{'model':db[_0x8b71('0x53')],'as':_0x8b71('0x51')}]});}return null;})[_0x8b71('0x25')](respondWithResult(_0x389c70,null))[_0x8b71('0x43')](handleError(_0x389c70,null));};exports[_0x8b71('0x54')]=function(_0x148c9a,_0x2de028,_0x41a769){var _0x3fff2d=[_0x8b71('0x55'),_0x8b71('0x56'),_0x8b71('0x57'),'subcategory',_0x8b71('0x58'),_0x8b71('0x59'),'incident_state',_0x8b71('0x5a'),_0x8b71('0x5b')];var _0x52d91a=['parent',_0x8b71('0x55'),_0x8b71('0x5c'),_0x8b71('0x5d'),_0x8b71('0x5e'),_0x8b71('0x5f'),_0x8b71('0x60'),_0x8b71('0x56'),_0x8b71('0x61'),'number',_0x8b71('0x62'),'sys_updated_by','opened_by',_0x8b71('0x63'),'sys_created_on',_0x8b71('0x64'),_0x8b71('0x65'),_0x8b71('0x66'),_0x8b71('0x57'),'order',_0x8b71('0x67'),_0x8b71('0x68'),_0x8b71('0x69'),'delivery_plan',_0x8b71('0x6a'),'active',_0x8b71('0x6b'),'business_service','priority','sys_domain_path',_0x8b71('0x6c'),_0x8b71('0x6d'),'expected_start',_0x8b71('0x6e'),_0x8b71('0x6f'),'group_list',_0x8b71('0x70'),_0x8b71('0x71'),_0x8b71('0x72'),_0x8b71('0x73'),_0x8b71('0x74'),'subcategory','work_notes',_0x8b71('0x75'),_0x8b71('0x58'),_0x8b71('0x76'),_0x8b71('0x77'),_0x8b71('0x78'),_0x8b71('0x79'),'business_stc',_0x8b71('0x7a'),'description',_0x8b71('0x7b'),'notify',_0x8b71('0x7c'),_0x8b71('0x7d'),'closed_by',_0x8b71('0x7e'),_0x8b71('0x7f'),_0x8b71('0x80'),_0x8b71('0x81'),'reopened_by','incident_state',_0x8b71('0x82'),_0x8b71('0x83'),_0x8b71('0x84'),_0x8b71('0x85'),_0x8b71('0x86'),_0x8b71('0x87'),_0x8b71('0x5a'),'comments',_0x8b71('0x88'),_0x8b71('0x89'),_0x8b71('0x8a'),_0x8b71('0x8b'),_0x8b71('0x8c'),_0x8b71('0x8d'),_0x8b71('0x8e'),_0x8b71('0x8f'),_0x8b71('0x90'),'correlation_id',_0x8b71('0x91'),_0x8b71('0x5b')];var _0x1b83dd='';var _0x1d8fcd='';var _0x13468f=[];var _0x39a39c='';var _0x1d7474='';var _0x5d6a30=[];var _0x454985='';var _0x44f328='';var _0x551e76={};var _0x5ee981='';return db[_0x8b71('0x3e')][_0x8b71('0x4b')]({'where':{'id':_0x148c9a['params']['id']},'attributes':['id',_0x8b71('0x92'),'password','email',_0x8b71('0x93'),_0x8b71('0x94')]})[_0x8b71('0x25')](handleEntityNotFound(_0x2de028,null))[_0x8b71('0x25')](function(_0x326232){if(_0x326232){_0x5ee981=_0x326232['remoteUri'];var _0x4e2665=_0x5ee981[_0x8b71('0x95')](-0x1);if(_0x4e2665==='/'){_0x5ee981=_0x5ee981[_0x8b71('0x96')](0x0,_0x5ee981[_0x8b71('0x97')](_0x4e2665));}_0x44f328=util['format'](_0x8b71('0x98'),_0x5ee981);_0x454985=util[_0x8b71('0x99')](_0x8b71('0x9a'),_0x5ee981);_0x551e76={'user':_0x326232[_0x8b71('0x92')],'pass':_0x326232[_0x8b71('0x9b')]};var _0x57bda2={'method':_0x8b71('0x9c'),'uri':_0x44f328+_0x8b71('0x9d'),'auth':_0x551e76,'json':!![]};return rp(_0x57bda2);}})[_0x8b71('0x25')](function(_0x3b5b78){if(_0x3b5b78[_0x8b71('0x9e')][_0x8b71('0x45')]>0x0){_0x1b83dd=_0x3b5b78[_0x8b71('0x9e')];}console[_0x8b71('0x9f')](_0x8b71('0xa0'),_0x1b83dd);_0x5d6a30=[];_0x1d8fcd=Object['assign']([],_0x1b83dd);_['remove'](_0x1d8fcd,function(_0x10007e){return!_0x3fff2d[_0x8b71('0xa1')](_0x10007e['name']);});_0x1d8fcd[_0x8b71('0xa2')](function(_0x14a5b7){var _0x3d00c8=createFieldObject(_0x454985,_0x551e76,_0x14a5b7['internalType'],_0x14a5b7[_0x8b71('0x28')],_0x14a5b7[_0x8b71('0xa3')],![]);_0x5d6a30[_0x8b71('0xa4')](_0x3d00c8);});return Promise[_0x8b71('0xa5')](_0x5d6a30);})[_0x8b71('0x25')](function(_0x42b239){_0x13468f=_0x42b239;_0x39a39c=Object[_0x8b71('0xa6')]([],_0x1b83dd);console[_0x8b71('0x9f')](_0x8b71('0xa7'),_0x1b83dd);_['remove'](_0x39a39c,function(_0x108127){return _0x52d91a[_0x8b71('0xa1')](_0x108127[_0x8b71('0x28')]);});console['log'](_0x8b71('0xa8'),_0x39a39c);_0x5d6a30=[];_0x39a39c['forEach'](function(_0x20d1fa){var _0x4ce682=createFieldObject(_0x454985,_0x551e76,_0x20d1fa['internalType'],_0x20d1fa[_0x8b71('0x28')],_0x20d1fa[_0x8b71('0xa3')],!![]);_0x5d6a30['push'](_0x4ce682);});return Promise['all'](_0x5d6a30);})[_0x8b71('0x25')](function(_0x3d8371){_0x1d7474=_0x3d8371;var _0x4ee26b=_0x13468f[_0x8b71('0xa9')](_0x1d7474);return{'count':_0x4ee26b[_0x8b71('0x45')],'rows':_0x4ee26b};})[_0x8b71('0x25')](respondWithResult(_0x2de028,null))['catch'](function(_0x577b83){console[_0x8b71('0x9f')](_0x8b71('0xaa')+_0x577b83);var _0xacc18=_0x148c9a[_0x8b71('0x30')][_0x8b71('0xab')]?0x1f4:_0x577b83['statusCode']||0x1f4;logger[_0x8b71('0x26')](_0x577b83[_0x8b71('0x27')]);delete _0x577b83['name'];if(_0xacc18===0x191){_0xacc18=0x190;}_0x2de028[_0x8b71('0x18')](_0xacc18)['send'](_0x148c9a[_0x8b71('0x30')]['test']?{'message':_0x8b71('0xac'),'statusCode':_0x577b83[_0x8b71('0xad')]}:_0x577b83);});};function createFieldObject(_0x13c117,_0x31bc48,_0x1ad713,_0x57ac3a,_0x504352,_0x40ac5e){return new Promise(function(_0x144eb5,_0x37fa6a){var _0x5c08ab={'id':_0x57ac3a,'name':_0x504352,'custom':_0x40ac5e};if(_0x1ad713===_0x8b71('0xae')){_0x5c08ab['options']=[{'name':_0x8b71('0xaf'),'value':'true'},{'name':'False','value':'false'}];_0x144eb5(_0x5c08ab);}else{var _0x3b6c4f={'method':_0x8b71('0x9c'),'uri':_0x13c117+_0x8b71('0xb0')+_0x57ac3a,'auth':_0x31bc48,'json':!![]};return rp(_0x3b6c4f)[_0x8b71('0x25')](function(_0x359cf6){var _0x49df9b=[];if(_0x359cf6[_0x8b71('0x9e')][_0x8b71('0x45')]>0x0){_0x359cf6[_0x8b71('0x9e')][_0x8b71('0xa2')](function(_0x378446){if(_0x378446[_0x8b71('0xb1')]===_0x8b71('0xb2')){var _0x2a19b8={'name':_0x378446[_0x8b71('0xa3')],'value':_0x378446['value']};_0x49df9b[_0x8b71('0xa4')](_0x2a19b8);}});}_0x5c08ab[_0x8b71('0x3d')]=_0x49df9b;if(_0x5c08ab[_0x8b71('0x3d')][_0x8b71('0x45')]>0x0){_0x144eb5(_0x5c08ab);}else{if(_0x40ac5e==![]){_0x144eb5();}else{_0x144eb5(_0x5c08ab);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index eae8ce4..987321f 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x481604,_0x276ff8){var _0x1ca4ed=function(_0x136e9d){while(--_0x136e9d){_0x481604['push'](_0x481604['shift']());}};_0x1ca4ed(++_0x276ff8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x32e8b5,_0x567349){_0x32e8b5=_0x32e8b5-0x0;var _0x7a28fb=_0x1cb9[_0x32e8b5];return _0x7a28fb;};'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'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x52802f,_0x29f437){_0x52802f=_0x52802f-0x0;var _0x3407cb=_0x1cb9[_0x52802f];return _0x3407cb;};'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'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'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 1e37db6..d1d15eb 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 _0x88fa=['GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','map','include','model','stringify','find','raw','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x19e747,_0x1ecf7a){var _0x5e9206=function(_0x74a79d){while(--_0x74a79d){_0x19e747['push'](_0x19e747['shift']());}};_0x5e9206(++_0x1ecf7a);}(_0x88fa,0x18e));var _0xa88f=function(_0x2fecf2,_0x25ef12){_0x2fecf2=_0x2fecf2-0x0;var _0x30cbd8=_0x88fa[_0x2fecf2];return _0x30cbd8;};'use strict';var _=require(_0xa88f('0x0'));var util=require(_0xa88f('0x1'));var moment=require(_0xa88f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa88f('0x3'));var fs=require('fs');var Redis=require(_0xa88f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa88f('0x5'));var logger=require(_0xa88f('0x6'))(_0xa88f('0x7'));var config=require(_0xa88f('0x8'));var jayson=require(_0xa88f('0x9'));var client=jayson[_0xa88f('0xa')][_0xa88f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f22cc,_0x1623dc,_0x577151){return new BPromise(function(_0x525570,_0x15280d){return client[_0xa88f('0xc')](_0x5f22cc,_0x577151)[_0xa88f('0xd')](function(_0x3b756c){logger[_0xa88f('0xe')](_0xa88f('0xf'),_0x1623dc,'request\x20sent');logger[_0xa88f('0x10')](_0xa88f('0x11'),_0x1623dc,'request\x20sent',JSON['stringify'](_0x3b756c));if(_0x3b756c[_0xa88f('0x12')]){if(_0x3b756c[_0xa88f('0x12')][_0xa88f('0x13')]===0x1f4){logger[_0xa88f('0x12')](_0xa88f('0xf'),_0x1623dc,_0x3b756c[_0xa88f('0x12')][_0xa88f('0x14')]);return _0x15280d(_0x3b756c[_0xa88f('0x12')][_0xa88f('0x14')]);}logger['error'](_0xa88f('0xf'),_0x1623dc,_0x3b756c['error'][_0xa88f('0x14')]);return _0x525570(_0x3b756c[_0xa88f('0x12')][_0xa88f('0x14')]);}else{logger[_0xa88f('0xe')](_0xa88f('0xf'),_0x1623dc,'request\x20sent');_0x525570(_0x3b756c['result']['message']);}})[_0xa88f('0x15')](function(_0x5ce832){logger[_0xa88f('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1623dc,_0x5ce832);_0x15280d(_0x5ce832);});});}exports[_0xa88f('0x16')]=function(_0xe61cfd){var _0x585dc6=this;return new Promise(function(_0x560daa,_0x5eb0b6){return db[_0xa88f('0x17')]['findAll']({'raw':_0xe61cfd[_0xa88f('0x18')]?_0xe61cfd[_0xa88f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xe61cfd['options']?_0xe61cfd['options'][_0xa88f('0x19')]||null:null,'attributes':_0xe61cfd['options']?_0xe61cfd['options'][_0xa88f('0x1a')]||null:null,'limit':_0xe61cfd[_0xa88f('0x18')]?_0xe61cfd[_0xa88f('0x18')][_0xa88f('0x1b')]||null:null,'include':_0xe61cfd[_0xa88f('0x18')]?_0xe61cfd[_0xa88f('0x18')]['include']?_[_0xa88f('0x1c')](_0xe61cfd['options'][_0xa88f('0x1d')],function(_0x44a7ce){return{'model':db[_0x44a7ce[_0xa88f('0x1e')]],'as':_0x44a7ce['as'],'attributes':_0x44a7ce['attributes'],'include':_0x44a7ce[_0xa88f('0x1d')]?_[_0xa88f('0x1c')](_0x44a7ce['include'],function(_0x24e69d){return{'model':db[_0x24e69d[_0xa88f('0x1e')]],'as':_0x24e69d['as'],'attributes':_0x24e69d[_0xa88f('0x1a')],'include':_0x24e69d[_0xa88f('0x1d')]?_[_0xa88f('0x1c')](_0x24e69d[_0xa88f('0x1d')],function(_0x380347){return{'model':db[_0x380347[_0xa88f('0x1e')]],'as':_0x380347['as'],'attributes':_0x380347['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x562bef){logger[_0xa88f('0xe')]('GetServicenowAccount',_0xe61cfd);logger[_0xa88f('0x10')](_0xa88f('0x16'),_0xe61cfd,JSON[_0xa88f('0x1f')](_0x562bef));_0x560daa(_0x562bef);})[_0xa88f('0x15')](function(_0x5d60f5){logger[_0xa88f('0x12')](_0xa88f('0x16'),_0x5d60f5[_0xa88f('0x14')],_0xe61cfd);_0x5eb0b6(_0x585dc6['error'](0x1f4,_0x5d60f5['message']));});});};exports['ShowServicenowAccount']=function(_0x4d741a){var _0xbe5254=this;return new Promise(function(_0x996689,_0x488534){return db['ServicenowAccount'][_0xa88f('0x20')]({'raw':_0x4d741a[_0xa88f('0x18')]?_0x4d741a['options'][_0xa88f('0x21')]===undefined?!![]:![]:!![],'where':_0x4d741a[_0xa88f('0x18')]?_0x4d741a[_0xa88f('0x18')]['where']||null:null,'attributes':_0x4d741a['options']?_0x4d741a[_0xa88f('0x18')][_0xa88f('0x1a')]||null:null,'include':_0x4d741a[_0xa88f('0x18')]?_0x4d741a[_0xa88f('0x18')][_0xa88f('0x1d')]?_[_0xa88f('0x1c')](_0x4d741a[_0xa88f('0x18')][_0xa88f('0x1d')],function(_0x538e24){return{'model':db[_0x538e24[_0xa88f('0x1e')]],'as':_0x538e24['as'],'attributes':_0x538e24['attributes'],'include':_0x538e24[_0xa88f('0x1d')]?_[_0xa88f('0x1c')](_0x538e24[_0xa88f('0x1d')],function(_0x3f0beb){return{'model':db[_0x3f0beb[_0xa88f('0x1e')]],'as':_0x3f0beb['as'],'attributes':_0x3f0beb[_0xa88f('0x1a')],'include':_0x3f0beb[_0xa88f('0x1d')]?_[_0xa88f('0x1c')](_0x3f0beb[_0xa88f('0x1d')],function(_0xace501){return{'model':db[_0xace501[_0xa88f('0x1e')]],'as':_0xace501['as'],'attributes':_0xace501[_0xa88f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a6596){logger[_0xa88f('0xe')](_0xa88f('0x22'),_0x4d741a);logger['debug'](_0xa88f('0x22'),_0x4d741a,JSON['stringify'](_0x5a6596));_0x996689(_0x5a6596);})[_0xa88f('0x15')](function(_0x38ddf1){logger[_0xa88f('0x12')](_0xa88f('0x22'),_0x38ddf1[_0xa88f('0x14')],_0x4d741a);_0x488534(_0xbe5254[_0xa88f('0x12')](0x1f4,_0x38ddf1[_0xa88f('0x14')]));});});}; \ No newline at end of file +var _0x14b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','ServicenowAccount','find','moment','bluebird'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x14b7,0x130));var _0x714b=function(_0x5e3cef,_0x3c57f5){_0x5e3cef=_0x5e3cef-0x0;var _0x34c370=_0x14b7[_0x5e3cef];return _0x34c370;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x714b('0x0'));var BPromise=require(_0x714b('0x1'));var rs=require(_0x714b('0x2'));var fs=require('fs');var Redis=require(_0x714b('0x3'));var db=require(_0x714b('0x4'))['db'];var utils=require(_0x714b('0x5'));var logger=require(_0x714b('0x6'))(_0x714b('0x7'));var config=require('../../config/environment');var jayson=require(_0x714b('0x8'));var client=jayson[_0x714b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dcc21,_0x4e85a6,_0x46e164){return new BPromise(function(_0x23d802,_0x21d277){return client['request'](_0x4dcc21,_0x46e164)[_0x714b('0xa')](function(_0x4af53e){logger[_0x714b('0xb')](_0x714b('0xc'),_0x4e85a6,_0x714b('0xd'));logger[_0x714b('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4e85a6,'request\x20sent',JSON[_0x714b('0xf')](_0x4af53e));if(_0x4af53e[_0x714b('0x10')]){if(_0x4af53e[_0x714b('0x10')][_0x714b('0x11')]===0x1f4){logger['error'](_0x714b('0xc'),_0x4e85a6,_0x4af53e[_0x714b('0x10')][_0x714b('0x12')]);return _0x21d277(_0x4af53e[_0x714b('0x10')][_0x714b('0x12')]);}logger[_0x714b('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4e85a6,_0x4af53e[_0x714b('0x10')][_0x714b('0x12')]);return _0x23d802(_0x4af53e['error']['message']);}else{logger[_0x714b('0xb')](_0x714b('0xc'),_0x4e85a6,'request\x20sent');_0x23d802(_0x4af53e[_0x714b('0x13')][_0x714b('0x12')]);}})[_0x714b('0x14')](function(_0x50a1bd){logger[_0x714b('0x10')](_0x714b('0xc'),_0x4e85a6,_0x50a1bd);_0x21d277(_0x50a1bd);});});}exports[_0x714b('0x15')]=function(_0x3249a6){var _0x3ae588=this;return new Promise(function(_0x3208c9,_0x2bf46e){return db['ServicenowAccount'][_0x714b('0x16')]({'raw':_0x3249a6[_0x714b('0x17')]?_0x3249a6[_0x714b('0x17')][_0x714b('0x18')]===undefined?!![]:![]:!![],'where':_0x3249a6[_0x714b('0x17')]?_0x3249a6[_0x714b('0x17')][_0x714b('0x19')]||null:null,'attributes':_0x3249a6[_0x714b('0x17')]?_0x3249a6['options'][_0x714b('0x1a')]||null:null,'limit':_0x3249a6[_0x714b('0x17')]?_0x3249a6['options'][_0x714b('0x1b')]||null:null,'include':_0x3249a6[_0x714b('0x17')]?_0x3249a6['options']['include']?_[_0x714b('0x1c')](_0x3249a6[_0x714b('0x17')][_0x714b('0x1d')],function(_0x25033b){return{'model':db[_0x25033b['model']],'as':_0x25033b['as'],'attributes':_0x25033b[_0x714b('0x1a')],'include':_0x25033b[_0x714b('0x1d')]?_[_0x714b('0x1c')](_0x25033b[_0x714b('0x1d')],function(_0x369b75){return{'model':db[_0x369b75[_0x714b('0x1e')]],'as':_0x369b75['as'],'attributes':_0x369b75[_0x714b('0x1a')],'include':_0x369b75[_0x714b('0x1d')]?_['map'](_0x369b75['include'],function(_0x2ee1a0){return{'model':db[_0x2ee1a0[_0x714b('0x1e')]],'as':_0x2ee1a0['as'],'attributes':_0x2ee1a0[_0x714b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x714b('0xa')](function(_0x4c004c){logger[_0x714b('0xb')]('GetServicenowAccount',_0x3249a6);logger[_0x714b('0xe')](_0x714b('0x15'),_0x3249a6,JSON[_0x714b('0xf')](_0x4c004c));_0x3208c9(_0x4c004c);})['catch'](function(_0x5227ad){logger['error'](_0x714b('0x15'),_0x5227ad[_0x714b('0x12')],_0x3249a6);_0x2bf46e(_0x3ae588[_0x714b('0x10')](0x1f4,_0x5227ad['message']));});});};exports[_0x714b('0x1f')]=function(_0x53b0f9){var _0x39c633=this;return new Promise(function(_0x386308,_0x5ec9f0){return db[_0x714b('0x20')][_0x714b('0x21')]({'raw':_0x53b0f9[_0x714b('0x17')]?_0x53b0f9[_0x714b('0x17')][_0x714b('0x18')]===undefined?!![]:![]:!![],'where':_0x53b0f9['options']?_0x53b0f9[_0x714b('0x17')]['where']||null:null,'attributes':_0x53b0f9['options']?_0x53b0f9[_0x714b('0x17')]['attributes']||null:null,'include':_0x53b0f9[_0x714b('0x17')]?_0x53b0f9[_0x714b('0x17')][_0x714b('0x1d')]?_[_0x714b('0x1c')](_0x53b0f9[_0x714b('0x17')]['include'],function(_0x15c819){return{'model':db[_0x15c819[_0x714b('0x1e')]],'as':_0x15c819['as'],'attributes':_0x15c819[_0x714b('0x1a')],'include':_0x15c819[_0x714b('0x1d')]?_[_0x714b('0x1c')](_0x15c819['include'],function(_0x1a0b60){return{'model':db[_0x1a0b60[_0x714b('0x1e')]],'as':_0x1a0b60['as'],'attributes':_0x1a0b60[_0x714b('0x1a')],'include':_0x1a0b60[_0x714b('0x1d')]?_[_0x714b('0x1c')](_0x1a0b60[_0x714b('0x1d')],function(_0x36fa3b){return{'model':db[_0x36fa3b[_0x714b('0x1e')]],'as':_0x36fa3b['as'],'attributes':_0x36fa3b[_0x714b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47bd3c){logger['info']('ShowServicenowAccount',_0x53b0f9);logger[_0x714b('0xe')](_0x714b('0x1f'),_0x53b0f9,JSON[_0x714b('0xf')](_0x47bd3c));_0x386308(_0x47bd3c);})['catch'](function(_0x45976c){logger['error'](_0x714b('0x1f'),_0x45976c[_0x714b('0x12')],_0x53b0f9);_0x5ec9f0(_0x39c633[_0x714b('0x10')](0x1f4,_0x45976c[_0x714b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index deaf352..4be0fbe 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 _0x141c=['./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x141c,0xa1));var _0xc141=function(_0x28306f,_0x420f61){_0x28306f=_0x28306f-0x0;var _0x417cb4=_0x141c[_0x28306f];return _0x417cb4;};'use strict';var multer=require(_0xc141('0x0'));var util=require(_0xc141('0x1'));var path=require(_0xc141('0x2'));var timeout=require(_0xc141('0x3'));var express=require(_0xc141('0x4'));var router=express['Router']();var fs_extra=require(_0xc141('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc141('0x6'));var config=require('../../config/environment');var controller=require(_0xc141('0x7'));router['get']('/',auth[_0xc141('0x8')](),controller[_0xc141('0x9')]);router[_0xc141('0xa')](_0xc141('0xb'),auth[_0xc141('0x8')](),controller[_0xc141('0xc')]);router['get']('/:id/fields',auth[_0xc141('0x8')](),controller[_0xc141('0xd')]);router[_0xc141('0xa')]('/:id/subjects',auth[_0xc141('0x8')](),controller[_0xc141('0xe')]);router[_0xc141('0xa')](_0xc141('0xf'),auth['isAuthenticated'](),controller[_0xc141('0x10')]);router[_0xc141('0x11')]('/',auth['isAuthenticated'](),controller[_0xc141('0x12')]);router['put']('/:id',auth[_0xc141('0x8')](),controller['update']);router[_0xc141('0x13')](_0xc141('0xb'),auth['isAuthenticated'](),controller[_0xc141('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd996=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x28eb09,_0x56aa34){var _0x38ac82=function(_0x384bd2){while(--_0x384bd2){_0x28eb09['push'](_0x28eb09['shift']());}};_0x38ac82(++_0x56aa34);}(_0xd996,0x179));var _0x6d99=function(_0x468290,_0x1f1de7){_0x468290=_0x468290-0x0;var _0x16c3ae=_0xd996[_0x468290];return _0x16c3ae;};'use strict';var multer=require(_0x6d99('0x0'));var util=require(_0x6d99('0x1'));var path=require('path');var timeout=require(_0x6d99('0x2'));var express=require(_0x6d99('0x3'));var router=express[_0x6d99('0x4')]();var fs_extra=require(_0x6d99('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6d99('0x6'));var config=require(_0x6d99('0x7'));var controller=require(_0x6d99('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d99('0x9')]);router[_0x6d99('0xa')](_0x6d99('0xb'),auth[_0x6d99('0xc')](),controller['show']);router['get'](_0x6d99('0xd'),auth[_0x6d99('0xc')](),controller['getFields']);router[_0x6d99('0xa')](_0x6d99('0xe'),auth[_0x6d99('0xc')](),controller['getSubjects']);router['get'](_0x6d99('0xf'),auth[_0x6d99('0xc')](),controller[_0x6d99('0x10')]);router[_0x6d99('0x11')]('/',auth[_0x6d99('0xc')](),controller['create']);router[_0x6d99('0x12')](_0x6d99('0xb'),auth['isAuthenticated'](),controller[_0x6d99('0x13')]);router[_0x6d99('0x14')](_0x6d99('0xb'),auth[_0x6d99('0xc')](),controller[_0x6d99('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index be49a1f..3eef99b 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 _0x3d5c=['STRING','sequelize'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x3d5c,0x181));var _0xc3d5=function(_0x3bfe11,_0x573678){_0x3bfe11=_0x3bfe11-0x0;var _0x19f6b2=_0x3d5c[_0x3bfe11];return _0x19f6b2;};'use strict';var Sequelize=require(_0xc3d5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3d5('0x1')]},'description':{'type':Sequelize[_0xc3d5('0x1')]}}; \ No newline at end of file +var _0x73a7=['STRING','sequelize'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x73a7,0x1c7));var _0x773a=function(_0x15c97c,_0x3b0c64){_0x15c97c=_0x15c97c-0x0;var _0x3f869a=_0x73a7[_0x15c97c];return _0x3f869a;};'use strict';var Sequelize=require(_0x773a('0x0'));module['exports']={'name':{'type':Sequelize[_0x773a('0x1')]},'description':{'type':Sequelize[_0x773a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1551c88..129bc09 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 _0x6d0c=['include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','getFields','findOne','ServicenowField','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','ServicenowConfiguration','type','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6d0c,0xaf));var _0xc6d0=function(_0x4c5b52,_0x1a945a){_0x4c5b52=_0x4c5b52-0x0;var _0x24fce3=_0x6d0c[_0x4c5b52];return _0x24fce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6d0('0x0'));var zipdir=require(_0xc6d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6d0('0x2'));var moment=require('moment');var BPromise=require(_0xc6d0('0x3'));var Mustache=require(_0xc6d0('0x4'));var util=require(_0xc6d0('0x5'));var path=require(_0xc6d0('0x6'));var sox=require(_0xc6d0('0x7'));var csv=require(_0xc6d0('0x8'));var ejs=require(_0xc6d0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6d0('0xa'));var squel=require(_0xc6d0('0xb'));var crypto=require(_0xc6d0('0xc'));var jsforce=require(_0xc6d0('0xd'));var deskjs=require(_0xc6d0('0xe'));var toCsv=require(_0xc6d0('0x8'));var querystring=require(_0xc6d0('0xf'));var Papa=require('papaparse');var Redis=require(_0xc6d0('0x10'));var authService=require(_0xc6d0('0x11'));var qs=require(_0xc6d0('0x12'));var as=require(_0xc6d0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6d0('0x14'))(_0xc6d0('0x15'));var utils=require('../../config/utils');var config=require(_0xc6d0('0x16'));var licenseUtil=require(_0xc6d0('0x17'));var db=require(_0xc6d0('0x18'))['db'];function respondWithStatusCode(_0x570f61,_0x34c32f){_0x34c32f=_0x34c32f||0xcc;return function(_0x13270b){if(_0x13270b){return _0x570f61['sendStatus'](_0x34c32f);}return _0x570f61[_0xc6d0('0x19')](_0x34c32f)[_0xc6d0('0x1a')]();};}function respondWithResult(_0x5011c0,_0x2a1828){_0x2a1828=_0x2a1828||0xc8;return function(_0x147340){if(_0x147340){return _0x5011c0[_0xc6d0('0x19')](_0x2a1828)[_0xc6d0('0x1b')](_0x147340);}};}function respondWithFilteredResult(_0x4b6529,_0x3d2b55){return function(_0x5d3f92){if(_0x5d3f92){var _0x105108=typeof _0x3d2b55[_0xc6d0('0x1c')]===_0xc6d0('0x1d')&&typeof _0x3d2b55['limit']===_0xc6d0('0x1d');var _0x11c15d=_0x5d3f92[_0xc6d0('0x1e')];var _0x657a04=_0x105108?0x0:_0x3d2b55[_0xc6d0('0x1c')];var _0x615b78=_0x105108?_0x5d3f92[_0xc6d0('0x1e')]:_0x3d2b55[_0xc6d0('0x1c')]+_0x3d2b55[_0xc6d0('0x1f')];var _0x30714b;if(_0x615b78>=_0x11c15d){_0x615b78=_0x11c15d;_0x30714b=0xc8;}else{_0x30714b=0xce;}_0x4b6529['status'](_0x30714b);return _0x4b6529[_0xc6d0('0x20')](_0xc6d0('0x21'),_0x657a04+'-'+_0x615b78+'/'+_0x11c15d)[_0xc6d0('0x1b')](_0x5d3f92);}return null;};}function patchUpdates(_0x7b78d6){return function(_0x4c19c6){try{jsonpatch['apply'](_0x4c19c6,_0x7b78d6,!![]);}catch(_0x4679fb){return BPromise['reject'](_0x4679fb);}return _0x4c19c6['save']();};}function saveUpdates(_0x503993,_0x3cef0e){return function(_0x115abe){if(_0x115abe){return _0x115abe[_0xc6d0('0x22')](_0x503993)[_0xc6d0('0x23')](function(_0x169ba3){return _0x169ba3;});}return null;};}function removeEntity(_0x1dd5be,_0x46ec92){return function(_0x511219){if(_0x511219){return _0x511219[_0xc6d0('0x24')]()[_0xc6d0('0x23')](function(){_0x1dd5be[_0xc6d0('0x19')](0xcc)[_0xc6d0('0x1a')]();});}};}function handleEntityNotFound(_0x519ac5,_0x24159f){return function(_0x19da97){if(!_0x19da97){_0x519ac5[_0xc6d0('0x25')](0x194);}return _0x19da97;};}function handleError(_0x37f437,_0x4f38e7){_0x4f38e7=_0x4f38e7||0x1f4;return function(_0x211cbb){logger[_0xc6d0('0x26')](_0x211cbb['stack']);if(_0x211cbb['name']){delete _0x211cbb[_0xc6d0('0x27')];}_0x37f437[_0xc6d0('0x19')](_0x4f38e7)[_0xc6d0('0x28')](_0x211cbb);};}exports[_0xc6d0('0x29')]=function(_0x4db517,_0x464df7){var _0x870799={},_0x265601={},_0x46b1d2={'count':0x0,'rows':[]};var _0x4ba9b6=_[_0xc6d0('0x2a')](db[_0xc6d0('0x2b')]['rawAttributes'],function(_0x3c139e){return{'name':_0x3c139e['fieldName'],'type':_0x3c139e[_0xc6d0('0x2c')]['key']};});_0x265601[_0xc6d0('0x2d')]=_[_0xc6d0('0x2a')](_0x4ba9b6,_0xc6d0('0x27'));_0x265601[_0xc6d0('0x2e')]=_[_0xc6d0('0x2f')](_0x4db517[_0xc6d0('0x2e')]);_0x265601['filters']=_[_0xc6d0('0x30')](_0x265601[_0xc6d0('0x2d')],_0x265601[_0xc6d0('0x2e')]);_0x870799[_0xc6d0('0x31')]=_[_0xc6d0('0x30')](_0x265601['model'],qs[_0xc6d0('0x32')](_0x4db517[_0xc6d0('0x2e')][_0xc6d0('0x32')]));_0x870799[_0xc6d0('0x31')]=_0x870799['attributes']['length']?_0x870799[_0xc6d0('0x31')]:_0x265601[_0xc6d0('0x2d')];if(!_0x4db517[_0xc6d0('0x2e')]['hasOwnProperty']('nolimit')){_0x870799[_0xc6d0('0x1f')]=qs[_0xc6d0('0x1f')](_0x4db517[_0xc6d0('0x2e')][_0xc6d0('0x1f')]);_0x870799[_0xc6d0('0x1c')]=qs[_0xc6d0('0x1c')](_0x4db517['query'][_0xc6d0('0x1c')]);}_0x870799[_0xc6d0('0x33')]=qs[_0xc6d0('0x34')](_0x4db517[_0xc6d0('0x2e')][_0xc6d0('0x34')]);_0x870799[_0xc6d0('0x35')]=qs['filters'](_['pick'](_0x4db517[_0xc6d0('0x2e')],_0x265601[_0xc6d0('0x36')]),_0x4ba9b6);if(_0x4db517['query'][_0xc6d0('0x37')]){_0x870799['where']=_[_0xc6d0('0x38')](_0x870799[_0xc6d0('0x35')],{'$or':_[_0xc6d0('0x2a')](_0x4ba9b6,function(_0x549a1b){if(_0x549a1b[_0xc6d0('0x2c')]!==_0xc6d0('0x39')){var _0x1ca782={};_0x1ca782[_0x549a1b[_0xc6d0('0x27')]]={'$like':'%'+_0x4db517['query'][_0xc6d0('0x37')]+'%'};return _0x1ca782;}})});}_0x870799=_[_0xc6d0('0x38')]({},_0x870799,_0x4db517[_0xc6d0('0x3a')]);var _0x4f30d5={'where':_0x870799[_0xc6d0('0x35')]};return db[_0xc6d0('0x2b')][_0xc6d0('0x1e')](_0x4f30d5)[_0xc6d0('0x23')](function(_0x192b97){_0x46b1d2['count']=_0x192b97;if(_0x4db517[_0xc6d0('0x2e')]['includeAll']){_0x870799[_0xc6d0('0x3b')]=[{'all':!![]}];}return db[_0xc6d0('0x2b')]['findAll'](_0x870799);})[_0xc6d0('0x23')](function(_0x13677a){_0x46b1d2[_0xc6d0('0x3c')]=_0x13677a;return _0x46b1d2;})[_0xc6d0('0x23')](respondWithFilteredResult(_0x464df7,_0x870799))[_0xc6d0('0x3d')](handleError(_0x464df7,null));};exports[_0xc6d0('0x3e')]=function(_0x169393,_0x180db0){var _0x1b6152={'raw':![],'where':{'id':_0x169393[_0xc6d0('0x3f')]['id']}},_0x4e2206={};_0x4e2206[_0xc6d0('0x2d')]=_[_0xc6d0('0x2f')](db[_0xc6d0('0x2b')][_0xc6d0('0x40')]);_0x4e2206[_0xc6d0('0x2e')]=_[_0xc6d0('0x2f')](_0x169393[_0xc6d0('0x2e')]);_0x4e2206[_0xc6d0('0x36')]=_[_0xc6d0('0x30')](_0x4e2206[_0xc6d0('0x2d')],_0x4e2206[_0xc6d0('0x2e')]);_0x1b6152[_0xc6d0('0x31')]=_[_0xc6d0('0x30')](_0x4e2206[_0xc6d0('0x2d')],qs[_0xc6d0('0x32')](_0x169393['query'][_0xc6d0('0x32')]));_0x1b6152[_0xc6d0('0x31')]=_0x1b6152['attributes'][_0xc6d0('0x41')]?_0x1b6152[_0xc6d0('0x31')]:_0x4e2206[_0xc6d0('0x2d')];if(_0x169393['query'][_0xc6d0('0x42')]){_0x1b6152[_0xc6d0('0x3b')]=[{'all':!![]}];}_0x1b6152=_[_0xc6d0('0x38')]({},_0x1b6152,_0x169393[_0xc6d0('0x3a')]);return db[_0xc6d0('0x2b')][_0xc6d0('0x43')](_0x1b6152)[_0xc6d0('0x23')](handleEntityNotFound(_0x180db0,null))[_0xc6d0('0x23')](respondWithResult(_0x180db0,null))[_0xc6d0('0x3d')](handleError(_0x180db0,null));};exports[_0xc6d0('0x44')]=function(_0x57870c,_0x19c823){return db['ServicenowConfiguration'][_0xc6d0('0x44')](_0x57870c[_0xc6d0('0x45')],{})[_0xc6d0('0x23')](respondWithResult(_0x19c823,0xc9))[_0xc6d0('0x3d')](handleError(_0x19c823,null));};exports[_0xc6d0('0x22')]=function(_0x3daf88,_0x5140f8){if(_0x3daf88[_0xc6d0('0x45')]['id']){delete _0x3daf88[_0xc6d0('0x45')]['id'];}return db[_0xc6d0('0x2b')][_0xc6d0('0x43')]({'where':{'id':_0x3daf88[_0xc6d0('0x3f')]['id']}})[_0xc6d0('0x23')](handleEntityNotFound(_0x5140f8,null))['then'](saveUpdates(_0x3daf88[_0xc6d0('0x45')],null))[_0xc6d0('0x23')](respondWithResult(_0x5140f8,null))[_0xc6d0('0x3d')](handleError(_0x5140f8,null));};exports[_0xc6d0('0x24')]=function(_0x259f9d,_0x2eedbf){return db[_0xc6d0('0x2b')][_0xc6d0('0x43')]({'where':{'id':_0x259f9d[_0xc6d0('0x3f')]['id']}})[_0xc6d0('0x23')](handleEntityNotFound(_0x2eedbf,null))[_0xc6d0('0x23')](removeEntity(_0x2eedbf,null))[_0xc6d0('0x3d')](handleError(_0x2eedbf,null));};exports[_0xc6d0('0x46')]=function(_0x5583e4,_0x2a8cb3,_0x818599){var _0x162542={};var _0x2827dc={};var _0xd42603;var _0x266241;return db['ServicenowConfiguration'][_0xc6d0('0x47')]({'where':{'id':_0x5583e4[_0xc6d0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a8cb3,null))['then'](function(_0x4fe461){if(_0x4fe461){_0xd42603=_0x4fe461;_0x2827dc[_0xc6d0('0x2d')]=_[_0xc6d0('0x2f')](db[_0xc6d0('0x48')][_0xc6d0('0x40')]);_0x2827dc[_0xc6d0('0x2e')]=_[_0xc6d0('0x2f')](_0x5583e4[_0xc6d0('0x2e')]);_0x2827dc['filters']=_[_0xc6d0('0x30')](_0x2827dc[_0xc6d0('0x2d')],_0x2827dc[_0xc6d0('0x2e')]);_0x162542[_0xc6d0('0x31')]=_[_0xc6d0('0x30')](_0x2827dc[_0xc6d0('0x2d')],qs['fields'](_0x5583e4[_0xc6d0('0x2e')][_0xc6d0('0x32')]));_0x162542[_0xc6d0('0x31')]=_0x162542[_0xc6d0('0x31')][_0xc6d0('0x41')]?_0x162542[_0xc6d0('0x31')]:_0x2827dc[_0xc6d0('0x2d')];_0x162542['order']=qs['sort'](_0x5583e4[_0xc6d0('0x2e')]['sort']);_0x162542['where']=qs[_0xc6d0('0x36')](_[_0xc6d0('0x49')](_0x5583e4[_0xc6d0('0x2e')],_0x2827dc[_0xc6d0('0x36')]));if(_0x5583e4[_0xc6d0('0x2e')][_0xc6d0('0x37')]){_0x162542['where']=_[_0xc6d0('0x38')](_0x162542[_0xc6d0('0x35')],{'$or':_['map'](_0x162542[_0xc6d0('0x31')],function(_0x502832){var _0xade3d={};_0xade3d[_0x502832]={'$like':'%'+_0x5583e4[_0xc6d0('0x2e')][_0xc6d0('0x37')]+'%'};return _0xade3d;})});}_0x162542=_[_0xc6d0('0x38')]({},_0x162542,_0x5583e4['options']);return _0xd42603[_0xc6d0('0x46')](_0x162542);}})[_0xc6d0('0x23')](function(_0x5954c9){if(_0x5954c9){_0x266241=_0x5954c9[_0xc6d0('0x41')];if(!_0x5583e4[_0xc6d0('0x2e')][_0xc6d0('0x4a')](_0xc6d0('0x4b'))){_0x162542[_0xc6d0('0x1f')]=qs[_0xc6d0('0x1f')](_0x5583e4[_0xc6d0('0x2e')]['limit']);_0x162542[_0xc6d0('0x1c')]=qs['offset'](_0x5583e4[_0xc6d0('0x2e')][_0xc6d0('0x1c')]);}return _0xd42603['getFields'](_0x162542);}})[_0xc6d0('0x23')](function(_0x5285ac){if(_0x5285ac){return _0x5285ac?{'count':_0x266241,'rows':_0x5285ac}:null;}})[_0xc6d0('0x23')](respondWithResult(_0x2a8cb3,null))['catch'](handleError(_0x2a8cb3,null));};exports['getSubjects']=function(_0x4184bc,_0x303c5d,_0x3f3242){var _0x127ea7={};var _0x262b41={};var _0x3b5a50;var _0x559c49;return db[_0xc6d0('0x2b')][_0xc6d0('0x47')]({'where':{'id':_0x4184bc['params']['id']}})[_0xc6d0('0x23')](handleEntityNotFound(_0x303c5d,null))[_0xc6d0('0x23')](function(_0x1401e8){if(_0x1401e8){_0x3b5a50=_0x1401e8;_0x262b41[_0xc6d0('0x2d')]=_['keys'](db[_0xc6d0('0x48')][_0xc6d0('0x40')]);_0x262b41[_0xc6d0('0x2e')]=_[_0xc6d0('0x2f')](_0x4184bc[_0xc6d0('0x2e')]);_0x262b41['filters']=_['intersection'](_0x262b41[_0xc6d0('0x2d')],_0x262b41['query']);_0x127ea7[_0xc6d0('0x31')]=_[_0xc6d0('0x30')](_0x262b41[_0xc6d0('0x2d')],qs[_0xc6d0('0x32')](_0x4184bc['query'][_0xc6d0('0x32')]));_0x127ea7[_0xc6d0('0x31')]=_0x127ea7[_0xc6d0('0x31')][_0xc6d0('0x41')]?_0x127ea7[_0xc6d0('0x31')]:_0x262b41['model'];_0x127ea7[_0xc6d0('0x33')]=qs[_0xc6d0('0x34')](_0x4184bc[_0xc6d0('0x2e')][_0xc6d0('0x34')]);_0x127ea7[_0xc6d0('0x35')]=qs[_0xc6d0('0x36')](_[_0xc6d0('0x49')](_0x4184bc[_0xc6d0('0x2e')],_0x262b41['filters']));if(_0x4184bc[_0xc6d0('0x2e')][_0xc6d0('0x37')]){_0x127ea7[_0xc6d0('0x35')]=_[_0xc6d0('0x38')](_0x127ea7[_0xc6d0('0x35')],{'$or':_[_0xc6d0('0x2a')](_0x127ea7['attributes'],function(_0x5580ad){var _0x4dd7cf={};_0x4dd7cf[_0x5580ad]={'$like':'%'+_0x4184bc[_0xc6d0('0x2e')][_0xc6d0('0x37')]+'%'};return _0x4dd7cf;})});}_0x127ea7=_[_0xc6d0('0x38')]({},_0x127ea7,_0x4184bc[_0xc6d0('0x3a')]);return _0x3b5a50[_0xc6d0('0x4c')](_0x127ea7);}})[_0xc6d0('0x23')](function(_0x3d8d71){if(_0x3d8d71){_0x559c49=_0x3d8d71[_0xc6d0('0x41')];if(!_0x4184bc[_0xc6d0('0x2e')][_0xc6d0('0x4a')](_0xc6d0('0x4b'))){_0x127ea7['limit']=qs['limit'](_0x4184bc[_0xc6d0('0x2e')]['limit']);_0x127ea7['offset']=qs[_0xc6d0('0x1c')](_0x4184bc[_0xc6d0('0x2e')][_0xc6d0('0x1c')]);}return _0x3b5a50[_0xc6d0('0x4c')](_0x127ea7);}})['then'](function(_0x5d7514){if(_0x5d7514){return _0x5d7514?{'count':_0x559c49,'rows':_0x5d7514}:null;}})[_0xc6d0('0x23')](respondWithResult(_0x303c5d,null))['catch'](handleError(_0x303c5d,null));};exports['getDescriptions']=function(_0x1e6607,_0xee9c62,_0x32cf14){var _0x589b6d={};var _0x4672d1={};var _0x393504;var _0x9412a8;return db[_0xc6d0('0x2b')][_0xc6d0('0x47')]({'where':{'id':_0x1e6607[_0xc6d0('0x3f')]['id']}})[_0xc6d0('0x23')](handleEntityNotFound(_0xee9c62,null))[_0xc6d0('0x23')](function(_0x23328f){if(_0x23328f){_0x393504=_0x23328f;_0x4672d1[_0xc6d0('0x2d')]=_[_0xc6d0('0x2f')](db[_0xc6d0('0x48')][_0xc6d0('0x40')]);_0x4672d1[_0xc6d0('0x2e')]=_[_0xc6d0('0x2f')](_0x1e6607[_0xc6d0('0x2e')]);_0x4672d1[_0xc6d0('0x36')]=_[_0xc6d0('0x30')](_0x4672d1[_0xc6d0('0x2d')],_0x4672d1['query']);_0x589b6d[_0xc6d0('0x31')]=_[_0xc6d0('0x30')](_0x4672d1[_0xc6d0('0x2d')],qs['fields'](_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x32')]));_0x589b6d[_0xc6d0('0x31')]=_0x589b6d[_0xc6d0('0x31')][_0xc6d0('0x41')]?_0x589b6d[_0xc6d0('0x31')]:_0x4672d1[_0xc6d0('0x2d')];_0x589b6d[_0xc6d0('0x33')]=qs[_0xc6d0('0x34')](_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x34')]);_0x589b6d['where']=qs[_0xc6d0('0x36')](_[_0xc6d0('0x49')](_0x1e6607['query'],_0x4672d1[_0xc6d0('0x36')]));if(_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x37')]){_0x589b6d[_0xc6d0('0x35')]=_['merge'](_0x589b6d[_0xc6d0('0x35')],{'$or':_[_0xc6d0('0x2a')](_0x589b6d['attributes'],function(_0x100659){var _0x3bb228={};_0x3bb228[_0x100659]={'$like':'%'+_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x37')]+'%'};return _0x3bb228;})});}_0x589b6d=_['merge']({},_0x589b6d,_0x1e6607['options']);return _0x393504[_0xc6d0('0x4d')](_0x589b6d);}})[_0xc6d0('0x23')](function(_0xf0b2a2){if(_0xf0b2a2){_0x9412a8=_0xf0b2a2['length'];if(!_0x1e6607['query'][_0xc6d0('0x4a')]('nolimit')){_0x589b6d[_0xc6d0('0x1f')]=qs[_0xc6d0('0x1f')](_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x1f')]);_0x589b6d[_0xc6d0('0x1c')]=qs[_0xc6d0('0x1c')](_0x1e6607[_0xc6d0('0x2e')][_0xc6d0('0x1c')]);}return _0x393504[_0xc6d0('0x4d')](_0x589b6d);}})['then'](function(_0x4b399f){if(_0x4b399f){return _0x4b399f?{'count':_0x9412a8,'rows':_0x4b399f}:null;}})[_0xc6d0('0x23')](respondWithResult(_0xee9c62,null))[_0xc6d0('0x3d')](handleError(_0xee9c62,null));}; \ No newline at end of file +var _0xdd53=['path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','include','findAll','catch','show','params','keys','includeAll','options','create','body','find','getFields','findOne','ServicenowField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x31efbe,_0x2c349f){var _0x3b354d=function(_0x2ba335){while(--_0x2ba335){_0x31efbe['push'](_0x31efbe['shift']());}};_0x3b354d(++_0x2c349f);}(_0xdd53,0x191));var _0x3dd5=function(_0x565115,_0x150f18){_0x565115=_0x565115-0x0;var _0x9a37c0=_0xdd53[_0x565115];return _0x9a37c0;};'use strict';var emlformat=require(_0x3dd5('0x0'));var rimraf=require(_0x3dd5('0x1'));var zipdir=require(_0x3dd5('0x2'));var jsonpatch=require(_0x3dd5('0x3'));var rp=require(_0x3dd5('0x4'));var moment=require(_0x3dd5('0x5'));var BPromise=require(_0x3dd5('0x6'));var Mustache=require(_0x3dd5('0x7'));var util=require(_0x3dd5('0x8'));var path=require(_0x3dd5('0x9'));var sox=require(_0x3dd5('0xa'));var csv=require('to-csv');var ejs=require(_0x3dd5('0xb'));var fs=require('fs');var fs_extra=require(_0x3dd5('0xc'));var _=require('lodash');var squel=require(_0x3dd5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3dd5('0xe'));var toCsv=require(_0x3dd5('0xf'));var querystring=require('querystring');var Papa=require(_0x3dd5('0x10'));var Redis=require('ioredis');var authService=require(_0x3dd5('0x11'));var qs=require(_0x3dd5('0x12'));var as=require(_0x3dd5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dd5('0x14'))(_0x3dd5('0x15'));var utils=require(_0x3dd5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dd5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd636b,_0x51d816){_0x51d816=_0x51d816||0xcc;return function(_0x396382){if(_0x396382){return _0xcd636b[_0x3dd5('0x18')](_0x51d816);}return _0xcd636b[_0x3dd5('0x19')](_0x51d816)[_0x3dd5('0x1a')]();};}function respondWithResult(_0x4c321b,_0x453165){_0x453165=_0x453165||0xc8;return function(_0x2e90b7){if(_0x2e90b7){return _0x4c321b[_0x3dd5('0x19')](_0x453165)[_0x3dd5('0x1b')](_0x2e90b7);}};}function respondWithFilteredResult(_0x62765a,_0x3d1838){return function(_0x2cbe65){if(_0x2cbe65){var _0x2d00b9=typeof _0x3d1838['offset']==='undefined'&&typeof _0x3d1838[_0x3dd5('0x1c')]==='undefined';var _0x528d6d=_0x2cbe65[_0x3dd5('0x1d')];var _0x2e4473=_0x2d00b9?0x0:_0x3d1838['offset'];var _0x190b49=_0x2d00b9?_0x2cbe65[_0x3dd5('0x1d')]:_0x3d1838[_0x3dd5('0x1e')]+_0x3d1838['limit'];var _0x4f7634;if(_0x190b49>=_0x528d6d){_0x190b49=_0x528d6d;_0x4f7634=0xc8;}else{_0x4f7634=0xce;}_0x62765a['status'](_0x4f7634);return _0x62765a[_0x3dd5('0x1f')](_0x3dd5('0x20'),_0x2e4473+'-'+_0x190b49+'/'+_0x528d6d)[_0x3dd5('0x1b')](_0x2cbe65);}return null;};}function patchUpdates(_0x5c59a5){return function(_0x3702a1){try{jsonpatch[_0x3dd5('0x21')](_0x3702a1,_0x5c59a5,!![]);}catch(_0x558ff2){return BPromise[_0x3dd5('0x22')](_0x558ff2);}return _0x3702a1[_0x3dd5('0x23')]();};}function saveUpdates(_0x34e5ba,_0x1d086e){return function(_0x4fb458){if(_0x4fb458){return _0x4fb458[_0x3dd5('0x24')](_0x34e5ba)['then'](function(_0xf48e11){return _0xf48e11;});}return null;};}function removeEntity(_0x4404fa,_0xdbf4dc){return function(_0x1674e1){if(_0x1674e1){return _0x1674e1[_0x3dd5('0x25')]()[_0x3dd5('0x26')](function(){_0x4404fa[_0x3dd5('0x19')](0xcc)[_0x3dd5('0x1a')]();});}};}function handleEntityNotFound(_0x156acf,_0x652972){return function(_0x437c77){if(!_0x437c77){_0x156acf['sendStatus'](0x194);}return _0x437c77;};}function handleError(_0x55ce6c,_0x2f9f66){_0x2f9f66=_0x2f9f66||0x1f4;return function(_0x58bb01){logger[_0x3dd5('0x27')](_0x58bb01[_0x3dd5('0x28')]);if(_0x58bb01['name']){delete _0x58bb01[_0x3dd5('0x29')];}_0x55ce6c['status'](_0x2f9f66)[_0x3dd5('0x2a')](_0x58bb01);};}exports[_0x3dd5('0x2b')]=function(_0x42aec2,_0x2a89cb){var _0x51494f={},_0x7b5215={},_0x50618d={'count':0x0,'rows':[]};var _0x5d4f60=_[_0x3dd5('0x2c')](db[_0x3dd5('0x2d')]['rawAttributes'],function(_0x5e57a9){return{'name':_0x5e57a9[_0x3dd5('0x2e')],'type':_0x5e57a9['type'][_0x3dd5('0x2f')]};});_0x7b5215[_0x3dd5('0x30')]=_['map'](_0x5d4f60,_0x3dd5('0x29'));_0x7b5215[_0x3dd5('0x31')]=_['keys'](_0x42aec2[_0x3dd5('0x31')]);_0x7b5215['filters']=_[_0x3dd5('0x32')](_0x7b5215[_0x3dd5('0x30')],_0x7b5215['query']);_0x51494f[_0x3dd5('0x33')]=_['intersection'](_0x7b5215[_0x3dd5('0x30')],qs['fields'](_0x42aec2['query'][_0x3dd5('0x34')]));_0x51494f[_0x3dd5('0x33')]=_0x51494f[_0x3dd5('0x33')][_0x3dd5('0x35')]?_0x51494f[_0x3dd5('0x33')]:_0x7b5215['model'];if(!_0x42aec2['query'][_0x3dd5('0x36')](_0x3dd5('0x37'))){_0x51494f[_0x3dd5('0x1c')]=qs[_0x3dd5('0x1c')](_0x42aec2['query'][_0x3dd5('0x1c')]);_0x51494f[_0x3dd5('0x1e')]=qs[_0x3dd5('0x1e')](_0x42aec2[_0x3dd5('0x31')][_0x3dd5('0x1e')]);}_0x51494f[_0x3dd5('0x38')]=qs['sort'](_0x42aec2[_0x3dd5('0x31')][_0x3dd5('0x39')]);_0x51494f['where']=qs[_0x3dd5('0x3a')](_[_0x3dd5('0x3b')](_0x42aec2[_0x3dd5('0x31')],_0x7b5215[_0x3dd5('0x3a')]),_0x5d4f60);if(_0x42aec2[_0x3dd5('0x31')]['filter']){_0x51494f[_0x3dd5('0x3c')]=_[_0x3dd5('0x3d')](_0x51494f[_0x3dd5('0x3c')],{'$or':_[_0x3dd5('0x2c')](_0x5d4f60,function(_0x464c6f){if(_0x464c6f[_0x3dd5('0x3e')]!==_0x3dd5('0x3f')){var _0x1aa3bb={};_0x1aa3bb[_0x464c6f[_0x3dd5('0x29')]]={'$like':'%'+_0x42aec2[_0x3dd5('0x31')][_0x3dd5('0x40')]+'%'};return _0x1aa3bb;}})});}_0x51494f=_[_0x3dd5('0x3d')]({},_0x51494f,_0x42aec2['options']);var _0x1eca85={'where':_0x51494f[_0x3dd5('0x3c')]};return db[_0x3dd5('0x2d')][_0x3dd5('0x1d')](_0x1eca85)[_0x3dd5('0x26')](function(_0x45c5b0){_0x50618d[_0x3dd5('0x1d')]=_0x45c5b0;if(_0x42aec2[_0x3dd5('0x31')]['includeAll']){_0x51494f[_0x3dd5('0x41')]=[{'all':!![]}];}return db[_0x3dd5('0x2d')][_0x3dd5('0x42')](_0x51494f);})['then'](function(_0x1444b4){_0x50618d['rows']=_0x1444b4;return _0x50618d;})['then'](respondWithFilteredResult(_0x2a89cb,_0x51494f))[_0x3dd5('0x43')](handleError(_0x2a89cb,null));};exports[_0x3dd5('0x44')]=function(_0x1fedae,_0x191b4c){var _0xaf8667={'raw':![],'where':{'id':_0x1fedae[_0x3dd5('0x45')]['id']}},_0x597514={};_0x597514[_0x3dd5('0x30')]=_[_0x3dd5('0x46')](db[_0x3dd5('0x2d')]['rawAttributes']);_0x597514['query']=_[_0x3dd5('0x46')](_0x1fedae[_0x3dd5('0x31')]);_0x597514[_0x3dd5('0x3a')]=_[_0x3dd5('0x32')](_0x597514[_0x3dd5('0x30')],_0x597514['query']);_0xaf8667[_0x3dd5('0x33')]=_['intersection'](_0x597514[_0x3dd5('0x30')],qs['fields'](_0x1fedae[_0x3dd5('0x31')][_0x3dd5('0x34')]));_0xaf8667[_0x3dd5('0x33')]=_0xaf8667[_0x3dd5('0x33')]['length']?_0xaf8667[_0x3dd5('0x33')]:_0x597514[_0x3dd5('0x30')];if(_0x1fedae[_0x3dd5('0x31')][_0x3dd5('0x47')]){_0xaf8667[_0x3dd5('0x41')]=[{'all':!![]}];}_0xaf8667=_[_0x3dd5('0x3d')]({},_0xaf8667,_0x1fedae[_0x3dd5('0x48')]);return db[_0x3dd5('0x2d')]['find'](_0xaf8667)[_0x3dd5('0x26')](handleEntityNotFound(_0x191b4c,null))[_0x3dd5('0x26')](respondWithResult(_0x191b4c,null))[_0x3dd5('0x43')](handleError(_0x191b4c,null));};exports[_0x3dd5('0x49')]=function(_0x1e81f6,_0x4e7e98){return db[_0x3dd5('0x2d')][_0x3dd5('0x49')](_0x1e81f6[_0x3dd5('0x4a')],{})[_0x3dd5('0x26')](respondWithResult(_0x4e7e98,0xc9))['catch'](handleError(_0x4e7e98,null));};exports[_0x3dd5('0x24')]=function(_0x1b10b2,_0x23588a){if(_0x1b10b2[_0x3dd5('0x4a')]['id']){delete _0x1b10b2[_0x3dd5('0x4a')]['id'];}return db[_0x3dd5('0x2d')][_0x3dd5('0x4b')]({'where':{'id':_0x1b10b2[_0x3dd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x23588a,null))[_0x3dd5('0x26')](saveUpdates(_0x1b10b2[_0x3dd5('0x4a')],null))[_0x3dd5('0x26')](respondWithResult(_0x23588a,null))[_0x3dd5('0x43')](handleError(_0x23588a,null));};exports[_0x3dd5('0x25')]=function(_0x56a726,_0x359a34){return db['ServicenowConfiguration'][_0x3dd5('0x4b')]({'where':{'id':_0x56a726[_0x3dd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x359a34,null))[_0x3dd5('0x26')](removeEntity(_0x359a34,null))[_0x3dd5('0x43')](handleError(_0x359a34,null));};exports[_0x3dd5('0x4c')]=function(_0x3053e4,_0x11b74b,_0x5e46b0){var _0x4f973a={};var _0x1791f8={};var _0x14066f;var _0xb9ba10;return db[_0x3dd5('0x2d')][_0x3dd5('0x4d')]({'where':{'id':_0x3053e4[_0x3dd5('0x45')]['id']}})[_0x3dd5('0x26')](handleEntityNotFound(_0x11b74b,null))['then'](function(_0x4f060a){if(_0x4f060a){_0x14066f=_0x4f060a;_0x1791f8['model']=_[_0x3dd5('0x46')](db[_0x3dd5('0x4e')][_0x3dd5('0x4f')]);_0x1791f8['query']=_[_0x3dd5('0x46')](_0x3053e4[_0x3dd5('0x31')]);_0x1791f8['filters']=_['intersection'](_0x1791f8[_0x3dd5('0x30')],_0x1791f8['query']);_0x4f973a[_0x3dd5('0x33')]=_[_0x3dd5('0x32')](_0x1791f8['model'],qs[_0x3dd5('0x34')](_0x3053e4[_0x3dd5('0x31')][_0x3dd5('0x34')]));_0x4f973a['attributes']=_0x4f973a[_0x3dd5('0x33')][_0x3dd5('0x35')]?_0x4f973a[_0x3dd5('0x33')]:_0x1791f8[_0x3dd5('0x30')];_0x4f973a[_0x3dd5('0x38')]=qs[_0x3dd5('0x39')](_0x3053e4[_0x3dd5('0x31')]['sort']);_0x4f973a[_0x3dd5('0x3c')]=qs[_0x3dd5('0x3a')](_[_0x3dd5('0x3b')](_0x3053e4[_0x3dd5('0x31')],_0x1791f8[_0x3dd5('0x3a')]));if(_0x3053e4[_0x3dd5('0x31')]['filter']){_0x4f973a['where']=_[_0x3dd5('0x3d')](_0x4f973a[_0x3dd5('0x3c')],{'$or':_[_0x3dd5('0x2c')](_0x4f973a[_0x3dd5('0x33')],function(_0x41ec98){var _0x424c23={};_0x424c23[_0x41ec98]={'$like':'%'+_0x3053e4['query'][_0x3dd5('0x40')]+'%'};return _0x424c23;})});}_0x4f973a=_[_0x3dd5('0x3d')]({},_0x4f973a,_0x3053e4[_0x3dd5('0x48')]);return _0x14066f[_0x3dd5('0x4c')](_0x4f973a);}})[_0x3dd5('0x26')](function(_0x2e91f8){if(_0x2e91f8){_0xb9ba10=_0x2e91f8[_0x3dd5('0x35')];if(!_0x3053e4[_0x3dd5('0x31')][_0x3dd5('0x36')](_0x3dd5('0x37'))){_0x4f973a['limit']=qs[_0x3dd5('0x1c')](_0x3053e4['query']['limit']);_0x4f973a[_0x3dd5('0x1e')]=qs[_0x3dd5('0x1e')](_0x3053e4[_0x3dd5('0x31')]['offset']);}return _0x14066f[_0x3dd5('0x4c')](_0x4f973a);}})[_0x3dd5('0x26')](function(_0x5e2ca0){if(_0x5e2ca0){return _0x5e2ca0?{'count':_0xb9ba10,'rows':_0x5e2ca0}:null;}})[_0x3dd5('0x26')](respondWithResult(_0x11b74b,null))[_0x3dd5('0x43')](handleError(_0x11b74b,null));};exports[_0x3dd5('0x50')]=function(_0x1de001,_0x48dfeb,_0x556fcb){var _0xd58547={};var _0x252edc={};var _0x2560e9;var _0x2b48c3;return db['ServicenowConfiguration'][_0x3dd5('0x4d')]({'where':{'id':_0x1de001[_0x3dd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x48dfeb,null))[_0x3dd5('0x26')](function(_0x2c9b18){if(_0x2c9b18){_0x2560e9=_0x2c9b18;_0x252edc[_0x3dd5('0x30')]=_['keys'](db['ServicenowField'][_0x3dd5('0x4f')]);_0x252edc[_0x3dd5('0x31')]=_[_0x3dd5('0x46')](_0x1de001['query']);_0x252edc[_0x3dd5('0x3a')]=_[_0x3dd5('0x32')](_0x252edc[_0x3dd5('0x30')],_0x252edc[_0x3dd5('0x31')]);_0xd58547[_0x3dd5('0x33')]=_[_0x3dd5('0x32')](_0x252edc[_0x3dd5('0x30')],qs[_0x3dd5('0x34')](_0x1de001[_0x3dd5('0x31')][_0x3dd5('0x34')]));_0xd58547[_0x3dd5('0x33')]=_0xd58547[_0x3dd5('0x33')][_0x3dd5('0x35')]?_0xd58547[_0x3dd5('0x33')]:_0x252edc[_0x3dd5('0x30')];_0xd58547[_0x3dd5('0x38')]=qs['sort'](_0x1de001[_0x3dd5('0x31')]['sort']);_0xd58547[_0x3dd5('0x3c')]=qs[_0x3dd5('0x3a')](_[_0x3dd5('0x3b')](_0x1de001['query'],_0x252edc[_0x3dd5('0x3a')]));if(_0x1de001[_0x3dd5('0x31')][_0x3dd5('0x40')]){_0xd58547[_0x3dd5('0x3c')]=_[_0x3dd5('0x3d')](_0xd58547['where'],{'$or':_[_0x3dd5('0x2c')](_0xd58547[_0x3dd5('0x33')],function(_0x21fa59){var _0x1a1f06={};_0x1a1f06[_0x21fa59]={'$like':'%'+_0x1de001[_0x3dd5('0x31')]['filter']+'%'};return _0x1a1f06;})});}_0xd58547=_[_0x3dd5('0x3d')]({},_0xd58547,_0x1de001[_0x3dd5('0x48')]);return _0x2560e9['getSubjects'](_0xd58547);}})[_0x3dd5('0x26')](function(_0x272176){if(_0x272176){_0x2b48c3=_0x272176['length'];if(!_0x1de001[_0x3dd5('0x31')][_0x3dd5('0x36')](_0x3dd5('0x37'))){_0xd58547[_0x3dd5('0x1c')]=qs[_0x3dd5('0x1c')](_0x1de001[_0x3dd5('0x31')][_0x3dd5('0x1c')]);_0xd58547[_0x3dd5('0x1e')]=qs['offset'](_0x1de001['query'][_0x3dd5('0x1e')]);}return _0x2560e9['getSubjects'](_0xd58547);}})[_0x3dd5('0x26')](function(_0x217f2e){if(_0x217f2e){return _0x217f2e?{'count':_0x2b48c3,'rows':_0x217f2e}:null;}})['then'](respondWithResult(_0x48dfeb,null))[_0x3dd5('0x43')](handleError(_0x48dfeb,null));};exports[_0x3dd5('0x51')]=function(_0x5ddbf5,_0x367061,_0x206998){var _0x55b9e2={};var _0x495509={};var _0x3075de;var _0x42d344;return db[_0x3dd5('0x2d')][_0x3dd5('0x4d')]({'where':{'id':_0x5ddbf5[_0x3dd5('0x45')]['id']}})[_0x3dd5('0x26')](handleEntityNotFound(_0x367061,null))[_0x3dd5('0x26')](function(_0xe6f7ef){if(_0xe6f7ef){_0x3075de=_0xe6f7ef;_0x495509[_0x3dd5('0x30')]=_[_0x3dd5('0x46')](db[_0x3dd5('0x4e')]['rawAttributes']);_0x495509[_0x3dd5('0x31')]=_[_0x3dd5('0x46')](_0x5ddbf5['query']);_0x495509[_0x3dd5('0x3a')]=_['intersection'](_0x495509[_0x3dd5('0x30')],_0x495509[_0x3dd5('0x31')]);_0x55b9e2[_0x3dd5('0x33')]=_[_0x3dd5('0x32')](_0x495509[_0x3dd5('0x30')],qs[_0x3dd5('0x34')](_0x5ddbf5[_0x3dd5('0x31')][_0x3dd5('0x34')]));_0x55b9e2[_0x3dd5('0x33')]=_0x55b9e2[_0x3dd5('0x33')][_0x3dd5('0x35')]?_0x55b9e2[_0x3dd5('0x33')]:_0x495509[_0x3dd5('0x30')];_0x55b9e2[_0x3dd5('0x38')]=qs[_0x3dd5('0x39')](_0x5ddbf5[_0x3dd5('0x31')][_0x3dd5('0x39')]);_0x55b9e2[_0x3dd5('0x3c')]=qs[_0x3dd5('0x3a')](_[_0x3dd5('0x3b')](_0x5ddbf5['query'],_0x495509[_0x3dd5('0x3a')]));if(_0x5ddbf5['query'][_0x3dd5('0x40')]){_0x55b9e2[_0x3dd5('0x3c')]=_[_0x3dd5('0x3d')](_0x55b9e2[_0x3dd5('0x3c')],{'$or':_[_0x3dd5('0x2c')](_0x55b9e2[_0x3dd5('0x33')],function(_0xdd7240){var _0x12324d={};_0x12324d[_0xdd7240]={'$like':'%'+_0x5ddbf5[_0x3dd5('0x31')][_0x3dd5('0x40')]+'%'};return _0x12324d;})});}_0x55b9e2=_[_0x3dd5('0x3d')]({},_0x55b9e2,_0x5ddbf5[_0x3dd5('0x48')]);return _0x3075de['getDescriptions'](_0x55b9e2);}})['then'](function(_0x1d3c0c){if(_0x1d3c0c){_0x42d344=_0x1d3c0c[_0x3dd5('0x35')];if(!_0x5ddbf5[_0x3dd5('0x31')][_0x3dd5('0x36')](_0x3dd5('0x37'))){_0x55b9e2[_0x3dd5('0x1c')]=qs[_0x3dd5('0x1c')](_0x5ddbf5['query'][_0x3dd5('0x1c')]);_0x55b9e2[_0x3dd5('0x1e')]=qs[_0x3dd5('0x1e')](_0x5ddbf5['query'][_0x3dd5('0x1e')]);}return _0x3075de['getDescriptions'](_0x55b9e2);}})[_0x3dd5('0x26')](function(_0x3554d6){if(_0x3554d6){return _0x3554d6?{'count':_0x42d344,'rows':_0x3554d6}:null;}})[_0x3dd5('0x26')](respondWithResult(_0x367061,null))[_0x3dd5('0x43')](handleError(_0x367061,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 5878df7..e805676 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 _0x3014=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3014,0x1d7));var _0x4301=function(_0x728138,_0x3d75cc){_0x728138=_0x728138-0x0;var _0x33c6ee=_0x3014[_0x728138];return _0x33c6ee;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var logger=require('../../config/logger')(_0x4301('0x2'));var moment=require(_0x4301('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4301('0x4'));var rimraf=require(_0x4301('0x5'));var config=require(_0x4301('0x6'));var attributes=require(_0x4301('0x7'));module[_0x4301('0x8')]=function(_0x42ced6,_0x42ac4b){return _0x42ced6[_0x4301('0x9')](_0x4301('0xa'),attributes,{'tableName':_0x4301('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cbc=['../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3a5f9c,_0x257a66){var _0x4290de=function(_0x29aa52){while(--_0x29aa52){_0x3a5f9c['push'](_0x3a5f9c['shift']());}};_0x4290de(++_0x257a66);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x7ad661,_0x1e4efa){_0x7ad661=_0x7ad661-0x0;var _0x363e14=_0x1cbc[_0x7ad661];return _0x363e14;};'use strict';var _=require(_0xc1cb('0x0'));var util=require('util');var logger=require(_0xc1cb('0x1'))(_0xc1cb('0x2'));var moment=require(_0xc1cb('0x3'));var BPromise=require(_0xc1cb('0x4'));var rp=require(_0xc1cb('0x5'));var fs=require('fs');var path=require(_0xc1cb('0x6'));var rimraf=require(_0xc1cb('0x7'));var config=require(_0xc1cb('0x8'));var attributes=require(_0xc1cb('0x9'));module[_0xc1cb('0xa')]=function(_0x1dacec,_0x27423b){return _0x1dacec['define'](_0xc1cb('0xb'),attributes,{'tableName':'int_servicenow_configurations','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 4f2fdc9..0d3dc0d 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 _0xcd91=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xcd91,0x8a));var _0x1cd9=function(_0x26b2e9,_0x32ace7){_0x26b2e9=_0x26b2e9-0x0;var _0x503593=_0xcd91[_0x26b2e9];return _0x503593;};'use strict';var _=require(_0x1cd9('0x0'));var util=require(_0x1cd9('0x1'));var moment=require('moment');var BPromise=require(_0x1cd9('0x2'));var rs=require(_0x1cd9('0x3'));var fs=require('fs');var Redis=require(_0x1cd9('0x4'));var db=require(_0x1cd9('0x5'))['db'];var utils=require(_0x1cd9('0x6'));var logger=require(_0x1cd9('0x7'))(_0x1cd9('0x8'));var config=require(_0x1cd9('0x9'));var jayson=require(_0x1cd9('0xa'));var client=jayson[_0x1cd9('0xb')][_0x1cd9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x249513,_0x1e0b64,_0x50b60f){return new BPromise(function(_0x3f617b,_0x3881c8){return client['request'](_0x249513,_0x50b60f)[_0x1cd9('0xd')](function(_0x47e147){logger[_0x1cd9('0xe')](_0x1cd9('0xf'),_0x1e0b64,_0x1cd9('0x10'));logger['debug'](_0x1cd9('0x11'),_0x1e0b64,_0x1cd9('0x10'),JSON[_0x1cd9('0x12')](_0x47e147));if(_0x47e147[_0x1cd9('0x13')]){if(_0x47e147[_0x1cd9('0x13')][_0x1cd9('0x14')]===0x1f4){logger[_0x1cd9('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1e0b64,_0x47e147[_0x1cd9('0x13')][_0x1cd9('0x15')]);return _0x3881c8(_0x47e147[_0x1cd9('0x13')][_0x1cd9('0x15')]);}logger[_0x1cd9('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1e0b64,_0x47e147[_0x1cd9('0x13')][_0x1cd9('0x15')]);return _0x3f617b(_0x47e147[_0x1cd9('0x13')]['message']);}else{logger['info'](_0x1cd9('0xf'),_0x1e0b64,'request\x20sent');_0x3f617b(_0x47e147[_0x1cd9('0x16')][_0x1cd9('0x15')]);}})['catch'](function(_0x3a7a86){logger['error'](_0x1cd9('0xf'),_0x1e0b64,_0x3a7a86);_0x3881c8(_0x3a7a86);});});} \ No newline at end of file +var _0x788e=['ioredis','../../config/utils','../../config/logger','../../config/environment','http','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x788e,0x12e));var _0xe788=function(_0x2b47cd,_0x5ddb7d){_0x2b47cd=_0x2b47cd-0x0;var _0x64714f=_0x788e[_0x2b47cd];return _0x64714f;};'use strict';var _=require('lodash');var util=require(_0xe788('0x0'));var moment=require(_0xe788('0x1'));var BPromise=require(_0xe788('0x2'));var rs=require(_0xe788('0x3'));var fs=require('fs');var Redis=require(_0xe788('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe788('0x5'));var logger=require(_0xe788('0x6'))('rpc');var config=require(_0xe788('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe788('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5427f8,_0x4a64de,_0x2ebb4e){return new BPromise(function(_0x207656,_0x11bd2d){return client['request'](_0x5427f8,_0x2ebb4e)['then'](function(_0xf7ab45){logger['info'](_0xe788('0x9'),_0x4a64de,_0xe788('0xa'));logger['debug'](_0xe788('0xb'),_0x4a64de,'request\x20sent',JSON[_0xe788('0xc')](_0xf7ab45));if(_0xf7ab45[_0xe788('0xd')]){if(_0xf7ab45['error'][_0xe788('0xe')]===0x1f4){logger[_0xe788('0xd')](_0xe788('0x9'),_0x4a64de,_0xf7ab45[_0xe788('0xd')][_0xe788('0xf')]);return _0x11bd2d(_0xf7ab45[_0xe788('0xd')][_0xe788('0xf')]);}logger[_0xe788('0xd')](_0xe788('0x9'),_0x4a64de,_0xf7ab45['error'][_0xe788('0xf')]);return _0x207656(_0xf7ab45['error'][_0xe788('0xf')]);}else{logger[_0xe788('0x10')](_0xe788('0x9'),_0x4a64de,_0xe788('0xa'));_0x207656(_0xf7ab45['result']['message']);}})['catch'](function(_0x2df4d4){logger[_0xe788('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4a64de,_0x2df4d4);_0x11bd2d(_0x2df4d4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 200c16d..4d4a70a 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 _0xc650=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2dc2b1,_0x95b8be){var _0x4054d7=function(_0x5b65a3){while(--_0x5b65a3){_0x2dc2b1['push'](_0x2dc2b1['shift']());}};_0x4054d7(++_0x95b8be);}(_0xc650,0xcc));var _0x0c65=function(_0x1ca309,_0x478da0){_0x1ca309=_0x1ca309-0x0;var _0x74c872=_0xc650[_0x1ca309];return _0x74c872;};'use strict';var multer=require(_0x0c65('0x0'));var util=require(_0x0c65('0x1'));var path=require(_0x0c65('0x2'));var timeout=require(_0x0c65('0x3'));var express=require(_0x0c65('0x4'));var router=express[_0x0c65('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0c65('0x6'));var interaction=require(_0x0c65('0x7'));var config=require(_0x0c65('0x8'));var controller=require(_0x0c65('0x9'));router[_0x0c65('0xa')]('/',auth[_0x0c65('0xb')](),controller[_0x0c65('0xc')]);router[_0x0c65('0xa')](_0x0c65('0xd'),auth[_0x0c65('0xb')](),controller[_0x0c65('0xe')]);router[_0x0c65('0xf')]('/',auth[_0x0c65('0xb')](),controller[_0x0c65('0x10')]);router[_0x0c65('0x11')](_0x0c65('0xd'),auth['isAuthenticated'](),controller[_0x0c65('0x12')]);router[_0x0c65('0x13')]('/:id',auth[_0x0c65('0xb')](),controller[_0x0c65('0x14')]);module[_0x0c65('0x15')]=router; \ No newline at end of file +var _0x6556=['get','index','show','isAuthenticated','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0xb0ba5a,_0xa4a85f){var _0x211d11=function(_0x12571c){while(--_0x12571c){_0xb0ba5a['push'](_0xb0ba5a['shift']());}};_0x211d11(++_0xa4a85f);}(_0x6556,0x95));var _0x6655=function(_0x5a3cf7,_0x59b0b3){_0x5a3cf7=_0x5a3cf7-0x0;var _0x42987a=_0x6556[_0x5a3cf7];return _0x42987a;};'use strict';var multer=require(_0x6655('0x0'));var util=require(_0x6655('0x1'));var path=require(_0x6655('0x2'));var timeout=require(_0x6655('0x3'));var express=require(_0x6655('0x4'));var router=express[_0x6655('0x5')]();var fs_extra=require(_0x6655('0x6'));var auth=require(_0x6655('0x7'));var interaction=require(_0x6655('0x8'));var config=require(_0x6655('0x9'));var controller=require(_0x6655('0xa'));router[_0x6655('0xb')]('/',auth['isAuthenticated'](),controller[_0x6655('0xc')]);router[_0x6655('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6655('0xd')]);router['post']('/',auth[_0x6655('0xe')](),controller['create']);router[_0x6655('0xf')]('/:id',auth[_0x6655('0xe')](),controller['update']);router[_0x6655('0x10')](_0x6655('0x11'),auth[_0x6655('0xe')](),controller[_0x6655('0x12')]);module[_0x6655('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 05d3244..1ba9ea9 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 _0xb98e=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x121210,_0x3f9353){var _0x4d5000=function(_0x1f2257){while(--_0x1f2257){_0x121210['push'](_0x121210['shift']());}};_0x4d5000(++_0x3f9353);}(_0xb98e,0x197));var _0xeb98=function(_0x57c539,_0xf84f50){_0x57c539=_0x57c539-0x0;var _0x2b76d3=_0xb98e[_0x57c539];return _0x2b76d3;};'use strict';var Sequelize=require(_0xeb98('0x0'));module[_0xeb98('0x1')]={'type':{'type':Sequelize[_0xeb98('0x2')](_0xeb98('0x3'),_0xeb98('0x4'),_0xeb98('0x5'),_0xeb98('0x6'),_0xeb98('0x7')),'defaultValue':_0xeb98('0x3')},'content':{'type':Sequelize[_0xeb98('0x8')]},'key':{'type':Sequelize[_0xeb98('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xeb98('0x3'),_0xeb98('0x4'),_0xeb98('0x5'))},'keyContent':{'type':Sequelize[_0xeb98('0x8')]},'idField':{'type':Sequelize[_0xeb98('0x8')]},'nameField':{'type':Sequelize[_0xeb98('0x8')]},'customField':{'type':Sequelize[_0xeb98('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb98('0x8')]}}; \ No newline at end of file +var _0x11e8=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x533e5f,_0x527739){var _0x3aad76=function(_0x2a236f){while(--_0x2a236f){_0x533e5f['push'](_0x533e5f['shift']());}};_0x3aad76(++_0x527739);}(_0x11e8,0x1ec));var _0x811e=function(_0x5b97bc,_0x25dbef){_0x5b97bc=_0x5b97bc-0x0;var _0x3dc797=_0x11e8[_0x5b97bc];return _0x3dc797;};'use strict';var Sequelize=require(_0x811e('0x0'));module[_0x811e('0x1')]={'type':{'type':Sequelize[_0x811e('0x2')](_0x811e('0x3'),_0x811e('0x4'),_0x811e('0x5'),_0x811e('0x6'),_0x811e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x811e('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x811e('0x3'),_0x811e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x811e('0x8')]},'idField':{'type':Sequelize[_0x811e('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x811e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x811e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f5ac080..48d1256 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 _0xe086=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','type','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe086,0x1b0));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6e08('0x0'));var rimraf=require(_0x6e08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e08('0x2'));var rp=require('request-promise');var moment=require(_0x6e08('0x3'));var BPromise=require(_0x6e08('0x4'));var Mustache=require(_0x6e08('0x5'));var util=require('util');var path=require(_0x6e08('0x6'));var sox=require(_0x6e08('0x7'));var csv=require(_0x6e08('0x8'));var ejs=require(_0x6e08('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e08('0xa'));var squel=require(_0x6e08('0xb'));var crypto=require('crypto');var jsforce=require(_0x6e08('0xc'));var deskjs=require(_0x6e08('0xd'));var toCsv=require(_0x6e08('0x8'));var querystring=require(_0x6e08('0xe'));var Papa=require('papaparse');var Redis=require(_0x6e08('0xf'));var authService=require(_0x6e08('0x10'));var qs=require(_0x6e08('0x11'));var as=require(_0x6e08('0x12'));var hardwareService=require(_0x6e08('0x13'));var logger=require(_0x6e08('0x14'))(_0x6e08('0x15'));var utils=require(_0x6e08('0x16'));var config=require(_0x6e08('0x17'));var licenseUtil=require(_0x6e08('0x18'));var db=require(_0x6e08('0x19'))['db'];function respondWithStatusCode(_0x4929a9,_0x3c3a40){_0x3c3a40=_0x3c3a40||0xcc;return function(_0x5c9a22){if(_0x5c9a22){return _0x4929a9['sendStatus'](_0x3c3a40);}return _0x4929a9[_0x6e08('0x1a')](_0x3c3a40)[_0x6e08('0x1b')]();};}function respondWithResult(_0x509685,_0x417b63){_0x417b63=_0x417b63||0xc8;return function(_0x339bd3){if(_0x339bd3){return _0x509685['status'](_0x417b63)[_0x6e08('0x1c')](_0x339bd3);}};}function respondWithFilteredResult(_0x22600c,_0x5f3e37){return function(_0x47c3e9){if(_0x47c3e9){var _0x3d7d85=typeof _0x5f3e37[_0x6e08('0x1d')]==='undefined'&&typeof _0x5f3e37[_0x6e08('0x1e')]===_0x6e08('0x1f');var _0xf9eb99=_0x47c3e9[_0x6e08('0x20')];var _0x51d3e8=_0x3d7d85?0x0:_0x5f3e37[_0x6e08('0x1d')];var _0x2e1e7b=_0x3d7d85?_0x47c3e9[_0x6e08('0x20')]:_0x5f3e37[_0x6e08('0x1d')]+_0x5f3e37[_0x6e08('0x1e')];var _0x1b5447;if(_0x2e1e7b>=_0xf9eb99){_0x2e1e7b=_0xf9eb99;_0x1b5447=0xc8;}else{_0x1b5447=0xce;}_0x22600c['status'](_0x1b5447);return _0x22600c['set'](_0x6e08('0x21'),_0x51d3e8+'-'+_0x2e1e7b+'/'+_0xf9eb99)[_0x6e08('0x1c')](_0x47c3e9);}return null;};}function patchUpdates(_0x1e13bd){return function(_0x39e532){try{jsonpatch[_0x6e08('0x22')](_0x39e532,_0x1e13bd,!![]);}catch(_0x1d8d2e){return BPromise[_0x6e08('0x23')](_0x1d8d2e);}return _0x39e532[_0x6e08('0x24')]();};}function saveUpdates(_0x33d55b,_0x4fc3d3){return function(_0x20c9dc){if(_0x20c9dc){return _0x20c9dc[_0x6e08('0x25')](_0x33d55b)['then'](function(_0x565852){return _0x565852;});}return null;};}function removeEntity(_0x390255,_0x384a80){return function(_0x579727){if(_0x579727){return _0x579727[_0x6e08('0x26')]()[_0x6e08('0x27')](function(){_0x390255['status'](0xcc)[_0x6e08('0x1b')]();});}};}function handleEntityNotFound(_0x33f4ca,_0x56b186){return function(_0x53b5af){if(!_0x53b5af){_0x33f4ca['sendStatus'](0x194);}return _0x53b5af;};}function handleError(_0x4ba8c9,_0x1d2f86){_0x1d2f86=_0x1d2f86||0x1f4;return function(_0x280c45){logger[_0x6e08('0x28')](_0x280c45[_0x6e08('0x29')]);if(_0x280c45[_0x6e08('0x2a')]){delete _0x280c45[_0x6e08('0x2a')];}_0x4ba8c9['status'](_0x1d2f86)[_0x6e08('0x2b')](_0x280c45);};}exports[_0x6e08('0x2c')]=function(_0x24704a,_0x11b3b2){var _0x3b0b4e={},_0x343598={},_0x55fb9e={'count':0x0,'rows':[]};var _0x26b59c=_[_0x6e08('0x2d')](db[_0x6e08('0x2e')][_0x6e08('0x2f')],function(_0x1cead6){return{'name':_0x1cead6['fieldName'],'type':_0x1cead6[_0x6e08('0x30')]['key']};});_0x343598[_0x6e08('0x31')]=_[_0x6e08('0x2d')](_0x26b59c,_0x6e08('0x2a'));_0x343598['query']=_[_0x6e08('0x32')](_0x24704a['query']);_0x343598[_0x6e08('0x33')]=_['intersection'](_0x343598[_0x6e08('0x31')],_0x343598[_0x6e08('0x34')]);_0x3b0b4e['attributes']=_[_0x6e08('0x35')](_0x343598['model'],qs[_0x6e08('0x36')](_0x24704a[_0x6e08('0x34')][_0x6e08('0x36')]));_0x3b0b4e[_0x6e08('0x37')]=_0x3b0b4e['attributes'][_0x6e08('0x38')]?_0x3b0b4e[_0x6e08('0x37')]:_0x343598[_0x6e08('0x31')];if(!_0x24704a['query'][_0x6e08('0x39')](_0x6e08('0x3a'))){_0x3b0b4e[_0x6e08('0x1e')]=qs[_0x6e08('0x1e')](_0x24704a[_0x6e08('0x34')][_0x6e08('0x1e')]);_0x3b0b4e[_0x6e08('0x1d')]=qs['offset'](_0x24704a[_0x6e08('0x34')]['offset']);}_0x3b0b4e['order']=qs['sort'](_0x24704a['query'][_0x6e08('0x3b')]);_0x3b0b4e[_0x6e08('0x3c')]=qs[_0x6e08('0x33')](_['pick'](_0x24704a[_0x6e08('0x34')],_0x343598[_0x6e08('0x33')]),_0x26b59c);if(_0x24704a[_0x6e08('0x34')][_0x6e08('0x3d')]){_0x3b0b4e['where']=_[_0x6e08('0x3e')](_0x3b0b4e[_0x6e08('0x3c')],{'$or':_[_0x6e08('0x2d')](_0x26b59c,function(_0xaea103){if(_0xaea103[_0x6e08('0x30')]!==_0x6e08('0x3f')){var _0x1f4f46={};_0x1f4f46[_0xaea103['name']]={'$like':'%'+_0x24704a[_0x6e08('0x34')]['filter']+'%'};return _0x1f4f46;}})});}_0x3b0b4e=_['merge']({},_0x3b0b4e,_0x24704a['options']);var _0x944fd5={'where':_0x3b0b4e['where']};return db[_0x6e08('0x2e')][_0x6e08('0x20')](_0x944fd5)['then'](function(_0x26f5a5){_0x55fb9e[_0x6e08('0x20')]=_0x26f5a5;if(_0x24704a[_0x6e08('0x34')][_0x6e08('0x40')]){_0x3b0b4e[_0x6e08('0x41')]=[{'all':!![]}];}return db[_0x6e08('0x2e')]['findAll'](_0x3b0b4e);})['then'](function(_0x3333a8){_0x55fb9e[_0x6e08('0x42')]=_0x3333a8;return _0x55fb9e;})['then'](respondWithFilteredResult(_0x11b3b2,_0x3b0b4e))[_0x6e08('0x43')](handleError(_0x11b3b2,null));};exports[_0x6e08('0x44')]=function(_0x5bf1e8,_0x4302d){var _0x3e2ca7={'raw':!![],'where':{'id':_0x5bf1e8['params']['id']}},_0x13a7cd={};_0x13a7cd['model']=_['keys'](db[_0x6e08('0x2e')][_0x6e08('0x2f')]);_0x13a7cd['query']=_[_0x6e08('0x32')](_0x5bf1e8[_0x6e08('0x34')]);_0x13a7cd['filters']=_[_0x6e08('0x35')](_0x13a7cd['model'],_0x13a7cd[_0x6e08('0x34')]);_0x3e2ca7[_0x6e08('0x37')]=_[_0x6e08('0x35')](_0x13a7cd[_0x6e08('0x31')],qs[_0x6e08('0x36')](_0x5bf1e8[_0x6e08('0x34')]['fields']));_0x3e2ca7['attributes']=_0x3e2ca7[_0x6e08('0x37')]['length']?_0x3e2ca7[_0x6e08('0x37')]:_0x13a7cd['model'];if(_0x5bf1e8['query']['includeAll']){_0x3e2ca7[_0x6e08('0x41')]=[{'all':!![]}];}_0x3e2ca7=_[_0x6e08('0x3e')]({},_0x3e2ca7,_0x5bf1e8[_0x6e08('0x45')]);return db[_0x6e08('0x2e')][_0x6e08('0x46')](_0x3e2ca7)['then'](handleEntityNotFound(_0x4302d,null))['then'](respondWithResult(_0x4302d,null))[_0x6e08('0x43')](handleError(_0x4302d,null));};exports[_0x6e08('0x47')]=function(_0x10c622,_0x303482){return db['ServicenowField'][_0x6e08('0x47')](_0x10c622[_0x6e08('0x48')],{})[_0x6e08('0x27')](respondWithResult(_0x303482,0xc9))['catch'](handleError(_0x303482,null));};exports['update']=function(_0x5ddb27,_0x3258ec){if(_0x5ddb27['body']['id']){delete _0x5ddb27[_0x6e08('0x48')]['id'];}return db['ServicenowField'][_0x6e08('0x46')]({'where':{'id':_0x5ddb27[_0x6e08('0x49')]['id']}})[_0x6e08('0x27')](handleEntityNotFound(_0x3258ec,null))[_0x6e08('0x27')](saveUpdates(_0x5ddb27['body'],null))[_0x6e08('0x27')](respondWithResult(_0x3258ec,null))[_0x6e08('0x43')](handleError(_0x3258ec,null));};exports[_0x6e08('0x26')]=function(_0x4281cc,_0x12e6f8){return db[_0x6e08('0x2e')][_0x6e08('0x46')]({'where':{'id':_0x4281cc[_0x6e08('0x49')]['id']}})[_0x6e08('0x27')](handleEntityNotFound(_0x12e6f8,null))[_0x6e08('0x27')](removeEntity(_0x12e6f8,null))['catch'](handleError(_0x12e6f8,null));}; \ No newline at end of file +var _0xce53=['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','end','json','offset','undefined','limit','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv'];(function(_0x323cc3,_0x2b540e){var _0x11a2fb=function(_0x17ae43){while(--_0x17ae43){_0x323cc3['push'](_0x323cc3['shift']());}};_0x11a2fb(++_0x2b540e);}(_0xce53,0x178));var _0x3ce5=function(_0xf1fd56,_0x17124e){_0xf1fd56=_0xf1fd56-0x0;var _0x19bef3=_0xce53[_0xf1fd56];return _0x19bef3;};'use strict';var emlformat=require(_0x3ce5('0x0'));var rimraf=require(_0x3ce5('0x1'));var zipdir=require(_0x3ce5('0x2'));var jsonpatch=require(_0x3ce5('0x3'));var rp=require(_0x3ce5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3ce5('0x5'));var util=require('util');var path=require(_0x3ce5('0x6'));var sox=require(_0x3ce5('0x7'));var csv=require(_0x3ce5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3ce5('0x9'));var crypto=require(_0x3ce5('0xa'));var jsforce=require(_0x3ce5('0xb'));var deskjs=require(_0x3ce5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ce5('0xd'));var Redis=require(_0x3ce5('0xe'));var authService=require(_0x3ce5('0xf'));var qs=require(_0x3ce5('0x10'));var as=require(_0x3ce5('0x11'));var hardwareService=require(_0x3ce5('0x12'));var logger=require(_0x3ce5('0x13'))(_0x3ce5('0x14'));var utils=require(_0x3ce5('0x15'));var config=require(_0x3ce5('0x16'));var licenseUtil=require(_0x3ce5('0x17'));var db=require(_0x3ce5('0x18'))['db'];function respondWithStatusCode(_0x20214e,_0x1995d9){_0x1995d9=_0x1995d9||0xcc;return function(_0x278a1a){if(_0x278a1a){return _0x20214e['sendStatus'](_0x1995d9);}return _0x20214e['status'](_0x1995d9)[_0x3ce5('0x19')]();};}function respondWithResult(_0x15fc82,_0x1ae111){_0x1ae111=_0x1ae111||0xc8;return function(_0x47af2f){if(_0x47af2f){return _0x15fc82['status'](_0x1ae111)[_0x3ce5('0x1a')](_0x47af2f);}};}function respondWithFilteredResult(_0x44c5e9,_0x103a26){return function(_0x4c4ae9){if(_0x4c4ae9){var _0x3e3298=typeof _0x103a26[_0x3ce5('0x1b')]===_0x3ce5('0x1c')&&typeof _0x103a26[_0x3ce5('0x1d')]===_0x3ce5('0x1c');var _0x47843e=_0x4c4ae9['count'];var _0x11df91=_0x3e3298?0x0:_0x103a26[_0x3ce5('0x1b')];var _0x33a969=_0x3e3298?_0x4c4ae9['count']:_0x103a26['offset']+_0x103a26[_0x3ce5('0x1d')];var _0x132f23;if(_0x33a969>=_0x47843e){_0x33a969=_0x47843e;_0x132f23=0xc8;}else{_0x132f23=0xce;}_0x44c5e9[_0x3ce5('0x1e')](_0x132f23);return _0x44c5e9[_0x3ce5('0x1f')](_0x3ce5('0x20'),_0x11df91+'-'+_0x33a969+'/'+_0x47843e)[_0x3ce5('0x1a')](_0x4c4ae9);}return null;};}function patchUpdates(_0x36198f){return function(_0x1514fd){try{jsonpatch[_0x3ce5('0x21')](_0x1514fd,_0x36198f,!![]);}catch(_0x27afd1){return BPromise['reject'](_0x27afd1);}return _0x1514fd[_0x3ce5('0x22')]();};}function saveUpdates(_0x247b5b,_0x497a03){return function(_0x4f52f6){if(_0x4f52f6){return _0x4f52f6[_0x3ce5('0x23')](_0x247b5b)[_0x3ce5('0x24')](function(_0x212ac5){return _0x212ac5;});}return null;};}function removeEntity(_0x1bfd0a,_0x336bce){return function(_0xb21ac9){if(_0xb21ac9){return _0xb21ac9[_0x3ce5('0x25')]()[_0x3ce5('0x24')](function(){_0x1bfd0a[_0x3ce5('0x1e')](0xcc)[_0x3ce5('0x19')]();});}};}function handleEntityNotFound(_0x326159,_0x5e2414){return function(_0x1c2dad){if(!_0x1c2dad){_0x326159['sendStatus'](0x194);}return _0x1c2dad;};}function handleError(_0x42679b,_0x201ff8){_0x201ff8=_0x201ff8||0x1f4;return function(_0x21dd35){logger[_0x3ce5('0x26')](_0x21dd35[_0x3ce5('0x27')]);if(_0x21dd35[_0x3ce5('0x28')]){delete _0x21dd35[_0x3ce5('0x28')];}_0x42679b[_0x3ce5('0x1e')](_0x201ff8)[_0x3ce5('0x29')](_0x21dd35);};}exports[_0x3ce5('0x2a')]=function(_0x3185c0,_0x15c7b5){var _0x2e19dc={},_0x4aacb5={},_0x14a82d={'count':0x0,'rows':[]};var _0xd845e0=_[_0x3ce5('0x2b')](db[_0x3ce5('0x2c')]['rawAttributes'],function(_0xe7e65b){return{'name':_0xe7e65b[_0x3ce5('0x2d')],'type':_0xe7e65b[_0x3ce5('0x2e')]['key']};});_0x4aacb5['model']=_[_0x3ce5('0x2b')](_0xd845e0,_0x3ce5('0x28'));_0x4aacb5['query']=_[_0x3ce5('0x2f')](_0x3185c0[_0x3ce5('0x30')]);_0x4aacb5[_0x3ce5('0x31')]=_['intersection'](_0x4aacb5[_0x3ce5('0x32')],_0x4aacb5[_0x3ce5('0x30')]);_0x2e19dc[_0x3ce5('0x33')]=_[_0x3ce5('0x34')](_0x4aacb5[_0x3ce5('0x32')],qs[_0x3ce5('0x35')](_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x35')]));_0x2e19dc['attributes']=_0x2e19dc['attributes'][_0x3ce5('0x36')]?_0x2e19dc['attributes']:_0x4aacb5[_0x3ce5('0x32')];if(!_0x3185c0['query'][_0x3ce5('0x37')](_0x3ce5('0x38'))){_0x2e19dc['limit']=qs[_0x3ce5('0x1d')](_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x1d')]);_0x2e19dc[_0x3ce5('0x1b')]=qs[_0x3ce5('0x1b')](_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x1b')]);}_0x2e19dc[_0x3ce5('0x39')]=qs[_0x3ce5('0x3a')](_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x3a')]);_0x2e19dc[_0x3ce5('0x3b')]=qs[_0x3ce5('0x31')](_[_0x3ce5('0x3c')](_0x3185c0['query'],_0x4aacb5[_0x3ce5('0x31')]),_0xd845e0);if(_0x3185c0['query']['filter']){_0x2e19dc[_0x3ce5('0x3b')]=_[_0x3ce5('0x3d')](_0x2e19dc['where'],{'$or':_['map'](_0xd845e0,function(_0x823523){if(_0x823523[_0x3ce5('0x2e')]!==_0x3ce5('0x3e')){var _0xed9dfd={};_0xed9dfd[_0x823523[_0x3ce5('0x28')]]={'$like':'%'+_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x3f')]+'%'};return _0xed9dfd;}})});}_0x2e19dc=_[_0x3ce5('0x3d')]({},_0x2e19dc,_0x3185c0[_0x3ce5('0x40')]);var _0x470db0={'where':_0x2e19dc[_0x3ce5('0x3b')]};return db[_0x3ce5('0x2c')][_0x3ce5('0x41')](_0x470db0)[_0x3ce5('0x24')](function(_0x17921e){_0x14a82d[_0x3ce5('0x41')]=_0x17921e;if(_0x3185c0[_0x3ce5('0x30')][_0x3ce5('0x42')]){_0x2e19dc[_0x3ce5('0x43')]=[{'all':!![]}];}return db[_0x3ce5('0x2c')][_0x3ce5('0x44')](_0x2e19dc);})[_0x3ce5('0x24')](function(_0x36d1a6){_0x14a82d[_0x3ce5('0x45')]=_0x36d1a6;return _0x14a82d;})['then'](respondWithFilteredResult(_0x15c7b5,_0x2e19dc))[_0x3ce5('0x46')](handleError(_0x15c7b5,null));};exports[_0x3ce5('0x47')]=function(_0x122029,_0x4be2e){var _0x1d0e56={'raw':!![],'where':{'id':_0x122029[_0x3ce5('0x48')]['id']}},_0x383a92={};_0x383a92[_0x3ce5('0x32')]=_[_0x3ce5('0x2f')](db[_0x3ce5('0x2c')][_0x3ce5('0x49')]);_0x383a92['query']=_[_0x3ce5('0x2f')](_0x122029['query']);_0x383a92[_0x3ce5('0x31')]=_['intersection'](_0x383a92[_0x3ce5('0x32')],_0x383a92[_0x3ce5('0x30')]);_0x1d0e56[_0x3ce5('0x33')]=_[_0x3ce5('0x34')](_0x383a92[_0x3ce5('0x32')],qs[_0x3ce5('0x35')](_0x122029[_0x3ce5('0x30')][_0x3ce5('0x35')]));_0x1d0e56[_0x3ce5('0x33')]=_0x1d0e56[_0x3ce5('0x33')]['length']?_0x1d0e56[_0x3ce5('0x33')]:_0x383a92[_0x3ce5('0x32')];if(_0x122029['query']['includeAll']){_0x1d0e56[_0x3ce5('0x43')]=[{'all':!![]}];}_0x1d0e56=_['merge']({},_0x1d0e56,_0x122029['options']);return db['ServicenowField'][_0x3ce5('0x4a')](_0x1d0e56)[_0x3ce5('0x24')](handleEntityNotFound(_0x4be2e,null))[_0x3ce5('0x24')](respondWithResult(_0x4be2e,null))[_0x3ce5('0x46')](handleError(_0x4be2e,null));};exports[_0x3ce5('0x4b')]=function(_0x4d7ce6,_0x5e115b){return db[_0x3ce5('0x2c')][_0x3ce5('0x4b')](_0x4d7ce6[_0x3ce5('0x4c')],{})[_0x3ce5('0x24')](respondWithResult(_0x5e115b,0xc9))['catch'](handleError(_0x5e115b,null));};exports[_0x3ce5('0x23')]=function(_0x446ceb,_0x378cda){if(_0x446ceb[_0x3ce5('0x4c')]['id']){delete _0x446ceb[_0x3ce5('0x4c')]['id'];}return db[_0x3ce5('0x2c')][_0x3ce5('0x4a')]({'where':{'id':_0x446ceb['params']['id']}})[_0x3ce5('0x24')](handleEntityNotFound(_0x378cda,null))[_0x3ce5('0x24')](saveUpdates(_0x446ceb[_0x3ce5('0x4c')],null))[_0x3ce5('0x24')](respondWithResult(_0x378cda,null))[_0x3ce5('0x46')](handleError(_0x378cda,null));};exports[_0x3ce5('0x25')]=function(_0x57273d,_0x57276d){return db[_0x3ce5('0x2c')]['find']({'where':{'id':_0x57273d[_0x3ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x57276d,null))[_0x3ce5('0x24')](removeEntity(_0x57276d,null))[_0x3ce5('0x46')](handleError(_0x57276d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c3118b1..998f327 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 _0x9036=['idField','FieldId','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index'];(function(_0x2f8b3d,_0x408d44){var _0xfe9e29=function(_0x1f2095){while(--_0x1f2095){_0x2f8b3d['push'](_0x2f8b3d['shift']());}};_0xfe9e29(++_0x408d44);}(_0x9036,0x128));var _0x6903=function(_0x493c7a,_0x30ea93){_0x493c7a=_0x493c7a-0x0;var _0x1ad499=_0x9036[_0x493c7a];return _0x1ad499;};'use strict';var _=require(_0x6903('0x0'));var util=require(_0x6903('0x1'));var logger=require(_0x6903('0x2'))(_0x6903('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6903('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6903('0x5'));var config=require(_0x6903('0x6'));var attributes=require(_0x6903('0x7'));module[_0x6903('0x8')]=function(_0x80cb6f,_0x59accb){return _0x80cb6f[_0x6903('0x9')]('ServicenowField',attributes,{'tableName':_0x6903('0xa'),'paranoid':![],'indexes':[{'name':_0x6903('0xb'),'fields':[_0x6903('0xc'),_0x6903('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x04d2=['ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x04d2,0x1e4));var _0x204d=function(_0x3dcd5a,_0xd603e3){_0x3dcd5a=_0x3dcd5a-0x0;var _0x2a81cf=_0x04d2[_0x3dcd5a];return _0x2a81cf;};'use strict';var _=require(_0x204d('0x0'));var util=require(_0x204d('0x1'));var logger=require(_0x204d('0x2'))(_0x204d('0x3'));var moment=require(_0x204d('0x4'));var BPromise=require('bluebird');var rp=require(_0x204d('0x5'));var fs=require('fs');var path=require(_0x204d('0x6'));var rimraf=require(_0x204d('0x7'));var config=require(_0x204d('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x204d('0x9')]=function(_0x136a08,_0x68034){return _0x136a08[_0x204d('0xa')](_0x204d('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x204d('0xc'),'fields':[_0x204d('0xd'),_0x204d('0xe')],'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 b9c0d2d..ea5db4d 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\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','ServicenowField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x479372,_0x1bb4d3){_0x479372=_0x479372-0x0;var _0x3a9b00=_0xbdb7[_0x479372];return _0x3a9b00;};'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 +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xda3f,0xec));var _0xfda3=function(_0x5c3795,_0x3baaff){_0x5c3795=_0x5c3795-0x0;var _0x257e54=_0xda3f[_0x5c3795];return _0x257e54;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 96bdee2..ffdf560 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(_0x3c43f2,_0x37e1a4){var _0x4edee1=function(_0x252ceb){while(--_0x252ceb){_0x3c43f2['push'](_0x3c43f2['shift']());}};_0x4edee1(++_0x37e1a4);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x55c5fc,_0x41b31a){var _0x2daec2=function(_0x222bea){while(--_0x222bea){_0x55c5fc['push'](_0x55c5fc['shift']());}};_0x2daec2(++_0x41b31a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 6bfe637..299ed4d 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(_0x28f19f,_0x15b7f2){var _0x2ace00=function(_0x2181eb){while(--_0x2181eb){_0x28f19f['push'](_0x28f19f['shift']());}};_0x2ace00(++_0x15b7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x16234b,_0x45ac14){var _0x3e503c=function(_0x1d54b6){while(--_0x1d54b6){_0x16234b['push'](_0x16234b['shift']());}};_0x3e503c(++_0x45ac14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 5fad13b..b7b0df6 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 _0x7aee=['value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','update','body','params','findOne','SugarcrmConfiguration','rawAttributes','filters','pick','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','SugarcrmField','Descriptions','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','username','PLAIN','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','endsWith'];(function(_0x5a9759,_0x15ee29){var _0x10152a=function(_0x6f8271){while(--_0x6f8271){_0x5a9759['push'](_0x5a9759['shift']());}};_0x10152a(++_0x15ee29);}(_0x7aee,0x1cd));var _0xe7ae=function(_0xad7106,_0x5c9ce7){_0xad7106=_0xad7106-0x0;var _0x2833e1=_0x7aee[_0xad7106];return _0x2833e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7ae('0x0'));var zipdir=require(_0xe7ae('0x1'));var jsonpatch=require(_0xe7ae('0x2'));var rp=require(_0xe7ae('0x3'));var moment=require(_0xe7ae('0x4'));var BPromise=require(_0xe7ae('0x5'));var Mustache=require('mustache');var util=require(_0xe7ae('0x6'));var path=require(_0xe7ae('0x7'));var sox=require(_0xe7ae('0x8'));var csv=require(_0xe7ae('0x9'));var ejs=require(_0xe7ae('0xa'));var fs=require('fs');var fs_extra=require(_0xe7ae('0xb'));var _=require(_0xe7ae('0xc'));var squel=require('squel');var crypto=require(_0xe7ae('0xd'));var jsforce=require(_0xe7ae('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe7ae('0x9'));var querystring=require('querystring');var Papa=require(_0xe7ae('0xf'));var Redis=require(_0xe7ae('0x10'));var authService=require(_0xe7ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe7ae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe7ae('0x13'));var utils=require(_0xe7ae('0x14'));var config=require(_0xe7ae('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xe7ae('0x16'));function respondWithStatusCode(_0x452cab,_0x3ffd19){_0x3ffd19=_0x3ffd19||0xcc;return function(_0x4bcf89){if(_0x4bcf89){return _0x452cab[_0xe7ae('0x17')](_0x3ffd19);}return _0x452cab[_0xe7ae('0x18')](_0x3ffd19)[_0xe7ae('0x19')]();};}function respondWithResult(_0x3207df,_0x7e5d77){_0x7e5d77=_0x7e5d77||0xc8;return function(_0x226aaa){if(_0x226aaa){return _0x3207df[_0xe7ae('0x18')](_0x7e5d77)[_0xe7ae('0x1a')](_0x226aaa);}};}function respondWithFilteredResult(_0x19f03d,_0x555a2d){return function(_0x15ddf6){if(_0x15ddf6){var _0x113f3e=typeof _0x555a2d[_0xe7ae('0x1b')]===_0xe7ae('0x1c')&&typeof _0x555a2d[_0xe7ae('0x1d')]==='undefined';var _0x579bc5=_0x15ddf6[_0xe7ae('0x1e')];var _0x414781=_0x113f3e?0x0:_0x555a2d[_0xe7ae('0x1b')];var _0x159837=_0x113f3e?_0x15ddf6[_0xe7ae('0x1e')]:_0x555a2d[_0xe7ae('0x1b')]+_0x555a2d[_0xe7ae('0x1d')];var _0x1bb8ab;if(_0x159837>=_0x579bc5){_0x159837=_0x579bc5;_0x1bb8ab=0xc8;}else{_0x1bb8ab=0xce;}_0x19f03d[_0xe7ae('0x18')](_0x1bb8ab);return _0x19f03d[_0xe7ae('0x1f')](_0xe7ae('0x20'),_0x414781+'-'+_0x159837+'/'+_0x579bc5)[_0xe7ae('0x1a')](_0x15ddf6);}return null;};}function patchUpdates(_0x3107e4){return function(_0xb1563d){try{jsonpatch[_0xe7ae('0x21')](_0xb1563d,_0x3107e4,!![]);}catch(_0x395931){return BPromise[_0xe7ae('0x22')](_0x395931);}return _0xb1563d['save']();};}function saveUpdates(_0xb4d3d5,_0x4b2e20){return function(_0x190b76){if(_0x190b76){return _0x190b76['update'](_0xb4d3d5)[_0xe7ae('0x23')](function(_0x26a06f){return _0x26a06f;});}return null;};}function removeEntity(_0x25722f,_0xe24b6d){return function(_0x3d9f7c){if(_0x3d9f7c){return _0x3d9f7c[_0xe7ae('0x24')]()[_0xe7ae('0x23')](function(){_0x25722f[_0xe7ae('0x18')](0xcc)[_0xe7ae('0x19')]();});}};}function handleEntityNotFound(_0x248586,_0x1f37e9){return function(_0x257040){if(!_0x257040){_0x248586[_0xe7ae('0x17')](0x194);}return _0x257040;};}function handleError(_0xcd3462,_0x60fde9){_0x60fde9=_0x60fde9||0x1f4;return function(_0x33d11f){logger[_0xe7ae('0x25')](_0x33d11f[_0xe7ae('0x26')]);if(_0x33d11f[_0xe7ae('0x27')]){delete _0x33d11f[_0xe7ae('0x27')];}_0xcd3462['status'](_0x60fde9)[_0xe7ae('0x28')](_0x33d11f);};}exports[_0xe7ae('0x29')]=function(_0x23c7f0,_0x1cf8dd){var _0x22704d={},_0x34b570={},_0x5857ab={'count':0x0,'rows':[]};var _0x269b05=_[_0xe7ae('0x2a')](db[_0xe7ae('0x2b')]['rawAttributes'],function(_0x5936ae){return{'name':_0x5936ae['fieldName'],'type':_0x5936ae['type'][_0xe7ae('0x2c')]};});_0x34b570[_0xe7ae('0x2d')]=_['map'](_0x269b05,'name');_0x34b570[_0xe7ae('0x2e')]=_[_0xe7ae('0x2f')](_0x23c7f0['query']);_0x34b570['filters']=_[_0xe7ae('0x30')](_0x34b570['model'],_0x34b570[_0xe7ae('0x2e')]);_0x22704d[_0xe7ae('0x31')]=_[_0xe7ae('0x30')](_0x34b570[_0xe7ae('0x2d')],qs[_0xe7ae('0x32')](_0x23c7f0['query'][_0xe7ae('0x32')]));_0x22704d['attributes']=_0x22704d['attributes'][_0xe7ae('0x33')]?_0x22704d[_0xe7ae('0x31')]:_0x34b570['model'];if(!_0x23c7f0[_0xe7ae('0x2e')]['hasOwnProperty'](_0xe7ae('0x34'))){_0x22704d['limit']=qs[_0xe7ae('0x1d')](_0x23c7f0[_0xe7ae('0x2e')]['limit']);_0x22704d[_0xe7ae('0x1b')]=qs[_0xe7ae('0x1b')](_0x23c7f0[_0xe7ae('0x2e')][_0xe7ae('0x1b')]);}_0x22704d[_0xe7ae('0x35')]=qs['sort'](_0x23c7f0[_0xe7ae('0x2e')][_0xe7ae('0x36')]);_0x22704d[_0xe7ae('0x37')]=qs['filters'](_['pick'](_0x23c7f0[_0xe7ae('0x2e')],_0x34b570['filters']),_0x269b05);if(_0x23c7f0[_0xe7ae('0x2e')][_0xe7ae('0x38')]){_0x22704d[_0xe7ae('0x37')]=_['merge'](_0x22704d['where'],{'$or':_[_0xe7ae('0x2a')](_0x269b05,function(_0x31191d){if(_0x31191d[_0xe7ae('0x39')]!==_0xe7ae('0x3a')){var _0x141648={};_0x141648[_0x31191d[_0xe7ae('0x27')]]={'$like':'%'+_0x23c7f0[_0xe7ae('0x2e')][_0xe7ae('0x38')]+'%'};return _0x141648;}})});}_0x22704d=_[_0xe7ae('0x3b')]({},_0x22704d,_0x23c7f0[_0xe7ae('0x3c')]);var _0x105615={'where':_0x22704d['where']};return db[_0xe7ae('0x2b')][_0xe7ae('0x1e')](_0x105615)[_0xe7ae('0x23')](function(_0x819263){_0x5857ab[_0xe7ae('0x1e')]=_0x819263;if(_0x23c7f0['query'][_0xe7ae('0x3d')]){_0x22704d['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xe7ae('0x3e')](_0x22704d);})['then'](function(_0x2878e0){_0x5857ab[_0xe7ae('0x3f')]=_0x2878e0;return _0x5857ab;})['then'](respondWithFilteredResult(_0x1cf8dd,_0x22704d))[_0xe7ae('0x40')](handleError(_0x1cf8dd,null));};exports[_0xe7ae('0x41')]=function(_0xd704ee,_0x1bd7a2){var _0x2b9788={'raw':![],'where':{'id':_0xd704ee['params']['id']}},_0x1fa5c8={};_0x1fa5c8['model']=_[_0xe7ae('0x2f')](db[_0xe7ae('0x2b')]['rawAttributes']);_0x1fa5c8[_0xe7ae('0x2e')]=_['keys'](_0xd704ee[_0xe7ae('0x2e')]);_0x1fa5c8['filters']=_[_0xe7ae('0x30')](_0x1fa5c8[_0xe7ae('0x2d')],_0x1fa5c8['query']);_0x2b9788[_0xe7ae('0x31')]=_[_0xe7ae('0x30')](_0x1fa5c8[_0xe7ae('0x2d')],qs[_0xe7ae('0x32')](_0xd704ee[_0xe7ae('0x2e')]['fields']));_0x2b9788['attributes']=_0x2b9788['attributes'][_0xe7ae('0x33')]?_0x2b9788[_0xe7ae('0x31')]:_0x1fa5c8['model'];if(_0xd704ee[_0xe7ae('0x2e')][_0xe7ae('0x3d')]){_0x2b9788[_0xe7ae('0x42')]=[{'all':!![]}];}_0x2b9788=_[_0xe7ae('0x3b')]({},_0x2b9788,_0xd704ee['options']);return db[_0xe7ae('0x2b')][_0xe7ae('0x43')](_0x2b9788)[_0xe7ae('0x23')](handleEntityNotFound(_0x1bd7a2,null))[_0xe7ae('0x23')](respondWithResult(_0x1bd7a2,null))['catch'](handleError(_0x1bd7a2,null));};exports['create']=function(_0x14f38d,_0x27944d){return db[_0xe7ae('0x2b')][_0xe7ae('0x44')](_0x14f38d['body'],{})[_0xe7ae('0x23')](respondWithResult(_0x27944d,0xc9))[_0xe7ae('0x40')](handleError(_0x27944d,null));};exports[_0xe7ae('0x45')]=function(_0x14b63d,_0x5d7967){if(_0x14b63d[_0xe7ae('0x46')]['id']){delete _0x14b63d[_0xe7ae('0x46')]['id'];}return db[_0xe7ae('0x2b')][_0xe7ae('0x43')]({'where':{'id':_0x14b63d[_0xe7ae('0x47')]['id']}})[_0xe7ae('0x23')](handleEntityNotFound(_0x5d7967,null))[_0xe7ae('0x23')](saveUpdates(_0x14b63d[_0xe7ae('0x46')],null))[_0xe7ae('0x23')](respondWithResult(_0x5d7967,null))['catch'](handleError(_0x5d7967,null));};exports[_0xe7ae('0x24')]=function(_0x43523e,_0x375628){return db['SugarcrmAccount'][_0xe7ae('0x43')]({'where':{'id':_0x43523e[_0xe7ae('0x47')]['id']}})[_0xe7ae('0x23')](handleEntityNotFound(_0x375628,null))['then'](removeEntity(_0x375628,null))[_0xe7ae('0x40')](handleError(_0x375628,null));};exports['getConfigurations']=function(_0x54cc05,_0x53df82,_0x4b3196){var _0x1ed704={};var _0x2695df={};var _0x416625;var _0x114124;return db[_0xe7ae('0x2b')][_0xe7ae('0x48')]({'where':{'id':_0x54cc05[_0xe7ae('0x47')]['id']}})[_0xe7ae('0x23')](handleEntityNotFound(_0x53df82,null))['then'](function(_0xacd8d){if(_0xacd8d){_0x416625=_0xacd8d;_0x2695df[_0xe7ae('0x2d')]=_[_0xe7ae('0x2f')](db[_0xe7ae('0x49')][_0xe7ae('0x4a')]);_0x2695df[_0xe7ae('0x2e')]=_[_0xe7ae('0x2f')](_0x54cc05['query']);_0x2695df['filters']=_[_0xe7ae('0x30')](_0x2695df[_0xe7ae('0x2d')],_0x2695df[_0xe7ae('0x2e')]);_0x1ed704['attributes']=_[_0xe7ae('0x30')](_0x2695df['model'],qs[_0xe7ae('0x32')](_0x54cc05['query']['fields']));_0x1ed704[_0xe7ae('0x31')]=_0x1ed704[_0xe7ae('0x31')]['length']?_0x1ed704[_0xe7ae('0x31')]:_0x2695df[_0xe7ae('0x2d')];_0x1ed704[_0xe7ae('0x35')]=qs[_0xe7ae('0x36')](_0x54cc05['query'][_0xe7ae('0x36')]);_0x1ed704[_0xe7ae('0x37')]=qs[_0xe7ae('0x4b')](_[_0xe7ae('0x4c')](_0x54cc05['query'],_0x2695df[_0xe7ae('0x4b')]));if(_0x54cc05[_0xe7ae('0x2e')][_0xe7ae('0x38')]){_0x1ed704['where']=_[_0xe7ae('0x3b')](_0x1ed704[_0xe7ae('0x37')],{'$or':_[_0xe7ae('0x2a')](_0x1ed704[_0xe7ae('0x31')],function(_0x40371c){var _0x300b34={};_0x300b34[_0x40371c]={'$like':'%'+_0x54cc05[_0xe7ae('0x2e')][_0xe7ae('0x38')]+'%'};return _0x300b34;})});}_0x1ed704=_['merge']({},_0x1ed704,_0x54cc05[_0xe7ae('0x3c')]);return _0x416625[_0xe7ae('0x4d')](_0x1ed704);}})[_0xe7ae('0x23')](function(_0x61d596){if(_0x61d596){_0x114124=_0x61d596[_0xe7ae('0x33')];if(!_0x54cc05[_0xe7ae('0x2e')][_0xe7ae('0x4e')]('nolimit')){_0x1ed704[_0xe7ae('0x1d')]=qs[_0xe7ae('0x1d')](_0x54cc05[_0xe7ae('0x2e')][_0xe7ae('0x1d')]);_0x1ed704[_0xe7ae('0x1b')]=qs[_0xe7ae('0x1b')](_0x54cc05['query'][_0xe7ae('0x1b')]);}return _0x416625['getConfigurations'](_0x1ed704);}})[_0xe7ae('0x23')](function(_0x413ac6){if(_0x413ac6){return _0x413ac6?{'count':_0x114124,'rows':_0x413ac6}:null;}})[_0xe7ae('0x23')](respondWithResult(_0x53df82,null))[_0xe7ae('0x40')](handleError(_0x53df82,null));};exports['addConfiguration']=function(_0x585f33,_0x2a0772,_0x17b823){if(_0x585f33[_0xe7ae('0x46')]['id']){delete _0x585f33[_0xe7ae('0x46')]['id'];}return db[_0xe7ae('0x2b')][_0xe7ae('0x48')]({'where':{'id':_0x585f33[_0xe7ae('0x47')]['id']}})[_0xe7ae('0x23')](handleEntityNotFound(_0x2a0772,null))[_0xe7ae('0x23')](function(_0x275b6e){if(_0x275b6e){_0x585f33[_0xe7ae('0x46')][_0xe7ae('0x4f')]=_0x275b6e['id'];_0x585f33['body'][_0xe7ae('0x50')]=integrations[_0xe7ae('0x51')](_0x585f33[_0xe7ae('0x46')]['channel'],_0x585f33[_0xe7ae('0x46')][_0xe7ae('0x39')]);_0x585f33[_0xe7ae('0x46')]['Descriptions']=integrations['getDescriptions'](_0x585f33[_0xe7ae('0x46')]['channel'],_0x585f33[_0xe7ae('0x46')]['type']);return db[_0xe7ae('0x49')][_0xe7ae('0x44')](_0x585f33[_0xe7ae('0x46')],{'include':[{'model':db[_0xe7ae('0x52')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xe7ae('0x53')}]});}return null;})[_0xe7ae('0x23')](respondWithResult(_0x2a0772,null))[_0xe7ae('0x40')](handleError(_0x2a0772,null));};exports[_0xe7ae('0x54')]=function(_0x180790,_0x278757,_0x52f43e){var _0x3aff00='';var _0x3b4aa4=['id',_0xe7ae('0x27'),_0xe7ae('0x55'),'created_by',_0xe7ae('0x56'),'date_start',_0xe7ae('0x57'),_0xe7ae('0x58'),'parent_id','parent_type',_0xe7ae('0x59'),_0xe7ae('0x5a')];return db[_0xe7ae('0x2b')][_0xe7ae('0x48')]({'where':{'id':_0x180790[_0xe7ae('0x47')]['id']},'attributes':['id','username','password',_0xe7ae('0x5b')]})['then'](handleEntityNotFound(_0x278757,null))['then'](function(_0x427f5b){if(_0x427f5b){_0x3aff00=_0x427f5b[_0xe7ae('0x5b')];var _0x1b92f8=_0x3aff00[_0xe7ae('0x5c')](-0x1);if(_0x1b92f8==='/'){_0x3aff00=_0x3aff00[_0xe7ae('0x5d')](0x0,_0x3aff00[_0xe7ae('0x5e')](_0x1b92f8));}return rp({'method':_0xe7ae('0x5f'),'uri':util[_0xe7ae('0x60')](_0xe7ae('0x61'),_0x3aff00,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe7ae('0x62'),'input_type':_0xe7ae('0x63'),'response_type':_0xe7ae('0x63'),'rest_data':JSON[_0xe7ae('0x64')]({'user_auth':{'user_name':_0x427f5b[_0xe7ae('0x65')],'password':_0x427f5b['password'],'encryption':_0xe7ae('0x66')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xe7ae('0x23')](function(_0x2ec5ee){if(_0x2ec5ee&&_0x2ec5ee['name']!=='Invalid\x20Login'&&_0x2ec5ee[_0xe7ae('0x27')]!==_0xe7ae('0x67')){return rp({'method':_0xe7ae('0x5f'),'uri':util[_0xe7ae('0x60')](_0xe7ae('0x61'),_0x3aff00,_0xe7ae('0x68')),'json':!![],'form':{'method':_0xe7ae('0x69'),'input_type':_0xe7ae('0x63'),'response_type':_0xe7ae('0x63'),'rest_data':JSON[_0xe7ae('0x64')]({'session':_0x2ec5ee['id'],'module_name':_0xe7ae('0x6a')})}})[_0xe7ae('0x23')](function(_0x227652){if(_0x227652){var _0x2fec54=_[_0xe7ae('0x6b')](_0x227652['module_fields']);_['remove'](_0x2fec54,function(_0x46a2da){return _0x3b4aa4['includes'](_0x46a2da['name']);});return{'count':_0x2fec54[_0xe7ae('0x33')],'rows':_[_0xe7ae('0x2a')](_0x2fec54,function(_0x1a0100){return{'id':_0x1a0100[_0xe7ae('0x27')],'name':_0x1a0100['label'],'custom':_[_0xe7ae('0x6c')](_0x1a0100[_0xe7ae('0x27')],'_c')?!![]:![],'options':_0x1a0100[_0xe7ae('0x3c')]?_[_0xe7ae('0x2a')](_['values'](_0x1a0100[_0xe7ae('0x3c')]),function(_0x34e331){return{'name':_0x34e331[_0xe7ae('0x6d')],'value':_0x34e331[_0xe7ae('0x27')]};}):[]};})};}})[_0xe7ae('0x23')](respondWithResult(_0x278757,null))[_0xe7ae('0x40')](function(_0x31bd0d){var _0x24f92e=_0x180790[_0xe7ae('0x2e')][_0xe7ae('0x6e')]?0x1f4:_0x31bd0d[_0xe7ae('0x6f')]||0x1f4;logger[_0xe7ae('0x25')](_0xe7ae('0x70'),_0xe7ae('0x54'),_0x24f92e,JSON['stringify'](_0x31bd0d));delete _0x31bd0d[_0xe7ae('0x27')];if(_0x24f92e===0x191){_0x24f92e=0x190;}_0x278757[_0xe7ae('0x18')](_0x24f92e)[_0xe7ae('0x28')](_0x180790[_0xe7ae('0x2e')]['test']?{'message':_0xe7ae('0x71'),'statusCode':_0x31bd0d['statusCode']}:_0x31bd0d);});}else{var _0xb9d653=0x1f4;_0x278757[_0xe7ae('0x18')](_0xb9d653)[_0xe7ae('0x28')]({'message':_0xe7ae('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x92b6=['reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','catch','show','params','merge','find','create','update','body','getConfigurations','findOne','SugarcrmConfiguration','length','addConfiguration','AccountId','Subjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','password','remoteUri','lastIndexOf','format','login','JSON','stringify','username','PLAIN','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x550ceb,_0x59f157){var _0x87cf92=function(_0xa64fa5){while(--_0xa64fa5){_0x550ceb['push'](_0x550ceb['shift']());}};_0x87cf92(++_0x59f157);}(_0x92b6,0x140));var _0x692b=function(_0x52e791,_0x4b3159){_0x52e791=_0x52e791-0x0;var _0x2e4ba3=_0x92b6[_0x52e791];return _0x2e4ba3;};'use strict';var emlformat=require(_0x692b('0x0'));var rimraf=require(_0x692b('0x1'));var zipdir=require(_0x692b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x692b('0x3'));var moment=require(_0x692b('0x4'));var BPromise=require(_0x692b('0x5'));var Mustache=require(_0x692b('0x6'));var util=require(_0x692b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x692b('0x8'));var ejs=require(_0x692b('0x9'));var fs=require('fs');var fs_extra=require(_0x692b('0xa'));var _=require(_0x692b('0xb'));var squel=require(_0x692b('0xc'));var crypto=require(_0x692b('0xd'));var jsforce=require(_0x692b('0xe'));var deskjs=require(_0x692b('0xf'));var toCsv=require(_0x692b('0x8'));var querystring=require(_0x692b('0x10'));var Papa=require('papaparse');var Redis=require(_0x692b('0x11'));var authService=require(_0x692b('0x12'));var qs=require(_0x692b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x692b('0x14'));var logger=require(_0x692b('0x15'))(_0x692b('0x16'));var utils=require(_0x692b('0x17'));var config=require(_0x692b('0x18'));var licenseUtil=require(_0x692b('0x19'));var db=require(_0x692b('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5aa170,_0x4bc78b){_0x4bc78b=_0x4bc78b||0xcc;return function(_0x2da46d){if(_0x2da46d){return _0x5aa170[_0x692b('0x1b')](_0x4bc78b);}return _0x5aa170[_0x692b('0x1c')](_0x4bc78b)[_0x692b('0x1d')]();};}function respondWithResult(_0x55dd0c,_0x2f11c4){_0x2f11c4=_0x2f11c4||0xc8;return function(_0x1cba0){if(_0x1cba0){return _0x55dd0c[_0x692b('0x1c')](_0x2f11c4)[_0x692b('0x1e')](_0x1cba0);}};}function respondWithFilteredResult(_0xa70581,_0x2ad3c7){return function(_0x293dba){if(_0x293dba){var _0x4d967e=typeof _0x2ad3c7[_0x692b('0x1f')]===_0x692b('0x20')&&typeof _0x2ad3c7[_0x692b('0x21')]===_0x692b('0x20');var _0x464248=_0x293dba[_0x692b('0x22')];var _0x4b6465=_0x4d967e?0x0:_0x2ad3c7['offset'];var _0x1f123f=_0x4d967e?_0x293dba[_0x692b('0x22')]:_0x2ad3c7['offset']+_0x2ad3c7[_0x692b('0x21')];var _0x24db42;if(_0x1f123f>=_0x464248){_0x1f123f=_0x464248;_0x24db42=0xc8;}else{_0x24db42=0xce;}_0xa70581[_0x692b('0x1c')](_0x24db42);return _0xa70581['set'](_0x692b('0x23'),_0x4b6465+'-'+_0x1f123f+'/'+_0x464248)['json'](_0x293dba);}return null;};}function patchUpdates(_0x4421e7){return function(_0x96a756){try{jsonpatch[_0x692b('0x24')](_0x96a756,_0x4421e7,!![]);}catch(_0x53dd22){return BPromise[_0x692b('0x25')](_0x53dd22);}return _0x96a756[_0x692b('0x26')]();};}function saveUpdates(_0x165021,_0x5ae1bf){return function(_0xe0096c){if(_0xe0096c){return _0xe0096c['update'](_0x165021)[_0x692b('0x27')](function(_0xdcfd95){return _0xdcfd95;});}return null;};}function removeEntity(_0x3b3747,_0x43f099){return function(_0x1eb6e8){if(_0x1eb6e8){return _0x1eb6e8[_0x692b('0x28')]()[_0x692b('0x27')](function(){_0x3b3747[_0x692b('0x1c')](0xcc)[_0x692b('0x1d')]();});}};}function handleEntityNotFound(_0x1863de,_0x3a1197){return function(_0x53d344){if(!_0x53d344){_0x1863de[_0x692b('0x1b')](0x194);}return _0x53d344;};}function handleError(_0x4e2c4a,_0x9b86fe){_0x9b86fe=_0x9b86fe||0x1f4;return function(_0x214466){logger[_0x692b('0x29')](_0x214466[_0x692b('0x2a')]);if(_0x214466[_0x692b('0x2b')]){delete _0x214466[_0x692b('0x2b')];}_0x4e2c4a[_0x692b('0x1c')](_0x9b86fe)[_0x692b('0x2c')](_0x214466);};}exports[_0x692b('0x2d')]=function(_0x4e4bd0,_0x740a06){var _0x45380e={},_0x22ce03={},_0x20b9f8={'count':0x0,'rows':[]};var _0x3abf2d=_[_0x692b('0x2e')](db[_0x692b('0x2f')][_0x692b('0x30')],function(_0x5d6a8f){return{'name':_0x5d6a8f[_0x692b('0x31')],'type':_0x5d6a8f[_0x692b('0x32')]['key']};});_0x22ce03[_0x692b('0x33')]=_[_0x692b('0x2e')](_0x3abf2d,'name');_0x22ce03[_0x692b('0x34')]=_[_0x692b('0x35')](_0x4e4bd0['query']);_0x22ce03[_0x692b('0x36')]=_[_0x692b('0x37')](_0x22ce03[_0x692b('0x33')],_0x22ce03['query']);_0x45380e[_0x692b('0x38')]=_['intersection'](_0x22ce03['model'],qs['fields'](_0x4e4bd0[_0x692b('0x34')][_0x692b('0x39')]));_0x45380e['attributes']=_0x45380e[_0x692b('0x38')]['length']?_0x45380e['attributes']:_0x22ce03[_0x692b('0x33')];if(!_0x4e4bd0[_0x692b('0x34')][_0x692b('0x3a')](_0x692b('0x3b'))){_0x45380e[_0x692b('0x21')]=qs[_0x692b('0x21')](_0x4e4bd0['query'][_0x692b('0x21')]);_0x45380e[_0x692b('0x1f')]=qs[_0x692b('0x1f')](_0x4e4bd0[_0x692b('0x34')]['offset']);}_0x45380e[_0x692b('0x3c')]=qs[_0x692b('0x3d')](_0x4e4bd0[_0x692b('0x34')][_0x692b('0x3d')]);_0x45380e[_0x692b('0x3e')]=qs[_0x692b('0x36')](_[_0x692b('0x3f')](_0x4e4bd0[_0x692b('0x34')],_0x22ce03[_0x692b('0x36')]),_0x3abf2d);if(_0x4e4bd0['query'][_0x692b('0x40')]){_0x45380e[_0x692b('0x3e')]=_['merge'](_0x45380e[_0x692b('0x3e')],{'$or':_['map'](_0x3abf2d,function(_0x5d504c){if(_0x5d504c['type']!=='VIRTUAL'){var _0x44435b={};_0x44435b[_0x5d504c[_0x692b('0x2b')]]={'$like':'%'+_0x4e4bd0['query']['filter']+'%'};return _0x44435b;}})});}_0x45380e=_['merge']({},_0x45380e,_0x4e4bd0[_0x692b('0x41')]);var _0x2ed72e={'where':_0x45380e[_0x692b('0x3e')]};return db[_0x692b('0x2f')]['count'](_0x2ed72e)['then'](function(_0x3d54a6){_0x20b9f8[_0x692b('0x22')]=_0x3d54a6;if(_0x4e4bd0[_0x692b('0x34')][_0x692b('0x42')]){_0x45380e[_0x692b('0x43')]=[{'all':!![]}];}return db[_0x692b('0x2f')]['findAll'](_0x45380e);})[_0x692b('0x27')](function(_0x1d008a){_0x20b9f8['rows']=_0x1d008a;return _0x20b9f8;})[_0x692b('0x27')](respondWithFilteredResult(_0x740a06,_0x45380e))[_0x692b('0x44')](handleError(_0x740a06,null));};exports[_0x692b('0x45')]=function(_0x6c039b,_0x5a7369){var _0x2b2d4b={'raw':![],'where':{'id':_0x6c039b[_0x692b('0x46')]['id']}},_0x5b3a0b={};_0x5b3a0b[_0x692b('0x33')]=_[_0x692b('0x35')](db[_0x692b('0x2f')][_0x692b('0x30')]);_0x5b3a0b[_0x692b('0x34')]=_[_0x692b('0x35')](_0x6c039b[_0x692b('0x34')]);_0x5b3a0b[_0x692b('0x36')]=_['intersection'](_0x5b3a0b[_0x692b('0x33')],_0x5b3a0b[_0x692b('0x34')]);_0x2b2d4b[_0x692b('0x38')]=_[_0x692b('0x37')](_0x5b3a0b['model'],qs[_0x692b('0x39')](_0x6c039b[_0x692b('0x34')][_0x692b('0x39')]));_0x2b2d4b[_0x692b('0x38')]=_0x2b2d4b[_0x692b('0x38')]['length']?_0x2b2d4b[_0x692b('0x38')]:_0x5b3a0b['model'];if(_0x6c039b[_0x692b('0x34')][_0x692b('0x42')]){_0x2b2d4b[_0x692b('0x43')]=[{'all':!![]}];}_0x2b2d4b=_[_0x692b('0x47')]({},_0x2b2d4b,_0x6c039b[_0x692b('0x41')]);return db[_0x692b('0x2f')][_0x692b('0x48')](_0x2b2d4b)[_0x692b('0x27')](handleEntityNotFound(_0x5a7369,null))[_0x692b('0x27')](respondWithResult(_0x5a7369,null))[_0x692b('0x44')](handleError(_0x5a7369,null));};exports[_0x692b('0x49')]=function(_0x4087ae,_0x1f0568){return db[_0x692b('0x2f')][_0x692b('0x49')](_0x4087ae['body'],{})['then'](respondWithResult(_0x1f0568,0xc9))[_0x692b('0x44')](handleError(_0x1f0568,null));};exports[_0x692b('0x4a')]=function(_0x329530,_0x843fa2){if(_0x329530[_0x692b('0x4b')]['id']){delete _0x329530[_0x692b('0x4b')]['id'];}return db[_0x692b('0x2f')][_0x692b('0x48')]({'where':{'id':_0x329530[_0x692b('0x46')]['id']}})[_0x692b('0x27')](handleEntityNotFound(_0x843fa2,null))[_0x692b('0x27')](saveUpdates(_0x329530[_0x692b('0x4b')],null))[_0x692b('0x27')](respondWithResult(_0x843fa2,null))[_0x692b('0x44')](handleError(_0x843fa2,null));};exports['destroy']=function(_0x1a5128,_0xc01252){return db[_0x692b('0x2f')][_0x692b('0x48')]({'where':{'id':_0x1a5128[_0x692b('0x46')]['id']}})[_0x692b('0x27')](handleEntityNotFound(_0xc01252,null))[_0x692b('0x27')](removeEntity(_0xc01252,null))[_0x692b('0x44')](handleError(_0xc01252,null));};exports[_0x692b('0x4c')]=function(_0x1fe918,_0xde23a7,_0x5c7841){var _0x3523d1={};var _0xaf1f37={};var _0x3bfab2;var _0x2614a1;return db[_0x692b('0x2f')][_0x692b('0x4d')]({'where':{'id':_0x1fe918[_0x692b('0x46')]['id']}})['then'](handleEntityNotFound(_0xde23a7,null))['then'](function(_0x484e08){if(_0x484e08){_0x3bfab2=_0x484e08;_0xaf1f37[_0x692b('0x33')]=_[_0x692b('0x35')](db[_0x692b('0x4e')][_0x692b('0x30')]);_0xaf1f37['query']=_[_0x692b('0x35')](_0x1fe918[_0x692b('0x34')]);_0xaf1f37[_0x692b('0x36')]=_[_0x692b('0x37')](_0xaf1f37[_0x692b('0x33')],_0xaf1f37[_0x692b('0x34')]);_0x3523d1[_0x692b('0x38')]=_[_0x692b('0x37')](_0xaf1f37['model'],qs[_0x692b('0x39')](_0x1fe918[_0x692b('0x34')]['fields']));_0x3523d1[_0x692b('0x38')]=_0x3523d1[_0x692b('0x38')][_0x692b('0x4f')]?_0x3523d1[_0x692b('0x38')]:_0xaf1f37['model'];_0x3523d1[_0x692b('0x3c')]=qs['sort'](_0x1fe918[_0x692b('0x34')][_0x692b('0x3d')]);_0x3523d1[_0x692b('0x3e')]=qs[_0x692b('0x36')](_[_0x692b('0x3f')](_0x1fe918[_0x692b('0x34')],_0xaf1f37[_0x692b('0x36')]));if(_0x1fe918[_0x692b('0x34')][_0x692b('0x40')]){_0x3523d1[_0x692b('0x3e')]=_[_0x692b('0x47')](_0x3523d1['where'],{'$or':_[_0x692b('0x2e')](_0x3523d1[_0x692b('0x38')],function(_0x506473){var _0x5602c6={};_0x5602c6[_0x506473]={'$like':'%'+_0x1fe918[_0x692b('0x34')][_0x692b('0x40')]+'%'};return _0x5602c6;})});}_0x3523d1=_[_0x692b('0x47')]({},_0x3523d1,_0x1fe918['options']);return _0x3bfab2['getConfigurations'](_0x3523d1);}})[_0x692b('0x27')](function(_0x32ce72){if(_0x32ce72){_0x2614a1=_0x32ce72[_0x692b('0x4f')];if(!_0x1fe918[_0x692b('0x34')]['hasOwnProperty'](_0x692b('0x3b'))){_0x3523d1[_0x692b('0x21')]=qs['limit'](_0x1fe918['query'][_0x692b('0x21')]);_0x3523d1[_0x692b('0x1f')]=qs[_0x692b('0x1f')](_0x1fe918['query'][_0x692b('0x1f')]);}return _0x3bfab2[_0x692b('0x4c')](_0x3523d1);}})['then'](function(_0x6e33b4){if(_0x6e33b4){return _0x6e33b4?{'count':_0x2614a1,'rows':_0x6e33b4}:null;}})[_0x692b('0x27')](respondWithResult(_0xde23a7,null))[_0x692b('0x44')](handleError(_0xde23a7,null));};exports[_0x692b('0x50')]=function(_0x2744d3,_0x1589cc,_0x2190dd){if(_0x2744d3[_0x692b('0x4b')]['id']){delete _0x2744d3[_0x692b('0x4b')]['id'];}return db[_0x692b('0x2f')][_0x692b('0x4d')]({'where':{'id':_0x2744d3['params']['id']}})[_0x692b('0x27')](handleEntityNotFound(_0x1589cc,null))[_0x692b('0x27')](function(_0x1f300f){if(_0x1f300f){_0x2744d3[_0x692b('0x4b')][_0x692b('0x51')]=_0x1f300f['id'];_0x2744d3[_0x692b('0x4b')][_0x692b('0x52')]=integrations['getSubjects'](_0x2744d3[_0x692b('0x4b')][_0x692b('0x53')],_0x2744d3[_0x692b('0x4b')]['type']);_0x2744d3[_0x692b('0x4b')][_0x692b('0x54')]=integrations['getDescriptions'](_0x2744d3[_0x692b('0x4b')][_0x692b('0x53')],_0x2744d3['body'][_0x692b('0x32')]);return db['SugarcrmConfiguration'][_0x692b('0x49')](_0x2744d3['body'],{'include':[{'model':db[_0x692b('0x55')],'as':_0x692b('0x52')},{'model':db[_0x692b('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1589cc,null))[_0x692b('0x44')](handleError(_0x1589cc,null));};exports[_0x692b('0x56')]=function(_0x4bd8af,_0x19349a,_0x193579){var _0x50080b='';var _0x527d59=['id',_0x692b('0x2b'),_0x692b('0x57'),_0x692b('0x58'),_0x692b('0x59'),_0x692b('0x5a'),_0x692b('0x5b'),_0x692b('0x5c'),'parent_id',_0x692b('0x5d'),_0x692b('0x5e'),_0x692b('0x5f')];return db[_0x692b('0x2f')]['findOne']({'where':{'id':_0x4bd8af[_0x692b('0x46')]['id']},'attributes':['id','username',_0x692b('0x60'),_0x692b('0x61')]})[_0x692b('0x27')](handleEntityNotFound(_0x19349a,null))[_0x692b('0x27')](function(_0x6d4853){if(_0x6d4853){_0x50080b=_0x6d4853[_0x692b('0x61')];var _0x1bfdc1=_0x50080b['slice'](-0x1);if(_0x1bfdc1==='/'){_0x50080b=_0x50080b['substring'](0x0,_0x50080b[_0x692b('0x62')](_0x1bfdc1));}return rp({'method':'POST','uri':util[_0x692b('0x63')]('%s%s',_0x50080b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x692b('0x64'),'input_type':_0x692b('0x65'),'response_type':_0x692b('0x65'),'rest_data':JSON[_0x692b('0x66')]({'user_auth':{'user_name':_0x6d4853[_0x692b('0x67')],'password':_0x6d4853['password'],'encryption':_0x692b('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x692b('0x27')](function(_0xc94ce2){if(_0xc94ce2&&_0xc94ce2[_0x692b('0x2b')]!==_0x692b('0x69')&&_0xc94ce2[_0x692b('0x2b')]!==_0x692b('0x6a')){return rp({'method':'POST','uri':util[_0x692b('0x63')]('%s%s',_0x50080b,_0x692b('0x6b')),'json':!![],'form':{'method':_0x692b('0x6c'),'input_type':_0x692b('0x65'),'response_type':_0x692b('0x65'),'rest_data':JSON[_0x692b('0x66')]({'session':_0xc94ce2['id'],'module_name':_0x692b('0x6d')})}})[_0x692b('0x27')](function(_0x2cbbf9){if(_0x2cbbf9){var _0x47c21c=_[_0x692b('0x6e')](_0x2cbbf9['module_fields']);_[_0x692b('0x6f')](_0x47c21c,function(_0x3f4668){return _0x527d59[_0x692b('0x70')](_0x3f4668['name']);});return{'count':_0x47c21c[_0x692b('0x4f')],'rows':_[_0x692b('0x2e')](_0x47c21c,function(_0x5a3bf6){return{'id':_0x5a3bf6[_0x692b('0x2b')],'name':_0x5a3bf6[_0x692b('0x71')],'custom':_[_0x692b('0x72')](_0x5a3bf6[_0x692b('0x2b')],'_c')?!![]:![],'options':_0x5a3bf6['options']?_[_0x692b('0x2e')](_[_0x692b('0x6e')](_0x5a3bf6[_0x692b('0x41')]),function(_0x21658e){return{'name':_0x21658e[_0x692b('0x73')],'value':_0x21658e['name']};}):[]};})};}})[_0x692b('0x27')](respondWithResult(_0x19349a,null))[_0x692b('0x44')](function(_0x49fa1f){var _0x38ef7c=_0x4bd8af[_0x692b('0x34')]['test']?0x1f4:_0x49fa1f[_0x692b('0x74')]||0x1f4;logger['error'](_0x692b('0x75'),_0x692b('0x56'),_0x38ef7c,JSON[_0x692b('0x66')](_0x49fa1f));delete _0x49fa1f[_0x692b('0x2b')];if(_0x38ef7c===0x191){_0x38ef7c=0x190;}_0x19349a[_0x692b('0x1c')](_0x38ef7c)[_0x692b('0x2c')](_0x4bd8af[_0x692b('0x34')]['test']?{'message':_0x692b('0x76'),'statusCode':_0x49fa1f['statusCode']}:_0x49fa1f);});}else{var _0x48a1fa=0x1f4;_0x19349a['status'](_0x48a1fa)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index a47594b..663a2e5 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 _0x2752=['exports','define','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0xd5848a,_0x4162a5){var _0x104762=function(_0x314879){while(--_0x314879){_0xd5848a['push'](_0xd5848a['shift']());}};_0x104762(++_0x4162a5);}(_0x2752,0x12b));var _0x2275=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2752[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2275('0x0'));var util=require('util');var logger=require(_0x2275('0x1'))('api');var moment=require(_0x2275('0x2'));var BPromise=require(_0x2275('0x3'));var rp=require(_0x2275('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2275('0x5'));var config=require(_0x2275('0x6'));var attributes=require(_0x2275('0x7'));var integrations=require(_0x2275('0x8'));module[_0x2275('0x9')]=function(_0x3bc1b9,_0x48e596){return _0x3bc1b9[_0x2275('0xa')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x464d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x464d,0x70));var _0xd464=function(_0x50bbd9,_0x3f7db2){_0x50bbd9=_0x50bbd9-0x0;var _0x408f6f=_0x464d[_0x50bbd9];return _0x408f6f;};'use strict';var _=require('lodash');var util=require(_0xd464('0x0'));var logger=require(_0xd464('0x1'))(_0xd464('0x2'));var moment=require(_0xd464('0x3'));var BPromise=require(_0xd464('0x4'));var rp=require(_0xd464('0x5'));var fs=require('fs');var path=require(_0xd464('0x6'));var rimraf=require(_0xd464('0x7'));var config=require(_0xd464('0x8'));var attributes=require(_0xd464('0x9'));var integrations=require(_0xd464('0xa'));module['exports']=function(_0x3f5c42,_0x4010b8){return _0x3f5c42[_0xd464('0xb')](_0xd464('0xc'),attributes,{'tableName':_0xd464('0xd'),'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 bb81030..f3f2ed0 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 _0x4e71=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e71,0x1c2));var _0x14e7=function(_0x598015,_0x4423db){_0x598015=_0x598015-0x0;var _0x44438c=_0x4e71[_0x598015];return _0x44438c;};'use strict';var _=require('lodash');var util=require(_0x14e7('0x0'));var moment=require(_0x14e7('0x1'));var BPromise=require(_0x14e7('0x2'));var rs=require(_0x14e7('0x3'));var fs=require('fs');var Redis=require(_0x14e7('0x4'));var db=require(_0x14e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x14e7('0x6'))('rpc');var config=require(_0x14e7('0x7'));var jayson=require(_0x14e7('0x8'));var client=jayson[_0x14e7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e372,_0x583d79,_0x3bab64){return new BPromise(function(_0x4918c4,_0x994997){return client['request'](_0x17e372,_0x3bab64)[_0x14e7('0xa')](function(_0x5409a7){logger[_0x14e7('0xb')](_0x14e7('0xc'),_0x583d79,_0x14e7('0xd'));logger[_0x14e7('0xe')](_0x14e7('0xf'),_0x583d79,'request\x20sent',JSON[_0x14e7('0x10')](_0x5409a7));if(_0x5409a7[_0x14e7('0x11')]){if(_0x5409a7[_0x14e7('0x11')][_0x14e7('0x12')]===0x1f4){logger[_0x14e7('0x11')](_0x14e7('0xc'),_0x583d79,_0x5409a7[_0x14e7('0x11')][_0x14e7('0x13')]);return _0x994997(_0x5409a7[_0x14e7('0x11')][_0x14e7('0x13')]);}logger[_0x14e7('0x11')](_0x14e7('0xc'),_0x583d79,_0x5409a7[_0x14e7('0x11')][_0x14e7('0x13')]);return _0x4918c4(_0x5409a7[_0x14e7('0x11')][_0x14e7('0x13')]);}else{logger['info'](_0x14e7('0xc'),_0x583d79,_0x14e7('0xd'));_0x4918c4(_0x5409a7[_0x14e7('0x14')][_0x14e7('0x13')]);}})[_0x14e7('0x15')](function(_0x5186f8){logger[_0x14e7('0x11')](_0x14e7('0xc'),_0x583d79,_0x5186f8);_0x994997(_0x5186f8);});});}exports[_0x14e7('0x16')]=function(_0x2e21cb){var _0x244e3e=this;return new Promise(function(_0x35fb9f,_0x29e975){return db['SugarcrmAccount'][_0x14e7('0x17')]({'raw':_0x2e21cb['options']?_0x2e21cb[_0x14e7('0x18')][_0x14e7('0x19')]===undefined?!![]:![]:!![],'where':_0x2e21cb[_0x14e7('0x18')]?_0x2e21cb['options'][_0x14e7('0x1a')]||null:null,'attributes':_0x2e21cb[_0x14e7('0x18')]?_0x2e21cb[_0x14e7('0x18')][_0x14e7('0x1b')]||null:null,'limit':_0x2e21cb[_0x14e7('0x18')]?_0x2e21cb[_0x14e7('0x18')][_0x14e7('0x1c')]||null:null,'include':_0x2e21cb[_0x14e7('0x18')]?_0x2e21cb[_0x14e7('0x18')][_0x14e7('0x1d')]?_[_0x14e7('0x1e')](_0x2e21cb[_0x14e7('0x18')][_0x14e7('0x1d')],function(_0x384e9f){return{'model':db[_0x384e9f[_0x14e7('0x1f')]],'as':_0x384e9f['as'],'attributes':_0x384e9f['attributes'],'include':_0x384e9f['include']?_[_0x14e7('0x1e')](_0x384e9f[_0x14e7('0x1d')],function(_0x208716){return{'model':db[_0x208716[_0x14e7('0x1f')]],'as':_0x208716['as'],'attributes':_0x208716[_0x14e7('0x1b')],'include':_0x208716[_0x14e7('0x1d')]?_[_0x14e7('0x1e')](_0x208716[_0x14e7('0x1d')],function(_0x279ac9){return{'model':db[_0x279ac9[_0x14e7('0x1f')]],'as':_0x279ac9['as'],'attributes':_0x279ac9[_0x14e7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x14e7('0xa')](function(_0x2beb00){logger[_0x14e7('0xb')](_0x14e7('0x16'),_0x2e21cb);logger['debug'](_0x14e7('0x16'),_0x2e21cb,JSON[_0x14e7('0x10')](_0x2beb00));_0x35fb9f(_0x2beb00);})[_0x14e7('0x15')](function(_0x516e30){logger['error']('GetSugarcrmAccount',_0x516e30[_0x14e7('0x13')],_0x2e21cb);_0x29e975(_0x244e3e[_0x14e7('0x11')](0x1f4,_0x516e30[_0x14e7('0x13')]));});});};exports[_0x14e7('0x20')]=function(_0xaa4067){var _0x52c111=this;return new Promise(function(_0x12e121,_0x3b17ee){return db['SugarcrmAccount']['find']({'raw':_0xaa4067[_0x14e7('0x18')]?_0xaa4067[_0x14e7('0x18')][_0x14e7('0x19')]===undefined?!![]:![]:!![],'where':_0xaa4067[_0x14e7('0x18')]?_0xaa4067[_0x14e7('0x18')]['where']||null:null,'attributes':_0xaa4067[_0x14e7('0x18')]?_0xaa4067['options'][_0x14e7('0x1b')]||null:null,'include':_0xaa4067['options']?_0xaa4067['options'][_0x14e7('0x1d')]?_[_0x14e7('0x1e')](_0xaa4067[_0x14e7('0x18')][_0x14e7('0x1d')],function(_0x3cdfb4){return{'model':db[_0x3cdfb4[_0x14e7('0x1f')]],'as':_0x3cdfb4['as'],'attributes':_0x3cdfb4[_0x14e7('0x1b')],'include':_0x3cdfb4[_0x14e7('0x1d')]?_[_0x14e7('0x1e')](_0x3cdfb4[_0x14e7('0x1d')],function(_0xd5da59){return{'model':db[_0xd5da59[_0x14e7('0x1f')]],'as':_0xd5da59['as'],'attributes':_0xd5da59[_0x14e7('0x1b')],'include':_0xd5da59[_0x14e7('0x1d')]?_['map'](_0xd5da59[_0x14e7('0x1d')],function(_0x4e138a){return{'model':db[_0x4e138a[_0x14e7('0x1f')]],'as':_0x4e138a['as'],'attributes':_0x4e138a['attributes']};}):[]};}):[]};}):[]:[]})[_0x14e7('0xa')](function(_0x5d786d){logger[_0x14e7('0xb')](_0x14e7('0x20'),_0xaa4067);logger[_0x14e7('0xe')](_0x14e7('0x20'),_0xaa4067,JSON[_0x14e7('0x10')](_0x5d786d));_0x12e121(_0x5d786d);})[_0x14e7('0x15')](function(_0xddc0ba){logger[_0x14e7('0x11')]('ShowSugarcrmAccount',_0xddc0ba[_0x14e7('0x13')],_0xaa4067);_0x3b17ee(_0x52c111[_0x14e7('0x11')](0x1f4,_0xddc0ba[_0x14e7('0x13')]));});});}; \ No newline at end of file +var _0xbb51=['info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','map','model','include','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0xbb51,0x13f));var _0x1bb5=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xbb51[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x1bb5('0x0'));var util=require(_0x1bb5('0x1'));var moment=require(_0x1bb5('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb5('0x3'));var fs=require('fs');var Redis=require(_0x1bb5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bb5('0x5'));var logger=require('../../config/logger')(_0x1bb5('0x6'));var config=require('../../config/environment');var jayson=require(_0x1bb5('0x7'));var client=jayson['client'][_0x1bb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e3079,_0x49dd17,_0x58413c){return new BPromise(function(_0x3f9708,_0x4d4714){return client[_0x1bb5('0x9')](_0x5e3079,_0x58413c)[_0x1bb5('0xa')](function(_0xb3cc63){logger[_0x1bb5('0xb')](_0x1bb5('0xc'),_0x49dd17,'request\x20sent');logger[_0x1bb5('0xd')](_0x1bb5('0xe'),_0x49dd17,_0x1bb5('0xf'),JSON[_0x1bb5('0x10')](_0xb3cc63));if(_0xb3cc63['error']){if(_0xb3cc63['error']['code']===0x1f4){logger[_0x1bb5('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x49dd17,_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);return _0x4d4714(_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);}logger[_0x1bb5('0x11')](_0x1bb5('0xc'),_0x49dd17,_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);return _0x3f9708(_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);}else{logger[_0x1bb5('0xb')](_0x1bb5('0xc'),_0x49dd17,_0x1bb5('0xf'));_0x3f9708(_0xb3cc63[_0x1bb5('0x13')][_0x1bb5('0x12')]);}})[_0x1bb5('0x14')](function(_0x58b658){logger['error'](_0x1bb5('0xc'),_0x49dd17,_0x58b658);_0x4d4714(_0x58b658);});});}exports[_0x1bb5('0x15')]=function(_0x44b55e){var _0x327def=this;return new Promise(function(_0x222f95,_0x23f3ef){return db['SugarcrmAccount']['findAll']({'raw':_0x44b55e[_0x1bb5('0x16')]?_0x44b55e['options'][_0x1bb5('0x17')]===undefined?!![]:![]:!![],'where':_0x44b55e[_0x1bb5('0x16')]?_0x44b55e[_0x1bb5('0x16')][_0x1bb5('0x18')]||null:null,'attributes':_0x44b55e[_0x1bb5('0x16')]?_0x44b55e[_0x1bb5('0x16')][_0x1bb5('0x19')]||null:null,'limit':_0x44b55e[_0x1bb5('0x16')]?_0x44b55e[_0x1bb5('0x16')][_0x1bb5('0x1a')]||null:null,'include':_0x44b55e[_0x1bb5('0x16')]?_0x44b55e[_0x1bb5('0x16')]['include']?_[_0x1bb5('0x1b')](_0x44b55e['options']['include'],function(_0x205ea8){return{'model':db[_0x205ea8[_0x1bb5('0x1c')]],'as':_0x205ea8['as'],'attributes':_0x205ea8[_0x1bb5('0x19')],'include':_0x205ea8[_0x1bb5('0x1d')]?_['map'](_0x205ea8[_0x1bb5('0x1d')],function(_0x4447a2){return{'model':db[_0x4447a2[_0x1bb5('0x1c')]],'as':_0x4447a2['as'],'attributes':_0x4447a2[_0x1bb5('0x19')],'include':_0x4447a2['include']?_[_0x1bb5('0x1b')](_0x4447a2['include'],function(_0x47b6fe){return{'model':db[_0x47b6fe[_0x1bb5('0x1c')]],'as':_0x47b6fe['as'],'attributes':_0x47b6fe[_0x1bb5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1bb5('0xa')](function(_0x867fcf){logger[_0x1bb5('0xb')]('GetSugarcrmAccount',_0x44b55e);logger['debug'](_0x1bb5('0x15'),_0x44b55e,JSON[_0x1bb5('0x10')](_0x867fcf));_0x222f95(_0x867fcf);})['catch'](function(_0x2c892b){logger[_0x1bb5('0x11')]('GetSugarcrmAccount',_0x2c892b['message'],_0x44b55e);_0x23f3ef(_0x327def[_0x1bb5('0x11')](0x1f4,_0x2c892b[_0x1bb5('0x12')]));});});};exports[_0x1bb5('0x1e')]=function(_0x37cc92){var _0x3322c9=this;return new Promise(function(_0x17cdbc,_0x7a1514){return db[_0x1bb5('0x1f')][_0x1bb5('0x20')]({'raw':_0x37cc92[_0x1bb5('0x16')]?_0x37cc92[_0x1bb5('0x16')][_0x1bb5('0x17')]===undefined?!![]:![]:!![],'where':_0x37cc92['options']?_0x37cc92[_0x1bb5('0x16')][_0x1bb5('0x18')]||null:null,'attributes':_0x37cc92[_0x1bb5('0x16')]?_0x37cc92[_0x1bb5('0x16')]['attributes']||null:null,'include':_0x37cc92[_0x1bb5('0x16')]?_0x37cc92[_0x1bb5('0x16')][_0x1bb5('0x1d')]?_[_0x1bb5('0x1b')](_0x37cc92[_0x1bb5('0x16')][_0x1bb5('0x1d')],function(_0xbe8697){return{'model':db[_0xbe8697[_0x1bb5('0x1c')]],'as':_0xbe8697['as'],'attributes':_0xbe8697[_0x1bb5('0x19')],'include':_0xbe8697[_0x1bb5('0x1d')]?_[_0x1bb5('0x1b')](_0xbe8697[_0x1bb5('0x1d')],function(_0x100d6b){return{'model':db[_0x100d6b['model']],'as':_0x100d6b['as'],'attributes':_0x100d6b[_0x1bb5('0x19')],'include':_0x100d6b[_0x1bb5('0x1d')]?_[_0x1bb5('0x1b')](_0x100d6b[_0x1bb5('0x1d')],function(_0x306036){return{'model':db[_0x306036[_0x1bb5('0x1c')]],'as':_0x306036['as'],'attributes':_0x306036['attributes']};}):[]};}):[]};}):[]:[]})[_0x1bb5('0xa')](function(_0x2cb8c8){logger['info'](_0x1bb5('0x1e'),_0x37cc92);logger[_0x1bb5('0xd')]('ShowSugarcrmAccount',_0x37cc92,JSON[_0x1bb5('0x10')](_0x2cb8c8));_0x17cdbc(_0x2cb8c8);})[_0x1bb5('0x14')](function(_0x1cf2ab){logger[_0x1bb5('0x11')](_0x1bb5('0x1e'),_0x1cf2ab[_0x1bb5('0x12')],_0x37cc92);_0x7a1514(_0x3322c9['error'](0x1f4,_0x1cf2ab[_0x1bb5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4114ec5..088e443 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 _0x163f=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x163f,0x6b));var _0xf163=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x163f[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var path=require(_0xf163('0x2'));var timeout=require(_0xf163('0x3'));var express=require(_0xf163('0x4'));var router=express[_0xf163('0x5')]();var fs_extra=require(_0xf163('0x6'));var auth=require(_0xf163('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf163('0x8'));var controller=require(_0xf163('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf163('0xa')]);router[_0xf163('0xb')](_0xf163('0xc'),auth[_0xf163('0xd')](),controller[_0xf163('0xe')]);router[_0xf163('0xb')](_0xf163('0xf'),auth[_0xf163('0xd')](),controller[_0xf163('0x10')]);router['get']('/:id/subjects',auth[_0xf163('0xd')](),controller[_0xf163('0x11')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf163('0x12')]);router[_0xf163('0x13')]('/',auth[_0xf163('0xd')](),controller[_0xf163('0x14')]);router[_0xf163('0x15')](_0xf163('0xc'),auth[_0xf163('0xd')](),controller[_0xf163('0x16')]);router[_0xf163('0x17')](_0xf163('0xc'),auth[_0xf163('0xd')](),controller[_0xf163('0x18')]);module[_0xf163('0x19')]=router; \ No newline at end of file +var _0x793c=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields'];(function(_0x4c2f83,_0xadd7bd){var _0x414773=function(_0x48aaa4){while(--_0x48aaa4){_0x4c2f83['push'](_0x4c2f83['shift']());}};_0x414773(++_0xadd7bd);}(_0x793c,0x1d6));var _0xc793=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x793c[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0xc793('0x0'));var util=require(_0xc793('0x1'));var path=require('path');var timeout=require(_0xc793('0x2'));var express=require(_0xc793('0x3'));var router=express[_0xc793('0x4')]();var fs_extra=require(_0xc793('0x5'));var auth=require(_0xc793('0x6'));var interaction=require(_0xc793('0x7'));var config=require(_0xc793('0x8'));var controller=require(_0xc793('0x9'));router[_0xc793('0xa')]('/',auth[_0xc793('0xb')](),controller[_0xc793('0xc')]);router[_0xc793('0xa')](_0xc793('0xd'),auth[_0xc793('0xb')](),controller['show']);router[_0xc793('0xa')](_0xc793('0xe'),auth['isAuthenticated'](),controller[_0xc793('0xf')]);router[_0xc793('0xa')](_0xc793('0x10'),auth[_0xc793('0xb')](),controller[_0xc793('0x11')]);router[_0xc793('0xa')](_0xc793('0x12'),auth[_0xc793('0xb')](),controller[_0xc793('0x13')]);router[_0xc793('0x14')]('/',auth['isAuthenticated'](),controller[_0xc793('0x15')]);router[_0xc793('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xc793('0x17')]);router[_0xc793('0x18')](_0xc793('0xd'),auth['isAuthenticated'](),controller[_0xc793('0x19')]);module[_0xc793('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 431c514..98cd448 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 _0x6c10=['exports','STRING'];(function(_0x594880,_0x17df86){var _0x31bab3=function(_0x517224){while(--_0x517224){_0x594880['push'](_0x594880['shift']());}};_0x31bab3(++_0x17df86);}(_0x6c10,0xf8));var _0x06c1=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x6c10[_0x27e811];return _0x1627fa;};'use strict';var Sequelize=require('sequelize');module[_0x06c1('0x0')]={'name':{'type':Sequelize[_0x06c1('0x1')]},'description':{'type':Sequelize[_0x06c1('0x1')]}}; \ No newline at end of file +var _0xf7d2=['exports','STRING','sequelize'];(function(_0xf40d11,_0xb4dd63){var _0x2c21c8=function(_0x14a2cc){while(--_0x14a2cc){_0xf40d11['push'](_0xf40d11['shift']());}};_0x2c21c8(++_0xb4dd63);}(_0xf7d2,0x107));var _0x2f7d=function(_0x4e4a38,_0x13b3a0){_0x4e4a38=_0x4e4a38-0x0;var _0x2fe004=_0xf7d2[_0x4e4a38];return _0x2fe004;};'use strict';var Sequelize=require(_0x2f7d('0x0'));module[_0x2f7d('0x1')]={'name':{'type':Sequelize[_0x2f7d('0x2')]},'description':{'type':Sequelize[_0x2f7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4ce5c17..afeb88a 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 _0xfb83=['getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','getFields','findOne','SugarcrmField','getSubjects'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xfb83,0x196));var _0x3fb8=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xfb83[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require(_0x3fb8('0x0'));var rimraf=require(_0x3fb8('0x1'));var zipdir=require(_0x3fb8('0x2'));var jsonpatch=require(_0x3fb8('0x3'));var rp=require('request-promise');var moment=require(_0x3fb8('0x4'));var BPromise=require(_0x3fb8('0x5'));var Mustache=require(_0x3fb8('0x6'));var util=require(_0x3fb8('0x7'));var path=require('path');var sox=require(_0x3fb8('0x8'));var csv=require(_0x3fb8('0x9'));var ejs=require(_0x3fb8('0xa'));var fs=require('fs');var fs_extra=require(_0x3fb8('0xb'));var _=require('lodash');var squel=require(_0x3fb8('0xc'));var crypto=require('crypto');var jsforce=require(_0x3fb8('0xd'));var deskjs=require(_0x3fb8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3fb8('0xf'));var Papa=require(_0x3fb8('0x10'));var Redis=require(_0x3fb8('0x11'));var authService=require(_0x3fb8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fb8('0x13'));var logger=require(_0x3fb8('0x14'))(_0x3fb8('0x15'));var utils=require(_0x3fb8('0x16'));var config=require(_0x3fb8('0x17'));var licenseUtil=require(_0x3fb8('0x18'));var db=require(_0x3fb8('0x19'))['db'];function respondWithStatusCode(_0x14180e,_0x5a6390){_0x5a6390=_0x5a6390||0xcc;return function(_0x26ede5){if(_0x26ede5){return _0x14180e['sendStatus'](_0x5a6390);}return _0x14180e[_0x3fb8('0x1a')](_0x5a6390)[_0x3fb8('0x1b')]();};}function respondWithResult(_0x1c91a7,_0x4065c8){_0x4065c8=_0x4065c8||0xc8;return function(_0x3ed75){if(_0x3ed75){return _0x1c91a7[_0x3fb8('0x1a')](_0x4065c8)[_0x3fb8('0x1c')](_0x3ed75);}};}function respondWithFilteredResult(_0x48a5ba,_0x63dc0){return function(_0x11d199){if(_0x11d199){var _0x207ab5=typeof _0x63dc0['offset']===_0x3fb8('0x1d')&&typeof _0x63dc0[_0x3fb8('0x1e')]===_0x3fb8('0x1d');var _0x250420=_0x11d199[_0x3fb8('0x1f')];var _0x609174=_0x207ab5?0x0:_0x63dc0[_0x3fb8('0x20')];var _0x37e5d5=_0x207ab5?_0x11d199[_0x3fb8('0x1f')]:_0x63dc0[_0x3fb8('0x20')]+_0x63dc0[_0x3fb8('0x1e')];var _0x4dd084;if(_0x37e5d5>=_0x250420){_0x37e5d5=_0x250420;_0x4dd084=0xc8;}else{_0x4dd084=0xce;}_0x48a5ba[_0x3fb8('0x1a')](_0x4dd084);return _0x48a5ba[_0x3fb8('0x21')](_0x3fb8('0x22'),_0x609174+'-'+_0x37e5d5+'/'+_0x250420)[_0x3fb8('0x1c')](_0x11d199);}return null;};}function patchUpdates(_0x39bc2f){return function(_0x2483ec){try{jsonpatch[_0x3fb8('0x23')](_0x2483ec,_0x39bc2f,!![]);}catch(_0x2c675a){return BPromise['reject'](_0x2c675a);}return _0x2483ec[_0x3fb8('0x24')]();};}function saveUpdates(_0xbce4ff,_0x2853fb){return function(_0x297c85){if(_0x297c85){return _0x297c85['update'](_0xbce4ff)[_0x3fb8('0x25')](function(_0x235a84){return _0x235a84;});}return null;};}function removeEntity(_0x17653f,_0x4cf03e){return function(_0x2b0e7f){if(_0x2b0e7f){return _0x2b0e7f['destroy']()[_0x3fb8('0x25')](function(){_0x17653f[_0x3fb8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb6e3,_0x5bb142){return function(_0x43f07f){if(!_0x43f07f){_0x4eb6e3[_0x3fb8('0x26')](0x194);}return _0x43f07f;};}function handleError(_0x4c61e6,_0x340337){_0x340337=_0x340337||0x1f4;return function(_0x1305fe){logger[_0x3fb8('0x27')](_0x1305fe[_0x3fb8('0x28')]);if(_0x1305fe[_0x3fb8('0x29')]){delete _0x1305fe[_0x3fb8('0x29')];}_0x4c61e6['status'](_0x340337)[_0x3fb8('0x2a')](_0x1305fe);};}exports['index']=function(_0x1682e8,_0x1e0fdf){var _0x52e925={},_0x2115db={},_0x189227={'count':0x0,'rows':[]};var _0xdd8d55=_[_0x3fb8('0x2b')](db[_0x3fb8('0x2c')][_0x3fb8('0x2d')],function(_0x45b60b){return{'name':_0x45b60b[_0x3fb8('0x2e')],'type':_0x45b60b[_0x3fb8('0x2f')]['key']};});_0x2115db[_0x3fb8('0x30')]=_['map'](_0xdd8d55,_0x3fb8('0x29'));_0x2115db['query']=_[_0x3fb8('0x31')](_0x1682e8[_0x3fb8('0x32')]);_0x2115db['filters']=_['intersection'](_0x2115db[_0x3fb8('0x30')],_0x2115db[_0x3fb8('0x32')]);_0x52e925['attributes']=_[_0x3fb8('0x33')](_0x2115db[_0x3fb8('0x30')],qs[_0x3fb8('0x34')](_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x34')]));_0x52e925['attributes']=_0x52e925[_0x3fb8('0x35')][_0x3fb8('0x36')]?_0x52e925['attributes']:_0x2115db[_0x3fb8('0x30')];if(!_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x37')](_0x3fb8('0x38'))){_0x52e925[_0x3fb8('0x1e')]=qs[_0x3fb8('0x1e')](_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x1e')]);_0x52e925['offset']=qs[_0x3fb8('0x20')](_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x20')]);}_0x52e925[_0x3fb8('0x39')]=qs[_0x3fb8('0x3a')](_0x1682e8[_0x3fb8('0x32')]['sort']);_0x52e925[_0x3fb8('0x3b')]=qs[_0x3fb8('0x3c')](_[_0x3fb8('0x3d')](_0x1682e8[_0x3fb8('0x32')],_0x2115db['filters']),_0xdd8d55);if(_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x3e')]){_0x52e925[_0x3fb8('0x3b')]=_[_0x3fb8('0x3f')](_0x52e925['where'],{'$or':_[_0x3fb8('0x2b')](_0xdd8d55,function(_0x1c64d3){if(_0x1c64d3[_0x3fb8('0x2f')]!==_0x3fb8('0x40')){var _0x452987={};_0x452987[_0x1c64d3[_0x3fb8('0x29')]]={'$like':'%'+_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x3e')]+'%'};return _0x452987;}})});}_0x52e925=_[_0x3fb8('0x3f')]({},_0x52e925,_0x1682e8[_0x3fb8('0x41')]);var _0x4e9056={'where':_0x52e925['where']};return db[_0x3fb8('0x2c')][_0x3fb8('0x1f')](_0x4e9056)['then'](function(_0x4918c5){_0x189227['count']=_0x4918c5;if(_0x1682e8[_0x3fb8('0x32')][_0x3fb8('0x42')]){_0x52e925[_0x3fb8('0x43')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x52e925);})[_0x3fb8('0x25')](function(_0x4b6c10){_0x189227[_0x3fb8('0x44')]=_0x4b6c10;return _0x189227;})[_0x3fb8('0x25')](respondWithFilteredResult(_0x1e0fdf,_0x52e925))['catch'](handleError(_0x1e0fdf,null));};exports[_0x3fb8('0x45')]=function(_0xda6ee8,_0x4fe58c){var _0x3bf397={'raw':![],'where':{'id':_0xda6ee8[_0x3fb8('0x46')]['id']}},_0x3ab038={};_0x3ab038[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](db[_0x3fb8('0x2c')][_0x3fb8('0x2d')]);_0x3ab038['query']=_[_0x3fb8('0x31')](_0xda6ee8[_0x3fb8('0x32')]);_0x3ab038[_0x3fb8('0x3c')]=_[_0x3fb8('0x33')](_0x3ab038[_0x3fb8('0x30')],_0x3ab038[_0x3fb8('0x32')]);_0x3bf397[_0x3fb8('0x35')]=_['intersection'](_0x3ab038[_0x3fb8('0x30')],qs[_0x3fb8('0x34')](_0xda6ee8[_0x3fb8('0x32')][_0x3fb8('0x34')]));_0x3bf397[_0x3fb8('0x35')]=_0x3bf397[_0x3fb8('0x35')][_0x3fb8('0x36')]?_0x3bf397[_0x3fb8('0x35')]:_0x3ab038[_0x3fb8('0x30')];if(_0xda6ee8[_0x3fb8('0x32')][_0x3fb8('0x42')]){_0x3bf397['include']=[{'all':!![]}];}_0x3bf397=_[_0x3fb8('0x3f')]({},_0x3bf397,_0xda6ee8[_0x3fb8('0x41')]);return db['SugarcrmConfiguration'][_0x3fb8('0x47')](_0x3bf397)['then'](handleEntityNotFound(_0x4fe58c,null))[_0x3fb8('0x25')](respondWithResult(_0x4fe58c,null))[_0x3fb8('0x48')](handleError(_0x4fe58c,null));};exports[_0x3fb8('0x49')]=function(_0x4adf21,_0x383dcf){return db[_0x3fb8('0x2c')][_0x3fb8('0x49')](_0x4adf21[_0x3fb8('0x4a')],{})[_0x3fb8('0x25')](respondWithResult(_0x383dcf,0xc9))['catch'](handleError(_0x383dcf,null));};exports['update']=function(_0x3aca29,_0x2af8fb){if(_0x3aca29[_0x3fb8('0x4a')]['id']){delete _0x3aca29[_0x3fb8('0x4a')]['id'];}return db[_0x3fb8('0x2c')][_0x3fb8('0x47')]({'where':{'id':_0x3aca29['params']['id']}})['then'](handleEntityNotFound(_0x2af8fb,null))[_0x3fb8('0x25')](saveUpdates(_0x3aca29[_0x3fb8('0x4a')],null))['then'](respondWithResult(_0x2af8fb,null))[_0x3fb8('0x48')](handleError(_0x2af8fb,null));};exports[_0x3fb8('0x4b')]=function(_0x526e7b,_0x1d8b0c){return db['SugarcrmConfiguration'][_0x3fb8('0x47')]({'where':{'id':_0x526e7b[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x25')](handleEntityNotFound(_0x1d8b0c,null))[_0x3fb8('0x25')](removeEntity(_0x1d8b0c,null))[_0x3fb8('0x48')](handleError(_0x1d8b0c,null));};exports[_0x3fb8('0x4c')]=function(_0x4617e4,_0x173c96,_0x308e1f){var _0xbc7993={};var _0x2c9f46={};var _0x5d79f3;var _0x411278;return db['SugarcrmConfiguration'][_0x3fb8('0x4d')]({'where':{'id':_0x4617e4[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x25')](handleEntityNotFound(_0x173c96,null))[_0x3fb8('0x25')](function(_0x4e981a){if(_0x4e981a){_0x5d79f3=_0x4e981a;_0x2c9f46[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](db[_0x3fb8('0x4e')]['rawAttributes']);_0x2c9f46[_0x3fb8('0x32')]=_[_0x3fb8('0x31')](_0x4617e4[_0x3fb8('0x32')]);_0x2c9f46['filters']=_[_0x3fb8('0x33')](_0x2c9f46['model'],_0x2c9f46[_0x3fb8('0x32')]);_0xbc7993[_0x3fb8('0x35')]=_[_0x3fb8('0x33')](_0x2c9f46[_0x3fb8('0x30')],qs['fields'](_0x4617e4[_0x3fb8('0x32')][_0x3fb8('0x34')]));_0xbc7993[_0x3fb8('0x35')]=_0xbc7993[_0x3fb8('0x35')][_0x3fb8('0x36')]?_0xbc7993[_0x3fb8('0x35')]:_0x2c9f46[_0x3fb8('0x30')];_0xbc7993['order']=qs[_0x3fb8('0x3a')](_0x4617e4[_0x3fb8('0x32')]['sort']);_0xbc7993[_0x3fb8('0x3b')]=qs[_0x3fb8('0x3c')](_[_0x3fb8('0x3d')](_0x4617e4[_0x3fb8('0x32')],_0x2c9f46[_0x3fb8('0x3c')]));if(_0x4617e4['query'][_0x3fb8('0x3e')]){_0xbc7993[_0x3fb8('0x3b')]=_[_0x3fb8('0x3f')](_0xbc7993['where'],{'$or':_[_0x3fb8('0x2b')](_0xbc7993[_0x3fb8('0x35')],function(_0x3abdd5){var _0x290145={};_0x290145[_0x3abdd5]={'$like':'%'+_0x4617e4[_0x3fb8('0x32')][_0x3fb8('0x3e')]+'%'};return _0x290145;})});}_0xbc7993=_[_0x3fb8('0x3f')]({},_0xbc7993,_0x4617e4['options']);return _0x5d79f3[_0x3fb8('0x4c')](_0xbc7993);}})['then'](function(_0x518e2d){if(_0x518e2d){_0x411278=_0x518e2d[_0x3fb8('0x36')];if(!_0x4617e4['query'][_0x3fb8('0x37')](_0x3fb8('0x38'))){_0xbc7993[_0x3fb8('0x1e')]=qs[_0x3fb8('0x1e')](_0x4617e4[_0x3fb8('0x32')][_0x3fb8('0x1e')]);_0xbc7993[_0x3fb8('0x20')]=qs['offset'](_0x4617e4['query'][_0x3fb8('0x20')]);}return _0x5d79f3[_0x3fb8('0x4c')](_0xbc7993);}})[_0x3fb8('0x25')](function(_0x4133a1){if(_0x4133a1){return _0x4133a1?{'count':_0x411278,'rows':_0x4133a1}:null;}})[_0x3fb8('0x25')](respondWithResult(_0x173c96,null))['catch'](handleError(_0x173c96,null));};exports['getSubjects']=function(_0x515cac,_0x31ce6c,_0x3583c5){var _0x432ad6={};var _0x55fbfa={};var _0x1880ca;var _0x19c876;return db[_0x3fb8('0x2c')]['findOne']({'where':{'id':_0x515cac[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x25')](handleEntityNotFound(_0x31ce6c,null))[_0x3fb8('0x25')](function(_0x47d2ef){if(_0x47d2ef){_0x1880ca=_0x47d2ef;_0x55fbfa[_0x3fb8('0x30')]=_[_0x3fb8('0x31')](db[_0x3fb8('0x4e')]['rawAttributes']);_0x55fbfa['query']=_[_0x3fb8('0x31')](_0x515cac[_0x3fb8('0x32')]);_0x55fbfa['filters']=_[_0x3fb8('0x33')](_0x55fbfa[_0x3fb8('0x30')],_0x55fbfa[_0x3fb8('0x32')]);_0x432ad6[_0x3fb8('0x35')]=_['intersection'](_0x55fbfa[_0x3fb8('0x30')],qs[_0x3fb8('0x34')](_0x515cac[_0x3fb8('0x32')]['fields']));_0x432ad6[_0x3fb8('0x35')]=_0x432ad6[_0x3fb8('0x35')][_0x3fb8('0x36')]?_0x432ad6[_0x3fb8('0x35')]:_0x55fbfa[_0x3fb8('0x30')];_0x432ad6[_0x3fb8('0x39')]=qs[_0x3fb8('0x3a')](_0x515cac['query']['sort']);_0x432ad6[_0x3fb8('0x3b')]=qs[_0x3fb8('0x3c')](_[_0x3fb8('0x3d')](_0x515cac[_0x3fb8('0x32')],_0x55fbfa[_0x3fb8('0x3c')]));if(_0x515cac[_0x3fb8('0x32')][_0x3fb8('0x3e')]){_0x432ad6[_0x3fb8('0x3b')]=_[_0x3fb8('0x3f')](_0x432ad6['where'],{'$or':_[_0x3fb8('0x2b')](_0x432ad6[_0x3fb8('0x35')],function(_0x3e7611){var _0x4468fd={};_0x4468fd[_0x3e7611]={'$like':'%'+_0x515cac['query'][_0x3fb8('0x3e')]+'%'};return _0x4468fd;})});}_0x432ad6=_[_0x3fb8('0x3f')]({},_0x432ad6,_0x515cac[_0x3fb8('0x41')]);return _0x1880ca[_0x3fb8('0x4f')](_0x432ad6);}})[_0x3fb8('0x25')](function(_0x5009cf){if(_0x5009cf){_0x19c876=_0x5009cf[_0x3fb8('0x36')];if(!_0x515cac[_0x3fb8('0x32')]['hasOwnProperty']('nolimit')){_0x432ad6[_0x3fb8('0x1e')]=qs[_0x3fb8('0x1e')](_0x515cac[_0x3fb8('0x32')][_0x3fb8('0x1e')]);_0x432ad6[_0x3fb8('0x20')]=qs[_0x3fb8('0x20')](_0x515cac['query'][_0x3fb8('0x20')]);}return _0x1880ca['getSubjects'](_0x432ad6);}})[_0x3fb8('0x25')](function(_0x5dc363){if(_0x5dc363){return _0x5dc363?{'count':_0x19c876,'rows':_0x5dc363}:null;}})['then'](respondWithResult(_0x31ce6c,null))[_0x3fb8('0x48')](handleError(_0x31ce6c,null));};exports[_0x3fb8('0x50')]=function(_0x11678a,_0x13155,_0x13340a){var _0x45a088={};var _0x56c6b9={};var _0x37d618;var _0x59f1d4;return db[_0x3fb8('0x2c')][_0x3fb8('0x4d')]({'where':{'id':_0x11678a[_0x3fb8('0x46')]['id']}})[_0x3fb8('0x25')](handleEntityNotFound(_0x13155,null))[_0x3fb8('0x25')](function(_0xb5159e){if(_0xb5159e){_0x37d618=_0xb5159e;_0x56c6b9[_0x3fb8('0x30')]=_['keys'](db[_0x3fb8('0x4e')][_0x3fb8('0x2d')]);_0x56c6b9[_0x3fb8('0x32')]=_[_0x3fb8('0x31')](_0x11678a['query']);_0x56c6b9[_0x3fb8('0x3c')]=_[_0x3fb8('0x33')](_0x56c6b9[_0x3fb8('0x30')],_0x56c6b9['query']);_0x45a088['attributes']=_[_0x3fb8('0x33')](_0x56c6b9['model'],qs[_0x3fb8('0x34')](_0x11678a[_0x3fb8('0x32')][_0x3fb8('0x34')]));_0x45a088['attributes']=_0x45a088[_0x3fb8('0x35')][_0x3fb8('0x36')]?_0x45a088[_0x3fb8('0x35')]:_0x56c6b9[_0x3fb8('0x30')];_0x45a088[_0x3fb8('0x39')]=qs[_0x3fb8('0x3a')](_0x11678a[_0x3fb8('0x32')][_0x3fb8('0x3a')]);_0x45a088['where']=qs[_0x3fb8('0x3c')](_[_0x3fb8('0x3d')](_0x11678a[_0x3fb8('0x32')],_0x56c6b9['filters']));if(_0x11678a[_0x3fb8('0x32')][_0x3fb8('0x3e')]){_0x45a088[_0x3fb8('0x3b')]=_[_0x3fb8('0x3f')](_0x45a088[_0x3fb8('0x3b')],{'$or':_[_0x3fb8('0x2b')](_0x45a088['attributes'],function(_0x5c6980){var _0x5b153e={};_0x5b153e[_0x5c6980]={'$like':'%'+_0x11678a['query']['filter']+'%'};return _0x5b153e;})});}_0x45a088=_['merge']({},_0x45a088,_0x11678a[_0x3fb8('0x41')]);return _0x37d618[_0x3fb8('0x50')](_0x45a088);}})[_0x3fb8('0x25')](function(_0x51358c){if(_0x51358c){_0x59f1d4=_0x51358c[_0x3fb8('0x36')];if(!_0x11678a[_0x3fb8('0x32')]['hasOwnProperty'](_0x3fb8('0x38'))){_0x45a088[_0x3fb8('0x1e')]=qs[_0x3fb8('0x1e')](_0x11678a[_0x3fb8('0x32')]['limit']);_0x45a088[_0x3fb8('0x20')]=qs[_0x3fb8('0x20')](_0x11678a[_0x3fb8('0x32')][_0x3fb8('0x20')]);}return _0x37d618[_0x3fb8('0x50')](_0x45a088);}})['then'](function(_0x35eada){if(_0x35eada){return _0x35eada?{'count':_0x59f1d4,'rows':_0x35eada}:null;}})['then'](respondWithResult(_0x13155,null))[_0x3fb8('0x48')](handleError(_0x13155,null));}; \ No newline at end of file +var _0x7774=['save','destroy','then','end','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','update','body','find','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x584b9d,_0x1cb5c5){var _0x172053=function(_0x5036ec){while(--_0x5036ec){_0x584b9d['push'](_0x584b9d['shift']());}};_0x172053(++_0x1cb5c5);}(_0x7774,0x1b7));var _0x4777=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x7774[_0x39ffd1];return _0x31267e;};'use strict';var emlformat=require(_0x4777('0x0'));var rimraf=require(_0x4777('0x1'));var zipdir=require(_0x4777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4777('0x3'));var moment=require(_0x4777('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4777('0x5'));var sox=require(_0x4777('0x6'));var csv=require(_0x4777('0x7'));var ejs=require(_0x4777('0x8'));var fs=require('fs');var fs_extra=require(_0x4777('0x9'));var _=require(_0x4777('0xa'));var squel=require('squel');var crypto=require(_0x4777('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4777('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4777('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4777('0xe'));var as=require(_0x4777('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4777('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4777('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4777('0x12'))['db'];function respondWithStatusCode(_0x25f96f,_0x43bbfa){_0x43bbfa=_0x43bbfa||0xcc;return function(_0x4f2c19){if(_0x4f2c19){return _0x25f96f[_0x4777('0x13')](_0x43bbfa);}return _0x25f96f[_0x4777('0x14')](_0x43bbfa)['end']();};}function respondWithResult(_0x2b933a,_0x3710e5){_0x3710e5=_0x3710e5||0xc8;return function(_0x17d3e5){if(_0x17d3e5){return _0x2b933a[_0x4777('0x14')](_0x3710e5)[_0x4777('0x15')](_0x17d3e5);}};}function respondWithFilteredResult(_0x40b902,_0x1b8919){return function(_0x4e2b38){if(_0x4e2b38){var _0xd095cb=typeof _0x1b8919[_0x4777('0x16')]==='undefined'&&typeof _0x1b8919['limit']==='undefined';var _0x19ee24=_0x4e2b38['count'];var _0x239a97=_0xd095cb?0x0:_0x1b8919[_0x4777('0x16')];var _0x29c42a=_0xd095cb?_0x4e2b38[_0x4777('0x17')]:_0x1b8919[_0x4777('0x16')]+_0x1b8919[_0x4777('0x18')];var _0x29fde4;if(_0x29c42a>=_0x19ee24){_0x29c42a=_0x19ee24;_0x29fde4=0xc8;}else{_0x29fde4=0xce;}_0x40b902[_0x4777('0x14')](_0x29fde4);return _0x40b902[_0x4777('0x19')](_0x4777('0x1a'),_0x239a97+'-'+_0x29c42a+'/'+_0x19ee24)[_0x4777('0x15')](_0x4e2b38);}return null;};}function patchUpdates(_0x4280fd){return function(_0x497434){try{jsonpatch[_0x4777('0x1b')](_0x497434,_0x4280fd,!![]);}catch(_0x24ec6a){return BPromise[_0x4777('0x1c')](_0x24ec6a);}return _0x497434[_0x4777('0x1d')]();};}function saveUpdates(_0xef56d8,_0x232830){return function(_0x363ec6){if(_0x363ec6){return _0x363ec6['update'](_0xef56d8)['then'](function(_0x411c45){return _0x411c45;});}return null;};}function removeEntity(_0x8b70fa,_0x41e4a1){return function(_0x5ca608){if(_0x5ca608){return _0x5ca608[_0x4777('0x1e')]()[_0x4777('0x1f')](function(){_0x8b70fa['status'](0xcc)[_0x4777('0x20')]();});}};}function handleEntityNotFound(_0x45ba11,_0x155100){return function(_0x40b6e1){if(!_0x40b6e1){_0x45ba11[_0x4777('0x13')](0x194);}return _0x40b6e1;};}function handleError(_0x414b6b,_0x43aa6d){_0x43aa6d=_0x43aa6d||0x1f4;return function(_0x5658bd){logger[_0x4777('0x21')](_0x5658bd[_0x4777('0x22')]);if(_0x5658bd[_0x4777('0x23')]){delete _0x5658bd[_0x4777('0x23')];}_0x414b6b[_0x4777('0x14')](_0x43aa6d)[_0x4777('0x24')](_0x5658bd);};}exports[_0x4777('0x25')]=function(_0x40b68f,_0x3333f3){var _0x5f37be={},_0x5c7965={},_0x26d072={'count':0x0,'rows':[]};var _0x1618cd=_[_0x4777('0x26')](db[_0x4777('0x27')][_0x4777('0x28')],function(_0x4369f8){return{'name':_0x4369f8[_0x4777('0x29')],'type':_0x4369f8[_0x4777('0x2a')][_0x4777('0x2b')]};});_0x5c7965[_0x4777('0x2c')]=_[_0x4777('0x26')](_0x1618cd,'name');_0x5c7965[_0x4777('0x2d')]=_[_0x4777('0x2e')](_0x40b68f[_0x4777('0x2d')]);_0x5c7965[_0x4777('0x2f')]=_[_0x4777('0x30')](_0x5c7965[_0x4777('0x2c')],_0x5c7965[_0x4777('0x2d')]);_0x5f37be[_0x4777('0x31')]=_[_0x4777('0x30')](_0x5c7965[_0x4777('0x2c')],qs['fields'](_0x40b68f['query'][_0x4777('0x32')]));_0x5f37be[_0x4777('0x31')]=_0x5f37be['attributes'][_0x4777('0x33')]?_0x5f37be['attributes']:_0x5c7965[_0x4777('0x2c')];if(!_0x40b68f[_0x4777('0x2d')][_0x4777('0x34')](_0x4777('0x35'))){_0x5f37be['limit']=qs[_0x4777('0x18')](_0x40b68f['query'][_0x4777('0x18')]);_0x5f37be[_0x4777('0x16')]=qs[_0x4777('0x16')](_0x40b68f[_0x4777('0x2d')][_0x4777('0x16')]);}_0x5f37be[_0x4777('0x36')]=qs[_0x4777('0x37')](_0x40b68f[_0x4777('0x2d')]['sort']);_0x5f37be[_0x4777('0x38')]=qs[_0x4777('0x2f')](_[_0x4777('0x39')](_0x40b68f[_0x4777('0x2d')],_0x5c7965[_0x4777('0x2f')]),_0x1618cd);if(_0x40b68f[_0x4777('0x2d')][_0x4777('0x3a')]){_0x5f37be['where']=_[_0x4777('0x3b')](_0x5f37be[_0x4777('0x38')],{'$or':_[_0x4777('0x26')](_0x1618cd,function(_0x114952){if(_0x114952['type']!==_0x4777('0x3c')){var _0x3b87f8={};_0x3b87f8[_0x114952[_0x4777('0x23')]]={'$like':'%'+_0x40b68f[_0x4777('0x2d')][_0x4777('0x3a')]+'%'};return _0x3b87f8;}})});}_0x5f37be=_['merge']({},_0x5f37be,_0x40b68f[_0x4777('0x3d')]);var _0x247cd8={'where':_0x5f37be[_0x4777('0x38')]};return db[_0x4777('0x27')][_0x4777('0x17')](_0x247cd8)['then'](function(_0x23370e){_0x26d072[_0x4777('0x17')]=_0x23370e;if(_0x40b68f['query'][_0x4777('0x3e')]){_0x5f37be[_0x4777('0x3f')]=[{'all':!![]}];}return db[_0x4777('0x27')][_0x4777('0x40')](_0x5f37be);})[_0x4777('0x1f')](function(_0x23a312){_0x26d072[_0x4777('0x41')]=_0x23a312;return _0x26d072;})[_0x4777('0x1f')](respondWithFilteredResult(_0x3333f3,_0x5f37be))['catch'](handleError(_0x3333f3,null));};exports[_0x4777('0x42')]=function(_0x508299,_0x2a7b39){var _0x4d97a2={'raw':![],'where':{'id':_0x508299['params']['id']}},_0x406e7a={};_0x406e7a['model']=_[_0x4777('0x2e')](db['SugarcrmConfiguration'][_0x4777('0x28')]);_0x406e7a[_0x4777('0x2d')]=_[_0x4777('0x2e')](_0x508299[_0x4777('0x2d')]);_0x406e7a[_0x4777('0x2f')]=_[_0x4777('0x30')](_0x406e7a[_0x4777('0x2c')],_0x406e7a[_0x4777('0x2d')]);_0x4d97a2['attributes']=_[_0x4777('0x30')](_0x406e7a['model'],qs[_0x4777('0x32')](_0x508299[_0x4777('0x2d')][_0x4777('0x32')]));_0x4d97a2[_0x4777('0x31')]=_0x4d97a2[_0x4777('0x31')][_0x4777('0x33')]?_0x4d97a2[_0x4777('0x31')]:_0x406e7a['model'];if(_0x508299[_0x4777('0x2d')]['includeAll']){_0x4d97a2['include']=[{'all':!![]}];}_0x4d97a2=_[_0x4777('0x3b')]({},_0x4d97a2,_0x508299[_0x4777('0x3d')]);return db[_0x4777('0x27')]['find'](_0x4d97a2)['then'](handleEntityNotFound(_0x2a7b39,null))[_0x4777('0x1f')](respondWithResult(_0x2a7b39,null))[_0x4777('0x43')](handleError(_0x2a7b39,null));};exports[_0x4777('0x44')]=function(_0x210d12,_0x4fbd72){return db[_0x4777('0x27')]['create'](_0x210d12['body'],{})[_0x4777('0x1f')](respondWithResult(_0x4fbd72,0xc9))[_0x4777('0x43')](handleError(_0x4fbd72,null));};exports[_0x4777('0x45')]=function(_0x1dbf10,_0x4a886e){if(_0x1dbf10[_0x4777('0x46')]['id']){delete _0x1dbf10[_0x4777('0x46')]['id'];}return db[_0x4777('0x27')][_0x4777('0x47')]({'where':{'id':_0x1dbf10[_0x4777('0x48')]['id']}})[_0x4777('0x1f')](handleEntityNotFound(_0x4a886e,null))[_0x4777('0x1f')](saveUpdates(_0x1dbf10[_0x4777('0x46')],null))['then'](respondWithResult(_0x4a886e,null))[_0x4777('0x43')](handleError(_0x4a886e,null));};exports[_0x4777('0x1e')]=function(_0x14e956,_0x151e76){return db[_0x4777('0x27')][_0x4777('0x47')]({'where':{'id':_0x14e956[_0x4777('0x48')]['id']}})['then'](handleEntityNotFound(_0x151e76,null))[_0x4777('0x1f')](removeEntity(_0x151e76,null))[_0x4777('0x43')](handleError(_0x151e76,null));};exports[_0x4777('0x49')]=function(_0x425456,_0x985fb2,_0x2dcb7a){var _0x3b36f6={};var _0x59addb={};var _0x32613c;var _0x1f6a8c;return db[_0x4777('0x27')][_0x4777('0x4a')]({'where':{'id':_0x425456[_0x4777('0x48')]['id']}})[_0x4777('0x1f')](handleEntityNotFound(_0x985fb2,null))[_0x4777('0x1f')](function(_0x21a30e){if(_0x21a30e){_0x32613c=_0x21a30e;_0x59addb[_0x4777('0x2c')]=_[_0x4777('0x2e')](db[_0x4777('0x4b')][_0x4777('0x28')]);_0x59addb['query']=_[_0x4777('0x2e')](_0x425456[_0x4777('0x2d')]);_0x59addb['filters']=_['intersection'](_0x59addb[_0x4777('0x2c')],_0x59addb[_0x4777('0x2d')]);_0x3b36f6[_0x4777('0x31')]=_[_0x4777('0x30')](_0x59addb[_0x4777('0x2c')],qs[_0x4777('0x32')](_0x425456[_0x4777('0x2d')][_0x4777('0x32')]));_0x3b36f6[_0x4777('0x31')]=_0x3b36f6['attributes'][_0x4777('0x33')]?_0x3b36f6['attributes']:_0x59addb[_0x4777('0x2c')];_0x3b36f6[_0x4777('0x36')]=qs[_0x4777('0x37')](_0x425456['query'][_0x4777('0x37')]);_0x3b36f6[_0x4777('0x38')]=qs[_0x4777('0x2f')](_[_0x4777('0x39')](_0x425456[_0x4777('0x2d')],_0x59addb[_0x4777('0x2f')]));if(_0x425456[_0x4777('0x2d')][_0x4777('0x3a')]){_0x3b36f6[_0x4777('0x38')]=_[_0x4777('0x3b')](_0x3b36f6['where'],{'$or':_[_0x4777('0x26')](_0x3b36f6[_0x4777('0x31')],function(_0x14c17a){var _0x259b29={};_0x259b29[_0x14c17a]={'$like':'%'+_0x425456['query']['filter']+'%'};return _0x259b29;})});}_0x3b36f6=_['merge']({},_0x3b36f6,_0x425456['options']);return _0x32613c[_0x4777('0x49')](_0x3b36f6);}})[_0x4777('0x1f')](function(_0x494049){if(_0x494049){_0x1f6a8c=_0x494049['length'];if(!_0x425456[_0x4777('0x2d')][_0x4777('0x34')]('nolimit')){_0x3b36f6['limit']=qs[_0x4777('0x18')](_0x425456[_0x4777('0x2d')]['limit']);_0x3b36f6[_0x4777('0x16')]=qs[_0x4777('0x16')](_0x425456['query']['offset']);}return _0x32613c[_0x4777('0x49')](_0x3b36f6);}})[_0x4777('0x1f')](function(_0x3d3d65){if(_0x3d3d65){return _0x3d3d65?{'count':_0x1f6a8c,'rows':_0x3d3d65}:null;}})['then'](respondWithResult(_0x985fb2,null))['catch'](handleError(_0x985fb2,null));};exports[_0x4777('0x4c')]=function(_0x5ca107,_0x55a1d0,_0x1de4e5){var _0x567631={};var _0x47492d={};var _0x4e66c5;var _0x393011;return db[_0x4777('0x27')][_0x4777('0x4a')]({'where':{'id':_0x5ca107['params']['id']}})['then'](handleEntityNotFound(_0x55a1d0,null))[_0x4777('0x1f')](function(_0x262c14){if(_0x262c14){_0x4e66c5=_0x262c14;_0x47492d[_0x4777('0x2c')]=_[_0x4777('0x2e')](db[_0x4777('0x4b')]['rawAttributes']);_0x47492d[_0x4777('0x2d')]=_[_0x4777('0x2e')](_0x5ca107[_0x4777('0x2d')]);_0x47492d[_0x4777('0x2f')]=_[_0x4777('0x30')](_0x47492d[_0x4777('0x2c')],_0x47492d['query']);_0x567631[_0x4777('0x31')]=_['intersection'](_0x47492d[_0x4777('0x2c')],qs[_0x4777('0x32')](_0x5ca107[_0x4777('0x2d')]['fields']));_0x567631[_0x4777('0x31')]=_0x567631[_0x4777('0x31')]['length']?_0x567631[_0x4777('0x31')]:_0x47492d[_0x4777('0x2c')];_0x567631[_0x4777('0x36')]=qs[_0x4777('0x37')](_0x5ca107[_0x4777('0x2d')][_0x4777('0x37')]);_0x567631['where']=qs[_0x4777('0x2f')](_['pick'](_0x5ca107[_0x4777('0x2d')],_0x47492d[_0x4777('0x2f')]));if(_0x5ca107['query'][_0x4777('0x3a')]){_0x567631[_0x4777('0x38')]=_[_0x4777('0x3b')](_0x567631[_0x4777('0x38')],{'$or':_[_0x4777('0x26')](_0x567631[_0x4777('0x31')],function(_0x56c61c){var _0x550bea={};_0x550bea[_0x56c61c]={'$like':'%'+_0x5ca107[_0x4777('0x2d')]['filter']+'%'};return _0x550bea;})});}_0x567631=_[_0x4777('0x3b')]({},_0x567631,_0x5ca107[_0x4777('0x3d')]);return _0x4e66c5[_0x4777('0x4c')](_0x567631);}})[_0x4777('0x1f')](function(_0x2b493f){if(_0x2b493f){_0x393011=_0x2b493f[_0x4777('0x33')];if(!_0x5ca107['query']['hasOwnProperty']('nolimit')){_0x567631[_0x4777('0x18')]=qs['limit'](_0x5ca107[_0x4777('0x2d')]['limit']);_0x567631[_0x4777('0x16')]=qs[_0x4777('0x16')](_0x5ca107[_0x4777('0x2d')][_0x4777('0x16')]);}return _0x4e66c5[_0x4777('0x4c')](_0x567631);}})[_0x4777('0x1f')](function(_0xc2e39f){if(_0xc2e39f){return _0xc2e39f?{'count':_0x393011,'rows':_0xc2e39f}:null;}})['then'](respondWithResult(_0x55a1d0,null))[_0x4777('0x43')](handleError(_0x55a1d0,null));};exports[_0x4777('0x4d')]=function(_0x59b54f,_0x1dd1b4,_0x152c3b){var _0x18d317={};var _0x7380b0={};var _0x3cbc3e;var _0x35292d;return db[_0x4777('0x27')]['findOne']({'where':{'id':_0x59b54f['params']['id']}})[_0x4777('0x1f')](handleEntityNotFound(_0x1dd1b4,null))[_0x4777('0x1f')](function(_0x50ebbf){if(_0x50ebbf){_0x3cbc3e=_0x50ebbf;_0x7380b0['model']=_[_0x4777('0x2e')](db[_0x4777('0x4b')][_0x4777('0x28')]);_0x7380b0[_0x4777('0x2d')]=_[_0x4777('0x2e')](_0x59b54f[_0x4777('0x2d')]);_0x7380b0['filters']=_[_0x4777('0x30')](_0x7380b0[_0x4777('0x2c')],_0x7380b0['query']);_0x18d317[_0x4777('0x31')]=_[_0x4777('0x30')](_0x7380b0[_0x4777('0x2c')],qs[_0x4777('0x32')](_0x59b54f[_0x4777('0x2d')][_0x4777('0x32')]));_0x18d317[_0x4777('0x31')]=_0x18d317[_0x4777('0x31')]['length']?_0x18d317[_0x4777('0x31')]:_0x7380b0[_0x4777('0x2c')];_0x18d317[_0x4777('0x36')]=qs[_0x4777('0x37')](_0x59b54f[_0x4777('0x2d')][_0x4777('0x37')]);_0x18d317['where']=qs['filters'](_[_0x4777('0x39')](_0x59b54f[_0x4777('0x2d')],_0x7380b0[_0x4777('0x2f')]));if(_0x59b54f[_0x4777('0x2d')][_0x4777('0x3a')]){_0x18d317[_0x4777('0x38')]=_[_0x4777('0x3b')](_0x18d317['where'],{'$or':_[_0x4777('0x26')](_0x18d317[_0x4777('0x31')],function(_0x50c875){var _0x43f0b7={};_0x43f0b7[_0x50c875]={'$like':'%'+_0x59b54f[_0x4777('0x2d')]['filter']+'%'};return _0x43f0b7;})});}_0x18d317=_[_0x4777('0x3b')]({},_0x18d317,_0x59b54f[_0x4777('0x3d')]);return _0x3cbc3e[_0x4777('0x4d')](_0x18d317);}})[_0x4777('0x1f')](function(_0x54d95d){if(_0x54d95d){_0x35292d=_0x54d95d[_0x4777('0x33')];if(!_0x59b54f['query'][_0x4777('0x34')]('nolimit')){_0x18d317[_0x4777('0x18')]=qs[_0x4777('0x18')](_0x59b54f[_0x4777('0x2d')][_0x4777('0x18')]);_0x18d317['offset']=qs[_0x4777('0x16')](_0x59b54f['query'][_0x4777('0x16')]);}return _0x3cbc3e[_0x4777('0x4d')](_0x18d317);}})['then'](function(_0x92e92d){if(_0x92e92d){return _0x92e92d?{'count':_0x35292d,'rows':_0x92e92d}:null;}})[_0x4777('0x1f')](respondWithResult(_0x1dd1b4,null))[_0x4777('0x43')](handleError(_0x1dd1b4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 0dbaac9..4fad8c6 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 _0x9364=['rimraf','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0x9364,0xe1));var _0x4936=function(_0x327010,_0x45de0e){_0x327010=_0x327010-0x0;var _0x2b1ca2=_0x9364[_0x327010];return _0x2b1ca2;};'use strict';var _=require(_0x4936('0x0'));var util=require(_0x4936('0x1'));var logger=require(_0x4936('0x2'))(_0x4936('0x3'));var moment=require('moment');var BPromise=require(_0x4936('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4936('0x5'));var config=require('../../config/environment');var attributes=require(_0x4936('0x6'));module[_0x4936('0x7')]=function(_0x132587,_0x386192){return _0x132587[_0x4936('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0x4936('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7b5=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','util','../../config/logger','moment','bluebird'];(function(_0x3ce988,_0x52809a){var _0x1d6bca=function(_0x3fff3f){while(--_0x3fff3f){_0x3ce988['push'](_0x3ce988['shift']());}};_0x1d6bca(++_0x52809a);}(_0xb7b5,0x75));var _0x5b7b=function(_0x41cac3,_0x26aadf){_0x41cac3=_0x41cac3-0x0;var _0x5b6ad9=_0xb7b5[_0x41cac3];return _0x5b6ad9;};'use strict';var _=require('lodash');var util=require(_0x5b7b('0x0'));var logger=require(_0x5b7b('0x1'))('api');var moment=require(_0x5b7b('0x2'));var BPromise=require(_0x5b7b('0x3'));var rp=require(_0x5b7b('0x4'));var fs=require('fs');var path=require(_0x5b7b('0x5'));var rimraf=require(_0x5b7b('0x6'));var config=require(_0x5b7b('0x7'));var attributes=require(_0x5b7b('0x8'));module['exports']=function(_0x4130da,_0x42351c){return _0x4130da[_0x5b7b('0x9')](_0x5b7b('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index f980ba3..1167862 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 _0x685c=['stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','info','request\x20sent'];(function(_0x15e43a,_0x3a20e3){var _0xa91cc7=function(_0x388dc7){while(--_0x388dc7){_0x15e43a['push'](_0x15e43a['shift']());}};_0xa91cc7(++_0x3a20e3);}(_0x685c,0xf6));var _0xc685=function(_0x4dc396,_0x5985ce){_0x4dc396=_0x4dc396-0x0;var _0x1d9e63=_0x685c[_0x4dc396];return _0x1d9e63;};'use strict';var _=require(_0xc685('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc685('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc685('0x2'));var db=require(_0xc685('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc685('0x4'))('rpc');var config=require(_0xc685('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc685('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4602e3,_0xb6fcc3,_0x29c6cf){return new BPromise(function(_0x58a1f9,_0x4bf1b5){return client[_0xc685('0x7')](_0x4602e3,_0x29c6cf)['then'](function(_0x4accd0){logger[_0xc685('0x8')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xb6fcc3,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xb6fcc3,_0xc685('0x9'),JSON[_0xc685('0xa')](_0x4accd0));if(_0x4accd0['error']){if(_0x4accd0[_0xc685('0xb')]['code']===0x1f4){logger['error'](_0xc685('0xc'),_0xb6fcc3,_0x4accd0[_0xc685('0xb')]['message']);return _0x4bf1b5(_0x4accd0[_0xc685('0xb')][_0xc685('0xd')]);}logger[_0xc685('0xb')](_0xc685('0xc'),_0xb6fcc3,_0x4accd0[_0xc685('0xb')][_0xc685('0xd')]);return _0x58a1f9(_0x4accd0[_0xc685('0xb')][_0xc685('0xd')]);}else{logger[_0xc685('0x8')](_0xc685('0xc'),_0xb6fcc3,_0xc685('0x9'));_0x58a1f9(_0x4accd0[_0xc685('0xe')][_0xc685('0xd')]);}})[_0xc685('0xf')](function(_0x3acc99){logger[_0xc685('0xb')](_0xc685('0xc'),_0xb6fcc3,_0x3acc99);_0x4bf1b5(_0x3acc99);});});} \ No newline at end of file +var _0x4169=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','catch','util','moment','randomstring'];(function(_0x3691d3,_0x5b302f){var _0x1b3e65=function(_0x1c017f){while(--_0x1c017f){_0x3691d3['push'](_0x3691d3['shift']());}};_0x1b3e65(++_0x5b302f);}(_0x4169,0x11b));var _0x9416=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4169[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9416('0x0'));var moment=require(_0x9416('0x1'));var BPromise=require('bluebird');var rs=require(_0x9416('0x2'));var fs=require('fs');var Redis=require(_0x9416('0x3'));var db=require(_0x9416('0x4'))['db'];var utils=require(_0x9416('0x5'));var logger=require(_0x9416('0x6'))(_0x9416('0x7'));var config=require('../../config/environment');var jayson=require(_0x9416('0x8'));var client=jayson[_0x9416('0x9')][_0x9416('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f735,_0x4b9c10,_0x5b31f0){return new BPromise(function(_0x848c51,_0xcc8ca1){return client[_0x9416('0xb')](_0x47f735,_0x5b31f0)[_0x9416('0xc')](function(_0x26ed8b){logger[_0x9416('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4b9c10,_0x9416('0xe'));logger['debug'](_0x9416('0xf'),_0x4b9c10,_0x9416('0xe'),JSON[_0x9416('0x10')](_0x26ed8b));if(_0x26ed8b[_0x9416('0x11')]){if(_0x26ed8b[_0x9416('0x11')][_0x9416('0x12')]===0x1f4){logger[_0x9416('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4b9c10,_0x26ed8b[_0x9416('0x11')][_0x9416('0x13')]);return _0xcc8ca1(_0x26ed8b[_0x9416('0x11')][_0x9416('0x13')]);}logger[_0x9416('0x11')](_0x9416('0x14'),_0x4b9c10,_0x26ed8b[_0x9416('0x11')][_0x9416('0x13')]);return _0x848c51(_0x26ed8b[_0x9416('0x11')][_0x9416('0x13')]);}else{logger[_0x9416('0xd')](_0x9416('0x14'),_0x4b9c10,'request\x20sent');_0x848c51(_0x26ed8b['result'][_0x9416('0x13')]);}})[_0x9416('0x15')](function(_0x5bbf1f){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4b9c10,_0x5bbf1f);_0xcc8ca1(_0x5bbf1f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 5d79502..44ac320 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 _0x0a12=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','post','create','put','/:id','update','delete','exports','util'];(function(_0x2cfd99,_0x2a97b7){var _0x3c4ba7=function(_0x4dd8e2){while(--_0x4dd8e2){_0x2cfd99['push'](_0x2cfd99['shift']());}};_0x3c4ba7(++_0x2a97b7);}(_0x0a12,0x1db));var _0x20a1=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0a12[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x20a1('0x0'));var path=require(_0x20a1('0x1'));var timeout=require(_0x20a1('0x2'));var express=require(_0x20a1('0x3'));var router=express[_0x20a1('0x4')]();var fs_extra=require(_0x20a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20a1('0x6'));var config=require('../../config/environment');var controller=require(_0x20a1('0x7'));router[_0x20a1('0x8')]('/',auth[_0x20a1('0x9')](),controller['index']);router[_0x20a1('0x8')]('/:id',auth[_0x20a1('0x9')](),controller['show']);router[_0x20a1('0xa')]('/',auth[_0x20a1('0x9')](),controller[_0x20a1('0xb')]);router[_0x20a1('0xc')](_0x20a1('0xd'),auth[_0x20a1('0x9')](),controller[_0x20a1('0xe')]);router[_0x20a1('0xf')](_0x20a1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x20a1('0x10')]=router; \ No newline at end of file +var _0xc35b=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x548af0,_0x2f9fd8){var _0x595aeb=function(_0x25ba45){while(--_0x25ba45){_0x548af0['push'](_0x548af0['shift']());}};_0x595aeb(++_0x2f9fd8);}(_0xc35b,0x71));var _0xbc35=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xc35b[_0x256b72];return _0x2183e3;};'use strict';var multer=require(_0xbc35('0x0'));var util=require(_0xbc35('0x1'));var path=require('path');var timeout=require(_0xbc35('0x2'));var express=require(_0xbc35('0x3'));var router=express['Router']();var fs_extra=require(_0xbc35('0x4'));var auth=require(_0xbc35('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xbc35('0x6')]('/',auth[_0xbc35('0x7')](),controller[_0xbc35('0x8')]);router[_0xbc35('0x6')](_0xbc35('0x9'),auth[_0xbc35('0x7')](),controller[_0xbc35('0xa')]);router['post']('/',auth[_0xbc35('0x7')](),controller[_0xbc35('0xb')]);router[_0xbc35('0xc')]('/:id',auth[_0xbc35('0x7')](),controller[_0xbc35('0xd')]);router[_0xbc35('0xe')](_0xbc35('0x9'),auth['isAuthenticated'](),controller[_0xbc35('0xf')]);module[_0xbc35('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7ab808e..e4a539f 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 _0x7394=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x5be00b,_0x154b5b){var _0x350ca7=function(_0x515a26){while(--_0x515a26){_0x5be00b['push'](_0x5be00b['shift']());}};_0x350ca7(++_0x154b5b);}(_0x7394,0xeb));var _0x4739=function(_0x168426,_0xae605){_0x168426=_0x168426-0x0;var _0x588116=_0x7394[_0x168426];return _0x588116;};'use strict';var Sequelize=require(_0x4739('0x0'));module[_0x4739('0x1')]={'type':{'type':Sequelize[_0x4739('0x2')](_0x4739('0x3'),_0x4739('0x4'),_0x4739('0x5'),'keyValue',_0x4739('0x6')),'defaultValue':_0x4739('0x3')},'content':{'type':Sequelize[_0x4739('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4739('0x3'),_0x4739('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4739('0x7')]},'idField':{'type':Sequelize[_0x4739('0x7')]},'nameField':{'type':Sequelize[_0x4739('0x7')]},'customField':{'type':Sequelize[_0x4739('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4739('0x7')]}}; \ No newline at end of file +var _0x8d23=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x4c2a48,_0xc76784){var _0x41b50c=function(_0x4cfec0){while(--_0x4cfec0){_0x4c2a48['push'](_0x4c2a48['shift']());}};_0x41b50c(++_0xc76784);}(_0x8d23,0x14c));var _0x38d2=function(_0x5085f5,_0x2ccc56){_0x5085f5=_0x5085f5-0x0;var _0x276f63=_0x8d23[_0x5085f5];return _0x276f63;};'use strict';var Sequelize=require('sequelize');module[_0x38d2('0x0')]={'type':{'type':Sequelize[_0x38d2('0x1')](_0x38d2('0x2'),_0x38d2('0x3'),_0x38d2('0x4'),_0x38d2('0x5'),_0x38d2('0x6')),'defaultValue':_0x38d2('0x2')},'content':{'type':Sequelize[_0x38d2('0x7')]},'key':{'type':Sequelize[_0x38d2('0x7')]},'keyType':{'type':Sequelize[_0x38d2('0x1')]('string',_0x38d2('0x3'),_0x38d2('0x4'))},'keyContent':{'type':Sequelize[_0x38d2('0x7')]},'idField':{'type':Sequelize[_0x38d2('0x7')]},'nameField':{'type':Sequelize[_0x38d2('0x7')]},'customField':{'type':Sequelize[_0x38d2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38d2('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5763758..08d4379 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 _0x37ac=['VIRTUAL','includeAll','include','rows','catch','show','keys','options','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','SugarcrmField','rawAttributes','type','intersection','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x37ac,0x179));var _0xc37a=function(_0x5c44c9,_0x1bb863){_0x5c44c9=_0x5c44c9-0x0;var _0x512bf0=_0x37ac[_0x5c44c9];return _0x512bf0;};'use strict';var emlformat=require(_0xc37a('0x0'));var rimraf=require(_0xc37a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc37a('0x2'));var moment=require(_0xc37a('0x3'));var BPromise=require(_0xc37a('0x4'));var Mustache=require(_0xc37a('0x5'));var util=require(_0xc37a('0x6'));var path=require(_0xc37a('0x7'));var sox=require('sox');var csv=require(_0xc37a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc37a('0x9'));var _=require('lodash');var squel=require(_0xc37a('0xa'));var crypto=require(_0xc37a('0xb'));var jsforce=require(_0xc37a('0xc'));var deskjs=require(_0xc37a('0xd'));var toCsv=require(_0xc37a('0x8'));var querystring=require(_0xc37a('0xe'));var Papa=require('papaparse');var Redis=require(_0xc37a('0xf'));var authService=require(_0xc37a('0x10'));var qs=require(_0xc37a('0x11'));var as=require(_0xc37a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc37a('0x13'))(_0xc37a('0x14'));var utils=require(_0xc37a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc37a('0x16'));var db=require(_0xc37a('0x17'))['db'];function respondWithStatusCode(_0x34a631,_0x4e4264){_0x4e4264=_0x4e4264||0xcc;return function(_0x2c2884){if(_0x2c2884){return _0x34a631[_0xc37a('0x18')](_0x4e4264);}return _0x34a631['status'](_0x4e4264)[_0xc37a('0x19')]();};}function respondWithResult(_0x40b47b,_0x47b61f){_0x47b61f=_0x47b61f||0xc8;return function(_0x3e4842){if(_0x3e4842){return _0x40b47b[_0xc37a('0x1a')](_0x47b61f)[_0xc37a('0x1b')](_0x3e4842);}};}function respondWithFilteredResult(_0x48f143,_0x48940e){return function(_0x33ae8){if(_0x33ae8){var _0x2e38da=typeof _0x48940e[_0xc37a('0x1c')]==='undefined'&&typeof _0x48940e[_0xc37a('0x1d')]===_0xc37a('0x1e');var _0x4a7b7a=_0x33ae8[_0xc37a('0x1f')];var _0x114748=_0x2e38da?0x0:_0x48940e[_0xc37a('0x1c')];var _0x321e2e=_0x2e38da?_0x33ae8[_0xc37a('0x1f')]:_0x48940e[_0xc37a('0x1c')]+_0x48940e[_0xc37a('0x1d')];var _0x727e95;if(_0x321e2e>=_0x4a7b7a){_0x321e2e=_0x4a7b7a;_0x727e95=0xc8;}else{_0x727e95=0xce;}_0x48f143['status'](_0x727e95);return _0x48f143[_0xc37a('0x20')](_0xc37a('0x21'),_0x114748+'-'+_0x321e2e+'/'+_0x4a7b7a)['json'](_0x33ae8);}return null;};}function patchUpdates(_0x2b1c49){return function(_0x40d91c){try{jsonpatch[_0xc37a('0x22')](_0x40d91c,_0x2b1c49,!![]);}catch(_0x34bde0){return BPromise[_0xc37a('0x23')](_0x34bde0);}return _0x40d91c[_0xc37a('0x24')]();};}function saveUpdates(_0xb60cad,_0x15abd8){return function(_0x2795d7){if(_0x2795d7){return _0x2795d7[_0xc37a('0x25')](_0xb60cad)[_0xc37a('0x26')](function(_0x1071dc){return _0x1071dc;});}return null;};}function removeEntity(_0x299209,_0x142a85){return function(_0x2d3c1b){if(_0x2d3c1b){return _0x2d3c1b[_0xc37a('0x27')]()[_0xc37a('0x26')](function(){_0x299209[_0xc37a('0x1a')](0xcc)[_0xc37a('0x19')]();});}};}function handleEntityNotFound(_0x34ce1a,_0x1ade8e){return function(_0x5e5d5a){if(!_0x5e5d5a){_0x34ce1a[_0xc37a('0x18')](0x194);}return _0x5e5d5a;};}function handleError(_0x3ee335,_0x1fa84c){_0x1fa84c=_0x1fa84c||0x1f4;return function(_0x4dce7d){logger[_0xc37a('0x28')](_0x4dce7d['stack']);if(_0x4dce7d[_0xc37a('0x29')]){delete _0x4dce7d['name'];}_0x3ee335[_0xc37a('0x1a')](_0x1fa84c)['send'](_0x4dce7d);};}exports[_0xc37a('0x2a')]=function(_0xbe47e4,_0x1dcc9b){var _0x3e9c91={},_0x27c895={},_0x2e5096={'count':0x0,'rows':[]};var _0x3db6fa=_[_0xc37a('0x2b')](db[_0xc37a('0x2c')][_0xc37a('0x2d')],function(_0x381dc8){return{'name':_0x381dc8['fieldName'],'type':_0x381dc8[_0xc37a('0x2e')]['key']};});_0x27c895['model']=_[_0xc37a('0x2b')](_0x3db6fa,_0xc37a('0x29'));_0x27c895['query']=_['keys'](_0xbe47e4['query']);_0x27c895['filters']=_[_0xc37a('0x2f')](_0x27c895[_0xc37a('0x30')],_0x27c895[_0xc37a('0x31')]);_0x3e9c91[_0xc37a('0x32')]=_[_0xc37a('0x2f')](_0x27c895[_0xc37a('0x30')],qs[_0xc37a('0x33')](_0xbe47e4[_0xc37a('0x31')][_0xc37a('0x33')]));_0x3e9c91[_0xc37a('0x32')]=_0x3e9c91[_0xc37a('0x32')][_0xc37a('0x34')]?_0x3e9c91['attributes']:_0x27c895[_0xc37a('0x30')];if(!_0xbe47e4['query']['hasOwnProperty'](_0xc37a('0x35'))){_0x3e9c91['limit']=qs[_0xc37a('0x1d')](_0xbe47e4[_0xc37a('0x31')][_0xc37a('0x1d')]);_0x3e9c91[_0xc37a('0x1c')]=qs[_0xc37a('0x1c')](_0xbe47e4['query'][_0xc37a('0x1c')]);}_0x3e9c91[_0xc37a('0x36')]=qs[_0xc37a('0x37')](_0xbe47e4[_0xc37a('0x31')][_0xc37a('0x37')]);_0x3e9c91['where']=qs[_0xc37a('0x38')](_[_0xc37a('0x39')](_0xbe47e4['query'],_0x27c895['filters']),_0x3db6fa);if(_0xbe47e4['query'][_0xc37a('0x3a')]){_0x3e9c91[_0xc37a('0x3b')]=_[_0xc37a('0x3c')](_0x3e9c91[_0xc37a('0x3b')],{'$or':_[_0xc37a('0x2b')](_0x3db6fa,function(_0x4fb990){if(_0x4fb990[_0xc37a('0x2e')]!==_0xc37a('0x3d')){var _0x5f5a45={};_0x5f5a45[_0x4fb990[_0xc37a('0x29')]]={'$like':'%'+_0xbe47e4[_0xc37a('0x31')][_0xc37a('0x3a')]+'%'};return _0x5f5a45;}})});}_0x3e9c91=_[_0xc37a('0x3c')]({},_0x3e9c91,_0xbe47e4['options']);var _0x4bcb98={'where':_0x3e9c91[_0xc37a('0x3b')]};return db[_0xc37a('0x2c')][_0xc37a('0x1f')](_0x4bcb98)['then'](function(_0x4335c2){_0x2e5096['count']=_0x4335c2;if(_0xbe47e4[_0xc37a('0x31')][_0xc37a('0x3e')]){_0x3e9c91[_0xc37a('0x3f')]=[{'all':!![]}];}return db[_0xc37a('0x2c')]['findAll'](_0x3e9c91);})[_0xc37a('0x26')](function(_0x31a777){_0x2e5096[_0xc37a('0x40')]=_0x31a777;return _0x2e5096;})['then'](respondWithFilteredResult(_0x1dcc9b,_0x3e9c91))[_0xc37a('0x41')](handleError(_0x1dcc9b,null));};exports[_0xc37a('0x42')]=function(_0x57be37,_0x4cbfe8){var _0x5c4f35={'raw':!![],'where':{'id':_0x57be37['params']['id']}},_0x1f7cf4={};_0x1f7cf4[_0xc37a('0x30')]=_['keys'](db['SugarcrmField'][_0xc37a('0x2d')]);_0x1f7cf4[_0xc37a('0x31')]=_[_0xc37a('0x43')](_0x57be37[_0xc37a('0x31')]);_0x1f7cf4[_0xc37a('0x38')]=_[_0xc37a('0x2f')](_0x1f7cf4[_0xc37a('0x30')],_0x1f7cf4[_0xc37a('0x31')]);_0x5c4f35[_0xc37a('0x32')]=_[_0xc37a('0x2f')](_0x1f7cf4[_0xc37a('0x30')],qs[_0xc37a('0x33')](_0x57be37[_0xc37a('0x31')][_0xc37a('0x33')]));_0x5c4f35['attributes']=_0x5c4f35[_0xc37a('0x32')][_0xc37a('0x34')]?_0x5c4f35[_0xc37a('0x32')]:_0x1f7cf4[_0xc37a('0x30')];if(_0x57be37[_0xc37a('0x31')]['includeAll']){_0x5c4f35[_0xc37a('0x3f')]=[{'all':!![]}];}_0x5c4f35=_[_0xc37a('0x3c')]({},_0x5c4f35,_0x57be37[_0xc37a('0x44')]);return db['SugarcrmField']['find'](_0x5c4f35)['then'](handleEntityNotFound(_0x4cbfe8,null))[_0xc37a('0x26')](respondWithResult(_0x4cbfe8,null))[_0xc37a('0x41')](handleError(_0x4cbfe8,null));};exports[_0xc37a('0x45')]=function(_0x2056c8,_0x40e1be){return db[_0xc37a('0x2c')]['create'](_0x2056c8[_0xc37a('0x46')],{})[_0xc37a('0x26')](respondWithResult(_0x40e1be,0xc9))[_0xc37a('0x41')](handleError(_0x40e1be,null));};exports[_0xc37a('0x25')]=function(_0x1a0157,_0x2d13ac){if(_0x1a0157[_0xc37a('0x46')]['id']){delete _0x1a0157[_0xc37a('0x46')]['id'];}return db['SugarcrmField'][_0xc37a('0x47')]({'where':{'id':_0x1a0157[_0xc37a('0x48')]['id']}})[_0xc37a('0x26')](handleEntityNotFound(_0x2d13ac,null))['then'](saveUpdates(_0x1a0157[_0xc37a('0x46')],null))[_0xc37a('0x26')](respondWithResult(_0x2d13ac,null))[_0xc37a('0x41')](handleError(_0x2d13ac,null));};exports[_0xc37a('0x27')]=function(_0x40caab,_0x49c858){return db[_0xc37a('0x2c')]['find']({'where':{'id':_0x40caab[_0xc37a('0x48')]['id']}})[_0xc37a('0x26')](handleEntityNotFound(_0x49c858,null))['then'](removeEntity(_0x49c858,null))[_0xc37a('0x41')](handleError(_0x49c858,null));}; \ No newline at end of file +var _0xbf0a=['create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SugarcrmField','include','findAll','rows','catch','show','params','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf0a,0xa3));var _0xabf0=function(_0x4e1301,_0x31d640){_0x4e1301=_0x4e1301-0x0;var _0x161d46=_0xbf0a[_0x4e1301];return _0x161d46;};'use strict';var emlformat=require(_0xabf0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabf0('0x1'));var jsonpatch=require(_0xabf0('0x2'));var rp=require(_0xabf0('0x3'));var moment=require(_0xabf0('0x4'));var BPromise=require(_0xabf0('0x5'));var Mustache=require(_0xabf0('0x6'));var util=require(_0xabf0('0x7'));var path=require(_0xabf0('0x8'));var sox=require(_0xabf0('0x9'));var csv=require(_0xabf0('0xa'));var ejs=require(_0xabf0('0xb'));var fs=require('fs');var fs_extra=require(_0xabf0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabf0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabf0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xabf0('0xf'));var Papa=require(_0xabf0('0x10'));var Redis=require(_0xabf0('0x11'));var authService=require(_0xabf0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xabf0('0x13'));var hardwareService=require(_0xabf0('0x14'));var logger=require('../../config/logger')(_0xabf0('0x15'));var utils=require(_0xabf0('0x16'));var config=require(_0xabf0('0x17'));var licenseUtil=require(_0xabf0('0x18'));var db=require(_0xabf0('0x19'))['db'];function respondWithStatusCode(_0xf2b904,_0x3ccdd2){_0x3ccdd2=_0x3ccdd2||0xcc;return function(_0x14a644){if(_0x14a644){return _0xf2b904[_0xabf0('0x1a')](_0x3ccdd2);}return _0xf2b904[_0xabf0('0x1b')](_0x3ccdd2)['end']();};}function respondWithResult(_0x5b805c,_0x5ba7f6){_0x5ba7f6=_0x5ba7f6||0xc8;return function(_0x50a06d){if(_0x50a06d){return _0x5b805c[_0xabf0('0x1b')](_0x5ba7f6)[_0xabf0('0x1c')](_0x50a06d);}};}function respondWithFilteredResult(_0x2b21d0,_0x157851){return function(_0x3249ee){if(_0x3249ee){var _0x2e0e31=typeof _0x157851[_0xabf0('0x1d')]===_0xabf0('0x1e')&&typeof _0x157851[_0xabf0('0x1f')]==='undefined';var _0x4aa40d=_0x3249ee['count'];var _0x5e22ec=_0x2e0e31?0x0:_0x157851[_0xabf0('0x1d')];var _0x462b08=_0x2e0e31?_0x3249ee[_0xabf0('0x20')]:_0x157851[_0xabf0('0x1d')]+_0x157851[_0xabf0('0x1f')];var _0x362d86;if(_0x462b08>=_0x4aa40d){_0x462b08=_0x4aa40d;_0x362d86=0xc8;}else{_0x362d86=0xce;}_0x2b21d0['status'](_0x362d86);return _0x2b21d0[_0xabf0('0x21')]('Content-Range',_0x5e22ec+'-'+_0x462b08+'/'+_0x4aa40d)['json'](_0x3249ee);}return null;};}function patchUpdates(_0x49c64c){return function(_0x5c422d){try{jsonpatch[_0xabf0('0x22')](_0x5c422d,_0x49c64c,!![]);}catch(_0x3e4f59){return BPromise[_0xabf0('0x23')](_0x3e4f59);}return _0x5c422d[_0xabf0('0x24')]();};}function saveUpdates(_0x5cfaa5,_0x2b643f){return function(_0x1b9d45){if(_0x1b9d45){return _0x1b9d45[_0xabf0('0x25')](_0x5cfaa5)[_0xabf0('0x26')](function(_0x3256d7){return _0x3256d7;});}return null;};}function removeEntity(_0x5a0536,_0x998f83){return function(_0x400184){if(_0x400184){return _0x400184[_0xabf0('0x27')]()[_0xabf0('0x26')](function(){_0x5a0536['status'](0xcc)[_0xabf0('0x28')]();});}};}function handleEntityNotFound(_0xf1600a,_0x2a4bbb){return function(_0x5e43fd){if(!_0x5e43fd){_0xf1600a['sendStatus'](0x194);}return _0x5e43fd;};}function handleError(_0x3352eb,_0x57193e){_0x57193e=_0x57193e||0x1f4;return function(_0x277e6d){logger[_0xabf0('0x29')](_0x277e6d[_0xabf0('0x2a')]);if(_0x277e6d[_0xabf0('0x2b')]){delete _0x277e6d['name'];}_0x3352eb['status'](_0x57193e)[_0xabf0('0x2c')](_0x277e6d);};}exports[_0xabf0('0x2d')]=function(_0x3ceae3,_0x1790ac){var _0x3c547f={},_0x1a9963={},_0x363a5e={'count':0x0,'rows':[]};var _0x1f6c8c=_[_0xabf0('0x2e')](db['SugarcrmField'][_0xabf0('0x2f')],function(_0x24977a){return{'name':_0x24977a[_0xabf0('0x30')],'type':_0x24977a['type'][_0xabf0('0x31')]};});_0x1a9963[_0xabf0('0x32')]=_[_0xabf0('0x2e')](_0x1f6c8c,'name');_0x1a9963[_0xabf0('0x33')]=_[_0xabf0('0x34')](_0x3ceae3['query']);_0x1a9963[_0xabf0('0x35')]=_['intersection'](_0x1a9963[_0xabf0('0x32')],_0x1a9963[_0xabf0('0x33')]);_0x3c547f[_0xabf0('0x36')]=_[_0xabf0('0x37')](_0x1a9963['model'],qs[_0xabf0('0x38')](_0x3ceae3[_0xabf0('0x33')]['fields']));_0x3c547f[_0xabf0('0x36')]=_0x3c547f['attributes'][_0xabf0('0x39')]?_0x3c547f['attributes']:_0x1a9963['model'];if(!_0x3ceae3[_0xabf0('0x33')][_0xabf0('0x3a')](_0xabf0('0x3b'))){_0x3c547f['limit']=qs['limit'](_0x3ceae3[_0xabf0('0x33')][_0xabf0('0x1f')]);_0x3c547f[_0xabf0('0x1d')]=qs[_0xabf0('0x1d')](_0x3ceae3[_0xabf0('0x33')][_0xabf0('0x1d')]);}_0x3c547f[_0xabf0('0x3c')]=qs[_0xabf0('0x3d')](_0x3ceae3[_0xabf0('0x33')][_0xabf0('0x3d')]);_0x3c547f[_0xabf0('0x3e')]=qs[_0xabf0('0x35')](_[_0xabf0('0x3f')](_0x3ceae3['query'],_0x1a9963['filters']),_0x1f6c8c);if(_0x3ceae3[_0xabf0('0x33')]['filter']){_0x3c547f[_0xabf0('0x3e')]=_[_0xabf0('0x40')](_0x3c547f[_0xabf0('0x3e')],{'$or':_[_0xabf0('0x2e')](_0x1f6c8c,function(_0x450288){if(_0x450288[_0xabf0('0x41')]!==_0xabf0('0x42')){var _0x100cd4={};_0x100cd4[_0x450288['name']]={'$like':'%'+_0x3ceae3[_0xabf0('0x33')][_0xabf0('0x43')]+'%'};return _0x100cd4;}})});}_0x3c547f=_[_0xabf0('0x40')]({},_0x3c547f,_0x3ceae3[_0xabf0('0x44')]);var _0x4a99b7={'where':_0x3c547f[_0xabf0('0x3e')]};return db[_0xabf0('0x45')]['count'](_0x4a99b7)[_0xabf0('0x26')](function(_0x4ca66c){_0x363a5e[_0xabf0('0x20')]=_0x4ca66c;if(_0x3ceae3[_0xabf0('0x33')]['includeAll']){_0x3c547f[_0xabf0('0x46')]=[{'all':!![]}];}return db[_0xabf0('0x45')][_0xabf0('0x47')](_0x3c547f);})[_0xabf0('0x26')](function(_0x2f60b1){_0x363a5e[_0xabf0('0x48')]=_0x2f60b1;return _0x363a5e;})[_0xabf0('0x26')](respondWithFilteredResult(_0x1790ac,_0x3c547f))[_0xabf0('0x49')](handleError(_0x1790ac,null));};exports[_0xabf0('0x4a')]=function(_0x26d5b6,_0x786f32){var _0x11327e={'raw':!![],'where':{'id':_0x26d5b6[_0xabf0('0x4b')]['id']}},_0x2f8b2b={};_0x2f8b2b[_0xabf0('0x32')]=_['keys'](db[_0xabf0('0x45')][_0xabf0('0x2f')]);_0x2f8b2b['query']=_[_0xabf0('0x34')](_0x26d5b6[_0xabf0('0x33')]);_0x2f8b2b[_0xabf0('0x35')]=_[_0xabf0('0x37')](_0x2f8b2b[_0xabf0('0x32')],_0x2f8b2b['query']);_0x11327e[_0xabf0('0x36')]=_[_0xabf0('0x37')](_0x2f8b2b[_0xabf0('0x32')],qs[_0xabf0('0x38')](_0x26d5b6[_0xabf0('0x33')][_0xabf0('0x38')]));_0x11327e[_0xabf0('0x36')]=_0x11327e[_0xabf0('0x36')][_0xabf0('0x39')]?_0x11327e[_0xabf0('0x36')]:_0x2f8b2b[_0xabf0('0x32')];if(_0x26d5b6[_0xabf0('0x33')][_0xabf0('0x4c')]){_0x11327e[_0xabf0('0x46')]=[{'all':!![]}];}_0x11327e=_['merge']({},_0x11327e,_0x26d5b6[_0xabf0('0x44')]);return db[_0xabf0('0x45')]['find'](_0x11327e)[_0xabf0('0x26')](handleEntityNotFound(_0x786f32,null))[_0xabf0('0x26')](respondWithResult(_0x786f32,null))[_0xabf0('0x49')](handleError(_0x786f32,null));};exports[_0xabf0('0x4d')]=function(_0x923df7,_0x42a5e1){return db[_0xabf0('0x45')][_0xabf0('0x4d')](_0x923df7[_0xabf0('0x4e')],{})[_0xabf0('0x26')](respondWithResult(_0x42a5e1,0xc9))[_0xabf0('0x49')](handleError(_0x42a5e1,null));};exports[_0xabf0('0x25')]=function(_0x7bc501,_0x3f888d){if(_0x7bc501[_0xabf0('0x4e')]['id']){delete _0x7bc501[_0xabf0('0x4e')]['id'];}return db['SugarcrmField'][_0xabf0('0x4f')]({'where':{'id':_0x7bc501[_0xabf0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f888d,null))[_0xabf0('0x26')](saveUpdates(_0x7bc501[_0xabf0('0x4e')],null))[_0xabf0('0x26')](respondWithResult(_0x3f888d,null))[_0xabf0('0x49')](handleError(_0x3f888d,null));};exports[_0xabf0('0x27')]=function(_0x199fb0,_0x49db64){return db['SugarcrmField'][_0xabf0('0x4f')]({'where':{'id':_0x199fb0[_0xabf0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49db64,null))[_0xabf0('0x26')](removeEntity(_0x49db64,null))['catch'](handleError(_0x49db64,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 3a13b05..1dedc8e 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 _0x41b9=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41b9,0x1ad));var _0x941b=function(_0x6004d5,_0x40978c){_0x6004d5=_0x6004d5-0x0;var _0x47667b=_0x41b9[_0x6004d5];return _0x47667b;};'use strict';var _=require(_0x941b('0x0'));var util=require(_0x941b('0x1'));var logger=require(_0x941b('0x2'))('api');var moment=require(_0x941b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x941b('0x4'));var rimraf=require(_0x941b('0x5'));var config=require(_0x941b('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x941b('0x7')]=function(_0xbd47a4,_0x2e8232){return _0xbd47a4['define'](_0x941b('0x8'),attributes,{'tableName':_0x941b('0x9'),'paranoid':![],'indexes':[{'name':_0x941b('0xa'),'fields':[_0x941b('0xb'),_0x941b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c82=['define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./intSugarcrmField.attributes','exports'];(function(_0x2c0278,_0x1e4b63){var _0x34dd90=function(_0x768af5){while(--_0x768af5){_0x2c0278['push'](_0x2c0278['shift']());}};_0x34dd90(++_0x1e4b63);}(_0x6c82,0x1d3));var _0x26c8=function(_0x2c7c93,_0x297b4d){_0x2c7c93=_0x2c7c93-0x0;var _0xf99c2d=_0x6c82[_0x2c7c93];return _0xf99c2d;};'use strict';var _=require(_0x26c8('0x0'));var util=require(_0x26c8('0x1'));var logger=require(_0x26c8('0x2'))(_0x26c8('0x3'));var moment=require(_0x26c8('0x4'));var BPromise=require('bluebird');var rp=require(_0x26c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x26c8('0x7'));module[_0x26c8('0x8')]=function(_0x3c4370,_0x346f86){return _0x3c4370[_0x26c8('0x9')]('SugarcrmField',attributes,{'tableName':_0x26c8('0xa'),'paranoid':![],'indexes':[{'name':_0x26c8('0xb'),'fields':[_0x26c8('0xc'),_0x26c8('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 77dfe0d..8c0072e 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 _0x7ceb=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5eb0bd,_0x659c4b){var _0x211c89=function(_0x39d9c1){while(--_0x39d9c1){_0x5eb0bd['push'](_0x5eb0bd['shift']());}};_0x211c89(++_0x659c4b);}(_0x7ceb,0xe8));var _0xb7ce=function(_0x42f956,_0x7f7300){_0x42f956=_0x42f956-0x0;var _0x2f8b0c=_0x7ceb[_0x42f956];return _0x2f8b0c;};'use strict';var _=require(_0xb7ce('0x0'));var util=require(_0xb7ce('0x1'));var moment=require(_0xb7ce('0x2'));var BPromise=require(_0xb7ce('0x3'));var rs=require(_0xb7ce('0x4'));var fs=require('fs');var Redis=require(_0xb7ce('0x5'));var db=require(_0xb7ce('0x6'))['db'];var utils=require(_0xb7ce('0x7'));var logger=require(_0xb7ce('0x8'))(_0xb7ce('0x9'));var config=require('../../config/environment');var jayson=require(_0xb7ce('0xa'));var client=jayson['client'][_0xb7ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fe093,_0x2fb59e,_0x334b5c){return new BPromise(function(_0x156cb3,_0x5a8879){return client[_0xb7ce('0xc')](_0x4fe093,_0x334b5c)[_0xb7ce('0xd')](function(_0x4edb63){logger['info'](_0xb7ce('0xe'),_0x2fb59e,_0xb7ce('0xf'));logger[_0xb7ce('0x10')](_0xb7ce('0x11'),_0x2fb59e,_0xb7ce('0xf'),JSON['stringify'](_0x4edb63));if(_0x4edb63[_0xb7ce('0x12')]){if(_0x4edb63['error'][_0xb7ce('0x13')]===0x1f4){logger[_0xb7ce('0x12')](_0xb7ce('0xe'),_0x2fb59e,_0x4edb63[_0xb7ce('0x12')][_0xb7ce('0x14')]);return _0x5a8879(_0x4edb63['error'][_0xb7ce('0x14')]);}logger['error'](_0xb7ce('0xe'),_0x2fb59e,_0x4edb63[_0xb7ce('0x12')][_0xb7ce('0x14')]);return _0x156cb3(_0x4edb63[_0xb7ce('0x12')][_0xb7ce('0x14')]);}else{logger[_0xb7ce('0x15')](_0xb7ce('0xe'),_0x2fb59e,_0xb7ce('0xf'));_0x156cb3(_0x4edb63['result'][_0xb7ce('0x14')]);}})[_0xb7ce('0x16')](function(_0x384f1d){logger[_0xb7ce('0x12')](_0xb7ce('0xe'),_0x2fb59e,_0x384f1d);_0x5a8879(_0x384f1d);});});} \ No newline at end of file +var _0x13c7=['bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x13c7,0x1ca));var _0x713c=function(_0x28d079,_0x1b4734){_0x28d079=_0x28d079-0x0;var _0x5601eb=_0x13c7[_0x28d079];return _0x5601eb;};'use strict';var _=require(_0x713c('0x0'));var util=require('util');var moment=require(_0x713c('0x1'));var BPromise=require(_0x713c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x713c('0x3'));var logger=require(_0x713c('0x4'))(_0x713c('0x5'));var config=require(_0x713c('0x6'));var jayson=require(_0x713c('0x7'));var client=jayson[_0x713c('0x8')][_0x713c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439af5,_0x522006,_0x208745){return new BPromise(function(_0x58ec90,_0x29ef64){return client[_0x713c('0xa')](_0x439af5,_0x208745)[_0x713c('0xb')](function(_0x902dad){logger[_0x713c('0xc')](_0x713c('0xd'),_0x522006,_0x713c('0xe'));logger[_0x713c('0xf')](_0x713c('0x10'),_0x522006,_0x713c('0xe'),JSON['stringify'](_0x902dad));if(_0x902dad[_0x713c('0x11')]){if(_0x902dad[_0x713c('0x11')][_0x713c('0x12')]===0x1f4){logger[_0x713c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x522006,_0x902dad[_0x713c('0x11')][_0x713c('0x13')]);return _0x29ef64(_0x902dad[_0x713c('0x11')][_0x713c('0x13')]);}logger[_0x713c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x522006,_0x902dad['error'][_0x713c('0x13')]);return _0x58ec90(_0x902dad[_0x713c('0x11')][_0x713c('0x13')]);}else{logger[_0x713c('0xc')](_0x713c('0xd'),_0x522006,_0x713c('0xe'));_0x58ec90(_0x902dad['result']['message']);}})['catch'](function(_0xe21088){logger[_0x713c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x522006,_0xe21088);_0x29ef64(_0xe21088);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 967312b..8ec2552 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 _0xc923=['exports','multer','util','path','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','delete'];(function(_0x2dfe00,_0x57632f){var _0x28ba33=function(_0x14cf25){while(--_0x14cf25){_0x2dfe00['push'](_0x2dfe00['shift']());}};_0x28ba33(++_0x57632f);}(_0xc923,0x1ef));var _0x3c92=function(_0x85dcf3,_0x51bc87){_0x85dcf3=_0x85dcf3-0x0;var _0x4a9bc0=_0xc923[_0x85dcf3];return _0x4a9bc0;};'use strict';var multer=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var path=require(_0x3c92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x3'));var config=require(_0x3c92('0x4'));var controller=require(_0x3c92('0x5'));router[_0x3c92('0x6')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0x8')]);router[_0x3c92('0x6')](_0x3c92('0x9'),auth[_0x3c92('0x7')](),controller['show']);router[_0x3c92('0x6')](_0x3c92('0xa'),auth[_0x3c92('0x7')](),controller[_0x3c92('0xb')]);router['get'](_0x3c92('0xc'),auth['isAuthenticated'](),controller[_0x3c92('0xd')]);router['post']('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0xe')]);router[_0x3c92('0xf')](_0x3c92('0xa'),auth[_0x3c92('0x7')](),controller[_0x3c92('0x10')]);router['put'](_0x3c92('0x9'),auth[_0x3c92('0x7')](),controller['update']);router[_0x3c92('0x11')](_0x3c92('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c92('0x12')]=router; \ No newline at end of file +var _0xc298=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc298,0x143));var _0x8c29=function(_0x13b88b,_0x35adaf){_0x13b88b=_0x13b88b-0x0;var _0x5e89ff=_0xc298[_0x13b88b];return _0x5e89ff;};'use strict';var multer=require('multer');var util=require(_0x8c29('0x0'));var path=require(_0x8c29('0x1'));var timeout=require(_0x8c29('0x2'));var express=require(_0x8c29('0x3'));var router=express[_0x8c29('0x4')]();var fs_extra=require(_0x8c29('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var controller=require(_0x8c29('0x8'));router[_0x8c29('0x9')]('/',auth[_0x8c29('0xa')](),controller['index']);router[_0x8c29('0x9')](_0x8c29('0xb'),auth[_0x8c29('0xa')](),controller[_0x8c29('0xc')]);router[_0x8c29('0x9')](_0x8c29('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x8c29('0xe'),auth[_0x8c29('0xa')](),controller[_0x8c29('0xf')]);router[_0x8c29('0x10')]('/',auth[_0x8c29('0xa')](),controller[_0x8c29('0x11')]);router[_0x8c29('0x10')](_0x8c29('0xd'),auth[_0x8c29('0xa')](),controller[_0x8c29('0x12')]);router[_0x8c29('0x13')](_0x8c29('0xb'),auth[_0x8c29('0xa')](),controller[_0x8c29('0x14')]);router[_0x8c29('0x15')](_0x8c29('0xb'),auth['isAuthenticated'](),controller[_0x8c29('0x16')]);module[_0x8c29('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 9cee289..d641e53 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 _0x18cb=['exports','STRING','sequelize'];(function(_0x3a4c07,_0x18440c){var _0x5a4943=function(_0x4afb24){while(--_0x4afb24){_0x3a4c07['push'](_0x3a4c07['shift']());}};_0x5a4943(++_0x18440c);}(_0x18cb,0x131));var _0xb18c=function(_0x207fa2,_0x4a05a8){_0x207fa2=_0x207fa2-0x0;var _0x5ce3e2=_0x18cb[_0x207fa2];return _0x5ce3e2;};'use strict';var Sequelize=require(_0xb18c('0x0'));module[_0xb18c('0x1')]={'name':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb18c('0x2')]},'username':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x359e=['sequelize','STRING'];(function(_0x321ad4,_0x4b17ce){var _0xe2f490=function(_0x4f27ab){while(--_0x4f27ab){_0x321ad4['push'](_0x321ad4['shift']());}};_0xe2f490(++_0x4b17ce);}(_0x359e,0x1ce));var _0xe359=function(_0x23e9ae,_0xb78a99){_0x23e9ae=_0x23e9ae-0x0;var _0x744c35=_0x359e[_0x23e9ae];return _0x744c35;};'use strict';var Sequelize=require(_0xe359('0x0'));module['exports']={'name':{'type':Sequelize[_0xe359('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe359('0x1')]},'username':{'type':Sequelize[_0xe359('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe359('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xe359('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe359('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 2deb3c0..fbb7cd3 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 _0x7e2a=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','keys','intersection','find','create','body','params','findOne','sort','map','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','moduleName','remoteUri','accessKey','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','startsWith','cf_','picklist','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x157cd5,_0x13f920){var _0x862eb=function(_0x40a084){while(--_0x40a084){_0x157cd5['push'](_0x157cd5['shift']());}};_0x862eb(++_0x13f920);}(_0x7e2a,0x15d));var _0xa7e2=function(_0x1bd845,_0x567d93){_0x1bd845=_0x1bd845-0x0;var _0x2257b3=_0x7e2a[_0x1bd845];return _0x2257b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7e2('0x0'));var zipdir=require(_0xa7e2('0x1'));var jsonpatch=require(_0xa7e2('0x2'));var rp=require(_0xa7e2('0x3'));var moment=require(_0xa7e2('0x4'));var BPromise=require(_0xa7e2('0x5'));var Mustache=require(_0xa7e2('0x6'));var util=require(_0xa7e2('0x7'));var path=require(_0xa7e2('0x8'));var sox=require(_0xa7e2('0x9'));var csv=require('to-csv');var ejs=require(_0xa7e2('0xa'));var fs=require('fs');var fs_extra=require(_0xa7e2('0xb'));var _=require(_0xa7e2('0xc'));var squel=require(_0xa7e2('0xd'));var crypto=require('crypto');var jsforce=require(_0xa7e2('0xe'));var deskjs=require(_0xa7e2('0xf'));var toCsv=require(_0xa7e2('0x10'));var querystring=require(_0xa7e2('0x11'));var Papa=require('papaparse');var Redis=require(_0xa7e2('0x12'));var authService=require(_0xa7e2('0x13'));var qs=require(_0xa7e2('0x14'));var as=require(_0xa7e2('0x15'));var hardwareService=require(_0xa7e2('0x16'));var logger=require(_0xa7e2('0x17'))(_0xa7e2('0x18'));var utils=require(_0xa7e2('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa7e2('0x1a'));var db=require(_0xa7e2('0x1b'))['db'];var integrations=require(_0xa7e2('0x1c'));function respondWithStatusCode(_0x40f79b,_0x3206cf){_0x3206cf=_0x3206cf||0xcc;return function(_0x666348){if(_0x666348){return _0x40f79b[_0xa7e2('0x1d')](_0x3206cf);}return _0x40f79b[_0xa7e2('0x1e')](_0x3206cf)[_0xa7e2('0x1f')]();};}function respondWithResult(_0x21e217,_0x2d024e){_0x2d024e=_0x2d024e||0xc8;return function(_0xd6a79a){if(_0xd6a79a){return _0x21e217['status'](_0x2d024e)[_0xa7e2('0x20')](_0xd6a79a);}};}function respondWithFilteredResult(_0x32f8bd,_0x2d1b97){return function(_0xefd15b){if(_0xefd15b){var _0x29191d=typeof _0x2d1b97[_0xa7e2('0x21')]===_0xa7e2('0x22')&&typeof _0x2d1b97['limit']===_0xa7e2('0x22');var _0x5c5369=_0xefd15b[_0xa7e2('0x23')];var _0x1692e1=_0x29191d?0x0:_0x2d1b97[_0xa7e2('0x21')];var _0x56cffd=_0x29191d?_0xefd15b[_0xa7e2('0x23')]:_0x2d1b97[_0xa7e2('0x21')]+_0x2d1b97[_0xa7e2('0x24')];var _0xd7b738;if(_0x56cffd>=_0x5c5369){_0x56cffd=_0x5c5369;_0xd7b738=0xc8;}else{_0xd7b738=0xce;}_0x32f8bd['status'](_0xd7b738);return _0x32f8bd['set'](_0xa7e2('0x25'),_0x1692e1+'-'+_0x56cffd+'/'+_0x5c5369)[_0xa7e2('0x20')](_0xefd15b);}return null;};}function patchUpdates(_0x29fcc6){return function(_0x5819dd){try{jsonpatch['apply'](_0x5819dd,_0x29fcc6,!![]);}catch(_0x270736){return BPromise['reject'](_0x270736);}return _0x5819dd[_0xa7e2('0x26')]();};}function saveUpdates(_0x13c5fc,_0x2be95d){return function(_0x32828f){if(_0x32828f){return _0x32828f[_0xa7e2('0x27')](_0x13c5fc)[_0xa7e2('0x28')](function(_0x336b27){return _0x336b27;});}return null;};}function removeEntity(_0x46d082,_0x54c3a4){return function(_0x5378a4){if(_0x5378a4){return _0x5378a4[_0xa7e2('0x29')]()[_0xa7e2('0x28')](function(){_0x46d082[_0xa7e2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217034,_0x3b5108){return function(_0x315519){if(!_0x315519){_0x217034[_0xa7e2('0x1d')](0x194);}return _0x315519;};}function handleError(_0x3dc1e5,_0x3bad15){_0x3bad15=_0x3bad15||0x1f4;return function(_0x191f7f){logger[_0xa7e2('0x2a')](_0x191f7f[_0xa7e2('0x2b')]);if(_0x191f7f[_0xa7e2('0x2c')]){delete _0x191f7f['name'];}_0x3dc1e5['status'](_0x3bad15)[_0xa7e2('0x2d')](_0x191f7f);};}exports[_0xa7e2('0x2e')]=function(_0x1b6504,_0xb66990){var _0x67b75={},_0x222ea4={},_0x131c87={'count':0x0,'rows':[]};var _0x249fb4=_['map'](db[_0xa7e2('0x2f')][_0xa7e2('0x30')],function(_0x225aa2){return{'name':_0x225aa2[_0xa7e2('0x31')],'type':_0x225aa2[_0xa7e2('0x32')][_0xa7e2('0x33')]};});_0x222ea4['model']=_['map'](_0x249fb4,_0xa7e2('0x2c'));_0x222ea4['query']=_['keys'](_0x1b6504[_0xa7e2('0x34')]);_0x222ea4[_0xa7e2('0x35')]=_['intersection'](_0x222ea4[_0xa7e2('0x36')],_0x222ea4[_0xa7e2('0x34')]);_0x67b75[_0xa7e2('0x37')]=_['intersection'](_0x222ea4[_0xa7e2('0x36')],qs[_0xa7e2('0x38')](_0x1b6504[_0xa7e2('0x34')][_0xa7e2('0x38')]));_0x67b75['attributes']=_0x67b75[_0xa7e2('0x37')][_0xa7e2('0x39')]?_0x67b75[_0xa7e2('0x37')]:_0x222ea4[_0xa7e2('0x36')];if(!_0x1b6504['query'][_0xa7e2('0x3a')]('nolimit')){_0x67b75[_0xa7e2('0x24')]=qs[_0xa7e2('0x24')](_0x1b6504[_0xa7e2('0x34')][_0xa7e2('0x24')]);_0x67b75[_0xa7e2('0x21')]=qs[_0xa7e2('0x21')](_0x1b6504[_0xa7e2('0x34')]['offset']);}_0x67b75[_0xa7e2('0x3b')]=qs['sort'](_0x1b6504[_0xa7e2('0x34')]['sort']);_0x67b75[_0xa7e2('0x3c')]=qs[_0xa7e2('0x35')](_[_0xa7e2('0x3d')](_0x1b6504['query'],_0x222ea4[_0xa7e2('0x35')]),_0x249fb4);if(_0x1b6504[_0xa7e2('0x34')][_0xa7e2('0x3e')]){_0x67b75[_0xa7e2('0x3c')]=_['merge'](_0x67b75[_0xa7e2('0x3c')],{'$or':_['map'](_0x249fb4,function(_0x10b2d8){if(_0x10b2d8[_0xa7e2('0x32')]!==_0xa7e2('0x3f')){var _0x20e809={};_0x20e809[_0x10b2d8[_0xa7e2('0x2c')]]={'$like':'%'+_0x1b6504[_0xa7e2('0x34')][_0xa7e2('0x3e')]+'%'};return _0x20e809;}})});}_0x67b75=_[_0xa7e2('0x40')]({},_0x67b75,_0x1b6504[_0xa7e2('0x41')]);var _0x5a418c={'where':_0x67b75[_0xa7e2('0x3c')]};return db[_0xa7e2('0x2f')][_0xa7e2('0x23')](_0x5a418c)[_0xa7e2('0x28')](function(_0x4554e2){_0x131c87[_0xa7e2('0x23')]=_0x4554e2;if(_0x1b6504[_0xa7e2('0x34')][_0xa7e2('0x42')]){_0x67b75[_0xa7e2('0x43')]=[{'all':!![]}];}return db[_0xa7e2('0x2f')]['findAll'](_0x67b75);})[_0xa7e2('0x28')](function(_0x5ac38d){_0x131c87['rows']=_0x5ac38d;return _0x131c87;})['then'](respondWithFilteredResult(_0xb66990,_0x67b75))[_0xa7e2('0x44')](handleError(_0xb66990,null));};exports[_0xa7e2('0x45')]=function(_0x412ae5,_0x345892){var _0x4a0810={'raw':![],'where':{'id':_0x412ae5['params']['id']}},_0x5ca2bf={};_0x5ca2bf[_0xa7e2('0x36')]=_[_0xa7e2('0x46')](db[_0xa7e2('0x2f')][_0xa7e2('0x30')]);_0x5ca2bf['query']=_['keys'](_0x412ae5[_0xa7e2('0x34')]);_0x5ca2bf[_0xa7e2('0x35')]=_['intersection'](_0x5ca2bf[_0xa7e2('0x36')],_0x5ca2bf[_0xa7e2('0x34')]);_0x4a0810[_0xa7e2('0x37')]=_[_0xa7e2('0x47')](_0x5ca2bf[_0xa7e2('0x36')],qs['fields'](_0x412ae5['query']['fields']));_0x4a0810[_0xa7e2('0x37')]=_0x4a0810[_0xa7e2('0x37')][_0xa7e2('0x39')]?_0x4a0810[_0xa7e2('0x37')]:_0x5ca2bf['model'];if(_0x412ae5[_0xa7e2('0x34')]['includeAll']){_0x4a0810[_0xa7e2('0x43')]=[{'all':!![]}];}_0x4a0810=_[_0xa7e2('0x40')]({},_0x4a0810,_0x412ae5[_0xa7e2('0x41')]);return db[_0xa7e2('0x2f')][_0xa7e2('0x48')](_0x4a0810)['then'](handleEntityNotFound(_0x345892,null))[_0xa7e2('0x28')](respondWithResult(_0x345892,null))[_0xa7e2('0x44')](handleError(_0x345892,null));};exports[_0xa7e2('0x49')]=function(_0x8fb123,_0x31bd31){return db[_0xa7e2('0x2f')][_0xa7e2('0x49')](_0x8fb123[_0xa7e2('0x4a')],{})[_0xa7e2('0x28')](respondWithResult(_0x31bd31,0xc9))[_0xa7e2('0x44')](handleError(_0x31bd31,null));};exports[_0xa7e2('0x27')]=function(_0x87419d,_0x28781c){if(_0x87419d[_0xa7e2('0x4a')]['id']){delete _0x87419d[_0xa7e2('0x4a')]['id'];}return db[_0xa7e2('0x2f')]['find']({'where':{'id':_0x87419d[_0xa7e2('0x4b')]['id']}})[_0xa7e2('0x28')](handleEntityNotFound(_0x28781c,null))['then'](saveUpdates(_0x87419d[_0xa7e2('0x4a')],null))['then'](respondWithResult(_0x28781c,null))[_0xa7e2('0x44')](handleError(_0x28781c,null));};exports[_0xa7e2('0x29')]=function(_0x59e596,_0x23f2d5){return db[_0xa7e2('0x2f')][_0xa7e2('0x48')]({'where':{'id':_0x59e596[_0xa7e2('0x4b')]['id']}})[_0xa7e2('0x28')](handleEntityNotFound(_0x23f2d5,null))[_0xa7e2('0x28')](removeEntity(_0x23f2d5,null))[_0xa7e2('0x44')](handleError(_0x23f2d5,null));};exports['getConfigurations']=function(_0x134175,_0x16af49,_0xae1bf7){var _0x5a0210={};var _0x5eb3f3={};var _0x27dbb3;var _0x1b8448;return db[_0xa7e2('0x2f')][_0xa7e2('0x4c')]({'where':{'id':_0x134175[_0xa7e2('0x4b')]['id']}})[_0xa7e2('0x28')](handleEntityNotFound(_0x16af49,null))['then'](function(_0x24db32){if(_0x24db32){_0x27dbb3=_0x24db32;_0x5eb3f3['model']=_[_0xa7e2('0x46')](db['VtigerConfiguration'][_0xa7e2('0x30')]);_0x5eb3f3[_0xa7e2('0x34')]=_['keys'](_0x134175[_0xa7e2('0x34')]);_0x5eb3f3[_0xa7e2('0x35')]=_[_0xa7e2('0x47')](_0x5eb3f3[_0xa7e2('0x36')],_0x5eb3f3[_0xa7e2('0x34')]);_0x5a0210[_0xa7e2('0x37')]=_[_0xa7e2('0x47')](_0x5eb3f3[_0xa7e2('0x36')],qs[_0xa7e2('0x38')](_0x134175[_0xa7e2('0x34')][_0xa7e2('0x38')]));_0x5a0210[_0xa7e2('0x37')]=_0x5a0210['attributes'][_0xa7e2('0x39')]?_0x5a0210[_0xa7e2('0x37')]:_0x5eb3f3[_0xa7e2('0x36')];_0x5a0210[_0xa7e2('0x3b')]=qs[_0xa7e2('0x4d')](_0x134175['query'][_0xa7e2('0x4d')]);_0x5a0210[_0xa7e2('0x3c')]=qs[_0xa7e2('0x35')](_[_0xa7e2('0x3d')](_0x134175[_0xa7e2('0x34')],_0x5eb3f3['filters']));if(_0x134175[_0xa7e2('0x34')][_0xa7e2('0x3e')]){_0x5a0210[_0xa7e2('0x3c')]=_['merge'](_0x5a0210[_0xa7e2('0x3c')],{'$or':_[_0xa7e2('0x4e')](_0x5a0210['attributes'],function(_0x3d6e4b){var _0x45a99c={};_0x45a99c[_0x3d6e4b]={'$like':'%'+_0x134175['query'][_0xa7e2('0x3e')]+'%'};return _0x45a99c;})});}_0x5a0210=_[_0xa7e2('0x40')]({},_0x5a0210,_0x134175['options']);return _0x27dbb3[_0xa7e2('0x4f')](_0x5a0210);}})[_0xa7e2('0x28')](function(_0x148675){if(_0x148675){_0x1b8448=_0x148675[_0xa7e2('0x39')];if(!_0x134175['query']['hasOwnProperty'](_0xa7e2('0x50'))){_0x5a0210['limit']=qs['limit'](_0x134175[_0xa7e2('0x34')]['limit']);_0x5a0210[_0xa7e2('0x21')]=qs[_0xa7e2('0x21')](_0x134175[_0xa7e2('0x34')][_0xa7e2('0x21')]);}return _0x27dbb3['getConfigurations'](_0x5a0210);}})['then'](function(_0xd67dc0){if(_0xd67dc0){return _0xd67dc0?{'count':_0x1b8448,'rows':_0xd67dc0}:null;}})[_0xa7e2('0x28')](respondWithResult(_0x16af49,null))[_0xa7e2('0x44')](handleError(_0x16af49,null));};exports[_0xa7e2('0x51')]=function(_0x155d84,_0x5cf3eb,_0x5a99b7){if(_0x155d84[_0xa7e2('0x4a')]['id']){delete _0x155d84[_0xa7e2('0x4a')]['id'];}return db[_0xa7e2('0x2f')][_0xa7e2('0x4c')]({'where':{'id':_0x155d84[_0xa7e2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5cf3eb,null))[_0xa7e2('0x28')](function(_0x2f2949){if(_0x2f2949){_0x155d84[_0xa7e2('0x4a')][_0xa7e2('0x52')]=_0x2f2949['id'];_0x155d84[_0xa7e2('0x4a')][_0xa7e2('0x53')]=integrations['getSubjects'](_0x155d84[_0xa7e2('0x4a')][_0xa7e2('0x54')],_0x155d84[_0xa7e2('0x4a')][_0xa7e2('0x32')]);_0x155d84[_0xa7e2('0x4a')]['Descriptions']=integrations[_0xa7e2('0x55')](_0x155d84[_0xa7e2('0x4a')]['channel'],_0x155d84[_0xa7e2('0x4a')][_0xa7e2('0x32')]);return db[_0xa7e2('0x56')][_0xa7e2('0x49')](_0x155d84[_0xa7e2('0x4a')],{'include':[{'model':db[_0xa7e2('0x57')],'as':_0xa7e2('0x53')},{'model':db[_0xa7e2('0x57')],'as':_0xa7e2('0x58')}]});}return null;})[_0xa7e2('0x28')](respondWithResult(_0x5cf3eb,null))['catch'](handleError(_0x5cf3eb,null));};var md5=require(_0xa7e2('0x59'));exports[_0xa7e2('0x5a')]=function(_0x50f14b,_0x146190,_0x329799){var _0x37d8f8=null;var _0x1dd817=null;var _0x3cc185=null;var _0x1f2cb2=null;var _0x5b3056='';return db['VtigerAccount']['findOne']({'where':{'id':_0x50f14b[_0xa7e2('0x4b')]['id']},'attributes':['id',_0xa7e2('0x2c'),_0xa7e2('0x5b'),'description',_0xa7e2('0x5c'),_0xa7e2('0x5d'),'serverUrl','accessKey']})[_0xa7e2('0x28')](handleEntityNotFound(_0x146190,null))[_0xa7e2('0x28')](function(_0x59c4fb){if(_0x59c4fb){_0x37d8f8=_0x59c4fb[_0xa7e2('0x5b')];_0x1dd817=_0x59c4fb[_0xa7e2('0x5e')];_0x3cc185=_0x59c4fb[_0xa7e2('0x5c')];_0x5b3056=_0x59c4fb[_0xa7e2('0x5d')];var _0x3559c0=_0x5b3056['slice'](-0x1);if(_0x3559c0==='/'){_0x5b3056=_0x5b3056['substring'](0x0,_0x5b3056[_0xa7e2('0x5f')](_0x3559c0));}_0x1f2cb2=util[_0xa7e2('0x60')](_0xa7e2('0x61'),_0x5b3056);var _0x185f36={'method':_0xa7e2('0x62'),'uri':_0x1f2cb2,'qs':{'operation':_0xa7e2('0x63'),'username':_0x59c4fb[_0xa7e2('0x5b')]},'json':!![]};return rp(_0x185f36);}})[_0xa7e2('0x28')](function(_0x3d79b7){if(_0x3d79b7[_0xa7e2('0x64')]){var _0x165293={'method':_0xa7e2('0x65'),'uri':_0x1f2cb2,'form':{'operation':_0xa7e2('0x66'),'username':_0x37d8f8,'accessKey':md5(_0x3d79b7[_0xa7e2('0x67')][_0xa7e2('0x68')]+_0x1dd817)},'json':!![]};return rp(_0x165293);}})[_0xa7e2('0x28')](function(_0x22d3e0){if(_0x22d3e0['success']){var _0x4189f4={'method':'GET','uri':_0x1f2cb2,'qs':{'operation':_0xa7e2('0x69'),'username':_0x37d8f8,'sessionName':_0x22d3e0[_0xa7e2('0x67')][_0xa7e2('0x6a')],'elementType':_0x3cc185},'json':!![]};return rp(_0x4189f4);}})[_0xa7e2('0x28')](function(_0x189627){if(_0x189627['success']){var _0x46d15c=[_0xa7e2('0x6b'),_0xa7e2('0x6c'),_0xa7e2('0x6d')];_[_0xa7e2('0x6e')](_0x189627[_0xa7e2('0x67')][_0xa7e2('0x38')],function(_0x4e5185){return _0x46d15c['includes'](_0x4e5185[_0xa7e2('0x32')][_0xa7e2('0x2c')]);});_['remove'](_0x189627['result']['fields'],function(_0x13bccb){return _0x13bccb[_0xa7e2('0x6f')]==='false';});return{'count':_0x189627[_0xa7e2('0x67')][_0xa7e2('0x38')]['length'],'rows':_[_0xa7e2('0x4e')](_0x189627['result'][_0xa7e2('0x38')],function(_0x4066a2){return{'id':_0x4066a2['name'],'name':_0x4066a2['label'],'custom':_[_0xa7e2('0x70')](_0x4066a2[_0xa7e2('0x2c')],_0xa7e2('0x71'))?!![]:![],'options':_0x4066a2[_0xa7e2('0x32')][_0xa7e2('0x2c')]===_0xa7e2('0x72')&&_0x4066a2[_0xa7e2('0x32')]['picklistValues'][_0xa7e2('0x39')]>0x0?_[_0xa7e2('0x4e')](_0x4066a2[_0xa7e2('0x32')]['picklistValues'],function(_0x12e728){return{'name':_0x12e728['label'],'value':_0x12e728[_0xa7e2('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x146190,null))[_0xa7e2('0x44')](function(_0x5711ce){console[_0xa7e2('0x74')](_0xa7e2('0x75')+_0x5711ce);var _0x190fe2=_0x50f14b[_0xa7e2('0x34')][_0xa7e2('0x76')]?0x1f4:_0x5711ce[_0xa7e2('0x77')]||0x1f4;logger[_0xa7e2('0x2a')](_0xa7e2('0x78'),_0xa7e2('0x5a'),_0x190fe2,JSON['stringify'](_0x5711ce));delete _0x5711ce[_0xa7e2('0x2c')];if(_0x190fe2===0x191){_0x190fe2=0x190;}_0x146190[_0xa7e2('0x1e')](_0x190fe2)[_0xa7e2('0x2d')](_0x50f14b[_0xa7e2('0x34')][_0xa7e2('0x76')]?{'message':_0xa7e2('0x79'),'statusCode':_0x5711ce['statusCode']}:_0x5711ce);});}; \ No newline at end of file +var _0x9656=['autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','VtigerAccount','rawAttributes','type','key','model','map','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','intersection','length','includeAll','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','username','accessKey','slice','substring','success','login','result','token','GET','describe'];(function(_0x215c73,_0x272244){var _0x3287b2=function(_0x59c9bc){while(--_0x59c9bc){_0x215c73['push'](_0x215c73['shift']());}};_0x3287b2(++_0x272244);}(_0x9656,0x8d));var _0x6965=function(_0x2f5d1e,_0x1c6993){_0x2f5d1e=_0x2f5d1e-0x0;var _0x33760c=_0x9656[_0x2f5d1e];return _0x33760c;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6965('0x1'));var jsonpatch=require(_0x6965('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6965('0x3'));var Mustache=require(_0x6965('0x4'));var util=require(_0x6965('0x5'));var path=require(_0x6965('0x6'));var sox=require(_0x6965('0x7'));var csv=require(_0x6965('0x8'));var ejs=require(_0x6965('0x9'));var fs=require('fs');var fs_extra=require(_0x6965('0xa'));var _=require(_0x6965('0xb'));var squel=require('squel');var crypto=require(_0x6965('0xc'));var jsforce=require(_0x6965('0xd'));var deskjs=require(_0x6965('0xe'));var toCsv=require(_0x6965('0x8'));var querystring=require(_0x6965('0xf'));var Papa=require('papaparse');var Redis=require(_0x6965('0x10'));var authService=require(_0x6965('0x11'));var qs=require(_0x6965('0x12'));var as=require(_0x6965('0x13'));var hardwareService=require(_0x6965('0x14'));var logger=require(_0x6965('0x15'))(_0x6965('0x16'));var utils=require(_0x6965('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6965('0x18'));var db=require(_0x6965('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59577e,_0x5cfd93){_0x5cfd93=_0x5cfd93||0xcc;return function(_0x12b8b9){if(_0x12b8b9){return _0x59577e[_0x6965('0x1a')](_0x5cfd93);}return _0x59577e[_0x6965('0x1b')](_0x5cfd93)[_0x6965('0x1c')]();};}function respondWithResult(_0x1aefd4,_0x15780d){_0x15780d=_0x15780d||0xc8;return function(_0x3390c5){if(_0x3390c5){return _0x1aefd4[_0x6965('0x1b')](_0x15780d)[_0x6965('0x1d')](_0x3390c5);}};}function respondWithFilteredResult(_0x8ac2a3,_0x203806){return function(_0x69f31e){if(_0x69f31e){var _0x3e2ea9=typeof _0x203806[_0x6965('0x1e')]===_0x6965('0x1f')&&typeof _0x203806[_0x6965('0x20')]===_0x6965('0x1f');var _0x46e7af=_0x69f31e[_0x6965('0x21')];var _0x460852=_0x3e2ea9?0x0:_0x203806['offset'];var _0x5a62ba=_0x3e2ea9?_0x69f31e['count']:_0x203806[_0x6965('0x1e')]+_0x203806[_0x6965('0x20')];var _0x9b0380;if(_0x5a62ba>=_0x46e7af){_0x5a62ba=_0x46e7af;_0x9b0380=0xc8;}else{_0x9b0380=0xce;}_0x8ac2a3['status'](_0x9b0380);return _0x8ac2a3[_0x6965('0x22')](_0x6965('0x23'),_0x460852+'-'+_0x5a62ba+'/'+_0x46e7af)[_0x6965('0x1d')](_0x69f31e);}return null;};}function patchUpdates(_0xf29b61){return function(_0x32a427){try{jsonpatch[_0x6965('0x24')](_0x32a427,_0xf29b61,!![]);}catch(_0x465050){return BPromise[_0x6965('0x25')](_0x465050);}return _0x32a427[_0x6965('0x26')]();};}function saveUpdates(_0x889a20,_0x5e8acc){return function(_0x1a0429){if(_0x1a0429){return _0x1a0429[_0x6965('0x27')](_0x889a20)[_0x6965('0x28')](function(_0x43ae7f){return _0x43ae7f;});}return null;};}function removeEntity(_0x16f174,_0x10091a){return function(_0x3ad86d){if(_0x3ad86d){return _0x3ad86d[_0x6965('0x29')]()[_0x6965('0x28')](function(){_0x16f174[_0x6965('0x1b')](0xcc)[_0x6965('0x1c')]();});}};}function handleEntityNotFound(_0x57c39d,_0x5243e0){return function(_0x1cfe06){if(!_0x1cfe06){_0x57c39d[_0x6965('0x1a')](0x194);}return _0x1cfe06;};}function handleError(_0x80c76f,_0x43cc8a){_0x43cc8a=_0x43cc8a||0x1f4;return function(_0x460a7f){logger['error'](_0x460a7f[_0x6965('0x2a')]);if(_0x460a7f[_0x6965('0x2b')]){delete _0x460a7f[_0x6965('0x2b')];}_0x80c76f['status'](_0x43cc8a)[_0x6965('0x2c')](_0x460a7f);};}exports[_0x6965('0x2d')]=function(_0x4a6bfd,_0x3157cb){var _0x34c253={},_0x5d6420={},_0x211332={'count':0x0,'rows':[]};var _0x117281=_['map'](db[_0x6965('0x2e')][_0x6965('0x2f')],function(_0x30c507){return{'name':_0x30c507['fieldName'],'type':_0x30c507[_0x6965('0x30')][_0x6965('0x31')]};});_0x5d6420[_0x6965('0x32')]=_[_0x6965('0x33')](_0x117281,_0x6965('0x2b'));_0x5d6420[_0x6965('0x34')]=_['keys'](_0x4a6bfd[_0x6965('0x34')]);_0x5d6420[_0x6965('0x35')]=_['intersection'](_0x5d6420[_0x6965('0x32')],_0x5d6420[_0x6965('0x34')]);_0x34c253[_0x6965('0x36')]=_['intersection'](_0x5d6420[_0x6965('0x32')],qs[_0x6965('0x37')](_0x4a6bfd[_0x6965('0x34')][_0x6965('0x37')]));_0x34c253[_0x6965('0x36')]=_0x34c253[_0x6965('0x36')]['length']?_0x34c253['attributes']:_0x5d6420['model'];if(!_0x4a6bfd[_0x6965('0x34')]['hasOwnProperty'](_0x6965('0x38'))){_0x34c253[_0x6965('0x20')]=qs[_0x6965('0x20')](_0x4a6bfd[_0x6965('0x34')][_0x6965('0x20')]);_0x34c253['offset']=qs[_0x6965('0x1e')](_0x4a6bfd[_0x6965('0x34')][_0x6965('0x1e')]);}_0x34c253['order']=qs[_0x6965('0x39')](_0x4a6bfd[_0x6965('0x34')][_0x6965('0x39')]);_0x34c253[_0x6965('0x3a')]=qs['filters'](_[_0x6965('0x3b')](_0x4a6bfd[_0x6965('0x34')],_0x5d6420['filters']),_0x117281);if(_0x4a6bfd[_0x6965('0x34')][_0x6965('0x3c')]){_0x34c253[_0x6965('0x3a')]=_[_0x6965('0x3d')](_0x34c253[_0x6965('0x3a')],{'$or':_[_0x6965('0x33')](_0x117281,function(_0xd729f8){if(_0xd729f8[_0x6965('0x30')]!==_0x6965('0x3e')){var _0x1281ee={};_0x1281ee[_0xd729f8[_0x6965('0x2b')]]={'$like':'%'+_0x4a6bfd[_0x6965('0x34')]['filter']+'%'};return _0x1281ee;}})});}_0x34c253=_[_0x6965('0x3d')]({},_0x34c253,_0x4a6bfd['options']);var _0xb1d7e2={'where':_0x34c253[_0x6965('0x3a')]};return db['VtigerAccount'][_0x6965('0x21')](_0xb1d7e2)[_0x6965('0x28')](function(_0x2aedb6){_0x211332['count']=_0x2aedb6;if(_0x4a6bfd[_0x6965('0x34')]['includeAll']){_0x34c253[_0x6965('0x3f')]=[{'all':!![]}];}return db[_0x6965('0x2e')][_0x6965('0x40')](_0x34c253);})[_0x6965('0x28')](function(_0x570ff2){_0x211332[_0x6965('0x41')]=_0x570ff2;return _0x211332;})[_0x6965('0x28')](respondWithFilteredResult(_0x3157cb,_0x34c253))[_0x6965('0x42')](handleError(_0x3157cb,null));};exports[_0x6965('0x43')]=function(_0x5a1c06,_0x29aa91){var _0x49d912={'raw':![],'where':{'id':_0x5a1c06[_0x6965('0x44')]['id']}},_0x524472={};_0x524472[_0x6965('0x32')]=_['keys'](db['VtigerAccount'][_0x6965('0x2f')]);_0x524472[_0x6965('0x34')]=_[_0x6965('0x45')](_0x5a1c06[_0x6965('0x34')]);_0x524472['filters']=_['intersection'](_0x524472[_0x6965('0x32')],_0x524472[_0x6965('0x34')]);_0x49d912['attributes']=_[_0x6965('0x46')](_0x524472['model'],qs['fields'](_0x5a1c06[_0x6965('0x34')][_0x6965('0x37')]));_0x49d912[_0x6965('0x36')]=_0x49d912['attributes'][_0x6965('0x47')]?_0x49d912['attributes']:_0x524472[_0x6965('0x32')];if(_0x5a1c06[_0x6965('0x34')][_0x6965('0x48')]){_0x49d912[_0x6965('0x3f')]=[{'all':!![]}];}_0x49d912=_['merge']({},_0x49d912,_0x5a1c06[_0x6965('0x49')]);return db['VtigerAccount'][_0x6965('0x4a')](_0x49d912)[_0x6965('0x28')](handleEntityNotFound(_0x29aa91,null))['then'](respondWithResult(_0x29aa91,null))['catch'](handleError(_0x29aa91,null));};exports[_0x6965('0x4b')]=function(_0x1a53c,_0x24c1bb){return db[_0x6965('0x2e')]['create'](_0x1a53c[_0x6965('0x4c')],{})[_0x6965('0x28')](respondWithResult(_0x24c1bb,0xc9))[_0x6965('0x42')](handleError(_0x24c1bb,null));};exports[_0x6965('0x27')]=function(_0x2922db,_0x5cb372){if(_0x2922db['body']['id']){delete _0x2922db['body']['id'];}return db[_0x6965('0x2e')][_0x6965('0x4a')]({'where':{'id':_0x2922db['params']['id']}})[_0x6965('0x28')](handleEntityNotFound(_0x5cb372,null))[_0x6965('0x28')](saveUpdates(_0x2922db[_0x6965('0x4c')],null))['then'](respondWithResult(_0x5cb372,null))[_0x6965('0x42')](handleError(_0x5cb372,null));};exports['destroy']=function(_0x193161,_0x56ac54){return db[_0x6965('0x2e')][_0x6965('0x4a')]({'where':{'id':_0x193161['params']['id']}})[_0x6965('0x28')](handleEntityNotFound(_0x56ac54,null))['then'](removeEntity(_0x56ac54,null))[_0x6965('0x42')](handleError(_0x56ac54,null));};exports[_0x6965('0x4d')]=function(_0x557ca9,_0x2a51e7,_0x4e70fc){var _0x2b5c4e={};var _0x1f060c={};var _0x5e273d;var _0x2df5eb;return db['VtigerAccount'][_0x6965('0x4e')]({'where':{'id':_0x557ca9['params']['id']}})[_0x6965('0x28')](handleEntityNotFound(_0x2a51e7,null))[_0x6965('0x28')](function(_0x4ae738){if(_0x4ae738){_0x5e273d=_0x4ae738;_0x1f060c[_0x6965('0x32')]=_['keys'](db[_0x6965('0x4f')]['rawAttributes']);_0x1f060c[_0x6965('0x34')]=_['keys'](_0x557ca9[_0x6965('0x34')]);_0x1f060c[_0x6965('0x35')]=_[_0x6965('0x46')](_0x1f060c['model'],_0x1f060c[_0x6965('0x34')]);_0x2b5c4e['attributes']=_[_0x6965('0x46')](_0x1f060c['model'],qs[_0x6965('0x37')](_0x557ca9[_0x6965('0x34')]['fields']));_0x2b5c4e[_0x6965('0x36')]=_0x2b5c4e[_0x6965('0x36')][_0x6965('0x47')]?_0x2b5c4e[_0x6965('0x36')]:_0x1f060c[_0x6965('0x32')];_0x2b5c4e[_0x6965('0x50')]=qs[_0x6965('0x39')](_0x557ca9[_0x6965('0x34')]['sort']);_0x2b5c4e[_0x6965('0x3a')]=qs[_0x6965('0x35')](_[_0x6965('0x3b')](_0x557ca9[_0x6965('0x34')],_0x1f060c[_0x6965('0x35')]));if(_0x557ca9[_0x6965('0x34')]['filter']){_0x2b5c4e[_0x6965('0x3a')]=_[_0x6965('0x3d')](_0x2b5c4e[_0x6965('0x3a')],{'$or':_[_0x6965('0x33')](_0x2b5c4e[_0x6965('0x36')],function(_0x5bee10){var _0x5b3fce={};_0x5b3fce[_0x5bee10]={'$like':'%'+_0x557ca9[_0x6965('0x34')][_0x6965('0x3c')]+'%'};return _0x5b3fce;})});}_0x2b5c4e=_[_0x6965('0x3d')]({},_0x2b5c4e,_0x557ca9[_0x6965('0x49')]);return _0x5e273d[_0x6965('0x4d')](_0x2b5c4e);}})['then'](function(_0x1de88b){if(_0x1de88b){_0x2df5eb=_0x1de88b[_0x6965('0x47')];if(!_0x557ca9[_0x6965('0x34')][_0x6965('0x51')](_0x6965('0x38'))){_0x2b5c4e[_0x6965('0x20')]=qs[_0x6965('0x20')](_0x557ca9['query'][_0x6965('0x20')]);_0x2b5c4e['offset']=qs[_0x6965('0x1e')](_0x557ca9[_0x6965('0x34')][_0x6965('0x1e')]);}return _0x5e273d['getConfigurations'](_0x2b5c4e);}})['then'](function(_0xc76825){if(_0xc76825){return _0xc76825?{'count':_0x2df5eb,'rows':_0xc76825}:null;}})[_0x6965('0x28')](respondWithResult(_0x2a51e7,null))[_0x6965('0x42')](handleError(_0x2a51e7,null));};exports[_0x6965('0x52')]=function(_0x4398d9,_0x49a154,_0x210bfd){if(_0x4398d9[_0x6965('0x4c')]['id']){delete _0x4398d9['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x4398d9['params']['id']}})[_0x6965('0x28')](handleEntityNotFound(_0x49a154,null))['then'](function(_0x6ae121){if(_0x6ae121){_0x4398d9[_0x6965('0x4c')]['AccountId']=_0x6ae121['id'];_0x4398d9[_0x6965('0x4c')][_0x6965('0x53')]=integrations[_0x6965('0x54')](_0x4398d9['body'][_0x6965('0x55')],_0x4398d9['body'][_0x6965('0x30')]);_0x4398d9[_0x6965('0x4c')][_0x6965('0x56')]=integrations['getDescriptions'](_0x4398d9['body']['channel'],_0x4398d9[_0x6965('0x4c')][_0x6965('0x30')]);return db[_0x6965('0x4f')][_0x6965('0x4b')](_0x4398d9[_0x6965('0x4c')],{'include':[{'model':db[_0x6965('0x57')],'as':_0x6965('0x53')},{'model':db[_0x6965('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x49a154,null))[_0x6965('0x42')](handleError(_0x49a154,null));};var md5=require(_0x6965('0x58'));exports[_0x6965('0x59')]=function(_0x3734b0,_0x582280,_0x3c6a85){var _0x2a4983=null;var _0x34553d=null;var _0x5731c1=null;var _0x4c59f2=null;var _0x5d4b28='';return db[_0x6965('0x2e')][_0x6965('0x4e')]({'where':{'id':_0x3734b0['params']['id']},'attributes':['id',_0x6965('0x2b'),'username','description',_0x6965('0x5a'),_0x6965('0x5b'),_0x6965('0x5c'),'accessKey']})[_0x6965('0x28')](handleEntityNotFound(_0x582280,null))[_0x6965('0x28')](function(_0x598648){if(_0x598648){_0x2a4983=_0x598648[_0x6965('0x5d')];_0x34553d=_0x598648[_0x6965('0x5e')];_0x5731c1=_0x598648[_0x6965('0x5a')];_0x5d4b28=_0x598648[_0x6965('0x5b')];var _0x5d68b4=_0x5d4b28[_0x6965('0x5f')](-0x1);if(_0x5d68b4==='/'){_0x5d4b28=_0x5d4b28[_0x6965('0x60')](0x0,_0x5d4b28['lastIndexOf'](_0x5d68b4));}_0x4c59f2=util['format']('%s/webservice.php',_0x5d4b28);var _0x7e7fe={'method':'GET','uri':_0x4c59f2,'qs':{'operation':'getchallenge','username':_0x598648['username']},'json':!![]};return rp(_0x7e7fe);}})[_0x6965('0x28')](function(_0x3020b7){if(_0x3020b7[_0x6965('0x61')]){var _0x5f3492={'method':'POST','uri':_0x4c59f2,'form':{'operation':_0x6965('0x62'),'username':_0x2a4983,'accessKey':md5(_0x3020b7[_0x6965('0x63')][_0x6965('0x64')]+_0x34553d)},'json':!![]};return rp(_0x5f3492);}})[_0x6965('0x28')](function(_0x35015f){if(_0x35015f['success']){var _0x3a9b6c={'method':_0x6965('0x65'),'uri':_0x4c59f2,'qs':{'operation':_0x6965('0x66'),'username':_0x2a4983,'sessionName':_0x35015f[_0x6965('0x63')]['sessionName'],'elementType':_0x5731c1},'json':!![]};return rp(_0x3a9b6c);}})['then'](function(_0x206f48){if(_0x206f48[_0x6965('0x61')]){var _0x393a1e=[_0x6965('0x67'),_0x6965('0x68'),_0x6965('0x69')];_[_0x6965('0x6a')](_0x206f48[_0x6965('0x63')][_0x6965('0x37')],function(_0x54f135){return _0x393a1e[_0x6965('0x6b')](_0x54f135['type'][_0x6965('0x2b')]);});_['remove'](_0x206f48['result'][_0x6965('0x37')],function(_0xa10527){return _0xa10527[_0x6965('0x6c')]===_0x6965('0x6d');});return{'count':_0x206f48['result']['fields']['length'],'rows':_[_0x6965('0x33')](_0x206f48['result'][_0x6965('0x37')],function(_0x41982c){return{'id':_0x41982c[_0x6965('0x2b')],'name':_0x41982c['label'],'custom':_[_0x6965('0x6e')](_0x41982c['name'],_0x6965('0x6f'))?!![]:![],'options':_0x41982c[_0x6965('0x30')]['name']===_0x6965('0x70')&&_0x41982c[_0x6965('0x30')][_0x6965('0x71')][_0x6965('0x47')]>0x0?_[_0x6965('0x33')](_0x41982c[_0x6965('0x30')]['picklistValues'],function(_0x7ca1fb){return{'name':_0x7ca1fb[_0x6965('0x72')],'value':_0x7ca1fb[_0x6965('0x73')]};}):[]};})};}})[_0x6965('0x28')](respondWithResult(_0x582280,null))['catch'](function(_0x295f60){console[_0x6965('0x74')]('vTiger\x20error:\x20'+_0x295f60);var _0x5bf8bb=_0x3734b0[_0x6965('0x34')]['test']?0x1f4:_0x295f60['statusCode']||0x1f4;logger[_0x6965('0x75')](_0x6965('0x76'),_0x6965('0x59'),_0x5bf8bb,JSON[_0x6965('0x77')](_0x295f60));delete _0x295f60[_0x6965('0x2b')];if(_0x5bf8bb===0x191){_0x5bf8bb=0x190;}_0x582280[_0x6965('0x1b')](_0x5bf8bb)[_0x6965('0x2c')](_0x3734b0['query']['test']?{'message':_0x6965('0x78'),'statusCode':_0x295f60[_0x6965('0x79')]}:_0x295f60);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4671c3b..78335d1 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 _0x7bce=['lodash','../../config/logger','api','moment','bluebird','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x23c738,_0xc89e5e){var _0x2e68a9=function(_0x281ec4){while(--_0x281ec4){_0x23c738['push'](_0x23c738['shift']());}};_0x2e68a9(++_0xc89e5e);}(_0x7bce,0x1ec));var _0xe7bc=function(_0x16ed82,_0xb71a8d){_0x16ed82=_0x16ed82-0x0;var _0xe60eee=_0x7bce[_0x16ed82];return _0xe60eee;};'use strict';var _=require(_0xe7bc('0x0'));var util=require('util');var logger=require(_0xe7bc('0x1'))(_0xe7bc('0x2'));var moment=require(_0xe7bc('0x3'));var BPromise=require(_0xe7bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7bc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7bc('0x6'));var integrations=require(_0xe7bc('0x7'));module[_0xe7bc('0x8')]=function(_0x48d9ee,_0x3a11b9){return _0x48d9ee[_0xe7bc('0x9')](_0xe7bc('0xa'),attributes,{'tableName':_0xe7bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ae9=['VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','bluebird','path','../../components/integrations/configuration','define'];(function(_0x130331,_0x4e1df1){var _0x19f22d=function(_0x4975d9){while(--_0x4975d9){_0x130331['push'](_0x130331['shift']());}};_0x19f22d(++_0x4e1df1);}(_0x2ae9,0x107));var _0x92ae=function(_0x1338a1,_0x48c226){_0x1338a1=_0x1338a1-0x0;var _0x39b9e6=_0x2ae9[_0x1338a1];return _0x39b9e6;};'use strict';var _=require('lodash');var util=require(_0x92ae('0x0'));var logger=require(_0x92ae('0x1'))(_0x92ae('0x2'));var moment=require('moment');var BPromise=require(_0x92ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92ae('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x92ae('0x5'));module['exports']=function(_0x5ad955,_0xa02c8b){return _0x5ad955[_0x92ae('0x6')](_0x92ae('0x7'),attributes,{'tableName':_0x92ae('0x8'),'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 cba7855..75a6266 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 _0x065e=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','find','ShowVtigerAccount','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3f1b2a,_0x4aaddd){var _0x3b6029=function(_0x59237a){while(--_0x59237a){_0x3f1b2a['push'](_0x3f1b2a['shift']());}};_0x3b6029(++_0x4aaddd);}(_0x065e,0x1a7));var _0xe065=function(_0x288536,_0x369b51){_0x288536=_0x288536-0x0;var _0x525e94=_0x065e[_0x288536];return _0x525e94;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x189d72,_0x52403a,_0x267122){return new BPromise(function(_0x5afbd4,_0x273e22){return client[_0xe065('0x8')](_0x189d72,_0x267122)[_0xe065('0x9')](function(_0x114497){logger[_0xe065('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x52403a,_0xe065('0xb'));logger[_0xe065('0xc')](_0xe065('0xd'),_0x52403a,_0xe065('0xb'),JSON[_0xe065('0xe')](_0x114497));if(_0x114497[_0xe065('0xf')]){if(_0x114497['error']['code']===0x1f4){logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x273e22(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x5afbd4(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}else{logger[_0xe065('0xa')](_0xe065('0x10'),_0x52403a,_0xe065('0xb'));_0x5afbd4(_0x114497[_0xe065('0x12')][_0xe065('0x11')]);}})['catch'](function(_0x1ba88d){logger[_0xe065('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x52403a,_0x1ba88d);_0x273e22(_0x1ba88d);});});}exports[_0xe065('0x13')]=function(_0x1d2f7a){var _0x397f05=this;return new Promise(function(_0x14c97c,_0x1e7177){return db[_0xe065('0x14')][_0xe065('0x15')]({'raw':_0x1d2f7a['options']?_0x1d2f7a[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')]['where']||null:null,'attributes':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a['options'][_0xe065('0x17')]||null:null,'limit':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x18')]||null:null,'include':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1d2f7a[_0xe065('0x16')]['include'],function(_0x7208af){return{'model':db[_0x7208af[_0xe065('0x1b')]],'as':_0x7208af['as'],'attributes':_0x7208af[_0xe065('0x17')],'include':_0x7208af[_0xe065('0x19')]?_['map'](_0x7208af['include'],function(_0x164965){return{'model':db[_0x164965['model']],'as':_0x164965['as'],'attributes':_0x164965[_0xe065('0x17')],'include':_0x164965[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x164965[_0xe065('0x19')],function(_0x418731){return{'model':db[_0x418731[_0xe065('0x1b')]],'as':_0x418731['as'],'attributes':_0x418731[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x52cd9c){logger['info'](_0xe065('0x13'),_0x1d2f7a);logger[_0xe065('0xc')](_0xe065('0x13'),_0x1d2f7a,JSON[_0xe065('0xe')](_0x52cd9c));_0x14c97c(_0x52cd9c);})['catch'](function(_0x23f573){logger['error']('GetVtigerAccount',_0x23f573[_0xe065('0x11')],_0x1d2f7a);_0x1e7177(_0x397f05[_0xe065('0xf')](0x1f4,_0x23f573[_0xe065('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x883747){var _0x59b915=this;return new Promise(function(_0x12679d,_0x46db7e){return db[_0xe065('0x14')][_0xe065('0x1c')]({'raw':_0x883747['options']?_0x883747[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x883747[_0xe065('0x16')]?_0x883747[_0xe065('0x16')]['where']||null:null,'attributes':_0x883747[_0xe065('0x16')]?_0x883747['options'][_0xe065('0x17')]||null:null,'include':_0x883747['options']?_0x883747[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x883747[_0xe065('0x16')]['include'],function(_0x1fe1dc){return{'model':db[_0x1fe1dc[_0xe065('0x1b')]],'as':_0x1fe1dc['as'],'attributes':_0x1fe1dc[_0xe065('0x17')],'include':_0x1fe1dc[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1fe1dc[_0xe065('0x19')],function(_0x4b822a){return{'model':db[_0x4b822a[_0xe065('0x1b')]],'as':_0x4b822a['as'],'attributes':_0x4b822a[_0xe065('0x17')],'include':_0x4b822a['include']?_[_0xe065('0x1a')](_0x4b822a[_0xe065('0x19')],function(_0x5afc23){return{'model':db[_0x5afc23[_0xe065('0x1b')]],'as':_0x5afc23['as'],'attributes':_0x5afc23[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x35135f){logger['info'](_0xe065('0x1d'),_0x883747);logger['debug'](_0xe065('0x1d'),_0x883747,JSON[_0xe065('0xe')](_0x35135f));_0x12679d(_0x35135f);})[_0xe065('0x1e')](function(_0xcceb12){logger[_0xe065('0xf')](_0xe065('0x1d'),_0xcceb12['message'],_0x883747);_0x46db7e(_0x59b915[_0xe065('0xf')](0x1f4,_0xcceb12[_0xe065('0x11')]));});});}; \ No newline at end of file +var _0x2e54=['error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','map','include','model','ShowVtigerAccount','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x126c2f,_0x19a958){var _0x421c3a=function(_0x42cc92){while(--_0x42cc92){_0x126c2f['push'](_0x126c2f['shift']());}};_0x421c3a(++_0x19a958);}(_0x2e54,0x1dd));var _0x42e5=function(_0x1f6f41,_0x42980d){_0x1f6f41=_0x1f6f41-0x0;var _0x325802=_0x2e54[_0x1f6f41];return _0x325802;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});}exports[_0x42e5('0x16')]=function(_0x38282d){var _0x11550e=this;return new Promise(function(_0x23fe09,_0x54fcfc){return db[_0x42e5('0x17')]['findAll']({'raw':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1a')]||null:null,'attributes':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1b')]||null:null,'limit':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')]['limit']||null:null,'include':_0x38282d['options']?_0x38282d[_0x42e5('0x18')]['include']?_[_0x42e5('0x1c')](_0x38282d[_0x42e5('0x18')][_0x42e5('0x1d')],function(_0x49490f){return{'model':db[_0x49490f[_0x42e5('0x1e')]],'as':_0x49490f['as'],'attributes':_0x49490f['attributes'],'include':_0x49490f[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x49490f[_0x42e5('0x1d')],function(_0x275c80){return{'model':db[_0x275c80[_0x42e5('0x1e')]],'as':_0x275c80['as'],'attributes':_0x275c80['attributes'],'include':_0x275c80['include']?_[_0x42e5('0x1c')](_0x275c80['include'],function(_0x56f812){return{'model':db[_0x56f812[_0x42e5('0x1e')]],'as':_0x56f812['as'],'attributes':_0x56f812['attributes']};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x2d9e65){logger[_0x42e5('0xd')](_0x42e5('0x16'),_0x38282d);logger[_0x42e5('0x10')](_0x42e5('0x16'),_0x38282d,JSON['stringify'](_0x2d9e65));_0x23fe09(_0x2d9e65);})[_0x42e5('0x15')](function(_0x201d9e){logger[_0x42e5('0x12')](_0x42e5('0x16'),_0x201d9e[_0x42e5('0x13')],_0x38282d);_0x54fcfc(_0x11550e[_0x42e5('0x12')](0x1f4,_0x201d9e[_0x42e5('0x13')]));});});};exports[_0x42e5('0x1f')]=function(_0x5a4930){var _0x2ba9ef=this;return new Promise(function(_0x2c7542,_0x3d9e8b){return db[_0x42e5('0x17')]['find']({'raw':_0x5a4930[_0x42e5('0x18')]?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options']['where']||null:null,'attributes':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options'][_0x42e5('0x1b')]||null:null,'include':_0x5a4930['options']?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x5a4930['options'][_0x42e5('0x1d')],function(_0x3a8d1c){return{'model':db[_0x3a8d1c['model']],'as':_0x3a8d1c['as'],'attributes':_0x3a8d1c[_0x42e5('0x1b')],'include':_0x3a8d1c['include']?_[_0x42e5('0x1c')](_0x3a8d1c[_0x42e5('0x1d')],function(_0x25a040){return{'model':db[_0x25a040[_0x42e5('0x1e')]],'as':_0x25a040['as'],'attributes':_0x25a040[_0x42e5('0x1b')],'include':_0x25a040[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x25a040['include'],function(_0x5a18cc){return{'model':db[_0x5a18cc[_0x42e5('0x1e')]],'as':_0x5a18cc['as'],'attributes':_0x5a18cc[_0x42e5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x4a1a8a){logger['info']('ShowVtigerAccount',_0x5a4930);logger['debug'](_0x42e5('0x1f'),_0x5a4930,JSON[_0x42e5('0x20')](_0x4a1a8a));_0x2c7542(_0x4a1a8a);})[_0x42e5('0x15')](function(_0xedb7bc){logger[_0x42e5('0x12')](_0x42e5('0x1f'),_0xedb7bc[_0x42e5('0x13')],_0x5a4930);_0x3d9e8b(_0x2ba9ef[_0x42e5('0x12')](0x1f4,_0xedb7bc['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7fb3b45..80dff18 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 _0xc6de=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x3f8759,_0x3fe6fb){var _0x2d33ca=function(_0x39b5c9){while(--_0x39b5c9){_0x3f8759['push'](_0x3f8759['shift']());}};_0x2d33ca(++_0x3fe6fb);}(_0xc6de,0xa9));var _0xec6d=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0xc6de[_0x448bab];return _0x5dc534;};'use strict';var multer=require(_0xec6d('0x0'));var util=require(_0xec6d('0x1'));var path=require(_0xec6d('0x2'));var timeout=require(_0xec6d('0x3'));var express=require(_0xec6d('0x4'));var router=express[_0xec6d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec6d('0x6'));var interaction=require(_0xec6d('0x7'));var config=require(_0xec6d('0x8'));var controller=require(_0xec6d('0x9'));router[_0xec6d('0xa')]('/',auth[_0xec6d('0xb')](),controller[_0xec6d('0xc')]);router[_0xec6d('0xa')](_0xec6d('0xd'),auth['isAuthenticated'](),controller[_0xec6d('0xe')]);router[_0xec6d('0xa')](_0xec6d('0xf'),auth[_0xec6d('0xb')](),controller[_0xec6d('0x10')]);router[_0xec6d('0xa')](_0xec6d('0x11'),auth[_0xec6d('0xb')](),controller[_0xec6d('0x12')]);router['get'](_0xec6d('0x13'),auth[_0xec6d('0xb')](),controller[_0xec6d('0x14')]);router[_0xec6d('0x15')]('/',auth[_0xec6d('0xb')](),controller['create']);router[_0xec6d('0x16')](_0xec6d('0xd'),auth['isAuthenticated'](),controller[_0xec6d('0x17')]);router[_0xec6d('0x18')](_0xec6d('0xd'),auth['isAuthenticated'](),controller[_0xec6d('0x19')]);module['exports']=router; \ No newline at end of file +var _0xce24=['getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields'];(function(_0x411cd2,_0x5c2f55){var _0x314d25=function(_0x2bdd8c){while(--_0x2bdd8c){_0x411cd2['push'](_0x411cd2['shift']());}};_0x314d25(++_0x5c2f55);}(_0xce24,0xec));var _0x4ce2=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xce24[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x4ce2('0x0'));var util=require(_0x4ce2('0x1'));var path=require('path');var timeout=require(_0x4ce2('0x2'));var express=require(_0x4ce2('0x3'));var router=express[_0x4ce2('0x4')]();var fs_extra=require(_0x4ce2('0x5'));var auth=require(_0x4ce2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ce2('0x7'));var controller=require(_0x4ce2('0x8'));router[_0x4ce2('0x9')]('/',auth[_0x4ce2('0xa')](),controller['index']);router['get'](_0x4ce2('0xb'),auth[_0x4ce2('0xa')](),controller[_0x4ce2('0xc')]);router[_0x4ce2('0x9')](_0x4ce2('0xd'),auth['isAuthenticated'](),controller[_0x4ce2('0xe')]);router[_0x4ce2('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4ce2('0xf')]);router[_0x4ce2('0x9')](_0x4ce2('0x10'),auth['isAuthenticated'](),controller[_0x4ce2('0x11')]);router[_0x4ce2('0x12')]('/',auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x13')]);router[_0x4ce2('0x14')](_0x4ce2('0xb'),auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x15')]);router[_0x4ce2('0x16')](_0x4ce2('0xb'),auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x17')]);module[_0x4ce2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3a022a5..a7c7fcf 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 _0xf24f=['sequelize','exports','STRING'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xf24f,0x171));var _0xff24=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xf24f[_0x3be0c4];return _0x11af9f;};'use strict';var Sequelize=require(_0xff24('0x0'));module[_0xff24('0x1')]={'name':{'type':Sequelize[_0xff24('0x2')]},'description':{'type':Sequelize[_0xff24('0x2')]}}; \ No newline at end of file +var _0x2e5b=['STRING','sequelize'];(function(_0x49def9,_0x46014d){var _0x540581=function(_0x59e27a){while(--_0x59e27a){_0x49def9['push'](_0x49def9['shift']());}};_0x540581(++_0x46014d);}(_0x2e5b,0x1d3));var _0xb2e5=function(_0x48e8d5,_0x575cc4){_0x48e8d5=_0x48e8d5-0x0;var _0x1cbfc1=_0x2e5b[_0x48e8d5];return _0x1cbfc1;};'use strict';var Sequelize=require(_0xb2e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2e5('0x1')]},'description':{'type':Sequelize[_0xb2e5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 070054b..6ab8804 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 _0x13ba=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','VtigerConfiguration','includeAll','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs'];(function(_0x141b04,_0x4fd925){var _0x8e9ee5=function(_0x20a299){while(--_0x20a299){_0x141b04['push'](_0x141b04['shift']());}};_0x8e9ee5(++_0x4fd925);}(_0x13ba,0x1bf));var _0xa13b=function(_0x46d9a1,_0x136802){_0x46d9a1=_0x46d9a1-0x0;var _0x17c284=_0x13ba[_0x46d9a1];return _0x17c284;};'use strict';var emlformat=require(_0xa13b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa13b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa13b('0x2'));var moment=require(_0xa13b('0x3'));var BPromise=require(_0xa13b('0x4'));var Mustache=require('mustache');var util=require(_0xa13b('0x5'));var path=require('path');var sox=require(_0xa13b('0x6'));var csv=require(_0xa13b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa13b('0x8'));var _=require(_0xa13b('0x9'));var squel=require(_0xa13b('0xa'));var crypto=require(_0xa13b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa13b('0xc'));var Papa=require(_0xa13b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa13b('0xe'));var as=require(_0xa13b('0xf'));var hardwareService=require(_0xa13b('0x10'));var logger=require(_0xa13b('0x11'))(_0xa13b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa13b('0x13'))['db'];function respondWithStatusCode(_0x44a104,_0x74f83c){_0x74f83c=_0x74f83c||0xcc;return function(_0x144a6a){if(_0x144a6a){return _0x44a104[_0xa13b('0x14')](_0x74f83c);}return _0x44a104[_0xa13b('0x15')](_0x74f83c)[_0xa13b('0x16')]();};}function respondWithResult(_0x5df9c8,_0x18e629){_0x18e629=_0x18e629||0xc8;return function(_0xc78213){if(_0xc78213){return _0x5df9c8[_0xa13b('0x15')](_0x18e629)[_0xa13b('0x17')](_0xc78213);}};}function respondWithFilteredResult(_0x5da462,_0x5be37b){return function(_0x54c8b1){if(_0x54c8b1){var _0x3e92a4=typeof _0x5be37b[_0xa13b('0x18')]===_0xa13b('0x19')&&typeof _0x5be37b[_0xa13b('0x1a')]==='undefined';var _0x5e25b6=_0x54c8b1[_0xa13b('0x1b')];var _0x187c52=_0x3e92a4?0x0:_0x5be37b[_0xa13b('0x18')];var _0x477d1f=_0x3e92a4?_0x54c8b1['count']:_0x5be37b[_0xa13b('0x18')]+_0x5be37b[_0xa13b('0x1a')];var _0x4d9908;if(_0x477d1f>=_0x5e25b6){_0x477d1f=_0x5e25b6;_0x4d9908=0xc8;}else{_0x4d9908=0xce;}_0x5da462[_0xa13b('0x15')](_0x4d9908);return _0x5da462[_0xa13b('0x1c')](_0xa13b('0x1d'),_0x187c52+'-'+_0x477d1f+'/'+_0x5e25b6)['json'](_0x54c8b1);}return null;};}function patchUpdates(_0x531e6b){return function(_0x1d18ec){try{jsonpatch[_0xa13b('0x1e')](_0x1d18ec,_0x531e6b,!![]);}catch(_0x210a19){return BPromise['reject'](_0x210a19);}return _0x1d18ec[_0xa13b('0x1f')]();};}function saveUpdates(_0x5a762b,_0xa73a9d){return function(_0x27b6b5){if(_0x27b6b5){return _0x27b6b5[_0xa13b('0x20')](_0x5a762b)[_0xa13b('0x21')](function(_0x403ec9){return _0x403ec9;});}return null;};}function removeEntity(_0x16b61b,_0x382310){return function(_0x56b62b){if(_0x56b62b){return _0x56b62b[_0xa13b('0x22')]()[_0xa13b('0x21')](function(){_0x16b61b[_0xa13b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9b58,_0x33a7c7){return function(_0x404181){if(!_0x404181){_0x2d9b58[_0xa13b('0x14')](0x194);}return _0x404181;};}function handleError(_0x56b0f6,_0x1d769b){_0x1d769b=_0x1d769b||0x1f4;return function(_0x1241b8){logger['error'](_0x1241b8[_0xa13b('0x23')]);if(_0x1241b8['name']){delete _0x1241b8[_0xa13b('0x24')];}_0x56b0f6[_0xa13b('0x15')](_0x1d769b)[_0xa13b('0x25')](_0x1241b8);};}exports[_0xa13b('0x26')]=function(_0x1bd213,_0x4b8c8b){var _0x102901={},_0x4dce43={},_0x5a16e0={'count':0x0,'rows':[]};var _0x56d047=_[_0xa13b('0x27')](db['VtigerConfiguration'][_0xa13b('0x28')],function(_0x3f9d9d){return{'name':_0x3f9d9d[_0xa13b('0x29')],'type':_0x3f9d9d[_0xa13b('0x2a')][_0xa13b('0x2b')]};});_0x4dce43['model']=_[_0xa13b('0x27')](_0x56d047,_0xa13b('0x24'));_0x4dce43[_0xa13b('0x2c')]=_[_0xa13b('0x2d')](_0x1bd213[_0xa13b('0x2c')]);_0x4dce43[_0xa13b('0x2e')]=_[_0xa13b('0x2f')](_0x4dce43[_0xa13b('0x30')],_0x4dce43[_0xa13b('0x2c')]);_0x102901[_0xa13b('0x31')]=_[_0xa13b('0x2f')](_0x4dce43[_0xa13b('0x30')],qs[_0xa13b('0x32')](_0x1bd213[_0xa13b('0x2c')][_0xa13b('0x32')]));_0x102901[_0xa13b('0x31')]=_0x102901['attributes'][_0xa13b('0x33')]?_0x102901['attributes']:_0x4dce43[_0xa13b('0x30')];if(!_0x1bd213['query'][_0xa13b('0x34')](_0xa13b('0x35'))){_0x102901['limit']=qs['limit'](_0x1bd213[_0xa13b('0x2c')]['limit']);_0x102901[_0xa13b('0x18')]=qs[_0xa13b('0x18')](_0x1bd213[_0xa13b('0x2c')]['offset']);}_0x102901[_0xa13b('0x36')]=qs[_0xa13b('0x37')](_0x1bd213[_0xa13b('0x2c')][_0xa13b('0x37')]);_0x102901['where']=qs['filters'](_[_0xa13b('0x38')](_0x1bd213['query'],_0x4dce43[_0xa13b('0x2e')]),_0x56d047);if(_0x1bd213[_0xa13b('0x2c')]['filter']){_0x102901[_0xa13b('0x39')]=_[_0xa13b('0x3a')](_0x102901['where'],{'$or':_[_0xa13b('0x27')](_0x56d047,function(_0x345f59){if(_0x345f59[_0xa13b('0x2a')]!==_0xa13b('0x3b')){var _0x1fba7f={};_0x1fba7f[_0x345f59[_0xa13b('0x24')]]={'$like':'%'+_0x1bd213[_0xa13b('0x2c')][_0xa13b('0x3c')]+'%'};return _0x1fba7f;}})});}_0x102901=_[_0xa13b('0x3a')]({},_0x102901,_0x1bd213[_0xa13b('0x3d')]);var _0x2681ab={'where':_0x102901['where']};return db[_0xa13b('0x3e')][_0xa13b('0x1b')](_0x2681ab)['then'](function(_0x222f25){_0x5a16e0[_0xa13b('0x1b')]=_0x222f25;if(_0x1bd213['query'][_0xa13b('0x3f')]){_0x102901['include']=[{'all':!![]}];}return db[_0xa13b('0x3e')][_0xa13b('0x40')](_0x102901);})[_0xa13b('0x21')](function(_0x29bf66){_0x5a16e0[_0xa13b('0x41')]=_0x29bf66;return _0x5a16e0;})[_0xa13b('0x21')](respondWithFilteredResult(_0x4b8c8b,_0x102901))[_0xa13b('0x42')](handleError(_0x4b8c8b,null));};exports[_0xa13b('0x43')]=function(_0x550fbd,_0x5d0c80){var _0x4e737d={'raw':![],'where':{'id':_0x550fbd[_0xa13b('0x44')]['id']}},_0x5ed3fb={};_0x5ed3fb[_0xa13b('0x30')]=_[_0xa13b('0x2d')](db[_0xa13b('0x3e')][_0xa13b('0x28')]);_0x5ed3fb[_0xa13b('0x2c')]=_[_0xa13b('0x2d')](_0x550fbd['query']);_0x5ed3fb[_0xa13b('0x2e')]=_['intersection'](_0x5ed3fb[_0xa13b('0x30')],_0x5ed3fb['query']);_0x4e737d['attributes']=_[_0xa13b('0x2f')](_0x5ed3fb['model'],qs[_0xa13b('0x32')](_0x550fbd[_0xa13b('0x2c')]['fields']));_0x4e737d[_0xa13b('0x31')]=_0x4e737d[_0xa13b('0x31')][_0xa13b('0x33')]?_0x4e737d[_0xa13b('0x31')]:_0x5ed3fb[_0xa13b('0x30')];if(_0x550fbd[_0xa13b('0x2c')][_0xa13b('0x3f')]){_0x4e737d['include']=[{'all':!![]}];}_0x4e737d=_[_0xa13b('0x3a')]({},_0x4e737d,_0x550fbd[_0xa13b('0x3d')]);return db['VtigerConfiguration'][_0xa13b('0x45')](_0x4e737d)['then'](handleEntityNotFound(_0x5d0c80,null))[_0xa13b('0x21')](respondWithResult(_0x5d0c80,null))['catch'](handleError(_0x5d0c80,null));};exports[_0xa13b('0x46')]=function(_0x26aad5,_0x5197b3){return db[_0xa13b('0x3e')][_0xa13b('0x46')](_0x26aad5[_0xa13b('0x47')],{})[_0xa13b('0x21')](respondWithResult(_0x5197b3,0xc9))[_0xa13b('0x42')](handleError(_0x5197b3,null));};exports[_0xa13b('0x20')]=function(_0x2ed7bb,_0x59b8fc){if(_0x2ed7bb[_0xa13b('0x47')]['id']){delete _0x2ed7bb['body']['id'];}return db['VtigerConfiguration'][_0xa13b('0x45')]({'where':{'id':_0x2ed7bb[_0xa13b('0x44')]['id']}})[_0xa13b('0x21')](handleEntityNotFound(_0x59b8fc,null))[_0xa13b('0x21')](saveUpdates(_0x2ed7bb[_0xa13b('0x47')],null))['then'](respondWithResult(_0x59b8fc,null))[_0xa13b('0x42')](handleError(_0x59b8fc,null));};exports['destroy']=function(_0x2879b9,_0x5813b9){return db[_0xa13b('0x3e')][_0xa13b('0x45')]({'where':{'id':_0x2879b9[_0xa13b('0x44')]['id']}})[_0xa13b('0x21')](handleEntityNotFound(_0x5813b9,null))['then'](removeEntity(_0x5813b9,null))[_0xa13b('0x42')](handleError(_0x5813b9,null));};exports[_0xa13b('0x48')]=function(_0x46e0e2,_0x1d9f0d,_0x50e263){var _0x4757fb={};var _0x5c96c0={};var _0x1f3d8a;var _0x306ac6;return db[_0xa13b('0x3e')][_0xa13b('0x49')]({'where':{'id':_0x46e0e2[_0xa13b('0x44')]['id']}})[_0xa13b('0x21')](handleEntityNotFound(_0x1d9f0d,null))['then'](function(_0x4fa1cc){if(_0x4fa1cc){_0x1f3d8a=_0x4fa1cc;_0x5c96c0['model']=_['keys'](db[_0xa13b('0x4a')][_0xa13b('0x28')]);_0x5c96c0['query']=_[_0xa13b('0x2d')](_0x46e0e2['query']);_0x5c96c0[_0xa13b('0x2e')]=_['intersection'](_0x5c96c0['model'],_0x5c96c0[_0xa13b('0x2c')]);_0x4757fb[_0xa13b('0x31')]=_[_0xa13b('0x2f')](_0x5c96c0[_0xa13b('0x30')],qs[_0xa13b('0x32')](_0x46e0e2[_0xa13b('0x2c')][_0xa13b('0x32')]));_0x4757fb[_0xa13b('0x31')]=_0x4757fb[_0xa13b('0x31')][_0xa13b('0x33')]?_0x4757fb[_0xa13b('0x31')]:_0x5c96c0[_0xa13b('0x30')];_0x4757fb[_0xa13b('0x36')]=qs[_0xa13b('0x37')](_0x46e0e2[_0xa13b('0x2c')][_0xa13b('0x37')]);_0x4757fb['where']=qs[_0xa13b('0x2e')](_['pick'](_0x46e0e2[_0xa13b('0x2c')],_0x5c96c0[_0xa13b('0x2e')]));if(_0x46e0e2[_0xa13b('0x2c')]['filter']){_0x4757fb[_0xa13b('0x39')]=_[_0xa13b('0x3a')](_0x4757fb[_0xa13b('0x39')],{'$or':_[_0xa13b('0x27')](_0x4757fb['attributes'],function(_0x2a6e20){var _0x34d86c={};_0x34d86c[_0x2a6e20]={'$like':'%'+_0x46e0e2[_0xa13b('0x2c')]['filter']+'%'};return _0x34d86c;})});}_0x4757fb=_['merge']({},_0x4757fb,_0x46e0e2[_0xa13b('0x3d')]);return _0x1f3d8a[_0xa13b('0x48')](_0x4757fb);}})[_0xa13b('0x21')](function(_0x437034){if(_0x437034){_0x306ac6=_0x437034['length'];if(!_0x46e0e2[_0xa13b('0x2c')]['hasOwnProperty']('nolimit')){_0x4757fb[_0xa13b('0x1a')]=qs[_0xa13b('0x1a')](_0x46e0e2['query'][_0xa13b('0x1a')]);_0x4757fb[_0xa13b('0x18')]=qs[_0xa13b('0x18')](_0x46e0e2[_0xa13b('0x2c')][_0xa13b('0x18')]);}return _0x1f3d8a[_0xa13b('0x48')](_0x4757fb);}})[_0xa13b('0x21')](function(_0x54eef9){if(_0x54eef9){return _0x54eef9?{'count':_0x306ac6,'rows':_0x54eef9}:null;}})['then'](respondWithResult(_0x1d9f0d,null))[_0xa13b('0x42')](handleError(_0x1d9f0d,null));};exports[_0xa13b('0x4b')]=function(_0x3cdc3b,_0x32e38a,_0x54bfba){var _0x6636ee={};var _0x1510eb={};var _0xeec0ab;var _0x361187;return db[_0xa13b('0x3e')][_0xa13b('0x49')]({'where':{'id':_0x3cdc3b['params']['id']}})[_0xa13b('0x21')](handleEntityNotFound(_0x32e38a,null))[_0xa13b('0x21')](function(_0x8ad3ca){if(_0x8ad3ca){_0xeec0ab=_0x8ad3ca;_0x1510eb[_0xa13b('0x30')]=_[_0xa13b('0x2d')](db[_0xa13b('0x4a')][_0xa13b('0x28')]);_0x1510eb[_0xa13b('0x2c')]=_['keys'](_0x3cdc3b[_0xa13b('0x2c')]);_0x1510eb[_0xa13b('0x2e')]=_[_0xa13b('0x2f')](_0x1510eb['model'],_0x1510eb[_0xa13b('0x2c')]);_0x6636ee[_0xa13b('0x31')]=_[_0xa13b('0x2f')](_0x1510eb[_0xa13b('0x30')],qs[_0xa13b('0x32')](_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x32')]));_0x6636ee[_0xa13b('0x31')]=_0x6636ee[_0xa13b('0x31')]['length']?_0x6636ee[_0xa13b('0x31')]:_0x1510eb['model'];_0x6636ee['order']=qs[_0xa13b('0x37')](_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x37')]);_0x6636ee['where']=qs[_0xa13b('0x2e')](_[_0xa13b('0x38')](_0x3cdc3b[_0xa13b('0x2c')],_0x1510eb['filters']));if(_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x3c')]){_0x6636ee[_0xa13b('0x39')]=_[_0xa13b('0x3a')](_0x6636ee['where'],{'$or':_['map'](_0x6636ee['attributes'],function(_0x509261){var _0x3eb39f={};_0x3eb39f[_0x509261]={'$like':'%'+_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x3c')]+'%'};return _0x3eb39f;})});}_0x6636ee=_['merge']({},_0x6636ee,_0x3cdc3b[_0xa13b('0x3d')]);return _0xeec0ab[_0xa13b('0x4b')](_0x6636ee);}})[_0xa13b('0x21')](function(_0x1c5f9e){if(_0x1c5f9e){_0x361187=_0x1c5f9e[_0xa13b('0x33')];if(!_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x34')]('nolimit')){_0x6636ee[_0xa13b('0x1a')]=qs[_0xa13b('0x1a')](_0x3cdc3b[_0xa13b('0x2c')]['limit']);_0x6636ee[_0xa13b('0x18')]=qs['offset'](_0x3cdc3b[_0xa13b('0x2c')][_0xa13b('0x18')]);}return _0xeec0ab[_0xa13b('0x4b')](_0x6636ee);}})['then'](function(_0x171b6d){if(_0x171b6d){return _0x171b6d?{'count':_0x361187,'rows':_0x171b6d}:null;}})[_0xa13b('0x21')](respondWithResult(_0x32e38a,null))[_0xa13b('0x42')](handleError(_0x32e38a,null));};exports[_0xa13b('0x4c')]=function(_0x5dd738,_0xa7af7,_0x525f0b){var _0x200911={};var _0x48264a={};var _0x2c5951;var _0x4e58ed;return db['VtigerConfiguration'][_0xa13b('0x49')]({'where':{'id':_0x5dd738[_0xa13b('0x44')]['id']}})[_0xa13b('0x21')](handleEntityNotFound(_0xa7af7,null))[_0xa13b('0x21')](function(_0x2dc1b9){if(_0x2dc1b9){_0x2c5951=_0x2dc1b9;_0x48264a[_0xa13b('0x30')]=_['keys'](db[_0xa13b('0x4a')][_0xa13b('0x28')]);_0x48264a[_0xa13b('0x2c')]=_['keys'](_0x5dd738[_0xa13b('0x2c')]);_0x48264a[_0xa13b('0x2e')]=_['intersection'](_0x48264a[_0xa13b('0x30')],_0x48264a[_0xa13b('0x2c')]);_0x200911['attributes']=_['intersection'](_0x48264a[_0xa13b('0x30')],qs[_0xa13b('0x32')](_0x5dd738[_0xa13b('0x2c')][_0xa13b('0x32')]));_0x200911[_0xa13b('0x31')]=_0x200911[_0xa13b('0x31')][_0xa13b('0x33')]?_0x200911['attributes']:_0x48264a[_0xa13b('0x30')];_0x200911[_0xa13b('0x36')]=qs[_0xa13b('0x37')](_0x5dd738[_0xa13b('0x2c')][_0xa13b('0x37')]);_0x200911['where']=qs[_0xa13b('0x2e')](_[_0xa13b('0x38')](_0x5dd738[_0xa13b('0x2c')],_0x48264a[_0xa13b('0x2e')]));if(_0x5dd738[_0xa13b('0x2c')][_0xa13b('0x3c')]){_0x200911[_0xa13b('0x39')]=_[_0xa13b('0x3a')](_0x200911[_0xa13b('0x39')],{'$or':_[_0xa13b('0x27')](_0x200911['attributes'],function(_0x32f459){var _0x1c9d63={};_0x1c9d63[_0x32f459]={'$like':'%'+_0x5dd738[_0xa13b('0x2c')][_0xa13b('0x3c')]+'%'};return _0x1c9d63;})});}_0x200911=_[_0xa13b('0x3a')]({},_0x200911,_0x5dd738['options']);return _0x2c5951[_0xa13b('0x4c')](_0x200911);}})[_0xa13b('0x21')](function(_0x271c96){if(_0x271c96){_0x4e58ed=_0x271c96['length'];if(!_0x5dd738['query'][_0xa13b('0x34')](_0xa13b('0x35'))){_0x200911[_0xa13b('0x1a')]=qs[_0xa13b('0x1a')](_0x5dd738[_0xa13b('0x2c')][_0xa13b('0x1a')]);_0x200911['offset']=qs[_0xa13b('0x18')](_0x5dd738[_0xa13b('0x2c')]['offset']);}return _0x2c5951['getDescriptions'](_0x200911);}})[_0xa13b('0x21')](function(_0x3281dd){if(_0x3281dd){return _0x3281dd?{'count':_0x4e58ed,'rows':_0x3281dd}:null;}})[_0xa13b('0x21')](respondWithResult(_0xa7af7,null))[_0xa13b('0x42')](handleError(_0xa7af7,null));}; \ No newline at end of file +var _0xa376=['../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','getFields','findOne','pick','getSubjects','VtigerField','getDescriptions','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x5b7a90,_0xeaeac9){var _0x41c7f6=function(_0x1bb157){while(--_0x1bb157){_0x5b7a90['push'](_0x5b7a90['shift']());}};_0x41c7f6(++_0xeaeac9);}(_0xa376,0x88));var _0x6a37=function(_0xd72144,_0x53e49b){_0xd72144=_0xd72144-0x0;var _0x308f66=_0xa376[_0xd72144];return _0x308f66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a37('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a37('0x1'));var moment=require(_0x6a37('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6a37('0x3'));var path=require(_0x6a37('0x4'));var sox=require(_0x6a37('0x5'));var csv=require(_0x6a37('0x6'));var ejs=require(_0x6a37('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a37('0x8'));var squel=require(_0x6a37('0x9'));var crypto=require(_0x6a37('0xa'));var jsforce=require(_0x6a37('0xb'));var deskjs=require(_0x6a37('0xc'));var toCsv=require(_0x6a37('0x6'));var querystring=require(_0x6a37('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a37('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a37('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6a37('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a37('0x11'))['db'];function respondWithStatusCode(_0x123ef3,_0x47457b){_0x47457b=_0x47457b||0xcc;return function(_0x3b371a){if(_0x3b371a){return _0x123ef3[_0x6a37('0x12')](_0x47457b);}return _0x123ef3['status'](_0x47457b)[_0x6a37('0x13')]();};}function respondWithResult(_0x5a2502,_0xf2f919){_0xf2f919=_0xf2f919||0xc8;return function(_0x58fb53){if(_0x58fb53){return _0x5a2502[_0x6a37('0x14')](_0xf2f919)['json'](_0x58fb53);}};}function respondWithFilteredResult(_0x1ec6e6,_0x3dfd5c){return function(_0x5340b1){if(_0x5340b1){var _0x952417=typeof _0x3dfd5c[_0x6a37('0x15')]===_0x6a37('0x16')&&typeof _0x3dfd5c[_0x6a37('0x17')]===_0x6a37('0x16');var _0x38181a=_0x5340b1[_0x6a37('0x18')];var _0x6b525a=_0x952417?0x0:_0x3dfd5c[_0x6a37('0x15')];var _0x22fc54=_0x952417?_0x5340b1['count']:_0x3dfd5c['offset']+_0x3dfd5c[_0x6a37('0x17')];var _0x1dbd0f;if(_0x22fc54>=_0x38181a){_0x22fc54=_0x38181a;_0x1dbd0f=0xc8;}else{_0x1dbd0f=0xce;}_0x1ec6e6[_0x6a37('0x14')](_0x1dbd0f);return _0x1ec6e6[_0x6a37('0x19')]('Content-Range',_0x6b525a+'-'+_0x22fc54+'/'+_0x38181a)[_0x6a37('0x1a')](_0x5340b1);}return null;};}function patchUpdates(_0x4c6411){return function(_0x5b6516){try{jsonpatch[_0x6a37('0x1b')](_0x5b6516,_0x4c6411,!![]);}catch(_0x1390fe){return BPromise[_0x6a37('0x1c')](_0x1390fe);}return _0x5b6516[_0x6a37('0x1d')]();};}function saveUpdates(_0x24ba24,_0x28a602){return function(_0x135352){if(_0x135352){return _0x135352['update'](_0x24ba24)[_0x6a37('0x1e')](function(_0x3ebe08){return _0x3ebe08;});}return null;};}function removeEntity(_0x4500f1,_0x13fc84){return function(_0x460324){if(_0x460324){return _0x460324[_0x6a37('0x1f')]()[_0x6a37('0x1e')](function(){_0x4500f1['status'](0xcc)[_0x6a37('0x13')]();});}};}function handleEntityNotFound(_0xf8d82d,_0x3a21bd){return function(_0x187ebb){if(!_0x187ebb){_0xf8d82d[_0x6a37('0x12')](0x194);}return _0x187ebb;};}function handleError(_0x5fc322,_0x33347f){_0x33347f=_0x33347f||0x1f4;return function(_0x3c25a5){logger[_0x6a37('0x20')](_0x3c25a5[_0x6a37('0x21')]);if(_0x3c25a5[_0x6a37('0x22')]){delete _0x3c25a5[_0x6a37('0x22')];}_0x5fc322[_0x6a37('0x14')](_0x33347f)[_0x6a37('0x23')](_0x3c25a5);};}exports[_0x6a37('0x24')]=function(_0x18f076,_0x2398d9){var _0x1bf83b={},_0x2573e5={},_0x5cfa53={'count':0x0,'rows':[]};var _0x5be572=_[_0x6a37('0x25')](db[_0x6a37('0x26')][_0x6a37('0x27')],function(_0x22ae1b){return{'name':_0x22ae1b[_0x6a37('0x28')],'type':_0x22ae1b[_0x6a37('0x29')][_0x6a37('0x2a')]};});_0x2573e5[_0x6a37('0x2b')]=_[_0x6a37('0x25')](_0x5be572,_0x6a37('0x22'));_0x2573e5['query']=_[_0x6a37('0x2c')](_0x18f076['query']);_0x2573e5['filters']=_[_0x6a37('0x2d')](_0x2573e5[_0x6a37('0x2b')],_0x2573e5[_0x6a37('0x2e')]);_0x1bf83b[_0x6a37('0x2f')]=_['intersection'](_0x2573e5[_0x6a37('0x2b')],qs[_0x6a37('0x30')](_0x18f076[_0x6a37('0x2e')]['fields']));_0x1bf83b[_0x6a37('0x2f')]=_0x1bf83b[_0x6a37('0x2f')][_0x6a37('0x31')]?_0x1bf83b[_0x6a37('0x2f')]:_0x2573e5[_0x6a37('0x2b')];if(!_0x18f076[_0x6a37('0x2e')][_0x6a37('0x32')](_0x6a37('0x33'))){_0x1bf83b['limit']=qs[_0x6a37('0x17')](_0x18f076[_0x6a37('0x2e')][_0x6a37('0x17')]);_0x1bf83b['offset']=qs[_0x6a37('0x15')](_0x18f076['query'][_0x6a37('0x15')]);}_0x1bf83b[_0x6a37('0x34')]=qs[_0x6a37('0x35')](_0x18f076[_0x6a37('0x2e')]['sort']);_0x1bf83b['where']=qs[_0x6a37('0x36')](_['pick'](_0x18f076[_0x6a37('0x2e')],_0x2573e5['filters']),_0x5be572);if(_0x18f076[_0x6a37('0x2e')][_0x6a37('0x37')]){_0x1bf83b['where']=_[_0x6a37('0x38')](_0x1bf83b[_0x6a37('0x39')],{'$or':_[_0x6a37('0x25')](_0x5be572,function(_0x1b2c1f){if(_0x1b2c1f[_0x6a37('0x29')]!==_0x6a37('0x3a')){var _0x402687={};_0x402687[_0x1b2c1f['name']]={'$like':'%'+_0x18f076['query'][_0x6a37('0x37')]+'%'};return _0x402687;}})});}_0x1bf83b=_[_0x6a37('0x38')]({},_0x1bf83b,_0x18f076[_0x6a37('0x3b')]);var _0x58c04c={'where':_0x1bf83b[_0x6a37('0x39')]};return db['VtigerConfiguration']['count'](_0x58c04c)['then'](function(_0x574b14){_0x5cfa53[_0x6a37('0x18')]=_0x574b14;if(_0x18f076['query']['includeAll']){_0x1bf83b[_0x6a37('0x3c')]=[{'all':!![]}];}return db[_0x6a37('0x26')][_0x6a37('0x3d')](_0x1bf83b);})[_0x6a37('0x1e')](function(_0x165c44){_0x5cfa53[_0x6a37('0x3e')]=_0x165c44;return _0x5cfa53;})[_0x6a37('0x1e')](respondWithFilteredResult(_0x2398d9,_0x1bf83b))[_0x6a37('0x3f')](handleError(_0x2398d9,null));};exports['show']=function(_0x5268d0,_0x3463fe){var _0x517664={'raw':![],'where':{'id':_0x5268d0[_0x6a37('0x40')]['id']}},_0x1c3369={};_0x1c3369[_0x6a37('0x2b')]=_[_0x6a37('0x2c')](db[_0x6a37('0x26')]['rawAttributes']);_0x1c3369[_0x6a37('0x2e')]=_['keys'](_0x5268d0[_0x6a37('0x2e')]);_0x1c3369[_0x6a37('0x36')]=_['intersection'](_0x1c3369[_0x6a37('0x2b')],_0x1c3369['query']);_0x517664[_0x6a37('0x2f')]=_[_0x6a37('0x2d')](_0x1c3369[_0x6a37('0x2b')],qs[_0x6a37('0x30')](_0x5268d0[_0x6a37('0x2e')][_0x6a37('0x30')]));_0x517664[_0x6a37('0x2f')]=_0x517664[_0x6a37('0x2f')]['length']?_0x517664[_0x6a37('0x2f')]:_0x1c3369[_0x6a37('0x2b')];if(_0x5268d0[_0x6a37('0x2e')][_0x6a37('0x41')]){_0x517664[_0x6a37('0x3c')]=[{'all':!![]}];}_0x517664=_[_0x6a37('0x38')]({},_0x517664,_0x5268d0[_0x6a37('0x3b')]);return db[_0x6a37('0x26')][_0x6a37('0x42')](_0x517664)['then'](handleEntityNotFound(_0x3463fe,null))[_0x6a37('0x1e')](respondWithResult(_0x3463fe,null))['catch'](handleError(_0x3463fe,null));};exports[_0x6a37('0x43')]=function(_0x1b99a0,_0x2ea3a6){return db[_0x6a37('0x26')][_0x6a37('0x43')](_0x1b99a0[_0x6a37('0x44')],{})[_0x6a37('0x1e')](respondWithResult(_0x2ea3a6,0xc9))['catch'](handleError(_0x2ea3a6,null));};exports[_0x6a37('0x45')]=function(_0x2fcc95,_0x786497){if(_0x2fcc95[_0x6a37('0x44')]['id']){delete _0x2fcc95['body']['id'];}return db[_0x6a37('0x26')][_0x6a37('0x42')]({'where':{'id':_0x2fcc95[_0x6a37('0x40')]['id']}})[_0x6a37('0x1e')](handleEntityNotFound(_0x786497,null))['then'](saveUpdates(_0x2fcc95['body'],null))['then'](respondWithResult(_0x786497,null))[_0x6a37('0x3f')](handleError(_0x786497,null));};exports['destroy']=function(_0x3b9e0a,_0x3f286a){return db[_0x6a37('0x26')][_0x6a37('0x42')]({'where':{'id':_0x3b9e0a['params']['id']}})[_0x6a37('0x1e')](handleEntityNotFound(_0x3f286a,null))[_0x6a37('0x1e')](removeEntity(_0x3f286a,null))[_0x6a37('0x3f')](handleError(_0x3f286a,null));};exports[_0x6a37('0x46')]=function(_0x3b74b6,_0x5cd706,_0x12e773){var _0x29a2bf={};var _0x4e4d99={};var _0x17edf6;var _0x51c0ce;return db[_0x6a37('0x26')][_0x6a37('0x47')]({'where':{'id':_0x3b74b6['params']['id']}})[_0x6a37('0x1e')](handleEntityNotFound(_0x5cd706,null))['then'](function(_0x2a3509){if(_0x2a3509){_0x17edf6=_0x2a3509;_0x4e4d99[_0x6a37('0x2b')]=_[_0x6a37('0x2c')](db['VtigerField'][_0x6a37('0x27')]);_0x4e4d99[_0x6a37('0x2e')]=_['keys'](_0x3b74b6[_0x6a37('0x2e')]);_0x4e4d99[_0x6a37('0x36')]=_[_0x6a37('0x2d')](_0x4e4d99[_0x6a37('0x2b')],_0x4e4d99[_0x6a37('0x2e')]);_0x29a2bf['attributes']=_[_0x6a37('0x2d')](_0x4e4d99[_0x6a37('0x2b')],qs[_0x6a37('0x30')](_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x30')]));_0x29a2bf[_0x6a37('0x2f')]=_0x29a2bf['attributes']['length']?_0x29a2bf['attributes']:_0x4e4d99['model'];_0x29a2bf[_0x6a37('0x34')]=qs[_0x6a37('0x35')](_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x35')]);_0x29a2bf[_0x6a37('0x39')]=qs[_0x6a37('0x36')](_[_0x6a37('0x48')](_0x3b74b6[_0x6a37('0x2e')],_0x4e4d99[_0x6a37('0x36')]));if(_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x37')]){_0x29a2bf[_0x6a37('0x39')]=_[_0x6a37('0x38')](_0x29a2bf[_0x6a37('0x39')],{'$or':_[_0x6a37('0x25')](_0x29a2bf['attributes'],function(_0x784f9b){var _0x264557={};_0x264557[_0x784f9b]={'$like':'%'+_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x37')]+'%'};return _0x264557;})});}_0x29a2bf=_[_0x6a37('0x38')]({},_0x29a2bf,_0x3b74b6[_0x6a37('0x3b')]);return _0x17edf6['getFields'](_0x29a2bf);}})[_0x6a37('0x1e')](function(_0x352975){if(_0x352975){_0x51c0ce=_0x352975['length'];if(!_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x32')](_0x6a37('0x33'))){_0x29a2bf[_0x6a37('0x17')]=qs['limit'](_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x17')]);_0x29a2bf[_0x6a37('0x15')]=qs[_0x6a37('0x15')](_0x3b74b6[_0x6a37('0x2e')][_0x6a37('0x15')]);}return _0x17edf6[_0x6a37('0x46')](_0x29a2bf);}})[_0x6a37('0x1e')](function(_0x21d03f){if(_0x21d03f){return _0x21d03f?{'count':_0x51c0ce,'rows':_0x21d03f}:null;}})['then'](respondWithResult(_0x5cd706,null))[_0x6a37('0x3f')](handleError(_0x5cd706,null));};exports[_0x6a37('0x49')]=function(_0x2f3a2f,_0x2bf588,_0x2569a9){var _0x56884e={};var _0x4a06a6={};var _0x26153a;var _0x2906a4;return db[_0x6a37('0x26')]['findOne']({'where':{'id':_0x2f3a2f['params']['id']}})['then'](handleEntityNotFound(_0x2bf588,null))['then'](function(_0x280daf){if(_0x280daf){_0x26153a=_0x280daf;_0x4a06a6[_0x6a37('0x2b')]=_['keys'](db[_0x6a37('0x4a')][_0x6a37('0x27')]);_0x4a06a6['query']=_[_0x6a37('0x2c')](_0x2f3a2f['query']);_0x4a06a6[_0x6a37('0x36')]=_[_0x6a37('0x2d')](_0x4a06a6['model'],_0x4a06a6['query']);_0x56884e['attributes']=_[_0x6a37('0x2d')](_0x4a06a6['model'],qs[_0x6a37('0x30')](_0x2f3a2f[_0x6a37('0x2e')][_0x6a37('0x30')]));_0x56884e['attributes']=_0x56884e[_0x6a37('0x2f')]['length']?_0x56884e['attributes']:_0x4a06a6[_0x6a37('0x2b')];_0x56884e[_0x6a37('0x34')]=qs['sort'](_0x2f3a2f['query'][_0x6a37('0x35')]);_0x56884e[_0x6a37('0x39')]=qs[_0x6a37('0x36')](_['pick'](_0x2f3a2f[_0x6a37('0x2e')],_0x4a06a6['filters']));if(_0x2f3a2f[_0x6a37('0x2e')][_0x6a37('0x37')]){_0x56884e[_0x6a37('0x39')]=_[_0x6a37('0x38')](_0x56884e[_0x6a37('0x39')],{'$or':_[_0x6a37('0x25')](_0x56884e[_0x6a37('0x2f')],function(_0x4bc74){var _0x3af6be={};_0x3af6be[_0x4bc74]={'$like':'%'+_0x2f3a2f['query'][_0x6a37('0x37')]+'%'};return _0x3af6be;})});}_0x56884e=_[_0x6a37('0x38')]({},_0x56884e,_0x2f3a2f['options']);return _0x26153a[_0x6a37('0x49')](_0x56884e);}})[_0x6a37('0x1e')](function(_0x252438){if(_0x252438){_0x2906a4=_0x252438['length'];if(!_0x2f3a2f[_0x6a37('0x2e')]['hasOwnProperty'](_0x6a37('0x33'))){_0x56884e['limit']=qs['limit'](_0x2f3a2f['query'][_0x6a37('0x17')]);_0x56884e[_0x6a37('0x15')]=qs[_0x6a37('0x15')](_0x2f3a2f['query']['offset']);}return _0x26153a[_0x6a37('0x49')](_0x56884e);}})[_0x6a37('0x1e')](function(_0x4da881){if(_0x4da881){return _0x4da881?{'count':_0x2906a4,'rows':_0x4da881}:null;}})[_0x6a37('0x1e')](respondWithResult(_0x2bf588,null))[_0x6a37('0x3f')](handleError(_0x2bf588,null));};exports[_0x6a37('0x4b')]=function(_0x55f523,_0x4aeb45,_0x4e3297){var _0x31cc1c={};var _0x57e4b7={};var _0x1f2425;var _0x2c0183;return db[_0x6a37('0x26')][_0x6a37('0x47')]({'where':{'id':_0x55f523[_0x6a37('0x40')]['id']}})[_0x6a37('0x1e')](handleEntityNotFound(_0x4aeb45,null))[_0x6a37('0x1e')](function(_0x2924a5){if(_0x2924a5){_0x1f2425=_0x2924a5;_0x57e4b7[_0x6a37('0x2b')]=_[_0x6a37('0x2c')](db[_0x6a37('0x4a')][_0x6a37('0x27')]);_0x57e4b7[_0x6a37('0x2e')]=_[_0x6a37('0x2c')](_0x55f523[_0x6a37('0x2e')]);_0x57e4b7['filters']=_[_0x6a37('0x2d')](_0x57e4b7[_0x6a37('0x2b')],_0x57e4b7[_0x6a37('0x2e')]);_0x31cc1c['attributes']=_[_0x6a37('0x2d')](_0x57e4b7['model'],qs[_0x6a37('0x30')](_0x55f523[_0x6a37('0x2e')][_0x6a37('0x30')]));_0x31cc1c[_0x6a37('0x2f')]=_0x31cc1c[_0x6a37('0x2f')][_0x6a37('0x31')]?_0x31cc1c[_0x6a37('0x2f')]:_0x57e4b7[_0x6a37('0x2b')];_0x31cc1c['order']=qs['sort'](_0x55f523['query'][_0x6a37('0x35')]);_0x31cc1c[_0x6a37('0x39')]=qs[_0x6a37('0x36')](_['pick'](_0x55f523['query'],_0x57e4b7[_0x6a37('0x36')]));if(_0x55f523[_0x6a37('0x2e')][_0x6a37('0x37')]){_0x31cc1c[_0x6a37('0x39')]=_[_0x6a37('0x38')](_0x31cc1c[_0x6a37('0x39')],{'$or':_['map'](_0x31cc1c[_0x6a37('0x2f')],function(_0x3712a7){var _0x1b4a1c={};_0x1b4a1c[_0x3712a7]={'$like':'%'+_0x55f523[_0x6a37('0x2e')][_0x6a37('0x37')]+'%'};return _0x1b4a1c;})});}_0x31cc1c=_['merge']({},_0x31cc1c,_0x55f523[_0x6a37('0x3b')]);return _0x1f2425[_0x6a37('0x4b')](_0x31cc1c);}})['then'](function(_0x4d5743){if(_0x4d5743){_0x2c0183=_0x4d5743['length'];if(!_0x55f523[_0x6a37('0x2e')][_0x6a37('0x32')](_0x6a37('0x33'))){_0x31cc1c['limit']=qs[_0x6a37('0x17')](_0x55f523[_0x6a37('0x2e')][_0x6a37('0x17')]);_0x31cc1c[_0x6a37('0x15')]=qs[_0x6a37('0x15')](_0x55f523[_0x6a37('0x2e')][_0x6a37('0x15')]);}return _0x1f2425[_0x6a37('0x4b')](_0x31cc1c);}})[_0x6a37('0x1e')](function(_0x207015){if(_0x207015){return _0x207015?{'count':_0x2c0183,'rows':_0x207015}:null;}})[_0x6a37('0x1e')](respondWithResult(_0x4aeb45,null))[_0x6a37('0x3f')](handleError(_0x4aeb45,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6b7a25f..d9bf4c5 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 _0xdb63=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xdb63,0xde));var _0x3db6=function(_0x4a46d3,_0x1b76be){_0x4a46d3=_0x4a46d3-0x0;var _0x1b50ae=_0xdb63[_0x4a46d3];return _0x1b50ae;};'use strict';var _=require(_0x3db6('0x0'));var util=require(_0x3db6('0x1'));var logger=require('../../config/logger')(_0x3db6('0x2'));var moment=require(_0x3db6('0x3'));var BPromise=require(_0x3db6('0x4'));var rp=require(_0x3db6('0x5'));var fs=require('fs');var path=require(_0x3db6('0x6'));var rimraf=require(_0x3db6('0x7'));var config=require(_0x3db6('0x8'));var attributes=require(_0x3db6('0x9'));module[_0x3db6('0xa')]=function(_0x82d1ae,_0x56918c){return _0x82d1ae['define'](_0x3db6('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbc8=['util','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x194494,_0x57c76e){var _0x45acaf=function(_0x37e62f){while(--_0x37e62f){_0x194494['push'](_0x194494['shift']());}};_0x45acaf(++_0x57c76e);}(_0xcbc8,0xb0));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8cbc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8cbc('0x1'));var BPromise=require(_0x8cbc('0x2'));var rp=require(_0x8cbc('0x3'));var fs=require('fs');var path=require(_0x8cbc('0x4'));var rimraf=require(_0x8cbc('0x5'));var config=require('../../config/environment');var attributes=require(_0x8cbc('0x6'));module[_0x8cbc('0x7')]=function(_0x1a91fd,_0x4fbd17){return _0x1a91fd[_0x8cbc('0x8')](_0x8cbc('0x9'),attributes,{'tableName':_0x8cbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index df1c914..0c04bf1 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 _0x8f15=['http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2bed03,_0x8035db){var _0x281223=function(_0x4d02bf){while(--_0x4d02bf){_0x2bed03['push'](_0x2bed03['shift']());}};_0x281223(++_0x8035db);}(_0x8f15,0x1f0));var _0x58f1=function(_0x4f6f77,_0x228325){_0x4f6f77=_0x4f6f77-0x0;var _0x45562f=_0x8f15[_0x4f6f77];return _0x45562f;};'use strict';var _=require(_0x58f1('0x0'));var util=require('util');var moment=require(_0x58f1('0x1'));var BPromise=require(_0x58f1('0x2'));var rs=require(_0x58f1('0x3'));var fs=require('fs');var Redis=require(_0x58f1('0x4'));var db=require(_0x58f1('0x5'))['db'];var utils=require(_0x58f1('0x6'));var logger=require(_0x58f1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x58f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54312f,_0x532eb3,_0x5da244){return new BPromise(function(_0x108926,_0x3740ba){return client[_0x58f1('0x9')](_0x54312f,_0x5da244)[_0x58f1('0xa')](function(_0x5a02b5){logger['info'](_0x58f1('0xb'),_0x532eb3,_0x58f1('0xc'));logger[_0x58f1('0xd')](_0x58f1('0xe'),_0x532eb3,_0x58f1('0xc'),JSON['stringify'](_0x5a02b5));if(_0x5a02b5['error']){if(_0x5a02b5[_0x58f1('0xf')]['code']===0x1f4){logger['error'](_0x58f1('0xb'),_0x532eb3,_0x5a02b5[_0x58f1('0xf')][_0x58f1('0x10')]);return _0x3740ba(_0x5a02b5[_0x58f1('0xf')]['message']);}logger[_0x58f1('0xf')](_0x58f1('0xb'),_0x532eb3,_0x5a02b5['error'][_0x58f1('0x10')]);return _0x108926(_0x5a02b5[_0x58f1('0xf')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x532eb3,'request\x20sent');_0x108926(_0x5a02b5['result'][_0x58f1('0x10')]);}})[_0x58f1('0x11')](function(_0xa459c3){logger[_0x58f1('0xf')](_0x58f1('0xb'),_0x532eb3,_0xa459c3);_0x3740ba(_0xa459c3);});});} \ No newline at end of file +var _0x1a74=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util'];(function(_0x3c79d1,_0x1e55d4){var _0x1646e8=function(_0x278dfe){while(--_0x278dfe){_0x3c79d1['push'](_0x3c79d1['shift']());}};_0x1646e8(++_0x1e55d4);}(_0x1a74,0x1da));var _0x41a7=function(_0x1138cd,_0x4fa9a4){_0x1138cd=_0x1138cd-0x0;var _0x5eae44=_0x1a74[_0x1138cd];return _0x5eae44;};'use strict';var _=require('lodash');var util=require(_0x41a7('0x0'));var moment=require(_0x41a7('0x1'));var BPromise=require(_0x41a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41a7('0x3'));var db=require(_0x41a7('0x4'))['db'];var utils=require(_0x41a7('0x5'));var logger=require(_0x41a7('0x6'))(_0x41a7('0x7'));var config=require('../../config/environment');var jayson=require(_0x41a7('0x8'));var client=jayson[_0x41a7('0x9')][_0x41a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a351b,_0x5df65d,_0x37b32a){return new BPromise(function(_0x17da60,_0x839d1d){return client['request'](_0x2a351b,_0x37b32a)[_0x41a7('0xb')](function(_0x29c922){logger['info'](_0x41a7('0xc'),_0x5df65d,_0x41a7('0xd'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5df65d,_0x41a7('0xd'),JSON[_0x41a7('0xe')](_0x29c922));if(_0x29c922[_0x41a7('0xf')]){if(_0x29c922[_0x41a7('0xf')]['code']===0x1f4){logger['error'](_0x41a7('0xc'),_0x5df65d,_0x29c922[_0x41a7('0xf')][_0x41a7('0x10')]);return _0x839d1d(_0x29c922['error'][_0x41a7('0x10')]);}logger[_0x41a7('0xf')](_0x41a7('0xc'),_0x5df65d,_0x29c922[_0x41a7('0xf')][_0x41a7('0x10')]);return _0x17da60(_0x29c922[_0x41a7('0xf')][_0x41a7('0x10')]);}else{logger['info'](_0x41a7('0xc'),_0x5df65d,_0x41a7('0xd'));_0x17da60(_0x29c922[_0x41a7('0x11')][_0x41a7('0x10')]);}})[_0x41a7('0x12')](function(_0x58ead9){logger[_0x41a7('0xf')](_0x41a7('0xc'),_0x5df65d,_0x58ead9);_0x839d1d(_0x58ead9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index de1dcb6..969d046 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 _0x856e=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b750f,_0x3f0eb8){var _0x5bb5ab=function(_0x3c1789){while(--_0x3c1789){_0x1b750f['push'](_0x1b750f['shift']());}};_0x5bb5ab(++_0x3f0eb8);}(_0x856e,0x1ae));var _0xe856=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x856e[_0x473738];return _0x1df4ae;};'use strict';var multer=require(_0xe856('0x0'));var util=require(_0xe856('0x1'));var path=require(_0xe856('0x2'));var timeout=require(_0xe856('0x3'));var express=require(_0xe856('0x4'));var router=express[_0xe856('0x5')]();var fs_extra=require(_0xe856('0x6'));var auth=require(_0xe856('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe856('0x8'));var controller=require('./intVtigerField.controller');router[_0xe856('0x9')]('/',auth[_0xe856('0xa')](),controller[_0xe856('0xb')]);router[_0xe856('0x9')](_0xe856('0xc'),auth['isAuthenticated'](),controller[_0xe856('0xd')]);router[_0xe856('0xe')]('/',auth[_0xe856('0xa')](),controller[_0xe856('0xf')]);router['put'](_0xe856('0xc'),auth[_0xe856('0xa')](),controller[_0xe856('0x10')]);router['delete'](_0xe856('0xc'),auth[_0xe856('0xa')](),controller[_0xe856('0x11')]);module[_0xe856('0x12')]=router; \ No newline at end of file +var _0x1009=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x32ba59,_0x5e101f){var _0x343029=function(_0x482901){while(--_0x482901){_0x32ba59['push'](_0x32ba59['shift']());}};_0x343029(++_0x5e101f);}(_0x1009,0x183));var _0x9100=function(_0x107bfe,_0xf91c9c){_0x107bfe=_0x107bfe-0x0;var _0x227a7c=_0x1009[_0x107bfe];return _0x227a7c;};'use strict';var multer=require(_0x9100('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9100('0x1'));var express=require(_0x9100('0x2'));var router=express['Router']();var fs_extra=require(_0x9100('0x3'));var auth=require(_0x9100('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x9100('0x5')]('/',auth[_0x9100('0x6')](),controller['index']);router[_0x9100('0x5')](_0x9100('0x7'),auth[_0x9100('0x6')](),controller[_0x9100('0x8')]);router[_0x9100('0x9')]('/',auth[_0x9100('0x6')](),controller[_0x9100('0xa')]);router[_0x9100('0xb')](_0x9100('0x7'),auth[_0x9100('0x6')](),controller[_0x9100('0xc')]);router[_0x9100('0xd')](_0x9100('0x7'),auth[_0x9100('0x6')](),controller[_0x9100('0xe')]);module[_0x9100('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 3d6b43a..c9511dc 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 _0x2fb1=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x2fb1,0x1cc));var _0x12fb=function(_0x5da29f,_0x1e279f){_0x5da29f=_0x5da29f-0x0;var _0x252b33=_0x2fb1[_0x5da29f];return _0x252b33;};'use strict';var Sequelize=require(_0x12fb('0x0'));module[_0x12fb('0x1')]={'type':{'type':Sequelize[_0x12fb('0x2')]('string',_0x12fb('0x3'),_0x12fb('0x4'),_0x12fb('0x5'),'picklist'),'defaultValue':_0x12fb('0x6')},'content':{'type':Sequelize[_0x12fb('0x7')]},'key':{'type':Sequelize[_0x12fb('0x7')]},'keyType':{'type':Sequelize[_0x12fb('0x2')](_0x12fb('0x6'),_0x12fb('0x3'),_0x12fb('0x4'))},'keyContent':{'type':Sequelize[_0x12fb('0x7')]},'idField':{'type':Sequelize[_0x12fb('0x7')]},'nameField':{'type':Sequelize[_0x12fb('0x7')]},'customField':{'type':Sequelize[_0x12fb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x12fb('0x7')]}}; \ No newline at end of file +var _0x066f=['exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x066f,0x195));var _0xf066=function(_0x5edc42,_0x4bd24f){_0x5edc42=_0x5edc42-0x0;var _0x7757cd=_0x066f[_0x5edc42];return _0x7757cd;};'use strict';var Sequelize=require('sequelize');module[_0xf066('0x0')]={'type':{'type':Sequelize[_0xf066('0x1')]('string',_0xf066('0x2'),'customVariable',_0xf066('0x3'),_0xf066('0x4')),'defaultValue':_0xf066('0x5')},'content':{'type':Sequelize[_0xf066('0x6')]},'key':{'type':Sequelize[_0xf066('0x6')]},'keyType':{'type':Sequelize[_0xf066('0x1')](_0xf066('0x5'),_0xf066('0x2'),_0xf066('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf066('0x6')]},'nameField':{'type':Sequelize[_0xf066('0x6')]},'customField':{'type':Sequelize[_0xf066('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index eb8992c..d3116e8 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 _0x6ff1=['length','hasOwnProperty','order','sort','pick','filter','where','merge','options','VtigerField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x817a90,_0x1f5b18){var _0x511f52=function(_0x5f1e1a){while(--_0x5f1e1a){_0x817a90['push'](_0x817a90['shift']());}};_0x511f52(++_0x1f5b18);}(_0x6ff1,0x18c));var _0x16ff=function(_0x1b78ec,_0x592b5f){_0x1b78ec=_0x1b78ec-0x0;var _0x1358df=_0x6ff1[_0x1b78ec];return _0x1358df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16ff('0x0'));var zipdir=require(_0x16ff('0x1'));var jsonpatch=require(_0x16ff('0x2'));var rp=require(_0x16ff('0x3'));var moment=require(_0x16ff('0x4'));var BPromise=require(_0x16ff('0x5'));var Mustache=require(_0x16ff('0x6'));var util=require('util');var path=require(_0x16ff('0x7'));var sox=require('sox');var csv=require(_0x16ff('0x8'));var ejs=require(_0x16ff('0x9'));var fs=require('fs');var fs_extra=require(_0x16ff('0xa'));var _=require(_0x16ff('0xb'));var squel=require(_0x16ff('0xc'));var crypto=require(_0x16ff('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x16ff('0xe'));var toCsv=require(_0x16ff('0x8'));var querystring=require('querystring');var Papa=require(_0x16ff('0xf'));var Redis=require('ioredis');var authService=require(_0x16ff('0x10'));var qs=require(_0x16ff('0x11'));var as=require(_0x16ff('0x12'));var hardwareService=require(_0x16ff('0x13'));var logger=require(_0x16ff('0x14'))(_0x16ff('0x15'));var utils=require(_0x16ff('0x16'));var config=require(_0x16ff('0x17'));var licenseUtil=require(_0x16ff('0x18'));var db=require(_0x16ff('0x19'))['db'];function respondWithStatusCode(_0x57a963,_0x337f4b){_0x337f4b=_0x337f4b||0xcc;return function(_0x2a22c9){if(_0x2a22c9){return _0x57a963[_0x16ff('0x1a')](_0x337f4b);}return _0x57a963['status'](_0x337f4b)['end']();};}function respondWithResult(_0x5f0b74,_0xa90d79){_0xa90d79=_0xa90d79||0xc8;return function(_0x2c13a8){if(_0x2c13a8){return _0x5f0b74[_0x16ff('0x1b')](_0xa90d79)[_0x16ff('0x1c')](_0x2c13a8);}};}function respondWithFilteredResult(_0x510100,_0x548303){return function(_0x9fb37b){if(_0x9fb37b){var _0x76edec=typeof _0x548303[_0x16ff('0x1d')]==='undefined'&&typeof _0x548303[_0x16ff('0x1e')]===_0x16ff('0x1f');var _0xb43647=_0x9fb37b[_0x16ff('0x20')];var _0x27aca9=_0x76edec?0x0:_0x548303['offset'];var _0x171296=_0x76edec?_0x9fb37b[_0x16ff('0x20')]:_0x548303[_0x16ff('0x1d')]+_0x548303['limit'];var _0x4b6c96;if(_0x171296>=_0xb43647){_0x171296=_0xb43647;_0x4b6c96=0xc8;}else{_0x4b6c96=0xce;}_0x510100[_0x16ff('0x1b')](_0x4b6c96);return _0x510100[_0x16ff('0x21')](_0x16ff('0x22'),_0x27aca9+'-'+_0x171296+'/'+_0xb43647)[_0x16ff('0x1c')](_0x9fb37b);}return null;};}function patchUpdates(_0x3f900a){return function(_0x4c5dac){try{jsonpatch[_0x16ff('0x23')](_0x4c5dac,_0x3f900a,!![]);}catch(_0x5bfcb4){return BPromise[_0x16ff('0x24')](_0x5bfcb4);}return _0x4c5dac['save']();};}function saveUpdates(_0xe2ff2,_0x5afadf){return function(_0x408924){if(_0x408924){return _0x408924[_0x16ff('0x25')](_0xe2ff2)[_0x16ff('0x26')](function(_0x572cc3){return _0x572cc3;});}return null;};}function removeEntity(_0x25d623,_0x5c9242){return function(_0x2371e5){if(_0x2371e5){return _0x2371e5[_0x16ff('0x27')]()[_0x16ff('0x26')](function(){_0x25d623[_0x16ff('0x1b')](0xcc)[_0x16ff('0x28')]();});}};}function handleEntityNotFound(_0x5b8273,_0x1d2f48){return function(_0x3fa428){if(!_0x3fa428){_0x5b8273[_0x16ff('0x1a')](0x194);}return _0x3fa428;};}function handleError(_0x26abf8,_0x26dd21){_0x26dd21=_0x26dd21||0x1f4;return function(_0x176f7b){logger[_0x16ff('0x29')](_0x176f7b[_0x16ff('0x2a')]);if(_0x176f7b[_0x16ff('0x2b')]){delete _0x176f7b[_0x16ff('0x2b')];}_0x26abf8[_0x16ff('0x1b')](_0x26dd21)['send'](_0x176f7b);};}exports['index']=function(_0x265b53,_0x452b17){var _0x3871d2={},_0x5c8c95={},_0x1d24b9={'count':0x0,'rows':[]};var _0x1e8d1e=_[_0x16ff('0x2c')](db['VtigerField']['rawAttributes'],function(_0x54aac3){return{'name':_0x54aac3[_0x16ff('0x2d')],'type':_0x54aac3[_0x16ff('0x2e')]['key']};});_0x5c8c95[_0x16ff('0x2f')]=_['map'](_0x1e8d1e,_0x16ff('0x2b'));_0x5c8c95[_0x16ff('0x30')]=_[_0x16ff('0x31')](_0x265b53[_0x16ff('0x30')]);_0x5c8c95[_0x16ff('0x32')]=_[_0x16ff('0x33')](_0x5c8c95[_0x16ff('0x2f')],_0x5c8c95['query']);_0x3871d2[_0x16ff('0x34')]=_['intersection'](_0x5c8c95['model'],qs['fields'](_0x265b53['query'][_0x16ff('0x35')]));_0x3871d2[_0x16ff('0x34')]=_0x3871d2[_0x16ff('0x34')][_0x16ff('0x36')]?_0x3871d2[_0x16ff('0x34')]:_0x5c8c95[_0x16ff('0x2f')];if(!_0x265b53[_0x16ff('0x30')][_0x16ff('0x37')]('nolimit')){_0x3871d2[_0x16ff('0x1e')]=qs[_0x16ff('0x1e')](_0x265b53[_0x16ff('0x30')][_0x16ff('0x1e')]);_0x3871d2['offset']=qs[_0x16ff('0x1d')](_0x265b53[_0x16ff('0x30')]['offset']);}_0x3871d2[_0x16ff('0x38')]=qs[_0x16ff('0x39')](_0x265b53['query']['sort']);_0x3871d2['where']=qs[_0x16ff('0x32')](_[_0x16ff('0x3a')](_0x265b53[_0x16ff('0x30')],_0x5c8c95['filters']),_0x1e8d1e);if(_0x265b53[_0x16ff('0x30')][_0x16ff('0x3b')]){_0x3871d2[_0x16ff('0x3c')]=_[_0x16ff('0x3d')](_0x3871d2[_0x16ff('0x3c')],{'$or':_[_0x16ff('0x2c')](_0x1e8d1e,function(_0x503417){if(_0x503417[_0x16ff('0x2e')]!=='VIRTUAL'){var _0x316c2a={};_0x316c2a[_0x503417[_0x16ff('0x2b')]]={'$like':'%'+_0x265b53[_0x16ff('0x30')]['filter']+'%'};return _0x316c2a;}})});}_0x3871d2=_[_0x16ff('0x3d')]({},_0x3871d2,_0x265b53[_0x16ff('0x3e')]);var _0x1f7789={'where':_0x3871d2[_0x16ff('0x3c')]};return db[_0x16ff('0x3f')][_0x16ff('0x20')](_0x1f7789)['then'](function(_0x477abc){_0x1d24b9['count']=_0x477abc;if(_0x265b53[_0x16ff('0x30')][_0x16ff('0x40')]){_0x3871d2[_0x16ff('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x16ff('0x42')](_0x3871d2);})['then'](function(_0xc070b4){_0x1d24b9[_0x16ff('0x43')]=_0xc070b4;return _0x1d24b9;})[_0x16ff('0x26')](respondWithFilteredResult(_0x452b17,_0x3871d2))[_0x16ff('0x44')](handleError(_0x452b17,null));};exports[_0x16ff('0x45')]=function(_0x9ebb4,_0x4fd1c1){var _0x373692={'raw':!![],'where':{'id':_0x9ebb4[_0x16ff('0x46')]['id']}},_0x32d8d0={};_0x32d8d0['model']=_[_0x16ff('0x31')](db[_0x16ff('0x3f')][_0x16ff('0x47')]);_0x32d8d0[_0x16ff('0x30')]=_[_0x16ff('0x31')](_0x9ebb4[_0x16ff('0x30')]);_0x32d8d0[_0x16ff('0x32')]=_['intersection'](_0x32d8d0[_0x16ff('0x2f')],_0x32d8d0[_0x16ff('0x30')]);_0x373692[_0x16ff('0x34')]=_[_0x16ff('0x33')](_0x32d8d0[_0x16ff('0x2f')],qs[_0x16ff('0x35')](_0x9ebb4[_0x16ff('0x30')][_0x16ff('0x35')]));_0x373692[_0x16ff('0x34')]=_0x373692[_0x16ff('0x34')][_0x16ff('0x36')]?_0x373692[_0x16ff('0x34')]:_0x32d8d0[_0x16ff('0x2f')];if(_0x9ebb4[_0x16ff('0x30')][_0x16ff('0x40')]){_0x373692[_0x16ff('0x41')]=[{'all':!![]}];}_0x373692=_[_0x16ff('0x3d')]({},_0x373692,_0x9ebb4[_0x16ff('0x3e')]);return db[_0x16ff('0x3f')][_0x16ff('0x48')](_0x373692)[_0x16ff('0x26')](handleEntityNotFound(_0x4fd1c1,null))[_0x16ff('0x26')](respondWithResult(_0x4fd1c1,null))[_0x16ff('0x44')](handleError(_0x4fd1c1,null));};exports[_0x16ff('0x49')]=function(_0x27ba2a,_0x26a394){return db[_0x16ff('0x3f')]['create'](_0x27ba2a[_0x16ff('0x4a')],{})[_0x16ff('0x26')](respondWithResult(_0x26a394,0xc9))[_0x16ff('0x44')](handleError(_0x26a394,null));};exports[_0x16ff('0x25')]=function(_0x433427,_0x31f38d){if(_0x433427['body']['id']){delete _0x433427[_0x16ff('0x4a')]['id'];}return db['VtigerField'][_0x16ff('0x48')]({'where':{'id':_0x433427[_0x16ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x31f38d,null))[_0x16ff('0x26')](saveUpdates(_0x433427[_0x16ff('0x4a')],null))[_0x16ff('0x26')](respondWithResult(_0x31f38d,null))[_0x16ff('0x44')](handleError(_0x31f38d,null));};exports[_0x16ff('0x27')]=function(_0x475697,_0x4751d5){return db[_0x16ff('0x3f')][_0x16ff('0x48')]({'where':{'id':_0x475697[_0x16ff('0x46')]['id']}})[_0x16ff('0x26')](handleEntityNotFound(_0x4751d5,null))[_0x16ff('0x26')](removeEntity(_0x4751d5,null))[_0x16ff('0x44')](handleError(_0x4751d5,null));}; \ No newline at end of file +var _0xfe38=['stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','include','VtigerField','findAll','rows','show','params','includeAll','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','end'];(function(_0x4e336a,_0x5d3666){var _0x3f8f1d=function(_0x208edd){while(--_0x208edd){_0x4e336a['push'](_0x4e336a['shift']());}};_0x3f8f1d(++_0x5d3666);}(_0xfe38,0x1bf));var _0x8fe3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe38[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8fe3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fe3('0x1'));var jsonpatch=require(_0x8fe3('0x2'));var rp=require(_0x8fe3('0x3'));var moment=require(_0x8fe3('0x4'));var BPromise=require(_0x8fe3('0x5'));var Mustache=require(_0x8fe3('0x6'));var util=require(_0x8fe3('0x7'));var path=require(_0x8fe3('0x8'));var sox=require(_0x8fe3('0x9'));var csv=require(_0x8fe3('0xa'));var ejs=require(_0x8fe3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fe3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8fe3('0xa'));var querystring=require(_0x8fe3('0xd'));var Papa=require('papaparse');var Redis=require(_0x8fe3('0xe'));var authService=require(_0x8fe3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8fe3('0x10'));var hardwareService=require(_0x8fe3('0x11'));var logger=require(_0x8fe3('0x12'))(_0x8fe3('0x13'));var utils=require(_0x8fe3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8fe3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xba30fb,_0x5761c1){_0x5761c1=_0x5761c1||0xcc;return function(_0x31d963){if(_0x31d963){return _0xba30fb[_0x8fe3('0x16')](_0x5761c1);}return _0xba30fb[_0x8fe3('0x17')](_0x5761c1)['end']();};}function respondWithResult(_0x4e2ba2,_0x3a1426){_0x3a1426=_0x3a1426||0xc8;return function(_0x19b57b){if(_0x19b57b){return _0x4e2ba2[_0x8fe3('0x17')](_0x3a1426)['json'](_0x19b57b);}};}function respondWithFilteredResult(_0x4183fa,_0x2c633a){return function(_0x32d8f7){if(_0x32d8f7){var _0x172810=typeof _0x2c633a['offset']===_0x8fe3('0x18')&&typeof _0x2c633a[_0x8fe3('0x19')]===_0x8fe3('0x18');var _0x14b128=_0x32d8f7[_0x8fe3('0x1a')];var _0x490f38=_0x172810?0x0:_0x2c633a['offset'];var _0x32e1e0=_0x172810?_0x32d8f7['count']:_0x2c633a[_0x8fe3('0x1b')]+_0x2c633a[_0x8fe3('0x19')];var _0x298395;if(_0x32e1e0>=_0x14b128){_0x32e1e0=_0x14b128;_0x298395=0xc8;}else{_0x298395=0xce;}_0x4183fa[_0x8fe3('0x17')](_0x298395);return _0x4183fa[_0x8fe3('0x1c')](_0x8fe3('0x1d'),_0x490f38+'-'+_0x32e1e0+'/'+_0x14b128)[_0x8fe3('0x1e')](_0x32d8f7);}return null;};}function patchUpdates(_0x1de98f){return function(_0xac52ab){try{jsonpatch[_0x8fe3('0x1f')](_0xac52ab,_0x1de98f,!![]);}catch(_0x444538){return BPromise[_0x8fe3('0x20')](_0x444538);}return _0xac52ab['save']();};}function saveUpdates(_0x12ab5b,_0x5deb4a){return function(_0x560e9d){if(_0x560e9d){return _0x560e9d[_0x8fe3('0x21')](_0x12ab5b)['then'](function(_0x118947){return _0x118947;});}return null;};}function removeEntity(_0x392174,_0x3c7046){return function(_0x1776d6){if(_0x1776d6){return _0x1776d6['destroy']()[_0x8fe3('0x22')](function(){_0x392174[_0x8fe3('0x17')](0xcc)[_0x8fe3('0x23')]();});}};}function handleEntityNotFound(_0x49e794,_0x2d9880){return function(_0x222b33){if(!_0x222b33){_0x49e794[_0x8fe3('0x16')](0x194);}return _0x222b33;};}function handleError(_0x386b90,_0x2c7ef3){_0x2c7ef3=_0x2c7ef3||0x1f4;return function(_0x1aa8db){logger['error'](_0x1aa8db[_0x8fe3('0x24')]);if(_0x1aa8db[_0x8fe3('0x25')]){delete _0x1aa8db['name'];}_0x386b90['status'](_0x2c7ef3)['send'](_0x1aa8db);};}exports[_0x8fe3('0x26')]=function(_0x315307,_0x5b86a6){var _0x41b9b4={},_0x4bc2b5={},_0x5902fd={'count':0x0,'rows':[]};var _0x527ce4=_[_0x8fe3('0x27')](db['VtigerField']['rawAttributes'],function(_0x41caf1){return{'name':_0x41caf1[_0x8fe3('0x28')],'type':_0x41caf1[_0x8fe3('0x29')][_0x8fe3('0x2a')]};});_0x4bc2b5[_0x8fe3('0x2b')]=_[_0x8fe3('0x27')](_0x527ce4,_0x8fe3('0x25'));_0x4bc2b5[_0x8fe3('0x2c')]=_[_0x8fe3('0x2d')](_0x315307[_0x8fe3('0x2c')]);_0x4bc2b5[_0x8fe3('0x2e')]=_['intersection'](_0x4bc2b5['model'],_0x4bc2b5[_0x8fe3('0x2c')]);_0x41b9b4[_0x8fe3('0x2f')]=_[_0x8fe3('0x30')](_0x4bc2b5[_0x8fe3('0x2b')],qs[_0x8fe3('0x31')](_0x315307[_0x8fe3('0x2c')][_0x8fe3('0x31')]));_0x41b9b4['attributes']=_0x41b9b4[_0x8fe3('0x2f')][_0x8fe3('0x32')]?_0x41b9b4['attributes']:_0x4bc2b5[_0x8fe3('0x2b')];if(!_0x315307[_0x8fe3('0x2c')]['hasOwnProperty'](_0x8fe3('0x33'))){_0x41b9b4[_0x8fe3('0x19')]=qs[_0x8fe3('0x19')](_0x315307['query'][_0x8fe3('0x19')]);_0x41b9b4[_0x8fe3('0x1b')]=qs[_0x8fe3('0x1b')](_0x315307[_0x8fe3('0x2c')][_0x8fe3('0x1b')]);}_0x41b9b4[_0x8fe3('0x34')]=qs['sort'](_0x315307['query']['sort']);_0x41b9b4['where']=qs[_0x8fe3('0x2e')](_[_0x8fe3('0x35')](_0x315307[_0x8fe3('0x2c')],_0x4bc2b5[_0x8fe3('0x2e')]),_0x527ce4);if(_0x315307['query'][_0x8fe3('0x36')]){_0x41b9b4[_0x8fe3('0x37')]=_[_0x8fe3('0x38')](_0x41b9b4[_0x8fe3('0x37')],{'$or':_[_0x8fe3('0x27')](_0x527ce4,function(_0x819716){if(_0x819716[_0x8fe3('0x29')]!==_0x8fe3('0x39')){var _0x2e3d3a={};_0x2e3d3a[_0x819716[_0x8fe3('0x25')]]={'$like':'%'+_0x315307['query'][_0x8fe3('0x36')]+'%'};return _0x2e3d3a;}})});}_0x41b9b4=_['merge']({},_0x41b9b4,_0x315307['options']);var _0x230b54={'where':_0x41b9b4[_0x8fe3('0x37')]};return db['VtigerField'][_0x8fe3('0x1a')](_0x230b54)['then'](function(_0x5a553e){_0x5902fd[_0x8fe3('0x1a')]=_0x5a553e;if(_0x315307['query']['includeAll']){_0x41b9b4[_0x8fe3('0x3a')]=[{'all':!![]}];}return db[_0x8fe3('0x3b')][_0x8fe3('0x3c')](_0x41b9b4);})[_0x8fe3('0x22')](function(_0x5e0c58){_0x5902fd[_0x8fe3('0x3d')]=_0x5e0c58;return _0x5902fd;})[_0x8fe3('0x22')](respondWithFilteredResult(_0x5b86a6,_0x41b9b4))['catch'](handleError(_0x5b86a6,null));};exports[_0x8fe3('0x3e')]=function(_0x258502,_0x1fc5b5){var _0x3acd9b={'raw':!![],'where':{'id':_0x258502[_0x8fe3('0x3f')]['id']}},_0x137fe7={};_0x137fe7[_0x8fe3('0x2b')]=_[_0x8fe3('0x2d')](db['VtigerField']['rawAttributes']);_0x137fe7['query']=_[_0x8fe3('0x2d')](_0x258502['query']);_0x137fe7[_0x8fe3('0x2e')]=_['intersection'](_0x137fe7['model'],_0x137fe7[_0x8fe3('0x2c')]);_0x3acd9b['attributes']=_[_0x8fe3('0x30')](_0x137fe7[_0x8fe3('0x2b')],qs[_0x8fe3('0x31')](_0x258502[_0x8fe3('0x2c')]['fields']));_0x3acd9b[_0x8fe3('0x2f')]=_0x3acd9b['attributes'][_0x8fe3('0x32')]?_0x3acd9b[_0x8fe3('0x2f')]:_0x137fe7[_0x8fe3('0x2b')];if(_0x258502[_0x8fe3('0x2c')][_0x8fe3('0x40')]){_0x3acd9b[_0x8fe3('0x3a')]=[{'all':!![]}];}_0x3acd9b=_[_0x8fe3('0x38')]({},_0x3acd9b,_0x258502['options']);return db[_0x8fe3('0x3b')]['find'](_0x3acd9b)['then'](handleEntityNotFound(_0x1fc5b5,null))['then'](respondWithResult(_0x1fc5b5,null))[_0x8fe3('0x41')](handleError(_0x1fc5b5,null));};exports[_0x8fe3('0x42')]=function(_0x15ea0c,_0x31ed53){return db['VtigerField'][_0x8fe3('0x42')](_0x15ea0c['body'],{})[_0x8fe3('0x22')](respondWithResult(_0x31ed53,0xc9))[_0x8fe3('0x41')](handleError(_0x31ed53,null));};exports['update']=function(_0x2c5415,_0xfe1b8d){if(_0x2c5415[_0x8fe3('0x43')]['id']){delete _0x2c5415[_0x8fe3('0x43')]['id'];}return db['VtigerField'][_0x8fe3('0x44')]({'where':{'id':_0x2c5415[_0x8fe3('0x3f')]['id']}})['then'](handleEntityNotFound(_0xfe1b8d,null))['then'](saveUpdates(_0x2c5415[_0x8fe3('0x43')],null))[_0x8fe3('0x22')](respondWithResult(_0xfe1b8d,null))['catch'](handleError(_0xfe1b8d,null));};exports['destroy']=function(_0x4cab5a,_0x399036){return db[_0x8fe3('0x3b')][_0x8fe3('0x44')]({'where':{'id':_0x4cab5a[_0x8fe3('0x3f')]['id']}})[_0x8fe3('0x22')](handleEntityNotFound(_0x399036,null))[_0x8fe3('0x22')](removeEntity(_0x399036,null))[_0x8fe3('0x41')](handleError(_0x399036,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f70b1cc..594dfab 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 _0x8f06=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerField','vtiger_unique_index','idField','lodash'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x8f06,0xed));var _0x68f0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8f06[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x68f0('0x0'));var util=require('util');var logger=require(_0x68f0('0x1'))(_0x68f0('0x2'));var moment=require(_0x68f0('0x3'));var BPromise=require(_0x68f0('0x4'));var rp=require(_0x68f0('0x5'));var fs=require('fs');var path=require(_0x68f0('0x6'));var rimraf=require(_0x68f0('0x7'));var config=require(_0x68f0('0x8'));var attributes=require('./intVtigerField.attributes');module[_0x68f0('0x9')]=function(_0x2e3885,_0x58d840){return _0x2e3885[_0x68f0('0xa')](_0x68f0('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x68f0('0xc'),'fields':[_0x68f0('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc40=['vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','define','int_vtiger_fields'];(function(_0x2f2d7a,_0x2a0cc1){var _0x4ddf28=function(_0x296b19){while(--_0x296b19){_0x2f2d7a['push'](_0x2f2d7a['shift']());}};_0x4ddf28(++_0x2a0cc1);}(_0xcc40,0x1a3));var _0x0cc4=function(_0x5d7831,_0xe411a2){_0x5d7831=_0x5d7831-0x0;var _0x450a14=_0xcc40[_0x5d7831];return _0x450a14;};'use strict';var _=require('lodash');var util=require(_0x0cc4('0x0'));var logger=require(_0x0cc4('0x1'))(_0x0cc4('0x2'));var moment=require(_0x0cc4('0x3'));var BPromise=require(_0x0cc4('0x4'));var rp=require(_0x0cc4('0x5'));var fs=require('fs');var path=require(_0x0cc4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0cc4('0x7'));module['exports']=function(_0x2664d3,_0xc72492){return _0x2664d3[_0x0cc4('0x8')]('VtigerField',attributes,{'tableName':_0x0cc4('0x9'),'paranoid':![],'indexes':[{'name':_0x0cc4('0xa'),'fields':[_0x0cc4('0xb'),_0x0cc4('0xc')],'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 769a2ea..74d287e 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 _0xfc75=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3fbe46,_0x12a0d1){var _0x27c406=function(_0x4a1020){while(--_0x4a1020){_0x3fbe46['push'](_0x3fbe46['shift']());}};_0x27c406(++_0x12a0d1);}(_0xfc75,0xe1));var _0x5fc7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfc75[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5fc7('0x0'));var util=require(_0x5fc7('0x1'));var moment=require(_0x5fc7('0x2'));var BPromise=require(_0x5fc7('0x3'));var rs=require(_0x5fc7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5fc7('0x5'));var logger=require('../../config/logger')(_0x5fc7('0x6'));var config=require(_0x5fc7('0x7'));var jayson=require(_0x5fc7('0x8'));var client=jayson[_0x5fc7('0x9')][_0x5fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x503eaa,_0x2385ad,_0x56f284){return new BPromise(function(_0x1bb845,_0x4828fd){return client['request'](_0x503eaa,_0x56f284)[_0x5fc7('0xb')](function(_0x5d30b9){logger[_0x5fc7('0xc')]('VtigerField,\x20%s,\x20%s',_0x2385ad,_0x5fc7('0xd'));logger[_0x5fc7('0xe')](_0x5fc7('0xf'),_0x2385ad,'request\x20sent',JSON[_0x5fc7('0x10')](_0x5d30b9));if(_0x5d30b9[_0x5fc7('0x11')]){if(_0x5d30b9[_0x5fc7('0x11')]['code']===0x1f4){logger[_0x5fc7('0x11')](_0x5fc7('0x12'),_0x2385ad,_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0x4828fd(_0x5d30b9['error']['message']);}logger['error']('VtigerField,\x20%s,\x20%s',_0x2385ad,_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0x1bb845(_0x5d30b9[_0x5fc7('0x11')][_0x5fc7('0x13')]);}else{logger['info'](_0x5fc7('0x12'),_0x2385ad,_0x5fc7('0xd'));_0x1bb845(_0x5d30b9[_0x5fc7('0x14')][_0x5fc7('0x13')]);}})['catch'](function(_0x188101){logger[_0x5fc7('0x11')]('VtigerField,\x20%s,\x20%s',_0x2385ad,_0x188101);_0x4828fd(_0x188101);});});} \ No newline at end of file +var _0xf19d=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5babe2,_0x2e64fa){var _0x42b9ec=function(_0x11c2ef){while(--_0x11c2ef){_0x5babe2['push'](_0x5babe2['shift']());}};_0x42b9ec(++_0x2e64fa);}(_0xf19d,0x164));var _0xdf19=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xf19d[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xdf19('0x0'));var util=require(_0xdf19('0x1'));var moment=require(_0xdf19('0x2'));var BPromise=require(_0xdf19('0x3'));var rs=require(_0xdf19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf19('0x5'));var logger=require('../../config/logger')(_0xdf19('0x6'));var config=require(_0xdf19('0x7'));var jayson=require(_0xdf19('0x8'));var client=jayson[_0xdf19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33fab6,_0x79b9d5,_0xb93039){return new BPromise(function(_0x5eae63,_0x2ac56e){return client[_0xdf19('0xa')](_0x33fab6,_0xb93039)['then'](function(_0x41bf59){logger['info'](_0xdf19('0xb'),_0x79b9d5,_0xdf19('0xc'));logger[_0xdf19('0xd')](_0xdf19('0xe'),_0x79b9d5,'request\x20sent',JSON[_0xdf19('0xf')](_0x41bf59));if(_0x41bf59[_0xdf19('0x10')]){if(_0x41bf59[_0xdf19('0x10')][_0xdf19('0x11')]===0x1f4){logger[_0xdf19('0x10')](_0xdf19('0xb'),_0x79b9d5,_0x41bf59[_0xdf19('0x10')][_0xdf19('0x12')]);return _0x2ac56e(_0x41bf59[_0xdf19('0x10')][_0xdf19('0x12')]);}logger[_0xdf19('0x10')](_0xdf19('0xb'),_0x79b9d5,_0x41bf59['error'][_0xdf19('0x12')]);return _0x5eae63(_0x41bf59[_0xdf19('0x10')][_0xdf19('0x12')]);}else{logger[_0xdf19('0x13')](_0xdf19('0xb'),_0x79b9d5,_0xdf19('0xc'));_0x5eae63(_0x41bf59[_0xdf19('0x14')][_0xdf19('0x12')]);}})[_0xdf19('0x15')](function(_0xb1a50b){logger[_0xdf19('0x10')]('VtigerField,\x20%s,\x20%s',_0x79b9d5,_0xb1a50b);_0x2ac56e(_0xb1a50b);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 2cd2b00..fd7ec06 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 _0xcecc=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','getFields','post','put','/:id'];(function(_0x32821f,_0x10124b){var _0x16efef=function(_0x43bc23){while(--_0x43bc23){_0x32821f['push'](_0x32821f['shift']());}};_0x16efef(++_0x10124b);}(_0xcecc,0x118));var _0xccec=function(_0x124268,_0x2e672b){_0x124268=_0x124268-0x0;var _0x357d89=_0xcecc[_0x124268];return _0x357d89;};'use strict';var multer=require(_0xccec('0x0'));var util=require(_0xccec('0x1'));var path=require(_0xccec('0x2'));var timeout=require(_0xccec('0x3'));var express=require(_0xccec('0x4'));var router=express[_0xccec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xccec('0x6'));var interaction=require(_0xccec('0x7'));var config=require(_0xccec('0x8'));var controller=require(_0xccec('0x9'));router[_0xccec('0xa')]('/',auth[_0xccec('0xb')](),controller[_0xccec('0xc')]);router[_0xccec('0xa')]('/:id',auth[_0xccec('0xb')](),controller['show']);router['get'](_0xccec('0xd'),auth[_0xccec('0xb')](),controller[_0xccec('0xe')]);router['get']('/:id/fields',auth[_0xccec('0xb')](),controller[_0xccec('0xf')]);router[_0xccec('0x10')]('/',auth[_0xccec('0xb')](),controller['create']);router[_0xccec('0x10')](_0xccec('0xd'),auth[_0xccec('0xb')](),controller['addConfiguration']);router[_0xccec('0x11')](_0xccec('0x12'),auth['isAuthenticated'](),controller[_0xccec('0x13')]);router[_0xccec('0x14')](_0xccec('0x12'),auth['isAuthenticated'](),controller[_0xccec('0x15')]);module[_0xccec('0x16')]=router; \ No newline at end of file +var _0xbc7b=['get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x470d22,_0x1b6a4f){var _0x3cc44d=function(_0x4a3749){while(--_0x4a3749){_0x470d22['push'](_0x470d22['shift']());}};_0x3cc44d(++_0x1b6a4f);}(_0xbc7b,0xaf));var _0xbbc7=function(_0x33aa93,_0x1a9182){_0x33aa93=_0x33aa93-0x0;var _0x279566=_0xbc7b[_0x33aa93];return _0x279566;};'use strict';var multer=require(_0xbbc7('0x0'));var util=require('util');var path=require(_0xbbc7('0x1'));var timeout=require(_0xbbc7('0x2'));var express=require(_0xbbc7('0x3'));var router=express['Router']();var fs_extra=require(_0xbbc7('0x4'));var auth=require(_0xbbc7('0x5'));var interaction=require(_0xbbc7('0x6'));var config=require(_0xbbc7('0x7'));var controller=require(_0xbbc7('0x8'));router[_0xbbc7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbc7('0x9')](_0xbbc7('0xa'),auth[_0xbbc7('0xb')](),controller[_0xbbc7('0xc')]);router[_0xbbc7('0x9')](_0xbbc7('0xd'),auth['isAuthenticated'](),controller[_0xbbc7('0xe')]);router[_0xbbc7('0x9')](_0xbbc7('0xf'),auth['isAuthenticated'](),controller[_0xbbc7('0x10')]);router[_0xbbc7('0x11')]('/',auth[_0xbbc7('0xb')](),controller[_0xbbc7('0x12')]);router[_0xbbc7('0x11')](_0xbbc7('0xd'),auth[_0xbbc7('0xb')](),controller[_0xbbc7('0x13')]);router[_0xbbc7('0x14')](_0xbbc7('0xa'),auth[_0xbbc7('0xb')](),controller['update']);router[_0xbbc7('0x15')]('/:id',auth[_0xbbc7('0xb')](),controller['destroy']);module[_0xbbc7('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 4abda80..2e4df6a 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 _0x398a=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x5065c8,_0x597db4){var _0x1619ae=function(_0x367ab3){while(--_0x367ab3){_0x5065c8['push'](_0x5065c8['shift']());}};_0x1619ae(++_0x597db4);}(_0x398a,0x11a));var _0xa398=function(_0x4a9c29,_0x78e8e4){_0x4a9c29=_0x4a9c29-0x0;var _0x4ccf95=_0x398a[_0x4a9c29];return _0x4ccf95;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')]},'description':{'type':Sequelize[_0xa398('0x2')]},'username':{'type':Sequelize[_0xa398('0x2')],'unique':_0xa398('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa398('0x4')},'authType':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x6'),_0xa398('0x7')),'defaultValue':_0xa398('0x6')},'serverUrl':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x8'),_0xa398('0x9')),'defaultValue':_0xa398('0x8')}}; \ No newline at end of file +var _0x29b1=['token','integrationTab','newTab','STRING','username','remoteUri','ENUM','password'];(function(_0x2851a6,_0x4f01ab){var _0x497c2b=function(_0x5334fb){while(--_0x5334fb){_0x2851a6['push'](_0x2851a6['shift']());}};_0x497c2b(++_0x4f01ab);}(_0x29b1,0x13b));var _0x129b=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x29b1[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x129b('0x0')]},'description':{'type':Sequelize[_0x129b('0x0')]},'username':{'type':Sequelize[_0x129b('0x0')],'unique':_0x129b('0x1')},'password':{'type':Sequelize[_0x129b('0x0')]},'token':{'type':Sequelize[_0x129b('0x0')]},'remoteUri':{'type':Sequelize[_0x129b('0x0')],'unique':_0x129b('0x2')},'authType':{'type':Sequelize[_0x129b('0x3')](_0x129b('0x4'),_0x129b('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x129b('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x129b('0x6'),_0x129b('0x7')),'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 5b01f2a..a3cecc8 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 _0xb9a7=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ZendeskAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getDescriptions','ZendeskConfiguration','getFields','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','username','toString','headers','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x45852b,_0x1025bd){var _0x8c653=function(_0x69dab4){while(--_0x69dab4){_0x45852b['push'](_0x45852b['shift']());}};_0x8c653(++_0x1025bd);}(_0xb9a7,0x112));var _0x7b9a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb9a7[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32f616,_0xec5949){_0xec5949=_0xec5949||0xcc;return function(_0x5e3875){if(_0x5e3875){return _0x32f616[_0x7b9a('0x14')](_0xec5949);}return _0x32f616[_0x7b9a('0x15')](_0xec5949)['end']();};}function respondWithResult(_0xb157e5,_0xde180d){_0xde180d=_0xde180d||0xc8;return function(_0x6fa16a){if(_0x6fa16a){return _0xb157e5[_0x7b9a('0x15')](_0xde180d)[_0x7b9a('0x16')](_0x6fa16a);}};}function respondWithFilteredResult(_0x346daa,_0x22a7e4){return function(_0x35e602){if(_0x35e602){var _0x2f1899=typeof _0x22a7e4['offset']===_0x7b9a('0x17')&&typeof _0x22a7e4['limit']===_0x7b9a('0x17');var _0xa217cb=_0x35e602[_0x7b9a('0x18')];var _0x169d16=_0x2f1899?0x0:_0x22a7e4[_0x7b9a('0x19')];var _0x180a67=_0x2f1899?_0x35e602[_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0x19')]+_0x22a7e4[_0x7b9a('0x1a')];var _0x588c48;if(_0x180a67>=_0xa217cb){_0x180a67=_0xa217cb;_0x588c48=0xc8;}else{_0x588c48=0xce;}_0x346daa[_0x7b9a('0x15')](_0x588c48);return _0x346daa[_0x7b9a('0x1b')](_0x7b9a('0x1c'),_0x169d16+'-'+_0x180a67+'/'+_0xa217cb)['json'](_0x35e602);}return null;};}function patchUpdates(_0x993048){return function(_0x59a64d){try{jsonpatch[_0x7b9a('0x1d')](_0x59a64d,_0x993048,!![]);}catch(_0x517e93){return BPromise[_0x7b9a('0x1e')](_0x517e93);}return _0x59a64d[_0x7b9a('0x1f')]();};}function saveUpdates(_0x23d812,_0x54fda7){return function(_0x411eea){if(_0x411eea){return _0x411eea[_0x7b9a('0x20')](_0x23d812)['then'](function(_0x35aca7){return _0x35aca7;});}return null;};}function removeEntity(_0x374dca,_0x269c07){return function(_0x2f7d34){if(_0x2f7d34){return _0x2f7d34[_0x7b9a('0x21')]()['then'](function(){_0x374dca[_0x7b9a('0x15')](0xcc)[_0x7b9a('0x22')]();});}};}function handleEntityNotFound(_0x5809f5,_0x39b7ec){return function(_0x4fa111){if(!_0x4fa111){_0x5809f5[_0x7b9a('0x14')](0x194);}return _0x4fa111;};}function handleError(_0x3091ab,_0x4c2271){_0x4c2271=_0x4c2271||0x1f4;return function(_0x55d01c){logger[_0x7b9a('0x23')](_0x55d01c['stack']);if(_0x55d01c['name']){delete _0x55d01c[_0x7b9a('0x24')];}_0x3091ab['status'](_0x4c2271)['send'](_0x55d01c);};}exports[_0x7b9a('0x25')]=function(_0x4d5880,_0x5c89b6){var _0x314b6d={},_0x4fee38={},_0x1553ae={'count':0x0,'rows':[]};var _0x2e6144=_[_0x7b9a('0x26')](db['ZendeskAccount'][_0x7b9a('0x27')],function(_0x2ce78b){return{'name':_0x2ce78b[_0x7b9a('0x28')],'type':_0x2ce78b[_0x7b9a('0x29')][_0x7b9a('0x2a')]};});_0x4fee38[_0x7b9a('0x2b')]=_['map'](_0x2e6144,'name');_0x4fee38[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x4d5880[_0x7b9a('0x2c')]);_0x4fee38['filters']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],_0x4fee38['query']);_0x314b6d['attributes']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],qs['fields'](_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x314b6d[_0x7b9a('0x30')]=_0x314b6d[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x314b6d['attributes']:_0x4fee38[_0x7b9a('0x2b')];if(!_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x32')](_0x7b9a('0x33'))){_0x314b6d[_0x7b9a('0x1a')]=qs[_0x7b9a('0x1a')](_0x4d5880['query']['limit']);_0x314b6d[_0x7b9a('0x19')]=qs[_0x7b9a('0x19')](_0x4d5880['query'][_0x7b9a('0x19')]);}_0x314b6d[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_0x4d5880['query'][_0x7b9a('0x35')]);_0x314b6d[_0x7b9a('0x36')]=qs['filters'](_['pick'](_0x4d5880[_0x7b9a('0x2c')],_0x4fee38[_0x7b9a('0x37')]),_0x2e6144);if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x314b6d[_0x7b9a('0x36')]=_[_0x7b9a('0x39')](_0x314b6d[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x2e6144,function(_0x4af212){if(_0x4af212[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x213370={};_0x213370[_0x4af212[_0x7b9a('0x24')]]={'$like':'%'+_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x213370;}})});}_0x314b6d=_[_0x7b9a('0x39')]({},_0x314b6d,_0x4d5880[_0x7b9a('0x3a')]);var _0x5e504f={'where':_0x314b6d[_0x7b9a('0x36')]};return db[_0x7b9a('0x3b')][_0x7b9a('0x18')](_0x5e504f)[_0x7b9a('0x3c')](function(_0x5af103){_0x1553ae[_0x7b9a('0x18')]=_0x5af103;if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x314b6d[_0x7b9a('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x7b9a('0x3f')](_0x314b6d);})['then'](function(_0x1ee576){_0x1553ae[_0x7b9a('0x40')]=_0x1ee576;return _0x1553ae;})[_0x7b9a('0x3c')](respondWithFilteredResult(_0x5c89b6,_0x314b6d))[_0x7b9a('0x41')](handleError(_0x5c89b6,null));};exports[_0x7b9a('0x42')]=function(_0x41f541,_0x56e274){var _0x33edc6={'raw':![],'where':{'id':_0x41f541[_0x7b9a('0x43')]['id']}},_0x85770={};_0x85770['model']=_['keys'](db[_0x7b9a('0x3b')][_0x7b9a('0x27')]);_0x85770[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x41f541[_0x7b9a('0x2c')]);_0x85770[_0x7b9a('0x37')]=_['intersection'](_0x85770['model'],_0x85770['query']);_0x33edc6[_0x7b9a('0x30')]=_[_0x7b9a('0x2e')](_0x85770['model'],qs[_0x7b9a('0x2f')](_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x33edc6['attributes']=_0x33edc6[_0x7b9a('0x30')]['length']?_0x33edc6[_0x7b9a('0x30')]:_0x85770[_0x7b9a('0x2b')];if(_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x33edc6[_0x7b9a('0x3e')]=[{'all':!![]}];}_0x33edc6=_['merge']({},_0x33edc6,_0x41f541[_0x7b9a('0x3a')]);return db['ZendeskAccount'][_0x7b9a('0x44')](_0x33edc6)['then'](handleEntityNotFound(_0x56e274,null))['then'](respondWithResult(_0x56e274,null))[_0x7b9a('0x41')](handleError(_0x56e274,null));};exports[_0x7b9a('0x45')]=function(_0x717d08,_0x43cba){return db[_0x7b9a('0x3b')][_0x7b9a('0x45')](_0x717d08[_0x7b9a('0x46')],{})[_0x7b9a('0x3c')](respondWithResult(_0x43cba,0xc9))[_0x7b9a('0x41')](handleError(_0x43cba,null));};exports['update']=function(_0x1d7957,_0x4044ba){if(_0x1d7957['body']['id']){delete _0x1d7957['body']['id'];}return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x1d7957[_0x7b9a('0x43')]['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x4044ba,null))[_0x7b9a('0x3c')](saveUpdates(_0x1d7957['body'],null))[_0x7b9a('0x3c')](respondWithResult(_0x4044ba,null))[_0x7b9a('0x41')](handleError(_0x4044ba,null));};exports[_0x7b9a('0x21')]=function(_0x33b200,_0x2d083b){return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x33b200['params']['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x2d083b,null))[_0x7b9a('0x3c')](removeEntity(_0x2d083b,null))[_0x7b9a('0x41')](handleError(_0x2d083b,null));};exports[_0x7b9a('0x47')]=function(_0x52f2ca,_0xd42491,_0x2d353f){var _0x354a87={};var _0x28855a={};var _0x2b0db5;var _0x3e2f1b;return db[_0x7b9a('0x3b')]['findOne']({'where':{'id':_0x52f2ca['params']['id']}})['then'](handleEntityNotFound(_0xd42491,null))[_0x7b9a('0x3c')](function(_0x2f8929){if(_0x2f8929){_0x2b0db5=_0x2f8929;_0x28855a['model']=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x28855a[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x52f2ca[_0x7b9a('0x2c')]);_0x28855a[_0x7b9a('0x37')]=_[_0x7b9a('0x2e')](_0x28855a[_0x7b9a('0x2b')],_0x28855a[_0x7b9a('0x2c')]);_0x354a87[_0x7b9a('0x30')]=_['intersection'](_0x28855a[_0x7b9a('0x2b')],qs['fields'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x354a87[_0x7b9a('0x30')]=_0x354a87[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x354a87['attributes']:_0x28855a[_0x7b9a('0x2b')];_0x354a87['order']=qs[_0x7b9a('0x35')](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x35')]);_0x354a87['where']=qs['filters'](_['pick'](_0x52f2ca['query'],_0x28855a[_0x7b9a('0x37')]));if(_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x354a87['where']=_[_0x7b9a('0x39')](_0x354a87[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x354a87[_0x7b9a('0x30')],function(_0xea7b37){var _0x4c3939={};_0x4c3939[_0xea7b37]={'$like':'%'+_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x4c3939;})});}_0x354a87=_[_0x7b9a('0x39')]({},_0x354a87,_0x52f2ca['options']);return _0x2b0db5['getConfigurations'](_0x354a87);}})['then'](function(_0x14e2d5){if(_0x14e2d5){_0x3e2f1b=_0x14e2d5[_0x7b9a('0x31')];if(!_0x52f2ca[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x33'))){_0x354a87[_0x7b9a('0x1a')]=qs['limit'](_0x52f2ca[_0x7b9a('0x2c')]['limit']);_0x354a87[_0x7b9a('0x19')]=qs['offset'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x19')]);}return _0x2b0db5[_0x7b9a('0x47')](_0x354a87);}})[_0x7b9a('0x3c')](function(_0x5d45ae){if(_0x5d45ae){return _0x5d45ae?{'count':_0x3e2f1b,'rows':_0x5d45ae}:null;}})[_0x7b9a('0x3c')](respondWithResult(_0xd42491,null))[_0x7b9a('0x41')](handleError(_0xd42491,null));};exports[_0x7b9a('0x48')]=function(_0x273134,_0x567328,_0x239b62){if(_0x273134['body']['id']){delete _0x273134[_0x7b9a('0x46')]['id'];}return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x273134['params']['id']}})['then'](handleEntityNotFound(_0x567328,null))['then'](function(_0x48442a){if(_0x48442a){_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4a')]=_0x48442a['id'];_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4b')]=integrations['getSubjects'](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134['body'][_0x7b9a('0x29')]);_0x273134['body']['Descriptions']=integrations[_0x7b9a('0x4c')](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134[_0x7b9a('0x46')]['type']);return db[_0x7b9a('0x4d')][_0x7b9a('0x45')](_0x273134[_0x7b9a('0x46')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x7b9a('0x3c')](respondWithResult(_0x567328,null))[_0x7b9a('0x41')](handleError(_0x567328,null));};exports[_0x7b9a('0x4e')]=function(_0x2092b6,_0x261a43,_0x147d23){var _0x45014b='';return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x2092b6[_0x7b9a('0x43')]['id']},'attributes':['id','username',_0x7b9a('0x4f'),_0x7b9a('0x50'),_0x7b9a('0x51'),'remoteUri']})['then'](handleEntityNotFound(_0x261a43,null))[_0x7b9a('0x3c')](function(_0x8a3d84){if(_0x8a3d84){_0x45014b=_0x8a3d84['remoteUri'];var _0xc64c42=_0x45014b['slice'](-0x1);if(_0xc64c42==='/'){_0x45014b=_0x45014b[_0x7b9a('0x52')](0x0,_0x45014b[_0x7b9a('0x53')](_0xc64c42));}var _0x3a46e9={'method':'GET','uri':util[_0x7b9a('0x54')](_0x7b9a('0x55'),_0x45014b,_0x7b9a('0x56')),'json':!![]};switch(_0x8a3d84[_0x7b9a('0x51')]){case _0x7b9a('0x4f'):_0x3a46e9['headers']={'Authorization':util['format'](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x4f')]))[_0x7b9a('0x59')]('base64'))};break;case'token':_0x3a46e9[_0x7b9a('0x5a')]={'Authorization':util[_0x7b9a('0x54')](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s/token:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x50')]))[_0x7b9a('0x59')]('base64'))};break;default:throw new db['Sequelize'][(_0x7b9a('0x5b'))](_0x7b9a('0x5c'));}return rp(_0x3a46e9);}})[_0x7b9a('0x3c')](function(_0x1934e2){if(_0x1934e2){var _0x48e5dd=[_0x7b9a('0x5d'),_0x7b9a('0x5e'),'group',_0x7b9a('0x5f')];_[_0x7b9a('0x60')](_0x1934e2[_0x7b9a('0x56')],function(_0x34f229){return _0x48e5dd[_0x7b9a('0x61')](_0x34f229[_0x7b9a('0x29')]);});return{'count':_0x1934e2[_0x7b9a('0x56')][_0x7b9a('0x31')],'rows':_[_0x7b9a('0x26')](_0x1934e2[_0x7b9a('0x56')],function(_0x4c41dc){return{'id':_0x4c41dc['id'],'name':_0x4c41dc['position']>0x7?_0x4c41dc['title']:_0x4c41dc[_0x7b9a('0x29')],'custom':_0x4c41dc[_0x7b9a('0x62')]>0x7?!![]:![],'options':_0x4c41dc['system_field_options']?_0x4c41dc[_0x7b9a('0x63')]:_0x4c41dc[_0x7b9a('0x64')]?_0x4c41dc['custom_field_options']:[]};})};}})[_0x7b9a('0x3c')](respondWithResult(_0x261a43,null))[_0x7b9a('0x41')](function(_0x3774e1){var _0x20c427=_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?0x1f4:_0x3774e1[_0x7b9a('0x66')]||0x1f4;logger[_0x7b9a('0x23')](_0x7b9a('0x67'),'getFields',_0x20c427,JSON[_0x7b9a('0x68')](_0x3774e1));delete _0x3774e1[_0x7b9a('0x24')];if(_0x20c427===0x191){_0x20c427=0x190;}_0x261a43[_0x7b9a('0x15')](_0x20c427)[_0x7b9a('0x69')](_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?{'message':_0x7b9a('0x6a'),'statusCode':_0x3774e1[_0x7b9a('0x66')]}:_0x3774e1);});}; \ No newline at end of file +var _0xd87e=['undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5adf4d,_0xdfd7ef){var _0x17b2db=function(_0x5a9a2f){while(--_0x5a9a2f){_0x5adf4d['push'](_0x5adf4d['shift']());}};_0x17b2db(++_0xdfd7ef);}(_0xd87e,0x1bf));var _0xed87=function(_0x3318fe,_0x3f5d89){_0x3318fe=_0x3318fe-0x0;var _0x574ad=_0xd87e[_0x3318fe];return _0x574ad;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ffc2d,_0x466f35){_0x466f35=_0x466f35||0xcc;return function(_0x32276e){if(_0x32276e){return _0x4ffc2d[_0xed87('0x18')](_0x466f35);}return _0x4ffc2d[_0xed87('0x19')](_0x466f35)[_0xed87('0x1a')]();};}function respondWithResult(_0x3865c5,_0x52dfe8){_0x52dfe8=_0x52dfe8||0xc8;return function(_0x4494da){if(_0x4494da){return _0x3865c5[_0xed87('0x19')](_0x52dfe8)[_0xed87('0x1b')](_0x4494da);}};}function respondWithFilteredResult(_0x1e9a3d,_0x2f2fd3){return function(_0xd34e0e){if(_0xd34e0e){var _0x173413=typeof _0x2f2fd3[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x2f2fd3['limit']===_0xed87('0x1d');var _0x18ab7d=_0xd34e0e[_0xed87('0x1e')];var _0xfb8a44=_0x173413?0x0:_0x2f2fd3['offset'];var _0x211085=_0x173413?_0xd34e0e[_0xed87('0x1e')]:_0x2f2fd3[_0xed87('0x1c')]+_0x2f2fd3[_0xed87('0x1f')];var _0x98a2ca;if(_0x211085>=_0x18ab7d){_0x211085=_0x18ab7d;_0x98a2ca=0xc8;}else{_0x98a2ca=0xce;}_0x1e9a3d[_0xed87('0x19')](_0x98a2ca);return _0x1e9a3d[_0xed87('0x20')](_0xed87('0x21'),_0xfb8a44+'-'+_0x211085+'/'+_0x18ab7d)[_0xed87('0x1b')](_0xd34e0e);}return null;};}function patchUpdates(_0x52e81c){return function(_0x5a7329){try{jsonpatch['apply'](_0x5a7329,_0x52e81c,!![]);}catch(_0x47c121){return BPromise[_0xed87('0x22')](_0x47c121);}return _0x5a7329['save']();};}function saveUpdates(_0x4191a7,_0x2b0b98){return function(_0x5b1659){if(_0x5b1659){return _0x5b1659[_0xed87('0x23')](_0x4191a7)['then'](function(_0x3d1641){return _0x3d1641;});}return null;};}function removeEntity(_0x24962e,_0x27799a){return function(_0x2a8733){if(_0x2a8733){return _0x2a8733[_0xed87('0x24')]()['then'](function(){_0x24962e[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x41e0d4,_0x320bcc){return function(_0x31c600){if(!_0x31c600){_0x41e0d4[_0xed87('0x18')](0x194);}return _0x31c600;};}function handleError(_0x25a6f7,_0x4735b3){_0x4735b3=_0x4735b3||0x1f4;return function(_0x40b2fa){logger[_0xed87('0x25')](_0x40b2fa[_0xed87('0x26')]);if(_0x40b2fa[_0xed87('0x27')]){delete _0x40b2fa[_0xed87('0x27')];}_0x25a6f7[_0xed87('0x19')](_0x4735b3)['send'](_0x40b2fa);};}exports[_0xed87('0x28')]=function(_0x1c4a65,_0x4eaa44){var _0x3dff74={},_0x33c367={},_0x21c93b={'count':0x0,'rows':[]};var _0x4b259e=_['map'](db[_0xed87('0x29')][_0xed87('0x2a')],function(_0x21ab8a){return{'name':_0x21ab8a['fieldName'],'type':_0x21ab8a[_0xed87('0x2b')][_0xed87('0x2c')]};});_0x33c367[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x4b259e,_0xed87('0x27'));_0x33c367[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x1c4a65[_0xed87('0x2f')]);_0x33c367[_0xed87('0x31')]=_['intersection'](_0x33c367[_0xed87('0x2d')],_0x33c367[_0xed87('0x2f')]);_0x3dff74['attributes']=_[_0xed87('0x32')](_0x33c367['model'],qs[_0xed87('0x33')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x33')]));_0x3dff74[_0xed87('0x34')]=_0x3dff74[_0xed87('0x34')][_0xed87('0x35')]?_0x3dff74[_0xed87('0x34')]:_0x33c367[_0xed87('0x2d')];if(!_0x1c4a65[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x3dff74['limit']=qs[_0xed87('0x1f')](_0x1c4a65[_0xed87('0x2f')]['limit']);_0x3dff74[_0xed87('0x1c')]=qs['offset'](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x1c')]);}_0x3dff74['order']=qs[_0xed87('0x38')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x38')]);_0x3dff74[_0xed87('0x39')]=qs[_0xed87('0x31')](_['pick'](_0x1c4a65[_0xed87('0x2f')],_0x33c367['filters']),_0x4b259e);if(_0x1c4a65[_0xed87('0x2f')]['filter']){_0x3dff74[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x3dff74[_0xed87('0x39')],{'$or':_[_0xed87('0x2e')](_0x4b259e,function(_0x319f69){if(_0x319f69[_0xed87('0x2b')]!==_0xed87('0x3b')){var _0x161491={};_0x161491[_0x319f69[_0xed87('0x27')]]={'$like':'%'+_0x1c4a65['query']['filter']+'%'};return _0x161491;}})});}_0x3dff74=_[_0xed87('0x3a')]({},_0x3dff74,_0x1c4a65[_0xed87('0x3c')]);var _0x1f16a8={'where':_0x3dff74[_0xed87('0x39')]};return db[_0xed87('0x29')][_0xed87('0x1e')](_0x1f16a8)['then'](function(_0x4398a0){_0x21c93b[_0xed87('0x1e')]=_0x4398a0;if(_0x1c4a65[_0xed87('0x2f')]['includeAll']){_0x3dff74[_0xed87('0x3d')]=[{'all':!![]}];}return db[_0xed87('0x29')][_0xed87('0x3e')](_0x3dff74);})[_0xed87('0x3f')](function(_0x1d1e99){_0x21c93b[_0xed87('0x40')]=_0x1d1e99;return _0x21c93b;})[_0xed87('0x3f')](respondWithFilteredResult(_0x4eaa44,_0x3dff74))[_0xed87('0x41')](handleError(_0x4eaa44,null));};exports[_0xed87('0x42')]=function(_0x406b73,_0x5c6925){var _0x7e6cbb={'raw':![],'where':{'id':_0x406b73[_0xed87('0x43')]['id']}},_0x3c7fcc={};_0x3c7fcc['model']=_['keys'](db[_0xed87('0x29')][_0xed87('0x2a')]);_0x3c7fcc[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x406b73['query']);_0x3c7fcc[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3c7fcc['model'],_0x3c7fcc[_0xed87('0x2f')]);_0x7e6cbb[_0xed87('0x34')]=_[_0xed87('0x32')](_0x3c7fcc[_0xed87('0x2d')],qs[_0xed87('0x33')](_0x406b73[_0xed87('0x2f')][_0xed87('0x33')]));_0x7e6cbb[_0xed87('0x34')]=_0x7e6cbb[_0xed87('0x34')][_0xed87('0x35')]?_0x7e6cbb[_0xed87('0x34')]:_0x3c7fcc['model'];if(_0x406b73[_0xed87('0x2f')][_0xed87('0x44')]){_0x7e6cbb[_0xed87('0x3d')]=[{'all':!![]}];}_0x7e6cbb=_[_0xed87('0x3a')]({},_0x7e6cbb,_0x406b73[_0xed87('0x3c')]);return db[_0xed87('0x29')][_0xed87('0x45')](_0x7e6cbb)[_0xed87('0x3f')](handleEntityNotFound(_0x5c6925,null))[_0xed87('0x3f')](respondWithResult(_0x5c6925,null))[_0xed87('0x41')](handleError(_0x5c6925,null));};exports[_0xed87('0x46')]=function(_0x26c8f4,_0x27ed22){return db[_0xed87('0x29')][_0xed87('0x46')](_0x26c8f4[_0xed87('0x47')],{})[_0xed87('0x3f')](respondWithResult(_0x27ed22,0xc9))['catch'](handleError(_0x27ed22,null));};exports[_0xed87('0x23')]=function(_0x1a68a7,_0x3a91c5){if(_0x1a68a7['body']['id']){delete _0x1a68a7[_0xed87('0x47')]['id'];}return db[_0xed87('0x29')]['find']({'where':{'id':_0x1a68a7[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3a91c5,null))[_0xed87('0x3f')](saveUpdates(_0x1a68a7[_0xed87('0x47')],null))['then'](respondWithResult(_0x3a91c5,null))[_0xed87('0x41')](handleError(_0x3a91c5,null));};exports[_0xed87('0x24')]=function(_0x3ca34c,_0x272a07){return db[_0xed87('0x29')][_0xed87('0x45')]({'where':{'id':_0x3ca34c[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x272a07,null))[_0xed87('0x3f')](removeEntity(_0x272a07,null))[_0xed87('0x41')](handleError(_0x272a07,null));};exports[_0xed87('0x48')]=function(_0x18846f,_0x2e5a9f,_0x4df105){var _0x43ffa4={};var _0x4ea4e3={};var _0x17cad7;var _0x329973;return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x18846f[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x2e5a9f,null))[_0xed87('0x3f')](function(_0xccdbb6){if(_0xccdbb6){_0x17cad7=_0xccdbb6;_0x4ea4e3[_0xed87('0x2d')]=_[_0xed87('0x30')](db['ZendeskConfiguration'][_0xed87('0x2a')]);_0x4ea4e3[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x18846f[_0xed87('0x2f')]);_0x4ea4e3[_0xed87('0x31')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],_0x4ea4e3[_0xed87('0x2f')]);_0x43ffa4[_0xed87('0x34')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],qs['fields'](_0x18846f['query'][_0xed87('0x33')]));_0x43ffa4[_0xed87('0x34')]=_0x43ffa4[_0xed87('0x34')][_0xed87('0x35')]?_0x43ffa4[_0xed87('0x34')]:_0x4ea4e3['model'];_0x43ffa4[_0xed87('0x4a')]=qs[_0xed87('0x38')](_0x18846f[_0xed87('0x2f')][_0xed87('0x38')]);_0x43ffa4[_0xed87('0x39')]=qs[_0xed87('0x31')](_[_0xed87('0x4b')](_0x18846f[_0xed87('0x2f')],_0x4ea4e3[_0xed87('0x31')]));if(_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]){_0x43ffa4[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x43ffa4[_0xed87('0x39')],{'$or':_['map'](_0x43ffa4[_0xed87('0x34')],function(_0x10a19c){var _0x2f03d4={};_0x2f03d4[_0x10a19c]={'$like':'%'+_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]+'%'};return _0x2f03d4;})});}_0x43ffa4=_[_0xed87('0x3a')]({},_0x43ffa4,_0x18846f[_0xed87('0x3c')]);return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})['then'](function(_0x4367c3){if(_0x4367c3){_0x329973=_0x4367c3[_0xed87('0x35')];if(!_0x18846f[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x43ffa4[_0xed87('0x1f')]=qs['limit'](_0x18846f['query'][_0xed87('0x1f')]);_0x43ffa4[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0x18846f[_0xed87('0x2f')][_0xed87('0x1c')]);}return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})[_0xed87('0x3f')](function(_0x3bdf7c){if(_0x3bdf7c){return _0x3bdf7c?{'count':_0x329973,'rows':_0x3bdf7c}:null;}})['then'](respondWithResult(_0x2e5a9f,null))[_0xed87('0x41')](handleError(_0x2e5a9f,null));};exports['addConfiguration']=function(_0xd3b300,_0x3c82de,_0x4e5055){if(_0xd3b300[_0xed87('0x47')]['id']){delete _0xd3b300[_0xed87('0x47')]['id'];}return db['ZendeskAccount'][_0xed87('0x49')]({'where':{'id':_0xd3b300[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3c82de,null))[_0xed87('0x3f')](function(_0x112685){if(_0x112685){_0xd3b300['body'][_0xed87('0x4d')]=_0x112685['id'];_0xd3b300[_0xed87('0x47')][_0xed87('0x4e')]=integrations[_0xed87('0x4f')](_0xd3b300['body']['channel'],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);_0xd3b300['body'][_0xed87('0x50')]=integrations[_0xed87('0x51')](_0xd3b300[_0xed87('0x47')][_0xed87('0x52')],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);return db[_0xed87('0x53')][_0xed87('0x46')](_0xd3b300[_0xed87('0x47')],{'include':[{'model':db[_0xed87('0x54')],'as':_0xed87('0x4e')},{'model':db[_0xed87('0x54')],'as':_0xed87('0x50')}]});}return null;})[_0xed87('0x3f')](respondWithResult(_0x3c82de,null))['catch'](handleError(_0x3c82de,null));};exports[_0xed87('0x55')]=function(_0x2686cd,_0x566ace,_0x4f7b92){var _0x5136c9='';return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x2686cd[_0xed87('0x43')]['id']},'attributes':['id',_0xed87('0x56'),_0xed87('0x57'),_0xed87('0x58'),_0xed87('0x59'),'remoteUri']})[_0xed87('0x3f')](handleEntityNotFound(_0x566ace,null))[_0xed87('0x3f')](function(_0x3b6a9b){if(_0x3b6a9b){_0x5136c9=_0x3b6a9b[_0xed87('0x5a')];var _0xc35cab=_0x5136c9[_0xed87('0x5b')](-0x1);if(_0xc35cab==='/'){_0x5136c9=_0x5136c9[_0xed87('0x5c')](0x0,_0x5136c9[_0xed87('0x5d')](_0xc35cab));}var _0x116198={'method':_0xed87('0x5e'),'uri':util['format']('%s/%s',_0x5136c9,'ticket_fields'),'json':!![]};switch(_0x3b6a9b[_0xed87('0x59')]){case _0xed87('0x57'):_0x116198[_0xed87('0x5f')]={'Authorization':util[_0xed87('0x60')](_0xed87('0x61'),new Buffer(util['format'](_0xed87('0x62'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x57')]))[_0xed87('0x63')](_0xed87('0x64')))};break;case _0xed87('0x58'):_0x116198['headers']={'Authorization':util['format'](_0xed87('0x61'),new Buffer(util[_0xed87('0x60')](_0xed87('0x65'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x58')]))[_0xed87('0x63')](_0xed87('0x64')))};break;default:throw new db[(_0xed87('0x66'))][(_0xed87('0x67'))](_0xed87('0x68'));}return rp(_0x116198);}})[_0xed87('0x3f')](function(_0x1a1f95){if(_0x1a1f95){var _0x52af5c=[_0xed87('0x69'),_0xed87('0x6a'),_0xed87('0x6b'),_0xed87('0x6c')];_[_0xed87('0x6d')](_0x1a1f95[_0xed87('0x6e')],function(_0x4ae84c){return _0x52af5c[_0xed87('0x6f')](_0x4ae84c[_0xed87('0x2b')]);});return{'count':_0x1a1f95[_0xed87('0x6e')][_0xed87('0x35')],'rows':_['map'](_0x1a1f95['ticket_fields'],function(_0x4bfca0){return{'id':_0x4bfca0['id'],'name':_0x4bfca0['position']>0x7?_0x4bfca0['title']:_0x4bfca0[_0xed87('0x2b')],'custom':_0x4bfca0[_0xed87('0x70')]>0x7?!![]:![],'options':_0x4bfca0[_0xed87('0x71')]?_0x4bfca0[_0xed87('0x71')]:_0x4bfca0[_0xed87('0x72')]?_0x4bfca0[_0xed87('0x72')]:[]};})};}})[_0xed87('0x3f')](respondWithResult(_0x566ace,null))[_0xed87('0x41')](function(_0x1b223b){var _0x510066=_0x2686cd['query'][_0xed87('0x73')]?0x1f4:_0x1b223b[_0xed87('0x74')]||0x1f4;logger[_0xed87('0x25')](_0xed87('0x75'),_0xed87('0x55'),_0x510066,JSON['stringify'](_0x1b223b));delete _0x1b223b['name'];if(_0x510066===0x191){_0x510066=0x190;}_0x566ace[_0xed87('0x19')](_0x510066)[_0xed87('0x76')](_0x2686cd['query'][_0xed87('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1b223b[_0xed87('0x74')]}:_0x1b223b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 61a5b1a..f8486da 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 _0xd83f=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','ZendeskAccount','lodash','../../config/logger','moment'];(function(_0x64b531,_0x4cb65b){var _0x469673=function(_0x176039){while(--_0x176039){_0x64b531['push'](_0x64b531['shift']());}};_0x469673(++_0x4cb65b);}(_0xd83f,0x1bf));var _0xfd83=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd83f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xfd83('0x0'));var util=require('util');var logger=require(_0xfd83('0x1'))('api');var moment=require(_0xfd83('0x2'));var BPromise=require(_0xfd83('0x3'));var rp=require(_0xfd83('0x4'));var fs=require('fs');var path=require(_0xfd83('0x5'));var rimraf=require(_0xfd83('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xfd83('0x7'));module['exports']=function(_0x245eb5,_0x31b89b){return _0x245eb5['define'](_0xfd83('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8385=['api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger'];(function(_0xb3f0bb,_0xc129c0){var _0x551481=function(_0x307201){while(--_0x307201){_0xb3f0bb['push'](_0xb3f0bb['shift']());}};_0x551481(++_0xc129c0);}(_0x8385,0x12a));var _0x5838=function(_0x2979db,_0x470467){_0x2979db=_0x2979db-0x0;var _0x2c2bed=_0x8385[_0x2979db];return _0x2c2bed;};'use strict';var _=require('lodash');var util=require(_0x5838('0x0'));var logger=require(_0x5838('0x1'))(_0x5838('0x2'));var moment=require(_0x5838('0x3'));var BPromise=require('bluebird');var rp=require(_0x5838('0x4'));var fs=require('fs');var path=require(_0x5838('0x5'));var rimraf=require(_0x5838('0x6'));var config=require(_0x5838('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x5838('0x8'));module['exports']=function(_0x3f155c,_0x365987){return _0x3f155c[_0x5838('0x9')](_0x5838('0xa'),attributes,{'tableName':_0x5838('0xb'),'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 78d7653..3c6e3f9 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 _0x6469=['include','map','model','debug','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','findAll','options','raw','attributes'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x6469,0x142));var _0x9646=function(_0x3c3f09,_0x540048){_0x3c3f09=_0x3c3f09-0x0;var _0x392a94=_0x6469[_0x3c3f09];return _0x392a94;};'use strict';var _=require(_0x9646('0x0'));var util=require(_0x9646('0x1'));var moment=require(_0x9646('0x2'));var BPromise=require(_0x9646('0x3'));var rs=require(_0x9646('0x4'));var fs=require('fs');var Redis=require(_0x9646('0x5'));var db=require(_0x9646('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9646('0x7'))(_0x9646('0x8'));var config=require(_0x9646('0x9'));var jayson=require(_0x9646('0xa'));var client=jayson[_0x9646('0xb')][_0x9646('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57dde5,_0x1e1568,_0x1caff2){return new BPromise(function(_0x98be5c,_0x96fde9){return client[_0x9646('0xd')](_0x57dde5,_0x1caff2)[_0x9646('0xe')](function(_0x3ad438){logger[_0x9646('0xf')](_0x9646('0x10'),_0x1e1568,_0x9646('0x11'));logger['debug'](_0x9646('0x12'),_0x1e1568,_0x9646('0x11'),JSON[_0x9646('0x13')](_0x3ad438));if(_0x3ad438[_0x9646('0x14')]){if(_0x3ad438[_0x9646('0x14')]['code']===0x1f4){logger[_0x9646('0x14')](_0x9646('0x10'),_0x1e1568,_0x3ad438['error'][_0x9646('0x15')]);return _0x96fde9(_0x3ad438[_0x9646('0x14')][_0x9646('0x15')]);}logger[_0x9646('0x14')](_0x9646('0x10'),_0x1e1568,_0x3ad438[_0x9646('0x14')]['message']);return _0x98be5c(_0x3ad438[_0x9646('0x14')][_0x9646('0x15')]);}else{logger['info'](_0x9646('0x10'),_0x1e1568,_0x9646('0x11'));_0x98be5c(_0x3ad438['result']['message']);}})[_0x9646('0x16')](function(_0x5f214d){logger['error'](_0x9646('0x10'),_0x1e1568,_0x5f214d);_0x96fde9(_0x5f214d);});});}exports[_0x9646('0x17')]=function(_0x164b4c){var _0x16f0b8=this;return new Promise(function(_0x1e04b8,_0x355853){return db['ZendeskAccount'][_0x9646('0x18')]({'raw':_0x164b4c[_0x9646('0x19')]?_0x164b4c['options'][_0x9646('0x1a')]===undefined?!![]:![]:!![],'where':_0x164b4c[_0x9646('0x19')]?_0x164b4c[_0x9646('0x19')]['where']||null:null,'attributes':_0x164b4c[_0x9646('0x19')]?_0x164b4c[_0x9646('0x19')][_0x9646('0x1b')]||null:null,'limit':_0x164b4c[_0x9646('0x19')]?_0x164b4c[_0x9646('0x19')]['limit']||null:null,'include':_0x164b4c[_0x9646('0x19')]?_0x164b4c['options'][_0x9646('0x1c')]?_['map'](_0x164b4c[_0x9646('0x19')][_0x9646('0x1c')],function(_0x4597b6){return{'model':db[_0x4597b6['model']],'as':_0x4597b6['as'],'attributes':_0x4597b6[_0x9646('0x1b')],'include':_0x4597b6[_0x9646('0x1c')]?_[_0x9646('0x1d')](_0x4597b6[_0x9646('0x1c')],function(_0x33b9d2){return{'model':db[_0x33b9d2[_0x9646('0x1e')]],'as':_0x33b9d2['as'],'attributes':_0x33b9d2['attributes'],'include':_0x33b9d2['include']?_['map'](_0x33b9d2[_0x9646('0x1c')],function(_0x4e1769){return{'model':db[_0x4e1769[_0x9646('0x1e')]],'as':_0x4e1769['as'],'attributes':_0x4e1769[_0x9646('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9646('0xe')](function(_0x45d79c){logger[_0x9646('0xf')](_0x9646('0x17'),_0x164b4c);logger[_0x9646('0x1f')](_0x9646('0x17'),_0x164b4c,JSON[_0x9646('0x13')](_0x45d79c));_0x1e04b8(_0x45d79c);})['catch'](function(_0x2b08cb){logger[_0x9646('0x14')]('GetZendeskAccount',_0x2b08cb[_0x9646('0x15')],_0x164b4c);_0x355853(_0x16f0b8[_0x9646('0x14')](0x1f4,_0x2b08cb['message']));});});};exports[_0x9646('0x20')]=function(_0x4201a9){var _0x4ae051=this;return new Promise(function(_0x2fa468,_0x237693){return db[_0x9646('0x21')][_0x9646('0x22')]({'raw':_0x4201a9['options']?_0x4201a9[_0x9646('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4201a9[_0x9646('0x19')]?_0x4201a9[_0x9646('0x19')]['where']||null:null,'attributes':_0x4201a9['options']?_0x4201a9[_0x9646('0x19')][_0x9646('0x1b')]||null:null,'include':_0x4201a9[_0x9646('0x19')]?_0x4201a9[_0x9646('0x19')]['include']?_[_0x9646('0x1d')](_0x4201a9[_0x9646('0x19')][_0x9646('0x1c')],function(_0x320def){return{'model':db[_0x320def[_0x9646('0x1e')]],'as':_0x320def['as'],'attributes':_0x320def[_0x9646('0x1b')],'include':_0x320def[_0x9646('0x1c')]?_['map'](_0x320def[_0x9646('0x1c')],function(_0x44e45d){return{'model':db[_0x44e45d[_0x9646('0x1e')]],'as':_0x44e45d['as'],'attributes':_0x44e45d[_0x9646('0x1b')],'include':_0x44e45d[_0x9646('0x1c')]?_[_0x9646('0x1d')](_0x44e45d[_0x9646('0x1c')],function(_0x1276a4){return{'model':db[_0x1276a4[_0x9646('0x1e')]],'as':_0x1276a4['as'],'attributes':_0x1276a4[_0x9646('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e52a){logger[_0x9646('0xf')]('ShowZendeskAccount',_0x4201a9);logger[_0x9646('0x1f')](_0x9646('0x20'),_0x4201a9,JSON[_0x9646('0x13')](_0x22e52a));_0x2fa468(_0x22e52a);})[_0x9646('0x16')](function(_0x24fc41){logger[_0x9646('0x14')]('ShowZendeskAccount',_0x24fc41['message'],_0x4201a9);_0x237693(_0x4ae051[_0x9646('0x14')](0x1f4,_0x24fc41[_0x9646('0x15')]));});});}; \ No newline at end of file +var _0x1894=['catch','GetZendeskAccount','ZendeskAccount','options','where','attributes','include','model','map','find','ShowZendeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x1894,0x1af));var _0x4189=function(_0xda6ad1,_0x5f09e3){_0xda6ad1=_0xda6ad1-0x0;var _0xedc3a5=_0x1894[_0xda6ad1];return _0xedc3a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4189('0x0'));var BPromise=require(_0x4189('0x1'));var rs=require(_0x4189('0x2'));var fs=require('fs');var Redis=require(_0x4189('0x3'));var db=require(_0x4189('0x4'))['db'];var utils=require(_0x4189('0x5'));var logger=require(_0x4189('0x6'))(_0x4189('0x7'));var config=require(_0x4189('0x8'));var jayson=require(_0x4189('0x9'));var client=jayson[_0x4189('0xa')][_0x4189('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0c59,_0xad3195,_0x21043d){return new BPromise(function(_0x5cc832,_0x61439){return client[_0x4189('0xc')](_0x2a0c59,_0x21043d)[_0x4189('0xd')](function(_0x51b466){logger['info'](_0x4189('0xe'),_0xad3195,_0x4189('0xf'));logger[_0x4189('0x10')](_0x4189('0x11'),_0xad3195,'request\x20sent',JSON[_0x4189('0x12')](_0x51b466));if(_0x51b466[_0x4189('0x13')]){if(_0x51b466[_0x4189('0x13')][_0x4189('0x14')]===0x1f4){logger[_0x4189('0x13')](_0x4189('0xe'),_0xad3195,_0x51b466[_0x4189('0x13')][_0x4189('0x15')]);return _0x61439(_0x51b466[_0x4189('0x13')]['message']);}logger[_0x4189('0x13')](_0x4189('0xe'),_0xad3195,_0x51b466[_0x4189('0x13')]['message']);return _0x5cc832(_0x51b466[_0x4189('0x13')]['message']);}else{logger[_0x4189('0x16')](_0x4189('0xe'),_0xad3195,_0x4189('0xf'));_0x5cc832(_0x51b466[_0x4189('0x17')]['message']);}})[_0x4189('0x18')](function(_0x1cb7f1){logger[_0x4189('0x13')](_0x4189('0xe'),_0xad3195,_0x1cb7f1);_0x61439(_0x1cb7f1);});});}exports[_0x4189('0x19')]=function(_0x1ba603){var _0x16a677=this;return new Promise(function(_0x228aac,_0x496b79){return db[_0x4189('0x1a')]['findAll']({'raw':_0x1ba603[_0x4189('0x1b')]?_0x1ba603[_0x4189('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ba603['options']?_0x1ba603[_0x4189('0x1b')][_0x4189('0x1c')]||null:null,'attributes':_0x1ba603[_0x4189('0x1b')]?_0x1ba603[_0x4189('0x1b')][_0x4189('0x1d')]||null:null,'limit':_0x1ba603[_0x4189('0x1b')]?_0x1ba603[_0x4189('0x1b')]['limit']||null:null,'include':_0x1ba603['options']?_0x1ba603['options']['include']?_['map'](_0x1ba603[_0x4189('0x1b')][_0x4189('0x1e')],function(_0x1420a9){return{'model':db[_0x1420a9[_0x4189('0x1f')]],'as':_0x1420a9['as'],'attributes':_0x1420a9[_0x4189('0x1d')],'include':_0x1420a9['include']?_[_0x4189('0x20')](_0x1420a9['include'],function(_0x4ea922){return{'model':db[_0x4ea922[_0x4189('0x1f')]],'as':_0x4ea922['as'],'attributes':_0x4ea922['attributes'],'include':_0x4ea922[_0x4189('0x1e')]?_[_0x4189('0x20')](_0x4ea922['include'],function(_0x47e44a){return{'model':db[_0x47e44a[_0x4189('0x1f')]],'as':_0x47e44a['as'],'attributes':_0x47e44a[_0x4189('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x562f64){logger[_0x4189('0x16')](_0x4189('0x19'),_0x1ba603);logger[_0x4189('0x10')](_0x4189('0x19'),_0x1ba603,JSON['stringify'](_0x562f64));_0x228aac(_0x562f64);})['catch'](function(_0x56c176){logger[_0x4189('0x13')](_0x4189('0x19'),_0x56c176[_0x4189('0x15')],_0x1ba603);_0x496b79(_0x16a677['error'](0x1f4,_0x56c176['message']));});});};exports['ShowZendeskAccount']=function(_0x40e816){var _0xceeb3f=this;return new Promise(function(_0x679354,_0x3c9c64){return db[_0x4189('0x1a')][_0x4189('0x21')]({'raw':_0x40e816[_0x4189('0x1b')]?_0x40e816[_0x4189('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x40e816['options']?_0x40e816[_0x4189('0x1b')][_0x4189('0x1c')]||null:null,'attributes':_0x40e816[_0x4189('0x1b')]?_0x40e816['options'][_0x4189('0x1d')]||null:null,'include':_0x40e816[_0x4189('0x1b')]?_0x40e816[_0x4189('0x1b')]['include']?_[_0x4189('0x20')](_0x40e816[_0x4189('0x1b')][_0x4189('0x1e')],function(_0x1c8133){return{'model':db[_0x1c8133[_0x4189('0x1f')]],'as':_0x1c8133['as'],'attributes':_0x1c8133[_0x4189('0x1d')],'include':_0x1c8133['include']?_[_0x4189('0x20')](_0x1c8133['include'],function(_0x375f92){return{'model':db[_0x375f92['model']],'as':_0x375f92['as'],'attributes':_0x375f92[_0x4189('0x1d')],'include':_0x375f92['include']?_[_0x4189('0x20')](_0x375f92['include'],function(_0x3d00b9){return{'model':db[_0x3d00b9[_0x4189('0x1f')]],'as':_0x3d00b9['as'],'attributes':_0x3d00b9[_0x4189('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4189('0xd')](function(_0xe9d26e){logger[_0x4189('0x16')](_0x4189('0x22'),_0x40e816);logger['debug']('ShowZendeskAccount',_0x40e816,JSON[_0x4189('0x12')](_0xe9d26e));_0x679354(_0xe9d26e);})[_0x4189('0x18')](function(_0x2efe3b){logger[_0x4189('0x13')](_0x4189('0x22'),_0x2efe3b[_0x4189('0x15')],_0x40e816);_0x3c9c64(_0xceeb3f[_0x4189('0x13')](0x1f4,_0x2efe3b[_0x4189('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 84c84d7..3bc7e6f 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 _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x44f1c0,_0x523564){var _0x2ed1a6=function(_0x3d9b73){while(--_0x3d9b73){_0x44f1c0['push'](_0x44f1c0['shift']());}};_0x2ed1a6(++_0x523564);}(_0x087b,0x11a));var _0xb087=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x087b[_0x2e4e19];return _0x9ba20b;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 85b2017..0fee27f 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 _0xdfb2=['exports','STRING','sequelize'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0xdfb2,0x12b));var _0x2dfb=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xdfb2[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x2dfb('0x0'));module[_0x2dfb('0x1')]={'name':{'type':Sequelize[_0x2dfb('0x2')]},'description':{'type':Sequelize[_0x2dfb('0x2')]}}; \ No newline at end of file +var _0x3183=['STRING','sequelize','exports'];(function(_0x48a15e,_0x43ed03){var _0x4ee441=function(_0x11872e){while(--_0x11872e){_0x48a15e['push'](_0x48a15e['shift']());}};_0x4ee441(++_0x43ed03);}(_0x3183,0xa0));var _0x3318=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x3183[_0x4dbba7];return _0x43ef83;};'use strict';var Sequelize=require(_0x3318('0x0'));module[_0x3318('0x1')]={'name':{'type':Sequelize[_0x3318('0x2')]},'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 3049989..4dbca64 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 _0xf7d8=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','ZendeskConfiguration','findAll','rows','catch','fields','find','create','body','params','destroy','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xf7d8,0x8b));var _0x8f7d=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0xf7d8[_0x189c9e];return _0x3f38ca;};'use strict';var emlformat=require(_0x8f7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f7d('0x1'));var jsonpatch=require(_0x8f7d('0x2'));var rp=require(_0x8f7d('0x3'));var moment=require(_0x8f7d('0x4'));var BPromise=require(_0x8f7d('0x5'));var Mustache=require(_0x8f7d('0x6'));var util=require(_0x8f7d('0x7'));var path=require('path');var sox=require(_0x8f7d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f7d('0x9'));var _=require(_0x8f7d('0xa'));var squel=require(_0x8f7d('0xb'));var crypto=require(_0x8f7d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8f7d('0xd'));var toCsv=require(_0x8f7d('0xe'));var querystring=require('querystring');var Papa=require(_0x8f7d('0xf'));var Redis=require(_0x8f7d('0x10'));var authService=require(_0x8f7d('0x11'));var qs=require(_0x8f7d('0x12'));var as=require(_0x8f7d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f7d('0x14'))(_0x8f7d('0x15'));var utils=require(_0x8f7d('0x16'));var config=require(_0x8f7d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x412794,_0x14a1b8){_0x14a1b8=_0x14a1b8||0xcc;return function(_0x6edb27){if(_0x6edb27){return _0x412794[_0x8f7d('0x18')](_0x14a1b8);}return _0x412794[_0x8f7d('0x19')](_0x14a1b8)[_0x8f7d('0x1a')]();};}function respondWithResult(_0x5399b0,_0x2dce72){_0x2dce72=_0x2dce72||0xc8;return function(_0x54229e){if(_0x54229e){return _0x5399b0[_0x8f7d('0x19')](_0x2dce72)[_0x8f7d('0x1b')](_0x54229e);}};}function respondWithFilteredResult(_0x155fb1,_0x26b451){return function(_0x56f307){if(_0x56f307){var _0x3cdaff=typeof _0x26b451[_0x8f7d('0x1c')]==='undefined'&&typeof _0x26b451[_0x8f7d('0x1d')]===_0x8f7d('0x1e');var _0x42c9f5=_0x56f307[_0x8f7d('0x1f')];var _0x462700=_0x3cdaff?0x0:_0x26b451[_0x8f7d('0x1c')];var _0x4912bb=_0x3cdaff?_0x56f307[_0x8f7d('0x1f')]:_0x26b451[_0x8f7d('0x1c')]+_0x26b451[_0x8f7d('0x1d')];var _0x16a8a3;if(_0x4912bb>=_0x42c9f5){_0x4912bb=_0x42c9f5;_0x16a8a3=0xc8;}else{_0x16a8a3=0xce;}_0x155fb1[_0x8f7d('0x19')](_0x16a8a3);return _0x155fb1[_0x8f7d('0x20')](_0x8f7d('0x21'),_0x462700+'-'+_0x4912bb+'/'+_0x42c9f5)[_0x8f7d('0x1b')](_0x56f307);}return null;};}function patchUpdates(_0x53ff27){return function(_0x594559){try{jsonpatch[_0x8f7d('0x22')](_0x594559,_0x53ff27,!![]);}catch(_0x1c9c37){return BPromise[_0x8f7d('0x23')](_0x1c9c37);}return _0x594559[_0x8f7d('0x24')]();};}function saveUpdates(_0x466370,_0x3f9652){return function(_0x500656){if(_0x500656){return _0x500656[_0x8f7d('0x25')](_0x466370)[_0x8f7d('0x26')](function(_0x1386da){return _0x1386da;});}return null;};}function removeEntity(_0x2a260e,_0x4cb77e){return function(_0x49934c){if(_0x49934c){return _0x49934c['destroy']()['then'](function(){_0x2a260e[_0x8f7d('0x19')](0xcc)[_0x8f7d('0x1a')]();});}};}function handleEntityNotFound(_0x25f8bc,_0x1d0c86){return function(_0x4dc573){if(!_0x4dc573){_0x25f8bc[_0x8f7d('0x18')](0x194);}return _0x4dc573;};}function handleError(_0x5b3d10,_0x2a8c8a){_0x2a8c8a=_0x2a8c8a||0x1f4;return function(_0x30d258){logger[_0x8f7d('0x27')](_0x30d258['stack']);if(_0x30d258[_0x8f7d('0x28')]){delete _0x30d258[_0x8f7d('0x28')];}_0x5b3d10['status'](_0x2a8c8a)[_0x8f7d('0x29')](_0x30d258);};}exports['index']=function(_0x577f35,_0x1cb7eb){var _0x54eaaa={},_0x304336={},_0x59230a={'count':0x0,'rows':[]};var _0x1a6b35=_['map'](db['ZendeskConfiguration'][_0x8f7d('0x2a')],function(_0x47d394){return{'name':_0x47d394['fieldName'],'type':_0x47d394[_0x8f7d('0x2b')][_0x8f7d('0x2c')]};});_0x304336[_0x8f7d('0x2d')]=_[_0x8f7d('0x2e')](_0x1a6b35,_0x8f7d('0x28'));_0x304336[_0x8f7d('0x2f')]=_[_0x8f7d('0x30')](_0x577f35[_0x8f7d('0x2f')]);_0x304336[_0x8f7d('0x31')]=_[_0x8f7d('0x32')](_0x304336[_0x8f7d('0x2d')],_0x304336[_0x8f7d('0x2f')]);_0x54eaaa['attributes']=_[_0x8f7d('0x32')](_0x304336['model'],qs['fields'](_0x577f35[_0x8f7d('0x2f')]['fields']));_0x54eaaa['attributes']=_0x54eaaa[_0x8f7d('0x33')][_0x8f7d('0x34')]?_0x54eaaa[_0x8f7d('0x33')]:_0x304336[_0x8f7d('0x2d')];if(!_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x35')](_0x8f7d('0x36'))){_0x54eaaa['limit']=qs[_0x8f7d('0x1d')](_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x1d')]);_0x54eaaa[_0x8f7d('0x1c')]=qs[_0x8f7d('0x1c')](_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x1c')]);}_0x54eaaa[_0x8f7d('0x37')]=qs[_0x8f7d('0x38')](_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x38')]);_0x54eaaa[_0x8f7d('0x39')]=qs[_0x8f7d('0x31')](_['pick'](_0x577f35['query'],_0x304336['filters']),_0x1a6b35);if(_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x3a')]){_0x54eaaa['where']=_['merge'](_0x54eaaa[_0x8f7d('0x39')],{'$or':_['map'](_0x1a6b35,function(_0x1273ef){if(_0x1273ef[_0x8f7d('0x2b')]!==_0x8f7d('0x3b')){var _0xf53780={};_0xf53780[_0x1273ef[_0x8f7d('0x28')]]={'$like':'%'+_0x577f35['query'][_0x8f7d('0x3a')]+'%'};return _0xf53780;}})});}_0x54eaaa=_[_0x8f7d('0x3c')]({},_0x54eaaa,_0x577f35[_0x8f7d('0x3d')]);var _0x5b759f={'where':_0x54eaaa[_0x8f7d('0x39')]};return db['ZendeskConfiguration'][_0x8f7d('0x1f')](_0x5b759f)[_0x8f7d('0x26')](function(_0x1eb2a5){_0x59230a[_0x8f7d('0x1f')]=_0x1eb2a5;if(_0x577f35[_0x8f7d('0x2f')][_0x8f7d('0x3e')]){_0x54eaaa['include']=[{'all':!![]}];}return db[_0x8f7d('0x3f')][_0x8f7d('0x40')](_0x54eaaa);})[_0x8f7d('0x26')](function(_0x1b37bb){_0x59230a[_0x8f7d('0x41')]=_0x1b37bb;return _0x59230a;})[_0x8f7d('0x26')](respondWithFilteredResult(_0x1cb7eb,_0x54eaaa))[_0x8f7d('0x42')](handleError(_0x1cb7eb,null));};exports['show']=function(_0x2d4db9,_0x4876ce){var _0xf3653c={'raw':![],'where':{'id':_0x2d4db9['params']['id']}},_0x5db2de={};_0x5db2de['model']=_[_0x8f7d('0x30')](db[_0x8f7d('0x3f')][_0x8f7d('0x2a')]);_0x5db2de['query']=_['keys'](_0x2d4db9[_0x8f7d('0x2f')]);_0x5db2de[_0x8f7d('0x31')]=_[_0x8f7d('0x32')](_0x5db2de[_0x8f7d('0x2d')],_0x5db2de[_0x8f7d('0x2f')]);_0xf3653c['attributes']=_['intersection'](_0x5db2de[_0x8f7d('0x2d')],qs[_0x8f7d('0x43')](_0x2d4db9['query'][_0x8f7d('0x43')]));_0xf3653c[_0x8f7d('0x33')]=_0xf3653c[_0x8f7d('0x33')]['length']?_0xf3653c[_0x8f7d('0x33')]:_0x5db2de[_0x8f7d('0x2d')];if(_0x2d4db9[_0x8f7d('0x2f')][_0x8f7d('0x3e')]){_0xf3653c['include']=[{'all':!![]}];}_0xf3653c=_[_0x8f7d('0x3c')]({},_0xf3653c,_0x2d4db9[_0x8f7d('0x3d')]);return db[_0x8f7d('0x3f')][_0x8f7d('0x44')](_0xf3653c)[_0x8f7d('0x26')](handleEntityNotFound(_0x4876ce,null))['then'](respondWithResult(_0x4876ce,null))[_0x8f7d('0x42')](handleError(_0x4876ce,null));};exports[_0x8f7d('0x45')]=function(_0x10c06d,_0x1cd4f2){return db['ZendeskConfiguration']['create'](_0x10c06d[_0x8f7d('0x46')],{})[_0x8f7d('0x26')](respondWithResult(_0x1cd4f2,0xc9))[_0x8f7d('0x42')](handleError(_0x1cd4f2,null));};exports['update']=function(_0x1af27e,_0x54de4c){if(_0x1af27e[_0x8f7d('0x46')]['id']){delete _0x1af27e['body']['id'];}return db[_0x8f7d('0x3f')]['find']({'where':{'id':_0x1af27e[_0x8f7d('0x47')]['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x54de4c,null))[_0x8f7d('0x26')](saveUpdates(_0x1af27e[_0x8f7d('0x46')],null))[_0x8f7d('0x26')](respondWithResult(_0x54de4c,null))['catch'](handleError(_0x54de4c,null));};exports[_0x8f7d('0x48')]=function(_0x249bb1,_0x4690b8){return db[_0x8f7d('0x3f')]['find']({'where':{'id':_0x249bb1['params']['id']}})['then'](handleEntityNotFound(_0x4690b8,null))[_0x8f7d('0x26')](removeEntity(_0x4690b8,null))[_0x8f7d('0x42')](handleError(_0x4690b8,null));};exports[_0x8f7d('0x49')]=function(_0x490467,_0x1b16a2,_0x18616e){var _0x360d28={};var _0x2e9b22={};var _0x414aad;var _0x5e089e;return db[_0x8f7d('0x3f')][_0x8f7d('0x4a')]({'where':{'id':_0x490467['params']['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x1b16a2,null))[_0x8f7d('0x26')](function(_0x32844c){if(_0x32844c){_0x414aad=_0x32844c;_0x2e9b22[_0x8f7d('0x2d')]=_[_0x8f7d('0x30')](db[_0x8f7d('0x4b')][_0x8f7d('0x2a')]);_0x2e9b22[_0x8f7d('0x2f')]=_[_0x8f7d('0x30')](_0x490467[_0x8f7d('0x2f')]);_0x2e9b22[_0x8f7d('0x31')]=_[_0x8f7d('0x32')](_0x2e9b22[_0x8f7d('0x2d')],_0x2e9b22[_0x8f7d('0x2f')]);_0x360d28[_0x8f7d('0x33')]=_[_0x8f7d('0x32')](_0x2e9b22[_0x8f7d('0x2d')],qs['fields'](_0x490467[_0x8f7d('0x2f')][_0x8f7d('0x43')]));_0x360d28[_0x8f7d('0x33')]=_0x360d28[_0x8f7d('0x33')][_0x8f7d('0x34')]?_0x360d28[_0x8f7d('0x33')]:_0x2e9b22[_0x8f7d('0x2d')];_0x360d28['order']=qs['sort'](_0x490467[_0x8f7d('0x2f')][_0x8f7d('0x38')]);_0x360d28[_0x8f7d('0x39')]=qs[_0x8f7d('0x31')](_[_0x8f7d('0x4c')](_0x490467[_0x8f7d('0x2f')],_0x2e9b22[_0x8f7d('0x31')]));if(_0x490467[_0x8f7d('0x2f')][_0x8f7d('0x3a')]){_0x360d28[_0x8f7d('0x39')]=_[_0x8f7d('0x3c')](_0x360d28['where'],{'$or':_[_0x8f7d('0x2e')](_0x360d28[_0x8f7d('0x33')],function(_0x100543){var _0x10155a={};_0x10155a[_0x100543]={'$like':'%'+_0x490467[_0x8f7d('0x2f')][_0x8f7d('0x3a')]+'%'};return _0x10155a;})});}_0x360d28=_[_0x8f7d('0x3c')]({},_0x360d28,_0x490467[_0x8f7d('0x3d')]);return _0x414aad[_0x8f7d('0x49')](_0x360d28);}})[_0x8f7d('0x26')](function(_0x27b7dc){if(_0x27b7dc){_0x5e089e=_0x27b7dc[_0x8f7d('0x34')];if(!_0x490467[_0x8f7d('0x2f')][_0x8f7d('0x35')]('nolimit')){_0x360d28[_0x8f7d('0x1d')]=qs[_0x8f7d('0x1d')](_0x490467['query'][_0x8f7d('0x1d')]);_0x360d28[_0x8f7d('0x1c')]=qs[_0x8f7d('0x1c')](_0x490467[_0x8f7d('0x2f')]['offset']);}return _0x414aad[_0x8f7d('0x49')](_0x360d28);}})['then'](function(_0x478adb){if(_0x478adb){return _0x478adb?{'count':_0x5e089e,'rows':_0x478adb}:null;}})[_0x8f7d('0x26')](respondWithResult(_0x1b16a2,null))[_0x8f7d('0x42')](handleError(_0x1b16a2,null));};exports[_0x8f7d('0x4d')]=function(_0xf29616,_0x353726,_0x4cf605){var _0x331dea={};var _0x18e8c1={};var _0x4a075f;var _0x13cbf8;return db[_0x8f7d('0x3f')]['findOne']({'where':{'id':_0xf29616['params']['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x353726,null))[_0x8f7d('0x26')](function(_0x2884c0){if(_0x2884c0){_0x4a075f=_0x2884c0;_0x18e8c1[_0x8f7d('0x2d')]=_[_0x8f7d('0x30')](db['ZendeskField']['rawAttributes']);_0x18e8c1['query']=_['keys'](_0xf29616[_0x8f7d('0x2f')]);_0x18e8c1['filters']=_[_0x8f7d('0x32')](_0x18e8c1[_0x8f7d('0x2d')],_0x18e8c1['query']);_0x331dea[_0x8f7d('0x33')]=_[_0x8f7d('0x32')](_0x18e8c1[_0x8f7d('0x2d')],qs[_0x8f7d('0x43')](_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x43')]));_0x331dea['attributes']=_0x331dea[_0x8f7d('0x33')][_0x8f7d('0x34')]?_0x331dea[_0x8f7d('0x33')]:_0x18e8c1[_0x8f7d('0x2d')];_0x331dea[_0x8f7d('0x37')]=qs[_0x8f7d('0x38')](_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x38')]);_0x331dea[_0x8f7d('0x39')]=qs['filters'](_['pick'](_0xf29616['query'],_0x18e8c1[_0x8f7d('0x31')]));if(_0xf29616['query'][_0x8f7d('0x3a')]){_0x331dea[_0x8f7d('0x39')]=_[_0x8f7d('0x3c')](_0x331dea[_0x8f7d('0x39')],{'$or':_[_0x8f7d('0x2e')](_0x331dea[_0x8f7d('0x33')],function(_0x51518d){var _0x51c23e={};_0x51c23e[_0x51518d]={'$like':'%'+_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x3a')]+'%'};return _0x51c23e;})});}_0x331dea=_[_0x8f7d('0x3c')]({},_0x331dea,_0xf29616[_0x8f7d('0x3d')]);return _0x4a075f[_0x8f7d('0x4d')](_0x331dea);}})[_0x8f7d('0x26')](function(_0x378d70){if(_0x378d70){_0x13cbf8=_0x378d70[_0x8f7d('0x34')];if(!_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x35')](_0x8f7d('0x36'))){_0x331dea[_0x8f7d('0x1d')]=qs['limit'](_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x1d')]);_0x331dea[_0x8f7d('0x1c')]=qs[_0x8f7d('0x1c')](_0xf29616[_0x8f7d('0x2f')][_0x8f7d('0x1c')]);}return _0x4a075f[_0x8f7d('0x4d')](_0x331dea);}})[_0x8f7d('0x26')](function(_0x5e9787){if(_0x5e9787){return _0x5e9787?{'count':_0x13cbf8,'rows':_0x5e9787}:null;}})[_0x8f7d('0x26')](respondWithResult(_0x353726,null))[_0x8f7d('0x42')](handleError(_0x353726,null));};exports[_0x8f7d('0x4e')]=function(_0x1b78bb,_0x18738c,_0x4f85ca){var _0x3c553d={};var _0x305ad4={};var _0x17985e;var _0x26bb91;return db['ZendeskConfiguration'][_0x8f7d('0x4a')]({'where':{'id':_0x1b78bb[_0x8f7d('0x47')]['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x18738c,null))[_0x8f7d('0x26')](function(_0x2b05c1){if(_0x2b05c1){_0x17985e=_0x2b05c1;_0x305ad4[_0x8f7d('0x2d')]=_[_0x8f7d('0x30')](db[_0x8f7d('0x4b')][_0x8f7d('0x2a')]);_0x305ad4[_0x8f7d('0x2f')]=_[_0x8f7d('0x30')](_0x1b78bb[_0x8f7d('0x2f')]);_0x305ad4[_0x8f7d('0x31')]=_[_0x8f7d('0x32')](_0x305ad4['model'],_0x305ad4[_0x8f7d('0x2f')]);_0x3c553d[_0x8f7d('0x33')]=_[_0x8f7d('0x32')](_0x305ad4[_0x8f7d('0x2d')],qs['fields'](_0x1b78bb['query'][_0x8f7d('0x43')]));_0x3c553d[_0x8f7d('0x33')]=_0x3c553d[_0x8f7d('0x33')][_0x8f7d('0x34')]?_0x3c553d[_0x8f7d('0x33')]:_0x305ad4[_0x8f7d('0x2d')];_0x3c553d[_0x8f7d('0x37')]=qs[_0x8f7d('0x38')](_0x1b78bb[_0x8f7d('0x2f')][_0x8f7d('0x38')]);_0x3c553d[_0x8f7d('0x39')]=qs['filters'](_[_0x8f7d('0x4c')](_0x1b78bb[_0x8f7d('0x2f')],_0x305ad4[_0x8f7d('0x31')]));if(_0x1b78bb[_0x8f7d('0x2f')][_0x8f7d('0x3a')]){_0x3c553d[_0x8f7d('0x39')]=_[_0x8f7d('0x3c')](_0x3c553d[_0x8f7d('0x39')],{'$or':_[_0x8f7d('0x2e')](_0x3c553d[_0x8f7d('0x33')],function(_0x38c189){var _0x398134={};_0x398134[_0x38c189]={'$like':'%'+_0x1b78bb[_0x8f7d('0x2f')]['filter']+'%'};return _0x398134;})});}_0x3c553d=_[_0x8f7d('0x3c')]({},_0x3c553d,_0x1b78bb[_0x8f7d('0x3d')]);return _0x17985e[_0x8f7d('0x4e')](_0x3c553d);}})['then'](function(_0x217976){if(_0x217976){_0x26bb91=_0x217976['length'];if(!_0x1b78bb[_0x8f7d('0x2f')][_0x8f7d('0x35')]('nolimit')){_0x3c553d[_0x8f7d('0x1d')]=qs[_0x8f7d('0x1d')](_0x1b78bb[_0x8f7d('0x2f')][_0x8f7d('0x1d')]);_0x3c553d['offset']=qs[_0x8f7d('0x1c')](_0x1b78bb['query']['offset']);}return _0x17985e['getDescriptions'](_0x3c553d);}})[_0x8f7d('0x26')](function(_0x3050af){if(_0x3050af){return _0x3050af?{'count':_0x26bb91,'rows':_0x3050af}:null;}})[_0x8f7d('0x26')](respondWithResult(_0x18738c,null))['catch'](handleError(_0x18738c,null));};exports[_0x8f7d('0x4f')]=function(_0x5cca64,_0x1bd784,_0x383d6f){var _0x539de2={};var _0x5df7b0={};var _0x5c1416;var _0x34ec33;return db[_0x8f7d('0x3f')]['findOne']({'where':{'id':_0x5cca64[_0x8f7d('0x47')]['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x1bd784,null))[_0x8f7d('0x26')](function(_0x5688fc){if(_0x5688fc){_0x5c1416=_0x5688fc;_0x5df7b0['model']=_[_0x8f7d('0x30')](db[_0x8f7d('0x50')][_0x8f7d('0x2a')]);_0x5df7b0[_0x8f7d('0x2f')]=_['keys'](_0x5cca64[_0x8f7d('0x2f')]);_0x5df7b0[_0x8f7d('0x31')]=_[_0x8f7d('0x32')](_0x5df7b0[_0x8f7d('0x2d')],_0x5df7b0['query']);_0x539de2[_0x8f7d('0x33')]=_['intersection'](_0x5df7b0['model'],qs[_0x8f7d('0x43')](_0x5cca64[_0x8f7d('0x2f')]['fields']));_0x539de2[_0x8f7d('0x33')]=_0x539de2[_0x8f7d('0x33')][_0x8f7d('0x34')]?_0x539de2[_0x8f7d('0x33')]:_0x5df7b0[_0x8f7d('0x2d')];_0x539de2[_0x8f7d('0x37')]=qs[_0x8f7d('0x38')](_0x5cca64[_0x8f7d('0x2f')][_0x8f7d('0x38')]);_0x539de2['where']=qs['filters'](_[_0x8f7d('0x4c')](_0x5cca64['query'],_0x5df7b0[_0x8f7d('0x31')]));if(_0x5cca64[_0x8f7d('0x2f')]['filter']){_0x539de2[_0x8f7d('0x39')]=_[_0x8f7d('0x3c')](_0x539de2[_0x8f7d('0x39')],{'$or':_[_0x8f7d('0x2e')](_0x539de2[_0x8f7d('0x33')],function(_0x2fae40){var _0xd5dea5={};_0xd5dea5[_0x2fae40]={'$like':'%'+_0x5cca64[_0x8f7d('0x2f')][_0x8f7d('0x3a')]+'%'};return _0xd5dea5;})});}_0x539de2=_[_0x8f7d('0x3c')]({},_0x539de2,_0x5cca64[_0x8f7d('0x3d')]);return _0x5c1416[_0x8f7d('0x4f')](_0x539de2);}})['then'](function(_0x52bacb){if(_0x52bacb){_0x34ec33=_0x52bacb[_0x8f7d('0x34')];if(!_0x5cca64['query'][_0x8f7d('0x35')](_0x8f7d('0x36'))){_0x539de2[_0x8f7d('0x1d')]=qs[_0x8f7d('0x1d')](_0x5cca64[_0x8f7d('0x2f')][_0x8f7d('0x1d')]);_0x539de2[_0x8f7d('0x1c')]=qs['offset'](_0x5cca64['query']['offset']);}return _0x5c1416['getTags'](_0x539de2);}})['then'](function(_0x20c257){if(_0x20c257){return _0x20c257?{'count':_0x34ec33,'rows':_0x20c257}:null;}})[_0x8f7d('0x26')](respondWithResult(_0x1bd784,null))['catch'](handleError(_0x1bd784,null));};exports[_0x8f7d('0x51')]=function(_0xa2de80,_0x3dda8b,_0x5f2f16){if(_0xa2de80['body']['id']){delete _0xa2de80[_0x8f7d('0x46')]['id'];}return db['ZendeskConfiguration'][_0x8f7d('0x4a')]({'where':{'id':_0xa2de80['params']['id']}})[_0x8f7d('0x26')](handleEntityNotFound(_0x3dda8b,null))['then'](function(_0x33a7b3){if(_0x33a7b3){return _0x33a7b3[_0x8f7d('0x51')](_0xa2de80[_0x8f7d('0x46')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3dda8b,null))[_0x8f7d('0x42')](handleError(_0x3dda8b,null));}; \ No newline at end of file +var _0xc68d=['count','includeAll','include','findAll','catch','show','params','options','create','body','find','findOne','order','getFields','getSubjects','getDescriptions','ZendeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2a38dd,_0x3aab0d){var _0x86caea=function(_0xddbd82){while(--_0xddbd82){_0x2a38dd['push'](_0x2a38dd['shift']());}};_0x86caea(++_0x3aab0d);}(_0xc68d,0x6d));var _0xdc68=function(_0x34ea40,_0x709674){_0x34ea40=_0x34ea40-0x0;var _0x482dc5=_0xc68d[_0x34ea40];return _0x482dc5;};'use strict';var emlformat=require(_0xdc68('0x0'));var rimraf=require(_0xdc68('0x1'));var zipdir=require(_0xdc68('0x2'));var jsonpatch=require(_0xdc68('0x3'));var rp=require(_0xdc68('0x4'));var moment=require(_0xdc68('0x5'));var BPromise=require(_0xdc68('0x6'));var Mustache=require(_0xdc68('0x7'));var util=require(_0xdc68('0x8'));var path=require(_0xdc68('0x9'));var sox=require(_0xdc68('0xa'));var csv=require(_0xdc68('0xb'));var ejs=require(_0xdc68('0xc'));var fs=require('fs');var fs_extra=require(_0xdc68('0xd'));var _=require(_0xdc68('0xe'));var squel=require(_0xdc68('0xf'));var crypto=require(_0xdc68('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc68('0xb'));var querystring=require(_0xdc68('0x11'));var Papa=require(_0xdc68('0x12'));var Redis=require(_0xdc68('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc68('0x14'));var hardwareService=require(_0xdc68('0x15'));var logger=require(_0xdc68('0x16'))(_0xdc68('0x17'));var utils=require(_0xdc68('0x18'));var config=require(_0xdc68('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc68('0x1a'))['db'];function respondWithStatusCode(_0x2be51e,_0xa8b17d){_0xa8b17d=_0xa8b17d||0xcc;return function(_0x24fd41){if(_0x24fd41){return _0x2be51e[_0xdc68('0x1b')](_0xa8b17d);}return _0x2be51e[_0xdc68('0x1c')](_0xa8b17d)['end']();};}function respondWithResult(_0x17bb4b,_0x2f06a6){_0x2f06a6=_0x2f06a6||0xc8;return function(_0x4d4ae8){if(_0x4d4ae8){return _0x17bb4b[_0xdc68('0x1c')](_0x2f06a6)[_0xdc68('0x1d')](_0x4d4ae8);}};}function respondWithFilteredResult(_0x5a8cfa,_0x545d24){return function(_0x19343b){if(_0x19343b){var _0x48c978=typeof _0x545d24[_0xdc68('0x1e')]==='undefined'&&typeof _0x545d24['limit']==='undefined';var _0x4ab9d4=_0x19343b['count'];var _0x1261f0=_0x48c978?0x0:_0x545d24[_0xdc68('0x1e')];var _0x4b856a=_0x48c978?_0x19343b['count']:_0x545d24[_0xdc68('0x1e')]+_0x545d24[_0xdc68('0x1f')];var _0x4ef25f;if(_0x4b856a>=_0x4ab9d4){_0x4b856a=_0x4ab9d4;_0x4ef25f=0xc8;}else{_0x4ef25f=0xce;}_0x5a8cfa[_0xdc68('0x1c')](_0x4ef25f);return _0x5a8cfa[_0xdc68('0x20')](_0xdc68('0x21'),_0x1261f0+'-'+_0x4b856a+'/'+_0x4ab9d4)[_0xdc68('0x1d')](_0x19343b);}return null;};}function patchUpdates(_0x5b47ca){return function(_0x4b2dc7){try{jsonpatch[_0xdc68('0x22')](_0x4b2dc7,_0x5b47ca,!![]);}catch(_0x3fcc20){return BPromise[_0xdc68('0x23')](_0x3fcc20);}return _0x4b2dc7[_0xdc68('0x24')]();};}function saveUpdates(_0xef52f0,_0x5541a1){return function(_0x474931){if(_0x474931){return _0x474931[_0xdc68('0x25')](_0xef52f0)[_0xdc68('0x26')](function(_0x19039b){return _0x19039b;});}return null;};}function removeEntity(_0x416629,_0x5e1e69){return function(_0x392ea5){if(_0x392ea5){return _0x392ea5[_0xdc68('0x27')]()[_0xdc68('0x26')](function(){_0x416629[_0xdc68('0x1c')](0xcc)[_0xdc68('0x28')]();});}};}function handleEntityNotFound(_0x287ca8,_0x5ce1ff){return function(_0x274b41){if(!_0x274b41){_0x287ca8[_0xdc68('0x1b')](0x194);}return _0x274b41;};}function handleError(_0x1b66d9,_0x24aed2){_0x24aed2=_0x24aed2||0x1f4;return function(_0x28eb2a){logger[_0xdc68('0x29')](_0x28eb2a[_0xdc68('0x2a')]);if(_0x28eb2a['name']){delete _0x28eb2a[_0xdc68('0x2b')];}_0x1b66d9['status'](_0x24aed2)[_0xdc68('0x2c')](_0x28eb2a);};}exports['index']=function(_0x335f11,_0x4ede5d){var _0x187321={},_0xd8138e={},_0x159ddf={'count':0x0,'rows':[]};var _0x32c016=_[_0xdc68('0x2d')](db[_0xdc68('0x2e')][_0xdc68('0x2f')],function(_0x3da2ae){return{'name':_0x3da2ae[_0xdc68('0x30')],'type':_0x3da2ae[_0xdc68('0x31')][_0xdc68('0x32')]};});_0xd8138e[_0xdc68('0x33')]=_[_0xdc68('0x2d')](_0x32c016,_0xdc68('0x2b'));_0xd8138e[_0xdc68('0x34')]=_[_0xdc68('0x35')](_0x335f11[_0xdc68('0x34')]);_0xd8138e[_0xdc68('0x36')]=_['intersection'](_0xd8138e[_0xdc68('0x33')],_0xd8138e[_0xdc68('0x34')]);_0x187321[_0xdc68('0x37')]=_[_0xdc68('0x38')](_0xd8138e[_0xdc68('0x33')],qs[_0xdc68('0x39')](_0x335f11[_0xdc68('0x34')][_0xdc68('0x39')]));_0x187321[_0xdc68('0x37')]=_0x187321[_0xdc68('0x37')][_0xdc68('0x3a')]?_0x187321[_0xdc68('0x37')]:_0xd8138e[_0xdc68('0x33')];if(!_0x335f11['query'][_0xdc68('0x3b')](_0xdc68('0x3c'))){_0x187321[_0xdc68('0x1f')]=qs['limit'](_0x335f11[_0xdc68('0x34')][_0xdc68('0x1f')]);_0x187321[_0xdc68('0x1e')]=qs['offset'](_0x335f11[_0xdc68('0x34')][_0xdc68('0x1e')]);}_0x187321['order']=qs[_0xdc68('0x3d')](_0x335f11[_0xdc68('0x34')][_0xdc68('0x3d')]);_0x187321[_0xdc68('0x3e')]=qs['filters'](_[_0xdc68('0x3f')](_0x335f11[_0xdc68('0x34')],_0xd8138e[_0xdc68('0x36')]),_0x32c016);if(_0x335f11['query'][_0xdc68('0x40')]){_0x187321[_0xdc68('0x3e')]=_[_0xdc68('0x41')](_0x187321['where'],{'$or':_[_0xdc68('0x2d')](_0x32c016,function(_0x4f4dda){if(_0x4f4dda['type']!==_0xdc68('0x42')){var _0xdc9613={};_0xdc9613[_0x4f4dda[_0xdc68('0x2b')]]={'$like':'%'+_0x335f11['query'][_0xdc68('0x40')]+'%'};return _0xdc9613;}})});}_0x187321=_[_0xdc68('0x41')]({},_0x187321,_0x335f11['options']);var _0x5c72d9={'where':_0x187321['where']};return db[_0xdc68('0x2e')][_0xdc68('0x43')](_0x5c72d9)['then'](function(_0x2acf4f){_0x159ddf['count']=_0x2acf4f;if(_0x335f11[_0xdc68('0x34')][_0xdc68('0x44')]){_0x187321[_0xdc68('0x45')]=[{'all':!![]}];}return db[_0xdc68('0x2e')][_0xdc68('0x46')](_0x187321);})[_0xdc68('0x26')](function(_0x449210){_0x159ddf['rows']=_0x449210;return _0x159ddf;})['then'](respondWithFilteredResult(_0x4ede5d,_0x187321))[_0xdc68('0x47')](handleError(_0x4ede5d,null));};exports[_0xdc68('0x48')]=function(_0x1d6a08,_0x35e1fc){var _0x3d446b={'raw':![],'where':{'id':_0x1d6a08[_0xdc68('0x49')]['id']}},_0x2434dc={};_0x2434dc[_0xdc68('0x33')]=_['keys'](db[_0xdc68('0x2e')]['rawAttributes']);_0x2434dc[_0xdc68('0x34')]=_[_0xdc68('0x35')](_0x1d6a08['query']);_0x2434dc[_0xdc68('0x36')]=_[_0xdc68('0x38')](_0x2434dc[_0xdc68('0x33')],_0x2434dc[_0xdc68('0x34')]);_0x3d446b[_0xdc68('0x37')]=_[_0xdc68('0x38')](_0x2434dc[_0xdc68('0x33')],qs[_0xdc68('0x39')](_0x1d6a08[_0xdc68('0x34')]['fields']));_0x3d446b['attributes']=_0x3d446b[_0xdc68('0x37')]['length']?_0x3d446b['attributes']:_0x2434dc[_0xdc68('0x33')];if(_0x1d6a08[_0xdc68('0x34')]['includeAll']){_0x3d446b[_0xdc68('0x45')]=[{'all':!![]}];}_0x3d446b=_['merge']({},_0x3d446b,_0x1d6a08[_0xdc68('0x4a')]);return db[_0xdc68('0x2e')]['find'](_0x3d446b)['then'](handleEntityNotFound(_0x35e1fc,null))[_0xdc68('0x26')](respondWithResult(_0x35e1fc,null))[_0xdc68('0x47')](handleError(_0x35e1fc,null));};exports[_0xdc68('0x4b')]=function(_0x13b66f,_0x2fcd18){return db[_0xdc68('0x2e')]['create'](_0x13b66f[_0xdc68('0x4c')],{})[_0xdc68('0x26')](respondWithResult(_0x2fcd18,0xc9))[_0xdc68('0x47')](handleError(_0x2fcd18,null));};exports['update']=function(_0x3368a2,_0x5dccf8){if(_0x3368a2[_0xdc68('0x4c')]['id']){delete _0x3368a2[_0xdc68('0x4c')]['id'];}return db[_0xdc68('0x2e')][_0xdc68('0x4d')]({'where':{'id':_0x3368a2[_0xdc68('0x49')]['id']}})[_0xdc68('0x26')](handleEntityNotFound(_0x5dccf8,null))['then'](saveUpdates(_0x3368a2[_0xdc68('0x4c')],null))[_0xdc68('0x26')](respondWithResult(_0x5dccf8,null))[_0xdc68('0x47')](handleError(_0x5dccf8,null));};exports[_0xdc68('0x27')]=function(_0x23ea7e,_0x2c4aa2){return db[_0xdc68('0x2e')][_0xdc68('0x4d')]({'where':{'id':_0x23ea7e[_0xdc68('0x49')]['id']}})[_0xdc68('0x26')](handleEntityNotFound(_0x2c4aa2,null))[_0xdc68('0x26')](removeEntity(_0x2c4aa2,null))['catch'](handleError(_0x2c4aa2,null));};exports['getFields']=function(_0x3f8fbb,_0x1bc85f,_0x1f74ea){var _0x389b5d={};var _0x261789={};var _0x599882;var _0x584a97;return db['ZendeskConfiguration'][_0xdc68('0x4e')]({'where':{'id':_0x3f8fbb[_0xdc68('0x49')]['id']}})['then'](handleEntityNotFound(_0x1bc85f,null))['then'](function(_0xee9b9f){if(_0xee9b9f){_0x599882=_0xee9b9f;_0x261789['model']=_[_0xdc68('0x35')](db['ZendeskField'][_0xdc68('0x2f')]);_0x261789['query']=_[_0xdc68('0x35')](_0x3f8fbb[_0xdc68('0x34')]);_0x261789[_0xdc68('0x36')]=_[_0xdc68('0x38')](_0x261789['model'],_0x261789[_0xdc68('0x34')]);_0x389b5d[_0xdc68('0x37')]=_[_0xdc68('0x38')](_0x261789[_0xdc68('0x33')],qs[_0xdc68('0x39')](_0x3f8fbb['query'][_0xdc68('0x39')]));_0x389b5d['attributes']=_0x389b5d[_0xdc68('0x37')]['length']?_0x389b5d[_0xdc68('0x37')]:_0x261789[_0xdc68('0x33')];_0x389b5d[_0xdc68('0x4f')]=qs[_0xdc68('0x3d')](_0x3f8fbb['query']['sort']);_0x389b5d[_0xdc68('0x3e')]=qs[_0xdc68('0x36')](_[_0xdc68('0x3f')](_0x3f8fbb['query'],_0x261789[_0xdc68('0x36')]));if(_0x3f8fbb[_0xdc68('0x34')][_0xdc68('0x40')]){_0x389b5d[_0xdc68('0x3e')]=_['merge'](_0x389b5d[_0xdc68('0x3e')],{'$or':_[_0xdc68('0x2d')](_0x389b5d[_0xdc68('0x37')],function(_0x4f693b){var _0x5e832a={};_0x5e832a[_0x4f693b]={'$like':'%'+_0x3f8fbb[_0xdc68('0x34')][_0xdc68('0x40')]+'%'};return _0x5e832a;})});}_0x389b5d=_[_0xdc68('0x41')]({},_0x389b5d,_0x3f8fbb['options']);return _0x599882[_0xdc68('0x50')](_0x389b5d);}})['then'](function(_0x1af182){if(_0x1af182){_0x584a97=_0x1af182[_0xdc68('0x3a')];if(!_0x3f8fbb[_0xdc68('0x34')][_0xdc68('0x3b')](_0xdc68('0x3c'))){_0x389b5d[_0xdc68('0x1f')]=qs[_0xdc68('0x1f')](_0x3f8fbb[_0xdc68('0x34')]['limit']);_0x389b5d[_0xdc68('0x1e')]=qs['offset'](_0x3f8fbb[_0xdc68('0x34')]['offset']);}return _0x599882[_0xdc68('0x50')](_0x389b5d);}})[_0xdc68('0x26')](function(_0x382b39){if(_0x382b39){return _0x382b39?{'count':_0x584a97,'rows':_0x382b39}:null;}})['then'](respondWithResult(_0x1bc85f,null))[_0xdc68('0x47')](handleError(_0x1bc85f,null));};exports[_0xdc68('0x51')]=function(_0x39deec,_0x588f6b,_0x117d14){var _0x1d575c={};var _0x4634a7={};var _0x235728;var _0x2d4a24;return db['ZendeskConfiguration'][_0xdc68('0x4e')]({'where':{'id':_0x39deec[_0xdc68('0x49')]['id']}})['then'](handleEntityNotFound(_0x588f6b,null))[_0xdc68('0x26')](function(_0x32b7c3){if(_0x32b7c3){_0x235728=_0x32b7c3;_0x4634a7[_0xdc68('0x33')]=_[_0xdc68('0x35')](db['ZendeskField'][_0xdc68('0x2f')]);_0x4634a7['query']=_[_0xdc68('0x35')](_0x39deec[_0xdc68('0x34')]);_0x4634a7[_0xdc68('0x36')]=_[_0xdc68('0x38')](_0x4634a7[_0xdc68('0x33')],_0x4634a7[_0xdc68('0x34')]);_0x1d575c[_0xdc68('0x37')]=_[_0xdc68('0x38')](_0x4634a7[_0xdc68('0x33')],qs[_0xdc68('0x39')](_0x39deec[_0xdc68('0x34')][_0xdc68('0x39')]));_0x1d575c[_0xdc68('0x37')]=_0x1d575c[_0xdc68('0x37')][_0xdc68('0x3a')]?_0x1d575c[_0xdc68('0x37')]:_0x4634a7[_0xdc68('0x33')];_0x1d575c[_0xdc68('0x4f')]=qs['sort'](_0x39deec[_0xdc68('0x34')][_0xdc68('0x3d')]);_0x1d575c[_0xdc68('0x3e')]=qs['filters'](_[_0xdc68('0x3f')](_0x39deec[_0xdc68('0x34')],_0x4634a7[_0xdc68('0x36')]));if(_0x39deec[_0xdc68('0x34')][_0xdc68('0x40')]){_0x1d575c[_0xdc68('0x3e')]=_[_0xdc68('0x41')](_0x1d575c[_0xdc68('0x3e')],{'$or':_[_0xdc68('0x2d')](_0x1d575c[_0xdc68('0x37')],function(_0x4958d7){var _0x46b3a0={};_0x46b3a0[_0x4958d7]={'$like':'%'+_0x39deec[_0xdc68('0x34')][_0xdc68('0x40')]+'%'};return _0x46b3a0;})});}_0x1d575c=_['merge']({},_0x1d575c,_0x39deec[_0xdc68('0x4a')]);return _0x235728['getSubjects'](_0x1d575c);}})['then'](function(_0x58f74e){if(_0x58f74e){_0x2d4a24=_0x58f74e[_0xdc68('0x3a')];if(!_0x39deec[_0xdc68('0x34')][_0xdc68('0x3b')](_0xdc68('0x3c'))){_0x1d575c['limit']=qs['limit'](_0x39deec[_0xdc68('0x34')]['limit']);_0x1d575c[_0xdc68('0x1e')]=qs['offset'](_0x39deec['query']['offset']);}return _0x235728['getSubjects'](_0x1d575c);}})[_0xdc68('0x26')](function(_0x361824){if(_0x361824){return _0x361824?{'count':_0x2d4a24,'rows':_0x361824}:null;}})[_0xdc68('0x26')](respondWithResult(_0x588f6b,null))[_0xdc68('0x47')](handleError(_0x588f6b,null));};exports[_0xdc68('0x52')]=function(_0x417fb9,_0x184688,_0x3b6457){var _0x19adba={};var _0xe149c8={};var _0xf0bd44;var _0x3420e6;return db[_0xdc68('0x2e')]['findOne']({'where':{'id':_0x417fb9[_0xdc68('0x49')]['id']}})[_0xdc68('0x26')](handleEntityNotFound(_0x184688,null))[_0xdc68('0x26')](function(_0x5e32e7){if(_0x5e32e7){_0xf0bd44=_0x5e32e7;_0xe149c8[_0xdc68('0x33')]=_[_0xdc68('0x35')](db[_0xdc68('0x53')][_0xdc68('0x2f')]);_0xe149c8[_0xdc68('0x34')]=_[_0xdc68('0x35')](_0x417fb9[_0xdc68('0x34')]);_0xe149c8[_0xdc68('0x36')]=_[_0xdc68('0x38')](_0xe149c8['model'],_0xe149c8['query']);_0x19adba[_0xdc68('0x37')]=_[_0xdc68('0x38')](_0xe149c8['model'],qs[_0xdc68('0x39')](_0x417fb9['query'][_0xdc68('0x39')]));_0x19adba[_0xdc68('0x37')]=_0x19adba['attributes']['length']?_0x19adba['attributes']:_0xe149c8['model'];_0x19adba[_0xdc68('0x4f')]=qs['sort'](_0x417fb9[_0xdc68('0x34')][_0xdc68('0x3d')]);_0x19adba[_0xdc68('0x3e')]=qs[_0xdc68('0x36')](_[_0xdc68('0x3f')](_0x417fb9[_0xdc68('0x34')],_0xe149c8[_0xdc68('0x36')]));if(_0x417fb9[_0xdc68('0x34')]['filter']){_0x19adba[_0xdc68('0x3e')]=_[_0xdc68('0x41')](_0x19adba[_0xdc68('0x3e')],{'$or':_['map'](_0x19adba[_0xdc68('0x37')],function(_0x32b0c8){var _0x208e26={};_0x208e26[_0x32b0c8]={'$like':'%'+_0x417fb9[_0xdc68('0x34')][_0xdc68('0x40')]+'%'};return _0x208e26;})});}_0x19adba=_[_0xdc68('0x41')]({},_0x19adba,_0x417fb9[_0xdc68('0x4a')]);return _0xf0bd44['getDescriptions'](_0x19adba);}})['then'](function(_0x36c8f4){if(_0x36c8f4){_0x3420e6=_0x36c8f4[_0xdc68('0x3a')];if(!_0x417fb9[_0xdc68('0x34')][_0xdc68('0x3b')](_0xdc68('0x3c'))){_0x19adba[_0xdc68('0x1f')]=qs[_0xdc68('0x1f')](_0x417fb9[_0xdc68('0x34')][_0xdc68('0x1f')]);_0x19adba[_0xdc68('0x1e')]=qs[_0xdc68('0x1e')](_0x417fb9[_0xdc68('0x34')]['offset']);}return _0xf0bd44[_0xdc68('0x52')](_0x19adba);}})[_0xdc68('0x26')](function(_0x2b4f7d){if(_0x2b4f7d){return _0x2b4f7d?{'count':_0x3420e6,'rows':_0x2b4f7d}:null;}})[_0xdc68('0x26')](respondWithResult(_0x184688,null))[_0xdc68('0x47')](handleError(_0x184688,null));};exports[_0xdc68('0x54')]=function(_0xeebe1a,_0x42c1e6,_0x3f19b8){var _0x81a778={};var _0x3d4ec0={};var _0x546131;var _0x3e31d5;return db[_0xdc68('0x2e')][_0xdc68('0x4e')]({'where':{'id':_0xeebe1a[_0xdc68('0x49')]['id']}})[_0xdc68('0x26')](handleEntityNotFound(_0x42c1e6,null))[_0xdc68('0x26')](function(_0x1dabe6){if(_0x1dabe6){_0x546131=_0x1dabe6;_0x3d4ec0[_0xdc68('0x33')]=_[_0xdc68('0x35')](db[_0xdc68('0x55')][_0xdc68('0x2f')]);_0x3d4ec0[_0xdc68('0x34')]=_[_0xdc68('0x35')](_0xeebe1a[_0xdc68('0x34')]);_0x3d4ec0[_0xdc68('0x36')]=_[_0xdc68('0x38')](_0x3d4ec0[_0xdc68('0x33')],_0x3d4ec0[_0xdc68('0x34')]);_0x81a778['attributes']=_[_0xdc68('0x38')](_0x3d4ec0[_0xdc68('0x33')],qs[_0xdc68('0x39')](_0xeebe1a['query'][_0xdc68('0x39')]));_0x81a778[_0xdc68('0x37')]=_0x81a778['attributes'][_0xdc68('0x3a')]?_0x81a778['attributes']:_0x3d4ec0[_0xdc68('0x33')];_0x81a778['order']=qs[_0xdc68('0x3d')](_0xeebe1a[_0xdc68('0x34')][_0xdc68('0x3d')]);_0x81a778[_0xdc68('0x3e')]=qs[_0xdc68('0x36')](_[_0xdc68('0x3f')](_0xeebe1a[_0xdc68('0x34')],_0x3d4ec0[_0xdc68('0x36')]));if(_0xeebe1a[_0xdc68('0x34')][_0xdc68('0x40')]){_0x81a778[_0xdc68('0x3e')]=_[_0xdc68('0x41')](_0x81a778[_0xdc68('0x3e')],{'$or':_[_0xdc68('0x2d')](_0x81a778[_0xdc68('0x37')],function(_0x25f899){var _0xe1d4f9={};_0xe1d4f9[_0x25f899]={'$like':'%'+_0xeebe1a[_0xdc68('0x34')][_0xdc68('0x40')]+'%'};return _0xe1d4f9;})});}_0x81a778=_[_0xdc68('0x41')]({},_0x81a778,_0xeebe1a[_0xdc68('0x4a')]);return _0x546131[_0xdc68('0x54')](_0x81a778);}})['then'](function(_0x328726){if(_0x328726){_0x3e31d5=_0x328726[_0xdc68('0x3a')];if(!_0xeebe1a[_0xdc68('0x34')][_0xdc68('0x3b')](_0xdc68('0x3c'))){_0x81a778[_0xdc68('0x1f')]=qs['limit'](_0xeebe1a[_0xdc68('0x34')][_0xdc68('0x1f')]);_0x81a778[_0xdc68('0x1e')]=qs[_0xdc68('0x1e')](_0xeebe1a[_0xdc68('0x34')]['offset']);}return _0x546131['getTags'](_0x81a778);}})[_0xdc68('0x26')](function(_0xc3fa16){if(_0xc3fa16){return _0xc3fa16?{'count':_0x3e31d5,'rows':_0xc3fa16}:null;}})[_0xdc68('0x26')](respondWithResult(_0x42c1e6,null))[_0xdc68('0x47')](handleError(_0x42c1e6,null));};exports[_0xdc68('0x56')]=function(_0x1a61e0,_0x4a2b14,_0x241444){if(_0x1a61e0[_0xdc68('0x4c')]['id']){delete _0x1a61e0[_0xdc68('0x4c')]['id'];}return db[_0xdc68('0x2e')][_0xdc68('0x4e')]({'where':{'id':_0x1a61e0[_0xdc68('0x49')]['id']}})[_0xdc68('0x26')](handleEntityNotFound(_0x4a2b14,null))[_0xdc68('0x26')](function(_0x190148){if(_0x190148){return _0x190148[_0xdc68('0x56')](_0x1a61e0[_0xdc68('0x4c')][_0xdc68('0x57')]||[]);}return null;})[_0xdc68('0x26')](respondWithResult(_0x4a2b14,null))[_0xdc68('0x47')](handleError(_0x4a2b14,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1e6e63c..d16853c 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 _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x2e473d,_0x29c52a){var _0x4bfbf8=function(_0xd593f1){while(--_0xd593f1){_0x2e473d['push'](_0x2e473d['shift']());}};_0x4bfbf8(++_0x29c52a);}(_0x80ed,0x11c));var _0xd80e=function(_0x4140b4,_0x29cb37){_0x4140b4=_0x4140b4-0x0;var _0x446290=_0x80ed[_0x4140b4];return _0x446290;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0abf=['define','int_zendesk_configurations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x3446a2,_0x75daec){var _0xb594fa=function(_0x57c4a0){while(--_0x57c4a0){_0x3446a2['push'](_0x3446a2['shift']());}};_0xb594fa(++_0x75daec);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x2ab7d6,_0x4d2ea8){return _0x2ab7d6[_0xf0ab('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0xf0ab('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 9d1752b..02575d1 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 _0x6f62=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3e7370,_0x594870){var _0x3100fe=function(_0x29f7cc){while(--_0x29f7cc){_0x3e7370['push'](_0x3e7370['shift']());}};_0x3100fe(++_0x594870);}(_0x6f62,0x151));var _0x26f6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6f62[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x26f6('0x0'));var util=require('util');var moment=require(_0x26f6('0x1'));var BPromise=require(_0x26f6('0x2'));var rs=require(_0x26f6('0x3'));var fs=require('fs');var Redis=require(_0x26f6('0x4'));var db=require(_0x26f6('0x5'))['db'];var utils=require(_0x26f6('0x6'));var logger=require('../../config/logger')(_0x26f6('0x7'));var config=require(_0x26f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x26f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a6abd,_0x543fb0,_0x18a943){return new BPromise(function(_0x49b32a,_0x45ae03){return client[_0x26f6('0xa')](_0x3a6abd,_0x18a943)[_0x26f6('0xb')](function(_0x1ff481){logger['info'](_0x26f6('0xc'),_0x543fb0,'request\x20sent');logger[_0x26f6('0xd')](_0x26f6('0xe'),_0x543fb0,_0x26f6('0xf'),JSON[_0x26f6('0x10')](_0x1ff481));if(_0x1ff481[_0x26f6('0x11')]){if(_0x1ff481[_0x26f6('0x11')][_0x26f6('0x12')]===0x1f4){logger[_0x26f6('0x11')](_0x26f6('0xc'),_0x543fb0,_0x1ff481[_0x26f6('0x11')]['message']);return _0x45ae03(_0x1ff481['error'][_0x26f6('0x13')]);}logger[_0x26f6('0x11')](_0x26f6('0xc'),_0x543fb0,_0x1ff481[_0x26f6('0x11')][_0x26f6('0x13')]);return _0x49b32a(_0x1ff481[_0x26f6('0x11')][_0x26f6('0x13')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x543fb0,_0x26f6('0xf'));_0x49b32a(_0x1ff481[_0x26f6('0x14')][_0x26f6('0x13')]);}})[_0x26f6('0x15')](function(_0x233288){logger[_0x26f6('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x543fb0,_0x233288);_0x45ae03(_0x233288);});});} \ No newline at end of file +var _0x9380=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment'];(function(_0x3473ec,_0x2170f3){var _0x59bac8=function(_0x369e48){while(--_0x369e48){_0x3473ec['push'](_0x3473ec['shift']());}};_0x59bac8(++_0x2170f3);}(_0x9380,0x156));var _0x0938=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9380[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0938('0x0'));var util=require(_0x0938('0x1'));var moment=require(_0x0938('0x2'));var BPromise=require('bluebird');var rs=require(_0x0938('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0938('0x4'))['db'];var utils=require(_0x0938('0x5'));var logger=require(_0x0938('0x6'))(_0x0938('0x7'));var config=require(_0x0938('0x8'));var jayson=require(_0x0938('0x9'));var client=jayson[_0x0938('0xa')][_0x0938('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x229e84,_0x203e66,_0x3c76d4){return new BPromise(function(_0x5c799a,_0x22bed1){return client[_0x0938('0xc')](_0x229e84,_0x3c76d4)[_0x0938('0xd')](function(_0x26f827){logger[_0x0938('0xe')](_0x0938('0xf'),_0x203e66,'request\x20sent');logger[_0x0938('0x10')](_0x0938('0x11'),_0x203e66,_0x0938('0x12'),JSON['stringify'](_0x26f827));if(_0x26f827['error']){if(_0x26f827[_0x0938('0x13')][_0x0938('0x14')]===0x1f4){logger['error'](_0x0938('0xf'),_0x203e66,_0x26f827['error'][_0x0938('0x15')]);return _0x22bed1(_0x26f827[_0x0938('0x13')][_0x0938('0x15')]);}logger[_0x0938('0x13')](_0x0938('0xf'),_0x203e66,_0x26f827[_0x0938('0x13')][_0x0938('0x15')]);return _0x5c799a(_0x26f827[_0x0938('0x13')]['message']);}else{logger[_0x0938('0xe')](_0x0938('0xf'),_0x203e66,_0x0938('0x12'));_0x5c799a(_0x26f827[_0x0938('0x16')][_0x0938('0x15')]);}})['catch'](function(_0x4c8ce1){logger['error'](_0x0938('0xf'),_0x203e66,_0x4c8ce1);_0x22bed1(_0x4c8ce1);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index de431ce..fc69ddd 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 _0x43ba=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0xe7978a,_0x20a403){var _0x1f45e4=function(_0x2eeb3e){while(--_0x2eeb3e){_0xe7978a['push'](_0xe7978a['shift']());}};_0x1f45e4(++_0x20a403);}(_0x43ba,0xb1));var _0xa43b=function(_0x477a19,_0x54832e){_0x477a19=_0x477a19-0x0;var _0x80e965=_0x43ba[_0x477a19];return _0x80e965;};'use strict';var multer=require(_0xa43b('0x0'));var util=require(_0xa43b('0x1'));var path=require(_0xa43b('0x2'));var timeout=require(_0xa43b('0x3'));var express=require(_0xa43b('0x4'));var router=express['Router']();var fs_extra=require(_0xa43b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa43b('0x6'));var config=require(_0xa43b('0x7'));var controller=require(_0xa43b('0x8'));router[_0xa43b('0x9')]('/',auth[_0xa43b('0xa')](),controller[_0xa43b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa43b('0xc')]);router[_0xa43b('0xd')]('/',auth['isAuthenticated'](),controller[_0xa43b('0xe')]);router[_0xa43b('0xf')](_0xa43b('0x10'),auth[_0xa43b('0xa')](),controller[_0xa43b('0x11')]);router[_0xa43b('0x12')](_0xa43b('0x10'),auth['isAuthenticated'](),controller[_0xa43b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3b08=['post','put','update','delete','/:id','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x521ed8,_0x4db93e){var _0x2c4f92=function(_0x4539b1){while(--_0x4539b1){_0x521ed8['push'](_0x521ed8['shift']());}};_0x2c4f92(++_0x4db93e);}(_0x3b08,0xba));var _0x83b0=function(_0x249389,_0x2c8049){_0x249389=_0x249389-0x0;var _0x323dbf=_0x3b08[_0x249389];return _0x323dbf;};'use strict';var multer=require('multer');var util=require(_0x83b0('0x0'));var path=require(_0x83b0('0x1'));var timeout=require(_0x83b0('0x2'));var express=require('express');var router=express[_0x83b0('0x3')]();var fs_extra=require(_0x83b0('0x4'));var auth=require(_0x83b0('0x5'));var interaction=require(_0x83b0('0x6'));var config=require(_0x83b0('0x7'));var controller=require(_0x83b0('0x8'));router[_0x83b0('0x9')]('/',auth[_0x83b0('0xa')](),controller[_0x83b0('0xb')]);router[_0x83b0('0x9')]('/:id',auth[_0x83b0('0xa')](),controller['show']);router[_0x83b0('0xc')]('/',auth[_0x83b0('0xa')](),controller['create']);router[_0x83b0('0xd')]('/:id',auth[_0x83b0('0xa')](),controller[_0x83b0('0xe')]);router[_0x83b0('0xf')](_0x83b0('0x10'),auth[_0x83b0('0xa')](),controller[_0x83b0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index bc12ecd..d4afea6 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 _0x6476=['string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x192360,_0x2f0b91){var _0x24609d=function(_0x1270d8){while(--_0x1270d8){_0x192360['push'](_0x192360['shift']());}};_0x24609d(++_0x2f0b91);}(_0x6476,0x170));var _0x6647=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x6476[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x6647('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6647('0x1'),'variable',_0x6647('0x2'),_0x6647('0x3'),_0x6647('0x4')),'defaultValue':_0x6647('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6647('0x5')]},'keyType':{'type':Sequelize[_0x6647('0x6')](_0x6647('0x1'),_0x6647('0x7'),_0x6647('0x2'))},'keyContent':{'type':Sequelize[_0x6647('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6647('0x5')]},'customField':{'type':Sequelize[_0x6647('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6647('0x5')]}}; \ No newline at end of file +var _0x292d=['string','keyValue','picklist','STRING','ENUM','variable','customVariable','sequelize','exports'];(function(_0x5880ac,_0x86e30c){var _0x2bb201=function(_0x2703b7){while(--_0x2703b7){_0x5880ac['push'](_0x5880ac['shift']());}};_0x2bb201(++_0x86e30c);}(_0x292d,0x178));var _0xd292=function(_0x1bc445,_0x2d6fe0){_0x1bc445=_0x1bc445-0x0;var _0x589e6b=_0x292d[_0x1bc445];return _0x589e6b;};'use strict';var Sequelize=require(_0xd292('0x0'));module[_0xd292('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd292('0x2'),'variable','customVariable',_0xd292('0x3'),_0xd292('0x4')),'defaultValue':_0xd292('0x2')},'content':{'type':Sequelize[_0xd292('0x5')]},'key':{'type':Sequelize[_0xd292('0x5')]},'keyType':{'type':Sequelize[_0xd292('0x6')](_0xd292('0x2'),_0xd292('0x7'),_0xd292('0x8'))},'keyContent':{'type':Sequelize[_0xd292('0x5')]},'idField':{'type':Sequelize[_0xd292('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd292('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 93e3980..83e420d 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 _0x86f5=['where','pick','filter','type','merge','options','ZendeskField','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x392b89,_0x296a38){var _0x37becc=function(_0x39a861){while(--_0x39a861){_0x392b89['push'](_0x392b89['shift']());}};_0x37becc(++_0x296a38);}(_0x86f5,0x178));var _0x586f=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x86f5[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x586f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x586f('0x1'));var jsonpatch=require(_0x586f('0x2'));var rp=require('request-promise');var moment=require(_0x586f('0x3'));var BPromise=require(_0x586f('0x4'));var Mustache=require(_0x586f('0x5'));var util=require(_0x586f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x586f('0x7'));var ejs=require(_0x586f('0x8'));var fs=require('fs');var fs_extra=require(_0x586f('0x9'));var _=require('lodash');var squel=require(_0x586f('0xa'));var crypto=require(_0x586f('0xb'));var jsforce=require(_0x586f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x586f('0xd'));var Papa=require(_0x586f('0xe'));var Redis=require(_0x586f('0xf'));var authService=require(_0x586f('0x10'));var qs=require(_0x586f('0x11'));var as=require(_0x586f('0x12'));var hardwareService=require(_0x586f('0x13'));var logger=require('../../config/logger')(_0x586f('0x14'));var utils=require('../../config/utils');var config=require(_0x586f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x586f('0x16'))['db'];function respondWithStatusCode(_0x5a0c86,_0xf6b7f9){_0xf6b7f9=_0xf6b7f9||0xcc;return function(_0x560019){if(_0x560019){return _0x5a0c86[_0x586f('0x17')](_0xf6b7f9);}return _0x5a0c86[_0x586f('0x18')](_0xf6b7f9)[_0x586f('0x19')]();};}function respondWithResult(_0x3fc15c,_0x1056cf){_0x1056cf=_0x1056cf||0xc8;return function(_0x23d237){if(_0x23d237){return _0x3fc15c['status'](_0x1056cf)[_0x586f('0x1a')](_0x23d237);}};}function respondWithFilteredResult(_0x4da2fa,_0x5d838c){return function(_0x3381c6){if(_0x3381c6){var _0x24d0ca=typeof _0x5d838c[_0x586f('0x1b')]===_0x586f('0x1c')&&typeof _0x5d838c[_0x586f('0x1d')]===_0x586f('0x1c');var _0x5ef362=_0x3381c6['count'];var _0x44f938=_0x24d0ca?0x0:_0x5d838c[_0x586f('0x1b')];var _0x287faf=_0x24d0ca?_0x3381c6[_0x586f('0x1e')]:_0x5d838c[_0x586f('0x1b')]+_0x5d838c[_0x586f('0x1d')];var _0x276f07;if(_0x287faf>=_0x5ef362){_0x287faf=_0x5ef362;_0x276f07=0xc8;}else{_0x276f07=0xce;}_0x4da2fa[_0x586f('0x18')](_0x276f07);return _0x4da2fa[_0x586f('0x1f')](_0x586f('0x20'),_0x44f938+'-'+_0x287faf+'/'+_0x5ef362)[_0x586f('0x1a')](_0x3381c6);}return null;};}function patchUpdates(_0x38fda7){return function(_0x2c9e43){try{jsonpatch['apply'](_0x2c9e43,_0x38fda7,!![]);}catch(_0x3e36fb){return BPromise[_0x586f('0x21')](_0x3e36fb);}return _0x2c9e43[_0x586f('0x22')]();};}function saveUpdates(_0x32b709,_0x4a7c6a){return function(_0xbd3f34){if(_0xbd3f34){return _0xbd3f34[_0x586f('0x23')](_0x32b709)[_0x586f('0x24')](function(_0x2457b3){return _0x2457b3;});}return null;};}function removeEntity(_0x2d226e,_0x4c1b9c){return function(_0x45e18e){if(_0x45e18e){return _0x45e18e[_0x586f('0x25')]()[_0x586f('0x24')](function(){_0x2d226e[_0x586f('0x18')](0xcc)[_0x586f('0x19')]();});}};}function handleEntityNotFound(_0x2683d7,_0x5cb2ba){return function(_0x1743f2){if(!_0x1743f2){_0x2683d7[_0x586f('0x17')](0x194);}return _0x1743f2;};}function handleError(_0x3e8b53,_0xcee521){_0xcee521=_0xcee521||0x1f4;return function(_0x5536ce){logger[_0x586f('0x26')](_0x5536ce['stack']);if(_0x5536ce[_0x586f('0x27')]){delete _0x5536ce[_0x586f('0x27')];}_0x3e8b53[_0x586f('0x18')](_0xcee521)[_0x586f('0x28')](_0x5536ce);};}exports[_0x586f('0x29')]=function(_0x410d51,_0x2ba6f1){var _0x4d1cfe={},_0x44e83f={},_0x550277={'count':0x0,'rows':[]};var _0x3d6bb2=_['map'](db['ZendeskField'][_0x586f('0x2a')],function(_0x2a2f9f){return{'name':_0x2a2f9f['fieldName'],'type':_0x2a2f9f['type'][_0x586f('0x2b')]};});_0x44e83f[_0x586f('0x2c')]=_['map'](_0x3d6bb2,_0x586f('0x27'));_0x44e83f[_0x586f('0x2d')]=_[_0x586f('0x2e')](_0x410d51[_0x586f('0x2d')]);_0x44e83f[_0x586f('0x2f')]=_[_0x586f('0x30')](_0x44e83f['model'],_0x44e83f[_0x586f('0x2d')]);_0x4d1cfe['attributes']=_[_0x586f('0x30')](_0x44e83f[_0x586f('0x2c')],qs[_0x586f('0x31')](_0x410d51[_0x586f('0x2d')][_0x586f('0x31')]));_0x4d1cfe[_0x586f('0x32')]=_0x4d1cfe[_0x586f('0x32')][_0x586f('0x33')]?_0x4d1cfe['attributes']:_0x44e83f[_0x586f('0x2c')];if(!_0x410d51[_0x586f('0x2d')][_0x586f('0x34')](_0x586f('0x35'))){_0x4d1cfe[_0x586f('0x1d')]=qs['limit'](_0x410d51[_0x586f('0x2d')]['limit']);_0x4d1cfe[_0x586f('0x1b')]=qs['offset'](_0x410d51[_0x586f('0x2d')][_0x586f('0x1b')]);}_0x4d1cfe[_0x586f('0x36')]=qs[_0x586f('0x37')](_0x410d51[_0x586f('0x2d')][_0x586f('0x37')]);_0x4d1cfe[_0x586f('0x38')]=qs[_0x586f('0x2f')](_[_0x586f('0x39')](_0x410d51[_0x586f('0x2d')],_0x44e83f['filters']),_0x3d6bb2);if(_0x410d51[_0x586f('0x2d')][_0x586f('0x3a')]){_0x4d1cfe['where']=_['merge'](_0x4d1cfe[_0x586f('0x38')],{'$or':_['map'](_0x3d6bb2,function(_0x47afad){if(_0x47afad[_0x586f('0x3b')]!=='VIRTUAL'){var _0x346a56={};_0x346a56[_0x47afad[_0x586f('0x27')]]={'$like':'%'+_0x410d51[_0x586f('0x2d')][_0x586f('0x3a')]+'%'};return _0x346a56;}})});}_0x4d1cfe=_[_0x586f('0x3c')]({},_0x4d1cfe,_0x410d51[_0x586f('0x3d')]);var _0x5269e7={'where':_0x4d1cfe[_0x586f('0x38')]};return db[_0x586f('0x3e')]['count'](_0x5269e7)[_0x586f('0x24')](function(_0x47c881){_0x550277[_0x586f('0x1e')]=_0x47c881;if(_0x410d51[_0x586f('0x2d')][_0x586f('0x3f')]){_0x4d1cfe[_0x586f('0x40')]=[{'all':!![]}];}return db[_0x586f('0x3e')][_0x586f('0x41')](_0x4d1cfe);})[_0x586f('0x24')](function(_0x1ece6d){_0x550277[_0x586f('0x42')]=_0x1ece6d;return _0x550277;})[_0x586f('0x24')](respondWithFilteredResult(_0x2ba6f1,_0x4d1cfe))['catch'](handleError(_0x2ba6f1,null));};exports['show']=function(_0x2e9b2d,_0x4ac7fc){var _0x5ef3f6={'raw':!![],'where':{'id':_0x2e9b2d[_0x586f('0x43')]['id']}},_0x5729cb={};_0x5729cb[_0x586f('0x2c')]=_[_0x586f('0x2e')](db[_0x586f('0x3e')][_0x586f('0x2a')]);_0x5729cb[_0x586f('0x2d')]=_['keys'](_0x2e9b2d[_0x586f('0x2d')]);_0x5729cb[_0x586f('0x2f')]=_[_0x586f('0x30')](_0x5729cb[_0x586f('0x2c')],_0x5729cb['query']);_0x5ef3f6[_0x586f('0x32')]=_[_0x586f('0x30')](_0x5729cb['model'],qs[_0x586f('0x31')](_0x2e9b2d[_0x586f('0x2d')]['fields']));_0x5ef3f6[_0x586f('0x32')]=_0x5ef3f6[_0x586f('0x32')][_0x586f('0x33')]?_0x5ef3f6[_0x586f('0x32')]:_0x5729cb[_0x586f('0x2c')];if(_0x2e9b2d['query'][_0x586f('0x3f')]){_0x5ef3f6['include']=[{'all':!![]}];}_0x5ef3f6=_[_0x586f('0x3c')]({},_0x5ef3f6,_0x2e9b2d[_0x586f('0x3d')]);return db[_0x586f('0x3e')]['find'](_0x5ef3f6)[_0x586f('0x24')](handleEntityNotFound(_0x4ac7fc,null))[_0x586f('0x24')](respondWithResult(_0x4ac7fc,null))[_0x586f('0x44')](handleError(_0x4ac7fc,null));};exports[_0x586f('0x45')]=function(_0x487d20,_0x470e74){return db['ZendeskField'][_0x586f('0x45')](_0x487d20[_0x586f('0x46')],{})[_0x586f('0x24')](respondWithResult(_0x470e74,0xc9))[_0x586f('0x44')](handleError(_0x470e74,null));};exports['update']=function(_0x1207e9,_0x1da394){if(_0x1207e9[_0x586f('0x46')]['id']){delete _0x1207e9[_0x586f('0x46')]['id'];}return db[_0x586f('0x3e')][_0x586f('0x47')]({'where':{'id':_0x1207e9['params']['id']}})[_0x586f('0x24')](handleEntityNotFound(_0x1da394,null))['then'](saveUpdates(_0x1207e9[_0x586f('0x46')],null))[_0x586f('0x24')](respondWithResult(_0x1da394,null))[_0x586f('0x44')](handleError(_0x1da394,null));};exports[_0x586f('0x25')]=function(_0x2df877,_0xef5a6a){return db[_0x586f('0x3e')][_0x586f('0x47')]({'where':{'id':_0x2df877[_0x586f('0x43')]['id']}})[_0x586f('0x24')](handleEntityNotFound(_0xef5a6a,null))[_0x586f('0x24')](removeEntity(_0xef5a6a,null))[_0x586f('0x44')](handleError(_0xef5a6a,null));}; \ No newline at end of file +var _0x92ba=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','name','send','index','ZendeskField','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge'];(function(_0x4f8d92,_0x5e846b){var _0xcbdb79=function(_0x3d5954){while(--_0x3d5954){_0x4f8d92['push'](_0x4f8d92['shift']());}};_0xcbdb79(++_0x5e846b);}(_0x92ba,0x17c));var _0xa92b=function(_0x1e5a76,_0x5351e5){_0x1e5a76=_0x1e5a76-0x0;var _0x22e8fc=_0x92ba[_0x1e5a76];return _0x22e8fc;};'use strict';var emlformat=require(_0xa92b('0x0'));var rimraf=require(_0xa92b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa92b('0x2'));var rp=require(_0xa92b('0x3'));var moment=require(_0xa92b('0x4'));var BPromise=require(_0xa92b('0x5'));var Mustache=require(_0xa92b('0x6'));var util=require('util');var path=require(_0xa92b('0x7'));var sox=require(_0xa92b('0x8'));var csv=require(_0xa92b('0x9'));var ejs=require(_0xa92b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa92b('0xb'));var squel=require(_0xa92b('0xc'));var crypto=require('crypto');var jsforce=require(_0xa92b('0xd'));var deskjs=require(_0xa92b('0xe'));var toCsv=require(_0xa92b('0x9'));var querystring=require(_0xa92b('0xf'));var Papa=require(_0xa92b('0x10'));var Redis=require(_0xa92b('0x11'));var authService=require(_0xa92b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa92b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa92b('0x14'));var licenseUtil=require(_0xa92b('0x15'));var db=require(_0xa92b('0x16'))['db'];function respondWithStatusCode(_0x370c0e,_0xe0fa43){_0xe0fa43=_0xe0fa43||0xcc;return function(_0x49c163){if(_0x49c163){return _0x370c0e[_0xa92b('0x17')](_0xe0fa43);}return _0x370c0e[_0xa92b('0x18')](_0xe0fa43)[_0xa92b('0x19')]();};}function respondWithResult(_0x51c833,_0x229ba9){_0x229ba9=_0x229ba9||0xc8;return function(_0x443323){if(_0x443323){return _0x51c833[_0xa92b('0x18')](_0x229ba9)[_0xa92b('0x1a')](_0x443323);}};}function respondWithFilteredResult(_0x1b297d,_0x192b70){return function(_0x354088){if(_0x354088){var _0x408ed2=typeof _0x192b70[_0xa92b('0x1b')]===_0xa92b('0x1c')&&typeof _0x192b70['limit']===_0xa92b('0x1c');var _0x1a5ff6=_0x354088[_0xa92b('0x1d')];var _0x1c26f1=_0x408ed2?0x0:_0x192b70[_0xa92b('0x1b')];var _0x44512a=_0x408ed2?_0x354088['count']:_0x192b70[_0xa92b('0x1b')]+_0x192b70['limit'];var _0x44df31;if(_0x44512a>=_0x1a5ff6){_0x44512a=_0x1a5ff6;_0x44df31=0xc8;}else{_0x44df31=0xce;}_0x1b297d[_0xa92b('0x18')](_0x44df31);return _0x1b297d[_0xa92b('0x1e')](_0xa92b('0x1f'),_0x1c26f1+'-'+_0x44512a+'/'+_0x1a5ff6)[_0xa92b('0x1a')](_0x354088);}return null;};}function patchUpdates(_0x2e2e71){return function(_0x572ee5){try{jsonpatch[_0xa92b('0x20')](_0x572ee5,_0x2e2e71,!![]);}catch(_0x42eb92){return BPromise[_0xa92b('0x21')](_0x42eb92);}return _0x572ee5['save']();};}function saveUpdates(_0x31cb2,_0x546084){return function(_0xdb21cb){if(_0xdb21cb){return _0xdb21cb[_0xa92b('0x22')](_0x31cb2)[_0xa92b('0x23')](function(_0x5517c4){return _0x5517c4;});}return null;};}function removeEntity(_0x75fb18,_0x4c22bc){return function(_0x48c462){if(_0x48c462){return _0x48c462['destroy']()['then'](function(){_0x75fb18[_0xa92b('0x18')](0xcc)[_0xa92b('0x19')]();});}};}function handleEntityNotFound(_0x568422,_0x422c3a){return function(_0x546d5d){if(!_0x546d5d){_0x568422['sendStatus'](0x194);}return _0x546d5d;};}function handleError(_0x146e24,_0x3a90ea){_0x3a90ea=_0x3a90ea||0x1f4;return function(_0x12d631){logger['error'](_0x12d631['stack']);if(_0x12d631[_0xa92b('0x24')]){delete _0x12d631['name'];}_0x146e24[_0xa92b('0x18')](_0x3a90ea)[_0xa92b('0x25')](_0x12d631);};}exports[_0xa92b('0x26')]=function(_0x5bd1e3,_0x59c24f){var _0x26e579={},_0x14d2f4={},_0x4ae13a={'count':0x0,'rows':[]};var _0x49b70e=_['map'](db[_0xa92b('0x27')]['rawAttributes'],function(_0x98fdb1){return{'name':_0x98fdb1['fieldName'],'type':_0x98fdb1['type'][_0xa92b('0x28')]};});_0x14d2f4[_0xa92b('0x29')]=_[_0xa92b('0x2a')](_0x49b70e,_0xa92b('0x24'));_0x14d2f4[_0xa92b('0x2b')]=_[_0xa92b('0x2c')](_0x5bd1e3[_0xa92b('0x2b')]);_0x14d2f4[_0xa92b('0x2d')]=_[_0xa92b('0x2e')](_0x14d2f4[_0xa92b('0x29')],_0x14d2f4[_0xa92b('0x2b')]);_0x26e579[_0xa92b('0x2f')]=_[_0xa92b('0x2e')](_0x14d2f4['model'],qs[_0xa92b('0x30')](_0x5bd1e3['query'][_0xa92b('0x30')]));_0x26e579[_0xa92b('0x2f')]=_0x26e579[_0xa92b('0x2f')][_0xa92b('0x31')]?_0x26e579[_0xa92b('0x2f')]:_0x14d2f4[_0xa92b('0x29')];if(!_0x5bd1e3['query'][_0xa92b('0x32')](_0xa92b('0x33'))){_0x26e579[_0xa92b('0x34')]=qs['limit'](_0x5bd1e3[_0xa92b('0x2b')]['limit']);_0x26e579[_0xa92b('0x1b')]=qs[_0xa92b('0x1b')](_0x5bd1e3[_0xa92b('0x2b')][_0xa92b('0x1b')]);}_0x26e579['order']=qs[_0xa92b('0x35')](_0x5bd1e3['query'][_0xa92b('0x35')]);_0x26e579[_0xa92b('0x36')]=qs[_0xa92b('0x2d')](_[_0xa92b('0x37')](_0x5bd1e3[_0xa92b('0x2b')],_0x14d2f4[_0xa92b('0x2d')]),_0x49b70e);if(_0x5bd1e3[_0xa92b('0x2b')][_0xa92b('0x38')]){_0x26e579['where']=_[_0xa92b('0x39')](_0x26e579['where'],{'$or':_[_0xa92b('0x2a')](_0x49b70e,function(_0x129031){if(_0x129031[_0xa92b('0x3a')]!==_0xa92b('0x3b')){var _0x8f47aa={};_0x8f47aa[_0x129031[_0xa92b('0x24')]]={'$like':'%'+_0x5bd1e3[_0xa92b('0x2b')]['filter']+'%'};return _0x8f47aa;}})});}_0x26e579=_[_0xa92b('0x39')]({},_0x26e579,_0x5bd1e3[_0xa92b('0x3c')]);var _0x54d31a={'where':_0x26e579[_0xa92b('0x36')]};return db[_0xa92b('0x27')][_0xa92b('0x1d')](_0x54d31a)[_0xa92b('0x23')](function(_0x145036){_0x4ae13a[_0xa92b('0x1d')]=_0x145036;if(_0x5bd1e3[_0xa92b('0x2b')][_0xa92b('0x3d')]){_0x26e579[_0xa92b('0x3e')]=[{'all':!![]}];}return db[_0xa92b('0x27')][_0xa92b('0x3f')](_0x26e579);})[_0xa92b('0x23')](function(_0x137b12){_0x4ae13a[_0xa92b('0x40')]=_0x137b12;return _0x4ae13a;})[_0xa92b('0x23')](respondWithFilteredResult(_0x59c24f,_0x26e579))[_0xa92b('0x41')](handleError(_0x59c24f,null));};exports[_0xa92b('0x42')]=function(_0x4864c3,_0x545201){var _0x35b7b9={'raw':!![],'where':{'id':_0x4864c3[_0xa92b('0x43')]['id']}},_0xc710d8={};_0xc710d8[_0xa92b('0x29')]=_['keys'](db['ZendeskField'][_0xa92b('0x44')]);_0xc710d8[_0xa92b('0x2b')]=_['keys'](_0x4864c3[_0xa92b('0x2b')]);_0xc710d8['filters']=_[_0xa92b('0x2e')](_0xc710d8[_0xa92b('0x29')],_0xc710d8['query']);_0x35b7b9['attributes']=_['intersection'](_0xc710d8[_0xa92b('0x29')],qs[_0xa92b('0x30')](_0x4864c3[_0xa92b('0x2b')][_0xa92b('0x30')]));_0x35b7b9[_0xa92b('0x2f')]=_0x35b7b9[_0xa92b('0x2f')][_0xa92b('0x31')]?_0x35b7b9[_0xa92b('0x2f')]:_0xc710d8[_0xa92b('0x29')];if(_0x4864c3[_0xa92b('0x2b')][_0xa92b('0x3d')]){_0x35b7b9['include']=[{'all':!![]}];}_0x35b7b9=_[_0xa92b('0x39')]({},_0x35b7b9,_0x4864c3[_0xa92b('0x3c')]);return db[_0xa92b('0x27')][_0xa92b('0x45')](_0x35b7b9)[_0xa92b('0x23')](handleEntityNotFound(_0x545201,null))[_0xa92b('0x23')](respondWithResult(_0x545201,null))[_0xa92b('0x41')](handleError(_0x545201,null));};exports[_0xa92b('0x46')]=function(_0x5059a8,_0x39427a){return db['ZendeskField'][_0xa92b('0x46')](_0x5059a8[_0xa92b('0x47')],{})[_0xa92b('0x23')](respondWithResult(_0x39427a,0xc9))[_0xa92b('0x41')](handleError(_0x39427a,null));};exports['update']=function(_0x2ff38b,_0x99513a){if(_0x2ff38b[_0xa92b('0x47')]['id']){delete _0x2ff38b[_0xa92b('0x47')]['id'];}return db['ZendeskField'][_0xa92b('0x45')]({'where':{'id':_0x2ff38b['params']['id']}})[_0xa92b('0x23')](handleEntityNotFound(_0x99513a,null))['then'](saveUpdates(_0x2ff38b[_0xa92b('0x47')],null))[_0xa92b('0x23')](respondWithResult(_0x99513a,null))['catch'](handleError(_0x99513a,null));};exports[_0xa92b('0x48')]=function(_0x2629f6,_0xf3e72b){return db[_0xa92b('0x27')][_0xa92b('0x45')]({'where':{'id':_0x2629f6[_0xa92b('0x43')]['id']}})[_0xa92b('0x23')](handleEntityNotFound(_0xf3e72b,null))['then'](removeEntity(_0xf3e72b,null))['catch'](handleError(_0xf3e72b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 541f791..b2e8b5d 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 _0x2738=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x2738,0x172));var _0x8273=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2738[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x8273('0x0'));var util=require(_0x8273('0x1'));var logger=require(_0x8273('0x2'))('api');var moment=require(_0x8273('0x3'));var BPromise=require(_0x8273('0x4'));var rp=require(_0x8273('0x5'));var fs=require('fs');var path=require(_0x8273('0x6'));var rimraf=require('rimraf');var config=require(_0x8273('0x7'));var attributes=require(_0x8273('0x8'));module[_0x8273('0x9')]=function(_0x10c19e,_0x4ad29e){return _0x10c19e[_0x8273('0xa')](_0x8273('0xb'),attributes,{'tableName':_0x8273('0xc'),'paranoid':![],'indexes':[{'name':_0x8273('0xd'),'fields':[_0x8273('0xe'),_0x8273('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bc3=['define','ZendeskField','int_zendesk_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x607d9e,_0x59c257){var _0x114e00=function(_0x23f293){while(--_0x23f293){_0x607d9e['push'](_0x607d9e['shift']());}};_0x114e00(++_0x59c257);}(_0x6bc3,0x11c));var _0x36bc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6bc3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x36bc('0x0'));var util=require(_0x36bc('0x1'));var logger=require(_0x36bc('0x2'))(_0x36bc('0x3'));var moment=require('moment');var BPromise=require(_0x36bc('0x4'));var rp=require(_0x36bc('0x5'));var fs=require('fs');var path=require(_0x36bc('0x6'));var rimraf=require(_0x36bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x36bc('0x8'));module[_0x36bc('0x9')]=function(_0x3683fd,_0x55f453){return _0x3683fd[_0x36bc('0xa')](_0x36bc('0xb'),attributes,{'tableName':_0x36bc('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x36bc('0xd')],'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 1360b0f..d08d1c9 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 _0x38fb=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a3ee3,_0x304512){var _0x56d16d=function(_0x280251){while(--_0x280251){_0x4a3ee3['push'](_0x4a3ee3['shift']());}};_0x56d16d(++_0x304512);}(_0x38fb,0xa2));var _0xb38f=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x38fb[_0x2055a7];return _0x42a14d;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var moment=require('moment');var BPromise=require(_0xb38f('0x2'));var rs=require(_0xb38f('0x3'));var fs=require('fs');var Redis=require(_0xb38f('0x4'));var db=require(_0xb38f('0x5'))['db'];var utils=require(_0xb38f('0x6'));var logger=require(_0xb38f('0x7'))('rpc');var config=require(_0xb38f('0x8'));var jayson=require(_0xb38f('0x9'));var client=jayson['client'][_0xb38f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f34bb,_0x5eb600,_0x11ee97){return new BPromise(function(_0x94f9fa,_0x5df395){return client['request'](_0x3f34bb,_0x11ee97)['then'](function(_0xa6784c){logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x5eb600,_0xb38f('0xd'));logger[_0xb38f('0xe')](_0xb38f('0xf'),_0x5eb600,_0xb38f('0xd'),JSON[_0xb38f('0x10')](_0xa6784c));if(_0xa6784c[_0xb38f('0x11')]){if(_0xa6784c[_0xb38f('0x11')]['code']===0x1f4){logger[_0xb38f('0x11')](_0xb38f('0xc'),_0x5eb600,_0xa6784c[_0xb38f('0x11')][_0xb38f('0x12')]);return _0x5df395(_0xa6784c[_0xb38f('0x11')][_0xb38f('0x12')]);}logger['error'](_0xb38f('0xc'),_0x5eb600,_0xa6784c[_0xb38f('0x11')][_0xb38f('0x12')]);return _0x94f9fa(_0xa6784c['error'][_0xb38f('0x12')]);}else{logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x5eb600,_0xb38f('0xd'));_0x94f9fa(_0xa6784c[_0xb38f('0x13')]['message']);}})['catch'](function(_0x461f6d){logger[_0xb38f('0x11')](_0xb38f('0xc'),_0x5eb600,_0x461f6d);_0x5df395(_0x461f6d);});});} \ No newline at end of file +var _0xe912=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2a7aef,_0x53a1c6){var _0x2f9b2f=function(_0x2f8130){while(--_0x2f8130){_0x2a7aef['push'](_0x2a7aef['shift']());}};_0x2f9b2f(++_0x53a1c6);}(_0xe912,0x176));var _0x2e91=function(_0x581733,_0x339f65){_0x581733=_0x581733-0x0;var _0x585638=_0xe912[_0x581733];return _0x585638;};'use strict';var _=require(_0x2e91('0x0'));var util=require('util');var moment=require(_0x2e91('0x1'));var BPromise=require(_0x2e91('0x2'));var rs=require(_0x2e91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e91('0x4'))['db'];var utils=require(_0x2e91('0x5'));var logger=require(_0x2e91('0x6'))(_0x2e91('0x7'));var config=require('../../config/environment');var jayson=require(_0x2e91('0x8'));var client=jayson[_0x2e91('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5db9,_0x32a9e1,_0x4314ff){return new BPromise(function(_0x4b7941,_0x16c0cb){return client[_0x2e91('0xa')](_0x3d5db9,_0x4314ff)[_0x2e91('0xb')](function(_0xae6e47){logger[_0x2e91('0xc')](_0x2e91('0xd'),_0x32a9e1,_0x2e91('0xe'));logger[_0x2e91('0xf')](_0x2e91('0x10'),_0x32a9e1,_0x2e91('0xe'),JSON[_0x2e91('0x11')](_0xae6e47));if(_0xae6e47[_0x2e91('0x12')]){if(_0xae6e47[_0x2e91('0x12')][_0x2e91('0x13')]===0x1f4){logger[_0x2e91('0x12')]('ZendeskField,\x20%s,\x20%s',_0x32a9e1,_0xae6e47[_0x2e91('0x12')]['message']);return _0x16c0cb(_0xae6e47[_0x2e91('0x12')][_0x2e91('0x14')]);}logger[_0x2e91('0x12')](_0x2e91('0xd'),_0x32a9e1,_0xae6e47['error'][_0x2e91('0x14')]);return _0x4b7941(_0xae6e47[_0x2e91('0x12')][_0x2e91('0x14')]);}else{logger[_0x2e91('0xc')](_0x2e91('0xd'),_0x32a9e1,_0x2e91('0xe'));_0x4b7941(_0xae6e47[_0x2e91('0x15')][_0x2e91('0x14')]);}})['catch'](function(_0x2c421c){logger[_0x2e91('0x12')](_0x2e91('0xd'),_0x32a9e1,_0x2c421c);_0x16c0cb(_0x2c421c);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index de983bb..783d5c3 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 _0x3771=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','put','update','delete','destroy'];(function(_0x406e7d,_0x573599){var _0x1e5ff3=function(_0x745fc5){while(--_0x745fc5){_0x406e7d['push'](_0x406e7d['shift']());}};_0x1e5ff3(++_0x573599);}(_0x3771,0x1f4));var _0x1377=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x3771[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0x1377('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1377('0x1'));var router=express[_0x1377('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1377('0x3'));var interaction=require(_0x1377('0x4'));var config=require(_0x1377('0x5'));var controller=require(_0x1377('0x6'));router['get']('/',auth[_0x1377('0x7')](),controller[_0x1377('0x8')]);router[_0x1377('0x9')](_0x1377('0xa'),auth['isAuthenticated'](),controller[_0x1377('0xb')]);router[_0x1377('0x9')](_0x1377('0xc'),auth[_0x1377('0x7')](),controller[_0x1377('0xd')]);router[_0x1377('0x9')](_0x1377('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x1377('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1377('0xc'),auth[_0x1377('0x7')](),controller['addConfiguration']);router[_0x1377('0x10')](_0x1377('0xa'),auth['isAuthenticated'](),controller[_0x1377('0x11')]);router[_0x1377('0x12')](_0x1377('0xa'),auth[_0x1377('0x7')](),controller[_0x1377('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc3f4=['addConfiguration','put','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','show','isAuthenticated','/:id/fields','getFields','post','/:id/configurations'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xc3f4,0x16e));var _0x4c3f=function(_0x25b384,_0x386d9b){_0x25b384=_0x25b384-0x0;var _0x47ca4a=_0xc3f4[_0x25b384];return _0x47ca4a;};'use strict';var multer=require(_0x4c3f('0x0'));var util=require(_0x4c3f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c3f('0x2')]();var fs_extra=require(_0x4c3f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4c3f('0x4'));var config=require(_0x4c3f('0x5'));var controller=require('./intZohoAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4c3f('0x6')]);router[_0x4c3f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4c3f('0x8')]);router[_0x4c3f('0x7')]('/:id/configurations',auth[_0x4c3f('0x9')](),controller['getConfigurations']);router['get'](_0x4c3f('0xa'),auth[_0x4c3f('0x9')](),controller[_0x4c3f('0xb')]);router[_0x4c3f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c3f('0xc')](_0x4c3f('0xd'),auth[_0x4c3f('0x9')](),controller[_0x4c3f('0xe')]);router[_0x4c3f('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4c3f('0x10')](_0x4c3f('0x11'),auth[_0x4c3f('0x9')](),controller[_0x4c3f('0x12')]);module[_0x4c3f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 50fed55..22addc7 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 _0xec56=['STRING','sequelize'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xec56,0x1bd));var _0x6ec5=function(_0x6e46b7,_0x4f7ff5){_0x6e46b7=_0x6e46b7-0x0;var _0x4d1d98=_0xec56[_0x6e46b7];return _0x4d1d98;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ec5('0x1')]},'host':{'type':Sequelize[_0x6ec5('0x1')]},'zone':{'type':Sequelize[_0x6ec5('0x1')]},'clientId':{'type':Sequelize[_0x6ec5('0x1')]},'clientSecret':{'type':Sequelize[_0x6ec5('0x1')]},'serverUrl':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x6ec5('0x1')]},'refreshToken':{'type':Sequelize[_0x6ec5('0x1')]}}; \ No newline at end of file +var _0x2dae=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2dae,0xc3));var _0xe2da=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x2dae[_0x4a7631];return _0x1a5a6f;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')]},'description':{'type':Sequelize[_0xe2da('0x1')]},'host':{'type':Sequelize[_0xe2da('0x1')]},'zone':{'type':Sequelize[_0xe2da('0x1')]},'clientId':{'type':Sequelize[_0xe2da('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe2da('0x1')]},'refreshToken':{'type':Sequelize[_0xe2da('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6a103ee..c647fc0 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 _0xa94d=['count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','includeAll','include','find','catch','create','body','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Description','Call_Duration','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0xa94d,0x157));var _0xda94=function(_0x2b106a,_0x505380){_0x2b106a=_0x2b106a-0x0;var _0x4af2b0=_0xa94d[_0x2b106a];return _0x4af2b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda94('0x0'));var zipdir=require(_0xda94('0x1'));var jsonpatch=require(_0xda94('0x2'));var rp=require(_0xda94('0x3'));var moment=require('moment');var BPromise=require(_0xda94('0x4'));var Mustache=require(_0xda94('0x5'));var util=require(_0xda94('0x6'));var path=require(_0xda94('0x7'));var sox=require(_0xda94('0x8'));var csv=require(_0xda94('0x9'));var ejs=require(_0xda94('0xa'));var fs=require('fs');var fs_extra=require(_0xda94('0xb'));var _=require(_0xda94('0xc'));var squel=require(_0xda94('0xd'));var crypto=require(_0xda94('0xe'));var jsforce=require(_0xda94('0xf'));var deskjs=require(_0xda94('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xda94('0x11'));var Redis=require('ioredis');var authService=require(_0xda94('0x12'));var qs=require(_0xda94('0x13'));var as=require(_0xda94('0x14'));var hardwareService=require(_0xda94('0x15'));var logger=require(_0xda94('0x16'))('api');var utils=require(_0xda94('0x17'));var config=require(_0xda94('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xda94('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4db0a0,_0x1ebc52){_0x1ebc52=_0x1ebc52||0xcc;return function(_0x46b847){if(_0x46b847){return _0x4db0a0[_0xda94('0x1a')](_0x1ebc52);}return _0x4db0a0[_0xda94('0x1b')](_0x1ebc52)[_0xda94('0x1c')]();};}function respondWithResult(_0x3114cb,_0x21a62d){_0x21a62d=_0x21a62d||0xc8;return function(_0x4d54f3){if(_0x4d54f3){return _0x3114cb[_0xda94('0x1b')](_0x21a62d)['json'](_0x4d54f3);}};}function respondWithFilteredResult(_0x3110d9,_0x4871f9){return function(_0xbd48cb){if(_0xbd48cb){var _0x5964ce=typeof _0x4871f9[_0xda94('0x1d')]===_0xda94('0x1e')&&typeof _0x4871f9[_0xda94('0x1f')]===_0xda94('0x1e');var _0x52edc2=_0xbd48cb[_0xda94('0x20')];var _0x4fcedb=_0x5964ce?0x0:_0x4871f9[_0xda94('0x1d')];var _0x4fac1d=_0x5964ce?_0xbd48cb['count']:_0x4871f9[_0xda94('0x1d')]+_0x4871f9['limit'];var _0x3c803d;if(_0x4fac1d>=_0x52edc2){_0x4fac1d=_0x52edc2;_0x3c803d=0xc8;}else{_0x3c803d=0xce;}_0x3110d9[_0xda94('0x1b')](_0x3c803d);return _0x3110d9[_0xda94('0x21')](_0xda94('0x22'),_0x4fcedb+'-'+_0x4fac1d+'/'+_0x52edc2)[_0xda94('0x23')](_0xbd48cb);}return null;};}function patchUpdates(_0x14d179){return function(_0xbe31b4){try{jsonpatch[_0xda94('0x24')](_0xbe31b4,_0x14d179,!![]);}catch(_0x4e0638){return BPromise[_0xda94('0x25')](_0x4e0638);}return _0xbe31b4[_0xda94('0x26')]();};}function saveUpdates(_0x3bdfd2,_0x5046ad){return function(_0x2b7d87){if(_0x2b7d87){return _0x2b7d87[_0xda94('0x27')](_0x3bdfd2)[_0xda94('0x28')](function(_0xa5d078){return _0xa5d078;});}return null;};}function removeEntity(_0x58123f,_0x1ea492){return function(_0x3c5a51){if(_0x3c5a51){return _0x3c5a51[_0xda94('0x29')]()[_0xda94('0x28')](function(){_0x58123f[_0xda94('0x1b')](0xcc)[_0xda94('0x1c')]();});}};}function handleEntityNotFound(_0x3e4a78,_0x4c567d){return function(_0x6298fe){if(!_0x6298fe){_0x3e4a78[_0xda94('0x1a')](0x194);}return _0x6298fe;};}function handleError(_0x286b17,_0x15ce3e){_0x15ce3e=_0x15ce3e||0x1f4;return function(_0x517295){logger[_0xda94('0x2a')](_0x517295['stack']);if(_0x517295[_0xda94('0x2b')]){delete _0x517295['name'];}_0x286b17[_0xda94('0x1b')](_0x15ce3e)[_0xda94('0x2c')](_0x517295);};}exports[_0xda94('0x2d')]=function(_0x3ada3c,_0x51bd83){var _0x201c30={},_0x2727de={},_0x105921={'count':0x0,'rows':[]};var _0x479143=_[_0xda94('0x2e')](db[_0xda94('0x2f')]['rawAttributes'],function(_0x281a7a){return{'name':_0x281a7a[_0xda94('0x30')],'type':_0x281a7a[_0xda94('0x31')][_0xda94('0x32')]};});_0x2727de[_0xda94('0x33')]=_['map'](_0x479143,_0xda94('0x2b'));_0x2727de[_0xda94('0x34')]=_[_0xda94('0x35')](_0x3ada3c['query']);_0x2727de[_0xda94('0x36')]=_[_0xda94('0x37')](_0x2727de[_0xda94('0x33')],_0x2727de[_0xda94('0x34')]);_0x201c30[_0xda94('0x38')]=_[_0xda94('0x37')](_0x2727de[_0xda94('0x33')],qs['fields'](_0x3ada3c[_0xda94('0x34')][_0xda94('0x39')]));_0x201c30[_0xda94('0x38')]=_0x201c30[_0xda94('0x38')][_0xda94('0x3a')]?_0x201c30[_0xda94('0x38')]:_0x2727de[_0xda94('0x33')];if(!_0x3ada3c['query'][_0xda94('0x3b')](_0xda94('0x3c'))){_0x201c30[_0xda94('0x1f')]=qs['limit'](_0x3ada3c[_0xda94('0x34')][_0xda94('0x1f')]);_0x201c30[_0xda94('0x1d')]=qs[_0xda94('0x1d')](_0x3ada3c['query'][_0xda94('0x1d')]);}_0x201c30[_0xda94('0x3d')]=qs[_0xda94('0x3e')](_0x3ada3c[_0xda94('0x34')][_0xda94('0x3e')]);_0x201c30[_0xda94('0x3f')]=qs[_0xda94('0x36')](_[_0xda94('0x40')](_0x3ada3c[_0xda94('0x34')],_0x2727de[_0xda94('0x36')]),_0x479143);if(_0x3ada3c[_0xda94('0x34')][_0xda94('0x41')]){_0x201c30['where']=_[_0xda94('0x42')](_0x201c30[_0xda94('0x3f')],{'$or':_[_0xda94('0x2e')](_0x479143,function(_0x4a73ab){if(_0x4a73ab['type']!==_0xda94('0x43')){var _0x196bb4={};_0x196bb4[_0x4a73ab['name']]={'$like':'%'+_0x3ada3c[_0xda94('0x34')][_0xda94('0x41')]+'%'};return _0x196bb4;}})});}_0x201c30=_[_0xda94('0x42')]({},_0x201c30,_0x3ada3c[_0xda94('0x44')]);var _0x35214a={'where':_0x201c30[_0xda94('0x3f')]};return db[_0xda94('0x2f')][_0xda94('0x20')](_0x35214a)['then'](function(_0x3992d5){_0x105921[_0xda94('0x20')]=_0x3992d5;if(_0x3ada3c['query']['includeAll']){_0x201c30['include']=[{'all':!![]}];}return db[_0xda94('0x2f')][_0xda94('0x45')](_0x201c30);})[_0xda94('0x28')](function(_0x1a11f1){_0x105921[_0xda94('0x46')]=_0x1a11f1;return _0x105921;})[_0xda94('0x28')](respondWithFilteredResult(_0x51bd83,_0x201c30))['catch'](handleError(_0x51bd83,null));};exports['show']=function(_0x53bc5a,_0x30f809){var _0x5b303f={'raw':![],'where':{'id':_0x53bc5a[_0xda94('0x47')]['id']}},_0x6ad022={};_0x6ad022[_0xda94('0x33')]=_[_0xda94('0x35')](db[_0xda94('0x2f')][_0xda94('0x48')]);_0x6ad022[_0xda94('0x34')]=_[_0xda94('0x35')](_0x53bc5a[_0xda94('0x34')]);_0x6ad022[_0xda94('0x36')]=_[_0xda94('0x37')](_0x6ad022['model'],_0x6ad022[_0xda94('0x34')]);_0x5b303f[_0xda94('0x38')]=_[_0xda94('0x37')](_0x6ad022['model'],qs['fields'](_0x53bc5a[_0xda94('0x34')]['fields']));_0x5b303f[_0xda94('0x38')]=_0x5b303f[_0xda94('0x38')][_0xda94('0x3a')]?_0x5b303f[_0xda94('0x38')]:_0x6ad022[_0xda94('0x33')];if(_0x53bc5a[_0xda94('0x34')][_0xda94('0x49')]){_0x5b303f[_0xda94('0x4a')]=[{'all':!![]}];}_0x5b303f=_[_0xda94('0x42')]({},_0x5b303f,_0x53bc5a[_0xda94('0x44')]);return db['ZohoAccount'][_0xda94('0x4b')](_0x5b303f)[_0xda94('0x28')](handleEntityNotFound(_0x30f809,null))[_0xda94('0x28')](respondWithResult(_0x30f809,null))[_0xda94('0x4c')](handleError(_0x30f809,null));};exports['create']=function(_0x18e5d1,_0x2fda00){return db[_0xda94('0x2f')][_0xda94('0x4d')](_0x18e5d1[_0xda94('0x4e')],{})[_0xda94('0x28')](respondWithResult(_0x2fda00,0xc9))[_0xda94('0x4c')](handleError(_0x2fda00,null));};exports['update']=function(_0x307c22,_0x3dd89e){if(_0x307c22['body']['id']){delete _0x307c22['body']['id'];}return db[_0xda94('0x2f')][_0xda94('0x4b')]({'where':{'id':_0x307c22[_0xda94('0x47')]['id']}})['then'](handleEntityNotFound(_0x3dd89e,null))[_0xda94('0x28')](saveUpdates(_0x307c22[_0xda94('0x4e')],null))[_0xda94('0x28')](respondWithResult(_0x3dd89e,null))[_0xda94('0x4c')](handleError(_0x3dd89e,null));};exports[_0xda94('0x29')]=function(_0x2c6e03,_0x23f48){return db[_0xda94('0x2f')][_0xda94('0x4b')]({'where':{'id':_0x2c6e03[_0xda94('0x47')]['id']}})[_0xda94('0x28')](handleEntityNotFound(_0x23f48,null))[_0xda94('0x28')](removeEntity(_0x23f48,null))[_0xda94('0x4c')](handleError(_0x23f48,null));};exports[_0xda94('0x4f')]=function(_0x24d666,_0x3ba723,_0x285ac8){var _0x32deaa={};var _0xd922aa={};var _0x20d025;var _0x132277;return db[_0xda94('0x2f')][_0xda94('0x50')]({'where':{'id':_0x24d666[_0xda94('0x47')]['id']}})[_0xda94('0x28')](handleEntityNotFound(_0x3ba723,null))[_0xda94('0x28')](function(_0x4909ec){if(_0x4909ec){_0x20d025=_0x4909ec;_0xd922aa[_0xda94('0x33')]=_[_0xda94('0x35')](db['ZohoConfiguration']['rawAttributes']);_0xd922aa[_0xda94('0x34')]=_[_0xda94('0x35')](_0x24d666[_0xda94('0x34')]);_0xd922aa[_0xda94('0x36')]=_['intersection'](_0xd922aa[_0xda94('0x33')],_0xd922aa[_0xda94('0x34')]);_0x32deaa[_0xda94('0x38')]=_[_0xda94('0x37')](_0xd922aa[_0xda94('0x33')],qs[_0xda94('0x39')](_0x24d666[_0xda94('0x34')][_0xda94('0x39')]));_0x32deaa[_0xda94('0x38')]=_0x32deaa['attributes'][_0xda94('0x3a')]?_0x32deaa['attributes']:_0xd922aa[_0xda94('0x33')];_0x32deaa[_0xda94('0x3d')]=qs[_0xda94('0x3e')](_0x24d666[_0xda94('0x34')][_0xda94('0x3e')]);_0x32deaa['where']=qs[_0xda94('0x36')](_[_0xda94('0x40')](_0x24d666['query'],_0xd922aa[_0xda94('0x36')]));if(_0x24d666[_0xda94('0x34')]['filter']){_0x32deaa['where']=_[_0xda94('0x42')](_0x32deaa[_0xda94('0x3f')],{'$or':_[_0xda94('0x2e')](_0x32deaa['attributes'],function(_0x4bd829){var _0x3d835a={};_0x3d835a[_0x4bd829]={'$like':'%'+_0x24d666[_0xda94('0x34')]['filter']+'%'};return _0x3d835a;})});}_0x32deaa=_['merge']({},_0x32deaa,_0x24d666[_0xda94('0x44')]);return _0x20d025['getConfigurations'](_0x32deaa);}})[_0xda94('0x28')](function(_0x531fa3){if(_0x531fa3){_0x132277=_0x531fa3[_0xda94('0x3a')];if(!_0x24d666[_0xda94('0x34')][_0xda94('0x3b')](_0xda94('0x3c'))){_0x32deaa[_0xda94('0x1f')]=qs[_0xda94('0x1f')](_0x24d666[_0xda94('0x34')][_0xda94('0x1f')]);_0x32deaa[_0xda94('0x1d')]=qs['offset'](_0x24d666[_0xda94('0x34')][_0xda94('0x1d')]);}return _0x20d025[_0xda94('0x4f')](_0x32deaa);}})[_0xda94('0x28')](function(_0x4cf0d3){if(_0x4cf0d3){return _0x4cf0d3?{'count':_0x132277,'rows':_0x4cf0d3}:null;}})['then'](respondWithResult(_0x3ba723,null))[_0xda94('0x4c')](handleError(_0x3ba723,null));};exports['addConfiguration']=function(_0xfdd1eb,_0x1d12ea,_0x1244b6){if(_0xfdd1eb['body']['id']){delete _0xfdd1eb['body']['id'];}return db[_0xda94('0x2f')][_0xda94('0x50')]({'where':{'id':_0xfdd1eb[_0xda94('0x47')]['id']}})[_0xda94('0x28')](handleEntityNotFound(_0x1d12ea,null))['then'](function(_0x4f48e0){if(_0x4f48e0){_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x51')]=_0x4f48e0['id'];_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x52')]=integrations['getSubjects'](_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x53')],_0xfdd1eb['body'][_0xda94('0x31')]);_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x54')]=integrations[_0xda94('0x55')](_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x53')],_0xfdd1eb[_0xda94('0x4e')][_0xda94('0x31')]);return db['ZohoConfiguration'][_0xda94('0x4d')](_0xfdd1eb['body'],{'include':[{'model':db['ZohoField'],'as':_0xda94('0x52')},{'model':db[_0xda94('0x56')],'as':_0xda94('0x54')}]});}return null;})[_0xda94('0x28')](respondWithResult(_0x1d12ea,null))[_0xda94('0x4c')](handleError(_0x1d12ea,null));};function getAccessToken(_0xfa8cc9){return new Promise(function(_0x10b664,_0x2fa1e4){var _0xd366e3;switch(_0xfa8cc9[_0xda94('0x57')]){case'US':_0xd366e3='https://accounts.zoho.com';break;case'AU':_0xd366e3=_0xda94('0x58');break;case'EU':_0xd366e3='https://accounts.zoho.eu';break;case'IN':_0xd366e3=_0xda94('0x59');break;case'CN':_0xd366e3='https://accounts.zoho.com.cn';break;default:_0xd366e3='https://accounts.zoho.eu';break;}var _0x536759={'method':_0xda94('0x5a'),'uri':_0xd366e3+_0xda94('0x5b'),'qs':{'refresh_token':_0xfa8cc9[_0xda94('0x5c')],'client_id':_0xfa8cc9['clientId'],'client_secret':_0xfa8cc9[_0xda94('0x5d')],'grant_type':_0xda94('0x5e')},'json':!![]};return rp(_0x536759)[_0xda94('0x28')](function(_0x11ffb2){if(_0x11ffb2[_0xda94('0x5f')]){_0x10b664(_0x11ffb2['access_token']);}else{_0x2fa1e4(_0xda94('0x60'));}})[_0xda94('0x4c')](function(_0x520e0a){_0x2fa1e4(_0x520e0a);});});}exports[_0xda94('0x61')]=function(_0x326521,_0x88c635,_0x541845){var _0x3c9e30,_0x81f492,_0x5b18a2,_0x37afaf,_0x306eb0;return db[_0xda94('0x2f')][_0xda94('0x50')]({'where':{'id':_0x326521[_0xda94('0x47')]['id']},'attributes':['id',_0xda94('0x62'),'zone',_0xda94('0x63'),_0xda94('0x5d'),_0xda94('0x64'),_0xda94('0x65'),_0xda94('0x5c')]})[_0xda94('0x28')](handleEntityNotFound(_0x88c635,null))[_0xda94('0x28')](function(_0x50652c){_0x306eb0=_0x50652c;_0x3c9e30=_0x306eb0[_0xda94('0x62')];_0x81f492=_0x3c9e30==='zoho.eu'?'eu':_0xda94('0x66');_0x5b18a2=_0x306eb0[_0xda94('0x64')];var _0x3bf83a=_0x5b18a2['slice'](-0x1);if(_0x3bf83a==='/'||_0x3bf83a==='\x5c'||_0x3bf83a===':'){_0x5b18a2=_0x5b18a2[_0xda94('0x67')](0x0,_0x5b18a2['lastIndexOf'](_0x3bf83a));}if(!_0x306eb0[_0xda94('0x5c')]){throw new Error(_0xda94('0x68'));}return getAccessToken(_0x306eb0);})[_0xda94('0x28')](function(_0x34e08e){if(_0x34e08e){return rp({'method':_0xda94('0x69'),'uri':util[_0xda94('0x6a')](_0xda94('0x6b'),_0x81f492),'qs':{'module':_0xda94('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x34e08e},'json':!![]});}})[_0xda94('0x28')](function(_0x44a00a){if(_0x44a00a){if(_0x44a00a[_0xda94('0x6d')]&&_0x44a00a[_0xda94('0x6d')][_0xda94('0x2a')]){throw new Error(_0x44a00a[_0xda94('0x6d')][_0xda94('0x2a')][_0xda94('0x6e')]);}var _0x310d47=[];var _0x1b5e29=[];var _0x107fb7=[_0xda94('0x6f'),'Subject',_0xda94('0x70'),'WhoId',_0xda94('0x71'),'Call_Result',_0xda94('0x72'),'Call_Type'];_0x1b5e29=_[_0xda94('0x73')](_0x44a00a[_0xda94('0x39')],function(_0x4b17bc){return _0x107fb7[_0xda94('0x74')](_0x4b17bc[_0xda94('0x75')]);});for(var _0x11cd4c=0x0;_0x11cd4c<_0x1b5e29['length'];_0x11cd4c++){if(_0x1b5e29[_0x11cd4c][_0xda94('0x76')]===![]){_0x310d47[_0xda94('0x77')]({'id':_0x1b5e29[_0x11cd4c]['id'],'name':_0x1b5e29[_0x11cd4c][_0xda94('0x78')],'custom':_0x1b5e29[_0x11cd4c][_0xda94('0x79')],'options':_0x1b5e29[_0x11cd4c]['data_type']==='picklist'&&_0x1b5e29[_0x11cd4c]['pick_list_values'][_0xda94('0x3a')]>-0x1?_[_0xda94('0x2e')](_0x1b5e29[_0x11cd4c]['pick_list_values'],function(_0x3f87a1){return{'name':_0x3f87a1,'value':_0x3f87a1};}):[]});}}return{'count':_0x310d47['length'],'rows':_0x310d47};}else{return{'count':0x0,'rows':[]};}})[_0xda94('0x28')](respondWithResult(_0x88c635,null))[_0xda94('0x4c')](function(_0x13663c){var _0x12bdaa=_0x326521[_0xda94('0x34')][_0xda94('0x7a')]?0x1f4:_0x13663c['statusCode']||0x1f4;logger[_0xda94('0x2a')](_0xda94('0x7b'),_0xda94('0x61'),_0x12bdaa,JSON['stringify'](_0x13663c));delete _0x13663c[_0xda94('0x2b')];if(_0x12bdaa===0x191){_0x12bdaa=0x190;}_0x88c635[_0xda94('0x1b')](_0x12bdaa)[_0xda94('0x2c')](_0x326521[_0xda94('0x34')]['test']?{'message':_0xda94('0x7c'),'statusCode':_0x13663c['statusCode']}:_0x13663c);});}; \ No newline at end of file +var _0x6654=['format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','status','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','ZohoAccount','include','findAll','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET'];(function(_0x411b68,_0x52e768){var _0x41ff90=function(_0x2ab602){while(--_0x2ab602){_0x411b68['push'](_0x411b68['shift']());}};_0x41ff90(++_0x52e768);}(_0x6654,0x122));var _0x4665=function(_0x58ddd6,_0x56925e){_0x58ddd6=_0x58ddd6-0x0;var _0x541f82=_0x6654[_0x58ddd6];return _0x541f82;};'use strict';var emlformat=require(_0x4665('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4665('0x1'));var jsonpatch=require(_0x4665('0x2'));var rp=require(_0x4665('0x3'));var moment=require(_0x4665('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4665('0x5'));var path=require(_0x4665('0x6'));var sox=require(_0x4665('0x7'));var csv=require(_0x4665('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4665('0x9'));var _=require(_0x4665('0xa'));var squel=require(_0x4665('0xb'));var crypto=require(_0x4665('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4665('0x8'));var querystring=require(_0x4665('0xd'));var Papa=require(_0x4665('0xe'));var Redis=require(_0x4665('0xf'));var authService=require(_0x4665('0x10'));var qs=require(_0x4665('0x11'));var as=require(_0x4665('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4665('0x13'));var utils=require('../../config/utils');var config=require(_0x4665('0x14'));var licenseUtil=require(_0x4665('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4665('0x16'));function respondWithStatusCode(_0x1c75ac,_0x555407){_0x555407=_0x555407||0xcc;return function(_0x1a5f81){if(_0x1a5f81){return _0x1c75ac[_0x4665('0x17')](_0x555407);}return _0x1c75ac['status'](_0x555407)[_0x4665('0x18')]();};}function respondWithResult(_0x15b6a5,_0x45b036){_0x45b036=_0x45b036||0xc8;return function(_0x4fd1b8){if(_0x4fd1b8){return _0x15b6a5['status'](_0x45b036)[_0x4665('0x19')](_0x4fd1b8);}};}function respondWithFilteredResult(_0x17f60b,_0x3032a1){return function(_0x3565c7){if(_0x3565c7){var _0x266093=typeof _0x3032a1['offset']==='undefined'&&typeof _0x3032a1[_0x4665('0x1a')]==='undefined';var _0x55c699=_0x3565c7[_0x4665('0x1b')];var _0x332f73=_0x266093?0x0:_0x3032a1[_0x4665('0x1c')];var _0x5447c1=_0x266093?_0x3565c7['count']:_0x3032a1[_0x4665('0x1c')]+_0x3032a1['limit'];var _0x225697;if(_0x5447c1>=_0x55c699){_0x5447c1=_0x55c699;_0x225697=0xc8;}else{_0x225697=0xce;}_0x17f60b['status'](_0x225697);return _0x17f60b[_0x4665('0x1d')](_0x4665('0x1e'),_0x332f73+'-'+_0x5447c1+'/'+_0x55c699)['json'](_0x3565c7);}return null;};}function patchUpdates(_0x5e732c){return function(_0x13249f){try{jsonpatch['apply'](_0x13249f,_0x5e732c,!![]);}catch(_0x4da556){return BPromise[_0x4665('0x1f')](_0x4da556);}return _0x13249f[_0x4665('0x20')]();};}function saveUpdates(_0x3b803b,_0x571a49){return function(_0x32350e){if(_0x32350e){return _0x32350e[_0x4665('0x21')](_0x3b803b)[_0x4665('0x22')](function(_0x5ef5c9){return _0x5ef5c9;});}return null;};}function removeEntity(_0x212931,_0x27ab75){return function(_0x1fc714){if(_0x1fc714){return _0x1fc714[_0x4665('0x23')]()[_0x4665('0x22')](function(){_0x212931['status'](0xcc)[_0x4665('0x18')]();});}};}function handleEntityNotFound(_0x315676,_0xc2f0ad){return function(_0x1d4bf7){if(!_0x1d4bf7){_0x315676[_0x4665('0x17')](0x194);}return _0x1d4bf7;};}function handleError(_0x5e5907,_0x5738d2){_0x5738d2=_0x5738d2||0x1f4;return function(_0x38a30f){logger[_0x4665('0x24')](_0x38a30f['stack']);if(_0x38a30f[_0x4665('0x25')]){delete _0x38a30f[_0x4665('0x25')];}_0x5e5907[_0x4665('0x26')](_0x5738d2)['send'](_0x38a30f);};}exports[_0x4665('0x27')]=function(_0x1d1071,_0x5cdb26){var _0x134b6b={},_0x40dc84={},_0x30529e={'count':0x0,'rows':[]};var _0x3fa994=_[_0x4665('0x28')](db['ZohoAccount'][_0x4665('0x29')],function(_0x273d0f){return{'name':_0x273d0f[_0x4665('0x2a')],'type':_0x273d0f['type'][_0x4665('0x2b')]};});_0x40dc84[_0x4665('0x2c')]=_[_0x4665('0x28')](_0x3fa994,_0x4665('0x25'));_0x40dc84[_0x4665('0x2d')]=_['keys'](_0x1d1071[_0x4665('0x2d')]);_0x40dc84[_0x4665('0x2e')]=_['intersection'](_0x40dc84[_0x4665('0x2c')],_0x40dc84[_0x4665('0x2d')]);_0x134b6b[_0x4665('0x2f')]=_[_0x4665('0x30')](_0x40dc84['model'],qs[_0x4665('0x31')](_0x1d1071[_0x4665('0x2d')][_0x4665('0x31')]));_0x134b6b[_0x4665('0x2f')]=_0x134b6b[_0x4665('0x2f')][_0x4665('0x32')]?_0x134b6b[_0x4665('0x2f')]:_0x40dc84[_0x4665('0x2c')];if(!_0x1d1071[_0x4665('0x2d')][_0x4665('0x33')](_0x4665('0x34'))){_0x134b6b[_0x4665('0x1a')]=qs['limit'](_0x1d1071[_0x4665('0x2d')]['limit']);_0x134b6b[_0x4665('0x1c')]=qs[_0x4665('0x1c')](_0x1d1071['query']['offset']);}_0x134b6b[_0x4665('0x35')]=qs[_0x4665('0x36')](_0x1d1071[_0x4665('0x2d')]['sort']);_0x134b6b[_0x4665('0x37')]=qs[_0x4665('0x2e')](_[_0x4665('0x38')](_0x1d1071[_0x4665('0x2d')],_0x40dc84['filters']),_0x3fa994);if(_0x1d1071[_0x4665('0x2d')][_0x4665('0x39')]){_0x134b6b['where']=_['merge'](_0x134b6b[_0x4665('0x37')],{'$or':_[_0x4665('0x28')](_0x3fa994,function(_0x318b64){if(_0x318b64[_0x4665('0x3a')]!=='VIRTUAL'){var _0xb45695={};_0xb45695[_0x318b64[_0x4665('0x25')]]={'$like':'%'+_0x1d1071[_0x4665('0x2d')]['filter']+'%'};return _0xb45695;}})});}_0x134b6b=_[_0x4665('0x3b')]({},_0x134b6b,_0x1d1071[_0x4665('0x3c')]);var _0x2850dc={'where':_0x134b6b[_0x4665('0x37')]};return db[_0x4665('0x3d')][_0x4665('0x1b')](_0x2850dc)[_0x4665('0x22')](function(_0x4348b7){_0x30529e[_0x4665('0x1b')]=_0x4348b7;if(_0x1d1071[_0x4665('0x2d')]['includeAll']){_0x134b6b[_0x4665('0x3e')]=[{'all':!![]}];}return db[_0x4665('0x3d')][_0x4665('0x3f')](_0x134b6b);})[_0x4665('0x22')](function(_0x54ac8b){_0x30529e['rows']=_0x54ac8b;return _0x30529e;})[_0x4665('0x22')](respondWithFilteredResult(_0x5cdb26,_0x134b6b))[_0x4665('0x40')](handleError(_0x5cdb26,null));};exports[_0x4665('0x41')]=function(_0x6b72f3,_0x38322c){var _0x1c26f8={'raw':![],'where':{'id':_0x6b72f3[_0x4665('0x42')]['id']}},_0x60c0d3={};_0x60c0d3[_0x4665('0x2c')]=_[_0x4665('0x43')](db['ZohoAccount'][_0x4665('0x29')]);_0x60c0d3[_0x4665('0x2d')]=_[_0x4665('0x43')](_0x6b72f3['query']);_0x60c0d3[_0x4665('0x2e')]=_['intersection'](_0x60c0d3[_0x4665('0x2c')],_0x60c0d3[_0x4665('0x2d')]);_0x1c26f8[_0x4665('0x2f')]=_[_0x4665('0x30')](_0x60c0d3[_0x4665('0x2c')],qs['fields'](_0x6b72f3[_0x4665('0x2d')]['fields']));_0x1c26f8['attributes']=_0x1c26f8[_0x4665('0x2f')][_0x4665('0x32')]?_0x1c26f8[_0x4665('0x2f')]:_0x60c0d3['model'];if(_0x6b72f3[_0x4665('0x2d')][_0x4665('0x44')]){_0x1c26f8[_0x4665('0x3e')]=[{'all':!![]}];}_0x1c26f8=_[_0x4665('0x3b')]({},_0x1c26f8,_0x6b72f3['options']);return db[_0x4665('0x3d')][_0x4665('0x45')](_0x1c26f8)[_0x4665('0x22')](handleEntityNotFound(_0x38322c,null))[_0x4665('0x22')](respondWithResult(_0x38322c,null))[_0x4665('0x40')](handleError(_0x38322c,null));};exports[_0x4665('0x46')]=function(_0x56231d,_0x4b75d6){return db[_0x4665('0x3d')][_0x4665('0x46')](_0x56231d[_0x4665('0x47')],{})[_0x4665('0x22')](respondWithResult(_0x4b75d6,0xc9))[_0x4665('0x40')](handleError(_0x4b75d6,null));};exports['update']=function(_0x3135d3,_0x49a5c2){if(_0x3135d3['body']['id']){delete _0x3135d3['body']['id'];}return db[_0x4665('0x3d')][_0x4665('0x45')]({'where':{'id':_0x3135d3[_0x4665('0x42')]['id']}})[_0x4665('0x22')](handleEntityNotFound(_0x49a5c2,null))[_0x4665('0x22')](saveUpdates(_0x3135d3['body'],null))[_0x4665('0x22')](respondWithResult(_0x49a5c2,null))[_0x4665('0x40')](handleError(_0x49a5c2,null));};exports[_0x4665('0x23')]=function(_0x2e93a8,_0x5ac237){return db[_0x4665('0x3d')][_0x4665('0x45')]({'where':{'id':_0x2e93a8[_0x4665('0x42')]['id']}})[_0x4665('0x22')](handleEntityNotFound(_0x5ac237,null))[_0x4665('0x22')](removeEntity(_0x5ac237,null))['catch'](handleError(_0x5ac237,null));};exports[_0x4665('0x48')]=function(_0x46beab,_0x32c15f,_0x3ffccd){var _0x34822f={};var _0x10749f={};var _0x242b28;var _0x3a063b;return db[_0x4665('0x3d')][_0x4665('0x49')]({'where':{'id':_0x46beab['params']['id']}})[_0x4665('0x22')](handleEntityNotFound(_0x32c15f,null))[_0x4665('0x22')](function(_0x564594){if(_0x564594){_0x242b28=_0x564594;_0x10749f[_0x4665('0x2c')]=_[_0x4665('0x43')](db[_0x4665('0x4a')][_0x4665('0x29')]);_0x10749f[_0x4665('0x2d')]=_[_0x4665('0x43')](_0x46beab[_0x4665('0x2d')]);_0x10749f[_0x4665('0x2e')]=_[_0x4665('0x30')](_0x10749f[_0x4665('0x2c')],_0x10749f[_0x4665('0x2d')]);_0x34822f[_0x4665('0x2f')]=_[_0x4665('0x30')](_0x10749f[_0x4665('0x2c')],qs[_0x4665('0x31')](_0x46beab[_0x4665('0x2d')][_0x4665('0x31')]));_0x34822f[_0x4665('0x2f')]=_0x34822f[_0x4665('0x2f')][_0x4665('0x32')]?_0x34822f[_0x4665('0x2f')]:_0x10749f['model'];_0x34822f[_0x4665('0x35')]=qs[_0x4665('0x36')](_0x46beab[_0x4665('0x2d')][_0x4665('0x36')]);_0x34822f[_0x4665('0x37')]=qs[_0x4665('0x2e')](_['pick'](_0x46beab[_0x4665('0x2d')],_0x10749f[_0x4665('0x2e')]));if(_0x46beab[_0x4665('0x2d')][_0x4665('0x39')]){_0x34822f[_0x4665('0x37')]=_[_0x4665('0x3b')](_0x34822f[_0x4665('0x37')],{'$or':_[_0x4665('0x28')](_0x34822f[_0x4665('0x2f')],function(_0x21ca32){var _0x5f0e16={};_0x5f0e16[_0x21ca32]={'$like':'%'+_0x46beab[_0x4665('0x2d')]['filter']+'%'};return _0x5f0e16;})});}_0x34822f=_['merge']({},_0x34822f,_0x46beab['options']);return _0x242b28[_0x4665('0x48')](_0x34822f);}})[_0x4665('0x22')](function(_0x88a81d){if(_0x88a81d){_0x3a063b=_0x88a81d[_0x4665('0x32')];if(!_0x46beab[_0x4665('0x2d')][_0x4665('0x33')]('nolimit')){_0x34822f[_0x4665('0x1a')]=qs['limit'](_0x46beab[_0x4665('0x2d')][_0x4665('0x1a')]);_0x34822f[_0x4665('0x1c')]=qs[_0x4665('0x1c')](_0x46beab['query'][_0x4665('0x1c')]);}return _0x242b28[_0x4665('0x48')](_0x34822f);}})[_0x4665('0x22')](function(_0x519f77){if(_0x519f77){return _0x519f77?{'count':_0x3a063b,'rows':_0x519f77}:null;}})[_0x4665('0x22')](respondWithResult(_0x32c15f,null))[_0x4665('0x40')](handleError(_0x32c15f,null));};exports[_0x4665('0x4b')]=function(_0x3708fe,_0x14679d,_0x5ba3eb){if(_0x3708fe[_0x4665('0x47')]['id']){delete _0x3708fe['body']['id'];}return db[_0x4665('0x3d')][_0x4665('0x49')]({'where':{'id':_0x3708fe[_0x4665('0x42')]['id']}})['then'](handleEntityNotFound(_0x14679d,null))[_0x4665('0x22')](function(_0x143e96){if(_0x143e96){_0x3708fe[_0x4665('0x47')][_0x4665('0x4c')]=_0x143e96['id'];_0x3708fe[_0x4665('0x47')][_0x4665('0x4d')]=integrations[_0x4665('0x4e')](_0x3708fe[_0x4665('0x47')][_0x4665('0x4f')],_0x3708fe[_0x4665('0x47')][_0x4665('0x3a')]);_0x3708fe[_0x4665('0x47')][_0x4665('0x50')]=integrations['getDescriptions'](_0x3708fe[_0x4665('0x47')][_0x4665('0x4f')],_0x3708fe[_0x4665('0x47')][_0x4665('0x3a')]);return db['ZohoConfiguration'][_0x4665('0x46')](_0x3708fe['body'],{'include':[{'model':db[_0x4665('0x51')],'as':_0x4665('0x4d')},{'model':db['ZohoField'],'as':_0x4665('0x50')}]});}return null;})[_0x4665('0x22')](respondWithResult(_0x14679d,null))[_0x4665('0x40')](handleError(_0x14679d,null));};function getAccessToken(_0x11317a){return new Promise(function(_0x3db8fa,_0x3e49b7){var _0x58a97b;switch(_0x11317a[_0x4665('0x52')]){case'US':_0x58a97b=_0x4665('0x53');break;case'AU':_0x58a97b=_0x4665('0x54');break;case'EU':_0x58a97b='https://accounts.zoho.eu';break;case'IN':_0x58a97b=_0x4665('0x55');break;case'CN':_0x58a97b=_0x4665('0x56');break;default:_0x58a97b='https://accounts.zoho.eu';break;}var _0x2ded3d={'method':_0x4665('0x57'),'uri':_0x58a97b+_0x4665('0x58'),'qs':{'refresh_token':_0x11317a[_0x4665('0x59')],'client_id':_0x11317a[_0x4665('0x5a')],'client_secret':_0x11317a['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x2ded3d)[_0x4665('0x22')](function(_0x54b8ac){if(_0x54b8ac['access_token']){_0x3db8fa(_0x54b8ac[_0x4665('0x5b')]);}else{_0x3e49b7(_0x4665('0x5c'));}})[_0x4665('0x40')](function(_0x2fae3c){_0x3e49b7(_0x2fae3c);});});}exports['getFields']=function(_0x39776f,_0x2b8535,_0x429ddf){var _0x559abf,_0x4d074b,_0x22c0b0,_0x4e80a5,_0x1e86b7;return db[_0x4665('0x3d')][_0x4665('0x49')]({'where':{'id':_0x39776f[_0x4665('0x42')]['id']},'attributes':['id',_0x4665('0x5d'),_0x4665('0x52'),'clientId',_0x4665('0x5e'),_0x4665('0x5f'),_0x4665('0x60'),_0x4665('0x59')]})[_0x4665('0x22')](handleEntityNotFound(_0x2b8535,null))[_0x4665('0x22')](function(_0x36800a){_0x1e86b7=_0x36800a;_0x559abf=_0x1e86b7['host'];_0x4d074b=_0x559abf==='zoho.eu'?'eu':_0x4665('0x61');_0x22c0b0=_0x1e86b7['serverUrl'];var _0x1e0543=_0x22c0b0[_0x4665('0x62')](-0x1);if(_0x1e0543==='/'||_0x1e0543==='\x5c'||_0x1e0543===':'){_0x22c0b0=_0x22c0b0[_0x4665('0x63')](0x0,_0x22c0b0[_0x4665('0x64')](_0x1e0543));}if(!_0x1e86b7['refreshToken']){throw new Error(_0x4665('0x65'));}return getAccessToken(_0x1e86b7);})['then'](function(_0x17558c){if(_0x17558c){return rp({'method':_0x4665('0x66'),'uri':util[_0x4665('0x67')](_0x4665('0x68'),_0x4d074b),'qs':{'module':_0x4665('0x69')},'headers':{'Authorization':_0x4665('0x6a')+_0x17558c},'json':!![]});}})[_0x4665('0x22')](function(_0x4851b2){if(_0x4851b2){if(_0x4851b2['response']&&_0x4851b2['response'][_0x4665('0x24')]){throw new Error(_0x4851b2[_0x4665('0x6b')][_0x4665('0x24')][_0x4665('0x6c')]);}var _0x6bd5d9=[];var _0x1e2f3f=[];var _0x528a92=['Owner',_0x4665('0x6d'),_0x4665('0x6e'),_0x4665('0x6f'),_0x4665('0x70'),_0x4665('0x71'),_0x4665('0x72'),_0x4665('0x73')];_0x1e2f3f=_[_0x4665('0x74')](_0x4851b2[_0x4665('0x31')],function(_0x5ebe16){return _0x528a92[_0x4665('0x75')](_0x5ebe16[_0x4665('0x76')]);});for(var _0x364d1a=0x0;_0x364d1a<_0x1e2f3f[_0x4665('0x32')];_0x364d1a++){if(_0x1e2f3f[_0x364d1a][_0x4665('0x77')]===![]){_0x6bd5d9[_0x4665('0x78')]({'id':_0x1e2f3f[_0x364d1a]['id'],'name':_0x1e2f3f[_0x364d1a][_0x4665('0x79')],'custom':_0x1e2f3f[_0x364d1a][_0x4665('0x7a')],'options':_0x1e2f3f[_0x364d1a][_0x4665('0x7b')]===_0x4665('0x7c')&&_0x1e2f3f[_0x364d1a]['pick_list_values']['length']>-0x1?_[_0x4665('0x28')](_0x1e2f3f[_0x364d1a][_0x4665('0x7d')],function(_0x17a70a){return{'name':_0x17a70a,'value':_0x17a70a};}):[]});}}return{'count':_0x6bd5d9[_0x4665('0x32')],'rows':_0x6bd5d9};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2b8535,null))[_0x4665('0x40')](function(_0x318e2e){var _0x4f2025=_0x39776f[_0x4665('0x2d')][_0x4665('0x7e')]?0x1f4:_0x318e2e[_0x4665('0x7f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4665('0x80'),_0x4f2025,JSON['stringify'](_0x318e2e));delete _0x318e2e['name'];if(_0x4f2025===0x191){_0x4f2025=0x190;}_0x2b8535[_0x4665('0x26')](_0x4f2025)[_0x4665('0x81')](_0x39776f['query'][_0x4665('0x7e')]?{'message':_0x4665('0x82'),'statusCode':_0x318e2e[_0x4665('0x7f')]}:_0x318e2e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5a59c8e..d0084e7 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 _0xb58c=['path','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','authorization_code','code','application/x-www-form-urlencoded','parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','info','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xb58c,0x78));var _0xcb58=function(_0x267533,_0x51d585){_0x267533=_0x267533-0x0;var _0x11d03f=_0xb58c[_0x267533];return _0x11d03f;};'use strict';var _=require(_0xcb58('0x0'));var util=require('util');var logger=require(_0xcb58('0x1'))(_0xcb58('0x2'));var moment=require(_0xcb58('0x3'));var BPromise=require(_0xcb58('0x4'));var rp=require(_0xcb58('0x5'));var fs=require('fs');var path=require(_0xcb58('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xcb58('0x7'));module[_0xcb58('0x8')]=function(_0x41b57a,_0xc04f99){return _0x41b57a[_0xcb58('0x9')](_0xcb58('0xa'),attributes,{'tableName':_0xcb58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x443171,_0x47efe9,_0x4f7740){if(_0x443171[_0xcb58('0xc')](_0xcb58('0xd'))||_0x443171[_0xcb58('0xc')](_0xcb58('0xe'))||_0x443171[_0xcb58('0xc')](_0xcb58('0xf'))||_0x443171['changed'](_0xcb58('0x10'))||_0x443171[_0xcb58('0xc')]('code')||_0x443171[_0xcb58('0xc')](_0xcb58('0x11'))){var _0x10bbc8,_0x5d4553;_0x10bbc8=_0x443171[_0xcb58('0xe')];var _0x116bf5=_0x10bbc8[_0xcb58('0x12')](-0x1);if(_0x116bf5==='/'||_0x116bf5==='\x5c'||_0x116bf5===':'){_0x10bbc8=_0x10bbc8[_0xcb58('0x13')](0x0,_0x10bbc8['lastIndexOf'](_0x116bf5));}switch(_0x443171[_0xcb58('0xd')]){case'US':_0x5d4553=_0xcb58('0x14');break;case'AU':_0x5d4553='https://accounts.zoho.com.au';break;case'IN':_0x5d4553=_0xcb58('0x15');break;case'CN':_0x5d4553='https://accounts.zoho.com.cn';break;default:_0x5d4553=_0xcb58('0x16');break;}var _0x28eb6a={'method':'POST','uri':_0x5d4553+'/oauth/v2/token','form':{'grant_type':_0xcb58('0x17'),'client_id':_0x443171[_0xcb58('0xf')],'client_secret':_0x443171[_0xcb58('0x10')],'redirect_uri':_0x443171[_0xcb58('0xe')],'code':_0x443171[_0xcb58('0x18')]},'headers':{'Content-Type':_0xcb58('0x19')}};return rp(_0x28eb6a)['then'](function(_0x3d2ff7){var _0x411887=JSON[_0xcb58('0x1a')](_0x3d2ff7);if(_0x411887[_0xcb58('0x1b')]){_0x443171['refreshToken']=_0x411887[_0xcb58('0x1b')];logger['info'](util[_0xcb58('0x1c')](_0xcb58('0x1d'),_0x443171[_0xcb58('0x1e')],_0x443171['id']));}else{logger['error'](util[_0xcb58('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x443171[_0xcb58('0x1e')],_0x443171['id']),util[_0xcb58('0x1f')](_0x411887,{'showHidden':![],'depth':null}));}return _0x4f7740(null,_0x47efe9);})[_0xcb58('0x20')](function(_0x215dec){logger[_0xcb58('0x21')](util['format'](_0xcb58('0x22'),_0x443171[_0xcb58('0x1e')],_0x443171['id']),util[_0xcb58('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x4f7740(_0x215dec);});}else{return _0x4f7740(null,_0x47efe9);}},'beforeUpdate':function(_0x556c11,_0x57dd4c,_0x59ab5a){if(_0x556c11['changed'](_0xcb58('0xd'))||_0x556c11[_0xcb58('0xc')](_0xcb58('0xe'))||_0x556c11['changed']('clientId')||_0x556c11[_0xcb58('0xc')](_0xcb58('0x10'))||_0x556c11[_0xcb58('0xc')]('code')||_0x556c11[_0xcb58('0xc')](_0xcb58('0x11'))){var _0x29a753,_0x1aae41;_0x29a753=_0x556c11[_0xcb58('0xe')];var _0x360b46=_0x29a753[_0xcb58('0x12')](-0x1);if(_0x360b46==='/'||_0x360b46==='\x5c'||_0x360b46===':'){_0x29a753=_0x29a753[_0xcb58('0x13')](0x0,_0x29a753[_0xcb58('0x23')](_0x360b46));}switch(_0x556c11[_0xcb58('0xd')]){case'US':_0x1aae41=_0xcb58('0x14');break;case'AU':_0x1aae41=_0xcb58('0x24');break;case'IN':_0x1aae41=_0xcb58('0x15');break;case'CN':_0x1aae41=_0xcb58('0x25');break;default:_0x1aae41=_0xcb58('0x16');break;}var _0x4d6fc9={'method':_0xcb58('0x26'),'uri':_0x1aae41+_0xcb58('0x27'),'form':{'grant_type':_0xcb58('0x17'),'client_id':_0x556c11[_0xcb58('0xf')],'client_secret':_0x556c11[_0xcb58('0x10')],'redirect_uri':_0x556c11[_0xcb58('0xe')],'code':_0x556c11[_0xcb58('0x18')]},'headers':{'Content-Type':_0xcb58('0x19')}};return rp(_0x4d6fc9)['then'](function(_0x2ece60){var _0x36671d=JSON[_0xcb58('0x1a')](_0x2ece60);if(_0x36671d[_0xcb58('0x1b')]){_0x556c11[_0xcb58('0x28')]=_0x36671d['refresh_token'];logger[_0xcb58('0x29')](util[_0xcb58('0x1c')](_0xcb58('0x1d'),_0x556c11[_0xcb58('0x1e')],_0x556c11['id']));}else{logger[_0xcb58('0x21')](util[_0xcb58('0x1c')](_0xcb58('0x22'),_0x556c11[_0xcb58('0x1e')],_0x556c11['id']),util['inspect'](_0x36671d,{'showHidden':![],'depth':null}));}return _0x59ab5a(null,_0x57dd4c);})[_0xcb58('0x20')](function(_0x5215fa){logger[_0xcb58('0x21')](util[_0xcb58('0x1c')](_0xcb58('0x22'),_0x556c11[_0xcb58('0x1e')],_0x556c11['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x59ab5a(_0x5215fa);});}else{return _0x59ab5a(null,_0x57dd4c);}}}});}; \ No newline at end of file +var _0x46a6=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','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','name','inspect','slice','substring','https://accounts.zoho.com.au','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x269d9b,_0x55d1e8){var _0x518cf5=function(_0x56e7bf){while(--_0x56e7bf){_0x269d9b['push'](_0x269d9b['shift']());}};_0x518cf5(++_0x55d1e8);}(_0x46a6,0x1e6));var _0x646a=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x46a6[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x646a('0x0'));var util=require(_0x646a('0x1'));var logger=require(_0x646a('0x2'))(_0x646a('0x3'));var moment=require('moment');var BPromise=require(_0x646a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x646a('0x5'));var rimraf=require('rimraf');var config=require(_0x646a('0x6'));var attributes=require(_0x646a('0x7'));var integrations=require(_0x646a('0x8'));module['exports']=function(_0x29c5d5,_0x5a638b){return _0x29c5d5[_0x646a('0x9')](_0x646a('0xa'),attributes,{'tableName':_0x646a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x232769,_0x3cb036,_0x2d7d9c){if(_0x232769['changed']('zone')||_0x232769[_0x646a('0xc')](_0x646a('0xd'))||_0x232769['changed'](_0x646a('0xe'))||_0x232769['changed'](_0x646a('0xf'))||_0x232769['changed'](_0x646a('0x10'))||_0x232769[_0x646a('0xc')](_0x646a('0x11'))){var _0x1ff81a,_0x1930ec;_0x1ff81a=_0x232769[_0x646a('0xd')];var _0x31d116=_0x1ff81a['slice'](-0x1);if(_0x31d116==='/'||_0x31d116==='\x5c'||_0x31d116===':'){_0x1ff81a=_0x1ff81a['substring'](0x0,_0x1ff81a[_0x646a('0x12')](_0x31d116));}switch(_0x232769[_0x646a('0x13')]){case'US':_0x1930ec=_0x646a('0x14');break;case'AU':_0x1930ec='https://accounts.zoho.com.au';break;case'IN':_0x1930ec=_0x646a('0x15');break;case'CN':_0x1930ec=_0x646a('0x16');break;default:_0x1930ec=_0x646a('0x17');break;}var _0x1165c6={'method':_0x646a('0x18'),'uri':_0x1930ec+_0x646a('0x19'),'form':{'grant_type':_0x646a('0x1a'),'client_id':_0x232769[_0x646a('0xe')],'client_secret':_0x232769[_0x646a('0xf')],'redirect_uri':_0x232769[_0x646a('0xd')],'code':_0x232769[_0x646a('0x10')]},'headers':{'Content-Type':_0x646a('0x1b')}};return rp(_0x1165c6)[_0x646a('0x1c')](function(_0x1680e7){var _0x3fdd71=JSON[_0x646a('0x1d')](_0x1680e7);if(_0x3fdd71[_0x646a('0x1e')]){_0x232769['refreshToken']=_0x3fdd71[_0x646a('0x1e')];logger[_0x646a('0x1f')](util[_0x646a('0x20')](_0x646a('0x21'),_0x232769['name'],_0x232769['id']));}else{logger[_0x646a('0x22')](util[_0x646a('0x20')](_0x646a('0x23'),_0x232769['name'],_0x232769['id']),util['inspect'](_0x3fdd71,{'showHidden':![],'depth':null}));}return _0x2d7d9c(null,_0x3cb036);})['catch'](function(_0x3b7f66){logger[_0x646a('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x232769[_0x646a('0x24')],_0x232769['id']),util[_0x646a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2d7d9c(_0x3b7f66);});}else{return _0x2d7d9c(null,_0x3cb036);}},'beforeUpdate':function(_0x506fa9,_0x2176c0,_0x35ac13){if(_0x506fa9[_0x646a('0xc')](_0x646a('0x13'))||_0x506fa9[_0x646a('0xc')](_0x646a('0xd'))||_0x506fa9[_0x646a('0xc')]('clientId')||_0x506fa9[_0x646a('0xc')](_0x646a('0xf'))||_0x506fa9['changed'](_0x646a('0x10'))||_0x506fa9[_0x646a('0xc')](_0x646a('0x11'))){var _0xf56e32,_0x1870ca;_0xf56e32=_0x506fa9[_0x646a('0xd')];var _0x4d4de6=_0xf56e32[_0x646a('0x26')](-0x1);if(_0x4d4de6==='/'||_0x4d4de6==='\x5c'||_0x4d4de6===':'){_0xf56e32=_0xf56e32[_0x646a('0x27')](0x0,_0xf56e32[_0x646a('0x12')](_0x4d4de6));}switch(_0x506fa9[_0x646a('0x13')]){case'US':_0x1870ca='https://accounts.zoho.com';break;case'AU':_0x1870ca=_0x646a('0x28');break;case'IN':_0x1870ca=_0x646a('0x15');break;case'CN':_0x1870ca=_0x646a('0x16');break;default:_0x1870ca=_0x646a('0x17');break;}var _0x2bab01={'method':_0x646a('0x18'),'uri':_0x1870ca+_0x646a('0x19'),'form':{'grant_type':_0x646a('0x1a'),'client_id':_0x506fa9[_0x646a('0xe')],'client_secret':_0x506fa9['clientSecret'],'redirect_uri':_0x506fa9[_0x646a('0xd')],'code':_0x506fa9['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2bab01)['then'](function(_0x1cb396){var _0x349814=JSON['parse'](_0x1cb396);if(_0x349814[_0x646a('0x1e')]){_0x506fa9['refreshToken']=_0x349814[_0x646a('0x1e')];logger['info'](util[_0x646a('0x20')](_0x646a('0x21'),_0x506fa9[_0x646a('0x24')],_0x506fa9['id']));}else{logger[_0x646a('0x22')](util[_0x646a('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x506fa9['name'],_0x506fa9['id']),util['inspect'](_0x349814,{'showHidden':![],'depth':null}));}return _0x35ac13(null,_0x2176c0);})['catch'](function(_0x20dced){logger[_0x646a('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x506fa9['name'],_0x506fa9['id']),util[_0x646a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x35ac13(_0x20dced);});}else{return _0x35ac13(null,_0x2176c0);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index bb83511..d19d8f8 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 _0x8e3f=['ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});}; \ No newline at end of file +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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xce62,0x83));var _0x2ce6=function(_0x7f57d2,_0x1dd696){_0x7f57d2=_0x7f57d2-0x0;var _0x1759da=_0xce62[_0x7f57d2];return _0x1759da;};'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 diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 4683d30..e135f4c 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 _0xb649=['getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/fields','getFields','/:id/subjects','isAuthenticated'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xb649,0x129));var _0x9b64=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0xb649[_0x57a670];return _0x41ce21;};'use strict';var multer=require(_0x9b64('0x0'));var util=require(_0x9b64('0x1'));var path=require(_0x9b64('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b64('0x3'));var router=express['Router']();var fs_extra=require(_0x9b64('0x4'));var auth=require(_0x9b64('0x5'));var interaction=require(_0x9b64('0x6'));var config=require(_0x9b64('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x9b64('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b64('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9b64('0xa')]);router['get'](_0x9b64('0xb'),auth['isAuthenticated'](),controller[_0x9b64('0xc')]);router[_0x9b64('0x8')](_0x9b64('0xd'),auth[_0x9b64('0xe')](),controller[_0x9b64('0xf')]);router['get'](_0x9b64('0x10'),auth['isAuthenticated'](),controller[_0x9b64('0x11')]);router[_0x9b64('0x12')]('/',auth[_0x9b64('0xe')](),controller[_0x9b64('0x13')]);router['put'](_0x9b64('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x9b64('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9b64('0x16')]);module[_0x9b64('0x17')]=router; \ No newline at end of file +var _0xc0d4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','util'];(function(_0x1bf616,_0x12b164){var _0x1ab4ed=function(_0x35477a){while(--_0x35477a){_0x1bf616['push'](_0x1bf616['shift']());}};_0x1ab4ed(++_0x12b164);}(_0xc0d4,0xfb));var _0x4c0d=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc0d4[_0x313c96];return _0x522f53;};'use strict';var multer=require(_0x4c0d('0x0'));var util=require(_0x4c0d('0x1'));var path=require('path');var timeout=require(_0x4c0d('0x2'));var express=require(_0x4c0d('0x3'));var router=express[_0x4c0d('0x4')]();var fs_extra=require(_0x4c0d('0x5'));var auth=require(_0x4c0d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4c0d('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x4c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x4c0d('0x9')]);router['get'](_0x4c0d('0xa'),auth[_0x4c0d('0xb')](),controller[_0x4c0d('0xc')]);router[_0x4c0d('0x8')](_0x4c0d('0xd'),auth[_0x4c0d('0xb')](),controller['getFields']);router[_0x4c0d('0x8')]('/:id/subjects',auth[_0x4c0d('0xb')](),controller[_0x4c0d('0xe')]);router[_0x4c0d('0x8')](_0x4c0d('0xf'),auth[_0x4c0d('0xb')](),controller[_0x4c0d('0x10')]);router[_0x4c0d('0x11')]('/',auth[_0x4c0d('0xb')](),controller[_0x4c0d('0x12')]);router['put'](_0x4c0d('0xa'),auth[_0x4c0d('0xb')](),controller[_0x4c0d('0x13')]);router[_0x4c0d('0x14')](_0x4c0d('0xa'),auth['isAuthenticated'](),controller[_0x4c0d('0x15')]);module[_0x4c0d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index b365663..6ea0dd7 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 _0x23c9=['lead','nothing','contact_lead','contact','exports','STRING','ENUM'];(function(_0x37e56b,_0x66874f){var _0x34c9c8=function(_0x35f5d6){while(--_0x35f5d6){_0x37e56b['push'](_0x37e56b['shift']());}};_0x34c9c8(++_0x66874f);}(_0x23c9,0x1a1));var _0x923c=function(_0x540fb4,_0x464ce9){_0x540fb4=_0x540fb4-0x0;var _0x57de2c=_0x23c9[_0x540fb4];return _0x57de2c;};'use strict';var Sequelize=require('sequelize');module[_0x923c('0x0')]={'name':{'type':Sequelize[_0x923c('0x1')]},'moduleCreate':{'type':Sequelize[_0x923c('0x2')](_0x923c('0x3'),'contact',_0x923c('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x923c('0x2')](_0x923c('0x5'),_0x923c('0x6'),'lead'),'defaultValue':_0x923c('0x5')},'description':{'type':Sequelize[_0x923c('0x1')]}}; \ No newline at end of file +var _0x01c9=['STRING','lead','contact','contact_lead','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01c9,0x1a3));var _0x901c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01c9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x901c('0x0')]={'name':{'type':Sequelize[_0x901c('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x901c('0x2'),_0x901c('0x3'),'nothing'),'defaultValue':_0x901c('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x901c('0x4'),_0x901c('0x3'),_0x901c('0x2')),'defaultValue':_0x901c('0x4')},'description':{'type':Sequelize[_0x901c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c23b1b6..2a24a90 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 _0x8de9=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','keys','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8de9,0x91));var _0x98de=function(_0x1f8dc0,_0x3d20c7){_0x1f8dc0=_0x1f8dc0-0x0;var _0x53b469=_0x8de9[_0x1f8dc0];return _0x53b469;};'use strict';var emlformat=require(_0x98de('0x0'));var rimraf=require(_0x98de('0x1'));var zipdir=require(_0x98de('0x2'));var jsonpatch=require(_0x98de('0x3'));var rp=require(_0x98de('0x4'));var moment=require(_0x98de('0x5'));var BPromise=require(_0x98de('0x6'));var Mustache=require(_0x98de('0x7'));var util=require(_0x98de('0x8'));var path=require(_0x98de('0x9'));var sox=require(_0x98de('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98de('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x98de('0xc'));var jsforce=require(_0x98de('0xd'));var deskjs=require(_0x98de('0xe'));var toCsv=require(_0x98de('0xf'));var querystring=require('querystring');var Papa=require(_0x98de('0x10'));var Redis=require(_0x98de('0x11'));var authService=require(_0x98de('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x98de('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x98de('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x98de('0x15'));var db=require(_0x98de('0x16'))['db'];function respondWithStatusCode(_0x1eee35,_0x25c08e){_0x25c08e=_0x25c08e||0xcc;return function(_0x192b59){if(_0x192b59){return _0x1eee35['sendStatus'](_0x25c08e);}return _0x1eee35[_0x98de('0x17')](_0x25c08e)['end']();};}function respondWithResult(_0x38a738,_0x3eef3c){_0x3eef3c=_0x3eef3c||0xc8;return function(_0x161330){if(_0x161330){return _0x38a738[_0x98de('0x17')](_0x3eef3c)[_0x98de('0x18')](_0x161330);}};}function respondWithFilteredResult(_0x3e4462,_0x522c47){return function(_0x451758){if(_0x451758){var _0x1c3f23=typeof _0x522c47[_0x98de('0x19')]===_0x98de('0x1a')&&typeof _0x522c47[_0x98de('0x1b')]===_0x98de('0x1a');var _0x54f577=_0x451758[_0x98de('0x1c')];var _0x46e8c4=_0x1c3f23?0x0:_0x522c47['offset'];var _0x207e4c=_0x1c3f23?_0x451758['count']:_0x522c47[_0x98de('0x19')]+_0x522c47[_0x98de('0x1b')];var _0x383a34;if(_0x207e4c>=_0x54f577){_0x207e4c=_0x54f577;_0x383a34=0xc8;}else{_0x383a34=0xce;}_0x3e4462[_0x98de('0x17')](_0x383a34);return _0x3e4462[_0x98de('0x1d')](_0x98de('0x1e'),_0x46e8c4+'-'+_0x207e4c+'/'+_0x54f577)[_0x98de('0x18')](_0x451758);}return null;};}function patchUpdates(_0x5619f3){return function(_0x4108f3){try{jsonpatch[_0x98de('0x1f')](_0x4108f3,_0x5619f3,!![]);}catch(_0x207c56){return BPromise[_0x98de('0x20')](_0x207c56);}return _0x4108f3['save']();};}function saveUpdates(_0x153747,_0x21386b){return function(_0x3fc83f){if(_0x3fc83f){return _0x3fc83f[_0x98de('0x21')](_0x153747)[_0x98de('0x22')](function(_0x5a0fa5){return _0x5a0fa5;});}return null;};}function removeEntity(_0x45f0d5,_0x1d0a7e){return function(_0x414ed8){if(_0x414ed8){return _0x414ed8['destroy']()[_0x98de('0x22')](function(){_0x45f0d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2e2c,_0x248456){return function(_0x3526fd){if(!_0x3526fd){_0x1c2e2c[_0x98de('0x23')](0x194);}return _0x3526fd;};}function handleError(_0x5622ab,_0x73e3bc){_0x73e3bc=_0x73e3bc||0x1f4;return function(_0x2fa079){logger[_0x98de('0x24')](_0x2fa079[_0x98de('0x25')]);if(_0x2fa079['name']){delete _0x2fa079[_0x98de('0x26')];}_0x5622ab[_0x98de('0x17')](_0x73e3bc)[_0x98de('0x27')](_0x2fa079);};}exports[_0x98de('0x28')]=function(_0x55ac8a,_0x42701d){var _0x222af4={},_0x38985d={},_0x5a414f={'count':0x0,'rows':[]};var _0xc79bca=_[_0x98de('0x29')](db[_0x98de('0x2a')]['rawAttributes'],function(_0x56b4d2){return{'name':_0x56b4d2[_0x98de('0x2b')],'type':_0x56b4d2['type'][_0x98de('0x2c')]};});_0x38985d['model']=_['map'](_0xc79bca,_0x98de('0x26'));_0x38985d[_0x98de('0x2d')]=_['keys'](_0x55ac8a[_0x98de('0x2d')]);_0x38985d[_0x98de('0x2e')]=_[_0x98de('0x2f')](_0x38985d[_0x98de('0x30')],_0x38985d[_0x98de('0x2d')]);_0x222af4[_0x98de('0x31')]=_[_0x98de('0x2f')](_0x38985d[_0x98de('0x30')],qs[_0x98de('0x32')](_0x55ac8a[_0x98de('0x2d')][_0x98de('0x32')]));_0x222af4[_0x98de('0x31')]=_0x222af4[_0x98de('0x31')][_0x98de('0x33')]?_0x222af4[_0x98de('0x31')]:_0x38985d[_0x98de('0x30')];if(!_0x55ac8a['query'][_0x98de('0x34')](_0x98de('0x35'))){_0x222af4[_0x98de('0x1b')]=qs[_0x98de('0x1b')](_0x55ac8a[_0x98de('0x2d')][_0x98de('0x1b')]);_0x222af4[_0x98de('0x19')]=qs[_0x98de('0x19')](_0x55ac8a[_0x98de('0x2d')]['offset']);}_0x222af4[_0x98de('0x36')]=qs[_0x98de('0x37')](_0x55ac8a[_0x98de('0x2d')][_0x98de('0x37')]);_0x222af4[_0x98de('0x38')]=qs[_0x98de('0x2e')](_['pick'](_0x55ac8a['query'],_0x38985d[_0x98de('0x2e')]),_0xc79bca);if(_0x55ac8a[_0x98de('0x2d')][_0x98de('0x39')]){_0x222af4[_0x98de('0x38')]=_[_0x98de('0x3a')](_0x222af4[_0x98de('0x38')],{'$or':_[_0x98de('0x29')](_0xc79bca,function(_0x23dc4b){if(_0x23dc4b['type']!==_0x98de('0x3b')){var _0x181e96={};_0x181e96[_0x23dc4b[_0x98de('0x26')]]={'$like':'%'+_0x55ac8a[_0x98de('0x2d')]['filter']+'%'};return _0x181e96;}})});}_0x222af4=_[_0x98de('0x3a')]({},_0x222af4,_0x55ac8a[_0x98de('0x3c')]);var _0x1e060b={'where':_0x222af4['where']};return db[_0x98de('0x2a')][_0x98de('0x1c')](_0x1e060b)[_0x98de('0x22')](function(_0x2f9660){_0x5a414f[_0x98de('0x1c')]=_0x2f9660;if(_0x55ac8a['query'][_0x98de('0x3d')]){_0x222af4[_0x98de('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x98de('0x3f')](_0x222af4);})['then'](function(_0x85e30d){_0x5a414f[_0x98de('0x40')]=_0x85e30d;return _0x5a414f;})['then'](respondWithFilteredResult(_0x42701d,_0x222af4))[_0x98de('0x41')](handleError(_0x42701d,null));};exports[_0x98de('0x42')]=function(_0x3e1950,_0x582044){var _0x4bc648={'raw':![],'where':{'id':_0x3e1950[_0x98de('0x43')]['id']}},_0x8c63f1={};_0x8c63f1[_0x98de('0x30')]=_['keys'](db[_0x98de('0x2a')][_0x98de('0x44')]);_0x8c63f1[_0x98de('0x2d')]=_['keys'](_0x3e1950[_0x98de('0x2d')]);_0x8c63f1[_0x98de('0x2e')]=_[_0x98de('0x2f')](_0x8c63f1[_0x98de('0x30')],_0x8c63f1[_0x98de('0x2d')]);_0x4bc648[_0x98de('0x31')]=_['intersection'](_0x8c63f1[_0x98de('0x30')],qs[_0x98de('0x32')](_0x3e1950[_0x98de('0x2d')]['fields']));_0x4bc648['attributes']=_0x4bc648[_0x98de('0x31')][_0x98de('0x33')]?_0x4bc648[_0x98de('0x31')]:_0x8c63f1[_0x98de('0x30')];if(_0x3e1950[_0x98de('0x2d')]['includeAll']){_0x4bc648[_0x98de('0x3e')]=[{'all':!![]}];}_0x4bc648=_['merge']({},_0x4bc648,_0x3e1950[_0x98de('0x3c')]);return db['ZohoConfiguration'][_0x98de('0x45')](_0x4bc648)[_0x98de('0x22')](handleEntityNotFound(_0x582044,null))[_0x98de('0x22')](respondWithResult(_0x582044,null))[_0x98de('0x41')](handleError(_0x582044,null));};exports[_0x98de('0x46')]=function(_0x184a57,_0x295f8e){return db[_0x98de('0x2a')][_0x98de('0x46')](_0x184a57[_0x98de('0x47')],{})['then'](respondWithResult(_0x295f8e,0xc9))[_0x98de('0x41')](handleError(_0x295f8e,null));};exports[_0x98de('0x21')]=function(_0x474e61,_0x27507b){if(_0x474e61[_0x98de('0x47')]['id']){delete _0x474e61[_0x98de('0x47')]['id'];}return db[_0x98de('0x2a')][_0x98de('0x45')]({'where':{'id':_0x474e61['params']['id']}})[_0x98de('0x22')](handleEntityNotFound(_0x27507b,null))[_0x98de('0x22')](saveUpdates(_0x474e61[_0x98de('0x47')],null))[_0x98de('0x22')](respondWithResult(_0x27507b,null))[_0x98de('0x41')](handleError(_0x27507b,null));};exports['destroy']=function(_0x19e92b,_0x708bca){return db[_0x98de('0x2a')][_0x98de('0x45')]({'where':{'id':_0x19e92b['params']['id']}})[_0x98de('0x22')](handleEntityNotFound(_0x708bca,null))[_0x98de('0x22')](removeEntity(_0x708bca,null))[_0x98de('0x41')](handleError(_0x708bca,null));};exports[_0x98de('0x48')]=function(_0x234cd0,_0x734465,_0x5e12e7){var _0x1058b9={};var _0x3e3364={};var _0x23f13d;var _0x373bed;return db[_0x98de('0x2a')][_0x98de('0x49')]({'where':{'id':_0x234cd0[_0x98de('0x43')]['id']}})[_0x98de('0x22')](handleEntityNotFound(_0x734465,null))[_0x98de('0x22')](function(_0x30adcd){if(_0x30adcd){_0x23f13d=_0x30adcd;_0x3e3364['model']=_[_0x98de('0x4a')](db[_0x98de('0x4b')][_0x98de('0x44')]);_0x3e3364[_0x98de('0x2d')]=_['keys'](_0x234cd0[_0x98de('0x2d')]);_0x3e3364[_0x98de('0x2e')]=_[_0x98de('0x2f')](_0x3e3364[_0x98de('0x30')],_0x3e3364[_0x98de('0x2d')]);_0x1058b9['attributes']=_[_0x98de('0x2f')](_0x3e3364['model'],qs['fields'](_0x234cd0[_0x98de('0x2d')][_0x98de('0x32')]));_0x1058b9[_0x98de('0x31')]=_0x1058b9[_0x98de('0x31')][_0x98de('0x33')]?_0x1058b9['attributes']:_0x3e3364[_0x98de('0x30')];_0x1058b9['order']=qs['sort'](_0x234cd0['query'][_0x98de('0x37')]);_0x1058b9['where']=qs['filters'](_[_0x98de('0x4c')](_0x234cd0['query'],_0x3e3364[_0x98de('0x2e')]));if(_0x234cd0[_0x98de('0x2d')][_0x98de('0x39')]){_0x1058b9[_0x98de('0x38')]=_[_0x98de('0x3a')](_0x1058b9[_0x98de('0x38')],{'$or':_[_0x98de('0x29')](_0x1058b9[_0x98de('0x31')],function(_0x459076){var _0x431dc8={};_0x431dc8[_0x459076]={'$like':'%'+_0x234cd0[_0x98de('0x2d')][_0x98de('0x39')]+'%'};return _0x431dc8;})});}_0x1058b9=_['merge']({},_0x1058b9,_0x234cd0[_0x98de('0x3c')]);return _0x23f13d[_0x98de('0x48')](_0x1058b9);}})[_0x98de('0x22')](function(_0x59ed61){if(_0x59ed61){_0x373bed=_0x59ed61[_0x98de('0x33')];if(!_0x234cd0['query']['hasOwnProperty']('nolimit')){_0x1058b9[_0x98de('0x1b')]=qs[_0x98de('0x1b')](_0x234cd0[_0x98de('0x2d')]['limit']);_0x1058b9[_0x98de('0x19')]=qs[_0x98de('0x19')](_0x234cd0[_0x98de('0x2d')][_0x98de('0x19')]);}return _0x23f13d['getFields'](_0x1058b9);}})[_0x98de('0x22')](function(_0x471759){if(_0x471759){return _0x471759?{'count':_0x373bed,'rows':_0x471759}:null;}})[_0x98de('0x22')](respondWithResult(_0x734465,null))['catch'](handleError(_0x734465,null));};exports[_0x98de('0x4d')]=function(_0x4afaa8,_0x78b0f3,_0x4eeb3f){var _0x18f1b4={};var _0x1ab551={};var _0x5de225;var _0x5933aa;return db[_0x98de('0x2a')][_0x98de('0x49')]({'where':{'id':_0x4afaa8[_0x98de('0x43')]['id']}})[_0x98de('0x22')](handleEntityNotFound(_0x78b0f3,null))[_0x98de('0x22')](function(_0x2ac9f9){if(_0x2ac9f9){_0x5de225=_0x2ac9f9;_0x1ab551[_0x98de('0x30')]=_[_0x98de('0x4a')](db[_0x98de('0x4b')][_0x98de('0x44')]);_0x1ab551[_0x98de('0x2d')]=_[_0x98de('0x4a')](_0x4afaa8['query']);_0x1ab551[_0x98de('0x2e')]=_[_0x98de('0x2f')](_0x1ab551[_0x98de('0x30')],_0x1ab551[_0x98de('0x2d')]);_0x18f1b4[_0x98de('0x31')]=_[_0x98de('0x2f')](_0x1ab551[_0x98de('0x30')],qs[_0x98de('0x32')](_0x4afaa8[_0x98de('0x2d')]['fields']));_0x18f1b4[_0x98de('0x31')]=_0x18f1b4[_0x98de('0x31')][_0x98de('0x33')]?_0x18f1b4[_0x98de('0x31')]:_0x1ab551[_0x98de('0x30')];_0x18f1b4['order']=qs[_0x98de('0x37')](_0x4afaa8[_0x98de('0x2d')][_0x98de('0x37')]);_0x18f1b4[_0x98de('0x38')]=qs[_0x98de('0x2e')](_[_0x98de('0x4c')](_0x4afaa8['query'],_0x1ab551[_0x98de('0x2e')]));if(_0x4afaa8[_0x98de('0x2d')][_0x98de('0x39')]){_0x18f1b4[_0x98de('0x38')]=_['merge'](_0x18f1b4['where'],{'$or':_['map'](_0x18f1b4[_0x98de('0x31')],function(_0x4a7930){var _0x56aff6={};_0x56aff6[_0x4a7930]={'$like':'%'+_0x4afaa8['query'][_0x98de('0x39')]+'%'};return _0x56aff6;})});}_0x18f1b4=_[_0x98de('0x3a')]({},_0x18f1b4,_0x4afaa8[_0x98de('0x3c')]);return _0x5de225[_0x98de('0x4d')](_0x18f1b4);}})[_0x98de('0x22')](function(_0x168b3b){if(_0x168b3b){_0x5933aa=_0x168b3b[_0x98de('0x33')];if(!_0x4afaa8[_0x98de('0x2d')][_0x98de('0x34')](_0x98de('0x35'))){_0x18f1b4['limit']=qs[_0x98de('0x1b')](_0x4afaa8[_0x98de('0x2d')][_0x98de('0x1b')]);_0x18f1b4['offset']=qs[_0x98de('0x19')](_0x4afaa8['query'][_0x98de('0x19')]);}return _0x5de225[_0x98de('0x4d')](_0x18f1b4);}})[_0x98de('0x22')](function(_0x54943b){if(_0x54943b){return _0x54943b?{'count':_0x5933aa,'rows':_0x54943b}:null;}})['then'](respondWithResult(_0x78b0f3,null))['catch'](handleError(_0x78b0f3,null));};exports[_0x98de('0x4e')]=function(_0x5d8c18,_0x587de4,_0x3477bf){var _0x345b2e={};var _0x1e49ae={};var _0x4d861a;var _0x3a3caa;return db['ZohoConfiguration'][_0x98de('0x49')]({'where':{'id':_0x5d8c18[_0x98de('0x43')]['id']}})[_0x98de('0x22')](handleEntityNotFound(_0x587de4,null))[_0x98de('0x22')](function(_0x3f8f04){if(_0x3f8f04){_0x4d861a=_0x3f8f04;_0x1e49ae['model']=_[_0x98de('0x4a')](db[_0x98de('0x4b')][_0x98de('0x44')]);_0x1e49ae['query']=_[_0x98de('0x4a')](_0x5d8c18[_0x98de('0x2d')]);_0x1e49ae[_0x98de('0x2e')]=_[_0x98de('0x2f')](_0x1e49ae['model'],_0x1e49ae[_0x98de('0x2d')]);_0x345b2e['attributes']=_[_0x98de('0x2f')](_0x1e49ae[_0x98de('0x30')],qs[_0x98de('0x32')](_0x5d8c18[_0x98de('0x2d')][_0x98de('0x32')]));_0x345b2e['attributes']=_0x345b2e[_0x98de('0x31')][_0x98de('0x33')]?_0x345b2e['attributes']:_0x1e49ae['model'];_0x345b2e[_0x98de('0x36')]=qs[_0x98de('0x37')](_0x5d8c18[_0x98de('0x2d')][_0x98de('0x37')]);_0x345b2e[_0x98de('0x38')]=qs['filters'](_[_0x98de('0x4c')](_0x5d8c18['query'],_0x1e49ae[_0x98de('0x2e')]));if(_0x5d8c18[_0x98de('0x2d')][_0x98de('0x39')]){_0x345b2e[_0x98de('0x38')]=_['merge'](_0x345b2e[_0x98de('0x38')],{'$or':_['map'](_0x345b2e[_0x98de('0x31')],function(_0x5cb152){var _0x3f893f={};_0x3f893f[_0x5cb152]={'$like':'%'+_0x5d8c18[_0x98de('0x2d')][_0x98de('0x39')]+'%'};return _0x3f893f;})});}_0x345b2e=_['merge']({},_0x345b2e,_0x5d8c18[_0x98de('0x3c')]);return _0x4d861a[_0x98de('0x4e')](_0x345b2e);}})[_0x98de('0x22')](function(_0x558b45){if(_0x558b45){_0x3a3caa=_0x558b45['length'];if(!_0x5d8c18[_0x98de('0x2d')][_0x98de('0x34')]('nolimit')){_0x345b2e[_0x98de('0x1b')]=qs[_0x98de('0x1b')](_0x5d8c18['query']['limit']);_0x345b2e['offset']=qs[_0x98de('0x19')](_0x5d8c18[_0x98de('0x2d')][_0x98de('0x19')]);}return _0x4d861a[_0x98de('0x4e')](_0x345b2e);}})['then'](function(_0x5c47ed){if(_0x5c47ed){return _0x5c47ed?{'count':_0x3a3caa,'rows':_0x5c47ed}:null;}})[_0x98de('0x22')](respondWithResult(_0x587de4,null))[_0x98de('0x41')](handleError(_0x587de4,null));}; \ No newline at end of file +var _0x6a56=['intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','ZohoConfiguration','then','includeAll','include','params','rawAttributes','find','catch','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','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','offset','undefined','limit','count','Content-Range','json','apply','error','stack','name','index','fieldName','type','key','map','query','keys','filters'];(function(_0x87eaa7,_0x288c0d){var _0x27a4cf=function(_0x468c30){while(--_0x468c30){_0x87eaa7['push'](_0x87eaa7['shift']());}};_0x27a4cf(++_0x288c0d);}(_0x6a56,0x15e));var _0x66a5=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x6a56[_0x5a60ce];return _0x393e5e;};'use strict';var emlformat=require(_0x66a5('0x0'));var rimraf=require(_0x66a5('0x1'));var zipdir=require(_0x66a5('0x2'));var jsonpatch=require(_0x66a5('0x3'));var rp=require(_0x66a5('0x4'));var moment=require(_0x66a5('0x5'));var BPromise=require(_0x66a5('0x6'));var Mustache=require(_0x66a5('0x7'));var util=require(_0x66a5('0x8'));var path=require(_0x66a5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66a5('0xa'));var _=require(_0x66a5('0xb'));var squel=require(_0x66a5('0xc'));var crypto=require(_0x66a5('0xd'));var jsforce=require(_0x66a5('0xe'));var deskjs=require(_0x66a5('0xf'));var toCsv=require(_0x66a5('0x10'));var querystring=require(_0x66a5('0x11'));var Papa=require(_0x66a5('0x12'));var Redis=require(_0x66a5('0x13'));var authService=require(_0x66a5('0x14'));var qs=require(_0x66a5('0x15'));var as=require(_0x66a5('0x16'));var hardwareService=require(_0x66a5('0x17'));var logger=require(_0x66a5('0x18'))(_0x66a5('0x19'));var utils=require(_0x66a5('0x1a'));var config=require(_0x66a5('0x1b'));var licenseUtil=require(_0x66a5('0x1c'));var db=require(_0x66a5('0x1d'))['db'];function respondWithStatusCode(_0x13ce07,_0x1115c6){_0x1115c6=_0x1115c6||0xcc;return function(_0x34b560){if(_0x34b560){return _0x13ce07['sendStatus'](_0x1115c6);}return _0x13ce07[_0x66a5('0x1e')](_0x1115c6)[_0x66a5('0x1f')]();};}function respondWithResult(_0x1c0c5a,_0x1ac286){_0x1ac286=_0x1ac286||0xc8;return function(_0x38c56b){if(_0x38c56b){return _0x1c0c5a[_0x66a5('0x1e')](_0x1ac286)['json'](_0x38c56b);}};}function respondWithFilteredResult(_0x23a563,_0x1a73a5){return function(_0x3232c4){if(_0x3232c4){var _0x12069d=typeof _0x1a73a5[_0x66a5('0x20')]===_0x66a5('0x21')&&typeof _0x1a73a5[_0x66a5('0x22')]===_0x66a5('0x21');var _0x572e0f=_0x3232c4['count'];var _0x43e262=_0x12069d?0x0:_0x1a73a5[_0x66a5('0x20')];var _0x449c2a=_0x12069d?_0x3232c4[_0x66a5('0x23')]:_0x1a73a5[_0x66a5('0x20')]+_0x1a73a5['limit'];var _0x40448a;if(_0x449c2a>=_0x572e0f){_0x449c2a=_0x572e0f;_0x40448a=0xc8;}else{_0x40448a=0xce;}_0x23a563[_0x66a5('0x1e')](_0x40448a);return _0x23a563['set'](_0x66a5('0x24'),_0x43e262+'-'+_0x449c2a+'/'+_0x572e0f)[_0x66a5('0x25')](_0x3232c4);}return null;};}function patchUpdates(_0x15e055){return function(_0x46e639){try{jsonpatch[_0x66a5('0x26')](_0x46e639,_0x15e055,!![]);}catch(_0x391b96){return BPromise['reject'](_0x391b96);}return _0x46e639['save']();};}function saveUpdates(_0x963232,_0x5a4be4){return function(_0x1ccce0){if(_0x1ccce0){return _0x1ccce0['update'](_0x963232)['then'](function(_0x3faa09){return _0x3faa09;});}return null;};}function removeEntity(_0x55901b,_0x1c43ac){return function(_0x4a4d51){if(_0x4a4d51){return _0x4a4d51['destroy']()['then'](function(){_0x55901b[_0x66a5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbb2a,_0x136d67){return function(_0x1822c7){if(!_0x1822c7){_0x5cbb2a['sendStatus'](0x194);}return _0x1822c7;};}function handleError(_0x1a9bfa,_0x3df585){_0x3df585=_0x3df585||0x1f4;return function(_0x1e7283){logger[_0x66a5('0x27')](_0x1e7283[_0x66a5('0x28')]);if(_0x1e7283[_0x66a5('0x29')]){delete _0x1e7283[_0x66a5('0x29')];}_0x1a9bfa[_0x66a5('0x1e')](_0x3df585)['send'](_0x1e7283);};}exports[_0x66a5('0x2a')]=function(_0x46fe0c,_0x2d84bf){var _0x316623={},_0x14020f={},_0x339c9a={'count':0x0,'rows':[]};var _0x41cab5=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x1e00cc){return{'name':_0x1e00cc[_0x66a5('0x2b')],'type':_0x1e00cc[_0x66a5('0x2c')][_0x66a5('0x2d')]};});_0x14020f['model']=_[_0x66a5('0x2e')](_0x41cab5,'name');_0x14020f[_0x66a5('0x2f')]=_[_0x66a5('0x30')](_0x46fe0c[_0x66a5('0x2f')]);_0x14020f[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x14020f['model'],_0x14020f[_0x66a5('0x2f')]);_0x316623[_0x66a5('0x33')]=_[_0x66a5('0x32')](_0x14020f[_0x66a5('0x34')],qs[_0x66a5('0x35')](_0x46fe0c['query']['fields']));_0x316623[_0x66a5('0x33')]=_0x316623[_0x66a5('0x33')][_0x66a5('0x36')]?_0x316623[_0x66a5('0x33')]:_0x14020f[_0x66a5('0x34')];if(!_0x46fe0c['query'][_0x66a5('0x37')](_0x66a5('0x38'))){_0x316623['limit']=qs[_0x66a5('0x22')](_0x46fe0c[_0x66a5('0x2f')][_0x66a5('0x22')]);_0x316623[_0x66a5('0x20')]=qs[_0x66a5('0x20')](_0x46fe0c['query']['offset']);}_0x316623[_0x66a5('0x39')]=qs[_0x66a5('0x3a')](_0x46fe0c[_0x66a5('0x2f')][_0x66a5('0x3a')]);_0x316623['where']=qs[_0x66a5('0x31')](_[_0x66a5('0x3b')](_0x46fe0c[_0x66a5('0x2f')],_0x14020f['filters']),_0x41cab5);if(_0x46fe0c['query'][_0x66a5('0x3c')]){_0x316623['where']=_[_0x66a5('0x3d')](_0x316623[_0x66a5('0x3e')],{'$or':_[_0x66a5('0x2e')](_0x41cab5,function(_0x21209f){if(_0x21209f[_0x66a5('0x2c')]!==_0x66a5('0x3f')){var _0x3f3e48={};_0x3f3e48[_0x21209f['name']]={'$like':'%'+_0x46fe0c[_0x66a5('0x2f')][_0x66a5('0x3c')]+'%'};return _0x3f3e48;}})});}_0x316623=_[_0x66a5('0x3d')]({},_0x316623,_0x46fe0c[_0x66a5('0x40')]);var _0x543c24={'where':_0x316623[_0x66a5('0x3e')]};return db[_0x66a5('0x41')]['count'](_0x543c24)[_0x66a5('0x42')](function(_0x58d770){_0x339c9a[_0x66a5('0x23')]=_0x58d770;if(_0x46fe0c[_0x66a5('0x2f')][_0x66a5('0x43')]){_0x316623[_0x66a5('0x44')]=[{'all':!![]}];}return db[_0x66a5('0x41')]['findAll'](_0x316623);})[_0x66a5('0x42')](function(_0x44b26f){_0x339c9a['rows']=_0x44b26f;return _0x339c9a;})[_0x66a5('0x42')](respondWithFilteredResult(_0x2d84bf,_0x316623))['catch'](handleError(_0x2d84bf,null));};exports['show']=function(_0x5027c1,_0x1b27dc){var _0x3863ff={'raw':![],'where':{'id':_0x5027c1[_0x66a5('0x45')]['id']}},_0x22d293={};_0x22d293[_0x66a5('0x34')]=_[_0x66a5('0x30')](db[_0x66a5('0x41')][_0x66a5('0x46')]);_0x22d293[_0x66a5('0x2f')]=_[_0x66a5('0x30')](_0x5027c1[_0x66a5('0x2f')]);_0x22d293[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x22d293['model'],_0x22d293['query']);_0x3863ff[_0x66a5('0x33')]=_[_0x66a5('0x32')](_0x22d293[_0x66a5('0x34')],qs[_0x66a5('0x35')](_0x5027c1[_0x66a5('0x2f')][_0x66a5('0x35')]));_0x3863ff[_0x66a5('0x33')]=_0x3863ff[_0x66a5('0x33')][_0x66a5('0x36')]?_0x3863ff[_0x66a5('0x33')]:_0x22d293[_0x66a5('0x34')];if(_0x5027c1[_0x66a5('0x2f')][_0x66a5('0x43')]){_0x3863ff[_0x66a5('0x44')]=[{'all':!![]}];}_0x3863ff=_[_0x66a5('0x3d')]({},_0x3863ff,_0x5027c1[_0x66a5('0x40')]);return db[_0x66a5('0x41')][_0x66a5('0x47')](_0x3863ff)[_0x66a5('0x42')](handleEntityNotFound(_0x1b27dc,null))[_0x66a5('0x42')](respondWithResult(_0x1b27dc,null))[_0x66a5('0x48')](handleError(_0x1b27dc,null));};exports['create']=function(_0x391e71,_0xf5c187){return db[_0x66a5('0x41')][_0x66a5('0x49')](_0x391e71[_0x66a5('0x4a')],{})[_0x66a5('0x42')](respondWithResult(_0xf5c187,0xc9))[_0x66a5('0x48')](handleError(_0xf5c187,null));};exports['update']=function(_0x55e444,_0x599c69){if(_0x55e444[_0x66a5('0x4a')]['id']){delete _0x55e444[_0x66a5('0x4a')]['id'];}return db['ZohoConfiguration'][_0x66a5('0x47')]({'where':{'id':_0x55e444[_0x66a5('0x45')]['id']}})[_0x66a5('0x42')](handleEntityNotFound(_0x599c69,null))[_0x66a5('0x42')](saveUpdates(_0x55e444[_0x66a5('0x4a')],null))['then'](respondWithResult(_0x599c69,null))[_0x66a5('0x48')](handleError(_0x599c69,null));};exports['destroy']=function(_0x340c15,_0x5c7746){return db['ZohoConfiguration'][_0x66a5('0x47')]({'where':{'id':_0x340c15[_0x66a5('0x45')]['id']}})[_0x66a5('0x42')](handleEntityNotFound(_0x5c7746,null))[_0x66a5('0x42')](removeEntity(_0x5c7746,null))[_0x66a5('0x48')](handleError(_0x5c7746,null));};exports[_0x66a5('0x4b')]=function(_0x517a3d,_0x5db5bc,_0x4e6c93){var _0x46aa7d={};var _0x4d8e09={};var _0x2bb2fb;var _0x518ff1;return db[_0x66a5('0x41')][_0x66a5('0x4c')]({'where':{'id':_0x517a3d[_0x66a5('0x45')]['id']}})[_0x66a5('0x42')](handleEntityNotFound(_0x5db5bc,null))['then'](function(_0x37c4e5){if(_0x37c4e5){_0x2bb2fb=_0x37c4e5;_0x4d8e09['model']=_[_0x66a5('0x30')](db[_0x66a5('0x4d')][_0x66a5('0x46')]);_0x4d8e09[_0x66a5('0x2f')]=_[_0x66a5('0x30')](_0x517a3d[_0x66a5('0x2f')]);_0x4d8e09[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x4d8e09[_0x66a5('0x34')],_0x4d8e09['query']);_0x46aa7d[_0x66a5('0x33')]=_[_0x66a5('0x32')](_0x4d8e09[_0x66a5('0x34')],qs['fields'](_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x35')]));_0x46aa7d[_0x66a5('0x33')]=_0x46aa7d['attributes'][_0x66a5('0x36')]?_0x46aa7d['attributes']:_0x4d8e09[_0x66a5('0x34')];_0x46aa7d[_0x66a5('0x39')]=qs[_0x66a5('0x3a')](_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x3a')]);_0x46aa7d['where']=qs[_0x66a5('0x31')](_['pick'](_0x517a3d[_0x66a5('0x2f')],_0x4d8e09['filters']));if(_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x3c')]){_0x46aa7d[_0x66a5('0x3e')]=_[_0x66a5('0x3d')](_0x46aa7d[_0x66a5('0x3e')],{'$or':_['map'](_0x46aa7d['attributes'],function(_0x17cab8){var _0x513ac8={};_0x513ac8[_0x17cab8]={'$like':'%'+_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x3c')]+'%'};return _0x513ac8;})});}_0x46aa7d=_[_0x66a5('0x3d')]({},_0x46aa7d,_0x517a3d[_0x66a5('0x40')]);return _0x2bb2fb[_0x66a5('0x4b')](_0x46aa7d);}})[_0x66a5('0x42')](function(_0x3491de){if(_0x3491de){_0x518ff1=_0x3491de['length'];if(!_0x517a3d[_0x66a5('0x2f')]['hasOwnProperty']('nolimit')){_0x46aa7d[_0x66a5('0x22')]=qs['limit'](_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x22')]);_0x46aa7d[_0x66a5('0x20')]=qs[_0x66a5('0x20')](_0x517a3d[_0x66a5('0x2f')][_0x66a5('0x20')]);}return _0x2bb2fb[_0x66a5('0x4b')](_0x46aa7d);}})['then'](function(_0x2ee42c){if(_0x2ee42c){return _0x2ee42c?{'count':_0x518ff1,'rows':_0x2ee42c}:null;}})[_0x66a5('0x42')](respondWithResult(_0x5db5bc,null))[_0x66a5('0x48')](handleError(_0x5db5bc,null));};exports[_0x66a5('0x4e')]=function(_0x5b7f0b,_0x41a7f1,_0x4f1c19){var _0x531ef1={};var _0x5aae09={};var _0xd2316c;var _0x416d21;return db['ZohoConfiguration'][_0x66a5('0x4c')]({'where':{'id':_0x5b7f0b['params']['id']}})['then'](handleEntityNotFound(_0x41a7f1,null))[_0x66a5('0x42')](function(_0x344f79){if(_0x344f79){_0xd2316c=_0x344f79;_0x5aae09[_0x66a5('0x34')]=_[_0x66a5('0x30')](db['ZohoField'][_0x66a5('0x46')]);_0x5aae09[_0x66a5('0x2f')]=_[_0x66a5('0x30')](_0x5b7f0b[_0x66a5('0x2f')]);_0x5aae09[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x5aae09[_0x66a5('0x34')],_0x5aae09[_0x66a5('0x2f')]);_0x531ef1[_0x66a5('0x33')]=_['intersection'](_0x5aae09[_0x66a5('0x34')],qs['fields'](_0x5b7f0b[_0x66a5('0x2f')]['fields']));_0x531ef1[_0x66a5('0x33')]=_0x531ef1[_0x66a5('0x33')][_0x66a5('0x36')]?_0x531ef1[_0x66a5('0x33')]:_0x5aae09[_0x66a5('0x34')];_0x531ef1[_0x66a5('0x39')]=qs[_0x66a5('0x3a')](_0x5b7f0b[_0x66a5('0x2f')][_0x66a5('0x3a')]);_0x531ef1['where']=qs[_0x66a5('0x31')](_['pick'](_0x5b7f0b[_0x66a5('0x2f')],_0x5aae09[_0x66a5('0x31')]));if(_0x5b7f0b[_0x66a5('0x2f')][_0x66a5('0x3c')]){_0x531ef1[_0x66a5('0x3e')]=_[_0x66a5('0x3d')](_0x531ef1[_0x66a5('0x3e')],{'$or':_[_0x66a5('0x2e')](_0x531ef1[_0x66a5('0x33')],function(_0xf51162){var _0x3e4704={};_0x3e4704[_0xf51162]={'$like':'%'+_0x5b7f0b['query']['filter']+'%'};return _0x3e4704;})});}_0x531ef1=_[_0x66a5('0x3d')]({},_0x531ef1,_0x5b7f0b[_0x66a5('0x40')]);return _0xd2316c[_0x66a5('0x4e')](_0x531ef1);}})['then'](function(_0x11cd10){if(_0x11cd10){_0x416d21=_0x11cd10['length'];if(!_0x5b7f0b[_0x66a5('0x2f')][_0x66a5('0x37')](_0x66a5('0x38'))){_0x531ef1['limit']=qs[_0x66a5('0x22')](_0x5b7f0b[_0x66a5('0x2f')][_0x66a5('0x22')]);_0x531ef1[_0x66a5('0x20')]=qs[_0x66a5('0x20')](_0x5b7f0b[_0x66a5('0x2f')]['offset']);}return _0xd2316c[_0x66a5('0x4e')](_0x531ef1);}})['then'](function(_0x4b1284){if(_0x4b1284){return _0x4b1284?{'count':_0x416d21,'rows':_0x4b1284}:null;}})['then'](respondWithResult(_0x41a7f1,null))['catch'](handleError(_0x41a7f1,null));};exports[_0x66a5('0x4f')]=function(_0x333347,_0xd6a8e3,_0x49cae3){var _0x535159={};var _0x57a200={};var _0x5e2b96;var _0x338d8f;return db[_0x66a5('0x41')][_0x66a5('0x4c')]({'where':{'id':_0x333347['params']['id']}})[_0x66a5('0x42')](handleEntityNotFound(_0xd6a8e3,null))[_0x66a5('0x42')](function(_0xda8167){if(_0xda8167){_0x5e2b96=_0xda8167;_0x57a200['model']=_[_0x66a5('0x30')](db['ZohoField'][_0x66a5('0x46')]);_0x57a200[_0x66a5('0x2f')]=_['keys'](_0x333347[_0x66a5('0x2f')]);_0x57a200['filters']=_[_0x66a5('0x32')](_0x57a200['model'],_0x57a200[_0x66a5('0x2f')]);_0x535159[_0x66a5('0x33')]=_[_0x66a5('0x32')](_0x57a200[_0x66a5('0x34')],qs[_0x66a5('0x35')](_0x333347[_0x66a5('0x2f')][_0x66a5('0x35')]));_0x535159[_0x66a5('0x33')]=_0x535159['attributes'][_0x66a5('0x36')]?_0x535159[_0x66a5('0x33')]:_0x57a200['model'];_0x535159[_0x66a5('0x39')]=qs[_0x66a5('0x3a')](_0x333347[_0x66a5('0x2f')][_0x66a5('0x3a')]);_0x535159['where']=qs['filters'](_[_0x66a5('0x3b')](_0x333347[_0x66a5('0x2f')],_0x57a200[_0x66a5('0x31')]));if(_0x333347[_0x66a5('0x2f')][_0x66a5('0x3c')]){_0x535159[_0x66a5('0x3e')]=_['merge'](_0x535159['where'],{'$or':_['map'](_0x535159[_0x66a5('0x33')],function(_0x24fc41){var _0x5943b0={};_0x5943b0[_0x24fc41]={'$like':'%'+_0x333347['query'][_0x66a5('0x3c')]+'%'};return _0x5943b0;})});}_0x535159=_[_0x66a5('0x3d')]({},_0x535159,_0x333347[_0x66a5('0x40')]);return _0x5e2b96['getDescriptions'](_0x535159);}})['then'](function(_0x1989ff){if(_0x1989ff){_0x338d8f=_0x1989ff[_0x66a5('0x36')];if(!_0x333347[_0x66a5('0x2f')][_0x66a5('0x37')](_0x66a5('0x38'))){_0x535159[_0x66a5('0x22')]=qs[_0x66a5('0x22')](_0x333347[_0x66a5('0x2f')][_0x66a5('0x22')]);_0x535159[_0x66a5('0x20')]=qs[_0x66a5('0x20')](_0x333347[_0x66a5('0x2f')][_0x66a5('0x20')]);}return _0x5e2b96[_0x66a5('0x4f')](_0x535159);}})[_0x66a5('0x42')](function(_0x259dc3){if(_0x259dc3){return _0x259dc3?{'count':_0x338d8f,'rows':_0x259dc3}:null;}})[_0x66a5('0x42')](respondWithResult(_0xd6a8e3,null))[_0x66a5('0x48')](handleError(_0xd6a8e3,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 29f5a00..bb14762 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 _0x425b=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x5361d1,_0x28d46e){var _0x5ca916=function(_0x17d9e9){while(--_0x17d9e9){_0x5361d1['push'](_0x5361d1['shift']());}};_0x5ca916(++_0x28d46e);}(_0x425b,0x1cb));var _0xb425=function(_0x524cbf,_0x49131f){_0x524cbf=_0x524cbf-0x0;var _0x4817f2=_0x425b[_0x524cbf];return _0x4817f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb425('0x0'))('api');var moment=require(_0xb425('0x1'));var BPromise=require(_0xb425('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb425('0x3'));var rimraf=require(_0xb425('0x4'));var config=require(_0xb425('0x5'));var attributes=require(_0xb425('0x6'));module[_0xb425('0x7')]=function(_0x4d7a7c,_0x143e76){return _0x4d7a7c[_0xb425('0x8')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2156=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0x2156,0x107));var _0x6215=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2156[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x6215('0x0'));var logger=require(_0x6215('0x1'))(_0x6215('0x2'));var moment=require(_0x6215('0x3'));var BPromise=require('bluebird');var rp=require(_0x6215('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6215('0x5'));var config=require(_0x6215('0x6'));var attributes=require(_0x6215('0x7'));module[_0x6215('0x8')]=function(_0x36eeae,_0x43f0b5){return _0x36eeae[_0x6215('0x9')](_0x6215('0xa'),attributes,{'tableName':_0x6215('0xb'),'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 64ef4aa..e12e751 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 _0xa810=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x4eef8a,_0x358d25){var _0x5e1991=function(_0x32f1e0){while(--_0x32f1e0){_0x4eef8a['push'](_0x4eef8a['shift']());}};_0x5e1991(++_0x358d25);}(_0xa810,0xdc));var _0x0a81=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0xa810[_0x3f52ee];return _0x4f7924;};'use strict';var _=require('lodash');var util=require(_0x0a81('0x0'));var moment=require(_0x0a81('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a81('0x2'));var fs=require('fs');var Redis=require(_0x0a81('0x3'));var db=require(_0x0a81('0x4'))['db'];var utils=require(_0x0a81('0x5'));var logger=require(_0x0a81('0x6'))(_0x0a81('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0a81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x439abe,_0x259272,_0x2efbbe){return new BPromise(function(_0x48a493,_0xaabad5){return client[_0x0a81('0x9')](_0x439abe,_0x2efbbe)[_0x0a81('0xa')](function(_0x4e71c2){logger[_0x0a81('0xb')](_0x0a81('0xc'),_0x259272,'request\x20sent');logger[_0x0a81('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x259272,_0x0a81('0xe'),JSON[_0x0a81('0xf')](_0x4e71c2));if(_0x4e71c2[_0x0a81('0x10')]){if(_0x4e71c2['error']['code']===0x1f4){logger[_0x0a81('0x10')](_0x0a81('0xc'),_0x259272,_0x4e71c2[_0x0a81('0x10')][_0x0a81('0x11')]);return _0xaabad5(_0x4e71c2[_0x0a81('0x10')][_0x0a81('0x11')]);}logger['error'](_0x0a81('0xc'),_0x259272,_0x4e71c2['error'][_0x0a81('0x11')]);return _0x48a493(_0x4e71c2['error']['message']);}else{logger[_0x0a81('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x259272,_0x0a81('0xe'));_0x48a493(_0x4e71c2[_0x0a81('0x12')][_0x0a81('0x11')]);}})[_0x0a81('0x13')](function(_0x2c0144){logger[_0x0a81('0x10')](_0x0a81('0xc'),_0x259272,_0x2c0144);_0xaabad5(_0x2c0144);});});} \ No newline at end of file +var _0x30b8=['then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x30b8,0xd1));var _0x830b=function(_0x2c4fe9,_0x4e5bb4){_0x2c4fe9=_0x2c4fe9-0x0;var _0x5c2eb3=_0x30b8[_0x2c4fe9];return _0x5c2eb3;};'use strict';var _=require(_0x830b('0x0'));var util=require(_0x830b('0x1'));var moment=require(_0x830b('0x2'));var BPromise=require(_0x830b('0x3'));var rs=require(_0x830b('0x4'));var fs=require('fs');var Redis=require(_0x830b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x830b('0x6'));var config=require(_0x830b('0x7'));var jayson=require(_0x830b('0x8'));var client=jayson[_0x830b('0x9')][_0x830b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31d4cf,_0x51305e,_0x2d406f){return new BPromise(function(_0x5ac8a0,_0x4feb32){return client['request'](_0x31d4cf,_0x2d406f)[_0x830b('0xb')](function(_0x6b6ada){logger['info'](_0x830b('0xc'),_0x51305e,_0x830b('0xd'));logger[_0x830b('0xe')](_0x830b('0xf'),_0x51305e,'request\x20sent',JSON[_0x830b('0x10')](_0x6b6ada));if(_0x6b6ada[_0x830b('0x11')]){if(_0x6b6ada[_0x830b('0x11')][_0x830b('0x12')]===0x1f4){logger[_0x830b('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x51305e,_0x6b6ada[_0x830b('0x11')]['message']);return _0x4feb32(_0x6b6ada[_0x830b('0x11')][_0x830b('0x13')]);}logger[_0x830b('0x11')](_0x830b('0xc'),_0x51305e,_0x6b6ada[_0x830b('0x11')][_0x830b('0x13')]);return _0x5ac8a0(_0x6b6ada[_0x830b('0x11')]['message']);}else{logger[_0x830b('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x51305e,_0x830b('0xd'));_0x5ac8a0(_0x6b6ada[_0x830b('0x15')][_0x830b('0x13')]);}})['catch'](function(_0x1a9867){logger[_0x830b('0x11')](_0x830b('0xc'),_0x51305e,_0x1a9867);_0x4feb32(_0x1a9867);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index c957e52..e719be9 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 _0xa623=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4e0f9e,_0x1cafaa){var _0x225e38=function(_0x9deca7){while(--_0x9deca7){_0x4e0f9e['push'](_0x4e0f9e['shift']());}};_0x225e38(++_0x1cafaa);}(_0xa623,0x1c4));var _0x3a62=function(_0x3c04c6,_0x11168f){_0x3c04c6=_0x3c04c6-0x0;var _0x3d937b=_0xa623[_0x3c04c6];return _0x3d937b;};'use strict';var multer=require('multer');var util=require(_0x3a62('0x0'));var path=require(_0x3a62('0x1'));var timeout=require(_0x3a62('0x2'));var express=require(_0x3a62('0x3'));var router=express[_0x3a62('0x4')]();var fs_extra=require(_0x3a62('0x5'));var auth=require(_0x3a62('0x6'));var interaction=require(_0x3a62('0x7'));var config=require(_0x3a62('0x8'));var controller=require(_0x3a62('0x9'));router[_0x3a62('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a62('0xa')](_0x3a62('0xb'),auth[_0x3a62('0xc')](),controller[_0x3a62('0xd')]);router['post']('/',auth[_0x3a62('0xc')](),controller[_0x3a62('0xe')]);router[_0x3a62('0xf')](_0x3a62('0xb'),auth[_0x3a62('0xc')](),controller['update']);router[_0x3a62('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3a62('0x11')]);module[_0x3a62('0x12')]=router; \ No newline at end of file +var _0xdb19=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d94b7,_0x5988e5){var _0x40a258=function(_0x3da766){while(--_0x3da766){_0x1d94b7['push'](_0x1d94b7['shift']());}};_0x40a258(++_0x5988e5);}(_0xdb19,0x1d4));var _0x9db1=function(_0x1c7cee,_0x36ea41){_0x1c7cee=_0x1c7cee-0x0;var _0x265506=_0xdb19[_0x1c7cee];return _0x265506;};'use strict';var multer=require(_0x9db1('0x0'));var util=require(_0x9db1('0x1'));var path=require(_0x9db1('0x2'));var timeout=require('connect-timeout');var express=require(_0x9db1('0x3'));var router=express[_0x9db1('0x4')]();var fs_extra=require(_0x9db1('0x5'));var auth=require(_0x9db1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9db1('0x7'));var controller=require(_0x9db1('0x8'));router[_0x9db1('0x9')]('/',auth[_0x9db1('0xa')](),controller[_0x9db1('0xb')]);router[_0x9db1('0x9')]('/:id',auth[_0x9db1('0xa')](),controller[_0x9db1('0xc')]);router[_0x9db1('0xd')]('/',auth['isAuthenticated'](),controller[_0x9db1('0xe')]);router['put'](_0x9db1('0xf'),auth[_0x9db1('0xa')](),controller['update']);router[_0x9db1('0x10')]('/:id',auth[_0x9db1('0xa')](),controller[_0x9db1('0x11')]);module[_0x9db1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 429173e..b129ab7 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 _0x8ccc=['STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x44d28c,_0x3a197b){var _0x754673=function(_0x5a5773){while(--_0x5a5773){_0x44d28c['push'](_0x44d28c['shift']());}};_0x754673(++_0x3a197b);}(_0x8ccc,0x6c));var _0xc8cc=function(_0xe95f8e,_0x5e962e){_0xe95f8e=_0xe95f8e-0x0;var _0x16839e=_0x8ccc[_0xe95f8e];return _0x16839e;};'use strict';var Sequelize=require(_0xc8cc('0x0'));module['exports']={'type':{'type':Sequelize[_0xc8cc('0x1')](_0xc8cc('0x2'),_0xc8cc('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc8cc('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc8cc('0x2'),'variable',_0xc8cc('0x5'))},'keyContent':{'type':Sequelize[_0xc8cc('0x4')]},'idField':{'type':Sequelize[_0xc8cc('0x4')]},'nameField':{'type':Sequelize[_0xc8cc('0x4')]},'customField':{'type':Sequelize[_0xc8cc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc8cc('0x4')]}}; \ No newline at end of file +var _0x0044=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x321811,_0x4d2670){var _0x4cbd5d=function(_0x1efcf3){while(--_0x1efcf3){_0x321811['push'](_0x321811['shift']());}};_0x4cbd5d(++_0x4d2670);}(_0x0044,0x17f));var _0x4004=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x0044[_0x2abc3d];return _0x252745;};'use strict';var Sequelize=require(_0x4004('0x0'));module['exports']={'type':{'type':Sequelize[_0x4004('0x1')](_0x4004('0x2'),_0x4004('0x3'),_0x4004('0x4'),_0x4004('0x5'),'picklist'),'defaultValue':_0x4004('0x2')},'content':{'type':Sequelize[_0x4004('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4004('0x1')](_0x4004('0x2'),_0x4004('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4004('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4004('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4004('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 43d836f..20b0a9d 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 _0xfe29=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','rows','catch','show','params','length','include','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','error','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x164129,_0x5135b6){var _0x2a3ee0=function(_0x593c23){while(--_0x593c23){_0x164129['push'](_0x164129['shift']());}};_0x2a3ee0(++_0x5135b6);}(_0xfe29,0x1ed));var _0x9fe2=function(_0xe58f8e,_0x34811b){_0xe58f8e=_0xe58f8e-0x0;var _0x8c908d=_0xfe29[_0xe58f8e];return _0x8c908d;};'use strict';var emlformat=require(_0x9fe2('0x0'));var rimraf=require(_0x9fe2('0x1'));var zipdir=require(_0x9fe2('0x2'));var jsonpatch=require(_0x9fe2('0x3'));var rp=require(_0x9fe2('0x4'));var moment=require(_0x9fe2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9fe2('0x6'));var util=require(_0x9fe2('0x7'));var path=require(_0x9fe2('0x8'));var sox=require(_0x9fe2('0x9'));var csv=require(_0x9fe2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fe2('0xb'));var _=require(_0x9fe2('0xc'));var squel=require(_0x9fe2('0xd'));var crypto=require(_0x9fe2('0xe'));var jsforce=require(_0x9fe2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9fe2('0x10'));var Papa=require('papaparse');var Redis=require(_0x9fe2('0x11'));var authService=require(_0x9fe2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9fe2('0x13'));var hardwareService=require(_0x9fe2('0x14'));var logger=require('../../config/logger')(_0x9fe2('0x15'));var utils=require(_0x9fe2('0x16'));var config=require(_0x9fe2('0x17'));var licenseUtil=require(_0x9fe2('0x18'));var db=require(_0x9fe2('0x19'))['db'];function respondWithStatusCode(_0x50040c,_0x98c9db){_0x98c9db=_0x98c9db||0xcc;return function(_0x54db5d){if(_0x54db5d){return _0x50040c[_0x9fe2('0x1a')](_0x98c9db);}return _0x50040c[_0x9fe2('0x1b')](_0x98c9db)[_0x9fe2('0x1c')]();};}function respondWithResult(_0x3cd04b,_0x5101a7){_0x5101a7=_0x5101a7||0xc8;return function(_0x196871){if(_0x196871){return _0x3cd04b[_0x9fe2('0x1b')](_0x5101a7)[_0x9fe2('0x1d')](_0x196871);}};}function respondWithFilteredResult(_0x591c5b,_0x210f7a){return function(_0x2a1e6c){if(_0x2a1e6c){var _0x117e96=typeof _0x210f7a[_0x9fe2('0x1e')]===_0x9fe2('0x1f')&&typeof _0x210f7a[_0x9fe2('0x20')]===_0x9fe2('0x1f');var _0x5e8089=_0x2a1e6c[_0x9fe2('0x21')];var _0x30e119=_0x117e96?0x0:_0x210f7a[_0x9fe2('0x1e')];var _0x1e5d5f=_0x117e96?_0x2a1e6c[_0x9fe2('0x21')]:_0x210f7a[_0x9fe2('0x1e')]+_0x210f7a[_0x9fe2('0x20')];var _0x4db1b3;if(_0x1e5d5f>=_0x5e8089){_0x1e5d5f=_0x5e8089;_0x4db1b3=0xc8;}else{_0x4db1b3=0xce;}_0x591c5b['status'](_0x4db1b3);return _0x591c5b[_0x9fe2('0x22')]('Content-Range',_0x30e119+'-'+_0x1e5d5f+'/'+_0x5e8089)[_0x9fe2('0x1d')](_0x2a1e6c);}return null;};}function patchUpdates(_0x4dff90){return function(_0x52851d){try{jsonpatch[_0x9fe2('0x23')](_0x52851d,_0x4dff90,!![]);}catch(_0xc3a166){return BPromise[_0x9fe2('0x24')](_0xc3a166);}return _0x52851d[_0x9fe2('0x25')]();};}function saveUpdates(_0x489d71,_0x3bd529){return function(_0x28e424){if(_0x28e424){return _0x28e424['update'](_0x489d71)['then'](function(_0x53b9c4){return _0x53b9c4;});}return null;};}function removeEntity(_0x44612f,_0x145e6a){return function(_0x23dbc1){if(_0x23dbc1){return _0x23dbc1[_0x9fe2('0x26')]()[_0x9fe2('0x27')](function(){_0x44612f[_0x9fe2('0x1b')](0xcc)[_0x9fe2('0x1c')]();});}};}function handleEntityNotFound(_0x3847ce,_0x19484b){return function(_0x5e3338){if(!_0x5e3338){_0x3847ce[_0x9fe2('0x1a')](0x194);}return _0x5e3338;};}function handleError(_0x113469,_0x4a06f1){_0x4a06f1=_0x4a06f1||0x1f4;return function(_0x3adbf6){logger[_0x9fe2('0x28')](_0x3adbf6['stack']);if(_0x3adbf6[_0x9fe2('0x29')]){delete _0x3adbf6[_0x9fe2('0x29')];}_0x113469[_0x9fe2('0x1b')](_0x4a06f1)[_0x9fe2('0x2a')](_0x3adbf6);};}exports[_0x9fe2('0x2b')]=function(_0x576dd1,_0x38ea4a){var _0x2b700e={},_0x8048bb={},_0x2fdfec={'count':0x0,'rows':[]};var _0x2d02ce=_['map'](db[_0x9fe2('0x2c')][_0x9fe2('0x2d')],function(_0x3206dd){return{'name':_0x3206dd[_0x9fe2('0x2e')],'type':_0x3206dd[_0x9fe2('0x2f')][_0x9fe2('0x30')]};});_0x8048bb[_0x9fe2('0x31')]=_['map'](_0x2d02ce,_0x9fe2('0x29'));_0x8048bb[_0x9fe2('0x32')]=_[_0x9fe2('0x33')](_0x576dd1[_0x9fe2('0x32')]);_0x8048bb[_0x9fe2('0x34')]=_[_0x9fe2('0x35')](_0x8048bb[_0x9fe2('0x31')],_0x8048bb[_0x9fe2('0x32')]);_0x2b700e[_0x9fe2('0x36')]=_['intersection'](_0x8048bb[_0x9fe2('0x31')],qs[_0x9fe2('0x37')](_0x576dd1['query'][_0x9fe2('0x37')]));_0x2b700e[_0x9fe2('0x36')]=_0x2b700e[_0x9fe2('0x36')]['length']?_0x2b700e[_0x9fe2('0x36')]:_0x8048bb[_0x9fe2('0x31')];if(!_0x576dd1[_0x9fe2('0x32')][_0x9fe2('0x38')](_0x9fe2('0x39'))){_0x2b700e[_0x9fe2('0x20')]=qs['limit'](_0x576dd1[_0x9fe2('0x32')][_0x9fe2('0x20')]);_0x2b700e[_0x9fe2('0x1e')]=qs[_0x9fe2('0x1e')](_0x576dd1['query'][_0x9fe2('0x1e')]);}_0x2b700e[_0x9fe2('0x3a')]=qs[_0x9fe2('0x3b')](_0x576dd1[_0x9fe2('0x32')][_0x9fe2('0x3b')]);_0x2b700e[_0x9fe2('0x3c')]=qs[_0x9fe2('0x34')](_[_0x9fe2('0x3d')](_0x576dd1[_0x9fe2('0x32')],_0x8048bb['filters']),_0x2d02ce);if(_0x576dd1[_0x9fe2('0x32')][_0x9fe2('0x3e')]){_0x2b700e[_0x9fe2('0x3c')]=_[_0x9fe2('0x3f')](_0x2b700e['where'],{'$or':_[_0x9fe2('0x40')](_0x2d02ce,function(_0x542776){if(_0x542776[_0x9fe2('0x2f')]!==_0x9fe2('0x41')){var _0x57b09d={};_0x57b09d[_0x542776[_0x9fe2('0x29')]]={'$like':'%'+_0x576dd1['query'][_0x9fe2('0x3e')]+'%'};return _0x57b09d;}})});}_0x2b700e=_['merge']({},_0x2b700e,_0x576dd1['options']);var _0x48b826={'where':_0x2b700e[_0x9fe2('0x3c')]};return db[_0x9fe2('0x2c')]['count'](_0x48b826)[_0x9fe2('0x27')](function(_0x260dc5){_0x2fdfec[_0x9fe2('0x21')]=_0x260dc5;if(_0x576dd1[_0x9fe2('0x32')][_0x9fe2('0x42')]){_0x2b700e['include']=[{'all':!![]}];}return db[_0x9fe2('0x2c')]['findAll'](_0x2b700e);})[_0x9fe2('0x27')](function(_0x510a5e){_0x2fdfec[_0x9fe2('0x43')]=_0x510a5e;return _0x2fdfec;})[_0x9fe2('0x27')](respondWithFilteredResult(_0x38ea4a,_0x2b700e))[_0x9fe2('0x44')](handleError(_0x38ea4a,null));};exports[_0x9fe2('0x45')]=function(_0x43b3e6,_0x28ca4b){var _0x6134ba={'raw':!![],'where':{'id':_0x43b3e6[_0x9fe2('0x46')]['id']}},_0x5eb8ca={};_0x5eb8ca[_0x9fe2('0x31')]=_[_0x9fe2('0x33')](db[_0x9fe2('0x2c')][_0x9fe2('0x2d')]);_0x5eb8ca[_0x9fe2('0x32')]=_[_0x9fe2('0x33')](_0x43b3e6[_0x9fe2('0x32')]);_0x5eb8ca['filters']=_[_0x9fe2('0x35')](_0x5eb8ca[_0x9fe2('0x31')],_0x5eb8ca[_0x9fe2('0x32')]);_0x6134ba['attributes']=_['intersection'](_0x5eb8ca[_0x9fe2('0x31')],qs['fields'](_0x43b3e6[_0x9fe2('0x32')]['fields']));_0x6134ba[_0x9fe2('0x36')]=_0x6134ba['attributes'][_0x9fe2('0x47')]?_0x6134ba[_0x9fe2('0x36')]:_0x5eb8ca['model'];if(_0x43b3e6[_0x9fe2('0x32')][_0x9fe2('0x42')]){_0x6134ba[_0x9fe2('0x48')]=[{'all':!![]}];}_0x6134ba=_[_0x9fe2('0x3f')]({},_0x6134ba,_0x43b3e6[_0x9fe2('0x49')]);return db[_0x9fe2('0x2c')][_0x9fe2('0x4a')](_0x6134ba)[_0x9fe2('0x27')](handleEntityNotFound(_0x28ca4b,null))[_0x9fe2('0x27')](respondWithResult(_0x28ca4b,null))[_0x9fe2('0x44')](handleError(_0x28ca4b,null));};exports['create']=function(_0x364242,_0x3e874b){return db[_0x9fe2('0x2c')][_0x9fe2('0x4b')](_0x364242[_0x9fe2('0x4c')],{})[_0x9fe2('0x27')](respondWithResult(_0x3e874b,0xc9))[_0x9fe2('0x44')](handleError(_0x3e874b,null));};exports[_0x9fe2('0x4d')]=function(_0x4d52b9,_0x1b93ba){if(_0x4d52b9['body']['id']){delete _0x4d52b9['body']['id'];}return db['ZohoField'][_0x9fe2('0x4a')]({'where':{'id':_0x4d52b9[_0x9fe2('0x46')]['id']}})[_0x9fe2('0x27')](handleEntityNotFound(_0x1b93ba,null))[_0x9fe2('0x27')](saveUpdates(_0x4d52b9[_0x9fe2('0x4c')],null))[_0x9fe2('0x27')](respondWithResult(_0x1b93ba,null))['catch'](handleError(_0x1b93ba,null));};exports[_0x9fe2('0x26')]=function(_0x4b9699,_0x41e0fe){return db[_0x9fe2('0x2c')][_0x9fe2('0x4a')]({'where':{'id':_0x4b9699['params']['id']}})[_0x9fe2('0x27')](handleEntityNotFound(_0x41e0fe,null))['then'](removeEntity(_0x41e0fe,null))[_0x9fe2('0x44')](handleError(_0x41e0fe,null));}; \ No newline at end of file +var _0xb2ea=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZohoField','rawAttributes'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0xb2ea,0x1eb));var _0xab2e=function(_0x4b2037,_0x41055c){_0x4b2037=_0x4b2037-0x0;var _0x48599b=_0xb2ea[_0x4b2037];return _0x48599b;};'use strict';var emlformat=require(_0xab2e('0x0'));var rimraf=require(_0xab2e('0x1'));var zipdir=require(_0xab2e('0x2'));var jsonpatch=require(_0xab2e('0x3'));var rp=require(_0xab2e('0x4'));var moment=require('moment');var BPromise=require(_0xab2e('0x5'));var Mustache=require(_0xab2e('0x6'));var util=require(_0xab2e('0x7'));var path=require(_0xab2e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab2e('0xa'));var squel=require('squel');var crypto=require(_0xab2e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xab2e('0xc'));var toCsv=require(_0xab2e('0xd'));var querystring=require(_0xab2e('0xe'));var Papa=require(_0xab2e('0xf'));var Redis=require(_0xab2e('0x10'));var authService=require(_0xab2e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xab2e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab2e('0x13'));var utils=require(_0xab2e('0x14'));var config=require(_0xab2e('0x15'));var licenseUtil=require(_0xab2e('0x16'));var db=require(_0xab2e('0x17'))['db'];function respondWithStatusCode(_0x301823,_0x47e3db){_0x47e3db=_0x47e3db||0xcc;return function(_0x208ccc){if(_0x208ccc){return _0x301823[_0xab2e('0x18')](_0x47e3db);}return _0x301823[_0xab2e('0x19')](_0x47e3db)[_0xab2e('0x1a')]();};}function respondWithResult(_0x9201f2,_0x119f0a){_0x119f0a=_0x119f0a||0xc8;return function(_0xa42166){if(_0xa42166){return _0x9201f2[_0xab2e('0x19')](_0x119f0a)[_0xab2e('0x1b')](_0xa42166);}};}function respondWithFilteredResult(_0x43e7d6,_0x56c9f5){return function(_0x293deb){if(_0x293deb){var _0x2f3ada=typeof _0x56c9f5[_0xab2e('0x1c')]===_0xab2e('0x1d')&&typeof _0x56c9f5[_0xab2e('0x1e')]==='undefined';var _0x228dfc=_0x293deb[_0xab2e('0x1f')];var _0x3ad89f=_0x2f3ada?0x0:_0x56c9f5['offset'];var _0x5a4854=_0x2f3ada?_0x293deb[_0xab2e('0x1f')]:_0x56c9f5[_0xab2e('0x1c')]+_0x56c9f5[_0xab2e('0x1e')];var _0x290526;if(_0x5a4854>=_0x228dfc){_0x5a4854=_0x228dfc;_0x290526=0xc8;}else{_0x290526=0xce;}_0x43e7d6['status'](_0x290526);return _0x43e7d6[_0xab2e('0x20')](_0xab2e('0x21'),_0x3ad89f+'-'+_0x5a4854+'/'+_0x228dfc)[_0xab2e('0x1b')](_0x293deb);}return null;};}function patchUpdates(_0x5b380d){return function(_0x53fa27){try{jsonpatch[_0xab2e('0x22')](_0x53fa27,_0x5b380d,!![]);}catch(_0x2f5072){return BPromise[_0xab2e('0x23')](_0x2f5072);}return _0x53fa27[_0xab2e('0x24')]();};}function saveUpdates(_0x44da43,_0x359cde){return function(_0x51a203){if(_0x51a203){return _0x51a203[_0xab2e('0x25')](_0x44da43)['then'](function(_0x21aef8){return _0x21aef8;});}return null;};}function removeEntity(_0x346927,_0xcb30b0){return function(_0x4b45e8){if(_0x4b45e8){return _0x4b45e8[_0xab2e('0x26')]()[_0xab2e('0x27')](function(){_0x346927[_0xab2e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3cf0,_0x2e2802){return function(_0x476e1f){if(!_0x476e1f){_0x3b3cf0[_0xab2e('0x18')](0x194);}return _0x476e1f;};}function handleError(_0x11effb,_0x131a18){_0x131a18=_0x131a18||0x1f4;return function(_0x335ddb){logger[_0xab2e('0x28')](_0x335ddb[_0xab2e('0x29')]);if(_0x335ddb[_0xab2e('0x2a')]){delete _0x335ddb[_0xab2e('0x2a')];}_0x11effb[_0xab2e('0x19')](_0x131a18)[_0xab2e('0x2b')](_0x335ddb);};}exports[_0xab2e('0x2c')]=function(_0x4ed55a,_0x45d50e){var _0x25ddb4={},_0x2fd0b6={},_0x27fa11={'count':0x0,'rows':[]};var _0x521c2e=_[_0xab2e('0x2d')](db[_0xab2e('0x2e')][_0xab2e('0x2f')],function(_0x3ad099){return{'name':_0x3ad099[_0xab2e('0x30')],'type':_0x3ad099[_0xab2e('0x31')][_0xab2e('0x32')]};});_0x2fd0b6['model']=_['map'](_0x521c2e,_0xab2e('0x2a'));_0x2fd0b6[_0xab2e('0x33')]=_[_0xab2e('0x34')](_0x4ed55a['query']);_0x2fd0b6[_0xab2e('0x35')]=_[_0xab2e('0x36')](_0x2fd0b6[_0xab2e('0x37')],_0x2fd0b6['query']);_0x25ddb4[_0xab2e('0x38')]=_[_0xab2e('0x36')](_0x2fd0b6['model'],qs['fields'](_0x4ed55a['query'][_0xab2e('0x39')]));_0x25ddb4[_0xab2e('0x38')]=_0x25ddb4[_0xab2e('0x38')]['length']?_0x25ddb4[_0xab2e('0x38')]:_0x2fd0b6['model'];if(!_0x4ed55a['query'][_0xab2e('0x3a')](_0xab2e('0x3b'))){_0x25ddb4[_0xab2e('0x1e')]=qs[_0xab2e('0x1e')](_0x4ed55a[_0xab2e('0x33')][_0xab2e('0x1e')]);_0x25ddb4['offset']=qs[_0xab2e('0x1c')](_0x4ed55a['query']['offset']);}_0x25ddb4[_0xab2e('0x3c')]=qs[_0xab2e('0x3d')](_0x4ed55a[_0xab2e('0x33')]['sort']);_0x25ddb4[_0xab2e('0x3e')]=qs[_0xab2e('0x35')](_[_0xab2e('0x3f')](_0x4ed55a[_0xab2e('0x33')],_0x2fd0b6['filters']),_0x521c2e);if(_0x4ed55a[_0xab2e('0x33')][_0xab2e('0x40')]){_0x25ddb4[_0xab2e('0x3e')]=_[_0xab2e('0x41')](_0x25ddb4['where'],{'$or':_[_0xab2e('0x2d')](_0x521c2e,function(_0x2890ba){if(_0x2890ba['type']!=='VIRTUAL'){var _0x15fdf9={};_0x15fdf9[_0x2890ba[_0xab2e('0x2a')]]={'$like':'%'+_0x4ed55a['query'][_0xab2e('0x40')]+'%'};return _0x15fdf9;}})});}_0x25ddb4=_['merge']({},_0x25ddb4,_0x4ed55a[_0xab2e('0x42')]);var _0x3e1a91={'where':_0x25ddb4[_0xab2e('0x3e')]};return db[_0xab2e('0x2e')][_0xab2e('0x1f')](_0x3e1a91)[_0xab2e('0x27')](function(_0x31b581){_0x27fa11[_0xab2e('0x1f')]=_0x31b581;if(_0x4ed55a[_0xab2e('0x33')][_0xab2e('0x43')]){_0x25ddb4[_0xab2e('0x44')]=[{'all':!![]}];}return db[_0xab2e('0x2e')][_0xab2e('0x45')](_0x25ddb4);})[_0xab2e('0x27')](function(_0x1e9a20){_0x27fa11[_0xab2e('0x46')]=_0x1e9a20;return _0x27fa11;})['then'](respondWithFilteredResult(_0x45d50e,_0x25ddb4))[_0xab2e('0x47')](handleError(_0x45d50e,null));};exports['show']=function(_0x1714a9,_0x5a2959){var _0x54e156={'raw':!![],'where':{'id':_0x1714a9['params']['id']}},_0x246826={};_0x246826[_0xab2e('0x37')]=_[_0xab2e('0x34')](db[_0xab2e('0x2e')][_0xab2e('0x2f')]);_0x246826[_0xab2e('0x33')]=_[_0xab2e('0x34')](_0x1714a9[_0xab2e('0x33')]);_0x246826[_0xab2e('0x35')]=_[_0xab2e('0x36')](_0x246826[_0xab2e('0x37')],_0x246826[_0xab2e('0x33')]);_0x54e156[_0xab2e('0x38')]=_[_0xab2e('0x36')](_0x246826[_0xab2e('0x37')],qs[_0xab2e('0x39')](_0x1714a9[_0xab2e('0x33')]['fields']));_0x54e156[_0xab2e('0x38')]=_0x54e156[_0xab2e('0x38')][_0xab2e('0x48')]?_0x54e156[_0xab2e('0x38')]:_0x246826['model'];if(_0x1714a9['query']['includeAll']){_0x54e156[_0xab2e('0x44')]=[{'all':!![]}];}_0x54e156=_[_0xab2e('0x41')]({},_0x54e156,_0x1714a9['options']);return db[_0xab2e('0x2e')]['find'](_0x54e156)[_0xab2e('0x27')](handleEntityNotFound(_0x5a2959,null))[_0xab2e('0x27')](respondWithResult(_0x5a2959,null))['catch'](handleError(_0x5a2959,null));};exports[_0xab2e('0x49')]=function(_0x40bca7,_0x3f630c){return db[_0xab2e('0x2e')]['create'](_0x40bca7[_0xab2e('0x4a')],{})[_0xab2e('0x27')](respondWithResult(_0x3f630c,0xc9))[_0xab2e('0x47')](handleError(_0x3f630c,null));};exports[_0xab2e('0x25')]=function(_0x46c15b,_0x152988){if(_0x46c15b[_0xab2e('0x4a')]['id']){delete _0x46c15b[_0xab2e('0x4a')]['id'];}return db[_0xab2e('0x2e')][_0xab2e('0x4b')]({'where':{'id':_0x46c15b['params']['id']}})[_0xab2e('0x27')](handleEntityNotFound(_0x152988,null))[_0xab2e('0x27')](saveUpdates(_0x46c15b[_0xab2e('0x4a')],null))[_0xab2e('0x27')](respondWithResult(_0x152988,null))[_0xab2e('0x47')](handleError(_0x152988,null));};exports['destroy']=function(_0x2954e6,_0x5bc3c0){return db[_0xab2e('0x2e')][_0xab2e('0x4b')]({'where':{'id':_0x2954e6[_0xab2e('0x4c')]['id']}})[_0xab2e('0x27')](handleEntityNotFound(_0x5bc3c0,null))[_0xab2e('0x27')](removeEntity(_0x5bc3c0,null))['catch'](handleError(_0x5bc3c0,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d2f7846..831c1da 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 _0x3e24=['request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x506bfc,_0x5e2cd0){var _0x4fe912=function(_0xdf03be){while(--_0xdf03be){_0x506bfc['push'](_0x506bfc['shift']());}};_0x4fe912(++_0x5e2cd0);}(_0x3e24,0x167));var _0x43e2=function(_0x133156,_0x109b02){_0x133156=_0x133156-0x0;var _0xb6d904=_0x3e24[_0x133156];return _0xb6d904;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x43e2('0xc'),'fields':[_0x43e2('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0x268f1f,_0x24f2cd){var _0x5c45c0=function(_0x3e2612){while(--_0x3e2612){_0x268f1f['push'](_0x268f1f['shift']());}};_0x5c45c0(++_0x24f2cd);}(_0xd046,0x129));var _0x6d04=function(_0x491606,_0x2c53be){_0x491606=_0x491606-0x0;var _0x593183=_0xd046[_0x491606];return _0x593183;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var logger=require(_0x6d04('0x1'))(_0x6d04('0x2'));var moment=require('moment');var BPromise=require(_0x6d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x6d04('0x5'));module['exports']=function(_0x4bacb1,_0xf3b4e7){return _0x4bacb1[_0x6d04('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x6d04('0x7'),'fields':[_0x6d04('0x8'),'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 f8646a0..760a92f 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 _0x0e88=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment'];(function(_0x34d412,_0x54ed36){var _0x3e06ef=function(_0x49f2e6){while(--_0x49f2e6){_0x34d412['push'](_0x34d412['shift']());}};_0x3e06ef(++_0x54ed36);}(_0x0e88,0x1cc));var _0x80e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e88[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x80e8('0x0'));var moment=require(_0x80e8('0x1'));var BPromise=require('bluebird');var rs=require(_0x80e8('0x2'));var fs=require('fs');var Redis=require(_0x80e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x80e8('0x4'));var logger=require(_0x80e8('0x5'))(_0x80e8('0x6'));var config=require(_0x80e8('0x7'));var jayson=require(_0x80e8('0x8'));var client=jayson[_0x80e8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b566,_0xa389a5,_0x36fa47){return new BPromise(function(_0x35bc4b,_0x3dd7f4){return client[_0x80e8('0xa')](_0x59b566,_0x36fa47)[_0x80e8('0xb')](function(_0x5c391d){logger[_0x80e8('0xc')](_0x80e8('0xd'),_0xa389a5,'request\x20sent');logger[_0x80e8('0xe')](_0x80e8('0xf'),_0xa389a5,'request\x20sent',JSON['stringify'](_0x5c391d));if(_0x5c391d[_0x80e8('0x10')]){if(_0x5c391d[_0x80e8('0x10')][_0x80e8('0x11')]===0x1f4){logger[_0x80e8('0x10')](_0x80e8('0xd'),_0xa389a5,_0x5c391d[_0x80e8('0x10')][_0x80e8('0x12')]);return _0x3dd7f4(_0x5c391d[_0x80e8('0x10')][_0x80e8('0x12')]);}logger[_0x80e8('0x10')]('ZohoField,\x20%s,\x20%s',_0xa389a5,_0x5c391d[_0x80e8('0x10')]['message']);return _0x35bc4b(_0x5c391d[_0x80e8('0x10')]['message']);}else{logger[_0x80e8('0xc')]('ZohoField,\x20%s,\x20%s',_0xa389a5,_0x80e8('0x13'));_0x35bc4b(_0x5c391d[_0x80e8('0x14')][_0x80e8('0x12')]);}})[_0x80e8('0x15')](function(_0x5aa62e){logger[_0x80e8('0x10')]('ZohoField,\x20%s,\x20%s',_0xa389a5,_0x5aa62e);_0x3dd7f4(_0x5aa62e);});});} \ No newline at end of file +var _0x8c21=['../../config/logger','rpc','jayson/promise','client','http','request','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoField,\x20%s,\x20%s','request\x20sent','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x8c21,0x12e));var _0x18c2=function(_0xad37e0,_0x4771c7){_0xad37e0=_0xad37e0-0x0;var _0xeeee86=_0x8c21[_0xad37e0];return _0xeeee86;};'use strict';var _=require('lodash');var util=require(_0x18c2('0x0'));var moment=require(_0x18c2('0x1'));var BPromise=require('bluebird');var rs=require(_0x18c2('0x2'));var fs=require('fs');var Redis=require(_0x18c2('0x3'));var db=require(_0x18c2('0x4'))['db'];var utils=require(_0x18c2('0x5'));var logger=require(_0x18c2('0x6'))(_0x18c2('0x7'));var config=require('../../config/environment');var jayson=require(_0x18c2('0x8'));var client=jayson[_0x18c2('0x9')][_0x18c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4df1e3,_0xbe2e54,_0x175e42){return new BPromise(function(_0x474a40,_0x26ffae){return client[_0x18c2('0xb')](_0x4df1e3,_0x175e42)['then'](function(_0x5911b5){logger[_0x18c2('0xc')]('ZohoField,\x20%s,\x20%s',_0xbe2e54,'request\x20sent');logger[_0x18c2('0xd')](_0x18c2('0xe'),_0xbe2e54,'request\x20sent',JSON[_0x18c2('0xf')](_0x5911b5));if(_0x5911b5[_0x18c2('0x10')]){if(_0x5911b5[_0x18c2('0x10')][_0x18c2('0x11')]===0x1f4){logger[_0x18c2('0x10')]('ZohoField,\x20%s,\x20%s',_0xbe2e54,_0x5911b5[_0x18c2('0x10')][_0x18c2('0x12')]);return _0x26ffae(_0x5911b5[_0x18c2('0x10')]['message']);}logger[_0x18c2('0x10')](_0x18c2('0x13'),_0xbe2e54,_0x5911b5[_0x18c2('0x10')]['message']);return _0x474a40(_0x5911b5[_0x18c2('0x10')][_0x18c2('0x12')]);}else{logger[_0x18c2('0xc')](_0x18c2('0x13'),_0xbe2e54,_0x18c2('0x14'));_0x474a40(_0x5911b5[_0x18c2('0x15')][_0x18c2('0x12')]);}})['catch'](function(_0x572e41){logger[_0x18c2('0x10')](_0x18c2('0x13'),_0xbe2e54,_0x572e41);_0x26ffae(_0x572e41);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 0251d76..cf029c5 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x127c65,_0xff1c9){var _0x2b09b9=function(_0x24ef65){while(--_0x24ef65){_0x127c65['push'](_0x127c65['shift']());}};_0x2b09b9(++_0xff1c9);}(_0xe706,0xa3));var _0x6e70=function(_0xc441b5,_0xa58567){_0xc441b5=_0xc441b5-0x0;var _0x4f5e7c=_0xe706[_0xc441b5];return _0x4f5e7c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 541c4ba..3acb64e 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 _0x2d88=['exports','STRING','unique_name_and_version','app.js','INTEGER','state','sequelize'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0x2d88,0x110));var _0x82d8=function(_0x226948,_0x14f317){_0x226948=_0x226948-0x0;var _0x4f00da=_0x2d88[_0x226948];return _0x4f00da;};'use strict';var Sequelize=require(_0x82d8('0x0'));module[_0x82d8('0x1')]={'name':{'type':Sequelize[_0x82d8('0x2')],'allowNull':![],'unique':_0x82d8('0x3')},'version':{'type':Sequelize[_0x82d8('0x2')],'allowNull':![],'unique':_0x82d8('0x3')},'main':{'type':Sequelize[_0x82d8('0x2')],'defaultValue':_0x82d8('0x4')},'filename':{'type':Sequelize[_0x82d8('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x82d8('0x2')]},'size':{'type':Sequelize[_0x82d8('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x82d8('0x2')]},'logo':{'type':Sequelize[_0x82d8('0x2')]},'state':{'type':Sequelize[_0x82d8('0x2')],'unique':_0x82d8('0x6')},'description':{'type':Sequelize[_0x82d8('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x82d8('0x2')]},'link':{'type':Sequelize[_0x82d8('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5e4e=['unique_name_and_version','STRING','INTEGER','BOOLEAN','state','sequelize'];(function(_0x26643f,_0x4d1171){var _0x4ea004=function(_0x47ed51){while(--_0x47ed51){_0x26643f['push'](_0x26643f['shift']());}};_0x4ea004(++_0x4d1171);}(_0x5e4e,0x89));var _0xe5e4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e4e[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xe5e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe5e4('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe5e4('0x1')},'main':{'type':Sequelize[_0xe5e4('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xe5e4('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe5e4('0x2')]},'size':{'type':Sequelize[_0xe5e4('0x3')]},'active':{'type':Sequelize[_0xe5e4('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xe5e4('0x2')]},'logo':{'type':Sequelize[_0xe5e4('0x2')]},'state':{'type':Sequelize[_0xe5e4('0x2')],'unique':_0xe5e4('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe5e4('0x2')]},'link':{'type':Sequelize[_0xe5e4('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 93c52cb..7ec0866 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 _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2c7,0x134));var _0x7c2c=function(_0x24b150,_0x902be5){_0x24b150=_0x24b150-0x0;var _0x50b582=_0xc2c7[_0x24b150];return _0x50b582;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['Integration'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['Integration'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file +var _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0x9536[_0xb7b878];return _0x3c84b9;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index dc621af..243a3b6 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 _0x0ce1=['integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./integration.attributes','exports','Integration'];(function(_0x3ed1df,_0x18d47a){var _0x313d39=function(_0x31b135){while(--_0x31b135){_0x3ed1df['push'](_0x3ed1df['shift']());}};_0x313d39(++_0x18d47a);}(_0x0ce1,0x7a));var _0x10ce=function(_0x207c23,_0x50ce5d){_0x207c23=_0x207c23-0x0;var _0x438a20=_0x0ce1[_0x207c23];return _0x438a20;};'use strict';var _=require(_0x10ce('0x0'));var util=require('util');var logger=require(_0x10ce('0x1'))(_0x10ce('0x2'));var moment=require(_0x10ce('0x3'));var BPromise=require(_0x10ce('0x4'));var rp=require(_0x10ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10ce('0x6'));var config=require('../../config/environment');var attributes=require(_0x10ce('0x7'));module[_0x10ce('0x8')]=function(_0x36b42a,_0x3c55c6){return _0x36b42a['define'](_0x10ce('0x9'),attributes,{'tableName':_0x10ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe797=['exports','define','Integration','integrations','util','../../config/logger','moment','request-promise','path','../../config/environment','./integration.attributes'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xe797,0x143));var _0x7e79=function(_0x8084d,_0x510574){_0x8084d=_0x8084d-0x0;var _0x1d7af5=_0xe797[_0x8084d];return _0x1d7af5;};'use strict';var _=require('lodash');var util=require(_0x7e79('0x0'));var logger=require(_0x7e79('0x1'))('api');var moment=require(_0x7e79('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e79('0x3'));var fs=require('fs');var path=require(_0x7e79('0x4'));var rimraf=require('rimraf');var config=require(_0x7e79('0x5'));var attributes=require(_0x7e79('0x6'));module[_0x7e79('0x7')]=function(_0x45dd32,_0x46e7d2){return _0x45dd32[_0x7e79('0x8')](_0x7e79('0x9'),attributes,{'tableName':_0x7e79('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 d0b7890..f1d0597 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1cb574,_0x318720){var _0x3f11a5=function(_0xa75264){while(--_0xa75264){_0x1cb574['push'](_0x1cb574['shift']());}};_0x3f11a5(++_0x318720);}(_0x2ef3,0xba));var _0x32ef=function(_0x199174,_0x39f0b8){_0x199174=_0x199174-0x0;var _0x51d536=_0x2ef3[_0x199174];return _0x51d536;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x17ce7c,_0x41cf64){var _0x2f3f1f=function(_0x2e771b){while(--_0x2e771b){_0x17ce7c['push'](_0x17ce7c['shift']());}};_0x2f3f1f(++_0x41cf64);}(_0x955f,0x1eb));var _0xf955=function(_0x5c4c2b,_0x58a317){_0x5c4c2b=_0x5c4c2b-0x0;var _0x1604f5=_0x955f[_0x5c4c2b];return _0x1604f5;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 153470d..9bc09c2 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 _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0xe03ad7,_0x7e153d){var _0x5c6408=function(_0x315a43){while(--_0x315a43){_0xe03ad7['push'](_0xe03ad7['shift']());}};_0x5c6408(++_0x7e153d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x0b0e[_0x482214];return _0x38d0cb;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file +var _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0xc3f740,_0x242fda){var _0x497e38=function(_0x4c70d1){while(--_0x4c70d1){_0xc3f740['push'](_0xc3f740['shift']());}};_0x497e38(++_0x242fda);}(_0xc2c7,0x134));var _0x7c2c=function(_0x408c88,_0x378a93){_0x408c88=_0x408c88-0x0;var _0xcf201e=_0xc2c7[_0x408c88];return _0xcf201e;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 21dd17c..e85ff1d 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 _0x4b30=['RECEIVED','FAILED','exports','INTEGER','STRING','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b30,0xb6));var _0x04b3=function(_0x55a747,_0x50c122){_0x55a747=_0x55a747-0x0;var _0x2136b3=_0x4b30[_0x55a747];return _0x2136b3;};'use strict';var Sequelize=require('sequelize');module[_0x04b3('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x04b3('0x1')]},'contacts':{'type':Sequelize[_0x04b3('0x2')]},'uniqueid':{'type':Sequelize[_0x04b3('0x2')]},'calleridnum':{'type':Sequelize[_0x04b3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x04b3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x04b3('0x3')]},'agentconnectAt':{'type':Sequelize[_0x04b3('0x3')]},'holdtime':{'type':Sequelize[_0x04b3('0x1')]},'agentcomplete':{'type':Sequelize[_0x04b3('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x04b3('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x04b3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x04b3('0x1')]},'reason':{'type':Sequelize[_0x04b3('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x04b3('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x04b3('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x04b3('0x2')]},'channel':{'type':Sequelize[_0x04b3('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x04b3('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x04b3('0x2')]},'language':{'type':Sequelize[_0x04b3('0x2')]},'accountcode':{'type':Sequelize[_0x04b3('0x2')]},'context':{'type':Sequelize[_0x04b3('0x2')]},'exten':{'type':Sequelize[_0x04b3('0x2')]},'priority':{'type':Sequelize[_0x04b3('0x2')]},'destchannel':{'type':Sequelize[_0x04b3('0x2')]},'destchannelstate':{'type':Sequelize[_0x04b3('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x04b3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x04b3('0x2')]},'destcalleridname':{'type':Sequelize[_0x04b3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x04b3('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x04b3('0x2')]},'destaccountcode':{'type':Sequelize[_0x04b3('0x2')]},'destcontext':{'type':Sequelize[_0x04b3('0x2')]},'destexten':{'type':Sequelize[_0x04b3('0x2')]},'destpriority':{'type':Sequelize[_0x04b3('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x04b3('0x2')]},'inReplyTo':{'type':Sequelize[_0x04b3('0x2')]},'subject':{'type':Sequelize[_0x04b3('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x04b3('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x04b3('0x5')]},'html':{'type':Sequelize[_0x04b3('0x5')]},'text':{'type':Sequelize[_0x04b3('0x5')]},'status':{'type':Sequelize[_0x04b3('0x6')](_0x04b3('0x7'),'SENDING',_0x04b3('0x8'),_0x04b3('0x9'))},'url':{'type':Sequelize[_0x04b3('0x2')]},'app':{'type':Sequelize[_0x04b3('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x04b3('0x1')]}}; \ No newline at end of file +var _0xec55=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','FAILED'];(function(_0x3e9c0d,_0x46bac5){var _0x4aace8=function(_0x35e528){while(--_0x35e528){_0x3e9c0d['push'](_0x3e9c0d['shift']());}};_0x4aace8(++_0x46bac5);}(_0xec55,0x1ef));var _0x5ec5=function(_0x252d53,_0x31204a){_0x252d53=_0x252d53-0x0;var _0x410c8b=_0xec55[_0x252d53];return _0x410c8b;};'use strict';var Sequelize=require('sequelize');module[_0x5ec5('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x5ec5('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x5ec5('0x1')]},'integrationId':{'type':Sequelize[_0x5ec5('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5ec5('0x1')]},'calleridnum':{'type':Sequelize[_0x5ec5('0x1')]},'calleridname':{'type':Sequelize[_0x5ec5('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5ec5('0x1')]},'membername':{'type':Sequelize[_0x5ec5('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5ec5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5ec5('0x3')]},'holdtime':{'type':Sequelize[_0x5ec5('0x2')]},'agentcomplete':{'type':Sequelize[_0x5ec5('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5ec5('0x3')]},'talktime':{'type':Sequelize[_0x5ec5('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5ec5('0x2')]},'reason':{'type':Sequelize[_0x5ec5('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x5ec5('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5ec5('0x3')]},'agentdump':{'type':Sequelize[_0x5ec5('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5ec5('0x3')]},'lastevent':{'type':Sequelize[_0x5ec5('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5ec5('0x2')]},'channelstatedesc':{'type':Sequelize[_0x5ec5('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5ec5('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5ec5('0x1')]},'accountcode':{'type':Sequelize[_0x5ec5('0x1')]},'context':{'type':Sequelize[_0x5ec5('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5ec5('0x1')]},'destchannel':{'type':Sequelize[_0x5ec5('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5ec5('0x1')]},'destcalleridnum':{'type':Sequelize[_0x5ec5('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5ec5('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5ec5('0x1')]},'destlanguage':{'type':Sequelize[_0x5ec5('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5ec5('0x1')]},'destpriority':{'type':Sequelize[_0x5ec5('0x1')]},'destuniqueid':{'type':Sequelize[_0x5ec5('0x1')]},'messageId':{'type':Sequelize[_0x5ec5('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x5ec5('0x1')]},'from':{'type':Sequelize[_0x5ec5('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x5ec5('0x1')]},'attachment':{'type':Sequelize[_0x5ec5('0x5')]},'html':{'type':Sequelize[_0x5ec5('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x5ec5('0x6'),_0x5ec5('0x7'),'RECEIVED',_0x5ec5('0x8'))},'url':{'type':Sequelize[_0x5ec5('0x1')]},'app':{'type':Sequelize[_0x5ec5('0x1')]},'appdata':{'type':Sequelize[_0x5ec5('0x1')]},'projectId':{'type':Sequelize[_0x5ec5('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e6bb15e..81744a8 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 _0x5668=['update','then','destroy','error','stack','name','send','index','IntegrationReport','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','save'];(function(_0x508db5,_0x573522){var _0x1e21ff=function(_0xde2077){while(--_0xde2077){_0x508db5['push'](_0x508db5['shift']());}};_0x1e21ff(++_0x573522);}(_0x5668,0x1f0));var _0x8566=function(_0x315046,_0x23306a){_0x315046=_0x315046-0x0;var _0x848e2a=_0x5668[_0x315046];return _0x848e2a;};'use strict';var emlformat=require(_0x8566('0x0'));var rimraf=require(_0x8566('0x1'));var zipdir=require(_0x8566('0x2'));var jsonpatch=require(_0x8566('0x3'));var rp=require('request-promise');var moment=require(_0x8566('0x4'));var BPromise=require(_0x8566('0x5'));var Mustache=require(_0x8566('0x6'));var util=require(_0x8566('0x7'));var path=require(_0x8566('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8566('0x9'));var fs=require('fs');var fs_extra=require(_0x8566('0xa'));var _=require('lodash');var squel=require(_0x8566('0xb'));var crypto=require(_0x8566('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8566('0xd'));var toCsv=require(_0x8566('0xe'));var querystring=require(_0x8566('0xf'));var Papa=require(_0x8566('0x10'));var Redis=require(_0x8566('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8566('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8566('0x13'));var logger=require(_0x8566('0x14'))(_0x8566('0x15'));var utils=require(_0x8566('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8566('0x17'));var db=require(_0x8566('0x18'))['db'];function respondWithStatusCode(_0x504b3a,_0x373525){_0x373525=_0x373525||0xcc;return function(_0x19fd5d){if(_0x19fd5d){return _0x504b3a[_0x8566('0x19')](_0x373525);}return _0x504b3a[_0x8566('0x1a')](_0x373525)[_0x8566('0x1b')]();};}function respondWithResult(_0x535fbb,_0x291bb0){_0x291bb0=_0x291bb0||0xc8;return function(_0x5a557e){if(_0x5a557e){return _0x535fbb[_0x8566('0x1a')](_0x291bb0)['json'](_0x5a557e);}};}function respondWithFilteredResult(_0x3bd669,_0x43ae3b){return function(_0x2eb17c){if(_0x2eb17c){var _0x3d2ed2=typeof _0x43ae3b['offset']===_0x8566('0x1c')&&typeof _0x43ae3b[_0x8566('0x1d')]===_0x8566('0x1c');var _0x3d2600=_0x2eb17c[_0x8566('0x1e')];var _0x52ad85=_0x3d2ed2?0x0:_0x43ae3b['offset'];var _0x170e58=_0x3d2ed2?_0x2eb17c[_0x8566('0x1e')]:_0x43ae3b['offset']+_0x43ae3b[_0x8566('0x1d')];var _0x30b351;if(_0x170e58>=_0x3d2600){_0x170e58=_0x3d2600;_0x30b351=0xc8;}else{_0x30b351=0xce;}_0x3bd669[_0x8566('0x1a')](_0x30b351);return _0x3bd669[_0x8566('0x1f')](_0x8566('0x20'),_0x52ad85+'-'+_0x170e58+'/'+_0x3d2600)[_0x8566('0x21')](_0x2eb17c);}return null;};}function patchUpdates(_0x298c32){return function(_0x10d8c3){try{jsonpatch[_0x8566('0x22')](_0x10d8c3,_0x298c32,!![]);}catch(_0x535255){return BPromise['reject'](_0x535255);}return _0x10d8c3[_0x8566('0x23')]();};}function saveUpdates(_0x5a2e63,_0x5c7223){return function(_0x306305){if(_0x306305){return _0x306305[_0x8566('0x24')](_0x5a2e63)[_0x8566('0x25')](function(_0x3d6ed6){return _0x3d6ed6;});}return null;};}function removeEntity(_0x819154,_0x3c2ffa){return function(_0x1de25c){if(_0x1de25c){return _0x1de25c[_0x8566('0x26')]()['then'](function(){_0x819154[_0x8566('0x1a')](0xcc)[_0x8566('0x1b')]();});}};}function handleEntityNotFound(_0x4df413,_0x7f4bff){return function(_0x51ac2f){if(!_0x51ac2f){_0x4df413['sendStatus'](0x194);}return _0x51ac2f;};}function handleError(_0x505337,_0xc17e23){_0xc17e23=_0xc17e23||0x1f4;return function(_0x44e4d5){logger[_0x8566('0x27')](_0x44e4d5[_0x8566('0x28')]);if(_0x44e4d5['name']){delete _0x44e4d5[_0x8566('0x29')];}_0x505337['status'](_0xc17e23)[_0x8566('0x2a')](_0x44e4d5);};}exports[_0x8566('0x2b')]=function(_0xddd8f3,_0x582203){var _0x141557={},_0x5e6dc6={},_0x4ff8e3={'count':0x0,'rows':[]};var _0x522478=_['map'](db[_0x8566('0x2c')]['rawAttributes'],function(_0x1054e1){return{'name':_0x1054e1['fieldName'],'type':_0x1054e1['type'][_0x8566('0x2d')]};});_0x5e6dc6[_0x8566('0x2e')]=_[_0x8566('0x2f')](_0x522478,_0x8566('0x29'));_0x5e6dc6['query']=_[_0x8566('0x30')](_0xddd8f3[_0x8566('0x31')]);_0x5e6dc6[_0x8566('0x32')]=_['intersection'](_0x5e6dc6[_0x8566('0x2e')],_0x5e6dc6[_0x8566('0x31')]);_0x141557[_0x8566('0x33')]=_[_0x8566('0x34')](_0x5e6dc6[_0x8566('0x2e')],qs[_0x8566('0x35')](_0xddd8f3['query'][_0x8566('0x35')]));_0x141557[_0x8566('0x33')]=_0x141557[_0x8566('0x33')][_0x8566('0x36')]?_0x141557[_0x8566('0x33')]:_0x5e6dc6[_0x8566('0x2e')];if(!_0xddd8f3[_0x8566('0x31')][_0x8566('0x37')](_0x8566('0x38'))){_0x141557[_0x8566('0x1d')]=qs['limit'](_0xddd8f3['query']['limit']);_0x141557['offset']=qs[_0x8566('0x39')](_0xddd8f3['query'][_0x8566('0x39')]);}_0x141557[_0x8566('0x3a')]=qs['sort'](_0xddd8f3[_0x8566('0x31')][_0x8566('0x3b')]);_0x141557[_0x8566('0x3c')]=qs[_0x8566('0x32')](_['pick'](_0xddd8f3[_0x8566('0x31')],_0x5e6dc6[_0x8566('0x32')]),_0x522478);if(_0xddd8f3[_0x8566('0x31')][_0x8566('0x3d')]){_0x141557[_0x8566('0x3c')]=_[_0x8566('0x3e')](_0x141557['where'],{'$or':_[_0x8566('0x2f')](_0x522478,function(_0x3a3986){if(_0x3a3986[_0x8566('0x3f')]!==_0x8566('0x40')){var _0x3134c6={};_0x3134c6[_0x3a3986[_0x8566('0x29')]]={'$like':'%'+_0xddd8f3[_0x8566('0x31')][_0x8566('0x3d')]+'%'};return _0x3134c6;}})});}_0x141557=_[_0x8566('0x3e')]({},_0x141557,_0xddd8f3['options']);var _0x290d5f={'where':_0x141557['where']};return db[_0x8566('0x2c')][_0x8566('0x1e')](_0x290d5f)[_0x8566('0x25')](function(_0x51bc2c){_0x4ff8e3[_0x8566('0x1e')]=_0x51bc2c;if(_0xddd8f3['query'][_0x8566('0x41')]){_0x141557[_0x8566('0x42')]=[{'all':!![]}];}return db[_0x8566('0x2c')][_0x8566('0x43')](_0x141557);})[_0x8566('0x25')](function(_0x45d169){_0x4ff8e3['rows']=_0x45d169;return _0x4ff8e3;})['then'](respondWithFilteredResult(_0x582203,_0x141557))[_0x8566('0x44')](handleError(_0x582203,null));};exports[_0x8566('0x45')]=function(_0x182a8d,_0x185d9d){var _0x2e5257={'raw':![],'where':{'id':_0x182a8d[_0x8566('0x46')]['id']}},_0x9a11f7={};_0x9a11f7['model']=_[_0x8566('0x30')](db[_0x8566('0x2c')][_0x8566('0x47')]);_0x9a11f7[_0x8566('0x31')]=_[_0x8566('0x30')](_0x182a8d[_0x8566('0x31')]);_0x9a11f7['filters']=_[_0x8566('0x34')](_0x9a11f7[_0x8566('0x2e')],_0x9a11f7[_0x8566('0x31')]);_0x2e5257[_0x8566('0x33')]=_['intersection'](_0x9a11f7[_0x8566('0x2e')],qs[_0x8566('0x35')](_0x182a8d[_0x8566('0x31')][_0x8566('0x35')]));_0x2e5257['attributes']=_0x2e5257['attributes']['length']?_0x2e5257['attributes']:_0x9a11f7[_0x8566('0x2e')];if(_0x182a8d[_0x8566('0x31')]['includeAll']){_0x2e5257[_0x8566('0x42')]=[{'all':!![]}];}_0x2e5257=_[_0x8566('0x3e')]({},_0x2e5257,_0x182a8d['options']);return db[_0x8566('0x2c')][_0x8566('0x48')](_0x2e5257)[_0x8566('0x25')](handleEntityNotFound(_0x185d9d,null))[_0x8566('0x25')](respondWithResult(_0x185d9d,null))['catch'](handleError(_0x185d9d,null));};exports[_0x8566('0x49')]=function(_0x384da6,_0x18248b){return db[_0x8566('0x2c')][_0x8566('0x49')](_0x384da6['body'],{})[_0x8566('0x25')](respondWithResult(_0x18248b,0xc9))[_0x8566('0x44')](handleError(_0x18248b,null));};exports[_0x8566('0x24')]=function(_0xcb2084,_0x2ca225){if(_0xcb2084[_0x8566('0x4a')]['id']){delete _0xcb2084[_0x8566('0x4a')]['id'];}return db[_0x8566('0x2c')][_0x8566('0x48')]({'where':{'id':_0xcb2084[_0x8566('0x46')]['id']}})[_0x8566('0x25')](handleEntityNotFound(_0x2ca225,null))[_0x8566('0x25')](saveUpdates(_0xcb2084[_0x8566('0x4a')],null))[_0x8566('0x25')](respondWithResult(_0x2ca225,null))[_0x8566('0x44')](handleError(_0x2ca225,null));};exports[_0x8566('0x26')]=function(_0x3ad1b5,_0x3102ae){return db[_0x8566('0x2c')][_0x8566('0x48')]({'where':{'id':_0x3ad1b5[_0x8566('0x46')]['id']}})[_0x8566('0x25')](handleEntityNotFound(_0x3102ae,null))['then'](removeEntity(_0x3102ae,null))['catch'](handleError(_0x3102ae,null));};exports[_0x8566('0x4b')]=function(_0x27b33f,_0x2923c9){return db[_0x8566('0x2c')][_0x8566('0x4b')]()[_0x8566('0x25')](respondWithResult(_0x2923c9,null))[_0x8566('0x44')](handleError(_0x2923c9,null));}; \ No newline at end of file +var _0x74d8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0x74d8,0x8a));var _0x874d=function(_0x5cafb2,_0x7e912e){_0x5cafb2=_0x5cafb2-0x0;var _0x356d13=_0x74d8[_0x5cafb2];return _0x356d13;};'use strict';var emlformat=require(_0x874d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x874d('0x1'));var jsonpatch=require(_0x874d('0x2'));var rp=require(_0x874d('0x3'));var moment=require(_0x874d('0x4'));var BPromise=require(_0x874d('0x5'));var Mustache=require(_0x874d('0x6'));var util=require(_0x874d('0x7'));var path=require(_0x874d('0x8'));var sox=require(_0x874d('0x9'));var csv=require(_0x874d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x874d('0xb'));var _=require(_0x874d('0xc'));var squel=require('squel');var crypto=require(_0x874d('0xd'));var jsforce=require(_0x874d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x874d('0xa'));var querystring=require(_0x874d('0xf'));var Papa=require(_0x874d('0x10'));var Redis=require('ioredis');var authService=require(_0x874d('0x11'));var qs=require(_0x874d('0x12'));var as=require(_0x874d('0x13'));var hardwareService=require(_0x874d('0x14'));var logger=require(_0x874d('0x15'))(_0x874d('0x16'));var utils=require(_0x874d('0x17'));var config=require(_0x874d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x874d('0x19'))['db'];function respondWithStatusCode(_0x52b4c6,_0x469c9c){_0x469c9c=_0x469c9c||0xcc;return function(_0x388a19){if(_0x388a19){return _0x52b4c6['sendStatus'](_0x469c9c);}return _0x52b4c6[_0x874d('0x1a')](_0x469c9c)[_0x874d('0x1b')]();};}function respondWithResult(_0x36306f,_0x286da3){_0x286da3=_0x286da3||0xc8;return function(_0x11f227){if(_0x11f227){return _0x36306f['status'](_0x286da3)['json'](_0x11f227);}};}function respondWithFilteredResult(_0xa50f58,_0x5d5eb2){return function(_0x46b4af){if(_0x46b4af){var _0x337cbb=typeof _0x5d5eb2[_0x874d('0x1c')]===_0x874d('0x1d')&&typeof _0x5d5eb2[_0x874d('0x1e')]===_0x874d('0x1d');var _0x21c126=_0x46b4af[_0x874d('0x1f')];var _0x33c578=_0x337cbb?0x0:_0x5d5eb2['offset'];var _0xa46474=_0x337cbb?_0x46b4af['count']:_0x5d5eb2[_0x874d('0x1c')]+_0x5d5eb2[_0x874d('0x1e')];var _0x5e7550;if(_0xa46474>=_0x21c126){_0xa46474=_0x21c126;_0x5e7550=0xc8;}else{_0x5e7550=0xce;}_0xa50f58['status'](_0x5e7550);return _0xa50f58[_0x874d('0x20')](_0x874d('0x21'),_0x33c578+'-'+_0xa46474+'/'+_0x21c126)[_0x874d('0x22')](_0x46b4af);}return null;};}function patchUpdates(_0x46f42a){return function(_0x1fdf9a){try{jsonpatch[_0x874d('0x23')](_0x1fdf9a,_0x46f42a,!![]);}catch(_0x58f2c1){return BPromise['reject'](_0x58f2c1);}return _0x1fdf9a[_0x874d('0x24')]();};}function saveUpdates(_0x13397d,_0x10648d){return function(_0x402092){if(_0x402092){return _0x402092[_0x874d('0x25')](_0x13397d)[_0x874d('0x26')](function(_0x483d10){return _0x483d10;});}return null;};}function removeEntity(_0x1cea3b,_0x17f203){return function(_0x53f200){if(_0x53f200){return _0x53f200[_0x874d('0x27')]()[_0x874d('0x26')](function(){_0x1cea3b[_0x874d('0x1a')](0xcc)[_0x874d('0x1b')]();});}};}function handleEntityNotFound(_0x3e796e,_0x2c20ec){return function(_0x4582e6){if(!_0x4582e6){_0x3e796e['sendStatus'](0x194);}return _0x4582e6;};}function handleError(_0xb144a6,_0x3c5946){_0x3c5946=_0x3c5946||0x1f4;return function(_0x1c939a){logger[_0x874d('0x28')](_0x1c939a[_0x874d('0x29')]);if(_0x1c939a['name']){delete _0x1c939a[_0x874d('0x2a')];}_0xb144a6[_0x874d('0x1a')](_0x3c5946)[_0x874d('0x2b')](_0x1c939a);};}exports[_0x874d('0x2c')]=function(_0x43afb7,_0x501445){var _0x1dd643={},_0x1d1f6e={},_0x40c31e={'count':0x0,'rows':[]};var _0x46a089=_['map'](db[_0x874d('0x2d')]['rawAttributes'],function(_0x1ea341){return{'name':_0x1ea341['fieldName'],'type':_0x1ea341[_0x874d('0x2e')][_0x874d('0x2f')]};});_0x1d1f6e[_0x874d('0x30')]=_[_0x874d('0x31')](_0x46a089,_0x874d('0x2a'));_0x1d1f6e['query']=_[_0x874d('0x32')](_0x43afb7[_0x874d('0x33')]);_0x1d1f6e[_0x874d('0x34')]=_[_0x874d('0x35')](_0x1d1f6e[_0x874d('0x30')],_0x1d1f6e['query']);_0x1dd643[_0x874d('0x36')]=_[_0x874d('0x35')](_0x1d1f6e[_0x874d('0x30')],qs[_0x874d('0x37')](_0x43afb7[_0x874d('0x33')][_0x874d('0x37')]));_0x1dd643[_0x874d('0x36')]=_0x1dd643[_0x874d('0x36')][_0x874d('0x38')]?_0x1dd643[_0x874d('0x36')]:_0x1d1f6e['model'];if(!_0x43afb7['query'][_0x874d('0x39')](_0x874d('0x3a'))){_0x1dd643[_0x874d('0x1e')]=qs[_0x874d('0x1e')](_0x43afb7[_0x874d('0x33')]['limit']);_0x1dd643[_0x874d('0x1c')]=qs[_0x874d('0x1c')](_0x43afb7[_0x874d('0x33')][_0x874d('0x1c')]);}_0x1dd643[_0x874d('0x3b')]=qs[_0x874d('0x3c')](_0x43afb7['query']['sort']);_0x1dd643[_0x874d('0x3d')]=qs[_0x874d('0x34')](_[_0x874d('0x3e')](_0x43afb7[_0x874d('0x33')],_0x1d1f6e[_0x874d('0x34')]),_0x46a089);if(_0x43afb7['query'][_0x874d('0x3f')]){_0x1dd643['where']=_[_0x874d('0x40')](_0x1dd643[_0x874d('0x3d')],{'$or':_[_0x874d('0x31')](_0x46a089,function(_0xe6c970){if(_0xe6c970[_0x874d('0x2e')]!==_0x874d('0x41')){var _0x1f483d={};_0x1f483d[_0xe6c970[_0x874d('0x2a')]]={'$like':'%'+_0x43afb7[_0x874d('0x33')][_0x874d('0x3f')]+'%'};return _0x1f483d;}})});}_0x1dd643=_[_0x874d('0x40')]({},_0x1dd643,_0x43afb7[_0x874d('0x42')]);var _0x515678={'where':_0x1dd643[_0x874d('0x3d')]};return db['IntegrationReport']['count'](_0x515678)[_0x874d('0x26')](function(_0x495e78){_0x40c31e['count']=_0x495e78;if(_0x43afb7['query'][_0x874d('0x43')]){_0x1dd643['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x874d('0x44')](_0x1dd643);})[_0x874d('0x26')](function(_0x105b2f){_0x40c31e[_0x874d('0x45')]=_0x105b2f;return _0x40c31e;})['then'](respondWithFilteredResult(_0x501445,_0x1dd643))[_0x874d('0x46')](handleError(_0x501445,null));};exports[_0x874d('0x47')]=function(_0x247b03,_0x36013e){var _0x1f7a74={'raw':![],'where':{'id':_0x247b03['params']['id']}},_0x150ed1={};_0x150ed1[_0x874d('0x30')]=_[_0x874d('0x32')](db[_0x874d('0x2d')][_0x874d('0x48')]);_0x150ed1[_0x874d('0x33')]=_[_0x874d('0x32')](_0x247b03[_0x874d('0x33')]);_0x150ed1[_0x874d('0x34')]=_[_0x874d('0x35')](_0x150ed1['model'],_0x150ed1[_0x874d('0x33')]);_0x1f7a74[_0x874d('0x36')]=_['intersection'](_0x150ed1['model'],qs[_0x874d('0x37')](_0x247b03[_0x874d('0x33')][_0x874d('0x37')]));_0x1f7a74[_0x874d('0x36')]=_0x1f7a74[_0x874d('0x36')][_0x874d('0x38')]?_0x1f7a74[_0x874d('0x36')]:_0x150ed1[_0x874d('0x30')];if(_0x247b03[_0x874d('0x33')][_0x874d('0x43')]){_0x1f7a74[_0x874d('0x49')]=[{'all':!![]}];}_0x1f7a74=_[_0x874d('0x40')]({},_0x1f7a74,_0x247b03[_0x874d('0x42')]);return db[_0x874d('0x2d')][_0x874d('0x4a')](_0x1f7a74)[_0x874d('0x26')](handleEntityNotFound(_0x36013e,null))[_0x874d('0x26')](respondWithResult(_0x36013e,null))[_0x874d('0x46')](handleError(_0x36013e,null));};exports[_0x874d('0x4b')]=function(_0xba3196,_0x1dd416){return db['IntegrationReport'][_0x874d('0x4b')](_0xba3196[_0x874d('0x4c')],{})[_0x874d('0x26')](respondWithResult(_0x1dd416,0xc9))['catch'](handleError(_0x1dd416,null));};exports[_0x874d('0x25')]=function(_0x521dc4,_0x2766fd){if(_0x521dc4[_0x874d('0x4c')]['id']){delete _0x521dc4[_0x874d('0x4c')]['id'];}return db[_0x874d('0x2d')][_0x874d('0x4a')]({'where':{'id':_0x521dc4['params']['id']}})['then'](handleEntityNotFound(_0x2766fd,null))[_0x874d('0x26')](saveUpdates(_0x521dc4[_0x874d('0x4c')],null))['then'](respondWithResult(_0x2766fd,null))[_0x874d('0x46')](handleError(_0x2766fd,null));};exports[_0x874d('0x27')]=function(_0x505393,_0x5b30ee){return db[_0x874d('0x2d')][_0x874d('0x4a')]({'where':{'id':_0x505393['params']['id']}})[_0x874d('0x26')](handleEntityNotFound(_0x5b30ee,null))[_0x874d('0x26')](removeEntity(_0x5b30ee,null))[_0x874d('0x46')](handleError(_0x5b30ee,null));};exports[_0x874d('0x4d')]=function(_0x112dc0,_0x115baa){return db[_0x874d('0x2d')][_0x874d('0x4d')]()['then'](respondWithResult(_0x115baa,null))['catch'](handleError(_0x115baa,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a493e34..8b8d8c1 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 _0xd1f2=['report_integration','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','IntegrationReport'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0xd1f2,0x64));var _0x2d1f=function(_0x41ed52,_0x279da2){_0x41ed52=_0x41ed52-0x0;var _0x4b120e=_0xd1f2[_0x41ed52];return _0x4b120e;};'use strict';var _=require(_0x2d1f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d1f('0x1'));var moment=require(_0x2d1f('0x2'));var BPromise=require(_0x2d1f('0x3'));var rp=require(_0x2d1f('0x4'));var fs=require('fs');var path=require(_0x2d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x2d1f('0x6'));var attributes=require('./integrationReport.attributes');module[_0x2d1f('0x7')]=function(_0x431c14,_0x4dad7c){return _0x431c14[_0x2d1f('0x8')](_0x2d1f('0x9'),attributes,{'tableName':_0x2d1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb6c=['request-promise','path','rimraf','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19cbcc,_0x44384e){var _0x44d405=function(_0x475354){while(--_0x475354){_0x19cbcc['push'](_0x19cbcc['shift']());}};_0x44d405(++_0x44384e);}(_0xdb6c,0x180));var _0xcdb6=function(_0x419181,_0x5d70b7){_0x419181=_0x419181-0x0;var _0xacf6b1=_0xdb6c[_0x419181];return _0xacf6b1;};'use strict';var _=require(_0xcdb6('0x0'));var util=require(_0xcdb6('0x1'));var logger=require(_0xcdb6('0x2'))(_0xcdb6('0x3'));var moment=require(_0xcdb6('0x4'));var BPromise=require(_0xcdb6('0x5'));var rp=require(_0xcdb6('0x6'));var fs=require('fs');var path=require(_0xcdb6('0x7'));var rimraf=require(_0xcdb6('0x8'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xcdb6('0x9')]=function(_0x579e02,_0x365fb9){return _0x579e02[_0xcdb6('0xa')](_0xcdb6('0xb'),attributes,{'tableName':_0xcdb6('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 88e5918..8ea9cf6 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x3a2c62,_0x3cef74){var _0xcbb850=function(_0x22fff0){while(--_0x22fff0){_0x3a2c62['push'](_0x3a2c62['shift']());}};_0xcbb850(++_0x3cef74);}(_0x187d,0x93));var _0xd187=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x187d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\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(_0x3941e8,_0x2f5cdb){var _0x1c4941=function(_0x5a1309){while(--_0x5a1309){_0x3941e8['push'](_0x3941e8['shift']());}};_0x1c4941(++_0x2f5cdb);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1b87ae,_0xc9ab58){_0x1b87ae=_0x1b87ae-0x0;var _0x36a592=_0xc6ac[_0x1b87ae];return _0x36a592;};'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']('IntegrationReport,\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/interval/index.js b/server/api/interval/index.js index 4b16a89..1ba081c 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 _0x3d41=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d41,0xea));var _0x13d4=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x3d41[_0x401d67];return _0x25076b;};'use strict';var multer=require('multer');var util=require(_0x13d4('0x0'));var path=require(_0x13d4('0x1'));var timeout=require(_0x13d4('0x2'));var express=require(_0x13d4('0x3'));var router=express[_0x13d4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x13d4('0x5'));var config=require(_0x13d4('0x6'));var controller=require('./interval.controller');router[_0x13d4('0x7')]('/',auth[_0x13d4('0x8')](),controller[_0x13d4('0x9')]);router[_0x13d4('0x7')](_0x13d4('0xa'),auth[_0x13d4('0x8')](),controller[_0x13d4('0xb')]);router['get'](_0x13d4('0xc'),auth['isAuthenticated'](),controller['getIntervals']);router[_0x13d4('0xd')]('/',auth[_0x13d4('0x8')](),controller['create']);router[_0x13d4('0xd')](_0x13d4('0xc'),auth['isAuthenticated'](),controller[_0x13d4('0xe')]);router[_0x13d4('0xd')](_0x13d4('0xf'),auth[_0x13d4('0x8')](),controller['addIntervals']);router[_0x13d4('0x10')](_0x13d4('0xa'),auth[_0x13d4('0x8')](),controller['update']);router[_0x13d4('0x11')]('/:id',auth[_0x13d4('0x8')](),controller[_0x13d4('0x12')]);module[_0x13d4('0x13')]=router; \ No newline at end of file +var _0xf52f=['/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xf52f,0x113));var _0xff52=function(_0x29740e,_0x200cc1){_0x29740e=_0x29740e-0x0;var _0x89660b=_0xf52f[_0x29740e];return _0x89660b;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var fs_extra=require(_0xff52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff52('0x6'));var config=require(_0xff52('0x7'));var controller=require('./interval.controller');router[_0xff52('0x8')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0xa')]);router[_0xff52('0x8')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0xc')]);router[_0xff52('0x8')](_0xff52('0xd'),auth[_0xff52('0x9')](),controller[_0xff52('0xe')]);router[_0xff52('0xf')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0x10')]);router[_0xff52('0xf')](_0xff52('0xd'),auth[_0xff52('0x9')](),controller[_0xff52('0x11')]);router[_0xff52('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xff52('0x12')]);router['put'](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x13')]);router[_0xff52('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xff52('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 6543141..da5c9bd 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 _0x28ec=['sequelize','STRING'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x28ec,0x176));var _0xc28e=function(_0x4186a6,_0x33785c){_0x4186a6=_0x4186a6-0x0;var _0x4b29c6=_0x28ec[_0x4186a6];return _0x4b29c6;};'use strict';var Sequelize=require(_0xc28e('0x0'));module['exports']={'name':{'type':Sequelize[_0xc28e('0x1')]},'description':{'type':Sequelize[_0xc28e('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa16f=['sequelize','exports','STRING'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xa16f,0x147));var _0xfa16=function(_0x518eb3,_0x193d2f){_0x518eb3=_0x518eb3-0x0;var _0x39d991=_0xa16f[_0x518eb3];return _0x39d991;};'use strict';var Sequelize=require(_0xfa16('0x0'));module[_0xfa16('0x1')]={'name':{'type':Sequelize[_0xfa16('0x2')]},'description':{'type':Sequelize[_0xfa16('0x2')]},'interval':{'type':Sequelize[_0xfa16('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 c8e32d6..4fcdb58 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 _0x32fd=['length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','create','body','user','role','Intervals','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','sort','addIntervals','bulkCreate','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','map','Interval','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model'];(function(_0xe11ebc,_0x482741){var _0xafa89b=function(_0x50f805){while(--_0x50f805){_0xe11ebc['push'](_0xe11ebc['shift']());}};_0xafa89b(++_0x482741);}(_0x32fd,0x76));var _0xd32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd32f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd32f('0x1'));var rp=require(_0xd32f('0x2'));var moment=require(_0xd32f('0x3'));var BPromise=require(_0xd32f('0x4'));var Mustache=require(_0xd32f('0x5'));var util=require(_0xd32f('0x6'));var path=require(_0xd32f('0x7'));var sox=require(_0xd32f('0x8'));var csv=require(_0xd32f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd32f('0xa'));var crypto=require(_0xd32f('0xb'));var jsforce=require(_0xd32f('0xc'));var deskjs=require(_0xd32f('0xd'));var toCsv=require(_0xd32f('0x9'));var querystring=require('querystring');var Papa=require(_0xd32f('0xe'));var Redis=require(_0xd32f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd32f('0x10'));var as=require(_0xd32f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd32f('0x12'))(_0xd32f('0x13'));var utils=require('../../config/utils');var config=require(_0xd32f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd32f('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x27ed10,_0x510e1e){_0x510e1e=_0x510e1e||0xcc;return function(_0x362fa9){if(_0x362fa9){return _0x27ed10['sendStatus'](_0x510e1e);}return _0x27ed10[_0xd32f('0x16')](_0x510e1e)['end']();};}function respondWithResult(_0x701d9f,_0x38eba5){_0x38eba5=_0x38eba5||0xc8;return function(_0x34b34a){if(_0x34b34a){return _0x701d9f[_0xd32f('0x16')](_0x38eba5)[_0xd32f('0x17')](_0x34b34a);}};}function respondWithFilteredResult(_0x5cb988,_0x254bc1){return function(_0x69ccfc){if(_0x69ccfc){var _0x2b0e30=typeof _0x254bc1[_0xd32f('0x18')]===_0xd32f('0x19')&&typeof _0x254bc1[_0xd32f('0x1a')]===_0xd32f('0x19');var _0x34b774=_0x69ccfc[_0xd32f('0x1b')];var _0x5bfb31=_0x2b0e30?0x0:_0x254bc1[_0xd32f('0x18')];var _0x2f0a0b=_0x2b0e30?_0x69ccfc[_0xd32f('0x1b')]:_0x254bc1[_0xd32f('0x18')]+_0x254bc1[_0xd32f('0x1a')];var _0x4f53cf;if(_0x2f0a0b>=_0x34b774){_0x2f0a0b=_0x34b774;_0x4f53cf=0xc8;}else{_0x4f53cf=0xce;}_0x5cb988[_0xd32f('0x16')](_0x4f53cf);return _0x5cb988[_0xd32f('0x1c')]('Content-Range',_0x5bfb31+'-'+_0x2f0a0b+'/'+_0x34b774)[_0xd32f('0x17')](_0x69ccfc);}return null;};}function patchUpdates(_0x2a8f52){return function(_0x4c20fa){try{jsonpatch[_0xd32f('0x1d')](_0x4c20fa,_0x2a8f52,!![]);}catch(_0x4a08cc){return BPromise[_0xd32f('0x1e')](_0x4a08cc);}return _0x4c20fa[_0xd32f('0x1f')]();};}function saveUpdates(_0x374e27,_0x43c6f7){return function(_0x1f3276){if(_0x1f3276){return _0x1f3276[_0xd32f('0x20')](_0x374e27)[_0xd32f('0x21')](function(_0x17cb4c){return _0x17cb4c;});}return null;};}function removeEntity(_0x15f96c,_0x37636b){return function(_0x1f10e0){if(_0x1f10e0){return _0x1f10e0[_0xd32f('0x22')]()[_0xd32f('0x21')](function(){var _0x47f5bc=_0x1f10e0[_0xd32f('0x23')]({'plain':!![]});var _0x2fb929='Intervals';return db[_0xd32f('0x24')][_0xd32f('0x22')]({'where':{'type':_0x2fb929,'resourceId':_0x47f5bc['id']}})[_0xd32f('0x21')](function(){return _0x1f10e0;});})[_0xd32f('0x21')](function(){_0x15f96c[_0xd32f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42afde,_0x3f64f0){return function(_0x11b34a){if(!_0x11b34a){_0x42afde[_0xd32f('0x25')](0x194);}return _0x11b34a;};}function handleError(_0x17615d,_0x41bed5){_0x41bed5=_0x41bed5||0x1f4;return function(_0x4d6993){logger['error'](_0x4d6993[_0xd32f('0x26')]);if(_0x4d6993[_0xd32f('0x27')]){delete _0x4d6993['name'];}_0x17615d[_0xd32f('0x16')](_0x41bed5)[_0xd32f('0x28')](_0x4d6993);};}exports['index']=function(_0x48a3ed,_0x34be91){var _0x4fe9bf={},_0x85a6d8={},_0x4d948f={'count':0x0,'rows':[]};var _0x188a7d=_[_0xd32f('0x29')](db[_0xd32f('0x2a')][_0xd32f('0x2b')],function(_0x35e1a0){return{'name':_0x35e1a0[_0xd32f('0x2c')],'type':_0x35e1a0[_0xd32f('0x2d')]['key']};});_0x85a6d8['model']=_[_0xd32f('0x29')](_0x188a7d,_0xd32f('0x27'));_0x85a6d8[_0xd32f('0x2e')]=_[_0xd32f('0x2f')](_0x48a3ed['query']);_0x85a6d8[_0xd32f('0x30')]=_[_0xd32f('0x31')](_0x85a6d8['model'],_0x85a6d8['query']);_0x4fe9bf[_0xd32f('0x32')]=_['intersection'](_0x85a6d8[_0xd32f('0x33')],qs['fields'](_0x48a3ed[_0xd32f('0x2e')]['fields']));_0x4fe9bf[_0xd32f('0x32')]=_0x4fe9bf[_0xd32f('0x32')][_0xd32f('0x34')]?_0x4fe9bf[_0xd32f('0x32')]:_0x85a6d8[_0xd32f('0x33')];if(!_0x48a3ed[_0xd32f('0x2e')][_0xd32f('0x35')]('nolimit')){_0x4fe9bf['limit']=qs[_0xd32f('0x1a')](_0x48a3ed[_0xd32f('0x2e')][_0xd32f('0x1a')]);_0x4fe9bf[_0xd32f('0x18')]=qs[_0xd32f('0x18')](_0x48a3ed[_0xd32f('0x2e')]['offset']);}_0x4fe9bf[_0xd32f('0x36')]=qs['sort'](_0x48a3ed[_0xd32f('0x2e')]['sort']);_0x4fe9bf[_0xd32f('0x37')]=qs['filters'](_[_0xd32f('0x38')](_0x48a3ed[_0xd32f('0x2e')],_0x85a6d8['filters']),_0x188a7d);if(_0x48a3ed[_0xd32f('0x2e')][_0xd32f('0x39')]){_0x4fe9bf[_0xd32f('0x37')]=_[_0xd32f('0x3a')](_0x4fe9bf[_0xd32f('0x37')],{'$or':_[_0xd32f('0x29')](_0x188a7d,function(_0x6ba59a){if(_0x6ba59a[_0xd32f('0x2d')]!==_0xd32f('0x3b')){var _0x4afa27={};_0x4afa27[_0x6ba59a[_0xd32f('0x27')]]={'$like':'%'+_0x48a3ed[_0xd32f('0x2e')][_0xd32f('0x39')]+'%'};return _0x4afa27;}})});}_0x4fe9bf=_[_0xd32f('0x3a')]({},_0x4fe9bf,_0x48a3ed[_0xd32f('0x3c')]);var _0x2562e1={'where':_0x4fe9bf[_0xd32f('0x37')]};return db[_0xd32f('0x2a')][_0xd32f('0x1b')](_0x2562e1)['then'](function(_0x458616){_0x4d948f[_0xd32f('0x1b')]=_0x458616;if(_0x48a3ed[_0xd32f('0x2e')][_0xd32f('0x3d')]){_0x4fe9bf[_0xd32f('0x3e')]=[{'all':!![]}];}return db[_0xd32f('0x2a')][_0xd32f('0x3f')](_0x4fe9bf);})[_0xd32f('0x21')](function(_0xd5da1c){_0x4d948f['rows']=_0xd5da1c;return _0x4d948f;})[_0xd32f('0x21')](respondWithFilteredResult(_0x34be91,_0x4fe9bf))[_0xd32f('0x40')](handleError(_0x34be91,null));};exports[_0xd32f('0x41')]=function(_0x48cde8,_0xfb6ed){var _0x46c346={'raw':!![],'where':{'id':_0x48cde8[_0xd32f('0x42')]['id']}},_0x2908c5={};_0x2908c5[_0xd32f('0x33')]=_[_0xd32f('0x2f')](db[_0xd32f('0x2a')]['rawAttributes']);_0x2908c5['query']=_[_0xd32f('0x2f')](_0x48cde8[_0xd32f('0x2e')]);_0x2908c5[_0xd32f('0x30')]=_['intersection'](_0x2908c5['model'],_0x2908c5[_0xd32f('0x2e')]);_0x46c346[_0xd32f('0x32')]=_[_0xd32f('0x31')](_0x2908c5['model'],qs[_0xd32f('0x43')](_0x48cde8['query'][_0xd32f('0x43')]));_0x46c346[_0xd32f('0x32')]=_0x46c346['attributes'][_0xd32f('0x34')]?_0x46c346['attributes']:_0x2908c5[_0xd32f('0x33')];if(_0x48cde8[_0xd32f('0x2e')]['includeAll']){_0x46c346[_0xd32f('0x3e')]=[{'all':!![]}];}_0x46c346=_['merge']({},_0x46c346,_0x48cde8[_0xd32f('0x3c')]);return db['Interval']['find'](_0x46c346)[_0xd32f('0x21')](handleEntityNotFound(_0xfb6ed,null))[_0xd32f('0x21')](respondWithResult(_0xfb6ed,null))[_0xd32f('0x40')](handleError(_0xfb6ed,null));};exports[_0xd32f('0x44')]=function(_0x422592,_0xc103de){return db[_0xd32f('0x2a')]['create'](_0x422592[_0xd32f('0x45')],{})['then'](function(_0x1faf2d){var _0xd26f7e=_0x422592[_0xd32f('0x46')]['get']({'plain':!![]});if(!_0xd26f7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd26f7e[_0xd32f('0x47')]===_0xd32f('0x46')){var _0x52745f=_0x1faf2d[_0xd32f('0x23')]({'plain':!![]});var _0x49601d=_0xd32f('0x48');return db[_0xd32f('0x49')][_0xd32f('0x4a')]({'where':{'name':_0x49601d,'userProfileId':_0xd26f7e[_0xd32f('0x4b')]},'raw':!![]})[_0xd32f('0x21')](function(_0x2c574c){if(_0x2c574c&&_0x2c574c[_0xd32f('0x4c')]===0x0){return db[_0xd32f('0x24')]['create']({'name':_0x52745f[_0xd32f('0x27')],'resourceId':_0x52745f['id'],'type':_0x2c574c[_0xd32f('0x27')],'sectionId':_0x2c574c['id']},{})[_0xd32f('0x21')](function(){return _0x1faf2d;});}else{return _0x1faf2d;}})[_0xd32f('0x40')](function(_0x53ac26){logger[_0xd32f('0x4d')](_0xd32f('0x4e'),_0x53ac26);throw _0x53ac26;});}return _0x1faf2d;})[_0xd32f('0x21')](respondWithResult(_0xc103de,0xc9))[_0xd32f('0x40')](handleError(_0xc103de,null));};exports[_0xd32f('0x20')]=function(_0x29a26f,_0x5914fa){if(_0x29a26f[_0xd32f('0x45')]['id']){delete _0x29a26f[_0xd32f('0x45')]['id'];}return db[_0xd32f('0x2a')][_0xd32f('0x4a')]({'where':{'id':_0x29a26f[_0xd32f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5914fa,null))[_0xd32f('0x21')](saveUpdates(_0x29a26f[_0xd32f('0x45')],null))[_0xd32f('0x21')](respondWithResult(_0x5914fa,null))[_0xd32f('0x40')](handleError(_0x5914fa,null));};exports['destroy']=function(_0x33d3bd,_0x51a36a){return db['Interval'][_0xd32f('0x4a')]({'where':{'id':_0x33d3bd[_0xd32f('0x42')]['id']}})['then'](handleEntityNotFound(_0x51a36a,null))['then'](removeEntity(_0x51a36a,null))[_0xd32f('0x40')](handleError(_0x51a36a,null));};exports[_0xd32f('0x4f')]=function(_0x4e4c2a,_0x5d9bc0,_0x515fce){if(_0x4e4c2a[_0xd32f('0x45')]['id']){delete _0x4e4c2a[_0xd32f('0x45')]['id'];}return db['Interval']['find']({'where':{'id':_0x4e4c2a['params']['id']}})['then'](handleEntityNotFound(_0x5d9bc0,null))[_0xd32f('0x21')](function(_0x18035b){if(_0x18035b){_0x4e4c2a[_0xd32f('0x45')]['IntervalId']=_0x18035b['id'];return db[_0xd32f('0x2a')]['create'](_0x4e4c2a['body']);}})[_0xd32f('0x21')](respondWithResult(_0x5d9bc0,null))[_0xd32f('0x40')](handleError(_0x5d9bc0,null));};exports[_0xd32f('0x50')]=function(_0x460984,_0x3abbdc,_0xc8573d){var _0x11872c={};var _0x518cce={};var _0x373cf0;var _0x356d1;return db[_0xd32f('0x2a')][_0xd32f('0x51')]({'where':{'id':_0x460984[_0xd32f('0x42')]['id']}})[_0xd32f('0x21')](handleEntityNotFound(_0x3abbdc,null))[_0xd32f('0x21')](function(_0x3a3d37){if(_0x3a3d37){_0x373cf0=_0x3a3d37;_0x518cce['model']=_[_0xd32f('0x2f')](db[_0xd32f('0x2a')]['rawAttributes']);_0x518cce[_0xd32f('0x2e')]=_[_0xd32f('0x2f')](_0x460984[_0xd32f('0x2e')]);_0x518cce[_0xd32f('0x30')]=_[_0xd32f('0x31')](_0x518cce[_0xd32f('0x33')],_0x518cce[_0xd32f('0x2e')]);_0x11872c['attributes']=_['intersection'](_0x518cce[_0xd32f('0x33')],qs['fields'](_0x460984[_0xd32f('0x2e')][_0xd32f('0x43')]));_0x11872c[_0xd32f('0x32')]=_0x11872c['attributes']['length']?_0x11872c[_0xd32f('0x32')]:_0x518cce[_0xd32f('0x33')];_0x11872c[_0xd32f('0x36')]=qs['sort'](_0x460984[_0xd32f('0x2e')][_0xd32f('0x52')]);_0x11872c[_0xd32f('0x37')]=qs[_0xd32f('0x30')](_[_0xd32f('0x38')](_0x460984[_0xd32f('0x2e')],_0x518cce[_0xd32f('0x30')]));if(_0x460984['query'][_0xd32f('0x39')]){_0x11872c[_0xd32f('0x37')]=_[_0xd32f('0x3a')](_0x11872c[_0xd32f('0x37')],{'$or':_[_0xd32f('0x29')](_0x11872c[_0xd32f('0x32')],function(_0x58973b){var _0x2b4264={};_0x2b4264[_0x58973b]={'$like':'%'+_0x460984[_0xd32f('0x2e')][_0xd32f('0x39')]+'%'};return _0x2b4264;})});}_0x11872c=_[_0xd32f('0x3a')]({},_0x11872c,_0x460984[_0xd32f('0x3c')]);return _0x373cf0['getIntervals'](_0x11872c);}})[_0xd32f('0x21')](function(_0x21a992){if(_0x21a992){_0x356d1=_0x21a992[_0xd32f('0x34')];if(!_0x460984[_0xd32f('0x2e')][_0xd32f('0x35')]('nolimit')){_0x11872c[_0xd32f('0x1a')]=qs[_0xd32f('0x1a')](_0x460984[_0xd32f('0x2e')][_0xd32f('0x1a')]);_0x11872c[_0xd32f('0x18')]=qs['offset'](_0x460984[_0xd32f('0x2e')][_0xd32f('0x18')]);}return _0x373cf0[_0xd32f('0x50')](_0x11872c);}})[_0xd32f('0x21')](function(_0x2b05b9){if(_0x2b05b9){return _0x2b05b9?{'count':_0x356d1,'rows':_0x2b05b9}:null;}})[_0xd32f('0x21')](respondWithResult(_0x3abbdc,null))[_0xd32f('0x40')](handleError(_0x3abbdc,null));};exports[_0xd32f('0x53')]=function(_0x2f9546,_0x4ec846,_0x5e38c2){return db[_0xd32f('0x2a')][_0xd32f('0x51')]({'where':{'id':_0x2f9546[_0xd32f('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ec846,null))[_0xd32f('0x21')](function(_0xaaf2ab){if(_0xaaf2ab){return db['sequelize']['transaction'](function(_0x1c1fee){return db['Interval'][_0xd32f('0x22')]({'where':{'IntervalId':_0x2f9546[_0xd32f('0x42')]['id']},'transaction':_0x1c1fee})['then'](function(_0x1b4df4){var _0x41b10a=_['map'](_0x2f9546['body'],function(_0x2f23f5){delete _0x2f23f5['id'];_0x2f23f5['IntervalId']=_0x2f9546[_0xd32f('0x42')]['id'];return _0x2f23f5;});return db[_0xd32f('0x2a')][_0xd32f('0x54')](_0x41b10a,{'transaction':_0x1c1fee});});})[_0xd32f('0x21')](function(){return db[_0xd32f('0x2a')][_0xd32f('0x3f')]({'where':{'IntervalId':_0x2f9546[_0xd32f('0x42')]['id']}});});}})[_0xd32f('0x21')](respondWithResult(_0x4ec846,null))[_0xd32f('0x40')](handleError(_0x4ec846,null));}; \ No newline at end of file +var _0xdc54=['role','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','sort','getIntervals','addIntervals','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','VIRTUAL','filter','merge','Interval','includeAll','include','rows','catch','show','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x391929,_0x204a58){var _0x30a04b=function(_0x5a752d){while(--_0x5a752d){_0x391929['push'](_0x391929['shift']());}};_0x30a04b(++_0x204a58);}(_0xdc54,0x174));var _0x4dc5=function(_0x67b581,_0x327fd0){_0x67b581=_0x67b581-0x0;var _0x24e142=_0xdc54[_0x67b581];return _0x24e142;};'use strict';var emlformat=require(_0x4dc5('0x0'));var rimraf=require(_0x4dc5('0x1'));var zipdir=require(_0x4dc5('0x2'));var jsonpatch=require(_0x4dc5('0x3'));var rp=require('request-promise');var moment=require(_0x4dc5('0x4'));var BPromise=require(_0x4dc5('0x5'));var Mustache=require(_0x4dc5('0x6'));var util=require('util');var path=require(_0x4dc5('0x7'));var sox=require(_0x4dc5('0x8'));var csv=require(_0x4dc5('0x9'));var ejs=require(_0x4dc5('0xa'));var fs=require('fs');var fs_extra=require(_0x4dc5('0xb'));var _=require(_0x4dc5('0xc'));var squel=require('squel');var crypto=require(_0x4dc5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4dc5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4dc5('0xf'));var Papa=require('papaparse');var Redis=require(_0x4dc5('0x10'));var authService=require(_0x4dc5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4dc5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4dc5('0x13'))(_0x4dc5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4dc5('0x15'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x44995b,_0x4cbf68){_0x4cbf68=_0x4cbf68||0xcc;return function(_0x27851a){if(_0x27851a){return _0x44995b[_0x4dc5('0x16')](_0x4cbf68);}return _0x44995b[_0x4dc5('0x17')](_0x4cbf68)['end']();};}function respondWithResult(_0x3cd904,_0x5b93d2){_0x5b93d2=_0x5b93d2||0xc8;return function(_0x1bead3){if(_0x1bead3){return _0x3cd904[_0x4dc5('0x17')](_0x5b93d2)['json'](_0x1bead3);}};}function respondWithFilteredResult(_0x7416ac,_0x1885fc){return function(_0x414cbe){if(_0x414cbe){var _0x863ba6=typeof _0x1885fc['offset']===_0x4dc5('0x18')&&typeof _0x1885fc[_0x4dc5('0x19')]===_0x4dc5('0x18');var _0x5a6ff7=_0x414cbe[_0x4dc5('0x1a')];var _0x5dfe2c=_0x863ba6?0x0:_0x1885fc[_0x4dc5('0x1b')];var _0xa51bc9=_0x863ba6?_0x414cbe[_0x4dc5('0x1a')]:_0x1885fc['offset']+_0x1885fc[_0x4dc5('0x19')];var _0xbb1333;if(_0xa51bc9>=_0x5a6ff7){_0xa51bc9=_0x5a6ff7;_0xbb1333=0xc8;}else{_0xbb1333=0xce;}_0x7416ac[_0x4dc5('0x17')](_0xbb1333);return _0x7416ac[_0x4dc5('0x1c')](_0x4dc5('0x1d'),_0x5dfe2c+'-'+_0xa51bc9+'/'+_0x5a6ff7)['json'](_0x414cbe);}return null;};}function patchUpdates(_0x1e7fed){return function(_0x37a69a){try{jsonpatch['apply'](_0x37a69a,_0x1e7fed,!![]);}catch(_0x2fd568){return BPromise[_0x4dc5('0x1e')](_0x2fd568);}return _0x37a69a[_0x4dc5('0x1f')]();};}function saveUpdates(_0x417fd6,_0x22352e){return function(_0x1e69ee){if(_0x1e69ee){return _0x1e69ee[_0x4dc5('0x20')](_0x417fd6)[_0x4dc5('0x21')](function(_0x1d03ef){return _0x1d03ef;});}return null;};}function removeEntity(_0x2a4b57,_0x2c2ed6){return function(_0x3a971e){if(_0x3a971e){return _0x3a971e[_0x4dc5('0x22')]()[_0x4dc5('0x21')](function(){var _0x582ae6=_0x3a971e[_0x4dc5('0x23')]({'plain':!![]});var _0x44309f=_0x4dc5('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x44309f,'resourceId':_0x582ae6['id']}})['then'](function(){return _0x3a971e;});})[_0x4dc5('0x21')](function(){_0x2a4b57[_0x4dc5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a16db,_0x4fe658){return function(_0x7f30fd){if(!_0x7f30fd){_0x1a16db[_0x4dc5('0x16')](0x194);}return _0x7f30fd;};}function handleError(_0x31672d,_0x46f722){_0x46f722=_0x46f722||0x1f4;return function(_0x42819e){logger['error'](_0x42819e[_0x4dc5('0x25')]);if(_0x42819e[_0x4dc5('0x26')]){delete _0x42819e[_0x4dc5('0x26')];}_0x31672d['status'](_0x46f722)[_0x4dc5('0x27')](_0x42819e);};}exports[_0x4dc5('0x28')]=function(_0x1fe7f7,_0x16f150){var _0x633733={},_0x5c2fa0={},_0xb849c5={'count':0x0,'rows':[]};var _0x11eee2=_[_0x4dc5('0x29')](db['Interval'][_0x4dc5('0x2a')],function(_0x35d713){return{'name':_0x35d713[_0x4dc5('0x2b')],'type':_0x35d713['type'][_0x4dc5('0x2c')]};});_0x5c2fa0['model']=_[_0x4dc5('0x29')](_0x11eee2,_0x4dc5('0x26'));_0x5c2fa0[_0x4dc5('0x2d')]=_['keys'](_0x1fe7f7['query']);_0x5c2fa0[_0x4dc5('0x2e')]=_[_0x4dc5('0x2f')](_0x5c2fa0[_0x4dc5('0x30')],_0x5c2fa0['query']);_0x633733[_0x4dc5('0x31')]=_[_0x4dc5('0x2f')](_0x5c2fa0[_0x4dc5('0x30')],qs['fields'](_0x1fe7f7[_0x4dc5('0x2d')][_0x4dc5('0x32')]));_0x633733['attributes']=_0x633733[_0x4dc5('0x31')][_0x4dc5('0x33')]?_0x633733['attributes']:_0x5c2fa0[_0x4dc5('0x30')];if(!_0x1fe7f7['query'][_0x4dc5('0x34')](_0x4dc5('0x35'))){_0x633733[_0x4dc5('0x19')]=qs[_0x4dc5('0x19')](_0x1fe7f7['query'][_0x4dc5('0x19')]);_0x633733[_0x4dc5('0x1b')]=qs['offset'](_0x1fe7f7[_0x4dc5('0x2d')][_0x4dc5('0x1b')]);}_0x633733['order']=qs['sort'](_0x1fe7f7[_0x4dc5('0x2d')]['sort']);_0x633733[_0x4dc5('0x36')]=qs['filters'](_[_0x4dc5('0x37')](_0x1fe7f7[_0x4dc5('0x2d')],_0x5c2fa0[_0x4dc5('0x2e')]),_0x11eee2);if(_0x1fe7f7['query']['filter']){_0x633733[_0x4dc5('0x36')]=_['merge'](_0x633733[_0x4dc5('0x36')],{'$or':_[_0x4dc5('0x29')](_0x11eee2,function(_0x49e9ff){if(_0x49e9ff[_0x4dc5('0x38')]!==_0x4dc5('0x39')){var _0x32dea7={};_0x32dea7[_0x49e9ff[_0x4dc5('0x26')]]={'$like':'%'+_0x1fe7f7[_0x4dc5('0x2d')][_0x4dc5('0x3a')]+'%'};return _0x32dea7;}})});}_0x633733=_[_0x4dc5('0x3b')]({},_0x633733,_0x1fe7f7['options']);var _0x47b071={'where':_0x633733[_0x4dc5('0x36')]};return db[_0x4dc5('0x3c')][_0x4dc5('0x1a')](_0x47b071)['then'](function(_0x42f7f8){_0xb849c5[_0x4dc5('0x1a')]=_0x42f7f8;if(_0x1fe7f7[_0x4dc5('0x2d')][_0x4dc5('0x3d')]){_0x633733[_0x4dc5('0x3e')]=[{'all':!![]}];}return db[_0x4dc5('0x3c')]['findAll'](_0x633733);})[_0x4dc5('0x21')](function(_0x376f03){_0xb849c5[_0x4dc5('0x3f')]=_0x376f03;return _0xb849c5;})[_0x4dc5('0x21')](respondWithFilteredResult(_0x16f150,_0x633733))[_0x4dc5('0x40')](handleError(_0x16f150,null));};exports[_0x4dc5('0x41')]=function(_0x379a18,_0x394959){var _0x1d4934={'raw':!![],'where':{'id':_0x379a18[_0x4dc5('0x42')]['id']}},_0x33e9df={};_0x33e9df[_0x4dc5('0x30')]=_[_0x4dc5('0x43')](db[_0x4dc5('0x3c')][_0x4dc5('0x2a')]);_0x33e9df[_0x4dc5('0x2d')]=_[_0x4dc5('0x43')](_0x379a18[_0x4dc5('0x2d')]);_0x33e9df[_0x4dc5('0x2e')]=_['intersection'](_0x33e9df['model'],_0x33e9df[_0x4dc5('0x2d')]);_0x1d4934[_0x4dc5('0x31')]=_[_0x4dc5('0x2f')](_0x33e9df[_0x4dc5('0x30')],qs[_0x4dc5('0x32')](_0x379a18['query'][_0x4dc5('0x32')]));_0x1d4934[_0x4dc5('0x31')]=_0x1d4934[_0x4dc5('0x31')][_0x4dc5('0x33')]?_0x1d4934[_0x4dc5('0x31')]:_0x33e9df[_0x4dc5('0x30')];if(_0x379a18[_0x4dc5('0x2d')]['includeAll']){_0x1d4934['include']=[{'all':!![]}];}_0x1d4934=_[_0x4dc5('0x3b')]({},_0x1d4934,_0x379a18[_0x4dc5('0x44')]);return db[_0x4dc5('0x3c')]['find'](_0x1d4934)['then'](handleEntityNotFound(_0x394959,null))[_0x4dc5('0x21')](respondWithResult(_0x394959,null))['catch'](handleError(_0x394959,null));};exports[_0x4dc5('0x45')]=function(_0x58148d,_0x3fa870){return db['Interval'][_0x4dc5('0x45')](_0x58148d[_0x4dc5('0x46')],{})[_0x4dc5('0x21')](function(_0x21a511){var _0x26024f=_0x58148d[_0x4dc5('0x47')][_0x4dc5('0x23')]({'plain':!![]});if(!_0x26024f)throw new Error(_0x4dc5('0x48'));if(_0x26024f[_0x4dc5('0x49')]===_0x4dc5('0x47')){var _0x43bc4d=_0x21a511['get']({'plain':!![]});var _0x5b3a3c=_0x4dc5('0x24');return db['UserProfileSection'][_0x4dc5('0x4a')]({'where':{'name':_0x5b3a3c,'userProfileId':_0x26024f[_0x4dc5('0x4b')]},'raw':!![]})[_0x4dc5('0x21')](function(_0x278168){if(_0x278168&&_0x278168[_0x4dc5('0x4c')]===0x0){return db[_0x4dc5('0x4d')][_0x4dc5('0x45')]({'name':_0x43bc4d[_0x4dc5('0x26')],'resourceId':_0x43bc4d['id'],'type':_0x278168[_0x4dc5('0x26')],'sectionId':_0x278168['id']},{})[_0x4dc5('0x21')](function(){return _0x21a511;});}else{return _0x21a511;}})[_0x4dc5('0x40')](function(_0x45433b){logger[_0x4dc5('0x4e')](_0x4dc5('0x4f'),_0x45433b);throw _0x45433b;});}return _0x21a511;})[_0x4dc5('0x21')](respondWithResult(_0x3fa870,0xc9))[_0x4dc5('0x40')](handleError(_0x3fa870,null));};exports[_0x4dc5('0x20')]=function(_0x474d9d,_0x595d46){if(_0x474d9d[_0x4dc5('0x46')]['id']){delete _0x474d9d[_0x4dc5('0x46')]['id'];}return db[_0x4dc5('0x3c')][_0x4dc5('0x4a')]({'where':{'id':_0x474d9d['params']['id']}})[_0x4dc5('0x21')](handleEntityNotFound(_0x595d46,null))['then'](saveUpdates(_0x474d9d[_0x4dc5('0x46')],null))[_0x4dc5('0x21')](respondWithResult(_0x595d46,null))[_0x4dc5('0x40')](handleError(_0x595d46,null));};exports[_0x4dc5('0x22')]=function(_0x58bd82,_0x5b132c){return db[_0x4dc5('0x3c')]['find']({'where':{'id':_0x58bd82['params']['id']}})[_0x4dc5('0x21')](handleEntityNotFound(_0x5b132c,null))[_0x4dc5('0x21')](removeEntity(_0x5b132c,null))[_0x4dc5('0x40')](handleError(_0x5b132c,null));};exports[_0x4dc5('0x50')]=function(_0x52b760,_0x4b11ff,_0x3901f8){if(_0x52b760['body']['id']){delete _0x52b760[_0x4dc5('0x46')]['id'];}return db[_0x4dc5('0x3c')][_0x4dc5('0x4a')]({'where':{'id':_0x52b760[_0x4dc5('0x42')]['id']}})[_0x4dc5('0x21')](handleEntityNotFound(_0x4b11ff,null))[_0x4dc5('0x21')](function(_0x5053f8){if(_0x5053f8){_0x52b760[_0x4dc5('0x46')][_0x4dc5('0x51')]=_0x5053f8['id'];return db[_0x4dc5('0x3c')]['create'](_0x52b760[_0x4dc5('0x46')]);}})['then'](respondWithResult(_0x4b11ff,null))[_0x4dc5('0x40')](handleError(_0x4b11ff,null));};exports['getIntervals']=function(_0x58ec08,_0x1e1a8e,_0x384a0c){var _0x22c015={};var _0x23f436={};var _0x463d8f;var _0x121658;return db['Interval'][_0x4dc5('0x52')]({'where':{'id':_0x58ec08[_0x4dc5('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1a8e,null))[_0x4dc5('0x21')](function(_0x5039a0){if(_0x5039a0){_0x463d8f=_0x5039a0;_0x23f436[_0x4dc5('0x30')]=_[_0x4dc5('0x43')](db[_0x4dc5('0x3c')]['rawAttributes']);_0x23f436[_0x4dc5('0x2d')]=_[_0x4dc5('0x43')](_0x58ec08[_0x4dc5('0x2d')]);_0x23f436[_0x4dc5('0x2e')]=_[_0x4dc5('0x2f')](_0x23f436[_0x4dc5('0x30')],_0x23f436[_0x4dc5('0x2d')]);_0x22c015[_0x4dc5('0x31')]=_[_0x4dc5('0x2f')](_0x23f436[_0x4dc5('0x30')],qs[_0x4dc5('0x32')](_0x58ec08[_0x4dc5('0x2d')][_0x4dc5('0x32')]));_0x22c015[_0x4dc5('0x31')]=_0x22c015[_0x4dc5('0x31')][_0x4dc5('0x33')]?_0x22c015[_0x4dc5('0x31')]:_0x23f436['model'];_0x22c015['order']=qs[_0x4dc5('0x53')](_0x58ec08['query'][_0x4dc5('0x53')]);_0x22c015['where']=qs[_0x4dc5('0x2e')](_[_0x4dc5('0x37')](_0x58ec08['query'],_0x23f436[_0x4dc5('0x2e')]));if(_0x58ec08[_0x4dc5('0x2d')]['filter']){_0x22c015[_0x4dc5('0x36')]=_[_0x4dc5('0x3b')](_0x22c015[_0x4dc5('0x36')],{'$or':_[_0x4dc5('0x29')](_0x22c015[_0x4dc5('0x31')],function(_0xd4c39b){var _0x435ece={};_0x435ece[_0xd4c39b]={'$like':'%'+_0x58ec08[_0x4dc5('0x2d')][_0x4dc5('0x3a')]+'%'};return _0x435ece;})});}_0x22c015=_[_0x4dc5('0x3b')]({},_0x22c015,_0x58ec08['options']);return _0x463d8f[_0x4dc5('0x54')](_0x22c015);}})[_0x4dc5('0x21')](function(_0x58dfde){if(_0x58dfde){_0x121658=_0x58dfde[_0x4dc5('0x33')];if(!_0x58ec08[_0x4dc5('0x2d')][_0x4dc5('0x34')]('nolimit')){_0x22c015['limit']=qs[_0x4dc5('0x19')](_0x58ec08[_0x4dc5('0x2d')][_0x4dc5('0x19')]);_0x22c015[_0x4dc5('0x1b')]=qs[_0x4dc5('0x1b')](_0x58ec08[_0x4dc5('0x2d')][_0x4dc5('0x1b')]);}return _0x463d8f[_0x4dc5('0x54')](_0x22c015);}})[_0x4dc5('0x21')](function(_0x47d71a){if(_0x47d71a){return _0x47d71a?{'count':_0x121658,'rows':_0x47d71a}:null;}})['then'](respondWithResult(_0x1e1a8e,null))[_0x4dc5('0x40')](handleError(_0x1e1a8e,null));};exports[_0x4dc5('0x55')]=function(_0x8472bd,_0x555c0e,_0x4d00f3){return db['Interval'][_0x4dc5('0x52')]({'where':{'id':_0x8472bd[_0x4dc5('0x42')]['id']}})[_0x4dc5('0x21')](handleEntityNotFound(_0x555c0e,null))['then'](function(_0x32d4c8){if(_0x32d4c8){return db['sequelize'][_0x4dc5('0x56')](function(_0x451679){return db[_0x4dc5('0x3c')][_0x4dc5('0x22')]({'where':{'IntervalId':_0x8472bd[_0x4dc5('0x42')]['id']},'transaction':_0x451679})[_0x4dc5('0x21')](function(_0x3c7361){var _0x28327e=_[_0x4dc5('0x29')](_0x8472bd[_0x4dc5('0x46')],function(_0x2493dd){delete _0x2493dd['id'];_0x2493dd[_0x4dc5('0x51')]=_0x8472bd[_0x4dc5('0x42')]['id'];return _0x2493dd;});return db[_0x4dc5('0x3c')][_0x4dc5('0x57')](_0x28327e,{'transaction':_0x451679});});})[_0x4dc5('0x21')](function(){return db[_0x4dc5('0x3c')][_0x4dc5('0x58')]({'where':{'IntervalId':_0x8472bd[_0x4dc5('0x42')]['id']}});});}})[_0x4dc5('0x21')](respondWithResult(_0x555c0e,null))[_0x4dc5('0x40')](handleError(_0x555c0e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 02e87f1..6a3ac37 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 _0xbf55=['iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf55,0x12f));var _0x5bf5=function(_0x531c3b,_0x524110){_0x531c3b=_0x531c3b-0x0;var _0x353493=_0xbf55[_0x531c3b];return _0x353493;};'use strict';var attributes=require(_0x5bf5('0x0'));var extensions=require(_0x5bf5('0x1'));var iftime=require(_0x5bf5('0x2'))[_0x5bf5('0x3')];module[_0x5bf5('0x4')]=function(_0x1330b5){return _0x1330b5[_0x5bf5('0x5')](_0x5bf5('0x6'),attributes,{'tableName':_0x5bf5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x19fc4e){extensions[_0x5bf5('0x8')](_0x1330b5,_0x19fc4e);},'afterBulkCreate':function(_0x226bb2,_0x4a2912,_0x1d60fa){_0x1d60fa();extensions[_0x5bf5('0x8')](_0x1330b5,_0x226bb2[0x0]);},'afterUpdate':function(_0x195bd1){extensions[_0x5bf5('0x8')](_0x1330b5,_0x195bd1);},'afterDestroy':function(_0x2d38a8){extensions[_0x5bf5('0x8')](_0x1330b5,_0x2d38a8);}},'instanceMethods':{'ifTime':function(_0x33d186=undefined,_0x3eb736=new Date()){if(typeof this[_0x5bf5('0x9')]===_0x5bf5('0xa')){return iftime(this['interval'],_0x33d186,_0x3eb736);}else{return this[_0x5bf5('0xb')]()[_0x5bf5('0xc')](function(_0x3220c4){return Promise[_0x5bf5('0xd')](_0x3220c4[_0x5bf5('0xe')](function(_0x1aad95){return _0x1aad95[_0x5bf5('0xf')](_0x33d186,_0x3eb736);}));})[_0x5bf5('0xc')](function(_0x18ede8){return _0x18ede8[_0x5bf5('0x10')](function(_0x1c1cfc,_0x2569b9){return _0x1c1cfc||_0x2569b9;},![]);});}}}});}; \ No newline at end of file +var _0x9817=['../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','then','all','map','./interval.attributes'];(function(_0x528ba1,_0x481d0d){var _0x30127f=function(_0x23016c){while(--_0x23016c){_0x528ba1['push'](_0x528ba1['shift']());}};_0x30127f(++_0x481d0d);}(_0x9817,0x11d));var _0x7981=function(_0x3375b2,_0x571d5a){_0x3375b2=_0x3375b2-0x0;var _0x3fbd8e=_0x9817[_0x3375b2];return _0x3fbd8e;};'use strict';var attributes=require(_0x7981('0x0'));var extensions=require(_0x7981('0x1'));var iftime=require(_0x7981('0x2'))['iftime'];module[_0x7981('0x3')]=function(_0x1a46ce){return _0x1a46ce[_0x7981('0x4')](_0x7981('0x5'),attributes,{'tableName':_0x7981('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a31d7){extensions[_0x7981('0x7')](_0x1a46ce,_0x5a31d7);},'afterBulkCreate':function(_0x45238a,_0x4b6e87,_0xaf58c0){_0xaf58c0();extensions[_0x7981('0x7')](_0x1a46ce,_0x45238a[0x0]);},'afterUpdate':function(_0xbb9d31){extensions['rewrite'](_0x1a46ce,_0xbb9d31);},'afterDestroy':function(_0x1a667f){extensions[_0x7981('0x7')](_0x1a46ce,_0x1a667f);}},'instanceMethods':{'ifTime':function(_0x1379cd=undefined,_0x26fa65=new Date()){if(typeof this[_0x7981('0x8')]===_0x7981('0x9')){return iftime(this[_0x7981('0x8')],_0x1379cd,_0x26fa65);}else{return this['getIntervals']()[_0x7981('0xa')](function(_0x38321e){return Promise[_0x7981('0xb')](_0x38321e[_0x7981('0xc')](function(_0x2206ae){return _0x2206ae['ifTime'](_0x1379cd,_0x26fa65);}));})['then'](function(_0xa39894){return _0xa39894['reduce'](function(_0x24043c,_0x1b8356){return _0x24043c||_0x1b8356;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 44939ad..46859de 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 _0xa955=['IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','limit','include','map','model','attributes','then','info','debug','stringify','error','message','ShowInterval','where','catch','all','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','intervalIds','intervals'];(function(_0x9d73ab,_0x1817de){var _0x1df342=function(_0x46783f){while(--_0x46783f){_0x9d73ab['push'](_0x9d73ab['shift']());}};_0x1df342(++_0x1817de);}(_0xa955,0x180));var _0x5a95=function(_0x5887c2,_0x5b83a6){_0x5887c2=_0x5887c2-0x0;var _0x3f01ca=_0xa955[_0x5887c2];return _0x3f01ca;};'use strict';var _=require(_0x5a95('0x0'));var util=require(_0x5a95('0x1'));var db=require(_0x5a95('0x2'))['db'];var iftime=require(_0x5a95('0x3'))[_0x5a95('0x4')];var logger=require('../../config/logger')(_0x5a95('0x5'));exports[_0x5a95('0x6')]=function(_0x4e39a8){var _0x4ed9b4=this;return new Promise(function(_0x27db5b,_0xb5befb){return db[_0x5a95('0x7')][_0x5a95('0x8')]({'raw':_0x4e39a8[_0x5a95('0x9')]?_0x4e39a8[_0x5a95('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4e39a8['options']?_0x4e39a8[_0x5a95('0x9')]['where']||null:null,'attributes':_0x4e39a8[_0x5a95('0x9')]?_0x4e39a8[_0x5a95('0x9')]['attributes']||null:null,'limit':_0x4e39a8[_0x5a95('0x9')]?_0x4e39a8['options'][_0x5a95('0xa')]||null:null,'include':_0x4e39a8[_0x5a95('0x9')]?_0x4e39a8[_0x5a95('0x9')][_0x5a95('0xb')]?_[_0x5a95('0xc')](_0x4e39a8[_0x5a95('0x9')][_0x5a95('0xb')],function(_0x23a77d){return{'model':db[_0x23a77d[_0x5a95('0xd')]],'as':_0x23a77d['as'],'attributes':_0x23a77d[_0x5a95('0xe')],'include':_0x23a77d['include']?_[_0x5a95('0xc')](_0x23a77d[_0x5a95('0xb')],function(_0x645ad9){return{'model':db[_0x645ad9[_0x5a95('0xd')]],'as':_0x645ad9['as'],'attributes':_0x645ad9[_0x5a95('0xe')],'include':_0x645ad9['include']?_[_0x5a95('0xc')](_0x645ad9[_0x5a95('0xb')],function(_0x175ffc){return{'model':db[_0x175ffc[_0x5a95('0xd')]],'as':_0x175ffc['as'],'attributes':_0x175ffc[_0x5a95('0xe')]};}):[]};}):[]};}):[]:[]})[_0x5a95('0xf')](function(_0x4480e8){logger[_0x5a95('0x10')](_0x5a95('0x6'),_0x4e39a8);logger[_0x5a95('0x11')](_0x5a95('0x6'),_0x4e39a8,JSON[_0x5a95('0x12')](_0x4480e8));_0x27db5b(_0x4480e8);})['catch'](function(_0x176f8a){logger[_0x5a95('0x13')](_0x5a95('0x6'),_0x176f8a[_0x5a95('0x14')],_0x4e39a8);_0xb5befb(_0x4ed9b4[_0x5a95('0x13')](0x1f4,_0x176f8a[_0x5a95('0x14')]));});});};exports[_0x5a95('0x15')]=function(_0x28916b){var _0x4ba463=this;return new Promise(function(_0x3a8add,_0x3cd971){return db[_0x5a95('0x7')]['find']({'raw':_0x28916b['options']?_0x28916b['options']['raw']===undefined?!![]:![]:!![],'where':_0x28916b[_0x5a95('0x9')]?_0x28916b[_0x5a95('0x9')][_0x5a95('0x16')]||null:null,'attributes':_0x28916b[_0x5a95('0x9')]?_0x28916b['options']['attributes']||null:null,'include':_0x28916b[_0x5a95('0x9')]?_0x28916b[_0x5a95('0x9')]['include']?_[_0x5a95('0xc')](_0x28916b[_0x5a95('0x9')][_0x5a95('0xb')],function(_0x52dc0d){return{'model':db[_0x52dc0d[_0x5a95('0xd')]],'as':_0x52dc0d['as'],'attributes':_0x52dc0d['attributes'],'include':_0x52dc0d['include']?_[_0x5a95('0xc')](_0x52dc0d[_0x5a95('0xb')],function(_0x4aa0b3){return{'model':db[_0x4aa0b3[_0x5a95('0xd')]],'as':_0x4aa0b3['as'],'attributes':_0x4aa0b3[_0x5a95('0xe')],'include':_0x4aa0b3['include']?_[_0x5a95('0xc')](_0x4aa0b3[_0x5a95('0xb')],function(_0x5f42c3){return{'model':db[_0x5f42c3[_0x5a95('0xd')]],'as':_0x5f42c3['as'],'attributes':_0x5f42c3[_0x5a95('0xe')]};}):[]};}):[]};}):[]:[]})[_0x5a95('0xf')](function(_0x1b3341){logger['info']('ShowInterval',_0x28916b);logger[_0x5a95('0x11')](_0x5a95('0x15'),_0x28916b,JSON[_0x5a95('0x12')](_0x1b3341));_0x3a8add(_0x1b3341);})[_0x5a95('0x17')](function(_0x2539ec){logger[_0x5a95('0x13')](_0x5a95('0x15'),_0x2539ec[_0x5a95('0x14')],_0x28916b);_0x3cd971(_0x4ba463['error'](0x1f4,_0x2539ec['message']));});});};function checkArrayOfIntervals(_0x2e3b11,_0x2ddfc0){var _0x59ec04=[];return db[_0x5a95('0x7')][_0x5a95('0x8')]({'where':{'id':_0x2e3b11}})[_0x5a95('0xf')](function(_0x1673c7){_0x59ec04=_0x1673c7;return Promise[_0x5a95('0x18')](_0x59ec04[_0x5a95('0xc')](function(_0x5db55c){return _0x5db55c[_0x5a95('0x19')](_0x2ddfc0);}));})[_0x5a95('0xf')](function(_0x25789f){var _0x5e787c=_0x25789f[_0x5a95('0x1a')](function(_0xaa16bc,_0x4ffa56){return _0xaa16bc||_0x4ffa56;},![]);logger[_0x5a95('0x10')](util['format'](_0x5a95('0x1b'),_0x59ec04['map'](function(_0x20a1cd){return _0x20a1cd['name'];})[_0x5a95('0x1c')](',\x20'),_0x59ec04[_0x5a95('0xc')](function(_0x4b1edc){return _0x4b1edc['id'];})['join'](',\x20')));return _0x5e787c;});}function checkSingleInterval(_0x3092c2,_0xc79e05){return db[_0x5a95('0x7')][_0x5a95('0x1d')](_0x3092c2)[_0x5a95('0xf')](function(_0x1578cc){if(_0x1578cc){logger[_0x5a95('0x10')](util[_0x5a95('0x1e')](_0x5a95('0x1f'),_0x1578cc[_0x5a95('0x20')],_0x1578cc['id']));return _0x1578cc[_0x5a95('0x19')](_0xc79e05);}});}exports[_0x5a95('0x21')]=function(_0x93df2f){var _0xd4e41c=_0x93df2f[_0x5a95('0x22')];var _0xff9bd3=Array['isArray'](_0x93df2f[_0x5a95('0x23')])?_0x93df2f['intervals']:typeof _0x93df2f[_0x5a95('0x23')]==='string'?[_0x93df2f['intervals']]:[];var _0x5c9a45=_0x93df2f['timezone']||undefined;var _0x25ceee=![];if(_0xff9bd3['length']){logger[_0x5a95('0x10')](util[_0x5a95('0x1e')](_0x5a95('0x24'),_0xff9bd3['join'](';\x20')));}if(_0x5c9a45){logger[_0x5a95('0x10')](util[_0x5a95('0x1e')](_0x5a95('0x25'),_0x5c9a45));}logger[_0x5a95('0x11')](_0x5a95('0x26'),_0x25ceee);logger[_0x5a95('0x27')]('IntervalIftime',_0x93df2f);return Promise[_0x5a95('0x28')]()[_0x5a95('0xf')](function(){if(Array[_0x5a95('0x29')](_0xd4e41c)){return checkArrayOfIntervals(_0xd4e41c,_0x5c9a45);}else if(_0xd4e41c){return checkSingleInterval(_0xd4e41c,_0x5c9a45);}})[_0x5a95('0xf')](function(_0x570259){var _0x58e6d5=_0xff9bd3[_0x5a95('0x1a')](function(_0x32edc6,_0x4cc78b){return _0x32edc6||iftime(_0x4cc78b,_0x5c9a45);},![]);_0x25ceee=_0x570259||_0x58e6d5;return _0x25ceee;})[_0x5a95('0x17')](function(_0x4c10cc){logger['error']('IntervalIftime',_0x93df2f,_0x4c10cc);throw this[_0x5a95('0x13')](0x1f4,_0x4c10cc[_0x5a95('0x14')]);});}; \ No newline at end of file +var _0x4ebf=['isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','lodash','../../mysqldb','../../utils/iftime','GetInterval','Interval','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','catch','message','error','ShowInterval','find','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','ifTime','IntervalIftime'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x4ebf,0x1cc));var _0xf4eb=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x4ebf[_0x21f931];return _0x3f083c;};'use strict';var _=require(_0xf4eb('0x0'));var util=require('util');var db=require(_0xf4eb('0x1'))['db'];var iftime=require(_0xf4eb('0x2'))['iftime'];var logger=require('../../config/logger')('rpc');exports[_0xf4eb('0x3')]=function(_0x445139){var _0x14f55c=this;return new Promise(function(_0x368c71,_0x1f96bb){return db[_0xf4eb('0x4')][_0xf4eb('0x5')]({'raw':_0x445139[_0xf4eb('0x6')]?_0x445139['options'][_0xf4eb('0x7')]===undefined?!![]:![]:!![],'where':_0x445139[_0xf4eb('0x6')]?_0x445139[_0xf4eb('0x6')][_0xf4eb('0x8')]||null:null,'attributes':_0x445139[_0xf4eb('0x6')]?_0x445139[_0xf4eb('0x6')][_0xf4eb('0x9')]||null:null,'limit':_0x445139[_0xf4eb('0x6')]?_0x445139[_0xf4eb('0x6')][_0xf4eb('0xa')]||null:null,'include':_0x445139['options']?_0x445139['options']['include']?_[_0xf4eb('0xb')](_0x445139[_0xf4eb('0x6')][_0xf4eb('0xc')],function(_0x2712e2){return{'model':db[_0x2712e2[_0xf4eb('0xd')]],'as':_0x2712e2['as'],'attributes':_0x2712e2[_0xf4eb('0x9')],'include':_0x2712e2['include']?_[_0xf4eb('0xb')](_0x2712e2[_0xf4eb('0xc')],function(_0x4ecb52){return{'model':db[_0x4ecb52[_0xf4eb('0xd')]],'as':_0x4ecb52['as'],'attributes':_0x4ecb52[_0xf4eb('0x9')],'include':_0x4ecb52[_0xf4eb('0xc')]?_[_0xf4eb('0xb')](_0x4ecb52[_0xf4eb('0xc')],function(_0x33886f){return{'model':db[_0x33886f[_0xf4eb('0xd')]],'as':_0x33886f['as'],'attributes':_0x33886f[_0xf4eb('0x9')]};}):[]};}):[]};}):[]:[]})[_0xf4eb('0xe')](function(_0x12b20c){logger[_0xf4eb('0xf')](_0xf4eb('0x3'),_0x445139);logger[_0xf4eb('0x10')](_0xf4eb('0x3'),_0x445139,JSON['stringify'](_0x12b20c));_0x368c71(_0x12b20c);})[_0xf4eb('0x11')](function(_0xdb3ecb){logger['error'](_0xf4eb('0x3'),_0xdb3ecb[_0xf4eb('0x12')],_0x445139);_0x1f96bb(_0x14f55c[_0xf4eb('0x13')](0x1f4,_0xdb3ecb[_0xf4eb('0x12')]));});});};exports[_0xf4eb('0x14')]=function(_0x1a9b9a){var _0xcd59c4=this;return new Promise(function(_0x89d2e5,_0x14fa3d){return db[_0xf4eb('0x4')][_0xf4eb('0x15')]({'raw':_0x1a9b9a['options']?_0x1a9b9a['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a9b9a[_0xf4eb('0x6')]?_0x1a9b9a[_0xf4eb('0x6')]['where']||null:null,'attributes':_0x1a9b9a[_0xf4eb('0x6')]?_0x1a9b9a[_0xf4eb('0x6')]['attributes']||null:null,'include':_0x1a9b9a['options']?_0x1a9b9a[_0xf4eb('0x6')][_0xf4eb('0xc')]?_[_0xf4eb('0xb')](_0x1a9b9a[_0xf4eb('0x6')]['include'],function(_0x5a7006){return{'model':db[_0x5a7006[_0xf4eb('0xd')]],'as':_0x5a7006['as'],'attributes':_0x5a7006[_0xf4eb('0x9')],'include':_0x5a7006['include']?_['map'](_0x5a7006[_0xf4eb('0xc')],function(_0x2df285){return{'model':db[_0x2df285[_0xf4eb('0xd')]],'as':_0x2df285['as'],'attributes':_0x2df285[_0xf4eb('0x9')],'include':_0x2df285[_0xf4eb('0xc')]?_[_0xf4eb('0xb')](_0x2df285['include'],function(_0x26244f){return{'model':db[_0x26244f['model']],'as':_0x26244f['as'],'attributes':_0x26244f[_0xf4eb('0x9')]};}):[]};}):[]};}):[]:[]})[_0xf4eb('0xe')](function(_0x23eb60){logger[_0xf4eb('0xf')](_0xf4eb('0x14'),_0x1a9b9a);logger['debug'](_0xf4eb('0x14'),_0x1a9b9a,JSON['stringify'](_0x23eb60));_0x89d2e5(_0x23eb60);})[_0xf4eb('0x11')](function(_0x3b14f7){logger['error']('ShowInterval',_0x3b14f7['message'],_0x1a9b9a);_0x14fa3d(_0xcd59c4[_0xf4eb('0x13')](0x1f4,_0x3b14f7['message']));});});};function checkArrayOfIntervals(_0x3f3eae,_0x174d16){var _0x2021f0=[];return db[_0xf4eb('0x4')][_0xf4eb('0x5')]({'where':{'id':_0x3f3eae}})['then'](function(_0x5d718f){_0x2021f0=_0x5d718f;return Promise[_0xf4eb('0x16')](_0x2021f0[_0xf4eb('0xb')](function(_0x3fb539){return _0x3fb539['ifTime'](_0x174d16);}));})[_0xf4eb('0xe')](function(_0x4c65f4){var _0x4e7479=_0x4c65f4[_0xf4eb('0x17')](function(_0x1d7a7d,_0x19bead){return _0x1d7a7d||_0x19bead;},![]);logger[_0xf4eb('0xf')](util[_0xf4eb('0x18')](_0xf4eb('0x19'),_0x2021f0[_0xf4eb('0xb')](function(_0xa2b675){return _0xa2b675['name'];})[_0xf4eb('0x1a')](',\x20'),_0x2021f0['map'](function(_0xfeb319){return _0xfeb319['id'];})[_0xf4eb('0x1a')](',\x20')));return _0x4e7479;});}function checkSingleInterval(_0x30e6e6,_0x158e3f){return db[_0xf4eb('0x4')][_0xf4eb('0x1b')](_0x30e6e6)[_0xf4eb('0xe')](function(_0x452a81){if(_0x452a81){logger[_0xf4eb('0xf')](util['format'](_0xf4eb('0x1c'),_0x452a81[_0xf4eb('0x1d')],_0x452a81['id']));return _0x452a81[_0xf4eb('0x1e')](_0x158e3f);}});}exports[_0xf4eb('0x1f')]=function(_0x3fbe54){var _0x5b77b7=_0x3fbe54['intervalIds'];var _0x379914=Array[_0xf4eb('0x20')](_0x3fbe54[_0xf4eb('0x21')])?_0x3fbe54['intervals']:typeof _0x3fbe54['intervals']===_0xf4eb('0x22')?[_0x3fbe54['intervals']]:[];var _0x2bc5e8=_0x3fbe54[_0xf4eb('0x23')]||undefined;var _0x120107=![];if(_0x379914[_0xf4eb('0x24')]){logger[_0xf4eb('0xf')](util[_0xf4eb('0x18')](_0xf4eb('0x25'),_0x379914[_0xf4eb('0x1a')](';\x20')));}if(_0x2bc5e8){logger[_0xf4eb('0xf')](util[_0xf4eb('0x18')](_0xf4eb('0x26'),_0x2bc5e8));}logger[_0xf4eb('0x10')](_0xf4eb('0x27'),_0x120107);logger[_0xf4eb('0x28')]('IntervalIftime',_0x3fbe54);return Promise['resolve']()[_0xf4eb('0xe')](function(){if(Array[_0xf4eb('0x20')](_0x5b77b7)){return checkArrayOfIntervals(_0x5b77b7,_0x2bc5e8);}else if(_0x5b77b7){return checkSingleInterval(_0x5b77b7,_0x2bc5e8);}})[_0xf4eb('0xe')](function(_0x3f4308){var _0x569d96=_0x379914[_0xf4eb('0x17')](function(_0x3f2bed,_0x5ef7c2){return _0x3f2bed||iftime(_0x5ef7c2,_0x2bc5e8);},![]);_0x120107=_0x3f4308||_0x569d96;return _0x120107;})['catch'](function(_0x2add94){logger[_0xf4eb('0x13')](_0xf4eb('0x1f'),_0x3fbe54,_0x2add94);throw this[_0xf4eb('0x13')](0x1f4,_0x2add94['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index b5d4b5e..fcdf011 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x3d3acb,_0xc9fb78){var _0xf5aff=function(_0x3f697a){while(--_0x3f697a){_0x3d3acb['push'](_0x3d3acb['shift']());}};_0xf5aff(++_0xc9fb78);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0x5f2f[_0x4e1d3c];return _0x5177b2;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x297234,_0x4c2770){var _0x2aeb34=function(_0x4c1bcd){while(--_0x4c1bcd){_0x297234['push'](_0x297234['shift']());}};_0x2aeb34(++_0x4c2770);}(_0x2032,0xd9));var _0x2203=function(_0x314397,_0x2e13c0){_0x314397=_0x314397-0x0;var _0x111290=_0x2032[_0x314397];return _0x111290;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b76bd16..215b152 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 _0x4a47=['POST','application/json','base64','setEncoding','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','description','stringify','Bug','email','fields','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x218bf2,_0x48b5e1){var _0x4e6d56=function(_0x18397f){while(--_0x18397f){_0x218bf2['push'](_0x218bf2['shift']());}};_0x4e6d56(++_0x48b5e1);}(_0x4a47,0x1ae));var _0x74a4=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x4a47[_0x13f980];return _0x27153c;};'use strict';var BPromise=require(_0x74a4('0x0'));var https=require(_0x74a4('0x1'));var logger=require(_0x74a4('0x2'))(_0x74a4('0x3'));var USERNAME='support';var PASSWORD=_0x74a4('0x4');function openIssue(_0x1bbe8c,_0x3684fc){var _0x5f1807={'fields':{'project':{'key':_0x1bbe8c[_0x74a4('0x5')]||_0x74a4('0x6')},'summary':(_0x1bbe8c[_0x74a4('0x7')]||'Report')+'\x20from\x20'+_0x1bbe8c['ip'],'description':_0x1bbe8c[_0x74a4('0x8')]||JSON[_0x74a4('0x9')](_0x1bbe8c),'issuetype':{'name':_0x1bbe8c['issuetype']||_0x74a4('0xa')}}};_0x5f1807['fields']['customfield_11500']=_0x1bbe8c[_0x74a4('0xb')];_0x5f1807[_0x74a4('0xc')]['customfield_11501']=_0x1bbe8c[_0x74a4('0xd')];_0x5f1807['fields'][_0x74a4('0xe')]=_0x1bbe8c[_0x74a4('0xf')];_0x5f1807[_0x74a4('0xc')]['customfield_11503']=_0x1bbe8c[_0x74a4('0x10')];_0x5f1807[_0x74a4('0xc')][_0x74a4('0x11')]=_0x1bbe8c[_0x74a4('0x12')];_0x5f1807[_0x74a4('0xc')]['customfield_10102']=_0x1bbe8c['ip'];var _0x2baad9={'host':_0x74a4('0x13'),'port':0x1bb,'path':_0x74a4('0x14'),'method':_0x74a4('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x74a4('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x74a4('0x17'))}};var _0x196674=JSON[_0x74a4('0x9')](_0x5f1807);var _0x45cd48=https['request'](_0x2baad9,function(_0x44c7ca){_0x44c7ca[_0x74a4('0x18')](_0x74a4('0x19'));var _0x5b2555='';_0x44c7ca['on']('data',function(_0x140c7e){_0x5b2555+=_0x140c7e;});_0x44c7ca['on']('end',function(){if(_0x3684fc){return _0x3684fc[_0x74a4('0x1a')](_0x44c7ca[_0x74a4('0x1b')])[_0x74a4('0x1c')](JSON[_0x74a4('0x1d')](_0x5b2555));}});});_0x45cd48['on'](_0x74a4('0x1e'),function(_0x26229a){if(_0x3684fc){return _0x3684fc[_0x74a4('0x1a')](0x1f4)[_0x74a4('0x1c')]({'errors':[{'message':_0x74a4('0x1f'),'type':_0x74a4('0x20')}]});}});_0x45cd48[_0x74a4('0x21')](_0x196674);_0x45cd48[_0x74a4('0x22')]();}exports[_0x74a4('0x23')]=openIssue;exports[_0x74a4('0x24')]=function(_0x5872da,_0x2fd7c8){_0x5872da[_0x74a4('0x25')]['ip']=_0x5872da['headers']['x-forwarded-for']||_0x5872da[_0x74a4('0x26')][_0x74a4('0x27')]||_0x5872da[_0x74a4('0x28')]['remoteAddress']||_0x5872da[_0x74a4('0x26')][_0x74a4('0x28')]['remoteAddress'];return openIssue(_0x5872da[_0x74a4('0x25')],_0x2fd7c8);}; \ No newline at end of file +var _0x69ce=['end','status','statusCode','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','base64','request','setEncoding','utf8','data'];(function(_0x4fada1,_0x1548c8){var _0x2fcd57=function(_0x3df47d){while(--_0x3df47d){_0x4fada1['push'](_0x4fada1['shift']());}};_0x2fcd57(++_0x1548c8);}(_0x69ce,0x165));var _0xe69c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x69ce[_0x199572];return _0x13cfa3;};'use strict';var BPromise=require('bluebird');var https=require(_0xe69c('0x0'));var logger=require(_0xe69c('0x1'))('api');var USERNAME=_0xe69c('0x2');var PASSWORD=_0xe69c('0x3');function openIssue(_0x440d14,_0x11d1b2){var _0x2c8ea4={'fields':{'project':{'key':_0x440d14['key']||_0xe69c('0x4')},'summary':(_0x440d14['summary']||_0xe69c('0x5'))+_0xe69c('0x6')+_0x440d14['ip'],'description':_0x440d14[_0xe69c('0x7')]||JSON[_0xe69c('0x8')](_0x440d14),'issuetype':{'name':_0x440d14[_0xe69c('0x9')]||_0xe69c('0xa')}}};_0x2c8ea4[_0xe69c('0xb')]['customfield_11500']=_0x440d14[_0xe69c('0xc')];_0x2c8ea4[_0xe69c('0xb')][_0xe69c('0xd')]=_0x440d14[_0xe69c('0xe')];_0x2c8ea4[_0xe69c('0xb')]['customfield_11502']=_0x440d14[_0xe69c('0xf')];_0x2c8ea4[_0xe69c('0xb')][_0xe69c('0x10')]=_0x440d14[_0xe69c('0x11')];_0x2c8ea4[_0xe69c('0xb')][_0xe69c('0x12')]=_0x440d14[_0xe69c('0x13')];_0x2c8ea4[_0xe69c('0xb')][_0xe69c('0x14')]=_0x440d14['ip'];var _0x16da6d={'host':_0xe69c('0x15'),'port':0x1bb,'path':_0xe69c('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xe69c('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xe69c('0x18')](_0xe69c('0x19'))}};var _0xb3515d=JSON[_0xe69c('0x8')](_0x2c8ea4);var _0x3c1b91=https[_0xe69c('0x1a')](_0x16da6d,function(_0x11c5b7){_0x11c5b7[_0xe69c('0x1b')](_0xe69c('0x1c'));var _0x15d60='';_0x11c5b7['on'](_0xe69c('0x1d'),function(_0x198028){_0x15d60+=_0x198028;});_0x11c5b7['on'](_0xe69c('0x1e'),function(){if(_0x11d1b2){return _0x11d1b2[_0xe69c('0x1f')](_0x11c5b7[_0xe69c('0x20')])['json'](JSON[_0xe69c('0x21')](_0x15d60));}});});_0x3c1b91['on'](_0xe69c('0x22'),function(_0x227727){if(_0x11d1b2){return _0x11d1b2['status'](0x1f4)['json']({'errors':[{'message':_0xe69c('0x23'),'type':_0xe69c('0x24')}]});}});_0x3c1b91['write'](_0xb3515d);_0x3c1b91[_0xe69c('0x1e')]();}exports['openIssue']=openIssue;exports['send']=function(_0x591d93,_0x22aad0){_0x591d93[_0xe69c('0x25')]['ip']=_0x591d93[_0xe69c('0x26')][_0xe69c('0x27')]||_0x591d93[_0xe69c('0x28')][_0xe69c('0x29')]||_0x591d93[_0xe69c('0x2a')]['remoteAddress']||_0x591d93[_0xe69c('0x28')][_0xe69c('0x2a')][_0xe69c('0x29')];return openIssue(_0x591d93[_0xe69c('0x25')],_0x22aad0);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6c42575..61dd629 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 _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2dae,0xc3));var _0xe2da=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x2dae[_0x3b231a];return _0x18d67a;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x407604,_0x58f902){var _0x2da97a=function(_0x461868){while(--_0x461868){_0x407604['push'](_0x407604['shift']());}};_0x2da97a(++_0x58f902);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1fcc7d,_0x4eb620){_0x1fcc7d=_0x1fcc7d-0x0;var _0x3daa39=_0xbdb7[_0x1fcc7d];return _0x3daa39;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f437530..b866abb 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x13c7be,_0x16b729){_0x13c7be=_0x13c7be-0x0;var _0x88d42c=_0x7a54[_0x13c7be];return _0x88d42c;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x1c41dc,_0x317267){_0x1c41dc=_0x1c41dc-0x0;var _0x1753be=_0x7a54[_0x1c41dc];return _0x1753be;};'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 02bb0c4..43d52f3 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 _0x34f8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','show','params','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x16ddf6,_0x2d5206){var _0x102bd1=function(_0x4ef08b){while(--_0x4ef08b){_0x16ddf6['push'](_0x16ddf6['shift']());}};_0x102bd1(++_0x2d5206);}(_0x34f8,0x80));var _0x834f=function(_0x2459ea,_0x35fbf2){_0x2459ea=_0x2459ea-0x0;var _0x3a766a=_0x34f8[_0x2459ea];return _0x3a766a;};'use strict';var emlformat=require(_0x834f('0x0'));var rimraf=require(_0x834f('0x1'));var zipdir=require(_0x834f('0x2'));var jsonpatch=require(_0x834f('0x3'));var rp=require(_0x834f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x834f('0x5'));var util=require(_0x834f('0x6'));var path=require('path');var sox=require(_0x834f('0x7'));var csv=require(_0x834f('0x8'));var ejs=require(_0x834f('0x9'));var fs=require('fs');var fs_extra=require(_0x834f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x834f('0xb'));var jsforce=require(_0x834f('0xc'));var deskjs=require(_0x834f('0xd'));var toCsv=require(_0x834f('0x8'));var querystring=require('querystring');var Papa=require(_0x834f('0xe'));var Redis=require(_0x834f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x834f('0x10'));var as=require(_0x834f('0x11'));var hardwareService=require(_0x834f('0x12'));var logger=require(_0x834f('0x13'))(_0x834f('0x14'));var utils=require(_0x834f('0x15'));var config=require(_0x834f('0x16'));var licenseUtil=require(_0x834f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bed55,_0x46b91b){_0x46b91b=_0x46b91b||0xcc;return function(_0x456e59){if(_0x456e59){return _0x2bed55[_0x834f('0x18')](_0x46b91b);}return _0x2bed55[_0x834f('0x19')](_0x46b91b)['end']();};}function respondWithResult(_0x1757ae,_0x2f8592){_0x2f8592=_0x2f8592||0xc8;return function(_0x5bfea4){if(_0x5bfea4){return _0x1757ae[_0x834f('0x19')](_0x2f8592)[_0x834f('0x1a')](_0x5bfea4);}};}function respondWithFilteredResult(_0x55bc81,_0x2b9a0c){return function(_0x4bb979){if(_0x4bb979){var _0x342382=typeof _0x2b9a0c[_0x834f('0x1b')]===_0x834f('0x1c')&&typeof _0x2b9a0c[_0x834f('0x1d')]==='undefined';var _0x58154d=_0x4bb979[_0x834f('0x1e')];var _0x440b9b=_0x342382?0x0:_0x2b9a0c[_0x834f('0x1b')];var _0x320ee2=_0x342382?_0x4bb979['count']:_0x2b9a0c[_0x834f('0x1b')]+_0x2b9a0c[_0x834f('0x1d')];var _0x29cccd;if(_0x320ee2>=_0x58154d){_0x320ee2=_0x58154d;_0x29cccd=0xc8;}else{_0x29cccd=0xce;}_0x55bc81['status'](_0x29cccd);return _0x55bc81['set'](_0x834f('0x1f'),_0x440b9b+'-'+_0x320ee2+'/'+_0x58154d)['json'](_0x4bb979);}return null;};}function patchUpdates(_0x268e34){return function(_0x148839){try{jsonpatch['apply'](_0x148839,_0x268e34,!![]);}catch(_0x1fe653){return BPromise['reject'](_0x1fe653);}return _0x148839[_0x834f('0x20')]();};}function saveUpdates(_0x1157e2,_0x31044a){return function(_0x24cf5d){if(_0x24cf5d){return _0x24cf5d['update'](_0x1157e2)[_0x834f('0x21')](function(_0x4f62c8){return _0x4f62c8;});}return null;};}function removeEntity(_0x3ec8dc,_0x59af4e){return function(_0x536907){if(_0x536907){return _0x536907[_0x834f('0x22')]()['then'](function(){_0x3ec8dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e1ef,_0x2268a1){return function(_0xf54a26){if(!_0xf54a26){_0x45e1ef[_0x834f('0x18')](0x194);}return _0xf54a26;};}function handleError(_0x44355b,_0x2d852b){_0x2d852b=_0x2d852b||0x1f4;return function(_0x2cace0){logger[_0x834f('0x23')](_0x2cace0[_0x834f('0x24')]);if(_0x2cace0[_0x834f('0x25')]){delete _0x2cace0[_0x834f('0x25')];}_0x44355b['status'](_0x2d852b)[_0x834f('0x26')](_0x2cace0);};}exports[_0x834f('0x27')]=function(_0xcd12fe,_0x586324){var _0x1136b9={},_0x37e1d8={},_0x20da2d={'count':0x0,'rows':[]};var _0x2854e4=_['map'](db[_0x834f('0x28')][_0x834f('0x29')],function(_0xd411e){return{'name':_0xd411e[_0x834f('0x2a')],'type':_0xd411e['type'][_0x834f('0x2b')]};});_0x37e1d8[_0x834f('0x2c')]=_[_0x834f('0x2d')](_0x2854e4,_0x834f('0x25'));_0x37e1d8['query']=_[_0x834f('0x2e')](_0xcd12fe[_0x834f('0x2f')]);_0x37e1d8['filters']=_[_0x834f('0x30')](_0x37e1d8[_0x834f('0x2c')],_0x37e1d8['query']);_0x1136b9[_0x834f('0x31')]=_[_0x834f('0x30')](_0x37e1d8[_0x834f('0x2c')],qs[_0x834f('0x32')](_0xcd12fe[_0x834f('0x2f')]['fields']));_0x1136b9[_0x834f('0x31')]=_0x1136b9['attributes']['length']?_0x1136b9[_0x834f('0x31')]:_0x37e1d8['model'];if(!_0xcd12fe[_0x834f('0x2f')][_0x834f('0x33')](_0x834f('0x34'))){_0x1136b9[_0x834f('0x1d')]=qs['limit'](_0xcd12fe['query']['limit']);_0x1136b9[_0x834f('0x1b')]=qs[_0x834f('0x1b')](_0xcd12fe[_0x834f('0x2f')][_0x834f('0x1b')]);}_0x1136b9[_0x834f('0x35')]=qs['sort'](_0xcd12fe[_0x834f('0x2f')][_0x834f('0x36')]);_0x1136b9[_0x834f('0x37')]=qs[_0x834f('0x38')](_[_0x834f('0x39')](_0xcd12fe[_0x834f('0x2f')],_0x37e1d8[_0x834f('0x38')]),_0x2854e4);if(_0xcd12fe[_0x834f('0x2f')][_0x834f('0x3a')]){_0x1136b9[_0x834f('0x37')]=_[_0x834f('0x3b')](_0x1136b9[_0x834f('0x37')],{'$or':_[_0x834f('0x2d')](_0x2854e4,function(_0x4b4709){if(_0x4b4709['type']!=='VIRTUAL'){var _0x2cc5f7={};_0x2cc5f7[_0x4b4709['name']]={'$like':'%'+_0xcd12fe['query'][_0x834f('0x3a')]+'%'};return _0x2cc5f7;}})});}_0x1136b9=_[_0x834f('0x3b')]({},_0x1136b9,_0xcd12fe[_0x834f('0x3c')]);var _0x236711={'where':_0x1136b9[_0x834f('0x37')]};return db['JscriptyAnswerReport'][_0x834f('0x1e')](_0x236711)[_0x834f('0x21')](function(_0xa9d502){_0x20da2d[_0x834f('0x1e')]=_0xa9d502;if(_0xcd12fe[_0x834f('0x2f')]['includeAll']){_0x1136b9[_0x834f('0x3d')]=[{'all':!![]}];}return db[_0x834f('0x28')]['findAll'](_0x1136b9);})[_0x834f('0x21')](function(_0x59869){_0x20da2d[_0x834f('0x3e')]=_0x59869;return _0x20da2d;})['then'](respondWithFilteredResult(_0x586324,_0x1136b9))['catch'](handleError(_0x586324,null));};exports[_0x834f('0x3f')]=function(_0x5616ca,_0x49f627){var _0x1b2744={'raw':!![],'where':{'id':_0x5616ca[_0x834f('0x40')]['id']}},_0x214549={};_0x214549['model']=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x214549[_0x834f('0x2f')]=_['keys'](_0x5616ca[_0x834f('0x2f')]);_0x214549[_0x834f('0x38')]=_[_0x834f('0x30')](_0x214549['model'],_0x214549[_0x834f('0x2f')]);_0x1b2744[_0x834f('0x31')]=_[_0x834f('0x30')](_0x214549[_0x834f('0x2c')],qs[_0x834f('0x32')](_0x5616ca[_0x834f('0x2f')][_0x834f('0x32')]));_0x1b2744[_0x834f('0x31')]=_0x1b2744['attributes']['length']?_0x1b2744[_0x834f('0x31')]:_0x214549[_0x834f('0x2c')];if(_0x5616ca[_0x834f('0x2f')][_0x834f('0x41')]){_0x1b2744['include']=[{'all':!![]}];}_0x1b2744=_['merge']({},_0x1b2744,_0x5616ca['options']);return db['JscriptyAnswerReport'][_0x834f('0x42')](_0x1b2744)[_0x834f('0x21')](handleEntityNotFound(_0x49f627,null))[_0x834f('0x21')](respondWithResult(_0x49f627,null))[_0x834f('0x43')](handleError(_0x49f627,null));};exports[_0x834f('0x44')]=function(_0x2076e2,_0x5db5d5){return db[_0x834f('0x28')][_0x834f('0x44')](_0x2076e2[_0x834f('0x45')],{})[_0x834f('0x21')](respondWithResult(_0x5db5d5,0xc9))[_0x834f('0x43')](handleError(_0x5db5d5,null));};exports[_0x834f('0x46')]=function(_0x2203af,_0x28a8eb){if(_0x2203af[_0x834f('0x45')]['id']){delete _0x2203af['body']['id'];}return db[_0x834f('0x28')][_0x834f('0x42')]({'where':{'id':_0x2203af[_0x834f('0x40')]['id']}})['then'](handleEntityNotFound(_0x28a8eb,null))[_0x834f('0x21')](saveUpdates(_0x2203af[_0x834f('0x45')],null))[_0x834f('0x21')](respondWithResult(_0x28a8eb,null))[_0x834f('0x43')](handleError(_0x28a8eb,null));};exports['destroy']=function(_0x3320e3,_0x1617da){return db[_0x834f('0x28')][_0x834f('0x42')]({'where':{'id':_0x3320e3['params']['id']}})[_0x834f('0x21')](handleEntityNotFound(_0x1617da,null))[_0x834f('0x21')](removeEntity(_0x1617da,null))['catch'](handleError(_0x1617da,null));};exports[_0x834f('0x47')]=function(_0x5b8c59,_0x2224ef){return db['JscriptyAnswerReport'][_0x834f('0x47')]()['then'](respondWithResult(_0x2224ef,null))[_0x834f('0x43')](handleError(_0x2224ef,null));}; \ No newline at end of file +var _0xf5a7=['body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','JscriptyAnswerReport','fieldName','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','type','VIRTUAL','merge','where','then','findAll','rows','catch','show','params','rawAttributes','intersection','include','options','create'];(function(_0x1ad574,_0x492d96){var _0x310200=function(_0x3747b0){while(--_0x3747b0){_0x1ad574['push'](_0x1ad574['shift']());}};_0x310200(++_0x492d96);}(_0xf5a7,0x133));var _0x7f5a=function(_0x4f2a2a,_0x392074){_0x4f2a2a=_0x4f2a2a-0x0;var _0x46a537=_0xf5a7[_0x4f2a2a];return _0x46a537;};'use strict';var emlformat=require(_0x7f5a('0x0'));var rimraf=require(_0x7f5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f5a('0x2'));var rp=require(_0x7f5a('0x3'));var moment=require(_0x7f5a('0x4'));var BPromise=require(_0x7f5a('0x5'));var Mustache=require(_0x7f5a('0x6'));var util=require(_0x7f5a('0x7'));var path=require(_0x7f5a('0x8'));var sox=require(_0x7f5a('0x9'));var csv=require(_0x7f5a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f5a('0xb'));var _=require(_0x7f5a('0xc'));var squel=require('squel');var crypto=require(_0x7f5a('0xd'));var jsforce=require(_0x7f5a('0xe'));var deskjs=require(_0x7f5a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f5a('0x10'));var Redis=require(_0x7f5a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f5a('0x12'));var hardwareService=require(_0x7f5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7f5a('0x14'));var config=require(_0x7f5a('0x15'));var licenseUtil=require(_0x7f5a('0x16'));var db=require(_0x7f5a('0x17'))['db'];function respondWithStatusCode(_0x169701,_0x325fda){_0x325fda=_0x325fda||0xcc;return function(_0x55ca4b){if(_0x55ca4b){return _0x169701[_0x7f5a('0x18')](_0x325fda);}return _0x169701[_0x7f5a('0x19')](_0x325fda)[_0x7f5a('0x1a')]();};}function respondWithResult(_0x112311,_0x1f1c17){_0x1f1c17=_0x1f1c17||0xc8;return function(_0x2a25ab){if(_0x2a25ab){return _0x112311[_0x7f5a('0x19')](_0x1f1c17)[_0x7f5a('0x1b')](_0x2a25ab);}};}function respondWithFilteredResult(_0x4ce5c2,_0x2ed7d3){return function(_0x3c6d7c){if(_0x3c6d7c){var _0x5c6810=typeof _0x2ed7d3[_0x7f5a('0x1c')]===_0x7f5a('0x1d')&&typeof _0x2ed7d3[_0x7f5a('0x1e')]===_0x7f5a('0x1d');var _0x568857=_0x3c6d7c[_0x7f5a('0x1f')];var _0xce9655=_0x5c6810?0x0:_0x2ed7d3[_0x7f5a('0x1c')];var _0x3e168e=_0x5c6810?_0x3c6d7c['count']:_0x2ed7d3[_0x7f5a('0x1c')]+_0x2ed7d3[_0x7f5a('0x1e')];var _0x557b16;if(_0x3e168e>=_0x568857){_0x3e168e=_0x568857;_0x557b16=0xc8;}else{_0x557b16=0xce;}_0x4ce5c2['status'](_0x557b16);return _0x4ce5c2[_0x7f5a('0x20')](_0x7f5a('0x21'),_0xce9655+'-'+_0x3e168e+'/'+_0x568857)[_0x7f5a('0x1b')](_0x3c6d7c);}return null;};}function patchUpdates(_0x90c080){return function(_0x208a6e){try{jsonpatch[_0x7f5a('0x22')](_0x208a6e,_0x90c080,!![]);}catch(_0x2942f9){return BPromise[_0x7f5a('0x23')](_0x2942f9);}return _0x208a6e['save']();};}function saveUpdates(_0x4b8d6b,_0x3d5f19){return function(_0x57019e){if(_0x57019e){return _0x57019e[_0x7f5a('0x24')](_0x4b8d6b)['then'](function(_0x3fda96){return _0x3fda96;});}return null;};}function removeEntity(_0x1c43bb,_0xf52b51){return function(_0xb65c0){if(_0xb65c0){return _0xb65c0[_0x7f5a('0x25')]()['then'](function(){_0x1c43bb[_0x7f5a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280a55,_0x31f206){return function(_0x49902a){if(!_0x49902a){_0x280a55[_0x7f5a('0x18')](0x194);}return _0x49902a;};}function handleError(_0x5d53cc,_0x35c43b){_0x35c43b=_0x35c43b||0x1f4;return function(_0x2bfbfe){logger[_0x7f5a('0x26')](_0x2bfbfe[_0x7f5a('0x27')]);if(_0x2bfbfe['name']){delete _0x2bfbfe[_0x7f5a('0x28')];}_0x5d53cc[_0x7f5a('0x19')](_0x35c43b)[_0x7f5a('0x29')](_0x2bfbfe);};}exports[_0x7f5a('0x2a')]=function(_0x49327f,_0x4ee1ca){var _0x550e81={},_0x30c290={},_0x2f8113={'count':0x0,'rows':[]};var _0x332baa=_['map'](db[_0x7f5a('0x2b')]['rawAttributes'],function(_0x347d5c){return{'name':_0x347d5c[_0x7f5a('0x2c')],'type':_0x347d5c['type'][_0x7f5a('0x2d')]};});_0x30c290[_0x7f5a('0x2e')]=_[_0x7f5a('0x2f')](_0x332baa,_0x7f5a('0x28'));_0x30c290[_0x7f5a('0x30')]=_[_0x7f5a('0x31')](_0x49327f[_0x7f5a('0x30')]);_0x30c290[_0x7f5a('0x32')]=_['intersection'](_0x30c290[_0x7f5a('0x2e')],_0x30c290['query']);_0x550e81['attributes']=_['intersection'](_0x30c290[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x49327f[_0x7f5a('0x30')][_0x7f5a('0x33')]));_0x550e81[_0x7f5a('0x34')]=_0x550e81['attributes'][_0x7f5a('0x35')]?_0x550e81['attributes']:_0x30c290[_0x7f5a('0x2e')];if(!_0x49327f['query'][_0x7f5a('0x36')](_0x7f5a('0x37'))){_0x550e81[_0x7f5a('0x1e')]=qs['limit'](_0x49327f['query'][_0x7f5a('0x1e')]);_0x550e81[_0x7f5a('0x1c')]=qs[_0x7f5a('0x1c')](_0x49327f['query'][_0x7f5a('0x1c')]);}_0x550e81['order']=qs['sort'](_0x49327f[_0x7f5a('0x30')][_0x7f5a('0x38')]);_0x550e81['where']=qs[_0x7f5a('0x32')](_[_0x7f5a('0x39')](_0x49327f[_0x7f5a('0x30')],_0x30c290[_0x7f5a('0x32')]),_0x332baa);if(_0x49327f[_0x7f5a('0x30')]['filter']){_0x550e81['where']=_['merge'](_0x550e81['where'],{'$or':_[_0x7f5a('0x2f')](_0x332baa,function(_0x5f194b){if(_0x5f194b[_0x7f5a('0x3a')]!==_0x7f5a('0x3b')){var _0x3e06c6={};_0x3e06c6[_0x5f194b[_0x7f5a('0x28')]]={'$like':'%'+_0x49327f[_0x7f5a('0x30')]['filter']+'%'};return _0x3e06c6;}})});}_0x550e81=_[_0x7f5a('0x3c')]({},_0x550e81,_0x49327f['options']);var _0x367be8={'where':_0x550e81[_0x7f5a('0x3d')]};return db[_0x7f5a('0x2b')]['count'](_0x367be8)[_0x7f5a('0x3e')](function(_0x5219e8){_0x2f8113[_0x7f5a('0x1f')]=_0x5219e8;if(_0x49327f[_0x7f5a('0x30')]['includeAll']){_0x550e81['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7f5a('0x3f')](_0x550e81);})['then'](function(_0x4d65c0){_0x2f8113[_0x7f5a('0x40')]=_0x4d65c0;return _0x2f8113;})[_0x7f5a('0x3e')](respondWithFilteredResult(_0x4ee1ca,_0x550e81))[_0x7f5a('0x41')](handleError(_0x4ee1ca,null));};exports[_0x7f5a('0x42')]=function(_0x1fa1cc,_0x185db9){var _0x121fdf={'raw':!![],'where':{'id':_0x1fa1cc[_0x7f5a('0x43')]['id']}},_0x29b022={};_0x29b022[_0x7f5a('0x2e')]=_[_0x7f5a('0x31')](db['JscriptyAnswerReport'][_0x7f5a('0x44')]);_0x29b022['query']=_[_0x7f5a('0x31')](_0x1fa1cc[_0x7f5a('0x30')]);_0x29b022[_0x7f5a('0x32')]=_['intersection'](_0x29b022[_0x7f5a('0x2e')],_0x29b022[_0x7f5a('0x30')]);_0x121fdf[_0x7f5a('0x34')]=_[_0x7f5a('0x45')](_0x29b022[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x1fa1cc[_0x7f5a('0x30')]['fields']));_0x121fdf[_0x7f5a('0x34')]=_0x121fdf[_0x7f5a('0x34')][_0x7f5a('0x35')]?_0x121fdf[_0x7f5a('0x34')]:_0x29b022[_0x7f5a('0x2e')];if(_0x1fa1cc[_0x7f5a('0x30')]['includeAll']){_0x121fdf[_0x7f5a('0x46')]=[{'all':!![]}];}_0x121fdf=_[_0x7f5a('0x3c')]({},_0x121fdf,_0x1fa1cc[_0x7f5a('0x47')]);return db[_0x7f5a('0x2b')]['find'](_0x121fdf)[_0x7f5a('0x3e')](handleEntityNotFound(_0x185db9,null))[_0x7f5a('0x3e')](respondWithResult(_0x185db9,null))[_0x7f5a('0x41')](handleError(_0x185db9,null));};exports[_0x7f5a('0x48')]=function(_0x10457b,_0x21c7f6){return db[_0x7f5a('0x2b')][_0x7f5a('0x48')](_0x10457b[_0x7f5a('0x49')],{})[_0x7f5a('0x3e')](respondWithResult(_0x21c7f6,0xc9))[_0x7f5a('0x41')](handleError(_0x21c7f6,null));};exports[_0x7f5a('0x24')]=function(_0xaabf0f,_0x163b97){if(_0xaabf0f['body']['id']){delete _0xaabf0f[_0x7f5a('0x49')]['id'];}return db['JscriptyAnswerReport'][_0x7f5a('0x4a')]({'where':{'id':_0xaabf0f[_0x7f5a('0x43')]['id']}})[_0x7f5a('0x3e')](handleEntityNotFound(_0x163b97,null))['then'](saveUpdates(_0xaabf0f['body'],null))[_0x7f5a('0x3e')](respondWithResult(_0x163b97,null))[_0x7f5a('0x41')](handleError(_0x163b97,null));};exports[_0x7f5a('0x25')]=function(_0x3ad069,_0x5731d0){return db[_0x7f5a('0x2b')][_0x7f5a('0x4a')]({'where':{'id':_0x3ad069['params']['id']}})['then'](handleEntityNotFound(_0x5731d0,null))[_0x7f5a('0x3e')](removeEntity(_0x5731d0,null))[_0x7f5a('0x41')](handleError(_0x5731d0,null));};exports[_0x7f5a('0x4b')]=function(_0x225019,_0x361c56){return db['JscriptyAnswerReport'][_0x7f5a('0x4b')]()[_0x7f5a('0x3e')](respondWithResult(_0x361c56,null))['catch'](handleError(_0x361c56,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 1aa0f3c..2161c03 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 _0xe598=['../../config/environment','JscriptyAnswerReport','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x25817e,_0xcba774){var _0x52b022=function(_0x132849){while(--_0x132849){_0x25817e['push'](_0x25817e['shift']());}};_0x52b022(++_0xcba774);}(_0xe598,0x9a));var _0x8e59=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0xe598[_0x58c851];return _0x534d8a;};'use strict';var _=require(_0x8e59('0x0'));var util=require(_0x8e59('0x1'));var logger=require(_0x8e59('0x2'))(_0x8e59('0x3'));var moment=require('moment');var BPromise=require(_0x8e59('0x4'));var rp=require(_0x8e59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e59('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2c3200,_0x540811){return _0x2c3200['define'](_0x8e59('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ee=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x30198b,_0x4a489f){var _0x4255b4=function(_0x158f97){while(--_0x158f97){_0x30198b['push'](_0x30198b['shift']());}};_0x4255b4(++_0x4a489f);}(_0x25ee,0x1b3));var _0xe25e=function(_0x426881,_0x43b2ff){_0x426881=_0x426881-0x0;var _0x97ec6f=_0x25ee[_0x426881];return _0x97ec6f;};'use strict';var _=require(_0xe25e('0x0'));var util=require('util');var logger=require(_0xe25e('0x1'))(_0xe25e('0x2'));var moment=require('moment');var BPromise=require(_0xe25e('0x3'));var rp=require(_0xe25e('0x4'));var fs=require('fs');var path=require(_0xe25e('0x5'));var rimraf=require(_0xe25e('0x6'));var config=require(_0xe25e('0x7'));var attributes=require(_0xe25e('0x8'));module[_0xe25e('0x9')]=function(_0x409b4d,_0x45280d){return _0x409b4d[_0xe25e('0xa')](_0xe25e('0xb'),attributes,{'tableName':_0xe25e('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 9c9404f..b151aa7 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 _0xfcb6=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','JscriptyAnswerReport,\x20%s,\x20%s','message'];(function(_0x379e34,_0x199e44){var _0x36a674=function(_0x25a880){while(--_0x25a880){_0x379e34['push'](_0x379e34['shift']());}};_0x36a674(++_0x199e44);}(_0xfcb6,0x8c));var _0x6fcb=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xfcb6[_0x533110];return _0xc3c866;};'use strict';var _=require('lodash');var util=require(_0x6fcb('0x0'));var moment=require('moment');var BPromise=require(_0x6fcb('0x1'));var rs=require(_0x6fcb('0x2'));var fs=require('fs');var Redis=require(_0x6fcb('0x3'));var db=require(_0x6fcb('0x4'))['db'];var utils=require(_0x6fcb('0x5'));var logger=require(_0x6fcb('0x6'))(_0x6fcb('0x7'));var config=require(_0x6fcb('0x8'));var jayson=require(_0x6fcb('0x9'));var client=jayson[_0x6fcb('0xa')][_0x6fcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15516a,_0x305b3d,_0x2924e6){return new BPromise(function(_0x190680,_0x26d966){return client[_0x6fcb('0xc')](_0x15516a,_0x2924e6)[_0x6fcb('0xd')](function(_0x338b24){logger[_0x6fcb('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x305b3d,'request\x20sent');logger[_0x6fcb('0xf')](_0x6fcb('0x10'),_0x305b3d,_0x6fcb('0x11'),JSON['stringify'](_0x338b24));if(_0x338b24[_0x6fcb('0x12')]){if(_0x338b24[_0x6fcb('0x12')]['code']===0x1f4){logger[_0x6fcb('0x12')](_0x6fcb('0x13'),_0x305b3d,_0x338b24[_0x6fcb('0x12')][_0x6fcb('0x14')]);return _0x26d966(_0x338b24['error'][_0x6fcb('0x14')]);}logger[_0x6fcb('0x12')](_0x6fcb('0x13'),_0x305b3d,_0x338b24[_0x6fcb('0x12')][_0x6fcb('0x14')]);return _0x190680(_0x338b24['error']['message']);}else{logger[_0x6fcb('0xe')](_0x6fcb('0x13'),_0x305b3d,_0x6fcb('0x11'));_0x190680(_0x338b24[_0x6fcb('0x15')]['message']);}})[_0x6fcb('0x16')](function(_0x4cc953){logger[_0x6fcb('0x12')](_0x6fcb('0x13'),_0x305b3d,_0x4cc953);_0x26d966(_0x4cc953);});});} \ No newline at end of file +var _0x911c=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0x911c,0xbd));var _0xc911=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x911c[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0xc911('0x0'));var util=require(_0xc911('0x1'));var moment=require(_0xc911('0x2'));var BPromise=require(_0xc911('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc911('0x4'));var db=require(_0xc911('0x5'))['db'];var utils=require(_0xc911('0x6'));var logger=require(_0xc911('0x7'))(_0xc911('0x8'));var config=require(_0xc911('0x9'));var jayson=require(_0xc911('0xa'));var client=jayson[_0xc911('0xb')][_0xc911('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9a78f8,_0x3228a7,_0x2b2285){return new BPromise(function(_0x50cd46,_0x4eebbf){return client[_0xc911('0xd')](_0x9a78f8,_0x2b2285)['then'](function(_0x1537e3){logger[_0xc911('0xe')](_0xc911('0xf'),_0x3228a7,_0xc911('0x10'));logger[_0xc911('0x11')](_0xc911('0x12'),_0x3228a7,_0xc911('0x10'),JSON['stringify'](_0x1537e3));if(_0x1537e3[_0xc911('0x13')]){if(_0x1537e3['error'][_0xc911('0x14')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3228a7,_0x1537e3[_0xc911('0x13')][_0xc911('0x15')]);return _0x4eebbf(_0x1537e3[_0xc911('0x13')][_0xc911('0x15')]);}logger['error'](_0xc911('0xf'),_0x3228a7,_0x1537e3['error'][_0xc911('0x15')]);return _0x50cd46(_0x1537e3['error'][_0xc911('0x15')]);}else{logger[_0xc911('0xe')](_0xc911('0xf'),_0x3228a7,'request\x20sent');_0x50cd46(_0x1537e3['result'][_0xc911('0x15')]);}})[_0xc911('0x16')](function(_0x1cc5c8){logger[_0xc911('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3228a7,_0x1cc5c8);_0x4eebbf(_0x1cc5c8);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ad643be..4ad60d9 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 _0x4689=['util','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4689,0x15e));var _0x9468=function(_0x50a35b,_0x15bd66){_0x50a35b=_0x50a35b-0x0;var _0x5efb2a=_0x4689[_0x50a35b];return _0x5efb2a;};'use strict';var multer=require('multer');var util=require(_0x9468('0x0'));var path=require('path');var timeout=require(_0x9468('0x1'));var express=require(_0x9468('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9468('0x3'));var config=require(_0x9468('0x4'));var controller=require(_0x9468('0x5'));router[_0x9468('0x6')]('/',auth[_0x9468('0x7')](),controller[_0x9468('0x8')]);router[_0x9468('0x6')](_0x9468('0x9'),auth[_0x9468('0x7')](),controller['show']);router[_0x9468('0x6')](_0x9468('0xa'),auth[_0x9468('0x7')](),controller[_0x9468('0xb')]);router[_0x9468('0x6')](_0x9468('0xc'),auth['isAuthenticated'](),controller[_0x9468('0xd')]);router[_0x9468('0x6')](_0x9468('0xe'),auth[_0x9468('0x7')](),timeout('30s'),controller[_0x9468('0xf')]);router[_0x9468('0x10')]('/',auth['isAuthenticated'](),controller[_0x9468('0x11')]);router[_0x9468('0x10')](_0x9468('0x12'),auth[_0x9468('0x7')](),controller[_0x9468('0x13')]);router[_0x9468('0x14')](_0x9468('0x9'),auth[_0x9468('0x7')](),controller[_0x9468('0x15')]);router[_0x9468('0x16')](_0x9468('0x9'),auth[_0x9468('0x7')](),controller[_0x9468('0x17')]);module[_0x9468('0x18')]=router; \ No newline at end of file +var _0x0abe=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x48f48a,_0x3371cf){var _0x4c55db=function(_0x2bf15f){while(--_0x2bf15f){_0x48f48a['push'](_0x48f48a['shift']());}};_0x4c55db(++_0x3371cf);}(_0x0abe,0x191));var _0xe0ab=function(_0x51d956,_0x4cce45){_0x51d956=_0x51d956-0x0;var _0x33a70e=_0x0abe[_0x51d956];return _0x33a70e;};'use strict';var multer=require(_0xe0ab('0x0'));var util=require(_0xe0ab('0x1'));var path=require(_0xe0ab('0x2'));var timeout=require(_0xe0ab('0x3'));var express=require(_0xe0ab('0x4'));var router=express[_0xe0ab('0x5')]();var fs_extra=require(_0xe0ab('0x6'));var auth=require(_0xe0ab('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe0ab('0x8'));var controller=require('./jscriptyProject.controller');router[_0xe0ab('0x9')]('/',auth[_0xe0ab('0xa')](),controller[_0xe0ab('0xb')]);router[_0xe0ab('0x9')](_0xe0ab('0xc'),auth[_0xe0ab('0xa')](),controller['show']);router[_0xe0ab('0x9')](_0xe0ab('0xd'),auth[_0xe0ab('0xa')](),controller[_0xe0ab('0xe')]);router['get'](_0xe0ab('0xf'),auth[_0xe0ab('0xa')](),controller[_0xe0ab('0x10')]);router[_0xe0ab('0x9')](_0xe0ab('0x11'),auth[_0xe0ab('0xa')](),timeout(_0xe0ab('0x12')),controller['getSummary']);router[_0xe0ab('0x13')]('/',auth[_0xe0ab('0xa')](),controller['create']);router[_0xe0ab('0x13')](_0xe0ab('0x14'),auth[_0xe0ab('0xa')](),controller[_0xe0ab('0x15')]);router[_0xe0ab('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe0ab('0x17')]);router[_0xe0ab('0x18')](_0xe0ab('0xc'),auth[_0xe0ab('0xa')](),controller[_0xe0ab('0x19')]);module[_0xe0ab('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 1bd5ee8..129da01 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 _0x4ace=['TEXT','long','isObjectLike','setDataValue','formData','isString','format','getDataValue','name','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x258d71,_0x371e8a){var _0x12ab49=function(_0x2dbcff){while(--_0x2dbcff){_0x258d71['push'](_0x258d71['shift']());}};_0x12ab49(++_0x371e8a);}(_0x4ace,0x1bd));var _0xe4ac=function(_0x77103,_0x31d787){_0x77103=_0x77103-0x0;var _0x43aee9=_0x4ace[_0x77103];return _0x43aee9;};'use strict';var Sequelize=require(_0xe4ac('0x0'));var _=require(_0xe4ac('0x1'));var util=require(_0xe4ac('0x2'));module[_0xe4ac('0x3')]={'name':{'type':Sequelize[_0xe4ac('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xe4ac('0x4')]},'formData':{'type':Sequelize[_0xe4ac('0x5')](_0xe4ac('0x6')),'set':function(_0x3a8818){if(_[_0xe4ac('0x7')](_0x3a8818)){this[_0xe4ac('0x8')](_0xe4ac('0x9'),JSON['stringify'](_0x3a8818));}else if(_[_0xe4ac('0xa')](_0x3a8818)){this['setDataValue'](_0xe4ac('0x9'),_0x3a8818);}else{this[_0xe4ac('0x8')](_0xe4ac('0x9'),util[_0xe4ac('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xe4ac('0xc')](_0xe4ac('0xd'))||'',this[_0xe4ac('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe4ac('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe4ac('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x90ee=['BOOLEAN','sequelize','lodash','util','name','TEXT','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0x90ee,0x1a5));var _0xe90e=function(_0x1b1c65,_0x23ca6d){_0x1b1c65=_0x1b1c65-0x0;var _0x1b86d9=_0x90ee[_0x1b1c65];return _0x1b86d9;};'use strict';var Sequelize=require(_0xe90e('0x0'));var _=require(_0xe90e('0x1'));var util=require(_0xe90e('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe90e('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe90e('0x4')]('long'),'set':function(_0x19982f){if(_[_0xe90e('0x5')](_0x19982f)){this[_0xe90e('0x6')]('formData',JSON[_0xe90e('0x7')](_0x19982f));}else if(_[_0xe90e('0x8')](_0x19982f)){this[_0xe90e('0x6')](_0xe90e('0x9'),_0x19982f);}else{this[_0xe90e('0x6')](_0xe90e('0x9'),util['format'](_0xe90e('0xa'),this[_0xe90e('0xb')](_0xe90e('0x3'))||'',this[_0xe90e('0xb')](_0xe90e('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe90e('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9f4b761..8d56503 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 _0x30c4=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','params','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','omit','updatedAt','error','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash'];(function(_0x17b9fd,_0x23aef3){var _0x2f8304=function(_0x5a1b40){while(--_0x5a1b40){_0x17b9fd['push'](_0x17b9fd['shift']());}};_0x2f8304(++_0x23aef3);}(_0x30c4,0x152));var _0x430c=function(_0x3fde0c,_0x51b35c){_0x3fde0c=_0x3fde0c-0x0;var _0x2e3cf9=_0x30c4[_0x3fde0c];return _0x2e3cf9;};'use strict';var emlformat=require(_0x430c('0x0'));var rimraf=require(_0x430c('0x1'));var zipdir=require(_0x430c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x430c('0x3'));var BPromise=require(_0x430c('0x4'));var Mustache=require('mustache');var util=require(_0x430c('0x5'));var path=require(_0x430c('0x6'));var sox=require('sox');var csv=require(_0x430c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x430c('0x8'));var _=require(_0x430c('0x9'));var squel=require(_0x430c('0xa'));var crypto=require(_0x430c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x430c('0xc'));var Papa=require(_0x430c('0xd'));var Redis=require(_0x430c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x430c('0xf'));var as=require(_0x430c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x430c('0x11'));var utils=require(_0x430c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x430c('0x13'));var db=require(_0x430c('0x14'))['db'];function respondWithStatusCode(_0x4726a0,_0x250aa0){_0x250aa0=_0x250aa0||0xcc;return function(_0x560ebc){if(_0x560ebc){return _0x4726a0['sendStatus'](_0x250aa0);}return _0x4726a0[_0x430c('0x15')](_0x250aa0)[_0x430c('0x16')]();};}function respondWithResult(_0x56e78f,_0x54e555){_0x54e555=_0x54e555||0xc8;return function(_0x32d5ff){if(_0x32d5ff){return _0x56e78f['status'](_0x54e555)[_0x430c('0x17')](_0x32d5ff);}};}function respondWithFilteredResult(_0x211bf4,_0x177423){return function(_0x48201e){if(_0x48201e){var _0x17423a=typeof _0x177423[_0x430c('0x18')]==='undefined'&&typeof _0x177423[_0x430c('0x19')]===_0x430c('0x1a');var _0x121d98=_0x48201e[_0x430c('0x1b')];var _0x59be80=_0x17423a?0x0:_0x177423['offset'];var _0x521e6d=_0x17423a?_0x48201e['count']:_0x177423[_0x430c('0x18')]+_0x177423[_0x430c('0x19')];var _0x25814f;if(_0x521e6d>=_0x121d98){_0x521e6d=_0x121d98;_0x25814f=0xc8;}else{_0x25814f=0xce;}_0x211bf4[_0x430c('0x15')](_0x25814f);return _0x211bf4[_0x430c('0x1c')](_0x430c('0x1d'),_0x59be80+'-'+_0x521e6d+'/'+_0x121d98)[_0x430c('0x17')](_0x48201e);}return null;};}function patchUpdates(_0x440a94){return function(_0xa0525d){try{jsonpatch['apply'](_0xa0525d,_0x440a94,!![]);}catch(_0x2d1773){return BPromise[_0x430c('0x1e')](_0x2d1773);}return _0xa0525d[_0x430c('0x1f')]();};}function saveUpdates(_0x389d93,_0x3f173b){return function(_0x1107b7){if(_0x1107b7){return _0x1107b7[_0x430c('0x20')](_0x389d93)[_0x430c('0x21')](function(_0x1fe653){return _0x1fe653;});}return null;};}function removeEntity(_0x154029,_0x66ec4){return function(_0x416287){if(_0x416287){return _0x416287[_0x430c('0x22')]()[_0x430c('0x21')](function(){var _0x48275e=_0x416287['get']({'plain':!![]});var _0x2e9340=_0x430c('0x23');return db[_0x430c('0x24')]['destroy']({'where':{'type':_0x2e9340,'resourceId':_0x48275e['id']}})['then'](function(){return _0x416287;});})['then'](function(){_0x154029['status'](0xcc)[_0x430c('0x16')]();});}};}function handleEntityNotFound(_0x55787e,_0x553303){return function(_0x25fd2a){if(!_0x25fd2a){_0x55787e['sendStatus'](0x194);}return _0x25fd2a;};}function handleError(_0x1e9a67,_0x233eaf){_0x233eaf=_0x233eaf||0x1f4;return function(_0x44631f){logger['error'](_0x44631f[_0x430c('0x25')]);if(_0x44631f[_0x430c('0x26')]){delete _0x44631f['name'];}_0x1e9a67[_0x430c('0x15')](_0x233eaf)[_0x430c('0x27')](_0x44631f);};}exports[_0x430c('0x28')]=function(_0x2164a,_0x5660d5){var _0x3da989={},_0x3b6cee={},_0x1b734a={'count':0x0,'rows':[]};var _0x5247cf=_[_0x430c('0x29')](db[_0x430c('0x2a')][_0x430c('0x2b')],function(_0x35f1af){return{'name':_0x35f1af[_0x430c('0x2c')],'type':_0x35f1af['type'][_0x430c('0x2d')]};});_0x3b6cee[_0x430c('0x2e')]=_['map'](_0x5247cf,_0x430c('0x26'));_0x3b6cee[_0x430c('0x2f')]=_[_0x430c('0x30')](_0x2164a[_0x430c('0x2f')]);_0x3b6cee['filters']=_[_0x430c('0x31')](_0x3b6cee['model'],_0x3b6cee[_0x430c('0x2f')]);_0x3da989['attributes']=_[_0x430c('0x31')](_0x3b6cee[_0x430c('0x2e')],qs[_0x430c('0x32')](_0x2164a[_0x430c('0x2f')]['fields']));_0x3da989[_0x430c('0x33')]=_0x3da989[_0x430c('0x33')][_0x430c('0x34')]?_0x3da989[_0x430c('0x33')]:_0x3b6cee[_0x430c('0x2e')];if(!_0x2164a['query'][_0x430c('0x35')](_0x430c('0x36'))){_0x3da989['limit']=qs[_0x430c('0x19')](_0x2164a['query'][_0x430c('0x19')]);_0x3da989['offset']=qs[_0x430c('0x18')](_0x2164a[_0x430c('0x2f')][_0x430c('0x18')]);}_0x3da989[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x2164a[_0x430c('0x2f')][_0x430c('0x38')]);_0x3da989[_0x430c('0x39')]=qs[_0x430c('0x3a')](_['pick'](_0x2164a[_0x430c('0x2f')],_0x3b6cee[_0x430c('0x3a')]),_0x5247cf);if(_0x2164a[_0x430c('0x2f')][_0x430c('0x3b')]){_0x3da989[_0x430c('0x39')]=_[_0x430c('0x3c')](_0x3da989[_0x430c('0x39')],{'$or':_[_0x430c('0x29')](_0x5247cf,function(_0x4aa51e){if(_0x4aa51e['type']!=='VIRTUAL'){var _0x48accd={};_0x48accd[_0x4aa51e[_0x430c('0x26')]]={'$like':'%'+_0x2164a[_0x430c('0x2f')]['filter']+'%'};return _0x48accd;}})});}_0x3da989=_[_0x430c('0x3c')]({},_0x3da989,_0x2164a['options']);var _0xc7db7c={'where':_0x3da989['where']};return db['JscriptyProject'][_0x430c('0x1b')](_0xc7db7c)[_0x430c('0x21')](function(_0xa217b8){_0x1b734a[_0x430c('0x1b')]=_0xa217b8;if(_0x2164a[_0x430c('0x2f')][_0x430c('0x3d')]){_0x3da989[_0x430c('0x3e')]=[{'all':!![]}];}return db[_0x430c('0x2a')][_0x430c('0x3f')](_0x3da989);})[_0x430c('0x21')](function(_0x270cc5){_0x1b734a[_0x430c('0x40')]=_0x270cc5;return _0x1b734a;})[_0x430c('0x21')](respondWithFilteredResult(_0x5660d5,_0x3da989))[_0x430c('0x41')](handleError(_0x5660d5,null));};exports['show']=function(_0x25eb40,_0x4c7aba){var _0x261b06={'raw':![],'where':{'id':_0x25eb40[_0x430c('0x42')]['id']}},_0x566b50={};_0x566b50[_0x430c('0x2e')]=_[_0x430c('0x30')](db[_0x430c('0x2a')][_0x430c('0x2b')]);_0x566b50[_0x430c('0x2f')]=_[_0x430c('0x30')](_0x25eb40[_0x430c('0x2f')]);_0x566b50[_0x430c('0x3a')]=_[_0x430c('0x31')](_0x566b50['model'],_0x566b50['query']);_0x261b06['attributes']=_[_0x430c('0x31')](_0x566b50[_0x430c('0x2e')],qs[_0x430c('0x32')](_0x25eb40[_0x430c('0x2f')][_0x430c('0x32')]));_0x261b06[_0x430c('0x33')]=_0x261b06[_0x430c('0x33')][_0x430c('0x34')]?_0x261b06['attributes']:_0x566b50[_0x430c('0x2e')];if(_0x25eb40['query'][_0x430c('0x3d')]){_0x261b06[_0x430c('0x3e')]=[{'all':!![]}];}_0x261b06=_[_0x430c('0x3c')]({},_0x261b06,_0x25eb40['options']);return db['JscriptyProject']['find'](_0x261b06)['then'](handleEntityNotFound(_0x4c7aba,null))[_0x430c('0x21')](respondWithResult(_0x4c7aba,null))[_0x430c('0x41')](handleError(_0x4c7aba,null));};exports['create']=function(_0x3653d9,_0x2ecd22){return db[_0x430c('0x2a')][_0x430c('0x43')](_0x3653d9[_0x430c('0x44')],{})[_0x430c('0x21')](function(_0x499de6){var _0xd0d63d=_0x3653d9[_0x430c('0x45')][_0x430c('0x46')]({'plain':!![]});if(!_0xd0d63d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd0d63d[_0x430c('0x47')]===_0x430c('0x45')){var _0x421047=_0x499de6[_0x430c('0x46')]({'plain':!![]});var _0x5de5b7='Projects';return db[_0x430c('0x48')][_0x430c('0x49')]({'where':{'name':_0x5de5b7,'userProfileId':_0xd0d63d[_0x430c('0x4a')]},'raw':!![]})[_0x430c('0x21')](function(_0x37d13e){if(_0x37d13e&&_0x37d13e[_0x430c('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x421047[_0x430c('0x26')],'resourceId':_0x421047['id'],'type':_0x37d13e[_0x430c('0x26')],'sectionId':_0x37d13e['id']},{})[_0x430c('0x21')](function(){return _0x499de6;});}else{return _0x499de6;}})[_0x430c('0x41')](function(_0x165188){logger['error'](_0x430c('0x4c'),_0x165188);throw _0x165188;});}return _0x499de6;})['then'](respondWithResult(_0x2ecd22,0xc9))[_0x430c('0x41')](handleError(_0x2ecd22,null));};exports[_0x430c('0x4d')]=function(_0x3ed2e7,_0xfcedb4){var _0x5a513c={'where':{'id':_0x3ed2e7[_0x430c('0x42')]['id']}},_0x23b4fa={};_0x23b4fa[_0x430c('0x2e')]=_[_0x430c('0x30')](db[_0x430c('0x2a')][_0x430c('0x2b')]);_0x5a513c[_0x430c('0x33')]=_[_0x430c('0x31')](_0x23b4fa[_0x430c('0x2e')],qs[_0x430c('0x32')](_0x3ed2e7[_0x430c('0x2f')][_0x430c('0x32')]));_0x5a513c['attributes']=_0x5a513c[_0x430c('0x33')][_0x430c('0x34')]?_0x5a513c['attributes']:_0x23b4fa[_0x430c('0x2e')];if(_0x3ed2e7[_0x430c('0x2f')][_0x430c('0x3d')]){_0x5a513c['include']=[{'all':!![]}];}_0x5a513c=_[_0x430c('0x3c')]({},_0x5a513c,_0x3ed2e7[_0x430c('0x4e')]);return db[_0x430c('0x2a')][_0x430c('0x49')](_0x5a513c)[_0x430c('0x21')](handleEntityNotFound(_0xfcedb4,null))['then'](function(_0x5c6edc){if(_0x5c6edc){var _0x3e6b96=_0x5c6edc[_0x430c('0x46')]({'plain':!![]});_0x3e6b96=qs['omit'](_0x3e6b96,['id',_0x430c('0x4f'),'updatedAt']);_0x3ed2e7['body']=_[_0x430c('0x50')](_0x3ed2e7[_0x430c('0x44')],['id',_0x430c('0x4f'),_0x430c('0x51')]);return db[_0x430c('0x2a')][_0x430c('0x43')](_['merge'](_0x3e6b96,_0x3ed2e7[_0x430c('0x44')]),{'include':_0x3ed2e7[_0x430c('0x2f')][_0x430c('0x3d')]?[{'all':!![]}]:undefined})[_0x430c('0x21')](function(_0x4938ef){var _0x51b5c7=_0x3ed2e7['user'][_0x430c('0x46')]({'plain':!![]});if(!_0x51b5c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51b5c7[_0x430c('0x47')]===_0x430c('0x45')){var _0xbf86ab=_0x4938ef[_0x430c('0x46')]({'plain':!![]});var _0x351e86=_0x430c('0x23');return db[_0x430c('0x48')][_0x430c('0x49')]({'where':{'name':_0x351e86,'userProfileId':_0x51b5c7[_0x430c('0x4a')]},'raw':!![]})[_0x430c('0x21')](function(_0x42d5a6){if(_0x42d5a6&&_0x42d5a6[_0x430c('0x4b')]===0x0){return db['UserProfileResource'][_0x430c('0x43')]({'name':_0xbf86ab[_0x430c('0x26')],'resourceId':_0xbf86ab['id'],'type':_0x42d5a6[_0x430c('0x26')],'sectionId':_0x42d5a6['id']},{})[_0x430c('0x21')](function(){return _0x4938ef;});}else{return _0x4938ef;}})['catch'](function(_0x136336){logger[_0x430c('0x52')](_0x430c('0x4c'),_0x136336);throw _0x136336;});}return _0x4938ef;});}})['then'](respondWithResult(_0xfcedb4,0xc9))[_0x430c('0x41')](handleError(_0xfcedb4,null));};exports[_0x430c('0x20')]=function(_0x28f257,_0x513d20){if(_0x28f257[_0x430c('0x44')]['id']){delete _0x28f257[_0x430c('0x44')]['id'];}return db[_0x430c('0x2a')][_0x430c('0x49')]({'where':{'id':_0x28f257[_0x430c('0x42')]['id']}})[_0x430c('0x21')](handleEntityNotFound(_0x513d20,null))['then'](saveUpdates(_0x28f257[_0x430c('0x44')],null))[_0x430c('0x21')](respondWithResult(_0x513d20,null))[_0x430c('0x41')](handleError(_0x513d20,null));};exports['destroy']=function(_0x2730c8,_0x5ccaa3){return db[_0x430c('0x2a')]['find']({'where':{'id':_0x2730c8[_0x430c('0x42')]['id']}})[_0x430c('0x21')](handleEntityNotFound(_0x5ccaa3,null))[_0x430c('0x21')](removeEntity(_0x5ccaa3,null))[_0x430c('0x41')](handleError(_0x5ccaa3,null));};exports[_0x430c('0x53')]=function(_0x462f55,_0x558b08,_0x4d6a64){var _0xf1224d={'raw':!![],'where':{}};var _0x184b07={};var _0x2806f5={'count':0x0,'rows':[]};return db[_0x430c('0x2a')][_0x430c('0x54')]({'where':{'id':_0x462f55[_0x430c('0x42')]['id']}})['then'](handleEntityNotFound(_0x558b08,null))[_0x430c('0x21')](function(_0x32623e){if(_0x32623e){_0x184b07[_0x430c('0x2e')]=_[_0x430c('0x30')](db[_0x430c('0x55')][_0x430c('0x2b')]);_0x184b07[_0x430c('0x2f')]=_[_0x430c('0x30')](_0x462f55[_0x430c('0x2f')]);_0x184b07[_0x430c('0x3a')]=_[_0x430c('0x31')](_0x184b07[_0x430c('0x2e')],_0x184b07[_0x430c('0x2f')]);_0xf1224d['attributes']=_['intersection'](_0x184b07[_0x430c('0x2e')],qs[_0x430c('0x32')](_0x462f55[_0x430c('0x2f')][_0x430c('0x32')]));_0xf1224d[_0x430c('0x33')]=_0xf1224d['attributes'][_0x430c('0x34')]?_0xf1224d['attributes']:_0x184b07[_0x430c('0x2e')];if(!_0x462f55[_0x430c('0x2f')][_0x430c('0x35')](_0x430c('0x36'))){_0xf1224d[_0x430c('0x19')]=qs[_0x430c('0x19')](_0x462f55[_0x430c('0x2f')][_0x430c('0x19')]);_0xf1224d[_0x430c('0x18')]=qs['offset'](_0x462f55['query']['offset']);}_0xf1224d[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x462f55[_0x430c('0x2f')][_0x430c('0x38')]);_0xf1224d[_0x430c('0x39')]=qs[_0x430c('0x3a')](_[_0x430c('0x56')](_0x462f55[_0x430c('0x2f')],_0x184b07['filters']));_0xf1224d[_0x430c('0x39')][_0x430c('0x57')]=_0x32623e['id'];if(_0x462f55[_0x430c('0x2f')][_0x430c('0x3b')]){_0xf1224d[_0x430c('0x39')]=_[_0x430c('0x3c')](_0xf1224d[_0x430c('0x39')],{'$or':_[_0x430c('0x29')](_0xf1224d['attributes'],function(_0x2b84c5){var _0x16464b={};_0x16464b[_0x2b84c5]={'$like':'%'+_0x462f55['query']['filter']+'%'};return _0x16464b;})});}_0xf1224d=_[_0x430c('0x3c')]({},_0xf1224d,_0x462f55[_0x430c('0x4e')]);return db[_0x430c('0x55')][_0x430c('0x1b')]({'where':_0xf1224d[_0x430c('0x39')]})[_0x430c('0x21')](function(_0x1cde2c){_0x2806f5[_0x430c('0x1b')]=_0x1cde2c;if(_0x462f55[_0x430c('0x2f')]['includeAll']){_0xf1224d[_0x430c('0x3e')]=[{'all':!![]}];}return db[_0x430c('0x55')][_0x430c('0x3f')](_0xf1224d);})[_0x430c('0x21')](function(_0x41dcae){_0x2806f5['rows']=_0x41dcae;return _0x2806f5;});}})[_0x430c('0x21')](respondWithFilteredResult(_0x558b08,_0xf1224d))['catch'](handleError(_0x558b08,null));};exports[_0x430c('0x58')]=function(_0x101c87,_0x20e074,_0x1d8630){var _0x5a040c={'raw':!![],'where':{}};var _0x4ca321={};var _0x196750={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x430c('0x54')]({'where':{'id':_0x101c87[_0x430c('0x42')]['id']}})[_0x430c('0x21')](handleEntityNotFound(_0x20e074,null))['then'](function(_0x46874b){if(_0x46874b){_0x4ca321[_0x430c('0x2e')]=_[_0x430c('0x30')](db[_0x430c('0x59')]['rawAttributes']);_0x4ca321['query']=_[_0x430c('0x30')](_0x101c87['query']);_0x4ca321[_0x430c('0x3a')]=_[_0x430c('0x31')](_0x4ca321[_0x430c('0x2e')],_0x4ca321[_0x430c('0x2f')]);_0x5a040c[_0x430c('0x33')]=_[_0x430c('0x31')](_0x4ca321[_0x430c('0x2e')],qs[_0x430c('0x32')](_0x101c87[_0x430c('0x2f')][_0x430c('0x32')]));_0x5a040c[_0x430c('0x33')]=_0x5a040c[_0x430c('0x33')][_0x430c('0x34')]?_0x5a040c[_0x430c('0x33')]:_0x4ca321[_0x430c('0x2e')];if(!_0x101c87[_0x430c('0x2f')]['hasOwnProperty']('nolimit')){_0x5a040c[_0x430c('0x19')]=qs['limit'](_0x101c87[_0x430c('0x2f')][_0x430c('0x19')]);_0x5a040c[_0x430c('0x18')]=qs[_0x430c('0x18')](_0x101c87[_0x430c('0x2f')]['offset']);}_0x5a040c[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x101c87[_0x430c('0x2f')]['sort']);_0x5a040c['where']=qs[_0x430c('0x3a')](_['pick'](_0x101c87[_0x430c('0x2f')],_0x4ca321[_0x430c('0x3a')]));_0x5a040c[_0x430c('0x39')][_0x430c('0x57')]=_0x46874b['id'];if(_0x101c87[_0x430c('0x2f')][_0x430c('0x3b')]){_0x5a040c[_0x430c('0x39')]=_[_0x430c('0x3c')](_0x5a040c[_0x430c('0x39')],{'$or':_[_0x430c('0x29')](_0x5a040c[_0x430c('0x33')],function(_0x236d45){var _0x3b8335={};_0x3b8335[_0x236d45]={'$like':'%'+_0x101c87['query'][_0x430c('0x3b')]+'%'};return _0x3b8335;})});}_0x5a040c=_[_0x430c('0x3c')]({},_0x5a040c,_0x101c87[_0x430c('0x4e')]);return db[_0x430c('0x59')][_0x430c('0x1b')]({'where':_0x5a040c[_0x430c('0x39')]})['then'](function(_0x277d53){_0x196750[_0x430c('0x1b')]=_0x277d53;if(_0x101c87[_0x430c('0x2f')]['includeAll']){_0x5a040c[_0x430c('0x3e')]=[{'all':!![]}];}return db[_0x430c('0x59')][_0x430c('0x3f')](_0x5a040c);})[_0x430c('0x21')](function(_0x1ee167){_0x196750[_0x430c('0x40')]=_0x1ee167;return _0x196750;});}})[_0x430c('0x21')](respondWithFilteredResult(_0x20e074,_0x5a040c))[_0x430c('0x41')](handleError(_0x20e074,null));};function char(_0x891e71){return'number'===typeof _0x891e71?String[_0x430c('0x5a')][_0x430c('0x5b')](null,arguments):_0x891e71;}function needsEncapsulation(_0x52a6f0){return!!_0x52a6f0&&(_0x52a6f0[_0x430c('0x5c')]()[_0x430c('0x5d')](char(0xd))>=0x0||_0x52a6f0[_0x430c('0x5c')]()[_0x430c('0x5d')](char(0xa))>=0x0||_0x52a6f0[_0x430c('0x5c')]()[_0x430c('0x5d')](char(0x2c))>=0x0||_0x52a6f0['toString']()[_0x430c('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x18181b){var _0x664499=char(0x22),_0x29181d='\x5c'+char(0x22),_0x337e16=_0x18181b[_0x430c('0x5c')]()[_0x430c('0x5e')](new RegExp(_0x664499,'g'),_0x29181d);return _0x664499+_0x337e16+_0x664499;}exports[_0x430c('0x5f')]=function(_0x3e194e,_0x55d80c,_0x5e3f9a){var _0x3e24e1,_0x273b0a;var _0x4f32e9={'where':{'ProjectId':_0x3e194e[_0x430c('0x42')]['id']}};if(_0x3e194e[_0x430c('0x2f')][_0x430c('0x60')]){_0x4f32e9['where'][_0x430c('0x61')]=JSON[_0x430c('0x62')](_0x3e194e[_0x430c('0x2f')][_0x430c('0x60')]);}return db[_0x430c('0x55')]['findAll'](_0x4f32e9)['then'](handleEntityNotFound(_0x55d80c,null))['then'](function(_0x3b8216){if(_0x3b8216){_0x3e24e1=_0x3b8216;return db[_0x430c('0x63')][_0x430c('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x3e24e1,'id')},'ProjectId':_0x3e194e[_0x430c('0x42')]['id']},'order':_0x430c('0x64')});}})[_0x430c('0x21')](handleEntityNotFound(_0x55d80c,null))[_0x430c('0x21')](function(_0x565f00){if(_0x565f00){_0x273b0a=_0x565f00;var _0x2ca153={};for(var _0x44c751=0x0,_0x36a426=_0x273b0a[_0x430c('0x34')];_0x44c751<_0x36a426;_0x44c751++){if(!_0x2ca153[_0x430c('0x35')](_0x273b0a[_0x44c751]['questionId'])){_0x2ca153[_0x273b0a[_0x44c751][_0x430c('0x65')]]=needsEncapsulation(_0x273b0a[_0x44c751][_0x430c('0x66')])?encapsulate(_0x273b0a[_0x44c751][_0x430c('0x66')]):_0x273b0a[_0x44c751][_0x430c('0x66')];}}var _0x171087=[],_0x5eec86={};for(var _0x36351d=0x0,_0x3092d2=_0x3e24e1[_0x430c('0x34')];_0x36351d<_0x3092d2;_0x36351d++){_0x5eec86={'ProjectId':_0x3e194e[_0x430c('0x42')]['id'],'SessionId':_0x3e24e1[_0x36351d]['id'],'StartTime':moment(_0x3e24e1[_0x36351d][_0x430c('0x61')])[_0x430c('0x67')](_0x430c('0x68'))};for(var _0x367155=0x0,_0x196009=_0x273b0a[_0x430c('0x34')];_0x367155<_0x196009;_0x367155++){if(_0x273b0a[_0x367155][_0x430c('0x69')]==_0x3e24e1[_0x36351d]['id']&&_0x2ca153[_0x430c('0x35')](_0x273b0a[_0x367155]['questionId'])){_0x5eec86[_0x2ca153[_0x273b0a[_0x367155][_0x430c('0x65')]]]=_0x273b0a[_0x367155][_0x430c('0x6a')];}}for(var _0x33e335 in _0x2ca153){if(!_0x5eec86[_0x430c('0x35')](_0x2ca153[_0x33e335])){_0x5eec86[_0x2ca153[_0x33e335]]=null;}}_0x171087['push'](_0x5eec86);}return _0x171087;}})[_0x430c('0x21')](function(_0x1211b1){if(!_['isEmpty'](_0x1211b1)){var _0x48ecb4=toCsv(_0x1211b1);var _0x3917ec=Date[_0x430c('0x6b')]();fs[_0x430c('0x6c')](util['format'](_0x430c('0x6d'),_0x3e194e[_0x430c('0x42')]['id'],_0x3917ec),_0x48ecb4);_0x55d80c[_0x430c('0x6e')](_0x430c('0x6f'),_0x430c('0x70')+util[_0x430c('0x67')](_0x430c('0x71'),_0x3e194e[_0x430c('0x42')]['id'],_0x3917ec));_0x55d80c[_0x430c('0x6e')](_0x430c('0x72'),_0x430c('0x73'));return _0x55d80c['download'](util[_0x430c('0x67')](_0x430c('0x6d'),_0x3e194e[_0x430c('0x42')]['id'],_0x3917ec));}else{return _0x55d80c['sendStatus'](0xcc);}})[_0x430c('0x41')](handleError(_0x55d80c,null));}; \ No newline at end of file +var _0xc87b=['JscriptyProject','findAll','catch','params','rawAttributes','includeAll','include','options','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc87b,0xb2));var _0xbc87=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xc87b[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xbc87('0x0'));var rimraf=require(_0xbc87('0x1'));var zipdir=require(_0xbc87('0x2'));var jsonpatch=require(_0xbc87('0x3'));var rp=require('request-promise');var moment=require(_0xbc87('0x4'));var BPromise=require(_0xbc87('0x5'));var Mustache=require(_0xbc87('0x6'));var util=require('util');var path=require(_0xbc87('0x7'));var sox=require(_0xbc87('0x8'));var csv=require(_0xbc87('0x9'));var ejs=require(_0xbc87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc87('0xb'));var squel=require(_0xbc87('0xc'));var crypto=require(_0xbc87('0xd'));var jsforce=require(_0xbc87('0xe'));var deskjs=require(_0xbc87('0xf'));var toCsv=require(_0xbc87('0x9'));var querystring=require(_0xbc87('0x10'));var Papa=require(_0xbc87('0x11'));var Redis=require(_0xbc87('0x12'));var authService=require(_0xbc87('0x13'));var qs=require(_0xbc87('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc87('0x15'));var logger=require('../../config/logger')(_0xbc87('0x16'));var utils=require(_0xbc87('0x17'));var config=require(_0xbc87('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc87('0x19'))['db'];function respondWithStatusCode(_0x3b1906,_0x51a0f0){_0x51a0f0=_0x51a0f0||0xcc;return function(_0x9d0643){if(_0x9d0643){return _0x3b1906[_0xbc87('0x1a')](_0x51a0f0);}return _0x3b1906['status'](_0x51a0f0)[_0xbc87('0x1b')]();};}function respondWithResult(_0x1a8760,_0x4feea6){_0x4feea6=_0x4feea6||0xc8;return function(_0x2b4778){if(_0x2b4778){return _0x1a8760[_0xbc87('0x1c')](_0x4feea6)[_0xbc87('0x1d')](_0x2b4778);}};}function respondWithFilteredResult(_0x472dab,_0x3afc9f){return function(_0x2c3488){if(_0x2c3488){var _0x56c22c=typeof _0x3afc9f['offset']===_0xbc87('0x1e')&&typeof _0x3afc9f[_0xbc87('0x1f')]===_0xbc87('0x1e');var _0x5e6700=_0x2c3488[_0xbc87('0x20')];var _0x461031=_0x56c22c?0x0:_0x3afc9f[_0xbc87('0x21')];var _0x5beeb1=_0x56c22c?_0x2c3488[_0xbc87('0x20')]:_0x3afc9f[_0xbc87('0x21')]+_0x3afc9f[_0xbc87('0x1f')];var _0x46068d;if(_0x5beeb1>=_0x5e6700){_0x5beeb1=_0x5e6700;_0x46068d=0xc8;}else{_0x46068d=0xce;}_0x472dab[_0xbc87('0x1c')](_0x46068d);return _0x472dab[_0xbc87('0x22')](_0xbc87('0x23'),_0x461031+'-'+_0x5beeb1+'/'+_0x5e6700)[_0xbc87('0x1d')](_0x2c3488);}return null;};}function patchUpdates(_0x51d0a4){return function(_0x52e885){try{jsonpatch[_0xbc87('0x24')](_0x52e885,_0x51d0a4,!![]);}catch(_0x22cbd9){return BPromise[_0xbc87('0x25')](_0x22cbd9);}return _0x52e885[_0xbc87('0x26')]();};}function saveUpdates(_0x320102,_0x1bc01e){return function(_0x3edfd5){if(_0x3edfd5){return _0x3edfd5[_0xbc87('0x27')](_0x320102)['then'](function(_0x54036c){return _0x54036c;});}return null;};}function removeEntity(_0x41d595,_0x5860e4){return function(_0x1c6ef8){if(_0x1c6ef8){return _0x1c6ef8[_0xbc87('0x28')]()[_0xbc87('0x29')](function(){var _0x5aee55=_0x1c6ef8[_0xbc87('0x2a')]({'plain':!![]});var _0x3bf85d=_0xbc87('0x2b');return db[_0xbc87('0x2c')][_0xbc87('0x28')]({'where':{'type':_0x3bf85d,'resourceId':_0x5aee55['id']}})['then'](function(){return _0x1c6ef8;});})[_0xbc87('0x29')](function(){_0x41d595['status'](0xcc)[_0xbc87('0x1b')]();});}};}function handleEntityNotFound(_0x3c36f7,_0x59dc4b){return function(_0x96be38){if(!_0x96be38){_0x3c36f7[_0xbc87('0x1a')](0x194);}return _0x96be38;};}function handleError(_0x474215,_0x3155a1){_0x3155a1=_0x3155a1||0x1f4;return function(_0x1b5fd6){logger[_0xbc87('0x2d')](_0x1b5fd6[_0xbc87('0x2e')]);if(_0x1b5fd6['name']){delete _0x1b5fd6[_0xbc87('0x2f')];}_0x474215[_0xbc87('0x1c')](_0x3155a1)[_0xbc87('0x30')](_0x1b5fd6);};}exports[_0xbc87('0x31')]=function(_0x480d2e,_0x1fe23a){var _0x404dfb={},_0xfb3168={},_0x400769={'count':0x0,'rows':[]};var _0x312ebd=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x5c6a0d){return{'name':_0x5c6a0d['fieldName'],'type':_0x5c6a0d['type'][_0xbc87('0x32')]};});_0xfb3168[_0xbc87('0x33')]=_[_0xbc87('0x34')](_0x312ebd,_0xbc87('0x2f'));_0xfb3168[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x480d2e['query']);_0xfb3168[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0xfb3168['model'],_0xfb3168[_0xbc87('0x35')]);_0x404dfb[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0xfb3168[_0xbc87('0x33')],qs[_0xbc87('0x3a')](_0x480d2e['query'][_0xbc87('0x3a')]));_0x404dfb[_0xbc87('0x39')]=_0x404dfb[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x404dfb[_0xbc87('0x39')]:_0xfb3168['model'];if(!_0x480d2e[_0xbc87('0x35')][_0xbc87('0x3c')](_0xbc87('0x3d'))){_0x404dfb[_0xbc87('0x1f')]=qs[_0xbc87('0x1f')](_0x480d2e[_0xbc87('0x35')][_0xbc87('0x1f')]);_0x404dfb[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0x480d2e['query'][_0xbc87('0x21')]);}_0x404dfb['order']=qs[_0xbc87('0x3e')](_0x480d2e[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x404dfb[_0xbc87('0x3f')]=qs[_0xbc87('0x37')](_[_0xbc87('0x40')](_0x480d2e[_0xbc87('0x35')],_0xfb3168[_0xbc87('0x37')]),_0x312ebd);if(_0x480d2e[_0xbc87('0x35')][_0xbc87('0x41')]){_0x404dfb[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x404dfb['where'],{'$or':_[_0xbc87('0x34')](_0x312ebd,function(_0x455537){if(_0x455537[_0xbc87('0x43')]!=='VIRTUAL'){var _0xdfec35={};_0xdfec35[_0x455537[_0xbc87('0x2f')]]={'$like':'%'+_0x480d2e[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0xdfec35;}})});}_0x404dfb=_[_0xbc87('0x42')]({},_0x404dfb,_0x480d2e['options']);var _0xfd7e4d={'where':_0x404dfb[_0xbc87('0x3f')]};return db[_0xbc87('0x44')][_0xbc87('0x20')](_0xfd7e4d)[_0xbc87('0x29')](function(_0x427a3b){_0x400769[_0xbc87('0x20')]=_0x427a3b;if(_0x480d2e['query']['includeAll']){_0x404dfb['include']=[{'all':!![]}];}return db[_0xbc87('0x44')][_0xbc87('0x45')](_0x404dfb);})['then'](function(_0x1d73b0){_0x400769['rows']=_0x1d73b0;return _0x400769;})[_0xbc87('0x29')](respondWithFilteredResult(_0x1fe23a,_0x404dfb))[_0xbc87('0x46')](handleError(_0x1fe23a,null));};exports['show']=function(_0x45a0cb,_0x2121b1){var _0x3ac1f5={'raw':![],'where':{'id':_0x45a0cb[_0xbc87('0x47')]['id']}},_0xe1870a={};_0xe1870a[_0xbc87('0x33')]=_['keys'](db[_0xbc87('0x44')][_0xbc87('0x48')]);_0xe1870a[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x45a0cb[_0xbc87('0x35')]);_0xe1870a['filters']=_[_0xbc87('0x38')](_0xe1870a[_0xbc87('0x33')],_0xe1870a['query']);_0x3ac1f5['attributes']=_[_0xbc87('0x38')](_0xe1870a['model'],qs[_0xbc87('0x3a')](_0x45a0cb[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x3ac1f5[_0xbc87('0x39')]=_0x3ac1f5[_0xbc87('0x39')]['length']?_0x3ac1f5[_0xbc87('0x39')]:_0xe1870a['model'];if(_0x45a0cb[_0xbc87('0x35')][_0xbc87('0x49')]){_0x3ac1f5[_0xbc87('0x4a')]=[{'all':!![]}];}_0x3ac1f5=_[_0xbc87('0x42')]({},_0x3ac1f5,_0x45a0cb[_0xbc87('0x4b')]);return db[_0xbc87('0x44')][_0xbc87('0x4c')](_0x3ac1f5)[_0xbc87('0x29')](handleEntityNotFound(_0x2121b1,null))[_0xbc87('0x29')](respondWithResult(_0x2121b1,null))[_0xbc87('0x46')](handleError(_0x2121b1,null));};exports[_0xbc87('0x4d')]=function(_0x2f66f1,_0x225fbe){return db[_0xbc87('0x44')][_0xbc87('0x4d')](_0x2f66f1[_0xbc87('0x4e')],{})[_0xbc87('0x29')](function(_0x530b9c){var _0x6497c1=_0x2f66f1['user'][_0xbc87('0x2a')]({'plain':!![]});if(!_0x6497c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6497c1[_0xbc87('0x4f')]===_0xbc87('0x50')){var _0x578d96=_0x530b9c[_0xbc87('0x2a')]({'plain':!![]});var _0x38ca58=_0xbc87('0x2b');return db[_0xbc87('0x51')][_0xbc87('0x4c')]({'where':{'name':_0x38ca58,'userProfileId':_0x6497c1['userProfileId']},'raw':!![]})[_0xbc87('0x29')](function(_0x40cdc1){if(_0x40cdc1&&_0x40cdc1[_0xbc87('0x52')]===0x0){return db[_0xbc87('0x2c')][_0xbc87('0x4d')]({'name':_0x578d96['name'],'resourceId':_0x578d96['id'],'type':_0x40cdc1[_0xbc87('0x2f')],'sectionId':_0x40cdc1['id']},{})['then'](function(){return _0x530b9c;});}else{return _0x530b9c;}})[_0xbc87('0x46')](function(_0x5f2a82){logger[_0xbc87('0x2d')](_0xbc87('0x53'),_0x5f2a82);throw _0x5f2a82;});}return _0x530b9c;})['then'](respondWithResult(_0x225fbe,0xc9))[_0xbc87('0x46')](handleError(_0x225fbe,null));};exports[_0xbc87('0x54')]=function(_0x112cc7,_0x12109e){var _0x12c4d1={'where':{'id':_0x112cc7['params']['id']}},_0x48294c={};_0x48294c[_0xbc87('0x33')]=_['keys'](db[_0xbc87('0x44')][_0xbc87('0x48')]);_0x12c4d1['attributes']=_[_0xbc87('0x38')](_0x48294c['model'],qs['fields'](_0x112cc7[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x12c4d1[_0xbc87('0x39')]=_0x12c4d1[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x12c4d1[_0xbc87('0x39')]:_0x48294c['model'];if(_0x112cc7['query'][_0xbc87('0x49')]){_0x12c4d1[_0xbc87('0x4a')]=[{'all':!![]}];}_0x12c4d1=_[_0xbc87('0x42')]({},_0x12c4d1,_0x112cc7[_0xbc87('0x4b')]);return db[_0xbc87('0x44')][_0xbc87('0x4c')](_0x12c4d1)[_0xbc87('0x29')](handleEntityNotFound(_0x12109e,null))[_0xbc87('0x29')](function(_0x397b93){if(_0x397b93){var _0x38e4c7=_0x397b93[_0xbc87('0x2a')]({'plain':!![]});_0x38e4c7=qs[_0xbc87('0x55')](_0x38e4c7,['id',_0xbc87('0x56'),_0xbc87('0x57')]);_0x112cc7[_0xbc87('0x4e')]=_[_0xbc87('0x55')](_0x112cc7[_0xbc87('0x4e')],['id',_0xbc87('0x56'),_0xbc87('0x57')]);return db[_0xbc87('0x44')][_0xbc87('0x4d')](_[_0xbc87('0x42')](_0x38e4c7,_0x112cc7[_0xbc87('0x4e')]),{'include':_0x112cc7[_0xbc87('0x35')][_0xbc87('0x49')]?[{'all':!![]}]:undefined})[_0xbc87('0x29')](function(_0x14b27c){var _0x289ad4=_0x112cc7[_0xbc87('0x50')][_0xbc87('0x2a')]({'plain':!![]});if(!_0x289ad4)throw new Error(_0xbc87('0x58'));if(_0x289ad4['role']==='user'){var _0x566414=_0x14b27c[_0xbc87('0x2a')]({'plain':!![]});var _0x257535=_0xbc87('0x2b');return db[_0xbc87('0x51')][_0xbc87('0x4c')]({'where':{'name':_0x257535,'userProfileId':_0x289ad4['userProfileId']},'raw':!![]})[_0xbc87('0x29')](function(_0x70600c){if(_0x70600c&&_0x70600c[_0xbc87('0x52')]===0x0){return db[_0xbc87('0x2c')][_0xbc87('0x4d')]({'name':_0x566414[_0xbc87('0x2f')],'resourceId':_0x566414['id'],'type':_0x70600c[_0xbc87('0x2f')],'sectionId':_0x70600c['id']},{})[_0xbc87('0x29')](function(){return _0x14b27c;});}else{return _0x14b27c;}})[_0xbc87('0x46')](function(_0x57e426){logger[_0xbc87('0x2d')](_0xbc87('0x53'),_0x57e426);throw _0x57e426;});}return _0x14b27c;});}})[_0xbc87('0x29')](respondWithResult(_0x12109e,0xc9))[_0xbc87('0x46')](handleError(_0x12109e,null));};exports[_0xbc87('0x27')]=function(_0xd8b455,_0x4c14cd){if(_0xd8b455['body']['id']){delete _0xd8b455['body']['id'];}return db[_0xbc87('0x44')]['find']({'where':{'id':_0xd8b455[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x4c14cd,null))['then'](saveUpdates(_0xd8b455[_0xbc87('0x4e')],null))[_0xbc87('0x29')](respondWithResult(_0x4c14cd,null))[_0xbc87('0x46')](handleError(_0x4c14cd,null));};exports['destroy']=function(_0x5e4885,_0x332bcb){return db['JscriptyProject'][_0xbc87('0x4c')]({'where':{'id':_0x5e4885[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x332bcb,null))[_0xbc87('0x29')](removeEntity(_0x332bcb,null))[_0xbc87('0x46')](handleError(_0x332bcb,null));};exports[_0xbc87('0x59')]=function(_0x2745c4,_0x3f666a,_0x421d1f){var _0x1659d7={'raw':!![],'where':{}};var _0x62bb40={};var _0x26e0f5={'count':0x0,'rows':[]};return db[_0xbc87('0x44')][_0xbc87('0x5a')]({'where':{'id':_0x2745c4[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x3f666a,null))[_0xbc87('0x29')](function(_0x295b5c){if(_0x295b5c){_0x62bb40[_0xbc87('0x33')]=_[_0xbc87('0x36')](db[_0xbc87('0x5b')][_0xbc87('0x48')]);_0x62bb40[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x2745c4['query']);_0x62bb40[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0x62bb40[_0xbc87('0x33')],_0x62bb40['query']);_0x1659d7[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0x62bb40[_0xbc87('0x33')],qs[_0xbc87('0x3a')](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x1659d7[_0xbc87('0x39')]=_0x1659d7[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x1659d7[_0xbc87('0x39')]:_0x62bb40[_0xbc87('0x33')];if(!_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3c')]('nolimit')){_0x1659d7[_0xbc87('0x1f')]=qs['limit'](_0x2745c4['query'][_0xbc87('0x1f')]);_0x1659d7[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x21')]);}_0x1659d7[_0xbc87('0x5c')]=qs['sort'](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x1659d7[_0xbc87('0x3f')]=qs[_0xbc87('0x37')](_[_0xbc87('0x40')](_0x2745c4[_0xbc87('0x35')],_0x62bb40[_0xbc87('0x37')]));_0x1659d7[_0xbc87('0x3f')][_0xbc87('0x5d')]=_0x295b5c['id'];if(_0x2745c4['query'][_0xbc87('0x41')]){_0x1659d7[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x1659d7[_0xbc87('0x3f')],{'$or':_[_0xbc87('0x34')](_0x1659d7[_0xbc87('0x39')],function(_0x26891a){var _0x10d04a={};_0x10d04a[_0x26891a]={'$like':'%'+_0x2745c4[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0x10d04a;})});}_0x1659d7=_['merge']({},_0x1659d7,_0x2745c4[_0xbc87('0x4b')]);return db[_0xbc87('0x5b')][_0xbc87('0x20')]({'where':_0x1659d7[_0xbc87('0x3f')]})['then'](function(_0x3ebd6b){_0x26e0f5['count']=_0x3ebd6b;if(_0x2745c4[_0xbc87('0x35')][_0xbc87('0x49')]){_0x1659d7['include']=[{'all':!![]}];}return db[_0xbc87('0x5b')]['findAll'](_0x1659d7);})['then'](function(_0x4c912c){_0x26e0f5[_0xbc87('0x5e')]=_0x4c912c;return _0x26e0f5;});}})[_0xbc87('0x29')](respondWithFilteredResult(_0x3f666a,_0x1659d7))['catch'](handleError(_0x3f666a,null));};exports[_0xbc87('0x5f')]=function(_0xa2b9a4,_0x509623,_0x2a8171){var _0x40d9a8={'raw':!![],'where':{}};var _0xfdd155={};var _0x4a979e={'count':0x0,'rows':[]};return db[_0xbc87('0x44')][_0xbc87('0x5a')]({'where':{'id':_0xa2b9a4[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x509623,null))['then'](function(_0x1d0d57){if(_0x1d0d57){_0xfdd155['model']=_[_0xbc87('0x36')](db[_0xbc87('0x60')][_0xbc87('0x48')]);_0xfdd155['query']=_[_0xbc87('0x36')](_0xa2b9a4['query']);_0xfdd155[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0xfdd155[_0xbc87('0x33')],_0xfdd155[_0xbc87('0x35')]);_0x40d9a8[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0xfdd155[_0xbc87('0x33')],qs['fields'](_0xa2b9a4['query'][_0xbc87('0x3a')]));_0x40d9a8[_0xbc87('0x39')]=_0x40d9a8[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x40d9a8[_0xbc87('0x39')]:_0xfdd155[_0xbc87('0x33')];if(!_0xa2b9a4['query'][_0xbc87('0x3c')]('nolimit')){_0x40d9a8[_0xbc87('0x1f')]=qs[_0xbc87('0x1f')](_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x1f')]);_0x40d9a8[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0xa2b9a4[_0xbc87('0x35')]['offset']);}_0x40d9a8[_0xbc87('0x5c')]=qs['sort'](_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x40d9a8['where']=qs['filters'](_[_0xbc87('0x40')](_0xa2b9a4['query'],_0xfdd155[_0xbc87('0x37')]));_0x40d9a8['where']['ProjectId']=_0x1d0d57['id'];if(_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x41')]){_0x40d9a8[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x40d9a8[_0xbc87('0x3f')],{'$or':_[_0xbc87('0x34')](_0x40d9a8[_0xbc87('0x39')],function(_0x8bce11){var _0xe8096d={};_0xe8096d[_0x8bce11]={'$like':'%'+_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0xe8096d;})});}_0x40d9a8=_[_0xbc87('0x42')]({},_0x40d9a8,_0xa2b9a4[_0xbc87('0x4b')]);return db[_0xbc87('0x60')][_0xbc87('0x20')]({'where':_0x40d9a8['where']})['then'](function(_0x2c828f){_0x4a979e[_0xbc87('0x20')]=_0x2c828f;if(_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x49')]){_0x40d9a8['include']=[{'all':!![]}];}return db[_0xbc87('0x60')][_0xbc87('0x45')](_0x40d9a8);})[_0xbc87('0x29')](function(_0xb35e01){_0x4a979e[_0xbc87('0x5e')]=_0xb35e01;return _0x4a979e;});}})[_0xbc87('0x29')](respondWithFilteredResult(_0x509623,_0x40d9a8))['catch'](handleError(_0x509623,null));};function char(_0x37597f){return _0xbc87('0x61')===typeof _0x37597f?String[_0xbc87('0x62')]['apply'](null,arguments):_0x37597f;}function needsEncapsulation(_0x4e002e){return!!_0x4e002e&&(_0x4e002e['toString']()[_0xbc87('0x63')](char(0xd))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0xa))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0x2c))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0x22))>=0x0);}function encapsulate(_0x15faf1){var _0x17043d=char(0x22),_0x30ae73='\x5c'+char(0x22),_0x4fd064=_0x15faf1[_0xbc87('0x64')]()[_0xbc87('0x65')](new RegExp(_0x17043d,'g'),_0x30ae73);return _0x17043d+_0x4fd064+_0x17043d;}exports[_0xbc87('0x66')]=function(_0x42f8c1,_0x48365f,_0x1313ff){var _0x40e4bc,_0x9c13dd;var _0x5e7a07={'where':{'ProjectId':_0x42f8c1[_0xbc87('0x47')]['id']}};if(_0x42f8c1[_0xbc87('0x35')]['startTime']){_0x5e7a07['where']['starttime']=JSON['parse'](_0x42f8c1[_0xbc87('0x35')][_0xbc87('0x67')]);}return db[_0xbc87('0x5b')][_0xbc87('0x45')](_0x5e7a07)['then'](handleEntityNotFound(_0x48365f,null))[_0xbc87('0x29')](function(_0x293421){if(_0x293421){_0x40e4bc=_0x293421;return db[_0xbc87('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xbc87('0x34')](_0x40e4bc,'id')},'ProjectId':_0x42f8c1['params']['id']},'order':'-createdAt'});}})[_0xbc87('0x29')](handleEntityNotFound(_0x48365f,null))[_0xbc87('0x29')](function(_0x2517a4){if(_0x2517a4){_0x9c13dd=_0x2517a4;var _0x430eb4={};for(var _0x21dbb6=0x0,_0x424fbe=_0x9c13dd[_0xbc87('0x3b')];_0x21dbb6<_0x424fbe;_0x21dbb6++){if(!_0x430eb4[_0xbc87('0x3c')](_0x9c13dd[_0x21dbb6][_0xbc87('0x69')])){_0x430eb4[_0x9c13dd[_0x21dbb6][_0xbc87('0x69')]]=needsEncapsulation(_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')])?encapsulate(_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')]):_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')];}}var _0x34fa7f=[],_0x275bb6={};for(var _0x3330f0=0x0,_0x106728=_0x40e4bc[_0xbc87('0x3b')];_0x3330f0<_0x106728;_0x3330f0++){_0x275bb6={'ProjectId':_0x42f8c1['params']['id'],'SessionId':_0x40e4bc[_0x3330f0]['id'],'StartTime':moment(_0x40e4bc[_0x3330f0][_0xbc87('0x6b')])['format'](_0xbc87('0x6c'))};for(var _0x4d6872=0x0,_0x496949=_0x9c13dd['length'];_0x4d6872<_0x496949;_0x4d6872++){if(_0x9c13dd[_0x4d6872][_0xbc87('0x6d')]==_0x40e4bc[_0x3330f0]['id']&&_0x430eb4[_0xbc87('0x3c')](_0x9c13dd[_0x4d6872][_0xbc87('0x69')])){_0x275bb6[_0x430eb4[_0x9c13dd[_0x4d6872][_0xbc87('0x69')]]]=_0x9c13dd[_0x4d6872]['answer'];}}for(var _0x3060e0 in _0x430eb4){if(!_0x275bb6[_0xbc87('0x3c')](_0x430eb4[_0x3060e0])){_0x275bb6[_0x430eb4[_0x3060e0]]=null;}}_0x34fa7f[_0xbc87('0x6e')](_0x275bb6);}return _0x34fa7f;}})['then'](function(_0x1ca4dc){if(!_[_0xbc87('0x6f')](_0x1ca4dc)){var _0x39feed=toCsv(_0x1ca4dc);var _0x347d85=Date[_0xbc87('0x70')]();fs[_0xbc87('0x71')](util['format'](_0xbc87('0x72'),_0x42f8c1[_0xbc87('0x47')]['id'],_0x347d85),_0x39feed);_0x48365f['setHeader'](_0xbc87('0x73'),_0xbc87('0x74')+util[_0xbc87('0x75')](_0xbc87('0x76'),_0x42f8c1[_0xbc87('0x47')]['id'],_0x347d85));_0x48365f[_0xbc87('0x77')](_0xbc87('0x78'),_0xbc87('0x79'));return _0x48365f[_0xbc87('0x7a')](util[_0xbc87('0x75')](_0xbc87('0x72'),_0x42f8c1['params']['id'],_0x347d85));}else{return _0x48365f[_0xbc87('0x1a')](0xcc);}})[_0xbc87('0x46')](handleError(_0x48365f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 85a7bb2..3f04811 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 _0xab29=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x5114ce,_0x539ecc){var _0x196363=function(_0x179f08){while(--_0x179f08){_0x5114ce['push'](_0x5114ce['shift']());}};_0x196363(++_0x539ecc);}(_0xab29,0x145));var _0x9ab2=function(_0x2b2218,_0x516083){_0x2b2218=_0x2b2218-0x0;var _0x70b5d5=_0xab29[_0x2b2218];return _0x70b5d5;};'use strict';var _=require(_0x9ab2('0x0'));var util=require(_0x9ab2('0x1'));var logger=require(_0x9ab2('0x2'))(_0x9ab2('0x3'));var moment=require('moment');var BPromise=require(_0x9ab2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ab2('0x5'));var rimraf=require(_0x9ab2('0x6'));var config=require(_0x9ab2('0x7'));var attributes=require(_0x9ab2('0x8'));module[_0x9ab2('0x9')]=function(_0x47cc4f,_0x3c3e85){return _0x47cc4f[_0x9ab2('0xa')](_0x9ab2('0xb'),attributes,{'tableName':_0x9ab2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1af3=['exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1af3,0x1ca));var _0x31af=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x1af3[_0x368e09];return _0x14b7df;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var rp=require(_0x31af('0x6'));var fs=require('fs');var path=require(_0x31af('0x7'));var rimraf=require(_0x31af('0x8'));var config=require(_0x31af('0x9'));var attributes=require('./jscriptyProject.attributes');module[_0x31af('0xa')]=function(_0x416162,_0x1ac3f6){return _0x416162[_0x31af('0xb')]('JscriptyProject',attributes,{'tableName':_0x31af('0xc'),'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 09d7202..0ab86b1 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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xdf5421,_0x2326c8){var _0x3519f7=function(_0x13348a){while(--_0x13348a){_0xdf5421['push'](_0xdf5421['shift']());}};_0x3519f7(++_0x2326c8);}(_0x54ef,0x112));var _0xf54e=function(_0x1d0b69,_0x300b72){_0x1d0b69=_0x1d0b69-0x0;var _0x5d09fd=_0x54ef[_0x1d0b69];return _0x5d09fd;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x1afd7d,_0x53cb05){var _0x46dade=function(_0x550f89){while(--_0x550f89){_0x1afd7d['push'](_0x1afd7d['shift']());}};_0x46dade(++_0x53cb05);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xcb91[_0x258b93];return _0x35484b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index cc8b8ff..310206b 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 _0xff1d=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x1e6783,_0x4d68d7){var _0x4fcd5f=function(_0x5c4607){while(--_0x5c4607){_0x1e6783['push'](_0x1e6783['shift']());}};_0x4fcd5f(++_0x4d68d7);}(_0xff1d,0x82));var _0xdff1=function(_0x43d369,_0x576b15){_0x43d369=_0x43d369-0x0;var _0x1a7ae3=_0xff1d[_0x43d369];return _0x1a7ae3;};'use strict';var multer=require(_0xdff1('0x0'));var util=require(_0xdff1('0x1'));var path=require(_0xdff1('0x2'));var timeout=require(_0xdff1('0x3'));var express=require(_0xdff1('0x4'));var router=express[_0xdff1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdff1('0x6'));var config=require(_0xdff1('0x7'));var controller=require(_0xdff1('0x8'));router[_0xdff1('0x9')]('/',auth[_0xdff1('0xa')](),controller[_0xdff1('0xb')]);router[_0xdff1('0x9')](_0xdff1('0xc'),auth[_0xdff1('0xa')](),controller[_0xdff1('0xd')]);router[_0xdff1('0x9')](_0xdff1('0xe'),auth[_0xdff1('0xa')](),controller[_0xdff1('0xf')]);router[_0xdff1('0x10')]('/',auth['isAuthenticated'](),controller[_0xdff1('0x11')]);router['put'](_0xdff1('0xe'),auth['isAuthenticated'](),controller[_0xdff1('0x12')]);router[_0xdff1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xdff1('0x14')]);module[_0xdff1('0x15')]=router; \ No newline at end of file +var _0x212b=['describe','/:id','show','post','create','update','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x212b,0xe7));var _0xb212=function(_0x239d72,_0x1b9283){_0x239d72=_0x239d72-0x0;var _0x47838e=_0x212b[_0x239d72];return _0x47838e;};'use strict';var multer=require(_0xb212('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb212('0x1'));var express=require(_0xb212('0x2'));var router=express['Router']();var fs_extra=require(_0xb212('0x3'));var auth=require(_0xb212('0x4'));var interaction=require(_0xb212('0x5'));var config=require('../../config/environment');var controller=require(_0xb212('0x6'));router[_0xb212('0x7')]('/',auth[_0xb212('0x8')](),controller['index']);router[_0xb212('0x7')]('/describe',auth[_0xb212('0x8')](),controller[_0xb212('0x9')]);router['get'](_0xb212('0xa'),auth[_0xb212('0x8')](),controller[_0xb212('0xb')]);router[_0xb212('0xc')]('/',auth[_0xb212('0x8')](),controller[_0xb212('0xd')]);router['put'](_0xb212('0xa'),auth[_0xb212('0x8')](),controller[_0xb212('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb212('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index a3c4d11..4041b41 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0xa811f1,_0xc9d204){_0xa811f1=_0xa811f1-0x0;var _0x1e9166=_0x7a54[_0xa811f1];return _0x1e9166;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x4016e5,_0x3d573e){_0x4016e5=_0x4016e5-0x0;var _0xae8aaf=_0x7a54[_0x4016e5];return _0xae8aaf;};'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 a056d03..c0f2a72 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 _0x87da=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3a641c,_0x194d6d){var _0x58e5d6=function(_0x210ad1){while(--_0x210ad1){_0x3a641c['push'](_0x3a641c['shift']());}};_0x58e5d6(++_0x194d6d);}(_0x87da,0x9c));var _0xa87d=function(_0x4ee916,_0x651dc){_0x4ee916=_0x4ee916-0x0;var _0x1766a8=_0x87da[_0x4ee916];return _0x1766a8;};'use strict';var emlformat=require(_0xa87d('0x0'));var rimraf=require(_0xa87d('0x1'));var zipdir=require(_0xa87d('0x2'));var jsonpatch=require(_0xa87d('0x3'));var rp=require(_0xa87d('0x4'));var moment=require(_0xa87d('0x5'));var BPromise=require(_0xa87d('0x6'));var Mustache=require(_0xa87d('0x7'));var util=require(_0xa87d('0x8'));var path=require(_0xa87d('0x9'));var sox=require(_0xa87d('0xa'));var csv=require('to-csv');var ejs=require(_0xa87d('0xb'));var fs=require('fs');var fs_extra=require(_0xa87d('0xc'));var _=require(_0xa87d('0xd'));var squel=require(_0xa87d('0xe'));var crypto=require(_0xa87d('0xf'));var jsforce=require(_0xa87d('0x10'));var deskjs=require(_0xa87d('0x11'));var toCsv=require(_0xa87d('0x12'));var querystring=require(_0xa87d('0x13'));var Papa=require(_0xa87d('0x14'));var Redis=require(_0xa87d('0x15'));var authService=require(_0xa87d('0x16'));var qs=require(_0xa87d('0x17'));var as=require(_0xa87d('0x18'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa87d('0x19'));var utils=require(_0xa87d('0x1a'));var config=require(_0xa87d('0x1b'));var licenseUtil=require(_0xa87d('0x1c'));var db=require(_0xa87d('0x1d'))['db'];function respondWithStatusCode(_0x5b1bd7,_0x5db0f8){_0x5db0f8=_0x5db0f8||0xcc;return function(_0x525da5){if(_0x525da5){return _0x5b1bd7['sendStatus'](_0x5db0f8);}return _0x5b1bd7[_0xa87d('0x1e')](_0x5db0f8)[_0xa87d('0x1f')]();};}function respondWithResult(_0x52af60,_0x2533a5){_0x2533a5=_0x2533a5||0xc8;return function(_0x35f8e5){if(_0x35f8e5){return _0x52af60[_0xa87d('0x1e')](_0x2533a5)[_0xa87d('0x20')](_0x35f8e5);}};}function respondWithFilteredResult(_0x538a7e,_0x438553){return function(_0x308ade){if(_0x308ade){var _0xc9d07d=typeof _0x438553[_0xa87d('0x21')]===_0xa87d('0x22')&&typeof _0x438553[_0xa87d('0x23')]===_0xa87d('0x22');var _0x13c935=_0x308ade['count'];var _0x32eb79=_0xc9d07d?0x0:_0x438553[_0xa87d('0x21')];var _0x1bcd28=_0xc9d07d?_0x308ade[_0xa87d('0x24')]:_0x438553['offset']+_0x438553['limit'];var _0x4247ea;if(_0x1bcd28>=_0x13c935){_0x1bcd28=_0x13c935;_0x4247ea=0xc8;}else{_0x4247ea=0xce;}_0x538a7e[_0xa87d('0x1e')](_0x4247ea);return _0x538a7e[_0xa87d('0x25')]('Content-Range',_0x32eb79+'-'+_0x1bcd28+'/'+_0x13c935)[_0xa87d('0x20')](_0x308ade);}return null;};}function patchUpdates(_0x3b1316){return function(_0x3ae92e){try{jsonpatch[_0xa87d('0x26')](_0x3ae92e,_0x3b1316,!![]);}catch(_0x325cd6){return BPromise[_0xa87d('0x27')](_0x325cd6);}return _0x3ae92e['save']();};}function saveUpdates(_0x396dac,_0x264467){return function(_0x883eba){if(_0x883eba){return _0x883eba[_0xa87d('0x28')](_0x396dac)[_0xa87d('0x29')](function(_0x66e0cf){return _0x66e0cf;});}return null;};}function removeEntity(_0xb4985,_0x523452){return function(_0x510f28){if(_0x510f28){return _0x510f28['destroy']()['then'](function(){_0xb4985[_0xa87d('0x1e')](0xcc)[_0xa87d('0x1f')]();});}};}function handleEntityNotFound(_0x4703e7,_0x1dc817){return function(_0x55213c){if(!_0x55213c){_0x4703e7[_0xa87d('0x2a')](0x194);}return _0x55213c;};}function handleError(_0x444c63,_0x41b5ce){_0x41b5ce=_0x41b5ce||0x1f4;return function(_0x201e46){logger['error'](_0x201e46[_0xa87d('0x2b')]);if(_0x201e46[_0xa87d('0x2c')]){delete _0x201e46[_0xa87d('0x2c')];}_0x444c63[_0xa87d('0x1e')](_0x41b5ce)[_0xa87d('0x2d')](_0x201e46);};}exports[_0xa87d('0x2e')]=function(_0x2e0f2b,_0x8e8a61){var _0x2ec22e={},_0x28b9fe={},_0x19911e={'count':0x0,'rows':[]};var _0x1fba78=_[_0xa87d('0x2f')](db[_0xa87d('0x30')][_0xa87d('0x31')],function(_0x3e867d){return{'name':_0x3e867d[_0xa87d('0x32')],'type':_0x3e867d[_0xa87d('0x33')][_0xa87d('0x34')]};});_0x28b9fe[_0xa87d('0x35')]=_['map'](_0x1fba78,_0xa87d('0x2c'));_0x28b9fe[_0xa87d('0x36')]=_['keys'](_0x2e0f2b[_0xa87d('0x36')]);_0x28b9fe['filters']=_['intersection'](_0x28b9fe['model'],_0x28b9fe[_0xa87d('0x36')]);_0x2ec22e[_0xa87d('0x37')]=_[_0xa87d('0x38')](_0x28b9fe['model'],qs['fields'](_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x39')]));_0x2ec22e[_0xa87d('0x37')]=_0x2ec22e[_0xa87d('0x37')][_0xa87d('0x3a')]?_0x2ec22e[_0xa87d('0x37')]:_0x28b9fe[_0xa87d('0x35')];if(!_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x3b')](_0xa87d('0x3c'))){_0x2ec22e[_0xa87d('0x23')]=qs[_0xa87d('0x23')](_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x23')]);_0x2ec22e['offset']=qs[_0xa87d('0x21')](_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x21')]);}_0x2ec22e[_0xa87d('0x3d')]=qs[_0xa87d('0x3e')](_0x2e0f2b[_0xa87d('0x36')]['sort']);_0x2ec22e[_0xa87d('0x3f')]=qs['filters'](_[_0xa87d('0x40')](_0x2e0f2b[_0xa87d('0x36')],_0x28b9fe['filters']),_0x1fba78);if(_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x41')]){_0x2ec22e[_0xa87d('0x3f')]=_[_0xa87d('0x42')](_0x2ec22e['where'],{'$or':_[_0xa87d('0x2f')](_0x1fba78,function(_0x36af14){if(_0x36af14[_0xa87d('0x33')]!==_0xa87d('0x43')){var _0x1ac716={};_0x1ac716[_0x36af14[_0xa87d('0x2c')]]={'$like':'%'+_0x2e0f2b[_0xa87d('0x36')]['filter']+'%'};return _0x1ac716;}})});}_0x2ec22e=_['merge']({},_0x2ec22e,_0x2e0f2b[_0xa87d('0x44')]);var _0x5e2e4e={'where':_0x2ec22e['where']};return db[_0xa87d('0x30')][_0xa87d('0x24')](_0x5e2e4e)[_0xa87d('0x29')](function(_0x17850e){_0x19911e[_0xa87d('0x24')]=_0x17850e;if(_0x2e0f2b[_0xa87d('0x36')][_0xa87d('0x45')]){_0x2ec22e[_0xa87d('0x46')]=[{'all':!![]}];}return db[_0xa87d('0x30')][_0xa87d('0x47')](_0x2ec22e);})[_0xa87d('0x29')](function(_0xafba3b){_0x19911e[_0xa87d('0x48')]=_0xafba3b;return _0x19911e;})[_0xa87d('0x29')](respondWithFilteredResult(_0x8e8a61,_0x2ec22e))[_0xa87d('0x49')](handleError(_0x8e8a61,null));};exports[_0xa87d('0x4a')]=function(_0x271310,_0x5c515d){var _0x19b42f={'raw':!![],'where':{'id':_0x271310[_0xa87d('0x4b')]['id']}},_0x1343b0={};_0x1343b0['model']=_[_0xa87d('0x4c')](db['JscriptyQuestionReport'][_0xa87d('0x31')]);_0x1343b0[_0xa87d('0x36')]=_['keys'](_0x271310[_0xa87d('0x36')]);_0x1343b0['filters']=_[_0xa87d('0x38')](_0x1343b0[_0xa87d('0x35')],_0x1343b0[_0xa87d('0x36')]);_0x19b42f[_0xa87d('0x37')]=_['intersection'](_0x1343b0['model'],qs['fields'](_0x271310[_0xa87d('0x36')][_0xa87d('0x39')]));_0x19b42f['attributes']=_0x19b42f['attributes'][_0xa87d('0x3a')]?_0x19b42f[_0xa87d('0x37')]:_0x1343b0[_0xa87d('0x35')];if(_0x271310['query'][_0xa87d('0x45')]){_0x19b42f['include']=[{'all':!![]}];}_0x19b42f=_[_0xa87d('0x42')]({},_0x19b42f,_0x271310['options']);return db[_0xa87d('0x30')][_0xa87d('0x4d')](_0x19b42f)[_0xa87d('0x29')](handleEntityNotFound(_0x5c515d,null))[_0xa87d('0x29')](respondWithResult(_0x5c515d,null))[_0xa87d('0x49')](handleError(_0x5c515d,null));};exports[_0xa87d('0x4e')]=function(_0x3d5ee3,_0x5764fe){return db['JscriptyQuestionReport']['create'](_0x3d5ee3[_0xa87d('0x4f')],{})[_0xa87d('0x29')](respondWithResult(_0x5764fe,0xc9))[_0xa87d('0x49')](handleError(_0x5764fe,null));};exports[_0xa87d('0x28')]=function(_0x1b81b1,_0x105dda){if(_0x1b81b1[_0xa87d('0x4f')]['id']){delete _0x1b81b1['body']['id'];}return db[_0xa87d('0x30')][_0xa87d('0x4d')]({'where':{'id':_0x1b81b1[_0xa87d('0x4b')]['id']}})[_0xa87d('0x29')](handleEntityNotFound(_0x105dda,null))[_0xa87d('0x29')](saveUpdates(_0x1b81b1[_0xa87d('0x4f')],null))[_0xa87d('0x29')](respondWithResult(_0x105dda,null))['catch'](handleError(_0x105dda,null));};exports['destroy']=function(_0x424097,_0x26351f){return db[_0xa87d('0x30')][_0xa87d('0x4d')]({'where':{'id':_0x424097[_0xa87d('0x4b')]['id']}})[_0xa87d('0x29')](handleEntityNotFound(_0x26351f,null))[_0xa87d('0x29')](removeEntity(_0x26351f,null))[_0xa87d('0x49')](handleError(_0x26351f,null));};exports['describe']=function(_0xada9c9,_0x29b2a4){return db[_0xa87d('0x30')]['describe']()['then'](respondWithResult(_0x29b2a4,null))['catch'](handleError(_0x29b2a4,null));}; \ No newline at end of file +var _0xa742=['find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','reject','save','update','destroy','then','stack','name','map','fieldName','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyQuestionReport','findAll','rows','keys','intersection','includeAll','include','options'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0xa742,0x126));var _0x2a74=function(_0x38b637,_0x42cb70){_0x38b637=_0x38b637-0x0;var _0xc1c2cf=_0xa742[_0x38b637];return _0xc1c2cf;};'use strict';var emlformat=require(_0x2a74('0x0'));var rimraf=require(_0x2a74('0x1'));var zipdir=require(_0x2a74('0x2'));var jsonpatch=require(_0x2a74('0x3'));var rp=require(_0x2a74('0x4'));var moment=require(_0x2a74('0x5'));var BPromise=require(_0x2a74('0x6'));var Mustache=require(_0x2a74('0x7'));var util=require('util');var path=require(_0x2a74('0x8'));var sox=require(_0x2a74('0x9'));var csv=require(_0x2a74('0xa'));var ejs=require(_0x2a74('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a74('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2a74('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2a74('0xe'));var Papa=require(_0x2a74('0xf'));var Redis=require(_0x2a74('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2a74('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a74('0x12'));var logger=require(_0x2a74('0x13'))(_0x2a74('0x14'));var utils=require(_0x2a74('0x15'));var config=require(_0x2a74('0x16'));var licenseUtil=require(_0x2a74('0x17'));var db=require(_0x2a74('0x18'))['db'];function respondWithStatusCode(_0x3cc445,_0x4e6a3e){_0x4e6a3e=_0x4e6a3e||0xcc;return function(_0xe5304e){if(_0xe5304e){return _0x3cc445[_0x2a74('0x19')](_0x4e6a3e);}return _0x3cc445['status'](_0x4e6a3e)[_0x2a74('0x1a')]();};}function respondWithResult(_0x1ea8dc,_0x36aad3){_0x36aad3=_0x36aad3||0xc8;return function(_0xbaef19){if(_0xbaef19){return _0x1ea8dc['status'](_0x36aad3)['json'](_0xbaef19);}};}function respondWithFilteredResult(_0x2d2f8b,_0x2ff669){return function(_0x11842d){if(_0x11842d){var _0x1a8af0=typeof _0x2ff669[_0x2a74('0x1b')]===_0x2a74('0x1c')&&typeof _0x2ff669['limit']===_0x2a74('0x1c');var _0x283a7d=_0x11842d[_0x2a74('0x1d')];var _0x12db6e=_0x1a8af0?0x0:_0x2ff669[_0x2a74('0x1b')];var _0x36fa6f=_0x1a8af0?_0x11842d[_0x2a74('0x1d')]:_0x2ff669['offset']+_0x2ff669[_0x2a74('0x1e')];var _0x428c5d;if(_0x36fa6f>=_0x283a7d){_0x36fa6f=_0x283a7d;_0x428c5d=0xc8;}else{_0x428c5d=0xce;}_0x2d2f8b[_0x2a74('0x1f')](_0x428c5d);return _0x2d2f8b[_0x2a74('0x20')](_0x2a74('0x21'),_0x12db6e+'-'+_0x36fa6f+'/'+_0x283a7d)[_0x2a74('0x22')](_0x11842d);}return null;};}function patchUpdates(_0xdce729){return function(_0x2bdf12){try{jsonpatch['apply'](_0x2bdf12,_0xdce729,!![]);}catch(_0xb00c0a){return BPromise[_0x2a74('0x23')](_0xb00c0a);}return _0x2bdf12[_0x2a74('0x24')]();};}function saveUpdates(_0x5466ca,_0x9c2aae){return function(_0x489532){if(_0x489532){return _0x489532[_0x2a74('0x25')](_0x5466ca)['then'](function(_0x25cf7a){return _0x25cf7a;});}return null;};}function removeEntity(_0x5c8620,_0x24db81){return function(_0x3a6ab0){if(_0x3a6ab0){return _0x3a6ab0[_0x2a74('0x26')]()[_0x2a74('0x27')](function(){_0x5c8620['status'](0xcc)[_0x2a74('0x1a')]();});}};}function handleEntityNotFound(_0x4bef5c,_0x5327af){return function(_0x2158e0){if(!_0x2158e0){_0x4bef5c[_0x2a74('0x19')](0x194);}return _0x2158e0;};}function handleError(_0x8fea15,_0x48b432){_0x48b432=_0x48b432||0x1f4;return function(_0x565925){logger['error'](_0x565925[_0x2a74('0x28')]);if(_0x565925[_0x2a74('0x29')]){delete _0x565925[_0x2a74('0x29')];}_0x8fea15['status'](_0x48b432)['send'](_0x565925);};}exports['index']=function(_0x34bd08,_0x3e28bf){var _0x140759={},_0x214d48={},_0x4b3f01={'count':0x0,'rows':[]};var _0x2b0c1b=_[_0x2a74('0x2a')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x58df94){return{'name':_0x58df94[_0x2a74('0x2b')],'type':_0x58df94['type']['key']};});_0x214d48[_0x2a74('0x2c')]=_['map'](_0x2b0c1b,_0x2a74('0x29'));_0x214d48[_0x2a74('0x2d')]=_['keys'](_0x34bd08[_0x2a74('0x2d')]);_0x214d48[_0x2a74('0x2e')]=_['intersection'](_0x214d48['model'],_0x214d48['query']);_0x140759[_0x2a74('0x2f')]=_['intersection'](_0x214d48[_0x2a74('0x2c')],qs[_0x2a74('0x30')](_0x34bd08[_0x2a74('0x2d')][_0x2a74('0x30')]));_0x140759[_0x2a74('0x2f')]=_0x140759['attributes'][_0x2a74('0x31')]?_0x140759[_0x2a74('0x2f')]:_0x214d48[_0x2a74('0x2c')];if(!_0x34bd08[_0x2a74('0x2d')]['hasOwnProperty'](_0x2a74('0x32'))){_0x140759['limit']=qs['limit'](_0x34bd08[_0x2a74('0x2d')][_0x2a74('0x1e')]);_0x140759[_0x2a74('0x1b')]=qs[_0x2a74('0x1b')](_0x34bd08[_0x2a74('0x2d')][_0x2a74('0x1b')]);}_0x140759[_0x2a74('0x33')]=qs[_0x2a74('0x34')](_0x34bd08[_0x2a74('0x2d')][_0x2a74('0x34')]);_0x140759[_0x2a74('0x35')]=qs[_0x2a74('0x2e')](_[_0x2a74('0x36')](_0x34bd08[_0x2a74('0x2d')],_0x214d48['filters']),_0x2b0c1b);if(_0x34bd08[_0x2a74('0x2d')][_0x2a74('0x37')]){_0x140759[_0x2a74('0x35')]=_[_0x2a74('0x38')](_0x140759[_0x2a74('0x35')],{'$or':_[_0x2a74('0x2a')](_0x2b0c1b,function(_0x51213c){if(_0x51213c['type']!==_0x2a74('0x39')){var _0x3d3b09={};_0x3d3b09[_0x51213c[_0x2a74('0x29')]]={'$like':'%'+_0x34bd08['query'][_0x2a74('0x37')]+'%'};return _0x3d3b09;}})});}_0x140759=_[_0x2a74('0x38')]({},_0x140759,_0x34bd08['options']);var _0x292586={'where':_0x140759['where']};return db['JscriptyQuestionReport'][_0x2a74('0x1d')](_0x292586)[_0x2a74('0x27')](function(_0x2f2c79){_0x4b3f01[_0x2a74('0x1d')]=_0x2f2c79;if(_0x34bd08[_0x2a74('0x2d')]['includeAll']){_0x140759['include']=[{'all':!![]}];}return db[_0x2a74('0x3a')][_0x2a74('0x3b')](_0x140759);})[_0x2a74('0x27')](function(_0x1b19c9){_0x4b3f01[_0x2a74('0x3c')]=_0x1b19c9;return _0x4b3f01;})[_0x2a74('0x27')](respondWithFilteredResult(_0x3e28bf,_0x140759))['catch'](handleError(_0x3e28bf,null));};exports['show']=function(_0x25ac82,_0x81eda0){var _0x11589d={'raw':!![],'where':{'id':_0x25ac82['params']['id']}},_0x5d0fdc={};_0x5d0fdc['model']=_[_0x2a74('0x3d')](db[_0x2a74('0x3a')]['rawAttributes']);_0x5d0fdc[_0x2a74('0x2d')]=_['keys'](_0x25ac82[_0x2a74('0x2d')]);_0x5d0fdc['filters']=_[_0x2a74('0x3e')](_0x5d0fdc[_0x2a74('0x2c')],_0x5d0fdc[_0x2a74('0x2d')]);_0x11589d[_0x2a74('0x2f')]=_[_0x2a74('0x3e')](_0x5d0fdc[_0x2a74('0x2c')],qs['fields'](_0x25ac82['query'][_0x2a74('0x30')]));_0x11589d[_0x2a74('0x2f')]=_0x11589d[_0x2a74('0x2f')][_0x2a74('0x31')]?_0x11589d[_0x2a74('0x2f')]:_0x5d0fdc[_0x2a74('0x2c')];if(_0x25ac82[_0x2a74('0x2d')][_0x2a74('0x3f')]){_0x11589d[_0x2a74('0x40')]=[{'all':!![]}];}_0x11589d=_['merge']({},_0x11589d,_0x25ac82[_0x2a74('0x41')]);return db['JscriptyQuestionReport'][_0x2a74('0x42')](_0x11589d)['then'](handleEntityNotFound(_0x81eda0,null))[_0x2a74('0x27')](respondWithResult(_0x81eda0,null))[_0x2a74('0x43')](handleError(_0x81eda0,null));};exports[_0x2a74('0x44')]=function(_0x15a4b7,_0x49109e){return db['JscriptyQuestionReport']['create'](_0x15a4b7['body'],{})[_0x2a74('0x27')](respondWithResult(_0x49109e,0xc9))['catch'](handleError(_0x49109e,null));};exports[_0x2a74('0x25')]=function(_0x43bc74,_0x49a1e1){if(_0x43bc74[_0x2a74('0x45')]['id']){delete _0x43bc74[_0x2a74('0x45')]['id'];}return db['JscriptyQuestionReport'][_0x2a74('0x42')]({'where':{'id':_0x43bc74['params']['id']}})[_0x2a74('0x27')](handleEntityNotFound(_0x49a1e1,null))['then'](saveUpdates(_0x43bc74[_0x2a74('0x45')],null))[_0x2a74('0x27')](respondWithResult(_0x49a1e1,null))[_0x2a74('0x43')](handleError(_0x49a1e1,null));};exports[_0x2a74('0x26')]=function(_0x5ddafe,_0x584031){return db[_0x2a74('0x3a')][_0x2a74('0x42')]({'where':{'id':_0x5ddafe[_0x2a74('0x46')]['id']}})['then'](handleEntityNotFound(_0x584031,null))['then'](removeEntity(_0x584031,null))['catch'](handleError(_0x584031,null));};exports['describe']=function(_0x31a239,_0x1b8ba1){return db[_0x2a74('0x3a')][_0x2a74('0x47')]()[_0x2a74('0x27')](respondWithResult(_0x1b8ba1,null))['catch'](handleError(_0x1b8ba1,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cdeefd2..8ce5b9b 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 _0xbd08=['JscriptyQuestionReport','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2e3db1,_0x4b2552){var _0x179c98=function(_0x5606bb){while(--_0x5606bb){_0x2e3db1['push'](_0x2e3db1['shift']());}};_0x179c98(++_0x4b2552);}(_0xbd08,0x7f));var _0x8bd0=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbd08[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x8bd0('0x0'));var logger=require('../../config/logger')(_0x8bd0('0x1'));var moment=require(_0x8bd0('0x2'));var BPromise=require(_0x8bd0('0x3'));var rp=require(_0x8bd0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bd0('0x5'));var config=require(_0x8bd0('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x8bd0('0x7')]=function(_0x4d3aff,_0x511cc9){return _0x4d3aff['define'](_0x8bd0('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b1c=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','path','rimraf','./jscriptyQuestionReport.attributes'];(function(_0x4561fa,_0x4c770b){var _0x52df1b=function(_0x5f1dbb){while(--_0x5f1dbb){_0x4561fa['push'](_0x4561fa['shift']());}};_0x52df1b(++_0x4c770b);}(_0x1b1c,0x101));var _0xc1b1=function(_0x352b44,_0x4a91a1){_0x352b44=_0x352b44-0x0;var _0x3e8baa=_0x1b1c[_0x352b44];return _0x3e8baa;};'use strict';var _=require(_0xc1b1('0x0'));var util=require(_0xc1b1('0x1'));var logger=require(_0xc1b1('0x2'))(_0xc1b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1b1('0x4'));var rimraf=require(_0xc1b1('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1b1('0x6'));module[_0xc1b1('0x7')]=function(_0x159166,_0x28e51c){return _0x159166[_0xc1b1('0x8')](_0xc1b1('0x9'),attributes,{'tableName':_0xc1b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 436e545..4c1f8b9 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 _0x0365=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','JscriptyQuestionReport,\x20%s,\x20%s','error','code','message'];(function(_0x4b287d,_0x2ea048){var _0x563b27=function(_0x9e9396){while(--_0x9e9396){_0x4b287d['push'](_0x4b287d['shift']());}};_0x563b27(++_0x2ea048);}(_0x0365,0x132));var _0x5036=function(_0x32ee51,_0x26d577){_0x32ee51=_0x32ee51-0x0;var _0x57d860=_0x0365[_0x32ee51];return _0x57d860;};'use strict';var _=require(_0x5036('0x0'));var util=require(_0x5036('0x1'));var moment=require(_0x5036('0x2'));var BPromise=require(_0x5036('0x3'));var rs=require(_0x5036('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5036('0x5'))['db'];var utils=require(_0x5036('0x6'));var logger=require(_0x5036('0x7'))(_0x5036('0x8'));var config=require(_0x5036('0x9'));var jayson=require(_0x5036('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x548f68,_0x4c6bba,_0x3f916a){return new BPromise(function(_0x254b94,_0xa37784){return client['request'](_0x548f68,_0x3f916a)[_0x5036('0xb')](function(_0x433d9a){logger[_0x5036('0xc')](_0x5036('0xd'),_0x4c6bba,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4c6bba,'request\x20sent',JSON['stringify'](_0x433d9a));if(_0x433d9a['error']){if(_0x433d9a[_0x5036('0xe')][_0x5036('0xf')]===0x1f4){logger['error'](_0x5036('0xd'),_0x4c6bba,_0x433d9a['error'][_0x5036('0x10')]);return _0xa37784(_0x433d9a[_0x5036('0xe')][_0x5036('0x10')]);}logger[_0x5036('0xe')](_0x5036('0xd'),_0x4c6bba,_0x433d9a[_0x5036('0xe')][_0x5036('0x10')]);return _0x254b94(_0x433d9a[_0x5036('0xe')][_0x5036('0x10')]);}else{logger[_0x5036('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c6bba,_0x5036('0x11'));_0x254b94(_0x433d9a['result'][_0x5036('0x10')]);}})[_0x5036('0x12')](function(_0x40cf9a){logger['error'](_0x5036('0xd'),_0x4c6bba,_0x40cf9a);_0xa37784(_0x40cf9a);});});} \ No newline at end of file +var _0xacf4=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x9a7d08,_0xe9048){var _0x58e6e8=function(_0x31f047){while(--_0x31f047){_0x9a7d08['push'](_0x9a7d08['shift']());}};_0x58e6e8(++_0xe9048);}(_0xacf4,0x1a7));var _0x4acf=function(_0x251559,_0x5114a6){_0x251559=_0x251559-0x0;var _0x5d5035=_0xacf4[_0x251559];return _0x5d5035;};'use strict';var _=require(_0x4acf('0x0'));var util=require('util');var moment=require(_0x4acf('0x1'));var BPromise=require(_0x4acf('0x2'));var rs=require(_0x4acf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4acf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4acf('0x5'))('rpc');var config=require(_0x4acf('0x6'));var jayson=require(_0x4acf('0x7'));var client=jayson['client'][_0x4acf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x373495,_0x2737ff,_0x5ccede){return new BPromise(function(_0x566e35,_0x5c4680){return client[_0x4acf('0x9')](_0x373495,_0x5ccede)[_0x4acf('0xa')](function(_0x39ee7f){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x2737ff,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x2737ff,_0x4acf('0xd'),JSON[_0x4acf('0xf')](_0x39ee7f));if(_0x39ee7f['error']){if(_0x39ee7f[_0x4acf('0x10')]['code']===0x1f4){logger[_0x4acf('0x10')](_0x4acf('0xc'),_0x2737ff,_0x39ee7f[_0x4acf('0x10')][_0x4acf('0x11')]);return _0x5c4680(_0x39ee7f[_0x4acf('0x10')][_0x4acf('0x11')]);}logger[_0x4acf('0x10')](_0x4acf('0xc'),_0x2737ff,_0x39ee7f[_0x4acf('0x10')][_0x4acf('0x11')]);return _0x566e35(_0x39ee7f[_0x4acf('0x10')]['message']);}else{logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x2737ff,'request\x20sent');_0x566e35(_0x39ee7f[_0x4acf('0x12')]['message']);}})[_0x4acf('0x13')](function(_0x4efe58){logger[_0x4acf('0x10')](_0x4acf('0xc'),_0x2737ff,_0x4efe58);_0x5c4680(_0x4efe58);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 52d532e..7798f31 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 _0x851d=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','/:id/questions','getQuestions'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x851d,0x192));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd851('0x0'));var util=require(_0xd851('0x1'));var path=require(_0xd851('0x2'));var timeout=require(_0xd851('0x3'));var express=require(_0xd851('0x4'));var router=express[_0xd851('0x5')]();var fs_extra=require(_0xd851('0x6'));var auth=require(_0xd851('0x7'));var interaction=require(_0xd851('0x8'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xd851('0x9')](),controller['index']);router[_0xd851('0xa')](_0xd851('0xb'),auth[_0xd851('0x9')](),controller[_0xd851('0xc')]);router[_0xd851('0xa')](_0xd851('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd851('0xa')](_0xd851('0xe'),auth[_0xd851('0x9')](),controller[_0xd851('0xf')]);router[_0xd851('0x10')]('/',auth[_0xd851('0x9')](),controller[_0xd851('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd851('0x12')]);router[_0xd851('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd851('0x14')]);module[_0xd851('0x15')]=router; \ No newline at end of file +var _0x5b5b=['post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x5a52c3,_0x1ed9b7){var _0x13a8ae=function(_0x437172){while(--_0x437172){_0x5a52c3['push'](_0x5a52c3['shift']());}};_0x13a8ae(++_0x1ed9b7);}(_0x5b5b,0x1d5));var _0xb5b5=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x5b5b[_0x2a4095];return _0x52eeab;};'use strict';var multer=require(_0xb5b5('0x0'));var util=require(_0xb5b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5b5('0x2')]();var fs_extra=require(_0xb5b5('0x3'));var auth=require(_0xb5b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb5b5('0x5'));var controller=require(_0xb5b5('0x6'));router[_0xb5b5('0x7')]('/',auth[_0xb5b5('0x8')](),controller[_0xb5b5('0x9')]);router[_0xb5b5('0x7')]('/describe',auth[_0xb5b5('0x8')](),controller[_0xb5b5('0xa')]);router[_0xb5b5('0x7')](_0xb5b5('0xb'),auth[_0xb5b5('0x8')](),controller[_0xb5b5('0xc')]);router[_0xb5b5('0x7')](_0xb5b5('0xd'),auth[_0xb5b5('0x8')](),controller[_0xb5b5('0xe')]);router[_0xb5b5('0xf')]('/',auth[_0xb5b5('0x8')](),controller[_0xb5b5('0x10')]);router[_0xb5b5('0x11')](_0xb5b5('0xb'),auth[_0xb5b5('0x8')](),controller[_0xb5b5('0x12')]);router[_0xb5b5('0x13')]('/:id',auth[_0xb5b5('0x8')](),controller[_0xb5b5('0x14')]);module[_0xb5b5('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 8eab982..c82513d 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 _0x3f72=['starttime','setDataValue','endtime','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x3594d0,_0x532402){var _0x4bb821=function(_0x12a64e){while(--_0x12a64e){_0x3594d0['push'](_0x3594d0['shift']());}};_0x4bb821(++_0x532402);}(_0x3f72,0xbd));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require('moment');var Sequelize=require(_0x23f7('0x0'));module[_0x23f7('0x1')]={'starttime':{'type':Sequelize[_0x23f7('0x2')],'set':function(_0xbfda5d){this['setDataValue'](_0x23f7('0x3'),_0xbfda5d);this[_0x23f7('0x4')](_0x23f7('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x23f7('0x2')]},'membername':{'type':Sequelize[_0x23f7('0x6')]},'projectname':{'type':Sequelize[_0x23f7('0x6')]},'queue':{'type':Sequelize[_0x23f7('0x6')]},'uniqueid':{'type':Sequelize[_0x23f7('0x6')]},'calleridname':{'type':Sequelize[_0x23f7('0x6')]},'calleridnum':{'type':Sequelize[_0x23f7('0x6')]},'completed':{'type':Sequelize[_0x23f7('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xd20c=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','setDataValue','starttime','endtime'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0xd20c,0x16b));var _0xcd20=function(_0x1fba81,_0x301dda){_0x1fba81=_0x1fba81-0x0;var _0x108093=_0xd20c[_0x1fba81];return _0x108093;};'use strict';var moment=require(_0xcd20('0x0'));var Sequelize=require(_0xcd20('0x1'));module[_0xcd20('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x336f02){this[_0xcd20('0x3')](_0xcd20('0x4'),_0x336f02);this['setDataValue'](_0xcd20('0x5'),moment()[_0xcd20('0x6')](_0xcd20('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xcd20('0x8')]},'projectname':{'type':Sequelize[_0xcd20('0x8')]},'queue':{'type':Sequelize[_0xcd20('0x8')]},'uniqueid':{'type':Sequelize[_0xcd20('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcd20('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 7cc752f..5aa41c0 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 _0xfbeb=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','update','then','error','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','create','body','find','catch','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','eml-format'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0xfbeb,0x194));var _0xbfbe=function(_0x38c202,_0x299906){_0x38c202=_0x38c202-0x0;var _0xb66482=_0xfbeb[_0x38c202];return _0xb66482;};'use strict';var emlformat=require(_0xbfbe('0x0'));var rimraf=require(_0xbfbe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfbe('0x2'));var rp=require('request-promise');var moment=require(_0xbfbe('0x3'));var BPromise=require(_0xbfbe('0x4'));var Mustache=require(_0xbfbe('0x5'));var util=require(_0xbfbe('0x6'));var path=require(_0xbfbe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfbe('0x8'));var fs=require('fs');var fs_extra=require(_0xbfbe('0x9'));var _=require(_0xbfbe('0xa'));var squel=require(_0xbfbe('0xb'));var crypto=require(_0xbfbe('0xc'));var jsforce=require(_0xbfbe('0xd'));var deskjs=require(_0xbfbe('0xe'));var toCsv=require(_0xbfbe('0xf'));var querystring=require(_0xbfbe('0x10'));var Papa=require(_0xbfbe('0x11'));var Redis=require('ioredis');var authService=require(_0xbfbe('0x12'));var qs=require(_0xbfbe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfbe('0x14'));var logger=require(_0xbfbe('0x15'))(_0xbfbe('0x16'));var utils=require(_0xbfbe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbfbe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c4204,_0x5be7cf){_0x5be7cf=_0x5be7cf||0xcc;return function(_0x79d828){if(_0x79d828){return _0x2c4204[_0xbfbe('0x19')](_0x5be7cf);}return _0x2c4204['status'](_0x5be7cf)['end']();};}function respondWithResult(_0x1fcee2,_0x26634e){_0x26634e=_0x26634e||0xc8;return function(_0x436f55){if(_0x436f55){return _0x1fcee2[_0xbfbe('0x1a')](_0x26634e)[_0xbfbe('0x1b')](_0x436f55);}};}function respondWithFilteredResult(_0x1ac839,_0x58f711){return function(_0x3ee9ec){if(_0x3ee9ec){var _0x55297e=typeof _0x58f711['offset']===_0xbfbe('0x1c')&&typeof _0x58f711['limit']===_0xbfbe('0x1c');var _0x199086=_0x3ee9ec['count'];var _0x400447=_0x55297e?0x0:_0x58f711['offset'];var _0x382bb8=_0x55297e?_0x3ee9ec[_0xbfbe('0x1d')]:_0x58f711['offset']+_0x58f711[_0xbfbe('0x1e')];var _0x3a4762;if(_0x382bb8>=_0x199086){_0x382bb8=_0x199086;_0x3a4762=0xc8;}else{_0x3a4762=0xce;}_0x1ac839['status'](_0x3a4762);return _0x1ac839[_0xbfbe('0x1f')](_0xbfbe('0x20'),_0x400447+'-'+_0x382bb8+'/'+_0x199086)[_0xbfbe('0x1b')](_0x3ee9ec);}return null;};}function patchUpdates(_0x51aff1){return function(_0x478c77){try{jsonpatch[_0xbfbe('0x21')](_0x478c77,_0x51aff1,!![]);}catch(_0xea1606){return BPromise['reject'](_0xea1606);}return _0x478c77['save']();};}function saveUpdates(_0x3d4584,_0x347053){return function(_0x3b30fe){if(_0x3b30fe){return _0x3b30fe[_0xbfbe('0x22')](_0x3d4584)[_0xbfbe('0x23')](function(_0x46de25){return _0x46de25;});}return null;};}function removeEntity(_0x1bf875,_0x1cd0bb){return function(_0x55bed9){if(_0x55bed9){return _0x55bed9['destroy']()[_0xbfbe('0x23')](function(){_0x1bf875['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a7428,_0x51b53b){return function(_0x2b8b0a){if(!_0x2b8b0a){_0x1a7428['sendStatus'](0x194);}return _0x2b8b0a;};}function handleError(_0x152077,_0x4bbe49){_0x4bbe49=_0x4bbe49||0x1f4;return function(_0x5bad49){logger[_0xbfbe('0x24')](_0x5bad49['stack']);if(_0x5bad49[_0xbfbe('0x25')]){delete _0x5bad49[_0xbfbe('0x25')];}_0x152077[_0xbfbe('0x1a')](_0x4bbe49)[_0xbfbe('0x26')](_0x5bad49);};}exports[_0xbfbe('0x27')]=function(_0x4fd20d,_0x56a0b4){var _0x3c095d={},_0x528074={},_0x555dc3={'count':0x0,'rows':[]};var _0x761e7d=_['map'](db[_0xbfbe('0x28')][_0xbfbe('0x29')],function(_0x3b4861){return{'name':_0x3b4861[_0xbfbe('0x2a')],'type':_0x3b4861[_0xbfbe('0x2b')][_0xbfbe('0x2c')]};});_0x528074[_0xbfbe('0x2d')]=_[_0xbfbe('0x2e')](_0x761e7d,_0xbfbe('0x25'));_0x528074['query']=_[_0xbfbe('0x2f')](_0x4fd20d[_0xbfbe('0x30')]);_0x528074[_0xbfbe('0x31')]=_['intersection'](_0x528074[_0xbfbe('0x2d')],_0x528074[_0xbfbe('0x30')]);_0x3c095d[_0xbfbe('0x32')]=_[_0xbfbe('0x33')](_0x528074[_0xbfbe('0x2d')],qs[_0xbfbe('0x34')](_0x4fd20d['query']['fields']));_0x3c095d['attributes']=_0x3c095d[_0xbfbe('0x32')]['length']?_0x3c095d[_0xbfbe('0x32')]:_0x528074['model'];if(!_0x4fd20d[_0xbfbe('0x30')][_0xbfbe('0x35')](_0xbfbe('0x36'))){_0x3c095d[_0xbfbe('0x1e')]=qs['limit'](_0x4fd20d[_0xbfbe('0x30')][_0xbfbe('0x1e')]);_0x3c095d['offset']=qs['offset'](_0x4fd20d[_0xbfbe('0x30')][_0xbfbe('0x37')]);}_0x3c095d['order']=qs[_0xbfbe('0x38')](_0x4fd20d[_0xbfbe('0x30')][_0xbfbe('0x38')]);_0x3c095d[_0xbfbe('0x39')]=qs['filters'](_['pick'](_0x4fd20d[_0xbfbe('0x30')],_0x528074[_0xbfbe('0x31')]),_0x761e7d);if(_0x4fd20d[_0xbfbe('0x30')][_0xbfbe('0x3a')]){_0x3c095d['where']=_['merge'](_0x3c095d[_0xbfbe('0x39')],{'$or':_['map'](_0x761e7d,function(_0x217ca2){if(_0x217ca2['type']!==_0xbfbe('0x3b')){var _0x241b37={};_0x241b37[_0x217ca2[_0xbfbe('0x25')]]={'$like':'%'+_0x4fd20d['query'][_0xbfbe('0x3a')]+'%'};return _0x241b37;}})});}_0x3c095d=_[_0xbfbe('0x3c')]({},_0x3c095d,_0x4fd20d[_0xbfbe('0x3d')]);var _0x4a1095={'where':_0x3c095d[_0xbfbe('0x39')]};return db[_0xbfbe('0x28')][_0xbfbe('0x1d')](_0x4a1095)[_0xbfbe('0x23')](function(_0x1946e4){_0x555dc3['count']=_0x1946e4;if(_0x4fd20d['query'][_0xbfbe('0x3e')]){_0x3c095d['include']=[{'all':!![]}];}return db[_0xbfbe('0x28')][_0xbfbe('0x3f')](_0x3c095d);})[_0xbfbe('0x23')](function(_0x72ff){_0x555dc3[_0xbfbe('0x40')]=_0x72ff;return _0x555dc3;})['then'](respondWithFilteredResult(_0x56a0b4,_0x3c095d))['catch'](handleError(_0x56a0b4,null));};exports[_0xbfbe('0x41')]=function(_0x879ab8,_0x96c7e0){var _0x2bcb50={'raw':!![],'where':{'id':_0x879ab8[_0xbfbe('0x42')]['id']}},_0x147bfa={};_0x147bfa[_0xbfbe('0x2d')]=_[_0xbfbe('0x2f')](db[_0xbfbe('0x28')][_0xbfbe('0x29')]);_0x147bfa[_0xbfbe('0x30')]=_[_0xbfbe('0x2f')](_0x879ab8['query']);_0x147bfa[_0xbfbe('0x31')]=_[_0xbfbe('0x33')](_0x147bfa[_0xbfbe('0x2d')],_0x147bfa[_0xbfbe('0x30')]);_0x2bcb50[_0xbfbe('0x32')]=_[_0xbfbe('0x33')](_0x147bfa[_0xbfbe('0x2d')],qs[_0xbfbe('0x34')](_0x879ab8['query'][_0xbfbe('0x34')]));_0x2bcb50['attributes']=_0x2bcb50[_0xbfbe('0x32')][_0xbfbe('0x43')]?_0x2bcb50['attributes']:_0x147bfa[_0xbfbe('0x2d')];if(_0x879ab8[_0xbfbe('0x30')][_0xbfbe('0x3e')]){_0x2bcb50[_0xbfbe('0x44')]=[{'all':!![]}];}_0x2bcb50=_['merge']({},_0x2bcb50,_0x879ab8['options']);return db[_0xbfbe('0x28')]['find'](_0x2bcb50)[_0xbfbe('0x23')](handleEntityNotFound(_0x96c7e0,null))['then'](respondWithResult(_0x96c7e0,null))['catch'](handleError(_0x96c7e0,null));};exports[_0xbfbe('0x45')]=function(_0x1321a0,_0x4a547e){return db[_0xbfbe('0x28')][_0xbfbe('0x45')](_0x1321a0[_0xbfbe('0x46')],{})[_0xbfbe('0x23')](respondWithResult(_0x4a547e,0xc9))['catch'](handleError(_0x4a547e,null));};exports['update']=function(_0x1fa2e0,_0x1ae75a){if(_0x1fa2e0[_0xbfbe('0x46')]['id']){delete _0x1fa2e0[_0xbfbe('0x46')]['id'];}return db['JscriptySessionReport'][_0xbfbe('0x47')]({'where':{'id':_0x1fa2e0['params']['id']}})[_0xbfbe('0x23')](handleEntityNotFound(_0x1ae75a,null))[_0xbfbe('0x23')](saveUpdates(_0x1fa2e0[_0xbfbe('0x46')],null))[_0xbfbe('0x23')](respondWithResult(_0x1ae75a,null))[_0xbfbe('0x48')](handleError(_0x1ae75a,null));};exports[_0xbfbe('0x49')]=function(_0x4e1c41,_0x2a2ccc){return db[_0xbfbe('0x28')][_0xbfbe('0x47')]({'where':{'id':_0x4e1c41['params']['id']}})[_0xbfbe('0x23')](handleEntityNotFound(_0x2a2ccc,null))[_0xbfbe('0x23')](removeEntity(_0x2a2ccc,null))[_0xbfbe('0x48')](handleError(_0x2a2ccc,null));};exports[_0xbfbe('0x4a')]=function(_0x222b66,_0x15d6b6){return db[_0xbfbe('0x28')][_0xbfbe('0x4a')]()[_0xbfbe('0x23')](respondWithResult(_0x15d6b6,null))[_0xbfbe('0x48')](handleError(_0x15d6b6,null));};exports[_0xbfbe('0x4b')]=function(_0x14cb01,_0xb86250,_0x4a1a86){var _0x420c6b={'raw':!![],'where':{}};var _0x5eb6af={};var _0x3f3aa2={'count':0x0,'rows':[]};return db[_0xbfbe('0x28')][_0xbfbe('0x4c')]({'where':{'id':_0x14cb01[_0xbfbe('0x42')]['id']}})[_0xbfbe('0x23')](handleEntityNotFound(_0xb86250,null))[_0xbfbe('0x23')](function(_0x282bbe){if(_0x282bbe){_0x5eb6af['model']=_[_0xbfbe('0x2f')](db[_0xbfbe('0x4d')][_0xbfbe('0x29')]);_0x5eb6af['query']=_['keys'](_0x14cb01[_0xbfbe('0x30')]);_0x5eb6af[_0xbfbe('0x31')]=_[_0xbfbe('0x33')](_0x5eb6af['model'],_0x5eb6af[_0xbfbe('0x30')]);_0x420c6b[_0xbfbe('0x32')]=_[_0xbfbe('0x33')](_0x5eb6af[_0xbfbe('0x2d')],qs[_0xbfbe('0x34')](_0x14cb01['query'][_0xbfbe('0x34')]));_0x420c6b[_0xbfbe('0x32')]=_0x420c6b[_0xbfbe('0x32')][_0xbfbe('0x43')]?_0x420c6b[_0xbfbe('0x32')]:_0x5eb6af[_0xbfbe('0x2d')];if(!_0x14cb01[_0xbfbe('0x30')][_0xbfbe('0x35')]('nolimit')){_0x420c6b['limit']=qs['limit'](_0x14cb01[_0xbfbe('0x30')][_0xbfbe('0x1e')]);_0x420c6b['offset']=qs[_0xbfbe('0x37')](_0x14cb01['query'][_0xbfbe('0x37')]);}_0x420c6b[_0xbfbe('0x4e')]=qs[_0xbfbe('0x38')](_0x14cb01['query'][_0xbfbe('0x38')]);_0x420c6b['where']=qs['filters'](_[_0xbfbe('0x4f')](_0x14cb01[_0xbfbe('0x30')],_0x5eb6af[_0xbfbe('0x31')]));_0x420c6b[_0xbfbe('0x39')][_0xbfbe('0x50')]=_0x282bbe['id'];if(_0x14cb01['query'][_0xbfbe('0x3a')]){_0x420c6b['where']=_[_0xbfbe('0x3c')](_0x420c6b[_0xbfbe('0x39')],{'$or':_[_0xbfbe('0x2e')](_0x420c6b[_0xbfbe('0x32')],function(_0x4e8df0){var _0x580338={};_0x580338[_0x4e8df0]={'$like':'%'+_0x14cb01['query']['filter']+'%'};return _0x580338;})});}_0x420c6b=_['merge']({},_0x420c6b,_0x14cb01[_0xbfbe('0x3d')]);return db[_0xbfbe('0x4d')][_0xbfbe('0x1d')]({'where':_0x420c6b[_0xbfbe('0x39')]})[_0xbfbe('0x23')](function(_0x1de744){_0x3f3aa2[_0xbfbe('0x1d')]=_0x1de744;if(_0x14cb01[_0xbfbe('0x30')][_0xbfbe('0x3e')]){_0x420c6b[_0xbfbe('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xbfbe('0x3f')](_0x420c6b);})[_0xbfbe('0x23')](function(_0x34c65f){_0x3f3aa2['rows']=_0x34c65f;return _0x3f3aa2;});}})[_0xbfbe('0x23')](respondWithFilteredResult(_0xb86250,_0x420c6b))[_0xbfbe('0x48')](handleError(_0xb86250,null));}; \ No newline at end of file +var _0x6759=['count','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','keys','query','filters','model','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','options','JscriptySessionReport','include','findAll','rows','catch','show','params','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit'];(function(_0x15c916,_0x246612){var _0x10520c=function(_0x3dc0a0){while(--_0x3dc0a0){_0x15c916['push'](_0x15c916['shift']());}};_0x10520c(++_0x246612);}(_0x6759,0x7f));var _0x9675=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0x6759[_0x36e0f6];return _0xc90479;};'use strict';var emlformat=require(_0x9675('0x0'));var rimraf=require(_0x9675('0x1'));var zipdir=require(_0x9675('0x2'));var jsonpatch=require(_0x9675('0x3'));var rp=require('request-promise');var moment=require(_0x9675('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9675('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9675('0x6'));var ejs=require(_0x9675('0x7'));var fs=require('fs');var fs_extra=require(_0x9675('0x8'));var _=require(_0x9675('0x9'));var squel=require(_0x9675('0xa'));var crypto=require('crypto');var jsforce=require(_0x9675('0xb'));var deskjs=require(_0x9675('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9675('0xd'));var Papa=require(_0x9675('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9675('0xf'));var as=require(_0x9675('0x10'));var hardwareService=require(_0x9675('0x11'));var logger=require(_0x9675('0x12'))(_0x9675('0x13'));var utils=require(_0x9675('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9675('0x15'));var db=require(_0x9675('0x16'))['db'];function respondWithStatusCode(_0x495d3a,_0x525140){_0x525140=_0x525140||0xcc;return function(_0x56a777){if(_0x56a777){return _0x495d3a[_0x9675('0x17')](_0x525140);}return _0x495d3a['status'](_0x525140)[_0x9675('0x18')]();};}function respondWithResult(_0x4e1207,_0x39fe77){_0x39fe77=_0x39fe77||0xc8;return function(_0x33b84b){if(_0x33b84b){return _0x4e1207[_0x9675('0x19')](_0x39fe77)['json'](_0x33b84b);}};}function respondWithFilteredResult(_0x2d21df,_0x5945fa){return function(_0x15fd39){if(_0x15fd39){var _0x3119ac=typeof _0x5945fa[_0x9675('0x1a')]===_0x9675('0x1b')&&typeof _0x5945fa[_0x9675('0x1c')]===_0x9675('0x1b');var _0xec76e2=_0x15fd39['count'];var _0x45099b=_0x3119ac?0x0:_0x5945fa[_0x9675('0x1a')];var _0x5574ed=_0x3119ac?_0x15fd39[_0x9675('0x1d')]:_0x5945fa[_0x9675('0x1a')]+_0x5945fa[_0x9675('0x1c')];var _0x4d7331;if(_0x5574ed>=_0xec76e2){_0x5574ed=_0xec76e2;_0x4d7331=0xc8;}else{_0x4d7331=0xce;}_0x2d21df[_0x9675('0x19')](_0x4d7331);return _0x2d21df[_0x9675('0x1e')](_0x9675('0x1f'),_0x45099b+'-'+_0x5574ed+'/'+_0xec76e2)[_0x9675('0x20')](_0x15fd39);}return null;};}function patchUpdates(_0xe4c0a4){return function(_0xc6c3b7){try{jsonpatch[_0x9675('0x21')](_0xc6c3b7,_0xe4c0a4,!![]);}catch(_0x1ef218){return BPromise[_0x9675('0x22')](_0x1ef218);}return _0xc6c3b7['save']();};}function saveUpdates(_0x501de6,_0x5d2a02){return function(_0x45623){if(_0x45623){return _0x45623['update'](_0x501de6)['then'](function(_0xee613d){return _0xee613d;});}return null;};}function removeEntity(_0x245eb4,_0x336c98){return function(_0x10dcc8){if(_0x10dcc8){return _0x10dcc8[_0x9675('0x23')]()[_0x9675('0x24')](function(){_0x245eb4[_0x9675('0x19')](0xcc)[_0x9675('0x18')]();});}};}function handleEntityNotFound(_0x2f70f4,_0x443d89){return function(_0x3cb7ac){if(!_0x3cb7ac){_0x2f70f4[_0x9675('0x17')](0x194);}return _0x3cb7ac;};}function handleError(_0x25be00,_0xde10e){_0xde10e=_0xde10e||0x1f4;return function(_0x59d0f7){logger[_0x9675('0x25')](_0x59d0f7[_0x9675('0x26')]);if(_0x59d0f7[_0x9675('0x27')]){delete _0x59d0f7[_0x9675('0x27')];}_0x25be00['status'](_0xde10e)[_0x9675('0x28')](_0x59d0f7);};}exports['index']=function(_0x41e65e,_0x2ec9eb){var _0x5b61b8={},_0x524f7b={},_0x149778={'count':0x0,'rows':[]};var _0x2032d9=_[_0x9675('0x29')](db['JscriptySessionReport'][_0x9675('0x2a')],function(_0x1cc88b){return{'name':_0x1cc88b[_0x9675('0x2b')],'type':_0x1cc88b['type'][_0x9675('0x2c')]};});_0x524f7b['model']=_['map'](_0x2032d9,_0x9675('0x27'));_0x524f7b['query']=_[_0x9675('0x2d')](_0x41e65e[_0x9675('0x2e')]);_0x524f7b[_0x9675('0x2f')]=_['intersection'](_0x524f7b[_0x9675('0x30')],_0x524f7b[_0x9675('0x2e')]);_0x5b61b8['attributes']=_[_0x9675('0x31')](_0x524f7b[_0x9675('0x30')],qs['fields'](_0x41e65e[_0x9675('0x2e')][_0x9675('0x32')]));_0x5b61b8['attributes']=_0x5b61b8[_0x9675('0x33')][_0x9675('0x34')]?_0x5b61b8[_0x9675('0x33')]:_0x524f7b[_0x9675('0x30')];if(!_0x41e65e[_0x9675('0x2e')]['hasOwnProperty'](_0x9675('0x35'))){_0x5b61b8['limit']=qs['limit'](_0x41e65e['query'][_0x9675('0x1c')]);_0x5b61b8[_0x9675('0x1a')]=qs[_0x9675('0x1a')](_0x41e65e['query'][_0x9675('0x1a')]);}_0x5b61b8['order']=qs[_0x9675('0x36')](_0x41e65e[_0x9675('0x2e')]['sort']);_0x5b61b8['where']=qs[_0x9675('0x2f')](_[_0x9675('0x37')](_0x41e65e[_0x9675('0x2e')],_0x524f7b[_0x9675('0x2f')]),_0x2032d9);if(_0x41e65e[_0x9675('0x2e')][_0x9675('0x38')]){_0x5b61b8[_0x9675('0x39')]=_[_0x9675('0x3a')](_0x5b61b8[_0x9675('0x39')],{'$or':_[_0x9675('0x29')](_0x2032d9,function(_0x4b70ea){if(_0x4b70ea[_0x9675('0x3b')]!=='VIRTUAL'){var _0x3f7a88={};_0x3f7a88[_0x4b70ea['name']]={'$like':'%'+_0x41e65e['query'][_0x9675('0x38')]+'%'};return _0x3f7a88;}})});}_0x5b61b8=_[_0x9675('0x3a')]({},_0x5b61b8,_0x41e65e[_0x9675('0x3c')]);var _0x23e200={'where':_0x5b61b8[_0x9675('0x39')]};return db[_0x9675('0x3d')][_0x9675('0x1d')](_0x23e200)[_0x9675('0x24')](function(_0x967b45){_0x149778['count']=_0x967b45;if(_0x41e65e[_0x9675('0x2e')]['includeAll']){_0x5b61b8[_0x9675('0x3e')]=[{'all':!![]}];}return db[_0x9675('0x3d')][_0x9675('0x3f')](_0x5b61b8);})[_0x9675('0x24')](function(_0x407ebe){_0x149778[_0x9675('0x40')]=_0x407ebe;return _0x149778;})[_0x9675('0x24')](respondWithFilteredResult(_0x2ec9eb,_0x5b61b8))[_0x9675('0x41')](handleError(_0x2ec9eb,null));};exports[_0x9675('0x42')]=function(_0x532ab4,_0x2da4f3){var _0x121ebf={'raw':!![],'where':{'id':_0x532ab4[_0x9675('0x43')]['id']}},_0x5c82c7={};_0x5c82c7[_0x9675('0x30')]=_['keys'](db[_0x9675('0x3d')][_0x9675('0x2a')]);_0x5c82c7[_0x9675('0x2e')]=_[_0x9675('0x2d')](_0x532ab4['query']);_0x5c82c7[_0x9675('0x2f')]=_[_0x9675('0x31')](_0x5c82c7[_0x9675('0x30')],_0x5c82c7[_0x9675('0x2e')]);_0x121ebf[_0x9675('0x33')]=_['intersection'](_0x5c82c7['model'],qs[_0x9675('0x32')](_0x532ab4[_0x9675('0x2e')][_0x9675('0x32')]));_0x121ebf[_0x9675('0x33')]=_0x121ebf[_0x9675('0x33')]['length']?_0x121ebf['attributes']:_0x5c82c7[_0x9675('0x30')];if(_0x532ab4[_0x9675('0x2e')]['includeAll']){_0x121ebf[_0x9675('0x3e')]=[{'all':!![]}];}_0x121ebf=_[_0x9675('0x3a')]({},_0x121ebf,_0x532ab4[_0x9675('0x3c')]);return db['JscriptySessionReport'][_0x9675('0x44')](_0x121ebf)[_0x9675('0x24')](handleEntityNotFound(_0x2da4f3,null))[_0x9675('0x24')](respondWithResult(_0x2da4f3,null))['catch'](handleError(_0x2da4f3,null));};exports[_0x9675('0x45')]=function(_0x45c76d,_0x275f54){return db[_0x9675('0x3d')]['create'](_0x45c76d[_0x9675('0x46')],{})[_0x9675('0x24')](respondWithResult(_0x275f54,0xc9))[_0x9675('0x41')](handleError(_0x275f54,null));};exports[_0x9675('0x47')]=function(_0x17bb47,_0x130a39){if(_0x17bb47['body']['id']){delete _0x17bb47[_0x9675('0x46')]['id'];}return db['JscriptySessionReport'][_0x9675('0x44')]({'where':{'id':_0x17bb47[_0x9675('0x43')]['id']}})[_0x9675('0x24')](handleEntityNotFound(_0x130a39,null))[_0x9675('0x24')](saveUpdates(_0x17bb47['body'],null))[_0x9675('0x24')](respondWithResult(_0x130a39,null))[_0x9675('0x41')](handleError(_0x130a39,null));};exports['destroy']=function(_0x119398,_0x512741){return db[_0x9675('0x3d')][_0x9675('0x44')]({'where':{'id':_0x119398['params']['id']}})['then'](handleEntityNotFound(_0x512741,null))['then'](removeEntity(_0x512741,null))[_0x9675('0x41')](handleError(_0x512741,null));};exports[_0x9675('0x48')]=function(_0x171663,_0x2760d1){return db['JscriptySessionReport'][_0x9675('0x48')]()[_0x9675('0x24')](respondWithResult(_0x2760d1,null))[_0x9675('0x41')](handleError(_0x2760d1,null));};exports[_0x9675('0x49')]=function(_0x1a3efd,_0x2b50b8,_0xad1752){var _0x2958df={'raw':!![],'where':{}};var _0xecd10c={};var _0x24c2f3={'count':0x0,'rows':[]};return db[_0x9675('0x3d')][_0x9675('0x4a')]({'where':{'id':_0x1a3efd[_0x9675('0x43')]['id']}})[_0x9675('0x24')](handleEntityNotFound(_0x2b50b8,null))['then'](function(_0x4cc8d8){if(_0x4cc8d8){_0xecd10c[_0x9675('0x30')]=_['keys'](db[_0x9675('0x4b')][_0x9675('0x2a')]);_0xecd10c[_0x9675('0x2e')]=_[_0x9675('0x2d')](_0x1a3efd[_0x9675('0x2e')]);_0xecd10c[_0x9675('0x2f')]=_[_0x9675('0x31')](_0xecd10c[_0x9675('0x30')],_0xecd10c['query']);_0x2958df['attributes']=_['intersection'](_0xecd10c['model'],qs['fields'](_0x1a3efd[_0x9675('0x2e')][_0x9675('0x32')]));_0x2958df[_0x9675('0x33')]=_0x2958df['attributes']['length']?_0x2958df['attributes']:_0xecd10c['model'];if(!_0x1a3efd[_0x9675('0x2e')]['hasOwnProperty']('nolimit')){_0x2958df[_0x9675('0x1c')]=qs[_0x9675('0x1c')](_0x1a3efd[_0x9675('0x2e')][_0x9675('0x1c')]);_0x2958df[_0x9675('0x1a')]=qs[_0x9675('0x1a')](_0x1a3efd[_0x9675('0x2e')][_0x9675('0x1a')]);}_0x2958df[_0x9675('0x4c')]=qs[_0x9675('0x36')](_0x1a3efd[_0x9675('0x2e')][_0x9675('0x36')]);_0x2958df[_0x9675('0x39')]=qs[_0x9675('0x2f')](_[_0x9675('0x37')](_0x1a3efd[_0x9675('0x2e')],_0xecd10c[_0x9675('0x2f')]));_0x2958df[_0x9675('0x39')][_0x9675('0x4d')]=_0x4cc8d8['id'];if(_0x1a3efd['query'][_0x9675('0x38')]){_0x2958df[_0x9675('0x39')]=_[_0x9675('0x3a')](_0x2958df[_0x9675('0x39')],{'$or':_['map'](_0x2958df[_0x9675('0x33')],function(_0x115c15){var _0x1cbb77={};_0x1cbb77[_0x115c15]={'$like':'%'+_0x1a3efd['query'][_0x9675('0x38')]+'%'};return _0x1cbb77;})});}_0x2958df=_['merge']({},_0x2958df,_0x1a3efd[_0x9675('0x3c')]);return db[_0x9675('0x4b')]['count']({'where':_0x2958df['where']})[_0x9675('0x24')](function(_0x14cc2d){_0x24c2f3[_0x9675('0x1d')]=_0x14cc2d;if(_0x1a3efd[_0x9675('0x2e')]['includeAll']){_0x2958df['include']=[{'all':!![]}];}return db[_0x9675('0x4b')][_0x9675('0x3f')](_0x2958df);})[_0x9675('0x24')](function(_0x2018a5){_0x24c2f3[_0x9675('0x40')]=_0x2018a5;return _0x24c2f3;});}})['then'](respondWithFilteredResult(_0x2b50b8,_0x2958df))[_0x9675('0x41')](handleError(_0x2b50b8,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1932f21..8bd7320 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 _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','util'];(function(_0x2ec803,_0x465eb1){var _0x3ef409=function(_0x4a852a){while(--_0x4a852a){_0x2ec803['push'](_0x2ec803['shift']());}};_0x3ef409(++_0x465eb1);}(_0x6f47,0xc7));var _0x76f4=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x6f47[_0x1beef3];return _0x5af964;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment'];(function(_0x3ae013,_0x17cf25){var _0x518eec=function(_0x3df267){while(--_0x3df267){_0x3ae013['push'](_0x3ae013['shift']());}};_0x518eec(++_0x17cf25);}(_0xe14b,0x93));var _0xbe14=function(_0x11087e,_0x18f738){_0x11087e=_0x11087e-0x0;var _0x1ea4c0=_0xe14b[_0x11087e];return _0x1ea4c0;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index d916dbc..4f1e0b9 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x930113,_0x3ca521){var _0x1cfc34=function(_0x2ecba7){while(--_0x2ecba7){_0x930113['push'](_0x930113['shift']());}};_0x1cfc34(++_0x3ca521);}(_0x1623,0xab));var _0x3162=function(_0x10c2bd,_0x5aff28){_0x10c2bd=_0x10c2bd-0x0;var _0x226c36=_0x1623[_0x10c2bd];return _0x226c36;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file +var _0xd046=['ioredis','../../config/logger','../../config/environment','http','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd046,0x129));var _0x6d04=function(_0x5d7c5e,_0xf50d25){_0x5d7c5e=_0x5d7c5e-0x0;var _0x1f8ca5=_0xd046[_0x5d7c5e];return _0x1f8ca5;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 33c5e41..e1b8a7a 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 _0xfa1d=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','update','/download_log_file','multer','util'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xfa1d,0x1b1));var _0xdfa1=function(_0x36bdfc,_0x3c67f1){_0x36bdfc=_0x36bdfc-0x0;var _0x22a5be=_0xfa1d[_0x36bdfc];return _0x22a5be;};'use strict';var multer=require(_0xdfa1('0x0'));var util=require(_0xdfa1('0x1'));var path=require(_0xdfa1('0x2'));var timeout=require(_0xdfa1('0x3'));var express=require(_0xdfa1('0x4'));var router=express[_0xdfa1('0x5')]();var fs_extra=require(_0xdfa1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdfa1('0x7'));var config=require(_0xdfa1('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0xdfa1('0x9')]);router[_0xdfa1('0xa')](_0xdfa1('0xb'),auth[_0xdfa1('0xc')](),controller[_0xdfa1('0xd')]);router['get'](_0xdfa1('0xe'),auth[_0xdfa1('0xc')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file +var _0x9a50=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','put','/:id','isAuthenticated','/download_log_file','exports','multer','path','connect-timeout','express'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0x9a50,0x10a));var _0x09a5=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0x9a50[_0x544b3f];return _0x15787f;};'use strict';var multer=require(_0x09a5('0x0'));var util=require('util');var path=require(_0x09a5('0x1'));var timeout=require(_0x09a5('0x2'));var express=require(_0x09a5('0x3'));var router=express[_0x09a5('0x4')]();var fs_extra=require(_0x09a5('0x5'));var auth=require(_0x09a5('0x6'));var interaction=require(_0x09a5('0x7'));var config=require(_0x09a5('0x8'));var controller=require('./license.controller');router[_0x09a5('0x9')]('/',controller['index']);router[_0x09a5('0xa')](_0x09a5('0xb'),auth[_0x09a5('0xc')](),controller['update']);router[_0x09a5('0x9')](_0x09a5('0xd'),auth[_0x09a5('0xc')](),controller['downloadLogFile']);module[_0x09a5('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 dfcfcb7..264c4f5 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 _0x04cf=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x04cf,0x93));var _0xf04c=function(_0x5a2ab4,_0x2e34a4){_0x5a2ab4=_0x5a2ab4-0x0;var _0x5c92cf=_0x04cf[_0x5a2ab4];return _0x5c92cf;};'use strict';var Sequelize=require(_0xf04c('0x0'));module[_0xf04c('0x1')]={'license':{'type':Sequelize[_0xf04c('0x2')]},'data1':{'type':Sequelize[_0xf04c('0x3')]},'data2':{'type':Sequelize[_0xf04c('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xf04c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa2ca=['sequelize','TEXT','STRING','INTEGER'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa2ca,0x80));var _0xaa2c=function(_0x4b669b,_0x1815ff){_0x4b669b=_0x4b669b-0x0;var _0x49514b=_0xa2ca[_0x4b669b];return _0x49514b;};'use strict';var Sequelize=require(_0xaa2c('0x0'));module['exports']={'license':{'type':Sequelize[_0xaa2c('0x1')]},'data1':{'type':Sequelize[_0xaa2c('0x2')]},'data2':{'type':Sequelize[_0xaa2c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xaa2c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index fe21b70..0068f09 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 _0xa099=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','../../config/license/util','index','model','License','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','getLicense','update','body','find','checkLicense','demo','catch','downloadLogFile','license-info.log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xa099,0x186));var _0x9a09=function(_0x31349f,_0x1aaf5b){_0x31349f=_0x31349f-0x0;var _0x118408=_0xa099[_0x31349f];return _0x118408;};'use strict';var emlformat=require(_0x9a09('0x0'));var rimraf=require(_0x9a09('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a09('0x2'));var moment=require('moment');var BPromise=require(_0x9a09('0x3'));var Mustache=require(_0x9a09('0x4'));var util=require('util');var path=require(_0x9a09('0x5'));var sox=require(_0x9a09('0x6'));var csv=require(_0x9a09('0x7'));var ejs=require(_0x9a09('0x8'));var fs=require('fs');var fs_extra=require(_0x9a09('0x9'));var _=require(_0x9a09('0xa'));var squel=require(_0x9a09('0xb'));var crypto=require(_0x9a09('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9a09('0xd'));var toCsv=require(_0x9a09('0x7'));var querystring=require(_0x9a09('0xe'));var Papa=require(_0x9a09('0xf'));var Redis=require(_0x9a09('0x10'));var authService=require(_0x9a09('0x11'));var qs=require(_0x9a09('0x12'));var as=require(_0x9a09('0x13'));var hardwareService=require(_0x9a09('0x14'));var logger=require('../../config/logger')(_0x9a09('0x15'));var utils=require('../../config/utils');var config=require(_0x9a09('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a09('0x17'))['db'];function respondWithStatusCode(_0x2c3a4c,_0x5ab115){_0x5ab115=_0x5ab115||0xcc;return function(_0x6c2fe6){if(_0x6c2fe6){return _0x2c3a4c[_0x9a09('0x18')](_0x5ab115);}return _0x2c3a4c[_0x9a09('0x19')](_0x5ab115)[_0x9a09('0x1a')]();};}function respondWithResult(_0x22df0d,_0x5a1f04){_0x5a1f04=_0x5a1f04||0xc8;return function(_0x52f5ce){if(_0x52f5ce){return _0x22df0d[_0x9a09('0x19')](_0x5a1f04)[_0x9a09('0x1b')](_0x52f5ce);}};}function respondWithFilteredResult(_0x5e2bd2,_0x7a9a05){return function(_0x17273b){if(_0x17273b){var _0x571449=typeof _0x7a9a05[_0x9a09('0x1c')]===_0x9a09('0x1d')&&typeof _0x7a9a05[_0x9a09('0x1e')]===_0x9a09('0x1d');var _0x372cdc=_0x17273b[_0x9a09('0x1f')];var _0x38aa71=_0x571449?0x0:_0x7a9a05[_0x9a09('0x1c')];var _0x152725=_0x571449?_0x17273b[_0x9a09('0x1f')]:_0x7a9a05[_0x9a09('0x1c')]+_0x7a9a05[_0x9a09('0x1e')];var _0x2f613a;if(_0x152725>=_0x372cdc){_0x152725=_0x372cdc;_0x2f613a=0xc8;}else{_0x2f613a=0xce;}_0x5e2bd2[_0x9a09('0x19')](_0x2f613a);return _0x5e2bd2[_0x9a09('0x20')](_0x9a09('0x21'),_0x38aa71+'-'+_0x152725+'/'+_0x372cdc)[_0x9a09('0x1b')](_0x17273b);}return null;};}function patchUpdates(_0x27bb51){return function(_0x35e970){try{jsonpatch[_0x9a09('0x22')](_0x35e970,_0x27bb51,!![]);}catch(_0x1aa4b3){return BPromise[_0x9a09('0x23')](_0x1aa4b3);}return _0x35e970[_0x9a09('0x24')]();};}function saveUpdates(_0x50666b,_0x36e466){return function(_0x45e5cc){if(_0x45e5cc){return _0x45e5cc['update'](_0x50666b)['then'](function(_0x2027d8){return _0x2027d8;});}return null;};}function removeEntity(_0x3e345f,_0x5b8a05){return function(_0x2fc979){if(_0x2fc979){return _0x2fc979['destroy']()[_0x9a09('0x25')](function(){_0x3e345f[_0x9a09('0x19')](0xcc)[_0x9a09('0x1a')]();});}};}function handleEntityNotFound(_0x5beb0a,_0x33b97e){return function(_0x116879){if(!_0x116879){_0x5beb0a[_0x9a09('0x18')](0x194);}return _0x116879;};}function handleError(_0x472b6e,_0xcb01e5){_0xcb01e5=_0xcb01e5||0x1f4;return function(_0x16267c){logger[_0x9a09('0x26')](_0x16267c[_0x9a09('0x27')]);if(_0x16267c[_0x9a09('0x28')]){delete _0x16267c['name'];}_0x472b6e[_0x9a09('0x19')](_0xcb01e5)['send'](_0x16267c);};}var utilLicense=require(_0x9a09('0x29'));exports[_0x9a09('0x2a')]=function(_0x18e0e2,_0xbbef72){var _0x591e08={'raw':!![],'where':{'id':0x1}},_0x1a830a={};_0x1a830a[_0x9a09('0x2b')]=_['keys'](db[_0x9a09('0x2c')][_0x9a09('0x2d')]);_0x1a830a[_0x9a09('0x2e')]=_[_0x9a09('0x2f')](_0x18e0e2[_0x9a09('0x2e')]);_0x1a830a[_0x9a09('0x30')]=_[_0x9a09('0x31')](_0x1a830a[_0x9a09('0x2b')],_0x1a830a[_0x9a09('0x2e')]);_0x591e08[_0x9a09('0x32')]=_[_0x9a09('0x31')](_0x1a830a[_0x9a09('0x2b')],qs[_0x9a09('0x33')](_0x18e0e2['query']['fields']));_0x591e08[_0x9a09('0x32')]=_0x591e08[_0x9a09('0x32')][_0x9a09('0x34')]?_0x591e08['attributes']:_0x1a830a[_0x9a09('0x2b')];_0x591e08=_[_0x9a09('0x35')]({},_0x591e08,_0x18e0e2[_0x9a09('0x36')]);return utilLicense[_0x9a09('0x37')](_0x591e08)[_0x9a09('0x25')](respondWithResult(_0xbbef72,null))['catch'](handleError(_0xbbef72,null));};exports[_0x9a09('0x38')]=function(_0x19aac2,_0x2704f3){if(_0x19aac2[_0x9a09('0x39')]['id']){delete _0x19aac2[_0x9a09('0x39')]['id'];}return db['License'][_0x9a09('0x3a')]({'where':{'id':_0x19aac2['params']['id']}})[_0x9a09('0x25')](handleEntityNotFound(_0x2704f3,null))['then'](function(_0x3dc094){var _0x17d7bf=_0x3dc094['get']({'plain':!![]});return utilLicense[_0x9a09('0x3b')](_0x17d7bf,_0x19aac2['body']['key']);})[_0x9a09('0x25')](function(_0x143847){if(!_0x143847[_0x9a09('0x3c')]){return saveUpdates(_0x19aac2[_0x9a09('0x39')],null);}return _0x143847;})[_0x9a09('0x25')](respondWithResult(_0x2704f3,null))[_0x9a09('0x3d')](handleError(_0x2704f3,null));};exports[_0x9a09('0x3e')]=function(_0x239308,_0x448257){var _0xf9a604=_0x9a09('0x3f');var _0x4805a7=path['join']('/var','log','xcally',_0xf9a604);_0x448257[_0x9a09('0x40')](_0x9a09('0x41'),_0x9a09('0x42')+_0xf9a604);_0x448257[_0x9a09('0x20')](_0x9a09('0x43'),_0x9a09('0x44'));_0x448257['download'](_0x4805a7);}; \ No newline at end of file +var _0x22bd=['jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','downloadLogFile','setHeader','Content-Type','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x1efc9e,_0x3e530b){var _0x5415ef=function(_0xb5d03f){while(--_0xb5d03f){_0x1efc9e['push'](_0x1efc9e['shift']());}};_0x5415ef(++_0x3e530b);}(_0x22bd,0x17f));var _0xd22b=function(_0x92e367,_0x516971){_0x92e367=_0x92e367-0x0;var _0x505bcb=_0x22bd[_0x92e367];return _0x505bcb;};'use strict';var emlformat=require(_0xd22b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd22b('0x1'));var jsonpatch=require(_0xd22b('0x2'));var rp=require(_0xd22b('0x3'));var moment=require('moment');var BPromise=require(_0xd22b('0x4'));var Mustache=require(_0xd22b('0x5'));var util=require(_0xd22b('0x6'));var path=require(_0xd22b('0x7'));var sox=require(_0xd22b('0x8'));var csv=require('to-csv');var ejs=require(_0xd22b('0x9'));var fs=require('fs');var fs_extra=require(_0xd22b('0xa'));var _=require('lodash');var squel=require(_0xd22b('0xb'));var crypto=require(_0xd22b('0xc'));var jsforce=require(_0xd22b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd22b('0xe'));var querystring=require('querystring');var Papa=require(_0xd22b('0xf'));var Redis=require(_0xd22b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd22b('0x11'));var as=require(_0xd22b('0x12'));var hardwareService=require(_0xd22b('0x13'));var logger=require(_0xd22b('0x14'))(_0xd22b('0x15'));var utils=require('../../config/utils');var config=require(_0xd22b('0x16'));var licenseUtil=require(_0xd22b('0x17'));var db=require(_0xd22b('0x18'))['db'];function respondWithStatusCode(_0x7a65c1,_0xd4b618){_0xd4b618=_0xd4b618||0xcc;return function(_0x323093){if(_0x323093){return _0x7a65c1[_0xd22b('0x19')](_0xd4b618);}return _0x7a65c1[_0xd22b('0x1a')](_0xd4b618)[_0xd22b('0x1b')]();};}function respondWithResult(_0x18a282,_0x2ea630){_0x2ea630=_0x2ea630||0xc8;return function(_0x20a13c){if(_0x20a13c){return _0x18a282[_0xd22b('0x1a')](_0x2ea630)[_0xd22b('0x1c')](_0x20a13c);}};}function respondWithFilteredResult(_0x200f20,_0x11a2ac){return function(_0x2a079f){if(_0x2a079f){var _0x21cb6b=typeof _0x11a2ac['offset']==='undefined'&&typeof _0x11a2ac[_0xd22b('0x1d')]==='undefined';var _0x257cdb=_0x2a079f['count'];var _0x2bb3aa=_0x21cb6b?0x0:_0x11a2ac[_0xd22b('0x1e')];var _0x7b7239=_0x21cb6b?_0x2a079f[_0xd22b('0x1f')]:_0x11a2ac[_0xd22b('0x1e')]+_0x11a2ac[_0xd22b('0x1d')];var _0x1e0961;if(_0x7b7239>=_0x257cdb){_0x7b7239=_0x257cdb;_0x1e0961=0xc8;}else{_0x1e0961=0xce;}_0x200f20['status'](_0x1e0961);return _0x200f20[_0xd22b('0x20')](_0xd22b('0x21'),_0x2bb3aa+'-'+_0x7b7239+'/'+_0x257cdb)['json'](_0x2a079f);}return null;};}function patchUpdates(_0xed9829){return function(_0x5cf47c){try{jsonpatch[_0xd22b('0x22')](_0x5cf47c,_0xed9829,!![]);}catch(_0x4cdc87){return BPromise[_0xd22b('0x23')](_0x4cdc87);}return _0x5cf47c[_0xd22b('0x24')]();};}function saveUpdates(_0x5bd576,_0x55e597){return function(_0x218dff){if(_0x218dff){return _0x218dff[_0xd22b('0x25')](_0x5bd576)[_0xd22b('0x26')](function(_0x1e7210){return _0x1e7210;});}return null;};}function removeEntity(_0x489dd1,_0x58930f){return function(_0xc273a4){if(_0xc273a4){return _0xc273a4[_0xd22b('0x27')]()['then'](function(){_0x489dd1[_0xd22b('0x1a')](0xcc)[_0xd22b('0x1b')]();});}};}function handleEntityNotFound(_0xe04176,_0x2a334c){return function(_0x338d47){if(!_0x338d47){_0xe04176['sendStatus'](0x194);}return _0x338d47;};}function handleError(_0x2c7e1c,_0x41aa34){_0x41aa34=_0x41aa34||0x1f4;return function(_0x55ccf9){logger['error'](_0x55ccf9['stack']);if(_0x55ccf9['name']){delete _0x55ccf9[_0xd22b('0x28')];}_0x2c7e1c[_0xd22b('0x1a')](_0x41aa34)[_0xd22b('0x29')](_0x55ccf9);};}var utilLicense=require(_0xd22b('0x17'));exports[_0xd22b('0x2a')]=function(_0x2e33d2,_0x8dc6ce){var _0x4be677={'raw':!![],'where':{'id':0x1}},_0x32e7d9={};_0x32e7d9[_0xd22b('0x2b')]=_[_0xd22b('0x2c')](db[_0xd22b('0x2d')][_0xd22b('0x2e')]);_0x32e7d9[_0xd22b('0x2f')]=_[_0xd22b('0x2c')](_0x2e33d2[_0xd22b('0x2f')]);_0x32e7d9[_0xd22b('0x30')]=_[_0xd22b('0x31')](_0x32e7d9[_0xd22b('0x2b')],_0x32e7d9[_0xd22b('0x2f')]);_0x4be677[_0xd22b('0x32')]=_[_0xd22b('0x31')](_0x32e7d9['model'],qs[_0xd22b('0x33')](_0x2e33d2[_0xd22b('0x2f')][_0xd22b('0x33')]));_0x4be677[_0xd22b('0x32')]=_0x4be677[_0xd22b('0x32')]['length']?_0x4be677['attributes']:_0x32e7d9[_0xd22b('0x2b')];_0x4be677=_[_0xd22b('0x34')]({},_0x4be677,_0x2e33d2[_0xd22b('0x35')]);return utilLicense[_0xd22b('0x36')](_0x4be677)[_0xd22b('0x26')](respondWithResult(_0x8dc6ce,null))[_0xd22b('0x37')](handleError(_0x8dc6ce,null));};exports['update']=function(_0x4dbdce,_0xa36660){if(_0x4dbdce[_0xd22b('0x38')]['id']){delete _0x4dbdce['body']['id'];}return db[_0xd22b('0x2d')][_0xd22b('0x39')]({'where':{'id':_0x4dbdce[_0xd22b('0x3a')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0xa36660,null))[_0xd22b('0x26')](function(_0x4e38b7){var _0x383182=_0x4e38b7[_0xd22b('0x3b')]({'plain':!![]});return utilLicense[_0xd22b('0x3c')](_0x383182,_0x4dbdce[_0xd22b('0x38')][_0xd22b('0x3d')]);})[_0xd22b('0x26')](function(_0x2800ed){if(!_0x2800ed['demo']){return saveUpdates(_0x4dbdce['body'],null);}return _0x2800ed;})[_0xd22b('0x26')](respondWithResult(_0xa36660,null))[_0xd22b('0x37')](handleError(_0xa36660,null));};exports[_0xd22b('0x3e')]=function(_0x226a80,_0x667027){var _0x1cc0f1='license-info.log';var _0x397435=path['join']('/var','log','xcally',_0x1cc0f1);_0x667027[_0xd22b('0x3f')]('Content-disposition','attachment;\x20filename='+_0x1cc0f1);_0x667027['set'](_0xd22b('0x40'),'text/plain');_0x667027[_0xd22b('0x41')](_0x397435);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 62d611a..4e7b7be 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 _0xe08d=['path','rimraf','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x201a73,_0x443bf4){var _0x452417=function(_0x2f7a17){while(--_0x2f7a17){_0x201a73['push'](_0x201a73['shift']());}};_0x452417(++_0x443bf4);}(_0xe08d,0x6e));var _0xde08=function(_0x4e2dcf,_0x12c2f4){_0x4e2dcf=_0x4e2dcf-0x0;var _0x13fa20=_0xe08d[_0x4e2dcf];return _0x13fa20;};'use strict';var _=require(_0xde08('0x0'));var util=require(_0xde08('0x1'));var logger=require(_0xde08('0x2'))(_0xde08('0x3'));var moment=require(_0xde08('0x4'));var BPromise=require(_0xde08('0x5'));var rp=require(_0xde08('0x6'));var fs=require('fs');var path=require(_0xde08('0x7'));var rimraf=require(_0xde08('0x8'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xde08('0x9')]=function(_0x4ada98,_0x849225){return _0x4ada98[_0xde08('0xa')](_0xde08('0xb'),attributes,{'tableName':_0xde08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74af=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','License','license','lodash'];(function(_0x5a1c85,_0xa75d8f){var _0x21d6a5=function(_0x4c0020){while(--_0x4c0020){_0x5a1c85['push'](_0x5a1c85['shift']());}};_0x21d6a5(++_0xa75d8f);}(_0x74af,0x178));var _0xf74a=function(_0x2223c1,_0x1cc229){_0x2223c1=_0x2223c1-0x0;var _0x33573c=_0x74af[_0x2223c1];return _0x33573c;};'use strict';var _=require(_0xf74a('0x0'));var util=require(_0xf74a('0x1'));var logger=require(_0xf74a('0x2'))(_0xf74a('0x3'));var moment=require(_0xf74a('0x4'));var BPromise=require(_0xf74a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf74a('0x6'));var rimraf=require(_0xf74a('0x7'));var config=require(_0xf74a('0x8'));var attributes=require(_0xf74a('0x9'));module[_0xf74a('0xa')]=function(_0x41c258,_0x110741){return _0x41c258['define'](_0xf74a('0xb'),attributes,{'tableName':_0xf74a('0xc'),'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 63e326f..037922b 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 _0x50b8=['catch','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x38f2b7,_0x314770){var _0x296f0e=function(_0x4c0329){while(--_0x4c0329){_0x38f2b7['push'](_0x38f2b7['shift']());}};_0x296f0e(++_0x314770);}(_0x50b8,0xac));var _0x850b=function(_0x27ad97,_0x188740){_0x27ad97=_0x27ad97-0x0;var _0x2ebfef=_0x50b8[_0x27ad97];return _0x2ebfef;};'use strict';var _=require('lodash');var util=require(_0x850b('0x0'));var moment=require(_0x850b('0x1'));var BPromise=require(_0x850b('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')(_0x850b('0x3'));var config=require(_0x850b('0x4'));var jayson=require(_0x850b('0x5'));var client=jayson[_0x850b('0x6')][_0x850b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e2135,_0x5a6ef9,_0x4a6750){return new BPromise(function(_0x30a945,_0xab4425){return client[_0x850b('0x8')](_0x2e2135,_0x4a6750)[_0x850b('0x9')](function(_0x370ba2){logger[_0x850b('0xa')](_0x850b('0xb'),_0x5a6ef9,_0x850b('0xc'));logger[_0x850b('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x5a6ef9,'request\x20sent',JSON[_0x850b('0xe')](_0x370ba2));if(_0x370ba2[_0x850b('0xf')]){if(_0x370ba2[_0x850b('0xf')]['code']===0x1f4){logger[_0x850b('0xf')](_0x850b('0xb'),_0x5a6ef9,_0x370ba2['error'][_0x850b('0x10')]);return _0xab4425(_0x370ba2[_0x850b('0xf')][_0x850b('0x10')]);}logger['error'](_0x850b('0xb'),_0x5a6ef9,_0x370ba2[_0x850b('0xf')]['message']);return _0x30a945(_0x370ba2[_0x850b('0xf')][_0x850b('0x10')]);}else{logger[_0x850b('0xa')](_0x850b('0xb'),_0x5a6ef9,'request\x20sent');_0x30a945(_0x370ba2[_0x850b('0x11')][_0x850b('0x10')]);}})[_0x850b('0x12')](function(_0x39ab6d){logger[_0x850b('0xf')](_0x850b('0xb'),_0x5a6ef9,_0x39ab6d);_0xab4425(_0x39ab6d);});});} \ No newline at end of file +var _0xacd2=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','request\x20sent','result','catch','util','bluebird','randomstring'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0xacd2,0xa5));var _0x2acd=function(_0x330756,_0x39d5d8){_0x330756=_0x330756-0x0;var _0x18c708=_0xacd2[_0x330756];return _0x18c708;};'use strict';var _=require('lodash');var util=require(_0x2acd('0x0'));var moment=require('moment');var BPromise=require(_0x2acd('0x1'));var rs=require(_0x2acd('0x2'));var fs=require('fs');var Redis=require(_0x2acd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2acd('0x4'));var logger=require(_0x2acd('0x5'))('rpc');var config=require(_0x2acd('0x6'));var jayson=require(_0x2acd('0x7'));var client=jayson['client'][_0x2acd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38bd54,_0x1cdd9a,_0x4ba137){return new BPromise(function(_0x16c901,_0xef357){return client[_0x2acd('0x9')](_0x38bd54,_0x4ba137)[_0x2acd('0xa')](function(_0xdb850e){logger[_0x2acd('0xb')]('License,\x20%s,\x20%s',_0x1cdd9a,'request\x20sent');logger[_0x2acd('0xc')](_0x2acd('0xd'),_0x1cdd9a,'request\x20sent',JSON[_0x2acd('0xe')](_0xdb850e));if(_0xdb850e[_0x2acd('0xf')]){if(_0xdb850e[_0x2acd('0xf')]['code']===0x1f4){logger['error'](_0x2acd('0x10'),_0x1cdd9a,_0xdb850e[_0x2acd('0xf')][_0x2acd('0x11')]);return _0xef357(_0xdb850e[_0x2acd('0xf')]['message']);}logger[_0x2acd('0xf')]('License,\x20%s,\x20%s',_0x1cdd9a,_0xdb850e[_0x2acd('0xf')][_0x2acd('0x11')]);return _0x16c901(_0xdb850e[_0x2acd('0xf')][_0x2acd('0x11')]);}else{logger[_0x2acd('0xb')](_0x2acd('0x10'),_0x1cdd9a,_0x2acd('0x12'));_0x16c901(_0xdb850e[_0x2acd('0x13')][_0x2acd('0x11')]);}})[_0x2acd('0x14')](function(_0x19bf97){logger['error'](_0x2acd('0x10'),_0x1cdd9a,_0x19bf97);_0xef357(_0x19bf97);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 786f5e1..527e557 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 _0xa2c1=['/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','send','addAgents','update','removeDispositions','removeAnswers','delete','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap'];(function(_0x2c698e,_0x37f642){var _0x886b0f=function(_0xeea3cf){while(--_0xeea3cf){_0x2c698e['push'](_0x2c698e['shift']());}};_0x886b0f(++_0x37f642);}(_0xa2c1,0xda));var _0x1a2c=function(_0x49b6f2,_0x3e9d41){_0x49b6f2=_0x49b6f2-0x0;var _0x4d46d8=_0xa2c1[_0x49b6f2];return _0x4d46d8;};'use strict';var multer=require(_0x1a2c('0x0'));var util=require(_0x1a2c('0x1'));var path=require(_0x1a2c('0x2'));var timeout=require(_0x1a2c('0x3'));var express=require(_0x1a2c('0x4'));var router=express[_0x1a2c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a2c('0x6'));var interaction=require(_0x1a2c('0x7'));var config=require(_0x1a2c('0x8'));var controller=require(_0x1a2c('0x9'));router[_0x1a2c('0xa')]('/',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0xc')]);router[_0x1a2c('0xa')](_0x1a2c('0xd'),auth['isAuthenticated'](),controller[_0x1a2c('0xe')]);router[_0x1a2c('0xa')](_0x1a2c('0xf'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x10')]);router[_0x1a2c('0xa')](_0x1a2c('0x11'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x12')]);router[_0x1a2c('0xa')](_0x1a2c('0x13'),auth['isAuthenticated'](),controller[_0x1a2c('0x14')]);router[_0x1a2c('0xa')]('/:id/in_servers',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x15')]);router[_0x1a2c('0xa')](_0x1a2c('0x16'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x17')]);router[_0x1a2c('0xa')](_0x1a2c('0x18'),auth['isAuthenticated'](),controller[_0x1a2c('0x19')]);router[_0x1a2c('0xa')](_0x1a2c('0x1a'),auth['isAuthenticated'](),controller['getApplications']);router[_0x1a2c('0xa')](_0x1a2c('0x1b'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x1c')]);router[_0x1a2c('0xa')](_0x1a2c('0x1d'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x1e')]);router[_0x1a2c('0xa')](_0x1a2c('0x1f'),auth[_0x1a2c('0xb')](),controller['getAgents']);router[_0x1a2c('0x20')](_0x1a2c('0x11'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x21')]);router[_0x1a2c('0x20')](_0x1a2c('0x13'),auth['isAuthenticated'](),controller[_0x1a2c('0x22')]);router[_0x1a2c('0x20')]('/',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x23')]);router[_0x1a2c('0x20')]('/:id/in_servers',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x24')]);router[_0x1a2c('0x20')]('/:id/out_servers',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x25')]);router[_0x1a2c('0x20')](_0x1a2c('0x18'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x26')]);router['post'](_0x1a2c('0x1a'),auth[_0x1a2c('0xb')](),controller['addApplications']);router[_0x1a2c('0x20')]('/:id/send',auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x27')]);router[_0x1a2c('0x20')](_0x1a2c('0x1f'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x28')]);router['put'](_0x1a2c('0xf'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x29')]);router['delete'](_0x1a2c('0x11'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x2a')]);router['delete'](_0x1a2c('0x13'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x2b')]);router[_0x1a2c('0x2c')]('/:id/in_servers',auth[_0x1a2c('0xb')](),controller['removeImap']);router[_0x1a2c('0x2c')](_0x1a2c('0x16'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x2d')]);router[_0x1a2c('0x2c')](_0x1a2c('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x1a2c('0x2c')](_0x1a2c('0x1f'),auth[_0x1a2c('0xb')](),controller[_0x1a2c('0x2e')]);module[_0x1a2c('0x2f')]=router; \ No newline at end of file +var _0x8376=['getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','/:id/applications','getMessages','/:id/verify','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','describe','get','/:id','show','/:id/dispositions'];(function(_0x5a7b37,_0x4eee41){var _0x41fd1e=function(_0x4c1fc6){while(--_0x4c1fc6){_0x5a7b37['push'](_0x5a7b37['shift']());}};_0x41fd1e(++_0x4eee41);}(_0x8376,0x1ab));var _0x6837=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8376[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6837('0x0'));var util=require('util');var path=require(_0x6837('0x1'));var timeout=require(_0x6837('0x2'));var express=require(_0x6837('0x3'));var router=express[_0x6837('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6837('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router['get']('/',auth[_0x6837('0x6')](),controller[_0x6837('0x7')]);router['get']('/describe',auth[_0x6837('0x6')](),controller[_0x6837('0x8')]);router[_0x6837('0x9')](_0x6837('0xa'),auth[_0x6837('0x6')](),controller[_0x6837('0xb')]);router['get'](_0x6837('0xc'),auth[_0x6837('0x6')](),controller[_0x6837('0xd')]);router[_0x6837('0x9')](_0x6837('0xe'),auth['isAuthenticated'](),controller[_0x6837('0xf')]);router[_0x6837('0x9')](_0x6837('0x10'),auth[_0x6837('0x6')](),controller[_0x6837('0x11')]);router[_0x6837('0x9')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6837('0x12')]);router[_0x6837('0x9')](_0x6837('0x13'),auth[_0x6837('0x6')](),controller['getInteractions']);router['get'](_0x6837('0x14'),auth[_0x6837('0x6')](),controller['getApplications']);router[_0x6837('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6837('0x15')]);router[_0x6837('0x9')](_0x6837('0x16'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x6837('0x9')]('/:id/users',auth[_0x6837('0x6')](),controller[_0x6837('0x17')]);router[_0x6837('0x18')]('/:id/dispositions',auth[_0x6837('0x6')](),controller[_0x6837('0x19')]);router[_0x6837('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6837('0x1a')]);router[_0x6837('0x18')]('/',auth[_0x6837('0x6')](),controller[_0x6837('0x1b')]);router[_0x6837('0x18')](_0x6837('0x10'),auth[_0x6837('0x6')](),controller[_0x6837('0x1c')]);router[_0x6837('0x18')]('/:id/out_servers',auth[_0x6837('0x6')](),controller[_0x6837('0x1d')]);router[_0x6837('0x18')]('/:id/interactions',auth[_0x6837('0x6')](),controller[_0x6837('0x1e')]);router[_0x6837('0x18')](_0x6837('0x14'),auth['isAuthenticated'](),controller[_0x6837('0x1f')]);router[_0x6837('0x18')](_0x6837('0x20'),auth[_0x6837('0x6')](),controller['send']);router[_0x6837('0x18')](_0x6837('0x21'),auth[_0x6837('0x6')](),controller[_0x6837('0x22')]);router[_0x6837('0x23')](_0x6837('0xa'),auth[_0x6837('0x6')](),controller['update']);router[_0x6837('0x24')](_0x6837('0xc'),auth[_0x6837('0x6')](),controller[_0x6837('0x25')]);router[_0x6837('0x24')](_0x6837('0xe'),auth[_0x6837('0x6')](),controller[_0x6837('0x26')]);router[_0x6837('0x24')]('/:id/in_servers',auth[_0x6837('0x6')](),controller[_0x6837('0x27')]);router['delete'](_0x6837('0x28'),auth[_0x6837('0x6')](),controller['removeSmtp']);router[_0x6837('0x24')](_0x6837('0xa'),auth[_0x6837('0x6')](),controller[_0x6837('0x29')]);router[_0x6837('0x24')](_0x6837('0x21'),auth['isAuthenticated'](),controller[_0x6837('0x2a')]);module[_0x6837('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 80a3c08..6c0f242 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 _0xa067=['setDataValue','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x54f919,_0x57857b){var _0x35c055=function(_0x58e0c5){while(--_0x58e0c5){_0x54f919['push'](_0x54f919['shift']());}};_0x35c055(++_0x57857b);}(_0xa067,0x17f));var _0x7a06=function(_0x236f80,_0x5b317c){_0x236f80=_0x236f80-0x0;var _0x1f5b18=_0xa067[_0x236f80];return _0x1f5b18;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7a06('0x0')]},'name':{'type':Sequelize[_0x7a06('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x7a06('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7a06('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x7a06('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7a06('0x0')],'allowNull':![],'defaultValue':_0x7a06('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7a06('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7a06('0x2')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7a06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7a06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7a06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7a06('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7a06('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a06('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7a06('0x6'),'set':function(_0x1f9c1b){if(!_0x1f9c1b)this['setDataValue'](_0x7a06('0x7'),null);this[_0x7a06('0x8')](_0x7a06('0x9'),_0x1f9c1b);}},'provider':{'type':Sequelize[_0x7a06('0xa')](_0x7a06('0xb'),'hotmail',_0x7a06('0xc'),_0x7a06('0xd')),'defaultValue':null,'get':function(){var _0x2c9e97=this[_0x7a06('0xe')](_0x7a06('0xf'));return _0x2c9e97||_0x7a06('0x10');},'set':function(_0x5b9eb6){if(_0x5b9eb6===_0x7a06('0x10')){_0x5b9eb6=null;}return this[_0x7a06('0x8')]('provider',_0x5b9eb6);}}}; \ No newline at end of file +var _0xc02e=['provider','custom','sequelize','STRING','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','ENUM','hotmail','yahoo','getDataValue'];(function(_0x182064,_0x4114df){var _0x592c69=function(_0x3cf4ca){while(--_0x3cf4ca){_0x182064['push'](_0x182064['shift']());}};_0x592c69(++_0x4114df);}(_0xc02e,0x9c));var _0xec02=function(_0x5cf76b,_0xfbf968){_0x5cf76b=_0x5cf76b-0x0;var _0x50d61f=_0xc02e[_0x5cf76b];return _0x50d61f;};'use strict';var Sequelize=require(_0xec02('0x0'));module['exports']={'description':{'type':Sequelize[_0xec02('0x1')]},'name':{'type':Sequelize[_0xec02('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xec02('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xec02('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xec02('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xec02('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xec02('0x3')]},'markAsUnread':{'type':Sequelize[_0xec02('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xec02('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xec02('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xec02('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xec02('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xec02('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xec02('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xec02('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec02('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec02('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec02('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec02('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec02('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xec02('0x5')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x506c30){if(!_0x506c30)this[_0xec02('0x6')](_0xec02('0x7'),null);this[_0xec02('0x6')]('mandatoryDisposition',_0x506c30);}},'provider':{'type':Sequelize[_0xec02('0x8')]('gmail',_0xec02('0x9'),_0xec02('0xa'),'outlook365'),'defaultValue':null,'get':function(){var _0x22c8c1=this[_0xec02('0xb')](_0xec02('0xc'));return _0x22c8c1||_0xec02('0xd');},'set':function(_0x5c9e94){if(_0x5c9e94===_0xec02('0xd')){_0x5c9e94=null;}return this['setDataValue'](_0xec02('0xc'),_0x5c9e94);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 32406b6..4a44b30 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 _0x7958=['sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','destroy','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','CmContact','defaults','messageId','attach','out','MailMessage','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','User','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','get','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','port','service','authentication','Imap','host','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','params','MailServerIn','length','find','body','provider','secure','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','rawAttributes','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','MailInteraction','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications'];(function(_0x2b0973,_0xc46bce){var _0x45dac4=function(_0xb37dcd){while(--_0xb37dcd){_0x2b0973['push'](_0x2b0973['shift']());}};_0x45dac4(++_0xc46bce);}(_0x7958,0xf5));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8795('0x0'));var BPromise=require(_0x8795('0x1'));var util=require(_0x8795('0x2'));var path=require('path');var _=require(_0x8795('0x3'));var juice=require('juice');var Redis=require(_0x8795('0x4'));var qs=require(_0x8795('0x5'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x8795('0x6'))['db'];config[_0x8795('0x7')]=_['defaults'](config[_0x8795('0x7')],{'host':_0x8795('0x8'),'port':0x18eb});var socket=require(_0x8795('0x9'))(new Redis(config[_0x8795('0x7')]));require('./mailAccount.socket')[_0x8795('0xa')](socket);var jayson=require(_0x8795('0xb'));var client=jayson[_0x8795('0xc')][_0x8795('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x36102f,_0x2ee41c,_0x39746c,_0xa84926){return new BPromise(function(_0x2aad08,_0x53fe20){var _0xca6235=_0xa84926||client;return _0xca6235[_0x8795('0xe')](_0x36102f,_0x39746c)[_0x8795('0xf')](function(_0x4b2d23){logger[_0x8795('0x10')](_0x8795('0x11'),_0x2ee41c,_0x8795('0x12'));logger[_0x8795('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2ee41c,_0x8795('0x12'),JSON[_0x8795('0x14')](_0x4b2d23));if(_0x4b2d23[_0x8795('0x15')]){if(_0x4b2d23[_0x8795('0x15')]['code']===0x1f4){logger[_0x8795('0x15')](_0x8795('0x11'),_0x2ee41c,_0x4b2d23[_0x8795('0x15')][_0x8795('0x16')]);return _0x53fe20(_0x4b2d23[_0x8795('0x15')][_0x8795('0x16')]);}logger[_0x8795('0x15')](_0x8795('0x11'),_0x2ee41c,_0x4b2d23[_0x8795('0x15')][_0x8795('0x16')]);return _0x2aad08(_0x4b2d23[_0x8795('0x15')]['message']);}else{logger['info'](_0x8795('0x11'),_0x2ee41c,_0x8795('0x12'));_0x2aad08(_0x4b2d23[_0x8795('0x17')][_0x8795('0x16')]);}})[_0x8795('0x18')](function(_0x5bc4c4){logger[_0x8795('0x15')](_0x8795('0x11'),_0x2ee41c,_0x5bc4c4);_0x53fe20(_0x5bc4c4);});});}function respondWithStatusCode(_0x4e33ec,_0x5d120d){_0x5d120d=_0x5d120d||0xcc;return function(_0x578ef7){if(_0x578ef7){return _0x4e33ec[_0x8795('0x19')](_0x5d120d);}return _0x4e33ec[_0x8795('0x1a')](_0x5d120d)[_0x8795('0x1b')]();};}function respondWithResult(_0x1f0ea3,_0x391b83){_0x391b83=_0x391b83||0xc8;return function(_0x3635b7){if(_0x3635b7){return _0x1f0ea3[_0x8795('0x1a')](_0x391b83)[_0x8795('0x1c')](_0x3635b7);}};}function respondWithFilteredResult(_0x258b71,_0xbf697c){return function(_0x3d8f8f){if(_0x3d8f8f){var _0x4ee29a=typeof _0xbf697c[_0x8795('0x1d')]===_0x8795('0x1e')&&typeof _0xbf697c[_0x8795('0x1f')]===_0x8795('0x1e');var _0x1fffa9=_0x3d8f8f[_0x8795('0x20')];var _0x3590e8=_0x4ee29a?0x0:_0xbf697c[_0x8795('0x1d')];var _0x2ea648=_0x4ee29a?_0x3d8f8f[_0x8795('0x20')]:_0xbf697c['offset']+_0xbf697c[_0x8795('0x1f')];var _0x57f71f;if(_0x2ea648>=_0x1fffa9){_0x2ea648=_0x1fffa9;_0x57f71f=0xc8;}else{_0x57f71f=0xce;}_0x258b71[_0x8795('0x1a')](_0x57f71f);return _0x258b71[_0x8795('0x21')]('Content-Range',_0x3590e8+'-'+_0x2ea648+'/'+_0x1fffa9)[_0x8795('0x1c')](_0x3d8f8f);}return null;};}function saveUpdates(_0x3dadec){return function(_0x4c7aaf){if(_0x4c7aaf){return _0x4c7aaf[_0x8795('0x22')](_0x3dadec)[_0x8795('0xf')](function(_0x15addf){return _0x15addf;});}return null;};}function removeEntity(_0x451857){return function(_0x5f49b5){if(_0x5f49b5){return _0x5f49b5['destroy']()[_0x8795('0xf')](function(){var _0x5e58c9=_0x5f49b5[_0x8795('0x23')]({'plain':!![]});var _0x17e112=_0x8795('0x24');return db[_0x8795('0x25')]['destroy']({'where':{'type':_0x17e112,'resourceId':_0x5e58c9['id']}})[_0x8795('0xf')](function(){return _0x5f49b5;});})[_0x8795('0xf')](function(){_0x451857[_0x8795('0x1a')](0xcc)[_0x8795('0x1b')]();});}};}function handleEntityNotFound(_0x2a9238){return function(_0x3aa6be){if(!_0x3aa6be){_0x2a9238['sendStatus'](0x194);}return _0x3aa6be;};}function handleError(_0x8358c5,_0x48fb60){_0x48fb60=_0x48fb60||0x1f4;return function(_0x512d24){logger[_0x8795('0x15')](_0x512d24[_0x8795('0x26')]);if(_0x512d24[_0x8795('0x27')]){delete _0x512d24[_0x8795('0x27')];}_0x8358c5['status'](_0x48fb60)['send'](_0x512d24);};}function getImapHost(_0x18351a){switch(_0x18351a){case _0x8795('0x28'):return _0x8795('0x29');case'yahoo':return _0x8795('0x2a');case _0x8795('0x2b'):return _0x8795('0x2c');case _0x8795('0x2d'):return _0x8795('0x2e');}throw new Error(_0x8795('0x2f'),_0x18351a);}function getSmtpHost(_0x549981){switch(_0x549981){case'gmail':return _0x8795('0x30');case _0x8795('0x31'):return _0x8795('0x32');case _0x8795('0x2b'):return'smtp-mail.outlook.com';case _0x8795('0x2d'):return _0x8795('0x33');}throw new Error(_0x8795('0x2f'),_0x549981);}function getAuthenticationOptions(_0x56fe87,_0x158f7d){var _0x23d59c={};var _0x882560={};if(_0x56fe87){_0x23d59c['user']=_0x882560[_0x8795('0x34')]=_0x158f7d[_0x8795('0x35')];_0x23d59c['password']=_0x882560[_0x8795('0x36')]=_0x158f7d[_0x8795('0x37')];if(_0x158f7d[_0x8795('0x38')]){_0x23d59c[_0x8795('0x38')]=_0x882560[_0x8795('0x38')]=!![];_0x23d59c['CloudProviderId']=_0x882560[_0x8795('0x39')]=_0x158f7d['CloudProviderId'];_0x23d59c[_0x8795('0x37')]=_0x882560[_0x8795('0x36')]=null;}else{_0x23d59c[_0x8795('0x39')]=_0x882560[_0x8795('0x39')]=null;}_0x23d59c['host']=getImapHost(_0x56fe87);_0x23d59c[_0x8795('0x3a')]=0x3e1;_0x882560['host']=getSmtpHost(_0x56fe87);_0x882560['port']=0x24b;_0x882560['secure']=![];_0x23d59c[_0x8795('0x3b')]=_0x882560[_0x8795('0x3b')]=null;}else{if(_0x158f7d[_0x8795('0x3c')]){_0x23d59c['user']=_0x882560[_0x8795('0x34')]=_0x158f7d[_0x8795('0x35')];_0x23d59c['password']=_0x882560['pass']=_0x158f7d[_0x8795('0x37')];}else{_0x23d59c[_0x8795('0x3c')]=_0x882560[_0x8795('0x3c')]=![];_0x23d59c[_0x8795('0x34')]=_0x882560[_0x8795('0x34')]=null;_0x23d59c[_0x8795('0x37')]=_0x882560[_0x8795('0x36')]=null;}_0x23d59c['host']=_0x158f7d[_0x8795('0x3d')][_0x8795('0x3e')];_0x23d59c[_0x8795('0x3a')]=_0x158f7d[_0x8795('0x3d')][_0x8795('0x3a')];_0x882560[_0x8795('0x3e')]=_0x158f7d[_0x8795('0x3f')][_0x8795('0x3e')];_0x882560[_0x8795('0x3a')]=_0x158f7d[_0x8795('0x3f')][_0x8795('0x3a')];}return{'Imap':_0x23d59c,'Smtp':_0x882560};}exports[_0x8795('0x40')]=function(_0x29c17f,_0x240786){var _0x7b62ef={'include':[{'model':db['MailServerIn'],'as':_0x8795('0x3d')},{'model':db[_0x8795('0x41')],'as':'Smtp'},{'model':db[_0x8795('0x42')],'as':_0x8795('0x43')}]},_0x41bbb8={},_0x4b18d9={'count':0x0,'rows':[]};var _0x16f2f0=_['map'](db[_0x8795('0x44')]['rawAttributes'],function(_0x37ac5d){return{'name':_0x37ac5d['fieldName'],'type':_0x37ac5d['type'][_0x8795('0x45')]};});_0x41bbb8['model']=_[_0x8795('0x46')](_0x16f2f0,_0x8795('0x27'));_0x41bbb8[_0x8795('0x47')]=_[_0x8795('0x48')](_0x29c17f[_0x8795('0x47')]);_0x41bbb8[_0x8795('0x49')]=_[_0x8795('0x4a')](_0x41bbb8['model'],_0x41bbb8['query']);_0x7b62ef['attributes']=_[_0x8795('0x4a')](_0x41bbb8[_0x8795('0x4b')],qs['fields'](_0x29c17f['query'][_0x8795('0x4c')]));_0x7b62ef[_0x8795('0x4d')]=_0x7b62ef[_0x8795('0x4d')]['length']?_0x7b62ef[_0x8795('0x4d')]:_0x41bbb8[_0x8795('0x4b')];if(!_0x29c17f['query'][_0x8795('0x4e')](_0x8795('0x4f'))){_0x7b62ef[_0x8795('0x1f')]=qs[_0x8795('0x1f')](_0x29c17f[_0x8795('0x47')][_0x8795('0x1f')]);_0x7b62ef[_0x8795('0x1d')]=qs[_0x8795('0x1d')](_0x29c17f[_0x8795('0x47')][_0x8795('0x1d')]);}_0x7b62ef[_0x8795('0x50')]=qs[_0x8795('0x51')](_0x29c17f[_0x8795('0x47')]['sort']);_0x7b62ef[_0x8795('0x52')]=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x29c17f[_0x8795('0x47')],_0x41bbb8['filters']),_0x16f2f0);if(_0x29c17f['query'][_0x8795('0x54')]){_0x7b62ef[_0x8795('0x52')]=_[_0x8795('0x55')](_0x7b62ef['where'],{'$or':_['map'](_0x16f2f0,function(_0x55dc5f){if(_0x55dc5f[_0x8795('0x56')]!=='VIRTUAL'){var _0x52a4b3={};_0x52a4b3[_0x55dc5f[_0x8795('0x27')]]={'$like':'%'+_0x29c17f[_0x8795('0x47')][_0x8795('0x54')]+'%'};return _0x52a4b3;}})});}_0x7b62ef=_[_0x8795('0x55')]({},_0x7b62ef,_0x29c17f[_0x8795('0x57')]);var _0x251453={'where':_0x7b62ef[_0x8795('0x52')]};return db[_0x8795('0x44')][_0x8795('0x20')](_0x251453)[_0x8795('0xf')](function(_0xf28118){_0x4b18d9[_0x8795('0x20')]=_0xf28118;if(_0x29c17f['query'][_0x8795('0x58')]){_0x7b62ef[_0x8795('0x59')]=[{'all':!![]}];}return db[_0x8795('0x44')]['findAll'](_0x7b62ef);})[_0x8795('0xf')](function(_0x33e2b5){_0x4b18d9['rows']=_0x33e2b5;return _0x4b18d9;})[_0x8795('0xf')](respondWithFilteredResult(_0x240786,_0x7b62ef))['catch'](handleError(_0x240786,null));};exports['show']=function(_0x526de7,_0x6dab5d){var _0x2c2c65={'raw':![],'where':{'id':_0x526de7[_0x8795('0x5a')]['id']},'include':[{'model':db[_0x8795('0x5b')],'as':_0x8795('0x3d')},{'model':db['MailServerOut'],'as':_0x8795('0x3f')},{'model':db[_0x8795('0x42')],'as':_0x8795('0x43')}]},_0x2206e7={};_0x2206e7[_0x8795('0x4b')]=_[_0x8795('0x48')](db['MailAccount']['rawAttributes']);_0x2206e7['query']=_[_0x8795('0x48')](_0x526de7[_0x8795('0x47')]);_0x2206e7['filters']=_[_0x8795('0x4a')](_0x2206e7[_0x8795('0x4b')],_0x2206e7[_0x8795('0x47')]);_0x2c2c65['attributes']=_[_0x8795('0x4a')](_0x2206e7[_0x8795('0x4b')],qs[_0x8795('0x4c')](_0x526de7['query']['fields']));_0x2c2c65['attributes']=_0x2c2c65[_0x8795('0x4d')][_0x8795('0x5c')]?_0x2c2c65[_0x8795('0x4d')]:_0x2206e7[_0x8795('0x4b')];if(_0x526de7[_0x8795('0x47')]['includeAll']){_0x2c2c65['include']=[{'all':!![]}];}_0x2c2c65=_[_0x8795('0x55')]({},_0x2c2c65,_0x526de7['options']);return db[_0x8795('0x44')][_0x8795('0x5d')](_0x2c2c65)[_0x8795('0xf')](handleEntityNotFound(_0x6dab5d,null))[_0x8795('0xf')](respondWithResult(_0x6dab5d,null))[_0x8795('0x18')](handleError(_0x6dab5d,null));};exports[_0x8795('0x22')]=function(_0x8d4839,_0x3e3a0b){if(_0x8d4839[_0x8795('0x5e')]['id']){delete _0x8d4839['body']['id'];}var _0x5209c8=_0x8d4839[_0x8795('0x5e')][_0x8795('0x5f')]==='custom'?null:_0x8d4839['body'][_0x8795('0x5f')];var _0x2094c4=_0x8d4839[_0x8795('0x5e')]['Imap']||{};var _0x5dea4a=_0x8d4839[_0x8795('0x5e')][_0x8795('0x3f')]||{};if(_0x5209c8){_0x2094c4[_0x8795('0x3e')]=getImapHost(_0x5209c8);_0x2094c4[_0x8795('0x3a')]=0x3e1;_0x5dea4a[_0x8795('0x3e')]=getSmtpHost(_0x5209c8);_0x5dea4a[_0x8795('0x3a')]=0x24b;_0x5dea4a['secure']=![];}if(_0x5dea4a[_0x8795('0x38')]){_0x5dea4a[_0x8795('0x60')]=![];}else{_0x5dea4a['CloudProviderId']=null;}if(!_0x2094c4[_0x8795('0x38')])_0x2094c4['CloudProviderId']=null;_0x8d4839[_0x8795('0x5e')][_0x8795('0x3d')]=_0x2094c4;_0x8d4839['body'][_0x8795('0x3f')]=_0x5dea4a;return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x8d4839[_0x8795('0x5a')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x8795('0x3d')},{'model':db[_0x8795('0x41')],'as':'Smtp'},{'model':db[_0x8795('0x42')],'as':_0x8795('0x43')}]})['then'](handleEntityNotFound(_0x3e3a0b,null))[_0x8795('0xf')](function(_0x2e6725){if(!_0x2e6725)throw new Error(_0x8795('0x61'));if(_0x2e6725[_0x8795('0x3b')])delete _0x8d4839[_0x8795('0x5e')][_0x8795('0x3d')];return _0x2e6725;})[_0x8795('0xf')](saveUpdates(_0x8d4839[_0x8795('0x5e')],null))[_0x8795('0xf')](function(_0x54df93){if(!_0x8d4839[_0x8795('0x5e')][_0x8795('0x3d')])return _0x54df93;return db[_0x8795('0x5b')]['update'](_0x8d4839[_0x8795('0x5e')][_0x8795('0x3d')],{'where':{'MailAccountId':_0x54df93['id']}})[_0x8795('0xf')](function(){return _0x54df93;});})[_0x8795('0xf')](function(_0x37c48d){if(!_0x8d4839[_0x8795('0x5e')][_0x8795('0x3f')])return _0x37c48d;return db[_0x8795('0x41')][_0x8795('0x22')](_0x8d4839[_0x8795('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x37c48d['id']}})[_0x8795('0xf')](function(){return _0x37c48d;});})[_0x8795('0xf')](respondWithResult(_0x3e3a0b,null))['catch'](handleError(_0x3e3a0b,null));};exports[_0x8795('0x62')]=function(_0x406b30,_0x2ae57f){return db[_0x8795('0x44')][_0x8795('0x62')]()['then'](respondWithResult(_0x2ae57f,null))[_0x8795('0x18')](handleError(_0x2ae57f,null));};exports[_0x8795('0x63')]=function(_0x259ac8,_0x39ac2d){if(_0x259ac8['body']['id']){delete _0x259ac8[_0x8795('0x5e')]['id'];}return db['MailAccount'][_0x8795('0x5d')]({'where':{'id':_0x259ac8[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x39ac2d,null))[_0x8795('0xf')](function(_0x18f978){if(_0x18f978){_0x259ac8['body'][_0x8795('0x64')]=_0x18f978['id'];return db[_0x8795('0x65')][_0x8795('0x66')](_0x259ac8[_0x8795('0x5e')]);}})['then'](respondWithResult(_0x39ac2d,null))['catch'](handleError(_0x39ac2d,null));};exports['getDispositions']=function(_0x8e71cd,_0x2d284f){var _0x536212={'raw':![],'where':{}};var _0x3e9f12={};var _0xc071bf={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x8e71cd[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x2d284f,null))[_0x8795('0xf')](function(_0x354398){if(_0x354398){_0x3e9f12[_0x8795('0x4b')]=_[_0x8795('0x48')](db['Disposition'][_0x8795('0x67')]);_0x3e9f12[_0x8795('0x47')]=_[_0x8795('0x48')](_0x8e71cd[_0x8795('0x47')]);_0x3e9f12[_0x8795('0x49')]=_[_0x8795('0x4a')](_0x3e9f12[_0x8795('0x4b')],_0x3e9f12['query']);_0x536212['attributes']=_['intersection'](_0x3e9f12[_0x8795('0x4b')],qs['fields'](_0x8e71cd['query'][_0x8795('0x4c')]));_0x536212[_0x8795('0x4d')]=_0x536212[_0x8795('0x4d')][_0x8795('0x5c')]?_0x536212['attributes']:_0x3e9f12[_0x8795('0x4b')];if(!_0x8e71cd[_0x8795('0x47')][_0x8795('0x4e')](_0x8795('0x4f'))){_0x536212[_0x8795('0x1f')]=qs[_0x8795('0x1f')](_0x8e71cd[_0x8795('0x47')][_0x8795('0x1f')]);_0x536212['offset']=qs[_0x8795('0x1d')](_0x8e71cd[_0x8795('0x47')][_0x8795('0x1d')]);}_0x536212['order']=qs[_0x8795('0x51')](_0x8e71cd[_0x8795('0x47')]['sort']);_0x536212['where']=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x8e71cd['query'],_0x3e9f12['filters']));_0x536212[_0x8795('0x52')][_0x8795('0x64')]=_0x354398['id'];if(_0x8e71cd[_0x8795('0x47')][_0x8795('0x54')]){_0x536212[_0x8795('0x52')]=_['merge'](_0x536212['where'],{'$or':_[_0x8795('0x46')](_0x536212['attributes'],function(_0x5eed90){var _0x2986b1={};_0x2986b1[_0x5eed90]={'$like':'%'+_0x8e71cd[_0x8795('0x47')][_0x8795('0x54')]+'%'};return _0x2986b1;})});}_0x536212=_['merge']({},_0x536212,_0x8e71cd['options']);return db[_0x8795('0x65')][_0x8795('0x20')]({'where':_0x536212[_0x8795('0x52')]})[_0x8795('0xf')](function(_0x46245f){_0xc071bf[_0x8795('0x20')]=_0x46245f;if(_0x8e71cd[_0x8795('0x47')][_0x8795('0x58')]){_0x536212['include']=[{'all':!![]}];}return db[_0x8795('0x65')][_0x8795('0x68')](_0x536212);})['then'](function(_0x5b29b6){_0xc071bf[_0x8795('0x69')]=_0x5b29b6;return _0xc071bf;});}})[_0x8795('0xf')](respondWithFilteredResult(_0x2d284f,_0x536212))[_0x8795('0x18')](handleError(_0x2d284f,null));};exports[_0x8795('0x6a')]=function(_0x198189,_0x5dc4a0){return db['MailAccount'][_0x8795('0x5d')]({'where':{'id':_0x198189[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x5dc4a0,null))['then'](function(_0x4f51c5){if(_0x4f51c5){return _0x4f51c5['removeDispositions'](_0x198189[_0x8795('0x47')][_0x8795('0x6b')]);}})['then'](respondWithStatusCode(_0x5dc4a0,null))['catch'](handleError(_0x5dc4a0,null));};exports[_0x8795('0x6c')]=function(_0x5a51a3,_0x3a3304){if(_0x5a51a3[_0x8795('0x5e')]['id']){delete _0x5a51a3[_0x8795('0x5e')]['id'];}return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x5a51a3['params']['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x3a3304,null))[_0x8795('0xf')](function(_0x14cb1a){if(_0x14cb1a){_0x5a51a3[_0x8795('0x5e')][_0x8795('0x64')]=_0x14cb1a['id'];return db[_0x8795('0x6d')][_0x8795('0x66')](_0x5a51a3['body']);}})['then'](respondWithResult(_0x3a3304,null))[_0x8795('0x18')](handleError(_0x3a3304,null));};exports[_0x8795('0x6e')]=function(_0x10532a,_0x49ddf4){var _0x341216={'raw':![],'where':{}};var _0x249954={};var _0x588522={'count':0x0,'rows':[]};return db[_0x8795('0x44')]['findOne']({'where':{'id':_0x10532a[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x49ddf4,null))[_0x8795('0xf')](function(_0x2151df){if(_0x2151df){_0x249954[_0x8795('0x4b')]=_[_0x8795('0x48')](db['CannedAnswer']['rawAttributes']);_0x249954[_0x8795('0x47')]=_[_0x8795('0x48')](_0x10532a[_0x8795('0x47')]);_0x249954['filters']=_[_0x8795('0x4a')](_0x249954['model'],_0x249954['query']);_0x341216[_0x8795('0x4d')]=_[_0x8795('0x4a')](_0x249954[_0x8795('0x4b')],qs[_0x8795('0x4c')](_0x10532a['query'][_0x8795('0x4c')]));_0x341216['attributes']=_0x341216[_0x8795('0x4d')][_0x8795('0x5c')]?_0x341216['attributes']:_0x249954['model'];if(!_0x10532a[_0x8795('0x47')][_0x8795('0x4e')]('nolimit')){_0x341216['limit']=qs[_0x8795('0x1f')](_0x10532a[_0x8795('0x47')][_0x8795('0x1f')]);_0x341216['offset']=qs[_0x8795('0x1d')](_0x10532a[_0x8795('0x47')]['offset']);}_0x341216[_0x8795('0x50')]=qs[_0x8795('0x51')](_0x10532a[_0x8795('0x47')]['sort']);_0x341216[_0x8795('0x52')]=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x10532a['query'],_0x249954[_0x8795('0x49')]));_0x341216[_0x8795('0x52')][_0x8795('0x64')]=_0x2151df['id'];if(_0x10532a[_0x8795('0x47')][_0x8795('0x54')]){_0x341216['where']=_['merge'](_0x341216[_0x8795('0x52')],{'$or':_[_0x8795('0x46')](_0x341216['attributes'],function(_0x4a7861){var _0x262972={};_0x262972[_0x4a7861]={'$like':'%'+_0x10532a[_0x8795('0x47')][_0x8795('0x54')]+'%'};return _0x262972;})});}_0x341216=_[_0x8795('0x55')]({},_0x341216,_0x10532a[_0x8795('0x57')]);return db[_0x8795('0x6d')][_0x8795('0x20')]({'where':_0x341216['where']})[_0x8795('0xf')](function(_0x46a61b){_0x588522[_0x8795('0x20')]=_0x46a61b;if(_0x10532a[_0x8795('0x47')][_0x8795('0x58')]){_0x341216[_0x8795('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8795('0x68')](_0x341216);})['then'](function(_0x22f701){_0x588522['rows']=_0x22f701;return _0x588522;});}})[_0x8795('0xf')](respondWithFilteredResult(_0x49ddf4,_0x341216))[_0x8795('0x18')](handleError(_0x49ddf4,null));};exports[_0x8795('0x6f')]=function(_0x5dc91c,_0x4b9d6e){return db['MailAccount']['find']({'where':{'id':_0x5dc91c['params']['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x4b9d6e,null))['then'](function(_0x2b1ff1){if(_0x2b1ff1){return _0x2b1ff1['removeAnswers'](_0x5dc91c['query'][_0x8795('0x6b')]);}})[_0x8795('0xf')](respondWithStatusCode(_0x4b9d6e,null))[_0x8795('0x18')](handleError(_0x4b9d6e,null));};exports['create']=function(_0x38ff83,_0x586723){var _0x9a15ac={'name':_0x38ff83['body'][_0x8795('0x27')],'key':_0x38ff83[_0x8795('0x5e')][_0x8795('0x45')],'provider':_0x38ff83['body'][_0x8795('0x5f')]===_0x8795('0x70')?null:_0x38ff83['body'][_0x8795('0x5f')],'email':_0x38ff83['body']['email'],'ListId':_0x38ff83[_0x8795('0x5e')][_0x8795('0x71')],'active':!_[_0x8795('0x72')](_0x38ff83['body'][_0x8795('0x73')])?_0x38ff83['body']['active']:!![],'description':_0x38ff83['body'][_0x8795('0x74')]||null};var _0x5de120=getAuthenticationOptions(_0x9a15ac[_0x8795('0x5f')],_0x38ff83['body']);_0x9a15ac[_0x8795('0x3d')]=_0x5de120[_0x8795('0x3d')];_0x9a15ac[_0x8795('0x3f')]=_0x5de120[_0x8795('0x3f')];return db[_0x8795('0x44')]['create'](_0x9a15ac,{'include':[{'model':db[_0x8795('0x41')],'as':_0x8795('0x3f')},{'model':db[_0x8795('0x5b')],'as':_0x8795('0x3d')}]})[_0x8795('0xf')](function(_0x3a1377){var _0x55f09a=_0x38ff83[_0x8795('0x34')]['get']({'plain':!![]});if(!_0x55f09a)throw new Error(_0x8795('0x75'));if(_0x55f09a['role']==='user'){var _0x5a2aa5=_0x3a1377['get']({'plain':!![]});return db[_0x8795('0x76')][_0x8795('0x5d')]({'where':{'name':_0x8795('0x24'),'userProfileId':_0x55f09a[_0x8795('0x77')]},'raw':!![]})['then'](function(_0xc246da){if(_0xc246da&&_0xc246da[_0x8795('0x78')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a2aa5[_0x8795('0x27')],'resourceId':_0x5a2aa5['id'],'type':_0xc246da[_0x8795('0x27')],'sectionId':_0xc246da['id']},{})[_0x8795('0xf')](function(){return _0x3a1377;});}else{return _0x3a1377;}})['catch'](function(_0x4da011){logger['error'](_0x8795('0x79'),_0x4da011);throw _0x4da011;});}return _0x3a1377;})[_0x8795('0xf')](respondWithResult(_0x586723,0xc9))[_0x8795('0x18')](handleError(_0x586723,null));};exports[_0x8795('0x7a')]=function(_0x4a3608,_0x2a157e){return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x4a3608[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x2a157e,null))['then'](function(_0x2f6d12){if(_0x2f6d12){return _0x2f6d12['getImap']();}return null;})[_0x8795('0xf')](respondWithResult(_0x2a157e,null))['catch'](handleError(_0x2a157e,null));};exports[_0x8795('0x7c')]=function(_0x8b020e,_0x15837c){if(_0x8b020e[_0x8795('0x5e')]['id']){delete _0x8b020e[_0x8795('0x5e')]['id'];}return db['MailAccount'][_0x8795('0x5d')]({'where':{'id':_0x8b020e[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x15837c,null))[_0x8795('0xf')](function(_0x21b6ff){if(_0x21b6ff){_0x8b020e['body'][_0x8795('0x64')]=_0x21b6ff['id'];return db[_0x8795('0x5b')][_0x8795('0x66')](_0x8b020e[_0x8795('0x5e')]);}})['then'](respondWithResult(_0x15837c,null))['catch'](handleError(_0x15837c,null));};exports[_0x8795('0x7d')]=function(_0x26784d,_0x75248){return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x26784d[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x75248,null))[_0x8795('0xf')](function(_0x3df764){if(_0x3df764){return _0x3df764[_0x8795('0x7e')](null);}return null;})[_0x8795('0xf')](respondWithStatusCode(_0x75248,null))['catch'](handleError(_0x75248,null));};exports[_0x8795('0x7f')]=function(_0x32a6a1,_0x2f2ca1){return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x32a6a1[_0x8795('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f2ca1,null))['then'](function(_0xcffa7c){if(_0xcffa7c){return _0xcffa7c[_0x8795('0x7f')]();}return null;})[_0x8795('0xf')](respondWithResult(_0x2f2ca1,null))[_0x8795('0x18')](handleError(_0x2f2ca1,null));};exports[_0x8795('0x80')]=function(_0x271196,_0x17cb82){if(_0x271196[_0x8795('0x5e')]['id']){delete _0x271196[_0x8795('0x5e')]['id'];}return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x271196[_0x8795('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17cb82,null))['then'](function(_0x316403){if(_0x316403){_0x271196[_0x8795('0x5e')][_0x8795('0x64')]=_0x316403['id'];return db[_0x8795('0x41')][_0x8795('0x66')](_0x271196[_0x8795('0x5e')]);}})[_0x8795('0xf')](respondWithResult(_0x17cb82,null))[_0x8795('0x18')](handleError(_0x17cb82,null));};exports[_0x8795('0x81')]=function(_0x537af2,_0x19b515){return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x537af2[_0x8795('0x5a')]['id']}})['then'](handleEntityNotFound(_0x19b515,null))['then'](function(_0xf91008){if(_0xf91008){return _0xf91008['setSmtp'](null);}return null;})[_0x8795('0xf')](respondWithStatusCode(_0x19b515,null))['catch'](handleError(_0x19b515,null));};exports[_0x8795('0x82')]=function(_0x39e638,_0x1a0daa){return db['MailInteraction'][_0x8795('0x5d')]({'where':{'id':_0x39e638[_0x8795('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1a0daa,null))[_0x8795('0xf')](function(_0x65c17a){if(_0x65c17a){return _0x65c17a[_0x8795('0x82')](_0x39e638['body'][_0x8795('0x6b')],_[_0x8795('0x83')](_0x39e638[_0x8795('0x5e')],[_0x8795('0x6b'),'id'])||{});}})[_0x8795('0xf')](respondWithResult(_0x1a0daa,null))[_0x8795('0x18')](handleError(_0x1a0daa,null));};exports['getInteractions']=function(_0x3c2b77,_0x28d6ce){var _0x8dcdfd={'raw':![],'where':{}};var _0x3615d2={};var _0x591125={'count':0x0,'rows':[]};return db[_0x8795('0x44')]['findOne']({'where':{'id':_0x3c2b77[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x28d6ce,null))[_0x8795('0xf')](function(_0x7da9da){if(_0x7da9da){_0x3615d2[_0x8795('0x4b')]=_[_0x8795('0x48')](db['MailInteraction'][_0x8795('0x67')]);_0x3615d2['query']=_[_0x8795('0x48')](_0x3c2b77[_0x8795('0x47')]);_0x3615d2[_0x8795('0x49')]=_[_0x8795('0x4a')](_0x3615d2[_0x8795('0x4b')],_0x3615d2[_0x8795('0x47')]);_0x8dcdfd[_0x8795('0x4d')]=_[_0x8795('0x4a')](_0x3615d2[_0x8795('0x4b')],qs[_0x8795('0x4c')](_0x3c2b77[_0x8795('0x47')][_0x8795('0x4c')]));_0x8dcdfd[_0x8795('0x4d')]=_0x8dcdfd[_0x8795('0x4d')]['length']?_0x8dcdfd[_0x8795('0x4d')]:_0x3615d2['model'];if(!_0x3c2b77[_0x8795('0x47')][_0x8795('0x4e')]('nolimit')){_0x8dcdfd['limit']=qs[_0x8795('0x1f')](_0x3c2b77[_0x8795('0x47')][_0x8795('0x1f')]);_0x8dcdfd[_0x8795('0x1d')]=qs[_0x8795('0x1d')](_0x3c2b77[_0x8795('0x47')]['offset']);}_0x8dcdfd[_0x8795('0x50')]=qs[_0x8795('0x51')](_0x3c2b77['query'][_0x8795('0x51')]);_0x8dcdfd['where']=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x3c2b77['query'],_0x3615d2[_0x8795('0x49')]));_0x8dcdfd[_0x8795('0x52')]['MailAccountId']=_0x7da9da['id'];if(_0x3c2b77[_0x8795('0x47')][_0x8795('0x54')]){_0x8dcdfd['where']=_[_0x8795('0x55')](_0x8dcdfd[_0x8795('0x52')],{'$or':_['map'](_0x8dcdfd[_0x8795('0x4d')],function(_0x37b5a1){var _0x483d33={};_0x483d33[_0x37b5a1]={'$like':'%'+_0x3c2b77['query']['filter']+'%'};return _0x483d33;})});}_0x8dcdfd=_[_0x8795('0x55')]({},_0x8dcdfd,_0x3c2b77[_0x8795('0x57')]);return db[_0x8795('0x84')][_0x8795('0x20')]({'where':_0x8dcdfd[_0x8795('0x52')]})[_0x8795('0xf')](function(_0x3db695){_0x591125[_0x8795('0x20')]=_0x3db695;if(_0x3c2b77['query'][_0x8795('0x58')]){_0x8dcdfd[_0x8795('0x59')]=[{'model':db['CmContact'],'as':_0x8795('0x85'),'required':![]},{'model':db['User'],'as':_0x8795('0x86'),'attributes':[_0x8795('0x27'),_0x8795('0x87'),_0x8795('0x88')],'required':![]},{'model':db[_0x8795('0x89')],'as':_0x8795('0x8a'),'attributes':['id',_0x8795('0x27'),'color'],'where':_0x3c2b77[_0x8795('0x47')]['tag']?{'id':_0x3c2b77[_0x8795('0x47')][_0x8795('0x8b')]}:undefined,'required':_0x3c2b77[_0x8795('0x47')][_0x8795('0x8b')]?!![]:![]}];}return db[_0x8795('0x84')]['findAll'](_0x8dcdfd);})[_0x8795('0xf')](function(_0x134d9e){_0x591125[_0x8795('0x69')]=_0x134d9e;return _0x591125;});}})[_0x8795('0xf')](respondWithFilteredResult(_0x28d6ce,_0x8dcdfd))[_0x8795('0x18')](handleError(_0x28d6ce,null));};exports[_0x8795('0x8c')]=function addApplications(_0xe36e90,_0x34c976){var _0x519534=_0xe36e90[_0x8795('0x5a')]['id'];var _0x471961=_0xe36e90[_0x8795('0x5e')];var _0x39c5c4=0xc8;var _0x523ca6=null;return db[_0x8795('0x8d')][_0x8795('0x8e')]({'isolationLevel':db[_0x8795('0x8d')][_0x8795('0x8f')][_0x8795('0x90')][_0x8795('0x91')]},function(_0x94a0e0){return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x519534},'transaction':_0x94a0e0})[_0x8795('0xf')](function(_0x10e239){if(_0x10e239){return db[_0x8795('0x92')][_0x8795('0x93')]({'where':{'MailAccountId':_0x519534},'transaction':_0x94a0e0})[_0x8795('0xf')](function(){var _0x43ed59=_[_0x8795('0x46')](_0x471961,function(_0x199206){_0x199206[_0x8795('0x64')]=_0x519534;return _0x199206;});return db['MailApplication'][_0x8795('0x94')](_0x43ed59,{'transaction':_0x94a0e0});});}else{_0x39c5c4=0x194;_0x523ca6=[];}});})['then'](function(){if(_0x39c5c4!==0x194){return db['MailApplication'][_0x8795('0x95')]({'where':{'MailAccountId':_0x519534},'order':_0x8795('0x96')})[_0x8795('0xf')](function(_0x48988c){_0x523ca6=_0x48988c;});}})[_0x8795('0x18')](function(_0x5be869){_0x39c5c4=0x1f4;logger[_0x8795('0x15')](_0x5be869[_0x8795('0x26')]);if(_0x5be869[_0x8795('0x27')]){delete _0x5be869['name'];}_0x523ca6=_0x5be869;})[_0x8795('0x97')](function(){if(_0x523ca6===null){_0x34c976['sendStatus'](_0x39c5c4);}else{if(_0x39c5c4===0x1f4){_0x34c976['status'](_0x39c5c4)['send'](_0x523ca6);}else{_0x34c976[_0x8795('0x1a')](_0x39c5c4)['json'](_0x523ca6);}}});};exports[_0x8795('0x98')]=function(_0x458c94,_0x131ea9){var _0x51c055={};var _0x2e81e3={};var _0x5b87f0;var _0x56c7d4;return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x458c94[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x131ea9,null))[_0x8795('0xf')](function(_0x4892ec){if(_0x4892ec){_0x5b87f0=_0x4892ec;_0x2e81e3[_0x8795('0x4b')]=_[_0x8795('0x48')](db[_0x8795('0x92')][_0x8795('0x67')]);_0x2e81e3[_0x8795('0x47')]=_[_0x8795('0x48')](_0x458c94[_0x8795('0x47')]);_0x2e81e3[_0x8795('0x49')]=_[_0x8795('0x4a')](_0x2e81e3[_0x8795('0x4b')],_0x2e81e3[_0x8795('0x47')]);_0x51c055[_0x8795('0x4d')]=_[_0x8795('0x4a')](_0x2e81e3[_0x8795('0x4b')],qs[_0x8795('0x4c')](_0x458c94[_0x8795('0x47')][_0x8795('0x4c')]));_0x51c055[_0x8795('0x4d')]=_0x51c055[_0x8795('0x4d')][_0x8795('0x5c')]?_0x51c055['attributes']:_0x2e81e3['model'];_0x51c055[_0x8795('0x50')]=qs[_0x8795('0x51')](_0x458c94[_0x8795('0x47')][_0x8795('0x51')]);_0x51c055['where']=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x458c94[_0x8795('0x47')],_0x2e81e3[_0x8795('0x49')]));if(_0x458c94[_0x8795('0x47')]['filter']){_0x51c055[_0x8795('0x52')]=_[_0x8795('0x55')](_0x51c055['where'],{'$or':_[_0x8795('0x46')](_0x51c055[_0x8795('0x4d')],function(_0x25b58d){var _0x1342d2={};_0x1342d2[_0x25b58d]={'$like':'%'+_0x458c94['query']['filter']+'%'};return _0x1342d2;})});}_0x51c055=_[_0x8795('0x55')]({},_0x51c055,_0x458c94[_0x8795('0x57')]);return _0x5b87f0[_0x8795('0x98')](_0x51c055);}})[_0x8795('0xf')](function(_0x539064){if(_0x539064){_0x56c7d4=_0x539064[_0x8795('0x5c')];if(!_0x458c94[_0x8795('0x47')][_0x8795('0x4e')]('nolimit')){_0x51c055['limit']=qs[_0x8795('0x1f')](_0x458c94['query'][_0x8795('0x1f')]);_0x51c055[_0x8795('0x1d')]=qs['offset'](_0x458c94[_0x8795('0x47')]['offset']);}return _0x5b87f0['getApplications'](_0x51c055);}})[_0x8795('0xf')](function(_0xc6b88){if(_0xc6b88){return _0xc6b88?{'count':_0x56c7d4,'rows':_0xc6b88}:null;}})[_0x8795('0xf')](respondWithResult(_0x131ea9,null))[_0x8795('0x18')](handleError(_0x131ea9,null));};exports[_0x8795('0x99')]=function(_0xb2ff86,_0x71ed2e){var _0x54ee5d={'raw':!![],'where':{}};var _0x33749f={};var _0x4ac29b={'count':0x0,'rows':[]};return db['MailAccount'][_0x8795('0x7b')]({'where':{'id':_0xb2ff86[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x71ed2e,null))[_0x8795('0xf')](function(_0x51c003){if(_0x51c003){_0x33749f[_0x8795('0x4b')]=_[_0x8795('0x48')](db['MailMessage'][_0x8795('0x67')]);_0x33749f[_0x8795('0x47')]=_[_0x8795('0x48')](_0xb2ff86[_0x8795('0x47')]);_0x33749f['filters']=_[_0x8795('0x4a')](_0x33749f[_0x8795('0x4b')],_0x33749f[_0x8795('0x47')]);_0x54ee5d['attributes']=_[_0x8795('0x4a')](_0x33749f[_0x8795('0x4b')],qs['fields'](_0xb2ff86['query'][_0x8795('0x4c')]));_0x54ee5d[_0x8795('0x4d')]=_0x54ee5d['attributes'][_0x8795('0x5c')]?_0x54ee5d[_0x8795('0x4d')]:_0x33749f[_0x8795('0x4b')];if(!_0xb2ff86[_0x8795('0x47')]['hasOwnProperty']('nolimit')){_0x54ee5d['limit']=qs[_0x8795('0x1f')](_0xb2ff86['query']['limit']);_0x54ee5d[_0x8795('0x1d')]=qs[_0x8795('0x1d')](_0xb2ff86[_0x8795('0x47')][_0x8795('0x1d')]);}_0x54ee5d['order']=qs[_0x8795('0x51')](_0xb2ff86[_0x8795('0x47')][_0x8795('0x51')]);_0x54ee5d[_0x8795('0x52')]=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0xb2ff86['query'],_0x33749f['filters']));_0x54ee5d[_0x8795('0x52')]['MailAccountId']=_0x51c003['id'];if(_0xb2ff86[_0x8795('0x47')]['filter']){_0x54ee5d[_0x8795('0x52')]=_[_0x8795('0x55')](_0x54ee5d[_0x8795('0x52')],{'$or':_[_0x8795('0x46')](_0x54ee5d[_0x8795('0x4d')],function(_0x46febc){var _0x3c641a={};_0x3c641a[_0x46febc]={'$like':'%'+_0xb2ff86[_0x8795('0x47')][_0x8795('0x54')]+'%'};return _0x3c641a;})});}if(_0xb2ff86['query'][_0x8795('0x9a')]){var _0x16cf63=_0xb2ff86[_0x8795('0x47')][_0x8795('0x9a')][_0x8795('0x9b')](',');var _0x54cdc3={};_0x54cdc3[_0x16cf63[0x0]]={'$gte':moment(_0x16cf63[0x1])[_0x8795('0x9c')](_0x8795('0x9d'))};_0x54ee5d['where']=_[_0x8795('0x55')](_0x54ee5d['where'],_0x54cdc3);}_0x54ee5d=_[_0x8795('0x55')]({},_0x54ee5d,_0xb2ff86[_0x8795('0x57')]);return db['MailMessage'][_0x8795('0x20')]({'where':_0x54ee5d[_0x8795('0x52')]})[_0x8795('0xf')](function(_0x3ac1f4){_0x4ac29b['count']=_0x3ac1f4;if(_0xb2ff86['query'][_0x8795('0x58')]){_0x54ee5d[_0x8795('0x59')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x54ee5d);})['then'](function(_0x1c478d){if(_0xb2ff86[_0x8795('0x47')][_0x8795('0x9e')]==='true'){for(var _0x25de4d=0x0;_0x25de4d<_0x1c478d[_0x8795('0x5c')];_0x25de4d++){_0x1c478d[_0x25de4d]['body']=juice(_0x1c478d[_0x25de4d]['body']);}}_0x4ac29b[_0x8795('0x69')]=_0x1c478d;return _0x4ac29b;});}})[_0x8795('0xf')](respondWithFilteredResult(_0x71ed2e,_0x54ee5d))[_0x8795('0x18')](handleError(_0x71ed2e,null));};exports['send']=function(_0x2240dd,_0x3803eb){var _0x2e334a,_0x5da177={},_0xda479a;if(_0x2240dd['body']['to']){_0xda479a=_0x2240dd[_0x8795('0x5e')]['to'][_0x8795('0x9b')](',')[0x0];}return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x2240dd['params']['id']},'include':[{'model':db['CmList'],'as':_0x8795('0x9f'),'include':[{'model':db['CmContact'],'as':_0x8795('0xa0'),'where':{'email':_0xda479a},'limit':0x1,'order':[[_0x8795('0xa1'),_0x8795('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8795('0xa3')],'as':'CloudProvider','raw':!![]}]}]})[_0x8795('0xf')](handleEntityNotFound(_0x3803eb,null))[_0x8795('0xf')](function(_0x15b96d){if(!_0x15b96d)return;_0x2e334a=_0x15b96d;if(!_0x15b96d[_0x8795('0x3f')])throw new Error(_0x8795('0xa4'));if(_[_0x8795('0x72')](_0x2240dd[_0x8795('0x5e')][_0x8795('0xa5')])){_0x2240dd[_0x8795('0x5e')][_0x8795('0xa5')]=util[_0x8795('0x9c')](_0x8795('0xa6'),_0x15b96d['name'],_0x15b96d['email']||_0x15b96d['Smtp'][_0x8795('0x34')]);}if(_0x2240dd['body'][_0x8795('0xa7')]&&_0x2240dd['body']['attachments'][_0x8795('0x5c')]){for(var _0x3764b1=0x0;_0x3764b1<_0x2240dd[_0x8795('0x5e')][_0x8795('0xa7')][_0x8795('0x5c')];_0x3764b1+=0x1){_0x2240dd[_0x8795('0x5e')][_0x8795('0xa7')][_0x3764b1]={'filename':_0x2240dd[_0x8795('0x5e')][_0x8795('0xa7')][_0x3764b1][_0x8795('0x27')],'path':path['join'](config[_0x8795('0xa8')],_0x8795('0xa9'),_0x2240dd[_0x8795('0x5e')][_0x8795('0xa7')][_0x3764b1][_0x8795('0xaa')])};}}var _0x4b101e=_0x15b96d[_0x8795('0xab')]();return respondWithRpcPromise(_0x8795('0xac'),'sendMail',{'account':_0x4b101e,'message':_0x2240dd[_0x8795('0x5e')]});})[_0x8795('0xf')](function(_0xc76f0a){if(!_0xc76f0a)return;_0x5da177=_0xc76f0a;if(!_0x2e334a[_0x8795('0x9f')])throw new Error(_0x8795('0xad'));if(_0x2e334a[_0x8795('0x9f')][_0x8795('0xa0')][_0x8795('0x5c')])return _0x2e334a[_0x8795('0x9f')][_0x8795('0xa0')][0x0];return db[_0x8795('0xae')][_0x8795('0x66')](_[_0x8795('0xaf')](_0x2240dd[_0x8795('0x5e')],{'firstName':_0x2240dd[_0x8795('0x5e')]['to'],'email':_0x2240dd[_0x8795('0x5e')]['to'],'phone':_0x2240dd['body']['to'],'ListId':_0x2e334a['ListId']}));})[_0x8795('0xf')](function(_0x1cdf7b){if(!_0x1cdf7b)return;var _0x1b3966={'UserId':_0x2240dd[_0x8795('0x34')]['id'],'ContactId':_0x1cdf7b['id'],'MailAccountId':_0x2e334a['id'],'inReplyTo':_0x5da177[_0x8795('0xb0')],'to':_0x2240dd['body'][_0x8795('0xa5')],'cc':_0x2240dd[_0x8795('0x5e')]['cc'],'subject':_0x2240dd[_0x8795('0x5e')]['subject'],'attach':_0x2240dd[_0x8795('0x5e')][_0x8795('0xb1')],'firstMsgDirection':_0x8795('0xb2'),'lastMsgAt':moment()[_0x8795('0x9c')](_0x8795('0x9d')),'lastMsgDirection':_0x8795('0xb2'),'Messages':[_[_0x8795('0x55')](_0x2240dd[_0x8795('0x5e')],{'messageId':_0x5da177[_0x8795('0xb0')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2e334a['id'],'UserId':_0x2240dd['user']['id'],'ContactId':_0x1cdf7b['id']})]};if(_0x2240dd[_0x8795('0x5e')]['Interaction']){_0x1b3966=_['merge'](_0x1b3966,_0x2240dd['body']['Interaction']);}return db['MailInteraction'][_0x8795('0x66')](_0x1b3966,{'include':[{'model':db[_0x8795('0xb3')],'as':_0x8795('0xb4')}]});})[_0x8795('0xf')](respondWithResult(_0x3803eb,null))[_0x8795('0x18')](handleError(_0x3803eb,null));};exports[_0x8795('0xb5')]=function(_0x52fb43,_0x2980d1){return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x52fb43[_0x8795('0x5a')]['id']},'include':[{'model':db[_0x8795('0x41')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8795('0xa3')],'as':_0x8795('0xa3'),'raw':!![]}]}]})[_0x8795('0xf')](handleEntityNotFound(_0x2980d1,null))[_0x8795('0xf')](function(_0x1ca8a7){if(!_0x1ca8a7[_0x8795('0x3f')])return;var _0x52d60b=_0x1ca8a7[_0x8795('0xab')]();return respondWithRpcPromise(_0x8795('0xb6'),_0x8795('0xb5'),{'account':_0x52d60b});})[_0x8795('0xf')](respondWithResult(_0x2980d1,null))[_0x8795('0x18')](handleError(_0x2980d1,null));};exports['destroy']=function(_0x3c9c43,_0x455050){return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x3c9c43['params']['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x455050,null))[_0x8795('0xf')](function(_0x430a15){if(_0x430a15&&_0x430a15[_0x8795('0x3b')]){throw new db[(_0x8795('0xb7'))][(_0x8795('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x430a15;})['then'](removeEntity(_0x455050,null))['catch'](handleError(_0x455050,null));};exports[_0x8795('0xb9')]=function(_0x11ce25,_0x178f99){return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x11ce25[_0x8795('0x5a')]['id']}})['then'](handleEntityNotFound(_0x178f99,null))[_0x8795('0xf')](function(_0xc5e7d2){if(_0xc5e7d2){return _0xc5e7d2[_0x8795('0xb9')](_0x11ce25[_0x8795('0x5e')][_0x8795('0x6b')],_[_0x8795('0x83')](_0x11ce25[_0x8795('0x5e')],['ids','id'])||{})[_0x8795('0xba')](function(_0x483192){for(var _0x27c09d=0x0;_0x27c09d<_0x11ce25[_0x8795('0x5e')][_0x8795('0x6b')][_0x8795('0x5c')];_0x27c09d+=0x1){socket[_0x8795('0xbb')](_0x8795('0xbc'),{'UserId':Number(_0x11ce25[_0x8795('0x5e')][_0x8795('0x6b')][_0x27c09d]),'MailAccountId':Number(_0x11ce25[_0x8795('0x5a')]['id'])});}return _0x483192;});}})[_0x8795('0xf')](respondWithResult(_0x178f99,null))['catch'](handleError(_0x178f99,null));};exports[_0x8795('0xbd')]=function(_0x45b0e6,_0x2423b5){return db[_0x8795('0x44')][_0x8795('0x5d')]({'where':{'id':_0x45b0e6[_0x8795('0x5a')]['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x2423b5,null))[_0x8795('0xf')](function(_0x2f40b6){if(_0x2f40b6){return _0x2f40b6[_0x8795('0xbd')](_0x45b0e6[_0x8795('0x47')][_0x8795('0x6b')])[_0x8795('0xf')](function(){if(_['isArray'](_0x45b0e6[_0x8795('0x47')][_0x8795('0x6b')])){for(var _0x407c95=0x0;_0x407c95<_0x45b0e6['query'][_0x8795('0x6b')][_0x8795('0x5c')];_0x407c95+=0x1){socket[_0x8795('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x45b0e6[_0x8795('0x47')][_0x8795('0x6b')][_0x407c95]),'MailAccountId':Number(_0x45b0e6[_0x8795('0x5a')]['id'])});}}else{socket[_0x8795('0xbb')](_0x8795('0xbe'),{'UserId':Number(_0x45b0e6['query']['ids']),'MailAccountId':Number(_0x45b0e6[_0x8795('0x5a')]['id'])});}});}})[_0x8795('0xf')](respondWithStatusCode(_0x2423b5,null))[_0x8795('0x18')](handleError(_0x2423b5,null));};exports[_0x8795('0xbf')]=function(_0x16b8b7,_0x266ae0){var _0x4b9e4c={};var _0x28076f={};var _0x418499;var _0x1e8049;return db[_0x8795('0x44')][_0x8795('0x7b')]({'where':{'id':_0x16b8b7['params']['id']}})[_0x8795('0xf')](handleEntityNotFound(_0x266ae0,null))[_0x8795('0xf')](function(_0x1825e3){if(_0x1825e3){_0x418499=_0x1825e3;_0x28076f[_0x8795('0x4b')]=_['keys'](db[_0x8795('0xc0')][_0x8795('0x67')]);_0x28076f[_0x8795('0x47')]=_['keys'](_0x16b8b7[_0x8795('0x47')]);_0x28076f[_0x8795('0x49')]=_[_0x8795('0x4a')](_0x28076f[_0x8795('0x4b')],_0x28076f[_0x8795('0x47')]);_0x4b9e4c[_0x8795('0x4d')]=_['intersection'](_0x28076f['model'],qs[_0x8795('0x4c')](_0x16b8b7[_0x8795('0x47')][_0x8795('0x4c')]));_0x4b9e4c['attributes']=_0x4b9e4c[_0x8795('0x4d')]['length']?_0x4b9e4c['attributes']:_0x28076f[_0x8795('0x4b')];_0x4b9e4c[_0x8795('0x50')]=qs[_0x8795('0x51')](_0x16b8b7[_0x8795('0x47')][_0x8795('0x51')]);_0x4b9e4c['where']=qs[_0x8795('0x49')](_[_0x8795('0x53')](_0x16b8b7[_0x8795('0x47')],_0x28076f[_0x8795('0x49')]));if(_0x16b8b7[_0x8795('0x47')][_0x8795('0x54')]){_0x4b9e4c[_0x8795('0x52')]=_[_0x8795('0x55')](_0x4b9e4c['where'],{'$or':_[_0x8795('0x46')](_0x4b9e4c[_0x8795('0x4d')],function(_0xefef5d){var _0x56921a={};_0x56921a[_0xefef5d]={'$like':'%'+_0x16b8b7[_0x8795('0x47')][_0x8795('0x54')]+'%'};return _0x56921a;})});}_0x4b9e4c=_[_0x8795('0x55')]({},_0x4b9e4c,_0x16b8b7[_0x8795('0x57')]);return _0x418499[_0x8795('0xbf')](_0x4b9e4c);}})[_0x8795('0xf')](function(_0x5f51b8){if(_0x5f51b8){_0x1e8049=_0x5f51b8[_0x8795('0x5c')];if(!_0x16b8b7['query'][_0x8795('0x4e')](_0x8795('0x4f'))){_0x4b9e4c[_0x8795('0x1f')]=qs[_0x8795('0x1f')](_0x16b8b7[_0x8795('0x47')]['limit']);_0x4b9e4c[_0x8795('0x1d')]=qs[_0x8795('0x1d')](_0x16b8b7[_0x8795('0x47')][_0x8795('0x1d')]);}return _0x418499[_0x8795('0xbf')](_0x4b9e4c);}})[_0x8795('0xf')](function(_0x220a23){if(_0x220a23){return _0x220a23?{'count':_0x1e8049,'rows':_0x220a23}:null;}})['then'](respondWithResult(_0x266ae0,null))['catch'](handleError(_0x266ae0,null));}; \ No newline at end of file +var _0xb07f=['getMessages','MailMessage','$gte','format','inlineCss','true','split','CmList','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','server/files/attachments','SendMail','sendMail','List\x20not\x20found','List','messageId','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','path','lodash','juice','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','request','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','info','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','user','pass','modernAuthentication','CloudProviderId','password','host','service','authentication','username','Imap','port','Smtp','index','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','MailServerOut','length','update','body','custom','secure','find','MailServerIn','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','removeAnswers','provider','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications'];(function(_0xcbd63a,_0x2a5d90){var _0x51bcff=function(_0xdeb511){while(--_0xdeb511){_0xcbd63a['push'](_0xcbd63a['shift']());}};_0x51bcff(++_0x2a5d90);}(_0xb07f,0xe6));var _0xfb07=function(_0x110708,_0x336af6){_0x110708=_0x110708-0x0;var _0x406a86=_0xb07f[_0x110708];return _0x406a86;};'use strict';var moment=require(_0xfb07('0x0'));var BPromise=require('bluebird');var util=require(_0xfb07('0x1'));var path=require(_0xfb07('0x2'));var _=require(_0xfb07('0x3'));var juice=require(_0xfb07('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xfb07('0x5'));var config=require(_0xfb07('0x6'));var db=require(_0xfb07('0x7'))['db'];config['redis']=_[_0xfb07('0x8')](config[_0xfb07('0x9')],{'host':_0xfb07('0xa'),'port':0x18eb});var socket=require(_0xfb07('0xb'))(new Redis(config[_0xfb07('0x9')]));require(_0xfb07('0xc'))[_0xfb07('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfb07('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4af898,_0x5d8a15,_0xd79e25,_0xf2356){return new BPromise(function(_0x573f98,_0x5b97b6){var _0x4f96ec=_0xf2356||client;return _0x4f96ec[_0xfb07('0xf')](_0x4af898,_0xd79e25)['then'](function(_0x3fefca){logger['info']('MailAccount,\x20%s,\x20%s',_0x5d8a15,_0xfb07('0x10'));logger[_0xfb07('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5d8a15,'request\x20sent',JSON[_0xfb07('0x12')](_0x3fefca));if(_0x3fefca[_0xfb07('0x13')]){if(_0x3fefca['error']['code']===0x1f4){logger[_0xfb07('0x13')](_0xfb07('0x14'),_0x5d8a15,_0x3fefca['error']['message']);return _0x5b97b6(_0x3fefca[_0xfb07('0x13')]['message']);}logger['error'](_0xfb07('0x14'),_0x5d8a15,_0x3fefca[_0xfb07('0x13')][_0xfb07('0x15')]);return _0x573f98(_0x3fefca[_0xfb07('0x13')]['message']);}else{logger[_0xfb07('0x16')](_0xfb07('0x14'),_0x5d8a15,'request\x20sent');_0x573f98(_0x3fefca['result'][_0xfb07('0x15')]);}})[_0xfb07('0x17')](function(_0x4e82ae){logger['error']('MailAccount,\x20%s,\x20%s',_0x5d8a15,_0x4e82ae);_0x5b97b6(_0x4e82ae);});});}function respondWithStatusCode(_0x35fc83,_0xe59f1d){_0xe59f1d=_0xe59f1d||0xcc;return function(_0x2b9183){if(_0x2b9183){return _0x35fc83[_0xfb07('0x18')](_0xe59f1d);}return _0x35fc83['status'](_0xe59f1d)[_0xfb07('0x19')]();};}function respondWithResult(_0xe4c777,_0x3ba406){_0x3ba406=_0x3ba406||0xc8;return function(_0x321ab4){if(_0x321ab4){return _0xe4c777[_0xfb07('0x1a')](_0x3ba406)[_0xfb07('0x1b')](_0x321ab4);}};}function respondWithFilteredResult(_0x32754d,_0x480997){return function(_0x4aea91){if(_0x4aea91){var _0x40d2c4=typeof _0x480997[_0xfb07('0x1c')]==='undefined'&&typeof _0x480997[_0xfb07('0x1d')]===_0xfb07('0x1e');var _0x3764c0=_0x4aea91[_0xfb07('0x1f')];var _0x3aacee=_0x40d2c4?0x0:_0x480997[_0xfb07('0x1c')];var _0x475844=_0x40d2c4?_0x4aea91[_0xfb07('0x1f')]:_0x480997['offset']+_0x480997['limit'];var _0x2a4b52;if(_0x475844>=_0x3764c0){_0x475844=_0x3764c0;_0x2a4b52=0xc8;}else{_0x2a4b52=0xce;}_0x32754d['status'](_0x2a4b52);return _0x32754d[_0xfb07('0x20')](_0xfb07('0x21'),_0x3aacee+'-'+_0x475844+'/'+_0x3764c0)[_0xfb07('0x1b')](_0x4aea91);}return null;};}function saveUpdates(_0x55a57a){return function(_0x3cbc3c){if(_0x3cbc3c){return _0x3cbc3c['update'](_0x55a57a)['then'](function(_0x287192){return _0x287192;});}return null;};}function removeEntity(_0x1eaa82){return function(_0x21d67e){if(_0x21d67e){return _0x21d67e[_0xfb07('0x22')]()[_0xfb07('0x23')](function(){var _0x3e7271=_0x21d67e[_0xfb07('0x24')]({'plain':!![]});var _0x4762d3=_0xfb07('0x25');return db[_0xfb07('0x26')]['destroy']({'where':{'type':_0x4762d3,'resourceId':_0x3e7271['id']}})[_0xfb07('0x23')](function(){return _0x21d67e;});})['then'](function(){_0x1eaa82[_0xfb07('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2953aa){return function(_0x5a402a){if(!_0x5a402a){_0x2953aa[_0xfb07('0x18')](0x194);}return _0x5a402a;};}function handleError(_0x1e9659,_0x499bb7){_0x499bb7=_0x499bb7||0x1f4;return function(_0x3a0057){logger[_0xfb07('0x13')](_0x3a0057[_0xfb07('0x27')]);if(_0x3a0057[_0xfb07('0x28')]){delete _0x3a0057[_0xfb07('0x28')];}_0x1e9659[_0xfb07('0x1a')](_0x499bb7)[_0xfb07('0x29')](_0x3a0057);};}function getImapHost(_0xf1f95e){switch(_0xf1f95e){case _0xfb07('0x2a'):return'imap.gmail.com';case'yahoo':return _0xfb07('0x2b');case _0xfb07('0x2c'):return _0xfb07('0x2d');case _0xfb07('0x2e'):return _0xfb07('0x2f');}throw new Error(_0xfb07('0x30'),_0xf1f95e);}function getSmtpHost(_0x1b1cac){switch(_0x1b1cac){case _0xfb07('0x2a'):return _0xfb07('0x31');case'yahoo':return'smtp.mail.yahoo.com';case _0xfb07('0x2c'):return _0xfb07('0x32');case'outlook365':return'smtp.office365.com';}throw new Error(_0xfb07('0x30'),_0x1b1cac);}function getAuthenticationOptions(_0x4d8df3,_0x5c2b3c){var _0x1ecaf5={};var _0x35dcbb={};if(_0x4d8df3){_0x1ecaf5[_0xfb07('0x33')]=_0x35dcbb[_0xfb07('0x33')]=_0x5c2b3c['username'];_0x1ecaf5['password']=_0x35dcbb[_0xfb07('0x34')]=_0x5c2b3c['password'];if(_0x5c2b3c[_0xfb07('0x35')]){_0x1ecaf5['modernAuthentication']=_0x35dcbb['modernAuthentication']=!![];_0x1ecaf5[_0xfb07('0x36')]=_0x35dcbb[_0xfb07('0x36')]=_0x5c2b3c[_0xfb07('0x36')];_0x1ecaf5[_0xfb07('0x37')]=_0x35dcbb['pass']=null;}else{_0x1ecaf5['CloudProviderId']=_0x35dcbb[_0xfb07('0x36')]=null;}_0x1ecaf5[_0xfb07('0x38')]=getImapHost(_0x4d8df3);_0x1ecaf5['port']=0x3e1;_0x35dcbb[_0xfb07('0x38')]=getSmtpHost(_0x4d8df3);_0x35dcbb['port']=0x24b;_0x35dcbb['secure']=![];_0x1ecaf5[_0xfb07('0x39')]=_0x35dcbb[_0xfb07('0x39')]=null;}else{if(_0x5c2b3c[_0xfb07('0x3a')]){_0x1ecaf5[_0xfb07('0x33')]=_0x35dcbb[_0xfb07('0x33')]=_0x5c2b3c[_0xfb07('0x3b')];_0x1ecaf5[_0xfb07('0x37')]=_0x35dcbb[_0xfb07('0x34')]=_0x5c2b3c[_0xfb07('0x37')];}else{_0x1ecaf5[_0xfb07('0x3a')]=_0x35dcbb[_0xfb07('0x3a')]=![];_0x1ecaf5['user']=_0x35dcbb[_0xfb07('0x33')]=null;_0x1ecaf5[_0xfb07('0x37')]=_0x35dcbb[_0xfb07('0x34')]=null;}_0x1ecaf5[_0xfb07('0x38')]=_0x5c2b3c[_0xfb07('0x3c')][_0xfb07('0x38')];_0x1ecaf5[_0xfb07('0x3d')]=_0x5c2b3c[_0xfb07('0x3c')][_0xfb07('0x3d')];_0x35dcbb[_0xfb07('0x38')]=_0x5c2b3c[_0xfb07('0x3e')][_0xfb07('0x38')];_0x35dcbb['port']=_0x5c2b3c[_0xfb07('0x3e')][_0xfb07('0x3d')];}return{'Imap':_0x1ecaf5,'Smtp':_0x35dcbb};}exports[_0xfb07('0x3f')]=function(_0x189ebc,_0x27a1de){var _0x525136={'include':[{'model':db['MailServerIn'],'as':_0xfb07('0x3c')},{'model':db['MailServerOut'],'as':_0xfb07('0x3e')},{'model':db[_0xfb07('0x40')],'as':_0xfb07('0x41')}]},_0x59ce7e={},_0x1ebab3={'count':0x0,'rows':[]};var _0x594f8e=_[_0xfb07('0x42')](db[_0xfb07('0x43')][_0xfb07('0x44')],function(_0x31dd4e){return{'name':_0x31dd4e['fieldName'],'type':_0x31dd4e[_0xfb07('0x45')][_0xfb07('0x46')]};});_0x59ce7e['model']=_[_0xfb07('0x42')](_0x594f8e,'name');_0x59ce7e['query']=_[_0xfb07('0x47')](_0x189ebc[_0xfb07('0x48')]);_0x59ce7e[_0xfb07('0x49')]=_[_0xfb07('0x4a')](_0x59ce7e['model'],_0x59ce7e[_0xfb07('0x48')]);_0x525136['attributes']=_[_0xfb07('0x4a')](_0x59ce7e[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x189ebc[_0xfb07('0x48')][_0xfb07('0x4c')]));_0x525136[_0xfb07('0x4d')]=_0x525136[_0xfb07('0x4d')]['length']?_0x525136[_0xfb07('0x4d')]:_0x59ce7e[_0xfb07('0x4b')];if(!_0x189ebc[_0xfb07('0x48')]['hasOwnProperty'](_0xfb07('0x4e'))){_0x525136[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x189ebc[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x525136[_0xfb07('0x1c')]=qs[_0xfb07('0x1c')](_0x189ebc[_0xfb07('0x48')][_0xfb07('0x1c')]);}_0x525136[_0xfb07('0x4f')]=qs[_0xfb07('0x50')](_0x189ebc[_0xfb07('0x48')][_0xfb07('0x50')]);_0x525136['where']=qs['filters'](_[_0xfb07('0x51')](_0x189ebc[_0xfb07('0x48')],_0x59ce7e['filters']),_0x594f8e);if(_0x189ebc['query'][_0xfb07('0x52')]){_0x525136['where']=_[_0xfb07('0x53')](_0x525136[_0xfb07('0x54')],{'$or':_[_0xfb07('0x42')](_0x594f8e,function(_0x5d7917){if(_0x5d7917[_0xfb07('0x45')]!==_0xfb07('0x55')){var _0x1814ed={};_0x1814ed[_0x5d7917[_0xfb07('0x28')]]={'$like':'%'+_0x189ebc[_0xfb07('0x48')][_0xfb07('0x52')]+'%'};return _0x1814ed;}})});}_0x525136=_[_0xfb07('0x53')]({},_0x525136,_0x189ebc[_0xfb07('0x56')]);var _0xc434aa={'where':_0x525136['where']};return db[_0xfb07('0x43')]['count'](_0xc434aa)['then'](function(_0x34dd99){_0x1ebab3['count']=_0x34dd99;if(_0x189ebc[_0xfb07('0x48')][_0xfb07('0x57')]){_0x525136[_0xfb07('0x58')]=[{'all':!![]}];}return db[_0xfb07('0x43')][_0xfb07('0x59')](_0x525136);})[_0xfb07('0x23')](function(_0x1ffe4b){_0x1ebab3[_0xfb07('0x5a')]=_0x1ffe4b;return _0x1ebab3;})[_0xfb07('0x23')](respondWithFilteredResult(_0x27a1de,_0x525136))[_0xfb07('0x17')](handleError(_0x27a1de,null));};exports['show']=function(_0xb92a75,_0x275132){var _0x4649c5={'raw':![],'where':{'id':_0xb92a75[_0xfb07('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xfb07('0x3c')},{'model':db[_0xfb07('0x5c')],'as':'Smtp'},{'model':db[_0xfb07('0x40')],'as':_0xfb07('0x41')}]},_0x238b1c={};_0x238b1c[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db[_0xfb07('0x43')][_0xfb07('0x44')]);_0x238b1c[_0xfb07('0x48')]=_[_0xfb07('0x47')](_0xb92a75['query']);_0x238b1c[_0xfb07('0x49')]=_[_0xfb07('0x4a')](_0x238b1c[_0xfb07('0x4b')],_0x238b1c[_0xfb07('0x48')]);_0x4649c5[_0xfb07('0x4d')]=_[_0xfb07('0x4a')](_0x238b1c['model'],qs['fields'](_0xb92a75[_0xfb07('0x48')][_0xfb07('0x4c')]));_0x4649c5[_0xfb07('0x4d')]=_0x4649c5[_0xfb07('0x4d')][_0xfb07('0x5d')]?_0x4649c5[_0xfb07('0x4d')]:_0x238b1c[_0xfb07('0x4b')];if(_0xb92a75[_0xfb07('0x48')][_0xfb07('0x57')]){_0x4649c5['include']=[{'all':!![]}];}_0x4649c5=_[_0xfb07('0x53')]({},_0x4649c5,_0xb92a75[_0xfb07('0x56')]);return db[_0xfb07('0x43')]['find'](_0x4649c5)[_0xfb07('0x23')](handleEntityNotFound(_0x275132,null))[_0xfb07('0x23')](respondWithResult(_0x275132,null))['catch'](handleError(_0x275132,null));};exports[_0xfb07('0x5e')]=function(_0x22129e,_0x19d3dc){if(_0x22129e[_0xfb07('0x5f')]['id']){delete _0x22129e[_0xfb07('0x5f')]['id'];}var _0x4e8173=_0x22129e[_0xfb07('0x5f')]['provider']===_0xfb07('0x60')?null:_0x22129e[_0xfb07('0x5f')]['provider'];var _0x43230f=_0x22129e['body']['Imap']||{};var _0x52cd7b=_0x22129e['body']['Smtp']||{};if(_0x4e8173){_0x43230f[_0xfb07('0x38')]=getImapHost(_0x4e8173);_0x43230f[_0xfb07('0x3d')]=0x3e1;_0x52cd7b[_0xfb07('0x38')]=getSmtpHost(_0x4e8173);_0x52cd7b['port']=0x24b;_0x52cd7b[_0xfb07('0x61')]=![];}if(_0x52cd7b[_0xfb07('0x35')]){_0x52cd7b[_0xfb07('0x61')]=![];}else{_0x52cd7b[_0xfb07('0x36')]=null;}if(!_0x43230f[_0xfb07('0x35')])_0x43230f[_0xfb07('0x36')]=null;_0x22129e['body'][_0xfb07('0x3c')]=_0x43230f;_0x22129e['body'][_0xfb07('0x3e')]=_0x52cd7b;return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x22129e[_0xfb07('0x5b')]['id']},'include':[{'model':db[_0xfb07('0x63')],'as':'Imap'},{'model':db[_0xfb07('0x5c')],'as':_0xfb07('0x3e')},{'model':db[_0xfb07('0x40')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x19d3dc,null))[_0xfb07('0x23')](function(_0x21c06d){if(!_0x21c06d)throw new Error(_0xfb07('0x64'));if(_0x21c06d['service'])delete _0x22129e['body'][_0xfb07('0x3c')];return _0x21c06d;})['then'](saveUpdates(_0x22129e['body'],null))[_0xfb07('0x23')](function(_0xbeb9e){if(!_0x22129e[_0xfb07('0x5f')][_0xfb07('0x3c')])return _0xbeb9e;return db[_0xfb07('0x63')]['update'](_0x22129e['body']['Imap'],{'where':{'MailAccountId':_0xbeb9e['id']}})['then'](function(){return _0xbeb9e;});})[_0xfb07('0x23')](function(_0x4cbee8){if(!_0x22129e[_0xfb07('0x5f')]['Smtp'])return _0x4cbee8;return db[_0xfb07('0x5c')]['update'](_0x22129e['body']['Smtp'],{'where':{'MailAccountId':_0x4cbee8['id']}})[_0xfb07('0x23')](function(){return _0x4cbee8;});})['then'](respondWithResult(_0x19d3dc,null))['catch'](handleError(_0x19d3dc,null));};exports['describe']=function(_0x26158c,_0x3a7839){return db[_0xfb07('0x43')][_0xfb07('0x65')]()['then'](respondWithResult(_0x3a7839,null))[_0xfb07('0x17')](handleError(_0x3a7839,null));};exports['addDisposition']=function(_0xbe8e22,_0x1d5329){if(_0xbe8e22[_0xfb07('0x5f')]['id']){delete _0xbe8e22[_0xfb07('0x5f')]['id'];}return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0xbe8e22[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x1d5329,null))[_0xfb07('0x23')](function(_0x23c0e2){if(_0x23c0e2){_0xbe8e22[_0xfb07('0x5f')][_0xfb07('0x66')]=_0x23c0e2['id'];return db[_0xfb07('0x67')][_0xfb07('0x68')](_0xbe8e22[_0xfb07('0x5f')]);}})[_0xfb07('0x23')](respondWithResult(_0x1d5329,null))['catch'](handleError(_0x1d5329,null));};exports[_0xfb07('0x69')]=function(_0x1b700d,_0x14f15e){var _0x59c729={'raw':![],'where':{}};var _0x32dd57={};var _0x3fe63c={'count':0x0,'rows':[]};return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x1b700d[_0xfb07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x14f15e,null))['then'](function(_0x410ef0){if(_0x410ef0){_0x32dd57['model']=_[_0xfb07('0x47')](db[_0xfb07('0x67')][_0xfb07('0x44')]);_0x32dd57[_0xfb07('0x48')]=_[_0xfb07('0x47')](_0x1b700d['query']);_0x32dd57[_0xfb07('0x49')]=_[_0xfb07('0x4a')](_0x32dd57[_0xfb07('0x4b')],_0x32dd57['query']);_0x59c729[_0xfb07('0x4d')]=_[_0xfb07('0x4a')](_0x32dd57[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x1b700d['query'][_0xfb07('0x4c')]));_0x59c729[_0xfb07('0x4d')]=_0x59c729['attributes'][_0xfb07('0x5d')]?_0x59c729[_0xfb07('0x4d')]:_0x32dd57[_0xfb07('0x4b')];if(!_0x1b700d['query'][_0xfb07('0x6b')](_0xfb07('0x4e'))){_0x59c729[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x1b700d[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x59c729['offset']=qs[_0xfb07('0x1c')](_0x1b700d['query'][_0xfb07('0x1c')]);}_0x59c729[_0xfb07('0x4f')]=qs['sort'](_0x1b700d[_0xfb07('0x48')][_0xfb07('0x50')]);_0x59c729['where']=qs[_0xfb07('0x49')](_['pick'](_0x1b700d['query'],_0x32dd57[_0xfb07('0x49')]));_0x59c729[_0xfb07('0x54')]['MailAccountId']=_0x410ef0['id'];if(_0x1b700d[_0xfb07('0x48')][_0xfb07('0x52')]){_0x59c729[_0xfb07('0x54')]=_[_0xfb07('0x53')](_0x59c729[_0xfb07('0x54')],{'$or':_['map'](_0x59c729[_0xfb07('0x4d')],function(_0x5f5f29){var _0x233be1={};_0x233be1[_0x5f5f29]={'$like':'%'+_0x1b700d[_0xfb07('0x48')][_0xfb07('0x52')]+'%'};return _0x233be1;})});}_0x59c729=_[_0xfb07('0x53')]({},_0x59c729,_0x1b700d['options']);return db[_0xfb07('0x67')][_0xfb07('0x1f')]({'where':_0x59c729[_0xfb07('0x54')]})[_0xfb07('0x23')](function(_0xb5be65){_0x3fe63c[_0xfb07('0x1f')]=_0xb5be65;if(_0x1b700d[_0xfb07('0x48')][_0xfb07('0x57')]){_0x59c729['include']=[{'all':!![]}];}return db[_0xfb07('0x67')]['findAll'](_0x59c729);})['then'](function(_0x5c0054){_0x3fe63c[_0xfb07('0x5a')]=_0x5c0054;return _0x3fe63c;});}})['then'](respondWithFilteredResult(_0x14f15e,_0x59c729))[_0xfb07('0x17')](handleError(_0x14f15e,null));};exports[_0xfb07('0x6c')]=function(_0x15c2bf,_0x596fee){return db['MailAccount'][_0xfb07('0x62')]({'where':{'id':_0x15c2bf[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x596fee,null))[_0xfb07('0x23')](function(_0x4b4976){if(_0x4b4976){return _0x4b4976['removeDispositions'](_0x15c2bf[_0xfb07('0x48')][_0xfb07('0x6d')]);}})['then'](respondWithStatusCode(_0x596fee,null))[_0xfb07('0x17')](handleError(_0x596fee,null));};exports['addAnswer']=function(_0x567976,_0x686ec7){if(_0x567976[_0xfb07('0x5f')]['id']){delete _0x567976[_0xfb07('0x5f')]['id'];}return db['MailAccount'][_0xfb07('0x62')]({'where':{'id':_0x567976['params']['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x686ec7,null))[_0xfb07('0x23')](function(_0x211e94){if(_0x211e94){_0x567976[_0xfb07('0x5f')]['MailAccountId']=_0x211e94['id'];return db[_0xfb07('0x6e')]['create'](_0x567976[_0xfb07('0x5f')]);}})[_0xfb07('0x23')](respondWithResult(_0x686ec7,null))[_0xfb07('0x17')](handleError(_0x686ec7,null));};exports['getAnswers']=function(_0x488852,_0x112216){var _0x53831b={'raw':![],'where':{}};var _0x3a87f6={};var _0x5c34f9={'count':0x0,'rows':[]};return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x488852[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x112216,null))['then'](function(_0x1cd8b1){if(_0x1cd8b1){_0x3a87f6[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db[_0xfb07('0x6e')][_0xfb07('0x44')]);_0x3a87f6['query']=_[_0xfb07('0x47')](_0x488852[_0xfb07('0x48')]);_0x3a87f6[_0xfb07('0x49')]=_['intersection'](_0x3a87f6[_0xfb07('0x4b')],_0x3a87f6['query']);_0x53831b[_0xfb07('0x4d')]=_[_0xfb07('0x4a')](_0x3a87f6[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x488852[_0xfb07('0x48')]['fields']));_0x53831b[_0xfb07('0x4d')]=_0x53831b[_0xfb07('0x4d')][_0xfb07('0x5d')]?_0x53831b['attributes']:_0x3a87f6[_0xfb07('0x4b')];if(!_0x488852[_0xfb07('0x48')][_0xfb07('0x6b')]('nolimit')){_0x53831b[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x488852[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x53831b[_0xfb07('0x1c')]=qs[_0xfb07('0x1c')](_0x488852[_0xfb07('0x48')][_0xfb07('0x1c')]);}_0x53831b['order']=qs[_0xfb07('0x50')](_0x488852[_0xfb07('0x48')][_0xfb07('0x50')]);_0x53831b[_0xfb07('0x54')]=qs[_0xfb07('0x49')](_[_0xfb07('0x51')](_0x488852[_0xfb07('0x48')],_0x3a87f6[_0xfb07('0x49')]));_0x53831b[_0xfb07('0x54')][_0xfb07('0x66')]=_0x1cd8b1['id'];if(_0x488852[_0xfb07('0x48')][_0xfb07('0x52')]){_0x53831b['where']=_[_0xfb07('0x53')](_0x53831b[_0xfb07('0x54')],{'$or':_[_0xfb07('0x42')](_0x53831b[_0xfb07('0x4d')],function(_0x2d95fc){var _0x1ec430={};_0x1ec430[_0x2d95fc]={'$like':'%'+_0x488852[_0xfb07('0x48')][_0xfb07('0x52')]+'%'};return _0x1ec430;})});}_0x53831b=_[_0xfb07('0x53')]({},_0x53831b,_0x488852[_0xfb07('0x56')]);return db[_0xfb07('0x6e')]['count']({'where':_0x53831b[_0xfb07('0x54')]})['then'](function(_0x237a2d){_0x5c34f9[_0xfb07('0x1f')]=_0x237a2d;if(_0x488852[_0xfb07('0x48')][_0xfb07('0x57')]){_0x53831b[_0xfb07('0x58')]=[{'all':!![]}];}return db[_0xfb07('0x6e')]['findAll'](_0x53831b);})[_0xfb07('0x23')](function(_0x202bff){_0x5c34f9[_0xfb07('0x5a')]=_0x202bff;return _0x5c34f9;});}})[_0xfb07('0x23')](respondWithFilteredResult(_0x112216,_0x53831b))['catch'](handleError(_0x112216,null));};exports[_0xfb07('0x6f')]=function(_0x349996,_0x36683a){return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x349996[_0xfb07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36683a,null))[_0xfb07('0x23')](function(_0x1a6c81){if(_0x1a6c81){return _0x1a6c81[_0xfb07('0x6f')](_0x349996['query'][_0xfb07('0x6d')]);}})[_0xfb07('0x23')](respondWithStatusCode(_0x36683a,null))[_0xfb07('0x17')](handleError(_0x36683a,null));};exports[_0xfb07('0x68')]=function(_0x430510,_0x364108){var _0x9f2400={'name':_0x430510[_0xfb07('0x5f')][_0xfb07('0x28')],'key':_0x430510['body']['key'],'provider':_0x430510[_0xfb07('0x5f')][_0xfb07('0x70')]==='custom'?null:_0x430510[_0xfb07('0x5f')][_0xfb07('0x70')],'email':_0x430510[_0xfb07('0x5f')]['email'],'ListId':_0x430510['body'][_0xfb07('0x71')],'active':!_[_0xfb07('0x72')](_0x430510[_0xfb07('0x5f')][_0xfb07('0x73')])?_0x430510[_0xfb07('0x5f')]['active']:!![],'description':_0x430510[_0xfb07('0x5f')]['description']||null};var _0x46b72e=getAuthenticationOptions(_0x9f2400[_0xfb07('0x70')],_0x430510[_0xfb07('0x5f')]);_0x9f2400[_0xfb07('0x3c')]=_0x46b72e[_0xfb07('0x3c')];_0x9f2400[_0xfb07('0x3e')]=_0x46b72e[_0xfb07('0x3e')];return db['MailAccount'][_0xfb07('0x68')](_0x9f2400,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xfb07('0x63')],'as':_0xfb07('0x3c')}]})['then'](function(_0x3d4eca){var _0x1169f3=_0x430510[_0xfb07('0x33')]['get']({'plain':!![]});if(!_0x1169f3)throw new Error(_0xfb07('0x74'));if(_0x1169f3['role']===_0xfb07('0x33')){var _0x2c60ab=_0x3d4eca[_0xfb07('0x24')]({'plain':!![]});return db[_0xfb07('0x75')]['find']({'where':{'name':_0xfb07('0x25'),'userProfileId':_0x1169f3[_0xfb07('0x76')]},'raw':!![]})[_0xfb07('0x23')](function(_0x44e5f0){if(_0x44e5f0&&_0x44e5f0[_0xfb07('0x77')]===0x0){return db[_0xfb07('0x26')][_0xfb07('0x68')]({'name':_0x2c60ab[_0xfb07('0x28')],'resourceId':_0x2c60ab['id'],'type':_0x44e5f0[_0xfb07('0x28')],'sectionId':_0x44e5f0['id']},{})[_0xfb07('0x23')](function(){return _0x3d4eca;});}else{return _0x3d4eca;}})[_0xfb07('0x17')](function(_0x11470c){logger['error'](_0xfb07('0x78'),_0x11470c);throw _0x11470c;});}return _0x3d4eca;})[_0xfb07('0x23')](respondWithResult(_0x364108,0xc9))[_0xfb07('0x17')](handleError(_0x364108,null));};exports[_0xfb07('0x79')]=function(_0x49519a,_0x23d598){return db['MailAccount'][_0xfb07('0x6a')]({'where':{'id':_0x49519a[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x23d598,null))['then'](function(_0x36b6dd){if(_0x36b6dd){return _0x36b6dd[_0xfb07('0x79')]();}return null;})[_0xfb07('0x23')](respondWithResult(_0x23d598,null))['catch'](handleError(_0x23d598,null));};exports[_0xfb07('0x7a')]=function(_0x5ed646,_0x5592c9){if(_0x5ed646[_0xfb07('0x5f')]['id']){delete _0x5ed646[_0xfb07('0x5f')]['id'];}return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x5ed646['params']['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x5592c9,null))[_0xfb07('0x23')](function(_0x46b3e5){if(_0x46b3e5){_0x5ed646[_0xfb07('0x5f')]['MailAccountId']=_0x46b3e5['id'];return db[_0xfb07('0x63')][_0xfb07('0x68')](_0x5ed646[_0xfb07('0x5f')]);}})['then'](respondWithResult(_0x5592c9,null))[_0xfb07('0x17')](handleError(_0x5592c9,null));};exports['removeImap']=function(_0x20534a,_0x222bc2){return db[_0xfb07('0x43')]['findOne']({'where':{'id':_0x20534a[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x222bc2,null))['then'](function(_0x233c0b){if(_0x233c0b){return _0x233c0b[_0xfb07('0x7b')](null);}return null;})[_0xfb07('0x23')](respondWithStatusCode(_0x222bc2,null))[_0xfb07('0x17')](handleError(_0x222bc2,null));};exports[_0xfb07('0x7c')]=function(_0x582753,_0x43b383){return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x582753[_0xfb07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x43b383,null))[_0xfb07('0x23')](function(_0x50dfbe){if(_0x50dfbe){return _0x50dfbe['getSmtp']();}return null;})['then'](respondWithResult(_0x43b383,null))['catch'](handleError(_0x43b383,null));};exports[_0xfb07('0x7d')]=function(_0x50221b,_0xf53ef3){if(_0x50221b[_0xfb07('0x5f')]['id']){delete _0x50221b['body']['id'];}return db[_0xfb07('0x43')]['find']({'where':{'id':_0x50221b[_0xfb07('0x5b')]['id']}})['then'](handleEntityNotFound(_0xf53ef3,null))[_0xfb07('0x23')](function(_0x3086a5){if(_0x3086a5){_0x50221b[_0xfb07('0x5f')][_0xfb07('0x66')]=_0x3086a5['id'];return db[_0xfb07('0x5c')]['create'](_0x50221b[_0xfb07('0x5f')]);}})['then'](respondWithResult(_0xf53ef3,null))[_0xfb07('0x17')](handleError(_0xf53ef3,null));};exports[_0xfb07('0x7e')]=function(_0x446bd3,_0x2c2a8c){return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x446bd3[_0xfb07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2c2a8c,null))['then'](function(_0x55ca08){if(_0x55ca08){return _0x55ca08[_0xfb07('0x7f')](null);}return null;})[_0xfb07('0x23')](respondWithStatusCode(_0x2c2a8c,null))[_0xfb07('0x17')](handleError(_0x2c2a8c,null));};exports[_0xfb07('0x80')]=function(_0x4d545a,_0x461c1f){return db[_0xfb07('0x81')][_0xfb07('0x62')]({'where':{'id':_0x4d545a['params']['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x461c1f,null))['then'](function(_0x22520a){if(_0x22520a){return _0x22520a['addInteraction'](_0x4d545a['body'][_0xfb07('0x6d')],_['omit'](_0x4d545a[_0xfb07('0x5f')],[_0xfb07('0x6d'),'id'])||{});}})[_0xfb07('0x23')](respondWithResult(_0x461c1f,null))[_0xfb07('0x17')](handleError(_0x461c1f,null));};exports[_0xfb07('0x82')]=function(_0x2fdff4,_0x384608){var _0x262774={'raw':![],'where':{}};var _0x5a3f41={};var _0x21607a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2fdff4[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x384608,null))[_0xfb07('0x23')](function(_0x190481){if(_0x190481){_0x5a3f41[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db['MailInteraction'][_0xfb07('0x44')]);_0x5a3f41['query']=_[_0xfb07('0x47')](_0x2fdff4[_0xfb07('0x48')]);_0x5a3f41[_0xfb07('0x49')]=_[_0xfb07('0x4a')](_0x5a3f41[_0xfb07('0x4b')],_0x5a3f41[_0xfb07('0x48')]);_0x262774[_0xfb07('0x4d')]=_[_0xfb07('0x4a')](_0x5a3f41['model'],qs[_0xfb07('0x4c')](_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x4c')]));_0x262774[_0xfb07('0x4d')]=_0x262774[_0xfb07('0x4d')][_0xfb07('0x5d')]?_0x262774[_0xfb07('0x4d')]:_0x5a3f41[_0xfb07('0x4b')];if(!_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x6b')](_0xfb07('0x4e'))){_0x262774[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x262774[_0xfb07('0x1c')]=qs[_0xfb07('0x1c')](_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x1c')]);}_0x262774[_0xfb07('0x4f')]=qs[_0xfb07('0x50')](_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x50')]);_0x262774['where']=qs[_0xfb07('0x49')](_[_0xfb07('0x51')](_0x2fdff4[_0xfb07('0x48')],_0x5a3f41[_0xfb07('0x49')]));_0x262774[_0xfb07('0x54')][_0xfb07('0x66')]=_0x190481['id'];if(_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x52')]){_0x262774[_0xfb07('0x54')]=_[_0xfb07('0x53')](_0x262774[_0xfb07('0x54')],{'$or':_[_0xfb07('0x42')](_0x262774['attributes'],function(_0x378d94){var _0xa44235={};_0xa44235[_0x378d94]={'$like':'%'+_0x2fdff4['query'][_0xfb07('0x52')]+'%'};return _0xa44235;})});}_0x262774=_[_0xfb07('0x53')]({},_0x262774,_0x2fdff4[_0xfb07('0x56')]);return db[_0xfb07('0x81')]['count']({'where':_0x262774[_0xfb07('0x54')]})[_0xfb07('0x23')](function(_0x28f0d9){_0x21607a[_0xfb07('0x1f')]=_0x28f0d9;if(_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x57')]){_0x262774[_0xfb07('0x58')]=[{'model':db[_0xfb07('0x83')],'as':_0xfb07('0x84'),'required':![]},{'model':db['User'],'as':_0xfb07('0x85'),'attributes':[_0xfb07('0x28'),_0xfb07('0x86'),_0xfb07('0x87')],'required':![]},{'model':db[_0xfb07('0x88')],'as':_0xfb07('0x89'),'attributes':['id','name',_0xfb07('0x8a')],'where':_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x8b')]?{'id':_0x2fdff4['query'][_0xfb07('0x8b')]}:undefined,'required':_0x2fdff4[_0xfb07('0x48')][_0xfb07('0x8b')]?!![]:![]}];}return db[_0xfb07('0x81')][_0xfb07('0x59')](_0x262774);})['then'](function(_0x489461){_0x21607a['rows']=_0x489461;return _0x21607a;});}})[_0xfb07('0x23')](respondWithFilteredResult(_0x384608,_0x262774))[_0xfb07('0x17')](handleError(_0x384608,null));};exports['addApplications']=function addApplications(_0x53f1be,_0x2bd8a2){var _0x38d87f=_0x53f1be[_0xfb07('0x5b')]['id'];var _0x4a486c=_0x53f1be['body'];var _0x14f247=0xc8;var _0x554d25=null;return db[_0xfb07('0x8c')][_0xfb07('0x8d')]({'isolationLevel':db['sequelize'][_0xfb07('0x8e')][_0xfb07('0x8f')][_0xfb07('0x90')]},function(_0x5ef0b4){return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x38d87f},'transaction':_0x5ef0b4})['then'](function(_0x5d61dc){if(_0x5d61dc){return db[_0xfb07('0x91')][_0xfb07('0x22')]({'where':{'MailAccountId':_0x38d87f},'transaction':_0x5ef0b4})['then'](function(){var _0x963b7e=_[_0xfb07('0x42')](_0x4a486c,function(_0xe39395){_0xe39395[_0xfb07('0x66')]=_0x38d87f;return _0xe39395;});return db[_0xfb07('0x91')][_0xfb07('0x92')](_0x963b7e,{'transaction':_0x5ef0b4});});}else{_0x14f247=0x194;_0x554d25=[];}});})[_0xfb07('0x23')](function(){if(_0x14f247!==0x194){return db[_0xfb07('0x91')][_0xfb07('0x93')]({'where':{'MailAccountId':_0x38d87f},'order':_0xfb07('0x94')})['then'](function(_0x32f9ee){_0x554d25=_0x32f9ee;});}})[_0xfb07('0x17')](function(_0x41668b){_0x14f247=0x1f4;logger[_0xfb07('0x13')](_0x41668b[_0xfb07('0x27')]);if(_0x41668b['name']){delete _0x41668b[_0xfb07('0x28')];}_0x554d25=_0x41668b;})['finally'](function(){if(_0x554d25===null){_0x2bd8a2['sendStatus'](_0x14f247);}else{if(_0x14f247===0x1f4){_0x2bd8a2[_0xfb07('0x1a')](_0x14f247)[_0xfb07('0x29')](_0x554d25);}else{_0x2bd8a2[_0xfb07('0x1a')](_0x14f247)[_0xfb07('0x1b')](_0x554d25);}}});};exports[_0xfb07('0x95')]=function(_0x185a8a,_0x12d721){var _0x113c7d={};var _0x52af28={};var _0x16f38f;var _0x470b10;return db[_0xfb07('0x43')]['findOne']({'where':{'id':_0x185a8a['params']['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x12d721,null))['then'](function(_0x32da44){if(_0x32da44){_0x16f38f=_0x32da44;_0x52af28[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db['MailApplication'][_0xfb07('0x44')]);_0x52af28[_0xfb07('0x48')]=_['keys'](_0x185a8a[_0xfb07('0x48')]);_0x52af28[_0xfb07('0x49')]=_['intersection'](_0x52af28['model'],_0x52af28['query']);_0x113c7d[_0xfb07('0x4d')]=_['intersection'](_0x52af28[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x185a8a[_0xfb07('0x48')]['fields']));_0x113c7d[_0xfb07('0x4d')]=_0x113c7d['attributes'][_0xfb07('0x5d')]?_0x113c7d['attributes']:_0x52af28[_0xfb07('0x4b')];_0x113c7d[_0xfb07('0x4f')]=qs[_0xfb07('0x50')](_0x185a8a[_0xfb07('0x48')][_0xfb07('0x50')]);_0x113c7d['where']=qs['filters'](_['pick'](_0x185a8a[_0xfb07('0x48')],_0x52af28['filters']));if(_0x185a8a[_0xfb07('0x48')]['filter']){_0x113c7d[_0xfb07('0x54')]=_[_0xfb07('0x53')](_0x113c7d[_0xfb07('0x54')],{'$or':_['map'](_0x113c7d[_0xfb07('0x4d')],function(_0xbd7313){var _0x342452={};_0x342452[_0xbd7313]={'$like':'%'+_0x185a8a[_0xfb07('0x48')][_0xfb07('0x52')]+'%'};return _0x342452;})});}_0x113c7d=_['merge']({},_0x113c7d,_0x185a8a[_0xfb07('0x56')]);return _0x16f38f['getApplications'](_0x113c7d);}})[_0xfb07('0x23')](function(_0x17ce46){if(_0x17ce46){_0x470b10=_0x17ce46[_0xfb07('0x5d')];if(!_0x185a8a[_0xfb07('0x48')][_0xfb07('0x6b')]('nolimit')){_0x113c7d[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x185a8a[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x113c7d['offset']=qs['offset'](_0x185a8a['query'][_0xfb07('0x1c')]);}return _0x16f38f[_0xfb07('0x95')](_0x113c7d);}})[_0xfb07('0x23')](function(_0x23e28e){if(_0x23e28e){return _0x23e28e?{'count':_0x470b10,'rows':_0x23e28e}:null;}})['then'](respondWithResult(_0x12d721,null))[_0xfb07('0x17')](handleError(_0x12d721,null));};exports[_0xfb07('0x96')]=function(_0x517896,_0x55b4c8){var _0x4f119d={'raw':!![],'where':{}};var _0xc636b8={};var _0x17b7f8={'count':0x0,'rows':[]};return db[_0xfb07('0x43')]['findOne']({'where':{'id':_0x517896[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x55b4c8,null))['then'](function(_0x3dd272){if(_0x3dd272){_0xc636b8[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db[_0xfb07('0x97')]['rawAttributes']);_0xc636b8['query']=_[_0xfb07('0x47')](_0x517896[_0xfb07('0x48')]);_0xc636b8['filters']=_['intersection'](_0xc636b8[_0xfb07('0x4b')],_0xc636b8[_0xfb07('0x48')]);_0x4f119d['attributes']=_[_0xfb07('0x4a')](_0xc636b8[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x517896[_0xfb07('0x48')][_0xfb07('0x4c')]));_0x4f119d[_0xfb07('0x4d')]=_0x4f119d[_0xfb07('0x4d')]['length']?_0x4f119d[_0xfb07('0x4d')]:_0xc636b8[_0xfb07('0x4b')];if(!_0x517896[_0xfb07('0x48')][_0xfb07('0x6b')](_0xfb07('0x4e'))){_0x4f119d[_0xfb07('0x1d')]=qs['limit'](_0x517896[_0xfb07('0x48')][_0xfb07('0x1d')]);_0x4f119d[_0xfb07('0x1c')]=qs[_0xfb07('0x1c')](_0x517896['query'][_0xfb07('0x1c')]);}_0x4f119d[_0xfb07('0x4f')]=qs[_0xfb07('0x50')](_0x517896[_0xfb07('0x48')][_0xfb07('0x50')]);_0x4f119d[_0xfb07('0x54')]=qs[_0xfb07('0x49')](_['pick'](_0x517896['query'],_0xc636b8[_0xfb07('0x49')]));_0x4f119d['where']['MailAccountId']=_0x3dd272['id'];if(_0x517896[_0xfb07('0x48')][_0xfb07('0x52')]){_0x4f119d['where']=_['merge'](_0x4f119d[_0xfb07('0x54')],{'$or':_['map'](_0x4f119d[_0xfb07('0x4d')],function(_0x3cd8f2){var _0x1473e6={};_0x1473e6[_0x3cd8f2]={'$like':'%'+_0x517896[_0xfb07('0x48')][_0xfb07('0x52')]+'%'};return _0x1473e6;})});}if(_0x517896[_0xfb07('0x48')][_0xfb07('0x98')]){var _0x1baaa3=_0x517896[_0xfb07('0x48')][_0xfb07('0x98')]['split'](',');var _0x15355c={};_0x15355c[_0x1baaa3[0x0]]={'$gte':moment(_0x1baaa3[0x1])[_0xfb07('0x99')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4f119d[_0xfb07('0x54')]=_[_0xfb07('0x53')](_0x4f119d['where'],_0x15355c);}_0x4f119d=_[_0xfb07('0x53')]({},_0x4f119d,_0x517896[_0xfb07('0x56')]);return db['MailMessage'][_0xfb07('0x1f')]({'where':_0x4f119d[_0xfb07('0x54')]})['then'](function(_0x5e3a7e){_0x17b7f8['count']=_0x5e3a7e;if(_0x517896[_0xfb07('0x48')][_0xfb07('0x57')]){_0x4f119d[_0xfb07('0x58')]=[{'all':!![]}];}return db[_0xfb07('0x97')][_0xfb07('0x59')](_0x4f119d);})[_0xfb07('0x23')](function(_0x2223b2){if(_0x517896[_0xfb07('0x48')][_0xfb07('0x9a')]===_0xfb07('0x9b')){for(var _0x2719f0=0x0;_0x2719f0<_0x2223b2[_0xfb07('0x5d')];_0x2719f0++){_0x2223b2[_0x2719f0][_0xfb07('0x5f')]=juice(_0x2223b2[_0x2719f0]['body']);}}_0x17b7f8[_0xfb07('0x5a')]=_0x2223b2;return _0x17b7f8;});}})[_0xfb07('0x23')](respondWithFilteredResult(_0x55b4c8,_0x4f119d))['catch'](handleError(_0x55b4c8,null));};exports['send']=function(_0x3c7529,_0x37cc62){var _0x1fa7f8,_0x5bedb9={},_0x151556;if(_0x3c7529['body']['to']){_0x151556=_0x3c7529[_0xfb07('0x5f')]['to'][_0xfb07('0x9c')](',')[0x0];}return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x3c7529['params']['id']},'include':[{'model':db[_0xfb07('0x9d')],'as':'List','include':[{'model':db[_0xfb07('0x83')],'as':_0xfb07('0x9e'),'where':{'email':_0x151556},'limit':0x1,'order':[['updatedAt',_0xfb07('0x9f')]]}]},{'model':db['MailServerOut'],'as':_0xfb07('0x3e'),'raw':!![],'include':[{'model':db[_0xfb07('0xa0')],'as':_0xfb07('0xa0'),'raw':!![]}]}]})[_0xfb07('0x23')](handleEntityNotFound(_0x37cc62,null))[_0xfb07('0x23')](function(_0x493a57){if(!_0x493a57)return;_0x1fa7f8=_0x493a57;if(!_0x493a57[_0xfb07('0x3e')])throw new Error(_0xfb07('0xa1'));if(_['isNil'](_0x3c7529[_0xfb07('0x5f')][_0xfb07('0xa2')])){_0x3c7529['body'][_0xfb07('0xa2')]=util[_0xfb07('0x99')](_0xfb07('0xa3'),_0x493a57[_0xfb07('0x28')],_0x493a57[_0xfb07('0xa4')]||_0x493a57['Smtp'][_0xfb07('0x33')]);}if(_0x3c7529[_0xfb07('0x5f')][_0xfb07('0xa5')]&&_0x3c7529[_0xfb07('0x5f')][_0xfb07('0xa5')][_0xfb07('0x5d')]){for(var _0x39bc11=0x0;_0x39bc11<_0x3c7529['body'][_0xfb07('0xa5')][_0xfb07('0x5d')];_0x39bc11+=0x1){_0x3c7529['body'][_0xfb07('0xa5')][_0x39bc11]={'filename':_0x3c7529['body'][_0xfb07('0xa5')][_0x39bc11][_0xfb07('0x28')],'path':path[_0xfb07('0xa6')](config['root'],_0xfb07('0xa7'),_0x3c7529[_0xfb07('0x5f')][_0xfb07('0xa5')][_0x39bc11]['basename'])};}}var _0x59f64c=_0x493a57['getSmtpOptions']();return respondWithRpcPromise(_0xfb07('0xa8'),_0xfb07('0xa9'),{'account':_0x59f64c,'message':_0x3c7529['body']});})[_0xfb07('0x23')](function(_0x253d84){if(!_0x253d84)return;_0x5bedb9=_0x253d84;if(!_0x1fa7f8['List'])throw new Error(_0xfb07('0xaa'));if(_0x1fa7f8['List']['Contacts'][_0xfb07('0x5d')])return _0x1fa7f8[_0xfb07('0xab')][_0xfb07('0x9e')][0x0];return db[_0xfb07('0x83')]['create'](_[_0xfb07('0x8')](_0x3c7529[_0xfb07('0x5f')],{'firstName':_0x3c7529['body']['to'],'email':_0x3c7529[_0xfb07('0x5f')]['to'],'phone':_0x3c7529['body']['to'],'ListId':_0x1fa7f8[_0xfb07('0x71')]}));})[_0xfb07('0x23')](function(_0x43711c){if(!_0x43711c)return;var _0x349c87={'UserId':_0x3c7529['user']['id'],'ContactId':_0x43711c['id'],'MailAccountId':_0x1fa7f8['id'],'inReplyTo':_0x5bedb9[_0xfb07('0xac')],'to':_0x3c7529['body']['from'],'cc':_0x3c7529[_0xfb07('0x5f')]['cc'],'subject':_0x3c7529[_0xfb07('0x5f')]['subject'],'attach':_0x3c7529[_0xfb07('0x5f')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xfb07('0x99')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xfb07('0xad'),'Messages':[_['merge'](_0x3c7529[_0xfb07('0x5f')],{'messageId':_0x5bedb9[_0xfb07('0xac')],'sentAt':moment()[_0xfb07('0x99')](_0xfb07('0xae')),'read':!![],'MailAccountId':_0x1fa7f8['id'],'UserId':_0x3c7529[_0xfb07('0x33')]['id'],'ContactId':_0x43711c['id']})]};if(_0x3c7529[_0xfb07('0x5f')][_0xfb07('0xaf')]){_0x349c87=_[_0xfb07('0x53')](_0x349c87,_0x3c7529[_0xfb07('0x5f')]['Interaction']);}return db['MailInteraction'][_0xfb07('0x68')](_0x349c87,{'include':[{'model':db[_0xfb07('0x97')],'as':_0xfb07('0xb0')}]});})[_0xfb07('0x23')](respondWithResult(_0x37cc62,null))[_0xfb07('0x17')](handleError(_0x37cc62,null));};exports[_0xfb07('0xb1')]=function(_0x251d6a,_0x2c2567){return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x251d6a['params']['id']},'include':[{'model':db[_0xfb07('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xfb07('0xa0')],'as':_0xfb07('0xa0'),'raw':!![]}]}]})[_0xfb07('0x23')](handleEntityNotFound(_0x2c2567,null))[_0xfb07('0x23')](function(_0x31155b){if(!_0x31155b[_0xfb07('0x3e')])return;var _0x42449a=_0x31155b[_0xfb07('0xb2')]();return respondWithRpcPromise(_0xfb07('0xb3'),_0xfb07('0xb1'),{'account':_0x42449a});})[_0xfb07('0x23')](respondWithResult(_0x2c2567,null))[_0xfb07('0x17')](handleError(_0x2c2567,null));};exports['destroy']=function(_0x12ef36,_0x3628b2){return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x12ef36[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x3628b2,null))[_0xfb07('0x23')](function(_0x379c5a){if(_0x379c5a&&_0x379c5a['service']){throw new db[(_0xfb07('0xb4'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x379c5a;})['then'](removeEntity(_0x3628b2,null))[_0xfb07('0x17')](handleError(_0x3628b2,null));};exports[_0xfb07('0xb5')]=function(_0x1699a7,_0x3c2b45){return db['MailAccount']['find']({'where':{'id':_0x1699a7[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x3c2b45,null))['then'](function(_0x2d5674){if(_0x2d5674){return _0x2d5674[_0xfb07('0xb5')](_0x1699a7[_0xfb07('0x5f')][_0xfb07('0x6d')],_[_0xfb07('0xb6')](_0x1699a7['body'],['ids','id'])||{})[_0xfb07('0xb7')](function(_0x5d62f8){for(var _0x461f3b=0x0;_0x461f3b<_0x1699a7[_0xfb07('0x5f')]['ids'][_0xfb07('0x5d')];_0x461f3b+=0x1){socket[_0xfb07('0xb8')]('userMailAccount:save',{'UserId':Number(_0x1699a7[_0xfb07('0x5f')][_0xfb07('0x6d')][_0x461f3b]),'MailAccountId':Number(_0x1699a7['params']['id'])});}return _0x5d62f8;});}})['then'](respondWithResult(_0x3c2b45,null))[_0xfb07('0x17')](handleError(_0x3c2b45,null));};exports[_0xfb07('0xb9')]=function(_0x56d96c,_0x384f96){return db[_0xfb07('0x43')][_0xfb07('0x62')]({'where':{'id':_0x56d96c[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x384f96,null))['then'](function(_0x257886){if(_0x257886){return _0x257886[_0xfb07('0xb9')](_0x56d96c['query']['ids'])['then'](function(){if(_[_0xfb07('0xba')](_0x56d96c[_0xfb07('0x48')]['ids'])){for(var _0x5d0d75=0x0;_0x5d0d75<_0x56d96c[_0xfb07('0x48')][_0xfb07('0x6d')][_0xfb07('0x5d')];_0x5d0d75+=0x1){socket[_0xfb07('0xb8')](_0xfb07('0xbb'),{'UserId':Number(_0x56d96c['query'][_0xfb07('0x6d')][_0x5d0d75]),'MailAccountId':Number(_0x56d96c[_0xfb07('0x5b')]['id'])});}}else{socket[_0xfb07('0xb8')](_0xfb07('0xbb'),{'UserId':Number(_0x56d96c[_0xfb07('0x48')][_0xfb07('0x6d')]),'MailAccountId':Number(_0x56d96c['params']['id'])});}});}})[_0xfb07('0x23')](respondWithStatusCode(_0x384f96,null))['catch'](handleError(_0x384f96,null));};exports[_0xfb07('0xbc')]=function(_0x3436bb,_0x39d9eb){var _0x37184c={};var _0x3337a8={};var _0x3d269e;var _0x2507f5;return db[_0xfb07('0x43')][_0xfb07('0x6a')]({'where':{'id':_0x3436bb[_0xfb07('0x5b')]['id']}})[_0xfb07('0x23')](handleEntityNotFound(_0x39d9eb,null))[_0xfb07('0x23')](function(_0x1f8964){if(_0x1f8964){_0x3d269e=_0x1f8964;_0x3337a8[_0xfb07('0x4b')]=_[_0xfb07('0x47')](db[_0xfb07('0xbd')][_0xfb07('0x44')]);_0x3337a8['query']=_[_0xfb07('0x47')](_0x3436bb[_0xfb07('0x48')]);_0x3337a8[_0xfb07('0x49')]=_['intersection'](_0x3337a8[_0xfb07('0x4b')],_0x3337a8[_0xfb07('0x48')]);_0x37184c[_0xfb07('0x4d')]=_[_0xfb07('0x4a')](_0x3337a8[_0xfb07('0x4b')],qs[_0xfb07('0x4c')](_0x3436bb['query'][_0xfb07('0x4c')]));_0x37184c[_0xfb07('0x4d')]=_0x37184c['attributes'][_0xfb07('0x5d')]?_0x37184c[_0xfb07('0x4d')]:_0x3337a8[_0xfb07('0x4b')];_0x37184c[_0xfb07('0x4f')]=qs['sort'](_0x3436bb[_0xfb07('0x48')][_0xfb07('0x50')]);_0x37184c[_0xfb07('0x54')]=qs[_0xfb07('0x49')](_[_0xfb07('0x51')](_0x3436bb['query'],_0x3337a8['filters']));if(_0x3436bb[_0xfb07('0x48')][_0xfb07('0x52')]){_0x37184c[_0xfb07('0x54')]=_[_0xfb07('0x53')](_0x37184c['where'],{'$or':_[_0xfb07('0x42')](_0x37184c['attributes'],function(_0x524c8d){var _0x1f25a1={};_0x1f25a1[_0x524c8d]={'$like':'%'+_0x3436bb['query'][_0xfb07('0x52')]+'%'};return _0x1f25a1;})});}_0x37184c=_['merge']({},_0x37184c,_0x3436bb[_0xfb07('0x56')]);return _0x3d269e[_0xfb07('0xbc')](_0x37184c);}})[_0xfb07('0x23')](function(_0x475217){if(_0x475217){_0x2507f5=_0x475217[_0xfb07('0x5d')];if(!_0x3436bb[_0xfb07('0x48')][_0xfb07('0x6b')](_0xfb07('0x4e'))){_0x37184c[_0xfb07('0x1d')]=qs[_0xfb07('0x1d')](_0x3436bb[_0xfb07('0x48')]['limit']);_0x37184c['offset']=qs[_0xfb07('0x1c')](_0x3436bb[_0xfb07('0x48')]['offset']);}return _0x3d269e['getAgents'](_0x37184c);}})[_0xfb07('0x23')](function(_0xa7b604){if(_0xa7b604){return _0xa7b604?{'count':_0x2507f5,'rows':_0xa7b604}:null;}})['then'](respondWithResult(_0x39d9eb,null))[_0xfb07('0x17')](handleError(_0x39d9eb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index cceeeb6..963123e 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 _0xe260=['remove','emit','hook','exports','events','MailAccount','setMaxListeners','save','update'];(function(_0x4b42f6,_0x2ef964){var _0x25d871=function(_0x1ec61d){while(--_0x1ec61d){_0x4b42f6['push'](_0x4b42f6['shift']());}};_0x25d871(++_0x2ef964);}(_0xe260,0x94));var _0x0e26=function(_0x82e02c,_0x5e1d8a){_0x82e02c=_0x82e02c-0x0;var _0x372042=_0xe260[_0x82e02c];return _0x372042;};'use strict';var EventEmitter=require(_0x0e26('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x0e26('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0e26('0x2')](0x0);var events={'afterCreate':_0x0e26('0x3'),'afterUpdate':_0x0e26('0x4'),'afterDestroy':_0x0e26('0x5')};function emitEvent(_0x16613c){return function(_0x4a2388,_0x937f2a,_0x141a58){MailAccountEvents[_0x0e26('0x6')](_0x16613c+':'+_0x4a2388['id'],_0x4a2388);MailAccountEvents['emit'](_0x16613c,_0x4a2388);_0x141a58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x0e26('0x7')](e,emitEvent(event));}}module[_0x0e26('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x9df5=['exports','events','../../mysqldb','MailAccount','update','emit','hook'];(function(_0x1db413,_0xc971e4){var _0x30ff34=function(_0x10d9bf){while(--_0x10d9bf){_0x1db413['push'](_0x1db413['shift']());}};_0x30ff34(++_0xc971e4);}(_0x9df5,0x9b));var _0x59df=function(_0x2de1b0,_0x48681c){_0x2de1b0=_0x2de1b0-0x0;var _0x3aef9e=_0x9df5[_0x2de1b0];return _0x3aef9e;};'use strict';var EventEmitter=require(_0x59df('0x0'));var MailAccount=require(_0x59df('0x1'))['db'][_0x59df('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x59df('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3dee4f){return function(_0x4e7910,_0xd96d42,_0x2b478c){MailAccountEvents[_0x59df('0x4')](_0x3dee4f+':'+_0x4e7910['id'],_0x4e7910);MailAccountEvents[_0x59df('0x4')](_0x3dee4f,_0x4e7910);_0x2b478c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x59df('0x5')](e,emitEvent(event));}}module[_0x59df('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ffc3b10..5b7c141 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 _0x18a1=['exports','define','MailAccount','provider','service','host','port','Smtp','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','data5','auth','user'];(function(_0x5a3b64,_0x3c20dd){var _0x2b3983=function(_0x58a445){while(--_0x58a445){_0x5a3b64['push'](_0x5a3b64['shift']());}};_0x2b3983(++_0x3c20dd);}(_0x18a1,0x1a4));var _0x118a=function(_0x1f2db2,_0x2d3f58){_0x1f2db2=_0x1f2db2-0x0;var _0x47f05b=_0x18a1[_0x1f2db2];return _0x47f05b;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x118a('0x0')]=function(_0x25dcbd){return _0x25dcbd[_0x118a('0x1')](_0x118a('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x22b731=this;var _0x2c0b65={'id':_0x22b731['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22b731[_0x118a('0x3')]!=='custom'){_0x2c0b65[_0x118a('0x4')]=_0x22b731[_0x118a('0x3')];}else{_0x2c0b65[_0x118a('0x5')]=_0x22b731['Smtp'][_0x118a('0x5')];_0x2c0b65[_0x118a('0x6')]=_0x22b731[_0x118a('0x7')][_0x118a('0x6')];_0x2c0b65[_0x118a('0x8')]=_0x22b731[_0x118a('0x7')][_0x118a('0x8')];}if(_0x22b731[_0x118a('0x7')][_0x118a('0x9')]){if(_0x22b731[_0x118a('0x7')][_0x118a('0xa')]){if(!_0x22b731[_0x118a('0x7')]['CloudProvider'])throw new Error(_0x118a('0xb'));_0x2c0b65['auth']={'type':'OAuth2','user':_0x22b731[_0x118a('0x7')]['user'],'accessToken':_0x22b731['Smtp']['CloudProvider'][_0x118a('0xc')]};}else{_0x2c0b65[_0x118a('0xd')]={'user':_0x22b731[_0x118a('0x7')][_0x118a('0xe')],'pass':_0x22b731[_0x118a('0x7')]['pass']};}}return _0x2c0b65;}}});}; \ No newline at end of file +var _0xa4b0=['MailAccount','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','pass','exports','define'];(function(_0x167214,_0x5c57c3){var _0x3e9391=function(_0x13ef03){while(--_0x13ef03){_0x167214['push'](_0x167214['shift']());}};_0x3e9391(++_0x5c57c3);}(_0xa4b0,0x1a7));var _0x0a4b=function(_0x2a9866,_0x48a165){_0x2a9866=_0x2a9866-0x0;var _0x574f95=_0xa4b0[_0x2a9866];return _0x574f95;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x0a4b('0x0')]=function(_0x33f776){return _0x33f776[_0x0a4b('0x1')](_0x0a4b('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2c41b2=this;var _0x3f7947={'id':_0x2c41b2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2c41b2[_0x0a4b('0x3')]!==_0x0a4b('0x4')){_0x3f7947[_0x0a4b('0x5')]=_0x2c41b2[_0x0a4b('0x3')];}else{_0x3f7947[_0x0a4b('0x6')]=_0x2c41b2[_0x0a4b('0x7')]['host'];_0x3f7947[_0x0a4b('0x8')]=_0x2c41b2['Smtp'][_0x0a4b('0x8')];_0x3f7947[_0x0a4b('0x9')]=_0x2c41b2['Smtp'][_0x0a4b('0x9')];}if(_0x2c41b2[_0x0a4b('0x7')]['authentication']){if(_0x2c41b2[_0x0a4b('0x7')][_0x0a4b('0xa')]){if(!_0x2c41b2[_0x0a4b('0x7')][_0x0a4b('0xb')])throw new Error(_0x0a4b('0xc'));_0x3f7947[_0x0a4b('0xd')]={'type':_0x0a4b('0xe'),'user':_0x2c41b2['Smtp']['user'],'accessToken':_0x2c41b2['Smtp'][_0x0a4b('0xb')][_0x0a4b('0xf')]};}else{_0x3f7947[_0x0a4b('0xd')]={'user':_0x2c41b2[_0x0a4b('0x7')]['user'],'pass':_0x2c41b2[_0x0a4b('0x7')][_0x0a4b('0x10')]};}}return _0x3f7947;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4b144e3..f1ce879 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 _0xe015=['lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch','find','then','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','get','getSmtpOptions','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','contact','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','spread','interaction','created','subject','attachments','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting'];(function(_0x14ac65,_0xd253be){var _0x25fece=function(_0x6305bc){while(--_0x6305bc){_0x14ac65['push'](_0x14ac65['shift']());}};_0x25fece(++_0xd253be);}(_0xe015,0x13b));var _0x5e01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe015[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5e01('0x0'));var moment=require(_0x5e01('0x1'));var BPromise=require(_0x5e01('0x2'));var rs=require('randomstring');var Redis=require('ioredis');var db=require(_0x5e01('0x3'))['db'];var logger=require('../../config/logger')(_0x5e01('0x4'));var config=require(_0x5e01('0x5'));var jayson=require(_0x5e01('0x6'));var client=jayson[_0x5e01('0x7')]['http']({'port':0x232c});config[_0x5e01('0x8')]=_[_0x5e01('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e01('0xa'))(new Redis(config[_0x5e01('0x8')]));require(_0x5e01('0xb'))[_0x5e01('0xc')](socket);function respondWithRpcPromise(_0x4a39b1,_0x36bd7e,_0x5b3938){return new BPromise(function(_0x1c4a44,_0x502518){return client[_0x5e01('0xd')](_0x4a39b1,_0x5b3938)['then'](function(_0x3c2ea2){logger[_0x5e01('0xe')]('MailAccount,\x20%s,\x20%s',_0x36bd7e,_0x5e01('0xf'));logger[_0x5e01('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x36bd7e,'request\x20sent',JSON[_0x5e01('0x11')](_0x3c2ea2));if(_0x3c2ea2[_0x5e01('0x12')]){if(_0x3c2ea2[_0x5e01('0x12')][_0x5e01('0x13')]===0x1f4){logger[_0x5e01('0x12')](_0x5e01('0x14'),_0x36bd7e,_0x3c2ea2['error'][_0x5e01('0x15')]);return _0x502518(_0x3c2ea2['error']['message']);}logger[_0x5e01('0x12')](_0x5e01('0x14'),_0x36bd7e,_0x3c2ea2['error'][_0x5e01('0x15')]);return _0x1c4a44(_0x3c2ea2['error'][_0x5e01('0x15')]);}else{logger['info'](_0x5e01('0x14'),_0x36bd7e,'request\x20sent');_0x1c4a44(_0x3c2ea2[_0x5e01('0x16')]['message']);}})['catch'](function(_0x35a002){logger[_0x5e01('0x12')]('MailAccount,\x20%s,\x20%s',_0x36bd7e,_0x35a002);_0x502518(_0x35a002);});});}exports[_0x5e01('0x17')]=function(_0x2df752){var _0x36b4a7=this;return new Promise(function(_0x45e543,_0x396cf3){return db[_0x5e01('0x18')][_0x5e01('0x19')]({'raw':_0x2df752[_0x5e01('0x1a')]?_0x2df752['options'][_0x5e01('0x1b')]===undefined?!![]:![]:!![],'where':_0x2df752[_0x5e01('0x1a')]?_0x2df752['options'][_0x5e01('0x1c')]||null:null,'attributes':_0x2df752[_0x5e01('0x1a')]?_0x2df752[_0x5e01('0x1a')][_0x5e01('0x1d')]||null:null,'limit':_0x2df752[_0x5e01('0x1a')]?_0x2df752[_0x5e01('0x1a')]['limit']||null:null,'include':_0x2df752[_0x5e01('0x1a')]?_0x2df752[_0x5e01('0x1a')][_0x5e01('0x1e')]?_[_0x5e01('0x1f')](_0x2df752['options'][_0x5e01('0x1e')],function(_0x23264f){return{'model':db[_0x23264f[_0x5e01('0x20')]],'as':_0x23264f['as'],'attributes':_0x23264f['attributes'],'include':_0x23264f[_0x5e01('0x1e')]?_[_0x5e01('0x1f')](_0x23264f[_0x5e01('0x1e')],function(_0x28344a){return{'model':db[_0x28344a['model']],'as':_0x28344a['as'],'attributes':_0x28344a['attributes'],'include':_0x28344a[_0x5e01('0x1e')]?_['map'](_0x28344a[_0x5e01('0x1e')],function(_0x1332bb){return{'model':db[_0x1332bb[_0x5e01('0x20')]],'as':_0x1332bb['as'],'attributes':_0x1332bb[_0x5e01('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x531f0a){logger['info']('GetMailAccount',_0x2df752);logger[_0x5e01('0x10')]('GetMailAccount',_0x2df752,JSON[_0x5e01('0x11')](_0x531f0a));_0x45e543(_0x531f0a);})[_0x5e01('0x21')](function(_0xc6d3c2){logger['error'](_0x5e01('0x17'),_0xc6d3c2[_0x5e01('0x15')],_0x2df752);_0x396cf3(_0x36b4a7[_0x5e01('0x12')](0x1f4,_0xc6d3c2[_0x5e01('0x15')]));});});};exports['ShowMailAccount']=function(_0x5f263e){var _0x15c62b=this;return new Promise(function(_0x99e40e,_0x308649){return db[_0x5e01('0x18')][_0x5e01('0x22')]({'raw':_0x5f263e[_0x5e01('0x1a')]?_0x5f263e[_0x5e01('0x1a')][_0x5e01('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f263e[_0x5e01('0x1a')]?_0x5f263e[_0x5e01('0x1a')][_0x5e01('0x1c')]||null:null,'attributes':_0x5f263e[_0x5e01('0x1a')]?_0x5f263e['options'][_0x5e01('0x1d')]||null:null,'include':_0x5f263e[_0x5e01('0x1a')]?_0x5f263e[_0x5e01('0x1a')]['include']?_[_0x5e01('0x1f')](_0x5f263e[_0x5e01('0x1a')]['include'],function(_0x3cc642){return{'model':db[_0x3cc642[_0x5e01('0x20')]],'as':_0x3cc642['as'],'attributes':_0x3cc642[_0x5e01('0x1d')],'include':_0x3cc642['include']?_[_0x5e01('0x1f')](_0x3cc642[_0x5e01('0x1e')],function(_0x19c4ae){return{'model':db[_0x19c4ae[_0x5e01('0x20')]],'as':_0x19c4ae['as'],'attributes':_0x19c4ae[_0x5e01('0x1d')],'include':_0x19c4ae[_0x5e01('0x1e')]?_[_0x5e01('0x1f')](_0x19c4ae[_0x5e01('0x1e')],function(_0x94d4ee){return{'model':db[_0x94d4ee[_0x5e01('0x20')]],'as':_0x94d4ee['as'],'attributes':_0x94d4ee[_0x5e01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e01('0x23')](function(_0x20f3c6){if(_0x5f263e[_0x5e01('0x1a')][_0x5e01('0x24')]===!![])_0x20f3c6['setDataValue'](_0x5e01('0x25'),_0x20f3c6['getSmtpOptions']());logger['info'](_0x5e01('0x26'),_0x5f263e);logger[_0x5e01('0x10')](_0x5e01('0x26'),_0x5f263e,JSON[_0x5e01('0x11')](_0x20f3c6));_0x99e40e(_0x20f3c6);})[_0x5e01('0x21')](function(_0x4b8523){logger[_0x5e01('0x12')](_0x5e01('0x26'),_0x4b8523['message'],_0x5f263e);_0x308649(_0x15c62b[_0x5e01('0x12')](0x1f4,_0x4b8523[_0x5e01('0x15')]));});});};exports[_0x5e01('0x27')]=function(_0x4aeb11){var _0x1109ca=this;return new Promise(function(_0xfed2d2,_0x503c8c){var _0x1500da={'body':_0x4aeb11[_0x5e01('0x28')],'channel':'mail'};var _0x59c570=_[_0x5e01('0x29')](_['keys'](db[_0x5e01('0x2a')][_0x5e01('0x2b')]),[_0x5e01('0x2c'),_0x5e01('0x2d'),'CompanyId',_0x5e01('0x2e')]);var _0xb93846=![];if(_0x4aeb11[_0x5e01('0x28')]['id']){delete _0x4aeb11[_0x5e01('0x28')]['id'];}if(_[_0x5e01('0x2f')](_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x30')])){return _0x503c8c(_0x1109ca['error'](0x1f4,_0x5e01('0x31')));}if(_[_0x5e01('0x2f')](_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x28')])||_0x4aeb11[_0x5e01('0x28')]['body']===''){return _0x503c8c(_0x1109ca[_0x5e01('0x12')](0x1f4,_0x5e01('0x32')));}if(_[_0x5e01('0x2f')](_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x33')])){return _0x503c8c(_0x1109ca[_0x5e01('0x12')](0x1f4,_0x5e01('0x34')+_0x59c570));}if(!_['includes'](_0x59c570,_0x4aeb11[_0x5e01('0x28')]['mapKey'])){return _0x503c8c(_0x1109ca[_0x5e01('0x12')](0x1f4,_0x5e01('0x35')+_0x59c570));}var _0x43c29b={};_0x43c29b[_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x33')]]=_0x4aeb11[_0x5e01('0x28')]['from'];return db[_0x5e01('0x18')]['find']({'where':{'id':_0x4aeb11[_0x5e01('0x36')]['id']},'include':[{'model':db[_0x5e01('0x37')],'as':_0x5e01('0x38'),'include':[{'model':db[_0x5e01('0x2a')],'as':_0x5e01('0x39'),'where':_0x43c29b,'limit':0x1,'order':[[_0x5e01('0x2d'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x5e01('0x3a')},{'model':db[_0x5e01('0x3b')],'as':_0x5e01('0x3c'),'include':[{'model':db[_0x5e01('0x3d')],'as':_0x5e01('0x3d')}]}]})[_0x5e01('0x23')](function(_0x661d){if(_0x661d&&_0x661d[_0x5e01('0x38')]){var _0xfd1153=_0x661d[_0x5e01('0x3e')]({'plain':!![]});_0x1500da[_0x5e01('0x36')]=_['omit'](_0xfd1153,[_0x5e01('0x3a'),_0x5e01('0x38')]);_0x1500da[_0x5e01('0x36')]['smtpOptions']=_0x661d[_0x5e01('0x3f')]();_0x1500da[_0x5e01('0x40')]=_0xfd1153[_0x5e01('0x3a')];_0x1500da[_0x5e01('0x41')]=_0xfd1153[_0x5e01('0x38')];_0x1500da['applications']=_[_0x5e01('0x42')](_0x1500da['applications'],[_0x5e01('0x43')],[_0x5e01('0x44')]);if(_0x1500da[_0x5e01('0x36')]&&_0x1500da[_0x5e01('0x36')][_0x5e01('0x45')]){_0x1500da[_0x5e01('0x40')][_0x5e01('0x46')]({'id':0x0,'priority':_0x1500da[_0x5e01('0x40')][_0x5e01('0x47')]+0x1,'app':'close','appdata':_0x5e01('0x45'),'interval':_0x5e01('0x48')});}if(_0x1500da[_0x5e01('0x36')][_0x5e01('0x3a')]){delete _0x1500da[_0x5e01('0x36')][_0x5e01('0x3a')];}if(_0x1500da['account'][_0x5e01('0x38')]){delete _0x1500da['account'][_0x5e01('0x38')];}if(_0xfd1153[_0x5e01('0x38')][_0x5e01('0x39')]['length']){return _0xfd1153[_0x5e01('0x38')][_0x5e01('0x39')][0x0];}var _0x534bf0=_[_0x5e01('0x9')](_0x4aeb11['body'],{'firstName':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x30')],'ListId':_0xfd1153[_0x5e01('0x2e')]});_0x534bf0[_0x4aeb11[_0x5e01('0x28')]['mapKey']]=_0x4aeb11[_0x5e01('0x28')]['from'];return db['CmContact'][_0x5e01('0x49')](_0x534bf0);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x26863b){_0x1500da[_0x5e01('0x4a')]=_0x26863b;if(_0x26863b){if(!_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x4b')]){_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x4b')]=rs['generate']()+'\x20'+_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['from'];}var _0x9f5e19={'ContactId':_0x26863b['id'],'MailAccountId':_0x4aeb11[_0x5e01('0x36')]['id'],'inReplyTo':_0x4aeb11['body'][_0x5e01('0x15')][_0x5e01('0x4b')],'to':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x30')],'cc':_0x4aeb11['body'][_0x5e01('0x15')]['cc'],'subject':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['subject'],'attach':_0x4aeb11[_0x5e01('0x28')]['message'][_0x5e01('0x4c')],'lastMsgAt':moment()[_0x5e01('0x4d')](_0x5e01('0x4e')),'lastMsgDirection':'in'};return db[_0x5e01('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0x4aeb11['account']['id']},'include':[{'model':db[_0x5e01('0x50')],'as':_0x5e01('0x51'),'attributes':['messageId'],'where':{'messageId':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['inReplyTo']}}]})[_0x5e01('0x23')](function(_0x1be0ca){if(_0x1be0ca){return[_0x1be0ca,![]];}return db[_0x5e01('0x4f')][_0x5e01('0x49')](_0x9f5e19)[_0x5e01('0x23')](function(_0x534114){return[_0x534114,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5e01('0x52')](function(_0x278323,_0x45ddb8){if(_0x278323){_0xb93846=_0x45ddb8;if(!_0x45ddb8){return _0x278323['update']({'inReplyTo':_0x4aeb11[_0x5e01('0x28')]['message'][_0x5e01('0x4b')],'to':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x30')],'cc':_0x4aeb11['body'][_0x5e01('0x15')]['cc'],'subject':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['subject'],'attach':_0x278323['attach']?_0x278323[_0x5e01('0x4c')]:_0x4aeb11[_0x5e01('0x28')]['message'][_0x5e01('0x4c')],'substatus':null,'substatusAt':moment()['format'](_0x5e01('0x4e')),'lastMsgAt':moment()[_0x5e01('0x4d')](_0x5e01('0x4e')),'lastMsgDirection':'in'});}else{return _0x278323;}}})['then'](function(_0x439ffb){_0x1500da[_0x5e01('0x53')]=_0x439ffb[_0x5e01('0x3e')]({'plain':!![]});_0x1500da['interaction'][_0x5e01('0x54')]=_0xb93846;return db[_0x5e01('0x50')][_0x5e01('0x49')]({'body':_0x4aeb11['body']['body'],'MailAccountId':_0x4aeb11[_0x5e01('0x36')]['id'],'MailInteractionId':_0x439ffb['id'],'direction':'in','ContactId':_0x1500da['contact']['id'],'messageId':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x4b')],'from':_0x4aeb11[_0x5e01('0x28')]['message']['from'],'to':_0x4aeb11[_0x5e01('0x28')]['message']['to'],'cc':_0x4aeb11['body']['message']['cc'],'subject':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x55')],'attach':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['attach'],'Attachments':_0x4aeb11['body'][_0x5e01('0x15')][_0x5e01('0x56')],'originTo':_0x4aeb11['body'][_0x5e01('0x15')][_0x5e01('0x57')],'originCc':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')]['originCc'],'bcc':_0x4aeb11['body'][_0x5e01('0x15')][_0x5e01('0x58')],'ChatWebsiteId':_0x4aeb11[_0x5e01('0x28')][_0x5e01('0x15')][_0x5e01('0x59')]||null,'originChannel':_0x4aeb11['body'][_0x5e01('0x15')]['originChannel']||_0x5e01('0x5a'),'ChatOfflineMessageId':_0x4aeb11['body'][_0x5e01('0x15')][_0x5e01('0x5b')]||null},{'include':[{'model':db[_0x5e01('0x5c')],'as':_0x5e01('0x5d')}]});})[_0x5e01('0x23')](function(_0x5b58d3){_0x1500da[_0x5e01('0x15')]=_0x5b58d3;if(!_0x1500da[_0x5e01('0x53')][_0x5e01('0x5e')]){return;}return db[_0x5e01('0x5f')][_0x5e01('0x22')]({'attributes':['id',_0x5e01('0x60')],'where':{'id':_0x1500da[_0x5e01('0x53')]['UserId']}});})['then'](function(_0x244407){if(_0x244407){_0x1500da['applications'][_0x5e01('0x61')]({'id':0x0,'priority':0x0,'app':_0x5e01('0x62'),'appdata':_0x244407[_0x5e01('0x60')]+','+(_0x1500da[_0x5e01('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x5e01('0x48')});}if(!_0x1500da[_0x5e01('0x53')][_0x5e01('0x63')]){return;}return db[_0x5e01('0x64')][_0x5e01('0x22')]({'attributes':['id',_0x5e01('0x60')],'where':{'id':_0x1500da[_0x5e01('0x53')][_0x5e01('0x63')]}});})[_0x5e01('0x23')](function(_0x4bd138){if(_0x4bd138){_0x1500da[_0x5e01('0x40')][_0x5e01('0x61')]({'id':0x0,'priority':0x1,'app':_0x5e01('0x65'),'appdata':_0x4bd138['name']+','+(_0x1500da[_0x5e01('0x36')][_0x5e01('0x66')]||0x12c),'interval':_0x5e01('0x48')});}return respondWithRpcPromise(_0x5e01('0x67'),_0x5e01('0x68'),_0x1500da);})['then'](function(_0x53c42a){_0xfed2d2(_0x53c42a);})[_0x5e01('0x21')](function(_0x5679d5){_0x503c8c(_0x1109ca[_0x5e01('0x12')](0x1f4,_0x5679d5['message']));});});}; \ No newline at end of file +var _0xdbb1=['mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','List','Contacts','DESC','Applications','CloudProvider','get','getSmtpOptions','applications','orderBy','priority','autoclose','length','close','*,*,*,*','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','Contact\x20not\x20found','spread','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','name','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','ioredis','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x8f82df,_0x4ad0e9){var _0x19212a=function(_0xa30958){while(--_0xa30958){_0x8f82df['push'](_0x8f82df['shift']());}};_0x19212a(++_0x4ad0e9);}(_0xdbb1,0x105));var _0x1dbb=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xdbb1[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x1dbb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x1dbb('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1dbb('0x2'));var config=require('../../config/environment');var jayson=require(_0x1dbb('0x3'));var client=jayson[_0x1dbb('0x4')]['http']({'port':0x232c});config['redis']=_[_0x1dbb('0x5')](config[_0x1dbb('0x6')],{'host':_0x1dbb('0x7'),'port':0x18eb});var socket=require(_0x1dbb('0x8'))(new Redis(config['redis']));require(_0x1dbb('0x9'))[_0x1dbb('0xa')](socket);function respondWithRpcPromise(_0x5d2d5c,_0x208220,_0x232c1c){return new BPromise(function(_0x1e7ac5,_0x3ce7e9){return client[_0x1dbb('0xb')](_0x5d2d5c,_0x232c1c)[_0x1dbb('0xc')](function(_0x111841){logger[_0x1dbb('0xd')](_0x1dbb('0xe'),_0x208220,_0x1dbb('0xf'));logger[_0x1dbb('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x208220,_0x1dbb('0xf'),JSON[_0x1dbb('0x11')](_0x111841));if(_0x111841[_0x1dbb('0x12')]){if(_0x111841[_0x1dbb('0x12')]['code']===0x1f4){logger['error'](_0x1dbb('0xe'),_0x208220,_0x111841[_0x1dbb('0x12')][_0x1dbb('0x13')]);return _0x3ce7e9(_0x111841[_0x1dbb('0x12')][_0x1dbb('0x13')]);}logger['error'](_0x1dbb('0xe'),_0x208220,_0x111841[_0x1dbb('0x12')][_0x1dbb('0x13')]);return _0x1e7ac5(_0x111841['error'][_0x1dbb('0x13')]);}else{logger[_0x1dbb('0xd')]('MailAccount,\x20%s,\x20%s',_0x208220,_0x1dbb('0xf'));_0x1e7ac5(_0x111841[_0x1dbb('0x14')][_0x1dbb('0x13')]);}})[_0x1dbb('0x15')](function(_0xb21bc5){logger[_0x1dbb('0x12')](_0x1dbb('0xe'),_0x208220,_0xb21bc5);_0x3ce7e9(_0xb21bc5);});});}exports[_0x1dbb('0x16')]=function(_0x58aa43){var _0x550dd4=this;return new Promise(function(_0x4802ba,_0x4248d7){return db[_0x1dbb('0x17')]['findAll']({'raw':_0x58aa43[_0x1dbb('0x18')]?_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x19')]===undefined?!![]:![]:!![],'where':_0x58aa43[_0x1dbb('0x18')]?_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x1a')]||null:null,'attributes':_0x58aa43[_0x1dbb('0x18')]?_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x1b')]||null:null,'limit':_0x58aa43[_0x1dbb('0x18')]?_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x1c')]||null:null,'include':_0x58aa43[_0x1dbb('0x18')]?_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x1d')]?_[_0x1dbb('0x1e')](_0x58aa43[_0x1dbb('0x18')][_0x1dbb('0x1d')],function(_0x18f188){return{'model':db[_0x18f188['model']],'as':_0x18f188['as'],'attributes':_0x18f188[_0x1dbb('0x1b')],'include':_0x18f188['include']?_[_0x1dbb('0x1e')](_0x18f188['include'],function(_0x72cfed){return{'model':db[_0x72cfed[_0x1dbb('0x1f')]],'as':_0x72cfed['as'],'attributes':_0x72cfed[_0x1dbb('0x1b')],'include':_0x72cfed[_0x1dbb('0x1d')]?_[_0x1dbb('0x1e')](_0x72cfed[_0x1dbb('0x1d')],function(_0x5e5059){return{'model':db[_0x5e5059[_0x1dbb('0x1f')]],'as':_0x5e5059['as'],'attributes':_0x5e5059[_0x1dbb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1dbb('0xc')](function(_0x4c0a9d){logger['info'](_0x1dbb('0x16'),_0x58aa43);logger['debug']('GetMailAccount',_0x58aa43,JSON[_0x1dbb('0x11')](_0x4c0a9d));_0x4802ba(_0x4c0a9d);})[_0x1dbb('0x15')](function(_0x4511b3){logger[_0x1dbb('0x12')](_0x1dbb('0x16'),_0x4511b3[_0x1dbb('0x13')],_0x58aa43);_0x4248d7(_0x550dd4[_0x1dbb('0x12')](0x1f4,_0x4511b3[_0x1dbb('0x13')]));});});};exports[_0x1dbb('0x20')]=function(_0x5126a3){var _0x4d70fc=this;return new Promise(function(_0x15672c,_0x110b7a){return db[_0x1dbb('0x17')]['find']({'raw':_0x5126a3['options']?_0x5126a3[_0x1dbb('0x18')][_0x1dbb('0x19')]===undefined?!![]:![]:!![],'where':_0x5126a3[_0x1dbb('0x18')]?_0x5126a3['options']['where']||null:null,'attributes':_0x5126a3[_0x1dbb('0x18')]?_0x5126a3[_0x1dbb('0x18')]['attributes']||null:null,'include':_0x5126a3[_0x1dbb('0x18')]?_0x5126a3[_0x1dbb('0x18')][_0x1dbb('0x1d')]?_[_0x1dbb('0x1e')](_0x5126a3['options'][_0x1dbb('0x1d')],function(_0x22e40b){return{'model':db[_0x22e40b[_0x1dbb('0x1f')]],'as':_0x22e40b['as'],'attributes':_0x22e40b[_0x1dbb('0x1b')],'include':_0x22e40b[_0x1dbb('0x1d')]?_[_0x1dbb('0x1e')](_0x22e40b['include'],function(_0x5a9c2){return{'model':db[_0x5a9c2[_0x1dbb('0x1f')]],'as':_0x5a9c2['as'],'attributes':_0x5a9c2['attributes'],'include':_0x5a9c2[_0x1dbb('0x1d')]?_[_0x1dbb('0x1e')](_0x5a9c2[_0x1dbb('0x1d')],function(_0xde3241){return{'model':db[_0xde3241[_0x1dbb('0x1f')]],'as':_0xde3241['as'],'attributes':_0xde3241['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dbb('0xc')](function(_0x28db37){if(_0x5126a3[_0x1dbb('0x18')][_0x1dbb('0x21')]===!![])_0x28db37[_0x1dbb('0x22')](_0x1dbb('0x23'),_0x28db37['getSmtpOptions']());logger[_0x1dbb('0xd')](_0x1dbb('0x20'),_0x5126a3);logger['debug'](_0x1dbb('0x20'),_0x5126a3,JSON[_0x1dbb('0x11')](_0x28db37));_0x15672c(_0x28db37);})[_0x1dbb('0x15')](function(_0x311f6e){logger[_0x1dbb('0x12')](_0x1dbb('0x20'),_0x311f6e[_0x1dbb('0x13')],_0x5126a3);_0x110b7a(_0x4d70fc[_0x1dbb('0x12')](0x1f4,_0x311f6e[_0x1dbb('0x13')]));});});};exports[_0x1dbb('0x24')]=function(_0x3fed14){var _0x366f44=this;return new Promise(function(_0x2a74a3,_0x55a8f6){var _0x1b94ab={'body':_0x3fed14[_0x1dbb('0x25')],'channel':_0x1dbb('0x26')};var _0x2af34d=_[_0x1dbb('0x27')](_[_0x1dbb('0x28')](db[_0x1dbb('0x29')][_0x1dbb('0x2a')]),[_0x1dbb('0x2b'),_0x1dbb('0x2c'),_0x1dbb('0x2d'),_0x1dbb('0x2e')]);var _0x139cb4=![];if(_0x3fed14['body']['id']){delete _0x3fed14[_0x1dbb('0x25')]['id'];}if(_[_0x1dbb('0x2f')](_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x30')])){return _0x55a8f6(_0x366f44['error'](0x1f4,_0x1dbb('0x31')));}if(_[_0x1dbb('0x2f')](_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x25')])||_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x25')]===''){return _0x55a8f6(_0x366f44[_0x1dbb('0x12')](0x1f4,_0x1dbb('0x32')));}if(_['isNil'](_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x33')])){return _0x55a8f6(_0x366f44[_0x1dbb('0x12')](0x1f4,_0x1dbb('0x34')+_0x2af34d));}if(!_[_0x1dbb('0x35')](_0x2af34d,_0x3fed14[_0x1dbb('0x25')]['mapKey'])){return _0x55a8f6(_0x366f44[_0x1dbb('0x12')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2af34d));}var _0x11ae4c={};_0x11ae4c[_0x3fed14[_0x1dbb('0x25')]['mapKey']]=_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x30')];return db[_0x1dbb('0x17')][_0x1dbb('0x36')]({'where':{'id':_0x3fed14[_0x1dbb('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x1dbb('0x38'),'include':[{'model':db[_0x1dbb('0x29')],'as':_0x1dbb('0x39'),'where':_0x11ae4c,'limit':0x1,'order':[[_0x1dbb('0x2c'),_0x1dbb('0x3a')]]}]},{'model':db['MailApplication'],'as':_0x1dbb('0x3b')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x1dbb('0x3c')],'as':'CloudProvider'}]}]})[_0x1dbb('0xc')](function(_0xb47fb7){if(_0xb47fb7&&_0xb47fb7[_0x1dbb('0x38')]){var _0x3085ab=_0xb47fb7[_0x1dbb('0x3d')]({'plain':!![]});_0x1b94ab[_0x1dbb('0x37')]=_['omit'](_0x3085ab,[_0x1dbb('0x3b'),_0x1dbb('0x38')]);_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x23')]=_0xb47fb7[_0x1dbb('0x3e')]();_0x1b94ab[_0x1dbb('0x3f')]=_0x3085ab['Applications'];_0x1b94ab['list']=_0x3085ab[_0x1dbb('0x38')];_0x1b94ab['applications']=_[_0x1dbb('0x40')](_0x1b94ab[_0x1dbb('0x3f')],[_0x1dbb('0x41')],['asc']);if(_0x1b94ab[_0x1dbb('0x37')]&&_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x42')]){_0x1b94ab[_0x1dbb('0x3f')]['push']({'id':0x0,'priority':_0x1b94ab[_0x1dbb('0x3f')][_0x1dbb('0x43')]+0x1,'app':_0x1dbb('0x44'),'appdata':_0x1dbb('0x42'),'interval':_0x1dbb('0x45')});}if(_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x3b')]){delete _0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x3b')];}if(_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x38')]){delete _0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x38')];}if(_0x3085ab[_0x1dbb('0x38')]['Contacts']['length']){return _0x3085ab[_0x1dbb('0x38')]['Contacts'][0x0];}var _0x100828=_[_0x1dbb('0x5')](_0x3fed14[_0x1dbb('0x25')],{'firstName':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x30')],'ListId':_0x3085ab[_0x1dbb('0x2e')]});_0x100828[_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x33')]]=_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x30')];return db[_0x1dbb('0x29')]['create'](_0x100828);}else{throw new Error(_0x1dbb('0x46'));}})[_0x1dbb('0xc')](function(_0x558ac9){_0x1b94ab[_0x1dbb('0x47')]=_0x558ac9;if(_0x558ac9){if(!_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')]['messageId']){_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x48')]=rs[_0x1dbb('0x49')]()+'\x20'+_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x30')];}var _0x3958f6={'ContactId':_0x558ac9['id'],'MailAccountId':_0x3fed14[_0x1dbb('0x37')]['id'],'inReplyTo':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x48')],'to':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x30')],'cc':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')]['cc'],'subject':_0x3fed14['body'][_0x1dbb('0x13')][_0x1dbb('0x4a')],'attach':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x4b')],'lastMsgAt':moment()[_0x1dbb('0x4c')](_0x1dbb('0x4d')),'lastMsgDirection':'in'};return db[_0x1dbb('0x4e')][_0x1dbb('0x36')]({'where':{'closed':![],'MailAccountId':_0x3fed14[_0x1dbb('0x37')]['id']},'include':[{'model':db[_0x1dbb('0x4f')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x50')]}}]})[_0x1dbb('0xc')](function(_0x53004c){if(_0x53004c){return[_0x53004c,![]];}return db['MailInteraction'][_0x1dbb('0x51')](_0x3958f6)[_0x1dbb('0xc')](function(_0x3770c0){return[_0x3770c0,!![]];});});}else{throw new Error(_0x1dbb('0x52'));}})[_0x1dbb('0x53')](function(_0x322b54,_0x2b2746){if(_0x322b54){_0x139cb4=_0x2b2746;if(!_0x2b2746){return _0x322b54['update']({'inReplyTo':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x48')],'to':_0x3fed14[_0x1dbb('0x25')]['message'][_0x1dbb('0x30')],'cc':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')]['cc'],'subject':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x4a')],'attach':_0x322b54[_0x1dbb('0x4b')]?_0x322b54[_0x1dbb('0x4b')]:_0x3fed14[_0x1dbb('0x25')]['message'][_0x1dbb('0x4b')],'substatus':null,'substatusAt':moment()[_0x1dbb('0x4c')](_0x1dbb('0x4d')),'lastMsgAt':moment()[_0x1dbb('0x4c')](_0x1dbb('0x4d')),'lastMsgDirection':'in'});}else{return _0x322b54;}}})['then'](function(_0x40927c){_0x1b94ab[_0x1dbb('0x54')]=_0x40927c['get']({'plain':!![]});_0x1b94ab[_0x1dbb('0x54')][_0x1dbb('0x55')]=_0x139cb4;return db[_0x1dbb('0x4f')][_0x1dbb('0x51')]({'body':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x25')],'MailAccountId':_0x3fed14[_0x1dbb('0x37')]['id'],'MailInteractionId':_0x40927c['id'],'direction':'in','ContactId':_0x1b94ab['contact']['id'],'messageId':_0x3fed14['body'][_0x1dbb('0x13')][_0x1dbb('0x48')],'from':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x30')],'to':_0x3fed14[_0x1dbb('0x25')]['message']['to'],'cc':_0x3fed14[_0x1dbb('0x25')]['message']['cc'],'subject':_0x3fed14['body'][_0x1dbb('0x13')][_0x1dbb('0x4a')],'attach':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x4b')],'Attachments':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x56')],'originTo':_0x3fed14['body'][_0x1dbb('0x13')][_0x1dbb('0x57')],'originCc':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')]['originCc'],'bcc':_0x3fed14[_0x1dbb('0x25')]['message'][_0x1dbb('0x58')],'ChatWebsiteId':_0x3fed14[_0x1dbb('0x25')]['message'][_0x1dbb('0x59')]||null,'originChannel':_0x3fed14[_0x1dbb('0x25')][_0x1dbb('0x13')][_0x1dbb('0x5a')]||_0x1dbb('0x5b'),'ChatOfflineMessageId':_0x3fed14['body'][_0x1dbb('0x13')][_0x1dbb('0x5c')]||null},{'include':[{'model':db[_0x1dbb('0x5d')],'as':_0x1dbb('0x5e')}]});})[_0x1dbb('0xc')](function(_0x430bec){_0x1b94ab['message']=_0x430bec;if(!_0x1b94ab[_0x1dbb('0x54')]['UserId']){return;}return db['User'][_0x1dbb('0x36')]({'attributes':['id','name'],'where':{'id':_0x1b94ab[_0x1dbb('0x54')][_0x1dbb('0x5f')]}});})[_0x1dbb('0xc')](function(_0x3efd93){if(_0x3efd93){_0x1b94ab[_0x1dbb('0x3f')][_0x1dbb('0x60')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3efd93[_0x1dbb('0x61')]+','+(_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x62')]||0xa),'interval':_0x1dbb('0x45')});}if(!_0x1b94ab[_0x1dbb('0x54')]['queueId']){return;}return db['MailQueue'][_0x1dbb('0x36')]({'attributes':['id',_0x1dbb('0x61')],'where':{'id':_0x1b94ab['interaction'][_0x1dbb('0x63')]}});})[_0x1dbb('0xc')](function(_0x12008c){if(_0x12008c){_0x1b94ab['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x1dbb('0x64'),'appdata':_0x12008c[_0x1dbb('0x61')]+','+(_0x1b94ab[_0x1dbb('0x37')][_0x1dbb('0x65')]||0x12c),'interval':_0x1dbb('0x45')});}return respondWithRpcPromise(_0x1dbb('0x66'),_0x1dbb('0x67'),_0x1b94ab);})[_0x1dbb('0xc')](function(_0x43788f){_0x2a74a3(_0x43788f);})[_0x1dbb('0x15')](function(_0x48f548){_0x55a8f6(_0x366f44[_0x1dbb('0x12')](0x1f4,_0x48f548[_0x1dbb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3fffbc7..fef4cec 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 _0x19a3=['update','emit','removeListener','register','mailAccount:','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x19a3,0x1d9));var _0x319a=function(_0x359706,_0xd873d4){_0x359706=_0x359706-0x0;var _0x25e78e=_0x19a3[_0x359706];return _0x25e78e;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x319a('0x0'),_0x319a('0x1')];function createListener(_0x477dad,_0x1821eb){return function(_0x144d8a){_0x1821eb[_0x319a('0x2')](_0x477dad,_0x144d8a);};}function removeListener(_0x3f0190,_0x23d648){return function(){MailAccountEvents[_0x319a('0x3')](_0x3f0190,_0x23d648);};}exports[_0x319a('0x4')]=function(_0x25394f){for(var _0x56cbcf=0x0,_0x1aeafb=events['length'];_0x56cbcf<_0x1aeafb;_0x56cbcf++){var _0x144af0=events[_0x56cbcf];var _0x35f9ee=createListener(_0x319a('0x5')+_0x144af0,_0x25394f);MailAccountEvents['on'](_0x144af0,_0x35f9ee);}}; \ No newline at end of file +var _0xcd30=['removeListener','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xcd30,0x1e8));var _0x0cd3=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0xcd30[_0x57cc22];return _0x6f7bdc;};'use strict';var MailAccountEvents=require(_0x0cd3('0x0'));var events=[_0x0cd3('0x1'),_0x0cd3('0x2'),_0x0cd3('0x3')];function createListener(_0x392d43,_0x21311c){return function(_0x163b0c){_0x21311c['emit'](_0x392d43,_0x163b0c);};}function removeListener(_0x196d58,_0x3531d9){return function(){MailAccountEvents[_0x0cd3('0x4')](_0x196d58,_0x3531d9);};}exports['register']=function(_0x472566){for(var _0x5d321f=0x0,_0xe1ece5=events['length'];_0x5d321f<_0xe1ece5;_0x5d321f++){var _0x15ff66=events[_0x5d321f];var _0x18d6f3=createListener(_0x0cd3('0x5')+_0x15ff66,_0x472566);MailAccountEvents['on'](_0x15ff66,_0x18d6f3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 13c5466..539a9be 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 _0xa9cc=['/:id','isAuthenticated','show','put','update','delete','exports','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x343ceb,_0x564615){var _0x85fe4b=function(_0x546089){while(--_0x546089){_0x343ceb['push'](_0x343ceb['shift']());}};_0x85fe4b(++_0x564615);}(_0xa9cc,0xf7));var _0xca9c=function(_0x4f3204,_0x532aa0){_0x4f3204=_0x4f3204-0x0;var _0x3cc521=_0xa9cc[_0x4f3204];return _0x3cc521;};'use strict';var multer=require('multer');var util=require(_0xca9c('0x0'));var path=require(_0xca9c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xca9c('0x2')]();var fs_extra=require(_0xca9c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xca9c('0x4'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0xca9c('0x5'),auth[_0xca9c('0x6')](),controller[_0xca9c('0x7')]);router[_0xca9c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xca9c('0x9')]);router[_0xca9c('0xa')](_0xca9c('0x5'),auth[_0xca9c('0x6')](),controller['destroy']);module[_0xca9c('0xb')]=router; \ No newline at end of file +var _0xf9b9=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','connect-timeout'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0xf9b9,0xc1));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9f9b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9f9b('0x1'));var express=require(_0x9f9b('0x2'));var router=express[_0x9f9b('0x3')]();var fs_extra=require(_0x9f9b('0x4'));var auth=require(_0x9f9b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9f9b('0x6'));var controller=require('./mailApplication.controller');router[_0x9f9b('0x7')](_0x9f9b('0x8'),auth[_0x9f9b('0x9')](),controller[_0x9f9b('0xa')]);router[_0x9f9b('0xb')]('/:id',auth[_0x9f9b('0x9')](),controller[_0x9f9b('0xc')]);router[_0x9f9b('0xd')](_0x9f9b('0x8'),auth[_0x9f9b('0x9')](),controller[_0x9f9b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 32666bf..9a9fe1c 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 _0x4504=['exports','INTEGER','TEXT','STRING'];(function(_0x50cfec,_0x38049e){var _0x42fe70=function(_0x22c000){while(--_0x22c000){_0x50cfec['push'](_0x50cfec['shift']());}};_0x42fe70(++_0x38049e);}(_0x4504,0x94));var _0x4450=function(_0x46fcfc,_0x56073c){_0x46fcfc=_0x46fcfc-0x0;var _0x1c1c63=_0x4504[_0x46fcfc];return _0x1c1c63;};'use strict';var Sequelize=require('sequelize');module[_0x4450('0x0')]={'priority':{'type':Sequelize[_0x4450('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4450('0x2')]()},'description':{'type':Sequelize[_0x4450('0x3')]},'interval':{'type':Sequelize[_0x4450('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x184c=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2b16e9,_0xfa271c){var _0x54fa32=function(_0xd04ade){while(--_0xd04ade){_0x2b16e9['push'](_0x2b16e9['shift']());}};_0x54fa32(++_0xfa271c);}(_0x184c,0x1c3));var _0xc184=function(_0x3f7a88,_0x17c43e){_0x3f7a88=_0x3f7a88-0x0;var _0x4fda88=_0x184c[_0x3f7a88];return _0x4fda88;};'use strict';var Sequelize=require(_0xc184('0x0'));module[_0xc184('0x1')]={'priority':{'type':Sequelize[_0xc184('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc184('0x3')],'allowNull':![],'defaultValue':_0xc184('0x4')},'appdata':{'type':Sequelize[_0xc184('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc184('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 35570bc..12e386f 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xaa88[_0x3d78d7];return _0x4b6784;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x781aa2,_0x27b779){var _0x6c19f3=function(_0x3f14a3){while(--_0x3f14a3){_0x781aa2['push'](_0x781aa2['shift']());}};_0x6c19f3(++_0x27b779);}(_0x9bde,0xe1));var _0xe9bd=function(_0x35ae65,_0x3235d3){_0x35ae65=_0x35ae65-0x0;var _0x29b347=_0x9bde[_0x35ae65];return _0x29b347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d3761ee..7fe254e 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 _0xa749=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa749,0xb6));var _0x9a74=function(_0x54d978,_0x5af925){_0x54d978=_0x54d978-0x0;var _0x3a71fe=_0xa749[_0x54d978];return _0x3a71fe;};'use strict';var _=require(_0x9a74('0x0'));var util=require(_0x9a74('0x1'));var logger=require(_0x9a74('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9a74('0x3'));var rp=require(_0x9a74('0x4'));var fs=require('fs');var path=require(_0x9a74('0x5'));var rimraf=require(_0x9a74('0x6'));var config=require(_0x9a74('0x7'));var attributes=require(_0x9a74('0x8'));module[_0x9a74('0x9')]=function(_0x5d4435,_0x50bff6){return _0x5d4435[_0x9a74('0xa')](_0x9a74('0xb'),attributes,{'tableName':_0x9a74('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a74('0xd'),'collate':_0x9a74('0xe')});}; \ No newline at end of file +var _0x355d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x443cc5,_0x237fca){var _0x6271e9=function(_0x57a38){while(--_0x57a38){_0x443cc5['push'](_0x443cc5['shift']());}};_0x6271e9(++_0x237fca);}(_0x355d,0x15c));var _0xd355=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x355d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd355('0x0'));var logger=require(_0xd355('0x1'))(_0xd355('0x2'));var moment=require(_0xd355('0x3'));var BPromise=require(_0xd355('0x4'));var rp=require(_0xd355('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd355('0x6'));var config=require(_0xd355('0x7'));var attributes=require('./mailApplication.attributes');module[_0xd355('0x8')]=function(_0x14d9d9,_0x2f83ed){return _0x14d9d9[_0xd355('0x9')](_0xd355('0xa'),attributes,{'tableName':_0xd355('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd355('0xc'),'collate':_0xd355('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 11dd407..ae97fd5 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 _0xdd34=['then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','UpdateMailApplication','MailApplication','options','raw','where','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xcd24ed,_0x13623f){var _0x24193c=function(_0x4d9e7d){while(--_0x4d9e7d){_0xcd24ed['push'](_0xcd24ed['shift']());}};_0x24193c(++_0x13623f);}(_0xdd34,0x1db));var _0x4dd3=function(_0x104d9b,_0x59974d){_0x104d9b=_0x104d9b-0x0;var _0x400826=_0xdd34[_0x104d9b];return _0x400826;};'use strict';var _=require(_0x4dd3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4dd3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4dd3('0x2'));var db=require(_0x4dd3('0x3'))['db'];var utils=require(_0x4dd3('0x4'));var logger=require('../../config/logger')(_0x4dd3('0x5'));var config=require(_0x4dd3('0x6'));var jayson=require(_0x4dd3('0x7'));var client=jayson[_0x4dd3('0x8')][_0x4dd3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30fbab,_0x14d31f,_0x27644d){return new BPromise(function(_0x49bd45,_0x4a89ed){return client[_0x4dd3('0xa')](_0x30fbab,_0x27644d)[_0x4dd3('0xb')](function(_0xbcbc75){logger['info'](_0x4dd3('0xc'),_0x14d31f,_0x4dd3('0xd'));logger[_0x4dd3('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x14d31f,_0x4dd3('0xd'),JSON['stringify'](_0xbcbc75));if(_0xbcbc75['error']){if(_0xbcbc75[_0x4dd3('0xf')][_0x4dd3('0x10')]===0x1f4){logger['error'](_0x4dd3('0xc'),_0x14d31f,_0xbcbc75['error'][_0x4dd3('0x11')]);return _0x4a89ed(_0xbcbc75[_0x4dd3('0xf')][_0x4dd3('0x11')]);}logger[_0x4dd3('0xf')](_0x4dd3('0xc'),_0x14d31f,_0xbcbc75[_0x4dd3('0xf')][_0x4dd3('0x11')]);return _0x49bd45(_0xbcbc75['error'][_0x4dd3('0x11')]);}else{logger[_0x4dd3('0x12')]('MailApplication,\x20%s,\x20%s',_0x14d31f,_0x4dd3('0xd'));_0x49bd45(_0xbcbc75['result']['message']);}})[_0x4dd3('0x13')](function(_0x911035){logger[_0x4dd3('0xf')](_0x4dd3('0xc'),_0x14d31f,_0x911035);_0x4a89ed(_0x911035);});});}exports[_0x4dd3('0x14')]=function(_0x12bc9b){var _0x316160=this;return new Promise(function(_0x2d18fd,_0x5c8615){return db[_0x4dd3('0x15')]['update'](_0x12bc9b['body'],{'raw':_0x12bc9b['options']?_0x12bc9b[_0x4dd3('0x16')][_0x4dd3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12bc9b[_0x4dd3('0x16')]?_0x12bc9b['options'][_0x4dd3('0x18')]||null:null,'attributes':_0x12bc9b[_0x4dd3('0x16')]?_0x12bc9b[_0x4dd3('0x16')][_0x4dd3('0x19')]||null:null,'limit':_0x12bc9b[_0x4dd3('0x16')]?_0x12bc9b[_0x4dd3('0x16')][_0x4dd3('0x1a')]||null:null})[_0x4dd3('0xb')](function(_0x119f3e){logger[_0x4dd3('0x12')]('UpdateMailApplication',_0x12bc9b);logger[_0x4dd3('0xe')](_0x4dd3('0x14'),_0x12bc9b,JSON['stringify'](_0x119f3e));_0x2d18fd(_0x119f3e);})[_0x4dd3('0x13')](function(_0xefd3a3){logger[_0x4dd3('0xf')](_0x4dd3('0x14'),_0xefd3a3['message'],_0x12bc9b);_0x5c8615(_0x316160[_0x4dd3('0xf')](0x1f4,_0xefd3a3[_0x4dd3('0x11')]));});});}; \ No newline at end of file +var _0x47c6=['stringify','error','code','message','result','MailApplication','body','options','raw','attributes','limit','UpdateMailApplication','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2fd1de,_0x44e945){var _0x292851=function(_0x3c2192){while(--_0x3c2192){_0x2fd1de['push'](_0x2fd1de['shift']());}};_0x292851(++_0x44e945);}(_0x47c6,0x192));var _0x647c=function(_0x35bad0,_0x21927d){_0x35bad0=_0x35bad0-0x0;var _0x4fe50f=_0x47c6[_0x35bad0];return _0x4fe50f;};'use strict';var _=require('lodash');var util=require(_0x647c('0x0'));var moment=require(_0x647c('0x1'));var BPromise=require(_0x647c('0x2'));var rs=require(_0x647c('0x3'));var fs=require('fs');var Redis=require(_0x647c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x647c('0x5'));var logger=require(_0x647c('0x6'))(_0x647c('0x7'));var config=require(_0x647c('0x8'));var jayson=require(_0x647c('0x9'));var client=jayson[_0x647c('0xa')][_0x647c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f620,_0x27c9aa,_0x53d4d0){return new BPromise(function(_0x2a56ac,_0x3f10ba){return client['request'](_0x30f620,_0x53d4d0)[_0x647c('0xc')](function(_0x4da5de){logger[_0x647c('0xd')](_0x647c('0xe'),_0x27c9aa,_0x647c('0xf'));logger[_0x647c('0x10')](_0x647c('0x11'),_0x27c9aa,'request\x20sent',JSON[_0x647c('0x12')](_0x4da5de));if(_0x4da5de[_0x647c('0x13')]){if(_0x4da5de[_0x647c('0x13')][_0x647c('0x14')]===0x1f4){logger[_0x647c('0x13')](_0x647c('0xe'),_0x27c9aa,_0x4da5de[_0x647c('0x13')][_0x647c('0x15')]);return _0x3f10ba(_0x4da5de['error'][_0x647c('0x15')]);}logger[_0x647c('0x13')](_0x647c('0xe'),_0x27c9aa,_0x4da5de[_0x647c('0x13')][_0x647c('0x15')]);return _0x2a56ac(_0x4da5de[_0x647c('0x13')][_0x647c('0x15')]);}else{logger[_0x647c('0xd')](_0x647c('0xe'),_0x27c9aa,_0x647c('0xf'));_0x2a56ac(_0x4da5de[_0x647c('0x16')]['message']);}})['catch'](function(_0x42031e){logger[_0x647c('0x13')](_0x647c('0xe'),_0x27c9aa,_0x42031e);_0x3f10ba(_0x42031e);});});}exports['UpdateMailApplication']=function(_0x5f1c92){var _0x1dad0b=this;return new Promise(function(_0x5ed95a,_0x1dfcfa){return db[_0x647c('0x17')]['update'](_0x5f1c92[_0x647c('0x18')],{'raw':_0x5f1c92[_0x647c('0x19')]?_0x5f1c92['options'][_0x647c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1c92['options']?_0x5f1c92[_0x647c('0x19')]['where']||null:null,'attributes':_0x5f1c92[_0x647c('0x19')]?_0x5f1c92[_0x647c('0x19')][_0x647c('0x1b')]||null:null,'limit':_0x5f1c92['options']?_0x5f1c92[_0x647c('0x19')][_0x647c('0x1c')]||null:null})[_0x647c('0xc')](function(_0x49f5d9){logger[_0x647c('0xd')](_0x647c('0x1d'),_0x5f1c92);logger[_0x647c('0x10')]('UpdateMailApplication',_0x5f1c92,JSON['stringify'](_0x49f5d9));_0x5ed95a(_0x49f5d9);})['catch'](function(_0x4fe091){logger[_0x647c('0x13')](_0x647c('0x1d'),_0x4fe091['message'],_0x5f1c92);_0x1dfcfa(_0x1dad0b[_0x647c('0x13')](0x1f4,_0x4fe091[_0x647c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6046813..6e6a76a 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 _0x395a=['destroy','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x395a,0x1f0));var _0xa395=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x395a[_0x531cb8];return _0x5cf297;};'use strict';var express=require(_0xa395('0x0'));var router=express[_0xa395('0x1')]();var auth=require(_0xa395('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xa395('0x3'));router[_0xa395('0x4')]('/',auth[_0xa395('0x5')](),controller[_0xa395('0x6')]);router[_0xa395('0x4')](_0xa395('0x7'),auth[_0xa395('0x5')](),controller[_0xa395('0x8')]);router[_0xa395('0x4')]('/:id',auth[_0xa395('0x5')](),controller[_0xa395('0x9')]);router[_0xa395('0x4')]('/:id/messages',auth[_0xa395('0x5')](),controller[_0xa395('0xa')]);router[_0xa395('0x4')](_0xa395('0xb'),auth[_0xa395('0x5')](),controller[_0xa395('0xc')]);router[_0xa395('0xd')]('/',auth[_0xa395('0x5')](),controller['create']);router['post'](_0xa395('0xe'),auth[_0xa395('0x5')](),controller[_0xa395('0xf')]);router['post'](_0xa395('0x10'),auth[_0xa395('0x5')](),interaction['tracked'](_0xa395('0x11'),_0xa395('0x12')),controller['addTags']);router['put']('/:id',auth[_0xa395('0x5')](),interaction[_0xa395('0x13')]('mail',_0xa395('0x14')),controller[_0xa395('0x15')]);router[_0xa395('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked']('mail',_0xa395('0x17')),controller[_0xa395('0x18')]);router['delete'](_0xa395('0x10'),auth[_0xa395('0x5')](),controller[_0xa395('0x19')]);module['exports']=router; \ No newline at end of file +var _0x71e2=['delete','mailinteraction:destroy','destroy','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','update'];(function(_0x1ff6a4,_0x1a0729){var _0x4b9301=function(_0x315d3f){while(--_0x315d3f){_0x1ff6a4['push'](_0x1ff6a4['shift']());}};_0x4b9301(++_0x1a0729);}(_0x71e2,0x99));var _0x271e=function(_0x3e820b,_0xcc2f78){_0x3e820b=_0x3e820b-0x0;var _0x15edf7=_0x71e2[_0x3e820b];return _0x15edf7;};'use strict';var express=require('express');var router=express[_0x271e('0x0')]();var auth=require(_0x271e('0x1'));var interaction=require(_0x271e('0x2'));var controller=require(_0x271e('0x3'));router['get']('/',auth[_0x271e('0x4')](),controller[_0x271e('0x5')]);router[_0x271e('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x271e('0x7')]);router['get'](_0x271e('0x8'),auth[_0x271e('0x4')](),controller[_0x271e('0x9')]);router[_0x271e('0x6')]('/:id/messages',auth[_0x271e('0x4')](),controller['getMessages']);router[_0x271e('0x6')](_0x271e('0xa'),auth[_0x271e('0x4')](),controller[_0x271e('0xb')]);router[_0x271e('0xc')]('/',auth['isAuthenticated'](),controller[_0x271e('0xd')]);router[_0x271e('0xc')]('/:id/messages',auth[_0x271e('0x4')](),controller[_0x271e('0xe')]);router['post'](_0x271e('0xf'),auth['isAuthenticated'](),interaction[_0x271e('0x10')]('mail',_0x271e('0x11')),controller['addTags']);router[_0x271e('0x12')](_0x271e('0x8'),auth[_0x271e('0x4')](),interaction[_0x271e('0x10')](_0x271e('0x13'),_0x271e('0x14')),controller[_0x271e('0x15')]);router[_0x271e('0x16')](_0x271e('0x8'),auth[_0x271e('0x4')](),interaction[_0x271e('0x10')](_0x271e('0x13'),_0x271e('0x17')),controller[_0x271e('0x18')]);router['delete'](_0x271e('0xf'),auth[_0x271e('0x4')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 609e542..3a5146b 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 _0xbf1e=['INTEGER','sequelize','iconv','exports','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0xbf1e,0x64));var _0xebf1=function(_0x5908da,_0x1d510a){_0x5908da=_0x5908da-0x0;var _0x2138b7=_0xbf1e[_0x5908da];return _0x2138b7;};'use strict';var Sequelize=require(_0xebf1('0x0'));var iconv=require(_0xebf1('0x1'));module[_0xebf1('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebf1('0x3')]},'disposition':{'type':Sequelize[_0xebf1('0x4')]},'secondDisposition':{'type':Sequelize[_0xebf1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xebf1('0x4')]},'inReplyTo':{'type':Sequelize[_0xebf1('0x4')](0x1fe)},'to':{'type':Sequelize[_0xebf1('0x4')]},'cc':{'type':Sequelize[_0xebf1('0x5')](_0xebf1('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xebf1('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xebf1('0x3')]},'substatus':{'type':Sequelize[_0xebf1('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xebf1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xebf1('0x8')]('in',_0xebf1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xebf1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xebf1('0x8')]('in',_0xebf1('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xebf1('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xebf1('0xa')]}}; \ No newline at end of file +var _0xae6c=['TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN','DATE','STRING'];(function(_0x3c87a7,_0x67d072){var _0x38e1c0=function(_0x3f56a4){while(--_0x3f56a4){_0x3c87a7['push'](_0x3c87a7['shift']());}};_0x38e1c0(++_0x67d072);}(_0xae6c,0xd3));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xcae6('0x0'));var iconv=require(_0xcae6('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcae6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcae6('0x3')]},'disposition':{'type':Sequelize[_0xcae6('0x4')]},'secondDisposition':{'type':Sequelize[_0xcae6('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcae6('0x4')]},'inReplyTo':{'type':Sequelize[_0xcae6('0x4')](0x1fe)},'to':{'type':Sequelize[_0xcae6('0x4')]},'cc':{'type':Sequelize[_0xcae6('0x5')](_0xcae6('0x6'))},'subject':{'type':Sequelize[_0xcae6('0x5')]()},'attach':{'type':Sequelize[_0xcae6('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xcae6('0x3')]},'substatus':{'type':Sequelize[_0xcae6('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xcae6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcae6('0x7')]('in',_0xcae6('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcae6('0x7')]('in',_0xcae6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcae6('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index a917432..94f79ff 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 _0x257f=['order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','rows','addTags','setTags','spread','color','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','bcc','createdAt','get','mkdirSync','from','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','juice','../../config/logger','../../mysqldb','html-entities','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','MailInteraction','rawAttributes','fieldName','type','findAll','user','catch','params','model','keys','query','filters','intersection','attributes','fields','merge','options','find','create','body','describe','addMessage','ids','findOne','MailMessage','length','hasOwnProperty','nolimit'];(function(_0x5c822c,_0x4349f3){var _0xb42ffb=function(_0x11c8f4){while(--_0x11c8f4){_0x5c822c['push'](_0x5c822c['shift']());}};_0xb42ffb(++_0x4349f3);}(_0x257f,0x94));var _0xf257=function(_0x300b38,_0x144a20){_0x300b38=_0x300b38-0x0;var _0x540061=_0x257f[_0x300b38];return _0x540061;};'use strict';var emlformat=require(_0xf257('0x0'));var rimraf=require(_0xf257('0x1'));var zipdir=require('zip-dir');var moment=require(_0xf257('0x2'));var BPromise=require(_0xf257('0x3'));var util=require(_0xf257('0x4'));var path=require(_0xf257('0x5'));var fs=require('fs');var _=require(_0xf257('0x6'));var juice=require(_0xf257('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0xf257('0x8'))('api');var config=require('../../config/environment');var db=require(_0xf257('0x9'))['db'];var htmlEntities=require(_0xf257('0xa'));config[_0xf257('0xb')]=_[_0xf257('0xc')](config[_0xf257('0xb')],{'host':_0xf257('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0xf257('0xe')](socket);function respondWithStatusCode(_0x3a8a5c,_0x142ef9){_0x142ef9=_0x142ef9||0xcc;return function(_0x1c1af3){if(_0x1c1af3){return _0x3a8a5c['sendStatus'](_0x142ef9);}return _0x3a8a5c['status'](_0x142ef9)['end']();};}function respondWithResult(_0x274266,_0xfcf220){_0xfcf220=_0xfcf220||0xc8;return function(_0x2faf7c){if(_0x2faf7c){return _0x274266[_0xf257('0xf')](_0xfcf220)[_0xf257('0x10')](_0x2faf7c);}};}function respondWithFilteredResult(_0xf9b785,_0x12d750){return function(_0x18e5ea){if(_0x18e5ea){var _0x1ec1ec=typeof _0x12d750[_0xf257('0x11')]===_0xf257('0x12')&&typeof _0x12d750[_0xf257('0x13')]===_0xf257('0x12');var _0x4e7cf3=_0x18e5ea[_0xf257('0x14')];var _0x41aa83=_0x1ec1ec?0x0:_0x12d750[_0xf257('0x11')];var _0x551ecf=_0x1ec1ec?_0x18e5ea[_0xf257('0x14')]:_0x12d750[_0xf257('0x11')]+_0x12d750[_0xf257('0x13')];var _0x3d11b5;if(_0x551ecf>=_0x4e7cf3){_0x551ecf=_0x4e7cf3;_0x3d11b5=0xc8;}else{_0x3d11b5=0xce;}_0xf9b785[_0xf257('0xf')](_0x3d11b5);return _0xf9b785[_0xf257('0x15')](_0xf257('0x16'),_0x41aa83+'-'+_0x551ecf+'/'+_0x4e7cf3)[_0xf257('0x10')](_0x18e5ea);}return null;};}function saveUpdates(_0x23ac1d){return function(_0x32292e){if(_0x32292e){return _0x32292e[_0xf257('0x17')](_0x23ac1d)[_0xf257('0x18')](function(_0xe16f5a){return _0xe16f5a;});}return null;};}function removeEntity(_0x4cf33b){return function(_0x4cec41){if(_0x4cec41){return _0x4cec41['destroy']()['then'](function(){_0x4cf33b[_0xf257('0xf')](0xcc)[_0xf257('0x19')]();});}};}function handleEntityNotFound(_0x9d9f21){return function(_0x1c331d){if(!_0x1c331d){_0x9d9f21[_0xf257('0x1a')](0x194);}return _0x1c331d;};}function handleError(_0x46d04c,_0x15ccac){_0x15ccac=_0x15ccac||0x1f4;return function(_0x21aeaa){logger[_0xf257('0x1b')](_0x21aeaa[_0xf257('0x1c')]);if(_0x21aeaa[_0xf257('0x1d')]){delete _0x21aeaa[_0xf257('0x1d')];}_0x46d04c[_0xf257('0xf')](_0x15ccac)['send'](_0x21aeaa);};}exports['index']=function(_0x1ada50,_0x2cdb34){var _0x1a9e1c={};var _0x113cfd=_['map'](db[_0xf257('0x1e')][_0xf257('0x1f')],function(_0x5d5aba){return{'name':_0x5d5aba[_0xf257('0x20')],'type':_0x5d5aba[_0xf257('0x21')]['key']};});_0x1a9e1c=qs['getOptions'](_0x113cfd,_0x1ada50);return interaction[_0xf257('0x22')]('mail',_0x1ada50['query'],_0x1ada50[_0xf257('0x23')],_0x1a9e1c,_0x113cfd)[_0xf257('0x18')](respondWithFilteredResult(_0x2cdb34,_0x1a9e1c))[_0xf257('0x24')](handleError(_0x2cdb34,null));};exports['show']=function(_0x33ee78,_0x1e0490){var _0x213482={'raw':![],'where':{'id':_0x33ee78[_0xf257('0x25')]['id']}},_0x25bbff={};_0x25bbff[_0xf257('0x26')]=_[_0xf257('0x27')](db[_0xf257('0x1e')][_0xf257('0x1f')]);_0x25bbff[_0xf257('0x28')]=_['keys'](_0x33ee78[_0xf257('0x28')]);_0x25bbff[_0xf257('0x29')]=_[_0xf257('0x2a')](_0x25bbff[_0xf257('0x26')],_0x25bbff[_0xf257('0x28')]);_0x213482[_0xf257('0x2b')]=_[_0xf257('0x2a')](_0x25bbff[_0xf257('0x26')],qs[_0xf257('0x2c')](_0x33ee78[_0xf257('0x28')][_0xf257('0x2c')]));_0x213482[_0xf257('0x2b')]=_0x213482[_0xf257('0x2b')]['length']?_0x213482[_0xf257('0x2b')]:_0x25bbff['model'];if(_0x33ee78[_0xf257('0x28')]['includeAll']){_0x213482['include']=[{'all':!![]}];}_0x213482=_[_0xf257('0x2d')]({},_0x213482,_0x33ee78[_0xf257('0x2e')]);return db[_0xf257('0x1e')][_0xf257('0x2f')](_0x213482)[_0xf257('0x18')](handleEntityNotFound(_0x1e0490,null))[_0xf257('0x18')](respondWithResult(_0x1e0490,null))[_0xf257('0x24')](handleError(_0x1e0490,null));};exports[_0xf257('0x30')]=function(_0x158335,_0x3a4249){return db[_0xf257('0x1e')][_0xf257('0x30')](_0x158335['body'],{})[_0xf257('0x18')](respondWithResult(_0x3a4249,0xc9))['catch'](handleError(_0x3a4249,null));};exports[_0xf257('0x17')]=function(_0x2c1759,_0x4ecc78){if(_0x2c1759['body']['id']){delete _0x2c1759[_0xf257('0x31')]['id'];}return db['MailInteraction'][_0xf257('0x2f')]({'where':{'id':_0x2c1759[_0xf257('0x25')]['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x4ecc78,null))[_0xf257('0x18')](saveUpdates(_0x2c1759[_0xf257('0x31')],null))[_0xf257('0x18')](respondWithResult(_0x4ecc78,null))[_0xf257('0x24')](handleError(_0x4ecc78,null));};exports['destroy']=function(_0x3499c5,_0x49b529){return db[_0xf257('0x1e')][_0xf257('0x2f')]({'where':{'id':_0x3499c5['params']['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x49b529,null))[_0xf257('0x18')](removeEntity(_0x49b529,null))[_0xf257('0x24')](handleError(_0x49b529,null));};exports[_0xf257('0x32')]=function(_0x8fa1ef,_0x468981){return db[_0xf257('0x1e')]['describe']()['then'](respondWithResult(_0x468981,null))['catch'](handleError(_0x468981,null));};exports[_0xf257('0x33')]=function(_0x1b0811,_0x51f111){return db['MailMessage']['find']({'where':{'id':_0x1b0811[_0xf257('0x25')]['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x51f111,null))[_0xf257('0x18')](function(_0x4222f9){if(_0x4222f9){return _0x4222f9[_0xf257('0x33')](_0x1b0811['body'][_0xf257('0x34')],_['omit'](_0x1b0811[_0xf257('0x31')],[_0xf257('0x34'),'id'])||{});}})[_0xf257('0x18')](respondWithResult(_0x51f111,null))[_0xf257('0x24')](handleError(_0x51f111,null));};exports['getMessages']=function(_0x1585a4,_0x58a9b4){var _0x43171b={'raw':![],'where':{}};var _0x182f33={};var _0x3434df={'count':0x0,'rows':[]};return db[_0xf257('0x1e')][_0xf257('0x35')]({'where':{'id':_0x1585a4[_0xf257('0x25')]['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x58a9b4,null))[_0xf257('0x18')](function(_0x2a0ba9){if(_0x2a0ba9){_0x182f33[_0xf257('0x26')]=_['keys'](db[_0xf257('0x36')][_0xf257('0x1f')]);_0x182f33[_0xf257('0x28')]=_[_0xf257('0x27')](_0x1585a4[_0xf257('0x28')]);_0x182f33[_0xf257('0x29')]=_['intersection'](_0x182f33[_0xf257('0x26')],_0x182f33[_0xf257('0x28')]);_0x43171b[_0xf257('0x2b')]=_['intersection'](_0x182f33[_0xf257('0x26')],qs['fields'](_0x1585a4['query'][_0xf257('0x2c')]));_0x43171b[_0xf257('0x2b')]=_0x43171b[_0xf257('0x2b')][_0xf257('0x37')]?_0x43171b[_0xf257('0x2b')]:_0x182f33[_0xf257('0x26')];if(!_0x1585a4['query'][_0xf257('0x38')](_0xf257('0x39'))){_0x43171b[_0xf257('0x13')]=qs['limit'](_0x1585a4[_0xf257('0x28')][_0xf257('0x13')]);_0x43171b[_0xf257('0x11')]=qs[_0xf257('0x11')](_0x1585a4['query'][_0xf257('0x11')]);}_0x43171b[_0xf257('0x3a')]=qs[_0xf257('0x3b')](_0x1585a4[_0xf257('0x28')]['sort']);_0x43171b[_0xf257('0x3c')]=qs[_0xf257('0x29')](_[_0xf257('0x3d')](_0x1585a4[_0xf257('0x28')],_0x182f33[_0xf257('0x29')]));_0x43171b[_0xf257('0x3c')]['MailInteractionId']=_0x2a0ba9['id'];if(_0x1585a4[_0xf257('0x28')]['filter']){_0x43171b[_0xf257('0x3c')]=_[_0xf257('0x2d')](_0x43171b[_0xf257('0x3c')],{'$or':_['map'](_0x43171b[_0xf257('0x2b')],function(_0x4a0f4a){var _0x478f50={};_0x478f50[_0x4a0f4a]={'$like':'%'+_0x1585a4[_0xf257('0x28')][_0xf257('0x3e')]+'%'};return _0x478f50;})});}if(_0x1585a4[_0xf257('0x28')][_0xf257('0x3f')]){var _0x362b8d=_0x1585a4['query'][_0xf257('0x3f')][_0xf257('0x40')](',');var _0x3add52={};_0x3add52[_0x362b8d[0x0]]={'$gte':moment(_0x362b8d[0x1])[_0xf257('0x41')](_0xf257('0x42'))};_0x43171b['where']=_[_0xf257('0x2d')](_0x43171b[_0xf257('0x3c')],_0x3add52);}_0x43171b=_['merge']({},_0x43171b,_0x1585a4[_0xf257('0x2e')]);return db[_0xf257('0x36')][_0xf257('0x14')]({'where':_0x43171b[_0xf257('0x3c')]})[_0xf257('0x18')](function(_0x251782){_0x3434df[_0xf257('0x14')]=_0x251782;if(_0x1585a4[_0xf257('0x28')]['includeAll']){_0x43171b[_0xf257('0x43')]=[{'all':!![]}];}return db[_0xf257('0x36')][_0xf257('0x22')](_0x43171b);})[_0xf257('0x18')](function(_0x213d50){if(_0x1585a4['query'][_0xf257('0x44')]==='true'){for(var _0x735fed=0x0;_0x735fed<_0x213d50[_0xf257('0x37')];_0x735fed++){_0x213d50[_0x735fed][_0xf257('0x31')]=juice(_0x213d50[_0x735fed]['body']);}}_0x3434df[_0xf257('0x45')]=_0x213d50;return _0x3434df;});}})[_0xf257('0x18')](respondWithFilteredResult(_0x58a9b4,_0x43171b))[_0xf257('0x24')](handleError(_0x58a9b4,null));};exports[_0xf257('0x46')]=function(_0x2ec64d,_0x3fd602){return db[_0xf257('0x1e')][_0xf257('0x2f')]({'where':{'id':_0x2ec64d['params']['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x3fd602,null))['then'](function(_0x374ba6){if(_0x374ba6){return _0x374ba6[_0xf257('0x47')](_0x2ec64d[_0xf257('0x31')][_0xf257('0x34')],_['omit'](_0x2ec64d[_0xf257('0x31')],[_0xf257('0x34'),'id'])||{})[_0xf257('0x48')](function(){return db['Tag'][_0xf257('0x22')]({'attributes':['id',_0xf257('0x1d'),_0xf257('0x49')],'where':{'id':_0x2ec64d[_0xf257('0x31')][_0xf257('0x34')]}});})['then'](function(_0x495914){socket['emit']('mailInteractionTags:save',{'id':Number(_0x2ec64d[_0xf257('0x25')]['id']),'tags':_0x495914||[]});return{'id':Number(_0x2ec64d[_0xf257('0x25')]['id']),'tags':_0x495914||[]};});}})['then'](respondWithResult(_0x3fd602,null))[_0xf257('0x24')](handleError(_0x3fd602,null));};exports[_0xf257('0x4a')]=function(_0x5d25a0,_0x56aaea){return db[_0xf257('0x1e')]['find']({'where':{'id':_0x5d25a0['params']['id']}})[_0xf257('0x18')](handleEntityNotFound(_0x56aaea,null))['then'](function(_0x2724d7){if(_0x2724d7){return _0x2724d7[_0xf257('0x4a')](_0x5d25a0[_0xf257('0x28')][_0xf257('0x34')]);}})[_0xf257('0x18')](respondWithStatusCode(_0x56aaea,null))[_0xf257('0x24')](handleError(_0x56aaea,null));};exports[_0xf257('0x4b')]=function(_0x6874ba,_0x44fdef){var _0x2e8125=moment()[_0xf257('0x4c')]()[_0xf257('0x4d')]();var _0x1c02d0=path[_0xf257('0x4e')](config[_0xf257('0x4f')],_0xf257('0x50'),_0xf257('0x51'),_0xf257('0x52'));var _0x2208f6=path[_0xf257('0x4e')](config[_0xf257('0x4f')],_0xf257('0x50'),_0xf257('0x51'),_0xf257('0x53'));var _0x5edcc5=path[_0xf257('0x4e')](_0x1c02d0,_0x2e8125);var _0x1b0c22=util['format'](_0xf257('0x54'),_0x6874ba['params']['id'],_0x2e8125);var _0x2deb48=path['join'](_0x1c02d0,_0x1b0c22);var _0x2b9611=[];if(_0x6874ba[_0xf257('0x28')][_0xf257('0x53')]){_0x2b9611[_0xf257('0x55')]({'model':db[_0xf257('0x56')],'as':_0xf257('0x57'),'raw':!![]});}var _0x4ad96b=[{'model':db[_0xf257('0x36')],'as':_0xf257('0x58'),'attributes':['id',_0xf257('0x31'),'from','to','cc',_0xf257('0x59'),'subject',_0xf257('0x5a')],'where':{'secret':![]},'order':qs[_0xf257('0x3b')]('id'),'include':_0x2b9611}];return db[_0xf257('0x1e')]['find']({'where':{'id':_0x6874ba[_0xf257('0x25')]['id']},'include':_0x4ad96b})[_0xf257('0x18')](handleEntityNotFound(_0x44fdef,null))[_0xf257('0x18')](function(_0xb47a46){if(_0xb47a46&&_0xb47a46['Messages']){var _0x48c27b=_0xb47a46[_0xf257('0x5b')]({'plain':!![]});fs[_0xf257('0x5c')](_0x5edcc5);return BPromise['each'](_0x48c27b[_0xf257('0x58')],function(_0x296694,_0x1dd960){var _0xaeeb41={'from':_0x296694[_0xf257('0x5d')],'to':_0x296694['to']||'missing.recipient@your.company.com','subject':_0x296694[_0xf257('0x5e')],'html':htmlEntities['decode'](_0x296694[_0xf257('0x31')]),'headers':{'Date':moment(_0x296694[_0xf257('0x5a')])[_0xf257('0x41')](_0xf257('0x5f'))},'attachments':[]};if(_0x296694['cc']){_0xaeeb41[_0xf257('0x60')]['Cc']=_0x296694['cc'];}if(_0x296694[_0xf257('0x59')]){_0xaeeb41[_0xf257('0x60')]['Bcc']=_0x296694[_0xf257('0x59')];}return new BPromise(function(_0x5da2d,_0xcf63bb){if(_0x296694[_0xf257('0x57')]){for(var _0x267797=0x0;_0x267797<_0x296694['Attachments'][_0xf257('0x37')];_0x267797++){var _0x2a1266=_0x296694[_0xf257('0x57')][_0x267797];var _0x15d77a=path['join'](_0x2208f6,_0x2a1266['basename']);if(fs[_0xf257('0x61')](_0x15d77a)){_0xaeeb41['attachments'][_0xf257('0x55')]({'name':_0x2a1266[_0xf257('0x1d')],'contentType':_0x2a1266[_0xf257('0x21')],'data':fs[_0xf257('0x62')](_0x15d77a)});}}}emlformat[_0xf257('0x63')](_0xaeeb41,function(_0xa8a688,_0x1d237f){if(_0xa8a688)return _0xcf63bb(_0xa8a688);fs[_0xf257('0x64')](path[_0xf257('0x4e')](_0x5edcc5,util['format'](_0xf257('0x65'),_0x1dd960)),_0x1d237f);return _0x5da2d(_0x1d237f);});});})[_0xf257('0x18')](function(){return new BPromise(function(_0x37cc7d,_0x503224){zipdir(_0x5edcc5,{'saveTo':_0x2deb48},function(_0x3c89cf,_0x55481c){if(_0x3c89cf)return _0x503224(_0x3c89cf);return _0x37cc7d(_0x55481c);});})['then'](function(){return new BPromise(function(_0x5017f4,_0x2ab8bc){rimraf(_0x5edcc5,function(_0x15f66d){if(_0x15f66d)_0x2ab8bc(_0x15f66d);return _0x5017f4();});});})[_0xf257('0x18')](function(){return _0x44fdef[_0xf257('0x4b')](_0x2deb48,_0x1b0c22,function(_0x5cf736){if(!_0x5cf736)fs[_0xf257('0x66')](_0x2deb48);});});});}else{return _0x44fdef[_0xf257('0x1a')](0xc8);}})[_0xf257('0x24')](handleError(_0x44fdef,null));}; \ No newline at end of file +var _0x26fd=['omit','getMessages','filters','hasOwnProperty','order','sort','where','pick','filter','$gte','split','format','include','inlineCss','true','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachments','Messages','bcc','subject','createdAt','mkdirSync','from','missing.recipient@your.company.com','decode','headers','Bcc','message%d.eml','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','end','status','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','map','MailInteraction','fieldName','type','key','getOptions','findAll','catch','show','model','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','params','destroy','describe','addMessage','MailMessage','ids'];(function(_0x14af6d,_0xcd93b9){var _0x49c300=function(_0x1d1a85){while(--_0x1d1a85){_0x14af6d['push'](_0x14af6d['shift']());}};_0x49c300(++_0xcd93b9);}(_0x26fd,0x96));var _0xd26f=function(_0x152999,_0x1dd83b){_0x152999=_0x152999-0x0;var _0x32ef67=_0x26fd[_0x152999];return _0x32ef67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd26f('0x0'));var zipdir=require(_0xd26f('0x1'));var moment=require(_0xd26f('0x2'));var BPromise=require(_0xd26f('0x3'));var util=require(_0xd26f('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xd26f('0x5'));var juice=require(_0xd26f('0x6'));var Redis=require(_0xd26f('0x7'));var interaction=require(_0xd26f('0x8'));var qs=require(_0xd26f('0x9'));var logger=require(_0xd26f('0xa'))('api');var config=require(_0xd26f('0xb'));var db=require(_0xd26f('0xc'))['db'];var htmlEntities=require(_0xd26f('0xd'));config[_0xd26f('0xe')]=_[_0xd26f('0xf')](config[_0xd26f('0xe')],{'host':_0xd26f('0x10'),'port':0x18eb});var socket=require(_0xd26f('0x11'))(new Redis(config[_0xd26f('0xe')]));require(_0xd26f('0x12'))['register'](socket);function respondWithStatusCode(_0x2b52a7,_0x17893d){_0x17893d=_0x17893d||0xcc;return function(_0x124186){if(_0x124186){return _0x2b52a7['sendStatus'](_0x17893d);}return _0x2b52a7['status'](_0x17893d)[_0xd26f('0x13')]();};}function respondWithResult(_0x121a43,_0x1881be){_0x1881be=_0x1881be||0xc8;return function(_0xbacc66){if(_0xbacc66){return _0x121a43[_0xd26f('0x14')](_0x1881be)[_0xd26f('0x15')](_0xbacc66);}};}function respondWithFilteredResult(_0x65b8d,_0x5d27e1){return function(_0x51a449){if(_0x51a449){var _0x8dafb5=typeof _0x5d27e1[_0xd26f('0x16')]===_0xd26f('0x17')&&typeof _0x5d27e1[_0xd26f('0x18')]===_0xd26f('0x17');var _0x2806cb=_0x51a449[_0xd26f('0x19')];var _0x44eb2e=_0x8dafb5?0x0:_0x5d27e1[_0xd26f('0x16')];var _0x31a499=_0x8dafb5?_0x51a449[_0xd26f('0x19')]:_0x5d27e1[_0xd26f('0x16')]+_0x5d27e1[_0xd26f('0x18')];var _0xabf773;if(_0x31a499>=_0x2806cb){_0x31a499=_0x2806cb;_0xabf773=0xc8;}else{_0xabf773=0xce;}_0x65b8d[_0xd26f('0x14')](_0xabf773);return _0x65b8d[_0xd26f('0x1a')]('Content-Range',_0x44eb2e+'-'+_0x31a499+'/'+_0x2806cb)[_0xd26f('0x15')](_0x51a449);}return null;};}function saveUpdates(_0x3d617e){return function(_0x3058ff){if(_0x3058ff){return _0x3058ff[_0xd26f('0x1b')](_0x3d617e)[_0xd26f('0x1c')](function(_0x528075){return _0x528075;});}return null;};}function removeEntity(_0x445163){return function(_0x341110){if(_0x341110){return _0x341110['destroy']()[_0xd26f('0x1c')](function(){_0x445163[_0xd26f('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x387977){return function(_0x214a18){if(!_0x214a18){_0x387977['sendStatus'](0x194);}return _0x214a18;};}function handleError(_0x5b026e,_0x255eec){_0x255eec=_0x255eec||0x1f4;return function(_0x320a7f){logger[_0xd26f('0x1d')](_0x320a7f[_0xd26f('0x1e')]);if(_0x320a7f['name']){delete _0x320a7f[_0xd26f('0x1f')];}_0x5b026e[_0xd26f('0x14')](_0x255eec)[_0xd26f('0x20')](_0x320a7f);};}exports['index']=function(_0x463a2a,_0x33dce2){var _0x3ea413={};var _0x1fdcfa=_[_0xd26f('0x21')](db[_0xd26f('0x22')]['rawAttributes'],function(_0x5e39cc){return{'name':_0x5e39cc[_0xd26f('0x23')],'type':_0x5e39cc[_0xd26f('0x24')][_0xd26f('0x25')]};});_0x3ea413=qs[_0xd26f('0x26')](_0x1fdcfa,_0x463a2a);return interaction[_0xd26f('0x27')]('mail',_0x463a2a['query'],_0x463a2a['user'],_0x3ea413,_0x1fdcfa)[_0xd26f('0x1c')](respondWithFilteredResult(_0x33dce2,_0x3ea413))[_0xd26f('0x28')](handleError(_0x33dce2,null));};exports[_0xd26f('0x29')]=function(_0x19ec59,_0x1cba41){var _0x4fa607={'raw':![],'where':{'id':_0x19ec59['params']['id']}},_0x1a0c1b={};_0x1a0c1b[_0xd26f('0x2a')]=_['keys'](db['MailInteraction'][_0xd26f('0x2b')]);_0x1a0c1b[_0xd26f('0x2c')]=_[_0xd26f('0x2d')](_0x19ec59[_0xd26f('0x2c')]);_0x1a0c1b['filters']=_[_0xd26f('0x2e')](_0x1a0c1b[_0xd26f('0x2a')],_0x1a0c1b[_0xd26f('0x2c')]);_0x4fa607[_0xd26f('0x2f')]=_[_0xd26f('0x2e')](_0x1a0c1b[_0xd26f('0x2a')],qs[_0xd26f('0x30')](_0x19ec59[_0xd26f('0x2c')][_0xd26f('0x30')]));_0x4fa607[_0xd26f('0x2f')]=_0x4fa607[_0xd26f('0x2f')][_0xd26f('0x31')]?_0x4fa607[_0xd26f('0x2f')]:_0x1a0c1b['model'];if(_0x19ec59[_0xd26f('0x2c')][_0xd26f('0x32')]){_0x4fa607['include']=[{'all':!![]}];}_0x4fa607=_[_0xd26f('0x33')]({},_0x4fa607,_0x19ec59[_0xd26f('0x34')]);return db[_0xd26f('0x22')][_0xd26f('0x35')](_0x4fa607)[_0xd26f('0x1c')](handleEntityNotFound(_0x1cba41,null))[_0xd26f('0x1c')](respondWithResult(_0x1cba41,null))[_0xd26f('0x28')](handleError(_0x1cba41,null));};exports[_0xd26f('0x36')]=function(_0x2b0d12,_0x34d90b){return db[_0xd26f('0x22')][_0xd26f('0x36')](_0x2b0d12[_0xd26f('0x37')],{})['then'](respondWithResult(_0x34d90b,0xc9))['catch'](handleError(_0x34d90b,null));};exports['update']=function(_0x1b7b55,_0x2b8c2e){if(_0x1b7b55[_0xd26f('0x37')]['id']){delete _0x1b7b55['body']['id'];}return db[_0xd26f('0x22')][_0xd26f('0x35')]({'where':{'id':_0x1b7b55[_0xd26f('0x38')]['id']}})[_0xd26f('0x1c')](handleEntityNotFound(_0x2b8c2e,null))[_0xd26f('0x1c')](saveUpdates(_0x1b7b55['body'],null))[_0xd26f('0x1c')](respondWithResult(_0x2b8c2e,null))[_0xd26f('0x28')](handleError(_0x2b8c2e,null));};exports[_0xd26f('0x39')]=function(_0x1297e0,_0x1bced5){return db[_0xd26f('0x22')][_0xd26f('0x35')]({'where':{'id':_0x1297e0[_0xd26f('0x38')]['id']}})[_0xd26f('0x1c')](handleEntityNotFound(_0x1bced5,null))[_0xd26f('0x1c')](removeEntity(_0x1bced5,null))[_0xd26f('0x28')](handleError(_0x1bced5,null));};exports[_0xd26f('0x3a')]=function(_0x56d77c,_0xf44a23){return db[_0xd26f('0x22')][_0xd26f('0x3a')]()[_0xd26f('0x1c')](respondWithResult(_0xf44a23,null))[_0xd26f('0x28')](handleError(_0xf44a23,null));};exports[_0xd26f('0x3b')]=function(_0x574d51,_0x642b9e){return db[_0xd26f('0x3c')][_0xd26f('0x35')]({'where':{'id':_0x574d51[_0xd26f('0x38')]['id']}})['then'](handleEntityNotFound(_0x642b9e,null))[_0xd26f('0x1c')](function(_0xf49732){if(_0xf49732){return _0xf49732['addMessage'](_0x574d51[_0xd26f('0x37')][_0xd26f('0x3d')],_[_0xd26f('0x3e')](_0x574d51[_0xd26f('0x37')],[_0xd26f('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x642b9e,null))['catch'](handleError(_0x642b9e,null));};exports[_0xd26f('0x3f')]=function(_0x3a0963,_0x358a6e){var _0x30a480={'raw':![],'where':{}};var _0x3251a6={};var _0x61be1d={'count':0x0,'rows':[]};return db[_0xd26f('0x22')]['findOne']({'where':{'id':_0x3a0963[_0xd26f('0x38')]['id']}})[_0xd26f('0x1c')](handleEntityNotFound(_0x358a6e,null))[_0xd26f('0x1c')](function(_0x497d43){if(_0x497d43){_0x3251a6[_0xd26f('0x2a')]=_['keys'](db[_0xd26f('0x3c')][_0xd26f('0x2b')]);_0x3251a6['query']=_[_0xd26f('0x2d')](_0x3a0963[_0xd26f('0x2c')]);_0x3251a6[_0xd26f('0x40')]=_[_0xd26f('0x2e')](_0x3251a6[_0xd26f('0x2a')],_0x3251a6[_0xd26f('0x2c')]);_0x30a480[_0xd26f('0x2f')]=_[_0xd26f('0x2e')](_0x3251a6[_0xd26f('0x2a')],qs[_0xd26f('0x30')](_0x3a0963[_0xd26f('0x2c')]['fields']));_0x30a480[_0xd26f('0x2f')]=_0x30a480[_0xd26f('0x2f')][_0xd26f('0x31')]?_0x30a480['attributes']:_0x3251a6['model'];if(!_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x41')]('nolimit')){_0x30a480[_0xd26f('0x18')]=qs[_0xd26f('0x18')](_0x3a0963['query'][_0xd26f('0x18')]);_0x30a480[_0xd26f('0x16')]=qs['offset'](_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x16')]);}_0x30a480[_0xd26f('0x42')]=qs[_0xd26f('0x43')](_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x43')]);_0x30a480[_0xd26f('0x44')]=qs[_0xd26f('0x40')](_[_0xd26f('0x45')](_0x3a0963[_0xd26f('0x2c')],_0x3251a6[_0xd26f('0x40')]));_0x30a480[_0xd26f('0x44')]['MailInteractionId']=_0x497d43['id'];if(_0x3a0963['query']['filter']){_0x30a480[_0xd26f('0x44')]=_['merge'](_0x30a480[_0xd26f('0x44')],{'$or':_[_0xd26f('0x21')](_0x30a480[_0xd26f('0x2f')],function(_0x1806cc){var _0x2bdf72={};_0x2bdf72[_0x1806cc]={'$like':'%'+_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x46')]+'%'};return _0x2bdf72;})});}if(_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x47')]){var _0x46cbd3=_0x3a0963['query'][_0xd26f('0x47')][_0xd26f('0x48')](',');var _0x2e5ac2={};_0x2e5ac2[_0x46cbd3[0x0]]={'$gte':moment(_0x46cbd3[0x1])[_0xd26f('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x30a480[_0xd26f('0x44')]=_['merge'](_0x30a480[_0xd26f('0x44')],_0x2e5ac2);}_0x30a480=_[_0xd26f('0x33')]({},_0x30a480,_0x3a0963[_0xd26f('0x34')]);return db[_0xd26f('0x3c')][_0xd26f('0x19')]({'where':_0x30a480[_0xd26f('0x44')]})[_0xd26f('0x1c')](function(_0x1349fc){_0x61be1d[_0xd26f('0x19')]=_0x1349fc;if(_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x32')]){_0x30a480[_0xd26f('0x4a')]=[{'all':!![]}];}return db[_0xd26f('0x3c')][_0xd26f('0x27')](_0x30a480);})['then'](function(_0x322a0d){if(_0x3a0963[_0xd26f('0x2c')][_0xd26f('0x4b')]===_0xd26f('0x4c')){for(var _0x1a166c=0x0;_0x1a166c<_0x322a0d[_0xd26f('0x31')];_0x1a166c++){_0x322a0d[_0x1a166c][_0xd26f('0x37')]=juice(_0x322a0d[_0x1a166c][_0xd26f('0x37')]);}}_0x61be1d['rows']=_0x322a0d;return _0x61be1d;});}})[_0xd26f('0x1c')](respondWithFilteredResult(_0x358a6e,_0x30a480))[_0xd26f('0x28')](handleError(_0x358a6e,null));};exports[_0xd26f('0x4d')]=function(_0x187d13,_0xfbbeff){return db[_0xd26f('0x22')]['find']({'where':{'id':_0x187d13[_0xd26f('0x38')]['id']}})[_0xd26f('0x1c')](handleEntityNotFound(_0xfbbeff,null))[_0xd26f('0x1c')](function(_0x375807){if(_0x375807){return _0x375807[_0xd26f('0x4e')](_0x187d13[_0xd26f('0x37')][_0xd26f('0x3d')],_[_0xd26f('0x3e')](_0x187d13['body'],['ids','id'])||{})[_0xd26f('0x4f')](function(){return db[_0xd26f('0x50')]['findAll']({'attributes':['id',_0xd26f('0x1f'),'color'],'where':{'id':_0x187d13['body']['ids']}});})[_0xd26f('0x1c')](function(_0x1979a6){socket[_0xd26f('0x51')](_0xd26f('0x52'),{'id':Number(_0x187d13[_0xd26f('0x38')]['id']),'tags':_0x1979a6||[]});return{'id':Number(_0x187d13['params']['id']),'tags':_0x1979a6||[]};});}})['then'](respondWithResult(_0xfbbeff,null))[_0xd26f('0x28')](handleError(_0xfbbeff,null));};exports[_0xd26f('0x53')]=function(_0x1823a9,_0x361c43){return db[_0xd26f('0x22')][_0xd26f('0x35')]({'where':{'id':_0x1823a9['params']['id']}})[_0xd26f('0x1c')](handleEntityNotFound(_0x361c43,null))[_0xd26f('0x1c')](function(_0x149080){if(_0x149080){return _0x149080[_0xd26f('0x53')](_0x1823a9[_0xd26f('0x2c')][_0xd26f('0x3d')]);}})['then'](respondWithStatusCode(_0x361c43,null))[_0xd26f('0x28')](handleError(_0x361c43,null));};exports[_0xd26f('0x54')]=function(_0x444ca2,_0x583511){var _0x1001ec=moment()['unix']()['toString']();var _0x2358dd=path['join'](config['root'],_0xd26f('0x55'),_0xd26f('0x56'),_0xd26f('0x57'));var _0x411d52=path[_0xd26f('0x58')](config['root'],_0xd26f('0x55'),_0xd26f('0x56'),_0xd26f('0x59'));var _0x2b25bf=path['join'](_0x2358dd,_0x1001ec);var _0x12c3e8=util['format'](_0xd26f('0x5a'),_0x444ca2[_0xd26f('0x38')]['id'],_0x1001ec);var _0x341ef0=path[_0xd26f('0x58')](_0x2358dd,_0x12c3e8);var _0x351430=[];if(_0x444ca2[_0xd26f('0x2c')][_0xd26f('0x59')]){_0x351430[_0xd26f('0x5b')]({'model':db['Attachment'],'as':_0xd26f('0x5c'),'raw':!![]});}var _0x45efe3=[{'model':db['MailMessage'],'as':_0xd26f('0x5d'),'attributes':['id',_0xd26f('0x37'),'from','to','cc',_0xd26f('0x5e'),_0xd26f('0x5f'),_0xd26f('0x60')],'where':{'secret':![]},'order':qs[_0xd26f('0x43')]('id'),'include':_0x351430}];return db[_0xd26f('0x22')][_0xd26f('0x35')]({'where':{'id':_0x444ca2[_0xd26f('0x38')]['id']},'include':_0x45efe3})[_0xd26f('0x1c')](handleEntityNotFound(_0x583511,null))[_0xd26f('0x1c')](function(_0x2cf9e9){if(_0x2cf9e9&&_0x2cf9e9[_0xd26f('0x5d')]){var _0x5cef47=_0x2cf9e9['get']({'plain':!![]});fs[_0xd26f('0x61')](_0x2b25bf);return BPromise['each'](_0x5cef47[_0xd26f('0x5d')],function(_0x53ae2d,_0x2c2197){var _0x5e43c6={'from':_0x53ae2d[_0xd26f('0x62')],'to':_0x53ae2d['to']||_0xd26f('0x63'),'subject':_0x53ae2d[_0xd26f('0x5f')],'html':htmlEntities[_0xd26f('0x64')](_0x53ae2d['body']),'headers':{'Date':moment(_0x53ae2d['createdAt'])[_0xd26f('0x49')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x53ae2d['cc']){_0x5e43c6[_0xd26f('0x65')]['Cc']=_0x53ae2d['cc'];}if(_0x53ae2d['bcc']){_0x5e43c6[_0xd26f('0x65')][_0xd26f('0x66')]=_0x53ae2d[_0xd26f('0x5e')];}return new BPromise(function(_0x50217c,_0x148d18){if(_0x53ae2d[_0xd26f('0x5c')]){for(var _0x509e13=0x0;_0x509e13<_0x53ae2d[_0xd26f('0x5c')][_0xd26f('0x31')];_0x509e13++){var _0x7d359=_0x53ae2d[_0xd26f('0x5c')][_0x509e13];var _0x3fdfba=path[_0xd26f('0x58')](_0x411d52,_0x7d359['basename']);if(fs['existsSync'](_0x3fdfba)){_0x5e43c6[_0xd26f('0x59')][_0xd26f('0x5b')]({'name':_0x7d359[_0xd26f('0x1f')],'contentType':_0x7d359[_0xd26f('0x24')],'data':fs['readFileSync'](_0x3fdfba)});}}}emlformat['build'](_0x5e43c6,function(_0x46139c,_0x41a092){if(_0x46139c)return _0x148d18(_0x46139c);fs['writeFileSync'](path['join'](_0x2b25bf,util[_0xd26f('0x49')](_0xd26f('0x67'),_0x2c2197)),_0x41a092);return _0x50217c(_0x41a092);});});})['then'](function(){return new BPromise(function(_0x5a4377,_0x7fbb6d){zipdir(_0x2b25bf,{'saveTo':_0x341ef0},function(_0x38c350,_0x427c01){if(_0x38c350)return _0x7fbb6d(_0x38c350);return _0x5a4377(_0x427c01);});})[_0xd26f('0x1c')](function(){return new BPromise(function(_0x24c550,_0x5f7cd0){rimraf(_0x2b25bf,function(_0x195f65){if(_0x195f65)_0x5f7cd0(_0x195f65);return _0x24c550();});});})['then'](function(){return _0x583511['download'](_0x341ef0,_0x12c3e8,function(_0x247ca6){if(!_0x247ca6)fs[_0xd26f('0x68')](_0x341ef0);});});});}else{return _0x583511[_0xd26f('0x69')](0xc8);}})['catch'](handleError(_0x583511,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index cdf1b95..ae60239 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 _0x8dcd=['events','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0x8dcd,0x120));var _0xd8dc=function(_0x4669e7,_0x1d2a47){_0x4669e7=_0x4669e7-0x0;var _0x394871=_0x8dcd[_0x4669e7];return _0x394871;};'use strict';var EventEmitter=require(_0xd8dc('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xd8dc('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xd8dc('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd8dc('0x3')](0x0);var events={'afterCreate':_0xd8dc('0x4'),'afterUpdate':'update','afterDestroy':_0xd8dc('0x5')};function emitEvent(_0x49ba11){return function(_0x1b3869,_0x56c72e,_0x4ddcd4){_0x1b3869[_0xd8dc('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x57763f){_0x1b3869[_0xd8dc('0x7')]('Users',_0x57763f[_0xd8dc('0x8')](function(_0x11185a){return{'id':_0x11185a['id']};}));return MailMessage[_0xd8dc('0x9')]({'where':{'MailInteractionId':_0x1b3869['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x35229c){_0x1b3869[_0xd8dc('0x7')](_0xd8dc('0xa'),_0x35229c[_0xd8dc('0xb')]);MailInteractionEvents[_0xd8dc('0xc')](_0x49ba11+':'+_0x1b3869['id'],_0x1b3869);MailInteractionEvents[_0xd8dc('0xc')](_0x49ba11,_0x1b3869);_0x4ddcd4(null);})[_0xd8dc('0xd')](_0x4ddcd4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xd8dc('0xe')](e,emitEvent(event));}}module[_0xd8dc('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x2b74=['hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0x2b74,0xd4));var _0x42b7=function(_0x4ad047,_0x1d7e61){_0x4ad047=_0x4ad047-0x0;var _0x1ab662=_0x2b74[_0x4ad047];return _0x1ab662;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x42b7('0x0'))['db'][_0x42b7('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x42b7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x42b7('0x3'),'afterUpdate':_0x42b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x264aa9){return function(_0xfc981b,_0x12ff51,_0x46625d){_0xfc981b['getUsers']({'attributes':['id'],'raw':!![]})[_0x42b7('0x5')](function(_0x81115b){_0xfc981b[_0x42b7('0x6')](_0x42b7('0x7'),_0x81115b[_0x42b7('0x8')](function(_0x38b94d){return{'id':_0x38b94d['id']};}));return MailMessage[_0x42b7('0x9')]({'where':{'MailInteractionId':_0xfc981b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42b7('0x5')](function(_0x26f589){_0xfc981b['setDataValue'](_0x42b7('0xa'),_0x26f589[_0x42b7('0xb')]);MailInteractionEvents[_0x42b7('0xc')](_0x264aa9+':'+_0xfc981b['id'],_0xfc981b);MailInteractionEvents[_0x42b7('0xc')](_0x264aa9,_0xfc981b);_0x46625d(null);})['catch'](_0x46625d(null));};}for(var e in events){if(events[_0x42b7('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x42b7('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b660cc3..5554a50 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 _0x6555=['path','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','closed','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise'];(function(_0x1e9e6a,_0x439920){var _0x2ad57e=function(_0x115064){while(--_0x115064){_0x1e9e6a['push'](_0x1e9e6a['shift']());}};_0x2ad57e(++_0x439920);}(_0x6555,0xa3));var _0x5655=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6555[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5655('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5655('0x1'));var moment=require(_0x5655('0x2'));var BPromise=require(_0x5655('0x3'));var rp=require(_0x5655('0x4'));var fs=require('fs');var path=require(_0x5655('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5655('0x6'));module[_0x5655('0x7')]=function(_0x4de2cb,_0x30f9b5){return _0x4de2cb['define'](_0x5655('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x5655('0x9'),'fields':[_0x5655('0xa'),'to'],'type':_0x5655('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3e01b6,_0x140e87,_0x3ccdce){if(_0x3e01b6[_0x5655('0xc')]){_0x3e01b6[_0x5655('0xd')]=moment()[_0x5655('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e01b6['closed']){_0x3e01b6[_0x5655('0xf')]=moment()['format'](_0x5655('0x10'));}_0x3ccdce(null,_0x140e87);},'beforeUpdate':function(_0x46bcaa,_0x44b9c5,_0x38191e){if(_0x46bcaa['changed'](_0x5655('0xc'))){_0x46bcaa[_0x5655('0xd')]=_0x46bcaa[_0x5655('0xc')]?moment()[_0x5655('0xe')](_0x5655('0x10')):null;}if(_0x46bcaa[_0x5655('0x11')]('closed')){_0x46bcaa[_0x5655('0xf')]=moment()[_0x5655('0xe')](_0x5655('0x10'));_0x46bcaa[_0x5655('0xc')]=null;_0x46bcaa[_0x5655('0xd')]=null;}_0x38191e(null,_0x46bcaa);},'afterUpdate':function(_0x2ffbf6,_0x3ef6ac,_0x566ae6){var _0xf30ef5=_0x4de2cb['models'];var _0x3b152a=_0x2ffbf6['get']({'plain':!![]});if(_0x3b152a[_0x5655('0x12')]){return _0xf30ef5[_0x5655('0x13')][_0x5655('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x3b152a['id']}})[_0x5655('0x15')](function(){_0x566ae6();})[_0x5655('0x16')](function(_0x1e4882){_0x566ae6(_0x1e4882);});}else{_0x566ae6();}}},'charset':'utf8mb4','collate':_0x5655('0x17')});}; \ No newline at end of file +var _0x4038=['then','catch','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatus','substatusAt','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','MailMessage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4038,0xb9));var _0x8403=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x4038[_0x1ac120];return _0x19b703;};'use strict';var _=require('lodash');var util=require(_0x8403('0x0'));var logger=require(_0x8403('0x1'))(_0x8403('0x2'));var moment=require(_0x8403('0x3'));var BPromise=require(_0x8403('0x4'));var rp=require(_0x8403('0x5'));var fs=require('fs');var path=require(_0x8403('0x6'));var rimraf=require(_0x8403('0x7'));var config=require(_0x8403('0x8'));var attributes=require(_0x8403('0x9'));module[_0x8403('0xa')]=function(_0x2cd93f,_0x5ba744){return _0x2cd93f[_0x8403('0xb')](_0x8403('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x8403('0xd'),'fields':['subject','to'],'type':_0x8403('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a797e,_0x184ce4,_0x55694c){if(_0x2a797e[_0x8403('0xf')]){_0x2a797e[_0x8403('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2a797e[_0x8403('0x11')]){_0x2a797e[_0x8403('0x12')]=moment()[_0x8403('0x13')](_0x8403('0x14'));}_0x55694c(null,_0x184ce4);},'beforeUpdate':function(_0x5d5a45,_0x1d7ae8,_0x5a39c2){if(_0x5d5a45[_0x8403('0x15')](_0x8403('0xf'))){_0x5d5a45[_0x8403('0x10')]=_0x5d5a45[_0x8403('0xf')]?moment()[_0x8403('0x13')](_0x8403('0x14')):null;}if(_0x5d5a45['changed'](_0x8403('0x11'))){_0x5d5a45[_0x8403('0x12')]=moment()[_0x8403('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d5a45[_0x8403('0xf')]=null;_0x5d5a45[_0x8403('0x10')]=null;}_0x5a39c2(null,_0x5d5a45);},'afterUpdate':function(_0x1fed99,_0x40ec79,_0x51ffd5){var _0x18aa08=_0x2cd93f['models'];var _0x3d67b3=_0x1fed99['get']({'plain':!![]});if(_0x3d67b3[_0x8403('0x11')]){return _0x18aa08[_0x8403('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3d67b3['id']}})[_0x8403('0x17')](function(){_0x51ffd5();})[_0x8403('0x18')](function(_0x4f0dc3){_0x51ffd5(_0x4f0dc3);});}else{_0x51ffd5();}}},'charset':_0x8403('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index bbf51a3..be9f418 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 _0xcbd3=['where','attributes','limit','UpdateMailInteraction','catch','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','MailInteraction','update','body','options'];(function(_0x5cf4aa,_0x2e5fc2){var _0x1c3458=function(_0x5db6e9){while(--_0x5db6e9){_0x5cf4aa['push'](_0x5cf4aa['shift']());}};_0x1c3458(++_0x2e5fc2);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x18634b,_0x15af15){_0x18634b=_0x18634b-0x0;var _0x170dce=_0xcbd3[_0x18634b];return _0x170dce;};'use strict';var _=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var moment=require(_0x3cbd('0x2'));var BPromise=require(_0x3cbd('0x3'));var rs=require(_0x3cbd('0x4'));var fs=require('fs');var Redis=require(_0x3cbd('0x5'));var db=require(_0x3cbd('0x6'))['db'];var utils=require(_0x3cbd('0x7'));var logger=require(_0x3cbd('0x8'))(_0x3cbd('0x9'));var config=require('../../config/environment');var jayson=require(_0x3cbd('0xa'));var client=jayson[_0x3cbd('0xb')]['http']({'port':0x232a});config[_0x3cbd('0xc')]=_['defaults'](config[_0x3cbd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3cbd('0xd'))(new Redis(config[_0x3cbd('0xc')]));require(_0x3cbd('0xe'))[_0x3cbd('0xf')](socket);function respondWithRpcPromise(_0x44a388,_0x4fdaee,_0x37934c){return new BPromise(function(_0x530ad1,_0x38806e){return client[_0x3cbd('0x10')](_0x44a388,_0x37934c)[_0x3cbd('0x11')](function(_0x5918ff){logger[_0x3cbd('0x12')](_0x3cbd('0x13'),_0x4fdaee,_0x3cbd('0x14'));logger[_0x3cbd('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4fdaee,'request\x20sent',JSON[_0x3cbd('0x16')](_0x5918ff));if(_0x5918ff[_0x3cbd('0x17')]){if(_0x5918ff['error']['code']===0x1f4){logger['error'](_0x3cbd('0x13'),_0x4fdaee,_0x5918ff['error']['message']);return _0x38806e(_0x5918ff[_0x3cbd('0x17')][_0x3cbd('0x18')]);}logger[_0x3cbd('0x17')](_0x3cbd('0x13'),_0x4fdaee,_0x5918ff[_0x3cbd('0x17')][_0x3cbd('0x18')]);return _0x530ad1(_0x5918ff['error'][_0x3cbd('0x18')]);}else{logger[_0x3cbd('0x12')](_0x3cbd('0x13'),_0x4fdaee,'request\x20sent');_0x530ad1(_0x5918ff['result'][_0x3cbd('0x18')]);}})['catch'](function(_0x278742){logger[_0x3cbd('0x17')]('MailInteraction,\x20%s,\x20%s',_0x4fdaee,_0x278742);_0x38806e(_0x278742);});});}exports['UpdateMailInteraction']=function(_0x4587fc){var _0x2a986e=this;return new Promise(function(_0x3b41a2,_0x226050){return db[_0x3cbd('0x19')][_0x3cbd('0x1a')](_0x4587fc[_0x3cbd('0x1b')],{'raw':_0x4587fc[_0x3cbd('0x1c')]?_0x4587fc[_0x3cbd('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4587fc['options']?_0x4587fc[_0x3cbd('0x1c')][_0x3cbd('0x1d')]||null:null,'attributes':_0x4587fc[_0x3cbd('0x1c')]?_0x4587fc[_0x3cbd('0x1c')][_0x3cbd('0x1e')]||null:null,'limit':_0x4587fc['options']?_0x4587fc[_0x3cbd('0x1c')][_0x3cbd('0x1f')]||null:null})[_0x3cbd('0x11')](function(_0x1fca3c){logger[_0x3cbd('0x12')](_0x3cbd('0x20'),_0x4587fc);logger[_0x3cbd('0x15')](_0x3cbd('0x20'),_0x4587fc,JSON[_0x3cbd('0x16')](_0x1fca3c));_0x3b41a2(_0x1fca3c);})[_0x3cbd('0x21')](function(_0x3009f3){logger[_0x3cbd('0x17')](_0x3cbd('0x20'),_0x3009f3[_0x3cbd('0x18')],_0x4587fc);_0x226050(_0x2a986e[_0x3cbd('0x17')](0x1f4,_0x3009f3[_0x3cbd('0x18')]));});});};exports[_0x3cbd('0x22')]=function(_0xc0c7a7){return new Promise(function(_0x3717aa,_0x517338){return db[_0x3cbd('0x19')][_0x3cbd('0x23')]({'where':_0xc0c7a7[_0x3cbd('0x1c')]?_0xc0c7a7['options'][_0x3cbd('0x1d')]||null:null})['then'](function(_0x463f84){if(_0x463f84){return _0x463f84[_0x3cbd('0x24')](_0xc0c7a7[_0x3cbd('0x1b')][_0x3cbd('0x25')],_['omit'](_0xc0c7a7[_0x3cbd('0x1b')],[_0x3cbd('0x25'),'id'])||{});}})[_0x3cbd('0x26')](function(_0x2c2ad0){logger[_0x3cbd('0x12')]('AddTags',_0xc0c7a7);logger['debug'](_0x3cbd('0x27'),_0xc0c7a7,JSON['stringify'](_0x2c2ad0));_0x3717aa(_0x2c2ad0);})[_0x3cbd('0x21')](function(_0x13a48f){logger['error'](_0x3cbd('0x27'),_0x13a48f[_0x3cbd('0x18')],_0xc0c7a7);_0x517338(_this[_0x3cbd('0x17')](0x1f4,_0x13a48f[_0x3cbd('0x18')]));});});}; \ No newline at end of file +var _0xe7db=['http','defaults','localhost','redis','./mailInteraction.socket','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b1ac0,_0x3f626c){var _0x3a8c5b=function(_0x110468){while(--_0x110468){_0x3b1ac0['push'](_0x3b1ac0['shift']());}};_0x3a8c5b(++_0x3f626c);}(_0xe7db,0x1bd));var _0xbe7d=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xe7db[_0x3b4b1d];return _0x488c36;};'use strict';var _=require(_0xbe7d('0x0'));var util=require(_0xbe7d('0x1'));var moment=require(_0xbe7d('0x2'));var BPromise=require(_0xbe7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe7d('0x4'));var db=require(_0xbe7d('0x5'))['db'];var utils=require(_0xbe7d('0x6'));var logger=require(_0xbe7d('0x7'))('rpc');var config=require(_0xbe7d('0x8'));var jayson=require(_0xbe7d('0x9'));var client=jayson[_0xbe7d('0xa')][_0xbe7d('0xb')]({'port':0x232a});config['redis']=_[_0xbe7d('0xc')](config['redis'],{'host':_0xbe7d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe7d('0xe')]));require(_0xbe7d('0xf'))['register'](socket);function respondWithRpcPromise(_0x5e7b9a,_0x567926,_0x21a0b5){return new BPromise(function(_0x580551,_0x145967){return client[_0xbe7d('0x10')](_0x5e7b9a,_0x21a0b5)['then'](function(_0xa2fad7){logger[_0xbe7d('0x11')](_0xbe7d('0x12'),_0x567926,_0xbe7d('0x13'));logger[_0xbe7d('0x14')](_0xbe7d('0x15'),_0x567926,_0xbe7d('0x13'),JSON[_0xbe7d('0x16')](_0xa2fad7));if(_0xa2fad7[_0xbe7d('0x17')]){if(_0xa2fad7[_0xbe7d('0x17')]['code']===0x1f4){logger[_0xbe7d('0x17')](_0xbe7d('0x12'),_0x567926,_0xa2fad7[_0xbe7d('0x17')][_0xbe7d('0x18')]);return _0x145967(_0xa2fad7[_0xbe7d('0x17')][_0xbe7d('0x18')]);}logger[_0xbe7d('0x17')](_0xbe7d('0x12'),_0x567926,_0xa2fad7[_0xbe7d('0x17')][_0xbe7d('0x18')]);return _0x580551(_0xa2fad7[_0xbe7d('0x17')]['message']);}else{logger[_0xbe7d('0x11')](_0xbe7d('0x12'),_0x567926,_0xbe7d('0x13'));_0x580551(_0xa2fad7['result'][_0xbe7d('0x18')]);}})[_0xbe7d('0x19')](function(_0x319597){logger['error'](_0xbe7d('0x12'),_0x567926,_0x319597);_0x145967(_0x319597);});});}exports[_0xbe7d('0x1a')]=function(_0x190568){var _0x3c7e5a=this;return new Promise(function(_0x12d4c8,_0x15dfc5){return db[_0xbe7d('0x1b')]['update'](_0x190568[_0xbe7d('0x1c')],{'raw':_0x190568[_0xbe7d('0x1d')]?_0x190568[_0xbe7d('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x190568['options']?_0x190568[_0xbe7d('0x1d')][_0xbe7d('0x1e')]||null:null,'attributes':_0x190568['options']?_0x190568['options'][_0xbe7d('0x1f')]||null:null,'limit':_0x190568[_0xbe7d('0x1d')]?_0x190568[_0xbe7d('0x1d')][_0xbe7d('0x20')]||null:null})['then'](function(_0x486f33){logger[_0xbe7d('0x11')](_0xbe7d('0x1a'),_0x190568);logger[_0xbe7d('0x14')](_0xbe7d('0x1a'),_0x190568,JSON[_0xbe7d('0x16')](_0x486f33));_0x12d4c8(_0x486f33);})[_0xbe7d('0x19')](function(_0x5c2529){logger[_0xbe7d('0x17')]('UpdateMailInteraction',_0x5c2529[_0xbe7d('0x18')],_0x190568);_0x15dfc5(_0x3c7e5a[_0xbe7d('0x17')](0x1f4,_0x5c2529['message']));});});};exports[_0xbe7d('0x21')]=function(_0x2d823c){return new Promise(function(_0x136643,_0x2acfb3){return db[_0xbe7d('0x1b')][_0xbe7d('0x22')]({'where':_0x2d823c[_0xbe7d('0x1d')]?_0x2d823c[_0xbe7d('0x1d')][_0xbe7d('0x1e')]||null:null})['then'](function(_0x24ab26){if(_0x24ab26){return _0x24ab26['addTags'](_0x2d823c[_0xbe7d('0x1c')][_0xbe7d('0x23')],_['omit'](_0x2d823c[_0xbe7d('0x1c')],['ids','id'])||{});}})[_0xbe7d('0x24')](function(_0x12f910){logger[_0xbe7d('0x11')](_0xbe7d('0x25'),_0x2d823c);logger[_0xbe7d('0x14')](_0xbe7d('0x25'),_0x2d823c,JSON['stringify'](_0x12f910));_0x136643(_0x12f910);})[_0xbe7d('0x19')](function(_0x2538e7){logger['error'](_0xbe7d('0x25'),_0x2538e7[_0xbe7d('0x18')],_0x2d823c);_0x2acfb3(_this[_0xbe7d('0x17')](0x1f4,_0x2538e7[_0xbe7d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d7f68cb..d2e2a47 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 _0x3fe9=['save','update','emit','register','length','mailInteraction:'];(function(_0x1f9a45,_0x34ca93){var _0x44da98=function(_0xc4e603){while(--_0xc4e603){_0x1f9a45['push'](_0x1f9a45['shift']());}};_0x44da98(++_0x34ca93);}(_0x3fe9,0xd2));var _0x93fe=function(_0x321e10,_0x58919c){_0x321e10=_0x321e10-0x0;var _0x95149a=_0x3fe9[_0x321e10];return _0x95149a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x93fe('0x0'),'remove',_0x93fe('0x1')];function createListener(_0x2ca5b5,_0x1915a6){return function(_0x2e9220){_0x1915a6[_0x93fe('0x2')](_0x2ca5b5,_0x2e9220);};}function removeListener(_0x46d920,_0x5525cf){return function(){MailInteractionEvents['removeListener'](_0x46d920,_0x5525cf);};}exports[_0x93fe('0x3')]=function(_0x556e7e){for(var _0x317e34=0x0,_0x2b3c33=events[_0x93fe('0x4')];_0x317e34<_0x2b3c33;_0x317e34++){var _0xc8fa78=events[_0x317e34];var _0x4aff75=createListener(_0x93fe('0x5')+_0xc8fa78,_0x556e7e);MailInteractionEvents['on'](_0xc8fa78,_0x4aff75);}}; \ No newline at end of file +var _0x39d8=['save','remove','update','emit','register','./mailInteraction.events'];(function(_0xde0217,_0x43aa70){var _0x2346c5=function(_0x1b72fd){while(--_0x1b72fd){_0xde0217['push'](_0xde0217['shift']());}};_0x2346c5(++_0x43aa70);}(_0x39d8,0xd1));var _0x839d=function(_0x21e0cc,_0x2094c4){_0x21e0cc=_0x21e0cc-0x0;var _0x3a29a9=_0x39d8[_0x21e0cc];return _0x3a29a9;};'use strict';var MailInteractionEvents=require(_0x839d('0x0'));var events=[_0x839d('0x1'),_0x839d('0x2'),_0x839d('0x3')];function createListener(_0x22b53a,_0x4c7349){return function(_0x2d09c){_0x4c7349[_0x839d('0x4')](_0x22b53a,_0x2d09c);};}function removeListener(_0xd8c111,_0x4869b9){return function(){MailInteractionEvents['removeListener'](_0xd8c111,_0x4869b9);};}exports[_0x839d('0x5')]=function(_0x3afdde){for(var _0xc42386=0x0,_0x161131=events['length'];_0xc42386<_0x161131;_0xc42386++){var _0x13dcab=events[_0xc42386];var _0xaa52fb=createListener('mailInteraction:'+_0x13dcab,_0x3afdde);MailInteractionEvents['on'](_0x13dcab,_0xaa52fb);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index e01e65c..c56801f 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3157=['describe','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','/describe'];(function(_0x45d5d1,_0x1dd809){var _0x51ca55=function(_0x4c27f0){while(--_0x4c27f0){_0x45d5d1['push'](_0x45d5d1['shift']());}};_0x51ca55(++_0x1dd809);}(_0x3157,0x198));var _0x7315=function(_0x2f8970,_0x5ed876){_0x2f8970=_0x2f8970-0x0;var _0x185edc=_0x3157[_0x2f8970];return _0x185edc;};'use strict';var express=require(_0x7315('0x0'));var router=express[_0x7315('0x1')]();var auth=require(_0x7315('0x2'));var controller=require(_0x7315('0x3'));router['get'](_0x7315('0x4'),auth['isAuthenticated'](),controller[_0x7315('0x5')]);module[_0x7315('0x6')]=router; \ No newline at end of file +var _0xc69b=['/describe','isAuthenticated','exports','express','../../components/auth/service','get'];(function(_0x871ef5,_0x58880b){var _0x1f62ea=function(_0x13934c){while(--_0x13934c){_0x871ef5['push'](_0x871ef5['shift']());}};_0x1f62ea(++_0x58880b);}(_0xc69b,0xcf));var _0xbc69=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xc69b[_0x5c6994];return _0x1d5c84;};'use strict';var express=require(_0xbc69('0x0'));var router=express['Router']();var auth=require(_0xbc69('0x1'));var controller=require('./mailInteractionHasTag.controller');router[_0xbc69('0x2')](_0xbc69('0x3'),auth[_0xbc69('0x4')](),controller['describe']);module[_0xbc69('0x5')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index ed61164..db469be 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x4e1d1d,_0x3e265){var _0x81ea76=function(_0x3231f9){while(--_0x3231f9){_0x4e1d1d['push'](_0x4e1d1d['shift']());}};_0x81ea76(++_0x3e265);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x5957ab,_0x58515c){var _0x4515ba=function(_0x51878b){while(--_0x51878b){_0x5957ab['push'](_0x5957ab['shift']());}};_0x4515ba(++_0x58515c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 8e5d751..e9f6651 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb207=['sequelize'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb207,0x137));var _0x7b20=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0xb207[_0x3bceea];return _0x30a8d3;};'use strict';var Sequelize=require(_0x7b20('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0xcf2b=['sequelize','INTEGER'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xcf2b,0x1a6));var _0xbcf2=function(_0x21c068,_0x369d6a){_0x21c068=_0x21c068-0x0;var _0x5cf199=_0xcf2b[_0x21c068];return _0x5cf199;};'use strict';var Sequelize=require(_0xbcf2('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xbcf2('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 848ee8d..4e38f20 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04d2=['define','MailInteractionHasTag','mail_interaction_has_tags','./mailInteractionHasTag','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x04d2,0x16b));var _0x204d=function(_0x6c4aa0,_0x4b2969){_0x6c4aa0=_0x6c4aa0-0x0;var _0x484c23=_0x04d2[_0x6c4aa0];return _0x484c23;};'use strict';var attributes=require(_0x204d('0x0'));module[_0x204d('0x1')]=function(_0x2176a5){return _0x2176a5[_0x204d('0x2')](_0x204d('0x3'),attributes,{'tableName':_0x204d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69fc=['./mailInteractionHasTag','exports','define'];(function(_0x1e756c,_0x529247){var _0x15c5a9=function(_0x3fb132){while(--_0x3fb132){_0x1e756c['push'](_0x1e756c['shift']());}};_0x15c5a9(++_0x529247);}(_0x69fc,0xdb));var _0xc69f=function(_0x2be4bf,_0x2216a5){_0x2be4bf=_0x2be4bf-0x0;var _0x1907d1=_0x69fc[_0x2be4bf];return _0x1907d1;};'use strict';var attributes=require(_0xc69f('0x0'));module[_0xc69f('0x1')]=function(_0x38c8e9){return _0x38c8e9[_0xc69f('0x2')]('MailInteractionHasTag',attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a8110ed..5a4e912 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 _0x83e1=['download','isAuthenticated','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','show','/:id/download'];(function(_0x4b0695,_0x1e9f62){var _0xafd4cf=function(_0xb54c50){while(--_0xb54c50){_0x4b0695['push'](_0x4b0695['shift']());}};_0xafd4cf(++_0x1e9f62);}(_0x83e1,0x1ad));var _0x183e=function(_0xea3e42,_0x2e43f9){_0xea3e42=_0xea3e42-0x0;var _0x394ae9=_0x83e1[_0xea3e42];return _0x394ae9;};'use strict';var multer=require(_0x183e('0x0'));var util=require(_0x183e('0x1'));var path=require('path');var timeout=require(_0x183e('0x2'));var express=require('express');var router=express[_0x183e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x183e('0x4'));var config=require(_0x183e('0x5'));var controller=require('./mailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x183e('0x6')]);router[_0x183e('0x7')](_0x183e('0x8'),auth['isAuthenticated'](),controller[_0x183e('0x9')]);router[_0x183e('0x7')](_0x183e('0xa'),auth['isAuthenticated'](),controller[_0x183e('0xb')]);router[_0x183e('0x7')](_0x183e('0xc'),auth['isAuthenticated'](),controller[_0x183e('0xd')]);router['post']('/',auth[_0x183e('0xe')](),interaction[_0x183e('0xf')](_0x183e('0x10'),_0x183e('0x11')),controller[_0x183e('0x12')]);router[_0x183e('0x13')](_0x183e('0xa'),auth['isAuthenticated'](),controller['update']);router['put'](_0x183e('0x14'),auth[_0x183e('0xe')](),controller[_0x183e('0x15')]);router['put'](_0x183e('0x16'),auth[_0x183e('0xe')](),controller[_0x183e('0x17')]);router['delete'](_0x183e('0xa'),auth[_0x183e('0xe')](),controller[_0x183e('0x18')]);module[_0x183e('0x19')]=router; \ No newline at end of file +var _0x7d13=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x3b8aa9,_0x3d2c3a){var _0x19fa6a=function(_0x56a21b){while(--_0x56a21b){_0x3b8aa9['push'](_0x3b8aa9['shift']());}};_0x19fa6a(++_0x3d2c3a);}(_0x7d13,0x6c));var _0x37d1=function(_0x5619c3,_0x568923){_0x5619c3=_0x5619c3-0x0;var _0x66cf19=_0x7d13[_0x5619c3];return _0x66cf19;};'use strict';var multer=require('multer');var util=require(_0x37d1('0x0'));var path=require('path');var timeout=require(_0x37d1('0x1'));var express=require('express');var router=express[_0x37d1('0x2')]();var fs_extra=require(_0x37d1('0x3'));var auth=require(_0x37d1('0x4'));var interaction=require(_0x37d1('0x5'));var config=require(_0x37d1('0x6'));var controller=require('./mailMessage.controller');router[_0x37d1('0x7')]('/',auth[_0x37d1('0x8')](),controller[_0x37d1('0x9')]);router[_0x37d1('0x7')]('/describe',auth[_0x37d1('0x8')](),controller[_0x37d1('0xa')]);router[_0x37d1('0x7')](_0x37d1('0xb'),auth[_0x37d1('0x8')](),controller[_0x37d1('0xc')]);router[_0x37d1('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x37d1('0xd')]);router[_0x37d1('0xe')]('/',auth['isAuthenticated'](),interaction[_0x37d1('0xf')](_0x37d1('0x10'),_0x37d1('0x11')),controller[_0x37d1('0x12')]);router[_0x37d1('0x13')](_0x37d1('0xb'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x14')]);router['put'](_0x37d1('0x15'),auth[_0x37d1('0x8')](),controller['accept']);router[_0x37d1('0x13')](_0x37d1('0x16'),auth['isAuthenticated'](),controller[_0x37d1('0x17')]);router[_0x37d1('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x37d1('0x19')]);module[_0x37d1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 222cde3..5299078 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 _0xbe75=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','sequelize','exports','TEXT','long','medium'];(function(_0x1e2f88,_0x487272){var _0x241b2c=function(_0x2ba3ef){while(--_0x2ba3ef){_0x1e2f88['push'](_0x1e2f88['shift']());}};_0x241b2c(++_0x487272);}(_0xbe75,0x193));var _0x5be7=function(_0x464c22,_0x4510dd){_0x464c22=_0x464c22-0x0;var _0x5b715e=_0xbe75[_0x464c22];return _0x5b715e;};'use strict';var Sequelize=require(_0x5be7('0x0'));var _=require('lodash');module[_0x5be7('0x1')]={'body':{'type':Sequelize[_0x5be7('0x2')](_0x5be7('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5be7('0x2')](_0x5be7('0x4'))},'read':{'type':Sequelize[_0x5be7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5be7('0x6')]('in',_0x5be7('0x7')),'defaultValue':_0x5be7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5be7('0x8')](0x1fe)},'from':{'type':Sequelize[_0x5be7('0x8')]},'to':{'type':Sequelize[_0x5be7('0x2')](_0x5be7('0x3'))},'cc':{'type':Sequelize[_0x5be7('0x2')](_0x5be7('0x3'))},'bcc':{'type':Sequelize[_0x5be7('0x2')](_0x5be7('0x3'))},'subject':{'type':Sequelize[_0x5be7('0x2')]},'sentAt':{'type':Sequelize[_0x5be7('0x9')]},'attach':{'type':Sequelize[_0x5be7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5be7('0x2')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x5be7('0x3'))},'originChannel':{'type':Sequelize[_0x5be7('0x6')]('Email',_0x5be7('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x70eb=['DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x141016,_0x244c99){var _0x116459=function(_0x558c7d){while(--_0x558c7d){_0x141016['push'](_0x141016['shift']());}};_0x116459(++_0x244c99);}(_0x70eb,0xba));var _0xb70e=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x70eb[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0xb70e('0x0'));var _=require(_0xb70e('0x1'));module[_0xb70e('0x2')]={'body':{'type':Sequelize[_0xb70e('0x3')](_0xb70e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb70e('0x3')](_0xb70e('0x5'))},'read':{'type':Sequelize[_0xb70e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb70e('0x7')]('in',_0xb70e('0x8')),'defaultValue':_0xb70e('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb70e('0x9')](0x1fe)},'from':{'type':Sequelize[_0xb70e('0x9')]},'to':{'type':Sequelize[_0xb70e('0x3')](_0xb70e('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xb70e('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xb70e('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xb70e('0xa')]},'attach':{'type':Sequelize[_0xb70e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb70e('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xb70e('0x3')]('long')},'originCc':{'type':Sequelize[_0xb70e('0x3')](_0xb70e('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xb70e('0xc'),_0xb70e('0xd')),'defaultValue':_0xb70e('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 9194282..149a5b2 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 _0x5ead=['create','direction','out','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','CmContact','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','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','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','SELECT','motionChannel','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','Attachments','from','subject','decode','headers','Bcc','basename','push','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','count','set','Content-Range','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','length','options','update','body','find','params','destroy','describe'];(function(_0x2eed48,_0x3e98cc){var _0x15eb27=function(_0x2645b3){while(--_0x2645b3){_0x2eed48['push'](_0x2eed48['shift']());}};_0x15eb27(++_0x3e98cc);}(_0x5ead,0xf8));var _0xd5ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5ead[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd5ea('0x0'));var moment=require(_0xd5ea('0x1'));var BPromise=require(_0xd5ea('0x2'));var util=require(_0xd5ea('0x3'));var path=require(_0xd5ea('0x4'));var fs=require('fs');var _=require(_0xd5ea('0x5'));var Redis=require(_0xd5ea('0x6'));var htmlToText=require(_0xd5ea('0x7'));var qs=require(_0xd5ea('0x8'));var logger=require(_0xd5ea('0x9'))(_0xd5ea('0xa'));var interaction_log=require(_0xd5ea('0x9'))(_0xd5ea('0xb'));var config=require(_0xd5ea('0xc'));var db=require(_0xd5ea('0xd'))['db'];config[_0xd5ea('0xe')]=_[_0xd5ea('0xf')](config[_0xd5ea('0xe')],{'host':_0xd5ea('0x10'),'port':0x18eb});var socket=require(_0xd5ea('0x11'))(new Redis(config[_0xd5ea('0xe')]));var htmlEntities=require('html-entities');require(_0xd5ea('0x12'))[_0xd5ea('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd5ea('0x14')]['http']({'port':0x232c});var client9003=jayson[_0xd5ea('0x14')][_0xd5ea('0x15')]({'port':0x232b});var client9002=jayson[_0xd5ea('0x14')][_0xd5ea('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xa49488,_0x1b1b09,_0x12c477,_0x1aa530){return new BPromise(function(_0x126926,_0x191a1a){var _0x2ccfbc=_0x1aa530||client;return _0x2ccfbc[_0xd5ea('0x16')](_0xa49488,_0x12c477)[_0xd5ea('0x17')](function(_0x4c8f46){logger['info']('MailMessage,\x20%s,\x20%s',_0x1b1b09,_0xd5ea('0x18'));logger[_0xd5ea('0x19')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1b1b09,'request\x20sent',JSON['stringify'](_0x4c8f46));if(_0x4c8f46[_0xd5ea('0x1a')]){if(_0x4c8f46['error'][_0xd5ea('0x1b')]===0x1f4){logger[_0xd5ea('0x1a')](_0xd5ea('0x1c'),_0x1b1b09,_0x4c8f46['error']['message']);return _0x191a1a(_0x4c8f46[_0xd5ea('0x1a')][_0xd5ea('0x1d')]);}logger[_0xd5ea('0x1a')](_0xd5ea('0x1c'),_0x1b1b09,_0x4c8f46[_0xd5ea('0x1a')][_0xd5ea('0x1d')]);return _0x126926(_0x4c8f46[_0xd5ea('0x1a')][_0xd5ea('0x1d')]);}else{logger[_0xd5ea('0x1e')](_0xd5ea('0x1c'),_0x1b1b09,_0xd5ea('0x18'));_0x126926(_0x4c8f46[_0xd5ea('0x1f')]['message']);}})[_0xd5ea('0x20')](function(_0x35df93){logger[_0xd5ea('0x1a')](_0xd5ea('0x1c'),_0x1b1b09,_0x35df93);_0x191a1a(_0x35df93);});});}function respondWithResult(_0x1e54c3,_0x341918){_0x341918=_0x341918||0xc8;return function(_0x3e6600){if(_0x3e6600){return _0x1e54c3[_0xd5ea('0x21')](_0x341918)[_0xd5ea('0x22')](_0x3e6600);}};}function respondWithFilteredResult(_0x358bd0,_0x216561){return function(_0xc03b4c){if(_0xc03b4c){var _0x185de4=typeof _0x216561[_0xd5ea('0x23')]===_0xd5ea('0x24')&&typeof _0x216561['limit']===_0xd5ea('0x24');var _0x2c92f0=_0xc03b4c[_0xd5ea('0x25')];var _0x9746d8=_0x185de4?0x0:_0x216561[_0xd5ea('0x23')];var _0xda87d1=_0x185de4?_0xc03b4c[_0xd5ea('0x25')]:_0x216561[_0xd5ea('0x23')]+_0x216561['limit'];var _0x1106dd;if(_0xda87d1>=_0x2c92f0){_0xda87d1=_0x2c92f0;_0x1106dd=0xc8;}else{_0x1106dd=0xce;}_0x358bd0[_0xd5ea('0x21')](_0x1106dd);return _0x358bd0[_0xd5ea('0x26')](_0xd5ea('0x27'),_0x9746d8+'-'+_0xda87d1+'/'+_0x2c92f0)[_0xd5ea('0x22')](_0xc03b4c);}return null;};}function saveUpdates(_0x5222e6){return function(_0x5d2ee1){if(_0x5d2ee1){return _0x5d2ee1['update'](_0x5222e6)[_0xd5ea('0x17')](function(_0x3939a0){return _0x3939a0;});}return null;};}function removeEntity(_0x595453){return function(_0x126227){if(_0x126227){return _0x126227['destroy']()['then'](function(){_0x595453[_0xd5ea('0x21')](0xcc)[_0xd5ea('0x28')]();});}};}function handleEntityNotFound(_0x347180){return function(_0x31d018){if(!_0x31d018){_0x347180[_0xd5ea('0x29')](0x194);}return _0x31d018;};}function handleError(_0x3d7c40,_0x8557b0){_0x8557b0=_0x8557b0||0x1f4;return function(_0x3da2ff){logger[_0xd5ea('0x1a')](_0x3da2ff[_0xd5ea('0x2a')]);if(_0x3da2ff[_0xd5ea('0x2b')]){delete _0x3da2ff[_0xd5ea('0x2b')];}_0x3d7c40[_0xd5ea('0x21')](_0x8557b0)[_0xd5ea('0x2c')](_0x3da2ff);};}exports[_0xd5ea('0x2d')]=function(_0x39cbde,_0x11c3f3){var _0x4d6586={},_0x3be209={},_0x1c3927={'count':0x0,'rows':[]};var _0x43ff42=_[_0xd5ea('0x2e')](db[_0xd5ea('0x2f')][_0xd5ea('0x30')],function(_0x59cb1e){return{'name':_0x59cb1e[_0xd5ea('0x31')],'type':_0x59cb1e['type'][_0xd5ea('0x32')]};});_0x3be209['model']=_['map'](_0x43ff42,'name');_0x3be209[_0xd5ea('0x33')]=_[_0xd5ea('0x34')](_0x39cbde['query']);_0x3be209[_0xd5ea('0x35')]=_[_0xd5ea('0x36')](_0x3be209[_0xd5ea('0x37')],_0x3be209['query']);_0x4d6586[_0xd5ea('0x38')]=_[_0xd5ea('0x36')](_0x3be209['model'],qs['fields'](_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x39')]));_0x4d6586[_0xd5ea('0x38')]=_0x4d6586[_0xd5ea('0x38')]['length']?_0x4d6586[_0xd5ea('0x38')]:_0x3be209[_0xd5ea('0x37')];if(!_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x3a')]('nolimit')){_0x4d6586['limit']=qs[_0xd5ea('0x3b')](_0x39cbde['query'][_0xd5ea('0x3b')]);_0x4d6586[_0xd5ea('0x23')]=qs[_0xd5ea('0x23')](_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x23')]);}_0x4d6586[_0xd5ea('0x3c')]=qs['sort'](_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x3d')]);_0x4d6586[_0xd5ea('0x3e')]=qs[_0xd5ea('0x35')](_[_0xd5ea('0x3f')](_0x39cbde[_0xd5ea('0x33')],_0x3be209['filters']),_0x43ff42);if(_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x40')]){_0x4d6586[_0xd5ea('0x3e')]=_[_0xd5ea('0x41')](_0x4d6586[_0xd5ea('0x3e')],{'$or':_[_0xd5ea('0x2e')](_0x43ff42,function(_0x2216cf){if(_0x2216cf[_0xd5ea('0x42')]!==_0xd5ea('0x43')){var _0x3ba8e1={};_0x3ba8e1[_0x2216cf[_0xd5ea('0x2b')]]={'$like':'%'+_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x40')]+'%'};return _0x3ba8e1;}})});}_0x4d6586=_[_0xd5ea('0x41')]({},_0x4d6586,_0x39cbde['options']);var _0x39d54a={'where':_0x4d6586[_0xd5ea('0x3e')]};return db[_0xd5ea('0x2f')][_0xd5ea('0x25')](_0x39d54a)[_0xd5ea('0x17')](function(_0x29a55b){_0x1c3927[_0xd5ea('0x25')]=_0x29a55b;if(_0x39cbde[_0xd5ea('0x33')][_0xd5ea('0x44')]){_0x4d6586[_0xd5ea('0x45')]=[{'all':!![]}];}return db[_0xd5ea('0x2f')][_0xd5ea('0x46')](_0x4d6586);})[_0xd5ea('0x17')](function(_0x4ac908){_0x1c3927[_0xd5ea('0x47')]=_0x4ac908;return _0x1c3927;})[_0xd5ea('0x17')](respondWithFilteredResult(_0x11c3f3,_0x4d6586))['catch'](handleError(_0x11c3f3,null));};exports['show']=function(_0x1e97c6,_0x16a023){var _0x8d16b2={'raw':!![],'where':{'id':_0x1e97c6['params']['id']}},_0x562740={};_0x562740[_0xd5ea('0x37')]=_['keys'](db['MailMessage'][_0xd5ea('0x30')]);_0x562740['query']=_[_0xd5ea('0x34')](_0x1e97c6['query']);_0x562740[_0xd5ea('0x35')]=_['intersection'](_0x562740['model'],_0x562740[_0xd5ea('0x33')]);_0x8d16b2['attributes']=_['intersection'](_0x562740['model'],qs[_0xd5ea('0x39')](_0x1e97c6[_0xd5ea('0x33')][_0xd5ea('0x39')]));_0x8d16b2[_0xd5ea('0x38')]=_0x8d16b2[_0xd5ea('0x38')][_0xd5ea('0x48')]?_0x8d16b2[_0xd5ea('0x38')]:_0x562740[_0xd5ea('0x37')];if(_0x1e97c6['query'][_0xd5ea('0x44')]){_0x8d16b2[_0xd5ea('0x45')]=[{'all':!![]}];}_0x8d16b2=_[_0xd5ea('0x41')]({},_0x8d16b2,_0x1e97c6[_0xd5ea('0x49')]);return db[_0xd5ea('0x2f')]['find'](_0x8d16b2)[_0xd5ea('0x17')](handleEntityNotFound(_0x16a023,null))[_0xd5ea('0x17')](respondWithResult(_0x16a023,null))[_0xd5ea('0x20')](handleError(_0x16a023,null));};exports[_0xd5ea('0x4a')]=function(_0x1100d5,_0x442751){if(_0x1100d5[_0xd5ea('0x4b')]['id']){delete _0x1100d5[_0xd5ea('0x4b')]['id'];}return db[_0xd5ea('0x2f')][_0xd5ea('0x4c')]({'where':{'id':_0x1100d5[_0xd5ea('0x4d')]['id']}})[_0xd5ea('0x17')](handleEntityNotFound(_0x442751,null))[_0xd5ea('0x17')](saveUpdates(_0x1100d5['body'],null))[_0xd5ea('0x17')](respondWithResult(_0x442751,null))['catch'](handleError(_0x442751,null));};exports[_0xd5ea('0x4e')]=function(_0x258179,_0xa46b09){return db[_0xd5ea('0x2f')][_0xd5ea('0x4c')]({'where':{'id':_0x258179[_0xd5ea('0x4d')]['id']}})[_0xd5ea('0x17')](handleEntityNotFound(_0xa46b09,null))[_0xd5ea('0x17')](removeEntity(_0xa46b09,null))[_0xd5ea('0x20')](handleError(_0xa46b09,null));};exports[_0xd5ea('0x4f')]=function(_0x4fef47,_0x32a7fb){return db[_0xd5ea('0x2f')]['describe']()[_0xd5ea('0x17')](respondWithResult(_0x32a7fb,null))[_0xd5ea('0x20')](handleError(_0x32a7fb,null));};exports[_0xd5ea('0x50')]=function(_0x341192,_0x1e023c){return db[_0xd5ea('0x2f')][_0xd5ea('0x50')](_0x341192[_0xd5ea('0x4b')])[_0xd5ea('0x17')](function(_0x4479a3){if(_0x4479a3){if(_0x4479a3[_0xd5ea('0x51')]===_0xd5ea('0x52')&&!_0x4479a3['secret']){var _0x226787,_0x15e41e,_0x2ec969;if(_0x341192['body']['to']){_0x15e41e=_0x341192[_0xd5ea('0x4b')]['to'][_0xd5ea('0x53')](',')[0x0];}return db[_0xd5ea('0x54')]['findOne']({'where':{'id':_0x4479a3[_0xd5ea('0x55')]},'include':[{'model':db[_0xd5ea('0x56')],'as':_0xd5ea('0x57'),'include':[{'model':db['CmContact'],'as':_0xd5ea('0x58'),'where':{'email':_0x15e41e},'limit':0x1,'order':[[_0xd5ea('0x59'),'DESC']]}]},{'model':db[_0xd5ea('0x5a')],'as':_0xd5ea('0x5b'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xd5ea('0x5c'),'raw':!![]}]}]})['then'](function(_0x278da3){_0x226787=_0x278da3;if(!_0x226787||!_0x226787[_0xd5ea('0x5b')])return;var _0x57e447=_0x226787[_0xd5ea('0x5d')]();if(_0x341192[_0xd5ea('0x4b')][_0xd5ea('0x5e')]&&_0x341192[_0xd5ea('0x4b')][_0xd5ea('0x5e')]['length']){for(var _0x2cda55=0x0;_0x2cda55<_0x341192[_0xd5ea('0x4b')]['attachments']['length'];_0x2cda55+=0x1){_0x341192[_0xd5ea('0x4b')][_0xd5ea('0x5e')][_0x2cda55]={'filename':_0x341192['body'][_0xd5ea('0x5e')][_0x2cda55]['name'],'path':path[_0xd5ea('0x5f')](config[_0xd5ea('0x60')],'server/files/attachments',_0x341192[_0xd5ea('0x4b')]['attachments'][_0x2cda55]['basename'])};}}_0x2ec969={'account':_0x57e447,'message':_0x341192['body']};return;})[_0xd5ea('0x17')](function(){if(_0x226787[_0xd5ea('0x57')]){if(_0x226787[_0xd5ea('0x57')][_0xd5ea('0x58')][_0xd5ea('0x48')]){return _0x226787['List'][_0xd5ea('0x58')][0x0];}else{return db[_0xd5ea('0x61')][_0xd5ea('0x50')](_[_0xd5ea('0xf')](_0x341192[_0xd5ea('0x4b')],{'firstName':_0x341192[_0xd5ea('0x4b')]['to'],'email':_0x341192['body']['to'],'phone':_0x341192['body']['to'],'ListId':_0x226787['ListId']}));}}else{throw new Error(_0xd5ea('0x62'));}})[_0xd5ea('0x17')](function(){if(_0x2ec969){return respondWithRpcPromise(_0xd5ea('0x63'),_0xd5ea('0x64'),_0x2ec969,client9003)[_0xd5ea('0x17')](function(_0xec9d6e){return _0x4479a3[_0xd5ea('0x4a')]({'read':!![],'messageId':_0xec9d6e[_0xd5ea('0x65')],'sentAt':moment()[_0xd5ea('0x66')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x24c925){logger[_0xd5ea('0x1a')]('%s',JSON[_0xd5ea('0x67')](_0x24c925));return _0x4479a3;});}return _0x4479a3;});}return _0x4479a3;}})[_0xd5ea('0x17')](respondWithResult(_0x1e023c,0xc9))['catch'](handleError(_0x1e023c,null));};exports[_0xd5ea('0x68')]=function(_0x211549,_0xb891f8){var _0x36c8c6={'agent':{},'channel':'mail'};if(_0x211549['body']['id']){delete _0x211549[_0xd5ea('0x4b')]['id'];}_0x211549[_0xd5ea('0x4b')][_0xd5ea('0x69')]=!![];_0x211549['body'][_0xd5ea('0x6a')]=moment()[_0xd5ea('0x66')](_0xd5ea('0x6b'));_0x211549[_0xd5ea('0x4b')][_0xd5ea('0x6c')]=_0x211549['body'][_0xd5ea('0x6c')]||_0x211549[_0xd5ea('0x6d')]['id'];_0x36c8c6[_0xd5ea('0x6e')]['id']=_0x211549[_0xd5ea('0x4b')]['UserId'];return db[_0xd5ea('0x2f')][_0xd5ea('0x4c')]({'where':{'id':_0x211549['params']['id'],'UserId':null}})[_0xd5ea('0x17')](handleEntityNotFound(_0xb891f8,null))[_0xd5ea('0x17')](saveUpdates(_0x211549[_0xd5ea('0x4b')],null))['then'](function(_0x200fd0){if(_0x200fd0){_0x36c8c6[_0xd5ea('0x1d')]=_0x200fd0[_0xd5ea('0x6f')]({'plain':!![]});return db[_0xd5ea('0x70')][_0xd5ea('0x4c')]({'where':{'id':_0x200fd0[_0xd5ea('0x71')]}});}return null;})[_0xd5ea('0x17')](handleEntityNotFound(_0xb891f8,null))[_0xd5ea('0x17')](function(_0x4c5451){if(_0x4c5451){return _0x4c5451[_0xd5ea('0x4a')]({'UserId':_0x211549[_0xd5ea('0x4b')][_0xd5ea('0x6c')],'read1stAt':_[_0xd5ea('0x72')](_0x4c5451[_0xd5ea('0x73')])?moment()['format'](_0xd5ea('0x6b')):undefined});}return null;})['then'](function(_0x57d2a0){if(_0x57d2a0){_0x36c8c6['interaction']=_0x57d2a0[_0xd5ea('0x6f')]({'plain':!![]});interaction_log[_0xd5ea('0x1e')](_0xd5ea('0x74'),_0x211549[_0xd5ea('0x6d')]['id'],_0x211549[_0xd5ea('0x6d')][_0xd5ea('0x2b')],_0x211549['user'][_0xd5ea('0x75')],_0x36c8c6[_0xd5ea('0x76')]['id'],_0x211549[_0xd5ea('0x4b')]?JSON[_0xd5ea('0x67')](_0x211549['body']):_0xd5ea('0x77'));return respondWithRpcPromise(_0xd5ea('0x78'),_0xd5ea('0x79'),_0x36c8c6);}return null;})[_0xd5ea('0x17')](function(_0x25fa56){var _0x2b66b0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25fa56[_0xd5ea('0x1d')]['ContactId'];return db[_0xd5ea('0x7a')]['query'](_0x2b66b0,{'type':db[_0xd5ea('0x7b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd5ea('0x17')](function(_0x19544b){return _0x19544b;});})[_0xd5ea('0x17')](function(_0x2432af){if(_0x2432af){_0x36c8c6[_0xd5ea('0x1d')][_0xd5ea('0x7c')]=_0x2432af[0x0];if(!_0x211549[_0xd5ea('0x4b')][_0xd5ea('0x6c')])return;return db[_0xd5ea('0x7d')][_0xd5ea('0x4c')]({'where':{'id':_0x211549[_0xd5ea('0x4b')][_0xd5ea('0x6c')],'role':'agent'},'attributes':['id',_0xd5ea('0x2b'),_0xd5ea('0x7e'),_0xd5ea('0x7f'),_0xd5ea('0x80')],'raw':!![]});}return null;})['then'](function(_0x157fa9){if(!_0x157fa9)return null;_0x36c8c6[_0xd5ea('0x1d')][_0xd5ea('0x6e')]=_0x157fa9;return _0x36c8c6;})[_0xd5ea('0x17')](function(_0x445b53){if(_0x445b53){if(_0x211549['body'][_0xd5ea('0x81')]){_0x36c8c6[_0xd5ea('0x1d')][_0xd5ea('0x82')]=util['format'](_0xd5ea('0x83'),_0x211549[_0xd5ea('0x6d')][_0xd5ea('0x2b')]);_0x36c8c6[_0xd5ea('0x1d')][_0xd5ea('0x84')]=_0x36c8c6[_0xd5ea('0x84')];_0x36c8c6[_0xd5ea('0x1d')]['motionChannel']=_0x36c8c6[_0xd5ea('0x84')];_0x36c8c6[_0xd5ea('0x1d')]['event']=_0xd5ea('0x68');_0x36c8c6[_0xd5ea('0x1d')][_0xd5ea('0x4b')]=htmlToText[_0xd5ea('0x85')](_0x36c8c6[_0xd5ea('0x1d')]['body']);return respondWithRpcPromise(_0xd5ea('0x86'),'EventManager',{'event':_0xd5ea('0x87'),'message':_0x36c8c6[_0xd5ea('0x1d')]},client9002)[_0xd5ea('0x17')](function(){return _0x36c8c6;});}return _0x36c8c6;}return null;})[_0xd5ea('0x17')](respondWithResult(_0xb891f8,null))[_0xd5ea('0x20')](handleError(_0xb891f8,null));};exports[_0xd5ea('0x88')]=function(_0x19b09f,_0x461267){var _0x45e083={'agent':{},'channel':_0xd5ea('0x89')};if(_0x19b09f['body']['id']){delete _0x19b09f[_0xd5ea('0x4b')]['id'];}_0x19b09f[_0xd5ea('0x4b')]['UserId']=_0x19b09f[_0xd5ea('0x4b')][_0xd5ea('0x6c')]||_0x19b09f[_0xd5ea('0x6d')]['id'];_0x45e083['agent']['id']=_0x19b09f[_0xd5ea('0x4b')][_0xd5ea('0x6c')];return db[_0xd5ea('0x2f')][_0xd5ea('0x4c')]({'where':{'id':_0x19b09f['params']['id'],'UserId':null}})[_0xd5ea('0x17')](handleEntityNotFound(_0x461267,null))[_0xd5ea('0x17')](function(_0x4d734a){if(_0x4d734a){_0x45e083['message']=_0x4d734a[_0xd5ea('0x6f')]({'plain':!![]});return db[_0xd5ea('0x70')]['find']({'where':{'id':_0x4d734a[_0xd5ea('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x461267,null))[_0xd5ea('0x17')](function(_0xc80c3c){if(_0xc80c3c){_0x45e083[_0xd5ea('0x76')]=_0xc80c3c['get']({'plain':!![]});interaction_log[_0xd5ea('0x1e')](_0xd5ea('0x8a'),_0x19b09f[_0xd5ea('0x6d')]['id'],_0x19b09f[_0xd5ea('0x6d')][_0xd5ea('0x2b')],_0x19b09f['user']['role'],_0x45e083[_0xd5ea('0x76')]['id'],_0x19b09f[_0xd5ea('0x4b')]?JSON['stringify'](_0x19b09f[_0xd5ea('0x4b')]):_0xd5ea('0x77'));return respondWithRpcPromise(_0xd5ea('0x8b'),'rejectMessage',_0x45e083);}return null;})['then'](function(_0x30c333){var _0x213e48='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30c333[_0xd5ea('0x1d')][_0xd5ea('0x8c')];return db[_0xd5ea('0x7a')]['query'](_0x213e48,{'type':db['Sequelize']['QueryTypes'][_0xd5ea('0x8d')],'raw':!![]})[_0xd5ea('0x17')](function(_0x3d4e65){return _0x3d4e65;});})[_0xd5ea('0x17')](function(_0x2719db){if(_0x2719db){_0x45e083[_0xd5ea('0x1d')][_0xd5ea('0x7c')]=_0x2719db[0x0];if(!_0x19b09f[_0xd5ea('0x4b')][_0xd5ea('0x6c')])return;return db[_0xd5ea('0x7d')]['find']({'where':{'id':_0x19b09f[_0xd5ea('0x4b')][_0xd5ea('0x6c')],'role':_0xd5ea('0x6e')},'attributes':['id',_0xd5ea('0x2b'),_0xd5ea('0x7e'),_0xd5ea('0x7f'),_0xd5ea('0x80')],'raw':!![]});}return null;})['then'](function(_0x58f37d){if(!_0x58f37d)return null;_0x45e083[_0xd5ea('0x1d')]['agent']=_0x58f37d;return _0x45e083;})[_0xd5ea('0x17')](function(_0x2632ed){if(_0x2632ed){_0x2632ed[_0xd5ea('0x1d')][_0xd5ea('0x82')]=util[_0xd5ea('0x66')](_0xd5ea('0x83'),_0x19b09f[_0xd5ea('0x6d')][_0xd5ea('0x2b')]);_0x2632ed['message']['channel']=_0x45e083[_0xd5ea('0x84')];_0x2632ed[_0xd5ea('0x1d')][_0xd5ea('0x8e')]=_0x45e083[_0xd5ea('0x84')];_0x2632ed[_0xd5ea('0x1d')]['event']=_0xd5ea('0x88');_0x2632ed[_0xd5ea('0x1d')]['body']=htmlToText[_0xd5ea('0x85')](_0x45e083[_0xd5ea('0x1d')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0xd5ea('0x8f'),'message':_0x2632ed[_0xd5ea('0x1d')]},client9002);return _0x45e083;}return null;})[_0xd5ea('0x17')](respondWithResult(_0x461267,null))[_0xd5ea('0x20')](handleError(_0x461267,null));};exports[_0xd5ea('0x90')]=function(_0x490e35,_0x3e8d8a){var _0x27cc43=moment()[_0xd5ea('0x91')]()[_0xd5ea('0x92')]();var _0x3b90b5=path[_0xd5ea('0x5f')](config[_0xd5ea('0x60')],_0xd5ea('0x93'),_0xd5ea('0x94'),_0xd5ea('0x95'));var _0x156aea=path[_0xd5ea('0x5f')](config[_0xd5ea('0x60')],_0xd5ea('0x93'),'files',_0xd5ea('0x5e'));var _0xabd180=util[_0xd5ea('0x66')](_0xd5ea('0x96'),_0x27cc43);return db['MailMessage'][_0xd5ea('0x4c')]({'where':{'id':_0x490e35[_0xd5ea('0x4d')]['id']},'attributes':['id',_0xd5ea('0x4b'),'from','to','cc',_0xd5ea('0x97'),'subject',_0xd5ea('0x98')],'include':_0x490e35[_0xd5ea('0x33')][_0xd5ea('0x5e')]?[{'model':db[_0xd5ea('0x99')],'as':_0xd5ea('0x9a')}]:undefined})[_0xd5ea('0x17')](handleEntityNotFound(_0x3e8d8a,null))['then'](function(_0x15f608){if(_0x15f608){var _0x35f0a1=_0x15f608;var _0x3507db={'from':_0x35f0a1[_0xd5ea('0x9b')],'to':_0x35f0a1['to'],'subject':_0x35f0a1[_0xd5ea('0x9c')],'html':htmlEntities[_0xd5ea('0x9d')](_0x35f0a1[_0xd5ea('0x4b')]),'headers':{'Date':moment(_0x35f0a1[_0xd5ea('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x15f608['cc']){_0x3507db['headers']['Cc']=_0x15f608['cc'];}if(_0x15f608[_0xd5ea('0x97')]){_0x3507db[_0xd5ea('0x9e')][_0xd5ea('0x9f')]=_0x15f608['bcc'];}return new BPromise(function(_0x5dbdcf,_0x4dfc5d){if(_0x15f608['Attachments']){for(var _0x3bb1c7=0x0;_0x3bb1c7<_0x15f608[_0xd5ea('0x9a')]['length'];_0x3bb1c7++){var _0x4db004=_0x15f608['Attachments'][_0x3bb1c7];var _0xd29d9f=path['join'](_0x156aea,_0x4db004[_0xd5ea('0xa0')]);if(fs['existsSync'](_0xd29d9f)){_0x3507db[_0xd5ea('0x5e')][_0xd5ea('0xa1')]({'name':_0x4db004['name'],'contentType':_0x4db004[_0xd5ea('0x42')],'data':fs['readFileSync'](_0xd29d9f)});}}}emlformat['build'](_0x3507db,function(_0x44a7c3,_0x5492ad){if(_0x44a7c3)return _0x4dfc5d(_0x44a7c3);fs[_0xd5ea('0xa2')](path[_0xd5ea('0x5f')](_0x3b90b5,_0xabd180),_0x5492ad);return _0x5dbdcf(_0x5492ad);});});}})[_0xd5ea('0x17')](function(_0x480915){if(_0x480915){return _0x3e8d8a[_0xd5ea('0x90')](path[_0xd5ea('0x5f')](_0x3b90b5,_0xabd180),_0xabd180,function(_0x2a7217){if(!_0x2a7217)fs[_0xd5ea('0xa3')](path[_0xd5ea('0x5f')](_0x3b90b5,_0xabd180));});}})['catch'](handleError(_0x3e8d8a,null));}; \ No newline at end of file +var _0x7720=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','show','params','keys','length','body','find','describe','create','direction','out','MailAccount','findOne','MailAccountId','CmList','List','Contacts','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','format','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','fullname','SIP/%s','EventManager','rejectmessage','download','unix','root','server','files','message-%s.eml','Attachment','Attachments','from','subject','decode','createdAt','bcc','headers','Bcc','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','register','jayson/promise','http','client','request','then','info','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7720,0x129));var _0x0772=function(_0x356e79,_0x4587d4){_0x356e79=_0x356e79-0x0;var _0xffdae7=_0x7720[_0x356e79];return _0xffdae7;};'use strict';var emlformat=require(_0x0772('0x0'));var moment=require(_0x0772('0x1'));var BPromise=require(_0x0772('0x2'));var util=require('util');var path=require(_0x0772('0x3'));var fs=require('fs');var _=require(_0x0772('0x4'));var Redis=require(_0x0772('0x5'));var htmlToText=require(_0x0772('0x6'));var qs=require(_0x0772('0x7'));var logger=require('../../config/logger')(_0x0772('0x8'));var interaction_log=require(_0x0772('0x9'))('mail-interactions');var config=require(_0x0772('0xa'));var db=require(_0x0772('0xb'))['db'];config['redis']=_['defaults'](config[_0x0772('0xc')],{'host':_0x0772('0xd'),'port':0x18eb});var socket=require(_0x0772('0xe'))(new Redis(config[_0x0772('0xc')]));var htmlEntities=require(_0x0772('0xf'));require('./mailMessage.socket')[_0x0772('0x10')](socket);var jayson=require(_0x0772('0x11'));var client=jayson['client'][_0x0772('0x12')]({'port':0x232c});var client9003=jayson[_0x0772('0x13')]['http']({'port':0x232b});var client9002=jayson['client'][_0x0772('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x529e15,_0x296aee,_0xcf96b2,_0x5ce51f){return new BPromise(function(_0x5a822b,_0x15c800){var _0x3ee9ab=_0x5ce51f||client;return _0x3ee9ab[_0x0772('0x14')](_0x529e15,_0xcf96b2)[_0x0772('0x15')](function(_0x19852f){logger[_0x0772('0x16')]('MailMessage,\x20%s,\x20%s',_0x296aee,_0x0772('0x17'));logger[_0x0772('0x18')](_0x0772('0x19'),_0x296aee,'request\x20sent',JSON[_0x0772('0x1a')](_0x19852f));if(_0x19852f[_0x0772('0x1b')]){if(_0x19852f['error'][_0x0772('0x1c')]===0x1f4){logger[_0x0772('0x1b')](_0x0772('0x1d'),_0x296aee,_0x19852f[_0x0772('0x1b')][_0x0772('0x1e')]);return _0x15c800(_0x19852f[_0x0772('0x1b')][_0x0772('0x1e')]);}logger[_0x0772('0x1b')](_0x0772('0x1d'),_0x296aee,_0x19852f[_0x0772('0x1b')][_0x0772('0x1e')]);return _0x5a822b(_0x19852f[_0x0772('0x1b')]['message']);}else{logger[_0x0772('0x16')](_0x0772('0x1d'),_0x296aee,_0x0772('0x17'));_0x5a822b(_0x19852f[_0x0772('0x1f')][_0x0772('0x1e')]);}})[_0x0772('0x20')](function(_0x53d59e){logger['error'](_0x0772('0x1d'),_0x296aee,_0x53d59e);_0x15c800(_0x53d59e);});});}function respondWithResult(_0x2f32c4,_0x3c3c3c){_0x3c3c3c=_0x3c3c3c||0xc8;return function(_0x4f5434){if(_0x4f5434){return _0x2f32c4[_0x0772('0x21')](_0x3c3c3c)[_0x0772('0x22')](_0x4f5434);}};}function respondWithFilteredResult(_0x2fd286,_0xff3e99){return function(_0x13c025){if(_0x13c025){var _0x2f3097=typeof _0xff3e99[_0x0772('0x23')]==='undefined'&&typeof _0xff3e99[_0x0772('0x24')]===_0x0772('0x25');var _0x149a51=_0x13c025['count'];var _0x495d9d=_0x2f3097?0x0:_0xff3e99[_0x0772('0x23')];var _0x38ca68=_0x2f3097?_0x13c025[_0x0772('0x26')]:_0xff3e99[_0x0772('0x23')]+_0xff3e99['limit'];var _0x4fc5d5;if(_0x38ca68>=_0x149a51){_0x38ca68=_0x149a51;_0x4fc5d5=0xc8;}else{_0x4fc5d5=0xce;}_0x2fd286['status'](_0x4fc5d5);return _0x2fd286[_0x0772('0x27')](_0x0772('0x28'),_0x495d9d+'-'+_0x38ca68+'/'+_0x149a51)[_0x0772('0x22')](_0x13c025);}return null;};}function saveUpdates(_0x28f00c){return function(_0x28e419){if(_0x28e419){return _0x28e419[_0x0772('0x29')](_0x28f00c)[_0x0772('0x15')](function(_0xdb4b1){return _0xdb4b1;});}return null;};}function removeEntity(_0x6dce96){return function(_0x14ae52){if(_0x14ae52){return _0x14ae52[_0x0772('0x2a')]()[_0x0772('0x15')](function(){_0x6dce96[_0x0772('0x21')](0xcc)[_0x0772('0x2b')]();});}};}function handleEntityNotFound(_0x35286d){return function(_0x28930d){if(!_0x28930d){_0x35286d[_0x0772('0x2c')](0x194);}return _0x28930d;};}function handleError(_0x12cf3b,_0x38b92e){_0x38b92e=_0x38b92e||0x1f4;return function(_0x319669){logger['error'](_0x319669[_0x0772('0x2d')]);if(_0x319669[_0x0772('0x2e')]){delete _0x319669[_0x0772('0x2e')];}_0x12cf3b[_0x0772('0x21')](_0x38b92e)[_0x0772('0x2f')](_0x319669);};}exports[_0x0772('0x30')]=function(_0x24702d,_0x1ae41d){var _0x2b5119={},_0x250201={},_0x216db1={'count':0x0,'rows':[]};var _0x151de7=_['map'](db[_0x0772('0x31')][_0x0772('0x32')],function(_0x2e07e0){return{'name':_0x2e07e0[_0x0772('0x33')],'type':_0x2e07e0[_0x0772('0x34')][_0x0772('0x35')]};});_0x250201['model']=_[_0x0772('0x36')](_0x151de7,_0x0772('0x2e'));_0x250201[_0x0772('0x37')]=_['keys'](_0x24702d[_0x0772('0x37')]);_0x250201[_0x0772('0x38')]=_[_0x0772('0x39')](_0x250201[_0x0772('0x3a')],_0x250201[_0x0772('0x37')]);_0x2b5119[_0x0772('0x3b')]=_[_0x0772('0x39')](_0x250201[_0x0772('0x3a')],qs['fields'](_0x24702d[_0x0772('0x37')][_0x0772('0x3c')]));_0x2b5119[_0x0772('0x3b')]=_0x2b5119['attributes']['length']?_0x2b5119[_0x0772('0x3b')]:_0x250201[_0x0772('0x3a')];if(!_0x24702d['query']['hasOwnProperty'](_0x0772('0x3d'))){_0x2b5119['limit']=qs[_0x0772('0x24')](_0x24702d['query'][_0x0772('0x24')]);_0x2b5119[_0x0772('0x23')]=qs[_0x0772('0x23')](_0x24702d[_0x0772('0x37')][_0x0772('0x23')]);}_0x2b5119[_0x0772('0x3e')]=qs[_0x0772('0x3f')](_0x24702d[_0x0772('0x37')][_0x0772('0x3f')]);_0x2b5119[_0x0772('0x40')]=qs[_0x0772('0x38')](_[_0x0772('0x41')](_0x24702d[_0x0772('0x37')],_0x250201[_0x0772('0x38')]),_0x151de7);if(_0x24702d['query'][_0x0772('0x42')]){_0x2b5119['where']=_['merge'](_0x2b5119['where'],{'$or':_[_0x0772('0x36')](_0x151de7,function(_0x18d70f){if(_0x18d70f[_0x0772('0x34')]!=='VIRTUAL'){var _0x1eb860={};_0x1eb860[_0x18d70f[_0x0772('0x2e')]]={'$like':'%'+_0x24702d[_0x0772('0x37')]['filter']+'%'};return _0x1eb860;}})});}_0x2b5119=_[_0x0772('0x43')]({},_0x2b5119,_0x24702d[_0x0772('0x44')]);var _0x4d5023={'where':_0x2b5119[_0x0772('0x40')]};return db[_0x0772('0x31')][_0x0772('0x26')](_0x4d5023)[_0x0772('0x15')](function(_0x50ebe5){_0x216db1[_0x0772('0x26')]=_0x50ebe5;if(_0x24702d['query'][_0x0772('0x45')]){_0x2b5119[_0x0772('0x46')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x2b5119);})['then'](function(_0x4ec03e){_0x216db1['rows']=_0x4ec03e;return _0x216db1;})[_0x0772('0x15')](respondWithFilteredResult(_0x1ae41d,_0x2b5119))[_0x0772('0x20')](handleError(_0x1ae41d,null));};exports[_0x0772('0x47')]=function(_0xd3558b,_0x41ef09){var _0x5a5460={'raw':!![],'where':{'id':_0xd3558b[_0x0772('0x48')]['id']}},_0x286c43={};_0x286c43[_0x0772('0x3a')]=_[_0x0772('0x49')](db[_0x0772('0x31')][_0x0772('0x32')]);_0x286c43[_0x0772('0x37')]=_['keys'](_0xd3558b[_0x0772('0x37')]);_0x286c43['filters']=_[_0x0772('0x39')](_0x286c43['model'],_0x286c43[_0x0772('0x37')]);_0x5a5460[_0x0772('0x3b')]=_['intersection'](_0x286c43[_0x0772('0x3a')],qs[_0x0772('0x3c')](_0xd3558b[_0x0772('0x37')][_0x0772('0x3c')]));_0x5a5460[_0x0772('0x3b')]=_0x5a5460[_0x0772('0x3b')][_0x0772('0x4a')]?_0x5a5460[_0x0772('0x3b')]:_0x286c43[_0x0772('0x3a')];if(_0xd3558b['query'][_0x0772('0x45')]){_0x5a5460[_0x0772('0x46')]=[{'all':!![]}];}_0x5a5460=_['merge']({},_0x5a5460,_0xd3558b[_0x0772('0x44')]);return db[_0x0772('0x31')]['find'](_0x5a5460)[_0x0772('0x15')](handleEntityNotFound(_0x41ef09,null))[_0x0772('0x15')](respondWithResult(_0x41ef09,null))['catch'](handleError(_0x41ef09,null));};exports[_0x0772('0x29')]=function(_0x4ddcd9,_0x1b261a){if(_0x4ddcd9[_0x0772('0x4b')]['id']){delete _0x4ddcd9['body']['id'];}return db[_0x0772('0x31')][_0x0772('0x4c')]({'where':{'id':_0x4ddcd9[_0x0772('0x48')]['id']}})[_0x0772('0x15')](handleEntityNotFound(_0x1b261a,null))[_0x0772('0x15')](saveUpdates(_0x4ddcd9[_0x0772('0x4b')],null))[_0x0772('0x15')](respondWithResult(_0x1b261a,null))['catch'](handleError(_0x1b261a,null));};exports[_0x0772('0x2a')]=function(_0x2b12f8,_0xdbc8ad){return db[_0x0772('0x31')][_0x0772('0x4c')]({'where':{'id':_0x2b12f8['params']['id']}})['then'](handleEntityNotFound(_0xdbc8ad,null))[_0x0772('0x15')](removeEntity(_0xdbc8ad,null))[_0x0772('0x20')](handleError(_0xdbc8ad,null));};exports['describe']=function(_0x4dc4f9,_0x3c9158){return db[_0x0772('0x31')][_0x0772('0x4d')]()[_0x0772('0x15')](respondWithResult(_0x3c9158,null))['catch'](handleError(_0x3c9158,null));};exports[_0x0772('0x4e')]=function(_0x5214af,_0x560172){return db[_0x0772('0x31')][_0x0772('0x4e')](_0x5214af[_0x0772('0x4b')])[_0x0772('0x15')](function(_0xb90398){if(_0xb90398){if(_0xb90398[_0x0772('0x4f')]===_0x0772('0x50')&&!_0xb90398['secret']){var _0x1ad151,_0x4c84ff,_0x4aa998;if(_0x5214af[_0x0772('0x4b')]['to']){_0x4c84ff=_0x5214af[_0x0772('0x4b')]['to']['split'](',')[0x0];}return db[_0x0772('0x51')][_0x0772('0x52')]({'where':{'id':_0xb90398[_0x0772('0x53')]},'include':[{'model':db[_0x0772('0x54')],'as':_0x0772('0x55'),'include':[{'model':db['CmContact'],'as':_0x0772('0x56'),'where':{'email':_0x4c84ff},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x0772('0x57')],'as':_0x0772('0x58'),'raw':!![],'include':[{'model':db[_0x0772('0x59')],'as':_0x0772('0x59'),'raw':!![]}]}]})['then'](function(_0x190528){_0x1ad151=_0x190528;if(!_0x1ad151||!_0x1ad151[_0x0772('0x58')])return;var _0x277f6f=_0x1ad151[_0x0772('0x5a')]();if(_0x5214af[_0x0772('0x4b')][_0x0772('0x5b')]&&_0x5214af['body'][_0x0772('0x5b')]['length']){for(var _0x10b602=0x0;_0x10b602<_0x5214af[_0x0772('0x4b')][_0x0772('0x5b')][_0x0772('0x4a')];_0x10b602+=0x1){_0x5214af[_0x0772('0x4b')]['attachments'][_0x10b602]={'filename':_0x5214af[_0x0772('0x4b')][_0x0772('0x5b')][_0x10b602][_0x0772('0x2e')],'path':path[_0x0772('0x5c')](config['root'],_0x0772('0x5d'),_0x5214af[_0x0772('0x4b')][_0x0772('0x5b')][_0x10b602][_0x0772('0x5e')])};}}_0x4aa998={'account':_0x277f6f,'message':_0x5214af[_0x0772('0x4b')]};return;})[_0x0772('0x15')](function(){if(_0x1ad151[_0x0772('0x55')]){if(_0x1ad151[_0x0772('0x55')][_0x0772('0x56')]['length']){return _0x1ad151[_0x0772('0x55')]['Contacts'][0x0];}else{return db['CmContact'][_0x0772('0x4e')](_[_0x0772('0x5f')](_0x5214af[_0x0772('0x4b')],{'firstName':_0x5214af[_0x0772('0x4b')]['to'],'email':_0x5214af[_0x0772('0x4b')]['to'],'phone':_0x5214af[_0x0772('0x4b')]['to'],'ListId':_0x1ad151[_0x0772('0x60')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x0772('0x15')](function(){if(_0x4aa998){return respondWithRpcPromise(_0x0772('0x61'),_0x0772('0x62'),_0x4aa998,client9003)[_0x0772('0x15')](function(_0x38d7f7){return _0xb90398[_0x0772('0x29')]({'read':!![],'messageId':_0x38d7f7['messageId'],'sentAt':moment()['format'](_0x0772('0x63'))});})[_0x0772('0x20')](function(_0x136e13){logger[_0x0772('0x1b')]('%s',JSON[_0x0772('0x1a')](_0x136e13));return _0xb90398;});}return _0xb90398;});}return _0xb90398;}})['then'](respondWithResult(_0x560172,0xc9))[_0x0772('0x20')](handleError(_0x560172,null));};exports[_0x0772('0x64')]=function(_0x247b81,_0x55ac8e){var _0x52c255={'agent':{},'channel':_0x0772('0x65')};if(_0x247b81['body']['id']){delete _0x247b81[_0x0772('0x4b')]['id'];}_0x247b81[_0x0772('0x4b')][_0x0772('0x66')]=!![];_0x247b81[_0x0772('0x4b')]['readAt']=moment()['format'](_0x0772('0x63'));_0x247b81[_0x0772('0x4b')][_0x0772('0x67')]=_0x247b81[_0x0772('0x4b')][_0x0772('0x67')]||_0x247b81[_0x0772('0x68')]['id'];_0x52c255[_0x0772('0x69')]['id']=_0x247b81[_0x0772('0x4b')][_0x0772('0x67')];return db[_0x0772('0x31')]['find']({'where':{'id':_0x247b81['params']['id'],'UserId':null}})[_0x0772('0x15')](handleEntityNotFound(_0x55ac8e,null))[_0x0772('0x15')](saveUpdates(_0x247b81[_0x0772('0x4b')],null))['then'](function(_0x3a7f88){if(_0x3a7f88){_0x52c255['message']=_0x3a7f88[_0x0772('0x6a')]({'plain':!![]});return db[_0x0772('0x6b')]['find']({'where':{'id':_0x3a7f88[_0x0772('0x6c')]}});}return null;})[_0x0772('0x15')](handleEntityNotFound(_0x55ac8e,null))['then'](function(_0x49ad5a){if(_0x49ad5a){return _0x49ad5a[_0x0772('0x29')]({'UserId':_0x247b81['body'][_0x0772('0x67')],'read1stAt':_[_0x0772('0x6d')](_0x49ad5a[_0x0772('0x6e')])?moment()[_0x0772('0x6f')](_0x0772('0x63')):undefined});}return null;})['then'](function(_0x537dab){if(_0x537dab){_0x52c255['interaction']=_0x537dab[_0x0772('0x6a')]({'plain':!![]});interaction_log[_0x0772('0x16')](_0x0772('0x70'),_0x247b81[_0x0772('0x68')]['id'],_0x247b81[_0x0772('0x68')]['name'],_0x247b81['user'][_0x0772('0x71')],_0x52c255[_0x0772('0x72')]['id'],_0x247b81[_0x0772('0x4b')]?JSON[_0x0772('0x1a')](_0x247b81[_0x0772('0x4b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x0772('0x73'),_0x52c255);}return null;})[_0x0772('0x15')](function(_0x3f0b76){var _0x5a8630=_0x0772('0x74')+_0x3f0b76[_0x0772('0x1e')][_0x0772('0x75')];return db[_0x0772('0x76')][_0x0772('0x37')](_0x5a8630,{'type':db[_0x0772('0x77')]['QueryTypes'][_0x0772('0x78')],'raw':!![]})[_0x0772('0x15')](function(_0x341ef5){return _0x341ef5;});})['then'](function(_0x456913){if(_0x456913){_0x52c255['message'][_0x0772('0x79')]=_0x456913[0x0];if(!_0x247b81['body']['UserId'])return;return db[_0x0772('0x7a')][_0x0772('0x4c')]({'where':{'id':_0x247b81[_0x0772('0x4b')][_0x0772('0x67')],'role':_0x0772('0x69')},'attributes':['id',_0x0772('0x2e'),'fullname',_0x0772('0x7b'),_0x0772('0x7c')],'raw':!![]});}return null;})[_0x0772('0x15')](function(_0x4603ac){if(!_0x4603ac)return null;_0x52c255[_0x0772('0x1e')][_0x0772('0x69')]=_0x4603ac;return _0x52c255;})[_0x0772('0x15')](function(_0x265e2a){if(_0x265e2a){if(_0x247b81[_0x0772('0x4b')][_0x0772('0x7d')]){_0x52c255[_0x0772('0x1e')][_0x0772('0x7e')]=util[_0x0772('0x6f')]('SIP/%s',_0x247b81[_0x0772('0x68')][_0x0772('0x2e')]);_0x52c255[_0x0772('0x1e')][_0x0772('0x7f')]=_0x52c255[_0x0772('0x7f')];_0x52c255[_0x0772('0x1e')][_0x0772('0x80')]=_0x52c255['channel'];_0x52c255['message'][_0x0772('0x81')]=_0x0772('0x64');_0x52c255[_0x0772('0x1e')][_0x0772('0x4b')]=htmlToText[_0x0772('0x82')](_0x52c255['message'][_0x0772('0x4b')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x0772('0x83'),'message':_0x52c255[_0x0772('0x1e')]},client9002)[_0x0772('0x15')](function(){return _0x52c255;});}return _0x52c255;}return null;})[_0x0772('0x15')](respondWithResult(_0x55ac8e,null))['catch'](handleError(_0x55ac8e,null));};exports[_0x0772('0x84')]=function(_0x48831c,_0x383ebb){var _0x2fffc3={'agent':{},'channel':_0x0772('0x65')};if(_0x48831c['body']['id']){delete _0x48831c[_0x0772('0x4b')]['id'];}_0x48831c[_0x0772('0x4b')][_0x0772('0x67')]=_0x48831c[_0x0772('0x4b')][_0x0772('0x67')]||_0x48831c[_0x0772('0x68')]['id'];_0x2fffc3[_0x0772('0x69')]['id']=_0x48831c['body'][_0x0772('0x67')];return db['MailMessage']['find']({'where':{'id':_0x48831c[_0x0772('0x48')]['id'],'UserId':null}})[_0x0772('0x15')](handleEntityNotFound(_0x383ebb,null))[_0x0772('0x15')](function(_0x5487bc){if(_0x5487bc){_0x2fffc3[_0x0772('0x1e')]=_0x5487bc['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5487bc[_0x0772('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x383ebb,null))[_0x0772('0x15')](function(_0x1266c4){if(_0x1266c4){_0x2fffc3[_0x0772('0x72')]=_0x1266c4[_0x0772('0x6a')]({'plain':!![]});interaction_log[_0x0772('0x16')](_0x0772('0x85'),_0x48831c[_0x0772('0x68')]['id'],_0x48831c[_0x0772('0x68')][_0x0772('0x2e')],_0x48831c[_0x0772('0x68')][_0x0772('0x71')],_0x2fffc3[_0x0772('0x72')]['id'],_0x48831c[_0x0772('0x4b')]?JSON[_0x0772('0x1a')](_0x48831c['body']):_0x0772('0x86'));return respondWithRpcPromise(_0x0772('0x87'),_0x0772('0x88'),_0x2fffc3);}return null;})[_0x0772('0x15')](function(_0x501573){var _0x13ece7=_0x0772('0x74')+_0x501573[_0x0772('0x1e')][_0x0772('0x75')];return db[_0x0772('0x76')][_0x0772('0x37')](_0x13ece7,{'type':db[_0x0772('0x77')][_0x0772('0x89')][_0x0772('0x78')],'raw':!![]})[_0x0772('0x15')](function(_0x519f6d){return _0x519f6d;});})[_0x0772('0x15')](function(_0x30f1de){if(_0x30f1de){_0x2fffc3[_0x0772('0x1e')][_0x0772('0x79')]=_0x30f1de[0x0];if(!_0x48831c[_0x0772('0x4b')][_0x0772('0x67')])return;return db[_0x0772('0x7a')][_0x0772('0x4c')]({'where':{'id':_0x48831c[_0x0772('0x4b')]['UserId'],'role':_0x0772('0x69')},'attributes':['id',_0x0772('0x2e'),_0x0772('0x8a'),_0x0772('0x7b'),_0x0772('0x7c')],'raw':!![]});}return null;})['then'](function(_0x4acd83){if(!_0x4acd83)return null;_0x2fffc3[_0x0772('0x1e')][_0x0772('0x69')]=_0x4acd83;return _0x2fffc3;})['then'](function(_0x5df13c){if(_0x5df13c){_0x5df13c[_0x0772('0x1e')][_0x0772('0x7e')]=util[_0x0772('0x6f')](_0x0772('0x8b'),_0x48831c[_0x0772('0x68')][_0x0772('0x2e')]);_0x5df13c[_0x0772('0x1e')]['channel']=_0x2fffc3['channel'];_0x5df13c['message'][_0x0772('0x80')]=_0x2fffc3[_0x0772('0x7f')];_0x5df13c[_0x0772('0x1e')]['event']=_0x0772('0x84');_0x5df13c[_0x0772('0x1e')]['body']=htmlToText[_0x0772('0x82')](_0x2fffc3[_0x0772('0x1e')]['body']);respondWithRpcPromise(_0x0772('0x8c'),_0x0772('0x8c'),{'event':_0x0772('0x8d'),'message':_0x5df13c[_0x0772('0x1e')]},client9002);return _0x2fffc3;}return null;})[_0x0772('0x15')](respondWithResult(_0x383ebb,null))[_0x0772('0x20')](handleError(_0x383ebb,null));};exports[_0x0772('0x8e')]=function(_0x4e8d4a,_0x4ee5b3){var _0x1e8d5e=moment()[_0x0772('0x8f')]()['toString']();var _0x4c9b39=path['join'](config[_0x0772('0x90')],_0x0772('0x91'),_0x0772('0x92'),'tmp');var _0x259880=path[_0x0772('0x5c')](config[_0x0772('0x90')],_0x0772('0x91'),'files',_0x0772('0x5b'));var _0x2cef86=util[_0x0772('0x6f')](_0x0772('0x93'),_0x1e8d5e);return db[_0x0772('0x31')][_0x0772('0x4c')]({'where':{'id':_0x4e8d4a[_0x0772('0x48')]['id']},'attributes':['id','body','from','to','cc','bcc','subject','createdAt'],'include':_0x4e8d4a[_0x0772('0x37')][_0x0772('0x5b')]?[{'model':db[_0x0772('0x94')],'as':_0x0772('0x95')}]:undefined})['then'](handleEntityNotFound(_0x4ee5b3,null))[_0x0772('0x15')](function(_0x2b185a){if(_0x2b185a){var _0x230284=_0x2b185a;var _0xe32496={'from':_0x230284[_0x0772('0x96')],'to':_0x230284['to'],'subject':_0x230284[_0x0772('0x97')],'html':htmlEntities[_0x0772('0x98')](_0x230284['body']),'headers':{'Date':moment(_0x230284[_0x0772('0x99')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2b185a['cc']){_0xe32496['headers']['Cc']=_0x2b185a['cc'];}if(_0x2b185a[_0x0772('0x9a')]){_0xe32496[_0x0772('0x9b')][_0x0772('0x9c')]=_0x2b185a[_0x0772('0x9a')];}return new BPromise(function(_0xd7526f,_0x151845){if(_0x2b185a['Attachments']){for(var _0x583c8f=0x0;_0x583c8f<_0x2b185a[_0x0772('0x95')]['length'];_0x583c8f++){var _0xfc4746=_0x2b185a['Attachments'][_0x583c8f];var _0x1b4072=path[_0x0772('0x5c')](_0x259880,_0xfc4746[_0x0772('0x5e')]);if(fs['existsSync'](_0x1b4072)){_0xe32496[_0x0772('0x5b')][_0x0772('0x9d')]({'name':_0xfc4746[_0x0772('0x2e')],'contentType':_0xfc4746[_0x0772('0x34')],'data':fs[_0x0772('0x9e')](_0x1b4072)});}}}emlformat['build'](_0xe32496,function(_0x52ac92,_0xb50bf6){if(_0x52ac92)return _0x151845(_0x52ac92);fs[_0x0772('0x9f')](path[_0x0772('0x5c')](_0x4c9b39,_0x2cef86),_0xb50bf6);return _0xd7526f(_0xb50bf6);});});}})[_0x0772('0x15')](function(_0x43f14d){if(_0x43f14d){return _0x4ee5b3['download'](path[_0x0772('0x5c')](_0x4c9b39,_0x2cef86),_0x2cef86,function(_0x55a992){if(!_0x55a992)fs[_0x0772('0xa0')](path[_0x0772('0x5c')](_0x4c9b39,_0x2cef86));});}})[_0x0772('0x20')](handleError(_0x4ee5b3,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index da5fe8e..7c41bec 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 _0x1cab=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x1708c9,_0xd53378){var _0xb1a348=function(_0x580c03){while(--_0x580c03){_0x1708c9['push'](_0x1708c9['shift']());}};_0xb1a348(++_0xd53378);}(_0x1cab,0x1d1));var _0xb1ca=function(_0x2fb603,_0xc44be1){_0x2fb603=_0x2fb603-0x0;var _0x423b9d=_0x1cab[_0x2fb603];return _0x423b9d;};'use strict';var EventEmitter=require(_0xb1ca('0x0'));var MailMessage=require(_0xb1ca('0x1'))['db'][_0xb1ca('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb1ca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb1ca('0x4')};function emitEvent(_0x2ac2f6){return function(_0x3556e0,_0x55265f,_0x196081){MailMessageEvents[_0xb1ca('0x5')](_0x2ac2f6+':'+_0x3556e0['id'],_0x3556e0);MailMessageEvents['emit'](_0x2ac2f6,_0x3556e0);_0x196081(null);};}for(var e in events){if(events[_0xb1ca('0x6')](e)){var event=events[e];MailMessage[_0xb1ca('0x7')](e,emitEvent(event));}}module[_0xb1ca('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x884b=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x202dfd,_0x9ac39b){var _0x1c3464=function(_0x26b4cd){while(--_0x26b4cd){_0x202dfd['push'](_0x202dfd['shift']());}};_0x1c3464(++_0x9ac39b);}(_0x884b,0x162));var _0xb884=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x884b[_0x3616bb];return _0x1c0994;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xb884('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb884('0x1')](0x0);var events={'afterCreate':_0xb884('0x2'),'afterUpdate':_0xb884('0x3'),'afterDestroy':_0xb884('0x4')};function emitEvent(_0x3846fd){return function(_0x263633,_0x33c7b2,_0x4f8234){MailMessageEvents[_0xb884('0x5')](_0x3846fd+':'+_0x263633['id'],_0x263633);MailMessageEvents[_0xb884('0x5')](_0x3846fd,_0x263633);_0x4f8234(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xb884('0x6')](e,emitEvent(event));}}module[_0xb884('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7a7a664..b19b0f0 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 _0x9df6=['messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','get','toLowerCase','direction','out','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','MailMessage','mail_messages'];(function(_0x189241,_0x5564c5){var _0x2625de=function(_0x167605){while(--_0x167605){_0x189241['push'](_0x189241['shift']());}};_0x2625de(++_0x5564c5);}(_0x9df6,0x146));var _0x69df=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x9df6[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x69df('0x0'));var util=require(_0x69df('0x1'));var logger=require(_0x69df('0x2'))(_0x69df('0x3'));var moment=require(_0x69df('0x4'));var BPromise=require(_0x69df('0x5'));var rp=require(_0x69df('0x6'));var htmlToText=require(_0x69df('0x7'));var fs=require('fs');var path=require(_0x69df('0x8'));var rimraf=require(_0x69df('0x9'));var config=require('../../config/environment');var attributes=require(_0x69df('0xa'));module[_0x69df('0xb')]=function(_0x481da3,_0x1cf196){return _0x481da3['define'](_0x69df('0xc'),attributes,{'tableName':_0x69df('0xd'),'paranoid':![],'indexes':[{'name':_0x69df('0xe'),'fields':[_0x69df('0xe')]},{'name':_0x69df('0xf'),'fields':[_0x69df('0x10'),_0x69df('0x11')],'type':_0x69df('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1e9168,_0x5a8ed7,_0x1be9f0){if(_0x1e9168['body']){_0x1e9168[_0x69df('0x10')]=htmlToText[_0x69df('0x13')](_0x1e9168['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1be9f0(null,_0x5a8ed7);},'afterCreate':function(_0x5bf11b,_0x34c533,_0x356ec7){var _0x444add=_0x481da3['models'];var _0x16f91e=_0x5bf11b[_0x69df('0x14')]({'plain':!![]});if(_0x16f91e['direction'][_0x69df('0x15')]()==='in'||_0x16f91e[_0x69df('0x16')]['toLowerCase']()===_0x69df('0x17')&&!_0x16f91e['secret']&&!_[_0x69df('0x18')](_0x16f91e[_0x69df('0x19')])){_0x444add[_0x69df('0x1a')]['findOne']({'where':{'id':_0x16f91e[_0x69df('0x1b')]}})[_0x69df('0x1c')](function(_0x2cce22){if(_0x2cce22){_0x2cce22[_0x69df('0x1d')]({'lastMsgAt':_0x16f91e[_0x69df('0x1e')],'lastMsgDirection':_0x16f91e[_0x69df('0x16')][_0x69df('0x15')]()});}})['catch'](function(_0x36ac99){console[_0x69df('0x1f')](_0x36ac99);});}_0x356ec7();}},'charset':_0x69df('0x20'),'collate':_0x69df('0x21')});}; \ No newline at end of file +var _0xaeb5=['subject','FULLTEXT','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailMessage','mail_messages','messageId','plainBody'];(function(_0xd448a5,_0x52a055){var _0x4222a3=function(_0x12cbdd){while(--_0x12cbdd){_0xd448a5['push'](_0xd448a5['shift']());}};_0x4222a3(++_0x52a055);}(_0xaeb5,0x1c3));var _0x5aeb=function(_0x450f20,_0x159bb3){_0x450f20=_0x450f20-0x0;var _0x15bd66=_0xaeb5[_0x450f20];return _0x15bd66;};'use strict';var _=require(_0x5aeb('0x0'));var util=require('util');var logger=require(_0x5aeb('0x1'))(_0x5aeb('0x2'));var moment=require(_0x5aeb('0x3'));var BPromise=require(_0x5aeb('0x4'));var rp=require(_0x5aeb('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5aeb('0x6'));var rimraf=require(_0x5aeb('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x5aeb('0x8')]=function(_0x3ba9a7,_0x460f9e){return _0x3ba9a7[_0x5aeb('0x9')](_0x5aeb('0xa'),attributes,{'tableName':_0x5aeb('0xb'),'paranoid':![],'indexes':[{'name':_0x5aeb('0xc'),'fields':[_0x5aeb('0xc')]},{'name':'fti_mail_messages','fields':[_0x5aeb('0xd'),_0x5aeb('0xe')],'type':_0x5aeb('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x103bcc,_0x17d6ef,_0x4cf02e){if(_0x103bcc['body']){_0x103bcc[_0x5aeb('0xd')]=htmlToText[_0x5aeb('0x10')](_0x103bcc['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4cf02e(null,_0x17d6ef);},'afterCreate':function(_0x20df76,_0x13c9c4,_0x37cbe5){var _0x5f02b5=_0x3ba9a7[_0x5aeb('0x11')];var _0x44ffa9=_0x20df76[_0x5aeb('0x12')]({'plain':!![]});if(_0x44ffa9[_0x5aeb('0x13')][_0x5aeb('0x14')]()==='in'||_0x44ffa9[_0x5aeb('0x13')]['toLowerCase']()===_0x5aeb('0x15')&&!_0x44ffa9[_0x5aeb('0x16')]&&!_[_0x5aeb('0x17')](_0x44ffa9['UserId'])){_0x5f02b5[_0x5aeb('0x18')][_0x5aeb('0x19')]({'where':{'id':_0x44ffa9[_0x5aeb('0x1a')]}})['then'](function(_0x5c833b){if(_0x5c833b){_0x5c833b[_0x5aeb('0x1b')]({'lastMsgAt':_0x44ffa9['createdAt'],'lastMsgDirection':_0x44ffa9[_0x5aeb('0x13')][_0x5aeb('0x14')]()});}})[_0x5aeb('0x1c')](function(_0xa105e){console[_0x5aeb('0x1d')](_0xa105e);});}_0x37cbe5();}},'charset':'utf8mb4','collate':_0x5aeb('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 2438a6a..735c2d0 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 _0x8f4c=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8f4c,0x113));var _0xc8f4=function(_0x592587,_0x854f57){_0x592587=_0x592587-0x0;var _0x6d9f1d=_0x8f4c[_0x592587];return _0x6d9f1d;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8f4('0xa')](config['redis'],{'host':_0xc8f4('0xb'),'port':0x18eb});var socket=require(_0xc8f4('0xc'))(new Redis(config[_0xc8f4('0xd')]));require(_0xc8f4('0xe'))[_0xc8f4('0xf')](socket);function respondWithRpcPromise(_0x599de3,_0x38c41b,_0x191b92){return new BPromise(function(_0x2fba62,_0x3a2f8a){return client['request'](_0x599de3,_0x191b92)[_0xc8f4('0x10')](function(_0x52c699){logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));logger[_0xc8f4('0x14')](_0xc8f4('0x15'),_0x38c41b,'request\x20sent',JSON[_0xc8f4('0x16')](_0x52c699));if(_0x52c699[_0xc8f4('0x17')]){if(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x18')]===0x1f4){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x3a2f8a(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x19')]);}logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x2fba62(_0x52c699['error']['message']);}else{logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));_0x2fba62(_0x52c699[_0xc8f4('0x1a')][_0xc8f4('0x19')]);}})[_0xc8f4('0x1b')](function(_0x2459ac){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x2459ac);_0x3a2f8a(_0x2459ac);});});}exports[_0xc8f4('0x1c')]=function(_0x3cd90c){var _0x3126e5=this;return new Promise(function(_0x22236c,_0x5f3264){return db[_0xc8f4('0x1d')][_0xc8f4('0x1e')](_0x3cd90c[_0xc8f4('0x1f')],{'raw':_0x3cd90c[_0xc8f4('0x20')]?_0x3cd90c[_0xc8f4('0x20')][_0xc8f4('0x21')]===undefined?!![]:![]:!![]})[_0xc8f4('0x10')](function(_0x43eb57){logger['info'](_0xc8f4('0x1c'),_0x3cd90c);logger[_0xc8f4('0x14')](_0xc8f4('0x1c'),_0x3cd90c,JSON[_0xc8f4('0x16')](_0x43eb57));_0x22236c(_0x43eb57);})['catch'](function(_0x39174f){logger['error'](_0xc8f4('0x1c'),_0x39174f['message'],_0x3cd90c);_0x5f3264(_0x3126e5[_0xc8f4('0x17')](0x1f4,_0x39174f[_0xc8f4('0x19')]));});});}; \ No newline at end of file +var _0x93e9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','debug'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x93e9,0xcc));var _0x993e=function(_0x3aa0ac,_0x5f5da6){_0x3aa0ac=_0x3aa0ac-0x0;var _0x568a11=_0x93e9[_0x3aa0ac];return _0x568a11;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});config[_0x993e('0xc')]=_[_0x993e('0xd')](config[_0x993e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x993e('0xe'))(new Redis(config[_0x993e('0xc')]));require(_0x993e('0xf'))[_0x993e('0x10')](socket);function respondWithRpcPromise(_0x2cd389,_0x27a28f,_0x1c2324){return new BPromise(function(_0x48291a,_0x196f6d){return client[_0x993e('0x11')](_0x2cd389,_0x1c2324)['then'](function(_0x5ebc8c){logger[_0x993e('0x12')]('MailMessage,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'),JSON[_0x993e('0x14')](_0x5ebc8c));if(_0x5ebc8c[_0x993e('0x15')]){if(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x16')]===0x1f4){logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x196f6d(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x48291a(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}else{logger['info'](_0x993e('0x17'),_0x27a28f,_0x993e('0x13'));_0x48291a(_0x5ebc8c[_0x993e('0x19')][_0x993e('0x18')]);}})[_0x993e('0x1a')](function(_0x3eda77){logger['error'](_0x993e('0x17'),_0x27a28f,_0x3eda77);_0x196f6d(_0x3eda77);});});}exports[_0x993e('0x1b')]=function(_0x1eaf57){var _0x22390e=this;return new Promise(function(_0x130a8a,_0x425ab4){return db[_0x993e('0x1c')][_0x993e('0x1d')](_0x1eaf57['body'],{'raw':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57['options'][_0x993e('0x1f')]===undefined?!![]:![]:!![]})[_0x993e('0x20')](function(_0x32b09e){logger['info'](_0x993e('0x1b'),_0x1eaf57);logger[_0x993e('0x21')](_0x993e('0x1b'),_0x1eaf57,JSON[_0x993e('0x14')](_0x32b09e));_0x130a8a(_0x32b09e);})[_0x993e('0x1a')](function(_0x328d22){logger[_0x993e('0x15')](_0x993e('0x1b'),_0x328d22[_0x993e('0x18')],_0x1eaf57);_0x425ab4(_0x22390e[_0x993e('0x15')](0x1f4,_0x328d22[_0x993e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 3f5e62c..055bfb0 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 _0x097c=['save','remove','emit','register','./mailMessage.events'];(function(_0x16d128,_0x51e647){var _0xa5d180=function(_0x591170){while(--_0x591170){_0x16d128['push'](_0x16d128['shift']());}};_0xa5d180(++_0x51e647);}(_0x097c,0x1d5));var _0xc097=function(_0x103b97,_0x5c5d71){_0x103b97=_0x103b97-0x0;var _0x3f0337=_0x097c[_0x103b97];return _0x3f0337;};'use strict';var MailMessageEvents=require(_0xc097('0x0'));var events=[_0xc097('0x1'),_0xc097('0x2'),'update'];function createListener(_0x1eb862,_0x5b478f){return function(_0x23e66a){_0x5b478f[_0xc097('0x3')](_0x1eb862,_0x23e66a);};}function removeListener(_0x5aa3c1,_0x265284){return function(){MailMessageEvents['removeListener'](_0x5aa3c1,_0x265284);};}exports[_0xc097('0x4')]=function(_0x3c9603){for(var _0x31bc9a=0x0,_0x32493e=events['length'];_0x31bc9a<_0x32493e;_0x31bc9a++){var _0x3f67a4=events[_0x31bc9a];var _0x4d95d9=createListener('mailMessage:'+_0x3f67a4,_0x3c9603);MailMessageEvents['on'](_0x3f67a4,_0x4d95d9);}}; \ No newline at end of file +var _0x802c=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x2fa76b,_0x2fef86){var _0x547c53=function(_0x210b55){while(--_0x210b55){_0x2fa76b['push'](_0x2fa76b['shift']());}};_0x547c53(++_0x2fef86);}(_0x802c,0xd1));var _0xc802=function(_0x363789,_0x285ecd){_0x363789=_0x363789-0x0;var _0x129141=_0x802c[_0x363789];return _0x129141;};'use strict';var MailMessageEvents=require(_0xc802('0x0'));var events=[_0xc802('0x1'),_0xc802('0x2'),_0xc802('0x3')];function createListener(_0x1b07c7,_0x262600){return function(_0x2ee49a){_0x262600[_0xc802('0x4')](_0x1b07c7,_0x2ee49a);};}function removeListener(_0x7d0b02,_0x4fc45e){return function(){MailMessageEvents[_0xc802('0x5')](_0x7d0b02,_0x4fc45e);};}exports[_0xc802('0x6')]=function(_0x45da20){for(var _0x450195=0x0,_0x5aeb37=events[_0xc802('0x7')];_0x450195<_0x5aeb37;_0x450195++){var _0x300985=events[_0x450195];var _0x144b78=createListener(_0xc802('0x8')+_0x300985,_0x45da20);MailMessageEvents['on'](_0x300985,_0x144b78);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ed044c9..eded641 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 _0x10b7=['get','describe','/:id','getMembers','/:id/teams','/:id/users','post','addAgents','put','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x52ec7c,_0x1d6b4e){var _0x224914=function(_0x35063e){while(--_0x35063e){_0x52ec7c['push'](_0x52ec7c['shift']());}};_0x224914(++_0x1d6b4e);}(_0x10b7,0x76));var _0x710b=function(_0x50f128,_0xd07d20){_0x50f128=_0x50f128-0x0;var _0x3e4b0a=_0x10b7[_0x50f128];return _0x3e4b0a;};'use strict';var multer=require(_0x710b('0x0'));var util=require('util');var path=require(_0x710b('0x1'));var timeout=require(_0x710b('0x2'));var express=require(_0x710b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x710b('0x4'));var config=require(_0x710b('0x5'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x710b('0x6')](),controller[_0x710b('0x7')]);router[_0x710b('0x8')]('/describe',auth[_0x710b('0x6')](),controller[_0x710b('0x9')]);router[_0x710b('0x8')](_0x710b('0xa'),auth[_0x710b('0x6')](),controller['show']);router[_0x710b('0x8')]('/:id/members',auth[_0x710b('0x6')](),controller[_0x710b('0xb')]);router[_0x710b('0x8')](_0x710b('0xc'),auth[_0x710b('0x6')](),controller['getTeams']);router[_0x710b('0x8')](_0x710b('0xd'),auth[_0x710b('0x6')](),controller['getAgents']);router[_0x710b('0xe')]('/',auth[_0x710b('0x6')](),controller['create']);router[_0x710b('0xe')]('/:id/teams',auth[_0x710b('0x6')](),controller['addTeams']);router['post']('/:id/users',auth[_0x710b('0x6')](),controller[_0x710b('0xf')]);router[_0x710b('0x10')](_0x710b('0xa'),auth[_0x710b('0x6')](),controller[_0x710b('0x11')]);router['delete'](_0x710b('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x710b('0x12')](_0x710b('0xc'),auth[_0x710b('0x6')](),controller[_0x710b('0x13')]);router[_0x710b('0x12')](_0x710b('0xd'),auth['isAuthenticated'](),controller[_0x710b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6e31=['/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','destroy','removeTeams','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x1ec8fb,_0x8c43a9){var _0x166128=function(_0x41a20b){while(--_0x41a20b){_0x1ec8fb['push'](_0x1ec8fb['shift']());}};_0x166128(++_0x8c43a9);}(_0x6e31,0x89));var _0x16e3=function(_0x47f11f,_0x5e7078){_0x47f11f=_0x47f11f-0x0;var _0x3d8bdb=_0x6e31[_0x47f11f];return _0x3d8bdb;};'use strict';var multer=require('multer');var util=require(_0x16e3('0x0'));var path=require(_0x16e3('0x1'));var timeout=require(_0x16e3('0x2'));var express=require(_0x16e3('0x3'));var router=express[_0x16e3('0x4')]();var fs_extra=require(_0x16e3('0x5'));var auth=require(_0x16e3('0x6'));var interaction=require(_0x16e3('0x7'));var config=require(_0x16e3('0x8'));var controller=require(_0x16e3('0x9'));router[_0x16e3('0xa')]('/',auth[_0x16e3('0xb')](),controller[_0x16e3('0xc')]);router[_0x16e3('0xa')](_0x16e3('0xd'),auth[_0x16e3('0xb')](),controller['describe']);router[_0x16e3('0xa')](_0x16e3('0xe'),auth['isAuthenticated'](),controller[_0x16e3('0xf')]);router[_0x16e3('0xa')](_0x16e3('0x10'),auth[_0x16e3('0xb')](),controller[_0x16e3('0x11')]);router[_0x16e3('0xa')](_0x16e3('0x12'),auth[_0x16e3('0xb')](),controller[_0x16e3('0x13')]);router[_0x16e3('0xa')](_0x16e3('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x16e3('0xb')](),controller[_0x16e3('0x15')]);router[_0x16e3('0x16')]('/:id/teams',auth[_0x16e3('0xb')](),controller[_0x16e3('0x17')]);router['post'](_0x16e3('0x14'),auth[_0x16e3('0xb')](),controller[_0x16e3('0x18')]);router[_0x16e3('0x19')](_0x16e3('0xe'),auth[_0x16e3('0xb')](),controller['update']);router['delete'](_0x16e3('0xe'),auth['isAuthenticated'](),controller[_0x16e3('0x1a')]);router['delete'](_0x16e3('0x12'),auth['isAuthenticated'](),controller[_0x16e3('0x1b')]);router[_0x16e3('0x1c')](_0x16e3('0x14'),auth[_0x16e3('0xb')](),controller['removeAgents']);module[_0x16e3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index b6c77f8..75a8813 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 _0xb108=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1c6481,_0x11b650){var _0x4379e8=function(_0x43736b){while(--_0x43736b){_0x1c6481['push'](_0x1c6481['shift']());}};_0x4379e8(++_0x11b650);}(_0xb108,0x1e3));var _0x8b10=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb108[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8b10('0x0'));module[_0x8b10('0x1')]={'name':{'type':Sequelize[_0x8b10('0x2')],'unique':_0x8b10('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8b10('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b10('0x5')](_0x8b10('0x6'),'beepall',_0x8b10('0x7'))}}; \ No newline at end of file +var _0xb773=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb773,0x88));var _0x3b77=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0xb773[_0x20008a];return _0x5d0f1c;};'use strict';var Sequelize=require(_0x3b77('0x0'));module[_0x3b77('0x1')]={'name':{'type':Sequelize[_0x3b77('0x2')],'unique':_0x3b77('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3b77('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3b77('0x4')](_0x3b77('0x5'),_0x3b77('0x6'),_0x3b77('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f7e8312..ac6b462 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 _0xf511=['format','%s/%s','updatedAt','getTeams','Team','order','sort','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','findOne','options','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailQueue.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','get','MailQueues','stack','name','index','MailQueue','rawAttributes','fieldName','type','include','query','rows','catch','show','model','keys','filters','intersection','fields','attributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','getMembers','UserMailQueue','length','hasOwnProperty','nolimit','where','pick','MailQueueId','filter','merge','findAll','findAndCountAll','map','UserId','mailPause','createdAt'];(function(_0x12c7e7,_0x49d19c){var _0x220611=function(_0x152ece){while(--_0x152ece){_0x12c7e7['push'](_0x12c7e7['shift']());}};_0x220611(++_0x49d19c);}(_0xf511,0x19e));var _0x1f51=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xf511[_0x158a58];return _0x4935d9;};'use strict';var BPromise=require(_0x1f51('0x0'));var util=require('util');var _=require(_0x1f51('0x1'));var squel=require(_0x1f51('0x2'));var Redis=require(_0x1f51('0x3'));var qs=require(_0x1f51('0x4'));var logger=require(_0x1f51('0x5'))(_0x1f51('0x6'));var config=require(_0x1f51('0x7'));var db=require(_0x1f51('0x8'))['db'];config['redis']=_[_0x1f51('0x9')](config[_0x1f51('0xa')],{'host':_0x1f51('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f51('0xa')]));require(_0x1f51('0xc'))['register'](socket);function respondWithStatusCode(_0x3c929c,_0x35ea6a){_0x35ea6a=_0x35ea6a||0xcc;return function(_0x46246e){if(_0x46246e){return _0x3c929c[_0x1f51('0xd')](_0x35ea6a);}return _0x3c929c[_0x1f51('0xe')](_0x35ea6a)['end']();};}function respondWithResult(_0x4017c3,_0x5d35e1){_0x5d35e1=_0x5d35e1||0xc8;return function(_0x3db066){if(_0x3db066){return _0x4017c3[_0x1f51('0xe')](_0x5d35e1)['json'](_0x3db066);}};}function respondWithFilteredResult(_0x3ae27a,_0x29e45e){return function(_0x34be49){if(_0x34be49){var _0x322864=typeof _0x29e45e[_0x1f51('0xf')]===_0x1f51('0x10')&&typeof _0x29e45e[_0x1f51('0x11')]===_0x1f51('0x10');var _0x32e5af=_0x34be49[_0x1f51('0x12')];var _0x367068=_0x322864?0x0:_0x29e45e['offset'];var _0x1d71a8=_0x322864?_0x34be49[_0x1f51('0x12')]:_0x29e45e[_0x1f51('0xf')]+_0x29e45e[_0x1f51('0x11')];var _0x1c1f56;if(_0x1d71a8>=_0x32e5af){_0x1d71a8=_0x32e5af;_0x1c1f56=0xc8;}else{_0x1c1f56=0xce;}_0x3ae27a[_0x1f51('0xe')](_0x1c1f56);return _0x3ae27a[_0x1f51('0x13')](_0x1f51('0x14'),_0x367068+'-'+_0x1d71a8+'/'+_0x32e5af)[_0x1f51('0x15')](_0x34be49);}return null;};}function saveUpdates(_0x584d47){return function(_0x3cd69c){if(_0x3cd69c){return _0x3cd69c[_0x1f51('0x16')](_0x584d47)[_0x1f51('0x17')](function(_0x2c57cd){return _0x2c57cd;});}return null;};}function removeEntity(_0x3fb079){return function(_0x2afc99){if(_0x2afc99){return _0x2afc99['destroy']()[_0x1f51('0x17')](function(){var _0x14cfa4=_0x2afc99[_0x1f51('0x18')]({'plain':!![]});var _0x3e0ac7=_0x1f51('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e0ac7,'resourceId':_0x14cfa4['id']}})[_0x1f51('0x17')](function(){return _0x2afc99;});})[_0x1f51('0x17')](function(){_0x3fb079['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7182c8){return function(_0x77d2c3){if(!_0x77d2c3){_0x7182c8[_0x1f51('0xd')](0x194);}return _0x77d2c3;};}function handleError(_0x3519e1,_0x1874f2){_0x1874f2=_0x1874f2||0x1f4;return function(_0x5a80cb){logger['error'](_0x5a80cb[_0x1f51('0x1a')]);if(_0x5a80cb[_0x1f51('0x1b')]){delete _0x5a80cb[_0x1f51('0x1b')];}_0x3519e1['status'](_0x1874f2)['send'](_0x5a80cb);};}exports[_0x1f51('0x1c')]=function(_0x2d90e1,_0x214d7d){var _0x116405={};var _0x262f93={'count':0x0,'rows':[]};var _0x9cdb39=_['map'](db[_0x1f51('0x1d')][_0x1f51('0x1e')],function(_0xd61ff7){return{'name':_0xd61ff7[_0x1f51('0x1f')],'type':_0xd61ff7[_0x1f51('0x20')]['key']};});_0x116405=qs['getOptions'](_0x9cdb39,_0x2d90e1);var _0x1d15cf={'where':_0x116405['where']};return db[_0x1f51('0x1d')][_0x1f51('0x12')](_0x1d15cf)['then'](function(_0x42750b){_0x262f93[_0x1f51('0x12')]=_0x42750b;_0x116405[_0x1f51('0x21')]=qs[_0x1f51('0x21')](_0x2d90e1[_0x1f51('0x22')]);return db[_0x1f51('0x1d')]['findAll'](_0x116405);})[_0x1f51('0x17')](function(_0x2a32a6){_0x262f93[_0x1f51('0x23')]=_0x2a32a6;return _0x262f93;})['then'](respondWithFilteredResult(_0x214d7d,_0x116405))[_0x1f51('0x24')](handleError(_0x214d7d,null));};exports[_0x1f51('0x25')]=function(_0x2cdd4c,_0x25028b){var _0x1f867a={'raw':!![],'where':{'id':_0x2cdd4c['params']['id']}},_0x330df5={};_0x330df5[_0x1f51('0x26')]=_[_0x1f51('0x27')](db[_0x1f51('0x1d')]['rawAttributes']);_0x330df5[_0x1f51('0x22')]=_[_0x1f51('0x27')](_0x2cdd4c[_0x1f51('0x22')]);_0x330df5[_0x1f51('0x28')]=_[_0x1f51('0x29')](_0x330df5[_0x1f51('0x26')],_0x330df5[_0x1f51('0x22')]);_0x1f867a['attributes']=_[_0x1f51('0x29')](_0x330df5[_0x1f51('0x26')],qs[_0x1f51('0x2a')](_0x2cdd4c[_0x1f51('0x22')][_0x1f51('0x2a')]));_0x1f867a['attributes']=_0x1f867a[_0x1f51('0x2b')]['length']?_0x1f867a[_0x1f51('0x2b')]:_0x330df5[_0x1f51('0x26')];if(_0x2cdd4c[_0x1f51('0x22')][_0x1f51('0x2c')]){_0x1f867a['include']=[{'all':!![]}];}_0x1f867a=_['merge']({},_0x1f867a,_0x2cdd4c['options']);return db[_0x1f51('0x1d')][_0x1f51('0x2d')](_0x1f867a)[_0x1f51('0x17')](handleEntityNotFound(_0x25028b,null))['then'](respondWithResult(_0x25028b,null))[_0x1f51('0x24')](handleError(_0x25028b,null));};exports['create']=function(_0x4ffa28,_0x3981f0){return db[_0x1f51('0x1d')][_0x1f51('0x2e')](_0x4ffa28['body'],{})[_0x1f51('0x17')](function(_0x4070ce){var _0x2130d3=_0x4ffa28['user'][_0x1f51('0x18')]({'plain':!![]});if(!_0x2130d3)throw new Error(_0x1f51('0x2f'));if(_0x2130d3['role']===_0x1f51('0x30')){var _0x4cce17=_0x4070ce[_0x1f51('0x18')]({'plain':!![]});var _0x4b0129=_0x1f51('0x19');return db[_0x1f51('0x31')]['find']({'where':{'name':_0x4b0129,'userProfileId':_0x2130d3['userProfileId']},'raw':!![]})['then'](function(_0x33bd41){if(_0x33bd41&&_0x33bd41[_0x1f51('0x32')]===0x0){return db[_0x1f51('0x33')]['create']({'name':_0x4cce17[_0x1f51('0x1b')],'resourceId':_0x4cce17['id'],'type':_0x33bd41[_0x1f51('0x1b')],'sectionId':_0x33bd41['id']},{})['then'](function(){return _0x4070ce;});}else{return _0x4070ce;}})['catch'](function(_0xf364ec){logger[_0x1f51('0x34')](_0x1f51('0x35'),_0xf364ec);throw _0xf364ec;});}return _0x4070ce;})[_0x1f51('0x17')](respondWithResult(_0x3981f0,0xc9))[_0x1f51('0x24')](handleError(_0x3981f0,null));};exports[_0x1f51('0x16')]=function(_0x59623c,_0x44fdab){if(_0x59623c[_0x1f51('0x36')]['id']){delete _0x59623c[_0x1f51('0x36')]['id'];}return db[_0x1f51('0x1d')]['find']({'where':{'id':_0x59623c[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](handleEntityNotFound(_0x44fdab,null))[_0x1f51('0x17')](saveUpdates(_0x59623c[_0x1f51('0x36')],null))['then'](respondWithResult(_0x44fdab,null))['catch'](handleError(_0x44fdab,null));};exports[_0x1f51('0x38')]=function(_0xc9a32b,_0x337407){return db['MailQueue']['find']({'where':{'id':_0xc9a32b[_0x1f51('0x37')]['id']}})['then'](handleEntityNotFound(_0x337407,null))[_0x1f51('0x17')](removeEntity(_0x337407,null))[_0x1f51('0x24')](handleError(_0x337407,null));};exports['describe']=function(_0xf372d3,_0x3cc7e7){return db[_0x1f51('0x1d')][_0x1f51('0x39')]()[_0x1f51('0x17')](respondWithResult(_0x3cc7e7,null))[_0x1f51('0x24')](handleError(_0x3cc7e7,null));};exports[_0x1f51('0x3a')]=function(_0x579dcb,_0x3d2a64){var _0x27f81d={'raw':!![],'where':{}},_0x8fe8b7={},_0x4044b9;return db[_0x1f51('0x1d')]['findOne']({'where':{'id':_0x579dcb[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](handleEntityNotFound(_0x3d2a64,null))['then'](function(_0x465f3c){if(_0x465f3c){_0x4044b9=_0x465f3c['get']({'plain':!![]});_0x8fe8b7['model']=_[_0x1f51('0x27')](db[_0x1f51('0x3b')]['rawAttributes']);_0x8fe8b7['query']=_[_0x1f51('0x27')](_0x579dcb[_0x1f51('0x22')]);_0x8fe8b7[_0x1f51('0x28')]=_[_0x1f51('0x29')](_0x8fe8b7[_0x1f51('0x26')],_0x8fe8b7[_0x1f51('0x22')]);_0x27f81d[_0x1f51('0x2b')]=_[_0x1f51('0x29')](_0x8fe8b7[_0x1f51('0x26')],qs[_0x1f51('0x2a')](_0x579dcb[_0x1f51('0x22')]['fields']));_0x27f81d[_0x1f51('0x2b')]=_0x27f81d[_0x1f51('0x2b')][_0x1f51('0x3c')]?_0x27f81d[_0x1f51('0x2b')]:_0x8fe8b7[_0x1f51('0x26')];if(!_0x579dcb[_0x1f51('0x22')][_0x1f51('0x3d')](_0x1f51('0x3e'))){_0x27f81d[_0x1f51('0x11')]=qs[_0x1f51('0x11')](_0x579dcb[_0x1f51('0x22')][_0x1f51('0x11')]);_0x27f81d['offset']=qs['offset'](_0x579dcb['query'][_0x1f51('0xf')]);}_0x27f81d['order']=qs['sort'](_0x579dcb[_0x1f51('0x22')]['sort']);_0x27f81d[_0x1f51('0x3f')]=qs[_0x1f51('0x28')](_[_0x1f51('0x40')](_0x579dcb[_0x1f51('0x22')],_0x8fe8b7['filters']));_0x27f81d[_0x1f51('0x3f')][_0x1f51('0x41')]=_0x465f3c['id'];if(_0x579dcb['query'][_0x1f51('0x42')]){_0x27f81d[_0x1f51('0x3f')]=_[_0x1f51('0x43')](_0x27f81d[_0x1f51('0x3f')],{'$or':_['map'](_0x27f81d[_0x1f51('0x2b')],function(_0x51c884){var _0x31bec0={};_0x31bec0[_0x51c884]={'$like':'%'+_0x579dcb[_0x1f51('0x22')][_0x1f51('0x42')]+'%'};return _0x31bec0;})});}_0x27f81d=_[_0x1f51('0x43')]({},_0x27f81d,_0x579dcb['options']);return db['UserMailQueue'][_0x1f51('0x44')](_0x27f81d);}})[_0x1f51('0x17')](function(_0x48ebaf){if(_0x48ebaf){return db['User'][_0x1f51('0x45')]({'where':{'id':_[_0x1f51('0x46')](_0x48ebaf,_0x1f51('0x47')),'role':'agent'},'attributes':['id',_0x1f51('0x1b'),_0x1f51('0x48'),'updatedAt',_0x1f51('0x49')]});}})['then'](function(_0x48479d){if(_0x48479d){return{'count':_0x48479d[_0x1f51('0x12')],'rows':_[_0x1f51('0x46')](_0x48479d['rows'],function(_0x407640){return{'membername':_0x407640[_0x1f51('0x1b')],'UserId':_0x407640['id'],'queue_name':_0x4044b9[_0x1f51('0x1b')],'MailQueueId':_0x4044b9['id'],'interface':util[_0x1f51('0x4a')](_0x1f51('0x4b'),'SIP',_0x407640[_0x1f51('0x1b')]),'penalty':0x0,'paused':_0x407640['mailPause'],'createdAt':_0x407640[_0x1f51('0x49')],'updatedAt':_0x407640[_0x1f51('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1f51('0x17')](respondWithFilteredResult(_0x3d2a64,_0x27f81d))[_0x1f51('0x24')](handleError(_0x3d2a64,null));};exports[_0x1f51('0x4d')]=function(_0x51511b,_0x64edfe){var _0x2744d7={};var _0x4ee49a={};var _0x384747;var _0x3dbc5f;return db[_0x1f51('0x1d')]['findOne']({'where':{'id':_0x51511b['params']['id']}})[_0x1f51('0x17')](handleEntityNotFound(_0x64edfe,null))[_0x1f51('0x17')](function(_0x20f66d){if(_0x20f66d){_0x384747=_0x20f66d;_0x4ee49a[_0x1f51('0x26')]=_['keys'](db[_0x1f51('0x4e')][_0x1f51('0x1e')]);_0x4ee49a[_0x1f51('0x22')]=_[_0x1f51('0x27')](_0x51511b[_0x1f51('0x22')]);_0x4ee49a[_0x1f51('0x28')]=_['intersection'](_0x4ee49a['model'],_0x4ee49a[_0x1f51('0x22')]);_0x2744d7[_0x1f51('0x2b')]=_[_0x1f51('0x29')](_0x4ee49a[_0x1f51('0x26')],qs['fields'](_0x51511b[_0x1f51('0x22')][_0x1f51('0x2a')]));_0x2744d7['attributes']=_0x2744d7[_0x1f51('0x2b')][_0x1f51('0x3c')]?_0x2744d7[_0x1f51('0x2b')]:_0x4ee49a['model'];_0x2744d7[_0x1f51('0x4f')]=qs[_0x1f51('0x50')](_0x51511b[_0x1f51('0x22')][_0x1f51('0x50')]);_0x2744d7[_0x1f51('0x3f')]=qs[_0x1f51('0x28')](_[_0x1f51('0x40')](_0x51511b[_0x1f51('0x22')],_0x4ee49a['filters']));if(_0x51511b[_0x1f51('0x22')][_0x1f51('0x42')]){_0x2744d7['where']=_['merge'](_0x2744d7[_0x1f51('0x3f')],{'$or':_['map'](_0x2744d7[_0x1f51('0x2b')],function(_0x1bc6b6){var _0x11b18f={};_0x11b18f[_0x1bc6b6]={'$like':'%'+_0x51511b[_0x1f51('0x22')][_0x1f51('0x42')]+'%'};return _0x11b18f;})});}_0x2744d7=_[_0x1f51('0x43')]({},_0x2744d7,_0x51511b['options']);return _0x384747[_0x1f51('0x4d')](_0x2744d7);}})[_0x1f51('0x17')](function(_0x4383e0){if(_0x4383e0){_0x3dbc5f=_0x4383e0[_0x1f51('0x3c')];if(!_0x51511b[_0x1f51('0x22')][_0x1f51('0x3d')](_0x1f51('0x3e'))){_0x2744d7[_0x1f51('0x11')]=qs[_0x1f51('0x11')](_0x51511b[_0x1f51('0x22')][_0x1f51('0x11')]);_0x2744d7[_0x1f51('0xf')]=qs['offset'](_0x51511b[_0x1f51('0x22')][_0x1f51('0xf')]);}return _0x384747[_0x1f51('0x4d')](_0x2744d7);}})[_0x1f51('0x17')](function(_0xca49b4){if(_0xca49b4){return _0xca49b4?{'count':_0x3dbc5f,'rows':_0xca49b4}:null;}})[_0x1f51('0x17')](respondWithResult(_0x64edfe,null))[_0x1f51('0x24')](handleError(_0x64edfe,null));};exports[_0x1f51('0x51')]=function(_0x4eac06,_0x598f7c){var _0x2a0da7=_0x4eac06[_0x1f51('0x36')][_0x1f51('0x52')];return db[_0x1f51('0x4e')][_0x1f51('0x44')]({'where':{'id':_0x2a0da7},'attributes':['id'],'include':[{'model':db[_0x1f51('0x53')],'as':_0x1f51('0x54'),'attributes':['id',_0x1f51('0x1b'),_0x1f51('0x55'),_0x1f51('0x56'),'interface'],'raw':!![]}]})['then'](function(_0x3079df){if(_0x3079df){var _0x1c55a7=_[_0x1f51('0x57')](_0x3079df,function(_0x2083ca){var _0x255721=_0x2083ca[_0x1f51('0x18')]({'plain':!![]});return _0x255721[_0x1f51('0x54')];});return db[_0x1f51('0x1d')][_0x1f51('0x2d')]({'where':{'id':_0x4eac06[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](function(_0x37663b){return db[_0x1f51('0x58')][_0x1f51('0x59')](function(_0x370fea){return _0x37663b['addTeams'](_0x2a0da7,{'transaction':_0x370fea})[_0x1f51('0x17')](function(){return BPromise[_0x1f51('0x5a')](_0x1c55a7,function(_0x5aafe8){return db[_0x1f51('0x3b')][_0x1f51('0x5b')]({'where':{'UserId':_0x5aafe8['id'],'MailQueueId':_0x4eac06[_0x1f51('0x37')]['id']},'transaction':_0x370fea});});})[_0x1f51('0x17')](function(){_0x1c55a7[_0x1f51('0x5c')](function(_0x40dac5){socket[_0x1f51('0x5d')](_0x1f51('0x5e'),{'UserId':_0x40dac5['id'],'MailQueueId':_0x37663b['id']});});});});});}})['then'](respondWithStatusCode(_0x598f7c,null))[_0x1f51('0x24')](handleError(_0x598f7c,null));};exports[_0x1f51('0x5f')]=function(_0x2a4b98,_0x2c87c9){return db[_0x1f51('0x4e')][_0x1f51('0x44')]({'where':{'id':_0x2a4b98[_0x1f51('0x22')][_0x1f51('0x52')]},'attributes':['id'],'include':[{'model':db[_0x1f51('0x53')],'as':_0x1f51('0x54'),'attributes':['id'],'raw':!![]}]})[_0x1f51('0x17')](handleEntityNotFound(_0x2c87c9,null))[_0x1f51('0x17')](function(_0x4322d5){var _0xe6e5c4=_['map'](_0x4322d5,'id');var _0x2b5c08=[];var _0x28aaa2=[];var _0x429956=squel['select']();_0x429956['field'](_0x1f51('0x60'))[_0x1f51('0x61')]('team_has_mail_queues','tq')[_0x1f51('0x62')](_0x1f51('0x63'),'ut',_0x1f51('0x64'))[_0x1f51('0x3f')](_0x1f51('0x65'),_0x2a4b98[_0x1f51('0x37')]['id']);for(var _0x95216c=0x0;_0x95216c<_0x4322d5['length'];_0x95216c+=0x1){let _0x1a63e9=_0x4322d5[_0x95216c];for(var _0x1f9f5c=0x0;_0x1f9f5c<_0x1a63e9[_0x1f51('0x54')][_0x1f51('0x3c')];_0x1f9f5c+=0x1){let _0x30d301=_0x1a63e9[_0x1f51('0x54')][_0x1f9f5c];var _0x5d88b6=_0x429956['clone']();_0x5d88b6[_0x1f51('0x3f')](_0x1f51('0x66'),_0x30d301['id']);_0x28aaa2[_0x1f51('0x67')](db['sequelize'][_0x1f51('0x22')](_0x5d88b6['toString'](),{'type':db[_0x1f51('0x58')][_0x1f51('0x68')][_0x1f51('0x69')]})[_0x1f51('0x17')](function(_0xdf8203){if(_0xdf8203[_0x1f51('0x3c')]===0x1){return _0x30d301['id'];}else{var _0x207354=_['every'](_['map'](_0xdf8203,_0x1f51('0x6a')),function(_0xba3c6e){return _[_0x1f51('0x6b')](_0xe6e5c4,_0xba3c6e);});if(_0x207354){return _0x30d301['id'];}}}));}}return BPromise[_0x1f51('0x6c')](_0x28aaa2)[_0x1f51('0x17')](function(_0x20890d){_0x2b5c08=_(_0x2b5c08)[_0x1f51('0x6d')](_0x20890d)[_0x1f51('0x6e')]()[_0x1f51('0x6f')]();return db[_0x1f51('0x1d')][_0x1f51('0x2d')]({'where':{'id':_0x2a4b98[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](function(_0x1eeb84){return db[_0x1f51('0x58')][_0x1f51('0x59')](function(_0x3c6873){return _0x1eeb84[_0x1f51('0x5f')](_0x2a4b98[_0x1f51('0x22')][_0x1f51('0x52')],{'transaction':_0x3c6873})[_0x1f51('0x17')](function(){if(!_[_0x1f51('0x70')](_0x2b5c08)){return _0x1eeb84[_0x1f51('0x71')](_0x2b5c08,{'transaction':_0x3c6873});}})['then'](function(){_0x2b5c08[_0x1f51('0x5c')](function(_0x1a6afc){socket[_0x1f51('0x5d')]('userMailQueue:remove',{'UserId':_0x1a6afc,'MailQueueId':_0x1eeb84['id']});});});});});});})[_0x1f51('0x17')](respondWithStatusCode(_0x2c87c9,null))[_0x1f51('0x24')](handleError(_0x2c87c9,null));};exports[_0x1f51('0x72')]=function(_0x47912d,_0x14fad0){return db[_0x1f51('0x1d')][_0x1f51('0x2d')]({'where':{'id':_0x47912d[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](handleEntityNotFound(_0x14fad0,null))[_0x1f51('0x17')](function(_0x375c37){if(_0x375c37){return _0x375c37['addAgents'](_0x47912d[_0x1f51('0x36')][_0x1f51('0x52')],_[_0x1f51('0x73')](_0x47912d[_0x1f51('0x36')],[_0x1f51('0x52'),'id'])||{})[_0x1f51('0x74')](function(_0x1334c4){for(var _0x5af2ef=0x0;_0x5af2ef<_0x47912d[_0x1f51('0x36')][_0x1f51('0x52')][_0x1f51('0x3c')];_0x5af2ef+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x47912d[_0x1f51('0x36')]['ids'][_0x5af2ef]),'MailQueueId':Number(_0x47912d[_0x1f51('0x37')]['id'])});}return _0x1334c4;});}})[_0x1f51('0x17')](respondWithResult(_0x14fad0,null))[_0x1f51('0x24')](handleError(_0x14fad0,null));};exports['removeAgents']=function(_0x4b5eb2,_0x219885){return db['MailQueue'][_0x1f51('0x2d')]({'where':{'id':_0x4b5eb2[_0x1f51('0x37')]['id']}})[_0x1f51('0x17')](handleEntityNotFound(_0x219885,null))['then'](function(_0x234b30){if(_0x234b30){return _0x234b30[_0x1f51('0x71')](_0x4b5eb2['query']['ids'])[_0x1f51('0x17')](function(){if(_[_0x1f51('0x75')](_0x4b5eb2[_0x1f51('0x22')][_0x1f51('0x52')])){for(var _0x218d44=0x0;_0x218d44<_0x4b5eb2[_0x1f51('0x22')][_0x1f51('0x52')][_0x1f51('0x3c')];_0x218d44+=0x1){socket[_0x1f51('0x5d')]('userMailQueue:remove',{'UserId':Number(_0x4b5eb2[_0x1f51('0x22')][_0x1f51('0x52')][_0x218d44]),'MailQueueId':Number(_0x4b5eb2['params']['id'])});}}else{socket[_0x1f51('0x5d')](_0x1f51('0x76'),{'UserId':Number(_0x4b5eb2[_0x1f51('0x22')][_0x1f51('0x52')]),'MailQueueId':Number(_0x4b5eb2[_0x1f51('0x37')]['id'])});}});}})[_0x1f51('0x17')](respondWithStatusCode(_0x219885,null))['catch'](handleError(_0x219885,null));};exports['getAgents']=function(_0x360bc0,_0x314e3e){var _0x33faf5={};var _0x353f25={};var _0x45a1c9;var _0x52e197;return db[_0x1f51('0x1d')][_0x1f51('0x77')]({'where':{'id':_0x360bc0[_0x1f51('0x37')]['id']}})['then'](handleEntityNotFound(_0x314e3e,null))[_0x1f51('0x17')](function(_0x1260a9){if(_0x1260a9){_0x45a1c9=_0x1260a9;_0x353f25[_0x1f51('0x26')]=_[_0x1f51('0x27')](db[_0x1f51('0x53')]['rawAttributes']);_0x353f25[_0x1f51('0x22')]=_[_0x1f51('0x27')](_0x360bc0[_0x1f51('0x22')]);_0x353f25[_0x1f51('0x28')]=_['intersection'](_0x353f25[_0x1f51('0x26')],_0x353f25['query']);_0x33faf5[_0x1f51('0x2b')]=_[_0x1f51('0x29')](_0x353f25[_0x1f51('0x26')],qs[_0x1f51('0x2a')](_0x360bc0[_0x1f51('0x22')][_0x1f51('0x2a')]));_0x33faf5[_0x1f51('0x2b')]=_0x33faf5[_0x1f51('0x2b')][_0x1f51('0x3c')]?_0x33faf5[_0x1f51('0x2b')]:_0x353f25['model'];_0x33faf5[_0x1f51('0x4f')]=qs[_0x1f51('0x50')](_0x360bc0[_0x1f51('0x22')][_0x1f51('0x50')]);_0x33faf5[_0x1f51('0x3f')]=qs['filters'](_[_0x1f51('0x40')](_0x360bc0[_0x1f51('0x22')],_0x353f25[_0x1f51('0x28')]));if(_0x360bc0[_0x1f51('0x22')][_0x1f51('0x42')]){_0x33faf5[_0x1f51('0x3f')]=_['merge'](_0x33faf5[_0x1f51('0x3f')],{'$or':_['map'](_0x33faf5[_0x1f51('0x2b')],function(_0xe7e755){var _0x421b0f={};_0x421b0f[_0xe7e755]={'$like':'%'+_0x360bc0['query'][_0x1f51('0x42')]+'%'};return _0x421b0f;})});}_0x33faf5=_[_0x1f51('0x43')]({},_0x33faf5,_0x360bc0[_0x1f51('0x78')]);return _0x45a1c9[_0x1f51('0x79')](_0x33faf5);}})[_0x1f51('0x17')](function(_0x2cfd52){if(_0x2cfd52){_0x52e197=_0x2cfd52[_0x1f51('0x3c')];if(!_0x360bc0[_0x1f51('0x22')]['hasOwnProperty'](_0x1f51('0x3e'))){_0x33faf5[_0x1f51('0x11')]=qs['limit'](_0x360bc0['query']['limit']);_0x33faf5['offset']=qs[_0x1f51('0xf')](_0x360bc0[_0x1f51('0x22')][_0x1f51('0xf')]);}return _0x45a1c9['getAgents'](_0x33faf5);}})[_0x1f51('0x17')](function(_0xff2306){if(_0xff2306){return _0xff2306?{'count':_0x52e197,'rows':_0xff2306}:null;}})[_0x1f51('0x17')](respondWithResult(_0x314e3e,null))[_0x1f51('0x24')](handleError(_0x314e3e,null));}; \ No newline at end of file +var _0x3bf2=['attributes','fields','length','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','hasOwnProperty','nolimit','sort','pick','MailQueueId','filter','UserMailQueue','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','SIP','getTeams','Team','order','addTeams','ids','User','Agents','online','voicePause','sequelize','transaction','forEach','removeTeams','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','MailQueues','UserProfileResource','then','end','error','stack','name','map','MailQueue','rawAttributes','type','key','where','include','query','rows','catch','params','model','keys','filters','intersection'];(function(_0x2cac89,_0x134362){var _0x375819=function(_0x1be5d5){while(--_0x1be5d5){_0x2cac89['push'](_0x2cac89['shift']());}};_0x375819(++_0x134362);}(_0x3bf2,0x1a6));var _0x23bf=function(_0x1bae3e,_0x12950c){_0x1bae3e=_0x1bae3e-0x0;var _0x170b37=_0x3bf2[_0x1bae3e];return _0x170b37;};'use strict';var BPromise=require(_0x23bf('0x0'));var util=require(_0x23bf('0x1'));var _=require(_0x23bf('0x2'));var squel=require(_0x23bf('0x3'));var Redis=require('ioredis');var qs=require(_0x23bf('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x23bf('0x5'));var db=require(_0x23bf('0x6'))['db'];config[_0x23bf('0x7')]=_[_0x23bf('0x8')](config[_0x23bf('0x7')],{'host':_0x23bf('0x9'),'port':0x18eb});var socket=require(_0x23bf('0xa'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x23bf('0xb')](socket);function respondWithStatusCode(_0x32f64a,_0x5a8a5d){_0x5a8a5d=_0x5a8a5d||0xcc;return function(_0x186404){if(_0x186404){return _0x32f64a[_0x23bf('0xc')](_0x5a8a5d);}return _0x32f64a[_0x23bf('0xd')](_0x5a8a5d)['end']();};}function respondWithResult(_0x3e9a55,_0x421b13){_0x421b13=_0x421b13||0xc8;return function(_0xa87b23){if(_0xa87b23){return _0x3e9a55['status'](_0x421b13)[_0x23bf('0xe')](_0xa87b23);}};}function respondWithFilteredResult(_0xfa1b98,_0x2439da){return function(_0x3d79f4){if(_0x3d79f4){var _0x15d493=typeof _0x2439da[_0x23bf('0xf')]===_0x23bf('0x10')&&typeof _0x2439da['limit']===_0x23bf('0x10');var _0x1a33c5=_0x3d79f4[_0x23bf('0x11')];var _0x468222=_0x15d493?0x0:_0x2439da[_0x23bf('0xf')];var _0x59b9c0=_0x15d493?_0x3d79f4[_0x23bf('0x11')]:_0x2439da[_0x23bf('0xf')]+_0x2439da[_0x23bf('0x12')];var _0x1acc04;if(_0x59b9c0>=_0x1a33c5){_0x59b9c0=_0x1a33c5;_0x1acc04=0xc8;}else{_0x1acc04=0xce;}_0xfa1b98['status'](_0x1acc04);return _0xfa1b98[_0x23bf('0x13')](_0x23bf('0x14'),_0x468222+'-'+_0x59b9c0+'/'+_0x1a33c5)[_0x23bf('0xe')](_0x3d79f4);}return null;};}function saveUpdates(_0x4fab2a){return function(_0x19a683){if(_0x19a683){return _0x19a683[_0x23bf('0x15')](_0x4fab2a)['then'](function(_0x4daa94){return _0x4daa94;});}return null;};}function removeEntity(_0x190da4){return function(_0x547340){if(_0x547340){return _0x547340[_0x23bf('0x16')]()['then'](function(){var _0x3907fc=_0x547340[_0x23bf('0x17')]({'plain':!![]});var _0x24d59b=_0x23bf('0x18');return db[_0x23bf('0x19')]['destroy']({'where':{'type':_0x24d59b,'resourceId':_0x3907fc['id']}})[_0x23bf('0x1a')](function(){return _0x547340;});})['then'](function(){_0x190da4[_0x23bf('0xd')](0xcc)[_0x23bf('0x1b')]();});}};}function handleEntityNotFound(_0xba483f){return function(_0x528979){if(!_0x528979){_0xba483f[_0x23bf('0xc')](0x194);}return _0x528979;};}function handleError(_0x3455ae,_0x25374c){_0x25374c=_0x25374c||0x1f4;return function(_0x4fe2e1){logger[_0x23bf('0x1c')](_0x4fe2e1[_0x23bf('0x1d')]);if(_0x4fe2e1[_0x23bf('0x1e')]){delete _0x4fe2e1[_0x23bf('0x1e')];}_0x3455ae[_0x23bf('0xd')](_0x25374c)['send'](_0x4fe2e1);};}exports['index']=function(_0x4be0f9,_0x1feda9){var _0x3c161a={};var _0x53bf73={'count':0x0,'rows':[]};var _0x5ec7ee=_[_0x23bf('0x1f')](db[_0x23bf('0x20')][_0x23bf('0x21')],function(_0x3cc7bd){return{'name':_0x3cc7bd['fieldName'],'type':_0x3cc7bd[_0x23bf('0x22')][_0x23bf('0x23')]};});_0x3c161a=qs['getOptions'](_0x5ec7ee,_0x4be0f9);var _0x55326d={'where':_0x3c161a[_0x23bf('0x24')]};return db[_0x23bf('0x20')][_0x23bf('0x11')](_0x55326d)[_0x23bf('0x1a')](function(_0x57ecdc){_0x53bf73[_0x23bf('0x11')]=_0x57ecdc;_0x3c161a['include']=qs[_0x23bf('0x25')](_0x4be0f9[_0x23bf('0x26')]);return db['MailQueue']['findAll'](_0x3c161a);})[_0x23bf('0x1a')](function(_0x213027){_0x53bf73[_0x23bf('0x27')]=_0x213027;return _0x53bf73;})['then'](respondWithFilteredResult(_0x1feda9,_0x3c161a))[_0x23bf('0x28')](handleError(_0x1feda9,null));};exports['show']=function(_0x28d5b8,_0x35feb1){var _0xef337c={'raw':!![],'where':{'id':_0x28d5b8[_0x23bf('0x29')]['id']}},_0x14a2d2={};_0x14a2d2[_0x23bf('0x2a')]=_[_0x23bf('0x2b')](db[_0x23bf('0x20')]['rawAttributes']);_0x14a2d2['query']=_[_0x23bf('0x2b')](_0x28d5b8[_0x23bf('0x26')]);_0x14a2d2[_0x23bf('0x2c')]=_[_0x23bf('0x2d')](_0x14a2d2['model'],_0x14a2d2[_0x23bf('0x26')]);_0xef337c[_0x23bf('0x2e')]=_[_0x23bf('0x2d')](_0x14a2d2[_0x23bf('0x2a')],qs[_0x23bf('0x2f')](_0x28d5b8['query'][_0x23bf('0x2f')]));_0xef337c[_0x23bf('0x2e')]=_0xef337c[_0x23bf('0x2e')][_0x23bf('0x30')]?_0xef337c['attributes']:_0x14a2d2['model'];if(_0x28d5b8['query']['includeAll']){_0xef337c[_0x23bf('0x25')]=[{'all':!![]}];}_0xef337c=_[_0x23bf('0x31')]({},_0xef337c,_0x28d5b8[_0x23bf('0x32')]);return db[_0x23bf('0x20')]['find'](_0xef337c)[_0x23bf('0x1a')](handleEntityNotFound(_0x35feb1,null))[_0x23bf('0x1a')](respondWithResult(_0x35feb1,null))['catch'](handleError(_0x35feb1,null));};exports[_0x23bf('0x33')]=function(_0x412e08,_0x3d23f1){return db[_0x23bf('0x20')][_0x23bf('0x33')](_0x412e08['body'],{})[_0x23bf('0x1a')](function(_0x14bcc7){var _0xbdf21e=_0x412e08[_0x23bf('0x34')][_0x23bf('0x17')]({'plain':!![]});if(!_0xbdf21e)throw new Error(_0x23bf('0x35'));if(_0xbdf21e['role']===_0x23bf('0x34')){var _0x3ea5aa=_0x14bcc7[_0x23bf('0x17')]({'plain':!![]});var _0x4ec991=_0x23bf('0x18');return db[_0x23bf('0x36')][_0x23bf('0x37')]({'where':{'name':_0x4ec991,'userProfileId':_0xbdf21e[_0x23bf('0x38')]},'raw':!![]})['then'](function(_0x1291fc){if(_0x1291fc&&_0x1291fc[_0x23bf('0x39')]===0x0){return db['UserProfileResource']['create']({'name':_0x3ea5aa['name'],'resourceId':_0x3ea5aa['id'],'type':_0x1291fc[_0x23bf('0x1e')],'sectionId':_0x1291fc['id']},{})[_0x23bf('0x1a')](function(){return _0x14bcc7;});}else{return _0x14bcc7;}})['catch'](function(_0x519581){logger[_0x23bf('0x1c')](_0x23bf('0x3a'),_0x519581);throw _0x519581;});}return _0x14bcc7;})[_0x23bf('0x1a')](respondWithResult(_0x3d23f1,0xc9))['catch'](handleError(_0x3d23f1,null));};exports[_0x23bf('0x15')]=function(_0x63dbb7,_0x1596c3){if(_0x63dbb7[_0x23bf('0x3b')]['id']){delete _0x63dbb7[_0x23bf('0x3b')]['id'];}return db[_0x23bf('0x20')][_0x23bf('0x37')]({'where':{'id':_0x63dbb7['params']['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x1596c3,null))['then'](saveUpdates(_0x63dbb7[_0x23bf('0x3b')],null))['then'](respondWithResult(_0x1596c3,null))[_0x23bf('0x28')](handleError(_0x1596c3,null));};exports['destroy']=function(_0x2ad3c4,_0x3a08cd){return db[_0x23bf('0x20')][_0x23bf('0x37')]({'where':{'id':_0x2ad3c4['params']['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x3a08cd,null))['then'](removeEntity(_0x3a08cd,null))[_0x23bf('0x28')](handleError(_0x3a08cd,null));};exports['describe']=function(_0x3b70fd,_0x1a4f02){return db['MailQueue'][_0x23bf('0x3c')]()['then'](respondWithResult(_0x1a4f02,null))[_0x23bf('0x28')](handleError(_0x1a4f02,null));};exports[_0x23bf('0x3d')]=function(_0x45862a,_0x29bbfe){var _0x315429={'raw':!![],'where':{}},_0x44e9f2={},_0x17e9b;return db[_0x23bf('0x20')][_0x23bf('0x3e')]({'where':{'id':_0x45862a[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x29bbfe,null))[_0x23bf('0x1a')](function(_0x3b3e8){if(_0x3b3e8){_0x17e9b=_0x3b3e8[_0x23bf('0x17')]({'plain':!![]});_0x44e9f2[_0x23bf('0x2a')]=_[_0x23bf('0x2b')](db['UserMailQueue'][_0x23bf('0x21')]);_0x44e9f2[_0x23bf('0x26')]=_['keys'](_0x45862a[_0x23bf('0x26')]);_0x44e9f2[_0x23bf('0x2c')]=_[_0x23bf('0x2d')](_0x44e9f2[_0x23bf('0x2a')],_0x44e9f2[_0x23bf('0x26')]);_0x315429['attributes']=_[_0x23bf('0x2d')](_0x44e9f2['model'],qs[_0x23bf('0x2f')](_0x45862a['query'][_0x23bf('0x2f')]));_0x315429[_0x23bf('0x2e')]=_0x315429['attributes'][_0x23bf('0x30')]?_0x315429[_0x23bf('0x2e')]:_0x44e9f2[_0x23bf('0x2a')];if(!_0x45862a['query'][_0x23bf('0x3f')](_0x23bf('0x40'))){_0x315429[_0x23bf('0x12')]=qs[_0x23bf('0x12')](_0x45862a[_0x23bf('0x26')]['limit']);_0x315429[_0x23bf('0xf')]=qs[_0x23bf('0xf')](_0x45862a['query'][_0x23bf('0xf')]);}_0x315429['order']=qs[_0x23bf('0x41')](_0x45862a[_0x23bf('0x26')][_0x23bf('0x41')]);_0x315429['where']=qs['filters'](_[_0x23bf('0x42')](_0x45862a['query'],_0x44e9f2[_0x23bf('0x2c')]));_0x315429[_0x23bf('0x24')][_0x23bf('0x43')]=_0x3b3e8['id'];if(_0x45862a[_0x23bf('0x26')][_0x23bf('0x44')]){_0x315429[_0x23bf('0x24')]=_[_0x23bf('0x31')](_0x315429[_0x23bf('0x24')],{'$or':_[_0x23bf('0x1f')](_0x315429[_0x23bf('0x2e')],function(_0x3ccfd0){var _0x31c3ed={};_0x31c3ed[_0x3ccfd0]={'$like':'%'+_0x45862a['query'][_0x23bf('0x44')]+'%'};return _0x31c3ed;})});}_0x315429=_[_0x23bf('0x31')]({},_0x315429,_0x45862a['options']);return db[_0x23bf('0x45')][_0x23bf('0x46')](_0x315429);}})[_0x23bf('0x1a')](function(_0x1935cf){if(_0x1935cf){return db['User'][_0x23bf('0x47')]({'where':{'id':_[_0x23bf('0x1f')](_0x1935cf,_0x23bf('0x48')),'role':_0x23bf('0x49')},'attributes':['id',_0x23bf('0x1e'),_0x23bf('0x4a'),_0x23bf('0x4b'),_0x23bf('0x4c')]});}})[_0x23bf('0x1a')](function(_0x5d65ea){if(_0x5d65ea){return{'count':_0x5d65ea[_0x23bf('0x11')],'rows':_[_0x23bf('0x1f')](_0x5d65ea['rows'],function(_0x4cdcf5){return{'membername':_0x4cdcf5[_0x23bf('0x1e')],'UserId':_0x4cdcf5['id'],'queue_name':_0x17e9b[_0x23bf('0x1e')],'MailQueueId':_0x17e9b['id'],'interface':util['format']('%s/%s',_0x23bf('0x4d'),_0x4cdcf5[_0x23bf('0x1e')]),'penalty':0x0,'paused':_0x4cdcf5[_0x23bf('0x4a')],'createdAt':_0x4cdcf5[_0x23bf('0x4c')],'updatedAt':_0x4cdcf5[_0x23bf('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x23bf('0x1a')](respondWithFilteredResult(_0x29bbfe,_0x315429))[_0x23bf('0x28')](handleError(_0x29bbfe,null));};exports[_0x23bf('0x4e')]=function(_0x5175ad,_0x3c31a4){var _0x1d8869={};var _0x1d4b31={};var _0x1a5053;var _0x468812;return db['MailQueue'][_0x23bf('0x3e')]({'where':{'id':_0x5175ad['params']['id']}})['then'](handleEntityNotFound(_0x3c31a4,null))['then'](function(_0x29b66a){if(_0x29b66a){_0x1a5053=_0x29b66a;_0x1d4b31[_0x23bf('0x2a')]=_['keys'](db[_0x23bf('0x4f')][_0x23bf('0x21')]);_0x1d4b31[_0x23bf('0x26')]=_['keys'](_0x5175ad['query']);_0x1d4b31['filters']=_[_0x23bf('0x2d')](_0x1d4b31[_0x23bf('0x2a')],_0x1d4b31[_0x23bf('0x26')]);_0x1d8869['attributes']=_['intersection'](_0x1d4b31['model'],qs[_0x23bf('0x2f')](_0x5175ad['query'][_0x23bf('0x2f')]));_0x1d8869[_0x23bf('0x2e')]=_0x1d8869['attributes'][_0x23bf('0x30')]?_0x1d8869['attributes']:_0x1d4b31[_0x23bf('0x2a')];_0x1d8869[_0x23bf('0x50')]=qs[_0x23bf('0x41')](_0x5175ad[_0x23bf('0x26')][_0x23bf('0x41')]);_0x1d8869['where']=qs[_0x23bf('0x2c')](_[_0x23bf('0x42')](_0x5175ad[_0x23bf('0x26')],_0x1d4b31['filters']));if(_0x5175ad[_0x23bf('0x26')][_0x23bf('0x44')]){_0x1d8869[_0x23bf('0x24')]=_[_0x23bf('0x31')](_0x1d8869[_0x23bf('0x24')],{'$or':_[_0x23bf('0x1f')](_0x1d8869[_0x23bf('0x2e')],function(_0x5c6496){var _0x559c4e={};_0x559c4e[_0x5c6496]={'$like':'%'+_0x5175ad[_0x23bf('0x26')][_0x23bf('0x44')]+'%'};return _0x559c4e;})});}_0x1d8869=_[_0x23bf('0x31')]({},_0x1d8869,_0x5175ad[_0x23bf('0x32')]);return _0x1a5053[_0x23bf('0x4e')](_0x1d8869);}})[_0x23bf('0x1a')](function(_0x34a0e9){if(_0x34a0e9){_0x468812=_0x34a0e9[_0x23bf('0x30')];if(!_0x5175ad[_0x23bf('0x26')][_0x23bf('0x3f')](_0x23bf('0x40'))){_0x1d8869[_0x23bf('0x12')]=qs['limit'](_0x5175ad[_0x23bf('0x26')][_0x23bf('0x12')]);_0x1d8869[_0x23bf('0xf')]=qs[_0x23bf('0xf')](_0x5175ad[_0x23bf('0x26')]['offset']);}return _0x1a5053[_0x23bf('0x4e')](_0x1d8869);}})[_0x23bf('0x1a')](function(_0x528c42){if(_0x528c42){return _0x528c42?{'count':_0x468812,'rows':_0x528c42}:null;}})['then'](respondWithResult(_0x3c31a4,null))[_0x23bf('0x28')](handleError(_0x3c31a4,null));};exports[_0x23bf('0x51')]=function(_0x1c0fad,_0x22b6ae){var _0x1173ff=_0x1c0fad['body'][_0x23bf('0x52')];return db['Team'][_0x23bf('0x46')]({'where':{'id':_0x1173ff},'attributes':['id'],'include':[{'model':db[_0x23bf('0x53')],'as':_0x23bf('0x54'),'attributes':['id',_0x23bf('0x1e'),_0x23bf('0x55'),_0x23bf('0x56'),'interface'],'raw':!![]}]})[_0x23bf('0x1a')](function(_0x131468){if(_0x131468){var _0x732992=_['flatMap'](_0x131468,function(_0x4ffdaa){var _0x3153d6=_0x4ffdaa[_0x23bf('0x17')]({'plain':!![]});return _0x3153d6[_0x23bf('0x54')];});return db[_0x23bf('0x20')][_0x23bf('0x37')]({'where':{'id':_0x1c0fad[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](function(_0x506ab0){return db[_0x23bf('0x57')][_0x23bf('0x58')](function(_0xaf8ba0){return _0x506ab0[_0x23bf('0x51')](_0x1173ff,{'transaction':_0xaf8ba0})[_0x23bf('0x1a')](function(){return BPromise['each'](_0x732992,function(_0x3368e3){return db[_0x23bf('0x45')]['findOrCreate']({'where':{'UserId':_0x3368e3['id'],'MailQueueId':_0x1c0fad[_0x23bf('0x29')]['id']},'transaction':_0xaf8ba0});});})[_0x23bf('0x1a')](function(){_0x732992[_0x23bf('0x59')](function(_0x5f1510){socket['emit']('userMailQueue:save',{'UserId':_0x5f1510['id'],'MailQueueId':_0x506ab0['id']});});});});});}})[_0x23bf('0x1a')](respondWithStatusCode(_0x22b6ae,null))['catch'](handleError(_0x22b6ae,null));};exports[_0x23bf('0x5a')]=function(_0x35ef83,_0x3947f8){return db['Team'][_0x23bf('0x46')]({'where':{'id':_0x35ef83[_0x23bf('0x26')][_0x23bf('0x52')]},'attributes':['id'],'include':[{'model':db[_0x23bf('0x53')],'as':_0x23bf('0x54'),'attributes':['id'],'raw':!![]}]})[_0x23bf('0x1a')](handleEntityNotFound(_0x3947f8,null))[_0x23bf('0x1a')](function(_0x1d6233){var _0x545450=_['map'](_0x1d6233,'id');var _0x3287dc=[];var _0x3d187f=[];var _0x20c581=squel['select']();_0x20c581[_0x23bf('0x5b')]('tq.TeamId')[_0x23bf('0x5c')]('team_has_mail_queues','tq')[_0x23bf('0x5d')](_0x23bf('0x5e'),'ut',_0x23bf('0x5f'))[_0x23bf('0x24')](_0x23bf('0x60'),_0x35ef83['params']['id']);for(var _0x1cea28=0x0;_0x1cea28<_0x1d6233[_0x23bf('0x30')];_0x1cea28+=0x1){let _0x11a6c4=_0x1d6233[_0x1cea28];for(var _0x1408d8=0x0;_0x1408d8<_0x11a6c4[_0x23bf('0x54')][_0x23bf('0x30')];_0x1408d8+=0x1){let _0x13812a=_0x11a6c4[_0x23bf('0x54')][_0x1408d8];var _0x49b0aa=_0x20c581[_0x23bf('0x61')]();_0x49b0aa[_0x23bf('0x24')](_0x23bf('0x62'),_0x13812a['id']);_0x3d187f[_0x23bf('0x63')](db[_0x23bf('0x57')][_0x23bf('0x26')](_0x49b0aa[_0x23bf('0x64')](),{'type':db[_0x23bf('0x57')][_0x23bf('0x65')][_0x23bf('0x66')]})[_0x23bf('0x1a')](function(_0x5e39d0){if(_0x5e39d0['length']===0x1){return _0x13812a['id'];}else{var _0x8416d4=_['every'](_[_0x23bf('0x1f')](_0x5e39d0,_0x23bf('0x67')),function(_0x388d8d){return _[_0x23bf('0x68')](_0x545450,_0x388d8d);});if(_0x8416d4){return _0x13812a['id'];}}}));}}return BPromise[_0x23bf('0x69')](_0x3d187f)[_0x23bf('0x1a')](function(_0x21af31){_0x3287dc=_(_0x3287dc)['union'](_0x21af31)[_0x23bf('0x6a')]()['value']();return db[_0x23bf('0x20')]['find']({'where':{'id':_0x35ef83[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](function(_0x2eca03){return db[_0x23bf('0x57')][_0x23bf('0x58')](function(_0x2883ce){return _0x2eca03[_0x23bf('0x5a')](_0x35ef83[_0x23bf('0x26')][_0x23bf('0x52')],{'transaction':_0x2883ce})['then'](function(){if(!_[_0x23bf('0x6b')](_0x3287dc)){return _0x2eca03[_0x23bf('0x6c')](_0x3287dc,{'transaction':_0x2883ce});}})[_0x23bf('0x1a')](function(){_0x3287dc[_0x23bf('0x59')](function(_0xeb8fc8){socket[_0x23bf('0x6d')](_0x23bf('0x6e'),{'UserId':_0xeb8fc8,'MailQueueId':_0x2eca03['id']});});});});});});})[_0x23bf('0x1a')](respondWithStatusCode(_0x3947f8,null))['catch'](handleError(_0x3947f8,null));};exports['addAgents']=function(_0x207bf9,_0x743ff5){return db[_0x23bf('0x20')][_0x23bf('0x37')]({'where':{'id':_0x207bf9[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x743ff5,null))[_0x23bf('0x1a')](function(_0x519948){if(_0x519948){return _0x519948[_0x23bf('0x6f')](_0x207bf9[_0x23bf('0x3b')][_0x23bf('0x52')],_[_0x23bf('0x70')](_0x207bf9['body'],[_0x23bf('0x52'),'id'])||{})[_0x23bf('0x71')](function(_0x5b6e45){for(var _0x4ac5c3=0x0;_0x4ac5c3<_0x207bf9[_0x23bf('0x3b')][_0x23bf('0x52')][_0x23bf('0x30')];_0x4ac5c3+=0x1){socket[_0x23bf('0x6d')](_0x23bf('0x72'),{'UserId':Number(_0x207bf9[_0x23bf('0x3b')][_0x23bf('0x52')][_0x4ac5c3]),'MailQueueId':Number(_0x207bf9[_0x23bf('0x29')]['id'])});}return _0x5b6e45;});}})[_0x23bf('0x1a')](respondWithResult(_0x743ff5,null))[_0x23bf('0x28')](handleError(_0x743ff5,null));};exports[_0x23bf('0x6c')]=function(_0x30aafb,_0x473b08){return db[_0x23bf('0x20')]['find']({'where':{'id':_0x30aafb[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x473b08,null))[_0x23bf('0x1a')](function(_0x70671e){if(_0x70671e){return _0x70671e['removeAgents'](_0x30aafb[_0x23bf('0x26')]['ids'])['then'](function(){if(_[_0x23bf('0x73')](_0x30aafb[_0x23bf('0x26')]['ids'])){for(var _0x2db36b=0x0;_0x2db36b<_0x30aafb[_0x23bf('0x26')][_0x23bf('0x52')][_0x23bf('0x30')];_0x2db36b+=0x1){socket[_0x23bf('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x30aafb[_0x23bf('0x26')][_0x23bf('0x52')][_0x2db36b]),'MailQueueId':Number(_0x30aafb[_0x23bf('0x29')]['id'])});}}else{socket[_0x23bf('0x6d')](_0x23bf('0x6e'),{'UserId':Number(_0x30aafb[_0x23bf('0x26')]['ids']),'MailQueueId':Number(_0x30aafb[_0x23bf('0x29')]['id'])});}});}})[_0x23bf('0x1a')](respondWithStatusCode(_0x473b08,null))[_0x23bf('0x28')](handleError(_0x473b08,null));};exports[_0x23bf('0x74')]=function(_0x4aad8f,_0x2275c5){var _0x34d799={};var _0x5e899a={};var _0x5641f6;var _0x4d4654;return db[_0x23bf('0x20')]['findOne']({'where':{'id':_0x4aad8f[_0x23bf('0x29')]['id']}})[_0x23bf('0x1a')](handleEntityNotFound(_0x2275c5,null))[_0x23bf('0x1a')](function(_0xf6f227){if(_0xf6f227){_0x5641f6=_0xf6f227;_0x5e899a[_0x23bf('0x2a')]=_['keys'](db[_0x23bf('0x53')][_0x23bf('0x21')]);_0x5e899a[_0x23bf('0x26')]=_[_0x23bf('0x2b')](_0x4aad8f['query']);_0x5e899a[_0x23bf('0x2c')]=_['intersection'](_0x5e899a[_0x23bf('0x2a')],_0x5e899a[_0x23bf('0x26')]);_0x34d799[_0x23bf('0x2e')]=_['intersection'](_0x5e899a[_0x23bf('0x2a')],qs[_0x23bf('0x2f')](_0x4aad8f[_0x23bf('0x26')][_0x23bf('0x2f')]));_0x34d799[_0x23bf('0x2e')]=_0x34d799['attributes'][_0x23bf('0x30')]?_0x34d799['attributes']:_0x5e899a[_0x23bf('0x2a')];_0x34d799[_0x23bf('0x50')]=qs[_0x23bf('0x41')](_0x4aad8f[_0x23bf('0x26')][_0x23bf('0x41')]);_0x34d799['where']=qs[_0x23bf('0x2c')](_['pick'](_0x4aad8f[_0x23bf('0x26')],_0x5e899a[_0x23bf('0x2c')]));if(_0x4aad8f['query']['filter']){_0x34d799[_0x23bf('0x24')]=_['merge'](_0x34d799[_0x23bf('0x24')],{'$or':_['map'](_0x34d799[_0x23bf('0x2e')],function(_0x3a4609){var _0x4c6616={};_0x4c6616[_0x3a4609]={'$like':'%'+_0x4aad8f['query']['filter']+'%'};return _0x4c6616;})});}_0x34d799=_[_0x23bf('0x31')]({},_0x34d799,_0x4aad8f[_0x23bf('0x32')]);return _0x5641f6[_0x23bf('0x74')](_0x34d799);}})[_0x23bf('0x1a')](function(_0x13618f){if(_0x13618f){_0x4d4654=_0x13618f[_0x23bf('0x30')];if(!_0x4aad8f['query']['hasOwnProperty']('nolimit')){_0x34d799[_0x23bf('0x12')]=qs[_0x23bf('0x12')](_0x4aad8f['query'][_0x23bf('0x12')]);_0x34d799[_0x23bf('0xf')]=qs[_0x23bf('0xf')](_0x4aad8f[_0x23bf('0x26')]['offset']);}return _0x5641f6[_0x23bf('0x74')](_0x34d799);}})[_0x23bf('0x1a')](function(_0x556aaf){if(_0x556aaf){return _0x556aaf?{'count':_0x4d4654,'rows':_0x556aaf}:null;}})[_0x23bf('0x1a')](respondWithResult(_0x2275c5,null))[_0x23bf('0x28')](handleError(_0x2275c5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2b18df0..2f90e77 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 _0x063c=['hasOwnProperty','hook','exports','MailQueue','setMaxListeners','save','remove','emit'];(function(_0x1bb725,_0x3d09a1){var _0x4681da=function(_0x2a39ee){while(--_0x2a39ee){_0x1bb725['push'](_0x1bb725['shift']());}};_0x4681da(++_0x3d09a1);}(_0x063c,0x16b));var _0xc063=function(_0x224723,_0xc7e9ef){_0x224723=_0x224723-0x0;var _0xdb67a0=_0x063c[_0x224723];return _0xdb67a0;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xc063('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc063('0x1')](0x0);var events={'afterCreate':_0xc063('0x2'),'afterUpdate':'update','afterDestroy':_0xc063('0x3')};function emitEvent(_0x5ec057){return function(_0x3ea514,_0x2a64fa,_0x522b55){MailQueueEvents[_0xc063('0x4')](_0x5ec057+':'+_0x3ea514['id'],_0x3ea514);MailQueueEvents[_0xc063('0x4')](_0x5ec057,_0x3ea514);_0x522b55(null);};}for(var e in events){if(events[_0xc063('0x5')](e)){var event=events[e];MailQueue[_0xc063('0x6')](e,emitEvent(event));}}module[_0xc063('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x1e00=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4a669e,_0xb69e75){var _0x4d5df8=function(_0x3f3d0a){while(--_0x3f3d0a){_0x4a669e['push'](_0x4a669e['shift']());}};_0x4d5df8(++_0xb69e75);}(_0x1e00,0x104));var _0x01e0=function(_0x5c69ad,_0x40449a){_0x5c69ad=_0x5c69ad-0x0;var _0x310705=_0x1e00[_0x5c69ad];return _0x310705;};'use strict';var EventEmitter=require(_0x01e0('0x0'));var MailQueue=require(_0x01e0('0x1'))['db'][_0x01e0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x01e0('0x3')](0x0);var events={'afterCreate':_0x01e0('0x4'),'afterUpdate':_0x01e0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x475be3){return function(_0x4a2236,_0x3a633,_0x14ef88){MailQueueEvents[_0x01e0('0x6')](_0x475be3+':'+_0x4a2236['id'],_0x4a2236);MailQueueEvents[_0x01e0('0x6')](_0x475be3,_0x4a2236);_0x14ef88(null);};}for(var e in events){if(events[_0x01e0('0x7')](e)){var event=events[e];MailQueue[_0x01e0('0x8')](e,emitEvent(event));}}module[_0x01e0('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 1c7cd8b..50ab9ca 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 _0xf511=['rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x135cf6,_0x15285a){var _0x52bf11=function(_0x1038b1){while(--_0x1038b1){_0x135cf6['push'](_0x135cf6['shift']());}};_0x52bf11(++_0x15285a);}(_0xf511,0x96));var _0x1f51=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0xf511[_0x4b9dc9];return _0x57b302;};'use strict';var _=require(_0x1f51('0x0'));var util=require(_0x1f51('0x1'));var logger=require('../../config/logger')(_0x1f51('0x2'));var moment=require('moment');var BPromise=require(_0x1f51('0x3'));var rp=require(_0x1f51('0x4'));var fs=require('fs');var path=require(_0x1f51('0x5'));var rimraf=require(_0x1f51('0x6'));var config=require(_0x1f51('0x7'));var attributes=require(_0x1f51('0x8'));module['exports']=function(_0x212a0e,_0x34500a){return _0x212a0e[_0x1f51('0x9')](_0x1f51('0xa'),attributes,{'tableName':_0x1f51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd51=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','util'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0xdd51,0xc1));var _0x1dd5=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xdd51[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x1dd5('0x0'));var util=require(_0x1dd5('0x1'));var logger=require(_0x1dd5('0x2'))(_0x1dd5('0x3'));var moment=require(_0x1dd5('0x4'));var BPromise=require(_0x1dd5('0x5'));var rp=require(_0x1dd5('0x6'));var fs=require('fs');var path=require(_0x1dd5('0x7'));var rimraf=require(_0x1dd5('0x8'));var config=require(_0x1dd5('0x9'));var attributes=require(_0x1dd5('0xa'));module[_0x1dd5('0xb')]=function(_0x1913a9,_0x32231a){return _0x1913a9['define'](_0x1dd5('0xc'),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 a649ca7..7274908 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 _0x402b=['model','ShowMailQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x505ec0,_0x507b00){var _0x3a16fe=function(_0x5f4388){while(--_0x5f4388){_0x505ec0['push'](_0x505ec0['shift']());}};_0x3a16fe(++_0x507b00);}(_0x402b,0x1bb));var _0xb402=function(_0x46fe37,_0x358689){_0x46fe37=_0x46fe37-0x0;var _0x32c906=_0x402b[_0x46fe37];return _0x32c906;};'use strict';var _=require(_0xb402('0x0'));var util=require('util');var moment=require(_0xb402('0x1'));var BPromise=require(_0xb402('0x2'));var rs=require(_0xb402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb402('0x4'))['db'];var utils=require(_0xb402('0x5'));var logger=require('../../config/logger')(_0xb402('0x6'));var config=require(_0xb402('0x7'));var jayson=require(_0xb402('0x8'));var client=jayson[_0xb402('0x9')][_0xb402('0xa')]({'port':0x232a});config[_0xb402('0xb')]=_[_0xb402('0xc')](config[_0xb402('0xb')],{'host':_0xb402('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb402('0xb')]));require(_0xb402('0xe'))[_0xb402('0xf')](socket);function respondWithRpcPromise(_0x148dcf,_0x3c0618,_0x1a1bfb){return new BPromise(function(_0xe2472d,_0x3e8b58){return client[_0xb402('0x10')](_0x148dcf,_0x1a1bfb)[_0xb402('0x11')](function(_0x1a7cdc){logger[_0xb402('0x12')](_0xb402('0x13'),_0x3c0618,_0xb402('0x14'));logger[_0xb402('0x15')](_0xb402('0x16'),_0x3c0618,_0xb402('0x14'),JSON[_0xb402('0x17')](_0x1a7cdc));if(_0x1a7cdc[_0xb402('0x18')]){if(_0x1a7cdc[_0xb402('0x18')]['code']===0x1f4){logger[_0xb402('0x18')]('MailQueue,\x20%s,\x20%s',_0x3c0618,_0x1a7cdc[_0xb402('0x18')]['message']);return _0x3e8b58(_0x1a7cdc[_0xb402('0x18')][_0xb402('0x19')]);}logger[_0xb402('0x18')](_0xb402('0x13'),_0x3c0618,_0x1a7cdc[_0xb402('0x18')][_0xb402('0x19')]);return _0xe2472d(_0x1a7cdc[_0xb402('0x18')][_0xb402('0x19')]);}else{logger[_0xb402('0x12')](_0xb402('0x13'),_0x3c0618,_0xb402('0x14'));_0xe2472d(_0x1a7cdc[_0xb402('0x1a')][_0xb402('0x19')]);}})[_0xb402('0x1b')](function(_0x1e43cb){logger[_0xb402('0x18')]('MailQueue,\x20%s,\x20%s',_0x3c0618,_0x1e43cb);_0x3e8b58(_0x1e43cb);});});}exports[_0xb402('0x1c')]=function(_0x3b08f8){var _0x5d957e=this;return new Promise(function(_0x92d9e9,_0x2d5455){return db['MailQueue'][_0xb402('0x1d')]({'raw':_0x3b08f8['options']?_0x3b08f8['options'][_0xb402('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b08f8[_0xb402('0x1f')]?_0x3b08f8['options'][_0xb402('0x20')]||null:null,'attributes':_0x3b08f8[_0xb402('0x1f')]?_0x3b08f8['options'][_0xb402('0x21')]||null:null,'limit':_0x3b08f8[_0xb402('0x1f')]?_0x3b08f8['options'][_0xb402('0x22')]||null:null,'include':_0x3b08f8['options']?_0x3b08f8[_0xb402('0x1f')][_0xb402('0x23')]?_[_0xb402('0x24')](_0x3b08f8[_0xb402('0x1f')][_0xb402('0x23')],function(_0x2d5db9){return{'model':db[_0x2d5db9['model']],'as':_0x2d5db9['as'],'attributes':_0x2d5db9[_0xb402('0x21')],'include':_0x2d5db9[_0xb402('0x23')]?_[_0xb402('0x24')](_0x2d5db9[_0xb402('0x23')],function(_0x371bd2){return{'model':db[_0x371bd2[_0xb402('0x25')]],'as':_0x371bd2['as'],'attributes':_0x371bd2[_0xb402('0x21')],'include':_0x371bd2[_0xb402('0x23')]?_[_0xb402('0x24')](_0x371bd2['include'],function(_0x1aa202){return{'model':db[_0x1aa202['model']],'as':_0x1aa202['as'],'attributes':_0x1aa202[_0xb402('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb402('0x11')](function(_0x1d7fe5){logger['info'](_0xb402('0x1c'),_0x3b08f8);logger[_0xb402('0x15')](_0xb402('0x1c'),_0x3b08f8,JSON[_0xb402('0x17')](_0x1d7fe5));_0x92d9e9(_0x1d7fe5);})[_0xb402('0x1b')](function(_0x41eff4){logger[_0xb402('0x18')](_0xb402('0x1c'),_0x41eff4[_0xb402('0x19')],_0x3b08f8);_0x2d5455(_0x5d957e[_0xb402('0x18')](0x1f4,_0x41eff4[_0xb402('0x19')]));});});};exports[_0xb402('0x26')]=function(_0x3db058){var _0x53dfb4=this;return new Promise(function(_0x29c95b,_0x1639bf){return db['MailQueue'][_0xb402('0x27')]({'raw':_0x3db058[_0xb402('0x1f')]?_0x3db058[_0xb402('0x1f')][_0xb402('0x1e')]===undefined?!![]:![]:!![],'where':_0x3db058[_0xb402('0x1f')]?_0x3db058['options']['where']||null:null,'attributes':_0x3db058['options']?_0x3db058[_0xb402('0x1f')][_0xb402('0x21')]||null:null,'include':_0x3db058[_0xb402('0x1f')]?_0x3db058['options']['include']?_[_0xb402('0x24')](_0x3db058['options'][_0xb402('0x23')],function(_0x494eb7){return{'model':db[_0x494eb7[_0xb402('0x25')]],'as':_0x494eb7['as'],'attributes':_0x494eb7[_0xb402('0x21')],'include':_0x494eb7['include']?_[_0xb402('0x24')](_0x494eb7[_0xb402('0x23')],function(_0x24b7b8){return{'model':db[_0x24b7b8[_0xb402('0x25')]],'as':_0x24b7b8['as'],'attributes':_0x24b7b8[_0xb402('0x21')],'include':_0x24b7b8[_0xb402('0x23')]?_[_0xb402('0x24')](_0x24b7b8[_0xb402('0x23')],function(_0x39d3db){return{'model':db[_0x39d3db[_0xb402('0x25')]],'as':_0x39d3db['as'],'attributes':_0x39d3db['attributes']};}):[]};}):[]};}):[]:[]})[_0xb402('0x11')](function(_0x131b0a){logger[_0xb402('0x12')](_0xb402('0x26'),_0x3db058);logger[_0xb402('0x15')]('ShowMailQueue',_0x3db058,JSON[_0xb402('0x17')](_0x131b0a));_0x29c95b(_0x131b0a);})[_0xb402('0x1b')](function(_0x4139ec){logger[_0xb402('0x18')](_0xb402('0x26'),_0x4139ec[_0xb402('0x19')],_0x3db058);_0x1639bf(_0x53dfb4[_0xb402('0x18')](0x1f4,_0x4139ec['message']));});});}; \ No newline at end of file +var _0x0d16=['model','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x535ae1,_0x31fd5e){var _0x2460ae=function(_0x2156f6){while(--_0x2156f6){_0x535ae1['push'](_0x535ae1['shift']());}};_0x2460ae(++_0x31fd5e);}(_0x0d16,0xbb));var _0x60d1=function(_0x4fdf1b,_0x5f3f9b){_0x4fdf1b=_0x4fdf1b-0x0;var _0x2b5592=_0x0d16[_0x4fdf1b];return _0x2b5592;};'use strict';var _=require(_0x60d1('0x0'));var util=require(_0x60d1('0x1'));var moment=require(_0x60d1('0x2'));var BPromise=require(_0x60d1('0x3'));var rs=require(_0x60d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x60d1('0x5'));var logger=require('../../config/logger')(_0x60d1('0x6'));var config=require(_0x60d1('0x7'));var jayson=require(_0x60d1('0x8'));var client=jayson[_0x60d1('0x9')][_0x60d1('0xa')]({'port':0x232a});config[_0x60d1('0xb')]=_['defaults'](config[_0x60d1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x60d1('0xc'))(new Redis(config[_0x60d1('0xb')]));require(_0x60d1('0xd'))['register'](socket);function respondWithRpcPromise(_0xc7eef6,_0xd03da4,_0x598531){return new BPromise(function(_0x256910,_0x4460f3){return client[_0x60d1('0xe')](_0xc7eef6,_0x598531)['then'](function(_0x520447){logger[_0x60d1('0xf')](_0x60d1('0x10'),_0xd03da4,'request\x20sent');logger[_0x60d1('0x11')](_0x60d1('0x12'),_0xd03da4,'request\x20sent',JSON[_0x60d1('0x13')](_0x520447));if(_0x520447['error']){if(_0x520447['error'][_0x60d1('0x14')]===0x1f4){logger[_0x60d1('0x15')](_0x60d1('0x10'),_0xd03da4,_0x520447[_0x60d1('0x15')][_0x60d1('0x16')]);return _0x4460f3(_0x520447['error'][_0x60d1('0x16')]);}logger[_0x60d1('0x15')](_0x60d1('0x10'),_0xd03da4,_0x520447[_0x60d1('0x15')][_0x60d1('0x16')]);return _0x256910(_0x520447[_0x60d1('0x15')][_0x60d1('0x16')]);}else{logger['info'](_0x60d1('0x10'),_0xd03da4,_0x60d1('0x17'));_0x256910(_0x520447['result']['message']);}})[_0x60d1('0x18')](function(_0x38a1e6){logger[_0x60d1('0x15')](_0x60d1('0x10'),_0xd03da4,_0x38a1e6);_0x4460f3(_0x38a1e6);});});}exports[_0x60d1('0x19')]=function(_0x54c850){var _0x25fbaf=this;return new Promise(function(_0x314554,_0x6c47fd){return db[_0x60d1('0x1a')][_0x60d1('0x1b')]({'raw':_0x54c850[_0x60d1('0x1c')]?_0x54c850[_0x60d1('0x1c')][_0x60d1('0x1d')]===undefined?!![]:![]:!![],'where':_0x54c850['options']?_0x54c850[_0x60d1('0x1c')][_0x60d1('0x1e')]||null:null,'attributes':_0x54c850[_0x60d1('0x1c')]?_0x54c850['options'][_0x60d1('0x1f')]||null:null,'limit':_0x54c850['options']?_0x54c850['options'][_0x60d1('0x20')]||null:null,'include':_0x54c850[_0x60d1('0x1c')]?_0x54c850[_0x60d1('0x1c')][_0x60d1('0x21')]?_[_0x60d1('0x22')](_0x54c850[_0x60d1('0x1c')][_0x60d1('0x21')],function(_0xb6817f){return{'model':db[_0xb6817f[_0x60d1('0x23')]],'as':_0xb6817f['as'],'attributes':_0xb6817f[_0x60d1('0x1f')],'include':_0xb6817f[_0x60d1('0x21')]?_[_0x60d1('0x22')](_0xb6817f['include'],function(_0x2ae05f){return{'model':db[_0x2ae05f['model']],'as':_0x2ae05f['as'],'attributes':_0x2ae05f[_0x60d1('0x1f')],'include':_0x2ae05f[_0x60d1('0x21')]?_[_0x60d1('0x22')](_0x2ae05f[_0x60d1('0x21')],function(_0x3c4d3b){return{'model':db[_0x3c4d3b['model']],'as':_0x3c4d3b['as'],'attributes':_0x3c4d3b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21b1e3){logger[_0x60d1('0xf')](_0x60d1('0x19'),_0x54c850);logger[_0x60d1('0x11')](_0x60d1('0x19'),_0x54c850,JSON[_0x60d1('0x13')](_0x21b1e3));_0x314554(_0x21b1e3);})[_0x60d1('0x18')](function(_0xaf643c){logger[_0x60d1('0x15')](_0x60d1('0x19'),_0xaf643c[_0x60d1('0x16')],_0x54c850);_0x6c47fd(_0x25fbaf[_0x60d1('0x15')](0x1f4,_0xaf643c[_0x60d1('0x16')]));});});};exports[_0x60d1('0x24')]=function(_0x514892){var _0x18ddb8=this;return new Promise(function(_0x279834,_0x27a398){return db[_0x60d1('0x1a')]['find']({'raw':_0x514892['options']?_0x514892[_0x60d1('0x1c')][_0x60d1('0x1d')]===undefined?!![]:![]:!![],'where':_0x514892[_0x60d1('0x1c')]?_0x514892['options']['where']||null:null,'attributes':_0x514892[_0x60d1('0x1c')]?_0x514892[_0x60d1('0x1c')][_0x60d1('0x1f')]||null:null,'include':_0x514892['options']?_0x514892[_0x60d1('0x1c')][_0x60d1('0x21')]?_[_0x60d1('0x22')](_0x514892['options'][_0x60d1('0x21')],function(_0x10bf54){return{'model':db[_0x10bf54[_0x60d1('0x23')]],'as':_0x10bf54['as'],'attributes':_0x10bf54[_0x60d1('0x1f')],'include':_0x10bf54['include']?_[_0x60d1('0x22')](_0x10bf54[_0x60d1('0x21')],function(_0x3e31e2){return{'model':db[_0x3e31e2[_0x60d1('0x23')]],'as':_0x3e31e2['as'],'attributes':_0x3e31e2[_0x60d1('0x1f')],'include':_0x3e31e2[_0x60d1('0x21')]?_[_0x60d1('0x22')](_0x3e31e2[_0x60d1('0x21')],function(_0x38d713){return{'model':db[_0x38d713[_0x60d1('0x23')]],'as':_0x38d713['as'],'attributes':_0x38d713['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x238623){logger[_0x60d1('0xf')](_0x60d1('0x24'),_0x514892);logger['debug'](_0x60d1('0x24'),_0x514892,JSON[_0x60d1('0x13')](_0x238623));_0x279834(_0x238623);})[_0x60d1('0x18')](function(_0x33e455){logger[_0x60d1('0x15')]('ShowMailQueue',_0x33e455[_0x60d1('0x16')],_0x514892);_0x27a398(_0x18ddb8['error'](0x1f4,_0x33e455[_0x60d1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9566f9a..9f33ca9 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 _0xd2a8=['length','save','remove','register'];(function(_0x26a584,_0x18dd21){var _0x12074c=function(_0x17b8d0){while(--_0x17b8d0){_0x26a584['push'](_0x26a584['shift']());}};_0x12074c(++_0x18dd21);}(_0xd2a8,0xc9));var _0x8d2a=function(_0x4812a7,_0x1aa8c8){_0x4812a7=_0x4812a7-0x0;var _0x45224f=_0xd2a8[_0x4812a7];return _0x45224f;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x8d2a('0x0'),_0x8d2a('0x1'),'update'];function createListener(_0xb5a34b,_0x186fd5){return function(_0x537f57){_0x186fd5['emit'](_0xb5a34b,_0x537f57);};}function removeListener(_0x4ed965,_0x219629){return function(){MailQueueEvents['removeListener'](_0x4ed965,_0x219629);};}exports[_0x8d2a('0x2')]=function(_0x49bc8b){for(var _0x56c3a0=0x0,_0x4d5cee=events[_0x8d2a('0x3')];_0x56c3a0<_0x4d5cee;_0x56c3a0++){var _0x5900d5=events[_0x56c3a0];var _0x29d943=createListener('mailQueue:'+_0x5900d5,_0x49bc8b);MailQueueEvents['on'](_0x5900d5,_0x29d943);}}; \ No newline at end of file +var _0x301b=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x4d23c9,_0x4f4886){var _0x15f28c=function(_0x150107){while(--_0x150107){_0x4d23c9['push'](_0x4d23c9['shift']());}};_0x15f28c(++_0x4f4886);}(_0x301b,0x111));var _0xb301=function(_0x2a4ef7,_0x407d00){_0x2a4ef7=_0x2a4ef7-0x0;var _0x4ac204=_0x301b[_0x2a4ef7];return _0x4ac204;};'use strict';var MailQueueEvents=require(_0xb301('0x0'));var events=[_0xb301('0x1'),_0xb301('0x2'),_0xb301('0x3')];function createListener(_0x3aca16,_0x1cdfb9){return function(_0x459b71){_0x1cdfb9[_0xb301('0x4')](_0x3aca16,_0x459b71);};}function removeListener(_0x4fdab0,_0x44353f){return function(){MailQueueEvents[_0xb301('0x5')](_0x4fdab0,_0x44353f);};}exports[_0xb301('0x6')]=function(_0x12d167){for(var _0x5d9b0d=0x0,_0x535fcf=events['length'];_0x5d9b0d<_0x535fcf;_0x5d9b0d++){var _0x3612c9=events[_0x5d9b0d];var _0x1017f2=createListener(_0xb301('0x7')+_0x3612c9,_0x12d167);MailQueueEvents['on'](_0x3612c9,_0x1017f2);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f67ae55..3764499 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 _0xc5f4=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get'];(function(_0x446737,_0x411246){var _0x575b95=function(_0x388fc6){while(--_0x388fc6){_0x446737['push'](_0x446737['shift']());}};_0x575b95(++_0x411246);}(_0xc5f4,0x172));var _0x4c5f=function(_0x1afb1b,_0x15a705){_0x1afb1b=_0x1afb1b-0x0;var _0x47061f=_0xc5f4[_0x1afb1b];return _0x47061f;};'use strict';var multer=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var path=require(_0x4c5f('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c5f('0x3'));var router=express[_0x4c5f('0x4')]();var fs_extra=require(_0x4c5f('0x5'));var auth=require(_0x4c5f('0x6'));var interaction=require(_0x4c5f('0x7'));var config=require('../../config/environment');var controller=require(_0x4c5f('0x8'));router[_0x4c5f('0x9')]('/',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0xb')]);router[_0x4c5f('0x9')]('/describe',auth[_0x4c5f('0xa')](),controller['describe']);router[_0x4c5f('0x9')]('/:id',auth[_0x4c5f('0xa')](),controller['show']);router[_0x4c5f('0xc')]('/',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0xd')]);router[_0x4c5f('0xe')](_0x4c5f('0xf'),auth['isAuthenticated'](),controller[_0x4c5f('0x10')]);router[_0x4c5f('0x11')](_0x4c5f('0xf'),auth[_0x4c5f('0xa')](),controller[_0x4c5f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xde11=['get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xde11,0x184));var _0x1de1=function(_0x365dbe,_0x4d3979){_0x365dbe=_0x365dbe-0x0;var _0xaa71bb=_0xde11[_0x365dbe];return _0xaa71bb;};'use strict';var multer=require(_0x1de1('0x0'));var util=require(_0x1de1('0x1'));var path=require(_0x1de1('0x2'));var timeout=require(_0x1de1('0x3'));var express=require(_0x1de1('0x4'));var router=express[_0x1de1('0x5')]();var fs_extra=require(_0x1de1('0x6'));var auth=require(_0x1de1('0x7'));var interaction=require(_0x1de1('0x8'));var config=require(_0x1de1('0x9'));var controller=require(_0x1de1('0xa'));router[_0x1de1('0xb')]('/',auth[_0x1de1('0xc')](),controller[_0x1de1('0xd')]);router[_0x1de1('0xb')](_0x1de1('0xe'),auth[_0x1de1('0xc')](),controller[_0x1de1('0xf')]);router[_0x1de1('0xb')](_0x1de1('0x10'),auth[_0x1de1('0xc')](),controller[_0x1de1('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1de1('0x12')]);router['put']('/:id',auth[_0x1de1('0xc')](),controller[_0x1de1('0x13')]);router['delete'](_0x1de1('0x10'),auth[_0x1de1('0xc')](),controller[_0x1de1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index c355431..d0b1ba9 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 _0x9815=['sequelize','exports','STRING','DATE','moment'];(function(_0x73feaa,_0x3b0e6a){var _0x180fa7=function(_0x259bcd){while(--_0x259bcd){_0x73feaa['push'](_0x73feaa['shift']());}};_0x180fa7(++_0x3b0e6a);}(_0x9815,0x1d0));var _0x5981=function(_0x5d28ed,_0x1d314e){_0x5d28ed=_0x5d28ed-0x0;var _0x52fd06=_0x9815[_0x5d28ed];return _0x52fd06;};'use strict';var moment=require(_0x5981('0x0'));var Sequelize=require(_0x5981('0x1'));module[_0x5981('0x2')]={'uniqueid':{'type':Sequelize[_0x5981('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5981('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5981('0x4')]},'acceptAt':{'type':Sequelize[_0x5981('0x4')]},'exitAt':{'type':Sequelize[_0x5981('0x4')]},'reason':{'type':Sequelize[_0x5981('0x3')]}}; \ No newline at end of file +var _0x0853=['STRING','DATE','moment','sequelize','exports'];(function(_0x1c5304,_0x3866d4){var _0x211c1b=function(_0x4e7433){while(--_0x4e7433){_0x1c5304['push'](_0x1c5304['shift']());}};_0x211c1b(++_0x3866d4);}(_0x0853,0x101));var _0x3085=function(_0xcf715c,_0x11d1b3){_0xcf715c=_0xcf715c-0x0;var _0x4f0e2f=_0x0853[_0xcf715c];return _0x4f0e2f;};'use strict';var moment=require(_0x3085('0x0'));var Sequelize=require(_0x3085('0x1'));module[_0x3085('0x2')]={'uniqueid':{'type':Sequelize[_0x3085('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3085('0x3')]},'joinAt':{'type':Sequelize[_0x3085('0x4')]},'leaveAt':{'type':Sequelize[_0x3085('0x4')]},'acceptAt':{'type':Sequelize[_0x3085('0x4')]},'exitAt':{'type':Sequelize[_0x3085('0x4')]},'reason':{'type':Sequelize[_0x3085('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d4e3681..21d7587 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 _0x6a55=['eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','create','body','find','describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6a55,0xdb));var _0x56a5=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x6a55[_0x1fc4e2];return _0x2ba184;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x23')]();});}};}function handleEntityNotFound(_0xcf212,_0x2f203f){return function(_0x460bc2){if(!_0x460bc2){_0xcf212['sendStatus'](0x194);}return _0x460bc2;};}function handleError(_0x5c76a7,_0x2d8e68){_0x2d8e68=_0x2d8e68||0x1f4;return function(_0x42cd45){logger[_0x56a5('0x24')](_0x42cd45[_0x56a5('0x25')]);if(_0x42cd45['name']){delete _0x42cd45[_0x56a5('0x26')];}_0x5c76a7['status'](_0x2d8e68)[_0x56a5('0x27')](_0x42cd45);};}exports[_0x56a5('0x28')]=function(_0x1b27b5,_0x284ee5){var _0x4e7afd={},_0x3b55e6={},_0x1f7aeb={'count':0x0,'rows':[]};var _0x178f11=_['map'](db[_0x56a5('0x29')][_0x56a5('0x2a')],function(_0xeb4378){return{'name':_0xeb4378[_0x56a5('0x2b')],'type':_0xeb4378[_0x56a5('0x2c')]['key']};});_0x3b55e6[_0x56a5('0x2d')]=_[_0x56a5('0x2e')](_0x178f11,_0x56a5('0x26'));_0x3b55e6[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x1b27b5['query']);_0x3b55e6['filters']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],_0x3b55e6[_0x56a5('0x2f')]);_0x4e7afd['attributes']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],qs['fields'](_0x1b27b5['query']['fields']));_0x4e7afd['attributes']=_0x4e7afd[_0x56a5('0x32')][_0x56a5('0x33')]?_0x4e7afd[_0x56a5('0x32')]:_0x3b55e6['model'];if(!_0x1b27b5[_0x56a5('0x2f')]['hasOwnProperty'](_0x56a5('0x34'))){_0x4e7afd[_0x56a5('0x1d')]=qs['limit'](_0x1b27b5[_0x56a5('0x2f')]['limit']);_0x4e7afd[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x1b27b5[_0x56a5('0x2f')]['offset']);}_0x4e7afd[_0x56a5('0x35')]=qs[_0x56a5('0x36')](_0x1b27b5[_0x56a5('0x2f')]['sort']);_0x4e7afd[_0x56a5('0x37')]=qs[_0x56a5('0x38')](_[_0x56a5('0x39')](_0x1b27b5[_0x56a5('0x2f')],_0x3b55e6[_0x56a5('0x38')]),_0x178f11);if(_0x1b27b5['query']['filter']){_0x4e7afd[_0x56a5('0x37')]=_[_0x56a5('0x3a')](_0x4e7afd[_0x56a5('0x37')],{'$or':_[_0x56a5('0x2e')](_0x178f11,function(_0xbf2db6){if(_0xbf2db6[_0x56a5('0x2c')]!==_0x56a5('0x3b')){var _0x652028={};_0x652028[_0xbf2db6[_0x56a5('0x26')]]={'$like':'%'+_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3c')]+'%'};return _0x652028;}})});}_0x4e7afd=_[_0x56a5('0x3a')]({},_0x4e7afd,_0x1b27b5[_0x56a5('0x3d')]);var _0x389c01={'where':_0x4e7afd[_0x56a5('0x37')]};return db[_0x56a5('0x29')][_0x56a5('0x1b')](_0x389c01)[_0x56a5('0x21')](function(_0xf0f6c8){_0x1f7aeb[_0x56a5('0x1b')]=_0xf0f6c8;if(_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3e')]){_0x4e7afd['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x56a5('0x3f')](_0x4e7afd);})['then'](function(_0x7c3c3e){_0x1f7aeb[_0x56a5('0x40')]=_0x7c3c3e;return _0x1f7aeb;})[_0x56a5('0x21')](respondWithFilteredResult(_0x284ee5,_0x4e7afd))[_0x56a5('0x41')](handleError(_0x284ee5,null));};exports[_0x56a5('0x42')]=function(_0x1160da,_0x5618f9){var _0x5c565a={'raw':!![],'where':{'id':_0x1160da[_0x56a5('0x43')]['id']}},_0x29ab9b={};_0x29ab9b[_0x56a5('0x2d')]=_[_0x56a5('0x30')](db[_0x56a5('0x29')][_0x56a5('0x2a')]);_0x29ab9b['query']=_[_0x56a5('0x30')](_0x1160da[_0x56a5('0x2f')]);_0x29ab9b['filters']=_[_0x56a5('0x31')](_0x29ab9b[_0x56a5('0x2d')],_0x29ab9b[_0x56a5('0x2f')]);_0x5c565a[_0x56a5('0x32')]=_['intersection'](_0x29ab9b[_0x56a5('0x2d')],qs['fields'](_0x1160da[_0x56a5('0x2f')][_0x56a5('0x44')]));_0x5c565a['attributes']=_0x5c565a[_0x56a5('0x32')]['length']?_0x5c565a[_0x56a5('0x32')]:_0x29ab9b[_0x56a5('0x2d')];if(_0x1160da['query'][_0x56a5('0x3e')]){_0x5c565a['include']=[{'all':!![]}];}_0x5c565a=_[_0x56a5('0x3a')]({},_0x5c565a,_0x1160da['options']);return db[_0x56a5('0x29')]['find'](_0x5c565a)[_0x56a5('0x21')](handleEntityNotFound(_0x5618f9,null))[_0x56a5('0x21')](respondWithResult(_0x5618f9,null))[_0x56a5('0x41')](handleError(_0x5618f9,null));};exports[_0x56a5('0x45')]=function(_0x30d377,_0x43196d){return db[_0x56a5('0x29')]['create'](_0x30d377['body'],{})['then'](respondWithResult(_0x43196d,0xc9))[_0x56a5('0x41')](handleError(_0x43196d,null));};exports[_0x56a5('0x20')]=function(_0x1e510a,_0x55d2e2){if(_0x1e510a[_0x56a5('0x46')]['id']){delete _0x1e510a[_0x56a5('0x46')]['id'];}return db[_0x56a5('0x29')]['find']({'where':{'id':_0x1e510a[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x55d2e2,null))['then'](saveUpdates(_0x1e510a[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x55d2e2,null))[_0x56a5('0x41')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x22')]=function(_0xcb3cb9,_0x58d308){return db[_0x56a5('0x29')][_0x56a5('0x47')]({'where':{'id':_0xcb3cb9[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x58d308,null))[_0x56a5('0x21')](removeEntity(_0x58d308,null))['catch'](handleError(_0x58d308,null));};exports[_0x56a5('0x48')]=function(_0x3bda32,_0x597e52){return db[_0x56a5('0x29')][_0x56a5('0x48')]()[_0x56a5('0x21')](respondWithResult(_0x597e52,null))['catch'](handleError(_0x597e52,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(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x0295,0x1f0));var _0x5029=function(_0x3d8243,_0x431106){_0x3d8243=_0x3d8243-0x0;var _0x140fb4=_0x0295[_0x3d8243];return _0x140fb4;};'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 3643389..c91c5f7 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 _0x5a9b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','uniqueid','lodash'];(function(_0x55a6cc,_0x1b0f8c){var _0x231e84=function(_0x35caf0){while(--_0x35caf0){_0x55a6cc['push'](_0x55a6cc['shift']());}};_0x231e84(++_0x1b0f8c);}(_0x5a9b,0x15b));var _0xb5a9=function(_0x5ee933,_0x593ff4){_0x5ee933=_0x5ee933-0x0;var _0x23220e=_0x5a9b[_0x5ee933];return _0x23220e;};'use strict';var _=require(_0xb5a9('0x0'));var util=require(_0xb5a9('0x1'));var logger=require(_0xb5a9('0x2'))(_0xb5a9('0x3'));var moment=require('moment');var BPromise=require(_0xb5a9('0x4'));var rp=require(_0xb5a9('0x5'));var fs=require('fs');var path=require(_0xb5a9('0x6'));var rimraf=require(_0xb5a9('0x7'));var config=require(_0xb5a9('0x8'));var attributes=require(_0xb5a9('0x9'));module['exports']=function(_0x49f5b7,_0x3a5a8a){return _0x49f5b7[_0xb5a9('0xa')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xb5a9('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd706=['uniqueid','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x37870d,_0x356e02){var _0x1ae695=function(_0x508f6c){while(--_0x508f6c){_0x37870d['push'](_0x37870d['shift']());}};_0x1ae695(++_0x356e02);}(_0xd706,0x115));var _0x6d70=function(_0x1a3a08,_0x41e91b){_0x1a3a08=_0x1a3a08-0x0;var _0x55c399=_0xd706[_0x1a3a08];return _0x55c399;};'use strict';var _=require(_0x6d70('0x0'));var util=require(_0x6d70('0x1'));var logger=require(_0x6d70('0x2'))('api');var moment=require(_0x6d70('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d70('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6d70('0x5'));var attributes=require(_0x6d70('0x6'));module[_0x6d70('0x7')]=function(_0x4592ae,_0x1ea538){return _0x4592ae[_0x6d70('0x8')](_0x6d70('0x9'),attributes,{'tableName':_0x6d70('0xa'),'paranoid':![],'indexes':[{'name':_0x6d70('0xb'),'fields':[_0x6d70('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 1dd7335..d5ff6e8 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x234bbf,_0x3e5810){var _0x15f751=function(_0x5b4afd){while(--_0x5b4afd){_0x234bbf['push'](_0x234bbf['shift']());}};_0x15f751(++_0x3e5810);}(_0x1261,0x144));var _0x1126=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0x1261[_0x451d04];return _0x32c6fe;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x874709,_0x20b492){var _0x351b20=function(_0x87c907){while(--_0x87c907){_0x874709['push'](_0x874709['shift']());}};_0x351b20(++_0x20b492);}(_0xdb28,0x106));var _0x8db2=function(_0xa2bafc,_0x2f38bc){_0xa2bafc=_0xa2bafc-0x0;var _0x547ab4=_0xdb28[_0xa2bafc];return _0x547ab4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 024644a..b68c6b3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5bf912,_0x39950e){var _0x32a951=function(_0xe4630d){while(--_0xe4630d){_0x5bf912['push'](_0x5bf912['shift']());}};_0x32a951(++_0x39950e);}(_0xe706,0xa3));var _0x6e70=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xe706[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2987bf,_0x1877d1){var _0x41f722=function(_0x33ccf9){while(--_0x33ccf9){_0x2987bf['push'](_0x2987bf['shift']());}};_0x41f722(++_0x1877d1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 24f580c..89b952e 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 _0x1d68=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x59ca62,_0x540fdd){var _0x17a02a=function(_0x591bf6){while(--_0x591bf6){_0x59ca62['push'](_0x59ca62['shift']());}};_0x17a02a(++_0x540fdd);}(_0x1d68,0x174));var _0x81d6=function(_0x2d7fbe,_0x44b669){_0x2d7fbe=_0x2d7fbe-0x0;var _0x3a93ac=_0x1d68[_0x2d7fbe];return _0x3a93ac;};'use strict';var Sequelize=require(_0x81d6('0x0'));module[_0x81d6('0x1')]={'description':{'type':Sequelize[_0x81d6('0x2')]},'host':{'type':Sequelize[_0x81d6('0x2')]},'authentication':{'type':Sequelize[_0x81d6('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x81d6('0x2')]},'password':{'type':Sequelize[_0x81d6('0x2')]},'port':{'type':Sequelize[_0x81d6('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x81d6('0x2')],'defaultValue':_0x81d6('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x81d6('0x2')]},'modernAuthentication':{'type':Sequelize[_0x81d6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1f38=['STRING','INTEGER','sequelize','exports'];(function(_0xb6454a,_0x5576d4){var _0x40561f=function(_0x323815){while(--_0x323815){_0xb6454a['push'](_0xb6454a['shift']());}};_0x40561f(++_0x5576d4);}(_0x1f38,0x116));var _0x81f3=function(_0x57fbc8,_0x5f1746){_0x57fbc8=_0x57fbc8-0x0;var _0xfcf1de=_0x1f38[_0x57fbc8];return _0xfcf1de;};'use strict';var Sequelize=require(_0x81f3('0x0'));module[_0x81f3('0x1')]={'description':{'type':Sequelize[_0x81f3('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x81f3('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x81f3('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x81f3('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x81f3('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ae89dbf..1b595e5 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 _0x87ed=['request-promise','path','rimraf','../../config/environment','exports','define','mail_servers_in','lodash','util','api','moment'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x87ed,0x1bf));var _0xd87e=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x87ed[_0x55cc58];return _0x26062e;};'use strict';var _=require(_0xd87e('0x0'));var util=require(_0xd87e('0x1'));var logger=require('../../config/logger')(_0xd87e('0x2'));var moment=require(_0xd87e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd87e('0x4'));var fs=require('fs');var path=require(_0xd87e('0x5'));var rimraf=require(_0xd87e('0x6'));var config=require(_0xd87e('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xd87e('0x8')]=function(_0x343ab6,_0x318596){return _0x343ab6[_0xd87e('0x9')]('MailServerIn',attributes,{'tableName':_0xd87e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda1=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','define','mail_servers_in','lodash','util'];(function(_0x4b7498,_0x57aa70){var _0x3e80ae=function(_0x9c66b5){while(--_0x9c66b5){_0x4b7498['push'](_0x4b7498['shift']());}};_0x3e80ae(++_0x57aa70);}(_0xeda1,0x1ab));var _0x1eda=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0xeda1[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0x1eda('0x0'));var util=require(_0x1eda('0x1'));var logger=require(_0x1eda('0x2'))(_0x1eda('0x3'));var moment=require(_0x1eda('0x4'));var BPromise=require('bluebird');var rp=require(_0x1eda('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1eda('0x6'));var config=require(_0x1eda('0x7'));var attributes=require(_0x1eda('0x8'));module['exports']=function(_0x103860,_0x409845){return _0x103860[_0x1eda('0x9')]('MailServerIn',attributes,{'tableName':_0x1eda('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 ed52070..0fbffdb 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 _0x29a5=['attributes','include','model','map','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where'];(function(_0x10ee3b,_0x58d9d0){var _0x1d0b32=function(_0x3f55bc){while(--_0x3f55bc){_0x10ee3b['push'](_0x10ee3b['shift']());}};_0x1d0b32(++_0x58d9d0);}(_0x29a5,0x1e0));var _0x529a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x29a5[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x529a('0x0'));var util=require(_0x529a('0x1'));var moment=require(_0x529a('0x2'));var BPromise=require('bluebird');var rs=require(_0x529a('0x3'));var fs=require('fs');var Redis=require(_0x529a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x529a('0x5'));var logger=require(_0x529a('0x6'))('rpc');var config=require(_0x529a('0x7'));var jayson=require(_0x529a('0x8'));var client=jayson[_0x529a('0x9')][_0x529a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da223,_0x6861f0,_0x1c9b41){return new BPromise(function(_0x4b8ad9,_0x465d78){return client[_0x529a('0xb')](_0x3da223,_0x1c9b41)[_0x529a('0xc')](function(_0x5558a3){logger[_0x529a('0xd')]('MailServerIn,\x20%s,\x20%s',_0x6861f0,'request\x20sent');logger[_0x529a('0xe')](_0x529a('0xf'),_0x6861f0,_0x529a('0x10'),JSON[_0x529a('0x11')](_0x5558a3));if(_0x5558a3[_0x529a('0x12')]){if(_0x5558a3[_0x529a('0x12')][_0x529a('0x13')]===0x1f4){logger[_0x529a('0x12')](_0x529a('0x14'),_0x6861f0,_0x5558a3[_0x529a('0x12')][_0x529a('0x15')]);return _0x465d78(_0x5558a3[_0x529a('0x12')][_0x529a('0x15')]);}logger[_0x529a('0x12')](_0x529a('0x14'),_0x6861f0,_0x5558a3[_0x529a('0x12')]['message']);return _0x4b8ad9(_0x5558a3[_0x529a('0x12')][_0x529a('0x15')]);}else{logger[_0x529a('0xd')]('MailServerIn,\x20%s,\x20%s',_0x6861f0,_0x529a('0x10'));_0x4b8ad9(_0x5558a3[_0x529a('0x16')][_0x529a('0x15')]);}})[_0x529a('0x17')](function(_0x36e235){logger[_0x529a('0x12')]('MailServerIn,\x20%s,\x20%s',_0x6861f0,_0x36e235);_0x465d78(_0x36e235);});});}exports[_0x529a('0x18')]=function(_0x34fa5c){var _0x2b89c2=this;return new Promise(function(_0x543b56,_0x2168d5){return db[_0x529a('0x19')][_0x529a('0x1a')]({'raw':_0x34fa5c[_0x529a('0x1b')]?_0x34fa5c['options'][_0x529a('0x1c')]===undefined?!![]:![]:!![],'where':_0x34fa5c[_0x529a('0x1b')]?_0x34fa5c[_0x529a('0x1b')][_0x529a('0x1d')]||null:null,'attributes':_0x34fa5c[_0x529a('0x1b')]?_0x34fa5c[_0x529a('0x1b')][_0x529a('0x1e')]||null:null,'limit':_0x34fa5c[_0x529a('0x1b')]?_0x34fa5c[_0x529a('0x1b')]['limit']||null:null,'include':_0x34fa5c[_0x529a('0x1b')]?_0x34fa5c[_0x529a('0x1b')][_0x529a('0x1f')]?_['map'](_0x34fa5c['options'][_0x529a('0x1f')],function(_0x18f9b4){return{'model':db[_0x18f9b4[_0x529a('0x20')]],'as':_0x18f9b4['as'],'attributes':_0x18f9b4[_0x529a('0x1e')],'include':_0x18f9b4[_0x529a('0x1f')]?_[_0x529a('0x21')](_0x18f9b4[_0x529a('0x1f')],function(_0x40eac6){return{'model':db[_0x40eac6['model']],'as':_0x40eac6['as'],'attributes':_0x40eac6[_0x529a('0x1e')],'include':_0x40eac6[_0x529a('0x1f')]?_[_0x529a('0x21')](_0x40eac6[_0x529a('0x1f')],function(_0x3d91f5){return{'model':db[_0x3d91f5['model']],'as':_0x3d91f5['as'],'attributes':_0x3d91f5[_0x529a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x529a('0xc')](function(_0x527ad6){logger[_0x529a('0xd')](_0x529a('0x18'),_0x34fa5c);logger[_0x529a('0xe')]('GetMailServerIn',_0x34fa5c,JSON['stringify'](_0x527ad6));_0x543b56(_0x527ad6);})[_0x529a('0x17')](function(_0x1e1727){logger[_0x529a('0x12')](_0x529a('0x18'),_0x1e1727[_0x529a('0x15')],_0x34fa5c);_0x2168d5(_0x2b89c2[_0x529a('0x12')](0x1f4,_0x1e1727[_0x529a('0x15')]));});});}; \ No newline at end of file +var _0xc2e5=['GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','map','include','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','result'];(function(_0x4b1dcd,_0x24091c){var _0x4038bb=function(_0x112c92){while(--_0x112c92){_0x4b1dcd['push'](_0x4b1dcd['shift']());}};_0x4038bb(++_0x24091c);}(_0xc2e5,0x87));var _0x5c2e=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xc2e5[_0x4d35f3];return _0x382fea;};'use strict';var _=require(_0x5c2e('0x0'));var util=require(_0x5c2e('0x1'));var moment=require(_0x5c2e('0x2'));var BPromise=require(_0x5c2e('0x3'));var rs=require(_0x5c2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c2e('0x5'))['db'];var utils=require(_0x5c2e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5c2e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65371e,_0x1046a3,_0x22781f){return new BPromise(function(_0x1a3d16,_0x2d8cb6){return client[_0x5c2e('0x9')](_0x65371e,_0x22781f)[_0x5c2e('0xa')](function(_0x13a949){logger[_0x5c2e('0xb')]('MailServerIn,\x20%s,\x20%s',_0x1046a3,_0x5c2e('0xc'));logger[_0x5c2e('0xd')](_0x5c2e('0xe'),_0x1046a3,_0x5c2e('0xc'),JSON[_0x5c2e('0xf')](_0x13a949));if(_0x13a949[_0x5c2e('0x10')]){if(_0x13a949[_0x5c2e('0x10')]['code']===0x1f4){logger[_0x5c2e('0x10')](_0x5c2e('0x11'),_0x1046a3,_0x13a949['error']['message']);return _0x2d8cb6(_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);}logger[_0x5c2e('0x10')](_0x5c2e('0x11'),_0x1046a3,_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);return _0x1a3d16(_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);}else{logger[_0x5c2e('0xb')](_0x5c2e('0x11'),_0x1046a3,'request\x20sent');_0x1a3d16(_0x13a949[_0x5c2e('0x13')][_0x5c2e('0x12')]);}})['catch'](function(_0x54925b){logger[_0x5c2e('0x10')]('MailServerIn,\x20%s,\x20%s',_0x1046a3,_0x54925b);_0x2d8cb6(_0x54925b);});});}exports[_0x5c2e('0x14')]=function(_0x1b1f67){var _0x5237e3=this;return new Promise(function(_0x3f4d44,_0x1aafdc){return db[_0x5c2e('0x15')][_0x5c2e('0x16')]({'raw':_0x1b1f67['options']?_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x18')]===undefined?!![]:![]:!![],'where':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x19')]||null:null,'attributes':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67['options']['attributes']||null:null,'limit':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67['options'][_0x5c2e('0x1a')]||null:null,'include':_0x1b1f67['options']?_0x1b1f67['options']['include']?_[_0x5c2e('0x1b')](_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x1c')],function(_0x1660f3){return{'model':db[_0x1660f3['model']],'as':_0x1660f3['as'],'attributes':_0x1660f3[_0x5c2e('0x1d')],'include':_0x1660f3[_0x5c2e('0x1c')]?_[_0x5c2e('0x1b')](_0x1660f3[_0x5c2e('0x1c')],function(_0x317e3e){return{'model':db[_0x317e3e['model']],'as':_0x317e3e['as'],'attributes':_0x317e3e[_0x5c2e('0x1d')],'include':_0x317e3e[_0x5c2e('0x1c')]?_[_0x5c2e('0x1b')](_0x317e3e['include'],function(_0x475c4d){return{'model':db[_0x475c4d['model']],'as':_0x475c4d['as'],'attributes':_0x475c4d[_0x5c2e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5c2e('0xa')](function(_0x28aa56){logger[_0x5c2e('0xb')]('GetMailServerIn',_0x1b1f67);logger[_0x5c2e('0xd')](_0x5c2e('0x14'),_0x1b1f67,JSON[_0x5c2e('0xf')](_0x28aa56));_0x3f4d44(_0x28aa56);})[_0x5c2e('0x1e')](function(_0x2de061){logger['error']('GetMailServerIn',_0x2de061[_0x5c2e('0x12')],_0x1b1f67);_0x1aafdc(_0x5237e3[_0x5c2e('0x10')](0x1f4,_0x2de061[_0x5c2e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ee40d19..308b48c 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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(_0x56804c,_0x5d5f3a){_0x56804c=_0x56804c-0x0;var _0x215443=_0x7a54[_0x56804c];return _0x215443;};'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 7d6c6bb..9a3fb98 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 _0x0abf=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0xab65fc,_0x38a5e9){var _0x3ef2ac=function(_0x52c30e){while(--_0x52c30e){_0xab65fc['push'](_0xab65fc['shift']());}};_0x3ef2ac(++_0x38a5e9);}(_0x0abf,0xe8));var _0xf0ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0abf[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'description':{'type':Sequelize[_0xf0ab('0x1')]},'host':{'type':Sequelize[_0xf0ab('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf0ab('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xf0ab('0x1')]},'authentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa5fa=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x1368fa,_0x48ea18){var _0x2debec=function(_0x1f5748){while(--_0x1f5748){_0x1368fa['push'](_0x1368fa['shift']());}};_0x2debec(++_0x48ea18);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3b2ac8,_0x3819fe){_0x3b2ac8=_0x3b2ac8-0x0;var _0x3574f2=_0xa5fa[_0x3b2ac8];return _0x3574f2;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'description':{'type':Sequelize[_0xaa5f('0x1')]},'host':{'type':Sequelize[_0xaa5f('0x1')]},'user':{'type':Sequelize[_0xaa5f('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaa5f('0x2')]},'secure':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 17d1320..de9d36a 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 _0x9001=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1d352b,_0x5b0264){var _0xdbb3f6=function(_0xdb79ef){while(--_0xdb79ef){_0x1d352b['push'](_0x1d352b['shift']());}};_0xdbb3f6(++_0x5b0264);}(_0x9001,0x12e));var _0x1900=function(_0x3997d8,_0x5be1f9){_0x3997d8=_0x3997d8-0x0;var _0x38bf7b=_0x9001[_0x3997d8];return _0x38bf7b;};'use strict';var emlformat=require(_0x1900('0x0'));var rimraf=require(_0x1900('0x1'));var zipdir=require(_0x1900('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1900('0x3'));var moment=require(_0x1900('0x4'));var BPromise=require(_0x1900('0x5'));var Mustache=require(_0x1900('0x6'));var util=require('util');var path=require(_0x1900('0x7'));var sox=require(_0x1900('0x8'));var csv=require(_0x1900('0x9'));var ejs=require(_0x1900('0xa'));var fs=require('fs');var fs_extra=require(_0x1900('0xb'));var _=require(_0x1900('0xc'));var squel=require(_0x1900('0xd'));var crypto=require(_0x1900('0xe'));var jsforce=require(_0x1900('0xf'));var deskjs=require(_0x1900('0x10'));var toCsv=require(_0x1900('0x9'));var querystring=require('querystring');var Papa=require(_0x1900('0x11'));var Redis=require('ioredis');var authService=require(_0x1900('0x12'));var qs=require(_0x1900('0x13'));var as=require(_0x1900('0x14'));var hardwareService=require(_0x1900('0x15'));var logger=require(_0x1900('0x16'))(_0x1900('0x17'));var utils=require(_0x1900('0x18'));var config=require(_0x1900('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1900('0x1a'))['db'];function respondWithStatusCode(_0x4d8e8d,_0x16f842){_0x16f842=_0x16f842||0xcc;return function(_0xc406b1){if(_0xc406b1){return _0x4d8e8d[_0x1900('0x1b')](_0x16f842);}return _0x4d8e8d[_0x1900('0x1c')](_0x16f842)['end']();};}function respondWithResult(_0x43595a,_0xa65eaf){_0xa65eaf=_0xa65eaf||0xc8;return function(_0x1fc6a8){if(_0x1fc6a8){return _0x43595a['status'](_0xa65eaf)[_0x1900('0x1d')](_0x1fc6a8);}};}function respondWithFilteredResult(_0x63e487,_0x548803){return function(_0x2b6ee9){if(_0x2b6ee9){var _0x582642=typeof _0x548803['offset']===_0x1900('0x1e')&&typeof _0x548803[_0x1900('0x1f')]==='undefined';var _0x6408a8=_0x2b6ee9[_0x1900('0x20')];var _0x57c09a=_0x582642?0x0:_0x548803[_0x1900('0x21')];var _0x5d271d=_0x582642?_0x2b6ee9[_0x1900('0x20')]:_0x548803[_0x1900('0x21')]+_0x548803[_0x1900('0x1f')];var _0xc4ea08;if(_0x5d271d>=_0x6408a8){_0x5d271d=_0x6408a8;_0xc4ea08=0xc8;}else{_0xc4ea08=0xce;}_0x63e487['status'](_0xc4ea08);return _0x63e487['set'](_0x1900('0x22'),_0x57c09a+'-'+_0x5d271d+'/'+_0x6408a8)[_0x1900('0x1d')](_0x2b6ee9);}return null;};}function patchUpdates(_0x39c417){return function(_0x1449a6){try{jsonpatch[_0x1900('0x23')](_0x1449a6,_0x39c417,!![]);}catch(_0x34c0b0){return BPromise[_0x1900('0x24')](_0x34c0b0);}return _0x1449a6[_0x1900('0x25')]();};}function saveUpdates(_0xe09c5b,_0x293258){return function(_0x4c8181){if(_0x4c8181){return _0x4c8181[_0x1900('0x26')](_0xe09c5b)[_0x1900('0x27')](function(_0x108c65){return _0x108c65;});}return null;};}function removeEntity(_0x2b138c,_0x20f058){return function(_0x538644){if(_0x538644){return _0x538644[_0x1900('0x28')]()[_0x1900('0x27')](function(){_0x2b138c[_0x1900('0x1c')](0xcc)[_0x1900('0x29')]();});}};}function handleEntityNotFound(_0x358de7,_0x1b90e3){return function(_0xdf6273){if(!_0xdf6273){_0x358de7['sendStatus'](0x194);}return _0xdf6273;};}function handleError(_0x296348,_0x5652f3){_0x5652f3=_0x5652f3||0x1f4;return function(_0x4ec682){logger[_0x1900('0x2a')](_0x4ec682[_0x1900('0x2b')]);if(_0x4ec682[_0x1900('0x2c')]){delete _0x4ec682[_0x1900('0x2c')];}_0x296348['status'](_0x5652f3)[_0x1900('0x2d')](_0x4ec682);};}exports[_0x1900('0x2e')]=function(_0x368dee,_0x1805d5){var _0x3523fe={},_0x2f923e={},_0xe3286a={'count':0x0,'rows':[]};var _0x3391b1=_['map'](db[_0x1900('0x2f')][_0x1900('0x30')],function(_0x32b4fc){return{'name':_0x32b4fc[_0x1900('0x31')],'type':_0x32b4fc[_0x1900('0x32')][_0x1900('0x33')]};});_0x2f923e[_0x1900('0x34')]=_['map'](_0x3391b1,_0x1900('0x2c'));_0x2f923e[_0x1900('0x35')]=_[_0x1900('0x36')](_0x368dee['query']);_0x2f923e[_0x1900('0x37')]=_[_0x1900('0x38')](_0x2f923e[_0x1900('0x34')],_0x2f923e[_0x1900('0x35')]);_0x3523fe['attributes']=_[_0x1900('0x38')](_0x2f923e[_0x1900('0x34')],qs['fields'](_0x368dee[_0x1900('0x35')][_0x1900('0x39')]));_0x3523fe['attributes']=_0x3523fe[_0x1900('0x3a')][_0x1900('0x3b')]?_0x3523fe['attributes']:_0x2f923e['model'];if(!_0x368dee[_0x1900('0x35')][_0x1900('0x3c')](_0x1900('0x3d'))){_0x3523fe[_0x1900('0x1f')]=qs[_0x1900('0x1f')](_0x368dee[_0x1900('0x35')][_0x1900('0x1f')]);_0x3523fe[_0x1900('0x21')]=qs[_0x1900('0x21')](_0x368dee[_0x1900('0x35')][_0x1900('0x21')]);}_0x3523fe[_0x1900('0x3e')]=qs[_0x1900('0x3f')](_0x368dee['query'][_0x1900('0x3f')]);_0x3523fe['where']=qs[_0x1900('0x37')](_[_0x1900('0x40')](_0x368dee['query'],_0x2f923e['filters']),_0x3391b1);if(_0x368dee[_0x1900('0x35')]['filter']){_0x3523fe[_0x1900('0x41')]=_['merge'](_0x3523fe[_0x1900('0x41')],{'$or':_['map'](_0x3391b1,function(_0x4cfe60){if(_0x4cfe60[_0x1900('0x32')]!==_0x1900('0x42')){var _0x38d6f6={};_0x38d6f6[_0x4cfe60[_0x1900('0x2c')]]={'$like':'%'+_0x368dee[_0x1900('0x35')][_0x1900('0x43')]+'%'};return _0x38d6f6;}})});}_0x3523fe=_[_0x1900('0x44')]({},_0x3523fe,_0x368dee[_0x1900('0x45')]);var _0x534395={'where':_0x3523fe[_0x1900('0x41')]};return db[_0x1900('0x2f')][_0x1900('0x20')](_0x534395)[_0x1900('0x27')](function(_0xa6c080){_0xe3286a[_0x1900('0x20')]=_0xa6c080;if(_0x368dee[_0x1900('0x35')][_0x1900('0x46')]){_0x3523fe[_0x1900('0x47')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x3523fe);})[_0x1900('0x27')](function(_0x40a8ab){_0xe3286a[_0x1900('0x48')]=_0x40a8ab;return _0xe3286a;})[_0x1900('0x27')](respondWithFilteredResult(_0x1805d5,_0x3523fe))[_0x1900('0x49')](handleError(_0x1805d5,null));};exports[_0x1900('0x4a')]=function(_0x3f78be,_0x5c6e96){var _0x18a0b1={'raw':!![],'where':{'id':_0x3f78be[_0x1900('0x4b')]['id']}},_0x117d4f={};_0x117d4f[_0x1900('0x34')]=_[_0x1900('0x36')](db[_0x1900('0x2f')][_0x1900('0x30')]);_0x117d4f[_0x1900('0x35')]=_[_0x1900('0x36')](_0x3f78be['query']);_0x117d4f['filters']=_[_0x1900('0x38')](_0x117d4f[_0x1900('0x34')],_0x117d4f['query']);_0x18a0b1[_0x1900('0x3a')]=_[_0x1900('0x38')](_0x117d4f[_0x1900('0x34')],qs['fields'](_0x3f78be[_0x1900('0x35')][_0x1900('0x39')]));_0x18a0b1[_0x1900('0x3a')]=_0x18a0b1[_0x1900('0x3a')][_0x1900('0x3b')]?_0x18a0b1['attributes']:_0x117d4f[_0x1900('0x34')];if(_0x3f78be[_0x1900('0x35')][_0x1900('0x46')]){_0x18a0b1['include']=[{'all':!![]}];}_0x18a0b1=_[_0x1900('0x44')]({},_0x18a0b1,_0x3f78be[_0x1900('0x45')]);return db[_0x1900('0x2f')]['find'](_0x18a0b1)['then'](handleEntityNotFound(_0x5c6e96,null))['then'](respondWithResult(_0x5c6e96,null))['catch'](handleError(_0x5c6e96,null));};exports['create']=function(_0x3923ec,_0x383431){return db[_0x1900('0x2f')][_0x1900('0x4c')](_0x3923ec[_0x1900('0x4d')],{})[_0x1900('0x27')](respondWithResult(_0x383431,0xc9))[_0x1900('0x49')](handleError(_0x383431,null));};exports[_0x1900('0x26')]=function(_0x164707,_0x5a5745){if(_0x164707[_0x1900('0x4d')]['id']){delete _0x164707[_0x1900('0x4d')]['id'];}return db[_0x1900('0x2f')][_0x1900('0x4e')]({'where':{'id':_0x164707[_0x1900('0x4b')]['id']}})[_0x1900('0x27')](handleEntityNotFound(_0x5a5745,null))['then'](saveUpdates(_0x164707['body'],null))[_0x1900('0x27')](respondWithResult(_0x5a5745,null))[_0x1900('0x49')](handleError(_0x5a5745,null));};exports[_0x1900('0x28')]=function(_0x5da591,_0x350b7c){return db['MailServerOut'][_0x1900('0x4e')]({'where':{'id':_0x5da591[_0x1900('0x4b')]['id']}})[_0x1900('0x27')](handleEntityNotFound(_0x350b7c,null))[_0x1900('0x27')](removeEntity(_0x350b7c,null))[_0x1900('0x49')](handleError(_0x350b7c,null));}; \ No newline at end of file +var _0xfe14=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','MailServerOut','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','limit','undefined','count','offset','status','set','apply','reject','save','update','then','destroy','stack','name'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0xfe14,0xb0));var _0x4fe1=function(_0x823a0b,_0x5824ff){_0x823a0b=_0x823a0b-0x0;var _0x162120=_0xfe14[_0x823a0b];return _0x162120;};'use strict';var emlformat=require(_0x4fe1('0x0'));var rimraf=require(_0x4fe1('0x1'));var zipdir=require(_0x4fe1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4fe1('0x3'));var Mustache=require(_0x4fe1('0x4'));var util=require(_0x4fe1('0x5'));var path=require('path');var sox=require(_0x4fe1('0x6'));var csv=require('to-csv');var ejs=require(_0x4fe1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fe1('0x8'));var squel=require(_0x4fe1('0x9'));var crypto=require(_0x4fe1('0xa'));var jsforce=require(_0x4fe1('0xb'));var deskjs=require(_0x4fe1('0xc'));var toCsv=require(_0x4fe1('0xd'));var querystring=require(_0x4fe1('0xe'));var Papa=require(_0x4fe1('0xf'));var Redis=require('ioredis');var authService=require(_0x4fe1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4fe1('0x11'));var hardwareService=require(_0x4fe1('0x12'));var logger=require('../../config/logger')(_0x4fe1('0x13'));var utils=require(_0x4fe1('0x14'));var config=require(_0x4fe1('0x15'));var licenseUtil=require(_0x4fe1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a4488,_0x326f75){_0x326f75=_0x326f75||0xcc;return function(_0x318616){if(_0x318616){return _0x3a4488[_0x4fe1('0x17')](_0x326f75);}return _0x3a4488['status'](_0x326f75)[_0x4fe1('0x18')]();};}function respondWithResult(_0xd39640,_0x2832ad){_0x2832ad=_0x2832ad||0xc8;return function(_0xcf0bbc){if(_0xcf0bbc){return _0xd39640['status'](_0x2832ad)[_0x4fe1('0x19')](_0xcf0bbc);}};}function respondWithFilteredResult(_0x4bdf92,_0x2afcc2){return function(_0x227b13){if(_0x227b13){var _0x328b0a=typeof _0x2afcc2['offset']==='undefined'&&typeof _0x2afcc2[_0x4fe1('0x1a')]===_0x4fe1('0x1b');var _0x3ef03f=_0x227b13[_0x4fe1('0x1c')];var _0x1d6498=_0x328b0a?0x0:_0x2afcc2[_0x4fe1('0x1d')];var _0x90a4fc=_0x328b0a?_0x227b13['count']:_0x2afcc2[_0x4fe1('0x1d')]+_0x2afcc2['limit'];var _0x4068bf;if(_0x90a4fc>=_0x3ef03f){_0x90a4fc=_0x3ef03f;_0x4068bf=0xc8;}else{_0x4068bf=0xce;}_0x4bdf92[_0x4fe1('0x1e')](_0x4068bf);return _0x4bdf92[_0x4fe1('0x1f')]('Content-Range',_0x1d6498+'-'+_0x90a4fc+'/'+_0x3ef03f)[_0x4fe1('0x19')](_0x227b13);}return null;};}function patchUpdates(_0x1c8651){return function(_0x2d1195){try{jsonpatch[_0x4fe1('0x20')](_0x2d1195,_0x1c8651,!![]);}catch(_0x51f46c){return BPromise[_0x4fe1('0x21')](_0x51f46c);}return _0x2d1195[_0x4fe1('0x22')]();};}function saveUpdates(_0x5e674e,_0x50b3dd){return function(_0x439c89){if(_0x439c89){return _0x439c89[_0x4fe1('0x23')](_0x5e674e)[_0x4fe1('0x24')](function(_0x51a161){return _0x51a161;});}return null;};}function removeEntity(_0x3e61d9,_0x4ba579){return function(_0x1b292e){if(_0x1b292e){return _0x1b292e[_0x4fe1('0x25')]()[_0x4fe1('0x24')](function(){_0x3e61d9['status'](0xcc)[_0x4fe1('0x18')]();});}};}function handleEntityNotFound(_0x3158d8,_0x3e28e4){return function(_0x238b64){if(!_0x238b64){_0x3158d8[_0x4fe1('0x17')](0x194);}return _0x238b64;};}function handleError(_0x303128,_0xb9fefc){_0xb9fefc=_0xb9fefc||0x1f4;return function(_0x4cdf27){logger['error'](_0x4cdf27[_0x4fe1('0x26')]);if(_0x4cdf27[_0x4fe1('0x27')]){delete _0x4cdf27[_0x4fe1('0x27')];}_0x303128[_0x4fe1('0x1e')](_0xb9fefc)['send'](_0x4cdf27);};}exports[_0x4fe1('0x28')]=function(_0x177efc,_0x33ca96){var _0x1970ea={},_0x507ed0={},_0x1aa6ce={'count':0x0,'rows':[]};var _0x58fa2d=_[_0x4fe1('0x29')](db['MailServerOut'][_0x4fe1('0x2a')],function(_0x471ea7){return{'name':_0x471ea7[_0x4fe1('0x2b')],'type':_0x471ea7[_0x4fe1('0x2c')][_0x4fe1('0x2d')]};});_0x507ed0[_0x4fe1('0x2e')]=_[_0x4fe1('0x29')](_0x58fa2d,'name');_0x507ed0[_0x4fe1('0x2f')]=_[_0x4fe1('0x30')](_0x177efc['query']);_0x507ed0[_0x4fe1('0x31')]=_[_0x4fe1('0x32')](_0x507ed0[_0x4fe1('0x2e')],_0x507ed0[_0x4fe1('0x2f')]);_0x1970ea[_0x4fe1('0x33')]=_[_0x4fe1('0x32')](_0x507ed0[_0x4fe1('0x2e')],qs[_0x4fe1('0x34')](_0x177efc['query'][_0x4fe1('0x34')]));_0x1970ea[_0x4fe1('0x33')]=_0x1970ea['attributes'][_0x4fe1('0x35')]?_0x1970ea['attributes']:_0x507ed0['model'];if(!_0x177efc[_0x4fe1('0x2f')][_0x4fe1('0x36')]('nolimit')){_0x1970ea['limit']=qs[_0x4fe1('0x1a')](_0x177efc[_0x4fe1('0x2f')]['limit']);_0x1970ea[_0x4fe1('0x1d')]=qs[_0x4fe1('0x1d')](_0x177efc[_0x4fe1('0x2f')]['offset']);}_0x1970ea[_0x4fe1('0x37')]=qs[_0x4fe1('0x38')](_0x177efc[_0x4fe1('0x2f')][_0x4fe1('0x38')]);_0x1970ea['where']=qs[_0x4fe1('0x31')](_[_0x4fe1('0x39')](_0x177efc[_0x4fe1('0x2f')],_0x507ed0[_0x4fe1('0x31')]),_0x58fa2d);if(_0x177efc[_0x4fe1('0x2f')]['filter']){_0x1970ea[_0x4fe1('0x3a')]=_[_0x4fe1('0x3b')](_0x1970ea[_0x4fe1('0x3a')],{'$or':_[_0x4fe1('0x29')](_0x58fa2d,function(_0x4d74a3){if(_0x4d74a3[_0x4fe1('0x2c')]!==_0x4fe1('0x3c')){var _0x29ec77={};_0x29ec77[_0x4d74a3['name']]={'$like':'%'+_0x177efc[_0x4fe1('0x2f')]['filter']+'%'};return _0x29ec77;}})});}_0x1970ea=_[_0x4fe1('0x3b')]({},_0x1970ea,_0x177efc[_0x4fe1('0x3d')]);var _0x1e7392={'where':_0x1970ea[_0x4fe1('0x3a')]};return db[_0x4fe1('0x3e')][_0x4fe1('0x1c')](_0x1e7392)[_0x4fe1('0x24')](function(_0x11e020){_0x1aa6ce[_0x4fe1('0x1c')]=_0x11e020;if(_0x177efc['query'][_0x4fe1('0x3f')]){_0x1970ea[_0x4fe1('0x40')]=[{'all':!![]}];}return db[_0x4fe1('0x3e')][_0x4fe1('0x41')](_0x1970ea);})[_0x4fe1('0x24')](function(_0x2f43ea){_0x1aa6ce[_0x4fe1('0x42')]=_0x2f43ea;return _0x1aa6ce;})[_0x4fe1('0x24')](respondWithFilteredResult(_0x33ca96,_0x1970ea))['catch'](handleError(_0x33ca96,null));};exports['show']=function(_0x3de05d,_0x5ded0d){var _0x3c1bbd={'raw':!![],'where':{'id':_0x3de05d[_0x4fe1('0x43')]['id']}},_0x188c7d={};_0x188c7d[_0x4fe1('0x2e')]=_['keys'](db['MailServerOut'][_0x4fe1('0x2a')]);_0x188c7d['query']=_['keys'](_0x3de05d[_0x4fe1('0x2f')]);_0x188c7d[_0x4fe1('0x31')]=_['intersection'](_0x188c7d[_0x4fe1('0x2e')],_0x188c7d[_0x4fe1('0x2f')]);_0x3c1bbd['attributes']=_[_0x4fe1('0x32')](_0x188c7d[_0x4fe1('0x2e')],qs[_0x4fe1('0x34')](_0x3de05d[_0x4fe1('0x2f')][_0x4fe1('0x34')]));_0x3c1bbd[_0x4fe1('0x33')]=_0x3c1bbd[_0x4fe1('0x33')][_0x4fe1('0x35')]?_0x3c1bbd[_0x4fe1('0x33')]:_0x188c7d[_0x4fe1('0x2e')];if(_0x3de05d['query'][_0x4fe1('0x3f')]){_0x3c1bbd['include']=[{'all':!![]}];}_0x3c1bbd=_[_0x4fe1('0x3b')]({},_0x3c1bbd,_0x3de05d[_0x4fe1('0x3d')]);return db[_0x4fe1('0x3e')][_0x4fe1('0x44')](_0x3c1bbd)['then'](handleEntityNotFound(_0x5ded0d,null))[_0x4fe1('0x24')](respondWithResult(_0x5ded0d,null))[_0x4fe1('0x45')](handleError(_0x5ded0d,null));};exports[_0x4fe1('0x46')]=function(_0x18358b,_0x5cbd19){return db[_0x4fe1('0x3e')][_0x4fe1('0x46')](_0x18358b['body'],{})[_0x4fe1('0x24')](respondWithResult(_0x5cbd19,0xc9))[_0x4fe1('0x45')](handleError(_0x5cbd19,null));};exports['update']=function(_0x96e220,_0x186e3f){if(_0x96e220[_0x4fe1('0x47')]['id']){delete _0x96e220[_0x4fe1('0x47')]['id'];}return db[_0x4fe1('0x3e')][_0x4fe1('0x44')]({'where':{'id':_0x96e220[_0x4fe1('0x43')]['id']}})[_0x4fe1('0x24')](handleEntityNotFound(_0x186e3f,null))['then'](saveUpdates(_0x96e220[_0x4fe1('0x47')],null))[_0x4fe1('0x24')](respondWithResult(_0x186e3f,null))[_0x4fe1('0x45')](handleError(_0x186e3f,null));};exports[_0x4fe1('0x25')]=function(_0x2e4052,_0x273bbe){return db[_0x4fe1('0x3e')][_0x4fe1('0x44')]({'where':{'id':_0x2e4052['params']['id']}})[_0x4fe1('0x24')](handleEntityNotFound(_0x273bbe,null))[_0x4fe1('0x24')](removeEntity(_0x273bbe,null))[_0x4fe1('0x45')](handleError(_0x273bbe,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6538aeb..70d5776 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 _0x31b1=['mail_servers_out','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut'];(function(_0x31e965,_0xbd1e54){var _0x120351=function(_0x45229d){while(--_0x45229d){_0x31e965['push'](_0x31e965['shift']());}};_0x120351(++_0xbd1e54);}(_0x31b1,0x1e5));var _0x131b=function(_0x128eda,_0x5b8fe4){_0x128eda=_0x128eda-0x0;var _0x27e400=_0x31b1[_0x128eda];return _0x27e400;};'use strict';var _=require(_0x131b('0x0'));var util=require('util');var logger=require(_0x131b('0x1'))(_0x131b('0x2'));var moment=require('moment');var BPromise=require(_0x131b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x131b('0x4'));var rimraf=require(_0x131b('0x5'));var config=require(_0x131b('0x6'));var attributes=require(_0x131b('0x7'));module[_0x131b('0x8')]=function(_0x1cc60a,_0xd4bad3){return _0x1cc60a['define'](_0x131b('0x9'),attributes,{'tableName':_0x131b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff66=['api','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','lodash','../../config/logger'];(function(_0x223300,_0x504980){var _0x37baac=function(_0x1a97ea){while(--_0x1a97ea){_0x223300['push'](_0x223300['shift']());}};_0x37baac(++_0x504980);}(_0xff66,0xda));var _0x6ff6=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xff66[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x6ff6('0x0'));var util=require('util');var logger=require(_0x6ff6('0x1'))(_0x6ff6('0x2'));var moment=require('moment');var BPromise=require(_0x6ff6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ff6('0x4'));var rimraf=require(_0x6ff6('0x5'));var config=require(_0x6ff6('0x6'));var attributes=require(_0x6ff6('0x7'));module['exports']=function(_0x1f4ba1,_0x42c398){return _0x1f4ba1[_0x6ff6('0x8')](_0x6ff6('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 958ed95..5cf5cc1 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x28714d,_0x4e2fd3){var _0x2233c4=function(_0x5b01ff){while(--_0x5b01ff){_0x28714d['push'](_0x28714d['shift']());}};_0x2233c4(++_0x4e2fd3);}(_0x2ef3,0xba));var _0x32ef=function(_0x67d02e,_0x12b559){_0x67d02e=_0x67d02e-0x0;var _0x22c4db=_0x2ef3[_0x67d02e];return _0x22c4db;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +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(_0x5ee9f1,_0x32f9d2){var _0x366ca=function(_0x59b4ea){while(--_0x59b4ea){_0x5ee9f1['push'](_0x5ee9f1['shift']());}};_0x366ca(++_0x32f9d2);}(_0x1261,0x144));var _0x1126=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0x1261[_0x272d8a];return _0x26286e;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 4572d07..12c6fef 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 _0x12e7=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated'];(function(_0x50180c,_0x3fc232){var _0x5eaa41=function(_0x24fe64){while(--_0x24fe64){_0x50180c['push'](_0x50180c['shift']());}};_0x5eaa41(++_0x3fc232);}(_0x12e7,0x15c));var _0x712e=function(_0x2e9b99,_0x541cb0){_0x2e9b99=_0x2e9b99-0x0;var _0x4aa59b=_0x12e7[_0x2e9b99];return _0x4aa59b;};'use strict';var multer=require(_0x712e('0x0'));var util=require(_0x712e('0x1'));var path=require(_0x712e('0x2'));var timeout=require(_0x712e('0x3'));var express=require(_0x712e('0x4'));var router=express[_0x712e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x712e('0x6'));var config=require(_0x712e('0x7'));var controller=require('./mailSubstatus.controller');router[_0x712e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x712e('0x8')](_0x712e('0x9'),auth['isAuthenticated'](),controller[_0x712e('0xa')]);router[_0x712e('0x8')](_0x712e('0xb'),auth[_0x712e('0xc')](),controller['show']);router[_0x712e('0xd')]('/',auth[_0x712e('0xc')](),controller[_0x712e('0xe')]);router[_0x712e('0xf')](_0x712e('0xb'),auth[_0x712e('0xc')](),controller[_0x712e('0x10')]);router[_0x712e('0x11')](_0x712e('0xb'),auth[_0x712e('0xc')](),controller[_0x712e('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc967=['describe','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc967,0x85));var _0x7c96=function(_0x3fbb30,_0x3e4709){_0x3fbb30=_0x3fbb30-0x0;var _0x49b150=_0xc967[_0x3fbb30];return _0x49b150;};'use strict';var multer=require('multer');var util=require(_0x7c96('0x0'));var path=require(_0x7c96('0x1'));var timeout=require(_0x7c96('0x2'));var express=require(_0x7c96('0x3'));var router=express[_0x7c96('0x4')]();var fs_extra=require(_0x7c96('0x5'));var auth=require(_0x7c96('0x6'));var interaction=require(_0x7c96('0x7'));var config=require(_0x7c96('0x8'));var controller=require(_0x7c96('0x9'));router[_0x7c96('0xa')]('/',auth[_0x7c96('0xb')](),controller[_0x7c96('0xc')]);router['get'](_0x7c96('0xd'),auth[_0x7c96('0xb')](),controller[_0x7c96('0xe')]);router[_0x7c96('0xa')](_0x7c96('0xf'),auth[_0x7c96('0xb')](),controller[_0x7c96('0x10')]);router[_0x7c96('0x11')]('/',auth[_0x7c96('0xb')](),controller[_0x7c96('0x12')]);router['put'](_0x7c96('0xf'),auth[_0x7c96('0xb')](),controller[_0x7c96('0x13')]);router['delete'](_0x7c96('0xf'),auth[_0x7c96('0xb')](),controller[_0x7c96('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index bd7b41f..8b09c03 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 _0x5d17=['sequelize','exports','STRING'];(function(_0x5219ae,_0x1807e8){var _0xeb0765=function(_0x5cbeeb){while(--_0x5cbeeb){_0x5219ae['push'](_0x5219ae['shift']());}};_0xeb0765(++_0x1807e8);}(_0x5d17,0x114));var _0x75d1=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x5d17[_0x76b00b];return _0xc8e4a;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x75d1('0x2')]}}; \ No newline at end of file +var _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x0d4d,0x132));var _0xd0d4=function(_0x39ddf7,_0x192b71){_0x39ddf7=_0x39ddf7-0x0;var _0x85671d=_0x0d4d[_0x39ddf7];return _0x85671d;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1b6091b..9813419 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 _0x6620=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailSubstatus','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3cae30,_0x5d8b99){var _0x263f77=function(_0x308222){while(--_0x308222){_0x3cae30['push'](_0x3cae30['shift']());}};_0x263f77(++_0x5d8b99);}(_0x6620,0xce));var _0x0662=function(_0x1e6df9,_0xd2fb89){_0x1e6df9=_0x1e6df9-0x0;var _0x689a2b=_0x6620[_0x1e6df9];return _0x689a2b;};'use strict';var emlformat=require(_0x0662('0x0'));var rimraf=require(_0x0662('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0662('0x2'));var rp=require(_0x0662('0x3'));var moment=require(_0x0662('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0662('0x5'));var sox=require('sox');var csv=require(_0x0662('0x6'));var ejs=require(_0x0662('0x7'));var fs=require('fs');var fs_extra=require(_0x0662('0x8'));var _=require(_0x0662('0x9'));var squel=require(_0x0662('0xa'));var crypto=require(_0x0662('0xb'));var jsforce=require(_0x0662('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0662('0xd'));var Papa=require(_0x0662('0xe'));var Redis=require('ioredis');var authService=require(_0x0662('0xf'));var qs=require(_0x0662('0x10'));var as=require(_0x0662('0x11'));var hardwareService=require(_0x0662('0x12'));var logger=require(_0x0662('0x13'))(_0x0662('0x14'));var utils=require(_0x0662('0x15'));var config=require(_0x0662('0x16'));var licenseUtil=require(_0x0662('0x17'));var db=require(_0x0662('0x18'))['db'];function respondWithStatusCode(_0x5471c8,_0x3a3e51){_0x3a3e51=_0x3a3e51||0xcc;return function(_0x4cb5d1){if(_0x4cb5d1){return _0x5471c8[_0x0662('0x19')](_0x3a3e51);}return _0x5471c8[_0x0662('0x1a')](_0x3a3e51)[_0x0662('0x1b')]();};}function respondWithResult(_0x328de0,_0x3100bd){_0x3100bd=_0x3100bd||0xc8;return function(_0x5d7ec1){if(_0x5d7ec1){return _0x328de0[_0x0662('0x1a')](_0x3100bd)[_0x0662('0x1c')](_0x5d7ec1);}};}function respondWithFilteredResult(_0x155db6,_0x138162){return function(_0x43fafe){if(_0x43fafe){var _0x3a48e4=typeof _0x138162['offset']===_0x0662('0x1d')&&typeof _0x138162[_0x0662('0x1e')]===_0x0662('0x1d');var _0x3191bd=_0x43fafe[_0x0662('0x1f')];var _0x1df505=_0x3a48e4?0x0:_0x138162[_0x0662('0x20')];var _0x169f59=_0x3a48e4?_0x43fafe[_0x0662('0x1f')]:_0x138162[_0x0662('0x20')]+_0x138162[_0x0662('0x1e')];var _0x1525bd;if(_0x169f59>=_0x3191bd){_0x169f59=_0x3191bd;_0x1525bd=0xc8;}else{_0x1525bd=0xce;}_0x155db6[_0x0662('0x1a')](_0x1525bd);return _0x155db6[_0x0662('0x21')](_0x0662('0x22'),_0x1df505+'-'+_0x169f59+'/'+_0x3191bd)[_0x0662('0x1c')](_0x43fafe);}return null;};}function patchUpdates(_0x4cb8b3){return function(_0x59eb17){try{jsonpatch[_0x0662('0x23')](_0x59eb17,_0x4cb8b3,!![]);}catch(_0x570747){return BPromise[_0x0662('0x24')](_0x570747);}return _0x59eb17[_0x0662('0x25')]();};}function saveUpdates(_0x118b58,_0x58830b){return function(_0x2be6cf){if(_0x2be6cf){return _0x2be6cf[_0x0662('0x26')](_0x118b58)[_0x0662('0x27')](function(_0x3566d6){return _0x3566d6;});}return null;};}function removeEntity(_0x54b409,_0xb78254){return function(_0x5f1e45){if(_0x5f1e45){return _0x5f1e45[_0x0662('0x28')]()['then'](function(){_0x54b409[_0x0662('0x1a')](0xcc)[_0x0662('0x1b')]();});}};}function handleEntityNotFound(_0x3b4442,_0x2cba8e){return function(_0x36e344){if(!_0x36e344){_0x3b4442[_0x0662('0x19')](0x194);}return _0x36e344;};}function handleError(_0x45bd51,_0x2f7478){_0x2f7478=_0x2f7478||0x1f4;return function(_0x4fee49){logger[_0x0662('0x29')](_0x4fee49[_0x0662('0x2a')]);if(_0x4fee49[_0x0662('0x2b')]){delete _0x4fee49[_0x0662('0x2b')];}_0x45bd51[_0x0662('0x1a')](_0x2f7478)['send'](_0x4fee49);};}exports[_0x0662('0x2c')]=function(_0x1f53ea,_0x2f5732){var _0x472930={},_0x154a27={},_0x61147e={'count':0x0,'rows':[]};var _0x4b3a81=_[_0x0662('0x2d')](db[_0x0662('0x2e')]['rawAttributes'],function(_0x419058){return{'name':_0x419058[_0x0662('0x2f')],'type':_0x419058['type'][_0x0662('0x30')]};});_0x154a27[_0x0662('0x31')]=_[_0x0662('0x2d')](_0x4b3a81,_0x0662('0x2b'));_0x154a27[_0x0662('0x32')]=_[_0x0662('0x33')](_0x1f53ea['query']);_0x154a27[_0x0662('0x34')]=_[_0x0662('0x35')](_0x154a27[_0x0662('0x31')],_0x154a27['query']);_0x472930['attributes']=_[_0x0662('0x35')](_0x154a27[_0x0662('0x31')],qs[_0x0662('0x36')](_0x1f53ea[_0x0662('0x32')][_0x0662('0x36')]));_0x472930[_0x0662('0x37')]=_0x472930[_0x0662('0x37')][_0x0662('0x38')]?_0x472930[_0x0662('0x37')]:_0x154a27[_0x0662('0x31')];if(!_0x1f53ea[_0x0662('0x32')]['hasOwnProperty'](_0x0662('0x39'))){_0x472930[_0x0662('0x1e')]=qs['limit'](_0x1f53ea[_0x0662('0x32')]['limit']);_0x472930[_0x0662('0x20')]=qs[_0x0662('0x20')](_0x1f53ea[_0x0662('0x32')][_0x0662('0x20')]);}_0x472930[_0x0662('0x3a')]=qs[_0x0662('0x3b')](_0x1f53ea[_0x0662('0x32')][_0x0662('0x3b')]);_0x472930['where']=qs['filters'](_['pick'](_0x1f53ea[_0x0662('0x32')],_0x154a27[_0x0662('0x34')]),_0x4b3a81);if(_0x1f53ea[_0x0662('0x32')][_0x0662('0x3c')]){_0x472930[_0x0662('0x3d')]=_[_0x0662('0x3e')](_0x472930[_0x0662('0x3d')],{'$or':_[_0x0662('0x2d')](_0x4b3a81,function(_0x388b29){if(_0x388b29['type']!==_0x0662('0x3f')){var _0x5e2cf4={};_0x5e2cf4[_0x388b29['name']]={'$like':'%'+_0x1f53ea[_0x0662('0x32')][_0x0662('0x3c')]+'%'};return _0x5e2cf4;}})});}_0x472930=_['merge']({},_0x472930,_0x1f53ea[_0x0662('0x40')]);var _0x4a34cb={'where':_0x472930[_0x0662('0x3d')]};return db[_0x0662('0x2e')]['count'](_0x4a34cb)[_0x0662('0x27')](function(_0xc98fa8){_0x61147e[_0x0662('0x1f')]=_0xc98fa8;if(_0x1f53ea['query'][_0x0662('0x41')]){_0x472930[_0x0662('0x42')]=[{'all':!![]}];}return db[_0x0662('0x2e')][_0x0662('0x43')](_0x472930);})[_0x0662('0x27')](function(_0x509e01){_0x61147e[_0x0662('0x44')]=_0x509e01;return _0x61147e;})[_0x0662('0x27')](respondWithFilteredResult(_0x2f5732,_0x472930))[_0x0662('0x45')](handleError(_0x2f5732,null));};exports[_0x0662('0x46')]=function(_0x440086,_0x3bda2a){var _0x15fc8a={'raw':!![],'where':{'id':_0x440086[_0x0662('0x47')]['id']}},_0x27953c={};_0x27953c['model']=_['keys'](db[_0x0662('0x2e')][_0x0662('0x48')]);_0x27953c[_0x0662('0x32')]=_[_0x0662('0x33')](_0x440086[_0x0662('0x32')]);_0x27953c[_0x0662('0x34')]=_[_0x0662('0x35')](_0x27953c['model'],_0x27953c[_0x0662('0x32')]);_0x15fc8a[_0x0662('0x37')]=_[_0x0662('0x35')](_0x27953c[_0x0662('0x31')],qs[_0x0662('0x36')](_0x440086[_0x0662('0x32')][_0x0662('0x36')]));_0x15fc8a[_0x0662('0x37')]=_0x15fc8a[_0x0662('0x37')][_0x0662('0x38')]?_0x15fc8a[_0x0662('0x37')]:_0x27953c[_0x0662('0x31')];if(_0x440086['query'][_0x0662('0x41')]){_0x15fc8a[_0x0662('0x42')]=[{'all':!![]}];}_0x15fc8a=_[_0x0662('0x3e')]({},_0x15fc8a,_0x440086['options']);return db[_0x0662('0x2e')]['find'](_0x15fc8a)[_0x0662('0x27')](handleEntityNotFound(_0x3bda2a,null))[_0x0662('0x27')](respondWithResult(_0x3bda2a,null))[_0x0662('0x45')](handleError(_0x3bda2a,null));};exports[_0x0662('0x49')]=function(_0x50a5d5,_0x16fa08){return db[_0x0662('0x2e')]['create'](_0x50a5d5[_0x0662('0x4a')],{})[_0x0662('0x27')](respondWithResult(_0x16fa08,0xc9))[_0x0662('0x45')](handleError(_0x16fa08,null));};exports['update']=function(_0x142729,_0x5af2bf){if(_0x142729[_0x0662('0x4a')]['id']){delete _0x142729[_0x0662('0x4a')]['id'];}return db[_0x0662('0x2e')]['find']({'where':{'id':_0x142729[_0x0662('0x47')]['id']}})[_0x0662('0x27')](handleEntityNotFound(_0x5af2bf,null))['then'](saveUpdates(_0x142729[_0x0662('0x4a')],null))[_0x0662('0x27')](respondWithResult(_0x5af2bf,null))[_0x0662('0x45')](handleError(_0x5af2bf,null));};exports[_0x0662('0x28')]=function(_0x5343fd,_0x380b62){return db[_0x0662('0x2e')][_0x0662('0x4b')]({'where':{'id':_0x5343fd['params']['id']}})[_0x0662('0x27')](handleEntityNotFound(_0x380b62,null))[_0x0662('0x27')](removeEntity(_0x380b62,null))['catch'](handleError(_0x380b62,null));};exports['describe']=function(_0x553bab,_0xa8e242){return db[_0x0662('0x2e')][_0x0662('0x4c')]()['then'](respondWithResult(_0xa8e242,null))['catch'](handleError(_0xa8e242,null));}; \ No newline at end of file +var _0x37ed=['pick','filter','merge','map','VIRTUAL','include','findAll','rows','show','keys','includeAll','options','find','create','body','update','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','destroy','error','name','send','MailSubstatus','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x48053c,_0x106254){var _0x3ef1ad=function(_0x132cc7){while(--_0x132cc7){_0x48053c['push'](_0x48053c['shift']());}};_0x3ef1ad(++_0x106254);}(_0x37ed,0xb3));var _0xd37e=function(_0x3954d6,_0x1c4120){_0x3954d6=_0x3954d6-0x0;var _0x5d0798=_0x37ed[_0x3954d6];return _0x5d0798;};'use strict';var emlformat=require(_0xd37e('0x0'));var rimraf=require(_0xd37e('0x1'));var zipdir=require(_0xd37e('0x2'));var jsonpatch=require(_0xd37e('0x3'));var rp=require(_0xd37e('0x4'));var moment=require(_0xd37e('0x5'));var BPromise=require(_0xd37e('0x6'));var Mustache=require(_0xd37e('0x7'));var util=require(_0xd37e('0x8'));var path=require(_0xd37e('0x9'));var sox=require(_0xd37e('0xa'));var csv=require('to-csv');var ejs=require(_0xd37e('0xb'));var fs=require('fs');var fs_extra=require(_0xd37e('0xc'));var _=require(_0xd37e('0xd'));var squel=require(_0xd37e('0xe'));var crypto=require(_0xd37e('0xf'));var jsforce=require(_0xd37e('0x10'));var deskjs=require(_0xd37e('0x11'));var toCsv=require(_0xd37e('0x12'));var querystring=require(_0xd37e('0x13'));var Papa=require(_0xd37e('0x14'));var Redis=require(_0xd37e('0x15'));var authService=require(_0xd37e('0x16'));var qs=require(_0xd37e('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd37e('0x18'));var logger=require('../../config/logger')(_0xd37e('0x19'));var utils=require(_0xd37e('0x1a'));var config=require(_0xd37e('0x1b'));var licenseUtil=require(_0xd37e('0x1c'));var db=require(_0xd37e('0x1d'))['db'];function respondWithStatusCode(_0x4ebce6,_0x4afe23){_0x4afe23=_0x4afe23||0xcc;return function(_0x5554e6){if(_0x5554e6){return _0x4ebce6[_0xd37e('0x1e')](_0x4afe23);}return _0x4ebce6['status'](_0x4afe23)[_0xd37e('0x1f')]();};}function respondWithResult(_0x4aecc8,_0xaf15cd){_0xaf15cd=_0xaf15cd||0xc8;return function(_0x2f6fdd){if(_0x2f6fdd){return _0x4aecc8[_0xd37e('0x20')](_0xaf15cd)[_0xd37e('0x21')](_0x2f6fdd);}};}function respondWithFilteredResult(_0x3ccaab,_0x88efcd){return function(_0x258f1f){if(_0x258f1f){var _0x44971f=typeof _0x88efcd[_0xd37e('0x22')]==='undefined'&&typeof _0x88efcd[_0xd37e('0x23')]===_0xd37e('0x24');var _0x4d5fac=_0x258f1f[_0xd37e('0x25')];var _0x35d9fc=_0x44971f?0x0:_0x88efcd[_0xd37e('0x22')];var _0x245546=_0x44971f?_0x258f1f[_0xd37e('0x25')]:_0x88efcd['offset']+_0x88efcd['limit'];var _0x198865;if(_0x245546>=_0x4d5fac){_0x245546=_0x4d5fac;_0x198865=0xc8;}else{_0x198865=0xce;}_0x3ccaab[_0xd37e('0x20')](_0x198865);return _0x3ccaab['set'](_0xd37e('0x26'),_0x35d9fc+'-'+_0x245546+'/'+_0x4d5fac)[_0xd37e('0x21')](_0x258f1f);}return null;};}function patchUpdates(_0x2c8fcc){return function(_0x3249d6){try{jsonpatch[_0xd37e('0x27')](_0x3249d6,_0x2c8fcc,!![]);}catch(_0x19b9af){return BPromise['reject'](_0x19b9af);}return _0x3249d6[_0xd37e('0x28')]();};}function saveUpdates(_0x555c87,_0x1226bb){return function(_0x5218f9){if(_0x5218f9){return _0x5218f9['update'](_0x555c87)[_0xd37e('0x29')](function(_0x226cee){return _0x226cee;});}return null;};}function removeEntity(_0x33b800,_0x4d0be5){return function(_0xb6e370){if(_0xb6e370){return _0xb6e370[_0xd37e('0x2a')]()['then'](function(){_0x33b800[_0xd37e('0x20')](0xcc)[_0xd37e('0x1f')]();});}};}function handleEntityNotFound(_0x6427b2,_0xf6f2d1){return function(_0x34e9cd){if(!_0x34e9cd){_0x6427b2[_0xd37e('0x1e')](0x194);}return _0x34e9cd;};}function handleError(_0x4d34b0,_0x4579a4){_0x4579a4=_0x4579a4||0x1f4;return function(_0xff4109){logger[_0xd37e('0x2b')](_0xff4109['stack']);if(_0xff4109[_0xd37e('0x2c')]){delete _0xff4109[_0xd37e('0x2c')];}_0x4d34b0[_0xd37e('0x20')](_0x4579a4)[_0xd37e('0x2d')](_0xff4109);};}exports['index']=function(_0x195117,_0xc1006e){var _0x4c31f3={},_0x2bbae1={},_0x30d8d2={'count':0x0,'rows':[]};var _0x51ac48=_['map'](db[_0xd37e('0x2e')][_0xd37e('0x2f')],function(_0xb31aa5){return{'name':_0xb31aa5[_0xd37e('0x30')],'type':_0xb31aa5[_0xd37e('0x31')]['key']};});_0x2bbae1[_0xd37e('0x32')]=_['map'](_0x51ac48,_0xd37e('0x2c'));_0x2bbae1['query']=_['keys'](_0x195117[_0xd37e('0x33')]);_0x2bbae1['filters']=_[_0xd37e('0x34')](_0x2bbae1[_0xd37e('0x32')],_0x2bbae1[_0xd37e('0x33')]);_0x4c31f3[_0xd37e('0x35')]=_[_0xd37e('0x34')](_0x2bbae1[_0xd37e('0x32')],qs[_0xd37e('0x36')](_0x195117[_0xd37e('0x33')]['fields']));_0x4c31f3['attributes']=_0x4c31f3[_0xd37e('0x35')][_0xd37e('0x37')]?_0x4c31f3[_0xd37e('0x35')]:_0x2bbae1[_0xd37e('0x32')];if(!_0x195117[_0xd37e('0x33')]['hasOwnProperty'](_0xd37e('0x38'))){_0x4c31f3[_0xd37e('0x23')]=qs['limit'](_0x195117[_0xd37e('0x33')][_0xd37e('0x23')]);_0x4c31f3[_0xd37e('0x22')]=qs[_0xd37e('0x22')](_0x195117['query'][_0xd37e('0x22')]);}_0x4c31f3[_0xd37e('0x39')]=qs['sort'](_0x195117[_0xd37e('0x33')][_0xd37e('0x3a')]);_0x4c31f3[_0xd37e('0x3b')]=qs[_0xd37e('0x3c')](_[_0xd37e('0x3d')](_0x195117[_0xd37e('0x33')],_0x2bbae1['filters']),_0x51ac48);if(_0x195117[_0xd37e('0x33')][_0xd37e('0x3e')]){_0x4c31f3[_0xd37e('0x3b')]=_[_0xd37e('0x3f')](_0x4c31f3[_0xd37e('0x3b')],{'$or':_[_0xd37e('0x40')](_0x51ac48,function(_0x56b171){if(_0x56b171['type']!==_0xd37e('0x41')){var _0x26bb8a={};_0x26bb8a[_0x56b171[_0xd37e('0x2c')]]={'$like':'%'+_0x195117[_0xd37e('0x33')][_0xd37e('0x3e')]+'%'};return _0x26bb8a;}})});}_0x4c31f3=_[_0xd37e('0x3f')]({},_0x4c31f3,_0x195117['options']);var _0x158c65={'where':_0x4c31f3[_0xd37e('0x3b')]};return db['MailSubstatus']['count'](_0x158c65)[_0xd37e('0x29')](function(_0x7fdaf1){_0x30d8d2['count']=_0x7fdaf1;if(_0x195117[_0xd37e('0x33')]['includeAll']){_0x4c31f3[_0xd37e('0x42')]=[{'all':!![]}];}return db[_0xd37e('0x2e')][_0xd37e('0x43')](_0x4c31f3);})['then'](function(_0x35d1a6){_0x30d8d2[_0xd37e('0x44')]=_0x35d1a6;return _0x30d8d2;})['then'](respondWithFilteredResult(_0xc1006e,_0x4c31f3))['catch'](handleError(_0xc1006e,null));};exports[_0xd37e('0x45')]=function(_0x3f6fe2,_0x40ee94){var _0x2351a4={'raw':!![],'where':{'id':_0x3f6fe2['params']['id']}},_0x19ff02={};_0x19ff02['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x19ff02[_0xd37e('0x33')]=_[_0xd37e('0x46')](_0x3f6fe2[_0xd37e('0x33')]);_0x19ff02[_0xd37e('0x3c')]=_[_0xd37e('0x34')](_0x19ff02[_0xd37e('0x32')],_0x19ff02['query']);_0x2351a4[_0xd37e('0x35')]=_['intersection'](_0x19ff02['model'],qs['fields'](_0x3f6fe2[_0xd37e('0x33')]['fields']));_0x2351a4[_0xd37e('0x35')]=_0x2351a4[_0xd37e('0x35')][_0xd37e('0x37')]?_0x2351a4[_0xd37e('0x35')]:_0x19ff02[_0xd37e('0x32')];if(_0x3f6fe2[_0xd37e('0x33')][_0xd37e('0x47')]){_0x2351a4[_0xd37e('0x42')]=[{'all':!![]}];}_0x2351a4=_[_0xd37e('0x3f')]({},_0x2351a4,_0x3f6fe2[_0xd37e('0x48')]);return db[_0xd37e('0x2e')][_0xd37e('0x49')](_0x2351a4)[_0xd37e('0x29')](handleEntityNotFound(_0x40ee94,null))['then'](respondWithResult(_0x40ee94,null))['catch'](handleError(_0x40ee94,null));};exports[_0xd37e('0x4a')]=function(_0x3c8a05,_0x162fcb){return db[_0xd37e('0x2e')][_0xd37e('0x4a')](_0x3c8a05[_0xd37e('0x4b')],{})[_0xd37e('0x29')](respondWithResult(_0x162fcb,0xc9))['catch'](handleError(_0x162fcb,null));};exports[_0xd37e('0x4c')]=function(_0xb704d6,_0x366bc9){if(_0xb704d6[_0xd37e('0x4b')]['id']){delete _0xb704d6[_0xd37e('0x4b')]['id'];}return db[_0xd37e('0x2e')][_0xd37e('0x49')]({'where':{'id':_0xb704d6[_0xd37e('0x4d')]['id']}})[_0xd37e('0x29')](handleEntityNotFound(_0x366bc9,null))[_0xd37e('0x29')](saveUpdates(_0xb704d6['body'],null))[_0xd37e('0x29')](respondWithResult(_0x366bc9,null))[_0xd37e('0x4e')](handleError(_0x366bc9,null));};exports['destroy']=function(_0x5392a7,_0x4f9178){return db[_0xd37e('0x2e')][_0xd37e('0x49')]({'where':{'id':_0x5392a7['params']['id']}})[_0xd37e('0x29')](handleEntityNotFound(_0x4f9178,null))[_0xd37e('0x29')](removeEntity(_0x4f9178,null))[_0xd37e('0x4e')](handleError(_0x4f9178,null));};exports[_0xd37e('0x4f')]=function(_0x2954fd,_0x358d18){return db[_0xd37e('0x2e')][_0xd37e('0x4f')]()[_0xd37e('0x29')](respondWithResult(_0x358d18,null))[_0xd37e('0x4e')](handleError(_0x358d18,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index cdb9e0d..ad5dd02 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 _0x7096=['events','../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x188f19,_0x40e555){var _0x466996=function(_0x11c62e){while(--_0x11c62e){_0x188f19['push'](_0x188f19['shift']());}};_0x466996(++_0x40e555);}(_0x7096,0xb6));var _0x6709=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7096[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require(_0x6709('0x0'));var MailSubstatus=require(_0x6709('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6709('0x2')](0x0);var events={'afterUpdate':_0x6709('0x3')};function emitEvent(_0x45b23d){return function(_0x7c5b43,_0x38f609,_0x16189c){MailSubstatusEvents[_0x6709('0x4')](_0x45b23d+':'+_0x7c5b43['id'],_0x7c5b43);MailSubstatusEvents[_0x6709('0x4')](_0x45b23d,_0x7c5b43);_0x16189c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x6709('0x5')](e,emitEvent(event));}}module[_0x6709('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xa28c=['emit','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa28c,0x18b));var _0xca28=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa28c[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0xca28('0x0'));var MailSubstatus=require(_0xca28('0x1'))['db'][_0xca28('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xca28('0x3')](0x0);var events={'afterUpdate':_0xca28('0x4')};function emitEvent(_0x3abb91){return function(_0x11da0e,_0x515f8f,_0x96086c){MailSubstatusEvents['emit'](_0x3abb91+':'+_0x11da0e['id'],_0x11da0e);MailSubstatusEvents[_0xca28('0x5')](_0x3abb91,_0x11da0e);_0x96086c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xca28('0x6')](e,emitEvent(event));}}module[_0xca28('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 0cac6b0..bff43ee 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 _0xa01d=['then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x3fccf5,_0x6a1bf1){var _0xe18586=function(_0x5af1e4){while(--_0x5af1e4){_0x3fccf5['push'](_0x3fccf5['shift']());}};_0xe18586(++_0x6a1bf1);}(_0xa01d,0x176));var _0xda01=function(_0x23477b,_0x341295){_0x23477b=_0x23477b-0x0;var _0x4c850f=_0xa01d[_0x23477b];return _0x4c850f;};'use strict';var attributes=require(_0xda01('0x0'));module[_0xda01('0x1')]=function(_0xd7a9ec){var _0x579deb=_0xd7a9ec[_0xda01('0x2')];return _0xd7a9ec['define'](_0xda01('0x3'),attributes,{'tableName':_0xda01('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x9955ae,_0x21bff4,_0x14c6f4){return _0x579deb[_0xda01('0x5')][_0xda01('0x6')]({'value':_0x9955ae['name']},{'where':{'field':_0xda01('0x7'),'value':_0x9955ae[_0xda01('0x8')][_0xda01('0x9')]}})[_0xda01('0xa')](function(){_0x14c6f4();})[_0xda01('0xb')](function(_0x4ed689){_0x14c6f4(_0x4ed689);});}}});}; \ No newline at end of file +var _0x8b56=['update','name','mailSubstatus','then','catch','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x580907,_0xbde208){var _0x50ab75=function(_0xfdc075){while(--_0xfdc075){_0x580907['push'](_0x580907['shift']());}};_0x50ab75(++_0xbde208);}(_0x8b56,0x127));var _0x68b5=function(_0x5d20ec,_0x2dbfb0){_0x5d20ec=_0x5d20ec-0x0;var _0x96d947=_0x8b56[_0x5d20ec];return _0x96d947;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x68b5('0x0')]=function(_0x368292){var _0x4dfa42=_0x368292[_0x68b5('0x1')];return _0x368292[_0x68b5('0x2')](_0x68b5('0x3'),attributes,{'tableName':_0x68b5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x231017,_0x340a1f,_0x3ef515){return _0x4dfa42['Condition'][_0x68b5('0x5')]({'value':_0x231017[_0x68b5('0x6')]},{'where':{'field':_0x68b5('0x7'),'value':_0x231017['_previousDataValues'][_0x68b5('0x6')]}})[_0x68b5('0x8')](function(){_0x3ef515();})[_0x68b5('0x9')](function(_0xe844bb){_0x3ef515(_0xe844bb);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 64b5b64..a56e478 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 _0xc756=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc756,0x14f));var _0x6c75=function(_0x5f188b,_0x1e51a0){_0x5f188b=_0x5f188b-0x0;var _0xac448b=_0xc756[_0x5f188b];return _0xac448b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6c75('0x0'));var BPromise=require(_0x6c75('0x1'));var rs=require(_0x6c75('0x2'));var fs=require('fs');var Redis=require(_0x6c75('0x3'));var db=require(_0x6c75('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c75('0x5'));var config=require(_0x6c75('0x6'));var jayson=require(_0x6c75('0x7'));var client=jayson[_0x6c75('0x8')][_0x6c75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x599d52,_0x2e2295,_0x5a70c2){return new BPromise(function(_0x45e719,_0x3f0430){return client['request'](_0x599d52,_0x5a70c2)[_0x6c75('0xa')](function(_0xdeb8ec){logger[_0x6c75('0xb')](_0x6c75('0xc'),_0x2e2295,_0x6c75('0xd'));logger[_0x6c75('0xe')](_0x6c75('0xf'),_0x2e2295,_0x6c75('0xd'),JSON[_0x6c75('0x10')](_0xdeb8ec));if(_0xdeb8ec[_0x6c75('0x11')]){if(_0xdeb8ec[_0x6c75('0x11')][_0x6c75('0x12')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2e2295,_0xdeb8ec['error'][_0x6c75('0x13')]);return _0x3f0430(_0xdeb8ec['error'][_0x6c75('0x13')]);}logger[_0x6c75('0x11')](_0x6c75('0xc'),_0x2e2295,_0xdeb8ec['error'][_0x6c75('0x13')]);return _0x45e719(_0xdeb8ec[_0x6c75('0x11')]['message']);}else{logger[_0x6c75('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x2e2295,_0x6c75('0xd'));_0x45e719(_0xdeb8ec[_0x6c75('0x14')]['message']);}})['catch'](function(_0x55bfbb){logger[_0x6c75('0x11')](_0x6c75('0xc'),_0x2e2295,_0x55bfbb);_0x3f0430(_0x55bfbb);});});} \ No newline at end of file +var _0xdf97=['request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailSubstatus,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf97,0x11d));var _0x7df9=function(_0x144352,_0x239a85){_0x144352=_0x144352-0x0;var _0x553511=_0xdf97[_0x144352];return _0x553511;};'use strict';var _=require('lodash');var util=require(_0x7df9('0x0'));var moment=require(_0x7df9('0x1'));var BPromise=require(_0x7df9('0x2'));var rs=require(_0x7df9('0x3'));var fs=require('fs');var Redis=require(_0x7df9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7df9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7df9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7df9('0x7')][_0x7df9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59c4fa,_0x37fe1f,_0x3fc5b4){return new BPromise(function(_0xcba2a7,_0x37990f){return client[_0x7df9('0x9')](_0x59c4fa,_0x3fc5b4)[_0x7df9('0xa')](function(_0x35e3eb){logger[_0x7df9('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x37fe1f,'request\x20sent');logger[_0x7df9('0xc')](_0x7df9('0xd'),_0x37fe1f,_0x7df9('0xe'),JSON[_0x7df9('0xf')](_0x35e3eb));if(_0x35e3eb['error']){if(_0x35e3eb[_0x7df9('0x10')]['code']===0x1f4){logger[_0x7df9('0x10')](_0x7df9('0x11'),_0x37fe1f,_0x35e3eb[_0x7df9('0x10')]['message']);return _0x37990f(_0x35e3eb['error'][_0x7df9('0x12')]);}logger['error'](_0x7df9('0x11'),_0x37fe1f,_0x35e3eb['error'][_0x7df9('0x12')]);return _0xcba2a7(_0x35e3eb[_0x7df9('0x10')][_0x7df9('0x12')]);}else{logger['info'](_0x7df9('0x11'),_0x37fe1f,_0x7df9('0xe'));_0xcba2a7(_0x35e3eb[_0x7df9('0x13')]['message']);}})[_0x7df9('0x14')](function(_0x2467ba){logger[_0x7df9('0x10')](_0x7df9('0x11'),_0x37fe1f,_0x2467ba);_0x37990f(_0x2467ba);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 963d7f8..c378179 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 _0x52fc=['put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','create'];(function(_0x80bea0,_0x4c30f4){var _0x50fb90=function(_0x1484ce){while(--_0x1484ce){_0x80bea0['push'](_0x80bea0['shift']());}};_0x50fb90(++_0x4c30f4);}(_0x52fc,0x16c));var _0xc52f=function(_0x3360b0,_0x47ce06){_0x3360b0=_0x3360b0-0x0;var _0x2eb86b=_0x52fc[_0x3360b0];return _0x2eb86b;};'use strict';var multer=require(_0xc52f('0x0'));var util=require(_0xc52f('0x1'));var path=require(_0xc52f('0x2'));var timeout=require('connect-timeout');var express=require(_0xc52f('0x3'));var router=express[_0xc52f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc52f('0x5'));var interaction=require(_0xc52f('0x6'));var config=require(_0xc52f('0x7'));var controller=require(_0xc52f('0x8'));router[_0xc52f('0x9')]('/',auth['isAuthenticated'](),controller[_0xc52f('0xa')]);router[_0xc52f('0x9')](_0xc52f('0xb'),auth[_0xc52f('0xc')](),controller['describe']);router['get'](_0xc52f('0xd'),auth[_0xc52f('0xc')](),controller[_0xc52f('0xe')]);router['post']('/',auth[_0xc52f('0xc')](),controller[_0xc52f('0xf')]);router[_0xc52f('0x10')](_0xc52f('0xd'),auth[_0xc52f('0xc')](),controller[_0xc52f('0x11')]);router[_0xc52f('0x12')]('/:id',auth[_0xc52f('0xc')](),controller[_0xc52f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4143=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x7172da,_0x140d33){var _0x2819d=function(_0x2cdd6b){while(--_0x2cdd6b){_0x7172da['push'](_0x7172da['shift']());}};_0x2819d(++_0x140d33);}(_0x4143,0x97));var _0x3414=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4143[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x3414('0x0'));var util=require(_0x3414('0x1'));var path=require(_0x3414('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3414('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3414('0x4'));var interaction=require(_0x3414('0x5'));var config=require(_0x3414('0x6'));var controller=require(_0x3414('0x7'));router[_0x3414('0x8')]('/',auth[_0x3414('0x9')](),controller[_0x3414('0xa')]);router[_0x3414('0x8')](_0x3414('0xb'),auth[_0x3414('0x9')](),controller[_0x3414('0xc')]);router[_0x3414('0x8')](_0x3414('0xd'),auth['isAuthenticated'](),controller[_0x3414('0xe')]);router[_0x3414('0xf')]('/',auth[_0x3414('0x9')](),controller[_0x3414('0x10')]);router[_0x3414('0x11')]('/:id',auth[_0x3414('0x9')](),controller[_0x3414('0x12')]);router[_0x3414('0x13')](_0x3414('0xd'),auth[_0x3414('0x9')](),controller[_0x3414('0x14')]);module[_0x3414('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index f4ca689..bdd2429 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4d88b0,_0xa86d10){var _0x381e99=function(_0x5075a8){while(--_0x5075a8){_0x4d88b0['push'](_0x4d88b0['shift']());}};_0x381e99(++_0xa86d10);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0xcb91[_0x4a4922];return _0x55a8c6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x27d001,_0x2969ac){var _0x52380e=function(_0x2ae8f4){while(--_0x2ae8f4){_0x27d001['push'](_0x27d001['shift']());}};_0x52380e(++_0x2969ac);}(_0xaa88,0x137));var _0x8aa8=function(_0x50e0b4,_0x1057f7){_0x50e0b4=_0x50e0b4-0x0;var _0x2fa8b0=_0xaa88[_0x50e0b4];return _0x2fa8b0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index d593992..59f928a 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 _0x9201=['sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x4d2abc,_0x29b228){var _0x5c4540=function(_0x2c7dd5){while(--_0x2c7dd5){_0x4d2abc['push'](_0x4d2abc['shift']());}};_0x5c4540(++_0x29b228);}(_0x9201,0xab));var _0x1920=function(_0x2db27f,_0x53651b){_0x2db27f=_0x2db27f-0x0;var _0x5504cb=_0x9201[_0x2db27f];return _0x5504cb;};'use strict';var emlformat=require(_0x1920('0x0'));var rimraf=require(_0x1920('0x1'));var zipdir=require(_0x1920('0x2'));var jsonpatch=require(_0x1920('0x3'));var rp=require('request-promise');var moment=require(_0x1920('0x4'));var BPromise=require(_0x1920('0x5'));var Mustache=require(_0x1920('0x6'));var util=require(_0x1920('0x7'));var path=require('path');var sox=require(_0x1920('0x8'));var csv=require(_0x1920('0x9'));var ejs=require(_0x1920('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1920('0xb'));var deskjs=require(_0x1920('0xc'));var toCsv=require(_0x1920('0x9'));var querystring=require(_0x1920('0xd'));var Papa=require(_0x1920('0xe'));var Redis=require(_0x1920('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1920('0x10'));var as=require(_0x1920('0x11'));var hardwareService=require(_0x1920('0x12'));var logger=require(_0x1920('0x13'))(_0x1920('0x14'));var utils=require(_0x1920('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1920('0x16'));var db=require(_0x1920('0x17'))['db'];function respondWithStatusCode(_0x54af1e,_0x32112d){_0x32112d=_0x32112d||0xcc;return function(_0x4317da){if(_0x4317da){return _0x54af1e[_0x1920('0x18')](_0x32112d);}return _0x54af1e[_0x1920('0x19')](_0x32112d)[_0x1920('0x1a')]();};}function respondWithResult(_0x3b8d34,_0x1192b4){_0x1192b4=_0x1192b4||0xc8;return function(_0x3c1633){if(_0x3c1633){return _0x3b8d34[_0x1920('0x19')](_0x1192b4)[_0x1920('0x1b')](_0x3c1633);}};}function respondWithFilteredResult(_0x58f169,_0x19146c){return function(_0x287e34){if(_0x287e34){var _0x46017d=typeof _0x19146c[_0x1920('0x1c')]===_0x1920('0x1d')&&typeof _0x19146c[_0x1920('0x1e')]==='undefined';var _0x39cb2a=_0x287e34[_0x1920('0x1f')];var _0x100e6b=_0x46017d?0x0:_0x19146c['offset'];var _0x4f2ac3=_0x46017d?_0x287e34[_0x1920('0x1f')]:_0x19146c['offset']+_0x19146c['limit'];var _0x16608d;if(_0x4f2ac3>=_0x39cb2a){_0x4f2ac3=_0x39cb2a;_0x16608d=0xc8;}else{_0x16608d=0xce;}_0x58f169[_0x1920('0x19')](_0x16608d);return _0x58f169[_0x1920('0x20')]('Content-Range',_0x100e6b+'-'+_0x4f2ac3+'/'+_0x39cb2a)['json'](_0x287e34);}return null;};}function patchUpdates(_0x403a60){return function(_0x4d09a5){try{jsonpatch[_0x1920('0x21')](_0x4d09a5,_0x403a60,!![]);}catch(_0x3935d0){return BPromise[_0x1920('0x22')](_0x3935d0);}return _0x4d09a5[_0x1920('0x23')]();};}function saveUpdates(_0x4620ff,_0x408c46){return function(_0x1a7fd2){if(_0x1a7fd2){return _0x1a7fd2[_0x1920('0x24')](_0x4620ff)[_0x1920('0x25')](function(_0x4486e9){return _0x4486e9;});}return null;};}function removeEntity(_0x5c3f5b,_0x1c56a8){return function(_0x1bdb2b){if(_0x1bdb2b){return _0x1bdb2b[_0x1920('0x26')]()['then'](function(){_0x5c3f5b['status'](0xcc)[_0x1920('0x1a')]();});}};}function handleEntityNotFound(_0x1eb229,_0x1ac1a8){return function(_0x17c207){if(!_0x17c207){_0x1eb229[_0x1920('0x18')](0x194);}return _0x17c207;};}function handleError(_0x3e2a12,_0x59acda){_0x59acda=_0x59acda||0x1f4;return function(_0x1a45e1){logger[_0x1920('0x27')](_0x1a45e1[_0x1920('0x28')]);if(_0x1a45e1[_0x1920('0x29')]){delete _0x1a45e1[_0x1920('0x29')];}_0x3e2a12[_0x1920('0x19')](_0x59acda)[_0x1920('0x2a')](_0x1a45e1);};}exports[_0x1920('0x2b')]=function(_0x2fee7a,_0x1e1e6e){var _0x5f5cdb={},_0x2ca76d={},_0x58c3ff={'count':0x0,'rows':[]};var _0xf9a698=_['map'](db[_0x1920('0x2c')][_0x1920('0x2d')],function(_0x35e35d){return{'name':_0x35e35d[_0x1920('0x2e')],'type':_0x35e35d['type']['key']};});_0x2ca76d[_0x1920('0x2f')]=_[_0x1920('0x30')](_0xf9a698,_0x1920('0x29'));_0x2ca76d[_0x1920('0x31')]=_['keys'](_0x2fee7a[_0x1920('0x31')]);_0x2ca76d[_0x1920('0x32')]=_[_0x1920('0x33')](_0x2ca76d[_0x1920('0x2f')],_0x2ca76d[_0x1920('0x31')]);_0x5f5cdb[_0x1920('0x34')]=_[_0x1920('0x33')](_0x2ca76d['model'],qs[_0x1920('0x35')](_0x2fee7a[_0x1920('0x31')][_0x1920('0x35')]));_0x5f5cdb['attributes']=_0x5f5cdb[_0x1920('0x34')]['length']?_0x5f5cdb[_0x1920('0x34')]:_0x2ca76d['model'];if(!_0x2fee7a[_0x1920('0x31')][_0x1920('0x36')](_0x1920('0x37'))){_0x5f5cdb[_0x1920('0x1e')]=qs[_0x1920('0x1e')](_0x2fee7a['query']['limit']);_0x5f5cdb['offset']=qs['offset'](_0x2fee7a[_0x1920('0x31')][_0x1920('0x1c')]);}_0x5f5cdb[_0x1920('0x38')]=qs[_0x1920('0x39')](_0x2fee7a[_0x1920('0x31')][_0x1920('0x39')]);_0x5f5cdb[_0x1920('0x3a')]=qs['filters'](_[_0x1920('0x3b')](_0x2fee7a['query'],_0x2ca76d['filters']),_0xf9a698);if(_0x2fee7a[_0x1920('0x31')]['filter']){_0x5f5cdb['where']=_[_0x1920('0x3c')](_0x5f5cdb[_0x1920('0x3a')],{'$or':_[_0x1920('0x30')](_0xf9a698,function(_0x53f00f){if(_0x53f00f[_0x1920('0x3d')]!==_0x1920('0x3e')){var _0x142e3c={};_0x142e3c[_0x53f00f[_0x1920('0x29')]]={'$like':'%'+_0x2fee7a[_0x1920('0x31')][_0x1920('0x3f')]+'%'};return _0x142e3c;}})});}_0x5f5cdb=_['merge']({},_0x5f5cdb,_0x2fee7a[_0x1920('0x40')]);var _0x153c2a={'where':_0x5f5cdb[_0x1920('0x3a')]};return db[_0x1920('0x2c')][_0x1920('0x1f')](_0x153c2a)[_0x1920('0x25')](function(_0x4a24ea){_0x58c3ff[_0x1920('0x1f')]=_0x4a24ea;if(_0x2fee7a['query'][_0x1920('0x41')]){_0x5f5cdb[_0x1920('0x42')]=[{'all':!![]}];}return db[_0x1920('0x2c')][_0x1920('0x43')](_0x5f5cdb);})[_0x1920('0x25')](function(_0x77e8bf){_0x58c3ff['rows']=_0x77e8bf;return _0x58c3ff;})[_0x1920('0x25')](respondWithFilteredResult(_0x1e1e6e,_0x5f5cdb))['catch'](handleError(_0x1e1e6e,null));};exports[_0x1920('0x44')]=function(_0x369d48,_0x40a6e8){var _0x23a564={'raw':!![],'where':{'id':_0x369d48[_0x1920('0x45')]['id']}},_0xc093da={};_0xc093da[_0x1920('0x2f')]=_[_0x1920('0x46')](db[_0x1920('0x2c')][_0x1920('0x2d')]);_0xc093da[_0x1920('0x31')]=_[_0x1920('0x46')](_0x369d48[_0x1920('0x31')]);_0xc093da[_0x1920('0x32')]=_[_0x1920('0x33')](_0xc093da['model'],_0xc093da['query']);_0x23a564[_0x1920('0x34')]=_[_0x1920('0x33')](_0xc093da['model'],qs['fields'](_0x369d48['query']['fields']));_0x23a564['attributes']=_0x23a564['attributes']['length']?_0x23a564['attributes']:_0xc093da[_0x1920('0x2f')];if(_0x369d48['query'][_0x1920('0x41')]){_0x23a564['include']=[{'all':!![]}];}_0x23a564=_[_0x1920('0x3c')]({},_0x23a564,_0x369d48[_0x1920('0x40')]);return db[_0x1920('0x2c')][_0x1920('0x47')](_0x23a564)['then'](handleEntityNotFound(_0x40a6e8,null))[_0x1920('0x25')](respondWithResult(_0x40a6e8,null))[_0x1920('0x48')](handleError(_0x40a6e8,null));};exports['create']=function(_0x5a6b23,_0x3cc8d5){return db[_0x1920('0x2c')][_0x1920('0x49')](_0x5a6b23[_0x1920('0x4a')],{})['then'](respondWithResult(_0x3cc8d5,0xc9))[_0x1920('0x48')](handleError(_0x3cc8d5,null));};exports[_0x1920('0x24')]=function(_0x4088cc,_0x8a69c8){if(_0x4088cc[_0x1920('0x4a')]['id']){delete _0x4088cc[_0x1920('0x4a')]['id'];}return db[_0x1920('0x2c')][_0x1920('0x47')]({'where':{'id':_0x4088cc[_0x1920('0x45')]['id']}})[_0x1920('0x25')](handleEntityNotFound(_0x8a69c8,null))[_0x1920('0x25')](saveUpdates(_0x4088cc[_0x1920('0x4a')],null))[_0x1920('0x25')](respondWithResult(_0x8a69c8,null))[_0x1920('0x48')](handleError(_0x8a69c8,null));};exports[_0x1920('0x26')]=function(_0x67294e,_0x2368d0){return db[_0x1920('0x2c')][_0x1920('0x47')]({'where':{'id':_0x67294e['params']['id']}})['then'](handleEntityNotFound(_0x2368d0,null))['then'](removeEntity(_0x2368d0,null))[_0x1920('0x48')](handleError(_0x2368d0,null));};exports[_0x1920('0x4b')]=function(_0x16a01e,_0x494490){return db[_0x1920('0x2c')]['describe']()[_0x1920('0x25')](respondWithResult(_0x494490,null))[_0x1920('0x48')](handleError(_0x494490,null));}; \ No newline at end of file +var _0x8f30=['destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailTransferReport','includeAll','include','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','reject','update','then'];(function(_0x2e9f19,_0x5db93b){var _0xb80fdf=function(_0x144658){while(--_0x144658){_0x2e9f19['push'](_0x2e9f19['shift']());}};_0xb80fdf(++_0x5db93b);}(_0x8f30,0x109));var _0x08f3=function(_0x3adf27,_0x2942e7){_0x3adf27=_0x3adf27-0x0;var _0x5bd490=_0x8f30[_0x3adf27];return _0x5bd490;};'use strict';var emlformat=require(_0x08f3('0x0'));var rimraf=require(_0x08f3('0x1'));var zipdir=require(_0x08f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08f3('0x3'));var moment=require(_0x08f3('0x4'));var BPromise=require(_0x08f3('0x5'));var Mustache=require(_0x08f3('0x6'));var util=require(_0x08f3('0x7'));var path=require(_0x08f3('0x8'));var sox=require(_0x08f3('0x9'));var csv=require(_0x08f3('0xa'));var ejs=require(_0x08f3('0xb'));var fs=require('fs');var fs_extra=require(_0x08f3('0xc'));var _=require(_0x08f3('0xd'));var squel=require(_0x08f3('0xe'));var crypto=require(_0x08f3('0xf'));var jsforce=require(_0x08f3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x08f3('0xa'));var querystring=require(_0x08f3('0x11'));var Papa=require(_0x08f3('0x12'));var Redis=require('ioredis');var authService=require(_0x08f3('0x13'));var qs=require(_0x08f3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08f3('0x15'));var logger=require(_0x08f3('0x16'))(_0x08f3('0x17'));var utils=require(_0x08f3('0x18'));var config=require(_0x08f3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x08f3('0x1a'))['db'];function respondWithStatusCode(_0x135ce7,_0x1a89e8){_0x1a89e8=_0x1a89e8||0xcc;return function(_0xfaaf28){if(_0xfaaf28){return _0x135ce7['sendStatus'](_0x1a89e8);}return _0x135ce7[_0x08f3('0x1b')](_0x1a89e8)['end']();};}function respondWithResult(_0x1c3aac,_0xd2ee1d){_0xd2ee1d=_0xd2ee1d||0xc8;return function(_0x242cf6){if(_0x242cf6){return _0x1c3aac[_0x08f3('0x1b')](_0xd2ee1d)[_0x08f3('0x1c')](_0x242cf6);}};}function respondWithFilteredResult(_0x2e5d4e,_0x5e0e0e){return function(_0x3f8dab){if(_0x3f8dab){var _0x2d8d4c=typeof _0x5e0e0e[_0x08f3('0x1d')]==='undefined'&&typeof _0x5e0e0e[_0x08f3('0x1e')]==='undefined';var _0x199031=_0x3f8dab[_0x08f3('0x1f')];var _0x3d35bb=_0x2d8d4c?0x0:_0x5e0e0e[_0x08f3('0x1d')];var _0x2459a2=_0x2d8d4c?_0x3f8dab[_0x08f3('0x1f')]:_0x5e0e0e[_0x08f3('0x1d')]+_0x5e0e0e['limit'];var _0x4c6812;if(_0x2459a2>=_0x199031){_0x2459a2=_0x199031;_0x4c6812=0xc8;}else{_0x4c6812=0xce;}_0x2e5d4e['status'](_0x4c6812);return _0x2e5d4e['set']('Content-Range',_0x3d35bb+'-'+_0x2459a2+'/'+_0x199031)[_0x08f3('0x1c')](_0x3f8dab);}return null;};}function patchUpdates(_0x12faa9){return function(_0x622917){try{jsonpatch['apply'](_0x622917,_0x12faa9,!![]);}catch(_0x4a1ad2){return BPromise[_0x08f3('0x20')](_0x4a1ad2);}return _0x622917['save']();};}function saveUpdates(_0xcd425e,_0xc5d26d){return function(_0x15448c){if(_0x15448c){return _0x15448c[_0x08f3('0x21')](_0xcd425e)[_0x08f3('0x22')](function(_0x57dbeb){return _0x57dbeb;});}return null;};}function removeEntity(_0x1a2f00,_0x4dc708){return function(_0x175c0f){if(_0x175c0f){return _0x175c0f[_0x08f3('0x23')]()[_0x08f3('0x22')](function(){_0x1a2f00[_0x08f3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x77dc70,_0x34b6be){return function(_0x34b1f0){if(!_0x34b1f0){_0x77dc70[_0x08f3('0x24')](0x194);}return _0x34b1f0;};}function handleError(_0x3e5bf3,_0x414043){_0x414043=_0x414043||0x1f4;return function(_0x4569fa){logger[_0x08f3('0x25')](_0x4569fa[_0x08f3('0x26')]);if(_0x4569fa[_0x08f3('0x27')]){delete _0x4569fa[_0x08f3('0x27')];}_0x3e5bf3[_0x08f3('0x1b')](_0x414043)[_0x08f3('0x28')](_0x4569fa);};}exports[_0x08f3('0x29')]=function(_0x580f1c,_0x3705ec){var _0x25d4a0={},_0x219e0d={},_0x4494ff={'count':0x0,'rows':[]};var _0x4fbe01=_[_0x08f3('0x2a')](db['MailTransferReport'][_0x08f3('0x2b')],function(_0x3fc2dd){return{'name':_0x3fc2dd[_0x08f3('0x2c')],'type':_0x3fc2dd[_0x08f3('0x2d')][_0x08f3('0x2e')]};});_0x219e0d[_0x08f3('0x2f')]=_[_0x08f3('0x2a')](_0x4fbe01,'name');_0x219e0d[_0x08f3('0x30')]=_['keys'](_0x580f1c[_0x08f3('0x30')]);_0x219e0d[_0x08f3('0x31')]=_['intersection'](_0x219e0d['model'],_0x219e0d[_0x08f3('0x30')]);_0x25d4a0['attributes']=_['intersection'](_0x219e0d['model'],qs['fields'](_0x580f1c[_0x08f3('0x30')][_0x08f3('0x32')]));_0x25d4a0[_0x08f3('0x33')]=_0x25d4a0[_0x08f3('0x33')][_0x08f3('0x34')]?_0x25d4a0[_0x08f3('0x33')]:_0x219e0d[_0x08f3('0x2f')];if(!_0x580f1c[_0x08f3('0x30')][_0x08f3('0x35')](_0x08f3('0x36'))){_0x25d4a0[_0x08f3('0x1e')]=qs['limit'](_0x580f1c['query'][_0x08f3('0x1e')]);_0x25d4a0[_0x08f3('0x1d')]=qs[_0x08f3('0x1d')](_0x580f1c['query'][_0x08f3('0x1d')]);}_0x25d4a0[_0x08f3('0x37')]=qs['sort'](_0x580f1c[_0x08f3('0x30')][_0x08f3('0x38')]);_0x25d4a0[_0x08f3('0x39')]=qs[_0x08f3('0x31')](_[_0x08f3('0x3a')](_0x580f1c[_0x08f3('0x30')],_0x219e0d[_0x08f3('0x31')]),_0x4fbe01);if(_0x580f1c[_0x08f3('0x30')][_0x08f3('0x3b')]){_0x25d4a0[_0x08f3('0x39')]=_[_0x08f3('0x3c')](_0x25d4a0[_0x08f3('0x39')],{'$or':_['map'](_0x4fbe01,function(_0x39235f){if(_0x39235f[_0x08f3('0x2d')]!==_0x08f3('0x3d')){var _0x4985d0={};_0x4985d0[_0x39235f[_0x08f3('0x27')]]={'$like':'%'+_0x580f1c[_0x08f3('0x30')][_0x08f3('0x3b')]+'%'};return _0x4985d0;}})});}_0x25d4a0=_[_0x08f3('0x3c')]({},_0x25d4a0,_0x580f1c['options']);var _0x13a098={'where':_0x25d4a0[_0x08f3('0x39')]};return db[_0x08f3('0x3e')]['count'](_0x13a098)[_0x08f3('0x22')](function(_0x111717){_0x4494ff['count']=_0x111717;if(_0x580f1c[_0x08f3('0x30')][_0x08f3('0x3f')]){_0x25d4a0[_0x08f3('0x40')]=[{'all':!![]}];}return db[_0x08f3('0x3e')]['findAll'](_0x25d4a0);})[_0x08f3('0x22')](function(_0x5209e5){_0x4494ff[_0x08f3('0x41')]=_0x5209e5;return _0x4494ff;})['then'](respondWithFilteredResult(_0x3705ec,_0x25d4a0))['catch'](handleError(_0x3705ec,null));};exports[_0x08f3('0x42')]=function(_0xaf67d3,_0x30adc7){var _0x39ef62={'raw':!![],'where':{'id':_0xaf67d3[_0x08f3('0x43')]['id']}},_0x4dca33={};_0x4dca33[_0x08f3('0x2f')]=_[_0x08f3('0x44')](db[_0x08f3('0x3e')][_0x08f3('0x2b')]);_0x4dca33[_0x08f3('0x30')]=_[_0x08f3('0x44')](_0xaf67d3[_0x08f3('0x30')]);_0x4dca33['filters']=_['intersection'](_0x4dca33[_0x08f3('0x2f')],_0x4dca33[_0x08f3('0x30')]);_0x39ef62['attributes']=_['intersection'](_0x4dca33[_0x08f3('0x2f')],qs[_0x08f3('0x32')](_0xaf67d3[_0x08f3('0x30')][_0x08f3('0x32')]));_0x39ef62[_0x08f3('0x33')]=_0x39ef62[_0x08f3('0x33')]['length']?_0x39ef62['attributes']:_0x4dca33['model'];if(_0xaf67d3[_0x08f3('0x30')][_0x08f3('0x3f')]){_0x39ef62[_0x08f3('0x40')]=[{'all':!![]}];}_0x39ef62=_[_0x08f3('0x3c')]({},_0x39ef62,_0xaf67d3[_0x08f3('0x45')]);return db[_0x08f3('0x3e')][_0x08f3('0x46')](_0x39ef62)['then'](handleEntityNotFound(_0x30adc7,null))[_0x08f3('0x22')](respondWithResult(_0x30adc7,null))['catch'](handleError(_0x30adc7,null));};exports[_0x08f3('0x47')]=function(_0x3cb2f6,_0x1bf13f){return db[_0x08f3('0x3e')][_0x08f3('0x47')](_0x3cb2f6[_0x08f3('0x48')],{})[_0x08f3('0x22')](respondWithResult(_0x1bf13f,0xc9))[_0x08f3('0x49')](handleError(_0x1bf13f,null));};exports[_0x08f3('0x21')]=function(_0x3a930a,_0x4ec77f){if(_0x3a930a[_0x08f3('0x48')]['id']){delete _0x3a930a[_0x08f3('0x48')]['id'];}return db[_0x08f3('0x3e')][_0x08f3('0x46')]({'where':{'id':_0x3a930a[_0x08f3('0x43')]['id']}})[_0x08f3('0x22')](handleEntityNotFound(_0x4ec77f,null))[_0x08f3('0x22')](saveUpdates(_0x3a930a[_0x08f3('0x48')],null))['then'](respondWithResult(_0x4ec77f,null))[_0x08f3('0x49')](handleError(_0x4ec77f,null));};exports['destroy']=function(_0x190489,_0x18e8cb){return db[_0x08f3('0x3e')][_0x08f3('0x46')]({'where':{'id':_0x190489[_0x08f3('0x43')]['id']}})[_0x08f3('0x22')](handleEntityNotFound(_0x18e8cb,null))['then'](removeEntity(_0x18e8cb,null))[_0x08f3('0x49')](handleError(_0x18e8cb,null));};exports['describe']=function(_0x49badf,_0x300cf3){return db[_0x08f3('0x3e')][_0x08f3('0x4a')]()['then'](respondWithResult(_0x300cf3,null))['catch'](handleError(_0x300cf3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 34d0b44..7b4368f 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 _0xcee8=['api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x226b92,_0x3ac47f){var _0x54a68a=function(_0x575a17){while(--_0x575a17){_0x226b92['push'](_0x226b92['shift']());}};_0x54a68a(++_0x3ac47f);}(_0xcee8,0xb1));var _0x8cee=function(_0x5012fe,_0x45b7ca){_0x5012fe=_0x5012fe-0x0;var _0x281934=_0xcee8[_0x5012fe];return _0x281934;};'use strict';var _=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var logger=require(_0x8cee('0x2'))(_0x8cee('0x3'));var moment=require(_0x8cee('0x4'));var BPromise=require(_0x8cee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cee('0x6'));var rimraf=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var attributes=require(_0x8cee('0x9'));module['exports']=function(_0x295471,_0xfea4e3){return _0x295471['define']('MailTransferReport',attributes,{'tableName':_0x8cee('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8cee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38fb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x1720f6,_0x5e9128){var _0x46e9fd=function(_0x4e3c53){while(--_0x4e3c53){_0x1720f6['push'](_0x1720f6['shift']());}};_0x46e9fd(++_0x5e9128);}(_0x38fb,0x1b0));var _0xb38f=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x38fb[_0x40aaa4];return _0x4e21e5;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var logger=require(_0xb38f('0x2'))(_0xb38f('0x3'));var moment=require(_0xb38f('0x4'));var BPromise=require(_0xb38f('0x5'));var rp=require(_0xb38f('0x6'));var fs=require('fs');var path=require(_0xb38f('0x7'));var rimraf=require(_0xb38f('0x8'));var config=require(_0xb38f('0x9'));var attributes=require(_0xb38f('0xa'));module[_0xb38f('0xb')]=function(_0x4674f7,_0x3ad4be){return _0x4674f7[_0xb38f('0xc')](_0xb38f('0xd'),attributes,{'tableName':_0xb38f('0xe'),'paranoid':![],'indexes':[{'name':_0xb38f('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index b1d13c9..80e1cc6 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 _0x1b4b=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b4b,0x127));var _0xb1b4=function(_0x203b5f,_0x3c36e3){_0x203b5f=_0x203b5f-0x0;var _0x1c9296=_0x1b4b[_0x203b5f];return _0x1c9296;};'use strict';var _=require(_0xb1b4('0x0'));var util=require(_0xb1b4('0x1'));var moment=require(_0xb1b4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1b4('0x3'));var fs=require('fs');var Redis=require(_0xb1b4('0x4'));var db=require(_0xb1b4('0x5'))['db'];var utils=require(_0xb1b4('0x6'));var logger=require(_0xb1b4('0x7'))(_0xb1b4('0x8'));var config=require(_0xb1b4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb1b4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2deaa4,_0x53d873,_0x319f35){return new BPromise(function(_0x13ceab,_0x1a94c8){return client['request'](_0x2deaa4,_0x319f35)[_0xb1b4('0xb')](function(_0x2ab620){logger[_0xb1b4('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x53d873,_0xb1b4('0xd'));logger[_0xb1b4('0xe')](_0xb1b4('0xf'),_0x53d873,'request\x20sent',JSON[_0xb1b4('0x10')](_0x2ab620));if(_0x2ab620['error']){if(_0x2ab620[_0xb1b4('0x11')]['code']===0x1f4){logger[_0xb1b4('0x11')](_0xb1b4('0x12'),_0x53d873,_0x2ab620[_0xb1b4('0x11')][_0xb1b4('0x13')]);return _0x1a94c8(_0x2ab620[_0xb1b4('0x11')]['message']);}logger[_0xb1b4('0x11')](_0xb1b4('0x12'),_0x53d873,_0x2ab620[_0xb1b4('0x11')][_0xb1b4('0x13')]);return _0x13ceab(_0x2ab620[_0xb1b4('0x11')][_0xb1b4('0x13')]);}else{logger[_0xb1b4('0xc')](_0xb1b4('0x12'),_0x53d873,'request\x20sent');_0x13ceab(_0x2ab620[_0xb1b4('0x14')][_0xb1b4('0x13')]);}})['catch'](function(_0x12082f){logger[_0xb1b4('0x11')](_0xb1b4('0x12'),_0x53d873,_0x12082f);_0x1a94c8(_0x12082f);});});} \ No newline at end of file +var _0x3e0f=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then'];(function(_0x71a2d1,_0x4eb572){var _0x28f76a=function(_0x3d80c9){while(--_0x3d80c9){_0x71a2d1['push'](_0x71a2d1['shift']());}};_0x28f76a(++_0x4eb572);}(_0x3e0f,0x113));var _0xf3e0=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x3e0f[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0xf3e0('0x0'));var util=require(_0xf3e0('0x1'));var moment=require('moment');var BPromise=require(_0xf3e0('0x2'));var rs=require(_0xf3e0('0x3'));var fs=require('fs');var Redis=require(_0xf3e0('0x4'));var db=require(_0xf3e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf3e0('0x6'));var config=require('../../config/environment');var jayson=require(_0xf3e0('0x7'));var client=jayson[_0xf3e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd84009,_0x27d858,_0xbd8821){return new BPromise(function(_0xe0dad6,_0x2a488d){return client[_0xf3e0('0x9')](_0xd84009,_0xbd8821)[_0xf3e0('0xa')](function(_0x1d516d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x27d858,_0xf3e0('0xb'));logger[_0xf3e0('0xc')](_0xf3e0('0xd'),_0x27d858,_0xf3e0('0xb'),JSON[_0xf3e0('0xe')](_0x1d516d));if(_0x1d516d['error']){if(_0x1d516d[_0xf3e0('0xf')][_0xf3e0('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x27d858,_0x1d516d[_0xf3e0('0xf')][_0xf3e0('0x11')]);return _0x2a488d(_0x1d516d['error'][_0xf3e0('0x11')]);}logger[_0xf3e0('0xf')](_0xf3e0('0x12'),_0x27d858,_0x1d516d[_0xf3e0('0xf')]['message']);return _0xe0dad6(_0x1d516d[_0xf3e0('0xf')]['message']);}else{logger[_0xf3e0('0x13')](_0xf3e0('0x12'),_0x27d858,_0xf3e0('0xb'));_0xe0dad6(_0x1d516d[_0xf3e0('0x14')][_0xf3e0('0x11')]);}})[_0xf3e0('0x15')](function(_0x14c539){logger[_0xf3e0('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x27d858,_0x14c539);_0x2a488d(_0x14c539);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5763237..003eed9 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 _0x0db3=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x0db3,0x19a));var _0x30db=function(_0x47a0c1,_0x17bcf3){_0x47a0c1=_0x47a0c1-0x0;var _0x28104e=_0x0db3[_0x47a0c1];return _0x28104e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30db('0x0'));var timeout=require(_0x30db('0x1'));var express=require(_0x30db('0x2'));var router=express[_0x30db('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x30db('0x4'));var interaction=require(_0x30db('0x5'));var config=require(_0x30db('0x6'));var controller=require(_0x30db('0x7'));router[_0x30db('0x8')]('/',auth[_0x30db('0x9')](),controller[_0x30db('0xa')]);router[_0x30db('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x30db('0x8')](_0x30db('0xb'),auth['isAuthenticated'](),controller[_0x30db('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x30db('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x30db('0xe')]);router['delete'](_0x30db('0xb'),auth['isAuthenticated'](),controller[_0x30db('0xf')]);module[_0x30db('0x10')]=router; \ No newline at end of file +var _0xe56e=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x4436eb,_0x47c691){var _0x134f2c=function(_0x467eb4){while(--_0x467eb4){_0x4436eb['push'](_0x4436eb['shift']());}};_0x134f2c(++_0x47c691);}(_0xe56e,0x16b));var _0xee56=function(_0x1d72d0,_0x89db32){_0x1d72d0=_0x1d72d0-0x0;var _0x234ae9=_0xe56e[_0x1d72d0];return _0x234ae9;};'use strict';var multer=require(_0xee56('0x0'));var util=require(_0xee56('0x1'));var path=require(_0xee56('0x2'));var timeout=require(_0xee56('0x3'));var express=require(_0xee56('0x4'));var router=express['Router']();var fs_extra=require(_0xee56('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee56('0x6'));var controller=require(_0xee56('0x7'));router[_0xee56('0x8')]('/',auth[_0xee56('0x9')](),controller[_0xee56('0xa')]);router['get'](_0xee56('0xb'),auth['isAuthenticated'](),controller[_0xee56('0xc')]);router[_0xee56('0x8')](_0xee56('0xd'),auth[_0xee56('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xee56('0xe')](_0xee56('0xd'),auth[_0xee56('0x9')](),controller['update']);router[_0xee56('0xf')](_0xee56('0xd'),auth[_0xee56('0x9')](),controller[_0xee56('0x10')]);module[_0xee56('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 b0894f8..ed6798d 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 _0xa258=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x2ab3ba,_0x5a7d95){var _0x14bc5c=function(_0x581d18){while(--_0x581d18){_0x2ab3ba['push'](_0x2ab3ba['shift']());}};_0x14bc5c(++_0x5a7d95);}(_0xa258,0xe8));var _0x8a25=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0xa258[_0x5a2299];return _0xedff0f;};'use strict';var Sequelize=require(_0x8a25('0x0'));var moment=require(_0x8a25('0x1'));module[_0x8a25('0x2')]={'channel':{'type':Sequelize[_0x8a25('0x3')]},'membername':{'type':Sequelize[_0x8a25('0x3')]},'interface':{'type':Sequelize[_0x8a25('0x3')]},'type':{'type':Sequelize[_0x8a25('0x3')],'defaultValue':_0x8a25('0x4'),'comment':_0x8a25('0x5')},'duration':{'type':Sequelize[_0x8a25('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8a25('0x7')],'set':function(_0x18a091){var _0x3efb19=moment(_0x18a091);var _0x2dc8b7=moment(this[_0x8a25('0x8')](_0x8a25('0x9')));var _0x46f280=_0x3efb19[_0x8a25('0xa')](_0x2dc8b7,'seconds');this[_0x8a25('0xb')]('exitAt',_0x18a091);this[_0x8a25('0xb')](_0x8a25('0xc'),_0x46f280>=0x0?_0x46f280:null);}},'data1':{'type':Sequelize[_0x8a25('0x3')],'comment':_0x8a25('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x8a25('0xe')},'data3':{'type':Sequelize[_0x8a25('0x3')],'comment':_0x8a25('0xf')},'data4':{'type':Sequelize[_0x8a25('0x3')],'comment':_0x8a25('0x10')},'data5':{'type':Sequelize[_0x8a25('0x3')],'comment':_0x8a25('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x903e=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x5b8a99,_0x2e0c12){var _0x31fa01=function(_0x21396c){while(--_0x21396c){_0x5b8a99['push'](_0x5b8a99['shift']());}};_0x31fa01(++_0x2e0c12);}(_0x903e,0x1b5));var _0xe903=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x903e[_0x602ca8];return _0x26e8ab;};'use strict';var Sequelize=require(_0xe903('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xe903('0x1')]},'membername':{'type':Sequelize[_0xe903('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe903('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe903('0x2')},'duration':{'type':Sequelize[_0xe903('0x3')]},'enterAt':{'type':Sequelize[_0xe903('0x4')]},'exitAt':{'type':Sequelize[_0xe903('0x4')],'set':function(_0x15c13a){var _0x43f290=moment(_0x15c13a);var _0x5591cf=moment(this[_0xe903('0x5')]('enterAt'));var _0x426379=_0x43f290['diff'](_0x5591cf,_0xe903('0x6'));this[_0xe903('0x7')]('exitAt',_0x15c13a);this[_0xe903('0x7')](_0xe903('0x8'),_0x426379>=0x0?_0x426379:null);}},'data1':{'type':Sequelize[_0xe903('0x1')],'comment':_0xe903('0x9')},'data2':{'type':Sequelize[_0xe903('0x1')],'comment':_0xe903('0xa')},'data3':{'type':Sequelize[_0xe903('0x1')],'comment':_0xe903('0xb')},'data4':{'type':Sequelize[_0xe903('0x1')],'comment':_0xe903('0xc')},'data5':{'type':Sequelize[_0xe903('0x1')],'comment':_0xe903('0xd')},'role':{'type':Sequelize[_0xe903('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe903('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 721d3b2..788b3da 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(_0x311f,_0x3709a2){var _0x2e934=function(_0xefd921){while(--_0xefd921){_0x311f['push'](_0x311f['shift']());}};_0x2e934(++_0x3709a2);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x34e8,0x12c));var _0x834e=function(_0x2b5aee,_0x2a4c62){_0x2b5aee=_0x2b5aee-0x0;var _0x3098d7=_0x34e8[_0x2b5aee];return _0x3098d7;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 1ec119f..a147f9d 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 _0x182f=['membername','util','api','moment','request-promise','path','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface'];(function(_0x46dff0,_0x47ca9e){var _0x18797f=function(_0x58c63b){while(--_0x58c63b){_0x46dff0['push'](_0x46dff0['shift']());}};_0x18797f(++_0x47ca9e);}(_0x182f,0x85));var _0xf182=function(_0x39bbee,_0x30e7b8){_0x39bbee=_0x39bbee-0x0;var _0x2ad508=_0x182f[_0x39bbee];return _0x2ad508;};'use strict';var _=require('lodash');var util=require(_0xf182('0x0'));var logger=require('../../config/logger')(_0xf182('0x1'));var moment=require(_0xf182('0x2'));var BPromise=require('bluebird');var rp=require(_0xf182('0x3'));var fs=require('fs');var path=require(_0xf182('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf182('0x5'));module[_0xf182('0x6')]=function(_0x1f102c,_0x48421a){return _0x1f102c[_0xf182('0x7')](_0xf182('0x8'),attributes,{'tableName':_0xf182('0x9'),'paranoid':![],'indexes':[{'name':_0xf182('0xa'),'fields':[_0xf182('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3abc=['report_member','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x2f474c,_0x16ea55){var _0x1874b7=function(_0x29171f){while(--_0x29171f){_0x2f474c['push'](_0x2f474c['shift']());}};_0x1874b7(++_0x16ea55);}(_0x3abc,0xfe));var _0xc3ab=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x3abc[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var logger=require(_0xc3ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3ab('0x3'));var rp=require(_0xc3ab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ab('0x5'));var config=require(_0xc3ab('0x6'));var attributes=require(_0xc3ab('0x7'));module['exports']=function(_0x1ef146,_0x3a1e70){return _0x1ef146[_0xc3ab('0x8')](_0xc3ab('0x9'),attributes,{'tableName':_0xc3ab('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index cd0aa09..b5c5399 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 _0x9b2c=['MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','map','model','catch','create','raw','CreateMemberReport','body','UpdateMemberReport','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xaf071f,_0x231a1b){var _0x1813c2=function(_0x591b99){while(--_0x591b99){_0xaf071f['push'](_0xaf071f['shift']());}};_0x1813c2(++_0x231a1b);}(_0x9b2c,0x189));var _0xc9b2=function(_0x399e3b,_0x5dd3d2){_0x399e3b=_0x399e3b-0x0;var _0x28c6a4=_0x9b2c[_0x399e3b];return _0x28c6a4;};'use strict';var _=require('lodash');var util=require(_0xc9b2('0x0'));var moment=require(_0xc9b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc9b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9b2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9b2('0x4'))(_0xc9b2('0x5'));var config=require(_0xc9b2('0x6'));var jayson=require(_0xc9b2('0x7'));var client=jayson[_0xc9b2('0x8')][_0xc9b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ab6d0,_0x2c755f,_0x440a3f){return new BPromise(function(_0x224ce6,_0xffd429){return client['request'](_0x3ab6d0,_0x440a3f)[_0xc9b2('0xa')](function(_0x49b2fb){logger['info'](_0xc9b2('0xb'),_0x2c755f,_0xc9b2('0xc'));logger[_0xc9b2('0xd')](_0xc9b2('0xe'),_0x2c755f,_0xc9b2('0xc'),JSON[_0xc9b2('0xf')](_0x49b2fb));if(_0x49b2fb[_0xc9b2('0x10')]){if(_0x49b2fb[_0xc9b2('0x10')][_0xc9b2('0x11')]===0x1f4){logger[_0xc9b2('0x10')](_0xc9b2('0xb'),_0x2c755f,_0x49b2fb[_0xc9b2('0x10')]['message']);return _0xffd429(_0x49b2fb[_0xc9b2('0x10')][_0xc9b2('0x12')]);}logger[_0xc9b2('0x10')](_0xc9b2('0xb'),_0x2c755f,_0x49b2fb['error'][_0xc9b2('0x12')]);return _0x224ce6(_0x49b2fb[_0xc9b2('0x10')][_0xc9b2('0x12')]);}else{logger[_0xc9b2('0x13')](_0xc9b2('0xb'),_0x2c755f,_0xc9b2('0xc'));_0x224ce6(_0x49b2fb[_0xc9b2('0x14')][_0xc9b2('0x12')]);}})['catch'](function(_0x351c79){logger[_0xc9b2('0x10')](_0xc9b2('0xb'),_0x2c755f,_0x351c79);_0xffd429(_0x351c79);});});}exports[_0xc9b2('0x15')]=function(_0x49d95a){var _0x10aca7=this;return new Promise(function(_0xde5092,_0x414df9){return db[_0xc9b2('0x16')][_0xc9b2('0x17')]({'raw':_0x49d95a[_0xc9b2('0x18')]?_0x49d95a[_0xc9b2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49d95a[_0xc9b2('0x18')]?_0x49d95a['options'][_0xc9b2('0x19')]||null:null,'attributes':_0x49d95a[_0xc9b2('0x18')]?_0x49d95a['options'][_0xc9b2('0x1a')]||null:null,'limit':_0x49d95a[_0xc9b2('0x18')]?_0x49d95a['options'][_0xc9b2('0x1b')]||null:null,'include':_0x49d95a['options']?_0x49d95a[_0xc9b2('0x18')][_0xc9b2('0x1c')]?_[_0xc9b2('0x1d')](_0x49d95a[_0xc9b2('0x18')][_0xc9b2('0x1c')],function(_0x16e0e6){return{'model':db[_0x16e0e6[_0xc9b2('0x1e')]],'as':_0x16e0e6['as'],'attributes':_0x16e0e6[_0xc9b2('0x1a')],'include':_0x16e0e6[_0xc9b2('0x1c')]?_[_0xc9b2('0x1d')](_0x16e0e6['include'],function(_0x15dc60){return{'model':db[_0x15dc60[_0xc9b2('0x1e')]],'as':_0x15dc60['as'],'attributes':_0x15dc60[_0xc9b2('0x1a')],'include':_0x15dc60[_0xc9b2('0x1c')]?_['map'](_0x15dc60[_0xc9b2('0x1c')],function(_0x5bdfe8){return{'model':db[_0x5bdfe8[_0xc9b2('0x1e')]],'as':_0x5bdfe8['as'],'attributes':_0x5bdfe8[_0xc9b2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc9b2('0xa')](function(_0x245385){logger[_0xc9b2('0x13')](_0xc9b2('0x15'),_0x49d95a);logger[_0xc9b2('0xd')](_0xc9b2('0x15'),_0x49d95a,JSON[_0xc9b2('0xf')](_0x245385));_0xde5092(_0x245385);})[_0xc9b2('0x1f')](function(_0x16936f){logger[_0xc9b2('0x10')](_0xc9b2('0x15'),_0x16936f[_0xc9b2('0x12')],_0x49d95a);_0x414df9(_0x10aca7[_0xc9b2('0x10')](0x1f4,_0x16936f[_0xc9b2('0x12')]));});});};exports['CreateMemberReport']=function(_0x5c2277){var _0x3df56f=this;return new Promise(function(_0x34533a,_0x18c55e){return db['MemberReport'][_0xc9b2('0x20')](_0x5c2277['body'],{'raw':_0x5c2277[_0xc9b2('0x18')]?_0x5c2277[_0xc9b2('0x18')][_0xc9b2('0x21')]===undefined?!![]:![]:!![]})[_0xc9b2('0xa')](function(_0x3f7e5d){logger[_0xc9b2('0x13')](_0xc9b2('0x22'),_0x5c2277);logger[_0xc9b2('0xd')]('CreateMemberReport',_0x5c2277,JSON[_0xc9b2('0xf')](_0x3f7e5d));_0x34533a(_0x3f7e5d);})[_0xc9b2('0x1f')](function(_0x1eb98d){logger[_0xc9b2('0x10')]('CreateMemberReport',_0x1eb98d['message'],_0x5c2277);_0x18c55e(_0x3df56f[_0xc9b2('0x10')](0x1f4,_0x1eb98d[_0xc9b2('0x12')]));});});};exports['UpdateMemberReport']=function(_0x5c894d){var _0x3ca922=this;return new Promise(function(_0x5d75b0,_0x3e7da1){return db[_0xc9b2('0x16')]['update'](_0x5c894d[_0xc9b2('0x23')],{'raw':_0x5c894d[_0xc9b2('0x18')]?_0x5c894d[_0xc9b2('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c894d[_0xc9b2('0x18')]?_0x5c894d[_0xc9b2('0x18')][_0xc9b2('0x19')]||null:null,'attributes':_0x5c894d['options']?_0x5c894d['options'][_0xc9b2('0x1a')]||null:null,'limit':_0x5c894d['options']?_0x5c894d[_0xc9b2('0x18')][_0xc9b2('0x1b')]||null:null})['then'](function(_0x2503ce){logger[_0xc9b2('0x13')](_0xc9b2('0x24'),_0x5c894d);logger['debug'](_0xc9b2('0x24'),_0x5c894d,JSON[_0xc9b2('0xf')](_0x2503ce));_0x5d75b0(_0x2503ce);})[_0xc9b2('0x1f')](function(_0x5654a0){logger[_0xc9b2('0x10')]('UpdateMemberReport',_0x5654a0[_0xc9b2('0x12')],_0x5c894d);_0x3e7da1(_0x3ca922[_0xc9b2('0x10')](0x1f4,_0x5654a0[_0xc9b2('0x12')]));});});}; \ No newline at end of file +var _0xd69e=['lodash','util','moment','randomstring','ioredis','../../config/environment','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','include','map','model','attributes','debug','CreateMemberReport','body','UpdateMemberReport'];(function(_0x49ad25,_0x3e7198){var _0x45e7e0=function(_0x2527e7){while(--_0x2527e7){_0x49ad25['push'](_0x49ad25['shift']());}};_0x45e7e0(++_0x3e7198);}(_0xd69e,0xa0));var _0xed69=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd69e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var moment=require(_0xed69('0x2'));var BPromise=require('bluebird');var rs=require(_0xed69('0x3'));var fs=require('fs');var Redis=require(_0xed69('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xed69('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed69('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1f2757,_0xd7eed4,_0x20a74f){return new BPromise(function(_0x4bcb61,_0x3dec07){return client['request'](_0x1f2757,_0x20a74f)[_0xed69('0x7')](function(_0x42c0b0){logger['info'](_0xed69('0x8'),_0xd7eed4,_0xed69('0x9'));logger['debug'](_0xed69('0xa'),_0xd7eed4,'request\x20sent',JSON[_0xed69('0xb')](_0x42c0b0));if(_0x42c0b0[_0xed69('0xc')]){if(_0x42c0b0['error'][_0xed69('0xd')]===0x1f4){logger['error'](_0xed69('0x8'),_0xd7eed4,_0x42c0b0[_0xed69('0xc')][_0xed69('0xe')]);return _0x3dec07(_0x42c0b0['error']['message']);}logger[_0xed69('0xc')](_0xed69('0x8'),_0xd7eed4,_0x42c0b0[_0xed69('0xc')][_0xed69('0xe')]);return _0x4bcb61(_0x42c0b0[_0xed69('0xc')]['message']);}else{logger[_0xed69('0xf')](_0xed69('0x8'),_0xd7eed4,_0xed69('0x9'));_0x4bcb61(_0x42c0b0[_0xed69('0x10')][_0xed69('0xe')]);}})[_0xed69('0x11')](function(_0x465db9){logger[_0xed69('0xc')](_0xed69('0x8'),_0xd7eed4,_0x465db9);_0x3dec07(_0x465db9);});});}exports[_0xed69('0x12')]=function(_0x4df35e){var _0x4843bf=this;return new Promise(function(_0x553824,_0x2c8d25){return db[_0xed69('0x13')][_0xed69('0x14')]({'raw':_0x4df35e['options']?_0x4df35e[_0xed69('0x15')][_0xed69('0x16')]===undefined?!![]:![]:!![],'where':_0x4df35e['options']?_0x4df35e[_0xed69('0x15')][_0xed69('0x17')]||null:null,'attributes':_0x4df35e[_0xed69('0x15')]?_0x4df35e[_0xed69('0x15')]['attributes']||null:null,'limit':_0x4df35e[_0xed69('0x15')]?_0x4df35e[_0xed69('0x15')]['limit']||null:null,'include':_0x4df35e[_0xed69('0x15')]?_0x4df35e[_0xed69('0x15')][_0xed69('0x18')]?_[_0xed69('0x19')](_0x4df35e[_0xed69('0x15')][_0xed69('0x18')],function(_0x513337){return{'model':db[_0x513337[_0xed69('0x1a')]],'as':_0x513337['as'],'attributes':_0x513337[_0xed69('0x1b')],'include':_0x513337[_0xed69('0x18')]?_[_0xed69('0x19')](_0x513337[_0xed69('0x18')],function(_0xd182bd){return{'model':db[_0xd182bd[_0xed69('0x1a')]],'as':_0xd182bd['as'],'attributes':_0xd182bd[_0xed69('0x1b')],'include':_0xd182bd[_0xed69('0x18')]?_[_0xed69('0x19')](_0xd182bd[_0xed69('0x18')],function(_0x4c2986){return{'model':db[_0x4c2986['model']],'as':_0x4c2986['as'],'attributes':_0x4c2986[_0xed69('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed69('0x7')](function(_0x2c77d4){logger[_0xed69('0xf')](_0xed69('0x12'),_0x4df35e);logger[_0xed69('0x1c')](_0xed69('0x12'),_0x4df35e,JSON[_0xed69('0xb')](_0x2c77d4));_0x553824(_0x2c77d4);})[_0xed69('0x11')](function(_0x1b24d7){logger['error']('GetMemberReport',_0x1b24d7[_0xed69('0xe')],_0x4df35e);_0x2c8d25(_0x4843bf['error'](0x1f4,_0x1b24d7[_0xed69('0xe')]));});});};exports[_0xed69('0x1d')]=function(_0x164316){var _0x1f4e54=this;return new Promise(function(_0xe5cb74,_0x327298){return db[_0xed69('0x13')]['create'](_0x164316[_0xed69('0x1e')],{'raw':_0x164316[_0xed69('0x15')]?_0x164316[_0xed69('0x15')][_0xed69('0x16')]===undefined?!![]:![]:!![]})[_0xed69('0x7')](function(_0x200dfb){logger[_0xed69('0xf')]('CreateMemberReport',_0x164316);logger['debug'](_0xed69('0x1d'),_0x164316,JSON[_0xed69('0xb')](_0x200dfb));_0xe5cb74(_0x200dfb);})[_0xed69('0x11')](function(_0x1b7095){logger[_0xed69('0xc')](_0xed69('0x1d'),_0x1b7095['message'],_0x164316);_0x327298(_0x1f4e54[_0xed69('0xc')](0x1f4,_0x1b7095[_0xed69('0xe')]));});});};exports[_0xed69('0x1f')]=function(_0x166694){var _0x29f407=this;return new Promise(function(_0x42680f,_0x4d6a2c){return db['MemberReport']['update'](_0x166694[_0xed69('0x1e')],{'raw':_0x166694[_0xed69('0x15')]?_0x166694[_0xed69('0x15')][_0xed69('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x166694['options']?_0x166694[_0xed69('0x15')][_0xed69('0x17')]||null:null,'attributes':_0x166694['options']?_0x166694[_0xed69('0x15')][_0xed69('0x1b')]||null:null,'limit':_0x166694[_0xed69('0x15')]?_0x166694[_0xed69('0x15')]['limit']||null:null})[_0xed69('0x7')](function(_0x1defcf){logger[_0xed69('0xf')](_0xed69('0x1f'),_0x166694);logger[_0xed69('0x1c')](_0xed69('0x1f'),_0x166694,JSON[_0xed69('0xb')](_0x1defcf));_0x42680f(_0x1defcf);})[_0xed69('0x11')](function(_0x521ec9){logger[_0xed69('0xc')]('UpdateMemberReport',_0x521ec9[_0xed69('0xe')],_0x166694);_0x4d6a2c(_0x29f407[_0xed69('0xc')](0x1f4,_0x521ec9[_0xed69('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 0166306..d6b7c4d 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 _0xd9f1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','multer','util','connect-timeout','express','Router'];(function(_0x428af1,_0x22b54a){var _0x297da4=function(_0x4566e1){while(--_0x4566e1){_0x428af1['push'](_0x428af1['shift']());}};_0x297da4(++_0x22b54a);}(_0xd9f1,0x1df));var _0x1d9f=function(_0x547a87,_0x4d4e24){_0x547a87=_0x547a87-0x0;var _0x11fde1=_0xd9f1[_0x547a87];return _0x11fde1;};'use strict';var multer=require(_0x1d9f('0x0'));var util=require(_0x1d9f('0x1'));var path=require('path');var timeout=require(_0x1d9f('0x2'));var express=require(_0x1d9f('0x3'));var router=express[_0x1d9f('0x4')]();var fs_extra=require(_0x1d9f('0x5'));var auth=require(_0x1d9f('0x6'));var interaction=require(_0x1d9f('0x7'));var config=require(_0x1d9f('0x8'));var controller=require('./migration.controller');router[_0x1d9f('0x9')]('/',controller[_0x1d9f('0xa')]);module['exports']=router; \ No newline at end of file +var _0x078c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','multer','path','connect-timeout'];(function(_0x1006ad,_0x26a309){var _0x3edfe2=function(_0x392ed5){while(--_0x392ed5){_0x1006ad['push'](_0x1006ad['shift']());}};_0x3edfe2(++_0x26a309);}(_0x078c,0x19f));var _0xc078=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x078c[_0x3c4f1f];return _0x19cb69;};'use strict';var multer=require(_0xc078('0x0'));var util=require('util');var path=require(_0xc078('0x1'));var timeout=require(_0xc078('0x2'));var express=require('express');var router=express[_0xc078('0x3')]();var fs_extra=require(_0xc078('0x4'));var auth=require(_0xc078('0x5'));var interaction=require(_0xc078('0x6'));var config=require('../../config/environment');var controller=require(_0xc078('0x7'));router[_0xc078('0x8')]('/',controller[_0xc078('0x9')]);module[_0xc078('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 6a1b4b9..8f99703 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 _0x7a83=['version','exports','STRING'];(function(_0x4e7dd7,_0x3e7134){var _0x4f4461=function(_0x17aabb){while(--_0x17aabb){_0x4e7dd7['push'](_0x4e7dd7['shift']());}};_0x4f4461(++_0x3e7134);}(_0x7a83,0x1de));var _0x37a8=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x7a83[_0x5ad0d7];return _0xd83bd;};'use strict';var Sequelize=require('sequelize');module[_0x37a8('0x0')]={'version':{'type':Sequelize[_0x37a8('0x1')],'unique':_0x37a8('0x2')}}; \ No newline at end of file +var _0x6873=['version','sequelize','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x6873,0x112));var _0x3687=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0x6873[_0x86c6cb];return _0x1b1592;};'use strict';var Sequelize=require(_0x3687('0x0'));module[_0x3687('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x3687('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ac0a1bd..043e1a4 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 _0xf739=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','save','update','destroy','end','sendStatus','stack','name','send','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','eml-format','zip-dir','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf739,0x147));var _0x9f73=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0xf739[_0x1b6563];return _0xdea7b8;};'use strict';var emlformat=require(_0x9f73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f73('0x1'));var jsonpatch=require(_0x9f73('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f73('0x3'));var Mustache=require(_0x9f73('0x4'));var util=require(_0x9f73('0x5'));var path=require(_0x9f73('0x6'));var sox=require(_0x9f73('0x7'));var csv=require(_0x9f73('0x8'));var ejs=require(_0x9f73('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f73('0xa'));var squel=require(_0x9f73('0xb'));var crypto=require('crypto');var jsforce=require(_0x9f73('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9f73('0x8'));var querystring=require(_0x9f73('0xd'));var Papa=require(_0x9f73('0xe'));var Redis=require(_0x9f73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9f73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f73('0x11'))(_0x9f73('0x12'));var utils=require(_0x9f73('0x13'));var config=require(_0x9f73('0x14'));var licenseUtil=require(_0x9f73('0x15'));var db=require(_0x9f73('0x16'))['db'];function respondWithStatusCode(_0x1588fc,_0x724a7f){_0x724a7f=_0x724a7f||0xcc;return function(_0xe944a1){if(_0xe944a1){return _0x1588fc['sendStatus'](_0x724a7f);}return _0x1588fc[_0x9f73('0x17')](_0x724a7f)['end']();};}function respondWithResult(_0x3af968,_0x4668a2){_0x4668a2=_0x4668a2||0xc8;return function(_0xc45ca3){if(_0xc45ca3){return _0x3af968[_0x9f73('0x17')](_0x4668a2)[_0x9f73('0x18')](_0xc45ca3);}};}function respondWithFilteredResult(_0x2a7c6c,_0x54daf2){return function(_0x3aa076){if(_0x3aa076){var _0x4da12b=typeof _0x54daf2[_0x9f73('0x19')]===_0x9f73('0x1a')&&typeof _0x54daf2[_0x9f73('0x1b')]==='undefined';var _0x34459a=_0x3aa076[_0x9f73('0x1c')];var _0x5a967d=_0x4da12b?0x0:_0x54daf2[_0x9f73('0x19')];var _0x3aace8=_0x4da12b?_0x3aa076[_0x9f73('0x1c')]:_0x54daf2['offset']+_0x54daf2['limit'];var _0x279fb3;if(_0x3aace8>=_0x34459a){_0x3aace8=_0x34459a;_0x279fb3=0xc8;}else{_0x279fb3=0xce;}_0x2a7c6c[_0x9f73('0x17')](_0x279fb3);return _0x2a7c6c['set']('Content-Range',_0x5a967d+'-'+_0x3aace8+'/'+_0x34459a)[_0x9f73('0x18')](_0x3aa076);}return null;};}function patchUpdates(_0x454ecc){return function(_0x1d1329){try{jsonpatch['apply'](_0x1d1329,_0x454ecc,!![]);}catch(_0x14fed6){return BPromise[_0x9f73('0x1d')](_0x14fed6);}return _0x1d1329[_0x9f73('0x1e')]();};}function saveUpdates(_0x24b9b4,_0x375f79){return function(_0x471ec5){if(_0x471ec5){return _0x471ec5[_0x9f73('0x1f')](_0x24b9b4)['then'](function(_0x1506be){return _0x1506be;});}return null;};}function removeEntity(_0xa7efd,_0x1bd2c4){return function(_0x372349){if(_0x372349){return _0x372349[_0x9f73('0x20')]()['then'](function(){_0xa7efd['status'](0xcc)[_0x9f73('0x21')]();});}};}function handleEntityNotFound(_0x513c2d,_0x54b769){return function(_0x4b4059){if(!_0x4b4059){_0x513c2d[_0x9f73('0x22')](0x194);}return _0x4b4059;};}function handleError(_0x37cf92,_0x19af36){_0x19af36=_0x19af36||0x1f4;return function(_0x5e4466){logger['error'](_0x5e4466[_0x9f73('0x23')]);if(_0x5e4466[_0x9f73('0x24')]){delete _0x5e4466[_0x9f73('0x24')];}_0x37cf92[_0x9f73('0x17')](_0x19af36)[_0x9f73('0x25')](_0x5e4466);};}exports['index']=function(_0x55be30,_0x2fd34c){var _0x44343f={},_0x34b6a8={},_0x2255c5={'count':0x0,'rows':[]};var _0xa15662=_[_0x9f73('0x26')](db[_0x9f73('0x27')][_0x9f73('0x28')],function(_0x39583c){return{'name':_0x39583c[_0x9f73('0x29')],'type':_0x39583c[_0x9f73('0x2a')]['key']};});_0x34b6a8[_0x9f73('0x2b')]=_[_0x9f73('0x26')](_0xa15662,'name');_0x34b6a8[_0x9f73('0x2c')]=_[_0x9f73('0x2d')](_0x55be30[_0x9f73('0x2c')]);_0x34b6a8[_0x9f73('0x2e')]=_[_0x9f73('0x2f')](_0x34b6a8['model'],_0x34b6a8[_0x9f73('0x2c')]);_0x44343f[_0x9f73('0x30')]=_['intersection'](_0x34b6a8[_0x9f73('0x2b')],qs[_0x9f73('0x31')](_0x55be30[_0x9f73('0x2c')]['fields']));_0x44343f['attributes']=_0x44343f[_0x9f73('0x30')][_0x9f73('0x32')]?_0x44343f['attributes']:_0x34b6a8[_0x9f73('0x2b')];if(!_0x55be30[_0x9f73('0x2c')][_0x9f73('0x33')](_0x9f73('0x34'))){_0x44343f[_0x9f73('0x1b')]=qs[_0x9f73('0x1b')](_0x55be30[_0x9f73('0x2c')][_0x9f73('0x1b')]);_0x44343f[_0x9f73('0x19')]=qs[_0x9f73('0x19')](_0x55be30['query'][_0x9f73('0x19')]);}_0x44343f[_0x9f73('0x35')]=qs['sort'](_0x55be30[_0x9f73('0x2c')][_0x9f73('0x36')]);_0x44343f[_0x9f73('0x37')]=qs[_0x9f73('0x2e')](_[_0x9f73('0x38')](_0x55be30[_0x9f73('0x2c')],_0x34b6a8['filters']),_0xa15662);if(_0x55be30['query'][_0x9f73('0x39')]){_0x44343f['where']=_[_0x9f73('0x3a')](_0x44343f[_0x9f73('0x37')],{'$or':_['map'](_0xa15662,function(_0x9a92e0){if(_0x9a92e0['type']!==_0x9f73('0x3b')){var _0x50fda={};_0x50fda[_0x9a92e0[_0x9f73('0x24')]]={'$like':'%'+_0x55be30[_0x9f73('0x2c')][_0x9f73('0x39')]+'%'};return _0x50fda;}})});}_0x44343f=_[_0x9f73('0x3a')]({},_0x44343f,_0x55be30[_0x9f73('0x3c')]);var _0x1fd322={'where':_0x44343f[_0x9f73('0x37')]};return db[_0x9f73('0x27')][_0x9f73('0x1c')](_0x1fd322)[_0x9f73('0x3d')](function(_0x3af775){_0x2255c5[_0x9f73('0x1c')]=_0x3af775;if(_0x55be30[_0x9f73('0x2c')][_0x9f73('0x3e')]){_0x44343f['include']=[{'all':!![]}];}return db[_0x9f73('0x27')][_0x9f73('0x3f')](_0x44343f);})[_0x9f73('0x3d')](function(_0x88d963){_0x2255c5[_0x9f73('0x40')]=_0x88d963;return _0x2255c5;})[_0x9f73('0x3d')](respondWithFilteredResult(_0x2fd34c,_0x44343f))[_0x9f73('0x41')](handleError(_0x2fd34c,null));}; \ No newline at end of file +var _0xbb68=['VIRTUAL','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','Migration','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x2c4f1f,_0x4b5de4){var _0x418135=function(_0x2db28d){while(--_0x2db28d){_0x2c4f1f['push'](_0x2c4f1f['shift']());}};_0x418135(++_0x4b5de4);}(_0xbb68,0x140));var _0x8bb6=function(_0xc829a6,_0x554812){_0xc829a6=_0xc829a6-0x0;var _0xf19a92=_0xbb68[_0xc829a6];return _0xf19a92;};'use strict';var emlformat=require(_0x8bb6('0x0'));var rimraf=require(_0x8bb6('0x1'));var zipdir=require(_0x8bb6('0x2'));var jsonpatch=require(_0x8bb6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8bb6('0x4'));var Mustache=require(_0x8bb6('0x5'));var util=require(_0x8bb6('0x6'));var path=require('path');var sox=require(_0x8bb6('0x7'));var csv=require(_0x8bb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bb6('0x9'));var squel=require(_0x8bb6('0xa'));var crypto=require('crypto');var jsforce=require(_0x8bb6('0xb'));var deskjs=require(_0x8bb6('0xc'));var toCsv=require(_0x8bb6('0x8'));var querystring=require(_0x8bb6('0xd'));var Papa=require('papaparse');var Redis=require(_0x8bb6('0xe'));var authService=require(_0x8bb6('0xf'));var qs=require(_0x8bb6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bb6('0x11'));var logger=require('../../config/logger')(_0x8bb6('0x12'));var utils=require(_0x8bb6('0x13'));var config=require(_0x8bb6('0x14'));var licenseUtil=require(_0x8bb6('0x15'));var db=require(_0x8bb6('0x16'))['db'];function respondWithStatusCode(_0x29b966,_0x159ce9){_0x159ce9=_0x159ce9||0xcc;return function(_0x356cc3){if(_0x356cc3){return _0x29b966[_0x8bb6('0x17')](_0x159ce9);}return _0x29b966[_0x8bb6('0x18')](_0x159ce9)[_0x8bb6('0x19')]();};}function respondWithResult(_0x13b21c,_0x49f035){_0x49f035=_0x49f035||0xc8;return function(_0x4946a1){if(_0x4946a1){return _0x13b21c['status'](_0x49f035)[_0x8bb6('0x1a')](_0x4946a1);}};}function respondWithFilteredResult(_0x248f8f,_0xd6e43b){return function(_0x50e10f){if(_0x50e10f){var _0x31c0ba=typeof _0xd6e43b[_0x8bb6('0x1b')]==='undefined'&&typeof _0xd6e43b[_0x8bb6('0x1c')]===_0x8bb6('0x1d');var _0x5c5032=_0x50e10f['count'];var _0x120737=_0x31c0ba?0x0:_0xd6e43b[_0x8bb6('0x1b')];var _0x1c7389=_0x31c0ba?_0x50e10f[_0x8bb6('0x1e')]:_0xd6e43b[_0x8bb6('0x1b')]+_0xd6e43b[_0x8bb6('0x1c')];var _0x3aa628;if(_0x1c7389>=_0x5c5032){_0x1c7389=_0x5c5032;_0x3aa628=0xc8;}else{_0x3aa628=0xce;}_0x248f8f[_0x8bb6('0x18')](_0x3aa628);return _0x248f8f[_0x8bb6('0x1f')](_0x8bb6('0x20'),_0x120737+'-'+_0x1c7389+'/'+_0x5c5032)[_0x8bb6('0x1a')](_0x50e10f);}return null;};}function patchUpdates(_0x31f534){return function(_0x1bda45){try{jsonpatch[_0x8bb6('0x21')](_0x1bda45,_0x31f534,!![]);}catch(_0x51bc3a){return BPromise[_0x8bb6('0x22')](_0x51bc3a);}return _0x1bda45['save']();};}function saveUpdates(_0x138a70,_0x126c3e){return function(_0x2dc820){if(_0x2dc820){return _0x2dc820[_0x8bb6('0x23')](_0x138a70)['then'](function(_0x4fab68){return _0x4fab68;});}return null;};}function removeEntity(_0x1120c0,_0x4306b0){return function(_0x3289ef){if(_0x3289ef){return _0x3289ef['destroy']()[_0x8bb6('0x24')](function(){_0x1120c0[_0x8bb6('0x18')](0xcc)[_0x8bb6('0x19')]();});}};}function handleEntityNotFound(_0x2097e6,_0x4d9863){return function(_0x174b46){if(!_0x174b46){_0x2097e6['sendStatus'](0x194);}return _0x174b46;};}function handleError(_0x2f4228,_0x50ce47){_0x50ce47=_0x50ce47||0x1f4;return function(_0x4ea31f){logger[_0x8bb6('0x25')](_0x4ea31f['stack']);if(_0x4ea31f['name']){delete _0x4ea31f[_0x8bb6('0x26')];}_0x2f4228[_0x8bb6('0x18')](_0x50ce47)[_0x8bb6('0x27')](_0x4ea31f);};}exports[_0x8bb6('0x28')]=function(_0x46d8be,_0x3898ac){var _0x38e093={},_0xd98bb7={},_0x55b658={'count':0x0,'rows':[]};var _0x56d721=_[_0x8bb6('0x29')](db[_0x8bb6('0x2a')]['rawAttributes'],function(_0x175279){return{'name':_0x175279['fieldName'],'type':_0x175279[_0x8bb6('0x2b')]['key']};});_0xd98bb7[_0x8bb6('0x2c')]=_['map'](_0x56d721,'name');_0xd98bb7[_0x8bb6('0x2d')]=_[_0x8bb6('0x2e')](_0x46d8be[_0x8bb6('0x2d')]);_0xd98bb7[_0x8bb6('0x2f')]=_['intersection'](_0xd98bb7['model'],_0xd98bb7[_0x8bb6('0x2d')]);_0x38e093[_0x8bb6('0x30')]=_['intersection'](_0xd98bb7[_0x8bb6('0x2c')],qs[_0x8bb6('0x31')](_0x46d8be[_0x8bb6('0x2d')][_0x8bb6('0x31')]));_0x38e093['attributes']=_0x38e093[_0x8bb6('0x30')][_0x8bb6('0x32')]?_0x38e093['attributes']:_0xd98bb7[_0x8bb6('0x2c')];if(!_0x46d8be[_0x8bb6('0x2d')][_0x8bb6('0x33')](_0x8bb6('0x34'))){_0x38e093['limit']=qs[_0x8bb6('0x1c')](_0x46d8be[_0x8bb6('0x2d')]['limit']);_0x38e093['offset']=qs[_0x8bb6('0x1b')](_0x46d8be[_0x8bb6('0x2d')]['offset']);}_0x38e093[_0x8bb6('0x35')]=qs[_0x8bb6('0x36')](_0x46d8be['query'][_0x8bb6('0x36')]);_0x38e093[_0x8bb6('0x37')]=qs[_0x8bb6('0x2f')](_['pick'](_0x46d8be[_0x8bb6('0x2d')],_0xd98bb7[_0x8bb6('0x2f')]),_0x56d721);if(_0x46d8be[_0x8bb6('0x2d')][_0x8bb6('0x38')]){_0x38e093[_0x8bb6('0x37')]=_[_0x8bb6('0x39')](_0x38e093[_0x8bb6('0x37')],{'$or':_[_0x8bb6('0x29')](_0x56d721,function(_0x4a2972){if(_0x4a2972[_0x8bb6('0x2b')]!==_0x8bb6('0x3a')){var _0x165de7={};_0x165de7[_0x4a2972[_0x8bb6('0x26')]]={'$like':'%'+_0x46d8be[_0x8bb6('0x2d')]['filter']+'%'};return _0x165de7;}})});}_0x38e093=_[_0x8bb6('0x39')]({},_0x38e093,_0x46d8be['options']);var _0x450523={'where':_0x38e093[_0x8bb6('0x37')]};return db[_0x8bb6('0x2a')][_0x8bb6('0x1e')](_0x450523)[_0x8bb6('0x24')](function(_0x16c92a){_0x55b658[_0x8bb6('0x1e')]=_0x16c92a;if(_0x46d8be[_0x8bb6('0x2d')][_0x8bb6('0x3b')]){_0x38e093[_0x8bb6('0x3c')]=[{'all':!![]}];}return db[_0x8bb6('0x2a')][_0x8bb6('0x3d')](_0x38e093);})['then'](function(_0x5de38a){_0x55b658['rows']=_0x5de38a;return _0x55b658;})['then'](respondWithFilteredResult(_0x3898ac,_0x38e093))[_0x8bb6('0x3e')](handleError(_0x3898ac,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 00e281d..7297d4a 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 _0x1387=['define','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./migration.attributes','exports'];(function(_0x44a9e5,_0x34eed9){var _0xdef6e6=function(_0x54d29b){while(--_0x54d29b){_0x44a9e5['push'](_0x44a9e5['shift']());}};_0xdef6e6(++_0x34eed9);}(_0x1387,0x196));var _0x7138=function(_0x2182b5,_0x8afb7){_0x2182b5=_0x2182b5-0x0;var _0x4b163a=_0x1387[_0x2182b5];return _0x4b163a;};'use strict';var _=require(_0x7138('0x0'));var util=require(_0x7138('0x1'));var logger=require(_0x7138('0x2'))('api');var moment=require(_0x7138('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7138('0x4'));var config=require(_0x7138('0x5'));var attributes=require(_0x7138('0x6'));module[_0x7138('0x7')]=function(_0x509e93,_0x71126f){return _0x509e93[_0x7138('0x8')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe90e=['api','moment','bluebird','request-promise','path','../../config/environment','exports','migrations','util'];(function(_0x2bd4e3,_0x4d9b53){var _0x259f7c=function(_0x419754){while(--_0x419754){_0x2bd4e3['push'](_0x2bd4e3['shift']());}};_0x259f7c(++_0x4d9b53);}(_0xe90e,0x1e5));var _0xee90=function(_0x3a70ef,_0x7fdf5f){_0x3a70ef=_0x3a70ef-0x0;var _0x5197bf=_0xe90e[_0x3a70ef];return _0x5197bf;};'use strict';var _=require('lodash');var util=require(_0xee90('0x0'));var logger=require('../../config/logger')(_0xee90('0x1'));var moment=require(_0xee90('0x2'));var BPromise=require(_0xee90('0x3'));var rp=require(_0xee90('0x4'));var fs=require('fs');var path=require(_0xee90('0x5'));var rimraf=require('rimraf');var config=require(_0xee90('0x6'));var attributes=require('./migration.attributes');module[_0xee90('0x7')]=function(_0x2a53c2,_0xe5932a){return _0x2a53c2['define']('Migration',attributes,{'tableName':_0xee90('0x8'),'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 152a786..ec4d6dd 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 _0xd61e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0xd61e,0x13d));var _0xed61=function(_0x48e7ad,_0xb199f4){_0x48e7ad=_0x48e7ad-0x0;var _0x35e335=_0xd61e[_0x48e7ad];return _0x35e335;};'use strict';var _=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var moment=require(_0xed61('0x2'));var BPromise=require(_0xed61('0x3'));var rs=require(_0xed61('0x4'));var fs=require('fs');var Redis=require(_0xed61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xed61('0x6'));var logger=require(_0xed61('0x7'))(_0xed61('0x8'));var config=require(_0xed61('0x9'));var jayson=require(_0xed61('0xa'));var client=jayson[_0xed61('0xb')][_0xed61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b7469,_0x5e6173,_0x59ef0e){return new BPromise(function(_0x5cbbd7,_0x4a2d4c){return client[_0xed61('0xd')](_0x5b7469,_0x59ef0e)[_0xed61('0xe')](function(_0x2964de){logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x5e6173,_0xed61('0x11'),JSON[_0xed61('0x12')](_0x2964de));if(_0x2964de['error']){if(_0x2964de['error']['code']===0x1f4){logger['error'](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);return _0x4a2d4c(_0x2964de[_0xed61('0x13')]['message']);}logger[_0xed61('0x13')](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')]['message']);return _0x5cbbd7(_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);}else{logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');_0x5cbbd7(_0x2964de[_0xed61('0x15')][_0xed61('0x14')]);}})[_0xed61('0x16')](function(_0x6d05cd){logger['error'](_0xed61('0x10'),_0x5e6173,_0x6d05cd);_0x4a2d4c(_0x6d05cd);});});} \ No newline at end of file +var _0x1152=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x30ae75,_0x11f79f){var _0x28b317=function(_0x3740ca){while(--_0x3740ca){_0x30ae75['push'](_0x30ae75['shift']());}};_0x28b317(++_0x11f79f);}(_0x1152,0x182));var _0x2115=function(_0x242bb9,_0x5575b7){_0x242bb9=_0x242bb9-0x0;var _0x2a2760=_0x1152[_0x242bb9];return _0x2a2760;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564071,_0x54cdd0,_0x5dbb85){return new BPromise(function(_0x5df6db,_0x158711){return client[_0x2115('0xb')](_0x564071,_0x5dbb85)[_0x2115('0xc')](function(_0x5156f2){logger[_0x2115('0xd')]('Migration,\x20%s,\x20%s',_0x54cdd0,'request\x20sent');logger[_0x2115('0xe')](_0x2115('0xf'),_0x54cdd0,_0x2115('0x10'),JSON['stringify'](_0x5156f2));if(_0x5156f2[_0x2115('0x11')]){if(_0x5156f2['error'][_0x2115('0x12')]===0x1f4){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x158711(_0x5156f2['error'][_0x2115('0x14')]);}logger['error'](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x5df6db(_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);}else{logger[_0x2115('0xd')](_0x2115('0x13'),_0x54cdd0,'request\x20sent');_0x5df6db(_0x5156f2[_0x2115('0x15')][_0x2115('0x14')]);}})[_0x2115('0x16')](function(_0x184c05){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x184c05);_0x158711(_0x184c05);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 659d749..7f0a7d0 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 _0x0324=['get','isAuthenticated','index','/:id','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x0324,0x90));var _0x4032=function(_0xf9127c,_0x1df918){_0xf9127c=_0xf9127c-0x0;var _0x2724e5=_0x0324[_0xf9127c];return _0x2724e5;};'use strict';var multer=require('multer');var util=require(_0x4032('0x0'));var path=require(_0x4032('0x1'));var timeout=require(_0x4032('0x2'));var express=require(_0x4032('0x3'));var router=express[_0x4032('0x4')]();var fs_extra=require(_0x4032('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4032('0x6'));var config=require(_0x4032('0x7'));var controller=require(_0x4032('0x8'));router[_0x4032('0x9')]('/',auth[_0x4032('0xa')](),controller[_0x4032('0xb')]);router['get'](_0x4032('0xc'),auth[_0x4032('0xa')](),controller['show']);router['post']('/',auth[_0x4032('0xa')](),controller[_0x4032('0xd')]);router['put'](_0x4032('0xc'),auth[_0x4032('0xa')](),controller[_0x4032('0xe')]);router[_0x4032('0xf')]('/:id',auth[_0x4032('0xa')](),controller[_0x4032('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbe54=['update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','./network.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x119e6d,_0xe3377d){var _0x56b2d5=function(_0x31d728){while(--_0x31d728){_0x119e6d['push'](_0x119e6d['shift']());}};_0x56b2d5(++_0xe3377d);}(_0xbe54,0x9e));var _0x4be5=function(_0x58bf28,_0x31bdb5){_0x58bf28=_0x58bf28-0x0;var _0x18534a=_0xbe54[_0x58bf28];return _0x18534a;};'use strict';var multer=require(_0x4be5('0x0'));var util=require(_0x4be5('0x1'));var path=require('path');var timeout=require(_0x4be5('0x2'));var express=require('express');var router=express[_0x4be5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4be5('0x4'));router['get']('/',auth[_0x4be5('0x5')](),controller[_0x4be5('0x6')]);router[_0x4be5('0x7')]('/:id',auth[_0x4be5('0x5')](),controller[_0x4be5('0x8')]);router[_0x4be5('0x9')]('/',auth[_0x4be5('0x5')](),controller[_0x4be5('0xa')]);router[_0x4be5('0xb')]('/:id',auth[_0x4be5('0x5')](),controller[_0x4be5('0xc')]);router[_0x4be5('0xd')](_0x4be5('0xe'),auth[_0x4be5('0x5')](),controller[_0x4be5('0xf')]);module[_0x4be5('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 05aa6d9..fef441d 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 _0x2938=['externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x28d0ae,_0xca63a3){var _0x256533=function(_0x3b4cd8){while(--_0x3b4cd8){_0x28d0ae['push'](_0x28d0ae['shift']());}};_0x256533(++_0xca63a3);}(_0x2938,0x195));var _0x8293=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2938[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x8293('0x0'));module[_0x8293('0x1')]={'type':{'type':Sequelize[_0x8293('0x2')]('localnet',_0x8293('0x3'),_0x8293('0x4'),'turn')},'value':{'type':Sequelize[_0x8293('0x5')]},'username':{'type':Sequelize[_0x8293('0x5')]},'password':{'type':Sequelize[_0x8293('0x5')]}}; \ No newline at end of file +var _0x3e65=['STRING','ENUM','localnet','externip'];(function(_0x152cb8,_0x2cd976){var _0x494c94=function(_0x33b057){while(--_0x33b057){_0x152cb8['push'](_0x152cb8['shift']());}};_0x494c94(++_0x2cd976);}(_0x3e65,0x1ad));var _0x53e6=function(_0x33ccb0,_0x47aa54){_0x33ccb0=_0x33ccb0-0x0;var _0x390ed2=_0x3e65[_0x33ccb0];return _0x390ed2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x53e6('0x0')](_0x53e6('0x1'),_0x53e6('0x2'),'stun','turn')},'value':{'type':Sequelize[_0x53e6('0x3')]},'username':{'type':Sequelize[_0x53e6('0x3')]},'password':{'type':Sequelize[_0x53e6('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8bd8910..004360d 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 _0x1191=['/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','destroy','find','util','path','ejs','../../mysqldb','client','request','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','set','Content-Range','update','then','end','sendStatus','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','Network','count','includeAll','include','findAll','rows','show','params','rawAttributes','merge','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync'];(function(_0x56ef85,_0x22374d){var _0x186f58=function(_0x473f01){while(--_0x473f01){_0x56ef85['push'](_0x56ef85['shift']());}};_0x186f58(++_0x22374d);}(_0x1191,0xb3));var _0x1119=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1191[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x1119('0x0'));var path=require(_0x1119('0x1'));var ejs=require(_0x1119('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x1119('0x3'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1119('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1541,_0x5d8934,_0x1b86be,_0x5cb9ce){return new Promise(function(_0x12da42,_0x19b114){var _0x4808f0=_0x5cb9ce||client;return _0x4808f0[_0x1119('0x5')](_0x5c1541,_0x1b86be)['then'](function(_0x46af09){logger[_0x1119('0x6')](_0x1119('0x7'),_0x5d8934,_0x1119('0x8'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x5d8934,'request\x20sent',JSON[_0x1119('0x9')](_0x46af09));if(_0x46af09['error']){if(_0x46af09[_0x1119('0xa')][_0x1119('0xb')]===0x1f4){logger[_0x1119('0xa')]('Network,\x20%s,\x20%s',_0x5d8934,_0x46af09[_0x1119('0xa')]['message']);return _0x19b114(_0x46af09[_0x1119('0xa')][_0x1119('0xc')]);}logger[_0x1119('0xa')](_0x1119('0x7'),_0x5d8934,_0x46af09['error'][_0x1119('0xc')]);return _0x12da42(_0x46af09[_0x1119('0xa')][_0x1119('0xc')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x5d8934,'request\x20sent');_0x12da42(_0x46af09[_0x1119('0xd')][_0x1119('0xc')]);}})[_0x1119('0xe')](function(_0x23611e){logger[_0x1119('0xa')](_0x1119('0x7'),_0x5d8934,_0x23611e);_0x19b114(_0x23611e);});});}function respondWithResult(_0xc42783,_0x17c15d){_0x17c15d=_0x17c15d||0xc8;return function(_0x2ce7f8){if(_0x2ce7f8){return _0xc42783[_0x1119('0xf')](_0x17c15d)[_0x1119('0x10')](_0x2ce7f8);}};}function respondWithFilteredResult(_0x577271,_0x1360c5){return function(_0x38be2b){if(_0x38be2b){var _0x370884=typeof _0x1360c5['offset']==='undefined'&&typeof _0x1360c5['limit']==='undefined';var _0x2d733d=_0x38be2b['count'];var _0x23e1d8=_0x370884?0x0:_0x1360c5[_0x1119('0x11')];var _0x21dcd8=_0x370884?_0x38be2b['count']:_0x1360c5['offset']+_0x1360c5['limit'];var _0x51a3ef;if(_0x21dcd8>=_0x2d733d){_0x21dcd8=_0x2d733d;_0x51a3ef=0xc8;}else{_0x51a3ef=0xce;}_0x577271['status'](_0x51a3ef);return _0x577271[_0x1119('0x12')](_0x1119('0x13'),_0x23e1d8+'-'+_0x21dcd8+'/'+_0x2d733d)[_0x1119('0x10')](_0x38be2b);}return null;};}function saveUpdates(_0x4b3b9a){return function(_0x1b2af8){if(_0x1b2af8){return _0x1b2af8[_0x1119('0x14')](_0x4b3b9a)['then'](function(_0x40dd02){return _0x40dd02;});}return null;};}function removeEntity(_0x367796){return function(_0x18f2f8){if(_0x18f2f8){return _0x18f2f8['destroy']()[_0x1119('0x15')](function(){_0x367796['status'](0xcc)[_0x1119('0x16')]();});}};}function handleEntityNotFound(_0x147a4b){return function(_0x250d34){if(!_0x250d34){_0x147a4b[_0x1119('0x17')](0x194);}return _0x250d34;};}function handleError(_0x3f2c89,_0x163cbb){_0x163cbb=_0x163cbb||0x1f4;return function(_0x30e9de){logger[_0x1119('0xa')](_0x30e9de[_0x1119('0x18')]);if(_0x30e9de[_0x1119('0x19')]){delete _0x30e9de[_0x1119('0x19')];}_0x3f2c89[_0x1119('0xf')](_0x163cbb)[_0x1119('0x1a')](_0x30e9de);};}exports['index']=function(_0x111625,_0x1cfe6d){var _0x5ccc0e={},_0x114477={},_0x727781={'count':0x0,'rows':[]};var _0x91109b=_[_0x1119('0x1b')](db['Network']['rawAttributes'],function(_0x178788){return{'name':_0x178788[_0x1119('0x1c')],'type':_0x178788[_0x1119('0x1d')][_0x1119('0x1e')]};});_0x114477[_0x1119('0x1f')]=_[_0x1119('0x1b')](_0x91109b,_0x1119('0x19'));_0x114477['query']=_[_0x1119('0x20')](_0x111625[_0x1119('0x21')]);_0x114477[_0x1119('0x22')]=_[_0x1119('0x23')](_0x114477[_0x1119('0x1f')],_0x114477[_0x1119('0x21')]);_0x5ccc0e[_0x1119('0x24')]=_[_0x1119('0x23')](_0x114477['model'],qs[_0x1119('0x25')](_0x111625[_0x1119('0x21')]['fields']));_0x5ccc0e['attributes']=_0x5ccc0e[_0x1119('0x24')][_0x1119('0x26')]?_0x5ccc0e[_0x1119('0x24')]:_0x114477['model'];if(!_0x111625[_0x1119('0x21')][_0x1119('0x27')](_0x1119('0x28'))){_0x5ccc0e[_0x1119('0x29')]=qs['limit'](_0x111625['query'][_0x1119('0x29')]);_0x5ccc0e[_0x1119('0x11')]=qs[_0x1119('0x11')](_0x111625[_0x1119('0x21')][_0x1119('0x11')]);}_0x5ccc0e[_0x1119('0x2a')]=qs[_0x1119('0x2b')](_0x111625[_0x1119('0x21')][_0x1119('0x2b')]);_0x5ccc0e[_0x1119('0x2c')]=qs[_0x1119('0x22')](_[_0x1119('0x2d')](_0x111625[_0x1119('0x21')],_0x114477[_0x1119('0x22')]),_0x91109b);if(_0x111625[_0x1119('0x21')][_0x1119('0x2e')]){_0x5ccc0e[_0x1119('0x2c')]=_['merge'](_0x5ccc0e['where'],{'$or':_['map'](_0x91109b,function(_0x4018e9){if(_0x4018e9['type']!=='VIRTUAL'){var _0x1ad8be={};_0x1ad8be[_0x4018e9['name']]={'$like':'%'+_0x111625['query']['filter']+'%'};return _0x1ad8be;}})});}_0x5ccc0e=_['merge']({},_0x5ccc0e,_0x111625[_0x1119('0x2f')]);var _0x378773={'where':_0x5ccc0e[_0x1119('0x2c')]};return db[_0x1119('0x30')][_0x1119('0x31')](_0x378773)[_0x1119('0x15')](function(_0x290c76){_0x727781[_0x1119('0x31')]=_0x290c76;if(_0x111625[_0x1119('0x21')][_0x1119('0x32')]){_0x5ccc0e[_0x1119('0x33')]=[{'all':!![]}];}return db['Network'][_0x1119('0x34')](_0x5ccc0e);})[_0x1119('0x15')](function(_0x4a9f4f){_0x727781[_0x1119('0x35')]=_0x4a9f4f;return _0x727781;})[_0x1119('0x15')](respondWithFilteredResult(_0x1cfe6d,_0x5ccc0e))['catch'](handleError(_0x1cfe6d,null));};exports[_0x1119('0x36')]=function(_0x192f1f,_0x586603){var _0x4bd6db={'raw':!![],'where':{'id':_0x192f1f[_0x1119('0x37')]['id']}},_0x4cb893={};_0x4cb893[_0x1119('0x1f')]=_['keys'](db[_0x1119('0x30')][_0x1119('0x38')]);_0x4cb893[_0x1119('0x21')]=_['keys'](_0x192f1f[_0x1119('0x21')]);_0x4cb893[_0x1119('0x22')]=_[_0x1119('0x23')](_0x4cb893['model'],_0x4cb893[_0x1119('0x21')]);_0x4bd6db[_0x1119('0x24')]=_[_0x1119('0x23')](_0x4cb893[_0x1119('0x1f')],qs[_0x1119('0x25')](_0x192f1f[_0x1119('0x21')][_0x1119('0x25')]));_0x4bd6db[_0x1119('0x24')]=_0x4bd6db[_0x1119('0x24')][_0x1119('0x26')]?_0x4bd6db[_0x1119('0x24')]:_0x4cb893['model'];if(_0x192f1f['query']['includeAll']){_0x4bd6db[_0x1119('0x33')]=[{'all':!![]}];}_0x4bd6db=_[_0x1119('0x39')]({},_0x4bd6db,_0x192f1f[_0x1119('0x2f')]);return db[_0x1119('0x30')]['find'](_0x4bd6db)[_0x1119('0x15')](handleEntityNotFound(_0x586603,null))['then'](respondWithResult(_0x586603,null))[_0x1119('0xe')](handleError(_0x586603,null));};exports[_0x1119('0x3a')]=function(_0x26f6ac,_0x21a1d5){var _0xa38123;return db[_0x1119('0x30')]['create'](_0x26f6ac[_0x1119('0x3b')],{'raw':!![]})['then'](function(_0x39257c){_0xa38123=_0x39257c;return db[_0x1119('0x30')][_0x1119('0x34')]({'where':{'type':_0x26f6ac[_0x1119('0x3b')][_0x1119('0x1d')]},'raw':!![]});})[_0x1119('0x15')](function(_0x11acf6){if(_0xa38123[_0x1119('0x1d')]['toUpperCase']()==_0x1119('0x3c')){var _0x20b994=fs['readFileSync'](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x3f')),_0x1119('0x40'));var _0x23a926=ejs[_0x1119('0x41')](_0x20b994,{'networks':_0x11acf6||[]});fs[_0x1119('0x42')](_0x1119('0x43'),_0x23a926);return respondWithRpcPromise(_0x1119('0x44'),_0x1119('0x3a'),{'module':_0x1119('0x45')});}else if(_0xa38123[_0x1119('0x1d')][_0x1119('0x46')]()==_0x1119('0x47')){var _0x46565d=fs[_0x1119('0x48')](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x49')),_0x1119('0x40'));var _0x5b70ab=ejs['render'](_0x46565d,{'networks':_0x11acf6||[]});fs['writeFileSync'](_0x1119('0x4a'),_0x5b70ab);return respondWithRpcPromise(_0x1119('0x44'),_0x1119('0x3a'),{'module':'res_stun_monitor.so'});}else{var _0xb37a00=fs['readFileSync'](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x4b')),_0x1119('0x40'));var _0x475522=ejs[_0x1119('0x41')](_0xb37a00,{'networks':_0x11acf6||[]});fs['writeFileSync'](util[_0x1119('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x26f6ac['body'][_0x1119('0x1d')][_0x1119('0x4d')]()),_0x475522);return respondWithRpcPromise('Reload','create',{'module':_0x1119('0x4e')});}})['then'](function(){return _0xa38123;})[_0x1119('0x15')](respondWithResult(_0x21a1d5,0xc9))['catch'](handleError(_0x21a1d5,null));};exports[_0x1119('0x14')]=function(_0x14ffac,_0x193371){var _0x3fca03;return db['Network']['find']({'where':{'id':_0x14ffac[_0x1119('0x37')]['id']}})[_0x1119('0x15')](handleEntityNotFound(_0x193371,null))[_0x1119('0x15')](saveUpdates(_0x14ffac['body'],null))[_0x1119('0x15')](function(_0x15a664){if(_0x15a664){_0x3fca03=_0x15a664;return db[_0x1119('0x30')][_0x1119('0x34')]({'where':{'type':_0x3fca03[_0x1119('0x1d')]},'raw':!![]});}return null;})[_0x1119('0x15')](function(_0x2a5523){if(_0x3fca03['type'][_0x1119('0x46')]()=='STUN'){var _0x53491d=fs[_0x1119('0x48')](path[_0x1119('0x3d')](config[_0x1119('0x3e')],'server/files/templates/stun_multiple.ejs'),_0x1119('0x40'));var _0x42bdd5=ejs[_0x1119('0x41')](_0x53491d,{'networks':_0x2a5523||[]});fs[_0x1119('0x42')](_0x1119('0x43'),_0x42bdd5);return respondWithRpcPromise(_0x1119('0x44'),'update',{'module':_0x1119('0x45')});}else if(_0x3fca03[_0x1119('0x1d')]['toUpperCase']()==_0x1119('0x47')){var _0x125957=fs['readFileSync'](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x49')),'utf8');var _0x5ac3fd=ejs[_0x1119('0x41')](_0x125957,{'networks':_0x2a5523||[]});fs[_0x1119('0x42')](_0x1119('0x4a'),_0x5ac3fd);return respondWithRpcPromise(_0x1119('0x44'),'update',{'module':_0x1119('0x45')});}else{var _0x336d1b=fs['readFileSync'](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x4b')),_0x1119('0x40'));var _0x3618c2=ejs[_0x1119('0x41')](_0x336d1b,{'networks':_0x2a5523||[]});fs[_0x1119('0x42')](util[_0x1119('0x4c')](_0x1119('0x4f'),_0x14ffac[_0x1119('0x3b')][_0x1119('0x1d')][_0x1119('0x4d')]()),_0x3618c2);return respondWithRpcPromise(_0x1119('0x44'),_0x1119('0x14'),{'module':_0x1119('0x4e')});}})[_0x1119('0x15')](function(_0x248f50){if(_0x248f50){return _0x3fca03;}return null;})[_0x1119('0x15')](respondWithResult(_0x193371,null))[_0x1119('0xe')](handleError(_0x193371,null));};exports[_0x1119('0x50')]=function(_0x20b5fe,_0x512197){var _0x501d7e;return db['Network'][_0x1119('0x51')]({'where':{'id':_0x20b5fe[_0x1119('0x37')]['id']}})[_0x1119('0x15')](function(_0x28c643){_0x501d7e=_0x28c643;return _0x28c643;})['then'](handleEntityNotFound(_0x512197,null))['then'](removeEntity(_0x512197,null))[_0x1119('0x15')](function(){if(_0x501d7e){return db[_0x1119('0x30')]['findAll']({'where':{'type':_0x501d7e[_0x1119('0x1d')]},'raw':!![]});}})['then'](function(_0x30dc8f){if(_0x501d7e[_0x1119('0x1d')]['toUpperCase']()==_0x1119('0x3c')){var _0x555c2=fs[_0x1119('0x48')](path[_0x1119('0x3d')](config['root'],_0x1119('0x3f')),'utf8');var _0x1d421e=ejs['render'](_0x555c2,{'networks':_0x30dc8f||[]});fs[_0x1119('0x42')](_0x1119('0x43'),_0x1d421e);return respondWithRpcPromise(_0x1119('0x44'),_0x1119('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x501d7e[_0x1119('0x1d')][_0x1119('0x46')]()=='TURN'){var _0x1c5b72=fs[_0x1119('0x48')](path[_0x1119('0x3d')](config[_0x1119('0x3e')],_0x1119('0x49')),_0x1119('0x40'));var _0x4bebfa=ejs[_0x1119('0x41')](_0x1c5b72,{'networks':_0x30dc8f||[]});fs[_0x1119('0x42')](_0x1119('0x4a'),_0x4bebfa);return respondWithRpcPromise(_0x1119('0x44'),_0x1119('0x50'),{'module':_0x1119('0x45')});}else{var _0x1c4d18=fs[_0x1119('0x48')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x1119('0x40'));var _0x3931db=ejs['render'](_0x1c4d18,{'networks':_0x30dc8f||[]});fs[_0x1119('0x42')](util[_0x1119('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x501d7e[_0x1119('0x1d')][_0x1119('0x4d')]()),_0x3931db);return respondWithRpcPromise('Reload',_0x1119('0x50'),{'module':_0x1119('0x4e')});}})['catch'](handleError(_0x512197,null));}; \ No newline at end of file +var _0x9883=['body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','findAll','server/files/templates/turn_multiple.ejs','toLowerCase','util','path','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','http','request','then','info','request\x20sent','debug','error','code','message','Network,\x20%s,\x20%s','result','catch','status','json','limit','undefined','offset','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','create'];(function(_0x3cef4d,_0x3f3516){var _0x8c5437=function(_0x12bf9e){while(--_0x12bf9e){_0x3cef4d['push'](_0x3cef4d['shift']());}};_0x8c5437(++_0x3f3516);}(_0x9883,0x6d));var _0x3988=function(_0x332f6c,_0x5f3dec){_0x332f6c=_0x332f6c-0x0;var _0x239327=_0x9883[_0x332f6c];return _0x239327;};'use strict';var util=require(_0x3988('0x0'));var path=require(_0x3988('0x1'));var ejs=require(_0x3988('0x2'));var fs=require('fs');var _=require(_0x3988('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x3988('0x4'))(_0x3988('0x5'));var config=require(_0x3988('0x6'));var db=require(_0x3988('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x3988('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x260f9a,_0x1ec9eb,_0x107fd6,_0xb37f43){return new Promise(function(_0xc62e37,_0x48f27a){var _0x379f95=_0xb37f43||client;return _0x379f95[_0x3988('0x9')](_0x260f9a,_0x107fd6)[_0x3988('0xa')](function(_0x273915){logger[_0x3988('0xb')]('Network,\x20%s,\x20%s',_0x1ec9eb,_0x3988('0xc'));logger[_0x3988('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x1ec9eb,_0x3988('0xc'),JSON['stringify'](_0x273915));if(_0x273915[_0x3988('0xe')]){if(_0x273915[_0x3988('0xe')][_0x3988('0xf')]===0x1f4){logger[_0x3988('0xe')]('Network,\x20%s,\x20%s',_0x1ec9eb,_0x273915['error'][_0x3988('0x10')]);return _0x48f27a(_0x273915[_0x3988('0xe')][_0x3988('0x10')]);}logger[_0x3988('0xe')](_0x3988('0x11'),_0x1ec9eb,_0x273915[_0x3988('0xe')][_0x3988('0x10')]);return _0xc62e37(_0x273915[_0x3988('0xe')][_0x3988('0x10')]);}else{logger[_0x3988('0xb')]('Network,\x20%s,\x20%s',_0x1ec9eb,'request\x20sent');_0xc62e37(_0x273915[_0x3988('0x12')][_0x3988('0x10')]);}})[_0x3988('0x13')](function(_0xd19919){logger[_0x3988('0xe')](_0x3988('0x11'),_0x1ec9eb,_0xd19919);_0x48f27a(_0xd19919);});});}function respondWithResult(_0x19421b,_0x65680){_0x65680=_0x65680||0xc8;return function(_0x4b5ae7){if(_0x4b5ae7){return _0x19421b[_0x3988('0x14')](_0x65680)[_0x3988('0x15')](_0x4b5ae7);}};}function respondWithFilteredResult(_0x47735a,_0x1b4d6b){return function(_0x3f929b){if(_0x3f929b){var _0x3beb86=typeof _0x1b4d6b['offset']==='undefined'&&typeof _0x1b4d6b[_0x3988('0x16')]===_0x3988('0x17');var _0x3dd319=_0x3f929b['count'];var _0xaebb2=_0x3beb86?0x0:_0x1b4d6b[_0x3988('0x18')];var _0x5aa8ea=_0x3beb86?_0x3f929b[_0x3988('0x19')]:_0x1b4d6b[_0x3988('0x18')]+_0x1b4d6b[_0x3988('0x16')];var _0x5129d7;if(_0x5aa8ea>=_0x3dd319){_0x5aa8ea=_0x3dd319;_0x5129d7=0xc8;}else{_0x5129d7=0xce;}_0x47735a[_0x3988('0x14')](_0x5129d7);return _0x47735a[_0x3988('0x1a')](_0x3988('0x1b'),_0xaebb2+'-'+_0x5aa8ea+'/'+_0x3dd319)[_0x3988('0x15')](_0x3f929b);}return null;};}function saveUpdates(_0x29152f){return function(_0x2162c7){if(_0x2162c7){return _0x2162c7[_0x3988('0x1c')](_0x29152f)[_0x3988('0xa')](function(_0x268617){return _0x268617;});}return null;};}function removeEntity(_0x390197){return function(_0x1b806a){if(_0x1b806a){return _0x1b806a[_0x3988('0x1d')]()['then'](function(){_0x390197[_0x3988('0x14')](0xcc)[_0x3988('0x1e')]();});}};}function handleEntityNotFound(_0x429df1){return function(_0x580a71){if(!_0x580a71){_0x429df1[_0x3988('0x1f')](0x194);}return _0x580a71;};}function handleError(_0x27b201,_0x41f51a){_0x41f51a=_0x41f51a||0x1f4;return function(_0x4824a3){logger[_0x3988('0xe')](_0x4824a3[_0x3988('0x20')]);if(_0x4824a3['name']){delete _0x4824a3[_0x3988('0x21')];}_0x27b201['status'](_0x41f51a)[_0x3988('0x22')](_0x4824a3);};}exports[_0x3988('0x23')]=function(_0xab14d9,_0x28eb85){var _0x2ad2ee={},_0x1535a5={},_0xd59678={'count':0x0,'rows':[]};var _0x1dc1b1=_[_0x3988('0x24')](db[_0x3988('0x25')][_0x3988('0x26')],function(_0x25776e){return{'name':_0x25776e[_0x3988('0x27')],'type':_0x25776e['type'][_0x3988('0x28')]};});_0x1535a5[_0x3988('0x29')]=_[_0x3988('0x24')](_0x1dc1b1,_0x3988('0x21'));_0x1535a5[_0x3988('0x2a')]=_['keys'](_0xab14d9[_0x3988('0x2a')]);_0x1535a5[_0x3988('0x2b')]=_[_0x3988('0x2c')](_0x1535a5['model'],_0x1535a5[_0x3988('0x2a')]);_0x2ad2ee['attributes']=_[_0x3988('0x2c')](_0x1535a5[_0x3988('0x29')],qs[_0x3988('0x2d')](_0xab14d9['query'][_0x3988('0x2d')]));_0x2ad2ee[_0x3988('0x2e')]=_0x2ad2ee[_0x3988('0x2e')][_0x3988('0x2f')]?_0x2ad2ee[_0x3988('0x2e')]:_0x1535a5[_0x3988('0x29')];if(!_0xab14d9[_0x3988('0x2a')][_0x3988('0x30')](_0x3988('0x31'))){_0x2ad2ee[_0x3988('0x16')]=qs[_0x3988('0x16')](_0xab14d9[_0x3988('0x2a')][_0x3988('0x16')]);_0x2ad2ee[_0x3988('0x18')]=qs[_0x3988('0x18')](_0xab14d9['query'][_0x3988('0x18')]);}_0x2ad2ee[_0x3988('0x32')]=qs[_0x3988('0x33')](_0xab14d9[_0x3988('0x2a')]['sort']);_0x2ad2ee['where']=qs[_0x3988('0x2b')](_['pick'](_0xab14d9[_0x3988('0x2a')],_0x1535a5[_0x3988('0x2b')]),_0x1dc1b1);if(_0xab14d9[_0x3988('0x2a')]['filter']){_0x2ad2ee[_0x3988('0x34')]=_[_0x3988('0x35')](_0x2ad2ee[_0x3988('0x34')],{'$or':_['map'](_0x1dc1b1,function(_0x3aaca8){if(_0x3aaca8[_0x3988('0x36')]!==_0x3988('0x37')){var _0x313fad={};_0x313fad[_0x3aaca8[_0x3988('0x21')]]={'$like':'%'+_0xab14d9[_0x3988('0x2a')]['filter']+'%'};return _0x313fad;}})});}_0x2ad2ee=_['merge']({},_0x2ad2ee,_0xab14d9[_0x3988('0x38')]);var _0x93a3d8={'where':_0x2ad2ee[_0x3988('0x34')]};return db[_0x3988('0x25')][_0x3988('0x19')](_0x93a3d8)[_0x3988('0xa')](function(_0x3541c7){_0xd59678[_0x3988('0x19')]=_0x3541c7;if(_0xab14d9[_0x3988('0x2a')][_0x3988('0x39')]){_0x2ad2ee['include']=[{'all':!![]}];}return db[_0x3988('0x25')]['findAll'](_0x2ad2ee);})[_0x3988('0xa')](function(_0x13f2aa){_0xd59678[_0x3988('0x3a')]=_0x13f2aa;return _0xd59678;})[_0x3988('0xa')](respondWithFilteredResult(_0x28eb85,_0x2ad2ee))[_0x3988('0x13')](handleError(_0x28eb85,null));};exports[_0x3988('0x3b')]=function(_0x29da43,_0x82480b){var _0x30e6af={'raw':!![],'where':{'id':_0x29da43[_0x3988('0x3c')]['id']}},_0x14a533={};_0x14a533[_0x3988('0x29')]=_[_0x3988('0x3d')](db[_0x3988('0x25')][_0x3988('0x26')]);_0x14a533[_0x3988('0x2a')]=_[_0x3988('0x3d')](_0x29da43['query']);_0x14a533[_0x3988('0x2b')]=_[_0x3988('0x2c')](_0x14a533['model'],_0x14a533[_0x3988('0x2a')]);_0x30e6af['attributes']=_['intersection'](_0x14a533[_0x3988('0x29')],qs[_0x3988('0x2d')](_0x29da43[_0x3988('0x2a')][_0x3988('0x2d')]));_0x30e6af[_0x3988('0x2e')]=_0x30e6af[_0x3988('0x2e')]['length']?_0x30e6af[_0x3988('0x2e')]:_0x14a533[_0x3988('0x29')];if(_0x29da43[_0x3988('0x2a')][_0x3988('0x39')]){_0x30e6af[_0x3988('0x3e')]=[{'all':!![]}];}_0x30e6af=_[_0x3988('0x35')]({},_0x30e6af,_0x29da43['options']);return db[_0x3988('0x25')][_0x3988('0x3f')](_0x30e6af)[_0x3988('0xa')](handleEntityNotFound(_0x82480b,null))[_0x3988('0xa')](respondWithResult(_0x82480b,null))[_0x3988('0x13')](handleError(_0x82480b,null));};exports[_0x3988('0x40')]=function(_0x55d7fd,_0x1ea514){var _0x51f439;return db['Network'][_0x3988('0x40')](_0x55d7fd['body'],{'raw':!![]})[_0x3988('0xa')](function(_0x2652e1){_0x51f439=_0x2652e1;return db[_0x3988('0x25')]['findAll']({'where':{'type':_0x55d7fd[_0x3988('0x41')][_0x3988('0x36')]},'raw':!![]});})['then'](function(_0x4d3133){if(_0x51f439[_0x3988('0x36')][_0x3988('0x42')]()==_0x3988('0x43')){var _0x495324=fs[_0x3988('0x44')](path[_0x3988('0x45')](config[_0x3988('0x46')],_0x3988('0x47')),_0x3988('0x48'));var _0x25620d=ejs[_0x3988('0x49')](_0x495324,{'networks':_0x4d3133||[]});fs[_0x3988('0x4a')](_0x3988('0x4b'),_0x25620d);return respondWithRpcPromise(_0x3988('0x4c'),'create',{'module':_0x3988('0x4d')});}else if(_0x51f439['type'][_0x3988('0x42')]()==_0x3988('0x4e')){var _0xebae87=fs[_0x3988('0x44')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x3988('0x48'));var _0x2d4dbf=ejs[_0x3988('0x49')](_0xebae87,{'networks':_0x4d3133||[]});fs[_0x3988('0x4a')](_0x3988('0x4f'),_0x2d4dbf);return respondWithRpcPromise(_0x3988('0x4c'),'create',{'module':_0x3988('0x4d')});}else{var _0x4bbf42=fs[_0x3988('0x44')](path[_0x3988('0x45')](config[_0x3988('0x46')],_0x3988('0x50')),_0x3988('0x48'));var _0x1c3bed=ejs['render'](_0x4bbf42,{'networks':_0x4d3133||[]});fs['writeFileSync'](util[_0x3988('0x51')](_0x3988('0x52'),_0x55d7fd['body'][_0x3988('0x36')]['toLowerCase']()),_0x1c3bed);return respondWithRpcPromise(_0x3988('0x4c'),'create',{'module':_0x3988('0x53')});}})['then'](function(){return _0x51f439;})[_0x3988('0xa')](respondWithResult(_0x1ea514,0xc9))[_0x3988('0x13')](handleError(_0x1ea514,null));};exports[_0x3988('0x1c')]=function(_0x5aba50,_0x4935f9){var _0x3387b6;return db[_0x3988('0x25')][_0x3988('0x3f')]({'where':{'id':_0x5aba50[_0x3988('0x3c')]['id']}})[_0x3988('0xa')](handleEntityNotFound(_0x4935f9,null))['then'](saveUpdates(_0x5aba50[_0x3988('0x41')],null))[_0x3988('0xa')](function(_0x45f871){if(_0x45f871){_0x3387b6=_0x45f871;return db[_0x3988('0x25')][_0x3988('0x54')]({'where':{'type':_0x3387b6['type']},'raw':!![]});}return null;})[_0x3988('0xa')](function(_0x273e5c){if(_0x3387b6[_0x3988('0x36')]['toUpperCase']()=='STUN'){var _0x452677=fs[_0x3988('0x44')](path[_0x3988('0x45')](config['root'],_0x3988('0x47')),'utf8');var _0xd26cd2=ejs[_0x3988('0x49')](_0x452677,{'networks':_0x273e5c||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0xd26cd2);return respondWithRpcPromise(_0x3988('0x4c'),_0x3988('0x1c'),{'module':_0x3988('0x4d')});}else if(_0x3387b6[_0x3988('0x36')][_0x3988('0x42')]()==_0x3988('0x4e')){var _0x2d505e=fs['readFileSync'](path['join'](config['root'],_0x3988('0x55')),_0x3988('0x48'));var _0x5d2bbe=ejs['render'](_0x2d505e,{'networks':_0x273e5c||[]});fs[_0x3988('0x4a')]('/etc/asterisk/turn_xcally.conf',_0x5d2bbe);return respondWithRpcPromise(_0x3988('0x4c'),_0x3988('0x1c'),{'module':_0x3988('0x4d')});}else{var _0x1ec2fa=fs[_0x3988('0x44')](path['join'](config['root'],_0x3988('0x50')),_0x3988('0x48'));var _0x43c358=ejs[_0x3988('0x49')](_0x1ec2fa,{'networks':_0x273e5c||[]});fs['writeFileSync'](util[_0x3988('0x51')](_0x3988('0x52'),_0x5aba50[_0x3988('0x41')]['type'][_0x3988('0x56')]()),_0x43c358);return respondWithRpcPromise(_0x3988('0x4c'),'update',{'module':_0x3988('0x53')});}})[_0x3988('0xa')](function(_0x226d76){if(_0x226d76){return _0x3387b6;}return null;})[_0x3988('0xa')](respondWithResult(_0x4935f9,null))[_0x3988('0x13')](handleError(_0x4935f9,null));};exports[_0x3988('0x1d')]=function(_0xd9eeb3,_0x125867){var _0xa080f5;return db[_0x3988('0x25')][_0x3988('0x3f')]({'where':{'id':_0xd9eeb3[_0x3988('0x3c')]['id']}})[_0x3988('0xa')](function(_0x56d756){_0xa080f5=_0x56d756;return _0x56d756;})[_0x3988('0xa')](handleEntityNotFound(_0x125867,null))[_0x3988('0xa')](removeEntity(_0x125867,null))[_0x3988('0xa')](function(){if(_0xa080f5){return db[_0x3988('0x25')]['findAll']({'where':{'type':_0xa080f5[_0x3988('0x36')]},'raw':!![]});}})[_0x3988('0xa')](function(_0x3e8989){if(_0xa080f5[_0x3988('0x36')]['toUpperCase']()=='STUN'){var _0x96836b=fs[_0x3988('0x44')](path[_0x3988('0x45')](config['root'],_0x3988('0x47')),_0x3988('0x48'));var _0x3986c1=ejs['render'](_0x96836b,{'networks':_0x3e8989||[]});fs[_0x3988('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x3986c1);return respondWithRpcPromise(_0x3988('0x4c'),_0x3988('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0xa080f5[_0x3988('0x36')][_0x3988('0x42')]()==_0x3988('0x4e')){var _0x18c5c3=fs['readFileSync'](path[_0x3988('0x45')](config[_0x3988('0x46')],_0x3988('0x55')),_0x3988('0x48'));var _0x59f296=ejs[_0x3988('0x49')](_0x18c5c3,{'networks':_0x3e8989||[]});fs[_0x3988('0x4a')](_0x3988('0x4f'),_0x59f296);return respondWithRpcPromise(_0x3988('0x4c'),_0x3988('0x1d'),{'module':_0x3988('0x4d')});}else{var _0x42342c=fs[_0x3988('0x44')](path[_0x3988('0x45')](config['root'],_0x3988('0x50')),_0x3988('0x48'));var _0x35a10f=ejs['render'](_0x42342c,{'networks':_0x3e8989||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xa080f5[_0x3988('0x36')][_0x3988('0x56')]()),_0x35a10f);return respondWithRpcPromise(_0x3988('0x4c'),_0x3988('0x1d'),{'module':_0x3988('0x53')});}})[_0x3988('0x13')](handleError(_0x125867,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f13d96e..4d0b4e7 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 _0xfe57=['Network','network','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x5d99e0,_0x1e63aa){var _0x136641=function(_0x1aa257){while(--_0x1aa257){_0x5d99e0['push'](_0x5d99e0['shift']());}};_0x136641(++_0x1e63aa);}(_0xfe57,0x195));var _0x7fe5=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xfe57[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7fe5('0x2'));var BPromise=require(_0x7fe5('0x3'));var rp=require(_0x7fe5('0x4'));var fs=require('fs');var path=require(_0x7fe5('0x5'));var rimraf=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var attributes=require(_0x7fe5('0x8'));module[_0x7fe5('0x9')]=function(_0x22e850,_0x188cfb){return _0x22e850[_0x7fe5('0xa')](_0x7fe5('0xb'),attributes,{'tableName':_0x7fe5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0x277bfb,_0x30e01a){var _0x2079dc=function(_0x2a4cc1){while(--_0x2a4cc1){_0x277bfb['push'](_0x277bfb['shift']());}};_0x2079dc(++_0x30e01a);}(_0x99e9,0xb4));var _0x999e=function(_0x38ae4f,_0x1d3180){_0x38ae4f=_0x38ae4f-0x0;var _0x1e92db=_0x99e9[_0x38ae4f];return _0x1e92db;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'network','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 bd8e536..98e2dff 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(_0x315c35,_0x35e947){var _0x717819=function(_0x3ecb8b){while(--_0x3ecb8b){_0x315c35['push'](_0x315c35['shift']());}};_0x717819(++_0x35e947);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +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(_0x3f96df,_0xd87399){var _0x88f46=function(_0x9ab960){while(--_0x9ab960){_0x3f96df['push'](_0x3f96df['shift']());}};_0x88f46(++_0xd87399);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 85c87d8..611b9ef 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 _0x2542=['removeAnswers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','delete'];(function(_0xd7b7c4,_0x3bde33){var _0x3701d4=function(_0x37f7de){while(--_0x37f7de){_0xd7b7c4['push'](_0xd7b7c4['shift']());}};_0x3701d4(++_0x3bde33);}(_0x2542,0x169));var _0x2254=function(_0x1e7ccf,_0x1c602a){_0x1e7ccf=_0x1e7ccf-0x0;var _0x2e6325=_0x2542[_0x1e7ccf];return _0x2e6325;};'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['getInteractions']);router[_0x2254('0x9')](_0x2254('0x16'),auth['isAuthenticated'](),controller[_0x2254('0x17')]);router[_0x2254('0x18')]('/',auth[_0x2254('0xc')](),controller[_0x2254('0x19')]);router[_0x2254('0x18')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x1a')]);router['post'](_0x2254('0x12'),auth[_0x2254('0xc')](),controller[_0x2254('0x1b')]);router[_0x2254('0x18')](_0x2254('0x1c'),controller[_0x2254('0x1d')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x2254('0x1e')]);router[_0x2254('0x18')](_0x2254('0x16'),auth[_0x2254('0xc')](),controller[_0x2254('0x1f')]);router[_0x2254('0x18')]('/:id/send',auth[_0x2254('0xc')](),controller[_0x2254('0x20')]);router[_0x2254('0x21')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2254('0x22')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller['destroy']);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x2254('0x12'),auth[_0x2254('0xc')](),controller[_0x2254('0x23')]);router[_0x2254('0x22')](_0x2254('0x16'),auth[_0x2254('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5f2f=['./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3432b0,_0x5f3622){var _0x483ca7=function(_0x15f8c6){while(--_0x15f8c6){_0x3432b0['push'](_0x3432b0['shift']());}};_0x483ca7(++_0x5f3622);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa3b5cb,_0xf15eca){_0xa3b5cb=_0xa3b5cb-0x0;var _0x43d598=_0x5f2f[_0xa3b5cb];return _0x43d598;};'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/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getInteractions']);router[_0xf5f2('0x9')](_0xf5f2('0x16'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x18')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x18')](_0xf5f2('0x10'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x18')](_0xf5f2('0x1b'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x18')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x18')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router[_0xf5f2('0x18')]('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['post']('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router['put'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x22')]);router[_0xf5f2('0x23')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0x24')]);router[_0xf5f2('0x23')](_0xf5f2('0x10'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);router['delete']('/:id/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x26')]);router[_0xf5f2('0x23')](_0xf5f2('0x16'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x27')]);module[_0xf5f2('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3e27ed1..f43ce13 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 _0x18c8=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate'];(function(_0x50e9d6,_0x4b0f43){var _0x5ec30c=function(_0x3a89c0){while(--_0x3a89c0){_0x50e9d6['push'](_0x50e9d6['shift']());}};_0x5ec30c(++_0x4b0f43);}(_0x18c8,0x158));var _0x818c=function(_0x149926,_0x578455){_0x149926=_0x149926-0x0;var _0x268ff3=_0x18c8[_0x149926];return _0x268ff3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x818c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x818c('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x818c('0x2')],'defaultValue':function(){return rs[_0x818c('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x818c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x818c('0x4')],'defaultValue':function(){return _0x818c('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x818c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x818c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x818c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x818c('0x2')]},'queueTransfer':{'type':Sequelize[_0x818c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x818c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x818c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x818c('0x6')],'defaultValue':![],'comment':_0x818c('0x8'),'set':function(_0xb2d9ea){if(!_0xb2d9ea)this[_0x818c('0x9')](_0x818c('0xa'),null);this[_0x818c('0x9')](_0x818c('0xb'),_0xb2d9ea);}}}; \ No newline at end of file +var _0xfdff=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x12c289,_0x3376b8){var _0x9e28d5=function(_0x33cb58){while(--_0x33cb58){_0x12c289['push'](_0x12c289['shift']());}};_0x9e28d5(++_0x3376b8);}(_0xfdff,0x19a));var _0xffdf=function(_0x303a0c,_0x597a64){_0x303a0c=_0x303a0c-0x0;var _0x47aaf7=_0xfdff[_0x303a0c];return _0x47aaf7;};'use strict';var Sequelize=require(_0xffdf('0x0'));var rs=require('randomstring');module[_0xffdf('0x1')]={'name':{'type':Sequelize[_0xffdf('0x2')],'unique':_0xffdf('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xffdf('0x2')],'defaultValue':function(){return rs[_0xffdf('0x4')]();}},'replyUri':{'type':Sequelize[_0xffdf('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xffdf('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xffdf('0x5');}},'notificationSound':{'type':Sequelize[_0xffdf('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xffdf('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xffdf('0x2')]},'queueTransfer':{'type':Sequelize[_0xffdf('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xffdf('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xffdf('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xffdf('0x6')],'defaultValue':![],'comment':_0xffdf('0x8'),'set':function(_0xcdef6f){if(!_0xcdef6f)this[_0xffdf('0x9')](_0xffdf('0xa'),null);this['setDataValue'](_0xffdf('0xb'),_0xcdef6f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f2bfa0c..e3e4191 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 _0x9c5a=['messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','User','send','out','Messages','dataValues','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','pick','filter','where','merge','type','VIRTUAL','OpenchannelAccount','include','findAll','rows','params','Pause','includeAll','options','find','create','body','user','get','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','order','sort','removeDispositions','ids','addAnswer','CannedAnswer','OpenchannelAccountId','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread'];(function(_0x2d2796,_0x4f3ac3){var _0x5d1502=function(_0x10c48a){while(--_0x10c48a){_0x2d2796['push'](_0x2d2796['shift']());}};_0x5d1502(++_0x4f3ac3);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x484ee2,_0x13ee99){_0x484ee2=_0x484ee2-0x0;var _0x167ad6=_0x9c5a[_0x484ee2];return _0x167ad6;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];config[_0xa9c5('0x17')]=_[_0xa9c5('0x18')](config[_0xa9c5('0x17')],{'host':_0xa9c5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9c5('0x17')]));require(_0xa9c5('0x1a'))[_0xa9c5('0x1b')](socket);var jayson=require(_0xa9c5('0x1c'));var client=jayson[_0xa9c5('0x1d')][_0xa9c5('0x1e')]({'port':0x232c});var client9002=jayson[_0xa9c5('0x1d')][_0xa9c5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x19a43e,_0xcf13f2,_0x4bb57e,_0x2b0d73){return new BPromise(function(_0xd85c32,_0x1ee5ac){var _0x55cce5=_0x2b0d73||client;return _0x55cce5[_0xa9c5('0x1f')](_0x19a43e,_0x4bb57e)[_0xa9c5('0x20')](function(_0x2b9ac5){logger[_0xa9c5('0x21')](_0xa9c5('0x22'),_0xcf13f2,_0xa9c5('0x23'));logger[_0xa9c5('0x24')](_0xa9c5('0x25'),_0xcf13f2,_0xa9c5('0x23'),JSON[_0xa9c5('0x26')](_0x2b9ac5));if(_0x2b9ac5[_0xa9c5('0x27')]){if(_0x2b9ac5[_0xa9c5('0x27')]['code']===0x1f4){logger[_0xa9c5('0x27')](_0xa9c5('0x22'),_0xcf13f2,_0x2b9ac5['error']['message']);return _0x1ee5ac(_0x2b9ac5[_0xa9c5('0x27')][_0xa9c5('0x28')]);}logger[_0xa9c5('0x27')](_0xa9c5('0x22'),_0xcf13f2,_0x2b9ac5[_0xa9c5('0x27')][_0xa9c5('0x28')]);return _0xd85c32(_0x2b9ac5['error']['message']);}else{logger[_0xa9c5('0x21')](_0xa9c5('0x22'),_0xcf13f2,'request\x20sent');_0xd85c32(_0x2b9ac5[_0xa9c5('0x29')][_0xa9c5('0x28')]);}})[_0xa9c5('0x2a')](function(_0x32fc7d){logger[_0xa9c5('0x27')](_0xa9c5('0x22'),_0xcf13f2,_0x32fc7d);_0x1ee5ac(_0x32fc7d);});});}function respondWithStatusCode(_0xe44e6d,_0x51b64a){_0x51b64a=_0x51b64a||0xcc;return function(_0x4e8a7f){if(_0x4e8a7f){return _0xe44e6d[_0xa9c5('0x2b')](_0x51b64a);}return _0xe44e6d['status'](_0x51b64a)[_0xa9c5('0x2c')]();};}function respondWithResult(_0x830bad,_0x4caefa){_0x4caefa=_0x4caefa||0xc8;return function(_0x11a723){if(_0x11a723){return _0x830bad[_0xa9c5('0x2d')](_0x4caefa)['json'](_0x11a723);}};}function respondWithFilteredResult(_0x413edf,_0x32baf9){return function(_0x198cdf){if(_0x198cdf){var _0x185eb8=typeof _0x32baf9[_0xa9c5('0x2e')]==='undefined'&&typeof _0x32baf9[_0xa9c5('0x2f')]==='undefined';var _0x3c3da7=_0x198cdf[_0xa9c5('0x30')];var _0x2eeed1=_0x185eb8?0x0:_0x32baf9['offset'];var _0xc6d0c1=_0x185eb8?_0x198cdf[_0xa9c5('0x30')]:_0x32baf9['offset']+_0x32baf9[_0xa9c5('0x2f')];var _0xc454fd;if(_0xc6d0c1>=_0x3c3da7){_0xc6d0c1=_0x3c3da7;_0xc454fd=0xc8;}else{_0xc454fd=0xce;}_0x413edf[_0xa9c5('0x2d')](_0xc454fd);return _0x413edf[_0xa9c5('0x31')](_0xa9c5('0x32'),_0x2eeed1+'-'+_0xc6d0c1+'/'+_0x3c3da7)[_0xa9c5('0x33')](_0x198cdf);}return null;};}function patchUpdates(_0x3a66d8){return function(_0x4b9104){try{jsonpatch[_0xa9c5('0x34')](_0x4b9104,_0x3a66d8,!![]);}catch(_0x3bdf64){return BPromise[_0xa9c5('0x35')](_0x3bdf64);}return _0x4b9104[_0xa9c5('0x36')]();};}function saveUpdates(_0x1c617c,_0x2de191){return function(_0x226427){if(_0x226427){return _0x226427[_0xa9c5('0x37')](_0x1c617c)['then'](function(_0x4e3f3e){return _0x4e3f3e;});}return null;};}function removeEntity(_0x1487a4,_0x30a0e8){return function(_0xf2bebc){if(_0xf2bebc){return _0xf2bebc[_0xa9c5('0x38')]()[_0xa9c5('0x20')](function(){var _0x25121e=_0xf2bebc['get']({'plain':!![]});var _0x598920='OpenchannelAccounts';return db[_0xa9c5('0x39')][_0xa9c5('0x38')]({'where':{'type':_0x598920,'resourceId':_0x25121e['id']}})['then'](function(){return _0xf2bebc;});})[_0xa9c5('0x20')](function(){_0x1487a4['status'](0xcc)[_0xa9c5('0x2c')]();});}};}function handleEntityNotFound(_0x1fc8bf,_0x2567be){return function(_0x29b17c){if(!_0x29b17c){_0x1fc8bf['sendStatus'](0x194);}return _0x29b17c;};}function handleError(_0x675588,_0x2cd721){_0x2cd721=_0x2cd721||0x1f4;return function(_0x191153){logger[_0xa9c5('0x27')](_0x191153[_0xa9c5('0x3a')]);if(_0x191153[_0xa9c5('0x3b')]){delete _0x191153[_0xa9c5('0x3b')];}_0x675588[_0xa9c5('0x2d')](_0x2cd721)['send'](_0x191153);};}exports[_0xa9c5('0x3c')]=function(_0x46e5d2,_0x841c18){var _0x2b95fa={'include':[{'model':db['Pause'],'as':_0xa9c5('0x3d')}]},_0x1132e0={},_0x14f608={'count':0x0,'rows':[]};var _0x5b7a0a=_[_0xa9c5('0x3e')](db['OpenchannelAccount'][_0xa9c5('0x3f')],function(_0xd4305d){return{'name':_0xd4305d[_0xa9c5('0x40')],'type':_0xd4305d['type'][_0xa9c5('0x41')]};});_0x1132e0[_0xa9c5('0x42')]=_[_0xa9c5('0x3e')](_0x5b7a0a,_0xa9c5('0x3b'));_0x1132e0['query']=_[_0xa9c5('0x43')](_0x46e5d2[_0xa9c5('0x44')]);_0x1132e0[_0xa9c5('0x45')]=_[_0xa9c5('0x46')](_0x1132e0[_0xa9c5('0x42')],_0x1132e0['query']);_0x2b95fa[_0xa9c5('0x47')]=_['intersection'](_0x1132e0[_0xa9c5('0x42')],qs[_0xa9c5('0x48')](_0x46e5d2[_0xa9c5('0x44')][_0xa9c5('0x48')]));_0x2b95fa[_0xa9c5('0x47')]=_0x2b95fa[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x2b95fa[_0xa9c5('0x47')]:_0x1132e0[_0xa9c5('0x42')];if(!_0x46e5d2[_0xa9c5('0x44')]['hasOwnProperty'](_0xa9c5('0x4a'))){_0x2b95fa[_0xa9c5('0x2f')]=qs[_0xa9c5('0x2f')](_0x46e5d2[_0xa9c5('0x44')][_0xa9c5('0x2f')]);_0x2b95fa[_0xa9c5('0x2e')]=qs['offset'](_0x46e5d2[_0xa9c5('0x44')][_0xa9c5('0x2e')]);}_0x2b95fa['order']=qs['sort'](_0x46e5d2['query']['sort']);_0x2b95fa['where']=qs[_0xa9c5('0x45')](_[_0xa9c5('0x4b')](_0x46e5d2[_0xa9c5('0x44')],_0x1132e0[_0xa9c5('0x45')]),_0x5b7a0a);if(_0x46e5d2[_0xa9c5('0x44')][_0xa9c5('0x4c')]){_0x2b95fa[_0xa9c5('0x4d')]=_[_0xa9c5('0x4e')](_0x2b95fa[_0xa9c5('0x4d')],{'$or':_[_0xa9c5('0x3e')](_0x5b7a0a,function(_0x414ffb){if(_0x414ffb[_0xa9c5('0x4f')]!==_0xa9c5('0x50')){var _0x4bf8b4={};_0x4bf8b4[_0x414ffb[_0xa9c5('0x3b')]]={'$like':'%'+_0x46e5d2['query'][_0xa9c5('0x4c')]+'%'};return _0x4bf8b4;}})});}_0x2b95fa=_[_0xa9c5('0x4e')]({},_0x2b95fa,_0x46e5d2['options']);var _0x5cbd33={'where':_0x2b95fa[_0xa9c5('0x4d')]};return db[_0xa9c5('0x51')][_0xa9c5('0x30')](_0x5cbd33)['then'](function(_0x584504){_0x14f608[_0xa9c5('0x30')]=_0x584504;if(_0x46e5d2[_0xa9c5('0x44')]['includeAll']){_0x2b95fa[_0xa9c5('0x52')]=[{'all':!![]}];}return db[_0xa9c5('0x51')][_0xa9c5('0x53')](_0x2b95fa);})[_0xa9c5('0x20')](function(_0x34020f){_0x14f608[_0xa9c5('0x54')]=_0x34020f;return _0x14f608;})['then'](respondWithFilteredResult(_0x841c18,_0x2b95fa))['catch'](handleError(_0x841c18,null));};exports['show']=function(_0x4317d8,_0x277903){var _0x45037e={'raw':![],'where':{'id':_0x4317d8[_0xa9c5('0x55')]['id']},'include':[{'model':db[_0xa9c5('0x56')],'as':'mandatoryDispositionPause'}]},_0xef4d2={};_0xef4d2[_0xa9c5('0x42')]=_[_0xa9c5('0x43')](db[_0xa9c5('0x51')][_0xa9c5('0x3f')]);_0xef4d2[_0xa9c5('0x44')]=_[_0xa9c5('0x43')](_0x4317d8['query']);_0xef4d2['filters']=_[_0xa9c5('0x46')](_0xef4d2['model'],_0xef4d2[_0xa9c5('0x44')]);_0x45037e['attributes']=_[_0xa9c5('0x46')](_0xef4d2[_0xa9c5('0x42')],qs[_0xa9c5('0x48')](_0x4317d8['query'][_0xa9c5('0x48')]));_0x45037e[_0xa9c5('0x47')]=_0x45037e[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x45037e['attributes']:_0xef4d2['model'];if(_0x4317d8[_0xa9c5('0x44')][_0xa9c5('0x57')]){_0x45037e[_0xa9c5('0x52')]=[{'all':!![]}];}_0x45037e=_['merge']({},_0x45037e,_0x4317d8[_0xa9c5('0x58')]);return db[_0xa9c5('0x51')][_0xa9c5('0x59')](_0x45037e)[_0xa9c5('0x20')](handleEntityNotFound(_0x277903,null))[_0xa9c5('0x20')](respondWithResult(_0x277903,null))[_0xa9c5('0x2a')](handleError(_0x277903,null));};exports[_0xa9c5('0x5a')]=function(_0x298b3d,_0x5a7f0a){return db[_0xa9c5('0x51')]['create'](_0x298b3d[_0xa9c5('0x5b')],{})[_0xa9c5('0x20')](function(_0x26bda1){var _0x4dfe3a=_0x298b3d[_0xa9c5('0x5c')][_0xa9c5('0x5d')]({'plain':!![]});if(!_0x4dfe3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dfe3a[_0xa9c5('0x5e')]===_0xa9c5('0x5c')){var _0x13a708=_0x26bda1[_0xa9c5('0x5d')]({'plain':!![]});var _0x49f91c=_0xa9c5('0x5f');return db[_0xa9c5('0x60')][_0xa9c5('0x59')]({'where':{'name':_0x49f91c,'userProfileId':_0x4dfe3a[_0xa9c5('0x61')]},'raw':!![]})['then'](function(_0x5538ad){if(_0x5538ad&&_0x5538ad[_0xa9c5('0x62')]===0x0){return db[_0xa9c5('0x39')][_0xa9c5('0x5a')]({'name':_0x13a708[_0xa9c5('0x3b')],'resourceId':_0x13a708['id'],'type':_0x5538ad[_0xa9c5('0x3b')],'sectionId':_0x5538ad['id']},{})[_0xa9c5('0x20')](function(){return _0x26bda1;});}else{return _0x26bda1;}})['catch'](function(_0x86be71){logger[_0xa9c5('0x27')](_0xa9c5('0x63'),_0x86be71);throw _0x86be71;});}return _0x26bda1;})[_0xa9c5('0x20')](respondWithResult(_0x5a7f0a,0xc9))[_0xa9c5('0x2a')](handleError(_0x5a7f0a,null));};exports[_0xa9c5('0x37')]=function(_0x13204c,_0xbca251){if(_0x13204c[_0xa9c5('0x5b')]['id']){delete _0x13204c[_0xa9c5('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x13204c[_0xa9c5('0x55')]['id']},'include':[{'model':db[_0xa9c5('0x56')],'as':_0xa9c5('0x3d')}]})[_0xa9c5('0x20')](handleEntityNotFound(_0xbca251,null))['then'](saveUpdates(_0x13204c[_0xa9c5('0x5b')],null))['then'](respondWithResult(_0xbca251,null))[_0xa9c5('0x2a')](handleError(_0xbca251,null));};exports[_0xa9c5('0x38')]=function(_0x325424,_0x3d47cd){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0x325424[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x3d47cd,null))[_0xa9c5('0x20')](removeEntity(_0x3d47cd,null))[_0xa9c5('0x2a')](handleError(_0x3d47cd,null));};exports[_0xa9c5('0x64')]=function(_0x26c221,_0x59cfee){return db[_0xa9c5('0x51')][_0xa9c5('0x64')]()[_0xa9c5('0x20')](respondWithResult(_0x59cfee,null))[_0xa9c5('0x2a')](handleError(_0x59cfee,null));};exports[_0xa9c5('0x65')]=function(_0x3a8e33,_0x28ba54,_0x4dc5ab){if(_0x3a8e33['body']['id']){delete _0x3a8e33[_0xa9c5('0x5b')]['id'];}return db['OpenchannelAccount'][_0xa9c5('0x59')]({'where':{'id':_0x3a8e33[_0xa9c5('0x55')]['id']}})['then'](handleEntityNotFound(_0x28ba54,null))[_0xa9c5('0x20')](function(_0x3db169){if(_0x3db169){_0x3a8e33['body']['OpenchannelAccountId']=_0x3db169['id'];return db[_0xa9c5('0x66')][_0xa9c5('0x5a')](_0x3a8e33[_0xa9c5('0x5b')]);}})['then'](respondWithResult(_0x28ba54,null))['catch'](handleError(_0x28ba54,null));};exports[_0xa9c5('0x67')]=function(_0x3317c3,_0x4b36a3,_0xd0371c){var _0x393b00={'raw':![],'where':{}};var _0x2a3368={};var _0x3c0c7a={'count':0x0,'rows':[]};return db[_0xa9c5('0x51')][_0xa9c5('0x68')]({'where':{'id':_0x3317c3['params']['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x4b36a3,null))[_0xa9c5('0x20')](function(_0x4586ba){if(_0x4586ba){_0x2a3368[_0xa9c5('0x42')]=_['keys'](db[_0xa9c5('0x66')][_0xa9c5('0x3f')]);_0x2a3368['query']=_[_0xa9c5('0x43')](_0x3317c3[_0xa9c5('0x44')]);_0x2a3368[_0xa9c5('0x45')]=_['intersection'](_0x2a3368[_0xa9c5('0x42')],_0x2a3368[_0xa9c5('0x44')]);_0x393b00[_0xa9c5('0x47')]=_[_0xa9c5('0x46')](_0x2a3368[_0xa9c5('0x42')],qs[_0xa9c5('0x48')](_0x3317c3[_0xa9c5('0x44')]['fields']));_0x393b00[_0xa9c5('0x47')]=_0x393b00[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x393b00[_0xa9c5('0x47')]:_0x2a3368[_0xa9c5('0x42')];if(!_0x3317c3[_0xa9c5('0x44')][_0xa9c5('0x69')](_0xa9c5('0x4a'))){_0x393b00[_0xa9c5('0x2f')]=qs[_0xa9c5('0x2f')](_0x3317c3[_0xa9c5('0x44')]['limit']);_0x393b00[_0xa9c5('0x2e')]=qs[_0xa9c5('0x2e')](_0x3317c3['query'][_0xa9c5('0x2e')]);}_0x393b00[_0xa9c5('0x6a')]=qs[_0xa9c5('0x6b')](_0x3317c3['query'][_0xa9c5('0x6b')]);_0x393b00[_0xa9c5('0x4d')]=qs[_0xa9c5('0x45')](_[_0xa9c5('0x4b')](_0x3317c3['query'],_0x2a3368[_0xa9c5('0x45')]));_0x393b00[_0xa9c5('0x4d')]['OpenchannelAccountId']=_0x4586ba['id'];if(_0x3317c3['query']['filter']){_0x393b00['where']=_['merge'](_0x393b00['where'],{'$or':_['map'](_0x393b00['attributes'],function(_0x2fb53d){var _0x21797e={};_0x21797e[_0x2fb53d]={'$like':'%'+_0x3317c3[_0xa9c5('0x44')][_0xa9c5('0x4c')]+'%'};return _0x21797e;})});}_0x393b00=_[_0xa9c5('0x4e')]({},_0x393b00,_0x3317c3['options']);return db['Disposition']['count']({'where':_0x393b00['where']})[_0xa9c5('0x20')](function(_0xf9d2c0){_0x3c0c7a[_0xa9c5('0x30')]=_0xf9d2c0;if(_0x3317c3[_0xa9c5('0x44')]['includeAll']){_0x393b00['include']=[{'all':!![]}];}return db[_0xa9c5('0x66')][_0xa9c5('0x53')](_0x393b00);})[_0xa9c5('0x20')](function(_0x2b118d){_0x3c0c7a[_0xa9c5('0x54')]=_0x2b118d;return _0x3c0c7a;});}})['then'](respondWithFilteredResult(_0x4b36a3,_0x393b00))[_0xa9c5('0x2a')](handleError(_0x4b36a3,null));};exports[_0xa9c5('0x6c')]=function(_0xd063cf,_0x58de52,_0x26c81e){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0xd063cf[_0xa9c5('0x55')]['id']}})['then'](handleEntityNotFound(_0x58de52,null))[_0xa9c5('0x20')](function(_0x22c63b){if(_0x22c63b){return _0x22c63b['removeDispositions'](_0xd063cf['query'][_0xa9c5('0x6d')]);}})['then'](respondWithStatusCode(_0x58de52,null))['catch'](handleError(_0x58de52,null));};exports[_0xa9c5('0x6e')]=function(_0x2f49de,_0xa18f0d,_0x2f9757){if(_0x2f49de[_0xa9c5('0x5b')]['id']){delete _0x2f49de['body']['id'];}return db[_0xa9c5('0x51')]['find']({'where':{'id':_0x2f49de[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0xa18f0d,null))[_0xa9c5('0x20')](function(_0x3a324b){if(_0x3a324b){_0x2f49de['body']['OpenchannelAccountId']=_0x3a324b['id'];return db[_0xa9c5('0x6f')]['create'](_0x2f49de['body']);}})[_0xa9c5('0x20')](respondWithResult(_0xa18f0d,null))[_0xa9c5('0x2a')](handleError(_0xa18f0d,null));};exports['getAnswers']=function(_0x5b6d59,_0x4335ff,_0x187d59){var _0x9f7ad9={'raw':![],'where':{}};var _0x39492d={};var _0x57e73c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa9c5('0x68')]({'where':{'id':_0x5b6d59[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x4335ff,null))[_0xa9c5('0x20')](function(_0x2f80d9){if(_0x2f80d9){_0x39492d[_0xa9c5('0x42')]=_[_0xa9c5('0x43')](db['CannedAnswer'][_0xa9c5('0x3f')]);_0x39492d[_0xa9c5('0x44')]=_['keys'](_0x5b6d59[_0xa9c5('0x44')]);_0x39492d[_0xa9c5('0x45')]=_['intersection'](_0x39492d[_0xa9c5('0x42')],_0x39492d[_0xa9c5('0x44')]);_0x9f7ad9[_0xa9c5('0x47')]=_[_0xa9c5('0x46')](_0x39492d[_0xa9c5('0x42')],qs[_0xa9c5('0x48')](_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x48')]));_0x9f7ad9[_0xa9c5('0x47')]=_0x9f7ad9[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x9f7ad9[_0xa9c5('0x47')]:_0x39492d[_0xa9c5('0x42')];if(!_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x69')](_0xa9c5('0x4a'))){_0x9f7ad9[_0xa9c5('0x2f')]=qs['limit'](_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x2f')]);_0x9f7ad9[_0xa9c5('0x2e')]=qs['offset'](_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x2e')]);}_0x9f7ad9['order']=qs[_0xa9c5('0x6b')](_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x6b')]);_0x9f7ad9[_0xa9c5('0x4d')]=qs[_0xa9c5('0x45')](_[_0xa9c5('0x4b')](_0x5b6d59[_0xa9c5('0x44')],_0x39492d[_0xa9c5('0x45')]));_0x9f7ad9[_0xa9c5('0x4d')][_0xa9c5('0x70')]=_0x2f80d9['id'];if(_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x4c')]){_0x9f7ad9[_0xa9c5('0x4d')]=_['merge'](_0x9f7ad9['where'],{'$or':_[_0xa9c5('0x3e')](_0x9f7ad9[_0xa9c5('0x47')],function(_0x5a7508){var _0x3c3476={};_0x3c3476[_0x5a7508]={'$like':'%'+_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x4c')]+'%'};return _0x3c3476;})});}_0x9f7ad9=_[_0xa9c5('0x4e')]({},_0x9f7ad9,_0x5b6d59['options']);return db['CannedAnswer'][_0xa9c5('0x30')]({'where':_0x9f7ad9[_0xa9c5('0x4d')]})[_0xa9c5('0x20')](function(_0x5e5143){_0x57e73c[_0xa9c5('0x30')]=_0x5e5143;if(_0x5b6d59[_0xa9c5('0x44')][_0xa9c5('0x57')]){_0x9f7ad9['include']=[{'all':!![]}];}return db[_0xa9c5('0x6f')][_0xa9c5('0x53')](_0x9f7ad9);})[_0xa9c5('0x20')](function(_0x1a09f0){_0x57e73c[_0xa9c5('0x54')]=_0x1a09f0;return _0x57e73c;});}})[_0xa9c5('0x20')](respondWithFilteredResult(_0x4335ff,_0x9f7ad9))[_0xa9c5('0x2a')](handleError(_0x4335ff,null));};exports[_0xa9c5('0x71')]=function(_0x46d0b1,_0x13ac1f,_0x133a2c){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0x46d0b1[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x13ac1f,null))['then'](function(_0x48baf5){if(_0x48baf5){return _0x48baf5['removeAnswers'](_0x46d0b1[_0xa9c5('0x44')][_0xa9c5('0x6d')]);}})['then'](respondWithStatusCode(_0x13ac1f,null))[_0xa9c5('0x2a')](handleError(_0x13ac1f,null));};exports[_0xa9c5('0x72')]=function(_0x5646ab,_0x428223,_0x36d10b){var _0x2f853b={'body':_0x5646ab[_0xa9c5('0x5b')],'channel':_0xa9c5('0x73')};var _0x4aa0ba=[];var _0x70d779=[];var _0xcd70eb={};var _0x2e41da=![];return db[_0xa9c5('0x74')][_0xa9c5('0x64')]()[_0xa9c5('0x20')](function(_0x3050a6){if(!_0x3050a6){throw new db[(_0xa9c5('0x75'))][(_0xa9c5('0x76'))](_0xa9c5('0x77'));}_0x4aa0ba=_[_0xa9c5('0x78')](_[_0xa9c5('0x43')](_0x3050a6),[_0xa9c5('0x79'),'updatedAt']);_0x70d779=_['difference'](_[_0xa9c5('0x43')](_0x3050a6),[_0xa9c5('0x79'),_0xa9c5('0x7a'),_0xa9c5('0x7b'),'ListId']);if(_0x5646ab[_0xa9c5('0x5b')]['id']){delete _0x5646ab['body']['id'];}if(_['isNil'](_0x5646ab['body'][_0xa9c5('0x7c')])){throw new db[(_0xa9c5('0x75'))]['ValidationError'](_0xa9c5('0x7d'));}if(_[_0xa9c5('0x7e')](_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x5b')])||_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x5b')]===''){throw new db[(_0xa9c5('0x75'))]['ValidationError'](_0xa9c5('0x7f'));}if(_['isNil'](_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x80')])){throw new db[(_0xa9c5('0x75'))][(_0xa9c5('0x76'))](_0xa9c5('0x81')+_0x70d779);}if(!_[_0xa9c5('0x82')](_0x70d779,_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x80')])){throw new db['Sequelize'][(_0xa9c5('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x70d779);}_0xcd70eb[_0x5646ab[_0xa9c5('0x5b')]['mapKey']]=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x7c')];})[_0xa9c5('0x20')](function(){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0x5646ab[_0xa9c5('0x55')]['id']},'include':[{'model':db[_0xa9c5('0x83')],'as':_0xa9c5('0x84'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xcd70eb,'limit':0x1,'order':[[_0xa9c5('0x7a'),_0xa9c5('0x85')]]}]},{'model':db[_0xa9c5('0x86')],'as':_0xa9c5('0x87')}]});})['then'](handleEntityNotFound(_0x428223,null))['then'](function(_0x214caa){if(_0x214caa&&_0x214caa[_0xa9c5('0x84')]){_0x2f853b[_0xa9c5('0x88')]=_0x214caa;_0x2f853b[_0xa9c5('0x89')]=_0x214caa[_0xa9c5('0x87')];_0x2f853b[_0xa9c5('0x8a')]=_0x214caa[_0xa9c5('0x84')];_0x2f853b[_0xa9c5('0x89')]=_[_0xa9c5('0x8b')](_0x2f853b['applications'],[_0xa9c5('0x8c')],[_0xa9c5('0x8d')]);if(_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x87')]){delete _0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x87')];}if(_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x84')]&&_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x84')][_0xa9c5('0x8e')][_0xa9c5('0x49')]){return _0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x84')][_0xa9c5('0x8e')][0x0];}var _0x5aa562=_[_0xa9c5('0x18')](_0x5646ab[_0xa9c5('0x5b')],{'firstName':_0x5646ab[_0xa9c5('0x5b')]['from'],'ListId':_0x214caa[_0xa9c5('0x8f')]});_0x5aa562[_0x5646ab['body'][_0xa9c5('0x80')]]=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x7c')];return db[_0xa9c5('0x74')][_0xa9c5('0x5a')](_0x5aa562,{'fields':_0x4aa0ba,'raw':!![]});}})[_0xa9c5('0x20')](handleEntityNotFound(_0x428223,null))[_0xa9c5('0x20')](function(_0x102868){_0x2f853b[_0xa9c5('0x90')]=_0x102868;if(_0x102868){var _0x4dfb6c={'ContactId':_0x102868['id'],'OpenchannelAccountId':_0x5646ab[_0xa9c5('0x55')]['id'],'from':(_0x102868[_0xa9c5('0x91')]||'')+'\x20'+(_0x102868[_0xa9c5('0x92')]||'')};var _0x15aafd={'OpenchannelAccountId':_0x5646ab[_0xa9c5('0x55')]['id'],'closed':![]};if(_0x5646ab['body'][_0xa9c5('0x93')]){_0x15aafd[_0xa9c5('0x93')]=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x93')];return db[_0xa9c5('0x94')]['find']({'where':_0x15aafd})[_0xa9c5('0x20')](function(_0x576ab6){if(_0x576ab6){return[_0x576ab6,![]];}_0x4dfb6c[_0xa9c5('0x93')]=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x93')];_0x4dfb6c[_0xa9c5('0x95')]=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x95')];return db[_0xa9c5('0x94')][_0xa9c5('0x5a')](_0x4dfb6c)[_0xa9c5('0x20')](function(_0x1400b2){return[_0x1400b2,!![]];});});}else{_0x15aafd[_0xa9c5('0x93')]=null;}_0x15aafd[_0xa9c5('0x96')]=_0x102868['id'];return db[_0xa9c5('0x94')][_0xa9c5('0x59')]({'where':_0x15aafd})[_0xa9c5('0x20')](function(_0x452650){if(_0x452650){return[_0x452650,![]];}return db[_0xa9c5('0x94')]['create'](_0x4dfb6c)[_0xa9c5('0x20')](function(_0x370429){return[_0x370429,!![]];});});}})[_0xa9c5('0x97')](function(_0x3c2d45,_0x383e75){if(_0x3c2d45){_0x2e41da=_0x383e75;if(!_0x383e75){var _0xdc16e9={'from':(_0x2f853b[_0xa9c5('0x90')][_0xa9c5('0x91')]||'')+'\x20'+(_0x2f853b['contact'][_0xa9c5('0x92')]||'')};if(_0x5646ab[_0xa9c5('0x5b')]['threadId']&&_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x98')]&&_0x5646ab['body']['threadId']!=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x98')]){_0xdc16e9['threadId']=_0x5646ab[_0xa9c5('0x5b')][_0xa9c5('0x98')];}return _0x3c2d45[_0xa9c5('0x37')](_0xdc16e9);}else{return _0x3c2d45;}}})[_0xa9c5('0x20')](function(_0x40350d){_0x2f853b[_0xa9c5('0x99')]=_0x40350d[_0xa9c5('0x5d')]({'plain':!![]});_0x2f853b[_0xa9c5('0x99')][_0xa9c5('0x9a')]=_0x2e41da;if(_0x2f853b['interaction'][_0xa9c5('0x9a')]){if(_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0x9b')]){_0x2f853b[_0xa9c5('0x89')]['push']({'id':0x0,'priority':_0x2f853b['applications'][_0xa9c5('0x49')]+0x1,'app':_0xa9c5('0x9c'),'appdata':_0xa9c5('0x9d'),'interval':_0xa9c5('0x9e')});}}return db[_0xa9c5('0x9f')][_0xa9c5('0x5a')]({'body':_0x5646ab['body'][_0xa9c5('0x5b')],'OpenchannelAccountId':_0x5646ab[_0xa9c5('0x55')]['id'],'OpenchannelInteractionId':_0x40350d['id'],'direction':'in','ContactId':_0x2f853b[_0xa9c5('0x90')]['id'],'AttachmentId':_0x5646ab['body'][_0xa9c5('0xa0')]});})[_0xa9c5('0x20')](function(_0x54a495){_0x2f853b[_0xa9c5('0x28')]=_0x54a495;if(!_0x2f853b['interaction'][_0xa9c5('0xa1')])return;return db['User']['find']({'attributes':['id',_0xa9c5('0x3b')],'where':{'id':_0x2f853b[_0xa9c5('0x99')]['UserId']}});})['then'](function(_0x9c3349){if(_0x9c3349){_0x2f853b[_0xa9c5('0x89')][_0xa9c5('0xa2')]({'id':0x0,'priority':0x0,'app':_0xa9c5('0xa3'),'appdata':_0x9c3349['name']+','+(_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0xa4')]||0xa),'interval':'*,*,*,*'});}if(!_0x2f853b['interaction'][_0xa9c5('0xa5')])return;return db['OpenchannelQueue'][_0xa9c5('0x59')]({'attributes':['id','name'],'where':{'id':_0x2f853b[_0xa9c5('0x99')]['queueId']}});})[_0xa9c5('0x20')](function(_0x27ceea){if(_0x27ceea){_0x2f853b[_0xa9c5('0x89')]['unshift']({'id':0x0,'priority':0x1,'app':_0xa9c5('0xa6'),'appdata':_0x27ceea[_0xa9c5('0x3b')]+','+(_0x2f853b[_0xa9c5('0x88')][_0xa9c5('0xa7')]||0x12c),'interval':_0xa9c5('0x9e')});}return respondWithRpcPromise(_0xa9c5('0xa8'),_0xa9c5('0xa9'),_0x2f853b);})[_0xa9c5('0x20')](function(_0x37bdd7){respondWithRpcPromise(_0xa9c5('0xaa'),_0xa9c5('0xaa'),{'event':_0xa9c5('0x72'),'message':_0x37bdd7},client9002);return _0x37bdd7;})[_0xa9c5('0x20')](respondWithResult(_0x428223,null))[_0xa9c5('0x2a')](handleError(_0x428223,null));};exports[_0xa9c5('0xab')]=function(_0x2f8ccf,_0x1e2b13){var _0x416a8c=_0x2f8ccf[_0xa9c5('0x55')]['id'];var _0x1b54dc=_0x2f8ccf[_0xa9c5('0x5b')];var _0x1dcebb=0xc8;var _0x12170a=null;return db[_0xa9c5('0xac')][_0xa9c5('0xad')]({'isolationLevel':db['sequelize'][_0xa9c5('0xae')][_0xa9c5('0xaf')][_0xa9c5('0xb0')]},function(_0xa8905e){return db['OpenchannelAccount'][_0xa9c5('0x68')]({'where':{'id':_0x416a8c},'transaction':_0xa8905e})['then'](function(_0x21a87e){if(_0x21a87e){return db['OpenchannelApplication'][_0xa9c5('0x38')]({'where':{'OpenchannelAccountId':_0x416a8c},'transaction':_0xa8905e})['then'](function(){var _0x22424e=_[_0xa9c5('0x3e')](_0x1b54dc,function(_0x1c9d1f){_0x1c9d1f[_0xa9c5('0x70')]=_0x416a8c;return _0x1c9d1f;});return db['OpenchannelApplication'][_0xa9c5('0xb1')](_0x22424e,{'transaction':_0xa8905e});});}else{_0x1dcebb=0x194;_0x12170a=[];}});})[_0xa9c5('0x20')](function(){if(_0x1dcebb!==0x194){return db[_0xa9c5('0x86')][_0xa9c5('0xb2')]({'where':{'OpenchannelAccountId':_0x416a8c},'order':_0xa9c5('0x8c')})['then'](function(_0x3f5a78){_0x12170a=_0x3f5a78;});}})[_0xa9c5('0x2a')](function(_0x15d384){_0x1dcebb=0x1f4;logger['error'](_0x15d384[_0xa9c5('0x3a')]);if(_0x15d384[_0xa9c5('0x3b')]){delete _0x15d384[_0xa9c5('0x3b')];}_0x12170a=_0x15d384;})[_0xa9c5('0xb3')](function(){if(_0x12170a===null){_0x1e2b13['sendStatus'](_0x1dcebb);}else{if(_0x1dcebb===0x1f4){_0x1e2b13['status'](_0x1dcebb)['send'](_0x12170a);}else{_0x1e2b13[_0xa9c5('0x2d')](_0x1dcebb)[_0xa9c5('0x33')](_0x12170a);}}});};exports['getApplications']=function(_0xe2eebc,_0x585316,_0x592b18){var _0x4d4e9d={};var _0x2d4389={};var _0x3085cb;var _0x1c1141;return db[_0xa9c5('0x51')][_0xa9c5('0x68')]({'where':{'id':_0xe2eebc[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x585316,null))[_0xa9c5('0x20')](function(_0x3a7bfd){if(_0x3a7bfd){_0x3085cb=_0x3a7bfd;_0x2d4389[_0xa9c5('0x42')]=_[_0xa9c5('0x43')](db['OpenchannelApplication'][_0xa9c5('0x3f')]);_0x2d4389[_0xa9c5('0x44')]=_[_0xa9c5('0x43')](_0xe2eebc['query']);_0x2d4389[_0xa9c5('0x45')]=_[_0xa9c5('0x46')](_0x2d4389[_0xa9c5('0x42')],_0x2d4389['query']);_0x4d4e9d[_0xa9c5('0x47')]=_[_0xa9c5('0x46')](_0x2d4389['model'],qs[_0xa9c5('0x48')](_0xe2eebc[_0xa9c5('0x44')]['fields']));_0x4d4e9d[_0xa9c5('0x47')]=_0x4d4e9d[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x4d4e9d[_0xa9c5('0x47')]:_0x2d4389['model'];_0x4d4e9d[_0xa9c5('0x6a')]=qs[_0xa9c5('0x6b')](_0xe2eebc[_0xa9c5('0x44')][_0xa9c5('0x6b')]);_0x4d4e9d['where']=qs[_0xa9c5('0x45')](_[_0xa9c5('0x4b')](_0xe2eebc[_0xa9c5('0x44')],_0x2d4389[_0xa9c5('0x45')]));if(_0xe2eebc['query']['filter']){_0x4d4e9d[_0xa9c5('0x4d')]=_['merge'](_0x4d4e9d[_0xa9c5('0x4d')],{'$or':_[_0xa9c5('0x3e')](_0x4d4e9d[_0xa9c5('0x47')],function(_0x52a263){var _0x2ad0a5={};_0x2ad0a5[_0x52a263]={'$like':'%'+_0xe2eebc[_0xa9c5('0x44')][_0xa9c5('0x4c')]+'%'};return _0x2ad0a5;})});}_0x4d4e9d=_[_0xa9c5('0x4e')]({},_0x4d4e9d,_0xe2eebc[_0xa9c5('0x58')]);return _0x3085cb[_0xa9c5('0xb4')](_0x4d4e9d);}})[_0xa9c5('0x20')](function(_0x417181){if(_0x417181){_0x1c1141=_0x417181['length'];if(!_0xe2eebc[_0xa9c5('0x44')][_0xa9c5('0x69')](_0xa9c5('0x4a'))){_0x4d4e9d[_0xa9c5('0x2f')]=qs['limit'](_0xe2eebc[_0xa9c5('0x44')][_0xa9c5('0x2f')]);_0x4d4e9d[_0xa9c5('0x2e')]=qs['offset'](_0xe2eebc['query'][_0xa9c5('0x2e')]);}return _0x3085cb[_0xa9c5('0xb4')](_0x4d4e9d);}})[_0xa9c5('0x20')](function(_0x5980a2){if(_0x5980a2){return _0x5980a2?{'count':_0x1c1141,'rows':_0x5980a2}:null;}})['then'](respondWithResult(_0x585316,null))[_0xa9c5('0x2a')](handleError(_0x585316,null));};exports[_0xa9c5('0xb5')]=function(_0x526f33,_0x1dd94d,_0x4d4b6a){var _0x3b2282={'raw':![],'where':{}};var _0x1b7b32={};var _0x1afefe={'count':0x0,'rows':[]};return db[_0xa9c5('0x51')][_0xa9c5('0x68')]({'where':{'id':_0x526f33[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x1dd94d,null))[_0xa9c5('0x20')](function(_0x399b61){if(_0x399b61){_0x1b7b32[_0xa9c5('0x42')]=_[_0xa9c5('0x43')](db['OpenchannelInteraction'][_0xa9c5('0x3f')]);_0x1b7b32[_0xa9c5('0x44')]=_[_0xa9c5('0x43')](_0x526f33[_0xa9c5('0x44')]);_0x1b7b32[_0xa9c5('0x45')]=_[_0xa9c5('0x46')](_0x1b7b32[_0xa9c5('0x42')],_0x1b7b32['query']);_0x3b2282[_0xa9c5('0x47')]=_[_0xa9c5('0x46')](_0x1b7b32[_0xa9c5('0x42')],qs['fields'](_0x526f33['query'][_0xa9c5('0x48')]));_0x3b2282[_0xa9c5('0x47')]=_0x3b2282['attributes'][_0xa9c5('0x49')]?_0x3b2282[_0xa9c5('0x47')]:_0x1b7b32['model'];if(!_0x526f33[_0xa9c5('0x44')][_0xa9c5('0x69')](_0xa9c5('0x4a'))){_0x3b2282[_0xa9c5('0x2f')]=qs[_0xa9c5('0x2f')](_0x526f33[_0xa9c5('0x44')][_0xa9c5('0x2f')]);_0x3b2282[_0xa9c5('0x2e')]=qs[_0xa9c5('0x2e')](_0x526f33[_0xa9c5('0x44')][_0xa9c5('0x2e')]);}_0x3b2282['order']=qs[_0xa9c5('0x6b')](_0x526f33['query'][_0xa9c5('0x6b')]);_0x3b2282[_0xa9c5('0x4d')]=qs[_0xa9c5('0x45')](_[_0xa9c5('0x4b')](_0x526f33['query'],_0x1b7b32[_0xa9c5('0x45')]));_0x3b2282[_0xa9c5('0x4d')][_0xa9c5('0x70')]=_0x399b61['id'];if(_0x526f33[_0xa9c5('0x44')]['filter']){_0x3b2282[_0xa9c5('0x4d')]=_[_0xa9c5('0x4e')](_0x3b2282[_0xa9c5('0x4d')],{'$or':_[_0xa9c5('0x3e')](_0x3b2282['attributes'],function(_0x41dafb){var _0x42dbd7={};_0x42dbd7[_0x41dafb]={'$like':'%'+_0x526f33[_0xa9c5('0x44')][_0xa9c5('0x4c')]+'%'};return _0x42dbd7;})});}_0x3b2282=_[_0xa9c5('0x4e')]({},_0x3b2282,_0x526f33[_0xa9c5('0x58')]);return db[_0xa9c5('0x94')][_0xa9c5('0x30')]({'where':_0x3b2282[_0xa9c5('0x4d')]})[_0xa9c5('0x20')](function(_0x411ee7){_0x1afefe[_0xa9c5('0x30')]=_0x411ee7;if(_0x526f33[_0xa9c5('0x44')][_0xa9c5('0x57')]){_0x3b2282[_0xa9c5('0x52')]=[{'model':db['CmContact'],'as':_0xa9c5('0xb6'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xa9c5('0x3b'),_0xa9c5('0xb7'),_0xa9c5('0xb8')],'required':![]},{'model':db[_0xa9c5('0xb9')],'as':_0xa9c5('0xba'),'attributes':['id','name',_0xa9c5('0xbb')],'where':_0x526f33['query']['tag']?{'id':_0x526f33[_0xa9c5('0x44')][_0xa9c5('0xbc')]}:undefined,'required':_0x526f33[_0xa9c5('0x44')][_0xa9c5('0xbc')]?!![]:![]}];}return db[_0xa9c5('0x94')][_0xa9c5('0x53')](_0x3b2282);})[_0xa9c5('0x20')](function(_0x245109){_0x1afefe[_0xa9c5('0x54')]=_0x245109;return _0x1afefe;});}})[_0xa9c5('0x20')](respondWithFilteredResult(_0x1dd94d,_0x3b2282))[_0xa9c5('0x2a')](handleError(_0x1dd94d,null));};exports[_0xa9c5('0xbd')]=function(_0x5d93d2,_0x3df91b,_0x2cd15c){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0x5d93d2[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x3df91b,null))[_0xa9c5('0x20')](function(_0x45b3e5){if(_0x45b3e5){return _0x45b3e5[_0xa9c5('0xbd')](_0x5d93d2[_0xa9c5('0x5b')]['ids'],_[_0xa9c5('0xbe')](_0x5d93d2['body'],[_0xa9c5('0x6d'),'id'])||{})[_0xa9c5('0x97')](function(_0x2fbbbc){for(var _0x39185e=0x0;_0x39185e<_0x5d93d2[_0xa9c5('0x5b')][_0xa9c5('0x6d')]['length'];_0x39185e+=0x1){socket[_0xa9c5('0xbf')]('userOpenchannelAccount:save',{'UserId':Number(_0x5d93d2[_0xa9c5('0x5b')]['ids'][_0x39185e]),'OpenchannelAccountId':Number(_0x5d93d2[_0xa9c5('0x55')]['id'])});}return _0x2fbbbc;});}})[_0xa9c5('0x20')](respondWithResult(_0x3df91b,null))[_0xa9c5('0x2a')](handleError(_0x3df91b,null));};exports[_0xa9c5('0xc0')]=function(_0x5523d9,_0x4c48fc,_0x5e02c8){return db[_0xa9c5('0x51')]['find']({'where':{'id':_0x5523d9[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x4c48fc,null))[_0xa9c5('0x20')](function(_0x40ddd5){if(_0x40ddd5){return _0x40ddd5['removeAgents'](_0x5523d9['query']['ids'])[_0xa9c5('0x20')](function(){if(_['isArray'](_0x5523d9[_0xa9c5('0x44')][_0xa9c5('0x6d')])){for(var _0x14eccc=0x0;_0x14eccc<_0x5523d9[_0xa9c5('0x44')][_0xa9c5('0x6d')][_0xa9c5('0x49')];_0x14eccc+=0x1){socket['emit'](_0xa9c5('0xc1'),{'UserId':Number(_0x5523d9[_0xa9c5('0x44')][_0xa9c5('0x6d')][_0x14eccc]),'OpenchannelAccountId':Number(_0x5523d9[_0xa9c5('0x55')]['id'])});}}else{socket['emit'](_0xa9c5('0xc1'),{'UserId':Number(_0x5523d9['query']['ids']),'OpenchannelAccountId':Number(_0x5523d9[_0xa9c5('0x55')]['id'])});}});}})[_0xa9c5('0x20')](respondWithStatusCode(_0x4c48fc,null))['catch'](handleError(_0x4c48fc,null));};exports[_0xa9c5('0xc2')]=function(_0x4371d9,_0x4bac07,_0x2c8e64){var _0x8da804={};var _0x2848e8={};var _0x5298a7;var _0x1d9dce;return db[_0xa9c5('0x51')]['findOne']({'where':{'id':_0x4371d9[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x4bac07,null))[_0xa9c5('0x20')](function(_0x1aee56){if(_0x1aee56){_0x5298a7=_0x1aee56;_0x2848e8[_0xa9c5('0x42')]=_[_0xa9c5('0x43')](db[_0xa9c5('0xc3')][_0xa9c5('0x3f')]);_0x2848e8['query']=_['keys'](_0x4371d9['query']);_0x2848e8[_0xa9c5('0x45')]=_['intersection'](_0x2848e8[_0xa9c5('0x42')],_0x2848e8['query']);_0x8da804[_0xa9c5('0x47')]=_[_0xa9c5('0x46')](_0x2848e8[_0xa9c5('0x42')],qs['fields'](_0x4371d9['query'][_0xa9c5('0x48')]));_0x8da804[_0xa9c5('0x47')]=_0x8da804[_0xa9c5('0x47')][_0xa9c5('0x49')]?_0x8da804[_0xa9c5('0x47')]:_0x2848e8['model'];_0x8da804[_0xa9c5('0x6a')]=qs['sort'](_0x4371d9[_0xa9c5('0x44')][_0xa9c5('0x6b')]);_0x8da804['where']=qs['filters'](_[_0xa9c5('0x4b')](_0x4371d9[_0xa9c5('0x44')],_0x2848e8['filters']));if(_0x4371d9[_0xa9c5('0x44')][_0xa9c5('0x4c')]){_0x8da804[_0xa9c5('0x4d')]=_[_0xa9c5('0x4e')](_0x8da804[_0xa9c5('0x4d')],{'$or':_[_0xa9c5('0x3e')](_0x8da804[_0xa9c5('0x47')],function(_0x28e6bf){var _0x578451={};_0x578451[_0x28e6bf]={'$like':'%'+_0x4371d9[_0xa9c5('0x44')][_0xa9c5('0x4c')]+'%'};return _0x578451;})});}_0x8da804=_[_0xa9c5('0x4e')]({},_0x8da804,_0x4371d9[_0xa9c5('0x58')]);return _0x5298a7[_0xa9c5('0xc2')](_0x8da804);}})['then'](function(_0x3c397f){if(_0x3c397f){_0x1d9dce=_0x3c397f[_0xa9c5('0x49')];if(!_0x4371d9['query'][_0xa9c5('0x69')](_0xa9c5('0x4a'))){_0x8da804[_0xa9c5('0x2f')]=qs['limit'](_0x4371d9[_0xa9c5('0x44')]['limit']);_0x8da804[_0xa9c5('0x2e')]=qs[_0xa9c5('0x2e')](_0x4371d9[_0xa9c5('0x44')][_0xa9c5('0x2e')]);}return _0x5298a7[_0xa9c5('0xc2')](_0x8da804);}})[_0xa9c5('0x20')](function(_0xe7bc14){if(_0xe7bc14){return _0xe7bc14?{'count':_0x1d9dce,'rows':_0xe7bc14}:null;}})['then'](respondWithResult(_0x4bac07,null))['catch'](handleError(_0x4bac07,null));};exports[_0xa9c5('0xc4')]=function(_0x3b097b,_0x2068d6,_0x2ef81d){var _0x4eceb6,_0x128c22,_0x448001;if(_[_0xa9c5('0x7e')](_0x3b097b[_0xa9c5('0x5b')][_0xa9c5('0x5b')])||_0x3b097b['body'][_0xa9c5('0x5b')]===''){throw new db[(_0xa9c5('0x75'))][(_0xa9c5('0x76'))](_0xa9c5('0x7f'));}if(_[_0xa9c5('0x7e')](_0x3b097b[_0xa9c5('0x5b')]['to'])){}_0x4eceb6=_0x3b097b['body']['to'];return db['OpenchannelAccount'][_0xa9c5('0x68')]({'where':{'id':_0x3b097b[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x20')](handleEntityNotFound(_0x2068d6,null))['then'](function(_0x59bea2){if(_0x59bea2){return db[_0xa9c5('0x51')][_0xa9c5('0x59')]({'where':{'id':_0x59bea2['id']},'include':[{'model':db[_0xa9c5('0x83')],'as':_0xa9c5('0x84'),'include':[{'model':db['CmContact'],'as':_0xa9c5('0x8e'),'where':{[_0x59bea2['mapKey']]:_0x4eceb6},'limit':0x1,'order':[[_0xa9c5('0x7a'),_0xa9c5('0x85')]]}]}]})['then'](handleEntityNotFound(_0x2068d6,null))[_0xa9c5('0x20')](function(_0x3f48f0){if(_0x3f48f0&&_0x3f48f0[_0xa9c5('0x84')]){_0x128c22=_0x3f48f0[_0xa9c5('0x5d')]({'plain':!![]});if(_0x128c22[_0xa9c5('0x84')]&&_0x128c22['List'][_0xa9c5('0x8e')]['length']){return _0x128c22['List']['Contacts'][0x0];}return db[_0xa9c5('0x74')]['create'](_[_0xa9c5('0x18')](_0x3b097b[_0xa9c5('0x5b')],{'firstName':_0x4eceb6,[_0x3f48f0[_0xa9c5('0x80')]]:_0x4eceb6,'phone':_0x4eceb6,'ListId':_0x128c22[_0xa9c5('0x8f')]}));}})[_0xa9c5('0x20')](handleEntityNotFound(_0x2068d6,null))[_0xa9c5('0x20')](function(_0x5784a5){if(_0x5784a5){_0x448001=_0x5784a5;return db[_0xa9c5('0x94')]['find']({'where':{'ContactId':_0x448001['id'],'closed':![],'OpenchannelAccountId':_0x128c22['id']}})['then'](function(_0xd0fce8){if(_0xd0fce8){return[_0xd0fce8,![]];}return db['OpenchannelInteraction'][_0xa9c5('0x5a')]({'UserId':_0x3b097b[_0xa9c5('0x5c')]['id'],'ContactId':_0x448001['id'],'OpenchannelAccountId':_0x128c22['id'],'lastMsgDirection':_0xa9c5('0xc5'),'firstMsgDirection':_0xa9c5('0xc5'),'Messages':[_[_0xa9c5('0x4e')](_0x3b097b['body'],{'read':![],'body':_0x3b097b[_0xa9c5('0x5b')]['body'],'OpenchannelAccountId':_0x128c22['id'],'UserId':_0x3b097b[_0xa9c5('0x5c')]['id'],'ContactId':_0x448001['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xa9c5('0xc6')}]})['then'](function(_0x396622){return[_0x396622,!![]];});});}})[_0xa9c5('0x97')](function(_0x55e688,_0x2b63d0){if(_0x2b63d0){return _0x55e688;}return db['OpenchannelMessage']['create'](_[_0xa9c5('0x4e')](_0x3b097b['body'],{'read':![],'body':_0x3b097b[_0xa9c5('0x5b')][_0xa9c5('0x5b')],'OpenchannelAccountId':_0x128c22['id'],'OpenchannelInteractionId':_0x55e688['id'],'UserId':_0x3b097b['user']['id'],'ContactId':_0x448001['id']}))[_0xa9c5('0x20')](function(_0x2115a0){_0x55e688[_0xa9c5('0xc7')]['Messages']=[];_0x55e688[_0xa9c5('0xc7')][_0xa9c5('0xc6')][_0xa9c5('0xc8')](_0x2115a0[_0xa9c5('0xc7')]);return _0x55e688;});});}})[_0xa9c5('0x20')](respondWithResult(_0x2068d6,null))[_0xa9c5('0x2a')](handleError(_0x2068d6,null));}; \ No newline at end of file +var _0x3c03=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','get','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','user','role','UserProfileSection','autoAssociation','body','describe','Disposition','getDispositions','findOne','length','hasOwnProperty','ids','OpenchannelAccountId','CannedAnswer','getAnswers','pick','includeAll','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','list','applications','orderBy','priority','account','Applications','lastName','threadId','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','out','OpenchannelMessage','dataValues','Messages','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x4f39b8,_0x2d685e){var _0x297147=function(_0x3a0862){while(--_0x3a0862){_0x4f39b8['push'](_0x4f39b8['shift']());}};_0x297147(++_0x2d685e);}(_0x3c03,0x16d));var _0x33c0=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x3c03[_0x47a349];return _0x18ab75;};'use strict';var emlformat=require(_0x33c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x33c0('0x1'));var moment=require(_0x33c0('0x2'));var BPromise=require(_0x33c0('0x3'));var Mustache=require(_0x33c0('0x4'));var util=require('util');var path=require(_0x33c0('0x5'));var sox=require(_0x33c0('0x6'));var csv=require(_0x33c0('0x7'));var ejs=require(_0x33c0('0x8'));var fs=require('fs');var fs_extra=require(_0x33c0('0x9'));var _=require(_0x33c0('0xa'));var squel=require(_0x33c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x33c0('0xc'));var deskjs=require(_0x33c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x33c0('0xe'));var Papa=require(_0x33c0('0xf'));var Redis=require('ioredis');var authService=require(_0x33c0('0x10'));var qs=require(_0x33c0('0x11'));var as=require(_0x33c0('0x12'));var hardwareService=require(_0x33c0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x33c0('0x14'));var config=require(_0x33c0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x33c0('0x16')](config[_0x33c0('0x17')],{'host':_0x33c0('0x18'),'port':0x18eb});var socket=require(_0x33c0('0x19'))(new Redis(config[_0x33c0('0x17')]));require(_0x33c0('0x1a'))['register'](socket);var jayson=require(_0x33c0('0x1b'));var client=jayson[_0x33c0('0x1c')][_0x33c0('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x33c0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58c21e,_0x1e4134,_0x5a88cb,_0x115715){return new BPromise(function(_0x3e208a,_0x341302){var _0x1729b9=_0x115715||client;return _0x1729b9[_0x33c0('0x1e')](_0x58c21e,_0x5a88cb)[_0x33c0('0x1f')](function(_0x4a1fd3){logger[_0x33c0('0x20')](_0x33c0('0x21'),_0x1e4134,_0x33c0('0x22'));logger[_0x33c0('0x23')](_0x33c0('0x24'),_0x1e4134,_0x33c0('0x22'),JSON['stringify'](_0x4a1fd3));if(_0x4a1fd3[_0x33c0('0x25')]){if(_0x4a1fd3[_0x33c0('0x25')][_0x33c0('0x26')]===0x1f4){logger[_0x33c0('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x1e4134,_0x4a1fd3[_0x33c0('0x25')][_0x33c0('0x27')]);return _0x341302(_0x4a1fd3[_0x33c0('0x25')][_0x33c0('0x27')]);}logger[_0x33c0('0x25')](_0x33c0('0x21'),_0x1e4134,_0x4a1fd3[_0x33c0('0x25')][_0x33c0('0x27')]);return _0x3e208a(_0x4a1fd3[_0x33c0('0x25')][_0x33c0('0x27')]);}else{logger[_0x33c0('0x20')](_0x33c0('0x21'),_0x1e4134,_0x33c0('0x22'));_0x3e208a(_0x4a1fd3[_0x33c0('0x28')]['message']);}})[_0x33c0('0x29')](function(_0x2b1af2){logger[_0x33c0('0x25')](_0x33c0('0x21'),_0x1e4134,_0x2b1af2);_0x341302(_0x2b1af2);});});}function respondWithStatusCode(_0x4ac4ff,_0x2505db){_0x2505db=_0x2505db||0xcc;return function(_0x2e603f){if(_0x2e603f){return _0x4ac4ff[_0x33c0('0x2a')](_0x2505db);}return _0x4ac4ff[_0x33c0('0x2b')](_0x2505db)[_0x33c0('0x2c')]();};}function respondWithResult(_0x4f6d3b,_0x547675){_0x547675=_0x547675||0xc8;return function(_0x5f3720){if(_0x5f3720){return _0x4f6d3b[_0x33c0('0x2b')](_0x547675)[_0x33c0('0x2d')](_0x5f3720);}};}function respondWithFilteredResult(_0x254830,_0x1358c9){return function(_0x6e93f9){if(_0x6e93f9){var _0x4059dc=typeof _0x1358c9[_0x33c0('0x2e')]==='undefined'&&typeof _0x1358c9[_0x33c0('0x2f')]==='undefined';var _0x23ae3f=_0x6e93f9[_0x33c0('0x30')];var _0x25b91a=_0x4059dc?0x0:_0x1358c9[_0x33c0('0x2e')];var _0x483461=_0x4059dc?_0x6e93f9[_0x33c0('0x30')]:_0x1358c9[_0x33c0('0x2e')]+_0x1358c9[_0x33c0('0x2f')];var _0x3419da;if(_0x483461>=_0x23ae3f){_0x483461=_0x23ae3f;_0x3419da=0xc8;}else{_0x3419da=0xce;}_0x254830[_0x33c0('0x2b')](_0x3419da);return _0x254830['set'](_0x33c0('0x31'),_0x25b91a+'-'+_0x483461+'/'+_0x23ae3f)[_0x33c0('0x2d')](_0x6e93f9);}return null;};}function patchUpdates(_0x5fe38c){return function(_0x2933b3){try{jsonpatch[_0x33c0('0x32')](_0x2933b3,_0x5fe38c,!![]);}catch(_0x2d84e4){return BPromise[_0x33c0('0x33')](_0x2d84e4);}return _0x2933b3[_0x33c0('0x34')]();};}function saveUpdates(_0x1b63bb,_0xc9c56b){return function(_0x25a117){if(_0x25a117){return _0x25a117[_0x33c0('0x35')](_0x1b63bb)[_0x33c0('0x1f')](function(_0x364813){return _0x364813;});}return null;};}function removeEntity(_0xf65e1d,_0x15eeca){return function(_0x931cce){if(_0x931cce){return _0x931cce[_0x33c0('0x36')]()[_0x33c0('0x1f')](function(){var _0x556d70=_0x931cce[_0x33c0('0x37')]({'plain':!![]});var _0x105084='OpenchannelAccounts';return db['UserProfileResource'][_0x33c0('0x36')]({'where':{'type':_0x105084,'resourceId':_0x556d70['id']}})[_0x33c0('0x1f')](function(){return _0x931cce;});})[_0x33c0('0x1f')](function(){_0xf65e1d[_0x33c0('0x2b')](0xcc)[_0x33c0('0x2c')]();});}};}function handleEntityNotFound(_0x1959e1,_0x4a88c5){return function(_0x2da23f){if(!_0x2da23f){_0x1959e1[_0x33c0('0x2a')](0x194);}return _0x2da23f;};}function handleError(_0x5c2bc1,_0x303060){_0x303060=_0x303060||0x1f4;return function(_0x290a2f){logger[_0x33c0('0x25')](_0x290a2f['stack']);if(_0x290a2f[_0x33c0('0x38')]){delete _0x290a2f[_0x33c0('0x38')];}_0x5c2bc1[_0x33c0('0x2b')](_0x303060)[_0x33c0('0x39')](_0x290a2f);};}exports[_0x33c0('0x3a')]=function(_0x4cf55b,_0x134004){var _0x14fa7b={'include':[{'model':db[_0x33c0('0x3b')],'as':'mandatoryDispositionPause'}]},_0x1fb181={},_0xac7516={'count':0x0,'rows':[]};var _0x45e295=_[_0x33c0('0x3c')](db[_0x33c0('0x3d')][_0x33c0('0x3e')],function(_0x2544e5){return{'name':_0x2544e5['fieldName'],'type':_0x2544e5[_0x33c0('0x3f')]['key']};});_0x1fb181[_0x33c0('0x40')]=_[_0x33c0('0x3c')](_0x45e295,_0x33c0('0x38'));_0x1fb181[_0x33c0('0x41')]=_[_0x33c0('0x42')](_0x4cf55b[_0x33c0('0x41')]);_0x1fb181[_0x33c0('0x43')]=_[_0x33c0('0x44')](_0x1fb181[_0x33c0('0x40')],_0x1fb181['query']);_0x14fa7b['attributes']=_['intersection'](_0x1fb181[_0x33c0('0x40')],qs[_0x33c0('0x45')](_0x4cf55b[_0x33c0('0x41')]['fields']));_0x14fa7b[_0x33c0('0x46')]=_0x14fa7b[_0x33c0('0x46')]['length']?_0x14fa7b['attributes']:_0x1fb181[_0x33c0('0x40')];if(!_0x4cf55b[_0x33c0('0x41')]['hasOwnProperty'](_0x33c0('0x47'))){_0x14fa7b[_0x33c0('0x2f')]=qs[_0x33c0('0x2f')](_0x4cf55b[_0x33c0('0x41')][_0x33c0('0x2f')]);_0x14fa7b[_0x33c0('0x2e')]=qs[_0x33c0('0x2e')](_0x4cf55b['query'][_0x33c0('0x2e')]);}_0x14fa7b[_0x33c0('0x48')]=qs[_0x33c0('0x49')](_0x4cf55b[_0x33c0('0x41')][_0x33c0('0x49')]);_0x14fa7b[_0x33c0('0x4a')]=qs[_0x33c0('0x43')](_['pick'](_0x4cf55b[_0x33c0('0x41')],_0x1fb181[_0x33c0('0x43')]),_0x45e295);if(_0x4cf55b[_0x33c0('0x41')][_0x33c0('0x4b')]){_0x14fa7b[_0x33c0('0x4a')]=_[_0x33c0('0x4c')](_0x14fa7b['where'],{'$or':_[_0x33c0('0x3c')](_0x45e295,function(_0x585a0d){if(_0x585a0d[_0x33c0('0x3f')]!=='VIRTUAL'){var _0x10250d={};_0x10250d[_0x585a0d['name']]={'$like':'%'+_0x4cf55b[_0x33c0('0x41')][_0x33c0('0x4b')]+'%'};return _0x10250d;}})});}_0x14fa7b=_[_0x33c0('0x4c')]({},_0x14fa7b,_0x4cf55b[_0x33c0('0x4d')]);var _0x17a831={'where':_0x14fa7b[_0x33c0('0x4a')]};return db[_0x33c0('0x3d')]['count'](_0x17a831)[_0x33c0('0x1f')](function(_0x44488c){_0xac7516[_0x33c0('0x30')]=_0x44488c;if(_0x4cf55b[_0x33c0('0x41')]['includeAll']){_0x14fa7b[_0x33c0('0x4e')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x33c0('0x4f')](_0x14fa7b);})[_0x33c0('0x1f')](function(_0x1deb98){_0xac7516[_0x33c0('0x50')]=_0x1deb98;return _0xac7516;})[_0x33c0('0x1f')](respondWithFilteredResult(_0x134004,_0x14fa7b))[_0x33c0('0x29')](handleError(_0x134004,null));};exports[_0x33c0('0x51')]=function(_0x58499f,_0x271a27){var _0x483cdf={'raw':![],'where':{'id':_0x58499f[_0x33c0('0x52')]['id']},'include':[{'model':db[_0x33c0('0x3b')],'as':_0x33c0('0x53')}]},_0x454f49={};_0x454f49[_0x33c0('0x40')]=_[_0x33c0('0x42')](db[_0x33c0('0x3d')]['rawAttributes']);_0x454f49[_0x33c0('0x41')]=_[_0x33c0('0x42')](_0x58499f[_0x33c0('0x41')]);_0x454f49[_0x33c0('0x43')]=_[_0x33c0('0x44')](_0x454f49['model'],_0x454f49[_0x33c0('0x41')]);_0x483cdf[_0x33c0('0x46')]=_[_0x33c0('0x44')](_0x454f49[_0x33c0('0x40')],qs['fields'](_0x58499f[_0x33c0('0x41')]['fields']));_0x483cdf[_0x33c0('0x46')]=_0x483cdf[_0x33c0('0x46')]['length']?_0x483cdf[_0x33c0('0x46')]:_0x454f49[_0x33c0('0x40')];if(_0x58499f[_0x33c0('0x41')]['includeAll']){_0x483cdf['include']=[{'all':!![]}];}_0x483cdf=_[_0x33c0('0x4c')]({},_0x483cdf,_0x58499f[_0x33c0('0x4d')]);return db[_0x33c0('0x3d')][_0x33c0('0x54')](_0x483cdf)[_0x33c0('0x1f')](handleEntityNotFound(_0x271a27,null))[_0x33c0('0x1f')](respondWithResult(_0x271a27,null))['catch'](handleError(_0x271a27,null));};exports[_0x33c0('0x55')]=function(_0x396536,_0x541448){return db[_0x33c0('0x3d')][_0x33c0('0x55')](_0x396536['body'],{})[_0x33c0('0x1f')](function(_0x42caf7){var _0x324483=_0x396536[_0x33c0('0x56')][_0x33c0('0x37')]({'plain':!![]});if(!_0x324483)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x324483[_0x33c0('0x57')]===_0x33c0('0x56')){var _0x3f6a6e=_0x42caf7[_0x33c0('0x37')]({'plain':!![]});var _0x4f7ac5='OpenchannelAccounts';return db[_0x33c0('0x58')][_0x33c0('0x54')]({'where':{'name':_0x4f7ac5,'userProfileId':_0x324483['userProfileId']},'raw':!![]})[_0x33c0('0x1f')](function(_0x3212c8){if(_0x3212c8&&_0x3212c8[_0x33c0('0x59')]===0x0){return db['UserProfileResource'][_0x33c0('0x55')]({'name':_0x3f6a6e['name'],'resourceId':_0x3f6a6e['id'],'type':_0x3212c8[_0x33c0('0x38')],'sectionId':_0x3212c8['id']},{})['then'](function(){return _0x42caf7;});}else{return _0x42caf7;}})[_0x33c0('0x29')](function(_0xeadf76){logger[_0x33c0('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeadf76);throw _0xeadf76;});}return _0x42caf7;})[_0x33c0('0x1f')](respondWithResult(_0x541448,0xc9))[_0x33c0('0x29')](handleError(_0x541448,null));};exports[_0x33c0('0x35')]=function(_0x520406,_0x33f05b){if(_0x520406[_0x33c0('0x5a')]['id']){delete _0x520406[_0x33c0('0x5a')]['id'];}return db[_0x33c0('0x3d')][_0x33c0('0x54')]({'where':{'id':_0x520406[_0x33c0('0x52')]['id']},'include':[{'model':db[_0x33c0('0x3b')],'as':_0x33c0('0x53')}]})[_0x33c0('0x1f')](handleEntityNotFound(_0x33f05b,null))[_0x33c0('0x1f')](saveUpdates(_0x520406[_0x33c0('0x5a')],null))[_0x33c0('0x1f')](respondWithResult(_0x33f05b,null))['catch'](handleError(_0x33f05b,null));};exports[_0x33c0('0x36')]=function(_0x547f19,_0x17fac4){return db['OpenchannelAccount'][_0x33c0('0x54')]({'where':{'id':_0x547f19[_0x33c0('0x52')]['id']}})['then'](handleEntityNotFound(_0x17fac4,null))['then'](removeEntity(_0x17fac4,null))[_0x33c0('0x29')](handleError(_0x17fac4,null));};exports['describe']=function(_0x3c38e9,_0x13fb98){return db[_0x33c0('0x3d')][_0x33c0('0x5b')]()[_0x33c0('0x1f')](respondWithResult(_0x13fb98,null))[_0x33c0('0x29')](handleError(_0x13fb98,null));};exports['addDisposition']=function(_0x466007,_0x1973ed,_0x1dae63){if(_0x466007[_0x33c0('0x5a')]['id']){delete _0x466007[_0x33c0('0x5a')]['id'];}return db['OpenchannelAccount'][_0x33c0('0x54')]({'where':{'id':_0x466007[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x1973ed,null))[_0x33c0('0x1f')](function(_0x1f787e){if(_0x1f787e){_0x466007[_0x33c0('0x5a')]['OpenchannelAccountId']=_0x1f787e['id'];return db[_0x33c0('0x5c')]['create'](_0x466007['body']);}})[_0x33c0('0x1f')](respondWithResult(_0x1973ed,null))[_0x33c0('0x29')](handleError(_0x1973ed,null));};exports[_0x33c0('0x5d')]=function(_0x2511f7,_0x425e3f,_0x1789e5){var _0x4cf732={'raw':![],'where':{}};var _0x879c9a={};var _0x61dea3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x33c0('0x5e')]({'where':{'id':_0x2511f7['params']['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x425e3f,null))[_0x33c0('0x1f')](function(_0x3b561c){if(_0x3b561c){_0x879c9a['model']=_['keys'](db['Disposition'][_0x33c0('0x3e')]);_0x879c9a[_0x33c0('0x41')]=_[_0x33c0('0x42')](_0x2511f7['query']);_0x879c9a[_0x33c0('0x43')]=_[_0x33c0('0x44')](_0x879c9a[_0x33c0('0x40')],_0x879c9a[_0x33c0('0x41')]);_0x4cf732['attributes']=_['intersection'](_0x879c9a[_0x33c0('0x40')],qs['fields'](_0x2511f7['query'][_0x33c0('0x45')]));_0x4cf732[_0x33c0('0x46')]=_0x4cf732[_0x33c0('0x46')][_0x33c0('0x5f')]?_0x4cf732['attributes']:_0x879c9a[_0x33c0('0x40')];if(!_0x2511f7[_0x33c0('0x41')][_0x33c0('0x60')]('nolimit')){_0x4cf732['limit']=qs[_0x33c0('0x2f')](_0x2511f7[_0x33c0('0x41')][_0x33c0('0x2f')]);_0x4cf732[_0x33c0('0x2e')]=qs[_0x33c0('0x2e')](_0x2511f7[_0x33c0('0x41')][_0x33c0('0x2e')]);}_0x4cf732['order']=qs[_0x33c0('0x49')](_0x2511f7[_0x33c0('0x41')][_0x33c0('0x49')]);_0x4cf732[_0x33c0('0x4a')]=qs[_0x33c0('0x43')](_['pick'](_0x2511f7['query'],_0x879c9a[_0x33c0('0x43')]));_0x4cf732[_0x33c0('0x4a')]['OpenchannelAccountId']=_0x3b561c['id'];if(_0x2511f7[_0x33c0('0x41')]['filter']){_0x4cf732[_0x33c0('0x4a')]=_[_0x33c0('0x4c')](_0x4cf732[_0x33c0('0x4a')],{'$or':_[_0x33c0('0x3c')](_0x4cf732['attributes'],function(_0x121ae2){var _0x30ec1e={};_0x30ec1e[_0x121ae2]={'$like':'%'+_0x2511f7[_0x33c0('0x41')]['filter']+'%'};return _0x30ec1e;})});}_0x4cf732=_['merge']({},_0x4cf732,_0x2511f7[_0x33c0('0x4d')]);return db[_0x33c0('0x5c')][_0x33c0('0x30')]({'where':_0x4cf732[_0x33c0('0x4a')]})[_0x33c0('0x1f')](function(_0x95fa1d){_0x61dea3[_0x33c0('0x30')]=_0x95fa1d;if(_0x2511f7[_0x33c0('0x41')]['includeAll']){_0x4cf732[_0x33c0('0x4e')]=[{'all':!![]}];}return db[_0x33c0('0x5c')][_0x33c0('0x4f')](_0x4cf732);})[_0x33c0('0x1f')](function(_0xc9aeff){_0x61dea3[_0x33c0('0x50')]=_0xc9aeff;return _0x61dea3;});}})['then'](respondWithFilteredResult(_0x425e3f,_0x4cf732))[_0x33c0('0x29')](handleError(_0x425e3f,null));};exports['removeDispositions']=function(_0x3ed1c8,_0x326934,_0x249415){return db[_0x33c0('0x3d')][_0x33c0('0x54')]({'where':{'id':_0x3ed1c8['params']['id']}})['then'](handleEntityNotFound(_0x326934,null))['then'](function(_0x23de10){if(_0x23de10){return _0x23de10['removeDispositions'](_0x3ed1c8[_0x33c0('0x41')][_0x33c0('0x61')]);}})[_0x33c0('0x1f')](respondWithStatusCode(_0x326934,null))[_0x33c0('0x29')](handleError(_0x326934,null));};exports['addAnswer']=function(_0x155e31,_0x9dbde4,_0xc7bcd6){if(_0x155e31[_0x33c0('0x5a')]['id']){delete _0x155e31[_0x33c0('0x5a')]['id'];}return db['OpenchannelAccount'][_0x33c0('0x54')]({'where':{'id':_0x155e31['params']['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x9dbde4,null))[_0x33c0('0x1f')](function(_0x594bb0){if(_0x594bb0){_0x155e31[_0x33c0('0x5a')][_0x33c0('0x62')]=_0x594bb0['id'];return db[_0x33c0('0x63')][_0x33c0('0x55')](_0x155e31[_0x33c0('0x5a')]);}})[_0x33c0('0x1f')](respondWithResult(_0x9dbde4,null))[_0x33c0('0x29')](handleError(_0x9dbde4,null));};exports[_0x33c0('0x64')]=function(_0x42b3c1,_0x4f3d6a,_0x59e679){var _0x450096={'raw':![],'where':{}};var _0x5b4d73={};var _0x58079c={'count':0x0,'rows':[]};return db[_0x33c0('0x3d')]['findOne']({'where':{'id':_0x42b3c1[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x4f3d6a,null))[_0x33c0('0x1f')](function(_0x59fd5c){if(_0x59fd5c){_0x5b4d73[_0x33c0('0x40')]=_[_0x33c0('0x42')](db[_0x33c0('0x63')][_0x33c0('0x3e')]);_0x5b4d73[_0x33c0('0x41')]=_['keys'](_0x42b3c1[_0x33c0('0x41')]);_0x5b4d73['filters']=_['intersection'](_0x5b4d73[_0x33c0('0x40')],_0x5b4d73[_0x33c0('0x41')]);_0x450096[_0x33c0('0x46')]=_[_0x33c0('0x44')](_0x5b4d73[_0x33c0('0x40')],qs[_0x33c0('0x45')](_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x45')]));_0x450096['attributes']=_0x450096[_0x33c0('0x46')][_0x33c0('0x5f')]?_0x450096[_0x33c0('0x46')]:_0x5b4d73[_0x33c0('0x40')];if(!_0x42b3c1[_0x33c0('0x41')]['hasOwnProperty'](_0x33c0('0x47'))){_0x450096['limit']=qs['limit'](_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x2f')]);_0x450096['offset']=qs['offset'](_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x2e')]);}_0x450096[_0x33c0('0x48')]=qs['sort'](_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x49')]);_0x450096[_0x33c0('0x4a')]=qs[_0x33c0('0x43')](_[_0x33c0('0x65')](_0x42b3c1[_0x33c0('0x41')],_0x5b4d73[_0x33c0('0x43')]));_0x450096['where'][_0x33c0('0x62')]=_0x59fd5c['id'];if(_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x4b')]){_0x450096[_0x33c0('0x4a')]=_[_0x33c0('0x4c')](_0x450096['where'],{'$or':_[_0x33c0('0x3c')](_0x450096['attributes'],function(_0x3cec18){var _0x29a55e={};_0x29a55e[_0x3cec18]={'$like':'%'+_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x4b')]+'%'};return _0x29a55e;})});}_0x450096=_['merge']({},_0x450096,_0x42b3c1[_0x33c0('0x4d')]);return db[_0x33c0('0x63')][_0x33c0('0x30')]({'where':_0x450096['where']})[_0x33c0('0x1f')](function(_0x8d4e57){_0x58079c['count']=_0x8d4e57;if(_0x42b3c1[_0x33c0('0x41')][_0x33c0('0x66')]){_0x450096[_0x33c0('0x4e')]=[{'all':!![]}];}return db[_0x33c0('0x63')]['findAll'](_0x450096);})[_0x33c0('0x1f')](function(_0x54fc77){_0x58079c[_0x33c0('0x50')]=_0x54fc77;return _0x58079c;});}})[_0x33c0('0x1f')](respondWithFilteredResult(_0x4f3d6a,_0x450096))[_0x33c0('0x29')](handleError(_0x4f3d6a,null));};exports[_0x33c0('0x67')]=function(_0x2f5e98,_0x42b8b6,_0x8163c8){return db[_0x33c0('0x3d')][_0x33c0('0x54')]({'where':{'id':_0x2f5e98[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x42b8b6,null))['then'](function(_0x4dfce6){if(_0x4dfce6){return _0x4dfce6[_0x33c0('0x67')](_0x2f5e98['query']['ids']);}})[_0x33c0('0x1f')](respondWithStatusCode(_0x42b8b6,null))['catch'](handleError(_0x42b8b6,null));};exports['notify']=function(_0x17de40,_0x2f5b57,_0xe271c4){var _0x3c8ca0={'body':_0x17de40[_0x33c0('0x5a')],'channel':_0x33c0('0x68')};var _0x3ac09d=[];var _0x17aa30=[];var _0x1df3cb={};var _0x3b6c29=![];return db[_0x33c0('0x69')][_0x33c0('0x5b')]()[_0x33c0('0x1f')](function(_0x450e97){if(!_0x450e97){throw new db[(_0x33c0('0x6a'))][(_0x33c0('0x6b'))](_0x33c0('0x6c'));}_0x3ac09d=_[_0x33c0('0x6d')](_[_0x33c0('0x42')](_0x450e97),[_0x33c0('0x6e'),_0x33c0('0x6f')]);_0x17aa30=_[_0x33c0('0x6d')](_[_0x33c0('0x42')](_0x450e97),[_0x33c0('0x6e'),_0x33c0('0x6f'),_0x33c0('0x70'),_0x33c0('0x71')]);if(_0x17de40[_0x33c0('0x5a')]['id']){delete _0x17de40[_0x33c0('0x5a')]['id'];}if(_[_0x33c0('0x72')](_0x17de40[_0x33c0('0x5a')][_0x33c0('0x73')])){throw new db['Sequelize'][(_0x33c0('0x6b'))](_0x33c0('0x74'));}if(_['isNil'](_0x17de40[_0x33c0('0x5a')][_0x33c0('0x5a')])||_0x17de40[_0x33c0('0x5a')][_0x33c0('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0x33c0('0x75'));}if(_['isNil'](_0x17de40[_0x33c0('0x5a')][_0x33c0('0x76')])){throw new db[(_0x33c0('0x6a'))][(_0x33c0('0x6b'))](_0x33c0('0x77')+_0x17aa30);}if(!_['includes'](_0x17aa30,_0x17de40[_0x33c0('0x5a')][_0x33c0('0x76')])){throw new db[(_0x33c0('0x6a'))][(_0x33c0('0x6b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17aa30);}_0x1df3cb[_0x17de40[_0x33c0('0x5a')][_0x33c0('0x76')]]=_0x17de40['body'][_0x33c0('0x73')];})[_0x33c0('0x1f')](function(){return db['OpenchannelAccount'][_0x33c0('0x54')]({'where':{'id':_0x17de40[_0x33c0('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x33c0('0x78'),'include':[{'model':db[_0x33c0('0x69')],'as':_0x33c0('0x79'),'where':_0x1df3cb,'limit':0x1,'order':[['updatedAt',_0x33c0('0x7a')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x33c0('0x1f')](handleEntityNotFound(_0x2f5b57,null))[_0x33c0('0x1f')](function(_0x4219fb){if(_0x4219fb&&_0x4219fb[_0x33c0('0x78')]){_0x3c8ca0['account']=_0x4219fb;_0x3c8ca0['applications']=_0x4219fb['Applications'];_0x3c8ca0[_0x33c0('0x7b')]=_0x4219fb[_0x33c0('0x78')];_0x3c8ca0[_0x33c0('0x7c')]=_[_0x33c0('0x7d')](_0x3c8ca0[_0x33c0('0x7c')],[_0x33c0('0x7e')],['asc']);if(_0x3c8ca0['account']['Applications']){delete _0x3c8ca0[_0x33c0('0x7f')][_0x33c0('0x80')];}if(_0x3c8ca0['account'][_0x33c0('0x78')]&&_0x3c8ca0['account'][_0x33c0('0x78')]['Contacts'][_0x33c0('0x5f')]){return _0x3c8ca0[_0x33c0('0x7f')][_0x33c0('0x78')][_0x33c0('0x79')][0x0];}var _0x2a103c=_[_0x33c0('0x16')](_0x17de40[_0x33c0('0x5a')],{'firstName':_0x17de40[_0x33c0('0x5a')][_0x33c0('0x73')],'ListId':_0x4219fb[_0x33c0('0x71')]});_0x2a103c[_0x17de40[_0x33c0('0x5a')]['mapKey']]=_0x17de40[_0x33c0('0x5a')][_0x33c0('0x73')];return db[_0x33c0('0x69')][_0x33c0('0x55')](_0x2a103c,{'fields':_0x3ac09d,'raw':!![]});}})[_0x33c0('0x1f')](handleEntityNotFound(_0x2f5b57,null))[_0x33c0('0x1f')](function(_0x743acf){_0x3c8ca0['contact']=_0x743acf;if(_0x743acf){var _0x577e87={'ContactId':_0x743acf['id'],'OpenchannelAccountId':_0x17de40[_0x33c0('0x52')]['id'],'from':(_0x743acf['firstName']||'')+'\x20'+(_0x743acf[_0x33c0('0x81')]||'')};var _0x466c29={'OpenchannelAccountId':_0x17de40[_0x33c0('0x52')]['id'],'closed':![]};if(_0x17de40[_0x33c0('0x5a')]['threadId']){_0x466c29['threadId']=_0x17de40[_0x33c0('0x5a')][_0x33c0('0x82')];return db[_0x33c0('0x83')][_0x33c0('0x54')]({'where':_0x466c29})['then'](function(_0xb64ef6){if(_0xb64ef6){return[_0xb64ef6,![]];}_0x577e87[_0x33c0('0x82')]=_0x17de40[_0x33c0('0x5a')]['threadId'];_0x577e87['externalUrl']=_0x17de40[_0x33c0('0x5a')]['externalUrl'];return db[_0x33c0('0x83')][_0x33c0('0x55')](_0x577e87)['then'](function(_0x10c881){return[_0x10c881,!![]];});});}else{_0x466c29[_0x33c0('0x82')]=null;}_0x466c29[_0x33c0('0x84')]=_0x743acf['id'];return db[_0x33c0('0x83')][_0x33c0('0x54')]({'where':_0x466c29})[_0x33c0('0x1f')](function(_0x595d56){if(_0x595d56){return[_0x595d56,![]];}return db[_0x33c0('0x83')][_0x33c0('0x55')](_0x577e87)[_0x33c0('0x1f')](function(_0x9a23d3){return[_0x9a23d3,!![]];});});}})[_0x33c0('0x85')](function(_0x3fa077,_0x3069e0){if(_0x3fa077){_0x3b6c29=_0x3069e0;if(!_0x3069e0){var _0x3eb569={'from':(_0x3c8ca0[_0x33c0('0x86')]['firstName']||'')+'\x20'+(_0x3c8ca0['contact'][_0x33c0('0x81')]||'')};if(_0x17de40['body']['threadId']&&_0x17de40[_0x33c0('0x5a')][_0x33c0('0x87')]&&_0x17de40[_0x33c0('0x5a')][_0x33c0('0x82')]!=_0x17de40['body'][_0x33c0('0x87')]){_0x3eb569[_0x33c0('0x82')]=_0x17de40[_0x33c0('0x5a')][_0x33c0('0x87')];}return _0x3fa077[_0x33c0('0x35')](_0x3eb569);}else{return _0x3fa077;}}})['then'](function(_0x5f1d0f){_0x3c8ca0['interaction']=_0x5f1d0f['get']({'plain':!![]});_0x3c8ca0[_0x33c0('0x88')][_0x33c0('0x89')]=_0x3b6c29;if(_0x3c8ca0[_0x33c0('0x88')][_0x33c0('0x89')]){if(_0x3c8ca0['account'][_0x33c0('0x8a')]){_0x3c8ca0[_0x33c0('0x7c')][_0x33c0('0x8b')]({'id':0x0,'priority':_0x3c8ca0['applications'][_0x33c0('0x5f')]+0x1,'app':_0x33c0('0x8c'),'appdata':_0x33c0('0x8d'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x33c0('0x55')]({'body':_0x17de40[_0x33c0('0x5a')][_0x33c0('0x5a')],'OpenchannelAccountId':_0x17de40[_0x33c0('0x52')]['id'],'OpenchannelInteractionId':_0x5f1d0f['id'],'direction':'in','ContactId':_0x3c8ca0[_0x33c0('0x86')]['id'],'AttachmentId':_0x17de40[_0x33c0('0x5a')][_0x33c0('0x8e')]});})[_0x33c0('0x1f')](function(_0x5f2220){_0x3c8ca0[_0x33c0('0x27')]=_0x5f2220;if(!_0x3c8ca0[_0x33c0('0x88')][_0x33c0('0x8f')])return;return db['User'][_0x33c0('0x54')]({'attributes':['id',_0x33c0('0x38')],'where':{'id':_0x3c8ca0[_0x33c0('0x88')][_0x33c0('0x8f')]}});})[_0x33c0('0x1f')](function(_0x306073){if(_0x306073){_0x3c8ca0[_0x33c0('0x7c')][_0x33c0('0x90')]({'id':0x0,'priority':0x0,'app':_0x33c0('0x91'),'appdata':_0x306073[_0x33c0('0x38')]+','+(_0x3c8ca0[_0x33c0('0x7f')][_0x33c0('0x92')]||0xa),'interval':_0x33c0('0x93')});}if(!_0x3c8ca0[_0x33c0('0x88')][_0x33c0('0x94')])return;return db[_0x33c0('0x95')]['find']({'attributes':['id',_0x33c0('0x38')],'where':{'id':_0x3c8ca0[_0x33c0('0x88')]['queueId']}});})[_0x33c0('0x1f')](function(_0x208fa3){if(_0x208fa3){_0x3c8ca0[_0x33c0('0x7c')][_0x33c0('0x90')]({'id':0x0,'priority':0x1,'app':_0x33c0('0x96'),'appdata':_0x208fa3['name']+','+(_0x3c8ca0[_0x33c0('0x7f')][_0x33c0('0x97')]||0x12c),'interval':_0x33c0('0x93')});}return respondWithRpcPromise(_0x33c0('0x98'),_0x33c0('0x99'),_0x3c8ca0);})[_0x33c0('0x1f')](function(_0x2751c1){respondWithRpcPromise(_0x33c0('0x9a'),_0x33c0('0x9a'),{'event':'notify','message':_0x2751c1},client9002);return _0x2751c1;})[_0x33c0('0x1f')](respondWithResult(_0x2f5b57,null))[_0x33c0('0x29')](handleError(_0x2f5b57,null));};exports[_0x33c0('0x9b')]=function(_0x4be6a3,_0x321011){var _0x2d7549=_0x4be6a3[_0x33c0('0x52')]['id'];var _0x1a40da=_0x4be6a3[_0x33c0('0x5a')];var _0x373676=0xc8;var _0x5f24fd=null;return db['sequelize'][_0x33c0('0x9c')]({'isolationLevel':db[_0x33c0('0x9d')][_0x33c0('0x9e')][_0x33c0('0x9f')][_0x33c0('0xa0')]},function(_0x15dc50){return db[_0x33c0('0x3d')][_0x33c0('0x5e')]({'where':{'id':_0x2d7549},'transaction':_0x15dc50})['then'](function(_0x5e6f55){if(_0x5e6f55){return db[_0x33c0('0xa1')][_0x33c0('0x36')]({'where':{'OpenchannelAccountId':_0x2d7549},'transaction':_0x15dc50})[_0x33c0('0x1f')](function(){var _0x745b94=_[_0x33c0('0x3c')](_0x1a40da,function(_0x983628){_0x983628[_0x33c0('0x62')]=_0x2d7549;return _0x983628;});return db[_0x33c0('0xa1')][_0x33c0('0xa2')](_0x745b94,{'transaction':_0x15dc50});});}else{_0x373676=0x194;_0x5f24fd=[];}});})['then'](function(){if(_0x373676!==0x194){return db[_0x33c0('0xa1')][_0x33c0('0xa3')]({'where':{'OpenchannelAccountId':_0x2d7549},'order':_0x33c0('0x7e')})['then'](function(_0x3eff05){_0x5f24fd=_0x3eff05;});}})[_0x33c0('0x29')](function(_0x55ba37){_0x373676=0x1f4;logger[_0x33c0('0x25')](_0x55ba37['stack']);if(_0x55ba37[_0x33c0('0x38')]){delete _0x55ba37[_0x33c0('0x38')];}_0x5f24fd=_0x55ba37;})[_0x33c0('0xa4')](function(){if(_0x5f24fd===null){_0x321011[_0x33c0('0x2a')](_0x373676);}else{if(_0x373676===0x1f4){_0x321011['status'](_0x373676)[_0x33c0('0x39')](_0x5f24fd);}else{_0x321011[_0x33c0('0x2b')](_0x373676)['json'](_0x5f24fd);}}});};exports[_0x33c0('0xa5')]=function(_0x34546a,_0x150c9f,_0x41f728){var _0x5b158c={};var _0x5d9e0f={};var _0xfef18c;var _0x8fe4de;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x34546a[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x150c9f,null))[_0x33c0('0x1f')](function(_0x1a8db4){if(_0x1a8db4){_0xfef18c=_0x1a8db4;_0x5d9e0f[_0x33c0('0x40')]=_[_0x33c0('0x42')](db[_0x33c0('0xa1')]['rawAttributes']);_0x5d9e0f['query']=_[_0x33c0('0x42')](_0x34546a[_0x33c0('0x41')]);_0x5d9e0f['filters']=_[_0x33c0('0x44')](_0x5d9e0f['model'],_0x5d9e0f['query']);_0x5b158c['attributes']=_[_0x33c0('0x44')](_0x5d9e0f[_0x33c0('0x40')],qs[_0x33c0('0x45')](_0x34546a[_0x33c0('0x41')]['fields']));_0x5b158c[_0x33c0('0x46')]=_0x5b158c[_0x33c0('0x46')][_0x33c0('0x5f')]?_0x5b158c[_0x33c0('0x46')]:_0x5d9e0f['model'];_0x5b158c[_0x33c0('0x48')]=qs[_0x33c0('0x49')](_0x34546a[_0x33c0('0x41')][_0x33c0('0x49')]);_0x5b158c[_0x33c0('0x4a')]=qs[_0x33c0('0x43')](_['pick'](_0x34546a[_0x33c0('0x41')],_0x5d9e0f[_0x33c0('0x43')]));if(_0x34546a['query'][_0x33c0('0x4b')]){_0x5b158c[_0x33c0('0x4a')]=_['merge'](_0x5b158c[_0x33c0('0x4a')],{'$or':_[_0x33c0('0x3c')](_0x5b158c['attributes'],function(_0x4e8b2c){var _0x3ca642={};_0x3ca642[_0x4e8b2c]={'$like':'%'+_0x34546a['query']['filter']+'%'};return _0x3ca642;})});}_0x5b158c=_['merge']({},_0x5b158c,_0x34546a[_0x33c0('0x4d')]);return _0xfef18c['getApplications'](_0x5b158c);}})[_0x33c0('0x1f')](function(_0x44a32d){if(_0x44a32d){_0x8fe4de=_0x44a32d['length'];if(!_0x34546a[_0x33c0('0x41')][_0x33c0('0x60')]('nolimit')){_0x5b158c[_0x33c0('0x2f')]=qs[_0x33c0('0x2f')](_0x34546a[_0x33c0('0x41')][_0x33c0('0x2f')]);_0x5b158c[_0x33c0('0x2e')]=qs[_0x33c0('0x2e')](_0x34546a[_0x33c0('0x41')]['offset']);}return _0xfef18c[_0x33c0('0xa5')](_0x5b158c);}})[_0x33c0('0x1f')](function(_0x46698d){if(_0x46698d){return _0x46698d?{'count':_0x8fe4de,'rows':_0x46698d}:null;}})[_0x33c0('0x1f')](respondWithResult(_0x150c9f,null))[_0x33c0('0x29')](handleError(_0x150c9f,null));};exports[_0x33c0('0xa6')]=function(_0x34bf4b,_0x563181,_0x108182){var _0x2406ce={'raw':![],'where':{}};var _0xaf8848={};var _0x41508e={'count':0x0,'rows':[]};return db[_0x33c0('0x3d')][_0x33c0('0x5e')]({'where':{'id':_0x34bf4b[_0x33c0('0x52')]['id']}})['then'](handleEntityNotFound(_0x563181,null))[_0x33c0('0x1f')](function(_0x522674){if(_0x522674){_0xaf8848[_0x33c0('0x40')]=_[_0x33c0('0x42')](db['OpenchannelInteraction'][_0x33c0('0x3e')]);_0xaf8848['query']=_[_0x33c0('0x42')](_0x34bf4b[_0x33c0('0x41')]);_0xaf8848[_0x33c0('0x43')]=_['intersection'](_0xaf8848[_0x33c0('0x40')],_0xaf8848[_0x33c0('0x41')]);_0x2406ce['attributes']=_['intersection'](_0xaf8848[_0x33c0('0x40')],qs['fields'](_0x34bf4b[_0x33c0('0x41')][_0x33c0('0x45')]));_0x2406ce[_0x33c0('0x46')]=_0x2406ce['attributes'][_0x33c0('0x5f')]?_0x2406ce[_0x33c0('0x46')]:_0xaf8848['model'];if(!_0x34bf4b[_0x33c0('0x41')][_0x33c0('0x60')]('nolimit')){_0x2406ce[_0x33c0('0x2f')]=qs[_0x33c0('0x2f')](_0x34bf4b['query'][_0x33c0('0x2f')]);_0x2406ce[_0x33c0('0x2e')]=qs['offset'](_0x34bf4b['query']['offset']);}_0x2406ce[_0x33c0('0x48')]=qs[_0x33c0('0x49')](_0x34bf4b['query'][_0x33c0('0x49')]);_0x2406ce[_0x33c0('0x4a')]=qs['filters'](_[_0x33c0('0x65')](_0x34bf4b[_0x33c0('0x41')],_0xaf8848[_0x33c0('0x43')]));_0x2406ce[_0x33c0('0x4a')][_0x33c0('0x62')]=_0x522674['id'];if(_0x34bf4b[_0x33c0('0x41')][_0x33c0('0x4b')]){_0x2406ce[_0x33c0('0x4a')]=_['merge'](_0x2406ce[_0x33c0('0x4a')],{'$or':_[_0x33c0('0x3c')](_0x2406ce['attributes'],function(_0x4e2a57){var _0x1f8a75={};_0x1f8a75[_0x4e2a57]={'$like':'%'+_0x34bf4b[_0x33c0('0x41')]['filter']+'%'};return _0x1f8a75;})});}_0x2406ce=_['merge']({},_0x2406ce,_0x34bf4b[_0x33c0('0x4d')]);return db['OpenchannelInteraction'][_0x33c0('0x30')]({'where':_0x2406ce[_0x33c0('0x4a')]})[_0x33c0('0x1f')](function(_0x3a6643){_0x41508e[_0x33c0('0x30')]=_0x3a6643;if(_0x34bf4b[_0x33c0('0x41')][_0x33c0('0x66')]){_0x2406ce[_0x33c0('0x4e')]=[{'model':db[_0x33c0('0x69')],'as':_0x33c0('0xa7'),'required':![]},{'model':db[_0x33c0('0xa8')],'as':_0x33c0('0xa9'),'attributes':[_0x33c0('0x38'),_0x33c0('0xaa'),_0x33c0('0xab')],'required':![]},{'model':db[_0x33c0('0xac')],'as':_0x33c0('0xad'),'attributes':['id','name',_0x33c0('0xae')],'where':_0x34bf4b[_0x33c0('0x41')]['tag']?{'id':_0x34bf4b['query']['tag']}:undefined,'required':_0x34bf4b[_0x33c0('0x41')][_0x33c0('0xaf')]?!![]:![]}];}return db[_0x33c0('0x83')]['findAll'](_0x2406ce);})[_0x33c0('0x1f')](function(_0x2758c3){_0x41508e[_0x33c0('0x50')]=_0x2758c3;return _0x41508e;});}})[_0x33c0('0x1f')](respondWithFilteredResult(_0x563181,_0x2406ce))[_0x33c0('0x29')](handleError(_0x563181,null));};exports[_0x33c0('0xb0')]=function(_0x543e85,_0xf3a9b7,_0x3d87dc){return db[_0x33c0('0x3d')][_0x33c0('0x54')]({'where':{'id':_0x543e85[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0xf3a9b7,null))[_0x33c0('0x1f')](function(_0x59dfb8){if(_0x59dfb8){return _0x59dfb8['addAgents'](_0x543e85['body'][_0x33c0('0x61')],_[_0x33c0('0xb1')](_0x543e85[_0x33c0('0x5a')],['ids','id'])||{})[_0x33c0('0x85')](function(_0x53b3e5){for(var _0x2b0785=0x0;_0x2b0785<_0x543e85['body']['ids'][_0x33c0('0x5f')];_0x2b0785+=0x1){socket['emit'](_0x33c0('0xb2'),{'UserId':Number(_0x543e85[_0x33c0('0x5a')][_0x33c0('0x61')][_0x2b0785]),'OpenchannelAccountId':Number(_0x543e85[_0x33c0('0x52')]['id'])});}return _0x53b3e5;});}})[_0x33c0('0x1f')](respondWithResult(_0xf3a9b7,null))['catch'](handleError(_0xf3a9b7,null));};exports[_0x33c0('0xb3')]=function(_0x3d0f5a,_0x46a6a5,_0x3023a2){return db['OpenchannelAccount'][_0x33c0('0x54')]({'where':{'id':_0x3d0f5a['params']['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x46a6a5,null))[_0x33c0('0x1f')](function(_0x556266){if(_0x556266){return _0x556266['removeAgents'](_0x3d0f5a[_0x33c0('0x41')][_0x33c0('0x61')])['then'](function(){if(_[_0x33c0('0xb4')](_0x3d0f5a[_0x33c0('0x41')][_0x33c0('0x61')])){for(var _0x2dc901=0x0;_0x2dc901<_0x3d0f5a[_0x33c0('0x41')][_0x33c0('0x61')]['length'];_0x2dc901+=0x1){socket[_0x33c0('0xb5')](_0x33c0('0xb6'),{'UserId':Number(_0x3d0f5a['query'][_0x33c0('0x61')][_0x2dc901]),'OpenchannelAccountId':Number(_0x3d0f5a['params']['id'])});}}else{socket['emit'](_0x33c0('0xb6'),{'UserId':Number(_0x3d0f5a[_0x33c0('0x41')][_0x33c0('0x61')]),'OpenchannelAccountId':Number(_0x3d0f5a[_0x33c0('0x52')]['id'])});}});}})[_0x33c0('0x1f')](respondWithStatusCode(_0x46a6a5,null))[_0x33c0('0x29')](handleError(_0x46a6a5,null));};exports['getAgents']=function(_0x53876e,_0x37cdff,_0x1b4d4d){var _0x52f397={};var _0x529a3d={};var _0x55f67e;var _0x5d5887;return db[_0x33c0('0x3d')]['findOne']({'where':{'id':_0x53876e['params']['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x37cdff,null))[_0x33c0('0x1f')](function(_0x525a22){if(_0x525a22){_0x55f67e=_0x525a22;_0x529a3d[_0x33c0('0x40')]=_[_0x33c0('0x42')](db[_0x33c0('0xa8')]['rawAttributes']);_0x529a3d[_0x33c0('0x41')]=_[_0x33c0('0x42')](_0x53876e[_0x33c0('0x41')]);_0x529a3d[_0x33c0('0x43')]=_[_0x33c0('0x44')](_0x529a3d['model'],_0x529a3d[_0x33c0('0x41')]);_0x52f397[_0x33c0('0x46')]=_['intersection'](_0x529a3d[_0x33c0('0x40')],qs[_0x33c0('0x45')](_0x53876e[_0x33c0('0x41')][_0x33c0('0x45')]));_0x52f397['attributes']=_0x52f397[_0x33c0('0x46')][_0x33c0('0x5f')]?_0x52f397[_0x33c0('0x46')]:_0x529a3d['model'];_0x52f397[_0x33c0('0x48')]=qs[_0x33c0('0x49')](_0x53876e[_0x33c0('0x41')]['sort']);_0x52f397[_0x33c0('0x4a')]=qs[_0x33c0('0x43')](_[_0x33c0('0x65')](_0x53876e[_0x33c0('0x41')],_0x529a3d[_0x33c0('0x43')]));if(_0x53876e[_0x33c0('0x41')][_0x33c0('0x4b')]){_0x52f397[_0x33c0('0x4a')]=_[_0x33c0('0x4c')](_0x52f397[_0x33c0('0x4a')],{'$or':_[_0x33c0('0x3c')](_0x52f397[_0x33c0('0x46')],function(_0x295796){var _0x19110f={};_0x19110f[_0x295796]={'$like':'%'+_0x53876e['query']['filter']+'%'};return _0x19110f;})});}_0x52f397=_[_0x33c0('0x4c')]({},_0x52f397,_0x53876e['options']);return _0x55f67e[_0x33c0('0xb7')](_0x52f397);}})[_0x33c0('0x1f')](function(_0x53a375){if(_0x53a375){_0x5d5887=_0x53a375['length'];if(!_0x53876e[_0x33c0('0x41')][_0x33c0('0x60')](_0x33c0('0x47'))){_0x52f397[_0x33c0('0x2f')]=qs[_0x33c0('0x2f')](_0x53876e['query'][_0x33c0('0x2f')]);_0x52f397[_0x33c0('0x2e')]=qs[_0x33c0('0x2e')](_0x53876e[_0x33c0('0x41')][_0x33c0('0x2e')]);}return _0x55f67e[_0x33c0('0xb7')](_0x52f397);}})['then'](function(_0x161581){if(_0x161581){return _0x161581?{'count':_0x5d5887,'rows':_0x161581}:null;}})[_0x33c0('0x1f')](respondWithResult(_0x37cdff,null))[_0x33c0('0x29')](handleError(_0x37cdff,null));};exports['send']=function(_0x307dfd,_0x73af3b,_0x23eb44){var _0x5d7680,_0x26771d,_0x497751;if(_[_0x33c0('0x72')](_0x307dfd[_0x33c0('0x5a')][_0x33c0('0x5a')])||_0x307dfd[_0x33c0('0x5a')][_0x33c0('0x5a')]===''){throw new db[(_0x33c0('0x6a'))][(_0x33c0('0x6b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x33c0('0x72')](_0x307dfd[_0x33c0('0x5a')]['to'])){}_0x5d7680=_0x307dfd['body']['to'];return db[_0x33c0('0x3d')][_0x33c0('0x5e')]({'where':{'id':_0x307dfd[_0x33c0('0x52')]['id']}})[_0x33c0('0x1f')](handleEntityNotFound(_0x73af3b,null))['then'](function(_0x17767f){if(_0x17767f){return db[_0x33c0('0x3d')][_0x33c0('0x54')]({'where':{'id':_0x17767f['id']},'include':[{'model':db[_0x33c0('0xb8')],'as':_0x33c0('0x78'),'include':[{'model':db[_0x33c0('0x69')],'as':_0x33c0('0x79'),'where':{[_0x17767f['mapKey']]:_0x5d7680},'limit':0x1,'order':[[_0x33c0('0x6f'),_0x33c0('0x7a')]]}]}]})[_0x33c0('0x1f')](handleEntityNotFound(_0x73af3b,null))['then'](function(_0x79fc2d){if(_0x79fc2d&&_0x79fc2d[_0x33c0('0x78')]){_0x26771d=_0x79fc2d[_0x33c0('0x37')]({'plain':!![]});if(_0x26771d[_0x33c0('0x78')]&&_0x26771d[_0x33c0('0x78')][_0x33c0('0x79')][_0x33c0('0x5f')]){return _0x26771d[_0x33c0('0x78')][_0x33c0('0x79')][0x0];}return db['CmContact'][_0x33c0('0x55')](_[_0x33c0('0x16')](_0x307dfd[_0x33c0('0x5a')],{'firstName':_0x5d7680,[_0x79fc2d['mapKey']]:_0x5d7680,'phone':_0x5d7680,'ListId':_0x26771d[_0x33c0('0x71')]}));}})[_0x33c0('0x1f')](handleEntityNotFound(_0x73af3b,null))['then'](function(_0x4f6180){if(_0x4f6180){_0x497751=_0x4f6180;return db[_0x33c0('0x83')]['find']({'where':{'ContactId':_0x497751['id'],'closed':![],'OpenchannelAccountId':_0x26771d['id']}})[_0x33c0('0x1f')](function(_0x359240){if(_0x359240){return[_0x359240,![]];}return db[_0x33c0('0x83')][_0x33c0('0x55')]({'UserId':_0x307dfd[_0x33c0('0x56')]['id'],'ContactId':_0x497751['id'],'OpenchannelAccountId':_0x26771d['id'],'lastMsgDirection':'out','firstMsgDirection':_0x33c0('0xb9'),'Messages':[_[_0x33c0('0x4c')](_0x307dfd[_0x33c0('0x5a')],{'read':![],'body':_0x307dfd[_0x33c0('0x5a')]['body'],'OpenchannelAccountId':_0x26771d['id'],'UserId':_0x307dfd['user']['id'],'ContactId':_0x497751['id']})]},{'include':[{'model':db[_0x33c0('0xba')],'as':'Messages'}]})[_0x33c0('0x1f')](function(_0x331cb4){return[_0x331cb4,!![]];});});}})[_0x33c0('0x85')](function(_0x1a3ccd,_0x475738){if(_0x475738){return _0x1a3ccd;}return db[_0x33c0('0xba')]['create'](_[_0x33c0('0x4c')](_0x307dfd[_0x33c0('0x5a')],{'read':![],'body':_0x307dfd[_0x33c0('0x5a')]['body'],'OpenchannelAccountId':_0x26771d['id'],'OpenchannelInteractionId':_0x1a3ccd['id'],'UserId':_0x307dfd[_0x33c0('0x56')]['id'],'ContactId':_0x497751['id']}))[_0x33c0('0x1f')](function(_0x59437c){_0x1a3ccd[_0x33c0('0xbb')][_0x33c0('0xbc')]=[];_0x1a3ccd[_0x33c0('0xbb')][_0x33c0('0xbc')][_0x33c0('0x8b')](_0x59437c[_0x33c0('0xbb')]);return _0x1a3ccd;});});}})[_0x33c0('0x1f')](respondWithResult(_0x73af3b,null))[_0x33c0('0x29')](handleError(_0x73af3b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1454e8e..8a6c88e 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 _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x24c970,_0x1199ef){var _0x48f700=function(_0x5d22fe){while(--_0x5d22fe){_0x24c970['push'](_0x24c970['shift']());}};_0x48f700(++_0x1199ef);}(_0x3c81,0x102));var _0x13c8=function(_0x53122f,_0x294f68){_0x53122f=_0x53122f-0x0;var _0x115b52=_0x3c81[_0x53122f];return _0x115b52;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x91a7=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x91a7,0xe7));var _0x791a=function(_0x4912f2,_0x1d2a00){_0x4912f2=_0x4912f2-0x0;var _0x2f2b52=_0x91a7[_0x4912f2];return _0x2f2b52;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){OpenchannelAccountEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);OpenchannelAccountEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 080beaa..423e263 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(_0x103c4d,_0x3cf8ce){var _0x5b45ab=function(_0x4ee75c){while(--_0x4ee75c){_0x103c4d['push'](_0x103c4d['shift']());}};_0x5b45ab(++_0x3cf8ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x458129,_0x1a9dea){var _0x2c751d=function(_0x29b240){while(--_0x29b240){_0x458129['push'](_0x458129['shift']());}};_0x2c751d(++_0x1a9dea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 75c551a..e3f4be7 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 _0x2f68=['OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','socket.io-emitter','redis','./openchannelAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x27ffc3,_0x57a962){var _0x29b18f=function(_0x531e46){while(--_0x531e46){_0x27ffc3['push'](_0x27ffc3['shift']());}};_0x29b18f(++_0x57a962);}(_0x2f68,0x9a));var _0x82f6=function(_0x1e545c,_0x178134){_0x1e545c=_0x1e545c-0x0;var _0x17fbeb=_0x2f68[_0x1e545c];return _0x17fbeb;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x82f6('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x82f6('0xa'))(new Redis(config[_0x82f6('0xb')]));require(_0x82f6('0xc'))['register'](socket);function respondWithRpcPromise(_0x27db58,_0x432289,_0x4e7c12){return new BPromise(function(_0x1cf88e,_0x1eec2f){return client[_0x82f6('0xd')](_0x27db58,_0x4e7c12)[_0x82f6('0xe')](function(_0x1a68c4){logger[_0x82f6('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x432289,_0x82f6('0x10'));logger[_0x82f6('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x432289,_0x82f6('0x10'),JSON[_0x82f6('0x12')](_0x1a68c4));if(_0x1a68c4[_0x82f6('0x13')]){if(_0x1a68c4[_0x82f6('0x13')][_0x82f6('0x14')]===0x1f4){logger[_0x82f6('0x13')](_0x82f6('0x15'),_0x432289,_0x1a68c4[_0x82f6('0x13')][_0x82f6('0x16')]);return _0x1eec2f(_0x1a68c4['error'][_0x82f6('0x16')]);}logger['error'](_0x82f6('0x15'),_0x432289,_0x1a68c4[_0x82f6('0x13')][_0x82f6('0x16')]);return _0x1cf88e(_0x1a68c4[_0x82f6('0x13')][_0x82f6('0x16')]);}else{logger[_0x82f6('0xf')](_0x82f6('0x15'),_0x432289,_0x82f6('0x10'));_0x1cf88e(_0x1a68c4[_0x82f6('0x17')][_0x82f6('0x16')]);}})[_0x82f6('0x18')](function(_0x1d9091){logger[_0x82f6('0x13')](_0x82f6('0x15'),_0x432289,_0x1d9091);_0x1eec2f(_0x1d9091);});});} \ No newline at end of file +var _0xc788=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x21be0e,_0xc791d){var _0x4f4456=function(_0x367432){while(--_0x367432){_0x21be0e['push'](_0x21be0e['shift']());}};_0x4f4456(++_0xc791d);}(_0xc788,0xc4));var _0x8c78=function(_0x3ca29d,_0x5a8d31){_0x3ca29d=_0x3ca29d-0x0;var _0x5c5d2e=_0xc788[_0x3ca29d];return _0x5c5d2e;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var moment=require(_0x8c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c78('0x3'));var db=require(_0x8c78('0x4'))['db'];var utils=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c78('0x8'));var client=jayson[_0x8c78('0x9')][_0x8c78('0xa')]({'port':0x232a});config[_0x8c78('0xb')]=_[_0x8c78('0xc')](config['redis'],{'host':_0x8c78('0xd'),'port':0x18eb});var socket=require(_0x8c78('0xe'))(new Redis(config[_0x8c78('0xb')]));require(_0x8c78('0xf'))[_0x8c78('0x10')](socket);function respondWithRpcPromise(_0x39e116,_0x4f3e43,_0x13db9c){return new BPromise(function(_0x47a54b,_0x3d55f0){return client[_0x8c78('0x11')](_0x39e116,_0x13db9c)['then'](function(_0x1a05a7){logger[_0x8c78('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f3e43,_0x8c78('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4f3e43,_0x8c78('0x13'),JSON[_0x8c78('0x14')](_0x1a05a7));if(_0x1a05a7[_0x8c78('0x15')]){if(_0x1a05a7[_0x8c78('0x15')][_0x8c78('0x16')]===0x1f4){logger[_0x8c78('0x15')](_0x8c78('0x17'),_0x4f3e43,_0x1a05a7[_0x8c78('0x15')][_0x8c78('0x18')]);return _0x3d55f0(_0x1a05a7[_0x8c78('0x15')]['message']);}logger[_0x8c78('0x15')](_0x8c78('0x17'),_0x4f3e43,_0x1a05a7['error'][_0x8c78('0x18')]);return _0x47a54b(_0x1a05a7[_0x8c78('0x15')][_0x8c78('0x18')]);}else{logger[_0x8c78('0x12')](_0x8c78('0x17'),_0x4f3e43,_0x8c78('0x13'));_0x47a54b(_0x1a05a7['result']['message']);}})[_0x8c78('0x19')](function(_0x4a81a4){logger['error'](_0x8c78('0x17'),_0x4f3e43,_0x4a81a4);_0x3d55f0(_0x4a81a4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9f6a5c7..e42a8a9 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 _0xc30d=['update','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove'];(function(_0x4ec24d,_0x1db588){var _0x206236=function(_0x20ef2f){while(--_0x20ef2f){_0x4ec24d['push'](_0x4ec24d['shift']());}};_0x206236(++_0x1db588);}(_0xc30d,0x6e));var _0xdc30=function(_0x40b003,_0x3ae3aa){_0x40b003=_0x40b003-0x0;var _0x3d0edc=_0xc30d[_0x40b003];return _0x3d0edc;};'use strict';var OpenchannelAccountEvents=require(_0xdc30('0x0'));var events=['save',_0xdc30('0x1'),_0xdc30('0x2')];function createListener(_0x15aa6c,_0x3d0fd5){return function(_0x129c4e){_0x3d0fd5['emit'](_0x15aa6c,_0x129c4e);};}function removeListener(_0x1cc1bc,_0x53cb76){return function(){OpenchannelAccountEvents[_0xdc30('0x3')](_0x1cc1bc,_0x53cb76);};}exports[_0xdc30('0x4')]=function(_0x1d2db4){for(var _0x3e480e=0x0,_0x4011da=events[_0xdc30('0x5')];_0x3e480e<_0x4011da;_0x3e480e++){var _0x4a0310=events[_0x3e480e];var _0x1cdfb4=createListener(_0xdc30('0x6')+_0x4a0310,_0x1d2db4);OpenchannelAccountEvents['on'](_0x4a0310,_0x1cdfb4);}}; \ No newline at end of file +var _0xb2b3=['openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register','length'];(function(_0x4c414b,_0x17bfa2){var _0x2b0c92=function(_0x2a48d3){while(--_0x2a48d3){_0x4c414b['push'](_0x4c414b['shift']());}};_0x2b0c92(++_0x17bfa2);}(_0xb2b3,0x71));var _0x3b2b=function(_0x970aa8,_0x371931){_0x970aa8=_0x970aa8-0x0;var _0x6ea9bd=_0xb2b3[_0x970aa8];return _0x6ea9bd;};'use strict';var OpenchannelAccountEvents=require(_0x3b2b('0x0'));var events=[_0x3b2b('0x1'),_0x3b2b('0x2'),_0x3b2b('0x3')];function createListener(_0xf005ed,_0x3de73b){return function(_0x2059f0){_0x3de73b['emit'](_0xf005ed,_0x2059f0);};}function removeListener(_0x3eff63,_0x222c10){return function(){OpenchannelAccountEvents[_0x3b2b('0x4')](_0x3eff63,_0x222c10);};}exports[_0x3b2b('0x5')]=function(_0x2581eb){for(var _0xc53a84=0x0,_0x83e7ef=events[_0x3b2b('0x6')];_0xc53a84<_0x83e7ef;_0xc53a84++){var _0x1a9054=events[_0xc53a84];var _0x3ec416=createListener(_0x3b2b('0x7')+_0x1a9054,_0x2581eb);OpenchannelAccountEvents['on'](_0x1a9054,_0x3ec416);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 38788b1..678a43c 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 _0x89cc=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x89cc,0x196));var _0xc89c=function(_0x5e2e8a,_0x5058cf){_0x5e2e8a=_0x5e2e8a-0x0;var _0x19008a=_0x89cc[_0x5e2e8a];return _0x19008a;};'use strict';var multer=require(_0xc89c('0x0'));var util=require(_0xc89c('0x1'));var path=require(_0xc89c('0x2'));var timeout=require(_0xc89c('0x3'));var express=require('express');var router=express[_0xc89c('0x4')]();var fs_extra=require(_0xc89c('0x5'));var auth=require(_0xc89c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc89c('0x7'));var controller=require('./openchannelApplication.controller');router[_0xc89c('0x8')]('/',auth[_0xc89c('0x9')](),controller[_0xc89c('0xa')]);router[_0xc89c('0x8')](_0xc89c('0xb'),auth[_0xc89c('0x9')](),controller[_0xc89c('0xc')]);router[_0xc89c('0xd')]('/',auth[_0xc89c('0x9')](),controller[_0xc89c('0xe')]);router['put'](_0xc89c('0xb'),auth[_0xc89c('0x9')](),controller['update']);router['delete'](_0xc89c('0xb'),auth['isAuthenticated'](),controller[_0xc89c('0xf')]);module[_0xc89c('0x10')]=router; \ No newline at end of file +var _0x9267=['../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x9267,0x1dd));var _0x7926=function(_0x2cb05c,_0x2ab0d6){_0x2cb05c=_0x2cb05c-0x0;var _0x1ae777=_0x9267[_0x2cb05c];return _0x1ae777;};'use strict';var multer=require(_0x7926('0x0'));var util=require('util');var path=require(_0x7926('0x1'));var timeout=require(_0x7926('0x2'));var express=require(_0x7926('0x3'));var router=express[_0x7926('0x4')]();var fs_extra=require(_0x7926('0x5'));var auth=require(_0x7926('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7926('0x7'));var controller=require(_0x7926('0x8'));router[_0x7926('0x9')]('/',auth[_0x7926('0xa')](),controller[_0x7926('0xb')]);router[_0x7926('0x9')](_0x7926('0xc'),auth[_0x7926('0xa')](),controller[_0x7926('0xd')]);router[_0x7926('0xe')]('/',auth[_0x7926('0xa')](),controller[_0x7926('0xf')]);router[_0x7926('0x10')](_0x7926('0xc'),auth[_0x7926('0xa')](),controller[_0x7926('0x11')]);router[_0x7926('0x12')]('/:id',auth[_0x7926('0xa')](),controller[_0x7926('0x13')]);module[_0x7926('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c1e0b1c..463acc3 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 _0x8116=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x4f2330,_0x371cd7){var _0x38016f=function(_0x6aa668){while(--_0x6aa668){_0x4f2330['push'](_0x4f2330['shift']());}};_0x38016f(++_0x371cd7);}(_0x8116,0x1ec));var _0x6811=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8116[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x6811('0x0'));module[_0x6811('0x1')]={'priority':{'type':Sequelize[_0x6811('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6811('0x3')],'allowNull':![],'defaultValue':_0x6811('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6811('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd3b8=['*,*,*,*','exports','STRING','noop'];(function(_0x552a9b,_0x3f2cd9){var _0x48d23f=function(_0x50cf48){while(--_0x50cf48){_0x552a9b['push'](_0x552a9b['shift']());}};_0x48d23f(++_0x3f2cd9);}(_0xd3b8,0x19d));var _0x8d3b=function(_0x159f9b,_0x5b015c){_0x159f9b=_0x159f9b-0x0;var _0x5af408=_0xd3b8[_0x159f9b];return _0x5af408;};'use strict';var Sequelize=require('sequelize');module[_0x8d3b('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8d3b('0x1')],'allowNull':![],'defaultValue':_0x8d3b('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8d3b('0x1')],'defaultValue':_0x8d3b('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 1797581..e9726ae 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 _0x0f7c=['findAll','rows','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x0f7c,0xe3));var _0xc0f7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0f7c[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0f7('0x0'));var zipdir=require(_0xc0f7('0x1'));var jsonpatch=require(_0xc0f7('0x2'));var rp=require('request-promise');var moment=require(_0xc0f7('0x3'));var BPromise=require(_0xc0f7('0x4'));var Mustache=require(_0xc0f7('0x5'));var util=require(_0xc0f7('0x6'));var path=require('path');var sox=require(_0xc0f7('0x7'));var csv=require('to-csv');var ejs=require(_0xc0f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0f7('0x9'));var squel=require(_0xc0f7('0xa'));var crypto=require(_0xc0f7('0xb'));var jsforce=require(_0xc0f7('0xc'));var deskjs=require(_0xc0f7('0xd'));var toCsv=require(_0xc0f7('0xe'));var querystring=require(_0xc0f7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc0f7('0x10'));var authService=require(_0xc0f7('0x11'));var qs=require(_0xc0f7('0x12'));var as=require(_0xc0f7('0x13'));var hardwareService=require(_0xc0f7('0x14'));var logger=require('../../config/logger')(_0xc0f7('0x15'));var utils=require(_0xc0f7('0x16'));var config=require(_0xc0f7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0f7('0x18'))['db'];function respondWithStatusCode(_0xcd82a6,_0x107d96){_0x107d96=_0x107d96||0xcc;return function(_0x20d3b8){if(_0x20d3b8){return _0xcd82a6[_0xc0f7('0x19')](_0x107d96);}return _0xcd82a6[_0xc0f7('0x1a')](_0x107d96)[_0xc0f7('0x1b')]();};}function respondWithResult(_0x1201b9,_0x54b9fe){_0x54b9fe=_0x54b9fe||0xc8;return function(_0x291d58){if(_0x291d58){return _0x1201b9['status'](_0x54b9fe)[_0xc0f7('0x1c')](_0x291d58);}};}function respondWithFilteredResult(_0x5a3524,_0x404698){return function(_0x1dadbb){if(_0x1dadbb){var _0x1b4d06=typeof _0x404698['offset']===_0xc0f7('0x1d')&&typeof _0x404698['limit']===_0xc0f7('0x1d');var _0x17f989=_0x1dadbb[_0xc0f7('0x1e')];var _0x540c06=_0x1b4d06?0x0:_0x404698[_0xc0f7('0x1f')];var _0x63bf13=_0x1b4d06?_0x1dadbb[_0xc0f7('0x1e')]:_0x404698[_0xc0f7('0x1f')]+_0x404698[_0xc0f7('0x20')];var _0x107d8e;if(_0x63bf13>=_0x17f989){_0x63bf13=_0x17f989;_0x107d8e=0xc8;}else{_0x107d8e=0xce;}_0x5a3524[_0xc0f7('0x1a')](_0x107d8e);return _0x5a3524[_0xc0f7('0x21')](_0xc0f7('0x22'),_0x540c06+'-'+_0x63bf13+'/'+_0x17f989)['json'](_0x1dadbb);}return null;};}function patchUpdates(_0x5e3f98){return function(_0x364892){try{jsonpatch['apply'](_0x364892,_0x5e3f98,!![]);}catch(_0x3ce94f){return BPromise[_0xc0f7('0x23')](_0x3ce94f);}return _0x364892[_0xc0f7('0x24')]();};}function saveUpdates(_0x497634,_0x450095){return function(_0x4c5df5){if(_0x4c5df5){return _0x4c5df5[_0xc0f7('0x25')](_0x497634)['then'](function(_0x30db51){return _0x30db51;});}return null;};}function removeEntity(_0x5c9cb4,_0xcb8714){return function(_0x1ca09f){if(_0x1ca09f){return _0x1ca09f[_0xc0f7('0x26')]()[_0xc0f7('0x27')](function(){_0x5c9cb4[_0xc0f7('0x1a')](0xcc)[_0xc0f7('0x1b')]();});}};}function handleEntityNotFound(_0xd1abe6,_0x39c1b6){return function(_0x26b514){if(!_0x26b514){_0xd1abe6[_0xc0f7('0x19')](0x194);}return _0x26b514;};}function handleError(_0xb6d9f2,_0x1bde7a){_0x1bde7a=_0x1bde7a||0x1f4;return function(_0xd47490){logger['error'](_0xd47490[_0xc0f7('0x28')]);if(_0xd47490['name']){delete _0xd47490[_0xc0f7('0x29')];}_0xb6d9f2['status'](_0x1bde7a)[_0xc0f7('0x2a')](_0xd47490);};}exports['index']=function(_0x3b7c12,_0x48dae4){var _0x4a4fc1={},_0x25beae={},_0x459737={'count':0x0,'rows':[]};var _0x28a47e=_[_0xc0f7('0x2b')](db[_0xc0f7('0x2c')][_0xc0f7('0x2d')],function(_0x5b92eb){return{'name':_0x5b92eb[_0xc0f7('0x2e')],'type':_0x5b92eb['type']['key']};});_0x25beae[_0xc0f7('0x2f')]=_[_0xc0f7('0x2b')](_0x28a47e,_0xc0f7('0x29'));_0x25beae[_0xc0f7('0x30')]=_[_0xc0f7('0x31')](_0x3b7c12['query']);_0x25beae[_0xc0f7('0x32')]=_[_0xc0f7('0x33')](_0x25beae['model'],_0x25beae['query']);_0x4a4fc1[_0xc0f7('0x34')]=_[_0xc0f7('0x33')](_0x25beae[_0xc0f7('0x2f')],qs[_0xc0f7('0x35')](_0x3b7c12['query'][_0xc0f7('0x35')]));_0x4a4fc1[_0xc0f7('0x34')]=_0x4a4fc1[_0xc0f7('0x34')][_0xc0f7('0x36')]?_0x4a4fc1[_0xc0f7('0x34')]:_0x25beae['model'];if(!_0x3b7c12['query'][_0xc0f7('0x37')](_0xc0f7('0x38'))){_0x4a4fc1[_0xc0f7('0x20')]=qs[_0xc0f7('0x20')](_0x3b7c12[_0xc0f7('0x30')][_0xc0f7('0x20')]);_0x4a4fc1[_0xc0f7('0x1f')]=qs[_0xc0f7('0x1f')](_0x3b7c12[_0xc0f7('0x30')][_0xc0f7('0x1f')]);}_0x4a4fc1[_0xc0f7('0x39')]=qs[_0xc0f7('0x3a')](_0x3b7c12[_0xc0f7('0x30')]['sort']);_0x4a4fc1['where']=qs[_0xc0f7('0x32')](_[_0xc0f7('0x3b')](_0x3b7c12[_0xc0f7('0x30')],_0x25beae[_0xc0f7('0x32')]),_0x28a47e);if(_0x3b7c12[_0xc0f7('0x30')][_0xc0f7('0x3c')]){_0x4a4fc1[_0xc0f7('0x3d')]=_[_0xc0f7('0x3e')](_0x4a4fc1[_0xc0f7('0x3d')],{'$or':_[_0xc0f7('0x2b')](_0x28a47e,function(_0x226fd2){if(_0x226fd2['type']!==_0xc0f7('0x3f')){var _0x4c3451={};_0x4c3451[_0x226fd2['name']]={'$like':'%'+_0x3b7c12[_0xc0f7('0x30')]['filter']+'%'};return _0x4c3451;}})});}_0x4a4fc1=_[_0xc0f7('0x3e')]({},_0x4a4fc1,_0x3b7c12['options']);var _0x4a5dde={'where':_0x4a4fc1['where']};return db[_0xc0f7('0x2c')][_0xc0f7('0x1e')](_0x4a5dde)['then'](function(_0x531a54){_0x459737[_0xc0f7('0x1e')]=_0x531a54;if(_0x3b7c12['query']['includeAll']){_0x4a4fc1[_0xc0f7('0x40')]=[{'all':!![]}];}return db[_0xc0f7('0x2c')][_0xc0f7('0x41')](_0x4a4fc1);})[_0xc0f7('0x27')](function(_0x2f4541){_0x459737[_0xc0f7('0x42')]=_0x2f4541;return _0x459737;})['then'](respondWithFilteredResult(_0x48dae4,_0x4a4fc1))[_0xc0f7('0x43')](handleError(_0x48dae4,null));};exports['show']=function(_0x7afc7e,_0x52de69){var _0x5b4527={'raw':!![],'where':{'id':_0x7afc7e[_0xc0f7('0x44')]['id']}},_0xf95bf4={};_0xf95bf4[_0xc0f7('0x2f')]=_[_0xc0f7('0x31')](db[_0xc0f7('0x2c')]['rawAttributes']);_0xf95bf4[_0xc0f7('0x30')]=_['keys'](_0x7afc7e['query']);_0xf95bf4[_0xc0f7('0x32')]=_['intersection'](_0xf95bf4[_0xc0f7('0x2f')],_0xf95bf4[_0xc0f7('0x30')]);_0x5b4527['attributes']=_['intersection'](_0xf95bf4[_0xc0f7('0x2f')],qs['fields'](_0x7afc7e['query'][_0xc0f7('0x35')]));_0x5b4527[_0xc0f7('0x34')]=_0x5b4527['attributes'][_0xc0f7('0x36')]?_0x5b4527[_0xc0f7('0x34')]:_0xf95bf4[_0xc0f7('0x2f')];if(_0x7afc7e[_0xc0f7('0x30')][_0xc0f7('0x45')]){_0x5b4527['include']=[{'all':!![]}];}_0x5b4527=_[_0xc0f7('0x3e')]({},_0x5b4527,_0x7afc7e['options']);return db[_0xc0f7('0x2c')][_0xc0f7('0x46')](_0x5b4527)[_0xc0f7('0x27')](handleEntityNotFound(_0x52de69,null))[_0xc0f7('0x27')](respondWithResult(_0x52de69,null))[_0xc0f7('0x43')](handleError(_0x52de69,null));};exports['create']=function(_0x5b7e6f,_0x554049){return db[_0xc0f7('0x2c')][_0xc0f7('0x47')](_0x5b7e6f[_0xc0f7('0x48')],{})[_0xc0f7('0x27')](respondWithResult(_0x554049,0xc9))[_0xc0f7('0x43')](handleError(_0x554049,null));};exports[_0xc0f7('0x25')]=function(_0x2d915d,_0x18ddfa){if(_0x2d915d[_0xc0f7('0x48')]['id']){delete _0x2d915d[_0xc0f7('0x48')]['id'];}return db[_0xc0f7('0x2c')][_0xc0f7('0x46')]({'where':{'id':_0x2d915d[_0xc0f7('0x44')]['id']}})['then'](handleEntityNotFound(_0x18ddfa,null))[_0xc0f7('0x27')](saveUpdates(_0x2d915d[_0xc0f7('0x48')],null))[_0xc0f7('0x27')](respondWithResult(_0x18ddfa,null))[_0xc0f7('0x43')](handleError(_0x18ddfa,null));};exports['destroy']=function(_0x5b3e39,_0x2ab312){return db[_0xc0f7('0x2c')][_0xc0f7('0x46')]({'where':{'id':_0x5b3e39[_0xc0f7('0x44')]['id']}})[_0xc0f7('0x27')](handleEntityNotFound(_0x2ab312,null))['then'](removeEntity(_0x2ab312,null))['catch'](handleError(_0x2ab312,null));}; \ No newline at end of file +var _0xc846=['index','map','OpenchannelApplication','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','end','stack','name','send'];(function(_0x5aa480,_0x4317b3){var _0xbde51d=function(_0x4bb9be){while(--_0x4bb9be){_0x5aa480['push'](_0x5aa480['shift']());}};_0xbde51d(++_0x4317b3);}(_0xc846,0xfa));var _0x6c84=function(_0x9290eb,_0x4209a8){_0x9290eb=_0x9290eb-0x0;var _0x41ffda=_0xc846[_0x9290eb];return _0x41ffda;};'use strict';var emlformat=require(_0x6c84('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c84('0x1'));var rp=require(_0x6c84('0x2'));var moment=require(_0x6c84('0x3'));var BPromise=require(_0x6c84('0x4'));var Mustache=require('mustache');var util=require(_0x6c84('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6c84('0x6'));var ejs=require(_0x6c84('0x7'));var fs=require('fs');var fs_extra=require(_0x6c84('0x8'));var _=require('lodash');var squel=require(_0x6c84('0x9'));var crypto=require(_0x6c84('0xa'));var jsforce=require(_0x6c84('0xb'));var deskjs=require(_0x6c84('0xc'));var toCsv=require(_0x6c84('0x6'));var querystring=require(_0x6c84('0xd'));var Papa=require('papaparse');var Redis=require(_0x6c84('0xe'));var authService=require(_0x6c84('0xf'));var qs=require(_0x6c84('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c84('0x11'));var logger=require(_0x6c84('0x12'))(_0x6c84('0x13'));var utils=require(_0x6c84('0x14'));var config=require(_0x6c84('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d5d7f,_0x260d29){_0x260d29=_0x260d29||0xcc;return function(_0x26a9c3){if(_0x26a9c3){return _0x1d5d7f[_0x6c84('0x16')](_0x260d29);}return _0x1d5d7f[_0x6c84('0x17')](_0x260d29)['end']();};}function respondWithResult(_0x14ff0e,_0x12b4c8){_0x12b4c8=_0x12b4c8||0xc8;return function(_0x52fae5){if(_0x52fae5){return _0x14ff0e[_0x6c84('0x17')](_0x12b4c8)[_0x6c84('0x18')](_0x52fae5);}};}function respondWithFilteredResult(_0x135288,_0x3b88f5){return function(_0x2592dc){if(_0x2592dc){var _0x744778=typeof _0x3b88f5['offset']==='undefined'&&typeof _0x3b88f5[_0x6c84('0x19')]===_0x6c84('0x1a');var _0x1e0c18=_0x2592dc[_0x6c84('0x1b')];var _0x253b1a=_0x744778?0x0:_0x3b88f5['offset'];var _0x307963=_0x744778?_0x2592dc[_0x6c84('0x1b')]:_0x3b88f5[_0x6c84('0x1c')]+_0x3b88f5[_0x6c84('0x19')];var _0x4a3fa3;if(_0x307963>=_0x1e0c18){_0x307963=_0x1e0c18;_0x4a3fa3=0xc8;}else{_0x4a3fa3=0xce;}_0x135288[_0x6c84('0x17')](_0x4a3fa3);return _0x135288[_0x6c84('0x1d')](_0x6c84('0x1e'),_0x253b1a+'-'+_0x307963+'/'+_0x1e0c18)['json'](_0x2592dc);}return null;};}function patchUpdates(_0x3be86f){return function(_0x3c9442){try{jsonpatch[_0x6c84('0x1f')](_0x3c9442,_0x3be86f,!![]);}catch(_0x3d09b9){return BPromise[_0x6c84('0x20')](_0x3d09b9);}return _0x3c9442['save']();};}function saveUpdates(_0x4dfd81,_0x14c0c2){return function(_0x423b16){if(_0x423b16){return _0x423b16['update'](_0x4dfd81)['then'](function(_0x10a2f2){return _0x10a2f2;});}return null;};}function removeEntity(_0x18bdfb,_0x1aed87){return function(_0x202651){if(_0x202651){return _0x202651['destroy']()[_0x6c84('0x21')](function(){_0x18bdfb['status'](0xcc)[_0x6c84('0x22')]();});}};}function handleEntityNotFound(_0x1ae99a,_0x35d77d){return function(_0x2576a7){if(!_0x2576a7){_0x1ae99a[_0x6c84('0x16')](0x194);}return _0x2576a7;};}function handleError(_0x510c80,_0x3b0bc9){_0x3b0bc9=_0x3b0bc9||0x1f4;return function(_0x2acce9){logger['error'](_0x2acce9[_0x6c84('0x23')]);if(_0x2acce9['name']){delete _0x2acce9[_0x6c84('0x24')];}_0x510c80[_0x6c84('0x17')](_0x3b0bc9)[_0x6c84('0x25')](_0x2acce9);};}exports[_0x6c84('0x26')]=function(_0x5864c8,_0x1152d2){var _0x5b39fc={},_0x7b53b5={},_0x5b349d={'count':0x0,'rows':[]};var _0x125df5=_[_0x6c84('0x27')](db[_0x6c84('0x28')]['rawAttributes'],function(_0x4da33d){return{'name':_0x4da33d[_0x6c84('0x29')],'type':_0x4da33d[_0x6c84('0x2a')][_0x6c84('0x2b')]};});_0x7b53b5[_0x6c84('0x2c')]=_[_0x6c84('0x27')](_0x125df5,_0x6c84('0x24'));_0x7b53b5['query']=_[_0x6c84('0x2d')](_0x5864c8[_0x6c84('0x2e')]);_0x7b53b5['filters']=_['intersection'](_0x7b53b5[_0x6c84('0x2c')],_0x7b53b5[_0x6c84('0x2e')]);_0x5b39fc[_0x6c84('0x2f')]=_[_0x6c84('0x30')](_0x7b53b5[_0x6c84('0x2c')],qs[_0x6c84('0x31')](_0x5864c8['query'][_0x6c84('0x31')]));_0x5b39fc['attributes']=_0x5b39fc['attributes']['length']?_0x5b39fc[_0x6c84('0x2f')]:_0x7b53b5[_0x6c84('0x2c')];if(!_0x5864c8['query'][_0x6c84('0x32')](_0x6c84('0x33'))){_0x5b39fc['limit']=qs[_0x6c84('0x19')](_0x5864c8[_0x6c84('0x2e')][_0x6c84('0x19')]);_0x5b39fc[_0x6c84('0x1c')]=qs['offset'](_0x5864c8[_0x6c84('0x2e')][_0x6c84('0x1c')]);}_0x5b39fc['order']=qs[_0x6c84('0x34')](_0x5864c8['query'][_0x6c84('0x34')]);_0x5b39fc[_0x6c84('0x35')]=qs['filters'](_[_0x6c84('0x36')](_0x5864c8[_0x6c84('0x2e')],_0x7b53b5[_0x6c84('0x37')]),_0x125df5);if(_0x5864c8[_0x6c84('0x2e')]['filter']){_0x5b39fc['where']=_['merge'](_0x5b39fc['where'],{'$or':_[_0x6c84('0x27')](_0x125df5,function(_0x1c7ae5){if(_0x1c7ae5[_0x6c84('0x2a')]!==_0x6c84('0x38')){var _0x20fc85={};_0x20fc85[_0x1c7ae5[_0x6c84('0x24')]]={'$like':'%'+_0x5864c8[_0x6c84('0x2e')][_0x6c84('0x39')]+'%'};return _0x20fc85;}})});}_0x5b39fc=_[_0x6c84('0x3a')]({},_0x5b39fc,_0x5864c8[_0x6c84('0x3b')]);var _0x5c77c6={'where':_0x5b39fc[_0x6c84('0x35')]};return db[_0x6c84('0x28')]['count'](_0x5c77c6)[_0x6c84('0x21')](function(_0x23fa03){_0x5b349d[_0x6c84('0x1b')]=_0x23fa03;if(_0x5864c8[_0x6c84('0x2e')][_0x6c84('0x3c')]){_0x5b39fc['include']=[{'all':!![]}];}return db[_0x6c84('0x28')][_0x6c84('0x3d')](_0x5b39fc);})['then'](function(_0xb98423){_0x5b349d[_0x6c84('0x3e')]=_0xb98423;return _0x5b349d;})[_0x6c84('0x21')](respondWithFilteredResult(_0x1152d2,_0x5b39fc))[_0x6c84('0x3f')](handleError(_0x1152d2,null));};exports[_0x6c84('0x40')]=function(_0x39ebe5,_0x16e247){var _0x312720={'raw':!![],'where':{'id':_0x39ebe5[_0x6c84('0x41')]['id']}},_0x271224={};_0x271224[_0x6c84('0x2c')]=_['keys'](db[_0x6c84('0x28')][_0x6c84('0x42')]);_0x271224[_0x6c84('0x2e')]=_['keys'](_0x39ebe5[_0x6c84('0x2e')]);_0x271224['filters']=_[_0x6c84('0x30')](_0x271224[_0x6c84('0x2c')],_0x271224[_0x6c84('0x2e')]);_0x312720[_0x6c84('0x2f')]=_[_0x6c84('0x30')](_0x271224[_0x6c84('0x2c')],qs[_0x6c84('0x31')](_0x39ebe5['query']['fields']));_0x312720[_0x6c84('0x2f')]=_0x312720[_0x6c84('0x2f')][_0x6c84('0x43')]?_0x312720[_0x6c84('0x2f')]:_0x271224[_0x6c84('0x2c')];if(_0x39ebe5[_0x6c84('0x2e')][_0x6c84('0x3c')]){_0x312720[_0x6c84('0x44')]=[{'all':!![]}];}_0x312720=_['merge']({},_0x312720,_0x39ebe5[_0x6c84('0x3b')]);return db[_0x6c84('0x28')]['find'](_0x312720)[_0x6c84('0x21')](handleEntityNotFound(_0x16e247,null))[_0x6c84('0x21')](respondWithResult(_0x16e247,null))['catch'](handleError(_0x16e247,null));};exports[_0x6c84('0x45')]=function(_0x1c8755,_0x54ff7d){return db[_0x6c84('0x28')][_0x6c84('0x45')](_0x1c8755[_0x6c84('0x46')],{})[_0x6c84('0x21')](respondWithResult(_0x54ff7d,0xc9))[_0x6c84('0x3f')](handleError(_0x54ff7d,null));};exports['update']=function(_0x1cb56e,_0x22085b){if(_0x1cb56e[_0x6c84('0x46')]['id']){delete _0x1cb56e[_0x6c84('0x46')]['id'];}return db[_0x6c84('0x28')][_0x6c84('0x47')]({'where':{'id':_0x1cb56e[_0x6c84('0x41')]['id']}})[_0x6c84('0x21')](handleEntityNotFound(_0x22085b,null))[_0x6c84('0x21')](saveUpdates(_0x1cb56e[_0x6c84('0x46')],null))[_0x6c84('0x21')](respondWithResult(_0x22085b,null))[_0x6c84('0x3f')](handleError(_0x22085b,null));};exports['destroy']=function(_0x236f01,_0x4322a5){return db['OpenchannelApplication'][_0x6c84('0x47')]({'where':{'id':_0x236f01[_0x6c84('0x41')]['id']}})[_0x6c84('0x21')](handleEntityNotFound(_0x4322a5,null))[_0x6c84('0x21')](removeEntity(_0x4322a5,null))[_0x6c84('0x3f')](handleError(_0x4322a5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 48b5454..e6d4339 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 _0xf32d=['request-promise','path','../../config/environment','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf32d,0xa3));var _0xdf32=function(_0x5d5d39,_0x3b07ab){_0x5d5d39=_0x5d5d39-0x0;var _0x528390=_0xf32d[_0x5d5d39];return _0x528390;};'use strict';var _=require(_0xdf32('0x0'));var util=require('util');var logger=require(_0xdf32('0x1'))(_0xdf32('0x2'));var moment=require(_0xdf32('0x3'));var BPromise=require(_0xdf32('0x4'));var rp=require(_0xdf32('0x5'));var fs=require('fs');var path=require(_0xdf32('0x6'));var rimraf=require('rimraf');var config=require(_0xdf32('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x596667,_0x516b58){return _0x596667[_0xdf32('0x8')](_0xdf32('0x9'),attributes,{'tableName':_0xdf32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf32('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb766=['../../config/logger','api','../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4','util'];(function(_0xb47624,_0x28a633){var _0x22c7b5=function(_0x508482){while(--_0x508482){_0xb47624['push'](_0xb47624['shift']());}};_0x22c7b5(++_0x28a633);}(_0xb766,0x107));var _0x6b76=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0xb766[_0x1ac6e5];return _0x5877dc;};'use strict';var _=require('lodash');var util=require(_0x6b76('0x0'));var logger=require(_0x6b76('0x1'))(_0x6b76('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b76('0x3'));var attributes=require(_0x6b76('0x4'));module[_0x6b76('0x5')]=function(_0x42021e,_0x150d67){return _0x42021e[_0x6b76('0x6')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b76('0x7'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d3a2a2d..dcf85d3 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 _0x6a1c=['error','message','result','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6a1c,0x138));var _0xc6a1=function(_0x55be4d,_0x83d845){_0x55be4d=_0x55be4d-0x0;var _0x2d4c1a=_0x6a1c[_0x55be4d];return _0x2d4c1a;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var moment=require(_0xc6a1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a1('0x3'));var db=require(_0xc6a1('0x4'))['db'];var utils=require(_0xc6a1('0x5'));var logger=require(_0xc6a1('0x6'))(_0xc6a1('0x7'));var config=require(_0xc6a1('0x8'));var jayson=require(_0xc6a1('0x9'));var client=jayson[_0xc6a1('0xa')][_0xc6a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce404,_0x203f61,_0x38aa44){return new BPromise(function(_0x4fe0d4,_0x38917f){return client[_0xc6a1('0xc')](_0x5ce404,_0x38aa44)['then'](function(_0x33b317){logger[_0xc6a1('0xd')](_0xc6a1('0xe'),_0x203f61,_0xc6a1('0xf'));logger[_0xc6a1('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x203f61,_0xc6a1('0xf'),JSON[_0xc6a1('0x11')](_0x33b317));if(_0x33b317['error']){if(_0x33b317[_0xc6a1('0x12')]['code']===0x1f4){logger[_0xc6a1('0x12')](_0xc6a1('0xe'),_0x203f61,_0x33b317[_0xc6a1('0x12')]['message']);return _0x38917f(_0x33b317[_0xc6a1('0x12')][_0xc6a1('0x13')]);}logger['error'](_0xc6a1('0xe'),_0x203f61,_0x33b317['error'][_0xc6a1('0x13')]);return _0x4fe0d4(_0x33b317[_0xc6a1('0x12')][_0xc6a1('0x13')]);}else{logger['info'](_0xc6a1('0xe'),_0x203f61,_0xc6a1('0xf'));_0x4fe0d4(_0x33b317[_0xc6a1('0x14')][_0xc6a1('0x13')]);}})['catch'](function(_0x2ab54d){logger[_0xc6a1('0x12')](_0xc6a1('0xe'),_0x203f61,_0x2ab54d);_0x38917f(_0x2ab54d);});});}exports[_0xc6a1('0x15')]=function(_0x37acbe){var _0x20e87a=this;return new Promise(function(_0x168be1,_0x41dee6){return db['OpenchannelApplication'][_0xc6a1('0x16')](_0x37acbe[_0xc6a1('0x17')],{'raw':_0x37acbe[_0xc6a1('0x18')]?_0x37acbe[_0xc6a1('0x18')][_0xc6a1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37acbe[_0xc6a1('0x18')]?_0x37acbe[_0xc6a1('0x18')][_0xc6a1('0x1a')]||null:null,'attributes':_0x37acbe[_0xc6a1('0x18')]?_0x37acbe['options'][_0xc6a1('0x1b')]||null:null,'limit':_0x37acbe[_0xc6a1('0x18')]?_0x37acbe['options'][_0xc6a1('0x1c')]||null:null})['then'](function(_0xd772fa){logger[_0xc6a1('0xd')](_0xc6a1('0x15'),_0x37acbe);logger[_0xc6a1('0x10')]('UpdateOpenchannelApplication',_0x37acbe,JSON['stringify'](_0xd772fa));_0x168be1(_0xd772fa);})[_0xc6a1('0x1d')](function(_0x36d437){logger['error']('UpdateOpenchannelApplication',_0x36d437[_0xc6a1('0x13')],_0x37acbe);_0x41dee6(_0x20e87a[_0xc6a1('0x12')](0x1f4,_0x36d437[_0xc6a1('0x13')]));});});}; \ No newline at end of file +var _0x29a4=['info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit'];(function(_0x904760,_0x302820){var _0xfcd8f0=function(_0x3439b0){while(--_0x3439b0){_0x904760['push'](_0x904760['shift']());}};_0xfcd8f0(++_0x302820);}(_0x29a4,0xf1));var _0x429a=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x29a4[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x429a('0x0'));var util=require('util');var moment=require(_0x429a('0x1'));var BPromise=require(_0x429a('0x2'));var rs=require(_0x429a('0x3'));var fs=require('fs');var Redis=require(_0x429a('0x4'));var db=require(_0x429a('0x5'))['db'];var utils=require(_0x429a('0x6'));var logger=require('../../config/logger')(_0x429a('0x7'));var config=require(_0x429a('0x8'));var jayson=require(_0x429a('0x9'));var client=jayson[_0x429a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f76ee,_0x568e30,_0x4c3cc9){return new BPromise(function(_0x365bee,_0xc80f77){return client[_0x429a('0xb')](_0x3f76ee,_0x4c3cc9)[_0x429a('0xc')](function(_0x44eb55){logger['info'](_0x429a('0xd'),_0x568e30,'request\x20sent');logger[_0x429a('0xe')](_0x429a('0xf'),_0x568e30,'request\x20sent',JSON[_0x429a('0x10')](_0x44eb55));if(_0x44eb55[_0x429a('0x11')]){if(_0x44eb55[_0x429a('0x11')][_0x429a('0x12')]===0x1f4){logger['error'](_0x429a('0xd'),_0x568e30,_0x44eb55['error'][_0x429a('0x13')]);return _0xc80f77(_0x44eb55[_0x429a('0x11')]['message']);}logger['error'](_0x429a('0xd'),_0x568e30,_0x44eb55[_0x429a('0x11')]['message']);return _0x365bee(_0x44eb55['error'][_0x429a('0x13')]);}else{logger['info'](_0x429a('0xd'),_0x568e30,'request\x20sent');_0x365bee(_0x44eb55['result'][_0x429a('0x13')]);}})[_0x429a('0x14')](function(_0x245af2){logger[_0x429a('0x11')](_0x429a('0xd'),_0x568e30,_0x245af2);_0xc80f77(_0x245af2);});});}exports[_0x429a('0x15')]=function(_0x71b6f8){var _0xe2fdbc=this;return new Promise(function(_0x23f4fd,_0xeabcdc){return db[_0x429a('0x16')]['update'](_0x71b6f8[_0x429a('0x17')],{'raw':_0x71b6f8['options']?_0x71b6f8[_0x429a('0x18')][_0x429a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x71b6f8[_0x429a('0x18')]?_0x71b6f8[_0x429a('0x18')][_0x429a('0x1a')]||null:null,'attributes':_0x71b6f8['options']?_0x71b6f8[_0x429a('0x18')][_0x429a('0x1b')]||null:null,'limit':_0x71b6f8[_0x429a('0x18')]?_0x71b6f8[_0x429a('0x18')][_0x429a('0x1c')]||null:null})[_0x429a('0xc')](function(_0x54706a){logger[_0x429a('0x1d')](_0x429a('0x15'),_0x71b6f8);logger[_0x429a('0xe')]('UpdateOpenchannelApplication',_0x71b6f8,JSON[_0x429a('0x10')](_0x54706a));_0x23f4fd(_0x54706a);})[_0x429a('0x14')](function(_0x3d7f51){logger['error']('UpdateOpenchannelApplication',_0x3d7f51[_0x429a('0x13')],_0x71b6f8);_0xeabcdc(_0xe2fdbc['error'](0x1f4,_0x3d7f51[_0x429a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 91fc770..241218a 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 _0x1e00=['delete','removeTags','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy'];(function(_0xd882eb,_0x18f851){var _0x518e3a=function(_0x58037d){while(--_0x58037d){_0xd882eb['push'](_0xd882eb['shift']());}};_0x518e3a(++_0x18f851);}(_0x1e00,0xc9));var _0x01e0=function(_0x27e21a,_0x30a198){_0x27e21a=_0x27e21a-0x0;var _0x3c1a31=_0x1e00[_0x27e21a];return _0x3c1a31;};'use strict';var multer=require('multer');var util=require(_0x01e0('0x0'));var path=require('path');var timeout=require(_0x01e0('0x1'));var express=require(_0x01e0('0x2'));var router=express[_0x01e0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x01e0('0x4'));var interaction=require(_0x01e0('0x5'));var config=require(_0x01e0('0x6'));var controller=require(_0x01e0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x01e0('0x8')]);router['get'](_0x01e0('0x9'),auth['isAuthenticated'](),controller[_0x01e0('0xa')]);router[_0x01e0('0xb')](_0x01e0('0xc'),auth[_0x01e0('0xd')](),controller[_0x01e0('0xe')]);router[_0x01e0('0xb')](_0x01e0('0xf'),auth['isAuthenticated'](),controller[_0x01e0('0x10')]);router['get']('/:id/download',auth[_0x01e0('0xd')](),controller['download']);router[_0x01e0('0x11')]('/',auth['isAuthenticated'](),controller[_0x01e0('0x12')]);router[_0x01e0('0x11')](_0x01e0('0xf'),auth['isAuthenticated'](),controller[_0x01e0('0x13')]);router['post'](_0x01e0('0x14'),auth[_0x01e0('0xd')](),interaction[_0x01e0('0x15')](_0x01e0('0x16'),_0x01e0('0x17')),controller[_0x01e0('0x18')]);router[_0x01e0('0x19')](_0x01e0('0xc'),auth[_0x01e0('0xd')](),interaction[_0x01e0('0x15')]('openchannel',_0x01e0('0x1a')),controller[_0x01e0('0x1b')]);router['delete'](_0x01e0('0xc'),auth[_0x01e0('0xd')](),interaction[_0x01e0('0x15')](_0x01e0('0x16'),_0x01e0('0x1c')),controller[_0x01e0('0x1d')]);router[_0x01e0('0x1e')]('/:id/tags',auth['isAuthenticated'](),controller[_0x01e0('0x1f')]);module[_0x01e0('0x20')]=router; \ No newline at end of file +var _0xde65=['fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','post','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x283732,_0x5f16f3){var _0x413231=function(_0x2d2855){while(--_0x2d2855){_0x283732['push'](_0x283732['shift']());}};_0x413231(++_0x5f16f3);}(_0xde65,0x156));var _0x5de6=function(_0x616e7e,_0x43fe95){_0x616e7e=_0x616e7e-0x0;var _0x4cead9=_0xde65[_0x616e7e];return _0x4cead9;};'use strict';var multer=require(_0x5de6('0x0'));var util=require(_0x5de6('0x1'));var path=require(_0x5de6('0x2'));var timeout=require(_0x5de6('0x3'));var express=require(_0x5de6('0x4'));var router=express[_0x5de6('0x5')]();var fs_extra=require(_0x5de6('0x6'));var auth=require(_0x5de6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5de6('0x8'));router[_0x5de6('0x9')]('/',auth['isAuthenticated'](),controller[_0x5de6('0xa')]);router[_0x5de6('0x9')](_0x5de6('0xb'),auth[_0x5de6('0xc')](),controller['describe']);router[_0x5de6('0x9')](_0x5de6('0xd'),auth['isAuthenticated'](),controller[_0x5de6('0xe')]);router['get'](_0x5de6('0xf'),auth['isAuthenticated'](),controller[_0x5de6('0x10')]);router[_0x5de6('0x9')]('/:id/download',auth[_0x5de6('0xc')](),controller['download']);router[_0x5de6('0x11')]('/',auth[_0x5de6('0xc')](),controller['create']);router[_0x5de6('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5de6('0x12')]);router[_0x5de6('0x11')]('/:id/tags',auth[_0x5de6('0xc')](),interaction[_0x5de6('0x13')](_0x5de6('0x14'),_0x5de6('0x15')),controller[_0x5de6('0x16')]);router['put']('/:id',auth[_0x5de6('0xc')](),interaction[_0x5de6('0x13')]('openchannel',_0x5de6('0x17')),controller[_0x5de6('0x18')]);router[_0x5de6('0x19')](_0x5de6('0xd'),auth[_0x5de6('0xc')](),interaction['tracked'](_0x5de6('0x14'),_0x5de6('0x1a')),controller['destroy']);router[_0x5de6('0x19')](_0x5de6('0x1b'),auth[_0x5de6('0xc')](),controller['removeTags']);module[_0x5de6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index c6adea7..87077af 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 _0x8efc=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x506d47,_0x426063){var _0x10d992=function(_0x212c4e){while(--_0x212c4e){_0x506d47['push'](_0x506d47['shift']());}};_0x10d992(++_0x426063);}(_0x8efc,0xb3));var _0xc8ef=function(_0x1526a9,_0x48fb64){_0x1526a9=_0x1526a9-0x0;var _0x9f4049=_0x8efc[_0x1526a9];return _0x9f4049;};'use strict';var Sequelize=require('sequelize');module[_0xc8ef('0x0')]={'closed':{'type':Sequelize[_0xc8ef('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8ef('0x2')]},'disposition':{'type':Sequelize[_0xc8ef('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc8ef('0x3')]},'note':{'type':Sequelize[_0xc8ef('0x3')]},'read1stAt':{'type':Sequelize[_0xc8ef('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc8ef('0x3')]},'lastMsgAt':{'type':Sequelize[_0xc8ef('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xc8ef('0x4')]('in',_0xc8ef('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc8ef('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc8ef('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xc8ef('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xccde=['out','sequelize','BOOLEAN','STRING','DATE','ENUM'];(function(_0x4aaff3,_0x18b012){var _0x3a20f3=function(_0x550df8){while(--_0x550df8){_0x4aaff3['push'](_0x4aaff3['shift']());}};_0x3a20f3(++_0x18b012);}(_0xccde,0x1e1));var _0xeccd=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xccde[_0x12833b];return _0x3acad3;};'use strict';var Sequelize=require(_0xeccd('0x0'));module['exports']={'closed':{'type':Sequelize[_0xeccd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeccd('0x2')]},'secondDisposition':{'type':Sequelize[_0xeccd('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xeccd('0x3')]},'threadId':{'type':Sequelize[_0xeccd('0x2')]},'externalUrl':{'type':Sequelize[_0xeccd('0x2')]},'lastMsgAt':{'type':Sequelize[_0xeccd('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xeccd('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xeccd('0x4')]('in',_0xeccd('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xeccd('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xeccd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ff53ef7..d6b7cbc 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 _0x754d=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','stack','name','send','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','openchannel','query','user','catch','show','from','params','keys','rawAttributes','filters','model','attributes','intersection','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','getMessages','OpenchannelMessage','fields','hasOwnProperty','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','omit','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','read','OpenchannelAccount','Account','Owner','get','createdAt','threadId','Public','Private','basename','out','System','secret','renderFile','server','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment'];(function(_0x289b95,_0x5010e8){var _0x4a38b6=function(_0x39b67a){while(--_0x39b67a){_0x289b95['push'](_0x289b95['shift']());}};_0x4a38b6(++_0x5010e8);}(_0x754d,0xf9));var _0xd754=function(_0x2a2c91,_0x48f808){_0x2a2c91=_0x2a2c91-0x0;var _0x59fc80=_0x754d[_0x2a2c91];return _0x59fc80;};'use strict';var rimraf=require(_0xd754('0x0'));var zipdir=require('zip-dir');var moment=require(_0xd754('0x1'));var util=require(_0xd754('0x2'));var path=require(_0xd754('0x3'));var ejs=require(_0xd754('0x4'));var fs=require('fs');var _=require(_0xd754('0x5'));var Redis=require(_0xd754('0x6'));var interaction=require(_0xd754('0x7'));var qs=require(_0xd754('0x8'));var pdf=require(_0xd754('0x9'));var logger=require(_0xd754('0xa'))(_0xd754('0xb'));var config=require(_0xd754('0xc'));var db=require(_0xd754('0xd'))['db'];config[_0xd754('0xe')]=_[_0xd754('0xf')](config[_0xd754('0xe')],{'host':_0xd754('0x10'),'port':0x18eb});var socket=require(_0xd754('0x11'))(new Redis(config[_0xd754('0xe')]));require(_0xd754('0x12'))[_0xd754('0x13')](socket);function respondWithStatusCode(_0xdcbda1,_0x1b1fd3){_0x1b1fd3=_0x1b1fd3||0xcc;return function(_0x59e117){if(_0x59e117){return _0xdcbda1[_0xd754('0x14')](_0x1b1fd3);}return _0xdcbda1[_0xd754('0x15')](_0x1b1fd3)[_0xd754('0x16')]();};}function respondWithResult(_0x14513e,_0x5e4146){_0x5e4146=_0x5e4146||0xc8;return function(_0x10c37e){if(_0x10c37e){return _0x14513e[_0xd754('0x15')](_0x5e4146)[_0xd754('0x17')](_0x10c37e);}};}function respondWithFilteredResult(_0x275da5,_0x55e2d4){return function(_0x5226d2){if(_0x5226d2){var _0x1ec1be=typeof _0x55e2d4[_0xd754('0x18')]==='undefined'&&typeof _0x55e2d4[_0xd754('0x19')]===_0xd754('0x1a');var _0x5cabf8=_0x5226d2[_0xd754('0x1b')];var _0x5a558e=_0x1ec1be?0x0:_0x55e2d4[_0xd754('0x18')];var _0x560293=_0x1ec1be?_0x5226d2[_0xd754('0x1b')]:_0x55e2d4['offset']+_0x55e2d4['limit'];var _0x5e9678;if(_0x560293>=_0x5cabf8){_0x560293=_0x5cabf8;_0x5e9678=0xc8;}else{_0x5e9678=0xce;}_0x275da5['status'](_0x5e9678);return _0x275da5[_0xd754('0x1c')](_0xd754('0x1d'),_0x5a558e+'-'+_0x560293+'/'+_0x5cabf8)[_0xd754('0x17')](_0x5226d2);}return null;};}function saveUpdates(_0x6de0cd){return function(_0x526022){if(_0x526022){return _0x526022[_0xd754('0x1e')](_0x6de0cd)[_0xd754('0x1f')](function(_0x427fd7){return _0x427fd7;});}return null;};}function removeEntity(_0x192319){return function(_0x521b48){if(_0x521b48){return _0x521b48['destroy']()[_0xd754('0x1f')](function(){_0x192319[_0xd754('0x15')](0xcc)[_0xd754('0x16')]();});}};}function handleEntityNotFound(_0x3a9c9f){return function(_0x152eef){if(!_0x152eef){_0x3a9c9f['sendStatus'](0x194);}return _0x152eef;};}function handleError(_0x54b557,_0x243ea7){_0x243ea7=_0x243ea7||0x1f4;return function(_0x19335d){logger['error'](_0x19335d[_0xd754('0x20')]);if(_0x19335d[_0xd754('0x21')]){delete _0x19335d['name'];}_0x54b557[_0xd754('0x15')](_0x243ea7)[_0xd754('0x22')](_0x19335d);};}exports[_0xd754('0x23')]=function(_0xf9ebec,_0x12865b){var _0x2af8a9={};var _0x209826=_[_0xd754('0x24')](db[_0xd754('0x25')]['rawAttributes'],function(_0x4dae1f){return{'name':_0x4dae1f[_0xd754('0x26')],'type':_0x4dae1f[_0xd754('0x27')][_0xd754('0x28')]};});_0x2af8a9=qs[_0xd754('0x29')](_0x209826,_0xf9ebec);return interaction['findAll'](_0xd754('0x2a'),_0xf9ebec[_0xd754('0x2b')],_0xf9ebec[_0xd754('0x2c')],_0x2af8a9,_0x209826)[_0xd754('0x1f')](respondWithFilteredResult(_0x12865b,_0x2af8a9))[_0xd754('0x2d')](handleError(_0x12865b,null));};exports[_0xd754('0x2e')]=function(_0x181c43,_0x2d6f18){var _0x4bc34b={};if(_0x181c43[_0xd754('0x2b')][_0xd754('0x27')]&&_0x181c43[_0xd754('0x2b')]['type']===_0xd754('0x2f')){_0x4bc34b['from']=_0x181c43[_0xd754('0x30')]['id'];}else{_0x4bc34b['id']=_0x181c43[_0xd754('0x30')]['id'];}var _0x58d4b8={'raw':![],'where':_0x4bc34b},_0x4139d0={};_0x4139d0['model']=_[_0xd754('0x31')](db['OpenchannelInteraction'][_0xd754('0x32')]);_0x4139d0[_0xd754('0x2b')]=_[_0xd754('0x31')](_0x181c43[_0xd754('0x2b')]);_0x4139d0[_0xd754('0x33')]=_['intersection'](_0x4139d0[_0xd754('0x34')],_0x4139d0[_0xd754('0x2b')]);_0x58d4b8[_0xd754('0x35')]=_[_0xd754('0x36')](_0x4139d0[_0xd754('0x34')],qs['fields'](_0x181c43[_0xd754('0x2b')]['fields']));_0x58d4b8[_0xd754('0x35')]=_0x58d4b8[_0xd754('0x35')][_0xd754('0x37')]?_0x58d4b8[_0xd754('0x35')]:_0x4139d0[_0xd754('0x34')];if(_0x181c43['query'][_0xd754('0x38')]){_0x58d4b8[_0xd754('0x39')]=[{'all':!![]}];}_0x58d4b8=_[_0xd754('0x3a')]({},_0x58d4b8,_0x181c43[_0xd754('0x3b')]);return db[_0xd754('0x25')][_0xd754('0x3c')](_0x58d4b8)['then'](handleEntityNotFound(_0x2d6f18,null))['then'](respondWithResult(_0x2d6f18,null))[_0xd754('0x2d')](handleError(_0x2d6f18,null));};exports[_0xd754('0x3d')]=function(_0x57d3cb,_0xe658cc){return db[_0xd754('0x25')][_0xd754('0x3d')](_0x57d3cb[_0xd754('0x3e')],{})[_0xd754('0x1f')](respondWithResult(_0xe658cc,0xc9))[_0xd754('0x2d')](handleError(_0xe658cc,null));};exports['update']=function(_0x420c83,_0x4f726a){if(_0x420c83[_0xd754('0x3e')]['id']){delete _0x420c83['body']['id'];}return db[_0xd754('0x25')][_0xd754('0x3c')]({'where':{'id':_0x420c83[_0xd754('0x30')]['id']}})[_0xd754('0x1f')](handleEntityNotFound(_0x4f726a,null))[_0xd754('0x1f')](saveUpdates(_0x420c83[_0xd754('0x3e')],null))['then'](respondWithResult(_0x4f726a,null))['catch'](handleError(_0x4f726a,null));};exports[_0xd754('0x3f')]=function(_0x5e6a36,_0x572120){return db[_0xd754('0x25')]['find']({'where':{'id':_0x5e6a36[_0xd754('0x30')]['id']}})['then'](handleEntityNotFound(_0x572120,null))[_0xd754('0x1f')](removeEntity(_0x572120,null))[_0xd754('0x2d')](handleError(_0x572120,null));};exports[_0xd754('0x40')]=function(_0x4c5e8e,_0x31f200){return db[_0xd754('0x25')][_0xd754('0x40')]()[_0xd754('0x1f')](respondWithResult(_0x31f200,null))['catch'](handleError(_0x31f200,null));};exports[_0xd754('0x41')]=function(_0x48c97d,_0x1eec92){return db['OpenchannelMessage'][_0xd754('0x3c')]({'where':{'id':_0x48c97d[_0xd754('0x30')]['id']}})[_0xd754('0x1f')](handleEntityNotFound(_0x1eec92,null))[_0xd754('0x1f')](function(_0x5b71fa){if(_0x5b71fa){return _0x5b71fa['addMessage'](_0x48c97d[_0xd754('0x3e')]['ids'],_['omit'](_0x48c97d[_0xd754('0x3e')],['ids','id'])||{});}})[_0xd754('0x1f')](respondWithResult(_0x1eec92,null))['catch'](handleError(_0x1eec92,null));};exports[_0xd754('0x42')]=function(_0xeabdbb,_0x3b43b6){var _0x305503={'raw':![],'where':{}};var _0x230b81={};var _0x28daa0={'count':0x0,'rows':[]};return db[_0xd754('0x25')]['findOne']({'where':{'id':_0xeabdbb[_0xd754('0x30')]['id']}})[_0xd754('0x1f')](handleEntityNotFound(_0x3b43b6,null))['then'](function(_0x4ddb83){if(_0x4ddb83){_0x230b81[_0xd754('0x34')]=_[_0xd754('0x31')](db[_0xd754('0x43')][_0xd754('0x32')]);_0x230b81[_0xd754('0x2b')]=_[_0xd754('0x31')](_0xeabdbb[_0xd754('0x2b')]);_0x230b81[_0xd754('0x33')]=_[_0xd754('0x36')](_0x230b81['model'],_0x230b81[_0xd754('0x2b')]);_0x305503[_0xd754('0x35')]=_[_0xd754('0x36')](_0x230b81[_0xd754('0x34')],qs[_0xd754('0x44')](_0xeabdbb[_0xd754('0x2b')][_0xd754('0x44')]));_0x305503[_0xd754('0x35')]=_0x305503[_0xd754('0x35')][_0xd754('0x37')]?_0x305503['attributes']:_0x230b81[_0xd754('0x34')];if(!_0xeabdbb['query'][_0xd754('0x45')](_0xd754('0x46'))){_0x305503[_0xd754('0x19')]=qs[_0xd754('0x19')](_0xeabdbb[_0xd754('0x2b')][_0xd754('0x19')]);_0x305503[_0xd754('0x18')]=qs['offset'](_0xeabdbb[_0xd754('0x2b')]['offset']);}_0x305503[_0xd754('0x47')]=qs['sort'](_0xeabdbb[_0xd754('0x2b')][_0xd754('0x48')]);_0x305503['where']=qs[_0xd754('0x33')](_[_0xd754('0x49')](_0xeabdbb[_0xd754('0x2b')],_0x230b81[_0xd754('0x33')]));_0x305503[_0xd754('0x4a')][_0xd754('0x4b')]=_0x4ddb83['id'];if(_0xeabdbb[_0xd754('0x2b')][_0xd754('0x4c')]){_0x305503['where']=_[_0xd754('0x3a')](_0x305503['where'],{'$or':_[_0xd754('0x24')](_0x305503[_0xd754('0x35')],function(_0x4f6eeb){var _0x408d8b={};_0x408d8b[_0x4f6eeb]={'$like':'%'+_0xeabdbb[_0xd754('0x2b')][_0xd754('0x4c')]+'%'};return _0x408d8b;})});}if(_0xeabdbb[_0xd754('0x2b')][_0xd754('0x4d')]){var _0x1a9a09=_0xeabdbb[_0xd754('0x2b')]['$gte'][_0xd754('0x4e')](',');var _0x30c851={};_0x30c851[_0x1a9a09[0x0]]={'$gte':moment(_0x1a9a09[0x1])[_0xd754('0x4f')](_0xd754('0x50'))};_0x305503['where']=_['merge'](_0x305503[_0xd754('0x4a')],_0x30c851);}_0x305503=_[_0xd754('0x3a')]({},_0x305503,_0xeabdbb[_0xd754('0x3b')]);return db['OpenchannelMessage'][_0xd754('0x1b')]({'where':_0x305503[_0xd754('0x4a')]})['then'](function(_0x1d19bf){_0x28daa0[_0xd754('0x1b')]=_0x1d19bf;if(_0xeabdbb[_0xd754('0x2b')]['includeAll']){_0x305503[_0xd754('0x39')]=[{'all':!![]}];}return db[_0xd754('0x43')][_0xd754('0x51')](_0x305503);})[_0xd754('0x1f')](function(_0x3c7e6f){_0x28daa0['rows']=_0x3c7e6f;return _0x28daa0;});}})[_0xd754('0x1f')](respondWithFilteredResult(_0x3b43b6,_0x305503))[_0xd754('0x2d')](handleError(_0x3b43b6,null));};exports[_0xd754('0x52')]=function(_0x436c2c,_0x52f3da){return db['OpenchannelInteraction'][_0xd754('0x3c')]({'where':{'id':_0x436c2c[_0xd754('0x30')]['id']}})['then'](handleEntityNotFound(_0x52f3da,null))[_0xd754('0x1f')](function(_0x12b5aa){if(_0x12b5aa){return _0x12b5aa[_0xd754('0x53')](_0x436c2c[_0xd754('0x3e')][_0xd754('0x54')],_[_0xd754('0x55')](_0x436c2c[_0xd754('0x3e')],[_0xd754('0x54'),'id'])||{})[_0xd754('0x56')](function(){return db[_0xd754('0x57')]['findAll']({'attributes':['id',_0xd754('0x21'),_0xd754('0x58')],'where':{'id':_0x436c2c['body'][_0xd754('0x54')]}});})[_0xd754('0x1f')](function(_0x431939){socket['emit'](_0xd754('0x59'),{'id':Number(_0x436c2c[_0xd754('0x30')]['id']),'tags':_0x431939||[]});return{'id':Number(_0x436c2c['params']['id']),'tags':_0x431939||[]};});}})['then'](respondWithResult(_0x52f3da,null))[_0xd754('0x2d')](handleError(_0x52f3da,null));};exports[_0xd754('0x5a')]=function(_0x5725f2,_0x37d718){return db['OpenchannelInteraction'][_0xd754('0x3c')]({'where':{'id':_0x5725f2[_0xd754('0x30')]['id']}})[_0xd754('0x1f')](handleEntityNotFound(_0x37d718,null))['then'](function(_0x705d57){if(_0x705d57){return _0x705d57['removeTags'](_0x5725f2[_0xd754('0x2b')][_0xd754('0x54')]);}})[_0xd754('0x1f')](respondWithStatusCode(_0x37d718,null))[_0xd754('0x2d')](handleError(_0x37d718,null));};exports[_0xd754('0x5b')]=function(_0x3739b9,_0x10f456){var _0x349b3b=moment()[_0xd754('0x5c')]()[_0xd754('0x5d')]();var _0x3d751b=path[_0xd754('0x5e')](config['root'],'server',_0xd754('0x5f'),_0xd754('0x60'));var _0x9b2317=path[_0xd754('0x5e')](config[_0xd754('0x61')],'server',_0xd754('0x5f'),_0xd754('0x62'));var _0x462e6e=path[_0xd754('0x5e')](_0x3d751b,_0x349b3b);var _0x23e920=util['format']('transcript-%d-%s.zip',_0x3739b9[_0xd754('0x30')]['id'],_0x349b3b);var _0x384e11=path['join'](_0x3d751b,_0x23e920);var _0x29bf8a=[];_0x29bf8a[_0xd754('0x63')]({'model':db[_0xd754('0x64')],'as':_0xd754('0x64'),'attributes':['id',_0xd754('0x65')],'raw':!![]});_0x29bf8a[_0xd754('0x63')]({'model':db[_0xd754('0x66')],'as':_0xd754('0x67'),'attributes':['id',_0xd754('0x68'),_0xd754('0x69')],'raw':!![]});if(_0x3739b9['query'][_0xd754('0x62')]){_0x29bf8a[_0xd754('0x63')]({'model':db[_0xd754('0x6a')],'as':_0xd754('0x6a'),'raw':!![]});}var _0x5649a9=[{'model':db['OpenchannelMessage'],'as':_0xd754('0x6b'),'attributes':['id',_0xd754('0x3e'),'createdAt',_0xd754('0x6c'),'secret',_0xd754('0x6d')],'include':_0x29bf8a}];_0x5649a9[_0xd754('0x63')]({'model':db[_0xd754('0x6e')],'as':_0xd754('0x6f'),'attributes':['id',_0xd754('0x21')]});_0x5649a9[_0xd754('0x63')]({'model':db['User'],'as':_0xd754('0x70'),'attributes':['id',_0xd754('0x65')]});return db[_0xd754('0x25')][_0xd754('0x3c')]({'where':{'id':_0x3739b9[_0xd754('0x30')]['id']},'include':_0x5649a9})[_0xd754('0x1f')](handleEntityNotFound(_0x10f456,null))[_0xd754('0x1f')](function(_0x475d8c){if(_0x475d8c){var _0x3ca712=_0x475d8c[_0xd754('0x71')]({'plain':!![]});fs['mkdirSync'](_0x462e6e);var _0x1ab716={'channel':'Openchannel','account':_0x3ca712[_0xd754('0x6f')][_0xd754('0x21')],'agent':_0x3ca712[_0xd754('0x70')]?_0x3ca712[_0xd754('0x70')][_0xd754('0x65')]:'N.A.','createdAt':moment(_0x3ca712[_0xd754('0x72')])[_0xd754('0x4f')](_0xd754('0x50'))[_0xd754('0x5d')](),'closedAt':_0x3ca712['closed']?moment(_0x3ca712['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd754('0x5d')]():'','disposition':_0x3ca712['disposition'],'visibility':_0x3ca712[_0xd754('0x73')]?_0xd754('0x74'):_0xd754('0x75'),'messages':_(_0x3ca712['Messages'])[_0xd754('0x4c')]({'secret':![]})[_0xd754('0x24')](function(_0x4186e1){if(_0x4186e1['Attachment']){var _0x23c6fb=path['join'](_0x9b2317,_0x4186e1['Attachment'][_0xd754('0x76')]);if(fs['existsSync'](_0x23c6fb)){fs['createReadStream'](_0x23c6fb)['pipe'](fs['createWriteStream'](path[_0xd754('0x5e')](_0x462e6e,_0x4186e1['Attachment'][_0xd754('0x76')])));}}return{'date':moment(_0x4186e1[_0xd754('0x72')])[_0xd754('0x4f')](_0xd754('0x50'))['toString'](),'sender':_0x4186e1[_0xd754('0x6c')]===_0xd754('0x77')?_0x4186e1[_0xd754('0x64')]?_0x4186e1[_0xd754('0x64')]['fullname']:_0xd754('0x78'):_0x4186e1[_0xd754('0x67')][_0xd754('0x68')]+(_0x4186e1[_0xd754('0x67')]['lastName']?'\x20'+_0x4186e1[_0xd754('0x67')][_0xd754('0x69')]:''),'body':_0x4186e1[_0xd754('0x6a')]?_0x4186e1[_0xd754('0x6a')]['basename']:_0x4186e1[_0xd754('0x3e')],'direction':_0x4186e1[_0xd754('0x6c')]===_0xd754('0x77')?'A':'C','secret':_0x4186e1[_0xd754('0x79')],'read':_0x4186e1[_0xd754('0x6d')],'attachment':_0x4186e1[_0xd754('0x6a')]};})['value']()};return ejs[_0xd754('0x7a')](path[_0xd754('0x5e')](config[_0xd754('0x61')],_0xd754('0x7b'),_0xd754('0x7c'),_0xd754('0x7d')),{'interaction':_0x1ab716})['then'](function(_0x4745bd){var _0x55e42c=path[_0xd754('0x5e')](_0x462e6e,_0xd754('0x7e')+_0x3ca712['id']+'-'+_0x349b3b+'.pdf');var _0x2261d0={'path':_0x55e42c,'channel':'Openchannel','interactionId':_0x3ca712['id']};return pdf[_0xd754('0x7f')](_0x4745bd,_0x2261d0);})[_0xd754('0x1f')](function(){return new Promise(function(_0x67cfc5,_0x1d93bb){zipdir(_0x462e6e,{'saveTo':_0x384e11},function(_0x5ef7e1,_0x3ae469){if(_0x5ef7e1)return _0x1d93bb(_0x5ef7e1);return _0x67cfc5(_0x3ae469);});})['then'](function(){return new Promise(function(_0xe93c38,_0x4e52af){rimraf(_0x462e6e,function(_0x467402){if(_0x467402)_0x4e52af(_0x467402);return _0xe93c38();});});})['then'](function(){return _0x10f456[_0xd754('0x5b')](_0x384e11,_0x23e920,function(_0x371f3c){if(_0x371f3c){logger[_0xd754('0x80')](_0xd754('0x81'),_0x371f3c);}else{fs[_0xd754('0x82')](_0x384e11);}});});});}else{return _0x10f456['sendStatus'](0xc8);}})['catch'](handleError(_0x10f456,null));}; \ No newline at end of file +var _0xf62f=['moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','update','then','destroy','stack','name','send','OpenchannelInteraction','rawAttributes','fieldName','getOptions','findAll','openchannel','query','catch','show','type','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','nolimit','order','sort','where','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','root','server','files','attachments','transcript-%d-%s.zip','join','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','closed','disposition','threadId','Private','existsSync','createReadStream','basename','out','System','read','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir'];(function(_0x263fe7,_0x17d0f7){var _0x5377dd=function(_0x4f87cf){while(--_0x4f87cf){_0x263fe7['push'](_0x263fe7['shift']());}};_0x5377dd(++_0x17d0f7);}(_0xf62f,0x173));var _0xff62=function(_0x848d91,_0x1a688a){_0x848d91=_0x848d91-0x0;var _0x273685=_0xf62f[_0x848d91];return _0x273685;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xff62('0x0'));var moment=require(_0xff62('0x1'));var util=require(_0xff62('0x2'));var path=require(_0xff62('0x3'));var ejs=require(_0xff62('0x4'));var fs=require('fs');var _=require(_0xff62('0x5'));var Redis=require('ioredis');var interaction=require(_0xff62('0x6'));var qs=require(_0xff62('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xff62('0x8'))('api');var config=require(_0xff62('0x9'));var db=require(_0xff62('0xa'))['db'];config[_0xff62('0xb')]=_[_0xff62('0xc')](config['redis'],{'host':_0xff62('0xd'),'port':0x18eb});var socket=require(_0xff62('0xe'))(new Redis(config[_0xff62('0xb')]));require(_0xff62('0xf'))[_0xff62('0x10')](socket);function respondWithStatusCode(_0x5f5286,_0x38ba94){_0x38ba94=_0x38ba94||0xcc;return function(_0x1c4a52){if(_0x1c4a52){return _0x5f5286[_0xff62('0x11')](_0x38ba94);}return _0x5f5286[_0xff62('0x12')](_0x38ba94)[_0xff62('0x13')]();};}function respondWithResult(_0x285dea,_0x4436e7){_0x4436e7=_0x4436e7||0xc8;return function(_0x4bf61b){if(_0x4bf61b){return _0x285dea[_0xff62('0x12')](_0x4436e7)[_0xff62('0x14')](_0x4bf61b);}};}function respondWithFilteredResult(_0x4b4381,_0x2f2c9f){return function(_0x5977c4){if(_0x5977c4){var _0x2ed094=typeof _0x2f2c9f['offset']==='undefined'&&typeof _0x2f2c9f[_0xff62('0x15')]===_0xff62('0x16');var _0x3b0da5=_0x5977c4['count'];var _0x13f08b=_0x2ed094?0x0:_0x2f2c9f[_0xff62('0x17')];var _0xb6b876=_0x2ed094?_0x5977c4[_0xff62('0x18')]:_0x2f2c9f['offset']+_0x2f2c9f[_0xff62('0x15')];var _0x2aca13;if(_0xb6b876>=_0x3b0da5){_0xb6b876=_0x3b0da5;_0x2aca13=0xc8;}else{_0x2aca13=0xce;}_0x4b4381['status'](_0x2aca13);return _0x4b4381[_0xff62('0x19')](_0xff62('0x1a'),_0x13f08b+'-'+_0xb6b876+'/'+_0x3b0da5)[_0xff62('0x14')](_0x5977c4);}return null;};}function saveUpdates(_0x4cf074){return function(_0x5d41d5){if(_0x5d41d5){return _0x5d41d5[_0xff62('0x1b')](_0x4cf074)[_0xff62('0x1c')](function(_0x502635){return _0x502635;});}return null;};}function removeEntity(_0x2b1053){return function(_0x87ae84){if(_0x87ae84){return _0x87ae84[_0xff62('0x1d')]()[_0xff62('0x1c')](function(){_0x2b1053[_0xff62('0x12')](0xcc)[_0xff62('0x13')]();});}};}function handleEntityNotFound(_0x391dd4){return function(_0x7af8fe){if(!_0x7af8fe){_0x391dd4[_0xff62('0x11')](0x194);}return _0x7af8fe;};}function handleError(_0x7d9ec6,_0x4fd286){_0x4fd286=_0x4fd286||0x1f4;return function(_0x484a88){logger['error'](_0x484a88[_0xff62('0x1e')]);if(_0x484a88[_0xff62('0x1f')]){delete _0x484a88['name'];}_0x7d9ec6[_0xff62('0x12')](_0x4fd286)[_0xff62('0x20')](_0x484a88);};}exports['index']=function(_0x4cbdd5,_0x1c0f84){var _0xd8ad93={};var _0x528e06=_['map'](db[_0xff62('0x21')][_0xff62('0x22')],function(_0x4ceef5){return{'name':_0x4ceef5[_0xff62('0x23')],'type':_0x4ceef5['type']['key']};});_0xd8ad93=qs[_0xff62('0x24')](_0x528e06,_0x4cbdd5);return interaction[_0xff62('0x25')](_0xff62('0x26'),_0x4cbdd5[_0xff62('0x27')],_0x4cbdd5['user'],_0xd8ad93,_0x528e06)[_0xff62('0x1c')](respondWithFilteredResult(_0x1c0f84,_0xd8ad93))[_0xff62('0x28')](handleError(_0x1c0f84,null));};exports[_0xff62('0x29')]=function(_0x2b051f,_0x1eaa1a){var _0x2c1aea={};if(_0x2b051f[_0xff62('0x27')][_0xff62('0x2a')]&&_0x2b051f[_0xff62('0x27')][_0xff62('0x2a')]==='from'){_0x2c1aea['from']=_0x2b051f[_0xff62('0x2b')]['id'];}else{_0x2c1aea['id']=_0x2b051f['params']['id'];}var _0x4c636d={'raw':![],'where':_0x2c1aea},_0x343793={};_0x343793[_0xff62('0x2c')]=_['keys'](db[_0xff62('0x21')][_0xff62('0x22')]);_0x343793[_0xff62('0x27')]=_[_0xff62('0x2d')](_0x2b051f[_0xff62('0x27')]);_0x343793[_0xff62('0x2e')]=_[_0xff62('0x2f')](_0x343793[_0xff62('0x2c')],_0x343793[_0xff62('0x27')]);_0x4c636d[_0xff62('0x30')]=_[_0xff62('0x2f')](_0x343793[_0xff62('0x2c')],qs[_0xff62('0x31')](_0x2b051f['query']['fields']));_0x4c636d[_0xff62('0x30')]=_0x4c636d[_0xff62('0x30')][_0xff62('0x32')]?_0x4c636d[_0xff62('0x30')]:_0x343793[_0xff62('0x2c')];if(_0x2b051f[_0xff62('0x27')][_0xff62('0x33')]){_0x4c636d['include']=[{'all':!![]}];}_0x4c636d=_[_0xff62('0x34')]({},_0x4c636d,_0x2b051f['options']);return db[_0xff62('0x21')][_0xff62('0x35')](_0x4c636d)['then'](handleEntityNotFound(_0x1eaa1a,null))[_0xff62('0x1c')](respondWithResult(_0x1eaa1a,null))[_0xff62('0x28')](handleError(_0x1eaa1a,null));};exports[_0xff62('0x36')]=function(_0x519b79,_0x42c6a3){return db[_0xff62('0x21')][_0xff62('0x36')](_0x519b79[_0xff62('0x37')],{})[_0xff62('0x1c')](respondWithResult(_0x42c6a3,0xc9))['catch'](handleError(_0x42c6a3,null));};exports['update']=function(_0x42eed5,_0x14ccbb){if(_0x42eed5[_0xff62('0x37')]['id']){delete _0x42eed5[_0xff62('0x37')]['id'];}return db['OpenchannelInteraction'][_0xff62('0x35')]({'where':{'id':_0x42eed5[_0xff62('0x2b')]['id']}})[_0xff62('0x1c')](handleEntityNotFound(_0x14ccbb,null))['then'](saveUpdates(_0x42eed5[_0xff62('0x37')],null))[_0xff62('0x1c')](respondWithResult(_0x14ccbb,null))[_0xff62('0x28')](handleError(_0x14ccbb,null));};exports[_0xff62('0x1d')]=function(_0x1ea89c,_0x5d86a3){return db['OpenchannelInteraction'][_0xff62('0x35')]({'where':{'id':_0x1ea89c[_0xff62('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d86a3,null))[_0xff62('0x1c')](removeEntity(_0x5d86a3,null))[_0xff62('0x28')](handleError(_0x5d86a3,null));};exports[_0xff62('0x38')]=function(_0x5e2898,_0x51c43a){return db['OpenchannelInteraction'][_0xff62('0x38')]()['then'](respondWithResult(_0x51c43a,null))['catch'](handleError(_0x51c43a,null));};exports[_0xff62('0x39')]=function(_0x48e4f5,_0x445aba){return db[_0xff62('0x3a')][_0xff62('0x35')]({'where':{'id':_0x48e4f5[_0xff62('0x2b')]['id']}})[_0xff62('0x1c')](handleEntityNotFound(_0x445aba,null))[_0xff62('0x1c')](function(_0x4cca10){if(_0x4cca10){return _0x4cca10['addMessage'](_0x48e4f5['body'][_0xff62('0x3b')],_[_0xff62('0x3c')](_0x48e4f5[_0xff62('0x37')],[_0xff62('0x3b'),'id'])||{});}})[_0xff62('0x1c')](respondWithResult(_0x445aba,null))[_0xff62('0x28')](handleError(_0x445aba,null));};exports[_0xff62('0x3d')]=function(_0x3bb7e1,_0x2ea70c){var _0x56e6ae={'raw':![],'where':{}};var _0x1315dc={};var _0x31cc91={'count':0x0,'rows':[]};return db[_0xff62('0x21')]['findOne']({'where':{'id':_0x3bb7e1[_0xff62('0x2b')]['id']}})[_0xff62('0x1c')](handleEntityNotFound(_0x2ea70c,null))['then'](function(_0x2113cd){if(_0x2113cd){_0x1315dc['model']=_[_0xff62('0x2d')](db['OpenchannelMessage']['rawAttributes']);_0x1315dc[_0xff62('0x27')]=_[_0xff62('0x2d')](_0x3bb7e1[_0xff62('0x27')]);_0x1315dc[_0xff62('0x2e')]=_[_0xff62('0x2f')](_0x1315dc[_0xff62('0x2c')],_0x1315dc[_0xff62('0x27')]);_0x56e6ae[_0xff62('0x30')]=_['intersection'](_0x1315dc[_0xff62('0x2c')],qs[_0xff62('0x31')](_0x3bb7e1[_0xff62('0x27')]['fields']));_0x56e6ae[_0xff62('0x30')]=_0x56e6ae['attributes'][_0xff62('0x32')]?_0x56e6ae[_0xff62('0x30')]:_0x1315dc[_0xff62('0x2c')];if(!_0x3bb7e1[_0xff62('0x27')]['hasOwnProperty'](_0xff62('0x3e'))){_0x56e6ae[_0xff62('0x15')]=qs['limit'](_0x3bb7e1[_0xff62('0x27')][_0xff62('0x15')]);_0x56e6ae[_0xff62('0x17')]=qs[_0xff62('0x17')](_0x3bb7e1[_0xff62('0x27')]['offset']);}_0x56e6ae[_0xff62('0x3f')]=qs['sort'](_0x3bb7e1['query'][_0xff62('0x40')]);_0x56e6ae[_0xff62('0x41')]=qs[_0xff62('0x2e')](_['pick'](_0x3bb7e1[_0xff62('0x27')],_0x1315dc[_0xff62('0x2e')]));_0x56e6ae[_0xff62('0x41')]['OpenchannelInteractionId']=_0x2113cd['id'];if(_0x3bb7e1[_0xff62('0x27')]['filter']){_0x56e6ae[_0xff62('0x41')]=_[_0xff62('0x34')](_0x56e6ae[_0xff62('0x41')],{'$or':_[_0xff62('0x42')](_0x56e6ae[_0xff62('0x30')],function(_0x40df43){var _0x51cdeb={};_0x51cdeb[_0x40df43]={'$like':'%'+_0x3bb7e1['query'][_0xff62('0x43')]+'%'};return _0x51cdeb;})});}if(_0x3bb7e1[_0xff62('0x27')][_0xff62('0x44')]){var _0x5f4177=_0x3bb7e1['query']['$gte'][_0xff62('0x45')](',');var _0x3c7e12={};_0x3c7e12[_0x5f4177[0x0]]={'$gte':moment(_0x5f4177[0x1])[_0xff62('0x46')](_0xff62('0x47'))};_0x56e6ae[_0xff62('0x41')]=_[_0xff62('0x34')](_0x56e6ae[_0xff62('0x41')],_0x3c7e12);}_0x56e6ae=_[_0xff62('0x34')]({},_0x56e6ae,_0x3bb7e1[_0xff62('0x48')]);return db[_0xff62('0x3a')][_0xff62('0x18')]({'where':_0x56e6ae[_0xff62('0x41')]})[_0xff62('0x1c')](function(_0x484d6b){_0x31cc91[_0xff62('0x18')]=_0x484d6b;if(_0x3bb7e1[_0xff62('0x27')][_0xff62('0x33')]){_0x56e6ae[_0xff62('0x49')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x56e6ae);})[_0xff62('0x1c')](function(_0x12012d){_0x31cc91[_0xff62('0x4a')]=_0x12012d;return _0x31cc91;});}})[_0xff62('0x1c')](respondWithFilteredResult(_0x2ea70c,_0x56e6ae))[_0xff62('0x28')](handleError(_0x2ea70c,null));};exports['addTags']=function(_0x782cd7,_0x310758){return db['OpenchannelInteraction'][_0xff62('0x35')]({'where':{'id':_0x782cd7[_0xff62('0x2b')]['id']}})['then'](handleEntityNotFound(_0x310758,null))[_0xff62('0x1c')](function(_0x4ec961){if(_0x4ec961){return _0x4ec961[_0xff62('0x4b')](_0x782cd7[_0xff62('0x37')][_0xff62('0x3b')],_[_0xff62('0x3c')](_0x782cd7['body'],[_0xff62('0x3b'),'id'])||{})[_0xff62('0x4c')](function(){return db[_0xff62('0x4d')][_0xff62('0x25')]({'attributes':['id',_0xff62('0x1f'),_0xff62('0x4e')],'where':{'id':_0x782cd7[_0xff62('0x37')]['ids']}});})[_0xff62('0x1c')](function(_0x4364c5){socket[_0xff62('0x4f')]('openchannelInteractionTags:save',{'id':Number(_0x782cd7[_0xff62('0x2b')]['id']),'tags':_0x4364c5||[]});return{'id':Number(_0x782cd7[_0xff62('0x2b')]['id']),'tags':_0x4364c5||[]};});}})[_0xff62('0x1c')](respondWithResult(_0x310758,null))[_0xff62('0x28')](handleError(_0x310758,null));};exports['removeTags']=function(_0x28d1d2,_0x36db47){return db[_0xff62('0x21')][_0xff62('0x35')]({'where':{'id':_0x28d1d2[_0xff62('0x2b')]['id']}})[_0xff62('0x1c')](handleEntityNotFound(_0x36db47,null))['then'](function(_0x5683a6){if(_0x5683a6){return _0x5683a6[_0xff62('0x50')](_0x28d1d2[_0xff62('0x27')][_0xff62('0x3b')]);}})[_0xff62('0x1c')](respondWithStatusCode(_0x36db47,null))[_0xff62('0x28')](handleError(_0x36db47,null));};exports[_0xff62('0x51')]=function(_0x20e55d,_0x2fa53a){var _0x48b90c=moment()[_0xff62('0x52')]()[_0xff62('0x53')]();var _0x57dbb8=path['join'](config[_0xff62('0x54')],_0xff62('0x55'),_0xff62('0x56'),'tmp');var _0x34894c=path['join'](config['root'],'server',_0xff62('0x56'),_0xff62('0x57'));var _0x34c185=path['join'](_0x57dbb8,_0x48b90c);var _0x1c11cc=util[_0xff62('0x46')](_0xff62('0x58'),_0x20e55d[_0xff62('0x2b')]['id'],_0x48b90c);var _0xf81289=path[_0xff62('0x59')](_0x57dbb8,_0x1c11cc);var _0x4e6f40=[];_0x4e6f40[_0xff62('0x5a')]({'model':db[_0xff62('0x5b')],'as':_0xff62('0x5b'),'attributes':['id',_0xff62('0x5c')],'raw':!![]});_0x4e6f40[_0xff62('0x5a')]({'model':db[_0xff62('0x5d')],'as':_0xff62('0x5e'),'attributes':['id',_0xff62('0x5f'),_0xff62('0x60')],'raw':!![]});if(_0x20e55d['query'][_0xff62('0x57')]){_0x4e6f40[_0xff62('0x5a')]({'model':db[_0xff62('0x61')],'as':_0xff62('0x61'),'raw':!![]});}var _0x46d28e=[{'model':db[_0xff62('0x3a')],'as':'Messages','attributes':['id','body',_0xff62('0x62'),_0xff62('0x63'),_0xff62('0x64'),'read'],'include':_0x4e6f40}];_0x46d28e[_0xff62('0x5a')]({'model':db[_0xff62('0x65')],'as':_0xff62('0x66'),'attributes':['id',_0xff62('0x1f')]});_0x46d28e['push']({'model':db[_0xff62('0x5b')],'as':'Owner','attributes':['id',_0xff62('0x5c')]});return db[_0xff62('0x21')][_0xff62('0x35')]({'where':{'id':_0x20e55d['params']['id']},'include':_0x46d28e})[_0xff62('0x1c')](handleEntityNotFound(_0x2fa53a,null))[_0xff62('0x1c')](function(_0x3f43ed){if(_0x3f43ed){var _0x1884ba=_0x3f43ed[_0xff62('0x67')]({'plain':!![]});fs['mkdirSync'](_0x34c185);var _0x5b4b9a={'channel':_0xff62('0x68'),'account':_0x1884ba[_0xff62('0x66')][_0xff62('0x1f')],'agent':_0x1884ba['Owner']?_0x1884ba[_0xff62('0x69')][_0xff62('0x5c')]:_0xff62('0x6a'),'createdAt':moment(_0x1884ba[_0xff62('0x62')])[_0xff62('0x46')](_0xff62('0x47'))[_0xff62('0x53')](),'closedAt':_0x1884ba[_0xff62('0x6b')]?moment(_0x1884ba['closedAt'])[_0xff62('0x46')](_0xff62('0x47'))[_0xff62('0x53')]():'','disposition':_0x1884ba[_0xff62('0x6c')],'visibility':_0x1884ba[_0xff62('0x6d')]?'Public':_0xff62('0x6e'),'messages':_(_0x1884ba['Messages'])['filter']({'secret':![]})[_0xff62('0x42')](function(_0x472930){if(_0x472930['Attachment']){var _0x23ed3e=path['join'](_0x34894c,_0x472930[_0xff62('0x61')]['basename']);if(fs[_0xff62('0x6f')](_0x23ed3e)){fs[_0xff62('0x70')](_0x23ed3e)['pipe'](fs['createWriteStream'](path[_0xff62('0x59')](_0x34c185,_0x472930[_0xff62('0x61')][_0xff62('0x71')])));}}return{'date':moment(_0x472930['createdAt'])[_0xff62('0x46')](_0xff62('0x47'))[_0xff62('0x53')](),'sender':_0x472930[_0xff62('0x63')]===_0xff62('0x72')?_0x472930['User']?_0x472930[_0xff62('0x5b')][_0xff62('0x5c')]:_0xff62('0x73'):_0x472930[_0xff62('0x5e')][_0xff62('0x5f')]+(_0x472930[_0xff62('0x5e')][_0xff62('0x60')]?'\x20'+_0x472930[_0xff62('0x5e')][_0xff62('0x60')]:''),'body':_0x472930['Attachment']?_0x472930['Attachment']['basename']:_0x472930[_0xff62('0x37')],'direction':_0x472930[_0xff62('0x63')]===_0xff62('0x72')?'A':'C','secret':_0x472930[_0xff62('0x64')],'read':_0x472930[_0xff62('0x74')],'attachment':_0x472930[_0xff62('0x61')]};})[_0xff62('0x75')]()};return ejs[_0xff62('0x76')](path['join'](config['root'],_0xff62('0x55'),'views',_0xff62('0x77')),{'interaction':_0x5b4b9a})[_0xff62('0x1c')](function(_0x4ed81a){var _0x3dfec9=path[_0xff62('0x59')](_0x34c185,'transcript-'+_0x1884ba['id']+'-'+_0x48b90c+_0xff62('0x78'));var _0x3e4963={'path':_0x3dfec9,'channel':_0xff62('0x68'),'interactionId':_0x1884ba['id']};return pdf[_0xff62('0x79')](_0x4ed81a,_0x3e4963);})[_0xff62('0x1c')](function(){return new Promise(function(_0x1c5c75,_0x129e2d){zipdir(_0x34c185,{'saveTo':_0xf81289},function(_0x10e46d,_0x1560a6){if(_0x10e46d)return _0x129e2d(_0x10e46d);return _0x1c5c75(_0x1560a6);});})[_0xff62('0x1c')](function(){return new Promise(function(_0x3f4fb2,_0x115edc){rimraf(_0x34c185,function(_0x7fe249){if(_0x7fe249)_0x115edc(_0x7fe249);return _0x3f4fb2();});});})['then'](function(){return _0x2fa53a[_0xff62('0x51')](_0xf81289,_0x1c11cc,function(_0x1eb3b7){if(_0x1eb3b7){logger['error'](_0xff62('0x7a'),_0x1eb3b7);}else{fs[_0xff62('0x7b')](_0xf81289);}});});});}else{return _0x2fa53a['sendStatus'](0xc8);}})[_0xff62('0x28')](handleError(_0x2fa53a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 78975d8..d0d9568 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 _0x92e1=['save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x2f7073,_0x55c8bc){var _0x4b0f20=function(_0x374af0){while(--_0x374af0){_0x2f7073['push'](_0x2f7073['shift']());}};_0x4b0f20(++_0x55c8bc);}(_0x92e1,0x1c6));var _0x192e=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x92e1[_0x19a49f];return _0x5351ae;};'use strict';var EventEmitter=require(_0x192e('0x0'));var OpenchannelInteraction=require(_0x192e('0x1'))['db'][_0x192e('0x2')];var OpenchannelMessage=require(_0x192e('0x1'))['db'][_0x192e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x192e('0x4')](0x0);var events={'afterCreate':_0x192e('0x5'),'afterUpdate':_0x192e('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2fae36){return function(_0x2ef0db,_0x2e8a2f,_0x5aa4b6){_0x2ef0db[_0x192e('0x7')]({'attributes':['id'],'raw':!![]})[_0x192e('0x8')](function(_0x3bf420){_0x2ef0db[_0x192e('0x9')](_0x192e('0xa'),_0x3bf420['map'](function(_0x57106e){return{'id':_0x57106e['id']};}));return OpenchannelMessage[_0x192e('0xb')]({'where':{'OpenchannelInteractionId':_0x2ef0db['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f98b5){_0x2ef0db[_0x192e('0x9')](_0x192e('0xc'),_0x3f98b5[_0x192e('0xd')]);OpenchannelInteractionEvents[_0x192e('0xe')](_0x2fae36+':'+_0x2ef0db['id'],_0x2ef0db);OpenchannelInteractionEvents['emit'](_0x2fae36,_0x2ef0db);_0x5aa4b6(null);})[_0x192e('0xf')](_0x5aa4b6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x192e('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x96be=['OpenchannelInteraction','OpenchannelMessage','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x96be,0xa1));var _0xe96b=function(_0x5d661a,_0x300155){_0x5d661a=_0x5d661a-0x0;var _0x20b789=_0x96be[_0x5d661a];return _0x20b789;};'use strict';var EventEmitter=require(_0xe96b('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe96b('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe96b('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe96b('0x3'),'afterUpdate':_0xe96b('0x4'),'afterDestroy':_0xe96b('0x5')};function emitEvent(_0x3749b7){return function(_0x142dcf,_0x2027a8,_0x325ab1){_0x142dcf['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3d2f2b){_0x142dcf[_0xe96b('0x6')](_0xe96b('0x7'),_0x3d2f2b[_0xe96b('0x8')](function(_0x22ed5a){return{'id':_0x22ed5a['id']};}));return OpenchannelMessage[_0xe96b('0x9')]({'where':{'OpenchannelInteractionId':_0x142dcf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe96b('0xa')](function(_0x28ca2d){_0x142dcf[_0xe96b('0x6')](_0xe96b('0xb'),_0x28ca2d[_0xe96b('0xc')]);OpenchannelInteractionEvents[_0xe96b('0xd')](_0x3749b7+':'+_0x142dcf['id'],_0x142dcf);OpenchannelInteractionEvents[_0xe96b('0xd')](_0x3749b7,_0x142dcf);_0x325ab1(null);})[_0xe96b('0xe')](_0x325ab1(null));};}for(var e in events){if(events[_0xe96b('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xe96b('0x10')](e,emitEvent(event));}}module[_0xe96b('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 48322fe..e2d0b1a 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 _0xe364=['closed','closedAt','format','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4_unicode_ci','changed'];(function(_0x2a9d40,_0x6e65c2){var _0x574cd8=function(_0x2605d0){while(--_0x2605d0){_0x2a9d40['push'](_0x2a9d40['shift']());}};_0x574cd8(++_0x6e65c2);}(_0xe364,0x1ed));var _0x4e36=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0xe364[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x4e36('0x0'));var util=require('util');var logger=require(_0x4e36('0x1'))(_0x4e36('0x2'));var moment=require(_0x4e36('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e36('0x5'));var attributes=require(_0x4e36('0x6'));module[_0x4e36('0x7')]=function(_0x2f9c48,_0x3c5633){return _0x2f9c48['define']('OpenchannelInteraction',attributes,{'tableName':_0x4e36('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4e36('0x9'),'hooks':{'beforeUpdate':function(_0x4ce6bc,_0x43fd26,_0x25dcce){if(_0x4ce6bc[_0x4e36('0xa')](_0x4e36('0xb'))){_0x4ce6bc[_0x4e36('0xc')]=moment()[_0x4e36('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25dcce(null,_0x4ce6bc);}}});}; \ No newline at end of file +var _0xac9c=['openchannel_interactions','utf8mb4','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction'];(function(_0x4f81d2,_0x3f5e10){var _0x161dff=function(_0x4fce38){while(--_0x4fce38){_0x4f81d2['push'](_0x4f81d2['shift']());}};_0x161dff(++_0x3f5e10);}(_0xac9c,0x146));var _0xcac9=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xac9c[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0xcac9('0x0'));var util=require(_0xcac9('0x1'));var logger=require(_0xcac9('0x2'))(_0xcac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcac9('0x4'));var fs=require('fs');var path=require(_0xcac9('0x5'));var rimraf=require('rimraf');var config=require(_0xcac9('0x6'));var attributes=require(_0xcac9('0x7'));module['exports']=function(_0x3b943b,_0xd2df29){return _0x3b943b[_0xcac9('0x8')](_0xcac9('0x9'),attributes,{'tableName':_0xcac9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcac9('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2ad67f,_0xe2cee0,_0xc0e79b){if(_0x2ad67f[_0xcac9('0xc')](_0xcac9('0xd'))){_0x2ad67f['closedAt']=moment()[_0xcac9('0xe')](_0xcac9('0xf'));}_0xc0e79b(null,_0x2ad67f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 92f626b..68b77af 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 _0xaa61=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x30acdb,_0x5cfad4){var _0x244e16=function(_0x679e46){while(--_0x679e46){_0x30acdb['push'](_0x30acdb['shift']());}};_0x244e16(++_0x5cfad4);}(_0xaa61,0x18d));var _0x1aa6=function(_0x3d987a,_0x4c9011){_0x3d987a=_0x3d987a-0x0;var _0x16a179=_0xaa61[_0x3d987a];return _0x16a179;};'use strict';var _=require(_0x1aa6('0x0'));var util=require(_0x1aa6('0x1'));var moment=require(_0x1aa6('0x2'));var BPromise=require(_0x1aa6('0x3'));var rs=require(_0x1aa6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aa6('0x5'))['db'];var utils=require(_0x1aa6('0x6'));var logger=require(_0x1aa6('0x7'))(_0x1aa6('0x8'));var config=require(_0x1aa6('0x9'));var jayson=require(_0x1aa6('0xa'));var client=jayson[_0x1aa6('0xb')][_0x1aa6('0xc')]({'port':0x232a});config['redis']=_[_0x1aa6('0xd')](config['redis'],{'host':_0x1aa6('0xe'),'port':0x18eb});var socket=require(_0x1aa6('0xf'))(new Redis(config[_0x1aa6('0x10')]));require(_0x1aa6('0x11'))[_0x1aa6('0x12')](socket);function respondWithRpcPromise(_0x144729,_0x24ec66,_0x481a3a){return new BPromise(function(_0x26676d,_0x9d0947){return client[_0x1aa6('0x13')](_0x144729,_0x481a3a)[_0x1aa6('0x14')](function(_0x47cfc1){logger[_0x1aa6('0x15')](_0x1aa6('0x16'),_0x24ec66,_0x1aa6('0x17'));logger['debug'](_0x1aa6('0x18'),_0x24ec66,_0x1aa6('0x17'),JSON[_0x1aa6('0x19')](_0x47cfc1));if(_0x47cfc1[_0x1aa6('0x1a')]){if(_0x47cfc1[_0x1aa6('0x1a')]['code']===0x1f4){logger[_0x1aa6('0x1a')](_0x1aa6('0x16'),_0x24ec66,_0x47cfc1[_0x1aa6('0x1a')][_0x1aa6('0x1b')]);return _0x9d0947(_0x47cfc1[_0x1aa6('0x1a')][_0x1aa6('0x1b')]);}logger[_0x1aa6('0x1a')](_0x1aa6('0x16'),_0x24ec66,_0x47cfc1[_0x1aa6('0x1a')]['message']);return _0x26676d(_0x47cfc1[_0x1aa6('0x1a')][_0x1aa6('0x1b')]);}else{logger[_0x1aa6('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x24ec66,_0x1aa6('0x17'));_0x26676d(_0x47cfc1[_0x1aa6('0x1c')][_0x1aa6('0x1b')]);}})[_0x1aa6('0x1d')](function(_0xbb3387){logger[_0x1aa6('0x1a')](_0x1aa6('0x16'),_0x24ec66,_0xbb3387);_0x9d0947(_0xbb3387);});});}exports['UpdateOpenchannelInteraction']=function(_0x539767){var _0x5916f5=this;return new Promise(function(_0xc99480,_0x160cbe){return db['OpenchannelInteraction'][_0x1aa6('0x1e')](_0x539767[_0x1aa6('0x1f')],{'raw':_0x539767[_0x1aa6('0x20')]?_0x539767[_0x1aa6('0x20')][_0x1aa6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x539767[_0x1aa6('0x20')]?_0x539767[_0x1aa6('0x20')][_0x1aa6('0x22')]||null:null,'attributes':_0x539767[_0x1aa6('0x20')]?_0x539767[_0x1aa6('0x20')]['attributes']||null:null,'limit':_0x539767[_0x1aa6('0x20')]?_0x539767[_0x1aa6('0x20')][_0x1aa6('0x23')]||null:null})['then'](function(_0x4213c1){logger[_0x1aa6('0x15')](_0x1aa6('0x24'),_0x539767);logger[_0x1aa6('0x25')](_0x1aa6('0x24'),_0x539767,JSON[_0x1aa6('0x19')](_0x4213c1));_0xc99480(_0x4213c1);})[_0x1aa6('0x1d')](function(_0x5ef4e2){logger[_0x1aa6('0x1a')]('UpdateOpenchannelInteraction',_0x5ef4e2[_0x1aa6('0x1b')],_0x539767);_0x160cbe(_0x5916f5['error'](0x1f4,_0x5ef4e2[_0x1aa6('0x1b')]));});});};exports[_0x1aa6('0x26')]=function(_0x2d298c){return new Promise(function(_0x4c9a4a,_0x51a17d){return db['OpenchannelInteraction'][_0x1aa6('0x27')]({'where':_0x2d298c[_0x1aa6('0x20')]?_0x2d298c[_0x1aa6('0x20')][_0x1aa6('0x22')]||null:null})[_0x1aa6('0x14')](function(_0x511560){if(_0x511560){return _0x511560[_0x1aa6('0x28')](_0x2d298c[_0x1aa6('0x1f')][_0x1aa6('0x29')],_[_0x1aa6('0x2a')](_0x2d298c[_0x1aa6('0x1f')],[_0x1aa6('0x29'),'id'])||{});}})[_0x1aa6('0x2b')](function(_0x44740e){logger[_0x1aa6('0x15')](_0x1aa6('0x2c'),_0x2d298c);logger[_0x1aa6('0x25')](_0x1aa6('0x2c'),_0x2d298c,JSON[_0x1aa6('0x19')](_0x44740e));_0x4c9a4a(_0x44740e);})['catch'](function(_0x28ec5c){logger['error'](_0x1aa6('0x2c'),_0x28ec5c[_0x1aa6('0x1b')],_0x2d298c);_0x51a17d(_this[_0x1aa6('0x1a')](0x1f4,_0x28ec5c[_0x1aa6('0x1b')]));});});}; \ No newline at end of file +var _0x4910=['request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelInteraction.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4910,0x70));var _0x0491=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4910[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require(_0x0491('0x3'));var rs=require(_0x0491('0x4'));var fs=require('fs');var Redis=require(_0x0491('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))(_0x0491('0x8'));var config=require(_0x0491('0x9'));var jayson=require(_0x0491('0xa'));var client=jayson[_0x0491('0xb')][_0x0491('0xc')]({'port':0x232a});config[_0x0491('0xd')]=_[_0x0491('0xe')](config[_0x0491('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0491('0xd')]));require(_0x0491('0xf'))[_0x0491('0x10')](socket);function respondWithRpcPromise(_0x5d5923,_0x5bb6cc,_0x4048b3){return new BPromise(function(_0x109b49,_0x3651e3){return client[_0x0491('0x11')](_0x5d5923,_0x4048b3)[_0x0491('0x12')](function(_0x1f4139){logger['info'](_0x0491('0x13'),_0x5bb6cc,_0x0491('0x14'));logger[_0x0491('0x15')](_0x0491('0x16'),_0x5bb6cc,'request\x20sent',JSON['stringify'](_0x1f4139));if(_0x1f4139[_0x0491('0x17')]){if(_0x1f4139['error'][_0x0491('0x18')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5bb6cc,_0x1f4139['error'][_0x0491('0x19')]);return _0x3651e3(_0x1f4139[_0x0491('0x17')][_0x0491('0x19')]);}logger['error'](_0x0491('0x13'),_0x5bb6cc,_0x1f4139[_0x0491('0x17')]['message']);return _0x109b49(_0x1f4139['error'][_0x0491('0x19')]);}else{logger[_0x0491('0x1a')](_0x0491('0x13'),_0x5bb6cc,_0x0491('0x14'));_0x109b49(_0x1f4139[_0x0491('0x1b')]['message']);}})['catch'](function(_0xbc3f89){logger['error'](_0x0491('0x13'),_0x5bb6cc,_0xbc3f89);_0x3651e3(_0xbc3f89);});});}exports[_0x0491('0x1c')]=function(_0x4cc0a6){var _0x1c07cb=this;return new Promise(function(_0x2cb777,_0x545f60){return db[_0x0491('0x1d')][_0x0491('0x1e')](_0x4cc0a6['body'],{'raw':_0x4cc0a6[_0x0491('0x1f')]?_0x4cc0a6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc0a6[_0x0491('0x1f')]?_0x4cc0a6[_0x0491('0x1f')]['where']||null:null,'attributes':_0x4cc0a6[_0x0491('0x1f')]?_0x4cc0a6['options'][_0x0491('0x20')]||null:null,'limit':_0x4cc0a6['options']?_0x4cc0a6[_0x0491('0x1f')][_0x0491('0x21')]||null:null})[_0x0491('0x12')](function(_0x30dffc){logger[_0x0491('0x1a')](_0x0491('0x1c'),_0x4cc0a6);logger[_0x0491('0x15')](_0x0491('0x1c'),_0x4cc0a6,JSON['stringify'](_0x30dffc));_0x2cb777(_0x30dffc);})['catch'](function(_0x3dcce7){logger['error']('UpdateOpenchannelInteraction',_0x3dcce7[_0x0491('0x19')],_0x4cc0a6);_0x545f60(_0x1c07cb[_0x0491('0x17')](0x1f4,_0x3dcce7[_0x0491('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x4fbe79){return new Promise(function(_0x4b75a3,_0xa1bbc7){return db[_0x0491('0x1d')][_0x0491('0x22')]({'where':_0x4fbe79[_0x0491('0x1f')]?_0x4fbe79[_0x0491('0x1f')]['where']||null:null})[_0x0491('0x12')](function(_0xc0fdd){if(_0xc0fdd){return _0xc0fdd[_0x0491('0x23')](_0x4fbe79[_0x0491('0x24')][_0x0491('0x25')],_[_0x0491('0x26')](_0x4fbe79[_0x0491('0x24')],[_0x0491('0x25'),'id'])||{});}})[_0x0491('0x27')](function(_0x19cf96){logger[_0x0491('0x1a')](_0x0491('0x28'),_0x4fbe79);logger['debug'](_0x0491('0x28'),_0x4fbe79,JSON[_0x0491('0x29')](_0x19cf96));_0x4b75a3(_0x19cf96);})[_0x0491('0x2a')](function(_0x55a77d){logger['error'](_0x0491('0x28'),_0x55a77d[_0x0491('0x19')],_0x4fbe79);_0xa1bbc7(_this['error'](0x1f4,_0x55a77d[_0x0491('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c48d384..420d67d 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 _0xaaa8=['openchannelInteraction:','save','emit','removeListener','register'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xaaa8,0x83));var _0x8aaa=function(_0x168314,_0x28a88f){_0x168314=_0x168314-0x0;var _0x40c99a=_0xaaa8[_0x168314];return _0x40c99a;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8aaa('0x0'),'remove','update'];function createListener(_0x37d4d6,_0x3b5ab8){return function(_0x8f4415){_0x3b5ab8[_0x8aaa('0x1')](_0x37d4d6,_0x8f4415);};}function removeListener(_0x154bcd,_0x3414b7){return function(){OpenchannelInteractionEvents[_0x8aaa('0x2')](_0x154bcd,_0x3414b7);};}exports[_0x8aaa('0x3')]=function(_0x3c6d92){for(var _0x5ba134=0x0,_0x311a8b=events['length'];_0x5ba134<_0x311a8b;_0x5ba134++){var _0x4b2e2c=events[_0x5ba134];var _0x3e9cd4=createListener(_0x8aaa('0x4')+_0x4b2e2c,_0x3c6d92);OpenchannelInteractionEvents['on'](_0x4b2e2c,_0x3e9cd4);}}; \ No newline at end of file +var _0xa265=['./openchannelInteraction.events','save','update','removeListener','register','openchannelInteraction:'];(function(_0x2a3194,_0x4fbacc){var _0x4401ae=function(_0x5d0496){while(--_0x5d0496){_0x2a3194['push'](_0x2a3194['shift']());}};_0x4401ae(++_0x4fbacc);}(_0xa265,0xb4));var _0x5a26=function(_0x2d1e29,_0x4d4b79){_0x2d1e29=_0x2d1e29-0x0;var _0x5928db=_0xa265[_0x2d1e29];return _0x5928db;};'use strict';var OpenchannelInteractionEvents=require(_0x5a26('0x0'));var events=[_0x5a26('0x1'),'remove',_0x5a26('0x2')];function createListener(_0x4c18d1,_0x25a61a){return function(_0x2869a7){_0x25a61a['emit'](_0x4c18d1,_0x2869a7);};}function removeListener(_0xbc32c3,_0x1cf4d4){return function(){OpenchannelInteractionEvents[_0x5a26('0x3')](_0xbc32c3,_0x1cf4d4);};}exports[_0x5a26('0x4')]=function(_0x5b00c8){for(var _0x1083a0=0x0,_0x44f84c=events['length'];_0x1083a0<_0x44f84c;_0x1083a0++){var _0x435f39=events[_0x1083a0];var _0x171f85=createListener(_0x5a26('0x5')+_0x435f39,_0x5b00c8);OpenchannelInteractionEvents['on'](_0x435f39,_0x171f85);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ee29c27..72b1f4d 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x3b469f,_0x2dc8cb){var _0x139a18=function(_0x1c1680){while(--_0x1c1680){_0x3b469f['push'](_0x3b469f['shift']());}};_0x139a18(++_0x2dc8cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x2e7fb5,_0x84b930){var _0x321aab=function(_0x38f8cc){while(--_0x38f8cc){_0x2e7fb5['push'](_0x2e7fb5['shift']());}};_0x321aab(++_0x84b930);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 48cf34e..a78a40f 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 _0xa7fa=['out','DATE','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x652755,_0x466673){var _0x406625=function(_0x1b9546){while(--_0x1b9546){_0x652755['push'](_0x652755['shift']());}};_0x406625(++_0x466673);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa7f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xaa7f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xaa7f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xaa7f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa7f('0x3')]('in','out'),'defaultValue':_0xaa7f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xaa7f('0x5')]},'providerName':{'type':Sequelize[_0xaa7f('0x6')]},'providerResponse':{'type':Sequelize[_0xaa7f('0x7')]}}; \ No newline at end of file +var _0x3306=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0x3306,0x107));var _0x6330=function(_0xf4d05b,_0x490732){_0xf4d05b=_0xf4d05b-0x0;var _0x8ad782=_0x3306[_0xf4d05b];return _0x8ad782;};'use strict';var Sequelize=require(_0x6330('0x0'));module[_0x6330('0x1')]={'body':{'type':Sequelize[_0x6330('0x2')](_0x6330('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6330('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6330('0x5')]('in',_0x6330('0x6')),'defaultValue':_0x6330('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6330('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6330('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ef44cf9..02feffc 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 _0xae32=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','openchannel-interactions','openchannel','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','UserId','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','Sequelize','QueryTypes','SELECT','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','client','http','request','then','request\x20sent','debug','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','result','sendStatus','status','end','json'];(function(_0x10b863,_0x4027c2){var _0x498d2a=function(_0x140cf6){while(--_0x140cf6){_0x10b863['push'](_0x10b863['shift']());}};_0x498d2a(++_0x4027c2);}(_0xae32,0x157));var _0x2ae3=function(_0x2d969c,_0x2d5796){_0x2d969c=_0x2d969c-0x0;var _0x2a1699=_0xae32[_0x2d969c];return _0x2a1699;};'use strict';var emlformat=require(_0x2ae3('0x0'));var rimraf=require(_0x2ae3('0x1'));var zipdir=require(_0x2ae3('0x2'));var jsonpatch=require(_0x2ae3('0x3'));var rp=require(_0x2ae3('0x4'));var moment=require(_0x2ae3('0x5'));var BPromise=require(_0x2ae3('0x6'));var Mustache=require(_0x2ae3('0x7'));var util=require(_0x2ae3('0x8'));var path=require(_0x2ae3('0x9'));var sox=require(_0x2ae3('0xa'));var csv=require(_0x2ae3('0xb'));var ejs=require(_0x2ae3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ae3('0xd'));var squel=require(_0x2ae3('0xe'));var crypto=require(_0x2ae3('0xf'));var jsforce=require(_0x2ae3('0x10'));var deskjs=require(_0x2ae3('0x11'));var toCsv=require(_0x2ae3('0xb'));var querystring=require(_0x2ae3('0x12'));var Papa=require(_0x2ae3('0x13'));var Redis=require(_0x2ae3('0x14'));var authService=require(_0x2ae3('0x15'));var qs=require(_0x2ae3('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ae3('0x17'));var logger=require('../../config/logger')(_0x2ae3('0x18'));var utils=require(_0x2ae3('0x19'));var config=require(_0x2ae3('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ae3('0x1b'))['db'];config[_0x2ae3('0x1c')]=_[_0x2ae3('0x1d')](config[_0x2ae3('0x1c')],{'host':_0x2ae3('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ae3('0x1c')]));require(_0x2ae3('0x1f'))[_0x2ae3('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2ae3('0x21')][_0x2ae3('0x22')]({'port':0x232c});var client9002=jayson[_0x2ae3('0x21')][_0x2ae3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4e8190,_0x1a74b8,_0x229d4c,_0x27022a){return new BPromise(function(_0x67822,_0x2d5689){var _0x758485=_0x27022a||client;return _0x758485[_0x2ae3('0x23')](_0x4e8190,_0x229d4c)[_0x2ae3('0x24')](function(_0x121cfe){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1a74b8,_0x2ae3('0x25'));logger[_0x2ae3('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1a74b8,'request\x20sent',JSON[_0x2ae3('0x27')](_0x121cfe));if(_0x121cfe[_0x2ae3('0x28')]){if(_0x121cfe[_0x2ae3('0x28')][_0x2ae3('0x29')]===0x1f4){logger[_0x2ae3('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1a74b8,_0x121cfe[_0x2ae3('0x28')][_0x2ae3('0x2a')]);return _0x2d5689(_0x121cfe['error'][_0x2ae3('0x2a')]);}logger[_0x2ae3('0x28')](_0x2ae3('0x2b'),_0x1a74b8,_0x121cfe[_0x2ae3('0x28')][_0x2ae3('0x2a')]);return _0x67822(_0x121cfe['error']['message']);}else{logger[_0x2ae3('0x2c')](_0x2ae3('0x2b'),_0x1a74b8,_0x2ae3('0x25'));_0x67822(_0x121cfe[_0x2ae3('0x2d')][_0x2ae3('0x2a')]);}})['catch'](function(_0x5b9c55){logger[_0x2ae3('0x28')](_0x2ae3('0x2b'),_0x1a74b8,_0x5b9c55);_0x2d5689(_0x5b9c55);});});}function respondWithStatusCode(_0x42e38f,_0x3c8100){_0x3c8100=_0x3c8100||0xcc;return function(_0x553db0){if(_0x553db0){return _0x42e38f[_0x2ae3('0x2e')](_0x3c8100);}return _0x42e38f[_0x2ae3('0x2f')](_0x3c8100)[_0x2ae3('0x30')]();};}function respondWithResult(_0x3680d5,_0x5bedc9){_0x5bedc9=_0x5bedc9||0xc8;return function(_0xb6a8db){if(_0xb6a8db){return _0x3680d5[_0x2ae3('0x2f')](_0x5bedc9)[_0x2ae3('0x31')](_0xb6a8db);}};}function respondWithFilteredResult(_0x1f79e1,_0xf6e48){return function(_0x370e85){if(_0x370e85){var _0x3d3f6e=typeof _0xf6e48[_0x2ae3('0x32')]===_0x2ae3('0x33')&&typeof _0xf6e48[_0x2ae3('0x34')]==='undefined';var _0x166629=_0x370e85[_0x2ae3('0x35')];var _0x2b7116=_0x3d3f6e?0x0:_0xf6e48[_0x2ae3('0x32')];var _0x325e85=_0x3d3f6e?_0x370e85[_0x2ae3('0x35')]:_0xf6e48['offset']+_0xf6e48['limit'];var _0xc35f28;if(_0x325e85>=_0x166629){_0x325e85=_0x166629;_0xc35f28=0xc8;}else{_0xc35f28=0xce;}_0x1f79e1[_0x2ae3('0x2f')](_0xc35f28);return _0x1f79e1['set'](_0x2ae3('0x36'),_0x2b7116+'-'+_0x325e85+'/'+_0x166629)[_0x2ae3('0x31')](_0x370e85);}return null;};}function patchUpdates(_0xfa9b77){return function(_0x3534f8){try{jsonpatch[_0x2ae3('0x37')](_0x3534f8,_0xfa9b77,!![]);}catch(_0x5bd133){return BPromise[_0x2ae3('0x38')](_0x5bd133);}return _0x3534f8[_0x2ae3('0x39')]();};}function saveUpdates(_0x41adb2,_0x180627){return function(_0x2580e2){if(_0x2580e2){return _0x2580e2[_0x2ae3('0x3a')](_0x41adb2)[_0x2ae3('0x24')](function(_0x49b2ff){return _0x49b2ff;});}return null;};}function removeEntity(_0x73f97f,_0x24eee4){return function(_0x1b9ad6){if(_0x1b9ad6){return _0x1b9ad6[_0x2ae3('0x3b')]()['then'](function(){_0x73f97f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0ada,_0x32c816){return function(_0x435f36){if(!_0x435f36){_0x2f0ada[_0x2ae3('0x2e')](0x194);}return _0x435f36;};}function handleError(_0x479c17,_0x3fe4eb){_0x3fe4eb=_0x3fe4eb||0x1f4;return function(_0x674f46){logger[_0x2ae3('0x28')](_0x674f46[_0x2ae3('0x3c')]);if(_0x674f46['name']){delete _0x674f46[_0x2ae3('0x3d')];}_0x479c17[_0x2ae3('0x2f')](_0x3fe4eb)[_0x2ae3('0x3e')](_0x674f46);};}exports[_0x2ae3('0x3f')]=function(_0x1ffcd5,_0x5461b4){var _0x3c0421={},_0x4cd631={},_0x5bb398={'count':0x0,'rows':[]};var _0x56fc9e=_[_0x2ae3('0x40')](db[_0x2ae3('0x41')][_0x2ae3('0x42')],function(_0x1c583b){return{'name':_0x1c583b[_0x2ae3('0x43')],'type':_0x1c583b[_0x2ae3('0x44')][_0x2ae3('0x45')]};});_0x4cd631[_0x2ae3('0x46')]=_[_0x2ae3('0x40')](_0x56fc9e,_0x2ae3('0x3d'));_0x4cd631[_0x2ae3('0x47')]=_[_0x2ae3('0x48')](_0x1ffcd5['query']);_0x4cd631[_0x2ae3('0x49')]=_['intersection'](_0x4cd631['model'],_0x4cd631['query']);_0x3c0421['attributes']=_[_0x2ae3('0x4a')](_0x4cd631['model'],qs['fields'](_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x4b')]));_0x3c0421[_0x2ae3('0x4c')]=_0x3c0421[_0x2ae3('0x4c')][_0x2ae3('0x4d')]?_0x3c0421[_0x2ae3('0x4c')]:_0x4cd631[_0x2ae3('0x46')];if(!_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x4e')]('nolimit')){_0x3c0421[_0x2ae3('0x34')]=qs[_0x2ae3('0x34')](_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x34')]);_0x3c0421[_0x2ae3('0x32')]=qs['offset'](_0x1ffcd5['query'][_0x2ae3('0x32')]);}_0x3c0421[_0x2ae3('0x4f')]=qs['sort'](_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x50')]);_0x3c0421['where']=qs[_0x2ae3('0x49')](_['pick'](_0x1ffcd5['query'],_0x4cd631[_0x2ae3('0x49')]),_0x56fc9e);if(_0x1ffcd5[_0x2ae3('0x47')]['filter']){_0x3c0421[_0x2ae3('0x51')]=_[_0x2ae3('0x52')](_0x3c0421[_0x2ae3('0x51')],{'$or':_[_0x2ae3('0x40')](_0x56fc9e,function(_0x1d95ac){if(_0x1d95ac[_0x2ae3('0x44')]!==_0x2ae3('0x53')){var _0x595b1c={};_0x595b1c[_0x1d95ac[_0x2ae3('0x3d')]]={'$like':'%'+_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x54')]+'%'};return _0x595b1c;}})});}_0x3c0421=_[_0x2ae3('0x52')]({},_0x3c0421,_0x1ffcd5[_0x2ae3('0x55')]);var _0x373dfd={'where':_0x3c0421['where']};return db['OpenchannelMessage']['count'](_0x373dfd)[_0x2ae3('0x24')](function(_0x2f0d7a){_0x5bb398[_0x2ae3('0x35')]=_0x2f0d7a;if(_0x1ffcd5[_0x2ae3('0x47')][_0x2ae3('0x56')]){_0x3c0421[_0x2ae3('0x57')]=[{'all':!![]}];}return db[_0x2ae3('0x41')][_0x2ae3('0x58')](_0x3c0421);})[_0x2ae3('0x24')](function(_0x709c41){_0x5bb398['rows']=_0x709c41;return _0x5bb398;})[_0x2ae3('0x24')](respondWithFilteredResult(_0x5461b4,_0x3c0421))[_0x2ae3('0x59')](handleError(_0x5461b4,null));};exports[_0x2ae3('0x5a')]=function(_0x57c76f,_0x2e76d5){var _0x2a8d6a={'raw':!![],'where':{'id':_0x57c76f[_0x2ae3('0x5b')]['id']}},_0x471eb0={};_0x471eb0['model']=_['keys'](db[_0x2ae3('0x41')][_0x2ae3('0x42')]);_0x471eb0[_0x2ae3('0x47')]=_['keys'](_0x57c76f[_0x2ae3('0x47')]);_0x471eb0[_0x2ae3('0x49')]=_[_0x2ae3('0x4a')](_0x471eb0['model'],_0x471eb0[_0x2ae3('0x47')]);_0x2a8d6a[_0x2ae3('0x4c')]=_[_0x2ae3('0x4a')](_0x471eb0['model'],qs[_0x2ae3('0x4b')](_0x57c76f['query'][_0x2ae3('0x4b')]));_0x2a8d6a[_0x2ae3('0x4c')]=_0x2a8d6a[_0x2ae3('0x4c')][_0x2ae3('0x4d')]?_0x2a8d6a[_0x2ae3('0x4c')]:_0x471eb0[_0x2ae3('0x46')];if(_0x57c76f[_0x2ae3('0x47')][_0x2ae3('0x56')]){_0x2a8d6a['include']=[{'all':!![]}];}_0x2a8d6a=_['merge']({},_0x2a8d6a,_0x57c76f[_0x2ae3('0x55')]);return db[_0x2ae3('0x41')]['find'](_0x2a8d6a)[_0x2ae3('0x24')](handleEntityNotFound(_0x2e76d5,null))[_0x2ae3('0x24')](respondWithResult(_0x2e76d5,null))['catch'](handleError(_0x2e76d5,null));};exports[_0x2ae3('0x5c')]=function(_0x346f46,_0x468d2a){return db[_0x2ae3('0x41')][_0x2ae3('0x5c')](_0x346f46[_0x2ae3('0x5d')],{})[_0x2ae3('0x24')](respondWithResult(_0x468d2a,0xc9))[_0x2ae3('0x59')](handleError(_0x468d2a,null));};exports[_0x2ae3('0x3a')]=function(_0x16aaa0,_0x571d09){if(_0x16aaa0[_0x2ae3('0x5d')]['id']){delete _0x16aaa0[_0x2ae3('0x5d')]['id'];}return db[_0x2ae3('0x41')][_0x2ae3('0x5e')]({'where':{'id':_0x16aaa0['params']['id']}})[_0x2ae3('0x24')](handleEntityNotFound(_0x571d09,null))['then'](saveUpdates(_0x16aaa0[_0x2ae3('0x5d')],null))[_0x2ae3('0x24')](respondWithResult(_0x571d09,null))[_0x2ae3('0x59')](handleError(_0x571d09,null));};exports[_0x2ae3('0x3b')]=function(_0x1f2c9e,_0x33f8b0){return db[_0x2ae3('0x41')][_0x2ae3('0x5e')]({'where':{'id':_0x1f2c9e[_0x2ae3('0x5b')]['id']}})[_0x2ae3('0x24')](handleEntityNotFound(_0x33f8b0,null))[_0x2ae3('0x24')](removeEntity(_0x33f8b0,null))[_0x2ae3('0x59')](handleError(_0x33f8b0,null));};exports[_0x2ae3('0x5f')]=function(_0x58d209,_0xf50803){return db['OpenchannelMessage'][_0x2ae3('0x5f')]()[_0x2ae3('0x24')](respondWithResult(_0xf50803,null))[_0x2ae3('0x59')](handleError(_0xf50803,null));};var interaction_log=require('../../config/logger')(_0x2ae3('0x60'));exports['accept']=function(_0x41f575,_0x13b997,_0x21013c){var _0x261498={'agent':{},'channel':_0x2ae3('0x61')};if(_0x41f575[_0x2ae3('0x5d')]['id']){delete _0x41f575[_0x2ae3('0x5d')]['id'];}_0x41f575['body']['read']=!![];_0x41f575[_0x2ae3('0x5d')]['readAt']=moment()['format'](_0x2ae3('0x62'));_0x41f575[_0x2ae3('0x5d')]['UserId']=_0x41f575['body']['UserId']||_0x41f575[_0x2ae3('0x63')]['id'];_0x261498[_0x2ae3('0x64')]['id']=_0x41f575[_0x2ae3('0x5d')]['UserId'];return db[_0x2ae3('0x41')]['find']({'where':{'id':_0x41f575['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13b997,null))[_0x2ae3('0x24')](saveUpdates(_0x41f575[_0x2ae3('0x5d')],null))[_0x2ae3('0x24')](function(_0x44b96b){if(_0x44b96b){_0x261498['message']=_0x44b96b[_0x2ae3('0x65')]({'plain':!![]});return db[_0x2ae3('0x66')][_0x2ae3('0x5e')]({'where':{'id':_0x44b96b[_0x2ae3('0x67')]}});}return null;})[_0x2ae3('0x24')](handleEntityNotFound(_0x13b997,null))[_0x2ae3('0x24')](function(_0x23a681){if(_0x23a681){return _0x23a681['update']({'UserId':_0x41f575['body'][_0x2ae3('0x68')],'read1stAt':_['isNil'](_0x23a681[_0x2ae3('0x69')])?moment()[_0x2ae3('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x17a928){if(_0x17a928){_0x261498[_0x2ae3('0x6b')]=_0x17a928[_0x2ae3('0x65')]({'plain':!![]});interaction_log[_0x2ae3('0x2c')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41f575[_0x2ae3('0x63')]['id'],_0x41f575['user'][_0x2ae3('0x3d')],_0x41f575[_0x2ae3('0x63')][_0x2ae3('0x6c')],_0x261498['interaction']['id'],_0x41f575[_0x2ae3('0x5d')]?JSON[_0x2ae3('0x27')](_0x41f575['body']):_0x2ae3('0x6d'));return respondWithRpcPromise(_0x2ae3('0x6e'),_0x2ae3('0x6f'),_0x261498);}return null;})[_0x2ae3('0x24')](function(_0x2ed89a){var _0x2b930d=_0x2ae3('0x70')+_0x2ed89a[_0x2ae3('0x2a')]['ContactId'];return db['sequelize']['query'](_0x2b930d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x34fbfd){return _0x34fbfd;});})['then'](function(_0x3bd9f2){if(_0x3bd9f2){_0x261498['message']['contact']=_0x3bd9f2[0x0];if(!_0x41f575[_0x2ae3('0x5d')][_0x2ae3('0x68')])return;return db[_0x2ae3('0x71')][_0x2ae3('0x5e')]({'where':{'id':_0x41f575[_0x2ae3('0x5d')][_0x2ae3('0x68')],'role':'agent'},'attributes':['id',_0x2ae3('0x3d'),_0x2ae3('0x72'),_0x2ae3('0x73'),_0x2ae3('0x74')],'raw':!![]});}return null;})[_0x2ae3('0x24')](function(_0x3d625c){if(!_0x3d625c)return null;_0x261498[_0x2ae3('0x2a')][_0x2ae3('0x64')]=_0x3d625c;return _0x261498;})[_0x2ae3('0x24')](function(_0x30631a){if(_0x30631a){if(_0x41f575[_0x2ae3('0x5d')][_0x2ae3('0x75')]){_0x261498[_0x2ae3('0x2a')][_0x2ae3('0x76')]=util[_0x2ae3('0x6a')](_0x2ae3('0x77'),_0x41f575['user'][_0x2ae3('0x3d')]);_0x261498['message']['channel']=_0x261498[_0x2ae3('0x78')];_0x261498['message'][_0x2ae3('0x79')]=_0x261498['channel'];_0x261498[_0x2ae3('0x2a')]['event']='accept';return respondWithRpcPromise(_0x2ae3('0x7a'),_0x2ae3('0x7a'),{'event':_0x2ae3('0x7b'),'message':_0x261498['message']},client9002)[_0x2ae3('0x24')](function(){return _0x261498;});}return _0x261498;}return null;})[_0x2ae3('0x24')](respondWithResult(_0x13b997,null))[_0x2ae3('0x59')](handleError(_0x13b997,null));};var interaction_log=require(_0x2ae3('0x7c'))('openchannel-interactions');exports['reject']=function(_0x28aed2,_0x276c89,_0x108b53){var _0x2dc2f0={'agent':{},'channel':_0x2ae3('0x61')};if(_0x28aed2['body']['id']){delete _0x28aed2['body']['id'];}_0x28aed2[_0x2ae3('0x5d')][_0x2ae3('0x68')]=_0x28aed2[_0x2ae3('0x5d')][_0x2ae3('0x68')]||_0x28aed2[_0x2ae3('0x63')]['id'];_0x2dc2f0['agent']['id']=_0x28aed2[_0x2ae3('0x5d')]['UserId'];return db[_0x2ae3('0x41')][_0x2ae3('0x5e')]({'where':{'id':_0x28aed2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x276c89,null))['then'](function(_0x13ccb6){if(_0x13ccb6){_0x2dc2f0[_0x2ae3('0x2a')]=_0x13ccb6[_0x2ae3('0x65')]({'plain':!![]});return db[_0x2ae3('0x66')]['find']({'where':{'id':_0x13ccb6[_0x2ae3('0x67')]}});}return null;})[_0x2ae3('0x24')](handleEntityNotFound(_0x276c89,null))[_0x2ae3('0x24')](function(_0x13e067){if(_0x13e067){_0x2dc2f0[_0x2ae3('0x6b')]=_0x13e067['get']({'plain':!![]});interaction_log[_0x2ae3('0x2c')](_0x2ae3('0x7d'),_0x28aed2[_0x2ae3('0x63')]['id'],_0x28aed2['user']['name'],_0x28aed2[_0x2ae3('0x63')][_0x2ae3('0x6c')],_0x2dc2f0[_0x2ae3('0x6b')]['id'],_0x28aed2['body']?JSON[_0x2ae3('0x27')](_0x28aed2[_0x2ae3('0x5d')]):_0x2ae3('0x6d'));return respondWithRpcPromise('RejectMessage',_0x2ae3('0x7e'),_0x2dc2f0);}return null;})[_0x2ae3('0x24')](function(_0x8b27f1){var _0x7a758d=_0x2ae3('0x70')+_0x8b27f1['message']['ContactId'];return db[_0x2ae3('0x7f')][_0x2ae3('0x47')](_0x7a758d,{'type':db[_0x2ae3('0x80')][_0x2ae3('0x81')][_0x2ae3('0x82')],'raw':!![]})[_0x2ae3('0x24')](function(_0x38dbf4){return _0x38dbf4;});})[_0x2ae3('0x24')](function(_0x5b767c){if(_0x5b767c){_0x2dc2f0[_0x2ae3('0x2a')]['contact']=_0x5b767c[0x0];if(!_0x28aed2[_0x2ae3('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x28aed2[_0x2ae3('0x5d')][_0x2ae3('0x68')],'role':_0x2ae3('0x64')},'attributes':['id',_0x2ae3('0x3d'),_0x2ae3('0x72'),_0x2ae3('0x73'),_0x2ae3('0x74')],'raw':!![]});}return null;})[_0x2ae3('0x24')](function(_0x68e4b8){if(!_0x68e4b8)return null;_0x2dc2f0[_0x2ae3('0x2a')]['agent']=_0x68e4b8;return _0x2dc2f0;})[_0x2ae3('0x24')](function(_0x541ed2){if(_0x541ed2){_0x541ed2[_0x2ae3('0x2a')]['interface']=util[_0x2ae3('0x6a')](_0x2ae3('0x77'),_0x28aed2[_0x2ae3('0x63')]['name']);_0x541ed2[_0x2ae3('0x2a')][_0x2ae3('0x78')]=_0x2dc2f0['channel'];_0x541ed2['message'][_0x2ae3('0x79')]=_0x2dc2f0[_0x2ae3('0x78')];_0x541ed2[_0x2ae3('0x2a')]['event']='reject';respondWithRpcPromise(_0x2ae3('0x7a'),'EventManager',{'event':'rejectmessage','message':_0x541ed2[_0x2ae3('0x2a')]},client9002);return _0x2dc2f0;}return null;})[_0x2ae3('0x24')](respondWithResult(_0x276c89,null))[_0x2ae3('0x59')](handleError(_0x276c89,null));}; \ No newline at end of file +var _0xc051=['findAll','rows','show','params','filters','length','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','find','OpenchannelInteractionId','isNil','read1stAt','format','interaction','role','null','AcceptMessage','sequelize','QueryTypes','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','acceptmessage','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','internal','EventManager','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc051,0xb5));var _0x1c05=function(_0x20592f,_0x2ae891){_0x20592f=_0x20592f-0x0;var _0x4e7211=_0xc051[_0x20592f];return _0x4e7211;};'use strict';var emlformat=require(_0x1c05('0x0'));var rimraf=require(_0x1c05('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c05('0x2'));var moment=require(_0x1c05('0x3'));var BPromise=require(_0x1c05('0x4'));var Mustache=require(_0x1c05('0x5'));var util=require('util');var path=require(_0x1c05('0x6'));var sox=require(_0x1c05('0x7'));var csv=require(_0x1c05('0x8'));var ejs=require(_0x1c05('0x9'));var fs=require('fs');var fs_extra=require(_0x1c05('0xa'));var _=require(_0x1c05('0xb'));var squel=require(_0x1c05('0xc'));var crypto=require(_0x1c05('0xd'));var jsforce=require(_0x1c05('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1c05('0x8'));var querystring=require(_0x1c05('0xf'));var Papa=require(_0x1c05('0x10'));var Redis=require(_0x1c05('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c05('0x12'));var as=require(_0x1c05('0x13'));var hardwareService=require(_0x1c05('0x14'));var logger=require(_0x1c05('0x15'))('api');var utils=require(_0x1c05('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c05('0x17'));var db=require(_0x1c05('0x18'))['db'];config[_0x1c05('0x19')]=_[_0x1c05('0x1a')](config[_0x1c05('0x19')],{'host':_0x1c05('0x1b'),'port':0x18eb});var socket=require(_0x1c05('0x1c'))(new Redis(config[_0x1c05('0x19')]));require(_0x1c05('0x1d'))[_0x1c05('0x1e')](socket);var jayson=require(_0x1c05('0x1f'));var client=jayson[_0x1c05('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1c05('0x20')][_0x1c05('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x26a61e,_0x568633,_0x1e713f,_0x49b538){return new BPromise(function(_0x2ad711,_0x439aa5){var _0x3af388=_0x49b538||client;return _0x3af388[_0x1c05('0x22')](_0x26a61e,_0x1e713f)[_0x1c05('0x23')](function(_0x5d9a7e){logger[_0x1c05('0x24')](_0x1c05('0x25'),_0x568633,_0x1c05('0x26'));logger['debug'](_0x1c05('0x27'),_0x568633,_0x1c05('0x26'),JSON[_0x1c05('0x28')](_0x5d9a7e));if(_0x5d9a7e['error']){if(_0x5d9a7e[_0x1c05('0x29')][_0x1c05('0x2a')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x568633,_0x5d9a7e[_0x1c05('0x29')]['message']);return _0x439aa5(_0x5d9a7e['error']['message']);}logger[_0x1c05('0x29')](_0x1c05('0x25'),_0x568633,_0x5d9a7e['error'][_0x1c05('0x2b')]);return _0x2ad711(_0x5d9a7e[_0x1c05('0x29')][_0x1c05('0x2b')]);}else{logger[_0x1c05('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x568633,_0x1c05('0x26'));_0x2ad711(_0x5d9a7e[_0x1c05('0x2c')][_0x1c05('0x2b')]);}})[_0x1c05('0x2d')](function(_0x25d863){logger[_0x1c05('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x568633,_0x25d863);_0x439aa5(_0x25d863);});});}function respondWithStatusCode(_0xa841fb,_0x1dd767){_0x1dd767=_0x1dd767||0xcc;return function(_0x248f1d){if(_0x248f1d){return _0xa841fb[_0x1c05('0x2e')](_0x1dd767);}return _0xa841fb[_0x1c05('0x2f')](_0x1dd767)[_0x1c05('0x30')]();};}function respondWithResult(_0x190987,_0x4f7658){_0x4f7658=_0x4f7658||0xc8;return function(_0x32e88d){if(_0x32e88d){return _0x190987[_0x1c05('0x2f')](_0x4f7658)[_0x1c05('0x31')](_0x32e88d);}};}function respondWithFilteredResult(_0x5026ab,_0x52bc85){return function(_0x21594d){if(_0x21594d){var _0x1d548e=typeof _0x52bc85[_0x1c05('0x32')]===_0x1c05('0x33')&&typeof _0x52bc85[_0x1c05('0x34')]===_0x1c05('0x33');var _0x104678=_0x21594d[_0x1c05('0x35')];var _0x1224da=_0x1d548e?0x0:_0x52bc85[_0x1c05('0x32')];var _0x24b53f=_0x1d548e?_0x21594d[_0x1c05('0x35')]:_0x52bc85[_0x1c05('0x32')]+_0x52bc85[_0x1c05('0x34')];var _0x5aab6b;if(_0x24b53f>=_0x104678){_0x24b53f=_0x104678;_0x5aab6b=0xc8;}else{_0x5aab6b=0xce;}_0x5026ab[_0x1c05('0x2f')](_0x5aab6b);return _0x5026ab['set']('Content-Range',_0x1224da+'-'+_0x24b53f+'/'+_0x104678)[_0x1c05('0x31')](_0x21594d);}return null;};}function patchUpdates(_0x19323d){return function(_0xdd7dae){try{jsonpatch[_0x1c05('0x36')](_0xdd7dae,_0x19323d,!![]);}catch(_0x5b0ef4){return BPromise[_0x1c05('0x37')](_0x5b0ef4);}return _0xdd7dae['save']();};}function saveUpdates(_0x1513d4,_0x54269a){return function(_0x12a75a){if(_0x12a75a){return _0x12a75a[_0x1c05('0x38')](_0x1513d4)[_0x1c05('0x23')](function(_0xecd06f){return _0xecd06f;});}return null;};}function removeEntity(_0x230f48,_0x1513e3){return function(_0x361813){if(_0x361813){return _0x361813[_0x1c05('0x39')]()[_0x1c05('0x23')](function(){_0x230f48[_0x1c05('0x2f')](0xcc)[_0x1c05('0x30')]();});}};}function handleEntityNotFound(_0x1932b8,_0x63167b){return function(_0x418219){if(!_0x418219){_0x1932b8[_0x1c05('0x2e')](0x194);}return _0x418219;};}function handleError(_0x182e0a,_0x3a9196){_0x3a9196=_0x3a9196||0x1f4;return function(_0x385dcc){logger['error'](_0x385dcc[_0x1c05('0x3a')]);if(_0x385dcc[_0x1c05('0x3b')]){delete _0x385dcc['name'];}_0x182e0a['status'](_0x3a9196)[_0x1c05('0x3c')](_0x385dcc);};}exports[_0x1c05('0x3d')]=function(_0x1eb5bb,_0x530350){var _0x20f3dc={},_0x12b7d3={},_0xc1d675={'count':0x0,'rows':[]};var _0x4a022b=_[_0x1c05('0x3e')](db[_0x1c05('0x3f')][_0x1c05('0x40')],function(_0x5b4e12){return{'name':_0x5b4e12['fieldName'],'type':_0x5b4e12['type']['key']};});_0x12b7d3[_0x1c05('0x41')]=_['map'](_0x4a022b,'name');_0x12b7d3[_0x1c05('0x42')]=_[_0x1c05('0x43')](_0x1eb5bb[_0x1c05('0x42')]);_0x12b7d3['filters']=_[_0x1c05('0x44')](_0x12b7d3[_0x1c05('0x41')],_0x12b7d3[_0x1c05('0x42')]);_0x20f3dc[_0x1c05('0x45')]=_[_0x1c05('0x44')](_0x12b7d3[_0x1c05('0x41')],qs[_0x1c05('0x46')](_0x1eb5bb[_0x1c05('0x42')]['fields']));_0x20f3dc[_0x1c05('0x45')]=_0x20f3dc[_0x1c05('0x45')]['length']?_0x20f3dc[_0x1c05('0x45')]:_0x12b7d3[_0x1c05('0x41')];if(!_0x1eb5bb['query'][_0x1c05('0x47')](_0x1c05('0x48'))){_0x20f3dc[_0x1c05('0x34')]=qs[_0x1c05('0x34')](_0x1eb5bb['query'][_0x1c05('0x34')]);_0x20f3dc['offset']=qs['offset'](_0x1eb5bb[_0x1c05('0x42')][_0x1c05('0x32')]);}_0x20f3dc[_0x1c05('0x49')]=qs['sort'](_0x1eb5bb[_0x1c05('0x42')]['sort']);_0x20f3dc[_0x1c05('0x4a')]=qs['filters'](_[_0x1c05('0x4b')](_0x1eb5bb[_0x1c05('0x42')],_0x12b7d3['filters']),_0x4a022b);if(_0x1eb5bb[_0x1c05('0x42')][_0x1c05('0x4c')]){_0x20f3dc[_0x1c05('0x4a')]=_[_0x1c05('0x4d')](_0x20f3dc[_0x1c05('0x4a')],{'$or':_[_0x1c05('0x3e')](_0x4a022b,function(_0x2df92f){if(_0x2df92f[_0x1c05('0x4e')]!==_0x1c05('0x4f')){var _0x4ab1de={};_0x4ab1de[_0x2df92f[_0x1c05('0x3b')]]={'$like':'%'+_0x1eb5bb[_0x1c05('0x42')][_0x1c05('0x4c')]+'%'};return _0x4ab1de;}})});}_0x20f3dc=_['merge']({},_0x20f3dc,_0x1eb5bb[_0x1c05('0x50')]);var _0x20efb2={'where':_0x20f3dc[_0x1c05('0x4a')]};return db[_0x1c05('0x3f')][_0x1c05('0x35')](_0x20efb2)[_0x1c05('0x23')](function(_0xfa3a5e){_0xc1d675[_0x1c05('0x35')]=_0xfa3a5e;if(_0x1eb5bb[_0x1c05('0x42')][_0x1c05('0x51')]){_0x20f3dc[_0x1c05('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1c05('0x53')](_0x20f3dc);})['then'](function(_0x744b57){_0xc1d675[_0x1c05('0x54')]=_0x744b57;return _0xc1d675;})[_0x1c05('0x23')](respondWithFilteredResult(_0x530350,_0x20f3dc))['catch'](handleError(_0x530350,null));};exports[_0x1c05('0x55')]=function(_0x5e9e1b,_0x1df18b){var _0x10c553={'raw':!![],'where':{'id':_0x5e9e1b[_0x1c05('0x56')]['id']}},_0xf1a0bc={};_0xf1a0bc[_0x1c05('0x41')]=_[_0x1c05('0x43')](db[_0x1c05('0x3f')][_0x1c05('0x40')]);_0xf1a0bc[_0x1c05('0x42')]=_['keys'](_0x5e9e1b[_0x1c05('0x42')]);_0xf1a0bc[_0x1c05('0x57')]=_[_0x1c05('0x44')](_0xf1a0bc[_0x1c05('0x41')],_0xf1a0bc[_0x1c05('0x42')]);_0x10c553[_0x1c05('0x45')]=_[_0x1c05('0x44')](_0xf1a0bc[_0x1c05('0x41')],qs[_0x1c05('0x46')](_0x5e9e1b[_0x1c05('0x42')][_0x1c05('0x46')]));_0x10c553[_0x1c05('0x45')]=_0x10c553[_0x1c05('0x45')][_0x1c05('0x58')]?_0x10c553[_0x1c05('0x45')]:_0xf1a0bc[_0x1c05('0x41')];if(_0x5e9e1b[_0x1c05('0x42')]['includeAll']){_0x10c553[_0x1c05('0x52')]=[{'all':!![]}];}_0x10c553=_['merge']({},_0x10c553,_0x5e9e1b[_0x1c05('0x50')]);return db[_0x1c05('0x3f')]['find'](_0x10c553)[_0x1c05('0x23')](handleEntityNotFound(_0x1df18b,null))[_0x1c05('0x23')](respondWithResult(_0x1df18b,null))[_0x1c05('0x2d')](handleError(_0x1df18b,null));};exports[_0x1c05('0x59')]=function(_0x2af082,_0x4eef01){return db[_0x1c05('0x3f')]['create'](_0x2af082[_0x1c05('0x5a')],{})['then'](respondWithResult(_0x4eef01,0xc9))[_0x1c05('0x2d')](handleError(_0x4eef01,null));};exports['update']=function(_0x1e912,_0x200e75){if(_0x1e912['body']['id']){delete _0x1e912[_0x1c05('0x5a')]['id'];}return db[_0x1c05('0x3f')]['find']({'where':{'id':_0x1e912['params']['id']}})[_0x1c05('0x23')](handleEntityNotFound(_0x200e75,null))[_0x1c05('0x23')](saveUpdates(_0x1e912[_0x1c05('0x5a')],null))['then'](respondWithResult(_0x200e75,null))[_0x1c05('0x2d')](handleError(_0x200e75,null));};exports['destroy']=function(_0x13bf02,_0x33b932){return db[_0x1c05('0x3f')]['find']({'where':{'id':_0x13bf02[_0x1c05('0x56')]['id']}})[_0x1c05('0x23')](handleEntityNotFound(_0x33b932,null))[_0x1c05('0x23')](removeEntity(_0x33b932,null))['catch'](handleError(_0x33b932,null));};exports[_0x1c05('0x5b')]=function(_0x531f25,_0x2b3eb5){return db[_0x1c05('0x3f')]['describe']()['then'](respondWithResult(_0x2b3eb5,null))[_0x1c05('0x2d')](handleError(_0x2b3eb5,null));};var interaction_log=require(_0x1c05('0x15'))(_0x1c05('0x5c'));exports[_0x1c05('0x5d')]=function(_0x2a3fbf,_0x523476,_0x3bbfa0){var _0x1e39fa={'agent':{},'channel':_0x1c05('0x5e')};if(_0x2a3fbf['body']['id']){delete _0x2a3fbf['body']['id'];}_0x2a3fbf[_0x1c05('0x5a')][_0x1c05('0x5f')]=!![];_0x2a3fbf['body'][_0x1c05('0x60')]=moment()['format'](_0x1c05('0x61'));_0x2a3fbf[_0x1c05('0x5a')][_0x1c05('0x62')]=_0x2a3fbf[_0x1c05('0x5a')][_0x1c05('0x62')]||_0x2a3fbf[_0x1c05('0x63')]['id'];_0x1e39fa['agent']['id']=_0x2a3fbf['body'][_0x1c05('0x62')];return db[_0x1c05('0x3f')]['find']({'where':{'id':_0x2a3fbf[_0x1c05('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x523476,null))['then'](saveUpdates(_0x2a3fbf[_0x1c05('0x5a')],null))['then'](function(_0x29e86b){if(_0x29e86b){_0x1e39fa[_0x1c05('0x2b')]=_0x29e86b['get']({'plain':!![]});return db[_0x1c05('0x64')][_0x1c05('0x65')]({'where':{'id':_0x29e86b[_0x1c05('0x66')]}});}return null;})[_0x1c05('0x23')](handleEntityNotFound(_0x523476,null))['then'](function(_0x4c587f){if(_0x4c587f){return _0x4c587f['update']({'UserId':_0x2a3fbf[_0x1c05('0x5a')]['UserId'],'read1stAt':_[_0x1c05('0x67')](_0x4c587f[_0x1c05('0x68')])?moment()[_0x1c05('0x69')](_0x1c05('0x61')):undefined});}return null;})[_0x1c05('0x23')](function(_0x273884){if(_0x273884){_0x1e39fa[_0x1c05('0x6a')]=_0x273884['get']({'plain':!![]});interaction_log[_0x1c05('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a3fbf[_0x1c05('0x63')]['id'],_0x2a3fbf[_0x1c05('0x63')][_0x1c05('0x3b')],_0x2a3fbf['user'][_0x1c05('0x6b')],_0x1e39fa[_0x1c05('0x6a')]['id'],_0x2a3fbf['body']?JSON[_0x1c05('0x28')](_0x2a3fbf[_0x1c05('0x5a')]):_0x1c05('0x6c'));return respondWithRpcPromise(_0x1c05('0x6d'),'acceptMessage',_0x1e39fa);}return null;})[_0x1c05('0x23')](function(_0x4dbba9){var _0x16d751='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4dbba9[_0x1c05('0x2b')]['ContactId'];return db[_0x1c05('0x6e')]['query'](_0x16d751,{'type':db['Sequelize'][_0x1c05('0x6f')]['SELECT'],'raw':!![]})[_0x1c05('0x23')](function(_0xb00a1){return _0xb00a1;});})[_0x1c05('0x23')](function(_0x5c7125){if(_0x5c7125){_0x1e39fa[_0x1c05('0x2b')]['contact']=_0x5c7125[0x0];if(!_0x2a3fbf['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x2a3fbf[_0x1c05('0x5a')][_0x1c05('0x62')],'role':_0x1c05('0x70')},'attributes':['id','name',_0x1c05('0x71'),_0x1c05('0x72'),'internal'],'raw':!![]});}return null;})[_0x1c05('0x23')](function(_0x59caa6){if(!_0x59caa6)return null;_0x1e39fa['message'][_0x1c05('0x70')]=_0x59caa6;return _0x1e39fa;})[_0x1c05('0x23')](function(_0x487e25){if(_0x487e25){if(_0x2a3fbf[_0x1c05('0x5a')][_0x1c05('0x73')]){_0x1e39fa[_0x1c05('0x2b')]['interface']=util[_0x1c05('0x69')](_0x1c05('0x74'),_0x2a3fbf[_0x1c05('0x63')][_0x1c05('0x3b')]);_0x1e39fa[_0x1c05('0x2b')][_0x1c05('0x75')]=_0x1e39fa[_0x1c05('0x75')];_0x1e39fa[_0x1c05('0x2b')][_0x1c05('0x76')]=_0x1e39fa[_0x1c05('0x75')];_0x1e39fa[_0x1c05('0x2b')][_0x1c05('0x77')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x1c05('0x78'),'message':_0x1e39fa[_0x1c05('0x2b')]},client9002)[_0x1c05('0x23')](function(){return _0x1e39fa;});}return _0x1e39fa;}return null;})['then'](respondWithResult(_0x523476,null))[_0x1c05('0x2d')](handleError(_0x523476,null));};var interaction_log=require(_0x1c05('0x15'))('openchannel-interactions');exports[_0x1c05('0x37')]=function(_0x66e432,_0x48f857,_0x5400d3){var _0x55fc0b={'agent':{},'channel':_0x1c05('0x5e')};if(_0x66e432[_0x1c05('0x5a')]['id']){delete _0x66e432[_0x1c05('0x5a')]['id'];}_0x66e432[_0x1c05('0x5a')][_0x1c05('0x62')]=_0x66e432[_0x1c05('0x5a')][_0x1c05('0x62')]||_0x66e432[_0x1c05('0x63')]['id'];_0x55fc0b['agent']['id']=_0x66e432[_0x1c05('0x5a')][_0x1c05('0x62')];return db['OpenchannelMessage'][_0x1c05('0x65')]({'where':{'id':_0x66e432[_0x1c05('0x56')]['id'],'UserId':null}})[_0x1c05('0x23')](handleEntityNotFound(_0x48f857,null))[_0x1c05('0x23')](function(_0x51e283){if(_0x51e283){_0x55fc0b[_0x1c05('0x2b')]=_0x51e283[_0x1c05('0x79')]({'plain':!![]});return db[_0x1c05('0x64')][_0x1c05('0x65')]({'where':{'id':_0x51e283[_0x1c05('0x66')]}});}return null;})[_0x1c05('0x23')](handleEntityNotFound(_0x48f857,null))[_0x1c05('0x23')](function(_0x2f099e){if(_0x2f099e){_0x55fc0b[_0x1c05('0x6a')]=_0x2f099e['get']({'plain':!![]});interaction_log[_0x1c05('0x24')](_0x1c05('0x7a'),_0x66e432[_0x1c05('0x63')]['id'],_0x66e432[_0x1c05('0x63')][_0x1c05('0x3b')],_0x66e432[_0x1c05('0x63')]['role'],_0x55fc0b[_0x1c05('0x6a')]['id'],_0x66e432['body']?JSON[_0x1c05('0x28')](_0x66e432['body']):'null');return respondWithRpcPromise('RejectMessage',_0x1c05('0x7b'),_0x55fc0b);}return null;})[_0x1c05('0x23')](function(_0x32204b){var _0x10fbd9=_0x1c05('0x7c')+_0x32204b[_0x1c05('0x2b')][_0x1c05('0x7d')];return db[_0x1c05('0x6e')]['query'](_0x10fbd9,{'type':db[_0x1c05('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1c05('0x23')](function(_0x31c768){return _0x31c768;});})[_0x1c05('0x23')](function(_0x4a2307){if(_0x4a2307){_0x55fc0b[_0x1c05('0x2b')][_0x1c05('0x7f')]=_0x4a2307[0x0];if(!_0x66e432[_0x1c05('0x5a')][_0x1c05('0x62')])return;return db[_0x1c05('0x80')][_0x1c05('0x65')]({'where':{'id':_0x66e432[_0x1c05('0x5a')][_0x1c05('0x62')],'role':_0x1c05('0x70')},'attributes':['id','name',_0x1c05('0x71'),_0x1c05('0x72'),_0x1c05('0x81')],'raw':!![]});}return null;})[_0x1c05('0x23')](function(_0x4c3a9f){if(!_0x4c3a9f)return null;_0x55fc0b[_0x1c05('0x2b')][_0x1c05('0x70')]=_0x4c3a9f;return _0x55fc0b;})[_0x1c05('0x23')](function(_0x4a2b47){if(_0x4a2b47){_0x4a2b47[_0x1c05('0x2b')]['interface']=util['format'](_0x1c05('0x74'),_0x66e432[_0x1c05('0x63')]['name']);_0x4a2b47[_0x1c05('0x2b')]['channel']=_0x55fc0b[_0x1c05('0x75')];_0x4a2b47[_0x1c05('0x2b')][_0x1c05('0x76')]=_0x55fc0b[_0x1c05('0x75')];_0x4a2b47[_0x1c05('0x2b')][_0x1c05('0x77')]=_0x1c05('0x37');respondWithRpcPromise(_0x1c05('0x82'),_0x1c05('0x82'),{'event':_0x1c05('0x83'),'message':_0x4a2b47[_0x1c05('0x2b')]},client9002);return _0x55fc0b;}return null;})[_0x1c05('0x23')](respondWithResult(_0x48f857,null))['catch'](handleError(_0x48f857,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6c04551..96d1494 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 _0x73dc=['OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x15185b,_0x3d13df){var _0x30bc8e=function(_0x2d3370){while(--_0x2d3370){_0x15185b['push'](_0x15185b['shift']());}};_0x30bc8e(++_0x3d13df);}(_0x73dc,0xd0));var _0xc73d=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0x73dc[_0x1443eb];return _0x2b8810;};'use strict';var EventEmitter=require(_0xc73d('0x0'));var OpenchannelMessage=require(_0xc73d('0x1'))['db'][_0xc73d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc73d('0x3')](0x0);var events={'afterCreate':_0xc73d('0x4'),'afterUpdate':'update','afterDestroy':_0xc73d('0x5')};function emitEvent(_0x10042c){return function(_0x36a372,_0x269812,_0x28ae49){OpenchannelMessageEvents['emit'](_0x10042c+':'+_0x36a372['id'],_0x36a372);OpenchannelMessageEvents[_0xc73d('0x6')](_0x10042c,_0x36a372);_0x28ae49(null);};}for(var e in events){if(events[_0xc73d('0x7')](e)){var event=events[e];OpenchannelMessage[_0xc73d('0x8')](e,emitEvent(event));}}module[_0xc73d('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xec31=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x4b6feb,_0x158c73){var _0x749123=function(_0x1ba59f){while(--_0x1ba59f){_0x4b6feb['push'](_0x4b6feb['shift']());}};_0x749123(++_0x158c73);}(_0xec31,0xa7));var _0x1ec3=function(_0x480a4a,_0x56eabb){_0x480a4a=_0x480a4a-0x0;var _0x34a858=_0xec31[_0x480a4a];return _0x34a858;};'use strict';var EventEmitter=require(_0x1ec3('0x0'));var OpenchannelMessage=require(_0x1ec3('0x1'))['db'][_0x1ec3('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1ec3('0x3')](0x0);var events={'afterCreate':_0x1ec3('0x4'),'afterUpdate':_0x1ec3('0x5'),'afterDestroy':_0x1ec3('0x6')};function emitEvent(_0x25873f){return function(_0x3c5cfc,_0x18def6,_0xc612e){OpenchannelMessageEvents['emit'](_0x25873f+':'+_0x3c5cfc['id'],_0x3c5cfc);OpenchannelMessageEvents[_0x1ec3('0x7')](_0x25873f,_0x3c5cfc);_0xc612e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x1ec3('0x8')](e,emitEvent(event));}}module[_0x1ec3('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index bec7f20..451a055 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 _0xe7f1=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','then','update','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x113c4e,_0x2c05fd){var _0x7cb7ea=function(_0xbeeb28){while(--_0xbeeb28){_0x113c4e['push'](_0x113c4e['shift']());}};_0x7cb7ea(++_0x2c05fd);}(_0xe7f1,0x1a6));var _0x1e7f=function(_0x179679,_0x38a89a){_0x179679=_0x179679-0x0;var _0x28ef55=_0xe7f1[_0x179679];return _0x28ef55;};'use strict';var _=require(_0x1e7f('0x0'));var util=require(_0x1e7f('0x1'));var logger=require(_0x1e7f('0x2'))('api');var moment=require(_0x1e7f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e7f('0x4'));var fs=require('fs');var path=require(_0x1e7f('0x5'));var rimraf=require(_0x1e7f('0x6'));var config=require(_0x1e7f('0x7'));var attributes=require(_0x1e7f('0x8'));module[_0x1e7f('0x9')]=function(_0xf86251,_0x5a06e1){return _0xf86251['define'](_0x1e7f('0xa'),attributes,{'tableName':_0x1e7f('0xb'),'paranoid':![],'indexes':[{'name':_0x1e7f('0xc'),'fields':[_0x1e7f('0xd')],'type':_0x1e7f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x97a2d5,_0x9908af,_0x42de7a){var _0x3061f1=_0xf86251[_0x1e7f('0xf')];var _0x292448=_0x97a2d5[_0x1e7f('0x10')]({'plain':!![]});if(_0x292448[_0x1e7f('0x11')]['toLowerCase']()==='in'||_0x292448['direction'][_0x1e7f('0x12')]()===_0x1e7f('0x13')&&!_0x292448[_0x1e7f('0x14')]&&!_['isNil'](_0x292448[_0x1e7f('0x15')])){_0x3061f1[_0x1e7f('0x16')][_0x1e7f('0x17')]({'where':{'id':_0x292448['OpenchannelInteractionId']}})[_0x1e7f('0x18')](function(_0x2f3f59){if(_0x2f3f59){_0x2f3f59[_0x1e7f('0x19')]({'lastMsgAt':_0x292448['createdAt'],'lastMsgDirection':_0x292448[_0x1e7f('0x11')]['toLowerCase']()});}})[_0x1e7f('0x1a')](function(_0x257e4a){console[_0x1e7f('0x1b')](_0x257e4a);});}if(_0x292448[_0x1e7f('0x11')]===_0x1e7f('0x13')&&!_0x292448[_0x1e7f('0x14')]){var _0x3c43b0;_0x3061f1[_0x1e7f('0x1c')][_0x1e7f('0x1d')]()[_0x1e7f('0x18')](function(_0x449bc3){return _0x3061f1[_0x1e7f('0x1e')][_0x1e7f('0x1f')]({'where':{'id':_0x292448[_0x1e7f('0x20')]},'include':[{'model':_0x3061f1[_0x1e7f('0x16')],'as':_0x1e7f('0x21'),'where':{'id':_0x292448[_0x1e7f('0x22')]},'limit':0x1,'include':[{'model':_0x3061f1[_0x1e7f('0x1c')],'as':_0x1e7f('0x23'),'attributes':_[_0x1e7f('0x24')](_0x449bc3)}]}]});})[_0x1e7f('0x18')](function(_0x1e57d0){_0x3c43b0=_0x1e57d0[_0x1e7f('0x10')]({'plain':!![]});if(_0x3c43b0&&_0x3c43b0[_0x1e7f('0x25')]){logger[_0x1e7f('0x26')](_0x1e7f('0x27'),_0x1e7f('0x28'),util[_0x1e7f('0x29')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x292448['id'],_0x3c43b0[_0x1e7f('0x25')]));if(_0x3c43b0[_0x1e7f('0x21')]&&_0x3c43b0[_0x1e7f('0x21')]['length']){_0x292448[_0x1e7f('0x2a')]=_[_0x1e7f('0x2b')](_0x3c43b0[_0x1e7f('0x21')][0x0],_0x1e7f('0x23'));_0x292448['Contact']=_0x3c43b0['Interactions'][0x0]['Contact'];}var _0x9908af={'method':_0x1e7f('0x2c'),'uri':encodeURI(_0x3c43b0[_0x1e7f('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x9908af[_0x1e7f('0x2d')]){case _0x1e7f('0x2e'):_0x9908af['qs']=_0x292448;break;case _0x1e7f('0x2c'):_0x9908af[_0x1e7f('0xd')]=_0x292448;break;}return rp(_0x9908af)[_0x1e7f('0x18')](function(_0x131f26){logger[_0x1e7f('0x26')](_0x1e7f('0x27'),'afterCreate',util[_0x1e7f('0x29')](_0x1e7f('0x2f'),_0x292448['id'],_0x3c43b0[_0x1e7f('0x25')]));if(_0x131f26[_0x1e7f('0xd')][_0x1e7f('0x30')]&&_0x131f26['body'][_0x1e7f('0x30')]!=_0x292448[_0x1e7f('0x2a')][_0x1e7f('0x30')]){return _0x3061f1[_0x1e7f('0x16')][_0x1e7f('0x19')]({'threadId':_0x131f26['body'][_0x1e7f('0x30')]},{'where':{'id':_0x292448[_0x1e7f('0x2a')]['id']}});}else{return;}})[_0x1e7f('0x18')](function(){return _0x97a2d5['update']({'read':!![]});})[_0x1e7f('0x1a')](function(_0x4a2561){logger[_0x1e7f('0x1b')](_0x1e7f('0x27'),_0x1e7f('0x28'),util[_0x1e7f('0x31')](_0x4a2561,{'showHidden':![],'depth':null}));_0x42de7a();});}else{_0x42de7a();}})[_0x1e7f('0x32')](function(){_0x42de7a();});}else{_0x42de7a();}}},'charset':_0x1e7f('0x33'),'collate':_0x1e7f('0x34')});}; \ No newline at end of file +var _0x3806=['threadId','update','finally','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s'];(function(_0x1daa7a,_0x4ec4bd){var _0x1e4da3=function(_0x5cc820){while(--_0x5cc820){_0x1daa7a['push'](_0x1daa7a['shift']());}};_0x1e4da3(++_0x4ec4bd);}(_0x3806,0x14c));var _0x6380=function(_0x2d4276,_0x544dc1){_0x2d4276=_0x2d4276-0x0;var _0x21f410=_0x3806[_0x2d4276];return _0x21f410;};'use strict';var _=require(_0x6380('0x0'));var util=require('util');var logger=require(_0x6380('0x1'))(_0x6380('0x2'));var moment=require(_0x6380('0x3'));var BPromise=require('bluebird');var rp=require(_0x6380('0x4'));var fs=require('fs');var path=require(_0x6380('0x5'));var rimraf=require(_0x6380('0x6'));var config=require('../../config/environment');var attributes=require(_0x6380('0x7'));module[_0x6380('0x8')]=function(_0x1cd994,_0x227bff){return _0x1cd994['define'](_0x6380('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x6380('0xa'),'fields':[_0x6380('0xb')],'type':_0x6380('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b52ce,_0x23fba8,_0x255966){var _0xe3f714=_0x1cd994[_0x6380('0xd')];var _0x98ece1=_0x5b52ce[_0x6380('0xe')]({'plain':!![]});if(_0x98ece1['direction'][_0x6380('0xf')]()==='in'||_0x98ece1[_0x6380('0x10')][_0x6380('0xf')]()===_0x6380('0x11')&&!_0x98ece1[_0x6380('0x12')]&&!_['isNil'](_0x98ece1['UserId'])){_0xe3f714[_0x6380('0x13')][_0x6380('0x14')]({'where':{'id':_0x98ece1[_0x6380('0x15')]}})['then'](function(_0xef514a){if(_0xef514a){_0xef514a['update']({'lastMsgAt':_0x98ece1[_0x6380('0x16')],'lastMsgDirection':_0x98ece1[_0x6380('0x10')][_0x6380('0xf')]()});}})[_0x6380('0x17')](function(_0x4c41b3){console[_0x6380('0x18')](_0x4c41b3);});}if(_0x98ece1[_0x6380('0x10')]==='out'&&!_0x98ece1[_0x6380('0x12')]){var _0x3844e6;_0xe3f714[_0x6380('0x19')][_0x6380('0x1a')]()[_0x6380('0x1b')](function(_0x1a4d0f){return _0xe3f714[_0x6380('0x1c')]['find']({'where':{'id':_0x98ece1['OpenchannelAccountId']},'include':[{'model':_0xe3f714[_0x6380('0x13')],'as':_0x6380('0x1d'),'where':{'id':_0x98ece1[_0x6380('0x15')]},'limit':0x1,'include':[{'model':_0xe3f714['CmContact'],'as':_0x6380('0x1e'),'attributes':_[_0x6380('0x1f')](_0x1a4d0f)}]}]});})['then'](function(_0x4af10f){_0x3844e6=_0x4af10f[_0x6380('0xe')]({'plain':!![]});if(_0x3844e6&&_0x3844e6[_0x6380('0x20')]){logger[_0x6380('0x21')](_0x6380('0x22'),'afterCreate',util[_0x6380('0x23')](_0x6380('0x24'),_0x98ece1['id'],_0x3844e6[_0x6380('0x20')]));if(_0x3844e6[_0x6380('0x1d')]&&_0x3844e6[_0x6380('0x1d')][_0x6380('0x25')]){_0x98ece1[_0x6380('0x26')]=_[_0x6380('0x27')](_0x3844e6[_0x6380('0x1d')][0x0],_0x6380('0x1e'));_0x98ece1[_0x6380('0x1e')]=_0x3844e6[_0x6380('0x1d')][0x0][_0x6380('0x1e')];}var _0x23fba8={'method':_0x6380('0x28'),'uri':encodeURI(_0x3844e6['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x23fba8[_0x6380('0x29')]){case'GET':_0x23fba8['qs']=_0x98ece1;break;case'POST':_0x23fba8['body']=_0x98ece1;break;}return rp(_0x23fba8)[_0x6380('0x1b')](function(_0x335f5b){logger[_0x6380('0x21')](_0x6380('0x22'),_0x6380('0x2a'),util[_0x6380('0x23')](_0x6380('0x2b'),_0x98ece1['id'],_0x3844e6[_0x6380('0x20')]));if(_0x335f5b[_0x6380('0xb')]['threadId']&&_0x335f5b[_0x6380('0xb')][_0x6380('0x2c')]!=_0x98ece1[_0x6380('0x26')][_0x6380('0x2c')]){return _0xe3f714[_0x6380('0x13')][_0x6380('0x2d')]({'threadId':_0x335f5b[_0x6380('0xb')][_0x6380('0x2c')]},{'where':{'id':_0x98ece1[_0x6380('0x26')]['id']}});}else{return;}})['then'](function(){return _0x5b52ce['update']({'read':!![]});})[_0x6380('0x17')](function(_0xdb7199){logger[_0x6380('0x18')](_0x6380('0x22'),'afterCreate',util['inspect'](_0xdb7199,{'showHidden':![],'depth':null}));_0x255966();});}else{_0x255966();}})[_0x6380('0x2e')](function(){_0x255966();});}else{_0x255966();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 434c344..ac9e7ee 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2a9981,_0x3215f6){var _0x325a34=function(_0x4f282a){while(--_0x4f282a){_0x2a9981['push'](_0x2a9981['shift']());}};_0x325a34(++_0x3215f6);}(_0x7a54,0x106));var _0x47a5=function(_0x3c878e,_0x4865ae){_0x3c878e=_0x3c878e-0x0;var _0x50fdbe=_0x7a54[_0x3c878e];return _0x50fdbe;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x22754d,_0x3ffa6b){var _0x4e2724=function(_0x3e4691){while(--_0x3e4691){_0x22754d['push'](_0x22754d['shift']());}};_0x4e2724(++_0x3ffa6b);}(_0xdb28,0x106));var _0x8db2=function(_0x14aafa,_0x1a5995){_0x14aafa=_0x14aafa-0x0;var _0x27ce00=_0xdb28[_0x14aafa];return _0x27ce00;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index adeb543..6623c6a 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 _0x46fa=['remove','update','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x325a0f,_0x431b5b){var _0x56af51=function(_0x2fc89f){while(--_0x2fc89f){_0x325a0f['push'](_0x325a0f['shift']());}};_0x56af51(++_0x431b5b);}(_0x46fa,0x76));var _0xa46f=function(_0x39a1aa,_0x4c8162){_0x39a1aa=_0x39a1aa-0x0;var _0x28d3cb=_0x46fa[_0x39a1aa];return _0x28d3cb;};'use strict';var OpenchannelMessageEvents=require(_0xa46f('0x0'));var events=['save',_0xa46f('0x1'),_0xa46f('0x2')];function createListener(_0x29d513,_0x489aba){return function(_0x550c23){_0x489aba[_0xa46f('0x3')](_0x29d513,_0x550c23);};}function removeListener(_0x16de5b,_0xd00f3c){return function(){OpenchannelMessageEvents['removeListener'](_0x16de5b,_0xd00f3c);};}exports[_0xa46f('0x4')]=function(_0x50cff6){for(var _0x5ea799=0x0,_0x43b2cf=events[_0xa46f('0x5')];_0x5ea799<_0x43b2cf;_0x5ea799++){var _0x52dd73=events[_0x5ea799];var _0x5a23a3=createListener(_0xa46f('0x6')+_0x52dd73,_0x50cff6);OpenchannelMessageEvents['on'](_0x52dd73,_0x5a23a3);}}; \ No newline at end of file +var _0xfa3a=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit'];(function(_0x1b2db8,_0x337cbf){var _0x5c24f3=function(_0x31b304){while(--_0x31b304){_0x1b2db8['push'](_0x1b2db8['shift']());}};_0x5c24f3(++_0x337cbf);}(_0xfa3a,0xa6));var _0xafa3=function(_0x4a7874,_0x5464ed){_0x4a7874=_0x4a7874-0x0;var _0x336b94=_0xfa3a[_0x4a7874];return _0x336b94;};'use strict';var OpenchannelMessageEvents=require(_0xafa3('0x0'));var events=[_0xafa3('0x1'),_0xafa3('0x2'),_0xafa3('0x3')];function createListener(_0xf3d662,_0x2b6d94){return function(_0x36a15b){_0x2b6d94[_0xafa3('0x4')](_0xf3d662,_0x36a15b);};}function removeListener(_0x49410f,_0x29b287){return function(){OpenchannelMessageEvents[_0xafa3('0x5')](_0x49410f,_0x29b287);};}exports[_0xafa3('0x6')]=function(_0x1e3b62){for(var _0x21e8f9=0x0,_0x1cc2fd=events[_0xafa3('0x7')];_0x21e8f9<_0x1cc2fd;_0x21e8f9++){var _0x5297a6=events[_0x21e8f9];var _0x22f539=createListener(_0xafa3('0x8')+_0x5297a6,_0x1e3b62);OpenchannelMessageEvents['on'](_0x5297a6,_0x22f539);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c243d29..82d9ae0 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 _0xfb07=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfb07,0xfd));var _0x7fb0=function(_0x580848,_0x6a7cf6){_0x580848=_0x580848-0x0;var _0x247cae=_0xfb07[_0x580848];return _0x247cae;};'use strict';var multer=require(_0x7fb0('0x0'));var util=require(_0x7fb0('0x1'));var path=require(_0x7fb0('0x2'));var timeout=require(_0x7fb0('0x3'));var express=require('express');var router=express[_0x7fb0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7fb0('0x5'));var interaction=require(_0x7fb0('0x6'));var config=require(_0x7fb0('0x7'));var controller=require(_0x7fb0('0x8'));router[_0x7fb0('0x9')]('/',auth['isAuthenticated'](),controller[_0x7fb0('0xa')]);router[_0x7fb0('0x9')](_0x7fb0('0xb'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0xd')]);router[_0x7fb0('0x9')](_0x7fb0('0xe'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0xf')]);router[_0x7fb0('0x9')](_0x7fb0('0x10'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x11')]);router[_0x7fb0('0x9')](_0x7fb0('0x12'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x13')]);router[_0x7fb0('0x9')](_0x7fb0('0x14'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x15')]);router[_0x7fb0('0x16')]('/',auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x17')]);router[_0x7fb0('0x16')](_0x7fb0('0x12'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x18')]);router[_0x7fb0('0x16')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x7fb0('0x19')](_0x7fb0('0xe'),auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x1a')]);router[_0x7fb0('0x1b')](_0x7fb0('0xe'),auth[_0x7fb0('0xc')](),controller['destroy']);router[_0x7fb0('0x1b')]('/:id/teams',auth[_0x7fb0('0xc')](),controller[_0x7fb0('0x1c')]);router['delete'](_0x7fb0('0x14'),auth['isAuthenticated'](),controller[_0x7fb0('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x0484=['show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2b6249,_0x5f5345){var _0x28cd3c=function(_0x65fd75){while(--_0x65fd75){_0x2b6249['push'](_0x2b6249['shift']());}};_0x28cd3c(++_0x5f5345);}(_0x0484,0x190));var _0x4048=function(_0x3a2082,_0x579236){_0x3a2082=_0x3a2082-0x0;var _0x55beaa=_0x0484[_0x3a2082];return _0x55beaa;};'use strict';var multer=require(_0x4048('0x0'));var util=require(_0x4048('0x1'));var path=require(_0x4048('0x2'));var timeout=require(_0x4048('0x3'));var express=require(_0x4048('0x4'));var router=express['Router']();var fs_extra=require(_0x4048('0x5'));var auth=require(_0x4048('0x6'));var interaction=require(_0x4048('0x7'));var config=require(_0x4048('0x8'));var controller=require(_0x4048('0x9'));router[_0x4048('0xa')]('/',auth[_0x4048('0xb')](),controller[_0x4048('0xc')]);router[_0x4048('0xa')](_0x4048('0xd'),auth[_0x4048('0xb')](),controller[_0x4048('0xe')]);router['get'](_0x4048('0xf'),auth[_0x4048('0xb')](),controller[_0x4048('0x10')]);router[_0x4048('0xa')](_0x4048('0x11'),auth[_0x4048('0xb')](),controller[_0x4048('0x12')]);router[_0x4048('0xa')]('/:id/teams',auth[_0x4048('0xb')](),controller[_0x4048('0x13')]);router[_0x4048('0xa')](_0x4048('0x14'),auth['isAuthenticated'](),controller[_0x4048('0x15')]);router['post']('/',auth[_0x4048('0xb')](),controller['create']);router[_0x4048('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4048('0x17')]);router[_0x4048('0x16')](_0x4048('0x14'),auth[_0x4048('0xb')](),controller[_0x4048('0x18')]);router[_0x4048('0x19')](_0x4048('0xf'),auth['isAuthenticated'](),controller[_0x4048('0x1a')]);router[_0x4048('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x4048('0x1c')]);router[_0x4048('0x1b')](_0x4048('0x1d'),auth['isAuthenticated'](),controller[_0x4048('0x1e')]);router[_0x4048('0x1b')](_0x4048('0x14'),auth[_0x4048('0xb')](),controller[_0x4048('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 00b17d6..d55012d 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 _0xc088=['STRING','INTEGER','rrmemory','sequelize'];(function(_0x54d54f,_0x5b213a){var _0x3b8908=function(_0x4c6c4b){while(--_0x4c6c4b){_0x54d54f['push'](_0x54d54f['shift']());}};_0x3b8908(++_0x5b213a);}(_0xc088,0x143));var _0x8c08=function(_0x1133fc,_0x324619){_0x1133fc=_0x1133fc-0x0;var _0x320a68=_0xc088[_0x1133fc];return _0x320a68;};'use strict';var Sequelize=require(_0x8c08('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c08('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8c08('0x1')]},'timeout':{'type':Sequelize[_0x8c08('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8c08('0x3'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x35b1=['roundrobin','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x32bbb1,_0xa0e27e){var _0x42b415=function(_0x23f4e2){while(--_0x23f4e2){_0x32bbb1['push'](_0x32bbb1['shift']());}};_0x42b415(++_0xa0e27e);}(_0x35b1,0x1ba));var _0x135b=function(_0x324645,_0xdc9c60){_0x324645=_0x324645-0x0;var _0x518909=_0x35b1[_0x324645];return _0x518909;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x135b('0x0')],'unique':_0x135b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x135b('0x0')]},'timeout':{'type':Sequelize[_0x135b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x135b('0x3')](_0x135b('0x4'),_0x135b('0x5'),_0x135b('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f7ba488..2b76e05 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 _0xa198=['userOpenchannelQueue:save','removeAgents','isArray','getAgents','bluebird','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','update','OpenchannelQueues','UserProfileResource','then','sendStatus','error','stack','index','map','rawAttributes','fieldName','key','getOptions','OpenchannelQueue','include','query','findAll','catch','show','params','keys','filters','intersection','model','fields','attributes','length','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','findOne','get','UserOpenchannelQueue','nolimit','order','sort','where','pick','OpenchannelQueueId','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','userOpenchannelQueue:remove','addAgents','omit'];(function(_0x4432f7,_0x1a3e8c){var _0x1d0d6d=function(_0x2a335e){while(--_0x2a335e){_0x4432f7['push'](_0x4432f7['shift']());}};_0x1d0d6d(++_0x1a3e8c);}(_0xa198,0xf8));var _0x8a19=function(_0x32fdcb,_0x1c6168){_0x32fdcb=_0x32fdcb-0x0;var _0x5d9dda=_0xa198[_0x32fdcb];return _0x5d9dda;};'use strict';var BPromise=require(_0x8a19('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0x8a19('0x1'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x8a19('0x2'))(_0x8a19('0x3'));var config=require(_0x8a19('0x4'));var db=require(_0x8a19('0x5'))['db'];config[_0x8a19('0x6')]=_[_0x8a19('0x7')](config[_0x8a19('0x6')],{'host':_0x8a19('0x8'),'port':0x18eb});var socket=require(_0x8a19('0x9'))(new Redis(config[_0x8a19('0x6')]));require(_0x8a19('0xa'))['register'](socket);function respondWithStatusCode(_0x2b2a1d,_0x3fa166){_0x3fa166=_0x3fa166||0xcc;return function(_0x124fdb){if(_0x124fdb){return _0x2b2a1d['sendStatus'](_0x3fa166);}return _0x2b2a1d[_0x8a19('0xb')](_0x3fa166)[_0x8a19('0xc')]();};}function respondWithResult(_0xabd9c7,_0x5a36b2){_0x5a36b2=_0x5a36b2||0xc8;return function(_0x4f69a9){if(_0x4f69a9){return _0xabd9c7[_0x8a19('0xb')](_0x5a36b2)[_0x8a19('0xd')](_0x4f69a9);}};}function respondWithFilteredResult(_0x24baf2,_0x5551e1){return function(_0x19039a){if(_0x19039a){var _0x5cb375=typeof _0x5551e1[_0x8a19('0xe')]===_0x8a19('0xf')&&typeof _0x5551e1['limit']===_0x8a19('0xf');var _0x57a497=_0x19039a[_0x8a19('0x10')];var _0x5bb6fe=_0x5cb375?0x0:_0x5551e1[_0x8a19('0xe')];var _0x1cd765=_0x5cb375?_0x19039a[_0x8a19('0x10')]:_0x5551e1['offset']+_0x5551e1[_0x8a19('0x11')];var _0x11a964;if(_0x1cd765>=_0x57a497){_0x1cd765=_0x57a497;_0x11a964=0xc8;}else{_0x11a964=0xce;}_0x24baf2[_0x8a19('0xb')](_0x11a964);return _0x24baf2[_0x8a19('0x12')](_0x8a19('0x13'),_0x5bb6fe+'-'+_0x1cd765+'/'+_0x57a497)['json'](_0x19039a);}return null;};}function saveUpdates(_0x4de19e){return function(_0x5cc4ef){if(_0x5cc4ef){return _0x5cc4ef[_0x8a19('0x14')](_0x4de19e)['then'](function(_0x3ecec4){return _0x3ecec4;});}return null;};}function removeEntity(_0x2ddef3){return function(_0x233a1e){if(_0x233a1e){return _0x233a1e['destroy']()['then'](function(){var _0x405a0c=_0x233a1e['get']({'plain':!![]});var _0x42b6e5=_0x8a19('0x15');return db[_0x8a19('0x16')]['destroy']({'where':{'type':_0x42b6e5,'resourceId':_0x405a0c['id']}})[_0x8a19('0x17')](function(){return _0x233a1e;});})['then'](function(){_0x2ddef3[_0x8a19('0xb')](0xcc)[_0x8a19('0xc')]();});}};}function handleEntityNotFound(_0x5eff9c){return function(_0x2e2a23){if(!_0x2e2a23){_0x5eff9c[_0x8a19('0x18')](0x194);}return _0x2e2a23;};}function handleError(_0x2c832f,_0x3c06ae){_0x3c06ae=_0x3c06ae||0x1f4;return function(_0x30d933){logger[_0x8a19('0x19')](_0x30d933[_0x8a19('0x1a')]);if(_0x30d933['name']){delete _0x30d933['name'];}_0x2c832f['status'](_0x3c06ae)['send'](_0x30d933);};}exports[_0x8a19('0x1b')]=function(_0x262b10,_0x36588d){var _0x3ab936={};var _0x1f307b={'count':0x0,'rows':[]};var _0x33db91=_[_0x8a19('0x1c')](db['OpenchannelQueue'][_0x8a19('0x1d')],function(_0x163f4f){return{'name':_0x163f4f[_0x8a19('0x1e')],'type':_0x163f4f['type'][_0x8a19('0x1f')]};});_0x3ab936=qs[_0x8a19('0x20')](_0x33db91,_0x262b10);var _0x43814a={'where':_0x3ab936['where']};return db[_0x8a19('0x21')]['count'](_0x43814a)[_0x8a19('0x17')](function(_0xa6d62d){_0x1f307b['count']=_0xa6d62d;_0x3ab936['include']=qs[_0x8a19('0x22')](_0x262b10[_0x8a19('0x23')]);return db['OpenchannelQueue'][_0x8a19('0x24')](_0x3ab936);})['then'](function(_0x14ad57){_0x1f307b['rows']=_0x14ad57;return _0x1f307b;})['then'](respondWithFilteredResult(_0x36588d,_0x3ab936))[_0x8a19('0x25')](handleError(_0x36588d,null));};exports[_0x8a19('0x26')]=function(_0x350c3d,_0x3d2502){var _0x43824b={'raw':!![],'where':{'id':_0x350c3d[_0x8a19('0x27')]['id']}},_0x1d7ccb={};_0x1d7ccb['model']=_[_0x8a19('0x28')](db[_0x8a19('0x21')][_0x8a19('0x1d')]);_0x1d7ccb[_0x8a19('0x23')]=_[_0x8a19('0x28')](_0x350c3d[_0x8a19('0x23')]);_0x1d7ccb[_0x8a19('0x29')]=_[_0x8a19('0x2a')](_0x1d7ccb[_0x8a19('0x2b')],_0x1d7ccb[_0x8a19('0x23')]);_0x43824b['attributes']=_[_0x8a19('0x2a')](_0x1d7ccb[_0x8a19('0x2b')],qs[_0x8a19('0x2c')](_0x350c3d[_0x8a19('0x23')][_0x8a19('0x2c')]));_0x43824b[_0x8a19('0x2d')]=_0x43824b['attributes'][_0x8a19('0x2e')]?_0x43824b[_0x8a19('0x2d')]:_0x1d7ccb['model'];if(_0x350c3d['query'][_0x8a19('0x2f')]){_0x43824b[_0x8a19('0x22')]=[{'all':!![]}];}_0x43824b=_[_0x8a19('0x30')]({},_0x43824b,_0x350c3d[_0x8a19('0x31')]);return db[_0x8a19('0x21')][_0x8a19('0x32')](_0x43824b)[_0x8a19('0x17')](handleEntityNotFound(_0x3d2502,null))[_0x8a19('0x17')](respondWithResult(_0x3d2502,null))[_0x8a19('0x25')](handleError(_0x3d2502,null));};exports['create']=function(_0x581f6c,_0x259e45){return db[_0x8a19('0x21')][_0x8a19('0x33')](_0x581f6c['body'],{})[_0x8a19('0x17')](function(_0x454835){var _0x1d4f60=_0x581f6c['user']['get']({'plain':!![]});if(!_0x1d4f60)throw new Error(_0x8a19('0x34'));if(_0x1d4f60[_0x8a19('0x35')]==='user'){var _0x3a5994=_0x454835['get']({'plain':!![]});var _0x823efc=_0x8a19('0x15');return db[_0x8a19('0x36')][_0x8a19('0x32')]({'where':{'name':_0x823efc,'userProfileId':_0x1d4f60[_0x8a19('0x37')]},'raw':!![]})['then'](function(_0x14b352){if(_0x14b352&&_0x14b352[_0x8a19('0x38')]===0x0){return db[_0x8a19('0x16')][_0x8a19('0x33')]({'name':_0x3a5994[_0x8a19('0x39')],'resourceId':_0x3a5994['id'],'type':_0x14b352[_0x8a19('0x39')],'sectionId':_0x14b352['id']},{})[_0x8a19('0x17')](function(){return _0x454835;});}else{return _0x454835;}})['catch'](function(_0x1a3eec){logger[_0x8a19('0x19')](_0x8a19('0x3a'),_0x1a3eec);throw _0x1a3eec;});}return _0x454835;})[_0x8a19('0x17')](respondWithResult(_0x259e45,0xc9))[_0x8a19('0x25')](handleError(_0x259e45,null));};exports[_0x8a19('0x14')]=function(_0x5cd1c9,_0x5f189b){if(_0x5cd1c9['body']['id']){delete _0x5cd1c9[_0x8a19('0x3b')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x5cd1c9[_0x8a19('0x27')]['id']}})[_0x8a19('0x17')](handleEntityNotFound(_0x5f189b,null))[_0x8a19('0x17')](saveUpdates(_0x5cd1c9[_0x8a19('0x3b')],null))['then'](respondWithResult(_0x5f189b,null))[_0x8a19('0x25')](handleError(_0x5f189b,null));};exports[_0x8a19('0x3c')]=function(_0x1f44af,_0x2adf1a){return db['OpenchannelQueue']['find']({'where':{'id':_0x1f44af[_0x8a19('0x27')]['id']}})['then'](handleEntityNotFound(_0x2adf1a,null))[_0x8a19('0x17')](removeEntity(_0x2adf1a,null))[_0x8a19('0x25')](handleError(_0x2adf1a,null));};exports[_0x8a19('0x3d')]=function(_0x323004,_0x276aea){return db[_0x8a19('0x21')][_0x8a19('0x3d')]()['then'](respondWithResult(_0x276aea,null))[_0x8a19('0x25')](handleError(_0x276aea,null));};exports['getMembers']=function(_0xdeb0ff,_0x475bcb){var _0x162816={'raw':!![],'where':{}},_0x348a49={},_0x281676;return db[_0x8a19('0x21')][_0x8a19('0x3e')]({'where':{'id':_0xdeb0ff[_0x8a19('0x27')]['id']}})[_0x8a19('0x17')](handleEntityNotFound(_0x475bcb,null))['then'](function(_0x1ac297){if(_0x1ac297){_0x281676=_0x1ac297[_0x8a19('0x3f')]({'plain':!![]});_0x348a49[_0x8a19('0x2b')]=_[_0x8a19('0x28')](db[_0x8a19('0x40')][_0x8a19('0x1d')]);_0x348a49['query']=_['keys'](_0xdeb0ff['query']);_0x348a49['filters']=_[_0x8a19('0x2a')](_0x348a49[_0x8a19('0x2b')],_0x348a49[_0x8a19('0x23')]);_0x162816[_0x8a19('0x2d')]=_[_0x8a19('0x2a')](_0x348a49['model'],qs['fields'](_0xdeb0ff[_0x8a19('0x23')][_0x8a19('0x2c')]));_0x162816[_0x8a19('0x2d')]=_0x162816[_0x8a19('0x2d')][_0x8a19('0x2e')]?_0x162816[_0x8a19('0x2d')]:_0x348a49[_0x8a19('0x2b')];if(!_0xdeb0ff['query']['hasOwnProperty'](_0x8a19('0x41'))){_0x162816[_0x8a19('0x11')]=qs['limit'](_0xdeb0ff['query']['limit']);_0x162816[_0x8a19('0xe')]=qs[_0x8a19('0xe')](_0xdeb0ff[_0x8a19('0x23')]['offset']);}_0x162816[_0x8a19('0x42')]=qs['sort'](_0xdeb0ff[_0x8a19('0x23')][_0x8a19('0x43')]);_0x162816[_0x8a19('0x44')]=qs['filters'](_[_0x8a19('0x45')](_0xdeb0ff['query'],_0x348a49[_0x8a19('0x29')]));_0x162816[_0x8a19('0x44')][_0x8a19('0x46')]=_0x1ac297['id'];if(_0xdeb0ff[_0x8a19('0x23')]['filter']){_0x162816[_0x8a19('0x44')]=_[_0x8a19('0x30')](_0x162816[_0x8a19('0x44')],{'$or':_[_0x8a19('0x1c')](_0x162816[_0x8a19('0x2d')],function(_0x4ebc34){var _0x3ad48a={};_0x3ad48a[_0x4ebc34]={'$like':'%'+_0xdeb0ff[_0x8a19('0x23')][_0x8a19('0x47')]+'%'};return _0x3ad48a;})});}_0x162816=_['merge']({},_0x162816,_0xdeb0ff[_0x8a19('0x31')]);return db[_0x8a19('0x40')][_0x8a19('0x24')](_0x162816);}})[_0x8a19('0x17')](function(_0x3a8323){if(_0x3a8323){return db[_0x8a19('0x48')][_0x8a19('0x49')]({'where':{'id':_[_0x8a19('0x1c')](_0x3a8323,_0x8a19('0x4a')),'role':'agent'},'attributes':['id',_0x8a19('0x39'),_0x8a19('0x4b'),_0x8a19('0x4c'),_0x8a19('0x4d')]});}})[_0x8a19('0x17')](function(_0x360452){if(_0x360452){return{'count':_0x360452[_0x8a19('0x10')],'rows':_['map'](_0x360452['rows'],function(_0x4f2b8c){return{'membername':_0x4f2b8c['name'],'UserId':_0x4f2b8c['id'],'queue_name':_0x281676[_0x8a19('0x39')],'OpenchannelQueueId':_0x281676['id'],'interface':util[_0x8a19('0x4e')](_0x8a19('0x4f'),_0x8a19('0x50'),_0x4f2b8c[_0x8a19('0x39')]),'penalty':0x0,'paused':_0x4f2b8c[_0x8a19('0x4b')],'createdAt':_0x4f2b8c[_0x8a19('0x4d')],'updatedAt':_0x4f2b8c[_0x8a19('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a19('0x17')](respondWithFilteredResult(_0x475bcb,_0x162816))[_0x8a19('0x25')](handleError(_0x475bcb,null));};exports[_0x8a19('0x51')]=function(_0x11cdb7,_0x2b41d3){var _0x3602ec={};var _0x5b58e6={};var _0x2912d8;var _0x3354ab;return db['OpenchannelQueue'][_0x8a19('0x3e')]({'where':{'id':_0x11cdb7[_0x8a19('0x27')]['id']}})['then'](handleEntityNotFound(_0x2b41d3,null))[_0x8a19('0x17')](function(_0x55ae21){if(_0x55ae21){_0x2912d8=_0x55ae21;_0x5b58e6[_0x8a19('0x2b')]=_[_0x8a19('0x28')](db[_0x8a19('0x52')][_0x8a19('0x1d')]);_0x5b58e6[_0x8a19('0x23')]=_[_0x8a19('0x28')](_0x11cdb7[_0x8a19('0x23')]);_0x5b58e6['filters']=_[_0x8a19('0x2a')](_0x5b58e6[_0x8a19('0x2b')],_0x5b58e6[_0x8a19('0x23')]);_0x3602ec[_0x8a19('0x2d')]=_[_0x8a19('0x2a')](_0x5b58e6[_0x8a19('0x2b')],qs[_0x8a19('0x2c')](_0x11cdb7[_0x8a19('0x23')][_0x8a19('0x2c')]));_0x3602ec[_0x8a19('0x2d')]=_0x3602ec[_0x8a19('0x2d')]['length']?_0x3602ec[_0x8a19('0x2d')]:_0x5b58e6['model'];_0x3602ec[_0x8a19('0x42')]=qs['sort'](_0x11cdb7[_0x8a19('0x23')][_0x8a19('0x43')]);_0x3602ec[_0x8a19('0x44')]=qs[_0x8a19('0x29')](_[_0x8a19('0x45')](_0x11cdb7[_0x8a19('0x23')],_0x5b58e6[_0x8a19('0x29')]));if(_0x11cdb7[_0x8a19('0x23')][_0x8a19('0x47')]){_0x3602ec[_0x8a19('0x44')]=_['merge'](_0x3602ec['where'],{'$or':_[_0x8a19('0x1c')](_0x3602ec[_0x8a19('0x2d')],function(_0xf2cbc4){var _0x5bb923={};_0x5bb923[_0xf2cbc4]={'$like':'%'+_0x11cdb7['query'][_0x8a19('0x47')]+'%'};return _0x5bb923;})});}_0x3602ec=_[_0x8a19('0x30')]({},_0x3602ec,_0x11cdb7['options']);return _0x2912d8[_0x8a19('0x51')](_0x3602ec);}})[_0x8a19('0x17')](function(_0x8bb4cc){if(_0x8bb4cc){_0x3354ab=_0x8bb4cc[_0x8a19('0x2e')];if(!_0x11cdb7[_0x8a19('0x23')][_0x8a19('0x53')]('nolimit')){_0x3602ec['limit']=qs[_0x8a19('0x11')](_0x11cdb7['query'][_0x8a19('0x11')]);_0x3602ec[_0x8a19('0xe')]=qs[_0x8a19('0xe')](_0x11cdb7['query'][_0x8a19('0xe')]);}return _0x2912d8[_0x8a19('0x51')](_0x3602ec);}})[_0x8a19('0x17')](function(_0x29ef64){if(_0x29ef64){return _0x29ef64?{'count':_0x3354ab,'rows':_0x29ef64}:null;}})[_0x8a19('0x17')](respondWithResult(_0x2b41d3,null))[_0x8a19('0x25')](handleError(_0x2b41d3,null));};exports[_0x8a19('0x54')]=function(_0xcee2a3,_0x2a92ca){var _0x219bcf=_0xcee2a3[_0x8a19('0x3b')]['ids'];return db[_0x8a19('0x52')][_0x8a19('0x24')]({'where':{'id':_0x219bcf},'attributes':['id'],'include':[{'model':db[_0x8a19('0x48')],'as':_0x8a19('0x55'),'attributes':['id',_0x8a19('0x39'),_0x8a19('0x56'),_0x8a19('0x57'),_0x8a19('0x58')],'raw':!![]}]})[_0x8a19('0x17')](function(_0x585813){if(_0x585813){var _0x319cc9=_[_0x8a19('0x59')](_0x585813,function(_0x4db6b8){var _0x1786cc=_0x4db6b8[_0x8a19('0x3f')]({'plain':!![]});return _0x1786cc['Agents'];});return db[_0x8a19('0x21')][_0x8a19('0x32')]({'where':{'id':_0xcee2a3[_0x8a19('0x27')]['id']}})['then'](function(_0x365b8b){return db[_0x8a19('0x5a')][_0x8a19('0x5b')](function(_0x1bd79a){return _0x365b8b[_0x8a19('0x54')](_0x219bcf,{'transaction':_0x1bd79a})['then'](function(){return BPromise['each'](_0x319cc9,function(_0x5203d3){return db[_0x8a19('0x40')][_0x8a19('0x5c')]({'where':{'UserId':_0x5203d3['id'],'OpenchannelQueueId':_0xcee2a3['params']['id']},'transaction':_0x1bd79a});});})['then'](function(){_0x319cc9[_0x8a19('0x5d')](function(_0x5726ae){socket[_0x8a19('0x5e')]('userOpenchannelQueue:save',{'UserId':_0x5726ae['id'],'OpenchannelQueueId':_0x365b8b['id']});});});});});}})['then'](respondWithStatusCode(_0x2a92ca,null))['catch'](handleError(_0x2a92ca,null));};exports[_0x8a19('0x5f')]=function(_0x414008,_0x1a6c1e){return db['Team'][_0x8a19('0x24')]({'where':{'id':_0x414008[_0x8a19('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8a19('0x48')],'as':_0x8a19('0x55'),'attributes':['id'],'raw':!![]}]})[_0x8a19('0x17')](handleEntityNotFound(_0x1a6c1e,null))['then'](function(_0x7fb2b1){var _0x1d1217=_[_0x8a19('0x1c')](_0x7fb2b1,'id');var _0x3c9258=[];var _0x5fda3c=[];var _0xf4bf60=squel[_0x8a19('0x60')]();_0xf4bf60[_0x8a19('0x61')](_0x8a19('0x62'))[_0x8a19('0x63')](_0x8a19('0x64'),'tq')[_0x8a19('0x65')](_0x8a19('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8a19('0x44')](_0x8a19('0x67'),_0x414008[_0x8a19('0x27')]['id']);for(var _0x14ba01=0x0;_0x14ba01<_0x7fb2b1[_0x8a19('0x2e')];_0x14ba01+=0x1){let _0x18d208=_0x7fb2b1[_0x14ba01];for(var _0x2f1e3f=0x0;_0x2f1e3f<_0x18d208[_0x8a19('0x55')][_0x8a19('0x2e')];_0x2f1e3f+=0x1){let _0x329452=_0x18d208['Agents'][_0x2f1e3f];var _0x504d7a=_0xf4bf60[_0x8a19('0x68')]();_0x504d7a[_0x8a19('0x44')]('ut.UserId\x20=\x20?',_0x329452['id']);_0x5fda3c[_0x8a19('0x69')](db[_0x8a19('0x5a')][_0x8a19('0x23')](_0x504d7a['toString'](),{'type':db[_0x8a19('0x5a')][_0x8a19('0x6a')][_0x8a19('0x6b')]})['then'](function(_0x3ddd11){if(_0x3ddd11[_0x8a19('0x2e')]===0x1){return _0x329452['id'];}else{var _0x41cd3b=_[_0x8a19('0x6c')](_['map'](_0x3ddd11,'TeamId'),function(_0x3d19ab){return _[_0x8a19('0x6d')](_0x1d1217,_0x3d19ab);});if(_0x41cd3b){return _0x329452['id'];}}}));}}return BPromise[_0x8a19('0x6e')](_0x5fda3c)['then'](function(_0x438d3a){_0x3c9258=_(_0x3c9258)[_0x8a19('0x6f')](_0x438d3a)[_0x8a19('0x70')]()[_0x8a19('0x71')]();return db[_0x8a19('0x21')][_0x8a19('0x32')]({'where':{'id':_0x414008[_0x8a19('0x27')]['id']}})[_0x8a19('0x17')](function(_0x391b58){return db[_0x8a19('0x5a')][_0x8a19('0x5b')](function(_0x57d598){return _0x391b58[_0x8a19('0x5f')](_0x414008[_0x8a19('0x23')][_0x8a19('0x72')],{'transaction':_0x57d598})[_0x8a19('0x17')](function(){if(!_['isEmpty'](_0x3c9258)){return _0x391b58['removeAgents'](_0x3c9258,{'transaction':_0x57d598});}})[_0x8a19('0x17')](function(){_0x3c9258[_0x8a19('0x5d')](function(_0x4a4bc6){socket[_0x8a19('0x5e')](_0x8a19('0x73'),{'UserId':_0x4a4bc6,'OpenchannelQueueId':_0x391b58['id']});});});});});});})['then'](respondWithStatusCode(_0x1a6c1e,null))[_0x8a19('0x25')](handleError(_0x1a6c1e,null));};exports[_0x8a19('0x74')]=function(_0x2a82de,_0x375a08){return db[_0x8a19('0x21')][_0x8a19('0x32')]({'where':{'id':_0x2a82de[_0x8a19('0x27')]['id']}})['then'](handleEntityNotFound(_0x375a08,null))['then'](function(_0x36c1b2){if(_0x36c1b2){return _0x36c1b2[_0x8a19('0x74')](_0x2a82de[_0x8a19('0x3b')][_0x8a19('0x72')],_[_0x8a19('0x75')](_0x2a82de[_0x8a19('0x3b')],[_0x8a19('0x72'),'id'])||{})['spread'](function(_0x2e6b25){for(var _0x819acb=0x0;_0x819acb<_0x2a82de[_0x8a19('0x3b')][_0x8a19('0x72')][_0x8a19('0x2e')];_0x819acb+=0x1){socket[_0x8a19('0x5e')](_0x8a19('0x76'),{'UserId':Number(_0x2a82de['body'][_0x8a19('0x72')][_0x819acb]),'OpenchannelQueueId':Number(_0x2a82de[_0x8a19('0x27')]['id'])});}return _0x2e6b25;});}})['then'](respondWithResult(_0x375a08,null))[_0x8a19('0x25')](handleError(_0x375a08,null));};exports[_0x8a19('0x77')]=function(_0x4be467,_0x1899a7){return db[_0x8a19('0x21')][_0x8a19('0x32')]({'where':{'id':_0x4be467[_0x8a19('0x27')]['id']}})[_0x8a19('0x17')](handleEntityNotFound(_0x1899a7,null))[_0x8a19('0x17')](function(_0xb30d8c){if(_0xb30d8c){return _0xb30d8c[_0x8a19('0x77')](_0x4be467[_0x8a19('0x23')][_0x8a19('0x72')])[_0x8a19('0x17')](function(){if(_[_0x8a19('0x78')](_0x4be467[_0x8a19('0x23')]['ids'])){for(var _0x1daa64=0x0;_0x1daa64<_0x4be467['query'][_0x8a19('0x72')][_0x8a19('0x2e')];_0x1daa64+=0x1){socket['emit'](_0x8a19('0x73'),{'UserId':Number(_0x4be467[_0x8a19('0x23')][_0x8a19('0x72')][_0x1daa64]),'OpenchannelQueueId':Number(_0x4be467[_0x8a19('0x27')]['id'])});}}else{socket['emit'](_0x8a19('0x73'),{'UserId':Number(_0x4be467['query'][_0x8a19('0x72')]),'OpenchannelQueueId':Number(_0x4be467['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1899a7,null))[_0x8a19('0x25')](handleError(_0x1899a7,null));};exports[_0x8a19('0x79')]=function(_0x1026f8,_0x5488d){var _0x287951={};var _0x1c211a={};var _0x5f26e7;var _0x55d98d;return db['OpenchannelQueue'][_0x8a19('0x3e')]({'where':{'id':_0x1026f8['params']['id']}})['then'](handleEntityNotFound(_0x5488d,null))[_0x8a19('0x17')](function(_0x1c877a){if(_0x1c877a){_0x5f26e7=_0x1c877a;_0x1c211a['model']=_[_0x8a19('0x28')](db['User'][_0x8a19('0x1d')]);_0x1c211a[_0x8a19('0x23')]=_['keys'](_0x1026f8[_0x8a19('0x23')]);_0x1c211a[_0x8a19('0x29')]=_[_0x8a19('0x2a')](_0x1c211a['model'],_0x1c211a[_0x8a19('0x23')]);_0x287951['attributes']=_[_0x8a19('0x2a')](_0x1c211a['model'],qs[_0x8a19('0x2c')](_0x1026f8[_0x8a19('0x23')][_0x8a19('0x2c')]));_0x287951['attributes']=_0x287951['attributes'][_0x8a19('0x2e')]?_0x287951[_0x8a19('0x2d')]:_0x1c211a[_0x8a19('0x2b')];_0x287951[_0x8a19('0x42')]=qs[_0x8a19('0x43')](_0x1026f8[_0x8a19('0x23')]['sort']);_0x287951['where']=qs[_0x8a19('0x29')](_['pick'](_0x1026f8[_0x8a19('0x23')],_0x1c211a[_0x8a19('0x29')]));if(_0x1026f8[_0x8a19('0x23')]['filter']){_0x287951[_0x8a19('0x44')]=_[_0x8a19('0x30')](_0x287951[_0x8a19('0x44')],{'$or':_['map'](_0x287951[_0x8a19('0x2d')],function(_0x29e8a2){var _0x17f7cd={};_0x17f7cd[_0x29e8a2]={'$like':'%'+_0x1026f8[_0x8a19('0x23')][_0x8a19('0x47')]+'%'};return _0x17f7cd;})});}_0x287951=_['merge']({},_0x287951,_0x1026f8['options']);return _0x5f26e7[_0x8a19('0x79')](_0x287951);}})[_0x8a19('0x17')](function(_0x369322){if(_0x369322){_0x55d98d=_0x369322['length'];if(!_0x1026f8[_0x8a19('0x23')][_0x8a19('0x53')]('nolimit')){_0x287951[_0x8a19('0x11')]=qs[_0x8a19('0x11')](_0x1026f8[_0x8a19('0x23')][_0x8a19('0x11')]);_0x287951[_0x8a19('0xe')]=qs[_0x8a19('0xe')](_0x1026f8[_0x8a19('0x23')][_0x8a19('0xe')]);}return _0x5f26e7['getAgents'](_0x287951);}})[_0x8a19('0x17')](function(_0x4fb18d){if(_0x4fb18d){return _0x4fb18d?{'count':_0x55d98d,'rows':_0x4fb18d}:null;}})['then'](respondWithResult(_0x5488d,null))[_0x8a19('0x25')](handleError(_0x5488d,null));}; \ No newline at end of file +var _0x09fd=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','length','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','map','User','UserId','agent','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','keys','filter','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeAgents','forEach','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','show','filters','attributes','intersection','model','fields','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x4ecffb,_0x69b339){var _0x1f9bdb=function(_0x269c8b){while(--_0x269c8b){_0x4ecffb['push'](_0x4ecffb['shift']());}};_0x1f9bdb(++_0x69b339);}(_0x09fd,0xb6));var _0xd09f=function(_0x156489,_0x2bbaf2){_0x156489=_0x156489-0x0;var _0x4d2814=_0x09fd[_0x156489];return _0x4d2814;};'use strict';var BPromise=require(_0xd09f('0x0'));var util=require(_0xd09f('0x1'));var _=require(_0xd09f('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd09f('0x3'))(_0xd09f('0x4'));var config=require(_0xd09f('0x5'));var db=require(_0xd09f('0x6'))['db'];config[_0xd09f('0x7')]=_[_0xd09f('0x8')](config[_0xd09f('0x7')],{'host':_0xd09f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd09f('0x7')]));require(_0xd09f('0xa'))[_0xd09f('0xb')](socket);function respondWithStatusCode(_0x1ad371,_0x1733e9){_0x1733e9=_0x1733e9||0xcc;return function(_0x16fc0a){if(_0x16fc0a){return _0x1ad371['sendStatus'](_0x1733e9);}return _0x1ad371[_0xd09f('0xc')](_0x1733e9)[_0xd09f('0xd')]();};}function respondWithResult(_0x4646b2,_0x2ec105){_0x2ec105=_0x2ec105||0xc8;return function(_0x3d4cf5){if(_0x3d4cf5){return _0x4646b2[_0xd09f('0xc')](_0x2ec105)[_0xd09f('0xe')](_0x3d4cf5);}};}function respondWithFilteredResult(_0x41e3ee,_0x57a559){return function(_0x14d62d){if(_0x14d62d){var _0x2a5656=typeof _0x57a559[_0xd09f('0xf')]===_0xd09f('0x10')&&typeof _0x57a559[_0xd09f('0x11')]===_0xd09f('0x10');var _0x2f0a71=_0x14d62d['count'];var _0x1ce63b=_0x2a5656?0x0:_0x57a559[_0xd09f('0xf')];var _0x4c5fda=_0x2a5656?_0x14d62d[_0xd09f('0x12')]:_0x57a559[_0xd09f('0xf')]+_0x57a559[_0xd09f('0x11')];var _0x435ef9;if(_0x4c5fda>=_0x2f0a71){_0x4c5fda=_0x2f0a71;_0x435ef9=0xc8;}else{_0x435ef9=0xce;}_0x41e3ee['status'](_0x435ef9);return _0x41e3ee[_0xd09f('0x13')]('Content-Range',_0x1ce63b+'-'+_0x4c5fda+'/'+_0x2f0a71)['json'](_0x14d62d);}return null;};}function saveUpdates(_0x525b25){return function(_0x3b5a54){if(_0x3b5a54){return _0x3b5a54[_0xd09f('0x14')](_0x525b25)[_0xd09f('0x15')](function(_0x35dcbb){return _0x35dcbb;});}return null;};}function removeEntity(_0x30feb2){return function(_0x10e887){if(_0x10e887){return _0x10e887['destroy']()[_0xd09f('0x15')](function(){var _0x54c6e9=_0x10e887[_0xd09f('0x16')]({'plain':!![]});var _0x466bee='OpenchannelQueues';return db[_0xd09f('0x17')][_0xd09f('0x18')]({'where':{'type':_0x466bee,'resourceId':_0x54c6e9['id']}})[_0xd09f('0x15')](function(){return _0x10e887;});})['then'](function(){_0x30feb2[_0xd09f('0xc')](0xcc)[_0xd09f('0xd')]();});}};}function handleEntityNotFound(_0x3e84f3){return function(_0x15bee0){if(!_0x15bee0){_0x3e84f3[_0xd09f('0x19')](0x194);}return _0x15bee0;};}function handleError(_0x1838d5,_0x32286e){_0x32286e=_0x32286e||0x1f4;return function(_0x4014b1){logger['error'](_0x4014b1[_0xd09f('0x1a')]);if(_0x4014b1[_0xd09f('0x1b')]){delete _0x4014b1['name'];}_0x1838d5[_0xd09f('0xc')](_0x32286e)[_0xd09f('0x1c')](_0x4014b1);};}exports['index']=function(_0x5279ff,_0x5db15e){var _0x5c529e={};var _0x400ac6={'count':0x0,'rows':[]};var _0x20e4ef=_['map'](db[_0xd09f('0x1d')][_0xd09f('0x1e')],function(_0x95f7fe){return{'name':_0x95f7fe[_0xd09f('0x1f')],'type':_0x95f7fe[_0xd09f('0x20')][_0xd09f('0x21')]};});_0x5c529e=qs[_0xd09f('0x22')](_0x20e4ef,_0x5279ff);var _0xd3f5bd={'where':_0x5c529e[_0xd09f('0x23')]};return db[_0xd09f('0x1d')][_0xd09f('0x12')](_0xd3f5bd)[_0xd09f('0x15')](function(_0x203095){_0x400ac6[_0xd09f('0x12')]=_0x203095;_0x5c529e[_0xd09f('0x24')]=qs[_0xd09f('0x24')](_0x5279ff[_0xd09f('0x25')]);return db[_0xd09f('0x1d')][_0xd09f('0x26')](_0x5c529e);})['then'](function(_0x12b9b3){_0x400ac6['rows']=_0x12b9b3;return _0x400ac6;})[_0xd09f('0x15')](respondWithFilteredResult(_0x5db15e,_0x5c529e))['catch'](handleError(_0x5db15e,null));};exports[_0xd09f('0x27')]=function(_0xba8055,_0x4909ff){var _0x4e055c={'raw':!![],'where':{'id':_0xba8055['params']['id']}},_0x1226f1={};_0x1226f1['model']=_['keys'](db[_0xd09f('0x1d')][_0xd09f('0x1e')]);_0x1226f1[_0xd09f('0x25')]=_['keys'](_0xba8055[_0xd09f('0x25')]);_0x1226f1[_0xd09f('0x28')]=_['intersection'](_0x1226f1['model'],_0x1226f1[_0xd09f('0x25')]);_0x4e055c[_0xd09f('0x29')]=_[_0xd09f('0x2a')](_0x1226f1[_0xd09f('0x2b')],qs[_0xd09f('0x2c')](_0xba8055[_0xd09f('0x25')][_0xd09f('0x2c')]));_0x4e055c['attributes']=_0x4e055c[_0xd09f('0x29')]['length']?_0x4e055c[_0xd09f('0x29')]:_0x1226f1[_0xd09f('0x2b')];if(_0xba8055[_0xd09f('0x25')]['includeAll']){_0x4e055c[_0xd09f('0x24')]=[{'all':!![]}];}_0x4e055c=_[_0xd09f('0x2d')]({},_0x4e055c,_0xba8055[_0xd09f('0x2e')]);return db[_0xd09f('0x1d')][_0xd09f('0x2f')](_0x4e055c)[_0xd09f('0x15')](handleEntityNotFound(_0x4909ff,null))[_0xd09f('0x15')](respondWithResult(_0x4909ff,null))[_0xd09f('0x30')](handleError(_0x4909ff,null));};exports['create']=function(_0x5db341,_0xe7f0a6){return db['OpenchannelQueue'][_0xd09f('0x31')](_0x5db341[_0xd09f('0x32')],{})[_0xd09f('0x15')](function(_0xccea26){var _0x45b4bd=_0x5db341[_0xd09f('0x33')][_0xd09f('0x16')]({'plain':!![]});if(!_0x45b4bd)throw new Error(_0xd09f('0x34'));if(_0x45b4bd[_0xd09f('0x35')]===_0xd09f('0x33')){var _0x220657=_0xccea26[_0xd09f('0x16')]({'plain':!![]});var _0x370aed='OpenchannelQueues';return db[_0xd09f('0x36')][_0xd09f('0x2f')]({'where':{'name':_0x370aed,'userProfileId':_0x45b4bd[_0xd09f('0x37')]},'raw':!![]})[_0xd09f('0x15')](function(_0x5a264e){if(_0x5a264e&&_0x5a264e['autoAssociation']===0x0){return db['UserProfileResource'][_0xd09f('0x31')]({'name':_0x220657[_0xd09f('0x1b')],'resourceId':_0x220657['id'],'type':_0x5a264e[_0xd09f('0x1b')],'sectionId':_0x5a264e['id']},{})[_0xd09f('0x15')](function(){return _0xccea26;});}else{return _0xccea26;}})[_0xd09f('0x30')](function(_0x394bac){logger[_0xd09f('0x38')](_0xd09f('0x39'),_0x394bac);throw _0x394bac;});}return _0xccea26;})[_0xd09f('0x15')](respondWithResult(_0xe7f0a6,0xc9))[_0xd09f('0x30')](handleError(_0xe7f0a6,null));};exports[_0xd09f('0x14')]=function(_0x2e5381,_0x86813e){if(_0x2e5381[_0xd09f('0x32')]['id']){delete _0x2e5381[_0xd09f('0x32')]['id'];}return db[_0xd09f('0x1d')]['find']({'where':{'id':_0x2e5381[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x86813e,null))['then'](saveUpdates(_0x2e5381['body'],null))[_0xd09f('0x15')](respondWithResult(_0x86813e,null))[_0xd09f('0x30')](handleError(_0x86813e,null));};exports[_0xd09f('0x18')]=function(_0x40fd6b,_0x11f5fb){return db[_0xd09f('0x1d')][_0xd09f('0x2f')]({'where':{'id':_0x40fd6b['params']['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x11f5fb,null))[_0xd09f('0x15')](removeEntity(_0x11f5fb,null))[_0xd09f('0x30')](handleError(_0x11f5fb,null));};exports['describe']=function(_0x776d5d,_0x484dbb){return db[_0xd09f('0x1d')]['describe']()['then'](respondWithResult(_0x484dbb,null))[_0xd09f('0x30')](handleError(_0x484dbb,null));};exports[_0xd09f('0x3b')]=function(_0x4c3955,_0x51c25a){var _0x15764b={'raw':!![],'where':{}},_0x4d5f38={},_0x517455;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4c3955[_0xd09f('0x3a')]['id']}})['then'](handleEntityNotFound(_0x51c25a,null))[_0xd09f('0x15')](function(_0x3a4343){if(_0x3a4343){_0x517455=_0x3a4343['get']({'plain':!![]});_0x4d5f38[_0xd09f('0x2b')]=_['keys'](db['UserOpenchannelQueue'][_0xd09f('0x1e')]);_0x4d5f38[_0xd09f('0x25')]=_['keys'](_0x4c3955[_0xd09f('0x25')]);_0x4d5f38['filters']=_[_0xd09f('0x2a')](_0x4d5f38[_0xd09f('0x2b')],_0x4d5f38[_0xd09f('0x25')]);_0x15764b['attributes']=_[_0xd09f('0x2a')](_0x4d5f38[_0xd09f('0x2b')],qs[_0xd09f('0x2c')](_0x4c3955[_0xd09f('0x25')][_0xd09f('0x2c')]));_0x15764b[_0xd09f('0x29')]=_0x15764b['attributes'][_0xd09f('0x3c')]?_0x15764b[_0xd09f('0x29')]:_0x4d5f38['model'];if(!_0x4c3955['query'][_0xd09f('0x3d')](_0xd09f('0x3e'))){_0x15764b[_0xd09f('0x11')]=qs['limit'](_0x4c3955['query'][_0xd09f('0x11')]);_0x15764b[_0xd09f('0xf')]=qs[_0xd09f('0xf')](_0x4c3955[_0xd09f('0x25')][_0xd09f('0xf')]);}_0x15764b[_0xd09f('0x3f')]=qs[_0xd09f('0x40')](_0x4c3955[_0xd09f('0x25')][_0xd09f('0x40')]);_0x15764b[_0xd09f('0x23')]=qs[_0xd09f('0x28')](_[_0xd09f('0x41')](_0x4c3955['query'],_0x4d5f38['filters']));_0x15764b[_0xd09f('0x23')][_0xd09f('0x42')]=_0x3a4343['id'];if(_0x4c3955[_0xd09f('0x25')]['filter']){_0x15764b[_0xd09f('0x23')]=_['merge'](_0x15764b['where'],{'$or':_[_0xd09f('0x43')](_0x15764b['attributes'],function(_0x30e444){var _0x36d193={};_0x36d193[_0x30e444]={'$like':'%'+_0x4c3955[_0xd09f('0x25')]['filter']+'%'};return _0x36d193;})});}_0x15764b=_[_0xd09f('0x2d')]({},_0x15764b,_0x4c3955['options']);return db['UserOpenchannelQueue'][_0xd09f('0x26')](_0x15764b);}})['then'](function(_0x4b17f4){if(_0x4b17f4){return db[_0xd09f('0x44')]['findAndCountAll']({'where':{'id':_['map'](_0x4b17f4,_0xd09f('0x45')),'role':_0xd09f('0x46')},'attributes':['id',_0xd09f('0x1b'),'openchannelPause','updatedAt',_0xd09f('0x47')]});}})[_0xd09f('0x15')](function(_0xed3b3b){if(_0xed3b3b){return{'count':_0xed3b3b[_0xd09f('0x12')],'rows':_[_0xd09f('0x43')](_0xed3b3b['rows'],function(_0x497cb0){return{'membername':_0x497cb0['name'],'UserId':_0x497cb0['id'],'queue_name':_0x517455[_0xd09f('0x1b')],'OpenchannelQueueId':_0x517455['id'],'interface':util[_0xd09f('0x48')](_0xd09f('0x49'),_0xd09f('0x4a'),_0x497cb0[_0xd09f('0x1b')]),'penalty':0x0,'paused':_0x497cb0['openchannelPause'],'createdAt':_0x497cb0[_0xd09f('0x47')],'updatedAt':_0x497cb0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd09f('0x15')](respondWithFilteredResult(_0x51c25a,_0x15764b))[_0xd09f('0x30')](handleError(_0x51c25a,null));};exports[_0xd09f('0x4b')]=function(_0x1632f9,_0x1579f1){var _0x5af4d5={};var _0x44c873={};var _0x4bb4e9;var _0x289f59;return db['OpenchannelQueue'][_0xd09f('0x4c')]({'where':{'id':_0x1632f9[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x1579f1,null))[_0xd09f('0x15')](function(_0x255bf5){if(_0x255bf5){_0x4bb4e9=_0x255bf5;_0x44c873[_0xd09f('0x2b')]=_['keys'](db[_0xd09f('0x4d')][_0xd09f('0x1e')]);_0x44c873['query']=_[_0xd09f('0x4e')](_0x1632f9['query']);_0x44c873[_0xd09f('0x28')]=_[_0xd09f('0x2a')](_0x44c873[_0xd09f('0x2b')],_0x44c873[_0xd09f('0x25')]);_0x5af4d5['attributes']=_[_0xd09f('0x2a')](_0x44c873['model'],qs[_0xd09f('0x2c')](_0x1632f9['query'][_0xd09f('0x2c')]));_0x5af4d5[_0xd09f('0x29')]=_0x5af4d5[_0xd09f('0x29')][_0xd09f('0x3c')]?_0x5af4d5[_0xd09f('0x29')]:_0x44c873[_0xd09f('0x2b')];_0x5af4d5[_0xd09f('0x3f')]=qs['sort'](_0x1632f9[_0xd09f('0x25')]['sort']);_0x5af4d5[_0xd09f('0x23')]=qs['filters'](_['pick'](_0x1632f9[_0xd09f('0x25')],_0x44c873[_0xd09f('0x28')]));if(_0x1632f9[_0xd09f('0x25')]['filter']){_0x5af4d5['where']=_['merge'](_0x5af4d5['where'],{'$or':_[_0xd09f('0x43')](_0x5af4d5[_0xd09f('0x29')],function(_0xe1aa53){var _0xe41cae={};_0xe41cae[_0xe1aa53]={'$like':'%'+_0x1632f9[_0xd09f('0x25')][_0xd09f('0x4f')]+'%'};return _0xe41cae;})});}_0x5af4d5=_['merge']({},_0x5af4d5,_0x1632f9['options']);return _0x4bb4e9[_0xd09f('0x4b')](_0x5af4d5);}})[_0xd09f('0x15')](function(_0x3bf37c){if(_0x3bf37c){_0x289f59=_0x3bf37c[_0xd09f('0x3c')];if(!_0x1632f9[_0xd09f('0x25')][_0xd09f('0x3d')](_0xd09f('0x3e'))){_0x5af4d5[_0xd09f('0x11')]=qs['limit'](_0x1632f9[_0xd09f('0x25')]['limit']);_0x5af4d5['offset']=qs[_0xd09f('0xf')](_0x1632f9[_0xd09f('0x25')][_0xd09f('0xf')]);}return _0x4bb4e9[_0xd09f('0x4b')](_0x5af4d5);}})['then'](function(_0x25e309){if(_0x25e309){return _0x25e309?{'count':_0x289f59,'rows':_0x25e309}:null;}})[_0xd09f('0x15')](respondWithResult(_0x1579f1,null))[_0xd09f('0x30')](handleError(_0x1579f1,null));};exports[_0xd09f('0x50')]=function(_0x5cdbae,_0x56f948){var _0x3e4c12=_0x5cdbae[_0xd09f('0x32')][_0xd09f('0x51')];return db['Team'][_0xd09f('0x26')]({'where':{'id':_0x3e4c12},'attributes':['id'],'include':[{'model':db[_0xd09f('0x44')],'as':_0xd09f('0x52'),'attributes':['id',_0xd09f('0x1b'),_0xd09f('0x53'),_0xd09f('0x54'),_0xd09f('0x55')],'raw':!![]}]})[_0xd09f('0x15')](function(_0x483017){if(_0x483017){var _0x271d14=_['flatMap'](_0x483017,function(_0x2a17aa){var _0x4b2e64=_0x2a17aa[_0xd09f('0x16')]({'plain':!![]});return _0x4b2e64[_0xd09f('0x52')];});return db[_0xd09f('0x1d')]['find']({'where':{'id':_0x5cdbae[_0xd09f('0x3a')]['id']}})['then'](function(_0xb98bc5){return db[_0xd09f('0x56')][_0xd09f('0x57')](function(_0x1d1849){return _0xb98bc5[_0xd09f('0x50')](_0x3e4c12,{'transaction':_0x1d1849})[_0xd09f('0x15')](function(){return BPromise[_0xd09f('0x58')](_0x271d14,function(_0x5477be){return db[_0xd09f('0x59')][_0xd09f('0x5a')]({'where':{'UserId':_0x5477be['id'],'OpenchannelQueueId':_0x5cdbae[_0xd09f('0x3a')]['id']},'transaction':_0x1d1849});});})['then'](function(){_0x271d14['forEach'](function(_0x4e3db4){socket[_0xd09f('0x5b')](_0xd09f('0x5c'),{'UserId':_0x4e3db4['id'],'OpenchannelQueueId':_0xb98bc5['id']});});});});});}})['then'](respondWithStatusCode(_0x56f948,null))[_0xd09f('0x30')](handleError(_0x56f948,null));};exports[_0xd09f('0x5d')]=function(_0x1e8171,_0x24170f){return db[_0xd09f('0x4d')]['findAll']({'where':{'id':_0x1e8171['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xd09f('0x44')],'as':_0xd09f('0x52'),'attributes':['id'],'raw':!![]}]})[_0xd09f('0x15')](handleEntityNotFound(_0x24170f,null))[_0xd09f('0x15')](function(_0x2d7932){var _0x522ec3=_[_0xd09f('0x43')](_0x2d7932,'id');var _0xec64ff=[];var _0x1ce710=[];var _0x35b3e7=squel[_0xd09f('0x5e')]();_0x35b3e7[_0xd09f('0x5f')](_0xd09f('0x60'))[_0xd09f('0x61')](_0xd09f('0x62'),'tq')[_0xd09f('0x63')]('user_has_teams','ut',_0xd09f('0x64'))[_0xd09f('0x23')](_0xd09f('0x65'),_0x1e8171[_0xd09f('0x3a')]['id']);for(var _0x353a57=0x0;_0x353a57<_0x2d7932[_0xd09f('0x3c')];_0x353a57+=0x1){let _0x52aa93=_0x2d7932[_0x353a57];for(var _0x178421=0x0;_0x178421<_0x52aa93[_0xd09f('0x52')][_0xd09f('0x3c')];_0x178421+=0x1){let _0x2a8035=_0x52aa93[_0xd09f('0x52')][_0x178421];var _0x744bbd=_0x35b3e7[_0xd09f('0x66')]();_0x744bbd[_0xd09f('0x23')]('ut.UserId\x20=\x20?',_0x2a8035['id']);_0x1ce710[_0xd09f('0x67')](db[_0xd09f('0x56')][_0xd09f('0x25')](_0x744bbd[_0xd09f('0x68')](),{'type':db[_0xd09f('0x56')]['QueryTypes'][_0xd09f('0x69')]})['then'](function(_0x5980c5){if(_0x5980c5[_0xd09f('0x3c')]===0x1){return _0x2a8035['id'];}else{var _0x281848=_[_0xd09f('0x6a')](_['map'](_0x5980c5,_0xd09f('0x6b')),function(_0x5599a3){return _[_0xd09f('0x6c')](_0x522ec3,_0x5599a3);});if(_0x281848){return _0x2a8035['id'];}}}));}}return BPromise['all'](_0x1ce710)[_0xd09f('0x15')](function(_0x434d84){_0xec64ff=_(_0xec64ff)[_0xd09f('0x6d')](_0x434d84)[_0xd09f('0x6e')]()[_0xd09f('0x6f')]();return db[_0xd09f('0x1d')][_0xd09f('0x2f')]({'where':{'id':_0x1e8171[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](function(_0x47e553){return db[_0xd09f('0x56')][_0xd09f('0x57')](function(_0x33071c){return _0x47e553['removeTeams'](_0x1e8171[_0xd09f('0x25')]['ids'],{'transaction':_0x33071c})['then'](function(){if(!_['isEmpty'](_0xec64ff)){return _0x47e553[_0xd09f('0x70')](_0xec64ff,{'transaction':_0x33071c});}})[_0xd09f('0x15')](function(){_0xec64ff[_0xd09f('0x71')](function(_0x4e682b){socket[_0xd09f('0x5b')]('userOpenchannelQueue:remove',{'UserId':_0x4e682b,'OpenchannelQueueId':_0x47e553['id']});});});});});});})[_0xd09f('0x15')](respondWithStatusCode(_0x24170f,null))[_0xd09f('0x30')](handleError(_0x24170f,null));};exports[_0xd09f('0x72')]=function(_0x312d84,_0x34ce9d){return db[_0xd09f('0x1d')][_0xd09f('0x2f')]({'where':{'id':_0x312d84[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x34ce9d,null))['then'](function(_0x4534b2){if(_0x4534b2){return _0x4534b2[_0xd09f('0x72')](_0x312d84[_0xd09f('0x32')]['ids'],_['omit'](_0x312d84[_0xd09f('0x32')],[_0xd09f('0x51'),'id'])||{})[_0xd09f('0x73')](function(_0x6a8a98){for(var _0x303018=0x0;_0x303018<_0x312d84[_0xd09f('0x32')][_0xd09f('0x51')][_0xd09f('0x3c')];_0x303018+=0x1){socket[_0xd09f('0x5b')](_0xd09f('0x5c'),{'UserId':Number(_0x312d84[_0xd09f('0x32')][_0xd09f('0x51')][_0x303018]),'OpenchannelQueueId':Number(_0x312d84[_0xd09f('0x3a')]['id'])});}return _0x6a8a98;});}})['then'](respondWithResult(_0x34ce9d,null))[_0xd09f('0x30')](handleError(_0x34ce9d,null));};exports['removeAgents']=function(_0x5df46f,_0x132650){return db[_0xd09f('0x1d')]['find']({'where':{'id':_0x5df46f[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x132650,null))[_0xd09f('0x15')](function(_0x614dfb){if(_0x614dfb){return _0x614dfb[_0xd09f('0x70')](_0x5df46f['query'][_0xd09f('0x51')])[_0xd09f('0x15')](function(){if(_[_0xd09f('0x74')](_0x5df46f[_0xd09f('0x25')][_0xd09f('0x51')])){for(var _0x514b36=0x0;_0x514b36<_0x5df46f['query'][_0xd09f('0x51')]['length'];_0x514b36+=0x1){socket[_0xd09f('0x5b')](_0xd09f('0x75'),{'UserId':Number(_0x5df46f[_0xd09f('0x25')][_0xd09f('0x51')][_0x514b36]),'OpenchannelQueueId':Number(_0x5df46f[_0xd09f('0x3a')]['id'])});}}else{socket['emit'](_0xd09f('0x75'),{'UserId':Number(_0x5df46f[_0xd09f('0x25')][_0xd09f('0x51')]),'OpenchannelQueueId':Number(_0x5df46f[_0xd09f('0x3a')]['id'])});}});}})[_0xd09f('0x15')](respondWithStatusCode(_0x132650,null))[_0xd09f('0x30')](handleError(_0x132650,null));};exports[_0xd09f('0x76')]=function(_0x5156c7,_0x23c789){var _0x2763f0={};var _0x125469={};var _0x13360b;var _0x31074d;return db[_0xd09f('0x1d')][_0xd09f('0x4c')]({'where':{'id':_0x5156c7[_0xd09f('0x3a')]['id']}})[_0xd09f('0x15')](handleEntityNotFound(_0x23c789,null))['then'](function(_0x16e955){if(_0x16e955){_0x13360b=_0x16e955;_0x125469[_0xd09f('0x2b')]=_[_0xd09f('0x4e')](db[_0xd09f('0x44')]['rawAttributes']);_0x125469[_0xd09f('0x25')]=_[_0xd09f('0x4e')](_0x5156c7[_0xd09f('0x25')]);_0x125469[_0xd09f('0x28')]=_[_0xd09f('0x2a')](_0x125469[_0xd09f('0x2b')],_0x125469['query']);_0x2763f0[_0xd09f('0x29')]=_[_0xd09f('0x2a')](_0x125469[_0xd09f('0x2b')],qs[_0xd09f('0x2c')](_0x5156c7[_0xd09f('0x25')]['fields']));_0x2763f0['attributes']=_0x2763f0[_0xd09f('0x29')]['length']?_0x2763f0[_0xd09f('0x29')]:_0x125469[_0xd09f('0x2b')];_0x2763f0[_0xd09f('0x3f')]=qs['sort'](_0x5156c7['query'][_0xd09f('0x40')]);_0x2763f0[_0xd09f('0x23')]=qs[_0xd09f('0x28')](_[_0xd09f('0x41')](_0x5156c7[_0xd09f('0x25')],_0x125469['filters']));if(_0x5156c7[_0xd09f('0x25')]['filter']){_0x2763f0[_0xd09f('0x23')]=_[_0xd09f('0x2d')](_0x2763f0[_0xd09f('0x23')],{'$or':_[_0xd09f('0x43')](_0x2763f0['attributes'],function(_0x4af123){var _0xb68201={};_0xb68201[_0x4af123]={'$like':'%'+_0x5156c7[_0xd09f('0x25')]['filter']+'%'};return _0xb68201;})});}_0x2763f0=_[_0xd09f('0x2d')]({},_0x2763f0,_0x5156c7[_0xd09f('0x2e')]);return _0x13360b[_0xd09f('0x76')](_0x2763f0);}})[_0xd09f('0x15')](function(_0x2e4c09){if(_0x2e4c09){_0x31074d=_0x2e4c09[_0xd09f('0x3c')];if(!_0x5156c7[_0xd09f('0x25')][_0xd09f('0x3d')]('nolimit')){_0x2763f0[_0xd09f('0x11')]=qs['limit'](_0x5156c7[_0xd09f('0x25')]['limit']);_0x2763f0[_0xd09f('0xf')]=qs[_0xd09f('0xf')](_0x5156c7[_0xd09f('0x25')][_0xd09f('0xf')]);}return _0x13360b['getAgents'](_0x2763f0);}})['then'](function(_0x224736){if(_0x224736){return _0x224736?{'count':_0x31074d,'rows':_0x224736}:null;}})[_0xd09f('0x15')](respondWithResult(_0x23c789,null))[_0xd09f('0x30')](handleError(_0x23c789,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6282040..e021ab6 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 _0x4338=['exports','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4cc749,_0x1dc17b){var _0x2d98d6=function(_0x5ca451){while(--_0x5ca451){_0x4cc749['push'](_0x4cc749['shift']());}};_0x2d98d6(++_0x1dc17b);}(_0x4338,0xfb));var _0x8433=function(_0x4adef7,_0x26777d){_0x4adef7=_0x4adef7-0x0;var _0x283540=_0x4338[_0x4adef7];return _0x283540;};'use strict';var EventEmitter=require(_0x8433('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x8433('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8433('0x2')](0x0);var events={'afterCreate':_0x8433('0x3'),'afterUpdate':_0x8433('0x4'),'afterDestroy':_0x8433('0x5')};function emitEvent(_0x100c77){return function(_0x32a314,_0x3469a9,_0x81778e){OpenchannelQueueEvents['emit'](_0x100c77+':'+_0x32a314['id'],_0x32a314);OpenchannelQueueEvents[_0x8433('0x6')](_0x100c77,_0x32a314);_0x81778e(null);};}for(var e in events){if(events[_0x8433('0x7')](e)){var event=events[e];OpenchannelQueue[_0x8433('0x8')](e,emitEvent(event));}}module[_0x8433('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5733=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x5733,0x142));var _0x3573=function(_0x1952ce,_0x4a2cad){_0x1952ce=_0x1952ce-0x0;var _0x6a6aff=_0x5733[_0x1952ce];return _0x6a6aff;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x3573('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3573('0x1')](0x0);var events={'afterCreate':_0x3573('0x2'),'afterUpdate':_0x3573('0x3'),'afterDestroy':_0x3573('0x4')};function emitEvent(_0x4c6470){return function(_0x3a6e35,_0x1f900c,_0x593d1c){OpenchannelQueueEvents[_0x3573('0x5')](_0x4c6470+':'+_0x3a6e35['id'],_0x3a6e35);OpenchannelQueueEvents[_0x3573('0x5')](_0x4c6470,_0x3a6e35);_0x593d1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x3573('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c10ea41..5fc6731 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 _0xe5a5=['api','moment','bluebird','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util'];(function(_0x4bf71a,_0x3051c4){var _0xb620f5=function(_0x4b0cb5){while(--_0x4b0cb5){_0x4bf71a['push'](_0x4bf71a['shift']());}};_0xb620f5(++_0x3051c4);}(_0xe5a5,0x13f));var _0x5e5a=function(_0x5f083d,_0x24edd9){_0x5f083d=_0x5f083d-0x0;var _0x29a0f2=_0xe5a5[_0x5f083d];return _0x29a0f2;};'use strict';var _=require('lodash');var util=require(_0x5e5a('0x0'));var logger=require('../../config/logger')(_0x5e5a('0x1'));var moment=require(_0x5e5a('0x2'));var BPromise=require(_0x5e5a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e5a('0x4'));var config=require(_0x5e5a('0x5'));var attributes=require(_0x5e5a('0x6'));module[_0x5e5a('0x7')]=function(_0xd859e9,_0x413164){return _0xd859e9[_0x5e5a('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x5e5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90f9=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','./openchannelQueue.attributes','define','OpenchannelQueue'];(function(_0x5af565,_0xe531a7){var _0x2a311f=function(_0x59429a){while(--_0x59429a){_0x5af565['push'](_0x5af565['shift']());}};_0x2a311f(++_0xe531a7);}(_0x90f9,0x1eb));var _0x990f=function(_0x2dc2c8,_0x1efe21){_0x2dc2c8=_0x2dc2c8-0x0;var _0x40c1fe=_0x90f9[_0x2dc2c8];return _0x40c1fe;};'use strict';var _=require(_0x990f('0x0'));var util=require(_0x990f('0x1'));var logger=require(_0x990f('0x2'))(_0x990f('0x3'));var moment=require(_0x990f('0x4'));var BPromise=require(_0x990f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x990f('0x6'));module['exports']=function(_0x5029a6,_0xda139b){return _0x5029a6[_0x990f('0x7')](_0x990f('0x8'),attributes,{'tableName':_0x990f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index c5bd234..ef6c527 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 _0xa858=['code','OpenchannelQueue,\x20%s,\x20%s','message','error','info','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ce7b0,_0x11a94f){var _0x2dba44=function(_0x2b8880){while(--_0x2b8880){_0x4ce7b0['push'](_0x4ce7b0['shift']());}};_0x2dba44(++_0x11a94f);}(_0xa858,0x84));var _0x8a85=function(_0x42e45c,_0x3c94d8){_0x42e45c=_0x42e45c-0x0;var _0x377661=_0xa858[_0x42e45c];return _0x377661;};'use strict';var _=require(_0x8a85('0x0'));var util=require(_0x8a85('0x1'));var moment=require('moment');var BPromise=require(_0x8a85('0x2'));var rs=require(_0x8a85('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a85('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a85('0x5'))(_0x8a85('0x6'));var config=require(_0x8a85('0x7'));var jayson=require(_0x8a85('0x8'));var client=jayson[_0x8a85('0x9')]['http']({'port':0x232a});config[_0x8a85('0xa')]=_['defaults'](config[_0x8a85('0xa')],{'host':_0x8a85('0xb'),'port':0x18eb});var socket=require(_0x8a85('0xc'))(new Redis(config[_0x8a85('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x154dd6,_0xd4c0f6,_0x425a74){return new BPromise(function(_0x3b6354,_0x20a116){return client['request'](_0x154dd6,_0x425a74)['then'](function(_0x4747ec){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0xd4c0f6,_0x8a85('0xd'));logger['debug'](_0x8a85('0xe'),_0xd4c0f6,_0x8a85('0xd'),JSON[_0x8a85('0xf')](_0x4747ec));if(_0x4747ec['error']){if(_0x4747ec['error'][_0x8a85('0x10')]===0x1f4){logger['error'](_0x8a85('0x11'),_0xd4c0f6,_0x4747ec['error'][_0x8a85('0x12')]);return _0x20a116(_0x4747ec[_0x8a85('0x13')][_0x8a85('0x12')]);}logger[_0x8a85('0x13')](_0x8a85('0x11'),_0xd4c0f6,_0x4747ec['error']['message']);return _0x3b6354(_0x4747ec[_0x8a85('0x13')][_0x8a85('0x12')]);}else{logger[_0x8a85('0x14')](_0x8a85('0x11'),_0xd4c0f6,_0x8a85('0xd'));_0x3b6354(_0x4747ec['result']['message']);}})[_0x8a85('0x15')](function(_0x329624){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0xd4c0f6,_0x329624);_0x20a116(_0x329624);});});}exports[_0x8a85('0x16')]=function(_0xdd65c9){var _0x21bc4f=this;return new Promise(function(_0x18fde7,_0x10435d){return db[_0x8a85('0x17')][_0x8a85('0x18')]({'raw':_0xdd65c9[_0x8a85('0x19')]?_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1a')]===undefined?!![]:![]:!![],'where':_0xdd65c9[_0x8a85('0x19')]?_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1b')]||null:null,'attributes':_0xdd65c9['options']?_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1c')]||null:null,'limit':_0xdd65c9['options']?_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1d')]||null:null,'include':_0xdd65c9[_0x8a85('0x19')]?_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1e')]?_['map'](_0xdd65c9[_0x8a85('0x19')][_0x8a85('0x1e')],function(_0x12e4f7){return{'model':db[_0x12e4f7['model']],'as':_0x12e4f7['as'],'attributes':_0x12e4f7[_0x8a85('0x1c')],'include':_0x12e4f7[_0x8a85('0x1e')]?_[_0x8a85('0x1f')](_0x12e4f7[_0x8a85('0x1e')],function(_0x1b458f){return{'model':db[_0x1b458f[_0x8a85('0x20')]],'as':_0x1b458f['as'],'attributes':_0x1b458f[_0x8a85('0x1c')],'include':_0x1b458f['include']?_[_0x8a85('0x1f')](_0x1b458f[_0x8a85('0x1e')],function(_0x51149a){return{'model':db[_0x51149a[_0x8a85('0x20')]],'as':_0x51149a['as'],'attributes':_0x51149a[_0x8a85('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8a85('0x21')](function(_0x3d40e2){logger['info'](_0x8a85('0x16'),_0xdd65c9);logger[_0x8a85('0x22')](_0x8a85('0x16'),_0xdd65c9,JSON[_0x8a85('0xf')](_0x3d40e2));_0x18fde7(_0x3d40e2);})[_0x8a85('0x15')](function(_0x30b372){logger[_0x8a85('0x13')](_0x8a85('0x16'),_0x30b372[_0x8a85('0x12')],_0xdd65c9);_0x10435d(_0x21bc4f[_0x8a85('0x13')](0x1f4,_0x30b372[_0x8a85('0x12')]));});});};exports[_0x8a85('0x23')]=function(_0x2639c1){var _0x287562=this;return new Promise(function(_0x5db8d9,_0x40192b){return db[_0x8a85('0x17')][_0x8a85('0x24')]({'raw':_0x2639c1[_0x8a85('0x19')]?_0x2639c1[_0x8a85('0x19')][_0x8a85('0x1a')]===undefined?!![]:![]:!![],'where':_0x2639c1[_0x8a85('0x19')]?_0x2639c1['options']['where']||null:null,'attributes':_0x2639c1[_0x8a85('0x19')]?_0x2639c1['options'][_0x8a85('0x1c')]||null:null,'include':_0x2639c1[_0x8a85('0x19')]?_0x2639c1[_0x8a85('0x19')][_0x8a85('0x1e')]?_['map'](_0x2639c1[_0x8a85('0x19')][_0x8a85('0x1e')],function(_0x115761){return{'model':db[_0x115761[_0x8a85('0x20')]],'as':_0x115761['as'],'attributes':_0x115761['attributes'],'include':_0x115761[_0x8a85('0x1e')]?_[_0x8a85('0x1f')](_0x115761[_0x8a85('0x1e')],function(_0x36ebef){return{'model':db[_0x36ebef[_0x8a85('0x20')]],'as':_0x36ebef['as'],'attributes':_0x36ebef[_0x8a85('0x1c')],'include':_0x36ebef[_0x8a85('0x1e')]?_['map'](_0x36ebef[_0x8a85('0x1e')],function(_0xb4e4fb){return{'model':db[_0xb4e4fb[_0x8a85('0x20')]],'as':_0xb4e4fb['as'],'attributes':_0xb4e4fb[_0x8a85('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8a85('0x21')](function(_0x2175fe){logger['info'](_0x8a85('0x23'),_0x2639c1);logger['debug'](_0x8a85('0x23'),_0x2639c1,JSON[_0x8a85('0xf')](_0x2175fe));_0x5db8d9(_0x2175fe);})[_0x8a85('0x15')](function(_0x129ba0){logger[_0x8a85('0x13')](_0x8a85('0x23'),_0x129ba0[_0x8a85('0x12')],_0x2639c1);_0x40192b(_0x287562[_0x8a85('0x13')](0x1f4,_0x129ba0[_0x8a85('0x12')]));});});}; \ No newline at end of file +var _0x5dfb=['redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetOpenchannelQueue','findAll','options','raw','attributes','limit','map','include','model','ShowOpenchannelQueue','OpenchannelQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5dfb,0x8c));var _0xb5df=function(_0x67754c,_0x4ee2c1){_0x67754c=_0x67754c-0x0;var _0x1f09ec=_0x5dfb[_0x67754c];return _0x1f09ec;};'use strict';var _=require(_0xb5df('0x0'));var util=require(_0xb5df('0x1'));var moment=require(_0xb5df('0x2'));var BPromise=require('bluebird');var rs=require(_0xb5df('0x3'));var fs=require('fs');var Redis=require(_0xb5df('0x4'));var db=require(_0xb5df('0x5'))['db'];var utils=require(_0xb5df('0x6'));var logger=require(_0xb5df('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb5df('0x8')]=_['defaults'](config[_0xb5df('0x8')],{'host':_0xb5df('0x9'),'port':0x18eb});var socket=require(_0xb5df('0xa'))(new Redis(config[_0xb5df('0x8')]));require(_0xb5df('0xb'))[_0xb5df('0xc')](socket);function respondWithRpcPromise(_0x216b39,_0x133de0,_0x531370){return new BPromise(function(_0x214221,_0x279e60){return client[_0xb5df('0xd')](_0x216b39,_0x531370)[_0xb5df('0xe')](function(_0x37b044){logger[_0xb5df('0xf')](_0xb5df('0x10'),_0x133de0,_0xb5df('0x11'));logger[_0xb5df('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x133de0,_0xb5df('0x11'),JSON[_0xb5df('0x13')](_0x37b044));if(_0x37b044[_0xb5df('0x14')]){if(_0x37b044[_0xb5df('0x14')][_0xb5df('0x15')]===0x1f4){logger[_0xb5df('0x14')](_0xb5df('0x10'),_0x133de0,_0x37b044[_0xb5df('0x14')]['message']);return _0x279e60(_0x37b044[_0xb5df('0x14')]['message']);}logger[_0xb5df('0x14')](_0xb5df('0x10'),_0x133de0,_0x37b044[_0xb5df('0x14')][_0xb5df('0x16')]);return _0x214221(_0x37b044[_0xb5df('0x14')][_0xb5df('0x16')]);}else{logger[_0xb5df('0xf')](_0xb5df('0x10'),_0x133de0,_0xb5df('0x11'));_0x214221(_0x37b044['result'][_0xb5df('0x16')]);}})[_0xb5df('0x17')](function(_0x42297b){logger['error'](_0xb5df('0x10'),_0x133de0,_0x42297b);_0x279e60(_0x42297b);});});}exports[_0xb5df('0x18')]=function(_0x199e20){var _0x3bf1e9=this;return new Promise(function(_0x4ccdbe,_0x57ce23){return db['OpenchannelQueue'][_0xb5df('0x19')]({'raw':_0x199e20[_0xb5df('0x1a')]?_0x199e20[_0xb5df('0x1a')][_0xb5df('0x1b')]===undefined?!![]:![]:!![],'where':_0x199e20[_0xb5df('0x1a')]?_0x199e20['options']['where']||null:null,'attributes':_0x199e20[_0xb5df('0x1a')]?_0x199e20[_0xb5df('0x1a')][_0xb5df('0x1c')]||null:null,'limit':_0x199e20['options']?_0x199e20[_0xb5df('0x1a')][_0xb5df('0x1d')]||null:null,'include':_0x199e20[_0xb5df('0x1a')]?_0x199e20[_0xb5df('0x1a')]['include']?_[_0xb5df('0x1e')](_0x199e20[_0xb5df('0x1a')][_0xb5df('0x1f')],function(_0x5e83cc){return{'model':db[_0x5e83cc['model']],'as':_0x5e83cc['as'],'attributes':_0x5e83cc[_0xb5df('0x1c')],'include':_0x5e83cc['include']?_[_0xb5df('0x1e')](_0x5e83cc[_0xb5df('0x1f')],function(_0x22b6c3){return{'model':db[_0x22b6c3[_0xb5df('0x20')]],'as':_0x22b6c3['as'],'attributes':_0x22b6c3[_0xb5df('0x1c')],'include':_0x22b6c3[_0xb5df('0x1f')]?_['map'](_0x22b6c3[_0xb5df('0x1f')],function(_0xc3935e){return{'model':db[_0xc3935e[_0xb5df('0x20')]],'as':_0xc3935e['as'],'attributes':_0xc3935e[_0xb5df('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf013ff){logger[_0xb5df('0xf')](_0xb5df('0x18'),_0x199e20);logger[_0xb5df('0x12')](_0xb5df('0x18'),_0x199e20,JSON['stringify'](_0xf013ff));_0x4ccdbe(_0xf013ff);})[_0xb5df('0x17')](function(_0x2e602c){logger[_0xb5df('0x14')](_0xb5df('0x18'),_0x2e602c['message'],_0x199e20);_0x57ce23(_0x3bf1e9[_0xb5df('0x14')](0x1f4,_0x2e602c[_0xb5df('0x16')]));});});};exports[_0xb5df('0x21')]=function(_0x4a9ebf){var _0x149f44=this;return new Promise(function(_0x143aa5,_0x4bd0b6){return db[_0xb5df('0x22')][_0xb5df('0x23')]({'raw':_0x4a9ebf['options']?_0x4a9ebf[_0xb5df('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4a9ebf['options']?_0x4a9ebf[_0xb5df('0x1a')][_0xb5df('0x24')]||null:null,'attributes':_0x4a9ebf[_0xb5df('0x1a')]?_0x4a9ebf['options'][_0xb5df('0x1c')]||null:null,'include':_0x4a9ebf[_0xb5df('0x1a')]?_0x4a9ebf['options'][_0xb5df('0x1f')]?_[_0xb5df('0x1e')](_0x4a9ebf[_0xb5df('0x1a')][_0xb5df('0x1f')],function(_0x3e455d){return{'model':db[_0x3e455d[_0xb5df('0x20')]],'as':_0x3e455d['as'],'attributes':_0x3e455d[_0xb5df('0x1c')],'include':_0x3e455d[_0xb5df('0x1f')]?_[_0xb5df('0x1e')](_0x3e455d[_0xb5df('0x1f')],function(_0x30e552){return{'model':db[_0x30e552[_0xb5df('0x20')]],'as':_0x30e552['as'],'attributes':_0x30e552[_0xb5df('0x1c')],'include':_0x30e552[_0xb5df('0x1f')]?_[_0xb5df('0x1e')](_0x30e552[_0xb5df('0x1f')],function(_0xfa5453){return{'model':db[_0xfa5453['model']],'as':_0xfa5453['as'],'attributes':_0xfa5453[_0xb5df('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3093a2){logger[_0xb5df('0xf')](_0xb5df('0x21'),_0x4a9ebf);logger[_0xb5df('0x12')](_0xb5df('0x21'),_0x4a9ebf,JSON[_0xb5df('0x13')](_0x3093a2));_0x143aa5(_0x3093a2);})['catch'](function(_0x252d12){logger['error'](_0xb5df('0x21'),_0x252d12['message'],_0x4a9ebf);_0x4bd0b6(_0x149f44[_0xb5df('0x14')](0x1f4,_0x252d12[_0xb5df('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index fc6cc06..5e41787 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 _0x4103=['./openchannelQueue.events','remove','emit','removeListener','register','length'];(function(_0xf4a534,_0x3c7ddd){var _0x228e40=function(_0x59e324){while(--_0x59e324){_0xf4a534['push'](_0xf4a534['shift']());}};_0x228e40(++_0x3c7ddd);}(_0x4103,0x144));var _0x3410=function(_0x4a6fc8,_0x394612){_0x4a6fc8=_0x4a6fc8-0x0;var _0x33dd27=_0x4103[_0x4a6fc8];return _0x33dd27;};'use strict';var OpenchannelQueueEvents=require(_0x3410('0x0'));var events=['save',_0x3410('0x1'),'update'];function createListener(_0x27cb4c,_0x3d6052){return function(_0x4c4ac4){_0x3d6052[_0x3410('0x2')](_0x27cb4c,_0x4c4ac4);};}function removeListener(_0x171f23,_0x3a593f){return function(){OpenchannelQueueEvents[_0x3410('0x3')](_0x171f23,_0x3a593f);};}exports[_0x3410('0x4')]=function(_0x470726){for(var _0x56bab9=0x0,_0x1031d9=events[_0x3410('0x5')];_0x56bab9<_0x1031d9;_0x56bab9++){var _0xacded7=events[_0x56bab9];var _0x15a41c=createListener('openchannelQueue:'+_0xacded7,_0x470726);OpenchannelQueueEvents['on'](_0xacded7,_0x15a41c);}}; \ No newline at end of file +var _0xe00b=['./openchannelQueue.events','save','remove','update','removeListener','length','openchannelQueue:'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xe00b,0xa1));var _0xbe00=function(_0x3c9175,_0x3d39b2){_0x3c9175=_0x3c9175-0x0;var _0x476098=_0xe00b[_0x3c9175];return _0x476098;};'use strict';var OpenchannelQueueEvents=require(_0xbe00('0x0'));var events=[_0xbe00('0x1'),_0xbe00('0x2'),_0xbe00('0x3')];function createListener(_0x16baaf,_0x100792){return function(_0x552d69){_0x100792['emit'](_0x16baaf,_0x552d69);};}function removeListener(_0x5dec98,_0x185596){return function(){OpenchannelQueueEvents[_0xbe00('0x4')](_0x5dec98,_0x185596);};}exports['register']=function(_0x11edfa){for(var _0x2b8dc0=0x0,_0x3dc56b=events[_0xbe00('0x5')];_0x2b8dc0<_0x3dc56b;_0x2b8dc0++){var _0x201340=events[_0x2b8dc0];var _0x28f470=createListener(_0xbe00('0x6')+_0x201340,_0x11edfa);OpenchannelQueueEvents['on'](_0x201340,_0x28f470);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5867c41..1f513f3 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 _0x180d=['isAuthenticated','index','/describe','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x180d,0x14a));var _0xd180=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x180d[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xd180('0x0'));var util=require(_0xd180('0x1'));var path=require(_0xd180('0x2'));var timeout=require(_0xd180('0x3'));var express=require('express');var router=express[_0xd180('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd180('0x5'));var interaction=require(_0xd180('0x6'));var config=require(_0xd180('0x7'));var controller=require(_0xd180('0x8'));router[_0xd180('0x9')]('/',auth[_0xd180('0xa')](),controller[_0xd180('0xb')]);router['get'](_0xd180('0xc'),auth[_0xd180('0xa')](),controller['describe']);router['get']('/:id',auth[_0xd180('0xa')](),controller['show']);router[_0xd180('0xd')]('/',auth[_0xd180('0xa')](),controller['create']);router[_0xd180('0xe')]('/:id',auth[_0xd180('0xa')](),controller[_0xd180('0xf')]);router[_0xd180('0x10')](_0xd180('0x11'),auth['isAuthenticated'](),controller[_0xd180('0x12')]);module[_0xd180('0x13')]=router; \ No newline at end of file +var _0xa534=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','destroy','path','fs-extra'];(function(_0x12fa9b,_0x167b4e){var _0xb717f1=function(_0x3c65ef){while(--_0x3c65ef){_0x12fa9b['push'](_0x12fa9b['shift']());}};_0xb717f1(++_0x167b4e);}(_0xa534,0xfa));var _0x4a53=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xa534[_0x2fc012];return _0x2891f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a53('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4a53('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x4a53('0x2'));var config=require(_0x4a53('0x3'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x4a53('0x4')](),controller[_0x4a53('0x5')]);router[_0x4a53('0x6')]('/describe',auth[_0x4a53('0x4')](),controller['describe']);router[_0x4a53('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4a53('0x7')]);router[_0x4a53('0x8')]('/',auth[_0x4a53('0x4')](),controller[_0x4a53('0x9')]);router[_0x4a53('0xa')](_0x4a53('0xb'),auth['isAuthenticated'](),controller[_0x4a53('0xc')]);router['delete'](_0x4a53('0xb'),auth[_0x4a53('0x4')](),controller[_0x4a53('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e92bcb3..48f7aec 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 _0x6108=['moment','exports','STRING','DATE'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x6108,0xbc));var _0x8610=function(_0x7ff342,_0x41c8d0){_0x7ff342=_0x7ff342-0x0;var _0x24d223=_0x6108[_0x7ff342];return _0x24d223;};'use strict';var moment=require(_0x8610('0x0'));var Sequelize=require('sequelize');module[_0x8610('0x1')]={'uniqueid':{'type':Sequelize[_0x8610('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8610('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8610('0x3')]},'exitAt':{'type':Sequelize[_0x8610('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9175=['STRING','DATE','sequelize'];(function(_0x3ae8f4,_0x2920f4){var _0x367312=function(_0x4dffbf){while(--_0x4dffbf){_0x3ae8f4['push'](_0x3ae8f4['shift']());}};_0x367312(++_0x2920f4);}(_0x9175,0x14f));var _0x5917=function(_0x198ccc,_0x538804){_0x198ccc=_0x198ccc-0x0;var _0x79f72a=_0x9175[_0x198ccc];return _0x79f72a;};'use strict';var moment=require('moment');var Sequelize=require(_0x5917('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5917('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5917('0x2')]},'acceptAt':{'type':Sequelize[_0x5917('0x2')]},'exitAt':{'type':Sequelize[_0x5917('0x2')]},'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 0cbb31e..47c8cdf 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 _0x548a=['offset','Content-Range','apply','update','then','end','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count'];(function(_0x3d0b61,_0x1fa646){var _0x4c8012=function(_0x37e674){while(--_0x37e674){_0x3d0b61['push'](_0x3d0b61['shift']());}};_0x4c8012(++_0x1fa646);}(_0x548a,0xfc));var _0xa548=function(_0x5d07eb,_0x5879f3){_0x5d07eb=_0x5d07eb-0x0;var _0x3c454f=_0x548a[_0x5d07eb];return _0x3c454f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa548('0x0'));var zipdir=require(_0xa548('0x1'));var jsonpatch=require(_0xa548('0x2'));var rp=require(_0xa548('0x3'));var moment=require('moment');var BPromise=require(_0xa548('0x4'));var Mustache=require(_0xa548('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa548('0x6'));var ejs=require(_0xa548('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa548('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa548('0x9'));var deskjs=require(_0xa548('0xa'));var toCsv=require(_0xa548('0x6'));var querystring=require(_0xa548('0xb'));var Papa=require(_0xa548('0xc'));var Redis=require(_0xa548('0xd'));var authService=require(_0xa548('0xe'));var qs=require(_0xa548('0xf'));var as=require(_0xa548('0x10'));var hardwareService=require(_0xa548('0x11'));var logger=require(_0xa548('0x12'))(_0xa548('0x13'));var utils=require('../../config/utils');var config=require(_0xa548('0x14'));var licenseUtil=require(_0xa548('0x15'));var db=require(_0xa548('0x16'))['db'];function respondWithStatusCode(_0x312d5a,_0x34cf44){_0x34cf44=_0x34cf44||0xcc;return function(_0x36111f){if(_0x36111f){return _0x312d5a[_0xa548('0x17')](_0x34cf44);}return _0x312d5a[_0xa548('0x18')](_0x34cf44)['end']();};}function respondWithResult(_0x3bc3ce,_0x21ab4c){_0x21ab4c=_0x21ab4c||0xc8;return function(_0x3375c5){if(_0x3375c5){return _0x3bc3ce[_0xa548('0x18')](_0x21ab4c)[_0xa548('0x19')](_0x3375c5);}};}function respondWithFilteredResult(_0x2f48ab,_0x1b14f2){return function(_0x143f20){if(_0x143f20){var _0x3c6ac4=typeof _0x1b14f2['offset']==='undefined'&&typeof _0x1b14f2[_0xa548('0x1a')]==='undefined';var _0xe869e7=_0x143f20[_0xa548('0x1b')];var _0x2e5cd8=_0x3c6ac4?0x0:_0x1b14f2[_0xa548('0x1c')];var _0x545a60=_0x3c6ac4?_0x143f20['count']:_0x1b14f2[_0xa548('0x1c')]+_0x1b14f2[_0xa548('0x1a')];var _0x2fda34;if(_0x545a60>=_0xe869e7){_0x545a60=_0xe869e7;_0x2fda34=0xc8;}else{_0x2fda34=0xce;}_0x2f48ab[_0xa548('0x18')](_0x2fda34);return _0x2f48ab['set'](_0xa548('0x1d'),_0x2e5cd8+'-'+_0x545a60+'/'+_0xe869e7)['json'](_0x143f20);}return null;};}function patchUpdates(_0x264e1a){return function(_0x2d5307){try{jsonpatch[_0xa548('0x1e')](_0x2d5307,_0x264e1a,!![]);}catch(_0x495431){return BPromise['reject'](_0x495431);}return _0x2d5307['save']();};}function saveUpdates(_0x54e707,_0x29b4c2){return function(_0x4ecbb8){if(_0x4ecbb8){return _0x4ecbb8[_0xa548('0x1f')](_0x54e707)['then'](function(_0x887c90){return _0x887c90;});}return null;};}function removeEntity(_0x468ec8,_0x3ca94a){return function(_0x579a2a){if(_0x579a2a){return _0x579a2a['destroy']()[_0xa548('0x20')](function(){_0x468ec8[_0xa548('0x18')](0xcc)[_0xa548('0x21')]();});}};}function handleEntityNotFound(_0x446504,_0x3170f5){return function(_0x23fb69){if(!_0x23fb69){_0x446504['sendStatus'](0x194);}return _0x23fb69;};}function handleError(_0x4d18f1,_0x21b8e9){_0x21b8e9=_0x21b8e9||0x1f4;return function(_0x2ba1a8){logger['error'](_0x2ba1a8['stack']);if(_0x2ba1a8[_0xa548('0x22')]){delete _0x2ba1a8[_0xa548('0x22')];}_0x4d18f1[_0xa548('0x18')](_0x21b8e9)['send'](_0x2ba1a8);};}exports[_0xa548('0x23')]=function(_0x3d671b,_0x1fee80){var _0x2d0b89={},_0x4a41a5={},_0x23268e={'count':0x0,'rows':[]};var _0x52406d=_[_0xa548('0x24')](db[_0xa548('0x25')][_0xa548('0x26')],function(_0x107fab){return{'name':_0x107fab[_0xa548('0x27')],'type':_0x107fab[_0xa548('0x28')][_0xa548('0x29')]};});_0x4a41a5['model']=_[_0xa548('0x24')](_0x52406d,_0xa548('0x22'));_0x4a41a5[_0xa548('0x2a')]=_[_0xa548('0x2b')](_0x3d671b[_0xa548('0x2a')]);_0x4a41a5['filters']=_[_0xa548('0x2c')](_0x4a41a5[_0xa548('0x2d')],_0x4a41a5[_0xa548('0x2a')]);_0x2d0b89[_0xa548('0x2e')]=_[_0xa548('0x2c')](_0x4a41a5[_0xa548('0x2d')],qs[_0xa548('0x2f')](_0x3d671b['query']['fields']));_0x2d0b89[_0xa548('0x2e')]=_0x2d0b89[_0xa548('0x2e')][_0xa548('0x30')]?_0x2d0b89[_0xa548('0x2e')]:_0x4a41a5[_0xa548('0x2d')];if(!_0x3d671b['query'][_0xa548('0x31')](_0xa548('0x32'))){_0x2d0b89[_0xa548('0x1a')]=qs[_0xa548('0x1a')](_0x3d671b[_0xa548('0x2a')]['limit']);_0x2d0b89[_0xa548('0x1c')]=qs[_0xa548('0x1c')](_0x3d671b['query'][_0xa548('0x1c')]);}_0x2d0b89['order']=qs[_0xa548('0x33')](_0x3d671b[_0xa548('0x2a')][_0xa548('0x33')]);_0x2d0b89[_0xa548('0x34')]=qs[_0xa548('0x35')](_[_0xa548('0x36')](_0x3d671b[_0xa548('0x2a')],_0x4a41a5[_0xa548('0x35')]),_0x52406d);if(_0x3d671b['query'][_0xa548('0x37')]){_0x2d0b89[_0xa548('0x34')]=_[_0xa548('0x38')](_0x2d0b89[_0xa548('0x34')],{'$or':_['map'](_0x52406d,function(_0x38ffea){if(_0x38ffea[_0xa548('0x28')]!==_0xa548('0x39')){var _0x4072d7={};_0x4072d7[_0x38ffea['name']]={'$like':'%'+_0x3d671b['query'][_0xa548('0x37')]+'%'};return _0x4072d7;}})});}_0x2d0b89=_[_0xa548('0x38')]({},_0x2d0b89,_0x3d671b[_0xa548('0x3a')]);var _0x16da0b={'where':_0x2d0b89[_0xa548('0x34')]};return db[_0xa548('0x25')][_0xa548('0x1b')](_0x16da0b)[_0xa548('0x20')](function(_0x3259c8){_0x23268e[_0xa548('0x1b')]=_0x3259c8;if(_0x3d671b[_0xa548('0x2a')][_0xa548('0x3b')]){_0x2d0b89[_0xa548('0x3c')]=[{'all':!![]}];}return db[_0xa548('0x25')][_0xa548('0x3d')](_0x2d0b89);})[_0xa548('0x20')](function(_0x144c22){_0x23268e['rows']=_0x144c22;return _0x23268e;})[_0xa548('0x20')](respondWithFilteredResult(_0x1fee80,_0x2d0b89))[_0xa548('0x3e')](handleError(_0x1fee80,null));};exports[_0xa548('0x3f')]=function(_0x549db3,_0x4ef4dc){var _0x18a483={'raw':!![],'where':{'id':_0x549db3[_0xa548('0x40')]['id']}},_0xf97662={};_0xf97662[_0xa548('0x2d')]=_[_0xa548('0x2b')](db[_0xa548('0x25')][_0xa548('0x26')]);_0xf97662[_0xa548('0x2a')]=_[_0xa548('0x2b')](_0x549db3[_0xa548('0x2a')]);_0xf97662['filters']=_[_0xa548('0x2c')](_0xf97662['model'],_0xf97662[_0xa548('0x2a')]);_0x18a483[_0xa548('0x2e')]=_[_0xa548('0x2c')](_0xf97662[_0xa548('0x2d')],qs[_0xa548('0x2f')](_0x549db3[_0xa548('0x2a')][_0xa548('0x2f')]));_0x18a483[_0xa548('0x2e')]=_0x18a483['attributes'][_0xa548('0x30')]?_0x18a483['attributes']:_0xf97662[_0xa548('0x2d')];if(_0x549db3[_0xa548('0x2a')][_0xa548('0x3b')]){_0x18a483[_0xa548('0x3c')]=[{'all':!![]}];}_0x18a483=_['merge']({},_0x18a483,_0x549db3[_0xa548('0x3a')]);return db[_0xa548('0x25')][_0xa548('0x41')](_0x18a483)[_0xa548('0x20')](handleEntityNotFound(_0x4ef4dc,null))[_0xa548('0x20')](respondWithResult(_0x4ef4dc,null))[_0xa548('0x3e')](handleError(_0x4ef4dc,null));};exports['create']=function(_0x289dee,_0x1ef392){return db[_0xa548('0x25')][_0xa548('0x42')](_0x289dee[_0xa548('0x43')],{})[_0xa548('0x20')](respondWithResult(_0x1ef392,0xc9))[_0xa548('0x3e')](handleError(_0x1ef392,null));};exports['update']=function(_0x232fa8,_0x3b646f){if(_0x232fa8['body']['id']){delete _0x232fa8[_0xa548('0x43')]['id'];}return db[_0xa548('0x25')][_0xa548('0x41')]({'where':{'id':_0x232fa8[_0xa548('0x40')]['id']}})[_0xa548('0x20')](handleEntityNotFound(_0x3b646f,null))['then'](saveUpdates(_0x232fa8['body'],null))[_0xa548('0x20')](respondWithResult(_0x3b646f,null))['catch'](handleError(_0x3b646f,null));};exports[_0xa548('0x44')]=function(_0x107b59,_0x328826){return db[_0xa548('0x25')][_0xa548('0x41')]({'where':{'id':_0x107b59[_0xa548('0x40')]['id']}})[_0xa548('0x20')](handleEntityNotFound(_0x328826,null))[_0xa548('0x20')](removeEntity(_0x328826,null))[_0xa548('0x3e')](handleError(_0x328826,null));};exports[_0xa548('0x45')]=function(_0x302a69,_0x21e615){return db[_0xa548('0x25')]['describe']()[_0xa548('0x20')](respondWithResult(_0x21e615,null))[_0xa548('0x3e')](handleError(_0x21e615,null));}; \ No newline at end of file +var _0xc212=['hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','OpenchannelQueueReport','include','rows','includeAll','options','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','undefined','limit','count','offset','set','Content-Range','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model'];(function(_0x51aac2,_0x25a645){var _0x1028c1=function(_0x176da5){while(--_0x176da5){_0x51aac2['push'](_0x51aac2['shift']());}};_0x1028c1(++_0x25a645);}(_0xc212,0x149));var _0x2c21=function(_0x2ce31e,_0x1de58a){_0x2ce31e=_0x2ce31e-0x0;var _0x64772a=_0xc212[_0x2ce31e];return _0x64772a;};'use strict';var emlformat=require(_0x2c21('0x0'));var rimraf=require(_0x2c21('0x1'));var zipdir=require(_0x2c21('0x2'));var jsonpatch=require(_0x2c21('0x3'));var rp=require(_0x2c21('0x4'));var moment=require(_0x2c21('0x5'));var BPromise=require(_0x2c21('0x6'));var Mustache=require('mustache');var util=require(_0x2c21('0x7'));var path=require(_0x2c21('0x8'));var sox=require(_0x2c21('0x9'));var csv=require(_0x2c21('0xa'));var ejs=require(_0x2c21('0xb'));var fs=require('fs');var fs_extra=require(_0x2c21('0xc'));var _=require(_0x2c21('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2c21('0xe'));var deskjs=require(_0x2c21('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2c21('0x10'));var Papa=require(_0x2c21('0x11'));var Redis=require(_0x2c21('0x12'));var authService=require(_0x2c21('0x13'));var qs=require(_0x2c21('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c21('0x15'));var logger=require(_0x2c21('0x16'))('api');var utils=require(_0x2c21('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2c21('0x18'));var db=require(_0x2c21('0x19'))['db'];function respondWithStatusCode(_0x4cd69f,_0x17ac76){_0x17ac76=_0x17ac76||0xcc;return function(_0x186457){if(_0x186457){return _0x4cd69f[_0x2c21('0x1a')](_0x17ac76);}return _0x4cd69f['status'](_0x17ac76)[_0x2c21('0x1b')]();};}function respondWithResult(_0x4d0271,_0x5c45b4){_0x5c45b4=_0x5c45b4||0xc8;return function(_0x374c5e){if(_0x374c5e){return _0x4d0271[_0x2c21('0x1c')](_0x5c45b4)[_0x2c21('0x1d')](_0x374c5e);}};}function respondWithFilteredResult(_0x30578a,_0x53d022){return function(_0x2790ac){if(_0x2790ac){var _0x13ca72=typeof _0x53d022['offset']===_0x2c21('0x1e')&&typeof _0x53d022[_0x2c21('0x1f')]==='undefined';var _0x31e78e=_0x2790ac[_0x2c21('0x20')];var _0x51bf0d=_0x13ca72?0x0:_0x53d022[_0x2c21('0x21')];var _0xd266c1=_0x13ca72?_0x2790ac[_0x2c21('0x20')]:_0x53d022[_0x2c21('0x21')]+_0x53d022[_0x2c21('0x1f')];var _0x375a8f;if(_0xd266c1>=_0x31e78e){_0xd266c1=_0x31e78e;_0x375a8f=0xc8;}else{_0x375a8f=0xce;}_0x30578a[_0x2c21('0x1c')](_0x375a8f);return _0x30578a[_0x2c21('0x22')](_0x2c21('0x23'),_0x51bf0d+'-'+_0xd266c1+'/'+_0x31e78e)['json'](_0x2790ac);}return null;};}function patchUpdates(_0x3fdecb){return function(_0x149612){try{jsonpatch['apply'](_0x149612,_0x3fdecb,!![]);}catch(_0x1f36c7){return BPromise['reject'](_0x1f36c7);}return _0x149612[_0x2c21('0x24')]();};}function saveUpdates(_0x444bf,_0x33c18c){return function(_0x89f3d2){if(_0x89f3d2){return _0x89f3d2['update'](_0x444bf)[_0x2c21('0x25')](function(_0x1c7275){return _0x1c7275;});}return null;};}function removeEntity(_0x3d22b5,_0x5c5bb0){return function(_0xbb2575){if(_0xbb2575){return _0xbb2575[_0x2c21('0x26')]()[_0x2c21('0x25')](function(){_0x3d22b5[_0x2c21('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f9c4,_0x4d34f4){return function(_0xd99a51){if(!_0xd99a51){_0x47f9c4[_0x2c21('0x1a')](0x194);}return _0xd99a51;};}function handleError(_0x1d16bf,_0x17f711){_0x17f711=_0x17f711||0x1f4;return function(_0x322e70){logger[_0x2c21('0x27')](_0x322e70[_0x2c21('0x28')]);if(_0x322e70[_0x2c21('0x29')]){delete _0x322e70[_0x2c21('0x29')];}_0x1d16bf[_0x2c21('0x1c')](_0x17f711)[_0x2c21('0x2a')](_0x322e70);};}exports['index']=function(_0xc7c438,_0x1367a1){var _0x36f76c={},_0x50e47c={},_0x302883={'count':0x0,'rows':[]};var _0x5a4eca=_[_0x2c21('0x2b')](db['OpenchannelQueueReport'][_0x2c21('0x2c')],function(_0x3d6287){return{'name':_0x3d6287[_0x2c21('0x2d')],'type':_0x3d6287[_0x2c21('0x2e')][_0x2c21('0x2f')]};});_0x50e47c['model']=_[_0x2c21('0x2b')](_0x5a4eca,'name');_0x50e47c[_0x2c21('0x30')]=_[_0x2c21('0x31')](_0xc7c438['query']);_0x50e47c[_0x2c21('0x32')]=_['intersection'](_0x50e47c['model'],_0x50e47c[_0x2c21('0x30')]);_0x36f76c['attributes']=_[_0x2c21('0x33')](_0x50e47c['model'],qs[_0x2c21('0x34')](_0xc7c438['query'][_0x2c21('0x34')]));_0x36f76c[_0x2c21('0x35')]=_0x36f76c[_0x2c21('0x35')][_0x2c21('0x36')]?_0x36f76c['attributes']:_0x50e47c[_0x2c21('0x37')];if(!_0xc7c438[_0x2c21('0x30')][_0x2c21('0x38')](_0x2c21('0x39'))){_0x36f76c[_0x2c21('0x1f')]=qs[_0x2c21('0x1f')](_0xc7c438[_0x2c21('0x30')][_0x2c21('0x1f')]);_0x36f76c[_0x2c21('0x21')]=qs[_0x2c21('0x21')](_0xc7c438['query'][_0x2c21('0x21')]);}_0x36f76c[_0x2c21('0x3a')]=qs[_0x2c21('0x3b')](_0xc7c438['query']['sort']);_0x36f76c['where']=qs[_0x2c21('0x32')](_[_0x2c21('0x3c')](_0xc7c438['query'],_0x50e47c[_0x2c21('0x32')]),_0x5a4eca);if(_0xc7c438[_0x2c21('0x30')][_0x2c21('0x3d')]){_0x36f76c['where']=_[_0x2c21('0x3e')](_0x36f76c[_0x2c21('0x3f')],{'$or':_[_0x2c21('0x2b')](_0x5a4eca,function(_0x36c491){if(_0x36c491[_0x2c21('0x2e')]!==_0x2c21('0x40')){var _0x1c7beb={};_0x1c7beb[_0x36c491[_0x2c21('0x29')]]={'$like':'%'+_0xc7c438[_0x2c21('0x30')][_0x2c21('0x3d')]+'%'};return _0x1c7beb;}})});}_0x36f76c=_[_0x2c21('0x3e')]({},_0x36f76c,_0xc7c438['options']);var _0x1ceed8={'where':_0x36f76c['where']};return db[_0x2c21('0x41')][_0x2c21('0x20')](_0x1ceed8)[_0x2c21('0x25')](function(_0x2c847a){_0x302883[_0x2c21('0x20')]=_0x2c847a;if(_0xc7c438['query']['includeAll']){_0x36f76c[_0x2c21('0x42')]=[{'all':!![]}];}return db[_0x2c21('0x41')]['findAll'](_0x36f76c);})[_0x2c21('0x25')](function(_0x47f0a6){_0x302883[_0x2c21('0x43')]=_0x47f0a6;return _0x302883;})[_0x2c21('0x25')](respondWithFilteredResult(_0x1367a1,_0x36f76c))['catch'](handleError(_0x1367a1,null));};exports['show']=function(_0x4881f2,_0x42a542){var _0x457460={'raw':!![],'where':{'id':_0x4881f2['params']['id']}},_0x4f5bdb={};_0x4f5bdb['model']=_[_0x2c21('0x31')](db['OpenchannelQueueReport']['rawAttributes']);_0x4f5bdb['query']=_[_0x2c21('0x31')](_0x4881f2[_0x2c21('0x30')]);_0x4f5bdb[_0x2c21('0x32')]=_[_0x2c21('0x33')](_0x4f5bdb[_0x2c21('0x37')],_0x4f5bdb[_0x2c21('0x30')]);_0x457460[_0x2c21('0x35')]=_[_0x2c21('0x33')](_0x4f5bdb['model'],qs[_0x2c21('0x34')](_0x4881f2[_0x2c21('0x30')][_0x2c21('0x34')]));_0x457460['attributes']=_0x457460['attributes'][_0x2c21('0x36')]?_0x457460[_0x2c21('0x35')]:_0x4f5bdb['model'];if(_0x4881f2[_0x2c21('0x30')][_0x2c21('0x44')]){_0x457460[_0x2c21('0x42')]=[{'all':!![]}];}_0x457460=_['merge']({},_0x457460,_0x4881f2[_0x2c21('0x45')]);return db['OpenchannelQueueReport'][_0x2c21('0x46')](_0x457460)['then'](handleEntityNotFound(_0x42a542,null))[_0x2c21('0x25')](respondWithResult(_0x42a542,null))[_0x2c21('0x47')](handleError(_0x42a542,null));};exports[_0x2c21('0x48')]=function(_0x370ad5,_0x1a217b){return db[_0x2c21('0x41')]['create'](_0x370ad5[_0x2c21('0x49')],{})[_0x2c21('0x25')](respondWithResult(_0x1a217b,0xc9))[_0x2c21('0x47')](handleError(_0x1a217b,null));};exports[_0x2c21('0x4a')]=function(_0x1bfcc4,_0x1d5dc6){if(_0x1bfcc4[_0x2c21('0x49')]['id']){delete _0x1bfcc4[_0x2c21('0x49')]['id'];}return db[_0x2c21('0x41')][_0x2c21('0x46')]({'where':{'id':_0x1bfcc4[_0x2c21('0x4b')]['id']}})[_0x2c21('0x25')](handleEntityNotFound(_0x1d5dc6,null))[_0x2c21('0x25')](saveUpdates(_0x1bfcc4[_0x2c21('0x49')],null))[_0x2c21('0x25')](respondWithResult(_0x1d5dc6,null))[_0x2c21('0x47')](handleError(_0x1d5dc6,null));};exports['destroy']=function(_0x39a3df,_0x230cb3){return db['OpenchannelQueueReport'][_0x2c21('0x46')]({'where':{'id':_0x39a3df['params']['id']}})['then'](handleEntityNotFound(_0x230cb3,null))[_0x2c21('0x25')](removeEntity(_0x230cb3,null))[_0x2c21('0x47')](handleError(_0x230cb3,null));};exports[_0x2c21('0x4c')]=function(_0x177d5b,_0x51b7b0){return db[_0x2c21('0x41')]['describe']()['then'](respondWithResult(_0x51b7b0,null))[_0x2c21('0x47')](handleError(_0x51b7b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 3e00772..b6d0ec5 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x24f5ec,_0x34c588){var _0x366b7c=function(_0x4146c0){while(--_0x4146c0){_0x24f5ec['push'](_0x24f5ec['shift']());}};_0x366b7c(++_0x34c588);}(_0xe14b,0x93));var _0xbe14=function(_0x485377,_0xfa8793){_0x485377=_0x485377-0x0;var _0x19e180=_0xe14b[_0x485377];return _0x19e180;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x814b,0x1a2));var _0xb814=function(_0x5ff464,_0x5038d7){_0x5ff464=_0x5ff464-0x0;var _0x347182=_0x814b[_0x5ff464];return _0x347182;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b799c13..2adb98b 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 _0x235b=['code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','limit','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xafa01e,_0x7230fe){var _0x1c95a0=function(_0x25548e){while(--_0x25548e){_0xafa01e['push'](_0xafa01e['shift']());}};_0x1c95a0(++_0x7230fe);}(_0x235b,0x1ed));var _0xb235=function(_0x54c10a,_0x59e255){_0x54c10a=_0x54c10a-0x0;var _0x3f729c=_0x235b[_0x54c10a];return _0x3f729c;};'use strict';var _=require(_0xb235('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb235('0x1'));var rs=require(_0xb235('0x2'));var fs=require('fs');var Redis=require(_0xb235('0x3'));var db=require(_0xb235('0x4'))['db'];var utils=require(_0xb235('0x5'));var logger=require(_0xb235('0x6'))('rpc');var config=require(_0xb235('0x7'));var jayson=require(_0xb235('0x8'));var client=jayson[_0xb235('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d0ae,_0x44559a,_0x2affe8){return new BPromise(function(_0x436d63,_0x3241b4){return client['request'](_0x12d0ae,_0x2affe8)['then'](function(_0xecf759){logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));logger[_0xb235('0xd')](_0xb235('0xe'),_0x44559a,_0xb235('0xc'),JSON[_0xb235('0xf')](_0xecf759));if(_0xecf759['error']){if(_0xecf759[_0xb235('0x10')][_0xb235('0x11')]===0x1f4){logger[_0xb235('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x44559a,_0xecf759[_0xb235('0x10')]['message']);return _0x3241b4(_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);}logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);return _0x436d63(_0xecf759[_0xb235('0x10')]['message']);}else{logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));_0x436d63(_0xecf759[_0xb235('0x13')][_0xb235('0x12')]);}})[_0xb235('0x14')](function(_0x16f044){logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0x16f044);_0x3241b4(_0x16f044);});});}exports[_0xb235('0x15')]=function(_0x2f1c46){var _0x1b9eae=this;return new Promise(function(_0x1f7cb9,_0x55a479){return db[_0xb235('0x16')]['create'](_0x2f1c46[_0xb235('0x17')],{'raw':_0x2f1c46['options']?_0x2f1c46[_0xb235('0x18')][_0xb235('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x447ec6){logger[_0xb235('0xa')](_0xb235('0x15'),_0x2f1c46);logger[_0xb235('0xd')](_0xb235('0x15'),_0x2f1c46,JSON['stringify'](_0x447ec6));_0x1f7cb9(_0x447ec6);})[_0xb235('0x14')](function(_0x12f787){logger[_0xb235('0x10')](_0xb235('0x15'),_0x12f787[_0xb235('0x12')],_0x2f1c46);_0x55a479(_0x1b9eae[_0xb235('0x10')](0x1f4,_0x12f787['message']));});});};exports[_0xb235('0x1a')]=function(_0x57d7f5){var _0x2b5c93=this;return new Promise(function(_0x1d7122,_0xb97b29){return db['OpenchannelQueueReport']['update'](_0x57d7f5['body'],{'raw':_0x57d7f5[_0xb235('0x18')]?_0x57d7f5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d7f5[_0xb235('0x18')]?_0x57d7f5[_0xb235('0x18')][_0xb235('0x1b')]||null:null,'attributes':_0x57d7f5['options']?_0x57d7f5[_0xb235('0x18')]['attributes']||null:null,'limit':_0x57d7f5['options']?_0x57d7f5[_0xb235('0x18')][_0xb235('0x1c')]||null:null})[_0xb235('0x1d')](function(_0x4fe640){logger[_0xb235('0xa')](_0xb235('0x1a'),_0x57d7f5);logger[_0xb235('0xd')]('UpdateOpenchannelQueueReport',_0x57d7f5,JSON['stringify'](_0x4fe640));_0x1d7122(_0x4fe640);})[_0xb235('0x14')](function(_0x4871b7){logger[_0xb235('0x10')]('UpdateOpenchannelQueueReport',_0x4871b7['message'],_0x57d7f5);_0xb97b29(_0x2b5c93[_0xb235('0x10')](0x1f4,_0x4871b7[_0xb235('0x12')]));});});}; \ No newline at end of file +var _0x97c1=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelQueueReport','create','body','options','raw','then','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash'];(function(_0x37b769,_0x2a975d){var _0x288257=function(_0x775d8e){while(--_0x775d8e){_0x37b769['push'](_0x37b769['shift']());}};_0x288257(++_0x2a975d);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateOpenchannelQueueReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});};exports[_0x197c('0x1b')]=function(_0x2a1310){var _0x37b040=this;return new Promise(function(_0x25486a,_0x5f4a02){return db[_0x197c('0x13')][_0x197c('0x1c')](_0x2a1310[_0x197c('0x15')],{'raw':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1310['options']?_0x2a1310['options'][_0x197c('0x1d')]||null:null,'attributes':_0x2a1310['options']?_0x2a1310[_0x197c('0x16')][_0x197c('0x1e')]||null:null,'limit':_0x2a1310[_0x197c('0x16')]?_0x2a1310[_0x197c('0x16')][_0x197c('0x1f')]||null:null})[_0x197c('0x18')](function(_0x2b6154){logger[_0x197c('0xa')](_0x197c('0x1b'),_0x2a1310);logger['debug']('UpdateOpenchannelQueueReport',_0x2a1310,JSON['stringify'](_0x2b6154));_0x25486a(_0x2b6154);})['catch'](function(_0x5f7425){logger['error'](_0x197c('0x1b'),_0x5f7425[_0x197c('0x10')],_0x2a1310);_0x5f4a02(_0x37b040['error'](0x1f4,_0x5f7425[_0x197c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1d8953e..538e4bd 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 _0x489c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','delete','destroy','multer','path'];(function(_0x2b5ca8,_0x4a027c){var _0x4148ad=function(_0x296fd8){while(--_0x296fd8){_0x2b5ca8['push'](_0x2b5ca8['shift']());}};_0x4148ad(++_0x4a027c);}(_0x489c,0x116));var _0xc489=function(_0x4024bd,_0x164def){_0x4024bd=_0x4024bd-0x0;var _0x5cbe79=_0x489c[_0x4024bd];return _0x5cbe79;};'use strict';var multer=require(_0xc489('0x0'));var util=require('util');var path=require(_0xc489('0x1'));var timeout=require(_0xc489('0x2'));var express=require(_0xc489('0x3'));var router=express[_0xc489('0x4')]();var fs_extra=require(_0xc489('0x5'));var auth=require(_0xc489('0x6'));var interaction=require(_0xc489('0x7'));var config=require('../../config/environment');var controller=require(_0xc489('0x8'));router[_0xc489('0x9')]('/',auth[_0xc489('0xa')](),controller[_0xc489('0xb')]);router[_0xc489('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc489('0xc')]);router['get']('/:id',auth[_0xc489('0xa')](),controller[_0xc489('0xd')]);router[_0xc489('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc489('0xf')](_0xc489('0x10'),auth[_0xc489('0xa')](),controller[_0xc489('0x11')]);router[_0xc489('0x12')](_0xc489('0x10'),auth['isAuthenticated'](),controller[_0xc489('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1e40=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2bf4d9,_0xc537b4){var _0x5a8fed=function(_0x452193){while(--_0x452193){_0x2bf4d9['push'](_0x2bf4d9['shift']());}};_0x5a8fed(++_0xc537b4);}(_0x1e40,0x148));var _0x01e4=function(_0x77e4bf,_0x4ff911){_0x77e4bf=_0x77e4bf-0x0;var _0x3aa027=_0x1e40[_0x77e4bf];return _0x3aa027;};'use strict';var multer=require(_0x01e4('0x0'));var util=require(_0x01e4('0x1'));var path=require(_0x01e4('0x2'));var timeout=require(_0x01e4('0x3'));var express=require(_0x01e4('0x4'));var router=express[_0x01e4('0x5')]();var fs_extra=require(_0x01e4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x01e4('0x7'));var config=require(_0x01e4('0x8'));var controller=require(_0x01e4('0x9'));router[_0x01e4('0xa')]('/',auth[_0x01e4('0xb')](),controller[_0x01e4('0xc')]);router[_0x01e4('0xa')](_0x01e4('0xd'),auth[_0x01e4('0xb')](),controller[_0x01e4('0xe')]);router['get'](_0x01e4('0xf'),auth[_0x01e4('0xb')](),controller[_0x01e4('0x10')]);router['post']('/',auth[_0x01e4('0xb')](),controller['create']);router[_0x01e4('0x11')]('/:id',auth[_0x01e4('0xb')](),controller['update']);router[_0x01e4('0x12')](_0x01e4('0xf'),auth[_0x01e4('0xb')](),controller[_0x01e4('0x13')]);module[_0x01e4('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 1a59ef5..4be81f9 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x54214a,_0x16b6dd){var _0x1fea42=function(_0x2fca00){while(--_0x2fca00){_0x54214a['push'](_0x54214a['shift']());}};_0x1fea42(++_0x16b6dd);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x552352,_0x51e3b0){var _0x1e0d71=function(_0xa0c4f5){while(--_0xa0c4f5){_0x552352['push'](_0x552352['shift']());}};_0x1e0d71(++_0x51e3b0);}(_0x34e8,0x12c));var _0x834e=function(_0x446073,_0x325311){_0x446073=_0x446073-0x0;var _0x158da0=_0x34e8[_0x446073];return _0x158da0;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 8cfdfe9..08861c9 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 _0x0901=['eml-format','fast-json-patch','moment','bluebird','mustache','util','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','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','rawAttributes','includeAll','find','create','update','params','destroy','describe'];(function(_0x34543b,_0x49ca0e){var _0x588dc2=function(_0x10d4e4){while(--_0x10d4e4){_0x34543b['push'](_0x34543b['shift']());}};_0x588dc2(++_0x49ca0e);}(_0x0901,0x9a));var _0x1090=function(_0x50ccbf,_0xd187e6){_0x50ccbf=_0x50ccbf-0x0;var _0x497033=_0x0901[_0x50ccbf];return _0x497033;};'use strict';var emlformat=require(_0x1090('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1090('0x1'));var rp=require('request-promise');var moment=require(_0x1090('0x2'));var BPromise=require(_0x1090('0x3'));var Mustache=require(_0x1090('0x4'));var util=require(_0x1090('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1090('0x6'));var ejs=require(_0x1090('0x7'));var fs=require('fs');var fs_extra=require(_0x1090('0x8'));var _=require(_0x1090('0x9'));var squel=require(_0x1090('0xa'));var crypto=require(_0x1090('0xb'));var jsforce=require(_0x1090('0xc'));var deskjs=require(_0x1090('0xd'));var toCsv=require(_0x1090('0x6'));var querystring=require(_0x1090('0xe'));var Papa=require(_0x1090('0xf'));var Redis=require(_0x1090('0x10'));var authService=require(_0x1090('0x11'));var qs=require(_0x1090('0x12'));var as=require(_0x1090('0x13'));var hardwareService=require(_0x1090('0x14'));var logger=require(_0x1090('0x15'))(_0x1090('0x16'));var utils=require(_0x1090('0x17'));var config=require(_0x1090('0x18'));var licenseUtil=require(_0x1090('0x19'));var db=require(_0x1090('0x1a'))['db'];function respondWithStatusCode(_0xeea39d,_0x1e0b21){_0x1e0b21=_0x1e0b21||0xcc;return function(_0x4cd198){if(_0x4cd198){return _0xeea39d['sendStatus'](_0x1e0b21);}return _0xeea39d[_0x1090('0x1b')](_0x1e0b21)[_0x1090('0x1c')]();};}function respondWithResult(_0x1a2c90,_0xacd330){_0xacd330=_0xacd330||0xc8;return function(_0x15ab0d){if(_0x15ab0d){return _0x1a2c90['status'](_0xacd330)['json'](_0x15ab0d);}};}function respondWithFilteredResult(_0x1e46bc,_0x568cf6){return function(_0x5d2186){if(_0x5d2186){var _0x74a9e=typeof _0x568cf6[_0x1090('0x1d')]===_0x1090('0x1e')&&typeof _0x568cf6['limit']===_0x1090('0x1e');var _0x579002=_0x5d2186[_0x1090('0x1f')];var _0x506c0d=_0x74a9e?0x0:_0x568cf6[_0x1090('0x1d')];var _0x4d89a5=_0x74a9e?_0x5d2186[_0x1090('0x1f')]:_0x568cf6['offset']+_0x568cf6[_0x1090('0x20')];var _0x59c28e;if(_0x4d89a5>=_0x579002){_0x4d89a5=_0x579002;_0x59c28e=0xc8;}else{_0x59c28e=0xce;}_0x1e46bc[_0x1090('0x1b')](_0x59c28e);return _0x1e46bc[_0x1090('0x21')](_0x1090('0x22'),_0x506c0d+'-'+_0x4d89a5+'/'+_0x579002)[_0x1090('0x23')](_0x5d2186);}return null;};}function patchUpdates(_0x2b8238){return function(_0x2718ea){try{jsonpatch[_0x1090('0x24')](_0x2718ea,_0x2b8238,!![]);}catch(_0x32a0a1){return BPromise['reject'](_0x32a0a1);}return _0x2718ea[_0x1090('0x25')]();};}function saveUpdates(_0x494304,_0x3845d1){return function(_0x503226){if(_0x503226){return _0x503226['update'](_0x494304)[_0x1090('0x26')](function(_0x1965a1){return _0x1965a1;});}return null;};}function removeEntity(_0x5828b8,_0x4b7057){return function(_0x2f10a1){if(_0x2f10a1){return _0x2f10a1['destroy']()[_0x1090('0x26')](function(){_0x5828b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2490c2,_0x25f5b9){return function(_0x565b76){if(!_0x565b76){_0x2490c2[_0x1090('0x27')](0x194);}return _0x565b76;};}function handleError(_0x2eab3f,_0x3744a4){_0x3744a4=_0x3744a4||0x1f4;return function(_0x4d3569){logger[_0x1090('0x28')](_0x4d3569[_0x1090('0x29')]);if(_0x4d3569['name']){delete _0x4d3569[_0x1090('0x2a')];}_0x2eab3f[_0x1090('0x1b')](_0x3744a4)[_0x1090('0x2b')](_0x4d3569);};}exports[_0x1090('0x2c')]=function(_0x5060fd,_0xf0116){var _0x46d6ce={},_0x1ba1ab={},_0x2e15b1={'count':0x0,'rows':[]};var _0x408970=_[_0x1090('0x2d')](db[_0x1090('0x2e')]['rawAttributes'],function(_0x517745){return{'name':_0x517745[_0x1090('0x2f')],'type':_0x517745[_0x1090('0x30')]['key']};});_0x1ba1ab[_0x1090('0x31')]=_['map'](_0x408970,_0x1090('0x2a'));_0x1ba1ab[_0x1090('0x32')]=_[_0x1090('0x33')](_0x5060fd[_0x1090('0x32')]);_0x1ba1ab[_0x1090('0x34')]=_['intersection'](_0x1ba1ab[_0x1090('0x31')],_0x1ba1ab['query']);_0x46d6ce[_0x1090('0x35')]=_[_0x1090('0x36')](_0x1ba1ab['model'],qs[_0x1090('0x37')](_0x5060fd[_0x1090('0x32')]['fields']));_0x46d6ce[_0x1090('0x35')]=_0x46d6ce[_0x1090('0x35')][_0x1090('0x38')]?_0x46d6ce['attributes']:_0x1ba1ab['model'];if(!_0x5060fd[_0x1090('0x32')][_0x1090('0x39')](_0x1090('0x3a'))){_0x46d6ce['limit']=qs[_0x1090('0x20')](_0x5060fd[_0x1090('0x32')][_0x1090('0x20')]);_0x46d6ce[_0x1090('0x1d')]=qs[_0x1090('0x1d')](_0x5060fd[_0x1090('0x32')]['offset']);}_0x46d6ce[_0x1090('0x3b')]=qs['sort'](_0x5060fd[_0x1090('0x32')]['sort']);_0x46d6ce[_0x1090('0x3c')]=qs[_0x1090('0x34')](_[_0x1090('0x3d')](_0x5060fd[_0x1090('0x32')],_0x1ba1ab[_0x1090('0x34')]),_0x408970);if(_0x5060fd[_0x1090('0x32')][_0x1090('0x3e')]){_0x46d6ce['where']=_[_0x1090('0x3f')](_0x46d6ce[_0x1090('0x3c')],{'$or':_[_0x1090('0x2d')](_0x408970,function(_0x8a05bc){if(_0x8a05bc['type']!==_0x1090('0x40')){var _0x38aa0b={};_0x38aa0b[_0x8a05bc['name']]={'$like':'%'+_0x5060fd[_0x1090('0x32')][_0x1090('0x3e')]+'%'};return _0x38aa0b;}})});}_0x46d6ce=_[_0x1090('0x3f')]({},_0x46d6ce,_0x5060fd[_0x1090('0x41')]);var _0x6e2814={'where':_0x46d6ce[_0x1090('0x3c')]};return db[_0x1090('0x2e')][_0x1090('0x1f')](_0x6e2814)[_0x1090('0x26')](function(_0x3dc8ed){_0x2e15b1[_0x1090('0x1f')]=_0x3dc8ed;if(_0x5060fd[_0x1090('0x32')]['includeAll']){_0x46d6ce['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1090('0x42')](_0x46d6ce);})[_0x1090('0x26')](function(_0x172a71){_0x2e15b1[_0x1090('0x43')]=_0x172a71;return _0x2e15b1;})[_0x1090('0x26')](respondWithFilteredResult(_0xf0116,_0x46d6ce))[_0x1090('0x44')](handleError(_0xf0116,null));};exports['show']=function(_0x35cde4,_0x5e9384){var _0xedd064={'raw':!![],'where':{'id':_0x35cde4['params']['id']}},_0xab18f5={};_0xab18f5[_0x1090('0x31')]=_['keys'](db[_0x1090('0x2e')][_0x1090('0x45')]);_0xab18f5[_0x1090('0x32')]=_[_0x1090('0x33')](_0x35cde4[_0x1090('0x32')]);_0xab18f5['filters']=_[_0x1090('0x36')](_0xab18f5[_0x1090('0x31')],_0xab18f5['query']);_0xedd064[_0x1090('0x35')]=_['intersection'](_0xab18f5[_0x1090('0x31')],qs[_0x1090('0x37')](_0x35cde4['query']['fields']));_0xedd064[_0x1090('0x35')]=_0xedd064[_0x1090('0x35')][_0x1090('0x38')]?_0xedd064[_0x1090('0x35')]:_0xab18f5[_0x1090('0x31')];if(_0x35cde4['query'][_0x1090('0x46')]){_0xedd064['include']=[{'all':!![]}];}_0xedd064=_[_0x1090('0x3f')]({},_0xedd064,_0x35cde4[_0x1090('0x41')]);return db[_0x1090('0x2e')][_0x1090('0x47')](_0xedd064)[_0x1090('0x26')](handleEntityNotFound(_0x5e9384,null))[_0x1090('0x26')](respondWithResult(_0x5e9384,null))['catch'](handleError(_0x5e9384,null));};exports['create']=function(_0x390b67,_0x190732){return db[_0x1090('0x2e')][_0x1090('0x48')](_0x390b67['body'],{})[_0x1090('0x26')](respondWithResult(_0x190732,0xc9))[_0x1090('0x44')](handleError(_0x190732,null));};exports[_0x1090('0x49')]=function(_0x2261f3,_0x5ce68a){if(_0x2261f3['body']['id']){delete _0x2261f3['body']['id'];}return db['OpenchannelTransferReport'][_0x1090('0x47')]({'where':{'id':_0x2261f3[_0x1090('0x4a')]['id']}})[_0x1090('0x26')](handleEntityNotFound(_0x5ce68a,null))[_0x1090('0x26')](saveUpdates(_0x2261f3['body'],null))[_0x1090('0x26')](respondWithResult(_0x5ce68a,null))[_0x1090('0x44')](handleError(_0x5ce68a,null));};exports[_0x1090('0x4b')]=function(_0x1c60eb,_0x1654ed){return db[_0x1090('0x2e')]['find']({'where':{'id':_0x1c60eb[_0x1090('0x4a')]['id']}})[_0x1090('0x26')](handleEntityNotFound(_0x1654ed,null))[_0x1090('0x26')](removeEntity(_0x1654ed,null))[_0x1090('0x44')](handleError(_0x1654ed,null));};exports[_0x1090('0x4c')]=function(_0x40dc6f,_0x5662d3){return db[_0x1090('0x2e')]['describe']()['then'](respondWithResult(_0x5662d3,null))['catch'](handleError(_0x5662d3,null));}; \ No newline at end of file +var _0x3a52=['crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','then','show','params','length','find','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash'];(function(_0x2d2a9b,_0x5870ff){var _0x3d2d49=function(_0x13884d){while(--_0x13884d){_0x2d2a9b['push'](_0x2d2a9b['shift']());}};_0x3d2d49(++_0x5870ff);}(_0x3a52,0xd3));var _0x23a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a52[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x23a5('0x0'));var rimraf=require(_0x23a5('0x1'));var zipdir=require(_0x23a5('0x2'));var jsonpatch=require(_0x23a5('0x3'));var rp=require(_0x23a5('0x4'));var moment=require(_0x23a5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x23a5('0x6'));var util=require('util');var path=require(_0x23a5('0x7'));var sox=require(_0x23a5('0x8'));var csv=require('to-csv');var ejs=require(_0x23a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23a5('0xa'));var squel=require('squel');var crypto=require(_0x23a5('0xb'));var jsforce=require(_0x23a5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x23a5('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x23a5('0xe'));var authService=require(_0x23a5('0xf'));var qs=require(_0x23a5('0x10'));var as=require(_0x23a5('0x11'));var hardwareService=require(_0x23a5('0x12'));var logger=require('../../config/logger')(_0x23a5('0x13'));var utils=require(_0x23a5('0x14'));var config=require(_0x23a5('0x15'));var licenseUtil=require(_0x23a5('0x16'));var db=require(_0x23a5('0x17'))['db'];function respondWithStatusCode(_0x498816,_0x214941){_0x214941=_0x214941||0xcc;return function(_0x1667f7){if(_0x1667f7){return _0x498816[_0x23a5('0x18')](_0x214941);}return _0x498816[_0x23a5('0x19')](_0x214941)[_0x23a5('0x1a')]();};}function respondWithResult(_0x4e2562,_0x4bdaa0){_0x4bdaa0=_0x4bdaa0||0xc8;return function(_0x409702){if(_0x409702){return _0x4e2562[_0x23a5('0x19')](_0x4bdaa0)[_0x23a5('0x1b')](_0x409702);}};}function respondWithFilteredResult(_0x2c7ca0,_0x1265f1){return function(_0x1cd2cc){if(_0x1cd2cc){var _0x4dead0=typeof _0x1265f1[_0x23a5('0x1c')]===_0x23a5('0x1d')&&typeof _0x1265f1[_0x23a5('0x1e')]===_0x23a5('0x1d');var _0x38a91f=_0x1cd2cc[_0x23a5('0x1f')];var _0x40e1ca=_0x4dead0?0x0:_0x1265f1[_0x23a5('0x1c')];var _0x445350=_0x4dead0?_0x1cd2cc['count']:_0x1265f1[_0x23a5('0x1c')]+_0x1265f1[_0x23a5('0x1e')];var _0x4fb7a4;if(_0x445350>=_0x38a91f){_0x445350=_0x38a91f;_0x4fb7a4=0xc8;}else{_0x4fb7a4=0xce;}_0x2c7ca0[_0x23a5('0x19')](_0x4fb7a4);return _0x2c7ca0[_0x23a5('0x20')](_0x23a5('0x21'),_0x40e1ca+'-'+_0x445350+'/'+_0x38a91f)[_0x23a5('0x1b')](_0x1cd2cc);}return null;};}function patchUpdates(_0x3ad61f){return function(_0x305446){try{jsonpatch[_0x23a5('0x22')](_0x305446,_0x3ad61f,!![]);}catch(_0x9d00c1){return BPromise[_0x23a5('0x23')](_0x9d00c1);}return _0x305446['save']();};}function saveUpdates(_0x2cdccb,_0x246bc3){return function(_0x40a75d){if(_0x40a75d){return _0x40a75d[_0x23a5('0x24')](_0x2cdccb)['then'](function(_0x280eca){return _0x280eca;});}return null;};}function removeEntity(_0x479f3,_0x1b971d){return function(_0x2933bd){if(_0x2933bd){return _0x2933bd[_0x23a5('0x25')]()['then'](function(){_0x479f3[_0x23a5('0x19')](0xcc)[_0x23a5('0x1a')]();});}};}function handleEntityNotFound(_0x144c1e,_0x3c3bdc){return function(_0x13bea2){if(!_0x13bea2){_0x144c1e['sendStatus'](0x194);}return _0x13bea2;};}function handleError(_0x174f16,_0x26b5cd){_0x26b5cd=_0x26b5cd||0x1f4;return function(_0x47d902){logger[_0x23a5('0x26')](_0x47d902[_0x23a5('0x27')]);if(_0x47d902[_0x23a5('0x28')]){delete _0x47d902[_0x23a5('0x28')];}_0x174f16[_0x23a5('0x19')](_0x26b5cd)['send'](_0x47d902);};}exports['index']=function(_0xeeb3b3,_0x248953){var _0x1782f7={},_0x21320a={},_0x1888cb={'count':0x0,'rows':[]};var _0x47c2fb=_[_0x23a5('0x29')](db[_0x23a5('0x2a')]['rawAttributes'],function(_0x25ea37){return{'name':_0x25ea37[_0x23a5('0x2b')],'type':_0x25ea37[_0x23a5('0x2c')][_0x23a5('0x2d')]};});_0x21320a[_0x23a5('0x2e')]=_[_0x23a5('0x29')](_0x47c2fb,'name');_0x21320a[_0x23a5('0x2f')]=_[_0x23a5('0x30')](_0xeeb3b3[_0x23a5('0x2f')]);_0x21320a['filters']=_[_0x23a5('0x31')](_0x21320a[_0x23a5('0x2e')],_0x21320a['query']);_0x1782f7[_0x23a5('0x32')]=_[_0x23a5('0x31')](_0x21320a[_0x23a5('0x2e')],qs[_0x23a5('0x33')](_0xeeb3b3[_0x23a5('0x2f')][_0x23a5('0x33')]));_0x1782f7[_0x23a5('0x32')]=_0x1782f7[_0x23a5('0x32')]['length']?_0x1782f7[_0x23a5('0x32')]:_0x21320a['model'];if(!_0xeeb3b3['query'][_0x23a5('0x34')](_0x23a5('0x35'))){_0x1782f7[_0x23a5('0x1e')]=qs[_0x23a5('0x1e')](_0xeeb3b3[_0x23a5('0x2f')][_0x23a5('0x1e')]);_0x1782f7[_0x23a5('0x1c')]=qs[_0x23a5('0x1c')](_0xeeb3b3['query'][_0x23a5('0x1c')]);}_0x1782f7[_0x23a5('0x36')]=qs[_0x23a5('0x37')](_0xeeb3b3[_0x23a5('0x2f')]['sort']);_0x1782f7['where']=qs[_0x23a5('0x38')](_[_0x23a5('0x39')](_0xeeb3b3[_0x23a5('0x2f')],_0x21320a[_0x23a5('0x38')]),_0x47c2fb);if(_0xeeb3b3[_0x23a5('0x2f')]['filter']){_0x1782f7[_0x23a5('0x3a')]=_[_0x23a5('0x3b')](_0x1782f7[_0x23a5('0x3a')],{'$or':_[_0x23a5('0x29')](_0x47c2fb,function(_0x15a8cb){if(_0x15a8cb['type']!==_0x23a5('0x3c')){var _0xa7843d={};_0xa7843d[_0x15a8cb['name']]={'$like':'%'+_0xeeb3b3[_0x23a5('0x2f')][_0x23a5('0x3d')]+'%'};return _0xa7843d;}})});}_0x1782f7=_['merge']({},_0x1782f7,_0xeeb3b3[_0x23a5('0x3e')]);var _0x46e8e5={'where':_0x1782f7[_0x23a5('0x3a')]};return db[_0x23a5('0x2a')][_0x23a5('0x1f')](_0x46e8e5)['then'](function(_0x4eedcd){_0x1888cb[_0x23a5('0x1f')]=_0x4eedcd;if(_0xeeb3b3[_0x23a5('0x2f')][_0x23a5('0x3f')]){_0x1782f7[_0x23a5('0x40')]=[{'all':!![]}];}return db[_0x23a5('0x2a')]['findAll'](_0x1782f7);})['then'](function(_0x136dff){_0x1888cb[_0x23a5('0x41')]=_0x136dff;return _0x1888cb;})[_0x23a5('0x42')](respondWithFilteredResult(_0x248953,_0x1782f7))['catch'](handleError(_0x248953,null));};exports[_0x23a5('0x43')]=function(_0x5ee15d,_0x48a1fc){var _0x5487e4={'raw':!![],'where':{'id':_0x5ee15d[_0x23a5('0x44')]['id']}},_0x1c7024={};_0x1c7024[_0x23a5('0x2e')]=_[_0x23a5('0x30')](db[_0x23a5('0x2a')]['rawAttributes']);_0x1c7024[_0x23a5('0x2f')]=_[_0x23a5('0x30')](_0x5ee15d[_0x23a5('0x2f')]);_0x1c7024['filters']=_[_0x23a5('0x31')](_0x1c7024[_0x23a5('0x2e')],_0x1c7024[_0x23a5('0x2f')]);_0x5487e4[_0x23a5('0x32')]=_[_0x23a5('0x31')](_0x1c7024[_0x23a5('0x2e')],qs[_0x23a5('0x33')](_0x5ee15d['query'][_0x23a5('0x33')]));_0x5487e4['attributes']=_0x5487e4['attributes'][_0x23a5('0x45')]?_0x5487e4[_0x23a5('0x32')]:_0x1c7024[_0x23a5('0x2e')];if(_0x5ee15d[_0x23a5('0x2f')][_0x23a5('0x3f')]){_0x5487e4['include']=[{'all':!![]}];}_0x5487e4=_[_0x23a5('0x3b')]({},_0x5487e4,_0x5ee15d[_0x23a5('0x3e')]);return db[_0x23a5('0x2a')][_0x23a5('0x46')](_0x5487e4)['then'](handleEntityNotFound(_0x48a1fc,null))['then'](respondWithResult(_0x48a1fc,null))['catch'](handleError(_0x48a1fc,null));};exports['create']=function(_0x2267e9,_0x2523ee){return db[_0x23a5('0x2a')]['create'](_0x2267e9[_0x23a5('0x47')],{})['then'](respondWithResult(_0x2523ee,0xc9))[_0x23a5('0x48')](handleError(_0x2523ee,null));};exports[_0x23a5('0x24')]=function(_0x286ae2,_0x5dacd2){if(_0x286ae2['body']['id']){delete _0x286ae2['body']['id'];}return db[_0x23a5('0x2a')]['find']({'where':{'id':_0x286ae2[_0x23a5('0x44')]['id']}})[_0x23a5('0x42')](handleEntityNotFound(_0x5dacd2,null))[_0x23a5('0x42')](saveUpdates(_0x286ae2[_0x23a5('0x47')],null))['then'](respondWithResult(_0x5dacd2,null))[_0x23a5('0x48')](handleError(_0x5dacd2,null));};exports[_0x23a5('0x25')]=function(_0x41c70a,_0x5f00c4){return db[_0x23a5('0x2a')][_0x23a5('0x46')]({'where':{'id':_0x41c70a[_0x23a5('0x44')]['id']}})[_0x23a5('0x42')](handleEntityNotFound(_0x5f00c4,null))['then'](removeEntity(_0x5f00c4,null))[_0x23a5('0x48')](handleError(_0x5f00c4,null));};exports[_0x23a5('0x49')]=function(_0x4e2a9d,_0x381adc){return db[_0x23a5('0x2a')]['describe']()[_0x23a5('0x42')](respondWithResult(_0x381adc,null))[_0x23a5('0x48')](handleError(_0x381adc,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e7fb99a..ea8bc06 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 _0x77b0=['rimraf','../../config/environment','./openchannelTransferReport.attributes','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x37e3e8,_0x1acb9e){var _0x2e3f31=function(_0xb8a5e4){while(--_0xb8a5e4){_0x37e3e8['push'](_0x37e3e8['shift']());}};_0x2e3f31(++_0x1acb9e);}(_0x77b0,0x131));var _0x077b=function(_0x12ba64,_0x16b1fb){_0x12ba64=_0x12ba64-0x0;var _0x3db161=_0x77b0[_0x12ba64];return _0x3db161;};'use strict';var _=require(_0x077b('0x0'));var util=require(_0x077b('0x1'));var logger=require(_0x077b('0x2'))(_0x077b('0x3'));var moment=require(_0x077b('0x4'));var BPromise=require(_0x077b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x077b('0x6'));var rimraf=require(_0x077b('0x7'));var config=require(_0x077b('0x8'));var attributes=require(_0x077b('0x9'));module['exports']=function(_0x249fbd,_0x3f5388){return _0x249fbd['define']('OpenchannelTransferReport',attributes,{'tableName':_0x077b('0xa'),'paranoid':![],'indexes':[{'name':_0x077b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8626=['moment','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8626,0xc0));var _0x6862=function(_0x21b408,_0x405f04){_0x21b408=_0x21b408-0x0;var _0x551d6b=_0x8626[_0x21b408];return _0x551d6b;};'use strict';var _=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var logger=require(_0x6862('0x2'))(_0x6862('0x3'));var moment=require(_0x6862('0x4'));var BPromise=require('bluebird');var rp=require(_0x6862('0x5'));var fs=require('fs');var path=require(_0x6862('0x6'));var rimraf=require('rimraf');var config=require(_0x6862('0x7'));var attributes=require(_0x6862('0x8'));module[_0x6862('0x9')]=function(_0x51bbca,_0x328551){return _0x51bbca[_0x6862('0xa')](_0x6862('0xb'),attributes,{'tableName':_0x6862('0xc'),'paranoid':![],'indexes':[{'name':_0x6862('0xd'),'fields':[_0x6862('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 185d59f..e9df70f 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 _0xc818=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x378aca,_0x13e103){var _0x1b7b4b=function(_0xed42d6){while(--_0xed42d6){_0x378aca['push'](_0x378aca['shift']());}};_0x1b7b4b(++_0x13e103);}(_0xc818,0x1e3));var _0x8c81=function(_0xd03f7d,_0xce6913){_0xd03f7d=_0xd03f7d-0x0;var _0xbc4548=_0xc818[_0xd03f7d];return _0xbc4548;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c81('0x4'));var db=require(_0x8c81('0x5'))['db'];var utils=require(_0x8c81('0x6'));var logger=require(_0x8c81('0x7'))(_0x8c81('0x8'));var config=require(_0x8c81('0x9'));var jayson=require(_0x8c81('0xa'));var client=jayson['client'][_0x8c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d663e,_0x32cf31,_0x43d142){return new BPromise(function(_0x501240,_0x1173cf){return client[_0x8c81('0xc')](_0x3d663e,_0x43d142)[_0x8c81('0xd')](function(_0x15ebff){logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));logger['debug'](_0x8c81('0x11'),_0x32cf31,_0x8c81('0x10'),JSON[_0x8c81('0x12')](_0x15ebff));if(_0x15ebff[_0x8c81('0x13')]){if(_0x15ebff['error'][_0x8c81('0x14')]===0x1f4){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);return _0x1173cf(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff['error']['message']);return _0x501240(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}else{logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));_0x501240(_0x15ebff[_0x8c81('0x16')]['message']);}})[_0x8c81('0x17')](function(_0x29ccb0){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x29ccb0);_0x1173cf(_0x29ccb0);});});} \ No newline at end of file +var _0x9fc5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x43c6d1,_0x20edf8){var _0x334a91=function(_0x499115){while(--_0x499115){_0x43c6d1['push'](_0x43c6d1['shift']());}};_0x334a91(++_0x20edf8);}(_0x9fc5,0xb6));var _0x59fc=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0x9fc5[_0x4a96d2];return _0x38af04;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var moment=require(_0x59fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x59fc('0x2'));var fs=require('fs');var Redis=require(_0x59fc('0x3'));var db=require(_0x59fc('0x4'))['db'];var utils=require(_0x59fc('0x5'));var logger=require(_0x59fc('0x6'))(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var jayson=require(_0x59fc('0x9'));var client=jayson['client'][_0x59fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13897f,_0x2c47fb,_0x55fa6d){return new BPromise(function(_0xdd2bb9,_0x313063){return client[_0x59fc('0xb')](_0x13897f,_0x55fa6d)[_0x59fc('0xc')](function(_0x39bc72){logger[_0x59fc('0xd')](_0x59fc('0xe'),_0x2c47fb,'request\x20sent');logger[_0x59fc('0xf')](_0x59fc('0x10'),_0x2c47fb,_0x59fc('0x11'),JSON[_0x59fc('0x12')](_0x39bc72));if(_0x39bc72[_0x59fc('0x13')]){if(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x14')]===0x1f4){logger['error'](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0x313063(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0xdd2bb9(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}else{logger['info'](_0x59fc('0xe'),_0x2c47fb,_0x59fc('0x11'));_0xdd2bb9(_0x39bc72['result'][_0x59fc('0x15')]);}})[_0x59fc('0x16')](function(_0x4162c4){logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x4162c4);_0x313063(_0x4162c4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ab58e2f..ffe9644 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 _0x22f0=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','/:id','isAuthenticated','show','post','delete','destroy'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x22f0,0x150));var _0x022f=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x22f0[_0x4310e8];return _0x301445;};'use strict';var multer=require('multer');var util=require(_0x022f('0x0'));var path=require(_0x022f('0x1'));var timeout=require('connect-timeout');var express=require(_0x022f('0x2'));var router=express['Router']();var fs_extra=require(_0x022f('0x3'));var auth=require(_0x022f('0x4'));var interaction=require(_0x022f('0x5'));var config=require('../../config/environment');var controller=require(_0x022f('0x6'));router[_0x022f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x022f('0x7')](_0x022f('0x8'),auth[_0x022f('0x9')](),controller[_0x022f('0xa')]);router[_0x022f('0xb')]('/',auth[_0x022f('0x9')](),controller['create']);router['put'](_0x022f('0x8'),auth[_0x022f('0x9')](),controller['update']);router[_0x022f('0xc')](_0x022f('0x8'),auth[_0x022f('0x9')](),controller[_0x022f('0xd')]);module['exports']=router; \ No newline at end of file +var _0xbd9a=['update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x196e05,_0x11204a){var _0x162ae3=function(_0x363beb){while(--_0x363beb){_0x196e05['push'](_0x196e05['shift']());}};_0x162ae3(++_0x11204a);}(_0xbd9a,0x157));var _0xabd9=function(_0x56525e,_0x101ba8){_0x56525e=_0x56525e-0x0;var _0x20b22c=_0xbd9a[_0x56525e];return _0x20b22c;};'use strict';var multer=require(_0xabd9('0x0'));var util=require('util');var path=require(_0xabd9('0x1'));var timeout=require('connect-timeout');var express=require(_0xabd9('0x2'));var router=express['Router']();var fs_extra=require(_0xabd9('0x3'));var auth=require(_0xabd9('0x4'));var interaction=require(_0xabd9('0x5'));var config=require('../../config/environment');var controller=require(_0xabd9('0x6'));router[_0xabd9('0x7')]('/',auth[_0xabd9('0x8')](),controller['index']);router[_0xabd9('0x7')]('/:id',auth[_0xabd9('0x8')](),controller[_0xabd9('0x9')]);router[_0xabd9('0xa')]('/',auth[_0xabd9('0x8')](),controller[_0xabd9('0xb')]);router[_0xabd9('0xc')](_0xabd9('0xd'),auth[_0xabd9('0x8')](),controller[_0xabd9('0xe')]);router[_0xabd9('0xf')]('/:id',auth[_0xabd9('0x8')](),controller['destroy']);module[_0xabd9('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 56055f2..da52cae 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 _0x68dc=['exports','STRING','sequelize'];(function(_0x3c414c,_0x399dbb){var _0x4f3062=function(_0x1b71cc){while(--_0x1b71cc){_0x3c414c['push'](_0x3c414c['shift']());}};_0x4f3062(++_0x399dbb);}(_0x68dc,0xce));var _0xc68d=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x68dc[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0xc68d('0x0'));module[_0xc68d('0x1')]={'name':{'type':Sequelize[_0xc68d('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc68d('0x2')]}}; \ No newline at end of file +var _0x1e48=['exports','STRING','name','sequelize'];(function(_0x1c2d28,_0x305b58){var _0x56c101=function(_0xf8eb23){while(--_0xf8eb23){_0x1c2d28['push'](_0x1c2d28['shift']());}};_0x56c101(++_0x305b58);}(_0x1e48,0x15b));var _0x81e4=function(_0x9bfc6c,_0x159ef2){_0x9bfc6c=_0x9bfc6c-0x0;var _0x1f8376=_0x1e48[_0x9bfc6c];return _0x1f8376;};'use strict';var Sequelize=require(_0x81e4('0x0'));module[_0x81e4('0x1')]={'name':{'type':Sequelize[_0x81e4('0x2')],'unique':_0x81e4('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x81e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 092063f..b2b5d1f 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 _0x6958=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','set','Content-Range','save','then','destroy','Pauses','UserProfileResource','status','end','error','send','map','Pause','rawAttributes','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','count','includeAll','include','rows','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x6958,0x132));var _0x8695=function(_0x4e70e5,_0x3580bd){_0x4e70e5=_0x4e70e5-0x0;var _0x31d38d=_0x6958[_0x4e70e5];return _0x31d38d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8695('0x0'));var zipdir=require(_0x8695('0x1'));var jsonpatch=require(_0x8695('0x2'));var rp=require(_0x8695('0x3'));var moment=require('moment');var BPromise=require(_0x8695('0x4'));var Mustache=require(_0x8695('0x5'));var util=require(_0x8695('0x6'));var path=require(_0x8695('0x7'));var sox=require(_0x8695('0x8'));var csv=require(_0x8695('0x9'));var ejs=require(_0x8695('0xa'));var fs=require('fs');var fs_extra=require(_0x8695('0xb'));var _=require(_0x8695('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8695('0xd'));var toCsv=require(_0x8695('0x9'));var querystring=require(_0x8695('0xe'));var Papa=require('papaparse');var Redis=require(_0x8695('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8695('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8695('0x11'));var logger=require(_0x8695('0x12'))(_0x8695('0x13'));var utils=require(_0x8695('0x14'));var config=require(_0x8695('0x15'));var licenseUtil=require(_0x8695('0x16'));var db=require(_0x8695('0x17'))['db'];function respondWithStatusCode(_0x1639ed,_0x2e0352){_0x2e0352=_0x2e0352||0xcc;return function(_0x15f84a){if(_0x15f84a){return _0x1639ed[_0x8695('0x18')](_0x2e0352);}return _0x1639ed['status'](_0x2e0352)['end']();};}function respondWithResult(_0x5cfaec,_0x43b292){_0x43b292=_0x43b292||0xc8;return function(_0x4f3d18){if(_0x4f3d18){return _0x5cfaec['status'](_0x43b292)[_0x8695('0x19')](_0x4f3d18);}};}function respondWithFilteredResult(_0x30cdd8,_0x56a097){return function(_0x5a9b45){if(_0x5a9b45){var _0x5e3cf5=typeof _0x56a097['offset']===_0x8695('0x1a')&&typeof _0x56a097[_0x8695('0x1b')]===_0x8695('0x1a');var _0x138ca1=_0x5a9b45['count'];var _0x5db1b9=_0x5e3cf5?0x0:_0x56a097[_0x8695('0x1c')];var _0x4c71a8=_0x5e3cf5?_0x5a9b45['count']:_0x56a097[_0x8695('0x1c')]+_0x56a097[_0x8695('0x1b')];var _0x4f05fa;if(_0x4c71a8>=_0x138ca1){_0x4c71a8=_0x138ca1;_0x4f05fa=0xc8;}else{_0x4f05fa=0xce;}_0x30cdd8['status'](_0x4f05fa);return _0x30cdd8[_0x8695('0x1d')](_0x8695('0x1e'),_0x5db1b9+'-'+_0x4c71a8+'/'+_0x138ca1)[_0x8695('0x19')](_0x5a9b45);}return null;};}function patchUpdates(_0x5acf1c){return function(_0x3eee85){try{jsonpatch['apply'](_0x3eee85,_0x5acf1c,!![]);}catch(_0x551ff5){return BPromise['reject'](_0x551ff5);}return _0x3eee85[_0x8695('0x1f')]();};}function saveUpdates(_0x7797a5,_0x11b965){return function(_0x3efdb4){if(_0x3efdb4){return _0x3efdb4['update'](_0x7797a5)[_0x8695('0x20')](function(_0x320a46){return _0x320a46;});}return null;};}function removeEntity(_0xd75912,_0x253f78){return function(_0x390469){if(_0x390469){return _0x390469[_0x8695('0x21')]()[_0x8695('0x20')](function(){var _0x5ceefd=_0x390469['get']({'plain':!![]});var _0xb03e52=_0x8695('0x22');return db[_0x8695('0x23')][_0x8695('0x21')]({'where':{'type':_0xb03e52,'resourceId':_0x5ceefd['id']}})['then'](function(){return _0x390469;});})['then'](function(){_0xd75912[_0x8695('0x24')](0xcc)[_0x8695('0x25')]();});}};}function handleEntityNotFound(_0x3a0f2a,_0x28046e){return function(_0x4e4785){if(!_0x4e4785){_0x3a0f2a[_0x8695('0x18')](0x194);}return _0x4e4785;};}function handleError(_0x13dad2,_0x4d7e63){_0x4d7e63=_0x4d7e63||0x1f4;return function(_0x493cfd){logger[_0x8695('0x26')](_0x493cfd['stack']);if(_0x493cfd['name']){delete _0x493cfd['name'];}_0x13dad2[_0x8695('0x24')](_0x4d7e63)[_0x8695('0x27')](_0x493cfd);};}exports['index']=function(_0x504dbd,_0x5641a0){var _0x312510={},_0x31930f={},_0x14b876={'count':0x0,'rows':[]};var _0x3e382b=_[_0x8695('0x28')](db[_0x8695('0x29')][_0x8695('0x2a')],function(_0x5d3d37){return{'name':_0x5d3d37['fieldName'],'type':_0x5d3d37['type'][_0x8695('0x2b')]};});_0x31930f[_0x8695('0x2c')]=_[_0x8695('0x28')](_0x3e382b,_0x8695('0x2d'));_0x31930f[_0x8695('0x2e')]=_[_0x8695('0x2f')](_0x504dbd[_0x8695('0x2e')]);_0x31930f[_0x8695('0x30')]=_[_0x8695('0x31')](_0x31930f[_0x8695('0x2c')],_0x31930f[_0x8695('0x2e')]);_0x312510['attributes']=_[_0x8695('0x31')](_0x31930f[_0x8695('0x2c')],qs['fields'](_0x504dbd['query'][_0x8695('0x32')]));_0x312510[_0x8695('0x33')]=_0x312510[_0x8695('0x33')][_0x8695('0x34')]?_0x312510[_0x8695('0x33')]:_0x31930f[_0x8695('0x2c')];if(!_0x504dbd[_0x8695('0x2e')]['hasOwnProperty'](_0x8695('0x35'))){_0x312510[_0x8695('0x1b')]=qs['limit'](_0x504dbd[_0x8695('0x2e')][_0x8695('0x1b')]);_0x312510[_0x8695('0x1c')]=qs[_0x8695('0x1c')](_0x504dbd['query'][_0x8695('0x1c')]);}_0x312510[_0x8695('0x36')]=qs[_0x8695('0x37')](_0x504dbd['query']['sort']);_0x312510[_0x8695('0x38')]=qs[_0x8695('0x30')](_[_0x8695('0x39')](_0x504dbd[_0x8695('0x2e')],_0x31930f[_0x8695('0x30')]),_0x3e382b);if(_0x504dbd['query']['filter']){_0x312510[_0x8695('0x38')]=_['merge'](_0x312510['where'],{'$or':_[_0x8695('0x28')](_0x3e382b,function(_0xea5803){if(_0xea5803[_0x8695('0x3a')]!==_0x8695('0x3b')){var _0x4204e0={};_0x4204e0[_0xea5803['name']]={'$like':'%'+_0x504dbd[_0x8695('0x2e')][_0x8695('0x3c')]+'%'};return _0x4204e0;}})});}_0x312510=_[_0x8695('0x3d')]({},_0x312510,_0x504dbd[_0x8695('0x3e')]);var _0xbb4af2={'where':_0x312510[_0x8695('0x38')]};return db[_0x8695('0x29')][_0x8695('0x3f')](_0xbb4af2)[_0x8695('0x20')](function(_0x297f35){_0x14b876[_0x8695('0x3f')]=_0x297f35;if(_0x504dbd['query'][_0x8695('0x40')]){_0x312510[_0x8695('0x41')]=[{'all':!![]}];}return db[_0x8695('0x29')]['findAll'](_0x312510);})['then'](function(_0x252276){_0x14b876[_0x8695('0x42')]=_0x252276;return _0x14b876;})['then'](respondWithFilteredResult(_0x5641a0,_0x312510))[_0x8695('0x43')](handleError(_0x5641a0,null));};exports['show']=function(_0x288a6c,_0x3b2a9d){var _0x520545={'raw':!![],'where':{'id':_0x288a6c[_0x8695('0x44')]['id']}},_0xab2b92={};_0xab2b92[_0x8695('0x2c')]=_[_0x8695('0x2f')](db[_0x8695('0x29')][_0x8695('0x2a')]);_0xab2b92['query']=_['keys'](_0x288a6c[_0x8695('0x2e')]);_0xab2b92[_0x8695('0x30')]=_[_0x8695('0x31')](_0xab2b92[_0x8695('0x2c')],_0xab2b92[_0x8695('0x2e')]);_0x520545['attributes']=_[_0x8695('0x31')](_0xab2b92[_0x8695('0x2c')],qs[_0x8695('0x32')](_0x288a6c[_0x8695('0x2e')][_0x8695('0x32')]));_0x520545[_0x8695('0x33')]=_0x520545[_0x8695('0x33')][_0x8695('0x34')]?_0x520545[_0x8695('0x33')]:_0xab2b92[_0x8695('0x2c')];if(_0x288a6c[_0x8695('0x2e')][_0x8695('0x40')]){_0x520545[_0x8695('0x41')]=[{'all':!![]}];}_0x520545=_[_0x8695('0x3d')]({},_0x520545,_0x288a6c[_0x8695('0x3e')]);return db[_0x8695('0x29')][_0x8695('0x45')](_0x520545)[_0x8695('0x20')](handleEntityNotFound(_0x3b2a9d,null))[_0x8695('0x20')](respondWithResult(_0x3b2a9d,null))[_0x8695('0x43')](handleError(_0x3b2a9d,null));};exports[_0x8695('0x46')]=function(_0x4bb53c,_0xfe842e){return db[_0x8695('0x29')][_0x8695('0x46')](_0x4bb53c[_0x8695('0x47')],{})[_0x8695('0x20')](function(_0x2e63d7){var _0x463fd1=_0x4bb53c['user'][_0x8695('0x48')]({'plain':!![]});if(!_0x463fd1)throw new Error(_0x8695('0x49'));if(_0x463fd1['role']==='user'){var _0x22d417=_0x2e63d7[_0x8695('0x48')]({'plain':!![]});var _0x51ea7a='Pauses';return db['UserProfileSection'][_0x8695('0x45')]({'where':{'name':_0x51ea7a,'userProfileId':_0x463fd1[_0x8695('0x4a')]},'raw':!![]})[_0x8695('0x20')](function(_0x263fab){if(_0x263fab&&_0x263fab[_0x8695('0x4b')]===0x0){return db[_0x8695('0x23')]['create']({'name':_0x22d417[_0x8695('0x2d')],'resourceId':_0x22d417['id'],'type':_0x263fab[_0x8695('0x2d')],'sectionId':_0x263fab['id']},{})[_0x8695('0x20')](function(){return _0x2e63d7;});}else{return _0x2e63d7;}})[_0x8695('0x43')](function(_0x3cabac){logger['error'](_0x8695('0x4c'),_0x3cabac);throw _0x3cabac;});}return _0x2e63d7;})[_0x8695('0x20')](respondWithResult(_0xfe842e,0xc9))['catch'](handleError(_0xfe842e,null));};exports['update']=function(_0x353864,_0x306a49){if(_0x353864[_0x8695('0x47')]['id']){delete _0x353864[_0x8695('0x47')]['id'];}return db[_0x8695('0x29')][_0x8695('0x45')]({'where':{'id':_0x353864[_0x8695('0x44')]['id']}})[_0x8695('0x20')](handleEntityNotFound(_0x306a49,null))[_0x8695('0x20')](saveUpdates(_0x353864[_0x8695('0x47')],null))[_0x8695('0x20')](respondWithResult(_0x306a49,null))[_0x8695('0x43')](handleError(_0x306a49,null));};exports[_0x8695('0x21')]=function(_0x1411a6,_0x1dc181){return db['Pause'][_0x8695('0x45')]({'where':{'id':_0x1411a6[_0x8695('0x44')]['id']}})[_0x8695('0x20')](handleEntityNotFound(_0x1dc181,null))[_0x8695('0x20')](removeEntity(_0x1dc181,null))[_0x8695('0x43')](handleError(_0x1dc181,null));}; \ No newline at end of file +var _0xfa5b=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Pauses','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','where','filters','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','includeAll','include','find'];(function(_0x3f2f19,_0x2ea0c4){var _0x18f929=function(_0x358d09){while(--_0x358d09){_0x3f2f19['push'](_0x3f2f19['shift']());}};_0x18f929(++_0x2ea0c4);}(_0xfa5b,0x152));var _0xbfa5=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xfa5b[_0x5c9307];return _0x373e29;};'use strict';var emlformat=require(_0xbfa5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbfa5('0x1'));var jsonpatch=require(_0xbfa5('0x2'));var rp=require(_0xbfa5('0x3'));var moment=require('moment');var BPromise=require(_0xbfa5('0x4'));var Mustache=require(_0xbfa5('0x5'));var util=require('util');var path=require(_0xbfa5('0x6'));var sox=require(_0xbfa5('0x7'));var csv=require(_0xbfa5('0x8'));var ejs=require(_0xbfa5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbfa5('0xa'));var squel=require('squel');var crypto=require(_0xbfa5('0xb'));var jsforce=require(_0xbfa5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbfa5('0x8'));var querystring=require(_0xbfa5('0xd'));var Papa=require(_0xbfa5('0xe'));var Redis=require('ioredis');var authService=require(_0xbfa5('0xf'));var qs=require(_0xbfa5('0x10'));var as=require(_0xbfa5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfa5('0x12'))(_0xbfa5('0x13'));var utils=require(_0xbfa5('0x14'));var config=require(_0xbfa5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbfa5('0x16'))['db'];function respondWithStatusCode(_0x35944a,_0x74a955){_0x74a955=_0x74a955||0xcc;return function(_0x358ba6){if(_0x358ba6){return _0x35944a[_0xbfa5('0x17')](_0x74a955);}return _0x35944a[_0xbfa5('0x18')](_0x74a955)[_0xbfa5('0x19')]();};}function respondWithResult(_0x265c6a,_0x11bc78){_0x11bc78=_0x11bc78||0xc8;return function(_0x305316){if(_0x305316){return _0x265c6a[_0xbfa5('0x18')](_0x11bc78)[_0xbfa5('0x1a')](_0x305316);}};}function respondWithFilteredResult(_0x5abf3a,_0x34475e){return function(_0x124546){if(_0x124546){var _0x56f96a=typeof _0x34475e['offset']==='undefined'&&typeof _0x34475e[_0xbfa5('0x1b')]==='undefined';var _0x1027ed=_0x124546['count'];var _0x4f1a2c=_0x56f96a?0x0:_0x34475e[_0xbfa5('0x1c')];var _0x3400e2=_0x56f96a?_0x124546[_0xbfa5('0x1d')]:_0x34475e[_0xbfa5('0x1c')]+_0x34475e['limit'];var _0xe71025;if(_0x3400e2>=_0x1027ed){_0x3400e2=_0x1027ed;_0xe71025=0xc8;}else{_0xe71025=0xce;}_0x5abf3a[_0xbfa5('0x18')](_0xe71025);return _0x5abf3a[_0xbfa5('0x1e')](_0xbfa5('0x1f'),_0x4f1a2c+'-'+_0x3400e2+'/'+_0x1027ed)[_0xbfa5('0x1a')](_0x124546);}return null;};}function patchUpdates(_0x567f18){return function(_0x3b5f83){try{jsonpatch[_0xbfa5('0x20')](_0x3b5f83,_0x567f18,!![]);}catch(_0x1d62c9){return BPromise[_0xbfa5('0x21')](_0x1d62c9);}return _0x3b5f83[_0xbfa5('0x22')]();};}function saveUpdates(_0x4abae3,_0x3a5a20){return function(_0xbc74fc){if(_0xbc74fc){return _0xbc74fc[_0xbfa5('0x23')](_0x4abae3)['then'](function(_0x2b1f4d){return _0x2b1f4d;});}return null;};}function removeEntity(_0x427f1c,_0x326252){return function(_0x16fca8){if(_0x16fca8){return _0x16fca8[_0xbfa5('0x24')]()[_0xbfa5('0x25')](function(){var _0x1638b9=_0x16fca8[_0xbfa5('0x26')]({'plain':!![]});var _0x12f681=_0xbfa5('0x27');return db['UserProfileResource'][_0xbfa5('0x24')]({'where':{'type':_0x12f681,'resourceId':_0x1638b9['id']}})[_0xbfa5('0x25')](function(){return _0x16fca8;});})[_0xbfa5('0x25')](function(){_0x427f1c['status'](0xcc)[_0xbfa5('0x19')]();});}};}function handleEntityNotFound(_0x41c54c,_0x5511d6){return function(_0x403e58){if(!_0x403e58){_0x41c54c['sendStatus'](0x194);}return _0x403e58;};}function handleError(_0x1e8549,_0x5d7eb9){_0x5d7eb9=_0x5d7eb9||0x1f4;return function(_0x579991){logger[_0xbfa5('0x28')](_0x579991['stack']);if(_0x579991[_0xbfa5('0x29')]){delete _0x579991[_0xbfa5('0x29')];}_0x1e8549['status'](_0x5d7eb9)[_0xbfa5('0x2a')](_0x579991);};}exports[_0xbfa5('0x2b')]=function(_0x51046e,_0x33fa8c){var _0x2d6730={},_0x1c58e5={},_0x114bde={'count':0x0,'rows':[]};var _0x38d92f=_[_0xbfa5('0x2c')](db[_0xbfa5('0x2d')][_0xbfa5('0x2e')],function(_0x296650){return{'name':_0x296650[_0xbfa5('0x2f')],'type':_0x296650[_0xbfa5('0x30')][_0xbfa5('0x31')]};});_0x1c58e5[_0xbfa5('0x32')]=_[_0xbfa5('0x2c')](_0x38d92f,_0xbfa5('0x29'));_0x1c58e5[_0xbfa5('0x33')]=_[_0xbfa5('0x34')](_0x51046e[_0xbfa5('0x33')]);_0x1c58e5['filters']=_[_0xbfa5('0x35')](_0x1c58e5[_0xbfa5('0x32')],_0x1c58e5[_0xbfa5('0x33')]);_0x2d6730[_0xbfa5('0x36')]=_[_0xbfa5('0x35')](_0x1c58e5[_0xbfa5('0x32')],qs[_0xbfa5('0x37')](_0x51046e[_0xbfa5('0x33')][_0xbfa5('0x37')]));_0x2d6730[_0xbfa5('0x36')]=_0x2d6730[_0xbfa5('0x36')][_0xbfa5('0x38')]?_0x2d6730['attributes']:_0x1c58e5[_0xbfa5('0x32')];if(!_0x51046e['query'][_0xbfa5('0x39')]('nolimit')){_0x2d6730[_0xbfa5('0x1b')]=qs[_0xbfa5('0x1b')](_0x51046e[_0xbfa5('0x33')][_0xbfa5('0x1b')]);_0x2d6730[_0xbfa5('0x1c')]=qs['offset'](_0x51046e[_0xbfa5('0x33')]['offset']);}_0x2d6730['order']=qs['sort'](_0x51046e[_0xbfa5('0x33')]['sort']);_0x2d6730[_0xbfa5('0x3a')]=qs[_0xbfa5('0x3b')](_[_0xbfa5('0x3c')](_0x51046e[_0xbfa5('0x33')],_0x1c58e5[_0xbfa5('0x3b')]),_0x38d92f);if(_0x51046e[_0xbfa5('0x33')]['filter']){_0x2d6730[_0xbfa5('0x3a')]=_[_0xbfa5('0x3d')](_0x2d6730[_0xbfa5('0x3a')],{'$or':_[_0xbfa5('0x2c')](_0x38d92f,function(_0x26871b){if(_0x26871b[_0xbfa5('0x30')]!==_0xbfa5('0x3e')){var _0x332f94={};_0x332f94[_0x26871b['name']]={'$like':'%'+_0x51046e[_0xbfa5('0x33')][_0xbfa5('0x3f')]+'%'};return _0x332f94;}})});}_0x2d6730=_['merge']({},_0x2d6730,_0x51046e[_0xbfa5('0x40')]);var _0x227375={'where':_0x2d6730['where']};return db[_0xbfa5('0x2d')][_0xbfa5('0x1d')](_0x227375)['then'](function(_0x4e1896){_0x114bde[_0xbfa5('0x1d')]=_0x4e1896;if(_0x51046e[_0xbfa5('0x33')]['includeAll']){_0x2d6730['include']=[{'all':!![]}];}return db[_0xbfa5('0x2d')][_0xbfa5('0x41')](_0x2d6730);})[_0xbfa5('0x25')](function(_0x4033bf){_0x114bde[_0xbfa5('0x42')]=_0x4033bf;return _0x114bde;})['then'](respondWithFilteredResult(_0x33fa8c,_0x2d6730))[_0xbfa5('0x43')](handleError(_0x33fa8c,null));};exports[_0xbfa5('0x44')]=function(_0x5cbb67,_0x597250){var _0x4577f0={'raw':!![],'where':{'id':_0x5cbb67['params']['id']}},_0x1eaff8={};_0x1eaff8['model']=_[_0xbfa5('0x34')](db['Pause'][_0xbfa5('0x2e')]);_0x1eaff8[_0xbfa5('0x33')]=_[_0xbfa5('0x34')](_0x5cbb67[_0xbfa5('0x33')]);_0x1eaff8[_0xbfa5('0x3b')]=_[_0xbfa5('0x35')](_0x1eaff8[_0xbfa5('0x32')],_0x1eaff8[_0xbfa5('0x33')]);_0x4577f0[_0xbfa5('0x36')]=_[_0xbfa5('0x35')](_0x1eaff8[_0xbfa5('0x32')],qs[_0xbfa5('0x37')](_0x5cbb67[_0xbfa5('0x33')][_0xbfa5('0x37')]));_0x4577f0[_0xbfa5('0x36')]=_0x4577f0[_0xbfa5('0x36')][_0xbfa5('0x38')]?_0x4577f0[_0xbfa5('0x36')]:_0x1eaff8[_0xbfa5('0x32')];if(_0x5cbb67[_0xbfa5('0x33')][_0xbfa5('0x45')]){_0x4577f0[_0xbfa5('0x46')]=[{'all':!![]}];}_0x4577f0=_[_0xbfa5('0x3d')]({},_0x4577f0,_0x5cbb67['options']);return db[_0xbfa5('0x2d')][_0xbfa5('0x47')](_0x4577f0)[_0xbfa5('0x25')](handleEntityNotFound(_0x597250,null))[_0xbfa5('0x25')](respondWithResult(_0x597250,null))[_0xbfa5('0x43')](handleError(_0x597250,null));};exports[_0xbfa5('0x48')]=function(_0x10f7e5,_0x2c0b29){return db['Pause']['create'](_0x10f7e5[_0xbfa5('0x49')],{})['then'](function(_0x4235e4){var _0x359d01=_0x10f7e5[_0xbfa5('0x4a')]['get']({'plain':!![]});if(!_0x359d01)throw new Error(_0xbfa5('0x4b'));if(_0x359d01[_0xbfa5('0x4c')]===_0xbfa5('0x4a')){var _0x4950dc=_0x4235e4[_0xbfa5('0x26')]({'plain':!![]});var _0x1133db='Pauses';return db[_0xbfa5('0x4d')][_0xbfa5('0x47')]({'where':{'name':_0x1133db,'userProfileId':_0x359d01[_0xbfa5('0x4e')]},'raw':!![]})['then'](function(_0x24aa22){if(_0x24aa22&&_0x24aa22[_0xbfa5('0x4f')]===0x0){return db[_0xbfa5('0x50')][_0xbfa5('0x48')]({'name':_0x4950dc[_0xbfa5('0x29')],'resourceId':_0x4950dc['id'],'type':_0x24aa22[_0xbfa5('0x29')],'sectionId':_0x24aa22['id']},{})[_0xbfa5('0x25')](function(){return _0x4235e4;});}else{return _0x4235e4;}})[_0xbfa5('0x43')](function(_0xf69af9){logger[_0xbfa5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf69af9);throw _0xf69af9;});}return _0x4235e4;})[_0xbfa5('0x25')](respondWithResult(_0x2c0b29,0xc9))[_0xbfa5('0x43')](handleError(_0x2c0b29,null));};exports[_0xbfa5('0x23')]=function(_0x345c93,_0x3f1148){if(_0x345c93['body']['id']){delete _0x345c93['body']['id'];}return db['Pause']['find']({'where':{'id':_0x345c93[_0xbfa5('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f1148,null))['then'](saveUpdates(_0x345c93[_0xbfa5('0x49')],null))[_0xbfa5('0x25')](respondWithResult(_0x3f1148,null))['catch'](handleError(_0x3f1148,null));};exports[_0xbfa5('0x24')]=function(_0x50557c,_0x3d72d8){return db[_0xbfa5('0x2d')][_0xbfa5('0x47')]({'where':{'id':_0x50557c[_0xbfa5('0x51')]['id']}})['then'](handleEntityNotFound(_0x3d72d8,null))[_0xbfa5('0x25')](removeEntity(_0x3d72d8,null))[_0xbfa5('0x43')](handleError(_0x3d72d8,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 80d8911..3d45ab5 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 _0x55ca=['./pause.attributes','exports','define','tools_pauses','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x55ca,0x126));var _0xa55c=function(_0x32e865,_0x317078){_0x32e865=_0x32e865-0x0;var _0x850461=_0x55ca[_0x32e865];return _0x850461;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Pause',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x1c1a05,_0x31d226){var _0x2b3fb8=function(_0x2feda0){while(--_0x2feda0){_0x1c1a05['push'](_0x1c1a05['shift']());}};_0x2b3fb8(++_0x31d226);}(_0x53ec,0x192));var _0xc53e=function(_0x4b40de,_0x3efe59){_0x4b40de=_0x4b40de-0x0;var _0x5c9460=_0x53ec[_0x4b40de];return _0x5c9460;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'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 b50f37c..1d3e8f8 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x150f14,_0x18798b){var _0x2967da=function(_0x349beb){while(--_0x349beb){_0x150f14['push'](_0x150f14['shift']());}};_0x2967da(++_0x18798b);}(_0xb10b,0x12a));var _0xbb10=function(_0x22a9db,_0x4506c5){_0x22a9db=_0x22a9db-0x0;var _0x35715a=_0xb10b[_0x22a9db];return _0x35715a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x4e70fe,_0x4d2438){var _0x1c9808=function(_0x23708f){while(--_0x23708f){_0x4e70fe['push'](_0x4e70fe['shift']());}};_0x1c9808(++_0x4d2438);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea8e3,_0x2b81ce){_0x4ea8e3=_0x4ea8e3-0x0;var _0x5aa438=_0x7a54[_0x4ea8e3];return _0x5aa438;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index d6ac18a..bb0a2ff 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 _0x9f62=['extname','now','post','single','file','upload','put','/:id','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id/download','isAuthenticated','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x12f80f,_0x47f849){var _0x21b3a0=function(_0x1799dc){while(--_0x1799dc){_0x12f80f['push'](_0x12f80f['shift']());}};_0x21b3a0(++_0x47f849);}(_0x9f62,0x154));var _0x29f6=function(_0x5cd4ef,_0x48610f){_0x5cd4ef=_0x5cd4ef-0x0;var _0x1f86b5=_0x9f62[_0x5cd4ef];return _0x1f86b5;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),controller[_0x29f6('0xa')]);router[_0x29f6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xb'),auth[_0x29f6('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29b3f5,_0x442623,_0x4909e0){_0x4909e0(null,path[_0x29f6('0xd')](config[_0x29f6('0xe')],'server/files/plugins'));},'filename':function(_0x5b9b6a,_0x559585,_0x57b2d2){_0x559585[_0x29f6('0xf')]=_0x559585[_0x29f6('0xf')][_0x29f6('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57b2d2(null,util[_0x29f6('0x11')](_0x29f6('0x12'),path[_0x29f6('0x13')](_0x559585[_0x29f6('0xf')],path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])),Date[_0x29f6('0x15')](),path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])));}})});router[_0x29f6('0x16')]('/',upload[_0x29f6('0x17')](_0x29f6('0x18')),controller[_0x29f6('0x19')]);router[_0x29f6('0x16')]('/webhook',controller['webhookPost']);router[_0x29f6('0x1a')](_0x29f6('0x1b'),auth[_0x29f6('0xc')](),controller['update']);router[_0x29f6('0x1c')](_0x29f6('0x1b'),auth['isAuthenticated'](),controller[_0x29f6('0x1c')]);module[_0x29f6('0x1d')]=router; \ No newline at end of file +var _0x6737=['diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','upload','webhookPost','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','index','/:id','show','get','download'];(function(_0x21d100,_0x2d4eb8){var _0x2325a3=function(_0x523949){while(--_0x523949){_0x21d100['push'](_0x21d100['shift']());}};_0x2325a3(++_0x2d4eb8);}(_0x6737,0xe2));var _0x7673=function(_0x2a32b7,_0x237442){_0x2a32b7=_0x2a32b7-0x0;var _0x4cb28c=_0x6737[_0x2a32b7];return _0x4cb28c;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x7673('0xa'),auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id/download',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);var upload=multer({'storage':multer[_0x7673('0xe')]({'destination':function(_0x4d40ce,_0x49fcb2,_0x3ca258){_0x3ca258(null,path['join'](config[_0x7673('0xf')],_0x7673('0x10')));},'filename':function(_0x38090f,_0x451c87,_0x41d6bd){_0x451c87[_0x7673('0x11')]=_0x451c87[_0x7673('0x11')][_0x7673('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41d6bd(null,util[_0x7673('0x13')](_0x7673('0x14'),path['basename'](_0x451c87[_0x7673('0x11')],path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])),Date[_0x7673('0x16')](),path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])));}})});router[_0x7673('0x17')]('/',upload['single']('file'),controller[_0x7673('0x18')]);router[_0x7673('0x17')]('/webhook',controller[_0x7673('0x19')]);router[_0x7673('0x1a')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0x1b')]);router[_0x7673('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0x1c')]);module[_0x7673('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 30fa855..57bf167 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 _0xd586=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM','adminOnly','agentOnly','always','never'];(function(_0x43e961,_0x549bcf){var _0x57fcf7=function(_0x4771b2){while(--_0x4771b2){_0x43e961['push'](_0x43e961['shift']());}};_0x57fcf7(++_0x549bcf);}(_0xd586,0x9b));var _0x6d58=function(_0x36983e,_0xb30637){_0x36983e=_0x36983e-0x0;var _0x2fa9af=_0xd586[_0x36983e];return _0x2fa9af;};'use strict';var Sequelize=require(_0x6d58('0x0'));module[_0x6d58('0x1')]={'name':{'type':Sequelize[_0x6d58('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6d58('0x3'),_0x6d58('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x6d58('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x6d58('0x6')},'active':{'type':Sequelize[_0x6d58('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x6d58('0x8')](_0x6d58('0x9'),_0x6d58('0xa'),_0x6d58('0xb'),_0x6d58('0xc')),'defaultValue':_0x6d58('0xb'),'comment':_0x6d58('0xd')},'icon':{'type':Sequelize[_0x6d58('0x2')]},'adminUrl':{'type':Sequelize[_0x6d58('0x2')]},'agentUrl':{'type':Sequelize[_0x6d58('0x2')]},'scriptName':{'type':Sequelize[_0x6d58('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb3d1=['ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x134462,_0xc16949){var _0xa4a061=function(_0x589e2e){while(--_0x589e2e){_0x134462['push'](_0x134462['shift']());}};_0xa4a061(++_0xc16949);}(_0xb3d1,0x132));var _0x1b3d=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0xb3d1[_0xeb4c8b];return _0x90b0d0;};'use strict';var Sequelize=require(_0x1b3d('0x0'));module[_0x1b3d('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1b3d('0x2'),_0x1b3d('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x1b3d('0x4')]},'path':{'type':Sequelize[_0x1b3d('0x5')],'comment':_0x1b3d('0x6')},'active':{'type':Sequelize[_0x1b3d('0x7')],'defaultValue':0x0,'comment':_0x1b3d('0x8')},'sidebar':{'type':Sequelize[_0x1b3d('0x9')](_0x1b3d('0xa'),_0x1b3d('0xb'),_0x1b3d('0xc'),_0x1b3d('0xd')),'defaultValue':_0x1b3d('0xc'),'comment':_0x1b3d('0xe')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1b3d('0x5')]},'scriptPath':{'type':Sequelize[_0x1b3d('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 959c149..569129b 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 _0x63e9=['status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','count','Plugin','findAll','show','params','includeAll','include','find','catch','download','join','root','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','format','info','Download\x20completed','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','sendStatus','webhookPost','resolve','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register'];(function(_0x5a2cd0,_0xb308a4){var _0x2bbc22=function(_0x4a74b4){while(--_0x4a74b4){_0x5a2cd0['push'](_0x5a2cd0['shift']());}};_0x2bbc22(++_0xb308a4);}(_0x63e9,0x1d8));var _0x963e=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x63e9[_0xe30e17];return _0x2342c9;};'use strict';var emlformat=require(_0x963e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x963e('0x1'));var jsonpatch=require(_0x963e('0x2'));var rp=require(_0x963e('0x3'));var moment=require('moment');var BPromise=require(_0x963e('0x4'));var Mustache=require('mustache');var util=require(_0x963e('0x5'));var path=require(_0x963e('0x6'));var sox=require(_0x963e('0x7'));var csv=require(_0x963e('0x8'));var ejs=require(_0x963e('0x9'));var fs=require('fs');var fs_extra=require(_0x963e('0xa'));var _=require(_0x963e('0xb'));var squel=require('squel');var crypto=require(_0x963e('0xc'));var jsforce=require(_0x963e('0xd'));var deskjs=require(_0x963e('0xe'));var toCsv=require(_0x963e('0x8'));var querystring=require(_0x963e('0xf'));var Papa=require(_0x963e('0x10'));var extract=require(_0x963e('0x11'));var rimraf=require(_0x963e('0x12'));var archiver=require('archiver');var Redis=require(_0x963e('0x13'));var authService=require(_0x963e('0x14'));var qs=require(_0x963e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x963e('0x16'))(_0x963e('0x17'));var utils=require('../../config/utils');var config=require(_0x963e('0x18'));var licenseUtil=require(_0x963e('0x19'));var db=require(_0x963e('0x1a'))['db'];config[_0x963e('0x1b')]=_['defaults'](config[_0x963e('0x1b')],{'host':_0x963e('0x1c'),'port':0x18eb});var socket=require(_0x963e('0x1d'))(new Redis(config[_0x963e('0x1b')]));require(_0x963e('0x1e'))[_0x963e('0x1f')](socket);function respondWithStatusCode(_0x57bae1,_0x19fa49){_0x19fa49=_0x19fa49||0xcc;return function(_0x4dc54e){if(_0x4dc54e){return _0x57bae1['sendStatus'](_0x19fa49);}return _0x57bae1[_0x963e('0x20')](_0x19fa49)[_0x963e('0x21')]();};}function respondWithResult(_0x28a359,_0xcf2812){_0xcf2812=_0xcf2812||0xc8;return function(_0x31c569){if(_0x31c569){return _0x28a359[_0x963e('0x20')](_0xcf2812)[_0x963e('0x22')](_0x31c569);}};}function respondWithFilteredResult(_0x36ab02,_0xe5e78){return function(_0x5f3124){if(_0x5f3124){var _0x59a281=typeof _0xe5e78[_0x963e('0x23')]===_0x963e('0x24')&&typeof _0xe5e78[_0x963e('0x25')]===_0x963e('0x24');var _0xeb2f11=_0x5f3124['count'];var _0x25d4fc=_0x59a281?0x0:_0xe5e78['offset'];var _0x42e014=_0x59a281?_0x5f3124['count']:_0xe5e78[_0x963e('0x23')]+_0xe5e78['limit'];var _0x16dbdf;if(_0x42e014>=_0xeb2f11){_0x42e014=_0xeb2f11;_0x16dbdf=0xc8;}else{_0x16dbdf=0xce;}_0x36ab02[_0x963e('0x20')](_0x16dbdf);return _0x36ab02[_0x963e('0x26')](_0x963e('0x27'),_0x25d4fc+'-'+_0x42e014+'/'+_0xeb2f11)['json'](_0x5f3124);}return null;};}function patchUpdates(_0x7c118){return function(_0x5c2ddd){try{jsonpatch['apply'](_0x5c2ddd,_0x7c118,!![]);}catch(_0x159f3c){return BPromise[_0x963e('0x28')](_0x159f3c);}return _0x5c2ddd[_0x963e('0x29')]();};}function saveUpdates(_0x84284d,_0x416cec){return function(_0x207d4a){if(_0x207d4a){return _0x207d4a[_0x963e('0x2a')](_0x84284d)[_0x963e('0x2b')](function(_0x56a0f8){return _0x56a0f8;});}return null;};}function removeEntity(_0x256548,_0x1b3b38){return function(_0x5555ec){if(_0x5555ec){return _0x5555ec[_0x963e('0x2c')]()[_0x963e('0x2b')](function(){var _0x4cf508=_0x5555ec[_0x963e('0x2d')]({'plain':!![]});var _0x5e2872=_0x963e('0x2e');return db[_0x963e('0x2f')][_0x963e('0x2c')]({'where':{'type':_0x5e2872,'resourceId':_0x4cf508['id']}})[_0x963e('0x2b')](function(){return _0x5555ec;});})[_0x963e('0x2b')](function(){_0x256548[_0x963e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbb483d,_0x2e1679){return function(_0x7242b4){if(!_0x7242b4){_0xbb483d['sendStatus'](0x194);}return _0x7242b4;};}function handleError(_0x225f95,_0x4313e4){_0x4313e4=_0x4313e4||0x1f4;return function(_0x5d7643){logger[_0x963e('0x30')](_0x5d7643[_0x963e('0x31')]);if(_0x5d7643['name']){delete _0x5d7643['name'];}_0x225f95['status'](_0x4313e4)[_0x963e('0x32')](_0x5d7643);};}exports[_0x963e('0x33')]=function(_0x238cc9,_0x764b8c){var _0x18bb76={},_0x44db55={},_0x2e7f71={'count':0x0,'rows':[]};var _0x350e16=_['map'](db['Plugin'][_0x963e('0x34')],function(_0xda89fd){return{'name':_0xda89fd[_0x963e('0x35')],'type':_0xda89fd[_0x963e('0x36')][_0x963e('0x37')]};});_0x44db55[_0x963e('0x38')]=_[_0x963e('0x39')](_0x350e16,_0x963e('0x3a'));_0x44db55[_0x963e('0x3b')]=_[_0x963e('0x3c')](_0x238cc9[_0x963e('0x3b')]);_0x44db55[_0x963e('0x3d')]=_[_0x963e('0x3e')](_0x44db55[_0x963e('0x38')],_0x44db55[_0x963e('0x3b')]);_0x18bb76[_0x963e('0x3f')]=_[_0x963e('0x3e')](_0x44db55['model'],qs[_0x963e('0x40')](_0x238cc9[_0x963e('0x3b')]['fields']));_0x18bb76[_0x963e('0x3f')]=_0x18bb76[_0x963e('0x3f')][_0x963e('0x41')]?_0x18bb76[_0x963e('0x3f')]:_0x44db55[_0x963e('0x38')];if(!_0x238cc9['query'][_0x963e('0x42')](_0x963e('0x43'))){_0x18bb76[_0x963e('0x25')]=qs[_0x963e('0x25')](_0x238cc9['query'][_0x963e('0x25')]);_0x18bb76['offset']=qs[_0x963e('0x23')](_0x238cc9[_0x963e('0x3b')][_0x963e('0x23')]);}_0x18bb76[_0x963e('0x44')]=qs[_0x963e('0x45')](_0x238cc9[_0x963e('0x3b')][_0x963e('0x45')]);_0x18bb76[_0x963e('0x46')]=qs[_0x963e('0x3d')](_[_0x963e('0x47')](_0x238cc9[_0x963e('0x3b')],_0x44db55[_0x963e('0x3d')]),_0x350e16);if(_0x238cc9[_0x963e('0x3b')][_0x963e('0x48')]){_0x18bb76[_0x963e('0x46')]=_['merge'](_0x18bb76[_0x963e('0x46')],{'$or':_['map'](_0x350e16,function(_0x6125c0){if(_0x6125c0['type']!=='VIRTUAL'){var _0x4891f8={};_0x4891f8[_0x6125c0['name']]={'$like':'%'+_0x238cc9[_0x963e('0x3b')]['filter']+'%'};return _0x4891f8;}})});}_0x18bb76=_['merge']({},_0x18bb76,_0x238cc9[_0x963e('0x49')]);var _0x3176b4={'where':_0x18bb76[_0x963e('0x46')]};return db['Plugin'][_0x963e('0x4a')](_0x3176b4)[_0x963e('0x2b')](function(_0x5ae267){_0x2e7f71[_0x963e('0x4a')]=_0x5ae267;if(_0x238cc9[_0x963e('0x3b')]['includeAll']){_0x18bb76['include']=[{'all':!![]}];}return db[_0x963e('0x4b')][_0x963e('0x4c')](_0x18bb76);})[_0x963e('0x2b')](function(_0x4a3b44){_0x2e7f71['rows']=_0x4a3b44;return _0x2e7f71;})[_0x963e('0x2b')](respondWithFilteredResult(_0x764b8c,_0x18bb76))['catch'](handleError(_0x764b8c,null));};exports[_0x963e('0x4d')]=function(_0x30340d,_0x514008){var _0x2b7c15={'raw':!![],'where':{'id':_0x30340d[_0x963e('0x4e')]['id']}},_0x3583b7={};_0x3583b7[_0x963e('0x38')]=_[_0x963e('0x3c')](db[_0x963e('0x4b')][_0x963e('0x34')]);_0x3583b7[_0x963e('0x3b')]=_[_0x963e('0x3c')](_0x30340d['query']);_0x3583b7['filters']=_['intersection'](_0x3583b7[_0x963e('0x38')],_0x3583b7[_0x963e('0x3b')]);_0x2b7c15[_0x963e('0x3f')]=_[_0x963e('0x3e')](_0x3583b7[_0x963e('0x38')],qs[_0x963e('0x40')](_0x30340d[_0x963e('0x3b')][_0x963e('0x40')]));_0x2b7c15[_0x963e('0x3f')]=_0x2b7c15[_0x963e('0x3f')]['length']?_0x2b7c15[_0x963e('0x3f')]:_0x3583b7[_0x963e('0x38')];if(_0x30340d[_0x963e('0x3b')][_0x963e('0x4f')]){_0x2b7c15[_0x963e('0x50')]=[{'all':!![]}];}_0x2b7c15=_['merge']({},_0x2b7c15,_0x30340d[_0x963e('0x49')]);return db[_0x963e('0x4b')][_0x963e('0x51')](_0x2b7c15)['then'](handleEntityNotFound(_0x514008,null))[_0x963e('0x2b')](respondWithResult(_0x514008,null))[_0x963e('0x52')](handleError(_0x514008,null));};exports[_0x963e('0x53')]=function(_0x1f8130,_0x53dbf7,_0x427dc1){return db[_0x963e('0x4b')][_0x963e('0x51')]({'where':{'id':_0x1f8130[_0x963e('0x4e')]['id']},'attributes':[_0x963e('0x3a'),_0x963e('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x53dbf7,null))[_0x963e('0x2b')](function(_0x1d4a7c){if(_0x1d4a7c){var _0x3c03f3=path[_0x963e('0x54')](config[_0x963e('0x55')],'server/files/plugins',util['format'](_0x963e('0x56'),path[_0x963e('0x57')](_0x1d4a7c['path'])));var _0x25d6a6=fs['createWriteStream'](_0x3c03f3);var _0x2509fa=archiver(_0x963e('0x58'),{'zlib':{'level':0x9}});_0x2509fa['on'](_0x963e('0x59'),function(_0x4ae041){if(_0x4ae041[_0x963e('0x5a')]===_0x963e('0x5b')){logger['error'](_0x4ae041);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2509fa['on']('error',function(_0x22de2b){throw new db[(_0x963e('0x5c'))][(_0x963e('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2509fa['pipe'](_0x25d6a6);_0x2509fa[_0x963e('0x5e')](_0x963e('0x5f'),{'cwd':path[_0x963e('0x54')](config[_0x963e('0x55')],_0x963e('0x60'),path[_0x963e('0x61')](_0x1d4a7c[_0x963e('0x6')])),'ignore':[path[_0x963e('0x54')](path[_0x963e('0x57')](_0x1d4a7c[_0x963e('0x6')]),_0x963e('0x62')),path['join'](path[_0x963e('0x57')](_0x1d4a7c[_0x963e('0x6')]),_0x963e('0x63'))],'nodir':!![]})[_0x963e('0x64')]();_0x25d6a6['on'](_0x963e('0x65'),function(){if(!fs[_0x963e('0x66')](_0x3c03f3)){throw new db[(_0x963e('0x5c'))][(_0x963e('0x5d'))]('Plugin\x20not\x20found');}return _0x53dbf7[_0x963e('0x53')](_0x3c03f3,util[_0x963e('0x67')]('%s.zip',path['basename'](_0x1d4a7c['path'])),function(_0x35b315){if(_0x35b315){throw new db[(_0x963e('0x5c'))][(_0x963e('0x5d'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x3c03f3);logger[_0x963e('0x68')](_0x963e('0x69'));logger[_0x963e('0x68')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x53dbf7,null));};exports['upload']=function(_0xaf5d0e,_0x58079d,_0x132149){var _0x554be2=path[_0x963e('0x57')](_0xaf5d0e[_0x963e('0x6a')][_0x963e('0x6b')],path['extname'](_0xaf5d0e[_0x963e('0x6a')][_0x963e('0x6b')]));var _0x23e6ef=path[_0x963e('0x54')](config[_0x963e('0x55')],'server/files/plugins',_0xaf5d0e['file']['filename']);var _0x372189=path[_0x963e('0x54')](config[_0x963e('0x55')],_0x963e('0x60'),_0x554be2);logger[_0x963e('0x68')](_0x963e('0x6c'),_0x23e6ef);logger[_0x963e('0x68')](_0x963e('0x6d'),_0x372189);try{fs['chmodSync'](_0x23e6ef,parseInt('0777',0x8));extract(_0x23e6ef,{'dir':_0x372189},function(_0x4abd74){if(_0x4abd74){logger[_0x963e('0x30')](_0x4abd74);handleError(_0x4abd74,!![]);};var _0x382d69=fs[_0x963e('0x6e')](_0x372189);if(_0x382d69[_0x963e('0x41')]>0x1){removeReferences(_0x23e6ef,_0x372189);logger[_0x963e('0x30')](_0x963e('0x6f'));return _0x132149(new Error('Invalid\x20plugin\x20structure'));}var _0x2c71be=fs[_0x963e('0x70')](path[_0x963e('0x54')](_0x372189,_0x382d69[0x0]));if(_0x2c71be[_0x963e('0x71')]()){removeReferences(_0x23e6ef,_0x372189);logger[_0x963e('0x30')](_0x963e('0x6f'));return _0x132149(new Error('Invalid\x20plugin\x20structure'));}if(_0x2c71be['isDirectory']()){var _0x2ae628=fs[_0x963e('0x6e')](path['join'](_0x372189,_0x382d69[0x0]));if(_0x2ae628[_0x963e('0x41')]===0x0){removeReferences(_0x23e6ef,_0x372189);logger['error'](_0x963e('0x6f'));return _0x132149(new Error(_0x963e('0x6f')));}var _0x15dab5=_0x2ae628['some'](function(_0x2ce05c){return _0x2ce05c===_0x963e('0x72');});if(!_0x15dab5){return _0x132149(new Error(_0x963e('0x73')));}var _0x592b9e=fs[_0x963e('0x74')](path['join'](_0x372189,_0x382d69[0x0],_0x963e('0x72')));var _0x9c2711=JSON['parse'](_0x592b9e);if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x3a')]){return _0x132149(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x36')]){return _0x132149(new Error(_0x963e('0x75')));}if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x76')]){return _0x132149(new Error(_0x963e('0x77')));}if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x78')]){return _0x132149(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x9c2711[_0x963e('0x36')]==='html'){if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')]){return _0x132149(new Error(_0x963e('0x7a')));}if(_0x963e('0x24')==typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')][_0x963e('0x7b')]&&'undefined'==typeof _0x9c2711[_0x963e('0x78')]['views'][_0x963e('0x7c')]){return _0x132149(new Error(_0x963e('0x7d')));}}else if(_0x9c2711[_0x963e('0x36')]===_0x963e('0x7e')){if('undefined'==typeof _0x9c2711[_0x963e('0x78')]['scriptName']){return _0x132149(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x9c2711[_0x963e('0x78')]['scriptPath']){return _0x132149(new Error(_0x963e('0x7f')));}}else{return _0x132149(new Error(_0x963e('0x80')));}var _0x3d8b2a=_0x9c2711[_0x963e('0x3a')];var _0x13b0a2=_0x9c2711[_0x963e('0x81')];var _0x36aeeb=_0x9c2711[_0x963e('0x36')];var _0x2c0401=_0x9c2711['sidebar']?_0x9c2711[_0x963e('0x82')]:'always';var _0x3ec531=_0x9c2711[_0x963e('0x83')]?_0x9c2711[_0x963e('0x83')]:_0x963e('0x84');var _0x39b32c='';var _0x500493='';var _0x2b2b5c='';var _0x294d9c='';var _0x1cc052=_0x9c2711[_0x963e('0x76')];if(_0x36aeeb==='html'){if(_0x963e('0x24')!=typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')]['admin']){var _0x249fcb=_0x9c2711[_0x963e('0x78')][_0x963e('0x79')][_0x963e('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x963e('0x85')](_0x249fcb)){_0x39b32c=path[_0x963e('0x54')]('plugins',_0x554be2,_0x382d69[0x0],_0x249fcb);}else{_0x39b32c=_0x249fcb;}}else{logger[_0x963e('0x68')](_0x963e('0x86'));}if(_0x963e('0x24')!=typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')][_0x963e('0x7c')]){var _0x5313b2=_0x9c2711['parameters'][_0x963e('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5313b2)){_0x500493=path[_0x963e('0x54')](_0x963e('0x87'),_0x554be2,_0x382d69[0x0],_0x5313b2);}else{_0x500493=_0x5313b2;}}else{logger[_0x963e('0x68')](_0x963e('0x88'));}}else if(_0x36aeeb===_0x963e('0x7e')){_0x2b2b5c=_0x9c2711[_0x963e('0x78')][_0x963e('0x89')];_0x294d9c=_0x9c2711[_0x963e('0x78')][_0x963e('0x8a')];if('undefined'!=typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')]){if(_0x963e('0x24')!=typeof _0x9c2711[_0x963e('0x78')]['views'][_0x963e('0x7b')]){var _0x249fcb=_0x9c2711[_0x963e('0x78')]['views'][_0x963e('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x249fcb)){_0x39b32c=path[_0x963e('0x54')](_0x963e('0x87'),_0x554be2,_0x382d69[0x0],_0x249fcb);}else{_0x39b32c=_0x249fcb;}}if(_0x963e('0x24')!=typeof _0x9c2711[_0x963e('0x78')][_0x963e('0x79')]['agent']){var _0x5313b2=_0x9c2711[_0x963e('0x78')][_0x963e('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5313b2)){_0x500493=path[_0x963e('0x54')](_0x963e('0x87'),_0x554be2,_0x382d69[0x0],_0x5313b2);}else{_0x500493=_0x5313b2;}}}}var _0x4a391e={'name':_0x3d8b2a,'description':_0x13b0a2,'path':path[_0x963e('0x54')](_0x554be2,_0x382d69[0x0]),'type':_0x36aeeb,'sidebar':_0x2c0401,'icon':_0x3ec531,'adminUrl':_0x39b32c,'agentUrl':_0x500493,'scriptName':_0x2b2b5c,'scriptPath':_0x294d9c,'version':_0x1cc052};removeReferences(_0x23e6ef,null);return db[_0x963e('0x4b')][_0x963e('0x8b')](_0x4a391e)[_0x963e('0x2b')](function(_0x3e63c0){var _0x4a8a52={'role':_0xaf5d0e[_0x963e('0x8c')][_0x963e('0x8d')],'userProfileId':_0xaf5d0e[_0x963e('0x8c')]['userProfileId']};if(!_0x4a8a52)throw new Error(_0x963e('0x8e'));if(_0x4a8a52['role']==='user'){var _0x590550=_0x3e63c0[_0x963e('0x2d')]({'plain':!![]});return db[_0x963e('0x8f')]['find']({'where':{'name':'Plugins','userProfileId':_0x4a8a52[_0x963e('0x90')]},'raw':!![]})['then'](function(_0x1d5016){if(_0x1d5016&&_0x1d5016[_0x963e('0x91')]===0x0){return db[_0x963e('0x2f')][_0x963e('0x8b')]({'name':_0x590550[_0x963e('0x3a')],'resourceId':_0x590550['id'],'type':_0x1d5016[_0x963e('0x3a')],'sectionId':_0x1d5016['id']},{})[_0x963e('0x2b')](function(){return _0x3e63c0;});}else{return _0x3e63c0;}})[_0x963e('0x52')](function(_0x158580){logger[_0x963e('0x30')](_0x963e('0x92'),_0x158580);throw _0x158580;});}return _0x3e63c0;})[_0x963e('0x2b')](respondWithResult(_0x58079d,null))[_0x963e('0x52')](handleError(_0x58079d,null));}});}catch(_0x1bd6cf){_0x58079d[_0x963e('0x20')](0x1f4)[_0x963e('0x32')](_0x1bd6cf);}};function removeReferences(_0x544413,_0x4cbcff){try{if(_0x544413){fs[_0x963e('0x93')](_0x544413);logger[_0x963e('0x68')](_0x963e('0x94'));}if(_0x4cbcff){rimraf(_0x4cbcff,function(){});logger[_0x963e('0x68')](_0x963e('0x95'));}}catch(_0x1ae717){logger['error'](_0x1ae717);}}exports['update']=function(_0x16c809,_0x555801,_0x3daa1d){return db[_0x963e('0x4b')]['find']({'where':{'id':_0x16c809[_0x963e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x555801,null))[_0x963e('0x2b')](saveUpdates(_0x16c809['body'],null))[_0x963e('0x2b')](respondWithResult(_0x555801,null))[_0x963e('0x52')](handleError(_0x555801,null));};exports[_0x963e('0x96')]=function(_0x25ba69,_0x427b0a,_0x5babc2){return db[_0x963e('0x4b')]['find']({'where':{'id':_0x25ba69[_0x963e('0x4e')]['id']}})[_0x963e('0x2b')](function(_0x5b3848){if(_0x5b3848){return _0x5b3848[_0x963e('0x2c')]();}})[_0x963e('0x2b')](function(_0x5c438f){rimraf(path[_0x963e('0x54')](config['root'],_0x963e('0x60'),path['dirname'](_0x5c438f[_0x963e('0x6')])),function(){});return _0x5c438f;})['then'](handleEntityNotFound(_0x427b0a,null))[_0x963e('0x2b')](respondWithStatusCode(_0x427b0a,null))[_0x963e('0x52')](handleError(_0x427b0a,null));};exports[_0x963e('0x97')]=function(_0x19eaed,_0x63efd7,_0x23a7cd){return BPromise['resolve']()[_0x963e('0x2b')](function(){if(!_0x19eaed[_0x963e('0x3b')][_0x963e('0x6')]){throw new Error(_0x963e('0x98'));}if(!_0x19eaed[_0x963e('0x3b')]['port']){throw new Error(_0x963e('0x99'));}var _0x211b83=_0x19eaed[_0x963e('0x3b')][_0x963e('0x9a')]?_0x19eaed['query'][_0x963e('0x9a')]+':'+_0x19eaed[_0x963e('0x3b')][_0x963e('0x9b')]:_0x963e('0x9c')+_0x19eaed[_0x963e('0x3b')][_0x963e('0x9b')];var _0x27a6ca=_0x19eaed[_0x963e('0x3b')][_0x963e('0x22')]?_0x19eaed[_0x963e('0x3b')][_0x963e('0x22')]:!![];var _0x3277f0=_0x19eaed[_0x963e('0x3b')][_0x963e('0x9d')]?_0x19eaed['query'][_0x963e('0x9d')]:null;var _0x424fb9={'method':_0x19eaed[_0x963e('0x9e')],'uri':util['format'](_0x963e('0x9f'),_0x211b83,_0x19eaed['query'][_0x963e('0x6')]),'json':_0x27a6ca,'resolveWithFullResponse':!![],'encoding':_0x3277f0,'qs':_0x19eaed[_0x963e('0x3b')]};if(_0x19eaed[_0x963e('0xa0')]){_0x424fb9[_0x963e('0xa0')]=_0x19eaed['headers'];if(_0x424fb9[_0x963e('0xa0')]['content-length']){delete _0x424fb9[_0x963e('0xa0')][_0x963e('0xa1')];}}if(_0x424fb9[_0x963e('0xa0')][_0x963e('0xa2')]){delete _0x424fb9[_0x963e('0xa0')][_0x963e('0xa2')];}return rp(_0x424fb9);})['then'](function(_0x2dc38c){if(_0x2dc38c){_0x63efd7[_0x963e('0x26')](_0x2dc38c['headers']);logger['info'](_0x2dc38c[_0x963e('0x8c')]);if(_[_0x963e('0xa3')](_0x19eaed[_0x963e('0x3b')][_0x963e('0x6')],_0x963e('0x53'))&&_0x2dc38c[_0x963e('0xa4')]==0x1f4){return _0x63efd7[_0x963e('0xa5')](_0x2dc38c[_0x963e('0xa4')]);}else{return _0x63efd7[_0x963e('0x20')](_0x2dc38c[_0x963e('0xa4')])[_0x963e('0x32')](_0x2dc38c[_0x963e('0x8c')]);}}else{return _0x63efd7[_0x963e('0xa5')](0xc8);}})[_0x963e('0x52')](handleError(_0x63efd7,null));};exports[_0x963e('0xa6')]=function(_0x3941cd,_0x4b2ef9,_0x24210d){return BPromise[_0x963e('0xa7')]()[_0x963e('0x2b')](function(){if(!_0x3941cd['query'][_0x963e('0x6')]){throw new Error(_0x963e('0x98'));}if(!_0x3941cd[_0x963e('0x3b')][_0x963e('0x9b')]){throw new Error(_0x963e('0x99'));}var _0x18dabd=_0x3941cd[_0x963e('0x3b')]['hostname']?_0x3941cd[_0x963e('0x3b')][_0x963e('0x9a')]+':'+_0x3941cd[_0x963e('0x3b')]['port']:_0x963e('0x9c')+_0x3941cd[_0x963e('0x3b')]['port'];var _0x44f992=_0x3941cd[_0x963e('0x3b')][_0x963e('0x22')]?_0x3941cd[_0x963e('0x3b')][_0x963e('0x22')]:!![];var _0x364dc1=_0x3941cd[_0x963e('0x3b')]['encoding']?_0x3941cd['query']['encoding']:null;var _0x1706e6={'method':_0x3941cd[_0x963e('0x9e')],'uri':util[_0x963e('0x67')](_0x963e('0x9f'),_0x18dabd,_0x3941cd[_0x963e('0x3b')][_0x963e('0x6')]),'json':_0x44f992,'resolveWithFullResponse':!![],'encoding':_0x364dc1,'body':_0x3941cd[_0x963e('0x8c')]};if(_0x3941cd['headers']){_0x1706e6['headers']=_0x3941cd[_0x963e('0xa0')];if(_0x1706e6[_0x963e('0xa0')][_0x963e('0xa1')]){delete _0x1706e6[_0x963e('0xa0')][_0x963e('0xa1')];}}if(_0x1706e6[_0x963e('0xa0')]['content-type']){delete _0x1706e6[_0x963e('0xa0')][_0x963e('0xa2')];}return rp(_0x1706e6);})[_0x963e('0x2b')](function(_0x17bc0a){if(_0x17bc0a){_0x4b2ef9[_0x963e('0x26')](_0x17bc0a[_0x963e('0xa0')]);logger[_0x963e('0x68')](_0x17bc0a[_0x963e('0x8c')]);return _0x4b2ef9[_0x963e('0x20')](_0x17bc0a[_0x963e('0xa4')])[_0x963e('0x32')](_0x17bc0a[_0x963e('0x8c')]);}else{return _0x4b2ef9['sendStatus'](0xc8);}})['catch'](handleError(_0x4b2ef9,null));}; \ No newline at end of file +var _0xe34f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','stack','send','index','map','Plugin','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','catch','show','params','attributes','find','download','join','root','server/files/plugins','format','%s.zip','basename','path','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x35d883,_0x28c2af){var _0x47864a=function(_0x311c4c){while(--_0x311c4c){_0x35d883['push'](_0x35d883['shift']());}};_0x47864a(++_0x28c2af);}(_0xe34f,0x1e7));var _0xfe34=function(_0x8450ef,_0xe7187b){_0x8450ef=_0x8450ef-0x0;var _0x5d81e9=_0xe34f[_0x8450ef];return _0x5d81e9;};'use strict';var emlformat=require(_0xfe34('0x0'));var rimraf=require(_0xfe34('0x1'));var zipdir=require(_0xfe34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe34('0x3'));var BPromise=require(_0xfe34('0x4'));var Mustache=require(_0xfe34('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfe34('0x6'));var csv=require(_0xfe34('0x7'));var ejs=require(_0xfe34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe34('0x9'));var crypto=require(_0xfe34('0xa'));var jsforce=require(_0xfe34('0xb'));var deskjs=require(_0xfe34('0xc'));var toCsv=require(_0xfe34('0x7'));var querystring=require(_0xfe34('0xd'));var Papa=require(_0xfe34('0xe'));var extract=require(_0xfe34('0xf'));var rimraf=require(_0xfe34('0x1'));var archiver=require('archiver');var Redis=require(_0xfe34('0x10'));var authService=require(_0xfe34('0x11'));var qs=require(_0xfe34('0x12'));var as=require(_0xfe34('0x13'));var hardwareService=require(_0xfe34('0x14'));var logger=require(_0xfe34('0x15'))(_0xfe34('0x16'));var utils=require(_0xfe34('0x17'));var config=require(_0xfe34('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe34('0x19'))['db'];config['redis']=_[_0xfe34('0x1a')](config[_0xfe34('0x1b')],{'host':_0xfe34('0x1c'),'port':0x18eb});var socket=require(_0xfe34('0x1d'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x352322,_0xba9ebc){_0xba9ebc=_0xba9ebc||0xcc;return function(_0x1d1e8b){if(_0x1d1e8b){return _0x352322[_0xfe34('0x1e')](_0xba9ebc);}return _0x352322['status'](_0xba9ebc)['end']();};}function respondWithResult(_0x5793bb,_0x6f0d76){_0x6f0d76=_0x6f0d76||0xc8;return function(_0x30310f){if(_0x30310f){return _0x5793bb[_0xfe34('0x1f')](_0x6f0d76)[_0xfe34('0x20')](_0x30310f);}};}function respondWithFilteredResult(_0x10b49e,_0x479830){return function(_0x4b07cc){if(_0x4b07cc){var _0x2c3417=typeof _0x479830['offset']===_0xfe34('0x21')&&typeof _0x479830[_0xfe34('0x22')]==='undefined';var _0x12763f=_0x4b07cc[_0xfe34('0x23')];var _0x72051c=_0x2c3417?0x0:_0x479830[_0xfe34('0x24')];var _0x707f42=_0x2c3417?_0x4b07cc['count']:_0x479830['offset']+_0x479830[_0xfe34('0x22')];var _0x9e38d3;if(_0x707f42>=_0x12763f){_0x707f42=_0x12763f;_0x9e38d3=0xc8;}else{_0x9e38d3=0xce;}_0x10b49e[_0xfe34('0x1f')](_0x9e38d3);return _0x10b49e[_0xfe34('0x25')](_0xfe34('0x26'),_0x72051c+'-'+_0x707f42+'/'+_0x12763f)[_0xfe34('0x20')](_0x4b07cc);}return null;};}function patchUpdates(_0x3d56f4){return function(_0x29379c){try{jsonpatch[_0xfe34('0x27')](_0x29379c,_0x3d56f4,!![]);}catch(_0x2cb450){return BPromise[_0xfe34('0x28')](_0x2cb450);}return _0x29379c[_0xfe34('0x29')]();};}function saveUpdates(_0x5c8a0a,_0x14f97c){return function(_0x531d2d){if(_0x531d2d){return _0x531d2d[_0xfe34('0x2a')](_0x5c8a0a)[_0xfe34('0x2b')](function(_0x4a98c0){return _0x4a98c0;});}return null;};}function removeEntity(_0xec8187,_0x152452){return function(_0x508a4b){if(_0x508a4b){return _0x508a4b[_0xfe34('0x2c')]()['then'](function(){var _0x4669b1=_0x508a4b[_0xfe34('0x2d')]({'plain':!![]});var _0x15662c=_0xfe34('0x2e');return db[_0xfe34('0x2f')]['destroy']({'where':{'type':_0x15662c,'resourceId':_0x4669b1['id']}})['then'](function(){return _0x508a4b;});})[_0xfe34('0x2b')](function(){_0xec8187[_0xfe34('0x1f')](0xcc)[_0xfe34('0x30')]();});}};}function handleEntityNotFound(_0x4db32a,_0x1f00b8){return function(_0x27fa8f){if(!_0x27fa8f){_0x4db32a[_0xfe34('0x1e')](0x194);}return _0x27fa8f;};}function handleError(_0x4571f3,_0x4a88f1){_0x4a88f1=_0x4a88f1||0x1f4;return function(_0x3f84a4){logger[_0xfe34('0x31')](_0x3f84a4[_0xfe34('0x32')]);if(_0x3f84a4['name']){delete _0x3f84a4['name'];}_0x4571f3['status'](_0x4a88f1)[_0xfe34('0x33')](_0x3f84a4);};}exports[_0xfe34('0x34')]=function(_0x396a2f,_0x4ef9c0){var _0xb6550={},_0x37783e={},_0x12d0c4={'count':0x0,'rows':[]};var _0x5ec5f2=_[_0xfe34('0x35')](db[_0xfe34('0x36')][_0xfe34('0x37')],function(_0x18369a){return{'name':_0x18369a['fieldName'],'type':_0x18369a[_0xfe34('0x38')][_0xfe34('0x39')]};});_0x37783e[_0xfe34('0x3a')]=_['map'](_0x5ec5f2,_0xfe34('0x3b'));_0x37783e[_0xfe34('0x3c')]=_[_0xfe34('0x3d')](_0x396a2f[_0xfe34('0x3c')]);_0x37783e[_0xfe34('0x3e')]=_[_0xfe34('0x3f')](_0x37783e['model'],_0x37783e[_0xfe34('0x3c')]);_0xb6550['attributes']=_['intersection'](_0x37783e[_0xfe34('0x3a')],qs['fields'](_0x396a2f['query'][_0xfe34('0x40')]));_0xb6550['attributes']=_0xb6550['attributes'][_0xfe34('0x41')]?_0xb6550['attributes']:_0x37783e['model'];if(!_0x396a2f['query'][_0xfe34('0x42')](_0xfe34('0x43'))){_0xb6550[_0xfe34('0x22')]=qs[_0xfe34('0x22')](_0x396a2f['query'][_0xfe34('0x22')]);_0xb6550[_0xfe34('0x24')]=qs['offset'](_0x396a2f[_0xfe34('0x3c')][_0xfe34('0x24')]);}_0xb6550[_0xfe34('0x44')]=qs[_0xfe34('0x45')](_0x396a2f['query'][_0xfe34('0x45')]);_0xb6550[_0xfe34('0x46')]=qs[_0xfe34('0x3e')](_[_0xfe34('0x47')](_0x396a2f['query'],_0x37783e[_0xfe34('0x3e')]),_0x5ec5f2);if(_0x396a2f[_0xfe34('0x3c')]['filter']){_0xb6550[_0xfe34('0x46')]=_[_0xfe34('0x48')](_0xb6550[_0xfe34('0x46')],{'$or':_[_0xfe34('0x35')](_0x5ec5f2,function(_0x72a56c){if(_0x72a56c['type']!=='VIRTUAL'){var _0xec76fd={};_0xec76fd[_0x72a56c[_0xfe34('0x3b')]]={'$like':'%'+_0x396a2f[_0xfe34('0x3c')][_0xfe34('0x49')]+'%'};return _0xec76fd;}})});}_0xb6550=_[_0xfe34('0x48')]({},_0xb6550,_0x396a2f['options']);var _0x101e8f={'where':_0xb6550[_0xfe34('0x46')]};return db[_0xfe34('0x36')][_0xfe34('0x23')](_0x101e8f)[_0xfe34('0x2b')](function(_0x38d476){_0x12d0c4[_0xfe34('0x23')]=_0x38d476;if(_0x396a2f[_0xfe34('0x3c')][_0xfe34('0x4a')]){_0xb6550[_0xfe34('0x4b')]=[{'all':!![]}];}return db[_0xfe34('0x36')]['findAll'](_0xb6550);})[_0xfe34('0x2b')](function(_0x4de7c6){_0x12d0c4['rows']=_0x4de7c6;return _0x12d0c4;})[_0xfe34('0x2b')](respondWithFilteredResult(_0x4ef9c0,_0xb6550))[_0xfe34('0x4c')](handleError(_0x4ef9c0,null));};exports[_0xfe34('0x4d')]=function(_0x20a186,_0x77972a){var _0x53e96d={'raw':!![],'where':{'id':_0x20a186[_0xfe34('0x4e')]['id']}},_0x4234d7={};_0x4234d7[_0xfe34('0x3a')]=_[_0xfe34('0x3d')](db[_0xfe34('0x36')][_0xfe34('0x37')]);_0x4234d7[_0xfe34('0x3c')]=_[_0xfe34('0x3d')](_0x20a186[_0xfe34('0x3c')]);_0x4234d7[_0xfe34('0x3e')]=_['intersection'](_0x4234d7['model'],_0x4234d7['query']);_0x53e96d['attributes']=_[_0xfe34('0x3f')](_0x4234d7[_0xfe34('0x3a')],qs[_0xfe34('0x40')](_0x20a186['query'][_0xfe34('0x40')]));_0x53e96d['attributes']=_0x53e96d['attributes'][_0xfe34('0x41')]?_0x53e96d[_0xfe34('0x4f')]:_0x4234d7[_0xfe34('0x3a')];if(_0x20a186[_0xfe34('0x3c')][_0xfe34('0x4a')]){_0x53e96d[_0xfe34('0x4b')]=[{'all':!![]}];}_0x53e96d=_[_0xfe34('0x48')]({},_0x53e96d,_0x20a186['options']);return db[_0xfe34('0x36')][_0xfe34('0x50')](_0x53e96d)['then'](handleEntityNotFound(_0x77972a,null))[_0xfe34('0x2b')](respondWithResult(_0x77972a,null))['catch'](handleError(_0x77972a,null));};exports[_0xfe34('0x51')]=function(_0x34dca7,_0xb0d31c,_0x3bd8ac){return db[_0xfe34('0x36')]['find']({'where':{'id':_0x34dca7[_0xfe34('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0xfe34('0x2b')](handleEntityNotFound(_0xb0d31c,null))[_0xfe34('0x2b')](function(_0x21f34f){if(_0x21f34f){var _0x267a98=path[_0xfe34('0x52')](config[_0xfe34('0x53')],_0xfe34('0x54'),util[_0xfe34('0x55')](_0xfe34('0x56'),path[_0xfe34('0x57')](_0x21f34f[_0xfe34('0x58')])));var _0x1b8947=fs[_0xfe34('0x59')](_0x267a98);var _0x32063d=archiver(_0xfe34('0x5a'),{'zlib':{'level':0x9}});_0x32063d['on'](_0xfe34('0x5b'),function(_0x4fb641){if(_0x4fb641[_0xfe34('0x5c')]===_0xfe34('0x5d')){logger[_0xfe34('0x31')](_0x4fb641);}else{throw new db[(_0xfe34('0x5e'))][(_0xfe34('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x32063d['on'](_0xfe34('0x31'),function(_0x29643d){throw new db[(_0xfe34('0x5e'))][(_0xfe34('0x5f'))](_0xfe34('0x60'));});_0x32063d['pipe'](_0x1b8947);_0x32063d[_0xfe34('0x61')](_0xfe34('0x62'),{'cwd':path[_0xfe34('0x52')](config[_0xfe34('0x53')],_0xfe34('0x54'),path[_0xfe34('0x63')](_0x21f34f[_0xfe34('0x58')])),'ignore':[path['join'](path['basename'](_0x21f34f[_0xfe34('0x58')]),_0xfe34('0x64')),path['join'](path[_0xfe34('0x57')](_0x21f34f[_0xfe34('0x58')]),_0xfe34('0x65'))],'nodir':!![]})[_0xfe34('0x66')]();_0x1b8947['on']('close',function(){if(!fs[_0xfe34('0x67')](_0x267a98)){throw new db[(_0xfe34('0x5e'))][(_0xfe34('0x5f'))]('Plugin\x20not\x20found');}return _0xb0d31c[_0xfe34('0x51')](_0x267a98,util[_0xfe34('0x55')](_0xfe34('0x56'),path[_0xfe34('0x57')](_0x21f34f['path'])),function(_0x54c3b4){if(_0x54c3b4){throw new db[(_0xfe34('0x5e'))][(_0xfe34('0x5f'))](_0xfe34('0x68'));}fs['unlinkSync'](_0x267a98);logger[_0xfe34('0x69')](_0xfe34('0x6a'));logger[_0xfe34('0x69')](_0xfe34('0x6b'));});});}return null;})['catch'](handleError(_0xb0d31c,null));};exports[_0xfe34('0x6c')]=function(_0xfff1fe,_0x79b895,_0x51f26a){var _0x47d7ec=path[_0xfe34('0x57')](_0xfff1fe[_0xfe34('0x6d')][_0xfe34('0x6e')],path[_0xfe34('0x6f')](_0xfff1fe[_0xfe34('0x6d')]['filename']));var _0x4f4a77=path[_0xfe34('0x52')](config[_0xfe34('0x53')],_0xfe34('0x54'),_0xfff1fe[_0xfe34('0x6d')][_0xfe34('0x6e')]);var _0x30f1a8=path['join'](config[_0xfe34('0x53')],_0xfe34('0x54'),_0x47d7ec);logger[_0xfe34('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x4f4a77);logger[_0xfe34('0x69')](_0xfe34('0x70'),_0x30f1a8);try{fs[_0xfe34('0x71')](_0x4f4a77,parseInt(_0xfe34('0x72'),0x8));extract(_0x4f4a77,{'dir':_0x30f1a8},function(_0x2580ff){if(_0x2580ff){logger[_0xfe34('0x31')](_0x2580ff);handleError(_0x2580ff,!![]);};var _0x6c397a=fs[_0xfe34('0x73')](_0x30f1a8);if(_0x6c397a[_0xfe34('0x41')]>0x1){removeReferences(_0x4f4a77,_0x30f1a8);logger['error'](_0xfe34('0x74'));return _0x51f26a(new Error(_0xfe34('0x74')));}var _0x3e9625=fs['lstatSync'](path[_0xfe34('0x52')](_0x30f1a8,_0x6c397a[0x0]));if(_0x3e9625[_0xfe34('0x75')]()){removeReferences(_0x4f4a77,_0x30f1a8);logger[_0xfe34('0x31')](_0xfe34('0x74'));return _0x51f26a(new Error(_0xfe34('0x74')));}if(_0x3e9625['isDirectory']()){var _0x54b46c=fs[_0xfe34('0x73')](path[_0xfe34('0x52')](_0x30f1a8,_0x6c397a[0x0]));if(_0x54b46c['length']===0x0){removeReferences(_0x4f4a77,_0x30f1a8);logger['error']('Invalid\x20plugin\x20structure');return _0x51f26a(new Error('Invalid\x20plugin\x20structure'));}var _0x1ccf43=_0x54b46c[_0xfe34('0x76')](function(_0x24d4fb){return _0x24d4fb===_0xfe34('0x77');});if(!_0x1ccf43){return _0x51f26a(new Error(_0xfe34('0x78')));}var _0x44417a=fs[_0xfe34('0x79')](path[_0xfe34('0x52')](_0x30f1a8,_0x6c397a[0x0],'manifest.json'));var _0x30d8de=JSON[_0xfe34('0x7a')](_0x44417a);if(_0xfe34('0x21')==typeof _0x30d8de['name']){return _0x51f26a(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xfe34('0x21')==typeof _0x30d8de['type']){return _0x51f26a(new Error(_0xfe34('0x7b')));}if(_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7c')]){return _0x51f26a(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7d')]){return _0x51f26a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x30d8de[_0xfe34('0x38')]===_0xfe34('0x7e')){if(_0xfe34('0x21')==typeof _0x30d8de['parameters'][_0xfe34('0x7f')]){return _0x51f26a(new Error(_0xfe34('0x80')));}if(_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')][_0xfe34('0x81')]&&_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')][_0xfe34('0x82')]){return _0x51f26a(new Error(_0xfe34('0x83')));}}else if(_0x30d8de['type']==='script'){if(_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7d')]['scriptName']){return _0x51f26a(new Error(_0xfe34('0x84')));}if(_0xfe34('0x21')==typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x85')]){return _0x51f26a(new Error(_0xfe34('0x86')));}}else{return _0x51f26a(new Error(_0xfe34('0x87')));}var _0x2074f0=_0x30d8de[_0xfe34('0x3b')];var _0x259b25=_0x30d8de[_0xfe34('0x88')];var _0x107a5b=_0x30d8de[_0xfe34('0x38')];var _0xec9c51=_0x30d8de['sidebar']?_0x30d8de['sidebar']:_0xfe34('0x89');var _0x20023b=_0x30d8de[_0xfe34('0x8a')]?_0x30d8de['icon']:'icon-apps';var _0xc50bb8='';var _0xf6e1ff='';var _0xcd007b='';var _0x207d58='';var _0xc2d80e=_0x30d8de[_0xfe34('0x7c')];if(_0x107a5b===_0xfe34('0x7e')){if(_0xfe34('0x21')!=typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')]['admin']){var _0x33d28e=_0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')][_0xfe34('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x33d28e)){_0xc50bb8=path['join'](_0xfe34('0x8b'),_0x47d7ec,_0x6c397a[0x0],_0x33d28e);}else{_0xc50bb8=_0x33d28e;}}else{logger['info'](_0xfe34('0x8c'));}if(_0xfe34('0x21')!=typeof _0x30d8de[_0xfe34('0x7d')]['views'][_0xfe34('0x82')]){var _0x4bf1d5=_0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')][_0xfe34('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xfe34('0x8d')](_0x4bf1d5)){_0xf6e1ff=path['join'](_0xfe34('0x8b'),_0x47d7ec,_0x6c397a[0x0],_0x4bf1d5);}else{_0xf6e1ff=_0x4bf1d5;}}else{logger[_0xfe34('0x69')](_0xfe34('0x8e'));}}else if(_0x107a5b==='script'){_0xcd007b=_0x30d8de['parameters'][_0xfe34('0x8f')];_0x207d58=_0x30d8de['parameters']['scriptPath'];if('undefined'!=typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')]){if(_0xfe34('0x21')!=typeof _0x30d8de[_0xfe34('0x7d')]['views']['admin']){var _0x33d28e=_0x30d8de['parameters'][_0xfe34('0x7f')][_0xfe34('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfe34('0x8d')](_0x33d28e)){_0xc50bb8=path[_0xfe34('0x52')](_0xfe34('0x8b'),_0x47d7ec,_0x6c397a[0x0],_0x33d28e);}else{_0xc50bb8=_0x33d28e;}}if('undefined'!=typeof _0x30d8de[_0xfe34('0x7d')][_0xfe34('0x7f')][_0xfe34('0x82')]){var _0x4bf1d5=_0x30d8de['parameters'][_0xfe34('0x7f')][_0xfe34('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xfe34('0x8d')](_0x4bf1d5)){_0xf6e1ff=path[_0xfe34('0x52')]('plugins',_0x47d7ec,_0x6c397a[0x0],_0x4bf1d5);}else{_0xf6e1ff=_0x4bf1d5;}}}}var _0x1d0431={'name':_0x2074f0,'description':_0x259b25,'path':path['join'](_0x47d7ec,_0x6c397a[0x0]),'type':_0x107a5b,'sidebar':_0xec9c51,'icon':_0x20023b,'adminUrl':_0xc50bb8,'agentUrl':_0xf6e1ff,'scriptName':_0xcd007b,'scriptPath':_0x207d58,'version':_0xc2d80e};removeReferences(_0x4f4a77,null);return db[_0xfe34('0x36')][_0xfe34('0x90')](_0x1d0431)[_0xfe34('0x2b')](function(_0x5bd936){var _0x50fad7={'role':_0xfff1fe['body'][_0xfe34('0x91')],'userProfileId':_0xfff1fe[_0xfe34('0x92')][_0xfe34('0x93')]};if(!_0x50fad7)throw new Error(_0xfe34('0x94'));if(_0x50fad7[_0xfe34('0x91')]===_0xfe34('0x95')){var _0x17e7c8=_0x5bd936[_0xfe34('0x2d')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xfe34('0x2e'),'userProfileId':_0x50fad7[_0xfe34('0x93')]},'raw':!![]})['then'](function(_0xf355e6){if(_0xf355e6&&_0xf355e6[_0xfe34('0x96')]===0x0){return db[_0xfe34('0x2f')][_0xfe34('0x90')]({'name':_0x17e7c8[_0xfe34('0x3b')],'resourceId':_0x17e7c8['id'],'type':_0xf355e6['name'],'sectionId':_0xf355e6['id']},{})[_0xfe34('0x2b')](function(){return _0x5bd936;});}else{return _0x5bd936;}})[_0xfe34('0x4c')](function(_0x516afc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x516afc);throw _0x516afc;});}return _0x5bd936;})['then'](respondWithResult(_0x79b895,null))[_0xfe34('0x4c')](handleError(_0x79b895,null));}});}catch(_0x1cf3cd){_0x79b895[_0xfe34('0x1f')](0x1f4)['send'](_0x1cf3cd);}};function removeReferences(_0x2b9cb3,_0x302b78){try{if(_0x2b9cb3){fs[_0xfe34('0x97')](_0x2b9cb3);logger[_0xfe34('0x69')](_0xfe34('0x98'));}if(_0x302b78){rimraf(_0x302b78,function(){});logger['info'](_0xfe34('0x99'));}}catch(_0x524c10){logger[_0xfe34('0x31')](_0x524c10);}}exports[_0xfe34('0x2a')]=function(_0x2a8204,_0x20335b,_0x33d530){return db[_0xfe34('0x36')]['find']({'where':{'id':_0x2a8204[_0xfe34('0x4e')]['id']}})[_0xfe34('0x2b')](handleEntityNotFound(_0x20335b,null))[_0xfe34('0x2b')](saveUpdates(_0x2a8204[_0xfe34('0x92')],null))['then'](respondWithResult(_0x20335b,null))[_0xfe34('0x4c')](handleError(_0x20335b,null));};exports[_0xfe34('0x9a')]=function(_0x1e6f8c,_0x3547ff,_0x2a953b){return db[_0xfe34('0x36')][_0xfe34('0x50')]({'where':{'id':_0x1e6f8c[_0xfe34('0x4e')]['id']}})[_0xfe34('0x2b')](function(_0xd81b38){if(_0xd81b38){return _0xd81b38[_0xfe34('0x2c')]();}})[_0xfe34('0x2b')](function(_0x13e02b){rimraf(path[_0xfe34('0x52')](config['root'],_0xfe34('0x54'),path['dirname'](_0x13e02b[_0xfe34('0x58')])),function(){});return _0x13e02b;})[_0xfe34('0x2b')](handleEntityNotFound(_0x3547ff,null))[_0xfe34('0x2b')](respondWithStatusCode(_0x3547ff,null))['catch'](handleError(_0x3547ff,null));};exports['webhookGet']=function(_0xea0502,_0x443747,_0x19dd51){return BPromise[_0xfe34('0x9b')]()[_0xfe34('0x2b')](function(){if(!_0xea0502[_0xfe34('0x3c')][_0xfe34('0x58')]){throw new Error(_0xfe34('0x9c'));}if(!_0xea0502[_0xfe34('0x3c')][_0xfe34('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x29f334=_0xea0502[_0xfe34('0x3c')]['hostname']?_0xea0502['query'][_0xfe34('0x9e')]+':'+_0xea0502['query'][_0xfe34('0x9d')]:_0xfe34('0x9f')+_0xea0502['query'][_0xfe34('0x9d')];var _0x19a5b5=_0xea0502[_0xfe34('0x3c')][_0xfe34('0x20')]?_0xea0502['query'][_0xfe34('0x20')]:!![];var _0x19edc9=_0xea0502[_0xfe34('0x3c')]['encoding']?_0xea0502[_0xfe34('0x3c')]['encoding']:null;var _0x1da99d={'method':_0xea0502[_0xfe34('0xa0')],'uri':util[_0xfe34('0x55')](_0xfe34('0xa1'),_0x29f334,_0xea0502['query'][_0xfe34('0x58')]),'json':_0x19a5b5,'resolveWithFullResponse':!![],'encoding':_0x19edc9,'qs':_0xea0502[_0xfe34('0x3c')]};if(_0xea0502[_0xfe34('0xa2')]){_0x1da99d[_0xfe34('0xa2')]=_0xea0502[_0xfe34('0xa2')];if(_0x1da99d['headers']['content-length']){delete _0x1da99d['headers'][_0xfe34('0xa3')];}}if(_0x1da99d[_0xfe34('0xa2')]['content-type']){delete _0x1da99d['headers'][_0xfe34('0xa4')];}return rp(_0x1da99d);})[_0xfe34('0x2b')](function(_0x1ed5a9){if(_0x1ed5a9){_0x443747[_0xfe34('0x25')](_0x1ed5a9[_0xfe34('0xa2')]);logger[_0xfe34('0x69')](_0x1ed5a9[_0xfe34('0x92')]);if(_[_0xfe34('0xa5')](_0xea0502[_0xfe34('0x3c')][_0xfe34('0x58')],'download')&&_0x1ed5a9['statusCode']==0x1f4){return _0x443747[_0xfe34('0x1e')](_0x1ed5a9[_0xfe34('0xa6')]);}else{return _0x443747['status'](_0x1ed5a9[_0xfe34('0xa6')])['send'](_0x1ed5a9[_0xfe34('0x92')]);}}else{return _0x443747[_0xfe34('0x1e')](0xc8);}})['catch'](handleError(_0x443747,null));};exports['webhookPost']=function(_0x172d02,_0x266d5e,_0x3dafbe){return BPromise['resolve']()[_0xfe34('0x2b')](function(){if(!_0x172d02['query'][_0xfe34('0x58')]){throw new Error(_0xfe34('0x9c'));}if(!_0x172d02['query']['port']){throw new Error(_0xfe34('0xa7'));}var _0x34d8fc=_0x172d02[_0xfe34('0x3c')][_0xfe34('0x9e')]?_0x172d02[_0xfe34('0x3c')][_0xfe34('0x9e')]+':'+_0x172d02[_0xfe34('0x3c')][_0xfe34('0x9d')]:_0xfe34('0x9f')+_0x172d02[_0xfe34('0x3c')][_0xfe34('0x9d')];var _0x517b13=_0x172d02[_0xfe34('0x3c')][_0xfe34('0x20')]?_0x172d02['query'][_0xfe34('0x20')]:!![];var _0x176413=_0x172d02[_0xfe34('0x3c')][_0xfe34('0xa8')]?_0x172d02[_0xfe34('0x3c')]['encoding']:null;var _0x4cd286={'method':_0x172d02[_0xfe34('0xa0')],'uri':util[_0xfe34('0x55')]('%s%s',_0x34d8fc,_0x172d02[_0xfe34('0x3c')][_0xfe34('0x58')]),'json':_0x517b13,'resolveWithFullResponse':!![],'encoding':_0x176413,'body':_0x172d02['body']};if(_0x172d02[_0xfe34('0xa2')]){_0x4cd286[_0xfe34('0xa2')]=_0x172d02[_0xfe34('0xa2')];if(_0x4cd286[_0xfe34('0xa2')][_0xfe34('0xa3')]){delete _0x4cd286['headers'][_0xfe34('0xa3')];}}if(_0x4cd286[_0xfe34('0xa2')][_0xfe34('0xa4')]){delete _0x4cd286[_0xfe34('0xa2')][_0xfe34('0xa4')];}return rp(_0x4cd286);})[_0xfe34('0x2b')](function(_0x3dc516){if(_0x3dc516){_0x266d5e[_0xfe34('0x25')](_0x3dc516[_0xfe34('0xa2')]);logger[_0xfe34('0x69')](_0x3dc516['body']);return _0x266d5e[_0xfe34('0x1f')](_0x3dc516[_0xfe34('0xa6')])[_0xfe34('0x33')](_0x3dc516[_0xfe34('0x92')]);}else{return _0x266d5e[_0xfe34('0x1e')](0xc8);}})['catch'](handleError(_0x266d5e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8300468..048ec6a 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 _0xafb9=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x180947,_0x589ffa){var _0x58c81d=function(_0x5c7a96){while(--_0x5c7a96){_0x180947['push'](_0x180947['shift']());}};_0x58c81d(++_0x589ffa);}(_0xafb9,0x68));var _0x9afb=function(_0xf16d82,_0xd502c4){_0xf16d82=_0xf16d82-0x0;var _0xf25b39=_0xafb9[_0xf16d82];return _0xf25b39;};'use strict';var EventEmitter=require(_0x9afb('0x0'));var Plugin=require(_0x9afb('0x1'))['db'][_0x9afb('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9afb('0x3')](0x0);var events={'afterCreate':_0x9afb('0x4'),'afterUpdate':_0x9afb('0x5'),'afterDestroy':_0x9afb('0x6')};function emitEvent(_0x44892f){return function(_0xdaf0c6,_0x4e983d,_0x498463){PluginEvents[_0x9afb('0x7')](_0x44892f+':'+_0xdaf0c6['id'],_0xdaf0c6);PluginEvents['emit'](_0x44892f,_0xdaf0c6);_0x498463(null);};}for(var e in events){if(events[_0x9afb('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xc9ab=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x100133,_0x27082a){var _0x50086e=function(_0x33bddb){while(--_0x33bddb){_0x100133['push'](_0x100133['shift']());}};_0x50086e(++_0x27082a);}(_0xc9ab,0x125));var _0xbc9a=function(_0x4b86e5,_0xebe1df){_0x4b86e5=_0x4b86e5-0x0;var _0x473bc3=_0xc9ab[_0x4b86e5];return _0x473bc3;};'use strict';var EventEmitter=require(_0xbc9a('0x0'));var Plugin=require(_0xbc9a('0x1'))['db'][_0xbc9a('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbc9a('0x3')};function emitEvent(_0x20e8eb){return function(_0x23d40c,_0x33e557,_0x16f84d){PluginEvents[_0xbc9a('0x4')](_0x20e8eb+':'+_0x23d40c['id'],_0x23d40c);PluginEvents[_0xbc9a('0x4')](_0x20e8eb,_0x23d40c);_0x16f84d(null);};}for(var e in events){if(events[_0xbc9a('0x5')](e)){var event=events[e];Plugin[_0xbc9a('0x6')](e,emitEvent(event));}}module[_0xbc9a('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 599c689..bdd6ee3 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 _0xf4f3=['./plugin.attributes','exports','define','Plugin','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4f4c01,_0x38c583){var _0x191f01=function(_0x3bc958){while(--_0x3bc958){_0x4f4c01['push'](_0x4f4c01['shift']());}};_0x191f01(++_0x38c583);}(_0xf4f3,0x94));var _0x3f4f=function(_0x159b89,_0x29c326){_0x159b89=_0x159b89-0x0;var _0xf50a7d=_0xf4f3[_0x159b89];return _0xf50a7d;};'use strict';var _=require(_0x3f4f('0x0'));var util=require('util');var logger=require(_0x3f4f('0x1'))(_0x3f4f('0x2'));var moment=require(_0x3f4f('0x3'));var BPromise=require(_0x3f4f('0x4'));var rp=require(_0x3f4f('0x5'));var fs=require('fs');var path=require(_0x3f4f('0x6'));var rimraf=require(_0x3f4f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3f4f('0x8'));module[_0x3f4f('0x9')]=function(_0x1135c1,_0x197411){return _0x1135c1[_0x3f4f('0xa')](_0x3f4f('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd0d=['moment','rimraf','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api'];(function(_0x53874d,_0x522af1){var _0x391c4e=function(_0x48ad91){while(--_0x48ad91){_0x53874d['push'](_0x53874d['shift']());}};_0x391c4e(++_0x522af1);}(_0xcd0d,0x10a));var _0xdcd0=function(_0x5f55b5,_0x372ef9){_0x5f55b5=_0x5f55b5-0x0;var _0x489ba1=_0xcd0d[_0x5f55b5];return _0x489ba1;};'use strict';var _=require(_0xdcd0('0x0'));var util=require(_0xdcd0('0x1'));var logger=require(_0xdcd0('0x2'))(_0xdcd0('0x3'));var moment=require(_0xdcd0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdcd0('0x5'));var config=require('../../config/environment');var attributes=require(_0xdcd0('0x6'));module[_0xdcd0('0x7')]=function(_0x782b28,_0x3d71ef){return _0x782b28[_0xdcd0('0x8')](_0xdcd0('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 4eedbe9..22a5c98 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 _0x0e92=['request\x20sent','stringify','code','error','message','result','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x3c9210,_0x3f3dd2){var _0x5b61fd=function(_0x27a6fc){while(--_0x27a6fc){_0x3c9210['push'](_0x3c9210['shift']());}};_0x5b61fd(++_0x3f3dd2);}(_0x0e92,0x150));var _0x20e9=function(_0x40cf94,_0x4f6147){_0x40cf94=_0x40cf94-0x0;var _0x16a001=_0x0e92[_0x40cf94];return _0x16a001;};'use strict';var _=require(_0x20e9('0x0'));var util=require(_0x20e9('0x1'));var moment=require(_0x20e9('0x2'));var BPromise=require(_0x20e9('0x3'));var rs=require(_0x20e9('0x4'));var fs=require('fs');var Redis=require(_0x20e9('0x5'));var db=require(_0x20e9('0x6'))['db'];var utils=require(_0x20e9('0x7'));var logger=require(_0x20e9('0x8'))(_0x20e9('0x9'));var config=require(_0x20e9('0xa'));var jayson=require(_0x20e9('0xb'));var client=jayson['client'][_0x20e9('0xc')]({'port':0x232a});config['redis']=_[_0x20e9('0xd')](config[_0x20e9('0xe')],{'host':_0x20e9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20e9('0x10'))[_0x20e9('0x11')](socket);function respondWithRpcPromise(_0x1e9957,_0x332ea6,_0x2a01a2){return new BPromise(function(_0x132646,_0x151bbf){return client[_0x20e9('0x12')](_0x1e9957,_0x2a01a2)[_0x20e9('0x13')](function(_0xa2d7fa){logger[_0x20e9('0x14')](_0x20e9('0x15'),_0x332ea6,'request\x20sent');logger[_0x20e9('0x16')](_0x20e9('0x17'),_0x332ea6,_0x20e9('0x18'),JSON[_0x20e9('0x19')](_0xa2d7fa));if(_0xa2d7fa['error']){if(_0xa2d7fa['error'][_0x20e9('0x1a')]===0x1f4){logger['error'](_0x20e9('0x15'),_0x332ea6,_0xa2d7fa[_0x20e9('0x1b')][_0x20e9('0x1c')]);return _0x151bbf(_0xa2d7fa[_0x20e9('0x1b')][_0x20e9('0x1c')]);}logger[_0x20e9('0x1b')](_0x20e9('0x15'),_0x332ea6,_0xa2d7fa[_0x20e9('0x1b')][_0x20e9('0x1c')]);return _0x132646(_0xa2d7fa[_0x20e9('0x1b')]['message']);}else{logger[_0x20e9('0x14')](_0x20e9('0x15'),_0x332ea6,'request\x20sent');_0x132646(_0xa2d7fa[_0x20e9('0x1d')][_0x20e9('0x1c')]);}})[_0x20e9('0x1e')](function(_0x2c12d3){logger[_0x20e9('0x1b')]('Plugin,\x20%s,\x20%s',_0x332ea6,_0x2c12d3);_0x151bbf(_0x2c12d3);});});}exports[_0x20e9('0x1f')]=function(_0x5810b7){var _0x5c1719=this;return new Promise(function(_0x377071,_0x5c7581){return db[_0x20e9('0x20')][_0x20e9('0x21')](_0x5810b7['body'],{'raw':_0x5810b7[_0x20e9('0x22')]?_0x5810b7[_0x20e9('0x22')][_0x20e9('0x23')]===undefined?!![]:![]:!![]})[_0x20e9('0x13')](function(_0x21c9b4){logger[_0x20e9('0x14')](_0x20e9('0x1f'),_0x5810b7);logger[_0x20e9('0x16')]('CreatePlugin',_0x5810b7,JSON[_0x20e9('0x19')](_0x21c9b4));_0x377071(_0x21c9b4);})[_0x20e9('0x1e')](function(_0x1aeabe){logger['error']('CreatePlugin',_0x1aeabe[_0x20e9('0x1c')],_0x5810b7);_0x5c7581(_0x5c1719[_0x20e9('0x1b')](0x1f4,_0x1aeabe[_0x20e9('0x1c')]));});});}; \ No newline at end of file +var _0x98bc=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message','info','Plugin','create','body','options','raw','CreatePlugin','debug','stringify','catch','lodash','util','bluebird','ioredis'];(function(_0x39acbd,_0x5500fe){var _0x1e146f=function(_0x5b7434){while(--_0x5b7434){_0x39acbd['push'](_0x39acbd['shift']());}};_0x1e146f(++_0x5500fe);}(_0x98bc,0xce));var _0xc98b=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x98bc[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require(_0xc98b('0x0'));var util=require(_0xc98b('0x1'));var moment=require('moment');var BPromise=require(_0xc98b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc98b('0x3'));var db=require(_0xc98b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc98b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc98b('0x6'));var client=jayson[_0xc98b('0x7')][_0xc98b('0x8')]({'port':0x232a});config[_0xc98b('0x9')]=_['defaults'](config[_0xc98b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc98b('0xa'))(new Redis(config['redis']));require(_0xc98b('0xb'))[_0xc98b('0xc')](socket);function respondWithRpcPromise(_0x1369c5,_0x425341,_0x384902){return new BPromise(function(_0x4d5080,_0x4de8d8){return client[_0xc98b('0xd')](_0x1369c5,_0x384902)[_0xc98b('0xe')](function(_0x3f804e){logger['info']('Plugin,\x20%s,\x20%s',_0x425341,_0xc98b('0xf'));logger['debug'](_0xc98b('0x10'),_0x425341,'request\x20sent',JSON['stringify'](_0x3f804e));if(_0x3f804e['error']){if(_0x3f804e[_0xc98b('0x11')]['code']===0x1f4){logger[_0xc98b('0x11')](_0xc98b('0x12'),_0x425341,_0x3f804e[_0xc98b('0x11')]['message']);return _0x4de8d8(_0x3f804e[_0xc98b('0x11')][_0xc98b('0x13')]);}logger['error'](_0xc98b('0x12'),_0x425341,_0x3f804e[_0xc98b('0x11')][_0xc98b('0x13')]);return _0x4d5080(_0x3f804e[_0xc98b('0x11')][_0xc98b('0x13')]);}else{logger[_0xc98b('0x14')](_0xc98b('0x12'),_0x425341,_0xc98b('0xf'));_0x4d5080(_0x3f804e['result'][_0xc98b('0x13')]);}})['catch'](function(_0x289fc3){logger[_0xc98b('0x11')](_0xc98b('0x12'),_0x425341,_0x289fc3);_0x4de8d8(_0x289fc3);});});}exports['CreatePlugin']=function(_0x34cd78){var _0x17e2c2=this;return new Promise(function(_0x3ef60a,_0x2bd6ba){return db[_0xc98b('0x15')][_0xc98b('0x16')](_0x34cd78[_0xc98b('0x17')],{'raw':_0x34cd78['options']?_0x34cd78[_0xc98b('0x18')][_0xc98b('0x19')]===undefined?!![]:![]:!![]})[_0xc98b('0xe')](function(_0x437001){logger[_0xc98b('0x14')](_0xc98b('0x1a'),_0x34cd78);logger[_0xc98b('0x1b')](_0xc98b('0x1a'),_0x34cd78,JSON[_0xc98b('0x1c')](_0x437001));_0x3ef60a(_0x437001);})[_0xc98b('0x1d')](function(_0x13e899){logger[_0xc98b('0x11')](_0xc98b('0x1a'),_0x13e899['message'],_0x34cd78);_0x2bd6ba(_0x17e2c2[_0xc98b('0x11')](0x1f4,_0x13e899[_0xc98b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 824ea3c..1cd1df2 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 _0xba6a=['update','emit','removeListener','register','length','plugin:','save','remove'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xba6a,0x1be));var _0xaba6=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xba6a[_0x3c22e0];return _0x215811;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xaba6('0x0'),_0xaba6('0x1'),_0xaba6('0x2')];function createListener(_0x51a871,_0x3587fe){return function(_0xc87cfd){_0x3587fe[_0xaba6('0x3')](_0x51a871,_0xc87cfd);};}function removeListener(_0x4276c1,_0x5e7475){return function(){PluginEvents[_0xaba6('0x4')](_0x4276c1,_0x5e7475);};}exports[_0xaba6('0x5')]=function(_0x350758){for(var _0x2c28fd=0x0,_0x39476e=events[_0xaba6('0x6')];_0x2c28fd<_0x39476e;_0x2c28fd++){var _0x417055=events[_0x2c28fd];var _0xd2dafb=createListener(_0xaba6('0x7')+_0x417055,_0x350758);PluginEvents['on'](_0x417055,_0xd2dafb);}}; \ No newline at end of file +var _0xc505=['length','plugin:','./plugin.events','save','emit','removeListener','register'];(function(_0xf9f689,_0xaa7d83){var _0x1f1f46=function(_0x492246){while(--_0x492246){_0xf9f689['push'](_0xf9f689['shift']());}};_0x1f1f46(++_0xaa7d83);}(_0xc505,0x12f));var _0x5c50=function(_0x68d9f8,_0xc44731){_0x68d9f8=_0x68d9f8-0x0;var _0x53966d=_0xc505[_0x68d9f8];return _0x53966d;};'use strict';var PluginEvents=require(_0x5c50('0x0'));var events=[_0x5c50('0x1'),'remove','update'];function createListener(_0x5a2058,_0x27b67c){return function(_0x395f68){_0x27b67c[_0x5c50('0x2')](_0x5a2058,_0x395f68);};}function removeListener(_0x48525b,_0x15f83d){return function(){PluginEvents[_0x5c50('0x3')](_0x48525b,_0x15f83d);};}exports[_0x5c50('0x4')]=function(_0x18f716){for(var _0x362176=0x0,_0x2a3677=events[_0x5c50('0x5')];_0x362176<_0x2a3677;_0x362176++){var _0x49dc38=events[_0x362176];var _0x27a046=createListener(_0x5c50('0x6')+_0x49dc38,_0x18f716);PluginEvents['on'](_0x49dc38,_0x27a046);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 429aeaa..8a03501 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(_0x5b45ac,_0x393cbc){var _0x56a308=function(_0x3bc6fd){while(--_0x3bc6fd){_0x5b45ac['push'](_0x5b45ac['shift']());}};_0x56a308(++_0x393cbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x27b7d2,_0x56c091){var _0x3ef6be=function(_0x6e8a35){while(--_0x6e8a35){_0x27b7d2['push'](_0x27b7d2['shift']());}};_0x3ef6be(++_0x56c091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 708f9d0..0b2ba38 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 _0xa8a8=['dirname','start','dump','update','restart','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','length','catch','show','describe','params','create','script','join','../../files/plugins','body','cwd','chdir'];(function(_0x40bdb3,_0x5a81f2){var _0xeac086=function(_0x199fba){while(--_0x199fba){_0x40bdb3['push'](_0x40bdb3['shift']());}};_0xeac086(++_0x5a81f2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x57c7db,_0x14857c){_0x57c7db=_0x57c7db-0x0;var _0x29d106=_0xa8a8[_0x57c7db];return _0x29d106;};'use strict';var _=require(_0x8a8a('0x0'));var pm2=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var path=require('path');var exec=require(_0x8a8a('0x4'))[_0x8a8a('0x5')];var BPromise=require(_0x8a8a('0x6'));function handleEntityNotFound(_0x3ed1de,_0x45515d){return function(_0x1cecd4){if(!_0x1cecd4){_0x3ed1de[_0x8a8a('0x7')](0x194);;}return _0x1cecd4;};}function respondWithResult(_0x12db82,_0x2e8193){_0x2e8193=_0x2e8193||0xc8;return function(_0x315fe9){if(_0x315fe9){return _0x12db82[_0x8a8a('0x8')](_0x2e8193)[_0x8a8a('0x9')](_0x315fe9);}return null;};}function handleError(_0x4225b9,_0xecaa6f){_0xecaa6f=_0xecaa6f||0x1f4;return function(_0x3287f5){logger['error'](_0x3287f5['stack']);if(_0x3287f5[_0x8a8a('0xa')]){delete _0x3287f5['name'];}_0x4225b9[_0x8a8a('0x8')](_0xecaa6f)[_0x8a8a('0xb')](_0x3287f5);};}function execChildProcess(){return new BPromise(function(_0x532621,_0x118380){exec(_0x8a8a('0xc'),function(_0xb13fca,_0x5e448d,_0x679da2){logger[_0x8a8a('0xd')](_0x5e448d);logger[_0x8a8a('0xd')](_0x679da2);if(_0xb13fca){logger[_0x8a8a('0xe')](_0xb13fca);return _0x118380(_0xb13fca);}return _0x532621(_0x5e448d);});});}exports['index']=function(_0x23febf,_0x4e5d74){return pm2[_0x8a8a('0xf')]()[_0x8a8a('0x10')](function(_0x787eec){if(_0x787eec){var _0x2f6e33=_[_0x8a8a('0x11')](_0x787eec,function(_0x78b0f0){return _0x78b0f0[_0x8a8a('0xa')]==='express'||_0x78b0f0[_0x8a8a('0xa')]==='motion2';});return{'rows':_0x2f6e33,'count':_0x2f6e33[_0x8a8a('0x12')]};}return null;})[_0x8a8a('0x10')](respondWithResult(_0x4e5d74,null))[_0x8a8a('0x13')](handleError(_0x4e5d74,null));};exports[_0x8a8a('0x14')]=function(_0x42e8b6,_0x5dd616){return pm2[_0x8a8a('0x15')](_0x42e8b6[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](respondWithResult(_0x5dd616,null))[_0x8a8a('0x10')](handleEntityNotFound(_0x5dd616,null))[_0x8a8a('0x13')](handleError(_0x5dd616,null));};exports[_0x8a8a('0x17')]=function(_0x4d7a45,_0x5dc5ae){if(_0x4d7a45['body']['name']&&_0x4d7a45['body'][_0x8a8a('0x18')]){var _0x45095b=path[_0x8a8a('0x19')](__dirname,_0x8a8a('0x1a'),_0x4d7a45[_0x8a8a('0x1b')][_0x8a8a('0x18')]);var _0x242bac=process[_0x8a8a('0x1c')]();process[_0x8a8a('0x1d')](path[_0x8a8a('0x1e')](_0x45095b));return execChildProcess()[_0x8a8a('0x10')](function(_0x3aa2bb){process[_0x8a8a('0x1d')](_0x242bac);return pm2[_0x8a8a('0x1f')]({'name':_0x4d7a45[_0x8a8a('0x1b')]['name'],'script':_0x45095b});})[_0x8a8a('0x10')](function(_0x16c55b){pm2[_0x8a8a('0x20')]();return _0x16c55b[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x5dc5ae,0xc9))[_0x8a8a('0x13')](handleError(_0x5dc5ae,null));}else{return _0x5dc5ae[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8a8a('0x21')]=function(_0x38c1e0,_0x2e217a){if(_0x38c1e0['body']['id']){delete _0x38c1e0['body']['id'];}var _0x2dafcd={'online':_0x8a8a('0x22'),'stopped':'stop'};if(_0x2dafcd['hasOwnProperty'](_0x38c1e0['body'][_0x8a8a('0x8')])){return pm2[_0x2dafcd[_0x38c1e0['body'][_0x8a8a('0x8')]]](_0x38c1e0[_0x8a8a('0x16')]['id'])['then'](respondWithResult(_0x2e217a,0xc8))[_0x8a8a('0x13')](handleError(_0x2e217a,null));}else{return _0x2e217a[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x23')});}};exports[_0x8a8a('0x24')]=function(_0x3d6594,_0x3e73b1){if(_0x3d6594[_0x8a8a('0x1b')]['id']){delete _0x3d6594['body']['id'];}if(_0x3d6594['params']['id']){return pm2['delete'](_0x3d6594[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](function(_0x5f301e){pm2[_0x8a8a('0x20')]();return _0x5f301e[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x3e73b1,null))['catch'](handleError(_0x3e73b1,null));}else{return _0x3e73b1[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x25')});}}; \ No newline at end of file +var _0xb4e6=['express','motion2','length','describe','params','catch','create','body','script','join','cwd','chdir','dirname','dump','update','restart','hasOwnProperty','Unknown\x20status','delete','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','index','then','reject'];(function(_0x3e5ae1,_0x3d2e00){var _0x2dea96=function(_0x57a927){while(--_0x57a927){_0x3e5ae1['push'](_0x3e5ae1['shift']());}};_0x2dea96(++_0x3d2e00);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xb4e6[_0x211fef];return _0x5447bf;};'use strict';var _=require(_0x6b4e('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var path=require(_0x6b4e('0x3'));var exec=require(_0x6b4e('0x4'))[_0x6b4e('0x5')];var BPromise=require(_0x6b4e('0x6'));function handleEntityNotFound(_0x1929b8,_0x52313b){return function(_0x40da90){if(!_0x40da90){_0x1929b8[_0x6b4e('0x7')](0x194);;}return _0x40da90;};}function respondWithResult(_0x1f67a2,_0x49de51){_0x49de51=_0x49de51||0xc8;return function(_0xd3138f){if(_0xd3138f){return _0x1f67a2['status'](_0x49de51)['json'](_0xd3138f);}return null;};}function handleError(_0x2311d9,_0x48c870){_0x48c870=_0x48c870||0x1f4;return function(_0x53a71f){logger[_0x6b4e('0x8')](_0x53a71f[_0x6b4e('0x9')]);if(_0x53a71f[_0x6b4e('0xa')]){delete _0x53a71f[_0x6b4e('0xa')];}_0x2311d9[_0x6b4e('0xb')](_0x48c870)[_0x6b4e('0xc')](_0x53a71f);};}function execChildProcess(){return new BPromise(function(_0x323487,_0x49c734){exec(_0x6b4e('0xd'),function(_0x3bba86,_0x58c67d,_0x2a4d0f){logger[_0x6b4e('0xe')](_0x58c67d);logger[_0x6b4e('0xe')](_0x2a4d0f);if(_0x3bba86){logger[_0x6b4e('0x8')](_0x3bba86);return _0x49c734(_0x3bba86);}return _0x323487(_0x58c67d);});});}exports[_0x6b4e('0xf')]=function(_0xa3d358,_0x1db513){return pm2['list']()[_0x6b4e('0x10')](function(_0x29bdee){if(_0x29bdee){var _0x4788cf=_[_0x6b4e('0x11')](_0x29bdee,function(_0x4b62ad){return _0x4b62ad[_0x6b4e('0xa')]===_0x6b4e('0x12')||_0x4b62ad[_0x6b4e('0xa')]===_0x6b4e('0x13');});return{'rows':_0x4788cf,'count':_0x4788cf[_0x6b4e('0x14')]};}return null;})[_0x6b4e('0x10')](respondWithResult(_0x1db513,null))['catch'](handleError(_0x1db513,null));};exports['show']=function(_0x67496d,_0x1beb73){return pm2[_0x6b4e('0x15')](_0x67496d[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](respondWithResult(_0x1beb73,null))[_0x6b4e('0x10')](handleEntityNotFound(_0x1beb73,null))[_0x6b4e('0x17')](handleError(_0x1beb73,null));};exports[_0x6b4e('0x18')]=function(_0x35aee1,_0x20a178){if(_0x35aee1[_0x6b4e('0x19')]['name']&&_0x35aee1[_0x6b4e('0x19')][_0x6b4e('0x1a')]){var _0x31fb9d=path[_0x6b4e('0x1b')](__dirname,'../../files/plugins',_0x35aee1[_0x6b4e('0x19')]['script']);var _0x2503a5=process[_0x6b4e('0x1c')]();process[_0x6b4e('0x1d')](path[_0x6b4e('0x1e')](_0x31fb9d));return execChildProcess()[_0x6b4e('0x10')](function(_0x346566){process[_0x6b4e('0x1d')](_0x2503a5);return pm2['start']({'name':_0x35aee1[_0x6b4e('0x19')]['name'],'script':_0x31fb9d});})[_0x6b4e('0x10')](function(_0x884b7e){pm2[_0x6b4e('0x1f')]();return _0x884b7e[0x0];})[_0x6b4e('0x10')](respondWithResult(_0x20a178,0xc9))['catch'](handleError(_0x20a178,null));}else{return _0x20a178[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x6b4e('0x20')]=function(_0x381ff0,_0x3513b2){if(_0x381ff0[_0x6b4e('0x19')]['id']){delete _0x381ff0['body']['id'];}var _0x2d42be={'online':_0x6b4e('0x21'),'stopped':'stop'};if(_0x2d42be[_0x6b4e('0x22')](_0x381ff0[_0x6b4e('0x19')][_0x6b4e('0xb')])){return pm2[_0x2d42be[_0x381ff0[_0x6b4e('0x19')]['status']]](_0x381ff0[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](respondWithResult(_0x3513b2,0xc8))['catch'](handleError(_0x3513b2,null));}else{return _0x3513b2[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':_0x6b4e('0x23')});}};exports['destroy']=function(_0x5c2200,_0x11156e){if(_0x5c2200[_0x6b4e('0x19')]['id']){delete _0x5c2200[_0x6b4e('0x19')]['id'];}if(_0x5c2200['params']['id']){return pm2[_0x6b4e('0x24')](_0x5c2200[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](function(_0x5c1444){pm2['dump']();return _0x5c1444[0x0];})[_0x6b4e('0x10')](respondWithResult(_0x11156e,null))['catch'](handleError(_0x11156e,null));}else{return _0x11156e[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 25f0cfc..5d11478 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 _0x3618=['/agents','isAuthenticated','getAgents','/queues','exports','express','Router','./realtime.controller','get'];(function(_0x4ca401,_0x603bef){var _0xa00abd=function(_0xc3bbb7){while(--_0xc3bbb7){_0x4ca401['push'](_0x4ca401['shift']());}};_0xa00abd(++_0x603bef);}(_0x3618,0x1c7));var _0x8361=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3618[_0x28947d];return _0x12d2ee;};'use strict';var express=require(_0x8361('0x0'));var router=express[_0x8361('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x8361('0x2'));router[_0x8361('0x3')](_0x8361('0x4'),auth[_0x8361('0x5')](),controller[_0x8361('0x6')]);router[_0x8361('0x3')](_0x8361('0x7'),auth[_0x8361('0x5')](),controller['getQueues']);module[_0x8361('0x8')]=router; \ No newline at end of file +var _0x808e=['express','Router','../../components/auth/service','./realtime.controller','get','/agents','/queues'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x808e,0x149));var _0xe808=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x808e[_0x257642];return _0x3d813b;};'use strict';var express=require(_0xe808('0x0'));var router=express[_0xe808('0x1')]();var auth=require(_0xe808('0x2'));var controller=require(_0xe808('0x3'));router[_0xe808('0x4')](_0xe808('0x5'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xe808('0x6'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index c7dc974..a955f2b 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 _0x3505=['includes','globalStatus','validateSortParameter','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','Pause','forEach','merge','where','user','userProfileId','online','extraQueryConditions','assign','omit','UserProfile','findAndCountAll','find','filterAgentAttributes','pause','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','toLowerCase','Queue','key','name','dialActive','dialMethod','startCase','filter','getResources','getRealtimeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','handleError','offset','limit','undefined','count','status','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort'];(function(_0x248fad,_0x3de752){var _0x23a81=function(_0x256a0f){while(--_0x256a0f){_0x248fad['push'](_0x248fad['shift']());}};_0x23a81(++_0x3de752);}(_0x3505,0x1d9));var _0x5350=function(_0x4dab22,_0x4f91f3){_0x4dab22=_0x4dab22-0x0;var _0x19552d=_0x3505[_0x4dab22];return _0x19552d;};'use strict';var _=require(_0x5350('0x0'));var util=require('util');var rta=require(_0x5350('0x1'));var rtq=require(_0x5350('0x2'));var qs=require(_0x5350('0x3'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x5350('0x4'))['APIBadRequestError'];var APIHandleError=require(_0x5350('0x4'))[_0x5350('0x5')];function respondWithFilteredResult(_0x2572bb,_0x563d84){return function(_0x39a026){if(_0x39a026){var _0x1aadbb=typeof _0x563d84[_0x5350('0x6')]==='undefined'&&typeof _0x563d84[_0x5350('0x7')]===_0x5350('0x8');var _0x30ea8d=_0x39a026[_0x5350('0x9')];var _0x3112b8=_0x1aadbb?0x0:_0x563d84[_0x5350('0x6')];var _0x528783=_0x1aadbb?_0x39a026[_0x5350('0x9')]:_0x563d84['offset']+_0x563d84['limit'];var _0x1e96be;if(_0x528783>=_0x30ea8d){_0x528783=_0x30ea8d;_0x1e96be=0xc8;}else{_0x1e96be=0xce;}_0x2572bb[_0x5350('0xa')](_0x1e96be);return _0x2572bb['set'](_0x5350('0xb'),_0x3112b8+'-'+_0x528783+'/'+_0x30ea8d)[_0x5350('0xc')](_0x39a026);}return null;};}exports['getAgents']=function(_0x41e93b,_0x2f0c7e){var _0x3049ea={'count':0x0,'rows':[]};var _0x19c2bc={};var _0x46c89e;var _0x3d16e6=utils[_0x5350('0xd')]();var _0x2134d4;var _0x3d9d02;var _0x52a20a=_0x41e93b[_0x5350('0xe')][_0x5350('0xf')];var _0x593226=_0x41e93b[_0x5350('0xe')][_0x5350('0x10')];var _0x2a302d=_0x41e93b['query'][_0x5350('0x11')];var _0x2c18ec=_0x593226==='pause'||_0x593226===_0x5350('0x12')?!![]:![];var _0x13c1e1=[];var _0x20facc;var _0x34e706;Promise[_0x5350('0x13')]()['then'](function(){if(_0x41e93b['query'][_0x5350('0x14')]){if(!utils[_0x5350('0x15')](_0x41e93b['query'][_0x5350('0x14')])){throw new APIBadRequestError(util[_0x5350('0x16')](_0x5350('0x17'),_0x41e93b['query']['channel']));}_0x46c89e=_0x41e93b[_0x5350('0xe')][_0x5350('0x14')]['toLowerCase']();}if(!_0x41e93b[_0x5350('0xe')][_0x5350('0x18')]||!_0x41e93b[_0x5350('0xe')][_0x5350('0x18')][_0x5350('0x19')](_0x5350('0x1a'))){_0x41e93b['query'][_0x5350('0x18')]=rta[_0x5350('0x1b')](_0x41e93b[_0x5350('0xe')][_0x5350('0x18')]);return;}var _0x24fbbe=rta['getUpdatedSortOptions'](_0x41e93b[_0x5350('0xe')][_0x5350('0x18')]);_0x41e93b[_0x5350('0xe')][_0x5350('0x18')]=_0x24fbbe[_0x5350('0x1c')][_0x5350('0x1d')](',');_0x20facc=_0x24fbbe[_0x5350('0x1e')];})[_0x5350('0x1f')](function(){if(!_0x52a20a){return[];}return rta[_0x5350('0x20')](_0x52a20a,_0x46c89e);})[_0x5350('0x1f')](function(_0x2a3558){_0x13c1e1=_0x2a3558;return rta[_0x5350('0x21')]();})['then'](function(_0x3c2dde){_0x3d9d02=_0x3c2dde[_0x5350('0x22')];if((!_0x593226||_0x2c18ec)&&!_0x20facc){return _0x13c1e1;}if(_0x20facc&&!_0x593226){return rta['getSortedAgentsIdsByStatus'](_0x3d9d02,_0x13c1e1,_0x20facc);}else{return rta[_0x5350('0x23')](_0x3d9d02,_0x13c1e1,_0x593226);}})[_0x5350('0x1f')](function(_0x54a9b2){_0x13c1e1=_0x54a9b2;var _0x456c85=![];if(_0x13c1e1[_0x5350('0x24')]===0x0){if(_0x52a20a||_0x593226){_0x456c85=!![];}if(_0x2c18ec){_0x456c85=![];}}if(_0x456c85){return _0x3049ea;}var _0x2b9d31=_[_0x5350('0x25')](db[_0x5350('0x26')][_0x5350('0x27')],function(_0x4f7077){return{'name':_0x4f7077[_0x5350('0x28')],'type':_0x4f7077[_0x5350('0x29')]['key']};});_0x41e93b[_0x5350('0xe')][_0x5350('0x2a')]=_0x5350('0x2b');_0x19c2bc=qs[_0x5350('0x2c')](_0x2b9d31,_0x41e93b);_0x19c2bc[_0x5350('0x2d')]=!![];var _0x4374be=[];if(_0x13c1e1['length']>0x0){_0x4374be[_0x5350('0x2e')]({'id':{'$in':_0x13c1e1}});if(_0x20facc&&!_0x593226){_0x34e706=[db[_0x5350('0x2f')][_0x5350('0x30')](_0x5350('0x31')+_0x13c1e1+')')];_0x19c2bc[_0x5350('0x1e')]=_0x34e706;}}if(_0x2c18ec){_0x3d16e6['forEach'](function(_0x59ae12){var _0x519603=!![];if(_0x593226===_0x5350('0x12')&&_0x46c89e!==_0x59ae12){_0x519603=![];}_0x4374be['push']({[_0x59ae12+_0x5350('0x32')]:_0x519603});});if(_0x2a302d){_0x4374be[_0x5350('0x2e')]({'pauseType':_0x2a302d});}}else if(_0x593226){_0x3d16e6[_0x5350('0x33')](function(_0x3e1561){_0x4374be['push']({[_0x3e1561+_0x5350('0x32')]:![]});});}_0x19c2bc['where']=_[_0x5350('0x34')](_0x19c2bc[_0x5350('0x35')],{'$and':_0x4374be});if(_0x41e93b[_0x5350('0x36')][_0x5350('0x2a')]===_0x5350('0x36')){var _0x259171={'params':{'id':_0x41e93b[_0x5350('0x36')][_0x5350('0x37')]},'query':{'section':'Agents','role':_0x5350('0x2b'),'raw':!![],'ids':_0x13c1e1,'customSorting':_0x34e706}};if(_0x41e93b[_0x5350('0xe')][_0x5350('0x38')]){_0x259171[_0x5350('0xe')][_0x5350('0x38')]=!![];}if(_0x2c18ec){_0x259171['query'][_0x5350('0x39')]=_0x4374be;}_0x259171[_0x5350('0xe')]=Object[_0x5350('0x3a')](_0x259171['query'],_[_0x5350('0x3b')](_0x41e93b[_0x5350('0xe')],'id'));return db[_0x5350('0x3c')]['getResources'](_0x259171);}return db[_0x5350('0x26')][_0x5350('0x3d')](_0x19c2bc);})[_0x5350('0x1f')](function(_0x2f654d){_0x3049ea['count']=_0x2f654d[_0x5350('0x9')];_0x2134d4=_0x2f654d[_0x5350('0x22')];return _0x2134d4[_0x5350('0x25')](function(_0x30da9c){var _0x3393fe=_[_0x5350('0x3e')](_0x3d9d02,['id',_0x30da9c['id']]);if(_0x3393fe){var _0x5ba3c4=rta[_0x5350('0x3f')](_0x3393fe);_[_0x5350('0x34')](_0x30da9c,_0x5ba3c4);}_0x30da9c[_0x5350('0x1a')]=rta['getAgentStatus'](_0x30da9c);if(_0x30da9c[_0x5350('0x1a')][_0x5350('0x19')](_0x5350('0x40'))){_0x3d16e6[_0x5350('0x33')](function(_0x32b18c){if(_0x30da9c[_0x32b18c+_0x5350('0x32')]){if(_0x32b18c===_0x5350('0x41')){if(_0x30da9c[_0x5350('0x42')]!==_0x5350('0x43')){_0x30da9c['voiceStatus']=_0x5350('0x40');}}else{_0x30da9c[_0x32b18c+_0x5350('0x44')]=_0x5350('0x40');}}});}return _0x30da9c;});})[_0x5350('0x1f')](function(_0x1690ca){if(!_0x20facc||_0x34e706){return _0x1690ca;}return rta[_0x5350('0x45')](_0x1690ca,_0x20facc);})['then'](function(_0x246557){var _0x2e4227=rta[_0x5350('0x46')]();_0x3049ea[_0x5350('0x22')]=_0x246557[_0x5350('0x25')](function(_0x232a24){return _[_0x5350('0x47')](_0x232a24,_0x2e4227);});return _0x3049ea;})[_0x5350('0x1f')](respondWithFilteredResult(_0x2f0c7e,_0x19c2bc))[_0x5350('0x48')](APIHandleError(_0x2f0c7e));};exports['getQueues']=function(_0x353a87,_0x14c7b7){var _0x4cd04f={'count':0x0,'rows':[]};var _0x7be46={};var _0x25047b;var _0x136039;var _0x5abe06;Promise['resolve']()[_0x5350('0x1f')](function(){if(_0x353a87['query'][_0x5350('0x14')]){if(!utils[_0x5350('0x15')](_0x353a87[_0x5350('0xe')][_0x5350('0x14')])){throw new APIBadRequestError(util[_0x5350('0x16')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x353a87[_0x5350('0xe')][_0x5350('0x14')]));}_0x25047b=_0x353a87['query'][_0x5350('0x14')][_0x5350('0x49')]();}var _0xdb2d8f=_['startCase'](_0x25047b)+_0x5350('0x4a');var _0x54c634=_[_0x5350('0x25')](db[_0xdb2d8f][_0x5350('0x27')],function(_0x1d3670){return{'name':_0x1d3670['fieldName'],'type':_0x1d3670[_0x5350('0x29')][_0x5350('0x4b')]};});if(!_0x353a87[_0x5350('0xe')][_0x5350('0x1c')]){var _0x168264=['id',_0x5350('0x4c')];if(_0x25047b==='voice'){_0x168264[_0x5350('0x2e')](_0x5350('0x29'));if(_0x353a87[_0x5350('0xe')][_0x5350('0x29')]==='outbound'){_0x168264[_0x5350('0x2e')]([_0x5350('0x4d'),_0x5350('0x4e')]);}}_0x353a87[_0x5350('0xe')][_0x5350('0x1c')]=_0x168264[_0x5350('0x1d')](',');}_0x7be46=qs['getOptions'](_0x54c634,_0x353a87);if(_0x353a87[_0x5350('0x36')][_0x5350('0x2a')]===_0x5350('0x36')){var _0x345a61={'params':{'id':_0x353a87['user']['userProfileId']},'query':{'section':_0x25047b===_0x5350('0x41')&&_0x353a87[_0x5350('0xe')][_0x5350('0x29')]==='outbound'?'QueueCampaigns':_[_0x5350('0x4f')](_0x25047b)+'Queues','type':_0x353a87[_0x5350('0xe')][_0x5350('0x29')],'nolimit':!![],'sort':_0x5350('0x4c'),'filter':_0x353a87[_0x5350('0xe')][_0x5350('0x50')]}};_0x345a61['query']=Object[_0x5350('0x3a')](_0x345a61[_0x5350('0xe')],_0x353a87[_0x5350('0xe')]);delete _0x345a61[_0x5350('0xe')]['id'];return db[_0x5350('0x3c')][_0x5350('0x51')](_0x345a61);}return db[_0xdb2d8f][_0x5350('0x3d')](_0x7be46);})['then'](function(_0x3c68fb){_0x4cd04f[_0x5350('0x9')]=_0x3c68fb[_0x5350('0x9')];_0x136039=_0x3c68fb[_0x5350('0x22')];return rtq[_0x5350('0x52')](_0x353a87,_0x25047b);})[_0x5350('0x1f')](function(_0x1814d1){_0x5abe06=_0x1814d1[_0x5350('0x22')];return rtq['initializeQueues'](_0x136039,_0x5abe06,_0x25047b,_0x353a87[_0x5350('0xe')]['type']);})[_0x5350('0x1f')](function(_0x47fe29){_0x4cd04f['rows']=_0x47fe29;return _0x4cd04f;})['then'](respondWithFilteredResult(_0x14c7b7,_0x7be46))[_0x5350('0x48')](APIHandleError(_0x14c7b7));}; \ No newline at end of file +var _0x5e58=['map','User','fieldName','role','raw','length','push','literal','order','Pause','forEach','where','merge','user','Agents','agent','online','extraQueryConditions','omit','UserProfile','getResources','findAndCountAll','filterAgentAttributes','globalStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','Queue','rawAttributes','type','key','name','outbound','getOptions','QueueCampaigns','filter','assign','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','undefined','count','offset','set','Content-Range','json','getAgents','getChannels','query','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','rows','getAgentIdsByStatus'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x5e58,0x172));var _0x85e5=function(_0x4abcf4,_0x4d80bc){_0x4abcf4=_0x4abcf4-0x0;var _0x24c066=_0x5e58[_0x4abcf4];return _0x24c066;};'use strict';var _=require(_0x85e5('0x0'));var util=require(_0x85e5('0x1'));var rta=require(_0x85e5('0x2'));var rtq=require(_0x85e5('0x3'));var qs=require(_0x85e5('0x4'));var utils=require(_0x85e5('0x5'));var db=require(_0x85e5('0x6'))['db'];var APIBadRequestError=require(_0x85e5('0x7'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x5913eb,_0xc93f99){return function(_0x32f6d5){if(_0x32f6d5){var _0x490c06=typeof _0xc93f99['offset']===_0x85e5('0x8')&&typeof _0xc93f99['limit']===_0x85e5('0x8');var _0x300e76=_0x32f6d5[_0x85e5('0x9')];var _0x5b5802=_0x490c06?0x0:_0xc93f99[_0x85e5('0xa')];var _0x37b08d=_0x490c06?_0x32f6d5[_0x85e5('0x9')]:_0xc93f99[_0x85e5('0xa')]+_0xc93f99['limit'];var _0x2a29f6;if(_0x37b08d>=_0x300e76){_0x37b08d=_0x300e76;_0x2a29f6=0xc8;}else{_0x2a29f6=0xce;}_0x5913eb['status'](_0x2a29f6);return _0x5913eb[_0x85e5('0xb')](_0x85e5('0xc'),_0x5b5802+'-'+_0x37b08d+'/'+_0x300e76)[_0x85e5('0xd')](_0x32f6d5);}return null;};}exports[_0x85e5('0xe')]=function(_0x422fe6,_0x32a560){var _0x103588={'count':0x0,'rows':[]};var _0x350fa5={};var _0x316c84;var _0x97730d=utils[_0x85e5('0xf')]();var _0x4510d4;var _0x572d21;var _0x362351=_0x422fe6[_0x85e5('0x10')]['globalQueueFilter'];var _0x47b40d=_0x422fe6[_0x85e5('0x10')]['globalStatusFilter'];var _0x4f2135=_0x422fe6[_0x85e5('0x10')][_0x85e5('0x11')];var _0x2b7676=_0x47b40d===_0x85e5('0x12')||_0x47b40d===_0x85e5('0x13')?!![]:![];var _0x3981f0=[];var _0x1a2c16;var _0x115663;Promise[_0x85e5('0x14')]()[_0x85e5('0x15')](function(){if(_0x422fe6[_0x85e5('0x10')][_0x85e5('0x16')]){if(!utils[_0x85e5('0x17')](_0x422fe6[_0x85e5('0x10')][_0x85e5('0x16')])){throw new APIBadRequestError(util[_0x85e5('0x18')](_0x85e5('0x19'),_0x422fe6[_0x85e5('0x10')][_0x85e5('0x16')]));}_0x316c84=_0x422fe6[_0x85e5('0x10')][_0x85e5('0x16')][_0x85e5('0x1a')]();}if(!_0x422fe6[_0x85e5('0x10')][_0x85e5('0x1b')]||!_0x422fe6[_0x85e5('0x10')]['sort'][_0x85e5('0x1c')]('globalStatus')){_0x422fe6[_0x85e5('0x10')][_0x85e5('0x1b')]=rta['validateSortParameter'](_0x422fe6[_0x85e5('0x10')][_0x85e5('0x1b')]);return;}var _0x5c7fa6=rta[_0x85e5('0x1d')](_0x422fe6[_0x85e5('0x10')][_0x85e5('0x1b')]);_0x422fe6[_0x85e5('0x10')][_0x85e5('0x1b')]=_0x5c7fa6[_0x85e5('0x1e')][_0x85e5('0x1f')](',');_0x1a2c16=_0x5c7fa6['order'];})[_0x85e5('0x15')](function(){if(!_0x362351){return[];}return rta[_0x85e5('0x20')](_0x362351,_0x316c84);})[_0x85e5('0x15')](function(_0xb3016b){_0x3981f0=_0xb3016b;return rta['getRealtimeAgents']();})[_0x85e5('0x15')](function(_0x57a654){_0x572d21=_0x57a654[_0x85e5('0x21')];if((!_0x47b40d||_0x2b7676)&&!_0x1a2c16){return _0x3981f0;}if(_0x1a2c16&&!_0x47b40d){return rta['getSortedAgentsIdsByStatus'](_0x572d21,_0x3981f0,_0x1a2c16);}else{return rta[_0x85e5('0x22')](_0x572d21,_0x3981f0,_0x47b40d);}})[_0x85e5('0x15')](function(_0x5e78dc){_0x3981f0=_0x5e78dc;var _0x4e3ba5=![];if(_0x3981f0['length']===0x0){if(_0x362351||_0x47b40d){_0x4e3ba5=!![];}if(_0x2b7676){_0x4e3ba5=![];}}if(_0x4e3ba5){return _0x103588;}var _0x388e4a=_[_0x85e5('0x23')](db[_0x85e5('0x24')]['rawAttributes'],function(_0x517f35){return{'name':_0x517f35[_0x85e5('0x25')],'type':_0x517f35['type']['key']};});_0x422fe6[_0x85e5('0x10')][_0x85e5('0x26')]='agent';_0x350fa5=qs['getOptions'](_0x388e4a,_0x422fe6);_0x350fa5[_0x85e5('0x27')]=!![];var _0x428d96=[];if(_0x3981f0[_0x85e5('0x28')]>0x0){_0x428d96[_0x85e5('0x29')]({'id':{'$in':_0x3981f0}});if(_0x1a2c16&&!_0x47b40d){_0x115663=[db['sequelize'][_0x85e5('0x2a')]('FIELD(id,'+_0x3981f0+')')];_0x350fa5[_0x85e5('0x2b')]=_0x115663;}}if(_0x2b7676){_0x97730d['forEach'](function(_0x4dc2dc){var _0x19795b=!![];if(_0x47b40d===_0x85e5('0x13')&&_0x316c84!==_0x4dc2dc){_0x19795b=![];}_0x428d96[_0x85e5('0x29')]({[_0x4dc2dc+_0x85e5('0x2c')]:_0x19795b});});if(_0x4f2135){_0x428d96['push']({'pauseType':_0x4f2135});}}else if(_0x47b40d){_0x97730d[_0x85e5('0x2d')](function(_0x5a0b14){_0x428d96[_0x85e5('0x29')]({[_0x5a0b14+_0x85e5('0x2c')]:![]});});}_0x350fa5[_0x85e5('0x2e')]=_[_0x85e5('0x2f')](_0x350fa5['where'],{'$and':_0x428d96});if(_0x422fe6[_0x85e5('0x30')][_0x85e5('0x26')]===_0x85e5('0x30')){var _0xc9b35={'params':{'id':_0x422fe6[_0x85e5('0x30')]['userProfileId']},'query':{'section':_0x85e5('0x31'),'role':_0x85e5('0x32'),'raw':!![],'ids':_0x3981f0,'customSorting':_0x115663}};if(_0x422fe6['query'][_0x85e5('0x33')]){_0xc9b35[_0x85e5('0x10')][_0x85e5('0x33')]=!![];}if(_0x2b7676){_0xc9b35[_0x85e5('0x10')][_0x85e5('0x34')]=_0x428d96;}_0xc9b35[_0x85e5('0x10')]=Object['assign'](_0xc9b35[_0x85e5('0x10')],_[_0x85e5('0x35')](_0x422fe6[_0x85e5('0x10')],'id'));return db[_0x85e5('0x36')][_0x85e5('0x37')](_0xc9b35);}return db[_0x85e5('0x24')][_0x85e5('0x38')](_0x350fa5);})[_0x85e5('0x15')](function(_0x8e59e5){_0x103588[_0x85e5('0x9')]=_0x8e59e5[_0x85e5('0x9')];_0x4510d4=_0x8e59e5[_0x85e5('0x21')];return _0x4510d4[_0x85e5('0x23')](function(_0xfbff36){var _0x24814f=_['find'](_0x572d21,['id',_0xfbff36['id']]);if(_0x24814f){var _0x3acdd8=rta[_0x85e5('0x39')](_0x24814f);_[_0x85e5('0x2f')](_0xfbff36,_0x3acdd8);}_0xfbff36['globalStatus']=rta['getAgentStatus'](_0xfbff36);if(_0xfbff36[_0x85e5('0x3a')][_0x85e5('0x1c')]('pause')){_0x97730d['forEach'](function(_0x583400){if(_0xfbff36[_0x583400+_0x85e5('0x2c')]){if(_0x583400===_0x85e5('0x3b')){if(_0xfbff36[_0x85e5('0x3c')]!==_0x85e5('0x3d')){_0xfbff36[_0x85e5('0x3c')]=_0x85e5('0x12');}}else{_0xfbff36[_0x583400+_0x85e5('0x3e')]='pause';}}});}return _0xfbff36;});})['then'](function(_0x59f288){if(!_0x1a2c16||_0x115663){return _0x59f288;}return rta[_0x85e5('0x3f')](_0x59f288,_0x1a2c16);})[_0x85e5('0x15')](function(_0x14b30d){var _0x4131aa=rta[_0x85e5('0x40')]();_0x103588[_0x85e5('0x21')]=_0x14b30d[_0x85e5('0x23')](function(_0xf94ebf){return _[_0x85e5('0x41')](_0xf94ebf,_0x4131aa);});return _0x103588;})[_0x85e5('0x15')](respondWithFilteredResult(_0x32a560,_0x350fa5))[_0x85e5('0x42')](APIHandleError(_0x32a560));};exports[_0x85e5('0x43')]=function(_0x5b4788,_0x16fca0){var _0x219d84={'count':0x0,'rows':[]};var _0x4d37ac={};var _0x4f1df3;var _0x5910ab;var _0xeb0e35;Promise[_0x85e5('0x14')]()[_0x85e5('0x15')](function(){if(_0x5b4788[_0x85e5('0x10')]['channel']){if(!utils[_0x85e5('0x17')](_0x5b4788[_0x85e5('0x10')][_0x85e5('0x16')])){throw new APIBadRequestError(util[_0x85e5('0x18')](_0x85e5('0x19'),_0x5b4788[_0x85e5('0x10')][_0x85e5('0x16')]));}_0x4f1df3=_0x5b4788[_0x85e5('0x10')]['channel'][_0x85e5('0x1a')]();}var _0x34484e=_[_0x85e5('0x44')](_0x4f1df3)+_0x85e5('0x45');var _0x2a567f=_[_0x85e5('0x23')](db[_0x34484e][_0x85e5('0x46')],function(_0xcc25e8){return{'name':_0xcc25e8['fieldName'],'type':_0xcc25e8[_0x85e5('0x47')][_0x85e5('0x48')]};});if(!_0x5b4788['query'][_0x85e5('0x1e')]){var _0x4a4669=['id',_0x85e5('0x49')];if(_0x4f1df3===_0x85e5('0x3b')){_0x4a4669[_0x85e5('0x29')](_0x85e5('0x47'));if(_0x5b4788[_0x85e5('0x10')][_0x85e5('0x47')]===_0x85e5('0x4a')){_0x4a4669[_0x85e5('0x29')](['dialActive','dialMethod']);}}_0x5b4788[_0x85e5('0x10')][_0x85e5('0x1e')]=_0x4a4669[_0x85e5('0x1f')](',');}_0x4d37ac=qs[_0x85e5('0x4b')](_0x2a567f,_0x5b4788);if(_0x5b4788[_0x85e5('0x30')]['role']===_0x85e5('0x30')){var _0x120283={'params':{'id':_0x5b4788[_0x85e5('0x30')]['userProfileId']},'query':{'section':_0x4f1df3===_0x85e5('0x3b')&&_0x5b4788[_0x85e5('0x10')][_0x85e5('0x47')]===_0x85e5('0x4a')?_0x85e5('0x4c'):_[_0x85e5('0x44')](_0x4f1df3)+'Queues','type':_0x5b4788['query'][_0x85e5('0x47')],'nolimit':!![],'sort':_0x85e5('0x49'),'filter':_0x5b4788[_0x85e5('0x10')][_0x85e5('0x4d')]}};_0x120283[_0x85e5('0x10')]=Object[_0x85e5('0x4e')](_0x120283[_0x85e5('0x10')],_0x5b4788[_0x85e5('0x10')]);delete _0x120283[_0x85e5('0x10')]['id'];return db[_0x85e5('0x36')][_0x85e5('0x37')](_0x120283);}return db[_0x34484e][_0x85e5('0x38')](_0x4d37ac);})[_0x85e5('0x15')](function(_0x5f5674){_0x219d84[_0x85e5('0x9')]=_0x5f5674[_0x85e5('0x9')];_0x5910ab=_0x5f5674[_0x85e5('0x21')];return rtq[_0x85e5('0x4f')](_0x5b4788,_0x4f1df3);})[_0x85e5('0x15')](function(_0xce485f){_0xeb0e35=_0xce485f[_0x85e5('0x21')];return rtq[_0x85e5('0x50')](_0x5910ab,_0xeb0e35,_0x4f1df3,_0x5b4788[_0x85e5('0x10')][_0x85e5('0x47')]);})['then'](function(_0x190026){_0x219d84['rows']=_0x190026;return _0x219d84;})['then'](respondWithFilteredResult(_0x16fca0,_0x4d37ac))[_0x85e5('0x42')](APIHandleError(_0x16fca0));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f949c18..f3e0fbb 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e668b,_0x35b443){var _0xba75aa=function(_0x2d1e29){while(--_0x2d1e29){_0x4e668b['push'](_0x4e668b['shift']());}};_0xba75aa(++_0x35b443);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x1ddcc9,_0x277532){var _0x55b618=function(_0x5d1b07){while(--_0x5d1b07){_0x1ddcc9['push'](_0x1ddcc9['shift']());}};_0x55b618(++_0x277532);}(_0x70e0,0x17b));var _0x070e=function(_0x5cd0e3,_0x2d99cd){_0x5cd0e3=_0x5cd0e3-0x0;var _0xf9cea4=_0x70e0[_0x5cd0e3];return _0xf9cea4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index affe474..c39d526 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 _0x8f9d=['INTEGER','DATE','STRING','sequelize'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x8f9d,0x93));var _0xd8f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f9d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'state':{'type':Sequelize[_0xd8f9('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd8f9('0x2')]},'uniqueid':{'type':Sequelize[_0xd8f9('0x3')]},'starttime':{'type':Sequelize[_0xd8f9('0x2')]},'responsetime':{'type':Sequelize[_0xd8f9('0x2')]},'ringtime':{'type':Sequelize[_0xd8f9('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd8f9('0x3')]},'campaigntype':{'type':Sequelize[_0xd8f9('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd307=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xd307,0x110));var _0x7d30=function(_0x49493d,_0x344a57){_0x49493d=_0x49493d-0x0;var _0x31c28e=_0xd307[_0x49493d];return _0x31c28e;};'use strict';var Sequelize=require(_0x7d30('0x0'));module[_0x7d30('0x1')]={'state':{'type':Sequelize[_0x7d30('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7d30('0x3')]},'scheduledat':{'type':Sequelize[_0x7d30('0x4')]},'uniqueid':{'type':Sequelize[_0x7d30('0x3')]},'starttime':{'type':Sequelize[_0x7d30('0x4')]},'responsetime':{'type':Sequelize[_0x7d30('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7d30('0x3')]},'campaigntype':{'type':Sequelize[_0x7d30('0x3')]},'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 87de080..9bbfbd2 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 _0x8086=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','../../config/logger','api'];(function(_0x3ca3ff,_0x507255){var _0x3900d3=function(_0x4d9126){while(--_0x4d9126){_0x3ca3ff['push'](_0x3ca3ff['shift']());}};_0x3900d3(++_0x507255);}(_0x8086,0x1ed));var _0x6808=function(_0x4d5a50,_0x5a6947){_0x4d5a50=_0x4d5a50-0x0;var _0x25c9e8=_0x8086[_0x4d5a50];return _0x25c9e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6808('0x0'))(_0x6808('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6808('0x2'));var fs=require('fs');var path=require(_0x6808('0x3'));var rimraf=require(_0x6808('0x4'));var config=require(_0x6808('0x5'));var attributes=require(_0x6808('0x6'));module[_0x6808('0x7')]=function(_0x2794b9,_0x4f06c4){return _0x2794b9[_0x6808('0x8')](_0x6808('0x9'),attributes,{'tableName':_0x6808('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e52=['bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','../../config/logger','api'];(function(_0x4fb808,_0xee34b5){var _0x2dec98=function(_0x30626e){while(--_0x30626e){_0x4fb808['push'](_0x4fb808['shift']());}};_0x2dec98(++_0xee34b5);}(_0x9e52,0x165));var _0x29e5=function(_0x2394ad,_0x7dabc6){_0x2394ad=_0x2394ad-0x0;var _0x138983=_0x9e52[_0x2394ad];return _0x138983;};'use strict';var _=require(_0x29e5('0x0'));var util=require('util');var logger=require(_0x29e5('0x1'))(_0x29e5('0x2'));var moment=require('moment');var BPromise=require(_0x29e5('0x3'));var rp=require(_0x29e5('0x4'));var fs=require('fs');var path=require(_0x29e5('0x5'));var rimraf=require(_0x29e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x29e5('0x7'));module[_0x29e5('0x8')]=function(_0x23e01c,_0x14d937){return _0x23e01c['define'](_0x29e5('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index e565b15..308a924 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 _0x7ed2=['http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x7ed2,0x1ed));var _0x27ed=function(_0x30f63d,_0xf0902b){_0x30f63d=_0x30f63d-0x0;var _0x4f59f4=_0x7ed2[_0x30f63d];return _0x4f59f4;};'use strict';var _=require(_0x27ed('0x0'));var util=require(_0x27ed('0x1'));var moment=require('moment');var BPromise=require(_0x27ed('0x2'));var rs=require(_0x27ed('0x3'));var fs=require('fs');var Redis=require(_0x27ed('0x4'));var db=require(_0x27ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x27ed('0x6'))(_0x27ed('0x7'));var config=require(_0x27ed('0x8'));var jayson=require(_0x27ed('0x9'));var client=jayson[_0x27ed('0xa')][_0x27ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32fb45,_0x3a03e2,_0x41e603){return new BPromise(function(_0x220dcb,_0x125187){return client['request'](_0x32fb45,_0x41e603)[_0x27ed('0xc')](function(_0x15ecb9){logger[_0x27ed('0xd')](_0x27ed('0xe'),_0x3a03e2,_0x27ed('0xf'));logger[_0x27ed('0x10')](_0x27ed('0x11'),_0x3a03e2,_0x27ed('0xf'),JSON[_0x27ed('0x12')](_0x15ecb9));if(_0x15ecb9[_0x27ed('0x13')]){if(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x14')]===0x1f4){logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);return _0x125187(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);}logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x15ecb9[_0x27ed('0x13')]['message']);return _0x220dcb(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);}else{logger[_0x27ed('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3a03e2,_0x27ed('0xf'));_0x220dcb(_0x15ecb9['result']['message']);}})[_0x27ed('0x16')](function(_0x4cdb7b){logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x4cdb7b);_0x125187(_0x4cdb7b);});});}exports[_0x27ed('0x17')]=function(_0x3ab3b6){var _0x2629f8=this;return new Promise(function(_0x23a830,_0x15bfe9){return db[_0x27ed('0x18')]['create'](_0x3ab3b6[_0x27ed('0x19')],{'raw':_0x3ab3b6[_0x27ed('0x1a')]?_0x3ab3b6[_0x27ed('0x1a')][_0x27ed('0x1b')]===undefined?!![]:![]:!![]})[_0x27ed('0xc')](function(_0x3cabfe){logger[_0x27ed('0xd')]('CreateReportAgentPreview',_0x3ab3b6);logger[_0x27ed('0x10')](_0x27ed('0x17'),_0x3ab3b6,JSON['stringify'](_0x3cabfe));_0x23a830(_0x3cabfe);})[_0x27ed('0x16')](function(_0x1a2ee9){logger[_0x27ed('0x13')](_0x27ed('0x17'),_0x1a2ee9['message'],_0x3ab3b6);_0x15bfe9(_0x2629f8['error'](0x1f4,_0x1a2ee9[_0x27ed('0x15')]));});});}; \ No newline at end of file +var _0x3368=['stringify','lodash','moment','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','raw','CreateReportAgentPreview'];(function(_0x57a670,_0x30e402){var _0x41ce21=function(_0x11bd34){while(--_0x11bd34){_0x57a670['push'](_0x57a670['shift']());}};_0x41ce21(++_0x30e402);}(_0x3368,0x19f));var _0x8336=function(_0x4e5f6f,_0x462fbb){_0x4e5f6f=_0x4e5f6f-0x0;var _0x5b489b=_0x3368[_0x4e5f6f];return _0x5b489b;};'use strict';var _=require(_0x8336('0x0'));var util=require('util');var moment=require(_0x8336('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8336('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8336('0x3'))('rpc');var config=require(_0x8336('0x4'));var jayson=require(_0x8336('0x5'));var client=jayson['client'][_0x8336('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x478322,_0x5d5aec,_0x5a4133){return new BPromise(function(_0x40f371,_0x590d2f){return client[_0x8336('0x7')](_0x478322,_0x5a4133)[_0x8336('0x8')](function(_0x102e26){logger[_0x8336('0x9')](_0x8336('0xa'),_0x5d5aec,_0x8336('0xb'));logger[_0x8336('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x5d5aec,_0x8336('0xb'),JSON['stringify'](_0x102e26));if(_0x102e26['error']){if(_0x102e26[_0x8336('0xd')][_0x8336('0xe')]===0x1f4){logger['error'](_0x8336('0xa'),_0x5d5aec,_0x102e26['error'][_0x8336('0xf')]);return _0x590d2f(_0x102e26[_0x8336('0xd')][_0x8336('0xf')]);}logger[_0x8336('0xd')](_0x8336('0xa'),_0x5d5aec,_0x102e26[_0x8336('0xd')][_0x8336('0xf')]);return _0x40f371(_0x102e26[_0x8336('0xd')][_0x8336('0xf')]);}else{logger[_0x8336('0x9')](_0x8336('0xa'),_0x5d5aec,_0x8336('0xb'));_0x40f371(_0x102e26[_0x8336('0x10')][_0x8336('0xf')]);}})[_0x8336('0x11')](function(_0x12f3cc){logger[_0x8336('0xd')](_0x8336('0xa'),_0x5d5aec,_0x12f3cc);_0x590d2f(_0x12f3cc);});});}exports['CreateReportAgentPreview']=function(_0x5c1735){var _0x54fcd4=this;return new Promise(function(_0x47af12,_0x5b7838){return db['ReportAgentPreview'][_0x8336('0x12')](_0x5c1735[_0x8336('0x13')],{'raw':_0x5c1735['options']?_0x5c1735['options'][_0x8336('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x386a16){logger[_0x8336('0x9')](_0x8336('0x15'),_0x5c1735);logger[_0x8336('0xc')]('CreateReportAgentPreview',_0x5c1735,JSON[_0x8336('0x16')](_0x386a16));_0x47af12(_0x386a16);})[_0x8336('0x11')](function(_0x4378d3){logger[_0x8336('0xd')](_0x8336('0x15'),_0x4378d3[_0x8336('0xf')],_0x5c1735);_0x5b7838(_0x54fcd4[_0x8336('0xd')](0x1f4,_0x4378d3['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a4c1224..3bf75cc 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 _0xaf95=['/fax/queues/:id/notify','fax','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','telephones','/trunks','trunks','/campaigns','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues'];(function(_0x93cad8,_0x1f4bf6){var _0xb088df=function(_0x27c6fa){while(--_0x27c6fa){_0x93cad8['push'](_0x93cad8['shift']());}};_0xb088df(++_0x1f4bf6);}(_0xaf95,0xa5));var _0x5af9=function(_0x4dbe5c,_0x36ed26){_0x4dbe5c=_0x4dbe5c-0x0;var _0x57bd05=_0xaf95[_0x4dbe5c];return _0x57bd05;};'use strict';var multer=require(_0x5af9('0x0'));var util=require(_0x5af9('0x1'));var path=require(_0x5af9('0x2'));var express=require(_0x5af9('0x3'));var router=express[_0x5af9('0x4')]();var auth=require(_0x5af9('0x5'));var controller=require(_0x5af9('0x6'));router[_0x5af9('0x7')](_0x5af9('0x8'),auth[_0x5af9('0x9')](),controller['voiceChannels']);router[_0x5af9('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x5af9('0xa')]);router[_0x5af9('0x7')](_0x5af9('0xb'),auth[_0x5af9('0x9')](),controller[_0x5af9('0xc')]);router[_0x5af9('0x7')](_0x5af9('0xd'),auth[_0x5af9('0x9')](),controller['voiceQueues']);router[_0x5af9('0x7')](_0x5af9('0xe'),auth['isAuthenticated'](),controller[_0x5af9('0xf')]);router[_0x5af9('0x7')](_0x5af9('0x10'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x11')]);router[_0x5af9('0x7')]('/mail/accounts',auth[_0x5af9('0x9')](),controller[_0x5af9('0x12')]);router[_0x5af9('0x7')]('/openchannel/queues',auth[_0x5af9('0x9')](),controller[_0x5af9('0x13')]);router[_0x5af9('0x7')](_0x5af9('0x14'),auth['isAuthenticated'](),controller[_0x5af9('0x15')]);router[_0x5af9('0x7')]('/whatsapp/queues',auth[_0x5af9('0x9')](),controller[_0x5af9('0x16')]);router[_0x5af9('0x7')](_0x5af9('0x17'),auth['isAuthenticated'](),controller['faxQueues']);router['get'](_0x5af9('0x18'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x19')]);router[_0x5af9('0x7')](_0x5af9('0x1a'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x1b')]);router[_0x5af9('0x7')](_0x5af9('0x1c'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x1d')]);router[_0x5af9('0x7')](_0x5af9('0x1e'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x1f')]);router[_0x5af9('0x7')](_0x5af9('0x20'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x21')]);router[_0x5af9('0x7')](_0x5af9('0x22'),auth['isAuthenticated'](),controller[_0x5af9('0x23')]);router['put'](_0x5af9('0x22'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x24')]);router[_0x5af9('0x7')](_0x5af9('0x25'),auth[_0x5af9('0x9')](),controller['outbound']);router[_0x5af9('0x7')](_0x5af9('0x26'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x27')]);router[_0x5af9('0x7')](_0x5af9('0x28'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x29')]);router['put']('/agents/:id/capacity',auth[_0x5af9('0x9')](),controller['agentCapacity']);router[_0x5af9('0x7')]('/telephones',auth['isAuthenticated'](),controller[_0x5af9('0x2a')]);router[_0x5af9('0x7')](_0x5af9('0x2b'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x2c')]);router['get'](_0x5af9('0x2d'),auth[_0x5af9('0x9')](),controller['campaigns']);router[_0x5af9('0x7')]('/fax/accounts',auth[_0x5af9('0x9')](),controller['faxAccounts']);router[_0x5af9('0x7')](_0x5af9('0x2e'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router['get'](_0x5af9('0x2f'),auth[_0x5af9('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0x5af9('0x7')](_0x5af9('0x30'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x31')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x5af9('0x9')](),controller[_0x5af9('0x32')]);router[_0x5af9('0x7')](_0x5af9('0x33'),auth[_0x5af9('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x5af9('0x7')](_0x5af9('0x34'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x35')]);router[_0x5af9('0x7')]('/fax/queues/waitinginteractions',auth[_0x5af9('0x9')](),controller[_0x5af9('0x36')]);router[_0x5af9('0x37')](_0x5af9('0x38'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x39')](_0x5af9('0x3a')));router[_0x5af9('0x7')]('/mail/queues/:id',auth[_0x5af9('0x9')](),controller[_0x5af9('0x3b')]);router[_0x5af9('0x37')](_0x5af9('0x3c'),auth['isAuthenticated'](),controller['queueNotify']('chat'));router['get'](_0x5af9('0x3d'),auth['isAuthenticated'](),controller[_0x5af9('0x3e')]);router[_0x5af9('0x37')](_0x5af9('0x3f'),auth[_0x5af9('0x9')](),controller['queueNotify'](_0x5af9('0x40')));router['get']('/fax/queues/:id',auth[_0x5af9('0x9')](),controller['showFaxQueues']);router[_0x5af9('0x37')]('/openchannel/queues/:id/notify',auth[_0x5af9('0x9')](),controller['queueNotify'](_0x5af9('0x41')));router[_0x5af9('0x7')]('/openchannel/queues/:id',auth[_0x5af9('0x9')](),controller[_0x5af9('0x42')]);router['post'](_0x5af9('0x43'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x39')](_0x5af9('0x44')));router[_0x5af9('0x37')](_0x5af9('0x45'),auth[_0x5af9('0x9')](),controller['queueNotify'](_0x5af9('0x46')));router[_0x5af9('0x7')]('/sms/queues/:id',auth[_0x5af9('0x9')](),controller[_0x5af9('0x47')]);router[_0x5af9('0x7')](_0x5af9('0x48'),auth[_0x5af9('0x9')](),controller[_0x5af9('0x49')]);router['post']('/agents/:id/notify',auth[_0x5af9('0x9')](),controller[_0x5af9('0x4a')]);module[_0x5af9('0x4b')]=router; \ No newline at end of file +var _0xdace=['/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdace,0xad));var _0xedac=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0xdace[_0x5192de];return _0x4e287e;};'use strict';var multer=require(_0xedac('0x0'));var util=require(_0xedac('0x1'));var path=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express[_0xedac('0x4')]();var auth=require(_0xedac('0x5'));var controller=require(_0xedac('0x6'));router[_0xedac('0x7')](_0xedac('0x8'),auth[_0xedac('0x9')](),controller[_0xedac('0xa')]);router[_0xedac('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xedac('0x9')](),controller[_0xedac('0xb')]);router[_0xedac('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xedac('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0xedac('0x7')]('/voice/queues',auth[_0xedac('0x9')](),controller[_0xedac('0xc')]);router['get'](_0xedac('0xd'),auth['isAuthenticated'](),controller[_0xedac('0xe')]);router[_0xedac('0x7')](_0xedac('0xf'),auth['isAuthenticated'](),controller[_0xedac('0x10')]);router[_0xedac('0x7')](_0xedac('0x11'),auth[_0xedac('0x9')](),controller[_0xedac('0x12')]);router[_0xedac('0x7')](_0xedac('0x13'),auth[_0xedac('0x9')](),controller[_0xedac('0x14')]);router['get'](_0xedac('0x15'),auth[_0xedac('0x9')](),controller[_0xedac('0x16')]);router['get'](_0xedac('0x17'),auth[_0xedac('0x9')](),controller['whatsappQueues']);router[_0xedac('0x7')](_0xedac('0x18'),auth[_0xedac('0x9')](),controller[_0xedac('0x19')]);router[_0xedac('0x7')](_0xedac('0x1a'),auth['isAuthenticated'](),controller[_0xedac('0x1b')]);router[_0xedac('0x7')](_0xedac('0x1c'),auth[_0xedac('0x9')](),controller[_0xedac('0x1d')]);router[_0xedac('0x7')]('/voice/queues/channels/:uniqueid',auth[_0xedac('0x9')](),controller[_0xedac('0x1e')]);router[_0xedac('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0xedac('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xedac('0x9')](),controller[_0xedac('0x20')]);router[_0xedac('0x7')](_0xedac('0x21'),auth[_0xedac('0x9')](),controller[_0xedac('0x22')]);router[_0xedac('0x23')]('/voice/queues/:id',auth[_0xedac('0x9')](),controller[_0xedac('0x24')]);router[_0xedac('0x7')]('/outbound',auth[_0xedac('0x9')](),controller['outbound']);router[_0xedac('0x7')](_0xedac('0x25'),auth[_0xedac('0x9')](),controller[_0xedac('0x26')]);router[_0xedac('0x7')](_0xedac('0x27'),auth['isAuthenticated'](),controller[_0xedac('0x28')]);router[_0xedac('0x23')](_0xedac('0x29'),auth[_0xedac('0x9')](),controller[_0xedac('0x2a')]);router['get'](_0xedac('0x2b'),auth[_0xedac('0x9')](),controller[_0xedac('0x2c')]);router[_0xedac('0x7')](_0xedac('0x2d'),auth[_0xedac('0x9')](),controller[_0xedac('0x2e')]);router[_0xedac('0x7')]('/campaigns',auth[_0xedac('0x9')](),controller['campaigns']);router[_0xedac('0x7')](_0xedac('0x2f'),auth[_0xedac('0x9')](),controller['faxAccounts']);router[_0xedac('0x7')](_0xedac('0x30'),auth[_0xedac('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xedac('0x7')](_0xedac('0x31'),auth[_0xedac('0x9')](),controller[_0xedac('0x32')]);router[_0xedac('0x7')](_0xedac('0x33'),auth[_0xedac('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0xedac('0x7')](_0xedac('0x34'),auth[_0xedac('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0xedac('0x35'),auth[_0xedac('0x9')](),controller[_0xedac('0x36')]);router[_0xedac('0x7')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xedac('0x37')]);router[_0xedac('0x7')](_0xedac('0x38'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xedac('0x39')](_0xedac('0x3a'),auth['isAuthenticated'](),controller[_0xedac('0x3b')](_0xedac('0x3c')));router['get'](_0xedac('0x3d'),auth[_0xedac('0x9')](),controller[_0xedac('0x3e')]);router['post'](_0xedac('0x3f'),auth[_0xedac('0x9')](),controller[_0xedac('0x3b')](_0xedac('0x40')));router[_0xedac('0x7')](_0xedac('0x41'),auth[_0xedac('0x9')](),controller['showChatQueues']);router[_0xedac('0x39')](_0xedac('0x42'),auth[_0xedac('0x9')](),controller['queueNotify']('fax'));router['get'](_0xedac('0x43'),auth['isAuthenticated'](),controller[_0xedac('0x44')]);router[_0xedac('0x39')]('/openchannel/queues/:id/notify',auth[_0xedac('0x9')](),controller['queueNotify'](_0xedac('0x45')));router[_0xedac('0x7')](_0xedac('0x46'),auth[_0xedac('0x9')](),controller[_0xedac('0x47')]);router['post'](_0xedac('0x48'),auth['isAuthenticated'](),controller[_0xedac('0x3b')](_0xedac('0x49')));router['post'](_0xedac('0x4a'),auth[_0xedac('0x9')](),controller[_0xedac('0x3b')](_0xedac('0x4b')));router[_0xedac('0x7')]('/sms/queues/:id',auth[_0xedac('0x9')](),controller[_0xedac('0x4c')]);router[_0xedac('0x7')](_0xedac('0x4d'),auth[_0xedac('0x9')](),controller[_0xedac('0x4e')]);router[_0xedac('0x39')]('/agents/:id/notify',auth[_0xedac('0x9')](),controller[_0xedac('0x4f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c3e8086..8e2d7ad 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 _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x37e5ed,_0xbe5cea){var _0x5e32ce=function(_0x37e4b2){while(--_0x37e4b2){_0x37e5ed['push'](_0x37e5ed['shift']());}};_0x5e32ce(++_0xbe5cea);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x434316,_0x1853f6){var _0xbdb9a9=function(_0x336d4b){while(--_0x336d4b){_0x434316['push'](_0x434316['shift']());}};_0xbdb9a9(++_0x1853f6);}(_0xe706,0xa3));var _0x6e70=function(_0x48d218,_0x38ae7b){_0x48d218=_0x48d218-0x0;var _0x5d86c7=_0xe706[_0x48d218];return _0x5d86c7;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d8c4b18..bdcbd81 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 _0xe045=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0xe045,0x1b5));var _0x5e04=function(_0x2a87a6,_0x4cbf22){_0x2a87a6=_0x2a87a6-0x0;var _0x410e88=_0xe045[_0x2a87a6];return _0x410e88;};'use strict';var multer=require(_0x5e04('0x0'));var util=require(_0x5e04('0x1'));var path=require(_0x5e04('0x2'));var timeout=require(_0x5e04('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e04('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e04('0x5'));var config=require(_0x5e04('0x6'));var controller=require(_0x5e04('0x7'));router['get']('/',auth[_0x5e04('0x8')](),controller[_0x5e04('0x9')]);router[_0x5e04('0xa')](_0x5e04('0xb'),auth[_0x5e04('0x8')](),controller[_0x5e04('0xc')]);router[_0x5e04('0xa')](_0x5e04('0xd'),auth[_0x5e04('0x8')](),controller[_0x5e04('0xe')]);router[_0x5e04('0xf')]('/',auth['isAuthenticated'](),controller[_0x5e04('0x10')]);router[_0x5e04('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5e04('0x12')]);router[_0x5e04('0x13')](_0x5e04('0xb'),auth['isAuthenticated'](),controller[_0x5e04('0x14')]);module[_0x5e04('0x15')]=router; \ No newline at end of file +var _0xb68d=['show','/:id/run','post','create','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xb68d,0x198));var _0xdb68=function(_0x3cbe27,_0x228fdb){_0x3cbe27=_0x3cbe27-0x0;var _0x567bbd=_0xb68d[_0x3cbe27];return _0x567bbd;};'use strict';var multer=require(_0xdb68('0x0'));var util=require(_0xdb68('0x1'));var path=require(_0xdb68('0x2'));var timeout=require(_0xdb68('0x3'));var express=require(_0xdb68('0x4'));var router=express[_0xdb68('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdb68('0x6'));var interaction=require(_0xdb68('0x7'));var config=require(_0xdb68('0x8'));var controller=require(_0xdb68('0x9'));router[_0xdb68('0xa')]('/',auth[_0xdb68('0xb')](),controller['index']);router[_0xdb68('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdb68('0xc')]);router[_0xdb68('0xa')](_0xdb68('0xd'),auth[_0xdb68('0xb')](),controller['run']);router[_0xdb68('0xe')]('/',auth[_0xdb68('0xb')](),controller[_0xdb68('0xf')]);router[_0xdb68('0x10')]('/:id',auth[_0xdb68('0xb')](),controller[_0xdb68('0x11')]);router[_0xdb68('0x12')](_0xdb68('0x13'),auth[_0xdb68('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 03150e7..15c934c 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 _0xb5e8=['custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','months','minutes','days','pdf','xlsx','csv'];(function(_0x1fc095,_0x4bf16e){var _0x285a62=function(_0x15e789){while(--_0x15e789){_0x1fc095['push'](_0x1fc095['shift']());}};_0x285a62(++_0x4bf16e);}(_0xb5e8,0x1f0));var _0x8b5e=function(_0x9f3f96,_0x638252){_0x9f3f96=_0x9f3f96-0x0;var _0x118a71=_0xb5e8[_0x9f3f96];return _0x118a71;};'use strict';var Sequelize=require(_0x8b5e('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b5e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8b5e('0x1')]},'active':{'type':Sequelize[_0x8b5e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8b5e('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8b5e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8b5e('0x5')](_0x8b5e('0x6'),_0x8b5e('0x7'),_0x8b5e('0x8'),'weeks','days','hours',_0x8b5e('0x9')),'allowNull':![],'defaultValue':_0x8b5e('0xa')},'output':{'type':Sequelize['ENUM']('csv',_0x8b5e('0xb'),_0x8b5e('0xc')),'allowNull':![],'defaultValue':_0x8b5e('0xd')},'type':{'type':Sequelize['ENUM'](_0x8b5e('0xe'),_0x8b5e('0xf')),'allowNull':![],'defaultValue':_0x8b5e('0xe')},'sendMail':{'type':Sequelize[_0x8b5e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x8b5e('0x1')]},'cc':{'type':Sequelize[_0x8b5e('0x10')]},'bcc':{'type':Sequelize[_0x8b5e('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfbf0=['days','hours','minutes','ENUM','csv','xlsx','custom','default','TEXT','BOOLEAN','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks'];(function(_0x334676,_0x821ff4){var _0x58a7ab=function(_0x3b7087){while(--_0x3b7087){_0x334676['push'](_0x334676['shift']());}};_0x58a7ab(++_0x821ff4);}(_0xfbf0,0xe2));var _0x0fbf=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xfbf0[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require('sequelize');module[_0x0fbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0fbf('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0fbf('0x1')],'allowNull':![],'defaultValue':_0x0fbf('0x2')},'startAt':{'type':Sequelize[_0x0fbf('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0fbf('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0fbf('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x0fbf('0x5'),'quarters',_0x0fbf('0x6'),_0x0fbf('0x7'),_0x0fbf('0x8'),_0x0fbf('0x9'),_0x0fbf('0xa')),'allowNull':![],'defaultValue':_0x0fbf('0x8')},'output':{'type':Sequelize[_0x0fbf('0xb')](_0x0fbf('0xc'),'pdf',_0x0fbf('0xd')),'allowNull':![],'defaultValue':_0x0fbf('0xc')},'type':{'type':Sequelize['ENUM'](_0x0fbf('0xe'),_0x0fbf('0xf')),'allowNull':![],'defaultValue':_0x0fbf('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x0fbf('0x1')]},'cc':{'type':Sequelize[_0x0fbf('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x0fbf('0x11')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d4bc0b2..7d0a0a7 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 _0x46ed=['find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','rimraf','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Schedule','rawAttributes','fieldName','type','keys','filters','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','intersection'];(function(_0xd84328,_0xfc9b7c){var _0xd98bdc=function(_0xfabba1){while(--_0xfabba1){_0xd84328['push'](_0xd84328['shift']());}};_0xd98bdc(++_0xfc9b7c);}(_0x46ed,0x104));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd46e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var Mustache=require(_0xd46e('0x3'));var util=require(_0xd46e('0x4'));var path=require('path');var sox=require(_0xd46e('0x5'));var csv=require('to-csv');var ejs=require(_0xd46e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd46e('0x7'));var squel=require(_0xd46e('0x8'));var crypto=require(_0xd46e('0x9'));var jsforce=require(_0xd46e('0xa'));var deskjs=require(_0xd46e('0xb'));var toCsv=require(_0xd46e('0xc'));var querystring=require(_0xd46e('0xd'));var Papa=require(_0xd46e('0xe'));var Redis=require(_0xd46e('0xf'));var authService=require(_0xd46e('0x10'));var qs=require(_0xd46e('0x11'));var as=require(_0xd46e('0x12'));var hardwareService=require(_0xd46e('0x13'));var logger=require(_0xd46e('0x14'))(_0xd46e('0x15'));var utils=require(_0xd46e('0x16'));var config=require(_0xd46e('0x17'));var licenseUtil=require(_0xd46e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9055,_0x1292f1){_0x1292f1=_0x1292f1||0xcc;return function(_0x4d3af9){if(_0x4d3af9){return _0x4b9055[_0xd46e('0x19')](_0x1292f1);}return _0x4b9055[_0xd46e('0x1a')](_0x1292f1)[_0xd46e('0x1b')]();};}function respondWithResult(_0x551283,_0x2ed802){_0x2ed802=_0x2ed802||0xc8;return function(_0x537c7b){if(_0x537c7b){return _0x551283[_0xd46e('0x1a')](_0x2ed802)[_0xd46e('0x1c')](_0x537c7b);}};}function respondWithFilteredResult(_0x25e214,_0x51fd34){return function(_0x145afb){if(_0x145afb){var _0x2ff17e=typeof _0x51fd34[_0xd46e('0x1d')]==='undefined'&&typeof _0x51fd34[_0xd46e('0x1e')]===_0xd46e('0x1f');var _0x297af5=_0x145afb['count'];var _0x29243a=_0x2ff17e?0x0:_0x51fd34[_0xd46e('0x1d')];var _0x44ce16=_0x2ff17e?_0x145afb['count']:_0x51fd34[_0xd46e('0x1d')]+_0x51fd34[_0xd46e('0x1e')];var _0x4625fb;if(_0x44ce16>=_0x297af5){_0x44ce16=_0x297af5;_0x4625fb=0xc8;}else{_0x4625fb=0xce;}_0x25e214[_0xd46e('0x1a')](_0x4625fb);return _0x25e214[_0xd46e('0x20')]('Content-Range',_0x29243a+'-'+_0x44ce16+'/'+_0x297af5)[_0xd46e('0x1c')](_0x145afb);}return null;};}function patchUpdates(_0x2841d1){return function(_0xb41c00){try{jsonpatch['apply'](_0xb41c00,_0x2841d1,!![]);}catch(_0x184ae8){return BPromise['reject'](_0x184ae8);}return _0xb41c00[_0xd46e('0x21')]();};}function saveUpdates(_0x176426,_0x26f422){return function(_0x5a4629){if(_0x5a4629){return _0x5a4629[_0xd46e('0x22')](_0x176426)[_0xd46e('0x23')](function(_0x3c386a){return _0x3c386a;});}return null;};}function removeEntity(_0x467071,_0x4b9eff){return function(_0x50c789){if(_0x50c789){return _0x50c789[_0xd46e('0x24')]()[_0xd46e('0x23')](function(){var _0x1a0717=_0x50c789[_0xd46e('0x25')]({'plain':!![]});var _0xb3d617='Scheduler';return db[_0xd46e('0x26')]['destroy']({'where':{'type':_0xb3d617,'resourceId':_0x1a0717['id']}})['then'](function(){return _0x50c789;});})[_0xd46e('0x23')](function(){_0x467071[_0xd46e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0acb,_0x2fd587){return function(_0x11cab3){if(!_0x11cab3){_0x2e0acb[_0xd46e('0x19')](0x194);}return _0x11cab3;};}function handleError(_0x13a5ca,_0x5df4db){_0x5df4db=_0x5df4db||0x1f4;return function(_0x3ed659){logger[_0xd46e('0x27')](_0x3ed659['stack']);if(_0x3ed659[_0xd46e('0x28')]){delete _0x3ed659['name'];}_0x13a5ca['status'](_0x5df4db)[_0xd46e('0x29')](_0x3ed659);};}exports[_0xd46e('0x2a')]=function(_0x5d3468,_0x1543e2){var _0x21196a={},_0x5711b7={},_0x16491b={'count':0x0,'rows':[]};var _0x122e75=_[_0xd46e('0x2b')](db[_0xd46e('0x2c')][_0xd46e('0x2d')],function(_0x4e7e8b){return{'name':_0x4e7e8b[_0xd46e('0x2e')],'type':_0x4e7e8b[_0xd46e('0x2f')]['key']};});_0x5711b7['model']=_[_0xd46e('0x2b')](_0x122e75,'name');_0x5711b7['query']=_[_0xd46e('0x30')](_0x5d3468['query']);_0x5711b7[_0xd46e('0x31')]=_['intersection'](_0x5711b7[_0xd46e('0x32')],_0x5711b7[_0xd46e('0x33')]);_0x21196a[_0xd46e('0x34')]=_['intersection'](_0x5711b7[_0xd46e('0x32')],qs[_0xd46e('0x35')](_0x5d3468['query'][_0xd46e('0x35')]));_0x21196a['attributes']=_0x21196a[_0xd46e('0x34')][_0xd46e('0x36')]?_0x21196a[_0xd46e('0x34')]:_0x5711b7[_0xd46e('0x32')];if(!_0x5d3468[_0xd46e('0x33')][_0xd46e('0x37')]('nolimit')){_0x21196a[_0xd46e('0x1e')]=qs[_0xd46e('0x1e')](_0x5d3468['query'][_0xd46e('0x1e')]);_0x21196a[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x5d3468[_0xd46e('0x33')][_0xd46e('0x1d')]);}_0x21196a[_0xd46e('0x38')]=qs[_0xd46e('0x39')](_0x5d3468[_0xd46e('0x33')][_0xd46e('0x39')]);_0x21196a[_0xd46e('0x3a')]=qs[_0xd46e('0x31')](_[_0xd46e('0x3b')](_0x5d3468[_0xd46e('0x33')],_0x5711b7[_0xd46e('0x31')]),_0x122e75);if(_0x5d3468[_0xd46e('0x33')][_0xd46e('0x3c')]){_0x21196a[_0xd46e('0x3a')]=_[_0xd46e('0x3d')](_0x21196a[_0xd46e('0x3a')],{'$or':_[_0xd46e('0x2b')](_0x122e75,function(_0x4d29ee){if(_0x4d29ee[_0xd46e('0x2f')]!==_0xd46e('0x3e')){var _0x52ffb1={};_0x52ffb1[_0x4d29ee['name']]={'$like':'%'+_0x5d3468[_0xd46e('0x33')]['filter']+'%'};return _0x52ffb1;}})});}_0x21196a=_[_0xd46e('0x3d')]({},_0x21196a,_0x5d3468[_0xd46e('0x3f')]);var _0x261fdf={'where':_0x21196a['where']};return db['Schedule'][_0xd46e('0x40')](_0x261fdf)[_0xd46e('0x23')](function(_0x4dc447){_0x16491b['count']=_0x4dc447;if(_0x5d3468[_0xd46e('0x33')][_0xd46e('0x41')]){_0x21196a[_0xd46e('0x42')]=[{'all':!![]}];}return db['Schedule'][_0xd46e('0x43')](_0x21196a);})[_0xd46e('0x23')](function(_0x7b722c){_0x16491b[_0xd46e('0x44')]=_0x7b722c;return _0x16491b;})[_0xd46e('0x23')](respondWithFilteredResult(_0x1543e2,_0x21196a))['catch'](handleError(_0x1543e2,null));};exports[_0xd46e('0x45')]=function(_0x43a7ca,_0x3d0ffc){var _0xd36cc2={'raw':![],'where':{'id':_0x43a7ca[_0xd46e('0x46')]['id']}},_0x597daf={};_0x597daf['model']=_[_0xd46e('0x30')](db[_0xd46e('0x2c')]['rawAttributes']);_0x597daf['query']=_[_0xd46e('0x30')](_0x43a7ca[_0xd46e('0x33')]);_0x597daf['filters']=_[_0xd46e('0x47')](_0x597daf[_0xd46e('0x32')],_0x597daf[_0xd46e('0x33')]);_0xd36cc2[_0xd46e('0x34')]=_[_0xd46e('0x47')](_0x597daf[_0xd46e('0x32')],qs[_0xd46e('0x35')](_0x43a7ca[_0xd46e('0x33')][_0xd46e('0x35')]));_0xd36cc2['attributes']=_0xd36cc2[_0xd46e('0x34')]['length']?_0xd36cc2[_0xd46e('0x34')]:_0x597daf[_0xd46e('0x32')];if(_0x43a7ca['query']['includeAll']){_0xd36cc2['include']=[{'all':!![]}];}_0xd36cc2=_[_0xd46e('0x3d')]({},_0xd36cc2,_0x43a7ca[_0xd46e('0x3f')]);return db[_0xd46e('0x2c')][_0xd46e('0x48')](_0xd36cc2)[_0xd46e('0x23')](handleEntityNotFound(_0x3d0ffc,null))[_0xd46e('0x23')](respondWithResult(_0x3d0ffc,null))[_0xd46e('0x49')](handleError(_0x3d0ffc,null));};exports[_0xd46e('0x4a')]=function(_0x2d9722,_0x48701c){return db[_0xd46e('0x2c')][_0xd46e('0x4a')](_0x2d9722['body'],{})[_0xd46e('0x23')](function(_0x256dd1){var _0x84018a=_0x2d9722[_0xd46e('0x4b')][_0xd46e('0x25')]({'plain':!![]});if(!_0x84018a)throw new Error(_0xd46e('0x4c'));if(_0x84018a[_0xd46e('0x4d')]===_0xd46e('0x4b')){var _0x134489=_0x256dd1[_0xd46e('0x25')]({'plain':!![]});var _0x3fab6d=_0xd46e('0x4e');return db[_0xd46e('0x4f')]['find']({'where':{'name':_0x3fab6d,'userProfileId':_0x84018a['userProfileId']},'raw':!![]})[_0xd46e('0x23')](function(_0xce4b63){if(_0xce4b63&&_0xce4b63['autoAssociation']===0x0){return db[_0xd46e('0x26')]['create']({'name':_0x134489[_0xd46e('0x28')],'resourceId':_0x134489['id'],'type':_0xce4b63[_0xd46e('0x28')],'sectionId':_0xce4b63['id']},{})[_0xd46e('0x23')](function(){return _0x256dd1;});}else{return _0x256dd1;}})[_0xd46e('0x49')](function(_0x57364d){logger['error'](_0xd46e('0x50'),_0x57364d);throw _0x57364d;});}return _0x256dd1;})['then'](respondWithResult(_0x48701c,0xc9))[_0xd46e('0x49')](handleError(_0x48701c,null));};exports['update']=function(_0x5c4969,_0x1889e4){if(_0x5c4969[_0xd46e('0x51')]['id']){delete _0x5c4969[_0xd46e('0x51')]['id'];}return db[_0xd46e('0x2c')][_0xd46e('0x48')]({'where':{'id':_0x5c4969[_0xd46e('0x46')]['id']}})[_0xd46e('0x23')](handleEntityNotFound(_0x1889e4,null))['then'](saveUpdates(_0x5c4969[_0xd46e('0x51')],null))[_0xd46e('0x23')](respondWithResult(_0x1889e4,null))[_0xd46e('0x49')](handleError(_0x1889e4,null));};exports['destroy']=function(_0x1c079c,_0x1570b8){return db[_0xd46e('0x2c')][_0xd46e('0x48')]({'where':{'id':_0x1c079c[_0xd46e('0x46')]['id']}})[_0xd46e('0x23')](handleEntityNotFound(_0x1570b8,null))[_0xd46e('0x23')](removeEntity(_0x1570b8,null))[_0xd46e('0x49')](handleError(_0x1570b8,null));};exports[_0xd46e('0x52')]=function(_0x17ea68,_0x22cb6d,_0x58e720){var _0x4c1ac6=require('../../config/schedule');return db[_0xd46e('0x2c')]['find']({'where':{'id':_0x17ea68[_0xd46e('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22cb6d,null))['then'](function(){_0x4c1ac6[_0xd46e('0x52')](_0x17ea68[_0xd46e('0x46')]['id']);})[_0xd46e('0x23')](respondWithStatusCode(_0x22cb6d,null))['catch'](handleError(_0x22cb6d,null));}; \ No newline at end of file +var _0xbad4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','stack','name','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x56f1bc,_0x2812f1){var _0x4a41dc=function(_0x46d080){while(--_0x46d080){_0x56f1bc['push'](_0x56f1bc['shift']());}};_0x4a41dc(++_0x2812f1);}(_0xbad4,0x95));var _0x4bad=function(_0x36b330,_0x28274e){_0x36b330=_0x36b330-0x0;var _0x7b8dfc=_0xbad4[_0x36b330];return _0x7b8dfc;};'use strict';var emlformat=require(_0x4bad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4bad('0x1'));var rp=require(_0x4bad('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bad('0x3'));var util=require(_0x4bad('0x4'));var path=require(_0x4bad('0x5'));var sox=require('sox');var csv=require(_0x4bad('0x6'));var ejs=require(_0x4bad('0x7'));var fs=require('fs');var fs_extra=require(_0x4bad('0x8'));var _=require('lodash');var squel=require(_0x4bad('0x9'));var crypto=require('crypto');var jsforce=require(_0x4bad('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4bad('0x6'));var querystring=require(_0x4bad('0xb'));var Papa=require(_0x4bad('0xc'));var Redis=require(_0x4bad('0xd'));var authService=require(_0x4bad('0xe'));var qs=require(_0x4bad('0xf'));var as=require(_0x4bad('0x10'));var hardwareService=require(_0x4bad('0x11'));var logger=require(_0x4bad('0x12'))(_0x4bad('0x13'));var utils=require(_0x4bad('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4bad('0x15'));var db=require(_0x4bad('0x16'))['db'];function respondWithStatusCode(_0x1ba571,_0x1f7289){_0x1f7289=_0x1f7289||0xcc;return function(_0x27c042){if(_0x27c042){return _0x1ba571[_0x4bad('0x17')](_0x1f7289);}return _0x1ba571[_0x4bad('0x18')](_0x1f7289)[_0x4bad('0x19')]();};}function respondWithResult(_0x5d9123,_0x316bd5){_0x316bd5=_0x316bd5||0xc8;return function(_0x2faed5){if(_0x2faed5){return _0x5d9123[_0x4bad('0x18')](_0x316bd5)[_0x4bad('0x1a')](_0x2faed5);}};}function respondWithFilteredResult(_0x3118cd,_0x397279){return function(_0x515532){if(_0x515532){var _0x4dab6c=typeof _0x397279[_0x4bad('0x1b')]==='undefined'&&typeof _0x397279[_0x4bad('0x1c')]===_0x4bad('0x1d');var _0x35b15f=_0x515532['count'];var _0x129eec=_0x4dab6c?0x0:_0x397279['offset'];var _0x110bb0=_0x4dab6c?_0x515532['count']:_0x397279['offset']+_0x397279['limit'];var _0x571323;if(_0x110bb0>=_0x35b15f){_0x110bb0=_0x35b15f;_0x571323=0xc8;}else{_0x571323=0xce;}_0x3118cd[_0x4bad('0x18')](_0x571323);return _0x3118cd['set'](_0x4bad('0x1e'),_0x129eec+'-'+_0x110bb0+'/'+_0x35b15f)['json'](_0x515532);}return null;};}function patchUpdates(_0x59f4aa){return function(_0x32f207){try{jsonpatch[_0x4bad('0x1f')](_0x32f207,_0x59f4aa,!![]);}catch(_0x5b11f1){return BPromise[_0x4bad('0x20')](_0x5b11f1);}return _0x32f207[_0x4bad('0x21')]();};}function saveUpdates(_0x60f5eb,_0x1b3432){return function(_0x5d82f8){if(_0x5d82f8){return _0x5d82f8[_0x4bad('0x22')](_0x60f5eb)[_0x4bad('0x23')](function(_0x49cad0){return _0x49cad0;});}return null;};}function removeEntity(_0x4431e0,_0x546bc9){return function(_0x3dda15){if(_0x3dda15){return _0x3dda15[_0x4bad('0x24')]()[_0x4bad('0x23')](function(){var _0x1b8c27=_0x3dda15[_0x4bad('0x25')]({'plain':!![]});var _0x4da201=_0x4bad('0x26');return db['UserProfileResource'][_0x4bad('0x24')]({'where':{'type':_0x4da201,'resourceId':_0x1b8c27['id']}})[_0x4bad('0x23')](function(){return _0x3dda15;});})[_0x4bad('0x23')](function(){_0x4431e0[_0x4bad('0x18')](0xcc)[_0x4bad('0x19')]();});}};}function handleEntityNotFound(_0x139974,_0x13fcab){return function(_0x46a6fe){if(!_0x46a6fe){_0x139974[_0x4bad('0x17')](0x194);}return _0x46a6fe;};}function handleError(_0x46443d,_0x5891f8){_0x5891f8=_0x5891f8||0x1f4;return function(_0x205aa3){logger['error'](_0x205aa3[_0x4bad('0x27')]);if(_0x205aa3[_0x4bad('0x28')]){delete _0x205aa3[_0x4bad('0x28')];}_0x46443d['status'](_0x5891f8)['send'](_0x205aa3);};}exports[_0x4bad('0x29')]=function(_0x6a96d3,_0xba901){var _0x3653a5={},_0x114ea9={},_0x23217a={'count':0x0,'rows':[]};var _0x69c9ee=_['map'](db[_0x4bad('0x2a')][_0x4bad('0x2b')],function(_0x1263c9){return{'name':_0x1263c9[_0x4bad('0x2c')],'type':_0x1263c9[_0x4bad('0x2d')][_0x4bad('0x2e')]};});_0x114ea9[_0x4bad('0x2f')]=_[_0x4bad('0x30')](_0x69c9ee,_0x4bad('0x28'));_0x114ea9[_0x4bad('0x31')]=_['keys'](_0x6a96d3['query']);_0x114ea9[_0x4bad('0x32')]=_[_0x4bad('0x33')](_0x114ea9[_0x4bad('0x2f')],_0x114ea9[_0x4bad('0x31')]);_0x3653a5[_0x4bad('0x34')]=_['intersection'](_0x114ea9[_0x4bad('0x2f')],qs[_0x4bad('0x35')](_0x6a96d3[_0x4bad('0x31')][_0x4bad('0x35')]));_0x3653a5[_0x4bad('0x34')]=_0x3653a5[_0x4bad('0x34')]['length']?_0x3653a5[_0x4bad('0x34')]:_0x114ea9[_0x4bad('0x2f')];if(!_0x6a96d3[_0x4bad('0x31')]['hasOwnProperty'](_0x4bad('0x36'))){_0x3653a5[_0x4bad('0x1c')]=qs[_0x4bad('0x1c')](_0x6a96d3['query']['limit']);_0x3653a5[_0x4bad('0x1b')]=qs['offset'](_0x6a96d3['query'][_0x4bad('0x1b')]);}_0x3653a5['order']=qs[_0x4bad('0x37')](_0x6a96d3['query'][_0x4bad('0x37')]);_0x3653a5[_0x4bad('0x38')]=qs[_0x4bad('0x32')](_[_0x4bad('0x39')](_0x6a96d3[_0x4bad('0x31')],_0x114ea9[_0x4bad('0x32')]),_0x69c9ee);if(_0x6a96d3[_0x4bad('0x31')][_0x4bad('0x3a')]){_0x3653a5[_0x4bad('0x38')]=_[_0x4bad('0x3b')](_0x3653a5['where'],{'$or':_['map'](_0x69c9ee,function(_0x30f2f9){if(_0x30f2f9['type']!==_0x4bad('0x3c')){var _0x1b1dcd={};_0x1b1dcd[_0x30f2f9[_0x4bad('0x28')]]={'$like':'%'+_0x6a96d3[_0x4bad('0x31')]['filter']+'%'};return _0x1b1dcd;}})});}_0x3653a5=_[_0x4bad('0x3b')]({},_0x3653a5,_0x6a96d3[_0x4bad('0x3d')]);var _0x172e42={'where':_0x3653a5[_0x4bad('0x38')]};return db[_0x4bad('0x2a')][_0x4bad('0x3e')](_0x172e42)['then'](function(_0x27a3df){_0x23217a[_0x4bad('0x3e')]=_0x27a3df;if(_0x6a96d3['query'][_0x4bad('0x3f')]){_0x3653a5[_0x4bad('0x40')]=[{'all':!![]}];}return db[_0x4bad('0x2a')][_0x4bad('0x41')](_0x3653a5);})[_0x4bad('0x23')](function(_0x344507){_0x23217a[_0x4bad('0x42')]=_0x344507;return _0x23217a;})[_0x4bad('0x23')](respondWithFilteredResult(_0xba901,_0x3653a5))[_0x4bad('0x43')](handleError(_0xba901,null));};exports[_0x4bad('0x44')]=function(_0x24d68c,_0x1057a8){var _0x317724={'raw':![],'where':{'id':_0x24d68c[_0x4bad('0x45')]['id']}},_0x38f37b={};_0x38f37b[_0x4bad('0x2f')]=_[_0x4bad('0x46')](db['Schedule'][_0x4bad('0x2b')]);_0x38f37b[_0x4bad('0x31')]=_[_0x4bad('0x46')](_0x24d68c['query']);_0x38f37b[_0x4bad('0x32')]=_[_0x4bad('0x33')](_0x38f37b[_0x4bad('0x2f')],_0x38f37b['query']);_0x317724['attributes']=_['intersection'](_0x38f37b[_0x4bad('0x2f')],qs['fields'](_0x24d68c[_0x4bad('0x31')][_0x4bad('0x35')]));_0x317724[_0x4bad('0x34')]=_0x317724[_0x4bad('0x34')][_0x4bad('0x47')]?_0x317724[_0x4bad('0x34')]:_0x38f37b[_0x4bad('0x2f')];if(_0x24d68c[_0x4bad('0x31')][_0x4bad('0x3f')]){_0x317724['include']=[{'all':!![]}];}_0x317724=_[_0x4bad('0x3b')]({},_0x317724,_0x24d68c[_0x4bad('0x3d')]);return db[_0x4bad('0x2a')][_0x4bad('0x48')](_0x317724)['then'](handleEntityNotFound(_0x1057a8,null))[_0x4bad('0x23')](respondWithResult(_0x1057a8,null))['catch'](handleError(_0x1057a8,null));};exports[_0x4bad('0x49')]=function(_0x5a7a8e,_0x20d35f){return db['Schedule'][_0x4bad('0x49')](_0x5a7a8e[_0x4bad('0x4a')],{})[_0x4bad('0x23')](function(_0xafa3d5){var _0x1286a3=_0x5a7a8e[_0x4bad('0x4b')][_0x4bad('0x25')]({'plain':!![]});if(!_0x1286a3)throw new Error(_0x4bad('0x4c'));if(_0x1286a3['role']===_0x4bad('0x4b')){var _0x39bad2=_0xafa3d5['get']({'plain':!![]});var _0x59e0a7=_0x4bad('0x26');return db['UserProfileSection'][_0x4bad('0x48')]({'where':{'name':_0x59e0a7,'userProfileId':_0x1286a3[_0x4bad('0x4d')]},'raw':!![]})[_0x4bad('0x23')](function(_0x558363){if(_0x558363&&_0x558363[_0x4bad('0x4e')]===0x0){return db[_0x4bad('0x4f')]['create']({'name':_0x39bad2[_0x4bad('0x28')],'resourceId':_0x39bad2['id'],'type':_0x558363['name'],'sectionId':_0x558363['id']},{})['then'](function(){return _0xafa3d5;});}else{return _0xafa3d5;}})[_0x4bad('0x43')](function(_0x13f00e){logger['error'](_0x4bad('0x50'),_0x13f00e);throw _0x13f00e;});}return _0xafa3d5;})['then'](respondWithResult(_0x20d35f,0xc9))['catch'](handleError(_0x20d35f,null));};exports[_0x4bad('0x22')]=function(_0x381cdd,_0x1240d7){if(_0x381cdd[_0x4bad('0x4a')]['id']){delete _0x381cdd[_0x4bad('0x4a')]['id'];}return db[_0x4bad('0x2a')]['find']({'where':{'id':_0x381cdd['params']['id']}})[_0x4bad('0x23')](handleEntityNotFound(_0x1240d7,null))[_0x4bad('0x23')](saveUpdates(_0x381cdd['body'],null))[_0x4bad('0x23')](respondWithResult(_0x1240d7,null))[_0x4bad('0x43')](handleError(_0x1240d7,null));};exports[_0x4bad('0x24')]=function(_0x46c9d1,_0x12eb82){return db[_0x4bad('0x2a')][_0x4bad('0x48')]({'where':{'id':_0x46c9d1[_0x4bad('0x45')]['id']}})[_0x4bad('0x23')](handleEntityNotFound(_0x12eb82,null))[_0x4bad('0x23')](removeEntity(_0x12eb82,null))[_0x4bad('0x43')](handleError(_0x12eb82,null));};exports[_0x4bad('0x51')]=function(_0x2bb870,_0xbcc1cc,_0x3d0803){var _0x30f1cb=require(_0x4bad('0x52'));return db['Schedule'][_0x4bad('0x48')]({'where':{'id':_0x2bb870['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xbcc1cc,null))[_0x4bad('0x23')](function(){_0x30f1cb['run'](_0x2bb870[_0x4bad('0x45')]['id']);})[_0x4bad('0x23')](respondWithStatusCode(_0xbcc1cc,null))[_0x4bad('0x43')](handleError(_0xbcc1cc,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index bfccb4f..0a433be 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 _0x6c4f=['define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x25288d,_0x1da59d){var _0x5c7c67=function(_0x3c62d5){while(--_0x3c62d5){_0x25288d['push'](_0x25288d['shift']());}};_0x5c7c67(++_0x1da59d);}(_0x6c4f,0x1d4));var _0xf6c4=function(_0x1d41ed,_0x1c4d6e){_0x1d41ed=_0x1d41ed-0x0;var _0x385f2a=_0x6c4f[_0x1d41ed];return _0x385f2a;};'use strict';var _=require(_0xf6c4('0x0'));var util=require(_0xf6c4('0x1'));var logger=require(_0xf6c4('0x2'))(_0xf6c4('0x3'));var moment=require(_0xf6c4('0x4'));var BPromise=require(_0xf6c4('0x5'));var rp=require(_0xf6c4('0x6'));var fs=require('fs');var path=require(_0xf6c4('0x7'));var rimraf=require(_0xf6c4('0x8'));var config=require(_0xf6c4('0x9'));var attributes=require(_0xf6c4('0xa'));module[_0xf6c4('0xb')]=function(_0x19199b,_0x316ffb){return _0x19199b[_0xf6c4('0xc')](_0xf6c4('0xd'),attributes,{'tableName':_0xf6c4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd741=['rimraf','../../config/environment','./schedule.attributes','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1fb559,_0x10760c){var _0x16f0de=function(_0x6b7d3b){while(--_0x6b7d3b){_0x1fb559['push'](_0x1fb559['shift']());}};_0x16f0de(++_0x10760c);}(_0xd741,0xc3));var _0x1d74=function(_0x525add,_0x2b8e24){_0x525add=_0x525add-0x0;var _0x47f592=_0xd741[_0x525add];return _0x47f592;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1d74('0x0'))(_0x1d74('0x1'));var moment=require('moment');var BPromise=require(_0x1d74('0x2'));var rp=require(_0x1d74('0x3'));var fs=require('fs');var path=require(_0x1d74('0x4'));var rimraf=require(_0x1d74('0x5'));var config=require(_0x1d74('0x6'));var attributes=require(_0x1d74('0x7'));module['exports']=function(_0xa6a5e4,_0x23db10){return _0xa6a5e4['define']('Schedule',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 110ae00..b93725b 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 _0x2356=['Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s','debug'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x2356,0xbb));var _0x6235=function(_0x3d54d8,_0x57bed2){_0x3d54d8=_0x3d54d8-0x0;var _0x4df7bf=_0x2356[_0x3d54d8];return _0x4df7bf;};'use strict';var _=require(_0x6235('0x0'));var util=require('util');var moment=require(_0x6235('0x1'));var BPromise=require(_0x6235('0x2'));var rs=require(_0x6235('0x3'));var fs=require('fs');var Redis=require(_0x6235('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6235('0x5'));var jayson=require(_0x6235('0x6'));var client=jayson[_0x6235('0x7')][_0x6235('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x357555,_0x5672ce,_0xa9b3bb){return new BPromise(function(_0x3c2cc7,_0x3b1b6e){return client[_0x6235('0x9')](_0x357555,_0xa9b3bb)[_0x6235('0xa')](function(_0x4f4194){logger['info'](_0x6235('0xb'),_0x5672ce,'request\x20sent');logger[_0x6235('0xc')](_0x6235('0xd'),_0x5672ce,_0x6235('0xe'),JSON[_0x6235('0xf')](_0x4f4194));if(_0x4f4194[_0x6235('0x10')]){if(_0x4f4194[_0x6235('0x10')]['code']===0x1f4){logger[_0x6235('0x10')](_0x6235('0xb'),_0x5672ce,_0x4f4194[_0x6235('0x10')][_0x6235('0x11')]);return _0x3b1b6e(_0x4f4194[_0x6235('0x10')][_0x6235('0x11')]);}logger[_0x6235('0x10')](_0x6235('0xb'),_0x5672ce,_0x4f4194['error'][_0x6235('0x11')]);return _0x3c2cc7(_0x4f4194[_0x6235('0x10')][_0x6235('0x11')]);}else{logger['info'](_0x6235('0xb'),_0x5672ce,_0x6235('0xe'));_0x3c2cc7(_0x4f4194[_0x6235('0x12')][_0x6235('0x11')]);}})[_0x6235('0x13')](function(_0x45f76b){logger[_0x6235('0x10')](_0x6235('0xb'),_0x5672ce,_0x45f76b);_0x3b1b6e(_0x45f76b);});});} \ No newline at end of file +var _0xb64f=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','Schedule,\x20%s,\x20%s','message'];(function(_0x561899,_0x11947b){var _0x12e019=function(_0x16dbf2){while(--_0x16dbf2){_0x561899['push'](_0x561899['shift']());}};_0x12e019(++_0x11947b);}(_0xb64f,0x126));var _0xfb64=function(_0x4f3da4,_0x121375){_0x4f3da4=_0x4f3da4-0x0;var _0x1df1a1=_0xb64f[_0x4f3da4];return _0x1df1a1;};'use strict';var _=require(_0xfb64('0x0'));var util=require(_0xfb64('0x1'));var moment=require(_0xfb64('0x2'));var BPromise=require(_0xfb64('0x3'));var rs=require(_0xfb64('0x4'));var fs=require('fs');var Redis=require(_0xfb64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb64('0x6'));var logger=require('../../config/logger')(_0xfb64('0x7'));var config=require(_0xfb64('0x8'));var jayson=require(_0xfb64('0x9'));var client=jayson[_0xfb64('0xa')][_0xfb64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35af66,_0x4aa641,_0x5cb56e){return new BPromise(function(_0x4971a5,_0x219045){return client[_0xfb64('0xc')](_0x35af66,_0x5cb56e)['then'](function(_0x25d9c7){logger[_0xfb64('0xd')]('Schedule,\x20%s,\x20%s',_0x4aa641,_0xfb64('0xe'));logger[_0xfb64('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4aa641,_0xfb64('0xe'),JSON[_0xfb64('0x10')](_0x25d9c7));if(_0x25d9c7[_0xfb64('0x11')]){if(_0x25d9c7[_0xfb64('0x11')][_0xfb64('0x12')]===0x1f4){logger[_0xfb64('0x11')](_0xfb64('0x13'),_0x4aa641,_0x25d9c7[_0xfb64('0x11')][_0xfb64('0x14')]);return _0x219045(_0x25d9c7[_0xfb64('0x11')]['message']);}logger['error'](_0xfb64('0x13'),_0x4aa641,_0x25d9c7[_0xfb64('0x11')][_0xfb64('0x14')]);return _0x4971a5(_0x25d9c7[_0xfb64('0x11')][_0xfb64('0x14')]);}else{logger[_0xfb64('0xd')]('Schedule,\x20%s,\x20%s',_0x4aa641,_0xfb64('0xe'));_0x4971a5(_0x25d9c7['result']['message']);}})['catch'](function(_0x390329){logger[_0xfb64('0x11')](_0xfb64('0x13'),_0x4aa641,_0x390329);_0x219045(_0x390329);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 041251c..2d27c99 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 _0x4380=['/:id','show','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','isAuthenticated','describe'];(function(_0x60b199,_0x31c6c7){var _0x4562c8=function(_0x3f607f){while(--_0x3f607f){_0x60b199['push'](_0x60b199['shift']());}};_0x4562c8(++_0x31c6c7);}(_0x4380,0x1ae));var _0x0438=function(_0x7ef980,_0x1566bf){_0x7ef980=_0x7ef980-0x0;var _0x4025b1=_0x4380[_0x7ef980];return _0x4025b1;};'use strict';var multer=require(_0x0438('0x0'));var util=require(_0x0438('0x1'));var path=require(_0x0438('0x2'));var timeout=require(_0x0438('0x3'));var express=require('express');var router=express[_0x0438('0x4')]();var fs_extra=require(_0x0438('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0438('0x6'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x0438('0x7')]('/',auth['isAuthenticated'](),controller[_0x0438('0x8')]);router[_0x0438('0x7')]('/describe',auth[_0x0438('0x9')](),controller[_0x0438('0xa')]);router[_0x0438('0x7')](_0x0438('0xb'),auth[_0x0438('0x9')](),controller[_0x0438('0xc')]);router[_0x0438('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x0438('0xd')]);router[_0x0438('0xe')]('/',auth[_0x0438('0x9')](),controller[_0x0438('0xf')]);router[_0x0438('0x10')](_0x0438('0xb'),auth[_0x0438('0x9')](),controller[_0x0438('0x11')]);router[_0x0438('0x12')](_0x0438('0xb'),auth[_0x0438('0x9')](),controller[_0x0438('0x13')]);module[_0x0438('0x14')]=router; \ No newline at end of file +var _0x5bd1=['isAuthenticated','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id'];(function(_0x1bcfcc,_0x3b7eb3){var _0x4dd23a=function(_0x368142){while(--_0x368142){_0x1bcfcc['push'](_0x1bcfcc['shift']());}};_0x4dd23a(++_0x3b7eb3);}(_0x5bd1,0x7d));var _0x15bd=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0x5bd1[_0x508685];return _0x976a76;};'use strict';var multer=require(_0x15bd('0x0'));var util=require('util');var path=require(_0x15bd('0x1'));var timeout=require('connect-timeout');var express=require(_0x15bd('0x2'));var router=express[_0x15bd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x15bd('0x4'));var interaction=require(_0x15bd('0x5'));var config=require(_0x15bd('0x6'));var controller=require(_0x15bd('0x7'));router[_0x15bd('0x8')]('/',auth['isAuthenticated'](),controller[_0x15bd('0x9')]);router[_0x15bd('0x8')](_0x15bd('0xa'),auth['isAuthenticated'](),controller[_0x15bd('0xb')]);router[_0x15bd('0x8')](_0x15bd('0xc'),auth[_0x15bd('0xd')](),controller[_0x15bd('0xe')]);router[_0x15bd('0x8')](_0x15bd('0xf'),auth[_0x15bd('0xd')](),controller[_0x15bd('0x10')]);router[_0x15bd('0x11')]('/',auth[_0x15bd('0xd')](),controller['create']);router[_0x15bd('0x12')]('/:id',auth[_0x15bd('0xd')](),controller[_0x15bd('0x13')]);router[_0x15bd('0x14')](_0x15bd('0xc'),auth[_0x15bd('0xd')](),controller[_0x15bd('0x15')]);module[_0x15bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index fcfec30..9fbef16 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 _0x79e2=['setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','getDataValue','extname','value','STRING','replace'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x79e2,0x1c3));var _0x279e=function(_0x45bd81,_0x26da6d){_0x45bd81=_0x45bd81-0x0;var _0x27792e=_0x79e2[_0x45bd81];return _0x27792e;};'use strict';var Sequelize=require(_0x279e('0x0'));var moment=require('moment');var path=require(_0x279e('0x1'));var config=require(_0x279e('0x2'));module[_0x279e('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x279e('0x4')]('value')?path[_0x279e('0x5')](this[_0x279e('0x4')](_0x279e('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x279e('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x1c6b6f){var _0x26c072=_0x1c6b6f[_0x279e('0x8')](/\\/g,'/');this[_0x279e('0x9')](_0x279e('0x6'),_0x26c072);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x279e('0xa')],'set':function(_0x1ec1b7){this[_0x279e('0x9')]('startedAt',moment()[_0x279e('0xb')](_0x1ec1b7,'ms'));this[_0x279e('0x9')]('closedAt',moment());this[_0x279e('0x9')](_0x279e('0xc'),_0x1ec1b7);}},'startedAt':{'type':Sequelize[_0x279e('0xd')],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0xe')))[_0x279e('0xf')](_0x279e('0x10'))[_0x279e('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x279e('0x4')]('closedAt'))[_0x279e('0xf')](_0x279e('0x10'))[_0x279e('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0x12')))[_0x279e('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x279e('0x11')]();}},'updatedAt':{'type':Sequelize[_0x279e('0xd')],'get':function(){return moment(this[_0x279e('0x4')](_0x279e('0x13')))[_0x279e('0xf')](_0x279e('0x10'))['toString']();}}}; \ No newline at end of file +var _0x2fc9=['format','MM-DD-YYYY\x20HH:mm','closedAt','createdAt','toString','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE'];(function(_0x563568,_0x1d3e90){var _0x543aec=function(_0x890855){while(--_0x890855){_0x563568['push'](_0x563568['shift']());}};_0x543aec(++_0x1d3e90);}(_0x2fc9,0xc2));var _0x92fc=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x2fc9[_0x54e6f5];return _0x5e8794;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92fc('0x0'));var path=require(_0x92fc('0x1'));var config=require(_0x92fc('0x2'));module[_0x92fc('0x3')]={'format':{'type':Sequelize[_0x92fc('0x4')],'get':function(){return this[_0x92fc('0x5')](_0x92fc('0x6'))?path[_0x92fc('0x7')](this[_0x92fc('0x5')](_0x92fc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x92fc('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x5c79a5){var _0x340518=_0x5c79a5[_0x92fc('0x9')](/\\/g,'/');this[_0x92fc('0xa')](_0x92fc('0x6'),_0x340518);}},'rating':{'type':Sequelize[_0x92fc('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x92fc('0xb')],'set':function(_0x2805f4){this['setDataValue'](_0x92fc('0xc'),moment()[_0x92fc('0xd')](_0x2805f4,'ms'));this[_0x92fc('0xa')]('closedAt',moment());this[_0x92fc('0xa')](_0x92fc('0xe'),_0x2805f4);}},'startedAt':{'type':Sequelize[_0x92fc('0xf')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x92fc('0x10')](_0x92fc('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x92fc('0xf')],'get':function(){return moment(this[_0x92fc('0x5')](_0x92fc('0x12')))[_0x92fc('0x10')](_0x92fc('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x92fc('0xf')],'get':function(){return moment(this[_0x92fc('0x5')](_0x92fc('0x13')))[_0x92fc('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x92fc('0xf')],'get':function(){return moment(this[_0x92fc('0x5')]('updatedAt'))[_0x92fc('0x10')](_0x92fc('0x11'))[_0x92fc('0x14')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 3532ad9..b895ad2 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 _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0xadf9a5,_0x570df8){var _0x4eeb52=function(_0x39fec2){while(--_0x39fec2){_0xadf9a5['push'](_0xadf9a5['shift']());}};_0x4eeb52(++_0x570df8);}(_0xe5b3,0x133));var _0x3e5b=function(_0x43cc50,_0x1b7bd1){_0x43cc50=_0x43cc50-0x0;var _0x2fb4b5=_0xe5b3[_0x43cc50];return _0x2fb4b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file +var _0x6f47=['zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','ScreenRecording','fieldName','type','key','model','format','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','catch','create','body','duration','createdAt','closedAt','value','find','describe','uniqueid','join','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','root','server/files/screen_recordings','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','rimraf'];(function(_0x3210a6,_0x5c6345){var _0x2121b0=function(_0x5f285d){while(--_0x5f285d){_0x3210a6['push'](_0x3210a6['shift']());}};_0x2121b0(++_0x5c6345);}(_0x6f47,0xc7));var _0x76f4=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x6f47[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76f4('0x0'));var zipdir=require(_0x76f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76f4('0x2'));var moment=require('moment');var BPromise=require(_0x76f4('0x3'));var Mustache=require('mustache');var util=require(_0x76f4('0x4'));var path=require(_0x76f4('0x5'));var sox=require(_0x76f4('0x6'));var csv=require(_0x76f4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76f4('0x8'));var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0x7'));var querystring=require(_0x76f4('0xd'));var Papa=require(_0x76f4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0xf'));var as=require(_0x76f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x11'));var utils=require(_0x76f4('0x12'));var config=require(_0x76f4('0x13'));var licenseUtil=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xcc;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0x16')](_0xf7e347);}return _0xafd21e['status'](_0xf7e347)[_0x76f4('0x17')]();};}function respondWithResult(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0xc8;return function(_0x4b6021){if(_0x4b6021){return _0x30dabf['status'](_0x5da1ff)[_0x76f4('0x18')](_0x4b6021);}};}function respondWithFilteredResult(_0x3dd240,_0x979946){return function(_0x40252d){if(_0x40252d){var _0x3d8f5a=typeof _0x979946[_0x76f4('0x19')]===_0x76f4('0x1a')&&typeof _0x979946[_0x76f4('0x1b')]===_0x76f4('0x1a');var _0xb159a9=_0x40252d[_0x76f4('0x1c')];var _0x2d4bd1=_0x3d8f5a?0x0:_0x979946[_0x76f4('0x19')];var _0x38450e=_0x3d8f5a?_0x40252d[_0x76f4('0x1c')]:_0x979946[_0x76f4('0x19')]+_0x979946[_0x76f4('0x1b')];var _0x3e809f;if(_0x38450e>=_0xb159a9){_0x38450e=_0xb159a9;_0x3e809f=0xc8;}else{_0x3e809f=0xce;}_0x3dd240[_0x76f4('0x1d')](_0x3e809f);return _0x3dd240[_0x76f4('0x1e')](_0x76f4('0x1f'),_0x2d4bd1+'-'+_0x38450e+'/'+_0xb159a9)[_0x76f4('0x18')](_0x40252d);}return null;};}function patchUpdates(_0x5bf3d5){return function(_0x262937){try{jsonpatch['apply'](_0x262937,_0x5bf3d5,!![]);}catch(_0x13f3b1){return BPromise[_0x76f4('0x20')](_0x13f3b1);}return _0x262937[_0x76f4('0x21')]();};}function saveUpdates(_0x517c00,_0x567f2a){return function(_0x52da65){if(_0x52da65){return _0x52da65[_0x76f4('0x22')](_0x517c00)[_0x76f4('0x23')](function(_0x14bfe5){return _0x14bfe5;});}return null;};}function removeEntity(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(_0x4786c9){return _0x4786c9[_0x76f4('0x24')]()['then'](function(){_0x2b6d51['status'](0xcc)[_0x76f4('0x17')]();});}};}function handleEntityNotFound(_0x497913,_0x288365){return function(_0x5355bd){if(!_0x5355bd){_0x497913['sendStatus'](0x194);}return _0x5355bd;};}function handleError(_0x4f6087,_0x470242){_0x470242=_0x470242||0x1f4;return function(_0x38300d){logger[_0x76f4('0x25')](_0x38300d[_0x76f4('0x26')]);if(_0x38300d[_0x76f4('0x27')]){delete _0x38300d[_0x76f4('0x27')];}_0x4f6087['status'](_0x470242)[_0x76f4('0x28')](_0x38300d);};}exports['index']=function(_0x5346be,_0x5b3f07){var _0x10ddb4={},_0x30f02e={},_0x41dea4={'count':0x0,'rows':[]};var _0x1dea0e=_['map'](db[_0x76f4('0x29')]['rawAttributes'],function(_0x259c26){return{'name':_0x259c26[_0x76f4('0x2a')],'type':_0x259c26[_0x76f4('0x2b')][_0x76f4('0x2c')]};});_0x30f02e[_0x76f4('0x2d')]=_['differenceBy'](_['map'](_0x1dea0e,_0x76f4('0x27')),[_0x76f4('0x2e')]);_0x30f02e[_0x76f4('0x2f')]=_[_0x76f4('0x30')](_0x5346be[_0x76f4('0x2f')]);_0x30f02e[_0x76f4('0x31')]=_[_0x76f4('0x32')](_0x30f02e[_0x76f4('0x2d')],_0x30f02e[_0x76f4('0x2f')]);_0x10ddb4[_0x76f4('0x33')]=_[_0x76f4('0x32')](_0x30f02e[_0x76f4('0x2d')],qs['fields'](_0x5346be['query']['fields']));_0x10ddb4['attributes']=_0x10ddb4[_0x76f4('0x33')][_0x76f4('0x34')]?_0x10ddb4[_0x76f4('0x33')]:_0x30f02e[_0x76f4('0x2d')];if(!_0x5346be[_0x76f4('0x2f')]['hasOwnProperty'](_0x76f4('0x35'))){_0x10ddb4[_0x76f4('0x1b')]=qs[_0x76f4('0x1b')](_0x5346be[_0x76f4('0x2f')][_0x76f4('0x1b')]);_0x10ddb4[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0x5346be[_0x76f4('0x2f')][_0x76f4('0x19')]);}_0x10ddb4[_0x76f4('0x36')]=qs[_0x76f4('0x37')](_0x5346be[_0x76f4('0x2f')][_0x76f4('0x37')]);_0x10ddb4[_0x76f4('0x38')]=qs[_0x76f4('0x31')](_[_0x76f4('0x39')](_0x5346be[_0x76f4('0x2f')],_0x30f02e[_0x76f4('0x31')]),_0x1dea0e);if(_0x5346be['query'][_0x76f4('0x3a')]){_0x10ddb4[_0x76f4('0x38')]=_[_0x76f4('0x3b')](_0x10ddb4['where'],{'$or':_['map'](_0x1dea0e,function(_0x237fba){if(_0x237fba['type']!==_0x76f4('0x3c')){var _0x5ac18f={};_0x5ac18f[_0x237fba[_0x76f4('0x27')]]={'$like':'%'+_0x5346be[_0x76f4('0x2f')][_0x76f4('0x3a')]+'%'};return _0x5ac18f;}})});}_0x10ddb4=_[_0x76f4('0x3b')]({},_0x10ddb4,_0x5346be[_0x76f4('0x3d')]);var _0x2d99e3={'where':_0x10ddb4[_0x76f4('0x38')]};return db[_0x76f4('0x29')][_0x76f4('0x1c')](_0x2d99e3)[_0x76f4('0x23')](function(_0x5340a9){_0x41dea4['count']=_0x5340a9;if(_0x5346be[_0x76f4('0x2f')][_0x76f4('0x3e')]){_0x10ddb4[_0x76f4('0x3f')]=[{'all':!![]}];}return db[_0x76f4('0x29')][_0x76f4('0x40')](_0x10ddb4);})[_0x76f4('0x23')](function(_0x42754d){_0x41dea4[_0x76f4('0x41')]=_0x42754d;return _0x41dea4;})[_0x76f4('0x23')](respondWithFilteredResult(_0x5b3f07,_0x10ddb4))['catch'](handleError(_0x5b3f07,null));};exports[_0x76f4('0x42')]=function(_0xe744af,_0x4f0d1a){var _0x5ad90a={'raw':![],'where':{'id':_0xe744af[_0x76f4('0x43')]['id']}},_0x26c411={};_0x26c411[_0x76f4('0x2d')]=_[_0x76f4('0x30')](db[_0x76f4('0x29')]['rawAttributes']);_0x26c411[_0x76f4('0x2f')]=_[_0x76f4('0x30')](_0xe744af[_0x76f4('0x2f')]);_0x26c411[_0x76f4('0x31')]=_[_0x76f4('0x32')](_0x26c411[_0x76f4('0x2d')],_0x26c411['query']);_0x5ad90a[_0x76f4('0x33')]=_[_0x76f4('0x32')](_0x26c411[_0x76f4('0x2d')],qs['fields'](_0xe744af['query'][_0x76f4('0x44')]));_0x5ad90a[_0x76f4('0x33')]=_0x5ad90a[_0x76f4('0x33')][_0x76f4('0x34')]?_0x5ad90a[_0x76f4('0x33')]:_0x26c411['model'];if(_0xe744af['query'][_0x76f4('0x3e')]){_0x5ad90a['include']=[{'all':!![]}];}_0x5ad90a=_[_0x76f4('0x3b')]({},_0x5ad90a,_0xe744af[_0x76f4('0x3d')]);return db['ScreenRecording']['find'](_0x5ad90a)[_0x76f4('0x23')](handleEntityNotFound(_0x4f0d1a,null))[_0x76f4('0x23')](respondWithResult(_0x4f0d1a,null))[_0x76f4('0x45')](handleError(_0x4f0d1a,null));};exports[_0x76f4('0x46')]=function(_0x55e4cc,_0x9baa0f){return db[_0x76f4('0x29')][_0x76f4('0x46')](_0x55e4cc['body'],{})[_0x76f4('0x23')](respondWithResult(_0x9baa0f,0xc9))[_0x76f4('0x45')](handleError(_0x9baa0f,null));};exports['update']=function(_0x56d905,_0x4ab620){if(_0x56d905[_0x76f4('0x47')]['id']){delete _0x56d905[_0x76f4('0x47')]['id'];}delete _0x56d905[_0x76f4('0x47')][_0x76f4('0x48')];delete _0x56d905['body'][_0x76f4('0x49')];delete _0x56d905['body'][_0x76f4('0x4a')];delete _0x56d905[_0x76f4('0x47')][_0x76f4('0x4b')];return db['ScreenRecording'][_0x76f4('0x4c')]({'where':{'id':_0x56d905[_0x76f4('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ab620,null))[_0x76f4('0x23')](saveUpdates(_0x56d905[_0x76f4('0x47')],null))[_0x76f4('0x23')](respondWithResult(_0x4ab620,null))[_0x76f4('0x45')](handleError(_0x4ab620,null));};exports[_0x76f4('0x4d')]=function(_0x479c4b,_0x1041da){return db['ScreenRecording'][_0x76f4('0x4d')]()[_0x76f4('0x23')](respondWithResult(_0x1041da,null))[_0x76f4('0x45')](handleError(_0x1041da,null));};exports['download']=function(_0x141b1c,_0x46c944,_0x3fc794){var _0x3bec16=require('../../components/encryptor');var _0x2028e9=![];var _0xf11e07={};if(_0x141b1c[_0x76f4('0x2f')][_0x76f4('0x2b')]&&_0x141b1c['query'][_0x76f4('0x2b')]==='uniqueid'){_0xf11e07[_0x76f4('0x4e')]=_0x141b1c[_0x76f4('0x43')]['id'];}else{_0xf11e07['id']=_0x141b1c['params']['id'];}return db['ScreenRecording'][_0x76f4('0x4c')]({'where':_0xf11e07,'attributes':['id',_0x76f4('0x4b')],'raw':!![]})[_0x76f4('0x23')](handleEntityNotFound(_0x46c944,null))['then'](function(_0x27ba06){if(_0x27ba06){var _0x15ec0f=path[_0x76f4('0x4f')](config['root'],'server/files/screen_recordings',_0x27ba06[_0x76f4('0x4b')]);var _0x367238=util['format']('%s.cypher',_0x15ec0f);if(fs[_0x76f4('0x50')](_0x367238)){_0x2028e9=!![];return _0x3bec16[_0x76f4('0x51')](_0x367238,_0x15ec0f,config[_0x76f4('0x52')][_0x76f4('0x53')])[_0x76f4('0x23')](function(){return _0x27ba06;});}return _0x27ba06;}})[_0x76f4('0x23')](function(_0x97be11){if(_0x97be11){var _0x36a52a=path[_0x76f4('0x4f')](config['root'],'server/files/screen_recordings',_0x97be11['value']);if(!fs[_0x76f4('0x50')](_0x36a52a)){throw new db[(_0x76f4('0x54'))][(_0x76f4('0x55'))](_0x76f4('0x56'));}if(_0x97be11['filename']){return _0x46c944['download'](_0x36a52a,_0x97be11[_0x76f4('0x57')]+path['extname'](_0x36a52a),function(){if(_0x2028e9){fs[_0x76f4('0x58')](_0x36a52a);}});}else{return _0x46c944['download'](_0x36a52a,function(_0x4285dd){if(_0x2028e9){fs[_0x76f4('0x58')](_0x36a52a);}});}}})[_0x76f4('0x45')](function(_0x3317a4){if(_0x3317a4['message']===_0x76f4('0x56')){_0x46c944[_0x76f4('0x1d')](0x194)[_0x76f4('0x28')](_0x76f4('0x59'));}else{return handleError(_0x46c944,null);}});};exports[_0x76f4('0x24')]=function(_0x2a6f19,_0x46245f){return db['ScreenRecording'][_0x76f4('0x4c')]({'where':{'id':_0x2a6f19[_0x76f4('0x43')]['id']}})[_0x76f4('0x23')](function(_0x320a87){if(_[_0x76f4('0x5a')](_0x320a87)){throw new ReferenceError(_0x76f4('0x5b'));}return _0x320a87;})[_0x76f4('0x23')](function(_0x551d38){var _0x5724c3=path['join'](config[_0x76f4('0x5c')],_0x76f4('0x5d'),_0x551d38[_0x76f4('0x4b')]);logger['info'](_0x76f4('0x5e'),_0x5724c3);if(!_['isNil'](_0x551d38[_0x76f4('0x4b')])&&fs[_0x76f4('0x50')](_0x5724c3)){logger['info'](_0x76f4('0x5f')+_0x5724c3+_0x76f4('0x60'));fs[_0x76f4('0x61')](_0x5724c3);}_0x5724c3=_0x5724c3+_0x76f4('0x62');if(!_[_0x76f4('0x5a')](_0x551d38[_0x76f4('0x4b')])&&fs[_0x76f4('0x50')](_0x5724c3)){logger[_0x76f4('0x63')](_0x76f4('0x5f')+_0x5724c3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x76f4('0x61')](_0x5724c3);}return _0x551d38;})['then'](function(_0x318fcb){if(!_0x318fcb)throw new InternalError();return _0x318fcb[_0x76f4('0x24')]();})[_0x76f4('0x23')](function(){_0x46245f[_0x76f4('0x1d')](0xcc)[_0x76f4('0x17')]();})[_0x76f4('0x45')](handleError(_0x46245f,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ac1df77..1125646 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 _0x73d1=['api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger'];(function(_0x561802,_0x1146fb){var _0x336857=function(_0x5fa5f0){while(--_0x5fa5f0){_0x561802['push'](_0x561802['shift']());}};_0x336857(++_0x1146fb);}(_0x73d1,0xa6));var _0x173d=function(_0x2d5d8f,_0x5219de){_0x2d5d8f=_0x2d5d8f-0x0;var _0x1af3d0=_0x73d1[_0x2d5d8f];return _0x1af3d0;};'use strict';var _=require(_0x173d('0x0'));var util=require(_0x173d('0x1'));var logger=require(_0x173d('0x2'))(_0x173d('0x3'));var moment=require(_0x173d('0x4'));var BPromise=require('bluebird');var rp=require(_0x173d('0x5'));var fs=require('fs');var path=require(_0x173d('0x6'));var rimraf=require(_0x173d('0x7'));var config=require(_0x173d('0x8'));var attributes=require(_0x173d('0x9'));module['exports']=function(_0x222b23,_0x2ff0cb){return _0x222b23['define'](_0x173d('0xa'),attributes,{'tableName':_0x173d('0xb'),'paranoid':![],'indexes':[{'name':_0x173d('0xc'),'fields':[_0x173d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2963=['../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ee8da,_0x111e61){var _0x2d485c=function(_0x2550d1){while(--_0x2550d1){_0x4ee8da['push'](_0x4ee8da['shift']());}};_0x2d485c(++_0x111e61);}(_0x2963,0x132));var _0x3296=function(_0x1b9e1a,_0xe8e24d){_0x1b9e1a=_0x1b9e1a-0x0;var _0xc66289=_0x2963[_0x1b9e1a];return _0xc66289;};'use strict';var _=require(_0x3296('0x0'));var util=require(_0x3296('0x1'));var logger=require(_0x3296('0x2'))(_0x3296('0x3'));var moment=require(_0x3296('0x4'));var BPromise=require(_0x3296('0x5'));var rp=require(_0x3296('0x6'));var fs=require('fs');var path=require(_0x3296('0x7'));var rimraf=require(_0x3296('0x8'));var config=require(_0x3296('0x9'));var attributes=require('./screenRecording.attributes');module[_0x3296('0xa')]=function(_0x32a317,_0x320e15){return _0x32a317[_0x3296('0xb')](_0x3296('0xc'),attributes,{'tableName':_0x3296('0xd'),'paranoid':![],'indexes':[{'name':_0x3296('0xe'),'fields':[_0x3296('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7ce9191..0febbfa 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 _0x3a9b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x165935,_0x1ee745){var _0x107459=function(_0x50d7ad){while(--_0x50d7ad){_0x165935['push'](_0x165935['shift']());}};_0x107459(++_0x1ee745);}(_0x3a9b,0x18b));var _0xb3a9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3a9b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb3a9('0x0'));var util=require('util');var moment=require(_0xb3a9('0x1'));var BPromise=require(_0xb3a9('0x2'));var rs=require(_0xb3a9('0x3'));var fs=require('fs');var Redis=require(_0xb3a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3a9('0x5'));var logger=require(_0xb3a9('0x6'))(_0xb3a9('0x7'));var config=require('../../config/environment');var jayson=require(_0xb3a9('0x8'));var client=jayson[_0xb3a9('0x9')][_0xb3a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc72ef,_0x5b48fc,_0x3a0a7a){return new BPromise(function(_0xdaa7bc,_0x4c13b5){return client['request'](_0xcc72ef,_0x3a0a7a)[_0xb3a9('0xb')](function(_0x2fe4fe){logger['info'](_0xb3a9('0xc'),_0x5b48fc,'request\x20sent');logger['debug'](_0xb3a9('0xd'),_0x5b48fc,_0xb3a9('0xe'),JSON['stringify'](_0x2fe4fe));if(_0x2fe4fe[_0xb3a9('0xf')]){if(_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x10')]===0x1f4){logger[_0xb3a9('0xf')](_0xb3a9('0xc'),_0x5b48fc,_0x2fe4fe['error'][_0xb3a9('0x11')]);return _0x4c13b5(_0x2fe4fe['error'][_0xb3a9('0x11')]);}logger['error'](_0xb3a9('0xc'),_0x5b48fc,_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x11')]);return _0xdaa7bc(_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x11')]);}else{logger['info'](_0xb3a9('0xc'),_0x5b48fc,_0xb3a9('0xe'));_0xdaa7bc(_0x2fe4fe[_0xb3a9('0x12')]['message']);}})[_0xb3a9('0x13')](function(_0x51ff9f){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5b48fc,_0x51ff9f);_0x4c13b5(_0x51ff9f);});});} \ No newline at end of file +var _0x3b2f=['../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis'];(function(_0x791c4a,_0x926241){var _0x20d6a3=function(_0x53a195){while(--_0x53a195){_0x791c4a['push'](_0x791c4a['shift']());}};_0x20d6a3(++_0x926241);}(_0x3b2f,0x14c));var _0xf3b2=function(_0xc34c19,_0x1fe3d9){_0xc34c19=_0xc34c19-0x0;var _0x1592db=_0x3b2f[_0xc34c19];return _0x1592db;};'use strict';var _=require(_0xf3b2('0x0'));var util=require('util');var moment=require(_0xf3b2('0x1'));var BPromise=require(_0xf3b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3b2('0x3'));var db=require(_0xf3b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf3b2('0x5'));var config=require(_0xf3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf3b2('0x7')][_0xf3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40c7a2,_0x4c7d55,_0x1a0d56){return new BPromise(function(_0x28a419,_0x3b9d8d){return client[_0xf3b2('0x9')](_0x40c7a2,_0x1a0d56)[_0xf3b2('0xa')](function(_0x88abea){logger[_0xf3b2('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x4c7d55,_0xf3b2('0xc'));logger[_0xf3b2('0xd')](_0xf3b2('0xe'),_0x4c7d55,'request\x20sent',JSON[_0xf3b2('0xf')](_0x88abea));if(_0x88abea[_0xf3b2('0x10')]){if(_0x88abea['error'][_0xf3b2('0x11')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4c7d55,_0x88abea[_0xf3b2('0x10')][_0xf3b2('0x12')]);return _0x3b9d8d(_0x88abea[_0xf3b2('0x10')]['message']);}logger[_0xf3b2('0x10')](_0xf3b2('0x13'),_0x4c7d55,_0x88abea[_0xf3b2('0x10')][_0xf3b2('0x12')]);return _0x28a419(_0x88abea[_0xf3b2('0x10')][_0xf3b2('0x12')]);}else{logger[_0xf3b2('0xb')](_0xf3b2('0x13'),_0x4c7d55,_0xf3b2('0xc'));_0x28a419(_0x88abea['result'][_0xf3b2('0x12')]);}})[_0xf3b2('0x14')](function(_0x503110){logger['error'](_0xf3b2('0x13'),_0x4c7d55,_0x503110);_0x3b9d8d(_0x503110);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 5839e2e..9883849 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 _0x816a=['update','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','getDate','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','diskStorage','root','logologin','post','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put'];(function(_0x37e85a,_0x1a6ac3){var _0x16d51e=function(_0x1f07ed){while(--_0x1f07ed){_0x37e85a['push'](_0x37e85a['shift']());}};_0x16d51e(++_0x1a6ac3);}(_0x816a,0xce));var _0xa816=function(_0x1e96d8,_0x2a4400){_0x1e96d8=_0x1e96d8-0x0;var _0x4139e9=_0x816a[_0x1e96d8];return _0x4139e9;};'use strict';var multer=require(_0xa816('0x0'));var util=require(_0xa816('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa816('0x2'));var router=express[_0xa816('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa816('0x4'));var interaction=require(_0xa816('0x5'));var config=require(_0xa816('0x6'));var controller=require(_0xa816('0x7'));router['get']('/',auth[_0xa816('0x8')](),controller['index']);router[_0xa816('0x9')](_0xa816('0xa'),controller[_0xa816('0xb')]);router['get']('/:id',controller[_0xa816('0xc')]);router['get'](_0xa816('0xd'),controller[_0xa816('0xe')]);router[_0xa816('0x9')]('/:id/logo_login',controller[_0xa816('0xf')]);router['get'](_0xa816('0x10'),controller['gdpr']);router[_0xa816('0x9')](_0xa816('0x11'),controller[_0xa816('0x12')]);router[_0xa816('0x9')](_0xa816('0x13'),controller[_0xa816('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54ea0a,_0x4c9f9c,_0x1e720e){_0x1e720e(null,path[_0xa816('0x15')](config['root'],_0xa816('0x16')));},'filename':function(_0x511962,_0x17cad2,_0x2832f2){_0x2832f2(null,util[_0xa816('0x17')](_0xa816('0x18'),_0xa816('0x19'),path[_0xa816('0x1a')](_0x17cad2[_0xa816('0x1b')])));}})});router['post'](_0xa816('0xd'),upload[_0xa816('0x1c')](_0xa816('0x1d')),controller['addLogo']);var upload=multer({'storage':multer[_0xa816('0x1e')]({'destination':function(_0x79cec,_0x3f9b8b,_0x308047){_0x308047(null,path['join'](config[_0xa816('0x1f')],_0xa816('0x16')));},'filename':function(_0x307771,_0x4a96a6,_0x5937ae){_0x5937ae(null,util[_0xa816('0x17')](_0xa816('0x18'),_0xa816('0x20'),path[_0xa816('0x1a')](_0x4a96a6['originalname'])));}})});router[_0xa816('0x21')]('/:id/logo_login',upload[_0xa816('0x1c')](_0xa816('0x1d')),controller[_0xa816('0x22')]);var upload=multer({'storage':multer[_0xa816('0x1e')]({'destination':function(_0xb6f271,_0x24f192,_0x330489){_0x330489(null,path[_0xa816('0x15')](config[_0xa816('0x1f')],_0xa816('0x16')));},'filename':function(_0x5df544,_0x21238e,_0xb96fd0){_0xb96fd0(null,util['format'](_0xa816('0x18'),_0xa816('0x23'),path[_0xa816('0x1a')](_0x21238e['originalname'])));}})});router[_0xa816('0x21')]('/:id/preferred',upload['single']('file'),controller[_0xa816('0x24')]);var upload=multer({'storage':multer[_0xa816('0x1e')]({'destination':function(_0xd5518,_0x10d2dd,_0x1ac419){_0x1ac419(null,path[_0xa816('0x15')](config[_0xa816('0x1f')],'server/files/images/logos/'));},'filename':function(_0x27ff8c,_0x3fbeb4,_0x52d013){_0x52d013(null,util['format'](_0xa816('0x18'),_0xa816('0x25'),path['extname'](_0x3fbeb4['originalname'])));}})});router[_0xa816('0x21')](_0xa816('0x13'),upload[_0xa816('0x1c')](_0xa816('0x1d')),controller[_0xa816('0x26')]);router[_0xa816('0x27')]('/:id',auth[_0xa816('0x8')](),controller[_0xa816('0x28')]);module['exports']=router; \ No newline at end of file +var _0x053c=['file','single','addLogoLogin','preferred','post','addPreferred','favicon','put','/:id','isAuthenticated','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','getDate','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname'];(function(_0xf1175c,_0x4a27e1){var _0x5b7b4a=function(_0x1d890a){while(--_0x1d890a){_0xf1175c['push'](_0xf1175c['shift']());}};_0x5b7b4a(++_0x4a27e1);}(_0x053c,0xfc));var _0xc053=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x053c[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xc053('0x0'));var util=require(_0xc053('0x1'));var path=require(_0xc053('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc053('0x3')]();var fs_extra=require(_0xc053('0x4'));var auth=require(_0xc053('0x5'));var interaction=require(_0xc053('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xc053('0x7')]('/',auth['isAuthenticated'](),controller[_0xc053('0x8')]);router['get']('/now',controller[_0xc053('0x9')]);router[_0xc053('0x7')]('/:id',controller[_0xc053('0xa')]);router['get'](_0xc053('0xb'),controller[_0xc053('0xc')]);router['get'](_0xc053('0xd'),controller['getLogoLogin']);router[_0xc053('0x7')](_0xc053('0xe'),controller[_0xc053('0xf')]);router[_0xc053('0x7')](_0xc053('0x10'),controller[_0xc053('0x11')]);router[_0xc053('0x7')](_0xc053('0x12'),controller[_0xc053('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a5749,_0x32032e,_0x24f7fb){_0x24f7fb(null,path[_0xc053('0x14')](config[_0xc053('0x15')],_0xc053('0x16')));},'filename':function(_0x22d111,_0x2b1854,_0x54a7d0){_0x54a7d0(null,util[_0xc053('0x17')](_0xc053('0x18'),_0xc053('0x19'),path[_0xc053('0x1a')](_0x2b1854[_0xc053('0x1b')])));}})});router['post'](_0xc053('0xb'),upload['single'](_0xc053('0x1c')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55a034,_0x1468bd,_0x521734){_0x521734(null,path[_0xc053('0x14')](config[_0xc053('0x15')],_0xc053('0x16')));},'filename':function(_0x23287e,_0x5ba8b5,_0x2a45ca){_0x2a45ca(null,util[_0xc053('0x17')](_0xc053('0x18'),'logologin',path['extname'](_0x5ba8b5[_0xc053('0x1b')])));}})});router['post'](_0xc053('0xd'),upload[_0xc053('0x1d')](_0xc053('0x1c')),controller[_0xc053('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe57474,_0x47443e,_0x27e75d){_0x27e75d(null,path['join'](config[_0xc053('0x15')],_0xc053('0x16')));},'filename':function(_0xf51d6b,_0x5bd3eb,_0x29d74b){_0x29d74b(null,util['format'](_0xc053('0x18'),_0xc053('0x1f'),path[_0xc053('0x1a')](_0x5bd3eb[_0xc053('0x1b')])));}})});router[_0xc053('0x20')]('/:id/preferred',upload[_0xc053('0x1d')]('file'),controller[_0xc053('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55b3e6,_0x1c9e00,_0x4b6b47){_0x4b6b47(null,path[_0xc053('0x14')](config[_0xc053('0x15')],'server/files/images/logos/'));},'filename':function(_0x20e643,_0x7f37dd,_0x105eaa){_0x105eaa(null,util['format']('%s%s',_0xc053('0x22'),path['extname'](_0x7f37dd['originalname'])));}})});router[_0xc053('0x20')](_0xc053('0x12'),upload[_0xc053('0x1d')](_0xc053('0x1c')),controller['addFavicon']);router[_0xc053('0x23')](_0xc053('0x24'),auth[_0xc053('0x25')](),controller[_0xc053('0x26')]);module[_0xc053('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c4b37b4..085aef4 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 _0x44c2=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x1cf910,_0x5b0f64){var _0x144681=function(_0x4f0ce1){while(--_0x4f0ce1){_0x1cf910['push'](_0x1cf910['shift']());}};_0x144681(++_0x5b0f64);}(_0x44c2,0x1c6));var _0x244c=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x44c2[_0x257642];return _0x3d813b;};'use strict';var Sequelize=require(_0x244c('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x244c('0x1')](0xb),'unique':_0x244c('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x244c('0x1')](0xb),'unique':_0x244c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x244c('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x244c('0x4')],'defaultValue':_0x244c('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x244c('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x244c('0x4')]},'turnaddr':{'type':Sequelize[_0x244c('0x4')]},'turnusername':{'type':Sequelize[_0x244c('0x4')]},'turnpassword':{'type':Sequelize[_0x244c('0x4')]},'pageTitle':{'type':Sequelize[_0x244c('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x244c('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x244c('0x4')],'defaultValue':_0x244c('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x244c('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x244c('0x4')]},'defaultPreferred':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x244c('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x244c('0x4')]},'defaultFavicon':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x244c('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x244c('0x1')]},'transcribeRegion':{'type':Sequelize[_0x244c('0x4')]},'sentiment':{'type':Sequelize[_0x244c('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x244c('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x244c('0x4')]},'bucket':{'type':Sequelize[_0x244c('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x244c('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x244c('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x244c('0x1')](0x2)[_0x244c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x244c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x244c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x244c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x244c('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x244c('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5d3b=['min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','exports','INTEGER'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x5d3b,0x6e));var _0xb5d3=function(_0x44c1a3,_0x153fb1){_0x44c1a3=_0x44c1a3-0x0;var _0x4eac52=_0x5d3b[_0x44c1a3];return _0x4eac52;};'use strict';var Sequelize=require('sequelize');module[_0xb5d3('0x0')]={'min_internal':{'type':Sequelize[_0xb5d3('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb5d3('0x1')](0xb),'unique':_0xb5d3('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xb5d3('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb5d3('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb5d3('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xb5d3('0x3')]},'turnusername':{'type':Sequelize[_0xb5d3('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xb5d3('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb5d3('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb5d3('0x3')],'defaultValue':_0xb5d3('0x5')},'enableEmailPreview':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb5d3('0x3')],'defaultValue':_0xb5d3('0x6')},'chatTimeout':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb5d3('0x3')]},'defaultPreferred':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb5d3('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb5d3('0x1')]},'transcribeRegion':{'type':Sequelize[_0xb5d3('0x3')]},'sentiment':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb5d3('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xb5d3('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb5d3('0x1')](0x2)[_0xb5d3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xb5d3('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb5d3('0x1')](0x2)[_0xb5d3('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb5d3('0x1')](0x2)[_0xb5d3('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb5d3('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xb5d3('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8a7b122..57606c7 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 _0xbf83=['getPreferred','server/files/images/logos','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','stack','send','index','Setting','rawAttributes','fieldName','type','key','name','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','download','getLicense','default_loginLogo.svg','\x20not\x20found','gdpr','addPreferred'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbf83,0xf7));var _0x3bf8=function(_0x551d9a,_0x354eab){_0x551d9a=_0x551d9a-0x0;var _0x3a868b=_0xbf83[_0x551d9a];return _0x3a868b;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require(_0x3bf8('0x1'));var zipdir=require(_0x3bf8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bf8('0x3'));var moment=require('moment');var BPromise=require(_0x3bf8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bf8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3bf8('0x6'));var fs=require('fs');var fs_extra=require(_0x3bf8('0x7'));var _=require(_0x3bf8('0x8'));var squel=require('squel');var crypto=require(_0x3bf8('0x9'));var jsforce=require(_0x3bf8('0xa'));var deskjs=require(_0x3bf8('0xb'));var toCsv=require(_0x3bf8('0xc'));var querystring=require(_0x3bf8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3bf8('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bf8('0xf'));var logger=require('../../config/logger')(_0x3bf8('0x10'));var utils=require(_0x3bf8('0x11'));var config=require(_0x3bf8('0x12'));var licenseUtil=require(_0x3bf8('0x13'));var db=require(_0x3bf8('0x14'))['db'];var jayson=require(_0x3bf8('0x15'));var client=jayson[_0x3bf8('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe0e4,_0x1efead,_0x286b6e,_0x105ac7){return new BPromise(function(_0x32e414,_0x144e03){var _0x11654f=_0x105ac7||client;return _0x11654f[_0x3bf8('0x17')](_0xfe0e4,_0x286b6e)[_0x3bf8('0x18')](function(_0x175cbf){logger['info'](_0x3bf8('0x19'),_0x1efead,_0x3bf8('0x1a'));logger[_0x3bf8('0x1b')](_0x3bf8('0x1c'),_0x1efead,_0x3bf8('0x1a'),JSON['stringify'](_0x175cbf));if(_0x175cbf[_0x3bf8('0x1d')]){if(_0x175cbf[_0x3bf8('0x1d')][_0x3bf8('0x1e')]===0x1f4){logger[_0x3bf8('0x1d')](_0x3bf8('0x19'),_0x1efead,_0x175cbf[_0x3bf8('0x1d')][_0x3bf8('0x1f')]);return _0x144e03(_0x175cbf[_0x3bf8('0x1d')][_0x3bf8('0x1f')]);}logger[_0x3bf8('0x1d')](_0x3bf8('0x19'),_0x1efead,_0x175cbf[_0x3bf8('0x1d')][_0x3bf8('0x1f')]);return _0x32e414(_0x175cbf['error'][_0x3bf8('0x1f')]);}else{logger[_0x3bf8('0x20')](_0x3bf8('0x19'),_0x1efead,_0x3bf8('0x1a'));_0x32e414(_0x175cbf[_0x3bf8('0x21')][_0x3bf8('0x1f')]);}})[_0x3bf8('0x22')](function(_0x1b39ac){logger[_0x3bf8('0x1d')](_0x3bf8('0x19'),_0x1efead,_0x1b39ac);_0x144e03(_0x1b39ac);});});}function respondWithStatusCode(_0x991c85,_0x31c3ec){_0x31c3ec=_0x31c3ec||0xcc;return function(_0x3025ae){if(_0x3025ae){return _0x991c85['sendStatus'](_0x31c3ec);}return _0x991c85[_0x3bf8('0x23')](_0x31c3ec)[_0x3bf8('0x24')]();};}function respondWithResult(_0x1611fc,_0x348e23){_0x348e23=_0x348e23||0xc8;return function(_0x499a35){if(_0x499a35){return _0x1611fc[_0x3bf8('0x23')](_0x348e23)[_0x3bf8('0x25')](_0x499a35);}};}function respondWithFilteredResult(_0x584ad2,_0x534f2f){return function(_0x5a2c57){if(_0x5a2c57){var _0x1f4c49=typeof _0x534f2f[_0x3bf8('0x26')]===_0x3bf8('0x27')&&typeof _0x534f2f[_0x3bf8('0x28')]==='undefined';var _0x45897d=_0x5a2c57['count'];var _0x129a23=_0x1f4c49?0x0:_0x534f2f[_0x3bf8('0x26')];var _0x3cac97=_0x1f4c49?_0x5a2c57[_0x3bf8('0x29')]:_0x534f2f['offset']+_0x534f2f[_0x3bf8('0x28')];var _0x3d66fd;if(_0x3cac97>=_0x45897d){_0x3cac97=_0x45897d;_0x3d66fd=0xc8;}else{_0x3d66fd=0xce;}_0x584ad2[_0x3bf8('0x23')](_0x3d66fd);return _0x584ad2[_0x3bf8('0x2a')]('Content-Range',_0x129a23+'-'+_0x3cac97+'/'+_0x45897d)[_0x3bf8('0x25')](_0x5a2c57);}return null;};}function patchUpdates(_0x3f42c9){return function(_0x5844f4){try{jsonpatch[_0x3bf8('0x2b')](_0x5844f4,_0x3f42c9,!![]);}catch(_0x381b06){return BPromise[_0x3bf8('0x2c')](_0x381b06);}return _0x5844f4[_0x3bf8('0x2d')]();};}function saveUpdates(_0x2e3677,_0x890968){return function(_0xe6e29f){if(_0xe6e29f){return _0xe6e29f[_0x3bf8('0x2e')](_0x2e3677)['then'](function(_0xcfb477){return _0xcfb477;});}return null;};}function removeEntity(_0x3b0abc,_0xca3190){return function(_0xe0179a){if(_0xe0179a){return _0xe0179a['destroy']()[_0x3bf8('0x18')](function(){_0x3b0abc[_0x3bf8('0x23')](0xcc)[_0x3bf8('0x24')]();});}};}function handleEntityNotFound(_0x5056e1,_0x2f9751){return function(_0x1dbb82){if(!_0x1dbb82){_0x5056e1['sendStatus'](0x194);}return _0x1dbb82;};}function handleError(_0x692cac,_0x37bf37){_0x37bf37=_0x37bf37||0x1f4;return function(_0x2ff3a3){logger[_0x3bf8('0x1d')](_0x2ff3a3[_0x3bf8('0x2f')]);if(_0x2ff3a3['name']){delete _0x2ff3a3['name'];}_0x692cac['status'](_0x37bf37)[_0x3bf8('0x30')](_0x2ff3a3);};}exports[_0x3bf8('0x31')]=function(_0x25f801,_0x36936d){var _0x15d1fc={},_0x387e1d={},_0x34d391={'count':0x0,'rows':[]};var _0x517533=_['map'](db[_0x3bf8('0x32')][_0x3bf8('0x33')],function(_0x5533b1){return{'name':_0x5533b1[_0x3bf8('0x34')],'type':_0x5533b1[_0x3bf8('0x35')][_0x3bf8('0x36')]};});_0x387e1d['model']=_['map'](_0x517533,_0x3bf8('0x37'));_0x387e1d['query']=_[_0x3bf8('0x38')](_0x25f801['query']);_0x387e1d['filters']=_[_0x3bf8('0x39')](_0x387e1d['model'],_0x387e1d[_0x3bf8('0x3a')]);_0x15d1fc[_0x3bf8('0x3b')]=_[_0x3bf8('0x39')](_0x387e1d[_0x3bf8('0x3c')],qs[_0x3bf8('0x3d')](_0x25f801[_0x3bf8('0x3a')]['fields']));_0x15d1fc['attributes']=_0x15d1fc['attributes'][_0x3bf8('0x3e')]?_0x15d1fc[_0x3bf8('0x3b')]:_0x387e1d[_0x3bf8('0x3c')];if(!_0x25f801[_0x3bf8('0x3a')][_0x3bf8('0x3f')](_0x3bf8('0x40'))){_0x15d1fc[_0x3bf8('0x28')]=qs[_0x3bf8('0x28')](_0x25f801[_0x3bf8('0x3a')][_0x3bf8('0x28')]);_0x15d1fc[_0x3bf8('0x26')]=qs[_0x3bf8('0x26')](_0x25f801[_0x3bf8('0x3a')]['offset']);}_0x15d1fc['order']=qs[_0x3bf8('0x41')](_0x25f801[_0x3bf8('0x3a')]['sort']);_0x15d1fc[_0x3bf8('0x42')]=qs[_0x3bf8('0x43')](_[_0x3bf8('0x44')](_0x25f801[_0x3bf8('0x3a')],_0x387e1d[_0x3bf8('0x43')]),_0x517533);if(_0x25f801['query'][_0x3bf8('0x45')]){_0x15d1fc[_0x3bf8('0x42')]=_[_0x3bf8('0x46')](_0x15d1fc[_0x3bf8('0x42')],{'$or':_[_0x3bf8('0x47')](_0x517533,function(_0x227b0f){if(_0x227b0f[_0x3bf8('0x35')]!==_0x3bf8('0x48')){var _0x381492={};_0x381492[_0x227b0f['name']]={'$like':'%'+_0x25f801[_0x3bf8('0x3a')]['filter']+'%'};return _0x381492;}})});}_0x15d1fc=_['merge']({},_0x15d1fc,_0x25f801[_0x3bf8('0x49')]);var _0xb49cca={'where':_0x15d1fc[_0x3bf8('0x42')]};return db[_0x3bf8('0x32')][_0x3bf8('0x29')](_0xb49cca)['then'](function(_0x4c634f){_0x34d391[_0x3bf8('0x29')]=_0x4c634f;if(_0x25f801[_0x3bf8('0x3a')][_0x3bf8('0x4a')]){_0x15d1fc[_0x3bf8('0x4b')]=[{'all':!![]}];}return db[_0x3bf8('0x32')]['findAll'](_0x15d1fc);})[_0x3bf8('0x18')](function(_0x43bf7b){_0x34d391[_0x3bf8('0x4c')]=_0x43bf7b;return _0x34d391;})['then'](respondWithFilteredResult(_0x36936d,_0x15d1fc))['catch'](handleError(_0x36936d,null));};exports[_0x3bf8('0x4d')]=function(_0x5b169f,_0x1a6417){var _0x273303={'raw':![],'where':{'id':_0x5b169f[_0x3bf8('0x4e')]['id']}},_0xd1f5bd={};_0xd1f5bd['model']=_[_0x3bf8('0x38')](db[_0x3bf8('0x32')][_0x3bf8('0x33')]);_0xd1f5bd[_0x3bf8('0x3a')]=_['keys'](_0x5b169f[_0x3bf8('0x3a')]);_0xd1f5bd['filters']=_[_0x3bf8('0x39')](_0xd1f5bd[_0x3bf8('0x3c')],_0xd1f5bd['query']);_0x273303[_0x3bf8('0x3b')]=_[_0x3bf8('0x39')](_0xd1f5bd['model'],qs[_0x3bf8('0x3d')](_0x5b169f['query']['fields']));_0x273303[_0x3bf8('0x3b')]=_0x273303['attributes'][_0x3bf8('0x3e')]?_0x273303[_0x3bf8('0x3b')]:_0xd1f5bd[_0x3bf8('0x3c')];if(_0x5b169f[_0x3bf8('0x3a')][_0x3bf8('0x4a')]){_0x273303[_0x3bf8('0x4b')]=[{'all':!![]}];}_0x273303=_['merge']({},_0x273303,_0x5b169f[_0x3bf8('0x49')]);return db[_0x3bf8('0x32')][_0x3bf8('0x4f')](_0x273303)[_0x3bf8('0x18')](handleEntityNotFound(_0x1a6417,null))['then'](respondWithResult(_0x1a6417,null))[_0x3bf8('0x22')](handleError(_0x1a6417,null));};exports[_0x3bf8('0x2e')]=function(_0x449051,_0x548514){if(_0x449051['body']['id']){delete _0x449051[_0x3bf8('0x50')]['id'];}return db[_0x3bf8('0x32')][_0x3bf8('0x4f')]({'where':{'id':_0x449051[_0x3bf8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x548514,null))[_0x3bf8('0x18')](saveUpdates(_0x449051[_0x3bf8('0x50')],null))[_0x3bf8('0x18')](respondWithResult(_0x548514,null))['catch'](handleError(_0x548514,null));};exports[_0x3bf8('0x51')]=function(_0x425472,_0x2c8a11,_0x5f0a13){if(_0x425472[_0x3bf8('0x52')]&&_0x425472['file'][_0x3bf8('0x53')]){_0x425472['body'][_0x3bf8('0x54')]=_0x425472[_0x3bf8('0x52')][_0x3bf8('0x53')];}return db[_0x3bf8('0x32')][_0x3bf8('0x4f')]({'where':{'id':_0x425472[_0x3bf8('0x4e')]['id']}})[_0x3bf8('0x18')](handleEntityNotFound(_0x2c8a11,null))[_0x3bf8('0x18')](saveUpdates(_0x425472[_0x3bf8('0x50')],null))[_0x3bf8('0x18')](respondWithResult(_0x2c8a11,null))[_0x3bf8('0x22')](handleError(_0x2c8a11,null));};exports[_0x3bf8('0x55')]=function(_0x20a4b8,_0x44a113,_0xb60909){if(_0x20a4b8[_0x3bf8('0x52')]&&_0x20a4b8[_0x3bf8('0x52')]['filename']){_0x20a4b8[_0x3bf8('0x50')][_0x3bf8('0x56')]=_0x20a4b8['file'][_0x3bf8('0x53')];}return db[_0x3bf8('0x32')][_0x3bf8('0x4f')]({'where':{'id':_0x20a4b8['params']['id']}})['then'](handleEntityNotFound(_0x44a113,null))[_0x3bf8('0x18')](saveUpdates(_0x20a4b8['body'],null))[_0x3bf8('0x18')](respondWithResult(_0x44a113,null))['catch'](handleError(_0x44a113,null));};var utilLicense=require(_0x3bf8('0x13'));exports[_0x3bf8('0x57')]=function(_0x27b9b6,_0x12fa0,_0x366f73){var _0x557d0c='server/files/images/logos';var _0x1d344b={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2da751){if(_0x2da751){_0x1d344b=_0x2da751;}return db['Setting']['find']({'where':{'id':_0x27b9b6['params']['id']},'attributes':['logo','loginLogo',_0x3bf8('0x58'),_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d')],'raw':!![]});})[_0x3bf8('0x18')](handleEntityNotFound(_0x12fa0,null))[_0x3bf8('0x18')](function(_0x4d84e2){if(_0x4d84e2){var _0x39c077=_0x4d84e2['logo']&&fs[_0x3bf8('0x5e')](path[_0x3bf8('0x5f')](config['root'],_0x557d0c,_[_0x3bf8('0x60')](_0x4d84e2[_0x3bf8('0x54')])))?path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x557d0c,_[_0x3bf8('0x60')](_0x4d84e2['logo'])):path['join'](config[_0x3bf8('0x61')],_0x557d0c,_[_0x3bf8('0x60')](_0x3bf8('0x62')));var _0x433288=_0x3bf8('0x63')+_['upperFirst'](_0x3bf8('0x54'));if(_0x4d84e2[_0x433288]||!_0x1d344b[_0x3bf8('0x64')]){_0x39c077=path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x557d0c,_[_0x3bf8('0x60')]('default_logo.svg'));}if(!fs[_0x3bf8('0x5e')](_0x39c077)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x67')](_0x3bf8('0x54'))+'\x20not\x20found');}return _0x12fa0[_0x3bf8('0x68')](_0x39c077);}})[_0x3bf8('0x22')](handleError(_0x12fa0,null));};var utilLicense=require(_0x3bf8('0x13'));exports['getLogoLogin']=function(_0x33a19d,_0x3d27e4,_0x5b45d){var _0x5c24e2='server/files/images/logos';var _0x52a8ac={'custom':![]};return utilLicense[_0x3bf8('0x69')]()[_0x3bf8('0x18')](function(_0xfc3740){if(_0xfc3740){_0x52a8ac=_0xfc3740;}return db[_0x3bf8('0x32')][_0x3bf8('0x4f')]({'where':{'id':_0x33a19d['params']['id']},'attributes':[_0x3bf8('0x54'),'loginLogo',_0x3bf8('0x58'),_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d')],'raw':!![]});})[_0x3bf8('0x18')](handleEntityNotFound(_0x3d27e4,null))[_0x3bf8('0x18')](function(_0x14042e){if(_0x14042e){var _0x34b184=_0x14042e[_0x3bf8('0x56')]&&fs['existsSync'](path[_0x3bf8('0x5f')](config['root'],_0x5c24e2,_[_0x3bf8('0x60')](_0x14042e[_0x3bf8('0x56')])))?path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x5c24e2,_[_0x3bf8('0x60')](_0x14042e[_0x3bf8('0x56')])):path['join'](config[_0x3bf8('0x61')],_0x5c24e2,_[_0x3bf8('0x60')](_0x3bf8('0x6a')));var _0x1d924d='default'+_[_0x3bf8('0x67')](_0x3bf8('0x56'));if(_0x14042e[_0x1d924d]||!_0x52a8ac[_0x3bf8('0x64')]){_0x34b184=path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x5c24e2,_['toLower'](_0x3bf8('0x6a')));}if(!fs[_0x3bf8('0x5e')](_0x34b184)){throw new db[(_0x3bf8('0x65'))]['ValidationError'](_[_0x3bf8('0x67')](_0x3bf8('0x56'))+_0x3bf8('0x6b'));}return _0x3d27e4[_0x3bf8('0x68')](_0x34b184);}})[_0x3bf8('0x22')](handleError(_0x3d27e4,null));};exports[_0x3bf8('0x6c')]=function(_0x38e4cf,_0x3bca8c){return db['Setting'][_0x3bf8('0x4f')]({'where':{'id':_0x38e4cf['params']['id']},'attributes':['securePassword']})[_0x3bf8('0x18')](respondWithResult(_0x3bca8c,null))[_0x3bf8('0x22')](handleError(_0x3bca8c,null));};exports[_0x3bf8('0x6d')]=function(_0x365b98,_0x2ab4f3,_0x1bf925){if(_0x365b98[_0x3bf8('0x52')]&&_0x365b98['file'][_0x3bf8('0x53')]){_0x365b98[_0x3bf8('0x50')][_0x3bf8('0x58')]=_0x365b98[_0x3bf8('0x52')]['filename'];}return db[_0x3bf8('0x32')]['find']({'where':{'id':_0x365b98[_0x3bf8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2ab4f3,null))[_0x3bf8('0x18')](saveUpdates(_0x365b98['body'],null))['then'](respondWithResult(_0x2ab4f3,null))[_0x3bf8('0x22')](handleError(_0x2ab4f3,null));};var utilLicense=require(_0x3bf8('0x13'));exports[_0x3bf8('0x6e')]=function(_0xf5bbe7,_0x934a42,_0x3020b3){var _0x1e7bcb=_0x3bf8('0x6f');var _0x44006a={'custom':![]};return utilLicense[_0x3bf8('0x69')]()['then'](function(_0x471554){if(_0x471554){_0x44006a=_0x471554;}return db['Setting'][_0x3bf8('0x4f')]({'where':{'id':_0xf5bbe7['params']['id']},'attributes':[_0x3bf8('0x54'),'loginLogo',_0x3bf8('0x58'),_0x3bf8('0x59'),'defaultLogo',_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d')],'raw':!![]});})[_0x3bf8('0x18')](handleEntityNotFound(_0x934a42,null))[_0x3bf8('0x18')](function(_0x312bb6){if(_0x312bb6){var _0x386ef1=_0x312bb6[_0x3bf8('0x58')]&&fs[_0x3bf8('0x5e')](path[_0x3bf8('0x5f')](config['root'],_0x1e7bcb,_['toLower'](_0x312bb6['preferred'])))?path['join'](config['root'],_0x1e7bcb,_[_0x3bf8('0x60')](_0x312bb6['preferred'])):path[_0x3bf8('0x5f')](config['root'],_0x1e7bcb,_[_0x3bf8('0x60')]('default_preferred.png'));var _0x11083f=_0x3bf8('0x63')+_[_0x3bf8('0x67')](_0x3bf8('0x58'));if(_0x312bb6[_0x11083f]||!_0x44006a[_0x3bf8('0x64')]||!_0x44006a['preferred']){_0x386ef1=path['join'](config[_0x3bf8('0x61')],_0x1e7bcb,_[_0x3bf8('0x60')](_0x3bf8('0x70')));}if(!fs[_0x3bf8('0x5e')](_0x386ef1)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x67')]('preferred')+'\x20not\x20found');}return _0x934a42[_0x3bf8('0x68')](_0x386ef1);}})[_0x3bf8('0x22')](handleError(_0x934a42,null));};exports['addFavicon']=function(_0x5acec1,_0x4715d4,_0x3e6f76){if(_0x5acec1[_0x3bf8('0x52')]&&_0x5acec1[_0x3bf8('0x52')][_0x3bf8('0x53')]){_0x5acec1[_0x3bf8('0x50')][_0x3bf8('0x59')]=_0x5acec1[_0x3bf8('0x52')][_0x3bf8('0x53')];}return db[_0x3bf8('0x32')][_0x3bf8('0x4f')]({'where':{'id':_0x5acec1[_0x3bf8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4715d4,null))[_0x3bf8('0x18')](saveUpdates(_0x5acec1['body'],null))[_0x3bf8('0x18')](respondWithResult(_0x4715d4,null))[_0x3bf8('0x22')](handleError(_0x4715d4,null));};var utilLicense=require(_0x3bf8('0x13'));exports[_0x3bf8('0x71')]=function(_0x53bbe0,_0x29ac2c,_0x2941cc){var _0x34448a='server/files/images/logos';var _0x51cc9e={'custom':![]};return utilLicense[_0x3bf8('0x69')]()['then'](function(_0x307d5f){if(_0x307d5f){_0x51cc9e=_0x307d5f;}return db['Setting'][_0x3bf8('0x4f')]({'where':{'id':_0x53bbe0[_0x3bf8('0x4e')]['id']},'attributes':[_0x3bf8('0x54'),_0x3bf8('0x56'),_0x3bf8('0x58'),_0x3bf8('0x59'),'defaultLogo',_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d')],'raw':!![]});})[_0x3bf8('0x18')](handleEntityNotFound(_0x29ac2c,null))[_0x3bf8('0x18')](function(_0x451570){if(_0x451570){var _0x4d3528=_0x451570[_0x3bf8('0x59')]&&fs[_0x3bf8('0x5e')](path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x34448a,_[_0x3bf8('0x60')](_0x451570['favicon'])))?path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x34448a,_[_0x3bf8('0x60')](_0x451570[_0x3bf8('0x59')])):path['join'](config[_0x3bf8('0x61')],_0x34448a,_[_0x3bf8('0x60')](_0x3bf8('0x72')));var _0x1437c1='default'+_[_0x3bf8('0x67')](_0x3bf8('0x59'));if(_0x451570[_0x1437c1]||!_0x51cc9e['custom']){_0x4d3528=path[_0x3bf8('0x5f')](config[_0x3bf8('0x61')],_0x34448a,_[_0x3bf8('0x60')](_0x3bf8('0x72')));}if(!fs[_0x3bf8('0x5e')](_0x4d3528)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x67')]('favicon')+_0x3bf8('0x6b'));}return _0x29ac2c[_0x3bf8('0x68')](_0x4d3528);}})[_0x3bf8('0x22')](handleError(_0x29ac2c,null));};exports[_0x3bf8('0x73')]=function(_0x4a33a8,_0x5c87c3){var _0x42abf3={'offset':moment()['utcOffset']()};_0x42abf3[_0x3bf8('0x74')]=moment()[_0x3bf8('0x75')](_0x42abf3['offset'])['format'](_0x3bf8('0x76'));return _0x5c87c3[_0x3bf8('0x23')](0xc8)['send'](_0x42abf3);}; \ No newline at end of file +var _0x47aa=['getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultPreferred','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','stack','name','send','map','Setting','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','params','options','update','body','addLogo','file','filename','find','addLogoLogin','loginLogo'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x47aa,0x9e));var _0xa47a=function(_0x5888b6,_0x1cd36f){_0x5888b6=_0x5888b6-0x0;var _0x23621f=_0x47aa[_0x5888b6];return _0x23621f;};'use strict';var emlformat=require(_0xa47a('0x0'));var rimraf=require(_0xa47a('0x1'));var zipdir=require(_0xa47a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa47a('0x3'));var moment=require('moment');var BPromise=require(_0xa47a('0x4'));var Mustache=require(_0xa47a('0x5'));var util=require(_0xa47a('0x6'));var path=require(_0xa47a('0x7'));var sox=require(_0xa47a('0x8'));var csv=require(_0xa47a('0x9'));var ejs=require(_0xa47a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa47a('0xb'));var squel=require('squel');var crypto=require(_0xa47a('0xc'));var jsforce=require(_0xa47a('0xd'));var deskjs=require(_0xa47a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa47a('0xf'));var Papa=require(_0xa47a('0x10'));var Redis=require(_0xa47a('0x11'));var authService=require(_0xa47a('0x12'));var qs=require(_0xa47a('0x13'));var as=require(_0xa47a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa47a('0x15'));var utils=require(_0xa47a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa47a('0x17'));var db=require(_0xa47a('0x18'))['db'];var jayson=require(_0xa47a('0x19'));var client=jayson[_0xa47a('0x1a')][_0xa47a('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x799da,_0x567b0a,_0x290553,_0x59cb36){return new BPromise(function(_0x52a672,_0x235a99){var _0x4447a1=_0x59cb36||client;return _0x4447a1[_0xa47a('0x1c')](_0x799da,_0x290553)[_0xa47a('0x1d')](function(_0x3a2eb3){logger[_0xa47a('0x1e')](_0xa47a('0x1f'),_0x567b0a,'request\x20sent');logger[_0xa47a('0x20')](_0xa47a('0x21'),_0x567b0a,_0xa47a('0x22'),JSON[_0xa47a('0x23')](_0x3a2eb3));if(_0x3a2eb3['error']){if(_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x25')]===0x1f4){logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);return _0x235a99(_0x3a2eb3[_0xa47a('0x24')]['message']);}logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);return _0x52a672(_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x567b0a,_0xa47a('0x22'));_0x52a672(_0x3a2eb3[_0xa47a('0x27')][_0xa47a('0x26')]);}})[_0xa47a('0x28')](function(_0x4c701f){logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x4c701f);_0x235a99(_0x4c701f);});});}function respondWithStatusCode(_0x4b0aab,_0x456d75){_0x456d75=_0x456d75||0xcc;return function(_0x542028){if(_0x542028){return _0x4b0aab[_0xa47a('0x29')](_0x456d75);}return _0x4b0aab[_0xa47a('0x2a')](_0x456d75)[_0xa47a('0x2b')]();};}function respondWithResult(_0x12ea8c,_0x31f149){_0x31f149=_0x31f149||0xc8;return function(_0x32510f){if(_0x32510f){return _0x12ea8c['status'](_0x31f149)[_0xa47a('0x2c')](_0x32510f);}};}function respondWithFilteredResult(_0x500315,_0x2684a0){return function(_0x2e5b64){if(_0x2e5b64){var _0x1166c1=typeof _0x2684a0[_0xa47a('0x2d')]===_0xa47a('0x2e')&&typeof _0x2684a0[_0xa47a('0x2f')]===_0xa47a('0x2e');var _0xabaeb3=_0x2e5b64[_0xa47a('0x30')];var _0x5508ec=_0x1166c1?0x0:_0x2684a0[_0xa47a('0x2d')];var _0x19d70d=_0x1166c1?_0x2e5b64[_0xa47a('0x30')]:_0x2684a0[_0xa47a('0x2d')]+_0x2684a0['limit'];var _0x26b71e;if(_0x19d70d>=_0xabaeb3){_0x19d70d=_0xabaeb3;_0x26b71e=0xc8;}else{_0x26b71e=0xce;}_0x500315[_0xa47a('0x2a')](_0x26b71e);return _0x500315['set'](_0xa47a('0x31'),_0x5508ec+'-'+_0x19d70d+'/'+_0xabaeb3)['json'](_0x2e5b64);}return null;};}function patchUpdates(_0x394fec){return function(_0x52a8a7){try{jsonpatch[_0xa47a('0x32')](_0x52a8a7,_0x394fec,!![]);}catch(_0x370811){return BPromise['reject'](_0x370811);}return _0x52a8a7['save']();};}function saveUpdates(_0x1997ad,_0x1c1ecb){return function(_0x2b790a){if(_0x2b790a){return _0x2b790a['update'](_0x1997ad)[_0xa47a('0x1d')](function(_0x89c333){return _0x89c333;});}return null;};}function removeEntity(_0x3a0fa0,_0xec6e0b){return function(_0x2be74e){if(_0x2be74e){return _0x2be74e[_0xa47a('0x33')]()[_0xa47a('0x1d')](function(){_0x3a0fa0[_0xa47a('0x2a')](0xcc)[_0xa47a('0x2b')]();});}};}function handleEntityNotFound(_0x435bcf,_0x48285b){return function(_0x1c9bf6){if(!_0x1c9bf6){_0x435bcf[_0xa47a('0x29')](0x194);}return _0x1c9bf6;};}function handleError(_0x568e39,_0x1918ca){_0x1918ca=_0x1918ca||0x1f4;return function(_0x4c3dba){logger[_0xa47a('0x24')](_0x4c3dba[_0xa47a('0x34')]);if(_0x4c3dba[_0xa47a('0x35')]){delete _0x4c3dba[_0xa47a('0x35')];}_0x568e39[_0xa47a('0x2a')](_0x1918ca)[_0xa47a('0x36')](_0x4c3dba);};}exports['index']=function(_0x3a69c0,_0x3452bd){var _0x173d4d={},_0xe467ab={},_0x1b3ced={'count':0x0,'rows':[]};var _0x2f6814=_[_0xa47a('0x37')](db[_0xa47a('0x38')]['rawAttributes'],function(_0x443d3f){return{'name':_0x443d3f[_0xa47a('0x39')],'type':_0x443d3f[_0xa47a('0x3a')]['key']};});_0xe467ab[_0xa47a('0x3b')]=_[_0xa47a('0x37')](_0x2f6814,_0xa47a('0x35'));_0xe467ab['query']=_[_0xa47a('0x3c')](_0x3a69c0[_0xa47a('0x3d')]);_0xe467ab['filters']=_[_0xa47a('0x3e')](_0xe467ab[_0xa47a('0x3b')],_0xe467ab[_0xa47a('0x3d')]);_0x173d4d['attributes']=_[_0xa47a('0x3e')](_0xe467ab[_0xa47a('0x3b')],qs[_0xa47a('0x3f')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x3f')]));_0x173d4d[_0xa47a('0x40')]=_0x173d4d[_0xa47a('0x40')][_0xa47a('0x41')]?_0x173d4d[_0xa47a('0x40')]:_0xe467ab['model'];if(!_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x42')](_0xa47a('0x43'))){_0x173d4d[_0xa47a('0x2f')]=qs['limit'](_0x3a69c0['query'][_0xa47a('0x2f')]);_0x173d4d['offset']=qs[_0xa47a('0x2d')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x2d')]);}_0x173d4d[_0xa47a('0x44')]=qs[_0xa47a('0x45')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x45')]);_0x173d4d['where']=qs[_0xa47a('0x46')](_[_0xa47a('0x47')](_0x3a69c0['query'],_0xe467ab[_0xa47a('0x46')]),_0x2f6814);if(_0x3a69c0['query'][_0xa47a('0x48')]){_0x173d4d[_0xa47a('0x49')]=_['merge'](_0x173d4d[_0xa47a('0x49')],{'$or':_[_0xa47a('0x37')](_0x2f6814,function(_0x2ebf33){if(_0x2ebf33[_0xa47a('0x3a')]!==_0xa47a('0x4a')){var _0x5f1c71={};_0x5f1c71[_0x2ebf33[_0xa47a('0x35')]]={'$like':'%'+_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x48')]+'%'};return _0x5f1c71;}})});}_0x173d4d=_[_0xa47a('0x4b')]({},_0x173d4d,_0x3a69c0['options']);var _0x48ce06={'where':_0x173d4d['where']};return db[_0xa47a('0x38')][_0xa47a('0x30')](_0x48ce06)[_0xa47a('0x1d')](function(_0x335d4e){_0x1b3ced[_0xa47a('0x30')]=_0x335d4e;if(_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x4c')]){_0x173d4d[_0xa47a('0x4d')]=[{'all':!![]}];}return db['Setting'][_0xa47a('0x4e')](_0x173d4d);})['then'](function(_0x31bc78){_0x1b3ced[_0xa47a('0x4f')]=_0x31bc78;return _0x1b3ced;})[_0xa47a('0x1d')](respondWithFilteredResult(_0x3452bd,_0x173d4d))[_0xa47a('0x28')](handleError(_0x3452bd,null));};exports['show']=function(_0xd09f98,_0x22d933){var _0x509dc3={'raw':![],'where':{'id':_0xd09f98[_0xa47a('0x50')]['id']}},_0x1e7c82={};_0x1e7c82[_0xa47a('0x3b')]=_[_0xa47a('0x3c')](db['Setting']['rawAttributes']);_0x1e7c82[_0xa47a('0x3d')]=_['keys'](_0xd09f98[_0xa47a('0x3d')]);_0x1e7c82[_0xa47a('0x46')]=_[_0xa47a('0x3e')](_0x1e7c82['model'],_0x1e7c82[_0xa47a('0x3d')]);_0x509dc3[_0xa47a('0x40')]=_['intersection'](_0x1e7c82[_0xa47a('0x3b')],qs['fields'](_0xd09f98[_0xa47a('0x3d')][_0xa47a('0x3f')]));_0x509dc3[_0xa47a('0x40')]=_0x509dc3[_0xa47a('0x40')][_0xa47a('0x41')]?_0x509dc3[_0xa47a('0x40')]:_0x1e7c82[_0xa47a('0x3b')];if(_0xd09f98[_0xa47a('0x3d')][_0xa47a('0x4c')]){_0x509dc3[_0xa47a('0x4d')]=[{'all':!![]}];}_0x509dc3=_[_0xa47a('0x4b')]({},_0x509dc3,_0xd09f98[_0xa47a('0x51')]);return db['Setting']['find'](_0x509dc3)[_0xa47a('0x1d')](handleEntityNotFound(_0x22d933,null))[_0xa47a('0x1d')](respondWithResult(_0x22d933,null))[_0xa47a('0x28')](handleError(_0x22d933,null));};exports[_0xa47a('0x52')]=function(_0x3c4abb,_0x110217){if(_0x3c4abb[_0xa47a('0x53')]['id']){delete _0x3c4abb[_0xa47a('0x53')]['id'];}return db[_0xa47a('0x38')]['find']({'where':{'id':_0x3c4abb[_0xa47a('0x50')]['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x110217,null))[_0xa47a('0x1d')](saveUpdates(_0x3c4abb[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x110217,null))['catch'](handleError(_0x110217,null));};exports[_0xa47a('0x54')]=function(_0x33ed31,_0x54b81f,_0x24ae76){if(_0x33ed31[_0xa47a('0x55')]&&_0x33ed31[_0xa47a('0x55')][_0xa47a('0x56')]){_0x33ed31[_0xa47a('0x53')]['logo']=_0x33ed31[_0xa47a('0x55')]['filename'];}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0x33ed31[_0xa47a('0x50')]['id']}})['then'](handleEntityNotFound(_0x54b81f,null))[_0xa47a('0x1d')](saveUpdates(_0x33ed31[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x54b81f,null))[_0xa47a('0x28')](handleError(_0x54b81f,null));};exports[_0xa47a('0x58')]=function(_0xda4a30,_0x13c55b,_0x8b48c8){if(_0xda4a30[_0xa47a('0x55')]&&_0xda4a30[_0xa47a('0x55')][_0xa47a('0x56')]){_0xda4a30[_0xa47a('0x53')][_0xa47a('0x59')]=_0xda4a30[_0xa47a('0x55')]['filename'];}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0xda4a30['params']['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x13c55b,null))[_0xa47a('0x1d')](saveUpdates(_0xda4a30['body'],null))[_0xa47a('0x1d')](respondWithResult(_0x13c55b,null))[_0xa47a('0x28')](handleError(_0x13c55b,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x5a')]=function(_0x456131,_0xb76921,_0x1beab6){var _0x125e0c=_0xa47a('0x5b');var _0x12b2ef={'custom':![]};return utilLicense[_0xa47a('0x5c')]()['then'](function(_0x53ab29){if(_0x53ab29){_0x12b2ef=_0x53ab29;}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0x456131[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred',_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0xb76921,null))[_0xa47a('0x1d')](function(_0x390772){if(_0x390772){var _0x52e333=_0x390772[_0xa47a('0x5d')]&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x125e0c,_[_0xa47a('0x65')](_0x390772[_0xa47a('0x5d')])))?path['join'](config[_0xa47a('0x64')],_0x125e0c,_['toLower'](_0x390772['logo'])):path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x125e0c,_[_0xa47a('0x65')](_0xa47a('0x66')));var _0x1c8a9d=_0xa47a('0x67')+_[_0xa47a('0x68')]('logo');if(_0x390772[_0x1c8a9d]||!_0x12b2ef[_0xa47a('0x69')]){_0x52e333=path[_0xa47a('0x63')](config['root'],_0x125e0c,_[_0xa47a('0x65')](_0xa47a('0x66')));}if(!fs[_0xa47a('0x62')](_0x52e333)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_[_0xa47a('0x68')](_0xa47a('0x5d'))+_0xa47a('0x6c'));}return _0xb76921[_0xa47a('0x6d')](_0x52e333);}})['catch'](handleError(_0xb76921,null));};var utilLicense=require(_0xa47a('0x17'));exports[_0xa47a('0x6e')]=function(_0x16f1c3,_0x2d62aa,_0x9d047b){var _0x5184b5=_0xa47a('0x5b');var _0x414d25={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x44e84e){if(_0x44e84e){_0x414d25=_0x44e84e;}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x16f1c3[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),_0xa47a('0x6f'),'defaultLoginLogo',_0xa47a('0x70'),_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x2d62aa,null))[_0xa47a('0x1d')](function(_0x2f1fb7){if(_0x2f1fb7){var _0x42a7b9=_0x2f1fb7[_0xa47a('0x59')]&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')](_0x2f1fb7[_0xa47a('0x59')])))?path[_0xa47a('0x63')](config['root'],_0x5184b5,_[_0xa47a('0x65')](_0x2f1fb7[_0xa47a('0x59')])):path['join'](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')]('default_loginLogo.svg'));var _0x5e8dcf=_0xa47a('0x67')+_[_0xa47a('0x68')]('loginLogo');if(_0x2f1fb7[_0x5e8dcf]||!_0x414d25[_0xa47a('0x69')]){_0x42a7b9=path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')](_0xa47a('0x71')));}if(!fs[_0xa47a('0x62')](_0x42a7b9)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_['upperFirst'](_0xa47a('0x59'))+_0xa47a('0x6c'));}return _0x2d62aa[_0xa47a('0x6d')](_0x42a7b9);}})[_0xa47a('0x28')](handleError(_0x2d62aa,null));};exports[_0xa47a('0x72')]=function(_0xae9719,_0x33b255){return db[_0xa47a('0x38')]['find']({'where':{'id':_0xae9719['params']['id']},'attributes':['securePassword']})[_0xa47a('0x1d')](respondWithResult(_0x33b255,null))[_0xa47a('0x28')](handleError(_0x33b255,null));};exports[_0xa47a('0x73')]=function(_0x53a200,_0x4b3aa1,_0x13dfd4){if(_0x53a200[_0xa47a('0x55')]&&_0x53a200[_0xa47a('0x55')][_0xa47a('0x56')]){_0x53a200[_0xa47a('0x53')][_0xa47a('0x5e')]=_0x53a200[_0xa47a('0x55')][_0xa47a('0x56')];}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x53a200['params']['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x4b3aa1,null))[_0xa47a('0x1d')](saveUpdates(_0x53a200[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x4b3aa1,null))[_0xa47a('0x28')](handleError(_0x4b3aa1,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x74')]=function(_0xaead1a,_0x1f59f4,_0x3a61f0){var _0x4a7c6a=_0xa47a('0x5b');var _0x1eeb4b={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x6feb99){if(_0x6feb99){_0x1eeb4b=_0x6feb99;}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0xaead1a[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x1f59f4,null))[_0xa47a('0x1d')](function(_0x12f443){if(_0x12f443){var _0x294293=_0x12f443['preferred']&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0x12f443[_0xa47a('0x5e')])))?path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0x12f443[_0xa47a('0x5e')])):path['join'](config[_0xa47a('0x64')],_0x4a7c6a,_['toLower'](_0xa47a('0x75')));var _0x88d0da=_0xa47a('0x67')+_[_0xa47a('0x68')](_0xa47a('0x5e'));if(_0x12f443[_0x88d0da]||!_0x1eeb4b[_0xa47a('0x69')]||!_0x1eeb4b[_0xa47a('0x5e')]){_0x294293=path['join'](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0xa47a('0x75')));}if(!fs[_0xa47a('0x62')](_0x294293)){throw new db[(_0xa47a('0x6a'))]['ValidationError'](_[_0xa47a('0x68')](_0xa47a('0x5e'))+_0xa47a('0x6c'));}return _0x1f59f4[_0xa47a('0x6d')](_0x294293);}})[_0xa47a('0x28')](handleError(_0x1f59f4,null));};exports[_0xa47a('0x76')]=function(_0x52b01e,_0x24fbe5,_0x109539){if(_0x52b01e['file']&&_0x52b01e[_0xa47a('0x55')][_0xa47a('0x56')]){_0x52b01e[_0xa47a('0x53')][_0xa47a('0x5f')]=_0x52b01e[_0xa47a('0x55')][_0xa47a('0x56')];}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x52b01e[_0xa47a('0x50')]['id']}})['then'](handleEntityNotFound(_0x24fbe5,null))[_0xa47a('0x1d')](saveUpdates(_0x52b01e[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x24fbe5,null))[_0xa47a('0x28')](handleError(_0x24fbe5,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x77')]=function(_0x2d69f,_0x2b73d5,_0x55d60a){var _0x23c405='server/files/images/logos';var _0x3ff479={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x1fff6c){if(_0x1fff6c){_0x3ff479=_0x1fff6c;}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x2d69f[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred',_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x2b73d5,null))['then'](function(_0x517e0b){if(_0x517e0b){var _0x535a87=_0x517e0b['favicon']&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config['root'],_0x23c405,_[_0xa47a('0x65')](_0x517e0b[_0xa47a('0x5f')])))?path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x23c405,_[_0xa47a('0x65')](_0x517e0b['favicon'])):path[_0xa47a('0x63')](config['root'],_0x23c405,_['toLower'](_0xa47a('0x78')));var _0x32f1b9=_0xa47a('0x67')+_[_0xa47a('0x68')](_0xa47a('0x5f'));if(_0x517e0b[_0x32f1b9]||!_0x3ff479['custom']){_0x535a87=path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x23c405,_[_0xa47a('0x65')](_0xa47a('0x78')));}if(!fs['existsSync'](_0x535a87)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_[_0xa47a('0x68')](_0xa47a('0x5f'))+_0xa47a('0x6c'));}return _0x2b73d5[_0xa47a('0x6d')](_0x535a87);}})[_0xa47a('0x28')](handleError(_0x2b73d5,null));};exports[_0xa47a('0x79')]=function(_0x198f8e,_0x292676){var _0x184981={'offset':moment()[_0xa47a('0x7a')]()};_0x184981[_0xa47a('0x7b')]=moment()[_0xa47a('0x7a')](_0x184981['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x292676['status'](0xc8)[_0xa47a('0x36')](_0x184981);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4587f46..680869f 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x32f3c2,_0x1b23c0){var _0x42e3e9=function(_0x292756){while(--_0x292756){_0x32f3c2['push'](_0x32f3c2['shift']());}};_0x42e3e9(++_0x1b23c0);}(_0x34e8,0x12c));var _0x834e=function(_0x52b31c,_0x2ba10c){_0x52b31c=_0x52b31c-0x0;var _0x5498e9=_0x34e8[_0x52b31c];return _0x5498e9;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x321df4,_0x3efec5){var _0x50d06c=function(_0x3ac0f4){while(--_0x3ac0f4){_0x321df4['push'](_0x321df4['shift']());}};_0x50d06c(++_0x3efec5);}(_0x3e74,0x175));var _0x43e7=function(_0x2e0890,_0x5733bc){_0x2e0890=_0x2e0890-0x0;var _0x726ed0=_0x3e74[_0x2e0890];return _0x726ed0;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 9f962e4..f2b2b8d 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 _0x4838=['../../config/logger','rpc','../../config/environment','client','http','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Setting','find','options','raw','where','include','map','attributes','model','then','ShowSetting','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1178e2,_0x266722){var _0x1b455f=function(_0x41ca5a){while(--_0x41ca5a){_0x1178e2['push'](_0x1178e2['shift']());}};_0x1b455f(++_0x266722);}(_0x4838,0x144));var _0x8483=function(_0x1414ad,_0x4841d8){_0x1414ad=_0x1414ad-0x0;var _0x43dedc=_0x4838[_0x1414ad];return _0x43dedc;};'use strict';var _=require(_0x8483('0x0'));var util=require(_0x8483('0x1'));var moment=require(_0x8483('0x2'));var BPromise=require(_0x8483('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8483('0x4'));var db=require(_0x8483('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8483('0x6'))(_0x8483('0x7'));var config=require(_0x8483('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8483('0x9')][_0x8483('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e5553,_0x49d425,_0x4a6b74){return new BPromise(function(_0x2d0494,_0x1c085d){return client['request'](_0x4e5553,_0x4a6b74)['then'](function(_0x1fee57){logger['info'](_0x8483('0xb'),_0x49d425,_0x8483('0xc'));logger[_0x8483('0xd')](_0x8483('0xe'),_0x49d425,'request\x20sent',JSON[_0x8483('0xf')](_0x1fee57));if(_0x1fee57[_0x8483('0x10')]){if(_0x1fee57[_0x8483('0x10')][_0x8483('0x11')]===0x1f4){logger[_0x8483('0x10')](_0x8483('0xb'),_0x49d425,_0x1fee57[_0x8483('0x10')][_0x8483('0x12')]);return _0x1c085d(_0x1fee57[_0x8483('0x10')][_0x8483('0x12')]);}logger['error'](_0x8483('0xb'),_0x49d425,_0x1fee57[_0x8483('0x10')][_0x8483('0x12')]);return _0x2d0494(_0x1fee57[_0x8483('0x10')][_0x8483('0x12')]);}else{logger[_0x8483('0x13')]('Setting,\x20%s,\x20%s',_0x49d425,'request\x20sent');_0x2d0494(_0x1fee57[_0x8483('0x14')][_0x8483('0x12')]);}})[_0x8483('0x15')](function(_0x5d76f3){logger[_0x8483('0x10')](_0x8483('0xb'),_0x49d425,_0x5d76f3);_0x1c085d(_0x5d76f3);});});}exports['ShowSetting']=function(_0x4805fd){var _0x50db2d=this;return new Promise(function(_0x2dd280,_0x57ffdf){return db[_0x8483('0x16')][_0x8483('0x17')]({'raw':_0x4805fd[_0x8483('0x18')]?_0x4805fd[_0x8483('0x18')][_0x8483('0x19')]===undefined?!![]:![]:!![],'where':_0x4805fd[_0x8483('0x18')]?_0x4805fd[_0x8483('0x18')][_0x8483('0x1a')]||null:null,'attributes':_0x4805fd['options']?_0x4805fd[_0x8483('0x18')]['attributes']||null:null,'include':_0x4805fd['options']?_0x4805fd[_0x8483('0x18')][_0x8483('0x1b')]?_[_0x8483('0x1c')](_0x4805fd[_0x8483('0x18')]['include'],function(_0x548ae7){return{'model':db[_0x548ae7['model']],'as':_0x548ae7['as'],'attributes':_0x548ae7[_0x8483('0x1d')],'include':_0x548ae7[_0x8483('0x1b')]?_['map'](_0x548ae7[_0x8483('0x1b')],function(_0x412c20){return{'model':db[_0x412c20[_0x8483('0x1e')]],'as':_0x412c20['as'],'attributes':_0x412c20['attributes'],'include':_0x412c20[_0x8483('0x1b')]?_[_0x8483('0x1c')](_0x412c20[_0x8483('0x1b')],function(_0x3c31a1){return{'model':db[_0x3c31a1['model']],'as':_0x3c31a1['as'],'attributes':_0x3c31a1[_0x8483('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8483('0x1f')](function(_0x42a684){logger[_0x8483('0x13')](_0x8483('0x20'),_0x4805fd);logger[_0x8483('0xd')](_0x8483('0x20'),_0x4805fd,JSON[_0x8483('0xf')](_0x42a684));_0x2dd280(_0x42a684);})['catch'](function(_0x44a3ef){logger[_0x8483('0x10')](_0x8483('0x20'),_0x44a3ef[_0x8483('0x12')],_0x4805fd);_0x57ffdf(_0x50db2d[_0x8483('0x10')](0x1f4,_0x44a3ef[_0x8483('0x12')]));});});}; \ No newline at end of file +var _0x0082=['info','ShowSetting','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','Setting','options','include','model','attributes','map'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x0082,0x111));var _0x2008=function(_0x14e6eb,_0x12864f){_0x14e6eb=_0x14e6eb-0x0;var _0x517ddf=_0x0082[_0x14e6eb];return _0x517ddf;};'use strict';var _=require(_0x2008('0x0'));var util=require('util');var moment=require(_0x2008('0x1'));var BPromise=require(_0x2008('0x2'));var rs=require(_0x2008('0x3'));var fs=require('fs');var Redis=require(_0x2008('0x4'));var db=require(_0x2008('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2008('0x6'))(_0x2008('0x7'));var config=require(_0x2008('0x8'));var jayson=require(_0x2008('0x9'));var client=jayson[_0x2008('0xa')][_0x2008('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36c8be,_0x1f980d,_0x22c74a){return new BPromise(function(_0x396df8,_0x6c83b6){return client['request'](_0x36c8be,_0x22c74a)[_0x2008('0xc')](function(_0x5a74ce){logger['info'](_0x2008('0xd'),_0x1f980d,'request\x20sent');logger[_0x2008('0xe')](_0x2008('0xf'),_0x1f980d,_0x2008('0x10'),JSON['stringify'](_0x5a74ce));if(_0x5a74ce[_0x2008('0x11')]){if(_0x5a74ce[_0x2008('0x11')]['code']===0x1f4){logger['error'](_0x2008('0xd'),_0x1f980d,_0x5a74ce[_0x2008('0x11')][_0x2008('0x12')]);return _0x6c83b6(_0x5a74ce[_0x2008('0x11')][_0x2008('0x12')]);}logger[_0x2008('0x11')](_0x2008('0xd'),_0x1f980d,_0x5a74ce[_0x2008('0x11')]['message']);return _0x396df8(_0x5a74ce['error'][_0x2008('0x12')]);}else{logger['info'](_0x2008('0xd'),_0x1f980d,_0x2008('0x10'));_0x396df8(_0x5a74ce[_0x2008('0x13')][_0x2008('0x12')]);}})[_0x2008('0x14')](function(_0x41b2d1){logger[_0x2008('0x11')](_0x2008('0xd'),_0x1f980d,_0x41b2d1);_0x6c83b6(_0x41b2d1);});});}exports['ShowSetting']=function(_0x397a92){var _0x18da16=this;return new Promise(function(_0x240f1f,_0x47c929){return db[_0x2008('0x15')]['find']({'raw':_0x397a92[_0x2008('0x16')]?_0x397a92[_0x2008('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x397a92[_0x2008('0x16')]?_0x397a92[_0x2008('0x16')]['where']||null:null,'attributes':_0x397a92['options']?_0x397a92[_0x2008('0x16')]['attributes']||null:null,'include':_0x397a92[_0x2008('0x16')]?_0x397a92[_0x2008('0x16')][_0x2008('0x17')]?_['map'](_0x397a92['options'][_0x2008('0x17')],function(_0x1e0f5c){return{'model':db[_0x1e0f5c[_0x2008('0x18')]],'as':_0x1e0f5c['as'],'attributes':_0x1e0f5c[_0x2008('0x19')],'include':_0x1e0f5c[_0x2008('0x17')]?_['map'](_0x1e0f5c[_0x2008('0x17')],function(_0xc9ada5){return{'model':db[_0xc9ada5[_0x2008('0x18')]],'as':_0xc9ada5['as'],'attributes':_0xc9ada5[_0x2008('0x19')],'include':_0xc9ada5[_0x2008('0x17')]?_[_0x2008('0x1a')](_0xc9ada5[_0x2008('0x17')],function(_0xf957cc){return{'model':db[_0xf957cc['model']],'as':_0xf957cc['as'],'attributes':_0xf957cc[_0x2008('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e0322){logger[_0x2008('0x1b')](_0x2008('0x1c'),_0x397a92);logger[_0x2008('0xe')](_0x2008('0x1c'),_0x397a92,JSON[_0x2008('0x1d')](_0x5e0322));_0x240f1f(_0x5e0322);})[_0x2008('0x14')](function(_0x632548){logger[_0x2008('0x11')](_0x2008('0x1c'),_0x632548[_0x2008('0x12')],_0x397a92);_0x47c929(_0x18da16[_0x2008('0x11')](0x1f4,_0x632548[_0x2008('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 271b2be..041ee59 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x47e55f,_0x3ba3eb){var _0x5778f5=function(_0x57eda7){while(--_0x57eda7){_0x47e55f['push'](_0x47e55f['shift']());}};_0x5778f5(++_0x3ba3eb);}(_0x7a54,0x106));var _0x47a5=function(_0x2acc0a,_0x5af93f){_0x2acc0a=_0x2acc0a-0x0;var _0x4fc1ae=_0x7a54[_0x2acc0a];return _0x4fc1ae;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x328305,_0x19098d){var _0xf0347=function(_0xa391c1){while(--_0xa391c1){_0x328305['push'](_0x328305['shift']());}};_0xf0347(++_0x19098d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a4e3551..282653e 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 _0x0fd8=['STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','name'];(function(_0x150e27,_0x37aa51){var _0x437f5c=function(_0x4c8837){while(--_0x4c8837){_0x150e27['push'](_0x150e27['shift']());}};_0x437f5c(++_0x37aa51);}(_0x0fd8,0x90));var _0x80fd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0fd8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x80fd('0x0'));var rs=require(_0x80fd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x80fd('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x80fd('0x3')],'defaultValue':function(){return rs[_0x80fd('0x4')]();}},'phone':{'type':Sequelize[_0x80fd('0x3')]},'type':{'type':Sequelize[_0x80fd('0x5')](_0x80fd('0x6'),_0x80fd('0x7'),_0x80fd('0x8'),_0x80fd('0x9'),_0x80fd('0xa'),_0x80fd('0xb'),'bandwidth',_0x80fd('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x80fd('0x3')]},'authId':{'type':Sequelize[_0x80fd('0x3')]},'authToken':{'type':Sequelize[_0x80fd('0x3')]},'smsMethod':{'type':Sequelize[_0x80fd('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x80fd('0x3')]},'password':{'type':Sequelize[_0x80fd('0x3')]},'apiKey':{'type':Sequelize[_0x80fd('0x3')]},'applicationId':{'type':Sequelize[_0x80fd('0x3')]},'accountId':{'type':Sequelize[_0x80fd('0x3')]},'senderString':{'type':Sequelize[_0x80fd('0x3')]},'deliveryReport':{'type':Sequelize[_0x80fd('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x80fd('0x3')]},'notificationTemplate':{'type':Sequelize[_0x80fd('0xe')],'defaultValue':function(){return _0x80fd('0xf');}},'notificationSound':{'type':Sequelize[_0x80fd('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x80fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x80fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x80fd('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x80fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x80fd('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x80fd('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x80fd('0x10')],'comment':_0x80fd('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x80fd('0xd')],'defaultValue':![],'comment':_0x80fd('0x12'),'set':function(_0x2f1a74){if(!_0x2f1a74)this[_0x80fd('0x13')]('mandatoryDispositionPauseId',null);this[_0x80fd('0x13')](_0x80fd('0x14'),_0x2f1a74);}}}; \ No newline at end of file +var _0xcf87=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xcf87,0x10d));var _0x7cf8=function(_0x1fccde,_0x135012){_0x1fccde=_0x1fccde-0x0;var _0x30ea0d=_0xcf87[_0x1fccde];return _0x30ea0d;};'use strict';var Sequelize=require(_0x7cf8('0x0'));var rs=require(_0x7cf8('0x1'));module[_0x7cf8('0x2')]={'name':{'type':Sequelize[_0x7cf8('0x3')],'unique':_0x7cf8('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x7cf8('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7cf8('0x3')],'defaultValue':function(){return rs[_0x7cf8('0x5')]();}},'phone':{'type':Sequelize[_0x7cf8('0x3')]},'type':{'type':Sequelize[_0x7cf8('0x6')]('twilio',_0x7cf8('0x7'),_0x7cf8('0x8'),_0x7cf8('0x9'),_0x7cf8('0xa'),'clickatell','bandwidth',_0x7cf8('0xb'),_0x7cf8('0xc'),_0x7cf8('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7cf8('0x3')]},'smsMethod':{'type':Sequelize[_0x7cf8('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7cf8('0x3')]},'password':{'type':Sequelize[_0x7cf8('0x3')]},'apiKey':{'type':Sequelize[_0x7cf8('0x3')]},'applicationId':{'type':Sequelize[_0x7cf8('0x3')]},'accountId':{'type':Sequelize[_0x7cf8('0x3')]},'senderString':{'type':Sequelize[_0x7cf8('0x3')]},'deliveryReport':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x7cf8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7cf8('0xf')],'defaultValue':function(){return _0x7cf8('0x10');}},'notificationSound':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7cf8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7cf8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7cf8('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7cf8('0x11')],'comment':_0x7cf8('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x7cf8('0xe')],'defaultValue':![],'comment':_0x7cf8('0x13'),'set':function(_0x33b668){if(!_0x33b668)this[_0x7cf8('0x14')]('mandatoryDispositionPauseId',null);this[_0x7cf8('0x14')](_0x7cf8('0x15'),_0x33b668);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e731cc2..dd69d83 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 _0x304a=['count','offset','limit','set','Content-Range','apply','save','update','then','destroy','SmsAccounts','UserProfileResource','stack','name','index','Pause','SmsAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','catch','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','twilio','messageId','MessageSid','skebby','text','connectel','from','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','send','addApplications','sequelize','transaction','Transaction','bulkCreate','findAndCountAll','nolimit','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','end','status','json','undefined'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x304a,0xbf));var _0xa304=function(_0x6b90fa,_0x1e910e){_0x6b90fa=_0x6b90fa-0x0;var _0x20d515=_0x304a[_0x6b90fa];return _0x20d515;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa304('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa304('0x1'));var rp=require(_0xa304('0x2'));var moment=require(_0xa304('0x3'));var BPromise=require(_0xa304('0x4'));var Mustache=require('mustache');var util=require(_0xa304('0x5'));var path=require(_0xa304('0x6'));var sox=require(_0xa304('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('squel');var crypto=require(_0xa304('0x8'));var jsforce=require(_0xa304('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa304('0xa'));var querystring=require('querystring');var Papa=require(_0xa304('0xb'));var Redis=require(_0xa304('0xc'));var authService=require(_0xa304('0xd'));var qs=require(_0xa304('0xe'));var as=require(_0xa304('0xf'));var hardwareService=require(_0xa304('0x10'));var logger=require(_0xa304('0x11'))(_0xa304('0x12'));var utils=require(_0xa304('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa304('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa304('0x15')](config[_0xa304('0x16')],{'host':_0xa304('0x17'),'port':0x18eb});var socket=require(_0xa304('0x18'))(new Redis(config[_0xa304('0x16')]));require(_0xa304('0x19'))[_0xa304('0x1a')](socket);var jayson=require(_0xa304('0x1b'));var client=jayson['client'][_0xa304('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1bbca2,_0x322bbd,_0x3fddd8,_0x56f919){return new BPromise(function(_0x30e88d,_0x2aa3f5){var _0x72a7c0=_0x56f919||client;return _0x72a7c0['request'](_0x1bbca2,_0x3fddd8)['then'](function(_0xb12ee1){logger[_0xa304('0x1d')](_0xa304('0x1e'),_0x322bbd,'request\x20sent');logger[_0xa304('0x1f')](_0xa304('0x20'),_0x322bbd,_0xa304('0x21'),JSON['stringify'](_0xb12ee1));if(_0xb12ee1[_0xa304('0x22')]){if(_0xb12ee1[_0xa304('0x22')]['code']===0x1f4){logger['error'](_0xa304('0x1e'),_0x322bbd,_0xb12ee1[_0xa304('0x22')][_0xa304('0x23')]);return _0x2aa3f5(_0xb12ee1['error'][_0xa304('0x23')]);}logger[_0xa304('0x22')](_0xa304('0x1e'),_0x322bbd,_0xb12ee1[_0xa304('0x22')][_0xa304('0x23')]);return _0x30e88d(_0xb12ee1[_0xa304('0x22')]['message']);}else{logger[_0xa304('0x1d')](_0xa304('0x1e'),_0x322bbd,'request\x20sent');_0x30e88d(_0xb12ee1[_0xa304('0x24')][_0xa304('0x23')]);}})['catch'](function(_0x3f5afa){logger[_0xa304('0x22')]('SmsAccount,\x20%s,\x20%s',_0x322bbd,_0x3f5afa);_0x2aa3f5(_0x3f5afa);});});}function respondWithStatusCode(_0x44bf64,_0x238b4e){_0x238b4e=_0x238b4e||0xcc;return function(_0x473f4d){if(_0x473f4d){return _0x44bf64[_0xa304('0x25')](_0x238b4e);}return _0x44bf64['status'](_0x238b4e)[_0xa304('0x26')]();};}function respondWithResult(_0x5993b7,_0x5efccc){_0x5efccc=_0x5efccc||0xc8;return function(_0x5028c3){if(_0x5028c3){return _0x5993b7[_0xa304('0x27')](_0x5efccc)[_0xa304('0x28')](_0x5028c3);}};}function respondWithFilteredResult(_0x5efc7c,_0x3587e4){return function(_0x2a88fc){if(_0x2a88fc){var _0x523369=typeof _0x3587e4['offset']===_0xa304('0x29')&&typeof _0x3587e4['limit']===_0xa304('0x29');var _0x5d526d=_0x2a88fc[_0xa304('0x2a')];var _0x13ef01=_0x523369?0x0:_0x3587e4['offset'];var _0x2fdf84=_0x523369?_0x2a88fc[_0xa304('0x2a')]:_0x3587e4[_0xa304('0x2b')]+_0x3587e4[_0xa304('0x2c')];var _0x4c6aea;if(_0x2fdf84>=_0x5d526d){_0x2fdf84=_0x5d526d;_0x4c6aea=0xc8;}else{_0x4c6aea=0xce;}_0x5efc7c[_0xa304('0x27')](_0x4c6aea);return _0x5efc7c[_0xa304('0x2d')](_0xa304('0x2e'),_0x13ef01+'-'+_0x2fdf84+'/'+_0x5d526d)[_0xa304('0x28')](_0x2a88fc);}return null;};}function patchUpdates(_0x4e38ee){return function(_0x27f320){try{jsonpatch[_0xa304('0x2f')](_0x27f320,_0x4e38ee,!![]);}catch(_0x1da988){return BPromise['reject'](_0x1da988);}return _0x27f320[_0xa304('0x30')]();};}function saveUpdates(_0x306b51,_0x55004a){return function(_0xe7a169){if(_0xe7a169){return _0xe7a169[_0xa304('0x31')](_0x306b51)[_0xa304('0x32')](function(_0x140341){return _0x140341;});}return null;};}function removeEntity(_0x1a0466,_0x3a25df){return function(_0x469d57){if(_0x469d57){return _0x469d57[_0xa304('0x33')]()[_0xa304('0x32')](function(){var _0x2b89b3=_0x469d57['get']({'plain':!![]});var _0xbbc30=_0xa304('0x34');return db[_0xa304('0x35')][_0xa304('0x33')]({'where':{'type':_0xbbc30,'resourceId':_0x2b89b3['id']}})[_0xa304('0x32')](function(){return _0x469d57;});})[_0xa304('0x32')](function(){_0x1a0466[_0xa304('0x27')](0xcc)[_0xa304('0x26')]();});}};}function handleEntityNotFound(_0x5a6eee,_0x2580e4){return function(_0x2ce3bc){if(!_0x2ce3bc){_0x5a6eee[_0xa304('0x25')](0x194);}return _0x2ce3bc;};}function handleError(_0x144450,_0x114229){_0x114229=_0x114229||0x1f4;return function(_0x4d1e49){logger['error'](_0x4d1e49[_0xa304('0x36')]);if(_0x4d1e49[_0xa304('0x37')]){delete _0x4d1e49[_0xa304('0x37')];}_0x144450[_0xa304('0x27')](_0x114229)['send'](_0x4d1e49);};}exports[_0xa304('0x38')]=function(_0x8f206d,_0x514c92){var _0x266b8b={'include':[{'model':db[_0xa304('0x39')],'as':'mandatoryDispositionPause'}]},_0x537b03={},_0x217619={'count':0x0,'rows':[]};var _0x27bd31=_['map'](db[_0xa304('0x3a')][_0xa304('0x3b')],function(_0x34459f){return{'name':_0x34459f[_0xa304('0x3c')],'type':_0x34459f[_0xa304('0x3d')]['key']};});_0x537b03[_0xa304('0x3e')]=_[_0xa304('0x3f')](_0x27bd31,_0xa304('0x37'));_0x537b03[_0xa304('0x40')]=_[_0xa304('0x41')](_0x8f206d[_0xa304('0x40')]);_0x537b03[_0xa304('0x42')]=_['intersection'](_0x537b03[_0xa304('0x3e')],_0x537b03[_0xa304('0x40')]);_0x266b8b['attributes']=_[_0xa304('0x43')](_0x537b03[_0xa304('0x3e')],qs[_0xa304('0x44')](_0x8f206d['query'][_0xa304('0x44')]));_0x266b8b[_0xa304('0x45')]=_0x266b8b['attributes'][_0xa304('0x46')]?_0x266b8b[_0xa304('0x45')]:_0x537b03['model'];if(!_0x8f206d['query']['hasOwnProperty']('nolimit')){_0x266b8b[_0xa304('0x2c')]=qs['limit'](_0x8f206d[_0xa304('0x40')]['limit']);_0x266b8b[_0xa304('0x2b')]=qs[_0xa304('0x2b')](_0x8f206d['query'][_0xa304('0x2b')]);}_0x266b8b[_0xa304('0x47')]=qs[_0xa304('0x48')](_0x8f206d[_0xa304('0x40')][_0xa304('0x48')]);_0x266b8b[_0xa304('0x49')]=qs[_0xa304('0x42')](_[_0xa304('0x4a')](_0x8f206d[_0xa304('0x40')],_0x537b03[_0xa304('0x42')]),_0x27bd31);if(_0x8f206d['query'][_0xa304('0x4b')]){_0x266b8b[_0xa304('0x49')]=_[_0xa304('0x4c')](_0x266b8b['where'],{'$or':_[_0xa304('0x3f')](_0x27bd31,function(_0x29fe3c){if(_0x29fe3c['type']!==_0xa304('0x4d')){var _0x85f7c4={};_0x85f7c4[_0x29fe3c[_0xa304('0x37')]]={'$like':'%'+_0x8f206d['query'][_0xa304('0x4b')]+'%'};return _0x85f7c4;}})});}_0x266b8b=_[_0xa304('0x4c')]({},_0x266b8b,_0x8f206d[_0xa304('0x4e')]);var _0x3a4c85={'where':_0x266b8b['where']};return db[_0xa304('0x3a')][_0xa304('0x2a')](_0x3a4c85)['then'](function(_0x9ea3d9){_0x217619['count']=_0x9ea3d9;if(_0x8f206d[_0xa304('0x40')][_0xa304('0x4f')]){_0x266b8b[_0xa304('0x50')]=[{'all':!![]}];}return db[_0xa304('0x3a')][_0xa304('0x51')](_0x266b8b);})[_0xa304('0x32')](function(_0x535f0c){_0x217619[_0xa304('0x52')]=_0x535f0c;return _0x217619;})['then'](respondWithFilteredResult(_0x514c92,_0x266b8b))['catch'](handleError(_0x514c92,null));};exports[_0xa304('0x53')]=function(_0x19a07f,_0x301fcc){var _0x35bd19={'raw':![],'where':{'id':_0x19a07f[_0xa304('0x54')]['id']},'include':[{'model':db[_0xa304('0x39')],'as':_0xa304('0x55')}]},_0x423f24={};_0x423f24[_0xa304('0x3e')]=_[_0xa304('0x41')](db[_0xa304('0x3a')]['rawAttributes']);_0x423f24['query']=_[_0xa304('0x41')](_0x19a07f[_0xa304('0x40')]);_0x423f24[_0xa304('0x42')]=_[_0xa304('0x43')](_0x423f24['model'],_0x423f24[_0xa304('0x40')]);_0x35bd19['attributes']=_[_0xa304('0x43')](_0x423f24['model'],qs[_0xa304('0x44')](_0x19a07f[_0xa304('0x40')][_0xa304('0x44')]));_0x35bd19[_0xa304('0x45')]=_0x35bd19[_0xa304('0x45')]['length']?_0x35bd19[_0xa304('0x45')]:_0x423f24[_0xa304('0x3e')];if(_0x19a07f[_0xa304('0x40')][_0xa304('0x4f')]){_0x35bd19[_0xa304('0x50')]=[{'all':!![]}];}_0x35bd19=_[_0xa304('0x4c')]({},_0x35bd19,_0x19a07f[_0xa304('0x4e')]);return db[_0xa304('0x3a')][_0xa304('0x56')](_0x35bd19)[_0xa304('0x32')](handleEntityNotFound(_0x301fcc,null))['then'](respondWithResult(_0x301fcc,null))[_0xa304('0x57')](handleError(_0x301fcc,null));};exports['create']=function(_0x29cfaf,_0x3725dc){return db[_0xa304('0x3a')][_0xa304('0x58')](_0x29cfaf[_0xa304('0x59')],{})['then'](function(_0x47f4cf){var _0x22e095=_0x29cfaf[_0xa304('0x5a')][_0xa304('0x5b')]({'plain':!![]});if(!_0x22e095)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e095[_0xa304('0x5c')]===_0xa304('0x5a')){var _0xc73947=_0x47f4cf['get']({'plain':!![]});var _0x158b34=_0xa304('0x34');return db[_0xa304('0x5d')][_0xa304('0x56')]({'where':{'name':_0x158b34,'userProfileId':_0x22e095['userProfileId']},'raw':!![]})[_0xa304('0x32')](function(_0x2e99f4){if(_0x2e99f4&&_0x2e99f4[_0xa304('0x5e')]===0x0){return db['UserProfileResource'][_0xa304('0x58')]({'name':_0xc73947[_0xa304('0x37')],'resourceId':_0xc73947['id'],'type':_0x2e99f4[_0xa304('0x37')],'sectionId':_0x2e99f4['id']},{})['then'](function(){return _0x47f4cf;});}else{return _0x47f4cf;}})[_0xa304('0x57')](function(_0x4c0559){logger[_0xa304('0x22')](_0xa304('0x5f'),_0x4c0559);throw _0x4c0559;});}return _0x47f4cf;})[_0xa304('0x32')](respondWithResult(_0x3725dc,0xc9))[_0xa304('0x57')](handleError(_0x3725dc,null));};exports[_0xa304('0x31')]=function(_0x201f57,_0x1e4521){if(_0x201f57[_0xa304('0x59')]['id']){delete _0x201f57['body']['id'];}return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x201f57[_0xa304('0x54')]['id']},'include':[{'model':db[_0xa304('0x39')],'as':_0xa304('0x55')}]})[_0xa304('0x32')](handleEntityNotFound(_0x1e4521,null))[_0xa304('0x32')](saveUpdates(_0x201f57[_0xa304('0x59')],null))[_0xa304('0x32')](respondWithResult(_0x1e4521,null))['catch'](handleError(_0x1e4521,null));};exports['destroy']=function(_0x15700d,_0x51a573){return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x15700d[_0xa304('0x54')]['id']}})['then'](handleEntityNotFound(_0x51a573,null))[_0xa304('0x32')](removeEntity(_0x51a573,null))[_0xa304('0x57')](handleError(_0x51a573,null));};exports[_0xa304('0x60')]=function(_0x2a6d7f,_0x50bee0){return db[_0xa304('0x3a')]['describe']()[_0xa304('0x32')](respondWithResult(_0x50bee0,null))[_0xa304('0x57')](handleError(_0x50bee0,null));};exports['addDisposition']=function(_0x28ef5f,_0x10c633,_0x343c1f){if(_0x28ef5f[_0xa304('0x59')]['id']){delete _0x28ef5f['body']['id'];}return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x28ef5f[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x10c633,null))[_0xa304('0x32')](function(_0x27340e){if(_0x27340e){_0x28ef5f['body'][_0xa304('0x61')]=_0x27340e['id'];return db['Disposition'][_0xa304('0x58')](_0x28ef5f['body']);}})[_0xa304('0x32')](respondWithResult(_0x10c633,null))['catch'](handleError(_0x10c633,null));};exports[_0xa304('0x62')]=function(_0x2f1cfc,_0x49233e,_0xdc4ae3){var _0x5afa18={'raw':![],'where':{}};var _0x1e1c39={};var _0x1eeca2={'count':0x0,'rows':[]};return db[_0xa304('0x3a')][_0xa304('0x63')]({'where':{'id':_0x2f1cfc['params']['id']}})['then'](handleEntityNotFound(_0x49233e,null))[_0xa304('0x32')](function(_0x1300ae){if(_0x1300ae){_0x1e1c39[_0xa304('0x3e')]=_[_0xa304('0x41')](db[_0xa304('0x64')][_0xa304('0x3b')]);_0x1e1c39[_0xa304('0x40')]=_[_0xa304('0x41')](_0x2f1cfc['query']);_0x1e1c39[_0xa304('0x42')]=_[_0xa304('0x43')](_0x1e1c39[_0xa304('0x3e')],_0x1e1c39[_0xa304('0x40')]);_0x5afa18[_0xa304('0x45')]=_['intersection'](_0x1e1c39[_0xa304('0x3e')],qs[_0xa304('0x44')](_0x2f1cfc[_0xa304('0x40')][_0xa304('0x44')]));_0x5afa18[_0xa304('0x45')]=_0x5afa18['attributes'][_0xa304('0x46')]?_0x5afa18['attributes']:_0x1e1c39[_0xa304('0x3e')];if(!_0x2f1cfc[_0xa304('0x40')][_0xa304('0x65')]('nolimit')){_0x5afa18['limit']=qs[_0xa304('0x2c')](_0x2f1cfc['query']['limit']);_0x5afa18['offset']=qs[_0xa304('0x2b')](_0x2f1cfc['query'][_0xa304('0x2b')]);}_0x5afa18[_0xa304('0x47')]=qs['sort'](_0x2f1cfc[_0xa304('0x40')]['sort']);_0x5afa18[_0xa304('0x49')]=qs[_0xa304('0x42')](_[_0xa304('0x4a')](_0x2f1cfc[_0xa304('0x40')],_0x1e1c39[_0xa304('0x42')]));_0x5afa18[_0xa304('0x49')]['SmsAccountId']=_0x1300ae['id'];if(_0x2f1cfc['query'][_0xa304('0x4b')]){_0x5afa18[_0xa304('0x49')]=_[_0xa304('0x4c')](_0x5afa18[_0xa304('0x49')],{'$or':_[_0xa304('0x3f')](_0x5afa18['attributes'],function(_0x3acbbd){var _0x5bac80={};_0x5bac80[_0x3acbbd]={'$like':'%'+_0x2f1cfc[_0xa304('0x40')][_0xa304('0x4b')]+'%'};return _0x5bac80;})});}_0x5afa18=_['merge']({},_0x5afa18,_0x2f1cfc[_0xa304('0x4e')]);return db[_0xa304('0x64')][_0xa304('0x2a')]({'where':_0x5afa18[_0xa304('0x49')]})[_0xa304('0x32')](function(_0x360438){_0x1eeca2[_0xa304('0x2a')]=_0x360438;if(_0x2f1cfc[_0xa304('0x40')][_0xa304('0x4f')]){_0x5afa18['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5afa18);})['then'](function(_0x303f5b){_0x1eeca2[_0xa304('0x52')]=_0x303f5b;return _0x1eeca2;});}})['then'](respondWithFilteredResult(_0x49233e,_0x5afa18))[_0xa304('0x57')](handleError(_0x49233e,null));};exports[_0xa304('0x66')]=function(_0x17a100,_0x4954e9,_0x3c8c83){return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x17a100[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x4954e9,null))[_0xa304('0x32')](function(_0x10c361){if(_0x10c361){return _0x10c361[_0xa304('0x66')](_0x17a100[_0xa304('0x40')][_0xa304('0x67')]);}})[_0xa304('0x32')](respondWithStatusCode(_0x4954e9,null))['catch'](handleError(_0x4954e9,null));};exports[_0xa304('0x68')]=function(_0x1eddae,_0x359dd6,_0x5e75a3){if(_0x1eddae['body']['id']){delete _0x1eddae[_0xa304('0x59')]['id'];}return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x1eddae['params']['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x359dd6,null))[_0xa304('0x32')](function(_0x140557){if(_0x140557){_0x1eddae[_0xa304('0x59')][_0xa304('0x61')]=_0x140557['id'];return db[_0xa304('0x69')][_0xa304('0x58')](_0x1eddae[_0xa304('0x59')]);}})[_0xa304('0x32')](respondWithResult(_0x359dd6,null))[_0xa304('0x57')](handleError(_0x359dd6,null));};exports[_0xa304('0x6a')]=function(_0x389f63,_0x222ccf,_0x549d9e){var _0x595792={'raw':![],'where':{}};var _0xb84bb8={};var _0x4a329b={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa304('0x63')]({'where':{'id':_0x389f63[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x222ccf,null))[_0xa304('0x32')](function(_0x2ba99d){if(_0x2ba99d){_0xb84bb8[_0xa304('0x3e')]=_[_0xa304('0x41')](db[_0xa304('0x69')][_0xa304('0x3b')]);_0xb84bb8[_0xa304('0x40')]=_[_0xa304('0x41')](_0x389f63[_0xa304('0x40')]);_0xb84bb8[_0xa304('0x42')]=_['intersection'](_0xb84bb8[_0xa304('0x3e')],_0xb84bb8[_0xa304('0x40')]);_0x595792[_0xa304('0x45')]=_[_0xa304('0x43')](_0xb84bb8[_0xa304('0x3e')],qs['fields'](_0x389f63[_0xa304('0x40')][_0xa304('0x44')]));_0x595792[_0xa304('0x45')]=_0x595792[_0xa304('0x45')][_0xa304('0x46')]?_0x595792[_0xa304('0x45')]:_0xb84bb8[_0xa304('0x3e')];if(!_0x389f63[_0xa304('0x40')][_0xa304('0x65')]('nolimit')){_0x595792[_0xa304('0x2c')]=qs[_0xa304('0x2c')](_0x389f63[_0xa304('0x40')][_0xa304('0x2c')]);_0x595792[_0xa304('0x2b')]=qs[_0xa304('0x2b')](_0x389f63[_0xa304('0x40')][_0xa304('0x2b')]);}_0x595792[_0xa304('0x47')]=qs['sort'](_0x389f63['query'][_0xa304('0x48')]);_0x595792[_0xa304('0x49')]=qs[_0xa304('0x42')](_[_0xa304('0x4a')](_0x389f63[_0xa304('0x40')],_0xb84bb8[_0xa304('0x42')]));_0x595792[_0xa304('0x49')]['SmsAccountId']=_0x2ba99d['id'];if(_0x389f63[_0xa304('0x40')]['filter']){_0x595792[_0xa304('0x49')]=_[_0xa304('0x4c')](_0x595792[_0xa304('0x49')],{'$or':_[_0xa304('0x3f')](_0x595792[_0xa304('0x45')],function(_0x5daf10){var _0x5bd41a={};_0x5bd41a[_0x5daf10]={'$like':'%'+_0x389f63[_0xa304('0x40')][_0xa304('0x4b')]+'%'};return _0x5bd41a;})});}_0x595792=_[_0xa304('0x4c')]({},_0x595792,_0x389f63['options']);return db['CannedAnswer'][_0xa304('0x2a')]({'where':_0x595792[_0xa304('0x49')]})[_0xa304('0x32')](function(_0x269a76){_0x4a329b[_0xa304('0x2a')]=_0x269a76;if(_0x389f63[_0xa304('0x40')][_0xa304('0x4f')]){_0x595792['include']=[{'all':!![]}];}return db[_0xa304('0x69')][_0xa304('0x51')](_0x595792);})[_0xa304('0x32')](function(_0xb62dcf){_0x4a329b[_0xa304('0x52')]=_0xb62dcf;return _0x4a329b;});}})['then'](respondWithFilteredResult(_0x222ccf,_0x595792))[_0xa304('0x57')](handleError(_0x222ccf,null));};exports[_0xa304('0x6b')]=function(_0x31aa20,_0xe4695b,_0x24d16a){return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x31aa20[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0xe4695b,null))[_0xa304('0x32')](function(_0x130af3){if(_0x130af3){return _0x130af3[_0xa304('0x6b')](_0x31aa20[_0xa304('0x40')]['ids']);}})[_0xa304('0x32')](respondWithStatusCode(_0xe4695b,null))[_0xa304('0x57')](handleError(_0xe4695b,null));};exports[_0xa304('0x6c')]=function(_0x584e1a,_0x5119ba,_0x4ecbf9){var _0x1023ca={'channel':_0xa304('0x6d')};var _0x225f5e=[];var _0x5151ae=[];var _0x1991e0={};return db['SmsAccount']['find']({'where':{'id':_0x584e1a[_0xa304('0x54')]['id']},'include':[{'model':db[_0xa304('0x6e')],'as':_0xa304('0x6f')}]})[_0xa304('0x32')](handleEntityNotFound(_0x5119ba,null))[_0xa304('0x32')](function(_0x2da312){_0x1023ca[_0xa304('0x70')]=_0x2da312;_0x1023ca['applications']=_[_0xa304('0x71')](_0x2da312[_0xa304('0x6f')],[_0xa304('0x72')],[_0xa304('0x73')]);if(_0x1023ca[_0xa304('0x70')][_0xa304('0x6f')]){delete _0x1023ca[_0xa304('0x70')][_0xa304('0x6f')];}return db[_0xa304('0x74')][_0xa304('0x60')]();})['then'](function(_0x298759){if(!_0x298759){throw new db[(_0xa304('0x75'))][(_0xa304('0x76'))](_0xa304('0x77'));}_0x225f5e=_[_0xa304('0x78')](_[_0xa304('0x41')](_0x298759),['createdAt',_0xa304('0x79')]);_0x5151ae=_['difference'](_[_0xa304('0x41')](_0x298759),['createdAt',_0xa304('0x79'),_0xa304('0x7a'),_0xa304('0x7b')]);_0x1023ca[_0xa304('0x59')]={'mapKey':_0xa304('0x7c')};if(_0x1023ca['account'][_0xa304('0x3d')]){switch(_0x1023ca['account']['type']){case _0xa304('0x7d'):_0x1023ca[_0xa304('0x59')]['from']=_0x584e1a[_0xa304('0x59')]['From'];_0x1023ca[_0xa304('0x59')]['body']=_0x584e1a[_0xa304('0x59')]['Body'];_0x1023ca[_0xa304('0x59')][_0xa304('0x7e')]=_0x584e1a['body'][_0xa304('0x7f')];break;case _0xa304('0x80'):_0x1023ca[_0xa304('0x59')]['from']='+'+_0x584e1a['body']['sender'];_0x1023ca[_0xa304('0x59')][_0xa304('0x59')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x81')];break;case _0xa304('0x82'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a[_0xa304('0x59')]['from'];_0x1023ca[_0xa304('0x59')][_0xa304('0x59')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x23')];break;case _0xa304('0x84'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x83')];_0x1023ca['body'][_0xa304('0x59')]=_0x584e1a['body'][_0xa304('0x59')];_0x1023ca[_0xa304('0x59')][_0xa304('0x7e')]=_0x584e1a['body'][_0xa304('0x85')];break;case _0xa304('0x86'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a['body'][_0xa304('0x87')];_0x1023ca['body'][_0xa304('0x59')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x88')];_0x1023ca[_0xa304('0x59')]['messageId']=_0x584e1a['body'][_0xa304('0x89')];break;case _0xa304('0x8a'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]='+'+_0x584e1a[_0xa304('0x59')][_0xa304('0x8b')][0x0]['from'];_0x1023ca['body'][_0xa304('0x59')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x8b')][0x0][_0xa304('0x81')];_0x1023ca[_0xa304('0x59')]['messageId']=_0x584e1a[_0xa304('0x59')][_0xa304('0x8b')][0x0]['messageId'];break;case _0xa304('0x8c'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x8d')];_0x1023ca['body'][_0xa304('0x59')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x8e')][_0xa304('0x23')];break;case'clickatell':_0x1023ca['body'][_0xa304('0x83')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x8f')];_0x1023ca[_0xa304('0x59')]['body']=_0x584e1a['body'][_0xa304('0x81')];_0x1023ca['body'][_0xa304('0x7e')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x90')];break;case _0xa304('0x91'):_0x1023ca[_0xa304('0x59')][_0xa304('0x7e')]=_0x584e1a['body'][0x0][_0xa304('0x23')]['id'];_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a['body'][0x0][_0xa304('0x23')][_0xa304('0x83')];_0x1023ca[_0xa304('0x59')][_0xa304('0x59')]=_0x584e1a['body'][0x0][_0xa304('0x23')][_0xa304('0x81')];break;case _0xa304('0x92'):_0x1023ca[_0xa304('0x59')][_0xa304('0x83')]=_0x584e1a[_0xa304('0x59')][_0xa304('0x83')];_0x1023ca[_0xa304('0x59')][_0xa304('0x59')]=_0x584e1a['body']['message'];_0x1023ca[_0xa304('0x59')]['messageId']=_0x584e1a[_0xa304('0x59')][_0xa304('0x93')];break;}}if(_0x1023ca['body']['id']){delete _0x1023ca['body']['id'];}if(_['isNil'](_0x1023ca[_0xa304('0x59')][_0xa304('0x83')])){throw new db['Sequelize'][(_0xa304('0x76'))](_0xa304('0x94'));}if(_['isNil'](_0x1023ca['body'][_0xa304('0x59')])||_0x1023ca['body'][_0xa304('0x59')]===''){throw new db[(_0xa304('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa304('0x95')](_0x1023ca[_0xa304('0x59')][_0xa304('0x96')])){throw new db['Sequelize'][(_0xa304('0x76'))](_0xa304('0x97')+_0x5151ae);}if(!_[_0xa304('0x98')](_0x5151ae,_0x1023ca[_0xa304('0x59')][_0xa304('0x96')])){throw new db[(_0xa304('0x75'))][(_0xa304('0x76'))](_0xa304('0x99')+_0x5151ae);}_0x1991e0[_0x1023ca[_0xa304('0x59')][_0xa304('0x96')]]=_0x1023ca[_0xa304('0x59')][_0xa304('0x83')];return db[_0xa304('0x9a')][_0xa304('0x56')]({'where':{'id':_0x1023ca[_0xa304('0x70')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xa304('0x9b'),'where':_0x1991e0,'limit':0x1,'order':[[_0xa304('0x79'),'DESC']]}]});})[_0xa304('0x32')](handleEntityNotFound(_0x5119ba,null))[_0xa304('0x32')](function(_0x498632){if(_0x498632){_0x1023ca[_0xa304('0x9c')]=_[_0xa304('0x9d')](_0x498632,[_0xa304('0x9b')]);if(_0x498632['Contacts'][_0xa304('0x46')]){return _0x498632[_0xa304('0x9b')][0x0];}var _0x349ff1=_[_0xa304('0x15')](_0x1023ca[_0xa304('0x59')],{'firstName':_0x1023ca[_0xa304('0x59')][_0xa304('0x83')],'ListId':_0x498632['id']});_0x349ff1[_0x1023ca[_0xa304('0x59')][_0xa304('0x96')]]=_0x1023ca[_0xa304('0x59')][_0xa304('0x83')];return db[_0xa304('0x74')][_0xa304('0x58')](_0x349ff1,{'fields':_0x225f5e,'raw':!![]});}})[_0xa304('0x32')](handleEntityNotFound(_0x5119ba,null))[_0xa304('0x32')](function(_0x2407fd){if(_0x2407fd){_0x1023ca[_0xa304('0x9e')]=_0x2407fd;var _0x548aa0={'ContactId':_0x2407fd['id'],'phone':_0x1023ca['body'][_0xa304('0x83')],'SmsAccountId':_0x584e1a[_0xa304('0x54')]['id']};var _0x5d944d={'ContactId':_0x2407fd['id'],'SmsAccountId':_0x584e1a[_0xa304('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0xa304('0x56')]({'where':_0x5d944d})[_0xa304('0x32')](function(_0x4b7500){if(_0x4b7500){return[_0x4b7500,![]];}return db[_0xa304('0x9f')][_0xa304('0x58')](_0x548aa0)[_0xa304('0x32')](function(_0x23ab88){return[_0x23ab88,!![]];});});}})[_0xa304('0xa0')](function(_0x3dad8e,_0x368945){_0x1023ca[_0xa304('0xa1')]=_0x3dad8e[_0xa304('0x5b')]({'plain':!![]});_0x1023ca[_0xa304('0xa1')][_0xa304('0xa2')]=![];if(_0x368945){if(_0x1023ca[_0xa304('0x70')][_0xa304('0xa3')]){_0x1023ca[_0xa304('0xa4')]['push']({'id':0x0,'priority':_0x1023ca[_0xa304('0xa4')][_0xa304('0x46')]+0x1,'app':_0xa304('0xa5'),'appdata':_0xa304('0xa6'),'interval':_0xa304('0xa7')});}_0x1023ca[_0xa304('0xa1')][_0xa304('0xa2')]=!![];}return db[_0xa304('0xa8')][_0xa304('0x58')]({'phone':_0x1023ca['body'][_0xa304('0x83')],'messageId':_0x1023ca[_0xa304('0x59')]['messageId'],'body':_0x1023ca[_0xa304('0x59')][_0xa304('0x59')],'SmsAccountId':_0x584e1a[_0xa304('0x54')]['id'],'SmsInteractionId':_0x3dad8e['id'],'direction':'in','ContactId':_0x3dad8e[_0xa304('0xa9')],'AttachmentId':_0x1023ca[_0xa304('0x59')][_0xa304('0xaa')]});})[_0xa304('0x32')](function(_0x433022){_0x1023ca[_0xa304('0x23')]=_0x433022;if(!_0x1023ca[_0xa304('0xa1')][_0xa304('0xab')])return;return db[_0xa304('0xac')][_0xa304('0x56')]({'attributes':['id',_0xa304('0x37')],'where':{'id':_0x1023ca[_0xa304('0xa1')][_0xa304('0xab')]}});})[_0xa304('0x32')](function(_0x35ae7a){if(_0x35ae7a){_0x1023ca[_0xa304('0xa4')][_0xa304('0xad')]({'id':0x0,'priority':0x0,'app':_0xa304('0xae'),'appdata':_0x35ae7a[_0xa304('0x37')]+','+(_0x1023ca[_0xa304('0x70')][_0xa304('0xaf')]||0xa),'interval':'*,*,*,*'});}if(!_0x1023ca[_0xa304('0xa1')][_0xa304('0xb0')])return;return db['SmsQueue']['find']({'attributes':['id','name'],'where':{'id':_0x1023ca['interaction']['queueId']}});})['then'](function(_0x3d0629){if(_0x3d0629){_0x1023ca['applications'][_0xa304('0xad')]({'id':0x0,'priority':0x1,'app':_0xa304('0xb1'),'appdata':_0x3d0629['name']+','+(_0x1023ca[_0xa304('0x70')]['waitForTheAssignedQueue']||0x12c),'interval':_0xa304('0xa7')});}return respondWithRpcPromise(_0xa304('0xb2'),_0xa304('0xb3'),_0x1023ca);})[_0xa304('0x32')](function(_0x6969f4){if(_0x6969f4){var _0x2beb5e=0xc8;var _0x533c85='receiveMessage';logger[_0xa304('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x533c85,_0x2beb5e,_0xa304('0xb4'));logger[_0xa304('0x1f')](_0xa304('0xb5'),_0x533c85,_0x2beb5e,_0xa304('0xb4'),JSON[_0xa304('0xb6')](_0x6969f4));if(_0x1023ca['account']['type']===_0xa304('0x7d')){return _0x5119ba[_0xa304('0x27')](_0x2beb5e)[_0xa304('0x2d')](_0xa304('0xb7'),_0xa304('0xb8'))[_0xa304('0xb9')]('\x0a');}else{return _0x5119ba['status'](_0x2beb5e)['json'](_0x6969f4);}}})[_0xa304('0x57')](handleError(_0x5119ba,null));};exports[_0xa304('0xba')]=function(_0x242e01,_0x39e9a3){var _0x20d386=_0x242e01[_0xa304('0x54')]['id'];var _0x1af5f6=_0x242e01[_0xa304('0x59')];var _0x59bb48=0xc8;var _0xa400ab=null;return db[_0xa304('0xbb')][_0xa304('0xbc')]({'isolationLevel':db['sequelize'][_0xa304('0xbd')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1de6f7){return db[_0xa304('0x3a')]['findOne']({'where':{'id':_0x20d386},'transaction':_0x1de6f7})[_0xa304('0x32')](function(_0xc8ac21){if(_0xc8ac21){return db[_0xa304('0x6e')][_0xa304('0x33')]({'where':{'SmsAccountId':_0x20d386},'transaction':_0x1de6f7})[_0xa304('0x32')](function(){var _0x4bb5d5=_['map'](_0x1af5f6,function(_0x400344){_0x400344[_0xa304('0x61')]=_0x20d386;return _0x400344;});return db[_0xa304('0x6e')][_0xa304('0xbe')](_0x4bb5d5,{'transaction':_0x1de6f7});});}else{_0x59bb48=0x194;_0xa400ab=[];}});})[_0xa304('0x32')](function(){if(_0x59bb48!==0x194){return db[_0xa304('0x6e')][_0xa304('0xbf')]({'where':{'SmsAccountId':_0x20d386},'order':'priority'})[_0xa304('0x32')](function(_0x202250){_0xa400ab=_0x202250;});}})[_0xa304('0x57')](function(_0x1eb0b3){_0x59bb48=0x1f4;logger[_0xa304('0x22')](_0x1eb0b3[_0xa304('0x36')]);if(_0x1eb0b3[_0xa304('0x37')]){delete _0x1eb0b3['name'];}_0xa400ab=_0x1eb0b3;})['finally'](function(){if(_0xa400ab===null){_0x39e9a3['sendStatus'](_0x59bb48);}else{if(_0x59bb48===0x1f4){_0x39e9a3[_0xa304('0x27')](_0x59bb48)[_0xa304('0xb9')](_0xa400ab);}else{_0x39e9a3[_0xa304('0x27')](_0x59bb48)[_0xa304('0x28')](_0xa400ab);}}});};exports['getApplications']=function(_0x4ed61e,_0x1a46fc,_0x5035ed){var _0x1532e2={};var _0x3ffaa5={};var _0x392111;var _0x23d95f;return db[_0xa304('0x3a')][_0xa304('0x63')]({'where':{'id':_0x4ed61e[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x1a46fc,null))[_0xa304('0x32')](function(_0x33e234){if(_0x33e234){_0x392111=_0x33e234;_0x3ffaa5[_0xa304('0x3e')]=_[_0xa304('0x41')](db['SmsApplication'][_0xa304('0x3b')]);_0x3ffaa5[_0xa304('0x40')]=_[_0xa304('0x41')](_0x4ed61e[_0xa304('0x40')]);_0x3ffaa5[_0xa304('0x42')]=_['intersection'](_0x3ffaa5[_0xa304('0x3e')],_0x3ffaa5[_0xa304('0x40')]);_0x1532e2[_0xa304('0x45')]=_[_0xa304('0x43')](_0x3ffaa5['model'],qs['fields'](_0x4ed61e[_0xa304('0x40')][_0xa304('0x44')]));_0x1532e2[_0xa304('0x45')]=_0x1532e2[_0xa304('0x45')][_0xa304('0x46')]?_0x1532e2[_0xa304('0x45')]:_0x3ffaa5[_0xa304('0x3e')];_0x1532e2[_0xa304('0x47')]=qs['sort'](_0x4ed61e[_0xa304('0x40')]['sort']);_0x1532e2[_0xa304('0x49')]=qs[_0xa304('0x42')](_[_0xa304('0x4a')](_0x4ed61e['query'],_0x3ffaa5[_0xa304('0x42')]));if(_0x4ed61e[_0xa304('0x40')]['filter']){_0x1532e2[_0xa304('0x49')]=_[_0xa304('0x4c')](_0x1532e2[_0xa304('0x49')],{'$or':_['map'](_0x1532e2[_0xa304('0x45')],function(_0x4c2794){var _0x8635d9={};_0x8635d9[_0x4c2794]={'$like':'%'+_0x4ed61e[_0xa304('0x40')][_0xa304('0x4b')]+'%'};return _0x8635d9;})});}_0x1532e2=_['merge']({},_0x1532e2,_0x4ed61e[_0xa304('0x4e')]);return _0x392111['getApplications'](_0x1532e2);}})['then'](function(_0x39725f){if(_0x39725f){_0x23d95f=_0x39725f[_0xa304('0x46')];if(!_0x4ed61e[_0xa304('0x40')][_0xa304('0x65')](_0xa304('0xc0'))){_0x1532e2[_0xa304('0x2c')]=qs[_0xa304('0x2c')](_0x4ed61e[_0xa304('0x40')]['limit']);_0x1532e2[_0xa304('0x2b')]=qs[_0xa304('0x2b')](_0x4ed61e[_0xa304('0x40')][_0xa304('0x2b')]);}return _0x392111[_0xa304('0xc1')](_0x1532e2);}})[_0xa304('0x32')](function(_0x5f54ee){if(_0x5f54ee){return _0x5f54ee?{'count':_0x23d95f,'rows':_0x5f54ee}:null;}})[_0xa304('0x32')](respondWithResult(_0x1a46fc,null))['catch'](handleError(_0x1a46fc,null));};exports[_0xa304('0xc2')]=function(_0x57e8fd,_0x29f4af,_0x269d5d){var _0x1e9a8a={'raw':![],'where':{}};var _0x40af20={};var _0x1c0084={'count':0x0,'rows':[]};return db[_0xa304('0x3a')][_0xa304('0x63')]({'where':{'id':_0x57e8fd['params']['id']}})['then'](handleEntityNotFound(_0x29f4af,null))[_0xa304('0x32')](function(_0x3aebb0){if(_0x3aebb0){_0x40af20[_0xa304('0x3e')]=_[_0xa304('0x41')](db[_0xa304('0x9f')][_0xa304('0x3b')]);_0x40af20[_0xa304('0x40')]=_[_0xa304('0x41')](_0x57e8fd[_0xa304('0x40')]);_0x40af20['filters']=_[_0xa304('0x43')](_0x40af20['model'],_0x40af20[_0xa304('0x40')]);_0x1e9a8a['attributes']=_[_0xa304('0x43')](_0x40af20[_0xa304('0x3e')],qs[_0xa304('0x44')](_0x57e8fd[_0xa304('0x40')]['fields']));_0x1e9a8a[_0xa304('0x45')]=_0x1e9a8a[_0xa304('0x45')]['length']?_0x1e9a8a['attributes']:_0x40af20[_0xa304('0x3e')];if(!_0x57e8fd['query'][_0xa304('0x65')]('nolimit')){_0x1e9a8a[_0xa304('0x2c')]=qs[_0xa304('0x2c')](_0x57e8fd[_0xa304('0x40')][_0xa304('0x2c')]);_0x1e9a8a[_0xa304('0x2b')]=qs[_0xa304('0x2b')](_0x57e8fd[_0xa304('0x40')][_0xa304('0x2b')]);}_0x1e9a8a[_0xa304('0x47')]=qs['sort'](_0x57e8fd[_0xa304('0x40')][_0xa304('0x48')]);_0x1e9a8a[_0xa304('0x49')]=qs['filters'](_[_0xa304('0x4a')](_0x57e8fd[_0xa304('0x40')],_0x40af20['filters']));_0x1e9a8a[_0xa304('0x49')]['SmsAccountId']=_0x3aebb0['id'];if(_0x57e8fd[_0xa304('0x40')]['filter']){_0x1e9a8a[_0xa304('0x49')]=_[_0xa304('0x4c')](_0x1e9a8a[_0xa304('0x49')],{'$or':_[_0xa304('0x3f')](_0x1e9a8a[_0xa304('0x45')],function(_0x5f174f){var _0xa278e9={};_0xa278e9[_0x5f174f]={'$like':'%'+_0x57e8fd['query'][_0xa304('0x4b')]+'%'};return _0xa278e9;})});}_0x1e9a8a=_[_0xa304('0x4c')]({},_0x1e9a8a,_0x57e8fd['options']);return db['SmsInteraction'][_0xa304('0x2a')]({'where':_0x1e9a8a[_0xa304('0x49')]})['then'](function(_0x5d5dda){_0x1c0084['count']=_0x5d5dda;if(_0x57e8fd[_0xa304('0x40')][_0xa304('0x4f')]){_0x1e9a8a[_0xa304('0x50')]=[{'model':db[_0xa304('0x74')],'as':_0xa304('0xc3'),'required':![]},{'model':db[_0xa304('0xac')],'as':_0xa304('0xc4'),'attributes':[_0xa304('0x37'),'fullname',_0xa304('0xc5')],'required':![]},{'model':db[_0xa304('0xc6')],'as':_0xa304('0xc7'),'attributes':['id',_0xa304('0x37'),_0xa304('0xc8')],'where':_0x57e8fd[_0xa304('0x40')][_0xa304('0xc9')]?{'id':_0x57e8fd[_0xa304('0x40')][_0xa304('0xc9')]}:undefined,'required':_0x57e8fd[_0xa304('0x40')][_0xa304('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0xa304('0x51')](_0x1e9a8a);})[_0xa304('0x32')](function(_0x2886b6){_0x1c0084[_0xa304('0x52')]=_0x2886b6;return _0x1c0084;});}})[_0xa304('0x32')](respondWithFilteredResult(_0x29f4af,_0x1e9a8a))[_0xa304('0x57')](handleError(_0x29f4af,null));};exports[_0xa304('0xb9')]=function(_0x518bae,_0xbecb7,_0x1bf4e7){var _0x4eb09a,_0x5289b6,_0x8392b0;if(_[_0xa304('0x95')](_0x518bae[_0xa304('0x59')][_0xa304('0x59')])||_0x518bae[_0xa304('0x59')][_0xa304('0x59')]===''){throw new db[(_0xa304('0x75'))][(_0xa304('0x76'))](_0xa304('0xca'));}if(_['isNil'](_0x518bae['body']['to'])){throw new db[(_0xa304('0x75'))][(_0xa304('0x76'))](_0xa304('0xcb'));}_0x4eb09a=_0x518bae[_0xa304('0x59')]['to'];return db['SmsAccount'][_0xa304('0x56')]({'where':{'id':_0x518bae[_0xa304('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xa304('0xcc'),'include':[{'model':db[_0xa304('0x74')],'as':_0xa304('0x9b'),'where':{'mobile':_0x4eb09a},'limit':0x1,'order':[[_0xa304('0x79'),'DESC']]}]}]})['then'](handleEntityNotFound(_0xbecb7,null))[_0xa304('0x32')](function(_0x2fd0bf){if(_0x2fd0bf&&_0x2fd0bf['List']){_0x5289b6=_0x2fd0bf[_0xa304('0x5b')]({'plain':!![]});if(_0x5289b6[_0xa304('0xcc')]&&_0x5289b6[_0xa304('0xcc')]['Contacts'][_0xa304('0x46')]){return _0x5289b6[_0xa304('0xcc')][_0xa304('0x9b')][0x0];}return db[_0xa304('0x74')][_0xa304('0x58')](_[_0xa304('0x15')](_0x518bae['body'],{'firstName':_0x4eb09a,'mobile':_0x4eb09a,'phone':_0x4eb09a,'ListId':_0x5289b6[_0xa304('0x7b')]}));}})[_0xa304('0x32')](handleEntityNotFound(_0xbecb7,null))[_0xa304('0x32')](function(_0x3023ef){if(_0x3023ef){_0x8392b0=_0x3023ef;return db['SmsInteraction'][_0xa304('0x56')]({'where':{'ContactId':_0x8392b0['id'],'closed':![],'SmsAccountId':_0x5289b6['id']}})[_0xa304('0x32')](function(_0x153a70){if(_0x153a70){return[_0x153a70,![]];}return db[_0xa304('0x9f')][_0xa304('0x58')]({'UserId':_0x518bae[_0xa304('0x5a')]['id'],'ContactId':_0x8392b0['id'],'SmsAccountId':_0x5289b6['id'],'phone':_0x4eb09a,'firstMsgDirection':_0xa304('0xcd'),'Messages':[_['merge'](_0x518bae['body'],{'read':![],'body':_0x518bae['body'][_0xa304('0x59')],'phone':_0x4eb09a,'SmsAccountId':_0x5289b6['id'],'UserId':_0x518bae[_0xa304('0x5a')]['id'],'ContactId':_0x8392b0['id']})]},{'include':[{'model':db[_0xa304('0xa8')],'as':'Messages'}]})[_0xa304('0x32')](function(_0x58996e){return[_0x58996e,!![]];});});}})['spread'](function(_0x49b561,_0x21e643){if(_0x21e643){return _0x49b561;}return db['SmsMessage'][_0xa304('0x58')](_[_0xa304('0x4c')](_0x518bae[_0xa304('0x59')],{'read':![],'body':_0x518bae[_0xa304('0x59')][_0xa304('0x59')],'phone':_0x4eb09a,'SmsAccountId':_0x5289b6['id'],'SmsInteractionId':_0x49b561['id'],'UserId':_0x518bae[_0xa304('0x5a')]['id'],'ContactId':_0x8392b0['id']}))[_0xa304('0x32')](function(_0x3b6572){_0x49b561[_0xa304('0xce')][_0xa304('0xcf')]=[];_0x49b561['dataValues'][_0xa304('0xcf')][_0xa304('0xd0')](_0x3b6572['dataValues']);return _0x49b561;});})['then'](respondWithResult(_0xbecb7,null))['catch'](handleError(_0xbecb7,null));};exports[_0xa304('0x27')]=function(_0x4ceb9b,_0x114da3,_0x474dac){if(_0x4ceb9b[_0xa304('0x59')]['id']){delete _0x4ceb9b[_0xa304('0x59')]['id'];}var _0x2cf84d,_0x27a731,_0xf57359;return db[_0xa304('0x3a')]['find']({'where':{'id':_0x4ceb9b[_0xa304('0x54')]['id']}})['then'](handleEntityNotFound(_0x114da3,null))[_0xa304('0x32')](function(_0x185ac3){if(_0x185ac3){_0xf57359=_0x185ac3;logger[_0xa304('0x1f')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0xd1'),_0x185ac3['type'],util[_0xa304('0xd2')](_0x4ceb9b['body'],{'showHidden':![],'depth':null}));switch(_0x185ac3[_0xa304('0x3d')]){case _0xa304('0x80'):if(_0x4ceb9b[_0xa304('0x59')][_0xa304('0xd3')]&&_0x4ceb9b['body'][_0xa304('0x27')]){_0x27a731=_0x4ceb9b[_0xa304('0x59')]['status'];return db[_0xa304('0xa8')][_0xa304('0x56')]({'where':{'messageId':_0x4ceb9b[_0xa304('0x59')][_0xa304('0xd3')]}});}break;case _0xa304('0x82'):if(_0x4ceb9b[_0xa304('0x59')]['requestid']&&_0x4ceb9b[_0xa304('0x59')][_0xa304('0xd4')]){_0x27a731=_0x4ceb9b['body'][_0xa304('0xd4')];return db[_0xa304('0xa8')]['find']({'where':{'messageId':_0x4ceb9b[_0xa304('0x59')][_0xa304('0xd5')]}});}break;case _0xa304('0x84'):if(_0x4ceb9b[_0xa304('0x59')]['message_id']&&_0x4ceb9b['body'][_0xa304('0xd6')]){_0x27a731=_0x4ceb9b[_0xa304('0x59')][_0xa304('0xd6')];return db[_0xa304('0xa8')]['find']({'where':{'messageId':_0x4ceb9b['body'][_0xa304('0x85')]}});}break;case _0xa304('0x8a'):var _0x5dcd0a=_0x4ceb9b[_0xa304('0x59')][_0xa304('0x8b')][0x0];if(_0x5dcd0a[_0xa304('0x7e')]&&_0x5dcd0a[_0xa304('0x27')][_0xa304('0xd7')]===_0xa304('0xd8')){_0x27a731=_0x5dcd0a[_0xa304('0x27')][_0xa304('0xd7')];return db[_0xa304('0xa8')]['find']({'where':{'messageId':_0x5dcd0a[_0xa304('0x7e')]}});}break;case _0xa304('0xd9'):if(_0x4ceb9b['body'][_0xa304('0x7e')]&&_0x4ceb9b[_0xa304('0x59')]['status']){_0x27a731=_0x4ceb9b[_0xa304('0x59')][_0xa304('0x27')];return db[_0xa304('0xa8')][_0xa304('0x56')]({'where':{'messageId':_0x4ceb9b[_0xa304('0x59')][_0xa304('0x7e')]}});}break;case _0xa304('0x91'):if(_0x4ceb9b['body'][0x0][_0xa304('0x23')]['id']){_0x27a731=_0x4ceb9b[_0xa304('0x59')][0x0][_0xa304('0x3d')];return db[_0xa304('0xa8')][_0xa304('0x56')]({'where':{'messageId':_0x4ceb9b['body'][0x0][_0xa304('0x23')]['id']}});}break;case'intelepeer':if(_0x4ceb9b[_0xa304('0x59')][_0xa304('0xda')]&&_0x4ceb9b[_0xa304('0x59')][_0xa304('0x27')]){_0x27a731=_0x4ceb9b[_0xa304('0x59')][_0xa304('0x27')];return db['SmsMessage'][_0xa304('0x56')]({'where':{'messageId':_0x4ceb9b[_0xa304('0x59')]['redif']}});}break;}}})[_0xa304('0x32')](handleEntityNotFound(_0x114da3,null))[_0xa304('0x32')](function(_0x4f5085){if(_0x4f5085){_0x2cf84d=_0x4f5085;switch(_0xf57359[_0xa304('0x3d')]){case _0xa304('0x80'):if(_0x27a731===_0xa304('0xd8')){return _0x2cf84d['update']({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0x80'),util[_0xa304('0xd2')](_0x4ceb9b['body'],{'showHidden':![],'depth':null}));}break;case _0xa304('0x82'):if(_0x27a731==='1'){return _0x2cf84d['update']({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),'status','skebby',util[_0xa304('0xd2')](_0x4ceb9b[_0xa304('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa304('0x84'):if(!_0x4ceb9b[_0xa304('0x59')][_0xa304('0xdb')]&&_0x27a731>=0xc8&&_0x27a731<=0xce){return _0x2cf84d['update']({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0x84'),util[_0xa304('0xd2')](_0x4ceb9b[_0xa304('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa304('0x8a'):var _0x325d51=_0x4ceb9b[_0xa304('0x59')][_0xa304('0x8b')][0x0];if(_0x325d51[_0xa304('0x27')]['groupName']===_0xa304('0xd8')){return _0x2cf84d[_0xa304('0x31')]({'read':!![]});}else{logger[_0xa304('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa304('0x8a'),util[_0xa304('0xd2')](_0x4ceb9b['body'],{'showHidden':![],'depth':null}));}break;case _0xa304('0xd9'):if(_0x27a731==_0xa304('0xdc')||_0x27a731==_0xa304('0xdd')){return _0x2cf84d[_0xa304('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa304('0x27'),'clickatell',util[_0xa304('0xd2')](_0x4ceb9b['body'],{'showHidden':![],'depth':null}));}break;case _0xa304('0x91'):if(_0x27a731==_0xa304('0xde')){return _0x2cf84d['update']({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0x91'),util[_0xa304('0xd2')](_0x4ceb9b[_0xa304('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa304('0x92'):if(_0x27a731===_0xa304('0xdf')||_0x27a731===_0xa304('0xe0')){return _0x2cf84d[_0xa304('0x31')]({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0x92'),util[_0xa304('0xd2')](_0x4ceb9b[_0xa304('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2cf84d;}})[_0xa304('0x32')](respondWithResult(_0x114da3,null))[_0xa304('0x57')](handleError(_0x114da3,null));};exports['statusGet']=function(_0x40274f,_0x5ecef3,_0x5f3ea1){var _0x173303,_0x96e496,_0xf5733e;return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x40274f['params']['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x5ecef3,null))[_0xa304('0x32')](function(_0x2b273f){if(_0x2b273f){_0xf5733e=_0x2b273f;logger[_0xa304('0x1f')](_0xa304('0x20'),_0xa304('0x27'),_0xa304('0xd1'),_0x2b273f['type'],util[_0xa304('0xd2')](_0x40274f[_0xa304('0x40')],{'showHidden':![],'depth':null}));switch(_0x2b273f['type']){case _0xa304('0x8c'):if(_0x40274f[_0xa304('0x40')][_0xa304('0xe1')]&&_0x40274f['query'][_0xa304('0xe2')]){_0x96e496=_0x40274f[_0xa304('0x40')]['state'];return db['SmsMessage']['find']({'where':{'messageId':_0x40274f['query'][_0xa304('0xe1')]}});}break;}}})[_0xa304('0x32')](handleEntityNotFound(_0x5ecef3,null))[_0xa304('0x32')](function(_0x4a6d22){if(_0x4a6d22){_0x173303=_0x4a6d22;switch(_0xf5733e['type']){case _0xa304('0x8c'):if(_0x96e496==='2'||_0x96e496==='6'){return _0x173303[_0xa304('0x31')]({'read':!![]});}else{logger[_0xa304('0x22')](_0xa304('0x20'),_0xa304('0x27'),'csc',util['inspect'](_0x40274f[_0xa304('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x173303;}})[_0xa304('0x32')](respondWithResult(_0x5ecef3,null))['catch'](handleError(_0x5ecef3,null));};exports[_0xa304('0xe3')]=function(_0xeaaf07,_0x56e261,_0xc05582){return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0xeaaf07[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x56e261,null))[_0xa304('0x32')](function(_0x34a566){if(_0x34a566){return _0x34a566[_0xa304('0xe3')](_0xeaaf07[_0xa304('0x59')][_0xa304('0x67')],_[_0xa304('0x9d')](_0xeaaf07[_0xa304('0x59')],[_0xa304('0x67'),'id'])||{})['spread'](function(_0x269af6){for(var _0x1acec4=0x0;_0x1acec4<_0xeaaf07[_0xa304('0x59')][_0xa304('0x67')][_0xa304('0x46')];_0x1acec4+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0xeaaf07[_0xa304('0x59')][_0xa304('0x67')][_0x1acec4]),'SmsAccountId':Number(_0xeaaf07[_0xa304('0x54')]['id'])});}return _0x269af6;});}})[_0xa304('0x32')](respondWithResult(_0x56e261,null))['catch'](handleError(_0x56e261,null));};exports['removeAgents']=function(_0x26537d,_0x10ce29,_0x40e893){return db[_0xa304('0x3a')][_0xa304('0x56')]({'where':{'id':_0x26537d['params']['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x10ce29,null))[_0xa304('0x32')](function(_0x5d9459){if(_0x5d9459){return _0x5d9459[_0xa304('0xe4')](_0x26537d[_0xa304('0x40')][_0xa304('0x67')])['then'](function(){if(_[_0xa304('0xe5')](_0x26537d[_0xa304('0x40')]['ids'])){for(var _0x58f5f3=0x0;_0x58f5f3<_0x26537d[_0xa304('0x40')][_0xa304('0x67')][_0xa304('0x46')];_0x58f5f3+=0x1){socket['emit'](_0xa304('0xe6'),{'UserId':Number(_0x26537d[_0xa304('0x40')]['ids'][_0x58f5f3]),'SmsAccountId':Number(_0x26537d[_0xa304('0x54')]['id'])});}}else{socket[_0xa304('0xe7')]('userSmsAccount:remove',{'UserId':Number(_0x26537d[_0xa304('0x40')]['ids']),'SmsAccountId':Number(_0x26537d['params']['id'])});}});}})[_0xa304('0x32')](respondWithStatusCode(_0x10ce29,null))[_0xa304('0x57')](handleError(_0x10ce29,null));};exports['getAgents']=function(_0x266dda,_0x5bce95,_0x35a89a){var _0x51c4b1={};var _0x21b763={};var _0x17befd;var _0x13a22f;return db[_0xa304('0x3a')][_0xa304('0x63')]({'where':{'id':_0x266dda[_0xa304('0x54')]['id']}})[_0xa304('0x32')](handleEntityNotFound(_0x5bce95,null))['then'](function(_0x572ba3){if(_0x572ba3){_0x17befd=_0x572ba3;_0x21b763[_0xa304('0x3e')]=_[_0xa304('0x41')](db['User'][_0xa304('0x3b')]);_0x21b763[_0xa304('0x40')]=_[_0xa304('0x41')](_0x266dda[_0xa304('0x40')]);_0x21b763[_0xa304('0x42')]=_[_0xa304('0x43')](_0x21b763[_0xa304('0x3e')],_0x21b763[_0xa304('0x40')]);_0x51c4b1[_0xa304('0x45')]=_['intersection'](_0x21b763[_0xa304('0x3e')],qs['fields'](_0x266dda[_0xa304('0x40')][_0xa304('0x44')]));_0x51c4b1[_0xa304('0x45')]=_0x51c4b1['attributes'][_0xa304('0x46')]?_0x51c4b1[_0xa304('0x45')]:_0x21b763[_0xa304('0x3e')];_0x51c4b1[_0xa304('0x47')]=qs[_0xa304('0x48')](_0x266dda['query'][_0xa304('0x48')]);_0x51c4b1[_0xa304('0x49')]=qs['filters'](_[_0xa304('0x4a')](_0x266dda[_0xa304('0x40')],_0x21b763[_0xa304('0x42')]));if(_0x266dda['query'][_0xa304('0x4b')]){_0x51c4b1['where']=_['merge'](_0x51c4b1[_0xa304('0x49')],{'$or':_['map'](_0x51c4b1[_0xa304('0x45')],function(_0x401d75){var _0x139dff={};_0x139dff[_0x401d75]={'$like':'%'+_0x266dda[_0xa304('0x40')]['filter']+'%'};return _0x139dff;})});}_0x51c4b1=_[_0xa304('0x4c')]({},_0x51c4b1,_0x266dda[_0xa304('0x4e')]);return _0x17befd[_0xa304('0xe8')](_0x51c4b1);}})[_0xa304('0x32')](function(_0x4afca5){if(_0x4afca5){_0x13a22f=_0x4afca5['length'];if(!_0x266dda[_0xa304('0x40')][_0xa304('0x65')](_0xa304('0xc0'))){_0x51c4b1['limit']=qs['limit'](_0x266dda[_0xa304('0x40')]['limit']);_0x51c4b1['offset']=qs['offset'](_0x266dda['query'][_0xa304('0x2b')]);}return _0x17befd['getAgents'](_0x51c4b1);}})[_0xa304('0x32')](function(_0x4c65d5){if(_0x4c65d5){return _0x4c65d5?{'count':_0x13a22f,'rows':_0x4c65d5}:null;}})['then'](respondWithResult(_0x5bce95,null))[_0xa304('0x57')](handleError(_0x5bce95,null));}; \ No newline at end of file +var _0x0e76=['DELIVERED','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','UserProfileResource','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','mandatoryDispositionPause','includeAll','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','length','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','SmsApplication','applications','orderBy','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','text','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','SmsQueue','queue','waitForTheAssignedQueue','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','DESC','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','groupName','clickatell','intelepeer','redif'];(function(_0x2394fd,_0x5e8f2b){var _0x4caa72=function(_0x294536){while(--_0x294536){_0x2394fd['push'](_0x2394fd['shift']());}};_0x4caa72(++_0x5e8f2b);}(_0x0e76,0x102));var _0x60e7=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x0e76[_0x28fbbf];return _0x543af6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60e7('0x0'));var zipdir=require(_0x60e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60e7('0x2'));var moment=require(_0x60e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x60e7('0x4'));var util=require('util');var path=require(_0x60e7('0x5'));var sox=require(_0x60e7('0x6'));var csv=require('to-csv');var ejs=require(_0x60e7('0x7'));var fs=require('fs');var fs_extra=require(_0x60e7('0x8'));var _=require(_0x60e7('0x9'));var squel=require('squel');var crypto=require(_0x60e7('0xa'));var jsforce=require(_0x60e7('0xb'));var deskjs=require(_0x60e7('0xc'));var toCsv=require(_0x60e7('0xd'));var querystring=require(_0x60e7('0xe'));var Papa=require(_0x60e7('0xf'));var Redis=require(_0x60e7('0x10'));var authService=require(_0x60e7('0x11'));var qs=require(_0x60e7('0x12'));var as=require(_0x60e7('0x13'));var hardwareService=require(_0x60e7('0x14'));var logger=require(_0x60e7('0x15'))(_0x60e7('0x16'));var utils=require(_0x60e7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x60e7('0x18'));var db=require(_0x60e7('0x19'))['db'];config[_0x60e7('0x1a')]=_[_0x60e7('0x1b')](config[_0x60e7('0x1a')],{'host':_0x60e7('0x1c'),'port':0x18eb});var socket=require(_0x60e7('0x1d'))(new Redis(config[_0x60e7('0x1a')]));require(_0x60e7('0x1e'))[_0x60e7('0x1f')](socket);var jayson=require(_0x60e7('0x20'));var client=jayson[_0x60e7('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x589191,_0x230e9c,_0x219c5d,_0x58f604){return new BPromise(function(_0x464cd7,_0x549389){var _0x4188eb=_0x58f604||client;return _0x4188eb[_0x60e7('0x22')](_0x589191,_0x219c5d)['then'](function(_0x66a3dc){logger[_0x60e7('0x23')](_0x60e7('0x24'),_0x230e9c,_0x60e7('0x25'));logger['debug'](_0x60e7('0x26'),_0x230e9c,_0x60e7('0x25'),JSON[_0x60e7('0x27')](_0x66a3dc));if(_0x66a3dc['error']){if(_0x66a3dc[_0x60e7('0x28')][_0x60e7('0x29')]===0x1f4){logger[_0x60e7('0x28')](_0x60e7('0x24'),_0x230e9c,_0x66a3dc[_0x60e7('0x28')][_0x60e7('0x2a')]);return _0x549389(_0x66a3dc[_0x60e7('0x28')]['message']);}logger[_0x60e7('0x28')]('SmsAccount,\x20%s,\x20%s',_0x230e9c,_0x66a3dc[_0x60e7('0x28')][_0x60e7('0x2a')]);return _0x464cd7(_0x66a3dc[_0x60e7('0x28')][_0x60e7('0x2a')]);}else{logger[_0x60e7('0x23')](_0x60e7('0x24'),_0x230e9c,_0x60e7('0x25'));_0x464cd7(_0x66a3dc[_0x60e7('0x2b')][_0x60e7('0x2a')]);}})['catch'](function(_0x1ec157){logger[_0x60e7('0x28')](_0x60e7('0x24'),_0x230e9c,_0x1ec157);_0x549389(_0x1ec157);});});}function respondWithStatusCode(_0x1787dc,_0x655254){_0x655254=_0x655254||0xcc;return function(_0x4cba17){if(_0x4cba17){return _0x1787dc[_0x60e7('0x2c')](_0x655254);}return _0x1787dc[_0x60e7('0x2d')](_0x655254)[_0x60e7('0x2e')]();};}function respondWithResult(_0x49fc90,_0x5024f0){_0x5024f0=_0x5024f0||0xc8;return function(_0x34053b){if(_0x34053b){return _0x49fc90[_0x60e7('0x2d')](_0x5024f0)[_0x60e7('0x2f')](_0x34053b);}};}function respondWithFilteredResult(_0x18eead,_0x219d5b){return function(_0xde3fd4){if(_0xde3fd4){var _0x12ff24=typeof _0x219d5b[_0x60e7('0x30')]==='undefined'&&typeof _0x219d5b[_0x60e7('0x31')]===_0x60e7('0x32');var _0x4530ca=_0xde3fd4['count'];var _0x5c24f7=_0x12ff24?0x0:_0x219d5b[_0x60e7('0x30')];var _0x525d3c=_0x12ff24?_0xde3fd4[_0x60e7('0x33')]:_0x219d5b[_0x60e7('0x30')]+_0x219d5b[_0x60e7('0x31')];var _0x5a83ae;if(_0x525d3c>=_0x4530ca){_0x525d3c=_0x4530ca;_0x5a83ae=0xc8;}else{_0x5a83ae=0xce;}_0x18eead[_0x60e7('0x2d')](_0x5a83ae);return _0x18eead[_0x60e7('0x34')](_0x60e7('0x35'),_0x5c24f7+'-'+_0x525d3c+'/'+_0x4530ca)[_0x60e7('0x2f')](_0xde3fd4);}return null;};}function patchUpdates(_0x3e8b35){return function(_0x1bbb4a){try{jsonpatch[_0x60e7('0x36')](_0x1bbb4a,_0x3e8b35,!![]);}catch(_0x428e5e){return BPromise['reject'](_0x428e5e);}return _0x1bbb4a[_0x60e7('0x37')]();};}function saveUpdates(_0x53f71,_0xa81709){return function(_0x33a485){if(_0x33a485){return _0x33a485[_0x60e7('0x38')](_0x53f71)['then'](function(_0x2a30fe){return _0x2a30fe;});}return null;};}function removeEntity(_0x50e0a9,_0x36188e){return function(_0x2e4613){if(_0x2e4613){return _0x2e4613[_0x60e7('0x39')]()[_0x60e7('0x3a')](function(){var _0x5c4829=_0x2e4613['get']({'plain':!![]});var _0x51437f='SmsAccounts';return db[_0x60e7('0x3b')][_0x60e7('0x39')]({'where':{'type':_0x51437f,'resourceId':_0x5c4829['id']}})[_0x60e7('0x3a')](function(){return _0x2e4613;});})[_0x60e7('0x3a')](function(){_0x50e0a9[_0x60e7('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea7c9,_0x316b96){return function(_0x21716f){if(!_0x21716f){_0x4ea7c9[_0x60e7('0x2c')](0x194);}return _0x21716f;};}function handleError(_0x16d19a,_0x3e63c8){_0x3e63c8=_0x3e63c8||0x1f4;return function(_0x3269f2){logger['error'](_0x3269f2[_0x60e7('0x3c')]);if(_0x3269f2['name']){delete _0x3269f2[_0x60e7('0x3d')];}_0x16d19a[_0x60e7('0x2d')](_0x3e63c8)[_0x60e7('0x3e')](_0x3269f2);};}exports[_0x60e7('0x3f')]=function(_0x448c55,_0x283c5f){var _0x2c8b1c={'include':[{'model':db[_0x60e7('0x40')],'as':'mandatoryDispositionPause'}]},_0x46f193={},_0x44ad03={'count':0x0,'rows':[]};var _0x430880=_[_0x60e7('0x41')](db[_0x60e7('0x42')][_0x60e7('0x43')],function(_0x442690){return{'name':_0x442690[_0x60e7('0x44')],'type':_0x442690[_0x60e7('0x45')][_0x60e7('0x46')]};});_0x46f193['model']=_[_0x60e7('0x41')](_0x430880,_0x60e7('0x3d'));_0x46f193[_0x60e7('0x47')]=_[_0x60e7('0x48')](_0x448c55[_0x60e7('0x47')]);_0x46f193[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x46f193[_0x60e7('0x4b')],_0x46f193[_0x60e7('0x47')]);_0x2c8b1c[_0x60e7('0x4c')]=_[_0x60e7('0x4a')](_0x46f193[_0x60e7('0x4b')],qs[_0x60e7('0x4d')](_0x448c55[_0x60e7('0x47')][_0x60e7('0x4d')]));_0x2c8b1c[_0x60e7('0x4c')]=_0x2c8b1c[_0x60e7('0x4c')]['length']?_0x2c8b1c[_0x60e7('0x4c')]:_0x46f193[_0x60e7('0x4b')];if(!_0x448c55['query'][_0x60e7('0x4e')]('nolimit')){_0x2c8b1c[_0x60e7('0x31')]=qs[_0x60e7('0x31')](_0x448c55[_0x60e7('0x47')]['limit']);_0x2c8b1c[_0x60e7('0x30')]=qs['offset'](_0x448c55['query'][_0x60e7('0x30')]);}_0x2c8b1c[_0x60e7('0x4f')]=qs[_0x60e7('0x50')](_0x448c55[_0x60e7('0x47')][_0x60e7('0x50')]);_0x2c8b1c[_0x60e7('0x51')]=qs['filters'](_[_0x60e7('0x52')](_0x448c55[_0x60e7('0x47')],_0x46f193[_0x60e7('0x49')]),_0x430880);if(_0x448c55['query'][_0x60e7('0x53')]){_0x2c8b1c[_0x60e7('0x51')]=_[_0x60e7('0x54')](_0x2c8b1c['where'],{'$or':_['map'](_0x430880,function(_0x208a4b){if(_0x208a4b[_0x60e7('0x45')]!==_0x60e7('0x55')){var _0x17332e={};_0x17332e[_0x208a4b[_0x60e7('0x3d')]]={'$like':'%'+_0x448c55['query'][_0x60e7('0x53')]+'%'};return _0x17332e;}})});}_0x2c8b1c=_['merge']({},_0x2c8b1c,_0x448c55[_0x60e7('0x56')]);var _0x3ea19b={'where':_0x2c8b1c[_0x60e7('0x51')]};return db[_0x60e7('0x42')][_0x60e7('0x33')](_0x3ea19b)[_0x60e7('0x3a')](function(_0x2b94a0){_0x44ad03[_0x60e7('0x33')]=_0x2b94a0;if(_0x448c55['query']['includeAll']){_0x2c8b1c[_0x60e7('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0x60e7('0x58')](_0x2c8b1c);})[_0x60e7('0x3a')](function(_0x173ead){_0x44ad03[_0x60e7('0x59')]=_0x173ead;return _0x44ad03;})[_0x60e7('0x3a')](respondWithFilteredResult(_0x283c5f,_0x2c8b1c))[_0x60e7('0x5a')](handleError(_0x283c5f,null));};exports[_0x60e7('0x5b')]=function(_0x1fa6ac,_0x35c7b1){var _0x1e3703={'raw':![],'where':{'id':_0x1fa6ac[_0x60e7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x60e7('0x5d')}]},_0xcac76e={};_0xcac76e[_0x60e7('0x4b')]=_['keys'](db[_0x60e7('0x42')][_0x60e7('0x43')]);_0xcac76e[_0x60e7('0x47')]=_[_0x60e7('0x48')](_0x1fa6ac['query']);_0xcac76e['filters']=_[_0x60e7('0x4a')](_0xcac76e[_0x60e7('0x4b')],_0xcac76e['query']);_0x1e3703[_0x60e7('0x4c')]=_[_0x60e7('0x4a')](_0xcac76e['model'],qs['fields'](_0x1fa6ac[_0x60e7('0x47')][_0x60e7('0x4d')]));_0x1e3703['attributes']=_0x1e3703[_0x60e7('0x4c')]['length']?_0x1e3703[_0x60e7('0x4c')]:_0xcac76e[_0x60e7('0x4b')];if(_0x1fa6ac['query'][_0x60e7('0x5e')]){_0x1e3703[_0x60e7('0x57')]=[{'all':!![]}];}_0x1e3703=_[_0x60e7('0x54')]({},_0x1e3703,_0x1fa6ac['options']);return db[_0x60e7('0x42')][_0x60e7('0x5f')](_0x1e3703)[_0x60e7('0x3a')](handleEntityNotFound(_0x35c7b1,null))[_0x60e7('0x3a')](respondWithResult(_0x35c7b1,null))[_0x60e7('0x5a')](handleError(_0x35c7b1,null));};exports['create']=function(_0x403abf,_0x657c){return db[_0x60e7('0x42')][_0x60e7('0x60')](_0x403abf[_0x60e7('0x61')],{})[_0x60e7('0x3a')](function(_0xf7c448){var _0xf20385=_0x403abf[_0x60e7('0x62')]['get']({'plain':!![]});if(!_0xf20385)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf20385['role']===_0x60e7('0x62')){var _0x18f0b9=_0xf7c448[_0x60e7('0x63')]({'plain':!![]});var _0x3a8ced='SmsAccounts';return db[_0x60e7('0x64')]['find']({'where':{'name':_0x3a8ced,'userProfileId':_0xf20385['userProfileId']},'raw':!![]})[_0x60e7('0x3a')](function(_0x4ded24){if(_0x4ded24&&_0x4ded24[_0x60e7('0x65')]===0x0){return db['UserProfileResource'][_0x60e7('0x60')]({'name':_0x18f0b9['name'],'resourceId':_0x18f0b9['id'],'type':_0x4ded24['name'],'sectionId':_0x4ded24['id']},{})[_0x60e7('0x3a')](function(){return _0xf7c448;});}else{return _0xf7c448;}})[_0x60e7('0x5a')](function(_0x20dc64){logger[_0x60e7('0x28')](_0x60e7('0x66'),_0x20dc64);throw _0x20dc64;});}return _0xf7c448;})[_0x60e7('0x3a')](respondWithResult(_0x657c,0xc9))[_0x60e7('0x5a')](handleError(_0x657c,null));};exports[_0x60e7('0x38')]=function(_0x1dbad9,_0x3b64aa){if(_0x1dbad9[_0x60e7('0x61')]['id']){delete _0x1dbad9['body']['id'];}return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x1dbad9[_0x60e7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x60e7('0x5d')}]})['then'](handleEntityNotFound(_0x3b64aa,null))['then'](saveUpdates(_0x1dbad9[_0x60e7('0x61')],null))[_0x60e7('0x3a')](respondWithResult(_0x3b64aa,null))[_0x60e7('0x5a')](handleError(_0x3b64aa,null));};exports[_0x60e7('0x39')]=function(_0x1402f9,_0x91acbc){return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x1402f9[_0x60e7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x91acbc,null))[_0x60e7('0x3a')](removeEntity(_0x91acbc,null))[_0x60e7('0x5a')](handleError(_0x91acbc,null));};exports['describe']=function(_0x1afcb8,_0x3cb0ec){return db[_0x60e7('0x42')][_0x60e7('0x67')]()[_0x60e7('0x3a')](respondWithResult(_0x3cb0ec,null))['catch'](handleError(_0x3cb0ec,null));};exports[_0x60e7('0x68')]=function(_0x33c9e8,_0x2c874f,_0x3814c9){if(_0x33c9e8[_0x60e7('0x61')]['id']){delete _0x33c9e8[_0x60e7('0x61')]['id'];}return db['SmsAccount'][_0x60e7('0x5f')]({'where':{'id':_0x33c9e8[_0x60e7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2c874f,null))['then'](function(_0x588253){if(_0x588253){_0x33c9e8[_0x60e7('0x61')][_0x60e7('0x69')]=_0x588253['id'];return db[_0x60e7('0x6a')]['create'](_0x33c9e8[_0x60e7('0x61')]);}})[_0x60e7('0x3a')](respondWithResult(_0x2c874f,null))[_0x60e7('0x5a')](handleError(_0x2c874f,null));};exports[_0x60e7('0x6b')]=function(_0x1abe43,_0x26ceb2,_0x707e9c){var _0x274dc2={'raw':![],'where':{}};var _0x46f4f4={};var _0xc87c13={'count':0x0,'rows':[]};return db[_0x60e7('0x42')][_0x60e7('0x6c')]({'where':{'id':_0x1abe43[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x26ceb2,null))[_0x60e7('0x3a')](function(_0x411ceb){if(_0x411ceb){_0x46f4f4[_0x60e7('0x4b')]=_[_0x60e7('0x48')](db[_0x60e7('0x6a')][_0x60e7('0x43')]);_0x46f4f4[_0x60e7('0x47')]=_[_0x60e7('0x48')](_0x1abe43[_0x60e7('0x47')]);_0x46f4f4[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x46f4f4['model'],_0x46f4f4['query']);_0x274dc2['attributes']=_[_0x60e7('0x4a')](_0x46f4f4[_0x60e7('0x4b')],qs['fields'](_0x1abe43[_0x60e7('0x47')][_0x60e7('0x4d')]));_0x274dc2['attributes']=_0x274dc2[_0x60e7('0x4c')][_0x60e7('0x6d')]?_0x274dc2['attributes']:_0x46f4f4['model'];if(!_0x1abe43[_0x60e7('0x47')][_0x60e7('0x4e')](_0x60e7('0x6e'))){_0x274dc2[_0x60e7('0x31')]=qs[_0x60e7('0x31')](_0x1abe43[_0x60e7('0x47')][_0x60e7('0x31')]);_0x274dc2[_0x60e7('0x30')]=qs[_0x60e7('0x30')](_0x1abe43[_0x60e7('0x47')][_0x60e7('0x30')]);}_0x274dc2['order']=qs[_0x60e7('0x50')](_0x1abe43['query']['sort']);_0x274dc2[_0x60e7('0x51')]=qs[_0x60e7('0x49')](_[_0x60e7('0x52')](_0x1abe43[_0x60e7('0x47')],_0x46f4f4[_0x60e7('0x49')]));_0x274dc2[_0x60e7('0x51')][_0x60e7('0x69')]=_0x411ceb['id'];if(_0x1abe43['query'][_0x60e7('0x53')]){_0x274dc2['where']=_[_0x60e7('0x54')](_0x274dc2[_0x60e7('0x51')],{'$or':_[_0x60e7('0x41')](_0x274dc2[_0x60e7('0x4c')],function(_0x353f0a){var _0x14eb35={};_0x14eb35[_0x353f0a]={'$like':'%'+_0x1abe43[_0x60e7('0x47')][_0x60e7('0x53')]+'%'};return _0x14eb35;})});}_0x274dc2=_[_0x60e7('0x54')]({},_0x274dc2,_0x1abe43[_0x60e7('0x56')]);return db['Disposition'][_0x60e7('0x33')]({'where':_0x274dc2['where']})['then'](function(_0x3b34c1){_0xc87c13[_0x60e7('0x33')]=_0x3b34c1;if(_0x1abe43['query']['includeAll']){_0x274dc2[_0x60e7('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x60e7('0x58')](_0x274dc2);})[_0x60e7('0x3a')](function(_0xc811af){_0xc87c13['rows']=_0xc811af;return _0xc87c13;});}})['then'](respondWithFilteredResult(_0x26ceb2,_0x274dc2))['catch'](handleError(_0x26ceb2,null));};exports[_0x60e7('0x6f')]=function(_0x18f4e6,_0x3845f2,_0x29eb9c){return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x18f4e6[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x3845f2,null))[_0x60e7('0x3a')](function(_0x345af4){if(_0x345af4){return _0x345af4[_0x60e7('0x6f')](_0x18f4e6[_0x60e7('0x47')][_0x60e7('0x70')]);}})[_0x60e7('0x3a')](respondWithStatusCode(_0x3845f2,null))[_0x60e7('0x5a')](handleError(_0x3845f2,null));};exports[_0x60e7('0x71')]=function(_0x115f1f,_0x306a5a,_0x44a00c){if(_0x115f1f[_0x60e7('0x61')]['id']){delete _0x115f1f[_0x60e7('0x61')]['id'];}return db[_0x60e7('0x42')]['find']({'where':{'id':_0x115f1f[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x306a5a,null))[_0x60e7('0x3a')](function(_0x510019){if(_0x510019){_0x115f1f[_0x60e7('0x61')]['SmsAccountId']=_0x510019['id'];return db[_0x60e7('0x72')]['create'](_0x115f1f[_0x60e7('0x61')]);}})[_0x60e7('0x3a')](respondWithResult(_0x306a5a,null))[_0x60e7('0x5a')](handleError(_0x306a5a,null));};exports['getAnswers']=function(_0x245988,_0x34a72f,_0x1063ce){var _0x32265a={'raw':![],'where':{}};var _0x160da2={};var _0x13bc05={'count':0x0,'rows':[]};return db['SmsAccount'][_0x60e7('0x6c')]({'where':{'id':_0x245988[_0x60e7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x34a72f,null))[_0x60e7('0x3a')](function(_0x389e31){if(_0x389e31){_0x160da2[_0x60e7('0x4b')]=_[_0x60e7('0x48')](db[_0x60e7('0x72')]['rawAttributes']);_0x160da2[_0x60e7('0x47')]=_[_0x60e7('0x48')](_0x245988[_0x60e7('0x47')]);_0x160da2[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x160da2['model'],_0x160da2['query']);_0x32265a['attributes']=_[_0x60e7('0x4a')](_0x160da2[_0x60e7('0x4b')],qs[_0x60e7('0x4d')](_0x245988[_0x60e7('0x47')]['fields']));_0x32265a[_0x60e7('0x4c')]=_0x32265a[_0x60e7('0x4c')]['length']?_0x32265a['attributes']:_0x160da2[_0x60e7('0x4b')];if(!_0x245988[_0x60e7('0x47')]['hasOwnProperty'](_0x60e7('0x6e'))){_0x32265a[_0x60e7('0x31')]=qs[_0x60e7('0x31')](_0x245988[_0x60e7('0x47')]['limit']);_0x32265a[_0x60e7('0x30')]=qs['offset'](_0x245988['query']['offset']);}_0x32265a['order']=qs['sort'](_0x245988[_0x60e7('0x47')][_0x60e7('0x50')]);_0x32265a[_0x60e7('0x51')]=qs[_0x60e7('0x49')](_[_0x60e7('0x52')](_0x245988[_0x60e7('0x47')],_0x160da2[_0x60e7('0x49')]));_0x32265a['where'][_0x60e7('0x69')]=_0x389e31['id'];if(_0x245988[_0x60e7('0x47')][_0x60e7('0x53')]){_0x32265a[_0x60e7('0x51')]=_[_0x60e7('0x54')](_0x32265a[_0x60e7('0x51')],{'$or':_['map'](_0x32265a[_0x60e7('0x4c')],function(_0x404fd5){var _0x1cfd7a={};_0x1cfd7a[_0x404fd5]={'$like':'%'+_0x245988[_0x60e7('0x47')][_0x60e7('0x53')]+'%'};return _0x1cfd7a;})});}_0x32265a=_[_0x60e7('0x54')]({},_0x32265a,_0x245988[_0x60e7('0x56')]);return db[_0x60e7('0x72')][_0x60e7('0x33')]({'where':_0x32265a[_0x60e7('0x51')]})[_0x60e7('0x3a')](function(_0x30b55f){_0x13bc05[_0x60e7('0x33')]=_0x30b55f;if(_0x245988[_0x60e7('0x47')]['includeAll']){_0x32265a[_0x60e7('0x57')]=[{'all':!![]}];}return db[_0x60e7('0x72')][_0x60e7('0x58')](_0x32265a);})[_0x60e7('0x3a')](function(_0x12660f){_0x13bc05['rows']=_0x12660f;return _0x13bc05;});}})['then'](respondWithFilteredResult(_0x34a72f,_0x32265a))[_0x60e7('0x5a')](handleError(_0x34a72f,null));};exports['removeAnswers']=function(_0x190158,_0x2a62d8,_0x2c73c0){return db[_0x60e7('0x42')]['find']({'where':{'id':_0x190158[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x2a62d8,null))[_0x60e7('0x3a')](function(_0x47eacb){if(_0x47eacb){return _0x47eacb[_0x60e7('0x73')](_0x190158[_0x60e7('0x47')][_0x60e7('0x70')]);}})[_0x60e7('0x3a')](respondWithStatusCode(_0x2a62d8,null))['catch'](handleError(_0x2a62d8,null));};exports[_0x60e7('0x74')]=function(_0x158d83,_0x303201,_0x32b57b){var _0x18dcbe={'channel':'sms'};var _0x26dfdf=[];var _0x2c07f1=[];var _0x29278e={};return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x158d83[_0x60e7('0x5c')]['id']},'include':[{'model':db[_0x60e7('0x75')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x303201,null))['then'](function(_0x113cff){_0x18dcbe['account']=_0x113cff;_0x18dcbe[_0x60e7('0x76')]=_[_0x60e7('0x77')](_0x113cff[_0x60e7('0x78')],[_0x60e7('0x79')],[_0x60e7('0x7a')]);if(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0x78')]){delete _0x18dcbe[_0x60e7('0x7b')]['Applications'];}return db[_0x60e7('0x7c')][_0x60e7('0x67')]();})[_0x60e7('0x3a')](function(_0x623293){if(!_0x623293){throw new db[(_0x60e7('0x7d'))][(_0x60e7('0x7e'))]('no\x20available\x20attributes');}_0x26dfdf=_['difference'](_[_0x60e7('0x48')](_0x623293),['createdAt',_0x60e7('0x7f')]);_0x2c07f1=_[_0x60e7('0x80')](_[_0x60e7('0x48')](_0x623293),[_0x60e7('0x81'),_0x60e7('0x7f'),_0x60e7('0x82'),_0x60e7('0x83')]);_0x18dcbe[_0x60e7('0x61')]={'mapKey':_0x60e7('0x84')};if(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0x45')]){switch(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0x45')]){case _0x60e7('0x85'):_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x87')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83['body'][_0x60e7('0x88')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x89')]=_0x158d83['body'][_0x60e7('0x8a')];break;case'skebby':_0x18dcbe[_0x60e7('0x61')]['from']='+'+_0x158d83[_0x60e7('0x61')]['sender'];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83['body'][_0x60e7('0x8b')];break;case'connectel':_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')]=_0x158d83['body'][_0x60e7('0x86')];_0x18dcbe[_0x60e7('0x61')]['body']=_0x158d83[_0x60e7('0x61')]['message'];break;case _0x60e7('0x8c'):_0x18dcbe[_0x60e7('0x61')]['from']=_0x158d83['body'][_0x60e7('0x86')];_0x18dcbe['body'][_0x60e7('0x61')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x61')];_0x18dcbe['body'][_0x60e7('0x89')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x8d')];break;case _0x60e7('0x8e'):_0x18dcbe['body'][_0x60e7('0x86')]=_0x158d83['body'][_0x60e7('0x87')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83[_0x60e7('0x61')]['Text'];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x89')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x8f')];break;case _0x60e7('0x90'):_0x18dcbe['body'][_0x60e7('0x86')]='+'+_0x158d83[_0x60e7('0x61')][_0x60e7('0x91')][0x0][_0x60e7('0x86')];_0x18dcbe['body'][_0x60e7('0x61')]=_0x158d83[_0x60e7('0x61')]['results'][0x0][_0x60e7('0x8b')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x89')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x91')][0x0]['messageId'];break;case _0x60e7('0x92'):_0x18dcbe['body'][_0x60e7('0x86')]=_0x158d83['body'][_0x60e7('0x93')];_0x18dcbe[_0x60e7('0x61')]['body']=_0x158d83[_0x60e7('0x61')][_0x60e7('0x94')]['message'];break;case'clickatell':_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x95')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x8b')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x89')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x96')];break;case _0x60e7('0x97'):_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x89')]=_0x158d83[_0x60e7('0x61')][0x0][_0x60e7('0x2a')]['id'];_0x18dcbe['body'][_0x60e7('0x86')]=_0x158d83[_0x60e7('0x61')][0x0][_0x60e7('0x2a')][_0x60e7('0x86')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83['body'][0x0]['message'][_0x60e7('0x8b')];break;case'intelepeer':_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')]=_0x158d83[_0x60e7('0x61')][_0x60e7('0x86')];_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]=_0x158d83[_0x60e7('0x61')]['message'];_0x18dcbe[_0x60e7('0x61')]['messageId']=_0x158d83[_0x60e7('0x61')][_0x60e7('0x98')];break;}}if(_0x18dcbe[_0x60e7('0x61')]['id']){delete _0x18dcbe[_0x60e7('0x61')]['id'];}if(_[_0x60e7('0x99')](_0x18dcbe['body'][_0x60e7('0x86')])){throw new db['Sequelize'][(_0x60e7('0x7e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x18dcbe['body'][_0x60e7('0x61')])||_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x61')]===''){throw new db[(_0x60e7('0x7d'))]['ValidationError'](_0x60e7('0x9a'));}if(_['isNil'](_0x18dcbe[_0x60e7('0x61')]['mapKey'])){throw new db[(_0x60e7('0x7d'))][(_0x60e7('0x7e'))](_0x60e7('0x9b')+_0x2c07f1);}if(!_[_0x60e7('0x9c')](_0x2c07f1,_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x9d')])){throw new db[(_0x60e7('0x7d'))]['ValidationError'](_0x60e7('0x9e')+_0x2c07f1);}_0x29278e[_0x18dcbe[_0x60e7('0x61')]['mapKey']]=_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')];return db[_0x60e7('0x9f')][_0x60e7('0x5f')]({'where':{'id':_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0x83')]},'include':[{'model':db[_0x60e7('0x7c')],'as':_0x60e7('0xa0'),'where':_0x29278e,'limit':0x1,'order':[[_0x60e7('0x7f'),'DESC']]}]});})[_0x60e7('0x3a')](handleEntityNotFound(_0x303201,null))[_0x60e7('0x3a')](function(_0xb4d9e4){if(_0xb4d9e4){_0x18dcbe[_0x60e7('0xa1')]=_[_0x60e7('0xa2')](_0xb4d9e4,[_0x60e7('0xa0')]);if(_0xb4d9e4[_0x60e7('0xa0')][_0x60e7('0x6d')]){return _0xb4d9e4['Contacts'][0x0];}var _0x2ce6f2=_[_0x60e7('0x1b')](_0x18dcbe[_0x60e7('0x61')],{'firstName':_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')],'ListId':_0xb4d9e4['id']});_0x2ce6f2[_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x9d')]]=_0x18dcbe[_0x60e7('0x61')]['from'];return db[_0x60e7('0x7c')][_0x60e7('0x60')](_0x2ce6f2,{'fields':_0x26dfdf,'raw':!![]});}})[_0x60e7('0x3a')](handleEntityNotFound(_0x303201,null))[_0x60e7('0x3a')](function(_0x1b4eec){if(_0x1b4eec){_0x18dcbe[_0x60e7('0xa3')]=_0x1b4eec;var _0x56c6f9={'ContactId':_0x1b4eec['id'],'phone':_0x18dcbe[_0x60e7('0x61')][_0x60e7('0x86')],'SmsAccountId':_0x158d83['params']['id']};var _0x2ecb3e={'ContactId':_0x1b4eec['id'],'SmsAccountId':_0x158d83[_0x60e7('0x5c')]['id'],'closed':![]};return db[_0x60e7('0xa4')][_0x60e7('0x5f')]({'where':_0x2ecb3e})[_0x60e7('0x3a')](function(_0x4ab14c){if(_0x4ab14c){return[_0x4ab14c,![]];}return db[_0x60e7('0xa4')][_0x60e7('0x60')](_0x56c6f9)['then'](function(_0x2dfd8d){return[_0x2dfd8d,!![]];});});}})[_0x60e7('0xa5')](function(_0x5daad2,_0x10d839){_0x18dcbe[_0x60e7('0xa6')]=_0x5daad2[_0x60e7('0x63')]({'plain':!![]});_0x18dcbe[_0x60e7('0xa6')][_0x60e7('0xa7')]=![];if(_0x10d839){if(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0xa8')]){_0x18dcbe['applications'][_0x60e7('0xa9')]({'id':0x0,'priority':_0x18dcbe[_0x60e7('0x76')]['length']+0x1,'app':_0x60e7('0xaa'),'appdata':_0x60e7('0xab'),'interval':'*,*,*,*'});}_0x18dcbe[_0x60e7('0xa6')][_0x60e7('0xa7')]=!![];}return db[_0x60e7('0xac')][_0x60e7('0x60')]({'phone':_0x18dcbe['body'][_0x60e7('0x86')],'messageId':_0x18dcbe['body'][_0x60e7('0x89')],'body':_0x18dcbe['body'][_0x60e7('0x61')],'SmsAccountId':_0x158d83[_0x60e7('0x5c')]['id'],'SmsInteractionId':_0x5daad2['id'],'direction':'in','ContactId':_0x5daad2[_0x60e7('0xad')],'AttachmentId':_0x18dcbe['body'][_0x60e7('0xae')]});})[_0x60e7('0x3a')](function(_0x4be56a){_0x18dcbe[_0x60e7('0x2a')]=_0x4be56a;if(!_0x18dcbe[_0x60e7('0xa6')][_0x60e7('0xaf')])return;return db[_0x60e7('0xb0')][_0x60e7('0x5f')]({'attributes':['id',_0x60e7('0x3d')],'where':{'id':_0x18dcbe[_0x60e7('0xa6')]['UserId']}});})[_0x60e7('0x3a')](function(_0x58a7f9){if(_0x58a7f9){_0x18dcbe[_0x60e7('0x76')][_0x60e7('0xb1')]({'id':0x0,'priority':0x0,'app':_0x60e7('0xb2'),'appdata':_0x58a7f9[_0x60e7('0x3d')]+','+(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0xb3')]||0xa),'interval':_0x60e7('0xb4')});}if(!_0x18dcbe['interaction'][_0x60e7('0xb5')])return;return db[_0x60e7('0xb6')][_0x60e7('0x5f')]({'attributes':['id',_0x60e7('0x3d')],'where':{'id':_0x18dcbe[_0x60e7('0xa6')][_0x60e7('0xb5')]}});})[_0x60e7('0x3a')](function(_0x3746da){if(_0x3746da){_0x18dcbe[_0x60e7('0x76')][_0x60e7('0xb1')]({'id':0x0,'priority':0x1,'app':_0x60e7('0xb7'),'appdata':_0x3746da[_0x60e7('0x3d')]+','+(_0x18dcbe[_0x60e7('0x7b')][_0x60e7('0xb8')]||0x12c),'interval':_0x60e7('0xb4')});}return respondWithRpcPromise('Start',_0x60e7('0xb9'),_0x18dcbe);})['then'](function(_0x2b1756){if(_0x2b1756){var _0x26f0c3=0xc8;var _0x3b0b0b='receiveMessage';logger[_0x60e7('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3b0b0b,_0x26f0c3,_0x60e7('0xba'));logger[_0x60e7('0xbb')](_0x60e7('0xbc'),_0x3b0b0b,_0x26f0c3,_0x60e7('0xba'),JSON['stringify'](_0x2b1756));if(_0x18dcbe['account'][_0x60e7('0x45')]===_0x60e7('0x85')){return _0x303201[_0x60e7('0x2d')](_0x26f0c3)['set']('Content-Type',_0x60e7('0xbd'))[_0x60e7('0x3e')]('\x0a');}else{return _0x303201[_0x60e7('0x2d')](_0x26f0c3)[_0x60e7('0x2f')](_0x2b1756);}}})['catch'](handleError(_0x303201,null));};exports[_0x60e7('0xbe')]=function(_0x2820b4,_0x3a6b3c){var _0x38ac61=_0x2820b4['params']['id'];var _0x339a28=_0x2820b4[_0x60e7('0x61')];var _0x51c0d4=0xc8;var _0x12b244=null;return db[_0x60e7('0xbf')][_0x60e7('0xc0')]({'isolationLevel':db[_0x60e7('0xbf')]['Transaction'][_0x60e7('0xc1')][_0x60e7('0xc2')]},function(_0x2c4674){return db[_0x60e7('0x42')][_0x60e7('0x6c')]({'where':{'id':_0x38ac61},'transaction':_0x2c4674})[_0x60e7('0x3a')](function(_0x290b72){if(_0x290b72){return db[_0x60e7('0x75')]['destroy']({'where':{'SmsAccountId':_0x38ac61},'transaction':_0x2c4674})[_0x60e7('0x3a')](function(){var _0x5add63=_[_0x60e7('0x41')](_0x339a28,function(_0x2577b8){_0x2577b8['SmsAccountId']=_0x38ac61;return _0x2577b8;});return db[_0x60e7('0x75')][_0x60e7('0xc3')](_0x5add63,{'transaction':_0x2c4674});});}else{_0x51c0d4=0x194;_0x12b244=[];}});})[_0x60e7('0x3a')](function(){if(_0x51c0d4!==0x194){return db['SmsApplication'][_0x60e7('0xc4')]({'where':{'SmsAccountId':_0x38ac61},'order':'priority'})['then'](function(_0x3b8603){_0x12b244=_0x3b8603;});}})[_0x60e7('0x5a')](function(_0xf5e982){_0x51c0d4=0x1f4;logger[_0x60e7('0x28')](_0xf5e982['stack']);if(_0xf5e982[_0x60e7('0x3d')]){delete _0xf5e982[_0x60e7('0x3d')];}_0x12b244=_0xf5e982;})['finally'](function(){if(_0x12b244===null){_0x3a6b3c[_0x60e7('0x2c')](_0x51c0d4);}else{if(_0x51c0d4===0x1f4){_0x3a6b3c['status'](_0x51c0d4)[_0x60e7('0x3e')](_0x12b244);}else{_0x3a6b3c[_0x60e7('0x2d')](_0x51c0d4)[_0x60e7('0x2f')](_0x12b244);}}});};exports[_0x60e7('0xc5')]=function(_0x3ffdde,_0x3de187,_0x1da62d){var _0x688544={};var _0x2d7167={};var _0x43433d;var _0x451eac;return db[_0x60e7('0x42')][_0x60e7('0x6c')]({'where':{'id':_0x3ffdde['params']['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x3de187,null))[_0x60e7('0x3a')](function(_0x11e9d9){if(_0x11e9d9){_0x43433d=_0x11e9d9;_0x2d7167['model']=_[_0x60e7('0x48')](db[_0x60e7('0x75')][_0x60e7('0x43')]);_0x2d7167[_0x60e7('0x47')]=_['keys'](_0x3ffdde[_0x60e7('0x47')]);_0x2d7167[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x2d7167['model'],_0x2d7167['query']);_0x688544[_0x60e7('0x4c')]=_['intersection'](_0x2d7167[_0x60e7('0x4b')],qs['fields'](_0x3ffdde[_0x60e7('0x47')]['fields']));_0x688544['attributes']=_0x688544[_0x60e7('0x4c')]['length']?_0x688544[_0x60e7('0x4c')]:_0x2d7167[_0x60e7('0x4b')];_0x688544['order']=qs[_0x60e7('0x50')](_0x3ffdde['query']['sort']);_0x688544[_0x60e7('0x51')]=qs[_0x60e7('0x49')](_['pick'](_0x3ffdde['query'],_0x2d7167[_0x60e7('0x49')]));if(_0x3ffdde[_0x60e7('0x47')][_0x60e7('0x53')]){_0x688544['where']=_[_0x60e7('0x54')](_0x688544[_0x60e7('0x51')],{'$or':_[_0x60e7('0x41')](_0x688544[_0x60e7('0x4c')],function(_0xe6510d){var _0x4ea7aa={};_0x4ea7aa[_0xe6510d]={'$like':'%'+_0x3ffdde[_0x60e7('0x47')][_0x60e7('0x53')]+'%'};return _0x4ea7aa;})});}_0x688544=_[_0x60e7('0x54')]({},_0x688544,_0x3ffdde[_0x60e7('0x56')]);return _0x43433d[_0x60e7('0xc5')](_0x688544);}})['then'](function(_0x189f69){if(_0x189f69){_0x451eac=_0x189f69['length'];if(!_0x3ffdde[_0x60e7('0x47')][_0x60e7('0x4e')]('nolimit')){_0x688544[_0x60e7('0x31')]=qs[_0x60e7('0x31')](_0x3ffdde[_0x60e7('0x47')][_0x60e7('0x31')]);_0x688544['offset']=qs[_0x60e7('0x30')](_0x3ffdde['query'][_0x60e7('0x30')]);}return _0x43433d[_0x60e7('0xc5')](_0x688544);}})[_0x60e7('0x3a')](function(_0x132ff5){if(_0x132ff5){return _0x132ff5?{'count':_0x451eac,'rows':_0x132ff5}:null;}})[_0x60e7('0x3a')](respondWithResult(_0x3de187,null))[_0x60e7('0x5a')](handleError(_0x3de187,null));};exports[_0x60e7('0xc6')]=function(_0x223c7b,_0x71e140,_0x4023f2){var _0x4ffc56={'raw':![],'where':{}};var _0x2e2e24={};var _0x361066={'count':0x0,'rows':[]};return db[_0x60e7('0x42')][_0x60e7('0x6c')]({'where':{'id':_0x223c7b[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x71e140,null))[_0x60e7('0x3a')](function(_0x309909){if(_0x309909){_0x2e2e24[_0x60e7('0x4b')]=_['keys'](db[_0x60e7('0xa4')][_0x60e7('0x43')]);_0x2e2e24['query']=_['keys'](_0x223c7b['query']);_0x2e2e24[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x2e2e24['model'],_0x2e2e24[_0x60e7('0x47')]);_0x4ffc56[_0x60e7('0x4c')]=_[_0x60e7('0x4a')](_0x2e2e24[_0x60e7('0x4b')],qs[_0x60e7('0x4d')](_0x223c7b[_0x60e7('0x47')][_0x60e7('0x4d')]));_0x4ffc56[_0x60e7('0x4c')]=_0x4ffc56[_0x60e7('0x4c')][_0x60e7('0x6d')]?_0x4ffc56[_0x60e7('0x4c')]:_0x2e2e24['model'];if(!_0x223c7b['query']['hasOwnProperty'](_0x60e7('0x6e'))){_0x4ffc56['limit']=qs[_0x60e7('0x31')](_0x223c7b[_0x60e7('0x47')][_0x60e7('0x31')]);_0x4ffc56[_0x60e7('0x30')]=qs[_0x60e7('0x30')](_0x223c7b[_0x60e7('0x47')][_0x60e7('0x30')]);}_0x4ffc56[_0x60e7('0x4f')]=qs[_0x60e7('0x50')](_0x223c7b['query'][_0x60e7('0x50')]);_0x4ffc56[_0x60e7('0x51')]=qs[_0x60e7('0x49')](_[_0x60e7('0x52')](_0x223c7b['query'],_0x2e2e24[_0x60e7('0x49')]));_0x4ffc56[_0x60e7('0x51')][_0x60e7('0x69')]=_0x309909['id'];if(_0x223c7b[_0x60e7('0x47')][_0x60e7('0x53')]){_0x4ffc56['where']=_[_0x60e7('0x54')](_0x4ffc56[_0x60e7('0x51')],{'$or':_[_0x60e7('0x41')](_0x4ffc56[_0x60e7('0x4c')],function(_0x91ecd8){var _0x4a5748={};_0x4a5748[_0x91ecd8]={'$like':'%'+_0x223c7b['query'][_0x60e7('0x53')]+'%'};return _0x4a5748;})});}_0x4ffc56=_[_0x60e7('0x54')]({},_0x4ffc56,_0x223c7b[_0x60e7('0x56')]);return db[_0x60e7('0xa4')][_0x60e7('0x33')]({'where':_0x4ffc56[_0x60e7('0x51')]})[_0x60e7('0x3a')](function(_0x3ba37e){_0x361066[_0x60e7('0x33')]=_0x3ba37e;if(_0x223c7b['query'][_0x60e7('0x5e')]){_0x4ffc56['include']=[{'model':db[_0x60e7('0x7c')],'as':'Contact','required':![]},{'model':db[_0x60e7('0xb0')],'as':_0x60e7('0xc7'),'attributes':['name',_0x60e7('0xc8'),_0x60e7('0xc9')],'required':![]},{'model':db[_0x60e7('0xca')],'as':_0x60e7('0xcb'),'attributes':['id',_0x60e7('0x3d'),_0x60e7('0xcc')],'where':_0x223c7b[_0x60e7('0x47')][_0x60e7('0xcd')]?{'id':_0x223c7b['query'][_0x60e7('0xcd')]}:undefined,'required':_0x223c7b[_0x60e7('0x47')][_0x60e7('0xcd')]?!![]:![]}];}return db['SmsInteraction'][_0x60e7('0x58')](_0x4ffc56);})[_0x60e7('0x3a')](function(_0x2976e2){_0x361066['rows']=_0x2976e2;return _0x361066;});}})[_0x60e7('0x3a')](respondWithFilteredResult(_0x71e140,_0x4ffc56))[_0x60e7('0x5a')](handleError(_0x71e140,null));};exports[_0x60e7('0x3e')]=function(_0x3dbd4b,_0x1eb0bb,_0x35be92){var _0x54f13a,_0x19a82b,_0x56bdb7;if(_[_0x60e7('0x99')](_0x3dbd4b[_0x60e7('0x61')]['body'])||_0x3dbd4b['body'][_0x60e7('0x61')]===''){throw new db[(_0x60e7('0x7d'))][(_0x60e7('0x7e'))](_0x60e7('0x9a'));}if(_[_0x60e7('0x99')](_0x3dbd4b[_0x60e7('0x61')]['to'])){throw new db[(_0x60e7('0x7d'))][(_0x60e7('0x7e'))](_0x60e7('0xce'));}_0x54f13a=_0x3dbd4b[_0x60e7('0x61')]['to'];return db[_0x60e7('0x42')]['find']({'where':{'id':_0x3dbd4b[_0x60e7('0x5c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x60e7('0x7c')],'as':'Contacts','where':{'mobile':_0x54f13a},'limit':0x1,'order':[[_0x60e7('0x7f'),_0x60e7('0xcf')]]}]}]})[_0x60e7('0x3a')](handleEntityNotFound(_0x1eb0bb,null))[_0x60e7('0x3a')](function(_0x5dfa30){if(_0x5dfa30&&_0x5dfa30[_0x60e7('0xd0')]){_0x19a82b=_0x5dfa30[_0x60e7('0x63')]({'plain':!![]});if(_0x19a82b[_0x60e7('0xd0')]&&_0x19a82b[_0x60e7('0xd0')][_0x60e7('0xa0')]['length']){return _0x19a82b[_0x60e7('0xd0')][_0x60e7('0xa0')][0x0];}return db[_0x60e7('0x7c')]['create'](_[_0x60e7('0x1b')](_0x3dbd4b[_0x60e7('0x61')],{'firstName':_0x54f13a,'mobile':_0x54f13a,'phone':_0x54f13a,'ListId':_0x19a82b[_0x60e7('0x83')]}));}})[_0x60e7('0x3a')](handleEntityNotFound(_0x1eb0bb,null))['then'](function(_0x40b4fc){if(_0x40b4fc){_0x56bdb7=_0x40b4fc;return db['SmsInteraction']['find']({'where':{'ContactId':_0x56bdb7['id'],'closed':![],'SmsAccountId':_0x19a82b['id']}})[_0x60e7('0x3a')](function(_0x14996b){if(_0x14996b){return[_0x14996b,![]];}return db['SmsInteraction'][_0x60e7('0x60')]({'UserId':_0x3dbd4b[_0x60e7('0x62')]['id'],'ContactId':_0x56bdb7['id'],'SmsAccountId':_0x19a82b['id'],'phone':_0x54f13a,'firstMsgDirection':_0x60e7('0xd1'),'Messages':[_[_0x60e7('0x54')](_0x3dbd4b['body'],{'read':![],'body':_0x3dbd4b[_0x60e7('0x61')][_0x60e7('0x61')],'phone':_0x54f13a,'SmsAccountId':_0x19a82b['id'],'UserId':_0x3dbd4b[_0x60e7('0x62')]['id'],'ContactId':_0x56bdb7['id']})]},{'include':[{'model':db[_0x60e7('0xac')],'as':'Messages'}]})['then'](function(_0x402257){return[_0x402257,!![]];});});}})[_0x60e7('0xa5')](function(_0xf44be8,_0x33a8c6){if(_0x33a8c6){return _0xf44be8;}return db['SmsMessage'][_0x60e7('0x60')](_['merge'](_0x3dbd4b[_0x60e7('0x61')],{'read':![],'body':_0x3dbd4b[_0x60e7('0x61')]['body'],'phone':_0x54f13a,'SmsAccountId':_0x19a82b['id'],'SmsInteractionId':_0xf44be8['id'],'UserId':_0x3dbd4b[_0x60e7('0x62')]['id'],'ContactId':_0x56bdb7['id']}))[_0x60e7('0x3a')](function(_0x59bd22){_0xf44be8['dataValues']['Messages']=[];_0xf44be8[_0x60e7('0xd2')][_0x60e7('0xd3')]['push'](_0x59bd22[_0x60e7('0xd2')]);return _0xf44be8;});})[_0x60e7('0x3a')](respondWithResult(_0x1eb0bb,null))['catch'](handleError(_0x1eb0bb,null));};exports[_0x60e7('0x2d')]=function(_0x33b4e0,_0xd9651c,_0x165a88){if(_0x33b4e0[_0x60e7('0x61')]['id']){delete _0x33b4e0[_0x60e7('0x61')]['id'];}var _0xd0eea5,_0xdbe48,_0x553192;return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x33b4e0[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0xd9651c,null))[_0x60e7('0x3a')](function(_0xdd6fc9){if(_0xdd6fc9){_0x553192=_0xdd6fc9;logger[_0x60e7('0xbb')](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0xd4'),_0xdd6fc9[_0x60e7('0x45')],util[_0x60e7('0xd5')](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));switch(_0xdd6fc9[_0x60e7('0x45')]){case _0x60e7('0xd6'):if(_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xd7')]&&_0x33b4e0['body'][_0x60e7('0x2d')]){_0xdbe48=_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x2d')];return db[_0x60e7('0xac')][_0x60e7('0x5f')]({'where':{'messageId':_0x33b4e0['body'][_0x60e7('0xd7')]}});}break;case'connectel':if(_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xd8')]&&_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xd9')]){_0xdbe48=_0x33b4e0['body']['statusInt'];return db[_0x60e7('0xac')][_0x60e7('0x5f')]({'where':{'messageId':_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xd8')]}});}break;case _0x60e7('0x8c'):if(_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x8d')]&&_0x33b4e0[_0x60e7('0x61')]['status_code']){_0xdbe48=_0x33b4e0[_0x60e7('0x61')]['status_code'];return db[_0x60e7('0xac')][_0x60e7('0x5f')]({'where':{'messageId':_0x33b4e0['body']['message_id']}});}break;case _0x60e7('0x90'):var _0x251c02=_0x33b4e0[_0x60e7('0x61')]['results'][0x0];if(_0x251c02[_0x60e7('0x89')]&&_0x251c02['status']['groupName']==='DELIVERED'){_0xdbe48=_0x251c02['status'][_0x60e7('0xda')];return db['SmsMessage'][_0x60e7('0x5f')]({'where':{'messageId':_0x251c02[_0x60e7('0x89')]}});}break;case _0x60e7('0xdb'):if(_0x33b4e0['body'][_0x60e7('0x89')]&&_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x2d')]){_0xdbe48=_0x33b4e0[_0x60e7('0x61')]['status'];return db[_0x60e7('0xac')][_0x60e7('0x5f')]({'where':{'messageId':_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x89')]}});}break;case _0x60e7('0x97'):if(_0x33b4e0['body'][0x0][_0x60e7('0x2a')]['id']){_0xdbe48=_0x33b4e0['body'][0x0][_0x60e7('0x45')];return db[_0x60e7('0xac')]['find']({'where':{'messageId':_0x33b4e0['body'][0x0][_0x60e7('0x2a')]['id']}});}break;case _0x60e7('0xdc'):if(_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xdd')]&&_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x2d')]){_0xdbe48=_0x33b4e0[_0x60e7('0x61')][_0x60e7('0x2d')];return db[_0x60e7('0xac')][_0x60e7('0x5f')]({'where':{'messageId':_0x33b4e0[_0x60e7('0x61')]['redif']}});}break;}}})[_0x60e7('0x3a')](handleEntityNotFound(_0xd9651c,null))[_0x60e7('0x3a')](function(_0x3b5419){if(_0x3b5419){_0xd0eea5=_0x3b5419;switch(_0x553192[_0x60e7('0x45')]){case'skebby':if(_0xdbe48===_0x60e7('0xde')){return _0xd0eea5['update']({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),'status',_0x60e7('0xd6'),util['inspect'](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));}break;case _0x60e7('0xdf'):if(_0xdbe48==='1'){return _0xd0eea5[_0x60e7('0x38')]({'read':!![]});}else{logger['error'](_0x60e7('0x26'),'status',_0x60e7('0xd6'),util[_0x60e7('0xd5')](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x33b4e0[_0x60e7('0x61')][_0x60e7('0xe0')]&&_0xdbe48>=0xc8&&_0xdbe48<=0xce){return _0xd0eea5['update']({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),_0x60e7('0x2d'),'clicksend',util['inspect'](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));}break;case _0x60e7('0x90'):var _0x16e481=_0x33b4e0[_0x60e7('0x61')]['results'][0x0];if(_0x16e481[_0x60e7('0x2d')][_0x60e7('0xda')]===_0x60e7('0xde')){return _0xd0eea5['update']({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),'status',_0x60e7('0x90'),util[_0x60e7('0xd5')](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));}break;case _0x60e7('0xdb'):if(_0xdbe48==_0x60e7('0xe1')||_0xdbe48==_0x60e7('0xe2')){return _0xd0eea5[_0x60e7('0x38')]({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0xdb'),util[_0x60e7('0xd5')](_0x33b4e0[_0x60e7('0x61')],{'showHidden':![],'depth':null}));}break;case _0x60e7('0x97'):if(_0xdbe48==_0x60e7('0xe3')){return _0xd0eea5[_0x60e7('0x38')]({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0x97'),util[_0x60e7('0xd5')](_0x33b4e0['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0xdbe48===_0x60e7('0xe4')||_0xdbe48===_0x60e7('0xe5')){return _0xd0eea5[_0x60e7('0x38')]({'read':!![]});}else{logger['error'](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0xdc'),util[_0x60e7('0xd5')](_0x33b4e0['body'],{'showHidden':![],'depth':null}));}break;}return _0xd0eea5;}})[_0x60e7('0x3a')](respondWithResult(_0xd9651c,null))['catch'](handleError(_0xd9651c,null));};exports[_0x60e7('0xe6')]=function(_0x3a87bb,_0x536034,_0x144748){var _0x1d1178,_0x37f925,_0x704a7a;return db[_0x60e7('0x42')]['find']({'where':{'id':_0x3a87bb[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x536034,null))['then'](function(_0x3de2dc){if(_0x3de2dc){_0x704a7a=_0x3de2dc;logger['debug'](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0xd4'),_0x3de2dc[_0x60e7('0x45')],util[_0x60e7('0xd5')](_0x3a87bb[_0x60e7('0x47')],{'showHidden':![],'depth':null}));switch(_0x3de2dc[_0x60e7('0x45')]){case _0x60e7('0x92'):if(_0x3a87bb[_0x60e7('0x47')][_0x60e7('0xe7')]&&_0x3a87bb[_0x60e7('0x47')][_0x60e7('0xe8')]){_0x37f925=_0x3a87bb['query'][_0x60e7('0xe8')];return db['SmsMessage'][_0x60e7('0x5f')]({'where':{'messageId':_0x3a87bb[_0x60e7('0x47')]['message-id']}});}break;}}})[_0x60e7('0x3a')](handleEntityNotFound(_0x536034,null))[_0x60e7('0x3a')](function(_0x1a8fdc){if(_0x1a8fdc){_0x1d1178=_0x1a8fdc;switch(_0x704a7a[_0x60e7('0x45')]){case _0x60e7('0x92'):if(_0x37f925==='2'||_0x37f925==='6'){return _0x1d1178[_0x60e7('0x38')]({'read':!![]});}else{logger[_0x60e7('0x28')](_0x60e7('0x26'),_0x60e7('0x2d'),_0x60e7('0x92'),util[_0x60e7('0xd5')](_0x3a87bb[_0x60e7('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x1d1178;}})[_0x60e7('0x3a')](respondWithResult(_0x536034,null))['catch'](handleError(_0x536034,null));};exports[_0x60e7('0xe9')]=function(_0x247ea7,_0x4bf29c,_0x40ce5b){return db[_0x60e7('0x42')][_0x60e7('0x5f')]({'where':{'id':_0x247ea7[_0x60e7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4bf29c,null))['then'](function(_0x2a7370){if(_0x2a7370){return _0x2a7370[_0x60e7('0xe9')](_0x247ea7[_0x60e7('0x61')][_0x60e7('0x70')],_[_0x60e7('0xa2')](_0x247ea7[_0x60e7('0x61')],[_0x60e7('0x70'),'id'])||{})[_0x60e7('0xa5')](function(_0x305e7f){for(var _0x31cd39=0x0;_0x31cd39<_0x247ea7[_0x60e7('0x61')]['ids'][_0x60e7('0x6d')];_0x31cd39+=0x1){socket[_0x60e7('0xea')](_0x60e7('0xeb'),{'UserId':Number(_0x247ea7[_0x60e7('0x61')][_0x60e7('0x70')][_0x31cd39]),'SmsAccountId':Number(_0x247ea7[_0x60e7('0x5c')]['id'])});}return _0x305e7f;});}})[_0x60e7('0x3a')](respondWithResult(_0x4bf29c,null))[_0x60e7('0x5a')](handleError(_0x4bf29c,null));};exports[_0x60e7('0xec')]=function(_0x234d59,_0x309f77,_0x3c82d0){return db[_0x60e7('0x42')]['find']({'where':{'id':_0x234d59[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x309f77,null))[_0x60e7('0x3a')](function(_0x721184){if(_0x721184){return _0x721184['removeAgents'](_0x234d59[_0x60e7('0x47')][_0x60e7('0x70')])[_0x60e7('0x3a')](function(){if(_[_0x60e7('0xed')](_0x234d59[_0x60e7('0x47')][_0x60e7('0x70')])){for(var _0x2ac348=0x0;_0x2ac348<_0x234d59['query'][_0x60e7('0x70')][_0x60e7('0x6d')];_0x2ac348+=0x1){socket['emit'](_0x60e7('0xee'),{'UserId':Number(_0x234d59['query']['ids'][_0x2ac348]),'SmsAccountId':Number(_0x234d59[_0x60e7('0x5c')]['id'])});}}else{socket['emit'](_0x60e7('0xee'),{'UserId':Number(_0x234d59[_0x60e7('0x47')][_0x60e7('0x70')]),'SmsAccountId':Number(_0x234d59[_0x60e7('0x5c')]['id'])});}});}})[_0x60e7('0x3a')](respondWithStatusCode(_0x309f77,null))[_0x60e7('0x5a')](handleError(_0x309f77,null));};exports['getAgents']=function(_0x27d85c,_0x596adf,_0x319d73){var _0x1261b1={};var _0x49646b={};var _0x1c7443;var _0x11b4a8;return db['SmsAccount'][_0x60e7('0x6c')]({'where':{'id':_0x27d85c[_0x60e7('0x5c')]['id']}})[_0x60e7('0x3a')](handleEntityNotFound(_0x596adf,null))[_0x60e7('0x3a')](function(_0x522dd5){if(_0x522dd5){_0x1c7443=_0x522dd5;_0x49646b[_0x60e7('0x4b')]=_[_0x60e7('0x48')](db[_0x60e7('0xb0')]['rawAttributes']);_0x49646b[_0x60e7('0x47')]=_[_0x60e7('0x48')](_0x27d85c[_0x60e7('0x47')]);_0x49646b[_0x60e7('0x49')]=_[_0x60e7('0x4a')](_0x49646b[_0x60e7('0x4b')],_0x49646b[_0x60e7('0x47')]);_0x1261b1[_0x60e7('0x4c')]=_[_0x60e7('0x4a')](_0x49646b[_0x60e7('0x4b')],qs[_0x60e7('0x4d')](_0x27d85c[_0x60e7('0x47')]['fields']));_0x1261b1[_0x60e7('0x4c')]=_0x1261b1[_0x60e7('0x4c')][_0x60e7('0x6d')]?_0x1261b1[_0x60e7('0x4c')]:_0x49646b[_0x60e7('0x4b')];_0x1261b1[_0x60e7('0x4f')]=qs['sort'](_0x27d85c[_0x60e7('0x47')][_0x60e7('0x50')]);_0x1261b1['where']=qs[_0x60e7('0x49')](_[_0x60e7('0x52')](_0x27d85c[_0x60e7('0x47')],_0x49646b['filters']));if(_0x27d85c[_0x60e7('0x47')][_0x60e7('0x53')]){_0x1261b1[_0x60e7('0x51')]=_['merge'](_0x1261b1[_0x60e7('0x51')],{'$or':_[_0x60e7('0x41')](_0x1261b1[_0x60e7('0x4c')],function(_0x54e9dd){var _0x34d7a3={};_0x34d7a3[_0x54e9dd]={'$like':'%'+_0x27d85c[_0x60e7('0x47')]['filter']+'%'};return _0x34d7a3;})});}_0x1261b1=_[_0x60e7('0x54')]({},_0x1261b1,_0x27d85c[_0x60e7('0x56')]);return _0x1c7443[_0x60e7('0xef')](_0x1261b1);}})['then'](function(_0x36912e){if(_0x36912e){_0x11b4a8=_0x36912e['length'];if(!_0x27d85c[_0x60e7('0x47')][_0x60e7('0x4e')](_0x60e7('0x6e'))){_0x1261b1[_0x60e7('0x31')]=qs[_0x60e7('0x31')](_0x27d85c['query'][_0x60e7('0x31')]);_0x1261b1[_0x60e7('0x30')]=qs['offset'](_0x27d85c[_0x60e7('0x47')]['offset']);}return _0x1c7443[_0x60e7('0xef')](_0x1261b1);}})[_0x60e7('0x3a')](function(_0x4cfa2f){if(_0x4cfa2f){return _0x4cfa2f?{'count':_0x11b4a8,'rows':_0x4cfa2f}:null;}})[_0x60e7('0x3a')](respondWithResult(_0x596adf,null))[_0x60e7('0x5a')](handleError(_0x596adf,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 9674f16..d981900 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 _0x3714=['../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x5c4890,_0x57a20c){var _0x30fd61=function(_0x140e88){while(--_0x140e88){_0x5c4890['push'](_0x5c4890['shift']());}};_0x30fd61(++_0x57a20c);}(_0x3714,0x1ee));var _0x4371=function(_0x122cb9,_0xd3eac){_0x122cb9=_0x122cb9-0x0;var _0x5ad7d6=_0x3714[_0x122cb9];return _0x5ad7d6;};'use strict';var EventEmitter=require(_0x4371('0x0'));var SmsAccount=require(_0x4371('0x1'))['db'][_0x4371('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4371('0x3')](0x0);var events={'afterCreate':_0x4371('0x4'),'afterUpdate':'update','afterDestroy':_0x4371('0x5')};function emitEvent(_0xe985fd){return function(_0x546aa6,_0xbc74c0,_0xac8c72){SmsAccountEvents['emit'](_0xe985fd+':'+_0x546aa6['id'],_0x546aa6);SmsAccountEvents[_0x4371('0x6')](_0xe985fd,_0x546aa6);_0xac8c72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x4371('0x7')](e,emitEvent(event));}}module[_0x4371('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xda28=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x7a6aed,_0x335e68){var _0x9dbabf=function(_0x453c9c){while(--_0x453c9c){_0x7a6aed['push'](_0x7a6aed['shift']());}};_0x9dbabf(++_0x335e68);}(_0xda28,0xc5));var _0x8da2=function(_0x56e2bb,_0x420140){_0x56e2bb=_0x56e2bb-0x0;var _0x5eb398=_0xda28[_0x56e2bb];return _0x5eb398;};'use strict';var EventEmitter=require(_0x8da2('0x0'));var SmsAccount=require(_0x8da2('0x1'))['db'][_0x8da2('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8da2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x178939){return function(_0x8216ce,_0x407229,_0x2e7953){SmsAccountEvents[_0x8da2('0x4')](_0x178939+':'+_0x8216ce['id'],_0x8216ce);SmsAccountEvents[_0x8da2('0x4')](_0x178939,_0x8216ce);_0x2e7953(null);};}for(var e in events){if(events[_0x8da2('0x5')](e)){var event=events[e];SmsAccount[_0x8da2('0x6')](e,emitEvent(event));}}module[_0x8da2('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 4cc6b16..140b4a5 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 _0xf83f=['define','SmsAccount','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x3e3d0a,_0x4745dd){var _0x3fc765=function(_0x3b64c5){while(--_0x3b64c5){_0x3e3d0a['push'](_0x3e3d0a['shift']());}};_0x3fc765(++_0x4745dd);}(_0xf83f,0x162));var _0xff83=function(_0x1ffe0a,_0x2d7011){_0x1ffe0a=_0x1ffe0a-0x0;var _0x2135ad=_0xf83f[_0x1ffe0a];return _0x2135ad;};'use strict';var _=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var logger=require('../../config/logger')(_0xff83('0x2'));var moment=require(_0xff83('0x3'));var BPromise=require(_0xff83('0x4'));var rp=require(_0xff83('0x5'));var fs=require('fs');var path=require(_0xff83('0x6'));var rimraf=require('rimraf');var config=require(_0xff83('0x7'));var attributes=require('./smsAccount.attributes');module[_0xff83('0x8')]=function(_0x4d97cd,_0x1d8d4f){return _0x4d97cd[_0xff83('0x9')](_0xff83('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f4d=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x104354,_0x1d5cdc){var _0x5ce198=function(_0x12a899){while(--_0x12a899){_0x104354['push'](_0x104354['shift']());}};_0x5ce198(++_0x1d5cdc);}(_0x0f4d,0xb9));var _0xd0f4=function(_0x455973,_0x298913){_0x455973=_0x455973-0x0;var _0x68923c=_0x0f4d[_0x455973];return _0x68923c;};'use strict';var _=require(_0xd0f4('0x0'));var util=require(_0xd0f4('0x1'));var logger=require(_0xd0f4('0x2'))(_0xd0f4('0x3'));var moment=require('moment');var BPromise=require(_0xd0f4('0x4'));var rp=require(_0xd0f4('0x5'));var fs=require('fs');var path=require(_0xd0f4('0x6'));var rimraf=require(_0xd0f4('0x7'));var config=require(_0xd0f4('0x8'));var attributes=require(_0xd0f4('0x9'));module[_0xd0f4('0xa')]=function(_0x467a0a,_0x47587c){return _0x467a0a[_0xd0f4('0xb')](_0xd0f4('0xc'),attributes,{'tableName':_0xd0f4('0xd'),'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 617a55c..4dbede8 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 _0xd994=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','map','model','include'];(function(_0x398472,_0x1025c9){var _0x2479a4=function(_0x304818){while(--_0x304818){_0x398472['push'](_0x398472['shift']());}};_0x2479a4(++_0x1025c9);}(_0xd994,0x18c));var _0x4d99=function(_0x908286,_0x166f9b){_0x908286=_0x908286-0x0;var _0x430294=_0xd994[_0x908286];return _0x430294;};'use strict';var _=require('lodash');var util=require(_0x4d99('0x0'));var moment=require(_0x4d99('0x1'));var BPromise=require(_0x4d99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d99('0x3'));var db=require(_0x4d99('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d99('0x5'));var config=require(_0x4d99('0x6'));var jayson=require(_0x4d99('0x7'));var client=jayson[_0x4d99('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d99('0x9')](config[_0x4d99('0xa')],{'host':_0x4d99('0xb'),'port':0x18eb});var socket=require(_0x4d99('0xc'))(new Redis(config['redis']));require(_0x4d99('0xd'))[_0x4d99('0xe')](socket);function respondWithRpcPromise(_0x2d4560,_0x43f79d,_0x55a2d5){return new BPromise(function(_0x494f93,_0x2473d2){return client[_0x4d99('0xf')](_0x2d4560,_0x55a2d5)['then'](function(_0x567472){logger[_0x4d99('0x10')](_0x4d99('0x11'),_0x43f79d,_0x4d99('0x12'));logger[_0x4d99('0x13')](_0x4d99('0x14'),_0x43f79d,_0x4d99('0x12'),JSON[_0x4d99('0x15')](_0x567472));if(_0x567472[_0x4d99('0x16')]){if(_0x567472[_0x4d99('0x16')][_0x4d99('0x17')]===0x1f4){logger[_0x4d99('0x16')]('SmsAccount,\x20%s,\x20%s',_0x43f79d,_0x567472[_0x4d99('0x16')][_0x4d99('0x18')]);return _0x2473d2(_0x567472[_0x4d99('0x16')][_0x4d99('0x18')]);}logger[_0x4d99('0x16')](_0x4d99('0x11'),_0x43f79d,_0x567472[_0x4d99('0x16')][_0x4d99('0x18')]);return _0x494f93(_0x567472[_0x4d99('0x16')][_0x4d99('0x18')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x43f79d,_0x4d99('0x12'));_0x494f93(_0x567472[_0x4d99('0x19')]['message']);}})[_0x4d99('0x1a')](function(_0x41f6f5){logger[_0x4d99('0x16')](_0x4d99('0x11'),_0x43f79d,_0x41f6f5);_0x2473d2(_0x41f6f5);});});}exports[_0x4d99('0x1b')]=function(_0x1558bf){var _0x3da384=this;return new Promise(function(_0x150712,_0x2361bc){return db[_0x4d99('0x1c')][_0x4d99('0x1d')]({'raw':_0x1558bf[_0x4d99('0x1e')]?_0x1558bf[_0x4d99('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1558bf['options']?_0x1558bf['options'][_0x4d99('0x1f')]||null:null,'attributes':_0x1558bf[_0x4d99('0x1e')]?_0x1558bf[_0x4d99('0x1e')][_0x4d99('0x20')]||null:null,'include':_0x1558bf[_0x4d99('0x1e')]?_0x1558bf[_0x4d99('0x1e')]['include']?_[_0x4d99('0x21')](_0x1558bf[_0x4d99('0x1e')]['include'],function(_0x3457fa){return{'model':db[_0x3457fa[_0x4d99('0x22')]],'as':_0x3457fa['as'],'attributes':_0x3457fa['attributes'],'include':_0x3457fa[_0x4d99('0x23')]?_[_0x4d99('0x21')](_0x3457fa['include'],function(_0x12326a){return{'model':db[_0x12326a[_0x4d99('0x22')]],'as':_0x12326a['as'],'attributes':_0x12326a[_0x4d99('0x20')],'include':_0x12326a['include']?_[_0x4d99('0x21')](_0x12326a[_0x4d99('0x23')],function(_0xfd2e32){return{'model':db[_0xfd2e32[_0x4d99('0x22')]],'as':_0xfd2e32['as'],'attributes':_0xfd2e32[_0x4d99('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b3462){logger['info'](_0x4d99('0x1b'),_0x1558bf);logger[_0x4d99('0x13')](_0x4d99('0x1b'),_0x1558bf,JSON['stringify'](_0x1b3462));_0x150712(_0x1b3462);})['catch'](function(_0x4c07c4){logger['error'](_0x4d99('0x1b'),_0x4c07c4['message'],_0x1558bf);_0x2361bc(_0x3da384[_0x4d99('0x16')](0x1f4,_0x4c07c4[_0x4d99('0x18')]));});});}; \ No newline at end of file +var _0x7d94=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','raw','options','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./smsAccount.socket','request','then'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x7d94,0x1c1));var _0x47d9=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x7d94[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0x47d9('0x0'));var util=require(_0x47d9('0x1'));var moment=require(_0x47d9('0x2'));var BPromise=require(_0x47d9('0x3'));var rs=require(_0x47d9('0x4'));var fs=require('fs');var Redis=require(_0x47d9('0x5'));var db=require(_0x47d9('0x6'))['db'];var utils=require(_0x47d9('0x7'));var logger=require(_0x47d9('0x8'))(_0x47d9('0x9'));var config=require(_0x47d9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x47d9('0xb')][_0x47d9('0xc')]({'port':0x232a});config['redis']=_[_0x47d9('0xd')](config[_0x47d9('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x47d9('0xf'))(new Redis(config[_0x47d9('0xe')]));require(_0x47d9('0x10'))['register'](socket);function respondWithRpcPromise(_0x2fdbd3,_0x2d05f1,_0x183d7c){return new BPromise(function(_0x28e049,_0x2bdb57){return client[_0x47d9('0x11')](_0x2fdbd3,_0x183d7c)[_0x47d9('0x12')](function(_0x2a062e){logger[_0x47d9('0x13')](_0x47d9('0x14'),_0x2d05f1,_0x47d9('0x15'));logger['debug'](_0x47d9('0x16'),_0x2d05f1,_0x47d9('0x15'),JSON[_0x47d9('0x17')](_0x2a062e));if(_0x2a062e[_0x47d9('0x18')]){if(_0x2a062e[_0x47d9('0x18')][_0x47d9('0x19')]===0x1f4){logger['error'](_0x47d9('0x14'),_0x2d05f1,_0x2a062e[_0x47d9('0x18')][_0x47d9('0x1a')]);return _0x2bdb57(_0x2a062e['error'][_0x47d9('0x1a')]);}logger['error'](_0x47d9('0x14'),_0x2d05f1,_0x2a062e['error'][_0x47d9('0x1a')]);return _0x28e049(_0x2a062e[_0x47d9('0x18')][_0x47d9('0x1a')]);}else{logger[_0x47d9('0x13')](_0x47d9('0x14'),_0x2d05f1,'request\x20sent');_0x28e049(_0x2a062e[_0x47d9('0x1b')][_0x47d9('0x1a')]);}})[_0x47d9('0x1c')](function(_0x3540a1){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2d05f1,_0x3540a1);_0x2bdb57(_0x3540a1);});});}exports[_0x47d9('0x1d')]=function(_0xc8698e){var _0x44c966=this;return new Promise(function(_0x46d9f6,_0x321890){return db[_0x47d9('0x1e')][_0x47d9('0x1f')]({'raw':_0xc8698e['options']?_0xc8698e['options'][_0x47d9('0x20')]===undefined?!![]:![]:!![],'where':_0xc8698e[_0x47d9('0x21')]?_0xc8698e[_0x47d9('0x21')]['where']||null:null,'attributes':_0xc8698e['options']?_0xc8698e[_0x47d9('0x21')][_0x47d9('0x22')]||null:null,'include':_0xc8698e[_0x47d9('0x21')]?_0xc8698e[_0x47d9('0x21')][_0x47d9('0x23')]?_[_0x47d9('0x24')](_0xc8698e[_0x47d9('0x21')]['include'],function(_0xc0318a){return{'model':db[_0xc0318a[_0x47d9('0x25')]],'as':_0xc0318a['as'],'attributes':_0xc0318a[_0x47d9('0x22')],'include':_0xc0318a[_0x47d9('0x23')]?_[_0x47d9('0x24')](_0xc0318a[_0x47d9('0x23')],function(_0x30be73){return{'model':db[_0x30be73[_0x47d9('0x25')]],'as':_0x30be73['as'],'attributes':_0x30be73['attributes'],'include':_0x30be73[_0x47d9('0x23')]?_[_0x47d9('0x24')](_0x30be73[_0x47d9('0x23')],function(_0x1e835b){return{'model':db[_0x1e835b['model']],'as':_0x1e835b['as'],'attributes':_0x1e835b[_0x47d9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c1e2){logger[_0x47d9('0x13')](_0x47d9('0x1d'),_0xc8698e);logger[_0x47d9('0x26')](_0x47d9('0x1d'),_0xc8698e,JSON[_0x47d9('0x17')](_0x27c1e2));_0x46d9f6(_0x27c1e2);})[_0x47d9('0x1c')](function(_0x23ec6d){logger[_0x47d9('0x18')](_0x47d9('0x1d'),_0x23ec6d[_0x47d9('0x1a')],_0xc8698e);_0x321890(_0x44c966[_0x47d9('0x18')](0x1f4,_0x23ec6d[_0x47d9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 51722d3..305fa02 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 96de485..345b34b 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x129500,_0x19a655){var _0x562d6c=function(_0x3c3b07){while(--_0x3c3b07){_0x129500['push'](_0x129500['shift']());}};_0x562d6c(++_0x19a655);}(_0x008c,0x188));var _0xc008=function(_0x2722bc,_0x221dd9){_0x2722bc=_0x2722bc-0x0;var _0x5ac515=_0x008c[_0x2722bc];return _0x5ac515;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x3c2e17,_0x1d65c6){var _0x8a1c8b=function(_0x5e9d6b){while(--_0x5e9d6b){_0x3c2e17['push'](_0x3c2e17['shift']());}};_0x8a1c8b(++_0x1d65c6);}(_0x008c,0x188));var _0xc008=function(_0xf0ab7c,_0x23bbc2){_0xf0ab7c=_0xf0ab7c-0x0;var _0x198144=_0x008c[_0xf0ab7c];return _0x198144;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b2f9190..2acb7ee 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 _0x6cac=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x354f3d,_0x44fc3b){var _0xc55a3=function(_0x7c40d){while(--_0x7c40d){_0x354f3d['push'](_0x354f3d['shift']());}};_0xc55a3(++_0x44fc3b);}(_0x6cac,0x1df));var _0xc6ca=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6cac[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xc6ca('0x0'));module[_0xc6ca('0x1')]={'priority':{'type':Sequelize[_0xc6ca('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc6ca('0x3')},'appdata':{'type':Sequelize[_0xc6ca('0x4')]()},'description':{'type':Sequelize[_0xc6ca('0x5')]},'interval':{'type':Sequelize[_0xc6ca('0x5')],'defaultValue':_0xc6ca('0x6')}}; \ No newline at end of file +var _0x69d7=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x90131f,_0x5a5d80){var _0x32eb41=function(_0x4cdb03){while(--_0x4cdb03){_0x90131f['push'](_0x90131f['shift']());}};_0x32eb41(++_0x5a5d80);}(_0x69d7,0x1f1));var _0x769d=function(_0x31e96b,_0x2d6732){_0x31e96b=_0x31e96b-0x0;var _0x1cec18=_0x69d7[_0x31e96b];return _0x1cec18;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x769d('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x769d('0x1')],'allowNull':![],'defaultValue':_0x769d('0x2')},'appdata':{'type':Sequelize[_0x769d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x769d('0x1')],'defaultValue':_0x769d('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a57e26d..6ebd6bb 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 _0xd9c1=['options','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SmsApplication','includeAll','include','rows','catch','show'];(function(_0x313b3b,_0x517d42){var _0x53de65=function(_0x21fbd0){while(--_0x21fbd0){_0x313b3b['push'](_0x313b3b['shift']());}};_0x53de65(++_0x517d42);}(_0xd9c1,0x131));var _0x1d9c=function(_0x483d0b,_0x450925){_0x483d0b=_0x483d0b-0x0;var _0x2c7a8f=_0xd9c1[_0x483d0b];return _0x2c7a8f;};'use strict';var emlformat=require(_0x1d9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d9c('0x1'));var jsonpatch=require(_0x1d9c('0x2'));var rp=require('request-promise');var moment=require(_0x1d9c('0x3'));var BPromise=require(_0x1d9c('0x4'));var Mustache=require('mustache');var util=require(_0x1d9c('0x5'));var path=require(_0x1d9c('0x6'));var sox=require(_0x1d9c('0x7'));var csv=require(_0x1d9c('0x8'));var ejs=require(_0x1d9c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d9c('0xa'));var squel=require(_0x1d9c('0xb'));var crypto=require(_0x1d9c('0xc'));var jsforce=require(_0x1d9c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d9c('0xe'));var Papa=require(_0x1d9c('0xf'));var Redis=require(_0x1d9c('0x10'));var authService=require(_0x1d9c('0x11'));var qs=require(_0x1d9c('0x12'));var as=require(_0x1d9c('0x13'));var hardwareService=require(_0x1d9c('0x14'));var logger=require(_0x1d9c('0x15'))(_0x1d9c('0x16'));var utils=require(_0x1d9c('0x17'));var config=require(_0x1d9c('0x18'));var licenseUtil=require(_0x1d9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357f78,_0x18232a){_0x18232a=_0x18232a||0xcc;return function(_0x23f60c){if(_0x23f60c){return _0x357f78['sendStatus'](_0x18232a);}return _0x357f78[_0x1d9c('0x1a')](_0x18232a)['end']();};}function respondWithResult(_0x5a3a1c,_0x53660b){_0x53660b=_0x53660b||0xc8;return function(_0x4fbccf){if(_0x4fbccf){return _0x5a3a1c[_0x1d9c('0x1a')](_0x53660b)[_0x1d9c('0x1b')](_0x4fbccf);}};}function respondWithFilteredResult(_0x4b70b2,_0x279743){return function(_0x48afd4){if(_0x48afd4){var _0x3ffcbf=typeof _0x279743[_0x1d9c('0x1c')]===_0x1d9c('0x1d')&&typeof _0x279743[_0x1d9c('0x1e')]==='undefined';var _0x453bac=_0x48afd4[_0x1d9c('0x1f')];var _0x40cf03=_0x3ffcbf?0x0:_0x279743[_0x1d9c('0x1c')];var _0x44f17f=_0x3ffcbf?_0x48afd4['count']:_0x279743[_0x1d9c('0x1c')]+_0x279743['limit'];var _0x110df9;if(_0x44f17f>=_0x453bac){_0x44f17f=_0x453bac;_0x110df9=0xc8;}else{_0x110df9=0xce;}_0x4b70b2['status'](_0x110df9);return _0x4b70b2[_0x1d9c('0x20')](_0x1d9c('0x21'),_0x40cf03+'-'+_0x44f17f+'/'+_0x453bac)[_0x1d9c('0x1b')](_0x48afd4);}return null;};}function patchUpdates(_0x2e9f46){return function(_0x113d2b){try{jsonpatch[_0x1d9c('0x22')](_0x113d2b,_0x2e9f46,!![]);}catch(_0x5a7464){return BPromise[_0x1d9c('0x23')](_0x5a7464);}return _0x113d2b[_0x1d9c('0x24')]();};}function saveUpdates(_0x4ee951,_0x4058ce){return function(_0x2c0346){if(_0x2c0346){return _0x2c0346[_0x1d9c('0x25')](_0x4ee951)[_0x1d9c('0x26')](function(_0x4473fa){return _0x4473fa;});}return null;};}function removeEntity(_0x5994ef,_0x45f159){return function(_0x428d69){if(_0x428d69){return _0x428d69['destroy']()[_0x1d9c('0x26')](function(){_0x5994ef[_0x1d9c('0x1a')](0xcc)[_0x1d9c('0x27')]();});}};}function handleEntityNotFound(_0x422518,_0x1506c4){return function(_0x1cc1c5){if(!_0x1cc1c5){_0x422518[_0x1d9c('0x28')](0x194);}return _0x1cc1c5;};}function handleError(_0x28ede5,_0x383103){_0x383103=_0x383103||0x1f4;return function(_0x1fa438){logger[_0x1d9c('0x29')](_0x1fa438[_0x1d9c('0x2a')]);if(_0x1fa438[_0x1d9c('0x2b')]){delete _0x1fa438[_0x1d9c('0x2b')];}_0x28ede5[_0x1d9c('0x1a')](_0x383103)['send'](_0x1fa438);};}exports['index']=function(_0x3fd057,_0x29c1e9){var _0x5b60e3={},_0x467608={},_0x14f47e={'count':0x0,'rows':[]};var _0x5133df=_[_0x1d9c('0x2c')](db['SmsApplication'][_0x1d9c('0x2d')],function(_0x54e79d){return{'name':_0x54e79d[_0x1d9c('0x2e')],'type':_0x54e79d[_0x1d9c('0x2f')][_0x1d9c('0x30')]};});_0x467608[_0x1d9c('0x31')]=_[_0x1d9c('0x2c')](_0x5133df,'name');_0x467608[_0x1d9c('0x32')]=_[_0x1d9c('0x33')](_0x3fd057[_0x1d9c('0x32')]);_0x467608[_0x1d9c('0x34')]=_['intersection'](_0x467608[_0x1d9c('0x31')],_0x467608['query']);_0x5b60e3[_0x1d9c('0x35')]=_[_0x1d9c('0x36')](_0x467608[_0x1d9c('0x31')],qs[_0x1d9c('0x37')](_0x3fd057['query'][_0x1d9c('0x37')]));_0x5b60e3[_0x1d9c('0x35')]=_0x5b60e3['attributes']['length']?_0x5b60e3[_0x1d9c('0x35')]:_0x467608[_0x1d9c('0x31')];if(!_0x3fd057[_0x1d9c('0x32')][_0x1d9c('0x38')](_0x1d9c('0x39'))){_0x5b60e3[_0x1d9c('0x1e')]=qs[_0x1d9c('0x1e')](_0x3fd057['query']['limit']);_0x5b60e3[_0x1d9c('0x1c')]=qs[_0x1d9c('0x1c')](_0x3fd057['query'][_0x1d9c('0x1c')]);}_0x5b60e3[_0x1d9c('0x3a')]=qs[_0x1d9c('0x3b')](_0x3fd057[_0x1d9c('0x32')]['sort']);_0x5b60e3[_0x1d9c('0x3c')]=qs[_0x1d9c('0x34')](_[_0x1d9c('0x3d')](_0x3fd057[_0x1d9c('0x32')],_0x467608['filters']),_0x5133df);if(_0x3fd057['query'][_0x1d9c('0x3e')]){_0x5b60e3[_0x1d9c('0x3c')]=_[_0x1d9c('0x3f')](_0x5b60e3['where'],{'$or':_[_0x1d9c('0x2c')](_0x5133df,function(_0x3ad4f4){if(_0x3ad4f4[_0x1d9c('0x2f')]!=='VIRTUAL'){var _0x4e2a6e={};_0x4e2a6e[_0x3ad4f4['name']]={'$like':'%'+_0x3fd057[_0x1d9c('0x32')]['filter']+'%'};return _0x4e2a6e;}})});}_0x5b60e3=_[_0x1d9c('0x3f')]({},_0x5b60e3,_0x3fd057['options']);var _0x75a47e={'where':_0x5b60e3[_0x1d9c('0x3c')]};return db[_0x1d9c('0x40')][_0x1d9c('0x1f')](_0x75a47e)['then'](function(_0x41d7a2){_0x14f47e[_0x1d9c('0x1f')]=_0x41d7a2;if(_0x3fd057[_0x1d9c('0x32')][_0x1d9c('0x41')]){_0x5b60e3[_0x1d9c('0x42')]=[{'all':!![]}];}return db[_0x1d9c('0x40')]['findAll'](_0x5b60e3);})['then'](function(_0x57f271){_0x14f47e[_0x1d9c('0x43')]=_0x57f271;return _0x14f47e;})[_0x1d9c('0x26')](respondWithFilteredResult(_0x29c1e9,_0x5b60e3))[_0x1d9c('0x44')](handleError(_0x29c1e9,null));};exports[_0x1d9c('0x45')]=function(_0x4dfc56,_0x249f4f){var _0x15c144={'raw':!![],'where':{'id':_0x4dfc56['params']['id']}},_0x1b76b2={};_0x1b76b2['model']=_[_0x1d9c('0x33')](db[_0x1d9c('0x40')]['rawAttributes']);_0x1b76b2['query']=_[_0x1d9c('0x33')](_0x4dfc56['query']);_0x1b76b2['filters']=_[_0x1d9c('0x36')](_0x1b76b2[_0x1d9c('0x31')],_0x1b76b2[_0x1d9c('0x32')]);_0x15c144[_0x1d9c('0x35')]=_[_0x1d9c('0x36')](_0x1b76b2[_0x1d9c('0x31')],qs[_0x1d9c('0x37')](_0x4dfc56[_0x1d9c('0x32')]['fields']));_0x15c144[_0x1d9c('0x35')]=_0x15c144[_0x1d9c('0x35')]['length']?_0x15c144[_0x1d9c('0x35')]:_0x1b76b2[_0x1d9c('0x31')];if(_0x4dfc56[_0x1d9c('0x32')]['includeAll']){_0x15c144[_0x1d9c('0x42')]=[{'all':!![]}];}_0x15c144=_['merge']({},_0x15c144,_0x4dfc56[_0x1d9c('0x46')]);return db[_0x1d9c('0x40')][_0x1d9c('0x47')](_0x15c144)[_0x1d9c('0x26')](handleEntityNotFound(_0x249f4f,null))['then'](respondWithResult(_0x249f4f,null))[_0x1d9c('0x44')](handleError(_0x249f4f,null));};exports[_0x1d9c('0x48')]=function(_0x1a5a88,_0xaf5195){return db[_0x1d9c('0x40')][_0x1d9c('0x48')](_0x1a5a88[_0x1d9c('0x49')],{})['then'](respondWithResult(_0xaf5195,0xc9))[_0x1d9c('0x44')](handleError(_0xaf5195,null));};exports[_0x1d9c('0x25')]=function(_0xafbac3,_0x3060e7){if(_0xafbac3[_0x1d9c('0x49')]['id']){delete _0xafbac3[_0x1d9c('0x49')]['id'];}return db['SmsApplication'][_0x1d9c('0x47')]({'where':{'id':_0xafbac3[_0x1d9c('0x4a')]['id']}})[_0x1d9c('0x26')](handleEntityNotFound(_0x3060e7,null))['then'](saveUpdates(_0xafbac3['body'],null))[_0x1d9c('0x26')](respondWithResult(_0x3060e7,null))[_0x1d9c('0x44')](handleError(_0x3060e7,null));};exports['destroy']=function(_0x24aa07,_0x4e38bb){return db['SmsApplication'][_0x1d9c('0x47')]({'where':{'id':_0x24aa07[_0x1d9c('0x4a')]['id']}})[_0x1d9c('0x26')](handleEntityNotFound(_0x4e38bb,null))[_0x1d9c('0x26')](removeEntity(_0x4e38bb,null))[_0x1d9c('0x44')](handleError(_0x4e38bb,null));}; \ No newline at end of file +var _0x90aa=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x131249,_0x3f9d36){var _0x26df63=function(_0x2efd6c){while(--_0x2efd6c){_0x131249['push'](_0x131249['shift']());}};_0x26df63(++_0x3f9d36);}(_0x90aa,0x1b9));var _0xa90a=function(_0x5e9386,_0x1bde2d){_0x5e9386=_0x5e9386-0x0;var _0x6dbbe=_0x90aa[_0x5e9386];return _0x6dbbe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa90a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa90a('0x1'));var rp=require(_0xa90a('0x2'));var moment=require(_0xa90a('0x3'));var BPromise=require(_0xa90a('0x4'));var Mustache=require('mustache');var util=require(_0xa90a('0x5'));var path=require(_0xa90a('0x6'));var sox=require(_0xa90a('0x7'));var csv=require(_0xa90a('0x8'));var ejs=require(_0xa90a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa90a('0xa'));var squel=require(_0xa90a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa90a('0xc'));var deskjs=require(_0xa90a('0xd'));var toCsv=require(_0xa90a('0x8'));var querystring=require(_0xa90a('0xe'));var Papa=require('papaparse');var Redis=require(_0xa90a('0xf'));var authService=require(_0xa90a('0x10'));var qs=require(_0xa90a('0x11'));var as=require(_0xa90a('0x12'));var hardwareService=require(_0xa90a('0x13'));var logger=require(_0xa90a('0x14'))(_0xa90a('0x15'));var utils=require(_0xa90a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa90a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba4ed,_0x3e1d96){_0x3e1d96=_0x3e1d96||0xcc;return function(_0x24741a){if(_0x24741a){return _0x5ba4ed['sendStatus'](_0x3e1d96);}return _0x5ba4ed['status'](_0x3e1d96)[_0xa90a('0x18')]();};}function respondWithResult(_0x1fdefe,_0x43bfda){_0x43bfda=_0x43bfda||0xc8;return function(_0x5c8e3c){if(_0x5c8e3c){return _0x1fdefe['status'](_0x43bfda)[_0xa90a('0x19')](_0x5c8e3c);}};}function respondWithFilteredResult(_0x1da1f9,_0x4f8bb6){return function(_0x127053){if(_0x127053){var _0x420250=typeof _0x4f8bb6[_0xa90a('0x1a')]===_0xa90a('0x1b')&&typeof _0x4f8bb6[_0xa90a('0x1c')]===_0xa90a('0x1b');var _0x572377=_0x127053[_0xa90a('0x1d')];var _0x380672=_0x420250?0x0:_0x4f8bb6['offset'];var _0x4dc17f=_0x420250?_0x127053['count']:_0x4f8bb6[_0xa90a('0x1a')]+_0x4f8bb6[_0xa90a('0x1c')];var _0x19c57e;if(_0x4dc17f>=_0x572377){_0x4dc17f=_0x572377;_0x19c57e=0xc8;}else{_0x19c57e=0xce;}_0x1da1f9[_0xa90a('0x1e')](_0x19c57e);return _0x1da1f9[_0xa90a('0x1f')](_0xa90a('0x20'),_0x380672+'-'+_0x4dc17f+'/'+_0x572377)['json'](_0x127053);}return null;};}function patchUpdates(_0x40c723){return function(_0x4da9f7){try{jsonpatch[_0xa90a('0x21')](_0x4da9f7,_0x40c723,!![]);}catch(_0x3bd704){return BPromise[_0xa90a('0x22')](_0x3bd704);}return _0x4da9f7[_0xa90a('0x23')]();};}function saveUpdates(_0x134c58,_0x3f1447){return function(_0x23abdf){if(_0x23abdf){return _0x23abdf[_0xa90a('0x24')](_0x134c58)[_0xa90a('0x25')](function(_0x2cdd7e){return _0x2cdd7e;});}return null;};}function removeEntity(_0x8161c5,_0x517cbb){return function(_0x3b424d){if(_0x3b424d){return _0x3b424d['destroy']()[_0xa90a('0x25')](function(){_0x8161c5[_0xa90a('0x1e')](0xcc)[_0xa90a('0x18')]();});}};}function handleEntityNotFound(_0x1353db,_0x215905){return function(_0x45dec0){if(!_0x45dec0){_0x1353db[_0xa90a('0x26')](0x194);}return _0x45dec0;};}function handleError(_0x1eab35,_0x3d6b87){_0x3d6b87=_0x3d6b87||0x1f4;return function(_0x412eec){logger[_0xa90a('0x27')](_0x412eec[_0xa90a('0x28')]);if(_0x412eec[_0xa90a('0x29')]){delete _0x412eec[_0xa90a('0x29')];}_0x1eab35[_0xa90a('0x1e')](_0x3d6b87)[_0xa90a('0x2a')](_0x412eec);};}exports['index']=function(_0x3d0a91,_0x4c22a3){var _0x436bca={},_0xb4fc31={},_0x560f6c={'count':0x0,'rows':[]};var _0x1c84ca=_[_0xa90a('0x2b')](db[_0xa90a('0x2c')][_0xa90a('0x2d')],function(_0x1c6569){return{'name':_0x1c6569[_0xa90a('0x2e')],'type':_0x1c6569['type'][_0xa90a('0x2f')]};});_0xb4fc31['model']=_[_0xa90a('0x2b')](_0x1c84ca,_0xa90a('0x29'));_0xb4fc31[_0xa90a('0x30')]=_[_0xa90a('0x31')](_0x3d0a91[_0xa90a('0x30')]);_0xb4fc31[_0xa90a('0x32')]=_[_0xa90a('0x33')](_0xb4fc31['model'],_0xb4fc31[_0xa90a('0x30')]);_0x436bca['attributes']=_[_0xa90a('0x33')](_0xb4fc31[_0xa90a('0x34')],qs[_0xa90a('0x35')](_0x3d0a91['query'][_0xa90a('0x35')]));_0x436bca[_0xa90a('0x36')]=_0x436bca[_0xa90a('0x36')][_0xa90a('0x37')]?_0x436bca[_0xa90a('0x36')]:_0xb4fc31[_0xa90a('0x34')];if(!_0x3d0a91[_0xa90a('0x30')][_0xa90a('0x38')](_0xa90a('0x39'))){_0x436bca['limit']=qs[_0xa90a('0x1c')](_0x3d0a91[_0xa90a('0x30')][_0xa90a('0x1c')]);_0x436bca['offset']=qs[_0xa90a('0x1a')](_0x3d0a91[_0xa90a('0x30')][_0xa90a('0x1a')]);}_0x436bca[_0xa90a('0x3a')]=qs[_0xa90a('0x3b')](_0x3d0a91[_0xa90a('0x30')][_0xa90a('0x3b')]);_0x436bca[_0xa90a('0x3c')]=qs[_0xa90a('0x32')](_[_0xa90a('0x3d')](_0x3d0a91[_0xa90a('0x30')],_0xb4fc31[_0xa90a('0x32')]),_0x1c84ca);if(_0x3d0a91['query'][_0xa90a('0x3e')]){_0x436bca[_0xa90a('0x3c')]=_[_0xa90a('0x3f')](_0x436bca[_0xa90a('0x3c')],{'$or':_['map'](_0x1c84ca,function(_0x3a8bc2){if(_0x3a8bc2[_0xa90a('0x40')]!==_0xa90a('0x41')){var _0x3b5eab={};_0x3b5eab[_0x3a8bc2[_0xa90a('0x29')]]={'$like':'%'+_0x3d0a91[_0xa90a('0x30')][_0xa90a('0x3e')]+'%'};return _0x3b5eab;}})});}_0x436bca=_['merge']({},_0x436bca,_0x3d0a91[_0xa90a('0x42')]);var _0x83f2d3={'where':_0x436bca[_0xa90a('0x3c')]};return db[_0xa90a('0x2c')][_0xa90a('0x1d')](_0x83f2d3)[_0xa90a('0x25')](function(_0x44d867){_0x560f6c[_0xa90a('0x1d')]=_0x44d867;if(_0x3d0a91[_0xa90a('0x30')]['includeAll']){_0x436bca[_0xa90a('0x43')]=[{'all':!![]}];}return db[_0xa90a('0x2c')]['findAll'](_0x436bca);})[_0xa90a('0x25')](function(_0x34448f){_0x560f6c[_0xa90a('0x44')]=_0x34448f;return _0x560f6c;})[_0xa90a('0x25')](respondWithFilteredResult(_0x4c22a3,_0x436bca))[_0xa90a('0x45')](handleError(_0x4c22a3,null));};exports[_0xa90a('0x46')]=function(_0x52dda3,_0x4fa7a1){var _0x30cbc4={'raw':!![],'where':{'id':_0x52dda3[_0xa90a('0x47')]['id']}},_0x42fb12={};_0x42fb12[_0xa90a('0x34')]=_[_0xa90a('0x31')](db[_0xa90a('0x2c')][_0xa90a('0x2d')]);_0x42fb12['query']=_[_0xa90a('0x31')](_0x52dda3[_0xa90a('0x30')]);_0x42fb12[_0xa90a('0x32')]=_[_0xa90a('0x33')](_0x42fb12[_0xa90a('0x34')],_0x42fb12[_0xa90a('0x30')]);_0x30cbc4[_0xa90a('0x36')]=_[_0xa90a('0x33')](_0x42fb12[_0xa90a('0x34')],qs['fields'](_0x52dda3[_0xa90a('0x30')][_0xa90a('0x35')]));_0x30cbc4[_0xa90a('0x36')]=_0x30cbc4[_0xa90a('0x36')][_0xa90a('0x37')]?_0x30cbc4[_0xa90a('0x36')]:_0x42fb12[_0xa90a('0x34')];if(_0x52dda3[_0xa90a('0x30')][_0xa90a('0x48')]){_0x30cbc4['include']=[{'all':!![]}];}_0x30cbc4=_[_0xa90a('0x3f')]({},_0x30cbc4,_0x52dda3['options']);return db['SmsApplication'][_0xa90a('0x49')](_0x30cbc4)[_0xa90a('0x25')](handleEntityNotFound(_0x4fa7a1,null))[_0xa90a('0x25')](respondWithResult(_0x4fa7a1,null))[_0xa90a('0x45')](handleError(_0x4fa7a1,null));};exports[_0xa90a('0x4a')]=function(_0x5afb21,_0x482db7){return db[_0xa90a('0x2c')]['create'](_0x5afb21[_0xa90a('0x4b')],{})[_0xa90a('0x25')](respondWithResult(_0x482db7,0xc9))['catch'](handleError(_0x482db7,null));};exports['update']=function(_0x411cd3,_0x2b8e48){if(_0x411cd3[_0xa90a('0x4b')]['id']){delete _0x411cd3[_0xa90a('0x4b')]['id'];}return db[_0xa90a('0x2c')][_0xa90a('0x49')]({'where':{'id':_0x411cd3[_0xa90a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b8e48,null))[_0xa90a('0x25')](saveUpdates(_0x411cd3[_0xa90a('0x4b')],null))[_0xa90a('0x25')](respondWithResult(_0x2b8e48,null))[_0xa90a('0x45')](handleError(_0x2b8e48,null));};exports['destroy']=function(_0x34b58b,_0x1e9a55){return db[_0xa90a('0x2c')][_0xa90a('0x49')]({'where':{'id':_0x34b58b[_0xa90a('0x47')]['id']}})[_0xa90a('0x25')](handleEntityNotFound(_0x1e9a55,null))['then'](removeEntity(_0x1e9a55,null))[_0xa90a('0x45')](handleError(_0x1e9a55,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 01d4a57..d147c64 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 _0x11c5=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x114175,_0x23f35e){var _0x501f06=function(_0x4733d7){while(--_0x4733d7){_0x114175['push'](_0x114175['shift']());}};_0x501f06(++_0x23f35e);}(_0x11c5,0xc5));var _0x511c=function(_0x22ed79,_0x2ac364){_0x22ed79=_0x22ed79-0x0;var _0x37d444=_0x11c5[_0x22ed79];return _0x37d444;};'use strict';var _=require(_0x511c('0x0'));var util=require(_0x511c('0x1'));var logger=require(_0x511c('0x2'))(_0x511c('0x3'));var moment=require(_0x511c('0x4'));var BPromise=require('bluebird');var rp=require(_0x511c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x511c('0x6'));var config=require(_0x511c('0x7'));var attributes=require(_0x511c('0x8'));module[_0x511c('0x9')]=function(_0x4ec165,_0x4d43b2){return _0x4ec165[_0x511c('0xa')](_0x511c('0xb'),attributes,{'tableName':_0x511c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x511c('0xd'),'collate':_0x511c('0xe')});}; \ No newline at end of file +var _0x4262=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x340ea5,_0x1c0c96){var _0xd74a4e=function(_0x23d040){while(--_0x23d040){_0x340ea5['push'](_0x340ea5['shift']());}};_0xd74a4e(++_0x1c0c96);}(_0x4262,0x15f));var _0x2426=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4262[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2426('0x0'));var util=require(_0x2426('0x1'));var logger=require(_0x2426('0x2'))('api');var moment=require(_0x2426('0x3'));var BPromise=require('bluebird');var rp=require(_0x2426('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2426('0x5'));var attributes=require(_0x2426('0x6'));module[_0x2426('0x7')]=function(_0x127500,_0x4a6553){return _0x127500[_0x2426('0x8')](_0x2426('0x9'),attributes,{'tableName':_0x2426('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2426('0xb'),'collate':_0x2426('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 61e37d6..7cff0ee 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 _0x3423=['rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});} \ No newline at end of file +var _0x80c4=['request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xdb01a,_0x54a83a){var _0x107ede=function(_0x98f457){while(--_0x98f457){_0xdb01a['push'](_0xdb01a['shift']());}};_0x107ede(++_0x54a83a);}(_0x80c4,0xa3));var _0x480c=function(_0x2c58c8,_0x24c958){_0x2c58c8=_0x2c58c8-0x0;var _0x49efef=_0x80c4[_0x2c58c8];return _0x49efef;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var moment=require(_0x480c('0x1'));var BPromise=require(_0x480c('0x2'));var rs=require(_0x480c('0x3'));var fs=require('fs');var Redis=require(_0x480c('0x4'));var db=require(_0x480c('0x5'))['db'];var utils=require(_0x480c('0x6'));var logger=require('../../config/logger')(_0x480c('0x7'));var config=require(_0x480c('0x8'));var jayson=require(_0x480c('0x9'));var client=jayson[_0x480c('0xa')][_0x480c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a5a6,_0x3a69ec,_0x277efe){return new BPromise(function(_0x21545d,_0x510038){return client[_0x480c('0xc')](_0x40a5a6,_0x277efe)[_0x480c('0xd')](function(_0x292aca){logger[_0x480c('0xe')](_0x480c('0xf'),_0x3a69ec,_0x480c('0x10'));logger[_0x480c('0x11')](_0x480c('0x12'),_0x3a69ec,_0x480c('0x10'),JSON[_0x480c('0x13')](_0x292aca));if(_0x292aca[_0x480c('0x14')]){if(_0x292aca[_0x480c('0x14')][_0x480c('0x15')]===0x1f4){logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);return _0x510038(_0x292aca[_0x480c('0x14')]['message']);}logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca['error'][_0x480c('0x16')]);return _0x21545d(_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x3a69ec,_0x480c('0x10'));_0x21545d(_0x292aca[_0x480c('0x17')][_0x480c('0x16')]);}})[_0x480c('0x18')](function(_0x93d6c5){logger['error']('SmsApplication,\x20%s,\x20%s',_0x3a69ec,_0x93d6c5);_0x510038(_0x93d6c5);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5bcd129..690862f 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 _0xf4f4=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy'];(function(_0x3c47e9,_0x374112){var _0xc82a99=function(_0x40d7f2){while(--_0x40d7f2){_0x3c47e9['push'](_0x3c47e9['shift']());}};_0xc82a99(++_0x374112);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x32171e,_0x2a2a78){_0x32171e=_0x32171e-0x0;var _0x396dd3=_0xf4f4[_0x32171e];return _0x396dd3;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./smsInteraction.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x4f4f('0x11')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x11')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['addMessage']);router[_0x4f4f('0x11')]('/:id/tags',auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x15')),controller['addTags']);router[_0x4f4f('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4f4f('0x14'),_0x4f4f('0x17')),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x1b')),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);module[_0x4f4f('0x1f')]=router; \ No newline at end of file +var _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x7708,0x188));var _0x8770=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x7708[_0x3747ae];return _0x339035;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 68771db..5c062eb 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 _0x215d=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize'];(function(_0x3375d7,_0x4c9e87){var _0x44cf9e=function(_0x2424ee){while(--_0x2424ee){_0x3375d7['push'](_0x3375d7['shift']());}};_0x44cf9e(++_0x4c9e87);}(_0x215d,0x187));var _0xd215=function(_0x38b3ed,_0x86e274){_0x38b3ed=_0x38b3ed-0x0;var _0x34a9ed=_0x215d[_0x38b3ed];return _0x34a9ed;};'use strict';var Sequelize=require(_0xd215('0x0'));var moment=require('moment');module[_0xd215('0x1')]={'closed':{'type':Sequelize[_0xd215('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd215('0x3')]},'disposition':{'type':Sequelize[_0xd215('0x4')]},'secondDisposition':{'type':Sequelize[_0xd215('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd215('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd215('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xd215('0x5')]('in',_0xd215('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd215('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd215('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd215('0x7')]}}; \ No newline at end of file +var _0xc74c=['out','BOOLEAN','INTEGER','sequelize','moment','DATE','STRING','ENUM'];(function(_0x30af1b,_0x476f62){var _0x5ed313=function(_0x552b9d){while(--_0x552b9d){_0x30af1b['push'](_0x30af1b['shift']());}};_0x5ed313(++_0x476f62);}(_0xc74c,0x163));var _0xcc74=function(_0x51a4fc,_0x397414){_0x51a4fc=_0x51a4fc-0x0;var _0x46ce2e=_0xc74c[_0x51a4fc];return _0x46ce2e;};'use strict';var Sequelize=require(_0xcc74('0x0'));var moment=require(_0xcc74('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc74('0x2')]},'disposition':{'type':Sequelize[_0xcc74('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcc74('0x3')]},'note':{'type':Sequelize[_0xcc74('0x3')]},'phone':{'type':Sequelize[_0xcc74('0x3')]},'read1stAt':{'type':Sequelize[_0xcc74('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xcc74('0x4')]('in',_0xcc74('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc74('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xcc74('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc74('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xcc74('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5e50099..6e3a369 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 _0xa6a7=['ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','error','name','send','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','SmsInteractionId','filter','$gte','split','format','merge','SmsMessage','include','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','createdAt','secret','read','SmsAccount','Owner','get','mkdirSync','Sms','Account','closedAt','disposition','direction','lastName','out','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','bluebird','util'];(function(_0x1906e0,_0x45a2bf){var _0x5657a6=function(_0x27fa24){while(--_0x27fa24){_0x1906e0['push'](_0x1906e0['shift']());}};_0x5657a6(++_0x45a2bf);}(_0xa6a7,0x1d9));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x7a6a('0x0'));var moment=require('moment');var BPromise=require(_0x7a6a('0x1'));var util=require(_0x7a6a('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x7a6a('0x3'));var interaction=require(_0x7a6a('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7a6a('0x5'));var logger=require(_0x7a6a('0x6'))('api');var config=require('../../config/environment');var db=require(_0x7a6a('0x7'))['db'];config['redis']=_[_0x7a6a('0x8')](config['redis'],{'host':_0x7a6a('0x9'),'port':0x18eb});var socket=require(_0x7a6a('0xa'))(new Redis(config[_0x7a6a('0xb')]));require(_0x7a6a('0xc'))[_0x7a6a('0xd')](socket);function respondWithStatusCode(_0x530e3f,_0x19c99c){_0x19c99c=_0x19c99c||0xcc;return function(_0xfe679b){if(_0xfe679b){return _0x530e3f[_0x7a6a('0xe')](_0x19c99c);}return _0x530e3f[_0x7a6a('0xf')](_0x19c99c)[_0x7a6a('0x10')]();};}function respondWithResult(_0x3c9f3b,_0x497ddd){_0x497ddd=_0x497ddd||0xc8;return function(_0x5bf8e5){if(_0x5bf8e5){return _0x3c9f3b[_0x7a6a('0xf')](_0x497ddd)[_0x7a6a('0x11')](_0x5bf8e5);}};}function respondWithFilteredResult(_0x253da0,_0x34ba47){return function(_0x4735c6){if(_0x4735c6){var _0x4485a8=typeof _0x34ba47[_0x7a6a('0x12')]===_0x7a6a('0x13')&&typeof _0x34ba47[_0x7a6a('0x14')]===_0x7a6a('0x13');var _0x2992e0=_0x4735c6[_0x7a6a('0x15')];var _0x4966d6=_0x4485a8?0x0:_0x34ba47[_0x7a6a('0x12')];var _0x57e4aa=_0x4485a8?_0x4735c6[_0x7a6a('0x15')]:_0x34ba47[_0x7a6a('0x12')]+_0x34ba47['limit'];var _0x1c68bb;if(_0x57e4aa>=_0x2992e0){_0x57e4aa=_0x2992e0;_0x1c68bb=0xc8;}else{_0x1c68bb=0xce;}_0x253da0[_0x7a6a('0xf')](_0x1c68bb);return _0x253da0['set'](_0x7a6a('0x16'),_0x4966d6+'-'+_0x57e4aa+'/'+_0x2992e0)[_0x7a6a('0x11')](_0x4735c6);}return null;};}function saveUpdates(_0x3565a3){return function(_0x250533){if(_0x250533){return _0x250533[_0x7a6a('0x17')](_0x3565a3)['then'](function(_0x56f169){return _0x56f169;});}return null;};}function removeEntity(_0x1a715f){return function(_0x34366b){if(_0x34366b){return _0x34366b[_0x7a6a('0x18')]()[_0x7a6a('0x19')](function(){_0x1a715f[_0x7a6a('0xf')](0xcc)[_0x7a6a('0x10')]();});}};}function handleEntityNotFound(_0x3864be){return function(_0x317d54){if(!_0x317d54){_0x3864be[_0x7a6a('0xe')](0x194);}return _0x317d54;};}function handleError(_0x5ae38d,_0x20395c){_0x20395c=_0x20395c||0x1f4;return function(_0x49c752){logger[_0x7a6a('0x1a')](_0x49c752['stack']);if(_0x49c752[_0x7a6a('0x1b')]){delete _0x49c752[_0x7a6a('0x1b')];}_0x5ae38d[_0x7a6a('0xf')](_0x20395c)[_0x7a6a('0x1c')](_0x49c752);};}exports['index']=function(_0x594e0c,_0x156d1d){var _0x174afa={};var _0x347563=_[_0x7a6a('0x1d')](db[_0x7a6a('0x1e')][_0x7a6a('0x1f')],function(_0xc20fb0){return{'name':_0xc20fb0[_0x7a6a('0x20')],'type':_0xc20fb0[_0x7a6a('0x21')][_0x7a6a('0x22')]};});_0x174afa=qs[_0x7a6a('0x23')](_0x347563,_0x594e0c);return interaction[_0x7a6a('0x24')](_0x7a6a('0x25'),_0x594e0c[_0x7a6a('0x26')],_0x594e0c['user'],_0x174afa,_0x347563)[_0x7a6a('0x19')](respondWithFilteredResult(_0x156d1d,_0x174afa))[_0x7a6a('0x27')](handleError(_0x156d1d,null));};exports[_0x7a6a('0x28')]=function(_0x1b8702,_0x149481){var _0x511d78={'raw':![],'where':{'id':_0x1b8702[_0x7a6a('0x29')]['id']}},_0x3fd354={};_0x3fd354[_0x7a6a('0x2a')]=_[_0x7a6a('0x2b')](db[_0x7a6a('0x1e')]['rawAttributes']);_0x3fd354[_0x7a6a('0x26')]=_[_0x7a6a('0x2b')](_0x1b8702[_0x7a6a('0x26')]);_0x3fd354[_0x7a6a('0x2c')]=_[_0x7a6a('0x2d')](_0x3fd354[_0x7a6a('0x2a')],_0x3fd354[_0x7a6a('0x26')]);_0x511d78[_0x7a6a('0x2e')]=_[_0x7a6a('0x2d')](_0x3fd354['model'],qs[_0x7a6a('0x2f')](_0x1b8702[_0x7a6a('0x26')]['fields']));_0x511d78['attributes']=_0x511d78['attributes'][_0x7a6a('0x30')]?_0x511d78['attributes']:_0x3fd354[_0x7a6a('0x2a')];if(_0x1b8702[_0x7a6a('0x26')][_0x7a6a('0x31')]){_0x511d78['include']=[{'all':!![]}];}_0x511d78=_['merge']({},_0x511d78,_0x1b8702[_0x7a6a('0x32')]);return db[_0x7a6a('0x1e')][_0x7a6a('0x33')](_0x511d78)[_0x7a6a('0x19')](handleEntityNotFound(_0x149481,null))[_0x7a6a('0x19')](respondWithResult(_0x149481,null))['catch'](handleError(_0x149481,null));};exports[_0x7a6a('0x34')]=function(_0x2fc7f9,_0x549883){return db[_0x7a6a('0x1e')][_0x7a6a('0x34')](_0x2fc7f9[_0x7a6a('0x35')],{})[_0x7a6a('0x19')](respondWithResult(_0x549883,0xc9))[_0x7a6a('0x27')](handleError(_0x549883,null));};exports[_0x7a6a('0x17')]=function(_0x4c568d,_0x409788){if(_0x4c568d[_0x7a6a('0x35')]['id']){delete _0x4c568d[_0x7a6a('0x35')]['id'];}return db[_0x7a6a('0x1e')][_0x7a6a('0x33')]({'where':{'id':_0x4c568d['params']['id']}})['then'](handleEntityNotFound(_0x409788,null))[_0x7a6a('0x19')](saveUpdates(_0x4c568d[_0x7a6a('0x35')],null))[_0x7a6a('0x19')](respondWithResult(_0x409788,null))[_0x7a6a('0x27')](handleError(_0x409788,null));};exports[_0x7a6a('0x18')]=function(_0x5ae784,_0xbcd014){return db[_0x7a6a('0x1e')]['find']({'where':{'id':_0x5ae784[_0x7a6a('0x29')]['id']}})[_0x7a6a('0x19')](handleEntityNotFound(_0xbcd014,null))[_0x7a6a('0x19')](removeEntity(_0xbcd014,null))[_0x7a6a('0x27')](handleError(_0xbcd014,null));};exports[_0x7a6a('0x36')]=function(_0x152dbd,_0x4c5cfc){return db[_0x7a6a('0x1e')][_0x7a6a('0x36')]()[_0x7a6a('0x19')](respondWithResult(_0x4c5cfc,null))[_0x7a6a('0x27')](handleError(_0x4c5cfc,null));};exports['addMessage']=function(_0x213fc7,_0x345a2b){return db['SmsMessage']['find']({'where':{'id':_0x213fc7['params']['id']}})[_0x7a6a('0x19')](handleEntityNotFound(_0x345a2b,null))[_0x7a6a('0x19')](function(_0x23bf01){if(_0x23bf01){return _0x23bf01[_0x7a6a('0x37')](_0x213fc7[_0x7a6a('0x35')]['ids'],_[_0x7a6a('0x38')](_0x213fc7[_0x7a6a('0x35')],[_0x7a6a('0x39'),'id'])||{});}})[_0x7a6a('0x19')](respondWithResult(_0x345a2b,null))[_0x7a6a('0x27')](handleError(_0x345a2b,null));};exports[_0x7a6a('0x3a')]=function(_0x444832,_0x5d3db1){var _0x450de8={'raw':![],'where':{}};var _0xe16486={};var _0x36adf5={'count':0x0,'rows':[]};return db[_0x7a6a('0x1e')][_0x7a6a('0x3b')]({'where':{'id':_0x444832[_0x7a6a('0x29')]['id']}})['then'](handleEntityNotFound(_0x5d3db1,null))['then'](function(_0x4a7c3c){if(_0x4a7c3c){_0xe16486[_0x7a6a('0x2a')]=_['keys'](db['SmsMessage']['rawAttributes']);_0xe16486[_0x7a6a('0x26')]=_[_0x7a6a('0x2b')](_0x444832[_0x7a6a('0x26')]);_0xe16486['filters']=_[_0x7a6a('0x2d')](_0xe16486[_0x7a6a('0x2a')],_0xe16486[_0x7a6a('0x26')]);_0x450de8[_0x7a6a('0x2e')]=_['intersection'](_0xe16486['model'],qs[_0x7a6a('0x2f')](_0x444832[_0x7a6a('0x26')][_0x7a6a('0x2f')]));_0x450de8[_0x7a6a('0x2e')]=_0x450de8[_0x7a6a('0x2e')][_0x7a6a('0x30')]?_0x450de8[_0x7a6a('0x2e')]:_0xe16486[_0x7a6a('0x2a')];if(!_0x444832[_0x7a6a('0x26')][_0x7a6a('0x3c')](_0x7a6a('0x3d'))){_0x450de8[_0x7a6a('0x14')]=qs[_0x7a6a('0x14')](_0x444832[_0x7a6a('0x26')][_0x7a6a('0x14')]);_0x450de8[_0x7a6a('0x12')]=qs[_0x7a6a('0x12')](_0x444832[_0x7a6a('0x26')][_0x7a6a('0x12')]);}_0x450de8[_0x7a6a('0x3e')]=qs[_0x7a6a('0x3f')](_0x444832[_0x7a6a('0x26')][_0x7a6a('0x3f')]);_0x450de8['where']=qs[_0x7a6a('0x2c')](_[_0x7a6a('0x40')](_0x444832[_0x7a6a('0x26')],_0xe16486[_0x7a6a('0x2c')]));_0x450de8[_0x7a6a('0x41')][_0x7a6a('0x42')]=_0x4a7c3c['id'];if(_0x444832['query'][_0x7a6a('0x43')]){_0x450de8[_0x7a6a('0x41')]=_['merge'](_0x450de8[_0x7a6a('0x41')],{'$or':_[_0x7a6a('0x1d')](_0x450de8[_0x7a6a('0x2e')],function(_0x5ce086){var _0x7ae232={};_0x7ae232[_0x5ce086]={'$like':'%'+_0x444832['query'][_0x7a6a('0x43')]+'%'};return _0x7ae232;})});}if(_0x444832['query'][_0x7a6a('0x44')]){var _0x400c9a=_0x444832['query'][_0x7a6a('0x44')][_0x7a6a('0x45')](',');var _0x4659ce={};_0x4659ce[_0x400c9a[0x0]]={'$gte':moment(_0x400c9a[0x1])[_0x7a6a('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x450de8[_0x7a6a('0x41')]=_[_0x7a6a('0x47')](_0x450de8['where'],_0x4659ce);}_0x450de8=_[_0x7a6a('0x47')]({},_0x450de8,_0x444832['options']);return db[_0x7a6a('0x48')][_0x7a6a('0x15')]({'where':_0x450de8['where']})[_0x7a6a('0x19')](function(_0x41f1c6){_0x36adf5[_0x7a6a('0x15')]=_0x41f1c6;if(_0x444832[_0x7a6a('0x26')][_0x7a6a('0x31')]){_0x450de8[_0x7a6a('0x49')]=[{'all':!![]}];}return db[_0x7a6a('0x48')][_0x7a6a('0x24')](_0x450de8);})[_0x7a6a('0x19')](function(_0x2ceeb7){_0x36adf5['rows']=_0x2ceeb7;return _0x36adf5;});}})[_0x7a6a('0x19')](respondWithFilteredResult(_0x5d3db1,_0x450de8))[_0x7a6a('0x27')](handleError(_0x5d3db1,null));};exports['addTags']=function(_0x1842a9,_0x4af0e5){return db[_0x7a6a('0x1e')][_0x7a6a('0x33')]({'where':{'id':_0x1842a9[_0x7a6a('0x29')]['id']}})['then'](handleEntityNotFound(_0x4af0e5,null))[_0x7a6a('0x19')](function(_0xdec3f3){if(_0xdec3f3){return _0xdec3f3[_0x7a6a('0x4a')](_0x1842a9[_0x7a6a('0x35')][_0x7a6a('0x39')],_[_0x7a6a('0x38')](_0x1842a9[_0x7a6a('0x35')],[_0x7a6a('0x39'),'id'])||{})['spread'](function(){return db[_0x7a6a('0x4b')][_0x7a6a('0x24')]({'attributes':['id',_0x7a6a('0x1b'),_0x7a6a('0x4c')],'where':{'id':_0x1842a9[_0x7a6a('0x35')][_0x7a6a('0x39')]}});})[_0x7a6a('0x19')](function(_0x533fbb){socket[_0x7a6a('0x4d')](_0x7a6a('0x4e'),{'id':Number(_0x1842a9[_0x7a6a('0x29')]['id']),'tags':_0x533fbb||[]});return{'id':Number(_0x1842a9[_0x7a6a('0x29')]['id']),'tags':_0x533fbb||[]};});}})[_0x7a6a('0x19')](respondWithResult(_0x4af0e5,null))[_0x7a6a('0x27')](handleError(_0x4af0e5,null));};exports[_0x7a6a('0x4f')]=function(_0x1b5e2d,_0x4e5cb1){return db[_0x7a6a('0x1e')][_0x7a6a('0x33')]({'where':{'id':_0x1b5e2d['params']['id']}})[_0x7a6a('0x19')](handleEntityNotFound(_0x4e5cb1,null))[_0x7a6a('0x19')](function(_0x470f2a){if(_0x470f2a){return _0x470f2a[_0x7a6a('0x4f')](_0x1b5e2d['query'][_0x7a6a('0x39')]);}})[_0x7a6a('0x19')](respondWithStatusCode(_0x4e5cb1,null))['catch'](handleError(_0x4e5cb1,null));};exports[_0x7a6a('0x50')]=function(_0x594d31,_0x3ddeb9){var _0x18ba15=moment()[_0x7a6a('0x51')]()[_0x7a6a('0x52')]();var _0x510ff4=path['join'](config[_0x7a6a('0x53')],_0x7a6a('0x54'),_0x7a6a('0x55'),_0x7a6a('0x56'));var _0x566c53=path[_0x7a6a('0x57')](_0x510ff4,_0x18ba15);var _0x13fc5f=util[_0x7a6a('0x46')](_0x7a6a('0x58'),_0x594d31['params']['id'],_0x18ba15);var _0xb2a379=path[_0x7a6a('0x57')](_0x510ff4,_0x13fc5f);var _0x51af79=[];_0x51af79[_0x7a6a('0x59')]({'model':db[_0x7a6a('0x5a')],'as':_0x7a6a('0x5a'),'attributes':['id',_0x7a6a('0x5b')],'raw':!![]});_0x51af79['push']({'model':db[_0x7a6a('0x5c')],'as':_0x7a6a('0x5d'),'attributes':['id',_0x7a6a('0x5e'),'lastName'],'raw':!![]});var _0x38ef6e=[{'model':db[_0x7a6a('0x48')],'as':_0x7a6a('0x5f'),'attributes':['id',_0x7a6a('0x35'),_0x7a6a('0x60'),'direction',_0x7a6a('0x61'),_0x7a6a('0x62')],'include':_0x51af79}];_0x38ef6e[_0x7a6a('0x59')]({'model':db[_0x7a6a('0x63')],'as':'Account','attributes':['id','name']});_0x38ef6e[_0x7a6a('0x59')]({'model':db[_0x7a6a('0x5a')],'as':_0x7a6a('0x64'),'attributes':['id','fullname']});return db['SmsInteraction']['find']({'where':{'id':_0x594d31[_0x7a6a('0x29')]['id']},'include':_0x38ef6e})[_0x7a6a('0x19')](handleEntityNotFound(_0x3ddeb9,null))[_0x7a6a('0x19')](function(_0x50a8b9){if(_0x50a8b9){var _0x1477a0=_0x50a8b9[_0x7a6a('0x65')]({'plain':!![]});fs[_0x7a6a('0x66')](_0x566c53);var _0x3887a6={'channel':_0x7a6a('0x67'),'account':_0x1477a0[_0x7a6a('0x68')]['name'],'agent':_0x1477a0[_0x7a6a('0x64')]?_0x1477a0[_0x7a6a('0x64')][_0x7a6a('0x5b')]:'N.A.','createdAt':moment(_0x1477a0[_0x7a6a('0x60')])[_0x7a6a('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7a6a('0x52')](),'closedAt':_0x1477a0['closed']?moment(_0x1477a0[_0x7a6a('0x69')])[_0x7a6a('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7a6a('0x52')]():'','disposition':_0x1477a0[_0x7a6a('0x6a')],'messages':_(_0x1477a0[_0x7a6a('0x5f')])[_0x7a6a('0x43')]({'secret':![]})[_0x7a6a('0x1d')](function(_0x5b7d62){return{'date':moment(_0x5b7d62[_0x7a6a('0x60')])[_0x7a6a('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7a6a('0x52')](),'sender':_0x5b7d62[_0x7a6a('0x6b')]==='out'?_0x5b7d62[_0x7a6a('0x5a')]?_0x5b7d62[_0x7a6a('0x5a')][_0x7a6a('0x5b')]:'System':_0x5b7d62[_0x7a6a('0x5d')][_0x7a6a('0x5e')]+(_0x5b7d62[_0x7a6a('0x5d')][_0x7a6a('0x6c')]?'\x20'+_0x5b7d62[_0x7a6a('0x5d')]['lastName']:''),'body':_0x5b7d62[_0x7a6a('0x35')],'direction':_0x5b7d62['direction']===_0x7a6a('0x6d')?'A':'C','secret':_0x5b7d62[_0x7a6a('0x61')],'read':_0x5b7d62['read']};})[_0x7a6a('0x6e')]()};return ejs[_0x7a6a('0x6f')](path[_0x7a6a('0x57')](config['root'],_0x7a6a('0x54'),_0x7a6a('0x70'),_0x7a6a('0x71')),{'interaction':_0x3887a6})[_0x7a6a('0x19')](function(_0x30a467){var _0x4cf740=path[_0x7a6a('0x57')](_0x566c53,'transcript-'+_0x1477a0['id']+'-'+_0x18ba15+_0x7a6a('0x72'));var _0x39cd2b={'path':_0x4cf740,'channel':'Sms','interactionId':_0x1477a0['id']};return pdf[_0x7a6a('0x73')](_0x30a467,_0x39cd2b);})[_0x7a6a('0x19')](function(){return new BPromise(function(_0x4173b3,_0x3cc5cf){zipdir(_0x566c53,{'saveTo':_0xb2a379},function(_0xd04193,_0x2bd833){if(_0xd04193)return _0x3cc5cf(_0xd04193);return _0x4173b3(_0x2bd833);});})['then'](function(){return new BPromise(function(_0x282293,_0x1e4f72){rimraf(_0x566c53,function(_0x4d9841){if(_0x4d9841)_0x1e4f72(_0x4d9841);return _0x282293();});});})[_0x7a6a('0x19')](function(){return _0x3ddeb9[_0x7a6a('0x50')](_0xb2a379,_0x13fc5f,function(_0x4b6d32){if(_0x4b6d32){console[_0x7a6a('0x74')](_0x7a6a('0x75'),_0x4b6d32);}else{fs[_0x7a6a('0x76')](_0xb2a379);}});});});}else{return _0x3ddeb9[_0x7a6a('0xe')](0xc8);}})['catch'](handleError(_0x3ddeb9,null));}; \ No newline at end of file +var _0xf2cc=['emit','removeTags','download','unix','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','createdAt','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closed','disposition','Messages','direction','out','System','lastName','read','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','unlinkSync','rimraf','moment','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','error','name','send','index','SmsInteraction','rawAttributes','type','key','getOptions','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','pick','where','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','Tag','color'];(function(_0x2ff535,_0xd6516e){var _0x244584=function(_0x275c11){while(--_0x275c11){_0x2ff535['push'](_0x2ff535['shift']());}};_0x244584(++_0xd6516e);}(_0xf2cc,0x112));var _0xcf2c=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf2cc[_0xa1e3e3];return _0xc980e9;};'use strict';var rimraf=require(_0xcf2c('0x0'));var zipdir=require('zip-dir');var moment=require(_0xcf2c('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcf2c('0x2'));var ejs=require(_0xcf2c('0x3'));var fs=require('fs');var _=require(_0xcf2c('0x4'));var Redis=require(_0xcf2c('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xcf2c('0x6'));var pdf=require(_0xcf2c('0x7'));var logger=require('../../config/logger')(_0xcf2c('0x8'));var config=require(_0xcf2c('0x9'));var db=require(_0xcf2c('0xa'))['db'];config[_0xcf2c('0xb')]=_[_0xcf2c('0xc')](config[_0xcf2c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf2c('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1496d6,_0x5da44b){_0x5da44b=_0x5da44b||0xcc;return function(_0x6b5521){if(_0x6b5521){return _0x1496d6[_0xcf2c('0xe')](_0x5da44b);}return _0x1496d6[_0xcf2c('0xf')](_0x5da44b)['end']();};}function respondWithResult(_0x30ae7a,_0x4cf86f){_0x4cf86f=_0x4cf86f||0xc8;return function(_0x2674b9){if(_0x2674b9){return _0x30ae7a[_0xcf2c('0xf')](_0x4cf86f)['json'](_0x2674b9);}};}function respondWithFilteredResult(_0x2abcce,_0x12f1c9){return function(_0x17bc86){if(_0x17bc86){var _0x5d9007=typeof _0x12f1c9['offset']===_0xcf2c('0x10')&&typeof _0x12f1c9[_0xcf2c('0x11')]==='undefined';var _0x3aaba8=_0x17bc86[_0xcf2c('0x12')];var _0x55edf1=_0x5d9007?0x0:_0x12f1c9[_0xcf2c('0x13')];var _0x156514=_0x5d9007?_0x17bc86[_0xcf2c('0x12')]:_0x12f1c9['offset']+_0x12f1c9[_0xcf2c('0x11')];var _0x59db18;if(_0x156514>=_0x3aaba8){_0x156514=_0x3aaba8;_0x59db18=0xc8;}else{_0x59db18=0xce;}_0x2abcce[_0xcf2c('0xf')](_0x59db18);return _0x2abcce[_0xcf2c('0x14')](_0xcf2c('0x15'),_0x55edf1+'-'+_0x156514+'/'+_0x3aaba8)[_0xcf2c('0x16')](_0x17bc86);}return null;};}function saveUpdates(_0x33f66a){return function(_0x4f1a7f){if(_0x4f1a7f){return _0x4f1a7f[_0xcf2c('0x17')](_0x33f66a)[_0xcf2c('0x18')](function(_0x151f00){return _0x151f00;});}return null;};}function removeEntity(_0xbf5da){return function(_0x5313df){if(_0x5313df){return _0x5313df[_0xcf2c('0x19')]()[_0xcf2c('0x18')](function(){_0xbf5da['status'](0xcc)[_0xcf2c('0x1a')]();});}};}function handleEntityNotFound(_0x57fe2c){return function(_0xcbcdd7){if(!_0xcbcdd7){_0x57fe2c['sendStatus'](0x194);}return _0xcbcdd7;};}function handleError(_0x3134f0,_0x5139ff){_0x5139ff=_0x5139ff||0x1f4;return function(_0x240f9d){logger[_0xcf2c('0x1b')](_0x240f9d['stack']);if(_0x240f9d['name']){delete _0x240f9d[_0xcf2c('0x1c')];}_0x3134f0[_0xcf2c('0xf')](_0x5139ff)[_0xcf2c('0x1d')](_0x240f9d);};}exports[_0xcf2c('0x1e')]=function(_0x5f0e7c,_0x58fc8b){var _0x20c7f6={};var _0x28f074=_['map'](db[_0xcf2c('0x1f')][_0xcf2c('0x20')],function(_0x355cdf){return{'name':_0x355cdf['fieldName'],'type':_0x355cdf[_0xcf2c('0x21')][_0xcf2c('0x22')]};});_0x20c7f6=qs[_0xcf2c('0x23')](_0x28f074,_0x5f0e7c);return interaction['findAll'](_0xcf2c('0x24'),_0x5f0e7c[_0xcf2c('0x25')],_0x5f0e7c[_0xcf2c('0x26')],_0x20c7f6,_0x28f074)[_0xcf2c('0x18')](respondWithFilteredResult(_0x58fc8b,_0x20c7f6))[_0xcf2c('0x27')](handleError(_0x58fc8b,null));};exports[_0xcf2c('0x28')]=function(_0x85f05f,_0x31f113){var _0x3326e8={'raw':![],'where':{'id':_0x85f05f[_0xcf2c('0x29')]['id']}},_0x596235={};_0x596235[_0xcf2c('0x2a')]=_[_0xcf2c('0x2b')](db[_0xcf2c('0x1f')][_0xcf2c('0x20')]);_0x596235[_0xcf2c('0x25')]=_[_0xcf2c('0x2b')](_0x85f05f[_0xcf2c('0x25')]);_0x596235[_0xcf2c('0x2c')]=_[_0xcf2c('0x2d')](_0x596235[_0xcf2c('0x2a')],_0x596235[_0xcf2c('0x25')]);_0x3326e8[_0xcf2c('0x2e')]=_[_0xcf2c('0x2d')](_0x596235['model'],qs[_0xcf2c('0x2f')](_0x85f05f[_0xcf2c('0x25')][_0xcf2c('0x2f')]));_0x3326e8[_0xcf2c('0x2e')]=_0x3326e8['attributes'][_0xcf2c('0x30')]?_0x3326e8[_0xcf2c('0x2e')]:_0x596235[_0xcf2c('0x2a')];if(_0x85f05f['query'][_0xcf2c('0x31')]){_0x3326e8[_0xcf2c('0x32')]=[{'all':!![]}];}_0x3326e8=_[_0xcf2c('0x33')]({},_0x3326e8,_0x85f05f[_0xcf2c('0x34')]);return db[_0xcf2c('0x1f')][_0xcf2c('0x35')](_0x3326e8)['then'](handleEntityNotFound(_0x31f113,null))[_0xcf2c('0x18')](respondWithResult(_0x31f113,null))[_0xcf2c('0x27')](handleError(_0x31f113,null));};exports['create']=function(_0x48a725,_0x1a54a6){return db[_0xcf2c('0x1f')]['create'](_0x48a725[_0xcf2c('0x36')],{})[_0xcf2c('0x18')](respondWithResult(_0x1a54a6,0xc9))[_0xcf2c('0x27')](handleError(_0x1a54a6,null));};exports[_0xcf2c('0x17')]=function(_0x14798f,_0x4f616b){if(_0x14798f[_0xcf2c('0x36')]['id']){delete _0x14798f['body']['id'];}return db['SmsInteraction'][_0xcf2c('0x35')]({'where':{'id':_0x14798f[_0xcf2c('0x29')]['id']}})[_0xcf2c('0x18')](handleEntityNotFound(_0x4f616b,null))['then'](saveUpdates(_0x14798f[_0xcf2c('0x36')],null))['then'](respondWithResult(_0x4f616b,null))['catch'](handleError(_0x4f616b,null));};exports[_0xcf2c('0x19')]=function(_0x49072e,_0x5b89ba){return db[_0xcf2c('0x1f')][_0xcf2c('0x35')]({'where':{'id':_0x49072e[_0xcf2c('0x29')]['id']}})['then'](handleEntityNotFound(_0x5b89ba,null))[_0xcf2c('0x18')](removeEntity(_0x5b89ba,null))[_0xcf2c('0x27')](handleError(_0x5b89ba,null));};exports['describe']=function(_0x2b310e,_0x3858d2){return db[_0xcf2c('0x1f')]['describe']()['then'](respondWithResult(_0x3858d2,null))[_0xcf2c('0x27')](handleError(_0x3858d2,null));};exports['addMessage']=function(_0xf71384,_0xc07851){return db['SmsMessage']['find']({'where':{'id':_0xf71384[_0xcf2c('0x29')]['id']}})[_0xcf2c('0x18')](handleEntityNotFound(_0xc07851,null))[_0xcf2c('0x18')](function(_0x3a3e5e){if(_0x3a3e5e){return _0x3a3e5e[_0xcf2c('0x37')](_0xf71384[_0xcf2c('0x36')][_0xcf2c('0x38')],_[_0xcf2c('0x39')](_0xf71384[_0xcf2c('0x36')],[_0xcf2c('0x38'),'id'])||{});}})[_0xcf2c('0x18')](respondWithResult(_0xc07851,null))[_0xcf2c('0x27')](handleError(_0xc07851,null));};exports[_0xcf2c('0x3a')]=function(_0x44e3fa,_0xbc8930){var _0x47b33d={'raw':![],'where':{}};var _0x3e93d2={};var _0x53843e={'count':0x0,'rows':[]};return db[_0xcf2c('0x1f')][_0xcf2c('0x3b')]({'where':{'id':_0x44e3fa['params']['id']}})[_0xcf2c('0x18')](handleEntityNotFound(_0xbc8930,null))['then'](function(_0x4cee0e){if(_0x4cee0e){_0x3e93d2['model']=_['keys'](db[_0xcf2c('0x3c')]['rawAttributes']);_0x3e93d2[_0xcf2c('0x25')]=_[_0xcf2c('0x2b')](_0x44e3fa[_0xcf2c('0x25')]);_0x3e93d2[_0xcf2c('0x2c')]=_[_0xcf2c('0x2d')](_0x3e93d2['model'],_0x3e93d2['query']);_0x47b33d[_0xcf2c('0x2e')]=_[_0xcf2c('0x2d')](_0x3e93d2[_0xcf2c('0x2a')],qs[_0xcf2c('0x2f')](_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x2f')]));_0x47b33d[_0xcf2c('0x2e')]=_0x47b33d[_0xcf2c('0x2e')][_0xcf2c('0x30')]?_0x47b33d[_0xcf2c('0x2e')]:_0x3e93d2[_0xcf2c('0x2a')];if(!_0x44e3fa['query'][_0xcf2c('0x3d')](_0xcf2c('0x3e'))){_0x47b33d[_0xcf2c('0x11')]=qs['limit'](_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x11')]);_0x47b33d[_0xcf2c('0x13')]=qs[_0xcf2c('0x13')](_0x44e3fa[_0xcf2c('0x25')]['offset']);}_0x47b33d[_0xcf2c('0x3f')]=qs[_0xcf2c('0x40')](_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x40')]);_0x47b33d['where']=qs[_0xcf2c('0x2c')](_[_0xcf2c('0x41')](_0x44e3fa['query'],_0x3e93d2[_0xcf2c('0x2c')]));_0x47b33d[_0xcf2c('0x42')]['SmsInteractionId']=_0x4cee0e['id'];if(_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x43')]){_0x47b33d[_0xcf2c('0x42')]=_[_0xcf2c('0x33')](_0x47b33d['where'],{'$or':_[_0xcf2c('0x44')](_0x47b33d[_0xcf2c('0x2e')],function(_0x57ac8c){var _0x2609d6={};_0x2609d6[_0x57ac8c]={'$like':'%'+_0x44e3fa['query'][_0xcf2c('0x43')]+'%'};return _0x2609d6;})});}if(_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x45')]){var _0x3448a1=_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x45')]['split'](',');var _0x46829f={};_0x46829f[_0x3448a1[0x0]]={'$gte':moment(_0x3448a1[0x1])['format'](_0xcf2c('0x46'))};_0x47b33d[_0xcf2c('0x42')]=_[_0xcf2c('0x33')](_0x47b33d['where'],_0x46829f);}_0x47b33d=_[_0xcf2c('0x33')]({},_0x47b33d,_0x44e3fa['options']);return db[_0xcf2c('0x3c')]['count']({'where':_0x47b33d[_0xcf2c('0x42')]})[_0xcf2c('0x18')](function(_0x53938f){_0x53843e[_0xcf2c('0x12')]=_0x53938f;if(_0x44e3fa[_0xcf2c('0x25')][_0xcf2c('0x31')]){_0x47b33d['include']=[{'all':!![]}];}return db[_0xcf2c('0x3c')][_0xcf2c('0x47')](_0x47b33d);})['then'](function(_0x417d9a){_0x53843e[_0xcf2c('0x48')]=_0x417d9a;return _0x53843e;});}})[_0xcf2c('0x18')](respondWithFilteredResult(_0xbc8930,_0x47b33d))[_0xcf2c('0x27')](handleError(_0xbc8930,null));};exports[_0xcf2c('0x49')]=function(_0x14d82b,_0x422a8){return db[_0xcf2c('0x1f')][_0xcf2c('0x35')]({'where':{'id':_0x14d82b[_0xcf2c('0x29')]['id']}})[_0xcf2c('0x18')](handleEntityNotFound(_0x422a8,null))[_0xcf2c('0x18')](function(_0x623571){if(_0x623571){return _0x623571[_0xcf2c('0x4a')](_0x14d82b[_0xcf2c('0x36')][_0xcf2c('0x38')],_[_0xcf2c('0x39')](_0x14d82b['body'],[_0xcf2c('0x38'),'id'])||{})['spread'](function(){return db[_0xcf2c('0x4b')][_0xcf2c('0x47')]({'attributes':['id',_0xcf2c('0x1c'),_0xcf2c('0x4c')],'where':{'id':_0x14d82b[_0xcf2c('0x36')][_0xcf2c('0x38')]}});})[_0xcf2c('0x18')](function(_0x296535){socket[_0xcf2c('0x4d')]('smsInteractionTags:save',{'id':Number(_0x14d82b['params']['id']),'tags':_0x296535||[]});return{'id':Number(_0x14d82b['params']['id']),'tags':_0x296535||[]};});}})['then'](respondWithResult(_0x422a8,null))['catch'](handleError(_0x422a8,null));};exports[_0xcf2c('0x4e')]=function(_0x560425,_0x20d6ab){return db[_0xcf2c('0x1f')][_0xcf2c('0x35')]({'where':{'id':_0x560425[_0xcf2c('0x29')]['id']}})[_0xcf2c('0x18')](handleEntityNotFound(_0x20d6ab,null))[_0xcf2c('0x18')](function(_0x3833b5){if(_0x3833b5){return _0x3833b5['removeTags'](_0x560425[_0xcf2c('0x25')][_0xcf2c('0x38')]);}})[_0xcf2c('0x18')](respondWithStatusCode(_0x20d6ab,null))[_0xcf2c('0x27')](handleError(_0x20d6ab,null));};exports[_0xcf2c('0x4f')]=function(_0xeb9472,_0x3eb604){var _0x208890=moment()[_0xcf2c('0x50')]()[_0xcf2c('0x51')]();var _0x39433c=path[_0xcf2c('0x52')](config[_0xcf2c('0x53')],_0xcf2c('0x54'),_0xcf2c('0x55'),_0xcf2c('0x56'));var _0x5c4cd8=path[_0xcf2c('0x52')](_0x39433c,_0x208890);var _0x2adc83=util[_0xcf2c('0x57')](_0xcf2c('0x58'),_0xeb9472[_0xcf2c('0x29')]['id'],_0x208890);var _0x1c7043=path[_0xcf2c('0x52')](_0x39433c,_0x2adc83);var _0x17bcc3=[];_0x17bcc3[_0xcf2c('0x59')]({'model':db[_0xcf2c('0x5a')],'as':_0xcf2c('0x5a'),'attributes':['id',_0xcf2c('0x5b')],'raw':!![]});_0x17bcc3[_0xcf2c('0x59')]({'model':db['CmContact'],'as':_0xcf2c('0x5c'),'attributes':['id',_0xcf2c('0x5d'),'lastName'],'raw':!![]});var _0x195895=[{'model':db[_0xcf2c('0x3c')],'as':'Messages','attributes':['id',_0xcf2c('0x36'),_0xcf2c('0x5e'),'direction',_0xcf2c('0x5f'),'read'],'include':_0x17bcc3}];_0x195895[_0xcf2c('0x59')]({'model':db[_0xcf2c('0x60')],'as':_0xcf2c('0x61'),'attributes':['id',_0xcf2c('0x1c')]});_0x195895[_0xcf2c('0x59')]({'model':db['User'],'as':_0xcf2c('0x62'),'attributes':['id','fullname']});return db['SmsInteraction']['find']({'where':{'id':_0xeb9472[_0xcf2c('0x29')]['id']},'include':_0x195895})[_0xcf2c('0x18')](handleEntityNotFound(_0x3eb604,null))['then'](function(_0x1afacb){if(_0x1afacb){var _0x40dc67=_0x1afacb['get']({'plain':!![]});fs[_0xcf2c('0x63')](_0x5c4cd8);var _0x37a86f={'channel':_0xcf2c('0x64'),'account':_0x40dc67[_0xcf2c('0x61')][_0xcf2c('0x1c')],'agent':_0x40dc67[_0xcf2c('0x62')]?_0x40dc67[_0xcf2c('0x62')]['fullname']:_0xcf2c('0x65'),'createdAt':moment(_0x40dc67[_0xcf2c('0x5e')])[_0xcf2c('0x57')](_0xcf2c('0x46'))[_0xcf2c('0x51')](),'closedAt':_0x40dc67[_0xcf2c('0x66')]?moment(_0x40dc67['closedAt'])['format'](_0xcf2c('0x46'))[_0xcf2c('0x51')]():'','disposition':_0x40dc67[_0xcf2c('0x67')],'messages':_(_0x40dc67[_0xcf2c('0x68')])[_0xcf2c('0x43')]({'secret':![]})['map'](function(_0xdc08be){return{'date':moment(_0xdc08be[_0xcf2c('0x5e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xcf2c('0x51')](),'sender':_0xdc08be[_0xcf2c('0x69')]===_0xcf2c('0x6a')?_0xdc08be['User']?_0xdc08be[_0xcf2c('0x5a')][_0xcf2c('0x5b')]:_0xcf2c('0x6b'):_0xdc08be[_0xcf2c('0x5c')][_0xcf2c('0x5d')]+(_0xdc08be[_0xcf2c('0x5c')][_0xcf2c('0x6c')]?'\x20'+_0xdc08be[_0xcf2c('0x5c')][_0xcf2c('0x6c')]:''),'body':_0xdc08be[_0xcf2c('0x36')],'direction':_0xdc08be[_0xcf2c('0x69')]===_0xcf2c('0x6a')?'A':'C','secret':_0xdc08be[_0xcf2c('0x5f')],'read':_0xdc08be[_0xcf2c('0x6d')]};})[_0xcf2c('0x6e')]()};return ejs[_0xcf2c('0x6f')](path['join'](config['root'],_0xcf2c('0x54'),_0xcf2c('0x70'),_0xcf2c('0x71')),{'interaction':_0x37a86f})['then'](function(_0x4ae2c0){var _0x5af3b7=path[_0xcf2c('0x52')](_0x5c4cd8,'transcript-'+_0x40dc67['id']+'-'+_0x208890+'.pdf');var _0x429d49={'path':_0x5af3b7,'channel':_0xcf2c('0x64'),'interactionId':_0x40dc67['id']};return pdf[_0xcf2c('0x72')](_0x4ae2c0,_0x429d49);})[_0xcf2c('0x18')](function(){return new BPromise(function(_0x3dfb78,_0x52c2cb){zipdir(_0x5c4cd8,{'saveTo':_0x1c7043},function(_0x40074c,_0x5b3bb7){if(_0x40074c)return _0x52c2cb(_0x40074c);return _0x3dfb78(_0x5b3bb7);});})[_0xcf2c('0x18')](function(){return new BPromise(function(_0x26ab1b,_0x37e5c6){rimraf(_0x5c4cd8,function(_0x432551){if(_0x432551)_0x37e5c6(_0x432551);return _0x26ab1b();});});})[_0xcf2c('0x18')](function(){return _0x3eb604['download'](_0x1c7043,_0x2adc83,function(_0x597be4){if(_0x597be4){console[_0xcf2c('0x73')]('err',_0x597be4);}else{fs[_0xcf2c('0x74')](_0x1c7043);}});});});}else{return _0x3eb604[_0xcf2c('0xe')](0xc8);}})[_0xcf2c('0x27')](handleError(_0x3eb604,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index afe3e49..3322ae3 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x4a2c30,_0x4136f1){var _0x106c25=function(_0x36a533){while(--_0x36a533){_0x4a2c30['push'](_0x4a2c30['shift']());}};_0x106c25(++_0x4136f1);}(_0x583c,0x12b));var _0xc583=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x583c[_0x483d8b];return _0x6500f1;};'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 8ef2de6..ba5c827 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 _0x9bdc=['exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x9bdc,0x126));var _0xc9bd=function(_0x19feba,_0x4a3338){_0x19feba=_0x19feba-0x0;var _0x5ae28d=_0x9bdc[_0x19feba];return _0x5ae28d;};'use strict';var _=require(_0xc9bd('0x0'));var util=require(_0xc9bd('0x1'));var logger=require(_0xc9bd('0x2'))(_0xc9bd('0x3'));var moment=require(_0xc9bd('0x4'));var BPromise=require(_0xc9bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9bd('0x6'));var rimraf=require(_0xc9bd('0x7'));var config=require(_0xc9bd('0x8'));var attributes=require(_0xc9bd('0x9'));module[_0xc9bd('0xa')]=function(_0x239a17,_0x37400a){return _0x239a17[_0xc9bd('0xb')](_0xc9bd('0xc'),attributes,{'tableName':_0xc9bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa1def9,_0x3332ba,_0xc3ad68){if(_0xa1def9[_0xc9bd('0xe')](_0xc9bd('0xf'))){_0xa1def9[_0xc9bd('0x10')]=moment()[_0xc9bd('0x11')](_0xc9bd('0x12'));}_0xc3ad68(null,_0xa1def9);}}});}; \ No newline at end of file +var _0x17e6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3168e1,_0xa046e0){var _0x13ad69=function(_0x136b1f){while(--_0x136b1f){_0x3168e1['push'](_0x3168e1['shift']());}};_0x13ad69(++_0xa046e0);}(_0x17e6,0x166));var _0x617e=function(_0x162404,_0x3903c7){_0x162404=_0x162404-0x0;var _0x1d7869=_0x17e6[_0x162404];return _0x1d7869;};'use strict';var _=require(_0x617e('0x0'));var util=require(_0x617e('0x1'));var logger=require(_0x617e('0x2'))(_0x617e('0x3'));var moment=require(_0x617e('0x4'));var BPromise=require(_0x617e('0x5'));var rp=require(_0x617e('0x6'));var fs=require('fs');var path=require(_0x617e('0x7'));var rimraf=require(_0x617e('0x8'));var config=require(_0x617e('0x9'));var attributes=require(_0x617e('0xa'));module[_0x617e('0xb')]=function(_0x24ca21,_0x431212){return _0x24ca21[_0x617e('0xc')](_0x617e('0xd'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x440ae0,_0x5a58b8,_0x8718d1){if(_0x440ae0['changed'](_0x617e('0xe'))){_0x440ae0[_0x617e('0xf')]=moment()[_0x617e('0x10')](_0x617e('0x11'));}_0x8718d1(null,_0x440ae0);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bbc0477..ded066e 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 _0x4fdc=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','randomstring'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x4fdc,0x165));var _0xc4fd=function(_0xc0962c,_0x362db7){_0xc0962c=_0xc0962c-0x0;var _0x491fb5=_0x4fdc[_0xc0962c];return _0x491fb5;};'use strict';var _=require(_0xc4fd('0x0'));var util=require('util');var moment=require(_0xc4fd('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc4fd('0x3'));var jayson=require(_0xc4fd('0x4'));var client=jayson[_0xc4fd('0x5')][_0xc4fd('0x6')]({'port':0x232a});config['redis']=_[_0xc4fd('0x7')](config[_0xc4fd('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc4fd('0x9'))(new Redis(config[_0xc4fd('0x8')]));require(_0xc4fd('0xa'))[_0xc4fd('0xb')](socket);function respondWithRpcPromise(_0x438879,_0x502ad7,_0x55a3cb){return new BPromise(function(_0x50b12a,_0x3d0767){return client[_0xc4fd('0xc')](_0x438879,_0x55a3cb)[_0xc4fd('0xd')](function(_0x46345b){logger[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x502ad7,_0xc4fd('0x10'));logger[_0xc4fd('0x11')](_0xc4fd('0x12'),_0x502ad7,_0xc4fd('0x10'),JSON[_0xc4fd('0x13')](_0x46345b));if(_0x46345b[_0xc4fd('0x14')]){if(_0x46345b['error'][_0xc4fd('0x15')]===0x1f4){logger[_0xc4fd('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x502ad7,_0x46345b['error'][_0xc4fd('0x16')]);return _0x3d0767(_0x46345b[_0xc4fd('0x14')]['message']);}logger[_0xc4fd('0x14')](_0xc4fd('0xf'),_0x502ad7,_0x46345b[_0xc4fd('0x14')][_0xc4fd('0x16')]);return _0x50b12a(_0x46345b['error'][_0xc4fd('0x16')]);}else{logger[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x502ad7,_0xc4fd('0x10'));_0x50b12a(_0x46345b[_0xc4fd('0x17')][_0xc4fd('0x16')]);}})['catch'](function(_0xd13532){logger[_0xc4fd('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x502ad7,_0xd13532);_0x3d0767(_0xd13532);});});}exports['UpdateSmsInteraction']=function(_0xa6b944){var _0x3556ff=this;return new Promise(function(_0x435469,_0x476d4e){return db[_0xc4fd('0x18')][_0xc4fd('0x19')](_0xa6b944['body'],{'raw':_0xa6b944[_0xc4fd('0x1a')]?_0xa6b944[_0xc4fd('0x1a')][_0xc4fd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa6b944['options']?_0xa6b944['options'][_0xc4fd('0x1c')]||null:null,'attributes':_0xa6b944['options']?_0xa6b944[_0xc4fd('0x1a')][_0xc4fd('0x1d')]||null:null,'limit':_0xa6b944['options']?_0xa6b944[_0xc4fd('0x1a')][_0xc4fd('0x1e')]||null:null})['then'](function(_0x437b58){logger[_0xc4fd('0xe')](_0xc4fd('0x1f'),_0xa6b944);logger[_0xc4fd('0x11')](_0xc4fd('0x1f'),_0xa6b944,JSON[_0xc4fd('0x13')](_0x437b58));_0x435469(_0x437b58);})['catch'](function(_0x50311e){logger[_0xc4fd('0x14')](_0xc4fd('0x1f'),_0x50311e[_0xc4fd('0x16')],_0xa6b944);_0x476d4e(_0x3556ff['error'](0x1f4,_0x50311e[_0xc4fd('0x16')]));});});};exports[_0xc4fd('0x20')]=function(_0x3d0942){return new Promise(function(_0x489ba0,_0x12b11a){return db[_0xc4fd('0x18')][_0xc4fd('0x21')]({'where':_0x3d0942[_0xc4fd('0x1a')]?_0x3d0942['options'][_0xc4fd('0x1c')]||null:null})[_0xc4fd('0xd')](function(_0x54c7b9){if(_0x54c7b9){return _0x54c7b9[_0xc4fd('0x22')](_0x3d0942[_0xc4fd('0x23')][_0xc4fd('0x24')],_[_0xc4fd('0x25')](_0x3d0942[_0xc4fd('0x23')],[_0xc4fd('0x24'),'id'])||{});}})[_0xc4fd('0x26')](function(_0x51e5c8){logger[_0xc4fd('0xe')]('AddTags',_0x3d0942);logger['debug'](_0xc4fd('0x27'),_0x3d0942,JSON[_0xc4fd('0x13')](_0x51e5c8));_0x489ba0(_0x51e5c8);})['catch'](function(_0x5b0763){logger[_0xc4fd('0x14')](_0xc4fd('0x27'),_0x5b0763[_0xc4fd('0x16')],_0x3d0942);_0x12b11a(_this['error'](0x1f4,_0x5b0763[_0xc4fd('0x16')]));});});}; \ No newline at end of file +var _0x3373=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','update','raw','options','where','attributes','limit','AddTagsToSmsInteraction','SmsInteraction','find','addTags','omit','body','ids','spread','AddTags','util','moment'];(function(_0x44fe52,_0x1eb4fe){var _0x63f28f=function(_0x1c2515){while(--_0x1c2515){_0x44fe52['push'](_0x44fe52['shift']());}};_0x63f28f(++_0x1eb4fe);}(_0x3373,0x18a));var _0x3337=function(_0x52181a,_0x43495e){_0x52181a=_0x52181a-0x0;var _0x5a2e36=_0x3373[_0x52181a];return _0x5a2e36;};'use strict';var _=require('lodash');var util=require(_0x3337('0x0'));var moment=require(_0x3337('0x1'));var BPromise=require(_0x3337('0x2'));var rs=require(_0x3337('0x3'));var fs=require('fs');var Redis=require(_0x3337('0x4'));var db=require(_0x3337('0x5'))['db'];var utils=require(_0x3337('0x6'));var logger=require(_0x3337('0x7'))(_0x3337('0x8'));var config=require(_0x3337('0x9'));var jayson=require(_0x3337('0xa'));var client=jayson[_0x3337('0xb')][_0x3337('0xc')]({'port':0x232a});config[_0x3337('0xd')]=_[_0x3337('0xe')](config[_0x3337('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3337('0xd')]));require(_0x3337('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f97bc,_0x1d0b95,_0x4ff367){return new BPromise(function(_0x4d6237,_0x723f40){return client['request'](_0x2f97bc,_0x4ff367)[_0x3337('0x10')](function(_0x5584dc){logger[_0x3337('0x11')](_0x3337('0x12'),_0x1d0b95,_0x3337('0x13'));logger[_0x3337('0x14')](_0x3337('0x15'),_0x1d0b95,_0x3337('0x13'),JSON[_0x3337('0x16')](_0x5584dc));if(_0x5584dc['error']){if(_0x5584dc[_0x3337('0x17')][_0x3337('0x18')]===0x1f4){logger['error'](_0x3337('0x12'),_0x1d0b95,_0x5584dc[_0x3337('0x17')][_0x3337('0x19')]);return _0x723f40(_0x5584dc[_0x3337('0x17')][_0x3337('0x19')]);}logger[_0x3337('0x17')](_0x3337('0x12'),_0x1d0b95,_0x5584dc[_0x3337('0x17')][_0x3337('0x19')]);return _0x4d6237(_0x5584dc[_0x3337('0x17')][_0x3337('0x19')]);}else{logger[_0x3337('0x11')](_0x3337('0x12'),_0x1d0b95,_0x3337('0x13'));_0x4d6237(_0x5584dc[_0x3337('0x1a')][_0x3337('0x19')]);}})[_0x3337('0x1b')](function(_0x5395f5){logger[_0x3337('0x17')](_0x3337('0x12'),_0x1d0b95,_0x5395f5);_0x723f40(_0x5395f5);});});}exports[_0x3337('0x1c')]=function(_0x3a37f1){var _0x42c927=this;return new Promise(function(_0x61a039,_0x31bc9b){return db['SmsInteraction'][_0x3337('0x1d')](_0x3a37f1['body'],{'raw':_0x3a37f1['options']?_0x3a37f1['options'][_0x3337('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a37f1['options']?_0x3a37f1[_0x3337('0x1f')][_0x3337('0x20')]||null:null,'attributes':_0x3a37f1[_0x3337('0x1f')]?_0x3a37f1['options'][_0x3337('0x21')]||null:null,'limit':_0x3a37f1[_0x3337('0x1f')]?_0x3a37f1[_0x3337('0x1f')][_0x3337('0x22')]||null:null})[_0x3337('0x10')](function(_0x2958a2){logger['info'](_0x3337('0x1c'),_0x3a37f1);logger[_0x3337('0x14')]('UpdateSmsInteraction',_0x3a37f1,JSON[_0x3337('0x16')](_0x2958a2));_0x61a039(_0x2958a2);})[_0x3337('0x1b')](function(_0x4c2f15){logger[_0x3337('0x17')](_0x3337('0x1c'),_0x4c2f15['message'],_0x3a37f1);_0x31bc9b(_0x42c927['error'](0x1f4,_0x4c2f15['message']));});});};exports[_0x3337('0x23')]=function(_0x178210){return new Promise(function(_0x343f8e,_0x1f4b6c){return db[_0x3337('0x24')][_0x3337('0x25')]({'where':_0x178210['options']?_0x178210[_0x3337('0x1f')][_0x3337('0x20')]||null:null})['then'](function(_0x453523){if(_0x453523){return _0x453523[_0x3337('0x26')](_0x178210['body']['ids'],_[_0x3337('0x27')](_0x178210[_0x3337('0x28')],[_0x3337('0x29'),'id'])||{});}})[_0x3337('0x2a')](function(_0x5ea24e){logger['info'](_0x3337('0x2b'),_0x178210);logger[_0x3337('0x14')]('AddTags',_0x178210,JSON['stringify'](_0x5ea24e));_0x343f8e(_0x5ea24e);})[_0x3337('0x1b')](function(_0x21bcf9){logger[_0x3337('0x17')]('AddTags',_0x21bcf9[_0x3337('0x19')],_0x178210);_0x1f4b6c(_this[_0x3337('0x17')](0x1f4,_0x21bcf9['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ae0d8b4..ccb01d0 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 _0x7136=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x47ee6e,_0x5c002a){var _0x4ae263=function(_0x278beb){while(--_0x278beb){_0x47ee6e['push'](_0x47ee6e['shift']());}};_0x4ae263(++_0x5c002a);}(_0x7136,0xe8));var _0x6713=function(_0x10a938,_0x17db84){_0x10a938=_0x10a938-0x0;var _0x4643b4=_0x7136[_0x10a938];return _0x4643b4;};'use strict';var SmsInteractionEvents=require(_0x6713('0x0'));var events=[_0x6713('0x1'),_0x6713('0x2'),_0x6713('0x3')];function createListener(_0xc712a7,_0x4fbe60){return function(_0x452a75){_0x4fbe60[_0x6713('0x4')](_0xc712a7,_0x452a75);};}function removeListener(_0x5b04e2,_0x28e5f6){return function(){SmsInteractionEvents[_0x6713('0x5')](_0x5b04e2,_0x28e5f6);};}exports[_0x6713('0x6')]=function(_0x5768bf){for(var _0x4e8ce3=0x0,_0x2913b5=events[_0x6713('0x7')];_0x4e8ce3<_0x2913b5;_0x4e8ce3++){var _0x1fd11d=events[_0x4e8ce3];var _0x522411=createListener('smsInteraction:'+_0x1fd11d,_0x5768bf);SmsInteractionEvents['on'](_0x1fd11d,_0x522411);}}; \ No newline at end of file +var _0x10e9=['save','remove','update','emit','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x10e9,0x177));var _0x910e=function(_0x58b3d5,_0x5584f8){_0x58b3d5=_0x58b3d5-0x0;var _0x2f6de9=_0x10e9[_0x58b3d5];return _0x2f6de9;};'use strict';var SmsInteractionEvents=require(_0x910e('0x0'));var events=[_0x910e('0x1'),_0x910e('0x2'),_0x910e('0x3')];function createListener(_0x10a77f,_0x265b97){return function(_0x55d4f2){_0x265b97[_0x910e('0x4')](_0x10a77f,_0x55d4f2);};}function removeListener(_0x3c2e90,_0x379954){return function(){SmsInteractionEvents[_0x910e('0x5')](_0x3c2e90,_0x379954);};}exports[_0x910e('0x6')]=function(_0x339609){for(var _0x5225a4=0x0,_0x29651a=events['length'];_0x5225a4<_0x29651a;_0x5225a4++){var _0x37f6a2=events[_0x5225a4];var _0x3e2786=createListener(_0x910e('0x7')+_0x37f6a2,_0x339609);SmsInteractionEvents['on'](_0x37f6a2,_0x3e2786);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9cf6dda..40a3a04 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 _0xc7ec=['util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id/accept','accept','destroy','multer'];(function(_0x536128,_0x205e2b){var _0x19eb75=function(_0x5d5aa0){while(--_0x5d5aa0){_0x536128['push'](_0x536128['shift']());}};_0x19eb75(++_0x205e2b);}(_0xc7ec,0xae));var _0xcc7e=function(_0x286354,_0x128be5){_0x286354=_0x286354-0x0;var _0x30fe4d=_0xc7ec[_0x286354];return _0x30fe4d;};'use strict';var multer=require(_0xcc7e('0x0'));var util=require(_0xcc7e('0x1'));var path=require('path');var timeout=require(_0xcc7e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcc7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcc7e('0x4'));var config=require(_0xcc7e('0x5'));var controller=require(_0xcc7e('0x6'));router[_0xcc7e('0x7')]('/',auth['isAuthenticated'](),controller[_0xcc7e('0x8')]);router[_0xcc7e('0x7')](_0xcc7e('0x9'),auth[_0xcc7e('0xa')](),controller[_0xcc7e('0xb')]);router[_0xcc7e('0x7')](_0xcc7e('0xc'),auth[_0xcc7e('0xa')](),controller[_0xcc7e('0xd')]);router['post']('/',auth[_0xcc7e('0xa')](),interaction[_0xcc7e('0xe')](_0xcc7e('0xf'),_0xcc7e('0x10')),controller[_0xcc7e('0x11')]);router[_0xcc7e('0x12')](_0xcc7e('0x13'),controller[_0xcc7e('0x14')]);router[_0xcc7e('0x15')](_0xcc7e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xcc7e('0x15')](_0xcc7e('0x16'),auth[_0xcc7e('0xa')](),controller[_0xcc7e('0x17')]);router[_0xcc7e('0x15')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0xcc7e('0xc'),auth[_0xcc7e('0xa')](),controller[_0xcc7e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2136=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','reject','delete','destroy','multer','util'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x2136,0x1eb));var _0x6213=function(_0x17ec16,_0x2436e3){_0x17ec16=_0x17ec16-0x0;var _0x1f59f5=_0x2136[_0x17ec16];return _0x1f59f5;};'use strict';var multer=require(_0x6213('0x0'));var util=require(_0x6213('0x1'));var path=require(_0x6213('0x2'));var timeout=require(_0x6213('0x3'));var express=require(_0x6213('0x4'));var router=express[_0x6213('0x5')]();var fs_extra=require(_0x6213('0x6'));var auth=require(_0x6213('0x7'));var interaction=require(_0x6213('0x8'));var config=require(_0x6213('0x9'));var controller=require('./smsMessage.controller');router[_0x6213('0xa')]('/',auth[_0x6213('0xb')](),controller[_0x6213('0xc')]);router['get'](_0x6213('0xd'),auth['isAuthenticated'](),controller[_0x6213('0xe')]);router[_0x6213('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6213('0xf')]);router[_0x6213('0x10')]('/',auth[_0x6213('0xb')](),interaction[_0x6213('0x11')](_0x6213('0x12'),_0x6213('0x13')),controller[_0x6213('0x14')]);router['post'](_0x6213('0x15'),controller[_0x6213('0x16')]);router[_0x6213('0x17')]('/:id',auth[_0x6213('0xb')](),controller[_0x6213('0x18')]);router[_0x6213('0x17')](_0x6213('0x19'),auth[_0x6213('0xb')](),controller['accept']);router[_0x6213('0x17')]('/:id/reject',auth[_0x6213('0xb')](),controller[_0x6213('0x1a')]);router[_0x6213('0x1b')]('/:id',auth[_0x6213('0xb')](),controller[_0x6213('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index bebe326..1fb8127 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 _0x88d5=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0x50dd71,_0x48d6f5){var _0x35e802=function(_0x2270d4){while(--_0x2270d4){_0x50dd71['push'](_0x50dd71['shift']());}};_0x35e802(++_0x48d6f5);}(_0x88d5,0x76));var _0x588d=function(_0x30417e,_0x33b3a1){_0x30417e=_0x30417e-0x0;var _0x549274=_0x88d5[_0x30417e];return _0x549274;};'use strict';var Sequelize=require(_0x588d('0x0'));module[_0x588d('0x1')]={'body':{'type':Sequelize[_0x588d('0x2')](_0x588d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x588d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x588d('0x5')),'defaultValue':_0x588d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x588d('0x6')]},'readAt':{'type':Sequelize[_0x588d('0x7')]},'secret':{'type':Sequelize[_0x588d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x588d('0x6')]},'providerResponse':{'type':Sequelize[_0x588d('0x2')]}}; \ No newline at end of file +var _0xbeb0=['DATE','BOOLEAN','TEXT','sequelize','exports','ENUM','out','STRING'];(function(_0x279d70,_0x2dfb96){var _0x457e54=function(_0x321de2){while(--_0x321de2){_0x279d70['push'](_0x279d70['shift']());}};_0x457e54(++_0x2dfb96);}(_0xbeb0,0x15b));var _0x0beb=function(_0x4c5bf2,_0x2fd36f){_0x4c5bf2=_0x4c5bf2-0x0;var _0xd74663=_0xbeb0[_0x4c5bf2];return _0xd74663;};'use strict';var Sequelize=require(_0x0beb('0x0'));module[_0x0beb('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0beb('0x2')]('in',_0x0beb('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0beb('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0beb('0x5')]},'secret':{'type':Sequelize[_0x0beb('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0beb('0x4')]},'providerResponse':{'type':Sequelize[_0x0beb('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3fa470f..aea8a37 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 _0x3fce=['bluebird','mustache','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','rejectMessage','User','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3fce,0x121));var _0xe3fc=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x3fce[_0x9cbfe0];return _0x1f1534;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3fc('0x0'));var zipdir=require(_0xe3fc('0x1'));var jsonpatch=require(_0xe3fc('0x2'));var rp=require(_0xe3fc('0x3'));var moment=require(_0xe3fc('0x4'));var BPromise=require(_0xe3fc('0x5'));var Mustache=require(_0xe3fc('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe3fc('0x7'));var fs=require('fs');var fs_extra=require(_0xe3fc('0x8'));var _=require('lodash');var squel=require(_0xe3fc('0x9'));var crypto=require('crypto');var jsforce=require(_0xe3fc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe3fc('0xb'));var querystring=require(_0xe3fc('0xc'));var Papa=require(_0xe3fc('0xd'));var Redis=require(_0xe3fc('0xe'));var authService=require(_0xe3fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3fc('0x10'));var logger=require(_0xe3fc('0x11'))(_0xe3fc('0x12'));var utils=require('../../config/utils');var config=require(_0xe3fc('0x13'));var licenseUtil=require(_0xe3fc('0x14'));var db=require(_0xe3fc('0x15'))['db'];config[_0xe3fc('0x16')]=_[_0xe3fc('0x17')](config[_0xe3fc('0x16')],{'host':_0xe3fc('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3fc('0x16')]));require(_0xe3fc('0x19'))['register'](socket);var jayson=require(_0xe3fc('0x1a'));var client=jayson[_0xe3fc('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe3fc('0x1b')][_0xe3fc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b6256,_0x4fa4d4,_0x5953ac,_0x27b618){return new BPromise(function(_0x4283be,_0x2f8cc9){var _0x59a6db=_0x27b618||client;return _0x59a6db['request'](_0x4b6256,_0x5953ac)[_0xe3fc('0x1d')](function(_0x5a4d98){logger[_0xe3fc('0x1e')](_0xe3fc('0x1f'),_0x4fa4d4,_0xe3fc('0x20'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fa4d4,_0xe3fc('0x20'),JSON[_0xe3fc('0x21')](_0x5a4d98));if(_0x5a4d98[_0xe3fc('0x22')]){if(_0x5a4d98['error'][_0xe3fc('0x23')]===0x1f4){logger[_0xe3fc('0x22')]('SmsMessage,\x20%s,\x20%s',_0x4fa4d4,_0x5a4d98[_0xe3fc('0x22')][_0xe3fc('0x24')]);return _0x2f8cc9(_0x5a4d98['error'][_0xe3fc('0x24')]);}logger[_0xe3fc('0x22')](_0xe3fc('0x1f'),_0x4fa4d4,_0x5a4d98['error']['message']);return _0x4283be(_0x5a4d98[_0xe3fc('0x22')][_0xe3fc('0x24')]);}else{logger['info'](_0xe3fc('0x1f'),_0x4fa4d4,_0xe3fc('0x20'));_0x4283be(_0x5a4d98[_0xe3fc('0x25')][_0xe3fc('0x24')]);}})['catch'](function(_0x24043a){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4fa4d4,_0x24043a);_0x2f8cc9(_0x24043a);});});}function respondWithStatusCode(_0x5abdb3,_0x58adb8){_0x58adb8=_0x58adb8||0xcc;return function(_0x51dc35){if(_0x51dc35){return _0x5abdb3[_0xe3fc('0x26')](_0x58adb8);}return _0x5abdb3[_0xe3fc('0x27')](_0x58adb8)['end']();};}function respondWithResult(_0x60e9b8,_0x188ca2){_0x188ca2=_0x188ca2||0xc8;return function(_0x5be1d6){if(_0x5be1d6){return _0x60e9b8[_0xe3fc('0x27')](_0x188ca2)[_0xe3fc('0x28')](_0x5be1d6);}};}function respondWithFilteredResult(_0x1ecb86,_0x3bc101){return function(_0x3d173e){if(_0x3d173e){var _0x21ccdd=typeof _0x3bc101[_0xe3fc('0x29')]===_0xe3fc('0x2a')&&typeof _0x3bc101[_0xe3fc('0x2b')]===_0xe3fc('0x2a');var _0x30a897=_0x3d173e[_0xe3fc('0x2c')];var _0x25a0af=_0x21ccdd?0x0:_0x3bc101[_0xe3fc('0x29')];var _0x38ab54=_0x21ccdd?_0x3d173e[_0xe3fc('0x2c')]:_0x3bc101['offset']+_0x3bc101[_0xe3fc('0x2b')];var _0x2f910e;if(_0x38ab54>=_0x30a897){_0x38ab54=_0x30a897;_0x2f910e=0xc8;}else{_0x2f910e=0xce;}_0x1ecb86[_0xe3fc('0x27')](_0x2f910e);return _0x1ecb86['set'](_0xe3fc('0x2d'),_0x25a0af+'-'+_0x38ab54+'/'+_0x30a897)[_0xe3fc('0x28')](_0x3d173e);}return null;};}function patchUpdates(_0x3527ac){return function(_0x4a6202){try{jsonpatch[_0xe3fc('0x2e')](_0x4a6202,_0x3527ac,!![]);}catch(_0x30c178){return BPromise[_0xe3fc('0x2f')](_0x30c178);}return _0x4a6202[_0xe3fc('0x30')]();};}function saveUpdates(_0x3ebd5d,_0x161434){return function(_0x56cadd){if(_0x56cadd){return _0x56cadd[_0xe3fc('0x31')](_0x3ebd5d)[_0xe3fc('0x1d')](function(_0x9baaec){return _0x9baaec;});}return null;};}function removeEntity(_0x36701e,_0x1f441d){return function(_0x437e4e){if(_0x437e4e){return _0x437e4e[_0xe3fc('0x32')]()[_0xe3fc('0x1d')](function(){_0x36701e[_0xe3fc('0x27')](0xcc)[_0xe3fc('0x33')]();});}};}function handleEntityNotFound(_0x794f2,_0x25edfd){return function(_0x24dae1){if(!_0x24dae1){_0x794f2['sendStatus'](0x194);}return _0x24dae1;};}function handleError(_0x580cba,_0x4ced3a){_0x4ced3a=_0x4ced3a||0x1f4;return function(_0x2348b3){logger[_0xe3fc('0x22')](_0x2348b3[_0xe3fc('0x34')]);if(_0x2348b3[_0xe3fc('0x35')]){delete _0x2348b3[_0xe3fc('0x35')];}_0x580cba[_0xe3fc('0x27')](_0x4ced3a)[_0xe3fc('0x36')](_0x2348b3);};}exports[_0xe3fc('0x37')]=function(_0x4a5ba9,_0x4b4d2b){var _0x1b0d87={},_0x48a626={},_0x38b7b7={'count':0x0,'rows':[]};var _0x35a970=_[_0xe3fc('0x38')](db[_0xe3fc('0x39')][_0xe3fc('0x3a')],function(_0x5047f1){return{'name':_0x5047f1[_0xe3fc('0x3b')],'type':_0x5047f1['type']['key']};});_0x48a626[_0xe3fc('0x3c')]=_[_0xe3fc('0x38')](_0x35a970,'name');_0x48a626[_0xe3fc('0x3d')]=_[_0xe3fc('0x3e')](_0x4a5ba9[_0xe3fc('0x3d')]);_0x48a626[_0xe3fc('0x3f')]=_[_0xe3fc('0x40')](_0x48a626[_0xe3fc('0x3c')],_0x48a626['query']);_0x1b0d87[_0xe3fc('0x41')]=_[_0xe3fc('0x40')](_0x48a626[_0xe3fc('0x3c')],qs[_0xe3fc('0x42')](_0x4a5ba9[_0xe3fc('0x3d')]['fields']));_0x1b0d87[_0xe3fc('0x41')]=_0x1b0d87[_0xe3fc('0x41')][_0xe3fc('0x43')]?_0x1b0d87['attributes']:_0x48a626[_0xe3fc('0x3c')];if(!_0x4a5ba9['query'][_0xe3fc('0x44')](_0xe3fc('0x45'))){_0x1b0d87[_0xe3fc('0x2b')]=qs[_0xe3fc('0x2b')](_0x4a5ba9[_0xe3fc('0x3d')]['limit']);_0x1b0d87[_0xe3fc('0x29')]=qs[_0xe3fc('0x29')](_0x4a5ba9[_0xe3fc('0x3d')][_0xe3fc('0x29')]);}_0x1b0d87[_0xe3fc('0x46')]=qs['sort'](_0x4a5ba9[_0xe3fc('0x3d')]['sort']);_0x1b0d87['where']=qs['filters'](_[_0xe3fc('0x47')](_0x4a5ba9[_0xe3fc('0x3d')],_0x48a626[_0xe3fc('0x3f')]),_0x35a970);if(_0x4a5ba9[_0xe3fc('0x3d')][_0xe3fc('0x48')]){_0x1b0d87[_0xe3fc('0x49')]=_['merge'](_0x1b0d87[_0xe3fc('0x49')],{'$or':_['map'](_0x35a970,function(_0x352efb){if(_0x352efb[_0xe3fc('0x4a')]!==_0xe3fc('0x4b')){var _0x2c1350={};_0x2c1350[_0x352efb['name']]={'$like':'%'+_0x4a5ba9[_0xe3fc('0x3d')][_0xe3fc('0x48')]+'%'};return _0x2c1350;}})});}_0x1b0d87=_[_0xe3fc('0x4c')]({},_0x1b0d87,_0x4a5ba9[_0xe3fc('0x4d')]);var _0xde6752={'where':_0x1b0d87[_0xe3fc('0x49')]};return db['SmsMessage']['count'](_0xde6752)[_0xe3fc('0x1d')](function(_0x43bf0c){_0x38b7b7[_0xe3fc('0x2c')]=_0x43bf0c;if(_0x4a5ba9[_0xe3fc('0x3d')][_0xe3fc('0x4e')]){_0x1b0d87[_0xe3fc('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xe3fc('0x50')](_0x1b0d87);})['then'](function(_0x1a17e2){_0x38b7b7['rows']=_0x1a17e2;return _0x38b7b7;})['then'](respondWithFilteredResult(_0x4b4d2b,_0x1b0d87))['catch'](handleError(_0x4b4d2b,null));};exports[_0xe3fc('0x51')]=function(_0x33a62b,_0x577b14){var _0x2100f6={'raw':!![],'where':{'id':_0x33a62b[_0xe3fc('0x52')]['id']}},_0x5338c4={};_0x5338c4[_0xe3fc('0x3c')]=_[_0xe3fc('0x3e')](db[_0xe3fc('0x39')][_0xe3fc('0x3a')]);_0x5338c4[_0xe3fc('0x3d')]=_['keys'](_0x33a62b['query']);_0x5338c4[_0xe3fc('0x3f')]=_[_0xe3fc('0x40')](_0x5338c4[_0xe3fc('0x3c')],_0x5338c4[_0xe3fc('0x3d')]);_0x2100f6[_0xe3fc('0x41')]=_[_0xe3fc('0x40')](_0x5338c4[_0xe3fc('0x3c')],qs['fields'](_0x33a62b[_0xe3fc('0x3d')][_0xe3fc('0x42')]));_0x2100f6[_0xe3fc('0x41')]=_0x2100f6[_0xe3fc('0x41')]['length']?_0x2100f6['attributes']:_0x5338c4['model'];if(_0x33a62b[_0xe3fc('0x3d')][_0xe3fc('0x4e')]){_0x2100f6[_0xe3fc('0x4f')]=[{'all':!![]}];}_0x2100f6=_[_0xe3fc('0x4c')]({},_0x2100f6,_0x33a62b[_0xe3fc('0x4d')]);return db[_0xe3fc('0x39')][_0xe3fc('0x53')](_0x2100f6)[_0xe3fc('0x1d')](handleEntityNotFound(_0x577b14,null))[_0xe3fc('0x1d')](respondWithResult(_0x577b14,null))[_0xe3fc('0x54')](handleError(_0x577b14,null));};exports[_0xe3fc('0x55')]=function(_0x3a9d46,_0x2a95a5){return db['SmsMessage']['create'](_0x3a9d46['body'],{})[_0xe3fc('0x1d')](respondWithResult(_0x2a95a5,0xc9))[_0xe3fc('0x54')](handleError(_0x2a95a5,null));};exports[_0xe3fc('0x31')]=function(_0x4e5eb8,_0x4b06cf){if(_0x4e5eb8[_0xe3fc('0x56')]['id']){delete _0x4e5eb8[_0xe3fc('0x56')]['id'];}return db[_0xe3fc('0x39')]['find']({'where':{'id':_0x4e5eb8['params']['id']}})['then'](handleEntityNotFound(_0x4b06cf,null))[_0xe3fc('0x1d')](saveUpdates(_0x4e5eb8['body'],null))['then'](respondWithResult(_0x4b06cf,null))[_0xe3fc('0x54')](handleError(_0x4b06cf,null));};exports['destroy']=function(_0x4b5e5d,_0x5ed9be){return db[_0xe3fc('0x39')][_0xe3fc('0x53')]({'where':{'id':_0x4b5e5d[_0xe3fc('0x52')]['id']}})[_0xe3fc('0x1d')](handleEntityNotFound(_0x5ed9be,null))[_0xe3fc('0x1d')](removeEntity(_0x5ed9be,null))['catch'](handleError(_0x5ed9be,null));};exports[_0xe3fc('0x57')]=function(_0x34585a,_0x5bd77d){return db[_0xe3fc('0x39')][_0xe3fc('0x57')]()[_0xe3fc('0x1d')](respondWithResult(_0x5bd77d,null))[_0xe3fc('0x54')](handleError(_0x5bd77d,null));};var interaction_log=require(_0xe3fc('0x11'))(_0xe3fc('0x58'));exports[_0xe3fc('0x59')]=function(_0x4dd1ea,_0x3dbf21,_0x1dbffe){var _0x8d1312={'agent':{},'channel':_0xe3fc('0x5a')};if(_0x4dd1ea[_0xe3fc('0x56')]['id']){delete _0x4dd1ea[_0xe3fc('0x56')]['id'];}_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x5b')]=!![];_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x5c')]=moment()[_0xe3fc('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x5e')]=_0x4dd1ea[_0xe3fc('0x56')]['UserId']||_0x4dd1ea[_0xe3fc('0x5f')]['id'];_0x8d1312['agent']['id']=_0x4dd1ea[_0xe3fc('0x56')]['UserId'];return db['SmsMessage'][_0xe3fc('0x53')]({'where':{'id':_0x4dd1ea[_0xe3fc('0x52')]['id'],'UserId':null}})[_0xe3fc('0x1d')](handleEntityNotFound(_0x3dbf21,null))[_0xe3fc('0x1d')](saveUpdates(_0x4dd1ea['body'],null))[_0xe3fc('0x1d')](function(_0x348e0c){if(_0x348e0c){_0x8d1312[_0xe3fc('0x24')]=_0x348e0c[_0xe3fc('0x60')]({'plain':!![]});return db[_0xe3fc('0x61')][_0xe3fc('0x53')]({'where':{'id':_0x348e0c[_0xe3fc('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3dbf21,null))[_0xe3fc('0x1d')](function(_0x4f8ab3){if(_0x4f8ab3){return _0x4f8ab3[_0xe3fc('0x31')]({'UserId':_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x5e')],'read1stAt':_[_0xe3fc('0x63')](_0x4f8ab3[_0xe3fc('0x64')])?moment()['format'](_0xe3fc('0x65')):undefined});}return null;})[_0xe3fc('0x1d')](function(_0x1ea8b5){if(_0x1ea8b5){_0x8d1312[_0xe3fc('0x66')]=_0x1ea8b5[_0xe3fc('0x60')]({'plain':!![]});interaction_log[_0xe3fc('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4dd1ea[_0xe3fc('0x5f')]['id'],_0x4dd1ea[_0xe3fc('0x5f')][_0xe3fc('0x35')],_0x4dd1ea[_0xe3fc('0x5f')][_0xe3fc('0x67')],_0x8d1312['interaction']['id'],_0x4dd1ea[_0xe3fc('0x56')]?JSON[_0xe3fc('0x21')](_0x4dd1ea[_0xe3fc('0x56')]):'null');return respondWithRpcPromise(_0xe3fc('0x68'),_0xe3fc('0x69'),_0x8d1312);}return null;})['then'](function(_0x44529b){var _0x3b5a52=_0xe3fc('0x6a')+_0x44529b['message'][_0xe3fc('0x6b')];return db[_0xe3fc('0x6c')]['query'](_0x3b5a52,{'type':db[_0xe3fc('0x6d')][_0xe3fc('0x6e')][_0xe3fc('0x6f')],'raw':!![]})[_0xe3fc('0x1d')](function(_0x11e0d2){return _0x11e0d2;});})['then'](function(_0x579391){if(_0x579391){_0x8d1312[_0xe3fc('0x24')][_0xe3fc('0x70')]=_0x579391[0x0];if(!_0x4dd1ea[_0xe3fc('0x56')]['UserId'])return;return db['User'][_0xe3fc('0x53')]({'where':{'id':_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x5e')],'role':_0xe3fc('0x71')},'attributes':['id',_0xe3fc('0x35'),_0xe3fc('0x72'),_0xe3fc('0x73'),_0xe3fc('0x74')],'raw':!![]});}return null;})[_0xe3fc('0x1d')](function(_0x44ee45){if(!_0x44ee45)return null;_0x8d1312[_0xe3fc('0x24')]['agent']=_0x44ee45;return _0x8d1312;})[_0xe3fc('0x1d')](function(_0x376bd2){if(_0x376bd2){if(_0x4dd1ea[_0xe3fc('0x56')][_0xe3fc('0x75')]){_0x8d1312[_0xe3fc('0x24')][_0xe3fc('0x76')]=util[_0xe3fc('0x5d')]('SIP/%s',_0x4dd1ea['user'][_0xe3fc('0x35')]);_0x8d1312[_0xe3fc('0x24')][_0xe3fc('0x77')]=_0x8d1312['channel'];_0x8d1312[_0xe3fc('0x24')][_0xe3fc('0x78')]=_0x8d1312[_0xe3fc('0x77')];_0x8d1312[_0xe3fc('0x24')]['event']='accept';return respondWithRpcPromise(_0xe3fc('0x79'),_0xe3fc('0x79'),{'event':_0xe3fc('0x7a'),'message':_0x8d1312[_0xe3fc('0x24')]},client9002)[_0xe3fc('0x1d')](function(){return _0x8d1312;});}return _0x8d1312;}return null;})['then'](respondWithResult(_0x3dbf21,null))[_0xe3fc('0x54')](handleError(_0x3dbf21,null));};var interaction_log=require(_0xe3fc('0x11'))('sms-interactions');exports[_0xe3fc('0x2f')]=function(_0x130f78,_0x3b0b0f,_0x1c3c7c){var _0x2d8ff5={'agent':{},'channel':_0xe3fc('0x5a')};if(_0x130f78[_0xe3fc('0x56')]['id']){delete _0x130f78[_0xe3fc('0x56')]['id'];}_0x130f78['body'][_0xe3fc('0x5e')]=_0x130f78[_0xe3fc('0x56')][_0xe3fc('0x5e')]||_0x130f78[_0xe3fc('0x5f')]['id'];_0x2d8ff5[_0xe3fc('0x71')]['id']=_0x130f78[_0xe3fc('0x56')][_0xe3fc('0x5e')];return db['SmsMessage'][_0xe3fc('0x53')]({'where':{'id':_0x130f78['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b0b0f,null))[_0xe3fc('0x1d')](function(_0xc67375){if(_0xc67375){_0x2d8ff5['message']=_0xc67375[_0xe3fc('0x60')]({'plain':!![]});return db['SmsInteraction'][_0xe3fc('0x53')]({'where':{'id':_0xc67375[_0xe3fc('0x62')]}});}return null;})[_0xe3fc('0x1d')](handleEntityNotFound(_0x3b0b0f,null))[_0xe3fc('0x1d')](function(_0x749800){if(_0x749800){_0x2d8ff5[_0xe3fc('0x66')]=_0x749800['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x130f78[_0xe3fc('0x5f')]['id'],_0x130f78['user'][_0xe3fc('0x35')],_0x130f78['user'][_0xe3fc('0x67')],_0x2d8ff5[_0xe3fc('0x66')]['id'],_0x130f78[_0xe3fc('0x56')]?JSON[_0xe3fc('0x21')](_0x130f78['body']):'null');return respondWithRpcPromise('RejectMessage',_0xe3fc('0x7b'),_0x2d8ff5);}return null;})[_0xe3fc('0x1d')](function(_0x30f8e0){var _0x26b853=_0xe3fc('0x6a')+_0x30f8e0[_0xe3fc('0x24')][_0xe3fc('0x6b')];return db['sequelize'][_0xe3fc('0x3d')](_0x26b853,{'type':db[_0xe3fc('0x6d')][_0xe3fc('0x6e')][_0xe3fc('0x6f')],'raw':!![]})[_0xe3fc('0x1d')](function(_0x114185){return _0x114185;});})['then'](function(_0xdc176d){if(_0xdc176d){_0x2d8ff5['message']['contact']=_0xdc176d[0x0];if(!_0x130f78[_0xe3fc('0x56')][_0xe3fc('0x5e')])return;return db[_0xe3fc('0x7c')][_0xe3fc('0x53')]({'where':{'id':_0x130f78[_0xe3fc('0x56')][_0xe3fc('0x5e')],'role':'agent'},'attributes':['id',_0xe3fc('0x35'),_0xe3fc('0x72'),_0xe3fc('0x73'),_0xe3fc('0x74')],'raw':!![]});}return null;})[_0xe3fc('0x1d')](function(_0x173841){if(!_0x173841)return null;_0x2d8ff5[_0xe3fc('0x24')][_0xe3fc('0x71')]=_0x173841;return _0x2d8ff5;})[_0xe3fc('0x1d')](function(_0x70aede){if(_0x70aede){_0x70aede[_0xe3fc('0x24')][_0xe3fc('0x76')]=util[_0xe3fc('0x5d')](_0xe3fc('0x7d'),_0x130f78[_0xe3fc('0x5f')][_0xe3fc('0x35')]);_0x70aede['message'][_0xe3fc('0x77')]=_0x2d8ff5[_0xe3fc('0x77')];_0x70aede['message'][_0xe3fc('0x78')]=_0x2d8ff5[_0xe3fc('0x77')];_0x70aede['message'][_0xe3fc('0x7e')]=_0xe3fc('0x2f');respondWithRpcPromise(_0xe3fc('0x79'),_0xe3fc('0x79'),{'event':_0xe3fc('0x7f'),'message':_0x70aede[_0xe3fc('0x24')]},client9002);return _0x2d8ff5;}return null;})[_0xe3fc('0x1d')](respondWithResult(_0x3b0b0f,null))[_0xe3fc('0x54')](handleError(_0x3b0b0f,null));};exports[_0xe3fc('0x27')]=function(_0xff3647,_0x5387c6,_0x1f252b){if(_0xff3647[_0xe3fc('0x56')]['id']){delete _0xff3647['body']['id'];}var _0x1a4551;return db[_0xe3fc('0x39')][_0xe3fc('0x53')]({'where':{'id':_0xff3647['params']['id']}})[_0xe3fc('0x1d')](handleEntityNotFound(_0x5387c6,null))[_0xe3fc('0x1d')](function(_0x315bce){if(_0x315bce){_0x1a4551=_0x315bce;return db[_0xe3fc('0x80')][_0xe3fc('0x53')]({'where':{'id':_0x315bce[_0xe3fc('0x81')]}});}})[_0xe3fc('0x1d')](handleEntityNotFound(_0x5387c6,null))[_0xe3fc('0x1d')](function(_0x52c222){if(_0x52c222){logger[_0xe3fc('0x82')](_0xe3fc('0x83'),_0xe3fc('0x27'),_0xe3fc('0x84'),_0x52c222[_0xe3fc('0x4a')],util[_0xe3fc('0x85')](_0xff3647[_0xe3fc('0x56')],{'showHidden':![],'depth':null}));switch(_0x52c222['type']){case'twilio':if(_0xff3647[_0xe3fc('0x56')][_0xe3fc('0x86')]&&_0xff3647[_0xe3fc('0x56')]['MessageSid']===_0x1a4551['messageId']){return _0x1a4551[_0xe3fc('0x31')]({'read':!![]});}else{logger[_0xe3fc('0x22')](_0xe3fc('0x87'),_0xe3fc('0x27'),_0xe3fc('0x88'),util['inspect'](_0xff3647[_0xe3fc('0x56')],{'showHidden':![],'depth':null}));}break;case _0xe3fc('0x89'):if(_0xff3647[_0xe3fc('0x56')][_0xe3fc('0x8a')]&&_0xff3647[_0xe3fc('0x56')][_0xe3fc('0x8a')]===_0x1a4551[_0xe3fc('0x8b')]&&_[_0xe3fc('0x8c')](['sent','delivered'],_0xff3647[_0xe3fc('0x56')][_0xe3fc('0x8d')])>=0x0){return _0x1a4551[_0xe3fc('0x31')]({'read':!![]});}else{logger[_0xe3fc('0x22')](_0xe3fc('0x87'),'status',_0xe3fc('0x8e'),util[_0xe3fc('0x85')](_0xff3647[_0xe3fc('0x56')],{'showHidden':![],'depth':null}));}break;case _0xe3fc('0x8f'):var _0x28d479=_0xff3647[_0xe3fc('0x56')][_0xe3fc('0x90')][0x0];if(_0x28d479[_0xe3fc('0x27')][_0xe3fc('0x91')]===_0xe3fc('0x92')){return _0x1a4551[_0xe3fc('0x31')]({'read':!![]});}else{logger['error'](_0xe3fc('0x87'),_0xe3fc('0x27'),_0xe3fc('0x8f'),util[_0xe3fc('0x85')](_0xff3647[_0xe3fc('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x1a4551;}})['then'](respondWithResult(_0x5387c6,null))[_0xe3fc('0x54')](handleError(_0x5387c6,null));}; \ No newline at end of file +var _0x199d=['channel','motionChannel','EventManager','acceptmessage','../../config/logger','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','User','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','Status','plivio','infobip','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x199d,0x13d));var _0xd199=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x199d[_0x1e172a];return _0x96338b;};'use strict';var emlformat=require(_0xd199('0x0'));var rimraf=require(_0xd199('0x1'));var zipdir=require(_0xd199('0x2'));var jsonpatch=require(_0xd199('0x3'));var rp=require(_0xd199('0x4'));var moment=require('moment');var BPromise=require(_0xd199('0x5'));var Mustache=require('mustache');var util=require(_0xd199('0x6'));var path=require(_0xd199('0x7'));var sox=require(_0xd199('0x8'));var csv=require('to-csv');var ejs=require(_0xd199('0x9'));var fs=require('fs');var fs_extra=require(_0xd199('0xa'));var _=require('lodash');var squel=require(_0xd199('0xb'));var crypto=require(_0xd199('0xc'));var jsforce=require(_0xd199('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd199('0xe'));var querystring=require(_0xd199('0xf'));var Papa=require(_0xd199('0x10'));var Redis=require('ioredis');var authService=require(_0xd199('0x11'));var qs=require(_0xd199('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd199('0x13'));var logger=require('../../config/logger')(_0xd199('0x14'));var utils=require(_0xd199('0x15'));var config=require(_0xd199('0x16'));var licenseUtil=require(_0xd199('0x17'));var db=require(_0xd199('0x18'))['db'];config[_0xd199('0x19')]=_[_0xd199('0x1a')](config[_0xd199('0x19')],{'host':_0xd199('0x1b'),'port':0x18eb});var socket=require(_0xd199('0x1c'))(new Redis(config[_0xd199('0x19')]));require('./smsMessage.socket')[_0xd199('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd199('0x1e')][_0xd199('0x1f')]({'port':0x232c});var client9002=jayson[_0xd199('0x1e')][_0xd199('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5ee42f,_0x1e8132,_0xe48c1b,_0x1251a6){return new BPromise(function(_0x16a7c5,_0x4354d1){var _0x51379e=_0x1251a6||client;return _0x51379e[_0xd199('0x20')](_0x5ee42f,_0xe48c1b)['then'](function(_0xf97c6e){logger[_0xd199('0x21')](_0xd199('0x22'),_0x1e8132,_0xd199('0x23'));logger[_0xd199('0x24')](_0xd199('0x25'),_0x1e8132,_0xd199('0x23'),JSON['stringify'](_0xf97c6e));if(_0xf97c6e[_0xd199('0x26')]){if(_0xf97c6e[_0xd199('0x26')][_0xd199('0x27')]===0x1f4){logger[_0xd199('0x26')]('SmsMessage,\x20%s,\x20%s',_0x1e8132,_0xf97c6e[_0xd199('0x26')]['message']);return _0x4354d1(_0xf97c6e['error'][_0xd199('0x28')]);}logger[_0xd199('0x26')](_0xd199('0x22'),_0x1e8132,_0xf97c6e['error']['message']);return _0x16a7c5(_0xf97c6e[_0xd199('0x26')][_0xd199('0x28')]);}else{logger['info'](_0xd199('0x22'),_0x1e8132,_0xd199('0x23'));_0x16a7c5(_0xf97c6e[_0xd199('0x29')][_0xd199('0x28')]);}})[_0xd199('0x2a')](function(_0x3aa616){logger[_0xd199('0x26')](_0xd199('0x22'),_0x1e8132,_0x3aa616);_0x4354d1(_0x3aa616);});});}function respondWithStatusCode(_0x59408c,_0x5b50b2){_0x5b50b2=_0x5b50b2||0xcc;return function(_0x5a29cd){if(_0x5a29cd){return _0x59408c[_0xd199('0x2b')](_0x5b50b2);}return _0x59408c[_0xd199('0x2c')](_0x5b50b2)[_0xd199('0x2d')]();};}function respondWithResult(_0x57d6ff,_0x49bd83){_0x49bd83=_0x49bd83||0xc8;return function(_0x44c073){if(_0x44c073){return _0x57d6ff[_0xd199('0x2c')](_0x49bd83)[_0xd199('0x2e')](_0x44c073);}};}function respondWithFilteredResult(_0x263390,_0x232b5d){return function(_0x18f61d){if(_0x18f61d){var _0x3c1269=typeof _0x232b5d[_0xd199('0x2f')]===_0xd199('0x30')&&typeof _0x232b5d[_0xd199('0x31')]==='undefined';var _0x1caa61=_0x18f61d['count'];var _0x5220a3=_0x3c1269?0x0:_0x232b5d[_0xd199('0x2f')];var _0x444380=_0x3c1269?_0x18f61d[_0xd199('0x32')]:_0x232b5d[_0xd199('0x2f')]+_0x232b5d[_0xd199('0x31')];var _0x364343;if(_0x444380>=_0x1caa61){_0x444380=_0x1caa61;_0x364343=0xc8;}else{_0x364343=0xce;}_0x263390['status'](_0x364343);return _0x263390[_0xd199('0x33')](_0xd199('0x34'),_0x5220a3+'-'+_0x444380+'/'+_0x1caa61)[_0xd199('0x2e')](_0x18f61d);}return null;};}function patchUpdates(_0x21aaf3){return function(_0x50ab5b){try{jsonpatch[_0xd199('0x35')](_0x50ab5b,_0x21aaf3,!![]);}catch(_0x13aabd){return BPromise['reject'](_0x13aabd);}return _0x50ab5b['save']();};}function saveUpdates(_0x584af8,_0x38da97){return function(_0x3e8a6f){if(_0x3e8a6f){return _0x3e8a6f[_0xd199('0x36')](_0x584af8)['then'](function(_0x5db55c){return _0x5db55c;});}return null;};}function removeEntity(_0x426cb5,_0x5c9cef){return function(_0x28e3b7){if(_0x28e3b7){return _0x28e3b7[_0xd199('0x37')]()[_0xd199('0x38')](function(){_0x426cb5[_0xd199('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea308,_0x38a98a){return function(_0x17c945){if(!_0x17c945){_0x2ea308[_0xd199('0x2b')](0x194);}return _0x17c945;};}function handleError(_0x20892f,_0x2de443){_0x2de443=_0x2de443||0x1f4;return function(_0x1662c5){logger[_0xd199('0x26')](_0x1662c5['stack']);if(_0x1662c5['name']){delete _0x1662c5[_0xd199('0x39')];}_0x20892f['status'](_0x2de443)[_0xd199('0x3a')](_0x1662c5);};}exports[_0xd199('0x3b')]=function(_0x103ddd,_0xa59d29){var _0x481b02={},_0x5a8ac3={},_0xff388c={'count':0x0,'rows':[]};var _0x19626d=_[_0xd199('0x3c')](db[_0xd199('0x3d')]['rawAttributes'],function(_0x391b69){return{'name':_0x391b69[_0xd199('0x3e')],'type':_0x391b69[_0xd199('0x3f')][_0xd199('0x40')]};});_0x5a8ac3[_0xd199('0x41')]=_[_0xd199('0x3c')](_0x19626d,_0xd199('0x39'));_0x5a8ac3[_0xd199('0x42')]=_[_0xd199('0x43')](_0x103ddd['query']);_0x5a8ac3['filters']=_[_0xd199('0x44')](_0x5a8ac3[_0xd199('0x41')],_0x5a8ac3[_0xd199('0x42')]);_0x481b02[_0xd199('0x45')]=_[_0xd199('0x44')](_0x5a8ac3[_0xd199('0x41')],qs[_0xd199('0x46')](_0x103ddd[_0xd199('0x42')][_0xd199('0x46')]));_0x481b02[_0xd199('0x45')]=_0x481b02[_0xd199('0x45')][_0xd199('0x47')]?_0x481b02[_0xd199('0x45')]:_0x5a8ac3[_0xd199('0x41')];if(!_0x103ddd[_0xd199('0x42')]['hasOwnProperty'](_0xd199('0x48'))){_0x481b02[_0xd199('0x31')]=qs[_0xd199('0x31')](_0x103ddd[_0xd199('0x42')][_0xd199('0x31')]);_0x481b02[_0xd199('0x2f')]=qs['offset'](_0x103ddd['query'][_0xd199('0x2f')]);}_0x481b02[_0xd199('0x49')]=qs[_0xd199('0x4a')](_0x103ddd[_0xd199('0x42')]['sort']);_0x481b02[_0xd199('0x4b')]=qs[_0xd199('0x4c')](_[_0xd199('0x4d')](_0x103ddd[_0xd199('0x42')],_0x5a8ac3[_0xd199('0x4c')]),_0x19626d);if(_0x103ddd[_0xd199('0x42')][_0xd199('0x4e')]){_0x481b02['where']=_[_0xd199('0x4f')](_0x481b02['where'],{'$or':_['map'](_0x19626d,function(_0x2d4747){if(_0x2d4747[_0xd199('0x3f')]!==_0xd199('0x50')){var _0x2f6c04={};_0x2f6c04[_0x2d4747[_0xd199('0x39')]]={'$like':'%'+_0x103ddd['query'][_0xd199('0x4e')]+'%'};return _0x2f6c04;}})});}_0x481b02=_[_0xd199('0x4f')]({},_0x481b02,_0x103ddd['options']);var _0x406b67={'where':_0x481b02[_0xd199('0x4b')]};return db['SmsMessage'][_0xd199('0x32')](_0x406b67)[_0xd199('0x38')](function(_0x2822cb){_0xff388c[_0xd199('0x32')]=_0x2822cb;if(_0x103ddd[_0xd199('0x42')][_0xd199('0x51')]){_0x481b02[_0xd199('0x52')]=[{'all':!![]}];}return db[_0xd199('0x3d')][_0xd199('0x53')](_0x481b02);})[_0xd199('0x38')](function(_0x510583){_0xff388c[_0xd199('0x54')]=_0x510583;return _0xff388c;})[_0xd199('0x38')](respondWithFilteredResult(_0xa59d29,_0x481b02))[_0xd199('0x2a')](handleError(_0xa59d29,null));};exports['show']=function(_0x458abf,_0x5f2b6d){var _0x342134={'raw':!![],'where':{'id':_0x458abf['params']['id']}},_0x1585aa={};_0x1585aa[_0xd199('0x41')]=_[_0xd199('0x43')](db[_0xd199('0x3d')]['rawAttributes']);_0x1585aa[_0xd199('0x42')]=_[_0xd199('0x43')](_0x458abf[_0xd199('0x42')]);_0x1585aa[_0xd199('0x4c')]=_[_0xd199('0x44')](_0x1585aa[_0xd199('0x41')],_0x1585aa[_0xd199('0x42')]);_0x342134[_0xd199('0x45')]=_[_0xd199('0x44')](_0x1585aa[_0xd199('0x41')],qs[_0xd199('0x46')](_0x458abf[_0xd199('0x42')][_0xd199('0x46')]));_0x342134[_0xd199('0x45')]=_0x342134[_0xd199('0x45')][_0xd199('0x47')]?_0x342134[_0xd199('0x45')]:_0x1585aa[_0xd199('0x41')];if(_0x458abf[_0xd199('0x42')][_0xd199('0x51')]){_0x342134[_0xd199('0x52')]=[{'all':!![]}];}_0x342134=_['merge']({},_0x342134,_0x458abf[_0xd199('0x55')]);return db[_0xd199('0x3d')][_0xd199('0x56')](_0x342134)['then'](handleEntityNotFound(_0x5f2b6d,null))[_0xd199('0x38')](respondWithResult(_0x5f2b6d,null))['catch'](handleError(_0x5f2b6d,null));};exports['create']=function(_0x3a86e5,_0x46fd3c){return db[_0xd199('0x3d')][_0xd199('0x57')](_0x3a86e5[_0xd199('0x58')],{})[_0xd199('0x38')](respondWithResult(_0x46fd3c,0xc9))[_0xd199('0x2a')](handleError(_0x46fd3c,null));};exports['update']=function(_0x3bf23a,_0xe8cb26){if(_0x3bf23a[_0xd199('0x58')]['id']){delete _0x3bf23a[_0xd199('0x58')]['id'];}return db[_0xd199('0x3d')][_0xd199('0x56')]({'where':{'id':_0x3bf23a['params']['id']}})[_0xd199('0x38')](handleEntityNotFound(_0xe8cb26,null))[_0xd199('0x38')](saveUpdates(_0x3bf23a[_0xd199('0x58')],null))[_0xd199('0x38')](respondWithResult(_0xe8cb26,null))['catch'](handleError(_0xe8cb26,null));};exports[_0xd199('0x37')]=function(_0x27cff7,_0xa0d838){return db[_0xd199('0x3d')][_0xd199('0x56')]({'where':{'id':_0x27cff7[_0xd199('0x59')]['id']}})[_0xd199('0x38')](handleEntityNotFound(_0xa0d838,null))[_0xd199('0x38')](removeEntity(_0xa0d838,null))[_0xd199('0x2a')](handleError(_0xa0d838,null));};exports[_0xd199('0x5a')]=function(_0xc73c7d,_0x368a23){return db[_0xd199('0x3d')][_0xd199('0x5a')]()['then'](respondWithResult(_0x368a23,null))[_0xd199('0x2a')](handleError(_0x368a23,null));};var interaction_log=require('../../config/logger')(_0xd199('0x5b'));exports[_0xd199('0x5c')]=function(_0x3a7905,_0x3e291e,_0x3d99a9){var _0x284396={'agent':{},'channel':_0xd199('0x5d')};if(_0x3a7905['body']['id']){delete _0x3a7905['body']['id'];}_0x3a7905[_0xd199('0x58')][_0xd199('0x5e')]=!![];_0x3a7905['body'][_0xd199('0x5f')]=moment()[_0xd199('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a7905['body'][_0xd199('0x61')]=_0x3a7905['body']['UserId']||_0x3a7905[_0xd199('0x62')]['id'];_0x284396[_0xd199('0x63')]['id']=_0x3a7905[_0xd199('0x58')][_0xd199('0x61')];return db[_0xd199('0x3d')][_0xd199('0x56')]({'where':{'id':_0x3a7905[_0xd199('0x59')]['id'],'UserId':null}})[_0xd199('0x38')](handleEntityNotFound(_0x3e291e,null))['then'](saveUpdates(_0x3a7905['body'],null))[_0xd199('0x38')](function(_0x5ee813){if(_0x5ee813){_0x284396[_0xd199('0x28')]=_0x5ee813[_0xd199('0x64')]({'plain':!![]});return db[_0xd199('0x65')][_0xd199('0x56')]({'where':{'id':_0x5ee813[_0xd199('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3e291e,null))[_0xd199('0x38')](function(_0x10c518){if(_0x10c518){return _0x10c518[_0xd199('0x36')]({'UserId':_0x3a7905['body'][_0xd199('0x61')],'read1stAt':_[_0xd199('0x67')](_0x10c518[_0xd199('0x68')])?moment()[_0xd199('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1e01e2){if(_0x1e01e2){_0x284396[_0xd199('0x69')]=_0x1e01e2[_0xd199('0x64')]({'plain':!![]});interaction_log[_0xd199('0x21')](_0xd199('0x6a'),_0x3a7905[_0xd199('0x62')]['id'],_0x3a7905[_0xd199('0x62')][_0xd199('0x39')],_0x3a7905[_0xd199('0x62')][_0xd199('0x6b')],_0x284396[_0xd199('0x69')]['id'],_0x3a7905[_0xd199('0x58')]?JSON[_0xd199('0x6c')](_0x3a7905[_0xd199('0x58')]):'null');return respondWithRpcPromise(_0xd199('0x6d'),'acceptMessage',_0x284396);}return null;})[_0xd199('0x38')](function(_0x58c09c){var _0x594da2=_0xd199('0x6e')+_0x58c09c['message'][_0xd199('0x6f')];return db['sequelize'][_0xd199('0x42')](_0x594da2,{'type':db[_0xd199('0x70')]['QueryTypes'][_0xd199('0x71')],'raw':!![]})[_0xd199('0x38')](function(_0x2c00d5){return _0x2c00d5;});})[_0xd199('0x38')](function(_0x38412d){if(_0x38412d){_0x284396['message'][_0xd199('0x72')]=_0x38412d[0x0];if(!_0x3a7905['body']['UserId'])return;return db['User'][_0xd199('0x56')]({'where':{'id':_0x3a7905[_0xd199('0x58')][_0xd199('0x61')],'role':'agent'},'attributes':['id','name',_0xd199('0x73'),_0xd199('0x74'),_0xd199('0x75')],'raw':!![]});}return null;})[_0xd199('0x38')](function(_0x46c3ce){if(!_0x46c3ce)return null;_0x284396[_0xd199('0x28')][_0xd199('0x63')]=_0x46c3ce;return _0x284396;})[_0xd199('0x38')](function(_0x1e4a8e){if(_0x1e4a8e){if(_0x3a7905[_0xd199('0x58')][_0xd199('0x76')]){_0x284396[_0xd199('0x28')][_0xd199('0x77')]=util[_0xd199('0x60')](_0xd199('0x78'),_0x3a7905[_0xd199('0x62')][_0xd199('0x39')]);_0x284396['message'][_0xd199('0x79')]=_0x284396[_0xd199('0x79')];_0x284396[_0xd199('0x28')][_0xd199('0x7a')]=_0x284396[_0xd199('0x79')];_0x284396[_0xd199('0x28')]['event']=_0xd199('0x5c');return respondWithRpcPromise(_0xd199('0x7b'),_0xd199('0x7b'),{'event':_0xd199('0x7c'),'message':_0x284396['message']},client9002)[_0xd199('0x38')](function(){return _0x284396;});}return _0x284396;}return null;})[_0xd199('0x38')](respondWithResult(_0x3e291e,null))[_0xd199('0x2a')](handleError(_0x3e291e,null));};var interaction_log=require(_0xd199('0x7d'))('sms-interactions');exports[_0xd199('0x7e')]=function(_0x57eb3b,_0x1214dc,_0x57858f){var _0x328cfb={'agent':{},'channel':_0xd199('0x5d')};if(_0x57eb3b[_0xd199('0x58')]['id']){delete _0x57eb3b['body']['id'];}_0x57eb3b[_0xd199('0x58')][_0xd199('0x61')]=_0x57eb3b[_0xd199('0x58')][_0xd199('0x61')]||_0x57eb3b[_0xd199('0x62')]['id'];_0x328cfb[_0xd199('0x63')]['id']=_0x57eb3b['body'][_0xd199('0x61')];return db[_0xd199('0x3d')][_0xd199('0x56')]({'where':{'id':_0x57eb3b[_0xd199('0x59')]['id'],'UserId':null}})[_0xd199('0x38')](handleEntityNotFound(_0x1214dc,null))[_0xd199('0x38')](function(_0x5f3697){if(_0x5f3697){_0x328cfb['message']=_0x5f3697[_0xd199('0x64')]({'plain':!![]});return db[_0xd199('0x65')][_0xd199('0x56')]({'where':{'id':_0x5f3697['SmsInteractionId']}});}return null;})[_0xd199('0x38')](handleEntityNotFound(_0x1214dc,null))['then'](function(_0x512f00){if(_0x512f00){_0x328cfb[_0xd199('0x69')]=_0x512f00[_0xd199('0x64')]({'plain':!![]});interaction_log[_0xd199('0x21')](_0xd199('0x7f'),_0x57eb3b[_0xd199('0x62')]['id'],_0x57eb3b[_0xd199('0x62')][_0xd199('0x39')],_0x57eb3b[_0xd199('0x62')][_0xd199('0x6b')],_0x328cfb['interaction']['id'],_0x57eb3b[_0xd199('0x58')]?JSON['stringify'](_0x57eb3b[_0xd199('0x58')]):_0xd199('0x80'));return respondWithRpcPromise(_0xd199('0x81'),_0xd199('0x82'),_0x328cfb);}return null;})[_0xd199('0x38')](function(_0x5e59fd){var _0x5c983d=_0xd199('0x6e')+_0x5e59fd[_0xd199('0x28')][_0xd199('0x6f')];return db['sequelize']['query'](_0x5c983d,{'type':db['Sequelize'][_0xd199('0x83')][_0xd199('0x71')],'raw':!![]})[_0xd199('0x38')](function(_0xd23b5a){return _0xd23b5a;});})[_0xd199('0x38')](function(_0x40f2aa){if(_0x40f2aa){_0x328cfb[_0xd199('0x28')][_0xd199('0x72')]=_0x40f2aa[0x0];if(!_0x57eb3b[_0xd199('0x58')][_0xd199('0x61')])return;return db[_0xd199('0x84')][_0xd199('0x56')]({'where':{'id':_0x57eb3b['body']['UserId'],'role':_0xd199('0x63')},'attributes':['id',_0xd199('0x39'),_0xd199('0x73'),_0xd199('0x74'),_0xd199('0x75')],'raw':!![]});}return null;})[_0xd199('0x38')](function(_0x56cca6){if(!_0x56cca6)return null;_0x328cfb['message'][_0xd199('0x63')]=_0x56cca6;return _0x328cfb;})[_0xd199('0x38')](function(_0x374b4c){if(_0x374b4c){_0x374b4c['message'][_0xd199('0x77')]=util['format'](_0xd199('0x78'),_0x57eb3b['user'][_0xd199('0x39')]);_0x374b4c[_0xd199('0x28')][_0xd199('0x79')]=_0x328cfb[_0xd199('0x79')];_0x374b4c[_0xd199('0x28')][_0xd199('0x7a')]=_0x328cfb[_0xd199('0x79')];_0x374b4c[_0xd199('0x28')]['event']=_0xd199('0x7e');respondWithRpcPromise(_0xd199('0x7b'),_0xd199('0x7b'),{'event':_0xd199('0x85'),'message':_0x374b4c[_0xd199('0x28')]},client9002);return _0x328cfb;}return null;})[_0xd199('0x38')](respondWithResult(_0x1214dc,null))[_0xd199('0x2a')](handleError(_0x1214dc,null));};exports[_0xd199('0x2c')]=function(_0x3eb3a0,_0x2792b1,_0x56cc89){if(_0x3eb3a0[_0xd199('0x58')]['id']){delete _0x3eb3a0[_0xd199('0x58')]['id'];}var _0x3b6b09;return db[_0xd199('0x3d')][_0xd199('0x56')]({'where':{'id':_0x3eb3a0[_0xd199('0x59')]['id']}})[_0xd199('0x38')](handleEntityNotFound(_0x2792b1,null))[_0xd199('0x38')](function(_0x32ba4d){if(_0x32ba4d){_0x3b6b09=_0x32ba4d;return db['SmsAccount'][_0xd199('0x56')]({'where':{'id':_0x32ba4d[_0xd199('0x86')]}});}})[_0xd199('0x38')](handleEntityNotFound(_0x2792b1,null))[_0xd199('0x38')](function(_0x54a1a6){if(_0x54a1a6){logger[_0xd199('0x24')](_0xd199('0x25'),_0xd199('0x2c'),_0xd199('0x87'),_0x54a1a6[_0xd199('0x3f')],util[_0xd199('0x88')](_0x3eb3a0[_0xd199('0x58')],{'showHidden':![],'depth':null}));switch(_0x54a1a6['type']){case'twilio':if(_0x3eb3a0['body'][_0xd199('0x89')]&&_0x3eb3a0[_0xd199('0x58')]['MessageSid']===_0x3b6b09[_0xd199('0x8a')]){return _0x3b6b09['update']({'read':!![]});}else{logger[_0xd199('0x26')](_0xd199('0x8b'),_0xd199('0x2c'),'twilio',util[_0xd199('0x88')](_0x3eb3a0[_0xd199('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3eb3a0[_0xd199('0x58')][_0xd199('0x8c')]&&_0x3eb3a0[_0xd199('0x58')][_0xd199('0x8c')]===_0x3b6b09[_0xd199('0x8a')]&&_[_0xd199('0x8d')](['sent','delivered'],_0x3eb3a0[_0xd199('0x58')][_0xd199('0x8e')])>=0x0){return _0x3b6b09[_0xd199('0x36')]({'read':!![]});}else{logger[_0xd199('0x26')](_0xd199('0x8b'),_0xd199('0x2c'),_0xd199('0x8f'),util[_0xd199('0x88')](_0x3eb3a0[_0xd199('0x58')],{'showHidden':![],'depth':null}));}break;case _0xd199('0x90'):var _0x5a9e62=_0x3eb3a0[_0xd199('0x58')]['results'][0x0];if(_0x5a9e62[_0xd199('0x2c')]['groupName']===_0xd199('0x91')){return _0x3b6b09['update']({'read':!![]});}else{logger[_0xd199('0x26')](_0xd199('0x8b'),'status','infobip',util['inspect'](_0x3eb3a0[_0xd199('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3b6b09;}})[_0xd199('0x38')](respondWithResult(_0x2792b1,null))[_0xd199('0x2a')](handleError(_0x2792b1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8279ccb..cfe27c0 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 _0xfeb5=['update','remove','emit','hook','SmsMessage','setMaxListeners'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xfeb5,0x12a));var _0x5feb=function(_0x42eaca,_0x1fbbbc){_0x42eaca=_0x42eaca-0x0;var _0x2832d1=_0xfeb5[_0x42eaca];return _0x2832d1;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x5feb('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5feb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5feb('0x2'),'afterDestroy':_0x5feb('0x3')};function emitEvent(_0x53142c){return function(_0x477e0b,_0x3babc4,_0x3f6b0d){SmsMessageEvents[_0x5feb('0x4')](_0x53142c+':'+_0x477e0b['id'],_0x477e0b);SmsMessageEvents['emit'](_0x53142c,_0x477e0b);_0x3f6b0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x5feb('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x7605=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x7605,0x13f));var _0x5760=function(_0x3d949c,_0x411a05){_0x3d949c=_0x3d949c-0x0;var _0x1d5c67=_0x7605[_0x3d949c];return _0x1d5c67;};'use strict';var EventEmitter=require(_0x5760('0x0'));var SmsMessage=require(_0x5760('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5760('0x2')](0x0);var events={'afterCreate':_0x5760('0x3'),'afterUpdate':'update','afterDestroy':_0x5760('0x4')};function emitEvent(_0x3bccac){return function(_0x212060,_0x428061,_0x5a1db7){SmsMessageEvents[_0x5760('0x5')](_0x3bccac+':'+_0x212060['id'],_0x212060);SmsMessageEvents[_0x5760('0x5')](_0x3bccac,_0x212060);_0x5a1db7(null);};}for(var e in events){if(events[_0x5760('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x5760('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 557ba5e..0764b2e 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 _0x062f=['plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','infobip','csc','crypto','apiKey','login','timestamp','keys','md5','digest','hex','signature=','GET','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Basic\x20%s','base64','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','body','models','direction','secret','isNil','UserId','SmsInteraction','findOne','then','update','createdAt','toLowerCase','catch','out','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','error','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','session_key','internal_order_id','deliveryReport','read','inspect','connectel','senderString','POST','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','http_code','data','head','clickSend','Missing\x20parameters:\x20username,\x20password'];(function(_0x2220d7,_0x804d20){var _0xe4a29f=function(_0x2e3341){while(--_0x2e3341){_0x2220d7['push'](_0x2220d7['shift']());}};_0xe4a29f(++_0x804d20);}(_0x062f,0x118));var _0xf062=function(_0x2d579f,_0x370e5d){_0x2d579f=_0x2d579f-0x0;var _0x1145da=_0x062f[_0x2d579f];return _0x1145da;};'use strict';var _=require(_0xf062('0x0'));var util=require(_0xf062('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf062('0x2'));var BPromise=require(_0xf062('0x3'));var rp=require(_0xf062('0x4'));var fs=require('fs');var path=require(_0xf062('0x5'));var rimraf=require('rimraf');var config=require(_0xf062('0x6'));var attributes=require(_0xf062('0x7'));module[_0xf062('0x8')]=function(_0x4cdd26,_0x156f00){return _0x4cdd26[_0xf062('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xf062('0xa'),'fields':['messageId']},{'name':_0xf062('0xb'),'fields':[_0xf062('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3be97d,_0x1e170c,_0x3f1340){var _0x3b15cf=_0x4cdd26[_0xf062('0xd')];var _0x550843=_0x3be97d['get']({'plain':!![]});if(_0x550843[_0xf062('0xe')]['toLowerCase']()==='in'||_0x550843[_0xf062('0xe')]['toLowerCase']()==='out'&&!_0x550843[_0xf062('0xf')]&&!_[_0xf062('0x10')](_0x550843[_0xf062('0x11')])&&!_[_0xf062('0x10')](_0x550843['SmsInteractionId'])){_0x3b15cf[_0xf062('0x12')][_0xf062('0x13')]({'where':{'id':_0x550843['SmsInteractionId']}})[_0xf062('0x14')](function(_0x2bf2fd){if(_0x2bf2fd){_0x2bf2fd[_0xf062('0x15')]({'lastMsgAt':_0x550843[_0xf062('0x16')],'lastMsgDirection':_0x550843[_0xf062('0xe')][_0xf062('0x17')]()});}})[_0xf062('0x18')](function(_0x1fa5c3){console['error'](_0x1fa5c3);});}if(_0x550843[_0xf062('0xe')]===_0xf062('0x19')&&!_0x550843[_0xf062('0xf')]){var _0x4be4e8;_0x3b15cf['SmsAccount'][_0xf062('0x1a')]({'where':{'id':_0x550843[_0xf062('0x1b')]},'raw':!![]})[_0xf062('0x14')](function(_0x4cbbcc){_0x4be4e8=_0x4cbbcc;if(_0x4be4e8&&_0x4be4e8[_0xf062('0x1c')]){switch(_0x4be4e8['type']){case _0xf062('0x1d'):var _0xea6a7d=require(_0xf062('0x1d'));if(_0x4be4e8[_0xf062('0x1e')]&&_0x4be4e8[_0xf062('0x1f')]&&_0x4be4e8[_0xf062('0x20')]){var _0x5dc8c2=new _0xea6a7d(_0x4be4e8[_0xf062('0x1e')],_0x4be4e8[_0xf062('0x1f')]);_0x5dc8c2[_0xf062('0x21')]['create']({'body':_0x550843[_0xf062('0xc')],'to':_0x550843['phone'],'from':_0x4be4e8[_0xf062('0x20')],'statusCallback':_0x4be4e8[_0xf062('0x22')]+_0xf062('0x23')+_0x550843['id']+_0xf062('0x24')+_0x4be4e8['token']})['then'](function(_0x687689){if(_0x687689['sid']){return _0x3be97d[_0xf062('0x15')]({'messageId':_0x687689[_0xf062('0x25')]});}})[_0xf062('0x18')](function(_0x4841d7){logger['error'](_0xf062('0x26'),_0xf062('0x27'),'twilio',util['inspect'](_0x4841d7,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf062('0x29'):var _0x293940=_0xf062('0x2a');if(_0x4be4e8[_0xf062('0x2b')]&&_0x4be4e8['password']){var _0x685dbd={'recipient':[_0x550843[_0xf062('0x20')]],'message':_0x550843[_0xf062('0xc')],'message_type':_0x4be4e8[_0xf062('0x2c')]};if(_0x4be4e8[_0xf062('0x2c')]&&_0x4be4e8[_0xf062('0x2c')]!=='SI'){_0x685dbd[_0xf062('0x2d')]=_0x4be4e8[_0xf062('0x20')];}var _0x400943={'url':_0x293940+_0xf062('0x2e')+_0x4be4e8['username']+'&password='+_0x4be4e8[_0xf062('0x2f')],'method':'GET'};rp(_0x400943)['then'](function(_0x2c5314){var _0x5ac050=_0x2c5314['split'](';');var _0x274cc2={'user_key':_0x5ac050[0x0],'session_key':_0x5ac050[0x1]};_0x400943={'url':_0x293940+'sms','method':'POST','headers':{'user_key':_0x274cc2['user_key'],'Session_key':_0x274cc2[_0xf062('0x30')]},'json':!![],'body':_0x685dbd};return rp(_0x400943);})[_0xf062('0x14')](function(_0x32fa27){if(_0x32fa27['total_sent']>=0x1){var _0x100d83={'messageId':_0x32fa27[_0xf062('0x31')]};if(_0x4be4e8[_0xf062('0x2c')]!=='GP'||!_0x4be4e8[_0xf062('0x32')]){_0x100d83[_0xf062('0x33')]=!![];}return _0x3be97d[_0xf062('0x15')](_0x100d83);}else{return logger[_0xf062('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),'skebby',util['inspect'](_0x32fa27,{'showHidden':![],'depth':null}));}})['catch'](function(_0x32f91e){return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'skebby',util[_0xf062('0x34')](_0x32f91e,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf062('0x35'):if(_0x4be4e8['authToken']){var _0x1ba440={'recipient':_0x550843[_0xf062('0x20')],'message':_0x550843[_0xf062('0xc')],'sender':_0x4be4e8[_0xf062('0x36')]||_0x4be4e8[_0xf062('0x20')],'authorization':_0x4be4e8[_0xf062('0x1f')]};var _0x1e170c={'method':_0xf062('0x37'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1ba440,'json':!![]};rp(_0x1e170c)[_0xf062('0x14')](function(_0x325b82){var _0x504f6f={'messageId':_0x325b82[_0xf062('0x38')]};if(!_0x4be4e8[_0xf062('0x32')]){_0x504f6f[_0xf062('0x33')]=!![];}return _0x3be97d[_0xf062('0x15')](_0x504f6f);})[_0xf062('0x18')](function(_0x3389ef){logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'connectel',util['inspect'](_0x3389ef,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),_0xf062('0x35'),_0xf062('0x39'));}break;case _0xf062('0x3a'):if(_0x4be4e8[_0xf062('0x2b')]&&_0x4be4e8[_0xf062('0x2f')]){var _0x1ba440={'messages':[{'source':_0xf062('0x3b'),'to':_0x550843[_0xf062('0x20')],'body':_0x550843[_0xf062('0xc')],'from':_0x4be4e8[_0xf062('0x36')]||_0x4be4e8[_0xf062('0x20')]}]};var _0x2d06d0=util[_0xf062('0x3c')](_0xf062('0x3d'),_0x4be4e8['username'],_0x4be4e8[_0xf062('0x2f')]);var _0x1e170c={'method':_0xf062('0x37'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1ba440,'headers':{'Authorization':util[_0xf062('0x3c')]('Basic\x20%s',new Buffer(_0x2d06d0)[_0xf062('0x3e')]('base64'))},'json':!![]};rp(_0x1e170c)['then'](function(_0x11f5e6){if(_0x11f5e6[_0xf062('0x3f')]>=0xc8&&_0x11f5e6['http_code']<=0xce){if(_0x11f5e6[_0xf062('0x40')]&&_0x11f5e6[_0xf062('0x40')]['queued_count']>0x0){var _0x32b06b=_[_0xf062('0x41')](_0x11f5e6[_0xf062('0x40')][_0xf062('0x21')]);var _0x482f4e={'messageId':_0x32b06b['message_id']};if(!_0x4be4e8[_0xf062('0x32')]){_0x482f4e[_0xf062('0x33')]=!![];}return _0x3be97d[_0xf062('0x15')](_0x482f4e);}else{logger[_0xf062('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),_0xf062('0x42'),util[_0xf062('0x34')](_0x11f5e6,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf062('0x42'),util[_0xf062('0x34')](_0x11f5e6,{'showHidden':![],'depth':null}));}})[_0xf062('0x18')](function(_0x132edc){logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'clickSend',util[_0xf062('0x34')](_0x132edc,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x42'),_0xf062('0x43'));}break;case _0xf062('0x44'):if(_0x4be4e8[_0xf062('0x45')]&&_0x4be4e8[_0xf062('0x1f')]){var _0x1ba440={'dst':_0x550843[_0xf062('0x20')],'text':_0x550843[_0xf062('0xc')],'src':_0x4be4e8['senderString']||_0x4be4e8['phone'],'url':_0x4be4e8[_0xf062('0x22')]+_0xf062('0x23')+_0x550843['id']+_0xf062('0x24')+_0x4be4e8['token']};var _0x2d06d0=util[_0xf062('0x3c')](_0xf062('0x3d'),_0x4be4e8['authId'],_0x4be4e8[_0xf062('0x1f')]);var _0x1e170c={'method':_0xf062('0x37'),'uri':util[_0xf062('0x3c')](_0xf062('0x46'),_0x4be4e8['authId']),'body':_0x1ba440,'headers':{'Authorization':util[_0xf062('0x3c')]('Basic\x20%s',new Buffer(_0x2d06d0)[_0xf062('0x3e')]('base64'))},'json':!![]};rp(_0x1e170c)[_0xf062('0x14')](function(_0x4b3152){var _0x3a51e1={'messageId':_0x4b3152[_0xf062('0x47')][0x0]};return _0x3be97d['update'](_0x3a51e1);})[_0xf062('0x18')](function(_0x43eac1){logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x44'),util[_0xf062('0x34')](_0x43eac1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x44'),_0xf062('0x48'));}break;case'infobip':if(_0x4be4e8[_0xf062('0x2b')]&&_0x4be4e8[_0xf062('0x2f')]){if(_0x4be4e8[_0xf062('0x49')]){var _0x3cfb5d={'method':_0xf062('0x37'),'uri':_0x4be4e8[_0xf062('0x49')]+_0xf062('0x4a'),'body':{'username':_0x4be4e8[_0xf062('0x2b')],'password':_0x4be4e8[_0xf062('0x2f')]},'json':!![]};return rp(_0x3cfb5d)[_0xf062('0x14')](function(_0x156db2){var _0x4745e9={'method':_0xf062('0x37'),'uri':_0x4be4e8[_0xf062('0x49')]+_0xf062('0x4b'),'body':{'messages':[{'from':_0x4be4e8[_0xf062('0x20')],'destinations':[{'to':_0x550843[_0xf062('0x20')]}],'text':_0x550843['body'],'notifyUrl':_0x4be4e8[_0xf062('0x22')]+_0xf062('0x23')+_0x550843['id']+'/status?token='+_0x4be4e8[_0xf062('0x4c')],'notifyContentType':_0xf062('0x4d'),'callbackData':_0x4be4e8['phone']+';'+_0x550843[_0xf062('0xc')]}]},'headers':{'Authorization':_0xf062('0x4e')+_0x156db2[_0xf062('0x4c')]},'json':!![]};return rp(_0x4745e9)['then'](function(_0x133130){if(_0x133130[_0xf062('0x21')]){var _0x334cc3={'messageId':_0x133130[_0xf062('0x21')][0x0][_0xf062('0xa')]};if(!_0x4be4e8[_0xf062('0x32')]){_0x334cc3[_0xf062('0x33')]=!![];}return _0x3be97d[_0xf062('0x15')](_0x334cc3);}else{return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'infobip',util[_0xf062('0x34')](_0x133130,{'showHidden':![],'depth':null}));}});})[_0xf062('0x18')](function(_0x496f22){return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'infobip',util[_0xf062('0x34')](_0x496f22,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'infobip',_0xf062('0x4f'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),_0xf062('0x50'),_0xf062('0x43'));}break;case _0xf062('0x51'):var _0x5c31aa=require(_0xf062('0x52'));if(_0x4be4e8[_0xf062('0x53')]){var _0x47a735={};_0x47a735[_0xf062('0x54')]=_0x4be4e8[_0xf062('0x2b')];_0x47a735['phone']=_0x550843[_0xf062('0x20')];_0x47a735['sender']=_0x4be4e8['phone'];_0x47a735['text']=_0x550843[_0xf062('0xc')];_0x47a735[_0xf062('0x55')]=+new Date();var _0x20374b='';var _0x1c2c1b='';var _0xe07573=Object[_0xf062('0x56')](_0x47a735);_0xe07573['sort']();for(var _0x10c305=0x0;_0x10c305<_0xe07573['length'];_0x10c305++){if(_0x20374b!=''){_0x20374b+='&';}_0x20374b+=_0xe07573[_0x10c305]+'='+encodeURIComponent(_0x47a735[_0xe07573[_0x10c305]]);_0x1c2c1b+=_0x47a735[_0xe07573[_0x10c305]];}_0x1c2c1b+=_0x4be4e8['apiKey'];_0x1c2c1b=_0x5c31aa['createHash'](_0xf062('0x57'))['update'](_0x1c2c1b)[_0xf062('0x58')](_0xf062('0x59'));if(_0x20374b!==''){_0x20374b+='&';}_0x20374b+=_0xf062('0x5a')+_0x1c2c1b;var _0x400943={'method':_0xf062('0x5b'),'uri':_0x4be4e8['baseUrl']+'/external/get/send.php?'+_0x20374b,'json':!![]};return rp(_0x400943)[_0xf062('0x14')](function(_0x46cc82){var _0x138085=Object[_0xf062('0x56')](_0x46cc82);if(_0x46cc82[_0x138085[0x0]][_0xf062('0x28')]&&parseInt(_0x46cc82[_0x138085[0x0]][_0xf062('0x28')])===0x0){var _0x580f09={'messageId':_0x46cc82[_0x138085[0x0]]['id_sms']};if(!_0x4be4e8['deliveryReport']){_0x580f09[_0xf062('0x33')]=!![];}return _0x3be97d[_0xf062('0x15')](_0x580f09);}else{return logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x51'),util[_0xf062('0x34')](_0x46cc82[_0xf062('0x28')],{'showHidden':![],'depth':null}));}})[_0xf062('0x18')](function(_0x597921){return logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x51'),util[_0xf062('0x34')](_0x597921,{'showHidden':![],'depth':null}));});}else{logger[_0xf062('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),_0xf062('0x51'),_0xf062('0x5c'));}break;case _0xf062('0x5d'):if(_0x4be4e8[_0xf062('0x53')]){var _0x5521eb={'method':_0xf062('0x37'),'uri':_0xf062('0x5e'),'headers':{'Authorization':_0x4be4e8[_0xf062('0x53')]},'body':{'content':_0x550843[_0xf062('0xc')],'to':[_0x550843[_0xf062('0x20')]],'from':_0x4be4e8[_0xf062('0x20')],'binary':![],'clientMessageId':_0xf062('0x5f'),'charset':_0xf062('0x60')},'json':!![]};rp(_0x5521eb)[_0xf062('0x14')](function(_0x1fe101){if(!_0x1fe101[_0xf062('0x28')]){var _0x4c31d={'messageId':_0x1fe101[_0xf062('0x21')][0x0][_0xf062('0x61')]};if(!_0x4be4e8[_0xf062('0x32')]){_0x4c31d['read']=!![];}return _0x3be97d[_0xf062('0x15')](_0x4c31d);}else{return logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x5d'),util[_0xf062('0x34')](_0x1fe101[_0xf062('0x28')],{'showHidden':![],'depth':null}));}})[_0xf062('0x18')](function(_0x420e74){return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x5d'),util['inspect'](_0x420e74,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf062('0x27'),_0xf062('0x5d'),_0xf062('0x5c'));}break;case _0xf062('0x62'):if(_0x4be4e8[_0xf062('0x2b')]&&_0x4be4e8[_0xf062('0x2f')]){var _0x2d06d0=util[_0xf062('0x3c')](_0xf062('0x3d'),_0x4be4e8['username'],_0x4be4e8['password']);var _0x1e170c={'method':_0xf062('0x37'),'uri':_0xf062('0x63')+_0x4be4e8[_0xf062('0x64')]+_0xf062('0x65'),'body':{'to':[_0x550843[_0xf062('0x20')]],'text':_0x550843['body'],'from':_0x4be4e8[_0xf062('0x20')],'applicationId':_0x4be4e8[_0xf062('0x66')]},'headers':{'Authorization':util[_0xf062('0x3c')](_0xf062('0x67'),new Buffer(_0x2d06d0)[_0xf062('0x3e')](_0xf062('0x68')))},'json':!![]};rp(_0x1e170c)[_0xf062('0x14')](function(_0x144fcf){if(_0x144fcf['id']){var _0x4db128={'messageId':_0x144fcf['id']};return _0x3be97d[_0xf062('0x15')](_0x4db128);}else{logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x62'),util[_0xf062('0x34')](_0x144fcf,{'showHidden':![],'depth':null}));}})[_0xf062('0x18')](function(_0x48857f){logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),'bandwidth',util[_0xf062('0x34')](_0x48857f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x62'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x4be4e8[_0xf062('0x53')]){var _0x51e658={};var _0x400943={'method':_0xf062('0x37'),'uri':_0xf062('0x69'),'headers':{'Authorization':_0xf062('0x6a')+_0x4be4e8[_0xf062('0x53')],'Content-Type':_0xf062('0x4d')},'body':{'from':_0x4be4e8[_0xf062('0x20')],'to':_0x550843[_0xf062('0x20')],'text':_0x550843[_0xf062('0xc')]},'json':!![]};return rp(_0x400943)[_0xf062('0x14')](function(_0x2901af){if(_0x2901af[_0xf062('0x6b')]==0xca){_0x51e658[_0xf062('0x6c')]=_0x2901af;var _0x58d1e7={'method':_0xf062('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x4be4e8[_0xf062('0x53')],'Content-Type':_0xf062('0x4d')},'body':{'refid':_0x51e658[_0xf062('0x6c')][_0xf062('0x6d')]},'json':!![]};return rp(_0x58d1e7)['then'](function(_0x14b48a){_0x51e658[_0xf062('0x6e')]=_0x14b48a;var _0x4826a1={'messageId':_0x51e658['message'][_0xf062('0x6d')],'read':!![]};return _0x3be97d[_0xf062('0x15')](_0x4826a1);});}else{return logger['error'](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x6f'),util[_0xf062('0x34')](_0x2901af,{'showHidden':![],'depth':null}));}})['catch'](function(_0x174230){return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x6f'),util[_0xf062('0x34')](_0x174230,{'showHidden':![],'depth':null}));});}else{return logger[_0xf062('0x28')](_0xf062('0x26'),_0xf062('0x27'),_0xf062('0x6f'),_0xf062('0x70'));}break;}}})[_0xf062('0x71')](function(){_0x3f1340();});}else{_0x3f1340();}}},'charset':_0xf062('0x72'),'collate':_0xf062('0x73')});}; \ No newline at end of file +var _0x1fda=['token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','username','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','data','queued_count','head','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','crypto','apiKey','text','keys','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','accountId','/messages','applicationId','bandwidth','code','message','refid','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token='];(function(_0x288ef7,_0x4aee60){var _0x2c6598=function(_0xacae37){while(--_0xacae37){_0x288ef7['push'](_0x288ef7['shift']());}};_0x2c6598(++_0x4aee60);}(_0x1fda,0xc0));var _0xa1fd=function(_0x7a9d49,_0x437b3d){_0x7a9d49=_0x7a9d49-0x0;var _0x10a6e0=_0x1fda[_0x7a9d49];return _0x10a6e0;};'use strict';var _=require('lodash');var util=require(_0xa1fd('0x0'));var logger=require('../../config/logger')(_0xa1fd('0x1'));var moment=require(_0xa1fd('0x2'));var BPromise=require(_0xa1fd('0x3'));var rp=require(_0xa1fd('0x4'));var fs=require('fs');var path=require(_0xa1fd('0x5'));var rimraf=require('rimraf');var config=require(_0xa1fd('0x6'));var attributes=require(_0xa1fd('0x7'));module['exports']=function(_0x920c3,_0x14f22f){return _0x920c3[_0xa1fd('0x8')](_0xa1fd('0x9'),attributes,{'tableName':_0xa1fd('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa1fd('0xb')]},{'name':_0xa1fd('0xc'),'fields':[_0xa1fd('0xd')],'type':_0xa1fd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22de6b,_0x1eaf90,_0xd1028e){var _0x53bd20=_0x920c3[_0xa1fd('0xf')];var _0x524674=_0x22de6b[_0xa1fd('0x10')]({'plain':!![]});if(_0x524674[_0xa1fd('0x11')]['toLowerCase']()==='in'||_0x524674[_0xa1fd('0x11')][_0xa1fd('0x12')]()===_0xa1fd('0x13')&&!_0x524674[_0xa1fd('0x14')]&&!_[_0xa1fd('0x15')](_0x524674[_0xa1fd('0x16')])&&!_[_0xa1fd('0x15')](_0x524674[_0xa1fd('0x17')])){_0x53bd20['SmsInteraction'][_0xa1fd('0x18')]({'where':{'id':_0x524674[_0xa1fd('0x17')]}})[_0xa1fd('0x19')](function(_0x1366a9){if(_0x1366a9){_0x1366a9[_0xa1fd('0x1a')]({'lastMsgAt':_0x524674[_0xa1fd('0x1b')],'lastMsgDirection':_0x524674['direction'][_0xa1fd('0x12')]()});}})[_0xa1fd('0x1c')](function(_0x411397){console[_0xa1fd('0x1d')](_0x411397);});}if(_0x524674[_0xa1fd('0x11')]===_0xa1fd('0x13')&&!_0x524674[_0xa1fd('0x14')]){var _0x565b8f;_0x53bd20[_0xa1fd('0x1e')]['find']({'where':{'id':_0x524674[_0xa1fd('0x1f')]},'raw':!![]})['then'](function(_0x13b334){_0x565b8f=_0x13b334;if(_0x565b8f&&_0x565b8f['type']){switch(_0x565b8f[_0xa1fd('0x20')]){case _0xa1fd('0x21'):var _0x272d14=require(_0xa1fd('0x21'));if(_0x565b8f[_0xa1fd('0x22')]&&_0x565b8f[_0xa1fd('0x23')]&&_0x565b8f[_0xa1fd('0x24')]){var _0x57dd0=new _0x272d14(_0x565b8f['accountSid'],_0x565b8f['authToken']);_0x57dd0[_0xa1fd('0x25')][_0xa1fd('0x26')]({'body':_0x524674[_0xa1fd('0xd')],'to':_0x524674['phone'],'from':_0x565b8f[_0xa1fd('0x24')],'statusCallback':_0x565b8f[_0xa1fd('0x27')]+_0xa1fd('0x28')+_0x524674['id']+_0xa1fd('0x29')+_0x565b8f[_0xa1fd('0x2a')]})[_0xa1fd('0x19')](function(_0x4591a4){if(_0x4591a4[_0xa1fd('0x2b')]){return _0x22de6b[_0xa1fd('0x1a')]({'messageId':_0x4591a4[_0xa1fd('0x2b')]});}})[_0xa1fd('0x1c')](function(_0x410ff2){logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x21'),util['inspect'](_0x410ff2,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),'afterCreate',_0xa1fd('0x21'),_0xa1fd('0x2e'));}break;case _0xa1fd('0x2f'):var _0x30c152=_0xa1fd('0x30');if(_0x565b8f['username']&&_0x565b8f[_0xa1fd('0x31')]){var _0x5e47db={'recipient':[_0x524674['phone']],'message':_0x524674[_0xa1fd('0xd')],'message_type':_0x565b8f['smsMethod']};if(_0x565b8f[_0xa1fd('0x32')]&&_0x565b8f[_0xa1fd('0x32')]!=='SI'){_0x5e47db[_0xa1fd('0x33')]=_0x565b8f[_0xa1fd('0x24')];}var _0x5add0f={'url':_0x30c152+_0xa1fd('0x34')+_0x565b8f['username']+_0xa1fd('0x35')+_0x565b8f[_0xa1fd('0x31')],'method':_0xa1fd('0x36')};rp(_0x5add0f)[_0xa1fd('0x19')](function(_0x2609d5){var _0x4f07c9=_0x2609d5['split'](';');var _0x32fd23={'user_key':_0x4f07c9[0x0],'session_key':_0x4f07c9[0x1]};_0x5add0f={'url':_0x30c152+_0xa1fd('0x37'),'method':_0xa1fd('0x38'),'headers':{'user_key':_0x32fd23[_0xa1fd('0x39')],'Session_key':_0x32fd23[_0xa1fd('0x3a')]},'json':!![],'body':_0x5e47db};return rp(_0x5add0f);})['then'](function(_0x193310){if(_0x193310[_0xa1fd('0x3b')]>=0x1){var _0x2ea230={'messageId':_0x193310['internal_order_id']};if(_0x565b8f['smsMethod']!=='GP'||!_0x565b8f['deliveryReport']){_0x2ea230[_0xa1fd('0x3c')]=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x2ea230);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa1fd('0x2d'),_0xa1fd('0x2f'),util[_0xa1fd('0x3d')](_0x193310,{'showHidden':![],'depth':null}));}})[_0xa1fd('0x1c')](function(_0x22b9dd){return logger[_0xa1fd('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa1fd('0x2d'),'skebby',util[_0xa1fd('0x3d')](_0x22b9dd,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),'afterCreate',_0xa1fd('0x2f'),_0xa1fd('0x3e'));}break;case _0xa1fd('0x3f'):if(_0x565b8f['authToken']){var _0x558e1a={'recipient':_0x524674['phone'],'message':_0x524674['body'],'sender':_0x565b8f[_0xa1fd('0x40')]||_0x565b8f['phone'],'authorization':_0x565b8f[_0xa1fd('0x23')]};var _0x1eaf90={'method':_0xa1fd('0x38'),'uri':_0xa1fd('0x41'),'body':_0x558e1a,'json':!![]};rp(_0x1eaf90)['then'](function(_0x279055){var _0x2063b3={'messageId':_0x279055[_0xa1fd('0x42')]};if(!_0x565b8f[_0xa1fd('0x43')]){_0x2063b3[_0xa1fd('0x3c')]=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x2063b3);})[_0xa1fd('0x1c')](function(_0x29d7b1){logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x3f'),util[_0xa1fd('0x3d')](_0x29d7b1,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),'connectel',_0xa1fd('0x44'));}break;case'clicksend':if(_0x565b8f[_0xa1fd('0x45')]&&_0x565b8f[_0xa1fd('0x31')]){var _0x558e1a={'messages':[{'source':_0xa1fd('0x46'),'to':_0x524674[_0xa1fd('0x24')],'body':_0x524674[_0xa1fd('0xd')],'from':_0x565b8f[_0xa1fd('0x40')]||_0x565b8f['phone']}]};var _0x4b64e9=util['format']('%s:%s',_0x565b8f[_0xa1fd('0x45')],_0x565b8f[_0xa1fd('0x31')]);var _0x1eaf90={'method':_0xa1fd('0x38'),'uri':_0xa1fd('0x47'),'body':_0x558e1a,'headers':{'Authorization':util[_0xa1fd('0x48')](_0xa1fd('0x49'),new Buffer(_0x4b64e9)[_0xa1fd('0x4a')]('base64'))},'json':!![]};rp(_0x1eaf90)[_0xa1fd('0x19')](function(_0x105821){if(_0x105821['http_code']>=0xc8&&_0x105821['http_code']<=0xce){if(_0x105821[_0xa1fd('0x4b')]&&_0x105821[_0xa1fd('0x4b')][_0xa1fd('0x4c')]>0x0){var _0x5a0205=_[_0xa1fd('0x4d')](_0x105821[_0xa1fd('0x4b')][_0xa1fd('0x25')]);var _0x521cb7={'messageId':_0x5a0205['message_id']};if(!_0x565b8f[_0xa1fd('0x43')]){_0x521cb7[_0xa1fd('0x3c')]=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x521cb7);}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),'afterCreate',_0xa1fd('0x4e'),util[_0xa1fd('0x3d')](_0x105821,{'showHidden':![],'depth':null}));}}else{logger[_0xa1fd('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa1fd('0x4e'),util[_0xa1fd('0x3d')](_0x105821,{'showHidden':![],'depth':null}));}})['catch'](function(_0x348451){logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x4e'),util[_0xa1fd('0x3d')](_0x348451,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa1fd('0x2c'),'afterCreate',_0xa1fd('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa1fd('0x4f'):if(_0x565b8f[_0xa1fd('0x50')]&&_0x565b8f[_0xa1fd('0x23')]){var _0x558e1a={'dst':_0x524674[_0xa1fd('0x24')],'text':_0x524674['body'],'src':_0x565b8f[_0xa1fd('0x40')]||_0x565b8f['phone'],'url':_0x565b8f[_0xa1fd('0x27')]+'/api/sms/messages/'+_0x524674['id']+'/status?token='+_0x565b8f[_0xa1fd('0x2a')]};var _0x4b64e9=util[_0xa1fd('0x48')](_0xa1fd('0x51'),_0x565b8f[_0xa1fd('0x50')],_0x565b8f[_0xa1fd('0x23')]);var _0x1eaf90={'method':_0xa1fd('0x38'),'uri':util['format'](_0xa1fd('0x52'),_0x565b8f['authId']),'body':_0x558e1a,'headers':{'Authorization':util[_0xa1fd('0x48')](_0xa1fd('0x49'),new Buffer(_0x4b64e9)[_0xa1fd('0x4a')](_0xa1fd('0x53')))},'json':!![]};rp(_0x1eaf90)[_0xa1fd('0x19')](function(_0x4e5566){var _0x3494da={'messageId':_0x4e5566[_0xa1fd('0x54')][0x0]};return _0x22de6b['update'](_0x3494da);})[_0xa1fd('0x1c')](function(_0x467832){logger[_0xa1fd('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa1fd('0x4f'),util['inspect'](_0x467832,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),'plivo',_0xa1fd('0x55'));}break;case'infobip':if(_0x565b8f[_0xa1fd('0x45')]&&_0x565b8f['password']){if(_0x565b8f[_0xa1fd('0x56')]){var _0x26f08d={'method':'POST','uri':_0x565b8f['baseUrl']+_0xa1fd('0x57'),'body':{'username':_0x565b8f['username'],'password':_0x565b8f[_0xa1fd('0x31')]},'json':!![]};return rp(_0x26f08d)['then'](function(_0x54277b){var _0x529bfa={'method':_0xa1fd('0x38'),'uri':_0x565b8f['baseUrl']+_0xa1fd('0x58'),'body':{'messages':[{'from':_0x565b8f[_0xa1fd('0x24')],'destinations':[{'to':_0x524674['phone']}],'text':_0x524674[_0xa1fd('0xd')],'notifyUrl':_0x565b8f[_0xa1fd('0x27')]+_0xa1fd('0x28')+_0x524674['id']+_0xa1fd('0x29')+_0x565b8f['token'],'notifyContentType':_0xa1fd('0x59'),'callbackData':_0x565b8f['phone']+';'+_0x524674['body']}]},'headers':{'Authorization':_0xa1fd('0x5a')+_0x54277b['token']},'json':!![]};return rp(_0x529bfa)[_0xa1fd('0x19')](function(_0xef630b){if(_0xef630b[_0xa1fd('0x25')]){var _0x2285cd={'messageId':_0xef630b[_0xa1fd('0x25')][0x0][_0xa1fd('0xb')]};if(!_0x565b8f[_0xa1fd('0x43')]){_0x2285cd[_0xa1fd('0x3c')]=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x2285cd);}else{return logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x5b'),util[_0xa1fd('0x3d')](_0xef630b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x341f7d){return logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x5b'),util[_0xa1fd('0x3d')](_0x341f7d,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa1fd('0x2d'),_0xa1fd('0x5b'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x5b'),_0xa1fd('0x3e'));}break;case'csc':var _0x471001=require(_0xa1fd('0x5c'));if(_0x565b8f[_0xa1fd('0x5d')]){var _0x3b6778={};_0x3b6778['login']=_0x565b8f[_0xa1fd('0x45')];_0x3b6778[_0xa1fd('0x24')]=_0x524674[_0xa1fd('0x24')];_0x3b6778['sender']=_0x565b8f[_0xa1fd('0x24')];_0x3b6778[_0xa1fd('0x5e')]=_0x524674['body'];_0x3b6778['timestamp']=+new Date();var _0x2b5bc3='';var _0x94a4a3='';var _0x2a0015=Object[_0xa1fd('0x5f')](_0x3b6778);_0x2a0015['sort']();for(var _0x158c1f=0x0;_0x158c1f<_0x2a0015[_0xa1fd('0x60')];_0x158c1f++){if(_0x2b5bc3!=''){_0x2b5bc3+='&';}_0x2b5bc3+=_0x2a0015[_0x158c1f]+'='+encodeURIComponent(_0x3b6778[_0x2a0015[_0x158c1f]]);_0x94a4a3+=_0x3b6778[_0x2a0015[_0x158c1f]];}_0x94a4a3+=_0x565b8f[_0xa1fd('0x5d')];_0x94a4a3=_0x471001[_0xa1fd('0x61')](_0xa1fd('0x62'))[_0xa1fd('0x1a')](_0x94a4a3)['digest'](_0xa1fd('0x63'));if(_0x2b5bc3!==''){_0x2b5bc3+='&';}_0x2b5bc3+=_0xa1fd('0x64')+_0x94a4a3;var _0x5add0f={'method':_0xa1fd('0x36'),'uri':_0x565b8f['baseUrl']+_0xa1fd('0x65')+_0x2b5bc3,'json':!![]};return rp(_0x5add0f)[_0xa1fd('0x19')](function(_0x54b220){var _0x4840fd=Object[_0xa1fd('0x5f')](_0x54b220);if(_0x54b220[_0x4840fd[0x0]][_0xa1fd('0x1d')]&&parseInt(_0x54b220[_0x4840fd[0x0]]['error'])===0x0){var _0x46bb42={'messageId':_0x54b220[_0x4840fd[0x0]][_0xa1fd('0x66')]};if(!_0x565b8f['deliveryReport']){_0x46bb42['read']=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x46bb42);}else{return logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x67'),util[_0xa1fd('0x3d')](_0x54b220['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2dff92){return logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x67'),util['inspect'](_0x2dff92,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),'afterCreate',_0xa1fd('0x67'),_0xa1fd('0x68'));}break;case _0xa1fd('0x69'):if(_0x565b8f['apiKey']){var _0x21970e={'method':_0xa1fd('0x38'),'uri':_0xa1fd('0x6a'),'headers':{'Authorization':_0x565b8f[_0xa1fd('0x5d')]},'body':{'content':_0x524674[_0xa1fd('0xd')],'to':[_0x524674[_0xa1fd('0x24')]],'from':_0x565b8f[_0xa1fd('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xa1fd('0x6b')},'json':!![]};rp(_0x21970e)['then'](function(_0x2acb8a){if(!_0x2acb8a[_0xa1fd('0x1d')]){var _0x4a6295={'messageId':_0x2acb8a['messages'][0x0][_0xa1fd('0x6c')]};if(!_0x565b8f[_0xa1fd('0x43')]){_0x4a6295[_0xa1fd('0x3c')]=!![];}return _0x22de6b[_0xa1fd('0x1a')](_0x4a6295);}else{return logger[_0xa1fd('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa1fd('0x2d'),'clickatell',util[_0xa1fd('0x3d')](_0x2acb8a[_0xa1fd('0x1d')],{'showHidden':![],'depth':null}));}})[_0xa1fd('0x1c')](function(_0x8a4f08){return logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x69'),util[_0xa1fd('0x3d')](_0x8a4f08,{'showHidden':![],'depth':null}));});}else{logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x69'),_0xa1fd('0x68'));}break;case'bandwidth':if(_0x565b8f[_0xa1fd('0x45')]&&_0x565b8f[_0xa1fd('0x31')]){var _0x4b64e9=util['format']('%s:%s',_0x565b8f[_0xa1fd('0x45')],_0x565b8f[_0xa1fd('0x31')]);var _0x1eaf90={'method':_0xa1fd('0x38'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x565b8f[_0xa1fd('0x6d')]+_0xa1fd('0x6e'),'body':{'to':[_0x524674[_0xa1fd('0x24')]],'text':_0x524674['body'],'from':_0x565b8f[_0xa1fd('0x24')],'applicationId':_0x565b8f[_0xa1fd('0x6f')]},'headers':{'Authorization':util[_0xa1fd('0x48')](_0xa1fd('0x49'),new Buffer(_0x4b64e9)['toString'](_0xa1fd('0x53')))},'json':!![]};rp(_0x1eaf90)[_0xa1fd('0x19')](function(_0x722880){if(_0x722880['id']){var _0x2e7573={'messageId':_0x722880['id']};return _0x22de6b['update'](_0x2e7573);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa1fd('0x70'),util[_0xa1fd('0x3d')](_0x722880,{'showHidden':![],'depth':null}));}})[_0xa1fd('0x1c')](function(_0x313872){logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x70'),util[_0xa1fd('0x3d')](_0x313872,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),_0xa1fd('0x70'),_0xa1fd('0x3e'));}break;case'intelepeer':if(_0x565b8f['apiKey']){var _0x29429c={};var _0x5add0f={'method':_0xa1fd('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x565b8f[_0xa1fd('0x5d')],'Content-Type':_0xa1fd('0x59')},'body':{'from':_0x565b8f[_0xa1fd('0x24')],'to':_0x524674[_0xa1fd('0x24')],'text':_0x524674[_0xa1fd('0xd')]},'json':!![]};return rp(_0x5add0f)[_0xa1fd('0x19')](function(_0x503b4e){if(_0x503b4e[_0xa1fd('0x71')]==0xca){_0x29429c[_0xa1fd('0x72')]=_0x503b4e;var _0x30c1d1={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x565b8f[_0xa1fd('0x5d')],'Content-Type':_0xa1fd('0x59')},'body':{'refid':_0x29429c[_0xa1fd('0x72')][_0xa1fd('0x73')]},'json':!![]};return rp(_0x30c1d1)[_0xa1fd('0x19')](function(_0x1e143c){_0x29429c['status']=_0x1e143c;var _0x146124={'messageId':_0x29429c['message'][_0xa1fd('0x73')],'read':!![]};return _0x22de6b[_0xa1fd('0x1a')](_0x146124);});}else{return logger['error'](_0xa1fd('0x2c'),_0xa1fd('0x2d'),'intelepeer',util[_0xa1fd('0x3d')](_0x503b4e,{'showHidden':![],'depth':null}));}})[_0xa1fd('0x1c')](function(_0x49a70e){return logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),_0xa1fd('0x2d'),'intelepeer',util[_0xa1fd('0x3d')](_0x49a70e,{'showHidden':![],'depth':null}));});}else{return logger[_0xa1fd('0x1d')](_0xa1fd('0x2c'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})['finally'](function(){_0xd1028e();});}else{_0xd1028e();}}},'charset':'utf8mb4','collate':_0xa1fd('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2edca18..430082e 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 _0xba3b=['options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./smsMessage.socket','request','then','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','SmsMessage','create','body'];(function(_0x83beb6,_0x5a993b){var _0x5653ba=function(_0x396ca5){while(--_0x396ca5){_0x83beb6['push'](_0x83beb6['shift']());}};_0x5653ba(++_0x5a993b);}(_0xba3b,0x103));var _0xbba3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba3b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbba3('0x0'));var util=require(_0xbba3('0x1'));var moment=require(_0xbba3('0x2'));var BPromise=require(_0xbba3('0x3'));var rs=require(_0xbba3('0x4'));var fs=require('fs');var Redis=require(_0xbba3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbba3('0x6'));var logger=require(_0xbba3('0x7'))(_0xbba3('0x8'));var config=require(_0xbba3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbba3('0xa')]({'port':0x232a});config[_0xbba3('0xb')]=_[_0xbba3('0xc')](config[_0xbba3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbba3('0xd'))(new Redis(config[_0xbba3('0xb')]));require(_0xbba3('0xe'))['register'](socket);function respondWithRpcPromise(_0x56f9ef,_0x4db7d5,_0x3ef133){return new BPromise(function(_0x4074e8,_0x313993){return client[_0xbba3('0xf')](_0x56f9ef,_0x3ef133)[_0xbba3('0x10')](function(_0x4b829c){logger[_0xbba3('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4db7d5,_0xbba3('0x12'));logger[_0xbba3('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4db7d5,_0xbba3('0x12'),JSON[_0xbba3('0x14')](_0x4b829c));if(_0x4b829c[_0xbba3('0x15')]){if(_0x4b829c[_0xbba3('0x15')][_0xbba3('0x16')]===0x1f4){logger[_0xbba3('0x15')](_0xbba3('0x17'),_0x4db7d5,_0x4b829c[_0xbba3('0x15')][_0xbba3('0x18')]);return _0x313993(_0x4b829c[_0xbba3('0x15')][_0xbba3('0x18')]);}logger['error'](_0xbba3('0x17'),_0x4db7d5,_0x4b829c[_0xbba3('0x15')][_0xbba3('0x18')]);return _0x4074e8(_0x4b829c[_0xbba3('0x15')]['message']);}else{logger['info'](_0xbba3('0x17'),_0x4db7d5,_0xbba3('0x12'));_0x4074e8(_0x4b829c['result']['message']);}})[_0xbba3('0x19')](function(_0x7c7393){logger[_0xbba3('0x15')](_0xbba3('0x17'),_0x4db7d5,_0x7c7393);_0x313993(_0x7c7393);});});}exports['CreateSmsMessage']=function(_0x167969){var _0x212427=this;return new Promise(function(_0x52327d,_0x19cc9c){return db[_0xbba3('0x1a')][_0xbba3('0x1b')](_0x167969[_0xbba3('0x1c')],{'raw':_0x167969[_0xbba3('0x1d')]?_0x167969[_0xbba3('0x1d')][_0xbba3('0x1e')]===undefined?!![]:![]:!![]})[_0xbba3('0x10')](function(_0x4c45db){logger[_0xbba3('0x11')](_0xbba3('0x1f'),_0x167969);logger[_0xbba3('0x13')]('CreateSmsMessage',_0x167969,JSON[_0xbba3('0x14')](_0x4c45db));_0x52327d(_0x4c45db);})[_0xbba3('0x19')](function(_0x2c7379){logger['error']('CreateSmsMessage',_0x2c7379[_0xbba3('0x18')],_0x167969);_0x19cc9c(_0x212427[_0xbba3('0x15')](0x1f4,_0x2c7379[_0xbba3('0x18')]));});});}; \ No newline at end of file +var _0xc57b=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','SmsMessage,\x20%s,\x20%s','debug','code','error','message','request\x20sent','catch','CreateSmsMessage','SmsMessage','body','options','raw','then','stringify'];(function(_0x109e1d,_0x4474f0){var _0x549e93=function(_0x214d66){while(--_0x214d66){_0x109e1d['push'](_0x109e1d['shift']());}};_0x549e93(++_0x4474f0);}(_0xc57b,0x186));var _0xbc57=function(_0x54c68e,_0x3bb911){_0x54c68e=_0x54c68e-0x0;var _0x3dc1be=_0xc57b[_0x54c68e];return _0x3dc1be;};'use strict';var _=require(_0xbc57('0x0'));var util=require(_0xbc57('0x1'));var moment=require(_0xbc57('0x2'));var BPromise=require(_0xbc57('0x3'));var rs=require(_0xbc57('0x4'));var fs=require('fs');var Redis=require(_0xbc57('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc57('0x6'));var config=require('../../config/environment');var jayson=require(_0xbc57('0x7'));var client=jayson[_0xbc57('0x8')][_0xbc57('0x9')]({'port':0x232a});config[_0xbc57('0xa')]=_['defaults'](config[_0xbc57('0xa')],{'host':_0xbc57('0xb'),'port':0x18eb});var socket=require(_0xbc57('0xc'))(new Redis(config[_0xbc57('0xa')]));require('./smsMessage.socket')[_0xbc57('0xd')](socket);function respondWithRpcPromise(_0x556cd6,_0x1afc3f,_0x49f8aa){return new BPromise(function(_0x43dd2f,_0x27be9a){return client[_0xbc57('0xe')](_0x556cd6,_0x49f8aa)['then'](function(_0x30f18a){logger[_0xbc57('0xf')](_0xbc57('0x10'),_0x1afc3f,'request\x20sent');logger[_0xbc57('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1afc3f,'request\x20sent',JSON['stringify'](_0x30f18a));if(_0x30f18a['error']){if(_0x30f18a['error'][_0xbc57('0x12')]===0x1f4){logger['error'](_0xbc57('0x10'),_0x1afc3f,_0x30f18a['error']['message']);return _0x27be9a(_0x30f18a[_0xbc57('0x13')][_0xbc57('0x14')]);}logger['error'](_0xbc57('0x10'),_0x1afc3f,_0x30f18a[_0xbc57('0x13')][_0xbc57('0x14')]);return _0x43dd2f(_0x30f18a[_0xbc57('0x13')][_0xbc57('0x14')]);}else{logger[_0xbc57('0xf')](_0xbc57('0x10'),_0x1afc3f,_0xbc57('0x15'));_0x43dd2f(_0x30f18a['result'][_0xbc57('0x14')]);}})[_0xbc57('0x16')](function(_0x50df2b){logger[_0xbc57('0x13')](_0xbc57('0x10'),_0x1afc3f,_0x50df2b);_0x27be9a(_0x50df2b);});});}exports[_0xbc57('0x17')]=function(_0x485429){var _0x4a77cf=this;return new Promise(function(_0x1a8536,_0x116eea){return db[_0xbc57('0x18')]['create'](_0x485429[_0xbc57('0x19')],{'raw':_0x485429[_0xbc57('0x1a')]?_0x485429[_0xbc57('0x1a')][_0xbc57('0x1b')]===undefined?!![]:![]:!![]})[_0xbc57('0x1c')](function(_0x44deca){logger[_0xbc57('0xf')](_0xbc57('0x17'),_0x485429);logger[_0xbc57('0x11')](_0xbc57('0x17'),_0x485429,JSON[_0xbc57('0x1d')](_0x44deca));_0x1a8536(_0x44deca);})['catch'](function(_0x271825){logger['error'](_0xbc57('0x17'),_0x271825['message'],_0x485429);_0x116eea(_0x4a77cf[_0xbc57('0x13')](0x1f4,_0x271825[_0xbc57('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 56066d8..85602be 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 _0x3e12=['save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x234661,_0x335c87){var _0x1b6d08=function(_0x3c89dd){while(--_0x3c89dd){_0x234661['push'](_0x234661['shift']());}};_0x1b6d08(++_0x335c87);}(_0x3e12,0x180));var _0x23e1=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0x3e12[_0xbbfe59];return _0x28a2a4;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x23e1('0x0'),_0x23e1('0x1'),_0x23e1('0x2')];function createListener(_0x5535f1,_0x47baf2){return function(_0x5abea1){_0x47baf2[_0x23e1('0x3')](_0x5535f1,_0x5abea1);};}function removeListener(_0xa74673,_0x413262){return function(){SmsMessageEvents[_0x23e1('0x4')](_0xa74673,_0x413262);};}exports[_0x23e1('0x5')]=function(_0x262610){for(var _0x3d5075=0x0,_0x5e784d=events[_0x23e1('0x6')];_0x3d5075<_0x5e784d;_0x3d5075++){var _0x54c19a=events[_0x3d5075];var _0x203b15=createListener(_0x23e1('0x7')+_0x54c19a,_0x262610);SmsMessageEvents['on'](_0x54c19a,_0x203b15);}}; \ No newline at end of file +var _0x4029=['./smsMessage.events','save','remove','update','emit','register','length','smsMessage:'];(function(_0x3e0d8b,_0x394db3){var _0x323aad=function(_0x377aa9){while(--_0x377aa9){_0x3e0d8b['push'](_0x3e0d8b['shift']());}};_0x323aad(++_0x394db3);}(_0x4029,0x160));var _0x9402=function(_0x8d672b,_0x590368){_0x8d672b=_0x8d672b-0x0;var _0xdd43f=_0x4029[_0x8d672b];return _0xdd43f;};'use strict';var SmsMessageEvents=require(_0x9402('0x0'));var events=[_0x9402('0x1'),_0x9402('0x2'),_0x9402('0x3')];function createListener(_0x1ec535,_0x3785e9){return function(_0x619574){_0x3785e9[_0x9402('0x4')](_0x1ec535,_0x619574);};}function removeListener(_0x51f656,_0x44cc7a){return function(){SmsMessageEvents['removeListener'](_0x51f656,_0x44cc7a);};}exports[_0x9402('0x5')]=function(_0x1e89c8){for(var _0x1e82ca=0x0,_0x3adef3=events[_0x9402('0x6')];_0x1e82ca<_0x3adef3;_0x1e82ca++){var _0x4cd65e=events[_0x1e82ca];var _0x51367a=createListener(_0x9402('0x7')+_0x4cd65e,_0x1e89c8);SmsMessageEvents['on'](_0x4cd65e,_0x51367a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ed4166e..fa81371 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 _0xb50f=['post','create','addAgents','put','update','destroy','/:id/teams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','index','isAuthenticated','/:id','/:id/members','getTeams','/:id/users','getAgents'];(function(_0x2cd6e4,_0x36918a){var _0x3eb019=function(_0x40d8d0){while(--_0x40d8d0){_0x2cd6e4['push'](_0x2cd6e4['shift']());}};_0x3eb019(++_0x36918a);}(_0xb50f,0x1c3));var _0xfb50=function(_0x207bdf,_0x5b3c13){_0x207bdf=_0x207bdf-0x0;var _0x1f93f3=_0xb50f[_0x207bdf];return _0x1f93f3;};'use strict';var multer=require(_0xfb50('0x0'));var util=require(_0xfb50('0x1'));var path=require(_0xfb50('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb50('0x3'));var router=express[_0xfb50('0x4')]();var fs_extra=require(_0xfb50('0x5'));var auth=require(_0xfb50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb50('0x7'));var controller=require(_0xfb50('0x8'));router[_0xfb50('0x9')]('/',auth['isAuthenticated'](),controller[_0xfb50('0xa')]);router[_0xfb50('0x9')]('/describe',auth[_0xfb50('0xb')](),controller['describe']);router['get'](_0xfb50('0xc'),auth[_0xfb50('0xb')](),controller['show']);router[_0xfb50('0x9')](_0xfb50('0xd'),auth[_0xfb50('0xb')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xfb50('0xb')](),controller[_0xfb50('0xe')]);router['get'](_0xfb50('0xf'),auth[_0xfb50('0xb')](),controller[_0xfb50('0x10')]);router[_0xfb50('0x11')]('/',auth[_0xfb50('0xb')](),controller[_0xfb50('0x12')]);router[_0xfb50('0x11')]('/:id/teams',auth[_0xfb50('0xb')](),controller['addTeams']);router[_0xfb50('0x11')](_0xfb50('0xf'),auth[_0xfb50('0xb')](),controller[_0xfb50('0x13')]);router[_0xfb50('0x14')]('/:id',auth[_0xfb50('0xb')](),controller[_0xfb50('0x15')]);router['delete'](_0xfb50('0xc'),auth[_0xfb50('0xb')](),controller[_0xfb50('0x16')]);router['delete'](_0xfb50('0x17'),auth[_0xfb50('0xb')](),controller['removeTeams']);router['delete'](_0xfb50('0xf'),auth[_0xfb50('0xb')](),controller[_0xfb50('0x18')]);module[_0xfb50('0x19')]=router; \ No newline at end of file +var _0x61b6=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete'];(function(_0x1c1c7b,_0x2a8416){var _0x1b17e3=function(_0x4f7bd5){while(--_0x4f7bd5){_0x1c1c7b['push'](_0x1c1c7b['shift']());}};_0x1b17e3(++_0x2a8416);}(_0x61b6,0x1e0));var _0x661b=function(_0x546add,_0x261c01){_0x546add=_0x546add-0x0;var _0x45694a=_0x61b6[_0x546add];return _0x45694a;};'use strict';var multer=require(_0x661b('0x0'));var util=require(_0x661b('0x1'));var path=require(_0x661b('0x2'));var timeout=require(_0x661b('0x3'));var express=require(_0x661b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x661b('0x5'));var config=require(_0x661b('0x6'));var controller=require('./smsQueue.controller');router[_0x661b('0x7')]('/',auth[_0x661b('0x8')](),controller['index']);router[_0x661b('0x7')](_0x661b('0x9'),auth['isAuthenticated'](),controller[_0x661b('0xa')]);router['get'](_0x661b('0xb'),auth['isAuthenticated'](),controller[_0x661b('0xc')]);router[_0x661b('0x7')]('/:id/members',auth[_0x661b('0x8')](),controller['getMembers']);router[_0x661b('0x7')](_0x661b('0xd'),auth[_0x661b('0x8')](),controller[_0x661b('0xe')]);router[_0x661b('0x7')](_0x661b('0xf'),auth['isAuthenticated'](),controller[_0x661b('0x10')]);router[_0x661b('0x11')]('/',auth[_0x661b('0x8')](),controller[_0x661b('0x12')]);router[_0x661b('0x11')](_0x661b('0xd'),auth[_0x661b('0x8')](),controller[_0x661b('0x13')]);router[_0x661b('0x11')](_0x661b('0xf'),auth[_0x661b('0x8')](),controller[_0x661b('0x14')]);router[_0x661b('0x15')](_0x661b('0xb'),auth[_0x661b('0x8')](),controller[_0x661b('0x16')]);router[_0x661b('0x17')](_0x661b('0xb'),auth[_0x661b('0x8')](),controller[_0x661b('0x18')]);router[_0x661b('0x17')](_0x661b('0xd'),auth[_0x661b('0x8')](),controller[_0x661b('0x19')]);router['delete'](_0x661b('0xf'),auth[_0x661b('0x8')](),controller[_0x661b('0x1a')]);module[_0x661b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 221c8d2..532e6c4 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 _0x7ea2=['sequelize','exports','STRING','name','INTEGER','beepall'];(function(_0x210ee6,_0x2b3f97){var _0x37e529=function(_0x27bf1f){while(--_0x27bf1f){_0x210ee6['push'](_0x210ee6['shift']());}};_0x37e529(++_0x2b3f97);}(_0x7ea2,0x108));var _0x27ea=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x7ea2[_0xe2c95e];return _0x42ce6f;};'use strict';var Sequelize=require(_0x27ea('0x0'));module[_0x27ea('0x1')]={'name':{'type':Sequelize[_0x27ea('0x2')],'unique':_0x27ea('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x27ea('0x2')]},'timeout':{'type':Sequelize[_0x27ea('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x27ea('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x8b04=['STRING','ENUM','rrmemory','beepall','exports'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x8b04,0x95));var _0x48b0=function(_0x287080,_0xa8071c){_0x287080=_0x287080-0x0;var _0x2eba52=_0x8b04[_0x287080];return _0x2eba52;};'use strict';var Sequelize=require('sequelize');module[_0x48b0('0x0')]={'name':{'type':Sequelize[_0x48b0('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x48b0('0x2')](_0x48b0('0x3'),_0x48b0('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a4f21ac..421dba6 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 _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x7501e,_0x32ef9d){var _0x5ca577=function(_0x36d904){while(--_0x36d904){_0x7501e['push'](_0x7501e['shift']());}};_0x5ca577(++_0x32ef9d);}(_0xdb28,0x106));var _0x8db2=function(_0x5d5d05,_0x363e25){_0x5d5d05=_0x5d5d05-0x0;var _0x4c1267=_0xdb28[_0x5d5d05];return _0x4c1267;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x546f6b,_0x5620a7){var _0x3f407e=function(_0x118ab4){while(--_0x118ab4){_0x546f6b['push'](_0x546f6b['shift']());}};_0x3f407e(++_0x5620a7);}(_0x7a54,0x106));var _0x47a5=function(_0x53e98c,_0x5c7b5f){_0x53e98c=_0x53e98c-0x0;var _0x4b33b8=_0x7a54[_0x53e98c];return _0x4b33b8;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e0e769f..cc17495 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 _0x16a5=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsQueue'];(function(_0x234314,_0xf78352){var _0x33c696=function(_0x45ce5f){while(--_0x45ce5f){_0x234314['push'](_0x234314['shift']());}};_0x33c696(++_0xf78352);}(_0x16a5,0x102));var _0x516a=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0x16a5[_0x14f458];return _0x4ff2da;};'use strict';var EventEmitter=require(_0x516a('0x0'));var SmsQueue=require(_0x516a('0x1'))['db'][_0x516a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x516a('0x3')](0x0);var events={'afterCreate':_0x516a('0x4'),'afterUpdate':'update','afterDestroy':_0x516a('0x5')};function emitEvent(_0x48390f){return function(_0x24ba83,_0x25e28e,_0x219843){SmsQueueEvents[_0x516a('0x6')](_0x48390f+':'+_0x24ba83['id'],_0x24ba83);SmsQueueEvents['emit'](_0x48390f,_0x24ba83);_0x219843(null);};}for(var e in events){if(events[_0x516a('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x516a('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x99a0=['hook','events','../../mysqldb','remove','emit','hasOwnProperty'];(function(_0xc06747,_0x21be67){var _0x33cc3e=function(_0x2a902a){while(--_0x2a902a){_0xc06747['push'](_0xc06747['shift']());}};_0x33cc3e(++_0x21be67);}(_0x99a0,0x121));var _0x099a=function(_0x16ebf0,_0x28f49d){_0x16ebf0=_0x16ebf0-0x0;var _0x449e27=_0x99a0[_0x16ebf0];return _0x449e27;};'use strict';var EventEmitter=require(_0x099a('0x0'));var SmsQueue=require(_0x099a('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x099a('0x2')};function emitEvent(_0x2b5e88){return function(_0x5d6b40,_0x21d681,_0x1d3f16){SmsQueueEvents[_0x099a('0x3')](_0x2b5e88+':'+_0x5d6b40['id'],_0x5d6b40);SmsQueueEvents[_0x099a('0x3')](_0x2b5e88,_0x5d6b40);_0x1d3f16(null);};}for(var e in events){if(events[_0x099a('0x4')](e)){var event=events[e];SmsQueue[_0x099a('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 910f7e4..4fd7a33 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 _0x3ace=['bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x3ace,0x119));var _0xe3ac=function(_0x3f60f8,_0x1dcd27){_0x3f60f8=_0x3f60f8-0x0;var _0x4fb516=_0x3ace[_0x3f60f8];return _0x4fb516;};'use strict';var _=require(_0xe3ac('0x0'));var util=require(_0xe3ac('0x1'));var logger=require(_0xe3ac('0x2'))(_0xe3ac('0x3'));var moment=require(_0xe3ac('0x4'));var BPromise=require(_0xe3ac('0x5'));var rp=require(_0xe3ac('0x6'));var fs=require('fs');var path=require(_0xe3ac('0x7'));var rimraf=require(_0xe3ac('0x8'));var config=require('../../config/environment');var attributes=require(_0xe3ac('0x9'));module[_0xe3ac('0xa')]=function(_0x10ac91,_0x5c7f55){return _0x10ac91[_0xe3ac('0xb')](_0xe3ac('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcac5=['path','./smsQueue.attributes','exports','SmsQueue','lodash','util','api','moment','request-promise'];(function(_0x5030a4,_0x897564){var _0x34594e=function(_0x13d1e5){while(--_0x13d1e5){_0x5030a4['push'](_0x5030a4['shift']());}};_0x34594e(++_0x897564);}(_0xcac5,0x1d8));var _0x5cac=function(_0xeaade3,_0x16eae5){_0xeaade3=_0xeaade3-0x0;var _0x5504ab=_0xcac5[_0xeaade3];return _0x5504ab;};'use strict';var _=require(_0x5cac('0x0'));var util=require(_0x5cac('0x1'));var logger=require('../../config/logger')(_0x5cac('0x2'));var moment=require(_0x5cac('0x3'));var BPromise=require('bluebird');var rp=require(_0x5cac('0x4'));var fs=require('fs');var path=require(_0x5cac('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5cac('0x6'));module[_0x5cac('0x7')]=function(_0x40a1f7,_0x39e19a){return _0x40a1f7['define'](_0x5cac('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 245c155..bb07bf1 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 _0xc5a0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','limit','include','model','attributes','map','ShowSmsQueue','find','raw','then','lodash','util','moment','bluebird'];(function(_0x352e59,_0x2cf9ca){var _0x22ba56=function(_0x9ef78d){while(--_0x9ef78d){_0x352e59['push'](_0x352e59['shift']());}};_0x22ba56(++_0x2cf9ca);}(_0xc5a0,0xf8));var _0x0c5a=function(_0x36fa66,_0xd40ba){_0x36fa66=_0x36fa66-0x0;var _0x53bf09=_0xc5a0[_0x36fa66];return _0x53bf09;};'use strict';var _=require(_0x0c5a('0x0'));var util=require(_0x0c5a('0x1'));var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var rs=require(_0x0c5a('0x4'));var fs=require('fs');var Redis=require(_0x0c5a('0x5'));var db=require(_0x0c5a('0x6'))['db'];var utils=require(_0x0c5a('0x7'));var logger=require(_0x0c5a('0x8'))(_0x0c5a('0x9'));var config=require(_0x0c5a('0xa'));var jayson=require(_0x0c5a('0xb'));var client=jayson['client'][_0x0c5a('0xc')]({'port':0x232a});config[_0x0c5a('0xd')]=_['defaults'](config[_0x0c5a('0xd')],{'host':_0x0c5a('0xe'),'port':0x18eb});var socket=require(_0x0c5a('0xf'))(new Redis(config[_0x0c5a('0xd')]));require(_0x0c5a('0x10'))[_0x0c5a('0x11')](socket);function respondWithRpcPromise(_0x312482,_0x1d2c86,_0x31ad19){return new BPromise(function(_0x58d8dd,_0x1f4d07){return client[_0x0c5a('0x12')](_0x312482,_0x31ad19)['then'](function(_0x4ff30e){logger[_0x0c5a('0x13')](_0x0c5a('0x14'),_0x1d2c86,'request\x20sent');logger[_0x0c5a('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1d2c86,_0x0c5a('0x16'),JSON[_0x0c5a('0x17')](_0x4ff30e));if(_0x4ff30e[_0x0c5a('0x18')]){if(_0x4ff30e[_0x0c5a('0x18')][_0x0c5a('0x19')]===0x1f4){logger['error'](_0x0c5a('0x14'),_0x1d2c86,_0x4ff30e[_0x0c5a('0x18')][_0x0c5a('0x1a')]);return _0x1f4d07(_0x4ff30e[_0x0c5a('0x18')]['message']);}logger[_0x0c5a('0x18')](_0x0c5a('0x14'),_0x1d2c86,_0x4ff30e[_0x0c5a('0x18')][_0x0c5a('0x1a')]);return _0x58d8dd(_0x4ff30e['error'][_0x0c5a('0x1a')]);}else{logger[_0x0c5a('0x13')](_0x0c5a('0x14'),_0x1d2c86,_0x0c5a('0x16'));_0x58d8dd(_0x4ff30e[_0x0c5a('0x1b')][_0x0c5a('0x1a')]);}})[_0x0c5a('0x1c')](function(_0x171524){logger[_0x0c5a('0x18')](_0x0c5a('0x14'),_0x1d2c86,_0x171524);_0x1f4d07(_0x171524);});});}exports[_0x0c5a('0x1d')]=function(_0x13b94c){var _0x3e5d35=this;return new Promise(function(_0x1088fc,_0x118e60){return db[_0x0c5a('0x1e')][_0x0c5a('0x1f')]({'raw':_0x13b94c[_0x0c5a('0x20')]?_0x13b94c[_0x0c5a('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x13b94c[_0x0c5a('0x20')]?_0x13b94c[_0x0c5a('0x20')]['where']||null:null,'attributes':_0x13b94c[_0x0c5a('0x20')]?_0x13b94c[_0x0c5a('0x20')]['attributes']||null:null,'limit':_0x13b94c['options']?_0x13b94c['options'][_0x0c5a('0x21')]||null:null,'include':_0x13b94c['options']?_0x13b94c[_0x0c5a('0x20')][_0x0c5a('0x22')]?_['map'](_0x13b94c[_0x0c5a('0x20')]['include'],function(_0x5eda3e){return{'model':db[_0x5eda3e[_0x0c5a('0x23')]],'as':_0x5eda3e['as'],'attributes':_0x5eda3e[_0x0c5a('0x24')],'include':_0x5eda3e['include']?_[_0x0c5a('0x25')](_0x5eda3e[_0x0c5a('0x22')],function(_0x23a563){return{'model':db[_0x23a563[_0x0c5a('0x23')]],'as':_0x23a563['as'],'attributes':_0x23a563[_0x0c5a('0x24')],'include':_0x23a563['include']?_[_0x0c5a('0x25')](_0x23a563[_0x0c5a('0x22')],function(_0x3ad3cb){return{'model':db[_0x3ad3cb[_0x0c5a('0x23')]],'as':_0x3ad3cb['as'],'attributes':_0x3ad3cb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xdc2e6d){logger[_0x0c5a('0x13')](_0x0c5a('0x1d'),_0x13b94c);logger[_0x0c5a('0x15')]('GetSmsQueue',_0x13b94c,JSON[_0x0c5a('0x17')](_0xdc2e6d));_0x1088fc(_0xdc2e6d);})['catch'](function(_0x40a0bd){logger[_0x0c5a('0x18')]('GetSmsQueue',_0x40a0bd[_0x0c5a('0x1a')],_0x13b94c);_0x118e60(_0x3e5d35[_0x0c5a('0x18')](0x1f4,_0x40a0bd['message']));});});};exports[_0x0c5a('0x26')]=function(_0x173127){var _0x22d3bf=this;return new Promise(function(_0x227719,_0x41a22a){return db[_0x0c5a('0x1e')][_0x0c5a('0x27')]({'raw':_0x173127[_0x0c5a('0x20')]?_0x173127[_0x0c5a('0x20')][_0x0c5a('0x28')]===undefined?!![]:![]:!![],'where':_0x173127['options']?_0x173127['options']['where']||null:null,'attributes':_0x173127['options']?_0x173127[_0x0c5a('0x20')][_0x0c5a('0x24')]||null:null,'include':_0x173127['options']?_0x173127[_0x0c5a('0x20')][_0x0c5a('0x22')]?_[_0x0c5a('0x25')](_0x173127['options'][_0x0c5a('0x22')],function(_0x4d6a8a){return{'model':db[_0x4d6a8a[_0x0c5a('0x23')]],'as':_0x4d6a8a['as'],'attributes':_0x4d6a8a[_0x0c5a('0x24')],'include':_0x4d6a8a[_0x0c5a('0x22')]?_[_0x0c5a('0x25')](_0x4d6a8a[_0x0c5a('0x22')],function(_0x37f799){return{'model':db[_0x37f799[_0x0c5a('0x23')]],'as':_0x37f799['as'],'attributes':_0x37f799[_0x0c5a('0x24')],'include':_0x37f799['include']?_['map'](_0x37f799[_0x0c5a('0x22')],function(_0x1729ad){return{'model':db[_0x1729ad[_0x0c5a('0x23')]],'as':_0x1729ad['as'],'attributes':_0x1729ad[_0x0c5a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0c5a('0x29')](function(_0x12829d){logger[_0x0c5a('0x13')](_0x0c5a('0x26'),_0x173127);logger[_0x0c5a('0x15')](_0x0c5a('0x26'),_0x173127,JSON['stringify'](_0x12829d));_0x227719(_0x12829d);})[_0x0c5a('0x1c')](function(_0x2e9ba9){logger[_0x0c5a('0x18')]('ShowSmsQueue',_0x2e9ba9['message'],_0x173127);_0x41a22a(_0x22d3bf['error'](0x1f4,_0x2e9ba9[_0x0c5a('0x1a')]));});});}; \ No newline at end of file +var _0xdc25=['jayson/promise','http','redis','defaults','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','then','debug','catch','ShowSmsQueue','find','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdc25,0x1cd));var _0x5dc2=function(_0x39e06f,_0x9a2555){_0x39e06f=_0x39e06f-0x0;var _0x389749=_0xdc25[_0x39e06f];return _0x389749;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5dc2('0x4'));var logger=require(_0x5dc2('0x5'))(_0x5dc2('0x6'));var config=require('../../config/environment');var jayson=require(_0x5dc2('0x7'));var client=jayson['client'][_0x5dc2('0x8')]({'port':0x232a});config[_0x5dc2('0x9')]=_[_0x5dc2('0xa')](config[_0x5dc2('0x9')],{'host':_0x5dc2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dc2('0x9')]));require(_0x5dc2('0xc'))[_0x5dc2('0xd')](socket);function respondWithRpcPromise(_0x27b7ad,_0x2c43d0,_0x422e0f){return new BPromise(function(_0x43d3b2,_0x48907e){return client[_0x5dc2('0xe')](_0x27b7ad,_0x422e0f)['then'](function(_0x355ee4){logger[_0x5dc2('0xf')](_0x5dc2('0x10'),_0x2c43d0,_0x5dc2('0x11'));logger['debug'](_0x5dc2('0x12'),_0x2c43d0,_0x5dc2('0x11'),JSON[_0x5dc2('0x13')](_0x355ee4));if(_0x355ee4[_0x5dc2('0x14')]){if(_0x355ee4[_0x5dc2('0x14')][_0x5dc2('0x15')]===0x1f4){logger[_0x5dc2('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2c43d0,_0x355ee4[_0x5dc2('0x14')][_0x5dc2('0x16')]);return _0x48907e(_0x355ee4[_0x5dc2('0x14')][_0x5dc2('0x16')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x2c43d0,_0x355ee4[_0x5dc2('0x14')][_0x5dc2('0x16')]);return _0x43d3b2(_0x355ee4[_0x5dc2('0x14')][_0x5dc2('0x16')]);}else{logger[_0x5dc2('0xf')](_0x5dc2('0x10'),_0x2c43d0,'request\x20sent');_0x43d3b2(_0x355ee4[_0x5dc2('0x17')]['message']);}})['catch'](function(_0x487c26){logger[_0x5dc2('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2c43d0,_0x487c26);_0x48907e(_0x487c26);});});}exports[_0x5dc2('0x18')]=function(_0x1f7d72){var _0x251f44=this;return new Promise(function(_0x400537,_0x5e237f){return db[_0x5dc2('0x19')][_0x5dc2('0x1a')]({'raw':_0x1f7d72[_0x5dc2('0x1b')]?_0x1f7d72[_0x5dc2('0x1b')][_0x5dc2('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f7d72[_0x5dc2('0x1b')]?_0x1f7d72[_0x5dc2('0x1b')][_0x5dc2('0x1d')]||null:null,'attributes':_0x1f7d72[_0x5dc2('0x1b')]?_0x1f7d72[_0x5dc2('0x1b')][_0x5dc2('0x1e')]||null:null,'limit':_0x1f7d72[_0x5dc2('0x1b')]?_0x1f7d72[_0x5dc2('0x1b')]['limit']||null:null,'include':_0x1f7d72[_0x5dc2('0x1b')]?_0x1f7d72['options'][_0x5dc2('0x1f')]?_[_0x5dc2('0x20')](_0x1f7d72[_0x5dc2('0x1b')][_0x5dc2('0x1f')],function(_0x5f4a12){return{'model':db[_0x5f4a12['model']],'as':_0x5f4a12['as'],'attributes':_0x5f4a12[_0x5dc2('0x1e')],'include':_0x5f4a12[_0x5dc2('0x1f')]?_[_0x5dc2('0x20')](_0x5f4a12[_0x5dc2('0x1f')],function(_0x64b308){return{'model':db[_0x64b308[_0x5dc2('0x21')]],'as':_0x64b308['as'],'attributes':_0x64b308['attributes'],'include':_0x64b308[_0x5dc2('0x1f')]?_[_0x5dc2('0x20')](_0x64b308['include'],function(_0x43db97){return{'model':db[_0x43db97['model']],'as':_0x43db97['as'],'attributes':_0x43db97[_0x5dc2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0x22')](function(_0x353231){logger[_0x5dc2('0xf')](_0x5dc2('0x18'),_0x1f7d72);logger[_0x5dc2('0x23')](_0x5dc2('0x18'),_0x1f7d72,JSON[_0x5dc2('0x13')](_0x353231));_0x400537(_0x353231);})[_0x5dc2('0x24')](function(_0x5a4a12){logger[_0x5dc2('0x14')](_0x5dc2('0x18'),_0x5a4a12[_0x5dc2('0x16')],_0x1f7d72);_0x5e237f(_0x251f44['error'](0x1f4,_0x5a4a12[_0x5dc2('0x16')]));});});};exports[_0x5dc2('0x25')]=function(_0x10d26a){var _0x139f87=this;return new Promise(function(_0x397aa9,_0x3b3f98){return db[_0x5dc2('0x19')][_0x5dc2('0x26')]({'raw':_0x10d26a['options']?_0x10d26a['options']['raw']===undefined?!![]:![]:!![],'where':_0x10d26a[_0x5dc2('0x1b')]?_0x10d26a[_0x5dc2('0x1b')][_0x5dc2('0x1d')]||null:null,'attributes':_0x10d26a[_0x5dc2('0x1b')]?_0x10d26a['options'][_0x5dc2('0x1e')]||null:null,'include':_0x10d26a[_0x5dc2('0x1b')]?_0x10d26a[_0x5dc2('0x1b')][_0x5dc2('0x1f')]?_[_0x5dc2('0x20')](_0x10d26a['options'][_0x5dc2('0x1f')],function(_0x1bc081){return{'model':db[_0x1bc081[_0x5dc2('0x21')]],'as':_0x1bc081['as'],'attributes':_0x1bc081['attributes'],'include':_0x1bc081[_0x5dc2('0x1f')]?_['map'](_0x1bc081[_0x5dc2('0x1f')],function(_0x41280e){return{'model':db[_0x41280e['model']],'as':_0x41280e['as'],'attributes':_0x41280e['attributes'],'include':_0x41280e[_0x5dc2('0x1f')]?_['map'](_0x41280e[_0x5dc2('0x1f')],function(_0x28e35e){return{'model':db[_0x28e35e[_0x5dc2('0x21')]],'as':_0x28e35e['as'],'attributes':_0x28e35e[_0x5dc2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0x22')](function(_0x2c6732){logger[_0x5dc2('0xf')](_0x5dc2('0x25'),_0x10d26a);logger['debug'](_0x5dc2('0x25'),_0x10d26a,JSON[_0x5dc2('0x13')](_0x2c6732));_0x397aa9(_0x2c6732);})['catch'](function(_0x195654){logger['error'](_0x5dc2('0x25'),_0x195654[_0x5dc2('0x16')],_0x10d26a);_0x3b3f98(_0x139f87[_0x5dc2('0x14')](0x1f4,_0x195654[_0x5dc2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 495cd14..6647c52 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 _0xa4fe=['remove','update','emit','removeListener','length','./smsQueue.events','save'];(function(_0x130280,_0x4698e7){var _0x270a09=function(_0x185cda){while(--_0x185cda){_0x130280['push'](_0x130280['shift']());}};_0x270a09(++_0x4698e7);}(_0xa4fe,0x178));var _0xea4f=function(_0x2c14c7,_0x4988c1){_0x2c14c7=_0x2c14c7-0x0;var _0x59b4d1=_0xa4fe[_0x2c14c7];return _0x59b4d1;};'use strict';var SmsQueueEvents=require(_0xea4f('0x0'));var events=[_0xea4f('0x1'),_0xea4f('0x2'),_0xea4f('0x3')];function createListener(_0x2ab5c2,_0x3ef162){return function(_0x153cbf){_0x3ef162[_0xea4f('0x4')](_0x2ab5c2,_0x153cbf);};}function removeListener(_0x54129d,_0x57980b){return function(){SmsQueueEvents[_0xea4f('0x5')](_0x54129d,_0x57980b);};}exports['register']=function(_0x1fde1d){for(var _0x19ec4d=0x0,_0x277767=events[_0xea4f('0x6')];_0x19ec4d<_0x277767;_0x19ec4d++){var _0x4a75ac=events[_0x19ec4d];var _0x27cae3=createListener('smsQueue:'+_0x4a75ac,_0x1fde1d);SmsQueueEvents['on'](_0x4a75ac,_0x27cae3);}}; \ No newline at end of file +var _0xb7a1=['./smsQueue.events','remove','update','emit','removeListener','length'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0xb7a1,0xd2));var _0x1b7a=function(_0x1fb6b1,_0xe802db){_0x1fb6b1=_0x1fb6b1-0x0;var _0x39d305=_0xb7a1[_0x1fb6b1];return _0x39d305;};'use strict';var SmsQueueEvents=require(_0x1b7a('0x0'));var events=['save',_0x1b7a('0x1'),_0x1b7a('0x2')];function createListener(_0x4cc763,_0x203f84){return function(_0x3f7ae9){_0x203f84[_0x1b7a('0x3')](_0x4cc763,_0x3f7ae9);};}function removeListener(_0x187838,_0x6eec9c){return function(){SmsQueueEvents[_0x1b7a('0x4')](_0x187838,_0x6eec9c);};}exports['register']=function(_0x10a5e5){for(var _0x4f08dd=0x0,_0x25f832=events[_0x1b7a('0x5')];_0x4f08dd<_0x25f832;_0x4f08dd++){var _0x54b334=events[_0x4f08dd];var _0x2529d2=createListener('smsQueue:'+_0x54b334,_0x10a5e5);SmsQueueEvents['on'](_0x54b334,_0x2529d2);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b1cc209..f079991 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 _0x0967=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','exports','multer','connect-timeout','express','fs-extra'];(function(_0x182631,_0x3cf341){var _0x1e365e=function(_0x13d95e){while(--_0x13d95e){_0x182631['push'](_0x182631['shift']());}};_0x1e365e(++_0x3cf341);}(_0x0967,0x173));var _0x7096=function(_0x586288,_0x5576eb){_0x586288=_0x586288-0x0;var _0x3cb4f1=_0x0967[_0x586288];return _0x3cb4f1;};'use strict';var multer=require(_0x7096('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7096('0x1'));var express=require(_0x7096('0x2'));var router=express['Router']();var fs_extra=require(_0x7096('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7096('0x4'));var controller=require(_0x7096('0x5'));router[_0x7096('0x6')]('/',auth[_0x7096('0x7')](),controller['index']);router[_0x7096('0x6')](_0x7096('0x8'),auth[_0x7096('0x7')](),controller[_0x7096('0x9')]);router[_0x7096('0x6')](_0x7096('0xa'),auth[_0x7096('0x7')](),controller['show']);router[_0x7096('0xb')]('/',auth[_0x7096('0x7')](),controller[_0x7096('0xc')]);router[_0x7096('0xd')](_0x7096('0xa'),auth[_0x7096('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7096('0xe')]=router; \ No newline at end of file +var _0x0852=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','path'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x0852,0x108));var _0x2085=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0852[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x2085('0x0'));var util=require('util');var path=require(_0x2085('0x1'));var timeout=require(_0x2085('0x2'));var express=require('express');var router=express[_0x2085('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2085('0x4'));var interaction=require(_0x2085('0x5'));var config=require(_0x2085('0x6'));var controller=require('./smsQueueReport.controller');router[_0x2085('0x7')]('/',auth['isAuthenticated'](),controller[_0x2085('0x8')]);router[_0x2085('0x7')](_0x2085('0x9'),auth[_0x2085('0xa')](),controller[_0x2085('0xb')]);router['get'](_0x2085('0xc'),auth[_0x2085('0xa')](),controller['show']);router[_0x2085('0xd')]('/',auth[_0x2085('0xa')](),controller[_0x2085('0xe')]);router[_0x2085('0xf')](_0x2085('0xc'),auth[_0x2085('0xa')](),controller[_0x2085('0x10')]);router[_0x2085('0x11')](_0x2085('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2085('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index ffd5be6..dd5b83c 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 _0xde39=['STRING','DATE','moment','sequelize'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xde39,0x15e));var _0x9de3=function(_0x381d3c,_0x4bc7d0){_0x381d3c=_0x381d3c-0x0;var _0x12542e=_0xde39[_0x381d3c];return _0x12542e;};'use strict';var moment=require(_0x9de3('0x0'));var Sequelize=require(_0x9de3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9de3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9de3('0x2')]},'joinAt':{'type':Sequelize[_0x9de3('0x3')]},'leaveAt':{'type':Sequelize[_0x9de3('0x3')]},'acceptAt':{'type':Sequelize[_0x9de3('0x3')]},'exitAt':{'type':Sequelize[_0x9de3('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1db9=['sequelize','exports','STRING','DATE','moment'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x1db9,0x176));var _0x91db=function(_0x359110,_0x105af4){_0x359110=_0x359110-0x0;var _0x5d3edf=_0x1db9[_0x359110];return _0x5d3edf;};'use strict';var moment=require(_0x91db('0x0'));var Sequelize=require(_0x91db('0x1'));module[_0x91db('0x2')]={'uniqueid':{'type':Sequelize[_0x91db('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x91db('0x3')]},'joinAt':{'type':Sequelize[_0x91db('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x91db('0x4')]},'exitAt':{'type':Sequelize[_0x91db('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 26bf74d..fa83e0a 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 _0x058f=['index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','VIRTUAL','filter','merge','count','include','findAll','catch','show','params','includeAll','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x136dbb,_0x2b0666){var _0x6a5309=function(_0x2635af){while(--_0x2635af){_0x136dbb['push'](_0x136dbb['shift']());}};_0x6a5309(++_0x2b0666);}(_0x058f,0xc5));var _0xf058=function(_0x188785,_0x2dd92a){_0x188785=_0x188785-0x0;var _0x368290=_0x058f[_0x188785];return _0x368290;};'use strict';var emlformat=require(_0xf058('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf058('0x1'));var jsonpatch=require(_0xf058('0x2'));var rp=require(_0xf058('0x3'));var moment=require(_0xf058('0x4'));var BPromise=require(_0xf058('0x5'));var Mustache=require(_0xf058('0x6'));var util=require('util');var path=require(_0xf058('0x7'));var sox=require('sox');var csv=require(_0xf058('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf058('0x9'));var _=require(_0xf058('0xa'));var squel=require(_0xf058('0xb'));var crypto=require(_0xf058('0xc'));var jsforce=require(_0xf058('0xd'));var deskjs=require(_0xf058('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf058('0xf'));var Redis=require(_0xf058('0x10'));var authService=require(_0xf058('0x11'));var qs=require(_0xf058('0x12'));var as=require(_0xf058('0x13'));var hardwareService=require(_0xf058('0x14'));var logger=require(_0xf058('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf058('0x16'));var licenseUtil=require(_0xf058('0x17'));var db=require(_0xf058('0x18'))['db'];function respondWithStatusCode(_0x11bbaf,_0x4f6c08){_0x4f6c08=_0x4f6c08||0xcc;return function(_0x1e7333){if(_0x1e7333){return _0x11bbaf[_0xf058('0x19')](_0x4f6c08);}return _0x11bbaf[_0xf058('0x1a')](_0x4f6c08)['end']();};}function respondWithResult(_0x2bdbe9,_0x3eafa8){_0x3eafa8=_0x3eafa8||0xc8;return function(_0xb79502){if(_0xb79502){return _0x2bdbe9['status'](_0x3eafa8)[_0xf058('0x1b')](_0xb79502);}};}function respondWithFilteredResult(_0x39781e,_0xc5cb49){return function(_0x21a9c3){if(_0x21a9c3){var _0x373005=typeof _0xc5cb49['offset']===_0xf058('0x1c')&&typeof _0xc5cb49['limit']===_0xf058('0x1c');var _0xdd31c6=_0x21a9c3['count'];var _0x39d0ae=_0x373005?0x0:_0xc5cb49['offset'];var _0x37d7ef=_0x373005?_0x21a9c3['count']:_0xc5cb49['offset']+_0xc5cb49[_0xf058('0x1d')];var _0x399ccc;if(_0x37d7ef>=_0xdd31c6){_0x37d7ef=_0xdd31c6;_0x399ccc=0xc8;}else{_0x399ccc=0xce;}_0x39781e[_0xf058('0x1a')](_0x399ccc);return _0x39781e[_0xf058('0x1e')](_0xf058('0x1f'),_0x39d0ae+'-'+_0x37d7ef+'/'+_0xdd31c6)[_0xf058('0x1b')](_0x21a9c3);}return null;};}function patchUpdates(_0x4d2f52){return function(_0x6631fc){try{jsonpatch[_0xf058('0x20')](_0x6631fc,_0x4d2f52,!![]);}catch(_0x2565dd){return BPromise[_0xf058('0x21')](_0x2565dd);}return _0x6631fc[_0xf058('0x22')]();};}function saveUpdates(_0x424db0,_0x1d6a30){return function(_0x2baf91){if(_0x2baf91){return _0x2baf91[_0xf058('0x23')](_0x424db0)[_0xf058('0x24')](function(_0x3fe7a2){return _0x3fe7a2;});}return null;};}function removeEntity(_0x1bf66e,_0x36ffc5){return function(_0x177aa3){if(_0x177aa3){return _0x177aa3[_0xf058('0x25')]()[_0xf058('0x24')](function(){_0x1bf66e[_0xf058('0x1a')](0xcc)[_0xf058('0x26')]();});}};}function handleEntityNotFound(_0x199cbf,_0xad0eaa){return function(_0x11fe17){if(!_0x11fe17){_0x199cbf['sendStatus'](0x194);}return _0x11fe17;};}function handleError(_0x258d38,_0x328df3){_0x328df3=_0x328df3||0x1f4;return function(_0x5eb088){logger[_0xf058('0x27')](_0x5eb088[_0xf058('0x28')]);if(_0x5eb088['name']){delete _0x5eb088[_0xf058('0x29')];}_0x258d38[_0xf058('0x1a')](_0x328df3)[_0xf058('0x2a')](_0x5eb088);};}exports[_0xf058('0x2b')]=function(_0x35c28a,_0x3e3bd0){var _0x2f2dd9={},_0x1f189a={},_0x172f5d={'count':0x0,'rows':[]};var _0x462d6e=_[_0xf058('0x2c')](db[_0xf058('0x2d')][_0xf058('0x2e')],function(_0x5149cd){return{'name':_0x5149cd[_0xf058('0x2f')],'type':_0x5149cd[_0xf058('0x30')][_0xf058('0x31')]};});_0x1f189a[_0xf058('0x32')]=_[_0xf058('0x2c')](_0x462d6e,_0xf058('0x29'));_0x1f189a[_0xf058('0x33')]=_[_0xf058('0x34')](_0x35c28a[_0xf058('0x33')]);_0x1f189a['filters']=_[_0xf058('0x35')](_0x1f189a['model'],_0x1f189a[_0xf058('0x33')]);_0x2f2dd9[_0xf058('0x36')]=_[_0xf058('0x35')](_0x1f189a[_0xf058('0x32')],qs[_0xf058('0x37')](_0x35c28a['query'][_0xf058('0x37')]));_0x2f2dd9[_0xf058('0x36')]=_0x2f2dd9[_0xf058('0x36')][_0xf058('0x38')]?_0x2f2dd9['attributes']:_0x1f189a['model'];if(!_0x35c28a[_0xf058('0x33')][_0xf058('0x39')](_0xf058('0x3a'))){_0x2f2dd9[_0xf058('0x1d')]=qs['limit'](_0x35c28a[_0xf058('0x33')][_0xf058('0x1d')]);_0x2f2dd9[_0xf058('0x3b')]=qs['offset'](_0x35c28a[_0xf058('0x33')][_0xf058('0x3b')]);}_0x2f2dd9[_0xf058('0x3c')]=qs[_0xf058('0x3d')](_0x35c28a[_0xf058('0x33')][_0xf058('0x3d')]);_0x2f2dd9[_0xf058('0x3e')]=qs[_0xf058('0x3f')](_[_0xf058('0x40')](_0x35c28a[_0xf058('0x33')],_0x1f189a[_0xf058('0x3f')]),_0x462d6e);if(_0x35c28a[_0xf058('0x33')]['filter']){_0x2f2dd9[_0xf058('0x3e')]=_['merge'](_0x2f2dd9[_0xf058('0x3e')],{'$or':_[_0xf058('0x2c')](_0x462d6e,function(_0x1ef2cc){if(_0x1ef2cc[_0xf058('0x30')]!==_0xf058('0x41')){var _0x285151={};_0x285151[_0x1ef2cc[_0xf058('0x29')]]={'$like':'%'+_0x35c28a[_0xf058('0x33')][_0xf058('0x42')]+'%'};return _0x285151;}})});}_0x2f2dd9=_[_0xf058('0x43')]({},_0x2f2dd9,_0x35c28a['options']);var _0x12195d={'where':_0x2f2dd9[_0xf058('0x3e')]};return db[_0xf058('0x2d')][_0xf058('0x44')](_0x12195d)['then'](function(_0x3b60ed){_0x172f5d[_0xf058('0x44')]=_0x3b60ed;if(_0x35c28a['query']['includeAll']){_0x2f2dd9[_0xf058('0x45')]=[{'all':!![]}];}return db[_0xf058('0x2d')][_0xf058('0x46')](_0x2f2dd9);})[_0xf058('0x24')](function(_0x3eb255){_0x172f5d['rows']=_0x3eb255;return _0x172f5d;})['then'](respondWithFilteredResult(_0x3e3bd0,_0x2f2dd9))[_0xf058('0x47')](handleError(_0x3e3bd0,null));};exports[_0xf058('0x48')]=function(_0x57b6f7,_0x560f68){var _0x1baeac={'raw':!![],'where':{'id':_0x57b6f7[_0xf058('0x49')]['id']}},_0x531e6d={};_0x531e6d[_0xf058('0x32')]=_['keys'](db[_0xf058('0x2d')][_0xf058('0x2e')]);_0x531e6d[_0xf058('0x33')]=_[_0xf058('0x34')](_0x57b6f7['query']);_0x531e6d['filters']=_[_0xf058('0x35')](_0x531e6d['model'],_0x531e6d[_0xf058('0x33')]);_0x1baeac[_0xf058('0x36')]=_[_0xf058('0x35')](_0x531e6d[_0xf058('0x32')],qs[_0xf058('0x37')](_0x57b6f7[_0xf058('0x33')]['fields']));_0x1baeac[_0xf058('0x36')]=_0x1baeac[_0xf058('0x36')][_0xf058('0x38')]?_0x1baeac[_0xf058('0x36')]:_0x531e6d[_0xf058('0x32')];if(_0x57b6f7[_0xf058('0x33')][_0xf058('0x4a')]){_0x1baeac['include']=[{'all':!![]}];}_0x1baeac=_[_0xf058('0x43')]({},_0x1baeac,_0x57b6f7[_0xf058('0x4b')]);return db[_0xf058('0x2d')][_0xf058('0x4c')](_0x1baeac)[_0xf058('0x24')](handleEntityNotFound(_0x560f68,null))[_0xf058('0x24')](respondWithResult(_0x560f68,null))['catch'](handleError(_0x560f68,null));};exports['create']=function(_0x3ec501,_0x227851){return db[_0xf058('0x2d')][_0xf058('0x4d')](_0x3ec501[_0xf058('0x4e')],{})['then'](respondWithResult(_0x227851,0xc9))[_0xf058('0x47')](handleError(_0x227851,null));};exports[_0xf058('0x23')]=function(_0x509fe5,_0x3d3045){if(_0x509fe5['body']['id']){delete _0x509fe5[_0xf058('0x4e')]['id'];}return db[_0xf058('0x2d')]['find']({'where':{'id':_0x509fe5[_0xf058('0x49')]['id']}})[_0xf058('0x24')](handleEntityNotFound(_0x3d3045,null))[_0xf058('0x24')](saveUpdates(_0x509fe5['body'],null))[_0xf058('0x24')](respondWithResult(_0x3d3045,null))[_0xf058('0x47')](handleError(_0x3d3045,null));};exports[_0xf058('0x25')]=function(_0x395f4b,_0x21e19e){return db['SmsQueueReport']['find']({'where':{'id':_0x395f4b[_0xf058('0x49')]['id']}})[_0xf058('0x24')](handleEntityNotFound(_0x21e19e,null))[_0xf058('0x24')](removeEntity(_0x21e19e,null))[_0xf058('0x47')](handleError(_0x21e19e,null));};exports[_0xf058('0x4f')]=function(_0x54be9c,_0x31531e){return db['SmsQueueReport'][_0xf058('0x4f')]()['then'](respondWithResult(_0x31531e,null))[_0xf058('0x47')](handleError(_0x31531e,null));}; \ No newline at end of file +var _0x5155=['count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','SmsQueueReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','map','type','VIRTUAL','merge','include','findAll','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x1fdca1,_0x22eebb){var _0x1974af=function(_0x9bc26d){while(--_0x9bc26d){_0x1fdca1['push'](_0x1fdca1['shift']());}};_0x1974af(++_0x22eebb);}(_0x5155,0xc5));var _0x5515=function(_0xa40e6e,_0x5eb1c4){_0xa40e6e=_0xa40e6e-0x0;var _0x420221=_0x5155[_0xa40e6e];return _0x420221;};'use strict';var emlformat=require(_0x5515('0x0'));var rimraf=require(_0x5515('0x1'));var zipdir=require(_0x5515('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5515('0x3'));var moment=require(_0x5515('0x4'));var BPromise=require(_0x5515('0x5'));var Mustache=require(_0x5515('0x6'));var util=require(_0x5515('0x7'));var path=require(_0x5515('0x8'));var sox=require(_0x5515('0x9'));var csv=require(_0x5515('0xa'));var ejs=require(_0x5515('0xb'));var fs=require('fs');var fs_extra=require(_0x5515('0xc'));var _=require(_0x5515('0xd'));var squel=require('squel');var crypto=require(_0x5515('0xe'));var jsforce=require(_0x5515('0xf'));var deskjs=require(_0x5515('0x10'));var toCsv=require(_0x5515('0xa'));var querystring=require('querystring');var Papa=require(_0x5515('0x11'));var Redis=require('ioredis');var authService=require(_0x5515('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5515('0x13'));var logger=require(_0x5515('0x14'))(_0x5515('0x15'));var utils=require(_0x5515('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5515('0x17'));var db=require(_0x5515('0x18'))['db'];function respondWithStatusCode(_0x49a3ee,_0x31a743){_0x31a743=_0x31a743||0xcc;return function(_0xff8295){if(_0xff8295){return _0x49a3ee['sendStatus'](_0x31a743);}return _0x49a3ee[_0x5515('0x19')](_0x31a743)[_0x5515('0x1a')]();};}function respondWithResult(_0x174ef7,_0x4a9fc6){_0x4a9fc6=_0x4a9fc6||0xc8;return function(_0x475c89){if(_0x475c89){return _0x174ef7[_0x5515('0x19')](_0x4a9fc6)[_0x5515('0x1b')](_0x475c89);}};}function respondWithFilteredResult(_0x38363f,_0x2fc817){return function(_0x218ffe){if(_0x218ffe){var _0x88cb54=typeof _0x2fc817[_0x5515('0x1c')]===_0x5515('0x1d')&&typeof _0x2fc817[_0x5515('0x1e')]===_0x5515('0x1d');var _0x9cfc77=_0x218ffe['count'];var _0x360da1=_0x88cb54?0x0:_0x2fc817[_0x5515('0x1c')];var _0x48b450=_0x88cb54?_0x218ffe[_0x5515('0x1f')]:_0x2fc817[_0x5515('0x1c')]+_0x2fc817['limit'];var _0x17109e;if(_0x48b450>=_0x9cfc77){_0x48b450=_0x9cfc77;_0x17109e=0xc8;}else{_0x17109e=0xce;}_0x38363f[_0x5515('0x19')](_0x17109e);return _0x38363f[_0x5515('0x20')](_0x5515('0x21'),_0x360da1+'-'+_0x48b450+'/'+_0x9cfc77)[_0x5515('0x1b')](_0x218ffe);}return null;};}function patchUpdates(_0x30ef0b){return function(_0x3a55fd){try{jsonpatch[_0x5515('0x22')](_0x3a55fd,_0x30ef0b,!![]);}catch(_0x139e0f){return BPromise[_0x5515('0x23')](_0x139e0f);}return _0x3a55fd[_0x5515('0x24')]();};}function saveUpdates(_0xb6dd15,_0x2eb47c){return function(_0x5955b6){if(_0x5955b6){return _0x5955b6[_0x5515('0x25')](_0xb6dd15)['then'](function(_0x225bec){return _0x225bec;});}return null;};}function removeEntity(_0x157fa9,_0x3e45b6){return function(_0xf54b4b){if(_0xf54b4b){return _0xf54b4b[_0x5515('0x26')]()[_0x5515('0x27')](function(){_0x157fa9[_0x5515('0x19')](0xcc)[_0x5515('0x1a')]();});}};}function handleEntityNotFound(_0x1885db,_0x1beaf7){return function(_0x49a30e){if(!_0x49a30e){_0x1885db[_0x5515('0x28')](0x194);}return _0x49a30e;};}function handleError(_0x1ce532,_0x2c5e32){_0x2c5e32=_0x2c5e32||0x1f4;return function(_0x48654a){logger[_0x5515('0x29')](_0x48654a[_0x5515('0x2a')]);if(_0x48654a[_0x5515('0x2b')]){delete _0x48654a[_0x5515('0x2b')];}_0x1ce532[_0x5515('0x19')](_0x2c5e32)[_0x5515('0x2c')](_0x48654a);};}exports['index']=function(_0x1f5b6,_0x145271){var _0x4c018f={},_0x3060e8={},_0x1a9e3c={'count':0x0,'rows':[]};var _0x23531=_['map'](db[_0x5515('0x2d')][_0x5515('0x2e')],function(_0x486890){return{'name':_0x486890['fieldName'],'type':_0x486890['type'][_0x5515('0x2f')]};});_0x3060e8[_0x5515('0x30')]=_['map'](_0x23531,_0x5515('0x2b'));_0x3060e8[_0x5515('0x31')]=_[_0x5515('0x32')](_0x1f5b6[_0x5515('0x31')]);_0x3060e8[_0x5515('0x33')]=_['intersection'](_0x3060e8[_0x5515('0x30')],_0x3060e8[_0x5515('0x31')]);_0x4c018f['attributes']=_[_0x5515('0x34')](_0x3060e8[_0x5515('0x30')],qs[_0x5515('0x35')](_0x1f5b6['query']['fields']));_0x4c018f[_0x5515('0x36')]=_0x4c018f[_0x5515('0x36')][_0x5515('0x37')]?_0x4c018f[_0x5515('0x36')]:_0x3060e8['model'];if(!_0x1f5b6[_0x5515('0x31')][_0x5515('0x38')](_0x5515('0x39'))){_0x4c018f[_0x5515('0x1e')]=qs[_0x5515('0x1e')](_0x1f5b6[_0x5515('0x31')][_0x5515('0x1e')]);_0x4c018f['offset']=qs[_0x5515('0x1c')](_0x1f5b6[_0x5515('0x31')][_0x5515('0x1c')]);}_0x4c018f['order']=qs['sort'](_0x1f5b6['query']['sort']);_0x4c018f[_0x5515('0x3a')]=qs[_0x5515('0x33')](_[_0x5515('0x3b')](_0x1f5b6['query'],_0x3060e8[_0x5515('0x33')]),_0x23531);if(_0x1f5b6[_0x5515('0x31')][_0x5515('0x3c')]){_0x4c018f['where']=_['merge'](_0x4c018f[_0x5515('0x3a')],{'$or':_[_0x5515('0x3d')](_0x23531,function(_0x545061){if(_0x545061[_0x5515('0x3e')]!==_0x5515('0x3f')){var _0x14a7ee={};_0x14a7ee[_0x545061[_0x5515('0x2b')]]={'$like':'%'+_0x1f5b6[_0x5515('0x31')][_0x5515('0x3c')]+'%'};return _0x14a7ee;}})});}_0x4c018f=_[_0x5515('0x40')]({},_0x4c018f,_0x1f5b6['options']);var _0x2afc7c={'where':_0x4c018f[_0x5515('0x3a')]};return db[_0x5515('0x2d')]['count'](_0x2afc7c)[_0x5515('0x27')](function(_0x3640a8){_0x1a9e3c[_0x5515('0x1f')]=_0x3640a8;if(_0x1f5b6[_0x5515('0x31')]['includeAll']){_0x4c018f[_0x5515('0x41')]=[{'all':!![]}];}return db[_0x5515('0x2d')][_0x5515('0x42')](_0x4c018f);})[_0x5515('0x27')](function(_0x234fc4){_0x1a9e3c['rows']=_0x234fc4;return _0x1a9e3c;})['then'](respondWithFilteredResult(_0x145271,_0x4c018f))[_0x5515('0x43')](handleError(_0x145271,null));};exports[_0x5515('0x44')]=function(_0x4cac16,_0x500b2f){var _0x1e0fbc={'raw':!![],'where':{'id':_0x4cac16[_0x5515('0x45')]['id']}},_0x520f94={};_0x520f94[_0x5515('0x30')]=_['keys'](db['SmsQueueReport']['rawAttributes']);_0x520f94[_0x5515('0x31')]=_[_0x5515('0x32')](_0x4cac16[_0x5515('0x31')]);_0x520f94[_0x5515('0x33')]=_[_0x5515('0x34')](_0x520f94[_0x5515('0x30')],_0x520f94['query']);_0x1e0fbc[_0x5515('0x36')]=_[_0x5515('0x34')](_0x520f94[_0x5515('0x30')],qs[_0x5515('0x35')](_0x4cac16[_0x5515('0x31')][_0x5515('0x35')]));_0x1e0fbc[_0x5515('0x36')]=_0x1e0fbc['attributes'][_0x5515('0x37')]?_0x1e0fbc[_0x5515('0x36')]:_0x520f94['model'];if(_0x4cac16[_0x5515('0x31')][_0x5515('0x46')]){_0x1e0fbc[_0x5515('0x41')]=[{'all':!![]}];}_0x1e0fbc=_['merge']({},_0x1e0fbc,_0x4cac16[_0x5515('0x47')]);return db[_0x5515('0x2d')][_0x5515('0x48')](_0x1e0fbc)[_0x5515('0x27')](handleEntityNotFound(_0x500b2f,null))[_0x5515('0x27')](respondWithResult(_0x500b2f,null))[_0x5515('0x43')](handleError(_0x500b2f,null));};exports['create']=function(_0x27521d,_0x2562b2){return db[_0x5515('0x2d')][_0x5515('0x49')](_0x27521d[_0x5515('0x4a')],{})['then'](respondWithResult(_0x2562b2,0xc9))[_0x5515('0x43')](handleError(_0x2562b2,null));};exports[_0x5515('0x25')]=function(_0x200fa7,_0x4402e9){if(_0x200fa7['body']['id']){delete _0x200fa7[_0x5515('0x4a')]['id'];}return db['SmsQueueReport'][_0x5515('0x48')]({'where':{'id':_0x200fa7[_0x5515('0x45')]['id']}})[_0x5515('0x27')](handleEntityNotFound(_0x4402e9,null))[_0x5515('0x27')](saveUpdates(_0x200fa7[_0x5515('0x4a')],null))[_0x5515('0x27')](respondWithResult(_0x4402e9,null))[_0x5515('0x43')](handleError(_0x4402e9,null));};exports[_0x5515('0x26')]=function(_0x5eda93,_0x8a9788){return db[_0x5515('0x2d')][_0x5515('0x48')]({'where':{'id':_0x5eda93[_0x5515('0x45')]['id']}})[_0x5515('0x27')](handleEntityNotFound(_0x8a9788,null))[_0x5515('0x27')](removeEntity(_0x8a9788,null))[_0x5515('0x43')](handleError(_0x8a9788,null));};exports[_0x5515('0x4b')]=function(_0x5e5cd5,_0x2b93af){return db['SmsQueueReport']['describe']()[_0x5515('0x27')](respondWithResult(_0x2b93af,null))['catch'](handleError(_0x2b93af,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 48cfa91..0175e03 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1a4246a..083f1c2 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 _0xbcbf=['info','request\x20sent','debug','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','stringify','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x25063f,_0xc59638){var _0x97e389=function(_0x3ff15c){while(--_0x3ff15c){_0x25063f['push'](_0x25063f['shift']());}};_0x97e389(++_0xc59638);}(_0xbcbf,0x122));var _0xfbcb=function(_0x10d604,_0x9cc4c5){_0x10d604=_0x10d604-0x0;var _0x303c4a=_0xbcbf[_0x10d604];return _0x303c4a;};'use strict';var _=require(_0xfbcb('0x0'));var util=require(_0xfbcb('0x1'));var moment=require('moment');var BPromise=require(_0xfbcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbcb('0x3'));var logger=require(_0xfbcb('0x4'))(_0xfbcb('0x5'));var config=require(_0xfbcb('0x6'));var jayson=require(_0xfbcb('0x7'));var client=jayson[_0xfbcb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xea7948,_0x17e1b9,_0x54bce2){return new BPromise(function(_0x54758a,_0x5ae768){return client['request'](_0xea7948,_0x54bce2)[_0xfbcb('0x9')](function(_0x3a30c3){logger[_0xfbcb('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x17e1b9,_0xfbcb('0xb'));logger[_0xfbcb('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x17e1b9,_0xfbcb('0xb'),JSON['stringify'](_0x3a30c3));if(_0x3a30c3[_0xfbcb('0xd')]){if(_0x3a30c3[_0xfbcb('0xd')][_0xfbcb('0xe')]===0x1f4){logger['error'](_0xfbcb('0xf'),_0x17e1b9,_0x3a30c3[_0xfbcb('0xd')]['message']);return _0x5ae768(_0x3a30c3[_0xfbcb('0xd')][_0xfbcb('0x10')]);}logger[_0xfbcb('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x17e1b9,_0x3a30c3[_0xfbcb('0xd')][_0xfbcb('0x10')]);return _0x54758a(_0x3a30c3['error'][_0xfbcb('0x10')]);}else{logger[_0xfbcb('0xa')](_0xfbcb('0xf'),_0x17e1b9,_0xfbcb('0xb'));_0x54758a(_0x3a30c3[_0xfbcb('0x11')][_0xfbcb('0x10')]);}})[_0xfbcb('0x12')](function(_0xee54db){logger[_0xfbcb('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x17e1b9,_0xee54db);_0x5ae768(_0xee54db);});});}exports[_0xfbcb('0x13')]=function(_0x55ff9a){var _0x5c5938=this;return new Promise(function(_0x49c22d,_0x4af013){return db['SmsQueueReport'][_0xfbcb('0x14')](_0x55ff9a[_0xfbcb('0x15')],{'raw':_0x55ff9a[_0xfbcb('0x16')]?_0x55ff9a[_0xfbcb('0x16')][_0xfbcb('0x17')]===undefined?!![]:![]:!![]})[_0xfbcb('0x9')](function(_0x29cb6f){logger['info'](_0xfbcb('0x13'),_0x55ff9a);logger[_0xfbcb('0xc')](_0xfbcb('0x13'),_0x55ff9a,JSON['stringify'](_0x29cb6f));_0x49c22d(_0x29cb6f);})[_0xfbcb('0x12')](function(_0x5566d3){logger[_0xfbcb('0xd')](_0xfbcb('0x13'),_0x5566d3['message'],_0x55ff9a);_0x4af013(_0x5c5938[_0xfbcb('0xd')](0x1f4,_0x5566d3['message']));});});};exports[_0xfbcb('0x18')]=function(_0x41008a){var _0x3e68c4=this;return new Promise(function(_0x4468d3,_0x571589){return db[_0xfbcb('0x19')][_0xfbcb('0x1a')](_0x41008a['body'],{'raw':_0x41008a[_0xfbcb('0x16')]?_0x41008a[_0xfbcb('0x16')][_0xfbcb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41008a[_0xfbcb('0x16')]?_0x41008a['options'][_0xfbcb('0x1b')]||null:null,'attributes':_0x41008a[_0xfbcb('0x16')]?_0x41008a[_0xfbcb('0x16')][_0xfbcb('0x1c')]||null:null,'limit':_0x41008a[_0xfbcb('0x16')]?_0x41008a[_0xfbcb('0x16')]['limit']||null:null})[_0xfbcb('0x9')](function(_0x58475c){logger[_0xfbcb('0xa')](_0xfbcb('0x18'),_0x41008a);logger['debug'](_0xfbcb('0x18'),_0x41008a,JSON[_0xfbcb('0x1d')](_0x58475c));_0x4468d3(_0x58475c);})['catch'](function(_0x360477){logger[_0xfbcb('0xd')](_0xfbcb('0x18'),_0x360477[_0xfbcb('0x10')],_0x41008a);_0x571589(_0x3e68c4[_0xfbcb('0xd')](0x1f4,_0x360477[_0xfbcb('0x10')]));});});}; \ No newline at end of file +var _0xfbef=['then','UpdateSmsQueueReport','update','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSmsQueueReport','create','body','options'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xfbef,0xc5));var _0xffbe=function(_0x6d099b,_0x3e388b){_0x6d099b=_0x6d099b-0x0;var _0x385c68=_0xfbef[_0x6d099b];return _0x385c68;};'use strict';var _=require(_0xffbe('0x0'));var util=require(_0xffbe('0x1'));var moment=require(_0xffbe('0x2'));var BPromise=require(_0xffbe('0x3'));var rs=require(_0xffbe('0x4'));var fs=require('fs');var Redis=require(_0xffbe('0x5'));var db=require(_0xffbe('0x6'))['db'];var utils=require(_0xffbe('0x7'));var logger=require('../../config/logger')(_0xffbe('0x8'));var config=require(_0xffbe('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xffbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf4782e,_0x6b3a7b,_0x407c44){return new BPromise(function(_0x25417c,_0x4dced3){return client[_0xffbe('0xb')](_0xf4782e,_0x407c44)['then'](function(_0x15d43e){logger[_0xffbe('0xc')](_0xffbe('0xd'),_0x6b3a7b,'request\x20sent');logger[_0xffbe('0xe')](_0xffbe('0xf'),_0x6b3a7b,'request\x20sent',JSON[_0xffbe('0x10')](_0x15d43e));if(_0x15d43e[_0xffbe('0x11')]){if(_0x15d43e[_0xffbe('0x11')][_0xffbe('0x12')]===0x1f4){logger[_0xffbe('0x11')](_0xffbe('0xd'),_0x6b3a7b,_0x15d43e[_0xffbe('0x11')][_0xffbe('0x13')]);return _0x4dced3(_0x15d43e['error'][_0xffbe('0x13')]);}logger[_0xffbe('0x11')](_0xffbe('0xd'),_0x6b3a7b,_0x15d43e['error'][_0xffbe('0x13')]);return _0x25417c(_0x15d43e[_0xffbe('0x11')][_0xffbe('0x13')]);}else{logger[_0xffbe('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x6b3a7b,_0xffbe('0x14'));_0x25417c(_0x15d43e[_0xffbe('0x15')][_0xffbe('0x13')]);}})[_0xffbe('0x16')](function(_0x3f416b){logger[_0xffbe('0x11')](_0xffbe('0xd'),_0x6b3a7b,_0x3f416b);_0x4dced3(_0x3f416b);});});}exports[_0xffbe('0x17')]=function(_0x1992c5){var _0x340736=this;return new Promise(function(_0x5b709e,_0x56c72d){return db['SmsQueueReport'][_0xffbe('0x18')](_0x1992c5[_0xffbe('0x19')],{'raw':_0x1992c5[_0xffbe('0x1a')]?_0x1992c5[_0xffbe('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xffbe('0x1b')](function(_0x243c72){logger[_0xffbe('0xc')](_0xffbe('0x17'),_0x1992c5);logger[_0xffbe('0xe')](_0xffbe('0x17'),_0x1992c5,JSON[_0xffbe('0x10')](_0x243c72));_0x5b709e(_0x243c72);})[_0xffbe('0x16')](function(_0x1aa500){logger[_0xffbe('0x11')]('CreateSmsQueueReport',_0x1aa500[_0xffbe('0x13')],_0x1992c5);_0x56c72d(_0x340736[_0xffbe('0x11')](0x1f4,_0x1aa500['message']));});});};exports[_0xffbe('0x1c')]=function(_0x34f843){var _0x55b455=this;return new Promise(function(_0x425f33,_0x1585bf){return db['SmsQueueReport'][_0xffbe('0x1d')](_0x34f843['body'],{'raw':_0x34f843['options']?_0x34f843['options'][_0xffbe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34f843[_0xffbe('0x1a')]?_0x34f843['options']['where']||null:null,'attributes':_0x34f843[_0xffbe('0x1a')]?_0x34f843[_0xffbe('0x1a')]['attributes']||null:null,'limit':_0x34f843[_0xffbe('0x1a')]?_0x34f843[_0xffbe('0x1a')][_0xffbe('0x1f')]||null:null})[_0xffbe('0x1b')](function(_0x5587c0){logger[_0xffbe('0xc')](_0xffbe('0x1c'),_0x34f843);logger[_0xffbe('0xe')](_0xffbe('0x1c'),_0x34f843,JSON[_0xffbe('0x10')](_0x5587c0));_0x425f33(_0x5587c0);})[_0xffbe('0x16')](function(_0x5300e3){logger[_0xffbe('0x11')](_0xffbe('0x1c'),_0x5300e3[_0xffbe('0x13')],_0x34f843);_0x1585bf(_0x55b455['error'](0x1f4,_0x5300e3[_0xffbe('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 97ef593..eeef53f 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 _0x5075=['get','isAuthenticated','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index'];(function(_0x3c5ccc,_0x43c1c9){var _0x5451da=function(_0x1241b4){while(--_0x1241b4){_0x3c5ccc['push'](_0x3c5ccc['shift']());}};_0x5451da(++_0x43c1c9);}(_0x5075,0x73));var _0x5507=function(_0x1fc512,_0x1996db){_0x1fc512=_0x1fc512-0x0;var _0xae94b9=_0x5075[_0x1fc512];return _0xae94b9;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5507('0xa')]);router[_0x5507('0xb')]('/describe',auth[_0x5507('0xc')](),controller[_0x5507('0xd')]);router[_0x5507('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')]('/',auth[_0x5507('0xc')](),controller[_0x5507('0x10')]);router['put'](_0x5507('0x11'),auth[_0x5507('0xc')](),controller['update']);router[_0x5507('0x12')](_0x5507('0x11'),auth['isAuthenticated'](),controller[_0x5507('0x13')]);module[_0x5507('0x14')]=router; \ No newline at end of file +var _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x51d9f9,_0x1415bf){_0x51d9f9=_0x51d9f9-0x0;var _0x4bafb9=_0x9c5a[_0x51d9f9];return _0x4bafb9;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./smsTransferReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 433f933..f766bf6 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x49beef,_0x4b8def){var _0x5b1362=function(_0x2f4b66){while(--_0x2f4b66){_0x49beef['push'](_0x49beef['shift']());}};_0x5b1362(++_0x4b8def);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xcb91[_0x2fd69d];return _0x5d5ef3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xbaa79f,_0x4d59e9){var _0x33fbdc=function(_0x44cb54){while(--_0x44cb54){_0xbaa79f['push'](_0xbaa79f['shift']());}};_0x33fbdc(++_0x4d59e9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0xf3cd[_0x55e839];return _0x39c61a;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index fdccb7a..60c6074 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 _0xc2f9=['where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x585f8a,_0x476b07){var _0x5a0107=function(_0x5d6a8f){while(--_0x5d6a8f){_0x585f8a['push'](_0x585f8a['shift']());}};_0x5a0107(++_0x476b07);}(_0xc2f9,0xf1));var _0x9c2f=function(_0x451686,_0x9d6cdb){_0x451686=_0x451686-0x0;var _0x53720c=_0xc2f9[_0x451686];return _0x53720c;};'use strict';var emlformat=require(_0x9c2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c2f('0x2'));var moment=require(_0x9c2f('0x3'));var BPromise=require(_0x9c2f('0x4'));var Mustache=require(_0x9c2f('0x5'));var util=require('util');var path=require(_0x9c2f('0x6'));var sox=require('sox');var csv=require(_0x9c2f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c2f('0x8'));var squel=require(_0x9c2f('0x9'));var crypto=require(_0x9c2f('0xa'));var jsforce=require(_0x9c2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9c2f('0x7'));var querystring=require(_0x9c2f('0xc'));var Papa=require(_0x9c2f('0xd'));var Redis=require('ioredis');var authService=require(_0x9c2f('0xe'));var qs=require(_0x9c2f('0xf'));var as=require(_0x9c2f('0x10'));var hardwareService=require(_0x9c2f('0x11'));var logger=require(_0x9c2f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9c2f('0x13'));var licenseUtil=require(_0x9c2f('0x14'));var db=require(_0x9c2f('0x15'))['db'];function respondWithStatusCode(_0x340918,_0x217795){_0x217795=_0x217795||0xcc;return function(_0x4dd3ed){if(_0x4dd3ed){return _0x340918[_0x9c2f('0x16')](_0x217795);}return _0x340918[_0x9c2f('0x17')](_0x217795)[_0x9c2f('0x18')]();};}function respondWithResult(_0x514d4f,_0x524be4){_0x524be4=_0x524be4||0xc8;return function(_0x271062){if(_0x271062){return _0x514d4f[_0x9c2f('0x17')](_0x524be4)['json'](_0x271062);}};}function respondWithFilteredResult(_0x85c94c,_0xe46ece){return function(_0x4e1d9c){if(_0x4e1d9c){var _0x43d329=typeof _0xe46ece[_0x9c2f('0x19')]===_0x9c2f('0x1a')&&typeof _0xe46ece[_0x9c2f('0x1b')]===_0x9c2f('0x1a');var _0x5e6786=_0x4e1d9c['count'];var _0x5ccd38=_0x43d329?0x0:_0xe46ece['offset'];var _0x52def1=_0x43d329?_0x4e1d9c['count']:_0xe46ece['offset']+_0xe46ece['limit'];var _0x24946b;if(_0x52def1>=_0x5e6786){_0x52def1=_0x5e6786;_0x24946b=0xc8;}else{_0x24946b=0xce;}_0x85c94c[_0x9c2f('0x17')](_0x24946b);return _0x85c94c['set'](_0x9c2f('0x1c'),_0x5ccd38+'-'+_0x52def1+'/'+_0x5e6786)[_0x9c2f('0x1d')](_0x4e1d9c);}return null;};}function patchUpdates(_0x2577f9){return function(_0x562393){try{jsonpatch[_0x9c2f('0x1e')](_0x562393,_0x2577f9,!![]);}catch(_0x3ec26b){return BPromise[_0x9c2f('0x1f')](_0x3ec26b);}return _0x562393[_0x9c2f('0x20')]();};}function saveUpdates(_0x4ccaeb,_0x1da258){return function(_0x3c35b3){if(_0x3c35b3){return _0x3c35b3[_0x9c2f('0x21')](_0x4ccaeb)['then'](function(_0x37057b){return _0x37057b;});}return null;};}function removeEntity(_0x5a3201,_0x315534){return function(_0x20efea){if(_0x20efea){return _0x20efea['destroy']()[_0x9c2f('0x22')](function(){_0x5a3201[_0x9c2f('0x17')](0xcc)[_0x9c2f('0x18')]();});}};}function handleEntityNotFound(_0x1ec8b1,_0x485e8f){return function(_0x1b1258){if(!_0x1b1258){_0x1ec8b1[_0x9c2f('0x16')](0x194);}return _0x1b1258;};}function handleError(_0x3b5e98,_0x3572ce){_0x3572ce=_0x3572ce||0x1f4;return function(_0x289d49){logger['error'](_0x289d49[_0x9c2f('0x23')]);if(_0x289d49[_0x9c2f('0x24')]){delete _0x289d49[_0x9c2f('0x24')];}_0x3b5e98['status'](_0x3572ce)[_0x9c2f('0x25')](_0x289d49);};}exports[_0x9c2f('0x26')]=function(_0x1e1f9d,_0x1a760d){var _0x427f52={},_0xc62c94={},_0x360e29={'count':0x0,'rows':[]};var _0x3c6385=_[_0x9c2f('0x27')](db[_0x9c2f('0x28')]['rawAttributes'],function(_0x4f8ba6){return{'name':_0x4f8ba6[_0x9c2f('0x29')],'type':_0x4f8ba6[_0x9c2f('0x2a')][_0x9c2f('0x2b')]};});_0xc62c94['model']=_['map'](_0x3c6385,_0x9c2f('0x24'));_0xc62c94['query']=_[_0x9c2f('0x2c')](_0x1e1f9d[_0x9c2f('0x2d')]);_0xc62c94[_0x9c2f('0x2e')]=_[_0x9c2f('0x2f')](_0xc62c94[_0x9c2f('0x30')],_0xc62c94[_0x9c2f('0x2d')]);_0x427f52['attributes']=_[_0x9c2f('0x2f')](_0xc62c94[_0x9c2f('0x30')],qs[_0x9c2f('0x31')](_0x1e1f9d[_0x9c2f('0x2d')][_0x9c2f('0x31')]));_0x427f52[_0x9c2f('0x32')]=_0x427f52[_0x9c2f('0x32')][_0x9c2f('0x33')]?_0x427f52[_0x9c2f('0x32')]:_0xc62c94['model'];if(!_0x1e1f9d[_0x9c2f('0x2d')][_0x9c2f('0x34')]('nolimit')){_0x427f52[_0x9c2f('0x1b')]=qs[_0x9c2f('0x1b')](_0x1e1f9d['query']['limit']);_0x427f52['offset']=qs['offset'](_0x1e1f9d['query'][_0x9c2f('0x19')]);}_0x427f52[_0x9c2f('0x35')]=qs[_0x9c2f('0x36')](_0x1e1f9d[_0x9c2f('0x2d')]['sort']);_0x427f52[_0x9c2f('0x37')]=qs[_0x9c2f('0x2e')](_[_0x9c2f('0x38')](_0x1e1f9d['query'],_0xc62c94[_0x9c2f('0x2e')]),_0x3c6385);if(_0x1e1f9d[_0x9c2f('0x2d')][_0x9c2f('0x39')]){_0x427f52['where']=_[_0x9c2f('0x3a')](_0x427f52['where'],{'$or':_[_0x9c2f('0x27')](_0x3c6385,function(_0x2a3afd){if(_0x2a3afd[_0x9c2f('0x2a')]!==_0x9c2f('0x3b')){var _0x388017={};_0x388017[_0x2a3afd['name']]={'$like':'%'+_0x1e1f9d['query'][_0x9c2f('0x39')]+'%'};return _0x388017;}})});}_0x427f52=_[_0x9c2f('0x3a')]({},_0x427f52,_0x1e1f9d[_0x9c2f('0x3c')]);var _0x35b481={'where':_0x427f52[_0x9c2f('0x37')]};return db['SmsTransferReport']['count'](_0x35b481)[_0x9c2f('0x22')](function(_0x5a086f){_0x360e29[_0x9c2f('0x3d')]=_0x5a086f;if(_0x1e1f9d[_0x9c2f('0x2d')][_0x9c2f('0x3e')]){_0x427f52[_0x9c2f('0x3f')]=[{'all':!![]}];}return db[_0x9c2f('0x28')][_0x9c2f('0x40')](_0x427f52);})[_0x9c2f('0x22')](function(_0x108613){_0x360e29[_0x9c2f('0x41')]=_0x108613;return _0x360e29;})['then'](respondWithFilteredResult(_0x1a760d,_0x427f52))[_0x9c2f('0x42')](handleError(_0x1a760d,null));};exports[_0x9c2f('0x43')]=function(_0x26999b,_0x2464de){var _0x5006f7={'raw':!![],'where':{'id':_0x26999b[_0x9c2f('0x44')]['id']}},_0x2cde42={};_0x2cde42['model']=_['keys'](db[_0x9c2f('0x28')]['rawAttributes']);_0x2cde42[_0x9c2f('0x2d')]=_[_0x9c2f('0x2c')](_0x26999b['query']);_0x2cde42[_0x9c2f('0x2e')]=_[_0x9c2f('0x2f')](_0x2cde42['model'],_0x2cde42[_0x9c2f('0x2d')]);_0x5006f7['attributes']=_[_0x9c2f('0x2f')](_0x2cde42[_0x9c2f('0x30')],qs['fields'](_0x26999b[_0x9c2f('0x2d')]['fields']));_0x5006f7[_0x9c2f('0x32')]=_0x5006f7[_0x9c2f('0x32')][_0x9c2f('0x33')]?_0x5006f7[_0x9c2f('0x32')]:_0x2cde42[_0x9c2f('0x30')];if(_0x26999b[_0x9c2f('0x2d')][_0x9c2f('0x3e')]){_0x5006f7[_0x9c2f('0x3f')]=[{'all':!![]}];}_0x5006f7=_[_0x9c2f('0x3a')]({},_0x5006f7,_0x26999b['options']);return db['SmsTransferReport']['find'](_0x5006f7)['then'](handleEntityNotFound(_0x2464de,null))['then'](respondWithResult(_0x2464de,null))['catch'](handleError(_0x2464de,null));};exports[_0x9c2f('0x45')]=function(_0x50fcc8,_0x51099c){return db[_0x9c2f('0x28')][_0x9c2f('0x45')](_0x50fcc8[_0x9c2f('0x46')],{})[_0x9c2f('0x22')](respondWithResult(_0x51099c,0xc9))[_0x9c2f('0x42')](handleError(_0x51099c,null));};exports[_0x9c2f('0x21')]=function(_0x2c3684,_0x9acdaf){if(_0x2c3684[_0x9c2f('0x46')]['id']){delete _0x2c3684[_0x9c2f('0x46')]['id'];}return db[_0x9c2f('0x28')][_0x9c2f('0x47')]({'where':{'id':_0x2c3684['params']['id']}})[_0x9c2f('0x22')](handleEntityNotFound(_0x9acdaf,null))['then'](saveUpdates(_0x2c3684[_0x9c2f('0x46')],null))[_0x9c2f('0x22')](respondWithResult(_0x9acdaf,null))[_0x9c2f('0x42')](handleError(_0x9acdaf,null));};exports[_0x9c2f('0x48')]=function(_0x403665,_0x579c0a){return db['SmsTransferReport'][_0x9c2f('0x47')]({'where':{'id':_0x403665[_0x9c2f('0x44')]['id']}})['then'](handleEntityNotFound(_0x579c0a,null))[_0x9c2f('0x22')](removeEntity(_0x579c0a,null))[_0x9c2f('0x42')](handleError(_0x579c0a,null));};exports['describe']=function(_0x20e993,_0x18277f){return db[_0x9c2f('0x28')][_0x9c2f('0x49')]()[_0x9c2f('0x22')](respondWithResult(_0x18277f,null))[_0x9c2f('0x42')](handleError(_0x18277f,null));}; \ No newline at end of file +var _0xadd6=['SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','merge','body','find','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map'];(function(_0x13b80d,_0xeaca9f){var _0x495ca2=function(_0x1cd7ca){while(--_0x1cd7ca){_0x13b80d['push'](_0x13b80d['shift']());}};_0x495ca2(++_0xeaca9f);}(_0xadd6,0x103));var _0x6add=function(_0x50d8ab,_0x31dbf2){_0x50d8ab=_0x50d8ab-0x0;var _0x1c76d2=_0xadd6[_0x50d8ab];return _0x1c76d2;};'use strict';var emlformat=require(_0x6add('0x0'));var rimraf=require(_0x6add('0x1'));var zipdir=require(_0x6add('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6add('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6add('0x4'));var path=require(_0x6add('0x5'));var sox=require(_0x6add('0x6'));var csv=require(_0x6add('0x7'));var ejs=require(_0x6add('0x8'));var fs=require('fs');var fs_extra=require(_0x6add('0x9'));var _=require(_0x6add('0xa'));var squel=require(_0x6add('0xb'));var crypto=require(_0x6add('0xc'));var jsforce=require(_0x6add('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6add('0x7'));var querystring=require(_0x6add('0xe'));var Papa=require(_0x6add('0xf'));var Redis=require('ioredis');var authService=require(_0x6add('0x10'));var qs=require(_0x6add('0x11'));var as=require(_0x6add('0x12'));var hardwareService=require(_0x6add('0x13'));var logger=require(_0x6add('0x14'))(_0x6add('0x15'));var utils=require(_0x6add('0x16'));var config=require(_0x6add('0x17'));var licenseUtil=require(_0x6add('0x18'));var db=require(_0x6add('0x19'))['db'];function respondWithStatusCode(_0x5f2d97,_0x164236){_0x164236=_0x164236||0xcc;return function(_0x19c3f0){if(_0x19c3f0){return _0x5f2d97[_0x6add('0x1a')](_0x164236);}return _0x5f2d97[_0x6add('0x1b')](_0x164236)['end']();};}function respondWithResult(_0x172df2,_0x434f7a){_0x434f7a=_0x434f7a||0xc8;return function(_0x478cc4){if(_0x478cc4){return _0x172df2['status'](_0x434f7a)[_0x6add('0x1c')](_0x478cc4);}};}function respondWithFilteredResult(_0x75582f,_0x562cf7){return function(_0x15be39){if(_0x15be39){var _0x194141=typeof _0x562cf7['offset']===_0x6add('0x1d')&&typeof _0x562cf7['limit']===_0x6add('0x1d');var _0x13c732=_0x15be39['count'];var _0x332b04=_0x194141?0x0:_0x562cf7[_0x6add('0x1e')];var _0x436be7=_0x194141?_0x15be39[_0x6add('0x1f')]:_0x562cf7[_0x6add('0x1e')]+_0x562cf7['limit'];var _0x45d9e6;if(_0x436be7>=_0x13c732){_0x436be7=_0x13c732;_0x45d9e6=0xc8;}else{_0x45d9e6=0xce;}_0x75582f[_0x6add('0x1b')](_0x45d9e6);return _0x75582f[_0x6add('0x20')](_0x6add('0x21'),_0x332b04+'-'+_0x436be7+'/'+_0x13c732)[_0x6add('0x1c')](_0x15be39);}return null;};}function patchUpdates(_0x2dfb85){return function(_0x4c8769){try{jsonpatch[_0x6add('0x22')](_0x4c8769,_0x2dfb85,!![]);}catch(_0x9496ce){return BPromise[_0x6add('0x23')](_0x9496ce);}return _0x4c8769[_0x6add('0x24')]();};}function saveUpdates(_0x7474da,_0x4a2e90){return function(_0x3ebdbc){if(_0x3ebdbc){return _0x3ebdbc['update'](_0x7474da)[_0x6add('0x25')](function(_0x2c393a){return _0x2c393a;});}return null;};}function removeEntity(_0x2c3d9c,_0x5cace1){return function(_0x1acf63){if(_0x1acf63){return _0x1acf63[_0x6add('0x26')]()[_0x6add('0x25')](function(){_0x2c3d9c[_0x6add('0x1b')](0xcc)[_0x6add('0x27')]();});}};}function handleEntityNotFound(_0x16a9bb,_0x3ef05b){return function(_0x267b34){if(!_0x267b34){_0x16a9bb['sendStatus'](0x194);}return _0x267b34;};}function handleError(_0x2c07ac,_0x3fd40a){_0x3fd40a=_0x3fd40a||0x1f4;return function(_0x59c355){logger[_0x6add('0x28')](_0x59c355['stack']);if(_0x59c355[_0x6add('0x29')]){delete _0x59c355[_0x6add('0x29')];}_0x2c07ac[_0x6add('0x1b')](_0x3fd40a)[_0x6add('0x2a')](_0x59c355);};}exports[_0x6add('0x2b')]=function(_0x4ddf09,_0x2c94b1){var _0x547f5d={},_0x4a2e51={},_0x478a72={'count':0x0,'rows':[]};var _0x21472d=_[_0x6add('0x2c')](db[_0x6add('0x2d')][_0x6add('0x2e')],function(_0x43457e){return{'name':_0x43457e[_0x6add('0x2f')],'type':_0x43457e[_0x6add('0x30')]['key']};});_0x4a2e51[_0x6add('0x31')]=_[_0x6add('0x2c')](_0x21472d,_0x6add('0x29'));_0x4a2e51[_0x6add('0x32')]=_[_0x6add('0x33')](_0x4ddf09[_0x6add('0x32')]);_0x4a2e51['filters']=_[_0x6add('0x34')](_0x4a2e51[_0x6add('0x31')],_0x4a2e51[_0x6add('0x32')]);_0x547f5d[_0x6add('0x35')]=_[_0x6add('0x34')](_0x4a2e51[_0x6add('0x31')],qs[_0x6add('0x36')](_0x4ddf09[_0x6add('0x32')][_0x6add('0x36')]));_0x547f5d['attributes']=_0x547f5d[_0x6add('0x35')][_0x6add('0x37')]?_0x547f5d[_0x6add('0x35')]:_0x4a2e51[_0x6add('0x31')];if(!_0x4ddf09['query'][_0x6add('0x38')](_0x6add('0x39'))){_0x547f5d[_0x6add('0x3a')]=qs['limit'](_0x4ddf09[_0x6add('0x32')][_0x6add('0x3a')]);_0x547f5d[_0x6add('0x1e')]=qs[_0x6add('0x1e')](_0x4ddf09[_0x6add('0x32')][_0x6add('0x1e')]);}_0x547f5d[_0x6add('0x3b')]=qs['sort'](_0x4ddf09[_0x6add('0x32')][_0x6add('0x3c')]);_0x547f5d[_0x6add('0x3d')]=qs[_0x6add('0x3e')](_[_0x6add('0x3f')](_0x4ddf09[_0x6add('0x32')],_0x4a2e51[_0x6add('0x3e')]),_0x21472d);if(_0x4ddf09[_0x6add('0x32')]['filter']){_0x547f5d[_0x6add('0x3d')]=_['merge'](_0x547f5d[_0x6add('0x3d')],{'$or':_['map'](_0x21472d,function(_0x7a8893){if(_0x7a8893[_0x6add('0x30')]!==_0x6add('0x40')){var _0x3ed23c={};_0x3ed23c[_0x7a8893[_0x6add('0x29')]]={'$like':'%'+_0x4ddf09[_0x6add('0x32')][_0x6add('0x41')]+'%'};return _0x3ed23c;}})});}_0x547f5d=_['merge']({},_0x547f5d,_0x4ddf09[_0x6add('0x42')]);var _0x12bb6b={'where':_0x547f5d['where']};return db[_0x6add('0x2d')]['count'](_0x12bb6b)[_0x6add('0x25')](function(_0x4019a4){_0x478a72[_0x6add('0x1f')]=_0x4019a4;if(_0x4ddf09[_0x6add('0x32')][_0x6add('0x43')]){_0x547f5d['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x6add('0x44')](_0x547f5d);})[_0x6add('0x25')](function(_0x42ce8f){_0x478a72[_0x6add('0x45')]=_0x42ce8f;return _0x478a72;})[_0x6add('0x25')](respondWithFilteredResult(_0x2c94b1,_0x547f5d))[_0x6add('0x46')](handleError(_0x2c94b1,null));};exports['show']=function(_0x4f8287,_0x56ed28){var _0x3e2473={'raw':!![],'where':{'id':_0x4f8287[_0x6add('0x47')]['id']}},_0x550816={};_0x550816[_0x6add('0x31')]=_['keys'](db[_0x6add('0x2d')]['rawAttributes']);_0x550816[_0x6add('0x32')]=_[_0x6add('0x33')](_0x4f8287['query']);_0x550816[_0x6add('0x3e')]=_[_0x6add('0x34')](_0x550816['model'],_0x550816[_0x6add('0x32')]);_0x3e2473['attributes']=_['intersection'](_0x550816[_0x6add('0x31')],qs[_0x6add('0x36')](_0x4f8287['query'][_0x6add('0x36')]));_0x3e2473['attributes']=_0x3e2473['attributes']['length']?_0x3e2473[_0x6add('0x35')]:_0x550816['model'];if(_0x4f8287['query']['includeAll']){_0x3e2473['include']=[{'all':!![]}];}_0x3e2473=_[_0x6add('0x48')]({},_0x3e2473,_0x4f8287['options']);return db[_0x6add('0x2d')]['find'](_0x3e2473)[_0x6add('0x25')](handleEntityNotFound(_0x56ed28,null))['then'](respondWithResult(_0x56ed28,null))[_0x6add('0x46')](handleError(_0x56ed28,null));};exports['create']=function(_0x3be699,_0x36e0d2){return db[_0x6add('0x2d')]['create'](_0x3be699[_0x6add('0x49')],{})[_0x6add('0x25')](respondWithResult(_0x36e0d2,0xc9))['catch'](handleError(_0x36e0d2,null));};exports['update']=function(_0x38f50b,_0x41f786){if(_0x38f50b['body']['id']){delete _0x38f50b[_0x6add('0x49')]['id'];}return db[_0x6add('0x2d')]['find']({'where':{'id':_0x38f50b[_0x6add('0x47')]['id']}})[_0x6add('0x25')](handleEntityNotFound(_0x41f786,null))[_0x6add('0x25')](saveUpdates(_0x38f50b[_0x6add('0x49')],null))[_0x6add('0x25')](respondWithResult(_0x41f786,null))[_0x6add('0x46')](handleError(_0x41f786,null));};exports[_0x6add('0x26')]=function(_0xf3ef45,_0x3e887d){return db[_0x6add('0x2d')][_0x6add('0x4a')]({'where':{'id':_0xf3ef45['params']['id']}})['then'](handleEntityNotFound(_0x3e887d,null))['then'](removeEntity(_0x3e887d,null))[_0x6add('0x46')](handleError(_0x3e887d,null));};exports[_0x6add('0x4b')]=function(_0x23b429,_0xc4659f){return db[_0x6add('0x2d')][_0x6add('0x4b')]()[_0x6add('0x25')](respondWithResult(_0xc4659f,null))['catch'](handleError(_0xc4659f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 36b1fd3..2339d43 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 _0xf65f=['rimraf','define','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xf65f,0xe0));var _0xff65=function(_0x414743,_0x2e6d87){_0x414743=_0x414743-0x0;var _0x39d57d=_0xf65f[_0x414743];return _0x39d57d;};'use strict';var _=require('lodash');var util=require(_0xff65('0x0'));var logger=require(_0xff65('0x1'))(_0xff65('0x2'));var moment=require(_0xff65('0x3'));var BPromise=require(_0xff65('0x4'));var rp=require(_0xff65('0x5'));var fs=require('fs');var path=require(_0xff65('0x6'));var rimraf=require(_0xff65('0x7'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x541913,_0x7acefd){return _0x541913[_0xff65('0x8')]('SmsTransferReport',attributes,{'tableName':_0xff65('0x9'),'paranoid':![],'indexes':[{'name':_0xff65('0xa'),'fields':[_0xff65('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5294=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid'];(function(_0xb67faa,_0x3bc17b){var _0x14effc=function(_0x1792c6){while(--_0x1792c6){_0xb67faa['push'](_0xb67faa['shift']());}};_0x14effc(++_0x3bc17b);}(_0x5294,0x111));var _0x4529=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x5294[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x4529('0x0'));var util=require(_0x4529('0x1'));var logger=require(_0x4529('0x2'))(_0x4529('0x3'));var moment=require(_0x4529('0x4'));var BPromise=require(_0x4529('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4529('0x6'));var rimraf=require(_0x4529('0x7'));var config=require(_0x4529('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x4529('0x9')]=function(_0x2c78e9,_0x10192d){return _0x2c78e9[_0x4529('0xa')]('SmsTransferReport',attributes,{'tableName':_0x4529('0xb'),'paranoid':![],'indexes':[{'name':_0x4529('0xc'),'fields':[_0x4529('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 5a04c69..8a02b85 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 _0xd8ee=['../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xd8ee,0x1f2));var _0xed8e=function(_0xc1c93f,_0x1fba71){_0xc1c93f=_0xc1c93f-0x0;var _0x3f81cb=_0xd8ee[_0xc1c93f];return _0x3f81cb;};'use strict';var _=require(_0xed8e('0x0'));var util=require('util');var moment=require(_0xed8e('0x1'));var BPromise=require(_0xed8e('0x2'));var rs=require(_0xed8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed8e('0x4'))['db'];var utils=require(_0xed8e('0x5'));var logger=require(_0xed8e('0x6'))(_0xed8e('0x7'));var config=require(_0xed8e('0x8'));var jayson=require(_0xed8e('0x9'));var client=jayson['client'][_0xed8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc229f,_0x1bd206,_0x171acf){return new BPromise(function(_0x6c72c8,_0x438603){return client[_0xed8e('0xb')](_0xbc229f,_0x171acf)['then'](function(_0x535a11){logger[_0xed8e('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1bd206,'request\x20sent');logger[_0xed8e('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1bd206,_0xed8e('0xe'),JSON[_0xed8e('0xf')](_0x535a11));if(_0x535a11['error']){if(_0x535a11[_0xed8e('0x10')][_0xed8e('0x11')]===0x1f4){logger['error'](_0xed8e('0x12'),_0x1bd206,_0x535a11['error'][_0xed8e('0x13')]);return _0x438603(_0x535a11[_0xed8e('0x10')][_0xed8e('0x13')]);}logger[_0xed8e('0x10')](_0xed8e('0x12'),_0x1bd206,_0x535a11[_0xed8e('0x10')][_0xed8e('0x13')]);return _0x6c72c8(_0x535a11[_0xed8e('0x10')][_0xed8e('0x13')]);}else{logger[_0xed8e('0xc')](_0xed8e('0x12'),_0x1bd206,_0xed8e('0xe'));_0x6c72c8(_0x535a11[_0xed8e('0x14')]['message']);}})[_0xed8e('0x15')](function(_0x51a804){logger[_0xed8e('0x10')](_0xed8e('0x12'),_0x1bd206,_0x51a804);_0x438603(_0x51a804);});});} \ No newline at end of file +var _0xff2a=['request\x20sent','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x837006,_0x326159){var _0x4cf513=function(_0x2ac68e){while(--_0x2ac68e){_0x837006['push'](_0x837006['shift']());}};_0x4cf513(++_0x326159);}(_0xff2a,0x93));var _0xaff2=function(_0x33c090,_0x184b69){_0x33c090=_0x33c090-0x0;var _0x4081df=_0xff2a[_0x33c090];return _0x4081df;};'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});function respondWithRpcPromise(_0x2e4f44,_0x3498b7,_0x33229b){return new BPromise(function(_0x1125e,_0xe0d6d3){return client[_0xaff2('0x9')](_0x2e4f44,_0x33229b)[_0xaff2('0xa')](function(_0x3ecb3f){logger['info'](_0xaff2('0xb'),_0x3498b7,'request\x20sent');logger['debug'](_0xaff2('0xc'),_0x3498b7,_0xaff2('0xd'),JSON[_0xaff2('0xe')](_0x3ecb3f));if(_0x3ecb3f[_0xaff2('0xf')]){if(_0x3ecb3f[_0xaff2('0xf')]['code']===0x1f4){logger[_0xaff2('0xf')](_0xaff2('0xb'),_0x3498b7,_0x3ecb3f[_0xaff2('0xf')]['message']);return _0xe0d6d3(_0x3ecb3f[_0xaff2('0xf')][_0xaff2('0x10')]);}logger['error'](_0xaff2('0xb'),_0x3498b7,_0x3ecb3f['error'][_0xaff2('0x10')]);return _0x1125e(_0x3ecb3f['error']['message']);}else{logger[_0xaff2('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x3498b7,_0xaff2('0xd'));_0x1125e(_0x3ecb3f[_0xaff2('0x12')][_0xaff2('0x10')]);}})[_0xaff2('0x13')](function(_0x1bb23f){logger['error'](_0xaff2('0xb'),_0x3498b7,_0x1bb23f);_0xe0d6d3(_0x1bb23f);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5ab8e7e..8a4a424 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 _0x9494=['express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','index','/:id','isAuthenticated','show','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','delete','util'];(function(_0x24ddf6,_0x114e56){var _0x393d70=function(_0x12c818){while(--_0x12c818){_0x24ddf6['push'](_0x24ddf6['shift']());}};_0x393d70(++_0x114e56);}(_0x9494,0xcf));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x4949('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4949('0x1'));var router=express[_0x4949('0x2')]();var fs_extra=require(_0x4949('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4949('0x4'));var config=require('../../config/environment');var controller=require(_0x4949('0x5'));router[_0x4949('0x6')]('/',auth['isAuthenticated'](),controller[_0x4949('0x7')]);router[_0x4949('0x6')](_0x4949('0x8'),auth[_0x4949('0x9')](),controller[_0x4949('0xa')]);router[_0x4949('0x6')]('/:id/download',auth[_0x4949('0x9')](),controller[_0x4949('0xb')]);var upload=multer({'storage':multer[_0x4949('0xc')]({'destination':function(_0x2a6209,_0x39297e,_0x502b01){_0x502b01(null,path[_0x4949('0xd')](config['root'],_0x4949('0xe')));},'filename':function(_0xcf9385,_0x116d77,_0x11fcae){_0x116d77[_0x4949('0xf')]=_0x116d77['originalname'][_0x4949('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11fcae(null,util[_0x4949('0x11')](_0x4949('0x12'),path[_0x4949('0x13')](_0x116d77[_0x4949('0xf')],path[_0x4949('0x14')](_0x116d77[_0x4949('0xf')])),Date[_0x4949('0x15')](),path['extname'](_0x116d77[_0x4949('0xf')])));}})});router[_0x4949('0x16')]('/',upload[_0x4949('0x17')](_0x4949('0x18')),controller['create']);router['put'](_0x4949('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4949('0x9')](),controller[_0x4949('0x19')]);module['exports']=router; \ No newline at end of file +var _0xf120=['format','%s-%s%s','extname','now','post','single','file','put','update','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace'];(function(_0x1fede3,_0x5e506e){var _0x4b2b2c=function(_0x216ccb){while(--_0x216ccb){_0x1fede3['push'](_0x1fede3['shift']());}};_0x4b2b2c(++_0x5e506e);}(_0xf120,0xb3));var _0x0f12=function(_0x460c4e,_0x1fa04b){_0x460c4e=_0x460c4e-0x0;var _0x3a23a0=_0xf120[_0x460c4e];return _0x3a23a0;};'use strict';var multer=require(_0x0f12('0x0'));var util=require('util');var path=require(_0x0f12('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0f12('0x2')]();var fs_extra=require(_0x0f12('0x3'));var auth=require(_0x0f12('0x4'));var interaction=require(_0x0f12('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x0f12('0x6')]('/',auth[_0x0f12('0x7')](),controller[_0x0f12('0x8')]);router[_0x0f12('0x6')](_0x0f12('0x9'),auth[_0x0f12('0x7')](),controller['show']);router[_0x0f12('0x6')](_0x0f12('0xa'),auth[_0x0f12('0x7')](),controller[_0x0f12('0xb')]);var upload=multer({'storage':multer[_0x0f12('0xc')]({'destination':function(_0x840df9,_0x2a7f34,_0x2ad856){_0x2ad856(null,path[_0x0f12('0xd')](config['root'],_0x0f12('0xe')));},'filename':function(_0x130542,_0x26961d,_0xea3ffb){_0x26961d[_0x0f12('0xf')]=_0x26961d[_0x0f12('0xf')][_0x0f12('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xea3ffb(null,util[_0x0f12('0x11')](_0x0f12('0x12'),path['basename'](_0x26961d[_0x0f12('0xf')],path[_0x0f12('0x13')](_0x26961d[_0x0f12('0xf')])),Date[_0x0f12('0x14')](),path['extname'](_0x26961d['originalname'])));}})});router[_0x0f12('0x15')]('/',upload[_0x0f12('0x16')](_0x0f12('0x17')),controller['create']);router[_0x0f12('0x18')](_0x0f12('0x9'),auth[_0x0f12('0x7')](),controller[_0x0f12('0x19')]);router[_0x0f12('0x1a')](_0x0f12('0x9'),auth[_0x0f12('0x7')](),controller[_0x0f12('0x1a')]);module[_0x0f12('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index ac624d1..c669604 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 _0x27f9=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x27f9,0x73));var _0x927f=function(_0x54e040,_0x4f770c){_0x54e040=_0x54e040-0x0;var _0x5501da=_0x27f9[_0x54e040];return _0x5501da;};'use strict';var Sequelize=require(_0x927f('0x0'));module[_0x927f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x927f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x927f('0x3')]},'display_name':{'type':Sequelize[_0x927f('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x927f('0x3')]},'original_format':{'type':Sequelize[_0x927f('0x3')]},'original_duration':{'type':Sequelize[_0x927f('0x4')]},'original_sampleCount':{'type':Sequelize[_0x927f('0x5')]},'original_channelCount':{'type':Sequelize[_0x927f('0x6')]},'original_bitRate':{'type':Sequelize[_0x927f('0x5')]},'original_sampleRate':{'type':Sequelize[_0x927f('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x927f('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x927f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x927f('0x6')]},'converted_bitRate':{'type':Sequelize[_0x927f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x927f('0x6')]}}; \ No newline at end of file +var _0x4c54=['INTEGER','FLOAT','exports','STRING','name','BIGINT'];(function(_0x3d03c9,_0x377cf2){var _0x2505d7=function(_0x592ada){while(--_0x592ada){_0x3d03c9['push'](_0x3d03c9['shift']());}};_0x2505d7(++_0x377cf2);}(_0x4c54,0xaa));var _0x44c5=function(_0x5c13f0,_0x3722cd){_0x5c13f0=_0x5c13f0-0x0;var _0x5e28a0=_0x4c54[_0x5c13f0];return _0x5e28a0;};'use strict';var Sequelize=require('sequelize');module[_0x44c5('0x0')]={'name':{'type':Sequelize[_0x44c5('0x1')],'unique':_0x44c5('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x44c5('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x44c5('0x1')]},'original_format':{'type':Sequelize[_0x44c5('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x44c5('0x3')]},'original_channelCount':{'type':Sequelize[_0x44c5('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x44c5('0x4')]},'converted_format':{'type':Sequelize[_0x44c5('0x1')]},'converted_duration':{'type':Sequelize[_0x44c5('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x44c5('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x44c5('0x3')]},'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 2e9edb4..647efa7 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 _0xa52b=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','merge','options','rows','catch','show','fields','includeAll','include','find','download','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','root','format','%s.%s','create','originalname','extname','file','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','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'];(function(_0x2965cd,_0x1154bc){var _0x2f5dd4=function(_0x3ab510){while(--_0x3ab510){_0x2965cd['push'](_0x2965cd['shift']());}};_0x2f5dd4(++_0x1154bc);}(_0xa52b,0x6e));var _0xba52=function(_0x5d0bcb,_0x4b42ba){_0x5d0bcb=_0x5d0bcb-0x0;var _0x5840b5=_0xa52b[_0x5d0bcb];return _0x5840b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba52('0x0'));var zipdir=require(_0xba52('0x1'));var jsonpatch=require(_0xba52('0x2'));var rp=require(_0xba52('0x3'));var moment=require(_0xba52('0x4'));var BPromise=require(_0xba52('0x5'));var Mustache=require('mustache');var util=require(_0xba52('0x6'));var path=require(_0xba52('0x7'));var sox=require(_0xba52('0x8'));var csv=require(_0xba52('0x9'));var ejs=require(_0xba52('0xa'));var fs=require('fs');var fs_extra=require(_0xba52('0xb'));var _=require(_0xba52('0xc'));var squel=require(_0xba52('0xd'));var crypto=require(_0xba52('0xe'));var jsforce=require(_0xba52('0xf'));var deskjs=require(_0xba52('0x10'));var toCsv=require(_0xba52('0x9'));var querystring=require(_0xba52('0x11'));var Papa=require(_0xba52('0x12'));var Redis=require(_0xba52('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xba52('0x14'));var as=require(_0xba52('0x15'));var hardwareService=require(_0xba52('0x16'));var logger=require(_0xba52('0x17'))(_0xba52('0x18'));var utils=require(_0xba52('0x19'));var config=require(_0xba52('0x1a'));var licenseUtil=require(_0xba52('0x1b'));var db=require(_0xba52('0x1c'))['db'];function respondWithStatusCode(_0x3ffcf5,_0x5f21b4){_0x5f21b4=_0x5f21b4||0xcc;return function(_0x5e52a4){if(_0x5e52a4){return _0x3ffcf5[_0xba52('0x1d')](_0x5f21b4);}return _0x3ffcf5['status'](_0x5f21b4)[_0xba52('0x1e')]();};}function respondWithResult(_0x4bd597,_0x36f7ef){_0x36f7ef=_0x36f7ef||0xc8;return function(_0x341686){if(_0x341686){return _0x4bd597['status'](_0x36f7ef)[_0xba52('0x1f')](_0x341686);}};}function respondWithFilteredResult(_0x223a08,_0x182492){return function(_0x36d0da){if(_0x36d0da){var _0x24c2ff=typeof _0x182492[_0xba52('0x20')]===_0xba52('0x21')&&typeof _0x182492[_0xba52('0x22')]===_0xba52('0x21');var _0x1c7026=_0x36d0da['count'];var _0x41ea4c=_0x24c2ff?0x0:_0x182492[_0xba52('0x20')];var _0x1729a0=_0x24c2ff?_0x36d0da[_0xba52('0x23')]:_0x182492[_0xba52('0x20')]+_0x182492[_0xba52('0x22')];var _0x1cf9a7;if(_0x1729a0>=_0x1c7026){_0x1729a0=_0x1c7026;_0x1cf9a7=0xc8;}else{_0x1cf9a7=0xce;}_0x223a08[_0xba52('0x24')](_0x1cf9a7);return _0x223a08['set']('Content-Range',_0x41ea4c+'-'+_0x1729a0+'/'+_0x1c7026)[_0xba52('0x1f')](_0x36d0da);}return null;};}function patchUpdates(_0x4351f3){return function(_0x1e5801){try{jsonpatch[_0xba52('0x25')](_0x1e5801,_0x4351f3,!![]);}catch(_0x2b5d60){return BPromise[_0xba52('0x26')](_0x2b5d60);}return _0x1e5801[_0xba52('0x27')]();};}function saveUpdates(_0x1fe98d,_0x26c554){return function(_0x5c8f51){if(_0x5c8f51){return _0x5c8f51['update'](_0x1fe98d)[_0xba52('0x28')](function(_0x24ddf8){return _0x24ddf8;});}return null;};}function removeEntity(_0x5cd27d,_0x1000fc){return function(_0x80782c){if(_0x80782c){return _0x80782c[_0xba52('0x29')]()['then'](function(){var _0x245bfb=_0x80782c[_0xba52('0x2a')]({'plain':!![]});var _0x7b5b47=_0xba52('0x2b');return db[_0xba52('0x2c')]['destroy']({'where':{'type':_0x7b5b47,'resourceId':_0x245bfb['id']}})['then'](function(){return _0x80782c;});})[_0xba52('0x28')](function(){_0x5cd27d[_0xba52('0x24')](0xcc)[_0xba52('0x1e')]();});}};}function handleEntityNotFound(_0x5732c3,_0x4225f8){return function(_0x13bcd3){if(!_0x13bcd3){_0x5732c3[_0xba52('0x1d')](0x194);}return _0x13bcd3;};}function handleError(_0xdad31f,_0x2da9ab){_0x2da9ab=_0x2da9ab||0x1f4;return function(_0x1c9977){logger[_0xba52('0x2d')](_0x1c9977[_0xba52('0x2e')]);if(_0x1c9977[_0xba52('0x2f')]){delete _0x1c9977[_0xba52('0x2f')];}_0xdad31f[_0xba52('0x24')](_0x2da9ab)[_0xba52('0x30')](_0x1c9977);};}exports['index']=function(_0x3ab856,_0x998510){var _0xde731={},_0x160cf2={},_0x9ff9f7={'count':0x0,'rows':[]};var _0x21fe6f=_[_0xba52('0x31')](db[_0xba52('0x32')][_0xba52('0x33')],function(_0x2d1ce9){return{'name':_0x2d1ce9[_0xba52('0x34')],'type':_0x2d1ce9[_0xba52('0x35')][_0xba52('0x36')]};});_0x160cf2[_0xba52('0x37')]=_[_0xba52('0x31')](_0x21fe6f,'name');_0x160cf2[_0xba52('0x38')]=_[_0xba52('0x39')](_0x3ab856['query']);_0x160cf2[_0xba52('0x3a')]=_['intersection'](_0x160cf2[_0xba52('0x37')],_0x160cf2[_0xba52('0x38')]);_0xde731[_0xba52('0x3b')]=_[_0xba52('0x3c')](_0x160cf2[_0xba52('0x37')],qs['fields'](_0x3ab856[_0xba52('0x38')]['fields']));_0xde731[_0xba52('0x3b')]=_0xde731[_0xba52('0x3b')][_0xba52('0x3d')]?_0xde731[_0xba52('0x3b')]:_0x160cf2[_0xba52('0x37')];if(!_0x3ab856[_0xba52('0x38')][_0xba52('0x3e')]('nolimit')){_0xde731[_0xba52('0x22')]=qs[_0xba52('0x22')](_0x3ab856[_0xba52('0x38')]['limit']);_0xde731[_0xba52('0x20')]=qs[_0xba52('0x20')](_0x3ab856[_0xba52('0x38')][_0xba52('0x20')]);}_0xde731[_0xba52('0x3f')]=qs[_0xba52('0x40')](_0x3ab856[_0xba52('0x38')]['sort']);_0xde731[_0xba52('0x41')]=qs[_0xba52('0x3a')](_[_0xba52('0x42')](_0x3ab856[_0xba52('0x38')],_0x160cf2[_0xba52('0x3a')]),_0x21fe6f);if(_0x3ab856[_0xba52('0x38')]['filter']){_0xde731['where']=_['merge'](_0xde731[_0xba52('0x41')],{'$or':_[_0xba52('0x31')](_0x21fe6f,function(_0x3f28de){if(_0x3f28de[_0xba52('0x35')]!=='VIRTUAL'){var _0x4ba9bb={};_0x4ba9bb[_0x3f28de[_0xba52('0x2f')]]={'$like':'%'+_0x3ab856[_0xba52('0x38')]['filter']+'%'};return _0x4ba9bb;}})});}_0xde731=_[_0xba52('0x43')]({},_0xde731,_0x3ab856[_0xba52('0x44')]);var _0x29169e={'where':_0xde731['where']};return db[_0xba52('0x32')][_0xba52('0x23')](_0x29169e)[_0xba52('0x28')](function(_0x1ca3df){_0x9ff9f7[_0xba52('0x23')]=_0x1ca3df;if(_0x3ab856[_0xba52('0x38')]['includeAll']){_0xde731['include']=[{'all':!![]}];}return db[_0xba52('0x32')]['findAll'](_0xde731);})['then'](function(_0x4ff7aa){_0x9ff9f7[_0xba52('0x45')]=_0x4ff7aa;return _0x9ff9f7;})[_0xba52('0x28')](respondWithFilteredResult(_0x998510,_0xde731))[_0xba52('0x46')](handleError(_0x998510,null));};exports[_0xba52('0x47')]=function(_0x3bcd16,_0x36b984){var _0x2dbb26={'raw':!![],'where':{'id':_0x3bcd16['params']['id']}},_0x5a2a98={};_0x5a2a98[_0xba52('0x37')]=_[_0xba52('0x39')](db[_0xba52('0x32')]['rawAttributes']);_0x5a2a98[_0xba52('0x38')]=_[_0xba52('0x39')](_0x3bcd16['query']);_0x5a2a98[_0xba52('0x3a')]=_[_0xba52('0x3c')](_0x5a2a98[_0xba52('0x37')],_0x5a2a98['query']);_0x2dbb26['attributes']=_['intersection'](_0x5a2a98['model'],qs[_0xba52('0x48')](_0x3bcd16[_0xba52('0x38')]['fields']));_0x2dbb26[_0xba52('0x3b')]=_0x2dbb26[_0xba52('0x3b')][_0xba52('0x3d')]?_0x2dbb26['attributes']:_0x5a2a98['model'];if(_0x3bcd16['query'][_0xba52('0x49')]){_0x2dbb26[_0xba52('0x4a')]=[{'all':!![]}];}_0x2dbb26=_[_0xba52('0x43')]({},_0x2dbb26,_0x3bcd16[_0xba52('0x44')]);return db[_0xba52('0x32')][_0xba52('0x4b')](_0x2dbb26)[_0xba52('0x28')](handleEntityNotFound(_0x36b984,null))[_0xba52('0x28')](respondWithResult(_0x36b984,null))[_0xba52('0x46')](handleError(_0x36b984,null));};exports[_0xba52('0x4c')]=function(_0x3df49b,_0xc424dd,_0xc9c56b){return db[_0xba52('0x32')][_0xba52('0x4b')]({'where':{'id':_0x3df49b[_0xba52('0x4d')]['id']},'attributes':[_0xba52('0x2f'),_0xba52('0x4e'),_0xba52('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0xc424dd,null))[_0xba52('0x28')](function(_0x536e41){if(_0x536e41){if(!fs[_0xba52('0x50')](path[_0xba52('0x51')](config['root'],_0xba52('0x52'),_0x536e41[_0xba52('0x4e')]+'.'+_0x536e41['converted_format']))){throw new db[(_0xba52('0x53'))][(_0xba52('0x54'))]('Sound\x20not\x20found');}return _0xc424dd[_0xba52('0x4c')](path[_0xba52('0x51')](config[_0xba52('0x55')],_0xba52('0x52'),util[_0xba52('0x56')](_0xba52('0x57'),_0x536e41['save_name'],_0x536e41[_0xba52('0x4f')])),util[_0xba52('0x56')](_0xba52('0x57'),_0x536e41[_0xba52('0x2f')],_0x536e41[_0xba52('0x4f')]));}return null;})[_0xba52('0x46')](handleError(_0xc424dd,null));};exports[_0xba52('0x58')]=function(_0x209bc8,_0x3c0b9a,_0x50a5fb){var _0xb7ede9={'name':path['basename'](_0x209bc8['file'][_0xba52('0x59')],path[_0xba52('0x5a')](_0x209bc8[_0xba52('0x5b')][_0xba52('0x59')])),'save_name':path[_0xba52('0x5c')](_0x209bc8[_0xba52('0x5b')][_0xba52('0x5d')],path[_0xba52('0x5a')](_0x209bc8[_0xba52('0x5b')]['filename'])),'original_format':path['extname'](_0x209bc8[_0xba52('0x5b')][_0xba52('0x59')])[_0xba52('0x5e')](0x1),'converted_format':'wav'};var _0x43b28a=path['join'](config[_0xba52('0x55')],_0xba52('0x5f'),_0x209bc8[_0xba52('0x5b')]['filename']);var _0x5ac8d0=path[_0xba52('0x51')](config[_0xba52('0x55')],'server/files/sounds/converted',util[_0xba52('0x56')](_0xba52('0x57'),path[_0xba52('0x5c')](_0x209bc8[_0xba52('0x5b')][_0xba52('0x5d')],path[_0xba52('0x5a')](_0x209bc8[_0xba52('0x5b')][_0xba52('0x5d')])),_0xb7ede9['converted_format']));logger[_0xba52('0x60')](_0xba52('0x61'),_0x43b28a);logger[_0xba52('0x60')](_0xba52('0x62'),_0x5ac8d0);try{fs[_0xba52('0x63')](_0x43b28a,parseInt(_0xba52('0x64'),0x8));var _0x480311=sox[_0xba52('0x65')](_0x43b28a,_0x5ac8d0,{'sampleRate':0x1f40,'format':_0xba52('0x66'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x480311['on'](_0xba52('0x2d'),function(_0x358042){fs[_0xba52('0x67')](_0x43b28a);_0x3c0b9a[_0xba52('0x24')](0x1f4)['send'](_0x358042);});_0x480311['on'](_0xba52('0x68'),function(_0x2d806d){_0xb7ede9[_0xba52('0x69')]=isNaN(_0x2d806d[_0xba52('0x6a')])?null:_0x2d806d[_0xba52('0x6a')]*0x3e8;_0xb7ede9[_0xba52('0x6b')]=isNaN(_0x2d806d[_0xba52('0x6c')])?null:_0x2d806d[_0xba52('0x6c')];_0xb7ede9['original_channelCount']=isNaN(_0x2d806d['channelCount'])?null:_0x2d806d[_0xba52('0x6d')];_0xb7ede9[_0xba52('0x6e')]=isNaN(_0x2d806d[_0xba52('0x6f')])?null:_0x2d806d['bitRate'];_0xb7ede9[_0xba52('0x70')]=isNaN(_0x2d806d[_0xba52('0x71')])?null:_0x2d806d[_0xba52('0x71')];});_0x480311['on'](_0xba52('0x72'),function(_0x50861b){_0xb7ede9['converted_duration']=isNaN(_0x50861b[_0xba52('0x6a')])?null:_0x50861b['duration']*0x3e8;_0xb7ede9[_0xba52('0x73')]=isNaN(_0x50861b[_0xba52('0x6c')])?null:_0x50861b[_0xba52('0x6c')];_0xb7ede9[_0xba52('0x74')]=isNaN(_0x50861b[_0xba52('0x6d')])?null:_0x50861b[_0xba52('0x6d')];_0xb7ede9[_0xba52('0x75')]=isNaN(_0x50861b['bitRate'])?null:_0x50861b[_0xba52('0x6f')];_0xb7ede9[_0xba52('0x76')]=isNaN(_0x50861b[_0xba52('0x71')])?null:_0x50861b[_0xba52('0x71')];});_0x480311['on']('end',function(){fs[_0xba52('0x63')](_0x5ac8d0,parseInt('0777',0x8));return db['Sound'][_0xba52('0x58')](_0xb7ede9)[_0xba52('0x28')](function(_0x268a63){var _0x3ff3cd={'role':_0x209bc8[_0xba52('0x77')][_0xba52('0x78')],'userProfileId':_0x209bc8['body'][_0xba52('0x79')]};if(!_0x3ff3cd)throw new Error(_0xba52('0x7a'));if(_0x3ff3cd[_0xba52('0x78')]==='user'){var _0x50f184=_0x268a63[_0xba52('0x2a')]({'plain':!![]});return db['UserProfileSection'][_0xba52('0x4b')]({'where':{'name':_0xba52('0x2b'),'userProfileId':_0x3ff3cd[_0xba52('0x79')]},'raw':!![]})[_0xba52('0x28')](function(_0x2aa1f5){if(_0x2aa1f5&&_0x2aa1f5[_0xba52('0x7b')]===0x0){return db[_0xba52('0x2c')][_0xba52('0x58')]({'name':_0x50f184[_0xba52('0x2f')],'resourceId':_0x50f184['id'],'type':_0x2aa1f5[_0xba52('0x2f')],'sectionId':_0x2aa1f5['id']},{})[_0xba52('0x28')](function(){return _0x268a63;});}else{return _0x268a63;}})[_0xba52('0x46')](function(_0x12c53){logger[_0xba52('0x2d')](_0xba52('0x7c'),_0x12c53);throw _0x12c53;});}return _0x268a63;})['then'](respondWithResult(_0x3c0b9a,null))['catch'](handleError(_0x3c0b9a,null));});_0x480311[_0xba52('0x7d')]();}catch(_0x3cf788){_0x3c0b9a[_0xba52('0x24')](0x1f4)[_0xba52('0x30')](_0x3cf788);}};exports['update']=function(_0x50a43f,_0x1e6af1,_0x5c3353){return db['Sound'][_0xba52('0x4b')]({'where':{'id':_0x50a43f['params']['id']}})[_0xba52('0x28')](handleEntityNotFound(_0x1e6af1,null))['then'](saveUpdates(_[_0xba52('0x42')](_0x50a43f['body'],[_0xba52('0x2f'),_0xba52('0x7e')]),null))[_0xba52('0x28')](respondWithResult(_0x1e6af1,null))[_0xba52('0x46')](handleError(_0x1e6af1,null));};exports['delete']=function(_0x447b67,_0x6084f1,_0x1d7478){return db['Sound']['find']({'where':{'id':_0x447b67['params']['id']}})[_0xba52('0x28')](function(_0x6d26ed){if(_0x6d26ed){return _0x6d26ed[_0xba52('0x29')]();}})['then'](function(_0x30bf1f){var _0x263bfd=path['join'](config[_0xba52('0x55')],'server/files/sounds/original',util[_0xba52('0x56')](_0xba52('0x57'),_0x30bf1f['save_name'],_0x30bf1f[_0xba52('0x7f')]));var _0x2e69c9=path[_0xba52('0x51')](config[_0xba52('0x55')],_0xba52('0x52'),util[_0xba52('0x56')]('%s.%s',_0x30bf1f[_0xba52('0x4e')],_0x30bf1f['converted_format']));fs[_0xba52('0x67')](_0x263bfd);fs[_0xba52('0x67')](_0x2e69c9);return _0x30bf1f;})[_0xba52('0x28')](function(_0x595816){if(_0x595816){return _0x6084f1[_0xba52('0x24')](0xcc)['end']();}})[_0xba52('0x28')](handleEntityNotFound(_0x6084f1,null))[_0xba52('0x46')](handleError(_0x6084f1,null));}; \ No newline at end of file +var _0x8cc3=['unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','find','params','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','transcode'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x8cc3,0x19b));var _0x38cc=function(_0x763fc,_0x4a985b){_0x763fc=_0x763fc-0x0;var _0x589adf=_0x8cc3[_0x763fc];return _0x589adf;};'use strict';var emlformat=require(_0x38cc('0x0'));var rimraf=require(_0x38cc('0x1'));var zipdir=require(_0x38cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38cc('0x3'));var moment=require(_0x38cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x38cc('0x5'));var util=require(_0x38cc('0x6'));var path=require(_0x38cc('0x7'));var sox=require(_0x38cc('0x8'));var csv=require(_0x38cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38cc('0xa'));var _=require(_0x38cc('0xb'));var squel=require(_0x38cc('0xc'));var crypto=require(_0x38cc('0xd'));var jsforce=require(_0x38cc('0xe'));var deskjs=require(_0x38cc('0xf'));var toCsv=require(_0x38cc('0x9'));var querystring=require(_0x38cc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x38cc('0x11'));var qs=require(_0x38cc('0x12'));var as=require(_0x38cc('0x13'));var hardwareService=require(_0x38cc('0x14'));var logger=require(_0x38cc('0x15'))(_0x38cc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x38cc('0x17'));var db=require(_0x38cc('0x18'))['db'];function respondWithStatusCode(_0x51efa5,_0x1751f1){_0x1751f1=_0x1751f1||0xcc;return function(_0x2159b1){if(_0x2159b1){return _0x51efa5[_0x38cc('0x19')](_0x1751f1);}return _0x51efa5[_0x38cc('0x1a')](_0x1751f1)['end']();};}function respondWithResult(_0x47ae26,_0x430ec8){_0x430ec8=_0x430ec8||0xc8;return function(_0xc720dd){if(_0xc720dd){return _0x47ae26[_0x38cc('0x1a')](_0x430ec8)[_0x38cc('0x1b')](_0xc720dd);}};}function respondWithFilteredResult(_0x10385f,_0x201961){return function(_0x44c0e5){if(_0x44c0e5){var _0x5285d0=typeof _0x201961['offset']===_0x38cc('0x1c')&&typeof _0x201961['limit']===_0x38cc('0x1c');var _0x30f5e7=_0x44c0e5[_0x38cc('0x1d')];var _0x5adf21=_0x5285d0?0x0:_0x201961[_0x38cc('0x1e')];var _0x1ba822=_0x5285d0?_0x44c0e5['count']:_0x201961[_0x38cc('0x1e')]+_0x201961[_0x38cc('0x1f')];var _0x513180;if(_0x1ba822>=_0x30f5e7){_0x1ba822=_0x30f5e7;_0x513180=0xc8;}else{_0x513180=0xce;}_0x10385f[_0x38cc('0x1a')](_0x513180);return _0x10385f[_0x38cc('0x20')](_0x38cc('0x21'),_0x5adf21+'-'+_0x1ba822+'/'+_0x30f5e7)[_0x38cc('0x1b')](_0x44c0e5);}return null;};}function patchUpdates(_0x197d19){return function(_0x1eb5dc){try{jsonpatch[_0x38cc('0x22')](_0x1eb5dc,_0x197d19,!![]);}catch(_0x44c2d6){return BPromise[_0x38cc('0x23')](_0x44c2d6);}return _0x1eb5dc[_0x38cc('0x24')]();};}function saveUpdates(_0x595924,_0x2530cb){return function(_0x413175){if(_0x413175){return _0x413175['update'](_0x595924)['then'](function(_0x360890){return _0x360890;});}return null;};}function removeEntity(_0x273583,_0x15d4cd){return function(_0xfceb14){if(_0xfceb14){return _0xfceb14['destroy']()[_0x38cc('0x25')](function(){var _0x4ec3a7=_0xfceb14[_0x38cc('0x26')]({'plain':!![]});var _0x5f2149='Sounds';return db[_0x38cc('0x27')][_0x38cc('0x28')]({'where':{'type':_0x5f2149,'resourceId':_0x4ec3a7['id']}})[_0x38cc('0x25')](function(){return _0xfceb14;});})['then'](function(){_0x273583[_0x38cc('0x1a')](0xcc)[_0x38cc('0x29')]();});}};}function handleEntityNotFound(_0x43e920,_0x41ecdc){return function(_0x93a0fd){if(!_0x93a0fd){_0x43e920[_0x38cc('0x19')](0x194);}return _0x93a0fd;};}function handleError(_0x2a67f8,_0x383cba){_0x383cba=_0x383cba||0x1f4;return function(_0x39f690){logger[_0x38cc('0x2a')](_0x39f690[_0x38cc('0x2b')]);if(_0x39f690[_0x38cc('0x2c')]){delete _0x39f690[_0x38cc('0x2c')];}_0x2a67f8[_0x38cc('0x1a')](_0x383cba)[_0x38cc('0x2d')](_0x39f690);};}exports[_0x38cc('0x2e')]=function(_0x58a7fb,_0x5f51f5){var _0x1a16f6={},_0x219eee={},_0x5211d1={'count':0x0,'rows':[]};var _0x55f9f8=_[_0x38cc('0x2f')](db[_0x38cc('0x30')][_0x38cc('0x31')],function(_0xabe664){return{'name':_0xabe664[_0x38cc('0x32')],'type':_0xabe664[_0x38cc('0x33')]['key']};});_0x219eee['model']=_[_0x38cc('0x2f')](_0x55f9f8,'name');_0x219eee[_0x38cc('0x34')]=_[_0x38cc('0x35')](_0x58a7fb[_0x38cc('0x34')]);_0x219eee[_0x38cc('0x36')]=_[_0x38cc('0x37')](_0x219eee[_0x38cc('0x38')],_0x219eee[_0x38cc('0x34')]);_0x1a16f6[_0x38cc('0x39')]=_[_0x38cc('0x37')](_0x219eee['model'],qs[_0x38cc('0x3a')](_0x58a7fb[_0x38cc('0x34')][_0x38cc('0x3a')]));_0x1a16f6['attributes']=_0x1a16f6[_0x38cc('0x39')][_0x38cc('0x3b')]?_0x1a16f6[_0x38cc('0x39')]:_0x219eee[_0x38cc('0x38')];if(!_0x58a7fb['query'][_0x38cc('0x3c')](_0x38cc('0x3d'))){_0x1a16f6[_0x38cc('0x1f')]=qs[_0x38cc('0x1f')](_0x58a7fb[_0x38cc('0x34')][_0x38cc('0x1f')]);_0x1a16f6['offset']=qs[_0x38cc('0x1e')](_0x58a7fb[_0x38cc('0x34')][_0x38cc('0x1e')]);}_0x1a16f6[_0x38cc('0x3e')]=qs[_0x38cc('0x3f')](_0x58a7fb[_0x38cc('0x34')][_0x38cc('0x3f')]);_0x1a16f6['where']=qs[_0x38cc('0x36')](_[_0x38cc('0x40')](_0x58a7fb[_0x38cc('0x34')],_0x219eee[_0x38cc('0x36')]),_0x55f9f8);if(_0x58a7fb['query'][_0x38cc('0x41')]){_0x1a16f6[_0x38cc('0x42')]=_[_0x38cc('0x43')](_0x1a16f6[_0x38cc('0x42')],{'$or':_['map'](_0x55f9f8,function(_0x2b753f){if(_0x2b753f['type']!==_0x38cc('0x44')){var _0x3668f9={};_0x3668f9[_0x2b753f['name']]={'$like':'%'+_0x58a7fb[_0x38cc('0x34')][_0x38cc('0x41')]+'%'};return _0x3668f9;}})});}_0x1a16f6=_[_0x38cc('0x43')]({},_0x1a16f6,_0x58a7fb[_0x38cc('0x45')]);var _0x47a543={'where':_0x1a16f6['where']};return db['Sound'][_0x38cc('0x1d')](_0x47a543)[_0x38cc('0x25')](function(_0x40388c){_0x5211d1[_0x38cc('0x1d')]=_0x40388c;if(_0x58a7fb['query'][_0x38cc('0x46')]){_0x1a16f6[_0x38cc('0x47')]=[{'all':!![]}];}return db[_0x38cc('0x30')]['findAll'](_0x1a16f6);})[_0x38cc('0x25')](function(_0xa0401e){_0x5211d1['rows']=_0xa0401e;return _0x5211d1;})[_0x38cc('0x25')](respondWithFilteredResult(_0x5f51f5,_0x1a16f6))[_0x38cc('0x48')](handleError(_0x5f51f5,null));};exports['show']=function(_0x1f8c0f,_0x1d277d){var _0x44e2e2={'raw':!![],'where':{'id':_0x1f8c0f['params']['id']}},_0x276c2c={};_0x276c2c[_0x38cc('0x38')]=_[_0x38cc('0x35')](db[_0x38cc('0x30')][_0x38cc('0x31')]);_0x276c2c[_0x38cc('0x34')]=_[_0x38cc('0x35')](_0x1f8c0f[_0x38cc('0x34')]);_0x276c2c['filters']=_['intersection'](_0x276c2c[_0x38cc('0x38')],_0x276c2c[_0x38cc('0x34')]);_0x44e2e2[_0x38cc('0x39')]=_[_0x38cc('0x37')](_0x276c2c['model'],qs[_0x38cc('0x3a')](_0x1f8c0f[_0x38cc('0x34')][_0x38cc('0x3a')]));_0x44e2e2[_0x38cc('0x39')]=_0x44e2e2['attributes']['length']?_0x44e2e2[_0x38cc('0x39')]:_0x276c2c[_0x38cc('0x38')];if(_0x1f8c0f[_0x38cc('0x34')]['includeAll']){_0x44e2e2[_0x38cc('0x47')]=[{'all':!![]}];}_0x44e2e2=_[_0x38cc('0x43')]({},_0x44e2e2,_0x1f8c0f[_0x38cc('0x45')]);return db['Sound'][_0x38cc('0x49')](_0x44e2e2)[_0x38cc('0x25')](handleEntityNotFound(_0x1d277d,null))[_0x38cc('0x25')](respondWithResult(_0x1d277d,null))[_0x38cc('0x48')](handleError(_0x1d277d,null));};exports['download']=function(_0x11f312,_0x17e099,_0x744d80){return db[_0x38cc('0x30')][_0x38cc('0x49')]({'where':{'id':_0x11f312[_0x38cc('0x4a')]['id']},'attributes':['name','save_name',_0x38cc('0x4b')],'raw':!![]})[_0x38cc('0x25')](handleEntityNotFound(_0x17e099,null))[_0x38cc('0x25')](function(_0xae341e){if(_0xae341e){if(!fs[_0x38cc('0x4c')](path[_0x38cc('0x4d')](config['root'],_0x38cc('0x4e'),_0xae341e[_0x38cc('0x4f')]+'.'+_0xae341e[_0x38cc('0x4b')]))){throw new db[(_0x38cc('0x50'))]['ValidationError'](_0x38cc('0x51'));}return _0x17e099['download'](path['join'](config[_0x38cc('0x52')],_0x38cc('0x4e'),util[_0x38cc('0x53')]('%s.%s',_0xae341e[_0x38cc('0x4f')],_0xae341e[_0x38cc('0x4b')])),util[_0x38cc('0x53')](_0x38cc('0x54'),_0xae341e['name'],_0xae341e['converted_format']));}return null;})[_0x38cc('0x48')](handleError(_0x17e099,null));};exports[_0x38cc('0x55')]=function(_0x5d27ff,_0x59c006,_0x4bc4e4){var _0x2b364a={'name':path[_0x38cc('0x56')](_0x5d27ff[_0x38cc('0x57')][_0x38cc('0x58')],path['extname'](_0x5d27ff[_0x38cc('0x57')][_0x38cc('0x58')])),'save_name':path['basename'](_0x5d27ff[_0x38cc('0x57')][_0x38cc('0x59')],path[_0x38cc('0x5a')](_0x5d27ff[_0x38cc('0x57')]['filename'])),'original_format':path[_0x38cc('0x5a')](_0x5d27ff[_0x38cc('0x57')]['originalname'])[_0x38cc('0x5b')](0x1),'converted_format':'wav'};var _0x5289fa=path[_0x38cc('0x4d')](config[_0x38cc('0x52')],_0x38cc('0x5c'),_0x5d27ff[_0x38cc('0x57')]['filename']);var _0x1965d5=path[_0x38cc('0x4d')](config[_0x38cc('0x52')],_0x38cc('0x4e'),util[_0x38cc('0x53')](_0x38cc('0x54'),path['basename'](_0x5d27ff['file'][_0x38cc('0x59')],path[_0x38cc('0x5a')](_0x5d27ff[_0x38cc('0x57')]['filename'])),_0x2b364a['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x5289fa);logger[_0x38cc('0x5d')](_0x38cc('0x5e'),_0x1965d5);try{fs['chmodSync'](_0x5289fa,parseInt(_0x38cc('0x5f'),0x8));var _0x1da96d=sox[_0x38cc('0x60')](_0x5289fa,_0x1965d5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1da96d['on'](_0x38cc('0x2a'),function(_0x4e1a73){fs[_0x38cc('0x61')](_0x5289fa);_0x59c006[_0x38cc('0x1a')](0x1f4)[_0x38cc('0x2d')](_0x4e1a73);});_0x1da96d['on']('src',function(_0x5ea4be){_0x2b364a[_0x38cc('0x62')]=isNaN(_0x5ea4be[_0x38cc('0x63')])?null:_0x5ea4be[_0x38cc('0x63')]*0x3e8;_0x2b364a[_0x38cc('0x64')]=isNaN(_0x5ea4be[_0x38cc('0x65')])?null:_0x5ea4be[_0x38cc('0x65')];_0x2b364a[_0x38cc('0x66')]=isNaN(_0x5ea4be[_0x38cc('0x67')])?null:_0x5ea4be[_0x38cc('0x67')];_0x2b364a[_0x38cc('0x68')]=isNaN(_0x5ea4be[_0x38cc('0x69')])?null:_0x5ea4be[_0x38cc('0x69')];_0x2b364a[_0x38cc('0x6a')]=isNaN(_0x5ea4be['sampleRate'])?null:_0x5ea4be[_0x38cc('0x6b')];});_0x1da96d['on']('dest',function(_0x82c466){_0x2b364a[_0x38cc('0x6c')]=isNaN(_0x82c466['duration'])?null:_0x82c466['duration']*0x3e8;_0x2b364a[_0x38cc('0x6d')]=isNaN(_0x82c466[_0x38cc('0x65')])?null:_0x82c466['sampleCount'];_0x2b364a[_0x38cc('0x6e')]=isNaN(_0x82c466[_0x38cc('0x67')])?null:_0x82c466[_0x38cc('0x67')];_0x2b364a[_0x38cc('0x6f')]=isNaN(_0x82c466[_0x38cc('0x69')])?null:_0x82c466[_0x38cc('0x69')];_0x2b364a[_0x38cc('0x70')]=isNaN(_0x82c466[_0x38cc('0x6b')])?null:_0x82c466[_0x38cc('0x6b')];});_0x1da96d['on'](_0x38cc('0x29'),function(){fs[_0x38cc('0x71')](_0x1965d5,parseInt('0777',0x8));return db['Sound'][_0x38cc('0x55')](_0x2b364a)[_0x38cc('0x25')](function(_0x184ece){var _0x113a25={'role':_0x5d27ff[_0x38cc('0x72')][_0x38cc('0x73')],'userProfileId':_0x5d27ff['body'][_0x38cc('0x74')]};if(!_0x113a25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x113a25['role']===_0x38cc('0x75')){var _0x3b99da=_0x184ece['get']({'plain':!![]});return db[_0x38cc('0x76')][_0x38cc('0x49')]({'where':{'name':_0x38cc('0x77'),'userProfileId':_0x113a25[_0x38cc('0x74')]},'raw':!![]})[_0x38cc('0x25')](function(_0x4365b7){if(_0x4365b7&&_0x4365b7[_0x38cc('0x78')]===0x0){return db[_0x38cc('0x27')][_0x38cc('0x55')]({'name':_0x3b99da[_0x38cc('0x2c')],'resourceId':_0x3b99da['id'],'type':_0x4365b7[_0x38cc('0x2c')],'sectionId':_0x4365b7['id']},{})[_0x38cc('0x25')](function(){return _0x184ece;});}else{return _0x184ece;}})[_0x38cc('0x48')](function(_0xf2b981){logger[_0x38cc('0x2a')](_0x38cc('0x79'),_0xf2b981);throw _0xf2b981;});}return _0x184ece;})[_0x38cc('0x25')](respondWithResult(_0x59c006,null))[_0x38cc('0x48')](handleError(_0x59c006,null));});_0x1da96d[_0x38cc('0x7a')]();}catch(_0x139c37){_0x59c006[_0x38cc('0x1a')](0x1f4)[_0x38cc('0x2d')](_0x139c37);}};exports[_0x38cc('0x7b')]=function(_0x560ab5,_0x2d7735,_0x23f3b7){return db[_0x38cc('0x30')][_0x38cc('0x49')]({'where':{'id':_0x560ab5[_0x38cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d7735,null))[_0x38cc('0x25')](saveUpdates(_['pick'](_0x560ab5[_0x38cc('0x72')],[_0x38cc('0x2c'),_0x38cc('0x7c')]),null))[_0x38cc('0x25')](respondWithResult(_0x2d7735,null))[_0x38cc('0x48')](handleError(_0x2d7735,null));};exports[_0x38cc('0x7d')]=function(_0x447efa,_0x3a61dd,_0x1236d7){return db[_0x38cc('0x30')][_0x38cc('0x49')]({'where':{'id':_0x447efa['params']['id']}})[_0x38cc('0x25')](function(_0x3b08a6){if(_0x3b08a6){return _0x3b08a6[_0x38cc('0x28')]();}})[_0x38cc('0x25')](function(_0x23787d){var _0x141d3a=path['join'](config[_0x38cc('0x52')],_0x38cc('0x5c'),util[_0x38cc('0x53')](_0x38cc('0x54'),_0x23787d['save_name'],_0x23787d[_0x38cc('0x7e')]));var _0x46fc5f=path[_0x38cc('0x4d')](config[_0x38cc('0x52')],_0x38cc('0x4e'),util[_0x38cc('0x53')]('%s.%s',_0x23787d['save_name'],_0x23787d[_0x38cc('0x4b')]));fs['unlinkSync'](_0x141d3a);fs[_0x38cc('0x61')](_0x46fc5f);return _0x23787d;})[_0x38cc('0x25')](function(_0xd8fc93){if(_0xd8fc93){return _0x3a61dd[_0x38cc('0x1a')](0xcc)['end']();}})[_0x38cc('0x25')](handleEntityNotFound(_0x3a61dd,null))['catch'](handleError(_0x3a61dd,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index afe5915..6f798d9 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 _0x3aa6=['request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','moment','bluebird'];(function(_0x14714e,_0xa858d5){var _0x30ad6f=function(_0x2c51e0){while(--_0x2c51e0){_0x14714e['push'](_0x14714e['shift']());}};_0x30ad6f(++_0xa858d5);}(_0x3aa6,0x7f));var _0x63aa=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x3aa6[_0x427d3a];return _0xe5c521;};'use strict';var _=require(_0x63aa('0x0'));var util=require(_0x63aa('0x1'));var logger=require(_0x63aa('0x2'))('api');var moment=require(_0x63aa('0x3'));var BPromise=require(_0x63aa('0x4'));var rp=require(_0x63aa('0x5'));var fs=require('fs');var path=require(_0x63aa('0x6'));var rimraf=require('rimraf');var config=require(_0x63aa('0x7'));var attributes=require(_0x63aa('0x8'));module[_0x63aa('0x9')]=function(_0x51dfd1,_0x11ffc0){return _0x51dfd1[_0x63aa('0xa')](_0x63aa('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cdf=['define','tools_sounds','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4b82f0,_0x4a1487){var _0x494eff=function(_0x4ea3fc){while(--_0x4ea3fc){_0x4b82f0['push'](_0x4b82f0['shift']());}};_0x494eff(++_0x4a1487);}(_0x0cdf,0x13d));var _0xf0cd=function(_0x3e7b59,_0x14a4cd){_0x3e7b59=_0x3e7b59-0x0;var _0x4bd64a=_0x0cdf[_0x3e7b59];return _0x4bd64a;};'use strict';var _=require('lodash');var util=require(_0xf0cd('0x0'));var logger=require(_0xf0cd('0x1'))('api');var moment=require(_0xf0cd('0x2'));var BPromise=require('bluebird');var rp=require(_0xf0cd('0x3'));var fs=require('fs');var path=require(_0xf0cd('0x4'));var rimraf=require(_0xf0cd('0x5'));var config=require(_0xf0cd('0x6'));var attributes=require('./sound.attributes');module['exports']=function(_0x13ded1,_0x38d2be){return _0x13ded1[_0xf0cd('0x7')]('Sound',attributes,{'tableName':_0xf0cd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d00bbe3..50ef02a 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 _0x913f=['attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSound','Sound','options','raw','where','include','map','model'];(function(_0xa5446,_0x5790dc){var _0x67c343=function(_0x1486e9){while(--_0x1486e9){_0xa5446['push'](_0xa5446['shift']());}};_0x67c343(++_0x5790dc);}(_0x913f,0x10f));var _0xf913=function(_0x252e31,_0xc44a24){_0x252e31=_0x252e31-0x0;var _0x464545=_0x913f[_0x252e31];return _0x464545;};'use strict';var _=require('lodash');var util=require(_0xf913('0x0'));var moment=require(_0xf913('0x1'));var BPromise=require('bluebird');var rs=require(_0xf913('0x2'));var fs=require('fs');var Redis=require(_0xf913('0x3'));var db=require(_0xf913('0x4'))['db'];var utils=require(_0xf913('0x5'));var logger=require(_0xf913('0x6'))('rpc');var config=require(_0xf913('0x7'));var jayson=require(_0xf913('0x8'));var client=jayson['client'][_0xf913('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x92c69f,_0x3ab1e8,_0x325754){return new BPromise(function(_0x4a178e,_0x4ccb95){return client[_0xf913('0xa')](_0x92c69f,_0x325754)[_0xf913('0xb')](function(_0x99861f){logger[_0xf913('0xc')](_0xf913('0xd'),_0x3ab1e8,_0xf913('0xe'));logger[_0xf913('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x3ab1e8,_0xf913('0xe'),JSON[_0xf913('0x10')](_0x99861f));if(_0x99861f[_0xf913('0x11')]){if(_0x99861f['error']['code']===0x1f4){logger[_0xf913('0x11')](_0xf913('0xd'),_0x3ab1e8,_0x99861f['error'][_0xf913('0x12')]);return _0x4ccb95(_0x99861f[_0xf913('0x11')][_0xf913('0x12')]);}logger[_0xf913('0x11')](_0xf913('0xd'),_0x3ab1e8,_0x99861f['error']['message']);return _0x4a178e(_0x99861f[_0xf913('0x11')][_0xf913('0x12')]);}else{logger[_0xf913('0xc')](_0xf913('0xd'),_0x3ab1e8,_0xf913('0xe'));_0x4a178e(_0x99861f[_0xf913('0x13')][_0xf913('0x12')]);}})[_0xf913('0x14')](function(_0xf94843){logger[_0xf913('0x11')]('Sound,\x20%s,\x20%s',_0x3ab1e8,_0xf94843);_0x4ccb95(_0xf94843);});});}exports[_0xf913('0x15')]=function(_0x13b678){var _0x204ea4=this;return new Promise(function(_0x48f817,_0x4138d7){return db[_0xf913('0x16')]['find']({'raw':_0x13b678[_0xf913('0x17')]?_0x13b678['options'][_0xf913('0x18')]===undefined?!![]:![]:!![],'where':_0x13b678[_0xf913('0x17')]?_0x13b678['options'][_0xf913('0x19')]||null:null,'attributes':_0x13b678[_0xf913('0x17')]?_0x13b678[_0xf913('0x17')]['attributes']||null:null,'include':_0x13b678[_0xf913('0x17')]?_0x13b678['options'][_0xf913('0x1a')]?_[_0xf913('0x1b')](_0x13b678[_0xf913('0x17')][_0xf913('0x1a')],function(_0xed1731){return{'model':db[_0xed1731[_0xf913('0x1c')]],'as':_0xed1731['as'],'attributes':_0xed1731[_0xf913('0x1d')],'include':_0xed1731[_0xf913('0x1a')]?_[_0xf913('0x1b')](_0xed1731[_0xf913('0x1a')],function(_0x1bc05b){return{'model':db[_0x1bc05b['model']],'as':_0x1bc05b['as'],'attributes':_0x1bc05b['attributes'],'include':_0x1bc05b[_0xf913('0x1a')]?_[_0xf913('0x1b')](_0x1bc05b[_0xf913('0x1a')],function(_0x3479d9){return{'model':db[_0x3479d9[_0xf913('0x1c')]],'as':_0x3479d9['as'],'attributes':_0x3479d9[_0xf913('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf913('0xb')](function(_0x5eb981){logger['info']('ShowSound',_0x13b678);logger['debug'](_0xf913('0x15'),_0x13b678,JSON[_0xf913('0x10')](_0x5eb981));_0x48f817(_0x5eb981);})[_0xf913('0x14')](function(_0x13a34f){logger[_0xf913('0x11')]('ShowSound',_0x13a34f[_0xf913('0x12')],_0x13b678);_0x4138d7(_0x204ea4['error'](0x1f4,_0x13a34f['message']));});});}; \ No newline at end of file +var _0x0d44=['attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSound','Sound','options','raw','where'];(function(_0x10feaf,_0x15d7bf){var _0x459d54=function(_0x1f9312){while(--_0x1f9312){_0x10feaf['push'](_0x10feaf['shift']());}};_0x459d54(++_0x15d7bf);}(_0x0d44,0x112));var _0x40d4=function(_0x191830,_0x199a04){_0x191830=_0x191830-0x0;var _0x4494ab=_0x0d44[_0x191830];return _0x4494ab;};'use strict';var _=require(_0x40d4('0x0'));var util=require(_0x40d4('0x1'));var moment=require(_0x40d4('0x2'));var BPromise=require(_0x40d4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d4('0x4'));var db=require(_0x40d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40d4('0x6'))(_0x40d4('0x7'));var config=require(_0x40d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x40d4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4821,_0x4b812f,_0x2e0e56){return new BPromise(function(_0x2524cd,_0x4b5298){return client[_0x40d4('0xa')](_0x1f4821,_0x2e0e56)[_0x40d4('0xb')](function(_0x35aa6f){logger[_0x40d4('0xc')](_0x40d4('0xd'),_0x4b812f,_0x40d4('0xe'));logger[_0x40d4('0xf')](_0x40d4('0x10'),_0x4b812f,_0x40d4('0xe'),JSON[_0x40d4('0x11')](_0x35aa6f));if(_0x35aa6f[_0x40d4('0x12')]){if(_0x35aa6f['error'][_0x40d4('0x13')]===0x1f4){logger[_0x40d4('0x12')](_0x40d4('0xd'),_0x4b812f,_0x35aa6f[_0x40d4('0x12')][_0x40d4('0x14')]);return _0x4b5298(_0x35aa6f[_0x40d4('0x12')][_0x40d4('0x14')]);}logger[_0x40d4('0x12')]('Sound,\x20%s,\x20%s',_0x4b812f,_0x35aa6f[_0x40d4('0x12')][_0x40d4('0x14')]);return _0x2524cd(_0x35aa6f[_0x40d4('0x12')][_0x40d4('0x14')]);}else{logger[_0x40d4('0xc')](_0x40d4('0xd'),_0x4b812f,_0x40d4('0xe'));_0x2524cd(_0x35aa6f['result'][_0x40d4('0x14')]);}})['catch'](function(_0x381d8b){logger[_0x40d4('0x12')](_0x40d4('0xd'),_0x4b812f,_0x381d8b);_0x4b5298(_0x381d8b);});});}exports[_0x40d4('0x15')]=function(_0x6eb977){var _0x49c67e=this;return new Promise(function(_0x183bd5,_0x397808){return db[_0x40d4('0x16')]['find']({'raw':_0x6eb977[_0x40d4('0x17')]?_0x6eb977[_0x40d4('0x17')][_0x40d4('0x18')]===undefined?!![]:![]:!![],'where':_0x6eb977[_0x40d4('0x17')]?_0x6eb977[_0x40d4('0x17')][_0x40d4('0x19')]||null:null,'attributes':_0x6eb977[_0x40d4('0x17')]?_0x6eb977[_0x40d4('0x17')][_0x40d4('0x1a')]||null:null,'include':_0x6eb977[_0x40d4('0x17')]?_0x6eb977[_0x40d4('0x17')]['include']?_['map'](_0x6eb977[_0x40d4('0x17')][_0x40d4('0x1b')],function(_0x3d1977){return{'model':db[_0x3d1977[_0x40d4('0x1c')]],'as':_0x3d1977['as'],'attributes':_0x3d1977[_0x40d4('0x1a')],'include':_0x3d1977[_0x40d4('0x1b')]?_[_0x40d4('0x1d')](_0x3d1977[_0x40d4('0x1b')],function(_0x1ad615){return{'model':db[_0x1ad615['model']],'as':_0x1ad615['as'],'attributes':_0x1ad615[_0x40d4('0x1a')],'include':_0x1ad615[_0x40d4('0x1b')]?_[_0x40d4('0x1d')](_0x1ad615[_0x40d4('0x1b')],function(_0x93138a){return{'model':db[_0x93138a[_0x40d4('0x1c')]],'as':_0x93138a['as'],'attributes':_0x93138a[_0x40d4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x40d4('0xb')](function(_0x3e4f46){logger['info']('ShowSound',_0x6eb977);logger[_0x40d4('0xf')](_0x40d4('0x15'),_0x6eb977,JSON[_0x40d4('0x11')](_0x3e4f46));_0x183bd5(_0x3e4f46);})['catch'](function(_0x477673){logger[_0x40d4('0x12')](_0x40d4('0x15'),_0x477673[_0x40d4('0x14')],_0x6eb977);_0x397808(_0x49c67e[_0x40d4('0x12')](0x1f4,_0x477673['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 2c1de48..b6f41ff 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0xa16cc0,_0x217e43){var _0x5b7c04=function(_0xb3e2eb){while(--_0xb3e2eb){_0xa16cc0['push'](_0xa16cc0['shift']());}};_0x5b7c04(++_0x217e43);}(_0xda2d,0x102));var _0xdda2=function(_0x3579b5,_0x1d9290){_0x3579b5=_0x3579b5-0x0;var _0x193e3b=_0xda2d[_0x3579b5];return _0x193e3b;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xda2d,0x102));var _0xdda2=function(_0x3aee6e,_0x28a8e8){_0x3aee6e=_0x3aee6e-0x0;var _0x3c3948=_0xda2d[_0x3aee6e];return _0x3c3948;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 5349a78..d671252 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 _0x3f29=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x3f29,0x1cf));var _0x93f2=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3f29[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x93f2('0x0'));module[_0x93f2('0x1')]={'uniqueid':{'type':Sequelize[_0x93f2('0x2')]},'body':{'type':Sequelize[_0x93f2('0x3')](_0x93f2('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x93f2('0x5')),'defaultValue':_0x93f2('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x93f2('0x2')]},'providerResponse':{'type':Sequelize[_0x93f2('0x3')]}}; \ No newline at end of file +var _0x8f04=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f04,0x176));var _0x48f0=function(_0xe4bb6d,_0x2723ee){_0xe4bb6d=_0xe4bb6d-0x0;var _0x15cfe6=_0x8f04[_0xe4bb6d];return _0x15cfe6;};'use strict';var Sequelize=require(_0x48f0('0x0'));module[_0x48f0('0x1')]={'uniqueid':{'type':Sequelize[_0x48f0('0x2')]},'body':{'type':Sequelize[_0x48f0('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x48f0('0x4')]('in','out'),'defaultValue':_0x48f0('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x48f0('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 1f510f2..5be923e 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 _0x536e=['ejs','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','SquareMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','update','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x536e,0x111));var _0xe536=function(_0xab58e1,_0x5d47ce){_0xab58e1=_0xab58e1-0x0;var _0x295351=_0x536e[_0xab58e1];return _0x295351;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe536('0x0'));var zipdir=require(_0xe536('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe536('0x2'));var BPromise=require(_0xe536('0x3'));var Mustache=require(_0xe536('0x4'));var util=require(_0xe536('0x5'));var path=require(_0xe536('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe536('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe536('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe536('0x9'));var toCsv=require(_0xe536('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe536('0xb'));var authService=require(_0xe536('0xc'));var qs=require(_0xe536('0xd'));var as=require(_0xe536('0xe'));var hardwareService=require(_0xe536('0xf'));var logger=require(_0xe536('0x10'))(_0xe536('0x11'));var utils=require(_0xe536('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe536('0x13'))['db'];function respondWithStatusCode(_0x40767e,_0x3429df){_0x3429df=_0x3429df||0xcc;return function(_0x3f1ea4){if(_0x3f1ea4){return _0x40767e[_0xe536('0x14')](_0x3429df);}return _0x40767e[_0xe536('0x15')](_0x3429df)[_0xe536('0x16')]();};}function respondWithResult(_0x185969,_0x5e8c5c){_0x5e8c5c=_0x5e8c5c||0xc8;return function(_0x3df7e7){if(_0x3df7e7){return _0x185969[_0xe536('0x15')](_0x5e8c5c)[_0xe536('0x17')](_0x3df7e7);}};}function respondWithFilteredResult(_0x562bf3,_0x451e7b){return function(_0x1d5939){if(_0x1d5939){var _0x16bd53=typeof _0x451e7b[_0xe536('0x18')]==='undefined'&&typeof _0x451e7b[_0xe536('0x19')]===_0xe536('0x1a');var _0x2ae487=_0x1d5939['count'];var _0x342988=_0x16bd53?0x0:_0x451e7b[_0xe536('0x18')];var _0x571570=_0x16bd53?_0x1d5939[_0xe536('0x1b')]:_0x451e7b[_0xe536('0x18')]+_0x451e7b[_0xe536('0x19')];var _0xeac20e;if(_0x571570>=_0x2ae487){_0x571570=_0x2ae487;_0xeac20e=0xc8;}else{_0xeac20e=0xce;}_0x562bf3['status'](_0xeac20e);return _0x562bf3[_0xe536('0x1c')](_0xe536('0x1d'),_0x342988+'-'+_0x571570+'/'+_0x2ae487)['json'](_0x1d5939);}return null;};}function patchUpdates(_0x2940ff){return function(_0x410656){try{jsonpatch[_0xe536('0x1e')](_0x410656,_0x2940ff,!![]);}catch(_0x4287ff){return BPromise[_0xe536('0x1f')](_0x4287ff);}return _0x410656[_0xe536('0x20')]();};}function saveUpdates(_0x49f603,_0x31dc6c){return function(_0x587879){if(_0x587879){return _0x587879['update'](_0x49f603)['then'](function(_0x19b839){return _0x19b839;});}return null;};}function removeEntity(_0x5ba038,_0x2a3818){return function(_0x16fb7c){if(_0x16fb7c){return _0x16fb7c[_0xe536('0x21')]()[_0xe536('0x22')](function(){_0x5ba038[_0xe536('0x15')](0xcc)[_0xe536('0x16')]();});}};}function handleEntityNotFound(_0x595785,_0xba2c27){return function(_0x32893f){if(!_0x32893f){_0x595785[_0xe536('0x14')](0x194);}return _0x32893f;};}function handleError(_0x24605f,_0x43f25e){_0x43f25e=_0x43f25e||0x1f4;return function(_0x197f09){logger['error'](_0x197f09[_0xe536('0x23')]);if(_0x197f09[_0xe536('0x24')]){delete _0x197f09[_0xe536('0x24')];}_0x24605f['status'](_0x43f25e)[_0xe536('0x25')](_0x197f09);};}exports['index']=function(_0x48a8e2,_0x497bba){var _0x177aff={},_0x2faeb3={},_0x1a7205={'count':0x0,'rows':[]};var _0x33ec18=_[_0xe536('0x26')](db[_0xe536('0x27')][_0xe536('0x28')],function(_0x1c29ed){return{'name':_0x1c29ed[_0xe536('0x29')],'type':_0x1c29ed['type'][_0xe536('0x2a')]};});_0x2faeb3[_0xe536('0x2b')]=_[_0xe536('0x26')](_0x33ec18,_0xe536('0x24'));_0x2faeb3['query']=_[_0xe536('0x2c')](_0x48a8e2[_0xe536('0x2d')]);_0x2faeb3[_0xe536('0x2e')]=_[_0xe536('0x2f')](_0x2faeb3[_0xe536('0x2b')],_0x2faeb3[_0xe536('0x2d')]);_0x177aff[_0xe536('0x30')]=_[_0xe536('0x2f')](_0x2faeb3[_0xe536('0x2b')],qs[_0xe536('0x31')](_0x48a8e2[_0xe536('0x2d')][_0xe536('0x31')]));_0x177aff[_0xe536('0x30')]=_0x177aff[_0xe536('0x30')]['length']?_0x177aff[_0xe536('0x30')]:_0x2faeb3['model'];if(!_0x48a8e2[_0xe536('0x2d')]['hasOwnProperty'](_0xe536('0x32'))){_0x177aff[_0xe536('0x19')]=qs['limit'](_0x48a8e2[_0xe536('0x2d')]['limit']);_0x177aff[_0xe536('0x18')]=qs[_0xe536('0x18')](_0x48a8e2[_0xe536('0x2d')][_0xe536('0x18')]);}_0x177aff[_0xe536('0x33')]=qs[_0xe536('0x34')](_0x48a8e2[_0xe536('0x2d')][_0xe536('0x34')]);_0x177aff[_0xe536('0x35')]=qs[_0xe536('0x2e')](_[_0xe536('0x36')](_0x48a8e2['query'],_0x2faeb3[_0xe536('0x2e')]),_0x33ec18);if(_0x48a8e2[_0xe536('0x2d')][_0xe536('0x37')]){_0x177aff[_0xe536('0x35')]=_['merge'](_0x177aff[_0xe536('0x35')],{'$or':_[_0xe536('0x26')](_0x33ec18,function(_0x33365b){if(_0x33365b[_0xe536('0x38')]!=='VIRTUAL'){var _0x5ad164={};_0x5ad164[_0x33365b[_0xe536('0x24')]]={'$like':'%'+_0x48a8e2[_0xe536('0x2d')][_0xe536('0x37')]+'%'};return _0x5ad164;}})});}_0x177aff=_['merge']({},_0x177aff,_0x48a8e2[_0xe536('0x39')]);var _0x14f9ad={'where':_0x177aff[_0xe536('0x35')]};return db[_0xe536('0x27')][_0xe536('0x1b')](_0x14f9ad)[_0xe536('0x22')](function(_0x3d54c7){_0x1a7205[_0xe536('0x1b')]=_0x3d54c7;if(_0x48a8e2[_0xe536('0x2d')][_0xe536('0x3a')]){_0x177aff[_0xe536('0x3b')]=[{'all':!![]}];}return db[_0xe536('0x27')][_0xe536('0x3c')](_0x177aff);})[_0xe536('0x22')](function(_0x52f4cf){_0x1a7205[_0xe536('0x3d')]=_0x52f4cf;return _0x1a7205;})[_0xe536('0x22')](respondWithFilteredResult(_0x497bba,_0x177aff))[_0xe536('0x3e')](handleError(_0x497bba,null));};exports[_0xe536('0x3f')]=function(_0x2b9537,_0x23910f){var _0x4eaeee={'raw':!![],'where':{'id':_0x2b9537[_0xe536('0x40')]['id']}},_0x4d3fc9={};_0x4d3fc9[_0xe536('0x2b')]=_[_0xe536('0x2c')](db[_0xe536('0x27')]['rawAttributes']);_0x4d3fc9[_0xe536('0x2d')]=_['keys'](_0x2b9537['query']);_0x4d3fc9['filters']=_[_0xe536('0x2f')](_0x4d3fc9[_0xe536('0x2b')],_0x4d3fc9[_0xe536('0x2d')]);_0x4eaeee[_0xe536('0x30')]=_[_0xe536('0x2f')](_0x4d3fc9[_0xe536('0x2b')],qs[_0xe536('0x31')](_0x2b9537[_0xe536('0x2d')][_0xe536('0x31')]));_0x4eaeee[_0xe536('0x30')]=_0x4eaeee[_0xe536('0x30')]['length']?_0x4eaeee[_0xe536('0x30')]:_0x4d3fc9[_0xe536('0x2b')];if(_0x2b9537['query'][_0xe536('0x3a')]){_0x4eaeee[_0xe536('0x3b')]=[{'all':!![]}];}_0x4eaeee=_[_0xe536('0x41')]({},_0x4eaeee,_0x2b9537[_0xe536('0x39')]);return db[_0xe536('0x27')][_0xe536('0x42')](_0x4eaeee)['then'](handleEntityNotFound(_0x23910f,null))[_0xe536('0x22')](respondWithResult(_0x23910f,null))[_0xe536('0x3e')](handleError(_0x23910f,null));};exports[_0xe536('0x43')]=function(_0x17055b,_0x2c91ba){return db['SquareMessage'][_0xe536('0x43')](_0x17055b[_0xe536('0x44')],{})[_0xe536('0x22')](respondWithResult(_0x2c91ba,0xc9))[_0xe536('0x3e')](handleError(_0x2c91ba,null));};exports[_0xe536('0x45')]=function(_0xb0c2a0,_0x3f2803){if(_0xb0c2a0[_0xe536('0x44')]['id']){delete _0xb0c2a0['body']['id'];}return db['SquareMessage'][_0xe536('0x42')]({'where':{'id':_0xb0c2a0[_0xe536('0x40')]['id']}})[_0xe536('0x22')](handleEntityNotFound(_0x3f2803,null))['then'](saveUpdates(_0xb0c2a0[_0xe536('0x44')],null))[_0xe536('0x22')](respondWithResult(_0x3f2803,null))[_0xe536('0x3e')](handleError(_0x3f2803,null));};exports[_0xe536('0x21')]=function(_0x350ab1,_0x3245a2){return db[_0xe536('0x27')][_0xe536('0x42')]({'where':{'id':_0x350ab1[_0xe536('0x40')]['id']}})[_0xe536('0x22')](handleEntityNotFound(_0x3245a2,null))[_0xe536('0x22')](removeEntity(_0x3245a2,null))[_0xe536('0x3e')](handleError(_0x3245a2,null));}; \ No newline at end of file +var _0x5d30=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','then','destroy','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0x3e6ee3,_0x497ba4){var _0x44a25a=function(_0x22222e){while(--_0x22222e){_0x3e6ee3['push'](_0x3e6ee3['shift']());}};_0x44a25a(++_0x497ba4);}(_0x5d30,0x135));var _0x05d3=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x5d30[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require(_0x05d3('0x0'));var rimraf=require(_0x05d3('0x1'));var zipdir=require(_0x05d3('0x2'));var jsonpatch=require(_0x05d3('0x3'));var rp=require(_0x05d3('0x4'));var moment=require(_0x05d3('0x5'));var BPromise=require(_0x05d3('0x6'));var Mustache=require(_0x05d3('0x7'));var util=require(_0x05d3('0x8'));var path=require(_0x05d3('0x9'));var sox=require(_0x05d3('0xa'));var csv=require(_0x05d3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05d3('0xc'));var _=require('lodash');var squel=require(_0x05d3('0xd'));var crypto=require(_0x05d3('0xe'));var jsforce=require(_0x05d3('0xf'));var deskjs=require(_0x05d3('0x10'));var toCsv=require(_0x05d3('0xb'));var querystring=require('querystring');var Papa=require(_0x05d3('0x11'));var Redis=require('ioredis');var authService=require(_0x05d3('0x12'));var qs=require(_0x05d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x05d3('0x14'));var config=require(_0x05d3('0x15'));var licenseUtil=require(_0x05d3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x586326,_0x133b67){_0x133b67=_0x133b67||0xcc;return function(_0x108731){if(_0x108731){return _0x586326[_0x05d3('0x17')](_0x133b67);}return _0x586326[_0x05d3('0x18')](_0x133b67)[_0x05d3('0x19')]();};}function respondWithResult(_0x13278f,_0x3cdd0d){_0x3cdd0d=_0x3cdd0d||0xc8;return function(_0x773a31){if(_0x773a31){return _0x13278f['status'](_0x3cdd0d)[_0x05d3('0x1a')](_0x773a31);}};}function respondWithFilteredResult(_0x3a0e4c,_0x190525){return function(_0x1d56c1){if(_0x1d56c1){var _0x64bc41=typeof _0x190525[_0x05d3('0x1b')]==='undefined'&&typeof _0x190525['limit']===_0x05d3('0x1c');var _0x118343=_0x1d56c1[_0x05d3('0x1d')];var _0x5256f6=_0x64bc41?0x0:_0x190525[_0x05d3('0x1b')];var _0xce4f77=_0x64bc41?_0x1d56c1[_0x05d3('0x1d')]:_0x190525['offset']+_0x190525[_0x05d3('0x1e')];var _0x3e4822;if(_0xce4f77>=_0x118343){_0xce4f77=_0x118343;_0x3e4822=0xc8;}else{_0x3e4822=0xce;}_0x3a0e4c['status'](_0x3e4822);return _0x3a0e4c[_0x05d3('0x1f')]('Content-Range',_0x5256f6+'-'+_0xce4f77+'/'+_0x118343)[_0x05d3('0x1a')](_0x1d56c1);}return null;};}function patchUpdates(_0x1a8206){return function(_0x571bd9){try{jsonpatch[_0x05d3('0x20')](_0x571bd9,_0x1a8206,!![]);}catch(_0x3a5528){return BPromise[_0x05d3('0x21')](_0x3a5528);}return _0x571bd9['save']();};}function saveUpdates(_0x3e20a4,_0x1c209c){return function(_0x27bb32){if(_0x27bb32){return _0x27bb32['update'](_0x3e20a4)[_0x05d3('0x22')](function(_0x454965){return _0x454965;});}return null;};}function removeEntity(_0x359bf7,_0x13af4d){return function(_0x2504b9){if(_0x2504b9){return _0x2504b9[_0x05d3('0x23')]()[_0x05d3('0x22')](function(){_0x359bf7[_0x05d3('0x18')](0xcc)[_0x05d3('0x19')]();});}};}function handleEntityNotFound(_0x3885fa,_0x4fd4aa){return function(_0x55bdae){if(!_0x55bdae){_0x3885fa[_0x05d3('0x17')](0x194);}return _0x55bdae;};}function handleError(_0x46568e,_0x1daf46){_0x1daf46=_0x1daf46||0x1f4;return function(_0x3cc1e2){logger[_0x05d3('0x24')](_0x3cc1e2[_0x05d3('0x25')]);if(_0x3cc1e2[_0x05d3('0x26')]){delete _0x3cc1e2[_0x05d3('0x26')];}_0x46568e[_0x05d3('0x18')](_0x1daf46)[_0x05d3('0x27')](_0x3cc1e2);};}exports['index']=function(_0x44ad63,_0x1b8ed0){var _0x4a344d={},_0x12f676={},_0x11f0ee={'count':0x0,'rows':[]};var _0x4074fd=_[_0x05d3('0x28')](db[_0x05d3('0x29')][_0x05d3('0x2a')],function(_0x5de653){return{'name':_0x5de653[_0x05d3('0x2b')],'type':_0x5de653[_0x05d3('0x2c')][_0x05d3('0x2d')]};});_0x12f676[_0x05d3('0x2e')]=_[_0x05d3('0x28')](_0x4074fd,_0x05d3('0x26'));_0x12f676[_0x05d3('0x2f')]=_['keys'](_0x44ad63['query']);_0x12f676['filters']=_[_0x05d3('0x30')](_0x12f676[_0x05d3('0x2e')],_0x12f676[_0x05d3('0x2f')]);_0x4a344d['attributes']=_[_0x05d3('0x30')](_0x12f676['model'],qs['fields'](_0x44ad63['query']['fields']));_0x4a344d[_0x05d3('0x31')]=_0x4a344d['attributes'][_0x05d3('0x32')]?_0x4a344d[_0x05d3('0x31')]:_0x12f676[_0x05d3('0x2e')];if(!_0x44ad63['query'][_0x05d3('0x33')](_0x05d3('0x34'))){_0x4a344d[_0x05d3('0x1e')]=qs[_0x05d3('0x1e')](_0x44ad63[_0x05d3('0x2f')][_0x05d3('0x1e')]);_0x4a344d[_0x05d3('0x1b')]=qs[_0x05d3('0x1b')](_0x44ad63[_0x05d3('0x2f')]['offset']);}_0x4a344d['order']=qs[_0x05d3('0x35')](_0x44ad63[_0x05d3('0x2f')][_0x05d3('0x35')]);_0x4a344d['where']=qs['filters'](_[_0x05d3('0x36')](_0x44ad63['query'],_0x12f676['filters']),_0x4074fd);if(_0x44ad63[_0x05d3('0x2f')][_0x05d3('0x37')]){_0x4a344d[_0x05d3('0x38')]=_[_0x05d3('0x39')](_0x4a344d['where'],{'$or':_[_0x05d3('0x28')](_0x4074fd,function(_0x2fb29e){if(_0x2fb29e[_0x05d3('0x2c')]!==_0x05d3('0x3a')){var _0x2efec9={};_0x2efec9[_0x2fb29e[_0x05d3('0x26')]]={'$like':'%'+_0x44ad63['query'][_0x05d3('0x37')]+'%'};return _0x2efec9;}})});}_0x4a344d=_[_0x05d3('0x39')]({},_0x4a344d,_0x44ad63[_0x05d3('0x3b')]);var _0x1320ca={'where':_0x4a344d[_0x05d3('0x38')]};return db['SquareMessage']['count'](_0x1320ca)[_0x05d3('0x22')](function(_0x3c0b49){_0x11f0ee[_0x05d3('0x1d')]=_0x3c0b49;if(_0x44ad63[_0x05d3('0x2f')][_0x05d3('0x3c')]){_0x4a344d[_0x05d3('0x3d')]=[{'all':!![]}];}return db[_0x05d3('0x29')][_0x05d3('0x3e')](_0x4a344d);})[_0x05d3('0x22')](function(_0x21310c){_0x11f0ee[_0x05d3('0x3f')]=_0x21310c;return _0x11f0ee;})[_0x05d3('0x22')](respondWithFilteredResult(_0x1b8ed0,_0x4a344d))[_0x05d3('0x40')](handleError(_0x1b8ed0,null));};exports[_0x05d3('0x41')]=function(_0x207882,_0x58f1f5){var _0x34d3f3={'raw':!![],'where':{'id':_0x207882[_0x05d3('0x42')]['id']}},_0x25194f={};_0x25194f[_0x05d3('0x2e')]=_[_0x05d3('0x43')](db[_0x05d3('0x29')][_0x05d3('0x2a')]);_0x25194f['query']=_[_0x05d3('0x43')](_0x207882[_0x05d3('0x2f')]);_0x25194f[_0x05d3('0x44')]=_[_0x05d3('0x30')](_0x25194f[_0x05d3('0x2e')],_0x25194f[_0x05d3('0x2f')]);_0x34d3f3[_0x05d3('0x31')]=_['intersection'](_0x25194f[_0x05d3('0x2e')],qs['fields'](_0x207882[_0x05d3('0x2f')]['fields']));_0x34d3f3['attributes']=_0x34d3f3[_0x05d3('0x31')][_0x05d3('0x32')]?_0x34d3f3['attributes']:_0x25194f[_0x05d3('0x2e')];if(_0x207882[_0x05d3('0x2f')][_0x05d3('0x3c')]){_0x34d3f3[_0x05d3('0x3d')]=[{'all':!![]}];}_0x34d3f3=_[_0x05d3('0x39')]({},_0x34d3f3,_0x207882[_0x05d3('0x3b')]);return db[_0x05d3('0x29')][_0x05d3('0x45')](_0x34d3f3)[_0x05d3('0x22')](handleEntityNotFound(_0x58f1f5,null))[_0x05d3('0x22')](respondWithResult(_0x58f1f5,null))['catch'](handleError(_0x58f1f5,null));};exports[_0x05d3('0x46')]=function(_0xe49019,_0x27cfb6){return db['SquareMessage']['create'](_0xe49019[_0x05d3('0x47')],{})[_0x05d3('0x22')](respondWithResult(_0x27cfb6,0xc9))['catch'](handleError(_0x27cfb6,null));};exports[_0x05d3('0x48')]=function(_0x11b0ba,_0x2eb2ef){if(_0x11b0ba['body']['id']){delete _0x11b0ba[_0x05d3('0x47')]['id'];}return db[_0x05d3('0x29')]['find']({'where':{'id':_0x11b0ba[_0x05d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x2eb2ef,null))[_0x05d3('0x22')](saveUpdates(_0x11b0ba[_0x05d3('0x47')],null))[_0x05d3('0x22')](respondWithResult(_0x2eb2ef,null))['catch'](handleError(_0x2eb2ef,null));};exports[_0x05d3('0x23')]=function(_0x26dcda,_0x3eab6a){return db[_0x05d3('0x29')][_0x05d3('0x45')]({'where':{'id':_0x26dcda[_0x05d3('0x42')]['id']}})[_0x05d3('0x22')](handleEntityNotFound(_0x3eab6a,null))[_0x05d3('0x22')](removeEntity(_0x3eab6a,null))[_0x05d3('0x40')](handleError(_0x3eab6a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ae92ed9..3d87327 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 _0x3ea4=['define','SquareMessage','square_messages','util','api','moment','path','../../config/environment','./squareMessage.attributes'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x3ea4,0x198));var _0x43ea=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0x3ea4[_0x3a3d20];return _0x33bc94;};'use strict';var _=require('lodash');var util=require(_0x43ea('0x0'));var logger=require('../../config/logger')(_0x43ea('0x1'));var moment=require(_0x43ea('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ea('0x3'));var rimraf=require('rimraf');var config=require(_0x43ea('0x4'));var attributes=require(_0x43ea('0x5'));module['exports']=function(_0x40d78c,_0x137d48){return _0x40d78c[_0x43ea('0x6')](_0x43ea('0x7'),attributes,{'tableName':_0x43ea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe79c=['define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5770ea,_0x2973dc){var _0x40d868=function(_0x1c7053){while(--_0x1c7053){_0x5770ea['push'](_0x5770ea['shift']());}};_0x40d868(++_0x2973dc);}(_0xe79c,0x117));var _0xce79=function(_0x5d688d,_0x2103cc){_0x5d688d=_0x5d688d-0x0;var _0x41a514=_0xe79c[_0x5d688d];return _0x41a514;};'use strict';var _=require(_0xce79('0x0'));var util=require(_0xce79('0x1'));var logger=require(_0xce79('0x2'))('api');var moment=require(_0xce79('0x3'));var BPromise=require('bluebird');var rp=require(_0xce79('0x4'));var fs=require('fs');var path=require(_0xce79('0x5'));var rimraf=require(_0xce79('0x6'));var config=require(_0xce79('0x7'));var attributes=require('./squareMessage.attributes');module[_0xce79('0x8')]=function(_0x2c6389,_0x1e7dd7){return _0x2c6389[_0xce79('0x9')](_0xce79('0xa'),attributes,{'tableName':_0xce79('0xb'),'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 cd056c6..7d082d3 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 _0x78cd=['../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','moment','bluebird','ioredis'];(function(_0x5e895f,_0x3167d7){var _0x1a6d33=function(_0x1a2c4c){while(--_0x1a2c4c){_0x5e895f['push'](_0x5e895f['shift']());}};_0x1a6d33(++_0x3167d7);}(_0x78cd,0x82));var _0xd78c=function(_0x1012f5,_0x20a3a7){_0x1012f5=_0x1012f5-0x0;var _0x283bd9=_0x78cd[_0x1012f5];return _0x283bd9;};'use strict';var _=require(_0xd78c('0x0'));var util=require(_0xd78c('0x1'));var moment=require(_0xd78c('0x2'));var BPromise=require(_0xd78c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd78c('0x4'));var db=require(_0xd78c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd78c('0x6'));var jayson=require(_0xd78c('0x7'));var client=jayson[_0xd78c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54655d,_0x16b3e7,_0x3c7622){return new BPromise(function(_0x1ef87b,_0x52c8f4){return client[_0xd78c('0x9')](_0x54655d,_0x3c7622)[_0xd78c('0xa')](function(_0x2fba53){logger[_0xd78c('0xb')](_0xd78c('0xc'),_0x16b3e7,_0xd78c('0xd'));logger[_0xd78c('0xe')](_0xd78c('0xf'),_0x16b3e7,_0xd78c('0xd'),JSON[_0xd78c('0x10')](_0x2fba53));if(_0x2fba53[_0xd78c('0x11')]){if(_0x2fba53[_0xd78c('0x11')]['code']===0x1f4){logger['error'](_0xd78c('0xc'),_0x16b3e7,_0x2fba53[_0xd78c('0x11')][_0xd78c('0x12')]);return _0x52c8f4(_0x2fba53[_0xd78c('0x11')][_0xd78c('0x12')]);}logger['error'](_0xd78c('0xc'),_0x16b3e7,_0x2fba53['error'][_0xd78c('0x12')]);return _0x1ef87b(_0x2fba53[_0xd78c('0x11')][_0xd78c('0x12')]);}else{logger[_0xd78c('0xb')](_0xd78c('0xc'),_0x16b3e7,_0xd78c('0xd'));_0x1ef87b(_0x2fba53[_0xd78c('0x13')][_0xd78c('0x12')]);}})[_0xd78c('0x14')](function(_0xc4ad51){logger[_0xd78c('0x11')](_0xd78c('0xc'),_0x16b3e7,_0xc4ad51);_0x52c8f4(_0xc4ad51);});});}exports['CreateSquareMessage']=function(_0x3e31d6){var _0x57cdcf=this;return new Promise(function(_0x2acd7e,_0x1431f8){return db[_0xd78c('0x15')][_0xd78c('0x16')](_0x3e31d6[_0xd78c('0x17')],{'raw':_0x3e31d6[_0xd78c('0x18')]?_0x3e31d6[_0xd78c('0x18')][_0xd78c('0x19')]===undefined?!![]:![]:!![]})[_0xd78c('0xa')](function(_0x118dc7){logger[_0xd78c('0xb')](_0xd78c('0x1a'),_0x3e31d6);logger[_0xd78c('0xe')](_0xd78c('0x1a'),_0x3e31d6,JSON[_0xd78c('0x10')](_0x118dc7));_0x2acd7e(_0x118dc7);})[_0xd78c('0x14')](function(_0x2b62b5){logger[_0xd78c('0x11')](_0xd78c('0x1a'),_0x2b62b5[_0xd78c('0x12')],_0x3e31d6);_0x1431f8(_0x57cdcf[_0xd78c('0x11')](0x1f4,_0x2b62b5[_0xd78c('0x12')]));});});}; \ No newline at end of file +var _0xb4a6=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','raw','then','info','CreateSquareMessage','lodash','util','moment','bluebird','randomstring'];(function(_0x44400d,_0x2167c7){var _0x32c4ba=function(_0x36dda7){while(--_0x36dda7){_0x44400d['push'](_0x44400d['shift']());}};_0x32c4ba(++_0x2167c7);}(_0xb4a6,0x9d));var _0x6b4a=function(_0x1b9720,_0x4310b8){_0x1b9720=_0x1b9720-0x0;var _0x22db39=_0xb4a6[_0x1b9720];return _0x22db39;};'use strict';var _=require(_0x6b4a('0x0'));var util=require(_0x6b4a('0x1'));var moment=require(_0x6b4a('0x2'));var BPromise=require(_0x6b4a('0x3'));var rs=require(_0x6b4a('0x4'));var fs=require('fs');var Redis=require(_0x6b4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b4a('0x6'))('rpc');var config=require(_0x6b4a('0x7'));var jayson=require(_0x6b4a('0x8'));var client=jayson[_0x6b4a('0x9')][_0x6b4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b0372,_0x34d34a,_0x2bcbf8){return new BPromise(function(_0x5bfcef,_0x31fb87){return client['request'](_0x3b0372,_0x2bcbf8)['then'](function(_0x95066a){logger['info'](_0x6b4a('0xb'),_0x34d34a,_0x6b4a('0xc'));logger[_0x6b4a('0xd')](_0x6b4a('0xe'),_0x34d34a,_0x6b4a('0xc'),JSON[_0x6b4a('0xf')](_0x95066a));if(_0x95066a[_0x6b4a('0x10')]){if(_0x95066a[_0x6b4a('0x10')][_0x6b4a('0x11')]===0x1f4){logger['error'](_0x6b4a('0xb'),_0x34d34a,_0x95066a[_0x6b4a('0x10')]['message']);return _0x31fb87(_0x95066a['error'][_0x6b4a('0x12')]);}logger['error'](_0x6b4a('0xb'),_0x34d34a,_0x95066a[_0x6b4a('0x10')][_0x6b4a('0x12')]);return _0x5bfcef(_0x95066a[_0x6b4a('0x10')][_0x6b4a('0x12')]);}else{logger['info'](_0x6b4a('0xb'),_0x34d34a,_0x6b4a('0xc'));_0x5bfcef(_0x95066a[_0x6b4a('0x13')]['message']);}})[_0x6b4a('0x14')](function(_0x146717){logger[_0x6b4a('0x10')](_0x6b4a('0xb'),_0x34d34a,_0x146717);_0x31fb87(_0x146717);});});}exports['CreateSquareMessage']=function(_0x1048a3){var _0x41ad3f=this;return new Promise(function(_0x5e9a56,_0x1186ee){return db['SquareMessage'][_0x6b4a('0x15')](_0x1048a3['body'],{'raw':_0x1048a3[_0x6b4a('0x16')]?_0x1048a3[_0x6b4a('0x16')][_0x6b4a('0x17')]===undefined?!![]:![]:!![]})[_0x6b4a('0x18')](function(_0x1ccf61){logger[_0x6b4a('0x19')](_0x6b4a('0x1a'),_0x1048a3);logger[_0x6b4a('0xd')](_0x6b4a('0x1a'),_0x1048a3,JSON[_0x6b4a('0xf')](_0x1ccf61));_0x5e9a56(_0x1ccf61);})[_0x6b4a('0x14')](function(_0x4a07c2){logger[_0x6b4a('0x10')](_0x6b4a('0x1a'),_0x4a07c2[_0x6b4a('0x12')],_0x1048a3);_0x1186ee(_0x41ad3f[_0x6b4a('0x10')](0x1f4,_0x4a07c2[_0x6b4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 0c93d92..899dfd8 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 _0xf5ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','isAuthenticated','index','get','show','15s','test','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0xaf0cff,_0x52ca71){var _0x194c1f=function(_0x38659a){while(--_0x38659a){_0xaf0cff['push'](_0xaf0cff['shift']());}};_0x194c1f(++_0x52ca71);}(_0xf5ca,0xee));var _0xaf5c=function(_0x2db0fa,_0x4c06c0){_0x2db0fa=_0x2db0fa-0x0;var _0x4f2b48=_0xf5ca[_0x2db0fa];return _0x4f2b48;};'use strict';var multer=require(_0xaf5c('0x0'));var util=require(_0xaf5c('0x1'));var path=require('path');var timeout=require(_0xaf5c('0x2'));var express=require(_0xaf5c('0x3'));var router=express[_0xaf5c('0x4')]();var fs_extra=require(_0xaf5c('0x5'));var auth=require(_0xaf5c('0x6'));var interaction=require(_0xaf5c('0x7'));var config=require('../../config/environment');var controller=require(_0xaf5c('0x8'));router['get']('/',auth[_0xaf5c('0x9')](),controller[_0xaf5c('0xa')]);router[_0xaf5c('0xb')]('/:id',auth[_0xaf5c('0x9')](),controller[_0xaf5c('0xc')]);router[_0xaf5c('0xb')]('/:id/test',auth['isAuthenticated'](),timeout(_0xaf5c('0xd')),controller[_0xaf5c('0xe')]);router[_0xaf5c('0xf')]('/',auth[_0xaf5c('0x9')](),controller[_0xaf5c('0x10')]);router[_0xaf5c('0x11')]('/:id',auth[_0xaf5c('0x9')](),controller[_0xaf5c('0x12')]);router[_0xaf5c('0x13')]('/:id',auth[_0xaf5c('0x9')](),controller[_0xaf5c('0x14')]);module[_0xaf5c('0x15')]=router; \ No newline at end of file +var _0x304e=['fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x1d7599,_0x49929f){var _0x55da12=function(_0x3f7a5f){while(--_0x3f7a5f){_0x1d7599['push'](_0x1d7599['shift']());}};_0x55da12(++_0x49929f);}(_0x304e,0x1b5));var _0xe304=function(_0x5356f5,_0x412004){_0x5356f5=_0x5356f5-0x0;var _0x5595a5=_0x304e[_0x5356f5];return _0x5595a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe304('0x0'));var timeout=require(_0xe304('0x1'));var express=require(_0xe304('0x2'));var router=express[_0xe304('0x3')]();var fs_extra=require(_0xe304('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe304('0x5'));var config=require('../../config/environment');var controller=require(_0xe304('0x6'));router[_0xe304('0x7')]('/',auth[_0xe304('0x8')](),controller[_0xe304('0x9')]);router[_0xe304('0x7')](_0xe304('0xa'),auth[_0xe304('0x8')](),controller[_0xe304('0xb')]);router[_0xe304('0x7')](_0xe304('0xc'),auth['isAuthenticated'](),timeout(_0xe304('0xd')),controller[_0xe304('0xe')]);router[_0xe304('0xf')]('/',auth[_0xe304('0x8')](),controller[_0xe304('0x10')]);router['put'](_0xe304('0xa'),auth[_0xe304('0x8')](),controller[_0xe304('0x11')]);router[_0xe304('0x12')](_0xe304('0xa'),auth[_0xe304('0x8')](),controller[_0xe304('0x13')]);module[_0xe304('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 920103f..dd70d6e 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 _0x796e=['sequelize','exports'];(function(_0x4f0413,_0x17e9a4){var _0x40907f=function(_0x539282){while(--_0x539282){_0x4f0413['push'](_0x4f0413['shift']());}};_0x40907f(++_0x17e9a4);}(_0x796e,0x1c0));var _0xe796=function(_0x3371e9,_0x181a65){_0x3371e9=_0x3371e9-0x0;var _0x79c058=_0x796e[_0x3371e9];return _0x79c058;};'use strict';var Sequelize=require(_0xe796('0x0'));module[_0xe796('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9539=['sequelize','exports','STRING','name'];(function(_0x1cb95b,_0x50a7da){var _0x4ad1ff=function(_0x383dd8){while(--_0x383dd8){_0x1cb95b['push'](_0x1cb95b['shift']());}};_0x4ad1ff(++_0x50a7da);}(_0x9539,0xd4));var _0x9953=function(_0x142a17,_0xefa6c8){_0x142a17=_0x142a17-0x0;var _0xc54d0c=_0x9539[_0x142a17];return _0xc54d0c;};'use strict';var Sequelize=require(_0x9953('0x0'));module[_0x9953('0x1')]={'name':{'type':Sequelize[_0x9953('0x2')],'unique':_0x9953('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'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 29730a6..9081a57 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 _0xf8d4=['save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','SquareOdbc','rawAttributes','fieldName','key','map','keys','intersection','model','query','attributes','fields','length','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x54ef35,_0x55f747){var _0x342e49=function(_0x45c849){while(--_0x45c849){_0x54ef35['push'](_0x54ef35['shift']());}};_0x342e49(++_0x55f747);}(_0xf8d4,0x19c));var _0x4f8d=function(_0x515ec4,_0x29073d){_0x515ec4=_0x515ec4-0x0;var _0x3442d7=_0xf8d4[_0x515ec4];return _0x3442d7;};'use strict';var emlformat=require(_0x4f8d('0x0'));var rimraf=require(_0x4f8d('0x1'));var zipdir=require(_0x4f8d('0x2'));var jsonpatch=require(_0x4f8d('0x3'));var rp=require('request-promise');var moment=require(_0x4f8d('0x4'));var BPromise=require(_0x4f8d('0x5'));var Mustache=require(_0x4f8d('0x6'));var util=require('util');var path=require(_0x4f8d('0x7'));var sox=require(_0x4f8d('0x8'));var csv=require(_0x4f8d('0x9'));var ejs=require(_0x4f8d('0xa'));var fs=require('fs');var fs_extra=require(_0x4f8d('0xb'));var _=require(_0x4f8d('0xc'));var squel=require(_0x4f8d('0xd'));var crypto=require(_0x4f8d('0xe'));var jsforce=require(_0x4f8d('0xf'));var deskjs=require(_0x4f8d('0x10'));var toCsv=require(_0x4f8d('0x9'));var querystring=require(_0x4f8d('0x11'));var Papa=require('papaparse');var Redis=require(_0x4f8d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4f8d('0x13'));var as=require(_0x4f8d('0x14'));var hardwareService=require(_0x4f8d('0x15'));var logger=require(_0x4f8d('0x16'))('api');var utils=require(_0x4f8d('0x17'));var config=require(_0x4f8d('0x18'));var licenseUtil=require(_0x4f8d('0x19'));var db=require(_0x4f8d('0x1a'))['db'];function respondWithStatusCode(_0x2c02d5,_0x1a9c46){_0x1a9c46=_0x1a9c46||0xcc;return function(_0x465e1f){if(_0x465e1f){return _0x2c02d5[_0x4f8d('0x1b')](_0x1a9c46);}return _0x2c02d5[_0x4f8d('0x1c')](_0x1a9c46)[_0x4f8d('0x1d')]();};}function respondWithResult(_0x2a41e2,_0x34b330){_0x34b330=_0x34b330||0xc8;return function(_0x5d7f96){if(_0x5d7f96){return _0x2a41e2[_0x4f8d('0x1c')](_0x34b330)['json'](_0x5d7f96);}};}function respondWithFilteredResult(_0x32da70,_0x5d31ff){return function(_0x5c1082){if(_0x5c1082){var _0x4ed13e=typeof _0x5d31ff[_0x4f8d('0x1e')]===_0x4f8d('0x1f')&&typeof _0x5d31ff[_0x4f8d('0x20')]===_0x4f8d('0x1f');var _0x58aa99=_0x5c1082[_0x4f8d('0x21')];var _0x26a903=_0x4ed13e?0x0:_0x5d31ff[_0x4f8d('0x1e')];var _0x3dc47f=_0x4ed13e?_0x5c1082[_0x4f8d('0x21')]:_0x5d31ff[_0x4f8d('0x1e')]+_0x5d31ff[_0x4f8d('0x20')];var _0x8b1aff;if(_0x3dc47f>=_0x58aa99){_0x3dc47f=_0x58aa99;_0x8b1aff=0xc8;}else{_0x8b1aff=0xce;}_0x32da70[_0x4f8d('0x1c')](_0x8b1aff);return _0x32da70[_0x4f8d('0x22')](_0x4f8d('0x23'),_0x26a903+'-'+_0x3dc47f+'/'+_0x58aa99)['json'](_0x5c1082);}return null;};}function patchUpdates(_0x29ca8a){return function(_0x560de4){try{jsonpatch[_0x4f8d('0x24')](_0x560de4,_0x29ca8a,!![]);}catch(_0x4c2514){return BPromise[_0x4f8d('0x25')](_0x4c2514);}return _0x560de4[_0x4f8d('0x26')]();};}function saveUpdates(_0x3f3cee,_0x21a5dc){return function(_0x39cb41){if(_0x39cb41){return _0x39cb41['update'](_0x3f3cee)[_0x4f8d('0x27')](function(_0x27094f){return _0x27094f;});}return null;};}function removeEntity(_0x34a39d,_0x45bb11){return function(_0x6e17d3){if(_0x6e17d3){return _0x6e17d3[_0x4f8d('0x28')]()[_0x4f8d('0x27')](function(){var _0x462be3=_0x6e17d3[_0x4f8d('0x29')]({'plain':!![]});var _0x383d67=_0x4f8d('0x2a');return db[_0x4f8d('0x2b')][_0x4f8d('0x28')]({'where':{'type':_0x383d67,'resourceId':_0x462be3['id']}})[_0x4f8d('0x27')](function(){return _0x6e17d3;});})[_0x4f8d('0x27')](function(){_0x34a39d[_0x4f8d('0x1c')](0xcc)[_0x4f8d('0x1d')]();});}};}function handleEntityNotFound(_0xc9847a,_0x26ba93){return function(_0x5bd116){if(!_0x5bd116){_0xc9847a[_0x4f8d('0x1b')](0x194);}return _0x5bd116;};}function handleError(_0x52563d,_0x2ff260){_0x2ff260=_0x2ff260||0x1f4;return function(_0x134bbe){logger[_0x4f8d('0x2c')](_0x134bbe[_0x4f8d('0x2d')]);if(_0x134bbe[_0x4f8d('0x2e')]){delete _0x134bbe[_0x4f8d('0x2e')];}_0x52563d[_0x4f8d('0x1c')](_0x2ff260)['send'](_0x134bbe);};}exports[_0x4f8d('0x2f')]=function(_0x3ba3be,_0x31e02e){var _0x2c2ea4={},_0x24871e={},_0x5a050a={'count':0x0,'rows':[]};var _0x55c7a4=_['map'](db[_0x4f8d('0x30')][_0x4f8d('0x31')],function(_0x248df0){return{'name':_0x248df0[_0x4f8d('0x32')],'type':_0x248df0['type'][_0x4f8d('0x33')]};});_0x24871e['model']=_[_0x4f8d('0x34')](_0x55c7a4,_0x4f8d('0x2e'));_0x24871e['query']=_[_0x4f8d('0x35')](_0x3ba3be['query']);_0x24871e['filters']=_[_0x4f8d('0x36')](_0x24871e[_0x4f8d('0x37')],_0x24871e[_0x4f8d('0x38')]);_0x2c2ea4[_0x4f8d('0x39')]=_[_0x4f8d('0x36')](_0x24871e['model'],qs[_0x4f8d('0x3a')](_0x3ba3be['query'][_0x4f8d('0x3a')]));_0x2c2ea4[_0x4f8d('0x39')]=_0x2c2ea4[_0x4f8d('0x39')][_0x4f8d('0x3b')]?_0x2c2ea4['attributes']:_0x24871e[_0x4f8d('0x37')];if(!_0x3ba3be[_0x4f8d('0x38')]['hasOwnProperty']('nolimit')){_0x2c2ea4[_0x4f8d('0x20')]=qs[_0x4f8d('0x20')](_0x3ba3be[_0x4f8d('0x38')][_0x4f8d('0x20')]);_0x2c2ea4[_0x4f8d('0x1e')]=qs[_0x4f8d('0x1e')](_0x3ba3be[_0x4f8d('0x38')]['offset']);}_0x2c2ea4['order']=qs[_0x4f8d('0x3c')](_0x3ba3be[_0x4f8d('0x38')][_0x4f8d('0x3c')]);_0x2c2ea4[_0x4f8d('0x3d')]=qs[_0x4f8d('0x3e')](_[_0x4f8d('0x3f')](_0x3ba3be[_0x4f8d('0x38')],_0x24871e[_0x4f8d('0x3e')]),_0x55c7a4);if(_0x3ba3be[_0x4f8d('0x38')][_0x4f8d('0x40')]){_0x2c2ea4[_0x4f8d('0x3d')]=_[_0x4f8d('0x41')](_0x2c2ea4['where'],{'$or':_[_0x4f8d('0x34')](_0x55c7a4,function(_0x32c126){if(_0x32c126[_0x4f8d('0x42')]!==_0x4f8d('0x43')){var _0x54c272={};_0x54c272[_0x32c126[_0x4f8d('0x2e')]]={'$like':'%'+_0x3ba3be[_0x4f8d('0x38')][_0x4f8d('0x40')]+'%'};return _0x54c272;}})});}_0x2c2ea4=_[_0x4f8d('0x41')]({},_0x2c2ea4,_0x3ba3be[_0x4f8d('0x44')]);var _0xff26f7={'where':_0x2c2ea4[_0x4f8d('0x3d')]};return db[_0x4f8d('0x30')][_0x4f8d('0x21')](_0xff26f7)[_0x4f8d('0x27')](function(_0x3cd00d){_0x5a050a['count']=_0x3cd00d;if(_0x3ba3be[_0x4f8d('0x38')][_0x4f8d('0x45')]){_0x2c2ea4[_0x4f8d('0x46')]=[{'all':!![]}];}return db[_0x4f8d('0x30')][_0x4f8d('0x47')](_0x2c2ea4);})[_0x4f8d('0x27')](function(_0x31fe15){_0x5a050a[_0x4f8d('0x48')]=_0x31fe15;return _0x5a050a;})[_0x4f8d('0x27')](respondWithFilteredResult(_0x31e02e,_0x2c2ea4))[_0x4f8d('0x49')](handleError(_0x31e02e,null));};exports[_0x4f8d('0x4a')]=function(_0x337c2d,_0x18510b){var _0x566671={'raw':!![],'where':{'id':_0x337c2d[_0x4f8d('0x4b')]['id']}},_0x5a3839={};_0x5a3839[_0x4f8d('0x37')]=_[_0x4f8d('0x35')](db[_0x4f8d('0x30')][_0x4f8d('0x31')]);_0x5a3839[_0x4f8d('0x38')]=_[_0x4f8d('0x35')](_0x337c2d[_0x4f8d('0x38')]);_0x5a3839[_0x4f8d('0x3e')]=_[_0x4f8d('0x36')](_0x5a3839[_0x4f8d('0x37')],_0x5a3839[_0x4f8d('0x38')]);_0x566671[_0x4f8d('0x39')]=_['intersection'](_0x5a3839[_0x4f8d('0x37')],qs[_0x4f8d('0x3a')](_0x337c2d[_0x4f8d('0x38')][_0x4f8d('0x3a')]));_0x566671['attributes']=_0x566671[_0x4f8d('0x39')][_0x4f8d('0x3b')]?_0x566671[_0x4f8d('0x39')]:_0x5a3839[_0x4f8d('0x37')];if(_0x337c2d[_0x4f8d('0x38')][_0x4f8d('0x45')]){_0x566671['include']=[{'all':!![]}];}_0x566671=_[_0x4f8d('0x41')]({},_0x566671,_0x337c2d['options']);return db[_0x4f8d('0x30')][_0x4f8d('0x4c')](_0x566671)[_0x4f8d('0x27')](handleEntityNotFound(_0x18510b,null))[_0x4f8d('0x27')](respondWithResult(_0x18510b,null))['catch'](handleError(_0x18510b,null));};exports[_0x4f8d('0x4d')]=function(_0x38c396,_0x4f067d){return db[_0x4f8d('0x30')][_0x4f8d('0x4d')](_0x38c396[_0x4f8d('0x4e')],{})[_0x4f8d('0x27')](function(_0x474c45){var _0x355bb6=_0x38c396[_0x4f8d('0x4f')][_0x4f8d('0x29')]({'plain':!![]});if(!_0x355bb6)throw new Error(_0x4f8d('0x50'));if(_0x355bb6[_0x4f8d('0x51')]===_0x4f8d('0x4f')){var _0x3a14b5=_0x474c45[_0x4f8d('0x29')]({'plain':!![]});var _0x32f8aa=_0x4f8d('0x2a');return db['UserProfileSection'][_0x4f8d('0x4c')]({'where':{'name':_0x32f8aa,'userProfileId':_0x355bb6[_0x4f8d('0x52')]},'raw':!![]})[_0x4f8d('0x27')](function(_0x3e64db){if(_0x3e64db&&_0x3e64db['autoAssociation']===0x0){return db['UserProfileResource'][_0x4f8d('0x4d')]({'name':_0x3a14b5[_0x4f8d('0x2e')],'resourceId':_0x3a14b5['id'],'type':_0x3e64db[_0x4f8d('0x2e')],'sectionId':_0x3e64db['id']},{})[_0x4f8d('0x27')](function(){return _0x474c45;});}else{return _0x474c45;}})[_0x4f8d('0x49')](function(_0x224187){logger[_0x4f8d('0x2c')](_0x4f8d('0x53'),_0x224187);throw _0x224187;});}return _0x474c45;})[_0x4f8d('0x27')](respondWithResult(_0x4f067d,0xc9))['catch'](handleError(_0x4f067d,null));};exports[_0x4f8d('0x54')]=function(_0x418523,_0x551f8f){if(_0x418523[_0x4f8d('0x4e')]['id']){delete _0x418523['body']['id'];}return db[_0x4f8d('0x30')][_0x4f8d('0x4c')]({'where':{'id':_0x418523[_0x4f8d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x551f8f,null))[_0x4f8d('0x27')](saveUpdates(_0x418523[_0x4f8d('0x4e')],null))['then'](respondWithResult(_0x551f8f,null))[_0x4f8d('0x49')](handleError(_0x551f8f,null));};exports['destroy']=function(_0x18c805,_0x368ca9){return db[_0x4f8d('0x30')]['find']({'where':{'id':_0x18c805[_0x4f8d('0x4b')]['id']}})[_0x4f8d('0x27')](handleEntityNotFound(_0x368ca9,null))[_0x4f8d('0x27')](removeEntity(_0x368ca9,null))[_0x4f8d('0x49')](handleError(_0x368ca9,null));};exports[_0x4f8d('0x55')]=function(_0x441e3d,_0x1a5e43,_0x2d1192){var _0x875f35;return db[_0x4f8d('0x30')]['find']({'where':{'id':_0x441e3d['params']['id']},'attributes':['id',_0x4f8d('0x56')]})[_0x4f8d('0x27')](handleEntityNotFound(_0x1a5e43,null))[_0x4f8d('0x27')](function(_0x382ecc){if(_0x382ecc){var _0x2251a6=require(_0x4f8d('0x57'))();_0x2251a6[_0x4f8d('0x58')](_0x382ecc['dsn']);_0x2251a6[_0x4f8d('0x59')]();return _0x382ecc;}})['then'](respondWithResult(_0x1a5e43,null))[_0x4f8d('0x49')](handleError(_0x1a5e43,null));}; \ No newline at end of file +var _0x053d=['../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','get','ODBC','UserProfileResource','stack','name','send','index','SquareOdbc','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x053d,0x93));var _0xd053=function(_0xe7c4b5,_0x15a6d2){_0xe7c4b5=_0xe7c4b5-0x0;var _0x5e7c91=_0x053d[_0xe7c4b5];return _0x5e7c91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd053('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd053('0x1'));var rp=require('request-promise');var moment=require(_0xd053('0x2'));var BPromise=require(_0xd053('0x3'));var Mustache=require(_0xd053('0x4'));var util=require(_0xd053('0x5'));var path=require(_0xd053('0x6'));var sox=require(_0xd053('0x7'));var csv=require(_0xd053('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd053('0x9'));var _=require(_0xd053('0xa'));var squel=require('squel');var crypto=require(_0xd053('0xb'));var jsforce=require(_0xd053('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd053('0x8'));var querystring=require('querystring');var Papa=require(_0xd053('0xd'));var Redis=require('ioredis');var authService=require(_0xd053('0xe'));var qs=require(_0xd053('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd053('0x10'));var logger=require(_0xd053('0x11'))(_0xd053('0x12'));var utils=require('../../config/utils');var config=require(_0xd053('0x13'));var licenseUtil=require(_0xd053('0x14'));var db=require(_0xd053('0x15'))['db'];function respondWithStatusCode(_0x28061f,_0x296c3e){_0x296c3e=_0x296c3e||0xcc;return function(_0x4cd249){if(_0x4cd249){return _0x28061f['sendStatus'](_0x296c3e);}return _0x28061f[_0xd053('0x16')](_0x296c3e)[_0xd053('0x17')]();};}function respondWithResult(_0x36e46a,_0x2a3633){_0x2a3633=_0x2a3633||0xc8;return function(_0x323284){if(_0x323284){return _0x36e46a[_0xd053('0x16')](_0x2a3633)[_0xd053('0x18')](_0x323284);}};}function respondWithFilteredResult(_0x27c09d,_0x4dbac3){return function(_0x228ae5){if(_0x228ae5){var _0x2b6d5c=typeof _0x4dbac3[_0xd053('0x19')]==='undefined'&&typeof _0x4dbac3[_0xd053('0x1a')]===_0xd053('0x1b');var _0x5ab88f=_0x228ae5[_0xd053('0x1c')];var _0x3b13a4=_0x2b6d5c?0x0:_0x4dbac3[_0xd053('0x19')];var _0x49922d=_0x2b6d5c?_0x228ae5[_0xd053('0x1c')]:_0x4dbac3[_0xd053('0x19')]+_0x4dbac3[_0xd053('0x1a')];var _0x2958dc;if(_0x49922d>=_0x5ab88f){_0x49922d=_0x5ab88f;_0x2958dc=0xc8;}else{_0x2958dc=0xce;}_0x27c09d[_0xd053('0x16')](_0x2958dc);return _0x27c09d[_0xd053('0x1d')](_0xd053('0x1e'),_0x3b13a4+'-'+_0x49922d+'/'+_0x5ab88f)[_0xd053('0x18')](_0x228ae5);}return null;};}function patchUpdates(_0xfd6983){return function(_0x18da24){try{jsonpatch['apply'](_0x18da24,_0xfd6983,!![]);}catch(_0x52bdba){return BPromise[_0xd053('0x1f')](_0x52bdba);}return _0x18da24[_0xd053('0x20')]();};}function saveUpdates(_0x502679,_0x305e88){return function(_0x49d869){if(_0x49d869){return _0x49d869['update'](_0x502679)['then'](function(_0x7fcca8){return _0x7fcca8;});}return null;};}function removeEntity(_0x421959,_0x13c8d9){return function(_0x117fe2){if(_0x117fe2){return _0x117fe2[_0xd053('0x21')]()[_0xd053('0x22')](function(){var _0x4bf9d6=_0x117fe2[_0xd053('0x23')]({'plain':!![]});var _0x4a926a=_0xd053('0x24');return db[_0xd053('0x25')][_0xd053('0x21')]({'where':{'type':_0x4a926a,'resourceId':_0x4bf9d6['id']}})[_0xd053('0x22')](function(){return _0x117fe2;});})[_0xd053('0x22')](function(){_0x421959[_0xd053('0x16')](0xcc)[_0xd053('0x17')]();});}};}function handleEntityNotFound(_0x4b8a81,_0x2f950d){return function(_0x10ddc4){if(!_0x10ddc4){_0x4b8a81['sendStatus'](0x194);}return _0x10ddc4;};}function handleError(_0x46d12e,_0xb17c40){_0xb17c40=_0xb17c40||0x1f4;return function(_0x336b63){logger['error'](_0x336b63[_0xd053('0x26')]);if(_0x336b63[_0xd053('0x27')]){delete _0x336b63[_0xd053('0x27')];}_0x46d12e[_0xd053('0x16')](_0xb17c40)[_0xd053('0x28')](_0x336b63);};}exports[_0xd053('0x29')]=function(_0x5988af,_0x1dea62){var _0x29e094={},_0x1a2077={},_0x24cdea={'count':0x0,'rows':[]};var _0x35728c=_['map'](db[_0xd053('0x2a')]['rawAttributes'],function(_0xebd599){return{'name':_0xebd599[_0xd053('0x2b')],'type':_0xebd599['type'][_0xd053('0x2c')]};});_0x1a2077[_0xd053('0x2d')]=_[_0xd053('0x2e')](_0x35728c,_0xd053('0x27'));_0x1a2077[_0xd053('0x2f')]=_[_0xd053('0x30')](_0x5988af[_0xd053('0x2f')]);_0x1a2077[_0xd053('0x31')]=_[_0xd053('0x32')](_0x1a2077['model'],_0x1a2077[_0xd053('0x2f')]);_0x29e094['attributes']=_[_0xd053('0x32')](_0x1a2077[_0xd053('0x2d')],qs[_0xd053('0x33')](_0x5988af[_0xd053('0x2f')]['fields']));_0x29e094[_0xd053('0x34')]=_0x29e094[_0xd053('0x34')][_0xd053('0x35')]?_0x29e094['attributes']:_0x1a2077[_0xd053('0x2d')];if(!_0x5988af[_0xd053('0x2f')][_0xd053('0x36')](_0xd053('0x37'))){_0x29e094[_0xd053('0x1a')]=qs[_0xd053('0x1a')](_0x5988af[_0xd053('0x2f')][_0xd053('0x1a')]);_0x29e094[_0xd053('0x19')]=qs['offset'](_0x5988af['query'][_0xd053('0x19')]);}_0x29e094[_0xd053('0x38')]=qs['sort'](_0x5988af[_0xd053('0x2f')][_0xd053('0x39')]);_0x29e094[_0xd053('0x3a')]=qs[_0xd053('0x31')](_['pick'](_0x5988af[_0xd053('0x2f')],_0x1a2077[_0xd053('0x31')]),_0x35728c);if(_0x5988af[_0xd053('0x2f')][_0xd053('0x3b')]){_0x29e094[_0xd053('0x3a')]=_['merge'](_0x29e094[_0xd053('0x3a')],{'$or':_[_0xd053('0x2e')](_0x35728c,function(_0x512963){if(_0x512963['type']!==_0xd053('0x3c')){var _0x2feda5={};_0x2feda5[_0x512963['name']]={'$like':'%'+_0x5988af['query'][_0xd053('0x3b')]+'%'};return _0x2feda5;}})});}_0x29e094=_[_0xd053('0x3d')]({},_0x29e094,_0x5988af[_0xd053('0x3e')]);var _0x525b20={'where':_0x29e094['where']};return db[_0xd053('0x2a')][_0xd053('0x1c')](_0x525b20)[_0xd053('0x22')](function(_0x4942b6){_0x24cdea[_0xd053('0x1c')]=_0x4942b6;if(_0x5988af[_0xd053('0x2f')][_0xd053('0x3f')]){_0x29e094['include']=[{'all':!![]}];}return db[_0xd053('0x2a')][_0xd053('0x40')](_0x29e094);})[_0xd053('0x22')](function(_0x3d45a2){_0x24cdea[_0xd053('0x41')]=_0x3d45a2;return _0x24cdea;})['then'](respondWithFilteredResult(_0x1dea62,_0x29e094))[_0xd053('0x42')](handleError(_0x1dea62,null));};exports[_0xd053('0x43')]=function(_0x3f51d9,_0x13b477){var _0x34b217={'raw':!![],'where':{'id':_0x3f51d9[_0xd053('0x44')]['id']}},_0x41d13e={};_0x41d13e[_0xd053('0x2d')]=_[_0xd053('0x30')](db['SquareOdbc'][_0xd053('0x45')]);_0x41d13e[_0xd053('0x2f')]=_[_0xd053('0x30')](_0x3f51d9[_0xd053('0x2f')]);_0x41d13e[_0xd053('0x31')]=_['intersection'](_0x41d13e['model'],_0x41d13e[_0xd053('0x2f')]);_0x34b217[_0xd053('0x34')]=_[_0xd053('0x32')](_0x41d13e[_0xd053('0x2d')],qs[_0xd053('0x33')](_0x3f51d9[_0xd053('0x2f')][_0xd053('0x33')]));_0x34b217[_0xd053('0x34')]=_0x34b217[_0xd053('0x34')]['length']?_0x34b217['attributes']:_0x41d13e[_0xd053('0x2d')];if(_0x3f51d9[_0xd053('0x2f')][_0xd053('0x3f')]){_0x34b217['include']=[{'all':!![]}];}_0x34b217=_[_0xd053('0x3d')]({},_0x34b217,_0x3f51d9[_0xd053('0x3e')]);return db[_0xd053('0x2a')]['find'](_0x34b217)[_0xd053('0x22')](handleEntityNotFound(_0x13b477,null))[_0xd053('0x22')](respondWithResult(_0x13b477,null))[_0xd053('0x42')](handleError(_0x13b477,null));};exports[_0xd053('0x46')]=function(_0x400f97,_0x3775ae){return db[_0xd053('0x2a')][_0xd053('0x46')](_0x400f97[_0xd053('0x47')],{})[_0xd053('0x22')](function(_0x4ba3a4){var _0x205405=_0x400f97[_0xd053('0x48')][_0xd053('0x23')]({'plain':!![]});if(!_0x205405)throw new Error(_0xd053('0x49'));if(_0x205405[_0xd053('0x4a')]==='user'){var _0x532811=_0x4ba3a4[_0xd053('0x23')]({'plain':!![]});var _0x39b696=_0xd053('0x24');return db['UserProfileSection'][_0xd053('0x4b')]({'where':{'name':_0x39b696,'userProfileId':_0x205405['userProfileId']},'raw':!![]})[_0xd053('0x22')](function(_0x513518){if(_0x513518&&_0x513518[_0xd053('0x4c')]===0x0){return db['UserProfileResource'][_0xd053('0x46')]({'name':_0x532811[_0xd053('0x27')],'resourceId':_0x532811['id'],'type':_0x513518[_0xd053('0x27')],'sectionId':_0x513518['id']},{})['then'](function(){return _0x4ba3a4;});}else{return _0x4ba3a4;}})[_0xd053('0x42')](function(_0x14ede7){logger[_0xd053('0x4d')](_0xd053('0x4e'),_0x14ede7);throw _0x14ede7;});}return _0x4ba3a4;})[_0xd053('0x22')](respondWithResult(_0x3775ae,0xc9))['catch'](handleError(_0x3775ae,null));};exports[_0xd053('0x4f')]=function(_0x5eedcb,_0x5e9757){if(_0x5eedcb[_0xd053('0x47')]['id']){delete _0x5eedcb[_0xd053('0x47')]['id'];}return db[_0xd053('0x2a')][_0xd053('0x4b')]({'where':{'id':_0x5eedcb['params']['id']}})[_0xd053('0x22')](handleEntityNotFound(_0x5e9757,null))['then'](saveUpdates(_0x5eedcb[_0xd053('0x47')],null))[_0xd053('0x22')](respondWithResult(_0x5e9757,null))[_0xd053('0x42')](handleError(_0x5e9757,null));};exports[_0xd053('0x21')]=function(_0x53bcb9,_0x4242f7){return db[_0xd053('0x2a')][_0xd053('0x4b')]({'where':{'id':_0x53bcb9[_0xd053('0x44')]['id']}})[_0xd053('0x22')](handleEntityNotFound(_0x4242f7,null))[_0xd053('0x22')](removeEntity(_0x4242f7,null))['catch'](handleError(_0x4242f7,null));};exports['test']=function(_0x1c75de,_0x243c34,_0x2e665c){var _0x25cb28;return db[_0xd053('0x2a')][_0xd053('0x4b')]({'where':{'id':_0x1c75de[_0xd053('0x44')]['id']},'attributes':['id',_0xd053('0x50')]})[_0xd053('0x22')](handleEntityNotFound(_0x243c34,null))[_0xd053('0x22')](function(_0x5dea4f){if(_0x5dea4f){var _0x4ca7c4=require(_0xd053('0x51'))();_0x4ca7c4[_0xd053('0x52')](_0x5dea4f['dsn']);_0x4ca7c4[_0xd053('0x53')]();return _0x5dea4f;}})['then'](respondWithResult(_0x243c34,null))[_0xd053('0x42')](handleError(_0x243c34,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index afc6b98..12346c3 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 _0x38a6=['rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','path'];(function(_0x142c9a,_0x5c5494){var _0x3b444b=function(_0xe8e8ea){while(--_0xe8e8ea){_0x142c9a['push'](_0x142c9a['shift']());}};_0x3b444b(++_0x5c5494);}(_0x38a6,0x8b));var _0x638a=function(_0x3013dc,_0x547632){_0x3013dc=_0x3013dc-0x0;var _0x2fc5db=_0x38a6[_0x3013dc];return _0x2fc5db;};'use strict';var _=require(_0x638a('0x0'));var util=require(_0x638a('0x1'));var logger=require(_0x638a('0x2'))(_0x638a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x638a('0x4'));var rimraf=require(_0x638a('0x5'));var config=require(_0x638a('0x6'));var attributes=require(_0x638a('0x7'));module[_0x638a('0x8')]=function(_0x44cb98,_0x3bb0c4){return _0x44cb98[_0x638a('0x9')](_0x638a('0xa'),attributes,{'tableName':_0x638a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea2a=['path','../../config/environment','./squareOdbc.attributes','define','util','../../config/logger','bluebird','request-promise'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0xea2a,0xbc));var _0xaea2=function(_0x71bca8,_0x46656e){_0x71bca8=_0x71bca8-0x0;var _0x2691f5=_0xea2a[_0x71bca8];return _0x2691f5;};'use strict';var _=require('lodash');var util=require(_0xaea2('0x0'));var logger=require(_0xaea2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaea2('0x2'));var rp=require(_0xaea2('0x3'));var fs=require('fs');var path=require(_0xaea2('0x4'));var rimraf=require('rimraf');var config=require(_0xaea2('0x5'));var attributes=require(_0xaea2('0x6'));module['exports']=function(_0x56c264,_0x3fca24){return _0x56c264[_0xaea2('0x7')]('SquareOdbc',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 802a384..844c7b9 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 _0x83d1=['request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x83d1,0x1f1));var _0x183d=function(_0x2b4d2f,_0x46ae34){_0x2b4d2f=_0x2b4d2f-0x0;var _0x38d04c=_0x83d1[_0x2b4d2f];return _0x38d04c;};'use strict';var _=require('lodash');var util=require(_0x183d('0x0'));var moment=require(_0x183d('0x1'));var BPromise=require(_0x183d('0x2'));var rs=require(_0x183d('0x3'));var fs=require('fs');var Redis=require(_0x183d('0x4'));var db=require(_0x183d('0x5'))['db'];var utils=require(_0x183d('0x6'));var logger=require(_0x183d('0x7'))(_0x183d('0x8'));var config=require(_0x183d('0x9'));var jayson=require(_0x183d('0xa'));var client=jayson[_0x183d('0xb')][_0x183d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4175ec,_0x503e2c,_0x4abb5a){return new BPromise(function(_0x3a0d9b,_0x2ae7c5){return client[_0x183d('0xd')](_0x4175ec,_0x4abb5a)[_0x183d('0xe')](function(_0x4ee36f){logger[_0x183d('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x503e2c,'request\x20sent');logger[_0x183d('0x10')](_0x183d('0x11'),_0x503e2c,'request\x20sent',JSON[_0x183d('0x12')](_0x4ee36f));if(_0x4ee36f['error']){if(_0x4ee36f[_0x183d('0x13')][_0x183d('0x14')]===0x1f4){logger[_0x183d('0x13')](_0x183d('0x15'),_0x503e2c,_0x4ee36f[_0x183d('0x13')]['message']);return _0x2ae7c5(_0x4ee36f[_0x183d('0x13')][_0x183d('0x16')]);}logger[_0x183d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x503e2c,_0x4ee36f[_0x183d('0x13')]['message']);return _0x3a0d9b(_0x4ee36f[_0x183d('0x13')][_0x183d('0x16')]);}else{logger[_0x183d('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x503e2c,'request\x20sent');_0x3a0d9b(_0x4ee36f[_0x183d('0x17')][_0x183d('0x16')]);}})[_0x183d('0x18')](function(_0x7cad2c){logger[_0x183d('0x13')](_0x183d('0x15'),_0x503e2c,_0x7cad2c);_0x2ae7c5(_0x7cad2c);});});}exports[_0x183d('0x19')]=function(_0x59cfa7){var _0xfc7ffe=this;return new Promise(function(_0x5e7d56,_0x31b963){return db[_0x183d('0x1a')][_0x183d('0x1b')]({'raw':_0x59cfa7['options']?_0x59cfa7[_0x183d('0x1c')][_0x183d('0x1d')]===undefined?!![]:![]:!![],'where':_0x59cfa7[_0x183d('0x1c')]?_0x59cfa7[_0x183d('0x1c')]['where']||null:null,'attributes':_0x59cfa7[_0x183d('0x1c')]?_0x59cfa7['options'][_0x183d('0x1e')]||null:null,'include':_0x59cfa7[_0x183d('0x1c')]?_0x59cfa7[_0x183d('0x1c')][_0x183d('0x1f')]?_[_0x183d('0x20')](_0x59cfa7[_0x183d('0x1c')][_0x183d('0x1f')],function(_0x3e320c){return{'model':db[_0x3e320c[_0x183d('0x21')]],'as':_0x3e320c['as'],'attributes':_0x3e320c['attributes'],'include':_0x3e320c[_0x183d('0x1f')]?_[_0x183d('0x20')](_0x3e320c[_0x183d('0x1f')],function(_0x519388){return{'model':db[_0x519388['model']],'as':_0x519388['as'],'attributes':_0x519388[_0x183d('0x1e')],'include':_0x519388['include']?_[_0x183d('0x20')](_0x519388[_0x183d('0x1f')],function(_0x382872){return{'model':db[_0x382872[_0x183d('0x21')]],'as':_0x382872['as'],'attributes':_0x382872[_0x183d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29e767){logger[_0x183d('0xf')](_0x183d('0x19'),_0x59cfa7);logger['debug'](_0x183d('0x19'),_0x59cfa7,JSON[_0x183d('0x12')](_0x29e767));_0x5e7d56(_0x29e767);})['catch'](function(_0x46160c){logger[_0x183d('0x13')]('ShowSquareOdbc',_0x46160c[_0x183d('0x16')],_0x59cfa7);_0x31b963(_0xfc7ffe['error'](0x1f4,_0x46160c[_0x183d('0x16')]));});});}; \ No newline at end of file +var _0xb629=['raw','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','options'];(function(_0x187e50,_0x13774f){var _0x33a722=function(_0x43e0fb){while(--_0x43e0fb){_0x187e50['push'](_0x187e50['shift']());}};_0x33a722(++_0x13774f);}(_0xb629,0x66));var _0x9b62=function(_0x3cb405,_0xd5c09c){_0x3cb405=_0x3cb405-0x0;var _0x35a28e=_0xb629[_0x3cb405];return _0x35a28e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9b62('0x0'));var BPromise=require(_0x9b62('0x1'));var rs=require(_0x9b62('0x2'));var fs=require('fs');var Redis=require(_0x9b62('0x3'));var db=require(_0x9b62('0x4'))['db'];var utils=require(_0x9b62('0x5'));var logger=require(_0x9b62('0x6'))(_0x9b62('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b62('0x8'));var client=jayson[_0x9b62('0x9')][_0x9b62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50753d,_0x50d801,_0x25f72b){return new BPromise(function(_0x4ab82d,_0x3ea8b7){return client['request'](_0x50753d,_0x25f72b)[_0x9b62('0xb')](function(_0x2748f0){logger['info'](_0x9b62('0xc'),_0x50d801,_0x9b62('0xd'));logger[_0x9b62('0xe')](_0x9b62('0xf'),_0x50d801,_0x9b62('0xd'),JSON[_0x9b62('0x10')](_0x2748f0));if(_0x2748f0[_0x9b62('0x11')]){if(_0x2748f0[_0x9b62('0x11')][_0x9b62('0x12')]===0x1f4){logger['error'](_0x9b62('0xc'),_0x50d801,_0x2748f0[_0x9b62('0x11')][_0x9b62('0x13')]);return _0x3ea8b7(_0x2748f0[_0x9b62('0x11')][_0x9b62('0x13')]);}logger[_0x9b62('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x50d801,_0x2748f0[_0x9b62('0x11')][_0x9b62('0x13')]);return _0x4ab82d(_0x2748f0[_0x9b62('0x11')][_0x9b62('0x13')]);}else{logger[_0x9b62('0x14')](_0x9b62('0xc'),_0x50d801,'request\x20sent');_0x4ab82d(_0x2748f0[_0x9b62('0x15')][_0x9b62('0x13')]);}})[_0x9b62('0x16')](function(_0x5536ea){logger[_0x9b62('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x50d801,_0x5536ea);_0x3ea8b7(_0x5536ea);});});}exports[_0x9b62('0x17')]=function(_0x5cd577){var _0x499967=this;return new Promise(function(_0x8225b7,_0x23a11e){return db[_0x9b62('0x18')]['find']({'raw':_0x5cd577[_0x9b62('0x19')]?_0x5cd577[_0x9b62('0x19')][_0x9b62('0x1a')]===undefined?!![]:![]:!![],'where':_0x5cd577[_0x9b62('0x19')]?_0x5cd577[_0x9b62('0x19')][_0x9b62('0x1b')]||null:null,'attributes':_0x5cd577['options']?_0x5cd577['options'][_0x9b62('0x1c')]||null:null,'include':_0x5cd577['options']?_0x5cd577[_0x9b62('0x19')][_0x9b62('0x1d')]?_[_0x9b62('0x1e')](_0x5cd577['options'][_0x9b62('0x1d')],function(_0x1ea69b){return{'model':db[_0x1ea69b[_0x9b62('0x1f')]],'as':_0x1ea69b['as'],'attributes':_0x1ea69b[_0x9b62('0x1c')],'include':_0x1ea69b['include']?_['map'](_0x1ea69b[_0x9b62('0x1d')],function(_0x5d9e7b){return{'model':db[_0x5d9e7b['model']],'as':_0x5d9e7b['as'],'attributes':_0x5d9e7b[_0x9b62('0x1c')],'include':_0x5d9e7b[_0x9b62('0x1d')]?_['map'](_0x5d9e7b[_0x9b62('0x1d')],function(_0x6e895f){return{'model':db[_0x6e895f[_0x9b62('0x1f')]],'as':_0x6e895f['as'],'attributes':_0x6e895f[_0x9b62('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9b62('0xb')](function(_0x19686c){logger['info'](_0x9b62('0x17'),_0x5cd577);logger[_0x9b62('0xe')](_0x9b62('0x17'),_0x5cd577,JSON[_0x9b62('0x10')](_0x19686c));_0x8225b7(_0x19686c);})['catch'](function(_0x477057){logger[_0x9b62('0x11')](_0x9b62('0x17'),_0x477057[_0x9b62('0x13')],_0x5cd577);_0x23a11e(_0x499967['error'](0x1f4,_0x477057[_0x9b62('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9c14d85..2eca0aa 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 _0x606e=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x606e,0xe7));var _0xe606=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x606e[_0x3eb4a9];return _0x48dbad;};'use strict';var multer=require(_0xe606('0x0'));var util=require(_0xe606('0x1'));var path=require(_0xe606('0x2'));var timeout=require(_0xe606('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe606('0x4'));var auth=require(_0xe606('0x5'));var interaction=require(_0xe606('0x6'));var config=require(_0xe606('0x7'));var controller=require('./squareProject.controller');router[_0xe606('0x8')]('/',auth[_0xe606('0x9')](),controller[_0xe606('0xa')]);router[_0xe606('0x8')](_0xe606('0xb'),auth[_0xe606('0x9')](),controller[_0xe606('0xc')]);router[_0xe606('0xd')]('/',auth[_0xe606('0x9')](),controller[_0xe606('0xe')]);router['put'](_0xe606('0xb'),auth['isAuthenticated'](),controller[_0xe606('0xf')]);router[_0xe606('0x10')](_0xe606('0xb'),auth[_0xe606('0x9')](),controller[_0xe606('0x11')]);module[_0xe606('0x12')]=router; \ No newline at end of file +var _0x7dbb=['get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./squareProject.controller'];(function(_0x19ff64,_0x3c9dec){var _0x372e50=function(_0xe615f5){while(--_0xe615f5){_0x19ff64['push'](_0x19ff64['shift']());}};_0x372e50(++_0x3c9dec);}(_0x7dbb,0x1a2));var _0xb7db=function(_0x1e7450,_0x4665a9){_0x1e7450=_0x1e7450-0x0;var _0x7bddf8=_0x7dbb[_0x1e7450];return _0x7bddf8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb7db('0x0'));var timeout=require(_0xb7db('0x1'));var express=require(_0xb7db('0x2'));var router=express[_0xb7db('0x3')]();var fs_extra=require(_0xb7db('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7db('0x5'));var controller=require(_0xb7db('0x6'));router[_0xb7db('0x7')]('/',auth[_0xb7db('0x8')](),controller[_0xb7db('0x9')]);router[_0xb7db('0x7')](_0xb7db('0xa'),auth[_0xb7db('0x8')](),controller[_0xb7db('0xb')]);router[_0xb7db('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb7db('0xd')](_0xb7db('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xb7db('0xe')](_0xb7db('0xa'),auth[_0xb7db('0x8')](),controller[_0xb7db('0xf')]);module[_0xb7db('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 6058f3f..cf108b6 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 _0x142c=['exports','STRING','name','TEXT','BLOB','long','preproduction','getDataValue','toString','production','utf8','sequelize'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x142c,0x8f));var _0xc142=function(_0x275167,_0x28d7c2){_0x275167=_0x275167-0x0;var _0x5064b6=_0x142c[_0x275167];return _0x5064b6;};'use strict';var Sequelize=require(_0xc142('0x0'));module[_0xc142('0x1')]={'name':{'type':Sequelize[_0xc142('0x2')],'unique':_0xc142('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc142('0x2')]},'notes':{'type':Sequelize[_0xc142('0x4')]},'preproduction':{'type':Sequelize[_0xc142('0x5')](_0xc142('0x6')),'get':function(){if(this['getDataValue'](_0xc142('0x7'))){return this[_0xc142('0x8')](_0xc142('0x7'))[_0xc142('0x9')]('utf8');}}},'production':{'type':Sequelize[_0xc142('0x5')]('long'),'get':function(){if(this[_0xc142('0x8')](_0xc142('0xa'))){return this['getDataValue'](_0xc142('0xa'))[_0xc142('0x9')](_0xc142('0xb'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8b43=['preproduction','getDataValue','toString','utf8','production','DATE','sequelize','exports','STRING','TEXT','BLOB','long'];(function(_0x16716e,_0x3b8362){var _0x4d5a77=function(_0x18d99e){while(--_0x18d99e){_0x16716e['push'](_0x16716e['shift']());}};_0x4d5a77(++_0x3b8362);}(_0x8b43,0x7e));var _0x38b4=function(_0x2860b4,_0x12a944){_0x2860b4=_0x2860b4-0x0;var _0x5d7967=_0x8b43[_0x2860b4];return _0x5d7967;};'use strict';var Sequelize=require(_0x38b4('0x0'));module[_0x38b4('0x1')]={'name':{'type':Sequelize[_0x38b4('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x38b4('0x3')]},'preproduction':{'type':Sequelize[_0x38b4('0x4')](_0x38b4('0x5')),'get':function(){if(this['getDataValue'](_0x38b4('0x6'))){return this[_0x38b4('0x7')](_0x38b4('0x6'))[_0x38b4('0x8')](_0x38b4('0x9'));}}},'production':{'type':Sequelize[_0x38b4('0x4')](_0x38b4('0x5')),'get':function(){if(this['getDataValue'](_0x38b4('0xa'))){return this[_0x38b4('0x7')](_0x38b4('0xa'))[_0x38b4('0x8')](_0x38b4('0x9'));}}},'savedAt':{'type':Sequelize[_0x38b4('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9538553..8e7ebdb 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 _0x8c78=['undefined','count','limit','set','update','then','get','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','error','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','SquareProject','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset'];(function(_0x5ab844,_0x4f119b){var _0x3c061f=function(_0x443b68){while(--_0x443b68){_0x5ab844['push'](_0x5ab844['shift']());}};_0x3c061f(++_0x4f119b);}(_0x8c78,0xd0));var _0x88c7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8c78[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var Redis=require(_0x88c7('0x0'));var qs=require(_0x88c7('0x1'));var logger=require(_0x88c7('0x2'))(_0x88c7('0x3'));var config=require(_0x88c7('0x4'));var db=require(_0x88c7('0x5'))['db'];config['redis']=_[_0x88c7('0x6')](config[_0x88c7('0x7')],{'host':_0x88c7('0x8'),'port':0x18eb});var socket=require(_0x88c7('0x9'))(new Redis(config[_0x88c7('0x7')]));require(_0x88c7('0xa'))[_0x88c7('0xb')](socket);function respondWithResult(_0x149bcf,_0x273fbf){_0x273fbf=_0x273fbf||0xc8;return function(_0xdb9b19){if(_0xdb9b19){return _0x149bcf[_0x88c7('0xc')](_0x273fbf)['json'](_0xdb9b19);}};}function respondWithFilteredResult(_0x3d9e6a,_0x1abbc1){return function(_0xd77768){if(_0xd77768){var _0xd2374=typeof _0x1abbc1[_0x88c7('0xd')]===_0x88c7('0xe')&&typeof _0x1abbc1['limit']===_0x88c7('0xe');var _0x2f2b91=_0xd77768['count'];var _0x26f552=_0xd2374?0x0:_0x1abbc1[_0x88c7('0xd')];var _0x45ff00=_0xd2374?_0xd77768[_0x88c7('0xf')]:_0x1abbc1[_0x88c7('0xd')]+_0x1abbc1[_0x88c7('0x10')];var _0x4ba8dc;if(_0x45ff00>=_0x2f2b91){_0x45ff00=_0x2f2b91;_0x4ba8dc=0xc8;}else{_0x4ba8dc=0xce;}_0x3d9e6a[_0x88c7('0xc')](_0x4ba8dc);return _0x3d9e6a[_0x88c7('0x11')]('Content-Range',_0x26f552+'-'+_0x45ff00+'/'+_0x2f2b91)['json'](_0xd77768);}return null;};}function saveUpdates(_0x58d888){return function(_0x403178){if(_0x403178){return _0x403178[_0x88c7('0x12')](_0x58d888)[_0x88c7('0x13')](function(_0x5b7cc5){return _0x5b7cc5;});}return null;};}function removeEntity(_0x2fa868){return function(_0x459465){if(_0x459465){return _0x459465['destroy']()[_0x88c7('0x13')](function(){var _0x54c821=_0x459465[_0x88c7('0x14')]({'plain':!![]});var _0x50e994=_0x88c7('0x15');return db[_0x88c7('0x16')][_0x88c7('0x17')]({'where':{'type':_0x50e994,'resourceId':_0x54c821['id']}})['then'](function(){return _0x459465;});})[_0x88c7('0x13')](function(){var _0x190f4e=new Redis(config['redis']);_0x190f4e[_0x88c7('0x18')](_0x88c7('0x19'),JSON[_0x88c7('0x1a')]({'id':_0x459465['id'],'deleted':!![]}));})[_0x88c7('0x13')](function(){_0x2fa868[_0x88c7('0xc')](0xcc)[_0x88c7('0x1b')]();});}};}function handleEntityNotFound(_0x37930a){return function(_0x365fe9){if(!_0x365fe9){_0x37930a[_0x88c7('0x1c')](0x194);}return _0x365fe9;};}function handleError(_0xe47176,_0x1bae60){_0x1bae60=_0x1bae60||0x1f4;return function(_0x1d695b){logger[_0x88c7('0x1d')](_0x1d695b['stack']);if(_0x1d695b[_0x88c7('0x1e')]){delete _0x1d695b['name'];}_0xe47176[_0x88c7('0xc')](_0x1bae60)[_0x88c7('0x1f')](_0x1d695b);};}exports[_0x88c7('0x20')]=function(_0x4c84cb,_0x1a969d){var _0xb0fcd7={},_0x2622d6={},_0x2844b9={'count':0x0,'rows':[]};var _0x29d097=_[_0x88c7('0x21')](db['SquareProject']['rawAttributes'],function(_0x5ed808){return{'name':_0x5ed808[_0x88c7('0x22')],'type':_0x5ed808['type'][_0x88c7('0x23')]};});_0x2622d6[_0x88c7('0x24')]=_[_0x88c7('0x21')](_0x29d097,_0x88c7('0x1e'));_0x2622d6[_0x88c7('0x25')]=_[_0x88c7('0x26')](_0x4c84cb[_0x88c7('0x25')]);_0x2622d6['filters']=_[_0x88c7('0x27')](_0x2622d6[_0x88c7('0x24')],_0x2622d6['query']);_0xb0fcd7[_0x88c7('0x28')]=_[_0x88c7('0x27')](_0x2622d6[_0x88c7('0x24')],qs[_0x88c7('0x29')](_0x4c84cb['query'][_0x88c7('0x29')]));_0xb0fcd7['attributes']=_0xb0fcd7['attributes'][_0x88c7('0x2a')]?_0xb0fcd7[_0x88c7('0x28')]:_0x2622d6[_0x88c7('0x24')];if(!_0x4c84cb[_0x88c7('0x25')][_0x88c7('0x2b')](_0x88c7('0x2c'))){_0xb0fcd7[_0x88c7('0x10')]=qs['limit'](_0x4c84cb[_0x88c7('0x25')][_0x88c7('0x10')]);_0xb0fcd7[_0x88c7('0xd')]=qs[_0x88c7('0xd')](_0x4c84cb[_0x88c7('0x25')][_0x88c7('0xd')]);}_0xb0fcd7[_0x88c7('0x2d')]=qs[_0x88c7('0x2e')](_0x4c84cb[_0x88c7('0x25')][_0x88c7('0x2e')]);_0xb0fcd7[_0x88c7('0x2f')]=qs[_0x88c7('0x30')](_[_0x88c7('0x31')](_0x4c84cb[_0x88c7('0x25')],_0x2622d6[_0x88c7('0x30')]),_0x29d097);if(_0x4c84cb['query'][_0x88c7('0x32')]){_0xb0fcd7[_0x88c7('0x2f')]=_[_0x88c7('0x33')](_0xb0fcd7[_0x88c7('0x2f')],{'$or':_['map'](_0x29d097,function(_0x54945){if(_0x54945[_0x88c7('0x34')]!==_0x88c7('0x35')){var _0x5d9cae={};_0x5d9cae[_0x54945[_0x88c7('0x1e')]]={'$like':'%'+_0x4c84cb[_0x88c7('0x25')][_0x88c7('0x32')]+'%'};return _0x5d9cae;}})});}_0xb0fcd7=_['merge']({},_0xb0fcd7,_0x4c84cb['options']);var _0x422f71={'where':_0xb0fcd7[_0x88c7('0x2f')]};return db[_0x88c7('0x36')][_0x88c7('0xf')](_0x422f71)[_0x88c7('0x13')](function(_0x52bf49){_0x2844b9[_0x88c7('0xf')]=_0x52bf49;if(_0x4c84cb[_0x88c7('0x25')][_0x88c7('0x37')]){_0xb0fcd7[_0x88c7('0x38')]=[{'all':!![]}];}return db[_0x88c7('0x36')][_0x88c7('0x39')](_0xb0fcd7);})[_0x88c7('0x13')](function(_0x17b203){_0x2844b9[_0x88c7('0x3a')]=_0x17b203;return _0x2844b9;})[_0x88c7('0x13')](respondWithFilteredResult(_0x1a969d,_0xb0fcd7))[_0x88c7('0x3b')](handleError(_0x1a969d,null));};exports[_0x88c7('0x3c')]=function(_0xf9b64,_0x22ee3f){var _0x4587ff={'raw':![],'where':{'id':_0xf9b64[_0x88c7('0x3d')]['id']}},_0x8f31b8={};_0x8f31b8['model']=_[_0x88c7('0x26')](db[_0x88c7('0x36')][_0x88c7('0x3e')]);_0x8f31b8[_0x88c7('0x25')]=_[_0x88c7('0x26')](_0xf9b64[_0x88c7('0x25')]);_0x8f31b8[_0x88c7('0x30')]=_[_0x88c7('0x27')](_0x8f31b8['model'],_0x8f31b8[_0x88c7('0x25')]);_0x4587ff[_0x88c7('0x28')]=_[_0x88c7('0x27')](_0x8f31b8[_0x88c7('0x24')],qs[_0x88c7('0x29')](_0xf9b64['query']['fields']));_0x4587ff[_0x88c7('0x28')]=_0x4587ff['attributes'][_0x88c7('0x2a')]?_0x4587ff['attributes']:_0x8f31b8[_0x88c7('0x24')];if(_0xf9b64[_0x88c7('0x25')][_0x88c7('0x37')]){_0x4587ff[_0x88c7('0x38')]=[{'all':!![]}];}_0x4587ff=_[_0x88c7('0x33')]({},_0x4587ff,_0xf9b64[_0x88c7('0x3f')]);return db['SquareProject'][_0x88c7('0x40')](_0x4587ff)[_0x88c7('0x13')](handleEntityNotFound(_0x22ee3f,null))[_0x88c7('0x13')](respondWithResult(_0x22ee3f,null))[_0x88c7('0x3b')](handleError(_0x22ee3f,null));};exports[_0x88c7('0x41')]=function(_0x4f819c,_0x321471){return db[_0x88c7('0x36')][_0x88c7('0x41')](_0x4f819c[_0x88c7('0x42')],{})[_0x88c7('0x13')](function(_0x17982a){var _0x3d5819=_0x4f819c[_0x88c7('0x43')][_0x88c7('0x14')]({'plain':!![]});if(!_0x3d5819)throw new Error(_0x88c7('0x44'));if(_0x3d5819[_0x88c7('0x45')]===_0x88c7('0x43')){var _0x1f2ccc=_0x17982a[_0x88c7('0x14')]({'plain':!![]});var _0x15416c='SquareProjects';return db[_0x88c7('0x46')]['find']({'where':{'name':_0x15416c,'userProfileId':_0x3d5819['userProfileId']},'raw':!![]})[_0x88c7('0x13')](function(_0x4c9ad4){if(_0x4c9ad4&&_0x4c9ad4[_0x88c7('0x47')]===0x0){return db[_0x88c7('0x16')]['create']({'name':_0x1f2ccc[_0x88c7('0x1e')],'resourceId':_0x1f2ccc['id'],'type':_0x4c9ad4[_0x88c7('0x1e')],'sectionId':_0x4c9ad4['id']},{})[_0x88c7('0x13')](function(){return _0x17982a;});}else{return _0x17982a;}})[_0x88c7('0x3b')](function(_0x206cc3){logger['error'](_0x88c7('0x48'),_0x206cc3);throw _0x206cc3;});}return _0x17982a;})[_0x88c7('0x13')](respondWithResult(_0x321471,0xc9))['catch'](handleError(_0x321471,null));};exports['update']=function(_0x301659,_0x239c5e){if(_0x301659[_0x88c7('0x42')]['id']){delete _0x301659[_0x88c7('0x42')]['id'];}return db[_0x88c7('0x36')]['find']({'where':{'id':_0x301659['params']['id']}})['then'](handleEntityNotFound(_0x239c5e,null))[_0x88c7('0x13')](saveUpdates(_0x301659[_0x88c7('0x42')],null))['then'](function(_0x3bf783){if(!_0x3bf783)return;var _0x36875d=_0x3bf783['get']({'plain':!![]});return _0x36875d;})[_0x88c7('0x13')](function(_0x4cb79d){var _0x243c24=new Redis(config[_0x88c7('0x7')]);_0x243c24[_0x88c7('0x18')](_0x88c7('0x19'),JSON[_0x88c7('0x1a')](_[_0x88c7('0x31')](_0x4cb79d,['id','name',_0x88c7('0x49')])));return _0x4cb79d;})[_0x88c7('0x13')](respondWithResult(_0x239c5e,null))[_0x88c7('0x3b')](handleError(_0x239c5e,null));};exports[_0x88c7('0x17')]=function(_0x71fdec,_0xffe74e){return db[_0x88c7('0x36')][_0x88c7('0x40')]({'where':{'id':_0x71fdec[_0x88c7('0x3d')]['id']}})[_0x88c7('0x13')](handleEntityNotFound(_0xffe74e,null))[_0x88c7('0x13')](removeEntity(_0xffe74e,null))[_0x88c7('0x3b')](handleError(_0xffe74e,null));}; \ No newline at end of file +var _0x9c21=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','undefined','count','offset','set','Content-Range','then','get','SquareProjects','UserProfileResource','publish','agi','end','sendStatus','error','stack','name','SquareProject','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','include','rows','show','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch'];(function(_0x1d8b83,_0x5e4e57){var _0xca8ff=function(_0x274a60){while(--_0x274a60){_0x1d8b83['push'](_0x1d8b83['shift']());}};_0xca8ff(++_0x5e4e57);}(_0x9c21,0x162));var _0x19c2=function(_0x594f04,_0xa805b5){_0x594f04=_0x594f04-0x0;var _0x162144=_0x9c21[_0x594f04];return _0x162144;};'use strict';var _=require(_0x19c2('0x0'));var Redis=require(_0x19c2('0x1'));var qs=require(_0x19c2('0x2'));var logger=require(_0x19c2('0x3'))(_0x19c2('0x4'));var config=require(_0x19c2('0x5'));var db=require('../../mysqldb')['db'];config[_0x19c2('0x6')]=_[_0x19c2('0x7')](config[_0x19c2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x19c2('0x8'))(new Redis(config['redis']));require(_0x19c2('0x9'))[_0x19c2('0xa')](socket);function respondWithResult(_0x4e176f,_0x300d6f){_0x300d6f=_0x300d6f||0xc8;return function(_0x39baac){if(_0x39baac){return _0x4e176f[_0x19c2('0xb')](_0x300d6f)[_0x19c2('0xc')](_0x39baac);}};}function respondWithFilteredResult(_0x3f1d5b,_0x5273fc){return function(_0x27a9d2){if(_0x27a9d2){var _0x4df6cc=typeof _0x5273fc['offset']===_0x19c2('0xd')&&typeof _0x5273fc['limit']===_0x19c2('0xd');var _0x285b09=_0x27a9d2['count'];var _0x322273=_0x4df6cc?0x0:_0x5273fc['offset'];var _0x14ca17=_0x4df6cc?_0x27a9d2[_0x19c2('0xe')]:_0x5273fc[_0x19c2('0xf')]+_0x5273fc['limit'];var _0xdf14db;if(_0x14ca17>=_0x285b09){_0x14ca17=_0x285b09;_0xdf14db=0xc8;}else{_0xdf14db=0xce;}_0x3f1d5b[_0x19c2('0xb')](_0xdf14db);return _0x3f1d5b[_0x19c2('0x10')](_0x19c2('0x11'),_0x322273+'-'+_0x14ca17+'/'+_0x285b09)[_0x19c2('0xc')](_0x27a9d2);}return null;};}function saveUpdates(_0x599296){return function(_0x544c19){if(_0x544c19){return _0x544c19['update'](_0x599296)[_0x19c2('0x12')](function(_0x24149c){return _0x24149c;});}return null;};}function removeEntity(_0xb2ba7d){return function(_0x470921){if(_0x470921){return _0x470921['destroy']()[_0x19c2('0x12')](function(){var _0x50fda0=_0x470921[_0x19c2('0x13')]({'plain':!![]});var _0x41312c=_0x19c2('0x14');return db[_0x19c2('0x15')]['destroy']({'where':{'type':_0x41312c,'resourceId':_0x50fda0['id']}})[_0x19c2('0x12')](function(){return _0x470921;});})[_0x19c2('0x12')](function(){var _0x3d90c8=new Redis(config['redis']);_0x3d90c8[_0x19c2('0x16')](_0x19c2('0x17'),JSON['stringify']({'id':_0x470921['id'],'deleted':!![]}));})[_0x19c2('0x12')](function(){_0xb2ba7d[_0x19c2('0xb')](0xcc)[_0x19c2('0x18')]();});}};}function handleEntityNotFound(_0x26b57a){return function(_0x342efe){if(!_0x342efe){_0x26b57a[_0x19c2('0x19')](0x194);}return _0x342efe;};}function handleError(_0x126333,_0x3087de){_0x3087de=_0x3087de||0x1f4;return function(_0x18462c){logger[_0x19c2('0x1a')](_0x18462c[_0x19c2('0x1b')]);if(_0x18462c['name']){delete _0x18462c[_0x19c2('0x1c')];}_0x126333[_0x19c2('0xb')](_0x3087de)['send'](_0x18462c);};}exports['index']=function(_0xeef8e0,_0x5b40e6){var _0x2246a2={},_0x163ef4={},_0x57202e={'count':0x0,'rows':[]};var _0x500a01=_['map'](db[_0x19c2('0x1d')][_0x19c2('0x1e')],function(_0x4c79e3){return{'name':_0x4c79e3[_0x19c2('0x1f')],'type':_0x4c79e3[_0x19c2('0x20')][_0x19c2('0x21')]};});_0x163ef4['model']=_['map'](_0x500a01,_0x19c2('0x1c'));_0x163ef4[_0x19c2('0x22')]=_[_0x19c2('0x23')](_0xeef8e0[_0x19c2('0x22')]);_0x163ef4[_0x19c2('0x24')]=_['intersection'](_0x163ef4[_0x19c2('0x25')],_0x163ef4[_0x19c2('0x22')]);_0x2246a2[_0x19c2('0x26')]=_[_0x19c2('0x27')](_0x163ef4[_0x19c2('0x25')],qs['fields'](_0xeef8e0['query'][_0x19c2('0x28')]));_0x2246a2['attributes']=_0x2246a2[_0x19c2('0x26')][_0x19c2('0x29')]?_0x2246a2['attributes']:_0x163ef4[_0x19c2('0x25')];if(!_0xeef8e0['query'][_0x19c2('0x2a')](_0x19c2('0x2b'))){_0x2246a2[_0x19c2('0x2c')]=qs[_0x19c2('0x2c')](_0xeef8e0[_0x19c2('0x22')][_0x19c2('0x2c')]);_0x2246a2['offset']=qs[_0x19c2('0xf')](_0xeef8e0[_0x19c2('0x22')]['offset']);}_0x2246a2[_0x19c2('0x2d')]=qs[_0x19c2('0x2e')](_0xeef8e0[_0x19c2('0x22')][_0x19c2('0x2e')]);_0x2246a2[_0x19c2('0x2f')]=qs[_0x19c2('0x24')](_[_0x19c2('0x30')](_0xeef8e0[_0x19c2('0x22')],_0x163ef4[_0x19c2('0x24')]),_0x500a01);if(_0xeef8e0[_0x19c2('0x22')][_0x19c2('0x31')]){_0x2246a2[_0x19c2('0x2f')]=_[_0x19c2('0x32')](_0x2246a2[_0x19c2('0x2f')],{'$or':_['map'](_0x500a01,function(_0x344fe9){if(_0x344fe9['type']!=='VIRTUAL'){var _0x4e1b7f={};_0x4e1b7f[_0x344fe9[_0x19c2('0x1c')]]={'$like':'%'+_0xeef8e0['query'][_0x19c2('0x31')]+'%'};return _0x4e1b7f;}})});}_0x2246a2=_['merge']({},_0x2246a2,_0xeef8e0['options']);var _0x59ff70={'where':_0x2246a2['where']};return db[_0x19c2('0x1d')][_0x19c2('0xe')](_0x59ff70)[_0x19c2('0x12')](function(_0x332c5d){_0x57202e[_0x19c2('0xe')]=_0x332c5d;if(_0xeef8e0[_0x19c2('0x22')]['includeAll']){_0x2246a2[_0x19c2('0x33')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x2246a2);})[_0x19c2('0x12')](function(_0x358fb2){_0x57202e[_0x19c2('0x34')]=_0x358fb2;return _0x57202e;})[_0x19c2('0x12')](respondWithFilteredResult(_0x5b40e6,_0x2246a2))['catch'](handleError(_0x5b40e6,null));};exports[_0x19c2('0x35')]=function(_0x5886d7,_0x35e3f6){var _0x569572={'raw':![],'where':{'id':_0x5886d7['params']['id']}},_0x38c225={};_0x38c225[_0x19c2('0x25')]=_[_0x19c2('0x23')](db[_0x19c2('0x1d')][_0x19c2('0x1e')]);_0x38c225[_0x19c2('0x22')]=_[_0x19c2('0x23')](_0x5886d7['query']);_0x38c225['filters']=_['intersection'](_0x38c225[_0x19c2('0x25')],_0x38c225[_0x19c2('0x22')]);_0x569572['attributes']=_[_0x19c2('0x27')](_0x38c225['model'],qs[_0x19c2('0x28')](_0x5886d7[_0x19c2('0x22')][_0x19c2('0x28')]));_0x569572[_0x19c2('0x26')]=_0x569572['attributes'][_0x19c2('0x29')]?_0x569572[_0x19c2('0x26')]:_0x38c225[_0x19c2('0x25')];if(_0x5886d7['query'][_0x19c2('0x36')]){_0x569572[_0x19c2('0x33')]=[{'all':!![]}];}_0x569572=_[_0x19c2('0x32')]({},_0x569572,_0x5886d7[_0x19c2('0x37')]);return db[_0x19c2('0x1d')][_0x19c2('0x38')](_0x569572)[_0x19c2('0x12')](handleEntityNotFound(_0x35e3f6,null))['then'](respondWithResult(_0x35e3f6,null))['catch'](handleError(_0x35e3f6,null));};exports[_0x19c2('0x39')]=function(_0x5935e0,_0x150dfe){return db[_0x19c2('0x1d')][_0x19c2('0x39')](_0x5935e0[_0x19c2('0x3a')],{})['then'](function(_0x201ef6){var _0x17f2b0=_0x5935e0['user'][_0x19c2('0x13')]({'plain':!![]});if(!_0x17f2b0)throw new Error(_0x19c2('0x3b'));if(_0x17f2b0[_0x19c2('0x3c')]===_0x19c2('0x3d')){var _0x4e8dea=_0x201ef6[_0x19c2('0x13')]({'plain':!![]});var _0x53a082=_0x19c2('0x14');return db[_0x19c2('0x3e')]['find']({'where':{'name':_0x53a082,'userProfileId':_0x17f2b0[_0x19c2('0x3f')]},'raw':!![]})[_0x19c2('0x12')](function(_0x43c748){if(_0x43c748&&_0x43c748[_0x19c2('0x40')]===0x0){return db[_0x19c2('0x15')][_0x19c2('0x39')]({'name':_0x4e8dea['name'],'resourceId':_0x4e8dea['id'],'type':_0x43c748[_0x19c2('0x1c')],'sectionId':_0x43c748['id']},{})['then'](function(){return _0x201ef6;});}else{return _0x201ef6;}})[_0x19c2('0x41')](function(_0x110340){logger[_0x19c2('0x1a')](_0x19c2('0x42'),_0x110340);throw _0x110340;});}return _0x201ef6;})['then'](respondWithResult(_0x150dfe,0xc9))[_0x19c2('0x41')](handleError(_0x150dfe,null));};exports['update']=function(_0x4e34d9,_0x41e71b){if(_0x4e34d9[_0x19c2('0x3a')]['id']){delete _0x4e34d9['body']['id'];}return db['SquareProject'][_0x19c2('0x38')]({'where':{'id':_0x4e34d9[_0x19c2('0x43')]['id']}})[_0x19c2('0x12')](handleEntityNotFound(_0x41e71b,null))['then'](saveUpdates(_0x4e34d9[_0x19c2('0x3a')],null))[_0x19c2('0x12')](function(_0x5f5733){if(!_0x5f5733)return;var _0xca90a9=_0x5f5733[_0x19c2('0x13')]({'plain':!![]});return _0xca90a9;})[_0x19c2('0x12')](function(_0x4fc055){var _0x48e675=new Redis(config['redis']);_0x48e675[_0x19c2('0x16')]('agi',JSON[_0x19c2('0x44')](_[_0x19c2('0x30')](_0x4fc055,['id',_0x19c2('0x1c'),_0x19c2('0x45')])));return _0x4fc055;})[_0x19c2('0x12')](respondWithResult(_0x41e71b,null))[_0x19c2('0x41')](handleError(_0x41e71b,null));};exports['destroy']=function(_0x30576e,_0x24aa0f){return db[_0x19c2('0x1d')]['find']({'where':{'id':_0x30576e[_0x19c2('0x43')]['id']}})['then'](handleEntityNotFound(_0x24aa0f,null))[_0x19c2('0x12')](removeEntity(_0x24aa0f,null))[_0x19c2('0x41')](handleError(_0x24aa0f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3303928..518b749 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 _0x21c2=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x562446,_0x274fe3){var _0x381619=function(_0x16db9e){while(--_0x16db9e){_0x562446['push'](_0x562446['shift']());}};_0x381619(++_0x274fe3);}(_0x21c2,0x15a));var _0x221c=function(_0xa4c3f7,_0x8d68a2){_0xa4c3f7=_0xa4c3f7-0x0;var _0x4a6f9d=_0x21c2[_0xa4c3f7];return _0x4a6f9d;};'use strict';var EventEmitter=require(_0x221c('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x221c('0x1')](0x0);var events={'afterCreate':_0x221c('0x2'),'afterUpdate':_0x221c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38f743){return function(_0x3c050c,_0x5d3379,_0x506a7f){SquareProjectEvents[_0x221c('0x4')](_0x38f743+':'+_0x3c050c['id'],_0x3c050c);SquareProjectEvents[_0x221c('0x4')](_0x38f743,_0x3c050c);_0x506a7f(null);};}for(var e in events){if(events[_0x221c('0x5')](e)){var event=events[e];SquareProject[_0x221c('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x72a2=['events','../../mysqldb','SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ac5f3,_0x17ea51){var _0x65249d=function(_0x2da55b){while(--_0x2da55b){_0x3ac5f3['push'](_0x3ac5f3['shift']());}};_0x65249d(++_0x17ea51);}(_0x72a2,0x186));var _0x272a=function(_0xb3df2e,_0x472ddc){_0xb3df2e=_0xb3df2e-0x0;var _0xde69be=_0x72a2[_0xb3df2e];return _0xde69be;};'use strict';var EventEmitter=require(_0x272a('0x0'));var SquareProject=require(_0x272a('0x1'))['db'][_0x272a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x272a('0x3')](0x0);var events={'afterCreate':_0x272a('0x4'),'afterUpdate':'update','afterDestroy':_0x272a('0x5')};function emitEvent(_0x13eaf3){return function(_0x2672d8,_0x3e5cdc,_0x9a4205){SquareProjectEvents['emit'](_0x13eaf3+':'+_0x2672d8['id'],_0x2672d8);SquareProjectEvents[_0x272a('0x6')](_0x13eaf3,_0x2672d8);_0x9a4205(null);};}for(var e in events){if(events[_0x272a('0x7')](e)){var event=events[e];SquareProject[_0x272a('0x8')](e,emitEvent(event));}}module[_0x272a('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 725af9f..b80c64b 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 _0xf477=['lodash','api','moment','bluebird','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1384ac,_0x2e08a1){var _0x18df8f=function(_0x48112){while(--_0x48112){_0x1384ac['push'](_0x1384ac['shift']());}};_0x18df8f(++_0x2e08a1);}(_0xf477,0x15e));var _0x7f47=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf477[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x7f47('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7f47('0x1'));var moment=require(_0x7f47('0x2'));var BPromise=require(_0x7f47('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f47('0x4'));var rimraf=require(_0x7f47('0x5'));var config=require('../../config/environment');var attributes=require(_0x7f47('0x6'));module[_0x7f47('0x7')]=function(_0x270546,_0x4faf43){return _0x270546[_0x7f47('0x8')](_0x7f47('0x9'),attributes,{'tableName':_0x7f47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29deb3,_0x3c910f,_0x2fe6fc){if(_0x29deb3[_0x7f47('0xb')]('preproduction')){_0x29deb3['savedAt']=moment()[_0x7f47('0xc')](_0x7f47('0xd'));}if(_0x29deb3[_0x7f47('0xb')]('production')){_0x29deb3['publishedAt']=moment()[_0x7f47('0xc')](_0x7f47('0xd'));}_0x2fe6fc(null,_0x29deb3);}}});}; \ No newline at end of file +var _0xc202=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','square_projects','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','format','lodash'];(function(_0x4c1f9d,_0x345d5d){var _0x4a18e0=function(_0x516575){while(--_0x516575){_0x4c1f9d['push'](_0x4c1f9d['shift']());}};_0x4a18e0(++_0x345d5d);}(_0xc202,0xdc));var _0x2c20=function(_0x1c1174,_0x226715){_0x1c1174=_0x1c1174-0x0;var _0x2d4433=_0xc202[_0x1c1174];return _0x2d4433;};'use strict';var _=require(_0x2c20('0x0'));var util=require(_0x2c20('0x1'));var logger=require(_0x2c20('0x2'))(_0x2c20('0x3'));var moment=require(_0x2c20('0x4'));var BPromise=require(_0x2c20('0x5'));var rp=require(_0x2c20('0x6'));var fs=require('fs');var path=require(_0x2c20('0x7'));var rimraf=require(_0x2c20('0x8'));var config=require(_0x2c20('0x9'));var attributes=require(_0x2c20('0xa'));module['exports']=function(_0x22b2d5,_0x5b6c33){return _0x22b2d5[_0x2c20('0xb')]('SquareProject',attributes,{'tableName':_0x2c20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29ccc2,_0x133de9,_0x57d71d){if(_0x29ccc2[_0x2c20('0xd')](_0x2c20('0xe'))){_0x29ccc2['savedAt']=moment()['format'](_0x2c20('0xf'));}if(_0x29ccc2[_0x2c20('0xd')]('production')){_0x29ccc2['publishedAt']=moment()[_0x2c20('0x10')](_0x2c20('0xf'));}_0x57d71d(null,_0x29ccc2);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index afca129..a000a4a 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 _0x52f7=['findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify','error','ShowSquareProject','find','debug','catch','message','ioredis','../../config/logger','rpc','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject'];(function(_0x441568,_0x2539d5){var _0x1558d5=function(_0x27ce92){while(--_0x27ce92){_0x441568['push'](_0x441568['shift']());}};_0x1558d5(++_0x2539d5);}(_0x52f7,0x86));var _0x752f=function(_0x4d6f3f,_0x3afe73){_0x4d6f3f=_0x4d6f3f-0x0;var _0x212425=_0x52f7[_0x4d6f3f];return _0x212425;};'use strict';var _=require('lodash');var Redis=require(_0x752f('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0x752f('0x1'))(_0x752f('0x2'));var config=require('../../config/environment');config['redis']=_[_0x752f('0x3')](config[_0x752f('0x4')],{'host':_0x752f('0x5'),'port':0x18eb});var socket=require(_0x752f('0x6'))(new Redis(config['redis']));require(_0x752f('0x7'))[_0x752f('0x8')](socket);exports[_0x752f('0x9')]=function(_0x3238c5){var _0x81bcd=this;return new Promise(function(_0x179dab,_0x591969){return db[_0x752f('0xa')][_0x752f('0xb')]({'raw':_0x3238c5[_0x752f('0xc')]?_0x3238c5[_0x752f('0xc')][_0x752f('0xd')]===undefined?!![]:![]:!![],'where':_0x3238c5[_0x752f('0xc')]?_0x3238c5[_0x752f('0xc')][_0x752f('0xe')]||null:null,'attributes':_0x3238c5[_0x752f('0xc')]?_0x3238c5[_0x752f('0xc')][_0x752f('0xf')]||null:null,'limit':_0x3238c5['options']?_0x3238c5[_0x752f('0xc')][_0x752f('0x10')]||null:null,'include':_0x3238c5[_0x752f('0xc')]?_0x3238c5[_0x752f('0xc')][_0x752f('0x11')]?_[_0x752f('0x12')](_0x3238c5['options']['include'],function(_0x5dd1f7){return{'model':db[_0x5dd1f7[_0x752f('0x13')]],'as':_0x5dd1f7['as'],'attributes':_0x5dd1f7[_0x752f('0xf')],'include':_0x5dd1f7[_0x752f('0x11')]?_[_0x752f('0x12')](_0x5dd1f7[_0x752f('0x11')],function(_0xe85a43){return{'model':db[_0xe85a43['model']],'as':_0xe85a43['as'],'attributes':_0xe85a43[_0x752f('0xf')],'include':_0xe85a43[_0x752f('0x11')]?_[_0x752f('0x12')](_0xe85a43[_0x752f('0x11')],function(_0x278673){return{'model':db[_0x278673['model']],'as':_0x278673['as'],'attributes':_0x278673[_0x752f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x752f('0x14')](function(_0x21c333){logger[_0x752f('0x15')](_0x752f('0x9'),_0x3238c5);logger['debug'](_0x752f('0x9'),_0x3238c5,JSON[_0x752f('0x16')](_0x21c333));_0x179dab(_0x21c333);})['catch'](function(_0x2a83c8){logger[_0x752f('0x17')](_0x752f('0x9'),_0x2a83c8['message'],_0x3238c5);_0x591969(_0x81bcd[_0x752f('0x17')](0x1f4,_0x2a83c8['message']));});});};exports[_0x752f('0x18')]=function(_0x2597c4){var _0x222218=this;return new Promise(function(_0x59735b,_0x19c2ab){return db[_0x752f('0xa')][_0x752f('0x19')]({'raw':_0x2597c4[_0x752f('0xc')]?_0x2597c4[_0x752f('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x2597c4[_0x752f('0xc')]?_0x2597c4[_0x752f('0xc')][_0x752f('0xe')]||null:null,'attributes':_0x2597c4['options']?_0x2597c4['options'][_0x752f('0xf')]||null:null,'include':_0x2597c4['options']?_0x2597c4[_0x752f('0xc')]['include']?_[_0x752f('0x12')](_0x2597c4['options']['include'],function(_0x42a682){return{'model':db[_0x42a682['model']],'as':_0x42a682['as'],'attributes':_0x42a682[_0x752f('0xf')],'include':_0x42a682['include']?_['map'](_0x42a682[_0x752f('0x11')],function(_0x2e8deb){return{'model':db[_0x2e8deb['model']],'as':_0x2e8deb['as'],'attributes':_0x2e8deb[_0x752f('0xf')],'include':_0x2e8deb['include']?_[_0x752f('0x12')](_0x2e8deb['include'],function(_0x322867){return{'model':db[_0x322867['model']],'as':_0x322867['as'],'attributes':_0x322867[_0x752f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x752f('0x14')](function(_0x11c113){logger[_0x752f('0x15')](_0x752f('0x18'),_0x2597c4);logger[_0x752f('0x1a')](_0x752f('0x18'),_0x2597c4,JSON[_0x752f('0x16')](_0x11c113));_0x59735b(_0x11c113);})[_0x752f('0x1b')](function(_0x3d618e){logger['error']('ShowSquareProject',_0x3d618e[_0x752f('0x1c')],_0x2597c4);_0x19c2ab(_0x222218[_0x752f('0x17')](0x1f4,_0x3d618e[_0x752f('0x1c')]));});});}; \ No newline at end of file +var _0xc750=['catch','error','ShowSquareProject','raw','where','message','lodash','ioredis','../../mysqldb','../../config/logger','defaults','redis','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','attributes','map','model','include','then','info','debug','stringify'];(function(_0x3ccbc7,_0x37e98e){var _0x38203e=function(_0x3ead3f){while(--_0x3ead3f){_0x3ccbc7['push'](_0x3ccbc7['shift']());}};_0x38203e(++_0x37e98e);}(_0xc750,0x14b));var _0x0c75=function(_0x16a83b,_0x3db981){_0x16a83b=_0x16a83b-0x0;var _0x2d403a=_0xc750[_0x16a83b];return _0x2d403a;};'use strict';var _=require(_0x0c75('0x0'));var Redis=require(_0x0c75('0x1'));var db=require(_0x0c75('0x2'))['db'];var logger=require(_0x0c75('0x3'))('rpc');var config=require('../../config/environment');config['redis']=_[_0x0c75('0x4')](config[_0x0c75('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0c75('0x6'))['register'](socket);exports[_0x0c75('0x7')]=function(_0x153b0a){var _0x1a753c=this;return new Promise(function(_0x1f4744,_0x4f001c){return db[_0x0c75('0x8')][_0x0c75('0x9')]({'raw':_0x153b0a['options']?_0x153b0a[_0x0c75('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x153b0a['options']?_0x153b0a['options']['where']||null:null,'attributes':_0x153b0a['options']?_0x153b0a[_0x0c75('0xa')][_0x0c75('0xb')]||null:null,'limit':_0x153b0a[_0x0c75('0xa')]?_0x153b0a[_0x0c75('0xa')]['limit']||null:null,'include':_0x153b0a[_0x0c75('0xa')]?_0x153b0a['options']['include']?_[_0x0c75('0xc')](_0x153b0a[_0x0c75('0xa')]['include'],function(_0x533c81){return{'model':db[_0x533c81[_0x0c75('0xd')]],'as':_0x533c81['as'],'attributes':_0x533c81[_0x0c75('0xb')],'include':_0x533c81[_0x0c75('0xe')]?_[_0x0c75('0xc')](_0x533c81[_0x0c75('0xe')],function(_0x1af9b){return{'model':db[_0x1af9b[_0x0c75('0xd')]],'as':_0x1af9b['as'],'attributes':_0x1af9b[_0x0c75('0xb')],'include':_0x1af9b[_0x0c75('0xe')]?_[_0x0c75('0xc')](_0x1af9b[_0x0c75('0xe')],function(_0x49e45d){return{'model':db[_0x49e45d[_0x0c75('0xd')]],'as':_0x49e45d['as'],'attributes':_0x49e45d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c75('0xf')](function(_0x1ab31e){logger[_0x0c75('0x10')]('GetSquareProjects',_0x153b0a);logger[_0x0c75('0x11')]('GetSquareProjects',_0x153b0a,JSON[_0x0c75('0x12')](_0x1ab31e));_0x1f4744(_0x1ab31e);})[_0x0c75('0x13')](function(_0x506c9a){logger[_0x0c75('0x14')](_0x0c75('0x7'),_0x506c9a['message'],_0x153b0a);_0x4f001c(_0x1a753c[_0x0c75('0x14')](0x1f4,_0x506c9a['message']));});});};exports[_0x0c75('0x15')]=function(_0x2e597d){var _0x1f7e6d=this;return new Promise(function(_0x3b8488,_0x4b31dd){return db['SquareProject']['find']({'raw':_0x2e597d[_0x0c75('0xa')]?_0x2e597d[_0x0c75('0xa')][_0x0c75('0x16')]===undefined?!![]:![]:!![],'where':_0x2e597d[_0x0c75('0xa')]?_0x2e597d['options'][_0x0c75('0x17')]||null:null,'attributes':_0x2e597d[_0x0c75('0xa')]?_0x2e597d[_0x0c75('0xa')]['attributes']||null:null,'include':_0x2e597d[_0x0c75('0xa')]?_0x2e597d[_0x0c75('0xa')][_0x0c75('0xe')]?_[_0x0c75('0xc')](_0x2e597d['options'][_0x0c75('0xe')],function(_0x572e3c){return{'model':db[_0x572e3c[_0x0c75('0xd')]],'as':_0x572e3c['as'],'attributes':_0x572e3c[_0x0c75('0xb')],'include':_0x572e3c[_0x0c75('0xe')]?_['map'](_0x572e3c['include'],function(_0x5bc092){return{'model':db[_0x5bc092[_0x0c75('0xd')]],'as':_0x5bc092['as'],'attributes':_0x5bc092[_0x0c75('0xb')],'include':_0x5bc092[_0x0c75('0xe')]?_[_0x0c75('0xc')](_0x5bc092[_0x0c75('0xe')],function(_0x5ee24f){return{'model':db[_0x5ee24f[_0x0c75('0xd')]],'as':_0x5ee24f['as'],'attributes':_0x5ee24f[_0x0c75('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50eacf){logger[_0x0c75('0x10')](_0x0c75('0x15'),_0x2e597d);logger['debug'](_0x0c75('0x15'),_0x2e597d,JSON[_0x0c75('0x12')](_0x50eacf));_0x3b8488(_0x50eacf);})[_0x0c75('0x13')](function(_0x9ce31b){logger['error'](_0x0c75('0x15'),_0x9ce31b[_0x0c75('0x18')],_0x2e597d);_0x4b31dd(_0x1f7e6d[_0x0c75('0x14')](0x1f4,_0x9ce31b[_0x0c75('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8954a72..913ecd3 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 _0x8fea=['remove','update','emit','removeListener','length','squareProject:','./squareProject.events'];(function(_0x337683,_0x45f294){var _0x3777e9=function(_0x34705d){while(--_0x34705d){_0x337683['push'](_0x337683['shift']());}};_0x3777e9(++_0x45f294);}(_0x8fea,0x1d4));var _0xa8fe=function(_0x4ec043,_0x2f109f){_0x4ec043=_0x4ec043-0x0;var _0x1b208c=_0x8fea[_0x4ec043];return _0x1b208c;};'use strict';var SquareProjectEvents=require(_0xa8fe('0x0'));var events=['save',_0xa8fe('0x1'),_0xa8fe('0x2')];function createListener(_0xc33551,_0x35bbb6){return function(_0x28c20b){_0x35bbb6[_0xa8fe('0x3')](_0xc33551,_0x28c20b);};}function removeListener(_0x358fad,_0x4cfee0){return function(){SquareProjectEvents[_0xa8fe('0x4')](_0x358fad,_0x4cfee0);};}exports['register']=function(_0x5f5695){for(var _0x3cab26=0x0,_0x136b15=events[_0xa8fe('0x5')];_0x3cab26<_0x136b15;_0x3cab26++){var _0x5a9286=events[_0x3cab26];var _0x5edc75=createListener(_0xa8fe('0x6')+_0x5a9286,_0x5f5695);SquareProjectEvents['on'](_0x5a9286,_0x5edc75);}}; \ No newline at end of file +var _0x701e=['update','removeListener','register','length','./squareProject.events','save','remove'];(function(_0x407c6c,_0x57f7af){var _0x3168f3=function(_0x5d9f9c){while(--_0x5d9f9c){_0x407c6c['push'](_0x407c6c['shift']());}};_0x3168f3(++_0x57f7af);}(_0x701e,0x100));var _0xe701=function(_0x447057,_0xeadb8f){_0x447057=_0x447057-0x0;var _0x27df86=_0x701e[_0x447057];return _0x27df86;};'use strict';var SquareProjectEvents=require(_0xe701('0x0'));var events=[_0xe701('0x1'),_0xe701('0x2'),_0xe701('0x3')];function createListener(_0x2dfed8,_0x29d69f){return function(_0x200b81){_0x29d69f['emit'](_0x2dfed8,_0x200b81);};}function removeListener(_0x8eb43,_0x3c6c46){return function(){SquareProjectEvents[_0xe701('0x4')](_0x8eb43,_0x3c6c46);};}exports[_0xe701('0x5')]=function(_0x25e841){for(var _0xd968ec=0x0,_0x31bdda=events[_0xe701('0x6')];_0xd968ec<_0x31bdda;_0xd968ec++){var _0x4939b8=events[_0xd968ec];var _0x57638b=createListener('squareProject:'+_0x4939b8,_0x25e841);SquareProjectEvents['on'](_0x4939b8,_0x57638b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 6765b3d..ecfc1c9 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 _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(_0x402ad5,_0x2a71f7){var _0x4dd778=function(_0x4d20af){while(--_0x4d20af){_0x402ad5['push'](_0x402ad5['shift']());}};_0x4dd778(++_0x2a71f7);}(_0x1261,0x144));var _0x1126=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x1261[_0x4a095e];return _0x10ef73;};'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 +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3c562d,_0x4e51b6){var _0x512bf1=function(_0x2295c6){while(--_0x2295c6){_0x3c562d['push'](_0x3c562d['shift']());}};_0x512bf1(++_0x4e51b6);}(_0x4975,0x86));var _0x5497=function(_0x2241d5,_0xaefc81){_0x2241d5=_0x2241d5-0x0;var _0x227bb2=_0x4975[_0x2241d5];return _0x227bb2;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 12c9f04..2ac539e 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 _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x4091b4,_0x2e6fc4){var _0x5120f1=function(_0xf27c2c){while(--_0xf27c2c){_0x4091b4['push'](_0x4091b4['shift']());}};_0x5120f1(++_0x2e6fc4);}(_0x032e,0x124));var _0xe032=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x032e[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file +var _0xb458=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x5d29a8,_0x38512b){var _0x12f651=function(_0x59af22){while(--_0x59af22){_0x5d29a8['push'](_0x5d29a8['shift']());}};_0x12f651(++_0x38512b);}(_0xb458,0x103));var _0x8b45=function(_0x1a91f0,_0x11e203){_0x1a91f0=_0x1a91f0-0x0;var _0x12f862=_0xb458[_0x1a91f0];return _0x12f862;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'uniqueid':{'type':Sequelize[_0x8b45('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8b45('0x2')]},'extension':{'type':Sequelize[_0x8b45('0x2')]},'priority':{'type':Sequelize[_0x8b45('0x2')]},'accountcode':{'type':Sequelize[_0x8b45('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x8b45('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x8b45('0x2')]},'format':{'type':Sequelize[_0x8b45('0x3')],'get':function(){var _0x2daa9a='';var _0x3a8ccb=this[_0x8b45('0x4')]('savePath');if(_0x3a8ccb){_0x2daa9a=_0x3a8ccb[_0x8b45('0x5')](_0x3a8ccb[_0x8b45('0x6')]('.'));}return _0x2daa9a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 1f559ea..fd5ad13 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 _0xb8b1=['info','cancellazione\x20fisica\x20documento\x20%s','existsSync','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','update','then','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','keys','intersection','query','attributes','model','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','show','params','catch','create','body','find','download','uniqueid','savePath','filename','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found'];(function(_0x31970a,_0x1fb737){var _0x4e1564=function(_0x143eff){while(--_0x143eff){_0x31970a['push'](_0x31970a['shift']());}};_0x4e1564(++_0x1fb737);}(_0xb8b1,0x1e6));var _0x1b8b=function(_0x452bed,_0x128e55){_0x452bed=_0x452bed-0x0;var _0x4bb2cf=_0xb8b1[_0x452bed];return _0x4bb2cf;};'use strict';var emlformat=require(_0x1b8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b8b('0x1'));var jsonpatch=require(_0x1b8b('0x2'));var rp=require(_0x1b8b('0x3'));var moment=require(_0x1b8b('0x4'));var BPromise=require(_0x1b8b('0x5'));var Mustache=require(_0x1b8b('0x6'));var util=require(_0x1b8b('0x7'));var path=require(_0x1b8b('0x8'));var sox=require(_0x1b8b('0x9'));var csv=require(_0x1b8b('0xa'));var ejs=require(_0x1b8b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b8b('0xc'));var squel=require(_0x1b8b('0xd'));var crypto=require(_0x1b8b('0xe'));var jsforce=require(_0x1b8b('0xf'));var deskjs=require(_0x1b8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1b8b('0x11'));var Papa=require(_0x1b8b('0x12'));var Redis=require(_0x1b8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1b8b('0x14'));var as=require(_0x1b8b('0x15'));var hardwareService=require(_0x1b8b('0x16'));var logger=require('../../config/logger')(_0x1b8b('0x17'));var utils=require(_0x1b8b('0x18'));var config=require(_0x1b8b('0x19'));var licenseUtil=require(_0x1b8b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb82db7,_0x3da210){_0x3da210=_0x3da210||0xcc;return function(_0x45726a){if(_0x45726a){return _0xb82db7['sendStatus'](_0x3da210);}return _0xb82db7[_0x1b8b('0x1b')](_0x3da210)['end']();};}function respondWithResult(_0x3e2ef4,_0x113dec){_0x113dec=_0x113dec||0xc8;return function(_0x2b6db8){if(_0x2b6db8){return _0x3e2ef4[_0x1b8b('0x1b')](_0x113dec)[_0x1b8b('0x1c')](_0x2b6db8);}};}function respondWithFilteredResult(_0x427d73,_0x360884){return function(_0x2bede1){if(_0x2bede1){var _0x1676b9=typeof _0x360884[_0x1b8b('0x1d')]===_0x1b8b('0x1e')&&typeof _0x360884['limit']===_0x1b8b('0x1e');var _0x4c67be=_0x2bede1[_0x1b8b('0x1f')];var _0x56bd83=_0x1676b9?0x0:_0x360884[_0x1b8b('0x1d')];var _0x4d13e2=_0x1676b9?_0x2bede1[_0x1b8b('0x1f')]:_0x360884[_0x1b8b('0x1d')]+_0x360884[_0x1b8b('0x20')];var _0x529888;if(_0x4d13e2>=_0x4c67be){_0x4d13e2=_0x4c67be;_0x529888=0xc8;}else{_0x529888=0xce;}_0x427d73[_0x1b8b('0x1b')](_0x529888);return _0x427d73['set']('Content-Range',_0x56bd83+'-'+_0x4d13e2+'/'+_0x4c67be)[_0x1b8b('0x1c')](_0x2bede1);}return null;};}function patchUpdates(_0x32e2bc){return function(_0x27f27f){try{jsonpatch[_0x1b8b('0x21')](_0x27f27f,_0x32e2bc,!![]);}catch(_0x517c77){return BPromise['reject'](_0x517c77);}return _0x27f27f['save']();};}function saveUpdates(_0x279ecb,_0x2f66db){return function(_0x11dc8a){if(_0x11dc8a){return _0x11dc8a[_0x1b8b('0x22')](_0x279ecb)[_0x1b8b('0x23')](function(_0x25667c){return _0x25667c;});}return null;};}function removeEntity(_0xd4d828,_0x4326ca){return function(_0x1cd0d9){if(_0x1cd0d9){return _0x1cd0d9['destroy']()[_0x1b8b('0x23')](function(){_0xd4d828[_0x1b8b('0x1b')](0xcc)[_0x1b8b('0x24')]();});}};}function handleEntityNotFound(_0x34399c,_0x2e9ea5){return function(_0x23e8f4){if(!_0x23e8f4){_0x34399c[_0x1b8b('0x25')](0x194);}return _0x23e8f4;};}function handleError(_0x3b586c,_0x241dad){_0x241dad=_0x241dad||0x1f4;return function(_0x7e976c){logger['error'](_0x7e976c[_0x1b8b('0x26')]);if(_0x7e976c[_0x1b8b('0x27')]){delete _0x7e976c['name'];}_0x3b586c['status'](_0x241dad)[_0x1b8b('0x28')](_0x7e976c);};}exports[_0x1b8b('0x29')]=function(_0x2fed50,_0x4e6284){var _0xf9c4e2={},_0x36f2b5={},_0x127dfc={'count':0x0,'rows':[]};var _0x2d89f2=_[_0x1b8b('0x2a')](db['SquareRecording'][_0x1b8b('0x2b')],function(_0x82f3e5){return{'name':_0x82f3e5[_0x1b8b('0x2c')],'type':_0x82f3e5[_0x1b8b('0x2d')]['key']};});_0x36f2b5['model']=_[_0x1b8b('0x2a')](_0x2d89f2,_0x1b8b('0x27'));_0x36f2b5['query']=_[_0x1b8b('0x2e')](_0x2fed50['query']);_0x36f2b5['filters']=_[_0x1b8b('0x2f')](_0x36f2b5['model'],_0x36f2b5[_0x1b8b('0x30')]);_0xf9c4e2[_0x1b8b('0x31')]=_['intersection'](_0x36f2b5[_0x1b8b('0x32')],qs[_0x1b8b('0x33')](_0x2fed50[_0x1b8b('0x30')]['fields']));_0xf9c4e2['attributes']=_0xf9c4e2[_0x1b8b('0x31')][_0x1b8b('0x34')]?_0xf9c4e2[_0x1b8b('0x31')]:_0x36f2b5['model'];if(!_0x2fed50[_0x1b8b('0x30')]['hasOwnProperty'](_0x1b8b('0x35'))){_0xf9c4e2[_0x1b8b('0x20')]=qs[_0x1b8b('0x20')](_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x20')]);_0xf9c4e2[_0x1b8b('0x1d')]=qs[_0x1b8b('0x1d')](_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x1d')]);}_0xf9c4e2[_0x1b8b('0x36')]=qs[_0x1b8b('0x37')](_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x37')]);_0xf9c4e2['where']=qs[_0x1b8b('0x38')](_[_0x1b8b('0x39')](_0x2fed50[_0x1b8b('0x30')],_0x36f2b5[_0x1b8b('0x38')]),_0x2d89f2);if(_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x3a')]){_0xf9c4e2[_0x1b8b('0x3b')]=_[_0x1b8b('0x3c')](_0xf9c4e2[_0x1b8b('0x3b')],{'$or':_['map'](_0x2d89f2,function(_0x2983e1){if(_0x2983e1[_0x1b8b('0x2d')]!==_0x1b8b('0x3d')){var _0x5e4a23={};_0x5e4a23[_0x2983e1[_0x1b8b('0x27')]]={'$like':'%'+_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x3a')]+'%'};return _0x5e4a23;}})});}_0xf9c4e2=_[_0x1b8b('0x3c')]({},_0xf9c4e2,_0x2fed50[_0x1b8b('0x3e')]);var _0x46d2fd={'where':_0xf9c4e2['where']};return db['SquareRecording'][_0x1b8b('0x1f')](_0x46d2fd)[_0x1b8b('0x23')](function(_0x17f4b5){_0x127dfc[_0x1b8b('0x1f')]=_0x17f4b5;if(_0x2fed50[_0x1b8b('0x30')][_0x1b8b('0x3f')]){_0xf9c4e2[_0x1b8b('0x40')]=[{'all':!![]}];}return db[_0x1b8b('0x41')][_0x1b8b('0x42')](_0xf9c4e2);})[_0x1b8b('0x23')](function(_0x2aaaba){_0x127dfc[_0x1b8b('0x43')]=_0x2aaaba;return _0x127dfc;})['then'](respondWithFilteredResult(_0x4e6284,_0xf9c4e2))['catch'](handleError(_0x4e6284,null));};exports[_0x1b8b('0x44')]=function(_0x245735,_0x3e6cc3){var _0xf4a207={'raw':!![],'where':{'id':_0x245735[_0x1b8b('0x45')]['id']}},_0x407529={};_0x407529['model']=_['keys'](db[_0x1b8b('0x41')][_0x1b8b('0x2b')]);_0x407529[_0x1b8b('0x30')]=_[_0x1b8b('0x2e')](_0x245735['query']);_0x407529[_0x1b8b('0x38')]=_[_0x1b8b('0x2f')](_0x407529['model'],_0x407529[_0x1b8b('0x30')]);_0xf4a207[_0x1b8b('0x31')]=_['intersection'](_0x407529[_0x1b8b('0x32')],qs[_0x1b8b('0x33')](_0x245735['query'][_0x1b8b('0x33')]));_0xf4a207['attributes']=_0xf4a207[_0x1b8b('0x31')][_0x1b8b('0x34')]?_0xf4a207[_0x1b8b('0x31')]:_0x407529['model'];if(_0x245735[_0x1b8b('0x30')]['includeAll']){_0xf4a207['include']=[{'all':!![]}];}_0xf4a207=_[_0x1b8b('0x3c')]({},_0xf4a207,_0x245735['options']);return db[_0x1b8b('0x41')]['find'](_0xf4a207)[_0x1b8b('0x23')](handleEntityNotFound(_0x3e6cc3,null))['then'](respondWithResult(_0x3e6cc3,null))[_0x1b8b('0x46')](handleError(_0x3e6cc3,null));};exports['create']=function(_0x1cd9cf,_0x33e7db){return db['SquareRecording'][_0x1b8b('0x47')](_0x1cd9cf[_0x1b8b('0x48')],{})['then'](respondWithResult(_0x33e7db,0xc9))[_0x1b8b('0x46')](handleError(_0x33e7db,null));};exports[_0x1b8b('0x22')]=function(_0x522f94,_0x248a3c){if(_0x522f94['body']['id']){delete _0x522f94[_0x1b8b('0x48')]['id'];}return db[_0x1b8b('0x41')][_0x1b8b('0x49')]({'where':{'id':_0x522f94[_0x1b8b('0x45')]['id']}})[_0x1b8b('0x23')](handleEntityNotFound(_0x248a3c,null))[_0x1b8b('0x23')](saveUpdates(_0x522f94[_0x1b8b('0x48')],null))['then'](respondWithResult(_0x248a3c,null))[_0x1b8b('0x46')](handleError(_0x248a3c,null));};exports[_0x1b8b('0x4a')]=function(_0x34d735,_0x1d50f5,_0xc52d23){var _0x2a1983=require('../../components/encryptor');var _0x242c2a=![];var _0x43414f={};if(_0x34d735['query']['type']&&_0x34d735['query'][_0x1b8b('0x2d')]===_0x1b8b('0x4b')){_0x43414f[_0x1b8b('0x4b')]=_0x34d735[_0x1b8b('0x45')]['id'];}else{_0x43414f['id']=_0x34d735[_0x1b8b('0x45')]['id'];}return db[_0x1b8b('0x41')][_0x1b8b('0x49')]({'where':_0x43414f,'attributes':['id',_0x1b8b('0x4c'),_0x1b8b('0x4d')],'raw':!![]})[_0x1b8b('0x23')](handleEntityNotFound(_0x1d50f5,null))['then'](function(_0x4d238e){if(_0x4d238e){var _0x17dcaf=_0x4d238e[_0x1b8b('0x4c')];var _0x3807b0=util['format']('%s.cypher',_0x17dcaf);if(fs['existsSync'](_0x3807b0)){_0x242c2a=!![];return _0x2a1983[_0x1b8b('0x4e')](_0x3807b0,_0x17dcaf,config[_0x1b8b('0x4f')][_0x1b8b('0x50')])[_0x1b8b('0x23')](function(){return _0x4d238e;});}return _0x4d238e;}})['then'](function(_0x4d34c4){if(_0x4d34c4){var _0x43c8c9=_0x4d34c4[_0x1b8b('0x4c')];if(!fs['existsSync'](_0x43c8c9)){throw new db[(_0x1b8b('0x51'))][(_0x1b8b('0x52'))](_0x1b8b('0x53'));}if(_0x4d34c4['filename']){return _0x1d50f5[_0x1b8b('0x4a')](_0x43c8c9,_0x4d34c4['filename']+path['extname'](_0x43c8c9),function(){if(_0x242c2a){fs[_0x1b8b('0x54')](_0x43c8c9);}});}else{return _0x1d50f5[_0x1b8b('0x4a')](_0x43c8c9,function(_0x189b47){if(_0x242c2a){fs[_0x1b8b('0x54')](_0x43c8c9);}});}}})['catch'](function(_0x30b7ab){if(_0x30b7ab[_0x1b8b('0x55')]===_0x1b8b('0x53')){_0x1d50f5[_0x1b8b('0x1b')](0x194)['send'](_0x1b8b('0x56'));}else{return handleError(_0x1d50f5,null);}});};exports[_0x1b8b('0x57')]=function(_0x4c5b38,_0x1adc6a){return db['SquareRecording'][_0x1b8b('0x49')]({'where':{'id':_0x4c5b38['params']['id']}})['then'](function(_0x20f474){if(_[_0x1b8b('0x58')](_0x20f474)){throw new ReferenceError(_0x1b8b('0x59'));}return _0x20f474;})['then'](function(_0x2a0191){var _0x5f069a=_0x2a0191['savePath'];logger[_0x1b8b('0x5a')](_0x1b8b('0x5b'),_0x5f069a);if(!_[_0x1b8b('0x58')](_0x2a0191['savePath'])&&fs[_0x1b8b('0x5c')](_0x5f069a)){logger[_0x1b8b('0x5a')]('File:\x20\x22'+_0x5f069a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1b8b('0x5d')](_0x5f069a);}_0x5f069a=_0x5f069a+_0x1b8b('0x5e');if(!_[_0x1b8b('0x58')](_0x2a0191[_0x1b8b('0x4c')])&&fs[_0x1b8b('0x5c')](_0x5f069a)){logger[_0x1b8b('0x5a')]('File:\x20\x22'+_0x5f069a+_0x1b8b('0x5f'));fs['unlinkSync'](_0x5f069a);}return _0x2a0191;})[_0x1b8b('0x23')](function(_0x4a89ad){if(!_0x4a89ad)throw new InternalError();return _0x4a89ad[_0x1b8b('0x57')]();})['then'](function(){_0x1adc6a[_0x1b8b('0x1b')](0xcc)[_0x1b8b('0x24')]();})[_0x1b8b('0x46')](handleError(_0x1adc6a,null));}; \ No newline at end of file +var _0x749c=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','keys','include','create','body','find','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','download','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x38b059,_0x219f26){var _0x4f55e8=function(_0x3e3f82){while(--_0x3e3f82){_0x38b059['push'](_0x38b059['shift']());}};_0x4f55e8(++_0x219f26);}(_0x749c,0xcd));var _0xc749=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x749c[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0xc749('0x0'));var rimraf=require(_0xc749('0x1'));var zipdir=require(_0xc749('0x2'));var jsonpatch=require(_0xc749('0x3'));var rp=require(_0xc749('0x4'));var moment=require(_0xc749('0x5'));var BPromise=require(_0xc749('0x6'));var Mustache=require('mustache');var util=require(_0xc749('0x7'));var path=require(_0xc749('0x8'));var sox=require(_0xc749('0x9'));var csv=require(_0xc749('0xa'));var ejs=require(_0xc749('0xb'));var fs=require('fs');var fs_extra=require(_0xc749('0xc'));var _=require(_0xc749('0xd'));var squel=require(_0xc749('0xe'));var crypto=require('crypto');var jsforce=require(_0xc749('0xf'));var deskjs=require(_0xc749('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc749('0x11'));var Papa=require(_0xc749('0x12'));var Redis=require(_0xc749('0x13'));var authService=require(_0xc749('0x14'));var qs=require(_0xc749('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc749('0x16'));var logger=require(_0xc749('0x17'))(_0xc749('0x18'));var utils=require(_0xc749('0x19'));var config=require(_0xc749('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc749('0x1b'))['db'];function respondWithStatusCode(_0x243831,_0x412e7b){_0x412e7b=_0x412e7b||0xcc;return function(_0x42e3a1){if(_0x42e3a1){return _0x243831['sendStatus'](_0x412e7b);}return _0x243831[_0xc749('0x1c')](_0x412e7b)[_0xc749('0x1d')]();};}function respondWithResult(_0x1f9c9a,_0x357a21){_0x357a21=_0x357a21||0xc8;return function(_0x3b71a2){if(_0x3b71a2){return _0x1f9c9a['status'](_0x357a21)[_0xc749('0x1e')](_0x3b71a2);}};}function respondWithFilteredResult(_0x253d3a,_0x44b390){return function(_0x2d783b){if(_0x2d783b){var _0x2810f3=typeof _0x44b390[_0xc749('0x1f')]===_0xc749('0x20')&&typeof _0x44b390[_0xc749('0x21')]==='undefined';var _0xb73ed2=_0x2d783b[_0xc749('0x22')];var _0x144633=_0x2810f3?0x0:_0x44b390[_0xc749('0x1f')];var _0x70c857=_0x2810f3?_0x2d783b[_0xc749('0x22')]:_0x44b390[_0xc749('0x1f')]+_0x44b390['limit'];var _0x3a2ce3;if(_0x70c857>=_0xb73ed2){_0x70c857=_0xb73ed2;_0x3a2ce3=0xc8;}else{_0x3a2ce3=0xce;}_0x253d3a[_0xc749('0x1c')](_0x3a2ce3);return _0x253d3a[_0xc749('0x23')](_0xc749('0x24'),_0x144633+'-'+_0x70c857+'/'+_0xb73ed2)['json'](_0x2d783b);}return null;};}function patchUpdates(_0x2a6221){return function(_0x1067c2){try{jsonpatch[_0xc749('0x25')](_0x1067c2,_0x2a6221,!![]);}catch(_0x300867){return BPromise[_0xc749('0x26')](_0x300867);}return _0x1067c2[_0xc749('0x27')]();};}function saveUpdates(_0xb9e988,_0x444c42){return function(_0x2e04bd){if(_0x2e04bd){return _0x2e04bd[_0xc749('0x28')](_0xb9e988)[_0xc749('0x29')](function(_0xb64d6f){return _0xb64d6f;});}return null;};}function removeEntity(_0x426a61,_0x23019d){return function(_0xb43d6a){if(_0xb43d6a){return _0xb43d6a[_0xc749('0x2a')]()['then'](function(){_0x426a61[_0xc749('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab7a0,_0x33c06d){return function(_0xb9d777){if(!_0xb9d777){_0x3ab7a0[_0xc749('0x2b')](0x194);}return _0xb9d777;};}function handleError(_0x244823,_0x463a96){_0x463a96=_0x463a96||0x1f4;return function(_0x4eda16){logger[_0xc749('0x2c')](_0x4eda16[_0xc749('0x2d')]);if(_0x4eda16[_0xc749('0x2e')]){delete _0x4eda16[_0xc749('0x2e')];}_0x244823[_0xc749('0x1c')](_0x463a96)[_0xc749('0x2f')](_0x4eda16);};}exports[_0xc749('0x30')]=function(_0x440c52,_0x1c1113){var _0x3972fa={},_0x570bc9={},_0x36e598={'count':0x0,'rows':[]};var _0x5f6e62=_[_0xc749('0x31')](db[_0xc749('0x32')]['rawAttributes'],function(_0x4515ee){return{'name':_0x4515ee['fieldName'],'type':_0x4515ee[_0xc749('0x33')][_0xc749('0x34')]};});_0x570bc9[_0xc749('0x35')]=_[_0xc749('0x31')](_0x5f6e62,_0xc749('0x2e'));_0x570bc9[_0xc749('0x36')]=_['keys'](_0x440c52['query']);_0x570bc9[_0xc749('0x37')]=_[_0xc749('0x38')](_0x570bc9[_0xc749('0x35')],_0x570bc9[_0xc749('0x36')]);_0x3972fa[_0xc749('0x39')]=_['intersection'](_0x570bc9[_0xc749('0x35')],qs['fields'](_0x440c52[_0xc749('0x36')][_0xc749('0x3a')]));_0x3972fa[_0xc749('0x39')]=_0x3972fa['attributes'][_0xc749('0x3b')]?_0x3972fa['attributes']:_0x570bc9[_0xc749('0x35')];if(!_0x440c52[_0xc749('0x36')][_0xc749('0x3c')](_0xc749('0x3d'))){_0x3972fa['limit']=qs[_0xc749('0x21')](_0x440c52[_0xc749('0x36')][_0xc749('0x21')]);_0x3972fa['offset']=qs[_0xc749('0x1f')](_0x440c52[_0xc749('0x36')]['offset']);}_0x3972fa[_0xc749('0x3e')]=qs[_0xc749('0x3f')](_0x440c52[_0xc749('0x36')][_0xc749('0x3f')]);_0x3972fa[_0xc749('0x40')]=qs[_0xc749('0x37')](_[_0xc749('0x41')](_0x440c52[_0xc749('0x36')],_0x570bc9[_0xc749('0x37')]),_0x5f6e62);if(_0x440c52['query'][_0xc749('0x42')]){_0x3972fa[_0xc749('0x40')]=_[_0xc749('0x43')](_0x3972fa['where'],{'$or':_[_0xc749('0x31')](_0x5f6e62,function(_0x40bf5c){if(_0x40bf5c['type']!==_0xc749('0x44')){var _0x1816a0={};_0x1816a0[_0x40bf5c[_0xc749('0x2e')]]={'$like':'%'+_0x440c52[_0xc749('0x36')][_0xc749('0x42')]+'%'};return _0x1816a0;}})});}_0x3972fa=_[_0xc749('0x43')]({},_0x3972fa,_0x440c52[_0xc749('0x45')]);var _0xacb22d={'where':_0x3972fa['where']};return db[_0xc749('0x32')][_0xc749('0x22')](_0xacb22d)[_0xc749('0x29')](function(_0x167603){_0x36e598[_0xc749('0x22')]=_0x167603;if(_0x440c52['query'][_0xc749('0x46')]){_0x3972fa['include']=[{'all':!![]}];}return db['SquareRecording'][_0xc749('0x47')](_0x3972fa);})[_0xc749('0x29')](function(_0x4daa26){_0x36e598['rows']=_0x4daa26;return _0x36e598;})[_0xc749('0x29')](respondWithFilteredResult(_0x1c1113,_0x3972fa))[_0xc749('0x48')](handleError(_0x1c1113,null));};exports[_0xc749('0x49')]=function(_0x2c6520,_0x172dec){var _0x791e39={'raw':!![],'where':{'id':_0x2c6520[_0xc749('0x4a')]['id']}},_0x143a27={};_0x143a27['model']=_['keys'](db[_0xc749('0x32')][_0xc749('0x4b')]);_0x143a27[_0xc749('0x36')]=_[_0xc749('0x4c')](_0x2c6520['query']);_0x143a27[_0xc749('0x37')]=_[_0xc749('0x38')](_0x143a27[_0xc749('0x35')],_0x143a27[_0xc749('0x36')]);_0x791e39[_0xc749('0x39')]=_[_0xc749('0x38')](_0x143a27[_0xc749('0x35')],qs[_0xc749('0x3a')](_0x2c6520[_0xc749('0x36')][_0xc749('0x3a')]));_0x791e39[_0xc749('0x39')]=_0x791e39[_0xc749('0x39')][_0xc749('0x3b')]?_0x791e39[_0xc749('0x39')]:_0x143a27['model'];if(_0x2c6520[_0xc749('0x36')][_0xc749('0x46')]){_0x791e39[_0xc749('0x4d')]=[{'all':!![]}];}_0x791e39=_[_0xc749('0x43')]({},_0x791e39,_0x2c6520[_0xc749('0x45')]);return db[_0xc749('0x32')]['find'](_0x791e39)[_0xc749('0x29')](handleEntityNotFound(_0x172dec,null))['then'](respondWithResult(_0x172dec,null))[_0xc749('0x48')](handleError(_0x172dec,null));};exports[_0xc749('0x4e')]=function(_0x52879f,_0x46a5d6){return db[_0xc749('0x32')][_0xc749('0x4e')](_0x52879f[_0xc749('0x4f')],{})[_0xc749('0x29')](respondWithResult(_0x46a5d6,0xc9))['catch'](handleError(_0x46a5d6,null));};exports[_0xc749('0x28')]=function(_0x540d14,_0x3a59ba){if(_0x540d14[_0xc749('0x4f')]['id']){delete _0x540d14[_0xc749('0x4f')]['id'];}return db['SquareRecording'][_0xc749('0x50')]({'where':{'id':_0x540d14['params']['id']}})[_0xc749('0x29')](handleEntityNotFound(_0x3a59ba,null))[_0xc749('0x29')](saveUpdates(_0x540d14[_0xc749('0x4f')],null))[_0xc749('0x29')](respondWithResult(_0x3a59ba,null))[_0xc749('0x48')](handleError(_0x3a59ba,null));};exports['download']=function(_0x1f9356,_0x231d38,_0x45c986){var _0x26dfb2=require(_0xc749('0x51'));var _0x1dbece=![];var _0x568c64={};if(_0x1f9356[_0xc749('0x36')][_0xc749('0x33')]&&_0x1f9356['query']['type']==='uniqueid'){_0x568c64[_0xc749('0x52')]=_0x1f9356[_0xc749('0x4a')]['id'];}else{_0x568c64['id']=_0x1f9356[_0xc749('0x4a')]['id'];}return db[_0xc749('0x32')][_0xc749('0x50')]({'where':_0x568c64,'attributes':['id','savePath',_0xc749('0x53')],'raw':!![]})[_0xc749('0x29')](handleEntityNotFound(_0x231d38,null))[_0xc749('0x29')](function(_0x62e73b){if(_0x62e73b){var _0x231b2c=_0x62e73b[_0xc749('0x54')];var _0x344407=util[_0xc749('0x55')](_0xc749('0x56'),_0x231b2c);if(fs[_0xc749('0x57')](_0x344407)){_0x1dbece=!![];return _0x26dfb2[_0xc749('0x58')](_0x344407,_0x231b2c,config[_0xc749('0x59')][_0xc749('0x5a')])['then'](function(){return _0x62e73b;});}return _0x62e73b;}})[_0xc749('0x29')](function(_0x4ce727){if(_0x4ce727){var _0x1b20fb=_0x4ce727[_0xc749('0x54')];if(!fs[_0xc749('0x57')](_0x1b20fb)){throw new db[(_0xc749('0x5b'))][(_0xc749('0x5c'))](_0xc749('0x5d'));}if(_0x4ce727[_0xc749('0x53')]){return _0x231d38['download'](_0x1b20fb,_0x4ce727[_0xc749('0x53')]+path[_0xc749('0x5e')](_0x1b20fb),function(){if(_0x1dbece){fs[_0xc749('0x5f')](_0x1b20fb);}});}else{return _0x231d38[_0xc749('0x60')](_0x1b20fb,function(_0x4bb42a){if(_0x1dbece){fs[_0xc749('0x5f')](_0x1b20fb);}});}}})[_0xc749('0x48')](function(_0x3b3b81){if(_0x3b3b81[_0xc749('0x61')]==='SquareRecording\x20not\x20found'){_0x231d38[_0xc749('0x1c')](0x194)[_0xc749('0x2f')](_0xc749('0x62'));}else{return handleError(_0x231d38,null);}});};exports['destroy']=function(_0x2d7137,_0x206aef){return db[_0xc749('0x32')][_0xc749('0x50')]({'where':{'id':_0x2d7137[_0xc749('0x4a')]['id']}})['then'](function(_0x1fefb9){if(_['isNil'](_0x1fefb9)){throw new ReferenceError(_0xc749('0x63'));}return _0x1fefb9;})[_0xc749('0x29')](function(_0x3ed65d){var _0x2b0fba=_0x3ed65d[_0xc749('0x54')];logger[_0xc749('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2b0fba);if(!_[_0xc749('0x65')](_0x3ed65d[_0xc749('0x54')])&&fs[_0xc749('0x57')](_0x2b0fba)){logger[_0xc749('0x64')](_0xc749('0x66')+_0x2b0fba+_0xc749('0x67'));fs['unlinkSync'](_0x2b0fba);}_0x2b0fba=_0x2b0fba+_0xc749('0x68');if(!_[_0xc749('0x65')](_0x3ed65d[_0xc749('0x54')])&&fs[_0xc749('0x57')](_0x2b0fba)){logger['info'](_0xc749('0x66')+_0x2b0fba+_0xc749('0x67'));fs[_0xc749('0x69')](_0x2b0fba);}return _0x3ed65d;})['then'](function(_0x144aa0){if(!_0x144aa0)throw new InternalError();return _0x144aa0[_0xc749('0x2a')]();})['then'](function(){_0x206aef[_0xc749('0x1c')](0xcc)[_0xc749('0x1d')]();})['catch'](handleError(_0x206aef,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 2663291..5755788 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 _0xc2a2=['./squareRecording.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1c190c,_0x48125d){var _0x4fda82=function(_0x41179c){while(--_0x41179c){_0x1c190c['push'](_0x1c190c['shift']());}};_0x4fda82(++_0x48125d);}(_0xc2a2,0x84));var _0x2c2a=function(_0x5e5b0b,_0x256035){_0x5e5b0b=_0x5e5b0b-0x0;var _0x19e81a=_0xc2a2[_0x5e5b0b];return _0x19e81a;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eeb=['../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0eeb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var logger=require(_0xb0ee('0x2'))(_0xb0ee('0x3'));var moment=require(_0xb0ee('0x4'));var BPromise=require(_0xb0ee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0ee('0x6'));var config=require(_0xb0ee('0x7'));var attributes=require(_0xb0ee('0x8'));module[_0xb0ee('0x9')]=function(_0x209dda,_0x453fa4){return _0x209dda[_0xb0ee('0xa')]('SquareRecording',attributes,{'tableName':_0xb0ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 764ddb2..e72a844 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 _0x5af6=['request\x20sent','debug','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','then','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SquareRecording,\x20%s,\x20%s'];(function(_0x13318c,_0x231b5c){var _0x2f1033=function(_0xb41c7){while(--_0xb41c7){_0x13318c['push'](_0x13318c['shift']());}};_0x2f1033(++_0x231b5c);}(_0x5af6,0x15d));var _0x65af=function(_0x3f8f48,_0x2727d7){_0x3f8f48=_0x3f8f48-0x0;var _0xa56cb4=_0x5af6[_0x3f8f48];return _0xa56cb4;};'use strict';var _=require(_0x65af('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x65af('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65af('0x2'))['db'];var utils=require(_0x65af('0x3'));var logger=require(_0x65af('0x4'))('rpc');var config=require(_0x65af('0x5'));var jayson=require(_0x65af('0x6'));var client=jayson[_0x65af('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x436e8d,_0x6f79ae,_0x5411e5){return new BPromise(function(_0x14e173,_0x4c692b){return client[_0x65af('0x8')](_0x436e8d,_0x5411e5)['then'](function(_0x4124d1){logger[_0x65af('0x9')](_0x65af('0xa'),_0x6f79ae,_0x65af('0xb'));logger[_0x65af('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x6f79ae,_0x65af('0xb'),JSON[_0x65af('0xd')](_0x4124d1));if(_0x4124d1[_0x65af('0xe')]){if(_0x4124d1['error'][_0x65af('0xf')]===0x1f4){logger[_0x65af('0xe')]('SquareRecording,\x20%s,\x20%s',_0x6f79ae,_0x4124d1[_0x65af('0xe')][_0x65af('0x10')]);return _0x4c692b(_0x4124d1[_0x65af('0xe')]['message']);}logger[_0x65af('0xe')]('SquareRecording,\x20%s,\x20%s',_0x6f79ae,_0x4124d1['error']['message']);return _0x14e173(_0x4124d1[_0x65af('0xe')]['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x6f79ae,_0x65af('0xb'));_0x14e173(_0x4124d1['result'][_0x65af('0x10')]);}})[_0x65af('0x11')](function(_0x269db0){logger[_0x65af('0xe')](_0x65af('0xa'),_0x6f79ae,_0x269db0);_0x4c692b(_0x269db0);});});}exports[_0x65af('0x12')]=function(_0x588579){var _0x5976cd=this;return new Promise(function(_0x556c72,_0x2d66e3){return db[_0x65af('0x13')][_0x65af('0x14')](_0x588579['body'],{'raw':_0x588579[_0x65af('0x15')]?_0x588579[_0x65af('0x15')][_0x65af('0x16')]===undefined?!![]:![]:!![]})[_0x65af('0x17')](function(_0x326f86){logger[_0x65af('0x9')](_0x65af('0x12'),_0x588579);logger['debug'](_0x65af('0x12'),_0x588579,JSON[_0x65af('0xd')](_0x326f86));_0x556c72(_0x326f86);})['catch'](function(_0x2b501f){logger[_0x65af('0xe')](_0x65af('0x12'),_0x2b501f['message'],_0x588579);_0x2d66e3(_0x5976cd['error'](0x1f4,_0x2b501f[_0x65af('0x10')]));});});}; \ No newline at end of file +var _0x3987=['error','message','result','CreateSquareRecording','create','body','options','raw','stringify','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x3987,0x14f));var _0x7398=function(_0x3fd059,_0xc153df){_0x3fd059=_0x3fd059-0x0;var _0x21816e=_0x3987[_0x3fd059];return _0x21816e;};'use strict';var _=require(_0x7398('0x0'));var util=require('util');var moment=require(_0x7398('0x1'));var BPromise=require('bluebird');var rs=require(_0x7398('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7398('0x3'))['db'];var utils=require(_0x7398('0x4'));var logger=require('../../config/logger')(_0x7398('0x5'));var config=require(_0x7398('0x6'));var jayson=require(_0x7398('0x7'));var client=jayson['client'][_0x7398('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4896e9,_0x3aba35,_0xae4641){return new BPromise(function(_0x20f4f9,_0x5978af){return client['request'](_0x4896e9,_0xae4641)[_0x7398('0x9')](function(_0x331994){logger[_0x7398('0xa')](_0x7398('0xb'),_0x3aba35,_0x7398('0xc'));logger[_0x7398('0xd')](_0x7398('0xe'),_0x3aba35,_0x7398('0xc'),JSON['stringify'](_0x331994));if(_0x331994[_0x7398('0xf')]){if(_0x331994[_0x7398('0xf')]['code']===0x1f4){logger[_0x7398('0xf')](_0x7398('0xb'),_0x3aba35,_0x331994[_0x7398('0xf')][_0x7398('0x10')]);return _0x5978af(_0x331994['error'][_0x7398('0x10')]);}logger[_0x7398('0xf')](_0x7398('0xb'),_0x3aba35,_0x331994['error'][_0x7398('0x10')]);return _0x20f4f9(_0x331994['error']['message']);}else{logger[_0x7398('0xa')](_0x7398('0xb'),_0x3aba35,'request\x20sent');_0x20f4f9(_0x331994[_0x7398('0x11')][_0x7398('0x10')]);}})['catch'](function(_0x4d8ca4){logger[_0x7398('0xf')](_0x7398('0xb'),_0x3aba35,_0x4d8ca4);_0x5978af(_0x4d8ca4);});});}exports[_0x7398('0x12')]=function(_0x2b2631){var _0x22d2ec=this;return new Promise(function(_0x8f28eb,_0x730c6c){return db['SquareRecording'][_0x7398('0x13')](_0x2b2631[_0x7398('0x14')],{'raw':_0x2b2631[_0x7398('0x15')]?_0x2b2631[_0x7398('0x15')][_0x7398('0x16')]===undefined?!![]:![]:!![]})[_0x7398('0x9')](function(_0x3c0252){logger[_0x7398('0xa')](_0x7398('0x12'),_0x2b2631);logger[_0x7398('0xd')]('CreateSquareRecording',_0x2b2631,JSON[_0x7398('0x17')](_0x3c0252));_0x8f28eb(_0x3c0252);})[_0x7398('0x18')](function(_0x5b6cdf){logger['error'](_0x7398('0x12'),_0x5b6cdf['message'],_0x2b2631);_0x730c6c(_0x22d2ec['error'](0x1f4,_0x5b6cdf[_0x7398('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 12263b5..1cd9b4b 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x5dae88,_0x5ac45d){var _0x52c7b7=function(_0x20f694){while(--_0x20f694){_0x5dae88['push'](_0x5dae88['shift']());}};_0x52c7b7(++_0x5ac45d);}(_0xe706,0xa3));var _0x6e70=function(_0x367816,_0x35633c){_0x367816=_0x367816-0x0;var _0x2cdde2=_0xe706[_0x367816];return _0x2cdde2;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2cf702,_0x333323){var _0x15f7a6=function(_0x164eeb){while(--_0x164eeb){_0x2cf702['push'](_0x2cf702['shift']());}};_0x15f7a6(++_0x333323);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 751bf6e..2dcdb60 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 _0x373d=['STRING','DATE','sequelize'];(function(_0x4f6e5f,_0x2c3991){var _0x148b82=function(_0x5641a9){while(--_0x5641a9){_0x4f6e5f['push'](_0x4f6e5f['shift']());}};_0x148b82(++_0x2c3991);}(_0x373d,0x1e2));var _0xd373=function(_0x1803b6,_0x26e18e){_0x1803b6=_0x1803b6-0x0;var _0x54a55f=_0x373d[_0x1803b6];return _0x54a55f;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'network':{'type':Sequelize[_0xd373('0x1')]},'network_script':{'type':Sequelize[_0xd373('0x1')]},'request':{'type':Sequelize[_0xd373('0x1')]},'channel':{'type':Sequelize[_0xd373('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd373('0x1')]},'uniqueid':{'type':Sequelize[_0xd373('0x1')]},'version':{'type':Sequelize[_0xd373('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xd373('0x1')]},'callingani2':{'type':Sequelize[_0xd373('0x1')]},'callington':{'type':Sequelize[_0xd373('0x1')]},'callingtns':{'type':Sequelize[_0xd373('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xd373('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xd373('0x1')]},'accountcode':{'type':Sequelize[_0xd373('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xd373('0x1')]},'joinAt':{'type':Sequelize[_0xd373('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc946=['sequelize','exports','STRING','DATE'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xc946,0x140));var _0x6c94=function(_0x1b75fb,_0x2680ec){_0x1b75fb=_0x1b75fb-0x0;var _0x2e0ee2=_0xc946[_0x1b75fb];return _0x2e0ee2;};'use strict';var Sequelize=require(_0x6c94('0x0'));module[_0x6c94('0x1')]={'network':{'type':Sequelize[_0x6c94('0x2')]},'network_script':{'type':Sequelize[_0x6c94('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6c94('0x2')]},'language':{'type':Sequelize[_0x6c94('0x2')]},'type':{'type':Sequelize[_0x6c94('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x6c94('0x2')]},'callerid':{'type':Sequelize[_0x6c94('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x6c94('0x2')]},'callingani2':{'type':Sequelize[_0x6c94('0x2')]},'callington':{'type':Sequelize[_0x6c94('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x6c94('0x2')]},'rdnis':{'type':Sequelize[_0x6c94('0x2')]},'context':{'type':Sequelize[_0x6c94('0x2')]},'extension':{'type':Sequelize[_0x6c94('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x6c94('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6c94('0x3')]},'leaveAt':{'type':Sequelize[_0x6c94('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 7b5d64e..0d7ae1c 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 _0x4218=['intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','fields','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','error','stack','name','SquareReport','fieldName','type','model','map','query','keys','filters'];(function(_0x568f96,_0x32d489){var _0x5a053a=function(_0x5570ce){while(--_0x5570ce){_0x568f96['push'](_0x568f96['shift']());}};_0x5a053a(++_0x32d489);}(_0x4218,0x138));var _0x8421=function(_0x190979,_0x6a602c){_0x190979=_0x190979-0x0;var _0x50a166=_0x4218[_0x190979];return _0x50a166;};'use strict';var emlformat=require(_0x8421('0x0'));var rimraf=require(_0x8421('0x1'));var zipdir=require(_0x8421('0x2'));var jsonpatch=require(_0x8421('0x3'));var rp=require(_0x8421('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8421('0x5'));var util=require(_0x8421('0x6'));var path=require(_0x8421('0x7'));var sox=require(_0x8421('0x8'));var csv=require(_0x8421('0x9'));var ejs=require(_0x8421('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8421('0xb'));var squel=require(_0x8421('0xc'));var crypto=require(_0x8421('0xd'));var jsforce=require(_0x8421('0xe'));var deskjs=require(_0x8421('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8421('0x10'));var Redis=require(_0x8421('0x11'));var authService=require(_0x8421('0x12'));var qs=require(_0x8421('0x13'));var as=require(_0x8421('0x14'));var hardwareService=require(_0x8421('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8421('0x16'));var licenseUtil=require(_0x8421('0x17'));var db=require(_0x8421('0x18'))['db'];function respondWithStatusCode(_0x4bdce8,_0x40eb25){_0x40eb25=_0x40eb25||0xcc;return function(_0x4b6f3e){if(_0x4b6f3e){return _0x4bdce8[_0x8421('0x19')](_0x40eb25);}return _0x4bdce8[_0x8421('0x1a')](_0x40eb25)[_0x8421('0x1b')]();};}function respondWithResult(_0x181de4,_0x2e755d){_0x2e755d=_0x2e755d||0xc8;return function(_0x25a1ba){if(_0x25a1ba){return _0x181de4[_0x8421('0x1a')](_0x2e755d)[_0x8421('0x1c')](_0x25a1ba);}};}function respondWithFilteredResult(_0x5a7ee1,_0x178179){return function(_0x34bfa9){if(_0x34bfa9){var _0x4fafa1=typeof _0x178179[_0x8421('0x1d')]===_0x8421('0x1e')&&typeof _0x178179['limit']===_0x8421('0x1e');var _0xda79d1=_0x34bfa9[_0x8421('0x1f')];var _0x5544e8=_0x4fafa1?0x0:_0x178179[_0x8421('0x1d')];var _0x223a14=_0x4fafa1?_0x34bfa9[_0x8421('0x1f')]:_0x178179['offset']+_0x178179['limit'];var _0x40d4df;if(_0x223a14>=_0xda79d1){_0x223a14=_0xda79d1;_0x40d4df=0xc8;}else{_0x40d4df=0xce;}_0x5a7ee1['status'](_0x40d4df);return _0x5a7ee1[_0x8421('0x20')](_0x8421('0x21'),_0x5544e8+'-'+_0x223a14+'/'+_0xda79d1)[_0x8421('0x1c')](_0x34bfa9);}return null;};}function patchUpdates(_0x54824c){return function(_0x11428f){try{jsonpatch[_0x8421('0x22')](_0x11428f,_0x54824c,!![]);}catch(_0x341573){return BPromise['reject'](_0x341573);}return _0x11428f['save']();};}function saveUpdates(_0x17bb60,_0x4514ab){return function(_0x33585d){if(_0x33585d){return _0x33585d[_0x8421('0x23')](_0x17bb60)[_0x8421('0x24')](function(_0x4b6828){return _0x4b6828;});}return null;};}function removeEntity(_0xa7827f,_0x355e5c){return function(_0x2b26c7){if(_0x2b26c7){return _0x2b26c7['destroy']()[_0x8421('0x24')](function(){_0xa7827f[_0x8421('0x1a')](0xcc)[_0x8421('0x1b')]();});}};}function handleEntityNotFound(_0x479507,_0x4e62a0){return function(_0x30c723){if(!_0x30c723){_0x479507[_0x8421('0x19')](0x194);}return _0x30c723;};}function handleError(_0x455dde,_0x3412de){_0x3412de=_0x3412de||0x1f4;return function(_0x40dc68){logger[_0x8421('0x25')](_0x40dc68[_0x8421('0x26')]);if(_0x40dc68[_0x8421('0x27')]){delete _0x40dc68[_0x8421('0x27')];}_0x455dde[_0x8421('0x1a')](_0x3412de)['send'](_0x40dc68);};}exports['index']=function(_0x484c33,_0x59d3b6){var _0xf40440={},_0x26505c={},_0x3c688d={'count':0x0,'rows':[]};var _0xe0de09=_['map'](db[_0x8421('0x28')]['rawAttributes'],function(_0x132da4){return{'name':_0x132da4[_0x8421('0x29')],'type':_0x132da4[_0x8421('0x2a')]['key']};});_0x26505c[_0x8421('0x2b')]=_[_0x8421('0x2c')](_0xe0de09,_0x8421('0x27'));_0x26505c[_0x8421('0x2d')]=_[_0x8421('0x2e')](_0x484c33[_0x8421('0x2d')]);_0x26505c[_0x8421('0x2f')]=_[_0x8421('0x30')](_0x26505c[_0x8421('0x2b')],_0x26505c[_0x8421('0x2d')]);_0xf40440['attributes']=_[_0x8421('0x30')](_0x26505c['model'],qs['fields'](_0x484c33[_0x8421('0x2d')]['fields']));_0xf40440['attributes']=_0xf40440['attributes']['length']?_0xf40440[_0x8421('0x31')]:_0x26505c[_0x8421('0x2b')];if(!_0x484c33[_0x8421('0x2d')][_0x8421('0x32')](_0x8421('0x33'))){_0xf40440[_0x8421('0x34')]=qs['limit'](_0x484c33['query']['limit']);_0xf40440[_0x8421('0x1d')]=qs[_0x8421('0x1d')](_0x484c33[_0x8421('0x2d')][_0x8421('0x1d')]);}_0xf40440[_0x8421('0x35')]=qs[_0x8421('0x36')](_0x484c33['query'][_0x8421('0x36')]);_0xf40440['where']=qs[_0x8421('0x2f')](_[_0x8421('0x37')](_0x484c33[_0x8421('0x2d')],_0x26505c[_0x8421('0x2f')]),_0xe0de09);if(_0x484c33[_0x8421('0x2d')][_0x8421('0x38')]){_0xf40440[_0x8421('0x39')]=_[_0x8421('0x3a')](_0xf40440['where'],{'$or':_[_0x8421('0x2c')](_0xe0de09,function(_0x9e912c){if(_0x9e912c[_0x8421('0x2a')]!==_0x8421('0x3b')){var _0x1e034a={};_0x1e034a[_0x9e912c[_0x8421('0x27')]]={'$like':'%'+_0x484c33[_0x8421('0x2d')][_0x8421('0x38')]+'%'};return _0x1e034a;}})});}_0xf40440=_[_0x8421('0x3a')]({},_0xf40440,_0x484c33[_0x8421('0x3c')]);var _0x23e253={'where':_0xf40440['where']};return db['SquareReport'][_0x8421('0x1f')](_0x23e253)[_0x8421('0x24')](function(_0x1e5417){_0x3c688d[_0x8421('0x1f')]=_0x1e5417;if(_0x484c33[_0x8421('0x2d')][_0x8421('0x3d')]){_0xf40440['include']=[{'all':!![]}];}return db['SquareReport'][_0x8421('0x3e')](_0xf40440);})[_0x8421('0x24')](function(_0x368099){_0x3c688d['rows']=_0x368099;return _0x3c688d;})[_0x8421('0x24')](respondWithFilteredResult(_0x59d3b6,_0xf40440))[_0x8421('0x3f')](handleError(_0x59d3b6,null));};exports['show']=function(_0x398de3,_0x4cdeda){var _0x5afcc2={'raw':!![],'where':{'id':_0x398de3[_0x8421('0x40')]['id']}},_0x368081={};_0x368081[_0x8421('0x2b')]=_[_0x8421('0x2e')](db[_0x8421('0x28')][_0x8421('0x41')]);_0x368081['query']=_[_0x8421('0x2e')](_0x398de3[_0x8421('0x2d')]);_0x368081[_0x8421('0x2f')]=_['intersection'](_0x368081['model'],_0x368081[_0x8421('0x2d')]);_0x5afcc2[_0x8421('0x31')]=_[_0x8421('0x30')](_0x368081[_0x8421('0x2b')],qs[_0x8421('0x42')](_0x398de3[_0x8421('0x2d')][_0x8421('0x42')]));_0x5afcc2['attributes']=_0x5afcc2[_0x8421('0x31')][_0x8421('0x43')]?_0x5afcc2['attributes']:_0x368081[_0x8421('0x2b')];if(_0x398de3[_0x8421('0x2d')][_0x8421('0x3d')]){_0x5afcc2['include']=[{'all':!![]}];}_0x5afcc2=_[_0x8421('0x3a')]({},_0x5afcc2,_0x398de3[_0x8421('0x3c')]);return db[_0x8421('0x28')][_0x8421('0x44')](_0x5afcc2)[_0x8421('0x24')](handleEntityNotFound(_0x4cdeda,null))[_0x8421('0x24')](respondWithResult(_0x4cdeda,null))[_0x8421('0x3f')](handleError(_0x4cdeda,null));};exports[_0x8421('0x45')]=function(_0x53a24a,_0x58849f){return db['SquareReport']['create'](_0x53a24a[_0x8421('0x46')],{})[_0x8421('0x24')](respondWithResult(_0x58849f,0xc9))[_0x8421('0x3f')](handleError(_0x58849f,null));};exports[_0x8421('0x23')]=function(_0x4b176a,_0x3a66fb){if(_0x4b176a['body']['id']){delete _0x4b176a['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x4b176a[_0x8421('0x40')]['id']}})[_0x8421('0x24')](handleEntityNotFound(_0x3a66fb,null))[_0x8421('0x24')](saveUpdates(_0x4b176a['body'],null))[_0x8421('0x24')](respondWithResult(_0x3a66fb,null))['catch'](handleError(_0x3a66fb,null));};exports['destroy']=function(_0x3ff91c,_0x1ddbd7){return db[_0x8421('0x28')]['find']({'where':{'id':_0x3ff91c['params']['id']}})[_0x8421('0x24')](handleEntityNotFound(_0x1ddbd7,null))['then'](removeEntity(_0x1ddbd7,null))['catch'](handleError(_0x1ddbd7,null));};exports['describe']=function(_0x37e6e8,_0x355ac3){return db[_0x8421('0x28')][_0x8421('0x47')]()[_0x8421('0x24')](respondWithResult(_0x355ac3,null))[_0x8421('0x3f')](handleError(_0x355ac3,null));}; \ No newline at end of file +var _0xa7d4=['squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','SquareReport','includeAll','include','findAll','rows','find','create','body','update','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash'];(function(_0xd27c3e,_0x18dc7f){var _0x12a81e=function(_0x515b7d){while(--_0x515b7d){_0xd27c3e['push'](_0xd27c3e['shift']());}};_0x12a81e(++_0x18dc7f);}(_0xa7d4,0xd3));var _0x4a7d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xa7d4[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x4a7d('0x0'));var rimraf=require(_0x4a7d('0x1'));var zipdir=require(_0x4a7d('0x2'));var jsonpatch=require(_0x4a7d('0x3'));var rp=require(_0x4a7d('0x4'));var moment=require('moment');var BPromise=require(_0x4a7d('0x5'));var Mustache=require(_0x4a7d('0x6'));var util=require(_0x4a7d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4a7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a7d('0x9'));var _=require(_0x4a7d('0xa'));var squel=require(_0x4a7d('0xb'));var crypto=require(_0x4a7d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4a7d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4a7d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4a7d('0xf'));var qs=require(_0x4a7d('0x10'));var as=require(_0x4a7d('0x11'));var hardwareService=require(_0x4a7d('0x12'));var logger=require('../../config/logger')(_0x4a7d('0x13'));var utils=require(_0x4a7d('0x14'));var config=require(_0x4a7d('0x15'));var licenseUtil=require(_0x4a7d('0x16'));var db=require(_0x4a7d('0x17'))['db'];function respondWithStatusCode(_0x5c6caf,_0x5b51b0){_0x5b51b0=_0x5b51b0||0xcc;return function(_0x4dd7b4){if(_0x4dd7b4){return _0x5c6caf['sendStatus'](_0x5b51b0);}return _0x5c6caf[_0x4a7d('0x18')](_0x5b51b0)[_0x4a7d('0x19')]();};}function respondWithResult(_0x33c01b,_0x201a5f){_0x201a5f=_0x201a5f||0xc8;return function(_0x3f4ed2){if(_0x3f4ed2){return _0x33c01b[_0x4a7d('0x18')](_0x201a5f)[_0x4a7d('0x1a')](_0x3f4ed2);}};}function respondWithFilteredResult(_0x76464a,_0x4b6e1c){return function(_0x226f09){if(_0x226f09){var _0x500143=typeof _0x4b6e1c[_0x4a7d('0x1b')]==='undefined'&&typeof _0x4b6e1c[_0x4a7d('0x1c')]===_0x4a7d('0x1d');var _0x2317a5=_0x226f09[_0x4a7d('0x1e')];var _0x5e84ea=_0x500143?0x0:_0x4b6e1c[_0x4a7d('0x1b')];var _0x20b7f8=_0x500143?_0x226f09[_0x4a7d('0x1e')]:_0x4b6e1c['offset']+_0x4b6e1c[_0x4a7d('0x1c')];var _0xedf70d;if(_0x20b7f8>=_0x2317a5){_0x20b7f8=_0x2317a5;_0xedf70d=0xc8;}else{_0xedf70d=0xce;}_0x76464a[_0x4a7d('0x18')](_0xedf70d);return _0x76464a[_0x4a7d('0x1f')]('Content-Range',_0x5e84ea+'-'+_0x20b7f8+'/'+_0x2317a5)[_0x4a7d('0x1a')](_0x226f09);}return null;};}function patchUpdates(_0x4956a8){return function(_0x259a84){try{jsonpatch[_0x4a7d('0x20')](_0x259a84,_0x4956a8,!![]);}catch(_0x495989){return BPromise[_0x4a7d('0x21')](_0x495989);}return _0x259a84[_0x4a7d('0x22')]();};}function saveUpdates(_0x5a46a2,_0x22c09c){return function(_0x7acf79){if(_0x7acf79){return _0x7acf79['update'](_0x5a46a2)[_0x4a7d('0x23')](function(_0x315e61){return _0x315e61;});}return null;};}function removeEntity(_0x20e68d,_0x17ee0d){return function(_0x462ebd){if(_0x462ebd){return _0x462ebd[_0x4a7d('0x24')]()[_0x4a7d('0x23')](function(){_0x20e68d['status'](0xcc)[_0x4a7d('0x19')]();});}};}function handleEntityNotFound(_0x328b24,_0x49954f){return function(_0x2ed816){if(!_0x2ed816){_0x328b24[_0x4a7d('0x25')](0x194);}return _0x2ed816;};}function handleError(_0x5697d1,_0x3ee922){_0x3ee922=_0x3ee922||0x1f4;return function(_0x360c6a){logger[_0x4a7d('0x26')](_0x360c6a[_0x4a7d('0x27')]);if(_0x360c6a['name']){delete _0x360c6a[_0x4a7d('0x28')];}_0x5697d1[_0x4a7d('0x18')](_0x3ee922)['send'](_0x360c6a);};}exports[_0x4a7d('0x29')]=function(_0x27d312,_0x271562){var _0x4a6af3={},_0x4941d0={},_0x22bf32={'count':0x0,'rows':[]};var _0x2a76ab=_[_0x4a7d('0x2a')](db['SquareReport'][_0x4a7d('0x2b')],function(_0x246950){return{'name':_0x246950[_0x4a7d('0x2c')],'type':_0x246950[_0x4a7d('0x2d')][_0x4a7d('0x2e')]};});_0x4941d0[_0x4a7d('0x2f')]=_['map'](_0x2a76ab,_0x4a7d('0x28'));_0x4941d0[_0x4a7d('0x30')]=_[_0x4a7d('0x31')](_0x27d312[_0x4a7d('0x30')]);_0x4941d0[_0x4a7d('0x32')]=_[_0x4a7d('0x33')](_0x4941d0['model'],_0x4941d0[_0x4a7d('0x30')]);_0x4a6af3[_0x4a7d('0x34')]=_['intersection'](_0x4941d0[_0x4a7d('0x2f')],qs[_0x4a7d('0x35')](_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x35')]));_0x4a6af3[_0x4a7d('0x34')]=_0x4a6af3[_0x4a7d('0x34')][_0x4a7d('0x36')]?_0x4a6af3['attributes']:_0x4941d0['model'];if(!_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x37')]('nolimit')){_0x4a6af3[_0x4a7d('0x1c')]=qs['limit'](_0x27d312['query'][_0x4a7d('0x1c')]);_0x4a6af3['offset']=qs[_0x4a7d('0x1b')](_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x1b')]);}_0x4a6af3[_0x4a7d('0x38')]=qs[_0x4a7d('0x39')](_0x27d312[_0x4a7d('0x30')]['sort']);_0x4a6af3[_0x4a7d('0x3a')]=qs[_0x4a7d('0x32')](_['pick'](_0x27d312['query'],_0x4941d0[_0x4a7d('0x32')]),_0x2a76ab);if(_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x3b')]){_0x4a6af3[_0x4a7d('0x3a')]=_['merge'](_0x4a6af3['where'],{'$or':_[_0x4a7d('0x2a')](_0x2a76ab,function(_0x491eaf){if(_0x491eaf[_0x4a7d('0x2d')]!==_0x4a7d('0x3c')){var _0x473a20={};_0x473a20[_0x491eaf[_0x4a7d('0x28')]]={'$like':'%'+_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x3b')]+'%'};return _0x473a20;}})});}_0x4a6af3=_[_0x4a7d('0x3d')]({},_0x4a6af3,_0x27d312[_0x4a7d('0x3e')]);var _0x52e128={'where':_0x4a6af3[_0x4a7d('0x3a')]};return db[_0x4a7d('0x3f')]['count'](_0x52e128)[_0x4a7d('0x23')](function(_0x5a33ca){_0x22bf32['count']=_0x5a33ca;if(_0x27d312[_0x4a7d('0x30')][_0x4a7d('0x40')]){_0x4a6af3[_0x4a7d('0x41')]=[{'all':!![]}];}return db[_0x4a7d('0x3f')][_0x4a7d('0x42')](_0x4a6af3);})[_0x4a7d('0x23')](function(_0x5e9984){_0x22bf32[_0x4a7d('0x43')]=_0x5e9984;return _0x22bf32;})['then'](respondWithFilteredResult(_0x271562,_0x4a6af3))['catch'](handleError(_0x271562,null));};exports['show']=function(_0x47654c,_0x4d5191){var _0x72a52d={'raw':!![],'where':{'id':_0x47654c['params']['id']}},_0x5bb6de={};_0x5bb6de[_0x4a7d('0x2f')]=_['keys'](db[_0x4a7d('0x3f')]['rawAttributes']);_0x5bb6de[_0x4a7d('0x30')]=_['keys'](_0x47654c[_0x4a7d('0x30')]);_0x5bb6de[_0x4a7d('0x32')]=_[_0x4a7d('0x33')](_0x5bb6de[_0x4a7d('0x2f')],_0x5bb6de[_0x4a7d('0x30')]);_0x72a52d[_0x4a7d('0x34')]=_[_0x4a7d('0x33')](_0x5bb6de['model'],qs[_0x4a7d('0x35')](_0x47654c[_0x4a7d('0x30')][_0x4a7d('0x35')]));_0x72a52d[_0x4a7d('0x34')]=_0x72a52d['attributes']['length']?_0x72a52d[_0x4a7d('0x34')]:_0x5bb6de['model'];if(_0x47654c['query']['includeAll']){_0x72a52d[_0x4a7d('0x41')]=[{'all':!![]}];}_0x72a52d=_[_0x4a7d('0x3d')]({},_0x72a52d,_0x47654c[_0x4a7d('0x3e')]);return db[_0x4a7d('0x3f')][_0x4a7d('0x44')](_0x72a52d)[_0x4a7d('0x23')](handleEntityNotFound(_0x4d5191,null))[_0x4a7d('0x23')](respondWithResult(_0x4d5191,null))['catch'](handleError(_0x4d5191,null));};exports[_0x4a7d('0x45')]=function(_0x34f84b,_0x1369e7){return db[_0x4a7d('0x3f')][_0x4a7d('0x45')](_0x34f84b[_0x4a7d('0x46')],{})[_0x4a7d('0x23')](respondWithResult(_0x1369e7,0xc9))['catch'](handleError(_0x1369e7,null));};exports[_0x4a7d('0x47')]=function(_0x4e9a31,_0x47cf3a){if(_0x4e9a31['body']['id']){delete _0x4e9a31['body']['id'];}return db[_0x4a7d('0x3f')][_0x4a7d('0x44')]({'where':{'id':_0x4e9a31[_0x4a7d('0x48')]['id']}})['then'](handleEntityNotFound(_0x47cf3a,null))[_0x4a7d('0x23')](saveUpdates(_0x4e9a31[_0x4a7d('0x46')],null))[_0x4a7d('0x23')](respondWithResult(_0x47cf3a,null))[_0x4a7d('0x49')](handleError(_0x47cf3a,null));};exports[_0x4a7d('0x24')]=function(_0xcac625,_0x58a15e){return db['SquareReport']['find']({'where':{'id':_0xcac625[_0x4a7d('0x48')]['id']}})['then'](handleEntityNotFound(_0x58a15e,null))[_0x4a7d('0x23')](removeEntity(_0x58a15e,null))['catch'](handleError(_0x58a15e,null));};exports['describe']=function(_0x3945cc,_0x195a9c){return db[_0x4a7d('0x3f')]['describe']()[_0x4a7d('0x23')](respondWithResult(_0x195a9c,null))['catch'](handleError(_0x195a9c,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index f644850..2aecfc0 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 _0x1649=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util'];(function(_0x4e6993,_0x227824){var _0x2abd96=function(_0x12be28){while(--_0x12be28){_0x4e6993['push'](_0x4e6993['shift']());}};_0x2abd96(++_0x227824);}(_0x1649,0x15e));var _0x9164=function(_0x3845db,_0x47dd69){_0x3845db=_0x3845db-0x0;var _0x2ab35a=_0x1649[_0x3845db];return _0x2ab35a;};'use strict';var _=require(_0x9164('0x0'));var util=require(_0x9164('0x1'));var logger=require(_0x9164('0x2'))(_0x9164('0x3'));var moment=require(_0x9164('0x4'));var BPromise=require(_0x9164('0x5'));var rp=require(_0x9164('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9164('0x7'));var config=require(_0x9164('0x8'));var attributes=require(_0x9164('0x9'));module['exports']=function(_0x1c4058,_0x4445e2){return _0x1c4058[_0x9164('0xa')](_0x9164('0xb'),attributes,{'tableName':_0x9164('0xc'),'paranoid':![],'indexes':[{'name':_0x9164('0xd'),'fields':['uniqueid',_0x9164('0xe')]},{'name':_0x9164('0xf'),'fields':[_0x9164('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f7b=['../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','project_name','leaveAt','util','api','moment','request-promise','path'];(function(_0xcdda78,_0x4a51e7){var _0x251064=function(_0x28f112){while(--_0x28f112){_0xcdda78['push'](_0xcdda78['shift']());}};_0x251064(++_0x4a51e7);}(_0x9f7b,0x7d));var _0xb9f7=function(_0x2864eb,_0x292273){_0x2864eb=_0x2864eb-0x0;var _0x1e537e=_0x9f7b[_0x2864eb];return _0x1e537e;};'use strict';var _=require('lodash');var util=require(_0xb9f7('0x0'));var logger=require('../../config/logger')(_0xb9f7('0x1'));var moment=require(_0xb9f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xb9f7('0x3'));var fs=require('fs');var path=require(_0xb9f7('0x4'));var rimraf=require('rimraf');var config=require(_0xb9f7('0x5'));var attributes=require(_0xb9f7('0x6'));module[_0xb9f7('0x7')]=function(_0x2125eb,_0x43b611){return _0x2125eb[_0xb9f7('0x8')](_0xb9f7('0x9'),attributes,{'tableName':_0xb9f7('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xb9f7('0xb')]},{'name':_0xb9f7('0xc'),'fields':[_0xb9f7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 8f13d7b..dfb1258 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 _0x321d=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','where','attributes','lodash','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x321d,0x17e));var _0xd321=function(_0x1a458e,_0xbf2d9b){_0x1a458e=_0x1a458e-0x0;var _0x260db2=_0x321d[_0x1a458e];return _0x260db2;};'use strict';var _=require(_0xd321('0x0'));var util=require(_0xd321('0x1'));var moment=require(_0xd321('0x2'));var BPromise=require('bluebird');var rs=require(_0xd321('0x3'));var fs=require('fs');var Redis=require(_0xd321('0x4'));var db=require(_0xd321('0x5'))['db'];var utils=require(_0xd321('0x6'));var logger=require(_0xd321('0x7'))(_0xd321('0x8'));var config=require(_0xd321('0x9'));var jayson=require(_0xd321('0xa'));var client=jayson[_0xd321('0xb')][_0xd321('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5536ec,_0x4fa71a,_0x17f3ae){return new BPromise(function(_0x39f985,_0x147bbf){return client['request'](_0x5536ec,_0x17f3ae)[_0xd321('0xd')](function(_0x2c3256){logger[_0xd321('0xe')]('SquareReport,\x20%s,\x20%s',_0x4fa71a,_0xd321('0xf'));logger[_0xd321('0x10')](_0xd321('0x11'),_0x4fa71a,_0xd321('0xf'),JSON[_0xd321('0x12')](_0x2c3256));if(_0x2c3256[_0xd321('0x13')]){if(_0x2c3256['error'][_0xd321('0x14')]===0x1f4){logger[_0xd321('0x13')]('SquareReport,\x20%s,\x20%s',_0x4fa71a,_0x2c3256[_0xd321('0x13')]['message']);return _0x147bbf(_0x2c3256[_0xd321('0x13')][_0xd321('0x15')]);}logger[_0xd321('0x13')]('SquareReport,\x20%s,\x20%s',_0x4fa71a,_0x2c3256[_0xd321('0x13')]['message']);return _0x39f985(_0x2c3256['error']['message']);}else{logger[_0xd321('0xe')]('SquareReport,\x20%s,\x20%s',_0x4fa71a,_0xd321('0xf'));_0x39f985(_0x2c3256[_0xd321('0x16')]['message']);}})[_0xd321('0x17')](function(_0x25f0bf){logger[_0xd321('0x13')]('SquareReport,\x20%s,\x20%s',_0x4fa71a,_0x25f0bf);_0x147bbf(_0x25f0bf);});});}exports[_0xd321('0x18')]=function(_0x5d11ee){var _0x1826b9=this;return new Promise(function(_0xedecd,_0x20af93){return db[_0xd321('0x19')]['create'](_0x5d11ee[_0xd321('0x1a')],{'raw':_0x5d11ee['options']?_0x5d11ee[_0xd321('0x1b')][_0xd321('0x1c')]===undefined?!![]:![]:!![]})[_0xd321('0xd')](function(_0x4a7710){logger[_0xd321('0xe')](_0xd321('0x18'),_0x5d11ee);logger[_0xd321('0x10')](_0xd321('0x18'),_0x5d11ee,JSON[_0xd321('0x12')](_0x4a7710));_0xedecd(_0x4a7710);})[_0xd321('0x17')](function(_0x4c0960){logger[_0xd321('0x13')](_0xd321('0x18'),_0x4c0960[_0xd321('0x15')],_0x5d11ee);_0x20af93(_0x1826b9[_0xd321('0x13')](0x1f4,_0x4c0960[_0xd321('0x15')]));});});};exports[_0xd321('0x1d')]=function(_0x5bc330){var _0x1f778f=this;return new Promise(function(_0x47728d,_0x5f185e){return db[_0xd321('0x19')]['update'](_0x5bc330[_0xd321('0x1a')],{'raw':_0x5bc330['options']?_0x5bc330['options'][_0xd321('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bc330['options']?_0x5bc330['options'][_0xd321('0x1e')]||null:null,'attributes':_0x5bc330[_0xd321('0x1b')]?_0x5bc330[_0xd321('0x1b')][_0xd321('0x1f')]||null:null,'limit':_0x5bc330[_0xd321('0x1b')]?_0x5bc330['options']['limit']||null:null})[_0xd321('0xd')](function(_0x267ce8){logger[_0xd321('0xe')]('UpdateSquareReport',_0x5bc330);logger[_0xd321('0x10')]('UpdateSquareReport',_0x5bc330,JSON[_0xd321('0x12')](_0x267ce8));_0x47728d(_0x267ce8);})['catch'](function(_0xec4501){logger[_0xd321('0x13')](_0xd321('0x1d'),_0xec4501[_0xd321('0x15')],_0x5bc330);_0x5f185e(_0x1f778f[_0xd321('0x13')](0x1f4,_0xec4501['message']));});});}; \ No newline at end of file +var _0xa394=['attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','raw','then','catch','UpdateSquareReport','update','where'];(function(_0x5e8deb,_0x5dff57){var _0x3d6fbd=function(_0x1c8be6){while(--_0x1c8be6){_0x5e8deb['push'](_0x5e8deb['shift']());}};_0x3d6fbd(++_0x5dff57);}(_0xa394,0x1c9));var _0x4a39=function(_0x397948,_0x3e2212){_0x397948=_0x397948-0x0;var _0x43cb1f=_0xa394[_0x397948];return _0x43cb1f;};'use strict';var _=require(_0x4a39('0x0'));var util=require('util');var moment=require(_0x4a39('0x1'));var BPromise=require(_0x4a39('0x2'));var rs=require(_0x4a39('0x3'));var fs=require('fs');var Redis=require(_0x4a39('0x4'));var db=require(_0x4a39('0x5'))['db'];var utils=require(_0x4a39('0x6'));var logger=require(_0x4a39('0x7'))(_0x4a39('0x8'));var config=require(_0x4a39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4a39('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19fe29,_0x18d131,_0x42c93b){return new BPromise(function(_0x3846d0,_0x4d247c){return client[_0x4a39('0xb')](_0x19fe29,_0x42c93b)['then'](function(_0x352b1c){logger[_0x4a39('0xc')](_0x4a39('0xd'),_0x18d131,_0x4a39('0xe'));logger[_0x4a39('0xf')](_0x4a39('0x10'),_0x18d131,_0x4a39('0xe'),JSON[_0x4a39('0x11')](_0x352b1c));if(_0x352b1c['error']){if(_0x352b1c[_0x4a39('0x12')][_0x4a39('0x13')]===0x1f4){logger[_0x4a39('0x12')]('SquareReport,\x20%s,\x20%s',_0x18d131,_0x352b1c[_0x4a39('0x12')][_0x4a39('0x14')]);return _0x4d247c(_0x352b1c[_0x4a39('0x12')][_0x4a39('0x14')]);}logger[_0x4a39('0x12')](_0x4a39('0xd'),_0x18d131,_0x352b1c[_0x4a39('0x12')][_0x4a39('0x14')]);return _0x3846d0(_0x352b1c[_0x4a39('0x12')][_0x4a39('0x14')]);}else{logger[_0x4a39('0xc')](_0x4a39('0xd'),_0x18d131,_0x4a39('0xe'));_0x3846d0(_0x352b1c[_0x4a39('0x15')][_0x4a39('0x14')]);}})['catch'](function(_0x425aac){logger[_0x4a39('0x12')](_0x4a39('0xd'),_0x18d131,_0x425aac);_0x4d247c(_0x425aac);});});}exports[_0x4a39('0x16')]=function(_0x45a234){var _0x2ec5d6=this;return new Promise(function(_0x29d91c,_0x567330){return db[_0x4a39('0x17')][_0x4a39('0x18')](_0x45a234[_0x4a39('0x19')],{'raw':_0x45a234['options']?_0x45a234[_0x4a39('0x1a')][_0x4a39('0x1b')]===undefined?!![]:![]:!![]})[_0x4a39('0x1c')](function(_0x458e72){logger[_0x4a39('0xc')](_0x4a39('0x16'),_0x45a234);logger[_0x4a39('0xf')]('CreateSquareReport',_0x45a234,JSON[_0x4a39('0x11')](_0x458e72));_0x29d91c(_0x458e72);})[_0x4a39('0x1d')](function(_0x4b8fa1){logger[_0x4a39('0x12')](_0x4a39('0x16'),_0x4b8fa1[_0x4a39('0x14')],_0x45a234);_0x567330(_0x2ec5d6[_0x4a39('0x12')](0x1f4,_0x4b8fa1[_0x4a39('0x14')]));});});};exports[_0x4a39('0x1e')]=function(_0x586139){var _0x1632c1=this;return new Promise(function(_0x3664ea,_0x1cabdf){return db[_0x4a39('0x17')][_0x4a39('0x1f')](_0x586139[_0x4a39('0x19')],{'raw':_0x586139[_0x4a39('0x1a')]?_0x586139[_0x4a39('0x1a')][_0x4a39('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x586139[_0x4a39('0x1a')]?_0x586139['options'][_0x4a39('0x20')]||null:null,'attributes':_0x586139[_0x4a39('0x1a')]?_0x586139[_0x4a39('0x1a')][_0x4a39('0x21')]||null:null,'limit':_0x586139[_0x4a39('0x1a')]?_0x586139[_0x4a39('0x1a')][_0x4a39('0x22')]||null:null})[_0x4a39('0x1c')](function(_0x521c7a){logger[_0x4a39('0xc')](_0x4a39('0x1e'),_0x586139);logger[_0x4a39('0xf')](_0x4a39('0x1e'),_0x586139,JSON['stringify'](_0x521c7a));_0x3664ea(_0x521c7a);})[_0x4a39('0x1d')](function(_0x539b37){logger[_0x4a39('0x12')](_0x4a39('0x1e'),_0x539b37[_0x4a39('0x14')],_0x586139);_0x1cabdf(_0x1632c1[_0x4a39('0x12')](0x1f4,_0x539b37[_0x4a39('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 94be516..6a74572 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 _0xb44f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','isAuthenticated','describe','show','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x46e9d1,_0x57e37b){var _0x361a86=function(_0x5177c8){while(--_0x5177c8){_0x46e9d1['push'](_0x46e9d1['shift']());}};_0x361a86(++_0x57e37b);}(_0xb44f,0x101));var _0xfb44=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb44f[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var path=require('path');var timeout=require(_0xfb44('0x2'));var express=require(_0xfb44('0x3'));var router=express[_0xfb44('0x4')]();var fs_extra=require(_0xfb44('0x5'));var auth=require(_0xfb44('0x6'));var interaction=require(_0xfb44('0x7'));var config=require(_0xfb44('0x8'));var controller=require(_0xfb44('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb44('0xa')]);router[_0xfb44('0xb')](_0xfb44('0xc'),auth[_0xfb44('0xd')](),controller[_0xfb44('0xe')]);router[_0xfb44('0xb')]('/:id',auth[_0xfb44('0xd')](),controller[_0xfb44('0xf')]);router['post']('/',auth[_0xfb44('0xd')](),controller['create']);router['put'](_0xfb44('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xfb44('0x11')](_0xfb44('0x10'),auth[_0xfb44('0xd')](),controller[_0xfb44('0x12')]);module[_0xfb44('0x13')]=router; \ No newline at end of file +var _0x53f4=['/:id','show','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5c7e00,_0x48e6c1){var _0x289ba9=function(_0x38da0d){while(--_0x38da0d){_0x5c7e00['push'](_0x5c7e00['shift']());}};_0x289ba9(++_0x48e6c1);}(_0x53f4,0x1e2));var _0x453f=function(_0x40feb0,_0x10f1a4){_0x40feb0=_0x40feb0-0x0;var _0x4b45bf=_0x53f4[_0x40feb0];return _0x4b45bf;};'use strict';var multer=require('multer');var util=require(_0x453f('0x0'));var path=require('path');var timeout=require(_0x453f('0x1'));var express=require(_0x453f('0x2'));var router=express['Router']();var fs_extra=require(_0x453f('0x3'));var auth=require(_0x453f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x453f('0x5'));var controller=require(_0x453f('0x6'));router[_0x453f('0x7')]('/',auth[_0x453f('0x8')](),controller[_0x453f('0x9')]);router[_0x453f('0x7')](_0x453f('0xa'),auth[_0x453f('0x8')](),controller[_0x453f('0xb')]);router[_0x453f('0x7')](_0x453f('0xc'),auth[_0x453f('0x8')](),controller[_0x453f('0xd')]);router['post']('/',auth[_0x453f('0x8')](),controller[_0x453f('0xe')]);router[_0x453f('0xf')](_0x453f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x453f('0x10')](_0x453f('0xc'),auth[_0x453f('0x8')](),controller[_0x453f('0x11')]);module[_0x453f('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 582a60c..d133ad6 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 _0xa884=['STRING','TEXT','sequelize','exports'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xa884,0x182));var _0x4a88=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0xa884[_0x20cb20];return _0x2fcf4b;};'use strict';var Sequelize=require(_0x4a88('0x0'));module[_0x4a88('0x1')]={'uniqueid':{'type':Sequelize[_0x4a88('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x4a88('0x2')]},'data':{'type':Sequelize[_0x4a88('0x3')]},'project_name':{'type':Sequelize[_0x4a88('0x2')]},'callerid':{'type':Sequelize[_0x4a88('0x2')]}}; \ No newline at end of file +var _0x1bb7=['STRING','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1bb7,0x1c0));var _0x71bb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1bb7[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x71bb('0x0'));module[_0x71bb('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x71bb('0x2')]},'application':{'type':Sequelize[_0x71bb('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x71bb('0x2')]},'callerid':{'type':Sequelize[_0x71bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index f7cc3c8..3557942 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 _0xc3d8=['include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','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/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll'];(function(_0x2d1152,_0x583f24){var _0x16347c=function(_0x68a2ff){while(--_0x68a2ff){_0x2d1152['push'](_0x2d1152['shift']());}};_0x16347c(++_0x583f24);}(_0xc3d8,0x1de));var _0x8c3d=function(_0x62835d,_0xbbfb3a){_0x62835d=_0x62835d-0x0;var _0x5e816b=_0xc3d8[_0x62835d];return _0x5e816b;};'use strict';var emlformat=require(_0x8c3d('0x0'));var rimraf=require(_0x8c3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c3d('0x2'));var rp=require(_0x8c3d('0x3'));var moment=require(_0x8c3d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8c3d('0x5'));var util=require(_0x8c3d('0x6'));var path=require(_0x8c3d('0x7'));var sox=require(_0x8c3d('0x8'));var csv=require('to-csv');var ejs=require(_0x8c3d('0x9'));var fs=require('fs');var fs_extra=require(_0x8c3d('0xa'));var _=require(_0x8c3d('0xb'));var squel=require(_0x8c3d('0xc'));var crypto=require(_0x8c3d('0xd'));var jsforce=require(_0x8c3d('0xe'));var deskjs=require(_0x8c3d('0xf'));var toCsv=require(_0x8c3d('0x10'));var querystring=require(_0x8c3d('0x11'));var Papa=require(_0x8c3d('0x12'));var Redis=require(_0x8c3d('0x13'));var authService=require(_0x8c3d('0x14'));var qs=require(_0x8c3d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c3d('0x16'));var logger=require('../../config/logger')(_0x8c3d('0x17'));var utils=require(_0x8c3d('0x18'));var config=require(_0x8c3d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c3d('0x1a'))['db'];function respondWithStatusCode(_0x23970f,_0x26bde3){_0x26bde3=_0x26bde3||0xcc;return function(_0x13bf15){if(_0x13bf15){return _0x23970f[_0x8c3d('0x1b')](_0x26bde3);}return _0x23970f[_0x8c3d('0x1c')](_0x26bde3)[_0x8c3d('0x1d')]();};}function respondWithResult(_0x184b62,_0x4e6b88){_0x4e6b88=_0x4e6b88||0xc8;return function(_0x2c3e48){if(_0x2c3e48){return _0x184b62['status'](_0x4e6b88)['json'](_0x2c3e48);}};}function respondWithFilteredResult(_0x19559c,_0x3611fe){return function(_0x2f40a7){if(_0x2f40a7){var _0x59b6a6=typeof _0x3611fe['offset']==='undefined'&&typeof _0x3611fe[_0x8c3d('0x1e')]==='undefined';var _0x372922=_0x2f40a7[_0x8c3d('0x1f')];var _0x5d3978=_0x59b6a6?0x0:_0x3611fe[_0x8c3d('0x20')];var _0x11e723=_0x59b6a6?_0x2f40a7[_0x8c3d('0x1f')]:_0x3611fe[_0x8c3d('0x20')]+_0x3611fe['limit'];var _0x1a70e6;if(_0x11e723>=_0x372922){_0x11e723=_0x372922;_0x1a70e6=0xc8;}else{_0x1a70e6=0xce;}_0x19559c[_0x8c3d('0x1c')](_0x1a70e6);return _0x19559c[_0x8c3d('0x21')](_0x8c3d('0x22'),_0x5d3978+'-'+_0x11e723+'/'+_0x372922)['json'](_0x2f40a7);}return null;};}function patchUpdates(_0x469c14){return function(_0x130e38){try{jsonpatch[_0x8c3d('0x23')](_0x130e38,_0x469c14,!![]);}catch(_0x22ea77){return BPromise[_0x8c3d('0x24')](_0x22ea77);}return _0x130e38[_0x8c3d('0x25')]();};}function saveUpdates(_0x17fc3f,_0x682507){return function(_0x176436){if(_0x176436){return _0x176436[_0x8c3d('0x26')](_0x17fc3f)[_0x8c3d('0x27')](function(_0x50a784){return _0x50a784;});}return null;};}function removeEntity(_0x51076f,_0x12a259){return function(_0x326e3a){if(_0x326e3a){return _0x326e3a[_0x8c3d('0x28')]()[_0x8c3d('0x27')](function(){_0x51076f['status'](0xcc)[_0x8c3d('0x1d')]();});}};}function handleEntityNotFound(_0x30f513,_0x57a114){return function(_0xeee9a7){if(!_0xeee9a7){_0x30f513[_0x8c3d('0x1b')](0x194);}return _0xeee9a7;};}function handleError(_0x1fe6b1,_0x42c891){_0x42c891=_0x42c891||0x1f4;return function(_0x5dfb37){logger[_0x8c3d('0x29')](_0x5dfb37[_0x8c3d('0x2a')]);if(_0x5dfb37[_0x8c3d('0x2b')]){delete _0x5dfb37[_0x8c3d('0x2b')];}_0x1fe6b1['status'](_0x42c891)[_0x8c3d('0x2c')](_0x5dfb37);};}exports[_0x8c3d('0x2d')]=function(_0x376da9,_0xe514d6){var _0x3a1bb1={},_0x46e53d={},_0x155c33={'count':0x0,'rows':[]};var _0x708e62=_[_0x8c3d('0x2e')](db[_0x8c3d('0x2f')][_0x8c3d('0x30')],function(_0x1d50bf){return{'name':_0x1d50bf['fieldName'],'type':_0x1d50bf[_0x8c3d('0x31')][_0x8c3d('0x32')]};});_0x46e53d[_0x8c3d('0x33')]=_['map'](_0x708e62,_0x8c3d('0x2b'));_0x46e53d[_0x8c3d('0x34')]=_[_0x8c3d('0x35')](_0x376da9[_0x8c3d('0x34')]);_0x46e53d[_0x8c3d('0x36')]=_[_0x8c3d('0x37')](_0x46e53d[_0x8c3d('0x33')],_0x46e53d[_0x8c3d('0x34')]);_0x3a1bb1['attributes']=_[_0x8c3d('0x37')](_0x46e53d[_0x8c3d('0x33')],qs[_0x8c3d('0x38')](_0x376da9[_0x8c3d('0x34')]['fields']));_0x3a1bb1[_0x8c3d('0x39')]=_0x3a1bb1[_0x8c3d('0x39')]['length']?_0x3a1bb1[_0x8c3d('0x39')]:_0x46e53d['model'];if(!_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x3a')](_0x8c3d('0x3b'))){_0x3a1bb1[_0x8c3d('0x1e')]=qs['limit'](_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x1e')]);_0x3a1bb1[_0x8c3d('0x20')]=qs[_0x8c3d('0x20')](_0x376da9['query']['offset']);}_0x3a1bb1[_0x8c3d('0x3c')]=qs['sort'](_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x3d')]);_0x3a1bb1[_0x8c3d('0x3e')]=qs[_0x8c3d('0x36')](_[_0x8c3d('0x3f')](_0x376da9[_0x8c3d('0x34')],_0x46e53d[_0x8c3d('0x36')]),_0x708e62);if(_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x40')]){_0x3a1bb1[_0x8c3d('0x3e')]=_['merge'](_0x3a1bb1['where'],{'$or':_['map'](_0x708e62,function(_0x284bc5){if(_0x284bc5[_0x8c3d('0x31')]!==_0x8c3d('0x41')){var _0x13cf26={};_0x13cf26[_0x284bc5['name']]={'$like':'%'+_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x40')]+'%'};return _0x13cf26;}})});}_0x3a1bb1=_['merge']({},_0x3a1bb1,_0x376da9[_0x8c3d('0x42')]);var _0x44a2a6={'where':_0x3a1bb1[_0x8c3d('0x3e')]};return db[_0x8c3d('0x2f')][_0x8c3d('0x1f')](_0x44a2a6)[_0x8c3d('0x27')](function(_0x1f48ef){_0x155c33[_0x8c3d('0x1f')]=_0x1f48ef;if(_0x376da9[_0x8c3d('0x34')][_0x8c3d('0x43')]){_0x3a1bb1[_0x8c3d('0x44')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x8c3d('0x45')](_0x3a1bb1);})[_0x8c3d('0x27')](function(_0x576c19){_0x155c33[_0x8c3d('0x46')]=_0x576c19;return _0x155c33;})['then'](respondWithFilteredResult(_0xe514d6,_0x3a1bb1))[_0x8c3d('0x47')](handleError(_0xe514d6,null));};exports[_0x8c3d('0x48')]=function(_0x387942,_0x2a7fe7){var _0x1734f1={'raw':!![],'where':{'id':_0x387942[_0x8c3d('0x49')]['id']}},_0x3cdcfc={};_0x3cdcfc[_0x8c3d('0x33')]=_['keys'](db[_0x8c3d('0x2f')][_0x8c3d('0x30')]);_0x3cdcfc[_0x8c3d('0x34')]=_[_0x8c3d('0x35')](_0x387942[_0x8c3d('0x34')]);_0x3cdcfc[_0x8c3d('0x36')]=_[_0x8c3d('0x37')](_0x3cdcfc[_0x8c3d('0x33')],_0x3cdcfc['query']);_0x1734f1[_0x8c3d('0x39')]=_[_0x8c3d('0x37')](_0x3cdcfc['model'],qs[_0x8c3d('0x38')](_0x387942['query'][_0x8c3d('0x38')]));_0x1734f1[_0x8c3d('0x39')]=_0x1734f1['attributes']['length']?_0x1734f1['attributes']:_0x3cdcfc[_0x8c3d('0x33')];if(_0x387942[_0x8c3d('0x34')][_0x8c3d('0x43')]){_0x1734f1[_0x8c3d('0x44')]=[{'all':!![]}];}_0x1734f1=_[_0x8c3d('0x4a')]({},_0x1734f1,_0x387942[_0x8c3d('0x42')]);return db['SquareDetailsReport'][_0x8c3d('0x4b')](_0x1734f1)[_0x8c3d('0x27')](handleEntityNotFound(_0x2a7fe7,null))['then'](respondWithResult(_0x2a7fe7,null))['catch'](handleError(_0x2a7fe7,null));};exports['create']=function(_0x2b97fd,_0xf1df8b){return db[_0x8c3d('0x2f')][_0x8c3d('0x4c')](_0x2b97fd['body'],{})[_0x8c3d('0x27')](respondWithResult(_0xf1df8b,0xc9))['catch'](handleError(_0xf1df8b,null));};exports['update']=function(_0x3ff1e1,_0x1c60e4){if(_0x3ff1e1['body']['id']){delete _0x3ff1e1[_0x8c3d('0x4d')]['id'];}return db[_0x8c3d('0x2f')][_0x8c3d('0x4b')]({'where':{'id':_0x3ff1e1['params']['id']}})[_0x8c3d('0x27')](handleEntityNotFound(_0x1c60e4,null))['then'](saveUpdates(_0x3ff1e1[_0x8c3d('0x4d')],null))[_0x8c3d('0x27')](respondWithResult(_0x1c60e4,null))[_0x8c3d('0x47')](handleError(_0x1c60e4,null));};exports['destroy']=function(_0x2b51d7,_0x2d1d6f){return db[_0x8c3d('0x2f')][_0x8c3d('0x4b')]({'where':{'id':_0x2b51d7[_0x8c3d('0x49')]['id']}})[_0x8c3d('0x27')](handleEntityNotFound(_0x2d1d6f,null))[_0x8c3d('0x27')](removeEntity(_0x2d1d6f,null))[_0x8c3d('0x47')](handleError(_0x2d1d6f,null));};exports['describe']=function(_0x5f54b1,_0x188dfa){return db[_0x8c3d('0x2f')]['describe']()[_0x8c3d('0x27')](respondWithResult(_0x188dfa,null))[_0x8c3d('0x47')](handleError(_0x188dfa,null));}; \ No newline at end of file +var _0x0dd9=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x2913b5,_0x2387c0){var _0x2ca1cc=function(_0xc2045b){while(--_0xc2045b){_0x2913b5['push'](_0x2913b5['shift']());}};_0x2ca1cc(++_0x2387c0);}(_0x0dd9,0x84));var _0x90dd=function(_0x22a413,_0x86da8b){_0x22a413=_0x22a413-0x0;var _0x4d0ecb=_0x0dd9[_0x22a413];return _0x4d0ecb;};'use strict';var emlformat=require(_0x90dd('0x0'));var rimraf=require(_0x90dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90dd('0x2'));var rp=require(_0x90dd('0x3'));var moment=require('moment');var BPromise=require(_0x90dd('0x4'));var Mustache=require(_0x90dd('0x5'));var util=require('util');var path=require(_0x90dd('0x6'));var sox=require(_0x90dd('0x7'));var csv=require(_0x90dd('0x8'));var ejs=require(_0x90dd('0x9'));var fs=require('fs');var fs_extra=require(_0x90dd('0xa'));var _=require(_0x90dd('0xb'));var squel=require(_0x90dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x90dd('0xd'));var deskjs=require(_0x90dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x90dd('0xf'));var Papa=require(_0x90dd('0x10'));var Redis=require('ioredis');var authService=require(_0x90dd('0x11'));var qs=require(_0x90dd('0x12'));var as=require(_0x90dd('0x13'));var hardwareService=require(_0x90dd('0x14'));var logger=require(_0x90dd('0x15'))(_0x90dd('0x16'));var utils=require(_0x90dd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x90dd('0x18'))['db'];function respondWithStatusCode(_0x24357e,_0x2514fb){_0x2514fb=_0x2514fb||0xcc;return function(_0x4b2eba){if(_0x4b2eba){return _0x24357e[_0x90dd('0x19')](_0x2514fb);}return _0x24357e[_0x90dd('0x1a')](_0x2514fb)[_0x90dd('0x1b')]();};}function respondWithResult(_0x20fe79,_0x422f33){_0x422f33=_0x422f33||0xc8;return function(_0x45509f){if(_0x45509f){return _0x20fe79[_0x90dd('0x1a')](_0x422f33)[_0x90dd('0x1c')](_0x45509f);}};}function respondWithFilteredResult(_0x890369,_0x335cc5){return function(_0x1ce609){if(_0x1ce609){var _0x4fd433=typeof _0x335cc5[_0x90dd('0x1d')]===_0x90dd('0x1e')&&typeof _0x335cc5[_0x90dd('0x1f')]===_0x90dd('0x1e');var _0x2be68b=_0x1ce609['count'];var _0x140e37=_0x4fd433?0x0:_0x335cc5[_0x90dd('0x1d')];var _0x331318=_0x4fd433?_0x1ce609[_0x90dd('0x20')]:_0x335cc5[_0x90dd('0x1d')]+_0x335cc5[_0x90dd('0x1f')];var _0x2c7692;if(_0x331318>=_0x2be68b){_0x331318=_0x2be68b;_0x2c7692=0xc8;}else{_0x2c7692=0xce;}_0x890369[_0x90dd('0x1a')](_0x2c7692);return _0x890369['set']('Content-Range',_0x140e37+'-'+_0x331318+'/'+_0x2be68b)['json'](_0x1ce609);}return null;};}function patchUpdates(_0x52ac20){return function(_0x3cfe8a){try{jsonpatch[_0x90dd('0x21')](_0x3cfe8a,_0x52ac20,!![]);}catch(_0x50fd7c){return BPromise[_0x90dd('0x22')](_0x50fd7c);}return _0x3cfe8a[_0x90dd('0x23')]();};}function saveUpdates(_0x195512,_0x23fe07){return function(_0x5d3771){if(_0x5d3771){return _0x5d3771[_0x90dd('0x24')](_0x195512)[_0x90dd('0x25')](function(_0x5f4653){return _0x5f4653;});}return null;};}function removeEntity(_0x5e55bf,_0x24327d){return function(_0xef5ee){if(_0xef5ee){return _0xef5ee['destroy']()[_0x90dd('0x25')](function(){_0x5e55bf[_0x90dd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14cb9c,_0x3c17db){return function(_0x40e110){if(!_0x40e110){_0x14cb9c[_0x90dd('0x19')](0x194);}return _0x40e110;};}function handleError(_0x335ea5,_0x43ae86){_0x43ae86=_0x43ae86||0x1f4;return function(_0x2e3a21){logger['error'](_0x2e3a21[_0x90dd('0x26')]);if(_0x2e3a21[_0x90dd('0x27')]){delete _0x2e3a21[_0x90dd('0x27')];}_0x335ea5[_0x90dd('0x1a')](_0x43ae86)[_0x90dd('0x28')](_0x2e3a21);};}exports[_0x90dd('0x29')]=function(_0x128e11,_0x5b7118){var _0x36e409={},_0xa8496a={},_0x58bac9={'count':0x0,'rows':[]};var _0x37c839=_[_0x90dd('0x2a')](db[_0x90dd('0x2b')][_0x90dd('0x2c')],function(_0x417c8f){return{'name':_0x417c8f[_0x90dd('0x2d')],'type':_0x417c8f[_0x90dd('0x2e')][_0x90dd('0x2f')]};});_0xa8496a[_0x90dd('0x30')]=_[_0x90dd('0x2a')](_0x37c839,_0x90dd('0x27'));_0xa8496a[_0x90dd('0x31')]=_[_0x90dd('0x32')](_0x128e11[_0x90dd('0x31')]);_0xa8496a[_0x90dd('0x33')]=_[_0x90dd('0x34')](_0xa8496a[_0x90dd('0x30')],_0xa8496a[_0x90dd('0x31')]);_0x36e409['attributes']=_['intersection'](_0xa8496a[_0x90dd('0x30')],qs[_0x90dd('0x35')](_0x128e11[_0x90dd('0x31')][_0x90dd('0x35')]));_0x36e409[_0x90dd('0x36')]=_0x36e409['attributes'][_0x90dd('0x37')]?_0x36e409[_0x90dd('0x36')]:_0xa8496a[_0x90dd('0x30')];if(!_0x128e11['query']['hasOwnProperty'](_0x90dd('0x38'))){_0x36e409[_0x90dd('0x1f')]=qs[_0x90dd('0x1f')](_0x128e11[_0x90dd('0x31')]['limit']);_0x36e409[_0x90dd('0x1d')]=qs[_0x90dd('0x1d')](_0x128e11[_0x90dd('0x31')][_0x90dd('0x1d')]);}_0x36e409[_0x90dd('0x39')]=qs[_0x90dd('0x3a')](_0x128e11[_0x90dd('0x31')]['sort']);_0x36e409[_0x90dd('0x3b')]=qs['filters'](_[_0x90dd('0x3c')](_0x128e11[_0x90dd('0x31')],_0xa8496a[_0x90dd('0x33')]),_0x37c839);if(_0x128e11[_0x90dd('0x31')][_0x90dd('0x3d')]){_0x36e409[_0x90dd('0x3b')]=_['merge'](_0x36e409[_0x90dd('0x3b')],{'$or':_['map'](_0x37c839,function(_0x535ab3){if(_0x535ab3[_0x90dd('0x2e')]!==_0x90dd('0x3e')){var _0x335e3b={};_0x335e3b[_0x535ab3['name']]={'$like':'%'+_0x128e11[_0x90dd('0x31')][_0x90dd('0x3d')]+'%'};return _0x335e3b;}})});}_0x36e409=_[_0x90dd('0x3f')]({},_0x36e409,_0x128e11[_0x90dd('0x40')]);var _0x2bfbda={'where':_0x36e409[_0x90dd('0x3b')]};return db[_0x90dd('0x2b')][_0x90dd('0x20')](_0x2bfbda)['then'](function(_0x53bd17){_0x58bac9[_0x90dd('0x20')]=_0x53bd17;if(_0x128e11['query'][_0x90dd('0x41')]){_0x36e409['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x36e409);})[_0x90dd('0x25')](function(_0x3b7bd0){_0x58bac9[_0x90dd('0x42')]=_0x3b7bd0;return _0x58bac9;})['then'](respondWithFilteredResult(_0x5b7118,_0x36e409))[_0x90dd('0x43')](handleError(_0x5b7118,null));};exports['show']=function(_0x28eb90,_0x3abc5c){var _0x5f21c6={'raw':!![],'where':{'id':_0x28eb90[_0x90dd('0x44')]['id']}},_0x141b85={};_0x141b85['model']=_['keys'](db[_0x90dd('0x2b')]['rawAttributes']);_0x141b85[_0x90dd('0x31')]=_[_0x90dd('0x32')](_0x28eb90[_0x90dd('0x31')]);_0x141b85[_0x90dd('0x33')]=_[_0x90dd('0x34')](_0x141b85['model'],_0x141b85[_0x90dd('0x31')]);_0x5f21c6[_0x90dd('0x36')]=_['intersection'](_0x141b85['model'],qs[_0x90dd('0x35')](_0x28eb90[_0x90dd('0x31')][_0x90dd('0x35')]));_0x5f21c6[_0x90dd('0x36')]=_0x5f21c6[_0x90dd('0x36')][_0x90dd('0x37')]?_0x5f21c6[_0x90dd('0x36')]:_0x141b85[_0x90dd('0x30')];if(_0x28eb90[_0x90dd('0x31')][_0x90dd('0x41')]){_0x5f21c6['include']=[{'all':!![]}];}_0x5f21c6=_['merge']({},_0x5f21c6,_0x28eb90[_0x90dd('0x40')]);return db[_0x90dd('0x2b')][_0x90dd('0x45')](_0x5f21c6)[_0x90dd('0x25')](handleEntityNotFound(_0x3abc5c,null))[_0x90dd('0x25')](respondWithResult(_0x3abc5c,null))['catch'](handleError(_0x3abc5c,null));};exports[_0x90dd('0x46')]=function(_0x41825a,_0x7ca784){return db[_0x90dd('0x2b')][_0x90dd('0x46')](_0x41825a['body'],{})[_0x90dd('0x25')](respondWithResult(_0x7ca784,0xc9))[_0x90dd('0x43')](handleError(_0x7ca784,null));};exports['update']=function(_0x8c0a6a,_0x395d2c){if(_0x8c0a6a[_0x90dd('0x47')]['id']){delete _0x8c0a6a[_0x90dd('0x47')]['id'];}return db[_0x90dd('0x2b')][_0x90dd('0x45')]({'where':{'id':_0x8c0a6a[_0x90dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x395d2c,null))[_0x90dd('0x25')](saveUpdates(_0x8c0a6a['body'],null))['then'](respondWithResult(_0x395d2c,null))[_0x90dd('0x43')](handleError(_0x395d2c,null));};exports[_0x90dd('0x48')]=function(_0x2fba76,_0xaab39d){return db[_0x90dd('0x2b')][_0x90dd('0x45')]({'where':{'id':_0x2fba76[_0x90dd('0x44')]['id']}})[_0x90dd('0x25')](handleEntityNotFound(_0xaab39d,null))[_0x90dd('0x25')](removeEntity(_0xaab39d,null))['catch'](handleError(_0xaab39d,null));};exports[_0x90dd('0x49')]=function(_0xc30378,_0x5945f6){return db[_0x90dd('0x2b')]['describe']()[_0x90dd('0x25')](respondWithResult(_0x5945f6,null))[_0x90dd('0x43')](handleError(_0x5945f6,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f2f02e3..54b4557 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 _0xf6d3=['request-promise','path','rimraf','exports','define','SquareDetailsReport','report_square_details','util','api','moment','bluebird'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xf6d3,0x1eb));var _0x3f6d=function(_0x36fd3a,_0x21496e){_0x36fd3a=_0x36fd3a-0x0;var _0x28caaa=_0xf6d3[_0x36fd3a];return _0x28caaa;};'use strict';var _=require('lodash');var util=require(_0x3f6d('0x0'));var logger=require('../../config/logger')(_0x3f6d('0x1'));var moment=require(_0x3f6d('0x2'));var BPromise=require(_0x3f6d('0x3'));var rp=require(_0x3f6d('0x4'));var fs=require('fs');var path=require(_0x3f6d('0x5'));var rimraf=require(_0x3f6d('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x3f6d('0x7')]=function(_0x5db5e,_0x23ca49){return _0x5db5e[_0x3f6d('0x8')](_0x3f6d('0x9'),attributes,{'tableName':_0x3f6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf7f=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','../../config/logger','api','request-promise'];(function(_0x786ad4,_0x4ffe58){var _0x5cae2d=function(_0x4acd79){while(--_0x4acd79){_0x786ad4['push'](_0x786ad4['shift']());}};_0x5cae2d(++_0x4ffe58);}(_0xcf7f,0x13c));var _0xfcf7=function(_0x4c1697,_0x15cb88){_0x4c1697=_0x4c1697-0x0;var _0x80e10a=_0xcf7f[_0x4c1697];return _0x80e10a;};'use strict';var _=require('lodash');var util=require(_0xfcf7('0x0'));var logger=require(_0xfcf7('0x1'))(_0xfcf7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcf7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcf7('0x4'));var config=require(_0xfcf7('0x5'));var attributes=require(_0xfcf7('0x6'));module[_0xfcf7('0x7')]=function(_0x302a4c,_0x4d0122){return _0x302a4c['define'](_0xfcf7('0x8'),attributes,{'tableName':_0xfcf7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 3d25088..5b807ba 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 _0xeb3b=['rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xeb3b[_0x1b6311];return _0x25aab6;};'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});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d917b){logger['info']('CreateSquareDetailsReport',_0x44a4bb);logger[_0xbeb3('0x1a')](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1b')](_0x1d917b));_0x10b15d(_0x1d917b);})['catch'](function(_0x301899){logger[_0xbeb3('0x10')]('CreateSquareDetailsReport',_0x301899[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x301899['message']));});});}; \ No newline at end of file +var _0xc2da=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareDetailsReport','create','body','options','stringify','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc2da,0x124));var _0xac2d=function(_0x13a68a,_0x2daaaa){_0x13a68a=_0x13a68a-0x0;var _0x27f857=_0xc2da[_0x13a68a];return _0x27f857;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var moment=require(_0xac2d('0x1'));var BPromise=require('bluebird');var rs=require(_0xac2d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac2d('0x3'))['db'];var utils=require(_0xac2d('0x4'));var logger=require(_0xac2d('0x5'))(_0xac2d('0x6'));var config=require(_0xac2d('0x7'));var jayson=require(_0xac2d('0x8'));var client=jayson[_0xac2d('0x9')][_0xac2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0a36,_0x3ef58a,_0x41d5ae){return new BPromise(function(_0x515055,_0x5cbc87){return client[_0xac2d('0xb')](_0x2b0a36,_0x41d5ae)['then'](function(_0x4271fa){logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));logger[_0xac2d('0xf')](_0xac2d('0x10'),_0x3ef58a,'request\x20sent',JSON['stringify'](_0x4271fa));if(_0x4271fa[_0xac2d('0x11')]){if(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x12')]===0x1f4){logger[_0xac2d('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x5cbc87(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}logger[_0xac2d('0x11')](_0xac2d('0xd'),_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x515055(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}else{logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));_0x515055(_0x4271fa[_0xac2d('0x14')][_0xac2d('0x13')]);}})['catch'](function(_0x3170ae){logger[_0xac2d('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3ef58a,_0x3170ae);_0x5cbc87(_0x3170ae);});});}exports[_0xac2d('0x15')]=function(_0xed956b){var _0x1d8e9f=this;return new Promise(function(_0x4d34fa,_0x45c12b){return db['SquareDetailsReport'][_0xac2d('0x16')](_0xed956b[_0xac2d('0x17')],{'raw':_0xed956b['options']?_0xed956b[_0xac2d('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x510e85){logger['info'](_0xac2d('0x15'),_0xed956b);logger[_0xac2d('0xf')](_0xac2d('0x15'),_0xed956b,JSON[_0xac2d('0x19')](_0x510e85));_0x4d34fa(_0x510e85);})[_0xac2d('0x1a')](function(_0x391911){logger[_0xac2d('0x11')](_0xac2d('0x15'),_0x391911[_0xac2d('0x13')],_0xed956b);_0x45c12b(_0x1d8e9f[_0xac2d('0x11')](0x1f4,_0x391911[_0xac2d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 107b21a..b07bfb9 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 _0x3456=['killProcess','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x6bed2b,_0x3c149d){var _0x1b78bb=function(_0xbf14eb){while(--_0xbf14eb){_0x6bed2b['push'](_0x6bed2b['shift']());}};_0x1b78bb(++_0x3c149d);}(_0x3456,0x151));var _0x6345=function(_0x3cafb8,_0x32860e){_0x3cafb8=_0x3cafb8-0x0;var _0x4b7f85=_0x3456[_0x3cafb8];return _0x4b7f85;};'use strict';var express=require(_0x6345('0x0'));var router=express[_0x6345('0x1')]();var auth=require(_0x6345('0x2'));var controller=require(_0x6345('0x3'));router[_0x6345('0x4')]('/',auth[_0x6345('0x5')](),controller['index']);router[_0x6345('0x4')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x6345('0x6')]);module['exports']=router; \ No newline at end of file +var _0xdd4d=['/process/:pid/kill','exports','express','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x2195da,_0x5c9934){var _0x4db83c=function(_0x15af7c){while(--_0x15af7c){_0x2195da['push'](_0x2195da['shift']());}};_0x4db83c(++_0x5c9934);}(_0xdd4d,0x1b4));var _0xddd4=function(_0x4cbff5,_0x204225){_0x4cbff5=_0x4cbff5-0x0;var _0x44758f=_0xdd4d[_0x4cbff5];return _0x44758f;};'use strict';var express=require(_0xddd4('0x0'));var router=express['Router']();var auth=require(_0xddd4('0x1'));var controller=require(_0xddd4('0x2'));router[_0xddd4('0x3')]('/',auth[_0xddd4('0x4')](),controller['index']);router[_0xddd4('0x3')](_0xddd4('0x5'),auth[_0xddd4('0x4')](),controller['killProcess']);module[_0xddd4('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 c9a6995..7f21754 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 _0xe6df=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','exec','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf'];(function(_0x480b30,_0x47c427){var _0x234122=function(_0x4521e0){while(--_0x4521e0){_0x480b30['push'](_0x480b30['shift']());}};_0x234122(++_0x47c427);}(_0xe6df,0x10e));var _0xfe6d=function(_0x209e49,_0x1f636b){_0x209e49=_0x209e49-0x0;var _0x3ba0c9=_0xe6df[_0x209e49];return _0x3ba0c9;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xfe6d('0x0')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require('bluebird');var _=require(_0xfe6d('0x1'));function handleError(_0x4ee0f8,_0x1c9d5d,_0x4f2e05){_0x1c9d5d=_0x1c9d5d||0x1f4;return function(_0xcfbd82){logger[_0xfe6d('0x2')](_0xfe6d('0x3'),_0x4f2e05,_0x1c9d5d,util['inspect'](_0xcfbd82,{'showHidden':![],'depth':null}));delete _0xcfbd82[_0xfe6d('0x4')];_0x4ee0f8[_0xfe6d('0x5')](_0x1c9d5d)[_0xfe6d('0x6')](_0xcfbd82);};}exports[_0xfe6d('0x7')]=function(_0x308fe1,_0x1c0407){return info['getAllData']()[_0xfe6d('0x8')](function(_0x25045d){return _0x1c0407[_0xfe6d('0x5')](0xc8)['json'](_0x25045d);})['catch'](function(_0x2e3b77){return _0x1c0407[_0xfe6d('0x5')](0x1f4)[_0xfe6d('0x9')](_0x2e3b77);});};exports[_0xfe6d('0xa')]=function(_0x25780d,_0x349207){var _0x580089=[_0xfe6d('0xb')];return new BPromise(function(_0x272631,_0x5751c7){return exec(util[_0xfe6d('0xc')](_0xfe6d('0xd'),_0x25780d['params'][_0xfe6d('0xe')]),function(_0x4e6b48,_0x2bb107,_0x45b2bf){if(_0x4e6b48){return _0x5751c7(_0x4e6b48);}return _0x272631(_0x2bb107);});})[_0xfe6d('0x8')](function(_0x63ac1d){var _0x209773=![];var _0x3f3ea7=_0x63ac1d[_0xfe6d('0xf')](/\n/);for(var _0x1206cc=0x0,_0xaceb23=_0x580089[_0xfe6d('0x10')];_0x1206cc<_0xaceb23,_0x209773===![];_0x1206cc+=0x1){if(_0x63ac1d[_0xfe6d('0x11')](_0x580089[_0x1206cc])>=0x0){_0x209773=!![];}}if(!_0x209773){throw new Error(util[_0xfe6d('0xc')](_0xfe6d('0x12'),_0x25780d['params'][_0xfe6d('0xe')]));}process[_0xfe6d('0x13')](_0x25780d[_0xfe6d('0x14')][_0xfe6d('0xe')],_0xfe6d('0x15'));return _0x349207[_0xfe6d('0x5')](0xc8)[_0xfe6d('0x9')]({'message':util['format'](_0xfe6d('0x16'),_0x25780d[_0xfe6d('0x14')][_0xfe6d('0xe')])});})[_0xfe6d('0x17')](handleError(_0x349207,null,_0xfe6d('0xa')));}; \ No newline at end of file +var _0xb169=['name','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0xb169,0x13f));var _0x9b16=function(_0xf273f9,_0x486198){_0xf273f9=_0xf273f9-0x0;var _0xb4abcc=_0xb169[_0xf273f9];return _0xb4abcc;};'use strict';var info=require(_0x9b16('0x0'));var exec=require('child_process')[_0x9b16('0x1')];var logger=require(_0x9b16('0x2'))('api');var util=require('util');var BPromise=require(_0x9b16('0x3'));var _=require(_0x9b16('0x4'));function handleError(_0x47ce6b,_0x1aef8f,_0x96c8fb){_0x1aef8f=_0x1aef8f||0x1f4;return function(_0x3b756c){logger['error'](_0x9b16('0x5'),_0x96c8fb,_0x1aef8f,util['inspect'](_0x3b756c,{'showHidden':![],'depth':null}));delete _0x3b756c[_0x9b16('0x6')];_0x47ce6b[_0x9b16('0x7')](_0x1aef8f)[_0x9b16('0x8')](_0x3b756c);};}exports[_0x9b16('0x9')]=function(_0x36b98f,_0x3f82c6){return info[_0x9b16('0xa')]()[_0x9b16('0xb')](function(_0xca0a4){return _0x3f82c6[_0x9b16('0x7')](0xc8)['json'](_0xca0a4);})[_0x9b16('0xc')](function(_0x5d960a){return _0x3f82c6[_0x9b16('0x7')](0x1f4)[_0x9b16('0xd')](_0x5d960a);});};exports[_0x9b16('0xe')]=function(_0x22d414,_0x45245b){var _0x49fda3=[_0x9b16('0xf')];return new BPromise(function(_0x3e6eb5,_0x3e219c){return exec(util[_0x9b16('0x10')](_0x9b16('0x11'),_0x22d414[_0x9b16('0x12')][_0x9b16('0x13')]),function(_0x165efb,_0x188378,_0xfc8cdf){if(_0x165efb){return _0x3e219c(_0x165efb);}return _0x3e6eb5(_0x188378);});})[_0x9b16('0xb')](function(_0x396a58){var _0x251d04=![];var _0x3ee35c=_0x396a58['split'](/\n/);for(var _0x1836ae=0x0,_0xb9ff26=_0x49fda3[_0x9b16('0x14')];_0x1836ae<_0xb9ff26,_0x251d04===![];_0x1836ae+=0x1){if(_0x396a58[_0x9b16('0x15')](_0x49fda3[_0x1836ae])>=0x0){_0x251d04=!![];}}if(!_0x251d04){throw new Error(util[_0x9b16('0x10')](_0x9b16('0x16'),_0x22d414[_0x9b16('0x12')]['pid']));}process['kill'](_0x22d414[_0x9b16('0x12')][_0x9b16('0x13')],_0x9b16('0x17'));return _0x45245b[_0x9b16('0x7')](0xc8)[_0x9b16('0xd')]({'message':util[_0x9b16('0x10')](_0x9b16('0x18'),_0x22d414[_0x9b16('0x12')]['pid'])});})[_0x9b16('0xc')](handleError(_0x45245b,null,_0x9b16('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 227f970..37c371a 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x4991b1,_0x9a75cf){var _0x35df5f=function(_0x35b478){while(--_0x35b478){_0x4991b1['push'](_0x4991b1['shift']());}};_0x35df5f(++_0x9a75cf);}(_0x34e8,0x12c));var _0x834e=function(_0x1580a0,_0x22ed26){_0x1580a0=_0x1580a0-0x0;var _0x2da197=_0x34e8[_0x1580a0];return _0x2da197;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0x15')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x16')]=router; \ No newline at end of file +var _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x17ba,0xab));var _0xa17b=function(_0x2040fe,_0x50efd5){_0x2040fe=_0x2040fe-0x0;var _0x247998=_0x17ba[_0x2040fe];return _0x247998;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 80a9e7d..f301a3f 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 _0xc4dd=['#0091EA','sequelize','exports','STRING'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xc4dd,0xad));var _0xdc4d=function(_0x2349ae,_0xb40037){_0x2349ae=_0x2349ae-0x0;var _0x4b951a=_0xc4dd[_0x2349ae];return _0x4b951a;};'use strict';var Sequelize=require(_0xdc4d('0x0'));module[_0xdc4d('0x1')]={'name':{'type':Sequelize[_0xdc4d('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xdc4d('0x2')],'defaultValue':_0xdc4d('0x3')},'description':{'type':Sequelize[_0xdc4d('0x2')]}}; \ No newline at end of file +var _0xd844=['STRING','sequelize','exports','name'];(function(_0x2b38ec,_0x587dd6){var _0x1577bc=function(_0x58d6c5){while(--_0x58d6c5){_0x2b38ec['push'](_0x2b38ec['shift']());}};_0x1577bc(++_0x587dd6);}(_0xd844,0x6d));var _0x4d84=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd844[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x4d84('0x0'));module[_0x4d84('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4d84('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4d84('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index dfde4b7..ebe3b29 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 _0xb5f1=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Tags','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','catch','show','params','keys','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5f1,0x150));var _0x1b5f=function(_0x5b4c5f,_0x5e2a43){_0x5b4c5f=_0x5b4c5f-0x0;var _0x3d606e=_0xb5f1[_0x5b4c5f];return _0x3d606e;};'use strict';var emlformat=require(_0x1b5f('0x0'));var rimraf=require(_0x1b5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b5f('0x2'));var rp=require(_0x1b5f('0x3'));var moment=require(_0x1b5f('0x4'));var BPromise=require(_0x1b5f('0x5'));var Mustache=require(_0x1b5f('0x6'));var util=require('util');var path=require(_0x1b5f('0x7'));var sox=require(_0x1b5f('0x8'));var csv=require(_0x1b5f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b5f('0xa'));var _=require(_0x1b5f('0xb'));var squel=require('squel');var crypto=require(_0x1b5f('0xc'));var jsforce=require(_0x1b5f('0xd'));var deskjs=require(_0x1b5f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b5f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b5f('0x10'));var as=require(_0x1b5f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b5f('0x12'))(_0x1b5f('0x13'));var utils=require(_0x1b5f('0x14'));var config=require(_0x1b5f('0x15'));var licenseUtil=require(_0x1b5f('0x16'));var db=require(_0x1b5f('0x17'))['db'];function respondWithStatusCode(_0x22b293,_0x44a791){_0x44a791=_0x44a791||0xcc;return function(_0x382b41){if(_0x382b41){return _0x22b293['sendStatus'](_0x44a791);}return _0x22b293['status'](_0x44a791)[_0x1b5f('0x18')]();};}function respondWithResult(_0x9dfb86,_0x3de2e1){_0x3de2e1=_0x3de2e1||0xc8;return function(_0x11c4ab){if(_0x11c4ab){return _0x9dfb86[_0x1b5f('0x19')](_0x3de2e1)[_0x1b5f('0x1a')](_0x11c4ab);}};}function respondWithFilteredResult(_0x50faf7,_0x46b687){return function(_0x1bed03){if(_0x1bed03){var _0x42166c=typeof _0x46b687[_0x1b5f('0x1b')]===_0x1b5f('0x1c')&&typeof _0x46b687[_0x1b5f('0x1d')]===_0x1b5f('0x1c');var _0x17e517=_0x1bed03['count'];var _0x59963b=_0x42166c?0x0:_0x46b687[_0x1b5f('0x1b')];var _0x3ee425=_0x42166c?_0x1bed03[_0x1b5f('0x1e')]:_0x46b687[_0x1b5f('0x1b')]+_0x46b687[_0x1b5f('0x1d')];var _0x22fb53;if(_0x3ee425>=_0x17e517){_0x3ee425=_0x17e517;_0x22fb53=0xc8;}else{_0x22fb53=0xce;}_0x50faf7[_0x1b5f('0x19')](_0x22fb53);return _0x50faf7[_0x1b5f('0x1f')](_0x1b5f('0x20'),_0x59963b+'-'+_0x3ee425+'/'+_0x17e517)[_0x1b5f('0x1a')](_0x1bed03);}return null;};}function patchUpdates(_0x405965){return function(_0x31a110){try{jsonpatch['apply'](_0x31a110,_0x405965,!![]);}catch(_0x4ab3f6){return BPromise[_0x1b5f('0x21')](_0x4ab3f6);}return _0x31a110[_0x1b5f('0x22')]();};}function saveUpdates(_0x2a0cf6,_0x2c70be){return function(_0x5617c3){if(_0x5617c3){return _0x5617c3[_0x1b5f('0x23')](_0x2a0cf6)[_0x1b5f('0x24')](function(_0x4e87ad){return _0x4e87ad;});}return null;};}function removeEntity(_0x5d2014,_0x4331d3){return function(_0x2dc281){if(_0x2dc281){return _0x2dc281[_0x1b5f('0x25')]()[_0x1b5f('0x24')](function(){var _0x26e826=_0x2dc281['get']({'plain':!![]});var _0x450a5c=_0x1b5f('0x26');return db['UserProfileResource'][_0x1b5f('0x25')]({'where':{'type':_0x450a5c,'resourceId':_0x26e826['id']}})['then'](function(){return _0x2dc281;});})[_0x1b5f('0x24')](function(){_0x5d2014[_0x1b5f('0x19')](0xcc)[_0x1b5f('0x18')]();});}};}function handleEntityNotFound(_0x50c8c7,_0x4df2bc){return function(_0x5833db){if(!_0x5833db){_0x50c8c7[_0x1b5f('0x27')](0x194);}return _0x5833db;};}function handleError(_0x2a13a4,_0x2802f5){_0x2802f5=_0x2802f5||0x1f4;return function(_0xe68402){logger[_0x1b5f('0x28')](_0xe68402[_0x1b5f('0x29')]);if(_0xe68402[_0x1b5f('0x2a')]){delete _0xe68402['name'];}_0x2a13a4[_0x1b5f('0x19')](_0x2802f5)['send'](_0xe68402);};}exports[_0x1b5f('0x2b')]=function(_0x2fd36f,_0x401d49){var _0x44b497={},_0x4c43e8={},_0x72a92c={'count':0x0,'rows':[]};var _0x3d8f22=_[_0x1b5f('0x2c')](db[_0x1b5f('0x2d')][_0x1b5f('0x2e')],function(_0x2524ff){return{'name':_0x2524ff[_0x1b5f('0x2f')],'type':_0x2524ff['type'][_0x1b5f('0x30')]};});_0x4c43e8[_0x1b5f('0x31')]=_[_0x1b5f('0x2c')](_0x3d8f22,'name');_0x4c43e8[_0x1b5f('0x32')]=_['keys'](_0x2fd36f['query']);_0x4c43e8[_0x1b5f('0x33')]=_[_0x1b5f('0x34')](_0x4c43e8['model'],_0x4c43e8[_0x1b5f('0x32')]);_0x44b497[_0x1b5f('0x35')]=_[_0x1b5f('0x34')](_0x4c43e8[_0x1b5f('0x31')],qs[_0x1b5f('0x36')](_0x2fd36f['query'][_0x1b5f('0x36')]));_0x44b497[_0x1b5f('0x35')]=_0x44b497['attributes'][_0x1b5f('0x37')]?_0x44b497[_0x1b5f('0x35')]:_0x4c43e8[_0x1b5f('0x31')];if(!_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x38')](_0x1b5f('0x39'))){_0x44b497['limit']=qs[_0x1b5f('0x1d')](_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x1d')]);_0x44b497['offset']=qs[_0x1b5f('0x1b')](_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x1b')]);}_0x44b497[_0x1b5f('0x3a')]=qs[_0x1b5f('0x3b')](_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x3b')]);_0x44b497['where']=qs[_0x1b5f('0x33')](_['pick'](_0x2fd36f[_0x1b5f('0x32')],_0x4c43e8[_0x1b5f('0x33')]),_0x3d8f22);if(_0x2fd36f[_0x1b5f('0x32')]['filter']){_0x44b497[_0x1b5f('0x3c')]=_[_0x1b5f('0x3d')](_0x44b497[_0x1b5f('0x3c')],{'$or':_[_0x1b5f('0x2c')](_0x3d8f22,function(_0x3c7839){if(_0x3c7839[_0x1b5f('0x3e')]!==_0x1b5f('0x3f')){var _0x459ffc={};_0x459ffc[_0x3c7839[_0x1b5f('0x2a')]]={'$like':'%'+_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x40')]+'%'};return _0x459ffc;}})});}_0x44b497=_['merge']({},_0x44b497,_0x2fd36f['options']);var _0x13598d={'where':_0x44b497['where']};return db['Tag'][_0x1b5f('0x1e')](_0x13598d)[_0x1b5f('0x24')](function(_0x2161e3){_0x72a92c[_0x1b5f('0x1e')]=_0x2161e3;if(_0x2fd36f[_0x1b5f('0x32')][_0x1b5f('0x41')]){_0x44b497[_0x1b5f('0x42')]=[{'all':!![]}];}return db[_0x1b5f('0x2d')]['findAll'](_0x44b497);})[_0x1b5f('0x24')](function(_0x482764){_0x72a92c['rows']=_0x482764;return _0x72a92c;})[_0x1b5f('0x24')](respondWithFilteredResult(_0x401d49,_0x44b497))[_0x1b5f('0x43')](handleError(_0x401d49,null));};exports[_0x1b5f('0x44')]=function(_0x5509ec,_0x1adf6e){var _0xc866f1={'raw':!![],'where':{'id':_0x5509ec[_0x1b5f('0x45')]['id']}},_0x2c2f6b={};_0x2c2f6b[_0x1b5f('0x31')]=_[_0x1b5f('0x46')](db[_0x1b5f('0x2d')]['rawAttributes']);_0x2c2f6b[_0x1b5f('0x32')]=_[_0x1b5f('0x46')](_0x5509ec[_0x1b5f('0x32')]);_0x2c2f6b[_0x1b5f('0x33')]=_[_0x1b5f('0x34')](_0x2c2f6b[_0x1b5f('0x31')],_0x2c2f6b[_0x1b5f('0x32')]);_0xc866f1['attributes']=_[_0x1b5f('0x34')](_0x2c2f6b[_0x1b5f('0x31')],qs['fields'](_0x5509ec[_0x1b5f('0x32')][_0x1b5f('0x36')]));_0xc866f1[_0x1b5f('0x35')]=_0xc866f1[_0x1b5f('0x35')][_0x1b5f('0x37')]?_0xc866f1['attributes']:_0x2c2f6b[_0x1b5f('0x31')];if(_0x5509ec[_0x1b5f('0x32')]['includeAll']){_0xc866f1['include']=[{'all':!![]}];}_0xc866f1=_[_0x1b5f('0x3d')]({},_0xc866f1,_0x5509ec[_0x1b5f('0x47')]);return db['Tag']['find'](_0xc866f1)[_0x1b5f('0x24')](handleEntityNotFound(_0x1adf6e,null))['then'](respondWithResult(_0x1adf6e,null))[_0x1b5f('0x43')](handleError(_0x1adf6e,null));};exports[_0x1b5f('0x48')]=function(_0x22666a,_0x9ab8b1){return db[_0x1b5f('0x2d')]['create'](_0x22666a['body'],{})[_0x1b5f('0x24')](function(_0x5bfa39){var _0x37d6e4=_0x22666a[_0x1b5f('0x49')]['get']({'plain':!![]});if(!_0x37d6e4)throw new Error(_0x1b5f('0x4a'));if(_0x37d6e4[_0x1b5f('0x4b')]==='user'){var _0xfe1b61=_0x5bfa39[_0x1b5f('0x4c')]({'plain':!![]});var _0xc7a070='Tags';return db[_0x1b5f('0x4d')][_0x1b5f('0x4e')]({'where':{'name':_0xc7a070,'userProfileId':_0x37d6e4[_0x1b5f('0x4f')]},'raw':!![]})[_0x1b5f('0x24')](function(_0x5d3a4e){if(_0x5d3a4e&&_0x5d3a4e[_0x1b5f('0x50')]===0x0){return db[_0x1b5f('0x51')][_0x1b5f('0x48')]({'name':_0xfe1b61[_0x1b5f('0x2a')],'resourceId':_0xfe1b61['id'],'type':_0x5d3a4e[_0x1b5f('0x2a')],'sectionId':_0x5d3a4e['id']},{})[_0x1b5f('0x24')](function(){return _0x5bfa39;});}else{return _0x5bfa39;}})['catch'](function(_0x1a09d8){logger[_0x1b5f('0x28')](_0x1b5f('0x52'),_0x1a09d8);throw _0x1a09d8;});}return _0x5bfa39;})[_0x1b5f('0x24')](respondWithResult(_0x9ab8b1,0xc9))['catch'](handleError(_0x9ab8b1,null));};exports[_0x1b5f('0x23')]=function(_0x5e18c1,_0x2541f8){if(_0x5e18c1[_0x1b5f('0x53')]['id']){delete _0x5e18c1[_0x1b5f('0x53')]['id'];}return db[_0x1b5f('0x2d')][_0x1b5f('0x4e')]({'where':{'id':_0x5e18c1[_0x1b5f('0x45')]['id']}})[_0x1b5f('0x24')](handleEntityNotFound(_0x2541f8,null))[_0x1b5f('0x24')](saveUpdates(_0x5e18c1[_0x1b5f('0x53')],null))[_0x1b5f('0x24')](respondWithResult(_0x2541f8,null))[_0x1b5f('0x43')](handleError(_0x2541f8,null));};exports[_0x1b5f('0x25')]=function(_0x4e607a,_0x34966f){return db[_0x1b5f('0x2d')]['find']({'where':{'id':_0x4e607a[_0x1b5f('0x45')]['id']}})[_0x1b5f('0x24')](handleEntityNotFound(_0x34966f,null))[_0x1b5f('0x24')](removeEntity(_0x34966f,null))[_0x1b5f('0x43')](handleError(_0x34966f,null));};exports[_0x1b5f('0x54')]=function(_0x2531a2,_0x5c3b11){return db[_0x1b5f('0x2d')]['describe']()[_0x1b5f('0x24')](respondWithResult(_0x5c3b11,null))[_0x1b5f('0x43')](handleError(_0x5c3b11,null));}; \ No newline at end of file +var _0x41f6=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','Tags','UserProfileResource','destroy','error','name','send','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','Tag','include','rows','catch','show','params','length','includeAll','find'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x41f6,0x1e9));var _0x641f=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x41f6[_0x47b15f];return _0x55bf25;};'use strict';var emlformat=require(_0x641f('0x0'));var rimraf=require(_0x641f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x641f('0x2'));var rp=require(_0x641f('0x3'));var moment=require(_0x641f('0x4'));var BPromise=require(_0x641f('0x5'));var Mustache=require('mustache');var util=require(_0x641f('0x6'));var path=require(_0x641f('0x7'));var sox=require('sox');var csv=require(_0x641f('0x8'));var ejs=require(_0x641f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x641f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x641f('0xb'));var deskjs=require(_0x641f('0xc'));var toCsv=require(_0x641f('0x8'));var querystring=require(_0x641f('0xd'));var Papa=require(_0x641f('0xe'));var Redis=require(_0x641f('0xf'));var authService=require(_0x641f('0x10'));var qs=require(_0x641f('0x11'));var as=require(_0x641f('0x12'));var hardwareService=require(_0x641f('0x13'));var logger=require('../../config/logger')(_0x641f('0x14'));var utils=require('../../config/utils');var config=require(_0x641f('0x15'));var licenseUtil=require(_0x641f('0x16'));var db=require(_0x641f('0x17'))['db'];function respondWithStatusCode(_0x58663a,_0x1eaae8){_0x1eaae8=_0x1eaae8||0xcc;return function(_0x3202f4){if(_0x3202f4){return _0x58663a[_0x641f('0x18')](_0x1eaae8);}return _0x58663a[_0x641f('0x19')](_0x1eaae8)[_0x641f('0x1a')]();};}function respondWithResult(_0x10ad52,_0x571a59){_0x571a59=_0x571a59||0xc8;return function(_0x18f9fa){if(_0x18f9fa){return _0x10ad52['status'](_0x571a59)[_0x641f('0x1b')](_0x18f9fa);}};}function respondWithFilteredResult(_0x8114,_0x543ee9){return function(_0x24a4ea){if(_0x24a4ea){var _0x52ac21=typeof _0x543ee9[_0x641f('0x1c')]===_0x641f('0x1d')&&typeof _0x543ee9[_0x641f('0x1e')]==='undefined';var _0x319d1a=_0x24a4ea[_0x641f('0x1f')];var _0x1e69c0=_0x52ac21?0x0:_0x543ee9[_0x641f('0x1c')];var _0x808334=_0x52ac21?_0x24a4ea[_0x641f('0x1f')]:_0x543ee9['offset']+_0x543ee9[_0x641f('0x1e')];var _0x244b58;if(_0x808334>=_0x319d1a){_0x808334=_0x319d1a;_0x244b58=0xc8;}else{_0x244b58=0xce;}_0x8114[_0x641f('0x19')](_0x244b58);return _0x8114[_0x641f('0x20')](_0x641f('0x21'),_0x1e69c0+'-'+_0x808334+'/'+_0x319d1a)['json'](_0x24a4ea);}return null;};}function patchUpdates(_0x13fe00){return function(_0x3af6bf){try{jsonpatch[_0x641f('0x22')](_0x3af6bf,_0x13fe00,!![]);}catch(_0x61578b){return BPromise[_0x641f('0x23')](_0x61578b);}return _0x3af6bf['save']();};}function saveUpdates(_0x45af5b,_0xc5df09){return function(_0x274337){if(_0x274337){return _0x274337[_0x641f('0x24')](_0x45af5b)['then'](function(_0x37c91c){return _0x37c91c;});}return null;};}function removeEntity(_0x494b52,_0x2403e1){return function(_0x2e9609){if(_0x2e9609){return _0x2e9609['destroy']()[_0x641f('0x25')](function(){var _0x2596dd=_0x2e9609['get']({'plain':!![]});var _0x1e15d8=_0x641f('0x26');return db[_0x641f('0x27')][_0x641f('0x28')]({'where':{'type':_0x1e15d8,'resourceId':_0x2596dd['id']}})[_0x641f('0x25')](function(){return _0x2e9609;});})[_0x641f('0x25')](function(){_0x494b52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e5ffb,_0x3da248){return function(_0xc9d3f){if(!_0xc9d3f){_0x2e5ffb['sendStatus'](0x194);}return _0xc9d3f;};}function handleError(_0x3997fa,_0x45b6c8){_0x45b6c8=_0x45b6c8||0x1f4;return function(_0x219ff3){logger[_0x641f('0x29')](_0x219ff3['stack']);if(_0x219ff3[_0x641f('0x2a')]){delete _0x219ff3[_0x641f('0x2a')];}_0x3997fa[_0x641f('0x19')](_0x45b6c8)[_0x641f('0x2b')](_0x219ff3);};}exports['index']=function(_0x9d2835,_0x3d87ed){var _0x517579={},_0x5f5b33={},_0x303ca8={'count':0x0,'rows':[]};var _0x2e1140=_[_0x641f('0x2c')](db['Tag'][_0x641f('0x2d')],function(_0x94b753){return{'name':_0x94b753[_0x641f('0x2e')],'type':_0x94b753['type']['key']};});_0x5f5b33[_0x641f('0x2f')]=_[_0x641f('0x2c')](_0x2e1140,_0x641f('0x2a'));_0x5f5b33['query']=_[_0x641f('0x30')](_0x9d2835[_0x641f('0x31')]);_0x5f5b33[_0x641f('0x32')]=_[_0x641f('0x33')](_0x5f5b33[_0x641f('0x2f')],_0x5f5b33['query']);_0x517579[_0x641f('0x34')]=_[_0x641f('0x33')](_0x5f5b33['model'],qs['fields'](_0x9d2835['query'][_0x641f('0x35')]));_0x517579[_0x641f('0x34')]=_0x517579[_0x641f('0x34')]['length']?_0x517579['attributes']:_0x5f5b33[_0x641f('0x2f')];if(!_0x9d2835[_0x641f('0x31')][_0x641f('0x36')](_0x641f('0x37'))){_0x517579[_0x641f('0x1e')]=qs['limit'](_0x9d2835['query'][_0x641f('0x1e')]);_0x517579[_0x641f('0x1c')]=qs[_0x641f('0x1c')](_0x9d2835[_0x641f('0x31')][_0x641f('0x1c')]);}_0x517579['order']=qs['sort'](_0x9d2835['query']['sort']);_0x517579[_0x641f('0x38')]=qs['filters'](_[_0x641f('0x39')](_0x9d2835[_0x641f('0x31')],_0x5f5b33[_0x641f('0x32')]),_0x2e1140);if(_0x9d2835[_0x641f('0x31')][_0x641f('0x3a')]){_0x517579[_0x641f('0x38')]=_[_0x641f('0x3b')](_0x517579[_0x641f('0x38')],{'$or':_[_0x641f('0x2c')](_0x2e1140,function(_0x4d9c7c){if(_0x4d9c7c['type']!==_0x641f('0x3c')){var _0x281e94={};_0x281e94[_0x4d9c7c[_0x641f('0x2a')]]={'$like':'%'+_0x9d2835[_0x641f('0x31')][_0x641f('0x3a')]+'%'};return _0x281e94;}})});}_0x517579=_[_0x641f('0x3b')]({},_0x517579,_0x9d2835[_0x641f('0x3d')]);var _0x2a41f7={'where':_0x517579[_0x641f('0x38')]};return db[_0x641f('0x3e')][_0x641f('0x1f')](_0x2a41f7)[_0x641f('0x25')](function(_0x5d7145){_0x303ca8['count']=_0x5d7145;if(_0x9d2835[_0x641f('0x31')]['includeAll']){_0x517579[_0x641f('0x3f')]=[{'all':!![]}];}return db[_0x641f('0x3e')]['findAll'](_0x517579);})['then'](function(_0x4410ce){_0x303ca8[_0x641f('0x40')]=_0x4410ce;return _0x303ca8;})[_0x641f('0x25')](respondWithFilteredResult(_0x3d87ed,_0x517579))[_0x641f('0x41')](handleError(_0x3d87ed,null));};exports[_0x641f('0x42')]=function(_0x5926a4,_0x1439f9){var _0x2fc3da={'raw':!![],'where':{'id':_0x5926a4[_0x641f('0x43')]['id']}},_0x7339ad={};_0x7339ad[_0x641f('0x2f')]=_['keys'](db['Tag']['rawAttributes']);_0x7339ad[_0x641f('0x31')]=_['keys'](_0x5926a4[_0x641f('0x31')]);_0x7339ad[_0x641f('0x32')]=_['intersection'](_0x7339ad[_0x641f('0x2f')],_0x7339ad['query']);_0x2fc3da[_0x641f('0x34')]=_['intersection'](_0x7339ad[_0x641f('0x2f')],qs['fields'](_0x5926a4[_0x641f('0x31')][_0x641f('0x35')]));_0x2fc3da['attributes']=_0x2fc3da['attributes'][_0x641f('0x44')]?_0x2fc3da['attributes']:_0x7339ad[_0x641f('0x2f')];if(_0x5926a4[_0x641f('0x31')][_0x641f('0x45')]){_0x2fc3da[_0x641f('0x3f')]=[{'all':!![]}];}_0x2fc3da=_[_0x641f('0x3b')]({},_0x2fc3da,_0x5926a4[_0x641f('0x3d')]);return db[_0x641f('0x3e')][_0x641f('0x46')](_0x2fc3da)[_0x641f('0x25')](handleEntityNotFound(_0x1439f9,null))[_0x641f('0x25')](respondWithResult(_0x1439f9,null))[_0x641f('0x41')](handleError(_0x1439f9,null));};exports[_0x641f('0x47')]=function(_0x4ea4d8,_0x375f32){return db[_0x641f('0x3e')][_0x641f('0x47')](_0x4ea4d8[_0x641f('0x48')],{})[_0x641f('0x25')](function(_0x91a601){var _0x265feb=_0x4ea4d8[_0x641f('0x49')][_0x641f('0x4a')]({'plain':!![]});if(!_0x265feb)throw new Error(_0x641f('0x4b'));if(_0x265feb[_0x641f('0x4c')]===_0x641f('0x49')){var _0x580ee7=_0x91a601[_0x641f('0x4a')]({'plain':!![]});var _0xeea2ef=_0x641f('0x26');return db[_0x641f('0x4d')][_0x641f('0x46')]({'where':{'name':_0xeea2ef,'userProfileId':_0x265feb['userProfileId']},'raw':!![]})['then'](function(_0x1f7bd6){if(_0x1f7bd6&&_0x1f7bd6[_0x641f('0x4e')]===0x0){return db[_0x641f('0x27')][_0x641f('0x47')]({'name':_0x580ee7[_0x641f('0x2a')],'resourceId':_0x580ee7['id'],'type':_0x1f7bd6[_0x641f('0x2a')],'sectionId':_0x1f7bd6['id']},{})[_0x641f('0x25')](function(){return _0x91a601;});}else{return _0x91a601;}})['catch'](function(_0x3d5376){logger[_0x641f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5376);throw _0x3d5376;});}return _0x91a601;})['then'](respondWithResult(_0x375f32,0xc9))[_0x641f('0x41')](handleError(_0x375f32,null));};exports[_0x641f('0x24')]=function(_0x1c6da1,_0x231244){if(_0x1c6da1[_0x641f('0x48')]['id']){delete _0x1c6da1[_0x641f('0x48')]['id'];}return db[_0x641f('0x3e')][_0x641f('0x46')]({'where':{'id':_0x1c6da1[_0x641f('0x43')]['id']}})[_0x641f('0x25')](handleEntityNotFound(_0x231244,null))['then'](saveUpdates(_0x1c6da1[_0x641f('0x48')],null))['then'](respondWithResult(_0x231244,null))[_0x641f('0x41')](handleError(_0x231244,null));};exports[_0x641f('0x28')]=function(_0x1ab200,_0x27c844){return db[_0x641f('0x3e')][_0x641f('0x46')]({'where':{'id':_0x1ab200['params']['id']}})['then'](handleEntityNotFound(_0x27c844,null))[_0x641f('0x25')](removeEntity(_0x27c844,null))['catch'](handleError(_0x27c844,null));};exports[_0x641f('0x4f')]=function(_0x128232,_0x45776b){return db[_0x641f('0x3e')][_0x641f('0x4f')]()[_0x641f('0x25')](respondWithResult(_0x45776b,null))[_0x641f('0x41')](handleError(_0x45776b,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 721c631..086f51e 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 _0xda33=['moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x23dc01,_0x141127){var _0x1828d5=function(_0x427b74){while(--_0x427b74){_0x23dc01['push'](_0x23dc01['shift']());}};_0x1828d5(++_0x141127);}(_0xda33,0x1b7));var _0x3da3=function(_0x235da6,_0x2d5e95){_0x235da6=_0x235da6-0x0;var _0x3e758e=_0xda33[_0x235da6];return _0x3e758e;};'use strict';var _=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var logger=require(_0x3da3('0x2'))('api');var moment=require(_0x3da3('0x3'));var BPromise=require(_0x3da3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3da3('0x5'));var rimraf=require(_0x3da3('0x6'));var config=require(_0x3da3('0x7'));var attributes=require(_0x3da3('0x8'));module[_0x3da3('0x9')]=function(_0x2d2317,_0x5633bf){return _0x2d2317[_0x3da3('0xa')](_0x3da3('0xb'),attributes,{'tableName':_0x3da3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabbe=['../../config/environment','./tag.attributes','Tag','tools_tags','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xabbe,0x70));var _0xeabb=function(_0x3ca3fc,_0x307e84){_0x3ca3fc=_0x3ca3fc-0x0;var _0x41c26e=_0xabbe[_0x3ca3fc];return _0x41c26e;};'use strict';var _=require(_0xeabb('0x0'));var util=require('util');var logger=require(_0xeabb('0x1'))('api');var moment=require(_0xeabb('0x2'));var BPromise=require(_0xeabb('0x3'));var rp=require(_0xeabb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeabb('0x5'));var attributes=require(_0xeabb('0x6'));module['exports']=function(_0xfb506,_0x3cb3a4){return _0xfb506['define'](_0xeabb('0x7'),attributes,{'tableName':_0xeabb('0x8'),'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 8fa4935..6a8a276 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 _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x382435,_0x345463){var _0x331886=function(_0x233680){while(--_0x233680){_0x382435['push'](_0x382435['shift']());}};_0x331886(++_0x345463);}(_0x4b19,0x195));var _0x94b1=function(_0x4fdbcf,_0x20f17d){_0x4fdbcf=_0x4fdbcf-0x0;var _0x3ef126=_0x4b19[_0x4fdbcf];return _0x3ef126;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('Tag,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Tag,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x51f941,_0x4ff4be){var _0x536f5f=function(_0x10933f){while(--_0x10933f){_0x51f941['push'](_0x51f941['shift']());}};_0x536f5f(++_0x4ff4be);}(_0xb43b,0x1b2));var _0xbb43=function(_0x30c853,_0x53d943){_0x30c853=_0x30c853-0x0;var _0x2fc231=_0xb43b[_0x30c853];return _0x2fc231;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Tag,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Tag,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Tag,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 6cfa596..b488f41 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 3e4810d..d23f9de 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 _0x0713=['STRING','name'];(function(_0x2620a4,_0x273f67){var _0x5d7dc2=function(_0x27365f){while(--_0x27365f){_0x2620a4['push'](_0x2620a4['shift']());}};_0x5d7dc2(++_0x273f67);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xb7e7,0x121));var _0x7b7e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb7e7[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index d8f4cab..26570f0 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 _0xa162=['redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','Team','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','find','catch','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','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','VoicePrefixId','UserProfileResource','Teams','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','ValidationError','remove','ids','isArray','Chat','Sms','Whatsapp','Voice','through','penalty','QueueId','defaults','TeamVoiceQueue','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','addAgents','removeAgents','Mail','Openchannel','emit','Queue:remove','TeamVoicePrefix','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x3a75a1,_0x18842d){var _0x1f9f87=function(_0x1f21c2){while(--_0x1f21c2){_0x3a75a1['push'](_0x3a75a1['shift']());}};_0x1f9f87(++_0x18842d);}(_0xa162,0x7d));var _0x2a16=function(_0x39cdf2,_0x13d9c7){_0x39cdf2=_0x39cdf2-0x0;var _0x4d7b62=_0xa162[_0x39cdf2];return _0x4d7b62;};'use strict';var emlformat=require(_0x2a16('0x0'));var rimraf=require(_0x2a16('0x1'));var zipdir=require(_0x2a16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a16('0x3'));var moment=require(_0x2a16('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a16('0x5'));var util=require(_0x2a16('0x6'));var path=require('path');var sox=require(_0x2a16('0x7'));var csv=require(_0x2a16('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a16('0x9'));var _=require('lodash');var squel=require(_0x2a16('0xa'));var crypto=require(_0x2a16('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2a16('0xc'));var Papa=require(_0x2a16('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a16('0xe'));var hardwareService=require(_0x2a16('0xf'));var logger=require(_0x2a16('0x10'))(_0x2a16('0x11'));var utils=require('../../config/utils');var config=require(_0x2a16('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a16('0x13'))['db'];config['redis']=_['defaults'](config[_0x2a16('0x14')],{'host':_0x2a16('0x15'),'port':0x18eb});var socket=require(_0x2a16('0x16'))(new Redis(config[_0x2a16('0x14')]));require(_0x2a16('0x17'))['register'](socket);function respondWithStatusCode(_0x5831ab,_0xcd9ac2){_0xcd9ac2=_0xcd9ac2||0xcc;return function(_0x5c42f9){if(_0x5c42f9){return _0x5831ab[_0x2a16('0x18')](_0xcd9ac2);}return _0x5831ab[_0x2a16('0x19')](_0xcd9ac2)[_0x2a16('0x1a')]();};}function respondWithResult(_0x2f5dc1,_0x479063){_0x479063=_0x479063||0xc8;return function(_0x273b93){if(_0x273b93){return _0x2f5dc1[_0x2a16('0x19')](_0x479063)[_0x2a16('0x1b')](_0x273b93);}};}function respondWithFilteredResult(_0x3fb5e2,_0x5a0d92){return function(_0x2b9b41){if(_0x2b9b41){var _0x37ac7f=typeof _0x5a0d92[_0x2a16('0x1c')]==='undefined'&&typeof _0x5a0d92['limit']===_0x2a16('0x1d');var _0x197b8c=_0x2b9b41[_0x2a16('0x1e')];var _0x5278d8=_0x37ac7f?0x0:_0x5a0d92[_0x2a16('0x1c')];var _0x1ae68b=_0x37ac7f?_0x2b9b41['count']:_0x5a0d92['offset']+_0x5a0d92[_0x2a16('0x1f')];var _0x324a3c;if(_0x1ae68b>=_0x197b8c){_0x1ae68b=_0x197b8c;_0x324a3c=0xc8;}else{_0x324a3c=0xce;}_0x3fb5e2[_0x2a16('0x19')](_0x324a3c);return _0x3fb5e2['set'](_0x2a16('0x20'),_0x5278d8+'-'+_0x1ae68b+'/'+_0x197b8c)[_0x2a16('0x1b')](_0x2b9b41);}return null;};}function patchUpdates(_0x2d2358){return function(_0x370249){try{jsonpatch[_0x2a16('0x21')](_0x370249,_0x2d2358,!![]);}catch(_0x18ac59){return BPromise[_0x2a16('0x22')](_0x18ac59);}return _0x370249['save']();};}function saveUpdates(_0x1a3d34,_0x175320){return function(_0x520a7c){if(_0x520a7c){return _0x520a7c[_0x2a16('0x23')](_0x1a3d34)[_0x2a16('0x24')](function(_0x4c1b12){return _0x4c1b12;});}return null;};}function handleEntityNotFound(_0x22c01f,_0x7085a9){return function(_0x1c68a5){if(!_0x1c68a5){_0x22c01f[_0x2a16('0x18')](0x194);}return _0x1c68a5;};}function handleError(_0x3d39e0,_0x42af70){_0x42af70=_0x42af70||0x1f4;return function(_0x37410a){logger[_0x2a16('0x25')](_0x37410a[_0x2a16('0x26')]);if(_0x37410a[_0x2a16('0x27')]){delete _0x37410a['name'];}_0x3d39e0[_0x2a16('0x19')](_0x42af70)[_0x2a16('0x28')](_0x37410a);};}exports[_0x2a16('0x29')]=function(_0x3ac237,_0x59ed47){var _0x5d1ace={},_0x5e97ca={},_0x1c8a37={'count':0x0,'rows':[]};var _0x4e18b7=_['map'](db[_0x2a16('0x2a')][_0x2a16('0x2b')],function(_0x438688){return{'name':_0x438688['fieldName'],'type':_0x438688[_0x2a16('0x2c')][_0x2a16('0x2d')]};});_0x5e97ca[_0x2a16('0x2e')]=_[_0x2a16('0x2f')](_0x4e18b7,_0x2a16('0x27'));_0x5e97ca['query']=_[_0x2a16('0x30')](_0x3ac237[_0x2a16('0x31')]);_0x5e97ca[_0x2a16('0x32')]=_['intersection'](_0x5e97ca[_0x2a16('0x2e')],_0x5e97ca[_0x2a16('0x31')]);_0x5d1ace['attributes']=_[_0x2a16('0x33')](_0x5e97ca['model'],qs[_0x2a16('0x34')](_0x3ac237[_0x2a16('0x31')][_0x2a16('0x34')]));_0x5d1ace[_0x2a16('0x35')]=_0x5d1ace[_0x2a16('0x35')][_0x2a16('0x36')]?_0x5d1ace[_0x2a16('0x35')]:_0x5e97ca[_0x2a16('0x2e')];if(!_0x3ac237[_0x2a16('0x31')][_0x2a16('0x37')](_0x2a16('0x38'))){_0x5d1ace[_0x2a16('0x1f')]=qs[_0x2a16('0x1f')](_0x3ac237['query']['limit']);_0x5d1ace[_0x2a16('0x1c')]=qs['offset'](_0x3ac237[_0x2a16('0x31')]['offset']);}_0x5d1ace[_0x2a16('0x39')]=qs['sort'](_0x3ac237[_0x2a16('0x31')][_0x2a16('0x3a')]);_0x5d1ace[_0x2a16('0x3b')]=qs[_0x2a16('0x32')](_[_0x2a16('0x3c')](_0x3ac237[_0x2a16('0x31')],_0x5e97ca['filters']),_0x4e18b7);if(_0x3ac237['query'][_0x2a16('0x3d')]){_0x5d1ace[_0x2a16('0x3b')]=_['merge'](_0x5d1ace[_0x2a16('0x3b')],{'$or':_[_0x2a16('0x2f')](_0x4e18b7,function(_0x5506cf){if(_0x5506cf['type']!==_0x2a16('0x3e')){var _0x4edb40={};_0x4edb40[_0x5506cf[_0x2a16('0x27')]]={'$like':'%'+_0x3ac237['query'][_0x2a16('0x3d')]+'%'};return _0x4edb40;}})});}_0x5d1ace=_[_0x2a16('0x3f')]({},_0x5d1ace,_0x3ac237[_0x2a16('0x40')]);var _0x4c6db0={'where':_0x5d1ace[_0x2a16('0x3b')]};return db[_0x2a16('0x2a')][_0x2a16('0x1e')](_0x4c6db0)['then'](function(_0x520037){_0x1c8a37[_0x2a16('0x1e')]=_0x520037;if(_0x3ac237['query'][_0x2a16('0x41')]){_0x5d1ace[_0x2a16('0x42')]=[{'all':!![]}];}return db[_0x2a16('0x2a')][_0x2a16('0x43')](_0x5d1ace);})[_0x2a16('0x24')](function(_0x32baec){_0x1c8a37['rows']=_0x32baec;return _0x1c8a37;})['then'](respondWithFilteredResult(_0x59ed47,_0x5d1ace))['catch'](handleError(_0x59ed47,null));};exports[_0x2a16('0x44')]=function(_0x4ab42e,_0x43a8d7){var _0xde57f0={'raw':![],'where':{'id':_0x4ab42e['params']['id']}},_0x31b33a={};_0x31b33a[_0x2a16('0x2e')]=_[_0x2a16('0x30')](db[_0x2a16('0x2a')][_0x2a16('0x2b')]);_0x31b33a[_0x2a16('0x31')]=_[_0x2a16('0x30')](_0x4ab42e[_0x2a16('0x31')]);_0x31b33a['filters']=_[_0x2a16('0x33')](_0x31b33a[_0x2a16('0x2e')],_0x31b33a[_0x2a16('0x31')]);_0xde57f0[_0x2a16('0x35')]=_[_0x2a16('0x33')](_0x31b33a[_0x2a16('0x2e')],qs['fields'](_0x4ab42e[_0x2a16('0x31')][_0x2a16('0x34')]));_0xde57f0['attributes']=_0xde57f0[_0x2a16('0x35')][_0x2a16('0x36')]?_0xde57f0[_0x2a16('0x35')]:_0x31b33a[_0x2a16('0x2e')];if(_0x4ab42e[_0x2a16('0x31')]['includeAll']){_0xde57f0[_0x2a16('0x42')]=[{'all':!![]}];}_0xde57f0=_[_0x2a16('0x3f')]({},_0xde57f0,_0x4ab42e[_0x2a16('0x40')]);return db[_0x2a16('0x2a')][_0x2a16('0x45')](_0xde57f0)[_0x2a16('0x24')](handleEntityNotFound(_0x43a8d7,null))[_0x2a16('0x24')](respondWithResult(_0x43a8d7,null))[_0x2a16('0x46')](handleError(_0x43a8d7,null));};exports['create']=function(_0x2056e2,_0x102ab2){return db['Team']['create'](_0x2056e2[_0x2a16('0x47')],{})['then'](function(_0x1f5f43){var _0x12e7e0=_0x2056e2[_0x2a16('0x48')][_0x2a16('0x49')]({'plain':!![]});if(!_0x12e7e0)throw new Error(_0x2a16('0x4a'));if(_0x12e7e0[_0x2a16('0x4b')]===_0x2a16('0x48')){var _0x16c08d=_0x1f5f43[_0x2a16('0x49')]({'plain':!![]});var _0x5dfba3='Teams';return db[_0x2a16('0x4c')]['find']({'where':{'name':_0x5dfba3,'userProfileId':_0x12e7e0['userProfileId']},'raw':!![]})[_0x2a16('0x24')](function(_0x5bb827){if(_0x5bb827&&_0x5bb827[_0x2a16('0x4d')]===0x0){return db['UserProfileResource'][_0x2a16('0x4e')]({'name':_0x16c08d[_0x2a16('0x27')],'resourceId':_0x16c08d['id'],'type':_0x5bb827[_0x2a16('0x27')],'sectionId':_0x5bb827['id']},{})['then'](function(){return _0x1f5f43;});}else{return _0x1f5f43;}})[_0x2a16('0x46')](function(_0x53a313){logger['error'](_0x2a16('0x4f'),_0x53a313);throw _0x53a313;});}return _0x1f5f43;})[_0x2a16('0x24')](respondWithResult(_0x102ab2,0xc9))[_0x2a16('0x46')](handleError(_0x102ab2,null));};exports[_0x2a16('0x23')]=function(_0x17f8d3,_0x384457){if(_0x17f8d3[_0x2a16('0x47')]['id']){delete _0x17f8d3[_0x2a16('0x47')]['id'];}return db[_0x2a16('0x2a')][_0x2a16('0x45')]({'where':{'id':_0x17f8d3[_0x2a16('0x50')]['id']}})[_0x2a16('0x24')](handleEntityNotFound(_0x384457,null))[_0x2a16('0x24')](saveUpdates(_0x17f8d3[_0x2a16('0x47')],null))['then'](respondWithResult(_0x384457,null))[_0x2a16('0x46')](handleError(_0x384457,null));};exports[_0x2a16('0x51')]=function(_0x461e9f,_0x143a8a){var _0xdb167b=_0x461e9f[_0x2a16('0x50')]['id'];var _0x1722b1=[];return db[_0x2a16('0x52')][_0x2a16('0x53')](function(_0x4a735f){var _0x7469d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xdb167b;return db[_0x2a16('0x52')][_0x2a16('0x31')](_0x7469d,{'type':db['Sequelize']['QueryTypes'][_0x2a16('0x54')],'raw':!![],'transaction':_0x4a735f})[_0x2a16('0x24')](function(_0x36746c){_0x1722b1=_[_0x2a16('0x2f')](_0x36746c,function(_0x3a2447){return Number(_0x3a2447[_0x2a16('0x55')]);});})[_0x2a16('0x24')](function(){var _0x293141=_0x2a16('0x56')+_0xdb167b;return db['sequelize'][_0x2a16('0x31')](_0x293141,{'type':db[_0x2a16('0x57')][_0x2a16('0x58')][_0x2a16('0x54')],'raw':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x1017fb){var _0x57a488=_['map'](_0x1017fb,function(_0x2360c7){return Number(_0x2360c7[_0x2a16('0x59')]);});return db[_0x2a16('0x5a')][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'VoiceQueueId':{'$in':_0x57a488}},'transaction':_0x4a735f});})['then'](function(){var _0x2b8dfa=_0x2a16('0x5b')+_0xdb167b;return db[_0x2a16('0x52')][_0x2a16('0x31')](_0x2b8dfa,{'type':db[_0x2a16('0x57')][_0x2a16('0x58')][_0x2a16('0x54')],'raw':!![],'transaction':_0x4a735f});})['then'](function(_0x4e1b98){var _0x2b1cde=_[_0x2a16('0x2f')](_0x4e1b98,function(_0x449770){return Number(_0x449770[_0x2a16('0x5c')]);});return db['UserMailQueue'][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'MailQueueId':{'$in':_0x2b1cde}},'transaction':_0x4a735f});})['then'](function(){var _0x5a355b=_0x2a16('0x5d')+_0xdb167b;return db['sequelize']['query'](_0x5a355b,{'type':db[_0x2a16('0x57')][_0x2a16('0x58')][_0x2a16('0x54')],'raw':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x3d0891){var _0x3ca71a=_[_0x2a16('0x2f')](_0x3d0891,function(_0x34c3bc){return Number(_0x34c3bc[_0x2a16('0x5e')]);});return db[_0x2a16('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x1722b1},'SmsQueueId':{'$in':_0x3ca71a}},'transaction':_0x4a735f});})['then'](function(){var _0x1a845a='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xdb167b;return db[_0x2a16('0x52')]['query'](_0x1a845a,{'type':db[_0x2a16('0x57')]['QueryTypes'][_0x2a16('0x54')],'raw':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x25039c){var _0x3496d0=_['map'](_0x25039c,function(_0x58a327){return Number(_0x58a327[_0x2a16('0x60')]);});return db['UserChatQueue'][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'ChatQueueId':{'$in':_0x3496d0}},'transaction':_0x4a735f});})['then'](function(){var _0x3d877d='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0xdb167b;return db['sequelize'][_0x2a16('0x31')](_0x3d877d,{'type':db[_0x2a16('0x57')][_0x2a16('0x58')]['SELECT'],'raw':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x15095d){var _0x49fa85=_['map'](_0x15095d,function(_0x26b395){return Number(_0x26b395['FaxQueueId']);});return db['UserFaxQueue'][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'FaxQueueId':{'$in':_0x49fa85}},'transaction':_0x4a735f});})[_0x2a16('0x24')](function(){var _0x1be829=_0x2a16('0x61')+_0xdb167b;return db[_0x2a16('0x52')]['query'](_0x1be829,{'type':db['Sequelize'][_0x2a16('0x58')]['SELECT'],'raw':!![],'transaction':_0x4a735f});})['then'](function(_0x53eddf){var _0x439035=_[_0x2a16('0x2f')](_0x53eddf,function(_0x2a7371){return Number(_0x2a7371['OpenchannelQueueId']);});return db[_0x2a16('0x62')][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'OpenchannelQueueId':{'$in':_0x439035}},'transaction':_0x4a735f});})[_0x2a16('0x24')](function(){var _0xe3ff57=_0x2a16('0x63')+_0xdb167b;return db['sequelize'][_0x2a16('0x31')](_0xe3ff57,{'type':db['Sequelize'][_0x2a16('0x58')]['SELECT'],'raw':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x5d16b5){var _0x23119b=_[_0x2a16('0x2f')](_0x5d16b5,function(_0x2cad89){return Number(_0x2cad89[_0x2a16('0x64')]);});return db[_0x2a16('0x65')][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'WhatsappQueueId':{'$in':_0x23119b}},'transaction':_0x4a735f});})['then'](function(){return db['TeamVoicePrefix'][_0x2a16('0x45')]({'where':{'TeamId':_0xdb167b}});})['then'](function(_0x195428){if(_0x195428===null){return;}return db['UserVoicePrefix'][_0x2a16('0x51')]({'where':{'UserId':{'$in':_0x1722b1},'VoicePrefixId':_0x195428[_0x2a16('0x66')]},'transaction':_0x4a735f});})[_0x2a16('0x24')](function(){return db[_0x2a16('0x2a')][_0x2a16('0x51')]({'where':{'id':_0xdb167b},'cascade':!![],'transaction':_0x4a735f});})[_0x2a16('0x24')](function(_0x3c0baf){if(_0x3c0baf===0x0){_0x143a8a[_0x2a16('0x18')](0x194);}else{return db[_0x2a16('0x67')][_0x2a16('0x51')]({'where':{'type':_0x2a16('0x68'),'resourceId':_0xdb167b},'cascade':!![],'transaction':_0x4a735f})[_0x2a16('0x24')](function(){_0x143a8a[_0x2a16('0x19')](0xcc)[_0x2a16('0x1a')]();});}})[_0x2a16('0x46')](function(_0x1a60ce){_0x143a8a[_0x2a16('0x19')](0x1f4)[_0x2a16('0x28')](_0x1a60ce);});});};exports['getQueues']=function(_0x56b767,_0x288084,_0x3bdbf7){return db[_0x2a16('0x2a')][_0x2a16('0x69')]({'where':{'id':_0x56b767['params']['id']}})[_0x2a16('0x24')](handleEntityNotFound(_0x288084,null))[_0x2a16('0x24')](function(_0x2080a6){if(!_0x56b767[_0x2a16('0x31')][_0x2a16('0x6a')]||!utils[_0x2a16('0x6b')](_0x56b767[_0x2a16('0x31')][_0x2a16('0x6a')])){throw new db['Sequelize']['ValidationError'](_0x2a16('0x6c'));}var _0x2de01c={};var _0x58a793={};_0x58a793[_0x2a16('0x2e')]=_[_0x2a16('0x30')](db[_[_0x2a16('0x6d')](_0x56b767['query'][_0x2a16('0x6a')][_0x2a16('0x6e')]())+_0x2a16('0x6f')][_0x2a16('0x2b')]);_0x58a793['query']=_['keys'](_0x56b767[_0x2a16('0x31')]);_0x58a793[_0x2a16('0x32')]=_[_0x2a16('0x33')](_0x58a793[_0x2a16('0x2e')],_0x58a793[_0x2a16('0x31')]);_0x2de01c[_0x2a16('0x35')]=_[_0x2a16('0x33')](_0x58a793[_0x2a16('0x2e')],qs[_0x2a16('0x34')](_0x56b767['query'][_0x2a16('0x34')]));_0x2de01c['attributes']=_0x2de01c['attributes'][_0x2a16('0x36')]?_0x2de01c[_0x2a16('0x35')]:_0x58a793[_0x2a16('0x2e')];_0x2de01c['limit']=qs[_0x2a16('0x1f')](_0x56b767[_0x2a16('0x31')][_0x2a16('0x1f')]);_0x2de01c[_0x2a16('0x1c')]=qs[_0x2a16('0x1c')](_0x56b767[_0x2a16('0x31')][_0x2a16('0x1c')]);_0x2de01c['order']=qs[_0x2a16('0x3a')](_0x56b767['query'][_0x2a16('0x3a')]);_0x2de01c[_0x2a16('0x3b')]=qs[_0x2a16('0x32')](_['pick'](_0x56b767[_0x2a16('0x31')],_0x58a793['filters']));_0x2de01c=_[_0x2a16('0x3f')]({},_0x2de01c,_0x56b767['options']);return _0x2080a6[_0x2a16('0x49')+_['capitalize'](_0x56b767[_0x2a16('0x31')][_0x2a16('0x6a')]['toLowerCase']())+_0x2a16('0x70')](_0x2de01c);})['then'](respondWithResult(_0x288084,null))[_0x2a16('0x46')](handleError(_0x288084,null));};exports['addQueues']=function(_0x461732,_0xab3904,_0x957cd1){return db[_0x2a16('0x2a')][_0x2a16('0x69')]({'where':{'id':_0x461732[_0x2a16('0x50')]['id']}})[_0x2a16('0x24')](function(_0x21535c){if(_0x21535c){if(!_0x461732[_0x2a16('0x47')][_0x2a16('0x6a')]||!utils[_0x2a16('0x6b')](_0x461732[_0x2a16('0x47')][_0x2a16('0x6a')])){throw new db[(_0x2a16('0x57'))]['ValidationError'](_0x2a16('0x6c'));}return _0x21535c['add'+_['capitalize'](_0x461732['body']['channel'][_0x2a16('0x6e')]())+_0x2a16('0x70')](_0x461732[_0x2a16('0x47')]['ids']);}return null;})[_0x2a16('0x24')](handleEntityNotFound(_0xab3904,null))[_0x2a16('0x24')](respondWithStatusCode(_0xab3904,null))[_0x2a16('0x46')](handleError(_0xab3904,null));};exports['removeQueues']=function(_0x2c3bde,_0x49cc59,_0x5507cc){return db['Team'][_0x2a16('0x69')]({'where':{'id':_0x2c3bde[_0x2a16('0x50')]['id']}})[_0x2a16('0x24')](function(_0x4267f5){if(_0x4267f5){if(!_0x2c3bde['query'][_0x2a16('0x6a')]||!utils[_0x2a16('0x6b')](_0x2c3bde[_0x2a16('0x31')][_0x2a16('0x6a')])){throw new db[(_0x2a16('0x57'))][(_0x2a16('0x71'))]('Unknown\x20channel');}return _0x4267f5[_0x2a16('0x72')+_[_0x2a16('0x6d')](_0x2c3bde[_0x2a16('0x31')][_0x2a16('0x6a')][_0x2a16('0x6e')]())+_0x2a16('0x70')](_0x2c3bde[_0x2a16('0x31')][_0x2a16('0x73')]);}return null;})[_0x2a16('0x24')](handleEntityNotFound(_0x49cc59,null))['then'](respondWithStatusCode(_0x49cc59,null))[_0x2a16('0x46')](handleError(_0x49cc59,null));};exports['addAgents']=function(_0x48d623,_0xe258a7){var _0x23e99c=_[_0x2a16('0x74')](_0x48d623[_0x2a16('0x47')][_0x2a16('0x73')])?_0x48d623[_0x2a16('0x47')]['ids']:[_0x48d623[_0x2a16('0x47')][_0x2a16('0x73')]];var _0xf89206=_0x48d623[_0x2a16('0x50')]['id'];return db['Team']['find']({'where':{'id':_0xf89206}})[_0x2a16('0x24')](handleEntityNotFound(_0xe258a7,null))[_0x2a16('0x24')](function(_0x1e30ac){if(_0x1e30ac){var _0x15a3be=['Voice',_0x2a16('0x75'),'Mail',_0x2a16('0x76'),'Fax','Openchannel',_0x2a16('0x77')];return db[_0x2a16('0x52')]['transaction'](function(_0xe21266){var _0x308330=_[_0x2a16('0x2f')](_0x15a3be,function(_0x1c6d51){var _0x1b4560={'attributes':['id',_0x2a16('0x27')]};if(_0x1c6d51===_0x2a16('0x78')){_0x1b4560[_0x2a16('0x79')]={'attributes':[_0x2a16('0x7a')]};}return _0x1e30ac[_0x2a16('0x49')+_0x1c6d51+_0x2a16('0x70')](_0x1b4560)['then'](function(_0x390ffd){var _0x5eb633=_[_0x2a16('0x2f')](_0x390ffd,function(_0x445df1){var _0x211ace=_[_0x2a16('0x2f')](_0x23e99c,function(_0x39b462){var _0x3a9fc3={'where':{'UserId':_0x39b462,[_0x1c6d51+_0x2a16('0x7b')]:_0x445df1['id']},'transaction':_0xe21266};if(_0x1c6d51==='Voice'){_0x3a9fc3[_0x2a16('0x7c')]={'penalty':_0x445df1[_0x2a16('0x7d')][_0x2a16('0x7a')]};}return db['User'+_0x1c6d51+_0x2a16('0x6f')]['findOrCreate'](_0x3a9fc3)['then'](function(){socket['emit'](_0x2a16('0x48')+_0x1c6d51+_0x2a16('0x7e'),{'UserId':_0x39b462,[_0x1c6d51+_0x2a16('0x7b')]:_0x445df1['id']});if(_0x1c6d51!==_0x2a16('0x78')){return;}return db['User'][_0x2a16('0x43')]({'where':{'id':_0x23e99c,'online':0x1},'attributes':['id',_0x2a16('0x27'),'online',_0x2a16('0x7f'),_0x2a16('0x80')],'raw':!![]})[_0x2a16('0x24')](function(_0x349965){var _0x189391=_[_0x2a16('0x2f')](_0x349965,function(_0x2ce00f){return db[_0x2a16('0x81')][_0x2a16('0x82')]({'membername':_0x2ce00f[_0x2a16('0x27')],'UserId':_0x2ce00f['id'],'queue_name':_0x445df1[_0x2a16('0x27')],'VoiceQueueId':_0x445df1['id'],'interface':_[_0x2a16('0x83')](_0x2ce00f[_0x2a16('0x80')])?util[_0x2a16('0x84')](_0x2a16('0x85'),_0x2ce00f[_0x2a16('0x27')]):_0x2ce00f[_0x2a16('0x80')],'paused':_0x2ce00f['voicePause']||![],'penalty':_0x445df1[_0x2a16('0x7d')][_0x2a16('0x7a')]},{'transaction':_0xe21266});});return Promise[_0x2a16('0x86')](_0x189391);});});});return Promise[_0x2a16('0x86')](_0x211ace);});return Promise['all'](_0x5eb633);})[_0x2a16('0x24')](function(){return db['TeamVoicePrefix'][_0x2a16('0x69')]({'where':{'teamId':_0xf89206}})[_0x2a16('0x24')](function(_0x3fdfbb){if(_0x3fdfbb){var _0x249665=_[_0x2a16('0x2f')](_0x23e99c,function(_0x4e23ef){db[_0x2a16('0x87')][_0x2a16('0x82')]({'UserId':_0x4e23ef,'VoicePrefixId':_0x3fdfbb[_0x2a16('0x66')]});});return Promise[_0x2a16('0x86')](_0x249665);}});});});return Promise[_0x2a16('0x86')](_0x308330)[_0x2a16('0x24')](function(){return _0x1e30ac[_0x2a16('0x88')](_0x23e99c,{'transaction':_0xe21266})['spread'](function(_0x575558){return _0x575558;});});});}})[_0x2a16('0x24')](respondWithResult(_0xe258a7,null))[_0x2a16('0x46')](handleError(_0xe258a7,null));};exports[_0x2a16('0x89')]=function(_0x36f874,_0x5e8e26){var _0x30a1f2=_[_0x2a16('0x74')](_0x36f874[_0x2a16('0x31')][_0x2a16('0x73')])?_0x36f874[_0x2a16('0x31')][_0x2a16('0x73')]:[_0x36f874[_0x2a16('0x31')][_0x2a16('0x73')]];var _0x555dfc=_0x36f874['params']['id'];return db['Team'][_0x2a16('0x45')]({'where':{'id':_0x555dfc}})[_0x2a16('0x24')](handleEntityNotFound(_0x5e8e26,null))['then'](function(_0x2c64cf){if(_0x2c64cf){var _0x165dc1=['Voice',_0x2a16('0x75'),_0x2a16('0x8a'),_0x2a16('0x76'),'Fax',_0x2a16('0x8b'),'Whatsapp'];return db[_0x2a16('0x52')]['transaction'](function(_0x18b31c){var _0x34affc=_['map'](_0x165dc1,function(_0x28b263){var _0x15be32={'attributes':['id',_0x2a16('0x27')]};return _0x2c64cf['get'+_0x28b263+_0x2a16('0x70')](_0x15be32)[_0x2a16('0x24')](function(_0x3d5efe){var _0x1e1b23=_['map'](_0x3d5efe,function(_0x519daa){return _0x519daa[_0x2a16('0x89')](_0x30a1f2,{'transaction':_0x18b31c})[_0x2a16('0x24')](function(){var _0x3da648=_[_0x2a16('0x2f')](_0x30a1f2,function(_0x22acc2){socket[_0x2a16('0x8c')](_0x2a16('0x48')+_0x28b263+_0x2a16('0x8d'),{'UserId':Number(_0x22acc2),[_0x28b263+_0x2a16('0x7b')]:_0x519daa['id']});if(_0x28b263!==_0x2a16('0x78')){return;}return db[_0x2a16('0x81')][_0x2a16('0x51')]({'where':{'VoiceQueueId':_0x519daa['id'],'UserId':_0x22acc2},'transaction':_0x18b31c});});return Promise[_0x2a16('0x86')](_0x3da648);});});return Promise['all'](_0x1e1b23);});});return Promise[_0x2a16('0x86')](_0x34affc)[_0x2a16('0x24')](function(){return _0x2c64cf[_0x2a16('0x89')](_0x30a1f2,{'transaction':_0x18b31c});})[_0x2a16('0x24')](function(){return db[_0x2a16('0x8e')][_0x2a16('0x69')]({'where':{'teamId':_0x555dfc}})[_0x2a16('0x24')](function(_0x6f9baf){if(_0x6f9baf){var _0x31c62f=_[_0x2a16('0x2f')](_0x30a1f2,function(_0x1f3193){db[_0x2a16('0x87')][_0x2a16('0x51')]({'where':{'UserId':_0x1f3193,'VoicePrefixId':_0x6f9baf[_0x2a16('0x66')]}});});return Promise[_0x2a16('0x86')](_0x31c62f);}});});});}})['then'](respondWithStatusCode(_0x5e8e26,null))[_0x2a16('0x46')](handleError(_0x5e8e26,null));};exports[_0x2a16('0x8f')]=function(_0x19ac32,_0x130b0e,_0x26c5d7){var _0x3245c3={};var _0x5df080={};var _0x143031;var _0x5d272e;return db[_0x2a16('0x2a')][_0x2a16('0x69')]({'where':{'id':_0x19ac32[_0x2a16('0x50')]['id']}})['then'](handleEntityNotFound(_0x130b0e,null))[_0x2a16('0x24')](function(_0x1d19a3){if(_0x1d19a3){_0x143031=_0x1d19a3;_0x5df080['model']=_[_0x2a16('0x30')](db[_0x2a16('0x90')]['rawAttributes']);_0x5df080[_0x2a16('0x31')]=_[_0x2a16('0x30')](_0x19ac32[_0x2a16('0x31')]);_0x5df080[_0x2a16('0x32')]=_[_0x2a16('0x33')](_0x5df080[_0x2a16('0x2e')],_0x5df080[_0x2a16('0x31')]);_0x3245c3[_0x2a16('0x35')]=_[_0x2a16('0x33')](_0x5df080[_0x2a16('0x2e')],qs['fields'](_0x19ac32[_0x2a16('0x31')][_0x2a16('0x34')]));_0x3245c3[_0x2a16('0x35')]=_0x3245c3['attributes'][_0x2a16('0x36')]?_0x3245c3[_0x2a16('0x35')]:_0x5df080[_0x2a16('0x2e')];_0x3245c3[_0x2a16('0x39')]=qs[_0x2a16('0x3a')](_0x19ac32[_0x2a16('0x31')][_0x2a16('0x3a')]);_0x3245c3['where']=qs[_0x2a16('0x32')](_[_0x2a16('0x3c')](_0x19ac32[_0x2a16('0x31')],_0x5df080[_0x2a16('0x32')]));if(_0x19ac32[_0x2a16('0x31')][_0x2a16('0x3d')]){_0x3245c3[_0x2a16('0x3b')]=_[_0x2a16('0x3f')](_0x3245c3['where'],{'$or':_['map'](_0x3245c3[_0x2a16('0x35')],function(_0x4a7850){var _0x4b04b2={};_0x4b04b2[_0x4a7850]={'$like':'%'+_0x19ac32[_0x2a16('0x31')]['filter']+'%'};return _0x4b04b2;})});}_0x3245c3=_[_0x2a16('0x3f')]({},_0x3245c3,_0x19ac32[_0x2a16('0x40')]);return _0x143031[_0x2a16('0x8f')](_0x3245c3);}})['then'](function(_0x4516ce){if(_0x4516ce){_0x5d272e=_0x4516ce[_0x2a16('0x36')];if(!_0x19ac32[_0x2a16('0x31')][_0x2a16('0x37')](_0x2a16('0x38'))){_0x3245c3[_0x2a16('0x1f')]=qs[_0x2a16('0x1f')](_0x19ac32['query']['limit']);_0x3245c3[_0x2a16('0x1c')]=qs['offset'](_0x19ac32[_0x2a16('0x31')][_0x2a16('0x1c')]);}return _0x143031['getAgents'](_0x3245c3);}})[_0x2a16('0x24')](function(_0x32b8c1){if(_0x32b8c1){return _0x32b8c1?{'count':_0x5d272e,'rows':_0x32b8c1}:null;}})[_0x2a16('0x24')](respondWithResult(_0x130b0e,null))[_0x2a16('0x46')](handleError(_0x130b0e,null));}; \ No newline at end of file +var _0x750d=['emit','Queue:save','User','findAll','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','UserVoicePrefix','spread','removeAgents','Whatsapp','transaction','Queue:remove','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','error','stack','name','send','Team','rawAttributes','fieldName','key','map','query','filters','model','attributes','intersection','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','params','keys','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','order','addQueues','Unknown\x20channel','Queues','ids','removeQueues','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','Voice','through','QueueId','TeamVoiceQueue','penalty','Queue','findOrCreate'];(function(_0x354298,_0x1e6d78){var _0x3956ad=function(_0x26158c){while(--_0x26158c){_0x354298['push'](_0x354298['shift']());}};_0x3956ad(++_0x1e6d78);}(_0x750d,0x157));var _0xd750=function(_0x167464,_0x4a0a6a){_0x167464=_0x167464-0x0;var _0x55e3bc=_0x750d[_0x167464];return _0x55e3bc;};'use strict';var emlformat=require(_0xd750('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd750('0x1'));var jsonpatch=require(_0xd750('0x2'));var rp=require(_0xd750('0x3'));var moment=require(_0xd750('0x4'));var BPromise=require(_0xd750('0x5'));var Mustache=require(_0xd750('0x6'));var util=require(_0xd750('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd750('0x8'));var fs=require('fs');var fs_extra=require(_0xd750('0x9'));var _=require(_0xd750('0xa'));var squel=require(_0xd750('0xb'));var crypto=require(_0xd750('0xc'));var jsforce=require(_0xd750('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd750('0xe'));var querystring=require(_0xd750('0xf'));var Papa=require(_0xd750('0x10'));var Redis=require('ioredis');var authService=require(_0xd750('0x11'));var qs=require(_0xd750('0x12'));var as=require(_0xd750('0x13'));var hardwareService=require(_0xd750('0x14'));var logger=require(_0xd750('0x15'))(_0xd750('0x16'));var utils=require(_0xd750('0x17'));var config=require(_0xd750('0x18'));var licenseUtil=require(_0xd750('0x19'));var db=require(_0xd750('0x1a'))['db'];config[_0xd750('0x1b')]=_[_0xd750('0x1c')](config[_0xd750('0x1b')],{'host':_0xd750('0x1d'),'port':0x18eb});var socket=require(_0xd750('0x1e'))(new Redis(config[_0xd750('0x1b')]));require(_0xd750('0x1f'))['register'](socket);function respondWithStatusCode(_0x216dc1,_0x17c214){_0x17c214=_0x17c214||0xcc;return function(_0x1817b6){if(_0x1817b6){return _0x216dc1[_0xd750('0x20')](_0x17c214);}return _0x216dc1[_0xd750('0x21')](_0x17c214)['end']();};}function respondWithResult(_0x57f5ea,_0x25232e){_0x25232e=_0x25232e||0xc8;return function(_0x46db09){if(_0x46db09){return _0x57f5ea[_0xd750('0x21')](_0x25232e)[_0xd750('0x22')](_0x46db09);}};}function respondWithFilteredResult(_0x2c334b,_0x5814dc){return function(_0x567505){if(_0x567505){var _0x1edcc5=typeof _0x5814dc[_0xd750('0x23')]===_0xd750('0x24')&&typeof _0x5814dc['limit']===_0xd750('0x24');var _0x30cb62=_0x567505[_0xd750('0x25')];var _0x2c1a47=_0x1edcc5?0x0:_0x5814dc['offset'];var _0x561786=_0x1edcc5?_0x567505['count']:_0x5814dc['offset']+_0x5814dc[_0xd750('0x26')];var _0xa49561;if(_0x561786>=_0x30cb62){_0x561786=_0x30cb62;_0xa49561=0xc8;}else{_0xa49561=0xce;}_0x2c334b['status'](_0xa49561);return _0x2c334b[_0xd750('0x27')](_0xd750('0x28'),_0x2c1a47+'-'+_0x561786+'/'+_0x30cb62)['json'](_0x567505);}return null;};}function patchUpdates(_0x1e1cc7){return function(_0x1de2bf){try{jsonpatch['apply'](_0x1de2bf,_0x1e1cc7,!![]);}catch(_0xac2687){return BPromise[_0xd750('0x29')](_0xac2687);}return _0x1de2bf[_0xd750('0x2a')]();};}function saveUpdates(_0x28f0b9,_0x59a7c5){return function(_0x3c83bf){if(_0x3c83bf){return _0x3c83bf[_0xd750('0x2b')](_0x28f0b9)['then'](function(_0xad4408){return _0xad4408;});}return null;};}function handleEntityNotFound(_0x2122a2,_0x352484){return function(_0x495720){if(!_0x495720){_0x2122a2[_0xd750('0x20')](0x194);}return _0x495720;};}function handleError(_0x12d2b5,_0x1179b4){_0x1179b4=_0x1179b4||0x1f4;return function(_0x18ebda){logger[_0xd750('0x2c')](_0x18ebda[_0xd750('0x2d')]);if(_0x18ebda[_0xd750('0x2e')]){delete _0x18ebda['name'];}_0x12d2b5[_0xd750('0x21')](_0x1179b4)[_0xd750('0x2f')](_0x18ebda);};}exports['index']=function(_0x3a003f,_0x4954f5){var _0x59a3b3={},_0x14a441={},_0x433a11={'count':0x0,'rows':[]};var _0x390875=_['map'](db[_0xd750('0x30')][_0xd750('0x31')],function(_0x2b5497){return{'name':_0x2b5497[_0xd750('0x32')],'type':_0x2b5497['type'][_0xd750('0x33')]};});_0x14a441['model']=_[_0xd750('0x34')](_0x390875,_0xd750('0x2e'));_0x14a441['query']=_['keys'](_0x3a003f[_0xd750('0x35')]);_0x14a441[_0xd750('0x36')]=_['intersection'](_0x14a441[_0xd750('0x37')],_0x14a441[_0xd750('0x35')]);_0x59a3b3[_0xd750('0x38')]=_[_0xd750('0x39')](_0x14a441[_0xd750('0x37')],qs['fields'](_0x3a003f[_0xd750('0x35')]['fields']));_0x59a3b3[_0xd750('0x38')]=_0x59a3b3[_0xd750('0x38')][_0xd750('0x3a')]?_0x59a3b3[_0xd750('0x38')]:_0x14a441[_0xd750('0x37')];if(!_0x3a003f[_0xd750('0x35')][_0xd750('0x3b')]('nolimit')){_0x59a3b3['limit']=qs[_0xd750('0x26')](_0x3a003f[_0xd750('0x35')][_0xd750('0x26')]);_0x59a3b3[_0xd750('0x23')]=qs[_0xd750('0x23')](_0x3a003f['query'][_0xd750('0x23')]);}_0x59a3b3['order']=qs[_0xd750('0x3c')](_0x3a003f[_0xd750('0x35')][_0xd750('0x3c')]);_0x59a3b3[_0xd750('0x3d')]=qs[_0xd750('0x36')](_[_0xd750('0x3e')](_0x3a003f[_0xd750('0x35')],_0x14a441[_0xd750('0x36')]),_0x390875);if(_0x3a003f[_0xd750('0x35')]['filter']){_0x59a3b3[_0xd750('0x3d')]=_[_0xd750('0x3f')](_0x59a3b3[_0xd750('0x3d')],{'$or':_['map'](_0x390875,function(_0x369527){if(_0x369527[_0xd750('0x40')]!==_0xd750('0x41')){var _0x23d658={};_0x23d658[_0x369527[_0xd750('0x2e')]]={'$like':'%'+_0x3a003f[_0xd750('0x35')][_0xd750('0x42')]+'%'};return _0x23d658;}})});}_0x59a3b3=_[_0xd750('0x3f')]({},_0x59a3b3,_0x3a003f[_0xd750('0x43')]);var _0xb71e82={'where':_0x59a3b3['where']};return db[_0xd750('0x30')][_0xd750('0x25')](_0xb71e82)[_0xd750('0x44')](function(_0x5db04d){_0x433a11['count']=_0x5db04d;if(_0x3a003f[_0xd750('0x35')][_0xd750('0x45')]){_0x59a3b3[_0xd750('0x46')]=[{'all':!![]}];}return db['Team']['findAll'](_0x59a3b3);})[_0xd750('0x44')](function(_0x2d2ab5){_0x433a11[_0xd750('0x47')]=_0x2d2ab5;return _0x433a11;})[_0xd750('0x44')](respondWithFilteredResult(_0x4954f5,_0x59a3b3))[_0xd750('0x48')](handleError(_0x4954f5,null));};exports[_0xd750('0x49')]=function(_0x1a43a2,_0x334105){var _0x386974={'raw':![],'where':{'id':_0x1a43a2[_0xd750('0x4a')]['id']}},_0x1c242c={};_0x1c242c['model']=_[_0xd750('0x4b')](db[_0xd750('0x30')][_0xd750('0x31')]);_0x1c242c[_0xd750('0x35')]=_['keys'](_0x1a43a2[_0xd750('0x35')]);_0x1c242c[_0xd750('0x36')]=_['intersection'](_0x1c242c[_0xd750('0x37')],_0x1c242c[_0xd750('0x35')]);_0x386974[_0xd750('0x38')]=_[_0xd750('0x39')](_0x1c242c['model'],qs['fields'](_0x1a43a2[_0xd750('0x35')][_0xd750('0x4c')]));_0x386974[_0xd750('0x38')]=_0x386974['attributes'][_0xd750('0x3a')]?_0x386974['attributes']:_0x1c242c[_0xd750('0x37')];if(_0x1a43a2[_0xd750('0x35')][_0xd750('0x45')]){_0x386974['include']=[{'all':!![]}];}_0x386974=_[_0xd750('0x3f')]({},_0x386974,_0x1a43a2['options']);return db[_0xd750('0x30')][_0xd750('0x4d')](_0x386974)['then'](handleEntityNotFound(_0x334105,null))[_0xd750('0x44')](respondWithResult(_0x334105,null))[_0xd750('0x48')](handleError(_0x334105,null));};exports[_0xd750('0x4e')]=function(_0x5fd4f4,_0x3f3313){return db[_0xd750('0x30')]['create'](_0x5fd4f4[_0xd750('0x4f')],{})[_0xd750('0x44')](function(_0x401bc3){var _0xd62ba0=_0x5fd4f4['user'][_0xd750('0x50')]({'plain':!![]});if(!_0xd62ba0)throw new Error(_0xd750('0x51'));if(_0xd62ba0[_0xd750('0x52')]===_0xd750('0x53')){var _0x969c04=_0x401bc3[_0xd750('0x50')]({'plain':!![]});var _0x2a42d6='Teams';return db[_0xd750('0x54')][_0xd750('0x4d')]({'where':{'name':_0x2a42d6,'userProfileId':_0xd62ba0[_0xd750('0x55')]},'raw':!![]})[_0xd750('0x44')](function(_0x34f89c){if(_0x34f89c&&_0x34f89c[_0xd750('0x56')]===0x0){return db['UserProfileResource'][_0xd750('0x4e')]({'name':_0x969c04[_0xd750('0x2e')],'resourceId':_0x969c04['id'],'type':_0x34f89c[_0xd750('0x2e')],'sectionId':_0x34f89c['id']},{})['then'](function(){return _0x401bc3;});}else{return _0x401bc3;}})[_0xd750('0x48')](function(_0x47eefc){logger[_0xd750('0x2c')](_0xd750('0x57'),_0x47eefc);throw _0x47eefc;});}return _0x401bc3;})[_0xd750('0x44')](respondWithResult(_0x3f3313,0xc9))[_0xd750('0x48')](handleError(_0x3f3313,null));};exports['update']=function(_0xf343b6,_0x428e9a){if(_0xf343b6['body']['id']){delete _0xf343b6[_0xd750('0x4f')]['id'];}return db[_0xd750('0x30')][_0xd750('0x4d')]({'where':{'id':_0xf343b6[_0xd750('0x4a')]['id']}})[_0xd750('0x44')](handleEntityNotFound(_0x428e9a,null))[_0xd750('0x44')](saveUpdates(_0xf343b6['body'],null))[_0xd750('0x44')](respondWithResult(_0x428e9a,null))[_0xd750('0x48')](handleError(_0x428e9a,null));};exports[_0xd750('0x58')]=function(_0x55f6d5,_0x54f9de){var _0x2adab6=_0x55f6d5[_0xd750('0x4a')]['id'];var _0x1b527a=[];return db['sequelize']['transaction'](function(_0x424b61){var _0x4328ff=_0xd750('0x59')+_0x2adab6;return db[_0xd750('0x5a')][_0xd750('0x35')](_0x4328ff,{'type':db[_0xd750('0x5b')]['QueryTypes'][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61})['then'](function(_0x4c317f){_0x1b527a=_[_0xd750('0x34')](_0x4c317f,function(_0x1fbd07){return Number(_0x1fbd07[_0xd750('0x5d')]);});})[_0xd750('0x44')](function(){var _0x289ac3=_0xd750('0x5e')+_0x2adab6;return db['sequelize'][_0xd750('0x35')](_0x289ac3,{'type':db[_0xd750('0x5b')][_0xd750('0x5f')]['SELECT'],'raw':!![],'transaction':_0x424b61});})['then'](function(_0x35b238){var _0x57326d=_[_0xd750('0x34')](_0x35b238,function(_0x53f7ad){return Number(_0x53f7ad[_0xd750('0x60')]);});return db[_0xd750('0x61')][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'VoiceQueueId':{'$in':_0x57326d}},'transaction':_0x424b61});})['then'](function(){var _0x189d5d=_0xd750('0x62')+_0x2adab6;return db[_0xd750('0x5a')][_0xd750('0x35')](_0x189d5d,{'type':db[_0xd750('0x5b')][_0xd750('0x5f')][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x3e5f9e){var _0x2699da=_[_0xd750('0x34')](_0x3e5f9e,function(_0x4d025d){return Number(_0x4d025d['MailQueueId']);});return db[_0xd750('0x63')]['destroy']({'where':{'UserId':{'$in':_0x1b527a},'MailQueueId':{'$in':_0x2699da}},'transaction':_0x424b61});})[_0xd750('0x44')](function(){var _0x547d1e='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2adab6;return db['sequelize'][_0xd750('0x35')](_0x547d1e,{'type':db[_0xd750('0x5b')][_0xd750('0x5f')][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x2a6f62){var _0x1eff0a=_[_0xd750('0x34')](_0x2a6f62,function(_0x4e3037){return Number(_0x4e3037[_0xd750('0x64')]);});return db['UserSmsQueue'][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'SmsQueueId':{'$in':_0x1eff0a}},'transaction':_0x424b61});})['then'](function(){var _0x1a8ccd=_0xd750('0x65')+_0x2adab6;return db['sequelize'][_0xd750('0x35')](_0x1a8ccd,{'type':db[_0xd750('0x5b')][_0xd750('0x5f')][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x20c6f1){var _0x5d6eaf=_[_0xd750('0x34')](_0x20c6f1,function(_0x379035){return Number(_0x379035[_0xd750('0x66')]);});return db[_0xd750('0x67')][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'ChatQueueId':{'$in':_0x5d6eaf}},'transaction':_0x424b61});})[_0xd750('0x44')](function(){var _0x5bb23a=_0xd750('0x68')+_0x2adab6;return db[_0xd750('0x5a')][_0xd750('0x35')](_0x5bb23a,{'type':db['Sequelize'][_0xd750('0x5f')][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x3b6ddd){var _0x27fb17=_[_0xd750('0x34')](_0x3b6ddd,function(_0x27a30e){return Number(_0x27a30e[_0xd750('0x69')]);});return db[_0xd750('0x6a')][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'FaxQueueId':{'$in':_0x27fb17}},'transaction':_0x424b61});})['then'](function(){var _0x880e12=_0xd750('0x6b')+_0x2adab6;return db[_0xd750('0x5a')]['query'](_0x880e12,{'type':db[_0xd750('0x5b')]['QueryTypes'][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x4c2acb){var _0x590198=_['map'](_0x4c2acb,function(_0x90bdf7){return Number(_0x90bdf7[_0xd750('0x6c')]);});return db[_0xd750('0x6d')][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'OpenchannelQueueId':{'$in':_0x590198}},'transaction':_0x424b61});})[_0xd750('0x44')](function(){var _0xd58f38=_0xd750('0x6e')+_0x2adab6;return db[_0xd750('0x5a')][_0xd750('0x35')](_0xd58f38,{'type':db['Sequelize']['QueryTypes'][_0xd750('0x5c')],'raw':!![],'transaction':_0x424b61});})[_0xd750('0x44')](function(_0x59089e){var _0xf70e6d=_['map'](_0x59089e,function(_0x5a53b7){return Number(_0x5a53b7[_0xd750('0x6f')]);});return db[_0xd750('0x70')][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'WhatsappQueueId':{'$in':_0xf70e6d}},'transaction':_0x424b61});})[_0xd750('0x44')](function(){return db[_0xd750('0x71')][_0xd750('0x4d')]({'where':{'TeamId':_0x2adab6}});})[_0xd750('0x44')](function(_0x18dda0){if(_0x18dda0===null){return;}return db['UserVoicePrefix'][_0xd750('0x58')]({'where':{'UserId':{'$in':_0x1b527a},'VoicePrefixId':_0x18dda0[_0xd750('0x72')]},'transaction':_0x424b61});})[_0xd750('0x44')](function(){return db['Team'][_0xd750('0x58')]({'where':{'id':_0x2adab6},'cascade':!![],'transaction':_0x424b61});})['then'](function(_0x43c753){if(_0x43c753===0x0){_0x54f9de[_0xd750('0x20')](0x194);}else{return db['UserProfileResource'][_0xd750('0x58')]({'where':{'type':_0xd750('0x73'),'resourceId':_0x2adab6},'cascade':!![],'transaction':_0x424b61})['then'](function(){_0x54f9de[_0xd750('0x21')](0xcc)['end']();});}})[_0xd750('0x48')](function(_0x442b7){_0x54f9de[_0xd750('0x21')](0x1f4)[_0xd750('0x2f')](_0x442b7);});});};exports[_0xd750('0x74')]=function(_0x23eacc,_0x33b468,_0x5f179c){return db['Team'][_0xd750('0x75')]({'where':{'id':_0x23eacc[_0xd750('0x4a')]['id']}})[_0xd750('0x44')](handleEntityNotFound(_0x33b468,null))[_0xd750('0x44')](function(_0x424f6f){if(!_0x23eacc[_0xd750('0x35')][_0xd750('0x76')]||!utils[_0xd750('0x77')](_0x23eacc[_0xd750('0x35')][_0xd750('0x76')])){throw new db['Sequelize'][(_0xd750('0x78'))]('Unknown\x20channel');}var _0x58fcae={};var _0x2a77d9={};_0x2a77d9[_0xd750('0x37')]=_['keys'](db[_[_0xd750('0x79')](_0x23eacc[_0xd750('0x35')][_0xd750('0x76')][_0xd750('0x7a')]())+'Queue']['rawAttributes']);_0x2a77d9[_0xd750('0x35')]=_[_0xd750('0x4b')](_0x23eacc[_0xd750('0x35')]);_0x2a77d9['filters']=_[_0xd750('0x39')](_0x2a77d9[_0xd750('0x37')],_0x2a77d9[_0xd750('0x35')]);_0x58fcae[_0xd750('0x38')]=_[_0xd750('0x39')](_0x2a77d9['model'],qs[_0xd750('0x4c')](_0x23eacc[_0xd750('0x35')]['fields']));_0x58fcae[_0xd750('0x38')]=_0x58fcae[_0xd750('0x38')][_0xd750('0x3a')]?_0x58fcae['attributes']:_0x2a77d9['model'];_0x58fcae[_0xd750('0x26')]=qs['limit'](_0x23eacc['query'][_0xd750('0x26')]);_0x58fcae[_0xd750('0x23')]=qs[_0xd750('0x23')](_0x23eacc[_0xd750('0x35')][_0xd750('0x23')]);_0x58fcae[_0xd750('0x7b')]=qs[_0xd750('0x3c')](_0x23eacc['query']['sort']);_0x58fcae[_0xd750('0x3d')]=qs[_0xd750('0x36')](_['pick'](_0x23eacc[_0xd750('0x35')],_0x2a77d9[_0xd750('0x36')]));_0x58fcae=_[_0xd750('0x3f')]({},_0x58fcae,_0x23eacc['options']);return _0x424f6f['get'+_['capitalize'](_0x23eacc[_0xd750('0x35')]['channel'][_0xd750('0x7a')]())+'Queues'](_0x58fcae);})['then'](respondWithResult(_0x33b468,null))[_0xd750('0x48')](handleError(_0x33b468,null));};exports[_0xd750('0x7c')]=function(_0x87dfc3,_0x25929a,_0x54462a){return db[_0xd750('0x30')][_0xd750('0x75')]({'where':{'id':_0x87dfc3[_0xd750('0x4a')]['id']}})[_0xd750('0x44')](function(_0x37d724){if(_0x37d724){if(!_0x87dfc3[_0xd750('0x4f')]['channel']||!utils['isValidChannel'](_0x87dfc3[_0xd750('0x4f')][_0xd750('0x76')])){throw new db[(_0xd750('0x5b'))]['ValidationError'](_0xd750('0x7d'));}return _0x37d724['add'+_[_0xd750('0x79')](_0x87dfc3['body']['channel'][_0xd750('0x7a')]())+_0xd750('0x7e')](_0x87dfc3[_0xd750('0x4f')][_0xd750('0x7f')]);}return null;})[_0xd750('0x44')](handleEntityNotFound(_0x25929a,null))[_0xd750('0x44')](respondWithStatusCode(_0x25929a,null))[_0xd750('0x48')](handleError(_0x25929a,null));};exports[_0xd750('0x80')]=function(_0x28ad6c,_0x4929c1,_0x40d7e6){return db['Team']['findOne']({'where':{'id':_0x28ad6c[_0xd750('0x4a')]['id']}})[_0xd750('0x44')](function(_0x5d78a2){if(_0x5d78a2){if(!_0x28ad6c[_0xd750('0x35')][_0xd750('0x76')]||!utils[_0xd750('0x77')](_0x28ad6c[_0xd750('0x35')]['channel'])){throw new db[(_0xd750('0x5b'))][(_0xd750('0x78'))](_0xd750('0x7d'));}return _0x5d78a2['remove'+_[_0xd750('0x79')](_0x28ad6c[_0xd750('0x35')][_0xd750('0x76')][_0xd750('0x7a')]())+_0xd750('0x7e')](_0x28ad6c[_0xd750('0x35')]['ids']);}return null;})[_0xd750('0x44')](handleEntityNotFound(_0x4929c1,null))[_0xd750('0x44')](respondWithStatusCode(_0x4929c1,null))['catch'](handleError(_0x4929c1,null));};exports[_0xd750('0x81')]=function(_0xdfa5f4,_0x5063cd){var _0x5a92e6=_[_0xd750('0x82')](_0xdfa5f4[_0xd750('0x4f')][_0xd750('0x7f')])?_0xdfa5f4[_0xd750('0x4f')]['ids']:[_0xdfa5f4[_0xd750('0x4f')][_0xd750('0x7f')]];var _0x258e28=_0xdfa5f4[_0xd750('0x4a')]['id'];return db[_0xd750('0x30')][_0xd750('0x4d')]({'where':{'id':_0x258e28}})[_0xd750('0x44')](handleEntityNotFound(_0x5063cd,null))[_0xd750('0x44')](function(_0x5bb043){if(_0x5bb043){var _0x4d81b4=['Voice',_0xd750('0x83'),_0xd750('0x84'),_0xd750('0x85'),_0xd750('0x86'),_0xd750('0x87'),'Whatsapp'];return db[_0xd750('0x5a')]['transaction'](function(_0x5b55b2){var _0x46ccf7=_[_0xd750('0x34')](_0x4d81b4,function(_0x5bd053){var _0x3792bc={'attributes':['id',_0xd750('0x2e')]};if(_0x5bd053===_0xd750('0x88')){_0x3792bc[_0xd750('0x89')]={'attributes':['penalty']};}return _0x5bb043['get'+_0x5bd053+_0xd750('0x7e')](_0x3792bc)['then'](function(_0x56350e){var _0x1e35dd=_[_0xd750('0x34')](_0x56350e,function(_0x2b2992){var _0x4aef6a=_[_0xd750('0x34')](_0x5a92e6,function(_0x22e052){var _0x2dbd4e={'where':{'UserId':_0x22e052,[_0x5bd053+_0xd750('0x8a')]:_0x2b2992['id']},'transaction':_0x5b55b2};if(_0x5bd053==='Voice'){_0x2dbd4e[_0xd750('0x1c')]={'penalty':_0x2b2992[_0xd750('0x8b')][_0xd750('0x8c')]};}return db['User'+_0x5bd053+_0xd750('0x8d')][_0xd750('0x8e')](_0x2dbd4e)[_0xd750('0x44')](function(){socket[_0xd750('0x8f')]('user'+_0x5bd053+_0xd750('0x90'),{'UserId':_0x22e052,[_0x5bd053+_0xd750('0x8a')]:_0x2b2992['id']});if(_0x5bd053!==_0xd750('0x88')){return;}return db[_0xd750('0x91')][_0xd750('0x92')]({'where':{'id':_0x5a92e6,'online':0x1},'attributes':['id',_0xd750('0x2e'),_0xd750('0x93'),'voicePause',_0xd750('0x94')],'raw':!![]})[_0xd750('0x44')](function(_0xc328ea){var _0xb2bfb4=_[_0xd750('0x34')](_0xc328ea,function(_0x276e11){return db[_0xd750('0x95')][_0xd750('0x96')]({'membername':_0x276e11[_0xd750('0x2e')],'UserId':_0x276e11['id'],'queue_name':_0x2b2992[_0xd750('0x2e')],'VoiceQueueId':_0x2b2992['id'],'interface':_['isNil'](_0x276e11[_0xd750('0x94')])?util[_0xd750('0x97')](_0xd750('0x98'),_0x276e11[_0xd750('0x2e')]):_0x276e11[_0xd750('0x94')],'paused':_0x276e11[_0xd750('0x99')]||![],'penalty':_0x2b2992[_0xd750('0x8b')][_0xd750('0x8c')]},{'transaction':_0x5b55b2});});return Promise[_0xd750('0x9a')](_0xb2bfb4);});});});return Promise[_0xd750('0x9a')](_0x4aef6a);});return Promise[_0xd750('0x9a')](_0x1e35dd);})['then'](function(){return db[_0xd750('0x71')][_0xd750('0x75')]({'where':{'teamId':_0x258e28}})['then'](function(_0x1e43fd){if(_0x1e43fd){var _0x58a175=_[_0xd750('0x34')](_0x5a92e6,function(_0x3320c7){db[_0xd750('0x9b')]['upsert']({'UserId':_0x3320c7,'VoicePrefixId':_0x1e43fd['VoicePrefixId']});});return Promise[_0xd750('0x9a')](_0x58a175);}});});});return Promise[_0xd750('0x9a')](_0x46ccf7)[_0xd750('0x44')](function(){return _0x5bb043[_0xd750('0x81')](_0x5a92e6,{'transaction':_0x5b55b2})[_0xd750('0x9c')](function(_0x22837b){return _0x22837b;});});});}})[_0xd750('0x44')](respondWithResult(_0x5063cd,null))[_0xd750('0x48')](handleError(_0x5063cd,null));};exports[_0xd750('0x9d')]=function(_0xb46ba9,_0x50b3b9){var _0x48c836=_[_0xd750('0x82')](_0xb46ba9['query'][_0xd750('0x7f')])?_0xb46ba9[_0xd750('0x35')][_0xd750('0x7f')]:[_0xb46ba9[_0xd750('0x35')][_0xd750('0x7f')]];var _0x151e9c=_0xb46ba9[_0xd750('0x4a')]['id'];return db[_0xd750('0x30')][_0xd750('0x4d')]({'where':{'id':_0x151e9c}})[_0xd750('0x44')](handleEntityNotFound(_0x50b3b9,null))[_0xd750('0x44')](function(_0x536bf5){if(_0x536bf5){var _0x478812=[_0xd750('0x88'),_0xd750('0x83'),'Mail',_0xd750('0x85'),_0xd750('0x86'),'Openchannel',_0xd750('0x9e')];return db[_0xd750('0x5a')][_0xd750('0x9f')](function(_0x57dec0){var _0x521eb3=_[_0xd750('0x34')](_0x478812,function(_0x4ed18a){var _0x3922de={'attributes':['id',_0xd750('0x2e')]};return _0x536bf5['get'+_0x4ed18a+_0xd750('0x7e')](_0x3922de)[_0xd750('0x44')](function(_0x190ea1){var _0x5c7f80=_['map'](_0x190ea1,function(_0x1794df){return _0x1794df[_0xd750('0x9d')](_0x48c836,{'transaction':_0x57dec0})[_0xd750('0x44')](function(){var _0x321ef3=_[_0xd750('0x34')](_0x48c836,function(_0x4a65ab){socket[_0xd750('0x8f')](_0xd750('0x53')+_0x4ed18a+_0xd750('0xa0'),{'UserId':Number(_0x4a65ab),[_0x4ed18a+_0xd750('0x8a')]:_0x1794df['id']});if(_0x4ed18a!==_0xd750('0x88')){return;}return db[_0xd750('0x95')][_0xd750('0x58')]({'where':{'VoiceQueueId':_0x1794df['id'],'UserId':_0x4a65ab},'transaction':_0x57dec0});});return Promise['all'](_0x321ef3);});});return Promise[_0xd750('0x9a')](_0x5c7f80);});});return Promise[_0xd750('0x9a')](_0x521eb3)[_0xd750('0x44')](function(){return _0x536bf5[_0xd750('0x9d')](_0x48c836,{'transaction':_0x57dec0});})['then'](function(){return db[_0xd750('0x71')]['findOne']({'where':{'teamId':_0x151e9c}})[_0xd750('0x44')](function(_0x1c701f){if(_0x1c701f){var _0x260b84=_[_0xd750('0x34')](_0x48c836,function(_0x2c30b6){db[_0xd750('0x9b')][_0xd750('0x58')]({'where':{'UserId':_0x2c30b6,'VoicePrefixId':_0x1c701f['VoicePrefixId']}});});return Promise['all'](_0x260b84);}});});});}})[_0xd750('0x44')](respondWithStatusCode(_0x50b3b9,null))['catch'](handleError(_0x50b3b9,null));};exports['getAgents']=function(_0x2d0ce6,_0x9f1f55,_0x2e2699){var _0x5013e9={};var _0x35dd78={};var _0x5bf9e1;var _0x16a3a7;return db['Team'][_0xd750('0x75')]({'where':{'id':_0x2d0ce6['params']['id']}})['then'](handleEntityNotFound(_0x9f1f55,null))[_0xd750('0x44')](function(_0x3e811a){if(_0x3e811a){_0x5bf9e1=_0x3e811a;_0x35dd78[_0xd750('0x37')]=_['keys'](db[_0xd750('0x91')]['rawAttributes']);_0x35dd78['query']=_['keys'](_0x2d0ce6[_0xd750('0x35')]);_0x35dd78[_0xd750('0x36')]=_[_0xd750('0x39')](_0x35dd78[_0xd750('0x37')],_0x35dd78['query']);_0x5013e9[_0xd750('0x38')]=_['intersection'](_0x35dd78[_0xd750('0x37')],qs[_0xd750('0x4c')](_0x2d0ce6[_0xd750('0x35')][_0xd750('0x4c')]));_0x5013e9[_0xd750('0x38')]=_0x5013e9[_0xd750('0x38')][_0xd750('0x3a')]?_0x5013e9[_0xd750('0x38')]:_0x35dd78['model'];_0x5013e9[_0xd750('0x7b')]=qs[_0xd750('0x3c')](_0x2d0ce6[_0xd750('0x35')][_0xd750('0x3c')]);_0x5013e9['where']=qs[_0xd750('0x36')](_[_0xd750('0x3e')](_0x2d0ce6[_0xd750('0x35')],_0x35dd78[_0xd750('0x36')]));if(_0x2d0ce6['query']['filter']){_0x5013e9['where']=_['merge'](_0x5013e9[_0xd750('0x3d')],{'$or':_[_0xd750('0x34')](_0x5013e9[_0xd750('0x38')],function(_0x516d08){var _0x5cd3d7={};_0x5cd3d7[_0x516d08]={'$like':'%'+_0x2d0ce6['query']['filter']+'%'};return _0x5cd3d7;})});}_0x5013e9=_[_0xd750('0x3f')]({},_0x5013e9,_0x2d0ce6[_0xd750('0x43')]);return _0x5bf9e1['getAgents'](_0x5013e9);}})['then'](function(_0x3d7d23){if(_0x3d7d23){_0x16a3a7=_0x3d7d23['length'];if(!_0x2d0ce6[_0xd750('0x35')][_0xd750('0x3b')](_0xd750('0xa1'))){_0x5013e9['limit']=qs[_0xd750('0x26')](_0x2d0ce6[_0xd750('0x35')][_0xd750('0x26')]);_0x5013e9[_0xd750('0x23')]=qs[_0xd750('0x23')](_0x2d0ce6[_0xd750('0x35')]['offset']);}return _0x5bf9e1['getAgents'](_0x5013e9);}})['then'](function(_0x455301){if(_0x455301){return _0x455301?{'count':_0x16a3a7,'rows':_0x455301}:null;}})['then'](respondWithResult(_0x9f1f55,null))[_0xd750('0x48')](handleError(_0x9f1f55,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 735bc16..019b08b 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 _0xfbe5=['hook','exports','Team','setMaxListeners','save','update','remove','emit'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xfbe5,0x182));var _0x5fbe=function(_0x111bed,_0x109f8f){_0x111bed=_0x111bed-0x0;var _0x578935=_0xfbe5[_0x111bed];return _0x578935;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x5fbe('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0x5fbe('0x1')](0x0);var events={'afterCreate':_0x5fbe('0x2'),'afterUpdate':_0x5fbe('0x3'),'afterDestroy':_0x5fbe('0x4')};function emitEvent(_0x4bf7dc){return function(_0x26e57b,_0x3c48b8,_0x147a63){TeamEvents[_0x5fbe('0x5')](_0x4bf7dc+':'+_0x26e57b['id'],_0x26e57b);TeamEvents[_0x5fbe('0x5')](_0x4bf7dc,_0x26e57b);_0x147a63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x5fbe('0x6')](e,emitEvent(event));}}module[_0x5fbe('0x7')]=TeamEvents; \ No newline at end of file +var _0x169c=['emit','exports','events','Team','save','remove'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x169c,0xc8));var _0xc169=function(_0x2ffa17,_0x35b3a8){_0x2ffa17=_0x2ffa17-0x0;var _0x3a783b=_0x169c[_0x2ffa17];return _0x3a783b;};'use strict';var EventEmitter=require(_0xc169('0x0'));var Team=require('../../mysqldb')['db'][_0xc169('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc169('0x2'),'afterUpdate':'update','afterDestroy':_0xc169('0x3')};function emitEvent(_0x20db05){return function(_0x128074,_0x32ffce,_0x45b47a){TeamEvents['emit'](_0x20db05+':'+_0x128074['id'],_0x128074);TeamEvents[_0xc169('0x4')](_0x20db05,_0x128074);_0x45b47a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc169('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 45f2822..97657bc 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 _0x74fb=['Voice','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Openchannel'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x74fb,0x1e4));var _0xb74f=function(_0x5337b7,_0x20e927){_0x5337b7=_0x5337b7-0x0;var _0x813f10=_0x74fb[_0x5337b7];return _0x813f10;};'use strict';var _=require(_0xb74f('0x0'));var attributes=require(_0xb74f('0x1'));function getQueuesByChannel(_0x3755c7,_0x5e51bf){var _0xb56c87=_0xb74f('0x2')+_0x5e51bf+_0xb74f('0x3');return _0x3755c7[_0xb56c87]()[_0xb74f('0x4')](function(_0x2bd1d0){return _[_0xb74f('0x5')](_0x2bd1d0,function(_0x105ab9){_0x105ab9[_0xb74f('0x6')](_0xb74f('0x7'),_0x5e51bf);return _0x105ab9;});})[_0xb74f('0x8')](function(_0x284b15){throw _0x284b15;});}module[_0xb74f('0x9')]=function(_0x305f63){return _0x305f63[_0xb74f('0xa')](_0xb74f('0xb'),attributes,{'tableName':_0xb74f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x49d3ae=this;var _0x5ae7a7=[_0xb74f('0xd'),_0xb74f('0xe'),'Mail',_0xb74f('0xf'),'Sms',_0xb74f('0x10'),_0xb74f('0x11')];return Promise[_0xb74f('0x12')]()['then'](function(){var _0x8e2d28=_[_0xb74f('0x5')](_0x5ae7a7,function(_0x139501){return getQueuesByChannel(_0x49d3ae,_0x139501);});return Promise[_0xb74f('0x13')](_0x8e2d28);})[_0xb74f('0x8')](function(_0x2372c2){throw _0x2372c2;});}}});}; \ No newline at end of file +var _0xacdf=['Queues','then','map','setDataValue','channel','define','Team','teams','Mail','Openchannel','Sms','Whatsapp','resolve','all','lodash','./team.attributes','get'];(function(_0x5de056,_0x55b169){var _0x13d19e=function(_0x6e3cdf){while(--_0x6e3cdf){_0x5de056['push'](_0x5de056['shift']());}};_0x13d19e(++_0x55b169);}(_0xacdf,0x74));var _0xfacd=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xacdf[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xfacd('0x0'));var attributes=require(_0xfacd('0x1'));function getQueuesByChannel(_0x3c4157,_0x5ef6a2){var _0x48a8d8=_0xfacd('0x2')+_0x5ef6a2+_0xfacd('0x3');return _0x3c4157[_0x48a8d8]()[_0xfacd('0x4')](function(_0x4022f3){return _[_0xfacd('0x5')](_0x4022f3,function(_0x526d5c){_0x526d5c[_0xfacd('0x6')](_0xfacd('0x7'),_0x5ef6a2);return _0x526d5c;});})['catch'](function(_0x16ad95){throw _0x16ad95;});}module['exports']=function(_0x4277d8){return _0x4277d8[_0xfacd('0x8')](_0xfacd('0x9'),attributes,{'tableName':_0xfacd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x77f178=this;var _0x5b81d7=['Chat','Fax',_0xfacd('0xb'),_0xfacd('0xc'),_0xfacd('0xd'),'Voice',_0xfacd('0xe')];return Promise[_0xfacd('0xf')]()[_0xfacd('0x4')](function(){var _0x2c9130=_[_0xfacd('0x5')](_0x5b81d7,function(_0x3cab18){return getQueuesByChannel(_0x77f178,_0x3cab18);});return Promise[_0xfacd('0x10')](_0x2c9130);})['catch'](function(_0x1e5157){throw _0x1e5157;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e786d44..920cc0d 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 _0xd7cc=['request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register'];(function(_0x480957,_0x2632b7){var _0x5101d3=function(_0xca6835){while(--_0xca6835){_0x480957['push'](_0x480957['shift']());}};_0x5101d3(++_0x2632b7);}(_0xd7cc,0x134));var _0xcd7c=function(_0x4fb30c,_0x5e2547){_0x4fb30c=_0x4fb30c-0x0;var _0x2e40a2=_0xd7cc[_0x4fb30c];return _0x2e40a2;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var moment=require('moment');var BPromise=require(_0xcd7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd7c('0x3'));var db=require(_0xcd7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd7c('0x5'))(_0xcd7c('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd7c('0x7'));var client=jayson[_0xcd7c('0x8')][_0xcd7c('0x9')]({'port':0x232a});config['redis']=_[_0xcd7c('0xa')](config[_0xcd7c('0xb')],{'host':_0xcd7c('0xc'),'port':0x18eb});var socket=require(_0xcd7c('0xd'))(new Redis(config[_0xcd7c('0xb')]));require(_0xcd7c('0xe'))[_0xcd7c('0xf')](socket);function respondWithRpcPromise(_0x497278,_0x208c9c,_0x4b4905){return new BPromise(function(_0x53192a,_0x4f12c9){return client[_0xcd7c('0x10')](_0x497278,_0x4b4905)[_0xcd7c('0x11')](function(_0x3ab58f){logger[_0xcd7c('0x12')](_0xcd7c('0x13'),_0x208c9c,_0xcd7c('0x14'));logger['debug'](_0xcd7c('0x15'),_0x208c9c,_0xcd7c('0x14'),JSON[_0xcd7c('0x16')](_0x3ab58f));if(_0x3ab58f['error']){if(_0x3ab58f[_0xcd7c('0x17')]['code']===0x1f4){logger[_0xcd7c('0x17')](_0xcd7c('0x13'),_0x208c9c,_0x3ab58f['error'][_0xcd7c('0x18')]);return _0x4f12c9(_0x3ab58f[_0xcd7c('0x17')][_0xcd7c('0x18')]);}logger[_0xcd7c('0x17')](_0xcd7c('0x13'),_0x208c9c,_0x3ab58f['error']['message']);return _0x53192a(_0x3ab58f[_0xcd7c('0x17')][_0xcd7c('0x18')]);}else{logger[_0xcd7c('0x12')]('Team,\x20%s,\x20%s',_0x208c9c,_0xcd7c('0x14'));_0x53192a(_0x3ab58f[_0xcd7c('0x19')][_0xcd7c('0x18')]);}})[_0xcd7c('0x1a')](function(_0xfbfaac){logger[_0xcd7c('0x17')](_0xcd7c('0x13'),_0x208c9c,_0xfbfaac);_0x4f12c9(_0xfbfaac);});});} \ No newline at end of file +var _0x3cf6=['Team,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','defaults','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d7bb2,_0x1be16d){var _0x290b86=function(_0x5f1fb2){while(--_0x5f1fb2){_0x4d7bb2['push'](_0x4d7bb2['shift']());}};_0x290b86(++_0x1be16d);}(_0x3cf6,0x186));var _0x63cf=function(_0x3a31c3,_0x4b2e4d){_0x3a31c3=_0x3a31c3-0x0;var _0x1ec91b=_0x3cf6[_0x3a31c3];return _0x1ec91b;};'use strict';var _=require(_0x63cf('0x0'));var util=require(_0x63cf('0x1'));var moment=require('moment');var BPromise=require(_0x63cf('0x2'));var rs=require(_0x63cf('0x3'));var fs=require('fs');var Redis=require(_0x63cf('0x4'));var db=require(_0x63cf('0x5'))['db'];var utils=require(_0x63cf('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x63cf('0x7'));var jayson=require(_0x63cf('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x63cf('0x9')]=_[_0x63cf('0xa')](config[_0x63cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63cf('0x9')]));require(_0x63cf('0xb'))[_0x63cf('0xc')](socket);function respondWithRpcPromise(_0x2d9466,_0x3c7e9e,_0x4efb48){return new BPromise(function(_0x1782cf,_0x526c38){return client[_0x63cf('0xd')](_0x2d9466,_0x4efb48)['then'](function(_0x3c72b8){logger[_0x63cf('0xe')](_0x63cf('0xf'),_0x3c7e9e,_0x63cf('0x10'));logger[_0x63cf('0x11')](_0x63cf('0x12'),_0x3c7e9e,'request\x20sent',JSON['stringify'](_0x3c72b8));if(_0x3c72b8['error']){if(_0x3c72b8['error'][_0x63cf('0x13')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x3c7e9e,_0x3c72b8[_0x63cf('0x14')][_0x63cf('0x15')]);return _0x526c38(_0x3c72b8[_0x63cf('0x14')][_0x63cf('0x15')]);}logger[_0x63cf('0x14')](_0x63cf('0xf'),_0x3c7e9e,_0x3c72b8[_0x63cf('0x14')][_0x63cf('0x15')]);return _0x1782cf(_0x3c72b8[_0x63cf('0x14')]['message']);}else{logger[_0x63cf('0xe')](_0x63cf('0xf'),_0x3c7e9e,_0x63cf('0x10'));_0x1782cf(_0x3c72b8[_0x63cf('0x16')][_0x63cf('0x15')]);}})[_0x63cf('0x17')](function(_0x23df25){logger[_0x63cf('0x14')](_0x63cf('0xf'),_0x3c7e9e,_0x23df25);_0x526c38(_0x23df25);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c562f7a..72e164f 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 _0xe2a4=['./team.events','save','update','emit','removeListener','register','team:'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0xe2a4,0xaf));var _0x4e2a=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0xe2a4[_0x1dd532];return _0x3732aa;};'use strict';var TeamEvents=require(_0x4e2a('0x0'));var events=[_0x4e2a('0x1'),'remove',_0x4e2a('0x2')];function createListener(_0x4a51b2,_0x408eb7){return function(_0x9e41d7){_0x408eb7[_0x4e2a('0x3')](_0x4a51b2,_0x9e41d7);};}function removeListener(_0x1d4953,_0x935a9c){return function(){TeamEvents[_0x4e2a('0x4')](_0x1d4953,_0x935a9c);};}exports[_0x4e2a('0x5')]=function(_0x36f74b){for(var _0x310fb8=0x0,_0x3dd571=events['length'];_0x310fb8<_0x3dd571;_0x310fb8++){var _0x49bcb8=events[_0x310fb8];var _0x1e1e1c=createListener(_0x4e2a('0x6')+_0x49bcb8,_0x36f74b);TeamEvents['on'](_0x49bcb8,_0x1e1e1c);}}; \ No newline at end of file +var _0xdb06=['save','remove','emit','removeListener','./team.events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdb06,0x194));var _0x6db0=function(_0x5b5404,_0x1a5784){_0x5b5404=_0x5b5404-0x0;var _0x14a27f=_0xdb06[_0x5b5404];return _0x14a27f;};'use strict';var TeamEvents=require(_0x6db0('0x0'));var events=[_0x6db0('0x1'),_0x6db0('0x2'),'update'];function createListener(_0x1e037e,_0x32d489){return function(_0x368f63){_0x32d489[_0x6db0('0x3')](_0x1e037e,_0x368f63);};}function removeListener(_0x493037,_0x2bcac9){return function(){TeamEvents[_0x6db0('0x4')](_0x493037,_0x2bcac9);};}exports['register']=function(_0x461aa7){for(var _0x1db4cc=0x0,_0x53af74=events['length'];_0x1db4cc<_0x53af74;_0x1db4cc++){var _0x3f76fe=events[_0x1db4cc];var _0x397fc6=createListener('team:'+_0x3f76fe,_0x461aa7);TeamEvents['on'](_0x3f76fe,_0x397fc6);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e46905a..76405b1 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 _0xf998=['sequelize','INTEGER'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xf998,0x6c));var _0x8f99=function(_0x44073b,_0x53116c){_0x44073b=_0x44073b-0x0;var _0x3757d4=_0xf998[_0x44073b];return _0x3757d4;};'use strict';var Sequelize=require(_0x8f99('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x8f99('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8f99('0x1')]}}; \ No newline at end of file +var _0x2504=['INTEGER','sequelize','exports'];(function(_0x218da2,_0x329e35){var _0x26dbc8=function(_0x5b1bae){while(--_0x5b1bae){_0x218da2['push'](_0x218da2['shift']());}};_0x26dbc8(++_0x329e35);}(_0x2504,0xee));var _0x4250=function(_0x502262,_0x3c5d68){_0x502262=_0x502262-0x0;var _0x302121=_0x2504[_0x502262];return _0x302121;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'TeamId':{'type':Sequelize[_0x4250('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4250('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 578ba82..484415f 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 _0x1516=['bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x4cf741,_0x2fd254){var _0xfc0b8c=function(_0x361295){while(--_0x361295){_0x4cf741['push'](_0x4cf741['shift']());}};_0xfc0b8c(++_0x2fd254);}(_0x1516,0xb0));var _0x6151=function(_0x1eb51c,_0x4b6468){_0x1eb51c=_0x1eb51c-0x0;var _0x1d0dc7=_0x1516[_0x1eb51c];return _0x1d0dc7;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var logger=require(_0x6151('0x2'))('api');var moment=require(_0x6151('0x3'));var BPromise=require(_0x6151('0x4'));var rp=require(_0x6151('0x5'));var fs=require('fs');var path=require(_0x6151('0x6'));var rimraf=require(_0x6151('0x7'));var config=require('../../config/environment');var attributes=require(_0x6151('0x8'));module['exports']=function(_0x69f924,_0x2585cd){return _0x69f924[_0x6151('0x9')](_0x6151('0xa'),attributes,{'tableName':_0x6151('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc06d=['bluebird','request-promise','../../config/environment','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x224e3a,_0x54e22a){var _0x4f70db=function(_0x476fb1){while(--_0x476fb1){_0x224e3a['push'](_0x224e3a['shift']());}};_0x4f70db(++_0x54e22a);}(_0xc06d,0x15a));var _0xdc06=function(_0x435fb1,_0x40495d){_0x435fb1=_0x435fb1-0x0;var _0x176745=_0xc06d[_0x435fb1];return _0x176745;};'use strict';var _=require(_0xdc06('0x0'));var util=require(_0xdc06('0x1'));var logger=require(_0xdc06('0x2'))(_0xdc06('0x3'));var moment=require('moment');var BPromise=require(_0xdc06('0x4'));var rp=require(_0xdc06('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc06('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0xdc06('0x7')]=function(_0x2f7692,_0x5ce60c){return _0x2f7692['define'](_0xdc06('0x8'),attributes,{'tableName':_0xdc06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 94973f7..da32152 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1cce8f,_0x100685){var _0x5843ba=function(_0x4b169d){while(--_0x4b169d){_0x1cce8f['push'](_0x1cce8f['shift']());}};_0x5843ba(++_0x100685);}(_0x70e0,0x17b));var _0x070e=function(_0xbfd957,_0x13e812){_0xbfd957=_0xbfd957-0x0;var _0x534439=_0x70e0[_0xbfd957];return _0x534439;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2db874,_0x404703){var _0x2ffd16=function(_0x4c8d50){while(--_0x4c8d50){_0x2db874['push'](_0x2db874['shift']());}};_0x2ffd16(++_0x404703);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xcb91[_0x31c19c];return _0x1a87f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 498a857..2771cbb 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 _0x1762=['sequelize','exports'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x1762,0xc2));var _0x2176=function(_0x145dfa,_0x3f8231){_0x145dfa=_0x145dfa-0x0;var _0x557c59=_0x1762[_0x145dfa];return _0x557c59;};'use strict';var Sequelize=require(_0x2176('0x0'));module[_0x2176('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeccb=['exports','INTEGER'];(function(_0x2ee5ba,_0xab5c09){var _0x21e0f3=function(_0x39d0cf){while(--_0x39d0cf){_0x2ee5ba['push'](_0x2ee5ba['shift']());}};_0x21e0f3(++_0xab5c09);}(_0xeccb,0x76));var _0xbecc=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xeccb[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require('sequelize');module[_0xbecc('0x0')]={'penalty':{'type':Sequelize[_0xbecc('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index fcbe8b2..4672fca 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 _0x5ebe=['moment','bluebird','request-promise','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe5eb('0x0'));var logger=require(_0xe5eb('0x1'))(_0xe5eb('0x2'));var moment=require(_0xe5eb('0x3'));var BPromise=require(_0xe5eb('0x4'));var rp=require(_0xe5eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe5eb('0x6'));var attributes=require(_0xe5eb('0x7'));module[_0xe5eb('0x8')]=function(_0x1f7414,_0x3055ba){return _0x1f7414[_0xe5eb('0x9')](_0xe5eb('0xa'),attributes,{'tableName':_0xe5eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ef8=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x2d16fe,_0x237147){var _0x40840b=function(_0x158c44){while(--_0x158c44){_0x2d16fe['push'](_0x2d16fe['shift']());}};_0x40840b(++_0x237147);}(_0x9ef8,0x17f));var _0x89ef=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x9ef8[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var logger=require('../../config/logger')(_0x89ef('0x2'));var moment=require(_0x89ef('0x3'));var BPromise=require(_0x89ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ef('0x5'));var rimraf=require(_0x89ef('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x383019,_0x2e117e){return _0x383019[_0x89ef('0x7')](_0x89ef('0x8'),attributes,{'tableName':_0x89ef('0x9'),'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 12d5c56..c93c3af 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 _0xde94=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0xde94,0x134));var _0x4de9=function(_0x31316b,_0x14d84b){_0x31316b=_0x31316b-0x0;var _0x323e05=_0xde94[_0x31316b];return _0x323e05;};'use strict';var _=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var moment=require(_0x4de9('0x2'));var BPromise=require(_0x4de9('0x3'));var rs=require(_0x4de9('0x4'));var fs=require('fs');var Redis=require(_0x4de9('0x5'));var db=require(_0x4de9('0x6'))['db'];var utils=require(_0x4de9('0x7'));var logger=require(_0x4de9('0x8'))(_0x4de9('0x9'));var config=require('../../config/environment');var jayson=require(_0x4de9('0xa'));var client=jayson[_0x4de9('0xb')][_0x4de9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d08ab,_0x411f00,_0x244ea3){return new BPromise(function(_0x4a65ec,_0x38a351){return client['request'](_0x4d08ab,_0x244ea3)[_0x4de9('0xd')](function(_0x5cfc38){logger['info'](_0x4de9('0xe'),_0x411f00,_0x4de9('0xf'));logger[_0x4de9('0x10')](_0x4de9('0x11'),_0x411f00,_0x4de9('0xf'),JSON[_0x4de9('0x12')](_0x5cfc38));if(_0x5cfc38['error']){if(_0x5cfc38['error'][_0x4de9('0x13')]===0x1f4){logger[_0x4de9('0x14')](_0x4de9('0xe'),_0x411f00,_0x5cfc38[_0x4de9('0x14')]['message']);return _0x38a351(_0x5cfc38[_0x4de9('0x14')][_0x4de9('0x15')]);}logger[_0x4de9('0x14')](_0x4de9('0xe'),_0x411f00,_0x5cfc38[_0x4de9('0x14')][_0x4de9('0x15')]);return _0x4a65ec(_0x5cfc38['error']['message']);}else{logger[_0x4de9('0x16')](_0x4de9('0xe'),_0x411f00,_0x4de9('0xf'));_0x4a65ec(_0x5cfc38[_0x4de9('0x17')][_0x4de9('0x15')]);}})[_0x4de9('0x18')](function(_0x5371b1){logger['error'](_0x4de9('0xe'),_0x411f00,_0x5371b1);_0x38a351(_0x5371b1);});});} \ No newline at end of file +var _0xd605=['request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3ab2d4,_0x203181){var _0x222a94=function(_0x55975e){while(--_0x55975e){_0x3ab2d4['push'](_0x3ab2d4['shift']());}};_0x222a94(++_0x203181);}(_0xd605,0x1c1));var _0x5d60=function(_0xb6c38c,_0x3fc6c4){_0xb6c38c=_0xb6c38c-0x0;var _0x661192=_0xd605[_0xb6c38c];return _0x661192;};'use strict';var _=require(_0x5d60('0x0'));var util=require('util');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(_0x5d60('0x5'))['db'];var utils=require(_0x5d60('0x6'));var logger=require(_0x5d60('0x7'))(_0x5d60('0x8'));var config=require(_0x5d60('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13c408,_0x53752f,_0x5a7df1){return new BPromise(function(_0x2f8a09,_0x357340){return client[_0x5d60('0xb')](_0x13c408,_0x5a7df1)[_0x5d60('0xc')](function(_0x2566a5){logger[_0x5d60('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x53752f,_0x5d60('0xe'));logger[_0x5d60('0xf')](_0x5d60('0x10'),_0x53752f,_0x5d60('0xe'),JSON['stringify'](_0x2566a5));if(_0x2566a5[_0x5d60('0x11')]){if(_0x2566a5[_0x5d60('0x11')][_0x5d60('0x12')]===0x1f4){logger[_0x5d60('0x11')](_0x5d60('0x13'),_0x53752f,_0x2566a5[_0x5d60('0x11')]['message']);return _0x357340(_0x2566a5[_0x5d60('0x11')][_0x5d60('0x14')]);}logger['error'](_0x5d60('0x13'),_0x53752f,_0x2566a5[_0x5d60('0x11')][_0x5d60('0x14')]);return _0x2f8a09(_0x2566a5['error'][_0x5d60('0x14')]);}else{logger[_0x5d60('0xd')](_0x5d60('0x13'),_0x53752f,'request\x20sent');_0x2f8a09(_0x2566a5[_0x5d60('0x15')][_0x5d60('0x14')]);}})[_0x5d60('0x16')](function(_0x7f68d9){logger[_0x5d60('0x11')](_0x5d60('0x13'),_0x53752f,_0x7f68d9);_0x357340(_0x7f68d9);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a317317..c894800 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 _0xa6b0=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x5003e7,_0x2058c0){var _0x525c79=function(_0x210fb7){while(--_0x210fb7){_0x5003e7['push'](_0x5003e7['shift']());}};_0x525c79(++_0x2058c0);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x55f77d,_0x3307d1){_0x55f77d=_0x55f77d-0x0;var _0x38c775=_0xa6b0[_0x55f77d];return _0x38c775;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0xd')]('/',auth[_0x0a6b('0x9')](),controller['create']);router['put'](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xe')]);router[_0x0a6b('0xf')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x10')]);module[_0x0a6b('0x11')]=router; \ No newline at end of file +var _0x2250=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x171eb0,_0x802d36){var _0x3e82fb=function(_0x10b7f1){while(--_0x10b7f1){_0x171eb0['push'](_0x171eb0['shift']());}};_0x3e82fb(++_0x802d36);}(_0x2250,0x178));var _0x0225=function(_0x46a50c,_0x3a7f4a){_0x46a50c=_0x46a50c-0x0;var _0x4274db=_0x2250[_0x46a50c];return _0x4274db;};'use strict';var multer=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var path=require(_0x0225('0x2'));var timeout=require(_0x0225('0x3'));var express=require(_0x0225('0x4'));var router=express[_0x0225('0x5')]();var fs_extra=require(_0x0225('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var controller=require(_0x0225('0x9'));router[_0x0225('0xa')]('/',auth[_0x0225('0xb')](),controller[_0x0225('0xc')]);router[_0x0225('0xa')](_0x0225('0xd'),auth['isAuthenticated'](),controller[_0x0225('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0225('0xf')]);router[_0x0225('0x10')](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x11')]);router['delete'](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x12')]);module[_0x0225('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 cbe02fc..e270971 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 _0x4271=['sequelize','exports','STRING','TEXT'];(function(_0x16ffe3,_0x166556){var _0x2ac040=function(_0x158600){while(--_0x158600){_0x16ffe3['push'](_0x16ffe3['shift']());}};_0x2ac040(++_0x166556);}(_0x4271,0x1d8));var _0x1427=function(_0x119795,_0x474698){_0x119795=_0x119795-0x0;var _0x3c5478=_0x4271[_0x119795];return _0x3c5478;};'use strict';var Sequelize=require(_0x1427('0x0'));module[_0x1427('0x1')]={'name':{'type':Sequelize[_0x1427('0x2')]},'description':{'type':Sequelize[_0x1427('0x2')]},'html':{'type':Sequelize[_0x1427('0x3')]}}; \ No newline at end of file +var _0xafae=['STRING','TEXT','sequelize','exports'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xafae,0x17e));var _0xeafa=function(_0x42e675,_0x4f24ef){_0x42e675=_0x42e675-0x0;var _0x1e18b9=_0xafae[_0x42e675];return _0x1e18b9;};'use strict';var Sequelize=require(_0xeafa('0x0'));module[_0xeafa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeafa('0x2')]},'html':{'type':Sequelize[_0xeafa('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 866bdc7..da9d8f6 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 _0x46ce=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','Templates','destroy','then','error','stack','name','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','catch','show','fields','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x434c74,_0x7b7375){var _0x113ea5=function(_0xe140a2){while(--_0xe140a2){_0x434c74['push'](_0x434c74['shift']());}};_0x113ea5(++_0x7b7375);}(_0x46ce,0xe9));var _0xe46c=function(_0x51c7c3,_0x5d0e34){_0x51c7c3=_0x51c7c3-0x0;var _0x41cfcd=_0x46ce[_0x51c7c3];return _0x41cfcd;};'use strict';var emlformat=require(_0xe46c('0x0'));var rimraf=require(_0xe46c('0x1'));var zipdir=require(_0xe46c('0x2'));var jsonpatch=require(_0xe46c('0x3'));var rp=require(_0xe46c('0x4'));var moment=require(_0xe46c('0x5'));var BPromise=require(_0xe46c('0x6'));var Mustache=require(_0xe46c('0x7'));var util=require(_0xe46c('0x8'));var path=require(_0xe46c('0x9'));var sox=require('sox');var csv=require(_0xe46c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe46c('0xb'));var _=require('lodash');var squel=require(_0xe46c('0xc'));var crypto=require(_0xe46c('0xd'));var jsforce=require(_0xe46c('0xe'));var deskjs=require(_0xe46c('0xf'));var toCsv=require(_0xe46c('0xa'));var querystring=require(_0xe46c('0x10'));var Papa=require(_0xe46c('0x11'));var Redis=require(_0xe46c('0x12'));var authService=require(_0xe46c('0x13'));var qs=require(_0xe46c('0x14'));var as=require(_0xe46c('0x15'));var hardwareService=require(_0xe46c('0x16'));var logger=require(_0xe46c('0x17'))(_0xe46c('0x18'));var utils=require(_0xe46c('0x19'));var config=require(_0xe46c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe46c('0x1b'))['db'];function respondWithStatusCode(_0x3fb9bd,_0x21af6c){_0x21af6c=_0x21af6c||0xcc;return function(_0x289ce3){if(_0x289ce3){return _0x3fb9bd[_0xe46c('0x1c')](_0x21af6c);}return _0x3fb9bd[_0xe46c('0x1d')](_0x21af6c)[_0xe46c('0x1e')]();};}function respondWithResult(_0xcf5abd,_0x49b0b7){_0x49b0b7=_0x49b0b7||0xc8;return function(_0x15b058){if(_0x15b058){return _0xcf5abd['status'](_0x49b0b7)[_0xe46c('0x1f')](_0x15b058);}};}function respondWithFilteredResult(_0x1cdd96,_0x7a0b93){return function(_0x1dfb78){if(_0x1dfb78){var _0x3564f7=typeof _0x7a0b93[_0xe46c('0x20')]===_0xe46c('0x21')&&typeof _0x7a0b93[_0xe46c('0x22')]==='undefined';var _0x5369ec=_0x1dfb78[_0xe46c('0x23')];var _0xcc944b=_0x3564f7?0x0:_0x7a0b93[_0xe46c('0x20')];var _0x3be79b=_0x3564f7?_0x1dfb78['count']:_0x7a0b93[_0xe46c('0x20')]+_0x7a0b93[_0xe46c('0x22')];var _0x44e693;if(_0x3be79b>=_0x5369ec){_0x3be79b=_0x5369ec;_0x44e693=0xc8;}else{_0x44e693=0xce;}_0x1cdd96[_0xe46c('0x1d')](_0x44e693);return _0x1cdd96[_0xe46c('0x24')](_0xe46c('0x25'),_0xcc944b+'-'+_0x3be79b+'/'+_0x5369ec)[_0xe46c('0x1f')](_0x1dfb78);}return null;};}function patchUpdates(_0x3befbf){return function(_0x42a884){try{jsonpatch[_0xe46c('0x26')](_0x42a884,_0x3befbf,!![]);}catch(_0x315bc4){return BPromise[_0xe46c('0x27')](_0x315bc4);}return _0x42a884[_0xe46c('0x28')]();};}function saveUpdates(_0x55b79b,_0x34ffee){return function(_0x22365c){if(_0x22365c){return _0x22365c['update'](_0x55b79b)['then'](function(_0x3572c0){return _0x3572c0;});}return null;};}function removeEntity(_0x1aef79,_0xdd9aa6){return function(_0xfe67ac){if(_0xfe67ac){return _0xfe67ac['destroy']()['then'](function(){var _0x4f6c3c=_0xfe67ac['get']({'plain':!![]});var _0x207985=_0xe46c('0x29');return db['UserProfileResource'][_0xe46c('0x2a')]({'where':{'type':_0x207985,'resourceId':_0x4f6c3c['id']}})['then'](function(){return _0xfe67ac;});})[_0xe46c('0x2b')](function(){_0x1aef79[_0xe46c('0x1d')](0xcc)[_0xe46c('0x1e')]();});}};}function handleEntityNotFound(_0x508664,_0x4eea40){return function(_0x17b077){if(!_0x17b077){_0x508664[_0xe46c('0x1c')](0x194);}return _0x17b077;};}function handleError(_0x5e73df,_0x52b0b0){_0x52b0b0=_0x52b0b0||0x1f4;return function(_0x43217c){logger[_0xe46c('0x2c')](_0x43217c[_0xe46c('0x2d')]);if(_0x43217c[_0xe46c('0x2e')]){delete _0x43217c[_0xe46c('0x2e')];}_0x5e73df[_0xe46c('0x1d')](_0x52b0b0)['send'](_0x43217c);};}exports[_0xe46c('0x2f')]=function(_0x5c562d,_0x3eedc9){var _0x5ef718={},_0x593a43={},_0x39baba={'count':0x0,'rows':[]};var _0x32fc9f=_[_0xe46c('0x30')](db[_0xe46c('0x31')][_0xe46c('0x32')],function(_0x5146dd){return{'name':_0x5146dd[_0xe46c('0x33')],'type':_0x5146dd[_0xe46c('0x34')]['key']};});_0x593a43[_0xe46c('0x35')]=_['map'](_0x32fc9f,_0xe46c('0x2e'));_0x593a43[_0xe46c('0x36')]=_[_0xe46c('0x37')](_0x5c562d[_0xe46c('0x36')]);_0x593a43[_0xe46c('0x38')]=_[_0xe46c('0x39')](_0x593a43[_0xe46c('0x35')],_0x593a43['query']);_0x5ef718[_0xe46c('0x3a')]=_[_0xe46c('0x39')](_0x593a43[_0xe46c('0x35')],qs['fields'](_0x5c562d[_0xe46c('0x36')]['fields']));_0x5ef718[_0xe46c('0x3a')]=_0x5ef718[_0xe46c('0x3a')][_0xe46c('0x3b')]?_0x5ef718[_0xe46c('0x3a')]:_0x593a43['model'];if(!_0x5c562d['query'][_0xe46c('0x3c')](_0xe46c('0x3d'))){_0x5ef718[_0xe46c('0x22')]=qs[_0xe46c('0x22')](_0x5c562d[_0xe46c('0x36')][_0xe46c('0x22')]);_0x5ef718[_0xe46c('0x20')]=qs[_0xe46c('0x20')](_0x5c562d[_0xe46c('0x36')][_0xe46c('0x20')]);}_0x5ef718[_0xe46c('0x3e')]=qs['sort'](_0x5c562d[_0xe46c('0x36')][_0xe46c('0x3f')]);_0x5ef718[_0xe46c('0x40')]=qs[_0xe46c('0x38')](_['pick'](_0x5c562d['query'],_0x593a43['filters']),_0x32fc9f);if(_0x5c562d[_0xe46c('0x36')]['filter']){_0x5ef718[_0xe46c('0x40')]=_['merge'](_0x5ef718[_0xe46c('0x40')],{'$or':_['map'](_0x32fc9f,function(_0x3cb0af){if(_0x3cb0af[_0xe46c('0x34')]!=='VIRTUAL'){var _0x5d7310={};_0x5d7310[_0x3cb0af[_0xe46c('0x2e')]]={'$like':'%'+_0x5c562d[_0xe46c('0x36')]['filter']+'%'};return _0x5d7310;}})});}_0x5ef718=_[_0xe46c('0x41')]({},_0x5ef718,_0x5c562d[_0xe46c('0x42')]);var _0x1680ca={'where':_0x5ef718['where']};return db[_0xe46c('0x31')][_0xe46c('0x23')](_0x1680ca)[_0xe46c('0x2b')](function(_0x1183a7){_0x39baba[_0xe46c('0x23')]=_0x1183a7;if(_0x5c562d[_0xe46c('0x36')][_0xe46c('0x43')]){_0x5ef718['include']=[{'all':!![]}];}return db['Template'][_0xe46c('0x44')](_0x5ef718);})['then'](function(_0x1b377b){_0x39baba['rows']=_0x1b377b;return _0x39baba;})[_0xe46c('0x2b')](respondWithFilteredResult(_0x3eedc9,_0x5ef718))[_0xe46c('0x45')](handleError(_0x3eedc9,null));};exports[_0xe46c('0x46')]=function(_0x183961,_0x518145){var _0x244776={'raw':!![],'where':{'id':_0x183961['params']['id']}},_0x556bd9={};_0x556bd9['model']=_['keys'](db[_0xe46c('0x31')][_0xe46c('0x32')]);_0x556bd9['query']=_['keys'](_0x183961[_0xe46c('0x36')]);_0x556bd9[_0xe46c('0x38')]=_[_0xe46c('0x39')](_0x556bd9[_0xe46c('0x35')],_0x556bd9[_0xe46c('0x36')]);_0x244776['attributes']=_[_0xe46c('0x39')](_0x556bd9[_0xe46c('0x35')],qs[_0xe46c('0x47')](_0x183961[_0xe46c('0x36')][_0xe46c('0x47')]));_0x244776['attributes']=_0x244776[_0xe46c('0x3a')][_0xe46c('0x3b')]?_0x244776['attributes']:_0x556bd9[_0xe46c('0x35')];if(_0x183961[_0xe46c('0x36')]['includeAll']){_0x244776[_0xe46c('0x48')]=[{'all':!![]}];}_0x244776=_[_0xe46c('0x41')]({},_0x244776,_0x183961['options']);return db[_0xe46c('0x31')][_0xe46c('0x49')](_0x244776)[_0xe46c('0x2b')](handleEntityNotFound(_0x518145,null))[_0xe46c('0x2b')](respondWithResult(_0x518145,null))['catch'](handleError(_0x518145,null));};exports[_0xe46c('0x4a')]=function(_0x354e80,_0x29b97d){return db[_0xe46c('0x31')][_0xe46c('0x4a')](_0x354e80[_0xe46c('0x4b')],{})[_0xe46c('0x2b')](function(_0xa44c12){var _0x4fe7b2=_0x354e80[_0xe46c('0x4c')][_0xe46c('0x4d')]({'plain':!![]});if(!_0x4fe7b2)throw new Error(_0xe46c('0x4e'));if(_0x4fe7b2[_0xe46c('0x4f')]===_0xe46c('0x4c')){var _0x2a3498=_0xa44c12[_0xe46c('0x4d')]({'plain':!![]});var _0x593bf6=_0xe46c('0x29');return db[_0xe46c('0x50')][_0xe46c('0x49')]({'where':{'name':_0x593bf6,'userProfileId':_0x4fe7b2[_0xe46c('0x51')]},'raw':!![]})[_0xe46c('0x2b')](function(_0x3c4be0){if(_0x3c4be0&&_0x3c4be0['autoAssociation']===0x0){return db[_0xe46c('0x52')][_0xe46c('0x4a')]({'name':_0x2a3498[_0xe46c('0x2e')],'resourceId':_0x2a3498['id'],'type':_0x3c4be0['name'],'sectionId':_0x3c4be0['id']},{})[_0xe46c('0x2b')](function(){return _0xa44c12;});}else{return _0xa44c12;}})['catch'](function(_0x43878d){logger[_0xe46c('0x2c')](_0xe46c('0x53'),_0x43878d);throw _0x43878d;});}return _0xa44c12;})[_0xe46c('0x2b')](respondWithResult(_0x29b97d,0xc9))[_0xe46c('0x45')](handleError(_0x29b97d,null));};exports[_0xe46c('0x54')]=function(_0x3d4da7,_0x472af8){if(_0x3d4da7[_0xe46c('0x4b')]['id']){delete _0x3d4da7[_0xe46c('0x4b')]['id'];}return db[_0xe46c('0x31')][_0xe46c('0x49')]({'where':{'id':_0x3d4da7[_0xe46c('0x55')]['id']}})[_0xe46c('0x2b')](handleEntityNotFound(_0x472af8,null))['then'](saveUpdates(_0x3d4da7[_0xe46c('0x4b')],null))['then'](respondWithResult(_0x472af8,null))[_0xe46c('0x45')](handleError(_0x472af8,null));};exports[_0xe46c('0x2a')]=function(_0x31a6ce,_0x225703){return db[_0xe46c('0x31')][_0xe46c('0x49')]({'where':{'id':_0x31a6ce[_0xe46c('0x55')]['id']}})[_0xe46c('0x2b')](handleEntityNotFound(_0x225703,null))[_0xe46c('0x2b')](removeEntity(_0x225703,null))[_0xe46c('0x45')](handleError(_0x225703,null));}; \ No newline at end of file +var _0xfe75=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','Templates','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','Template','includeAll','include','findAll','catch','show','create','body','user'];(function(_0x63d33c,_0x49a376){var _0x198d15=function(_0x446e0e){while(--_0x446e0e){_0x63d33c['push'](_0x63d33c['shift']());}};_0x198d15(++_0x49a376);}(_0xfe75,0x10a));var _0x5fe7=function(_0x1493d4,_0x7f1431){_0x1493d4=_0x1493d4-0x0;var _0x1b3955=_0xfe75[_0x1493d4];return _0x1b3955;};'use strict';var emlformat=require(_0x5fe7('0x0'));var rimraf=require(_0x5fe7('0x1'));var zipdir=require(_0x5fe7('0x2'));var jsonpatch=require(_0x5fe7('0x3'));var rp=require(_0x5fe7('0x4'));var moment=require('moment');var BPromise=require(_0x5fe7('0x5'));var Mustache=require(_0x5fe7('0x6'));var util=require(_0x5fe7('0x7'));var path=require('path');var sox=require(_0x5fe7('0x8'));var csv=require(_0x5fe7('0x9'));var ejs=require(_0x5fe7('0xa'));var fs=require('fs');var fs_extra=require(_0x5fe7('0xb'));var _=require(_0x5fe7('0xc'));var squel=require(_0x5fe7('0xd'));var crypto=require(_0x5fe7('0xe'));var jsforce=require(_0x5fe7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5fe7('0x9'));var querystring=require(_0x5fe7('0x10'));var Papa=require(_0x5fe7('0x11'));var Redis=require(_0x5fe7('0x12'));var authService=require(_0x5fe7('0x13'));var qs=require(_0x5fe7('0x14'));var as=require(_0x5fe7('0x15'));var hardwareService=require(_0x5fe7('0x16'));var logger=require(_0x5fe7('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5fe7('0x18'));var licenseUtil=require(_0x5fe7('0x19'));var db=require(_0x5fe7('0x1a'))['db'];function respondWithStatusCode(_0x345f2c,_0xfef9d6){_0xfef9d6=_0xfef9d6||0xcc;return function(_0x995785){if(_0x995785){return _0x345f2c[_0x5fe7('0x1b')](_0xfef9d6);}return _0x345f2c[_0x5fe7('0x1c')](_0xfef9d6)[_0x5fe7('0x1d')]();};}function respondWithResult(_0x77f39d,_0x19e716){_0x19e716=_0x19e716||0xc8;return function(_0x299d89){if(_0x299d89){return _0x77f39d['status'](_0x19e716)[_0x5fe7('0x1e')](_0x299d89);}};}function respondWithFilteredResult(_0x126b2a,_0x551ce1){return function(_0x199fb7){if(_0x199fb7){var _0x4c751e=typeof _0x551ce1[_0x5fe7('0x1f')]===_0x5fe7('0x20')&&typeof _0x551ce1[_0x5fe7('0x21')]===_0x5fe7('0x20');var _0x3192eb=_0x199fb7[_0x5fe7('0x22')];var _0x4d1950=_0x4c751e?0x0:_0x551ce1[_0x5fe7('0x1f')];var _0x38511a=_0x4c751e?_0x199fb7[_0x5fe7('0x22')]:_0x551ce1[_0x5fe7('0x1f')]+_0x551ce1[_0x5fe7('0x21')];var _0x269b1c;if(_0x38511a>=_0x3192eb){_0x38511a=_0x3192eb;_0x269b1c=0xc8;}else{_0x269b1c=0xce;}_0x126b2a[_0x5fe7('0x1c')](_0x269b1c);return _0x126b2a[_0x5fe7('0x23')](_0x5fe7('0x24'),_0x4d1950+'-'+_0x38511a+'/'+_0x3192eb)[_0x5fe7('0x1e')](_0x199fb7);}return null;};}function patchUpdates(_0x5c7ca7){return function(_0x13ed6d){try{jsonpatch['apply'](_0x13ed6d,_0x5c7ca7,!![]);}catch(_0x62e787){return BPromise[_0x5fe7('0x25')](_0x62e787);}return _0x13ed6d['save']();};}function saveUpdates(_0x1ab7f,_0x4e65c5){return function(_0x553042){if(_0x553042){return _0x553042['update'](_0x1ab7f)['then'](function(_0x372a84){return _0x372a84;});}return null;};}function removeEntity(_0x185404,_0x208342){return function(_0x2dcf40){if(_0x2dcf40){return _0x2dcf40[_0x5fe7('0x26')]()[_0x5fe7('0x27')](function(){var _0x404279=_0x2dcf40['get']({'plain':!![]});var _0x22b2b6=_0x5fe7('0x28');return db[_0x5fe7('0x29')][_0x5fe7('0x26')]({'where':{'type':_0x22b2b6,'resourceId':_0x404279['id']}})[_0x5fe7('0x27')](function(){return _0x2dcf40;});})[_0x5fe7('0x27')](function(){_0x185404[_0x5fe7('0x1c')](0xcc)[_0x5fe7('0x1d')]();});}};}function handleEntityNotFound(_0x956d66,_0x25747b){return function(_0x3de30f){if(!_0x3de30f){_0x956d66[_0x5fe7('0x1b')](0x194);}return _0x3de30f;};}function handleError(_0x48bffc,_0x5c8580){_0x5c8580=_0x5c8580||0x1f4;return function(_0x259c93){logger[_0x5fe7('0x2a')](_0x259c93[_0x5fe7('0x2b')]);if(_0x259c93['name']){delete _0x259c93[_0x5fe7('0x2c')];}_0x48bffc[_0x5fe7('0x1c')](_0x5c8580)[_0x5fe7('0x2d')](_0x259c93);};}exports[_0x5fe7('0x2e')]=function(_0x22ec2e,_0x50a7fa){var _0x482c04={},_0x1dc2c3={},_0x3a30ef={'count':0x0,'rows':[]};var _0x59bbd7=_['map'](db['Template'][_0x5fe7('0x2f')],function(_0x54567d){return{'name':_0x54567d[_0x5fe7('0x30')],'type':_0x54567d['type'][_0x5fe7('0x31')]};});_0x1dc2c3[_0x5fe7('0x32')]=_[_0x5fe7('0x33')](_0x59bbd7,_0x5fe7('0x2c'));_0x1dc2c3[_0x5fe7('0x34')]=_[_0x5fe7('0x35')](_0x22ec2e['query']);_0x1dc2c3[_0x5fe7('0x36')]=_['intersection'](_0x1dc2c3['model'],_0x1dc2c3[_0x5fe7('0x34')]);_0x482c04[_0x5fe7('0x37')]=_[_0x5fe7('0x38')](_0x1dc2c3[_0x5fe7('0x32')],qs[_0x5fe7('0x39')](_0x22ec2e['query'][_0x5fe7('0x39')]));_0x482c04[_0x5fe7('0x37')]=_0x482c04[_0x5fe7('0x37')][_0x5fe7('0x3a')]?_0x482c04[_0x5fe7('0x37')]:_0x1dc2c3[_0x5fe7('0x32')];if(!_0x22ec2e[_0x5fe7('0x34')]['hasOwnProperty'](_0x5fe7('0x3b'))){_0x482c04[_0x5fe7('0x21')]=qs[_0x5fe7('0x21')](_0x22ec2e['query'][_0x5fe7('0x21')]);_0x482c04[_0x5fe7('0x1f')]=qs['offset'](_0x22ec2e[_0x5fe7('0x34')][_0x5fe7('0x1f')]);}_0x482c04[_0x5fe7('0x3c')]=qs[_0x5fe7('0x3d')](_0x22ec2e[_0x5fe7('0x34')][_0x5fe7('0x3d')]);_0x482c04[_0x5fe7('0x3e')]=qs[_0x5fe7('0x36')](_[_0x5fe7('0x3f')](_0x22ec2e['query'],_0x1dc2c3[_0x5fe7('0x36')]),_0x59bbd7);if(_0x22ec2e[_0x5fe7('0x34')]['filter']){_0x482c04[_0x5fe7('0x3e')]=_[_0x5fe7('0x40')](_0x482c04[_0x5fe7('0x3e')],{'$or':_[_0x5fe7('0x33')](_0x59bbd7,function(_0x1fb733){if(_0x1fb733[_0x5fe7('0x41')]!==_0x5fe7('0x42')){var _0x37c352={};_0x37c352[_0x1fb733['name']]={'$like':'%'+_0x22ec2e['query'][_0x5fe7('0x43')]+'%'};return _0x37c352;}})});}_0x482c04=_[_0x5fe7('0x40')]({},_0x482c04,_0x22ec2e[_0x5fe7('0x44')]);var _0x318c06={'where':_0x482c04['where']};return db[_0x5fe7('0x45')][_0x5fe7('0x22')](_0x318c06)[_0x5fe7('0x27')](function(_0x431133){_0x3a30ef[_0x5fe7('0x22')]=_0x431133;if(_0x22ec2e[_0x5fe7('0x34')][_0x5fe7('0x46')]){_0x482c04[_0x5fe7('0x47')]=[{'all':!![]}];}return db[_0x5fe7('0x45')][_0x5fe7('0x48')](_0x482c04);})[_0x5fe7('0x27')](function(_0x11c78d){_0x3a30ef['rows']=_0x11c78d;return _0x3a30ef;})[_0x5fe7('0x27')](respondWithFilteredResult(_0x50a7fa,_0x482c04))[_0x5fe7('0x49')](handleError(_0x50a7fa,null));};exports[_0x5fe7('0x4a')]=function(_0x422d4b,_0x5d5e6d){var _0x1d52e0={'raw':!![],'where':{'id':_0x422d4b['params']['id']}},_0x5deb02={};_0x5deb02['model']=_['keys'](db[_0x5fe7('0x45')][_0x5fe7('0x2f')]);_0x5deb02[_0x5fe7('0x34')]=_['keys'](_0x422d4b[_0x5fe7('0x34')]);_0x5deb02['filters']=_[_0x5fe7('0x38')](_0x5deb02['model'],_0x5deb02[_0x5fe7('0x34')]);_0x1d52e0[_0x5fe7('0x37')]=_['intersection'](_0x5deb02[_0x5fe7('0x32')],qs['fields'](_0x422d4b[_0x5fe7('0x34')]['fields']));_0x1d52e0[_0x5fe7('0x37')]=_0x1d52e0[_0x5fe7('0x37')][_0x5fe7('0x3a')]?_0x1d52e0['attributes']:_0x5deb02['model'];if(_0x422d4b[_0x5fe7('0x34')][_0x5fe7('0x46')]){_0x1d52e0[_0x5fe7('0x47')]=[{'all':!![]}];}_0x1d52e0=_[_0x5fe7('0x40')]({},_0x1d52e0,_0x422d4b['options']);return db[_0x5fe7('0x45')]['find'](_0x1d52e0)['then'](handleEntityNotFound(_0x5d5e6d,null))[_0x5fe7('0x27')](respondWithResult(_0x5d5e6d,null))[_0x5fe7('0x49')](handleError(_0x5d5e6d,null));};exports[_0x5fe7('0x4b')]=function(_0x5033b2,_0x19be56){return db[_0x5fe7('0x45')][_0x5fe7('0x4b')](_0x5033b2[_0x5fe7('0x4c')],{})[_0x5fe7('0x27')](function(_0xa1ca33){var _0x583a81=_0x5033b2[_0x5fe7('0x4d')][_0x5fe7('0x4e')]({'plain':!![]});if(!_0x583a81)throw new Error(_0x5fe7('0x4f'));if(_0x583a81['role']===_0x5fe7('0x4d')){var _0x380b25=_0xa1ca33[_0x5fe7('0x4e')]({'plain':!![]});var _0x5e0f3c=_0x5fe7('0x28');return db[_0x5fe7('0x50')][_0x5fe7('0x51')]({'where':{'name':_0x5e0f3c,'userProfileId':_0x583a81[_0x5fe7('0x52')]},'raw':!![]})['then'](function(_0x232ae8){if(_0x232ae8&&_0x232ae8[_0x5fe7('0x53')]===0x0){return db[_0x5fe7('0x29')][_0x5fe7('0x4b')]({'name':_0x380b25[_0x5fe7('0x2c')],'resourceId':_0x380b25['id'],'type':_0x232ae8['name'],'sectionId':_0x232ae8['id']},{})['then'](function(){return _0xa1ca33;});}else{return _0xa1ca33;}})[_0x5fe7('0x49')](function(_0x381710){logger[_0x5fe7('0x2a')](_0x5fe7('0x54'),_0x381710);throw _0x381710;});}return _0xa1ca33;})[_0x5fe7('0x27')](respondWithResult(_0x19be56,0xc9))[_0x5fe7('0x49')](handleError(_0x19be56,null));};exports['update']=function(_0x11ca36,_0x275284){if(_0x11ca36[_0x5fe7('0x4c')]['id']){delete _0x11ca36[_0x5fe7('0x4c')]['id'];}return db[_0x5fe7('0x45')][_0x5fe7('0x51')]({'where':{'id':_0x11ca36[_0x5fe7('0x55')]['id']}})[_0x5fe7('0x27')](handleEntityNotFound(_0x275284,null))[_0x5fe7('0x27')](saveUpdates(_0x11ca36[_0x5fe7('0x4c')],null))[_0x5fe7('0x27')](respondWithResult(_0x275284,null))[_0x5fe7('0x49')](handleError(_0x275284,null));};exports[_0x5fe7('0x26')]=function(_0x392401,_0x4f54dc){return db[_0x5fe7('0x45')][_0x5fe7('0x51')]({'where':{'id':_0x392401[_0x5fe7('0x55')]['id']}})[_0x5fe7('0x27')](handleEntityNotFound(_0x4f54dc,null))[_0x5fe7('0x27')](removeEntity(_0x4f54dc,null))[_0x5fe7('0x49')](handleError(_0x4f54dc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 31e923b..2b66ec5 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 _0xdb05=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./template.attributes','exports','Template','tools_templates'];(function(_0x35c393,_0x51cce2){var _0x3ca50c=function(_0x11990a){while(--_0x11990a){_0x35c393['push'](_0x35c393['shift']());}};_0x3ca50c(++_0x51cce2);}(_0xdb05,0x1ef));var _0x5db0=function(_0x2f132c,_0x19c4a5){_0x2f132c=_0x2f132c-0x0;var _0x5ed518=_0xdb05[_0x2f132c];return _0x5ed518;};'use strict';var _=require(_0x5db0('0x0'));var util=require('util');var logger=require(_0x5db0('0x1'))(_0x5db0('0x2'));var moment=require(_0x5db0('0x3'));var BPromise=require(_0x5db0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5db0('0x5'));var rimraf=require('rimraf');var config=require(_0x5db0('0x6'));var attributes=require(_0x5db0('0x7'));module[_0x5db0('0x8')]=function(_0xa8e5d1,_0x4aae27){return _0xa8e5d1['define'](_0x5db0('0x9'),attributes,{'tableName':_0x5db0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88a9=['Template','util','api','moment','request-promise','../../config/environment','./template.attributes','exports','define'];(function(_0x2a1cf5,_0x2619f2){var _0x5661a9=function(_0x2a9008){while(--_0x2a9008){_0x2a1cf5['push'](_0x2a1cf5['shift']());}};_0x5661a9(++_0x2619f2);}(_0x88a9,0x91));var _0x988a=function(_0x40e783,_0x41cc89){_0x40e783=_0x40e783-0x0;var _0x4a341e=_0x88a9[_0x40e783];return _0x4a341e;};'use strict';var _=require('lodash');var util=require(_0x988a('0x0'));var logger=require('../../config/logger')(_0x988a('0x1'));var moment=require(_0x988a('0x2'));var BPromise=require('bluebird');var rp=require(_0x988a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x988a('0x4'));var attributes=require(_0x988a('0x5'));module[_0x988a('0x6')]=function(_0x53ec99,_0x12f239){return _0x53ec99[_0x988a('0x7')](_0x988a('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 1f59c2e..df02a24 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 _0x3196=['request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s'];(function(_0x54f8d7,_0x460e53){var _0x1dddbc=function(_0x2cc17a){while(--_0x2cc17a){_0x54f8d7['push'](_0x54f8d7['shift']());}};_0x1dddbc(++_0x460e53);}(_0x3196,0x1ac));var _0x6319=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3196[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6319('0x0'));var util=require(_0x6319('0x1'));var moment=require(_0x6319('0x2'));var BPromise=require('bluebird');var rs=require(_0x6319('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6319('0x4'))['db'];var utils=require(_0x6319('0x5'));var logger=require('../../config/logger')(_0x6319('0x6'));var config=require(_0x6319('0x7'));var jayson=require(_0x6319('0x8'));var client=jayson[_0x6319('0x9')][_0x6319('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab585,_0x1d30a4,_0x1b8814){return new BPromise(function(_0x23cd70,_0x53876c){return client[_0x6319('0xb')](_0x4ab585,_0x1b8814)['then'](function(_0x59f127){logger[_0x6319('0xc')](_0x6319('0xd'),_0x1d30a4,_0x6319('0xe'));logger[_0x6319('0xf')](_0x6319('0x10'),_0x1d30a4,'request\x20sent',JSON[_0x6319('0x11')](_0x59f127));if(_0x59f127[_0x6319('0x12')]){if(_0x59f127[_0x6319('0x12')][_0x6319('0x13')]===0x1f4){logger[_0x6319('0x12')](_0x6319('0xd'),_0x1d30a4,_0x59f127['error'][_0x6319('0x14')]);return _0x53876c(_0x59f127[_0x6319('0x12')][_0x6319('0x14')]);}logger[_0x6319('0x12')](_0x6319('0xd'),_0x1d30a4,_0x59f127[_0x6319('0x12')][_0x6319('0x14')]);return _0x23cd70(_0x59f127[_0x6319('0x12')]['message']);}else{logger[_0x6319('0xc')](_0x6319('0xd'),_0x1d30a4,'request\x20sent');_0x23cd70(_0x59f127[_0x6319('0x15')][_0x6319('0x14')]);}})[_0x6319('0x16')](function(_0x4f0f1b){logger[_0x6319('0x12')](_0x6319('0xd'),_0x1d30a4,_0x4f0f1b);_0x53876c(_0x4f0f1b);});});}exports[_0x6319('0x17')]=function(_0x32c2f0){var _0x541168=this;return new Promise(function(_0x2e1045,_0x33b7ad){return db['Template'][_0x6319('0x18')]({'raw':_0x32c2f0[_0x6319('0x19')]?_0x32c2f0[_0x6319('0x19')][_0x6319('0x1a')]===undefined?!![]:![]:!![],'where':_0x32c2f0[_0x6319('0x19')]?_0x32c2f0[_0x6319('0x19')][_0x6319('0x1b')]||null:null,'attributes':_0x32c2f0['options']?_0x32c2f0[_0x6319('0x19')]['attributes']||null:null,'limit':_0x32c2f0[_0x6319('0x19')]?_0x32c2f0[_0x6319('0x19')][_0x6319('0x1c')]||null:null,'include':_0x32c2f0[_0x6319('0x19')]?_0x32c2f0[_0x6319('0x19')][_0x6319('0x1d')]?_[_0x6319('0x1e')](_0x32c2f0['options']['include'],function(_0x1b8a18){return{'model':db[_0x1b8a18[_0x6319('0x1f')]],'as':_0x1b8a18['as'],'attributes':_0x1b8a18[_0x6319('0x20')],'include':_0x1b8a18[_0x6319('0x1d')]?_[_0x6319('0x1e')](_0x1b8a18[_0x6319('0x1d')],function(_0x1dc8d4){return{'model':db[_0x1dc8d4[_0x6319('0x1f')]],'as':_0x1dc8d4['as'],'attributes':_0x1dc8d4['attributes'],'include':_0x1dc8d4['include']?_[_0x6319('0x1e')](_0x1dc8d4[_0x6319('0x1d')],function(_0x3dfdad){return{'model':db[_0x3dfdad[_0x6319('0x1f')]],'as':_0x3dfdad['as'],'attributes':_0x3dfdad[_0x6319('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6319('0x21')](function(_0x43b4e2){logger[_0x6319('0xc')](_0x6319('0x17'),_0x32c2f0);logger[_0x6319('0xf')](_0x6319('0x17'),_0x32c2f0,JSON[_0x6319('0x11')](_0x43b4e2));_0x2e1045(_0x43b4e2);})['catch'](function(_0xb988e9){logger[_0x6319('0x12')]('GetTemplate',_0xb988e9[_0x6319('0x14')],_0x32c2f0);_0x33b7ad(_0x541168[_0x6319('0x12')](0x1f4,_0xb988e9['message']));});});}; \ No newline at end of file +var _0x3297=['include','map','model','GetTemplate','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','request\x20sent','stringify','error','Template,\x20%s,\x20%s','message','info','catch','Template','findAll','options','raw','attributes','limit'];(function(_0x59a07b,_0x754ac4){var _0x5ca7c3=function(_0xc951c0){while(--_0xc951c0){_0x59a07b['push'](_0x59a07b['shift']());}};_0x5ca7c3(++_0x754ac4);}(_0x3297,0xa0));var _0x7329=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3297[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var moment=require(_0x7329('0x2'));var BPromise=require(_0x7329('0x3'));var rs=require(_0x7329('0x4'));var fs=require('fs');var Redis=require(_0x7329('0x5'));var db=require(_0x7329('0x6'))['db'];var utils=require(_0x7329('0x7'));var logger=require(_0x7329('0x8'))('rpc');var config=require(_0x7329('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7329('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38aa1d,_0x55b4b8,_0x78f778){return new BPromise(function(_0x28f5c7,_0xf92166){return client[_0x7329('0xb')](_0x38aa1d,_0x78f778)[_0x7329('0xc')](function(_0x1ac321){logger['info']('Template,\x20%s,\x20%s',_0x55b4b8,_0x7329('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x55b4b8,_0x7329('0xd'),JSON[_0x7329('0xe')](_0x1ac321));if(_0x1ac321['error']){if(_0x1ac321[_0x7329('0xf')]['code']===0x1f4){logger[_0x7329('0xf')](_0x7329('0x10'),_0x55b4b8,_0x1ac321[_0x7329('0xf')][_0x7329('0x11')]);return _0xf92166(_0x1ac321[_0x7329('0xf')][_0x7329('0x11')]);}logger[_0x7329('0xf')](_0x7329('0x10'),_0x55b4b8,_0x1ac321[_0x7329('0xf')][_0x7329('0x11')]);return _0x28f5c7(_0x1ac321[_0x7329('0xf')][_0x7329('0x11')]);}else{logger[_0x7329('0x12')](_0x7329('0x10'),_0x55b4b8,'request\x20sent');_0x28f5c7(_0x1ac321['result'][_0x7329('0x11')]);}})[_0x7329('0x13')](function(_0x3b0bb5){logger[_0x7329('0xf')](_0x7329('0x10'),_0x55b4b8,_0x3b0bb5);_0xf92166(_0x3b0bb5);});});}exports['GetTemplate']=function(_0x361d54){var _0x4f8cff=this;return new Promise(function(_0x1d923e,_0x1f16a4){return db[_0x7329('0x14')][_0x7329('0x15')]({'raw':_0x361d54[_0x7329('0x16')]?_0x361d54[_0x7329('0x16')][_0x7329('0x17')]===undefined?!![]:![]:!![],'where':_0x361d54[_0x7329('0x16')]?_0x361d54[_0x7329('0x16')]['where']||null:null,'attributes':_0x361d54['options']?_0x361d54[_0x7329('0x16')][_0x7329('0x18')]||null:null,'limit':_0x361d54[_0x7329('0x16')]?_0x361d54['options'][_0x7329('0x19')]||null:null,'include':_0x361d54[_0x7329('0x16')]?_0x361d54['options'][_0x7329('0x1a')]?_[_0x7329('0x1b')](_0x361d54['options'][_0x7329('0x1a')],function(_0x301c3f){return{'model':db[_0x301c3f[_0x7329('0x1c')]],'as':_0x301c3f['as'],'attributes':_0x301c3f[_0x7329('0x18')],'include':_0x301c3f[_0x7329('0x1a')]?_[_0x7329('0x1b')](_0x301c3f[_0x7329('0x1a')],function(_0x5a7d3f){return{'model':db[_0x5a7d3f[_0x7329('0x1c')]],'as':_0x5a7d3f['as'],'attributes':_0x5a7d3f[_0x7329('0x18')],'include':_0x5a7d3f[_0x7329('0x1a')]?_['map'](_0x5a7d3f[_0x7329('0x1a')],function(_0x48cdab){return{'model':db[_0x48cdab[_0x7329('0x1c')]],'as':_0x48cdab['as'],'attributes':_0x48cdab[_0x7329('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7329('0xc')](function(_0x4bb082){logger[_0x7329('0x12')](_0x7329('0x1d'),_0x361d54);logger[_0x7329('0x1e')]('GetTemplate',_0x361d54,JSON[_0x7329('0xe')](_0x4bb082));_0x1d923e(_0x4bb082);})[_0x7329('0x13')](function(_0x2c7be2){logger[_0x7329('0xf')](_0x7329('0x1d'),_0x2c7be2['message'],_0x361d54);_0x1f16a4(_0x4f8cff['error'](0x1f4,_0x2c7be2['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1722196..b420b1f 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 _0x0901=['addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAnyConditions','create','post'];(function(_0x12789c,_0x5c5383){var _0x235496=function(_0x215e1c){while(--_0x215e1c){_0x12789c['push'](_0x12789c['shift']());}};_0x235496(++_0x5c5383);}(_0x0901,0x134));var _0x1090=function(_0x1c52d5,_0x5b6d42){_0x1c52d5=_0x1c52d5-0x0;var _0x36328b=_0x0901[_0x1c52d5];return _0x36328b;};'use strict';var multer=require(_0x1090('0x0'));var util=require(_0x1090('0x1'));var path=require(_0x1090('0x2'));var timeout=require(_0x1090('0x3'));var express=require(_0x1090('0x4'));var router=express[_0x1090('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1090('0x6'));var config=require(_0x1090('0x7'));var controller=require(_0x1090('0x8'));router[_0x1090('0x9')]('/',auth[_0x1090('0xa')](),controller[_0x1090('0xb')]);router['get'](_0x1090('0xc'),auth[_0x1090('0xa')](),controller['show']);router[_0x1090('0x9')](_0x1090('0xd'),auth[_0x1090('0xa')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x1090('0xa')](),controller[_0x1090('0xe')]);router[_0x1090('0x9')]('/:id/actions',auth[_0x1090('0xa')](),controller['getActions']);router['post']('/',auth[_0x1090('0xa')](),controller[_0x1090('0xf')]);router[_0x1090('0x10')](_0x1090('0xd'),auth[_0x1090('0xa')](),controller[_0x1090('0x11')]);router[_0x1090('0x10')](_0x1090('0x12'),auth[_0x1090('0xa')](),controller[_0x1090('0x13')]);router[_0x1090('0x10')](_0x1090('0x14'),auth[_0x1090('0xa')](),controller['addAction']);router[_0x1090('0x15')](_0x1090('0xc'),auth[_0x1090('0xa')](),controller['update']);router[_0x1090('0x16')](_0x1090('0xc'),auth[_0x1090('0xa')](),controller[_0x1090('0x17')]);module[_0x1090('0x18')]=router; \ No newline at end of file +var _0x61b0=['/:id/actions','getActions','post','create','addAnyCondition','addAction','put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions'];(function(_0x51ab13,_0xbe6213){var _0x27c657=function(_0x19561b){while(--_0x19561b){_0x51ab13['push'](_0x51ab13['shift']());}};_0x27c657(++_0xbe6213);}(_0x61b0,0x18f));var _0x061b=function(_0xad606a,_0x33e585){_0xad606a=_0xad606a-0x0;var _0x115903=_0x61b0[_0xad606a];return _0x115903;};'use strict';var multer=require(_0x061b('0x0'));var util=require('util');var path=require(_0x061b('0x1'));var timeout=require(_0x061b('0x2'));var express=require(_0x061b('0x3'));var router=express['Router']();var fs_extra=require(_0x061b('0x4'));var auth=require(_0x061b('0x5'));var interaction=require(_0x061b('0x6'));var config=require(_0x061b('0x7'));var controller=require('./trigger.controller');router[_0x061b('0x8')]('/',auth[_0x061b('0x9')](),controller[_0x061b('0xa')]);router[_0x061b('0x8')](_0x061b('0xb'),auth[_0x061b('0x9')](),controller[_0x061b('0xc')]);router[_0x061b('0x8')](_0x061b('0xd'),auth[_0x061b('0x9')](),controller[_0x061b('0xe')]);router[_0x061b('0x8')](_0x061b('0xf'),auth[_0x061b('0x9')](),controller[_0x061b('0x10')]);router[_0x061b('0x8')](_0x061b('0x11'),auth[_0x061b('0x9')](),controller[_0x061b('0x12')]);router[_0x061b('0x13')]('/',auth[_0x061b('0x9')](),controller[_0x061b('0x14')]);router[_0x061b('0x13')](_0x061b('0xd'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x061b('0x13')](_0x061b('0xf'),auth[_0x061b('0x9')](),controller[_0x061b('0x15')]);router['post'](_0x061b('0x11'),auth[_0x061b('0x9')](),controller[_0x061b('0x16')]);router[_0x061b('0x17')](_0x061b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x061b('0x18')]('/:id',auth[_0x061b('0x9')](),controller['destroy']);module[_0x061b('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 70303fd..7439d39 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 _0x5019=['STRING','exports'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x5019,0x183));var _0x9501=function(_0x3863bf,_0x1c8fb9){_0x3863bf=_0x3863bf-0x0;var _0x10c602=_0x5019[_0x3863bf];return _0x10c602;};'use strict';var Sequelize=require('sequelize');module[_0x9501('0x0')]={'name':{'type':Sequelize[_0x9501('0x1')]},'channel':{'type':Sequelize[_0x9501('0x1')]},'description':{'type':Sequelize[_0x9501('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5651=['STRING','BOOLEAN'];(function(_0x2bd440,_0xfb5a9d){var _0x58f325=function(_0x19847f){while(--_0x19847f){_0x2bd440['push'](_0x2bd440['shift']());}};_0x58f325(++_0xfb5a9d);}(_0x5651,0x1e4));var _0x1565=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x5651[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1565('0x0')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1565('0x0')]},'status':{'type':Sequelize[_0x1565('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index df178e5..5672c64 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 _0x6c55=['count','set','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','find','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne','rawAttributes','getAnyConditions','addAction','getActions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2f2360,_0x550d17){var _0x1b0be4=function(_0x35332c){while(--_0x35332c){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1b0be4(++_0x550d17);}(_0x6c55,0x96));var _0x56c5=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0x6c55[_0x2c1101];return _0x56f52f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56c5('0x0'));var zipdir=require(_0x56c5('0x1'));var jsonpatch=require(_0x56c5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x56c5('0x3'));var Mustache=require(_0x56c5('0x4'));var util=require(_0x56c5('0x5'));var path=require(_0x56c5('0x6'));var sox=require(_0x56c5('0x7'));var csv=require(_0x56c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56c5('0x9'));var _=require('lodash');var squel=require(_0x56c5('0xa'));var crypto=require(_0x56c5('0xb'));var jsforce=require(_0x56c5('0xc'));var deskjs=require(_0x56c5('0xd'));var toCsv=require(_0x56c5('0x8'));var querystring=require(_0x56c5('0xe'));var Papa=require(_0x56c5('0xf'));var Redis=require(_0x56c5('0x10'));var authService=require(_0x56c5('0x11'));var qs=require(_0x56c5('0x12'));var as=require(_0x56c5('0x13'));var hardwareService=require(_0x56c5('0x14'));var logger=require(_0x56c5('0x15'))(_0x56c5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56c5('0x17'));var db=require(_0x56c5('0x18'))['db'];function respondWithStatusCode(_0x257a02,_0x138337){_0x138337=_0x138337||0xcc;return function(_0x5d790b){if(_0x5d790b){return _0x257a02[_0x56c5('0x19')](_0x138337);}return _0x257a02['status'](_0x138337)[_0x56c5('0x1a')]();};}function respondWithResult(_0x15556c,_0x248ddf){_0x248ddf=_0x248ddf||0xc8;return function(_0x2b1b5d){if(_0x2b1b5d){return _0x15556c[_0x56c5('0x1b')](_0x248ddf)[_0x56c5('0x1c')](_0x2b1b5d);}};}function respondWithFilteredResult(_0x1a842c,_0x296922){return function(_0x51b8e1){if(_0x51b8e1){var _0x4bf48e=typeof _0x296922[_0x56c5('0x1d')]===_0x56c5('0x1e')&&typeof _0x296922[_0x56c5('0x1f')]===_0x56c5('0x1e');var _0x420f01=_0x51b8e1[_0x56c5('0x20')];var _0x2cd0d6=_0x4bf48e?0x0:_0x296922[_0x56c5('0x1d')];var _0x470b0f=_0x4bf48e?_0x51b8e1['count']:_0x296922[_0x56c5('0x1d')]+_0x296922[_0x56c5('0x1f')];var _0x1b5a91;if(_0x470b0f>=_0x420f01){_0x470b0f=_0x420f01;_0x1b5a91=0xc8;}else{_0x1b5a91=0xce;}_0x1a842c[_0x56c5('0x1b')](_0x1b5a91);return _0x1a842c[_0x56c5('0x21')]('Content-Range',_0x2cd0d6+'-'+_0x470b0f+'/'+_0x420f01)['json'](_0x51b8e1);}return null;};}function patchUpdates(_0x474c57){return function(_0x49b2ee){try{jsonpatch[_0x56c5('0x22')](_0x49b2ee,_0x474c57,!![]);}catch(_0x1f2006){return BPromise[_0x56c5('0x23')](_0x1f2006);}return _0x49b2ee[_0x56c5('0x24')]();};}function saveUpdates(_0x128a54,_0x5ad280){return function(_0x2899c0){if(_0x2899c0){return _0x2899c0[_0x56c5('0x25')](_0x128a54)['then'](function(_0x467d53){return _0x467d53;});}return null;};}function removeEntity(_0x5e8a92,_0x3cf237){return function(_0x392da2){if(_0x392da2){return _0x392da2[_0x56c5('0x26')]()[_0x56c5('0x27')](function(){var _0x462950=_0x392da2[_0x56c5('0x28')]({'plain':!![]});var _0x43a3d0=_0x56c5('0x29');return db[_0x56c5('0x2a')][_0x56c5('0x26')]({'where':{'type':_0x43a3d0,'resourceId':_0x462950['id']}})['then'](function(){return _0x392da2;});})['then'](function(){_0x5e8a92[_0x56c5('0x1b')](0xcc)[_0x56c5('0x1a')]();});}};}function handleEntityNotFound(_0x532051,_0x2a0902){return function(_0x484ca2){if(!_0x484ca2){_0x532051[_0x56c5('0x19')](0x194);}return _0x484ca2;};}function handleError(_0x400409,_0x45796a){_0x45796a=_0x45796a||0x1f4;return function(_0x4f8118){logger[_0x56c5('0x2b')](_0x4f8118[_0x56c5('0x2c')]);if(_0x4f8118['name']){delete _0x4f8118[_0x56c5('0x2d')];}_0x400409[_0x56c5('0x1b')](_0x45796a)[_0x56c5('0x2e')](_0x4f8118);};}exports[_0x56c5('0x2f')]=function(_0x2d01af,_0x22362a){var _0x4e302a={},_0x373ebf={},_0x520734={'count':0x0,'rows':[]};var _0x4c2ce0=_[_0x56c5('0x30')](db[_0x56c5('0x31')]['rawAttributes'],function(_0x32c876){return{'name':_0x32c876[_0x56c5('0x32')],'type':_0x32c876[_0x56c5('0x33')][_0x56c5('0x34')]};});_0x373ebf[_0x56c5('0x35')]=_[_0x56c5('0x30')](_0x4c2ce0,_0x56c5('0x2d'));_0x373ebf[_0x56c5('0x36')]=_[_0x56c5('0x37')](_0x2d01af['query']);_0x373ebf[_0x56c5('0x38')]=_[_0x56c5('0x39')](_0x373ebf[_0x56c5('0x35')],_0x373ebf[_0x56c5('0x36')]);_0x4e302a['attributes']=_['intersection'](_0x373ebf[_0x56c5('0x35')],qs[_0x56c5('0x3a')](_0x2d01af[_0x56c5('0x36')]['fields']));_0x4e302a['attributes']=_0x4e302a[_0x56c5('0x3b')][_0x56c5('0x3c')]?_0x4e302a['attributes']:_0x373ebf[_0x56c5('0x35')];if(!_0x2d01af[_0x56c5('0x36')][_0x56c5('0x3d')](_0x56c5('0x3e'))){_0x4e302a[_0x56c5('0x1f')]=qs[_0x56c5('0x1f')](_0x2d01af[_0x56c5('0x36')][_0x56c5('0x1f')]);_0x4e302a['offset']=qs['offset'](_0x2d01af[_0x56c5('0x36')][_0x56c5('0x1d')]);}_0x4e302a[_0x56c5('0x3f')]=qs[_0x56c5('0x40')](_0x2d01af[_0x56c5('0x36')][_0x56c5('0x40')]);_0x4e302a[_0x56c5('0x41')]=qs['filters'](_[_0x56c5('0x42')](_0x2d01af[_0x56c5('0x36')],_0x373ebf[_0x56c5('0x38')]),_0x4c2ce0);if(_0x2d01af['query'][_0x56c5('0x43')]){_0x4e302a[_0x56c5('0x41')]=_[_0x56c5('0x44')](_0x4e302a[_0x56c5('0x41')],{'$or':_[_0x56c5('0x30')](_0x4c2ce0,function(_0x55d4b2){if(_0x55d4b2[_0x56c5('0x33')]!=='VIRTUAL'){var _0xc9af06={};_0xc9af06[_0x55d4b2[_0x56c5('0x2d')]]={'$like':'%'+_0x2d01af[_0x56c5('0x36')]['filter']+'%'};return _0xc9af06;}})});}_0x4e302a=_[_0x56c5('0x44')]({},_0x4e302a,_0x2d01af[_0x56c5('0x45')]);var _0x403bfb={'where':_0x4e302a['where']};return db[_0x56c5('0x31')][_0x56c5('0x20')](_0x403bfb)[_0x56c5('0x27')](function(_0x42e3f2){_0x520734['count']=_0x42e3f2;if(_0x2d01af['query'][_0x56c5('0x46')]){_0x4e302a['include']=[{'all':!![]}];}return db[_0x56c5('0x31')]['findAll'](_0x4e302a);})[_0x56c5('0x27')](function(_0x493ea0){_0x520734[_0x56c5('0x47')]=_0x493ea0;return _0x520734;})[_0x56c5('0x27')](respondWithFilteredResult(_0x22362a,_0x4e302a))[_0x56c5('0x48')](handleError(_0x22362a,null));};exports[_0x56c5('0x49')]=function(_0x433e79,_0x4f47e1){var _0x1d8fdd={'raw':![],'where':{'id':_0x433e79[_0x56c5('0x4a')]['id']}},_0x5e608d={};_0x5e608d['model']=_['keys'](db[_0x56c5('0x31')]['rawAttributes']);_0x5e608d[_0x56c5('0x36')]=_[_0x56c5('0x37')](_0x433e79[_0x56c5('0x36')]);_0x5e608d[_0x56c5('0x38')]=_[_0x56c5('0x39')](_0x5e608d[_0x56c5('0x35')],_0x5e608d[_0x56c5('0x36')]);_0x1d8fdd[_0x56c5('0x3b')]=_[_0x56c5('0x39')](_0x5e608d[_0x56c5('0x35')],qs[_0x56c5('0x3a')](_0x433e79[_0x56c5('0x36')][_0x56c5('0x3a')]));_0x1d8fdd[_0x56c5('0x3b')]=_0x1d8fdd['attributes'][_0x56c5('0x3c')]?_0x1d8fdd[_0x56c5('0x3b')]:_0x5e608d[_0x56c5('0x35')];if(_0x433e79[_0x56c5('0x36')][_0x56c5('0x46')]){_0x1d8fdd['include']=[{'all':!![]}];}_0x1d8fdd=_['merge']({},_0x1d8fdd,_0x433e79[_0x56c5('0x45')]);return db[_0x56c5('0x31')]['find'](_0x1d8fdd)[_0x56c5('0x27')](handleEntityNotFound(_0x4f47e1,null))[_0x56c5('0x27')](respondWithResult(_0x4f47e1,null))[_0x56c5('0x48')](handleError(_0x4f47e1,null));};exports['create']=function(_0x124839,_0x17e2de){return db['Trigger'][_0x56c5('0x4b')](_0x124839[_0x56c5('0x4c')],{})[_0x56c5('0x27')](function(_0x2bb1ac){var _0x31b022=_0x124839[_0x56c5('0x4d')][_0x56c5('0x28')]({'plain':!![]});if(!_0x31b022)throw new Error(_0x56c5('0x4e'));if(_0x31b022['role']===_0x56c5('0x4d')){var _0x4b4cda=_0x2bb1ac[_0x56c5('0x28')]({'plain':!![]});var _0x2157ab=_0x56c5('0x29');return db[_0x56c5('0x4f')]['find']({'where':{'name':_0x2157ab,'userProfileId':_0x31b022['userProfileId']},'raw':!![]})['then'](function(_0x169234){if(_0x169234&&_0x169234[_0x56c5('0x50')]===0x0){return db[_0x56c5('0x2a')][_0x56c5('0x4b')]({'name':_0x4b4cda[_0x56c5('0x2d')],'resourceId':_0x4b4cda['id'],'type':_0x169234[_0x56c5('0x2d')],'sectionId':_0x169234['id']},{})['then'](function(){return _0x2bb1ac;});}else{return _0x2bb1ac;}})[_0x56c5('0x48')](function(_0x120928){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x120928);throw _0x120928;});}return _0x2bb1ac;})['then'](respondWithResult(_0x17e2de,0xc9))[_0x56c5('0x48')](handleError(_0x17e2de,null));};exports[_0x56c5('0x25')]=function(_0x367330,_0x28018f){if(_0x367330[_0x56c5('0x4c')]['id']){delete _0x367330['body']['id'];}return db[_0x56c5('0x31')][_0x56c5('0x51')]({'where':{'id':_0x367330[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x28018f,null))['then'](saveUpdates(_0x367330[_0x56c5('0x4c')],null))['then'](respondWithResult(_0x28018f,null))[_0x56c5('0x48')](handleError(_0x28018f,null));};exports['destroy']=function(_0x10805c,_0x1b1b6f){return db[_0x56c5('0x31')][_0x56c5('0x51')]({'where':{'id':_0x10805c[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x1b1b6f,null))[_0x56c5('0x27')](removeEntity(_0x1b1b6f,null))[_0x56c5('0x48')](handleError(_0x1b1b6f,null));};exports[_0x56c5('0x52')]=function(_0x212472,_0x4539df,_0x15fd04){if(_0x212472['body']['id']){delete _0x212472[_0x56c5('0x4c')]['id'];}return db['Trigger'][_0x56c5('0x51')]({'where':{'id':_0x212472[_0x56c5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4539df,null))[_0x56c5('0x27')](function(_0x58044f){if(_0x58044f){_0x212472[_0x56c5('0x4c')][_0x56c5('0x53')]=_0x58044f['id'];return db[_0x56c5('0x54')][_0x56c5('0x4b')](_0x212472[_0x56c5('0x4c')]);}})['then'](respondWithResult(_0x4539df,null))[_0x56c5('0x48')](handleError(_0x4539df,null));};exports['addAnyCondition']=function(_0x4d6ac9,_0x4ecd5d,_0x2959be){if(_0x4d6ac9[_0x56c5('0x4c')]['id']){delete _0x4d6ac9[_0x56c5('0x4c')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4d6ac9[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x4ecd5d,null))[_0x56c5('0x27')](function(_0x23f8ec){if(_0x23f8ec){_0x4d6ac9[_0x56c5('0x4c')]['TriggerAnyId']=_0x23f8ec['id'];return db[_0x56c5('0x54')][_0x56c5('0x4b')](_0x4d6ac9[_0x56c5('0x4c')]);}})[_0x56c5('0x27')](respondWithResult(_0x4ecd5d,null))['catch'](handleError(_0x4ecd5d,null));};exports[_0x56c5('0x55')]=function(_0x208913,_0x575b67,_0x5099fe){var _0x4444f0={};var _0x315b62={};var _0x59d585;var _0x5b31ae;return db[_0x56c5('0x31')][_0x56c5('0x56')]({'where':{'id':_0x208913['params']['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x575b67,null))[_0x56c5('0x27')](function(_0x41b7cb){if(_0x41b7cb){_0x59d585=_0x41b7cb;_0x315b62[_0x56c5('0x35')]=_[_0x56c5('0x37')](db[_0x56c5('0x54')][_0x56c5('0x57')]);_0x315b62[_0x56c5('0x36')]=_['keys'](_0x208913[_0x56c5('0x36')]);_0x315b62[_0x56c5('0x38')]=_['intersection'](_0x315b62[_0x56c5('0x35')],_0x315b62[_0x56c5('0x36')]);_0x4444f0[_0x56c5('0x3b')]=_['intersection'](_0x315b62[_0x56c5('0x35')],qs[_0x56c5('0x3a')](_0x208913[_0x56c5('0x36')][_0x56c5('0x3a')]));_0x4444f0[_0x56c5('0x3b')]=_0x4444f0[_0x56c5('0x3b')][_0x56c5('0x3c')]?_0x4444f0[_0x56c5('0x3b')]:_0x315b62['model'];_0x4444f0[_0x56c5('0x3f')]=qs['sort'](_0x208913['query'][_0x56c5('0x40')]);_0x4444f0[_0x56c5('0x41')]=qs[_0x56c5('0x38')](_[_0x56c5('0x42')](_0x208913['query'],_0x315b62[_0x56c5('0x38')]));if(_0x208913[_0x56c5('0x36')]['filter']){_0x4444f0[_0x56c5('0x41')]=_['merge'](_0x4444f0[_0x56c5('0x41')],{'$or':_[_0x56c5('0x30')](_0x4444f0[_0x56c5('0x3b')],function(_0x4cb871){var _0x2d39e4={};_0x2d39e4[_0x4cb871]={'$like':'%'+_0x208913['query'][_0x56c5('0x43')]+'%'};return _0x2d39e4;})});}_0x4444f0=_[_0x56c5('0x44')]({},_0x4444f0,_0x208913['options']);return _0x59d585[_0x56c5('0x55')](_0x4444f0);}})['then'](function(_0x21552b){if(_0x21552b){_0x5b31ae=_0x21552b[_0x56c5('0x3c')];if(!_0x208913[_0x56c5('0x36')][_0x56c5('0x3d')]('nolimit')){_0x4444f0[_0x56c5('0x1f')]=qs[_0x56c5('0x1f')](_0x208913['query'][_0x56c5('0x1f')]);_0x4444f0[_0x56c5('0x1d')]=qs[_0x56c5('0x1d')](_0x208913[_0x56c5('0x36')][_0x56c5('0x1d')]);}return _0x59d585['getAllConditions'](_0x4444f0);}})['then'](function(_0x3c5048){if(_0x3c5048){return _0x3c5048?{'count':_0x5b31ae,'rows':_0x3c5048}:null;}})[_0x56c5('0x27')](respondWithResult(_0x575b67,null))['catch'](handleError(_0x575b67,null));};exports[_0x56c5('0x58')]=function(_0x2e633c,_0x2f38f2,_0x3ed87f){var _0x4d20e9={};var _0x33b9c9={};var _0x2bcbf3;var _0x58489c;return db[_0x56c5('0x31')][_0x56c5('0x56')]({'where':{'id':_0x2e633c[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x2f38f2,null))['then'](function(_0x341b97){if(_0x341b97){_0x2bcbf3=_0x341b97;_0x33b9c9[_0x56c5('0x35')]=_['keys'](db[_0x56c5('0x54')][_0x56c5('0x57')]);_0x33b9c9[_0x56c5('0x36')]=_[_0x56c5('0x37')](_0x2e633c[_0x56c5('0x36')]);_0x33b9c9[_0x56c5('0x38')]=_['intersection'](_0x33b9c9[_0x56c5('0x35')],_0x33b9c9[_0x56c5('0x36')]);_0x4d20e9[_0x56c5('0x3b')]=_[_0x56c5('0x39')](_0x33b9c9[_0x56c5('0x35')],qs[_0x56c5('0x3a')](_0x2e633c[_0x56c5('0x36')]['fields']));_0x4d20e9['attributes']=_0x4d20e9[_0x56c5('0x3b')][_0x56c5('0x3c')]?_0x4d20e9[_0x56c5('0x3b')]:_0x33b9c9[_0x56c5('0x35')];_0x4d20e9[_0x56c5('0x3f')]=qs[_0x56c5('0x40')](_0x2e633c[_0x56c5('0x36')]['sort']);_0x4d20e9[_0x56c5('0x41')]=qs[_0x56c5('0x38')](_[_0x56c5('0x42')](_0x2e633c[_0x56c5('0x36')],_0x33b9c9['filters']));if(_0x2e633c['query']['filter']){_0x4d20e9['where']=_[_0x56c5('0x44')](_0x4d20e9[_0x56c5('0x41')],{'$or':_['map'](_0x4d20e9[_0x56c5('0x3b')],function(_0xe692f){var _0x48462b={};_0x48462b[_0xe692f]={'$like':'%'+_0x2e633c[_0x56c5('0x36')][_0x56c5('0x43')]+'%'};return _0x48462b;})});}_0x4d20e9=_[_0x56c5('0x44')]({},_0x4d20e9,_0x2e633c['options']);return _0x2bcbf3['getAnyConditions'](_0x4d20e9);}})['then'](function(_0x1494c0){if(_0x1494c0){_0x58489c=_0x1494c0[_0x56c5('0x3c')];if(!_0x2e633c[_0x56c5('0x36')][_0x56c5('0x3d')](_0x56c5('0x3e'))){_0x4d20e9[_0x56c5('0x1f')]=qs[_0x56c5('0x1f')](_0x2e633c[_0x56c5('0x36')]['limit']);_0x4d20e9[_0x56c5('0x1d')]=qs['offset'](_0x2e633c[_0x56c5('0x36')][_0x56c5('0x1d')]);}return _0x2bcbf3['getAnyConditions'](_0x4d20e9);}})[_0x56c5('0x27')](function(_0x27d0fc){if(_0x27d0fc){return _0x27d0fc?{'count':_0x58489c,'rows':_0x27d0fc}:null;}})[_0x56c5('0x27')](respondWithResult(_0x2f38f2,null))[_0x56c5('0x48')](handleError(_0x2f38f2,null));};exports[_0x56c5('0x59')]=function(_0x39bd89,_0x1e2a36,_0x9c6e7a){if(_0x39bd89[_0x56c5('0x4c')]['id']){delete _0x39bd89[_0x56c5('0x4c')]['id'];}return db[_0x56c5('0x31')]['find']({'where':{'id':_0x39bd89[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x1e2a36,null))[_0x56c5('0x27')](function(_0x3566f3){if(_0x3566f3){_0x39bd89[_0x56c5('0x4c')]['TriggerId']=_0x3566f3['id'];return db['Action']['create'](_0x39bd89['body']);}})[_0x56c5('0x27')](respondWithResult(_0x1e2a36,null))[_0x56c5('0x48')](handleError(_0x1e2a36,null));};exports[_0x56c5('0x5a')]=function(_0x2bdd20,_0x3d3f46,_0x2bc227){var _0x4c23e9={};var _0x4d9cca={};var _0x1c2889;var _0x57785c;return db[_0x56c5('0x31')]['findOne']({'where':{'id':_0x2bdd20[_0x56c5('0x4a')]['id']}})[_0x56c5('0x27')](handleEntityNotFound(_0x3d3f46,null))['then'](function(_0x5daf8c){if(_0x5daf8c){_0x1c2889=_0x5daf8c;_0x4d9cca[_0x56c5('0x35')]=_[_0x56c5('0x37')](db['Action'][_0x56c5('0x57')]);_0x4d9cca['query']=_[_0x56c5('0x37')](_0x2bdd20[_0x56c5('0x36')]);_0x4d9cca[_0x56c5('0x38')]=_[_0x56c5('0x39')](_0x4d9cca['model'],_0x4d9cca['query']);_0x4c23e9[_0x56c5('0x3b')]=_[_0x56c5('0x39')](_0x4d9cca[_0x56c5('0x35')],qs[_0x56c5('0x3a')](_0x2bdd20['query']['fields']));_0x4c23e9[_0x56c5('0x3b')]=_0x4c23e9[_0x56c5('0x3b')][_0x56c5('0x3c')]?_0x4c23e9[_0x56c5('0x3b')]:_0x4d9cca[_0x56c5('0x35')];_0x4c23e9[_0x56c5('0x3f')]=qs[_0x56c5('0x40')](_0x2bdd20[_0x56c5('0x36')]['sort']);_0x4c23e9[_0x56c5('0x41')]=qs['filters'](_['pick'](_0x2bdd20[_0x56c5('0x36')],_0x4d9cca['filters']));if(_0x2bdd20['query'][_0x56c5('0x43')]){_0x4c23e9['where']=_['merge'](_0x4c23e9['where'],{'$or':_['map'](_0x4c23e9[_0x56c5('0x3b')],function(_0x2f695a){var _0x3987b0={};_0x3987b0[_0x2f695a]={'$like':'%'+_0x2bdd20[_0x56c5('0x36')][_0x56c5('0x43')]+'%'};return _0x3987b0;})});}_0x4c23e9=_[_0x56c5('0x44')]({},_0x4c23e9,_0x2bdd20[_0x56c5('0x45')]);return _0x1c2889[_0x56c5('0x5a')](_0x4c23e9);}})[_0x56c5('0x27')](function(_0x2801e4){if(_0x2801e4){_0x57785c=_0x2801e4[_0x56c5('0x3c')];if(!_0x2bdd20[_0x56c5('0x36')]['hasOwnProperty'](_0x56c5('0x3e'))){_0x4c23e9['limit']=qs[_0x56c5('0x1f')](_0x2bdd20[_0x56c5('0x36')][_0x56c5('0x1f')]);_0x4c23e9['offset']=qs[_0x56c5('0x1d')](_0x2bdd20[_0x56c5('0x36')][_0x56c5('0x1d')]);}return _0x1c2889[_0x56c5('0x5a')](_0x4c23e9);}})[_0x56c5('0x27')](function(_0x2d8d6a){if(_0x2d8d6a){return _0x2d8d6a?{'count':_0x57785c,'rows':_0x2d8d6a}:null;}})[_0x56c5('0x27')](respondWithResult(_0x3d3f46,null))[_0x56c5('0x48')](handleError(_0x3d3f46,null));}; \ No newline at end of file +var _0x1b64=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','hasOwnProperty','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1b64,0x72));var _0x41b6=function(_0xce4756,_0x51cc4a){_0xce4756=_0xce4756-0x0;var _0x4e0499=_0x1b64[_0xce4756];return _0x4e0499;};'use strict';var emlformat=require(_0x41b6('0x0'));var rimraf=require(_0x41b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x41b6('0x2'));var moment=require(_0x41b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x41b6('0x4'));var util=require('util');var path=require(_0x41b6('0x5'));var sox=require(_0x41b6('0x6'));var csv=require('to-csv');var ejs=require(_0x41b6('0x7'));var fs=require('fs');var fs_extra=require(_0x41b6('0x8'));var _=require(_0x41b6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x41b6('0xa'));var querystring=require(_0x41b6('0xb'));var Papa=require('papaparse');var Redis=require(_0x41b6('0xc'));var authService=require(_0x41b6('0xd'));var qs=require(_0x41b6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41b6('0xf'));var logger=require('../../config/logger')(_0x41b6('0x10'));var utils=require(_0x41b6('0x11'));var config=require(_0x41b6('0x12'));var licenseUtil=require(_0x41b6('0x13'));var db=require(_0x41b6('0x14'))['db'];function respondWithStatusCode(_0x1e87a5,_0x5de8fd){_0x5de8fd=_0x5de8fd||0xcc;return function(_0x1c9c59){if(_0x1c9c59){return _0x1e87a5[_0x41b6('0x15')](_0x5de8fd);}return _0x1e87a5['status'](_0x5de8fd)[_0x41b6('0x16')]();};}function respondWithResult(_0x4115ee,_0x1a9282){_0x1a9282=_0x1a9282||0xc8;return function(_0x5c2c16){if(_0x5c2c16){return _0x4115ee['status'](_0x1a9282)[_0x41b6('0x17')](_0x5c2c16);}};}function respondWithFilteredResult(_0x12ada9,_0x38e967){return function(_0x56a032){if(_0x56a032){var _0x5757c2=typeof _0x38e967[_0x41b6('0x18')]===_0x41b6('0x19')&&typeof _0x38e967[_0x41b6('0x1a')]===_0x41b6('0x19');var _0x4faeaf=_0x56a032[_0x41b6('0x1b')];var _0x3f6419=_0x5757c2?0x0:_0x38e967[_0x41b6('0x18')];var _0x17655f=_0x5757c2?_0x56a032[_0x41b6('0x1b')]:_0x38e967[_0x41b6('0x18')]+_0x38e967[_0x41b6('0x1a')];var _0x531df6;if(_0x17655f>=_0x4faeaf){_0x17655f=_0x4faeaf;_0x531df6=0xc8;}else{_0x531df6=0xce;}_0x12ada9[_0x41b6('0x1c')](_0x531df6);return _0x12ada9[_0x41b6('0x1d')](_0x41b6('0x1e'),_0x3f6419+'-'+_0x17655f+'/'+_0x4faeaf)[_0x41b6('0x17')](_0x56a032);}return null;};}function patchUpdates(_0x344748){return function(_0x2e2db3){try{jsonpatch[_0x41b6('0x1f')](_0x2e2db3,_0x344748,!![]);}catch(_0x409d1a){return BPromise[_0x41b6('0x20')](_0x409d1a);}return _0x2e2db3[_0x41b6('0x21')]();};}function saveUpdates(_0x1da098,_0x414624){return function(_0x13be84){if(_0x13be84){return _0x13be84[_0x41b6('0x22')](_0x1da098)[_0x41b6('0x23')](function(_0x11ba29){return _0x11ba29;});}return null;};}function removeEntity(_0x5df657,_0x305741){return function(_0x427729){if(_0x427729){return _0x427729[_0x41b6('0x24')]()[_0x41b6('0x23')](function(){var _0x355839=_0x427729['get']({'plain':!![]});var _0x340912=_0x41b6('0x25');return db['UserProfileResource'][_0x41b6('0x24')]({'where':{'type':_0x340912,'resourceId':_0x355839['id']}})[_0x41b6('0x23')](function(){return _0x427729;});})[_0x41b6('0x23')](function(){_0x5df657[_0x41b6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e03b4,_0xce4f7d){return function(_0x1dbf7b){if(!_0x1dbf7b){_0x2e03b4[_0x41b6('0x15')](0x194);}return _0x1dbf7b;};}function handleError(_0x2bebbf,_0x1670cb){_0x1670cb=_0x1670cb||0x1f4;return function(_0x244ae8){logger[_0x41b6('0x26')](_0x244ae8[_0x41b6('0x27')]);if(_0x244ae8[_0x41b6('0x28')]){delete _0x244ae8[_0x41b6('0x28')];}_0x2bebbf[_0x41b6('0x1c')](_0x1670cb)[_0x41b6('0x29')](_0x244ae8);};}exports[_0x41b6('0x2a')]=function(_0x185f48,_0x37c760){var _0x2b8651={},_0x1d8ca1={},_0x2a0b10={'count':0x0,'rows':[]};var _0x4333d1=_[_0x41b6('0x2b')](db[_0x41b6('0x2c')][_0x41b6('0x2d')],function(_0x276c22){return{'name':_0x276c22[_0x41b6('0x2e')],'type':_0x276c22[_0x41b6('0x2f')]['key']};});_0x1d8ca1[_0x41b6('0x30')]=_[_0x41b6('0x2b')](_0x4333d1,'name');_0x1d8ca1['query']=_[_0x41b6('0x31')](_0x185f48['query']);_0x1d8ca1[_0x41b6('0x32')]=_[_0x41b6('0x33')](_0x1d8ca1[_0x41b6('0x30')],_0x1d8ca1['query']);_0x2b8651[_0x41b6('0x34')]=_[_0x41b6('0x33')](_0x1d8ca1['model'],qs[_0x41b6('0x35')](_0x185f48[_0x41b6('0x36')][_0x41b6('0x35')]));_0x2b8651[_0x41b6('0x34')]=_0x2b8651[_0x41b6('0x34')][_0x41b6('0x37')]?_0x2b8651[_0x41b6('0x34')]:_0x1d8ca1[_0x41b6('0x30')];if(!_0x185f48[_0x41b6('0x36')]['hasOwnProperty'](_0x41b6('0x38'))){_0x2b8651[_0x41b6('0x1a')]=qs[_0x41b6('0x1a')](_0x185f48['query']['limit']);_0x2b8651['offset']=qs['offset'](_0x185f48[_0x41b6('0x36')][_0x41b6('0x18')]);}_0x2b8651[_0x41b6('0x39')]=qs[_0x41b6('0x3a')](_0x185f48['query'][_0x41b6('0x3a')]);_0x2b8651['where']=qs[_0x41b6('0x32')](_[_0x41b6('0x3b')](_0x185f48[_0x41b6('0x36')],_0x1d8ca1[_0x41b6('0x32')]),_0x4333d1);if(_0x185f48['query'][_0x41b6('0x3c')]){_0x2b8651['where']=_[_0x41b6('0x3d')](_0x2b8651[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x2b')](_0x4333d1,function(_0x4c28ca){if(_0x4c28ca[_0x41b6('0x2f')]!==_0x41b6('0x3f')){var _0xb4f855={};_0xb4f855[_0x4c28ca[_0x41b6('0x28')]]={'$like':'%'+_0x185f48['query'][_0x41b6('0x3c')]+'%'};return _0xb4f855;}})});}_0x2b8651=_[_0x41b6('0x3d')]({},_0x2b8651,_0x185f48[_0x41b6('0x40')]);var _0x5c6c5a={'where':_0x2b8651[_0x41b6('0x3e')]};return db[_0x41b6('0x2c')]['count'](_0x5c6c5a)[_0x41b6('0x23')](function(_0x5c3112){_0x2a0b10[_0x41b6('0x1b')]=_0x5c3112;if(_0x185f48[_0x41b6('0x36')][_0x41b6('0x41')]){_0x2b8651[_0x41b6('0x42')]=[{'all':!![]}];}return db[_0x41b6('0x2c')][_0x41b6('0x43')](_0x2b8651);})[_0x41b6('0x23')](function(_0x286762){_0x2a0b10[_0x41b6('0x44')]=_0x286762;return _0x2a0b10;})[_0x41b6('0x23')](respondWithFilteredResult(_0x37c760,_0x2b8651))[_0x41b6('0x45')](handleError(_0x37c760,null));};exports[_0x41b6('0x46')]=function(_0x5da9ae,_0x12d95c){var _0x4b5fd3={'raw':![],'where':{'id':_0x5da9ae[_0x41b6('0x47')]['id']}},_0x58bfeb={};_0x58bfeb[_0x41b6('0x30')]=_[_0x41b6('0x31')](db['Trigger'][_0x41b6('0x2d')]);_0x58bfeb[_0x41b6('0x36')]=_['keys'](_0x5da9ae[_0x41b6('0x36')]);_0x58bfeb[_0x41b6('0x32')]=_[_0x41b6('0x33')](_0x58bfeb[_0x41b6('0x30')],_0x58bfeb[_0x41b6('0x36')]);_0x4b5fd3[_0x41b6('0x34')]=_[_0x41b6('0x33')](_0x58bfeb[_0x41b6('0x30')],qs[_0x41b6('0x35')](_0x5da9ae[_0x41b6('0x36')][_0x41b6('0x35')]));_0x4b5fd3[_0x41b6('0x34')]=_0x4b5fd3['attributes'][_0x41b6('0x37')]?_0x4b5fd3[_0x41b6('0x34')]:_0x58bfeb['model'];if(_0x5da9ae[_0x41b6('0x36')][_0x41b6('0x41')]){_0x4b5fd3[_0x41b6('0x42')]=[{'all':!![]}];}_0x4b5fd3=_['merge']({},_0x4b5fd3,_0x5da9ae[_0x41b6('0x40')]);return db[_0x41b6('0x2c')]['find'](_0x4b5fd3)[_0x41b6('0x23')](handleEntityNotFound(_0x12d95c,null))[_0x41b6('0x23')](respondWithResult(_0x12d95c,null))[_0x41b6('0x45')](handleError(_0x12d95c,null));};exports[_0x41b6('0x48')]=function(_0x2bd08c,_0x54e3fc){return db['Trigger']['create'](_0x2bd08c[_0x41b6('0x49')],{})[_0x41b6('0x23')](function(_0x54c095){var _0x4a372c=_0x2bd08c[_0x41b6('0x4a')][_0x41b6('0x4b')]({'plain':!![]});if(!_0x4a372c)throw new Error(_0x41b6('0x4c'));if(_0x4a372c['role']===_0x41b6('0x4a')){var _0x1ad43d=_0x54c095['get']({'plain':!![]});var _0x131a1c=_0x41b6('0x25');return db[_0x41b6('0x4d')][_0x41b6('0x4e')]({'where':{'name':_0x131a1c,'userProfileId':_0x4a372c[_0x41b6('0x4f')]},'raw':!![]})['then'](function(_0x45816d){if(_0x45816d&&_0x45816d[_0x41b6('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1ad43d[_0x41b6('0x28')],'resourceId':_0x1ad43d['id'],'type':_0x45816d[_0x41b6('0x28')],'sectionId':_0x45816d['id']},{})['then'](function(){return _0x54c095;});}else{return _0x54c095;}})[_0x41b6('0x45')](function(_0x1d97c9){logger[_0x41b6('0x26')](_0x41b6('0x51'),_0x1d97c9);throw _0x1d97c9;});}return _0x54c095;})[_0x41b6('0x23')](respondWithResult(_0x54e3fc,0xc9))[_0x41b6('0x45')](handleError(_0x54e3fc,null));};exports[_0x41b6('0x22')]=function(_0x346d17,_0x619015){if(_0x346d17['body']['id']){delete _0x346d17['body']['id'];}return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x346d17[_0x41b6('0x47')]['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x619015,null))[_0x41b6('0x23')](saveUpdates(_0x346d17[_0x41b6('0x49')],null))[_0x41b6('0x23')](respondWithResult(_0x619015,null))[_0x41b6('0x45')](handleError(_0x619015,null));};exports[_0x41b6('0x24')]=function(_0x258921,_0x3ef75a){return db['Trigger'][_0x41b6('0x4e')]({'where':{'id':_0x258921[_0x41b6('0x47')]['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x3ef75a,null))['then'](removeEntity(_0x3ef75a,null))[_0x41b6('0x45')](handleError(_0x3ef75a,null));};exports[_0x41b6('0x52')]=function(_0x5b7ede,_0x1dae58,_0x24e93a){if(_0x5b7ede[_0x41b6('0x49')]['id']){delete _0x5b7ede[_0x41b6('0x49')]['id'];}return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x5b7ede[_0x41b6('0x47')]['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x1dae58,null))['then'](function(_0x3f7479){if(_0x3f7479){_0x5b7ede['body']['TriggerAllId']=_0x3f7479['id'];return db[_0x41b6('0x53')][_0x41b6('0x48')](_0x5b7ede['body']);}})[_0x41b6('0x23')](respondWithResult(_0x1dae58,null))[_0x41b6('0x45')](handleError(_0x1dae58,null));};exports[_0x41b6('0x54')]=function(_0x1a0c9b,_0x5f4c17,_0x4d8743){if(_0x1a0c9b[_0x41b6('0x49')]['id']){delete _0x1a0c9b['body']['id'];}return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x1a0c9b['params']['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x5f4c17,null))[_0x41b6('0x23')](function(_0x11871b){if(_0x11871b){_0x1a0c9b[_0x41b6('0x49')][_0x41b6('0x55')]=_0x11871b['id'];return db['Condition']['create'](_0x1a0c9b[_0x41b6('0x49')]);}})[_0x41b6('0x23')](respondWithResult(_0x5f4c17,null))['catch'](handleError(_0x5f4c17,null));};exports['getAllConditions']=function(_0x1ecb39,_0x1da265,_0x3bb4c3){var _0x44313f={};var _0x1d6407={};var _0x5999ab;var _0x20f200;return db[_0x41b6('0x2c')][_0x41b6('0x56')]({'where':{'id':_0x1ecb39[_0x41b6('0x47')]['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x1da265,null))[_0x41b6('0x23')](function(_0x43599d){if(_0x43599d){_0x5999ab=_0x43599d;_0x1d6407[_0x41b6('0x30')]=_[_0x41b6('0x31')](db[_0x41b6('0x53')]['rawAttributes']);_0x1d6407[_0x41b6('0x36')]=_[_0x41b6('0x31')](_0x1ecb39[_0x41b6('0x36')]);_0x1d6407['filters']=_[_0x41b6('0x33')](_0x1d6407[_0x41b6('0x30')],_0x1d6407[_0x41b6('0x36')]);_0x44313f['attributes']=_['intersection'](_0x1d6407[_0x41b6('0x30')],qs[_0x41b6('0x35')](_0x1ecb39[_0x41b6('0x36')][_0x41b6('0x35')]));_0x44313f[_0x41b6('0x34')]=_0x44313f[_0x41b6('0x34')][_0x41b6('0x37')]?_0x44313f[_0x41b6('0x34')]:_0x1d6407[_0x41b6('0x30')];_0x44313f[_0x41b6('0x39')]=qs[_0x41b6('0x3a')](_0x1ecb39[_0x41b6('0x36')]['sort']);_0x44313f['where']=qs[_0x41b6('0x32')](_[_0x41b6('0x3b')](_0x1ecb39['query'],_0x1d6407['filters']));if(_0x1ecb39[_0x41b6('0x36')]['filter']){_0x44313f[_0x41b6('0x3e')]=_[_0x41b6('0x3d')](_0x44313f[_0x41b6('0x3e')],{'$or':_['map'](_0x44313f[_0x41b6('0x34')],function(_0x2c0018){var _0x30d950={};_0x30d950[_0x2c0018]={'$like':'%'+_0x1ecb39[_0x41b6('0x36')][_0x41b6('0x3c')]+'%'};return _0x30d950;})});}_0x44313f=_[_0x41b6('0x3d')]({},_0x44313f,_0x1ecb39[_0x41b6('0x40')]);return _0x5999ab['getAllConditions'](_0x44313f);}})[_0x41b6('0x23')](function(_0x5d2df6){if(_0x5d2df6){_0x20f200=_0x5d2df6[_0x41b6('0x37')];if(!_0x1ecb39[_0x41b6('0x36')][_0x41b6('0x57')]('nolimit')){_0x44313f[_0x41b6('0x1a')]=qs[_0x41b6('0x1a')](_0x1ecb39['query'][_0x41b6('0x1a')]);_0x44313f['offset']=qs[_0x41b6('0x18')](_0x1ecb39['query'][_0x41b6('0x18')]);}return _0x5999ab[_0x41b6('0x58')](_0x44313f);}})['then'](function(_0x387c65){if(_0x387c65){return _0x387c65?{'count':_0x20f200,'rows':_0x387c65}:null;}})[_0x41b6('0x23')](respondWithResult(_0x1da265,null))[_0x41b6('0x45')](handleError(_0x1da265,null));};exports['getAnyConditions']=function(_0x4e21be,_0x54d89,_0x40fbc1){var _0x51fab0={};var _0x1cedda={};var _0xfa30c9;var _0x146fc3;return db[_0x41b6('0x2c')][_0x41b6('0x56')]({'where':{'id':_0x4e21be['params']['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x54d89,null))[_0x41b6('0x23')](function(_0xfc058f){if(_0xfc058f){_0xfa30c9=_0xfc058f;_0x1cedda[_0x41b6('0x30')]=_[_0x41b6('0x31')](db[_0x41b6('0x53')]['rawAttributes']);_0x1cedda['query']=_['keys'](_0x4e21be[_0x41b6('0x36')]);_0x1cedda['filters']=_[_0x41b6('0x33')](_0x1cedda['model'],_0x1cedda[_0x41b6('0x36')]);_0x51fab0['attributes']=_[_0x41b6('0x33')](_0x1cedda[_0x41b6('0x30')],qs[_0x41b6('0x35')](_0x4e21be[_0x41b6('0x36')][_0x41b6('0x35')]));_0x51fab0[_0x41b6('0x34')]=_0x51fab0[_0x41b6('0x34')][_0x41b6('0x37')]?_0x51fab0['attributes']:_0x1cedda[_0x41b6('0x30')];_0x51fab0[_0x41b6('0x39')]=qs['sort'](_0x4e21be[_0x41b6('0x36')][_0x41b6('0x3a')]);_0x51fab0[_0x41b6('0x3e')]=qs[_0x41b6('0x32')](_[_0x41b6('0x3b')](_0x4e21be['query'],_0x1cedda[_0x41b6('0x32')]));if(_0x4e21be[_0x41b6('0x36')][_0x41b6('0x3c')]){_0x51fab0[_0x41b6('0x3e')]=_['merge'](_0x51fab0['where'],{'$or':_['map'](_0x51fab0['attributes'],function(_0x51878b){var _0x26c61d={};_0x26c61d[_0x51878b]={'$like':'%'+_0x4e21be['query'][_0x41b6('0x3c')]+'%'};return _0x26c61d;})});}_0x51fab0=_[_0x41b6('0x3d')]({},_0x51fab0,_0x4e21be[_0x41b6('0x40')]);return _0xfa30c9[_0x41b6('0x59')](_0x51fab0);}})[_0x41b6('0x23')](function(_0x3084a6){if(_0x3084a6){_0x146fc3=_0x3084a6['length'];if(!_0x4e21be[_0x41b6('0x36')][_0x41b6('0x57')]('nolimit')){_0x51fab0[_0x41b6('0x1a')]=qs['limit'](_0x4e21be[_0x41b6('0x36')][_0x41b6('0x1a')]);_0x51fab0['offset']=qs[_0x41b6('0x18')](_0x4e21be[_0x41b6('0x36')]['offset']);}return _0xfa30c9[_0x41b6('0x59')](_0x51fab0);}})[_0x41b6('0x23')](function(_0x1b3e07){if(_0x1b3e07){return _0x1b3e07?{'count':_0x146fc3,'rows':_0x1b3e07}:null;}})[_0x41b6('0x23')](respondWithResult(_0x54d89,null))['catch'](handleError(_0x54d89,null));};exports[_0x41b6('0x5a')]=function(_0x27e480,_0x51acfa,_0x4683de){if(_0x27e480['body']['id']){delete _0x27e480[_0x41b6('0x49')]['id'];}return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x27e480['params']['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x51acfa,null))[_0x41b6('0x23')](function(_0x5e5a4d){if(_0x5e5a4d){_0x27e480[_0x41b6('0x49')][_0x41b6('0x5b')]=_0x5e5a4d['id'];return db[_0x41b6('0x5c')][_0x41b6('0x48')](_0x27e480[_0x41b6('0x49')]);}})[_0x41b6('0x23')](respondWithResult(_0x51acfa,null))[_0x41b6('0x45')](handleError(_0x51acfa,null));};exports[_0x41b6('0x5d')]=function(_0x565250,_0x52e840,_0x248817){var _0x5cfb7e={};var _0x1ac7f5={};var _0x2d85c2;var _0x30ab14;return db[_0x41b6('0x2c')][_0x41b6('0x56')]({'where':{'id':_0x565250[_0x41b6('0x47')]['id']}})[_0x41b6('0x23')](handleEntityNotFound(_0x52e840,null))[_0x41b6('0x23')](function(_0x23afe4){if(_0x23afe4){_0x2d85c2=_0x23afe4;_0x1ac7f5['model']=_[_0x41b6('0x31')](db[_0x41b6('0x5c')][_0x41b6('0x2d')]);_0x1ac7f5[_0x41b6('0x36')]=_[_0x41b6('0x31')](_0x565250[_0x41b6('0x36')]);_0x1ac7f5[_0x41b6('0x32')]=_[_0x41b6('0x33')](_0x1ac7f5[_0x41b6('0x30')],_0x1ac7f5[_0x41b6('0x36')]);_0x5cfb7e[_0x41b6('0x34')]=_[_0x41b6('0x33')](_0x1ac7f5['model'],qs[_0x41b6('0x35')](_0x565250[_0x41b6('0x36')]['fields']));_0x5cfb7e['attributes']=_0x5cfb7e[_0x41b6('0x34')][_0x41b6('0x37')]?_0x5cfb7e[_0x41b6('0x34')]:_0x1ac7f5['model'];_0x5cfb7e[_0x41b6('0x39')]=qs[_0x41b6('0x3a')](_0x565250[_0x41b6('0x36')][_0x41b6('0x3a')]);_0x5cfb7e[_0x41b6('0x3e')]=qs['filters'](_[_0x41b6('0x3b')](_0x565250[_0x41b6('0x36')],_0x1ac7f5['filters']));if(_0x565250[_0x41b6('0x36')]['filter']){_0x5cfb7e[_0x41b6('0x3e')]=_[_0x41b6('0x3d')](_0x5cfb7e[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x2b')](_0x5cfb7e['attributes'],function(_0x241c2d){var _0x15221a={};_0x15221a[_0x241c2d]={'$like':'%'+_0x565250[_0x41b6('0x36')]['filter']+'%'};return _0x15221a;})});}_0x5cfb7e=_[_0x41b6('0x3d')]({},_0x5cfb7e,_0x565250[_0x41b6('0x40')]);return _0x2d85c2[_0x41b6('0x5d')](_0x5cfb7e);}})[_0x41b6('0x23')](function(_0x2a62a8){if(_0x2a62a8){_0x30ab14=_0x2a62a8[_0x41b6('0x37')];if(!_0x565250[_0x41b6('0x36')][_0x41b6('0x57')](_0x41b6('0x38'))){_0x5cfb7e['limit']=qs[_0x41b6('0x1a')](_0x565250[_0x41b6('0x36')]['limit']);_0x5cfb7e[_0x41b6('0x18')]=qs[_0x41b6('0x18')](_0x565250[_0x41b6('0x36')][_0x41b6('0x18')]);}return _0x2d85c2[_0x41b6('0x5d')](_0x5cfb7e);}})['then'](function(_0x22df96){if(_0x22df96){return _0x22df96?{'count':_0x30ab14,'rows':_0x22df96}:null;}})[_0x41b6('0x23')](respondWithResult(_0x52e840,null))['catch'](handleError(_0x52e840,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f4675ad..1b54fa2 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 _0x0f3c=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','bluebird'];(function(_0x5711c5,_0x3b717b){var _0x3dae37=function(_0x50cde6){while(--_0x50cde6){_0x5711c5['push'](_0x5711c5['shift']());}};_0x3dae37(++_0x3b717b);}(_0x0f3c,0x189));var _0xc0f3=function(_0x33880b,_0x225f4b){_0x33880b=_0x33880b-0x0;var _0x56fc2d=_0x0f3c[_0x33880b];return _0x56fc2d;};'use strict';var _=require(_0xc0f3('0x0'));var util=require(_0xc0f3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc0f3('0x2'));var rp=require(_0xc0f3('0x3'));var fs=require('fs');var path=require(_0xc0f3('0x4'));var rimraf=require(_0xc0f3('0x5'));var config=require(_0xc0f3('0x6'));var attributes=require(_0xc0f3('0x7'));module[_0xc0f3('0x8')]=function(_0x256643,_0x4b76a0){return _0x256643[_0xc0f3('0x9')](_0xc0f3('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1f0=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','util'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x25ba65,_0x2613f1){_0x25ba65=_0x25ba65-0x0;var _0x129fc5=_0xe1f0[_0x25ba65];return _0x129fc5;};'use strict';var _=require('lodash');var util=require(_0x0e1f('0x0'));var logger=require(_0x0e1f('0x1'))('api');var moment=require(_0x0e1f('0x2'));var BPromise=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var attributes=require(_0x0e1f('0x7'));module['exports']=function(_0x260585,_0x569a5a){return _0x260585[_0x0e1f('0x8')](_0x0e1f('0x9'),attributes,{'tableName':_0x0e1f('0xa'),'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 8376840..75c1f11 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 _0x582a=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','debug','catch','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x582a,0x135));var _0xa582=function(_0x47bc5e,_0x6fc500){_0x47bc5e=_0x47bc5e-0x0;var _0x323a59=_0x582a[_0x47bc5e];return _0x323a59;};'use strict';var _=require(_0xa582('0x0'));var util=require(_0xa582('0x1'));var moment=require(_0xa582('0x2'));var BPromise=require(_0xa582('0x3'));var rs=require(_0xa582('0x4'));var fs=require('fs');var Redis=require(_0xa582('0x5'));var db=require(_0xa582('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa582('0x7'))(_0xa582('0x8'));var config=require('../../config/environment');var jayson=require(_0xa582('0x9'));var client=jayson[_0xa582('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc6ba,_0x5f435f,_0xb6c4fe){return new BPromise(function(_0x514643,_0x45a090){return client['request'](_0x3fc6ba,_0xb6c4fe)[_0xa582('0xb')](function(_0x1fb2ad){logger['info'](_0xa582('0xc'),_0x5f435f,'request\x20sent');logger['debug'](_0xa582('0xd'),_0x5f435f,_0xa582('0xe'),JSON[_0xa582('0xf')](_0x1fb2ad));if(_0x1fb2ad[_0xa582('0x10')]){if(_0x1fb2ad[_0xa582('0x10')][_0xa582('0x11')]===0x1f4){logger[_0xa582('0x10')](_0xa582('0xc'),_0x5f435f,_0x1fb2ad[_0xa582('0x10')][_0xa582('0x12')]);return _0x45a090(_0x1fb2ad[_0xa582('0x10')]['message']);}logger[_0xa582('0x10')](_0xa582('0xc'),_0x5f435f,_0x1fb2ad[_0xa582('0x10')]['message']);return _0x514643(_0x1fb2ad['error'][_0xa582('0x12')]);}else{logger[_0xa582('0x13')]('Trigger,\x20%s,\x20%s',_0x5f435f,_0xa582('0xe'));_0x514643(_0x1fb2ad['result'][_0xa582('0x12')]);}})['catch'](function(_0x399f08){logger[_0xa582('0x10')](_0xa582('0xc'),_0x5f435f,_0x399f08);_0x45a090(_0x399f08);});});}exports[_0xa582('0x14')]=function(_0x590dc4){var _0x22ecb0=this;return new Promise(function(_0x330ff0,_0x4f6cb7){return db[_0xa582('0x15')][_0xa582('0x16')]({'raw':_0x590dc4[_0xa582('0x17')]?_0x590dc4[_0xa582('0x17')][_0xa582('0x18')]===undefined?!![]:![]:!![],'where':_0x590dc4[_0xa582('0x17')]?_0x590dc4[_0xa582('0x17')][_0xa582('0x19')]||null:null,'attributes':_0x590dc4['options']?_0x590dc4[_0xa582('0x17')]['attributes']||null:null,'limit':_0x590dc4[_0xa582('0x17')]?_0x590dc4[_0xa582('0x17')][_0xa582('0x1a')]||null:null,'include':_0x590dc4[_0xa582('0x17')]?_0x590dc4[_0xa582('0x17')][_0xa582('0x1b')]?_[_0xa582('0x1c')](_0x590dc4[_0xa582('0x17')][_0xa582('0x1b')],function(_0x2119a1){return{'model':db[_0x2119a1[_0xa582('0x1d')]],'as':_0x2119a1['as'],'attributes':_0x2119a1[_0xa582('0x1e')],'include':_0x2119a1[_0xa582('0x1b')]?_[_0xa582('0x1c')](_0x2119a1[_0xa582('0x1b')],function(_0x1184d7){return{'model':db[_0x1184d7[_0xa582('0x1d')]],'as':_0x1184d7['as'],'attributes':_0x1184d7[_0xa582('0x1e')],'include':_0x1184d7[_0xa582('0x1b')]?_[_0xa582('0x1c')](_0x1184d7[_0xa582('0x1b')],function(_0x1f78f8){return{'model':db[_0x1f78f8[_0xa582('0x1d')]],'as':_0x1f78f8['as'],'attributes':_0x1f78f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa582('0xb')](function(_0x1787a4){logger['info'](_0xa582('0x14'),_0x590dc4);logger[_0xa582('0x1f')]('GetTrigger',_0x590dc4,JSON[_0xa582('0xf')](_0x1787a4));_0x330ff0(_0x1787a4);})[_0xa582('0x20')](function(_0x5733ab){logger[_0xa582('0x10')](_0xa582('0x14'),_0x5733ab[_0xa582('0x12')],_0x590dc4);_0x4f6cb7(_0x22ecb0[_0xa582('0x10')](0x1f4,_0x5733ab[_0xa582('0x12')]));});});};exports[_0xa582('0x21')]=function(_0x2955ef){var _0x1ae071=this;return new Promise(function(_0x41aee7,_0x275e84){return db[_0xa582('0x15')][_0xa582('0x22')]({'raw':_0x2955ef[_0xa582('0x17')]?_0x2955ef[_0xa582('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2955ef[_0xa582('0x17')]?_0x2955ef['options'][_0xa582('0x19')]||null:null,'attributes':_0x2955ef['options']?_0x2955ef[_0xa582('0x17')][_0xa582('0x1e')]||null:null,'include':_0x2955ef[_0xa582('0x17')]?_0x2955ef[_0xa582('0x17')][_0xa582('0x1b')]?_[_0xa582('0x1c')](_0x2955ef[_0xa582('0x17')][_0xa582('0x1b')],function(_0x216d8d){return{'model':db[_0x216d8d[_0xa582('0x1d')]],'as':_0x216d8d['as'],'attributes':_0x216d8d[_0xa582('0x1e')],'include':_0x216d8d['include']?_[_0xa582('0x1c')](_0x216d8d[_0xa582('0x1b')],function(_0x2f3b05){return{'model':db[_0x2f3b05[_0xa582('0x1d')]],'as':_0x2f3b05['as'],'attributes':_0x2f3b05[_0xa582('0x1e')],'include':_0x2f3b05[_0xa582('0x1b')]?_['map'](_0x2f3b05['include'],function(_0x43b09e){return{'model':db[_0x43b09e[_0xa582('0x1d')]],'as':_0x43b09e['as'],'attributes':_0x43b09e[_0xa582('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa582('0xb')](function(_0x49dc9e){logger[_0xa582('0x13')](_0xa582('0x21'),_0x2955ef);logger[_0xa582('0x1f')](_0xa582('0x21'),_0x2955ef,JSON[_0xa582('0xf')](_0x49dc9e));_0x41aee7(_0x49dc9e);})[_0xa582('0x20')](function(_0x366c0e){logger[_0xa582('0x10')](_0xa582('0x21'),_0x366c0e[_0xa582('0x12')],_0x2955ef);_0x275e84(_0x1ae071[_0xa582('0x10')](0x1f4,_0x366c0e[_0xa582('0x12')]));});});}; \ No newline at end of file +var _0x8f99=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','model','attributes','find','map','ShowTrigger','util','moment'];(function(_0x2ec22d,_0xac91c3){var _0x39dbc3=function(_0x5aaab4){while(--_0x5aaab4){_0x2ec22d['push'](_0x2ec22d['shift']());}};_0x39dbc3(++_0xac91c3);}(_0x8f99,0x130));var _0x98f9=function(_0x474b39,_0x5d508e){_0x474b39=_0x474b39-0x0;var _0x191d94=_0x8f99[_0x474b39];return _0x191d94;};'use strict';var _=require('lodash');var util=require(_0x98f9('0x0'));var moment=require(_0x98f9('0x1'));var BPromise=require(_0x98f9('0x2'));var rs=require(_0x98f9('0x3'));var fs=require('fs');var Redis=require(_0x98f9('0x4'));var db=require(_0x98f9('0x5'))['db'];var utils=require(_0x98f9('0x6'));var logger=require('../../config/logger')(_0x98f9('0x7'));var config=require(_0x98f9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x98f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b785d,_0x57a0f3,_0x21ef94){return new BPromise(function(_0x3e414b,_0x45270f){return client['request'](_0x3b785d,_0x21ef94)[_0x98f9('0xa')](function(_0xef04ea){logger[_0x98f9('0xb')](_0x98f9('0xc'),_0x57a0f3,_0x98f9('0xd'));logger[_0x98f9('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x57a0f3,_0x98f9('0xd'),JSON[_0x98f9('0xf')](_0xef04ea));if(_0xef04ea['error']){if(_0xef04ea[_0x98f9('0x10')][_0x98f9('0x11')]===0x1f4){logger['error'](_0x98f9('0xc'),_0x57a0f3,_0xef04ea[_0x98f9('0x10')][_0x98f9('0x12')]);return _0x45270f(_0xef04ea['error'][_0x98f9('0x12')]);}logger['error'](_0x98f9('0xc'),_0x57a0f3,_0xef04ea[_0x98f9('0x10')][_0x98f9('0x12')]);return _0x3e414b(_0xef04ea['error'][_0x98f9('0x12')]);}else{logger[_0x98f9('0xb')](_0x98f9('0xc'),_0x57a0f3,_0x98f9('0xd'));_0x3e414b(_0xef04ea[_0x98f9('0x13')][_0x98f9('0x12')]);}})[_0x98f9('0x14')](function(_0x230178){logger[_0x98f9('0x10')](_0x98f9('0xc'),_0x57a0f3,_0x230178);_0x45270f(_0x230178);});});}exports[_0x98f9('0x15')]=function(_0x5c3aa2){var _0x562c5a=this;return new Promise(function(_0x3ca91a,_0x299896){return db[_0x98f9('0x16')][_0x98f9('0x17')]({'raw':_0x5c3aa2[_0x98f9('0x18')]?_0x5c3aa2['options'][_0x98f9('0x19')]===undefined?!![]:![]:!![],'where':_0x5c3aa2[_0x98f9('0x18')]?_0x5c3aa2[_0x98f9('0x18')][_0x98f9('0x1a')]||null:null,'attributes':_0x5c3aa2[_0x98f9('0x18')]?_0x5c3aa2[_0x98f9('0x18')]['attributes']||null:null,'limit':_0x5c3aa2[_0x98f9('0x18')]?_0x5c3aa2[_0x98f9('0x18')][_0x98f9('0x1b')]||null:null,'include':_0x5c3aa2[_0x98f9('0x18')]?_0x5c3aa2['options'][_0x98f9('0x1c')]?_['map'](_0x5c3aa2['options']['include'],function(_0x5d239d){return{'model':db[_0x5d239d[_0x98f9('0x1d')]],'as':_0x5d239d['as'],'attributes':_0x5d239d[_0x98f9('0x1e')],'include':_0x5d239d[_0x98f9('0x1c')]?_['map'](_0x5d239d[_0x98f9('0x1c')],function(_0x4252af){return{'model':db[_0x4252af['model']],'as':_0x4252af['as'],'attributes':_0x4252af['attributes'],'include':_0x4252af['include']?_['map'](_0x4252af[_0x98f9('0x1c')],function(_0x1b33de){return{'model':db[_0x1b33de[_0x98f9('0x1d')]],'as':_0x1b33de['as'],'attributes':_0x1b33de[_0x98f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x98f9('0xa')](function(_0x403612){logger['info'](_0x98f9('0x15'),_0x5c3aa2);logger[_0x98f9('0xe')](_0x98f9('0x15'),_0x5c3aa2,JSON[_0x98f9('0xf')](_0x403612));_0x3ca91a(_0x403612);})[_0x98f9('0x14')](function(_0x4d0793){logger['error'](_0x98f9('0x15'),_0x4d0793['message'],_0x5c3aa2);_0x299896(_0x562c5a[_0x98f9('0x10')](0x1f4,_0x4d0793[_0x98f9('0x12')]));});});};exports['ShowTrigger']=function(_0x1a4de0){var _0x50c326=this;return new Promise(function(_0x5e624c,_0x3d4a3e){return db[_0x98f9('0x16')][_0x98f9('0x1f')]({'raw':_0x1a4de0[_0x98f9('0x18')]?_0x1a4de0[_0x98f9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a4de0[_0x98f9('0x18')]?_0x1a4de0[_0x98f9('0x18')][_0x98f9('0x1a')]||null:null,'attributes':_0x1a4de0[_0x98f9('0x18')]?_0x1a4de0['options'][_0x98f9('0x1e')]||null:null,'include':_0x1a4de0['options']?_0x1a4de0['options'][_0x98f9('0x1c')]?_[_0x98f9('0x20')](_0x1a4de0[_0x98f9('0x18')]['include'],function(_0x4d318f){return{'model':db[_0x4d318f[_0x98f9('0x1d')]],'as':_0x4d318f['as'],'attributes':_0x4d318f[_0x98f9('0x1e')],'include':_0x4d318f[_0x98f9('0x1c')]?_['map'](_0x4d318f[_0x98f9('0x1c')],function(_0x37d278){return{'model':db[_0x37d278[_0x98f9('0x1d')]],'as':_0x37d278['as'],'attributes':_0x37d278[_0x98f9('0x1e')],'include':_0x37d278[_0x98f9('0x1c')]?_[_0x98f9('0x20')](_0x37d278[_0x98f9('0x1c')],function(_0xb54c00){return{'model':db[_0xb54c00['model']],'as':_0xb54c00['as'],'attributes':_0xb54c00[_0x98f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x98f9('0xa')](function(_0x46d0d6){logger[_0x98f9('0xb')](_0x98f9('0x21'),_0x1a4de0);logger[_0x98f9('0xe')](_0x98f9('0x21'),_0x1a4de0,JSON[_0x98f9('0xf')](_0x46d0d6));_0x5e624c(_0x46d0d6);})[_0x98f9('0x14')](function(_0x4c4681){logger[_0x98f9('0x10')](_0x98f9('0x21'),_0x4c4681['message'],_0x1a4de0);_0x3d4a3e(_0x50c326[_0x98f9('0x10')](0x1f4,_0x4c4681[_0x98f9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 05268e2..984fe38 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 _0x5896=['util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','delete','destroy','exports','multer'];(function(_0x55e28f,_0x20cedb){var _0xee48e9=function(_0x1de3df){while(--_0x1de3df){_0x55e28f['push'](_0x55e28f['shift']());}};_0xee48e9(++_0x20cedb);}(_0x5896,0x153));var _0x6589=function(_0x42f5a8,_0x408a7c){_0x42f5a8=_0x42f5a8-0x0;var _0x2ddf14=_0x5896[_0x42f5a8];return _0x2ddf14;};'use strict';var multer=require(_0x6589('0x0'));var util=require(_0x6589('0x1'));var path=require(_0x6589('0x2'));var timeout=require('connect-timeout');var express=require(_0x6589('0x3'));var router=express['Router']();var fs_extra=require(_0x6589('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6589('0x5'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x6589('0x6')]('/',auth[_0x6589('0x7')](),controller['index']);router[_0x6589('0x6')](_0x6589('0x8'),auth[_0x6589('0x7')](),controller[_0x6589('0x9')]);router[_0x6589('0xa')](_0x6589('0xb'),auth['isAuthenticated'](),controller[_0x6589('0xc')]);router[_0x6589('0xa')]('/',auth[_0x6589('0x7')](),controller[_0x6589('0xd')]);router['put'](_0x6589('0x8'),auth[_0x6589('0x7')](),controller['update']);router[_0x6589('0xe')](_0x6589('0x8'),auth['isAuthenticated'](),controller[_0x6589('0xf')]);module[_0x6589('0x10')]=router; \ No newline at end of file +var _0xe9b4=['create','put','/:id','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','/:id/clone'];(function(_0x3c5830,_0x56afa4){var _0x1d8e3f=function(_0x5c240f){while(--_0x5c240f){_0x3c5830['push'](_0x3c5830['shift']());}};_0x1d8e3f(++_0x56afa4);}(_0xe9b4,0x8a));var _0x4e9b=function(_0x354220,_0x139406){_0x354220=_0x354220-0x0;var _0x595cf5=_0xe9b4[_0x354220];return _0x595cf5;};'use strict';var multer=require(_0x4e9b('0x0'));var util=require(_0x4e9b('0x1'));var path=require(_0x4e9b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e9b('0x3')]();var fs_extra=require(_0x4e9b('0x4'));var auth=require(_0x4e9b('0x5'));var interaction=require(_0x4e9b('0x6'));var config=require(_0x4e9b('0x7'));var controller=require('./trunk.controller');router['get']('/',auth[_0x4e9b('0x8')](),controller[_0x4e9b('0x9')]);router[_0x4e9b('0xa')]('/:id',auth[_0x4e9b('0x8')](),controller[_0x4e9b('0xb')]);router[_0x4e9b('0xc')](_0x4e9b('0xd'),auth[_0x4e9b('0x8')](),controller['clone']);router[_0x4e9b('0xc')]('/',auth[_0x4e9b('0x8')](),controller[_0x4e9b('0xe')]);router[_0x4e9b('0xf')](_0x4e9b('0x10'),auth[_0x4e9b('0x8')](),controller[_0x4e9b('0x11')]);router[_0x4e9b('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ac23d2d..cb557a7 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 _0x0f11=['auto','rfc2833','nonat','update','outgoing','yes','force_rport,comedia','nat','join','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','\x22\x22\x20<>','INTEGER','always','accept','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','shortinfo','inband'];(function(_0x4bb353,_0x53029a){var _0x35d649=function(_0x11525e){while(--_0x11525e){_0x4bb353['push'](_0x4bb353['shift']());}};_0x35d649(++_0x53029a);}(_0x0f11,0xbc));var _0x10f1=function(_0x2d01d6,_0xaef48e){_0x2d01d6=_0x2d01d6-0x0;var _0x262cbf=_0x0f11[_0x2d01d6];return _0x262cbf;};'use strict';var Sequelize=require('sequelize');module[_0x10f1('0x0')]={'name':{'type':Sequelize[_0x10f1('0x1')],'allowNull':![],'unique':_0x10f1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x4'),_0x10f1('0x5'),_0x10f1('0x6')),'allowNull':![],'defaultValue':_0x10f1('0x4')},'context':{'type':Sequelize[_0x10f1('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x10f1('0x7'),_0x10f1('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x10f1('0x9'),_0x10f1('0xa'),_0x10f1('0xb'),_0x10f1('0xc'))},'deny':{'type':Sequelize[_0x10f1('0x1')]},'permit':{'type':Sequelize[_0x10f1('0x1')]},'secret':{'type':Sequelize[_0x10f1('0x1')]},'md5secret':{'type':Sequelize[_0x10f1('0x1')]},'remotesecret':{'type':Sequelize[_0x10f1('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x10f1('0xd'),'set':function(_0xe58e2e){this[_0x10f1('0xe')](_0x10f1('0xf'),_0xe58e2e?_0xe58e2e['join'](','):null);},'get':function(){return this[_0x10f1('0x10')]('transport')?this['getDataValue'](_0x10f1('0xf'))[_0x10f1('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x10f1('0x12'),_0x10f1('0x13'),_0x10f1('0x14')),'defaultValue':_0x10f1('0x15')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x10f1('0x16'),_0x10f1('0x17'),_0x10f1('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x10f1('0x1')],'defaultValue':_0x10f1('0x1a'),'set':function(_0x46c713){this['setDataValue'](_0x10f1('0x1b'),_0x46c713?_0x46c713[_0x10f1('0x1c')](','):null);},'get':function(){return this['getDataValue'](_0x10f1('0x1b'))?this[_0x10f1('0x10')](_0x10f1('0x1b'))[_0x10f1('0x11')](','):null;},'comment':_0x10f1('0x1d')},'callgroup':{'type':Sequelize[_0x10f1('0x1')]},'namedcallgroup':{'type':Sequelize[_0x10f1('0x1')]},'pickupgroup':{'type':Sequelize[_0x10f1('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x10f1('0x1')]},'language':{'type':Sequelize[_0x10f1('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x10f1('0x1')],'defaultValue':_0x10f1('0x1e')},'allow':{'type':Sequelize[_0x10f1('0x1')],'allowNull':![],'defaultValue':_0x10f1('0x1f'),'set':function(_0x3d2600){this[_0x10f1('0xe')](_0x10f1('0x20'),_0x3d2600?_0x3d2600[_0x10f1('0x1c')](';'):_0x10f1('0x1f'));},'get':function(){return this[_0x10f1('0x10')](_0x10f1('0x20'))?this[_0x10f1('0x10')](_0x10f1('0x20'))['split'](';'):null;},'comment':_0x10f1('0x21')},'autoframing':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x10f1('0x22'),'set':function(_0x3807ea){this[_0x10f1('0xe')]('insecure',_0x3807ea?_0x3807ea[_0x10f1('0x1c')](','):null);},'get':function(){return this['getDataValue'](_0x10f1('0x23'))?this[_0x10f1('0x10')](_0x10f1('0x23'))[_0x10f1('0x11')](','):null;},'comment':_0x10f1('0x24')},'trustrpid':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x10f1('0x3')]('yes','no',_0x10f1('0x25'))},'promiscredir':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x10f1('0x1')]},'callerid':{'type':Sequelize[_0x10f1('0x1')],'defaultValue':_0x10f1('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x10f1('0x3')]('yes','no'),'defaultValue':_0x10f1('0x19')},'busylevel':{'type':Sequelize[_0x10f1('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x10f1('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x10f1('0x1')]},'template':{'type':Sequelize[_0x10f1('0x1')]},'videosupport':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no',_0x10f1('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x10f1('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x29'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x10f1('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x10f1('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x2a'),_0x10f1('0x2b')),'defaultValue':_0x10f1('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x10f1('0x1')]},'regexten':{'type':Sequelize[_0x10f1('0x1')]},'fromdomain':{'type':Sequelize[_0x10f1('0x1')]},'fromuser':{'type':Sequelize[_0x10f1('0x1')]},'port':{'type':Sequelize[_0x10f1('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no'),'defaultValue':_0x10f1('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x10f1('0x1')]},'defaultuser':{'type':Sequelize[_0x10f1('0x1')]},'rtptimeout':{'type':Sequelize[_0x10f1('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x10f1('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x10f1('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x10f1('0x1')]},'callbackextension':{'type':Sequelize[_0x10f1('0x1')]},'timert1':{'type':Sequelize[_0x10f1('0x27')](0xb)},'timerb':{'type':Sequelize[_0x10f1('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x10f1('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x10f1('0x1')]},'maxforwards':{'type':Sequelize[_0x10f1('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'icesupport':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x10f1('0x3')]('yes','no',_0x10f1('0x2d'),_0x10f1('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x10f1('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x10f1('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x10f1('0x1')]},'dtlscipher':{'type':Sequelize[_0x10f1('0x1')]},'dtlscafile':{'type':Sequelize[_0x10f1('0x1')]},'dtlscapath':{'type':Sequelize[_0x10f1('0x1')]},'dtlssetup':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x2f'),'passive',_0x10f1('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x10f1('0x1')]},'recordofffeature':{'type':Sequelize[_0x10f1('0x1')]},'call_limit':{'type':Sequelize[_0x10f1('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x10f1('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x10f1('0x3')](_0x10f1('0x19'),'no')},'vmexten':{'type':Sequelize[_0x10f1('0x1')]},'mohinterpret':{'type':Sequelize[_0x10f1('0x1')]},'mohsuggest':{'type':Sequelize[_0x10f1('0x1')]},'parkinglot':{'type':Sequelize[_0x10f1('0x1')]},'description':{'type':Sequelize[_0x10f1('0x1')]},'host':{'type':Sequelize[_0x10f1('0x1')],'defaultValue':_0x10f1('0x31')},'canreinvite':{'type':Sequelize[_0x10f1('0x3')]('yes','no',_0x10f1('0x16'),_0x10f1('0x17'),_0x10f1('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x10f1('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x10f1('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xf4c0=['refuse','uac','uas','certificate','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','rfc2833','info','inband','nonat','update','yes','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','always'];(function(_0x21f964,_0xc2d1d3){var _0x1d4231=function(_0x447623){while(--_0x447623){_0x21f964['push'](_0x21f964['shift']());}};_0x1d4231(++_0xc2d1d3);}(_0xf4c0,0x181));var _0x0f4c=function(_0x13ab50,_0x4be161){_0x13ab50=_0x13ab50-0x0;var _0x53b183=_0xf4c0[_0x13ab50];return _0x53b183;};'use strict';var Sequelize=require('sequelize');module[_0x0f4c('0x0')]={'name':{'type':Sequelize[_0x0f4c('0x1')],'allowNull':![],'unique':_0x0f4c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x4'),_0x0f4c('0x5'),'peer'),'allowNull':![],'defaultValue':_0x0f4c('0x4')},'context':{'type':Sequelize[_0x0f4c('0x1')],'allowNull':![],'defaultValue':_0x0f4c('0x6')},'callingpres':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x7'),_0x0f4c('0x8'),_0x0f4c('0x9'),_0x0f4c('0xa'),'PROHIB_NOT_SCREENED',_0x0f4c('0xb'),_0x0f4c('0xc'),_0x0f4c('0xd'))},'deny':{'type':Sequelize[_0x0f4c('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x0f4c('0x1')]},'md5secret':{'type':Sequelize[_0x0f4c('0x1')]},'remotesecret':{'type':Sequelize[_0x0f4c('0x1')]},'transport':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':_0x0f4c('0xe'),'set':function(_0x464c77){this['setDataValue'](_0x0f4c('0xf'),_0x464c77?_0x464c77[_0x0f4c('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x0f4c('0xf'))?this[_0x0f4c('0x11')](_0x0f4c('0xf'))[_0x0f4c('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x13'),_0x0f4c('0x14'),'shortinfo',_0x0f4c('0x15'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0f4c('0x3')]('yes','no',_0x0f4c('0x16'),_0x0f4c('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0f4c('0x1')]},'directmediadeny':{'type':Sequelize[_0x0f4c('0x1')]},'nat':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x10ccb5){this[_0x0f4c('0x19')]('nat',_0x10ccb5?_0x10ccb5[_0x0f4c('0x10')](','):null);},'get':function(){return this[_0x0f4c('0x11')](_0x0f4c('0x1a'))?this[_0x0f4c('0x11')](_0x0f4c('0x1a'))['split'](','):null;},'comment':_0x0f4c('0x1b')},'callgroup':{'type':Sequelize[_0x0f4c('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0f4c('0x1')]},'pickupgroup':{'type':Sequelize[_0x0f4c('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0f4c('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':_0x0f4c('0x1c')},'allow':{'type':Sequelize[_0x0f4c('0x1')],'allowNull':![],'defaultValue':_0x0f4c('0x1d'),'set':function(_0x218dd9){this['setDataValue'](_0x0f4c('0x1e'),_0x218dd9?_0x218dd9[_0x0f4c('0x10')](';'):_0x0f4c('0x1d'));},'get':function(){return this[_0x0f4c('0x11')](_0x0f4c('0x1e'))?this[_0x0f4c('0x11')](_0x0f4c('0x1e'))[_0x0f4c('0x12')](';'):null;},'comment':_0x0f4c('0x1f')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':_0x0f4c('0x20'),'set':function(_0x44ffa5){this['setDataValue'](_0x0f4c('0x21'),_0x44ffa5?_0x44ffa5[_0x0f4c('0x10')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue'](_0x0f4c('0x21'))[_0x0f4c('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no',_0x0f4c('0x22'))},'promiscredir':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x0f4c('0x23')},'amaflags':{'type':Sequelize[_0x0f4c('0x1')]},'callcounter':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no'),'defaultValue':_0x0f4c('0x18')},'busylevel':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x0f4c('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x0f4c('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no',_0x0f4c('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'mailbox':{'type':Sequelize[_0x0f4c('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x0f4c('0x26'),'originate')},'session_expires':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x27'),_0x0f4c('0x28')),'defaultValue':_0x0f4c('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x0f4c('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x0f4c('0x1')]},'port':{'type':Sequelize[_0x0f4c('0x24')](0x5)},'qualify':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no'),'defaultValue':_0x0f4c('0x18')},'keepalive':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0f4c('0x1')]},'callbackextension':{'type':Sequelize[_0x0f4c('0x1')]},'timert1':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x0f4c('0x1')]},'contactdeny':{'type':Sequelize[_0x0f4c('0x1')]},'contactacl':{'type':Sequelize[_0x0f4c('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x0f4c('0x1')]},'maxforwards':{'type':Sequelize[_0x0f4c('0x24')](0xb)},'encryption':{'type':Sequelize[_0x0f4c('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no')},'icesupport':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x0f4c('0x3')]('yes','no','fingerprint',_0x0f4c('0x29'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0f4c('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0f4c('0x1')]},'dtlscipher':{'type':Sequelize[_0x0f4c('0x1')]},'dtlscafile':{'type':Sequelize[_0x0f4c('0x1')]},'dtlscapath':{'type':Sequelize[_0x0f4c('0x1')]},'dtlssetup':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x2a'),_0x0f4c('0x2b'),_0x0f4c('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0f4c('0x1')]},'usereqphone':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0f4c('0x1')]},'recordofffeature':{'type':Sequelize[_0x0f4c('0x1')]},'call_limit':{'type':Sequelize[_0x0f4c('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0f4c('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no')},'vmexten':{'type':Sequelize[_0x0f4c('0x1')]},'mohinterpret':{'type':Sequelize[_0x0f4c('0x1')]},'mohsuggest':{'type':Sequelize[_0x0f4c('0x1')]},'parkinglot':{'type':Sequelize[_0x0f4c('0x1')]},'description':{'type':Sequelize[_0x0f4c('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x0f4c('0x2d')},'canreinvite':{'type':Sequelize[_0x0f4c('0x3')](_0x0f4c('0x18'),'no',_0x0f4c('0x16'),_0x0f4c('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0f4c('0x1')]},'otherFields':{'type':Sequelize[_0x0f4c('0x1')]},'active':{'type':Sequelize[_0x0f4c('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0f4c('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 00212c2..398d9cd 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x37d08d,_0xa885be){var _0x2c68b8=function(_0x1e3362){while(--_0x1e3362){_0x37d08d['push'](_0x37d08d['shift']());}};_0x2c68b8(++_0xa885be);}(_0xe14d,0x1ee));var _0xde14=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xe14d[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file +var _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x2f43dc,_0x338c96){var _0x1c60cf=function(_0x6317c4){while(--_0x6317c4){_0x2f43dc['push'](_0x2f43dc['shift']());}};_0x1c60cf(++_0x338c96);}(_0xdace,0xc5));var _0xedac=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xdace[_0x117f4c];return _0x2b24e9;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 5137d1f..fa3f0d9 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 _0x74dd=['rimraf','../../config/environment','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x22522d,_0x34d647){var _0x154a54=function(_0x10dd4e){while(--_0x10dd4e){_0x22522d['push'](_0x22522d['shift']());}};_0x154a54(++_0x34d647);}(_0x74dd,0x6e));var _0xd74d=function(_0x469fe3,_0x1c116f){_0x469fe3=_0x469fe3-0x0;var _0x323496=_0x74dd[_0x469fe3];return _0x323496;};'use strict';var _=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var logger=require(_0xd74d('0x2'))(_0xd74d('0x3'));var moment=require('moment');var BPromise=require(_0xd74d('0x4'));var rp=require(_0xd74d('0x5'));var fs=require('fs');var path=require(_0xd74d('0x6'));var rimraf=require(_0xd74d('0x7'));var config=require(_0xd74d('0x8'));var attributes=require('./trunk.attributes');module[_0xd74d('0x9')]=function(_0x3c281e,_0x3b7d1f){return _0x3c281e[_0xd74d('0xa')](_0xd74d('0xb'),attributes,{'tableName':_0xd74d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b4e=['tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','Trunk'];(function(_0xb92a00,_0x210172){var _0x39b437=function(_0x176675){while(--_0x176675){_0xb92a00['push'](_0xb92a00['shift']());}};_0x39b437(++_0x210172);}(_0x4b4e,0x1e2));var _0xe4b4=function(_0x21cc35,_0x4e715c){_0x21cc35=_0x21cc35-0x0;var _0x4cae2b=_0x4b4e[_0x21cc35];return _0x4cae2b;};'use strict';var _=require(_0xe4b4('0x0'));var util=require(_0xe4b4('0x1'));var logger=require(_0xe4b4('0x2'))(_0xe4b4('0x3'));var moment=require(_0xe4b4('0x4'));var BPromise=require(_0xe4b4('0x5'));var rp=require(_0xe4b4('0x6'));var fs=require('fs');var path=require(_0xe4b4('0x7'));var rimraf=require(_0xe4b4('0x8'));var config=require(_0xe4b4('0x9'));var attributes=require(_0xe4b4('0xa'));module['exports']=function(_0x276616,_0x4f1903){return _0x276616['define'](_0xe4b4('0xb'),attributes,{'tableName':_0xe4b4('0xc'),'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 3dbf482..fe45b72 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 _0xb156=['jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4c28b2,_0x55b2ae){var _0x587078=function(_0x504e24){while(--_0x504e24){_0x4c28b2['push'](_0x4c28b2['shift']());}};_0x587078(++_0x55b2ae);}(_0xb156,0x1a7));var _0x6b15=function(_0x5d75ff,_0x5bc7ac){_0x5d75ff=_0x5d75ff-0x0;var _0x1c1894=_0xb156[_0x5d75ff];return _0x1c1894;};'use strict';var _=require(_0x6b15('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b15('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b15('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b15('0x3'))(_0x6b15('0x4'));var config=require(_0x6b15('0x5'));var jayson=require(_0x6b15('0x6'));var client=jayson['client'][_0x6b15('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x540bc9,_0x4f66a7,_0x70be81){return new BPromise(function(_0x48c5f1,_0x184fa9){return client[_0x6b15('0x8')](_0x540bc9,_0x70be81)[_0x6b15('0x9')](function(_0x269f02){logger[_0x6b15('0xa')](_0x6b15('0xb'),_0x4f66a7,_0x6b15('0xc'));logger[_0x6b15('0xd')](_0x6b15('0xe'),_0x4f66a7,_0x6b15('0xc'),JSON[_0x6b15('0xf')](_0x269f02));if(_0x269f02[_0x6b15('0x10')]){if(_0x269f02[_0x6b15('0x10')]['code']===0x1f4){logger[_0x6b15('0x10')]('Trunk,\x20%s,\x20%s',_0x4f66a7,_0x269f02[_0x6b15('0x10')][_0x6b15('0x11')]);return _0x184fa9(_0x269f02[_0x6b15('0x10')][_0x6b15('0x11')]);}logger['error'](_0x6b15('0xb'),_0x4f66a7,_0x269f02[_0x6b15('0x10')][_0x6b15('0x11')]);return _0x48c5f1(_0x269f02[_0x6b15('0x10')][_0x6b15('0x11')]);}else{logger[_0x6b15('0xa')](_0x6b15('0xb'),_0x4f66a7,_0x6b15('0xc'));_0x48c5f1(_0x269f02[_0x6b15('0x12')][_0x6b15('0x11')]);}})[_0x6b15('0x13')](function(_0x495338){logger[_0x6b15('0x10')](_0x6b15('0xb'),_0x4f66a7,_0x495338);_0x184fa9(_0x495338);});});}exports[_0x6b15('0x14')]=function(_0x14ddac){var _0x1449b2=this;return new Promise(function(_0x32cc65,_0x352b10){return db[_0x6b15('0x15')][_0x6b15('0x16')]({'raw':_0x14ddac[_0x6b15('0x17')]?_0x14ddac[_0x6b15('0x17')][_0x6b15('0x18')]===undefined?!![]:![]:!![],'where':_0x14ddac[_0x6b15('0x17')]?_0x14ddac[_0x6b15('0x17')][_0x6b15('0x19')]||null:null,'attributes':_0x14ddac['options']?_0x14ddac[_0x6b15('0x17')][_0x6b15('0x1a')]||null:null,'limit':_0x14ddac[_0x6b15('0x17')]?_0x14ddac['options'][_0x6b15('0x1b')]||null:null,'include':_0x14ddac[_0x6b15('0x17')]?_0x14ddac[_0x6b15('0x17')][_0x6b15('0x1c')]?_[_0x6b15('0x1d')](_0x14ddac[_0x6b15('0x17')][_0x6b15('0x1c')],function(_0x34f938){return{'model':db[_0x34f938[_0x6b15('0x1e')]],'as':_0x34f938['as'],'attributes':_0x34f938[_0x6b15('0x1a')],'include':_0x34f938['include']?_['map'](_0x34f938[_0x6b15('0x1c')],function(_0x587c0e){return{'model':db[_0x587c0e[_0x6b15('0x1e')]],'as':_0x587c0e['as'],'attributes':_0x587c0e[_0x6b15('0x1a')],'include':_0x587c0e[_0x6b15('0x1c')]?_['map'](_0x587c0e[_0x6b15('0x1c')],function(_0x441ed6){return{'model':db[_0x441ed6[_0x6b15('0x1e')]],'as':_0x441ed6['as'],'attributes':_0x441ed6[_0x6b15('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c80d){logger['info'](_0x6b15('0x14'),_0x14ddac);logger['debug']('GetTrunk',_0x14ddac,JSON[_0x6b15('0xf')](_0x27c80d));_0x32cc65(_0x27c80d);})['catch'](function(_0x2c508d){logger[_0x6b15('0x10')](_0x6b15('0x14'),_0x2c508d[_0x6b15('0x11')],_0x14ddac);_0x352b10(_0x1449b2['error'](0x1f4,_0x2c508d[_0x6b15('0x11')]));});});};exports[_0x6b15('0x1f')]=function(_0x4afeec){var _0x4d5c84=this;return new Promise(function(_0x3050eb,_0x1be98c){return db[_0x6b15('0x15')][_0x6b15('0x20')]({'raw':_0x4afeec[_0x6b15('0x17')]?_0x4afeec[_0x6b15('0x17')][_0x6b15('0x18')]===undefined?!![]:![]:!![],'where':_0x4afeec[_0x6b15('0x17')]?_0x4afeec['options']['where']||null:null,'attributes':_0x4afeec['options']?_0x4afeec[_0x6b15('0x17')]['attributes']||null:null,'include':_0x4afeec[_0x6b15('0x17')]?_0x4afeec['options'][_0x6b15('0x1c')]?_['map'](_0x4afeec[_0x6b15('0x17')][_0x6b15('0x1c')],function(_0x56dab8){return{'model':db[_0x56dab8[_0x6b15('0x1e')]],'as':_0x56dab8['as'],'attributes':_0x56dab8[_0x6b15('0x1a')],'include':_0x56dab8[_0x6b15('0x1c')]?_[_0x6b15('0x1d')](_0x56dab8['include'],function(_0xf4ff61){return{'model':db[_0xf4ff61[_0x6b15('0x1e')]],'as':_0xf4ff61['as'],'attributes':_0xf4ff61[_0x6b15('0x1a')],'include':_0xf4ff61[_0x6b15('0x1c')]?_['map'](_0xf4ff61['include'],function(_0xddbf3f){return{'model':db[_0xddbf3f[_0x6b15('0x1e')]],'as':_0xddbf3f['as'],'attributes':_0xddbf3f[_0x6b15('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6b15('0x9')](function(_0x3c7035){logger[_0x6b15('0xa')](_0x6b15('0x1f'),_0x4afeec);logger[_0x6b15('0xd')](_0x6b15('0x1f'),_0x4afeec,JSON[_0x6b15('0xf')](_0x3c7035));_0x3050eb(_0x3c7035);})[_0x6b15('0x13')](function(_0x534ef9){logger['error'](_0x6b15('0x1f'),_0x534ef9[_0x6b15('0x11')],_0x4afeec);_0x1be98c(_0x4d5c84[_0x6b15('0x10')](0x1f4,_0x534ef9[_0x6b15('0x11')]));});});}; \ No newline at end of file +var _0x9631=['stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','model','include','debug','ShowTrunk','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9631,0x83));var _0x1963=function(_0x32b301,_0x380389){_0x32b301=_0x32b301-0x0;var _0xd0c417=_0x9631[_0x32b301];return _0xd0c417;};'use strict';var _=require(_0x1963('0x0'));var util=require(_0x1963('0x1'));var moment=require('moment');var BPromise=require(_0x1963('0x2'));var rs=require(_0x1963('0x3'));var fs=require('fs');var Redis=require(_0x1963('0x4'));var db=require(_0x1963('0x5'))['db'];var utils=require(_0x1963('0x6'));var logger=require(_0x1963('0x7'))(_0x1963('0x8'));var config=require(_0x1963('0x9'));var jayson=require(_0x1963('0xa'));var client=jayson[_0x1963('0xb')][_0x1963('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f3c70,_0x58d656,_0x43041a){return new BPromise(function(_0x3054eb,_0x5cc3a4){return client[_0x1963('0xd')](_0x1f3c70,_0x43041a)['then'](function(_0x4f3676){logger[_0x1963('0xe')](_0x1963('0xf'),_0x58d656,_0x1963('0x10'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x58d656,_0x1963('0x10'),JSON[_0x1963('0x11')](_0x4f3676));if(_0x4f3676[_0x1963('0x12')]){if(_0x4f3676[_0x1963('0x12')][_0x1963('0x13')]===0x1f4){logger['error'](_0x1963('0xf'),_0x58d656,_0x4f3676[_0x1963('0x12')][_0x1963('0x14')]);return _0x5cc3a4(_0x4f3676['error'][_0x1963('0x14')]);}logger[_0x1963('0x12')](_0x1963('0xf'),_0x58d656,_0x4f3676['error']['message']);return _0x3054eb(_0x4f3676[_0x1963('0x12')][_0x1963('0x14')]);}else{logger['info'](_0x1963('0xf'),_0x58d656,'request\x20sent');_0x3054eb(_0x4f3676[_0x1963('0x15')][_0x1963('0x14')]);}})[_0x1963('0x16')](function(_0x4fadce){logger['error'](_0x1963('0xf'),_0x58d656,_0x4fadce);_0x5cc3a4(_0x4fadce);});});}exports[_0x1963('0x17')]=function(_0x528ec1){var _0x18d5b7=this;return new Promise(function(_0x5cd4de,_0x5e3cc3){return db[_0x1963('0x18')][_0x1963('0x19')]({'raw':_0x528ec1['options']?_0x528ec1[_0x1963('0x1a')][_0x1963('0x1b')]===undefined?!![]:![]:!![],'where':_0x528ec1[_0x1963('0x1a')]?_0x528ec1[_0x1963('0x1a')][_0x1963('0x1c')]||null:null,'attributes':_0x528ec1[_0x1963('0x1a')]?_0x528ec1[_0x1963('0x1a')][_0x1963('0x1d')]||null:null,'limit':_0x528ec1['options']?_0x528ec1[_0x1963('0x1a')][_0x1963('0x1e')]||null:null,'include':_0x528ec1['options']?_0x528ec1[_0x1963('0x1a')]['include']?_[_0x1963('0x1f')](_0x528ec1[_0x1963('0x1a')]['include'],function(_0x31b6df){return{'model':db[_0x31b6df[_0x1963('0x20')]],'as':_0x31b6df['as'],'attributes':_0x31b6df[_0x1963('0x1d')],'include':_0x31b6df[_0x1963('0x21')]?_['map'](_0x31b6df[_0x1963('0x21')],function(_0x563cd9){return{'model':db[_0x563cd9[_0x1963('0x20')]],'as':_0x563cd9['as'],'attributes':_0x563cd9[_0x1963('0x1d')],'include':_0x563cd9[_0x1963('0x21')]?_[_0x1963('0x1f')](_0x563cd9['include'],function(_0x5d5b8f){return{'model':db[_0x5d5b8f[_0x1963('0x20')]],'as':_0x5d5b8f['as'],'attributes':_0x5d5b8f[_0x1963('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f4b5a){logger[_0x1963('0xe')](_0x1963('0x17'),_0x528ec1);logger[_0x1963('0x22')](_0x1963('0x17'),_0x528ec1,JSON['stringify'](_0x2f4b5a));_0x5cd4de(_0x2f4b5a);})['catch'](function(_0x45fb75){logger[_0x1963('0x12')]('GetTrunk',_0x45fb75[_0x1963('0x14')],_0x528ec1);_0x5e3cc3(_0x18d5b7['error'](0x1f4,_0x45fb75[_0x1963('0x14')]));});});};exports[_0x1963('0x23')]=function(_0x58d559){var _0x4eecc7=this;return new Promise(function(_0xfdae4a,_0x2ae80c){return db[_0x1963('0x18')]['find']({'raw':_0x58d559[_0x1963('0x1a')]?_0x58d559[_0x1963('0x1a')][_0x1963('0x1b')]===undefined?!![]:![]:!![],'where':_0x58d559[_0x1963('0x1a')]?_0x58d559[_0x1963('0x1a')][_0x1963('0x1c')]||null:null,'attributes':_0x58d559['options']?_0x58d559[_0x1963('0x1a')][_0x1963('0x1d')]||null:null,'include':_0x58d559[_0x1963('0x1a')]?_0x58d559['options'][_0x1963('0x21')]?_['map'](_0x58d559['options'][_0x1963('0x21')],function(_0x40947f){return{'model':db[_0x40947f[_0x1963('0x20')]],'as':_0x40947f['as'],'attributes':_0x40947f[_0x1963('0x1d')],'include':_0x40947f['include']?_[_0x1963('0x1f')](_0x40947f[_0x1963('0x21')],function(_0x444642){return{'model':db[_0x444642[_0x1963('0x20')]],'as':_0x444642['as'],'attributes':_0x444642['attributes'],'include':_0x444642['include']?_[_0x1963('0x1f')](_0x444642['include'],function(_0x21be7b){return{'model':db[_0x21be7b[_0x1963('0x20')]],'as':_0x21be7b['as'],'attributes':_0x21be7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1963('0x24')](function(_0x52164f){logger['info']('ShowTrunk',_0x58d559);logger[_0x1963('0x22')](_0x1963('0x23'),_0x58d559,JSON['stringify'](_0x52164f));_0xfdae4a(_0x52164f);})[_0x1963('0x16')](function(_0x725010){logger[_0x1963('0x12')]('ShowTrunk',_0x725010[_0x1963('0x14')],_0x58d559);_0x2ae80c(_0x4eecc7['error'](0x1f4,_0x725010[_0x1963('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index bf5cf48..55492bf 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 _0xfdde=['isAuthenticated','update','exports','express','../../components/auth/service','./user-setting.controller','/:id'];(function(_0x46e5b2,_0x312cbf){var _0x2ffde5=function(_0x4ed565){while(--_0x4ed565){_0x46e5b2['push'](_0x46e5b2['shift']());}};_0x2ffde5(++_0x312cbf);}(_0xfdde,0x11b));var _0xefdd=function(_0x19ac0c,_0x4d794c){_0x19ac0c=_0x19ac0c-0x0;var _0xe90175=_0xfdde[_0x19ac0c];return _0xe90175;};'use strict';var express=require(_0xefdd('0x0'));var router=express['Router']();var auth=require(_0xefdd('0x1'));var controller=require(_0xefdd('0x2'));router['put'](_0xefdd('0x3'),auth[_0xefdd('0x4')](),controller[_0xefdd('0x5')]);module[_0xefdd('0x6')]=router; \ No newline at end of file +var _0x6392=['express','Router','../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','exports'];(function(_0x1c0eee,_0x257cd8){var _0x33aaf1=function(_0x2b644c){while(--_0x2b644c){_0x1c0eee['push'](_0x1c0eee['shift']());}};_0x33aaf1(++_0x257cd8);}(_0x6392,0x181));var _0x2639=function(_0x54d5ac,_0x31a3f8){_0x54d5ac=_0x54d5ac-0x0;var _0x28dc98=_0x6392[_0x54d5ac];return _0x28dc98;};'use strict';var express=require(_0x2639('0x0'));var router=express[_0x2639('0x1')]();var auth=require(_0x2639('0x2'));var controller=require(_0x2639('0x3'));router['put'](_0x2639('0x4'),auth[_0x2639('0x5')](),controller['update']);module[_0x2639('0x6')]=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 0ed6218..7716844 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 _0x7dc1=['BOOLEAN','TEXT','DATE','UserId','sequelize','error','info','debug','exports','ENUM'];(function(_0x26660c,_0xa474ef){var _0x21fb98=function(_0xcedc16){while(--_0xcedc16){_0x26660c['push'](_0x26660c['shift']());}};_0x21fb98(++_0xa474ef);}(_0x7dc1,0x68));var _0x17dc=function(_0x2dfe42,_0x27e37d){_0x2dfe42=_0x2dfe42-0x0;var _0x3ba3b5=_0x7dc1[_0x2dfe42];return _0x3ba3b5;};'use strict';var Sequelize=require(_0x17dc('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x17dc('0x1'),'warning',_0x17dc('0x2'),_0x17dc('0x3')];module[_0x17dc('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x17dc('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x17dc('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x17dc('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x17dc('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x17dc('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x17dc('0x9')}}; \ No newline at end of file +var _0x49be=['sequelize','error','warning','debug','exports','TEXT','DATE','INTEGER'];(function(_0x39c638,_0x3753ac){var _0x5ba8c9=function(_0xfd7887){while(--_0xfd7887){_0x39c638['push'](_0x39c638['shift']());}};_0x5ba8c9(++_0x3753ac);}(_0x49be,0x170));var _0xe49b=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x49be[_0x35b2a1];return _0x6023da;};'use strict';var Sequelize=require(_0xe49b('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xe49b('0x1'),_0xe49b('0x2'),'info',_0xe49b('0x3')];module[_0xe49b('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe49b('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe49b('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe49b('0x7')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 0dd876f..8816d28 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 _0x303a=['user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','then','sendStatus','stack','name','status','send'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x303a,0x1a0));var _0xa303=function(_0xac8e9c,_0x2570bd){_0xac8e9c=_0xac8e9c-0x0;var _0x4eab81=_0x303a[_0xac8e9c];return _0x4eab81;};'use strict';var _=require(_0xa303('0x0'));var Redis=require('ioredis');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var config=require(_0xa303('0x3'));var db=require(_0xa303('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xa303('0x5')]));require(_0xa303('0x6'))[_0xa303('0x7')](socket);config[_0xa303('0x5')]=_[_0xa303('0x8')](config[_0xa303('0x5')],{'host':_0xa303('0x9'),'port':0x18eb});function respondWithResult(_0x3f61f1,_0x69b173){_0x69b173=_0x69b173||0xc8;return function(_0x5d95fd){if(_0x5d95fd){return _0x3f61f1['status'](_0x69b173)['json'](_0x5d95fd);}};}function saveUpdates(_0x9142e7){return function(_0x153544){if(_0x153544){return _0x153544['update'](_0x9142e7)[_0xa303('0xa')](function(_0x51acca){return _0x51acca;});}return null;};}function handleEntityNotFound(_0x1e7281){return function(_0x59f18a){if(!_0x59f18a){_0x1e7281[_0xa303('0xb')](0x194);}return _0x59f18a;};}function handleError(_0x17dfcd,_0x382cfd){_0x382cfd=_0x382cfd||0x1f4;return function(_0x3a8467){logger['error'](_0x3a8467[_0xa303('0xc')]);if(_0x3a8467['name']){delete _0x3a8467[_0xa303('0xd')];}_0x17dfcd[_0xa303('0xe')](_0x382cfd)[_0xa303('0xf')](_0x3a8467);};}exports['update']=function(_0xe87c60,_0x17d39b){if(_0xe87c60[_0xa303('0x10')][_0xa303('0x11')]!==_0xa303('0x12'))throw new Error(_0xa303('0x13'));if(isNaN(Number(_0xe87c60[_0xa303('0x14')]['id'])))throw new Error(_0xa303('0x15'));return db['UserSetting'][_0xa303('0x16')]({'where':{'id':_0xe87c60[_0xa303('0x14')]['id']}})[_0xa303('0xa')](handleEntityNotFound(_0x17d39b,null))[_0xa303('0xa')](saveUpdates(_0xe87c60[_0xa303('0x17')],null))[_0xa303('0xa')](respondWithResult(_0x17d39b,null))['catch'](handleError(_0x17d39b,null));}; \ No newline at end of file +var _0x6108=['../../config/logger','api','../../config/environment','redis','./user-setting.socket','defaults','localhost','json','then','sendStatus','error','stack','name','send','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','body','lodash'];(function(_0x31d03c,_0x158cef){var _0x420e61=function(_0x1ddac1){while(--_0x1ddac1){_0x31d03c['push'](_0x31d03c['shift']());}};_0x420e61(++_0x158cef);}(_0x6108,0xbc));var _0x8610=function(_0xd7f35a,_0x202b40){_0xd7f35a=_0xd7f35a-0x0;var _0x23f895=_0x6108[_0xd7f35a];return _0x23f895;};'use strict';var _=require(_0x8610('0x0'));var Redis=require('ioredis');var logger=require(_0x8610('0x1'))(_0x8610('0x2'));var config=require(_0x8610('0x3'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x8610('0x4')]));require(_0x8610('0x5'))['register'](socket);config['redis']=_[_0x8610('0x6')](config[_0x8610('0x4')],{'host':_0x8610('0x7'),'port':0x18eb});function respondWithResult(_0x26dab3,_0x4e0fe4){_0x4e0fe4=_0x4e0fe4||0xc8;return function(_0x174f41){if(_0x174f41){return _0x26dab3['status'](_0x4e0fe4)[_0x8610('0x8')](_0x174f41);}};}function saveUpdates(_0x2255a0){return function(_0x21774e){if(_0x21774e){return _0x21774e['update'](_0x2255a0)[_0x8610('0x9')](function(_0x3682b9){return _0x3682b9;});}return null;};}function handleEntityNotFound(_0x46854f){return function(_0x1eb419){if(!_0x1eb419){_0x46854f[_0x8610('0xa')](0x194);}return _0x1eb419;};}function handleError(_0x1da432,_0x4b3af2){_0x4b3af2=_0x4b3af2||0x1f4;return function(_0x1b6c16){logger[_0x8610('0xb')](_0x1b6c16[_0x8610('0xc')]);if(_0x1b6c16['name']){delete _0x1b6c16[_0x8610('0xd')];}_0x1da432['status'](_0x4b3af2)[_0x8610('0xe')](_0x1b6c16);};}exports[_0x8610('0xf')]=function(_0x413324,_0x277942){if(_0x413324[_0x8610('0x10')]['role']!=='admin')throw new Error(_0x8610('0x11'));if(isNaN(Number(_0x413324[_0x8610('0x12')]['id'])))throw new Error(_0x8610('0x13'));return db['UserSetting']['find']({'where':{'id':_0x413324['params']['id']}})[_0x8610('0x9')](handleEntityNotFound(_0x277942,null))[_0x8610('0x9')](saveUpdates(_0x413324[_0x8610('0x14')],null))[_0x8610('0x9')](respondWithResult(_0x277942,null))['catch'](handleError(_0x277942,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 624ee92..5ff37f2 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 _0x7f22=['update','remove','emit','hasOwnProperty','exports','events','UserSetting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f22,0x12b));var _0x27f2=function(_0x386537,_0x5347ee){_0x386537=_0x386537-0x0;var _0x128b62=_0x7f22[_0x386537];return _0x128b62;};'use strict';var EventEmitter=require(_0x27f2('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x27f2('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x27f2('0x2'),'afterDestroy':_0x27f2('0x3')};function emitEvent(_0x3eaca0){return function(_0x26394e,_0x11ca4d,_0x2a8a73){UserSettingEvents[_0x27f2('0x4')](_0x3eaca0+':'+_0x26394e['id'],_0x26394e);UserSettingEvents['emit'](_0x3eaca0,_0x26394e);_0x2a8a73(null);};}for(var e in events){if(events[_0x27f2('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x27f2('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xc696=['events','../../mysqldb','UserSetting','save','remove','emit','hasOwnProperty','exports'];(function(_0x1e204d,_0x1d1d01){var _0x45295c=function(_0x57725d){while(--_0x57725d){_0x1e204d['push'](_0x1e204d['shift']());}};_0x45295c(++_0x1d1d01);}(_0xc696,0x1d0));var _0x6c69=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xc696[_0x2283dc];return _0x16db90;};'use strict';var EventEmitter=require(_0x6c69('0x0'));var UserSetting=require(_0x6c69('0x1'))['db'][_0x6c69('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c69('0x3'),'afterUpdate':'update','afterDestroy':_0x6c69('0x4')};function emitEvent(_0x93e55b){return function(_0x2b3f74,_0x302e64,_0x41aad5){UserSettingEvents[_0x6c69('0x5')](_0x93e55b+':'+_0x2b3f74['id'],_0x2b3f74);UserSettingEvents['emit'](_0x93e55b,_0x2b3f74);_0x41aad5(null);};}for(var e in events){if(events[_0x6c69('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x6c69('0x7')]=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 048b9c4..f3473e9 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 _0xde2c=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x2955be,_0x17e9c4){var _0x27604b=function(_0x16adc0){while(--_0x16adc0){_0x2955be['push'](_0x2955be['shift']());}};_0x27604b(++_0x17e9c4);}(_0xde2c,0x7f));var _0xcde2=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xde2c[_0x14fad0];return _0x5c665f;};'use strict';var attributes=require(_0xcde2('0x0'));module[_0xcde2('0x1')]=function(_0x2f5f10){return _0x2f5f10[_0xcde2('0x2')](_0xcde2('0x3'),attributes,{'tableName':_0xcde2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33bb0c){if(!_0x33bb0c[_0xcde2('0x5')])_0x33bb0c['clientSideLoggingEnabledSince']=null;else if(_0x33bb0c[_0xcde2('0x6')]===null)_0x33bb0c[_0xcde2('0x6')]=new Date();}}});}; \ No newline at end of file +var _0xffaa=['exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x45a528,_0x36ed5d){var _0x5db6c5=function(_0x58296d){while(--_0x58296d){_0x45a528['push'](_0x45a528['shift']());}};_0x5db6c5(++_0x36ed5d);}(_0xffaa,0x130));var _0xaffa=function(_0x844ba1,_0x56340b){_0x844ba1=_0x844ba1-0x0;var _0x93b575=_0xffaa[_0x844ba1];return _0x93b575;};'use strict';var attributes=require(_0xaffa('0x0'));module[_0xaffa('0x1')]=function(_0x2c0e94){return _0x2c0e94['define']('UserSetting',attributes,{'tableName':_0xaffa('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2433d9){if(!_0x2433d9[_0xaffa('0x3')])_0x2433d9[_0xaffa('0x4')]=null;else if(_0x2433d9[_0xaffa('0x4')]===null)_0x2433d9[_0xaffa('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index caa4b25..8d49257 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 _0xb2c5=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','user-setting:','save'];(function(_0x57e774,_0x51559e){var _0x23169c=function(_0x37dd0d){while(--_0x37dd0d){_0x57e774['push'](_0x57e774['shift']());}};_0x23169c(++_0x51559e);}(_0xb2c5,0x1e7));var _0x5b2c=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xb2c5[_0x4629ed];return _0x52ca04;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x5b2c('0x0'),'remove',_0x5b2c('0x1')];function createListener(_0x1e6125,_0x5a4bbc){return function(_0x18286e){_0x5a4bbc[_0x5b2c('0x2')](_0x1e6125,_0x18286e);if(_0x1e6125===_0x5b2c('0x3')){_0x5a4bbc[_0x5b2c('0x2')](_0x5b2c('0x4')+_0x18286e[_0x5b2c('0x5')],_0x18286e);}};}exports[_0x5b2c('0x6')]=function(_0x357737){for(var _0x55d741=0x0,_0x395fd0=events['length'];_0x55d741<_0x395fd0;_0x55d741++){var _0x4779aa=events[_0x55d741];var _0x4f6f76=createListener(_0x5b2c('0x7')+_0x4779aa,_0x357737);UserSettingEvents['on'](_0x4779aa,_0x4f6f76);}}; \ No newline at end of file +var _0x9513=['update','emit','user-setting:update','user-setting:update:user-','length','user-setting:','./user-setting.events','save','remove'];(function(_0x958fe5,_0x20dcbb){var _0x3e6d0e=function(_0xfd4947){while(--_0xfd4947){_0x958fe5['push'](_0x958fe5['shift']());}};_0x3e6d0e(++_0x20dcbb);}(_0x9513,0x102));var _0x3951=function(_0x578b28,_0x1525f8){_0x578b28=_0x578b28-0x0;var _0x105756=_0x9513[_0x578b28];return _0x105756;};'use strict';var UserSettingEvents=require(_0x3951('0x0'));var events=[_0x3951('0x1'),_0x3951('0x2'),_0x3951('0x3')];function createListener(_0xc99728,_0x3f145b){return function(_0x47af6f){_0x3f145b[_0x3951('0x4')](_0xc99728,_0x47af6f);if(_0xc99728===_0x3951('0x5')){_0x3f145b[_0x3951('0x4')](_0x3951('0x6')+_0x47af6f['UserId'],_0x47af6f);}};}exports['register']=function(_0x4f830d){for(var _0x3c3c36=0x0,_0x2c0f22=events[_0x3951('0x7')];_0x3c3c36<_0x2c0f22;_0x3c3c36++){var _0x1b5a47=events[_0x3c3c36];var _0x44c076=createListener(_0x3951('0x8')+_0x1b5a47,_0x4f830d);UserSettingEvents['on'](_0x1b5a47,_0x44c076);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 8f4b8c3..53f7d7d 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 _0xac9b=['removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/: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','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','create','/create_many','diskStorage','join','root','server/files/images/','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeMailInteractions','removeSmsInteractions'];(function(_0x1e6521,_0x5b805c){var _0x549b2c=function(_0x26b54f){while(--_0x26b54f){_0x1e6521['push'](_0x1e6521['shift']());}};_0x549b2c(++_0x5b805c);}(_0xac9b,0x7a));var _0xbac9=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xac9b[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require('multer');var util=require(_0xbac9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbac9('0x1'));var router=express[_0xbac9('0x2')]();var fs_extra=require(_0xbac9('0x3'));var auth=require(_0xbac9('0x4'));var interaction=require(_0xbac9('0x5'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0xbac9('0x6')](),controller['index']);router[_0xbac9('0x7')](_0xbac9('0x8'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x9')]);router[_0xbac9('0x7')](_0xbac9('0xa'),auth['isAuthenticated'](),controller[_0xbac9('0xb')]);router[_0xbac9('0x7')](_0xbac9('0xc'),auth[_0xbac9('0x6')](),controller[_0xbac9('0xd')]);router[_0xbac9('0x7')]('/:id',auth[_0xbac9('0x6')](),controller['show']);router['get'](_0xbac9('0xe'),controller[_0xbac9('0xf')]);router[_0xbac9('0x7')](_0xbac9('0x10'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x11')]);router[_0xbac9('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xbac9('0x12')]);router[_0xbac9('0x7')](_0xbac9('0x13'),auth[_0xbac9('0x6')](),controller['getQueues']);router[_0xbac9('0x7')](_0xbac9('0x14'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x15')]);router[_0xbac9('0x7')]('/:id/groups',auth[_0xbac9('0x6')](),controller[_0xbac9('0x16')]);router['get'](_0xbac9('0x17'),auth['isAuthenticated'](),controller[_0xbac9('0x18')]);router[_0xbac9('0x7')](_0xbac9('0x19'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x1a')]);router[_0xbac9('0x7')]('/:id/chat/interactions',auth[_0xbac9('0x6')](),controller['getChatInteractions']);router[_0xbac9('0x7')](_0xbac9('0x1b'),auth[_0xbac9('0x6')](),controller['getOpenchannelInteractions']);router[_0xbac9('0x7')](_0xbac9('0x1c'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x1d')]);router['get'](_0xbac9('0x1e'),auth[_0xbac9('0x6')](),controller['getSmsInteractions']);router[_0xbac9('0x7')](_0xbac9('0x1f'),auth['isAuthenticated'](),controller['getFaxInteractions']);router['get'](_0xbac9('0x20'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x21')]);router['get'](_0xbac9('0x22'),auth[_0xbac9('0x6')](),controller['getTeams']);router['get'](_0xbac9('0x23'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x24')]);router[_0xbac9('0x7')](_0xbac9('0x25'),auth['isAuthenticated'](),controller[_0xbac9('0x26')]);router[_0xbac9('0x7')](_0xbac9('0x27'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x28')]);router[_0xbac9('0x7')](_0xbac9('0x29'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x2a')]);router[_0xbac9('0x7')](_0xbac9('0x2b'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x2c')]);router['get'](_0xbac9('0x2d'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x2e')]);router[_0xbac9('0x7')](_0xbac9('0x2f'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x30')]);router[_0xbac9('0x7')](_0xbac9('0x31'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x32')]);router[_0xbac9('0x7')](_0xbac9('0x33'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0xbac9('0x34'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x35')]);router[_0xbac9('0x7')]('/:id/api_key',auth[_0xbac9('0x6')](),controller[_0xbac9('0x36')]);router[_0xbac9('0x37')](_0xbac9('0x38'),auth['isAuthenticated'](),controller[_0xbac9('0x39')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbac9('0x3a')]);router[_0xbac9('0x37')](_0xbac9('0x3b'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xbac9('0x37')](_0xbac9('0x13'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xbac9('0x3c')]({'destination':function(_0x27f995,_0x36551a,_0x145ace){_0x145ace(null,path[_0xbac9('0x3d')](config[_0xbac9('0x3e')],_0xbac9('0x3f')));},'filename':function(_0x5e6f97,_0xce814e,_0x3f8e2d){_0x3f8e2d(null,util['format']('%s-%s',Date[_0xbac9('0x40')](),_0xce814e[_0xbac9('0x41')]));}})});router['post']('/:id/avatar',upload[_0xbac9('0x42')](_0xbac9('0x43')),controller[_0xbac9('0x44')]);router[_0xbac9('0x37')](_0xbac9('0x45'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x46')]);router[_0xbac9('0x37')]('/:id/logout',auth[_0xbac9('0x6')](),controller[_0xbac9('0x47')]);router[_0xbac9('0x37')](_0xbac9('0x48'),auth['isAuthenticated'](),controller[_0xbac9('0x49')]);router[_0xbac9('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0xbac9('0x37')](_0xbac9('0x22'),auth[_0xbac9('0x6')](),controller['addTeams']);router[_0xbac9('0x37')](_0xbac9('0x4a'),auth['isAuthenticated'](),controller[_0xbac9('0x4b')]);router[_0xbac9('0x37')](_0xbac9('0x4c'),auth['isAuthenticated'](),controller[_0xbac9('0x4d')]);router[_0xbac9('0x37')]('/:id/fax_interactions',auth[_0xbac9('0x6')](),controller[_0xbac9('0x4e')]);router[_0xbac9('0x37')](_0xbac9('0x4f'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x50')]);router[_0xbac9('0x37')](_0xbac9('0x51'),auth[_0xbac9('0x6')](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth[_0xbac9('0x6')](),controller[_0xbac9('0x52')]);router[_0xbac9('0x37')](_0xbac9('0x29'),auth[_0xbac9('0x6')](),controller['addFaxAccounts']);router['post'](_0xbac9('0x2b'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x53')]);router['post'](_0xbac9('0x2d'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x54')]);router[_0xbac9('0x37')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xbac9('0x55')]);router[_0xbac9('0x37')]('/:id/chat_websites',auth[_0xbac9('0x6')](),controller[_0xbac9('0x56')]);router[_0xbac9('0x37')](_0xbac9('0x33'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x57')]);router[_0xbac9('0x37')](_0xbac9('0x58'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x59')]);router[_0xbac9('0x5a')](_0xbac9('0x5b'),auth['isAuthenticated'](),controller[_0xbac9('0x5c')]);router['put'](_0xbac9('0x5d'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x5e')]);router[_0xbac9('0x5f')]('/:id/queues',auth[_0xbac9('0x6')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0xbac9('0x6')](),controller['removeTeams']);router[_0xbac9('0x5f')]('/:id',auth[_0xbac9('0x6')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0xbac9('0x6')](),controller['removeChatInteractions']);router[_0xbac9('0x5f')](_0xbac9('0x4c'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x60')]);router[_0xbac9('0x5f')]('/:id/fax_interactions',auth[_0xbac9('0x6')](),controller['removeFaxInteractions']);router['delete'](_0xbac9('0x4f'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x61')]);router[_0xbac9('0x5f')](_0xbac9('0x51'),auth['isAuthenticated'](),controller[_0xbac9('0x62')]);router[_0xbac9('0x5f')](_0xbac9('0x63'),auth['isAuthenticated'](),controller[_0xbac9('0x64')]);router[_0xbac9('0x5f')](_0xbac9('0x29'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x65')]);router[_0xbac9('0x5f')](_0xbac9('0x2b'),auth['isAuthenticated'](),controller[_0xbac9('0x66')]);router['delete'](_0xbac9('0x2d'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x67')]);router['delete'](_0xbac9('0x2f'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x68')]);router[_0xbac9('0x5f')]('/:id/chat_websites',auth[_0xbac9('0x6')](),controller[_0xbac9('0x69')]);router[_0xbac9('0x5f')](_0xbac9('0x33'),auth[_0xbac9('0x6')](),controller['removeWhatsappAccounts']);router['delete'](_0xbac9('0x58'),auth[_0xbac9('0x6')](),controller[_0xbac9('0x6a')]);router[_0xbac9('0x37')](_0xbac9('0x6b'),auth['isAuthenticated'](),controller[_0xbac9('0x6c')]);module[_0xbac9('0x6d')]=router; \ No newline at end of file +var _0xd3a9=['/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','join','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./user.controller','isAuthenticated','index','get','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd3a9,0xbf));var _0x9d3a=function(_0xe9d40c,_0x1feaf1){_0xe9d40c=_0xe9d40c-0x0;var _0x1e4362=_0xd3a9[_0xe9d40c];return _0x1e4362;};'use strict';var multer=require(_0x9d3a('0x0'));var util=require(_0x9d3a('0x1'));var path=require(_0x9d3a('0x2'));var timeout=require(_0x9d3a('0x3'));var express=require(_0x9d3a('0x4'));var router=express[_0x9d3a('0x5')]();var fs_extra=require(_0x9d3a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9d3a('0x7'));var controller=require(_0x9d3a('0x8'));router['get']('/',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0xa')]);router[_0x9d3a('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x9d3a('0xc')]);router[_0x9d3a('0xb')]('/whoami',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0xd')]);router[_0x9d3a('0xb')](_0x9d3a('0xe'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0xf')]);router[_0x9d3a('0xb')](_0x9d3a('0x10'),auth['isAuthenticated'](),controller[_0x9d3a('0x11')]);router[_0x9d3a('0xb')](_0x9d3a('0x12'),controller[_0x9d3a('0x13')]);router[_0x9d3a('0xb')](_0x9d3a('0x14'),auth['isAuthenticated'](),controller[_0x9d3a('0x15')]);router[_0x9d3a('0xb')](_0x9d3a('0x16'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x17')]);router[_0x9d3a('0xb')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0x9d3a('0xb')](_0x9d3a('0x18'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x19')]);router[_0x9d3a('0xb')](_0x9d3a('0x1a'),auth['isAuthenticated'](),controller['getGroups']);router[_0x9d3a('0xb')](_0x9d3a('0x1b'),auth['isAuthenticated'](),controller[_0x9d3a('0x1c')]);router[_0x9d3a('0xb')]('/:id/screen_recordings',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x1d')]);router[_0x9d3a('0xb')](_0x9d3a('0x1e'),auth['isAuthenticated'](),controller[_0x9d3a('0x1f')]);router[_0x9d3a('0xb')]('/:id/openchannel/interactions',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x20')]);router['get'](_0x9d3a('0x21'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x22')]);router[_0x9d3a('0xb')]('/:id/sms/interactions',auth[_0x9d3a('0x9')](),controller['getSmsInteractions']);router[_0x9d3a('0xb')](_0x9d3a('0x23'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x9d3a('0xb')](_0x9d3a('0x24'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x25')]);router[_0x9d3a('0xb')](_0x9d3a('0x26'),auth[_0x9d3a('0x9')](),controller['getTeams']);router[_0x9d3a('0xb')]('/:id/lists',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x27')]);router['get']('/:id/agents',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x28')]);router[_0x9d3a('0xb')](_0x9d3a('0x29'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x2a')]);router[_0x9d3a('0xb')]('/:id/fax_accounts',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x2b')]);router[_0x9d3a('0xb')](_0x9d3a('0x2c'),auth[_0x9d3a('0x9')](),controller['getMailAccounts']);router[_0x9d3a('0xb')](_0x9d3a('0x2d'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x2e')]);router[_0x9d3a('0xb')]('/:id/sms_accounts',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x2f')]);router['get']('/:id/chat_websites',auth[_0x9d3a('0x9')](),controller['getChatWebsites']);router[_0x9d3a('0xb')]('/:id/whatsapp_accounts',auth[_0x9d3a('0x9')](),controller['getWhatsappAccounts']);router['get'](_0x9d3a('0x30'),auth[_0x9d3a('0x9')](),controller['getScheduledCalls']);router[_0x9d3a('0xb')](_0x9d3a('0x31'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x32')]);router[_0x9d3a('0x33')]('/:id/contacts',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x34')]);router[_0x9d3a('0x33')]('/',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x35')]);router[_0x9d3a('0x33')](_0x9d3a('0x36'),auth['isAuthenticated'](),controller[_0x9d3a('0x37')]);router[_0x9d3a('0x33')](_0x9d3a('0x38'),auth[_0x9d3a('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x9d3a('0x39')]({'destination':function(_0xffaf67,_0x5a769c,_0x32c7a2){_0x32c7a2(null,path[_0x9d3a('0x3a')](config['root'],'server/files/images/'));},'filename':function(_0x4c7526,_0x3779c9,_0x39e1b3){_0x39e1b3(null,util['format'](_0x9d3a('0x3b'),Date[_0x9d3a('0x3c')](),_0x3779c9[_0x9d3a('0x3d')]));}})});router[_0x9d3a('0x33')](_0x9d3a('0x12'),upload[_0x9d3a('0x3e')](_0x9d3a('0x3f')),controller[_0x9d3a('0x40')]);router[_0x9d3a('0x33')](_0x9d3a('0x41'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x42')]);router[_0x9d3a('0x33')](_0x9d3a('0x43'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x44')]);router['post'](_0x9d3a('0x45'),auth['isAuthenticated'](),controller[_0x9d3a('0x46')]);router[_0x9d3a('0x33')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0x9d3a('0x33')](_0x9d3a('0x26'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x47')]);router[_0x9d3a('0x33')]('/:id/chat_interactions',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x48')]);router[_0x9d3a('0x33')](_0x9d3a('0x49'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x4a')]);router['post']('/:id/fax_interactions',auth[_0x9d3a('0x9')](),controller['addFaxInteractions']);router['post'](_0x9d3a('0x4b'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x4c')]);router[_0x9d3a('0x33')](_0x9d3a('0x4d'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x4e')]);router[_0x9d3a('0x33')](_0x9d3a('0x4f'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x50')]);router[_0x9d3a('0x33')](_0x9d3a('0x51'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x52')]);router[_0x9d3a('0x33')](_0x9d3a('0x2c'),auth['isAuthenticated'](),controller[_0x9d3a('0x53')]);router['post'](_0x9d3a('0x2d'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x54')]);router[_0x9d3a('0x33')](_0x9d3a('0x55'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x56')]);router['post'](_0x9d3a('0x57'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x58')]);router[_0x9d3a('0x33')]('/:id/whatsapp_accounts',auth[_0x9d3a('0x9')](),controller['addWhatsappAccounts']);router[_0x9d3a('0x33')](_0x9d3a('0x31'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x59')]);router[_0x9d3a('0x5a')]('/:id',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x5b')]);router['put']('/:id/password',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x5c')]);router[_0x9d3a('0x5d')](_0x9d3a('0x38'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x5e')]);router[_0x9d3a('0x5d')]('/:id/teams',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x5f')]);router[_0x9d3a('0x5d')]('/:id',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x60')]);router[_0x9d3a('0x5d')](_0x9d3a('0x61'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x62')]);router[_0x9d3a('0x5d')](_0x9d3a('0x49'),auth['isAuthenticated'](),controller[_0x9d3a('0x63')]);router[_0x9d3a('0x5d')](_0x9d3a('0x64'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x65')]);router['delete'](_0x9d3a('0x4b'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x66')]);router[_0x9d3a('0x5d')](_0x9d3a('0x4f'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x67')]);router['delete']('/:id/fax_accounts',auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x68')]);router[_0x9d3a('0x5d')](_0x9d3a('0x2c'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x69')]);router[_0x9d3a('0x5d')](_0x9d3a('0x2d'),auth['isAuthenticated'](),controller[_0x9d3a('0x6a')]);router[_0x9d3a('0x5d')](_0x9d3a('0x55'),auth['isAuthenticated'](),controller[_0x9d3a('0x6b')]);router[_0x9d3a('0x5d')](_0x9d3a('0x57'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x6c')]);router['delete'](_0x9d3a('0x6d'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x6e')]);router[_0x9d3a('0x5d')](_0x9d3a('0x31'),auth[_0x9d3a('0x9')](),controller['removeApiKey']);router['post'](_0x9d3a('0x6f'),auth[_0x9d3a('0x9')](),controller[_0x9d3a('0x70')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9e8777d..22f75b1 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 _0x6966=['STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','BOOLEAN','DATE','INTEGER','dynamic','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','update,nonat','TEXT','showWebBar','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','wss','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util'];(function(_0x5785f6,_0x21c3fa){var _0x32147c=function(_0x2ea177){while(--_0x2ea177){_0x5785f6['push'](_0x5785f6['shift']());}};_0x32147c(++_0x21c3fa);}(_0x6966,0x165));var _0x6696=function(_0x5c8722,_0x39fe9b){_0x5c8722=_0x5c8722-0x0;var _0x2d2e62=_0x6966[_0x5c8722];return _0x2d2e62;};'use strict';var Sequelize=require(_0x6696('0x0'));var moment=require(_0x6696('0x1'));var util=require(_0x6696('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x6696('0x3')],'allowNull':![],'unique':_0x6696('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5d4d4d){this[_0x6696('0x5')](_0x6696('0x4'),_0x5d4d4d);this['setDataValue']('defaultuser',_0x5d4d4d);},'comment':_0x6696('0x6')},'fullname':{'type':Sequelize[_0x6696('0x3')],'allowNull':![],'set':function(_0x231c1f){this[_0x6696('0x5')](_0x6696('0x7'),_0x231c1f);this['setDataValue'](_0x6696('0x8'),util[_0x6696('0x9')](_0x6696('0xa'),_0x231c1f,this['getDataValue'](_0x6696('0xb'))));}},'alias':{'type':Sequelize[_0x6696('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6696('0xc'),'validate':{'isEmail':!![]},'set':function(_0x1f9504){if(_0x1f9504){this[_0x6696('0x5')](_0x6696('0xc'),_0x1f9504[_0x6696('0xd')]());}}},'role':{'type':Sequelize[_0x6696('0xe')](_0x6696('0xf'),'user',_0x6696('0x10'),_0x6696('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x6696('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6696('0x3')],'defaultValue':_0x6696('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x6696('0xb'),'set':function(_0x3ea149){this[_0x6696('0x5')](_0x6696('0xb'),_0x3ea149);this[_0x6696('0x5')]('accountcode',_0x3ea149);this['setDataValue'](_0x6696('0x8'),util[_0x6696('0x9')](_0x6696('0xa'),this['getDataValue'](_0x6696('0x7')),_0x3ea149));}},'salt':{'type':Sequelize[_0x6696('0x3')]},'phone':{'type':Sequelize[_0x6696('0x3')]},'mobile':{'type':Sequelize[_0x6696('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x6696('0x3')]},'city':{'type':Sequelize[_0x6696('0x3')]},'country':{'type':Sequelize[_0x6696('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6696('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6696('0x14')]},'chatCapacity':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6696('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![],'defaultValue':_0x6696('0x16')},'ipaddr':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x6696('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x17'),_0x6696('0x18'),_0x6696('0x19')),'allowNull':!![],'defaultValue':_0x6696('0x17')},'context':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![],'defaultValue':_0x6696('0x1a')},'callingpres':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x1b'),_0x6696('0x1c'),'ALLOWED_FAILED_SCREEN',_0x6696('0x1d'),_0x6696('0x1e'),_0x6696('0x1f'),_0x6696('0x20'),_0x6696('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![],'defaultValue':_0x6696('0x22'),'set':function(_0xeca496){this[_0x6696('0x5')](_0x6696('0x23'),_0xeca496?_0xeca496['join'](','):null);},'get':function(){return this[_0x6696('0x24')](_0x6696('0x23'))?this[_0x6696('0x24')](_0x6696('0x23'))[_0x6696('0x25')](','):null;},'comment':_0x6696('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x6696('0x27'),_0x6696('0x28'),'shortinfo',_0x6696('0x29'),_0x6696('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no',_0x6696('0x2c'),'update',_0x6696('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6696('0x2e'),'set':function(_0x3f8b77){this['setDataValue'](_0x6696('0x2f'),_0x3f8b77?_0x3f8b77[_0x6696('0x30')](','):null);},'get':function(){return this[_0x6696('0x24')](_0x6696('0x2f'))?this[_0x6696('0x24')](_0x6696('0x2f'))[_0x6696('0x25')](','):null;},'comment':_0x6696('0x31')},'callgroup':{'type':Sequelize[_0x6696('0x3')]},'namedcallgroup':{'type':Sequelize[_0x6696('0x3')]},'pickupgroup':{'type':Sequelize[_0x6696('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x6696('0x3')]},'language':{'type':Sequelize[_0x6696('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6696('0x3')]},'disallow':{'type':Sequelize[_0x6696('0x3')],'allowNull':![],'defaultValue':_0x6696('0x32')},'allow':{'type':Sequelize[_0x6696('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1faea3){this[_0x6696('0x5')](_0x6696('0x33'),_0x1faea3?_0x1faea3[_0x6696('0x30')](';'):_0x6696('0x34'));},'get':function(){return this[_0x6696('0x24')]('allow')?this['getDataValue'](_0x6696('0x33'))[_0x6696('0x25')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![],'set':function(_0x35bb04){this[_0x6696('0x5')](_0x6696('0x35'),_0x35bb04?_0x35bb04[_0x6696('0x30')](','):null);},'get':function(){return this['getDataValue'](_0x6696('0x35'))?this['getDataValue'](_0x6696('0x35'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no',_0x6696('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6696('0x37')},'amaflags':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6696('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x6696('0x2b')},'busylevel':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6696('0xe')]('yes','no',_0x6696('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x6696('0x39'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x3a'),_0x6696('0x3b')),'allowNull':!![],'defaultValue':_0x6696('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6696('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x6696('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x6696('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no','fingerprint',_0x6696('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x6696('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6696('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6696('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no','nonat','update',_0x6696('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x6696('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x6696('0x3f')]},'showWebBar':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0,'set':function(_0x24fec6){this[_0x6696('0x5')](_0x6696('0x40'),_0x24fec6);var _0x2799e9=this[_0x6696('0x41')]({'plain':!![]});switch(_0x24fec6){case 0x0:case 0x1:var _0x281da8=_0x2799e9[_0x6696('0x23')]?_[_0x6696('0x42')](_0x2799e9['transport'])?_0x2799e9[_0x6696('0x23')][_0x6696('0x30')]():_0x2799e9[_0x6696('0x23')]:_0x6696('0x22');if(_0x281da8==='wss'){_0x281da8='udp';}this[_0x6696('0x5')](_0x6696('0x23'),_0x281da8);this[_0x6696('0x5')](_0x6696('0x43'),'no');this[_0x6696('0x5')](_0x6696('0x44'),null);this[_0x6696('0x5')](_0x6696('0x45'),null);this[_0x6696('0x5')](_0x6696('0x46'),null);this['setDataValue'](_0x6696('0x47'),null);this[_0x6696('0x5')](_0x6696('0x48'),null);this[_0x6696('0x5')]('dtlssetup',null);this[_0x6696('0x5')](_0x6696('0x49'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x6696('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x6696('0x5')]('transport',_0x6696('0x4a'));this[_0x6696('0x5')](_0x6696('0x43'),_0x6696('0x2b'));this['setDataValue']('avpf',_0x6696('0x2b'));this[_0x6696('0x5')](_0x6696('0x45'),_0x6696('0x2b'));this[_0x6696('0x5')](_0x6696('0x46'),_0x6696('0x2b'));this[_0x6696('0x5')]('dtlsenable',_0x6696('0x2b'));this[_0x6696('0x5')]('dtlsverify','no');this[_0x6696('0x5')]('dtlssetup',_0x6696('0x4b'));this['setDataValue'](_0x6696('0x49'),_0x2799e9[_0x6696('0x49')]||_0x6696('0x4c'));this[_0x6696('0x5')](_0x6696('0x4d'),_0x2799e9[_0x6696('0x4d')]||_0x6696('0x4e'));this[_0x6696('0x5')](_0x6696('0x4f'),_0x6696('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x6696('0x3f')],'set':function(_0x529272){this[_0x6696('0x5')]('permissions',_0x529272?_0x529272[_0x6696('0x30')](','):[]);},'get':function(){return this[_0x6696('0x24')](_0x6696('0x50'))?_[_0x6696('0x51')](this['getDataValue'](_0x6696('0x50'))['split'](','),function(_0x6d61ce){return parseInt(_0x6d61ce,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6696('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x6696('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6696('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6696('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6696('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6696('0xe')](_0x6696('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6696('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6696('0x52')],'get':function(){return this[_0x6696('0x24')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x6696('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![],'set':function(_0x3d626d){if(typeof _0x3d626d==='string'){var _0x4706d1=_0x3d626d==='1'?!![]:_0x3d626d==='0'?![]:_0x3d626d===_0x6696('0x54')?!![]:_0x3d626d===_0x6696('0x55')?![]:![];this[_0x6696('0x5')]('screenrecording',_0x4706d1);}else{this['setDataValue'](_0x6696('0x56'),_0x3d626d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f2344){this['setDataValue']('blocked',_0x4f2344);if(_0x4f2344===!![]){this[_0x6696('0x5')]('blockedAt',moment());this['setDataValue'](_0x6696('0x57'),0x0);}else{this[_0x6696('0x5')](_0x6696('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6696('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x6696('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6696('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6696('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6696('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6696('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x6696('0x13')],'defaultValue':![]}}; \ No newline at end of file +var _0x2d83=['insecure','never','\x22\x22\x20<>','accept','refuse','originate','fingerprint','active','passive','update,nonat','TEXT','get','wss','avpf','icesupport','dtlsverify','dtlssetup','dtlsprivatekey','encryption','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','sequelize','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','user','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'];(function(_0x325d4e,_0x4543a0){var _0x1a1c24=function(_0x2e0b4d){while(--_0x2e0b4d){_0x325d4e['push'](_0x325d4e['shift']());}};_0x1a1c24(++_0x4543a0);}(_0x2d83,0x122));var _0x32d8=function(_0x433c49,_0x2c44e9){_0x433c49=_0x433c49-0x0;var _0x7fd052=_0x2d83[_0x433c49];return _0x7fd052;};'use strict';var Sequelize=require(_0x32d8('0x0'));var moment=require('moment');var util=require(_0x32d8('0x1'));var _=require('lodash');module[_0x32d8('0x2')]={'name':{'type':Sequelize[_0x32d8('0x3')],'allowNull':![],'unique':_0x32d8('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x294406){this[_0x32d8('0x5')](_0x32d8('0x4'),_0x294406);this['setDataValue'](_0x32d8('0x6'),_0x294406);},'comment':_0x32d8('0x7')},'fullname':{'type':Sequelize[_0x32d8('0x3')],'allowNull':![],'set':function(_0x153155){this[_0x32d8('0x5')](_0x32d8('0x8'),_0x153155);this[_0x32d8('0x5')](_0x32d8('0x9'),util[_0x32d8('0xa')](_0x32d8('0xb'),_0x153155,this[_0x32d8('0xc')](_0x32d8('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3b2689){if(_0x3b2689){this[_0x32d8('0x5')]('email',_0x3b2689[_0x32d8('0xe')]());}}},'role':{'type':Sequelize['ENUM'](_0x32d8('0xf'),'user',_0x32d8('0x10'),_0x32d8('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x32d8('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x32d8('0x3')],'defaultValue':_0x32d8('0x12')},'internal':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':![],'unique':_0x32d8('0xd'),'set':function(_0x40f64b){this[_0x32d8('0x5')](_0x32d8('0xd'),_0x40f64b);this[_0x32d8('0x5')](_0x32d8('0x14'),_0x40f64b);this['setDataValue'](_0x32d8('0x9'),util[_0x32d8('0xa')](_0x32d8('0xb'),this['getDataValue'](_0x32d8('0x8')),_0x40f64b));}},'salt':{'type':Sequelize[_0x32d8('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x32d8('0x3')]},'address':{'type':Sequelize[_0x32d8('0x3')]},'zipcode':{'type':Sequelize[_0x32d8('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x32d8('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x32d8('0x17')},'lastPauseAt':{'type':Sequelize[_0x32d8('0x16')]},'chatCapacity':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x32d8('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x32d8('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x32d8('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x32d8('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x32d8('0x19')]('friend',_0x32d8('0x1a'),_0x32d8('0x1b')),'allowNull':!![],'defaultValue':_0x32d8('0x1c')},'context':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![],'defaultValue':_0x32d8('0x1d')},'callingpres':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x1e'),'ALLOWED_PASSED_SCREEN',_0x32d8('0x1f'),_0x32d8('0x20'),'PROHIB_NOT_SCREENED',_0x32d8('0x21'),_0x32d8('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![],'defaultValue':_0x32d8('0x23'),'set':function(_0x173e67){this[_0x32d8('0x5')](_0x32d8('0x24'),_0x173e67?_0x173e67[_0x32d8('0x25')](','):null);},'get':function(){return this[_0x32d8('0xc')](_0x32d8('0x24'))?this[_0x32d8('0xc')](_0x32d8('0x24'))[_0x32d8('0x26')](','):null;},'comment':_0x32d8('0x27')},'dtmfmode':{'type':Sequelize[_0x32d8('0x19')]('rfc2833',_0x32d8('0x28'),_0x32d8('0x29'),'inband',_0x32d8('0x2a')),'allowNull':!![],'defaultValue':_0x32d8('0x2b')},'directmedia':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no',_0x32d8('0x2d'),_0x32d8('0x2e'),_0x32d8('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x32d8('0x30'),'set':function(_0x321138){this[_0x32d8('0x5')]('nat',_0x321138?_0x321138['join'](','):null);},'get':function(){return this[_0x32d8('0xc')](_0x32d8('0x31'))?this['getDataValue'](_0x32d8('0x31'))[_0x32d8('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x32d8('0x3')]},'namedcallgroup':{'type':Sequelize[_0x32d8('0x3')]},'pickupgroup':{'type':Sequelize[_0x32d8('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x32d8('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x32d8('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x32d8('0x32')},'allow':{'type':Sequelize[_0x32d8('0x3')],'allowNull':![],'defaultValue':_0x32d8('0x33'),'set':function(_0x4fb93a){this[_0x32d8('0x5')](_0x32d8('0x34'),_0x4fb93a?_0x4fb93a['join'](';'):_0x32d8('0x33'));},'get':function(){return this[_0x32d8('0xc')](_0x32d8('0x34'))?this[_0x32d8('0xc')](_0x32d8('0x34'))[_0x32d8('0x26')](';'):null;},'comment':_0x32d8('0x35')},'autoframing':{'type':Sequelize[_0x32d8('0x19')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![],'set':function(_0x4cd4cc){this[_0x32d8('0x5')](_0x32d8('0x36'),_0x4cd4cc?_0x4cd4cc[_0x32d8('0x25')](','):null);},'get':function(){return this[_0x32d8('0xc')](_0x32d8('0x36'))?this[_0x32d8('0xc')](_0x32d8('0x36'))[_0x32d8('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no',_0x32d8('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![],'defaultValue':_0x32d8('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x32d8('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x39'),_0x32d8('0x3a'),_0x32d8('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x32d8('0x19')]('uac','uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x32d8('0x2c')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x32d8('0x19')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no',_0x32d8('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x3d'),_0x32d8('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x32d8('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x32d8('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x32d8('0x19')](_0x32d8('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x32d8('0x19')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x32d8('0x19')]('yes','no',_0x32d8('0x2d'),_0x32d8('0x2e'),_0x32d8('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x32d8('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x32d8('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x32d8('0x40')]},'showWebBar':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0,'set':function(_0x503b65){this[_0x32d8('0x5')]('showWebBar',_0x503b65);var _0x25621e=this[_0x32d8('0x41')]({'plain':!![]});switch(_0x503b65){case 0x0:case 0x1:var _0x3e95=_0x25621e[_0x32d8('0x24')]?_['isArray'](_0x25621e[_0x32d8('0x24')])?_0x25621e[_0x32d8('0x24')]['join']():_0x25621e[_0x32d8('0x24')]:_0x32d8('0x23');if(_0x3e95===_0x32d8('0x42')){_0x3e95='udp';}this['setDataValue']('transport',_0x3e95);this[_0x32d8('0x5')]('encryption','no');this[_0x32d8('0x5')](_0x32d8('0x43'),null);this[_0x32d8('0x5')]('force_avp',null);this[_0x32d8('0x5')](_0x32d8('0x44'),null);this[_0x32d8('0x5')]('dtlsenable',null);this['setDataValue'](_0x32d8('0x45'),null);this[_0x32d8('0x5')](_0x32d8('0x46'),null);this[_0x32d8('0x5')]('dtlscertfile',null);this['setDataValue'](_0x32d8('0x47'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x32d8('0x5')]('transport',_0x32d8('0x42'));this[_0x32d8('0x5')](_0x32d8('0x48'),'yes');this[_0x32d8('0x5')](_0x32d8('0x43'),_0x32d8('0x2c'));this[_0x32d8('0x5')]('force_avp','yes');this[_0x32d8('0x5')](_0x32d8('0x44'),_0x32d8('0x2c'));this[_0x32d8('0x5')]('dtlsenable',_0x32d8('0x2c'));this[_0x32d8('0x5')](_0x32d8('0x45'),'no');this[_0x32d8('0x5')](_0x32d8('0x46'),_0x32d8('0x49'));this[_0x32d8('0x5')](_0x32d8('0x4a'),_0x25621e[_0x32d8('0x4a')]||_0x32d8('0x4b'));this['setDataValue'](_0x32d8('0x47'),_0x25621e[_0x32d8('0x47')]||'/etc/pki/tls/private/motion.key');this[_0x32d8('0x5')]('rtcp_mux',_0x32d8('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x32d8('0x40')],'set':function(_0x49ea76){this[_0x32d8('0x5')]('permissions',_0x49ea76?_0x49ea76[_0x32d8('0x25')](','):[]);},'get':function(){return this[_0x32d8('0xc')]('permissions')?_['map'](this['getDataValue'](_0x32d8('0x4c'))[_0x32d8('0x26')](','),function(_0x16680a){return parseInt(_0x16680a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x32d8('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x32d8('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x32d8('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x32d8('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x32d8('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x32d8('0x4d')],'get':function(){return this['getDataValue'](_0x32d8('0x4e'))?this[_0x32d8('0xc')](_0x32d8('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x32d8('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x32d8('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![],'set':function(_0x1394a1){if(typeof _0x1394a1===_0x32d8('0x4f')){var _0x34b5a0=_0x1394a1==='1'?!![]:_0x1394a1==='0'?![]:_0x1394a1===_0x32d8('0x50')?!![]:_0x1394a1===_0x32d8('0x51')?![]:![];this[_0x32d8('0x5')](_0x32d8('0x52'),_0x34b5a0);}else{this['setDataValue'](_0x32d8('0x52'),_0x1394a1);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xbdb9cd){this[_0x32d8('0x5')](_0x32d8('0x53'),_0xbdb9cd);if(_0xbdb9cd===!![]){this[_0x32d8('0x5')]('blockedAt',moment());this[_0x32d8('0x5')](_0x32d8('0x54'),0x0);}else{this[_0x32d8('0x5')](_0x32d8('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x32d8('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x32d8('0x13')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x32d8('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 745ebe8..a2e2152 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 _0xf8e4=['DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','getTeams','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','VoicePrefixId','removeTeams','isArray','transaction','removeAgent','TeamVoicePrefix','UserVoicePrefix','CmList','getLists','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$like','$iLike','$notILike','$contained','$any','firstName','CmContact','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','idle','unknown','ringing','teams','queues','inbound','flatten','toString','lower','desc','asc','substring','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','messengerSoundNotification','moment','util','path','lodash','squel','ioredis','jayson/promise','../../components/auth/service','../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/license/util','handleError','../../mysqldb','socket.io-emitter','redis','localhost','client','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','request','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','then','emit','userNotification:recalc:','destroy','get','admin','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','role','name','UserProfileResource','stack','send','rawAttributes','fieldName','type','password','previousPasswords','resetPasswordExpires','md5secret','getOptions','where','User','query','includeAll','include','userSetting','true','attributes','push','findAll','rows','openTabs','dataValues','fax','openchannel','whatsapp','show','params','merge','options','find','chat','sms','mail','all','body','describe','addContacts','ids','omit','Setting','securePassword','validatePasswordPattern','isNil','min_internal','internal','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','voicemail','VoiceMail','fullname','email','101','102','103','113','110','104','105','106','108','109','100','114','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','length','isEmpty','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','penalty','UserVoiceQueueRt','removeQueues','remove','Queue:remove','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MAIL','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','List','Tag','Tags','color','tag','getQueues','keys','Queue','filters','intersection','model','fields','order','sort','getVoiceQueuesRt','pick','nolimit','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','update','logout','pause','QueuePause','updateAttributes'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xf8e4,0x85));var _0x4f8e=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xf8e4[_0x3ceb54];return _0x26d8a6;};'use strict';var moment=require(_0x4f8e('0x0'));var util=require(_0x4f8e('0x1'));var path=require(_0x4f8e('0x2'));var fs=require('fs');var _=require(_0x4f8e('0x3'));var squel=require(_0x4f8e('0x4'));var Redis=require(_0x4f8e('0x5'));var jayson=require(_0x4f8e('0x6'));var authService=require(_0x4f8e('0x7'));var contacts=require(_0x4f8e('0x8'));var qs=require('../../components/parsers/qs');var rta=require(_0x4f8e('0x9'));var logger=require(_0x4f8e('0xa'))(_0x4f8e('0xb'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f8e('0xc'));var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIForbiddenError=require('../../errors/api')['APIForbiddenrror'];var APIHandleError=require('../../errors/api')[_0x4f8e('0xd')];var db=require(_0x4f8e('0xe'))['db'];var socket=require(_0x4f8e('0xf'))(new Redis(config[_0x4f8e('0x10')]));require('./user.socket')['register'](socket);config[_0x4f8e('0x10')]=_['defaults'](config[_0x4f8e('0x10')],{'host':_0x4f8e('0x11'),'port':0x18eb});var amiClient=jayson[_0x4f8e('0x12')]['http']({'port':0x232a});var values;function respondWithStatusCode(_0x4f7b5f,_0x301e51){_0x301e51=_0x301e51||0xcc;return function(_0x47cdf8){if(_0x47cdf8){return _0x4f7b5f[_0x4f8e('0x13')](_0x301e51);}return _0x4f7b5f[_0x4f8e('0x14')](_0x301e51)[_0x4f8e('0x15')]();};}function respondWithResult(_0x1e7602,_0x655317){_0x655317=_0x655317||0xc8;return function(_0x20433d){if(_0x20433d){return _0x1e7602['status'](_0x655317)[_0x4f8e('0x16')](_0x20433d);}};}function respondWithFilteredResult(_0x48c05e,_0x3cb160){return function(_0x2cc839){if(_0x2cc839){var _0x1f1d0d=typeof _0x3cb160[_0x4f8e('0x17')]===_0x4f8e('0x18')&&typeof _0x3cb160[_0x4f8e('0x19')]===_0x4f8e('0x18');var _0x35a15d=_0x2cc839[_0x4f8e('0x1a')];var _0xa1b904=_0x1f1d0d?0x0:_0x3cb160[_0x4f8e('0x17')];var _0x15e703=_0x1f1d0d?_0x2cc839['count']:_0x3cb160[_0x4f8e('0x17')]+_0x3cb160[_0x4f8e('0x19')];var _0x3f46ce;if(_0x15e703>=_0x35a15d){_0x15e703=_0x35a15d;_0x3f46ce=0xc8;}else{_0x3f46ce=0xce;}_0x48c05e[_0x4f8e('0x14')](_0x3f46ce);return _0x48c05e[_0x4f8e('0x1b')](_0x4f8e('0x1c'),_0xa1b904+'-'+_0x15e703+'/'+_0x35a15d)['json'](_0x2cc839);}return null;};}function respondWithRpcPromise(_0x43442d,_0x444dc7,_0x5a9538,_0x318195){return new Promise(function(_0x56e93f,_0x5e6f2f){var _0x4a891d=_0x318195||amiClient;return _0x4a891d[_0x4f8e('0x1d')](_0x43442d,_0x5a9538)['then'](function(_0x50a5e0){logger[_0x4f8e('0x1e')]('User,\x20%s,\x20%s',_0x444dc7,_0x4f8e('0x1f'));logger[_0x4f8e('0x20')](_0x4f8e('0x21'),_0x444dc7,'request\x20sent',JSON[_0x4f8e('0x22')](_0x50a5e0));if(_0x50a5e0[_0x4f8e('0x23')]){if(_0x50a5e0[_0x4f8e('0x23')][_0x4f8e('0x24')]===0x1f4){logger['error'](_0x4f8e('0x25'),_0x444dc7,_0x50a5e0[_0x4f8e('0x23')][_0x4f8e('0x26')]);return _0x5e6f2f(_0x50a5e0[_0x4f8e('0x23')][_0x4f8e('0x26')]);}logger[_0x4f8e('0x23')](_0x4f8e('0x25'),_0x444dc7,_0x50a5e0[_0x4f8e('0x23')][_0x4f8e('0x26')]);return _0x56e93f(_0x50a5e0[_0x4f8e('0x23')][_0x4f8e('0x26')]);}else{logger[_0x4f8e('0x1e')](_0x4f8e('0x25'),_0x444dc7,_0x4f8e('0x1f'));_0x56e93f(_0x50a5e0[_0x4f8e('0x27')][_0x4f8e('0x26')]);}})[_0x4f8e('0x28')](function(_0x24b203){logger[_0x4f8e('0x23')]('User,\x20%s,\x20%s',_0x444dc7,_0x24b203);_0x5e6f2f(_0x24b203);});});}function saveUpdates(_0x2b1e69){return function(_0x441e4e){if(_0x441e4e){return _0x441e4e['update'](_0x2b1e69)[_0x4f8e('0x29')](function(_0x537da8){if(_0x537da8['role']==='agent'){socket[_0x4f8e('0x2a')](_0x4f8e('0x2b')+_0x537da8['id'],_0x537da8);}return _0x537da8;});}return null;};}function removeEntity(_0x250221,_0x7c7009){return function(_0x537a62){if(_0x537a62){return _0x537a62[_0x4f8e('0x2c')]({'transaction':_0x7c7009})['then'](function(){var _0x7416fb=_0x537a62[_0x4f8e('0x2d')]({'plain':!![]});if(_0x7416fb['role']===_0x4f8e('0x2e'))return;var _0x4cbf1e=[{'name':'Users','value':_0x4f8e('0x2f'),'ignore':!![]},{'name':_0x4f8e('0x30'),'value':_0x4f8e('0x31'),'ignore':![]},{'name':_0x4f8e('0x32'),'value':_0x4f8e('0x33'),'ignore':![]}];var _0x498b50=_(_0x4cbf1e)[_0x4f8e('0x34')](_0x4f8e('0x35'))[_0x4f8e('0x36')](_0x4f8e('0x37'))['value']();if(_[_0x4f8e('0x38')](_0x498b50,_0x7416fb[_0x4f8e('0x39')])){return;}var _0x46bbab=_['find'](_0x4cbf1e,[_0x4f8e('0x37'),_0x7416fb[_0x4f8e('0x39')]])[_0x4f8e('0x3a')];return db[_0x4f8e('0x3b')][_0x4f8e('0x2c')]({'where':{'type':_0x46bbab,'resourceId':_0x7416fb['id']},'transaction':_0x7c7009})[_0x4f8e('0x29')](function(){return _0x537a62;});})[_0x4f8e('0x29')](function(){_0x250221['status'](0xcc)[_0x4f8e('0x15')]();});}};}function handleEntityNotFound(_0x1d93db){return function(_0x1015f8){if(!_0x1015f8){_0x1d93db[_0x4f8e('0x13')](0x194);}return _0x1015f8;};}function handleError(_0x412952,_0x385f51){_0x385f51=_0x385f51||0x1f4;return function(_0x5f4724){logger['error'](_0x5f4724[_0x4f8e('0x3c')]);if(_0x5f4724['name']){delete _0x5f4724[_0x4f8e('0x3a')];}_0x412952[_0x4f8e('0x14')](_0x385f51)[_0x4f8e('0x3d')](_0x5f4724);};}function getUserAttributes(){return _(db['User'][_0x4f8e('0x3e')])[_0x4f8e('0x36')](function(_0x44958c){return{'name':_0x44958c[_0x4f8e('0x3f')],'type':_0x44958c[_0x4f8e('0x40')]['key']};})['filter'](function(_0xa436f2){return![_0x4f8e('0x41'),'salt',_0x4f8e('0x42'),'resetPasswordToken',_0x4f8e('0x43'),_0x4f8e('0x44')]['includes'](_0xa436f2[_0x4f8e('0x3a')]);})['value']();}exports['index']=function(_0x55da7b,_0x4a9768){var _0x1b0dc0={},_0x28f1ab={'count':0x0,'rows':[]};var _0x5e5c77=getUserAttributes();_0x1b0dc0=qs[_0x4f8e('0x45')](_0x5e5c77,_0x55da7b);var _0x145f93={'where':_0x1b0dc0[_0x4f8e('0x46')]};return db[_0x4f8e('0x47')][_0x4f8e('0x1a')](_0x145f93)[_0x4f8e('0x29')](function(_0x2385ef){_0x28f1ab[_0x4f8e('0x1a')]=_0x2385ef;if(_0x55da7b[_0x4f8e('0x48')][_0x4f8e('0x49')]){_0x1b0dc0[_0x4f8e('0x4a')]=[{'all':!![]}];}if(_0x55da7b[_0x4f8e('0x48')][_0x4f8e('0x4b')]===_0x4f8e('0x4c')){_0x1b0dc0['include']=[{'model':db['UserSetting'],'as':_0x4f8e('0x4b')}];}if(!_['includes'](_0x1b0dc0[_0x4f8e('0x4d')],'id')){_0x1b0dc0[_0x4f8e('0x4d')][_0x4f8e('0x4e')]('id');}return db[_0x4f8e('0x47')][_0x4f8e('0x4f')](_0x1b0dc0);})[_0x4f8e('0x29')](function(_0x2a1403){_0x28f1ab[_0x4f8e('0x50')]=_0x2a1403;if(_0x55da7b[_0x4f8e('0x48')][_0x4f8e('0x51')]===_0x4f8e('0x4c')){var _0x123975=[];for(var _0x8001be=0x0;_0x8001be<_0x28f1ab[_0x4f8e('0x50')]['length'];_0x8001be++){_0x123975[_0x4f8e('0x4e')](get_open_tabs('chat',_0x28f1ab['rows'][_0x8001be][_0x4f8e('0x52')]));_0x123975[_0x4f8e('0x4e')](get_open_tabs('sms',_0x28f1ab['rows'][_0x8001be][_0x4f8e('0x52')]));_0x123975[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x53'),_0x28f1ab[_0x4f8e('0x50')][_0x8001be][_0x4f8e('0x52')]));_0x123975[_0x4f8e('0x4e')](get_open_tabs('mail',_0x28f1ab[_0x4f8e('0x50')][_0x8001be][_0x4f8e('0x52')]));_0x123975['push'](get_open_tabs(_0x4f8e('0x54'),_0x28f1ab[_0x4f8e('0x50')][_0x8001be][_0x4f8e('0x52')]));_0x123975[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x55'),_0x28f1ab[_0x4f8e('0x50')][_0x8001be][_0x4f8e('0x52')]));}return Promise['all'](_0x123975)[_0x4f8e('0x29')](function(){return _0x28f1ab;});}else{return _0x28f1ab;}})[_0x4f8e('0x29')](respondWithFilteredResult(_0x4a9768,_0x1b0dc0))[_0x4f8e('0x28')](handleError(_0x4a9768,null));};exports[_0x4f8e('0x56')]=function(_0x465d4f,_0x2ed10b){var _0x2a025b=getUserAttributes();_0x465d4f['query']['id']=_0x465d4f[_0x4f8e('0x57')]['id'];var _0x135a00=qs[_0x4f8e('0x45')](_0x2a025b,_0x465d4f);if(_0x465d4f[_0x4f8e('0x48')][_0x4f8e('0x49')]){_0x135a00['include']=[{'all':!![]}];}if(_0x465d4f[_0x4f8e('0x48')]['userSetting']==='true'){_0x135a00['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x135a00=_[_0x4f8e('0x58')]({},_0x135a00,_0x465d4f[_0x4f8e('0x59')]);if(!_[_0x4f8e('0x38')](_0x135a00[_0x4f8e('0x4d')],'id')){_0x135a00[_0x4f8e('0x4d')][_0x4f8e('0x4e')]('id');}return db[_0x4f8e('0x47')][_0x4f8e('0x5a')](_0x135a00)[_0x4f8e('0x29')](handleEntityNotFound(_0x2ed10b,null))[_0x4f8e('0x29')](function(_0x43fe6a){var _0x31dc3c=[];values=_0x43fe6a;if(_0x465d4f[_0x4f8e('0x48')][_0x4f8e('0x51')]===_0x4f8e('0x4c')){_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x5b'),_0x43fe6a[_0x4f8e('0x52')]));_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x5c'),_0x43fe6a[_0x4f8e('0x52')]));_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x54'),_0x43fe6a['dataValues']));_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x55'),_0x43fe6a[_0x4f8e('0x52')]));_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x53'),_0x43fe6a[_0x4f8e('0x52')]));_0x31dc3c[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x5d'),_0x43fe6a[_0x4f8e('0x52')]));return Promise[_0x4f8e('0x5e')](_0x31dc3c);}else{return values;}})[_0x4f8e('0x29')](function(){return values;})['then'](respondWithResult(_0x2ed10b,null))[_0x4f8e('0x28')](handleError(_0x2ed10b,null));};exports['update']=function(_0x55fde1,_0x111855){if(_0x55fde1[_0x4f8e('0x5f')]['id']){delete _0x55fde1[_0x4f8e('0x5f')]['id'];}delete _0x55fde1[_0x4f8e('0x5f')][_0x4f8e('0x39')];return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x55fde1[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x111855,null))[_0x4f8e('0x29')](saveUpdates(_0x55fde1[_0x4f8e('0x5f')],null))['then'](respondWithResult(_0x111855,null))[_0x4f8e('0x28')](handleError(_0x111855,null));};exports[_0x4f8e('0x60')]=function(_0x54e084,_0x5739ce){return db[_0x4f8e('0x47')][_0x4f8e('0x60')]()[_0x4f8e('0x29')](respondWithResult(_0x5739ce,null))[_0x4f8e('0x28')](handleError(_0x5739ce,null));};exports[_0x4f8e('0x61')]=function(_0x1c2ae4,_0x10f5c0){return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x1c2ae4[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x10f5c0,null))[_0x4f8e('0x29')](function(_0x4ef019){if(_0x4ef019){return _0x4ef019[_0x4f8e('0x61')](_0x1c2ae4['body'][_0x4f8e('0x62')],_[_0x4f8e('0x63')](_0x1c2ae4[_0x4f8e('0x5f')],[_0x4f8e('0x62'),'id'])||{});}})[_0x4f8e('0x29')](respondWithResult(_0x10f5c0,null))[_0x4f8e('0x28')](handleError(_0x10f5c0,null));};function validateUser(_0x3907d5){return new Promise(function(_0x18e5d1,_0x5a436d){if(_0x3907d5['internal'])return _0x18e5d1(_0x3907d5);return db[_0x4f8e('0x64')]['findById'](0x1)[_0x4f8e('0x29')](function(_0xbf2bc1){if(_0xbf2bc1[_0x4f8e('0x65')])authService[_0x4f8e('0x66')](_0x3907d5[_0x4f8e('0x41')]);db['User']['max']('internal')[_0x4f8e('0x29')](function(_0x175b7d){if(_[_0x4f8e('0x67')](_0x175b7d)){_0x3907d5['internal']=_0xbf2bc1['min_internal']||0x1;return;}if(_[_0x4f8e('0x67')](_0xbf2bc1['min_internal'])||_0xbf2bc1[_0x4f8e('0x68')]===_0x175b7d){_0x3907d5['internal']=_0x175b7d+0x1;return;}if(_0xbf2bc1[_0x4f8e('0x68')]>_0x175b7d){_0x3907d5[_0x4f8e('0x69')]=_0xbf2bc1['min_internal'];return;}return db[_0x4f8e('0x6a')]['query'](_0x4f8e('0x6b'),{'type':db[_0x4f8e('0x6a')][_0x4f8e('0x6c')]['SELECT']})[_0x4f8e('0x29')](function(_0x120a78){if(_0x120a78&&_0x120a78['length']){for(var _0x563634=0x0,_0x27969c=_0x120a78['length'];_0x563634<_0x27969c&&_['isNil'](_0x3907d5[_0x4f8e('0x69')]);_0x563634++){if(_0xbf2bc1[_0x4f8e('0x68')]<=_0x120a78[_0x563634][_0x4f8e('0x6d')]){_0x3907d5['internal']=_0x120a78[_0x563634][_0x4f8e('0x6d')];}else if(_0xbf2bc1[_0x4f8e('0x68')]>_0x120a78[_0x563634][_0x4f8e('0x6d')]&&_0xbf2bc1['min_internal']<=_0x120a78[_0x563634]['to']){_0x3907d5[_0x4f8e('0x69')]=_0xbf2bc1[_0x4f8e('0x68')];}}}if(_[_0x4f8e('0x67')](_0x3907d5[_0x4f8e('0x69')])){_0x3907d5[_0x4f8e('0x69')]=_0x175b7d+0x1;}return _0x18e5d1(_0x3907d5);});});})[_0x4f8e('0x28')](function(_0x942ed3){_0x5a436d(_0x942ed3);});});}function updateUser(_0xd09af2){return new Promise(function(_0x2e855b,_0x5b7944){try{if(_0xd09af2[_0x4f8e('0x6e')]){_0xd09af2['mailbox']=_0xd09af2['internal'];_0xd09af2[_0x4f8e('0x6f')]={'mailbox':_0xd09af2[_0x4f8e('0x69')],'password':_0xd09af2['password'],'fullname':_0xd09af2[_0x4f8e('0x70')],'email':_0xd09af2[_0x4f8e('0x71')]};}if(_0xd09af2[_0x4f8e('0x39')]===_0x4f8e('0x31')){if(!_0xd09af2['permissions'])_0xd09af2['permissions']=[_0x4f8e('0x72'),_0x4f8e('0x73'),_0x4f8e('0x74'),_0x4f8e('0x75'),_0x4f8e('0x76'),_0x4f8e('0x77'),_0x4f8e('0x78'),_0x4f8e('0x79'),'107',_0x4f8e('0x7a'),_0x4f8e('0x7b'),_0x4f8e('0x7c'),'111',_0x4f8e('0x7d'),'115'];}_0x2e855b(_0xd09af2);}catch(_0x582ea2){_0x5b7944(_0x582ea2);}});}exports['create']=function(_0x185b9c,_0x514163){if(_0x185b9c[_0x4f8e('0x2f')][_0x4f8e('0x39')]===_0x4f8e('0x31'))throw new Error(_0x4f8e('0x7e'));if(_0x185b9c[_0x4f8e('0x5f')]['role']===_0x4f8e('0x2f')&&_0x185b9c['user'][_0x4f8e('0x39')]!==_0x4f8e('0x2e')){throw new Error(_0x4f8e('0x7f'));}if(_0x185b9c[_0x4f8e('0x5f')]['role']===_0x4f8e('0x2e')&&_0x185b9c['user'][_0x4f8e('0x39')]!==_0x4f8e('0x2e')){throw new Error(_0x4f8e('0x80'));}return licenseUtil[_0x4f8e('0x81')]([_0x185b9c[_0x4f8e('0x5f')]])[_0x4f8e('0x29')](function(){return validateUser(_0x185b9c[_0x4f8e('0x5f')]);})[_0x4f8e('0x29')](function(_0xdaa77d){return updateUser(_0xdaa77d)[_0x4f8e('0x29')](function(_0x319ef5){if(_0x319ef5[_0x4f8e('0x39')]===_0x4f8e('0x2e')){_0x319ef5[_0x4f8e('0x82')]=_0x185b9c['user'][_0x4f8e('0x82')];delete _0x319ef5[_0x4f8e('0x83')];}return _0x319ef5;});})['then'](function(_0x4e82a5){return db['User'][_0x4f8e('0x84')](_0x4e82a5,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x4f8e('0x29')](function(_0xa207f1){if(_0x185b9c[_0x4f8e('0x5f')][_0x4f8e('0x39')]==='user')return _0xa207f1;if(_0x185b9c['user'][_0x4f8e('0x39')]!=='user')return _0xa207f1;return db[_0x4f8e('0x85')][_0x4f8e('0x5a')]({'where':{'name':_0xa207f1[_0x4f8e('0x39')]===_0x4f8e('0x31')?_0x4f8e('0x30'):_0x4f8e('0x32'),'userProfileId':_0x185b9c[_0x4f8e('0x2f')][_0x4f8e('0x83')]},'raw':!![]})[_0x4f8e('0x29')](function(_0xde8d24){if(!_0xde8d24||_0xde8d24[_0x4f8e('0x86')]!=0x0)return _0xa207f1;return db['UserProfileResource']['create']({'name':_0xa207f1[_0x4f8e('0x3a')],'resourceId':_0xa207f1['id'],'type':_0xde8d24[_0x4f8e('0x3a')],'sectionId':_0xde8d24['id']},{})[_0x4f8e('0x29')](function(){return _0xa207f1;});})['catch'](function(_0xd7ed6b){logger[_0x4f8e('0x23')](_0x4f8e('0x87'),_0xd7ed6b);throw _0xd7ed6b;});})[_0x4f8e('0x29')](respondWithResult(_0x514163,0xc9))[_0x4f8e('0x28')](handleError(_0x514163,null));};exports[_0x4f8e('0x88')]=function(_0x128858,_0x21b1ad){var _0x2ce5d5=_0x128858['body'];var _0x3de32d=[];if(_0x128858[_0x4f8e('0x2f')]['role']==='agent')throw new Error('Unauthorized');if(_[_0x4f8e('0x89')](_0x2ce5d5,[_0x4f8e('0x39'),'user'])&&_0x128858[_0x4f8e('0x2f')][_0x4f8e('0x39')]!==_0x4f8e('0x2e')){throw new Error(_0x4f8e('0x7f'));}if(_['some'](_0x2ce5d5,['role',_0x4f8e('0x2e')])&&_0x128858[_0x4f8e('0x2f')][_0x4f8e('0x39')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x4f8e('0x81')](_0x2ce5d5)[_0x4f8e('0x29')](function(){return validateUser(_0x2ce5d5[0x0]);})[_0x4f8e('0x29')](function(){for(var _0x39813d=0x1;_0x39813d<_0x2ce5d5[_0x4f8e('0x8a')];_0x39813d++){var _0x2833a2=_0x2ce5d5[_0x39813d-0x1][_0x4f8e('0x69')];if(!_0x2ce5d5[_0x39813d][_0x4f8e('0x69')])_0x2ce5d5[_0x39813d][_0x4f8e('0x69')]=_0x2833a2+0x1;_0x3de32d[_0x4f8e('0x4e')](validateUser(_0x2ce5d5[_0x39813d]));}return Promise['all'](_0x3de32d);})[_0x4f8e('0x29')](function(){_0x3de32d=[];for(var _0x25dde4=0x0;_0x25dde4<_0x2ce5d5['length'];_0x25dde4++){_0x3de32d['push'](updateUser(_0x2ce5d5[_0x25dde4]));}return Promise['all'](_0x3de32d);})['then'](function(){_0x3de32d=_0x2ce5d5[_0x4f8e('0x36')](function(_0x29687d){return db[_0x4f8e('0x47')]['create'](_0x29687d,{'include':[{'model':db[_0x4f8e('0x6f')],'as':_0x4f8e('0x6f')}]})[_0x4f8e('0x29')](function(_0x2f256f){_0x29687d['id']=_0x2f256f['id'];return _0x29687d;});});return Promise[_0x4f8e('0x5e')](_0x3de32d);})[_0x4f8e('0x29')](function(_0x2f44bb){if(_0x128858[_0x4f8e('0x5f')][_0x4f8e('0x39')]==='user')return _0x2f44bb;if(_0x128858[_0x4f8e('0x2f')][_0x4f8e('0x39')]!==_0x4f8e('0x2f'))return _0x2f44bb;var _0x4d4f53=_['some'](_0x2f44bb,function(_0x3c6668){return _0x3c6668['role']===_0x4f8e('0x31')||_0x3c6668['role']===_0x4f8e('0x33');});if(!_0x4d4f53)return _0x2f44bb;return db[_0x4f8e('0x85')][_0x4f8e('0x4f')]({'where':{'name':{'$or':[_0x4f8e('0x30'),_0x4f8e('0x32')]},'userProfileId':_0x128858[_0x4f8e('0x2f')][_0x4f8e('0x83')]},'raw':!![]})['then'](function(_0x41f7b6){if(_[_0x4f8e('0x8b')](_0x41f7b6)||!_[_0x4f8e('0x89')](_0x41f7b6,['autoAssociation',0x0]))return _0x2f44bb;_0x3de32d=[];var _0x24dedb=_(_0x41f7b6)['map'](function(_0xc80e81){if(_0xc80e81['autoAssociation']===0x1)return;return _0xc80e81[_0x4f8e('0x3a')]===_0x4f8e('0x30')?'agent':_0x4f8e('0x33');})['compact']()[_0x4f8e('0x37')]();for(var _0x242d2e=0x0;_0x242d2e<_0x2f44bb[_0x4f8e('0x8a')];_0x242d2e++){if(!_[_0x4f8e('0x38')](_0x24dedb,_0x2f44bb[_0x242d2e][_0x4f8e('0x39')]))return;var _0x56525c=_0x2f44bb[_0x242d2e][_0x4f8e('0x39')]==='agent'?_0x4f8e('0x30'):_0x4f8e('0x32');_0x3de32d[_0x4f8e('0x4e')](db[_0x4f8e('0x3b')]['create']({'name':_0x2f44bb[_0x242d2e][_0x4f8e('0x3a')],'resourceId':_0x2f44bb[_0x242d2e]['id'],'type':_0x56525c,'sectionId':_['find'](_0x41f7b6,['name',_0x56525c])['id']},{}));}return Promise[_0x4f8e('0x5e')](_0x3de32d);});})['then'](respondWithResult(_0x21b1ad,0xc9))[_0x4f8e('0x28')](handleError(_0x21b1ad,null));};exports[_0x4f8e('0x8c')]=function(_0x38659e,_0x2f4124){if(_0x38659e[_0x4f8e('0x5f')]['id']){delete _0x38659e['body']['id'];}return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x38659e['params']['id']}})[_0x4f8e('0x29')](function(_0x38372a){if(!_0x38372a)return null;if(_0x38372a['id']===_0x38659e[_0x4f8e('0x2f')]['id']){if(!_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8d')]||!_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8e')]){throw new db[(_0x4f8e('0x8f'))]['ValidationError'](_0x4f8e('0x90'));}if(!_0x38372a[_0x4f8e('0x91')](_0x38659e[_0x4f8e('0x5f')]['oldPassword'])){throw new db['Sequelize'][(_0x4f8e('0x92'))]('Wrong\x20credentials');}if(_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8d')]===_0x38659e[_0x4f8e('0x5f')]['newPassword']){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x38659e['user'][_0x4f8e('0x39')]===_0x4f8e('0x2e')){if(!_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8e')]){throw new db['Sequelize'][(_0x4f8e('0x92'))](_0x4f8e('0x93'));}}else if(_0x38659e[_0x4f8e('0x2f')]['role']===_0x4f8e('0x2f')){if(!_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8e')]){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))](_0x4f8e('0x93'));}if(_0x38372a[_0x4f8e('0x39')]!=='agent'){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))](_0x4f8e('0x7e'));}}else{throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))]('Unauthorized');}return _0x38372a;})['then'](handleEntityNotFound(_0x2f4124,null))[_0x4f8e('0x29')](function(_0xf6886f){return db[_0x4f8e('0x64')]['findOne']({'attributes':['id',_0x4f8e('0x65'),_0x4f8e('0x94'),_0x4f8e('0x95')]})[_0x4f8e('0x29')](function(_0xf4bded){if(_0xf4bded[_0x4f8e('0x65')])authService[_0x4f8e('0x66')](_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8e')]);if(!_0xf4bded['enforcePasswordHistory']||!_0xf6886f[_0x4f8e('0x42')])return _0xf6886f;authService[_0x4f8e('0x96')](_0x38659e[_0x4f8e('0x5f')]['newPassword'],_0xf6886f[_0x4f8e('0x42')],_0xf4bded['passwordHistoryLimit']);return _0xf6886f;})[_0x4f8e('0x29')](saveUpdates({'password':_0x38659e[_0x4f8e('0x5f')]['newPassword'],'passwordResetAt':_0x38659e[_0x4f8e('0x2f')]['id']==_0x38659e[_0x4f8e('0x57')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x38659e[_0x4f8e('0x5f')][_0x4f8e('0x8e')],_0xf6886f[_0x4f8e('0x42')])},null));})[_0x4f8e('0x29')](respondWithResult(_0x2f4124,null))[_0x4f8e('0x28')](handleError(_0x2f4124,null));};exports[_0x4f8e('0x97')]=function(_0x2e36ba,_0x465e38){var _0x36cf77=_0x2e36ba[_0x4f8e('0x5f')][_0x4f8e('0x98')];return db['User'][_0x4f8e('0x5a')]({'where':{'id':_0x2e36ba[_0x4f8e('0x57')]['id']},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0x39'),_0x4f8e('0x99'),_0x4f8e('0x9a'),_0x4f8e('0x9b'),_0x4f8e('0x9c')]})['then'](handleEntityNotFound(_0x465e38,null))[_0x4f8e('0x29')](function(_0x4285a6){if(_0x4285a6){if(!utils[_0x4f8e('0x9d')](_0x36cf77)){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))](_0x4f8e('0x9e'));}return _0x4285a6[_0x4f8e('0x9f')+_[_0x4f8e('0xa0')](_0x36cf77[_0x4f8e('0xa1')]())+_0x4f8e('0xa2')](_0x2e36ba[_0x4f8e('0x5f')][_0x4f8e('0x62')],{'penalty':_0x2e36ba['body']['penalty']||0x0})['spread'](function(_0xc6ab6e){for(var _0x241c1b=0x0;_0x241c1b<_0x2e36ba['body']['ids']['length'];_0x241c1b+=0x1){var _0x55d68a={'UserId':Number(_0x2e36ba[_0x4f8e('0x57')]['id'])};_0x55d68a[_[_0x4f8e('0xa0')](_0x36cf77['toLowerCase']())+_0x4f8e('0xa3')]=Number(_0x2e36ba[_0x4f8e('0x5f')][_0x4f8e('0x62')][_0x241c1b]);socket[_0x4f8e('0x2a')](_0x4f8e('0x2f')+_['capitalize'](_0x36cf77[_0x4f8e('0xa1')]())+_0x4f8e('0xa4'),_0x55d68a);}return _0xc6ab6e;})['then'](function(){if(_0x36cf77===_0x4f8e('0xa5')){return db[_0x4f8e('0xa6')][_0x4f8e('0x4f')]({'where':{'id':_0x2e36ba[_0x4f8e('0x5f')][_0x4f8e('0x62')]||[]},'raw':!![],'attributes':['id',_0x4f8e('0x3a')]});}})['then'](function(_0x4767b1){var _0x3e6919=_0x4285a6['get']({'plain':!![]});var _0x309cde=[];if(_0x36cf77==='voice'&&_0x3e6919[_0x4f8e('0x39')]===_0x4f8e('0x31')&&_0x3e6919[_0x4f8e('0x99')]){for(let _0xf222d0=0x0;_0xf222d0<_0x4767b1[_0x4f8e('0x8a')];_0xf222d0+=0x1){_0x309cde[_0x4f8e('0x4e')]({'membername':_0x3e6919[_0x4f8e('0x3a')],'UserId':_0x3e6919['id'],'queue_name':_0x4767b1[_0xf222d0][_0x4f8e('0x3a')],'VoiceQueueId':_0x4767b1[_0xf222d0]['id'],'interface':_['isNil'](_0x3e6919[_0x4f8e('0x9c')])?util[_0x4f8e('0xa7')](_0x4f8e('0xa8'),_0x3e6919[_0x4f8e('0x3a')]):_0x3e6919[_0x4f8e('0x9c')],'paused':_0x3e6919[_0x4f8e('0x9b')]||![],'penalty':_0x2e36ba[_0x4f8e('0x5f')][_0x4f8e('0xa9')]||0x0});}return Promise['all'](_0x309cde[_0x4f8e('0x36')](function(_0x264691){return db[_0x4f8e('0xaa')]['upsert'](_0x264691);}));}return _0x4285a6;});}})[_0x4f8e('0x29')](respondWithStatusCode(_0x465e38,null))[_0x4f8e('0x28')](handleError(_0x465e38,null));};exports[_0x4f8e('0xab')]=function(_0x240fd5,_0x1a3f5e){var _0x340e03,_0x1a15cc;return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x240fd5[_0x4f8e('0x57')]['id']},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0x39')]})[_0x4f8e('0x29')](handleEntityNotFound(_0x1a3f5e,null))[_0x4f8e('0x29')](function(_0x44356b){if(_0x44356b){_0x340e03=_0x44356b;if(!_0x240fd5['query'][_0x4f8e('0x98')]||!utils[_0x4f8e('0x9d')](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x98')])){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))](_0x4f8e('0x9e'));}return _0x44356b[_0x4f8e('0xac')+_[_0x4f8e('0xa0')](_0x240fd5['query']['channel'][_0x4f8e('0xa1')]())+_0x4f8e('0xa2')](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x62')]);}})[_0x4f8e('0x29')](function(_0x14e5fb){if(_['isArray'](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x62')])){for(var _0x5a10e1=0x0;_0x5a10e1<_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x62')]['length'];_0x5a10e1+=0x1){_0x1a15cc={'UserId':Number(_0x240fd5[_0x4f8e('0x57')]['id'])};_0x1a15cc[_[_0x4f8e('0xa0')](_0x240fd5['query'][_0x4f8e('0x98')]['toLowerCase']())+_0x4f8e('0xa3')]=Number(_0x240fd5[_0x4f8e('0x48')]['ids'][_0x5a10e1]);socket[_0x4f8e('0x2a')](_0x4f8e('0x2f')+_[_0x4f8e('0xa0')](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x98')][_0x4f8e('0xa1')]())+_0x4f8e('0xad'),_0x1a15cc);}}else{_0x1a15cc={'UserId':Number(_0x240fd5['params']['id'])};_0x1a15cc[_['capitalize'](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x98')][_0x4f8e('0xa1')]())+_0x4f8e('0xa3')]=Number(_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x62')]);socket[_0x4f8e('0x2a')](_0x4f8e('0x2f')+_[_0x4f8e('0xa0')](_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x98')][_0x4f8e('0xa1')]())+_0x4f8e('0xad'),_0x1a15cc);}return _0x14e5fb;})[_0x4f8e('0x29')](function(){if(_0x240fd5[_0x4f8e('0x48')][_0x4f8e('0x98')]===_0x4f8e('0xa5')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x240fd5[_0x4f8e('0x57')]['id'],'VoiceQueueId':_0x240fd5['query'][_0x4f8e('0x62')]},'individualHooks':!![]})['then'](function(){return _0x340e03;});}return _0x340e03;})[_0x4f8e('0x29')](respondWithStatusCode(_0x1a3f5e,null))[_0x4f8e('0x28')](handleError(_0x1a3f5e,null));};exports['addAvatar']=function(_0x357fb4,_0x2b421a){_0x357fb4[_0x4f8e('0x5f')]['userpic']=_0x357fb4[_0x4f8e('0xae')]['filename'];return db['User']['find']({'where':{'id':_0x357fb4[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x2b421a,null))['then'](saveUpdates(_0x357fb4['body'],null))[_0x4f8e('0x29')](respondWithResult(_0x2b421a,null))[_0x4f8e('0x28')](handleError(_0x2b421a,null));};exports[_0x4f8e('0xaf')]=function(_0x253652,_0x31117e){var _0x29e1b0=path[_0x4f8e('0xb0')](config[_0x4f8e('0xb1')],_0x4f8e('0xb2'));return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x253652[_0x4f8e('0x57')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x31117e,null))[_0x4f8e('0x29')](function(_0x811b22){if(_0x811b22){if(_[_0x4f8e('0x67')](_0x811b22[_0x4f8e('0xb3')])){return _0x31117e[_0x4f8e('0xb4')](_0x29e1b0);}else{if(!fs[_0x4f8e('0xb5')](path[_0x4f8e('0xb0')](config[_0x4f8e('0xb1')],_0x4f8e('0xb6'),_0x811b22['userpic']))){return _0x31117e[_0x4f8e('0xb4')](_0x29e1b0);}return _0x31117e[_0x4f8e('0xb4')](path['join'](config[_0x4f8e('0xb1')],'server/files/images/',_0x811b22[_0x4f8e('0xb3')]));}}})[_0x4f8e('0x28')](handleError(_0x31117e,null));};exports[_0x4f8e('0xb7')]=function(_0x24f6fc,_0x484429){return db['User'][_0x4f8e('0x5a')]({'where':{'id':_0x24f6fc['params']['id']},'attributes':['id']})[_0x4f8e('0x29')](handleEntityNotFound(_0x484429,null))[_0x4f8e('0x29')](function(_0x4b3196){var _0x2cae55=[];values=_0x4b3196[_0x4f8e('0x52')];_0x2cae55[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x5b'),_0x4b3196[_0x4f8e('0x52')]));_0x2cae55[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x5c'),_0x4b3196[_0x4f8e('0x52')]));_0x2cae55[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x54'),_0x4b3196[_0x4f8e('0x52')]));_0x2cae55[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x55'),_0x4b3196['dataValues']));_0x2cae55[_0x4f8e('0x4e')](get_open_tabs(_0x4f8e('0x53'),_0x4b3196[_0x4f8e('0x52')]));_0x2cae55[_0x4f8e('0x4e')](get_open_tabs('mail',_0x4b3196[_0x4f8e('0x52')]));return Promise[_0x4f8e('0x5e')](_0x2cae55);})[_0x4f8e('0x29')](function(_0x4e54f5){if(_0x4e54f5){var _0x5b6fd5=_['map'](values[_0x4f8e('0xb8')],function(_0x5f276e){return{'channel':'CHAT','id':_0x5f276e['id'],'createdAt':_0x5f276e[_0x4f8e('0xb9')]};});var _0x3ec161=_[_0x4f8e('0x36')](values[_0x4f8e('0xba')],function(_0x44c305){return{'channel':'FAX','id':_0x44c305['id'],'createdAt':_0x44c305[_0x4f8e('0xb9')]};});var _0x3e7865=_[_0x4f8e('0x36')](values[_0x4f8e('0xbb')],function(_0x3a63d2){return{'channel':_0x4f8e('0xbc'),'id':_0x3a63d2['id'],'createdAt':_0x3a63d2[_0x4f8e('0xb9')]};});var _0x36d8d4=_[_0x4f8e('0x36')](values['MailOpenTabs'],function(_0x20c8af){return{'channel':_0x4f8e('0xbd'),'id':_0x20c8af['id'],'createdAt':_0x20c8af['createdAt']};});var _0x53127b=_[_0x4f8e('0x36')](values['SmsOpenTabs'],function(_0x11277d){return{'channel':'SMS','id':_0x11277d['id'],'createdAt':_0x11277d[_0x4f8e('0xb9')]};});var _0x3c5f40=_[_0x4f8e('0x36')](values[_0x4f8e('0xbe')],function(_0x6900c3){return{'channel':_0x4f8e('0xbf'),'id':_0x6900c3['id'],'createdAt':_0x6900c3['createdAt']};});var _0xfee29a=_[_0x4f8e('0xc0')](_0x5b6fd5,_0x3ec161,_0x3e7865,_0x36d8d4,_0x53127b,_0x3c5f40);var _0xb36710={'count':_0xfee29a['length'],'rows':_0xfee29a};return _0xb36710;}else return null;})['then'](respondWithResult(_0x484429,null))['catch'](handleError(_0x484429,null));};exports[_0x4f8e('0xc1')]=function(_0x2796a1,_0x20dba1){var _0x4ef614={};return db['User'][_0x4f8e('0xc2')]({'where':{'id':_0x2796a1[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](function(_0x50e2d0){if(!_0x50e2d0){throw new APINotFoundError(util[_0x4f8e('0xa7')](_0x4f8e('0xc3'),_0x2796a1[_0x4f8e('0x57')]['id']));}return contacts[_0x4f8e('0x60')]();})[_0x4f8e('0x29')](function(_0x25a36f){_0x2796a1[_0x4f8e('0x48')]['User']=_0x2796a1['params']['id'];_0x4ef614=qs[_0x4f8e('0x45')](_0x25a36f,_0x2796a1);if(_0x2796a1[_0x4f8e('0x48')][_0x4f8e('0xc4')]('includeAll')){_0x4ef614[_0x4f8e('0x4a')]=[{'model':db['CmList'],'as':_0x4f8e('0xc5'),'required':![]},{'model':db[_0x4f8e('0xc6')],'as':_0x4f8e('0xc7'),'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0xc8')],'where':_0x2796a1[_0x4f8e('0x48')][_0x4f8e('0xc9')]?{'id':_0x2796a1[_0x4f8e('0x48')][_0x4f8e('0xc9')]}:undefined,'required':_0x2796a1['query'][_0x4f8e('0xc9')]?!![]:![]}];}return contacts[_0x4f8e('0x4f')](_0x2796a1[_0x4f8e('0x48')],_0x2796a1[_0x4f8e('0x2f')],_0x4ef614,_0x25a36f);})[_0x4f8e('0x29')](respondWithFilteredResult(_0x20dba1,_0x4ef614))[_0x4f8e('0x28')](APIHandleError(_0x20dba1));};exports[_0x4f8e('0xca')]=function(_0x16c714,_0x8f4157){var _0x1f3839;var _0x575217={};var _0x234315;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x16c714['params']['id']},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0x39')]})[_0x4f8e('0x29')](handleEntityNotFound(_0x8f4157,null))[_0x4f8e('0x29')](function(_0x53d3b0){if(!utils[_0x4f8e('0x9d')](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x98')])){throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))](_0x4f8e('0x9e'));}_0x1f3839=_0x53d3b0;var _0x339b7c={};_0x339b7c['model']=_[_0x4f8e('0xcb')](db[_['capitalize'](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x98')])+_0x4f8e('0xcc')]['rawAttributes']);_0x339b7c[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x16c714[_0x4f8e('0x48')]);_0x339b7c[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x339b7c[_0x4f8e('0xcf')],_0x339b7c[_0x4f8e('0x48')]);_0x575217[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x339b7c[_0x4f8e('0xcf')],qs['fields'](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x575217['attributes']=_0x575217[_0x4f8e('0x4d')]['length']?_0x575217[_0x4f8e('0x4d')]:_0x339b7c[_0x4f8e('0xcf')];_0x575217[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x575217[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_['pick'](_0x16c714[_0x4f8e('0x48')],_0x339b7c['filters']));if(_0x16c714['query']['filter']){_0x575217[_0x4f8e('0x46')]=_['merge'](_0x575217['where'],{'$or':_[_0x4f8e('0x36')](_0x575217[_0x4f8e('0x4d')],function(_0x1f7454){var _0x1f0842={};_0x1f0842[_0x1f7454]={'$like':'%'+_0x16c714['query']['filter']+'%'};return _0x1f0842;})});}_0x575217=_[_0x4f8e('0x58')]({},_0x575217,_0x16c714[_0x4f8e('0x59')]);switch(_0x1f3839[_0x4f8e('0x39')]){case _0x4f8e('0x2e'):return db[_['capitalize'](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x98')])+_0x4f8e('0xcc')][_0x4f8e('0x4f')](_0x575217);case _0x4f8e('0x2f'):case _0x4f8e('0x31'):return _0x1f3839[_0x4f8e('0x2d')+_[_0x4f8e('0xa0')](_0x16c714[_0x4f8e('0x48')]['channel'])+_0x4f8e('0xa2')](_0x575217);default:throw new db[(_0x4f8e('0x8f'))][(_0x4f8e('0x92'))]('Unknown\x20role');}})['then'](function(_0x4085f7){_0x234315=_0x4085f7['length'];if(!_0x16c714[_0x4f8e('0x48')][_0x4f8e('0xc4')]('nolimit')){_0x575217[_0x4f8e('0x19')]=qs['limit'](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x19')]);_0x575217[_0x4f8e('0x17')]=qs[_0x4f8e('0x17')](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x17')]);}switch(_0x1f3839[_0x4f8e('0x39')]){case _0x4f8e('0x2e'):return db[_[_0x4f8e('0xa0')](_0x16c714['query'][_0x4f8e('0x98')])+_0x4f8e('0xcc')][_0x4f8e('0x4f')](_0x575217);case _0x4f8e('0x2f'):case _0x4f8e('0x31'):return _0x1f3839['get'+_[_0x4f8e('0xa0')](_0x16c714[_0x4f8e('0x48')][_0x4f8e('0x98')])+'Queues'](_0x575217);}})[_0x4f8e('0x29')](function(_0x3e9a0b){return{'count':_0x234315,'rows':_0x3e9a0b};})[_0x4f8e('0x29')](respondWithResult(_0x8f4157,null))[_0x4f8e('0x28')](handleError(_0x8f4157,null));};exports[_0x4f8e('0xd3')]=function(_0x353ee6,_0x15694c){var _0x54f58f={};var _0xa9fc07={};var _0x62c0b2;var _0x1e8e9c;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x353ee6[_0x4f8e('0x57')]['id']}})['then'](handleEntityNotFound(_0x15694c,null))[_0x4f8e('0x29')](function(_0xff20b6){if(_0xff20b6){_0x62c0b2=_0xff20b6;_0xa9fc07['model']=_[_0x4f8e('0xcb')](db[_0x4f8e('0xaa')]['rawAttributes']);_0xa9fc07['query']=_['keys'](_0x353ee6['query']);_0xa9fc07[_0x4f8e('0xcd')]=_['intersection'](_0xa9fc07['model'],_0xa9fc07[_0x4f8e('0x48')]);_0x54f58f[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0xa9fc07[_0x4f8e('0xcf')],qs['fields'](_0x353ee6[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x54f58f[_0x4f8e('0x4d')]=_0x54f58f[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x54f58f[_0x4f8e('0x4d')]:_0xa9fc07['model'];_0x54f58f['order']=qs['sort'](_0x353ee6[_0x4f8e('0x48')]['sort']);_0x54f58f['where']=qs['filters'](_[_0x4f8e('0xd4')](_0x353ee6[_0x4f8e('0x48')],_0xa9fc07[_0x4f8e('0xcd')]));if(_0x353ee6[_0x4f8e('0x48')][_0x4f8e('0x34')]){_0x54f58f[_0x4f8e('0x46')]=_[_0x4f8e('0x58')](_0x54f58f[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x54f58f['attributes'],function(_0x5e55ff){var _0x3d10d3={};_0x3d10d3[_0x5e55ff]={'$like':'%'+_0x353ee6['query'][_0x4f8e('0x34')]+'%'};return _0x3d10d3;})});}_0x54f58f=_['merge']({},_0x54f58f,_0x353ee6[_0x4f8e('0x59')]);return _0x62c0b2[_0x4f8e('0xd3')](_0x54f58f);}})['then'](function(_0x1338d8){if(_0x1338d8){_0x1e8e9c=_0x1338d8[_0x4f8e('0x8a')];if(!_0x353ee6[_0x4f8e('0x48')][_0x4f8e('0xc4')](_0x4f8e('0xd5'))){_0x54f58f[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x353ee6[_0x4f8e('0x48')][_0x4f8e('0x19')]);_0x54f58f[_0x4f8e('0x17')]=qs['offset'](_0x353ee6[_0x4f8e('0x48')][_0x4f8e('0x17')]);}return _0x62c0b2['getVoiceQueuesRt'](_0x54f58f);}})[_0x4f8e('0x29')](function(_0xff6d68){if(_0xff6d68){return _0xff6d68?{'count':_0x1e8e9c,'rows':_0xff6d68}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x15694c,null))[_0x4f8e('0x28')](handleError(_0x15694c,null));};exports[_0x4f8e('0xd6')]=function(_0x366b3b,_0x52e274){var _0x1c9467={};var _0x42dbe1={};var _0x6c0427;var _0x203d12;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x366b3b[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x52e274,null))[_0x4f8e('0x29')](function(_0x516794){if(_0x516794){_0x6c0427=_0x516794;_0x42dbe1[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db[_0x4f8e('0xd7')][_0x4f8e('0x3e')]);_0x42dbe1[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x366b3b[_0x4f8e('0x48')]);_0x42dbe1[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x42dbe1[_0x4f8e('0xcf')],_0x42dbe1[_0x4f8e('0x48')]);_0x1c9467[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x42dbe1[_0x4f8e('0xcf')],qs['fields'](_0x366b3b[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x1c9467['attributes']=_0x1c9467[_0x4f8e('0x4d')]['length']?_0x1c9467[_0x4f8e('0x4d')]:_0x42dbe1['model'];_0x1c9467[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x366b3b[_0x4f8e('0x48')]['sort']);_0x1c9467['where']=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x366b3b[_0x4f8e('0x48')],_0x42dbe1[_0x4f8e('0xcd')]));if(_0x366b3b[_0x4f8e('0x48')][_0x4f8e('0x34')]){_0x1c9467[_0x4f8e('0x46')]=_['merge'](_0x1c9467[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x1c9467[_0x4f8e('0x4d')],function(_0x517dc6){var _0x350c59={};_0x350c59[_0x517dc6]={'$like':'%'+_0x366b3b['query'][_0x4f8e('0x34')]+'%'};return _0x350c59;})});}_0x1c9467=_[_0x4f8e('0x58')]({},_0x1c9467,_0x366b3b['options']);return _0x6c0427[_0x4f8e('0xd6')](_0x1c9467);}})[_0x4f8e('0x29')](function(_0x19db8f){if(_0x19db8f){_0x203d12=_0x19db8f[_0x4f8e('0x8a')];if(!_0x366b3b['query'][_0x4f8e('0xc4')](_0x4f8e('0xd5'))){_0x1c9467[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x366b3b[_0x4f8e('0x48')][_0x4f8e('0x19')]);_0x1c9467[_0x4f8e('0x17')]=qs[_0x4f8e('0x17')](_0x366b3b[_0x4f8e('0x48')]['offset']);}return _0x6c0427[_0x4f8e('0xd6')](_0x1c9467);}})[_0x4f8e('0x29')](function(_0x2eeebe){if(_0x2eeebe){return _0x2eeebe?{'count':_0x203d12,'rows':_0x2eeebe}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x52e274,null))[_0x4f8e('0x28')](handleError(_0x52e274,null));};exports[_0x4f8e('0xd8')]=function(_0x262090,_0x3c1b9f){var _0x68a292={'raw':!![],'where':{}};var _0x33eded={};var _0x311314={'count':0x0,'rows':[]};return db['User'][_0x4f8e('0xc2')]({'where':{'id':_0x262090[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x3c1b9f,null))['then'](function(_0x30e469){if(_0x30e469){_0x33eded[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db['VoiceRecording']['rawAttributes']);_0x33eded[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x262090[_0x4f8e('0x48')]);_0x33eded[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x33eded[_0x4f8e('0xcf')],_0x33eded[_0x4f8e('0x48')]);_0x68a292[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x33eded['model'],qs[_0x4f8e('0xd0')](_0x262090[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x68a292[_0x4f8e('0x4d')]=_0x68a292['attributes'][_0x4f8e('0x8a')]?_0x68a292[_0x4f8e('0x4d')]:_0x33eded[_0x4f8e('0xcf')];if(!_0x262090[_0x4f8e('0x48')]['hasOwnProperty'](_0x4f8e('0xd5'))){_0x68a292[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x262090['query'][_0x4f8e('0x19')]);_0x68a292['offset']=qs[_0x4f8e('0x17')](_0x262090['query']['offset']);}_0x68a292[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x262090[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x68a292[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x262090[_0x4f8e('0x48')],_0x33eded[_0x4f8e('0xcd')]));_0x68a292[_0x4f8e('0x46')][_0x4f8e('0xd9')]=_0x30e469['id'];if(_0x262090['query']['filter']){_0x68a292['where']=_[_0x4f8e('0x58')](_0x68a292[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x68a292[_0x4f8e('0x4d')],function(_0x410504){var _0x2fa790={};_0x2fa790[_0x410504]={'$like':'%'+_0x262090['query']['filter']+'%'};return _0x2fa790;})});}_0x68a292=_['merge']({},_0x68a292,_0x262090[_0x4f8e('0x59')]);return db['VoiceRecording'][_0x4f8e('0x1a')]({'where':_0x68a292[_0x4f8e('0x46')]})['then'](function(_0x14e96f){_0x311314[_0x4f8e('0x1a')]=_0x14e96f;if(_0x262090['query'][_0x4f8e('0x49')]){_0x68a292[_0x4f8e('0x4a')]=[{'all':!![]}];}return db[_0x4f8e('0xda')][_0x4f8e('0x4f')](_0x68a292);})[_0x4f8e('0x29')](function(_0x108206){_0x311314[_0x4f8e('0x50')]=_0x108206;return _0x311314;});}})[_0x4f8e('0x29')](respondWithFilteredResult(_0x3c1b9f,_0x68a292))[_0x4f8e('0x28')](handleError(_0x3c1b9f,null));};exports[_0x4f8e('0xdb')]=function(_0x559c08,_0x50a1dc){var _0x1ae629={'raw':!![],'where':{}};var _0x4feec1={};var _0x5f431b={'count':0x0,'rows':[]};return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x559c08[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x50a1dc,null))[_0x4f8e('0x29')](function(_0x10a4ae){if(_0x10a4ae){_0x4feec1['model']=_['keys'](db[_0x4f8e('0xdc')][_0x4f8e('0x3e')]);_0x4feec1['query']=_['keys'](_0x559c08['query']);_0x4feec1[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x4feec1['model'],_0x4feec1['query']);_0x1ae629['attributes']=_['intersection'](_0x4feec1[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x559c08['query'][_0x4f8e('0xd0')]));_0x1ae629[_0x4f8e('0x4d')]=_0x1ae629[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x1ae629[_0x4f8e('0x4d')]:_0x4feec1[_0x4f8e('0xcf')];if(!_0x559c08[_0x4f8e('0x48')][_0x4f8e('0xc4')](_0x4f8e('0xd5'))){_0x1ae629[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x559c08['query'][_0x4f8e('0x19')]);_0x1ae629[_0x4f8e('0x17')]=qs[_0x4f8e('0x17')](_0x559c08[_0x4f8e('0x48')]['offset']);}_0x1ae629[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x559c08[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x1ae629['where']=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x559c08[_0x4f8e('0x48')],_0x4feec1[_0x4f8e('0xcd')]));_0x1ae629[_0x4f8e('0x46')]['UserId']=_0x10a4ae['id'];if(_0x559c08['query'][_0x4f8e('0x34')]){_0x1ae629['where']=_[_0x4f8e('0x58')](_0x1ae629[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x1ae629[_0x4f8e('0x4d')],function(_0x2b60b9){var _0x21c09f={};_0x21c09f[_0x2b60b9]={'$like':'%'+_0x559c08[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x21c09f;})});}_0x1ae629=_[_0x4f8e('0x58')]({},_0x1ae629,_0x559c08['options']);return db[_0x4f8e('0xdc')]['count']({'where':_0x1ae629[_0x4f8e('0x46')]})['then'](function(_0x3bb803){_0x5f431b[_0x4f8e('0x1a')]=_0x3bb803;if(_0x559c08['query'][_0x4f8e('0x49')]){_0x1ae629['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x4f8e('0x4f')](_0x1ae629);})['then'](function(_0x51f717){_0x5f431b['rows']=_0x51f717;return _0x5f431b;});}})[_0x4f8e('0x29')](respondWithFilteredResult(_0x50a1dc,_0x1ae629))[_0x4f8e('0x28')](handleError(_0x50a1dc,null));};exports['getChatInteractions']=function(_0x4bfc42,_0x5a5369){var _0x4ec951={};var _0xe940e3={};var _0x4b7393;var _0x41ded2;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x4bfc42['params']['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x5a5369,null))['then'](function(_0xfb0b47){if(_0xfb0b47){_0x4b7393=_0xfb0b47;_0xe940e3[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db[_0x4f8e('0xdd')][_0x4f8e('0x3e')]);_0xe940e3[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x4bfc42[_0x4f8e('0x48')]);_0xe940e3[_0x4f8e('0xcd')]=_['intersection'](_0xe940e3[_0x4f8e('0xcf')],_0xe940e3[_0x4f8e('0x48')]);_0x4ec951[_0x4f8e('0x4d')]=_['intersection'](_0xe940e3['model'],qs[_0x4f8e('0xd0')](_0x4bfc42[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x4ec951[_0x4f8e('0x4d')]=_0x4ec951['attributes'][_0x4f8e('0x8a')]?_0x4ec951[_0x4f8e('0x4d')]:_0xe940e3['model'];_0x4ec951[_0x4f8e('0xd1')]=qs['sort'](_0x4bfc42['query']['sort']);_0x4ec951[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_['pick'](_0x4bfc42[_0x4f8e('0x48')],_0xe940e3['filters']));if(_0x4bfc42[_0x4f8e('0x48')]['filter']){_0x4ec951[_0x4f8e('0x46')]=_[_0x4f8e('0x58')](_0x4ec951[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x4ec951[_0x4f8e('0x4d')],function(_0x4ae0a0){var _0x4fb243={};_0x4fb243[_0x4ae0a0]={'$like':'%'+_0x4bfc42[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x4fb243;})});}_0x4ec951=_[_0x4f8e('0x58')]({},_0x4ec951,_0x4bfc42[_0x4f8e('0x59')]);return _0x4b7393[_0x4f8e('0xde')](_0x4ec951);}})[_0x4f8e('0x29')](function(_0x625953){if(_0x625953){_0x41ded2=_0x625953[_0x4f8e('0x8a')];if(!_0x4bfc42['query'][_0x4f8e('0xc4')]('nolimit')){_0x4ec951[_0x4f8e('0x19')]=qs['limit'](_0x4bfc42[_0x4f8e('0x48')]['limit']);_0x4ec951['offset']=qs['offset'](_0x4bfc42[_0x4f8e('0x48')][_0x4f8e('0x17')]);}return _0x4b7393[_0x4f8e('0xde')](_0x4ec951);}})[_0x4f8e('0x29')](function(_0x35f848){if(_0x35f848){return _0x35f848?{'count':_0x41ded2,'rows':_0x35f848}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x5a5369,null))['catch'](handleError(_0x5a5369,null));};exports[_0x4f8e('0xdf')]=function(_0x1c9bc2,_0x4935e6){var _0x32b725={};var _0x29bcaf={};var _0x2f5fc6;var _0x48d55a;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x1c9bc2['params']['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x4935e6,null))[_0x4f8e('0x29')](function(_0x158b67){if(_0x158b67){_0x2f5fc6=_0x158b67;_0x29bcaf[_0x4f8e('0xcf')]=_['keys'](db[_0x4f8e('0xe0')][_0x4f8e('0x3e')]);_0x29bcaf[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x1c9bc2[_0x4f8e('0x48')]);_0x29bcaf['filters']=_[_0x4f8e('0xce')](_0x29bcaf[_0x4f8e('0xcf')],_0x29bcaf[_0x4f8e('0x48')]);_0x32b725[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x29bcaf[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x1c9bc2[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x32b725['attributes']=_0x32b725[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x32b725[_0x4f8e('0x4d')]:_0x29bcaf[_0x4f8e('0xcf')];_0x32b725[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x1c9bc2[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x32b725[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x1c9bc2[_0x4f8e('0x48')],_0x29bcaf[_0x4f8e('0xcd')]));if(_0x1c9bc2[_0x4f8e('0x48')]['filter']){_0x32b725[_0x4f8e('0x46')]=_[_0x4f8e('0x58')](_0x32b725[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x32b725[_0x4f8e('0x4d')],function(_0x413d50){var _0x254504={};_0x254504[_0x413d50]={'$like':'%'+_0x1c9bc2[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x254504;})});}_0x32b725=_[_0x4f8e('0x58')]({},_0x32b725,_0x1c9bc2[_0x4f8e('0x59')]);return _0x2f5fc6[_0x4f8e('0xdf')](_0x32b725);}})[_0x4f8e('0x29')](function(_0x40f528){if(_0x40f528){_0x48d55a=_0x40f528[_0x4f8e('0x8a')];if(!_0x1c9bc2[_0x4f8e('0x48')][_0x4f8e('0xc4')](_0x4f8e('0xd5'))){_0x32b725['limit']=qs['limit'](_0x1c9bc2[_0x4f8e('0x48')][_0x4f8e('0x19')]);_0x32b725['offset']=qs[_0x4f8e('0x17')](_0x1c9bc2['query'][_0x4f8e('0x17')]);}return _0x2f5fc6['getOpenchannelInteractions'](_0x32b725);}})[_0x4f8e('0x29')](function(_0x52d928){if(_0x52d928){return _0x52d928?{'count':_0x48d55a,'rows':_0x52d928}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x4935e6,null))[_0x4f8e('0x28')](handleError(_0x4935e6,null));};exports['getMailInteractions']=function(_0x4ae719,_0x22bae0){var _0x38b095={'raw':!![],'where':{}};var _0x16ffd8={};var _0x21c46c={'count':0x0,'rows':[]};return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x4ae719[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x22bae0,null))['then'](function(_0x51a158){if(_0x51a158){_0x16ffd8[_0x4f8e('0xcf')]=_['keys'](db[_0x4f8e('0xe1')][_0x4f8e('0x3e')]);_0x16ffd8[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x4ae719[_0x4f8e('0x48')]);_0x16ffd8[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x16ffd8[_0x4f8e('0xcf')],_0x16ffd8['query']);_0x38b095[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x16ffd8[_0x4f8e('0xcf')],qs['fields'](_0x4ae719['query'][_0x4f8e('0xd0')]));_0x38b095['attributes']=_0x38b095['attributes'][_0x4f8e('0x8a')]?_0x38b095[_0x4f8e('0x4d')]:_0x16ffd8['model'];if(!_0x4ae719['query']['hasOwnProperty'](_0x4f8e('0xd5'))){_0x38b095[_0x4f8e('0x19')]=qs['limit'](_0x4ae719['query']['limit']);_0x38b095[_0x4f8e('0x17')]=qs['offset'](_0x4ae719['query'][_0x4f8e('0x17')]);}_0x38b095[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x4ae719[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x38b095[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x4ae719[_0x4f8e('0x48')],_0x16ffd8['filters']));_0x38b095['where'][_0x4f8e('0xd9')]=_0x51a158['id'];if(_0x4ae719[_0x4f8e('0x48')]['filter']){_0x38b095[_0x4f8e('0x46')]=_['merge'](_0x38b095[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x38b095[_0x4f8e('0x4d')],function(_0x4effdf){var _0x26f80c={};_0x26f80c[_0x4effdf]={'$like':'%'+_0x4ae719[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x26f80c;})});}_0x38b095=_['merge']({},_0x38b095,_0x4ae719['options']);return db[_0x4f8e('0xe1')][_0x4f8e('0x1a')]({'where':_0x38b095['where']})[_0x4f8e('0x29')](function(_0x2256a1){_0x21c46c[_0x4f8e('0x1a')]=_0x2256a1;if(_0x4ae719['query'][_0x4f8e('0x49')]){_0x38b095[_0x4f8e('0x4a')]=[{'all':!![]}];}return db[_0x4f8e('0xe1')][_0x4f8e('0x4f')](_0x38b095);})[_0x4f8e('0x29')](function(_0x39a1ad){_0x21c46c[_0x4f8e('0x50')]=_0x39a1ad;return _0x21c46c;});}})[_0x4f8e('0x29')](respondWithFilteredResult(_0x22bae0,_0x38b095))[_0x4f8e('0x28')](handleError(_0x22bae0,null));};exports[_0x4f8e('0xe2')]=function(_0x5393ad,_0x5e2a6b){var _0x1c2dc9={};var _0x111f48={};var _0xccf736;var _0x599d65;return db['User'][_0x4f8e('0xc2')]({'where':{'id':_0x5393ad[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x5e2a6b,null))[_0x4f8e('0x29')](function(_0x1126f3){if(_0x1126f3){_0xccf736=_0x1126f3;_0x111f48[_0x4f8e('0xcf')]=_['keys'](db[_0x4f8e('0xe3')][_0x4f8e('0x3e')]);_0x111f48[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x5393ad['query']);_0x111f48[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x111f48[_0x4f8e('0xcf')],_0x111f48['query']);_0x1c2dc9[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x111f48[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x5393ad['query'][_0x4f8e('0xd0')]));_0x1c2dc9[_0x4f8e('0x4d')]=_0x1c2dc9[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x1c2dc9[_0x4f8e('0x4d')]:_0x111f48[_0x4f8e('0xcf')];_0x1c2dc9['order']=qs[_0x4f8e('0xd2')](_0x5393ad[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x1c2dc9[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x5393ad[_0x4f8e('0x48')],_0x111f48['filters']));if(_0x5393ad[_0x4f8e('0x48')][_0x4f8e('0x34')]){_0x1c2dc9['where']=_[_0x4f8e('0x58')](_0x1c2dc9['where'],{'$or':_[_0x4f8e('0x36')](_0x1c2dc9[_0x4f8e('0x4d')],function(_0x3d75d8){var _0x14cf16={};_0x14cf16[_0x3d75d8]={'$like':'%'+_0x5393ad[_0x4f8e('0x48')]['filter']+'%'};return _0x14cf16;})});}_0x1c2dc9=_[_0x4f8e('0x58')]({},_0x1c2dc9,_0x5393ad[_0x4f8e('0x59')]);return _0xccf736[_0x4f8e('0xe2')](_0x1c2dc9);}})[_0x4f8e('0x29')](function(_0x39aa4a){if(_0x39aa4a){_0x599d65=_0x39aa4a['length'];if(!_0x5393ad[_0x4f8e('0x48')][_0x4f8e('0xc4')](_0x4f8e('0xd5'))){_0x1c2dc9[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x5393ad['query']['limit']);_0x1c2dc9[_0x4f8e('0x17')]=qs[_0x4f8e('0x17')](_0x5393ad[_0x4f8e('0x48')]['offset']);}return _0xccf736['getSmsInteractions'](_0x1c2dc9);}})[_0x4f8e('0x29')](function(_0x1fcdd7){if(_0x1fcdd7){return _0x1fcdd7?{'count':_0x599d65,'rows':_0x1fcdd7}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x5e2a6b,null))[_0x4f8e('0x28')](handleError(_0x5e2a6b,null));};exports['getFaxInteractions']=function(_0x204e04,_0x5f129e){var _0x4ec42a={};var _0x2f7e00={};var _0x4ce1aa;var _0xca1a76;return db['User'][_0x4f8e('0xc2')]({'where':{'id':_0x204e04['params']['id']}})['then'](handleEntityNotFound(_0x5f129e,null))[_0x4f8e('0x29')](function(_0x2c3c2a){if(_0x2c3c2a){_0x4ce1aa=_0x2c3c2a;_0x2f7e00['model']=_[_0x4f8e('0xcb')](db[_0x4f8e('0xe4')][_0x4f8e('0x3e')]);_0x2f7e00[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x204e04[_0x4f8e('0x48')]);_0x2f7e00[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x2f7e00[_0x4f8e('0xcf')],_0x2f7e00[_0x4f8e('0x48')]);_0x4ec42a[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x2f7e00[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x204e04[_0x4f8e('0x48')]['fields']));_0x4ec42a[_0x4f8e('0x4d')]=_0x4ec42a[_0x4f8e('0x4d')]['length']?_0x4ec42a[_0x4f8e('0x4d')]:_0x2f7e00[_0x4f8e('0xcf')];_0x4ec42a[_0x4f8e('0xd1')]=qs['sort'](_0x204e04[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x4ec42a[_0x4f8e('0x46')]=qs['filters'](_[_0x4f8e('0xd4')](_0x204e04[_0x4f8e('0x48')],_0x2f7e00[_0x4f8e('0xcd')]));if(_0x204e04[_0x4f8e('0x48')]['filter']){_0x4ec42a['where']=_['merge'](_0x4ec42a['where'],{'$or':_[_0x4f8e('0x36')](_0x4ec42a['attributes'],function(_0x3f5c3b){var _0x5d2cbd={};_0x5d2cbd[_0x3f5c3b]={'$like':'%'+_0x204e04[_0x4f8e('0x48')]['filter']+'%'};return _0x5d2cbd;})});}_0x4ec42a=_[_0x4f8e('0x58')]({},_0x4ec42a,_0x204e04[_0x4f8e('0x59')]);return _0x4ce1aa[_0x4f8e('0xe5')](_0x4ec42a);}})[_0x4f8e('0x29')](function(_0x328c6a){if(_0x328c6a){_0xca1a76=_0x328c6a[_0x4f8e('0x8a')];if(!_0x204e04[_0x4f8e('0x48')][_0x4f8e('0xc4')]('nolimit')){_0x4ec42a[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x204e04[_0x4f8e('0x48')][_0x4f8e('0x19')]);_0x4ec42a[_0x4f8e('0x17')]=qs[_0x4f8e('0x17')](_0x204e04[_0x4f8e('0x48')]['offset']);}return _0x4ce1aa['getFaxInteractions'](_0x4ec42a);}})[_0x4f8e('0x29')](function(_0x48edec){if(_0x48edec){return _0x48edec?{'count':_0xca1a76,'rows':_0x48edec}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x5f129e,null))[_0x4f8e('0x28')](handleError(_0x5f129e,null));};exports['getWhatsappInteractions']=function(_0x144e88,_0x1240ec){var _0x3160eb={};var _0x516011={};var _0x3067f2;var _0x336e42;return db['User'][_0x4f8e('0xc2')]({'where':{'id':_0x144e88[_0x4f8e('0x57')]['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x1240ec,null))[_0x4f8e('0x29')](function(_0x26118d){if(_0x26118d){_0x3067f2=_0x26118d;_0x516011[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db[_0x4f8e('0xe6')][_0x4f8e('0x3e')]);_0x516011[_0x4f8e('0x48')]=_['keys'](_0x144e88[_0x4f8e('0x48')]);_0x516011[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x516011[_0x4f8e('0xcf')],_0x516011[_0x4f8e('0x48')]);_0x3160eb[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x516011[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x144e88['query'][_0x4f8e('0xd0')]));_0x3160eb[_0x4f8e('0x4d')]=_0x3160eb[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x3160eb[_0x4f8e('0x4d')]:_0x516011['model'];_0x3160eb[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x144e88[_0x4f8e('0x48')]['sort']);_0x3160eb[_0x4f8e('0x46')]=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x144e88[_0x4f8e('0x48')],_0x516011[_0x4f8e('0xcd')]));if(_0x144e88[_0x4f8e('0x48')]['filter']){_0x3160eb[_0x4f8e('0x46')]=_[_0x4f8e('0x58')](_0x3160eb[_0x4f8e('0x46')],{'$or':_['map'](_0x3160eb[_0x4f8e('0x4d')],function(_0x4d238){var _0x28d9a7={};_0x28d9a7[_0x4d238]={'$like':'%'+_0x144e88[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x28d9a7;})});}_0x3160eb=_['merge']({},_0x3160eb,_0x144e88[_0x4f8e('0x59')]);return _0x3067f2[_0x4f8e('0xe7')](_0x3160eb);}})[_0x4f8e('0x29')](function(_0x424c31){if(_0x424c31){_0x336e42=_0x424c31[_0x4f8e('0x8a')];if(!_0x144e88[_0x4f8e('0x48')][_0x4f8e('0xc4')]('nolimit')){_0x3160eb['limit']=qs[_0x4f8e('0x19')](_0x144e88[_0x4f8e('0x48')]['limit']);_0x3160eb[_0x4f8e('0x17')]=qs['offset'](_0x144e88[_0x4f8e('0x48')]['offset']);}return _0x3067f2[_0x4f8e('0xe7')](_0x3160eb);}})['then'](function(_0x126541){if(_0x126541){return _0x126541?{'count':_0x336e42,'rows':_0x126541}:null;}})['then'](respondWithResult(_0x1240ec,null))[_0x4f8e('0x28')](handleError(_0x1240ec,null));};exports['login']=function(_0x5c7f70,_0x3f2041,_0x1f5ddb){var _0x1e8ebd;var _0x46fbae;var _0x314d45;var _0x16d152=!_[_0x4f8e('0x67')](_0x5c7f70[_0x4f8e('0x57')]['id'])?_0x5c7f70[_0x4f8e('0x57')]['id']:!_['isNil'](_0x5c7f70[_0x4f8e('0x2f')]['id'])?_0x5c7f70[_0x4f8e('0x2f')]['id']:null;return db[_0x4f8e('0x47')][_0x4f8e('0x5a')]({'where':{'id':_0x16d152,'role':{'$or':[_0x4f8e('0x2e'),_0x4f8e('0x2f'),_0x4f8e('0x31')]}},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0xe8'),_0x4f8e('0xe9'),_0x4f8e('0x39'),_0x4f8e('0x69'),'loginInPause']})[_0x4f8e('0x29')](function(_0x7b949e){if(_0x7b949e){if(_0x7b949e[_0x4f8e('0x39')]===_0x4f8e('0x31')){_0x1e8ebd=_0x7b949e;if(_0x5c7f70[_0x4f8e('0x5f')][_0x4f8e('0x9c')]){_0x314d45=util[_0x4f8e('0xa7')](_0x4f8e('0xea'),_0x1e8ebd[_0x5c7f70['body'][_0x4f8e('0x9c')]]);}else if(_0x5c7f70[_0x4f8e('0x5f')][_0x4f8e('0xeb')]){_0x314d45=util[_0x4f8e('0xa7')](_0x4f8e('0xa8'),_0x5c7f70[_0x4f8e('0x5f')][_0x4f8e('0xeb')]);}else{_0x314d45=util['format'](_0x4f8e('0xa8'),_0x1e8ebd['name']);}socket['to'](util['format'](_0x4f8e('0xec'),_0x1e8ebd[_0x4f8e('0x3a')]))['emit'](_0x4f8e('0xed'),{'user':{'id':_0x1e8ebd['id'],'name':_0x1e8ebd[_0x4f8e('0x3a')]},'ip':_0x5c7f70['headers'][_0x4f8e('0xee')]||_0x5c7f70[_0x4f8e('0xef')]['remoteAddress']||_0x5c7f70[_0x4f8e('0xf0')][_0x4f8e('0xf1')]||_0x5c7f70[_0x4f8e('0xef')]['socket'][_0x4f8e('0xf1')]});return db['UserVoiceQueueRt'][_0x4f8e('0x2c')]({'where':{'membername':_0x1e8ebd[_0x4f8e('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0x4f8e('0xf2'));}})[_0x4f8e('0x29')](function(){if(_0x1e8ebd){return _0x1e8ebd[_0x4f8e('0xf3')]({'raw':!![]});}})[_0x4f8e('0x29')](function(_0x3d6fa3){if(_0x1e8ebd){if(_0x3d6fa3){_0x46fbae=_0x3d6fa3;if(_0x46fbae[_0x4f8e('0x8a')]){var _0x10dcd7=_0x46fbae[_0x4f8e('0x36')](function(_0x4bfc8a){var _0x199892={'membername':_0x1e8ebd[_0x4f8e('0x3a')],'UserId':_0x1e8ebd['id'],'queue_name':_0x4bfc8a[_0x4f8e('0x3a')],'VoiceQueueId':_0x4bfc8a['id'],'interface':_0x314d45,'paused':_0x1e8ebd[_0x4f8e('0x9a')]||![],'penalty':_0x4bfc8a[_0x4f8e('0xf4')]||0x0};return db[_0x4f8e('0xaa')][_0x4f8e('0xf5')](_0x199892);});return Promise[_0x4f8e('0x5e')](_0x10dcd7);}}}})[_0x4f8e('0x29')](function(){if(_0x1e8ebd){return db[_0x4f8e('0xf6')][_0x4f8e('0x4f')]({'where':{'membername':_0x1e8ebd[_0x4f8e('0x3a')],'exitAt':null}});}})[_0x4f8e('0x29')](function(_0x3c33b4){if(_0x1e8ebd){var _0x6527c4=[];_0x3c33b4[_0x4f8e('0xf7')](function(_0x447854){_0x6527c4[_0x4f8e('0x4e')](_0x447854['update']({'exitAt':moment()[_0x4f8e('0xa7')](_0x4f8e('0xf8'))}));});return Promise[_0x4f8e('0x5e')](_0x6527c4);}})[_0x4f8e('0x29')](function(){if(_0x1e8ebd){var _0x4b9654=[];var _0x548b83=[];var _0x809020=utils[_0x4f8e('0xf9')]();var _0x6c65fb={'membername':_0x1e8ebd[_0x4f8e('0x3a')],'interface':_0x314d45,'enterAt':moment()[_0x4f8e('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1e8ebd[_0x4f8e('0x39')],'internal':_0x1e8ebd[_0x4f8e('0x69')]};_0x809020[_0x4f8e('0xf7')](function(_0x4a53d4){_0x4b9654[_0x4f8e('0x4e')](_['merge']({'channel':_0x4a53d4,'type':_0x4f8e('0xfa'),'data1':_0x5c7f70[_0x4f8e('0x5f')]['device'],'data2':_0x314d45},_0x6c65fb));if(_0x1e8ebd['loginInPause']){_0x548b83[_0x4f8e('0x4e')](_['merge']({'channel':_0x4a53d4,'type':_0x4f8e('0xfb'),'data1':_0x4f8e('0xfc')},_0x6c65fb));}});return db[_0x4f8e('0xf6')][_0x4f8e('0x88')](_0x4b9654[_0x4f8e('0xc0')](_0x548b83),{'individualHooks':!![]});}})['then'](function(){if(_0x1e8ebd){return _0x1e8ebd[_0x4f8e('0xfd')]({'online':!![],'lastLoginAt':moment()[_0x4f8e('0xa7')](_0x4f8e('0xf8')),'voicePause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'mailPause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'chatPause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'faxPause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'smsPause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'openchannelPause':_0x1e8ebd[_0x4f8e('0x9a')]||![],'whatsappPause':_0x1e8ebd['loginInPause']||![],'pauseType':_0x1e8ebd[_0x4f8e('0x9a')]?'LOGININPAUSE':null,'interface':_0x314d45,'lastPauseAt':moment()['format'](_0x4f8e('0xf8'))});}})[_0x4f8e('0x29')](function(_0x15b113){if(_0x5c7f70['isMiddleware']){return _0x1f5ddb();}else{return Promise['resolve'](_0x15b113)[_0x4f8e('0x29')](respondWithResult(_0x3f2041,null));}})[_0x4f8e('0x28')](handleError(_0x3f2041,null));};exports[_0x4f8e('0xfe')]=function(_0x27f096,_0x57e2b4){var _0x36e1bb;return db['User'][_0x4f8e('0x5a')]({'where':{'id':_0x27f096[_0x4f8e('0x57')]['id'],'role':_0x4f8e('0x31')},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0x39')]})[_0x4f8e('0x29')](handleEntityNotFound(_0x57e2b4,null))['then'](function(_0x22619f){if(_0x22619f){_0x36e1bb=_0x22619f;return db[_0x4f8e('0xaa')][_0x4f8e('0x2c')]({'where':{'membername':_0x36e1bb[_0x4f8e('0x3a')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x4f8e('0x4f')]({'where':{'membername':_0x36e1bb[_0x4f8e('0x3a')],'exitAt':null}});})[_0x4f8e('0x29')](function(_0x4826cc){var _0x3f2f2c=[];_0x4826cc['forEach'](function(_0xc80770){_0x3f2f2c[_0x4f8e('0x4e')](_0xc80770['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x4f8e('0x5e')](_0x3f2f2c);})[_0x4f8e('0x29')](function(){return _0x36e1bb['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x57e2b4,null))[_0x4f8e('0x28')](handleError(_0x57e2b4,null));};exports[_0x4f8e('0xff')]=function(_0x60a69c,_0x515ed8){var _0x1c1b86;return db[_0x4f8e('0xaa')][_0x4f8e('0xfd')]({'paused':0x1},{'where':{'UserId':_0x60a69c['params']['id']},'individualHooks':!![]})[_0x4f8e('0x29')](function(){return db['User'][_0x4f8e('0x5a')]({'where':{'id':_0x60a69c[_0x4f8e('0x57')]['id'],'role':'agent'},'attributes':['id','name',_0x4f8e('0x39'),_0x4f8e('0x69'),_0x4f8e('0x9c'),_0x4f8e('0x99')]});})[_0x4f8e('0x29')](handleEntityNotFound(_0x515ed8,null))['then'](function(_0x4b57b7){if(_0x4b57b7){_0x1c1b86=_0x4b57b7;return respondWithRpcPromise(_0x4f8e('0x100'),'pause',{'id':_0x1c1b86['id'],'name':_0x1c1b86['name'],'pause':!![]});}})[_0x4f8e('0x29')](function(){if(_0x1c1b86){return db['MemberReport'][_0x4f8e('0x4f')]({'where':{'membername':_0x1c1b86[_0x4f8e('0x3a')],'type':_0x4f8e('0xfb'),'exitAt':null}});}})[_0x4f8e('0x29')](function(_0xc85fd7){if(_0xc85fd7[_0x4f8e('0x8a')]){var _0xa32863=moment()[_0x4f8e('0xa7')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x407400=0x0,_0x2c1261=_0xc85fd7[_0x4f8e('0x8a')];_0x407400<_0x2c1261;_0x407400++){_0xc85fd7[_0x407400][_0x4f8e('0x101')]({'exitAt':_0xa32863});}}})['then'](function(){var _0x51da90=[];var _0x42d070=utils[_0x4f8e('0xf9')]();_0x42d070['forEach'](function(_0x11b4ae){_0x51da90[_0x4f8e('0x4e')]({'channel':_0x11b4ae,'membername':_0x1c1b86[_0x4f8e('0x3a')],'interface':_[_0x4f8e('0x67')](_0x1c1b86[_0x4f8e('0x9c')])?util[_0x4f8e('0xa7')](_0x4f8e('0xa8'),_0x1c1b86[_0x4f8e('0x3a')]):_0x1c1b86[_0x4f8e('0x9c')],'type':'PAUSE','enterAt':moment()[_0x4f8e('0xa7')](_0x4f8e('0xf8')),'data1':_0x60a69c['body'][_0x4f8e('0x40')]||_0x4f8e('0x102'),'role':_0x1c1b86[_0x4f8e('0x39')],'internal':_0x1c1b86[_0x4f8e('0x69')]});});return db[_0x4f8e('0xf6')][_0x4f8e('0x88')](_0x51da90,{'individualHooks':!![]});})[_0x4f8e('0x29')](function(){return _0x1c1b86[_0x4f8e('0xfd')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x60a69c[_0x4f8e('0x5f')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x4f8e('0xa7')](_0x4f8e('0xf8'))});})['then'](respondWithResult(_0x515ed8,null))[_0x4f8e('0x28')](handleError(_0x515ed8,null));};exports[_0x4f8e('0x103')]=function(_0x217924,_0x991b7b){if(_0x217924['body'][_0x4f8e('0x98')]&&!utils[_0x4f8e('0x9d')](_0x217924[_0x4f8e('0x5f')][_0x4f8e('0x98')])){throw new APIBadRequestError(util['format'](_0x4f8e('0x104'),_0x217924[_0x4f8e('0x5f')]['channel']));}return db['User'][_0x4f8e('0x5a')]({'where':{'id':_0x217924['params']['id']},'attributes':['id',_0x4f8e('0x3a'),_0x4f8e('0x39'),'internal','interface',_0x4f8e('0x99'),'voicePause',_0x4f8e('0x105'),_0x4f8e('0x106'),_0x4f8e('0x107'),_0x4f8e('0x108'),'smsPause',_0x4f8e('0x109'),_0x4f8e('0x10a'),'lastPauseAt']})[_0x4f8e('0x29')](function(_0x256271){if(!_0x256271){throw new APINotFoundError(util[_0x4f8e('0xa7')](_0x4f8e('0xc3'),_0x217924[_0x4f8e('0x57')]['id']));}return _0x256271[_0x4f8e('0x103')](_0x217924[_0x4f8e('0x5f')][_0x4f8e('0x98')]);})[_0x4f8e('0x29')](respondWithResult(_0x991b7b,null))[_0x4f8e('0x28')](APIHandleError(_0x991b7b));};exports['getTeams']=function(_0x19c9dc,_0x551aee){var _0x5ccfa2={};var _0x33cb7f={};var _0x1d9fee;var _0x1df9b4;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x19c9dc['params']['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0x551aee,null))[_0x4f8e('0x29')](function(_0x526132){if(_0x526132){_0x1d9fee=_0x526132;_0x33cb7f[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db['Team'][_0x4f8e('0x3e')]);_0x33cb7f[_0x4f8e('0x48')]=_[_0x4f8e('0xcb')](_0x19c9dc['query']);_0x33cb7f[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x33cb7f[_0x4f8e('0xcf')],_0x33cb7f[_0x4f8e('0x48')]);_0x5ccfa2[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x33cb7f[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x19c9dc[_0x4f8e('0x48')][_0x4f8e('0xd0')]));_0x5ccfa2[_0x4f8e('0x4d')]=_0x5ccfa2[_0x4f8e('0x4d')]['length']?_0x5ccfa2[_0x4f8e('0x4d')]:_0x33cb7f[_0x4f8e('0xcf')];_0x5ccfa2[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x19c9dc[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x5ccfa2[_0x4f8e('0x46')]=qs['filters'](_['pick'](_0x19c9dc['query'],_0x33cb7f['filters']));if(_0x19c9dc[_0x4f8e('0x48')][_0x4f8e('0x34')]){_0x5ccfa2[_0x4f8e('0x46')]=_['merge'](_0x5ccfa2['where'],{'$or':_[_0x4f8e('0x36')](_0x5ccfa2[_0x4f8e('0x4d')],function(_0x3fd8fd){var _0x564cd6={};_0x564cd6[_0x3fd8fd]={'$like':'%'+_0x19c9dc['query'][_0x4f8e('0x34')]+'%'};return _0x564cd6;})});}_0x5ccfa2=_['merge']({},_0x5ccfa2,_0x19c9dc[_0x4f8e('0x59')]);return _0x1d9fee['getTeams'](_0x5ccfa2);}})['then'](function(_0x626593){if(_0x626593){_0x1df9b4=_0x626593['length'];if(!_0x19c9dc[_0x4f8e('0x48')][_0x4f8e('0xc4')]('nolimit')){_0x5ccfa2[_0x4f8e('0x19')]=qs[_0x4f8e('0x19')](_0x19c9dc['query'][_0x4f8e('0x19')]);_0x5ccfa2['offset']=qs['offset'](_0x19c9dc[_0x4f8e('0x48')][_0x4f8e('0x17')]);}return _0x1d9fee[_0x4f8e('0x10b')](_0x5ccfa2);}})['then'](function(_0xd90d37){if(_0xd90d37){return _0xd90d37?{'count':_0x1df9b4,'rows':_0xd90d37}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x551aee,null))[_0x4f8e('0x28')](handleError(_0x551aee,null));};exports[_0x4f8e('0x10c')]=function(_0x168fcf,_0x117e9e){var _0x5cec72=_0x168fcf['params']['id'];var _0x34934f=_0x168fcf['body']?_0x168fcf[_0x4f8e('0x5f')][_0x4f8e('0x62')]:null;var _0x33cde9=[];return Promise[_0x4f8e('0x10d')]()[_0x4f8e('0x29')](function(){if(!_0x34934f)throw new APIBadRequestError(_0x4f8e('0x10e'));})[_0x4f8e('0x29')](function(){return db[_0x4f8e('0x47')]['findOne']({'where':{'id':_0x5cec72}});})[_0x4f8e('0x29')](function(_0x4e2af9){if(!_0x4e2af9)throw new APINotFoundError(util[_0x4f8e('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x168fcf['params']['id']));return db[_0x4f8e('0x6a')]['transaction'](function(_0x575792){return _0x4e2af9['addTeams'](_0x34934f,{'transaction':_0x575792})['then'](function(){return db[_0x4f8e('0x10f')][_0x4f8e('0x4f')]({'where':{'id':{'$in':_0x34934f}}});})['then'](function(_0x29ee51){var _0x13d2a7=_[_0x4f8e('0x36')](_0x29ee51,function(_0x15a3ee){return _0x15a3ee[_0x4f8e('0x110')]();});return Promise[_0x4f8e('0x5e')](_0x13d2a7);})[_0x4f8e('0x29')](function(_0x366641){_0x33cde9=_[_0x4f8e('0x111')](_0x366641);var _0x301d50=_[_0x4f8e('0x36')](_0x33cde9,function(_0x4e1222){return _0x4e1222[_0x4f8e('0x112')](_0x4e2af9['id'],{'transaction':_0x575792});});return Promise[_0x4f8e('0x5e')](_0x301d50);})[_0x4f8e('0x29')](function(){if(!_0x4e2af9[_0x4f8e('0x99')])return;var _0x571199=_[_0x4f8e('0x34')](_0x33cde9,function(_0x721454){return _0x721454[_0x4f8e('0x113')](_0x4f8e('0x98'))===_0x4f8e('0x114');});var _0x53d836=_[_0x4f8e('0x36')](_0x571199,function(_0x251a23){return db[_0x4f8e('0xaa')]['upsert']({'membername':_0x4e2af9[_0x4f8e('0x3a')],'UserId':_0x4e2af9['id'],'queue_name':_0x251a23[_0x4f8e('0x3a')],'VoiceQueueId':_0x251a23['id'],'interface':_[_0x4f8e('0x67')](_0x4e2af9[_0x4f8e('0x9c')])?util[_0x4f8e('0xa7')](_0x4f8e('0xa8'),_0x4e2af9[_0x4f8e('0x3a')]):_0x4e2af9[_0x4f8e('0x9c')],'paused':_0x4e2af9['voicePause']||![],'penalty':_0x4e2af9['penalty']},{'transaction':_0x575792});});return Promise['all'](_0x53d836);})[_0x4f8e('0x29')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x34934f}}});})[_0x4f8e('0x29')](function(_0x4e1169){var _0x322511=_[_0x4f8e('0x36')](_0x4e1169,function(_0x3ffabe){return db['UserVoicePrefix'][_0x4f8e('0x84')]({'UserId':_0x4e2af9['id'],'VoicePrefixId':_0x3ffabe[_0x4f8e('0x115')]},{'transaction':_0x575792});});return Promise[_0x4f8e('0x5e')](_0x322511);});});})[_0x4f8e('0x29')](function(){for(var _0x122e36=0x0;_0x122e36<_0x33cde9['length'];_0x122e36++){var _0x12fd38=_0x33cde9[_0x122e36]['getDataValue']('channel');var _0x277893=_0x12fd38+_0x4f8e('0xa3');socket[_0x4f8e('0x2a')](_0x4f8e('0x2f')+_0x12fd38+_0x4f8e('0xa4'),{'UserId':_0x5cec72,['queueField']:_0x33cde9[_0x122e36]['id']});}})[_0x4f8e('0x29')](respondWithStatusCode(_0x117e9e,null))[_0x4f8e('0x28')](APIHandleError(_0x117e9e));};exports[_0x4f8e('0x116')]=function(_0x3d4a10,_0xad6e4){var _0x416bb4=_0x3d4a10[_0x4f8e('0x57')]['id'];var _0x377608=null;if(_0x3d4a10[_0x4f8e('0x48')][_0x4f8e('0x62')]){_0x377608=_[_0x4f8e('0x117')](_0x3d4a10[_0x4f8e('0x48')][_0x4f8e('0x62')])?_0x3d4a10[_0x4f8e('0x48')][_0x4f8e('0x62')]:[_0x3d4a10[_0x4f8e('0x48')][_0x4f8e('0x62')]];}var _0x207a9e=[];return Promise['resolve']()[_0x4f8e('0x29')](function(){if(!_0x377608)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x416bb4}});})[_0x4f8e('0x29')](function(_0x41af0e){if(!_0x41af0e)throw new APINotFoundError(util[_0x4f8e('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3d4a10[_0x4f8e('0x57')]['id']));return db[_0x4f8e('0x6a')][_0x4f8e('0x118')](function(_0x3f0cc5){return _0x41af0e[_0x4f8e('0x116')](_0x377608,{'transaction':_0x3f0cc5})[_0x4f8e('0x29')](function(){return db[_0x4f8e('0x10f')]['findAll']({'where':{'id':{'$in':_0x377608}}});})['then'](function(_0x41af15){var _0x2f415c=_[_0x4f8e('0x36')](_0x41af15,function(_0x4adf19){return _0x4adf19['getAssociatedQueues']();});return Promise[_0x4f8e('0x5e')](_0x2f415c);})['then'](function(_0x464b39){_0x207a9e=_[_0x4f8e('0x111')](_0x464b39);var _0x1c847c=_[_0x4f8e('0x36')](_0x207a9e,function(_0xde9c52){return _0xde9c52[_0x4f8e('0x119')](_0x41af0e['id'],{'transaction':_0x3f0cc5});});return Promise['all'](_0x1c847c);})[_0x4f8e('0x29')](function(){if(!_0x41af0e[_0x4f8e('0x99')])return;var _0x22b2f2=_[_0x4f8e('0x34')](_0x207a9e,function(_0x4961c8){return _0x4961c8['getDataValue'](_0x4f8e('0x98'))==='Voice';});var _0x2466c9=_[_0x4f8e('0x36')](_0x22b2f2,function(_0x824676){return db[_0x4f8e('0xaa')]['destroy']({'where':{'VoiceQueueId':_0x824676['id'],'UserId':_0x41af0e['id']},'transaction':_0x3f0cc5});});return Promise['all'](_0x2466c9);})[_0x4f8e('0x29')](function(){return db[_0x4f8e('0x11a')][_0x4f8e('0x4f')]({'where':{'teamId':{'$in':_0x377608}}});})[_0x4f8e('0x29')](function(_0x8a35){var _0x22ca40=_[_0x4f8e('0x36')](_0x8a35,function(_0x5ceffc){return db[_0x4f8e('0x11b')][_0x4f8e('0x2c')]({'where':{'UserId':_0x41af0e['id'],'VoicePrefixId':_0x5ceffc['VoicePrefixId']}},{'transaction':_0x3f0cc5});});return Promise['all'](_0x22ca40);});});})[_0x4f8e('0x29')](function(){for(var _0xf73c90=0x0;_0xf73c90<_0x207a9e[_0x4f8e('0x8a')];_0xf73c90++){var _0x4d259b=_0x207a9e[_0xf73c90][_0x4f8e('0x113')]('channel');var _0x4e928a=_0x4d259b+_0x4f8e('0xa3');socket[_0x4f8e('0x2a')](_0x4f8e('0x2f')+_0x4d259b+'Queue:remove',{'UserId':_0x416bb4,['queueField']:_0x207a9e[_0xf73c90]['id']});}})[_0x4f8e('0x29')](respondWithStatusCode(_0xad6e4,null))[_0x4f8e('0x28')](APIHandleError(_0xad6e4));};exports['getLists']=function(_0x5c9f6d,_0x1a6ebd){var _0x3a1b2e={};var _0x9b4385={};var _0x9d0e12;var _0x5976f8;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x5c9f6d[_0x4f8e('0x57')]['id']}})['then'](handleEntityNotFound(_0x1a6ebd,null))[_0x4f8e('0x29')](function(_0x423a25){if(_0x423a25){_0x9d0e12=_0x423a25;_0x9b4385[_0x4f8e('0xcf')]=_[_0x4f8e('0xcb')](db[_0x4f8e('0x11c')]['rawAttributes']);_0x9b4385['query']=_[_0x4f8e('0xcb')](_0x5c9f6d[_0x4f8e('0x48')]);_0x9b4385[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x9b4385[_0x4f8e('0xcf')],_0x9b4385[_0x4f8e('0x48')]);_0x3a1b2e[_0x4f8e('0x4d')]=_[_0x4f8e('0xce')](_0x9b4385[_0x4f8e('0xcf')],qs[_0x4f8e('0xd0')](_0x5c9f6d['query']['fields']));_0x3a1b2e['attributes']=_0x3a1b2e[_0x4f8e('0x4d')][_0x4f8e('0x8a')]?_0x3a1b2e[_0x4f8e('0x4d')]:_0x9b4385[_0x4f8e('0xcf')];_0x3a1b2e[_0x4f8e('0xd1')]=qs[_0x4f8e('0xd2')](_0x5c9f6d[_0x4f8e('0x48')][_0x4f8e('0xd2')]);_0x3a1b2e['where']=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x5c9f6d[_0x4f8e('0x48')],_0x9b4385[_0x4f8e('0xcd')]));if(_0x5c9f6d[_0x4f8e('0x48')]['filter']){_0x3a1b2e[_0x4f8e('0x46')]=_['merge'](_0x3a1b2e[_0x4f8e('0x46')],{'$or':_['map'](_0x3a1b2e[_0x4f8e('0x4d')],function(_0xe6f5c5){var _0x53d5ac={};_0x53d5ac[_0xe6f5c5]={'$like':'%'+_0x5c9f6d[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x53d5ac;})});}_0x3a1b2e=_[_0x4f8e('0x58')]({},_0x3a1b2e,_0x5c9f6d[_0x4f8e('0x59')]);return _0x9d0e12[_0x4f8e('0x11d')](_0x3a1b2e);}})[_0x4f8e('0x29')](function(_0xf13b60){if(_0xf13b60){_0x5976f8=_0xf13b60['length'];if(!_0x5c9f6d[_0x4f8e('0x48')][_0x4f8e('0xc4')]('nolimit')){_0x3a1b2e['limit']=qs[_0x4f8e('0x19')](_0x5c9f6d['query'][_0x4f8e('0x19')]);_0x3a1b2e['offset']=qs[_0x4f8e('0x17')](_0x5c9f6d[_0x4f8e('0x48')][_0x4f8e('0x17')]);}return _0x9d0e12[_0x4f8e('0x11d')](_0x3a1b2e);}})[_0x4f8e('0x29')](function(_0x5cc9f1){if(_0x5cc9f1){return _0x5cc9f1?{'count':_0x5976f8,'rows':_0x5cc9f1}:null;}})[_0x4f8e('0x29')](respondWithResult(_0x1a6ebd,null))['catch'](handleError(_0x1a6ebd,null));};exports['getAgents']=function(_0x502dec,_0xe6d43c){var _0x6e584c={};var _0x334fd4={};var _0x5c4ca9;return db[_0x4f8e('0x47')][_0x4f8e('0xc2')]({'where':{'id':_0x502dec['params']['id']}})[_0x4f8e('0x29')](handleEntityNotFound(_0xe6d43c,null))[_0x4f8e('0x29')](function(_0x5b9eee){if(_0x5b9eee){_0x5c4ca9=_0x5b9eee;_0x334fd4['model']=_[_0x4f8e('0xcb')](db[_0x4f8e('0x47')][_0x4f8e('0x3e')]);_0x334fd4['query']=_[_0x4f8e('0xcb')](_0x502dec[_0x4f8e('0x48')]);_0x334fd4[_0x4f8e('0xcd')]=_[_0x4f8e('0xce')](_0x334fd4['model'],_0x334fd4[_0x4f8e('0x48')]);_0x6e584c[_0x4f8e('0x4d')]=_['intersection'](_0x334fd4['model'],qs['fields'](_0x502dec[_0x4f8e('0x48')]['fields']));_0x6e584c[_0x4f8e('0x4d')]=_0x6e584c['attributes'][_0x4f8e('0x8a')]?_0x6e584c[_0x4f8e('0x4d')]:_0x334fd4[_0x4f8e('0xcf')];_0x6e584c[_0x4f8e('0xd1')]=qs['sort'](_0x502dec[_0x4f8e('0x48')]['sort']);_0x6e584c['where']=qs[_0x4f8e('0xcd')](_[_0x4f8e('0xd4')](_0x502dec[_0x4f8e('0x48')],_0x334fd4[_0x4f8e('0xcd')]));if(_0x502dec[_0x4f8e('0x48')]['filter']){_0x6e584c[_0x4f8e('0x46')]=_[_0x4f8e('0x58')](_0x6e584c[_0x4f8e('0x46')],{'$or':_[_0x4f8e('0x36')](_0x6e584c['attributes'],function(_0x14e71b){var _0x2e41e5={};_0x2e41e5[_0x14e71b]={'$like':'%'+_0x502dec[_0x4f8e('0x48')][_0x4f8e('0x34')]+'%'};return _0x2e41e5;})});}_0x6e584c[_0x4f8e('0xcf')]=db[_0x4f8e('0x47')];_0x6e584c['as']='Agents';_0x6e584c=_['merge']({},_0x6e584c,_0x502dec[_0x4f8e('0x59')]);return _0x5c4ca9[_0x4f8e('0xf3')]({'include':[_0x6e584c]});}})[_0x4f8e('0x29')](function(_0x2c883b){if(_0x2c883b){var _0x501f25={},_0x126efa=[];for(var _0x4c8909=0x0;_0x4c8909<_0x2c883b[_0x4f8e('0x8a')];_0x4c8909+=0x1){for(var _0x2ac737=0x0,_0x156eb2;_0x2ac737<_0x2c883b[_0x4c8909][_0x4f8e('0x30')][_0x4f8e('0x8a')];_0x2ac737+=0x1){_0x156eb2=_0x2c883b[_0x4c8909]['Agents'][_0x2ac737]['get']({'plain':!![]});_0x501f25[_0x156eb2['id']]=_0x156eb2;}}_0x501f25=_[_0x4f8e('0x11e')](_0x501f25);for(var _0x2d373b=qs[_0x4f8e('0x17')](_0x502dec[_0x4f8e('0x48')]['offset']);_0x2d373b<_0x501f25[_0x4f8e('0x8a')]&&_0x126efa[_0x4f8e('0x8a')]=_0x1a28b8){_0x2e76fa=_0x1a28b8;_0x2f3747=0xc8;}else{_0x2f3747=0xce;}_0x225729[_0x479a('0x18')](_0x2f3747);return _0x225729[_0x479a('0x1e')](_0x479a('0x1f'),_0x44e596+'-'+_0x2e76fa+'/'+_0x1a28b8)[_0x479a('0x20')](_0x43e8c9);}return null;};}function respondWithRpcPromise(_0xc0dc2a,_0x37187f,_0x57c7ef,_0x1a5d71){return new Promise(function(_0x2f4133,_0x4edcfa){var _0x1ff53c=_0x1a5d71||amiClient;return _0x1ff53c[_0x479a('0x21')](_0xc0dc2a,_0x57c7ef)[_0x479a('0x22')](function(_0x5984ec){logger[_0x479a('0x23')](_0x479a('0x24'),_0x37187f,_0x479a('0x25'));logger[_0x479a('0x26')](_0x479a('0x27'),_0x37187f,'request\x20sent',JSON['stringify'](_0x5984ec));if(_0x5984ec[_0x479a('0x28')]){if(_0x5984ec[_0x479a('0x28')][_0x479a('0x29')]===0x1f4){logger[_0x479a('0x28')](_0x479a('0x24'),_0x37187f,_0x5984ec[_0x479a('0x28')][_0x479a('0x2a')]);return _0x4edcfa(_0x5984ec[_0x479a('0x28')]['message']);}logger[_0x479a('0x28')](_0x479a('0x24'),_0x37187f,_0x5984ec['error'][_0x479a('0x2a')]);return _0x2f4133(_0x5984ec[_0x479a('0x28')][_0x479a('0x2a')]);}else{logger['info'](_0x479a('0x24'),_0x37187f,'request\x20sent');_0x2f4133(_0x5984ec['result'][_0x479a('0x2a')]);}})['catch'](function(_0x5cc49){logger[_0x479a('0x28')]('User,\x20%s,\x20%s',_0x37187f,_0x5cc49);_0x4edcfa(_0x5cc49);});});}function saveUpdates(_0x1856ad){return function(_0x197d69){if(_0x197d69){return _0x197d69[_0x479a('0x2b')](_0x1856ad)[_0x479a('0x22')](function(_0x38cc17){if(_0x38cc17[_0x479a('0x2c')]===_0x479a('0x2d')){socket[_0x479a('0x2e')]('userNotification:recalc:'+_0x38cc17['id'],_0x38cc17);}return _0x38cc17;});}return null;};}function removeEntity(_0x9198a1,_0x134233){return function(_0x5140e6){if(_0x5140e6){return _0x5140e6['destroy']({'transaction':_0x134233})[_0x479a('0x22')](function(){var _0x58abc4=_0x5140e6[_0x479a('0x2f')]({'plain':!![]});if(_0x58abc4['role']===_0x479a('0x30'))return;var _0x1ab18f=[{'name':'Users','value':_0x479a('0x31'),'ignore':!![]},{'name':'Agents','value':_0x479a('0x2d'),'ignore':![]},{'name':_0x479a('0x32'),'value':_0x479a('0x33'),'ignore':![]}];var _0x5ab7fd=_(_0x1ab18f)['filter'](_0x479a('0x34'))[_0x479a('0x35')](_0x479a('0x36'))['value']();if(_[_0x479a('0x37')](_0x5ab7fd,_0x58abc4['role'])){return;}var _0x227d73=_[_0x479a('0x38')](_0x1ab18f,[_0x479a('0x36'),_0x58abc4['role']])['name'];return db[_0x479a('0x39')]['destroy']({'where':{'type':_0x227d73,'resourceId':_0x58abc4['id']},'transaction':_0x134233})[_0x479a('0x22')](function(){return _0x5140e6;});})[_0x479a('0x22')](function(){_0x9198a1[_0x479a('0x18')](0xcc)[_0x479a('0x19')]();});}};}function handleEntityNotFound(_0x9db73d){return function(_0x36fdb7){if(!_0x36fdb7){_0x9db73d[_0x479a('0x17')](0x194);}return _0x36fdb7;};}function handleError(_0x937541,_0x2e0cee){_0x2e0cee=_0x2e0cee||0x1f4;return function(_0x2a22cd){logger['error'](_0x2a22cd[_0x479a('0x3a')]);if(_0x2a22cd[_0x479a('0x3b')]){delete _0x2a22cd['name'];}_0x937541['status'](_0x2e0cee)[_0x479a('0x3c')](_0x2a22cd);};}function getUserAttributes(){return _(db[_0x479a('0x3d')][_0x479a('0x3e')])[_0x479a('0x35')](function(_0x1f80a2){return{'name':_0x1f80a2[_0x479a('0x3f')],'type':_0x1f80a2[_0x479a('0x40')]['key']};})['filter'](function(_0x14732c){return![_0x479a('0x41'),'salt',_0x479a('0x42'),_0x479a('0x43'),_0x479a('0x44'),'md5secret'][_0x479a('0x37')](_0x14732c['name']);})[_0x479a('0x36')]();}exports[_0x479a('0x45')]=function(_0x55fa6d,_0x540a87){var _0x2c263d={},_0xeebef4={'count':0x0,'rows':[]};var _0x5b71f9=getUserAttributes();_0x2c263d=qs[_0x479a('0x46')](_0x5b71f9,_0x55fa6d);var _0x2ec29={'where':_0x2c263d[_0x479a('0x47')]};return db[_0x479a('0x3d')][_0x479a('0x1d')](_0x2ec29)[_0x479a('0x22')](function(_0x4819f3){_0xeebef4['count']=_0x4819f3;if(_0x55fa6d[_0x479a('0x48')][_0x479a('0x49')]){_0x2c263d[_0x479a('0x4a')]=[{'all':!![]}];}if(_0x55fa6d['query'][_0x479a('0x4b')]===_0x479a('0x4c')){_0x2c263d[_0x479a('0x4a')]=[{'model':db[_0x479a('0x4d')],'as':'userSetting'}];}if(!_[_0x479a('0x37')](_0x2c263d[_0x479a('0x4e')],'id')){_0x2c263d[_0x479a('0x4e')][_0x479a('0x4f')]('id');}return db[_0x479a('0x3d')][_0x479a('0x50')](_0x2c263d);})[_0x479a('0x22')](function(_0x2867a1){_0xeebef4[_0x479a('0x51')]=_0x2867a1;if(_0x55fa6d['query'][_0x479a('0x52')]===_0x479a('0x4c')){var _0x5092f=[];for(var _0x36638d=0x0;_0x36638d<_0xeebef4[_0x479a('0x51')][_0x479a('0x53')];_0x36638d++){_0x5092f[_0x479a('0x4f')](get_open_tabs(_0x479a('0x54'),_0xeebef4[_0x479a('0x51')][_0x36638d][_0x479a('0x55')]));_0x5092f[_0x479a('0x4f')](get_open_tabs(_0x479a('0x56'),_0xeebef4[_0x479a('0x51')][_0x36638d][_0x479a('0x55')]));_0x5092f[_0x479a('0x4f')](get_open_tabs(_0x479a('0x57'),_0xeebef4['rows'][_0x36638d][_0x479a('0x55')]));_0x5092f['push'](get_open_tabs('mail',_0xeebef4[_0x479a('0x51')][_0x36638d][_0x479a('0x55')]));_0x5092f[_0x479a('0x4f')](get_open_tabs(_0x479a('0x58'),_0xeebef4[_0x479a('0x51')][_0x36638d][_0x479a('0x55')]));_0x5092f[_0x479a('0x4f')](get_open_tabs('whatsapp',_0xeebef4[_0x479a('0x51')][_0x36638d]['dataValues']));}return Promise[_0x479a('0x59')](_0x5092f)[_0x479a('0x22')](function(){return _0xeebef4;});}else{return _0xeebef4;}})[_0x479a('0x22')](respondWithFilteredResult(_0x540a87,_0x2c263d))[_0x479a('0x5a')](handleError(_0x540a87,null));};exports[_0x479a('0x5b')]=function(_0x4b3066,_0x159670){var _0x56b250=getUserAttributes();_0x4b3066[_0x479a('0x48')]['id']=_0x4b3066[_0x479a('0x5c')]['id'];var _0x56f6bb=qs['getOptions'](_0x56b250,_0x4b3066);if(_0x4b3066[_0x479a('0x48')][_0x479a('0x49')]){_0x56f6bb[_0x479a('0x4a')]=[{'all':!![]}];}if(_0x4b3066['query'][_0x479a('0x4b')]===_0x479a('0x4c')){_0x56f6bb['include']=[{'model':db[_0x479a('0x4d')],'as':_0x479a('0x4b')}];}_0x56f6bb=_[_0x479a('0x5d')]({},_0x56f6bb,_0x4b3066[_0x479a('0x5e')]);if(!_[_0x479a('0x37')](_0x56f6bb[_0x479a('0x4e')],'id')){_0x56f6bb[_0x479a('0x4e')]['push']('id');}return db['User']['find'](_0x56f6bb)[_0x479a('0x22')](handleEntityNotFound(_0x159670,null))[_0x479a('0x22')](function(_0x207c11){var _0x45ea5a=[];values=_0x207c11;if(_0x4b3066[_0x479a('0x48')][_0x479a('0x52')]==='true'){_0x45ea5a[_0x479a('0x4f')](get_open_tabs(_0x479a('0x54'),_0x207c11[_0x479a('0x55')]));_0x45ea5a['push'](get_open_tabs(_0x479a('0x56'),_0x207c11['dataValues']));_0x45ea5a[_0x479a('0x4f')](get_open_tabs(_0x479a('0x58'),_0x207c11['dataValues']));_0x45ea5a[_0x479a('0x4f')](get_open_tabs(_0x479a('0x5f'),_0x207c11[_0x479a('0x55')]));_0x45ea5a[_0x479a('0x4f')](get_open_tabs(_0x479a('0x57'),_0x207c11[_0x479a('0x55')]));_0x45ea5a['push'](get_open_tabs(_0x479a('0x60'),_0x207c11['dataValues']));return Promise['all'](_0x45ea5a);}else{return values;}})[_0x479a('0x22')](function(){return values;})[_0x479a('0x22')](respondWithResult(_0x159670,null))[_0x479a('0x5a')](handleError(_0x159670,null));};exports[_0x479a('0x2b')]=function(_0x3ead67,_0x6a4302){if(_0x3ead67[_0x479a('0x61')]['id']){delete _0x3ead67[_0x479a('0x61')]['id'];}delete _0x3ead67[_0x479a('0x61')][_0x479a('0x2c')];return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x3ead67[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x6a4302,null))[_0x479a('0x22')](saveUpdates(_0x3ead67[_0x479a('0x61')],null))[_0x479a('0x22')](respondWithResult(_0x6a4302,null))['catch'](handleError(_0x6a4302,null));};exports[_0x479a('0x62')]=function(_0x33cc4f,_0x1ef9fb){return db[_0x479a('0x3d')][_0x479a('0x62')]()[_0x479a('0x22')](respondWithResult(_0x1ef9fb,null))['catch'](handleError(_0x1ef9fb,null));};exports[_0x479a('0x63')]=function(_0x59a2ee,_0x20e2f7){return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x59a2ee['params']['id']}})['then'](handleEntityNotFound(_0x20e2f7,null))[_0x479a('0x22')](function(_0x4bfa6e){if(_0x4bfa6e){return _0x4bfa6e[_0x479a('0x63')](_0x59a2ee[_0x479a('0x61')][_0x479a('0x64')],_[_0x479a('0x65')](_0x59a2ee[_0x479a('0x61')],[_0x479a('0x64'),'id'])||{});}})[_0x479a('0x22')](respondWithResult(_0x20e2f7,null))[_0x479a('0x5a')](handleError(_0x20e2f7,null));};function validateUser(_0x22b1bf){return new Promise(function(_0x2fdd93,_0x797710){if(_0x22b1bf[_0x479a('0x66')])return _0x2fdd93(_0x22b1bf);return db[_0x479a('0x67')][_0x479a('0x68')](0x1)['then'](function(_0x58946f){if(_0x58946f[_0x479a('0x69')])authService[_0x479a('0x6a')](_0x22b1bf['password']);db[_0x479a('0x3d')]['max'](_0x479a('0x66'))[_0x479a('0x22')](function(_0x5e7e0f){if(_[_0x479a('0x6b')](_0x5e7e0f)){_0x22b1bf[_0x479a('0x66')]=_0x58946f[_0x479a('0x6c')]||0x1;return;}if(_[_0x479a('0x6b')](_0x58946f['min_internal'])||_0x58946f[_0x479a('0x6c')]===_0x5e7e0f){_0x22b1bf[_0x479a('0x66')]=_0x5e7e0f+0x1;return;}if(_0x58946f[_0x479a('0x6c')]>_0x5e7e0f){_0x22b1bf[_0x479a('0x66')]=_0x58946f[_0x479a('0x6c')];return;}return db[_0x479a('0x6d')]['query'](_0x479a('0x6e'),{'type':db[_0x479a('0x6d')][_0x479a('0x6f')]['SELECT']})[_0x479a('0x22')](function(_0x477fb9){if(_0x477fb9&&_0x477fb9[_0x479a('0x53')]){for(var _0x411e09=0x0,_0x17a889=_0x477fb9['length'];_0x411e09<_0x17a889&&_[_0x479a('0x6b')](_0x22b1bf[_0x479a('0x66')]);_0x411e09++){if(_0x58946f[_0x479a('0x6c')]<=_0x477fb9[_0x411e09][_0x479a('0x70')]){_0x22b1bf['internal']=_0x477fb9[_0x411e09][_0x479a('0x70')];}else if(_0x58946f[_0x479a('0x6c')]>_0x477fb9[_0x411e09][_0x479a('0x70')]&&_0x58946f['min_internal']<=_0x477fb9[_0x411e09]['to']){_0x22b1bf[_0x479a('0x66')]=_0x58946f[_0x479a('0x6c')];}}}if(_['isNil'](_0x22b1bf[_0x479a('0x66')])){_0x22b1bf[_0x479a('0x66')]=_0x5e7e0f+0x1;}return _0x2fdd93(_0x22b1bf);});});})[_0x479a('0x5a')](function(_0x13eb9a){_0x797710(_0x13eb9a);});});}function updateUser(_0x1dc0bf){return new Promise(function(_0x453294,_0x31dbbb){try{if(_0x1dc0bf[_0x479a('0x71')]){_0x1dc0bf[_0x479a('0x72')]=_0x1dc0bf[_0x479a('0x66')];_0x1dc0bf[_0x479a('0x73')]={'mailbox':_0x1dc0bf['internal'],'password':_0x1dc0bf['password'],'fullname':_0x1dc0bf[_0x479a('0x74')],'email':_0x1dc0bf[_0x479a('0x75')]};}if(_0x1dc0bf[_0x479a('0x2c')]===_0x479a('0x2d')){if(!_0x1dc0bf[_0x479a('0x76')])_0x1dc0bf[_0x479a('0x76')]=[_0x479a('0x77'),_0x479a('0x78'),'103',_0x479a('0x79'),_0x479a('0x7a'),_0x479a('0x7b'),_0x479a('0x7c'),_0x479a('0x7d'),_0x479a('0x7e'),_0x479a('0x7f'),_0x479a('0x80'),'100',_0x479a('0x81'),_0x479a('0x82'),_0x479a('0x83')];}_0x453294(_0x1dc0bf);}catch(_0x5888e8){_0x31dbbb(_0x5888e8);}});}exports[_0x479a('0x84')]=function(_0x2c237d,_0x4d494e){if(_0x2c237d[_0x479a('0x31')][_0x479a('0x2c')]===_0x479a('0x2d'))throw new Error(_0x479a('0x85'));if(_0x2c237d[_0x479a('0x61')]['role']===_0x479a('0x31')&&_0x2c237d['user']['role']!==_0x479a('0x30')){throw new Error(_0x479a('0x86'));}if(_0x2c237d[_0x479a('0x61')]['role']==='admin'&&_0x2c237d[_0x479a('0x31')][_0x479a('0x2c')]!==_0x479a('0x30')){throw new Error(_0x479a('0x87'));}return licenseUtil[_0x479a('0x88')]([_0x2c237d[_0x479a('0x61')]])[_0x479a('0x22')](function(){return validateUser(_0x2c237d[_0x479a('0x61')]);})[_0x479a('0x22')](function(_0x30cbf1){return updateUser(_0x30cbf1)[_0x479a('0x22')](function(_0x8b43ca){if(_0x8b43ca['role']===_0x479a('0x30')){_0x8b43ca[_0x479a('0x89')]=_0x2c237d['user']['settingsEnabled'];delete _0x8b43ca[_0x479a('0x8a')];}return _0x8b43ca;});})['then'](function(_0x262abe){return db[_0x479a('0x3d')]['create'](_0x262abe,{'include':[{'model':db[_0x479a('0x73')],'as':_0x479a('0x73')}]});})['then'](function(_0x587f17){if(_0x2c237d['body'][_0x479a('0x2c')]==='user')return _0x587f17;if(_0x2c237d['user'][_0x479a('0x2c')]!=='user')return _0x587f17;return db[_0x479a('0x8b')][_0x479a('0x38')]({'where':{'name':_0x587f17[_0x479a('0x2c')]===_0x479a('0x2d')?_0x479a('0x8c'):_0x479a('0x32'),'userProfileId':_0x2c237d[_0x479a('0x31')][_0x479a('0x8a')]},'raw':!![]})[_0x479a('0x22')](function(_0x480978){if(!_0x480978||_0x480978['autoAssociation']!=0x0)return _0x587f17;return db[_0x479a('0x39')]['create']({'name':_0x587f17[_0x479a('0x3b')],'resourceId':_0x587f17['id'],'type':_0x480978[_0x479a('0x3b')],'sectionId':_0x480978['id']},{})[_0x479a('0x22')](function(){return _0x587f17;});})[_0x479a('0x5a')](function(_0x533f4f){logger[_0x479a('0x28')](_0x479a('0x8d'),_0x533f4f);throw _0x533f4f;});})[_0x479a('0x22')](respondWithResult(_0x4d494e,0xc9))[_0x479a('0x5a')](handleError(_0x4d494e,null));};exports['bulkCreate']=function(_0x184449,_0x5221d4){var _0x460269=_0x184449['body'];var _0x504f13=[];if(_0x184449[_0x479a('0x31')][_0x479a('0x2c')]===_0x479a('0x2d'))throw new Error(_0x479a('0x85'));if(_[_0x479a('0x8e')](_0x460269,[_0x479a('0x2c'),_0x479a('0x31')])&&_0x184449[_0x479a('0x31')]['role']!==_0x479a('0x30')){throw new Error(_0x479a('0x86'));}if(_[_0x479a('0x8e')](_0x460269,[_0x479a('0x2c'),'admin'])&&_0x184449[_0x479a('0x31')]['role']!==_0x479a('0x30')){throw new Error(_0x479a('0x8f'));}return licenseUtil[_0x479a('0x88')](_0x460269)[_0x479a('0x22')](function(){return validateUser(_0x460269[0x0]);})[_0x479a('0x22')](function(){for(var _0x448a0f=0x1;_0x448a0f<_0x460269[_0x479a('0x53')];_0x448a0f++){var _0x20297e=_0x460269[_0x448a0f-0x1][_0x479a('0x66')];if(!_0x460269[_0x448a0f]['internal'])_0x460269[_0x448a0f][_0x479a('0x66')]=_0x20297e+0x1;_0x504f13['push'](validateUser(_0x460269[_0x448a0f]));}return Promise[_0x479a('0x59')](_0x504f13);})[_0x479a('0x22')](function(){_0x504f13=[];for(var _0x5b3b70=0x0;_0x5b3b70<_0x460269[_0x479a('0x53')];_0x5b3b70++){_0x504f13['push'](updateUser(_0x460269[_0x5b3b70]));}return Promise[_0x479a('0x59')](_0x504f13);})[_0x479a('0x22')](function(){_0x504f13=_0x460269['map'](function(_0x5f3772){return db['User'][_0x479a('0x84')](_0x5f3772,{'include':[{'model':db[_0x479a('0x73')],'as':_0x479a('0x73')}]})[_0x479a('0x22')](function(_0x99f421){_0x5f3772['id']=_0x99f421['id'];return _0x5f3772;});});return Promise['all'](_0x504f13);})[_0x479a('0x22')](function(_0x3188c2){if(_0x184449[_0x479a('0x61')][_0x479a('0x2c')]===_0x479a('0x31'))return _0x3188c2;if(_0x184449['user'][_0x479a('0x2c')]!==_0x479a('0x31'))return _0x3188c2;var _0x5e7396=_['some'](_0x3188c2,function(_0x9f0da9){return _0x9f0da9[_0x479a('0x2c')]===_0x479a('0x2d')||_0x9f0da9[_0x479a('0x2c')]===_0x479a('0x33');});if(!_0x5e7396)return _0x3188c2;return db[_0x479a('0x8b')][_0x479a('0x50')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x184449[_0x479a('0x31')][_0x479a('0x8a')]},'raw':!![]})[_0x479a('0x22')](function(_0x1c214a){if(_[_0x479a('0x90')](_0x1c214a)||!_['some'](_0x1c214a,[_0x479a('0x91'),0x0]))return _0x3188c2;_0x504f13=[];var _0x227339=_(_0x1c214a)[_0x479a('0x35')](function(_0x315e7b){if(_0x315e7b[_0x479a('0x91')]===0x1)return;return _0x315e7b[_0x479a('0x3b')]===_0x479a('0x8c')?_0x479a('0x2d'):'telephone';})[_0x479a('0x92')]()[_0x479a('0x36')]();for(var _0x1664ea=0x0;_0x1664ea<_0x3188c2['length'];_0x1664ea++){if(!_[_0x479a('0x37')](_0x227339,_0x3188c2[_0x1664ea][_0x479a('0x2c')]))return;var _0x1280fd=_0x3188c2[_0x1664ea][_0x479a('0x2c')]===_0x479a('0x2d')?'Agents':_0x479a('0x32');_0x504f13['push'](db[_0x479a('0x39')][_0x479a('0x84')]({'name':_0x3188c2[_0x1664ea][_0x479a('0x3b')],'resourceId':_0x3188c2[_0x1664ea]['id'],'type':_0x1280fd,'sectionId':_[_0x479a('0x38')](_0x1c214a,[_0x479a('0x3b'),_0x1280fd])['id']},{}));}return Promise['all'](_0x504f13);});})[_0x479a('0x22')](respondWithResult(_0x5221d4,0xc9))[_0x479a('0x5a')](handleError(_0x5221d4,null));};exports[_0x479a('0x93')]=function(_0x328f47,_0x2e9236){if(_0x328f47[_0x479a('0x61')]['id']){delete _0x328f47[_0x479a('0x61')]['id'];}return db['User'][_0x479a('0x38')]({'where':{'id':_0x328f47['params']['id']}})[_0x479a('0x22')](function(_0x2e26ac){if(!_0x2e26ac)return null;if(_0x2e26ac['id']===_0x328f47[_0x479a('0x31')]['id']){if(!_0x328f47[_0x479a('0x61')][_0x479a('0x94')]||!_0x328f47[_0x479a('0x61')][_0x479a('0x95')]){throw new db['Sequelize'][(_0x479a('0x96'))](_0x479a('0x97'));}if(!_0x2e26ac[_0x479a('0x98')](_0x328f47[_0x479a('0x61')][_0x479a('0x94')])){throw new db['Sequelize'][(_0x479a('0x96'))](_0x479a('0x99'));}if(_0x328f47[_0x479a('0x61')][_0x479a('0x94')]===_0x328f47[_0x479a('0x61')][_0x479a('0x95')]){throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))](_0x479a('0x9b'));}}else if(_0x328f47[_0x479a('0x31')][_0x479a('0x2c')]===_0x479a('0x30')){if(!_0x328f47[_0x479a('0x61')][_0x479a('0x95')]){throw new db['Sequelize'][(_0x479a('0x96'))](_0x479a('0x9c'));}}else if(_0x328f47[_0x479a('0x31')]['role']===_0x479a('0x31')){if(!_0x328f47[_0x479a('0x61')][_0x479a('0x95')]){throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))](_0x479a('0x9c'));}if(_0x2e26ac[_0x479a('0x2c')]!==_0x479a('0x2d')){throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))]('Unauthorized');}}else{throw new db[(_0x479a('0x9a'))]['ValidationError'](_0x479a('0x85'));}return _0x2e26ac;})[_0x479a('0x22')](handleEntityNotFound(_0x2e9236,null))['then'](function(_0x22e454){return db['Setting'][_0x479a('0x9d')]({'attributes':['id',_0x479a('0x69'),_0x479a('0x9e'),_0x479a('0x9f')]})[_0x479a('0x22')](function(_0x34bc29){if(_0x34bc29['securePassword'])authService[_0x479a('0x6a')](_0x328f47[_0x479a('0x61')][_0x479a('0x95')]);if(!_0x34bc29[_0x479a('0x9e')]||!_0x22e454['previousPasswords'])return _0x22e454;authService[_0x479a('0xa0')](_0x328f47['body'][_0x479a('0x95')],_0x22e454[_0x479a('0x42')],_0x34bc29[_0x479a('0x9f')]);return _0x22e454;})[_0x479a('0x22')](saveUpdates({'password':_0x328f47[_0x479a('0x61')][_0x479a('0x95')],'passwordResetAt':_0x328f47['user']['id']==_0x328f47[_0x479a('0x5c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x328f47['body']['newPassword'],_0x22e454[_0x479a('0x42')])},null));})['then'](respondWithResult(_0x2e9236,null))['catch'](handleError(_0x2e9236,null));};exports[_0x479a('0xa1')]=function(_0x402108,_0x2182b3){var _0x4afd58=_0x402108[_0x479a('0x61')][_0x479a('0xa2')];return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x402108[_0x479a('0x5c')]['id']},'attributes':['id',_0x479a('0x3b'),_0x479a('0x2c'),_0x479a('0xa3'),_0x479a('0xa4'),'voicePause',_0x479a('0xa5')]})['then'](handleEntityNotFound(_0x2182b3,null))[_0x479a('0x22')](function(_0x228a51){if(_0x228a51){if(!utils[_0x479a('0xa6')](_0x4afd58)){throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))](_0x479a('0xa7'));}return _0x228a51[_0x479a('0xa8')+_['capitalize'](_0x4afd58['toLowerCase']())+_0x479a('0xa9')](_0x402108[_0x479a('0x61')][_0x479a('0x64')],{'penalty':_0x402108['body']['penalty']||0x0})[_0x479a('0xaa')](function(_0x37a1dc){for(var _0xb774fd=0x0;_0xb774fd<_0x402108['body']['ids'][_0x479a('0x53')];_0xb774fd+=0x1){var _0x4196dd={'UserId':Number(_0x402108['params']['id'])};_0x4196dd[_['capitalize'](_0x4afd58['toLowerCase']())+'QueueId']=Number(_0x402108[_0x479a('0x61')][_0x479a('0x64')][_0xb774fd]);socket[_0x479a('0x2e')](_0x479a('0x31')+_['capitalize'](_0x4afd58[_0x479a('0xab')]())+_0x479a('0xac'),_0x4196dd);}return _0x37a1dc;})[_0x479a('0x22')](function(){if(_0x4afd58===_0x479a('0xad')){return db['VoiceQueue'][_0x479a('0x50')]({'where':{'id':_0x402108['body'][_0x479a('0x64')]||[]},'raw':!![],'attributes':['id',_0x479a('0x3b')]});}})[_0x479a('0x22')](function(_0x267c95){var _0x108848=_0x228a51[_0x479a('0x2f')]({'plain':!![]});var _0x2abd8f=[];if(_0x4afd58===_0x479a('0xad')&&_0x108848[_0x479a('0x2c')]==='agent'&&_0x108848[_0x479a('0xa3')]){for(let _0x151c39=0x0;_0x151c39<_0x267c95[_0x479a('0x53')];_0x151c39+=0x1){_0x2abd8f[_0x479a('0x4f')]({'membername':_0x108848[_0x479a('0x3b')],'UserId':_0x108848['id'],'queue_name':_0x267c95[_0x151c39]['name'],'VoiceQueueId':_0x267c95[_0x151c39]['id'],'interface':_['isNil'](_0x108848[_0x479a('0xa5')])?util[_0x479a('0xae')](_0x479a('0xaf'),_0x108848[_0x479a('0x3b')]):_0x108848[_0x479a('0xa5')],'paused':_0x108848[_0x479a('0xb0')]||![],'penalty':_0x402108[_0x479a('0x61')][_0x479a('0xb1')]||0x0});}return Promise[_0x479a('0x59')](_0x2abd8f[_0x479a('0x35')](function(_0x55812f){return db['UserVoiceQueueRt'][_0x479a('0xb2')](_0x55812f);}));}return _0x228a51;});}})[_0x479a('0x22')](respondWithStatusCode(_0x2182b3,null))['catch'](handleError(_0x2182b3,null));};exports[_0x479a('0xb3')]=function(_0x2a4c3e,_0x45c1e3){var _0x4f0f1a,_0x32512e;return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x2a4c3e[_0x479a('0x5c')]['id']},'attributes':['id',_0x479a('0x3b'),_0x479a('0x2c')]})[_0x479a('0x22')](handleEntityNotFound(_0x45c1e3,null))[_0x479a('0x22')](function(_0x32f354){if(_0x32f354){_0x4f0f1a=_0x32f354;if(!_0x2a4c3e[_0x479a('0x48')][_0x479a('0xa2')]||!utils[_0x479a('0xa6')](_0x2a4c3e[_0x479a('0x48')][_0x479a('0xa2')])){throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))](_0x479a('0xa7'));}return _0x32f354[_0x479a('0xb4')+_[_0x479a('0xb5')](_0x2a4c3e[_0x479a('0x48')][_0x479a('0xa2')][_0x479a('0xab')]())+_0x479a('0xa9')](_0x2a4c3e[_0x479a('0x48')]['ids']);}})[_0x479a('0x22')](function(_0x1362e2){if(_[_0x479a('0xb6')](_0x2a4c3e[_0x479a('0x48')][_0x479a('0x64')])){for(var _0x2a33f8=0x0;_0x2a33f8<_0x2a4c3e[_0x479a('0x48')][_0x479a('0x64')][_0x479a('0x53')];_0x2a33f8+=0x1){_0x32512e={'UserId':Number(_0x2a4c3e['params']['id'])};_0x32512e[_[_0x479a('0xb5')](_0x2a4c3e['query'][_0x479a('0xa2')]['toLowerCase']())+_0x479a('0xb7')]=Number(_0x2a4c3e[_0x479a('0x48')][_0x479a('0x64')][_0x2a33f8]);socket['emit'](_0x479a('0x31')+_[_0x479a('0xb5')](_0x2a4c3e[_0x479a('0x48')]['channel'][_0x479a('0xab')]())+_0x479a('0xb8'),_0x32512e);}}else{_0x32512e={'UserId':Number(_0x2a4c3e['params']['id'])};_0x32512e[_['capitalize'](_0x2a4c3e[_0x479a('0x48')][_0x479a('0xa2')][_0x479a('0xab')]())+'QueueId']=Number(_0x2a4c3e[_0x479a('0x48')][_0x479a('0x64')]);socket[_0x479a('0x2e')](_0x479a('0x31')+_[_0x479a('0xb5')](_0x2a4c3e['query'][_0x479a('0xa2')]['toLowerCase']())+_0x479a('0xb8'),_0x32512e);}return _0x1362e2;})[_0x479a('0x22')](function(){if(_0x2a4c3e[_0x479a('0x48')]['channel']==='voice'){return db[_0x479a('0xb9')][_0x479a('0xba')]({'where':{'UserId':_0x2a4c3e[_0x479a('0x5c')]['id'],'VoiceQueueId':_0x2a4c3e[_0x479a('0x48')]['ids']},'individualHooks':!![]})['then'](function(){return _0x4f0f1a;});}return _0x4f0f1a;})['then'](respondWithStatusCode(_0x45c1e3,null))[_0x479a('0x5a')](handleError(_0x45c1e3,null));};exports[_0x479a('0xbb')]=function(_0x2d8dd1,_0x2663dd){_0x2d8dd1[_0x479a('0x61')][_0x479a('0xbc')]=_0x2d8dd1[_0x479a('0xbd')][_0x479a('0xbe')];return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x2d8dd1[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x2663dd,null))[_0x479a('0x22')](saveUpdates(_0x2d8dd1[_0x479a('0x61')],null))[_0x479a('0x22')](respondWithResult(_0x2663dd,null))['catch'](handleError(_0x2663dd,null));};exports['getAvatar']=function(_0x23d951,_0x97a21){var _0x15897a=path[_0x479a('0xbf')](config['root'],_0x479a('0xc0'));return db['User'][_0x479a('0x38')]({'where':{'id':_0x23d951[_0x479a('0x5c')]['id']},'attributes':['id',_0x479a('0xbc')],'raw':!![]})[_0x479a('0x22')](handleEntityNotFound(_0x97a21,null))[_0x479a('0x22')](function(_0x545ea3){if(_0x545ea3){if(_['isNil'](_0x545ea3[_0x479a('0xbc')])){return _0x97a21[_0x479a('0xc1')](_0x15897a);}else{if(!fs[_0x479a('0xc2')](path[_0x479a('0xbf')](config[_0x479a('0xc3')],_0x479a('0xc4'),_0x545ea3[_0x479a('0xbc')]))){return _0x97a21[_0x479a('0xc1')](_0x15897a);}return _0x97a21[_0x479a('0xc1')](path[_0x479a('0xbf')](config[_0x479a('0xc3')],_0x479a('0xc4'),_0x545ea3[_0x479a('0xbc')]));}}})[_0x479a('0x5a')](handleError(_0x97a21,null));};exports[_0x479a('0xc5')]=function(_0x435de7,_0x99f46b){return db['User'][_0x479a('0x38')]({'where':{'id':_0x435de7[_0x479a('0x5c')]['id']},'attributes':['id']})[_0x479a('0x22')](handleEntityNotFound(_0x99f46b,null))[_0x479a('0x22')](function(_0xc479d7){var _0x2fe4a7=[];values=_0xc479d7[_0x479a('0x55')];_0x2fe4a7[_0x479a('0x4f')](get_open_tabs('chat',_0xc479d7[_0x479a('0x55')]));_0x2fe4a7[_0x479a('0x4f')](get_open_tabs(_0x479a('0x56'),_0xc479d7[_0x479a('0x55')]));_0x2fe4a7[_0x479a('0x4f')](get_open_tabs(_0x479a('0x58'),_0xc479d7[_0x479a('0x55')]));_0x2fe4a7['push'](get_open_tabs(_0x479a('0x5f'),_0xc479d7[_0x479a('0x55')]));_0x2fe4a7[_0x479a('0x4f')](get_open_tabs(_0x479a('0x57'),_0xc479d7[_0x479a('0x55')]));_0x2fe4a7[_0x479a('0x4f')](get_open_tabs(_0x479a('0x60'),_0xc479d7[_0x479a('0x55')]));return Promise['all'](_0x2fe4a7);})['then'](function(_0x2a7fda){if(_0x2a7fda){var _0xcd2533=_[_0x479a('0x35')](values[_0x479a('0xc6')],function(_0x21137c){return{'channel':_0x479a('0xc7'),'id':_0x21137c['id'],'createdAt':_0x21137c[_0x479a('0xc8')]};});var _0x8395b3=_[_0x479a('0x35')](values[_0x479a('0xc9')],function(_0x5f139e){return{'channel':'FAX','id':_0x5f139e['id'],'createdAt':_0x5f139e[_0x479a('0xc8')]};});var _0x34476a=_['map'](values[_0x479a('0xca')],function(_0x50ade5){return{'channel':_0x479a('0xcb'),'id':_0x50ade5['id'],'createdAt':_0x50ade5[_0x479a('0xc8')]};});var _0xbfddec=_['map'](values[_0x479a('0xcc')],function(_0xf5ac3){return{'channel':_0x479a('0xcd'),'id':_0xf5ac3['id'],'createdAt':_0xf5ac3[_0x479a('0xc8')]};});var _0x3a62b8=_[_0x479a('0x35')](values['SmsOpenTabs'],function(_0x4fd744){return{'channel':_0x479a('0xce'),'id':_0x4fd744['id'],'createdAt':_0x4fd744['createdAt']};});var _0x5ed10b=_[_0x479a('0x35')](values[_0x479a('0xcf')],function(_0x46c3ce){return{'channel':_0x479a('0xd0'),'id':_0x46c3ce['id'],'createdAt':_0x46c3ce[_0x479a('0xc8')]};});var _0x98c4d0=_[_0x479a('0xd1')](_0xcd2533,_0x8395b3,_0x34476a,_0xbfddec,_0x3a62b8,_0x5ed10b);var _0x13f78c={'count':_0x98c4d0[_0x479a('0x53')],'rows':_0x98c4d0};return _0x13f78c;}else return null;})['then'](respondWithResult(_0x99f46b,null))[_0x479a('0x5a')](handleError(_0x99f46b,null));};exports[_0x479a('0xd2')]=function(_0x390f2f,_0x4b92b2){var _0x3f028f={};return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x390f2f[_0x479a('0x5c')]['id']}})['then'](function(_0x573dd7){if(!_0x573dd7){throw new APINotFoundError(util[_0x479a('0xae')](_0x479a('0xd3'),_0x390f2f['params']['id']));}return contacts[_0x479a('0x62')]();})[_0x479a('0x22')](function(_0x26c8ee){_0x390f2f['query'][_0x479a('0x3d')]=_0x390f2f[_0x479a('0x5c')]['id'];_0x3f028f=qs[_0x479a('0x46')](_0x26c8ee,_0x390f2f);if(_0x390f2f[_0x479a('0x48')]['hasOwnProperty'](_0x479a('0x49'))){_0x3f028f[_0x479a('0x4a')]=[{'model':db[_0x479a('0xd4')],'as':_0x479a('0xd5'),'required':![]},{'model':db[_0x479a('0xd6')],'as':_0x479a('0xd7'),'attributes':['id',_0x479a('0x3b'),'color'],'where':_0x390f2f[_0x479a('0x48')]['tag']?{'id':_0x390f2f['query'][_0x479a('0xd8')]}:undefined,'required':_0x390f2f[_0x479a('0x48')][_0x479a('0xd8')]?!![]:![]}];}return contacts[_0x479a('0x50')](_0x390f2f[_0x479a('0x48')],_0x390f2f[_0x479a('0x31')],_0x3f028f,_0x26c8ee);})[_0x479a('0x22')](respondWithFilteredResult(_0x4b92b2,_0x3f028f))[_0x479a('0x5a')](APIHandleError(_0x4b92b2));};exports['getQueues']=function(_0x29b48e,_0xbc87a2){var _0x2300e3;var _0x55709b={};var _0x2a86c5;return db['User'][_0x479a('0x9d')]({'where':{'id':_0x29b48e[_0x479a('0x5c')]['id']},'attributes':['id',_0x479a('0x3b'),_0x479a('0x2c')]})['then'](handleEntityNotFound(_0xbc87a2,null))[_0x479a('0x22')](function(_0xca087e){if(!utils[_0x479a('0xa6')](_0x29b48e[_0x479a('0x48')]['channel'])){throw new db['Sequelize'][(_0x479a('0x96'))](_0x479a('0xa7'));}_0x2300e3=_0xca087e;var _0x149515={};_0x149515[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_[_0x479a('0xb5')](_0x29b48e['query'][_0x479a('0xa2')])+_0x479a('0xdb')][_0x479a('0x3e')]);_0x149515[_0x479a('0x48')]=_[_0x479a('0xda')](_0x29b48e[_0x479a('0x48')]);_0x149515[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x149515[_0x479a('0xd9')],_0x149515[_0x479a('0x48')]);_0x55709b['attributes']=_[_0x479a('0xdd')](_0x149515[_0x479a('0xd9')],qs['fields'](_0x29b48e[_0x479a('0x48')]['fields']));_0x55709b[_0x479a('0x4e')]=_0x55709b[_0x479a('0x4e')]['length']?_0x55709b['attributes']:_0x149515['model'];_0x55709b[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x29b48e[_0x479a('0x48')][_0x479a('0xdf')]);_0x55709b[_0x479a('0x47')]=qs['filters'](_['pick'](_0x29b48e['query'],_0x149515[_0x479a('0xdc')]));if(_0x29b48e['query'][_0x479a('0xe0')]){_0x55709b[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x55709b[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x55709b['attributes'],function(_0x156bf1){var _0x87a496={};_0x87a496[_0x156bf1]={'$like':'%'+_0x29b48e['query'][_0x479a('0xe0')]+'%'};return _0x87a496;})});}_0x55709b=_[_0x479a('0x5d')]({},_0x55709b,_0x29b48e[_0x479a('0x5e')]);switch(_0x2300e3['role']){case _0x479a('0x30'):return db[_[_0x479a('0xb5')](_0x29b48e[_0x479a('0x48')][_0x479a('0xa2')])+'Queue'][_0x479a('0x50')](_0x55709b);case _0x479a('0x31'):case _0x479a('0x2d'):return _0x2300e3[_0x479a('0x2f')+_[_0x479a('0xb5')](_0x29b48e['query'][_0x479a('0xa2')])+'Queues'](_0x55709b);default:throw new db[(_0x479a('0x9a'))][(_0x479a('0x96'))](_0x479a('0xe1'));}})['then'](function(_0x245aa4){_0x2a86c5=_0x245aa4[_0x479a('0x53')];if(!_0x29b48e['query'][_0x479a('0xe2')]('nolimit')){_0x55709b[_0x479a('0x1b')]=qs[_0x479a('0x1b')](_0x29b48e[_0x479a('0x48')][_0x479a('0x1b')]);_0x55709b[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x29b48e[_0x479a('0x48')][_0x479a('0x1a')]);}switch(_0x2300e3[_0x479a('0x2c')]){case _0x479a('0x30'):return db[_[_0x479a('0xb5')](_0x29b48e[_0x479a('0x48')][_0x479a('0xa2')])+'Queue']['findAll'](_0x55709b);case _0x479a('0x31'):case _0x479a('0x2d'):return _0x2300e3[_0x479a('0x2f')+_['capitalize'](_0x29b48e[_0x479a('0x48')][_0x479a('0xa2')])+_0x479a('0xa9')](_0x55709b);}})[_0x479a('0x22')](function(_0x445e1b){return{'count':_0x2a86c5,'rows':_0x445e1b};})['then'](respondWithResult(_0xbc87a2,null))[_0x479a('0x5a')](handleError(_0xbc87a2,null));};exports['getVoiceQueuesRt']=function(_0x17c546,_0x185f94){var _0x39da79={};var _0x42cf6e={};var _0x539540;var _0x5d1a9b;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x17c546[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x185f94,null))[_0x479a('0x22')](function(_0x110396){if(_0x110396){_0x539540=_0x110396;_0x42cf6e[_0x479a('0xd9')]=_[_0x479a('0xda')](db['UserVoiceQueueRt'][_0x479a('0x3e')]);_0x42cf6e['query']=_[_0x479a('0xda')](_0x17c546[_0x479a('0x48')]);_0x42cf6e['filters']=_[_0x479a('0xdd')](_0x42cf6e['model'],_0x42cf6e[_0x479a('0x48')]);_0x39da79[_0x479a('0x4e')]=_['intersection'](_0x42cf6e[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x17c546[_0x479a('0x48')][_0x479a('0xe3')]));_0x39da79[_0x479a('0x4e')]=_0x39da79[_0x479a('0x4e')][_0x479a('0x53')]?_0x39da79[_0x479a('0x4e')]:_0x42cf6e[_0x479a('0xd9')];_0x39da79[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x17c546[_0x479a('0x48')][_0x479a('0xdf')]);_0x39da79[_0x479a('0x47')]=qs['filters'](_[_0x479a('0xe4')](_0x17c546[_0x479a('0x48')],_0x42cf6e[_0x479a('0xdc')]));if(_0x17c546[_0x479a('0x48')]['filter']){_0x39da79[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x39da79['where'],{'$or':_['map'](_0x39da79[_0x479a('0x4e')],function(_0x4ac42b){var _0x1af010={};_0x1af010[_0x4ac42b]={'$like':'%'+_0x17c546[_0x479a('0x48')]['filter']+'%'};return _0x1af010;})});}_0x39da79=_[_0x479a('0x5d')]({},_0x39da79,_0x17c546[_0x479a('0x5e')]);return _0x539540[_0x479a('0xe5')](_0x39da79);}})[_0x479a('0x22')](function(_0x44fba4){if(_0x44fba4){_0x5d1a9b=_0x44fba4[_0x479a('0x53')];if(!_0x17c546[_0x479a('0x48')]['hasOwnProperty'](_0x479a('0xe6'))){_0x39da79['limit']=qs[_0x479a('0x1b')](_0x17c546['query']['limit']);_0x39da79[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x17c546['query'][_0x479a('0x1a')]);}return _0x539540[_0x479a('0xe5')](_0x39da79);}})[_0x479a('0x22')](function(_0x1abf9f){if(_0x1abf9f){return _0x1abf9f?{'count':_0x5d1a9b,'rows':_0x1abf9f}:null;}})[_0x479a('0x22')](respondWithResult(_0x185f94,null))[_0x479a('0x5a')](handleError(_0x185f94,null));};exports[_0x479a('0xe7')]=function(_0x5c8add,_0x372080){var _0x437312={};var _0x3b7911={};var _0x4aa803;var _0x43de17;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x5c8add['params']['id']}})['then'](handleEntityNotFound(_0x372080,null))[_0x479a('0x22')](function(_0x50ee22){if(_0x50ee22){_0x4aa803=_0x50ee22;_0x3b7911[_0x479a('0xd9')]=_[_0x479a('0xda')](db['ChatGroup'][_0x479a('0x3e')]);_0x3b7911[_0x479a('0x48')]=_[_0x479a('0xda')](_0x5c8add[_0x479a('0x48')]);_0x3b7911[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x3b7911['model'],_0x3b7911[_0x479a('0x48')]);_0x437312[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x3b7911['model'],qs['fields'](_0x5c8add[_0x479a('0x48')][_0x479a('0xe3')]));_0x437312[_0x479a('0x4e')]=_0x437312['attributes'][_0x479a('0x53')]?_0x437312[_0x479a('0x4e')]:_0x3b7911[_0x479a('0xd9')];_0x437312[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x5c8add[_0x479a('0x48')][_0x479a('0xdf')]);_0x437312['where']=qs['filters'](_[_0x479a('0xe4')](_0x5c8add[_0x479a('0x48')],_0x3b7911[_0x479a('0xdc')]));if(_0x5c8add[_0x479a('0x48')]['filter']){_0x437312[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x437312['where'],{'$or':_[_0x479a('0x35')](_0x437312[_0x479a('0x4e')],function(_0xa01b87){var _0x56d998={};_0x56d998[_0xa01b87]={'$like':'%'+_0x5c8add[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x56d998;})});}_0x437312=_[_0x479a('0x5d')]({},_0x437312,_0x5c8add[_0x479a('0x5e')]);return _0x4aa803['getGroups'](_0x437312);}})[_0x479a('0x22')](function(_0x3c0ec4){if(_0x3c0ec4){_0x43de17=_0x3c0ec4[_0x479a('0x53')];if(!_0x5c8add[_0x479a('0x48')]['hasOwnProperty'](_0x479a('0xe6'))){_0x437312['limit']=qs[_0x479a('0x1b')](_0x5c8add[_0x479a('0x48')][_0x479a('0x1b')]);_0x437312['offset']=qs[_0x479a('0x1a')](_0x5c8add[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x4aa803['getGroups'](_0x437312);}})[_0x479a('0x22')](function(_0x82b3e3){if(_0x82b3e3){return _0x82b3e3?{'count':_0x43de17,'rows':_0x82b3e3}:null;}})[_0x479a('0x22')](respondWithResult(_0x372080,null))['catch'](handleError(_0x372080,null));};exports[_0x479a('0xe8')]=function(_0x2a69b6,_0x429d9f){var _0x241af5={'raw':!![],'where':{}};var _0x49ea4e={};var _0x5b0a6b={'count':0x0,'rows':[]};return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x2a69b6[_0x479a('0x5c')]['id']}})['then'](handleEntityNotFound(_0x429d9f,null))[_0x479a('0x22')](function(_0x5a6a29){if(_0x5a6a29){_0x49ea4e[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xe9')][_0x479a('0x3e')]);_0x49ea4e['query']=_[_0x479a('0xda')](_0x2a69b6[_0x479a('0x48')]);_0x49ea4e[_0x479a('0xdc')]=_['intersection'](_0x49ea4e['model'],_0x49ea4e[_0x479a('0x48')]);_0x241af5[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x49ea4e[_0x479a('0xd9')],qs['fields'](_0x2a69b6[_0x479a('0x48')][_0x479a('0xe3')]));_0x241af5[_0x479a('0x4e')]=_0x241af5[_0x479a('0x4e')][_0x479a('0x53')]?_0x241af5[_0x479a('0x4e')]:_0x49ea4e[_0x479a('0xd9')];if(!_0x2a69b6[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x241af5[_0x479a('0x1b')]=qs[_0x479a('0x1b')](_0x2a69b6['query'][_0x479a('0x1b')]);_0x241af5['offset']=qs['offset'](_0x2a69b6[_0x479a('0x48')]['offset']);}_0x241af5[_0x479a('0xde')]=qs['sort'](_0x2a69b6['query'][_0x479a('0xdf')]);_0x241af5[_0x479a('0x47')]=qs[_0x479a('0xdc')](_['pick'](_0x2a69b6['query'],_0x49ea4e[_0x479a('0xdc')]));_0x241af5[_0x479a('0x47')][_0x479a('0xea')]=_0x5a6a29['id'];if(_0x2a69b6[_0x479a('0x48')]['filter']){_0x241af5[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x241af5['where'],{'$or':_['map'](_0x241af5['attributes'],function(_0x3cc308){var _0x2188f9={};_0x2188f9[_0x3cc308]={'$like':'%'+_0x2a69b6[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x2188f9;})});}_0x241af5=_[_0x479a('0x5d')]({},_0x241af5,_0x2a69b6['options']);return db[_0x479a('0xe9')][_0x479a('0x1d')]({'where':_0x241af5[_0x479a('0x47')]})[_0x479a('0x22')](function(_0xf95f1a){_0x5b0a6b[_0x479a('0x1d')]=_0xf95f1a;if(_0x2a69b6['query'][_0x479a('0x49')]){_0x241af5['include']=[{'all':!![]}];}return db[_0x479a('0xe9')][_0x479a('0x50')](_0x241af5);})[_0x479a('0x22')](function(_0xcf3faf){_0x5b0a6b[_0x479a('0x51')]=_0xcf3faf;return _0x5b0a6b;});}})[_0x479a('0x22')](respondWithFilteredResult(_0x429d9f,_0x241af5))[_0x479a('0x5a')](handleError(_0x429d9f,null));};exports['getScreenRecordings']=function(_0x31bef1,_0x5f5061){var _0x1af6fa={'raw':!![],'where':{}};var _0xba5bb4={};var _0x536eff={'count':0x0,'rows':[]};return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x31bef1[_0x479a('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5f5061,null))['then'](function(_0x304823){if(_0x304823){_0xba5bb4[_0x479a('0xd9')]=_[_0x479a('0xda')](db['ScreenRecording'][_0x479a('0x3e')]);_0xba5bb4[_0x479a('0x48')]=_['keys'](_0x31bef1['query']);_0xba5bb4[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0xba5bb4[_0x479a('0xd9')],_0xba5bb4[_0x479a('0x48')]);_0x1af6fa[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0xba5bb4[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x31bef1['query']['fields']));_0x1af6fa[_0x479a('0x4e')]=_0x1af6fa[_0x479a('0x4e')][_0x479a('0x53')]?_0x1af6fa['attributes']:_0xba5bb4[_0x479a('0xd9')];if(!_0x31bef1[_0x479a('0x48')][_0x479a('0xe2')]('nolimit')){_0x1af6fa[_0x479a('0x1b')]=qs[_0x479a('0x1b')](_0x31bef1[_0x479a('0x48')][_0x479a('0x1b')]);_0x1af6fa[_0x479a('0x1a')]=qs['offset'](_0x31bef1['query'][_0x479a('0x1a')]);}_0x1af6fa['order']=qs[_0x479a('0xdf')](_0x31bef1[_0x479a('0x48')]['sort']);_0x1af6fa[_0x479a('0x47')]=qs['filters'](_[_0x479a('0xe4')](_0x31bef1[_0x479a('0x48')],_0xba5bb4[_0x479a('0xdc')]));_0x1af6fa[_0x479a('0x47')][_0x479a('0xea')]=_0x304823['id'];if(_0x31bef1[_0x479a('0x48')][_0x479a('0xe0')]){_0x1af6fa[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x1af6fa[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x1af6fa[_0x479a('0x4e')],function(_0x253742){var _0x518f22={};_0x518f22[_0x253742]={'$like':'%'+_0x31bef1[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x518f22;})});}_0x1af6fa=_[_0x479a('0x5d')]({},_0x1af6fa,_0x31bef1[_0x479a('0x5e')]);return db['ScreenRecording'][_0x479a('0x1d')]({'where':_0x1af6fa[_0x479a('0x47')]})['then'](function(_0x1dcf1f){_0x536eff[_0x479a('0x1d')]=_0x1dcf1f;if(_0x31bef1[_0x479a('0x48')]['includeAll']){_0x1af6fa['include']=[{'all':!![]}];}return db[_0x479a('0xeb')][_0x479a('0x50')](_0x1af6fa);})[_0x479a('0x22')](function(_0x498516){_0x536eff[_0x479a('0x51')]=_0x498516;return _0x536eff;});}})[_0x479a('0x22')](respondWithFilteredResult(_0x5f5061,_0x1af6fa))[_0x479a('0x5a')](handleError(_0x5f5061,null));};exports[_0x479a('0xec')]=function(_0xd8815b,_0x5c0f73){var _0x239a0f={};var _0x38a61b={};var _0x361212;var _0x4a3753;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0xd8815b[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x5c0f73,null))[_0x479a('0x22')](function(_0x2e1164){if(_0x2e1164){_0x361212=_0x2e1164;_0x38a61b['model']=_['keys'](db[_0x479a('0xed')][_0x479a('0x3e')]);_0x38a61b['query']=_[_0x479a('0xda')](_0xd8815b['query']);_0x38a61b[_0x479a('0xdc')]=_['intersection'](_0x38a61b[_0x479a('0xd9')],_0x38a61b[_0x479a('0x48')]);_0x239a0f['attributes']=_[_0x479a('0xdd')](_0x38a61b['model'],qs[_0x479a('0xe3')](_0xd8815b['query'][_0x479a('0xe3')]));_0x239a0f[_0x479a('0x4e')]=_0x239a0f[_0x479a('0x4e')][_0x479a('0x53')]?_0x239a0f['attributes']:_0x38a61b[_0x479a('0xd9')];_0x239a0f[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0xd8815b[_0x479a('0x48')][_0x479a('0xdf')]);_0x239a0f['where']=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0xd8815b[_0x479a('0x48')],_0x38a61b['filters']));if(_0xd8815b['query'][_0x479a('0xe0')]){_0x239a0f[_0x479a('0x47')]=_['merge'](_0x239a0f[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x239a0f[_0x479a('0x4e')],function(_0x1bbd49){var _0x4e3133={};_0x4e3133[_0x1bbd49]={'$like':'%'+_0xd8815b[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x4e3133;})});}_0x239a0f=_[_0x479a('0x5d')]({},_0x239a0f,_0xd8815b[_0x479a('0x5e')]);return _0x361212[_0x479a('0xec')](_0x239a0f);}})[_0x479a('0x22')](function(_0x59ad01){if(_0x59ad01){_0x4a3753=_0x59ad01[_0x479a('0x53')];if(!_0xd8815b['query'][_0x479a('0xe2')](_0x479a('0xe6'))){_0x239a0f['limit']=qs[_0x479a('0x1b')](_0xd8815b[_0x479a('0x48')]['limit']);_0x239a0f[_0x479a('0x1a')]=qs['offset'](_0xd8815b[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x361212[_0x479a('0xec')](_0x239a0f);}})[_0x479a('0x22')](function(_0x32a87b){if(_0x32a87b){return _0x32a87b?{'count':_0x4a3753,'rows':_0x32a87b}:null;}})[_0x479a('0x22')](respondWithResult(_0x5c0f73,null))[_0x479a('0x5a')](handleError(_0x5c0f73,null));};exports['getOpenchannelInteractions']=function(_0x573034,_0x349bf0){var _0x26c3d8={};var _0x33f3c4={};var _0x1df96f;var _0x3f9eb9;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x573034[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x349bf0,null))[_0x479a('0x22')](function(_0x416957){if(_0x416957){_0x1df96f=_0x416957;_0x33f3c4[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xee')]['rawAttributes']);_0x33f3c4[_0x479a('0x48')]=_[_0x479a('0xda')](_0x573034['query']);_0x33f3c4[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x33f3c4[_0x479a('0xd9')],_0x33f3c4[_0x479a('0x48')]);_0x26c3d8[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x33f3c4['model'],qs[_0x479a('0xe3')](_0x573034[_0x479a('0x48')]['fields']));_0x26c3d8[_0x479a('0x4e')]=_0x26c3d8[_0x479a('0x4e')][_0x479a('0x53')]?_0x26c3d8[_0x479a('0x4e')]:_0x33f3c4['model'];_0x26c3d8[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x573034['query'][_0x479a('0xdf')]);_0x26c3d8[_0x479a('0x47')]=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x573034[_0x479a('0x48')],_0x33f3c4['filters']));if(_0x573034[_0x479a('0x48')][_0x479a('0xe0')]){_0x26c3d8[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x26c3d8[_0x479a('0x47')],{'$or':_['map'](_0x26c3d8[_0x479a('0x4e')],function(_0x31df42){var _0x564139={};_0x564139[_0x31df42]={'$like':'%'+_0x573034[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x564139;})});}_0x26c3d8=_['merge']({},_0x26c3d8,_0x573034[_0x479a('0x5e')]);return _0x1df96f[_0x479a('0xef')](_0x26c3d8);}})[_0x479a('0x22')](function(_0x281486){if(_0x281486){_0x3f9eb9=_0x281486[_0x479a('0x53')];if(!_0x573034[_0x479a('0x48')][_0x479a('0xe2')]('nolimit')){_0x26c3d8['limit']=qs['limit'](_0x573034[_0x479a('0x48')][_0x479a('0x1b')]);_0x26c3d8['offset']=qs[_0x479a('0x1a')](_0x573034['query'][_0x479a('0x1a')]);}return _0x1df96f['getOpenchannelInteractions'](_0x26c3d8);}})['then'](function(_0x10a6f7){if(_0x10a6f7){return _0x10a6f7?{'count':_0x3f9eb9,'rows':_0x10a6f7}:null;}})[_0x479a('0x22')](respondWithResult(_0x349bf0,null))[_0x479a('0x5a')](handleError(_0x349bf0,null));};exports[_0x479a('0xf0')]=function(_0x5ea596,_0x5c15d8){var _0x5a922b={'raw':!![],'where':{}};var _0x186fc4={};var _0x2b1bb3={'count':0x0,'rows':[]};return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x5ea596[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x5c15d8,null))[_0x479a('0x22')](function(_0x4d26fc){if(_0x4d26fc){_0x186fc4[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xf1')][_0x479a('0x3e')]);_0x186fc4['query']=_[_0x479a('0xda')](_0x5ea596['query']);_0x186fc4[_0x479a('0xdc')]=_['intersection'](_0x186fc4['model'],_0x186fc4[_0x479a('0x48')]);_0x5a922b[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x186fc4['model'],qs[_0x479a('0xe3')](_0x5ea596['query'][_0x479a('0xe3')]));_0x5a922b[_0x479a('0x4e')]=_0x5a922b[_0x479a('0x4e')][_0x479a('0x53')]?_0x5a922b[_0x479a('0x4e')]:_0x186fc4['model'];if(!_0x5ea596[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x5a922b['limit']=qs[_0x479a('0x1b')](_0x5ea596['query']['limit']);_0x5a922b[_0x479a('0x1a')]=qs['offset'](_0x5ea596[_0x479a('0x48')]['offset']);}_0x5a922b[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x5ea596['query'][_0x479a('0xdf')]);_0x5a922b[_0x479a('0x47')]=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x5ea596[_0x479a('0x48')],_0x186fc4[_0x479a('0xdc')]));_0x5a922b['where']['UserId']=_0x4d26fc['id'];if(_0x5ea596[_0x479a('0x48')][_0x479a('0xe0')]){_0x5a922b['where']=_[_0x479a('0x5d')](_0x5a922b[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x5a922b[_0x479a('0x4e')],function(_0xc1e36d){var _0x2cf8b9={};_0x2cf8b9[_0xc1e36d]={'$like':'%'+_0x5ea596[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x2cf8b9;})});}_0x5a922b=_[_0x479a('0x5d')]({},_0x5a922b,_0x5ea596['options']);return db['MailInteraction'][_0x479a('0x1d')]({'where':_0x5a922b[_0x479a('0x47')]})[_0x479a('0x22')](function(_0x5b5888){_0x2b1bb3[_0x479a('0x1d')]=_0x5b5888;if(_0x5ea596['query'][_0x479a('0x49')]){_0x5a922b[_0x479a('0x4a')]=[{'all':!![]}];}return db[_0x479a('0xf1')][_0x479a('0x50')](_0x5a922b);})[_0x479a('0x22')](function(_0x2b92bd){_0x2b1bb3[_0x479a('0x51')]=_0x2b92bd;return _0x2b1bb3;});}})['then'](respondWithFilteredResult(_0x5c15d8,_0x5a922b))['catch'](handleError(_0x5c15d8,null));};exports[_0x479a('0xf2')]=function(_0x184e33,_0x48462c){var _0x32b89d={};var _0x56e6f9={};var _0x38b56c;var _0xa17d7;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x184e33[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x48462c,null))[_0x479a('0x22')](function(_0x3962bf){if(_0x3962bf){_0x38b56c=_0x3962bf;_0x56e6f9[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xf3')][_0x479a('0x3e')]);_0x56e6f9[_0x479a('0x48')]=_[_0x479a('0xda')](_0x184e33['query']);_0x56e6f9[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x56e6f9['model'],_0x56e6f9[_0x479a('0x48')]);_0x32b89d[_0x479a('0x4e')]=_['intersection'](_0x56e6f9[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x184e33['query'][_0x479a('0xe3')]));_0x32b89d['attributes']=_0x32b89d[_0x479a('0x4e')]['length']?_0x32b89d['attributes']:_0x56e6f9[_0x479a('0xd9')];_0x32b89d[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x184e33[_0x479a('0x48')][_0x479a('0xdf')]);_0x32b89d[_0x479a('0x47')]=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x184e33[_0x479a('0x48')],_0x56e6f9[_0x479a('0xdc')]));if(_0x184e33[_0x479a('0x48')][_0x479a('0xe0')]){_0x32b89d[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x32b89d[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x32b89d[_0x479a('0x4e')],function(_0x4e9748){var _0x254007={};_0x254007[_0x4e9748]={'$like':'%'+_0x184e33['query'][_0x479a('0xe0')]+'%'};return _0x254007;})});}_0x32b89d=_[_0x479a('0x5d')]({},_0x32b89d,_0x184e33[_0x479a('0x5e')]);return _0x38b56c[_0x479a('0xf2')](_0x32b89d);}})['then'](function(_0x5efb49){if(_0x5efb49){_0xa17d7=_0x5efb49['length'];if(!_0x184e33[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x32b89d['limit']=qs[_0x479a('0x1b')](_0x184e33[_0x479a('0x48')]['limit']);_0x32b89d[_0x479a('0x1a')]=qs['offset'](_0x184e33[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x38b56c['getSmsInteractions'](_0x32b89d);}})[_0x479a('0x22')](function(_0x3d8614){if(_0x3d8614){return _0x3d8614?{'count':_0xa17d7,'rows':_0x3d8614}:null;}})[_0x479a('0x22')](respondWithResult(_0x48462c,null))[_0x479a('0x5a')](handleError(_0x48462c,null));};exports[_0x479a('0xf4')]=function(_0x5c93a7,_0x4239b6){var _0x22c390={};var _0x167dd1={};var _0x24c9f1;var _0x4ec67a;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x5c93a7['params']['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x4239b6,null))[_0x479a('0x22')](function(_0x5a2d12){if(_0x5a2d12){_0x24c9f1=_0x5a2d12;_0x167dd1[_0x479a('0xd9')]=_[_0x479a('0xda')](db['FaxInteraction'][_0x479a('0x3e')]);_0x167dd1[_0x479a('0x48')]=_[_0x479a('0xda')](_0x5c93a7[_0x479a('0x48')]);_0x167dd1[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x167dd1[_0x479a('0xd9')],_0x167dd1[_0x479a('0x48')]);_0x22c390[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x167dd1[_0x479a('0xd9')],qs['fields'](_0x5c93a7[_0x479a('0x48')][_0x479a('0xe3')]));_0x22c390[_0x479a('0x4e')]=_0x22c390[_0x479a('0x4e')][_0x479a('0x53')]?_0x22c390[_0x479a('0x4e')]:_0x167dd1['model'];_0x22c390['order']=qs[_0x479a('0xdf')](_0x5c93a7['query'][_0x479a('0xdf')]);_0x22c390[_0x479a('0x47')]=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x5c93a7[_0x479a('0x48')],_0x167dd1['filters']));if(_0x5c93a7[_0x479a('0x48')][_0x479a('0xe0')]){_0x22c390['where']=_[_0x479a('0x5d')](_0x22c390[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x22c390[_0x479a('0x4e')],function(_0x58516f){var _0xd6c233={};_0xd6c233[_0x58516f]={'$like':'%'+_0x5c93a7['query']['filter']+'%'};return _0xd6c233;})});}_0x22c390=_[_0x479a('0x5d')]({},_0x22c390,_0x5c93a7['options']);return _0x24c9f1[_0x479a('0xf4')](_0x22c390);}})[_0x479a('0x22')](function(_0x1122f0){if(_0x1122f0){_0x4ec67a=_0x1122f0[_0x479a('0x53')];if(!_0x5c93a7[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x22c390[_0x479a('0x1b')]=qs['limit'](_0x5c93a7[_0x479a('0x48')][_0x479a('0x1b')]);_0x22c390[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x5c93a7[_0x479a('0x48')]['offset']);}return _0x24c9f1[_0x479a('0xf4')](_0x22c390);}})[_0x479a('0x22')](function(_0x4b2618){if(_0x4b2618){return _0x4b2618?{'count':_0x4ec67a,'rows':_0x4b2618}:null;}})[_0x479a('0x22')](respondWithResult(_0x4239b6,null))[_0x479a('0x5a')](handleError(_0x4239b6,null));};exports[_0x479a('0xf5')]=function(_0x15c19f,_0x227960){var _0x5041e9={};var _0x101559={};var _0x328043;var _0x4d8baf;return db[_0x479a('0x3d')][_0x479a('0x9d')]({'where':{'id':_0x15c19f[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x227960,null))['then'](function(_0x15f238){if(_0x15f238){_0x328043=_0x15f238;_0x101559[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xf6')][_0x479a('0x3e')]);_0x101559[_0x479a('0x48')]=_[_0x479a('0xda')](_0x15c19f['query']);_0x101559[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x101559[_0x479a('0xd9')],_0x101559['query']);_0x5041e9[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x101559[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x15c19f['query'][_0x479a('0xe3')]));_0x5041e9[_0x479a('0x4e')]=_0x5041e9[_0x479a('0x4e')][_0x479a('0x53')]?_0x5041e9[_0x479a('0x4e')]:_0x101559[_0x479a('0xd9')];_0x5041e9[_0x479a('0xde')]=qs['sort'](_0x15c19f['query'][_0x479a('0xdf')]);_0x5041e9[_0x479a('0x47')]=qs['filters'](_['pick'](_0x15c19f['query'],_0x101559[_0x479a('0xdc')]));if(_0x15c19f['query'][_0x479a('0xe0')]){_0x5041e9[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x5041e9[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x5041e9[_0x479a('0x4e')],function(_0xfb5fbb){var _0x54aae5={};_0x54aae5[_0xfb5fbb]={'$like':'%'+_0x15c19f[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x54aae5;})});}_0x5041e9=_[_0x479a('0x5d')]({},_0x5041e9,_0x15c19f[_0x479a('0x5e')]);return _0x328043[_0x479a('0xf5')](_0x5041e9);}})['then'](function(_0x5de24a){if(_0x5de24a){_0x4d8baf=_0x5de24a[_0x479a('0x53')];if(!_0x15c19f['query']['hasOwnProperty'](_0x479a('0xe6'))){_0x5041e9[_0x479a('0x1b')]=qs[_0x479a('0x1b')](_0x15c19f[_0x479a('0x48')][_0x479a('0x1b')]);_0x5041e9[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x15c19f[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x328043[_0x479a('0xf5')](_0x5041e9);}})[_0x479a('0x22')](function(_0x19f345){if(_0x19f345){return _0x19f345?{'count':_0x4d8baf,'rows':_0x19f345}:null;}})[_0x479a('0x22')](respondWithResult(_0x227960,null))[_0x479a('0x5a')](handleError(_0x227960,null));};exports[_0x479a('0xf7')]=function(_0x47db81,_0x3533d1,_0x4cd56c){var _0x2b131d;var _0x129760;var _0x355e49;var _0x4bf0a0=!_[_0x479a('0x6b')](_0x47db81['params']['id'])?_0x47db81[_0x479a('0x5c')]['id']:!_[_0x479a('0x6b')](_0x47db81[_0x479a('0x31')]['id'])?_0x47db81[_0x479a('0x31')]['id']:null;return db[_0x479a('0x3d')]['find']({'where':{'id':_0x4bf0a0,'role':{'$or':[_0x479a('0x30'),'user',_0x479a('0x2d')]}},'attributes':['id',_0x479a('0x3b'),_0x479a('0xf8'),_0x479a('0xf9'),'role',_0x479a('0x66'),_0x479a('0xa4')]})[_0x479a('0x22')](function(_0x22b5a4){if(_0x22b5a4){if(_0x22b5a4['role']===_0x479a('0x2d')){_0x2b131d=_0x22b5a4;if(_0x47db81[_0x479a('0x61')][_0x479a('0xa5')]){_0x355e49=util['format'](_0x479a('0xfa'),_0x2b131d[_0x47db81[_0x479a('0x61')][_0x479a('0xa5')]]);}else if(_0x47db81[_0x479a('0x61')][_0x479a('0xfb')]){_0x355e49=util['format']('SIP/%s',_0x47db81['body'][_0x479a('0xfb')]);}else{_0x355e49=util[_0x479a('0xae')]('SIP/%s',_0x2b131d[_0x479a('0x3b')]);}socket['to'](util[_0x479a('0xae')](_0x479a('0xfc'),_0x2b131d[_0x479a('0x3b')]))['emit'](_0x479a('0xfd'),{'user':{'id':_0x2b131d['id'],'name':_0x2b131d[_0x479a('0x3b')]},'ip':_0x47db81[_0x479a('0xfe')][_0x479a('0xff')]||_0x47db81[_0x479a('0x100')][_0x479a('0x101')]||_0x47db81['socket'][_0x479a('0x101')]||_0x47db81[_0x479a('0x100')][_0x479a('0x102')][_0x479a('0x101')]});return db[_0x479a('0xb9')]['destroy']({'where':{'membername':_0x2b131d[_0x479a('0x3b')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x479a('0x96'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x2b131d){return _0x2b131d['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x2fda50){if(_0x2b131d){if(_0x2fda50){_0x129760=_0x2fda50;if(_0x129760['length']){var _0x1805aa=_0x129760[_0x479a('0x35')](function(_0x187335){var _0x33ad68={'membername':_0x2b131d[_0x479a('0x3b')],'UserId':_0x2b131d['id'],'queue_name':_0x187335['name'],'VoiceQueueId':_0x187335['id'],'interface':_0x355e49,'paused':_0x2b131d['loginInPause']||![],'penalty':_0x187335[_0x479a('0x103')]||0x0};return db[_0x479a('0xb9')][_0x479a('0xb2')](_0x33ad68);});return Promise['all'](_0x1805aa);}}}})[_0x479a('0x22')](function(){if(_0x2b131d){return db[_0x479a('0x104')][_0x479a('0x50')]({'where':{'membername':_0x2b131d[_0x479a('0x3b')],'exitAt':null}});}})[_0x479a('0x22')](function(_0x8ef2dd){if(_0x2b131d){var _0x2452e8=[];_0x8ef2dd['forEach'](function(_0x1a4e15){_0x2452e8[_0x479a('0x4f')](_0x1a4e15[_0x479a('0x2b')]({'exitAt':moment()['format'](_0x479a('0x105'))}));});return Promise[_0x479a('0x59')](_0x2452e8);}})[_0x479a('0x22')](function(){if(_0x2b131d){var _0x46bbe1=[];var _0x25c9c0=[];var _0xd50f5e=utils[_0x479a('0x106')]();var _0x4e69a3={'membername':_0x2b131d['name'],'interface':_0x355e49,'enterAt':moment()[_0x479a('0xae')](_0x479a('0x105')),'role':_0x2b131d[_0x479a('0x2c')],'internal':_0x2b131d['internal']};_0xd50f5e[_0x479a('0x107')](function(_0x4a0ecc){_0x46bbe1[_0x479a('0x4f')](_[_0x479a('0x5d')]({'channel':_0x4a0ecc,'type':_0x479a('0x108'),'data1':_0x47db81[_0x479a('0x61')][_0x479a('0x109')],'data2':_0x355e49},_0x4e69a3));if(_0x2b131d[_0x479a('0xa4')]){_0x25c9c0['push'](_[_0x479a('0x5d')]({'channel':_0x4a0ecc,'type':_0x479a('0x10a'),'data1':_0x479a('0x10b')},_0x4e69a3));}});return db[_0x479a('0x104')][_0x479a('0x10c')](_0x46bbe1[_0x479a('0xd1')](_0x25c9c0),{'individualHooks':!![]});}})[_0x479a('0x22')](function(){if(_0x2b131d){return _0x2b131d[_0x479a('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x479a('0xae')](_0x479a('0x105')),'voicePause':_0x2b131d[_0x479a('0xa4')]||![],'mailPause':_0x2b131d[_0x479a('0xa4')]||![],'chatPause':_0x2b131d['loginInPause']||![],'faxPause':_0x2b131d[_0x479a('0xa4')]||![],'smsPause':_0x2b131d[_0x479a('0xa4')]||![],'openchannelPause':_0x2b131d[_0x479a('0xa4')]||![],'whatsappPause':_0x2b131d['loginInPause']||![],'pauseType':_0x2b131d[_0x479a('0xa4')]?_0x479a('0x10b'):null,'interface':_0x355e49,'lastPauseAt':moment()[_0x479a('0xae')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x479a('0x22')](function(_0x29a270){if(_0x47db81[_0x479a('0x10d')]){return _0x4cd56c();}else{return Promise['resolve'](_0x29a270)[_0x479a('0x22')](respondWithResult(_0x3533d1,null));}})['catch'](handleError(_0x3533d1,null));};exports[_0x479a('0x10e')]=function(_0x426b0a,_0x15e7ee){var _0x595f9a;return db[_0x479a('0x3d')][_0x479a('0x38')]({'where':{'id':_0x426b0a['params']['id'],'role':_0x479a('0x2d')},'attributes':['id',_0x479a('0x3b'),_0x479a('0x2c')]})[_0x479a('0x22')](handleEntityNotFound(_0x15e7ee,null))['then'](function(_0x54f0e9){if(_0x54f0e9){_0x595f9a=_0x54f0e9;return db[_0x479a('0xb9')][_0x479a('0xba')]({'where':{'membername':_0x595f9a[_0x479a('0x3b')]},'individualHooks':!![]});}})['then'](function(){return db[_0x479a('0x104')]['findAll']({'where':{'membername':_0x595f9a[_0x479a('0x3b')],'exitAt':null}});})['then'](function(_0x371e57){var _0x1ef5a1=[];_0x371e57[_0x479a('0x107')](function(_0x160595){_0x1ef5a1['push'](_0x160595[_0x479a('0x2b')]({'exitAt':moment()[_0x479a('0xae')](_0x479a('0x105'))}));});return Promise['all'](_0x1ef5a1);})[_0x479a('0x22')](function(){return _0x595f9a[_0x479a('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x479a('0x22')](respondWithResult(_0x15e7ee,null))[_0x479a('0x5a')](handleError(_0x15e7ee,null));};exports[_0x479a('0x10f')]=function(_0x8d64e5,_0x4deb3c){var _0x3c3338;return db[_0x479a('0xb9')][_0x479a('0x2b')]({'paused':0x1},{'where':{'UserId':_0x8d64e5[_0x479a('0x5c')]['id']},'individualHooks':!![]})[_0x479a('0x22')](function(){return db['User'][_0x479a('0x38')]({'where':{'id':_0x8d64e5['params']['id'],'role':'agent'},'attributes':['id','name',_0x479a('0x2c'),_0x479a('0x66'),_0x479a('0xa5'),'online']});})[_0x479a('0x22')](handleEntityNotFound(_0x4deb3c,null))[_0x479a('0x22')](function(_0x1101db){if(_0x1101db){_0x3c3338=_0x1101db;return respondWithRpcPromise('QueuePause',_0x479a('0x10f'),{'id':_0x3c3338['id'],'name':_0x3c3338[_0x479a('0x3b')],'pause':!![]});}})[_0x479a('0x22')](function(){if(_0x3c3338){return db['MemberReport'][_0x479a('0x50')]({'where':{'membername':_0x3c3338[_0x479a('0x3b')],'type':'PAUSE','exitAt':null}});}})[_0x479a('0x22')](function(_0x48a457){if(_0x48a457['length']){var _0x322f28=moment()[_0x479a('0xae')](_0x479a('0x105'));for(var _0x34b021=0x0,_0x1cd788=_0x48a457[_0x479a('0x53')];_0x34b021<_0x1cd788;_0x34b021++){_0x48a457[_0x34b021][_0x479a('0x110')]({'exitAt':_0x322f28});}}})[_0x479a('0x22')](function(){var _0x3f93dd=[];var _0xeff1b6=utils[_0x479a('0x106')]();_0xeff1b6[_0x479a('0x107')](function(_0x58b3b0){_0x3f93dd[_0x479a('0x4f')]({'channel':_0x58b3b0,'membername':_0x3c3338[_0x479a('0x3b')],'interface':_[_0x479a('0x6b')](_0x3c3338['interface'])?util[_0x479a('0xae')]('SIP/%s',_0x3c3338['name']):_0x3c3338[_0x479a('0xa5')],'type':'PAUSE','enterAt':moment()['format'](_0x479a('0x105')),'data1':_0x8d64e5[_0x479a('0x61')]['type']||_0x479a('0x111'),'role':_0x3c3338['role'],'internal':_0x3c3338[_0x479a('0x66')]});});return db[_0x479a('0x104')][_0x479a('0x10c')](_0x3f93dd,{'individualHooks':!![]});})[_0x479a('0x22')](function(){return _0x3c3338[_0x479a('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x8d64e5[_0x479a('0x61')]['type']||_0x479a('0x111'),'lastPauseAt':moment()['format'](_0x479a('0x105'))});})[_0x479a('0x22')](respondWithResult(_0x4deb3c,null))[_0x479a('0x5a')](handleError(_0x4deb3c,null));};exports['unpause']=function(_0x46ec6e,_0xcb1889){if(_0x46ec6e[_0x479a('0x61')][_0x479a('0xa2')]&&!utils['isValidChannel'](_0x46ec6e[_0x479a('0x61')][_0x479a('0xa2')])){throw new APIBadRequestError(util[_0x479a('0xae')](_0x479a('0x112'),_0x46ec6e[_0x479a('0x61')][_0x479a('0xa2')]));}return db['User'][_0x479a('0x38')]({'where':{'id':_0x46ec6e[_0x479a('0x5c')]['id']},'attributes':['id',_0x479a('0x3b'),_0x479a('0x2c'),'internal','interface',_0x479a('0xa3'),_0x479a('0xb0'),_0x479a('0x113'),_0x479a('0x114'),_0x479a('0x115'),_0x479a('0x116'),_0x479a('0x117'),'whatsappPause',_0x479a('0x118'),_0x479a('0x119')]})[_0x479a('0x22')](function(_0x5676d9){if(!_0x5676d9){throw new APINotFoundError(util[_0x479a('0xae')](_0x479a('0xd3'),_0x46ec6e[_0x479a('0x5c')]['id']));}return _0x5676d9[_0x479a('0x11a')](_0x46ec6e[_0x479a('0x61')][_0x479a('0xa2')]);})[_0x479a('0x22')](respondWithResult(_0xcb1889,null))[_0x479a('0x5a')](APIHandleError(_0xcb1889));};exports[_0x479a('0x11b')]=function(_0x38bb30,_0x493bc0){var _0x2cc8e0={};var _0x3f5d38={};var _0x3c64b9;var _0x46d452;return db['User'][_0x479a('0x9d')]({'where':{'id':_0x38bb30[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x493bc0,null))[_0x479a('0x22')](function(_0x26147f){if(_0x26147f){_0x3c64b9=_0x26147f;_0x3f5d38[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0x11c')][_0x479a('0x3e')]);_0x3f5d38[_0x479a('0x48')]=_[_0x479a('0xda')](_0x38bb30[_0x479a('0x48')]);_0x3f5d38[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x3f5d38[_0x479a('0xd9')],_0x3f5d38['query']);_0x2cc8e0[_0x479a('0x4e')]=_[_0x479a('0xdd')](_0x3f5d38[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x38bb30[_0x479a('0x48')][_0x479a('0xe3')]));_0x2cc8e0[_0x479a('0x4e')]=_0x2cc8e0[_0x479a('0x4e')][_0x479a('0x53')]?_0x2cc8e0[_0x479a('0x4e')]:_0x3f5d38[_0x479a('0xd9')];_0x2cc8e0['order']=qs[_0x479a('0xdf')](_0x38bb30[_0x479a('0x48')][_0x479a('0xdf')]);_0x2cc8e0['where']=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x38bb30[_0x479a('0x48')],_0x3f5d38['filters']));if(_0x38bb30[_0x479a('0x48')][_0x479a('0xe0')]){_0x2cc8e0[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x2cc8e0['where'],{'$or':_[_0x479a('0x35')](_0x2cc8e0[_0x479a('0x4e')],function(_0x2c3b45){var _0x3f27e3={};_0x3f27e3[_0x2c3b45]={'$like':'%'+_0x38bb30['query'][_0x479a('0xe0')]+'%'};return _0x3f27e3;})});}_0x2cc8e0=_['merge']({},_0x2cc8e0,_0x38bb30[_0x479a('0x5e')]);return _0x3c64b9[_0x479a('0x11b')](_0x2cc8e0);}})[_0x479a('0x22')](function(_0x148620){if(_0x148620){_0x46d452=_0x148620[_0x479a('0x53')];if(!_0x38bb30[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x2cc8e0[_0x479a('0x1b')]=qs[_0x479a('0x1b')](_0x38bb30[_0x479a('0x48')][_0x479a('0x1b')]);_0x2cc8e0[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x38bb30[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x3c64b9[_0x479a('0x11b')](_0x2cc8e0);}})[_0x479a('0x22')](function(_0xa222d2){if(_0xa222d2){return _0xa222d2?{'count':_0x46d452,'rows':_0xa222d2}:null;}})[_0x479a('0x22')](respondWithResult(_0x493bc0,null))['catch'](handleError(_0x493bc0,null));};exports[_0x479a('0x11d')]=function(_0x3d6570,_0x380b98){var _0x278b27=_0x3d6570[_0x479a('0x5c')]['id'];var _0x555c1b=_0x3d6570['body']?_0x3d6570[_0x479a('0x61')][_0x479a('0x64')]:null;var _0x51c6ed=[];return Promise[_0x479a('0x11e')]()['then'](function(){if(!_0x555c1b)throw new APIBadRequestError(_0x479a('0x11f'));})['then'](function(){return db[_0x479a('0x3d')]['findOne']({'where':{'id':_0x278b27}});})[_0x479a('0x22')](function(_0x3678ad){if(!_0x3678ad)throw new APINotFoundError(util[_0x479a('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3d6570[_0x479a('0x5c')]['id']));return db[_0x479a('0x6d')][_0x479a('0x120')](function(_0x458354){return _0x3678ad[_0x479a('0x11d')](_0x555c1b,{'transaction':_0x458354})['then'](function(){return db[_0x479a('0x11c')][_0x479a('0x50')]({'where':{'id':{'$in':_0x555c1b}}});})[_0x479a('0x22')](function(_0x19415f){var _0x113376=_[_0x479a('0x35')](_0x19415f,function(_0x9df9a9){return _0x9df9a9[_0x479a('0x121')]();});return Promise['all'](_0x113376);})['then'](function(_0xc96605){_0x51c6ed=_[_0x479a('0x122')](_0xc96605);var _0x53d295=_[_0x479a('0x35')](_0x51c6ed,function(_0x280edb){return _0x280edb[_0x479a('0x123')](_0x3678ad['id'],{'transaction':_0x458354});});return Promise[_0x479a('0x59')](_0x53d295);})[_0x479a('0x22')](function(){if(!_0x3678ad['online'])return;var _0x30bd26=_[_0x479a('0xe0')](_0x51c6ed,function(_0x3749de){return _0x3749de['getDataValue'](_0x479a('0xa2'))===_0x479a('0x124');});var _0x853355=_[_0x479a('0x35')](_0x30bd26,function(_0x33f439){return db[_0x479a('0xb9')][_0x479a('0xb2')]({'membername':_0x3678ad[_0x479a('0x3b')],'UserId':_0x3678ad['id'],'queue_name':_0x33f439[_0x479a('0x3b')],'VoiceQueueId':_0x33f439['id'],'interface':_[_0x479a('0x6b')](_0x3678ad[_0x479a('0xa5')])?util[_0x479a('0xae')](_0x479a('0xaf'),_0x3678ad[_0x479a('0x3b')]):_0x3678ad['interface'],'paused':_0x3678ad[_0x479a('0xb0')]||![],'penalty':_0x3678ad[_0x479a('0xb1')]},{'transaction':_0x458354});});return Promise['all'](_0x853355);})[_0x479a('0x22')](function(){return db[_0x479a('0x125')]['findAll']({'where':{'teamId':{'$in':_0x555c1b}}});})[_0x479a('0x22')](function(_0x387642){var _0x452083=_[_0x479a('0x35')](_0x387642,function(_0x52eee1){return db[_0x479a('0x126')][_0x479a('0x84')]({'UserId':_0x3678ad['id'],'VoicePrefixId':_0x52eee1['VoicePrefixId']},{'transaction':_0x458354});});return Promise[_0x479a('0x59')](_0x452083);});});})['then'](function(){for(var _0x48c820=0x0;_0x48c820<_0x51c6ed[_0x479a('0x53')];_0x48c820++){var _0x102ab5=_0x51c6ed[_0x48c820]['getDataValue'](_0x479a('0xa2'));var _0xf0b425=_0x102ab5+_0x479a('0xb7');socket[_0x479a('0x2e')](_0x479a('0x31')+_0x102ab5+_0x479a('0xac'),{'UserId':_0x278b27,['queueField']:_0x51c6ed[_0x48c820]['id']});}})[_0x479a('0x22')](respondWithStatusCode(_0x380b98,null))[_0x479a('0x5a')](APIHandleError(_0x380b98));};exports[_0x479a('0x127')]=function(_0x51eccf,_0x35d46b){var _0x3d21b7=_0x51eccf['params']['id'];var _0x5a351a=null;if(_0x51eccf[_0x479a('0x48')][_0x479a('0x64')]){_0x5a351a=_[_0x479a('0xb6')](_0x51eccf[_0x479a('0x48')][_0x479a('0x64')])?_0x51eccf[_0x479a('0x48')][_0x479a('0x64')]:[_0x51eccf[_0x479a('0x48')][_0x479a('0x64')]];}var _0x3c50ae=[];return Promise[_0x479a('0x11e')]()[_0x479a('0x22')](function(){if(!_0x5a351a)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x479a('0x22')](function(){return db['User'][_0x479a('0x9d')]({'where':{'id':_0x3d21b7}});})[_0x479a('0x22')](function(_0x4f6373){if(!_0x4f6373)throw new APINotFoundError(util[_0x479a('0xae')](_0x479a('0xd3'),_0x51eccf['params']['id']));return db[_0x479a('0x6d')][_0x479a('0x120')](function(_0x4f4dbd){return _0x4f6373['removeTeams'](_0x5a351a,{'transaction':_0x4f4dbd})['then'](function(){return db[_0x479a('0x11c')][_0x479a('0x50')]({'where':{'id':{'$in':_0x5a351a}}});})['then'](function(_0x26078f){var _0x37716=_[_0x479a('0x35')](_0x26078f,function(_0xc87831){return _0xc87831[_0x479a('0x121')]();});return Promise[_0x479a('0x59')](_0x37716);})[_0x479a('0x22')](function(_0x49863a){_0x3c50ae=_['flattenDeep'](_0x49863a);var _0x1cdbec=_['map'](_0x3c50ae,function(_0xde660d){return _0xde660d[_0x479a('0x128')](_0x4f6373['id'],{'transaction':_0x4f4dbd});});return Promise['all'](_0x1cdbec);})[_0x479a('0x22')](function(){if(!_0x4f6373[_0x479a('0xa3')])return;var _0xe36c58=_[_0x479a('0xe0')](_0x3c50ae,function(_0x4d597b){return _0x4d597b[_0x479a('0x129')](_0x479a('0xa2'))===_0x479a('0x124');});var _0x4f56cb=_[_0x479a('0x35')](_0xe36c58,function(_0x56b8d5){return db['UserVoiceQueueRt'][_0x479a('0xba')]({'where':{'VoiceQueueId':_0x56b8d5['id'],'UserId':_0x4f6373['id']},'transaction':_0x4f4dbd});});return Promise[_0x479a('0x59')](_0x4f56cb);})[_0x479a('0x22')](function(){return db['TeamVoicePrefix'][_0x479a('0x50')]({'where':{'teamId':{'$in':_0x5a351a}}});})['then'](function(_0x211289){var _0xef602=_[_0x479a('0x35')](_0x211289,function(_0x503927){return db['UserVoicePrefix'][_0x479a('0xba')]({'where':{'UserId':_0x4f6373['id'],'VoicePrefixId':_0x503927[_0x479a('0x12a')]}},{'transaction':_0x4f4dbd});});return Promise[_0x479a('0x59')](_0xef602);});});})['then'](function(){for(var _0x17542c=0x0;_0x17542c<_0x3c50ae[_0x479a('0x53')];_0x17542c++){var _0x43ebf=_0x3c50ae[_0x17542c][_0x479a('0x129')]('channel');var _0x38b446=_0x43ebf+'QueueId';socket['emit'](_0x479a('0x31')+_0x43ebf+_0x479a('0xb8'),{'UserId':_0x3d21b7,['queueField']:_0x3c50ae[_0x17542c]['id']});}})[_0x479a('0x22')](respondWithStatusCode(_0x35d46b,null))[_0x479a('0x5a')](APIHandleError(_0x35d46b));};exports[_0x479a('0x12b')]=function(_0x339b73,_0x5eb204){var _0x2fdbe8={};var _0x3d6791={};var _0x598b3a;var _0x2140fe;return db['User']['findOne']({'where':{'id':_0x339b73[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x5eb204,null))[_0x479a('0x22')](function(_0x52dcd5){if(_0x52dcd5){_0x598b3a=_0x52dcd5;_0x3d6791[_0x479a('0xd9')]=_[_0x479a('0xda')](db[_0x479a('0xd4')][_0x479a('0x3e')]);_0x3d6791[_0x479a('0x48')]=_[_0x479a('0xda')](_0x339b73[_0x479a('0x48')]);_0x3d6791[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x3d6791[_0x479a('0xd9')],_0x3d6791['query']);_0x2fdbe8[_0x479a('0x4e')]=_['intersection'](_0x3d6791['model'],qs[_0x479a('0xe3')](_0x339b73[_0x479a('0x48')][_0x479a('0xe3')]));_0x2fdbe8[_0x479a('0x4e')]=_0x2fdbe8[_0x479a('0x4e')][_0x479a('0x53')]?_0x2fdbe8['attributes']:_0x3d6791['model'];_0x2fdbe8[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x339b73['query']['sort']);_0x2fdbe8['where']=qs[_0x479a('0xdc')](_[_0x479a('0xe4')](_0x339b73[_0x479a('0x48')],_0x3d6791['filters']));if(_0x339b73[_0x479a('0x48')][_0x479a('0xe0')]){_0x2fdbe8[_0x479a('0x47')]=_[_0x479a('0x5d')](_0x2fdbe8[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x2fdbe8['attributes'],function(_0xe3b429){var _0x403284={};_0x403284[_0xe3b429]={'$like':'%'+_0x339b73[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x403284;})});}_0x2fdbe8=_['merge']({},_0x2fdbe8,_0x339b73[_0x479a('0x5e')]);return _0x598b3a[_0x479a('0x12b')](_0x2fdbe8);}})[_0x479a('0x22')](function(_0x2b531b){if(_0x2b531b){_0x2140fe=_0x2b531b['length'];if(!_0x339b73[_0x479a('0x48')][_0x479a('0xe2')](_0x479a('0xe6'))){_0x2fdbe8['limit']=qs[_0x479a('0x1b')](_0x339b73[_0x479a('0x48')][_0x479a('0x1b')]);_0x2fdbe8[_0x479a('0x1a')]=qs[_0x479a('0x1a')](_0x339b73[_0x479a('0x48')][_0x479a('0x1a')]);}return _0x598b3a[_0x479a('0x12b')](_0x2fdbe8);}})['then'](function(_0x185343){if(_0x185343){return _0x185343?{'count':_0x2140fe,'rows':_0x185343}:null;}})[_0x479a('0x22')](respondWithResult(_0x5eb204,null))[_0x479a('0x5a')](handleError(_0x5eb204,null));};exports['getAgents']=function(_0x1e724b,_0x51a541){var _0x381e61={};var _0x46944e={};var _0x5dd561;return db[_0x479a('0x3d')]['findOne']({'where':{'id':_0x1e724b[_0x479a('0x5c')]['id']}})[_0x479a('0x22')](handleEntityNotFound(_0x51a541,null))[_0x479a('0x22')](function(_0x545281){if(_0x545281){_0x5dd561=_0x545281;_0x46944e[_0x479a('0xd9')]=_[_0x479a('0xda')](db['User']['rawAttributes']);_0x46944e[_0x479a('0x48')]=_['keys'](_0x1e724b['query']);_0x46944e[_0x479a('0xdc')]=_[_0x479a('0xdd')](_0x46944e[_0x479a('0xd9')],_0x46944e[_0x479a('0x48')]);_0x381e61['attributes']=_[_0x479a('0xdd')](_0x46944e[_0x479a('0xd9')],qs[_0x479a('0xe3')](_0x1e724b[_0x479a('0x48')][_0x479a('0xe3')]));_0x381e61['attributes']=_0x381e61[_0x479a('0x4e')][_0x479a('0x53')]?_0x381e61[_0x479a('0x4e')]:_0x46944e['model'];_0x381e61[_0x479a('0xde')]=qs[_0x479a('0xdf')](_0x1e724b[_0x479a('0x48')]['sort']);_0x381e61[_0x479a('0x47')]=qs[_0x479a('0xdc')](_['pick'](_0x1e724b['query'],_0x46944e[_0x479a('0xdc')]));if(_0x1e724b[_0x479a('0x48')][_0x479a('0xe0')]){_0x381e61[_0x479a('0x47')]=_['merge'](_0x381e61[_0x479a('0x47')],{'$or':_[_0x479a('0x35')](_0x381e61[_0x479a('0x4e')],function(_0x5afff2){var _0x17f9dd={};_0x17f9dd[_0x5afff2]={'$like':'%'+_0x1e724b[_0x479a('0x48')][_0x479a('0xe0')]+'%'};return _0x17f9dd;})});}_0x381e61[_0x479a('0xd9')]=db['User'];_0x381e61['as']=_0x479a('0x8c');_0x381e61=_[_0x479a('0x5d')]({},_0x381e61,_0x1e724b['options']);return _0x5dd561['getVoiceQueues']({'include':[_0x381e61]});}})[_0x479a('0x22')](function(_0x3774c1){if(_0x3774c1){var _0x4a31d0={},_0x20ef23=[];for(var _0x5a3902=0x0;_0x5a3902<_0x3774c1[_0x479a('0x53')];_0x5a3902+=0x1){for(var _0x24b4fe=0x0,_0x1db282;_0x24b4fe<_0x3774c1[_0x5a3902][_0x479a('0x8c')]['length'];_0x24b4fe+=0x1){_0x1db282=_0x3774c1[_0x5a3902][_0x479a('0x8c')][_0x24b4fe][_0x479a('0x2f')]({'plain':!![]});_0x4a31d0[_0x1db282['id']]=_0x1db282;}}_0x4a31d0=_['values'](_0x4a31d0);for(var _0x202a66=qs[_0x479a('0x1a')](_0x1e724b[_0x479a('0x48')][_0x479a('0x1a')]);_0x202a66<_0x4a31d0[_0x479a('0x53')]&&_0x20ef23[_0x479a('0x53')]=_0x3dec9c[_0x19f1('0x4d')]){throw new Error(_0x19f1('0x4e'));}})[_0x19f1('0x1b')](function(){if(_0x1e933c){return db[_0x19f1('0x22')][_0x19f1('0x4f')]({'where':{'membername':_0x1e933c[_0x19f1('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x1e933c){return _0x1e933c[_0x19f1('0x50')]({'raw':!![]});}})[_0x19f1('0x1b')](function(_0x407298){if(_0x1e933c){if(_0x407298){var _0x4ef71c=[];_0x36db29=_0x407298;if(_0x36db29['length']){for(var _0x517a2a=0x0;_0x517a2a<_0x36db29['length'];_0x517a2a++){_0x4ef71c[_0x19f1('0x46')](db[_0x19f1('0x22')][_0x19f1('0x51')]({'membername':_0x1e933c[_0x19f1('0x25')],'UserId':_0x1e933c['id'],'queue_name':_0x36db29[_0x517a2a]['name'],'VoiceQueueId':_0x36db29[_0x517a2a]['id'],'interface':_0x5a67c6,'paused':_0x1e933c[_0x19f1('0x49')]||![],'penalty':_0x36db29[_0x517a2a][_0x19f1('0x52')]||0x0}));}return BPromise[_0x19f1('0x47')](_0x4ef71c);}}}})[_0x19f1('0x1b')](function(){if(_0x1e933c){return db[_0x19f1('0x24')][_0x19f1('0xc')]({'where':{'membername':_0x1e933c['name'],'exitAt':null}});}})[_0x19f1('0x1b')](function(_0x2b878f){if(_0x1e933c){if(_0x2b878f&&_0x2b878f[_0x19f1('0x27')]){var _0x347147=[];_0x2b878f[_0x19f1('0x45')](function(_0x47052b){_0x347147[_0x19f1('0x46')](_0x47052b[_0x19f1('0x23')]({'exitAt':moment()[_0x19f1('0x20')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x19f1('0x47')](_0x347147);}}})[_0x19f1('0x1b')](function(){if(_0x1e933c){var _0x58667d=[];var _0x10613b=[];var _0x481679=utils[_0x19f1('0x2a')]();var _0x403465={'membername':_0x1e933c[_0x19f1('0x25')],'interface':_0x5a67c6,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1e933c[_0x19f1('0x1e')],'internal':_0x1e933c[_0x19f1('0x30')]};_0x481679['forEach'](function(_0x1f35e8){_0x58667d[_0x19f1('0x46')](_[_0x19f1('0x53')]({'channel':_0x1f35e8,'type':'LOGIN','data1':_0x19f1('0x54'),'data2':_0x5a67c6},_0x403465));if(_0x1e933c[_0x19f1('0x49')]){_0x10613b[_0x19f1('0x46')](_['merge']({'channel':_0x1f35e8,'type':_0x19f1('0x26'),'data1':'LOGININPAUSE'},_0x403465));}});return db[_0x19f1('0x24')][_0x19f1('0x32')](_0x58667d[_0x19f1('0x55')](_0x10613b),{'individualHooks':!![]});}})['then'](function(){if(_0x1e933c){return _0x1e933c[_0x19f1('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0x19f1('0x28')),'voicePause':_0x1e933c[_0x19f1('0x49')]||![],'mailPause':_0x1e933c[_0x19f1('0x49')]||![],'chatPause':_0x1e933c['loginInPause']||![],'faxPause':_0x1e933c['loginInPause']||![],'smsPause':_0x1e933c['loginInPause']||![],'openchannelPause':_0x1e933c[_0x19f1('0x49')]||![],'pauseType':_0x1e933c[_0x19f1('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x19f1('0x20')](_0x19f1('0x28')),'interface':_0x5a67c6});}})[_0x19f1('0x1b')](function(_0x580221){_0x330181(_0x580221);})['catch'](function(_0x3fab7b){_0x2042d2(_0xe6641a[_0x19f1('0x19')](0x1f4,_0x3fab7b[_0x19f1('0x1c')]));});});}; \ No newline at end of file +var _0x1156=['raw','where','attributes','limit','include','map','model','then','info','debug','catch','error','message','ShowUser','find','stringify','PauseUser','role','internal','interface','format','params','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','updateAttributes','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','whatsappPause','lastPauseAt','unpause','LogoutUser','destroy','YYYY-MM-DD\x20HH:mm:ss','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','getChannels','callysquare','merge','LOGININPAUSE','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','GetUser','User','findAll','options'];(function(_0x2f5d3f,_0x29f360){var _0x604927=function(_0xf3e88c){while(--_0xf3e88c){_0x2f5d3f['push'](_0x2f5d3f['shift']());}};_0x604927(++_0x29f360);}(_0x1156,0x99));var _0x6115=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1156[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x6115('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6115('0x1'));var Redis=require('ioredis');var db=require(_0x6115('0x2'))['db'];var utils=require(_0x6115('0x3'));var logger=require(_0x6115('0x4'))(_0x6115('0x5'));var config=require(_0x6115('0x6'));config[_0x6115('0x7')]=_['defaults'](config[_0x6115('0x7')],{'host':_0x6115('0x8'),'port':0x18eb});var socket=require(_0x6115('0x9'))(new Redis(config[_0x6115('0x7')]));require('./user.socket')[_0x6115('0xa')](socket);exports[_0x6115('0xb')]=function(_0x4b83c8){var _0x3c93d3=this;return new Promise(function(_0x79ac0c,_0x39afd2){return db[_0x6115('0xc')][_0x6115('0xd')]({'raw':_0x4b83c8['options']?_0x4b83c8[_0x6115('0xe')][_0x6115('0xf')]===undefined?!![]:![]:!![],'where':_0x4b83c8[_0x6115('0xe')]?_0x4b83c8['options'][_0x6115('0x10')]||null:null,'attributes':_0x4b83c8[_0x6115('0xe')]?_0x4b83c8[_0x6115('0xe')][_0x6115('0x11')]||null:null,'limit':_0x4b83c8[_0x6115('0xe')]?_0x4b83c8['options'][_0x6115('0x12')]||null:null,'include':_0x4b83c8[_0x6115('0xe')]?_0x4b83c8[_0x6115('0xe')][_0x6115('0x13')]?_[_0x6115('0x14')](_0x4b83c8['options'][_0x6115('0x13')],function(_0xe4c6a4){return{'model':db[_0xe4c6a4[_0x6115('0x15')]],'as':_0xe4c6a4['as'],'attributes':_0xe4c6a4[_0x6115('0x11')],'include':_0xe4c6a4[_0x6115('0x13')]?_[_0x6115('0x14')](_0xe4c6a4['include'],function(_0x14d948){return{'model':db[_0x14d948[_0x6115('0x15')]],'as':_0x14d948['as'],'attributes':_0x14d948[_0x6115('0x11')],'include':_0x14d948[_0x6115('0x13')]?_[_0x6115('0x14')](_0x14d948[_0x6115('0x13')],function(_0x4ad6ac){return{'model':db[_0x4ad6ac[_0x6115('0x15')]],'as':_0x4ad6ac['as'],'attributes':_0x4ad6ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x6115('0x16')](function(_0x210eb8){logger[_0x6115('0x17')](_0x6115('0xb'),_0x4b83c8);logger[_0x6115('0x18')](_0x6115('0xb'),_0x4b83c8,JSON['stringify'](_0x210eb8));_0x79ac0c(_0x210eb8);})[_0x6115('0x19')](function(_0x4a01f6){logger[_0x6115('0x1a')](_0x6115('0xb'),_0x4a01f6['message'],_0x4b83c8);_0x39afd2(_0x3c93d3[_0x6115('0x1a')](0x1f4,_0x4a01f6[_0x6115('0x1b')]));});});};exports[_0x6115('0x1c')]=function(_0x351222){var _0x58034f=this;return new Promise(function(_0x357aba,_0x3e6cf8){return db['User'][_0x6115('0x1d')]({'raw':_0x351222[_0x6115('0xe')]?_0x351222[_0x6115('0xe')][_0x6115('0xf')]===undefined?!![]:![]:!![],'where':_0x351222['options']?_0x351222[_0x6115('0xe')][_0x6115('0x10')]||null:null,'attributes':_0x351222['options']?_0x351222[_0x6115('0xe')][_0x6115('0x11')]||null:null,'include':_0x351222['options']?_0x351222[_0x6115('0xe')][_0x6115('0x13')]?_[_0x6115('0x14')](_0x351222[_0x6115('0xe')][_0x6115('0x13')],function(_0xd1b670){return{'model':db[_0xd1b670['model']],'as':_0xd1b670['as'],'attributes':_0xd1b670[_0x6115('0x11')],'include':_0xd1b670['include']?_['map'](_0xd1b670[_0x6115('0x13')],function(_0x345024){return{'model':db[_0x345024['model']],'as':_0x345024['as'],'attributes':_0x345024[_0x6115('0x11')],'include':_0x345024[_0x6115('0x13')]?_[_0x6115('0x14')](_0x345024[_0x6115('0x13')],function(_0x208ac7){return{'model':db[_0x208ac7[_0x6115('0x15')]],'as':_0x208ac7['as'],'attributes':_0x208ac7['attributes']};}):[]};}):[]};}):[]:[]})[_0x6115('0x16')](function(_0x194cf7){logger[_0x6115('0x17')](_0x6115('0x1c'),_0x351222);logger[_0x6115('0x18')]('ShowUser',_0x351222,JSON[_0x6115('0x1e')](_0x194cf7));_0x357aba(_0x194cf7);})[_0x6115('0x19')](function(_0x558a88){logger[_0x6115('0x1a')](_0x6115('0x1c'),_0x558a88[_0x6115('0x1b')],_0x351222);_0x3e6cf8(_0x58034f['error'](0x1f4,_0x558a88[_0x6115('0x1b')]));});});};exports[_0x6115('0x1f')]=function(_0x2e90f7){var _0x50856e;return db[_0x6115('0xc')][_0x6115('0x1d')]({'where':_0x2e90f7[_0x6115('0xe')][_0x6115('0x10')]||{},'attributes':['id','name',_0x6115('0x20'),_0x6115('0x21'),_0x6115('0x22')]})['then'](function(_0x4a3928){if(!_0x4a3928){throw new Error(util[_0x6115('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2e90f7[_0x6115('0x24')]['id']));}_0x50856e=_0x4a3928;return db[_0x6115('0x25')][_0x6115('0x26')]({'paused':0x1},{'where':{'UserId':_0x50856e['id']},'individualHooks':!![]});})[_0x6115('0x16')](function(){return db[_0x6115('0x27')][_0x6115('0xd')]({'where':{'membername':_0x50856e[_0x6115('0x28')],'type':_0x6115('0x29'),'exitAt':null}});})[_0x6115('0x16')](function(_0x4edaf9){if(_0x4edaf9&&_0x4edaf9['length']){var _0x1ce4ca=moment()[_0x6115('0x23')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x54c7f7=0x0,_0x107cb0=_0x4edaf9[_0x6115('0x2a')];_0x54c7f7<_0x107cb0;_0x54c7f7++){_0x4edaf9[_0x54c7f7][_0x6115('0x2b')]({'exitAt':_0x1ce4ca});}}})[_0x6115('0x16')](function(){var _0x128a6c=[];var _0x438501=utils['getChannels']();_0x438501[_0x6115('0x2c')](function(_0xdf1c76){_0x128a6c[_0x6115('0x2d')]({'channel':_0xdf1c76,'membername':_0x50856e[_0x6115('0x28')],'interface':_['isNil'](_0x50856e[_0x6115('0x22')])?util['format'](_0x6115('0x2e'),_0x50856e[_0x6115('0x28')]):_0x50856e[_0x6115('0x22')],'type':_0x6115('0x29'),'enterAt':moment()[_0x6115('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2e90f7[_0x6115('0x2f')][_0x6115('0x30')]||_0x6115('0x31'),'role':_0x50856e[_0x6115('0x20')],'internal':_0x50856e['internal'],'uniqueid':_0x2e90f7[_0x6115('0x2f')][_0x6115('0x32')]||null});});return db[_0x6115('0x27')][_0x6115('0x33')](_0x128a6c,{'individualHooks':!![]});})[_0x6115('0x16')](function(){return _0x50856e[_0x6115('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e90f7['body'][_0x6115('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x6115('0x23')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6115('0x19')](function(_0xff731){throw _0xff731;});};exports['UnpauseUser']=function(_0x42b388){return Promise[_0x6115('0x34')]()['then'](function(){if(_0x42b388['body'][_0x6115('0x35')]&&!utils[_0x6115('0x36')](_0x42b388['body'][_0x6115('0x35')])){throw new Error(util[_0x6115('0x23')](_0x6115('0x37'),_0x42b388[_0x6115('0x2f')][_0x6115('0x35')]));}return db[_0x6115('0xc')][_0x6115('0x38')]({'where':_0x42b388['options']['where']||{},'attributes':['id',_0x6115('0x28'),_0x6115('0x20'),_0x6115('0x21'),_0x6115('0x22'),_0x6115('0x39'),_0x6115('0x3a'),_0x6115('0x3b'),_0x6115('0x3c'),_0x6115('0x3d'),'openchannelPause','smsPause',_0x6115('0x3e'),'pauseType',_0x6115('0x3f')]});})[_0x6115('0x16')](function(_0x11beb5){if(!_0x11beb5){throw new Error(util[_0x6115('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x42b388[_0x6115('0x24')]['id']));}return _0x11beb5[_0x6115('0x40')](_0x42b388['body']['channel'],'system');})[_0x6115('0x19')](function(_0x4bca9d){throw _0x4bca9d;});};exports[_0x6115('0x41')]=function(_0x3ab1b1){var _0x175128=this;return new Promise(function(_0x570b03,_0x2250b2){var _0x315e50;return db[_0x6115('0xc')][_0x6115('0x38')]({'where':_0x3ab1b1[_0x6115('0xe')][_0x6115('0x10')]||{},'attributes':['id',_0x6115('0x28')]})[_0x6115('0x16')](function(_0x2c8bdf){if(_0x2c8bdf){_0x315e50=_0x2c8bdf;return db['UserVoiceQueueRt'][_0x6115('0x42')]({'where':{'membername':_0x315e50[_0x6115('0x28')]},'individualHooks':!![]});}})[_0x6115('0x16')](function(){if(_0x315e50){return db[_0x6115('0x27')]['findAll']({'where':{'membername':_0x315e50[_0x6115('0x28')],'exitAt':null}});}})[_0x6115('0x16')](function(_0x42d883){if(_0x315e50){if(_0x42d883&&_0x42d883[_0x6115('0x2a')]){var _0x329010=[];_0x42d883['forEach'](function(_0x7e5b1b){_0x329010[_0x6115('0x2d')](_0x7e5b1b[_0x6115('0x26')]({'exitAt':moment()['format'](_0x6115('0x43'))}));});return BPromise[_0x6115('0x44')](_0x329010);}}})[_0x6115('0x16')](function(){if(_0x315e50){return _0x315e50[_0x6115('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x94582a){_0x570b03(_0x94582a);})['catch'](function(_0x267981){_0x2250b2(_0x175128[_0x6115('0x1a')](0x1f4,_0x267981[_0x6115('0x1b')]));});});};exports[_0x6115('0x45')]=function(_0x1ea512){var _0x158be0=this;return new Promise(function(_0x1a0d19,_0x17b865){var _0x15aa7d;var _0x5c4011;var _0x1e6d8d;var _0x248a86;return db[_0x6115('0xc')]['findOne']({'where':_0x1ea512['options'][_0x6115('0x10')]||{},'attributes':['id',_0x6115('0x28'),_0x6115('0x20'),_0x6115('0x46'),_0x6115('0x47'),_0x6115('0x21'),_0x6115('0x48'),_0x6115('0x22')]})[_0x6115('0x16')](function(_0x20fc2b){if(_0x20fc2b){_0x15aa7d=_0x20fc2b;_0x248a86=_0x1ea512['body'][_0x6115('0x22')]?_0x1ea512[_0x6115('0x2f')]['interface']:util[_0x6115('0x23')]('SIP/%s',_0x15aa7d[_0x6115('0x28')]);return db[_0x6115('0xc')][_0x6115('0x49')]({'where':{'role':_0x6115('0x4a'),'online':!![],'id':{'$ne':_0x15aa7d['id']}}});}})['then'](function(_0x48f95a){if(_0x48f95a){_0x1e6d8d=_0x48f95a;return require(_0x6115('0x4b'))[_0x6115('0x4c')]();}})[_0x6115('0x16')](function(_0x456aad){if(_0x456aad&&_0x456aad['agents']&&_0x1e6d8d>=_0x456aad['agents']){throw new Error(_0x6115('0x4d'));}})[_0x6115('0x16')](function(){if(_0x15aa7d){return db[_0x6115('0x25')]['destroy']({'where':{'membername':_0x15aa7d['name']},'individualHooks':!![]});}})[_0x6115('0x16')](function(){if(_0x15aa7d){return _0x15aa7d[_0x6115('0x4e')]({'raw':!![]});}})[_0x6115('0x16')](function(_0x3aa805){if(_0x15aa7d){if(_0x3aa805){var _0x382d79=[];_0x5c4011=_0x3aa805;if(_0x5c4011[_0x6115('0x2a')]){for(var _0x828059=0x0;_0x828059<_0x5c4011[_0x6115('0x2a')];_0x828059++){_0x382d79['push'](db['UserVoiceQueueRt'][_0x6115('0x4f')]({'membername':_0x15aa7d[_0x6115('0x28')],'UserId':_0x15aa7d['id'],'queue_name':_0x5c4011[_0x828059][_0x6115('0x28')],'VoiceQueueId':_0x5c4011[_0x828059]['id'],'interface':_0x248a86,'paused':_0x15aa7d['loginInPause']||![],'penalty':_0x5c4011[_0x828059]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x6115('0x44')](_0x382d79);}}}})[_0x6115('0x16')](function(){if(_0x15aa7d){return db['MemberReport'][_0x6115('0xd')]({'where':{'membername':_0x15aa7d[_0x6115('0x28')],'exitAt':null}});}})[_0x6115('0x16')](function(_0x334624){if(_0x15aa7d){if(_0x334624&&_0x334624['length']){var _0x20e51=[];_0x334624[_0x6115('0x2c')](function(_0x2a64ae){_0x20e51[_0x6115('0x2d')](_0x2a64ae['update']({'exitAt':moment()[_0x6115('0x23')](_0x6115('0x43'))}));});return BPromise['all'](_0x20e51);}}})[_0x6115('0x16')](function(){if(_0x15aa7d){var _0x291049=[];var _0x14b806=[];var _0x281df6=utils[_0x6115('0x50')]();var _0x32f6c3={'membername':_0x15aa7d[_0x6115('0x28')],'interface':_0x248a86,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x15aa7d[_0x6115('0x20')],'internal':_0x15aa7d['internal']};_0x281df6[_0x6115('0x2c')](function(_0x4d2a6d){_0x291049['push'](_['merge']({'channel':_0x4d2a6d,'type':'LOGIN','data1':_0x6115('0x51'),'data2':_0x248a86},_0x32f6c3));if(_0x15aa7d[_0x6115('0x48')]){_0x14b806['push'](_[_0x6115('0x52')]({'channel':_0x4d2a6d,'type':_0x6115('0x29'),'data1':_0x6115('0x53')},_0x32f6c3));}});return db[_0x6115('0x27')][_0x6115('0x33')](_0x291049['concat'](_0x14b806),{'individualHooks':!![]});}})[_0x6115('0x16')](function(){if(_0x15aa7d){return _0x15aa7d['update']({'online':!![],'lastLoginAt':moment()[_0x6115('0x23')](_0x6115('0x43')),'voicePause':_0x15aa7d[_0x6115('0x48')]||![],'mailPause':_0x15aa7d['loginInPause']||![],'chatPause':_0x15aa7d[_0x6115('0x48')]||![],'faxPause':_0x15aa7d[_0x6115('0x48')]||![],'smsPause':_0x15aa7d[_0x6115('0x48')]||![],'openchannelPause':_0x15aa7d[_0x6115('0x48')]||![],'pauseType':_0x15aa7d['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x6115('0x43')),'interface':_0x248a86});}})[_0x6115('0x16')](function(_0x53bad0){_0x1a0d19(_0x53bad0);})['catch'](function(_0x45dbab){_0x17b865(_0x158be0[_0x6115('0x1a')](0x1f4,_0x45dbab[_0x6115('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 0b3a2e8..9b0d8b6 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 _0x1ea1=['emit','register','length','save','remove','update'];(function(_0x7374b1,_0x4ff7c8){var _0x130438=function(_0x2c7f00){while(--_0x2c7f00){_0x7374b1['push'](_0x7374b1['shift']());}};_0x130438(++_0x4ff7c8);}(_0x1ea1,0x18f));var _0x11ea=function(_0x17491f,_0x3e1d71){_0x17491f=_0x17491f-0x0;var _0x315d8d=_0x1ea1[_0x17491f];return _0x315d8d;};'use strict';var UserEvents=require('./user.events');var events=[_0x11ea('0x0'),_0x11ea('0x1'),_0x11ea('0x2')];function createListener(_0x1d881b,_0x33e712){return function(_0x159051){_0x33e712[_0x11ea('0x3')](_0x1d881b,_0x159051);};}function removeListener(_0x58db94,_0x18d11e){return function(){UserEvents['removeListener'](_0x58db94,_0x18d11e);};}exports[_0x11ea('0x4')]=function(_0x546183){for(var _0x4bb638=0x0,_0x1d6718=events[_0x11ea('0x5')];_0x4bb638<_0x1d6718;_0x4bb638++){var _0x5d5910=events[_0x4bb638];var _0x228ba9=createListener('user:'+_0x5d5910,_0x546183);UserEvents['on'](_0x5d5910,_0x228ba9);}}; \ No newline at end of file +var _0xeb34=['register','length','user:','save','remove','update','emit'];(function(_0x329d86,_0x3167a7){var _0x31cf36=function(_0x59dcaf){while(--_0x59dcaf){_0x329d86['push'](_0x329d86['shift']());}};_0x31cf36(++_0x3167a7);}(_0xeb34,0x1bc));var _0x4eb3=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0xeb34[_0x5c2cd5];return _0x5180e9;};'use strict';var UserEvents=require('./user.events');var events=[_0x4eb3('0x0'),_0x4eb3('0x1'),_0x4eb3('0x2')];function createListener(_0x504ca2,_0x4483be){return function(_0x2bdcaa){_0x4483be[_0x4eb3('0x3')](_0x504ca2,_0x2bdcaa);};}function removeListener(_0x4b5f06,_0x52091d){return function(){UserEvents['removeListener'](_0x4b5f06,_0x52091d);};}exports[_0x4eb3('0x4')]=function(_0x3ada8d){for(var _0x9cc2d2=0x0,_0x539be3=events[_0x4eb3('0x5')];_0x9cc2d2<_0x539be3;_0x9cc2d2++){var _0x35deda=events[_0x9cc2d2];var _0x139af1=createListener(_0x4eb3('0x6')+_0x35deda,_0x3ada8d);UserEvents['on'](_0x35deda,_0x139af1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1be48f4..81a8ae2 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x8935ce,_0x3621c3){var _0x1a422f=function(_0x35cb66){while(--_0x35cb66){_0x8935ce['push'](_0x8935ce['shift']());}};_0x1a422f(++_0x3621c3);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1a362a,_0x532d2e){var _0x1c6fc4=function(_0x57b081){while(--_0x57b081){_0x1a362a['push'](_0x1a362a['shift']());}};_0x1c6fc4(++_0x532d2e);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 40b3d38..a6dece8 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 _0xa80e=['sequelize','exports','INTEGER'];(function(_0x2ae564,_0x430361){var _0x4cb7b9=function(_0x1f3ef0){while(--_0x1f3ef0){_0x2ae564['push'](_0x2ae564['shift']());}};_0x4cb7b9(++_0x430361);}(_0xa80e,0x1a1));var _0xea80=function(_0x4e4566,_0x5b62dc){_0x4e4566=_0x4e4566-0x0;var _0x2875a2=_0xa80e[_0x4e4566];return _0x2875a2;};'use strict';var Sequelize=require(_0xea80('0x0'));module[_0xea80('0x1')]={'penalty':{'type':Sequelize[_0xea80('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff46=['exports','INTEGER','sequelize'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xff46,0xb3));var _0x6ff4=function(_0x27bd65,_0x5407b3){_0x27bd65=_0x27bd65-0x0;var _0x5dfef=_0xff46[_0x27bd65];return _0x5dfef;};'use strict';var Sequelize=require(_0x6ff4('0x0'));module[_0x6ff4('0x1')]={'penalty':{'type':Sequelize[_0x6ff4('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 d1ad10f..21cd466 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 _0xb63f=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues'];(function(_0x3ab313,_0x4d6b91){var _0x52e13f=function(_0x3e20e9){while(--_0x3e20e9){_0x3ab313['push'](_0x3ab313['shift']());}};_0x52e13f(++_0x4d6b91);}(_0xb63f,0x108));var _0xfb63=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xb63f[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0xfb63('0x0'));var util=require(_0xfb63('0x1'));var logger=require(_0xfb63('0x2'))('api');var moment=require(_0xfb63('0x3'));var BPromise=require(_0xfb63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb63('0x5'));var rimraf=require(_0xfb63('0x6'));var config=require(_0xfb63('0x7'));var attributes=require(_0xfb63('0x8'));module['exports']=function(_0x141696,_0x273ca2){return _0x141696[_0xfb63('0x9')](_0xfb63('0xa'),attributes,{'tableName':_0xfb63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe55=['rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','path'];(function(_0x46afa4,_0x55f3e6){var _0x4430de=function(_0x355449){while(--_0x355449){_0x46afa4['push'](_0x46afa4['shift']());}};_0x4430de(++_0x55f3e6);}(_0xfe55,0xf7));var _0x5fe5=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xfe55[_0x335271];return _0xa9fff8;};'use strict';var _=require('lodash');var util=require(_0x5fe5('0x0'));var logger=require(_0x5fe5('0x1'))(_0x5fe5('0x2'));var moment=require(_0x5fe5('0x3'));var BPromise=require(_0x5fe5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fe5('0x5'));var rimraf=require(_0x5fe5('0x6'));var config=require(_0x5fe5('0x7'));var attributes=require(_0x5fe5('0x8'));module[_0x5fe5('0x9')]=function(_0x5c1cbf,_0x16692e){return _0x5c1cbf['define']('UserChatQueue',attributes,{'tableName':_0x5fe5('0xa'),'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 652326a..40d484b 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 _0x0019=['code','UserChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1599b8,_0x2745cf){var _0x2af75=function(_0x23038a){while(--_0x23038a){_0x1599b8['push'](_0x1599b8['shift']());}};_0x2af75(++_0x2745cf);}(_0x0019,0x18d));var _0x9001=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x0019[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x9001('0x0'));var util=require(_0x9001('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9001('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9001('0x3'))['db'];var utils=require(_0x9001('0x4'));var logger=require(_0x9001('0x5'))(_0x9001('0x6'));var config=require(_0x9001('0x7'));var jayson=require(_0x9001('0x8'));var client=jayson['client'][_0x9001('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47c258,_0x4f0c43,_0x2c0e99){return new BPromise(function(_0x24806f,_0x1ae0db){return client[_0x9001('0xa')](_0x47c258,_0x2c0e99)[_0x9001('0xb')](function(_0x257935){logger[_0x9001('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x4f0c43,'request\x20sent');logger[_0x9001('0xd')](_0x9001('0xe'),_0x4f0c43,'request\x20sent',JSON[_0x9001('0xf')](_0x257935));if(_0x257935[_0x9001('0x10')]){if(_0x257935[_0x9001('0x10')][_0x9001('0x11')]===0x1f4){logger[_0x9001('0x10')](_0x9001('0x12'),_0x4f0c43,_0x257935[_0x9001('0x10')][_0x9001('0x13')]);return _0x1ae0db(_0x257935[_0x9001('0x10')]['message']);}logger[_0x9001('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x4f0c43,_0x257935[_0x9001('0x10')][_0x9001('0x13')]);return _0x24806f(_0x257935[_0x9001('0x10')][_0x9001('0x13')]);}else{logger[_0x9001('0xc')](_0x9001('0x12'),_0x4f0c43,_0x9001('0x14'));_0x24806f(_0x257935[_0x9001('0x15')][_0x9001('0x13')]);}})[_0x9001('0x16')](function(_0x3a0d6e){logger[_0x9001('0x10')](_0x9001('0x12'),_0x4f0c43,_0x3a0d6e);_0x1ae0db(_0x3a0d6e);});});} \ No newline at end of file +var _0x1e49=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2a90d6,_0x4adbc0){var _0x6dba76=function(_0x18db3f){while(--_0x18db3f){_0x2a90d6['push'](_0x2a90d6['shift']());}};_0x6dba76(++_0x4adbc0);}(_0x1e49,0x71));var _0x91e4=function(_0x137453,_0x83b9d0){_0x137453=_0x137453-0x0;var _0x2f4391=_0x1e49[_0x137453];return _0x2f4391;};'use strict';var _=require(_0x91e4('0x0'));var util=require(_0x91e4('0x1'));var moment=require(_0x91e4('0x2'));var BPromise=require(_0x91e4('0x3'));var rs=require(_0x91e4('0x4'));var fs=require('fs');var Redis=require(_0x91e4('0x5'));var db=require(_0x91e4('0x6'))['db'];var utils=require(_0x91e4('0x7'));var logger=require('../../config/logger')(_0x91e4('0x8'));var config=require(_0x91e4('0x9'));var jayson=require(_0x91e4('0xa'));var client=jayson['client'][_0x91e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cf7d1,_0x544f9f,_0x1527a0){return new BPromise(function(_0x109960,_0x15e70d){return client[_0x91e4('0xc')](_0x2cf7d1,_0x1527a0)[_0x91e4('0xd')](function(_0x34b9cf){logger[_0x91e4('0xe')](_0x91e4('0xf'),_0x544f9f,_0x91e4('0x10'));logger[_0x91e4('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x544f9f,_0x91e4('0x10'),JSON[_0x91e4('0x12')](_0x34b9cf));if(_0x34b9cf[_0x91e4('0x13')]){if(_0x34b9cf['error'][_0x91e4('0x14')]===0x1f4){logger[_0x91e4('0x13')](_0x91e4('0xf'),_0x544f9f,_0x34b9cf[_0x91e4('0x13')]['message']);return _0x15e70d(_0x34b9cf[_0x91e4('0x13')][_0x91e4('0x15')]);}logger['error'](_0x91e4('0xf'),_0x544f9f,_0x34b9cf[_0x91e4('0x13')][_0x91e4('0x15')]);return _0x109960(_0x34b9cf[_0x91e4('0x13')][_0x91e4('0x15')]);}else{logger[_0x91e4('0xe')](_0x91e4('0xf'),_0x544f9f,_0x91e4('0x10'));_0x109960(_0x34b9cf[_0x91e4('0x16')][_0x91e4('0x15')]);}})[_0x91e4('0x17')](function(_0x4bbffc){logger[_0x91e4('0x13')](_0x91e4('0xf'),_0x544f9f,_0x4bbffc);_0x15e70d(_0x4bbffc);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 23123d7..523416c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4670be,_0x50141a){var _0xc3644d=function(_0x144b4c){while(--_0x144b4c){_0x4670be['push'](_0x4670be['shift']());}};_0xc3644d(++_0x50141a);}(_0x70e0,0x17b));var _0x070e=function(_0x27ab0c,_0x27a1f6){_0x27ab0c=_0x27ab0c-0x0;var _0x391e02=_0x70e0[_0x27ab0c];return _0x391e02;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4f7449,_0x407356){var _0x21e3cb=function(_0x40f623){while(--_0x40f623){_0x4f7449['push'](_0x4f7449['shift']());}};_0x21e3cb(++_0x407356);}(_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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d886709..344e32f 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 _0x39b0=['INTEGER','exports'];(function(_0x5c9f2e,_0x13f4d8){var _0x4a647e=function(_0x4d2ed6){while(--_0x4d2ed6){_0x5c9f2e['push'](_0x5c9f2e['shift']());}};_0x4a647e(++_0x13f4d8);}(_0x39b0,0x93));var _0x039b=function(_0x56f462,_0x2bc79f){_0x56f462=_0x56f462-0x0;var _0x59f361=_0x39b0[_0x56f462];return _0x59f361;};'use strict';var Sequelize=require('sequelize');module[_0x039b('0x0')]={'penalty':{'type':Sequelize[_0x039b('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x039b('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2afa=['INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2afa,0x172));var _0xa2af=function(_0x589dfe,_0x419f19){_0x589dfe=_0x589dfe-0x0;var _0x4b208f=_0x2afa[_0x589dfe];return _0x4b208f;};'use strict';var Sequelize=require(_0xa2af('0x0'));module[_0xa2af('0x1')]={'penalty':{'type':Sequelize[_0xa2af('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'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 0778ef3..4f99b73 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 _0x37c0=['path','rimraf','exports','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x181738,_0x155ced){var _0x4ae47f=function(_0x5c390b){while(--_0x5c390b){_0x181738['push'](_0x181738['shift']());}};_0x4ae47f(++_0x155ced);}(_0x37c0,0xf4));var _0x037c=function(_0x3a33f7,_0x47a6ec){_0x3a33f7=_0x3a33f7-0x0;var _0x3375ac=_0x37c0[_0x3a33f7];return _0x3375ac;};'use strict';var _=require(_0x037c('0x0'));var util=require('util');var logger=require(_0x037c('0x1'))(_0x037c('0x2'));var moment=require(_0x037c('0x3'));var BPromise=require(_0x037c('0x4'));var rp=require(_0x037c('0x5'));var fs=require('fs');var path=require(_0x037c('0x6'));var rimraf=require(_0x037c('0x7'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x037c('0x8')]=function(_0x4445b2,_0xb91d61){return _0x4445b2['define']('UserFaxQueue',attributes,{'tableName':_0x037c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2f=['rimraf','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x2a1f57,_0xff634b){var _0x124ecd=function(_0x1ad3f9){while(--_0x1ad3f9){_0x2a1f57['push'](_0x2a1f57['shift']());}};_0x124ecd(++_0xff634b);}(_0xdb2f,0x1de));var _0xfdb2=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xdb2f[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xfdb2('0x0'));var util=require(_0xfdb2('0x1'));var logger=require('../../config/logger')(_0xfdb2('0x2'));var moment=require('moment');var BPromise=require(_0xfdb2('0x3'));var rp=require(_0xfdb2('0x4'));var fs=require('fs');var path=require(_0xfdb2('0x5'));var rimraf=require(_0xfdb2('0x6'));var config=require('../../config/environment');var attributes=require(_0xfdb2('0x7'));module[_0xfdb2('0x8')]=function(_0x367128,_0x1a7926){return _0x367128[_0xfdb2('0x9')]('UserFaxQueue',attributes,{'tableName':_0xfdb2('0xa'),'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 e167b05..9eda334 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 _0xf6de=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x2bf5d5,_0x366ece){var _0x505ee3=function(_0x5b1192){while(--_0x5b1192){_0x2bf5d5['push'](_0x2bf5d5['shift']());}};_0x505ee3(++_0x366ece);}(_0xf6de,0x111));var _0xef6d=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xf6de[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0xef6d('0x0'));var util=require(_0xef6d('0x1'));var moment=require('moment');var BPromise=require(_0xef6d('0x2'));var rs=require(_0xef6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef6d('0x4'))['db'];var utils=require(_0xef6d('0x5'));var logger=require(_0xef6d('0x6'))(_0xef6d('0x7'));var config=require(_0xef6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xef6d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d868e,_0x38b9b7,_0xe9b15d){return new BPromise(function(_0x338a5e,_0x5e94db){return client[_0xef6d('0xa')](_0x1d868e,_0xe9b15d)['then'](function(_0x2cdfb6){logger[_0xef6d('0xb')](_0xef6d('0xc'),_0x38b9b7,_0xef6d('0xd'));logger[_0xef6d('0xe')](_0xef6d('0xf'),_0x38b9b7,_0xef6d('0xd'),JSON['stringify'](_0x2cdfb6));if(_0x2cdfb6['error']){if(_0x2cdfb6[_0xef6d('0x10')][_0xef6d('0x11')]===0x1f4){logger[_0xef6d('0x10')](_0xef6d('0xc'),_0x38b9b7,_0x2cdfb6['error'][_0xef6d('0x12')]);return _0x5e94db(_0x2cdfb6[_0xef6d('0x10')]['message']);}logger[_0xef6d('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x38b9b7,_0x2cdfb6[_0xef6d('0x10')][_0xef6d('0x12')]);return _0x338a5e(_0x2cdfb6[_0xef6d('0x10')]['message']);}else{logger['info'](_0xef6d('0xc'),_0x38b9b7,_0xef6d('0xd'));_0x338a5e(_0x2cdfb6['result'][_0xef6d('0x12')]);}})['catch'](function(_0xac4ee5){logger[_0xef6d('0x10')](_0xef6d('0xc'),_0x38b9b7,_0xac4ee5);_0x5e94db(_0xac4ee5);});});} \ No newline at end of file +var _0x7cd4=['client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1ea61e,_0x40de61){var _0x4ed8c0=function(_0x3cc3ba){while(--_0x3cc3ba){_0x1ea61e['push'](_0x1ea61e['shift']());}};_0x4ed8c0(++_0x40de61);}(_0x7cd4,0xe7));var _0x47cd=function(_0x1d4916,_0x3e3ed0){_0x1d4916=_0x1d4916-0x0;var _0x14cdf8=_0x7cd4[_0x1d4916];return _0x14cdf8;};'use strict';var _=require(_0x47cd('0x0'));var util=require(_0x47cd('0x1'));var moment=require(_0x47cd('0x2'));var BPromise=require(_0x47cd('0x3'));var rs=require(_0x47cd('0x4'));var fs=require('fs');var Redis=require(_0x47cd('0x5'));var db=require(_0x47cd('0x6'))['db'];var utils=require(_0x47cd('0x7'));var logger=require('../../config/logger')(_0x47cd('0x8'));var config=require(_0x47cd('0x9'));var jayson=require(_0x47cd('0xa'));var client=jayson[_0x47cd('0xb')][_0x47cd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xcf4b5f,_0x107e7d,_0xa82896){return new BPromise(function(_0x1bb26b,_0x40feb0){return client[_0x47cd('0xd')](_0xcf4b5f,_0xa82896)['then'](function(_0x59157d){logger[_0x47cd('0xe')](_0x47cd('0xf'),_0x107e7d,_0x47cd('0x10'));logger[_0x47cd('0x11')](_0x47cd('0x12'),_0x107e7d,_0x47cd('0x10'),JSON['stringify'](_0x59157d));if(_0x59157d['error']){if(_0x59157d[_0x47cd('0x13')]['code']===0x1f4){logger['error'](_0x47cd('0xf'),_0x107e7d,_0x59157d[_0x47cd('0x13')][_0x47cd('0x14')]);return _0x40feb0(_0x59157d['error'][_0x47cd('0x14')]);}logger[_0x47cd('0x13')](_0x47cd('0xf'),_0x107e7d,_0x59157d[_0x47cd('0x13')][_0x47cd('0x14')]);return _0x1bb26b(_0x59157d[_0x47cd('0x13')][_0x47cd('0x14')]);}else{logger[_0x47cd('0xe')](_0x47cd('0xf'),_0x107e7d,_0x47cd('0x10'));_0x1bb26b(_0x59157d['result'][_0x47cd('0x14')]);}})[_0x47cd('0x15')](function(_0x1c05bc){logger['error'](_0x47cd('0xf'),_0x107e7d,_0x1c05bc);_0x40feb0(_0x1c05bc);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e8b4721..f76e4f4 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5934f2,_0xb18078){var _0xe2a492=function(_0x11cdde){while(--_0x11cdde){_0x5934f2['push'](_0x5934f2['shift']());}};_0xe2a492(++_0xb18078);}(_0x70e0,0x17b));var _0x070e=function(_0x24ce6c,_0x16c0c8){_0x24ce6c=_0x24ce6c-0x0;var _0x5ba937=_0x70e0[_0x24ce6c];return _0x5ba937;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x33616f,_0x3855c6){var _0x47221f=function(_0xe32c3a){while(--_0xe32c3a){_0x33616f['push'](_0x33616f['shift']());}};_0x47221f(++_0x3855c6);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 5c884e3..721335a 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 _0x0ef8=['exports','INTEGER','sequelize'];(function(_0xf9acd2,_0x2f1c42){var _0x32381b=function(_0x31fb17){while(--_0x31fb17){_0xf9acd2['push'](_0xf9acd2['shift']());}};_0x32381b(++_0x2f1c42);}(_0x0ef8,0xe6));var _0x80ef=function(_0x3c0b58,_0x1deb43){_0x3c0b58=_0x3c0b58-0x0;var _0x1854ee=_0x0ef8[_0x3c0b58];return _0x1854ee;};'use strict';var Sequelize=require(_0x80ef('0x0'));module[_0x80ef('0x1')]={'penalty':{'type':Sequelize[_0x80ef('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5878=['sequelize','INTEGER'];(function(_0x44257e,_0x53681f){var _0x404895=function(_0x41d569){while(--_0x41d569){_0x44257e['push'](_0x44257e['shift']());}};_0x404895(++_0x53681f);}(_0x5878,0xf0));var _0x8587=function(_0x13ed01,_0x31ad69){_0x13ed01=_0x13ed01-0x0;var _0x2adb1a=_0x5878[_0x13ed01];return _0x2adb1a;};'use strict';var Sequelize=require(_0x8587('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8587('0x1')],'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 4fc42e6..c445ffe 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 _0x11de=['util','moment','bluebird','path','rimraf','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x5903cc,_0x576d33){var _0x4ce958=function(_0x434d78){while(--_0x434d78){_0x5903cc['push'](_0x5903cc['shift']());}};_0x4ce958(++_0x576d33);}(_0x11de,0x179));var _0xe11d=function(_0x49b898,_0x15f7de){_0x49b898=_0x49b898-0x0;var _0x32f4e2=_0x11de[_0x49b898];return _0x32f4e2;};'use strict';var _=require(_0xe11d('0x0'));var util=require(_0xe11d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe11d('0x2'));var BPromise=require(_0xe11d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe11d('0x4'));var rimraf=require(_0xe11d('0x5'));var config=require('../../config/environment');var attributes=require(_0xe11d('0x6'));module['exports']=function(_0x5bb23d,_0x44811f){return _0x5bb23d['define'](_0xe11d('0x7'),attributes,{'tableName':_0xe11d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x632c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','user_has_mail_queues','lodash','util'];(function(_0x3a7490,_0x265112){var _0x4209ab=function(_0x1e230c){while(--_0x1e230c){_0x3a7490['push'](_0x3a7490['shift']());}};_0x4209ab(++_0x265112);}(_0x632c,0x82));var _0xc632=function(_0x1ee8e2,_0x54b5ee){_0x1ee8e2=_0x1ee8e2-0x0;var _0x50e227=_0x632c[_0x1ee8e2];return _0x50e227;};'use strict';var _=require(_0xc632('0x0'));var util=require(_0xc632('0x1'));var logger=require(_0xc632('0x2'))(_0xc632('0x3'));var moment=require(_0xc632('0x4'));var BPromise=require(_0xc632('0x5'));var rp=require(_0xc632('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc632('0x7'));var config=require(_0xc632('0x8'));var attributes=require(_0xc632('0x9'));module['exports']=function(_0x1b34ed,_0x33dcf0){return _0x1b34ed['define']('UserMailQueue',attributes,{'tableName':_0xc632('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index d671c44..03f649b 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0xd2d138,_0x55d264){var _0x371ae0=function(_0xfe505c){while(--_0xfe505c){_0xd2d138['push'](_0xd2d138['shift']());}};_0x371ae0(++_0x55d264);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1610e0,_0x12e501){var _0x2f9bf4=function(_0x48e1cb){while(--_0x48e1cb){_0x1610e0['push'](_0x1610e0['shift']());}};_0x2f9bf4(++_0x12e501);}(_0xa41a,0x6b));var _0xaa41=function(_0x2b8b9f,_0xc566c0){_0x2b8b9f=_0x2b8b9f-0x0;var _0x16bfbb=_0xa41a[_0x2b8b9f];return _0x16bfbb;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index a8b5c32..3288ad5 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 _0x088a=['Router','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','exports','multer','util','path','connect-timeout','express'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x088a,0x1ea));var _0xa088=function(_0x1e1f34,_0x13f9ba){_0x1e1f34=_0x1e1f34-0x0;var _0x36a3f4=_0x088a[_0x1e1f34];return _0x36a3f4;};'use strict';var multer=require(_0xa088('0x0'));var util=require(_0xa088('0x1'));var path=require(_0xa088('0x2'));var timeout=require(_0xa088('0x3'));var express=require(_0xa088('0x4'));var router=express[_0xa088('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa088('0x6'));var interaction=require(_0xa088('0x7'));var config=require('../../config/environment');var controller=require(_0xa088('0x8'));router[_0xa088('0x9')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0xa088('0xa')]=router; \ No newline at end of file +var _0x4aee=['../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x596a0a,_0x31f8ee){var _0x65117a=function(_0x3047f5){while(--_0x3047f5){_0x596a0a['push'](_0x596a0a['shift']());}};_0x65117a(++_0x31f8ee);}(_0x4aee,0x108));var _0xe4ae=function(_0xd060e4,_0x45a988){_0xd060e4=_0xd060e4-0x0;var _0x4f9650=_0x4aee[_0xd060e4];return _0x4f9650;};'use strict';var multer=require(_0xe4ae('0x0'));var util=require('util');var path=require(_0xe4ae('0x1'));var timeout=require(_0xe4ae('0x2'));var express=require(_0xe4ae('0x3'));var router=express['Router']();var fs_extra=require(_0xe4ae('0x4'));var auth=require(_0xe4ae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4ae('0x6'));var controller=require(_0xe4ae('0x7'));router['post']('/',auth[_0xe4ae('0x8')](),controller[_0xe4ae('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 03f7e3c..76fc88a 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 _0x3e25=['exports','STRING','TEXT','sequelize'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x3e25,0x18b));var _0x53e2=function(_0xc73bc2,_0x39da6d){_0xc73bc2=_0xc73bc2-0x0;var _0x33b939=_0x3e25[_0xc73bc2];return _0x33b939;};'use strict';var Sequelize=require(_0x53e2('0x0'));module[_0x53e2('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x53e2('0x2')]},'recipientsId':{'type':Sequelize[_0x53e2('0x3')]},'recipientsDescription':{'type':Sequelize[_0x53e2('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xb35a=['STRING','BOOLEAN','TEXT'];(function(_0x3dbbcf,_0x4c77a1){var _0x59367b=function(_0x4b2460){while(--_0x4b2460){_0x3dbbcf['push'](_0x3dbbcf['shift']());}};_0x59367b(++_0x4c77a1);}(_0xb35a,0x185));var _0xab35=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0xb35a[_0x2be104];return _0x31c115;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xab35('0x0')]},'senderName':{'type':Sequelize[_0xab35('0x1')]},'recipientsId':{'type':Sequelize[_0xab35('0x0')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xab35('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 88dac20..e0eca2a 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 _0x244e=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','then','stack','name','send','sendUserNotification','hasOwnProperty','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','forEach','emit','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','toLowerCase','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x244e,0xc2));var _0xe244=function(_0x1cee40,_0x427d94){_0x1cee40=_0x1cee40-0x0;var _0x2ce498=_0x244e[_0x1cee40];return _0x2ce498;};'use strict';var emlformat=require(_0xe244('0x0'));var rimraf=require(_0xe244('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe244('0x2'));var rp=require(_0xe244('0x3'));var moment=require(_0xe244('0x4'));var BPromise=require(_0xe244('0x5'));var Mustache=require(_0xe244('0x6'));var util=require(_0xe244('0x7'));var path=require('path');var sox=require(_0xe244('0x8'));var csv=require(_0xe244('0x9'));var ejs=require(_0xe244('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe244('0xb'));var squel=require(_0xe244('0xc'));var crypto=require(_0xe244('0xd'));var jsforce=require(_0xe244('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe244('0x9'));var querystring=require(_0xe244('0xf'));var Papa=require(_0xe244('0x10'));var Redis=require(_0xe244('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe244('0x12'));var hardwareService=require(_0xe244('0x13'));var logger=require(_0xe244('0x14'))(_0xe244('0x15'));var utils=require('../../config/utils');var config=require(_0xe244('0x16'));var licenseUtil=require(_0xe244('0x17'));var db=require(_0xe244('0x18'))['db'];config[_0xe244('0x19')]=_['defaults'](config[_0xe244('0x19')],{'host':_0xe244('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe244('0x19')]));require(_0xe244('0x1b'))[_0xe244('0x1c')](socket);function respondWithStatusCode(_0x33b21d,_0x3dbccf){_0x3dbccf=_0x3dbccf||0xcc;return function(_0x1ae2d5){if(_0x1ae2d5){return _0x33b21d[_0xe244('0x1d')](_0x3dbccf);}return _0x33b21d[_0xe244('0x1e')](_0x3dbccf)[_0xe244('0x1f')]();};}function respondWithResult(_0x412e54,_0x4c25f5){_0x4c25f5=_0x4c25f5||0xc8;return function(_0x10736f){if(_0x10736f){return _0x412e54[_0xe244('0x1e')](_0x4c25f5)[_0xe244('0x20')](_0x10736f);}};}function respondWithFilteredResult(_0xd4fda2,_0x45fc3a){return function(_0x352bc3){if(_0x352bc3){var _0x45aaa0=typeof _0x45fc3a[_0xe244('0x21')]==='undefined'&&typeof _0x45fc3a[_0xe244('0x22')]===_0xe244('0x23');var _0x495f8d=_0x352bc3['count'];var _0x11eb91=_0x45aaa0?0x0:_0x45fc3a[_0xe244('0x21')];var _0x4a6de2=_0x45aaa0?_0x352bc3['count']:_0x45fc3a[_0xe244('0x21')]+_0x45fc3a[_0xe244('0x22')];var _0x2cb05f;if(_0x4a6de2>=_0x495f8d){_0x4a6de2=_0x495f8d;_0x2cb05f=0xc8;}else{_0x2cb05f=0xce;}_0xd4fda2[_0xe244('0x1e')](_0x2cb05f);return _0xd4fda2[_0xe244('0x24')](_0xe244('0x25'),_0x11eb91+'-'+_0x4a6de2+'/'+_0x495f8d)[_0xe244('0x20')](_0x352bc3);}return null;};}function patchUpdates(_0x3b9098){return function(_0x471935){try{jsonpatch[_0xe244('0x26')](_0x471935,_0x3b9098,!![]);}catch(_0x2c602f){return BPromise['reject'](_0x2c602f);}return _0x471935[_0xe244('0x27')]();};}function saveUpdates(_0x5d7d63,_0x7ed321){return function(_0x439b5c){if(_0x439b5c){return _0x439b5c[_0xe244('0x28')](_0x5d7d63)[_0xe244('0x29')](function(_0x16f05b){return _0x16f05b;});}return null;};}function removeEntity(_0x28cc72,_0x179a73){return function(_0xa27341){if(_0xa27341){return _0xa27341['destroy']()[_0xe244('0x29')](function(){_0x28cc72[_0xe244('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f7d6d,_0x26fe44){return function(_0xc2296b){if(!_0xc2296b){_0x1f7d6d['sendStatus'](0x194);}return _0xc2296b;};}function handleError(_0x39ed64,_0x5a55fe){_0x5a55fe=_0x5a55fe||0x1f4;return function(_0x30c7f9){logger['error'](_0x30c7f9[_0xe244('0x2a')]);if(_0x30c7f9[_0xe244('0x2b')]){delete _0x30c7f9['name'];}_0x39ed64['status'](_0x5a55fe)[_0xe244('0x2c')](_0x30c7f9);};}exports[_0xe244('0x2d')]=function(_0x57d66c,_0x159d75,_0x5324eb){if(!_0x57d66c['body'][_0xe244('0x2e')]('text')&&!_0x57d66c[_0xe244('0x2f')][_0xe244('0x2e')]('TemplateId')){throw new db[(_0xe244('0x30'))][(_0xe244('0x31'))](_0xe244('0x32'));}else{if(_0x57d66c[_0xe244('0x2f')][_0xe244('0x2e')](_0xe244('0x33'))&&!_0x57d66c[_0xe244('0x2f')]['hasOwnProperty']('view')){throw new db[(_0xe244('0x30'))][(_0xe244('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x57d66c['body'][_0xe244('0x2e')](_0xe244('0x34'))){throw new db[(_0xe244('0x30'))][(_0xe244('0x31'))](_0xe244('0x35'));}else{try{var _0x118435=JSON[_0xe244('0x36')](_0x57d66c[_0xe244('0x2f')][_0xe244('0x34')]);}catch(_0x5082dd){logger[_0xe244('0x37')](_0x5082dd);throw new db[(_0xe244('0x30'))][(_0xe244('0x31'))](_0xe244('0x38'));}var _0x16f8ae=[_0xe244('0x39'),'faxqueue',_0xe244('0x3a'),'openchannelqueue',_0xe244('0x3b'),_0xe244('0x3c'),_0xe244('0x3d'),_0xe244('0x3e'),_0xe244('0x3f')];if(_[_0xe244('0x40')](_0x118435,function(_0x11265d){return!_[_0xe244('0x41')](_0x16f8ae,_0x11265d[_0xe244('0x42')]['toLowerCase']());})){throw new db['Sequelize'][(_0xe244('0x31'))](_0xe244('0x43'));}}}var _0x1e0315={};_0x1e0315['senderName']=_0x57d66c[_0xe244('0x2f')][_0xe244('0x2e')](_0xe244('0x44'))?_0x57d66c[_0xe244('0x2f')]['senderName']:_0x57d66c[_0xe244('0x3f')][_0xe244('0x45')];_0x1e0315['recipientsDescription']=_['isEmpty'](_0x57d66c[_0xe244('0x2f')]['recipientsDescription'])?null:_0x57d66c['body'][_0xe244('0x46')];_0x1e0315[_0xe244('0x47')]=_0x57d66c[_0xe244('0x2f')][_0xe244('0x47')]||![];_0x1e0315[_0xe244('0x48')]=_0x57d66c[_0xe244('0x3f')]['id'];return getContent(_0x57d66c[_0xe244('0x2f')])['then'](function(_0x4200ff){_0x1e0315[_0xe244('0x2f')]=_0x4200ff;return getRecipients(_0x118435);})[_0xe244('0x29')](function(_0x39b720){_0x1e0315[_0xe244('0x49')]=_[_0xe244('0x4a')](_0x39b720)[_0xe244('0x4b')](',');return db[_0xe244('0x4c')][_0xe244('0x4d')](function(_0x40a1bf){return db['UserNotification']['create'](_0x1e0315,{'raw':!![],'transaction':_0x40a1bf})['then'](function(_0x37cb13){var _0x20d707={'sender':_0x1e0315[_0xe244('0x44')],'description':_0x1e0315['recipientsDescription'],'content':_0x1e0315[_0xe244('0x2f')],'beep':_0x1e0315[_0xe244('0x47')]};_0x39b720[_0xe244('0x4e')](function(_0x42217a){_0x20d707['recipient']=_0x42217a;socket[_0xe244('0x4f')](_0xe244('0x50'),_0x20d707);});return _0x37cb13;});});})[_0xe244('0x29')](respondWithResult(_0x159d75,0xc9))[_0xe244('0x51')](handleError(_0x159d75,null));};function getContent(_0x979980){return new BPromise(function(_0x2a97d6,_0x8e6ba5){if(_0x979980[_0xe244('0x52')]){_0x2a97d6(_0x979980['text']);return;}return db['Template'][_0xe244('0x53')]({'attributes':[_0xe244('0x54')],'where':{'id':_0x979980[_0xe244('0x33')]},'raw':!![]})[_0xe244('0x29')](function(_0x5e5ab3){if(!_0x5e5ab3)throw new db['Sequelize'][(_0xe244('0x31'))](_0xe244('0x55'));var _0x17ecd8=Mustache['render'](_0x5e5ab3[_0xe244('0x54')],_0x979980[_0xe244('0x56')]);_0x2a97d6(_0x17ecd8);})[_0xe244('0x51')](function(_0x214d4a){_0x8e6ba5(_0x214d4a);});});}function getRecipients(_0x23fa0c){return new BPromise(function(_0x2dcc95,_0x46adce){var _0x27aa76=[];var _0x11b89e=[];_0x23fa0c[_0xe244('0x4e')](function(_0x6ed0e6){var _0x615384=_[_0xe244('0x57')](_0x6ed0e6[_0xe244('0x42')][_0xe244('0x58')]());if(_0x615384===_0xe244('0x59')){_0x27aa76=_[_0xe244('0x5a')](_0x27aa76,_0x6ed0e6[_0xe244('0x5b')]);}else{if(_[_0xe244('0x41')](_0x615384,_0xe244('0x5c')))_0x615384=_0x615384[_0xe244('0x5d')](_0xe244('0x5c'),_0xe244('0x5e'));_0x6ed0e6[_0xe244('0x5b')][_0xe244('0x4e')](function(_0x5f5c08){_0x11b89e[_0xe244('0x5f')](getAgents(_0x615384,_0x5f5c08));});}});return BPromise[_0xe244('0x60')](_0x11b89e)[_0xe244('0x29')](function(_0x209e1a){_0x27aa76=_['union'](_0x27aa76,_[_0xe244('0x61')](_0x209e1a));_0x2dcc95(_0x27aa76);})['catch'](function(_0x566b29){_0x46adce(_0x566b29);});});}function getAgents(_0x36cfa3,_0x21350d){return new BPromise(function(_0xff70ef,_0xdf1766){return db[_0x36cfa3][_0xe244('0x53')]({'where':{'id':_0x21350d}})[_0xe244('0x29')](function(_0x107008){return _0x107008[_0xe244('0x62')]({'attributes':['id'],'raw':!![]})[_0xe244('0x29')](function(_0x5ca13d){var _0x4a70e7=_[_0xe244('0x63')](_0x5ca13d,'id');_0xff70ef(_0x4a70e7);});})[_0xe244('0x51')](function(_0x31c0f2){_0xdf1766(_0x31c0f2);});});} \ No newline at end of file +var _0x332d=['sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','create','forEach','recipient','emit','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','includes','queue','replace','flatten','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./userNotification.socket','register'];(function(_0xd8d73d,_0x4ccfc1){var _0x4e9bdf=function(_0x5121e6){while(--_0x5121e6){_0xd8d73d['push'](_0xd8d73d['shift']());}};_0x4e9bdf(++_0x4ccfc1);}(_0x332d,0xa4));var _0xd332=function(_0x4c5967,_0x439ff7){_0x4c5967=_0x4c5967-0x0;var _0x5ffcc0=_0x332d[_0x4c5967];return _0x5ffcc0;};'use strict';var emlformat=require(_0xd332('0x0'));var rimraf=require(_0xd332('0x1'));var zipdir=require(_0xd332('0x2'));var jsonpatch=require(_0xd332('0x3'));var rp=require('request-promise');var moment=require(_0xd332('0x4'));var BPromise=require(_0xd332('0x5'));var Mustache=require('mustache');var util=require(_0xd332('0x6'));var path=require(_0xd332('0x7'));var sox=require(_0xd332('0x8'));var csv=require('to-csv');var ejs=require(_0xd332('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd332('0xa'));var squel=require(_0xd332('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd332('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd332('0xd'));var Redis=require(_0xd332('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd332('0xf'));var hardwareService=require(_0xd332('0x10'));var logger=require(_0xd332('0x11'))('api');var utils=require(_0xd332('0x12'));var config=require(_0xd332('0x13'));var licenseUtil=require(_0xd332('0x14'));var db=require(_0xd332('0x15'))['db'];config[_0xd332('0x16')]=_['defaults'](config['redis'],{'host':_0xd332('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd332('0x18'))[_0xd332('0x19')](socket);function respondWithStatusCode(_0x2eec98,_0x2b0e42){_0x2b0e42=_0x2b0e42||0xcc;return function(_0x486bb4){if(_0x486bb4){return _0x2eec98[_0xd332('0x1a')](_0x2b0e42);}return _0x2eec98['status'](_0x2b0e42)[_0xd332('0x1b')]();};}function respondWithResult(_0x1c71a3,_0x52f3c4){_0x52f3c4=_0x52f3c4||0xc8;return function(_0xdbf982){if(_0xdbf982){return _0x1c71a3[_0xd332('0x1c')](_0x52f3c4)[_0xd332('0x1d')](_0xdbf982);}};}function respondWithFilteredResult(_0x3e2d34,_0x3e40cb){return function(_0xe01b9e){if(_0xe01b9e){var _0x461f30=typeof _0x3e40cb[_0xd332('0x1e')]==='undefined'&&typeof _0x3e40cb[_0xd332('0x1f')]===_0xd332('0x20');var _0x25ce69=_0xe01b9e[_0xd332('0x21')];var _0x49f0e0=_0x461f30?0x0:_0x3e40cb[_0xd332('0x1e')];var _0x626ea=_0x461f30?_0xe01b9e[_0xd332('0x21')]:_0x3e40cb['offset']+_0x3e40cb[_0xd332('0x1f')];var _0x134f47;if(_0x626ea>=_0x25ce69){_0x626ea=_0x25ce69;_0x134f47=0xc8;}else{_0x134f47=0xce;}_0x3e2d34[_0xd332('0x1c')](_0x134f47);return _0x3e2d34['set'](_0xd332('0x22'),_0x49f0e0+'-'+_0x626ea+'/'+_0x25ce69)[_0xd332('0x1d')](_0xe01b9e);}return null;};}function patchUpdates(_0x250cd9){return function(_0x221925){try{jsonpatch[_0xd332('0x23')](_0x221925,_0x250cd9,!![]);}catch(_0x433ad0){return BPromise[_0xd332('0x24')](_0x433ad0);}return _0x221925[_0xd332('0x25')]();};}function saveUpdates(_0x4c850f,_0x4fab9f){return function(_0x3848e2){if(_0x3848e2){return _0x3848e2[_0xd332('0x26')](_0x4c850f)[_0xd332('0x27')](function(_0x1fd4d6){return _0x1fd4d6;});}return null;};}function removeEntity(_0x172113,_0x4fcf1b){return function(_0x5517d3){if(_0x5517d3){return _0x5517d3['destroy']()['then'](function(){_0x172113['status'](0xcc)[_0xd332('0x1b')]();});}};}function handleEntityNotFound(_0x46b740,_0x10d857){return function(_0x251e87){if(!_0x251e87){_0x46b740[_0xd332('0x1a')](0x194);}return _0x251e87;};}function handleError(_0x13df45,_0x5b445e){_0x5b445e=_0x5b445e||0x1f4;return function(_0x38ee67){logger[_0xd332('0x28')](_0x38ee67[_0xd332('0x29')]);if(_0x38ee67[_0xd332('0x2a')]){delete _0x38ee67['name'];}_0x13df45['status'](_0x5b445e)[_0xd332('0x2b')](_0x38ee67);};}exports[_0xd332('0x2c')]=function(_0x15e180,_0x467875,_0x40ec20){if(!_0x15e180[_0xd332('0x2d')]['hasOwnProperty'](_0xd332('0x2e'))&&!_0x15e180['body'][_0xd332('0x2f')](_0xd332('0x30'))){throw new db[(_0xd332('0x31'))]['ValidationError'](_0xd332('0x32'));}else{if(_0x15e180[_0xd332('0x2d')][_0xd332('0x2f')](_0xd332('0x30'))&&!_0x15e180['body'][_0xd332('0x2f')](_0xd332('0x33'))){throw new db['Sequelize'][(_0xd332('0x34'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x15e180[_0xd332('0x2d')][_0xd332('0x2f')](_0xd332('0x35'))){throw new db[(_0xd332('0x31'))][(_0xd332('0x34'))](_0xd332('0x36'));}else{try{var _0x326604=JSON[_0xd332('0x37')](_0x15e180[_0xd332('0x2d')]['recipients']);}catch(_0x2f90f4){logger[_0xd332('0x28')](_0x2f90f4);throw new db['Sequelize'][(_0xd332('0x34'))](_0xd332('0x38'));}var _0x4dfdb8=[_0xd332('0x39'),'faxqueue',_0xd332('0x3a'),'openchannelqueue',_0xd332('0x3b'),_0xd332('0x3c'),_0xd332('0x3d'),_0xd332('0x3e'),_0xd332('0x3f')];if(_[_0xd332('0x40')](_0x326604,function(_0x4156e2){return!_['includes'](_0x4dfdb8,_0x4156e2[_0xd332('0x41')][_0xd332('0x42')]());})){throw new db['Sequelize']['ValidationError'](_0xd332('0x43'));}}}var _0x5e8d6c={};_0x5e8d6c[_0xd332('0x44')]=_0x15e180[_0xd332('0x2d')]['hasOwnProperty'](_0xd332('0x44'))?_0x15e180[_0xd332('0x2d')][_0xd332('0x44')]:_0x15e180[_0xd332('0x3f')]['fullname'];_0x5e8d6c[_0xd332('0x45')]=_[_0xd332('0x46')](_0x15e180[_0xd332('0x2d')]['recipientsDescription'])?null:_0x15e180['body'][_0xd332('0x45')];_0x5e8d6c[_0xd332('0x47')]=_0x15e180[_0xd332('0x2d')]['beep']||![];_0x5e8d6c[_0xd332('0x48')]=_0x15e180[_0xd332('0x3f')]['id'];return getContent(_0x15e180[_0xd332('0x2d')])[_0xd332('0x27')](function(_0x277256){_0x5e8d6c[_0xd332('0x2d')]=_0x277256;return getRecipients(_0x326604);})[_0xd332('0x27')](function(_0x2069bb){_0x5e8d6c[_0xd332('0x49')]=_[_0xd332('0x4a')](_0x2069bb)[_0xd332('0x4b')](',');return db['sequelize'][_0xd332('0x4c')](function(_0x43c98f){return db['UserNotification'][_0xd332('0x4d')](_0x5e8d6c,{'raw':!![],'transaction':_0x43c98f})[_0xd332('0x27')](function(_0x32299e){var _0xe4f892={'sender':_0x5e8d6c['senderName'],'description':_0x5e8d6c['recipientsDescription'],'content':_0x5e8d6c[_0xd332('0x2d')],'beep':_0x5e8d6c[_0xd332('0x47')]};_0x2069bb[_0xd332('0x4e')](function(_0x591399){_0xe4f892[_0xd332('0x4f')]=_0x591399;socket[_0xd332('0x50')](_0xd332('0x51'),_0xe4f892);});return _0x32299e;});});})[_0xd332('0x27')](respondWithResult(_0x467875,0xc9))[_0xd332('0x52')](handleError(_0x467875,null));};function getContent(_0x4e0951){return new BPromise(function(_0x45883a,_0x22188f){if(_0x4e0951[_0xd332('0x2e')]){_0x45883a(_0x4e0951[_0xd332('0x2e')]);return;}return db[_0xd332('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x4e0951[_0xd332('0x30')]},'raw':!![]})['then'](function(_0x472820){if(!_0x472820)throw new db[(_0xd332('0x31'))]['ValidationError'](_0xd332('0x54'));var _0x3bae1=Mustache['render'](_0x472820['html'],_0x4e0951[_0xd332('0x33')]);_0x45883a(_0x3bae1);})['catch'](function(_0x17e8d7){_0x22188f(_0x17e8d7);});});}function getRecipients(_0x21b60f){return new BPromise(function(_0x44672f,_0x59636b){var _0x5f58db=[];var _0x28e14f=[];_0x21b60f[_0xd332('0x4e')](function(_0x595b85){var _0x22d782=_[_0xd332('0x55')](_0x595b85[_0xd332('0x41')]['toLowerCase']());if(_0x22d782===_0xd332('0x56')){_0x5f58db=_[_0xd332('0x57')](_0x5f58db,_0x595b85[_0xd332('0x58')]);}else{if(_[_0xd332('0x59')](_0x22d782,_0xd332('0x5a')))_0x22d782=_0x22d782[_0xd332('0x5b')](_0xd332('0x5a'),'Queue');_0x595b85[_0xd332('0x58')][_0xd332('0x4e')](function(_0x4b3b1b){_0x28e14f['push'](getAgents(_0x22d782,_0x4b3b1b));});}});return BPromise['all'](_0x28e14f)[_0xd332('0x27')](function(_0x281386){_0x5f58db=_[_0xd332('0x57')](_0x5f58db,_[_0xd332('0x5c')](_0x281386));_0x44672f(_0x5f58db);})[_0xd332('0x52')](function(_0x57a61b){_0x59636b(_0x57a61b);});});}function getAgents(_0x4c23dc,_0x52f691){return new BPromise(function(_0x28ba52,_0x3ca59d){return db[_0x4c23dc][_0xd332('0x5d')]({'where':{'id':_0x52f691}})['then'](function(_0x17f08d){return _0x17f08d['getAgents']({'attributes':['id'],'raw':!![]})[_0xd332('0x27')](function(_0x4fef87){var _0x2fac81=_[_0xd332('0x5e')](_0x4fef87,'id');_0x28ba52(_0x2fac81);});})[_0xd332('0x52')](function(_0x1f1641){_0x3ca59d(_0x1f1641);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 5a8835c..44818b8 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 _0xd490=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','remove'];(function(_0x4db341,_0xb12794){var _0x193cb0=function(_0x27666e){while(--_0x27666e){_0x4db341['push'](_0x4db341['shift']());}};_0x193cb0(++_0xb12794);}(_0xd490,0x1c6));var _0x0d49=function(_0x5d1bca,_0x3df875){_0x5d1bca=_0x5d1bca-0x0;var _0x13f4fe=_0xd490[_0x5d1bca];return _0x13f4fe;};'use strict';var EventEmitter=require(_0x0d49('0x0'));var UserNotification=require(_0x0d49('0x1'))['db'][_0x0d49('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0d49('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0d49('0x4')};function emitEvent(_0x5c8efc){return function(_0x24a522,_0x5c9528,_0x55a9fe){UserNotificationEvents[_0x0d49('0x5')](_0x5c8efc+':'+_0x24a522['id'],_0x24a522);UserNotificationEvents[_0x0d49('0x5')](_0x5c8efc,_0x24a522);_0x55a9fe(null);};}for(var e in events){if(events[_0x0d49('0x6')](e)){var event=events[e];UserNotification[_0x0d49('0x7')](e,emitEvent(event));}}module[_0x0d49('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x7e85=['update','emit','hasOwnProperty','exports','UserNotification','setMaxListeners','save'];(function(_0x500210,_0x15bbe6){var _0x5b5da3=function(_0x29d0d8){while(--_0x29d0d8){_0x500210['push'](_0x500210['shift']());}};_0x5b5da3(++_0x15bbe6);}(_0x7e85,0x1d2));var _0x57e8=function(_0x5d1aea,_0x2a2fb8){_0x5d1aea=_0x5d1aea-0x0;var _0x1a91b6=_0x7e85[_0x5d1aea];return _0x1a91b6;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x57e8('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x57e8('0x1')](0x0);var events={'afterCreate':_0x57e8('0x2'),'afterUpdate':_0x57e8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x57a9bb){return function(_0x280f59,_0x155267,_0x2be76b){UserNotificationEvents[_0x57e8('0x4')](_0x57a9bb+':'+_0x280f59['id'],_0x280f59);UserNotificationEvents[_0x57e8('0x4')](_0x57a9bb,_0x280f59);_0x2be76b(null);};}for(var e in events){if(events[_0x57e8('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x57e8('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9f37094..baa3450 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 _0xc19a=['api','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','UserNotification','lodash','util','../../config/logger'];(function(_0x1e15e4,_0x58ca11){var _0x2fc32e=function(_0x51a207){while(--_0x51a207){_0x1e15e4['push'](_0x1e15e4['shift']());}};_0x2fc32e(++_0x58ca11);}(_0xc19a,0x7f));var _0xac19=function(_0xb8aa68,_0x3f06dd){_0xb8aa68=_0xb8aa68-0x0;var _0x3c5530=_0xc19a[_0xb8aa68];return _0x3c5530;};'use strict';var _=require(_0xac19('0x0'));var util=require(_0xac19('0x1'));var logger=require(_0xac19('0x2'))(_0xac19('0x3'));var moment=require('moment');var BPromise=require(_0xac19('0x4'));var rp=require(_0xac19('0x5'));var fs=require('fs');var path=require(_0xac19('0x6'));var rimraf=require('rimraf');var config=require(_0xac19('0x7'));var attributes=require(_0xac19('0x8'));module['exports']=function(_0x473377,_0x17c0d7){return _0x473377['define'](_0xac19('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfed7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x4cd9a9,_0x568436){var _0x17894f=function(_0x26ff4f){while(--_0x26ff4f){_0x4cd9a9['push'](_0x4cd9a9['shift']());}};_0x17894f(++_0x568436);}(_0xfed7,0x190));var _0x7fed=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xfed7[_0x318410];return _0x2898a3;};'use strict';var _=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var logger=require(_0x7fed('0x2'))(_0x7fed('0x3'));var moment=require(_0x7fed('0x4'));var BPromise=require(_0x7fed('0x5'));var rp=require(_0x7fed('0x6'));var fs=require('fs');var path=require(_0x7fed('0x7'));var rimraf=require(_0x7fed('0x8'));var config=require(_0x7fed('0x9'));var attributes=require('./userNotification.attributes');module[_0x7fed('0xa')]=function(_0x3be30c,_0x517ec1){return _0x3be30c['define'](_0x7fed('0xb'),attributes,{'tableName':_0x7fed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7fed('0xd'),'collate':_0x7fed('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 399ae1a..e13c4bb 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 _0xcf03=['rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','info','debug','request\x20sent','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2d7f33,_0x3c3cc5){var _0x5dbbd1=function(_0xb09f82){while(--_0xb09f82){_0x2d7f33['push'](_0x2d7f33['shift']());}};_0x5dbbd1(++_0x3c3cc5);}(_0xcf03,0x1d6));var _0x3cf0=function(_0x418799,_0x5f1b3e){_0x418799=_0x418799-0x0;var _0x46a84f=_0xcf03[_0x418799];return _0x46a84f;};'use strict';var _=require('lodash');var util=require(_0x3cf0('0x0'));var moment=require(_0x3cf0('0x1'));var BPromise=require(_0x3cf0('0x2'));var rs=require(_0x3cf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3cf0('0x4'));var logger=require('../../config/logger')(_0x3cf0('0x5'));var config=require(_0x3cf0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3cf0('0x7')][_0x3cf0('0x8')]({'port':0x232a});config['redis']=_[_0x3cf0('0x9')](config[_0x3cf0('0xa')],{'host':_0x3cf0('0xb'),'port':0x18eb});var socket=require(_0x3cf0('0xc'))(new Redis(config[_0x3cf0('0xa')]));require(_0x3cf0('0xd'))[_0x3cf0('0xe')](socket);function respondWithRpcPromise(_0x1076cf,_0x1f70c7,_0x1b3667){return new BPromise(function(_0x1472f3,_0x184114){return client[_0x3cf0('0xf')](_0x1076cf,_0x1b3667)['then'](function(_0x529e83){logger[_0x3cf0('0x10')]('UserNotification,\x20%s,\x20%s',_0x1f70c7,'request\x20sent');logger[_0x3cf0('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1f70c7,_0x3cf0('0x12'),JSON['stringify'](_0x529e83));if(_0x529e83[_0x3cf0('0x13')]){if(_0x529e83[_0x3cf0('0x13')][_0x3cf0('0x14')]===0x1f4){logger['error'](_0x3cf0('0x15'),_0x1f70c7,_0x529e83['error']['message']);return _0x184114(_0x529e83['error'][_0x3cf0('0x16')]);}logger['error'](_0x3cf0('0x15'),_0x1f70c7,_0x529e83['error'][_0x3cf0('0x16')]);return _0x1472f3(_0x529e83[_0x3cf0('0x13')][_0x3cf0('0x16')]);}else{logger['info'](_0x3cf0('0x15'),_0x1f70c7,'request\x20sent');_0x1472f3(_0x529e83[_0x3cf0('0x17')][_0x3cf0('0x16')]);}})[_0x3cf0('0x18')](function(_0xda5e75){logger[_0x3cf0('0x13')](_0x3cf0('0x15'),_0x1f70c7,_0xda5e75);_0x184114(_0xda5e75);});});} \ No newline at end of file +var _0x86e0=['randomstring','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86e0,0x134));var _0x086e=function(_0x43a35e,_0x1bde09){_0x43a35e=_0x43a35e-0x0;var _0x18bb51=_0x86e0[_0x43a35e];return _0x18bb51;};'use strict';var _=require(_0x086e('0x0'));var util=require(_0x086e('0x1'));var moment=require(_0x086e('0x2'));var BPromise=require(_0x086e('0x3'));var rs=require(_0x086e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x086e('0x5'))('rpc');var config=require(_0x086e('0x6'));var jayson=require(_0x086e('0x7'));var client=jayson['client'][_0x086e('0x8')]({'port':0x232a});config['redis']=_[_0x086e('0x9')](config[_0x086e('0xa')],{'host':_0x086e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x086e('0xc'))[_0x086e('0xd')](socket);function respondWithRpcPromise(_0x7aa033,_0x4cbced,_0x3d7941){return new BPromise(function(_0x5614e4,_0x2f9cfa){return client[_0x086e('0xe')](_0x7aa033,_0x3d7941)[_0x086e('0xf')](function(_0x3c9601){logger[_0x086e('0x10')](_0x086e('0x11'),_0x4cbced,_0x086e('0x12'));logger[_0x086e('0x13')](_0x086e('0x14'),_0x4cbced,'request\x20sent',JSON[_0x086e('0x15')](_0x3c9601));if(_0x3c9601[_0x086e('0x16')]){if(_0x3c9601[_0x086e('0x16')][_0x086e('0x17')]===0x1f4){logger[_0x086e('0x16')](_0x086e('0x11'),_0x4cbced,_0x3c9601[_0x086e('0x16')][_0x086e('0x18')]);return _0x2f9cfa(_0x3c9601[_0x086e('0x16')][_0x086e('0x18')]);}logger[_0x086e('0x16')](_0x086e('0x11'),_0x4cbced,_0x3c9601['error'][_0x086e('0x18')]);return _0x5614e4(_0x3c9601[_0x086e('0x16')][_0x086e('0x18')]);}else{logger[_0x086e('0x10')](_0x086e('0x11'),_0x4cbced,_0x086e('0x12'));_0x5614e4(_0x3c9601[_0x086e('0x19')]['message']);}})['catch'](function(_0x5a9a8d){logger[_0x086e('0x16')](_0x086e('0x11'),_0x4cbced,_0x5a9a8d);_0x2f9cfa(_0x5a9a8d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index caf43ce..5a0c952 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 _0x723f=['length','userNotification:','./userNotification.events','update','emit','register'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x723f,0x128));var _0xf723=function(_0x59eb6d,_0x1d8427){_0x59eb6d=_0x59eb6d-0x0;var _0x42f73f=_0x723f[_0x59eb6d];return _0x42f73f;};'use strict';var UserNotificationEvents=require(_0xf723('0x0'));var events=['save','remove',_0xf723('0x1')];function createListener(_0x50567d,_0x52630c){return function(_0x4a4642){_0x52630c[_0xf723('0x2')](_0x50567d,_0x4a4642);};}function removeListener(_0x1383b8,_0x275b01){return function(){UserNotificationEvents['removeListener'](_0x1383b8,_0x275b01);};}exports[_0xf723('0x3')]=function(_0x120849){for(var _0x321079=0x0,_0x45c8b4=events[_0xf723('0x4')];_0x321079<_0x45c8b4;_0x321079++){var _0x9192c=events[_0x321079];var _0x51a585=createListener(_0xf723('0x5')+_0x9192c,_0x120849);UserNotificationEvents['on'](_0x9192c,_0x51a585);}}; \ No newline at end of file +var _0xc5c4=['length','userNotification:','./userNotification.events','save','remove'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0xc5c4,0x18d));var _0x4c5c=function(_0x4d93d0,_0x19504a){_0x4d93d0=_0x4d93d0-0x0;var _0x2bcca4=_0xc5c4[_0x4d93d0];return _0x2bcca4;};'use strict';var UserNotificationEvents=require(_0x4c5c('0x0'));var events=[_0x4c5c('0x1'),_0x4c5c('0x2'),'update'];function createListener(_0x48c091,_0x30ed17){return function(_0x3546f6){_0x30ed17['emit'](_0x48c091,_0x3546f6);};}function removeListener(_0x4be5da,_0x7c1e75){return function(){UserNotificationEvents['removeListener'](_0x4be5da,_0x7c1e75);};}exports['register']=function(_0x217481){for(var _0x502bee=0x0,_0x1f6a56=events[_0x4c5c('0x3')];_0x502bee<_0x1f6a56;_0x502bee++){var _0x3ade77=events[_0x502bee];var _0x31f288=createListener(_0x4c5c('0x4')+_0x3ade77,_0x217481);UserNotificationEvents['on'](_0x3ade77,_0x31f288);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e23d8e1..4887397 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x536919,_0x2d0c68){var _0x3694d9=function(_0xf21223){while(--_0xf21223){_0x536919['push'](_0x536919['shift']());}};_0x3694d9(++_0x2d0c68);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x57f847,_0x33175b){var _0x2ebdcb=function(_0x432763){while(--_0x432763){_0x57f847['push'](_0x57f847['shift']());}};_0x2ebdcb(++_0x33175b);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f1e5b,_0x136a30){_0x2f1e5b=_0x2f1e5b-0x0;var _0x4a1898=_0xedd9[_0x2f1e5b];return _0x4a1898;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 886ec8e..0b2fac0 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 _0x23a3=['sequelize','INTEGER'];(function(_0x40710f,_0x3f145e){var _0x591385=function(_0x1615e4){while(--_0x1615e4){_0x40710f['push'](_0x40710f['shift']());}};_0x591385(++_0x3f145e);}(_0x23a3,0x1ac));var _0x323a=function(_0x3513e2,_0x26f645){_0x3513e2=_0x3513e2-0x0;var _0x186e8f=_0x23a3[_0x3513e2];return _0x186e8f;};'use strict';var Sequelize=require(_0x323a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x323a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x53ab=['INTEGER','sequelize','exports'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x53ab,0x130));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb53a('0x0'));module[_0xb53a('0x1')]={'penalty':{'type':Sequelize[_0xb53a('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 7d09cc6..018a1f0 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 _0x36ec=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','UserOpenchannelQueue'];(function(_0x2757fc,_0xfbd23){var _0x58efc4=function(_0x3a9f1e){while(--_0x3a9f1e){_0x2757fc['push'](_0x2757fc['shift']());}};_0x58efc4(++_0xfbd23);}(_0x36ec,0x6c));var _0xc36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc36e('0x0'));var util=require('util');var logger=require(_0xc36e('0x1'))(_0xc36e('0x2'));var moment=require(_0xc36e('0x3'));var BPromise=require(_0xc36e('0x4'));var rp=require(_0xc36e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc36e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc36e('0x7'));module['exports']=function(_0x14108f,_0x5493e6){return _0x14108f['define'](_0xc36e('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6bd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger'];(function(_0x199369,_0x5bcabe){var _0x5b3831=function(_0x25fa61){while(--_0x25fa61){_0x199369['push'](_0x199369['shift']());}};_0x5b3831(++_0x5bcabe);}(_0xd6bd,0x11a));var _0xdd6b=function(_0xc297bc,_0x2aed50){_0xc297bc=_0xc297bc-0x0;var _0xed03d3=_0xd6bd[_0xc297bc];return _0xed03d3;};'use strict';var _=require(_0xdd6b('0x0'));var util=require(_0xdd6b('0x1'));var logger=require(_0xdd6b('0x2'))(_0xdd6b('0x3'));var moment=require(_0xdd6b('0x4'));var BPromise=require(_0xdd6b('0x5'));var rp=require(_0xdd6b('0x6'));var fs=require('fs');var path=require(_0xdd6b('0x7'));var rimraf=require(_0xdd6b('0x8'));var config=require(_0xdd6b('0x9'));var attributes=require(_0xdd6b('0xa'));module[_0xdd6b('0xb')]=function(_0x8a1ad,_0x3b974b){return _0x8a1ad[_0xdd6b('0xc')](_0xdd6b('0xd'),attributes,{'tableName':_0xdd6b('0xe'),'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 546f3f3..1fd3d11 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 _0x79bb=['rpc','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x226c11,_0x14c0a4){var _0x4dc73e=function(_0x17e242){while(--_0x17e242){_0x226c11['push'](_0x226c11['shift']());}};_0x4dc73e(++_0x14c0a4);}(_0x79bb,0x9b));var _0xb79b=function(_0x1d0ee7,_0x1f26f0){_0x1d0ee7=_0x1d0ee7-0x0;var _0x243bd7=_0x79bb[_0x1d0ee7];return _0x243bd7;};'use strict';var _=require(_0xb79b('0x0'));var util=require(_0xb79b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb79b('0x2'));var fs=require('fs');var Redis=require(_0xb79b('0x3'));var db=require(_0xb79b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb79b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb79b('0x6')][_0xb79b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a818d,_0x30c859,_0x319a66){return new BPromise(function(_0x4e8c40,_0x43504b){return client[_0xb79b('0x8')](_0x2a818d,_0x319a66)['then'](function(_0x40f214){logger['info'](_0xb79b('0x9'),_0x30c859,_0xb79b('0xa'));logger['debug'](_0xb79b('0xb'),_0x30c859,_0xb79b('0xa'),JSON['stringify'](_0x40f214));if(_0x40f214['error']){if(_0x40f214[_0xb79b('0xc')]['code']===0x1f4){logger[_0xb79b('0xc')](_0xb79b('0x9'),_0x30c859,_0x40f214['error']['message']);return _0x43504b(_0x40f214['error'][_0xb79b('0xd')]);}logger[_0xb79b('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x30c859,_0x40f214[_0xb79b('0xc')][_0xb79b('0xd')]);return _0x4e8c40(_0x40f214[_0xb79b('0xc')][_0xb79b('0xd')]);}else{logger[_0xb79b('0xe')](_0xb79b('0x9'),_0x30c859,_0xb79b('0xa'));_0x4e8c40(_0x40f214[_0xb79b('0xf')][_0xb79b('0xd')]);}})['catch'](function(_0x2f2a69){logger['error'](_0xb79b('0x9'),_0x30c859,_0x2f2a69);_0x43504b(_0x2f2a69);});});} \ No newline at end of file +var _0x7a03=['client','http','request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7a03,0x1b7));var _0x37a0=function(_0x18eca2,_0x29c2a0){_0x18eca2=_0x18eca2-0x0;var _0x54538b=_0x7a03[_0x18eca2];return _0x54538b;};'use strict';var _=require(_0x37a0('0x0'));var util=require(_0x37a0('0x1'));var moment=require(_0x37a0('0x2'));var BPromise=require(_0x37a0('0x3'));var rs=require(_0x37a0('0x4'));var fs=require('fs');var Redis=require(_0x37a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x37a0('0x6'));var logger=require(_0x37a0('0x7'))(_0x37a0('0x8'));var config=require(_0x37a0('0x9'));var jayson=require(_0x37a0('0xa'));var client=jayson[_0x37a0('0xb')][_0x37a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a2ca1,_0x526d0f,_0x45ca08){return new BPromise(function(_0xbd21be,_0x36b3a2){return client[_0x37a0('0xd')](_0x4a2ca1,_0x45ca08)[_0x37a0('0xe')](function(_0x292410){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x526d0f,_0x37a0('0xf'));logger[_0x37a0('0x10')](_0x37a0('0x11'),_0x526d0f,'request\x20sent',JSON[_0x37a0('0x12')](_0x292410));if(_0x292410[_0x37a0('0x13')]){if(_0x292410[_0x37a0('0x13')][_0x37a0('0x14')]===0x1f4){logger[_0x37a0('0x13')](_0x37a0('0x15'),_0x526d0f,_0x292410[_0x37a0('0x13')][_0x37a0('0x16')]);return _0x36b3a2(_0x292410[_0x37a0('0x13')]['message']);}logger[_0x37a0('0x13')](_0x37a0('0x15'),_0x526d0f,_0x292410[_0x37a0('0x13')]['message']);return _0xbd21be(_0x292410[_0x37a0('0x13')][_0x37a0('0x16')]);}else{logger[_0x37a0('0x17')](_0x37a0('0x15'),_0x526d0f,_0x37a0('0xf'));_0xbd21be(_0x292410['result'][_0x37a0('0x16')]);}})[_0x37a0('0x18')](function(_0x2b6cba){logger[_0x37a0('0x13')](_0x37a0('0x15'),_0x526d0f,_0x2b6cba);_0x36b3a2(_0x2b6cba);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6f01352..eb80df1 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 _0x633a=['/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeResources','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x633a,0xbd));var _0xa633=function(_0x68222f,_0x66511a){_0x68222f=_0x68222f-0x0;var _0x56de12=_0x633a[_0x68222f];return _0x56de12;};'use strict';var multer=require(_0xa633('0x0'));var util=require(_0xa633('0x1'));var path=require(_0xa633('0x2'));var timeout=require(_0xa633('0x3'));var express=require(_0xa633('0x4'));var router=express['Router']();var fs_extra=require(_0xa633('0x5'));var auth=require(_0xa633('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa633('0x7'));var controller=require(_0xa633('0x8'));router[_0xa633('0x9')]('/',auth[_0xa633('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa633('0xb')]);router[_0xa633('0x9')](_0xa633('0xc'),auth['isAuthenticated'](),controller[_0xa633('0xd')]);router[_0xa633('0x9')](_0xa633('0xe'),auth[_0xa633('0xa')](),controller['getSections']);router['get'](_0xa633('0xf'),auth[_0xa633('0xa')](),controller[_0xa633('0x10')]);router[_0xa633('0x11')]('/',auth[_0xa633('0xa')](),controller[_0xa633('0x12')]);router[_0xa633('0x11')](_0xa633('0x13'),auth['isAuthenticated'](),controller[_0xa633('0x14')]);router['post'](_0xa633('0xe'),auth[_0xa633('0xa')](),controller[_0xa633('0x15')]);router[_0xa633('0x11')](_0xa633('0xf'),auth[_0xa633('0xa')](),controller[_0xa633('0x16')]);router[_0xa633('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa633('0x18')]);router[_0xa633('0x19')](_0xa633('0xc'),auth['isAuthenticated'](),controller[_0xa633('0x1a')]);router['delete']('/:id/sections',auth[_0xa633('0xa')](),controller['removeSections']);router['delete'](_0xa633('0xf'),auth['isAuthenticated'](),controller[_0xa633('0x1b')]);module[_0xa633('0x1c')]=router; \ No newline at end of file +var _0xcac2=['clone','addSections','/:id/resources','addResources','put','/:id','update','delete','destroy','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','show','/:id/sections','getSections','getResources','create','post'];(function(_0x17ce0d,_0x56e494){var _0x3cfefc=function(_0x44c69b){while(--_0x44c69b){_0x17ce0d['push'](_0x17ce0d['shift']());}};_0x3cfefc(++_0x56e494);}(_0xcac2,0x12c));var _0x2cac=function(_0x15c520,_0x197d0a){_0x15c520=_0x15c520-0x0;var _0x3b91cf=_0xcac2[_0x15c520];return _0x3b91cf;};'use strict';var multer=require('multer');var util=require(_0x2cac('0x0'));var path=require(_0x2cac('0x1'));var timeout=require(_0x2cac('0x2'));var express=require(_0x2cac('0x3'));var router=express[_0x2cac('0x4')]();var fs_extra=require(_0x2cac('0x5'));var auth=require(_0x2cac('0x6'));var interaction=require(_0x2cac('0x7'));var config=require(_0x2cac('0x8'));var controller=require(_0x2cac('0x9'));router[_0x2cac('0xa')]('/',auth[_0x2cac('0xb')](),controller['index']);router['get'](_0x2cac('0xc'),auth['isAuthenticated'](),controller[_0x2cac('0xd')]);router[_0x2cac('0xa')]('/:id',auth[_0x2cac('0xb')](),controller[_0x2cac('0xe')]);router[_0x2cac('0xa')](_0x2cac('0xf'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x10')]);router[_0x2cac('0xa')]('/:id/resources',auth[_0x2cac('0xb')](),controller[_0x2cac('0x11')]);router['post']('/',auth[_0x2cac('0xb')](),controller[_0x2cac('0x12')]);router[_0x2cac('0x13')]('/:id/clone',auth[_0x2cac('0xb')](),controller[_0x2cac('0x14')]);router[_0x2cac('0x13')](_0x2cac('0xf'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x15')]);router['post'](_0x2cac('0x16'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x17')]);router[_0x2cac('0x18')](_0x2cac('0x19'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x1a')]);router[_0x2cac('0x1b')](_0x2cac('0x19'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x1c')]);router['delete'](_0x2cac('0xf'),auth[_0x2cac('0xb')](),controller[_0x2cac('0x1d')]);router[_0x2cac('0x1b')]('/:id/resources',auth[_0x2cac('0xb')](),controller[_0x2cac('0x1e')]);module[_0x2cac('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e1ea297..ddf4218 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 _0xd4c5=['exports','STRING','setDataValue','getDataValue','BOOLEAN','sequelize'];(function(_0xdd4096,_0x1d7ca4){var _0x5e1ce6=function(_0x1af55b){while(--_0x1af55b){_0xdd4096['push'](_0xdd4096['shift']());}};_0x5e1ce6(++_0x1d7ca4);}(_0xd4c5,0xdd));var _0x5d4c=function(_0x464d23,_0x5710ba){_0x464d23=_0x464d23-0x0;var _0x86f638=_0xd4c5[_0x464d23];return _0x86f638;};'use strict';var Sequelize=require(_0x5d4c('0x0'));module[_0x5d4c('0x1')]={'name':{'type':Sequelize[_0x5d4c('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x5d4c('0x2')],'set':function(_0x186509){this[_0x5d4c('0x3')]('crudPermissions',_0x186509?_0x186509['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x5d4c('0x4')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5d4c('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5cd3=['name','setDataValue','crudPermissions','join','BOOLEAN','sequelize','STRING'];(function(_0x529d98,_0x12f54a){var _0x5a23fd=function(_0x50511d){while(--_0x50511d){_0x529d98['push'](_0x529d98['shift']());}};_0x5a23fd(++_0x12f54a);}(_0x5cd3,0xfa));var _0x35cd=function(_0x55e92d,_0x2d4e7a){_0x55e92d=_0x55e92d-0x0;var _0x21e2e5=_0x5cd3[_0x55e92d];return _0x21e2e5;};'use strict';var Sequelize=require(_0x35cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x35cd('0x1')],'allowNull':![],'unique':_0x35cd('0x2')},'crudPermissions':{'type':Sequelize[_0x35cd('0x1')],'set':function(_0x10db9b){this[_0x35cd('0x3')](_0x35cd('0x4'),_0x10db9b?_0x10db9b[_0x35cd('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x35cd('0x4'))?this['getDataValue'](_0x35cd('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x35cd('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x35cd('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 385d896..f33714f 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 _0xdd91=['ids','enabled','includes','isEmpty','subsections','concat','push','findOne','autoAssociation','Dashboard','forEach','resourceId','addResources','transaction','bulkCreate','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./userProfile.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','clone','updatedAt','crudPermissions','omit','sequelize','get','UserProfileSection','each','createdAt','sectionId','userProfileId','Resources','UserProfileResource','destroy','describe','addSections'];(function(_0x57e195,_0x103770){var _0x4f1230=function(_0x3e4ce2){while(--_0x3e4ce2){_0x57e195['push'](_0x57e195['shift']());}};_0x4f1230(++_0x103770);}(_0xdd91,0x168));var _0x1dd9=function(_0x4e8931,_0x83e273){_0x4e8931=_0x4e8931-0x0;var _0x34a486=_0xdd91[_0x4e8931];return _0x34a486;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1dd9('0x0'));var jsonpatch=require(_0x1dd9('0x1'));var rp=require(_0x1dd9('0x2'));var moment=require('moment');var BPromise=require(_0x1dd9('0x3'));var Mustache=require(_0x1dd9('0x4'));var util=require(_0x1dd9('0x5'));var path=require(_0x1dd9('0x6'));var sox=require('sox');var csv=require(_0x1dd9('0x7'));var ejs=require(_0x1dd9('0x8'));var fs=require('fs');var fs_extra=require(_0x1dd9('0x9'));var _=require(_0x1dd9('0xa'));var squel=require(_0x1dd9('0xb'));var crypto=require(_0x1dd9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1dd9('0xd'));var toCsv=require(_0x1dd9('0x7'));var querystring=require(_0x1dd9('0xe'));var Papa=require(_0x1dd9('0xf'));var Redis=require(_0x1dd9('0x10'));var authService=require(_0x1dd9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dd9('0x12'));var logger=require(_0x1dd9('0x13'))(_0x1dd9('0x14'));var utils=require(_0x1dd9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1dd9('0x16'));var db=require(_0x1dd9('0x17'))['db'];config[_0x1dd9('0x18')]=_['defaults'](config['redis'],{'host':_0x1dd9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1dd9('0x18')]));require(_0x1dd9('0x1a'))[_0x1dd9('0x1b')](socket);function respondWithStatusCode(_0x232926,_0x55f7ca){_0x55f7ca=_0x55f7ca||0xcc;return function(_0x2a2c7a){if(_0x2a2c7a){return _0x232926['sendStatus'](_0x55f7ca);}return _0x232926[_0x1dd9('0x1c')](_0x55f7ca)[_0x1dd9('0x1d')]();};}function respondWithResult(_0xbed631,_0x2d3977){_0x2d3977=_0x2d3977||0xc8;return function(_0x408be5){if(_0x408be5){return _0xbed631[_0x1dd9('0x1c')](_0x2d3977)[_0x1dd9('0x1e')](_0x408be5);}};}function respondWithFilteredResult(_0x3db413,_0x60053c){return function(_0x7d83ec){if(_0x7d83ec){var _0x4060da=typeof _0x60053c[_0x1dd9('0x1f')]==='undefined'&&typeof _0x60053c[_0x1dd9('0x20')]===_0x1dd9('0x21');var _0x337874=_0x7d83ec['count'];var _0x49e69c=_0x4060da?0x0:_0x60053c[_0x1dd9('0x1f')];var _0x4a1a86=_0x4060da?_0x7d83ec[_0x1dd9('0x22')]:_0x60053c[_0x1dd9('0x1f')]+_0x60053c[_0x1dd9('0x20')];var _0x479229;if(_0x4a1a86>=_0x337874){_0x4a1a86=_0x337874;_0x479229=0xc8;}else{_0x479229=0xce;}_0x3db413[_0x1dd9('0x1c')](_0x479229);return _0x3db413['set'](_0x1dd9('0x23'),_0x49e69c+'-'+_0x4a1a86+'/'+_0x337874)['json'](_0x7d83ec);}return null;};}function patchUpdates(_0x207ea5){return function(_0x1da3c4){try{jsonpatch[_0x1dd9('0x24')](_0x1da3c4,_0x207ea5,!![]);}catch(_0x10e3d5){return BPromise[_0x1dd9('0x25')](_0x10e3d5);}return _0x1da3c4[_0x1dd9('0x26')]();};}function saveUpdates(_0x3b8102,_0x2b7eee){return function(_0x422f23){if(_0x422f23){return _0x422f23[_0x1dd9('0x27')](_0x3b8102)[_0x1dd9('0x28')](function(_0x22c2ce){return _0x22c2ce;});}return null;};}function removeEntity(_0x5ca0ac,_0x292297){return function(_0x5f3e26){if(_0x5f3e26){return _0x5f3e26['destroy']()['then'](function(){_0x5ca0ac[_0x1dd9('0x1c')](0xcc)[_0x1dd9('0x1d')]();});}};}function handleEntityNotFound(_0x32567a,_0x148822){return function(_0x44aed7){if(!_0x44aed7){_0x32567a[_0x1dd9('0x29')](0x194);}return _0x44aed7;};}function handleError(_0x160999,_0x3e394e){_0x3e394e=_0x3e394e||0x1f4;return function(_0x4db163){logger[_0x1dd9('0x2a')](_0x4db163[_0x1dd9('0x2b')]);if(_0x4db163[_0x1dd9('0x2c')]){delete _0x4db163[_0x1dd9('0x2c')];}_0x160999[_0x1dd9('0x1c')](_0x3e394e)[_0x1dd9('0x2d')](_0x4db163);};}exports[_0x1dd9('0x2e')]=function(_0x13e8ea,_0x52400a){var _0x2e3629={},_0xc8ad9f={},_0x51389a={'count':0x0,'rows':[]};var _0x1d2eaa=_[_0x1dd9('0x2f')](db['UserProfile']['rawAttributes'],function(_0x51eb52){return{'name':_0x51eb52['fieldName'],'type':_0x51eb52[_0x1dd9('0x30')][_0x1dd9('0x31')]};});_0xc8ad9f[_0x1dd9('0x32')]=_[_0x1dd9('0x2f')](_0x1d2eaa,_0x1dd9('0x2c'));_0xc8ad9f[_0x1dd9('0x33')]=_[_0x1dd9('0x34')](_0x13e8ea[_0x1dd9('0x33')]);_0xc8ad9f[_0x1dd9('0x35')]=_['intersection'](_0xc8ad9f['model'],_0xc8ad9f[_0x1dd9('0x33')]);_0x2e3629[_0x1dd9('0x36')]=_[_0x1dd9('0x37')](_0xc8ad9f['model'],qs[_0x1dd9('0x38')](_0x13e8ea[_0x1dd9('0x33')]['fields']));_0x2e3629[_0x1dd9('0x36')]=_0x2e3629[_0x1dd9('0x36')][_0x1dd9('0x39')]?_0x2e3629[_0x1dd9('0x36')]:_0xc8ad9f[_0x1dd9('0x32')];if(!_0x13e8ea[_0x1dd9('0x33')][_0x1dd9('0x3a')](_0x1dd9('0x3b'))){_0x2e3629[_0x1dd9('0x20')]=qs['limit'](_0x13e8ea['query'][_0x1dd9('0x20')]);_0x2e3629[_0x1dd9('0x1f')]=qs[_0x1dd9('0x1f')](_0x13e8ea['query']['offset']);}_0x2e3629[_0x1dd9('0x3c')]=qs[_0x1dd9('0x3d')](_0x13e8ea[_0x1dd9('0x33')]['sort']);_0x2e3629[_0x1dd9('0x3e')]=qs[_0x1dd9('0x35')](_[_0x1dd9('0x3f')](_0x13e8ea['query'],_0xc8ad9f[_0x1dd9('0x35')]),_0x1d2eaa);if(_0x13e8ea['query'][_0x1dd9('0x40')]){_0x2e3629[_0x1dd9('0x3e')]=_[_0x1dd9('0x41')](_0x2e3629[_0x1dd9('0x3e')],{'$or':_[_0x1dd9('0x2f')](_0x1d2eaa,function(_0x410204){if(_0x410204[_0x1dd9('0x30')]!==_0x1dd9('0x42')){var _0x3fc427={};_0x3fc427[_0x410204[_0x1dd9('0x2c')]]={'$like':'%'+_0x13e8ea[_0x1dd9('0x33')][_0x1dd9('0x40')]+'%'};return _0x3fc427;}})});}_0x2e3629=_['merge']({},_0x2e3629,_0x13e8ea[_0x1dd9('0x43')]);var _0x350287={'where':_0x2e3629['where']};return db[_0x1dd9('0x44')][_0x1dd9('0x22')](_0x350287)[_0x1dd9('0x28')](function(_0x1b79e6){_0x51389a['count']=_0x1b79e6;if(_0x13e8ea[_0x1dd9('0x33')][_0x1dd9('0x45')]){_0x2e3629['include']=[{'all':!![]}];}return db[_0x1dd9('0x44')][_0x1dd9('0x46')](_0x2e3629);})[_0x1dd9('0x28')](function(_0x220d35){_0x51389a[_0x1dd9('0x47')]=_0x220d35;return _0x51389a;})['then'](respondWithFilteredResult(_0x52400a,_0x2e3629))['catch'](handleError(_0x52400a,null));};exports[_0x1dd9('0x48')]=function(_0x12c74b,_0x2f59b2){var _0x489979={'raw':![],'where':{'id':_0x12c74b[_0x1dd9('0x49')]['id']}},_0x24ced9={};_0x24ced9[_0x1dd9('0x32')]=_['keys'](db[_0x1dd9('0x44')][_0x1dd9('0x4a')]);_0x24ced9['query']=_['keys'](_0x12c74b[_0x1dd9('0x33')]);_0x24ced9['filters']=_[_0x1dd9('0x37')](_0x24ced9[_0x1dd9('0x32')],_0x24ced9[_0x1dd9('0x33')]);_0x489979[_0x1dd9('0x36')]=_[_0x1dd9('0x37')](_0x24ced9[_0x1dd9('0x32')],qs[_0x1dd9('0x38')](_0x12c74b[_0x1dd9('0x33')][_0x1dd9('0x38')]));_0x489979[_0x1dd9('0x36')]=_0x489979['attributes'][_0x1dd9('0x39')]?_0x489979[_0x1dd9('0x36')]:_0x24ced9[_0x1dd9('0x32')];if(_0x12c74b[_0x1dd9('0x33')]['includeAll']){_0x489979[_0x1dd9('0x4b')]=[{'all':!![]}];}_0x489979=_['merge']({},_0x489979,_0x12c74b['options']);return db[_0x1dd9('0x44')][_0x1dd9('0x4c')](_0x489979)[_0x1dd9('0x28')](handleEntityNotFound(_0x2f59b2,null))[_0x1dd9('0x28')](respondWithResult(_0x2f59b2,null))[_0x1dd9('0x4d')](handleError(_0x2f59b2,null));};exports[_0x1dd9('0x4e')]=function(_0x2bee0f,_0x2fe8b9){return db[_0x1dd9('0x44')][_0x1dd9('0x4e')](_0x2bee0f[_0x1dd9('0x4f')],{})[_0x1dd9('0x28')](respondWithResult(_0x2fe8b9,0xc9))['catch'](handleError(_0x2fe8b9,null));};exports[_0x1dd9('0x50')]=function(_0x2f546b,_0x5743c8){var _0xd02495={'where':{'id':_0x2f546b['params']['id']}},_0x4eb520={};_0x4eb520['model']=_[_0x1dd9('0x34')](db[_0x1dd9('0x44')][_0x1dd9('0x4a')]);_0xd02495[_0x1dd9('0x36')]=_[_0x1dd9('0x37')](_0x4eb520[_0x1dd9('0x32')],qs['fields'](_0x2f546b['query'][_0x1dd9('0x38')]));_0xd02495[_0x1dd9('0x36')]=_0xd02495[_0x1dd9('0x36')][_0x1dd9('0x39')]?_0xd02495['attributes']:_0x4eb520[_0x1dd9('0x32')];if(_0x2f546b[_0x1dd9('0x33')][_0x1dd9('0x45')]){_0xd02495[_0x1dd9('0x4b')]=[{'all':!![]}];}_0xd02495=_[_0x1dd9('0x41')]({},_0xd02495,_0x2f546b[_0x1dd9('0x43')]);return db[_0x1dd9('0x44')][_0x1dd9('0x4c')](_0xd02495)[_0x1dd9('0x28')](handleEntityNotFound(_0x5743c8,null))['then'](function(_0x16609c){if(_0x16609c){var _0x3c816d=_0x16609c['get']({'plain':!![]});_0x3c816d=qs['omit'](_0x3c816d,['id','createdAt',_0x1dd9('0x51'),_0x1dd9('0x52')]);_0x2f546b[_0x1dd9('0x4f')]=_[_0x1dd9('0x53')](_0x2f546b[_0x1dd9('0x4f')],['id','createdAt',_0x1dd9('0x51')]);return db[_0x1dd9('0x54')]['transaction'](function(_0x5f5289){return db['UserProfile'][_0x1dd9('0x4e')](_[_0x1dd9('0x41')](_0x3c816d,_0x2f546b[_0x1dd9('0x4f')]),{'include':_0x2f546b[_0x1dd9('0x33')][_0x1dd9('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x5f5289})[_0x1dd9('0x28')](function(_0x469584){var _0xa19a95=_0x469584[_0x1dd9('0x55')]({'plain':!![]});return db[_0x1dd9('0x56')][_0x1dd9('0x46')]({'where':{'userProfileId':_0x2f546b[_0x1dd9('0x49')]['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0x344765){if(_0x344765){return BPromise[_0x1dd9('0x57')](_0x344765,function(_0x2e87a6){return new BPromise(function(_0x498b5e,_0x20c705){if(_0x2e87a6['autoAssociation']===null||_0x2e87a6['autoAssociation']===0x1)_0x498b5e(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2e87a6['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0x57295e){var _0x3d9313=_[_0x1dd9('0x2f')](_0x57295e,function(_0x253d15){return qs[_0x1dd9('0x53')](_0x253d15,['id',_0x1dd9('0x58'),_0x1dd9('0x51'),_0x1dd9('0x59')]);});_0x498b5e(_0x3d9313);})[_0x1dd9('0x4d')](function(_0x3e7f45){_0x20c705(_0x3e7f45);});})[_0x1dd9('0x28')](function(_0x5bdb26){var _0x405cfc=qs[_0x1dd9('0x53')](_0x2e87a6,['id','createdAt','updatedAt']);_0x405cfc[_0x1dd9('0x5a')]=_0xa19a95['id'];if(_0x5bdb26)_0x405cfc[_0x1dd9('0x5b')]=_0x5bdb26;return _0x405cfc;})[_0x1dd9('0x28')](function(_0x34a2be){return db[_0x1dd9('0x56')]['create'](_0x34a2be,{'include':[{'model':db[_0x1dd9('0x5c')],'as':_0x1dd9('0x5b')}],'raw':!![],'transaction':_0x5f5289});});})[_0x1dd9('0x28')](function(){return _0xa19a95;});}});});});}})[_0x1dd9('0x28')](respondWithResult(_0x5743c8,0xc9))[_0x1dd9('0x4d')](handleError(_0x5743c8,null));};exports['update']=function(_0x1b09f7,_0xdbc27a){if(_0x1b09f7[_0x1dd9('0x4f')]['id']){delete _0x1b09f7[_0x1dd9('0x4f')]['id'];}return db[_0x1dd9('0x44')][_0x1dd9('0x4c')]({'where':{'id':_0x1b09f7[_0x1dd9('0x49')]['id']}})['then'](handleEntityNotFound(_0xdbc27a,null))[_0x1dd9('0x28')](saveUpdates(_0x1b09f7[_0x1dd9('0x4f')],null))[_0x1dd9('0x28')](respondWithResult(_0xdbc27a,null))[_0x1dd9('0x4d')](handleError(_0xdbc27a,null));};exports[_0x1dd9('0x5d')]=function(_0x321ad5,_0x32a6a4){return db[_0x1dd9('0x44')][_0x1dd9('0x4c')]({'where':{'id':_0x321ad5[_0x1dd9('0x49')]['id']}})[_0x1dd9('0x28')](handleEntityNotFound(_0x32a6a4,null))[_0x1dd9('0x28')](removeEntity(_0x32a6a4,null))['catch'](handleError(_0x32a6a4,null));};exports[_0x1dd9('0x5e')]=function(_0x5b7922,_0x46e035){return db['UserProfile'][_0x1dd9('0x5e')]()['then'](respondWithResult(_0x46e035,null))[_0x1dd9('0x4d')](handleError(_0x46e035,null));};exports[_0x1dd9('0x5f')]=function(_0x39a83b,_0x4a75f4){var _0x4bf65b=_0x39a83b[_0x1dd9('0x4f')];return db['UserProfile'][_0x1dd9('0x4c')]({'where':{'id':_0x39a83b[_0x1dd9('0x49')]['id']}})[_0x1dd9('0x28')](handleEntityNotFound(_0x4a75f4,null))[_0x1dd9('0x28')](function(_0x57bef3){if(_0x57bef3){return db['sequelize']['transaction'](function(_0x78f290){return db[_0x1dd9('0x56')][_0x1dd9('0x5d')]({'where':{'userProfileId':_0x39a83b['params']['id'],'sectionId':_[_0x1dd9('0x2f')](_0x4bf65b,function(_0xb77da9){return _0xb77da9['sectionId'];})},'transaction':_0x78f290})[_0x1dd9('0x28')](function(){var _0x1392a7=_[_0x1dd9('0x2f')](_0x4bf65b,function(_0x500701){_0x500701[_0x1dd9('0x5a')]=_0x39a83b[_0x1dd9('0x49')]['id'];return _0x500701;});var _0x4d1585=[];return BPromise['each'](_0x1392a7,function(_0x4f29b5){return db[_0x1dd9('0x56')][_0x1dd9('0x4e')](_0x4f29b5,{'include':[{'model':db[_0x1dd9('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x78f290})[_0x1dd9('0x28')](function(_0x121647){_0x4d1585['push'](_0x121647['get']({'plain':!![]}));});})[_0x1dd9('0x28')](function(){return _0x4d1585;});});});}})['then'](function(_0x50eb24){return _0x50eb24;})[_0x1dd9('0x28')](respondWithResult(_0x4a75f4,null))[_0x1dd9('0x4d')](handleError(_0x4a75f4,null));};exports['removeSections']=function(_0xe67f87,_0x3e01e0){var _0x5adb29;return db[_0x1dd9('0x44')]['find']({'where':{'id':_0xe67f87[_0x1dd9('0x49')]['id']},'attributes':['id',_0x1dd9('0x2c')]})[_0x1dd9('0x28')](handleEntityNotFound(_0x3e01e0,null))['then'](function(_0x1dc3eb){if(_0x1dc3eb){_0x5adb29=_0x1dc3eb;return db[_0x1dd9('0x56')][_0x1dd9('0x5d')]({'where':{'userProfileId':_0xe67f87[_0x1dd9('0x49')]['id'],'sectionId':_0xe67f87[_0x1dd9('0x33')][_0x1dd9('0x60')]}});}})['then'](function(){return _0x5adb29;})[_0x1dd9('0x28')](respondWithStatusCode(_0x3e01e0,null))[_0x1dd9('0x4d')](handleError(_0x3e01e0,null));};exports['getSections']=function(_0x40ada1,_0x44050e){var _0x275467=[];var _0x8a9fa6=[];return db[_0x1dd9('0x56')]['findAll']({'where':{'userProfileId':_0x40ada1[_0x1dd9('0x49')]['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0xfd791b){_0x275467=_[_0x1dd9('0x40')](_0xfd791b,function(_0x3bfd73){return _0x3bfd73[_0x1dd9('0x61')]===0x1||_[_0x1dd9('0x62')]([0x3eb,0x709],_0x3bfd73[_0x1dd9('0x59')]);});if(!_[_0x1dd9('0x63')](_0x275467)){return _[_0x1dd9('0x2f')](_0x275467,function(_0x8fa97f){return _0x8fa97f['sectionId'];});}else{return;}})[_0x1dd9('0x28')](function(_0xb08f1b){if(_0xb08f1b)_0x8a9fa6=_0xb08f1b;if(_['includes'](_0x8a9fa6,0x64)){var _0x5585e0=_[_0x1dd9('0x4c')](_0x275467,{'sectionId':0x64});return hasDefaultDashboard(_0x5585e0)['then'](function(_0x26bfec){return _[_0x1dd9('0x2f')](_0x275467,function(_0x37527d){if(_0x37527d[_0x1dd9('0x59')]===0x64){_0x37527d['subsections']=_0x26bfec;}return _0x37527d;});});}else{return;}})[_0x1dd9('0x28')](function(_0x36b172){if(_0x36b172)_0x275467=_0x36b172;if(_[_0x1dd9('0x62')](_0x8a9fa6,0x3eb)){var _0x5560d6=_[_0x1dd9('0x4c')](_0x275467,{'sectionId':0x3eb});return getCustomDashboards(_0x5560d6)[_0x1dd9('0x28')](function(_0x5ee668){return _[_0x1dd9('0x2f')](_0x275467,function(_0x22c967){if(_0x5560d6[_0x1dd9('0x61')]){if(_0x22c967[_0x1dd9('0x59')]===0x3eb){_0x22c967[_0x1dd9('0x64')]=_0x5ee668;}}else{if(_0x22c967[_0x1dd9('0x59')]===0x64){if(!_0x22c967[_0x1dd9('0x64')]){_0x22c967[_0x1dd9('0x64')]=[];}_0x22c967[_0x1dd9('0x64')]=_0x22c967['subsections'][_0x1dd9('0x65')](_0x5ee668);}}return _0x22c967;});});}else{return;}})[_0x1dd9('0x28')](function(_0x543df3){if(_0x543df3)_0x275467=_0x543df3;if(_[_0x1dd9('0x62')](_0x8a9fa6,0x709)){var _0x55ca73=_['find'](_0x275467,{'sectionId':0x709});return getPlugins(_0x55ca73)['then'](function(_0x54f79a){if(_0x55ca73[_0x1dd9('0x61')]){return _[_0x1dd9('0x2f')](_0x275467,function(_0x4c690d){if(_0x4c690d[_0x1dd9('0x59')]===0x709){_0x4c690d[_0x1dd9('0x64')]=_0x54f79a;}return _0x4c690d;});}else{var _0x4c0e21={'sectionId':0x76c,'enabled':0x1,'subsections':_0x54f79a};var _0x3de3e9=_[_0x1dd9('0x2f')](_0x275467);_0x3de3e9[_0x1dd9('0x66')](_0x4c0e21);return _0x3de3e9;}});}else{return;}})[_0x1dd9('0x28')](function(_0x4966e6){if(_0x4966e6)_0x275467=_0x4966e6;return _[_0x1dd9('0x40')](_0x275467,['enabled',0x1]);})[_0x1dd9('0x28')](respondWithResult(_0x44050e,null))[_0x1dd9('0x4d')](handleError(_0x44050e,null));};function hasDefaultDashboard(_0x20d50d){var _0x5cf2f7=[0x65];return new BPromise(function(_0x153280,_0xbffe50){try{if(_0x20d50d['autoAssociation']){_0x153280(_0x5cf2f7);}else{return db['UserProfileResource'][_0x1dd9('0x67')]({'where':{'sectionId':_0x20d50d['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0xb39d0d){_0xb39d0d?_0x153280(_0x5cf2f7):_0x153280();});}}catch(_0x2f5731){_0xbffe50(_0x2f5731);}});}function getCustomDashboards(_0x4a04d5){var _0x3431a0=[];return new BPromise(function(_0x51bf0d,_0xda5a4e){try{if(_0x4a04d5[_0x1dd9('0x68')]){return db[_0x1dd9('0x69')][_0x1dd9('0x46')]({'raw':!![]})[_0x1dd9('0x28')](function(_0x164162){_0x164162[_0x1dd9('0x6a')](function(_0x3426b1){_0x3431a0['push'](_0x3426b1['id']+0x1869f);});_0x51bf0d(_0x3431a0);});}else{return db['UserProfileResource'][_0x1dd9('0x46')]({'where':{'sectionId':_0x4a04d5['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0x4aee84){_0x4aee84['forEach'](function(_0x16b24a){_0x3431a0[_0x1dd9('0x66')](_0x16b24a[_0x1dd9('0x6b')]+0x1869f);});_0x51bf0d(_0x3431a0);});}}catch(_0x46022a){_0xda5a4e(_0x46022a);}});}function getPlugins(_0x12aaeb){var _0x23b77a=[];return new BPromise(function(_0x50196a,_0x389ae4){try{if(_0x12aaeb[_0x1dd9('0x68')]){return db['Plugin'][_0x1dd9('0x46')]({'raw':!![]})[_0x1dd9('0x28')](function(_0x5b2cd6){_0x5b2cd6[_0x1dd9('0x6a')](function(_0x4b872b){_0x23b77a['push'](_0x4b872b['id']+0x15b38);});_0x50196a(_0x23b77a);});}else{return db[_0x1dd9('0x5c')][_0x1dd9('0x46')]({'where':{'sectionId':_0x12aaeb['id']},'raw':!![]})[_0x1dd9('0x28')](function(_0x2e3304){_0x2e3304[_0x1dd9('0x6a')](function(_0x14dea4){_0x23b77a[_0x1dd9('0x66')](_0x14dea4[_0x1dd9('0x6b')]+0x15b38);});_0x50196a(_0x23b77a);});}}catch(_0x31bf40){_0x389ae4(_0x31bf40);}});}exports[_0x1dd9('0x6c')]=function(_0xfba63e,_0x33a54d){return db[_0x1dd9('0x44')][_0x1dd9('0x4c')]({'where':{'id':_0xfba63e[_0x1dd9('0x49')]['id']}})[_0x1dd9('0x28')](handleEntityNotFound(_0x33a54d,null))['then'](function(_0x8b0dee){if(_0x8b0dee){return db['sequelize'][_0x1dd9('0x6d')](function(_0x259455){return db[_0x1dd9('0x56')][_0x1dd9('0x46')]({'where':{'userProfileId':_0xfba63e[_0x1dd9('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x1dd9('0x28')](function(_0x48e5a8){if(_0x48e5a8){return db[_0x1dd9('0x56')]['destroy']({'where':{'userProfileId':_0xfba63e[_0x1dd9('0x49')]['id'],'id':_[_0x1dd9('0x2f')](_0x48e5a8,function(_0x33976f){return _0x33976f['id'];})},'transaction':_0x259455});}})[_0x1dd9('0x28')](function(_0x1d1a69){var _0x42b971=_[_0x1dd9('0x2f')](_0xfba63e[_0x1dd9('0x4f')],function(_0x47dfd3){_0x47dfd3[_0x1dd9('0x5a')]=_0xfba63e[_0x1dd9('0x49')]['id'];return _0x47dfd3;});return db[_0x1dd9('0x56')][_0x1dd9('0x6e')](_0x42b971,{'raw':!![],'transaction':_0x259455});})[_0x1dd9('0x28')](function(_0xb0add5){var _0x1fc7d6=_[_0x1dd9('0x40')](_[_0x1dd9('0x2f')](_0xb0add5,function(_0x54f52a){return _0x54f52a[_0x1dd9('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x1fc7d6){return db[_0x1dd9('0x56')][_0x1dd9('0x46')]({'where':{'userProfileId':_0xfba63e['params']['id'],'sectionId':_[_0x1dd9('0x2f')](_0x1fc7d6,function(_0x44d9fb){return _0x44d9fb['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x3f5b3a){var _0x53c804=_[_0x1dd9('0x2f')](_0xfba63e[_0x1dd9('0x4f')],function(_0x578c11){_0x578c11['userProfileId']=_0xfba63e[_0x1dd9('0x49')]['id'];return _0x578c11;});return db['UserProfileResource'][_0x1dd9('0x6e')](_0x53c804,{'raw':!![],'transaction':_0x259455});});}})['catch'](handleError(_0x33a54d,null));});}})['then'](function(_0x1b8c19){var _0x21edb0=_[_0x1dd9('0x2f')](_0x1b8c19,function(_0x124d0e){return _0x124d0e['get']({'plain':!![]});});})['then'](respondWithResult(_0x33a54d,null))['catch'](handleError(_0x33a54d,null));};exports['removeResources']=function(_0x48969a,_0x509100,_0x5692ba){return db[_0x1dd9('0x44')][_0x1dd9('0x4c')]({'where':{'id':_0x48969a[_0x1dd9('0x49')]['id']}})[_0x1dd9('0x28')](handleEntityNotFound(_0x509100,null))[_0x1dd9('0x28')](function(_0x2928c2){if(_0x2928c2){return _0x2928c2['removeResources'](_0x48969a['query'][_0x1dd9('0x60')]);}})[_0x1dd9('0x28')](respondWithStatusCode(_0x509100,null))[_0x1dd9('0x4d')](handleError(_0x509100,null));};exports[_0x1dd9('0x6f')]=function(_0x43d8e2,_0x23f969){var _0x125d31={};if(!_0x43d8e2['query'][_0x1dd9('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x43d8e2[_0x1dd9('0x33')][_0x1dd9('0x3a')](_0x1dd9('0x3b'))){_0x125d31['limit']=qs['limit'](_0x43d8e2[_0x1dd9('0x33')][_0x1dd9('0x20')]);_0x125d31[_0x1dd9('0x1f')]=qs[_0x1dd9('0x1f')](_0x43d8e2[_0x1dd9('0x33')][_0x1dd9('0x1f')]);}return db[_0x1dd9('0x44')]['find']({'where':{'id':_0x43d8e2[_0x1dd9('0x49')]['id']}})[_0x1dd9('0x28')](function(_0x11935c){if(!_0x11935c)throw new Error(_0x1dd9('0x71')+_0x43d8e2['params']['id']);return db[_0x1dd9('0x44')][_0x1dd9('0x6f')](_0x43d8e2);})[_0x1dd9('0x28')](respondWithFilteredResult(_0x23f969,_0x125d31))[_0x1dd9('0x4d')](handleError(_0x23f969,null));}; \ No newline at end of file +var _0x852d=['save','update','then','error','name','send','index','map','UserProfile','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','length','includeAll','find','create','get','omit','createdAt','updatedAt','body','sequelize','transaction','each','autoAssociation','userProfileId','Resources','UserProfileSection','UserProfileResource','destroy','describe','addSections','push','removeSections','ids','getSections','enabled','includes','sectionId','isEmpty','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x852d,0x190));var _0xd852=function(_0x21d833,_0x2ceace){_0x21d833=_0x21d833-0x0;var _0x3b1d3e=_0x852d[_0x21d833];return _0x3b1d3e;};'use strict';var emlformat=require(_0xd852('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd852('0x1'));var rp=require(_0xd852('0x2'));var moment=require('moment');var BPromise=require(_0xd852('0x3'));var Mustache=require(_0xd852('0x4'));var util=require('util');var path=require(_0xd852('0x5'));var sox=require('sox');var csv=require(_0xd852('0x6'));var ejs=require(_0xd852('0x7'));var fs=require('fs');var fs_extra=require(_0xd852('0x8'));var _=require(_0xd852('0x9'));var squel=require('squel');var crypto=require(_0xd852('0xa'));var jsforce=require(_0xd852('0xb'));var deskjs=require(_0xd852('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd852('0xd'));var Redis=require(_0xd852('0xe'));var authService=require(_0xd852('0xf'));var qs=require(_0xd852('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd852('0x11'));var logger=require(_0xd852('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd852('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd852('0x14'))['db'];config[_0xd852('0x15')]=_[_0xd852('0x16')](config[_0xd852('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd852('0x17'))(new Redis(config[_0xd852('0x15')]));require(_0xd852('0x18'))[_0xd852('0x19')](socket);function respondWithStatusCode(_0x4e50b7,_0x45223a){_0x45223a=_0x45223a||0xcc;return function(_0x3f30ad){if(_0x3f30ad){return _0x4e50b7[_0xd852('0x1a')](_0x45223a);}return _0x4e50b7[_0xd852('0x1b')](_0x45223a)[_0xd852('0x1c')]();};}function respondWithResult(_0x54ec26,_0x3df65b){_0x3df65b=_0x3df65b||0xc8;return function(_0x20786f){if(_0x20786f){return _0x54ec26[_0xd852('0x1b')](_0x3df65b)['json'](_0x20786f);}};}function respondWithFilteredResult(_0x44b4ed,_0x3f1353){return function(_0x586f97){if(_0x586f97){var _0x2cb66b=typeof _0x3f1353[_0xd852('0x1d')]===_0xd852('0x1e')&&typeof _0x3f1353['limit']==='undefined';var _0x37bce5=_0x586f97[_0xd852('0x1f')];var _0xa46bc1=_0x2cb66b?0x0:_0x3f1353[_0xd852('0x1d')];var _0x7d37f4=_0x2cb66b?_0x586f97[_0xd852('0x1f')]:_0x3f1353[_0xd852('0x1d')]+_0x3f1353['limit'];var _0x1362c3;if(_0x7d37f4>=_0x37bce5){_0x7d37f4=_0x37bce5;_0x1362c3=0xc8;}else{_0x1362c3=0xce;}_0x44b4ed[_0xd852('0x1b')](_0x1362c3);return _0x44b4ed[_0xd852('0x20')](_0xd852('0x21'),_0xa46bc1+'-'+_0x7d37f4+'/'+_0x37bce5)['json'](_0x586f97);}return null;};}function patchUpdates(_0x5c55b6){return function(_0x26d667){try{jsonpatch[_0xd852('0x22')](_0x26d667,_0x5c55b6,!![]);}catch(_0x4bb2a0){return BPromise[_0xd852('0x23')](_0x4bb2a0);}return _0x26d667[_0xd852('0x24')]();};}function saveUpdates(_0x55c00c,_0x1ceb55){return function(_0x316cfd){if(_0x316cfd){return _0x316cfd[_0xd852('0x25')](_0x55c00c)[_0xd852('0x26')](function(_0x4cd1ef){return _0x4cd1ef;});}return null;};}function removeEntity(_0x294ab4,_0x296b94){return function(_0x5e5bdf){if(_0x5e5bdf){return _0x5e5bdf['destroy']()[_0xd852('0x26')](function(){_0x294ab4['status'](0xcc)[_0xd852('0x1c')]();});}};}function handleEntityNotFound(_0xd3009,_0x2c27c6){return function(_0x330b36){if(!_0x330b36){_0xd3009[_0xd852('0x1a')](0x194);}return _0x330b36;};}function handleError(_0xa2decd,_0x4b2b47){_0x4b2b47=_0x4b2b47||0x1f4;return function(_0x3500d2){logger[_0xd852('0x27')](_0x3500d2['stack']);if(_0x3500d2[_0xd852('0x28')]){delete _0x3500d2[_0xd852('0x28')];}_0xa2decd['status'](_0x4b2b47)[_0xd852('0x29')](_0x3500d2);};}exports[_0xd852('0x2a')]=function(_0x3d9952,_0x2f4bd6){var _0x26ea90={},_0x575dc6={},_0x57563b={'count':0x0,'rows':[]};var _0x471eff=_[_0xd852('0x2b')](db[_0xd852('0x2c')][_0xd852('0x2d')],function(_0x2b2fbc){return{'name':_0x2b2fbc['fieldName'],'type':_0x2b2fbc['type'][_0xd852('0x2e')]};});_0x575dc6[_0xd852('0x2f')]=_[_0xd852('0x2b')](_0x471eff,_0xd852('0x28'));_0x575dc6[_0xd852('0x30')]=_[_0xd852('0x31')](_0x3d9952[_0xd852('0x30')]);_0x575dc6[_0xd852('0x32')]=_['intersection'](_0x575dc6[_0xd852('0x2f')],_0x575dc6[_0xd852('0x30')]);_0x26ea90['attributes']=_[_0xd852('0x33')](_0x575dc6['model'],qs[_0xd852('0x34')](_0x3d9952[_0xd852('0x30')]['fields']));_0x26ea90['attributes']=_0x26ea90[_0xd852('0x35')]['length']?_0x26ea90[_0xd852('0x35')]:_0x575dc6[_0xd852('0x2f')];if(!_0x3d9952['query'][_0xd852('0x36')](_0xd852('0x37'))){_0x26ea90[_0xd852('0x38')]=qs['limit'](_0x3d9952[_0xd852('0x30')][_0xd852('0x38')]);_0x26ea90[_0xd852('0x1d')]=qs[_0xd852('0x1d')](_0x3d9952[_0xd852('0x30')][_0xd852('0x1d')]);}_0x26ea90['order']=qs['sort'](_0x3d9952['query'][_0xd852('0x39')]);_0x26ea90[_0xd852('0x3a')]=qs[_0xd852('0x32')](_[_0xd852('0x3b')](_0x3d9952[_0xd852('0x30')],_0x575dc6[_0xd852('0x32')]),_0x471eff);if(_0x3d9952['query']['filter']){_0x26ea90[_0xd852('0x3a')]=_['merge'](_0x26ea90[_0xd852('0x3a')],{'$or':_[_0xd852('0x2b')](_0x471eff,function(_0x4952e3){if(_0x4952e3['type']!=='VIRTUAL'){var _0x23bed7={};_0x23bed7[_0x4952e3[_0xd852('0x28')]]={'$like':'%'+_0x3d9952[_0xd852('0x30')][_0xd852('0x3c')]+'%'};return _0x23bed7;}})});}_0x26ea90=_[_0xd852('0x3d')]({},_0x26ea90,_0x3d9952[_0xd852('0x3e')]);var _0x3c5e84={'where':_0x26ea90[_0xd852('0x3a')]};return db[_0xd852('0x2c')][_0xd852('0x1f')](_0x3c5e84)[_0xd852('0x26')](function(_0x424151){_0x57563b[_0xd852('0x1f')]=_0x424151;if(_0x3d9952['query']['includeAll']){_0x26ea90[_0xd852('0x3f')]=[{'all':!![]}];}return db[_0xd852('0x2c')][_0xd852('0x40')](_0x26ea90);})[_0xd852('0x26')](function(_0x3f4543){_0x57563b['rows']=_0x3f4543;return _0x57563b;})[_0xd852('0x26')](respondWithFilteredResult(_0x2f4bd6,_0x26ea90))[_0xd852('0x41')](handleError(_0x2f4bd6,null));};exports[_0xd852('0x42')]=function(_0x390d05,_0x467ecb){var _0x159949={'raw':![],'where':{'id':_0x390d05[_0xd852('0x43')]['id']}},_0x117687={};_0x117687[_0xd852('0x2f')]=_[_0xd852('0x31')](db[_0xd852('0x2c')][_0xd852('0x2d')]);_0x117687[_0xd852('0x30')]=_[_0xd852('0x31')](_0x390d05['query']);_0x117687[_0xd852('0x32')]=_[_0xd852('0x33')](_0x117687[_0xd852('0x2f')],_0x117687[_0xd852('0x30')]);_0x159949[_0xd852('0x35')]=_[_0xd852('0x33')](_0x117687['model'],qs[_0xd852('0x34')](_0x390d05[_0xd852('0x30')][_0xd852('0x34')]));_0x159949[_0xd852('0x35')]=_0x159949[_0xd852('0x35')][_0xd852('0x44')]?_0x159949['attributes']:_0x117687['model'];if(_0x390d05[_0xd852('0x30')][_0xd852('0x45')]){_0x159949[_0xd852('0x3f')]=[{'all':!![]}];}_0x159949=_[_0xd852('0x3d')]({},_0x159949,_0x390d05['options']);return db[_0xd852('0x2c')][_0xd852('0x46')](_0x159949)[_0xd852('0x26')](handleEntityNotFound(_0x467ecb,null))[_0xd852('0x26')](respondWithResult(_0x467ecb,null))[_0xd852('0x41')](handleError(_0x467ecb,null));};exports['create']=function(_0x59f7ab,_0x287171){return db['UserProfile'][_0xd852('0x47')](_0x59f7ab['body'],{})[_0xd852('0x26')](respondWithResult(_0x287171,0xc9))[_0xd852('0x41')](handleError(_0x287171,null));};exports['clone']=function(_0x2416d2,_0x3a3bed){var _0x340728={'where':{'id':_0x2416d2[_0xd852('0x43')]['id']}},_0x3fda53={};_0x3fda53[_0xd852('0x2f')]=_[_0xd852('0x31')](db[_0xd852('0x2c')]['rawAttributes']);_0x340728[_0xd852('0x35')]=_[_0xd852('0x33')](_0x3fda53['model'],qs['fields'](_0x2416d2[_0xd852('0x30')]['fields']));_0x340728[_0xd852('0x35')]=_0x340728[_0xd852('0x35')][_0xd852('0x44')]?_0x340728['attributes']:_0x3fda53[_0xd852('0x2f')];if(_0x2416d2[_0xd852('0x30')][_0xd852('0x45')]){_0x340728['include']=[{'all':!![]}];}_0x340728=_['merge']({},_0x340728,_0x2416d2[_0xd852('0x3e')]);return db[_0xd852('0x2c')]['find'](_0x340728)[_0xd852('0x26')](handleEntityNotFound(_0x3a3bed,null))[_0xd852('0x26')](function(_0x18c8da){if(_0x18c8da){var _0x55862d=_0x18c8da[_0xd852('0x48')]({'plain':!![]});_0x55862d=qs[_0xd852('0x49')](_0x55862d,['id',_0xd852('0x4a'),_0xd852('0x4b'),'crudPermissions']);_0x2416d2['body']=_[_0xd852('0x49')](_0x2416d2[_0xd852('0x4c')],['id',_0xd852('0x4a'),_0xd852('0x4b')]);return db[_0xd852('0x4d')][_0xd852('0x4e')](function(_0x4710b3){return db[_0xd852('0x2c')][_0xd852('0x47')](_[_0xd852('0x3d')](_0x55862d,_0x2416d2['body']),{'include':_0x2416d2[_0xd852('0x30')][_0xd852('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x4710b3})[_0xd852('0x26')](function(_0x90074){var _0x3d186d=_0x90074[_0xd852('0x48')]({'plain':!![]});return db['UserProfileSection'][_0xd852('0x40')]({'where':{'userProfileId':_0x2416d2[_0xd852('0x43')]['id']},'raw':!![]})[_0xd852('0x26')](function(_0x37b3ea){if(_0x37b3ea){return BPromise[_0xd852('0x4f')](_0x37b3ea,function(_0x1896a6){return new BPromise(function(_0x10624e,_0x54051f){if(_0x1896a6['autoAssociation']===null||_0x1896a6[_0xd852('0x50')]===0x1)_0x10624e(null);return db['UserProfileResource'][_0xd852('0x40')]({'where':{'sectionId':_0x1896a6['id']},'raw':!![]})[_0xd852('0x26')](function(_0x1388c5){var _0x1eeae3=_[_0xd852('0x2b')](_0x1388c5,function(_0x871546){return qs[_0xd852('0x49')](_0x871546,['id',_0xd852('0x4a'),_0xd852('0x4b'),'sectionId']);});_0x10624e(_0x1eeae3);})[_0xd852('0x41')](function(_0x203fac){_0x54051f(_0x203fac);});})['then'](function(_0x1d6a2d){var _0x35c913=qs[_0xd852('0x49')](_0x1896a6,['id','createdAt',_0xd852('0x4b')]);_0x35c913[_0xd852('0x51')]=_0x3d186d['id'];if(_0x1d6a2d)_0x35c913[_0xd852('0x52')]=_0x1d6a2d;return _0x35c913;})[_0xd852('0x26')](function(_0x409fbd){return db[_0xd852('0x53')][_0xd852('0x47')](_0x409fbd,{'include':[{'model':db[_0xd852('0x54')],'as':'Resources'}],'raw':!![],'transaction':_0x4710b3});});})[_0xd852('0x26')](function(){return _0x3d186d;});}});});});}})['then'](respondWithResult(_0x3a3bed,0xc9))['catch'](handleError(_0x3a3bed,null));};exports[_0xd852('0x25')]=function(_0x58061b,_0x39c1f1){if(_0x58061b[_0xd852('0x4c')]['id']){delete _0x58061b['body']['id'];}return db[_0xd852('0x2c')]['find']({'where':{'id':_0x58061b[_0xd852('0x43')]['id']}})[_0xd852('0x26')](handleEntityNotFound(_0x39c1f1,null))[_0xd852('0x26')](saveUpdates(_0x58061b['body'],null))[_0xd852('0x26')](respondWithResult(_0x39c1f1,null))[_0xd852('0x41')](handleError(_0x39c1f1,null));};exports[_0xd852('0x55')]=function(_0x3c7c81,_0x2f3e45){return db['UserProfile'][_0xd852('0x46')]({'where':{'id':_0x3c7c81['params']['id']}})[_0xd852('0x26')](handleEntityNotFound(_0x2f3e45,null))['then'](removeEntity(_0x2f3e45,null))[_0xd852('0x41')](handleError(_0x2f3e45,null));};exports[_0xd852('0x56')]=function(_0x54f629,_0x25a99c){return db['UserProfile'][_0xd852('0x56')]()[_0xd852('0x26')](respondWithResult(_0x25a99c,null))[_0xd852('0x41')](handleError(_0x25a99c,null));};exports[_0xd852('0x57')]=function(_0x468fc9,_0x477d41){var _0x2892a8=_0x468fc9[_0xd852('0x4c')];return db[_0xd852('0x2c')][_0xd852('0x46')]({'where':{'id':_0x468fc9[_0xd852('0x43')]['id']}})['then'](handleEntityNotFound(_0x477d41,null))[_0xd852('0x26')](function(_0x2ffe55){if(_0x2ffe55){return db[_0xd852('0x4d')][_0xd852('0x4e')](function(_0x3178cc){return db[_0xd852('0x53')][_0xd852('0x55')]({'where':{'userProfileId':_0x468fc9[_0xd852('0x43')]['id'],'sectionId':_[_0xd852('0x2b')](_0x2892a8,function(_0x159733){return _0x159733['sectionId'];})},'transaction':_0x3178cc})[_0xd852('0x26')](function(){var _0x5068bc=_['map'](_0x2892a8,function(_0x4c99e4){_0x4c99e4['userProfileId']=_0x468fc9[_0xd852('0x43')]['id'];return _0x4c99e4;});var _0x1aec05=[];return BPromise[_0xd852('0x4f')](_0x5068bc,function(_0x376aea){return db[_0xd852('0x53')][_0xd852('0x47')](_0x376aea,{'include':[{'model':db['UserProfileResource'],'as':_0xd852('0x52')}],'raw':!![],'transaction':_0x3178cc})['then'](function(_0x4d0d45){_0x1aec05[_0xd852('0x58')](_0x4d0d45['get']({'plain':!![]}));});})[_0xd852('0x26')](function(){return _0x1aec05;});});});}})['then'](function(_0x3913b1){return _0x3913b1;})['then'](respondWithResult(_0x477d41,null))[_0xd852('0x41')](handleError(_0x477d41,null));};exports[_0xd852('0x59')]=function(_0x372317,_0x4bfeb6){var _0xac94be;return db[_0xd852('0x2c')][_0xd852('0x46')]({'where':{'id':_0x372317[_0xd852('0x43')]['id']},'attributes':['id',_0xd852('0x28')]})[_0xd852('0x26')](handleEntityNotFound(_0x4bfeb6,null))['then'](function(_0x3c0555){if(_0x3c0555){_0xac94be=_0x3c0555;return db[_0xd852('0x53')][_0xd852('0x55')]({'where':{'userProfileId':_0x372317[_0xd852('0x43')]['id'],'sectionId':_0x372317[_0xd852('0x30')][_0xd852('0x5a')]}});}})[_0xd852('0x26')](function(){return _0xac94be;})[_0xd852('0x26')](respondWithStatusCode(_0x4bfeb6,null))[_0xd852('0x41')](handleError(_0x4bfeb6,null));};exports[_0xd852('0x5b')]=function(_0xfaaebb,_0xb2f689){var _0x3039e9=[];var _0x7172a3=[];return db[_0xd852('0x53')][_0xd852('0x40')]({'where':{'userProfileId':_0xfaaebb[_0xd852('0x43')]['id']},'raw':!![]})[_0xd852('0x26')](function(_0x4b1903){_0x3039e9=_[_0xd852('0x3c')](_0x4b1903,function(_0x40e241){return _0x40e241[_0xd852('0x5c')]===0x1||_[_0xd852('0x5d')]([0x3eb,0x709],_0x40e241[_0xd852('0x5e')]);});if(!_[_0xd852('0x5f')](_0x3039e9)){return _[_0xd852('0x2b')](_0x3039e9,function(_0x3feaad){return _0x3feaad['sectionId'];});}else{return;}})[_0xd852('0x26')](function(_0x1d835){if(_0x1d835)_0x7172a3=_0x1d835;if(_[_0xd852('0x5d')](_0x7172a3,0x64)){var _0x2e03c7=_[_0xd852('0x46')](_0x3039e9,{'sectionId':0x64});return hasDefaultDashboard(_0x2e03c7)[_0xd852('0x26')](function(_0x63e7eb){return _[_0xd852('0x2b')](_0x3039e9,function(_0x494a70){if(_0x494a70['sectionId']===0x64){_0x494a70[_0xd852('0x60')]=_0x63e7eb;}return _0x494a70;});});}else{return;}})[_0xd852('0x26')](function(_0x1b2390){if(_0x1b2390)_0x3039e9=_0x1b2390;if(_[_0xd852('0x5d')](_0x7172a3,0x3eb)){var _0x50f9e4=_[_0xd852('0x46')](_0x3039e9,{'sectionId':0x3eb});return getCustomDashboards(_0x50f9e4)['then'](function(_0x473bb3){return _[_0xd852('0x2b')](_0x3039e9,function(_0x2a085c){if(_0x50f9e4[_0xd852('0x5c')]){if(_0x2a085c[_0xd852('0x5e')]===0x3eb){_0x2a085c[_0xd852('0x60')]=_0x473bb3;}}else{if(_0x2a085c[_0xd852('0x5e')]===0x64){if(!_0x2a085c['subsections']){_0x2a085c[_0xd852('0x60')]=[];}_0x2a085c['subsections']=_0x2a085c[_0xd852('0x60')][_0xd852('0x61')](_0x473bb3);}}return _0x2a085c;});});}else{return;}})[_0xd852('0x26')](function(_0x5757d6){if(_0x5757d6)_0x3039e9=_0x5757d6;if(_[_0xd852('0x5d')](_0x7172a3,0x709)){var _0x33a4d6=_['find'](_0x3039e9,{'sectionId':0x709});return getPlugins(_0x33a4d6)[_0xd852('0x26')](function(_0x4dcf26){if(_0x33a4d6[_0xd852('0x5c')]){return _[_0xd852('0x2b')](_0x3039e9,function(_0x2f8899){if(_0x2f8899[_0xd852('0x5e')]===0x709){_0x2f8899[_0xd852('0x60')]=_0x4dcf26;}return _0x2f8899;});}else{var _0x49a786={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4dcf26};var _0x196a93=_[_0xd852('0x2b')](_0x3039e9);_0x196a93[_0xd852('0x58')](_0x49a786);return _0x196a93;}});}else{return;}})[_0xd852('0x26')](function(_0x555851){if(_0x555851)_0x3039e9=_0x555851;return _[_0xd852('0x3c')](_0x3039e9,[_0xd852('0x5c'),0x1]);})[_0xd852('0x26')](respondWithResult(_0xb2f689,null))[_0xd852('0x41')](handleError(_0xb2f689,null));};function hasDefaultDashboard(_0x492d93){var _0x11758d=[0x65];return new BPromise(function(_0x155157,_0xd6ca42){try{if(_0x492d93['autoAssociation']){_0x155157(_0x11758d);}else{return db['UserProfileResource'][_0xd852('0x62')]({'where':{'sectionId':_0x492d93['id']},'raw':!![]})[_0xd852('0x26')](function(_0x512b12){_0x512b12?_0x155157(_0x11758d):_0x155157();});}}catch(_0x5bf1dc){_0xd6ca42(_0x5bf1dc);}});}function getCustomDashboards(_0x28e612){var _0x421899=[];return new BPromise(function(_0x37d1d3,_0x2aff9a){try{if(_0x28e612[_0xd852('0x50')]){return db['Dashboard'][_0xd852('0x40')]({'raw':!![]})[_0xd852('0x26')](function(_0x327d76){_0x327d76[_0xd852('0x63')](function(_0x4a3b63){_0x421899['push'](_0x4a3b63['id']+0x1869f);});_0x37d1d3(_0x421899);});}else{return db[_0xd852('0x54')][_0xd852('0x40')]({'where':{'sectionId':_0x28e612['id']},'raw':!![]})[_0xd852('0x26')](function(_0x19389a){_0x19389a['forEach'](function(_0x5bd8e8){_0x421899[_0xd852('0x58')](_0x5bd8e8[_0xd852('0x64')]+0x1869f);});_0x37d1d3(_0x421899);});}}catch(_0x5eeb07){_0x2aff9a(_0x5eeb07);}});}function getPlugins(_0x453040){var _0x3c4793=[];return new BPromise(function(_0x3437b9,_0x5f62af){try{if(_0x453040['autoAssociation']){return db[_0xd852('0x65')][_0xd852('0x40')]({'raw':!![]})[_0xd852('0x26')](function(_0x16be81){_0x16be81[_0xd852('0x63')](function(_0x281538){_0x3c4793['push'](_0x281538['id']+0x15b38);});_0x3437b9(_0x3c4793);});}else{return db[_0xd852('0x54')]['findAll']({'where':{'sectionId':_0x453040['id']},'raw':!![]})[_0xd852('0x26')](function(_0x440806){_0x440806['forEach'](function(_0x5067c1){_0x3c4793['push'](_0x5067c1[_0xd852('0x64')]+0x15b38);});_0x3437b9(_0x3c4793);});}}catch(_0x298087){_0x5f62af(_0x298087);}});}exports[_0xd852('0x66')]=function(_0x3e79aa,_0x26858d){return db['UserProfile'][_0xd852('0x46')]({'where':{'id':_0x3e79aa[_0xd852('0x43')]['id']}})[_0xd852('0x26')](handleEntityNotFound(_0x26858d,null))[_0xd852('0x26')](function(_0x31d095){if(_0x31d095){return db['sequelize'][_0xd852('0x4e')](function(_0x1143a5){return db[_0xd852('0x53')]['findAll']({'where':{'userProfileId':_0x3e79aa[_0xd852('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0xd852('0x26')](function(_0x1043c8){if(_0x1043c8){return db[_0xd852('0x53')][_0xd852('0x55')]({'where':{'userProfileId':_0x3e79aa[_0xd852('0x43')]['id'],'id':_['map'](_0x1043c8,function(_0x1f3276){return _0x1f3276['id'];})},'transaction':_0x1143a5});}})[_0xd852('0x26')](function(_0x25de58){var _0x264dcd=_[_0xd852('0x2b')](_0x3e79aa[_0xd852('0x4c')],function(_0xc2d40e){_0xc2d40e[_0xd852('0x51')]=_0x3e79aa[_0xd852('0x43')]['id'];return _0xc2d40e;});return db[_0xd852('0x53')][_0xd852('0x67')](_0x264dcd,{'raw':!![],'transaction':_0x1143a5});})[_0xd852('0x26')](function(_0x39317b){var _0x1115af=_['filter'](_[_0xd852('0x2b')](_0x39317b,function(_0x32551d){return _0x32551d[_0xd852('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0x1115af){return db[_0xd852('0x53')][_0xd852('0x40')]({'where':{'userProfileId':_0x3e79aa[_0xd852('0x43')]['id'],'sectionId':_[_0xd852('0x2b')](_0x1115af,function(_0x4fa5fd){return _0x4fa5fd[_0xd852('0x5e')];})},'attributes':['id',_0xd852('0x5e')],'raw':!![]})[_0xd852('0x26')](function(_0x385eb0){var _0xa816dc=_[_0xd852('0x2b')](_0x3e79aa[_0xd852('0x4c')],function(_0x1fd363){_0x1fd363[_0xd852('0x51')]=_0x3e79aa['params']['id'];return _0x1fd363;});return db[_0xd852('0x54')][_0xd852('0x67')](_0xa816dc,{'raw':!![],'transaction':_0x1143a5});});}})[_0xd852('0x41')](handleError(_0x26858d,null));});}})['then'](function(_0x21a91d){var _0x315a44=_[_0xd852('0x2b')](_0x21a91d,function(_0x3868b2){return _0x3868b2[_0xd852('0x48')]({'plain':!![]});});})[_0xd852('0x26')](respondWithResult(_0x26858d,null))[_0xd852('0x41')](handleError(_0x26858d,null));};exports[_0xd852('0x68')]=function(_0x451435,_0x2e2bf2,_0x489a94){return db['UserProfile'][_0xd852('0x46')]({'where':{'id':_0x451435[_0xd852('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e2bf2,null))['then'](function(_0x1a066a){if(_0x1a066a){return _0x1a066a[_0xd852('0x68')](_0x451435[_0xd852('0x30')][_0xd852('0x5a')]);}})[_0xd852('0x26')](respondWithStatusCode(_0x2e2bf2,null))[_0xd852('0x41')](handleError(_0x2e2bf2,null));};exports['getResources']=function(_0xe25856,_0x4a5e0b){var _0x22835c={};if(!_0xe25856[_0xd852('0x30')][_0xd852('0x69')])throw new Error(_0xd852('0x6a'));if(!_0xe25856['query']['hasOwnProperty']('nolimit')){_0x22835c['limit']=qs['limit'](_0xe25856[_0xd852('0x30')][_0xd852('0x38')]);_0x22835c['offset']=qs[_0xd852('0x1d')](_0xe25856['query'][_0xd852('0x1d')]);}return db[_0xd852('0x2c')][_0xd852('0x46')]({'where':{'id':_0xe25856[_0xd852('0x43')]['id']}})[_0xd852('0x26')](function(_0x3a873b){if(!_0x3a873b)throw new Error(_0xd852('0x6b')+_0xe25856['params']['id']);return db[_0xd852('0x2c')][_0xd852('0x6c')](_0xe25856);})[_0xd852('0x26')](respondWithFilteredResult(_0x4a5e0b,_0x22835c))['catch'](handleError(_0x4a5e0b,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f77f71e..e40185d 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 _0xa46e=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x4fcb40,_0x3391d4){var _0x383179=function(_0x1e8258){while(--_0x1e8258){_0x4fcb40['push'](_0x4fcb40['shift']());}};_0x383179(++_0x3391d4);}(_0xa46e,0x8a));var _0xea46=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xa46e[_0x335271];return _0xa9fff8;};'use strict';var EventEmitter=require(_0xea46('0x0'));var UserProfile=require(_0xea46('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xea46('0x2')](0x0);var events={'afterCreate':_0xea46('0x3'),'afterUpdate':_0xea46('0x4'),'afterDestroy':'remove'};function emitEvent(_0x19f135){return function(_0x4b6e4a,_0x3a2209,_0x47d633){UserProfileEvents[_0xea46('0x5')](_0x19f135+':'+_0x4b6e4a['id'],_0x4b6e4a);UserProfileEvents['emit'](_0x19f135,_0x4b6e4a);_0x47d633(null);};}for(var e in events){if(events[_0xea46('0x6')](e)){var event=events[e];UserProfile[_0xea46('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x2525=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xe3c007,_0x374988){var _0x4b5cc3=function(_0x4b9bfe){while(--_0x4b9bfe){_0xe3c007['push'](_0xe3c007['shift']());}};_0x4b5cc3(++_0x374988);}(_0x2525,0x1f0));var _0x5252=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x2525[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require(_0x5252('0x0'));var UserProfile=require(_0x5252('0x1'))['db'][_0x5252('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5252('0x3')](0x0);var events={'afterCreate':_0x5252('0x4'),'afterUpdate':_0x5252('0x5'),'afterDestroy':_0x5252('0x6')};function emitEvent(_0x1138af){return function(_0x28efdd,_0x4907eb,_0x4a73a2){UserProfileEvents[_0x5252('0x7')](_0x1138af+':'+_0x28efdd['id'],_0x28efdd);UserProfileEvents[_0x5252('0x7')](_0x1138af,_0x28efdd);_0x4a73a2(null);};}for(var e in events){if(events[_0x5252('0x8')](e)){var event=events[e];UserProfile[_0x5252('0x9')](e,emitEvent(event));}}module[_0x5252('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index af87448..22dfc7e 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 _0xc793=['../../components/parsers/qs','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','model','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','pick','key','VIRTUAL','foreignKey','merge','includeAll','include','forEach','default','reportId','DefaultReports','CustomReports','count','ids','customSorting','order','extraQueryConditions','Tags','color','tag','rows','openTabs','true','chat','sms','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','filter','field','value','findAll','then','catch','associatedResources','map','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','parentSections','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','inbound','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','scheduler','Schedule','Tag','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles'];(function(_0x3c6f6f,_0x3833ee){var _0x223301=function(_0x403458){while(--_0x403458){_0x3c6f6f['push'](_0x3c6f6f['shift']());}};_0x223301(++_0x3833ee);}(_0xc793,0x1cc));var _0x3c79=function(_0x30ff0f,_0x525b52){_0x30ff0f=_0x30ff0f-0x0;var _0x55b48e=_0xc793[_0x30ff0f];return _0x55b48e;};'use strict';var _=require(_0x3c79('0x0'));var attributes=require(_0x3c79('0x1'));var squel=require('squel');module[_0x3c79('0x2')]=function(_0x6a075){var _0x27d5df=_0x6a075[_0x3c79('0x3')];function _0x4327de(_0x1bb38a,_0x2c1c0c){return new Promise(function(_0x1a753f,_0x9ac223){if(!_0x2c1c0c)return _0x1a753f(null);var _0x4aa192=_0x2c1c0c[_0x3c79('0x4')]?{[_0x2c1c0c['filter'][_0x3c79('0x5')]]:_0x2c1c0c[_0x3c79('0x4')][_0x3c79('0x6')]}:undefined;return _0x27d5df[_0x1bb38a][_0x3c79('0x7')]({'where':_0x4aa192,'raw':!![]})[_0x3c79('0x8')](function(_0x1ac7f3){_0x2c1c0c['associatedResources']=_['map'](_0x1ac7f3,'id');_0x1a753f(_0x2c1c0c);})[_0x3c79('0x9')](function(_0x416295){_0x9ac223(_0x416295);});});}function _0x3ed7f9(_0x53b26c,_0x41eda2){return new Promise(function(_0x2bed5c,_0x3bc6ef){var _0x194b9b=_0x53b26c[_0x3c79('0x4')]?{[_0x53b26c[_0x3c79('0x4')][_0x3c79('0x5')]]:_0x53b26c['filter'][_0x3c79('0x6')]}:undefined;return _0x27d5df[_0x53b26c['model']][_0x3c79('0x7')]({'where':_0x194b9b,'raw':!![]})[_0x3c79('0x8')](function(_0x2856a6){_0x41eda2[_0x3c79('0xa')]=_[_0x3c79('0xb')](_0x2856a6,function(_0x1ebda0){return _0x1ebda0[_0x3c79('0xc')];});_0x2bed5c(_0x41eda2);})[_0x3c79('0x9')](function(_0x395ba8){_0x3bc6ef(_0x395ba8);});});}function _0x53d86a(_0x21253e,_0x1783d6,_0x57b342){if(!_0x1783d6)return Promise[_0x3c79('0xd')](null);return new Promise(function(_0x55774b,_0x34c45a){return _0x27d5df[_0x3c79('0xe')][_0x3c79('0x7')]({'where':{'sectionId':_0x1783d6['id']},'raw':!![]})[_0x3c79('0x8')](function(_0x5bc9f0){if(_0x21253e[_0x3c79('0x5')]&&_0x21253e[_0x3c79('0x5')]!=='id'){_0x1783d6[_0x3c79('0xa')]=_[_0x3c79('0xb')](_0x5bc9f0,function(_0x4e7b02){return _0x4e7b02[_0x21253e[_0x3c79('0x5')]];});}else{if(_0x57b342===_0x3c79('0xf')){_0x1783d6[_0x3c79('0xa')]=_[_0x3c79('0xb')](_0x5bc9f0,function(_0xb6a75c){return{'id':_0xb6a75c[_0x3c79('0x10')],'type':_0xb6a75c[_0x3c79('0x11')]};});}else{_0x1783d6[_0x3c79('0xa')]=_[_0x3c79('0xb')](_0x5bc9f0,function(_0x3c15c5){return _0x3c15c5[_0x3c79('0x10')];});}}_0x55774b(_0x1783d6);})[_0x3c79('0x9')](function(_0x87aa06){_0x34c45a(_0x87aa06);});});}function _0x1d8914(_0x47ca9a,_0x3d44e2){var _0x4ca8c3={'parentSections':[]};switch(_0x47ca9a[_0x3c79('0x12')]()){case _0x3c79('0x13'):_0x4ca8c3['childModel']=_0x3c79('0x14');break;case _0x3c79('0x15'):_0x4ca8c3[_0x3c79('0x16')]='SquareOdbc';break;case _0x3c79('0x17'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x18');_0x4ca8c3['parentSections']=[{'name':_0x3c79('0x19'),'field':'name','foreignKey':_0x3c79('0x1a')}];break;case _0x3c79('0x1b'):_0x4ca8c3['childModel']=_0x3c79('0x1c');break;case _0x3c79('0x1d'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x1e');_0x4ca8c3['parentSections']=[{'name':_0x3c79('0x1f'),'field':'id','foreignKey':_0x3c79('0x20')}];break;case _0x3c79('0x21'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x22');break;case _0x3c79('0x23'):_0x4ca8c3['childModel']=_0x3c79('0x24');break;case _0x3c79('0x25'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x26');break;case _0x3c79('0x27'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x28');break;case _0x3c79('0x29'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x2a');break;case _0x3c79('0x2b'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x2c');break;case _0x3c79('0x2d'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x2e');break;case _0x3c79('0x2f'):case _0x3c79('0x30'):case'outboundroutes':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x31');break;case'contexts':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x32');break;case'voicemails':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x33');break;case _0x3c79('0x34'):_0x4ca8c3[_0x3c79('0x16')]='VoiceRecording';_0x4ca8c3[_0x3c79('0x35')]=[{'name':_0x3c79('0x36'),'field':_0x3c79('0xc'),'foreignKey':'membername','model':_0x3c79('0x37'),'filter':{'field':_0x3c79('0x38'),'value':[_0x3c79('0x39')]}},{'name':_0x3c79('0x3a'),'field':'name','foreignKey':_0x3c79('0x3b'),'model':_0x3c79('0x37'),'filter':{'field':'role','value':[_0x3c79('0x3c')]}},{'name':_0x3c79('0x3d'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x3c79('0x11'),'value':[_0x3c79('0x3e')]}},{'name':_0x3c79('0x3f'),'field':'name','foreignKey':_0x3c79('0x40'),'model':_0x3c79('0x41'),'filter':{'field':'type','value':[_0x3c79('0x42')]}}];break;case _0x3c79('0x43'):_0x4ca8c3['childModel']=_0x3c79('0x44');break;case _0x3c79('0x45'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x46');break;case _0x3c79('0x47'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x48');break;case _0x3c79('0x49'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x4a');break;case'mailqueues':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x4b');break;case'mailaccounts':_0x4ca8c3['childModel']='MailAccount';break;case _0x3c79('0x4c'):_0x4ca8c3[_0x3c79('0x16')]='MailSubstatus';break;case _0x3c79('0x4d'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x4e');break;case _0x3c79('0x4f'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x50');break;case _0x3c79('0x51'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x52');break;case _0x3c79('0x53'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x54');break;case _0x3c79('0x55'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x56');break;case _0x3c79('0x57'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x58');break;case _0x3c79('0x59'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x5a');break;case _0x3c79('0x5b'):case _0x3c79('0x5c'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x41');if(_0x3d44e2){_0x4ca8c3[_0x3c79('0x35')]=[{'name':_0x3c79('0x3d')},{'name':_0x3c79('0x3f')}];}break;case _0x3c79('0x5d'):case _0x3c79('0x5e'):case _0x3c79('0x5f'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x37');if(_0x3d44e2){_0x4ca8c3[_0x3c79('0x35')]=[{'name':_0x3c79('0x60'),'filter':{'field':_0x3c79('0x38'),'value':[_0x3c79('0x61'),_0x3c79('0x62')]},'ignore':!![]},{'name':_0x3c79('0x36')},{'name':_0x3c79('0x3a')}];}break;case _0x3c79('0x63'):_0x4ca8c3['childModel']='ZendeskAccount';break;case _0x3c79('0x64'):_0x4ca8c3['childModel']=_0x3c79('0x65');break;case'freshdeskaccounts':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x66');break;case _0x3c79('0x67'):_0x4ca8c3['childModel']='SugarcrmAccount';break;case'deskaccounts':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x68');break;case _0x3c79('0x69'):_0x4ca8c3['childModel']=_0x3c79('0x6a');break;case'vtigeraccounts':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x37');break;case'cannedanswers':_0x4ca8c3['childModel']=_0x3c79('0x6b');break;case _0x3c79('0x6c'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x6d');break;case _0x3c79('0x6e'):_0x4ca8c3[_0x3c79('0x16')]='Dashboard';break;case _0x3c79('0x6f'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x70');break;case'pauses':_0x4ca8c3[_0x3c79('0x16')]='Pause';break;case _0x3c79('0x71'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x72');break;case'sounds':_0x4ca8c3['childModel']='Sound';break;case'tags':_0x4ca8c3['childModel']=_0x3c79('0x73');break;case'templates':_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x74');break;case _0x3c79('0x75'):_0x4ca8c3['childModel']=_0x3c79('0x76');break;case _0x3c79('0x77'):_0x4ca8c3[_0x3c79('0x16')]='Trunk';break;case _0x3c79('0x78'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x79');break;case _0x3c79('0x7a'):_0x4ca8c3[_0x3c79('0x16')]=_0x3c79('0x7b');break;case _0x3c79('0x7c'):_0x4ca8c3['childModel']='AnalyticExtractedReport';_0x4ca8c3['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x3c79('0x7d'):_0x4ca8c3['childModel']='AnalyticMetric';break;}return _0x4ca8c3;}function _0x348801(_0x595825,_0x5bf8fc){var _0x2ff658=_0x595825[_0x3c79('0x7e')](0x0)[_0x3c79('0x7f')]()+_0x595825[_0x3c79('0x80')](0x1);var _0x4cb092={'type':_0x27d5df[_0x3c79('0x81')][_0x3c79('0x82')]['SELECT'],'raw':!![]};return new Promise(function(_0x520382,_0x2e84cf){var _0x2e15e7=squel[_0x3c79('0x83')]()['field'](_0x3c79('0x84')+_0x2ff658+_0x3c79('0x85'),'id')[_0x3c79('0x5')](_0x3c79('0x86'))[_0x3c79('0x87')](_0x3c79('0x88')+_0x595825+_0x3c79('0x89'),'ui')[_0x3c79('0x8a')](_0x3c79('0x8b'),_0x5bf8fc['id']);return _0x27d5df[_0x3c79('0x8c')]['query'](_0x2e15e7[_0x3c79('0x8d')](),_0x4cb092)[_0x3c79('0x8')](function(_0x4f093e){_0x5bf8fc[_0x2ff658+_0x3c79('0x8e')]=_0x4f093e;_0x520382(_0x4f093e);})['catch'](function(_0x44e5b8){_0x2e84cf(_0x44e5b8);});});}return _0x6a075[_0x3c79('0x8f')](_0x3c79('0x90'),attributes,{'tableName':_0x3c79('0x91'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xfd17dd){var _0x457af2=require(_0x3c79('0x92'));var _0x15d0bf={'raw':_0xfd17dd[_0x3c79('0x93')]['raw'],'where':{}};var _0xf8b8ac={};var _0x6bd1db={'count':0x0,'rows':[]};var _0xbff53b=_0xfd17dd['query'][_0x3c79('0x94')];var _0x10f765=_0xfd17dd[_0x3c79('0x93')][_0x3c79('0x95')]||![];var _0x575e64=_0x1d8914(_0xbff53b,_0x10f765);if(!_0x575e64[_0x3c79('0x16')])throw new Error(_0x3c79('0x96')+_0xbff53b+'\x27');var _0x3299c7=[{'name':_0xbff53b}];if(!_[_0x3c79('0x97')](_0x575e64['parentSections']))_0x3299c7=_0x575e64[_0x3c79('0x35')];var _0x5579a1=[];for(var _0x3706dc=0x0;_0x3706dc<_0x3299c7[_0x3c79('0x98')];_0x3706dc++){_0x5579a1[_0x3c79('0x99')](_0x27d5df[_0x3c79('0x9a')][_0x3c79('0x9b')]({'where':{'userProfileId':_0xfd17dd[_0x3c79('0x9c')]['id'],'name':_0x3299c7[_0x3706dc]['name']},'raw':!![]}));}return Promise[_0x3c79('0x9d')](_0x5579a1)[_0x3c79('0x8')](function(_0x141722){var _0x566da2=_[_0x3c79('0x4')](_0x141722,function(_0xf57b52){return _0xf57b52?_0xf57b52:undefined;});var _0x41e4d9=_[_0x3c79('0x4')](_0x3299c7,[_0x3c79('0x9e'),!![]]);var _0x3f8bd2=_['isEmpty'](_0x566da2)&&_['isEmpty'](_0x41e4d9)?null:_[_0x3c79('0x9f')](_0x41e4d9,_0x566da2);if(!_0x3f8bd2)return null;var _0x202ee0=[];for(var _0x4bed6a=0x0;_0x4bed6a<_0x3f8bd2[_0x3c79('0x98')];_0x4bed6a++){var _0x3e1c59=_[_0x3c79('0x9b')](_0x3299c7,function(_0x1cda69){return _0x3f8bd2[_0x4bed6a]?_0x1cda69[_0x3c79('0xc')]===_0x3f8bd2[_0x4bed6a]['name']:null;});if(_0x3e1c59){if(_0x3f8bd2[_0x4bed6a]['ignore']){_0x202ee0[_0x3c79('0x99')](_0x4327de(_0x575e64[_0x3c79('0x16')],_0x3f8bd2[_0x4bed6a]));}else{if(!_0x3f8bd2[_0x4bed6a][_0x3c79('0xa0')]){_0x202ee0[_0x3c79('0x99')](_0x53d86a(_0x3e1c59,_0x3f8bd2[_0x4bed6a],_0x575e64['childModel']));}else{if(_0x3e1c59[_0x3c79('0xa1')]){_0x202ee0['push'](_0x3ed7f9(_0x3e1c59,_0x3f8bd2[_0x4bed6a]));}}}}}return Promise['all'](_0x202ee0);})['then'](function(_0xa7c993){var _0x3daebf=_0xa7c993;var _0x9421bc=null;if(_0x3daebf){_0x9421bc=_0x3daebf[_0x3c79('0x98')]===0x1?_0x3daebf[0x0]:null;}if(!_0x9421bc&&!_0x3daebf)return _0x6bd1db;var _0x222dec=_0x27d5df[_0x575e64[_0x3c79('0x16')]][_0x3c79('0xa2')];_0xf8b8ac[_0x3c79('0xa1')]=_[_0x3c79('0xa3')](_0x222dec);_0xf8b8ac[_0x3c79('0x93')]=_[_0x3c79('0xa3')](_0xfd17dd[_0x3c79('0x93')]);_0xf8b8ac[_0x3c79('0xa4')]=_['intersection'](_0xf8b8ac['model'],_0xf8b8ac[_0x3c79('0x93')]);_0x15d0bf['attributes']=_[_0x3c79('0xa5')](_0xf8b8ac[_0x3c79('0xa1')],_0x457af2[_0x3c79('0xa6')](_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xa6')]));_0x15d0bf[_0x3c79('0xa7')]=_0x15d0bf[_0x3c79('0xa7')][_0x3c79('0x98')]?_0x15d0bf[_0x3c79('0xa7')]:_0xf8b8ac[_0x3c79('0xa1')];if(!_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xa8')](_0x3c79('0xa9'))){_0x15d0bf['limit']=_0x457af2[_0x3c79('0xaa')](_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xaa')]);_0x15d0bf[_0x3c79('0xab')]=_0x457af2['offset'](_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xab')]);}_0x15d0bf['order']=_0x457af2['sort'](_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xac')]);_0x15d0bf[_0x3c79('0x8a')]=_0x457af2[_0x3c79('0xa4')](_[_0x3c79('0xad')](_0xfd17dd['query'],_0xf8b8ac[_0x3c79('0xa4')]));if(_0xfd17dd[_0x3c79('0x93')][_0x3c79('0x4')]){_0x15d0bf[_0x3c79('0x8a')]=_['merge'](_0x15d0bf[_0x3c79('0x8a')],{'$or':_[_0x3c79('0xb')](_0x222dec,function(_0x155ab5){if(_0x155ab5[_0x3c79('0x11')][_0x3c79('0xae')]!==_0x3c79('0xaf')){var _0x5abb38={};_0x5abb38[_0x155ab5['field']]={'$like':'%'+_0xfd17dd[_0x3c79('0x93')][_0x3c79('0x4')]+'%'};return _0x5abb38;}})});}var _0x44a046=[];var _0x547579=null;var _0x2e14d5={};if(_0x9421bc){_0x547579=_['find'](_0x3299c7,['name',_0x9421bc[_0x3c79('0xc')]]);if(_0x547579[_0x3c79('0x5')]){_0x2e14d5={};if(_0x575e64['childModel']===_0x3c79('0xf')){_0x2e14d5[_0x547579[_0x3c79('0xb0')]]=_[_0x3c79('0xb')](_0x9421bc[_0x3c79('0xa')],'id');}else{_0x2e14d5[_0x547579[_0x3c79('0xb0')]]=_0x9421bc['associatedResources'];}_0x44a046['push'](_0x2e14d5);}else{_0x15d0bf[_0x3c79('0x8a')]['id']=_0x9421bc['associatedResources'];}}else{for(var _0x4c44b0=0x0;_0x4c44b0<_0x3daebf[_0x3c79('0x98')];_0x4c44b0++){_0x547579=_[_0x3c79('0x9b')](_0x3299c7,['name',_0x3daebf[_0x4c44b0][_0x3c79('0xc')]]);if(_0x547579[_0x3c79('0x5')]){_0x2e14d5={};_0x2e14d5[_0x547579[_0x3c79('0xb0')]]=_0x3daebf[_0x4c44b0][_0x3c79('0xa')];_0x44a046['push'](_0x2e14d5);}else{if(!_0x15d0bf[_0x3c79('0x8a')]['id'])_0x15d0bf[_0x3c79('0x8a')]['id']=[];_0x3daebf[_0x4c44b0][_0x3c79('0xa')]['forEach'](function(_0x2992da){_0x15d0bf[_0x3c79('0x8a')]['id'][_0x3c79('0x99')](_0x2992da);});}}}if(!_[_0x3c79('0x97')](_0x44a046)){_0x15d0bf[_0x3c79('0x8a')]=_[_0x3c79('0xb1')](_0x15d0bf['where'],{'$and':{'$or':_0x44a046}});}_0x15d0bf=_[_0x3c79('0xb1')]({},_0x15d0bf,_0xfd17dd['options']);if(_0x9421bc&&!_0x9421bc[_0x3c79('0xa0')]&&_0x575e64[_0x3c79('0x16')]===_0x3c79('0xf')){if(_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xb2')]){_0x15d0bf[_0x3c79('0xb3')]=[{'all':!![]}];}return _0x27d5df[_0x575e64['childModel']][_0x3c79('0x7')](_0x15d0bf)[_0x3c79('0x8')](function(_0x20631f){var _0x4bc958=[];_0x20631f[_0x3c79('0xb4')](function(_0x3bf5db){var _0x826733;switch(_0x3bf5db['reportType']){case _0x3c79('0xb5'):_0x826733=_[_0x3c79('0x9b')](_0x9421bc[_0x3c79('0xa')],function(_0x1f344a){return _0x1f344a['id']===_0x3bf5db[_0x3c79('0xb6')]&&_0x1f344a[_0x3c79('0x11')]===_0x3c79('0xb7');});break;case'custom':_0x826733=_[_0x3c79('0x9b')](_0x9421bc['associatedResources'],function(_0x5d8c9b){return _0x5d8c9b['id']===_0x3bf5db['reportId']&&_0x5d8c9b[_0x3c79('0x11')]===_0x3c79('0xb8');});break;}if(_0x826733)_0x4bc958['push'](_0x3bf5db);});_0x6bd1db[_0x3c79('0xb9')]=_0x4bc958[_0x3c79('0x98')];_0x6bd1db['rows']=_0x4bc958;return _0x6bd1db;});}else{if(!_[_0x3c79('0x97')](_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xba')])){_0x15d0bf[_0x3c79('0x8a')]['id']=_0x15d0bf[_0x3c79('0x8a')]['id']?_[_0x3c79('0xa5')](_0x15d0bf[_0x3c79('0x8a')]['id'],_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xba')]):_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xba')];if(_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xbb')]){_0x15d0bf[_0x3c79('0xbc')]=_0xfd17dd[_0x3c79('0x93')]['customSorting'];}}if(_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xbd')]){_0x15d0bf[_0x3c79('0x8a')]=_[_0x3c79('0xb1')](_0x15d0bf[_0x3c79('0x8a')],{'$and':_0xfd17dd['query'][_0x3c79('0xbd')]});}return _0x27d5df[_0x575e64['childModel']][_0x3c79('0xb9')]({'where':_0x15d0bf['where']})[_0x3c79('0x8')](function(_0x2e8d32){_0x6bd1db['count']=_0x2e8d32;if(_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xb2')]){if(_0x575e64[_0x3c79('0x16')]==='CmContact'){_0x15d0bf[_0x3c79('0xb3')]=[{'model':_0x27d5df[_0x3c79('0x73')],'as':_0x3c79('0xbe'),'attributes':['id','name',_0x3c79('0xbf')],'required':_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xc0')]?!![]:![]},{'model':_0x27d5df[_0x3c79('0x73')],'as':'ThroughTags','attributes':['id',_0x3c79('0xc'),_0x3c79('0xbf')],'through':_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xc0')]?{'attributes':[],'where':{'TagId':_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xc0')]||undefined}}:{},'required':_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xc0')]?!![]:![]}];}else{_0x15d0bf['include']=[{'all':!![]}];}}return _0x27d5df[_0x575e64[_0x3c79('0x16')]]['findAll'](_0x15d0bf);})[_0x3c79('0x8')](function(_0x39a2ad){_0x6bd1db[_0x3c79('0xc1')]=_0x39a2ad;if(_0xbff53b===_0x3c79('0x36')&&_0xfd17dd[_0x3c79('0x93')][_0x3c79('0xc2')]===_0x3c79('0xc3')){var _0x177299=[];for(var _0x484b24=0x0;_0x484b24<_0x6bd1db[_0x3c79('0xc1')][_0x3c79('0x98')];_0x484b24++){_0x177299[_0x3c79('0x99')](_0x348801(_0x3c79('0xc4'),_0x6bd1db[_0x3c79('0xc1')][_0x484b24]['dataValues']));_0x177299['push'](_0x348801(_0x3c79('0xc5'),_0x6bd1db[_0x3c79('0xc1')][_0x484b24][_0x3c79('0xc6')]));_0x177299[_0x3c79('0x99')](_0x348801('fax',_0x6bd1db[_0x3c79('0xc1')][_0x484b24][_0x3c79('0xc6')]));_0x177299[_0x3c79('0x99')](_0x348801(_0x3c79('0xc7'),_0x6bd1db[_0x3c79('0xc1')][_0x484b24][_0x3c79('0xc6')]));_0x177299[_0x3c79('0x99')](_0x348801(_0x3c79('0xc8'),_0x6bd1db[_0x3c79('0xc1')][_0x484b24][_0x3c79('0xc6')]));_0x177299[_0x3c79('0x99')](_0x348801(_0x3c79('0xc9'),_0x6bd1db['rows'][_0x484b24]['dataValues']));}return Promise[_0x3c79('0x9d')](_0x177299)[_0x3c79('0x8')](function(){return _0x6bd1db;});}return _0x6bd1db;});}});}}});}; \ No newline at end of file +var _0x67f8=['OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','WhatsappAccount','queuecampaigns','VoiceQueues','users','telephones','Users','role','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','key','foreignKey','forEach','merge','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','field','findAll','then','associatedResources','catch','value','model','name','resolve','map','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','CmContact','parentSections','ListId','lists','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','VoiceRecording','User','agent','Telephones','membername','telephone','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts'];(function(_0x2f42a4,_0xb82328){var _0x10fcf5=function(_0x1f6232){while(--_0x1f6232){_0x2f42a4['push'](_0x2f42a4['shift']());}};_0x10fcf5(++_0xb82328);}(_0x67f8,0x7b));var _0x867f=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x67f8[_0x4bf96c];return _0x281d09;};'use strict';var _=require(_0x867f('0x0'));var attributes=require(_0x867f('0x1'));var squel=require(_0x867f('0x2'));module[_0x867f('0x3')]=function(_0x35c7bf){var _0x43a53a=_0x35c7bf['models'];function _0x44b0f0(_0x203ec4,_0x3552fe){return new Promise(function(_0x15a0f2,_0x261a4f){if(!_0x3552fe)return _0x15a0f2(null);var _0x5120e4=_0x3552fe[_0x867f('0x4')]?{[_0x3552fe[_0x867f('0x4')][_0x867f('0x5')]]:_0x3552fe[_0x867f('0x4')]['value']}:undefined;return _0x43a53a[_0x203ec4][_0x867f('0x6')]({'where':_0x5120e4,'raw':!![]})[_0x867f('0x7')](function(_0x2e0d2a){_0x3552fe[_0x867f('0x8')]=_['map'](_0x2e0d2a,'id');_0x15a0f2(_0x3552fe);})[_0x867f('0x9')](function(_0x172b05){_0x261a4f(_0x172b05);});});}function _0x8e2479(_0x663fee,_0x3cb0f0){return new Promise(function(_0xa8eff6,_0x26047b){var _0xe83b9f=_0x663fee['filter']?{[_0x663fee[_0x867f('0x4')][_0x867f('0x5')]]:_0x663fee['filter'][_0x867f('0xa')]}:undefined;return _0x43a53a[_0x663fee[_0x867f('0xb')]]['findAll']({'where':_0xe83b9f,'raw':!![]})[_0x867f('0x7')](function(_0x5ed3ce){_0x3cb0f0['associatedResources']=_['map'](_0x5ed3ce,function(_0x1fe35a){return _0x1fe35a[_0x867f('0xc')];});_0xa8eff6(_0x3cb0f0);})['catch'](function(_0x5f505e){_0x26047b(_0x5f505e);});});}function _0x3e1444(_0x33854b,_0x36f8ac,_0x388dd0){if(!_0x36f8ac)return Promise[_0x867f('0xd')](null);return new Promise(function(_0x4be2f6,_0x2e6566){return _0x43a53a['UserProfileResource'][_0x867f('0x6')]({'where':{'sectionId':_0x36f8ac['id']},'raw':!![]})[_0x867f('0x7')](function(_0x523a31){if(_0x33854b['field']&&_0x33854b[_0x867f('0x5')]!=='id'){_0x36f8ac[_0x867f('0x8')]=_[_0x867f('0xe')](_0x523a31,function(_0x12dfcc){return _0x12dfcc[_0x33854b[_0x867f('0x5')]];});}else{if(_0x388dd0==='AnalyticExtractedReport'){_0x36f8ac[_0x867f('0x8')]=_['map'](_0x523a31,function(_0x5f3fa0){return{'id':_0x5f3fa0['resourceId'],'type':_0x5f3fa0['type']};});}else{_0x36f8ac['associatedResources']=_[_0x867f('0xe')](_0x523a31,function(_0x19bda6){return _0x19bda6[_0x867f('0xf')];});}}_0x4be2f6(_0x36f8ac);})[_0x867f('0x9')](function(_0x1e5a0a){_0x2e6566(_0x1e5a0a);});});}function _0x45aa9f(_0x5cd52a,_0x80dfcc){var _0x20a843={'parentSections':[]};switch(_0x5cd52a[_0x867f('0x10')]()){case _0x867f('0x11'):_0x20a843[_0x867f('0x12')]=_0x867f('0x13');break;case _0x867f('0x14'):_0x20a843[_0x867f('0x12')]='SquareOdbc';break;case _0x867f('0x15'):_0x20a843[_0x867f('0x12')]=_0x867f('0x16');_0x20a843['parentSections']=[{'name':_0x867f('0x17'),'field':'name','foreignKey':'projectName'}];break;case _0x867f('0x18'):_0x20a843[_0x867f('0x12')]='JscriptyProject';break;case _0x867f('0x19'):_0x20a843[_0x867f('0x12')]=_0x867f('0x1a');_0x20a843[_0x867f('0x1b')]=[{'name':'Lists','field':'id','foreignKey':_0x867f('0x1c')}];break;case _0x867f('0x1d'):_0x20a843[_0x867f('0x12')]='CmList';break;case _0x867f('0x1e'):_0x20a843[_0x867f('0x12')]=_0x867f('0x1f');break;case _0x867f('0x20'):_0x20a843[_0x867f('0x12')]='CmCustomField';break;case _0x867f('0x21'):_0x20a843['childModel']=_0x867f('0x22');break;case _0x867f('0x23'):_0x20a843[_0x867f('0x12')]=_0x867f('0x24');break;case _0x867f('0x25'):_0x20a843[_0x867f('0x12')]=_0x867f('0x26');break;case _0x867f('0x27'):_0x20a843[_0x867f('0x12')]=_0x867f('0x28');break;case _0x867f('0x29'):case _0x867f('0x2a'):case _0x867f('0x2b'):_0x20a843[_0x867f('0x12')]=_0x867f('0x2c');break;case _0x867f('0x2d'):_0x20a843[_0x867f('0x12')]='VoiceContext';break;case'voicemails':_0x20a843['childModel']=_0x867f('0x2e');break;case'voicerecordings':_0x20a843['childModel']=_0x867f('0x2f');_0x20a843[_0x867f('0x1b')]=[{'name':'Agents','field':_0x867f('0xc'),'foreignKey':'membername','model':_0x867f('0x30'),'filter':{'field':'role','value':[_0x867f('0x31')]}},{'name':_0x867f('0x32'),'field':_0x867f('0xc'),'foreignKey':_0x867f('0x33'),'model':'User','filter':{'field':'role','value':[_0x867f('0x34')]}},{'name':'VoiceQueues','field':_0x867f('0xc'),'foreignKey':'queue','model':_0x867f('0x35'),'filter':{'field':_0x867f('0x36'),'value':[_0x867f('0x37')]}},{'name':_0x867f('0x38'),'field':'name','foreignKey':'queue','model':_0x867f('0x35'),'filter':{'field':_0x867f('0x36'),'value':[_0x867f('0x39')]}}];break;case _0x867f('0x3a'):_0x20a843[_0x867f('0x12')]='VoiceMusicOnHold';break;case _0x867f('0x3b'):_0x20a843['childModel']=_0x867f('0x3c');break;case _0x867f('0x3d'):_0x20a843[_0x867f('0x12')]=_0x867f('0x3e');break;case _0x867f('0x3f'):_0x20a843[_0x867f('0x12')]='Campaign';break;case'mailqueues':_0x20a843['childModel']=_0x867f('0x40');break;case _0x867f('0x41'):_0x20a843['childModel']=_0x867f('0x42');break;case _0x867f('0x43'):_0x20a843['childModel']=_0x867f('0x44');break;case _0x867f('0x45'):_0x20a843[_0x867f('0x12')]=_0x867f('0x46');break;case _0x867f('0x47'):_0x20a843[_0x867f('0x12')]=_0x867f('0x48');break;case _0x867f('0x49'):_0x20a843['childModel']=_0x867f('0x4a');break;case'smsaccounts':_0x20a843['childModel']=_0x867f('0x4b');break;case'whatsappqueues':_0x20a843['childModel']=_0x867f('0x4c');break;case'whatsappaccounts':_0x20a843[_0x867f('0x12')]=_0x867f('0x4d');break;case'teams':_0x20a843['childModel']='Team';break;case'voicequeues':case _0x867f('0x4e'):_0x20a843[_0x867f('0x12')]=_0x867f('0x35');if(_0x80dfcc){_0x20a843[_0x867f('0x1b')]=[{'name':_0x867f('0x4f')},{'name':_0x867f('0x38')}];}break;case _0x867f('0x50'):case'agents':case _0x867f('0x51'):_0x20a843[_0x867f('0x12')]=_0x867f('0x30');if(_0x80dfcc){_0x20a843['parentSections']=[{'name':_0x867f('0x52'),'filter':{'field':_0x867f('0x53'),'value':[_0x867f('0x54'),_0x867f('0x55')]},'ignore':!![]},{'name':_0x867f('0x56')},{'name':'Telephones'}];}break;case _0x867f('0x57'):_0x20a843[_0x867f('0x12')]=_0x867f('0x58');break;case _0x867f('0x59'):_0x20a843[_0x867f('0x12')]='SalesforceAccount';break;case'freshdeskaccounts':_0x20a843['childModel']=_0x867f('0x5a');break;case _0x867f('0x5b'):_0x20a843[_0x867f('0x12')]='SugarcrmAccount';break;case'deskaccounts':_0x20a843[_0x867f('0x12')]=_0x867f('0x5c');break;case _0x867f('0x5d'):_0x20a843[_0x867f('0x12')]=_0x867f('0x5e');break;case _0x867f('0x5f'):_0x20a843['childModel']=_0x867f('0x30');break;case _0x867f('0x60'):_0x20a843[_0x867f('0x12')]=_0x867f('0x61');break;case _0x867f('0x62'):_0x20a843['childModel']=_0x867f('0x63');break;case _0x867f('0x64'):_0x20a843[_0x867f('0x12')]=_0x867f('0x65');break;case _0x867f('0x66'):_0x20a843['childModel']='Interval';break;case'pauses':_0x20a843[_0x867f('0x12')]=_0x867f('0x67');break;case _0x867f('0x68'):_0x20a843[_0x867f('0x12')]=_0x867f('0x69');break;case _0x867f('0x6a'):_0x20a843[_0x867f('0x12')]=_0x867f('0x6b');break;case _0x867f('0x6c'):_0x20a843[_0x867f('0x12')]='Tag';break;case _0x867f('0x6d'):_0x20a843[_0x867f('0x12')]=_0x867f('0x6e');break;case _0x867f('0x6f'):_0x20a843['childModel']=_0x867f('0x70');break;case _0x867f('0x71'):_0x20a843['childModel']=_0x867f('0x72');break;case _0x867f('0x73'):_0x20a843[_0x867f('0x12')]='Variable';break;case _0x867f('0x74'):_0x20a843['childModel']=_0x867f('0x75');break;case _0x867f('0x76'):_0x20a843[_0x867f('0x12')]=_0x867f('0x77');_0x20a843[_0x867f('0x1b')]=[{'name':_0x867f('0x78'),'field':'id','foreignKey':_0x867f('0x79')}];break;case'metrics':_0x20a843[_0x867f('0x12')]=_0x867f('0x7a');break;}return _0x20a843;}function _0x178f13(_0x185c22,_0x3d2e95){var _0x44bec8=_0x185c22[_0x867f('0x7b')](0x0)[_0x867f('0x7c')]()+_0x185c22[_0x867f('0x7d')](0x1);var _0x130ac4={'type':_0x43a53a[_0x867f('0x7e')]['QueryTypes'][_0x867f('0x7f')],'raw':!![]};return new Promise(function(_0x3b02db,_0x474183){var _0x90e9f=squel[_0x867f('0x80')]()[_0x867f('0x5')](_0x867f('0x81')+_0x44bec8+_0x867f('0x82'),'id')[_0x867f('0x5')]('ui.createdAt')[_0x867f('0x83')](_0x867f('0x84')+_0x185c22+_0x867f('0x85'),'ui')[_0x867f('0x86')]('ui.UserId\x20=\x20?',_0x3d2e95['id']);return _0x43a53a[_0x867f('0x87')][_0x867f('0x88')](_0x90e9f[_0x867f('0x89')](),_0x130ac4)[_0x867f('0x7')](function(_0x19ffa9){_0x3d2e95[_0x44bec8+_0x867f('0x8a')]=_0x19ffa9;_0x3b02db(_0x19ffa9);})[_0x867f('0x9')](function(_0x4cb77e){_0x474183(_0x4cb77e);});});}return _0x35c7bf[_0x867f('0x8b')]('UserProfile',attributes,{'tableName':_0x867f('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x439aa2){var _0xc8727f=require(_0x867f('0x8d'));var _0x3084da={'raw':_0x439aa2[_0x867f('0x88')][_0x867f('0x8e')],'where':{}};var _0xa0c4e0={};var _0x117a51={'count':0x0,'rows':[]};var _0x45062b=_0x439aa2[_0x867f('0x88')][_0x867f('0x8f')];var _0xc650e7=_0x439aa2[_0x867f('0x88')][_0x867f('0x90')]||![];var _0x3aa762=_0x45aa9f(_0x45062b,_0xc650e7);if(!_0x3aa762['childModel'])throw new Error(_0x867f('0x91')+_0x45062b+'\x27');var _0x579b59=[{'name':_0x45062b}];if(!_['isEmpty'](_0x3aa762[_0x867f('0x1b')]))_0x579b59=_0x3aa762[_0x867f('0x1b')];var _0x2b76be=[];for(var _0x13ccbe=0x0;_0x13ccbe<_0x579b59[_0x867f('0x92')];_0x13ccbe++){_0x2b76be[_0x867f('0x93')](_0x43a53a[_0x867f('0x94')][_0x867f('0x95')]({'where':{'userProfileId':_0x439aa2[_0x867f('0x96')]['id'],'name':_0x579b59[_0x13ccbe][_0x867f('0xc')]},'raw':!![]}));}return Promise[_0x867f('0x97')](_0x2b76be)[_0x867f('0x7')](function(_0xd257c0){var _0x4f512d=_[_0x867f('0x4')](_0xd257c0,function(_0x3070b3){return _0x3070b3?_0x3070b3:undefined;});var _0xc54bdc=_[_0x867f('0x4')](_0x579b59,[_0x867f('0x98'),!![]]);var _0x15237b=_[_0x867f('0x99')](_0x4f512d)&&_[_0x867f('0x99')](_0xc54bdc)?null:_[_0x867f('0x9a')](_0xc54bdc,_0x4f512d);if(!_0x15237b)return null;var _0x128d2a=[];for(var _0x4d2877=0x0;_0x4d2877<_0x15237b['length'];_0x4d2877++){var _0x254c50=_[_0x867f('0x95')](_0x579b59,function(_0x4e4778){return _0x15237b[_0x4d2877]?_0x4e4778[_0x867f('0xc')]===_0x15237b[_0x4d2877][_0x867f('0xc')]:null;});if(_0x254c50){if(_0x15237b[_0x4d2877][_0x867f('0x98')]){_0x128d2a[_0x867f('0x93')](_0x44b0f0(_0x3aa762[_0x867f('0x12')],_0x15237b[_0x4d2877]));}else{if(!_0x15237b[_0x4d2877][_0x867f('0x9b')]){_0x128d2a[_0x867f('0x93')](_0x3e1444(_0x254c50,_0x15237b[_0x4d2877],_0x3aa762['childModel']));}else{if(_0x254c50['model']){_0x128d2a[_0x867f('0x93')](_0x8e2479(_0x254c50,_0x15237b[_0x4d2877]));}}}}}return Promise[_0x867f('0x97')](_0x128d2a);})['then'](function(_0x365e71){var _0x37f2ea=_0x365e71;var _0x4f8d41=null;if(_0x37f2ea){_0x4f8d41=_0x37f2ea[_0x867f('0x92')]===0x1?_0x37f2ea[0x0]:null;}if(!_0x4f8d41&&!_0x37f2ea)return _0x117a51;var _0x479bf2=_0x43a53a[_0x3aa762['childModel']][_0x867f('0x9c')];_0xa0c4e0['model']=_[_0x867f('0x9d')](_0x479bf2);_0xa0c4e0[_0x867f('0x88')]=_[_0x867f('0x9d')](_0x439aa2[_0x867f('0x88')]);_0xa0c4e0[_0x867f('0x9e')]=_[_0x867f('0x9f')](_0xa0c4e0[_0x867f('0xb')],_0xa0c4e0[_0x867f('0x88')]);_0x3084da[_0x867f('0xa0')]=_['intersection'](_0xa0c4e0[_0x867f('0xb')],_0xc8727f[_0x867f('0xa1')](_0x439aa2[_0x867f('0x88')][_0x867f('0xa1')]));_0x3084da[_0x867f('0xa0')]=_0x3084da['attributes'][_0x867f('0x92')]?_0x3084da[_0x867f('0xa0')]:_0xa0c4e0[_0x867f('0xb')];if(!_0x439aa2[_0x867f('0x88')][_0x867f('0xa2')](_0x867f('0xa3'))){_0x3084da[_0x867f('0xa4')]=_0xc8727f['limit'](_0x439aa2[_0x867f('0x88')][_0x867f('0xa4')]);_0x3084da[_0x867f('0xa5')]=_0xc8727f['offset'](_0x439aa2[_0x867f('0x88')]['offset']);}_0x3084da[_0x867f('0xa6')]=_0xc8727f['sort'](_0x439aa2[_0x867f('0x88')]['sort']);_0x3084da['where']=_0xc8727f[_0x867f('0x9e')](_['pick'](_0x439aa2['query'],_0xa0c4e0[_0x867f('0x9e')]));if(_0x439aa2[_0x867f('0x88')][_0x867f('0x4')]){_0x3084da[_0x867f('0x86')]=_['merge'](_0x3084da[_0x867f('0x86')],{'$or':_[_0x867f('0xe')](_0x479bf2,function(_0x4685e5){if(_0x4685e5[_0x867f('0x36')][_0x867f('0xa7')]!=='VIRTUAL'){var _0x2b622c={};_0x2b622c[_0x4685e5[_0x867f('0x5')]]={'$like':'%'+_0x439aa2[_0x867f('0x88')]['filter']+'%'};return _0x2b622c;}})});}var _0x3f57b8=[];var _0x5c1e86=null;var _0x6054ad={};if(_0x4f8d41){_0x5c1e86=_['find'](_0x579b59,[_0x867f('0xc'),_0x4f8d41['name']]);if(_0x5c1e86[_0x867f('0x5')]){_0x6054ad={};if(_0x3aa762[_0x867f('0x12')]===_0x867f('0x77')){_0x6054ad[_0x5c1e86[_0x867f('0xa8')]]=_[_0x867f('0xe')](_0x4f8d41['associatedResources'],'id');}else{_0x6054ad[_0x5c1e86[_0x867f('0xa8')]]=_0x4f8d41[_0x867f('0x8')];}_0x3f57b8[_0x867f('0x93')](_0x6054ad);}else{_0x3084da[_0x867f('0x86')]['id']=_0x4f8d41[_0x867f('0x8')];}}else{for(var _0x58f43e=0x0;_0x58f43e<_0x37f2ea['length'];_0x58f43e++){_0x5c1e86=_['find'](_0x579b59,[_0x867f('0xc'),_0x37f2ea[_0x58f43e]['name']]);if(_0x5c1e86[_0x867f('0x5')]){_0x6054ad={};_0x6054ad[_0x5c1e86['foreignKey']]=_0x37f2ea[_0x58f43e][_0x867f('0x8')];_0x3f57b8[_0x867f('0x93')](_0x6054ad);}else{if(!_0x3084da[_0x867f('0x86')]['id'])_0x3084da['where']['id']=[];_0x37f2ea[_0x58f43e][_0x867f('0x8')][_0x867f('0xa9')](function(_0x210f59){_0x3084da[_0x867f('0x86')]['id'][_0x867f('0x93')](_0x210f59);});}}}if(!_['isEmpty'](_0x3f57b8)){_0x3084da[_0x867f('0x86')]=_['merge'](_0x3084da[_0x867f('0x86')],{'$and':{'$or':_0x3f57b8}});}_0x3084da=_[_0x867f('0xaa')]({},_0x3084da,_0x439aa2['options']);if(_0x4f8d41&&!_0x4f8d41[_0x867f('0x9b')]&&_0x3aa762['childModel']==='AnalyticExtractedReport'){if(_0x439aa2[_0x867f('0x88')]['includeAll']){_0x3084da['include']=[{'all':!![]}];}return _0x43a53a[_0x3aa762[_0x867f('0x12')]][_0x867f('0x6')](_0x3084da)['then'](function(_0x7f7874){var _0x1edd99=[];_0x7f7874['forEach'](function(_0x2b1a34){var _0x2001be;switch(_0x2b1a34[_0x867f('0xab')]){case _0x867f('0xac'):_0x2001be=_[_0x867f('0x95')](_0x4f8d41[_0x867f('0x8')],function(_0xd9b972){return _0xd9b972['id']===_0x2b1a34[_0x867f('0x79')]&&_0xd9b972[_0x867f('0x36')]===_0x867f('0xad');});break;case _0x867f('0xae'):_0x2001be=_[_0x867f('0x95')](_0x4f8d41[_0x867f('0x8')],function(_0x1fcfc2){return _0x1fcfc2['id']===_0x2b1a34[_0x867f('0x79')]&&_0x1fcfc2[_0x867f('0x36')]===_0x867f('0xaf');});break;}if(_0x2001be)_0x1edd99[_0x867f('0x93')](_0x2b1a34);});_0x117a51[_0x867f('0xb0')]=_0x1edd99[_0x867f('0x92')];_0x117a51[_0x867f('0xb1')]=_0x1edd99;return _0x117a51;});}else{if(!_[_0x867f('0x99')](_0x439aa2[_0x867f('0x88')][_0x867f('0xb2')])){_0x3084da[_0x867f('0x86')]['id']=_0x3084da['where']['id']?_[_0x867f('0x9f')](_0x3084da['where']['id'],_0x439aa2[_0x867f('0x88')][_0x867f('0xb2')]):_0x439aa2['query'][_0x867f('0xb2')];if(_0x439aa2['query'][_0x867f('0xb3')]){_0x3084da[_0x867f('0xa6')]=_0x439aa2[_0x867f('0x88')][_0x867f('0xb3')];}}if(_0x439aa2[_0x867f('0x88')][_0x867f('0xb4')]){_0x3084da[_0x867f('0x86')]=_[_0x867f('0xaa')](_0x3084da[_0x867f('0x86')],{'$and':_0x439aa2[_0x867f('0x88')][_0x867f('0xb4')]});}return _0x43a53a[_0x3aa762[_0x867f('0x12')]][_0x867f('0xb0')]({'where':_0x3084da[_0x867f('0x86')]})[_0x867f('0x7')](function(_0x3c9182){_0x117a51[_0x867f('0xb0')]=_0x3c9182;if(_0x439aa2[_0x867f('0x88')][_0x867f('0xb5')]){if(_0x3aa762[_0x867f('0x12')]==='CmContact'){_0x3084da['include']=[{'model':_0x43a53a[_0x867f('0xb6')],'as':_0x867f('0xb7'),'attributes':['id',_0x867f('0xc'),_0x867f('0xb8')],'required':_0x439aa2['query']['tag']?!![]:![]},{'model':_0x43a53a['Tag'],'as':'ThroughTags','attributes':['id',_0x867f('0xc'),_0x867f('0xb8')],'through':_0x439aa2[_0x867f('0x88')][_0x867f('0xb9')]?{'attributes':[],'where':{'TagId':_0x439aa2['query'][_0x867f('0xb9')]||undefined}}:{},'required':_0x439aa2[_0x867f('0x88')][_0x867f('0xb9')]?!![]:![]}];}else{_0x3084da['include']=[{'all':!![]}];}}return _0x43a53a[_0x3aa762['childModel']][_0x867f('0x6')](_0x3084da);})[_0x867f('0x7')](function(_0x1ee3fc){_0x117a51[_0x867f('0xb1')]=_0x1ee3fc;if(_0x45062b===_0x867f('0x56')&&_0x439aa2[_0x867f('0x88')][_0x867f('0xba')]===_0x867f('0xbb')){var _0x42a4fe=[];for(var _0x335c38=0x0;_0x335c38<_0x117a51[_0x867f('0xb1')][_0x867f('0x92')];_0x335c38++){_0x42a4fe[_0x867f('0x93')](_0x178f13(_0x867f('0xbc'),_0x117a51['rows'][_0x335c38][_0x867f('0xbd')]));_0x42a4fe[_0x867f('0x93')](_0x178f13(_0x867f('0xbe'),_0x117a51[_0x867f('0xb1')][_0x335c38][_0x867f('0xbd')]));_0x42a4fe[_0x867f('0x93')](_0x178f13(_0x867f('0xbf'),_0x117a51[_0x867f('0xb1')][_0x335c38]['dataValues']));_0x42a4fe['push'](_0x178f13(_0x867f('0xc0'),_0x117a51[_0x867f('0xb1')][_0x335c38]['dataValues']));_0x42a4fe[_0x867f('0x93')](_0x178f13(_0x867f('0xc1'),_0x117a51[_0x867f('0xb1')][_0x335c38]['dataValues']));_0x42a4fe['push'](_0x178f13(_0x867f('0xc2'),_0x117a51[_0x867f('0xb1')][_0x335c38]['dataValues']));}return Promise[_0x867f('0x97')](_0x42a4fe)[_0x867f('0x7')](function(){return _0x117a51;});}return _0x117a51;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0a71aa5..2599a77 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 _0x55c3=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','error','code','message','UserProfile,\x20%s,\x20%s'];(function(_0x217566,_0x3750f8){var _0x54f5de=function(_0x2fb4c9){while(--_0x2fb4c9){_0x217566['push'](_0x217566['shift']());}};_0x54f5de(++_0x3750f8);}(_0x55c3,0x189));var _0x355c=function(_0x11ed77,_0x44fbb7){_0x11ed77=_0x11ed77-0x0;var _0x179370=_0x55c3[_0x11ed77];return _0x179370;};'use strict';var _=require('lodash');var util=require(_0x355c('0x0'));var moment=require(_0x355c('0x1'));var BPromise=require(_0x355c('0x2'));var rs=require(_0x355c('0x3'));var fs=require('fs');var Redis=require(_0x355c('0x4'));var db=require(_0x355c('0x5'))['db'];var utils=require(_0x355c('0x6'));var logger=require(_0x355c('0x7'))(_0x355c('0x8'));var config=require(_0x355c('0x9'));var jayson=require(_0x355c('0xa'));var client=jayson[_0x355c('0xb')][_0x355c('0xc')]({'port':0x232a});config[_0x355c('0xd')]=_['defaults'](config['redis'],{'host':_0x355c('0xe'),'port':0x18eb});var socket=require(_0x355c('0xf'))(new Redis(config[_0x355c('0xd')]));require(_0x355c('0x10'))[_0x355c('0x11')](socket);function respondWithRpcPromise(_0x3ca52d,_0x4d91bc,_0x12fe87){return new BPromise(function(_0x3cdc28,_0xf40017){return client[_0x355c('0x12')](_0x3ca52d,_0x12fe87)[_0x355c('0x13')](function(_0x386a36){logger[_0x355c('0x14')]('UserProfile,\x20%s,\x20%s',_0x4d91bc,_0x355c('0x15'));logger[_0x355c('0x16')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4d91bc,_0x355c('0x15'),JSON['stringify'](_0x386a36));if(_0x386a36[_0x355c('0x17')]){if(_0x386a36[_0x355c('0x17')][_0x355c('0x18')]===0x1f4){logger[_0x355c('0x17')]('UserProfile,\x20%s,\x20%s',_0x4d91bc,_0x386a36[_0x355c('0x17')]['message']);return _0xf40017(_0x386a36['error'][_0x355c('0x19')]);}logger[_0x355c('0x17')](_0x355c('0x1a'),_0x4d91bc,_0x386a36[_0x355c('0x17')][_0x355c('0x19')]);return _0x3cdc28(_0x386a36[_0x355c('0x17')][_0x355c('0x19')]);}else{logger[_0x355c('0x14')](_0x355c('0x1a'),_0x4d91bc,'request\x20sent');_0x3cdc28(_0x386a36[_0x355c('0x1b')][_0x355c('0x19')]);}})['catch'](function(_0x4fabef){logger['error']('UserProfile,\x20%s,\x20%s',_0x4d91bc,_0x4fabef);_0xf40017(_0x4fabef);});});} \ No newline at end of file +var _0xef66=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0xef66,0x1db));var _0x6ef6=function(_0x1a4dd8,_0x255ecb){_0x1a4dd8=_0x1a4dd8-0x0;var _0x575ded=_0xef66[_0x1a4dd8];return _0x575ded;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var moment=require(_0x6ef6('0x2'));var BPromise=require(_0x6ef6('0x3'));var rs=require(_0x6ef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ef6('0x5'));var logger=require(_0x6ef6('0x6'))(_0x6ef6('0x7'));var config=require(_0x6ef6('0x8'));var jayson=require(_0x6ef6('0x9'));var client=jayson[_0x6ef6('0xa')][_0x6ef6('0xb')]({'port':0x232a});config[_0x6ef6('0xc')]=_[_0x6ef6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ef6('0xe'))(new Redis(config[_0x6ef6('0xc')]));require(_0x6ef6('0xf'))[_0x6ef6('0x10')](socket);function respondWithRpcPromise(_0xc0ace,_0x49fed5,_0x1c719e){return new BPromise(function(_0x4bf459,_0x53db5e){return client[_0x6ef6('0x11')](_0xc0ace,_0x1c719e)['then'](function(_0x107bb4){logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,_0x6ef6('0x14'));logger['debug'](_0x6ef6('0x15'),_0x49fed5,_0x6ef6('0x14'),JSON[_0x6ef6('0x16')](_0x107bb4));if(_0x107bb4[_0x6ef6('0x17')]){if(_0x107bb4['error'][_0x6ef6('0x18')]===0x1f4){logger['error'](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')]['message']);return _0x53db5e(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);return _0x4bf459(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}else{logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,'request\x20sent');_0x4bf459(_0x107bb4[_0x6ef6('0x1a')][_0x6ef6('0x19')]);}})[_0x6ef6('0x1b')](function(_0x37d2ef){logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x37d2ef);_0x53db5e(_0x37d2ef);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fc90eb8..e30e880 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 _0xbb19=['update','emit','removeListener','./userProfile.events','save','remove'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0xbb19,0x105));var _0x9bb1=function(_0x438261,_0x596052){_0x438261=_0x438261-0x0;var _0x537189=_0xbb19[_0x438261];return _0x537189;};'use strict';var UserProfileEvents=require(_0x9bb1('0x0'));var events=[_0x9bb1('0x1'),_0x9bb1('0x2'),_0x9bb1('0x3')];function createListener(_0x41003a,_0x37ae9c){return function(_0xafc5b5){_0x37ae9c[_0x9bb1('0x4')](_0x41003a,_0xafc5b5);};}function removeListener(_0x4860ff,_0x36c109){return function(){UserProfileEvents[_0x9bb1('0x5')](_0x4860ff,_0x36c109);};}exports['register']=function(_0x1828cd){for(var _0x16d3df=0x0,_0x230116=events['length'];_0x16d3df<_0x230116;_0x16d3df++){var _0x2fc564=events[_0x16d3df];var _0x1eb6e8=createListener('userProfile:'+_0x2fc564,_0x1828cd);UserProfileEvents['on'](_0x2fc564,_0x1eb6e8);}}; \ No newline at end of file +var _0x0fec=['save','remove','update','emit','removeListener','userProfile:'];(function(_0x16e604,_0x30add6){var _0x20efca=function(_0x240da4){while(--_0x240da4){_0x16e604['push'](_0x16e604['shift']());}};_0x20efca(++_0x30add6);}(_0x0fec,0x174));var _0xc0fe=function(_0x5e9964,_0x432f56){_0x5e9964=_0x5e9964-0x0;var _0x329c2a=_0x0fec[_0x5e9964];return _0x329c2a;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc0fe('0x0'),_0xc0fe('0x1'),_0xc0fe('0x2')];function createListener(_0x477199,_0x887f0a){return function(_0x23200a){_0x887f0a[_0xc0fe('0x3')](_0x477199,_0x23200a);};}function removeListener(_0x544c4d,_0x580e60){return function(){UserProfileEvents[_0xc0fe('0x4')](_0x544c4d,_0x580e60);};}exports['register']=function(_0x5ae5e0){for(var _0x30a530=0x0,_0x193cea=events['length'];_0x30a530<_0x193cea;_0x30a530++){var _0x29341f=events[_0x30a530];var _0x516150=createListener(_0xc0fe('0x5')+_0x29341f,_0x5ae5e0);UserProfileEvents['on'](_0x29341f,_0x516150);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0a9cd80..d7318fd 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 _0xabd7=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5d86bc,_0x31fbf2){var _0x562f82=function(_0x5a036a){while(--_0x5a036a){_0x5d86bc['push'](_0x5d86bc['shift']());}};_0x562f82(++_0x31fbf2);}(_0xabd7,0x189));var _0x7abd=function(_0x2de80e,_0x986172){_0x2de80e=_0x2de80e-0x0;var _0x20bb48=_0xabd7[_0x2de80e];return _0x20bb48;};'use strict';var multer=require(_0x7abd('0x0'));var util=require('util');var path=require(_0x7abd('0x1'));var timeout=require(_0x7abd('0x2'));var express=require(_0x7abd('0x3'));var router=express[_0x7abd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7abd('0x5'));var interaction=require(_0x7abd('0x6'));var config=require(_0x7abd('0x7'));var controller=require(_0x7abd('0x8'));router['get']('/',auth[_0x7abd('0x9')](),controller[_0x7abd('0xa')]);router[_0x7abd('0xb')](_0x7abd('0xc'),auth[_0x7abd('0x9')](),controller[_0x7abd('0xd')]);router[_0x7abd('0xb')](_0x7abd('0xe'),auth[_0x7abd('0x9')](),controller['show']);router[_0x7abd('0xf')]('/',auth[_0x7abd('0x9')](),controller[_0x7abd('0x10')]);router[_0x7abd('0x11')]('/:id',auth[_0x7abd('0x9')](),controller[_0x7abd('0x12')]);router[_0x7abd('0x13')](_0x7abd('0xe'),auth[_0x7abd('0x9')](),controller[_0x7abd('0x14')]);module[_0x7abd('0x15')]=router; \ No newline at end of file +var _0xdf8d=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','path'];(function(_0x355736,_0x44951a){var _0xd6a974=function(_0x10f710){while(--_0x10f710){_0x355736['push'](_0x355736['shift']());}};_0xd6a974(++_0x44951a);}(_0xdf8d,0x65));var _0xddf8=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xdf8d[_0x454018];return _0x24697d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xddf8('0x0'));var timeout=require('connect-timeout');var express=require(_0xddf8('0x1'));var router=express[_0xddf8('0x2')]();var fs_extra=require(_0xddf8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xddf8('0x4'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xddf8('0x5')]('/',auth[_0xddf8('0x6')](),controller[_0xddf8('0x7')]);router['get'](_0xddf8('0x8'),auth[_0xddf8('0x6')](),controller['describe']);router[_0xddf8('0x5')](_0xddf8('0x9'),auth[_0xddf8('0x6')](),controller[_0xddf8('0xa')]);router[_0xddf8('0xb')]('/',auth[_0xddf8('0x6')](),controller[_0xddf8('0xc')]);router[_0xddf8('0xd')]('/:id',auth[_0xddf8('0x6')](),controller['update']);router[_0xddf8('0xe')](_0xddf8('0x9'),auth[_0xddf8('0x6')](),controller[_0xddf8('0xf')]);module[_0xddf8('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 cd3d251..6f92cd8 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 _0xed4a=['sequelize','exports','STRING','INTEGER'];(function(_0x43f9fe,_0xc56a95){var _0x43608c=function(_0x183a59){while(--_0x183a59){_0x43f9fe['push'](_0x43f9fe['shift']());}};_0x43608c(++_0xc56a95);}(_0xed4a,0x144));var _0xaed4=function(_0x1f8354,_0xc26f05){_0x1f8354=_0x1f8354-0x0;var _0x1eda76=_0xed4a[_0x1f8354];return _0x1eda76;};'use strict';var Sequelize=require(_0xaed4('0x0'));module[_0xaed4('0x1')]={'name':{'type':Sequelize[_0xaed4('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xaed4('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xaed4('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd1ea=['INTEGER','exports','STRING'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0xd1ea,0x88));var _0xad1e=function(_0x9823f0,_0x427cf6){_0x9823f0=_0x9823f0-0x0;var _0x415dc5=_0xd1ea[_0x9823f0];return _0x415dc5;};'use strict';var Sequelize=require('sequelize');module[_0xad1e('0x0')]={'name':{'type':Sequelize[_0xad1e('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xad1e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xad1e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ea3f292..f038935 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 _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x2cf67,_0x52cf52){var _0x1db413=function(_0x27484f){while(--_0x27484f){_0x2cf67['push'](_0x2cf67['shift']());}};_0x1db413(++_0x52cf52);}(_0x33af,0xec));var _0xf33a=function(_0x268916,_0x1c27e1){_0x268916=_0x268916-0x0;var _0x38f8a4=_0x33af[_0x268916];return _0x38f8a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));}; \ No newline at end of file +var _0x2a07=['index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x474f02,_0x44c5af){_0x474f02=_0x474f02-0x0;var _0x47321d=_0x2a07[_0x474f02];return _0x47321d;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['UserProfileResource'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['UserProfileResource']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 33754c1..a84b522 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 _0x0d40=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d40,0xb9));var _0x00d4=function(_0x51c4f3,_0x1ce048){_0x51c4f3=_0x51c4f3-0x0;var _0x2d46be=_0x0d40[_0x51c4f3];return _0x2d46be;};'use strict';var _=require(_0x00d4('0x0'));var util=require(_0x00d4('0x1'));var logger=require(_0x00d4('0x2'))(_0x00d4('0x3'));var moment=require(_0x00d4('0x4'));var BPromise=require(_0x00d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x00d4('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x00d4('0x7')]=function(_0x57c27f,_0x29d932){return _0x57c27f[_0x00d4('0x8')](_0x00d4('0x9'),attributes,{'tableName':_0x00d4('0xa'),'paranoid':![],'indexes':[{'name':_0x00d4('0xb'),'fields':[_0x00d4('0xc'),_0x00d4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x618f=['exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfileResource.attributes'];(function(_0x893179,_0x5b4c85){var _0x15d29c=function(_0x55b4ae){while(--_0x55b4ae){_0x893179['push'](_0x893179['shift']());}};_0x15d29c(++_0x5b4c85);}(_0x618f,0xb7));var _0xf618=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x618f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf618('0x0'));var util=require(_0xf618('0x1'));var logger=require(_0xf618('0x2'))(_0xf618('0x3'));var moment=require(_0xf618('0x4'));var BPromise=require(_0xf618('0x5'));var rp=require(_0xf618('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf618('0x7'));var attributes=require(_0xf618('0x8'));module[_0xf618('0x9')]=function(_0xccd820,_0x946e24){return _0xccd820[_0xf618('0xa')](_0xf618('0xb'),attributes,{'tableName':_0xf618('0xc'),'paranoid':![],'indexes':[{'name':_0xf618('0xd'),'fields':[_0xf618('0xe'),_0xf618('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6d8defa..2fe36d5 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 _0xce94=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','debug','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce94,0xea));var _0x4ce9=function(_0x5e062a,_0x38dd36){_0x5e062a=_0x5e062a-0x0;var _0x33a66e=_0xce94[_0x5e062a];return _0x33a66e;};'use strict';var _=require(_0x4ce9('0x0'));var util=require(_0x4ce9('0x1'));var moment=require(_0x4ce9('0x2'));var BPromise=require(_0x4ce9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ce9('0x4'))['db'];var utils=require(_0x4ce9('0x5'));var logger=require(_0x4ce9('0x6'))(_0x4ce9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4ce9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bceed,_0x8fc457,_0x522e98){return new BPromise(function(_0x521091,_0x1110e0){return client['request'](_0x1bceed,_0x522e98)['then'](function(_0x23050c){logger[_0x4ce9('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x8fc457,'request\x20sent');logger[_0x4ce9('0xa')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x8fc457,_0x4ce9('0xb'),JSON[_0x4ce9('0xc')](_0x23050c));if(_0x23050c[_0x4ce9('0xd')]){if(_0x23050c['error'][_0x4ce9('0xe')]===0x1f4){logger[_0x4ce9('0xd')](_0x4ce9('0xf'),_0x8fc457,_0x23050c[_0x4ce9('0xd')][_0x4ce9('0x10')]);return _0x1110e0(_0x23050c[_0x4ce9('0xd')]['message']);}logger[_0x4ce9('0xd')](_0x4ce9('0xf'),_0x8fc457,_0x23050c['error']['message']);return _0x521091(_0x23050c[_0x4ce9('0xd')][_0x4ce9('0x10')]);}else{logger['info'](_0x4ce9('0xf'),_0x8fc457,_0x4ce9('0xb'));_0x521091(_0x23050c[_0x4ce9('0x11')][_0x4ce9('0x10')]);}})['catch'](function(_0x4ef1cb){logger[_0x4ce9('0xd')](_0x4ce9('0xf'),_0x8fc457,_0x4ef1cb);_0x1110e0(_0x4ef1cb);});});} \ No newline at end of file +var _0x821a=['request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','ioredis','../../mysqldb','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x821a,0x9b));var _0xa821=function(_0x229262,_0x268c68){_0x229262=_0x229262-0x0;var _0x54431b=_0x821a[_0x229262];return _0x54431b;};'use strict';var _=require('lodash');var util=require(_0xa821('0x0'));var moment=require(_0xa821('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa821('0x2'));var db=require(_0xa821('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa821('0x4'));var client=jayson[_0xa821('0x5')][_0xa821('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31f1f9,_0x485a4d,_0x35f199){return new BPromise(function(_0x1bd4a3,_0x149de9){return client[_0xa821('0x7')](_0x31f1f9,_0x35f199)[_0xa821('0x8')](function(_0x34f408){logger['info'](_0xa821('0x9'),_0x485a4d,_0xa821('0xa'));logger[_0xa821('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x485a4d,'request\x20sent',JSON[_0xa821('0xc')](_0x34f408));if(_0x34f408['error']){if(_0x34f408[_0xa821('0xd')][_0xa821('0xe')]===0x1f4){logger[_0xa821('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x485a4d,_0x34f408['error'][_0xa821('0xf')]);return _0x149de9(_0x34f408[_0xa821('0xd')]['message']);}logger[_0xa821('0xd')](_0xa821('0x9'),_0x485a4d,_0x34f408[_0xa821('0xd')]['message']);return _0x1bd4a3(_0x34f408[_0xa821('0xd')]['message']);}else{logger[_0xa821('0x10')](_0xa821('0x9'),_0x485a4d,_0xa821('0xa'));_0x1bd4a3(_0x34f408[_0xa821('0x11')][_0xa821('0xf')]);}})['catch'](function(_0x2a5e0a){logger[_0xa821('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x485a4d,_0x2a5e0a);_0x149de9(_0x2a5e0a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 38e136f..b6a2446 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 _0xc064=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc064,0x1b7));var _0x4c06=function(_0x30f100,_0x589bd2){_0x30f100=_0x30f100-0x0;var _0x1f7811=_0xc064[_0x30f100];return _0x1f7811;};'use strict';var multer=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c06('0x2'));var router=express[_0x4c06('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c06('0x4'));var interaction=require(_0x4c06('0x5'));var config=require(_0x4c06('0x6'));var controller=require(_0x4c06('0x7'));router[_0x4c06('0x8')]('/',auth[_0x4c06('0x9')](),controller[_0x4c06('0xa')]);router[_0x4c06('0x8')](_0x4c06('0xb'),auth['isAuthenticated'](),controller[_0x4c06('0xc')]);router[_0x4c06('0x8')](_0x4c06('0xd'),auth[_0x4c06('0x9')](),controller[_0x4c06('0xe')]);router[_0x4c06('0xf')]('/',auth[_0x4c06('0x9')](),controller[_0x4c06('0x10')]);router[_0x4c06('0x11')](_0x4c06('0xd'),auth[_0x4c06('0x9')](),controller[_0x4c06('0x12')]);router[_0x4c06('0x13')](_0x4c06('0xd'),auth['isAuthenticated'](),controller[_0x4c06('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5b1b=['./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x5b1b,0x162));var _0xb5b1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b1b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb5b1('0x0'));var util=require(_0xb5b1('0x1'));var path=require(_0xb5b1('0x2'));var timeout=require(_0xb5b1('0x3'));var express=require(_0xb5b1('0x4'));var router=express[_0xb5b1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5b1('0x6'));var controller=require(_0xb5b1('0x7'));router['get']('/',auth[_0xb5b1('0x8')](),controller['index']);router[_0xb5b1('0x9')](_0xb5b1('0xa'),auth[_0xb5b1('0x8')](),controller[_0xb5b1('0xb')]);router[_0xb5b1('0x9')](_0xb5b1('0xc'),auth['isAuthenticated'](),controller[_0xb5b1('0xd')]);router[_0xb5b1('0xe')]('/',auth[_0xb5b1('0x8')](),controller['create']);router['put'](_0xb5b1('0xc'),auth[_0xb5b1('0x8')](),controller[_0xb5b1('0xf')]);router[_0xb5b1('0x10')](_0xb5b1('0xc'),auth['isAuthenticated'](),controller[_0xb5b1('0x11')]);module[_0xb5b1('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 2452af7..0b6147f 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 _0x4024=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue'];(function(_0x1e767e,_0x554687){var _0x4534cd=function(_0x25f4d1){while(--_0x25f4d1){_0x1e767e['push'](_0x1e767e['shift']());}};_0x4534cd(++_0x554687);}(_0x4024,0x89));var _0x4402=function(_0x82a0bf,_0x57b0ec){_0x82a0bf=_0x82a0bf-0x0;var _0x505859=_0x4024[_0x82a0bf];return _0x505859;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4402('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4402('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4402('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x950c82){this[_0x4402('0x5')]('crudPermissions',_0x950c82?_0x950c82['join'](''):[]);},'get':function(){return this[_0x4402('0x6')](_0x4402('0x7'))?this[_0x4402('0x6')]('crudPermissions')[_0x4402('0x8')](''):[];}}}; \ No newline at end of file +var _0x282b=['setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING','INTEGER'];(function(_0x6efff0,_0x4f98b2){var _0x55b004=function(_0x5b59c1){while(--_0x5b59c1){_0x6efff0['push'](_0x6efff0['shift']());}};_0x55b004(++_0x4f98b2);}(_0x282b,0xec));var _0xb282=function(_0x459dfe,_0x37944c){_0x459dfe=_0x459dfe-0x0;var _0x3dd230=_0x282b[_0x459dfe];return _0x3dd230;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xb282('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb282('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb282('0x2')],'set':function(_0x5cadd7){this[_0xb282('0x4')](_0xb282('0x5'),_0x5cadd7?_0x5cadd7[_0xb282('0x6')](''):[]);},'get':function(){return this[_0xb282('0x7')](_0xb282('0x5'))?this[_0xb282('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7be49ba..e3fbe5a 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 _0xb1cb=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','name','map','UserProfileSection','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','then','includeAll','findAll','rows','catch','show','params','include','find','body','destroy','eml-format','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb1cb,0x94));var _0xbb1c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xb1cb[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xbb1c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb1c('0x1'));var moment=require(_0xbb1c('0x2'));var BPromise=require(_0xbb1c('0x3'));var Mustache=require(_0xbb1c('0x4'));var util=require(_0xbb1c('0x5'));var path=require(_0xbb1c('0x6'));var sox=require(_0xbb1c('0x7'));var csv=require(_0xbb1c('0x8'));var ejs=require(_0xbb1c('0x9'));var fs=require('fs');var fs_extra=require(_0xbb1c('0xa'));var _=require(_0xbb1c('0xb'));var squel=require(_0xbb1c('0xc'));var crypto=require(_0xbb1c('0xd'));var jsforce=require(_0xbb1c('0xe'));var deskjs=require(_0xbb1c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbb1c('0x10'));var Papa=require(_0xbb1c('0x11'));var Redis=require(_0xbb1c('0x12'));var authService=require(_0xbb1c('0x13'));var qs=require(_0xbb1c('0x14'));var as=require(_0xbb1c('0x15'));var hardwareService=require(_0xbb1c('0x16'));var logger=require(_0xbb1c('0x17'))('api');var utils=require(_0xbb1c('0x18'));var config=require(_0xbb1c('0x19'));var licenseUtil=require(_0xbb1c('0x1a'));var db=require(_0xbb1c('0x1b'))['db'];function respondWithStatusCode(_0x436bd4,_0x25e0a1){_0x25e0a1=_0x25e0a1||0xcc;return function(_0x1c8cb7){if(_0x1c8cb7){return _0x436bd4[_0xbb1c('0x1c')](_0x25e0a1);}return _0x436bd4[_0xbb1c('0x1d')](_0x25e0a1)[_0xbb1c('0x1e')]();};}function respondWithResult(_0x562766,_0x434924){_0x434924=_0x434924||0xc8;return function(_0x1e20e6){if(_0x1e20e6){return _0x562766[_0xbb1c('0x1d')](_0x434924)['json'](_0x1e20e6);}};}function respondWithFilteredResult(_0x37d933,_0x1e22c0){return function(_0x4519df){if(_0x4519df){var _0x3e4741=typeof _0x1e22c0[_0xbb1c('0x1f')]===_0xbb1c('0x20')&&typeof _0x1e22c0[_0xbb1c('0x21')]===_0xbb1c('0x20');var _0x43742a=_0x4519df[_0xbb1c('0x22')];var _0x3d0e00=_0x3e4741?0x0:_0x1e22c0[_0xbb1c('0x1f')];var _0x48c885=_0x3e4741?_0x4519df[_0xbb1c('0x22')]:_0x1e22c0[_0xbb1c('0x1f')]+_0x1e22c0[_0xbb1c('0x21')];var _0x1ae3da;if(_0x48c885>=_0x43742a){_0x48c885=_0x43742a;_0x1ae3da=0xc8;}else{_0x1ae3da=0xce;}_0x37d933[_0xbb1c('0x1d')](_0x1ae3da);return _0x37d933[_0xbb1c('0x23')](_0xbb1c('0x24'),_0x3d0e00+'-'+_0x48c885+'/'+_0x43742a)[_0xbb1c('0x25')](_0x4519df);}return null;};}function patchUpdates(_0x902a33){return function(_0x517b9d){try{jsonpatch['apply'](_0x517b9d,_0x902a33,!![]);}catch(_0x43d13d){return BPromise[_0xbb1c('0x26')](_0x43d13d);}return _0x517b9d[_0xbb1c('0x27')]();};}function saveUpdates(_0x250eeb,_0xa3c68b){return function(_0x585b9d){if(_0x585b9d){return _0x585b9d[_0xbb1c('0x28')](_0x250eeb)['then'](function(_0x29b584){return _0x29b584;});}return null;};}function removeEntity(_0x339875,_0x6190ad){return function(_0x392d1a){if(_0x392d1a){return _0x392d1a['destroy']()['then'](function(){_0x339875[_0xbb1c('0x1d')](0xcc)[_0xbb1c('0x1e')]();});}};}function handleEntityNotFound(_0x5096aa,_0x4a79c3){return function(_0x4e0e01){if(!_0x4e0e01){_0x5096aa[_0xbb1c('0x1c')](0x194);}return _0x4e0e01;};}function handleError(_0x5172e6,_0xb9d58){_0xb9d58=_0xb9d58||0x1f4;return function(_0x1fb2e2){logger['error'](_0x1fb2e2['stack']);if(_0x1fb2e2[_0xbb1c('0x29')]){delete _0x1fb2e2[_0xbb1c('0x29')];}_0x5172e6[_0xbb1c('0x1d')](_0xb9d58)['send'](_0x1fb2e2);};}exports['index']=function(_0xf692cf,_0xbc4e8f){var _0x1d557d={},_0x663386={},_0x85a374={'count':0x0,'rows':[]};var _0x8c1588=_[_0xbb1c('0x2a')](db[_0xbb1c('0x2b')][_0xbb1c('0x2c')],function(_0x32ba03){return{'name':_0x32ba03[_0xbb1c('0x2d')],'type':_0x32ba03['type'][_0xbb1c('0x2e')]};});_0x663386['model']=_[_0xbb1c('0x2a')](_0x8c1588,_0xbb1c('0x29'));_0x663386[_0xbb1c('0x2f')]=_[_0xbb1c('0x30')](_0xf692cf['query']);_0x663386['filters']=_[_0xbb1c('0x31')](_0x663386[_0xbb1c('0x32')],_0x663386[_0xbb1c('0x2f')]);_0x1d557d[_0xbb1c('0x33')]=_[_0xbb1c('0x31')](_0x663386[_0xbb1c('0x32')],qs['fields'](_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x34')]));_0x1d557d[_0xbb1c('0x33')]=_0x1d557d['attributes'][_0xbb1c('0x35')]?_0x1d557d[_0xbb1c('0x33')]:_0x663386[_0xbb1c('0x32')];if(!_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x36')](_0xbb1c('0x37'))){_0x1d557d['limit']=qs[_0xbb1c('0x21')](_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x21')]);_0x1d557d['offset']=qs[_0xbb1c('0x1f')](_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x1f')]);}_0x1d557d[_0xbb1c('0x38')]=qs[_0xbb1c('0x39')](_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x39')]);_0x1d557d[_0xbb1c('0x3a')]=qs[_0xbb1c('0x3b')](_[_0xbb1c('0x3c')](_0xf692cf[_0xbb1c('0x2f')],_0x663386['filters']),_0x8c1588);if(_0xf692cf[_0xbb1c('0x2f')]['filter']){_0x1d557d[_0xbb1c('0x3a')]=_[_0xbb1c('0x3d')](_0x1d557d['where'],{'$or':_['map'](_0x8c1588,function(_0x4879b7){if(_0x4879b7[_0xbb1c('0x3e')]!=='VIRTUAL'){var _0x112730={};_0x112730[_0x4879b7[_0xbb1c('0x29')]]={'$like':'%'+_0xf692cf['query'][_0xbb1c('0x3f')]+'%'};return _0x112730;}})});}_0x1d557d=_[_0xbb1c('0x3d')]({},_0x1d557d,_0xf692cf['options']);var _0x10fb33={'where':_0x1d557d[_0xbb1c('0x3a')]};return db[_0xbb1c('0x2b')][_0xbb1c('0x22')](_0x10fb33)[_0xbb1c('0x40')](function(_0x133b47){_0x85a374[_0xbb1c('0x22')]=_0x133b47;if(_0xf692cf[_0xbb1c('0x2f')][_0xbb1c('0x41')]){_0x1d557d['include']=[{'all':!![]}];}return db[_0xbb1c('0x2b')][_0xbb1c('0x42')](_0x1d557d);})['then'](function(_0x5a640b){_0x85a374[_0xbb1c('0x43')]=_0x5a640b;return _0x85a374;})[_0xbb1c('0x40')](respondWithFilteredResult(_0xbc4e8f,_0x1d557d))[_0xbb1c('0x44')](handleError(_0xbc4e8f,null));};exports[_0xbb1c('0x45')]=function(_0x697097,_0x204c9b){var _0x58cc36={'raw':![],'where':{'id':_0x697097[_0xbb1c('0x46')]['id']}},_0x3b5a21={};_0x3b5a21['model']=_[_0xbb1c('0x30')](db[_0xbb1c('0x2b')]['rawAttributes']);_0x3b5a21[_0xbb1c('0x2f')]=_[_0xbb1c('0x30')](_0x697097[_0xbb1c('0x2f')]);_0x3b5a21['filters']=_['intersection'](_0x3b5a21[_0xbb1c('0x32')],_0x3b5a21[_0xbb1c('0x2f')]);_0x58cc36[_0xbb1c('0x33')]=_['intersection'](_0x3b5a21[_0xbb1c('0x32')],qs[_0xbb1c('0x34')](_0x697097[_0xbb1c('0x2f')][_0xbb1c('0x34')]));_0x58cc36['attributes']=_0x58cc36[_0xbb1c('0x33')]['length']?_0x58cc36[_0xbb1c('0x33')]:_0x3b5a21['model'];if(_0x697097[_0xbb1c('0x2f')]['includeAll']){_0x58cc36[_0xbb1c('0x47')]=[{'all':!![]}];}_0x58cc36=_['merge']({},_0x58cc36,_0x697097['options']);return db[_0xbb1c('0x2b')][_0xbb1c('0x48')](_0x58cc36)[_0xbb1c('0x40')](handleEntityNotFound(_0x204c9b,null))[_0xbb1c('0x40')](respondWithResult(_0x204c9b,null))[_0xbb1c('0x44')](handleError(_0x204c9b,null));};exports['create']=function(_0x5fa33b,_0x58127f){return db[_0xbb1c('0x2b')]['create'](_0x5fa33b['body'],{})[_0xbb1c('0x40')](respondWithResult(_0x58127f,0xc9))['catch'](handleError(_0x58127f,null));};exports[_0xbb1c('0x28')]=function(_0x1a58f1,_0x581901){if(_0x1a58f1[_0xbb1c('0x49')]['id']){delete _0x1a58f1[_0xbb1c('0x49')]['id'];}return db[_0xbb1c('0x2b')]['find']({'where':{'id':_0x1a58f1[_0xbb1c('0x46')]['id']}})['then'](handleEntityNotFound(_0x581901,null))[_0xbb1c('0x40')](saveUpdates(_0x1a58f1['body'],null))['then'](respondWithResult(_0x581901,null))[_0xbb1c('0x44')](handleError(_0x581901,null));};exports[_0xbb1c('0x4a')]=function(_0x44f136,_0x43903c){return db[_0xbb1c('0x2b')]['find']({'where':{'id':_0x44f136[_0xbb1c('0x46')]['id']}})[_0xbb1c('0x40')](handleEntityNotFound(_0x43903c,null))['then'](removeEntity(_0x43903c,null))[_0xbb1c('0x44')](handleError(_0x43903c,null));};exports['describe']=function(_0x35ca8e,_0x277648){return db[_0xbb1c('0x2b')]['describe']()[_0xbb1c('0x40')](respondWithResult(_0x277648,null))[_0xbb1c('0x44')](handleError(_0x277648,null));}; \ No newline at end of file +var _0xb5f5=['hasOwnProperty','nolimit','order','sort','pick','filter','where','map','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x1d91c6,_0x6d90ba){var _0x29ce25=function(_0x55645c){while(--_0x55645c){_0x1d91c6['push'](_0x1d91c6['shift']());}};_0x29ce25(++_0x6d90ba);}(_0xb5f5,0xf8));var _0x5b5f=function(_0x16f4e5,_0x2de654){_0x16f4e5=_0x16f4e5-0x0;var _0x4fd22e=_0xb5f5[_0x16f4e5];return _0x4fd22e;};'use strict';var emlformat=require(_0x5b5f('0x0'));var rimraf=require(_0x5b5f('0x1'));var zipdir=require(_0x5b5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b5f('0x3'));var moment=require(_0x5b5f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b5f('0x5'));var util=require('util');var path=require(_0x5b5f('0x6'));var sox=require(_0x5b5f('0x7'));var csv=require('to-csv');var ejs=require(_0x5b5f('0x8'));var fs=require('fs');var fs_extra=require(_0x5b5f('0x9'));var _=require(_0x5b5f('0xa'));var squel=require(_0x5b5f('0xb'));var crypto=require(_0x5b5f('0xc'));var jsforce=require(_0x5b5f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5b5f('0xe'));var querystring=require(_0x5b5f('0xf'));var Papa=require(_0x5b5f('0x10'));var Redis=require('ioredis');var authService=require(_0x5b5f('0x11'));var qs=require(_0x5b5f('0x12'));var as=require(_0x5b5f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b5f('0x14'))(_0x5b5f('0x15'));var utils=require(_0x5b5f('0x16'));var config=require(_0x5b5f('0x17'));var licenseUtil=require(_0x5b5f('0x18'));var db=require(_0x5b5f('0x19'))['db'];function respondWithStatusCode(_0x2bdd40,_0x1602d6){_0x1602d6=_0x1602d6||0xcc;return function(_0x5b4f01){if(_0x5b4f01){return _0x2bdd40['sendStatus'](_0x1602d6);}return _0x2bdd40[_0x5b5f('0x1a')](_0x1602d6)[_0x5b5f('0x1b')]();};}function respondWithResult(_0x5a9406,_0x4f2033){_0x4f2033=_0x4f2033||0xc8;return function(_0x325aa1){if(_0x325aa1){return _0x5a9406[_0x5b5f('0x1a')](_0x4f2033)[_0x5b5f('0x1c')](_0x325aa1);}};}function respondWithFilteredResult(_0x2ab98f,_0x1b9bed){return function(_0x856707){if(_0x856707){var _0x4273cb=typeof _0x1b9bed[_0x5b5f('0x1d')]===_0x5b5f('0x1e')&&typeof _0x1b9bed[_0x5b5f('0x1f')]===_0x5b5f('0x1e');var _0x5c0776=_0x856707[_0x5b5f('0x20')];var _0x249f0e=_0x4273cb?0x0:_0x1b9bed[_0x5b5f('0x1d')];var _0x162638=_0x4273cb?_0x856707[_0x5b5f('0x20')]:_0x1b9bed[_0x5b5f('0x1d')]+_0x1b9bed['limit'];var _0x518413;if(_0x162638>=_0x5c0776){_0x162638=_0x5c0776;_0x518413=0xc8;}else{_0x518413=0xce;}_0x2ab98f[_0x5b5f('0x1a')](_0x518413);return _0x2ab98f['set'](_0x5b5f('0x21'),_0x249f0e+'-'+_0x162638+'/'+_0x5c0776)['json'](_0x856707);}return null;};}function patchUpdates(_0x2e973d){return function(_0x470b78){try{jsonpatch['apply'](_0x470b78,_0x2e973d,!![]);}catch(_0x235fb4){return BPromise['reject'](_0x235fb4);}return _0x470b78[_0x5b5f('0x22')]();};}function saveUpdates(_0x3c5bfb,_0x3188f9){return function(_0x30cbe5){if(_0x30cbe5){return _0x30cbe5[_0x5b5f('0x23')](_0x3c5bfb)['then'](function(_0x681c42){return _0x681c42;});}return null;};}function removeEntity(_0x1bb64a,_0x1cd3fe){return function(_0x228b61){if(_0x228b61){return _0x228b61[_0x5b5f('0x24')]()[_0x5b5f('0x25')](function(){_0x1bb64a['status'](0xcc)[_0x5b5f('0x1b')]();});}};}function handleEntityNotFound(_0x429e0d,_0x5dee8b){return function(_0x31a896){if(!_0x31a896){_0x429e0d['sendStatus'](0x194);}return _0x31a896;};}function handleError(_0x1b9717,_0x2c691a){_0x2c691a=_0x2c691a||0x1f4;return function(_0x3d56f6){logger[_0x5b5f('0x26')](_0x3d56f6[_0x5b5f('0x27')]);if(_0x3d56f6[_0x5b5f('0x28')]){delete _0x3d56f6[_0x5b5f('0x28')];}_0x1b9717[_0x5b5f('0x1a')](_0x2c691a)[_0x5b5f('0x29')](_0x3d56f6);};}exports[_0x5b5f('0x2a')]=function(_0x24070b,_0x21de42){var _0x46ed0e={},_0x1a4c1a={},_0x513c4d={'count':0x0,'rows':[]};var _0x58163c=_['map'](db[_0x5b5f('0x2b')][_0x5b5f('0x2c')],function(_0x53d47c){return{'name':_0x53d47c[_0x5b5f('0x2d')],'type':_0x53d47c[_0x5b5f('0x2e')][_0x5b5f('0x2f')]};});_0x1a4c1a[_0x5b5f('0x30')]=_['map'](_0x58163c,'name');_0x1a4c1a[_0x5b5f('0x31')]=_[_0x5b5f('0x32')](_0x24070b[_0x5b5f('0x31')]);_0x1a4c1a[_0x5b5f('0x33')]=_[_0x5b5f('0x34')](_0x1a4c1a[_0x5b5f('0x30')],_0x1a4c1a[_0x5b5f('0x31')]);_0x46ed0e['attributes']=_[_0x5b5f('0x34')](_0x1a4c1a[_0x5b5f('0x30')],qs[_0x5b5f('0x35')](_0x24070b[_0x5b5f('0x31')][_0x5b5f('0x35')]));_0x46ed0e[_0x5b5f('0x36')]=_0x46ed0e[_0x5b5f('0x36')][_0x5b5f('0x37')]?_0x46ed0e['attributes']:_0x1a4c1a['model'];if(!_0x24070b['query'][_0x5b5f('0x38')](_0x5b5f('0x39'))){_0x46ed0e[_0x5b5f('0x1f')]=qs[_0x5b5f('0x1f')](_0x24070b[_0x5b5f('0x31')][_0x5b5f('0x1f')]);_0x46ed0e[_0x5b5f('0x1d')]=qs['offset'](_0x24070b[_0x5b5f('0x31')]['offset']);}_0x46ed0e[_0x5b5f('0x3a')]=qs[_0x5b5f('0x3b')](_0x24070b['query']['sort']);_0x46ed0e['where']=qs['filters'](_[_0x5b5f('0x3c')](_0x24070b[_0x5b5f('0x31')],_0x1a4c1a[_0x5b5f('0x33')]),_0x58163c);if(_0x24070b['query'][_0x5b5f('0x3d')]){_0x46ed0e[_0x5b5f('0x3e')]=_['merge'](_0x46ed0e['where'],{'$or':_[_0x5b5f('0x3f')](_0x58163c,function(_0x1a6f75){if(_0x1a6f75[_0x5b5f('0x2e')]!=='VIRTUAL'){var _0x1d8d8d={};_0x1d8d8d[_0x1a6f75[_0x5b5f('0x28')]]={'$like':'%'+_0x24070b[_0x5b5f('0x31')][_0x5b5f('0x3d')]+'%'};return _0x1d8d8d;}})});}_0x46ed0e=_[_0x5b5f('0x40')]({},_0x46ed0e,_0x24070b['options']);var _0x49ee59={'where':_0x46ed0e[_0x5b5f('0x3e')]};return db[_0x5b5f('0x2b')][_0x5b5f('0x20')](_0x49ee59)[_0x5b5f('0x25')](function(_0x317df3){_0x513c4d['count']=_0x317df3;if(_0x24070b[_0x5b5f('0x31')][_0x5b5f('0x41')]){_0x46ed0e[_0x5b5f('0x42')]=[{'all':!![]}];}return db[_0x5b5f('0x2b')]['findAll'](_0x46ed0e);})[_0x5b5f('0x25')](function(_0x151f7a){_0x513c4d[_0x5b5f('0x43')]=_0x151f7a;return _0x513c4d;})[_0x5b5f('0x25')](respondWithFilteredResult(_0x21de42,_0x46ed0e))[_0x5b5f('0x44')](handleError(_0x21de42,null));};exports[_0x5b5f('0x45')]=function(_0x107ffd,_0x3770ff){var _0x37db4f={'raw':![],'where':{'id':_0x107ffd[_0x5b5f('0x46')]['id']}},_0xf08c43={};_0xf08c43[_0x5b5f('0x30')]=_['keys'](db['UserProfileSection'][_0x5b5f('0x2c')]);_0xf08c43['query']=_[_0x5b5f('0x32')](_0x107ffd[_0x5b5f('0x31')]);_0xf08c43[_0x5b5f('0x33')]=_[_0x5b5f('0x34')](_0xf08c43['model'],_0xf08c43[_0x5b5f('0x31')]);_0x37db4f[_0x5b5f('0x36')]=_[_0x5b5f('0x34')](_0xf08c43[_0x5b5f('0x30')],qs[_0x5b5f('0x35')](_0x107ffd[_0x5b5f('0x31')][_0x5b5f('0x35')]));_0x37db4f['attributes']=_0x37db4f['attributes'][_0x5b5f('0x37')]?_0x37db4f[_0x5b5f('0x36')]:_0xf08c43[_0x5b5f('0x30')];if(_0x107ffd[_0x5b5f('0x31')]['includeAll']){_0x37db4f[_0x5b5f('0x42')]=[{'all':!![]}];}_0x37db4f=_[_0x5b5f('0x40')]({},_0x37db4f,_0x107ffd[_0x5b5f('0x47')]);return db[_0x5b5f('0x2b')][_0x5b5f('0x48')](_0x37db4f)['then'](handleEntityNotFound(_0x3770ff,null))[_0x5b5f('0x25')](respondWithResult(_0x3770ff,null))[_0x5b5f('0x44')](handleError(_0x3770ff,null));};exports[_0x5b5f('0x49')]=function(_0x3701e1,_0x3147aa){return db[_0x5b5f('0x2b')][_0x5b5f('0x49')](_0x3701e1[_0x5b5f('0x4a')],{})[_0x5b5f('0x25')](respondWithResult(_0x3147aa,0xc9))[_0x5b5f('0x44')](handleError(_0x3147aa,null));};exports[_0x5b5f('0x23')]=function(_0x31656a,_0x20ffda){if(_0x31656a[_0x5b5f('0x4a')]['id']){delete _0x31656a[_0x5b5f('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x31656a[_0x5b5f('0x46')]['id']}})['then'](handleEntityNotFound(_0x20ffda,null))[_0x5b5f('0x25')](saveUpdates(_0x31656a[_0x5b5f('0x4a')],null))[_0x5b5f('0x25')](respondWithResult(_0x20ffda,null))[_0x5b5f('0x44')](handleError(_0x20ffda,null));};exports[_0x5b5f('0x24')]=function(_0x29efd5,_0x4a9edc){return db[_0x5b5f('0x2b')][_0x5b5f('0x48')]({'where':{'id':_0x29efd5[_0x5b5f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a9edc,null))['then'](removeEntity(_0x4a9edc,null))['catch'](handleError(_0x4a9edc,null));};exports[_0x5b5f('0x4b')]=function(_0x5b29a6,_0x124055){return db[_0x5b5f('0x2b')][_0x5b5f('0x4b')]()['then'](respondWithResult(_0x124055,null))[_0x5b5f('0x44')](handleError(_0x124055,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9bc5e04..13f741c 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 _0x15f0=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','sectionId','lodash'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x15f0,0x1eb));var _0x015f=function(_0x49aa90,_0x1bb428){_0x49aa90=_0x49aa90-0x0;var _0x53888e=_0x15f0[_0x49aa90];return _0x53888e;};'use strict';var _=require(_0x015f('0x0'));var util=require(_0x015f('0x1'));var logger=require(_0x015f('0x2'))(_0x015f('0x3'));var moment=require(_0x015f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x015f('0x5'));var rimraf=require(_0x015f('0x6'));var config=require(_0x015f('0x7'));var attributes=require(_0x015f('0x8'));module[_0x015f('0x9')]=function(_0x21ab30,_0x1d0c42){return _0x21ab30[_0x015f('0xa')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x015f('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2bd=['api','moment','bluebird','request-promise','path','rimraf','exports','define','user_profile_has_sections','compositeIndex','lodash','util','../../config/logger'];(function(_0x3dd91f,_0x815f56){var _0x4e1ffc=function(_0x428319){while(--_0x428319){_0x3dd91f['push'](_0x3dd91f['shift']());}};_0x4e1ffc(++_0x815f56);}(_0xf2bd,0x135));var _0xdf2b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf2bd[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xdf2b('0x0'));var util=require(_0xdf2b('0x1'));var logger=require(_0xdf2b('0x2'))(_0xdf2b('0x3'));var moment=require(_0xdf2b('0x4'));var BPromise=require(_0xdf2b('0x5'));var rp=require(_0xdf2b('0x6'));var fs=require('fs');var path=require(_0xdf2b('0x7'));var rimraf=require(_0xdf2b('0x8'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0xdf2b('0x9')]=function(_0x25cc58,_0x271967){return _0x25cc58[_0xdf2b('0xa')]('UserProfileSection',attributes,{'tableName':_0xdf2b('0xb'),'paranoid':![],'indexes':[{'name':_0xdf2b('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 421ef8d..1d2ab25 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 _0xb288=['client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xb288,0x1b1));var _0x8b28=function(_0x3ade1d,_0x254e1c){_0x3ade1d=_0x3ade1d-0x0;var _0x439a39=_0xb288[_0x3ade1d];return _0x439a39;};'use strict';var _=require(_0x8b28('0x0'));var util=require('util');var moment=require(_0x8b28('0x1'));var BPromise=require(_0x8b28('0x2'));var rs=require(_0x8b28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b28('0x4'));var logger=require(_0x8b28('0x5'))(_0x8b28('0x6'));var config=require('../../config/environment');var jayson=require(_0x8b28('0x7'));var client=jayson[_0x8b28('0x8')][_0x8b28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x273c91,_0x409fde,_0x29d3fd){return new BPromise(function(_0x3afb4d,_0x45b992){return client[_0x8b28('0xa')](_0x273c91,_0x29d3fd)['then'](function(_0xed9701){logger[_0x8b28('0xb')](_0x8b28('0xc'),_0x409fde,_0x8b28('0xd'));logger[_0x8b28('0xe')](_0x8b28('0xf'),_0x409fde,_0x8b28('0xd'),JSON[_0x8b28('0x10')](_0xed9701));if(_0xed9701[_0x8b28('0x11')]){if(_0xed9701[_0x8b28('0x11')][_0x8b28('0x12')]===0x1f4){logger[_0x8b28('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x409fde,_0xed9701['error']['message']);return _0x45b992(_0xed9701['error'][_0x8b28('0x13')]);}logger[_0x8b28('0x11')](_0x8b28('0xc'),_0x409fde,_0xed9701['error'][_0x8b28('0x13')]);return _0x3afb4d(_0xed9701['error'][_0x8b28('0x13')]);}else{logger[_0x8b28('0xb')](_0x8b28('0xc'),_0x409fde,_0x8b28('0xd'));_0x3afb4d(_0xed9701['result'][_0x8b28('0x13')]);}})[_0x8b28('0x14')](function(_0x5abe17){logger[_0x8b28('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x409fde,_0x5abe17);_0x45b992(_0x5abe17);});});} \ No newline at end of file +var _0x028a=['message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1b16ba,_0xe1a8dc){var _0x30d703=function(_0x4b6f53){while(--_0x4b6f53){_0x1b16ba['push'](_0x1b16ba['shift']());}};_0x30d703(++_0xe1a8dc);}(_0x028a,0xfd));var _0xa028=function(_0x36da48,_0xd4f63b){_0x36da48=_0x36da48-0x0;var _0x2c0be6=_0x028a[_0x36da48];return _0x2c0be6;};'use strict';var _=require(_0xa028('0x0'));var util=require(_0xa028('0x1'));var moment=require(_0xa028('0x2'));var BPromise=require('bluebird');var rs=require(_0xa028('0x3'));var fs=require('fs');var Redis=require(_0xa028('0x4'));var db=require(_0xa028('0x5'))['db'];var utils=require(_0xa028('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa028('0x7'));var jayson=require(_0xa028('0x8'));var client=jayson[_0xa028('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564224,_0x5e276a,_0x5224ca){return new BPromise(function(_0x200701,_0x5c3dd5){return client[_0xa028('0xa')](_0x564224,_0x5224ca)[_0xa028('0xb')](function(_0x5cfdc8){logger[_0xa028('0xc')](_0xa028('0xd'),_0x5e276a,_0xa028('0xe'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5e276a,_0xa028('0xe'),JSON[_0xa028('0xf')](_0x5cfdc8));if(_0x5cfdc8['error']){if(_0x5cfdc8['error']['code']===0x1f4){logger[_0xa028('0x10')](_0xa028('0xd'),_0x5e276a,_0x5cfdc8[_0xa028('0x10')][_0xa028('0x11')]);return _0x5c3dd5(_0x5cfdc8['error'][_0xa028('0x11')]);}logger['error'](_0xa028('0xd'),_0x5e276a,_0x5cfdc8[_0xa028('0x10')][_0xa028('0x11')]);return _0x200701(_0x5cfdc8[_0xa028('0x10')][_0xa028('0x11')]);}else{logger[_0xa028('0xc')](_0xa028('0xd'),_0x5e276a,_0xa028('0xe'));_0x200701(_0x5cfdc8['result'][_0xa028('0x11')]);}})['catch'](function(_0x267816){logger['error'](_0xa028('0xd'),_0x5e276a,_0x267816);_0x5c3dd5(_0x267816);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 56b618d..62a836c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3ebcee,_0x1e9541){var _0x34609a=function(_0x376103){while(--_0x376103){_0x3ebcee['push'](_0x3ebcee['shift']());}};_0x34609a(++_0x1e9541);}(_0x70e0,0x17b));var _0x070e=function(_0x4fa1ed,_0x35e978){_0x4fa1ed=_0x4fa1ed-0x0;var _0x10883d=_0x70e0[_0x4fa1ed];return _0x10883d;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5d83d5,_0x47bebb){var _0x103e97=function(_0x40bec0){while(--_0x40bec0){_0x5d83d5['push'](_0x5d83d5['shift']());}};_0x103e97(++_0x47bebb);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f750a,_0x244a8d){_0x1f750a=_0x1f750a-0x0;var _0x4fa658=_0xedd9[_0x1f750a];return _0x4fa658;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 51f2378..b13b52a 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 _0xfa4a=['sequelize','INTEGER'];(function(_0x29b242,_0x273342){var _0x21d336=function(_0x310022){while(--_0x310022){_0x29b242['push'](_0x29b242['shift']());}};_0x21d336(++_0x273342);}(_0xfa4a,0x1be));var _0xafa4=function(_0x417ea3,_0x156e87){_0x417ea3=_0x417ea3-0x0;var _0x18c29d=_0xfa4a[_0x417ea3];return _0x18c29d;};'use strict';var Sequelize=require(_0xafa4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xafa4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1ac3=['exports','INTEGER','sequelize'];(function(_0x198abb,_0x582c52){var _0x40bf4b=function(_0x3c60f9){while(--_0x3c60f9){_0x198abb['push'](_0x198abb['shift']());}};_0x40bf4b(++_0x582c52);}(_0x1ac3,0x17c));var _0x31ac=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x1ac3[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0x31ac('0x0'));module[_0x31ac('0x1')]={'penalty':{'type':Sequelize[_0x31ac('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 944509a..a5715b9 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 _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','user_has_sms_queues','bluebird'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x5d58,0x187));var _0x85d5=function(_0x344e58,_0x3bb959){_0x344e58=_0x344e58-0x0;var _0x1ff711=_0x5d58[_0x344e58];return _0x1ff711;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./userSmsQueue.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('UserSmsQueue',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e0e=['../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x11a6bd,_0x526e61){var _0x120525=function(_0x41617a){while(--_0x41617a){_0x11a6bd['push'](_0x11a6bd['shift']());}};_0x120525(++_0x526e61);}(_0x5e0e,0x89));var _0xe5e0=function(_0x419560,_0x16a92c){_0x419560=_0x419560-0x0;var _0x52a0a9=_0x5e0e[_0x419560];return _0x52a0a9;};'use strict';var _=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var logger=require('../../config/logger')(_0xe5e0('0x2'));var moment=require(_0xe5e0('0x3'));var BPromise=require(_0xe5e0('0x4'));var rp=require(_0xe5e0('0x5'));var fs=require('fs');var path=require(_0xe5e0('0x6'));var rimraf=require('rimraf');var config=require(_0xe5e0('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xe5e0('0x8')]=function(_0x3e564e,_0x2ff9ac){return _0x3e564e[_0xe5e0('0x9')](_0xe5e0('0xa'),attributes,{'tableName':_0xe5e0('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 60bad74..0d510dd 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 _0x2bcf=['UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x487832,_0x13283c){var _0xf27148=function(_0x59b567){while(--_0x59b567){_0x487832['push'](_0x487832['shift']());}};_0xf27148(++_0x13283c);}(_0x2bcf,0x1c0));var _0xf2bc=function(_0x3ccd5c,_0x1ee1a7){_0x3ccd5c=_0x3ccd5c-0x0;var _0x1be3e3=_0x2bcf[_0x3ccd5c];return _0x1be3e3;};'use strict';var _=require(_0xf2bc('0x0'));var util=require(_0xf2bc('0x1'));var moment=require(_0xf2bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2bc('0x3'));var db=require(_0xf2bc('0x4'))['db'];var utils=require(_0xf2bc('0x5'));var logger=require(_0xf2bc('0x6'))(_0xf2bc('0x7'));var config=require('../../config/environment');var jayson=require(_0xf2bc('0x8'));var client=jayson[_0xf2bc('0x9')][_0xf2bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59d94d,_0x302016,_0x4f734f){return new BPromise(function(_0x3b84e8,_0x2443cf){return client[_0xf2bc('0xb')](_0x59d94d,_0x4f734f)[_0xf2bc('0xc')](function(_0x375849){logger[_0xf2bc('0xd')](_0xf2bc('0xe'),_0x302016,'request\x20sent');logger[_0xf2bc('0xf')](_0xf2bc('0x10'),_0x302016,_0xf2bc('0x11'),JSON['stringify'](_0x375849));if(_0x375849[_0xf2bc('0x12')]){if(_0x375849[_0xf2bc('0x12')]['code']===0x1f4){logger[_0xf2bc('0x12')](_0xf2bc('0xe'),_0x302016,_0x375849[_0xf2bc('0x12')][_0xf2bc('0x13')]);return _0x2443cf(_0x375849[_0xf2bc('0x12')]['message']);}logger[_0xf2bc('0x12')](_0xf2bc('0xe'),_0x302016,_0x375849['error'][_0xf2bc('0x13')]);return _0x3b84e8(_0x375849['error']['message']);}else{logger['info'](_0xf2bc('0xe'),_0x302016,'request\x20sent');_0x3b84e8(_0x375849[_0xf2bc('0x14')][_0xf2bc('0x13')]);}})['catch'](function(_0x25bc71){logger[_0xf2bc('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x302016,_0x25bc71);_0x2443cf(_0x25bc71);});});} \ No newline at end of file +var _0xcdcc=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x4dce83,_0x5a4396){var _0x4939ce=function(_0x2fae98){while(--_0x2fae98){_0x4dce83['push'](_0x4dce83['shift']());}};_0x4939ce(++_0x5a4396);}(_0xcdcc,0x78));var _0xccdc=function(_0x2b24f8,_0x4dc816){_0x2b24f8=_0x2b24f8-0x0;var _0x54b75e=_0xcdcc[_0x2b24f8];return _0x54b75e;};'use strict';var _=require(_0xccdc('0x0'));var util=require('util');var moment=require(_0xccdc('0x1'));var BPromise=require(_0xccdc('0x2'));var rs=require(_0xccdc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccdc('0x4'))['db'];var utils=require(_0xccdc('0x5'));var logger=require('../../config/logger')(_0xccdc('0x6'));var config=require(_0xccdc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xccdc('0x8')][_0xccdc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495ad7,_0x5354f5,_0x2802e4){return new BPromise(function(_0x2fa5e4,_0x1ba273){return client[_0xccdc('0xa')](_0x495ad7,_0x2802e4)[_0xccdc('0xb')](function(_0x351058){logger[_0xccdc('0xc')](_0xccdc('0xd'),_0x5354f5,_0xccdc('0xe'));logger[_0xccdc('0xf')](_0xccdc('0x10'),_0x5354f5,_0xccdc('0xe'),JSON[_0xccdc('0x11')](_0x351058));if(_0x351058[_0xccdc('0x12')]){if(_0x351058[_0xccdc('0x12')][_0xccdc('0x13')]===0x1f4){logger[_0xccdc('0x12')](_0xccdc('0xd'),_0x5354f5,_0x351058['error'][_0xccdc('0x14')]);return _0x1ba273(_0x351058[_0xccdc('0x12')]['message']);}logger['error'](_0xccdc('0xd'),_0x5354f5,_0x351058['error'][_0xccdc('0x14')]);return _0x2fa5e4(_0x351058[_0xccdc('0x12')][_0xccdc('0x14')]);}else{logger['info'](_0xccdc('0xd'),_0x5354f5,'request\x20sent');_0x2fa5e4(_0x351058[_0xccdc('0x15')][_0xccdc('0x14')]);}})['catch'](function(_0xb76fb){logger[_0xccdc('0x12')](_0xccdc('0xd'),_0x5354f5,_0xb76fb);_0x1ba273(_0xb76fb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 755fb93..bef97e0 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 _0xd041=['INTEGER','sequelize'];(function(_0x407ebf,_0x2b47f5){var _0x29d7db=function(_0x4a25bf){while(--_0x4a25bf){_0x407ebf['push'](_0x407ebf['shift']());}};_0x29d7db(++_0x2b47f5);}(_0xd041,0x187));var _0x1d04=function(_0x4e75c5,_0x5eeb93){_0x4e75c5=_0x4e75c5-0x0;var _0x872171=_0xd041[_0x4e75c5];return _0x872171;};'use strict';var Sequelize=require(_0x1d04('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x1d04('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x592b=['sequelize','exports','INTEGER'];(function(_0x1c6856,_0x8786ba){var _0x310ca5=function(_0x5d32b6){while(--_0x5d32b6){_0x1c6856['push'](_0x1c6856['shift']());}};_0x310ca5(++_0x8786ba);}(_0x592b,0x8a));var _0xb592=function(_0x42f840,_0x1aa32e){_0x42f840=_0x42f840-0x0;var _0x47539f=_0x592b[_0x42f840];return _0x47539f;};'use strict';var Sequelize=require(_0xb592('0x0'));module[_0xb592('0x1')]={'UserId':{'type':Sequelize[_0xb592('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xb592('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index bb379a4..a3ece6a 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(_0xf04e42,_0x402df9){var _0x547479=function(_0x4f6685){while(--_0x4f6685){_0xf04e42['push'](_0xf04e42['shift']());}};_0x547479(++_0x402df9);}(_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 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(_0x4fd534,_0x2a3094){var _0x5255d6=function(_0x421f55){while(--_0x421f55){_0x4fd534['push'](_0x4fd534['shift']());}};_0x5255d6(++_0x2a3094);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 e5df1a9..8eebc0a 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2e1440,_0x5caf49){var _0x572883=function(_0x3b8001){while(--_0x3b8001){_0x2e1440['push'](_0x2e1440['shift']());}};_0x572883(++_0x5caf49);}(_0x70e0,0x17b));var _0x070e=function(_0x32fd7d,_0x2851c1){_0x32fd7d=_0x32fd7d-0x0;var _0x36b81e=_0x70e0[_0x32fd7d];return _0x36b81e;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x16cade,_0x49787d){var _0x1f9a74=function(_0x557eb8){while(--_0x557eb8){_0x16cade['push'](_0x16cade['shift']());}};_0x1f9a74(++_0x49787d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 905cb92..1ae1678 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 _0x61c6=['INTEGER','sequelize','exports'];(function(_0x11bc2e,_0xfeec21){var _0x364908=function(_0x10adcc){while(--_0x10adcc){_0x11bc2e['push'](_0x11bc2e['shift']());}};_0x364908(++_0xfeec21);}(_0x61c6,0x199));var _0x661c=function(_0x152bcc,_0x4e642e){_0x152bcc=_0x152bcc-0x0;var _0x3166f5=_0x61c6[_0x152bcc];return _0x3166f5;};'use strict';var Sequelize=require(_0x661c('0x0'));module[_0x661c('0x1')]={'penalty':{'type':Sequelize[_0x661c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1f17=['INTEGER','sequelize'];(function(_0x191288,_0x406bee){var _0x189193=function(_0x3305f4){while(--_0x3305f4){_0x191288['push'](_0x191288['shift']());}};_0x189193(++_0x406bee);}(_0x1f17,0x71));var _0x71f1=function(_0x3c68e4,_0x20e968){_0x3c68e4=_0x3c68e4-0x0;var _0x2b35e7=_0x1f17[_0x3c68e4];return _0x2b35e7;};'use strict';var Sequelize=require(_0x71f1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x71f1('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 303655c..4554446 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 _0x04d8=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x04d8,0x1d9));var _0x804d=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x04d8[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x804d('0x0'));var util=require('util');var logger=require(_0x804d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x804d('0x2'));var rp=require(_0x804d('0x3'));var fs=require('fs');var path=require(_0x804d('0x4'));var rimraf=require(_0x804d('0x5'));var config=require('../../config/environment');var attributes=require(_0x804d('0x6'));module[_0x804d('0x7')]=function(_0x5537ce,_0x3bdfd8){return _0x5537ce[_0x804d('0x8')](_0x804d('0x9'),attributes,{'tableName':_0x804d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc0c=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x3736ae,_0x1e0e98){var _0x327b26=function(_0x43ecde){while(--_0x43ecde){_0x3736ae['push'](_0x3736ae['shift']());}};_0x327b26(++_0x1e0e98);}(_0xdc0c,0x9a));var _0xcdc0=function(_0x4b5476,_0x4d42dd){_0x4b5476=_0x4b5476-0x0;var _0xd587a4=_0xdc0c[_0x4b5476];return _0xd587a4;};'use strict';var _=require(_0xcdc0('0x0'));var util=require(_0xcdc0('0x1'));var logger=require('../../config/logger')(_0xcdc0('0x2'));var moment=require(_0xcdc0('0x3'));var BPromise=require(_0xcdc0('0x4'));var rp=require(_0xcdc0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcdc0('0x6'));var attributes=require(_0xcdc0('0x7'));module[_0xcdc0('0x8')]=function(_0x41c24e,_0xfc0470){return _0x41c24e[_0xcdc0('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xcdc0('0xa'),'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 3c94103..fcfae32 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 _0x71de=['request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x71de,0x182));var _0xe71d=function(_0xe4df1e,_0x28fd58){_0xe4df1e=_0xe4df1e-0x0;var _0x24397a=_0x71de[_0xe4df1e];return _0x24397a;};'use strict';var _=require(_0xe71d('0x0'));var util=require(_0xe71d('0x1'));var moment=require(_0xe71d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe71d('0x3'))['db'];var utils=require(_0xe71d('0x4'));var logger=require(_0xe71d('0x5'))(_0xe71d('0x6'));var config=require(_0xe71d('0x7'));var jayson=require(_0xe71d('0x8'));var client=jayson[_0xe71d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ae24d,_0x49270e,_0x31dcf6){return new BPromise(function(_0x482575,_0x502949){return client[_0xe71d('0xa')](_0x2ae24d,_0x31dcf6)[_0xe71d('0xb')](function(_0x104525){logger[_0xe71d('0xc')](_0xe71d('0xd'),_0x49270e,_0xe71d('0xe'));logger[_0xe71d('0xf')](_0xe71d('0x10'),_0x49270e,_0xe71d('0xe'),JSON[_0xe71d('0x11')](_0x104525));if(_0x104525[_0xe71d('0x12')]){if(_0x104525[_0xe71d('0x12')][_0xe71d('0x13')]===0x1f4){logger[_0xe71d('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x49270e,_0x104525[_0xe71d('0x12')][_0xe71d('0x14')]);return _0x502949(_0x104525['error'][_0xe71d('0x14')]);}logger[_0xe71d('0x12')](_0xe71d('0xd'),_0x49270e,_0x104525[_0xe71d('0x12')]['message']);return _0x482575(_0x104525['error'][_0xe71d('0x14')]);}else{logger[_0xe71d('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x49270e,_0xe71d('0xe'));_0x482575(_0x104525[_0xe71d('0x15')][_0xe71d('0x14')]);}})['catch'](function(_0x14d49f){logger[_0xe71d('0x12')](_0xe71d('0xd'),_0x49270e,_0x14d49f);_0x502949(_0x14d49f);});});} \ No newline at end of file +var _0x6957=['jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x2268d9,_0x2784c6){var _0x4ca542=function(_0x2ad2ef){while(--_0x2ad2ef){_0x2268d9['push'](_0x2268d9['shift']());}};_0x4ca542(++_0x2784c6);}(_0x6957,0x85));var _0x7695=function(_0x5e6028,_0x23f4f8){_0x5e6028=_0x5e6028-0x0;var _0x3edddd=_0x6957[_0x5e6028];return _0x3edddd;};'use strict';var _=require(_0x7695('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7695('0x1'));var rs=require(_0x7695('0x2'));var fs=require('fs');var Redis=require(_0x7695('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7695('0x4'))(_0x7695('0x5'));var config=require(_0x7695('0x6'));var jayson=require(_0x7695('0x7'));var client=jayson[_0x7695('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43eced,_0x51066e,_0x57ffc2){return new BPromise(function(_0x41f140,_0x4b1b57){return client[_0x7695('0x9')](_0x43eced,_0x57ffc2)['then'](function(_0x312e8e){logger[_0x7695('0xa')](_0x7695('0xb'),_0x51066e,_0x7695('0xc'));logger[_0x7695('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x51066e,'request\x20sent',JSON[_0x7695('0xe')](_0x312e8e));if(_0x312e8e['error']){if(_0x312e8e[_0x7695('0xf')][_0x7695('0x10')]===0x1f4){logger[_0x7695('0xf')](_0x7695('0xb'),_0x51066e,_0x312e8e['error']['message']);return _0x4b1b57(_0x312e8e['error'][_0x7695('0x11')]);}logger[_0x7695('0xf')](_0x7695('0xb'),_0x51066e,_0x312e8e[_0x7695('0xf')][_0x7695('0x11')]);return _0x41f140(_0x312e8e[_0x7695('0xf')][_0x7695('0x11')]);}else{logger[_0x7695('0xa')](_0x7695('0xb'),_0x51066e,'request\x20sent');_0x41f140(_0x312e8e[_0x7695('0x12')][_0x7695('0x11')]);}})[_0x7695('0x13')](function(_0x38b739){logger[_0x7695('0xf')](_0x7695('0xb'),_0x51066e,_0x38b739);_0x4b1b57(_0x38b739);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a9e12a3..e89d53f 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x202b09,_0x421ef1){var _0x2c5253=function(_0x559ead){while(--_0x559ead){_0x202b09['push'](_0x202b09['shift']());}};_0x2c5253(++_0x421ef1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x153ed0,_0x1aa7fe){var _0x4bef10=function(_0x58e3f6){while(--_0x58e3f6){_0x153ed0['push'](_0x153ed0['shift']());}};_0x4bef10(++_0x1aa7fe);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e1e30d5..8534fc5 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 _0x23a1=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x3d13d7,_0x295266){var _0x34fdde=function(_0x2c52bf){while(--_0x2c52bf){_0x3d13d7['push'](_0x3d13d7['shift']());}};_0x34fdde(++_0x295266);}(_0x23a1,0x19c));var _0x123a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x23a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x123a('0x0'));module[_0x123a('0x1')]={'uniqueid':{'type':Sequelize[_0x123a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x123a('0x3')},'membername':{'type':Sequelize[_0x123a('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x123a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x123a('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x123a('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x123a('0x5'),'comment':_0x123a('0x3')},'penalty':{'type':Sequelize[_0x123a('0x2')](0xb),'defaultValue':0x0,'comment':_0x123a('0x3')},'paused':{'type':Sequelize[_0x123a('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xa0aa=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5c0070,_0x4a2213){var _0x18d795=function(_0x56e0a9){while(--_0x56e0a9){_0x5c0070['push'](_0x5c0070['shift']());}};_0x18d795(++_0x4a2213);}(_0xa0aa,0x83));var _0xaa0a=function(_0x55f720,_0xf03784){_0x55f720=_0x55f720-0x0;var _0x2a24e9=_0xa0aa[_0x55f720];return _0x2a24e9;};'use strict';var Sequelize=require(_0xaa0a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xaa0a('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xaa0a('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xaa0a('0x3')],'allowNull':![],'unique':_0xaa0a('0x4'),'comment':_0xaa0a('0x2')},'VoiceQueueId':{'type':Sequelize[_0xaa0a('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xaa0a('0x1')](0xb),'defaultValue':0x0,'comment':_0xaa0a('0x2')},'paused':{'type':Sequelize[_0xaa0a('0x1')](0xb),'defaultValue':0x0,'comment':_0xaa0a('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 22a0a7f..fab8195 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 _0x53e9=['hook','events','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x53e9,0x94));var _0x953e=function(_0x2b0044,_0x4f4821){_0x2b0044=_0x2b0044-0x0;var _0x2a7ddb=_0x53e9[_0x2b0044];return _0x2a7ddb;};'use strict';var EventEmitter=require(_0x953e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x953e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x953e('0x2'),'afterDestroy':_0x953e('0x3')};function emitEvent(_0x462918){return function(_0x3f5d99,_0x3725df,_0x4d3fce){UserVoiceQueueRtEvents['emit'](_0x462918+':'+_0x3f5d99['id'],_0x3f5d99);UserVoiceQueueRtEvents[_0x953e('0x4')](_0x462918,_0x3f5d99);_0x4d3fce(null);};}for(var e in events){if(events[_0x953e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x953e('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa0d8=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','save','update'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xa0d8,0x1d9));var _0x8a0d=function(_0x528ed7,_0x387b11){_0x528ed7=_0x528ed7-0x0;var _0x43e540=_0xa0d8[_0x528ed7];return _0x43e540;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8a0d('0x0'))['db'][_0x8a0d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a0d('0x2'),'afterUpdate':_0x8a0d('0x3'),'afterDestroy':_0x8a0d('0x4')};function emitEvent(_0x56188b){return function(_0x311fc5,_0xcfeacc,_0x318c5e){UserVoiceQueueRtEvents[_0x8a0d('0x5')](_0x56188b+':'+_0x311fc5['id'],_0x311fc5);UserVoiceQueueRtEvents[_0x8a0d('0x5')](_0x56188b,_0x311fc5);_0x318c5e(null);};}for(var e in events){if(events[_0x8a0d('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x8a0d('0x7')](e,emitEvent(event));}}module[_0x8a0d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index cf1aaf6..f1c09da 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 _0x0723=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2c5318,_0x18767f){var _0x913999=function(_0x1eeeb8){while(--_0x1eeeb8){_0x2c5318['push'](_0x2c5318['shift']());}};_0x913999(++_0x18767f);}(_0x0723,0x19d));var _0x3072=function(_0x3e1ed0,_0x4e2a92){_0x3e1ed0=_0x3e1ed0-0x0;var _0x35acc1=_0x0723[_0x3e1ed0];return _0x35acc1;};'use strict';var _=require(_0x3072('0x0'));var util=require('util');var logger=require(_0x3072('0x1'))('api');var moment=require(_0x3072('0x2'));var BPromise=require(_0x3072('0x3'));var rp=require(_0x3072('0x4'));var fs=require('fs');var path=require(_0x3072('0x5'));var rimraf=require(_0x3072('0x6'));var config=require(_0x3072('0x7'));var attributes=require(_0x3072('0x8'));module['exports']=function(_0x3d89ea,_0xe9a945){return _0x3d89ea[_0x3072('0x9')](_0x3072('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd09=['bluebird','request-promise','path','../../config/environment','user_has_voice_queues_rt','lodash','../../config/logger','api'];(function(_0x14f19b,_0x1fdb3a){var _0x2d0cd0=function(_0xb6dfce){while(--_0xb6dfce){_0x14f19b['push'](_0x14f19b['shift']());}};_0x2d0cd0(++_0x1fdb3a);}(_0xfd09,0xb5));var _0x9fd0=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0xfd09[_0x46884f];return _0x78c6c0;};'use strict';var _=require(_0x9fd0('0x0'));var util=require('util');var logger=require(_0x9fd0('0x1'))(_0x9fd0('0x2'));var moment=require('moment');var BPromise=require(_0x9fd0('0x3'));var rp=require(_0x9fd0('0x4'));var fs=require('fs');var path=require(_0x9fd0('0x5'));var rimraf=require('rimraf');var config=require(_0x9fd0('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x368d03,_0x95230){return _0x368d03['define']('UserVoiceQueueRt',attributes,{'tableName':_0x9fd0('0x7'),'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 b67c103..9b2f565 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 _0xbb48=['GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x16d297,_0x30dd59){var _0x4a400b=function(_0x5c33b4){while(--_0x5c33b4){_0x16d297['push'](_0x16d297['shift']());}};_0x4a400b(++_0x30dd59);}(_0xbb48,0x1a0));var _0x8bb4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbb48[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8bb4('0x0'));var util=require(_0x8bb4('0x1'));var moment=require(_0x8bb4('0x2'));var BPromise=require(_0x8bb4('0x3'));var rs=require(_0x8bb4('0x4'));var fs=require('fs');var Redis=require(_0x8bb4('0x5'));var db=require(_0x8bb4('0x6'))['db'];var utils=require(_0x8bb4('0x7'));var logger=require(_0x8bb4('0x8'))(_0x8bb4('0x9'));var config=require(_0x8bb4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8bb4('0xb')][_0x8bb4('0xc')]({'port':0x232a});config[_0x8bb4('0xd')]=_[_0x8bb4('0xe')](config[_0x8bb4('0xd')],{'host':_0x8bb4('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bb4('0xd')]));require('./userVoiceQueueRt.socket')[_0x8bb4('0x10')](socket);function respondWithRpcPromise(_0x125751,_0x3359ad,_0x3dabad){return new BPromise(function(_0x428586,_0x42e72d){return client['request'](_0x125751,_0x3dabad)[_0x8bb4('0x11')](function(_0x5de680){logger[_0x8bb4('0x12')](_0x8bb4('0x13'),_0x3359ad,_0x8bb4('0x14'));logger[_0x8bb4('0x15')](_0x8bb4('0x16'),_0x3359ad,_0x8bb4('0x14'),JSON[_0x8bb4('0x17')](_0x5de680));if(_0x5de680[_0x8bb4('0x18')]){if(_0x5de680[_0x8bb4('0x18')]['code']===0x1f4){logger[_0x8bb4('0x18')](_0x8bb4('0x13'),_0x3359ad,_0x5de680[_0x8bb4('0x18')]['message']);return _0x42e72d(_0x5de680[_0x8bb4('0x18')][_0x8bb4('0x19')]);}logger[_0x8bb4('0x18')](_0x8bb4('0x13'),_0x3359ad,_0x5de680[_0x8bb4('0x18')][_0x8bb4('0x19')]);return _0x428586(_0x5de680[_0x8bb4('0x18')]['message']);}else{logger['info'](_0x8bb4('0x13'),_0x3359ad,_0x8bb4('0x14'));_0x428586(_0x5de680[_0x8bb4('0x1a')][_0x8bb4('0x19')]);}})[_0x8bb4('0x1b')](function(_0x24c3e1){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3359ad,_0x24c3e1);_0x42e72d(_0x24c3e1);});});}exports[_0x8bb4('0x1c')]=function(_0x32a911){var _0x1863ac=this;return new Promise(function(_0x48dba3,_0x13ef93){return db[_0x8bb4('0x1d')][_0x8bb4('0x1e')]({'raw':_0x32a911['options']?_0x32a911[_0x8bb4('0x1f')][_0x8bb4('0x20')]===undefined?!![]:![]:!![],'where':_0x32a911[_0x8bb4('0x1f')]?_0x32a911[_0x8bb4('0x1f')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x8bb4('0x21'),db['sequelize']['fn']('IF',db[_0x8bb4('0x22')]['literal'](_0x8bb4('0x23')))),_0x8bb4('0x24')]]})['then'](function(_0x3eee8c){logger['info'](_0x8bb4('0x1c'),_0x32a911);logger['debug'](_0x8bb4('0x1c'),_0x32a911,JSON[_0x8bb4('0x17')](_0x3eee8c));_0x48dba3(_0x3eee8c);})['catch'](function(_0x444ce4){logger['error'](_0x8bb4('0x1c'),_0x444ce4['message'],_0x32a911);_0x13ef93(_0x1863ac[_0x8bb4('0x18')](0x1f4,_0x444ce4[_0x8bb4('0x19')]));});});}; \ No newline at end of file +var _0xb47a=['code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x181af3,_0x3b28e2){var _0x35fe40=function(_0x2e3917){while(--_0x2e3917){_0x181af3['push'](_0x181af3['shift']());}};_0x35fe40(++_0x3b28e2);}(_0xb47a,0xd3));var _0xab47=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xb47a[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0xab47('0x0'));var util=require('util');var moment=require(_0xab47('0x1'));var BPromise=require(_0xab47('0x2'));var rs=require(_0xab47('0x3'));var fs=require('fs');var Redis=require(_0xab47('0x4'));var db=require(_0xab47('0x5'))['db'];var utils=require(_0xab47('0x6'));var logger=require(_0xab47('0x7'))(_0xab47('0x8'));var config=require(_0xab47('0x9'));var jayson=require(_0xab47('0xa'));var client=jayson['client'][_0xab47('0xb')]({'port':0x232a});config[_0xab47('0xc')]=_[_0xab47('0xd')](config[_0xab47('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xab47('0xe'))(new Redis(config[_0xab47('0xc')]));require(_0xab47('0xf'))['register'](socket);function respondWithRpcPromise(_0x35fbec,_0x37ac97,_0x442256){return new BPromise(function(_0x367833,_0x1c2ddf){return client[_0xab47('0x10')](_0x35fbec,_0x442256)[_0xab47('0x11')](function(_0x33838b){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x37ac97,_0xab47('0x12'));logger[_0xab47('0x13')](_0xab47('0x14'),_0x37ac97,_0xab47('0x12'),JSON[_0xab47('0x15')](_0x33838b));if(_0x33838b[_0xab47('0x16')]){if(_0x33838b[_0xab47('0x16')][_0xab47('0x17')]===0x1f4){logger[_0xab47('0x16')](_0xab47('0x18'),_0x37ac97,_0x33838b[_0xab47('0x16')]['message']);return _0x1c2ddf(_0x33838b[_0xab47('0x16')]['message']);}logger[_0xab47('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x37ac97,_0x33838b[_0xab47('0x16')][_0xab47('0x19')]);return _0x367833(_0x33838b[_0xab47('0x16')][_0xab47('0x19')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x37ac97,_0xab47('0x12'));_0x367833(_0x33838b[_0xab47('0x1a')][_0xab47('0x19')]);}})[_0xab47('0x1b')](function(_0x40ab60){logger[_0xab47('0x16')](_0xab47('0x18'),_0x37ac97,_0x40ab60);_0x1c2ddf(_0x40ab60);});});}exports[_0xab47('0x1c')]=function(_0x5a5213){var _0xa320fd=this;return new Promise(function(_0x5a9f16,_0x4f060a){return db['UserVoiceQueueRt'][_0xab47('0x1d')]({'raw':_0x5a5213['options']?_0x5a5213[_0xab47('0x1e')][_0xab47('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a5213[_0xab47('0x1e')]?_0x5a5213[_0xab47('0x1e')][_0xab47('0x20')]||null:null,'attributes':[[db[_0xab47('0x21')]['fn'](_0xab47('0x22'),db[_0xab47('0x21')]['fn']('IF',db[_0xab47('0x21')][_0xab47('0x23')](_0xab47('0x24')))),_0xab47('0x25')]]})['then'](function(_0x19ad32){logger[_0xab47('0x26')]('GetVoiceQueueRtPauses',_0x5a5213);logger[_0xab47('0x13')](_0xab47('0x1c'),_0x5a5213,JSON[_0xab47('0x15')](_0x19ad32));_0x5a9f16(_0x19ad32);})[_0xab47('0x1b')](function(_0x541928){logger[_0xab47('0x16')](_0xab47('0x1c'),_0x541928['message'],_0x5a5213);_0x4f060a(_0xa320fd[_0xab47('0x16')](0x1f4,_0x541928['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2477901..3338b7d 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 _0xbd51=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x5072ba,_0x4699a0){var _0x1c08a0=function(_0x775108){while(--_0x775108){_0x5072ba['push'](_0x5072ba['shift']());}};_0x1c08a0(++_0x4699a0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1d6fcd,_0x570a13){_0x1d6fcd=_0x1d6fcd-0x0;var _0x573497=_0xbd51[_0x1d6fcd];return _0x573497;};'use strict';var UserVoiceQueueRtEvents=require(_0x1bd5('0x0'));var events=['save',_0x1bd5('0x1'),_0x1bd5('0x2')];function createListener(_0x3b9f71,_0x1a9dcc){return function(_0x545aac){_0x1a9dcc['emit'](_0x3b9f71,_0x545aac);};}function removeListener(_0x58af16,_0x531028){return function(){UserVoiceQueueRtEvents[_0x1bd5('0x3')](_0x58af16,_0x531028);};}exports[_0x1bd5('0x4')]=function(_0x43e6b6){for(var _0x59ddfb=0x0,_0x29abea=events[_0x1bd5('0x5')];_0x59ddfb<_0x29abea;_0x59ddfb++){var _0x19077c=events[_0x59ddfb];var _0x27d58f=createListener(_0x1bd5('0x6')+_0x19077c,_0x43e6b6);UserVoiceQueueRtEvents['on'](_0x19077c,_0x27d58f);}}; \ No newline at end of file +var _0xf417=['update','length','userVoiceQueueRt:','save','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf417,0x8f));var _0x7f41=function(_0x16954c,_0x2f3051){_0x16954c=_0x16954c-0x0;var _0x93e220=_0xf417[_0x16954c];return _0x93e220;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7f41('0x0'),_0x7f41('0x1'),_0x7f41('0x2')];function createListener(_0x57aab7,_0x85053){return function(_0x5d5098){_0x85053['emit'](_0x57aab7,_0x5d5098);};}function removeListener(_0x2b7d4c,_0x5170ec){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2b7d4c,_0x5170ec);};}exports['register']=function(_0x5ecdb2){for(var _0x1775d8=0x0,_0x4e37b5=events[_0x7f41('0x3')];_0x1775d8<_0x4e37b5;_0x1775d8++){var _0x295136=events[_0x1775d8];var _0x507ac0=createListener(_0x7f41('0x4')+_0x295136,_0x5ecdb2);UserVoiceQueueRtEvents['on'](_0x295136,_0x507ac0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index c6f1ac4..5325965 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c3a9e,_0x49e92e){var _0x13b7a4=function(_0x570ff3){while(--_0x570ff3){_0x3c3a9e['push'](_0x3c3a9e['shift']());}};_0x13b7a4(++_0x49e92e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0xcb91[_0xa1e3ca];return _0x5005ab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4fdbdb,_0x508e46){var _0x2ad723=function(_0x2ccc9b){while(--_0x2ccc9b){_0x4fdbdb['push'](_0x4fdbdb['shift']());}};_0x2ad723(++_0x508e46);}(_0x70e0,0x17b));var _0x070e=function(_0x38daae,_0x8e3ec8){_0x38daae=_0x38daae-0x0;var _0x22e7c5=_0x70e0[_0x38daae];return _0x22e7c5;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 213f5bf..4c71a39 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 _0x9ebc=['exports','INTEGER'];(function(_0x40bd56,_0x2491d1){var _0x20947d=function(_0x26a39c){while(--_0x26a39c){_0x40bd56['push'](_0x40bd56['shift']());}};_0x20947d(++_0x2491d1);}(_0x9ebc,0x1a2));var _0xc9eb=function(_0x2efd1d,_0x44f696){_0x2efd1d=_0x2efd1d-0x0;var _0x1ef3f6=_0x9ebc[_0x2efd1d];return _0x1ef3f6;};'use strict';var Sequelize=require('sequelize');module[_0xc9eb('0x0')]={'penalty':{'type':Sequelize[_0xc9eb('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9a6=['INTEGER','exports'];(function(_0x1244cc,_0x20e74){var _0x260530=function(_0x31f6cf){while(--_0x31f6cf){_0x1244cc['push'](_0x1244cc['shift']());}};_0x260530(++_0x20e74);}(_0xb9a6,0x1d5));var _0x6b9a=function(_0x179465,_0x4dcc4c){_0x179465=_0x179465-0x0;var _0x1e2081=_0xb9a6[_0x179465];return _0x1e2081;};'use strict';var Sequelize=require('sequelize');module[_0x6b9a('0x0')]={'penalty':{'type':Sequelize[_0x6b9a('0x1')],'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 cfac1d6..36dffbc 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 _0x779f=['./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x40125a,_0x3f0832){var _0x823887=function(_0xd8b64c){while(--_0xd8b64c){_0x40125a['push'](_0x40125a['shift']());}};_0x823887(++_0x3f0832);}(_0x779f,0xea));var _0xf779=function(_0x4f2ce9,_0x520d2d){_0x4f2ce9=_0x4f2ce9-0x0;var _0x1a38b4=_0x779f[_0x4f2ce9];return _0x1a38b4;};'use strict';var _=require(_0xf779('0x0'));var util=require('util');var logger=require(_0xf779('0x1'))('api');var moment=require(_0xf779('0x2'));var BPromise=require(_0xf779('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf779('0x4'));var rimraf=require('rimraf');var config=require(_0xf779('0x5'));var attributes=require(_0xf779('0x6'));module[_0xf779('0x7')]=function(_0x28e6a0,_0x50d258){return _0x28e6a0[_0xf779('0x8')]('UserWhatsappQueue',attributes,{'tableName':_0xf779('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92ea=['../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x3b101f,_0x1975cb){var _0x42ca34=function(_0x4205b1){while(--_0x4205b1){_0x3b101f['push'](_0x3b101f['shift']());}};_0x42ca34(++_0x1975cb);}(_0x92ea,0x102));var _0xa92e=function(_0x8d5497,_0x31815c){_0x8d5497=_0x8d5497-0x0;var _0x45f13e=_0x92ea[_0x8d5497];return _0x45f13e;};'use strict';var _=require(_0xa92e('0x0'));var util=require(_0xa92e('0x1'));var logger=require(_0xa92e('0x2'))(_0xa92e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa92e('0x4'));var rimraf=require(_0xa92e('0x5'));var config=require(_0xa92e('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xa92e('0x7')]=function(_0x288f6c,_0xaccb8a){return _0x288f6c[_0xa92e('0x8')](_0xa92e('0x9'),attributes,{'tableName':_0xa92e('0xa'),'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 588f7e1..9ca3006 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 _0x102b=['then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0xbc59f4,_0x39bc4b){var _0x43ddb5=function(_0x2b538b){while(--_0x2b538b){_0xbc59f4['push'](_0xbc59f4['shift']());}};_0x43ddb5(++_0x39bc4b);}(_0x102b,0x122));var _0xb102=function(_0x3ffebc,_0x2f71c4){_0x3ffebc=_0x3ffebc-0x0;var _0x2e283a=_0x102b[_0x3ffebc];return _0x2e283a;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var moment=require(_0xb102('0x1'));var BPromise=require(_0xb102('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb102('0x3'));var db=require(_0xb102('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb102('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb102('0x6'));var client=jayson[_0xb102('0x7')][_0xb102('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c41af,_0x11ed14,_0xc97d3d){return new BPromise(function(_0x110dc6,_0x874fc1){return client[_0xb102('0x9')](_0x4c41af,_0xc97d3d)[_0xb102('0xa')](function(_0x42bf25){logger[_0xb102('0xb')](_0xb102('0xc'),_0x11ed14,_0xb102('0xd'));logger[_0xb102('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x11ed14,_0xb102('0xd'),JSON['stringify'](_0x42bf25));if(_0x42bf25[_0xb102('0xf')]){if(_0x42bf25[_0xb102('0xf')][_0xb102('0x10')]===0x1f4){logger[_0xb102('0xf')](_0xb102('0xc'),_0x11ed14,_0x42bf25['error']['message']);return _0x874fc1(_0x42bf25['error'][_0xb102('0x11')]);}logger[_0xb102('0xf')](_0xb102('0xc'),_0x11ed14,_0x42bf25[_0xb102('0xf')][_0xb102('0x11')]);return _0x110dc6(_0x42bf25[_0xb102('0xf')][_0xb102('0x11')]);}else{logger['info'](_0xb102('0xc'),_0x11ed14,_0xb102('0xd'));_0x110dc6(_0x42bf25[_0xb102('0x12')][_0xb102('0x11')]);}})[_0xb102('0x13')](function(_0x501aa9){logger[_0xb102('0xf')](_0xb102('0xc'),_0x11ed14,_0x501aa9);_0x874fc1(_0x501aa9);});});} \ No newline at end of file +var _0x3db5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x1deb4d,_0x489e8f){var _0x21a1eb=function(_0x2f60e7){while(--_0x2f60e7){_0x1deb4d['push'](_0x1deb4d['shift']());}};_0x21a1eb(++_0x489e8f);}(_0x3db5,0xfb));var _0x53db=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x3db5[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x53db('0x0'));var util=require(_0x53db('0x1'));var moment=require(_0x53db('0x2'));var BPromise=require(_0x53db('0x3'));var rs=require(_0x53db('0x4'));var fs=require('fs');var Redis=require(_0x53db('0x5'));var db=require(_0x53db('0x6'))['db'];var utils=require(_0x53db('0x7'));var logger=require(_0x53db('0x8'))(_0x53db('0x9'));var config=require('../../config/environment');var jayson=require(_0x53db('0xa'));var client=jayson['client'][_0x53db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51430a,_0x4bdf02,_0x2aeedd){return new BPromise(function(_0x3c945b,_0x29eb6b){return client[_0x53db('0xc')](_0x51430a,_0x2aeedd)[_0x53db('0xd')](function(_0x515bd6){logger[_0x53db('0xe')](_0x53db('0xf'),_0x4bdf02,_0x53db('0x10'));logger[_0x53db('0x11')](_0x53db('0x12'),_0x4bdf02,_0x53db('0x10'),JSON[_0x53db('0x13')](_0x515bd6));if(_0x515bd6[_0x53db('0x14')]){if(_0x515bd6[_0x53db('0x14')][_0x53db('0x15')]===0x1f4){logger[_0x53db('0x14')](_0x53db('0xf'),_0x4bdf02,_0x515bd6[_0x53db('0x14')][_0x53db('0x16')]);return _0x29eb6b(_0x515bd6[_0x53db('0x14')][_0x53db('0x16')]);}logger[_0x53db('0x14')](_0x53db('0xf'),_0x4bdf02,_0x515bd6[_0x53db('0x14')][_0x53db('0x16')]);return _0x3c945b(_0x515bd6['error']['message']);}else{logger[_0x53db('0xe')](_0x53db('0xf'),_0x4bdf02,'request\x20sent');_0x3c945b(_0x515bd6['result'][_0x53db('0x16')]);}})['catch'](function(_0x57935a){logger[_0x53db('0x14')](_0x53db('0xf'),_0x4bdf02,_0x57935a);_0x29eb6b(_0x57935a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 6823859..8e453b3 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 _0x4f5d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4f5d[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var path=require(_0xd4f5('0x2'));var timeout=require(_0xd4f5('0x3'));var express=require(_0xd4f5('0x4'));var router=express[_0xd4f5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd4f5('0x6'));var interaction=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var controller=require(_0xd4f5('0x9'));router[_0xd4f5('0xa')]('/',auth[_0xd4f5('0xb')](),controller[_0xd4f5('0xc')]);router[_0xd4f5('0xa')](_0xd4f5('0xd'),auth[_0xd4f5('0xb')](),controller[_0xd4f5('0xe')]);router[_0xd4f5('0xf')]('/',auth[_0xd4f5('0xb')](),controller['create']);router[_0xd4f5('0x10')](_0xd4f5('0xd'),auth['isAuthenticated'](),controller[_0xd4f5('0x11')]);router[_0xd4f5('0x12')](_0xd4f5('0xd'),auth[_0xd4f5('0xb')](),controller[_0xd4f5('0x13')]);module[_0xd4f5('0x14')]=router; \ No newline at end of file +var _0x1e69=['/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x1e69,0x85));var _0x91e6=function(_0x1411e8,_0x249a68){_0x1411e8=_0x1411e8-0x0;var _0x5b844e=_0x1e69[_0x1411e8];return _0x5b844e;};'use strict';var multer=require('multer');var util=require(_0x91e6('0x0'));var path=require(_0x91e6('0x1'));var timeout=require(_0x91e6('0x2'));var express=require(_0x91e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x91e6('0x4'));var interaction=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var controller=require(_0x91e6('0x7'));router[_0x91e6('0x8')]('/',auth[_0x91e6('0x9')](),controller[_0x91e6('0xa')]);router[_0x91e6('0x8')](_0x91e6('0xb'),auth[_0x91e6('0x9')](),controller[_0x91e6('0xc')]);router[_0x91e6('0xd')]('/',auth[_0x91e6('0x9')](),controller['create']);router['put'](_0x91e6('0xb'),auth[_0x91e6('0x9')](),controller[_0x91e6('0xe')]);router[_0x91e6('0xf')]('/:id',auth[_0x91e6('0x9')](),controller[_0x91e6('0x10')]);module[_0x91e6('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 4271965..288f8d3 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 _0xf6c2=['exports','name','sequelize'];(function(_0x38cb55,_0x4899b4){var _0x5f1dea=function(_0x439d7e){while(--_0x439d7e){_0x38cb55['push'](_0x38cb55['shift']());}};_0x5f1dea(++_0x4899b4);}(_0xf6c2,0x1e8));var _0x2f6c=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xf6c2[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x2f6c('0x0'));module[_0x2f6c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f6c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa149=['name','sequelize','exports','STRING'];(function(_0x2724b7,_0x4aef8e){var _0x95a383=function(_0x4823fb){while(--_0x4823fb){_0x2724b7['push'](_0x2724b7['shift']());}};_0x95a383(++_0x4aef8e);}(_0xa149,0xb5));var _0x9a14=function(_0x412208,_0x4f90c1){_0x412208=_0x412208-0x0;var _0x479642=_0xa149[_0x412208];return _0x479642;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'name':{'type':Sequelize[_0x9a14('0x2')],'unique':_0x9a14('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9a14('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c3be482..31e9615 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 _0xf075=['include','findAll','rows','catch','show','find','create','body','role','UserProfileSection','autoAssociation','params','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll'];(function(_0x874cb7,_0x2c9fd9){var _0x2d27ab=function(_0x3e5a8c){while(--_0x3e5a8c){_0x874cb7['push'](_0x874cb7['shift']());}};_0x2d27ab(++_0x2c9fd9);}(_0xf075,0xf9));var _0x5f07=function(_0x57aa88,_0xcc7362){_0x57aa88=_0x57aa88-0x0;var _0x2103a1=_0xf075[_0x57aa88];return _0x2103a1;};'use strict';var emlformat=require(_0x5f07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f07('0x1'));var jsonpatch=require(_0x5f07('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f07('0x3'));var Mustache=require('mustache');var util=require(_0x5f07('0x4'));var path=require(_0x5f07('0x5'));var sox=require(_0x5f07('0x6'));var csv=require(_0x5f07('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f07('0x8'));var _=require(_0x5f07('0x9'));var squel=require(_0x5f07('0xa'));var crypto=require(_0x5f07('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5f07('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5f07('0xd'));var Redis=require(_0x5f07('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5f07('0xf'));var as=require(_0x5f07('0x10'));var hardwareService=require(_0x5f07('0x11'));var logger=require(_0x5f07('0x12'))(_0x5f07('0x13'));var utils=require('../../config/utils');var config=require(_0x5f07('0x14'));var licenseUtil=require(_0x5f07('0x15'));var db=require(_0x5f07('0x16'))['db'];function respondWithStatusCode(_0x17b05d,_0x377131){_0x377131=_0x377131||0xcc;return function(_0x18b706){if(_0x18b706){return _0x17b05d[_0x5f07('0x17')](_0x377131);}return _0x17b05d[_0x5f07('0x18')](_0x377131)[_0x5f07('0x19')]();};}function respondWithResult(_0x280f34,_0x235dd4){_0x235dd4=_0x235dd4||0xc8;return function(_0x24c7a6){if(_0x24c7a6){return _0x280f34['status'](_0x235dd4)[_0x5f07('0x1a')](_0x24c7a6);}};}function respondWithFilteredResult(_0x49d744,_0x8471f1){return function(_0x308981){if(_0x308981){var _0xba7536=typeof _0x8471f1[_0x5f07('0x1b')]===_0x5f07('0x1c')&&typeof _0x8471f1['limit']===_0x5f07('0x1c');var _0x802bed=_0x308981[_0x5f07('0x1d')];var _0x7f8948=_0xba7536?0x0:_0x8471f1[_0x5f07('0x1b')];var _0x141aab=_0xba7536?_0x308981[_0x5f07('0x1d')]:_0x8471f1[_0x5f07('0x1b')]+_0x8471f1[_0x5f07('0x1e')];var _0x5ed6fb;if(_0x141aab>=_0x802bed){_0x141aab=_0x802bed;_0x5ed6fb=0xc8;}else{_0x5ed6fb=0xce;}_0x49d744[_0x5f07('0x18')](_0x5ed6fb);return _0x49d744[_0x5f07('0x1f')](_0x5f07('0x20'),_0x7f8948+'-'+_0x141aab+'/'+_0x802bed)[_0x5f07('0x1a')](_0x308981);}return null;};}function patchUpdates(_0x48f16e){return function(_0x4982c6){try{jsonpatch[_0x5f07('0x21')](_0x4982c6,_0x48f16e,!![]);}catch(_0x8e75cc){return BPromise['reject'](_0x8e75cc);}return _0x4982c6[_0x5f07('0x22')]();};}function saveUpdates(_0x21696b,_0x25dded){return function(_0x73d37a){if(_0x73d37a){return _0x73d37a[_0x5f07('0x23')](_0x21696b)['then'](function(_0x4651f1){return _0x4651f1;});}return null;};}function removeEntity(_0x340f03,_0x3c1e75){return function(_0x4fbe6a){if(_0x4fbe6a){return _0x4fbe6a['destroy']()[_0x5f07('0x24')](function(){var _0x2019c3=_0x4fbe6a[_0x5f07('0x25')]({'plain':!![]});var _0x1f6c0f=_0x5f07('0x26');return db[_0x5f07('0x27')][_0x5f07('0x28')]({'where':{'type':_0x1f6c0f,'resourceId':_0x2019c3['id']}})[_0x5f07('0x24')](function(){return _0x4fbe6a;});})[_0x5f07('0x24')](function(){_0x340f03[_0x5f07('0x18')](0xcc)[_0x5f07('0x19')]();});}};}function handleEntityNotFound(_0x803bf0,_0xd4f384){return function(_0x5d8e0f){if(!_0x5d8e0f){_0x803bf0[_0x5f07('0x17')](0x194);}return _0x5d8e0f;};}function handleError(_0x431a4a,_0x21ed9a){_0x21ed9a=_0x21ed9a||0x1f4;return function(_0x16d3a2){logger[_0x5f07('0x29')](_0x16d3a2[_0x5f07('0x2a')]);if(_0x16d3a2[_0x5f07('0x2b')]){delete _0x16d3a2['name'];}_0x431a4a[_0x5f07('0x18')](_0x21ed9a)['send'](_0x16d3a2);};}exports['index']=function(_0x56b60,_0x28969b){var _0x40068b={},_0x281967={},_0x4613c7={'count':0x0,'rows':[]};var _0x190837=_[_0x5f07('0x2c')](db[_0x5f07('0x2d')][_0x5f07('0x2e')],function(_0x23c187){return{'name':_0x23c187[_0x5f07('0x2f')],'type':_0x23c187[_0x5f07('0x30')]['key']};});_0x281967[_0x5f07('0x31')]=_[_0x5f07('0x2c')](_0x190837,'name');_0x281967[_0x5f07('0x32')]=_[_0x5f07('0x33')](_0x56b60[_0x5f07('0x32')]);_0x281967[_0x5f07('0x34')]=_[_0x5f07('0x35')](_0x281967[_0x5f07('0x31')],_0x281967[_0x5f07('0x32')]);_0x40068b['attributes']=_[_0x5f07('0x35')](_0x281967['model'],qs[_0x5f07('0x36')](_0x56b60[_0x5f07('0x32')][_0x5f07('0x36')]));_0x40068b[_0x5f07('0x37')]=_0x40068b['attributes'][_0x5f07('0x38')]?_0x40068b['attributes']:_0x281967[_0x5f07('0x31')];if(!_0x56b60[_0x5f07('0x32')][_0x5f07('0x39')](_0x5f07('0x3a'))){_0x40068b[_0x5f07('0x1e')]=qs['limit'](_0x56b60[_0x5f07('0x32')][_0x5f07('0x1e')]);_0x40068b[_0x5f07('0x1b')]=qs[_0x5f07('0x1b')](_0x56b60['query'][_0x5f07('0x1b')]);}_0x40068b[_0x5f07('0x3b')]=qs['sort'](_0x56b60[_0x5f07('0x32')][_0x5f07('0x3c')]);_0x40068b[_0x5f07('0x3d')]=qs['filters'](_['pick'](_0x56b60['query'],_0x281967[_0x5f07('0x34')]),_0x190837);if(_0x56b60[_0x5f07('0x32')]['filter']){_0x40068b[_0x5f07('0x3d')]=_['merge'](_0x40068b[_0x5f07('0x3d')],{'$or':_[_0x5f07('0x2c')](_0x190837,function(_0x5ed77c){if(_0x5ed77c['type']!==_0x5f07('0x3e')){var _0x3eae51={};_0x3eae51[_0x5ed77c[_0x5f07('0x2b')]]={'$like':'%'+_0x56b60[_0x5f07('0x32')][_0x5f07('0x3f')]+'%'};return _0x3eae51;}})});}_0x40068b=_[_0x5f07('0x40')]({},_0x40068b,_0x56b60[_0x5f07('0x41')]);var _0x444994={'where':_0x40068b[_0x5f07('0x3d')]};return db[_0x5f07('0x2d')][_0x5f07('0x1d')](_0x444994)[_0x5f07('0x24')](function(_0xb7680f){_0x4613c7[_0x5f07('0x1d')]=_0xb7680f;if(_0x56b60[_0x5f07('0x32')][_0x5f07('0x42')]){_0x40068b[_0x5f07('0x43')]=[{'all':!![]}];}return db[_0x5f07('0x2d')][_0x5f07('0x44')](_0x40068b);})[_0x5f07('0x24')](function(_0x3049fa){_0x4613c7[_0x5f07('0x45')]=_0x3049fa;return _0x4613c7;})[_0x5f07('0x24')](respondWithFilteredResult(_0x28969b,_0x40068b))[_0x5f07('0x46')](handleError(_0x28969b,null));};exports[_0x5f07('0x47')]=function(_0x51639a,_0x457aa3){var _0x578efa={'raw':!![],'where':{'id':_0x51639a['params']['id']}},_0x45e23f={};_0x45e23f['model']=_[_0x5f07('0x33')](db[_0x5f07('0x2d')][_0x5f07('0x2e')]);_0x45e23f['query']=_[_0x5f07('0x33')](_0x51639a[_0x5f07('0x32')]);_0x45e23f['filters']=_['intersection'](_0x45e23f[_0x5f07('0x31')],_0x45e23f[_0x5f07('0x32')]);_0x578efa['attributes']=_[_0x5f07('0x35')](_0x45e23f[_0x5f07('0x31')],qs['fields'](_0x51639a[_0x5f07('0x32')][_0x5f07('0x36')]));_0x578efa[_0x5f07('0x37')]=_0x578efa[_0x5f07('0x37')][_0x5f07('0x38')]?_0x578efa[_0x5f07('0x37')]:_0x45e23f[_0x5f07('0x31')];if(_0x51639a[_0x5f07('0x32')][_0x5f07('0x42')]){_0x578efa[_0x5f07('0x43')]=[{'all':!![]}];}_0x578efa=_['merge']({},_0x578efa,_0x51639a[_0x5f07('0x41')]);return db[_0x5f07('0x2d')][_0x5f07('0x48')](_0x578efa)['then'](handleEntityNotFound(_0x457aa3,null))['then'](respondWithResult(_0x457aa3,null))['catch'](handleError(_0x457aa3,null));};exports[_0x5f07('0x49')]=function(_0x33d17a,_0x2bfb72){return db['Variable'][_0x5f07('0x49')](_0x33d17a[_0x5f07('0x4a')],{})['then'](function(_0x5bbc2e){var _0x356928=_0x33d17a['user'][_0x5f07('0x25')]({'plain':!![]});if(!_0x356928)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x356928[_0x5f07('0x4b')]==='user'){var _0x288f4d=_0x5bbc2e['get']({'plain':!![]});var _0x3344a1=_0x5f07('0x26');return db[_0x5f07('0x4c')][_0x5f07('0x48')]({'where':{'name':_0x3344a1,'userProfileId':_0x356928['userProfileId']},'raw':!![]})[_0x5f07('0x24')](function(_0xded5f4){if(_0xded5f4&&_0xded5f4[_0x5f07('0x4d')]===0x0){return db['UserProfileResource'][_0x5f07('0x49')]({'name':_0x288f4d[_0x5f07('0x2b')],'resourceId':_0x288f4d['id'],'type':_0xded5f4[_0x5f07('0x2b')],'sectionId':_0xded5f4['id']},{})[_0x5f07('0x24')](function(){return _0x5bbc2e;});}else{return _0x5bbc2e;}})[_0x5f07('0x46')](function(_0x3ca9f5){logger[_0x5f07('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ca9f5);throw _0x3ca9f5;});}return _0x5bbc2e;})[_0x5f07('0x24')](respondWithResult(_0x2bfb72,0xc9))['catch'](handleError(_0x2bfb72,null));};exports[_0x5f07('0x23')]=function(_0x376aaa,_0x404f06){if(_0x376aaa[_0x5f07('0x4a')]['id']){delete _0x376aaa[_0x5f07('0x4a')]['id'];}return db[_0x5f07('0x2d')][_0x5f07('0x48')]({'where':{'id':_0x376aaa[_0x5f07('0x4e')]['id']}})['then'](handleEntityNotFound(_0x404f06,null))['then'](saveUpdates(_0x376aaa[_0x5f07('0x4a')],null))[_0x5f07('0x24')](respondWithResult(_0x404f06,null))['catch'](handleError(_0x404f06,null));};exports[_0x5f07('0x28')]=function(_0x2c6623,_0x59509b){return db[_0x5f07('0x2d')][_0x5f07('0x48')]({'where':{'id':_0x2c6623[_0x5f07('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59509b,null))['then'](removeEntity(_0x59509b,null))[_0x5f07('0x46')](handleError(_0x59509b,null));}; \ No newline at end of file +var _0x256e=['where','filter','type','VIRTUAL','options','includeAll','include','findAll','params','merge','find','catch','create','body','user','UserProfileSection','userProfileId','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','Variables','error','stack','name','send','index','map','Variable','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x256e,0x15a));var _0xe256=function(_0x31a768,_0x49f459){_0x31a768=_0x31a768-0x0;var _0x3cc7aa=_0x256e[_0x31a768];return _0x3cc7aa;};'use strict';var emlformat=require(_0xe256('0x0'));var rimraf=require(_0xe256('0x1'));var zipdir=require(_0xe256('0x2'));var jsonpatch=require(_0xe256('0x3'));var rp=require(_0xe256('0x4'));var moment=require(_0xe256('0x5'));var BPromise=require(_0xe256('0x6'));var Mustache=require(_0xe256('0x7'));var util=require('util');var path=require(_0xe256('0x8'));var sox=require(_0xe256('0x9'));var csv=require('to-csv');var ejs=require(_0xe256('0xa'));var fs=require('fs');var fs_extra=require(_0xe256('0xb'));var _=require(_0xe256('0xc'));var squel=require(_0xe256('0xd'));var crypto=require(_0xe256('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe256('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe256('0x10'));var Papa=require(_0xe256('0x11'));var Redis=require(_0xe256('0x12'));var authService=require(_0xe256('0x13'));var qs=require(_0xe256('0x14'));var as=require(_0xe256('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe256('0x16'))(_0xe256('0x17'));var utils=require('../../config/utils');var config=require(_0xe256('0x18'));var licenseUtil=require(_0xe256('0x19'));var db=require(_0xe256('0x1a'))['db'];function respondWithStatusCode(_0x3f1122,_0x4c4c74){_0x4c4c74=_0x4c4c74||0xcc;return function(_0x4c889b){if(_0x4c889b){return _0x3f1122['sendStatus'](_0x4c4c74);}return _0x3f1122[_0xe256('0x1b')](_0x4c4c74)[_0xe256('0x1c')]();};}function respondWithResult(_0xb6ed9b,_0x298341){_0x298341=_0x298341||0xc8;return function(_0x2c453d){if(_0x2c453d){return _0xb6ed9b[_0xe256('0x1b')](_0x298341)['json'](_0x2c453d);}};}function respondWithFilteredResult(_0x16f4e5,_0x5a5f86){return function(_0x339a96){if(_0x339a96){var _0x514f8e=typeof _0x5a5f86[_0xe256('0x1d')]===_0xe256('0x1e')&&typeof _0x5a5f86['limit']===_0xe256('0x1e');var _0x65e84=_0x339a96[_0xe256('0x1f')];var _0x451e9=_0x514f8e?0x0:_0x5a5f86[_0xe256('0x1d')];var _0x5da4a0=_0x514f8e?_0x339a96[_0xe256('0x1f')]:_0x5a5f86[_0xe256('0x1d')]+_0x5a5f86[_0xe256('0x20')];var _0x37f897;if(_0x5da4a0>=_0x65e84){_0x5da4a0=_0x65e84;_0x37f897=0xc8;}else{_0x37f897=0xce;}_0x16f4e5[_0xe256('0x1b')](_0x37f897);return _0x16f4e5[_0xe256('0x21')](_0xe256('0x22'),_0x451e9+'-'+_0x5da4a0+'/'+_0x65e84)[_0xe256('0x23')](_0x339a96);}return null;};}function patchUpdates(_0x166d71){return function(_0x4358dc){try{jsonpatch[_0xe256('0x24')](_0x4358dc,_0x166d71,!![]);}catch(_0x12797f){return BPromise['reject'](_0x12797f);}return _0x4358dc[_0xe256('0x25')]();};}function saveUpdates(_0x5cea0f,_0x58e2d4){return function(_0x25d44d){if(_0x25d44d){return _0x25d44d[_0xe256('0x26')](_0x5cea0f)['then'](function(_0x2c113a){return _0x2c113a;});}return null;};}function removeEntity(_0x57b3ec,_0x37c03f){return function(_0x321094){if(_0x321094){return _0x321094[_0xe256('0x27')]()[_0xe256('0x28')](function(){var _0x245a4f=_0x321094[_0xe256('0x29')]({'plain':!![]});var _0x31a743=_0xe256('0x2a');return db['UserProfileResource'][_0xe256('0x27')]({'where':{'type':_0x31a743,'resourceId':_0x245a4f['id']}})['then'](function(){return _0x321094;});})['then'](function(){_0x57b3ec[_0xe256('0x1b')](0xcc)[_0xe256('0x1c')]();});}};}function handleEntityNotFound(_0x423ca4,_0x44ec56){return function(_0x37b56b){if(!_0x37b56b){_0x423ca4['sendStatus'](0x194);}return _0x37b56b;};}function handleError(_0x37e7a6,_0x1f0cdf){_0x1f0cdf=_0x1f0cdf||0x1f4;return function(_0x41cf2e){logger[_0xe256('0x2b')](_0x41cf2e[_0xe256('0x2c')]);if(_0x41cf2e[_0xe256('0x2d')]){delete _0x41cf2e[_0xe256('0x2d')];}_0x37e7a6[_0xe256('0x1b')](_0x1f0cdf)[_0xe256('0x2e')](_0x41cf2e);};}exports[_0xe256('0x2f')]=function(_0x2bb449,_0x1cad9b){var _0x484743={},_0x52fa1b={},_0x495047={'count':0x0,'rows':[]};var _0x58f999=_[_0xe256('0x30')](db[_0xe256('0x31')][_0xe256('0x32')],function(_0xe39b5f){return{'name':_0xe39b5f['fieldName'],'type':_0xe39b5f['type'][_0xe256('0x33')]};});_0x52fa1b[_0xe256('0x34')]=_[_0xe256('0x30')](_0x58f999,'name');_0x52fa1b['query']=_[_0xe256('0x35')](_0x2bb449[_0xe256('0x36')]);_0x52fa1b[_0xe256('0x37')]=_[_0xe256('0x38')](_0x52fa1b[_0xe256('0x34')],_0x52fa1b[_0xe256('0x36')]);_0x484743['attributes']=_['intersection'](_0x52fa1b[_0xe256('0x34')],qs[_0xe256('0x39')](_0x2bb449[_0xe256('0x36')][_0xe256('0x39')]));_0x484743['attributes']=_0x484743[_0xe256('0x3a')][_0xe256('0x3b')]?_0x484743[_0xe256('0x3a')]:_0x52fa1b[_0xe256('0x34')];if(!_0x2bb449[_0xe256('0x36')][_0xe256('0x3c')](_0xe256('0x3d'))){_0x484743[_0xe256('0x20')]=qs[_0xe256('0x20')](_0x2bb449['query'][_0xe256('0x20')]);_0x484743[_0xe256('0x1d')]=qs[_0xe256('0x1d')](_0x2bb449[_0xe256('0x36')]['offset']);}_0x484743[_0xe256('0x3e')]=qs[_0xe256('0x3f')](_0x2bb449[_0xe256('0x36')][_0xe256('0x3f')]);_0x484743[_0xe256('0x40')]=qs[_0xe256('0x37')](_['pick'](_0x2bb449[_0xe256('0x36')],_0x52fa1b['filters']),_0x58f999);if(_0x2bb449['query'][_0xe256('0x41')]){_0x484743[_0xe256('0x40')]=_['merge'](_0x484743['where'],{'$or':_['map'](_0x58f999,function(_0x166cad){if(_0x166cad[_0xe256('0x42')]!==_0xe256('0x43')){var _0x305c3e={};_0x305c3e[_0x166cad[_0xe256('0x2d')]]={'$like':'%'+_0x2bb449['query'][_0xe256('0x41')]+'%'};return _0x305c3e;}})});}_0x484743=_['merge']({},_0x484743,_0x2bb449[_0xe256('0x44')]);var _0x42670f={'where':_0x484743['where']};return db['Variable']['count'](_0x42670f)[_0xe256('0x28')](function(_0x1211ad){_0x495047[_0xe256('0x1f')]=_0x1211ad;if(_0x2bb449[_0xe256('0x36')][_0xe256('0x45')]){_0x484743[_0xe256('0x46')]=[{'all':!![]}];}return db[_0xe256('0x31')][_0xe256('0x47')](_0x484743);})[_0xe256('0x28')](function(_0x22e717){_0x495047['rows']=_0x22e717;return _0x495047;})[_0xe256('0x28')](respondWithFilteredResult(_0x1cad9b,_0x484743))['catch'](handleError(_0x1cad9b,null));};exports['show']=function(_0x148d1d,_0xf38213){var _0x17705b={'raw':!![],'where':{'id':_0x148d1d[_0xe256('0x48')]['id']}},_0x4ca8fa={};_0x4ca8fa[_0xe256('0x34')]=_['keys'](db[_0xe256('0x31')][_0xe256('0x32')]);_0x4ca8fa[_0xe256('0x36')]=_[_0xe256('0x35')](_0x148d1d[_0xe256('0x36')]);_0x4ca8fa[_0xe256('0x37')]=_['intersection'](_0x4ca8fa[_0xe256('0x34')],_0x4ca8fa[_0xe256('0x36')]);_0x17705b[_0xe256('0x3a')]=_[_0xe256('0x38')](_0x4ca8fa[_0xe256('0x34')],qs[_0xe256('0x39')](_0x148d1d[_0xe256('0x36')][_0xe256('0x39')]));_0x17705b[_0xe256('0x3a')]=_0x17705b['attributes']['length']?_0x17705b[_0xe256('0x3a')]:_0x4ca8fa['model'];if(_0x148d1d[_0xe256('0x36')][_0xe256('0x45')]){_0x17705b[_0xe256('0x46')]=[{'all':!![]}];}_0x17705b=_[_0xe256('0x49')]({},_0x17705b,_0x148d1d[_0xe256('0x44')]);return db[_0xe256('0x31')][_0xe256('0x4a')](_0x17705b)[_0xe256('0x28')](handleEntityNotFound(_0xf38213,null))[_0xe256('0x28')](respondWithResult(_0xf38213,null))[_0xe256('0x4b')](handleError(_0xf38213,null));};exports[_0xe256('0x4c')]=function(_0x2b0679,_0x451eb5){return db[_0xe256('0x31')][_0xe256('0x4c')](_0x2b0679[_0xe256('0x4d')],{})[_0xe256('0x28')](function(_0x359226){var _0x5ca8ee=_0x2b0679[_0xe256('0x4e')][_0xe256('0x29')]({'plain':!![]});if(!_0x5ca8ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ca8ee['role']==='user'){var _0x3d7174=_0x359226[_0xe256('0x29')]({'plain':!![]});var _0x3e4269=_0xe256('0x2a');return db[_0xe256('0x4f')][_0xe256('0x4a')]({'where':{'name':_0x3e4269,'userProfileId':_0x5ca8ee[_0xe256('0x50')]},'raw':!![]})[_0xe256('0x28')](function(_0xccbf2){if(_0xccbf2&&_0xccbf2['autoAssociation']===0x0){return db[_0xe256('0x51')]['create']({'name':_0x3d7174['name'],'resourceId':_0x3d7174['id'],'type':_0xccbf2[_0xe256('0x2d')],'sectionId':_0xccbf2['id']},{})[_0xe256('0x28')](function(){return _0x359226;});}else{return _0x359226;}})['catch'](function(_0x1b76e3){logger[_0xe256('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b76e3);throw _0x1b76e3;});}return _0x359226;})[_0xe256('0x28')](respondWithResult(_0x451eb5,0xc9))[_0xe256('0x4b')](handleError(_0x451eb5,null));};exports[_0xe256('0x26')]=function(_0x54f22b,_0x4d3b1b){if(_0x54f22b[_0xe256('0x4d')]['id']){delete _0x54f22b[_0xe256('0x4d')]['id'];}return db[_0xe256('0x31')][_0xe256('0x4a')]({'where':{'id':_0x54f22b['params']['id']}})[_0xe256('0x28')](handleEntityNotFound(_0x4d3b1b,null))[_0xe256('0x28')](saveUpdates(_0x54f22b['body'],null))['then'](respondWithResult(_0x4d3b1b,null))[_0xe256('0x4b')](handleError(_0x4d3b1b,null));};exports[_0xe256('0x27')]=function(_0x3b18fa,_0x5f0641){return db[_0xe256('0x31')][_0xe256('0x4a')]({'where':{'id':_0x3b18fa[_0xe256('0x48')]['id']}})[_0xe256('0x28')](handleEntityNotFound(_0x5f0641,null))[_0xe256('0x28')](removeEntity(_0x5f0641,null))[_0xe256('0x4b')](handleError(_0x5f0641,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 318cfbd..77e63c6 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 _0xf47a=['moment','request-promise','path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x41edb1,_0x5afeec){var _0x204e7e=function(_0x395e4c){while(--_0x395e4c){_0x41edb1['push'](_0x41edb1['shift']());}};_0x204e7e(++_0x5afeec);}(_0xf47a,0x11a));var _0xaf47=function(_0x1823e9,_0x6a7a00){_0x1823e9=_0x1823e9-0x0;var _0x5e80f0=_0xf47a[_0x1823e9];return _0x5e80f0;};'use strict';var _=require(_0xaf47('0x0'));var util=require(_0xaf47('0x1'));var logger=require(_0xaf47('0x2'))(_0xaf47('0x3'));var moment=require(_0xaf47('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf47('0x5'));var fs=require('fs');var path=require(_0xaf47('0x6'));var rimraf=require(_0xaf47('0x7'));var config=require('../../config/environment');var attributes=require(_0xaf47('0x8'));module[_0xaf47('0x9')]=function(_0x55908f,_0x4c30e9){return _0x55908f[_0xaf47('0xa')](_0xaf47('0xb'),attributes,{'tableName':_0xaf47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba3d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','Variable','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba3d,0x69));var _0xdba3=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xba3d[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xdba3('0x0'));var util=require(_0xdba3('0x1'));var logger=require(_0xdba3('0x2'))('api');var moment=require(_0xdba3('0x3'));var BPromise=require(_0xdba3('0x4'));var rp=require(_0xdba3('0x5'));var fs=require('fs');var path=require(_0xdba3('0x6'));var rimraf=require(_0xdba3('0x7'));var config=require(_0xdba3('0x8'));var attributes=require(_0xdba3('0x9'));module[_0xdba3('0xa')]=function(_0x115ee2,_0x56effe){return _0x115ee2['define'](_0xdba3('0xb'),attributes,{'tableName':'tools_variables','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 35a8f9a..3d6025e 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x5022d0,_0x3fc391){var _0x21c3df=function(_0x19361a){while(--_0x19361a){_0x5022d0['push'](_0x5022d0['shift']());}};_0x21c3df(++_0x3fc391);}(_0xf494,0x1c6));var _0x4f49=function(_0x5c79a0,_0x230c46){_0x5c79a0=_0x5c79a0-0x0;var _0x57fe04=_0xf494[_0x5c79a0];return _0x57fe04;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ 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(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x8ef6,0xf2));var _0x68ef=function(_0x30b9d4,_0x44207c){_0x30b9d4=_0x30b9d4-0x0;var _0x374f7f=_0x8ef6[_0x30b9d4];return _0x374f7f;};'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 26ca37f..c1b5cbf 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 _0x3078=['/reset','canUpdate','reset','pull','/restart','restart','migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','fetch'];(function(_0x5c1cb9,_0xe4a130){var _0x57f3c7=function(_0x26cfa4){while(--_0x26cfa4){_0x5c1cb9['push'](_0x5c1cb9['shift']());}};_0x57f3c7(++_0xe4a130);}(_0x3078,0x7f));var _0x8307=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0x3078[_0x244f5d];return _0x1a3886;};'use strict';var express=require(_0x8307('0x0'));var router=express[_0x8307('0x1')]();var auth=require(_0x8307('0x2'));var controller=require(_0x8307('0x3'));router[_0x8307('0x4')]('/',controller['index']);router[_0x8307('0x4')](_0x8307('0x5'),auth[_0x8307('0x6')](),auth['canUpdate'](),controller[_0x8307('0x7')]);router['get'](_0x8307('0x8'),auth[_0x8307('0x6')](),auth[_0x8307('0x9')](),controller[_0x8307('0xa')]);router[_0x8307('0x4')]('/pull',auth[_0x8307('0x6')](),auth[_0x8307('0x9')](),controller[_0x8307('0xb')]);router['get'](_0x8307('0xc'),auth[_0x8307('0x6')](),controller[_0x8307('0xd')]);router[_0x8307('0x4')]('/migrations',controller[_0x8307('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe078=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','exports','express','../../components/auth/service','./version.controller'];(function(_0x3059cc,_0x32bc22){var _0x163360=function(_0x472898){while(--_0x472898){_0x3059cc['push'](_0x3059cc['shift']());}};_0x163360(++_0x32bc22);}(_0xe078,0xb8));var _0x8e07=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xe078[_0xdea41a];return _0x15d0d8;};'use strict';var express=require(_0x8e07('0x0'));var router=express['Router']();var auth=require(_0x8e07('0x1'));var controller=require(_0x8e07('0x2'));router[_0x8e07('0x3')]('/',controller[_0x8e07('0x4')]);router['get'](_0x8e07('0x5'),auth[_0x8e07('0x6')](),auth[_0x8e07('0x7')](),controller[_0x8e07('0x8')]);router['get'](_0x8e07('0x9'),auth[_0x8e07('0x6')](),auth[_0x8e07('0x7')](),controller[_0x8e07('0xa')]);router[_0x8e07('0x3')](_0x8e07('0xb'),auth[_0x8e07('0x6')](),auth['canUpdate'](),controller[_0x8e07('0xc')]);router['get'](_0x8e07('0xd'),auth[_0x8e07('0x6')](),controller[_0x8e07('0xe')]);router[_0x8e07('0x3')](_0x8e07('0xf'),controller['migrations']);module[_0x8e07('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4d17907..1cf149e 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 _0xa87a=['git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD'];(function(_0x57cc49,_0x44ab4b){var _0x5dc398=function(_0x22c9ea){while(--_0x22c9ea){_0x57cc49['push'](_0x57cc49['shift']());}};_0x5dc398(++_0x44ab4b);}(_0xa87a,0xc1));var _0xaa87=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa87a[_0x376b45];return _0x2341b3;};'use strict';var Umzug=require(_0xaa87('0x0'));var path=require(_0xaa87('0x1'));var fs=require('fs');var _=require(_0xaa87('0x2'));var pkginfo=require(_0xaa87('0x3'))(module,_0xaa87('0x4'));var compareVersions=require(_0xaa87('0x5'));var exec=require(_0xaa87('0x6'))[_0xaa87('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0xaa87('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xaa87('0x9'))(_0xaa87('0xa'));var git=require(_0xaa87('0xb'))(config[_0xaa87('0xc')]);exports[_0xaa87('0xd')]=function(_0x5780b4,_0x3d92bf){var _0x1ab59d={'current':module[_0xaa87('0xe')]['version'],'phonebar':0x2};if(_0x5780b4['query']&&_0x5780b4[_0xaa87('0xf')][_0xaa87('0x10')]){return git[_0xaa87('0x11')]()[_0xaa87('0x12')](function(_0x24b1c9,_0x34aded){_0x1ab59d[_0xaa87('0x10')]=(_0x24b1c9?module[_0xaa87('0xe')]['version']:_0x34aded[_0xaa87('0x10')])||_0xaa87('0x13');return _0x3d92bf[_0xaa87('0x14')](0xc8)[_0xaa87('0x15')](_0x1ab59d);});}else{return _0x3d92bf[_0xaa87('0x14')](0xc8)[_0xaa87('0x15')](_0x1ab59d);}};exports[_0xaa87('0x11')]=function(_0x377ded,_0x39a05e){return git['fetch']([_0xaa87('0x16'),_0xaa87('0x17')],function(_0x1882f0){if(_0x1882f0){logger['error'](_0x1882f0);return _0x39a05e['status'](0x1f4)[_0xaa87('0x15')](_0x1882f0);}logger[_0xaa87('0x18')]('git\x20fetch');return _0x39a05e['status'](0xc8)[_0xaa87('0x15')]({'output':_0xaa87('0x19')});});};exports[_0xaa87('0x1a')]=function(_0x5ef98d,_0x1bf755){return git[_0xaa87('0x1a')]([_0xaa87('0x1b'),_0xaa87('0x1c')],function(_0x43ab71){if(_0x43ab71){logger[_0xaa87('0x1d')](_0x43ab71);return _0x1bf755[_0xaa87('0x14')](0x1f4)[_0xaa87('0x15')](_0x43ab71);}logger[_0xaa87('0x18')](_0xaa87('0x1e'));return _0x1bf755['status'](0xc8)['json']({'output':_0xaa87('0x1f')});});};exports[_0xaa87('0x20')]=function(_0x2a27a6,_0x10949a){exec(_0xaa87('0x21'),function(_0x11caf9,_0xc3ab34,_0x41342f){logger[_0xaa87('0x18')](_0xc3ab34);logger[_0xaa87('0x18')](_0x41342f);if(_0x11caf9){logger[_0xaa87('0x1d')](_0x11caf9);return _0x10949a['status'](0x1f4)[_0xaa87('0x15')](_0x11caf9);}return _0x10949a['status'](0xc8)[_0xaa87('0x15')]({'output':_0xc3ab34});});};exports[_0xaa87('0x22')]=function(_0x15c8ba,_0x3bff3e){return pm2[_0xaa87('0x22')]('motion2')[_0xaa87('0x23')](function(_0x138edd){logger[_0xaa87('0x18')]('pm2\x20restart\x20motion\x20%s',_0x138edd);return _0x3bff3e[_0xaa87('0x14')](0xc8)[_0xaa87('0x15')]({'output':_0xaa87('0x24')});})[_0xaa87('0x25')](function(_0x180bbb){logger['error'](_0x180bbb);return _0x3bff3e['status'](0x1f4)[_0xaa87('0x15')](_0x180bbb);});};exports['migrations']=function(_0x75234b,_0x3c44fc){var _0x414db4=fs[_0xaa87('0x26')](path[_0xaa87('0x27')](config[_0xaa87('0xc')],_0xaa87('0x28'),_0xaa87('0x29')));var _0x38c070=[];for(var _0x5d7542=0x0;_0x5d7542<_0x414db4['length'];_0x5d7542++){var _0x55d08e=_0x414db4[_0x5d7542][_0xaa87('0x2a')](_0xaa87('0x2b'),'');if(compareVersions(module[_0xaa87('0xe')][_0xaa87('0x4')],_0x55d08e)===-0x1){_0x38c070[_0xaa87('0x2c')](_0x55d08e);}}if(_0x38c070['length']){var _0x1d6d15=_0x38c070[_0xaa87('0x2d')](compareVersions);var _0x43d4c4=new Umzug({'storage':_0xaa87('0x2e'),'storageOptions':{'model':db['Migration'],'modelName':_0xaa87('0x2f'),'columnName':_0xaa87('0x4')},'migrations':{'params':[db[_0xaa87('0x2e')][_0xaa87('0x30')](),db[_0xaa87('0x2e')][_0xaa87('0x31')],function(){throw new Error(_0xaa87('0x32'));}],'path':path[_0xaa87('0x27')](config['root'],'server','migrations'),'pattern':/\.js$/}});_0x43d4c4['up']({'migrations':_[_0xaa87('0x33')](_0x1d6d15,function(_0x1a0685){return _0x1a0685+_0xaa87('0x2b');})})['then'](function(){return _0x3c44fc['status'](0xc8)[_0xaa87('0x15')]({'output':_0xaa87('0x34')+module['exports'][_0xaa87('0x4')]+_0xaa87('0x35')+_[_0xaa87('0x36')](_0x1d6d15),'migrations':_[_0xaa87('0x27')](_0x1d6d15)});})[_0xaa87('0x25')](function(_0x34c638){if(_0x34c638 instanceof db[_0xaa87('0x2e')]['UniqueConstraintError']){return _0x3c44fc[_0xaa87('0x14')](0xc8)[_0xaa87('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x3c44fc[_0xaa87('0x14')](0x1f4)['json'](_0x34c638);}});}else{return _0x3c44fc[_0xaa87('0x14')](0xc8)[_0xaa87('0x15')]({'output':_0xaa87('0x37')});}}; \ No newline at end of file +var _0x7444=['simple-git','root','index','exports','version','query','latest','tags','2.0.0','json','status','fetch','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','length','replace','.js','push','sequelize','Migration','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment'];(function(_0x39c408,_0x57a0b8){var _0x53a32a=function(_0x4f22e3){while(--_0x4f22e3){_0x39c408['push'](_0x39c408['shift']());}};_0x53a32a(++_0x57a0b8);}(_0x7444,0xc4));var _0x4744=function(_0x4c7ec9,_0x296cae){_0x4c7ec9=_0x4c7ec9-0x0;var _0x3e4428=_0x7444[_0x4c7ec9];return _0x3e4428;};'use strict';var Umzug=require(_0x4744('0x0'));var path=require(_0x4744('0x1'));var fs=require('fs');var _=require(_0x4744('0x2'));var pkginfo=require(_0x4744('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x4744('0x4'))[_0x4744('0x5')];var db=require(_0x4744('0x6'))['db'];var config=require(_0x4744('0x7'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0x4744('0x8'))(config[_0x4744('0x9')]);exports[_0x4744('0xa')]=function(_0xfb33b6,_0x5887b7){var _0x49e61b={'current':module[_0x4744('0xb')][_0x4744('0xc')],'phonebar':0x2};if(_0xfb33b6['query']&&_0xfb33b6[_0x4744('0xd')][_0x4744('0xe')]){return git['fetch']()[_0x4744('0xf')](function(_0x437bc1,_0x130e4a){_0x49e61b[_0x4744('0xe')]=(_0x437bc1?module[_0x4744('0xb')]['version']:_0x130e4a[_0x4744('0xe')])||_0x4744('0x10');return _0x5887b7['status'](0xc8)[_0x4744('0x11')](_0x49e61b);});}else{return _0x5887b7[_0x4744('0x12')](0xc8)[_0x4744('0x11')](_0x49e61b);}};exports[_0x4744('0x13')]=function(_0x1f302b,_0x5beb75){return git[_0x4744('0x13')]([_0x4744('0x14'),'master'],function(_0x484a4c){if(_0x484a4c){logger[_0x4744('0x15')](_0x484a4c);return _0x5beb75[_0x4744('0x12')](0x1f4)[_0x4744('0x11')](_0x484a4c);}logger['info'](_0x4744('0x16'));return _0x5beb75[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x4744('0x17')});});};exports[_0x4744('0x18')]=function(_0x230321,_0x1b0549){return git[_0x4744('0x18')]([_0x4744('0x19'),_0x4744('0x1a')],function(_0x1fa279){if(_0x1fa279){logger[_0x4744('0x15')](_0x1fa279);return _0x1b0549[_0x4744('0x12')](0x1f4)['json'](_0x1fa279);}logger[_0x4744('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1b0549[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x4744('0x1c')});});};exports[_0x4744('0x1d')]=function(_0x49bc64,_0x129b59){exec(_0x4744('0x1e'),function(_0x13e28e,_0x45e151,_0x479bdc){logger[_0x4744('0x1b')](_0x45e151);logger['info'](_0x479bdc);if(_0x13e28e){logger[_0x4744('0x15')](_0x13e28e);return _0x129b59['status'](0x1f4)[_0x4744('0x11')](_0x13e28e);}return _0x129b59[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x45e151});});};exports[_0x4744('0x1f')]=function(_0x23f5d1,_0x2b12a3){return pm2[_0x4744('0x1f')](_0x4744('0x20'))[_0x4744('0x21')](function(_0x18525f){logger['info'](_0x4744('0x22'),_0x18525f);return _0x2b12a3[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x4744('0x23')});})['catch'](function(_0x2a4df7){logger[_0x4744('0x15')](_0x2a4df7);return _0x2b12a3[_0x4744('0x12')](0x1f4)[_0x4744('0x11')](_0x2a4df7);});};exports[_0x4744('0x24')]=function(_0x967b46,_0x24e096){var _0x305c64=fs['readdirSync'](path[_0x4744('0x25')](config[_0x4744('0x9')],_0x4744('0x26'),_0x4744('0x24')));var _0x4c64c5=[];for(var _0x24c24d=0x0;_0x24c24d<_0x305c64[_0x4744('0x27')];_0x24c24d++){var _0x16a682=_0x305c64[_0x24c24d][_0x4744('0x28')](_0x4744('0x29'),'');if(compareVersions(module[_0x4744('0xb')][_0x4744('0xc')],_0x16a682)===-0x1){_0x4c64c5[_0x4744('0x2a')](_0x16a682);}}if(_0x4c64c5[_0x4744('0x27')]){var _0x27bd05=_0x4c64c5['sort'](compareVersions);var _0x947fd6=new Umzug({'storage':_0x4744('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x4744('0x2c'),'columnName':_0x4744('0xc')},'migrations':{'params':[db[_0x4744('0x2b')]['getQueryInterface'](),db[_0x4744('0x2b')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x4744('0x25')](config[_0x4744('0x9')],_0x4744('0x26'),'migrations'),'pattern':/\.js$/}});_0x947fd6['up']({'migrations':_[_0x4744('0x2d')](_0x27bd05,function(_0x5f455f){return _0x5f455f+_0x4744('0x29');})})[_0x4744('0x21')](function(){return _0x24e096[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x4744('0x2e')+module[_0x4744('0xb')]['version']+_0x4744('0x2f')+_[_0x4744('0x30')](_0x27bd05),'migrations':_[_0x4744('0x25')](_0x27bd05)});})['catch'](function(_0x23afed){if(_0x23afed instanceof db[_0x4744('0x2b')][_0x4744('0x31')]){return _0x24e096[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x24e096['status'](0x1f4)[_0x4744('0x11')](_0x23afed);}});}else{return _0x24e096[_0x4744('0x12')](0xc8)[_0x4744('0x11')]({'output':_0x4744('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 6556825..f97de96 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 _0x7bde=['../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7bde,0xc8));var _0xe7bd=function(_0xfb461f,_0x2cfbb6){_0xfb461f=_0xfb461f-0x0;var _0x4f5e8e=_0x7bde[_0xfb461f];return _0x4f5e8e;};'use strict';var multer=require('multer');var util=require(_0xe7bd('0x0'));var path=require('path');var timeout=require(_0xe7bd('0x1'));var express=require(_0xe7bd('0x2'));var router=express[_0xe7bd('0x3')]();var fs_extra=require(_0xe7bd('0x4'));var auth=require(_0xe7bd('0x5'));var interaction=require(_0xe7bd('0x6'));var config=require(_0xe7bd('0x7'));var controller=require(_0xe7bd('0x8'));router[_0xe7bd('0x9')]('/',auth[_0xe7bd('0xa')](),controller[_0xe7bd('0xb')]);router[_0xe7bd('0x9')](_0xe7bd('0xc'),auth[_0xe7bd('0xa')](),controller[_0xe7bd('0xd')]);router[_0xe7bd('0x9')](_0xe7bd('0xe'),auth[_0xe7bd('0xa')](),controller[_0xe7bd('0xf')]);router[_0xe7bd('0x10')]('/',auth[_0xe7bd('0xa')](),controller[_0xe7bd('0x11')]);router[_0xe7bd('0x12')](_0xe7bd('0xe'),auth[_0xe7bd('0xa')](),controller[_0xe7bd('0x13')]);router[_0xe7bd('0x14')](_0xe7bd('0xe'),auth['isAuthenticated'](),controller[_0xe7bd('0x15')]);module[_0xe7bd('0x16')]=router; \ No newline at end of file +var _0x4645=['/describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x205273,_0x5c37e8){var _0x3252a2=function(_0x33abe9){while(--_0x33abe9){_0x205273['push'](_0x205273['shift']());}};_0x3252a2(++_0x5c37e8);}(_0x4645,0xb9));var _0x5464=function(_0x35a5ea,_0x3eb3ec){_0x35a5ea=_0x35a5ea-0x0;var _0x22e4a3=_0x4645[_0x35a5ea];return _0x22e4a3;};'use strict';var multer=require(_0x5464('0x0'));var util=require(_0x5464('0x1'));var path=require(_0x5464('0x2'));var timeout=require(_0x5464('0x3'));var express=require(_0x5464('0x4'));var router=express[_0x5464('0x5')]();var fs_extra=require(_0x5464('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5464('0x7'));var config=require(_0x5464('0x8'));var controller=require(_0x5464('0x9'));router[_0x5464('0xa')]('/',auth[_0x5464('0xb')](),controller[_0x5464('0xc')]);router[_0x5464('0xa')](_0x5464('0xd'),auth[_0x5464('0xb')](),controller['describe']);router[_0x5464('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5464('0xe')]);router[_0x5464('0xf')]('/',auth[_0x5464('0xb')](),controller[_0x5464('0x10')]);router[_0x5464('0x11')](_0x5464('0x12'),auth[_0x5464('0xb')](),controller[_0x5464('0x13')]);router[_0x5464('0x14')](_0x5464('0x12'),auth[_0x5464('0xb')](),controller['destroy']);module[_0x5464('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d83d7d6..748aeb5 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 _0xf53d=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xf53d,0x199));var _0xdf53=function(_0x27807f,_0x9fc887){_0x27807f=_0x27807f-0x0;var _0x596457=_0xf53d[_0x27807f];return _0x596457;};'use strict';var Sequelize=require(_0xdf53('0x0'));module[_0xdf53('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdf53('0x2')]},'calleridnum':{'type':Sequelize[_0xdf53('0x2')]},'calleridname':{'type':Sequelize[_0xdf53('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xdf53('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xdf53('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xdf53('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdf53('0x4')]},'agentcomplete':{'type':Sequelize[_0xdf53('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xdf53('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xdf53('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdf53('0x4')]},'agentacw':{'type':Sequelize[_0xdf53('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdf53('0x4')]},'reason':{'type':Sequelize[_0xdf53('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdf53('0x2')]},'channelstate':{'type':Sequelize[_0xdf53('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdf53('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdf53('0x2')]},'accountcode':{'type':Sequelize[_0xdf53('0x2')]},'context':{'type':Sequelize[_0xdf53('0x2')]},'exten':{'type':Sequelize[_0xdf53('0x2')]},'priority':{'type':Sequelize[_0xdf53('0x2')]},'destchannel':{'type':Sequelize[_0xdf53('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xdf53('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xdf53('0x2')]},'destlanguage':{'type':Sequelize[_0xdf53('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf53('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xdf53('0x2')]},'destpriority':{'type':Sequelize[_0xdf53('0x2')]},'destuniqueid':{'type':Sequelize[_0xdf53('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdf53('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xdf53('0x2')]},'transfer':{'type':Sequelize[_0xdf53('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdf53('0x2')],'comment':_0xdf53('0x6')},'transferexten':{'type':Sequelize[_0xdf53('0x2')]},'transferuniqueid':{'type':Sequelize[_0xdf53('0x2')]},'agententerreason':{'type':Sequelize[_0xdf53('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd4dc=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x84a159,_0x1d2a62){var _0x596baa=function(_0x4676fd){while(--_0x4676fd){_0x84a159['push'](_0x84a159['shift']());}};_0x596baa(++_0x1d2a62);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd4dc[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0xcd4d('0x0'));module['exports']={'type':{'type':Sequelize[_0xcd4d('0x1')]},'uniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'calleridnum':{'type':Sequelize[_0xcd4d('0x1')]},'calleridname':{'type':Sequelize[_0xcd4d('0x1')]},'queue':{'type':Sequelize[_0xcd4d('0x1')]},'interface':{'type':Sequelize[_0xcd4d('0x1')]},'membername':{'type':Sequelize[_0xcd4d('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xcd4d('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xcd4d('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xcd4d('0x4')]},'agentacw':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xcd4d('0x1')]},'channel':{'type':Sequelize[_0xcd4d('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xcd4d('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcd4d('0x1')]},'connectedlinename':{'type':Sequelize[_0xcd4d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcd4d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xcd4d('0x1')]},'priority':{'type':Sequelize[_0xcd4d('0x1')]},'destchannel':{'type':Sequelize[_0xcd4d('0x1')]},'destchannelstate':{'type':Sequelize[_0xcd4d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xcd4d('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xcd4d('0x1')]},'destlanguage':{'type':Sequelize[_0xcd4d('0x1')]},'destaccountcode':{'type':Sequelize[_0xcd4d('0x1')]},'destcontext':{'type':Sequelize[_0xcd4d('0x1')]},'destexten':{'type':Sequelize[_0xcd4d('0x1')]},'destpriority':{'type':Sequelize[_0xcd4d('0x1')]},'destuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xcd4d('0x1')]},'transfer':{'type':Sequelize[_0xcd4d('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xcd4d('0x5')},'transferexten':{'type':Sequelize[_0xcd4d('0x1')]},'transferuniqueid':{'type':Sequelize[_0xcd4d('0x1')]},'agententerreason':{'type':Sequelize[_0xcd4d('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index bd4674a..9b23a7d 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(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 9b2b074..ce91017 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 _0x746f=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x746f,0x9c));var _0xf746=function(_0x53eedc,_0x15d2cf){_0x53eedc=_0x53eedc-0x0;var _0x10cac4=_0x746f[_0x53eedc];return _0x10cac4;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var logger=require(_0xf746('0x2'))(_0xf746('0x3'));var moment=require(_0xf746('0x4'));var BPromise=require(_0xf746('0x5'));var rp=require(_0xf746('0x6'));var fs=require('fs');var path=require(_0xf746('0x7'));var rimraf=require(_0xf746('0x8'));var config=require(_0xf746('0x9'));var attributes=require(_0xf746('0xa'));module[_0xf746('0xb')]=function(_0x19d855,_0x2f0f3c){return _0x19d855[_0xf746('0xc')](_0xf746('0xd'),attributes,{'tableName':_0xf746('0xe'),'paranoid':![],'indexes':[{'fields':[_0xf746('0xf'),_0xf746('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x43fd=['path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','moment','bluebird'];(function(_0x9cc3da,_0x587e07){var _0x2c3713=function(_0x10c47c){while(--_0x10c47c){_0x9cc3da['push'](_0x9cc3da['shift']());}};_0x2c3713(++_0x587e07);}(_0x43fd,0x1ec));var _0xd43f=function(_0x2c1fff,_0x320620){_0x2c1fff=_0x2c1fff-0x0;var _0x2eaf6f=_0x43fd[_0x2c1fff];return _0x2eaf6f;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd43f('0x1'));var BPromise=require(_0xd43f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43f('0x3'));var rimraf=require('rimraf');var config=require(_0xd43f('0x4'));var attributes=require(_0xd43f('0x5'));module[_0xd43f('0x6')]=function(_0x33ddff,_0x52e75f){return _0x33ddff[_0xd43f('0x7')](_0xd43f('0x8'),attributes,{'tableName':_0xd43f('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd43f('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 6c9974a..c1fddc8 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 _0x76b6=['result','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','then','catch','update','limit','UpdateVoiceAgentReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b6,0xb5));var _0x676b=function(_0x1bdb2d,_0x220cef){_0x1bdb2d=_0x1bdb2d-0x0;var _0x574e7a=_0x76b6[_0x1bdb2d];return _0x574e7a;};'use strict';var _=require('lodash');var util=require(_0x676b('0x0'));var moment=require(_0x676b('0x1'));var BPromise=require(_0x676b('0x2'));var rs=require(_0x676b('0x3'));var fs=require('fs');var Redis=require(_0x676b('0x4'));var db=require(_0x676b('0x5'))['db'];var utils=require(_0x676b('0x6'));var logger=require(_0x676b('0x7'))(_0x676b('0x8'));var config=require(_0x676b('0x9'));var jayson=require(_0x676b('0xa'));var client=jayson[_0x676b('0xb')][_0x676b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cf43,_0xefa091,_0x283c07){return new BPromise(function(_0x5cae68,_0x1670df){return client[_0x676b('0xd')](_0x14cf43,_0x283c07)['then'](function(_0x505754){logger[_0x676b('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xefa091,_0x676b('0xf'));logger[_0x676b('0x10')](_0x676b('0x11'),_0xefa091,_0x676b('0xf'),JSON[_0x676b('0x12')](_0x505754));if(_0x505754[_0x676b('0x13')]){if(_0x505754[_0x676b('0x13')][_0x676b('0x14')]===0x1f4){logger[_0x676b('0x13')](_0x676b('0x15'),_0xefa091,_0x505754['error']['message']);return _0x1670df(_0x505754[_0x676b('0x13')][_0x676b('0x16')]);}logger[_0x676b('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0xefa091,_0x505754['error'][_0x676b('0x16')]);return _0x5cae68(_0x505754[_0x676b('0x13')][_0x676b('0x16')]);}else{logger[_0x676b('0xe')](_0x676b('0x15'),_0xefa091,_0x676b('0xf'));_0x5cae68(_0x505754[_0x676b('0x17')][_0x676b('0x16')]);}})['catch'](function(_0x2b5180){logger[_0x676b('0x13')](_0x676b('0x15'),_0xefa091,_0x2b5180);_0x1670df(_0x2b5180);});});}exports[_0x676b('0x18')]=function(_0x32f1c9){var _0x478be0=this;return new Promise(function(_0x9c2b59,_0x508db2){return db[_0x676b('0x19')]['create'](_0x32f1c9[_0x676b('0x1a')],{'raw':_0x32f1c9[_0x676b('0x1b')]?_0x32f1c9[_0x676b('0x1b')][_0x676b('0x1c')]===undefined?!![]:![]:!![]})[_0x676b('0x1d')](function(_0x4ebc1e){logger['info'](_0x676b('0x18'),_0x32f1c9);logger['debug'](_0x676b('0x18'),_0x32f1c9,JSON[_0x676b('0x12')](_0x4ebc1e));_0x9c2b59(_0x4ebc1e);})[_0x676b('0x1e')](function(_0x4dc97d){logger[_0x676b('0x13')](_0x676b('0x18'),_0x4dc97d['message'],_0x32f1c9);_0x508db2(_0x478be0[_0x676b('0x13')](0x1f4,_0x4dc97d[_0x676b('0x16')]));});});};exports['UpdateVoiceAgentReport']=function(_0x48727a){var _0x518afe=this;return new Promise(function(_0x470746,_0x4bc22c){return db[_0x676b('0x19')][_0x676b('0x1f')](_0x48727a['body'],{'raw':_0x48727a[_0x676b('0x1b')]?_0x48727a[_0x676b('0x1b')][_0x676b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48727a['options']?_0x48727a[_0x676b('0x1b')]['where']||null:null,'attributes':_0x48727a['options']?_0x48727a[_0x676b('0x1b')]['attributes']||null:null,'limit':_0x48727a[_0x676b('0x1b')]?_0x48727a[_0x676b('0x1b')][_0x676b('0x20')]||null:null})['then'](function(_0x555f2a){logger[_0x676b('0xe')](_0x676b('0x21'),_0x48727a);logger['debug']('UpdateVoiceAgentReport',_0x48727a,JSON['stringify'](_0x555f2a));_0x470746(_0x555f2a);})[_0x676b('0x1e')](function(_0x2bbc68){logger['error'](_0x676b('0x21'),_0x2bbc68['message'],_0x48727a);_0x4bc22c(_0x518afe[_0x676b('0x13')](0x1f4,_0x2bbc68[_0x676b('0x16')]));});});}; \ No newline at end of file +var _0xc1de=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','util','randomstring'];(function(_0x261616,_0x5836a1){var _0x439b18=function(_0x4478f3){while(--_0x4478f3){_0x261616['push'](_0x261616['shift']());}};_0x439b18(++_0x5836a1);}(_0xc1de,0x1b0));var _0xec1d=function(_0xc3ea9,_0x20e81a){_0xc3ea9=_0xc3ea9-0x0;var _0x25b78b=_0xc1de[_0xc3ea9];return _0x25b78b;};'use strict';var _=require('lodash');var util=require(_0xec1d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xec1d('0x1'));var fs=require('fs');var Redis=require(_0xec1d('0x2'));var db=require(_0xec1d('0x3'))['db'];var utils=require(_0xec1d('0x4'));var logger=require(_0xec1d('0x5'))(_0xec1d('0x6'));var config=require(_0xec1d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xec1d('0x8')][_0xec1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf99dd8,_0x12e5b5,_0x55f28f){return new BPromise(function(_0x2b4194,_0x5b0d93){return client[_0xec1d('0xa')](_0xf99dd8,_0x55f28f)[_0xec1d('0xb')](function(_0x1efee5){logger[_0xec1d('0xc')](_0xec1d('0xd'),_0x12e5b5,_0xec1d('0xe'));logger[_0xec1d('0xf')](_0xec1d('0x10'),_0x12e5b5,_0xec1d('0xe'),JSON[_0xec1d('0x11')](_0x1efee5));if(_0x1efee5[_0xec1d('0x12')]){if(_0x1efee5[_0xec1d('0x12')]['code']===0x1f4){logger[_0xec1d('0x12')](_0xec1d('0xd'),_0x12e5b5,_0x1efee5[_0xec1d('0x12')][_0xec1d('0x13')]);return _0x5b0d93(_0x1efee5['error'][_0xec1d('0x13')]);}logger[_0xec1d('0x12')](_0xec1d('0xd'),_0x12e5b5,_0x1efee5[_0xec1d('0x12')][_0xec1d('0x13')]);return _0x2b4194(_0x1efee5['error'][_0xec1d('0x13')]);}else{logger[_0xec1d('0xc')](_0xec1d('0xd'),_0x12e5b5,'request\x20sent');_0x2b4194(_0x1efee5[_0xec1d('0x14')][_0xec1d('0x13')]);}})[_0xec1d('0x15')](function(_0x181097){logger[_0xec1d('0x12')](_0xec1d('0xd'),_0x12e5b5,_0x181097);_0x5b0d93(_0x181097);});});}exports[_0xec1d('0x16')]=function(_0x5b51ef){var _0xe586d9=this;return new Promise(function(_0x5d9fac,_0x4b4213){return db['VoiceAgentReport'][_0xec1d('0x17')](_0x5b51ef[_0xec1d('0x18')],{'raw':_0x5b51ef['options']?_0x5b51ef[_0xec1d('0x19')][_0xec1d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2b5552){logger[_0xec1d('0xc')](_0xec1d('0x16'),_0x5b51ef);logger[_0xec1d('0xf')](_0xec1d('0x16'),_0x5b51ef,JSON[_0xec1d('0x11')](_0x2b5552));_0x5d9fac(_0x2b5552);})[_0xec1d('0x15')](function(_0x389c03){logger[_0xec1d('0x12')](_0xec1d('0x16'),_0x389c03['message'],_0x5b51ef);_0x4b4213(_0xe586d9[_0xec1d('0x12')](0x1f4,_0x389c03[_0xec1d('0x13')]));});});};exports[_0xec1d('0x1b')]=function(_0x3eef51){var _0x6032fc=this;return new Promise(function(_0x33bf07,_0x5715ac){return db['VoiceAgentReport'][_0xec1d('0x1c')](_0x3eef51[_0xec1d('0x18')],{'raw':_0x3eef51['options']?_0x3eef51[_0xec1d('0x19')][_0xec1d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eef51[_0xec1d('0x19')]?_0x3eef51[_0xec1d('0x19')][_0xec1d('0x1d')]||null:null,'attributes':_0x3eef51[_0xec1d('0x19')]?_0x3eef51['options'][_0xec1d('0x1e')]||null:null,'limit':_0x3eef51[_0xec1d('0x19')]?_0x3eef51[_0xec1d('0x19')]['limit']||null:null})[_0xec1d('0xb')](function(_0x47f0e7){logger[_0xec1d('0xc')](_0xec1d('0x1b'),_0x3eef51);logger[_0xec1d('0xf')](_0xec1d('0x1b'),_0x3eef51,JSON[_0xec1d('0x11')](_0x47f0e7));_0x33bf07(_0x47f0e7);})['catch'](function(_0x37daf2){logger[_0xec1d('0x12')](_0xec1d('0x1b'),_0x37daf2['message'],_0x3eef51);_0x5715ac(_0x6032fc[_0xec1d('0x12')](0x1f4,_0x37daf2[_0xec1d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 60cd65a..d4db031 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 _0x20d0=['/with-retry/:id','updateWithRetry','exports','express','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x1669c4,_0x4f217a){var _0x5dee11=function(_0x462b48){while(--_0x462b48){_0x1669c4['push'](_0x1669c4['shift']());}};_0x5dee11(++_0x4f217a);}(_0x20d0,0x15c));var _0x020d=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x20d0[_0x1d24eb];return _0x1dc576;};'use strict';var express=require(_0x020d('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x020d('0x1'));router[_0x020d('0x2')]('/',auth[_0x020d('0x3')](),controller['index']);router[_0x020d('0x2')](_0x020d('0x4'),auth[_0x020d('0x3')](),controller[_0x020d('0x5')]);router[_0x020d('0x2')](_0x020d('0x6'),auth[_0x020d('0x3')](),controller[_0x020d('0x7')]);router[_0x020d('0x8')]('/',auth[_0x020d('0x3')](),controller[_0x020d('0x9')]);router[_0x020d('0xa')]('/:id',auth[_0x020d('0x3')](),controller[_0x020d('0xb')]);router['put'](_0x020d('0xc'),auth[_0x020d('0x3')](),controller[_0x020d('0xd')]);router['delete'](_0x020d('0x6'),auth[_0x020d('0x3')](),controller['destroy']);module[_0x020d('0xe')]=router; \ No newline at end of file +var _0x6cf3=['index','describe','get','/:id','create','put','/with-retry/:id','delete','exports','express','Router','./voiceCallReport.controller','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cf3,0x100));var _0x36cf=function(_0x167295,_0x555a81){_0x167295=_0x167295-0x0;var _0x400be6=_0x6cf3[_0x167295];return _0x400be6;};'use strict';var express=require(_0x36cf('0x0'));var router=express[_0x36cf('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x36cf('0x2'));router['get']('/',auth[_0x36cf('0x3')](),controller[_0x36cf('0x4')]);router['get']('/describe',auth[_0x36cf('0x3')](),controller[_0x36cf('0x5')]);router[_0x36cf('0x6')](_0x36cf('0x7'),auth[_0x36cf('0x3')](),controller['show']);router['post']('/',auth[_0x36cf('0x3')](),controller[_0x36cf('0x8')]);router['put'](_0x36cf('0x7'),auth[_0x36cf('0x3')](),controller['update']);router[_0x36cf('0x9')](_0x36cf('0xa'),auth['isAuthenticated'](),controller['updateWithRetry']);router[_0x36cf('0xb')](_0x36cf('0x7'),auth[_0x36cf('0x3')](),controller['destroy']);module[_0x36cf('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index fa04a8b..190eb60 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 _0x66e5=['outbound','inbound-fax','outbound-fax','dialer','STRING','DATE','INTEGER','sequelize','ENUM','internal'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x66e5,0x1a1));var _0x566e=function(_0x3f0752,_0x49c7ce){_0x3f0752=_0x3f0752-0x0;var _0x3d2d59=_0x66e5[_0x3f0752];return _0x3d2d59;};'use strict';var Sequelize=require(_0x566e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x566e('0x1')]('inbound',_0x566e('0x2'),_0x566e('0x3'),_0x566e('0x4'),_0x566e('0x5'),_0x566e('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x566e('0x7')]},'source':{'type':Sequelize[_0x566e('0x7')]},'destination':{'type':Sequelize[_0x566e('0x7')]},'destinationcontext':{'type':Sequelize[_0x566e('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x566e('0x7')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x566e('0x7')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x566e('0x8')]},'systemanswertime':{'type':Sequelize[_0x566e('0x8')]},'answertime':{'type':Sequelize[_0x566e('0x8')]},'endtime':{'type':Sequelize[_0x566e('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x566e('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x566e('0x7')]},'amaflags':{'type':Sequelize[_0x566e('0x7')]},'userfield':{'type':Sequelize[_0x566e('0x7')]},'userDisposition':{'type':Sequelize[_0x566e('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x566e('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x566e('0x7')]}}; \ No newline at end of file +var _0x3f7c=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound'];(function(_0x553e1e,_0x5bedef){var _0x3bb17b=function(_0x53ad59){while(--_0x53ad59){_0x553e1e['push'](_0x553e1e['shift']());}};_0x3bb17b(++_0x5bedef);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x49888a,_0x4fc201){_0x49888a=_0x49888a-0x0;var _0x2ce799=_0x3f7c[_0x49888a];return _0x2ce799;};'use strict';var Sequelize=require(_0xc3f7('0x0'));module[_0xc3f7('0x1')]={'uniqueid':{'type':Sequelize[_0xc3f7('0x2')]},'type':{'type':Sequelize[_0xc3f7('0x3')](_0xc3f7('0x4'),'internal',_0xc3f7('0x5'),'inbound-fax',_0xc3f7('0x6'),_0xc3f7('0x7'))},'tag':{'type':Sequelize[_0xc3f7('0x2')]},'accountcode':{'type':Sequelize[_0xc3f7('0x2')]},'source':{'type':Sequelize[_0xc3f7('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xc3f7('0x2')]},'callerid':{'type':Sequelize[_0xc3f7('0x2')]},'channel':{'type':Sequelize[_0xc3f7('0x2')]},'destinationchannel':{'type':Sequelize[_0xc3f7('0x2')]},'lastapplication':{'type':Sequelize[_0xc3f7('0x2')]},'lastdata':{'type':Sequelize[_0xc3f7('0x8')]},'starttime':{'type':Sequelize[_0xc3f7('0x9')]},'systemanswertime':{'type':Sequelize[_0xc3f7('0x9')]},'answertime':{'type':Sequelize[_0xc3f7('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xc3f7('0xa')]},'billableseconds':{'type':Sequelize[_0xc3f7('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc3f7('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc3f7('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xc3f7('0x2')]},'note':{'type':Sequelize[_0xc3f7('0x2')]},'prefix':{'type':Sequelize[_0xc3f7('0x2')]},'routeid':{'type':Sequelize[_0xc3f7('0xa')]},'sipcallid':{'type':Sequelize[_0xc3f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f41d2ab..f900fe9 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 _0x6b2e=['keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','include','fullname','alias','User','rows','catch','params','fields','find','create','body','describe','user','uniqueid','updateWithRetry','No\x20such\x20Voice\x20Call\x20Report','../../components/parsers/qs','../../config/logger','api','../../mysqldb','promise-retry','json','limit','undefined','count','status','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','VoiceCallReport','rawAttributes','fieldName','type','map'];(function(_0x463dca,_0x669e23){var _0x245462=function(_0x332ab2){while(--_0x332ab2){_0x463dca['push'](_0x463dca['shift']());}};_0x245462(++_0x669e23);}(_0x6b2e,0x1f2));var _0xe6b2=function(_0x21f96d,_0x3d57ac){_0x21f96d=_0x21f96d-0x0;var _0x1a1bc9=_0x6b2e[_0x21f96d];return _0x1a1bc9;};'use strict';var _=require('lodash');var qs=require(_0xe6b2('0x0'));var logger=require(_0xe6b2('0x1'))(_0xe6b2('0x2'));var db=require(_0xe6b2('0x3'))['db'];const promiseRetry=require(_0xe6b2('0x4'));function respondWithResult(_0x2d9b1c,_0x39184a){_0x39184a=_0x39184a||0xc8;return function(_0xa7e2e4){if(_0xa7e2e4){return _0x2d9b1c['status'](_0x39184a)[_0xe6b2('0x5')](_0xa7e2e4);}};}function respondWithFilteredResult(_0x4b6fcc,_0x1ea974){return function(_0x2124de){if(_0x2124de){var _0x5ad28a=typeof _0x1ea974['offset']==='undefined'&&typeof _0x1ea974[_0xe6b2('0x6')]===_0xe6b2('0x7');var _0x57c956=_0x2124de[_0xe6b2('0x8')];var _0x5cdf1c=_0x5ad28a?0x0:_0x1ea974['offset'];var _0x4bf982=_0x5ad28a?_0x2124de[_0xe6b2('0x8')]:_0x1ea974['offset']+_0x1ea974[_0xe6b2('0x6')];var _0x269144;if(_0x4bf982>=_0x57c956){_0x4bf982=_0x57c956;_0x269144=0xc8;}else{_0x269144=0xce;}_0x4b6fcc[_0xe6b2('0x9')](_0x269144);return _0x4b6fcc['set'](_0xe6b2('0xa'),_0x5cdf1c+'-'+_0x4bf982+'/'+_0x57c956)[_0xe6b2('0x5')](_0x2124de);}return null;};}function saveUpdates(_0x5932a3){return function(_0x253d91){if(_0x253d91){return _0x253d91[_0xe6b2('0xb')](_0x5932a3)[_0xe6b2('0xc')](function(_0x28bfd5){return _0x28bfd5;});}return null;};}function removeEntity(_0x31a539){return function(_0x5b7807){if(_0x5b7807){return _0x5b7807[_0xe6b2('0xd')]()[_0xe6b2('0xc')](function(){_0x31a539[_0xe6b2('0x9')](0xcc)[_0xe6b2('0xe')]();});}};}function handleEntityNotFound(_0x1df627){return function(_0x47de21){if(!_0x47de21){_0x1df627[_0xe6b2('0xf')](0x194);}return _0x47de21;};}function handleError(_0x10dcd4,_0x2b8e7e){_0x2b8e7e=_0x2b8e7e||0x1f4;return function(_0x589678){logger['error'](_0x589678[_0xe6b2('0x10')]);if(_0x589678[_0xe6b2('0x11')]){delete _0x589678[_0xe6b2('0x11')];}_0x10dcd4['status'](_0x2b8e7e)[_0xe6b2('0x12')](_0x589678);};}exports['index']=function(_0x5754b5,_0xf58ad3){var _0x47e647={},_0x41a924={},_0xfe21a={'count':0x0,'rows':[]};var _0x4b6450=_['map'](db[_0xe6b2('0x13')][_0xe6b2('0x14')],function(_0x25796d){return{'name':_0x25796d[_0xe6b2('0x15')],'type':_0x25796d[_0xe6b2('0x16')]['key']};});_0x41a924['model']=_[_0xe6b2('0x17')](_0x4b6450,_0xe6b2('0x11'));_0x41a924['query']=_[_0xe6b2('0x18')](_0x5754b5[_0xe6b2('0x19')]);_0x41a924[_0xe6b2('0x1a')]=_['intersection'](_0x41a924[_0xe6b2('0x1b')],_0x41a924[_0xe6b2('0x19')]);_0x47e647[_0xe6b2('0x1c')]=_[_0xe6b2('0x1d')](_0x41a924['model'],qs['fields'](_0x5754b5[_0xe6b2('0x19')]['fields']));_0x47e647[_0xe6b2('0x1c')]=_0x47e647[_0xe6b2('0x1c')][_0xe6b2('0x1e')]?_0x47e647[_0xe6b2('0x1c')]:_0x41a924[_0xe6b2('0x1b')];if(!_0x5754b5[_0xe6b2('0x19')][_0xe6b2('0x1f')](_0xe6b2('0x20'))){_0x47e647[_0xe6b2('0x6')]=qs[_0xe6b2('0x6')](_0x5754b5[_0xe6b2('0x19')][_0xe6b2('0x6')]);_0x47e647['offset']=qs[_0xe6b2('0x21')](_0x5754b5[_0xe6b2('0x19')]['offset']);}_0x47e647[_0xe6b2('0x22')]=qs['sort'](_0x5754b5[_0xe6b2('0x19')][_0xe6b2('0x23')]);_0x47e647['where']=qs[_0xe6b2('0x1a')](_[_0xe6b2('0x24')](_0x5754b5[_0xe6b2('0x19')],_0x41a924[_0xe6b2('0x1a')]),_0x4b6450);if(_0x5754b5[_0xe6b2('0x19')][_0xe6b2('0x25')]){_0x47e647[_0xe6b2('0x26')]=_[_0xe6b2('0x27')](_0x47e647[_0xe6b2('0x26')],{'$or':_[_0xe6b2('0x17')](_0x4b6450,function(_0x314e28){if(_0x314e28[_0xe6b2('0x16')]!==_0xe6b2('0x28')){var _0x1f943f={};_0x1f943f[_0x314e28[_0xe6b2('0x11')]]={'$like':'%'+_0x5754b5[_0xe6b2('0x19')]['filter']+'%'};return _0x1f943f;}})});}_0x47e647=_[_0xe6b2('0x27')]({},_0x47e647,_0x5754b5[_0xe6b2('0x29')]);var _0x41d421={'where':_0x47e647['where']};return db[_0xe6b2('0x13')]['count'](_0x41d421)[_0xe6b2('0xc')](function(_0x1687b2){_0xfe21a[_0xe6b2('0x8')]=_0x1687b2;if(_0x5754b5['query']['includeAll']){_0x47e647[_0xe6b2('0x2a')]=[{'attributes':['id',_0xe6b2('0x11'),_0xe6b2('0x2b'),_0xe6b2('0x2c')],'model':db[_0xe6b2('0x2d')],'as':_0xe6b2('0x2d')}];}return db[_0xe6b2('0x13')]['findAll'](_0x47e647);})[_0xe6b2('0xc')](function(_0x6fe3bd){_0xfe21a[_0xe6b2('0x2e')]=_0x6fe3bd;return _0xfe21a;})[_0xe6b2('0xc')](respondWithFilteredResult(_0xf58ad3,_0x47e647))[_0xe6b2('0x2f')](handleError(_0xf58ad3,null));};exports['show']=function(_0x6c963b,_0xa8dedc){var _0x5aa09a={'raw':!![],'where':{'id':_0x6c963b[_0xe6b2('0x30')]['id']}},_0x497da1={};_0x497da1['model']=_[_0xe6b2('0x18')](db['VoiceCallReport'][_0xe6b2('0x14')]);_0x497da1['query']=_[_0xe6b2('0x18')](_0x6c963b['query']);_0x497da1[_0xe6b2('0x1a')]=_[_0xe6b2('0x1d')](_0x497da1[_0xe6b2('0x1b')],_0x497da1[_0xe6b2('0x19')]);_0x5aa09a['attributes']=_[_0xe6b2('0x1d')](_0x497da1[_0xe6b2('0x1b')],qs[_0xe6b2('0x31')](_0x6c963b[_0xe6b2('0x19')][_0xe6b2('0x31')]));_0x5aa09a[_0xe6b2('0x1c')]=_0x5aa09a[_0xe6b2('0x1c')][_0xe6b2('0x1e')]?_0x5aa09a[_0xe6b2('0x1c')]:_0x497da1[_0xe6b2('0x1b')];if(_0x6c963b['query']['includeAll']){_0x5aa09a[_0xe6b2('0x2a')]=[{'all':!![]}];}_0x5aa09a=_[_0xe6b2('0x27')]({},_0x5aa09a,_0x6c963b['options']);return db[_0xe6b2('0x13')][_0xe6b2('0x32')](_0x5aa09a)['then'](handleEntityNotFound(_0xa8dedc,null))[_0xe6b2('0xc')](respondWithResult(_0xa8dedc,null))['catch'](handleError(_0xa8dedc,null));};exports[_0xe6b2('0x33')]=function(_0x33b7be,_0x5aa5a3){return db[_0xe6b2('0x13')]['create'](_0x33b7be[_0xe6b2('0x34')],{})['then'](respondWithResult(_0x5aa5a3,0xc9))['catch'](handleError(_0x5aa5a3,null));};exports[_0xe6b2('0xd')]=function(_0x5519fa,_0x550028){return db['VoiceCallReport'][_0xe6b2('0x32')]({'where':{'id':_0x5519fa['params']['id']}})[_0xe6b2('0xc')](handleEntityNotFound(_0x550028,null))[_0xe6b2('0xc')](removeEntity(_0x550028,null))[_0xe6b2('0x2f')](handleError(_0x550028,null));};exports['describe']=function(_0x2a6af1,_0x188c39){return db['VoiceCallReport'][_0xe6b2('0x35')]()[_0xe6b2('0xc')](respondWithResult(_0x188c39,null))[_0xe6b2('0x2f')](handleError(_0x188c39,null));};function findForUpdate(_0x5cac0a){return db[_0xe6b2('0x13')][_0xe6b2('0x32')]({'where':{'uniqueid':_0x5cac0a[_0xe6b2('0x30')]['id'],'UserId':{'$or':[null,_0x5cac0a[_0xe6b2('0x36')]['id']]}}});}exports['update']=function(_0x417059,_0x263aca){if(_0x417059[_0xe6b2('0x34')][_0xe6b2('0x37')]){delete _0x417059[_0xe6b2('0x34')][_0xe6b2('0x37')];}return findForUpdate(_0x417059)[_0xe6b2('0xc')](handleEntityNotFound(_0x263aca,null))['then'](saveUpdates(_0x417059[_0xe6b2('0x34')],null))[_0xe6b2('0xc')](respondWithResult(_0x263aca,null))[_0xe6b2('0x2f')](handleError(_0x263aca,null));};exports[_0xe6b2('0x38')]=function(_0x251a2b,_0xecb56a,_0x3e6e68){if(_0x251a2b[_0xe6b2('0x34')][_0xe6b2('0x37')]){delete _0x251a2b[_0xe6b2('0x34')][_0xe6b2('0x37')];}promiseRetry(function(){return findForUpdate(_0x251a2b);},{'retries':0x6,'minTimeout':0xfa})['then'](function(_0x1df22c){if(!_0x1df22c){return new Promise(function(_0x2cc76c){_0x2cc76c(handleEntityNotFound(_0xecb56a)({'message':_0xe6b2('0x39')}));});}else{return _0x1df22c[_0xe6b2('0xb')](_0x251a2b[_0xe6b2('0x34')])[_0xe6b2('0xc')](function(_0x5427cf){return respondWithResult(_0xecb56a)(_0x5427cf);});}},_0x3e6e68)[_0xe6b2('0x2f')](_0x3e6e68);}; \ No newline at end of file +var _0x486e=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceCallReport','include','fullname','alias','User','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','body','describe','user','uniqueid','api','../../mysqldb','promise-retry','status','offset','undefined','limit','count','json','update','then','destroy','end','name','send','map','fieldName','key','query'];(function(_0x509024,_0x5e6c3d){var _0x5c36e8=function(_0x595c7c){while(--_0x595c7c){_0x509024['push'](_0x509024['shift']());}};_0x5c36e8(++_0x5e6c3d);}(_0x486e,0x89));var _0xe486=function(_0x1aa181,_0x41210f){_0x1aa181=_0x1aa181-0x0;var _0x52d5ac=_0x486e[_0x1aa181];return _0x52d5ac;};'use strict';var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe486('0x0'));var db=require(_0xe486('0x1'))['db'];const promiseRetry=require(_0xe486('0x2'));function respondWithResult(_0x392d26,_0x4fc97d){_0x4fc97d=_0x4fc97d||0xc8;return function(_0x5621c9){if(_0x5621c9){return _0x392d26[_0xe486('0x3')](_0x4fc97d)['json'](_0x5621c9);}};}function respondWithFilteredResult(_0x22f4b5,_0x5a3480){return function(_0x1c596e){if(_0x1c596e){var _0x2138db=typeof _0x5a3480[_0xe486('0x4')]===_0xe486('0x5')&&typeof _0x5a3480[_0xe486('0x6')]===_0xe486('0x5');var _0x1a30d2=_0x1c596e[_0xe486('0x7')];var _0x52e006=_0x2138db?0x0:_0x5a3480[_0xe486('0x4')];var _0x596a63=_0x2138db?_0x1c596e[_0xe486('0x7')]:_0x5a3480['offset']+_0x5a3480[_0xe486('0x6')];var _0x3ec3b0;if(_0x596a63>=_0x1a30d2){_0x596a63=_0x1a30d2;_0x3ec3b0=0xc8;}else{_0x3ec3b0=0xce;}_0x22f4b5[_0xe486('0x3')](_0x3ec3b0);return _0x22f4b5['set']('Content-Range',_0x52e006+'-'+_0x596a63+'/'+_0x1a30d2)[_0xe486('0x8')](_0x1c596e);}return null;};}function saveUpdates(_0x3b0895){return function(_0x2ee214){if(_0x2ee214){return _0x2ee214[_0xe486('0x9')](_0x3b0895)[_0xe486('0xa')](function(_0x135a5f){return _0x135a5f;});}return null;};}function removeEntity(_0x2ff2bb){return function(_0xd1c3bb){if(_0xd1c3bb){return _0xd1c3bb[_0xe486('0xb')]()[_0xe486('0xa')](function(){_0x2ff2bb[_0xe486('0x3')](0xcc)[_0xe486('0xc')]();});}};}function handleEntityNotFound(_0x42e83f){return function(_0x3fc25b){if(!_0x3fc25b){_0x42e83f['sendStatus'](0x194);}return _0x3fc25b;};}function handleError(_0x5677ed,_0x37140e){_0x37140e=_0x37140e||0x1f4;return function(_0x1f7a31){logger['error'](_0x1f7a31['stack']);if(_0x1f7a31[_0xe486('0xd')]){delete _0x1f7a31['name'];}_0x5677ed[_0xe486('0x3')](_0x37140e)[_0xe486('0xe')](_0x1f7a31);};}exports['index']=function(_0x42ec58,_0x960c41){var _0x3f8a87={},_0x55c5d6={},_0x5a40de={'count':0x0,'rows':[]};var _0x36bb33=_[_0xe486('0xf')](db['VoiceCallReport']['rawAttributes'],function(_0x472215){return{'name':_0x472215[_0xe486('0x10')],'type':_0x472215['type'][_0xe486('0x11')]};});_0x55c5d6['model']=_[_0xe486('0xf')](_0x36bb33,_0xe486('0xd'));_0x55c5d6[_0xe486('0x12')]=_['keys'](_0x42ec58[_0xe486('0x12')]);_0x55c5d6[_0xe486('0x13')]=_[_0xe486('0x14')](_0x55c5d6[_0xe486('0x15')],_0x55c5d6[_0xe486('0x12')]);_0x3f8a87['attributes']=_[_0xe486('0x14')](_0x55c5d6[_0xe486('0x15')],qs['fields'](_0x42ec58['query'][_0xe486('0x16')]));_0x3f8a87['attributes']=_0x3f8a87[_0xe486('0x17')][_0xe486('0x18')]?_0x3f8a87['attributes']:_0x55c5d6[_0xe486('0x15')];if(!_0x42ec58[_0xe486('0x12')][_0xe486('0x19')](_0xe486('0x1a'))){_0x3f8a87['limit']=qs[_0xe486('0x6')](_0x42ec58[_0xe486('0x12')][_0xe486('0x6')]);_0x3f8a87[_0xe486('0x4')]=qs['offset'](_0x42ec58[_0xe486('0x12')]['offset']);}_0x3f8a87[_0xe486('0x1b')]=qs[_0xe486('0x1c')](_0x42ec58['query'][_0xe486('0x1c')]);_0x3f8a87[_0xe486('0x1d')]=qs['filters'](_[_0xe486('0x1e')](_0x42ec58[_0xe486('0x12')],_0x55c5d6[_0xe486('0x13')]),_0x36bb33);if(_0x42ec58[_0xe486('0x12')][_0xe486('0x1f')]){_0x3f8a87[_0xe486('0x1d')]=_[_0xe486('0x20')](_0x3f8a87[_0xe486('0x1d')],{'$or':_[_0xe486('0xf')](_0x36bb33,function(_0x4dcb37){if(_0x4dcb37['type']!=='VIRTUAL'){var _0x1de61e={};_0x1de61e[_0x4dcb37[_0xe486('0xd')]]={'$like':'%'+_0x42ec58[_0xe486('0x12')][_0xe486('0x1f')]+'%'};return _0x1de61e;}})});}_0x3f8a87=_[_0xe486('0x20')]({},_0x3f8a87,_0x42ec58[_0xe486('0x21')]);var _0xfa0aaa={'where':_0x3f8a87[_0xe486('0x1d')]};return db[_0xe486('0x22')]['count'](_0xfa0aaa)['then'](function(_0xd7e7e7){_0x5a40de[_0xe486('0x7')]=_0xd7e7e7;if(_0x42ec58['query']['includeAll']){_0x3f8a87[_0xe486('0x23')]=[{'attributes':['id','name',_0xe486('0x24'),_0xe486('0x25')],'model':db[_0xe486('0x26')],'as':_0xe486('0x26')}];}return db[_0xe486('0x22')][_0xe486('0x27')](_0x3f8a87);})[_0xe486('0xa')](function(_0x2db37c){_0x5a40de[_0xe486('0x28')]=_0x2db37c;return _0x5a40de;})[_0xe486('0xa')](respondWithFilteredResult(_0x960c41,_0x3f8a87))['catch'](handleError(_0x960c41,null));};exports[_0xe486('0x29')]=function(_0x415e2b,_0x237bc2){var _0x4f933c={'raw':!![],'where':{'id':_0x415e2b[_0xe486('0x2a')]['id']}},_0x5f4273={};_0x5f4273[_0xe486('0x15')]=_[_0xe486('0x2b')](db[_0xe486('0x22')][_0xe486('0x2c')]);_0x5f4273[_0xe486('0x12')]=_[_0xe486('0x2b')](_0x415e2b[_0xe486('0x12')]);_0x5f4273[_0xe486('0x13')]=_['intersection'](_0x5f4273['model'],_0x5f4273[_0xe486('0x12')]);_0x4f933c[_0xe486('0x17')]=_[_0xe486('0x14')](_0x5f4273[_0xe486('0x15')],qs[_0xe486('0x16')](_0x415e2b[_0xe486('0x12')][_0xe486('0x16')]));_0x4f933c[_0xe486('0x17')]=_0x4f933c[_0xe486('0x17')][_0xe486('0x18')]?_0x4f933c[_0xe486('0x17')]:_0x5f4273[_0xe486('0x15')];if(_0x415e2b['query'][_0xe486('0x2d')]){_0x4f933c[_0xe486('0x23')]=[{'all':!![]}];}_0x4f933c=_[_0xe486('0x20')]({},_0x4f933c,_0x415e2b[_0xe486('0x21')]);return db[_0xe486('0x22')][_0xe486('0x2e')](_0x4f933c)[_0xe486('0xa')](handleEntityNotFound(_0x237bc2,null))[_0xe486('0xa')](respondWithResult(_0x237bc2,null))[_0xe486('0x2f')](handleError(_0x237bc2,null));};exports['create']=function(_0x451616,_0x204a66){return db[_0xe486('0x22')]['create'](_0x451616[_0xe486('0x30')],{})[_0xe486('0xa')](respondWithResult(_0x204a66,0xc9))[_0xe486('0x2f')](handleError(_0x204a66,null));};exports['destroy']=function(_0x1efba1,_0x41d623){return db[_0xe486('0x22')][_0xe486('0x2e')]({'where':{'id':_0x1efba1[_0xe486('0x2a')]['id']}})[_0xe486('0xa')](handleEntityNotFound(_0x41d623,null))[_0xe486('0xa')](removeEntity(_0x41d623,null))[_0xe486('0x2f')](handleError(_0x41d623,null));};exports[_0xe486('0x31')]=function(_0x3a0667,_0x498496){return db[_0xe486('0x22')][_0xe486('0x31')]()[_0xe486('0xa')](respondWithResult(_0x498496,null))[_0xe486('0x2f')](handleError(_0x498496,null));};function findForUpdate(_0x53cd9a){return db['VoiceCallReport'][_0xe486('0x2e')]({'where':{'uniqueid':_0x53cd9a['params']['id'],'UserId':{'$or':[null,_0x53cd9a[_0xe486('0x32')]['id']]}}});}exports['update']=function(_0x1f3d04,_0x596762){if(_0x1f3d04[_0xe486('0x30')][_0xe486('0x33')]){delete _0x1f3d04[_0xe486('0x30')][_0xe486('0x33')];}return findForUpdate(_0x1f3d04)[_0xe486('0xa')](handleEntityNotFound(_0x596762,null))['then'](saveUpdates(_0x1f3d04[_0xe486('0x30')],null))[_0xe486('0xa')](respondWithResult(_0x596762,null))[_0xe486('0x2f')](handleError(_0x596762,null));};exports['updateWithRetry']=function(_0x3242fd,_0x2bc2df,_0x3c17f8){if(_0x3242fd['body'][_0xe486('0x33')]){delete _0x3242fd[_0xe486('0x30')]['uniqueid'];}promiseRetry(function(){return findForUpdate(_0x3242fd);},{'retries':0x6,'minTimeout':0xfa})['then'](function(_0x3cabd9){if(!_0x3cabd9){return new Promise(function(_0x5d3d46){_0x5d3d46(handleEntityNotFound(_0x2bc2df)({'message':'No\x20such\x20Voice\x20Call\x20Report'}));});}else{return _0x3cabd9[_0xe486('0x9')](_0x3242fd['body'])[_0xe486('0xa')](function(_0x1d3ae1){return respondWithResult(_0x2bc2df)(_0x1d3ae1);});}},handleEntityNotFound(_0x2bc2df,null))[_0xe486('0x2f')](handleEntityNotFound(_0x2bc2df,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 566a07c..42b07b7 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 _0x25ed=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','define','report_call'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0x25ed,0x13f));var _0xd25e=function(_0x6bc26,_0x59d229){_0x6bc26=_0x6bc26-0x0;var _0x420728=_0x25ed[_0x6bc26];return _0x420728;};'use strict';var _=require(_0xd25e('0x0'));var util=require(_0xd25e('0x1'));var logger=require('../../config/logger')(_0xd25e('0x2'));var moment=require(_0xd25e('0x3'));var BPromise=require(_0xd25e('0x4'));var rp=require(_0xd25e('0x5'));var fs=require('fs');var path=require(_0xd25e('0x6'));var rimraf=require('rimraf');var config=require(_0xd25e('0x7'));var attributes=require(_0xd25e('0x8'));module['exports']=function(_0x3e582a,_0x403851){return _0x3e582a[_0xd25e('0x9')]('VoiceCallReport',attributes,{'tableName':_0xd25e('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9fd=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x28f2da,_0x52b7d6){var _0x1c3044=function(_0x27b3c3){while(--_0x27b3c3){_0x28f2da['push'](_0x28f2da['shift']());}};_0x1c3044(++_0x52b7d6);}(_0xb9fd,0x149));var _0xdb9f=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0xb9fd[_0x648163];return _0x199d4d;};'use strict';var _=require(_0xdb9f('0x0'));var util=require(_0xdb9f('0x1'));var logger=require('../../config/logger')(_0xdb9f('0x2'));var moment=require(_0xdb9f('0x3'));var BPromise=require(_0xdb9f('0x4'));var rp=require(_0xdb9f('0x5'));var fs=require('fs');var path=require(_0xdb9f('0x6'));var rimraf=require(_0xdb9f('0x7'));var config=require(_0xdb9f('0x8'));var attributes=require(_0xdb9f('0x9'));module[_0xdb9f('0xa')]=function(_0xac4ef7,_0x200e46){return _0xac4ef7[_0xdb9f('0xb')](_0xdb9f('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xdb9f('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 d3c9c57..354691f 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 _0x1404=['rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','limit','include','model','attributes','map','catch','CreateVoiceCallReport','body','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x1404,0x186));var _0x4140=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x1404[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x4140('0x0'));var util=require(_0x4140('0x1'));var moment=require(_0x4140('0x2'));var BPromise=require('bluebird');var rs=require(_0x4140('0x3'));var fs=require('fs');var Redis=require(_0x4140('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4140('0x5'));var logger=require('../../config/logger')(_0x4140('0x6'));var config=require(_0x4140('0x7'));var jayson=require(_0x4140('0x8'));var client=jayson[_0x4140('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d205b,_0x383ed1,_0x26811e){return new BPromise(function(_0x3d32ce,_0x31d486){return client[_0x4140('0xa')](_0x2d205b,_0x26811e)[_0x4140('0xb')](function(_0x2447f7){logger[_0x4140('0xc')](_0x4140('0xd'),_0x383ed1,_0x4140('0xe'));logger[_0x4140('0xf')](_0x4140('0x10'),_0x383ed1,_0x4140('0xe'),JSON[_0x4140('0x11')](_0x2447f7));if(_0x2447f7[_0x4140('0x12')]){if(_0x2447f7[_0x4140('0x12')]['code']===0x1f4){logger[_0x4140('0x12')](_0x4140('0xd'),_0x383ed1,_0x2447f7[_0x4140('0x12')][_0x4140('0x13')]);return _0x31d486(_0x2447f7['error']['message']);}logger[_0x4140('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x383ed1,_0x2447f7[_0x4140('0x12')]['message']);return _0x3d32ce(_0x2447f7[_0x4140('0x12')]['message']);}else{logger[_0x4140('0xc')](_0x4140('0xd'),_0x383ed1,'request\x20sent');_0x3d32ce(_0x2447f7[_0x4140('0x14')][_0x4140('0x13')]);}})['catch'](function(_0x75f12f){logger['error'](_0x4140('0xd'),_0x383ed1,_0x75f12f);_0x31d486(_0x75f12f);});});}exports[_0x4140('0x15')]=function(_0x581c81){var _0x4fa695=this;return new Promise(function(_0x5060d7,_0x213fe4){return db[_0x4140('0x16')][_0x4140('0x17')]({'raw':_0x581c81['options']?_0x581c81['options'][_0x4140('0x18')]===undefined?!![]:![]:!![],'where':_0x581c81[_0x4140('0x19')]?_0x581c81[_0x4140('0x19')][_0x4140('0x1a')]||null:null,'attributes':_0x581c81[_0x4140('0x19')]?_0x581c81['options']['attributes']||null:null,'limit':_0x581c81[_0x4140('0x19')]?_0x581c81['options'][_0x4140('0x1b')]||null:null,'include':_0x581c81[_0x4140('0x19')]?_0x581c81[_0x4140('0x19')][_0x4140('0x1c')]?_['map'](_0x581c81[_0x4140('0x19')][_0x4140('0x1c')],function(_0x268809){return{'model':db[_0x268809[_0x4140('0x1d')]],'as':_0x268809['as'],'attributes':_0x268809[_0x4140('0x1e')],'include':_0x268809[_0x4140('0x1c')]?_[_0x4140('0x1f')](_0x268809[_0x4140('0x1c')],function(_0x10c635){return{'model':db[_0x10c635[_0x4140('0x1d')]],'as':_0x10c635['as'],'attributes':_0x10c635['attributes'],'include':_0x10c635[_0x4140('0x1c')]?_['map'](_0x10c635[_0x4140('0x1c')],function(_0x224497){return{'model':db[_0x224497[_0x4140('0x1d')]],'as':_0x224497['as'],'attributes':_0x224497[_0x4140('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4140('0xb')](function(_0xd1d09e){logger[_0x4140('0xc')]('GetVoiceCallReport',_0x581c81);logger['debug'](_0x4140('0x15'),_0x581c81,JSON[_0x4140('0x11')](_0xd1d09e));_0x5060d7(_0xd1d09e);})[_0x4140('0x20')](function(_0x548bca){logger[_0x4140('0x12')](_0x4140('0x15'),_0x548bca['message'],_0x581c81);_0x213fe4(_0x4fa695[_0x4140('0x12')](0x1f4,_0x548bca[_0x4140('0x13')]));});});};exports[_0x4140('0x21')]=function(_0x3ea673){var _0x3a47c4=this;return new Promise(function(_0x4a2d60,_0x10a9f3){return db['VoiceCallReport']['create'](_0x3ea673[_0x4140('0x22')],{'raw':_0x3ea673[_0x4140('0x19')]?_0x3ea673[_0x4140('0x19')][_0x4140('0x18')]===undefined?!![]:![]:!![]})[_0x4140('0xb')](function(_0x382658){logger[_0x4140('0xc')](_0x4140('0x21'),_0x3ea673);logger['debug'](_0x4140('0x21'),_0x3ea673,JSON['stringify'](_0x382658));_0x4a2d60(_0x382658);})['catch'](function(_0x19f6fd){logger[_0x4140('0x12')]('CreateVoiceCallReport',_0x19f6fd['message'],_0x3ea673);_0x10a9f3(_0x3a47c4[_0x4140('0x12')](0x1f4,_0x19f6fd[_0x4140('0x13')]));});});};exports[_0x4140('0x23')]=function(_0x1e2580){var _0x52938d=this;return new Promise(function(_0x29d9e7,_0xf3a5cd){return db[_0x4140('0x16')]['update'](_0x1e2580['body'],{'raw':_0x1e2580['options']?_0x1e2580['options'][_0x4140('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2580[_0x4140('0x19')]?_0x1e2580['options'][_0x4140('0x1a')]||null:null,'attributes':_0x1e2580[_0x4140('0x19')]?_0x1e2580[_0x4140('0x19')]['attributes']||null:null,'limit':_0x1e2580[_0x4140('0x19')]?_0x1e2580[_0x4140('0x19')][_0x4140('0x1b')]||null:null})[_0x4140('0xb')](function(_0xb53eb2){logger[_0x4140('0xc')](_0x4140('0x23'),_0x1e2580);logger['debug'](_0x4140('0x23'),_0x1e2580,JSON['stringify'](_0xb53eb2));_0x29d9e7(_0xb53eb2);})['catch'](function(_0x6be7cd){logger[_0x4140('0x12')](_0x4140('0x23'),_0x6be7cd[_0x4140('0x13')],_0x1e2580);_0xf3a5cd(_0x52938d[_0x4140('0x12')](0x1f4,_0x6be7cd[_0x4140('0x13')]));});});}; \ No newline at end of file +var _0x2d7b=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport'];(function(_0x2fbdf8,_0x4a91ca){var _0x3ac8b3=function(_0x4c93bb){while(--_0x4c93bb){_0x2fbdf8['push'](_0x2fbdf8['shift']());}};_0x3ac8b3(++_0x4a91ca);}(_0x2d7b,0x1b8));var _0xb2d7=function(_0x4f8661,_0x18bdf4){_0x4f8661=_0x4f8661-0x0;var _0x2484ba=_0x2d7b[_0x4f8661];return _0x2484ba;};'use strict';var _=require(_0xb2d7('0x0'));var util=require('util');var moment=require(_0xb2d7('0x1'));var BPromise=require(_0xb2d7('0x2'));var rs=require(_0xb2d7('0x3'));var fs=require('fs');var Redis=require(_0xb2d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2d7('0x5'));var logger=require(_0xb2d7('0x6'))(_0xb2d7('0x7'));var config=require(_0xb2d7('0x8'));var jayson=require(_0xb2d7('0x9'));var client=jayson[_0xb2d7('0xa')][_0xb2d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fff70,_0x4cc945,_0x1a9780){return new BPromise(function(_0x32e131,_0x3ba0f2){return client[_0xb2d7('0xc')](_0x2fff70,_0x1a9780)[_0xb2d7('0xd')](function(_0x493574){logger[_0xb2d7('0xe')](_0xb2d7('0xf'),_0x4cc945,'request\x20sent');logger[_0xb2d7('0x10')](_0xb2d7('0x11'),_0x4cc945,_0xb2d7('0x12'),JSON[_0xb2d7('0x13')](_0x493574));if(_0x493574[_0xb2d7('0x14')]){if(_0x493574[_0xb2d7('0x14')][_0xb2d7('0x15')]===0x1f4){logger['error'](_0xb2d7('0xf'),_0x4cc945,_0x493574[_0xb2d7('0x14')][_0xb2d7('0x16')]);return _0x3ba0f2(_0x493574[_0xb2d7('0x14')]['message']);}logger['error'](_0xb2d7('0xf'),_0x4cc945,_0x493574['error']['message']);return _0x32e131(_0x493574[_0xb2d7('0x14')][_0xb2d7('0x16')]);}else{logger[_0xb2d7('0xe')](_0xb2d7('0xf'),_0x4cc945,_0xb2d7('0x12'));_0x32e131(_0x493574[_0xb2d7('0x17')][_0xb2d7('0x16')]);}})[_0xb2d7('0x18')](function(_0x2b627c){logger[_0xb2d7('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x4cc945,_0x2b627c);_0x3ba0f2(_0x2b627c);});});}exports['GetVoiceCallReport']=function(_0x59dcd7){var _0x19dfdf=this;return new Promise(function(_0xf97e3d,_0x458622){return db[_0xb2d7('0x19')][_0xb2d7('0x1a')]({'raw':_0x59dcd7[_0xb2d7('0x1b')]?_0x59dcd7[_0xb2d7('0x1b')][_0xb2d7('0x1c')]===undefined?!![]:![]:!![],'where':_0x59dcd7[_0xb2d7('0x1b')]?_0x59dcd7[_0xb2d7('0x1b')][_0xb2d7('0x1d')]||null:null,'attributes':_0x59dcd7[_0xb2d7('0x1b')]?_0x59dcd7[_0xb2d7('0x1b')][_0xb2d7('0x1e')]||null:null,'limit':_0x59dcd7[_0xb2d7('0x1b')]?_0x59dcd7['options'][_0xb2d7('0x1f')]||null:null,'include':_0x59dcd7[_0xb2d7('0x1b')]?_0x59dcd7[_0xb2d7('0x1b')][_0xb2d7('0x20')]?_[_0xb2d7('0x21')](_0x59dcd7[_0xb2d7('0x1b')]['include'],function(_0x59b8d0){return{'model':db[_0x59b8d0[_0xb2d7('0x22')]],'as':_0x59b8d0['as'],'attributes':_0x59b8d0[_0xb2d7('0x1e')],'include':_0x59b8d0['include']?_['map'](_0x59b8d0[_0xb2d7('0x20')],function(_0x17656b){return{'model':db[_0x17656b[_0xb2d7('0x22')]],'as':_0x17656b['as'],'attributes':_0x17656b[_0xb2d7('0x1e')],'include':_0x17656b['include']?_[_0xb2d7('0x21')](_0x17656b['include'],function(_0x602b95){return{'model':db[_0x602b95[_0xb2d7('0x22')]],'as':_0x602b95['as'],'attributes':_0x602b95[_0xb2d7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb2d7('0xd')](function(_0xbf95ff){logger[_0xb2d7('0xe')](_0xb2d7('0x23'),_0x59dcd7);logger[_0xb2d7('0x10')]('GetVoiceCallReport',_0x59dcd7,JSON['stringify'](_0xbf95ff));_0xf97e3d(_0xbf95ff);})['catch'](function(_0x591cea){logger[_0xb2d7('0x14')](_0xb2d7('0x23'),_0x591cea[_0xb2d7('0x16')],_0x59dcd7);_0x458622(_0x19dfdf['error'](0x1f4,_0x591cea[_0xb2d7('0x16')]));});});};exports[_0xb2d7('0x24')]=function(_0x115579){var _0x366b55=this;return new Promise(function(_0x2ded48,_0x2ebe4e){return db['VoiceCallReport'][_0xb2d7('0x25')](_0x115579[_0xb2d7('0x26')],{'raw':_0x115579[_0xb2d7('0x1b')]?_0x115579['options'][_0xb2d7('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x58f110){logger[_0xb2d7('0xe')](_0xb2d7('0x24'),_0x115579);logger['debug']('CreateVoiceCallReport',_0x115579,JSON[_0xb2d7('0x13')](_0x58f110));_0x2ded48(_0x58f110);})[_0xb2d7('0x18')](function(_0x271a13){logger[_0xb2d7('0x14')](_0xb2d7('0x24'),_0x271a13['message'],_0x115579);_0x2ebe4e(_0x366b55['error'](0x1f4,_0x271a13[_0xb2d7('0x16')]));});});};exports['UpdateVoiceCallReport']=function(_0x2d62e8){var _0x35fa68=this;return new Promise(function(_0x4fd194,_0xc67525){return db[_0xb2d7('0x19')]['update'](_0x2d62e8[_0xb2d7('0x26')],{'raw':_0x2d62e8['options']?_0x2d62e8[_0xb2d7('0x1b')][_0xb2d7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d62e8[_0xb2d7('0x1b')]?_0x2d62e8['options'][_0xb2d7('0x1d')]||null:null,'attributes':_0x2d62e8[_0xb2d7('0x1b')]?_0x2d62e8[_0xb2d7('0x1b')][_0xb2d7('0x1e')]||null:null,'limit':_0x2d62e8['options']?_0x2d62e8['options'][_0xb2d7('0x1f')]||null:null})[_0xb2d7('0xd')](function(_0xdd59dd){logger[_0xb2d7('0xe')]('UpdateVoiceCallReport',_0x2d62e8);logger[_0xb2d7('0x10')](_0xb2d7('0x27'),_0x2d62e8,JSON[_0xb2d7('0x13')](_0xdd59dd));_0x4fd194(_0xdd59dd);})[_0xb2d7('0x18')](function(_0x1345b4){logger[_0xb2d7('0x14')](_0xb2d7('0x27'),_0x1345b4[_0xb2d7('0x16')],_0x2d62e8);_0xc67525(_0x35fa68['error'](0x1f4,_0x1345b4[_0xb2d7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 073996f..975f423 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 _0xadcc=['../../components/interaction/service','./voiceChanSpy.controller','index','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xadcc,0x11b));var _0xcadc=function(_0x25bde2,_0x141d3a){_0x25bde2=_0x25bde2-0x0;var _0x3dc1d7=_0xadcc[_0x25bde2];return _0x3dc1d7;};'use strict';var multer=require(_0xcadc('0x0'));var util=require(_0xcadc('0x1'));var path=require(_0xcadc('0x2'));var timeout=require('connect-timeout');var express=require(_0xcadc('0x3'));var router=express[_0xcadc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcadc('0x5'));var interaction=require(_0xcadc('0x6'));var config=require('../../config/environment');var controller=require(_0xcadc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcadc('0x8')]);router['get'](_0xcadc('0x9'),auth[_0xcadc('0xa')](),controller[_0xcadc('0xb')]);router[_0xcadc('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcadc('0xd')](_0xcadc('0x9'),auth['isAuthenticated'](),controller[_0xcadc('0xe')]);router['delete'](_0xcadc('0x9'),auth[_0xcadc('0xa')](),controller[_0xcadc('0xf')]);module[_0xcadc('0x10')]=router; \ No newline at end of file +var _0xfd1a=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','update','delete'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xfd1a,0xda));var _0xafd1=function(_0x138d1d,_0x245af7){_0x138d1d=_0x138d1d-0x0;var _0x342708=_0xfd1a[_0x138d1d];return _0x342708;};'use strict';var multer=require('multer');var util=require(_0xafd1('0x0'));var path=require(_0xafd1('0x1'));var timeout=require(_0xafd1('0x2'));var express=require('express');var router=express[_0xafd1('0x3')]();var fs_extra=require(_0xafd1('0x4'));var auth=require(_0xafd1('0x5'));var interaction=require(_0xafd1('0x6'));var config=require(_0xafd1('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xafd1('0x8')]('/',auth['isAuthenticated'](),controller[_0xafd1('0x9')]);router[_0xafd1('0x8')](_0xafd1('0xa'),auth[_0xafd1('0xb')](),controller[_0xafd1('0xc')]);router[_0xafd1('0xd')]('/',auth[_0xafd1('0xb')](),controller['create']);router['put'](_0xafd1('0xa'),auth[_0xafd1('0xb')](),controller[_0xafd1('0xe')]);router[_0xafd1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xafd1('0x10')]);module[_0xafd1('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 82c3f52..1564ece 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 _0x565e=['setDataValue','join','options','split','BOOLEAN','STRING'];(function(_0x37e342,_0x160c8f){var _0x1768f9=function(_0x413c98){while(--_0x413c98){_0x37e342['push'](_0x37e342['shift']());}};_0x1768f9(++_0x160c8f);}(_0x565e,0x1a3));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe565('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xe565('0x0')],'set':function(_0x45483c){this[_0xe565('0x1')]('options',_0x45483c?_0x45483c[_0xe565('0x2')](''):[]);},'get':function(){return this['getDataValue'](_0xe565('0x3'))?this['getDataValue'](_0xe565('0x3'))[_0xe565('0x4')](''):[];}},'auth':{'type':Sequelize[_0xe565('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0xe565('0x0')]},'record':{'type':Sequelize[_0xe565('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe565('0x0')]}}; \ No newline at end of file +var _0x2428=['BOOLEAN','STRING','sequelize','name','setDataValue','join','getDataValue','options','split'];(function(_0x365de6,_0x3f7e16){var _0xc448f4=function(_0x356078){while(--_0x356078){_0x365de6['push'](_0x365de6['shift']());}};_0xc448f4(++_0x3f7e16);}(_0x2428,0xe3));var _0x8242=function(_0x1e2600,_0x252e71){_0x1e2600=_0x1e2600-0x0;var _0x5e4423=_0x2428[_0x1e2600];return _0x5e4423;};'use strict';var Sequelize=require(_0x8242('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x8242('0x1'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x59e855){this[_0x8242('0x2')]('options',_0x59e855?_0x59e855[_0x8242('0x3')](''):[]);},'get':function(){return this[_0x8242('0x4')](_0x8242('0x5'))?this[_0x8242('0x4')](_0x8242('0x5'))[_0x8242('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x8242('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8242('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 206d772..a61d5fb 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 _0x76dc=['where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','VoiceChanSpy','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0x76dc,0x1f2));var _0xc76d=function(_0x54bfb2,_0x41af28){_0x54bfb2=_0x54bfb2-0x0;var _0x2aa61b=_0x76dc[_0x54bfb2];return _0x2aa61b;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['VoiceChanSpy']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['VoiceChanSpy']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));}; \ No newline at end of file +var _0xf290=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','ChanSpies','UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4e82f6,_0x3a1b7d){var _0x2ec7da=function(_0x55ef91){while(--_0x55ef91){_0x4e82f6['push'](_0x4e82f6['shift']());}};_0x2ec7da(++_0x3a1b7d);}(_0xf290,0xde));var _0x0f29=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xf290[_0x179c4a];return _0x5d1879;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){var _0x5a440f=_0x29ca73[_0x0f29('0x25')]({'plain':!![]});var _0x26f46f=_0x0f29('0x26');return db[_0x0f29('0x27')]['destroy']({'where':{'type':_0x26f46f,'resourceId':_0x5a440f['id']}})[_0x0f29('0x24')](function(){return _0x29ca73;});})['then'](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x5c0202,_0x5bfcac){return function(_0x57dcc7){if(!_0x57dcc7){_0x5c0202['sendStatus'](0x194);}return _0x57dcc7;};}function handleError(_0x3c6ce9,_0x1f4ad2){_0x1f4ad2=_0x1f4ad2||0x1f4;return function(_0x4cc5a0){logger[_0x0f29('0x28')](_0x4cc5a0[_0x0f29('0x29')]);if(_0x4cc5a0[_0x0f29('0x2a')]){delete _0x4cc5a0['name'];}_0x3c6ce9['status'](_0x1f4ad2)[_0x0f29('0x2b')](_0x4cc5a0);};}exports['index']=function(_0x36b65c,_0x561c31){var _0x526364={},_0x7b10f={},_0x409b19={'count':0x0,'rows':[]};var _0xf59431=_[_0x0f29('0x2c')](db['VoiceChanSpy']['rawAttributes'],function(_0x3bb3c8){return{'name':_0x3bb3c8['fieldName'],'type':_0x3bb3c8['type'][_0x0f29('0x2d')]};});_0x7b10f['model']=_[_0x0f29('0x2c')](_0xf59431,'name');_0x7b10f['query']=_[_0x0f29('0x2e')](_0x36b65c[_0x0f29('0x2f')]);_0x7b10f[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x7b10f[_0x0f29('0x32')],_0x7b10f['query']);_0x526364[_0x0f29('0x33')]=_['intersection'](_0x7b10f[_0x0f29('0x32')],qs[_0x0f29('0x34')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x34')]));_0x526364['attributes']=_0x526364[_0x0f29('0x33')][_0x0f29('0x35')]?_0x526364['attributes']:_0x7b10f[_0x0f29('0x32')];if(!_0x36b65c[_0x0f29('0x2f')]['hasOwnProperty']('nolimit')){_0x526364[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x1f')]);_0x526364[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x36b65c['query'][_0x0f29('0x1d')]);}_0x526364['order']=qs[_0x0f29('0x36')](_0x36b65c['query'][_0x0f29('0x36')]);_0x526364[_0x0f29('0x37')]=qs[_0x0f29('0x30')](_['pick'](_0x36b65c['query'],_0x7b10f[_0x0f29('0x30')]),_0xf59431);if(_0x36b65c['query'][_0x0f29('0x38')]){_0x526364[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x526364[_0x0f29('0x37')],{'$or':_[_0x0f29('0x2c')](_0xf59431,function(_0x5afbb8){if(_0x5afbb8[_0x0f29('0x3a')]!==_0x0f29('0x3b')){var _0x42872b={};_0x42872b[_0x5afbb8[_0x0f29('0x2a')]]={'$like':'%'+_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x38')]+'%'};return _0x42872b;}})});}_0x526364=_[_0x0f29('0x39')]({},_0x526364,_0x36b65c[_0x0f29('0x3c')]);var _0x250b20={'where':_0x526364['where']};return db[_0x0f29('0x3d')][_0x0f29('0x20')](_0x250b20)[_0x0f29('0x24')](function(_0x11b1dc){_0x409b19['count']=_0x11b1dc;if(_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x526364[_0x0f29('0x3f')]=[{'all':!![]}];}return db[_0x0f29('0x3d')][_0x0f29('0x40')](_0x526364);})['then'](function(_0x410c59){_0x409b19[_0x0f29('0x41')]=_0x410c59;return _0x409b19;})[_0x0f29('0x24')](respondWithFilteredResult(_0x561c31,_0x526364))['catch'](handleError(_0x561c31,null));};exports[_0x0f29('0x42')]=function(_0x284279,_0x3a6479){var _0x338412={'raw':![],'where':{'id':_0x284279[_0x0f29('0x43')]['id']}},_0x35f753={};_0x35f753[_0x0f29('0x32')]=_[_0x0f29('0x2e')](db['VoiceChanSpy']['rawAttributes']);_0x35f753['query']=_[_0x0f29('0x2e')](_0x284279[_0x0f29('0x2f')]);_0x35f753[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x35f753[_0x0f29('0x32')],_0x35f753[_0x0f29('0x2f')]);_0x338412['attributes']=_[_0x0f29('0x31')](_0x35f753['model'],qs[_0x0f29('0x34')](_0x284279['query'][_0x0f29('0x34')]));_0x338412[_0x0f29('0x33')]=_0x338412[_0x0f29('0x33')][_0x0f29('0x35')]?_0x338412[_0x0f29('0x33')]:_0x35f753['model'];if(_0x284279[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x338412[_0x0f29('0x3f')]=[{'all':!![]}];}_0x338412=_['merge']({},_0x338412,_0x284279[_0x0f29('0x3c')]);return db['VoiceChanSpy']['find'](_0x338412)[_0x0f29('0x24')](handleEntityNotFound(_0x3a6479,null))[_0x0f29('0x24')](respondWithResult(_0x3a6479,null))[_0x0f29('0x44')](handleError(_0x3a6479,null));};exports[_0x0f29('0x45')]=function(_0x20aa53,_0x335435){return db['VoiceChanSpy'][_0x0f29('0x45')](_0x20aa53[_0x0f29('0x46')],{})[_0x0f29('0x24')](function(_0x857564){var _0x2455d2=_0x20aa53[_0x0f29('0x47')][_0x0f29('0x25')]({'plain':!![]});if(!_0x2455d2)throw new Error(_0x0f29('0x48'));if(_0x2455d2[_0x0f29('0x49')]===_0x0f29('0x47')){var _0x5cd4a9=_0x857564['get']({'plain':!![]});var _0xa6231e=_0x0f29('0x26');return db[_0x0f29('0x4a')][_0x0f29('0x4b')]({'where':{'name':_0xa6231e,'userProfileId':_0x2455d2['userProfileId']},'raw':!![]})[_0x0f29('0x24')](function(_0xd624ad){if(_0xd624ad&&_0xd624ad[_0x0f29('0x4c')]===0x0){return db[_0x0f29('0x27')][_0x0f29('0x45')]({'name':_0x5cd4a9[_0x0f29('0x2a')],'resourceId':_0x5cd4a9['id'],'type':_0xd624ad[_0x0f29('0x2a')],'sectionId':_0xd624ad['id']},{})['then'](function(){return _0x857564;});}else{return _0x857564;}})[_0x0f29('0x44')](function(_0x6c1800){logger[_0x0f29('0x28')](_0x0f29('0x4d'),_0x6c1800);throw _0x6c1800;});}return _0x857564;})[_0x0f29('0x24')](respondWithResult(_0x335435,0xc9))[_0x0f29('0x44')](handleError(_0x335435,null));};exports['update']=function(_0x8c9780,_0x45d87c){if(_0x8c9780[_0x0f29('0x46')]['id']){delete _0x8c9780['body']['id'];}return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x8c9780[_0x0f29('0x43')]['id']}})['then'](handleEntityNotFound(_0x45d87c,null))[_0x0f29('0x24')](saveUpdates(_0x8c9780[_0x0f29('0x46')],null))['then'](respondWithResult(_0x45d87c,null))[_0x0f29('0x44')](handleError(_0x45d87c,null));};exports[_0x0f29('0x4e')]=function(_0x4ae30,_0x4a2c08){return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x4ae30[_0x0f29('0x43')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x4a2c08,null))['then'](removeEntity(_0x4a2c08,null))[_0x0f29('0x44')](handleError(_0x4a2c08,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ce21e87..609d3f2 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 _0xbce7=['chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','CDR(type)=%s'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xbce7,0x142));var _0x7bce=function(_0x7971bd,_0x1d2627){_0x7971bd=_0x7971bd-0x0;var _0x44a885=_0xbce7[_0x7971bd];return _0x44a885;};'use strict';var _=require(_0x7bce('0x0'));var util=require(_0x7bce('0x1'));var BPromise=require(_0x7bce('0x2'));var attributes=require(_0x7bce('0x3'));var getUserApplications=function(_0x5d3d86,_0x534b8b,_0x5774c6){var _0x31c3f1=0x1;var _0xd411e2=[];var _0x2a03b0={'context':_0x534b8b[_0x7bce('0x4')]||_0x7bce('0x5'),'exten':util[_0x7bce('0x6')]('%s%s',_0x5d3d86[_0x7bce('0x7')],_0x5774c6),'type':_0x7bce('0x8'),'isApp':![],'ChanSpyId':_0x5d3d86['id'],'UserId':_0x534b8b['id']};_0xd411e2[_0x7bce('0x9')](_['merge']({'app':'Set','appdata':util['format'](_0x7bce('0xa'),_0x7bce('0xb')),'priority':_0x31c3f1++},_0x2a03b0));if(_0x5d3d86[_0x7bce('0xc')]){_0xd411e2[_0x7bce('0x9')](_[_0x7bce('0xd')]({'app':_0x7bce('0xe'),'appdata':util[_0x7bce('0x6')](_0x7bce('0xf'),_0x5d3d86[_0x7bce('0x10')]),'priority':_0x31c3f1++},_0x2a03b0));}if(_0x5d3d86[_0x7bce('0x11')]){_0xd411e2[_0x7bce('0x9')](_['merge']({'app':_0x7bce('0x12'),'appdata':_0x5d3d86['password'],'priority':_0x31c3f1++},_0x2a03b0));}_0xd411e2[_0x7bce('0x9')](_[_0x7bce('0xd')]({'app':_0x7bce('0x13'),'appdata':util[_0x7bce('0x6')]('SIP/%s,%s',_0x534b8b['name'],_0x5d3d86[_0x7bce('0x14')]?_0x5d3d86[_0x7bce('0x14')][_0x7bce('0x15')](''):''),'priority':_0x31c3f1++},_0x2a03b0));if(_0x5d3d86[_0x7bce('0xc')]){_0xd411e2[_0x7bce('0x9')](_['merge']({'app':_0x7bce('0x16'),'priority':_0x31c3f1++},_0x2a03b0));}return _0xd411e2;};var getChanSpyApplications=function(_0x68f526,_0x32dd09){var _0x15ff4c=[];for(var _0x544ee8=0x0,_0x30ee62=0x1;_0x544ee8<_0x32dd09[_0x7bce('0x17')];_0x544ee8++,_0x30ee62=0x1){_0x15ff4c=_0x15ff4c[_0x7bce('0x18')](getUserApplications(_0x68f526,_0x32dd09[_0x544ee8],_0x32dd09[_0x544ee8]['internal']));if(_0x32dd09[_0x544ee8][_0x7bce('0x19')]!=_0x32dd09[_0x544ee8][_0x7bce('0x1a')]){_0x15ff4c=_0x15ff4c['concat'](getUserApplications(_0x68f526,_0x32dd09[_0x544ee8],_0x32dd09[_0x544ee8][_0x7bce('0x1a')]));}}return _0x15ff4c;};var getChanSpyPromise=function(_0x5ecb74,_0x108219){return new BPromise(function(_0x2f11a2,_0x18ff50){return _0x5ecb74[_0x7bce('0x1b')][_0x7bce('0x1c')]({'attributes':['id',_0x7bce('0x1a'),_0x7bce('0x19')],'where':{'role':_0x7bce('0x1d'),'chanspy':!![]},'raw':!![]})[_0x7bce('0x1e')](function(_0x46a2a4){if(_0x46a2a4){return _0x2f11a2(getChanSpyApplications(_0x108219,_0x46a2a4));}return _0x2f11a2([]);})[_0x7bce('0x1f')](function(_0x366a3c){_0x18ff50(_0x366a3c);});});};module[_0x7bce('0x20')]=function(_0x53b9ec,_0x58812b){var _0x55dbbe=_0x53b9ec['models'];return _0x53b9ec['define'](_0x7bce('0x21'),attributes,{'tableName':_0x7bce('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5899db,_0x59d68f,_0x2b5474){return getChanSpyPromise(_0x55dbbe,_0x5899db)[_0x7bce('0x1e')](function(_0xbcce3a){if(_0xbcce3a&&_0xbcce3a[_0x7bce('0x17')]){return _0x55dbbe[_0x7bce('0x23')]['bulkCreate'](_0xbcce3a);}})['then'](function(){_0x2b5474();})[_0x7bce('0x1f')](function(_0xec8b30){_0x2b5474(_0xec8b30);});},'afterUpdate':function(_0x56da6e,_0x501675,_0xd6a4fb){return _0x55dbbe['VoiceExtension'][_0x7bce('0x24')]({'where':{'ChanSpyId':_0x56da6e['id']}})['then'](function(){return getChanSpyPromise(_0x55dbbe,_0x56da6e);})[_0x7bce('0x1e')](function(_0x461151){if(_0x461151&&_0x461151['length']){return _0x55dbbe['VoiceExtension']['bulkCreate'](_0x461151);}})[_0x7bce('0x1e')](function(){_0xd6a4fb();})['catch'](function(_0x3025ee){_0xd6a4fb(_0x3025ee);});},'afterDestroy':function(_0x7b67e4,_0x18c9ff,_0x267800){return _0x55dbbe[_0x7bce('0x23')]['destroy']({'where':{'ChanSpyId':_0x7b67e4['id']}})[_0x7bce('0x1e')](function(){_0x267800();})[_0x7bce('0x1f')](function(_0x5a4c41){_0x267800(_0x5a4c41);});}}});}; \ No newline at end of file +var _0xc35e=['CDR(type)=%s','chanspy','merge','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','format'];(function(_0x12412b,_0x4a3583){var _0x52e0c8=function(_0x4d1b55){while(--_0x4d1b55){_0x12412b['push'](_0x12412b['shift']());}};_0x52e0c8(++_0x4a3583);}(_0xc35e,0x166));var _0xec35=function(_0x1ba865,_0x110d26){_0x1ba865=_0x1ba865-0x0;var _0x35a964=_0xc35e[_0x1ba865];return _0x35a964;};'use strict';var _=require(_0xec35('0x0'));var util=require(_0xec35('0x1'));var BPromise=require(_0xec35('0x2'));var attributes=require(_0xec35('0x3'));var getUserApplications=function(_0x5aab9a,_0xffce28,_0x308d6e){var _0x52caca=0x1;var _0x3a3b29=[];var _0x1fee46={'context':_0xffce28[_0xec35('0x4')]||_0xec35('0x5'),'exten':util['format'](_0xec35('0x6'),_0x5aab9a[_0xec35('0x7')],_0x308d6e),'type':_0xec35('0x8'),'isApp':![],'ChanSpyId':_0x5aab9a['id'],'UserId':_0xffce28['id']};_0x3a3b29[_0xec35('0x9')](_['merge']({'app':'Set','appdata':util[_0xec35('0xa')](_0xec35('0xb'),_0xec35('0xc')),'priority':_0x52caca++},_0x1fee46));if(_0x5aab9a['record']){_0x3a3b29['push'](_[_0xec35('0xd')]({'app':'MixMonitor','appdata':util[_0xec35('0xa')](_0xec35('0xe'),_0x5aab9a[_0xec35('0xf')]),'priority':_0x52caca++},_0x1fee46));}if(_0x5aab9a[_0xec35('0x10')]){_0x3a3b29[_0xec35('0x9')](_['merge']({'app':'Authenticate','appdata':_0x5aab9a[_0xec35('0x11')],'priority':_0x52caca++},_0x1fee46));}_0x3a3b29['push'](_[_0xec35('0xd')]({'app':_0xec35('0x12'),'appdata':util[_0xec35('0xa')](_0xec35('0x13'),_0xffce28[_0xec35('0x14')],_0x5aab9a[_0xec35('0x15')]?_0x5aab9a[_0xec35('0x15')][_0xec35('0x16')](''):''),'priority':_0x52caca++},_0x1fee46));if(_0x5aab9a[_0xec35('0x17')]){_0x3a3b29[_0xec35('0x9')](_[_0xec35('0xd')]({'app':_0xec35('0x18'),'priority':_0x52caca++},_0x1fee46));}return _0x3a3b29;};var getChanSpyApplications=function(_0xf490bc,_0x3fbfff){var _0x4918fd=[];for(var _0x37d7bb=0x0,_0x1713f3=0x1;_0x37d7bb<_0x3fbfff[_0xec35('0x19')];_0x37d7bb++,_0x1713f3=0x1){_0x4918fd=_0x4918fd[_0xec35('0x1a')](getUserApplications(_0xf490bc,_0x3fbfff[_0x37d7bb],_0x3fbfff[_0x37d7bb]['internal']));if(_0x3fbfff[_0x37d7bb][_0xec35('0x1b')]!=_0x3fbfff[_0x37d7bb]['name']){_0x4918fd=_0x4918fd[_0xec35('0x1a')](getUserApplications(_0xf490bc,_0x3fbfff[_0x37d7bb],_0x3fbfff[_0x37d7bb]['name']));}}return _0x4918fd;};var getChanSpyPromise=function(_0xf01cbe,_0x2d5c7d){return new BPromise(function(_0x4075f1,_0x5a5efd){return _0xf01cbe[_0xec35('0x1c')][_0xec35('0x1d')]({'attributes':['id',_0xec35('0x14'),_0xec35('0x1b')],'where':{'role':_0xec35('0x1e'),'chanspy':!![]},'raw':!![]})[_0xec35('0x1f')](function(_0x577af1){if(_0x577af1){return _0x4075f1(getChanSpyApplications(_0x2d5c7d,_0x577af1));}return _0x4075f1([]);})[_0xec35('0x20')](function(_0x5bc2db){_0x5a5efd(_0x5bc2db);});});};module[_0xec35('0x21')]=function(_0x5d8a2b,_0x591eef){var _0x385882=_0x5d8a2b[_0xec35('0x22')];return _0x5d8a2b[_0xec35('0x23')](_0xec35('0x24'),attributes,{'tableName':_0xec35('0x25'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e5fa0,_0x5c9181,_0x479563){return getChanSpyPromise(_0x385882,_0x1e5fa0)['then'](function(_0x3a8fbe){if(_0x3a8fbe&&_0x3a8fbe[_0xec35('0x19')]){return _0x385882[_0xec35('0x26')]['bulkCreate'](_0x3a8fbe);}})[_0xec35('0x1f')](function(){_0x479563();})[_0xec35('0x20')](function(_0x33ffe6){_0x479563(_0x33ffe6);});},'afterUpdate':function(_0x165d79,_0x1aee95,_0x517195){return _0x385882['VoiceExtension'][_0xec35('0x27')]({'where':{'ChanSpyId':_0x165d79['id']}})['then'](function(){return getChanSpyPromise(_0x385882,_0x165d79);})[_0xec35('0x1f')](function(_0x316b54){if(_0x316b54&&_0x316b54[_0xec35('0x19')]){return _0x385882[_0xec35('0x26')][_0xec35('0x28')](_0x316b54);}})[_0xec35('0x1f')](function(){_0x517195();})[_0xec35('0x20')](function(_0xb8f290){_0x517195(_0xb8f290);});},'afterDestroy':function(_0x41bc06,_0x3d1c03,_0x5ac9e2){return _0x385882[_0xec35('0x26')]['destroy']({'where':{'ChanSpyId':_0x41bc06['id']}})[_0xec35('0x1f')](function(){_0x5ac9e2();})[_0xec35('0x20')](function(_0x1f0184){_0x5ac9e2(_0x1f0184);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index bc0a992..288c159 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 _0xc3fe=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xc3fe,0xff));var _0xec3f=function(_0x405aed,_0x44cc54){_0x405aed=_0x405aed-0x0;var _0x1e9703=_0xc3fe[_0x405aed];return _0x1e9703;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});} \ No newline at end of file +var _0x3eec=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','VoiceChanSpy,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x5d6ff9,_0x467555){_0x5d6ff9=_0x5d6ff9-0x0;var _0x2a43b1=_0x3eec[_0x5d6ff9];return _0x2a43b1;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 945fa58..17cdcc8 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 _0x2a4a=['connect-timeout','express','../../config/environment','./voiceContext.controller','isAuthenticated','index','show','create','put','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x307cac,_0x48f1a3){var _0x167076=function(_0x5bc23b){while(--_0x5bc23b){_0x307cac['push'](_0x307cac['shift']());}};_0x167076(++_0x48f1a3);}(_0x2a4a,0x195));var _0xa2a4=function(_0x57e2f0,_0x20e3aa){_0x57e2f0=_0x57e2f0-0x0;var _0x47b356=_0x2a4a[_0x57e2f0];return _0x47b356;};'use strict';var multer=require(_0xa2a4('0x0'));var util=require(_0xa2a4('0x1'));var path=require(_0xa2a4('0x2'));var timeout=require(_0xa2a4('0x3'));var express=require(_0xa2a4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa2a4('0x5'));var controller=require(_0xa2a4('0x6'));router['get']('/',auth[_0xa2a4('0x7')](),controller[_0xa2a4('0x8')]);router['get']('/:id',auth[_0xa2a4('0x7')](),controller[_0xa2a4('0x9')]);router['post']('/',auth[_0xa2a4('0x7')](),controller[_0xa2a4('0xa')]);router[_0xa2a4('0xb')]('/:id',auth[_0xa2a4('0x7')](),controller[_0xa2a4('0xc')]);router[_0xa2a4('0xd')](_0xa2a4('0xe'),auth[_0xa2a4('0x7')](),controller[_0xa2a4('0xf')]);module[_0xa2a4('0x10')]=router; \ No newline at end of file +var _0xab10=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete'];(function(_0x3164d3,_0x20619b){var _0x5ad102=function(_0xa29da5){while(--_0xa29da5){_0x3164d3['push'](_0x3164d3['shift']());}};_0x5ad102(++_0x20619b);}(_0xab10,0x9a));var _0x0ab1=function(_0x5a16cd,_0x25a6f0){_0x5a16cd=_0x5a16cd-0x0;var _0x484083=_0xab10[_0x5a16cd];return _0x484083;};'use strict';var multer=require(_0x0ab1('0x0'));var util=require('util');var path=require(_0x0ab1('0x1'));var timeout=require(_0x0ab1('0x2'));var express=require('express');var router=express[_0x0ab1('0x3')]();var fs_extra=require(_0x0ab1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ab1('0x5'));var config=require(_0x0ab1('0x6'));var controller=require(_0x0ab1('0x7'));router['get']('/',auth[_0x0ab1('0x8')](),controller['index']);router[_0x0ab1('0x9')]('/:id',auth[_0x0ab1('0x8')](),controller[_0x0ab1('0xa')]);router[_0x0ab1('0xb')]('/',auth[_0x0ab1('0x8')](),controller[_0x0ab1('0xc')]);router[_0x0ab1('0xd')](_0x0ab1('0xe'),auth[_0x0ab1('0x8')](),controller[_0x0ab1('0xf')]);router[_0x0ab1('0x10')](_0x0ab1('0xe'),auth[_0x0ab1('0x8')](),controller[_0x0ab1('0x11')]);module[_0x0ab1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c45c5c8..93803f3 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 _0x0e2e=['STRING','name','BOOLEAN','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0e2e,0x1b7));var _0xe0e2=function(_0x5f250a,_0x7e142d){_0x5f250a=_0x5f250a-0x0;var _0x39287d=_0x0e2e[_0x5f250a];return _0x39287d;};'use strict';var Sequelize=require('sequelize');module[_0xe0e2('0x0')]={'name':{'type':Sequelize[_0xe0e2('0x1')],'unique':_0xe0e2('0x2')},'description':{'type':Sequelize[_0xe0e2('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe0e2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x579c=['STRING','name','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x579c,0x1f4));var _0xc579=function(_0x3716e6,_0x1a51df){_0x3716e6=_0x3716e6-0x0;var _0xd06104=_0x579c[_0x3716e6];return _0xd06104;};'use strict';var Sequelize=require(_0xc579('0x0'));module['exports']={'name':{'type':Sequelize[_0xc579('0x1')],'unique':_0xc579('0x2')},'description':{'type':Sequelize[_0xc579('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index d446043..31ae981 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 _0x8d19=['Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','writeFileSync','Reload','findAll','rimraf','fast-json-patch','bluebird','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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','stringify','error','code','message','result','catch','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','send','map','VoiceContext','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','params','keys','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','role','user'];(function(_0x39e79f,_0x294e56){var _0x293ced=function(_0x30e862){while(--_0x30e862){_0x39e79f['push'](_0x39e79f['shift']());}};_0x293ced(++_0x294e56);}(_0x8d19,0xc9));var _0x98d1=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0x8d19[_0x503cd5];return _0x1fdf1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98d1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98d1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x98d1('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x98d1('0x3'));var csv=require(_0x98d1('0x4'));var ejs=require(_0x98d1('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98d1('0x6'));var squel=require(_0x98d1('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x98d1('0x8'));var toCsv=require(_0x98d1('0x4'));var querystring=require(_0x98d1('0x9'));var Papa=require(_0x98d1('0xa'));var Redis=require(_0x98d1('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x98d1('0xc'));var hardwareService=require(_0x98d1('0xd'));var logger=require(_0x98d1('0xe'))(_0x98d1('0xf'));var utils=require(_0x98d1('0x10'));var config=require(_0x98d1('0x11'));var licenseUtil=require(_0x98d1('0x12'));var db=require(_0x98d1('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d144a,_0x2f4b99,_0x51e9da,_0x2fc9c0){return new BPromise(function(_0xe1f6c9,_0xfd8c8c){var _0x5b5f2a=_0x2fc9c0||client;return _0x5b5f2a[_0x98d1('0x14')](_0x2d144a,_0x51e9da)[_0x98d1('0x15')](function(_0x2565c3){logger[_0x98d1('0x16')](_0x98d1('0x17'),_0x2f4b99,_0x98d1('0x18'));logger[_0x98d1('0x19')](_0x98d1('0x1a'),_0x2f4b99,_0x98d1('0x18'),JSON[_0x98d1('0x1b')](_0x2565c3));if(_0x2565c3[_0x98d1('0x1c')]){if(_0x2565c3[_0x98d1('0x1c')][_0x98d1('0x1d')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2f4b99,_0x2565c3[_0x98d1('0x1c')]['message']);return _0xfd8c8c(_0x2565c3[_0x98d1('0x1c')][_0x98d1('0x1e')]);}logger[_0x98d1('0x1c')](_0x98d1('0x17'),_0x2f4b99,_0x2565c3[_0x98d1('0x1c')]['message']);return _0xe1f6c9(_0x2565c3['error'][_0x98d1('0x1e')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x2f4b99,_0x98d1('0x18'));_0xe1f6c9(_0x2565c3[_0x98d1('0x1f')]['message']);}})[_0x98d1('0x20')](function(_0xd8e6be){logger['error'](_0x98d1('0x17'),_0x2f4b99,_0xd8e6be);_0xfd8c8c(_0xd8e6be);});});}function respondWithStatusCode(_0x1e2417,_0x5dd223){_0x5dd223=_0x5dd223||0xcc;return function(_0x425230){if(_0x425230){return _0x1e2417['sendStatus'](_0x5dd223);}return _0x1e2417['status'](_0x5dd223)[_0x98d1('0x21')]();};}function respondWithResult(_0x2e1231,_0x56ef70){_0x56ef70=_0x56ef70||0xc8;return function(_0x4b5f2c){if(_0x4b5f2c){return _0x2e1231[_0x98d1('0x22')](_0x56ef70)[_0x98d1('0x23')](_0x4b5f2c);}};}function respondWithFilteredResult(_0x11f0fd,_0x1b7c27){return function(_0x511f93){if(_0x511f93){var _0x87ccc5=typeof _0x1b7c27['offset']===_0x98d1('0x24')&&typeof _0x1b7c27[_0x98d1('0x25')]===_0x98d1('0x24');var _0x43ab32=_0x511f93[_0x98d1('0x26')];var _0x79380c=_0x87ccc5?0x0:_0x1b7c27['offset'];var _0x43205e=_0x87ccc5?_0x511f93[_0x98d1('0x26')]:_0x1b7c27[_0x98d1('0x27')]+_0x1b7c27[_0x98d1('0x25')];var _0x23fab3;if(_0x43205e>=_0x43ab32){_0x43205e=_0x43ab32;_0x23fab3=0xc8;}else{_0x23fab3=0xce;}_0x11f0fd[_0x98d1('0x22')](_0x23fab3);return _0x11f0fd[_0x98d1('0x28')](_0x98d1('0x29'),_0x79380c+'-'+_0x43205e+'/'+_0x43ab32)[_0x98d1('0x23')](_0x511f93);}return null;};}function patchUpdates(_0x2ed49a){return function(_0x223ad3){try{jsonpatch[_0x98d1('0x2a')](_0x223ad3,_0x2ed49a,!![]);}catch(_0x207e54){return BPromise[_0x98d1('0x2b')](_0x207e54);}return _0x223ad3[_0x98d1('0x2c')]();};}function saveUpdates(_0x377576,_0x2a7797){return function(_0xbc5d47){if(_0xbc5d47){return _0xbc5d47[_0x98d1('0x2d')](_0x377576)[_0x98d1('0x15')](function(_0x1dbd00){return _0x1dbd00;});}return null;};}function removeEntity(_0x549195,_0x35c139){return function(_0x4a4acc){if(_0x4a4acc){return _0x4a4acc[_0x98d1('0x2e')]()[_0x98d1('0x15')](function(){var _0x2ffab7=_0x4a4acc[_0x98d1('0x2f')]({'plain':!![]});var _0x5bcd33='Contexts';return db[_0x98d1('0x30')]['destroy']({'where':{'type':_0x5bcd33,'resourceId':_0x2ffab7['id']}})[_0x98d1('0x15')](function(){return _0x4a4acc;});})[_0x98d1('0x15')](function(){_0x549195[_0x98d1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8b4c,_0x4020cb){return function(_0x3eab0f){if(!_0x3eab0f){_0x2b8b4c[_0x98d1('0x31')](0x194);}return _0x3eab0f;};}function handleError(_0x103f84,_0x40650c){_0x40650c=_0x40650c||0x1f4;return function(_0x3e837f){logger[_0x98d1('0x1c')](_0x3e837f[_0x98d1('0x32')]);if(_0x3e837f['name']){delete _0x3e837f['name'];}_0x103f84['status'](_0x40650c)[_0x98d1('0x33')](_0x3e837f);};}exports['index']=function(_0x4e8e19,_0x54eb60){var _0x2ace13={},_0x34e85f={},_0x3842e3={'count':0x0,'rows':[]};var _0x1a93ca=_[_0x98d1('0x34')](db[_0x98d1('0x35')]['rawAttributes'],function(_0x47f8ec){return{'name':_0x47f8ec['fieldName'],'type':_0x47f8ec['type'][_0x98d1('0x36')]};});_0x34e85f[_0x98d1('0x37')]=_[_0x98d1('0x34')](_0x1a93ca,_0x98d1('0x38'));_0x34e85f[_0x98d1('0x39')]=_['keys'](_0x4e8e19[_0x98d1('0x39')]);_0x34e85f[_0x98d1('0x3a')]=_[_0x98d1('0x3b')](_0x34e85f[_0x98d1('0x37')],_0x34e85f[_0x98d1('0x39')]);_0x2ace13[_0x98d1('0x3c')]=_['intersection'](_0x34e85f['model'],qs[_0x98d1('0x3d')](_0x4e8e19[_0x98d1('0x39')][_0x98d1('0x3d')]));_0x2ace13['attributes']=_0x2ace13[_0x98d1('0x3c')][_0x98d1('0x3e')]?_0x2ace13[_0x98d1('0x3c')]:_0x34e85f['model'];if(!_0x4e8e19[_0x98d1('0x39')][_0x98d1('0x3f')](_0x98d1('0x40'))){_0x2ace13['limit']=qs[_0x98d1('0x25')](_0x4e8e19['query']['limit']);_0x2ace13[_0x98d1('0x27')]=qs[_0x98d1('0x27')](_0x4e8e19[_0x98d1('0x39')][_0x98d1('0x27')]);}_0x2ace13[_0x98d1('0x41')]=qs[_0x98d1('0x42')](_0x4e8e19['query'][_0x98d1('0x42')]);_0x2ace13[_0x98d1('0x43')]=qs[_0x98d1('0x3a')](_[_0x98d1('0x44')](_0x4e8e19['query'],_0x34e85f[_0x98d1('0x3a')]),_0x1a93ca);if(_0x4e8e19[_0x98d1('0x39')]['filter']){_0x2ace13[_0x98d1('0x43')]=_[_0x98d1('0x45')](_0x2ace13[_0x98d1('0x43')],{'$or':_[_0x98d1('0x34')](_0x1a93ca,function(_0x2d9856){if(_0x2d9856['type']!==_0x98d1('0x46')){var _0x5f552f={};_0x5f552f[_0x2d9856[_0x98d1('0x38')]]={'$like':'%'+_0x4e8e19['query'][_0x98d1('0x47')]+'%'};return _0x5f552f;}})});}_0x2ace13=_[_0x98d1('0x45')]({},_0x2ace13,_0x4e8e19[_0x98d1('0x48')]);var _0x2e2689={'where':_0x2ace13[_0x98d1('0x43')]};return db['VoiceContext'][_0x98d1('0x26')](_0x2e2689)[_0x98d1('0x15')](function(_0x1955b8){_0x3842e3[_0x98d1('0x26')]=_0x1955b8;if(_0x4e8e19[_0x98d1('0x39')][_0x98d1('0x49')]){_0x2ace13['include']=[{'all':!![]}];}return db[_0x98d1('0x35')]['findAll'](_0x2ace13);})[_0x98d1('0x15')](function(_0x111acb){_0x3842e3['rows']=_0x111acb;return _0x3842e3;})[_0x98d1('0x15')](respondWithFilteredResult(_0x54eb60,_0x2ace13))[_0x98d1('0x20')](handleError(_0x54eb60,null));};exports['show']=function(_0x18ef9e,_0x2d466d){var _0x5356df={'raw':![],'where':{'id':_0x18ef9e[_0x98d1('0x4a')]['id']}},_0x1558bc={};_0x1558bc[_0x98d1('0x37')]=_[_0x98d1('0x4b')](db['VoiceContext']['rawAttributes']);_0x1558bc['query']=_[_0x98d1('0x4b')](_0x18ef9e['query']);_0x1558bc[_0x98d1('0x3a')]=_[_0x98d1('0x3b')](_0x1558bc[_0x98d1('0x37')],_0x1558bc[_0x98d1('0x39')]);_0x5356df[_0x98d1('0x3c')]=_['intersection'](_0x1558bc[_0x98d1('0x37')],qs[_0x98d1('0x3d')](_0x18ef9e[_0x98d1('0x39')]['fields']));_0x5356df[_0x98d1('0x3c')]=_0x5356df[_0x98d1('0x3c')][_0x98d1('0x3e')]?_0x5356df[_0x98d1('0x3c')]:_0x1558bc[_0x98d1('0x37')];if(_0x18ef9e[_0x98d1('0x39')][_0x98d1('0x49')]){_0x5356df['include']=[{'all':!![]}];}_0x5356df=_[_0x98d1('0x45')]({},_0x5356df,_0x18ef9e[_0x98d1('0x48')]);return db[_0x98d1('0x35')][_0x98d1('0x4c')](_0x5356df)[_0x98d1('0x15')](handleEntityNotFound(_0x2d466d,null))[_0x98d1('0x15')](respondWithResult(_0x2d466d,null))['catch'](handleError(_0x2d466d,null));};exports['create']=function(_0x419c7f,_0x287233,_0x183d4d){var _0x3b2bfc;return db[_0x98d1('0x35')][_0x98d1('0x4d')](_0x419c7f['body'],{'raw':!![]})[_0x98d1('0x15')](function(_0xf7cba6){_0x3b2bfc=_0xf7cba6;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x98d1('0x15')](function(_0x3e78cf){var _0x3dc9a4=fs[_0x98d1('0x4e')](path['join'](config[_0x98d1('0x4f')],_0x98d1('0x50')),_0x98d1('0x51'));var _0x58b2cd=ejs[_0x98d1('0x52')](_0x3dc9a4,{'contexts':_0x3e78cf||[]});fs['writeFileSync'](_0x98d1('0x53'),_0x58b2cd);})[_0x98d1('0x15')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x98d1('0x54')});})[_0x98d1('0x15')](function(){var _0x3f06cb=_0x419c7f['user'][_0x98d1('0x2f')]({'plain':!![]});if(!_0x3f06cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f06cb[_0x98d1('0x55')]===_0x98d1('0x56')){var _0x4af779=_0x3b2bfc[_0x98d1('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x98d1('0x4c')]({'where':{'name':_0x98d1('0x57'),'userProfileId':_0x3f06cb[_0x98d1('0x58')]},'raw':!![]})['then'](function(_0x34b19b){if(_0x34b19b&&_0x34b19b[_0x98d1('0x59')]===0x0){return db[_0x98d1('0x30')][_0x98d1('0x4d')]({'name':_0x4af779[_0x98d1('0x38')],'resourceId':_0x4af779['id'],'type':_0x34b19b[_0x98d1('0x38')],'sectionId':_0x34b19b['id']},{})[_0x98d1('0x15')](function(){return _0x3b2bfc;});}else{return _0x3b2bfc;}})['catch'](function(_0x31f03c){logger[_0x98d1('0x1c')](_0x98d1('0x5a'),_0x31f03c);throw _0x31f03c;});}return _0x3b2bfc;})[_0x98d1('0x15')](respondWithResult(_0x287233,0xc9))[_0x98d1('0x20')](handleError(_0x287233,null));};exports[_0x98d1('0x2d')]=function(_0xa977ab,_0x323eeb,_0x19ee4f){var _0x35fd19;return db[_0x98d1('0x35')][_0x98d1('0x4c')]({'where':{'id':_0xa977ab[_0x98d1('0x4a')]['id']}})[_0x98d1('0x15')](handleEntityNotFound(_0x323eeb,null))[_0x98d1('0x15')](saveUpdates(_0xa977ab[_0x98d1('0x5b')],null))['then'](function(_0x15a11b){if(_0x15a11b){_0x35fd19=_0x15a11b;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x98d1('0x15')](function(_0x56eea7){var _0x43b867=fs[_0x98d1('0x4e')](path[_0x98d1('0x5c')](config[_0x98d1('0x4f')],_0x98d1('0x50')),'utf8');var _0x2f18a6=ejs['render'](_0x43b867,{'contexts':_0x56eea7||[]});fs[_0x98d1('0x5d')](_0x98d1('0x53'),_0x2f18a6);})['then'](function(){return respondWithRpcPromise(_0x98d1('0x5e'),_0x98d1('0x2d'),{'module':_0x98d1('0x54')});})[_0x98d1('0x15')](function(){return _0x35fd19;})['then'](respondWithResult(_0x323eeb,null))[_0x98d1('0x20')](handleError(_0x323eeb,null));};exports[_0x98d1('0x2e')]=function(_0x56e74e,_0x46c192,_0x20acbf){var _0xd298cb;return db[_0x98d1('0x35')][_0x98d1('0x4c')]({'where':{'id':_0x56e74e[_0x98d1('0x4a')]['id']}})[_0x98d1('0x15')](handleEntityNotFound(_0x46c192,null))['then'](removeEntity(_0x46c192,null))['then'](function(){return db[_0x98d1('0x35')][_0x98d1('0x5f')]({'raw':!![]});})['then'](function(_0x10b654){var _0x26fed2=fs['readFileSync'](path[_0x98d1('0x5c')](config[_0x98d1('0x4f')],_0x98d1('0x50')),_0x98d1('0x51'));var _0x4e6751=ejs[_0x98d1('0x52')](_0x26fed2,{'contexts':_0x10b654});fs[_0x98d1('0x5d')](_0x98d1('0x53'),_0x4e6751);return respondWithRpcPromise('Reload',_0x98d1('0x2e'),{'module':_0x98d1('0x54')});})[_0x98d1('0x20')](handleError(_0x46c192,null));}; \ No newline at end of file +var _0x2c74=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','findAll','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','Contexts','UserProfileResource','name','send','index','VoiceContext','rawAttributes','type','map','query','keys','filters','intersection'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x2c74,0x153));var _0x42c7=function(_0x3ff3ad,_0x405fb3){_0x3ff3ad=_0x3ff3ad-0x0;var _0x2ada24=_0x2c74[_0x3ff3ad];return _0x2ada24;};'use strict';var emlformat=require(_0x42c7('0x0'));var rimraf=require(_0x42c7('0x1'));var zipdir=require(_0x42c7('0x2'));var jsonpatch=require(_0x42c7('0x3'));var rp=require(_0x42c7('0x4'));var moment=require(_0x42c7('0x5'));var BPromise=require(_0x42c7('0x6'));var Mustache=require('mustache');var util=require(_0x42c7('0x7'));var path=require(_0x42c7('0x8'));var sox=require(_0x42c7('0x9'));var csv=require(_0x42c7('0xa'));var ejs=require(_0x42c7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x42c7('0xc'));var crypto=require('crypto');var jsforce=require(_0x42c7('0xd'));var deskjs=require(_0x42c7('0xe'));var toCsv=require(_0x42c7('0xa'));var querystring=require('querystring');var Papa=require(_0x42c7('0xf'));var Redis=require(_0x42c7('0x10'));var authService=require(_0x42c7('0x11'));var qs=require(_0x42c7('0x12'));var as=require(_0x42c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42c7('0x14'))(_0x42c7('0x15'));var utils=require(_0x42c7('0x16'));var config=require(_0x42c7('0x17'));var licenseUtil=require(_0x42c7('0x18'));var db=require(_0x42c7('0x19'))['db'];var jayson=require(_0x42c7('0x1a'));var client=jayson['client'][_0x42c7('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5bd4a0,_0x443381,_0x3f7219,_0x3ff0d5){return new BPromise(function(_0x4d57f7,_0x51f062){var _0x18eeb1=_0x3ff0d5||client;return _0x18eeb1[_0x42c7('0x1c')](_0x5bd4a0,_0x3f7219)['then'](function(_0x45dc26){logger[_0x42c7('0x1d')](_0x42c7('0x1e'),_0x443381,_0x42c7('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x443381,'request\x20sent',JSON['stringify'](_0x45dc26));if(_0x45dc26[_0x42c7('0x20')]){if(_0x45dc26[_0x42c7('0x20')][_0x42c7('0x21')]===0x1f4){logger[_0x42c7('0x20')](_0x42c7('0x1e'),_0x443381,_0x45dc26[_0x42c7('0x20')][_0x42c7('0x22')]);return _0x51f062(_0x45dc26[_0x42c7('0x20')][_0x42c7('0x22')]);}logger[_0x42c7('0x20')](_0x42c7('0x1e'),_0x443381,_0x45dc26[_0x42c7('0x20')][_0x42c7('0x22')]);return _0x4d57f7(_0x45dc26[_0x42c7('0x20')][_0x42c7('0x22')]);}else{logger['info'](_0x42c7('0x1e'),_0x443381,_0x42c7('0x1f'));_0x4d57f7(_0x45dc26[_0x42c7('0x23')][_0x42c7('0x22')]);}})[_0x42c7('0x24')](function(_0x37853b){logger[_0x42c7('0x20')](_0x42c7('0x1e'),_0x443381,_0x37853b);_0x51f062(_0x37853b);});});}function respondWithStatusCode(_0x5d77fd,_0x245c6e){_0x245c6e=_0x245c6e||0xcc;return function(_0xc2776d){if(_0xc2776d){return _0x5d77fd[_0x42c7('0x25')](_0x245c6e);}return _0x5d77fd[_0x42c7('0x26')](_0x245c6e)[_0x42c7('0x27')]();};}function respondWithResult(_0x4a1545,_0x1662ee){_0x1662ee=_0x1662ee||0xc8;return function(_0x3049d0){if(_0x3049d0){return _0x4a1545[_0x42c7('0x26')](_0x1662ee)[_0x42c7('0x28')](_0x3049d0);}};}function respondWithFilteredResult(_0x56eb03,_0x58a845){return function(_0x198c96){if(_0x198c96){var _0x35d52a=typeof _0x58a845[_0x42c7('0x29')]===_0x42c7('0x2a')&&typeof _0x58a845['limit']===_0x42c7('0x2a');var _0x700cc1=_0x198c96[_0x42c7('0x2b')];var _0x4f75c7=_0x35d52a?0x0:_0x58a845['offset'];var _0x26ea8e=_0x35d52a?_0x198c96['count']:_0x58a845['offset']+_0x58a845[_0x42c7('0x2c')];var _0x5c3665;if(_0x26ea8e>=_0x700cc1){_0x26ea8e=_0x700cc1;_0x5c3665=0xc8;}else{_0x5c3665=0xce;}_0x56eb03[_0x42c7('0x26')](_0x5c3665);return _0x56eb03[_0x42c7('0x2d')](_0x42c7('0x2e'),_0x4f75c7+'-'+_0x26ea8e+'/'+_0x700cc1)[_0x42c7('0x28')](_0x198c96);}return null;};}function patchUpdates(_0x3f837d){return function(_0x321486){try{jsonpatch['apply'](_0x321486,_0x3f837d,!![]);}catch(_0x378b3b){return BPromise[_0x42c7('0x2f')](_0x378b3b);}return _0x321486[_0x42c7('0x30')]();};}function saveUpdates(_0x5f2392,_0x270533){return function(_0x464103){if(_0x464103){return _0x464103['update'](_0x5f2392)[_0x42c7('0x31')](function(_0xf12af9){return _0xf12af9;});}return null;};}function removeEntity(_0x4f5e82,_0x1f9a5d){return function(_0x4760b8){if(_0x4760b8){return _0x4760b8[_0x42c7('0x32')]()[_0x42c7('0x31')](function(){var _0xe2ef94=_0x4760b8[_0x42c7('0x33')]({'plain':!![]});var _0x378e75=_0x42c7('0x34');return db[_0x42c7('0x35')][_0x42c7('0x32')]({'where':{'type':_0x378e75,'resourceId':_0xe2ef94['id']}})[_0x42c7('0x31')](function(){return _0x4760b8;});})[_0x42c7('0x31')](function(){_0x4f5e82['status'](0xcc)[_0x42c7('0x27')]();});}};}function handleEntityNotFound(_0xfefd2c,_0x4f9679){return function(_0x966eb5){if(!_0x966eb5){_0xfefd2c[_0x42c7('0x25')](0x194);}return _0x966eb5;};}function handleError(_0x1dec05,_0x3d1987){_0x3d1987=_0x3d1987||0x1f4;return function(_0x15f1b1){logger[_0x42c7('0x20')](_0x15f1b1['stack']);if(_0x15f1b1[_0x42c7('0x36')]){delete _0x15f1b1['name'];}_0x1dec05['status'](_0x3d1987)[_0x42c7('0x37')](_0x15f1b1);};}exports[_0x42c7('0x38')]=function(_0x4f7811,_0x46d84d){var _0x43b394={},_0x3d8982={},_0x38291e={'count':0x0,'rows':[]};var _0x50b6e3=_['map'](db[_0x42c7('0x39')][_0x42c7('0x3a')],function(_0x22b8fb){return{'name':_0x22b8fb['fieldName'],'type':_0x22b8fb[_0x42c7('0x3b')]['key']};});_0x3d8982['model']=_[_0x42c7('0x3c')](_0x50b6e3,_0x42c7('0x36'));_0x3d8982[_0x42c7('0x3d')]=_[_0x42c7('0x3e')](_0x4f7811[_0x42c7('0x3d')]);_0x3d8982[_0x42c7('0x3f')]=_[_0x42c7('0x40')](_0x3d8982[_0x42c7('0x41')],_0x3d8982[_0x42c7('0x3d')]);_0x43b394[_0x42c7('0x42')]=_[_0x42c7('0x40')](_0x3d8982[_0x42c7('0x41')],qs[_0x42c7('0x43')](_0x4f7811['query'][_0x42c7('0x43')]));_0x43b394['attributes']=_0x43b394[_0x42c7('0x42')][_0x42c7('0x44')]?_0x43b394[_0x42c7('0x42')]:_0x3d8982[_0x42c7('0x41')];if(!_0x4f7811['query'][_0x42c7('0x45')](_0x42c7('0x46'))){_0x43b394[_0x42c7('0x2c')]=qs[_0x42c7('0x2c')](_0x4f7811[_0x42c7('0x3d')][_0x42c7('0x2c')]);_0x43b394[_0x42c7('0x29')]=qs[_0x42c7('0x29')](_0x4f7811[_0x42c7('0x3d')][_0x42c7('0x29')]);}_0x43b394[_0x42c7('0x47')]=qs[_0x42c7('0x48')](_0x4f7811[_0x42c7('0x3d')]['sort']);_0x43b394['where']=qs[_0x42c7('0x3f')](_['pick'](_0x4f7811[_0x42c7('0x3d')],_0x3d8982['filters']),_0x50b6e3);if(_0x4f7811[_0x42c7('0x3d')][_0x42c7('0x49')]){_0x43b394[_0x42c7('0x4a')]=_[_0x42c7('0x4b')](_0x43b394[_0x42c7('0x4a')],{'$or':_['map'](_0x50b6e3,function(_0x91131e){if(_0x91131e[_0x42c7('0x3b')]!==_0x42c7('0x4c')){var _0x1f7051={};_0x1f7051[_0x91131e['name']]={'$like':'%'+_0x4f7811[_0x42c7('0x3d')][_0x42c7('0x49')]+'%'};return _0x1f7051;}})});}_0x43b394=_[_0x42c7('0x4b')]({},_0x43b394,_0x4f7811[_0x42c7('0x4d')]);var _0x92a5e={'where':_0x43b394[_0x42c7('0x4a')]};return db[_0x42c7('0x39')][_0x42c7('0x2b')](_0x92a5e)[_0x42c7('0x31')](function(_0x4680b5){_0x38291e[_0x42c7('0x2b')]=_0x4680b5;if(_0x4f7811['query'][_0x42c7('0x4e')]){_0x43b394[_0x42c7('0x4f')]=[{'all':!![]}];}return db[_0x42c7('0x39')]['findAll'](_0x43b394);})['then'](function(_0x331b65){_0x38291e[_0x42c7('0x50')]=_0x331b65;return _0x38291e;})['then'](respondWithFilteredResult(_0x46d84d,_0x43b394))[_0x42c7('0x24')](handleError(_0x46d84d,null));};exports['show']=function(_0x4bff38,_0x225d74){var _0x224bff={'raw':![],'where':{'id':_0x4bff38[_0x42c7('0x51')]['id']}},_0x4d1ff4={};_0x4d1ff4[_0x42c7('0x41')]=_[_0x42c7('0x3e')](db[_0x42c7('0x39')][_0x42c7('0x3a')]);_0x4d1ff4[_0x42c7('0x3d')]=_[_0x42c7('0x3e')](_0x4bff38[_0x42c7('0x3d')]);_0x4d1ff4[_0x42c7('0x3f')]=_[_0x42c7('0x40')](_0x4d1ff4['model'],_0x4d1ff4[_0x42c7('0x3d')]);_0x224bff[_0x42c7('0x42')]=_[_0x42c7('0x40')](_0x4d1ff4[_0x42c7('0x41')],qs['fields'](_0x4bff38[_0x42c7('0x3d')][_0x42c7('0x43')]));_0x224bff[_0x42c7('0x42')]=_0x224bff[_0x42c7('0x42')][_0x42c7('0x44')]?_0x224bff[_0x42c7('0x42')]:_0x4d1ff4[_0x42c7('0x41')];if(_0x4bff38[_0x42c7('0x3d')][_0x42c7('0x4e')]){_0x224bff[_0x42c7('0x4f')]=[{'all':!![]}];}_0x224bff=_[_0x42c7('0x4b')]({},_0x224bff,_0x4bff38['options']);return db[_0x42c7('0x39')][_0x42c7('0x52')](_0x224bff)[_0x42c7('0x31')](handleEntityNotFound(_0x225d74,null))[_0x42c7('0x31')](respondWithResult(_0x225d74,null))[_0x42c7('0x24')](handleError(_0x225d74,null));};exports['create']=function(_0x207571,_0x36317a,_0x49bfcb){var _0x18bd1f;return db['VoiceContext'][_0x42c7('0x53')](_0x207571['body'],{'raw':!![]})[_0x42c7('0x31')](function(_0x59422b){_0x18bd1f=_0x59422b;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x42c7('0x31')](function(_0x27acbe){var _0x56a9f8=fs[_0x42c7('0x54')](path[_0x42c7('0x55')](config[_0x42c7('0x56')],_0x42c7('0x57')),'utf8');var _0x3a11da=ejs[_0x42c7('0x58')](_0x56a9f8,{'contexts':_0x27acbe||[]});fs[_0x42c7('0x59')](_0x42c7('0x5a'),_0x3a11da);})[_0x42c7('0x31')](function(){return respondWithRpcPromise(_0x42c7('0x5b'),'create',{'module':_0x42c7('0x5c')});})[_0x42c7('0x31')](function(){var _0x20fa12=_0x207571[_0x42c7('0x5d')]['get']({'plain':!![]});if(!_0x20fa12)throw new Error(_0x42c7('0x5e'));if(_0x20fa12[_0x42c7('0x5f')]==='user'){var _0xa94e20=_0x18bd1f[_0x42c7('0x33')]({'plain':!![]});return db[_0x42c7('0x60')]['find']({'where':{'name':_0x42c7('0x34'),'userProfileId':_0x20fa12['userProfileId']},'raw':!![]})['then'](function(_0x4586d3){if(_0x4586d3&&_0x4586d3[_0x42c7('0x61')]===0x0){return db[_0x42c7('0x35')][_0x42c7('0x53')]({'name':_0xa94e20['name'],'resourceId':_0xa94e20['id'],'type':_0x4586d3[_0x42c7('0x36')],'sectionId':_0x4586d3['id']},{})['then'](function(){return _0x18bd1f;});}else{return _0x18bd1f;}})['catch'](function(_0xa943e){logger[_0x42c7('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa943e);throw _0xa943e;});}return _0x18bd1f;})[_0x42c7('0x31')](respondWithResult(_0x36317a,0xc9))[_0x42c7('0x24')](handleError(_0x36317a,null));};exports[_0x42c7('0x62')]=function(_0x28efbe,_0x464a9f,_0x399bed){var _0xfa5bc;return db[_0x42c7('0x39')][_0x42c7('0x52')]({'where':{'id':_0x28efbe[_0x42c7('0x51')]['id']}})[_0x42c7('0x31')](handleEntityNotFound(_0x464a9f,null))[_0x42c7('0x31')](saveUpdates(_0x28efbe['body'],null))[_0x42c7('0x31')](function(_0x597818){if(_0x597818){_0xfa5bc=_0x597818;return db['VoiceContext'][_0x42c7('0x63')]({'raw':!![]});}})['then'](function(_0x2fa3e9){var _0x1a0f27=fs[_0x42c7('0x54')](path[_0x42c7('0x55')](config[_0x42c7('0x56')],_0x42c7('0x57')),'utf8');var _0xe74995=ejs[_0x42c7('0x58')](_0x1a0f27,{'contexts':_0x2fa3e9||[]});fs[_0x42c7('0x59')](_0x42c7('0x5a'),_0xe74995);})[_0x42c7('0x31')](function(){return respondWithRpcPromise(_0x42c7('0x5b'),_0x42c7('0x62'),{'module':'chan_sip.so'});})[_0x42c7('0x31')](function(){return _0xfa5bc;})['then'](respondWithResult(_0x464a9f,null))['catch'](handleError(_0x464a9f,null));};exports['destroy']=function(_0x1b8b25,_0x4fda85,_0x5d4fde){var _0x1a18a4;return db[_0x42c7('0x39')][_0x42c7('0x52')]({'where':{'id':_0x1b8b25[_0x42c7('0x51')]['id']}})['then'](handleEntityNotFound(_0x4fda85,null))[_0x42c7('0x31')](removeEntity(_0x4fda85,null))['then'](function(){return db[_0x42c7('0x39')]['findAll']({'raw':!![]});})[_0x42c7('0x31')](function(_0x3a2d38){var _0x1998fd=fs[_0x42c7('0x54')](path[_0x42c7('0x55')](config[_0x42c7('0x56')],_0x42c7('0x57')),_0x42c7('0x64'));var _0x3b8bb0=ejs[_0x42c7('0x58')](_0x1998fd,{'contexts':_0x3a2d38});fs[_0x42c7('0x59')](_0x42c7('0x5a'),_0x3b8bb0);return respondWithRpcPromise(_0x42c7('0x5b'),_0x42c7('0x32'),{'module':_0x42c7('0x5c')});})[_0x42c7('0x24')](handleError(_0x4fda85,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d856799..445a61c 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 _0x5b18=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x4039a8,_0xeca673){var _0x317085=function(_0x33a189){while(--_0x33a189){_0x4039a8['push'](_0x4039a8['shift']());}};_0x317085(++_0xeca673);}(_0x5b18,0xb4));var _0x85b1=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x5b18[_0x14476b];return _0x24e2e8;};'use strict';var _=require(_0x85b1('0x0'));var util=require('util');var logger=require(_0x85b1('0x1'))('api');var moment=require(_0x85b1('0x2'));var BPromise=require(_0x85b1('0x3'));var rp=require(_0x85b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85b1('0x5'));var config=require(_0x85b1('0x6'));var attributes=require(_0x85b1('0x7'));module[_0x85b1('0x8')]=function(_0xe54b06,_0x4f1483){return _0xe54b06[_0x85b1('0x9')](_0x85b1('0xa'),attributes,{'tableName':_0x85b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c8=['voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define'];(function(_0x10553a,_0x3f5022){var _0x45868c=function(_0x53784c){while(--_0x53784c){_0x10553a['push'](_0x10553a['shift']());}};_0x45868c(++_0x3f5022);}(_0x26c8,0x91));var _0x826c=function(_0x2a7826,_0x4b6d8e){_0x2a7826=_0x2a7826-0x0;var _0x37f848=_0x26c8[_0x2a7826];return _0x37f848;};'use strict';var _=require(_0x826c('0x0'));var util=require(_0x826c('0x1'));var logger=require(_0x826c('0x2'))(_0x826c('0x3'));var moment=require('moment');var BPromise=require(_0x826c('0x4'));var rp=require(_0x826c('0x5'));var fs=require('fs');var path=require(_0x826c('0x6'));var rimraf=require(_0x826c('0x7'));var config=require('../../config/environment');var attributes=require(_0x826c('0x8'));module[_0x826c('0x9')]=function(_0x5ea858,_0x5e515f){return _0x5ea858[_0x826c('0xa')]('VoiceContext',attributes,{'tableName':_0x826c('0xb'),'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 82f9875..67f6eee 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 _0x15da=['error','code','message','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x15da,0x98));var _0xa15d=function(_0x466186,_0x2276fb){_0x466186=_0x466186-0x0;var _0x1ee9af=_0x15da[_0x466186];return _0x1ee9af;};'use strict';var _=require('lodash');var util=require(_0xa15d('0x0'));var moment=require(_0xa15d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa15d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa15d('0x3'))(_0xa15d('0x4'));var config=require(_0xa15d('0x5'));var jayson=require(_0xa15d('0x6'));var client=jayson[_0xa15d('0x7')][_0xa15d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30bee4,_0x5c43bf,_0x2c5c74){return new BPromise(function(_0x46896d,_0x4380b3){return client[_0xa15d('0x9')](_0x30bee4,_0x2c5c74)[_0xa15d('0xa')](function(_0x198ada){logger[_0xa15d('0xb')](_0xa15d('0xc'),_0x5c43bf,_0xa15d('0xd'));logger[_0xa15d('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5c43bf,_0xa15d('0xd'),JSON[_0xa15d('0xf')](_0x198ada));if(_0x198ada[_0xa15d('0x10')]){if(_0x198ada[_0xa15d('0x10')][_0xa15d('0x11')]===0x1f4){logger[_0xa15d('0x10')]('VoiceContext,\x20%s,\x20%s',_0x5c43bf,_0x198ada['error'][_0xa15d('0x12')]);return _0x4380b3(_0x198ada['error'][_0xa15d('0x12')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5c43bf,_0x198ada[_0xa15d('0x10')][_0xa15d('0x12')]);return _0x46896d(_0x198ada['error'][_0xa15d('0x12')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5c43bf,'request\x20sent');_0x46896d(_0x198ada[_0xa15d('0x13')]['message']);}})[_0xa15d('0x14')](function(_0x14e95f){logger[_0xa15d('0x10')](_0xa15d('0xc'),_0x5c43bf,_0x14e95f);_0x4380b3(_0x14e95f);});});} \ No newline at end of file +var _0x5ed0=['VoiceContext,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x21e59d,_0x4fe94a){var _0x439dd1=function(_0x25232b){while(--_0x25232b){_0x21e59d['push'](_0x21e59d['shift']());}};_0x439dd1(++_0x4fe94a);}(_0x5ed0,0xcb));var _0x05ed=function(_0x57171b,_0xfe67c6){_0x57171b=_0x57171b-0x0;var _0x33a2c8=_0x5ed0[_0x57171b];return _0x33a2c8;};'use strict';var _=require('lodash');var util=require(_0x05ed('0x0'));var moment=require(_0x05ed('0x1'));var BPromise=require(_0x05ed('0x2'));var rs=require(_0x05ed('0x3'));var fs=require('fs');var Redis=require(_0x05ed('0x4'));var db=require(_0x05ed('0x5'))['db'];var utils=require(_0x05ed('0x6'));var logger=require(_0x05ed('0x7'))('rpc');var config=require(_0x05ed('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d2372,_0x31bfa4,_0x3d472e){return new BPromise(function(_0x1dbd21,_0x4d50bb){return client[_0x05ed('0xa')](_0x7d2372,_0x3d472e)['then'](function(_0x37cd75){logger[_0x05ed('0xb')]('VoiceContext,\x20%s,\x20%s',_0x31bfa4,_0x05ed('0xc'));logger[_0x05ed('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x31bfa4,_0x05ed('0xc'),JSON[_0x05ed('0xe')](_0x37cd75));if(_0x37cd75[_0x05ed('0xf')]){if(_0x37cd75[_0x05ed('0xf')][_0x05ed('0x10')]===0x1f4){logger[_0x05ed('0xf')](_0x05ed('0x11'),_0x31bfa4,_0x37cd75['error']['message']);return _0x4d50bb(_0x37cd75['error'][_0x05ed('0x12')]);}logger[_0x05ed('0xf')](_0x05ed('0x11'),_0x31bfa4,_0x37cd75['error'][_0x05ed('0x12')]);return _0x1dbd21(_0x37cd75[_0x05ed('0xf')][_0x05ed('0x12')]);}else{logger[_0x05ed('0xb')]('VoiceContext,\x20%s,\x20%s',_0x31bfa4,_0x05ed('0xc'));_0x1dbd21(_0x37cd75[_0x05ed('0x13')][_0x05ed('0x12')]);}})['catch'](function(_0x18a79d){logger[_0x05ed('0xf')]('VoiceContext,\x20%s,\x20%s',_0x31bfa4,_0x18a79d);_0x4d50bb(_0x18a79d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ae09801..847b5f4 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 _0x46be=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x46be,0x193));var _0xe46b=function(_0x24a26b,_0x49c278){_0x24a26b=_0x24a26b-0x0;var _0x3ebfd0=_0x46be[_0x24a26b];return _0x3ebfd0;};'use strict';var multer=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var path=require(_0xe46b('0x2'));var timeout=require(_0xe46b('0x3'));var express=require(_0xe46b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe46b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe46b('0x6'));router[_0xe46b('0x7')]('/',auth['isAuthenticated'](),controller[_0xe46b('0x8')]);router[_0xe46b('0x7')](_0xe46b('0x9'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xb')]);router['get'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xd')]);router[_0xe46b('0xe')]('/',auth['isAuthenticated'](),controller[_0xe46b('0xf')]);router[_0xe46b('0x10')](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x11')]);router['delete'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x12')]);module[_0xe46b('0x13')]=router; \ No newline at end of file +var _0x2524=['describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x1ba9f9,_0x249b1e){var _0x217b02=function(_0x4a7075){while(--_0x4a7075){_0x1ba9f9['push'](_0x1ba9f9['shift']());}};_0x217b02(++_0x249b1e);}(_0x2524,0x8c));var _0x4252=function(_0xc6dc3,_0x4541e2){_0xc6dc3=_0xc6dc3-0x0;var _0x55937d=_0x2524[_0xc6dc3];return _0x55937d;};'use strict';var multer=require(_0x4252('0x0'));var util=require(_0x4252('0x1'));var path=require('path');var timeout=require(_0x4252('0x2'));var express=require(_0x4252('0x3'));var router=express[_0x4252('0x4')]();var fs_extra=require(_0x4252('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4252('0x6'));var config=require(_0x4252('0x7'));var controller=require('./voiceDialReport.controller');router[_0x4252('0x8')]('/',auth[_0x4252('0x9')](),controller[_0x4252('0xa')]);router[_0x4252('0x8')](_0x4252('0xb'),auth[_0x4252('0x9')](),controller[_0x4252('0xc')]);router[_0x4252('0x8')](_0x4252('0xd'),auth[_0x4252('0x9')](),controller[_0x4252('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4252('0xf')]);router['put']('/:id',auth[_0x4252('0x9')](),controller[_0x4252('0x10')]);router[_0x4252('0x11')](_0x4252('0xd'),auth[_0x4252('0x9')](),controller['destroy']);module[_0x4252('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 67bf5a5..3005664 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 _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x47104f,_0x207d05){var _0x4e4081=function(_0x4ee98c){while(--_0x4ee98c){_0x47104f['push'](_0x47104f['shift']());}};_0x4e4081(++_0x207d05);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xf3cd[_0x119629];return _0x49a771;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index da756f0..24ce925 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 _0x461a=['status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','include','findAll','catch','params','attributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x235286,_0x2ce74e){var _0x2a3338=function(_0x588302){while(--_0x588302){_0x235286['push'](_0x235286['shift']());}};_0x2a3338(++_0x2ce74e);}(_0x461a,0xc0));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa461('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa461('0x1'));var jsonpatch=require(_0xa461('0x2'));var rp=require('request-promise');var moment=require(_0xa461('0x3'));var BPromise=require(_0xa461('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa461('0x5'));var sox=require(_0xa461('0x6'));var csv=require(_0xa461('0x7'));var ejs=require(_0xa461('0x8'));var fs=require('fs');var fs_extra=require(_0xa461('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa461('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa461('0xb'));var Papa=require(_0xa461('0xc'));var Redis=require(_0xa461('0xd'));var authService=require(_0xa461('0xe'));var qs=require(_0xa461('0xf'));var as=require(_0xa461('0x10'));var hardwareService=require(_0xa461('0x11'));var logger=require(_0xa461('0x12'))(_0xa461('0x13'));var utils=require(_0xa461('0x14'));var config=require(_0xa461('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa461('0x16'))['db'];function respondWithStatusCode(_0x224543,_0xd14d25){_0xd14d25=_0xd14d25||0xcc;return function(_0x18bf61){if(_0x18bf61){return _0x224543[_0xa461('0x17')](_0xd14d25);}return _0x224543[_0xa461('0x18')](_0xd14d25)[_0xa461('0x19')]();};}function respondWithResult(_0x2a8bbb,_0x4b0b2e){_0x4b0b2e=_0x4b0b2e||0xc8;return function(_0x23fd66){if(_0x23fd66){return _0x2a8bbb[_0xa461('0x18')](_0x4b0b2e)['json'](_0x23fd66);}};}function respondWithFilteredResult(_0x3c5474,_0x752783){return function(_0x4776c1){if(_0x4776c1){var _0x127d44=typeof _0x752783['offset']===_0xa461('0x1a')&&typeof _0x752783[_0xa461('0x1b')]===_0xa461('0x1a');var _0x98a4b2=_0x4776c1[_0xa461('0x1c')];var _0xaf5f3a=_0x127d44?0x0:_0x752783[_0xa461('0x1d')];var _0x1a124b=_0x127d44?_0x4776c1[_0xa461('0x1c')]:_0x752783[_0xa461('0x1d')]+_0x752783[_0xa461('0x1b')];var _0x40be23;if(_0x1a124b>=_0x98a4b2){_0x1a124b=_0x98a4b2;_0x40be23=0xc8;}else{_0x40be23=0xce;}_0x3c5474[_0xa461('0x18')](_0x40be23);return _0x3c5474[_0xa461('0x1e')](_0xa461('0x1f'),_0xaf5f3a+'-'+_0x1a124b+'/'+_0x98a4b2)[_0xa461('0x20')](_0x4776c1);}return null;};}function patchUpdates(_0x1a8c89){return function(_0x4955fb){try{jsonpatch['apply'](_0x4955fb,_0x1a8c89,!![]);}catch(_0x479071){return BPromise['reject'](_0x479071);}return _0x4955fb['save']();};}function saveUpdates(_0x5e4643,_0x3d003c){return function(_0xdd85e6){if(_0xdd85e6){return _0xdd85e6[_0xa461('0x21')](_0x5e4643)[_0xa461('0x22')](function(_0xf86813){return _0xf86813;});}return null;};}function removeEntity(_0x296031,_0x832401){return function(_0x41c765){if(_0x41c765){return _0x41c765[_0xa461('0x23')]()[_0xa461('0x22')](function(){_0x296031[_0xa461('0x18')](0xcc)[_0xa461('0x19')]();});}};}function handleEntityNotFound(_0x2d80b5,_0x403931){return function(_0xf1d799){if(!_0xf1d799){_0x2d80b5[_0xa461('0x17')](0x194);}return _0xf1d799;};}function handleError(_0xf25e8a,_0x2e5703){_0x2e5703=_0x2e5703||0x1f4;return function(_0x274250){logger[_0xa461('0x24')](_0x274250[_0xa461('0x25')]);if(_0x274250['name']){delete _0x274250[_0xa461('0x26')];}_0xf25e8a[_0xa461('0x18')](_0x2e5703)[_0xa461('0x27')](_0x274250);};}exports[_0xa461('0x28')]=function(_0x29e9c2,_0x437a1f){var _0xce5296={},_0x246ebc={},_0x2ceb9a={'count':0x0,'rows':[]};var _0xcd05a0=_[_0xa461('0x29')](db['VoiceDialReport'][_0xa461('0x2a')],function(_0x3f296d){return{'name':_0x3f296d[_0xa461('0x2b')],'type':_0x3f296d[_0xa461('0x2c')][_0xa461('0x2d')]};});_0x246ebc[_0xa461('0x2e')]=_[_0xa461('0x29')](_0xcd05a0,_0xa461('0x26'));_0x246ebc['query']=_[_0xa461('0x2f')](_0x29e9c2[_0xa461('0x30')]);_0x246ebc[_0xa461('0x31')]=_[_0xa461('0x32')](_0x246ebc[_0xa461('0x2e')],_0x246ebc[_0xa461('0x30')]);_0xce5296['attributes']=_[_0xa461('0x32')](_0x246ebc[_0xa461('0x2e')],qs[_0xa461('0x33')](_0x29e9c2[_0xa461('0x30')][_0xa461('0x33')]));_0xce5296['attributes']=_0xce5296['attributes'][_0xa461('0x34')]?_0xce5296['attributes']:_0x246ebc[_0xa461('0x2e')];if(!_0x29e9c2[_0xa461('0x30')][_0xa461('0x35')]('nolimit')){_0xce5296[_0xa461('0x1b')]=qs[_0xa461('0x1b')](_0x29e9c2[_0xa461('0x30')]['limit']);_0xce5296['offset']=qs['offset'](_0x29e9c2[_0xa461('0x30')][_0xa461('0x1d')]);}_0xce5296['order']=qs[_0xa461('0x36')](_0x29e9c2[_0xa461('0x30')][_0xa461('0x36')]);_0xce5296[_0xa461('0x37')]=qs['filters'](_[_0xa461('0x38')](_0x29e9c2[_0xa461('0x30')],_0x246ebc['filters']),_0xcd05a0);if(_0x29e9c2[_0xa461('0x30')][_0xa461('0x39')]){_0xce5296[_0xa461('0x37')]=_[_0xa461('0x3a')](_0xce5296[_0xa461('0x37')],{'$or':_['map'](_0xcd05a0,function(_0x1648e8){if(_0x1648e8['type']!==_0xa461('0x3b')){var _0x426e26={};_0x426e26[_0x1648e8[_0xa461('0x26')]]={'$like':'%'+_0x29e9c2['query'][_0xa461('0x39')]+'%'};return _0x426e26;}})});}_0xce5296=_[_0xa461('0x3a')]({},_0xce5296,_0x29e9c2[_0xa461('0x3c')]);var _0x2ccf87={'where':_0xce5296[_0xa461('0x37')]};return db[_0xa461('0x3d')][_0xa461('0x1c')](_0x2ccf87)['then'](function(_0x2bcc12){_0x2ceb9a[_0xa461('0x1c')]=_0x2bcc12;if(_0x29e9c2['query']['includeAll']){_0xce5296[_0xa461('0x3e')]=[{'all':!![]}];}return db[_0xa461('0x3d')][_0xa461('0x3f')](_0xce5296);})[_0xa461('0x22')](function(_0x1797a0){_0x2ceb9a['rows']=_0x1797a0;return _0x2ceb9a;})[_0xa461('0x22')](respondWithFilteredResult(_0x437a1f,_0xce5296))[_0xa461('0x40')](handleError(_0x437a1f,null));};exports['show']=function(_0x2d7cd7,_0x3a9fe6){var _0x42b250={'raw':!![],'where':{'id':_0x2d7cd7[_0xa461('0x41')]['id']}},_0x6ef0ea={};_0x6ef0ea[_0xa461('0x2e')]=_['keys'](db[_0xa461('0x3d')]['rawAttributes']);_0x6ef0ea['query']=_[_0xa461('0x2f')](_0x2d7cd7['query']);_0x6ef0ea[_0xa461('0x31')]=_[_0xa461('0x32')](_0x6ef0ea['model'],_0x6ef0ea[_0xa461('0x30')]);_0x42b250['attributes']=_[_0xa461('0x32')](_0x6ef0ea[_0xa461('0x2e')],qs[_0xa461('0x33')](_0x2d7cd7[_0xa461('0x30')][_0xa461('0x33')]));_0x42b250[_0xa461('0x42')]=_0x42b250['attributes']['length']?_0x42b250[_0xa461('0x42')]:_0x6ef0ea[_0xa461('0x2e')];if(_0x2d7cd7[_0xa461('0x30')][_0xa461('0x43')]){_0x42b250[_0xa461('0x3e')]=[{'all':!![]}];}_0x42b250=_[_0xa461('0x3a')]({},_0x42b250,_0x2d7cd7[_0xa461('0x3c')]);return db[_0xa461('0x3d')][_0xa461('0x44')](_0x42b250)[_0xa461('0x22')](handleEntityNotFound(_0x3a9fe6,null))['then'](respondWithResult(_0x3a9fe6,null))[_0xa461('0x40')](handleError(_0x3a9fe6,null));};exports[_0xa461('0x45')]=function(_0x10c63a,_0x42550f){return db[_0xa461('0x3d')][_0xa461('0x45')](_0x10c63a[_0xa461('0x46')],{})[_0xa461('0x22')](respondWithResult(_0x42550f,0xc9))[_0xa461('0x40')](handleError(_0x42550f,null));};exports[_0xa461('0x21')]=function(_0x1088bd,_0x557b53){if(_0x1088bd[_0xa461('0x46')]['id']){delete _0x1088bd[_0xa461('0x46')]['id'];}return db[_0xa461('0x3d')][_0xa461('0x44')]({'where':{'id':_0x1088bd[_0xa461('0x41')]['id']}})[_0xa461('0x22')](handleEntityNotFound(_0x557b53,null))['then'](saveUpdates(_0x1088bd[_0xa461('0x46')],null))[_0xa461('0x22')](respondWithResult(_0x557b53,null))[_0xa461('0x40')](handleError(_0x557b53,null));};exports['destroy']=function(_0x294900,_0x311702){return db[_0xa461('0x3d')]['find']({'where':{'id':_0x294900['params']['id']}})[_0xa461('0x22')](handleEntityNotFound(_0x311702,null))[_0xa461('0x22')](removeEntity(_0x311702,null))[_0xa461('0x40')](handleError(_0x311702,null));};exports[_0xa461('0x47')]=function(_0x51a1d3,_0x536810){return db[_0xa461('0x3d')][_0xa461('0x47')]()[_0xa461('0x22')](respondWithResult(_0x536810,null))['catch'](handleError(_0x536810,null));}; \ No newline at end of file +var _0x0f67=['count','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','type','key','map','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','then','rows','catch','show','params','includeAll','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x533deb,_0x13d177){var _0x2efe05=function(_0x390f7e){while(--_0x390f7e){_0x533deb['push'](_0x533deb['shift']());}};_0x2efe05(++_0x13d177);}(_0x0f67,0x77));var _0x70f6=function(_0x46226d,_0x289805){_0x46226d=_0x46226d-0x0;var _0x5cb476=_0x0f67[_0x46226d];return _0x5cb476;};'use strict';var emlformat=require(_0x70f6('0x0'));var rimraf=require(_0x70f6('0x1'));var zipdir=require(_0x70f6('0x2'));var jsonpatch=require(_0x70f6('0x3'));var rp=require(_0x70f6('0x4'));var moment=require(_0x70f6('0x5'));var BPromise=require(_0x70f6('0x6'));var Mustache=require(_0x70f6('0x7'));var util=require(_0x70f6('0x8'));var path=require(_0x70f6('0x9'));var sox=require(_0x70f6('0xa'));var csv=require(_0x70f6('0xb'));var ejs=require(_0x70f6('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x70f6('0xd'));var crypto=require(_0x70f6('0xe'));var jsforce=require(_0x70f6('0xf'));var deskjs=require(_0x70f6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x70f6('0x11'));var Papa=require('papaparse');var Redis=require(_0x70f6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70f6('0x13'));var as=require(_0x70f6('0x14'));var hardwareService=require(_0x70f6('0x15'));var logger=require('../../config/logger')(_0x70f6('0x16'));var utils=require(_0x70f6('0x17'));var config=require(_0x70f6('0x18'));var licenseUtil=require(_0x70f6('0x19'));var db=require(_0x70f6('0x1a'))['db'];function respondWithStatusCode(_0x42d9b1,_0x210e82){_0x210e82=_0x210e82||0xcc;return function(_0x15ea46){if(_0x15ea46){return _0x42d9b1[_0x70f6('0x1b')](_0x210e82);}return _0x42d9b1[_0x70f6('0x1c')](_0x210e82)[_0x70f6('0x1d')]();};}function respondWithResult(_0x1b16a2,_0x27f701){_0x27f701=_0x27f701||0xc8;return function(_0x2a62d2){if(_0x2a62d2){return _0x1b16a2['status'](_0x27f701)[_0x70f6('0x1e')](_0x2a62d2);}};}function respondWithFilteredResult(_0x45234a,_0xc2c8b5){return function(_0x186aef){if(_0x186aef){var _0x5ab658=typeof _0xc2c8b5[_0x70f6('0x1f')]===_0x70f6('0x20')&&typeof _0xc2c8b5['limit']===_0x70f6('0x20');var _0x45939d=_0x186aef[_0x70f6('0x21')];var _0x4c2516=_0x5ab658?0x0:_0xc2c8b5[_0x70f6('0x1f')];var _0x48f7d1=_0x5ab658?_0x186aef['count']:_0xc2c8b5[_0x70f6('0x1f')]+_0xc2c8b5[_0x70f6('0x22')];var _0x58115c;if(_0x48f7d1>=_0x45939d){_0x48f7d1=_0x45939d;_0x58115c=0xc8;}else{_0x58115c=0xce;}_0x45234a[_0x70f6('0x1c')](_0x58115c);return _0x45234a[_0x70f6('0x23')](_0x70f6('0x24'),_0x4c2516+'-'+_0x48f7d1+'/'+_0x45939d)[_0x70f6('0x1e')](_0x186aef);}return null;};}function patchUpdates(_0x160945){return function(_0x22a702){try{jsonpatch[_0x70f6('0x25')](_0x22a702,_0x160945,!![]);}catch(_0x6148ca){return BPromise[_0x70f6('0x26')](_0x6148ca);}return _0x22a702[_0x70f6('0x27')]();};}function saveUpdates(_0x15444b,_0x199862){return function(_0x5a2a2f){if(_0x5a2a2f){return _0x5a2a2f['update'](_0x15444b)['then'](function(_0x34c821){return _0x34c821;});}return null;};}function removeEntity(_0x33bd1f,_0x19b93f){return function(_0x474e40){if(_0x474e40){return _0x474e40[_0x70f6('0x28')]()['then'](function(){_0x33bd1f[_0x70f6('0x1c')](0xcc)[_0x70f6('0x1d')]();});}};}function handleEntityNotFound(_0x4caba7,_0x429c2e){return function(_0x574b80){if(!_0x574b80){_0x4caba7[_0x70f6('0x1b')](0x194);}return _0x574b80;};}function handleError(_0x58d232,_0x28d32a){_0x28d32a=_0x28d32a||0x1f4;return function(_0xa3e71e){logger[_0x70f6('0x29')](_0xa3e71e[_0x70f6('0x2a')]);if(_0xa3e71e[_0x70f6('0x2b')]){delete _0xa3e71e[_0x70f6('0x2b')];}_0x58d232[_0x70f6('0x1c')](_0x28d32a)[_0x70f6('0x2c')](_0xa3e71e);};}exports['index']=function(_0x428a8f,_0x57d798){var _0x57f04d={},_0x2e9e65={},_0x35cac3={'count':0x0,'rows':[]};var _0x105a28=_['map'](db[_0x70f6('0x2d')][_0x70f6('0x2e')],function(_0x48014c){return{'name':_0x48014c['fieldName'],'type':_0x48014c[_0x70f6('0x2f')][_0x70f6('0x30')]};});_0x2e9e65['model']=_[_0x70f6('0x31')](_0x105a28,'name');_0x2e9e65['query']=_[_0x70f6('0x32')](_0x428a8f[_0x70f6('0x33')]);_0x2e9e65['filters']=_[_0x70f6('0x34')](_0x2e9e65[_0x70f6('0x35')],_0x2e9e65['query']);_0x57f04d['attributes']=_[_0x70f6('0x34')](_0x2e9e65['model'],qs[_0x70f6('0x36')](_0x428a8f[_0x70f6('0x33')]['fields']));_0x57f04d[_0x70f6('0x37')]=_0x57f04d[_0x70f6('0x37')]['length']?_0x57f04d[_0x70f6('0x37')]:_0x2e9e65[_0x70f6('0x35')];if(!_0x428a8f['query'][_0x70f6('0x38')](_0x70f6('0x39'))){_0x57f04d[_0x70f6('0x22')]=qs[_0x70f6('0x22')](_0x428a8f[_0x70f6('0x33')]['limit']);_0x57f04d[_0x70f6('0x1f')]=qs['offset'](_0x428a8f[_0x70f6('0x33')][_0x70f6('0x1f')]);}_0x57f04d[_0x70f6('0x3a')]=qs[_0x70f6('0x3b')](_0x428a8f['query'][_0x70f6('0x3b')]);_0x57f04d[_0x70f6('0x3c')]=qs[_0x70f6('0x3d')](_[_0x70f6('0x3e')](_0x428a8f['query'],_0x2e9e65['filters']),_0x105a28);if(_0x428a8f[_0x70f6('0x33')][_0x70f6('0x3f')]){_0x57f04d['where']=_['merge'](_0x57f04d['where'],{'$or':_[_0x70f6('0x31')](_0x105a28,function(_0x1a0a39){if(_0x1a0a39['type']!==_0x70f6('0x40')){var _0x384cbc={};_0x384cbc[_0x1a0a39[_0x70f6('0x2b')]]={'$like':'%'+_0x428a8f[_0x70f6('0x33')][_0x70f6('0x3f')]+'%'};return _0x384cbc;}})});}_0x57f04d=_[_0x70f6('0x41')]({},_0x57f04d,_0x428a8f[_0x70f6('0x42')]);var _0x2d108e={'where':_0x57f04d[_0x70f6('0x3c')]};return db[_0x70f6('0x2d')][_0x70f6('0x21')](_0x2d108e)['then'](function(_0x4e9b22){_0x35cac3['count']=_0x4e9b22;if(_0x428a8f[_0x70f6('0x33')]['includeAll']){_0x57f04d[_0x70f6('0x43')]=[{'all':!![]}];}return db[_0x70f6('0x2d')]['findAll'](_0x57f04d);})[_0x70f6('0x44')](function(_0x251406){_0x35cac3[_0x70f6('0x45')]=_0x251406;return _0x35cac3;})['then'](respondWithFilteredResult(_0x57d798,_0x57f04d))[_0x70f6('0x46')](handleError(_0x57d798,null));};exports[_0x70f6('0x47')]=function(_0x400f3a,_0x38cd33){var _0x2e75d0={'raw':!![],'where':{'id':_0x400f3a[_0x70f6('0x48')]['id']}},_0x210d4d={};_0x210d4d[_0x70f6('0x35')]=_[_0x70f6('0x32')](db['VoiceDialReport'][_0x70f6('0x2e')]);_0x210d4d[_0x70f6('0x33')]=_[_0x70f6('0x32')](_0x400f3a['query']);_0x210d4d[_0x70f6('0x3d')]=_[_0x70f6('0x34')](_0x210d4d['model'],_0x210d4d['query']);_0x2e75d0[_0x70f6('0x37')]=_[_0x70f6('0x34')](_0x210d4d[_0x70f6('0x35')],qs['fields'](_0x400f3a[_0x70f6('0x33')][_0x70f6('0x36')]));_0x2e75d0[_0x70f6('0x37')]=_0x2e75d0['attributes']['length']?_0x2e75d0[_0x70f6('0x37')]:_0x210d4d[_0x70f6('0x35')];if(_0x400f3a[_0x70f6('0x33')][_0x70f6('0x49')]){_0x2e75d0[_0x70f6('0x43')]=[{'all':!![]}];}_0x2e75d0=_[_0x70f6('0x41')]({},_0x2e75d0,_0x400f3a[_0x70f6('0x42')]);return db[_0x70f6('0x2d')][_0x70f6('0x4a')](_0x2e75d0)[_0x70f6('0x44')](handleEntityNotFound(_0x38cd33,null))[_0x70f6('0x44')](respondWithResult(_0x38cd33,null))[_0x70f6('0x46')](handleError(_0x38cd33,null));};exports['create']=function(_0x507518,_0xc9646f){return db[_0x70f6('0x2d')]['create'](_0x507518[_0x70f6('0x4b')],{})['then'](respondWithResult(_0xc9646f,0xc9))['catch'](handleError(_0xc9646f,null));};exports['update']=function(_0x226a29,_0x4a54f9){if(_0x226a29[_0x70f6('0x4b')]['id']){delete _0x226a29[_0x70f6('0x4b')]['id'];}return db[_0x70f6('0x2d')][_0x70f6('0x4a')]({'where':{'id':_0x226a29[_0x70f6('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a54f9,null))[_0x70f6('0x44')](saveUpdates(_0x226a29[_0x70f6('0x4b')],null))['then'](respondWithResult(_0x4a54f9,null))[_0x70f6('0x46')](handleError(_0x4a54f9,null));};exports[_0x70f6('0x28')]=function(_0x47e46e,_0x13658d){return db[_0x70f6('0x2d')][_0x70f6('0x4a')]({'where':{'id':_0x47e46e[_0x70f6('0x48')]['id']}})[_0x70f6('0x44')](handleEntityNotFound(_0x13658d,null))['then'](removeEntity(_0x13658d,null))[_0x70f6('0x46')](handleError(_0x13658d,null));};exports['describe']=function(_0x2b0bb5,_0x292848){return db[_0x70f6('0x2d')]['describe']()[_0x70f6('0x44')](respondWithResult(_0x292848,null))[_0x70f6('0x46')](handleError(_0x292848,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c5b414d..5e1145a 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 _0xb845=['VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x48c147,_0x492051){var _0x3de81c=function(_0x1bc2aa){while(--_0x1bc2aa){_0x48c147['push'](_0x48c147['shift']());}};_0x3de81c(++_0x492051);}(_0xb845,0x18b));var _0x5b84=function(_0x36c39e,_0x383ba0){_0x36c39e=_0x36c39e-0x0;var _0x5307b7=_0xb845[_0x36c39e];return _0x5307b7;};'use strict';var _=require('lodash');var util=require(_0x5b84('0x0'));var logger=require(_0x5b84('0x1'))(_0x5b84('0x2'));var moment=require('moment');var BPromise=require(_0x5b84('0x3'));var rp=require(_0x5b84('0x4'));var fs=require('fs');var path=require(_0x5b84('0x5'));var rimraf=require(_0x5b84('0x6'));var config=require(_0x5b84('0x7'));var attributes=require(_0x5b84('0x8'));module[_0x5b84('0x9')]=function(_0x427221,_0x15bf6b){return _0x427221[_0x5b84('0xa')](_0x5b84('0xb'),attributes,{'tableName':_0x5b84('0xc'),'paranoid':![],'indexes':[{'fields':[_0x5b84('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd5d=['report_dial','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x462493,_0x514ca0){var _0xda7448=function(_0x4a22a5){while(--_0x4a22a5){_0x462493['push'](_0x462493['shift']());}};_0xda7448(++_0x514ca0);}(_0xdd5d,0x1ae));var _0xddd5=function(_0x3b3941,_0x2767b3){_0x3b3941=_0x3b3941-0x0;var _0x7ce768=_0xdd5d[_0x3b3941];return _0x7ce768;};'use strict';var _=require(_0xddd5('0x0'));var util=require(_0xddd5('0x1'));var logger=require(_0xddd5('0x2'))(_0xddd5('0x3'));var moment=require('moment');var BPromise=require(_0xddd5('0x4'));var rp=require(_0xddd5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddd5('0x6'));var config=require(_0xddd5('0x7'));var attributes=require(_0xddd5('0x8'));module[_0xddd5('0x9')]=function(_0x5d0aab,_0x1d889f){return _0x5d0aab[_0xddd5('0xa')](_0xddd5('0xb'),attributes,{'tableName':_0xddd5('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a73cb45..df257dc 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 _0x11ca=['CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','info','stringify','UpdateVoiceDialReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x5a57c6,_0x394b7d){var _0x509601=function(_0x1bb60b){while(--_0x1bb60b){_0x5a57c6['push'](_0x5a57c6['shift']());}};_0x509601(++_0x394b7d);}(_0x11ca,0x9d));var _0xa11c=function(_0x113faa,_0x4ec194){_0x113faa=_0x113faa-0x0;var _0x58f3d2=_0x11ca[_0x113faa];return _0x58f3d2;};'use strict';var _=require(_0xa11c('0x0'));var util=require(_0xa11c('0x1'));var moment=require(_0xa11c('0x2'));var BPromise=require(_0xa11c('0x3'));var rs=require(_0xa11c('0x4'));var fs=require('fs');var Redis=require(_0xa11c('0x5'));var db=require(_0xa11c('0x6'))['db'];var utils=require(_0xa11c('0x7'));var logger=require(_0xa11c('0x8'))('rpc');var config=require(_0xa11c('0x9'));var jayson=require(_0xa11c('0xa'));var client=jayson[_0xa11c('0xb')][_0xa11c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ca546,_0x5a103b,_0x3b8e46){return new BPromise(function(_0xf8a508,_0x54f6dd){return client[_0xa11c('0xd')](_0x1ca546,_0x3b8e46)['then'](function(_0x24e02f){logger['info'](_0xa11c('0xe'),_0x5a103b,_0xa11c('0xf'));logger[_0xa11c('0x10')](_0xa11c('0x11'),_0x5a103b,'request\x20sent',JSON['stringify'](_0x24e02f));if(_0x24e02f[_0xa11c('0x12')]){if(_0x24e02f[_0xa11c('0x12')][_0xa11c('0x13')]===0x1f4){logger[_0xa11c('0x12')](_0xa11c('0xe'),_0x5a103b,_0x24e02f[_0xa11c('0x12')]['message']);return _0x54f6dd(_0x24e02f[_0xa11c('0x12')]['message']);}logger[_0xa11c('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x5a103b,_0x24e02f[_0xa11c('0x12')][_0xa11c('0x14')]);return _0xf8a508(_0x24e02f[_0xa11c('0x12')]['message']);}else{logger['info'](_0xa11c('0xe'),_0x5a103b,'request\x20sent');_0xf8a508(_0x24e02f[_0xa11c('0x15')]['message']);}})[_0xa11c('0x16')](function(_0x31ddde){logger[_0xa11c('0x12')](_0xa11c('0xe'),_0x5a103b,_0x31ddde);_0x54f6dd(_0x31ddde);});});}exports[_0xa11c('0x17')]=function(_0x24730f){var _0x438649=this;return new Promise(function(_0x49ac5f,_0x5a949a){return db[_0xa11c('0x18')][_0xa11c('0x19')](_0x24730f[_0xa11c('0x1a')],{'raw':_0x24730f[_0xa11c('0x1b')]?_0x24730f[_0xa11c('0x1b')][_0xa11c('0x1c')]===undefined?!![]:![]:!![]})[_0xa11c('0x1d')](function(_0x401303){logger[_0xa11c('0x1e')](_0xa11c('0x17'),_0x24730f);logger[_0xa11c('0x10')]('CreateVoiceDialReport',_0x24730f,JSON[_0xa11c('0x1f')](_0x401303));_0x49ac5f(_0x401303);})['catch'](function(_0x53a4ef){logger[_0xa11c('0x12')](_0xa11c('0x17'),_0x53a4ef[_0xa11c('0x14')],_0x24730f);_0x5a949a(_0x438649[_0xa11c('0x12')](0x1f4,_0x53a4ef[_0xa11c('0x14')]));});});};exports[_0xa11c('0x20')]=function(_0x36daf6){var _0x282d76=this;return new Promise(function(_0x3c69f5,_0x5d6e70){return db['VoiceDialReport'][_0xa11c('0x21')](_0x36daf6[_0xa11c('0x1a')],{'raw':_0x36daf6[_0xa11c('0x1b')]?_0x36daf6[_0xa11c('0x1b')][_0xa11c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36daf6[_0xa11c('0x1b')]?_0x36daf6['options'][_0xa11c('0x22')]||null:null,'attributes':_0x36daf6[_0xa11c('0x1b')]?_0x36daf6[_0xa11c('0x1b')]['attributes']||null:null,'limit':_0x36daf6[_0xa11c('0x1b')]?_0x36daf6[_0xa11c('0x1b')][_0xa11c('0x23')]||null:null})[_0xa11c('0x1d')](function(_0x477b0d){logger[_0xa11c('0x1e')]('UpdateVoiceDialReport',_0x36daf6);logger['debug'](_0xa11c('0x20'),_0x36daf6,JSON[_0xa11c('0x1f')](_0x477b0d));_0x3c69f5(_0x477b0d);})[_0xa11c('0x16')](function(_0x527798){logger[_0xa11c('0x12')](_0xa11c('0x20'),_0x527798[_0xa11c('0x14')],_0x36daf6);_0x5d6e70(_0x282d76['error'](0x1f4,_0x527798[_0xa11c('0x14')]));});});}; \ No newline at end of file +var _0x5a6a=['info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x956813,_0x4c2173){var _0x3ddbe8=function(_0x731f23){while(--_0x731f23){_0x956813['push'](_0x956813['shift']());}};_0x3ddbe8(++_0x4c2173);}(_0x5a6a,0x115));var _0xa5a6=function(_0x29d41e,_0x57b33b){_0x29d41e=_0x29d41e-0x0;var _0x1dc54b=_0x5a6a[_0x29d41e];return _0x1dc54b;};'use strict';var _=require(_0xa5a6('0x0'));var util=require(_0xa5a6('0x1'));var moment=require('moment');var BPromise=require(_0xa5a6('0x2'));var rs=require(_0xa5a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa5a6('0x4'));var logger=require(_0xa5a6('0x5'))(_0xa5a6('0x6'));var config=require(_0xa5a6('0x7'));var jayson=require(_0xa5a6('0x8'));var client=jayson['client'][_0xa5a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25409e,_0x3c6e51,_0x3bc551){return new BPromise(function(_0x549ad4,_0x1b00d2){return client[_0xa5a6('0xa')](_0x25409e,_0x3bc551)[_0xa5a6('0xb')](function(_0x544a9f){logger['info'](_0xa5a6('0xc'),_0x3c6e51,_0xa5a6('0xd'));logger[_0xa5a6('0xe')](_0xa5a6('0xf'),_0x3c6e51,_0xa5a6('0xd'),JSON[_0xa5a6('0x10')](_0x544a9f));if(_0x544a9f[_0xa5a6('0x11')]){if(_0x544a9f[_0xa5a6('0x11')][_0xa5a6('0x12')]===0x1f4){logger['error'](_0xa5a6('0xc'),_0x3c6e51,_0x544a9f[_0xa5a6('0x11')][_0xa5a6('0x13')]);return _0x1b00d2(_0x544a9f[_0xa5a6('0x11')][_0xa5a6('0x13')]);}logger['error'](_0xa5a6('0xc'),_0x3c6e51,_0x544a9f[_0xa5a6('0x11')][_0xa5a6('0x13')]);return _0x549ad4(_0x544a9f[_0xa5a6('0x11')][_0xa5a6('0x13')]);}else{logger[_0xa5a6('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x3c6e51,'request\x20sent');_0x549ad4(_0x544a9f[_0xa5a6('0x15')][_0xa5a6('0x13')]);}})[_0xa5a6('0x16')](function(_0x4e080e){logger[_0xa5a6('0x11')](_0xa5a6('0xc'),_0x3c6e51,_0x4e080e);_0x1b00d2(_0x4e080e);});});}exports[_0xa5a6('0x17')]=function(_0x3444c7){var _0x304786=this;return new Promise(function(_0x223a2a,_0x2a9dc8){return db[_0xa5a6('0x18')][_0xa5a6('0x19')](_0x3444c7[_0xa5a6('0x1a')],{'raw':_0x3444c7[_0xa5a6('0x1b')]?_0x3444c7[_0xa5a6('0x1b')][_0xa5a6('0x1c')]===undefined?!![]:![]:!![]})[_0xa5a6('0xb')](function(_0x224c9a){logger[_0xa5a6('0x14')](_0xa5a6('0x17'),_0x3444c7);logger[_0xa5a6('0xe')]('CreateVoiceDialReport',_0x3444c7,JSON[_0xa5a6('0x10')](_0x224c9a));_0x223a2a(_0x224c9a);})[_0xa5a6('0x16')](function(_0x3cca53){logger[_0xa5a6('0x11')]('CreateVoiceDialReport',_0x3cca53['message'],_0x3444c7);_0x2a9dc8(_0x304786['error'](0x1f4,_0x3cca53[_0xa5a6('0x13')]));});});};exports[_0xa5a6('0x1d')]=function(_0x12f73d){var _0x1bbb5d=this;return new Promise(function(_0x1aa312,_0x4e8f8d){return db[_0xa5a6('0x18')][_0xa5a6('0x1e')](_0x12f73d['body'],{'raw':_0x12f73d[_0xa5a6('0x1b')]?_0x12f73d[_0xa5a6('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12f73d[_0xa5a6('0x1b')]?_0x12f73d[_0xa5a6('0x1b')]['where']||null:null,'attributes':_0x12f73d[_0xa5a6('0x1b')]?_0x12f73d[_0xa5a6('0x1b')][_0xa5a6('0x1f')]||null:null,'limit':_0x12f73d[_0xa5a6('0x1b')]?_0x12f73d[_0xa5a6('0x1b')][_0xa5a6('0x20')]||null:null})[_0xa5a6('0xb')](function(_0x56a848){logger['info']('UpdateVoiceDialReport',_0x12f73d);logger[_0xa5a6('0xe')](_0xa5a6('0x1d'),_0x12f73d,JSON[_0xa5a6('0x10')](_0x56a848));_0x1aa312(_0x56a848);})[_0xa5a6('0x16')](function(_0x48eb59){logger[_0xa5a6('0x11')](_0xa5a6('0x1d'),_0x48eb59['message'],_0x12f73d);_0x4e8f8d(_0x1bbb5d[_0xa5a6('0x11')](0x1f4,_0x48eb59[_0xa5a6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index daed485..f7f1265 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 _0x8cf5=['show','post','create','/:id/applications','addApplications','put','delete','destroy','exports','util','path','Router','fs-extra','get','index','/:id','isAuthenticated'];(function(_0x4c3e0e,_0x5be57a){var _0x41fa64=function(_0x2a0ff4){while(--_0x2a0ff4){_0x4c3e0e['push'](_0x4c3e0e['shift']());}};_0x41fa64(++_0x5be57a);}(_0x8cf5,0xf7));var _0x58cf=function(_0x30bf14,_0x39be81){_0x30bf14=_0x30bf14-0x0;var _0x56d468=_0x8cf5[_0x30bf14];return _0x56d468;};'use strict';var multer=require('multer');var util=require(_0x58cf('0x0'));var path=require(_0x58cf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x58cf('0x2')]();var fs_extra=require(_0x58cf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x58cf('0x4')]('/',auth['isAuthenticated'](),controller[_0x58cf('0x5')]);router[_0x58cf('0x4')](_0x58cf('0x6'),auth[_0x58cf('0x7')](),controller[_0x58cf('0x8')]);router[_0x58cf('0x9')]('/',auth[_0x58cf('0x7')](),controller[_0x58cf('0xa')]);router[_0x58cf('0x9')](_0x58cf('0xb'),auth[_0x58cf('0x7')](),controller[_0x58cf('0xc')]);router[_0x58cf('0xd')](_0x58cf('0x6'),auth[_0x58cf('0x7')](),controller['update']);router[_0x58cf('0xe')](_0x58cf('0x6'),auth['isAuthenticated'](),controller[_0x58cf('0xf')]);module[_0x58cf('0x10')]=router; \ No newline at end of file +var _0x7746=['/:id','isAuthenticated','show','post','create','/:id/applications','put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceExtension.controller','index','get'];(function(_0xa98ed2,_0x445c86){var _0x55c8d5=function(_0x26f015){while(--_0x26f015){_0xa98ed2['push'](_0xa98ed2['shift']());}};_0x55c8d5(++_0x445c86);}(_0x7746,0x173));var _0x6774=function(_0x3e9113,_0x57cdf3){_0x3e9113=_0x3e9113-0x0;var _0x100de6=_0x7746[_0x3e9113];return _0x100de6;};'use strict';var multer=require('multer');var util=require(_0x6774('0x0'));var path=require(_0x6774('0x1'));var timeout=require(_0x6774('0x2'));var express=require(_0x6774('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6774('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6774('0x5'));var controller=require(_0x6774('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6774('0x7')]);router[_0x6774('0x8')](_0x6774('0x9'),auth[_0x6774('0xa')](),controller[_0x6774('0xb')]);router[_0x6774('0xc')]('/',auth[_0x6774('0xa')](),controller[_0x6774('0xd')]);router[_0x6774('0xc')](_0x6774('0xe'),auth[_0x6774('0xa')](),controller['addApplications']);router[_0x6774('0xf')](_0x6774('0x9'),auth['isAuthenticated'](),controller[_0x6774('0x10')]);router[_0x6774('0x11')](_0x6774('0x9'),auth[_0x6774('0xa')](),controller['destroy']);module[_0x6774('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 0a4170c..70fefe2 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 _0xcb91=['outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','STRING','compositeIndex','NoOp','inbound'];(function(_0xd625f,_0x97b42){var _0x175369=function(_0x59c3a5){while(--_0x59c3a5){_0xd625f['push'](_0xd625f['shift']());}};_0x175369(++_0x97b42);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xcb91[_0x57e00e];return _0x415e60;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x1cb9('0x1')},'tag':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x2')},'appdata':{'type':Sequelize[_0x1cb9('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x1cb9('0x3'),_0x1cb9('0x4'),'internal',_0x1cb9('0x5'),_0x1cb9('0x6'),'system',_0x1cb9('0x7')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x8')},'IntervalId':{'type':Sequelize[_0x1cb9('0x9')]},'isApp':{'type':Sequelize[_0x1cb9('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1cb9('0x9')]},'recordingFormat':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':_0x1cb9('0xb')},'answer':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1cb9('0xc')],'get':function(){return this['getDataValue']('exten');}}}; \ No newline at end of file +var _0xd8b0=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d8b('0x2')},'priority':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x0d8b('0x2')},'tag':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x5'),_0x0d8b('0x6'),'internal',_0x0d8b('0x7'),_0x0d8b('0x8'),'system',_0x0d8b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x0d8b('0x3')]},'interval':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':_0x0d8b('0xa')},'IntervalId':{'type':Sequelize[_0x0d8b('0xb')]},'isApp':{'type':Sequelize[_0x0d8b('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0d8b('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0xd')},'answer':{'type':Sequelize[_0x0d8b('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 6d6ed48..1ed84a8 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 _0x54aa=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','limit','undefined','count','offset','set','Content-Range','json','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceExtension','rawAttributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x54aa,0x155));var _0xa54a=function(_0x4c5b62,_0x40d6fe){_0x4c5b62=_0x4c5b62-0x0;var _0x4088ff=_0x54aa[_0x4c5b62];return _0x4088ff;};'use strict';var _=require(_0xa54a('0x0'));var Redis=require(_0xa54a('0x1'));var qs=require(_0xa54a('0x2'));var logger=require(_0xa54a('0x3'))(_0xa54a('0x4'));var config=require('../../config/environment');var db=require(_0xa54a('0x5'))['db'];config[_0xa54a('0x6')]=_[_0xa54a('0x7')](config[_0xa54a('0x6')],{'host':_0xa54a('0x8'),'port':0x18eb});var socket=require(_0xa54a('0x9'))(new Redis(config[_0xa54a('0x6')]));require(_0xa54a('0xa'))[_0xa54a('0xb')](socket);function respondWithStatusCode(_0x2b6397,_0x4a12ec){_0x4a12ec=_0x4a12ec||0xcc;return function(_0xc0d102){if(_0xc0d102){return _0x2b6397['sendStatus'](_0x4a12ec);}return _0x2b6397['status'](_0x4a12ec)['end']();};}function respondWithResult(_0x29782c,_0x477e83){_0x477e83=_0x477e83||0xc8;return function(_0x409c52){if(_0x409c52){return _0x29782c[_0xa54a('0xc')](_0x477e83)['json'](_0x409c52);}};}function respondWithFilteredResult(_0x4dd088,_0x358a37){return function(_0x1de7a7){if(_0x1de7a7){var _0x47df91=typeof _0x358a37['offset']==='undefined'&&typeof _0x358a37[_0xa54a('0xd')]===_0xa54a('0xe');var _0x27b578=_0x1de7a7[_0xa54a('0xf')];var _0x5cf3a5=_0x47df91?0x0:_0x358a37['offset'];var _0x342223=_0x47df91?_0x1de7a7[_0xa54a('0xf')]:_0x358a37[_0xa54a('0x10')]+_0x358a37[_0xa54a('0xd')];var _0x4010ee;if(_0x342223>=_0x27b578){_0x342223=_0x27b578;_0x4010ee=0xc8;}else{_0x4010ee=0xce;}_0x4dd088[_0xa54a('0xc')](_0x4010ee);return _0x4dd088[_0xa54a('0x11')](_0xa54a('0x12'),_0x5cf3a5+'-'+_0x342223+'/'+_0x27b578)[_0xa54a('0x13')](_0x1de7a7);}return null;};}function removeEntity(_0x45a1c3){return function(_0x50b04e){if(_0x50b04e){return _0x50b04e[_0xa54a('0x14')]()['then'](function(){var _0x2e6266=_0x50b04e[_0xa54a('0x15')]({'plain':!![]});var _0x970274=[{'name':_0xa54a('0x16'),'value':_0xa54a('0x17'),'ignore':![]},{'name':_0xa54a('0x18'),'value':_0xa54a('0x19'),'ignore':![]},{'name':_0xa54a('0x1a'),'value':_0xa54a('0x1b'),'ignore':![]}];var _0x361100=_(_0x970274)[_0xa54a('0x1c')](_0xa54a('0x1d'))[_0xa54a('0x1e')](_0xa54a('0x1f'))[_0xa54a('0x1f')]();if(_['includes'](_0x361100,_0x2e6266['type'])){return;}var _0x1b5b35=_['find'](_0x970274,[_0xa54a('0x1f'),_0x2e6266[_0xa54a('0x20')]])['name'];return db[_0xa54a('0x21')][_0xa54a('0x14')]({'where':{'type':_0x1b5b35,'resourceId':_0x2e6266['id']}})[_0xa54a('0x22')](function(){return _0x50b04e;});})[_0xa54a('0x22')](function(){_0x45a1c3[_0xa54a('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2941cc){return function(_0x193ad4){if(!_0x193ad4){_0x2941cc[_0xa54a('0x23')](0x194);}return _0x193ad4;};}function handleError(_0x56f9c7,_0x364494){_0x364494=_0x364494||0x1f4;return function(_0x4f49ae){logger[_0xa54a('0x24')](_0x4f49ae[_0xa54a('0x25')]);if(_0x4f49ae['name']){delete _0x4f49ae[_0xa54a('0x26')];}_0x56f9c7[_0xa54a('0xc')](_0x364494)[_0xa54a('0x27')](_0x4f49ae);};}exports[_0xa54a('0x28')]=function(_0x3f180d,_0x323a44){var _0x4b3be1={},_0x2a4001={},_0x14bba8={'count':0x0,'rows':[]};var _0x375e3d=_[_0xa54a('0x1e')](db[_0xa54a('0x29')][_0xa54a('0x2a')],function(_0x2f44c9){return{'name':_0x2f44c9[_0xa54a('0x2b')],'type':_0x2f44c9[_0xa54a('0x20')][_0xa54a('0x2c')]};});_0x2a4001[_0xa54a('0x2d')]=_[_0xa54a('0x1e')](_0x375e3d,_0xa54a('0x26'));_0x2a4001[_0xa54a('0x2e')]=_[_0xa54a('0x2f')](_0x3f180d[_0xa54a('0x2e')]);_0x2a4001[_0xa54a('0x30')]=_[_0xa54a('0x31')](_0x2a4001[_0xa54a('0x2d')],_0x2a4001[_0xa54a('0x2e')]);_0x4b3be1[_0xa54a('0x32')]=_['intersection'](_0x2a4001['model'],qs[_0xa54a('0x33')](_0x3f180d[_0xa54a('0x2e')][_0xa54a('0x33')]));_0x4b3be1[_0xa54a('0x32')]=_0x4b3be1[_0xa54a('0x32')][_0xa54a('0x34')]?_0x4b3be1[_0xa54a('0x32')]:_0x2a4001[_0xa54a('0x2d')];if(!_0x3f180d[_0xa54a('0x2e')][_0xa54a('0x35')](_0xa54a('0x36'))){_0x4b3be1[_0xa54a('0xd')]=qs['limit'](_0x3f180d['query'][_0xa54a('0xd')]);_0x4b3be1[_0xa54a('0x10')]=qs[_0xa54a('0x10')](_0x3f180d[_0xa54a('0x2e')][_0xa54a('0x10')]);}_0x4b3be1[_0xa54a('0x37')]=qs[_0xa54a('0x38')](_0x3f180d[_0xa54a('0x2e')][_0xa54a('0x38')]);_0x4b3be1[_0xa54a('0x39')]=qs[_0xa54a('0x30')](_[_0xa54a('0x3a')](_0x3f180d[_0xa54a('0x2e')],_0x2a4001[_0xa54a('0x30')]),_0x375e3d);if(_0x3f180d['query'][_0xa54a('0x1c')]){_0x4b3be1[_0xa54a('0x39')]=_[_0xa54a('0x3b')](_0x4b3be1['where'],{'$or':_[_0xa54a('0x1e')](_0x375e3d,function(_0x5dba38){if(_0x5dba38[_0xa54a('0x20')]!==_0xa54a('0x3c')){var _0x3bece4={};_0x3bece4[_0x5dba38[_0xa54a('0x26')]]={'$like':'%'+_0x3f180d[_0xa54a('0x2e')]['filter']+'%'};return _0x3bece4;}})});}_0x4b3be1=_[_0xa54a('0x3b')]({},_0x4b3be1,_0x3f180d[_0xa54a('0x3d')]);var _0x436b47={'where':_0x4b3be1[_0xa54a('0x39')]};return db[_0xa54a('0x29')]['count'](_0x436b47)[_0xa54a('0x22')](function(_0x341c1c){_0x14bba8['count']=_0x341c1c;if(_0x3f180d[_0xa54a('0x2e')][_0xa54a('0x3e')]){_0x4b3be1[_0xa54a('0x3f')]=[{'all':!![]}];}return db['VoiceExtension'][_0xa54a('0x40')](_0x4b3be1);})[_0xa54a('0x22')](function(_0x4737c9){_0x14bba8[_0xa54a('0x41')]=_0x4737c9;return _0x14bba8;})['then'](respondWithFilteredResult(_0x323a44,_0x4b3be1))[_0xa54a('0x42')](handleError(_0x323a44,null));};exports['show']=function(_0x12f047,_0x1b06b4){var _0x36e467={'raw':![],'where':{'id':_0x12f047[_0xa54a('0x43')]['id']}},_0x240e55={};_0x240e55[_0xa54a('0x2d')]=_[_0xa54a('0x2f')](db[_0xa54a('0x29')][_0xa54a('0x2a')]);_0x240e55[_0xa54a('0x2e')]=_[_0xa54a('0x2f')](_0x12f047[_0xa54a('0x2e')]);_0x240e55[_0xa54a('0x30')]=_['intersection'](_0x240e55[_0xa54a('0x2d')],_0x240e55[_0xa54a('0x2e')]);_0x36e467[_0xa54a('0x32')]=_[_0xa54a('0x31')](_0x240e55[_0xa54a('0x2d')],qs[_0xa54a('0x33')](_0x12f047['query'][_0xa54a('0x33')]));_0x36e467[_0xa54a('0x32')]=_0x36e467[_0xa54a('0x32')][_0xa54a('0x34')]?_0x36e467[_0xa54a('0x32')]:_0x240e55[_0xa54a('0x2d')];if(_0x12f047[_0xa54a('0x2e')][_0xa54a('0x3e')]){_0x36e467[_0xa54a('0x3f')]=[{'all':!![]}];}_0x36e467=_[_0xa54a('0x3b')]({},_0x36e467,_0x12f047[_0xa54a('0x3d')]);return db['VoiceExtension']['find'](_0x36e467)[_0xa54a('0x22')](handleEntityNotFound(_0x1b06b4,null))[_0xa54a('0x22')](respondWithResult(_0x1b06b4,null))[_0xa54a('0x42')](handleError(_0x1b06b4,null));};exports[_0xa54a('0x14')]=function(_0x1aac5d,_0x222a2a){return db['VoiceExtension'][_0xa54a('0x44')]({'where':{'id':_0x1aac5d[_0xa54a('0x43')]['id']}})[_0xa54a('0x22')](handleEntityNotFound(_0x222a2a,null))['then'](removeEntity(_0x222a2a,null))[_0xa54a('0x42')](handleError(_0x222a2a,null));};exports[_0xa54a('0x45')]=function(_0x103a5a,_0xefba40){if(_0x103a5a[_0xa54a('0x46')][_0xa54a('0x20')]===_0xa54a('0x19')&&!_[_0xa54a('0x47')](_0x103a5a[_0xa54a('0x46')][_0xa54a('0x48')],'_')){_0x103a5a[_0xa54a('0x46')][_0xa54a('0x48')]='_'['concat'](_0x103a5a[_0xa54a('0x46')][_0xa54a('0x48')]);}return db[_0xa54a('0x29')]['create'](_0x103a5a[_0xa54a('0x46')],{'raw':![]})[_0xa54a('0x22')](function(_0x46bee6){var _0x1760f2=_0x103a5a[_0xa54a('0x49')][_0xa54a('0x15')]({'plain':!![]});if(!_0x1760f2)throw new Error(_0xa54a('0x4a'));if(_0x1760f2[_0xa54a('0x4b')]===_0xa54a('0x49')){var _0x1cbbff=_0x46bee6[_0xa54a('0x15')]({'plain':!![]});var _0x41974a=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':_0xa54a('0x19')},{'name':_0xa54a('0x1a'),'value':'internal'}];var _0x336d95=_['find'](_0x41974a,[_0xa54a('0x1f'),_0x1cbbff['type']])[_0xa54a('0x26')];return db[_0xa54a('0x4c')][_0xa54a('0x44')]({'where':{'name':_0x336d95,'userProfileId':_0x1760f2[_0xa54a('0x4d')]},'raw':!![]})[_0xa54a('0x22')](function(_0x4c8685){if(_0x4c8685&&_0x4c8685['autoAssociation']===0x0){return db[_0xa54a('0x21')][_0xa54a('0x45')]({'name':_0x1cbbff[_0xa54a('0x26')],'resourceId':_0x1cbbff['id'],'type':_0x4c8685[_0xa54a('0x26')],'sectionId':_0x4c8685['id']},{})['then'](function(){return _0x46bee6;});}else{return _0x46bee6;}})[_0xa54a('0x42')](function(_0x45c027){logger[_0xa54a('0x24')](_0xa54a('0x4e'),_0x45c027);throw _0x45c027;});}return _0x46bee6;})['then'](respondWithResult(_0xefba40,0xc9))[_0xa54a('0x42')](handleError(_0xefba40,null));};exports[_0xa54a('0x4f')]=function(_0x2ebe0f,_0x14e1e2){if(_0x2ebe0f['body']['id']){delete _0x2ebe0f['body']['id'];}return db[_0xa54a('0x29')][_0xa54a('0x44')]({'where':{'id':_0x2ebe0f[_0xa54a('0x43')]['id']}})['then'](handleEntityNotFound(_0x14e1e2,null))[_0xa54a('0x22')](function(_0x166b0e){if(_0x166b0e){return db[_0xa54a('0x29')][_0xa54a('0x4f')](_[_0xa54a('0x3a')](_0x2ebe0f[_0xa54a('0x46')],['exten',_0xa54a('0x50'),_0xa54a('0x51'),_0xa54a('0x52'),_0xa54a('0x53'),'mandatoryDisposition',_0xa54a('0x54')]),{'where':{'context':_0x166b0e['context'],'exten':_0x166b0e[_0xa54a('0x48')]},'individualHooks':!![]})[_0xa54a('0x22')](function(_0x30bcf8){return _0x30bcf8;});}return null;})[_0xa54a('0x22')](respondWithStatusCode(_0x14e1e2,null))['catch'](handleError(_0x14e1e2,null));};exports[_0xa54a('0x55')]=function(_0x3e1cff,_0x41f30d){var _0x1626a6=_0x3e1cff[_0xa54a('0x43')]['id'];var _0x21fde4=_0x3e1cff[_0xa54a('0x46')];var _0x25fbfc=0xc8;var _0x5a878d=null;return db['sequelize'][_0xa54a('0x56')]({'isolationLevel':db[_0xa54a('0x57')][_0xa54a('0x58')][_0xa54a('0x59')][_0xa54a('0x5a')]},function(_0x167893){return db[_0xa54a('0x29')][_0xa54a('0x5b')]({'where':{'id':_0x1626a6},'transaction':_0x167893})[_0xa54a('0x22')](function(_0x128271){if(_0x128271){return db['VoiceExtension'][_0xa54a('0x14')]({'where':{'VoiceExtensionId':_0x1626a6},'transaction':_0x167893})[_0xa54a('0x22')](function(){var _0x3bdab2=_[_0xa54a('0x1e')](_0x21fde4,function(_0x13590b){_0x13590b[_0xa54a('0x5c')]=_0x1626a6;_0x13590b['isApp']=!![];return _0x13590b;});return _0x128271[_0xa54a('0x5d')](_0x3bdab2);})['then'](function(_0x4a17a0){return db[_0xa54a('0x29')]['bulkCreate'](_0x4a17a0,{'transaction':_0x167893});});}else{_0x25fbfc=0x194;_0x5a878d=[];}});})[_0xa54a('0x22')](function(){if(_0x25fbfc!==0x194){return db[_0xa54a('0x29')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1626a6},'order':_0xa54a('0x5e')})[_0xa54a('0x22')](function(_0x14bf01){_0x5a878d=_0x14bf01;});}})['catch'](function(_0x4e7019){_0x25fbfc=0x1f4;logger[_0xa54a('0x24')](_0x4e7019[_0xa54a('0x25')]);if(_0x4e7019[_0xa54a('0x26')]){delete _0x4e7019[_0xa54a('0x26')];}_0x5a878d=_0x4e7019;})[_0xa54a('0x5f')](function(){if(_0x5a878d===null){_0x41f30d[_0xa54a('0x23')](_0x25fbfc);}else{if(_0x25fbfc===0x1f4){_0x41f30d[_0xa54a('0xc')](_0x25fbfc)[_0xa54a('0x27')](_0x5a878d);}else{_0x41f30d[_0xa54a('0xc')](_0x25fbfc)[_0xa54a('0x13')](_0x5a878d);}}});}; \ No newline at end of file +var _0xea7f=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','exten','concat','user','internal','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','find','type','name','error','stack','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea7f,0xe0));var _0xfea7=function(_0x2130e3,_0xa754ef){_0x2130e3=_0x2130e3-0x0;var _0xea07ba=_0xea7f[_0x2130e3];return _0xea07ba;};'use strict';var _=require(_0xfea7('0x0'));var Redis=require(_0xfea7('0x1'));var qs=require(_0xfea7('0x2'));var logger=require(_0xfea7('0x3'))('api');var config=require('../../config/environment');var db=require(_0xfea7('0x4'))['db'];config[_0xfea7('0x5')]=_[_0xfea7('0x6')](config[_0xfea7('0x5')],{'host':_0xfea7('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfea7('0x5')]));require(_0xfea7('0x8'))[_0xfea7('0x9')](socket);function respondWithStatusCode(_0x2bd947,_0x5516c6){_0x5516c6=_0x5516c6||0xcc;return function(_0x205cf0){if(_0x205cf0){return _0x2bd947[_0xfea7('0xa')](_0x5516c6);}return _0x2bd947['status'](_0x5516c6)[_0xfea7('0xb')]();};}function respondWithResult(_0x1cd5f2,_0x345554){_0x345554=_0x345554||0xc8;return function(_0x433243){if(_0x433243){return _0x1cd5f2[_0xfea7('0xc')](_0x345554)[_0xfea7('0xd')](_0x433243);}};}function respondWithFilteredResult(_0x155be6,_0x29e1e7){return function(_0xabc298){if(_0xabc298){var _0x392f0d=typeof _0x29e1e7[_0xfea7('0xe')]==='undefined'&&typeof _0x29e1e7[_0xfea7('0xf')]==='undefined';var _0x354c81=_0xabc298[_0xfea7('0x10')];var _0x70b93b=_0x392f0d?0x0:_0x29e1e7['offset'];var _0x17bd73=_0x392f0d?_0xabc298['count']:_0x29e1e7[_0xfea7('0xe')]+_0x29e1e7[_0xfea7('0xf')];var _0x49c54e;if(_0x17bd73>=_0x354c81){_0x17bd73=_0x354c81;_0x49c54e=0xc8;}else{_0x49c54e=0xce;}_0x155be6[_0xfea7('0xc')](_0x49c54e);return _0x155be6[_0xfea7('0x11')](_0xfea7('0x12'),_0x70b93b+'-'+_0x17bd73+'/'+_0x354c81)[_0xfea7('0xd')](_0xabc298);}return null;};}function removeEntity(_0x147d0a){return function(_0x155148){if(_0x155148){return _0x155148[_0xfea7('0x13')]()[_0xfea7('0x14')](function(){var _0x278882=_0x155148[_0xfea7('0x15')]({'plain':!![]});var _0x16017e=[{'name':'InboundRoutes','value':_0xfea7('0x16'),'ignore':![]},{'name':_0xfea7('0x17'),'value':_0xfea7('0x18'),'ignore':![]},{'name':_0xfea7('0x19'),'value':'internal','ignore':![]}];var _0x2fc8ad=_(_0x16017e)['filter'](_0xfea7('0x1a'))[_0xfea7('0x1b')](_0xfea7('0x1c'))[_0xfea7('0x1c')]();if(_['includes'](_0x2fc8ad,_0x278882['type'])){return;}var _0x4d0de0=_[_0xfea7('0x1d')](_0x16017e,[_0xfea7('0x1c'),_0x278882[_0xfea7('0x1e')]])[_0xfea7('0x1f')];return db['UserProfileResource'][_0xfea7('0x13')]({'where':{'type':_0x4d0de0,'resourceId':_0x278882['id']}})[_0xfea7('0x14')](function(){return _0x155148;});})['then'](function(){_0x147d0a[_0xfea7('0xc')](0xcc)[_0xfea7('0xb')]();});}};}function handleEntityNotFound(_0x243caf){return function(_0x173a51){if(!_0x173a51){_0x243caf['sendStatus'](0x194);}return _0x173a51;};}function handleError(_0x54b028,_0xd8d780){_0xd8d780=_0xd8d780||0x1f4;return function(_0x2c7404){logger[_0xfea7('0x20')](_0x2c7404[_0xfea7('0x21')]);if(_0x2c7404['name']){delete _0x2c7404[_0xfea7('0x1f')];}_0x54b028['status'](_0xd8d780)['send'](_0x2c7404);};}exports['index']=function(_0x33946c,_0xdff81f){var _0x486193={},_0x5c23f2={},_0x49333c={'count':0x0,'rows':[]};var _0x43b72b=_[_0xfea7('0x1b')](db[_0xfea7('0x22')][_0xfea7('0x23')],function(_0x212161){return{'name':_0x212161[_0xfea7('0x24')],'type':_0x212161[_0xfea7('0x1e')][_0xfea7('0x25')]};});_0x5c23f2['model']=_[_0xfea7('0x1b')](_0x43b72b,'name');_0x5c23f2[_0xfea7('0x26')]=_[_0xfea7('0x27')](_0x33946c[_0xfea7('0x26')]);_0x5c23f2[_0xfea7('0x28')]=_['intersection'](_0x5c23f2[_0xfea7('0x29')],_0x5c23f2[_0xfea7('0x26')]);_0x486193[_0xfea7('0x2a')]=_[_0xfea7('0x2b')](_0x5c23f2[_0xfea7('0x29')],qs[_0xfea7('0x2c')](_0x33946c[_0xfea7('0x26')][_0xfea7('0x2c')]));_0x486193[_0xfea7('0x2a')]=_0x486193[_0xfea7('0x2a')][_0xfea7('0x2d')]?_0x486193[_0xfea7('0x2a')]:_0x5c23f2[_0xfea7('0x29')];if(!_0x33946c[_0xfea7('0x26')][_0xfea7('0x2e')](_0xfea7('0x2f'))){_0x486193['limit']=qs[_0xfea7('0xf')](_0x33946c[_0xfea7('0x26')]['limit']);_0x486193['offset']=qs['offset'](_0x33946c[_0xfea7('0x26')][_0xfea7('0xe')]);}_0x486193[_0xfea7('0x30')]=qs[_0xfea7('0x31')](_0x33946c['query'][_0xfea7('0x31')]);_0x486193[_0xfea7('0x32')]=qs[_0xfea7('0x28')](_[_0xfea7('0x33')](_0x33946c['query'],_0x5c23f2[_0xfea7('0x28')]),_0x43b72b);if(_0x33946c[_0xfea7('0x26')][_0xfea7('0x34')]){_0x486193[_0xfea7('0x32')]=_[_0xfea7('0x35')](_0x486193[_0xfea7('0x32')],{'$or':_[_0xfea7('0x1b')](_0x43b72b,function(_0x399e3f){if(_0x399e3f[_0xfea7('0x1e')]!==_0xfea7('0x36')){var _0x20caa9={};_0x20caa9[_0x399e3f['name']]={'$like':'%'+_0x33946c[_0xfea7('0x26')]['filter']+'%'};return _0x20caa9;}})});}_0x486193=_['merge']({},_0x486193,_0x33946c[_0xfea7('0x37')]);var _0x2d2e2f={'where':_0x486193[_0xfea7('0x32')]};return db[_0xfea7('0x22')][_0xfea7('0x10')](_0x2d2e2f)[_0xfea7('0x14')](function(_0x313b61){_0x49333c[_0xfea7('0x10')]=_0x313b61;if(_0x33946c[_0xfea7('0x26')][_0xfea7('0x38')]){_0x486193[_0xfea7('0x39')]=[{'all':!![]}];}return db[_0xfea7('0x22')][_0xfea7('0x3a')](_0x486193);})[_0xfea7('0x14')](function(_0x14bf7d){_0x49333c[_0xfea7('0x3b')]=_0x14bf7d;return _0x49333c;})[_0xfea7('0x14')](respondWithFilteredResult(_0xdff81f,_0x486193))[_0xfea7('0x3c')](handleError(_0xdff81f,null));};exports[_0xfea7('0x3d')]=function(_0x4ba717,_0xc2ef7){var _0x24a32b={'raw':![],'where':{'id':_0x4ba717[_0xfea7('0x3e')]['id']}},_0x34e6a4={};_0x34e6a4[_0xfea7('0x29')]=_['keys'](db[_0xfea7('0x22')]['rawAttributes']);_0x34e6a4['query']=_[_0xfea7('0x27')](_0x4ba717[_0xfea7('0x26')]);_0x34e6a4[_0xfea7('0x28')]=_[_0xfea7('0x2b')](_0x34e6a4[_0xfea7('0x29')],_0x34e6a4[_0xfea7('0x26')]);_0x24a32b[_0xfea7('0x2a')]=_[_0xfea7('0x2b')](_0x34e6a4[_0xfea7('0x29')],qs['fields'](_0x4ba717[_0xfea7('0x26')]['fields']));_0x24a32b['attributes']=_0x24a32b[_0xfea7('0x2a')]['length']?_0x24a32b[_0xfea7('0x2a')]:_0x34e6a4[_0xfea7('0x29')];if(_0x4ba717[_0xfea7('0x26')][_0xfea7('0x38')]){_0x24a32b[_0xfea7('0x39')]=[{'all':!![]}];}_0x24a32b=_[_0xfea7('0x35')]({},_0x24a32b,_0x4ba717[_0xfea7('0x37')]);return db['VoiceExtension'][_0xfea7('0x1d')](_0x24a32b)[_0xfea7('0x14')](handleEntityNotFound(_0xc2ef7,null))[_0xfea7('0x14')](respondWithResult(_0xc2ef7,null))['catch'](handleError(_0xc2ef7,null));};exports['destroy']=function(_0x410cae,_0x421b3f){return db[_0xfea7('0x22')][_0xfea7('0x1d')]({'where':{'id':_0x410cae[_0xfea7('0x3e')]['id']}})['then'](handleEntityNotFound(_0x421b3f,null))[_0xfea7('0x14')](removeEntity(_0x421b3f,null))[_0xfea7('0x3c')](handleError(_0x421b3f,null));};exports[_0xfea7('0x3f')]=function(_0x62b538,_0x18b7c8){if(_0x62b538[_0xfea7('0x40')][_0xfea7('0x1e')]===_0xfea7('0x18')&&!_['startsWith'](_0x62b538[_0xfea7('0x40')]['exten'],'_')){_0x62b538[_0xfea7('0x40')][_0xfea7('0x41')]='_'[_0xfea7('0x42')](_0x62b538[_0xfea7('0x40')][_0xfea7('0x41')]);}return db['VoiceExtension'][_0xfea7('0x3f')](_0x62b538['body'],{'raw':![]})[_0xfea7('0x14')](function(_0x37835c){var _0x29acb2=_0x62b538[_0xfea7('0x43')][_0xfea7('0x15')]({'plain':!![]});if(!_0x29acb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29acb2['role']==='user'){var _0x1a377a=_0x37835c[_0xfea7('0x15')]({'plain':!![]});var _0x442eee=[{'name':'InboundRoutes','value':_0xfea7('0x16')},{'name':'OutboundRoutes','value':_0xfea7('0x18')},{'name':_0xfea7('0x19'),'value':_0xfea7('0x44')}];var _0x2015b3=_[_0xfea7('0x1d')](_0x442eee,['value',_0x1a377a[_0xfea7('0x1e')]])['name'];return db['UserProfileSection'][_0xfea7('0x1d')]({'where':{'name':_0x2015b3,'userProfileId':_0x29acb2[_0xfea7('0x45')]},'raw':!![]})[_0xfea7('0x14')](function(_0x8a7c41){if(_0x8a7c41&&_0x8a7c41[_0xfea7('0x46')]===0x0){return db['UserProfileResource'][_0xfea7('0x3f')]({'name':_0x1a377a[_0xfea7('0x1f')],'resourceId':_0x1a377a['id'],'type':_0x8a7c41['name'],'sectionId':_0x8a7c41['id']},{})[_0xfea7('0x14')](function(){return _0x37835c;});}else{return _0x37835c;}})[_0xfea7('0x3c')](function(_0x55f502){logger['error'](_0xfea7('0x47'),_0x55f502);throw _0x55f502;});}return _0x37835c;})['then'](respondWithResult(_0x18b7c8,0xc9))[_0xfea7('0x3c')](handleError(_0x18b7c8,null));};exports[_0xfea7('0x48')]=function(_0x233801,_0xfbda90){if(_0x233801[_0xfea7('0x40')]['id']){delete _0x233801[_0xfea7('0x40')]['id'];}return db['VoiceExtension'][_0xfea7('0x1d')]({'where':{'id':_0x233801['params']['id']}})[_0xfea7('0x14')](handleEntityNotFound(_0xfbda90,null))[_0xfea7('0x14')](function(_0x427527){if(_0x427527){return db[_0xfea7('0x22')][_0xfea7('0x48')](_[_0xfea7('0x33')](_0x233801[_0xfea7('0x40')],[_0xfea7('0x41'),_0xfea7('0x49'),_0xfea7('0x4a'),_0xfea7('0x4b'),'cutdigits',_0xfea7('0x4c'),_0xfea7('0x4d')]),{'where':{'context':_0x427527[_0xfea7('0x49')],'exten':_0x427527[_0xfea7('0x41')]},'individualHooks':!![]})[_0xfea7('0x14')](function(_0x5e40e6){return _0x5e40e6;});}return null;})['then'](respondWithStatusCode(_0xfbda90,null))[_0xfea7('0x3c')](handleError(_0xfbda90,null));};exports[_0xfea7('0x4e')]=function(_0x303c62,_0x46e5ea){var _0x65c2a6=_0x303c62[_0xfea7('0x3e')]['id'];var _0x3e655c=_0x303c62[_0xfea7('0x40')];var _0x20f02b=0xc8;var _0x32c99e=null;return db['sequelize'][_0xfea7('0x4f')]({'isolationLevel':db[_0xfea7('0x50')][_0xfea7('0x51')][_0xfea7('0x52')][_0xfea7('0x53')]},function(_0x37bae7){return db[_0xfea7('0x22')][_0xfea7('0x54')]({'where':{'id':_0x65c2a6},'transaction':_0x37bae7})['then'](function(_0x5dd3c6){if(_0x5dd3c6){return db[_0xfea7('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x65c2a6},'transaction':_0x37bae7})[_0xfea7('0x14')](function(){var _0x55deca=_[_0xfea7('0x1b')](_0x3e655c,function(_0x480315){_0x480315[_0xfea7('0x55')]=_0x65c2a6;_0x480315[_0xfea7('0x56')]=!![];return _0x480315;});return _0x5dd3c6[_0xfea7('0x57')](_0x55deca);})[_0xfea7('0x14')](function(_0x5bd692){return db[_0xfea7('0x22')][_0xfea7('0x58')](_0x5bd692,{'transaction':_0x37bae7});});}else{_0x20f02b=0x194;_0x32c99e=[];}});})[_0xfea7('0x14')](function(){if(_0x20f02b!==0x194){return db[_0xfea7('0x22')][_0xfea7('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x65c2a6},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x59cbb6){_0x32c99e=_0x59cbb6;});}})[_0xfea7('0x3c')](function(_0x41f793){_0x20f02b=0x1f4;logger[_0xfea7('0x20')](_0x41f793[_0xfea7('0x21')]);if(_0x41f793['name']){delete _0x41f793[_0xfea7('0x1f')];}_0x32c99e=_0x41f793;})[_0xfea7('0x5a')](function(){if(_0x32c99e===null){_0x46e5ea['sendStatus'](_0x20f02b);}else{if(_0x20f02b===0x1f4){_0x46e5ea['status'](_0x20f02b)['send'](_0x32c99e);}else{_0x46e5ea[_0xfea7('0xc')](_0x20f02b)['json'](_0x32c99e);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7616468..7049cb4 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 _0x217c=['exports','events','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d31de,_0xf3a605){var _0x5a4f13=function(_0x45e777){while(--_0x45e777){_0x3d31de['push'](_0x3d31de['shift']());}};_0x5a4f13(++_0xf3a605);}(_0x217c,0x172));var _0xc217=function(_0x307af9,_0x1d6195){_0x307af9=_0x307af9-0x0;var _0xd6a374=_0x217c[_0x307af9];return _0xd6a374;};'use strict';var EventEmitter=require(_0xc217('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xc217('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc217('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc217('0x3'),'afterDestroy':_0xc217('0x4')};function emitEvent(_0x2b1ac8){return function(_0x17d41f,_0x3d7e76,_0x187bc0){VoiceExtensionEvents[_0xc217('0x5')](_0x2b1ac8+':'+_0x17d41f['id'],_0x17d41f);VoiceExtensionEvents[_0xc217('0x5')](_0x2b1ac8,_0x17d41f);_0x187bc0(null);};}for(var e in events){if(events[_0xc217('0x6')](e)){var event=events[e];VoiceExtension[_0xc217('0x7')](e,emitEvent(event));}}module[_0xc217('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xdf52=['../../mysqldb','setMaxListeners','save','update','emit','exports','events'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0xdf52,0xb5));var _0x2df5=function(_0x30cac1,_0x448dfc){_0x30cac1=_0x30cac1-0x0;var _0xef9456=_0xdf52[_0x30cac1];return _0xef9456;};'use strict';var EventEmitter=require(_0x2df5('0x0'));var VoiceExtension=require(_0x2df5('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2df5('0x2')](0x0);var events={'afterCreate':_0x2df5('0x3'),'afterUpdate':_0x2df5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5eb75b){return function(_0x11471c,_0x3a952f,_0x6b1b27){VoiceExtensionEvents[_0x2df5('0x5')](_0x5eb75b+':'+_0x11471c['id'],_0x11471c);VoiceExtensionEvents['emit'](_0x5eb75b,_0x11471c);_0x6b1b27(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2df5('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 800b994..17db932 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 _0x4454=['tag','toLowerCase','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','appType','appdata','agi','priority','last','catch','define','VoiceExtension','voice_extensions','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','exten','inbound','push','Set','context','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','then','*,*,*,*','intervals','interval','IntervalId','filter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4454,0x6c));var _0x4445=function(_0x8aeb58,_0x13d059){_0x8aeb58=_0x8aeb58-0x0;var _0x9b7f8=_0x4454[_0x8aeb58];return _0x9b7f8;};'use strict';var _=require(_0x4445('0x0'));var attributes=require(_0x4445('0x1'));module[_0x4445('0x2')]=function(_0x44fb06){var _0x48169f=_0x44fb06[_0x4445('0x3')];function _0x16fe3c(_0x50623a){var _0x80d978=0x2;var _0x1eacc7=[{'type':_0x50623a[_0x4445('0x4')],'app':'Set','appdata':_0x4445('0x5')+_0x50623a[_0x4445('0x4')],'context':_0x50623a['context'],'exten':_0x50623a[_0x4445('0x6')],'priority':_0x80d978++,'VoiceExtensionId':_0x50623a['id']}];if(_0x50623a[_0x4445('0x4')]===_0x4445('0x7')){_0x1eacc7[_0x4445('0x8')]({'type':_0x4445('0x7'),'app':'Set','appdata':'CDR(routeid)='+_0x50623a['id'],'context':_0x50623a['context'],'exten':_0x50623a['exten'],'priority':_0x80d978++,'VoiceExtensionId':_0x50623a['id']});}_0x1eacc7[_0x4445('0x8')]({'type':_0x50623a[_0x4445('0x4')],'app':_0x4445('0x9'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x50623a[_0x4445('0xa')],'exten':_0x50623a['exten'],'priority':_0x80d978++,'VoiceExtensionId':_0x50623a['id']},{'type':_0x50623a[_0x4445('0x4')],'app':'Set','appdata':_0x4445('0xb'),'context':_0x50623a[_0x4445('0xa')],'exten':_0x50623a[_0x4445('0x6')],'priority':_0x80d978++,'VoiceExtensionId':_0x50623a['id']},{'type':_0x50623a[_0x4445('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x50623a[_0x4445('0xa')],'exten':_0x50623a[_0x4445('0x6')],'priority':_0x80d978++,'VoiceExtensionId':_0x50623a['id']});return _0x1eacc7;}function _0x4d208b(_0x30d500){var _0x5e1814=0x2;var _0x3acb2a=[{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x4445('0xd'),'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x4445('0xe')+(_0x30d500['cutdigits']?_0x4445('0xf')+_0x30d500[_0x4445('0x10')]+'}':_0x4445('0x11')),'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':'outbound','app':'Set','appdata':_0x4445('0x12')+_0x30d500['id'],'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':'ExecIf','appdata':_0x4445('0x13')+(_0x5e1814+0x2)+_0x4445('0x14')+(_0x5e1814+0x1)+')','context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x30d500[_0x4445('0x10')]?'CDR(prefix)=${EXTEN:0:'+_0x30d500[_0x4445('0x10')]+'}':'CDR(prefix)=noprefix','context':_0x30d500['context'],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':'outbound','app':_0x4445('0x9'),'appdata':_0x4445('0x15'),'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':'Set','appdata':_0x4445('0xb'),'context':_0x30d500['context'],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x4445('0x16'),'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x4445('0x17')+_0x30d500['id'],'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500['exten'],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']}];if(_0x30d500[_0x4445('0x18')](_0x4445('0x19'))&&_0x30d500[_0x4445('0x19')]!==_0x4445('0x1a')){_0x3acb2a[_0x4445('0x8')]({'type':_0x4445('0xc'),'app':'Set','appdata':_0x4445('0x1b'),'context':_0x30d500['context'],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']},{'type':_0x4445('0xc'),'app':_0x4445('0x9'),'appdata':_0x4445('0x1c')+_0x30d500[_0x4445('0x19')]||_0x4445('0x1d'),'context':_0x30d500[_0x4445('0xa')],'exten':_0x30d500[_0x4445('0x6')],'priority':_0x5e1814++,'VoiceExtensionId':_0x30d500['id']});}return _0x3acb2a;}function _0x144520(_0x56147c,_0x1bc68b){var _0xbe93a2=[{'name':_0x4445('0x1e'),'param':0x0},{'name':_0x4445('0x1f'),'param':0x1},{'name':_0x4445('0x20'),'param':0x2},{'name':_0x4445('0x21'),'param':0x3}];var _0x9937a3={};var _0x19ec07=_0x1bc68b['split'](',');var _0x221dfa=[];for(var _0x5f1927=0x0;_0x5f1927<_0xbe93a2[_0x4445('0x22')];_0x5f1927++){switch(_0xbe93a2[_0x5f1927][_0x4445('0x23')]){case'trunk':_0x9937a3[_0x4445('0x1e')]=_0x19ec07[_0xbe93a2[_0x5f1927][_0x4445('0x24')]][_0x4445('0x25')]('/')[0x1];_0x9937a3[_0x4445('0x26')]=_0x19ec07[_0xbe93a2[_0x5f1927]['param']]['split']('/')[0x2];_0x9937a3[_0x4445('0x27')]=_0x9937a3[_0x4445('0x26')]?_0x9937a3['phone'][_0x4445('0x25')]('$')[0x0]:undefined;_0x9937a3[_0x4445('0x26')]=_0x56147c[_0x4445('0x10')]?(_0x9937a3[_0x4445('0x27')]||'')+_0x4445('0xf')+_0x56147c[_0x4445('0x10')]+'}':(_0x9937a3[_0x4445('0x27')]||'')+_0x4445('0x11');_0x221dfa[_0xbe93a2[_0x5f1927][_0x4445('0x24')]]=[_0x4445('0x28'),_0x9937a3[_0x4445('0x1e')],_0x9937a3[_0x4445('0x26')]][_0x4445('0x29')]('/');break;case _0x4445('0x20'):_0x9937a3[_0x4445('0x20')]=_0x19ec07[_0xbe93a2[_0x5f1927][_0x4445('0x24')]];if(_0x56147c[_0x4445('0x19')]!==_0x4445('0x1a')){if(_0x9937a3['options'][_0x4445('0x2a')](_0x4445('0x2b'))<0x0){_0x9937a3['options']+=_0x4445('0x2b');}}else{_0x9937a3[_0x4445('0x20')]=_0x9937a3[_0x4445('0x20')]['replace'](_0x4445('0x2b'),'');}_0x221dfa[_0xbe93a2[_0x5f1927][_0x4445('0x24')]]=_0x9937a3['options'];break;default:_0x221dfa[_0xbe93a2[_0x5f1927]['param']]=_0x19ec07[_0xbe93a2[_0x5f1927][_0x4445('0x24')]];}}return _0x221dfa[_0x4445('0x29')](',');}function _0x2d3033(_0x3eca34,_0x1e0922,_0x524c81){return new Promise(function(_0x174f29,_0x22ff34){var _0x396309=[];if(_[_0x4445('0x2c')](_0x1e0922))return _0x174f29(_0x396309);_0x48169f['Interval'][_0x4445('0x2d')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x4445('0x2e')](function(_0x39fba3){for(var _0x4fcbab=0x0,_0x4ac2f1=0x0;_0x4fcbab<_0x1e0922[_0x4445('0x22')];_0x4fcbab++,_0x4ac2f1=0x0){var _0x370ede=_0x1e0922[_0x4fcbab];var _0x494361=[];var _0x5b42c4=[];delete _0x370ede['id'];if(_0x370ede['interval']!==_0x4445('0x2f')){_0x370ede[_0x4445('0x30')]=[_0x370ede[_0x4445('0x31')]];}else{_0x370ede[_0x4445('0x30')]=_0x370ede[_0x4445('0x32')]?_['map'](_[_0x4445('0x33')](_0x39fba3,{'IntervalId':_0x370ede['IntervalId']}),_0x4445('0x31')):[];}_0x370ede['context']=_0x3eca34[_0x4445('0xa')];_0x370ede[_0x4445('0x6')]=_0x3eca34[_0x4445('0x6')];if(_0x370ede['type'])_0x370ede[_0x4445('0x4')]=_0x370ede[_0x4445('0x4')]['toLowerCase']();if(_0x3eca34[_0x4445('0x4')]===_0x4445('0xc')){if(_0x370ede[_0x4445('0x18')](_0x4445('0x34'))&&_0x370ede[_0x4445('0x34')]&&_0x370ede[_0x4445('0x34')]!=='--'){_0x494361[_0x4445('0x8')]({'type':_0x370ede[_0x4445('0x4')]['toLowerCase'](),'app':_0x4445('0x9'),'appdata':'CDR(tag)='+_0x370ede[_0x4445('0x34')],'context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34[_0x4445('0x6')],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});}_0x494361[_0x4445('0x8')]({'type':_0x370ede[_0x4445('0x4')][_0x4445('0x35')](),'app':_0x4445('0x36'),'appdata':_0x4445('0x37')+(_0x370ede[_0x4445('0x38')]?_0x4445('0x39')+_0x370ede[_0x4445('0x38')]+')':_0x4445('0x3a')),'context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34[_0x4445('0x6')],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});}else{if(_0x370ede[_0x4445('0x18')]('answer')){if([_0x4445('0x3b'),_0x4445('0x3c')][_0x4445('0x3d')](_0x370ede[_0x4445('0x3e')][_0x4445('0x35')]())&&_0x370ede['appType']!==_0x4445('0x3f')){if(_0x370ede['answer']){_0x494361[_0x4445('0x8')]({'type':_0x370ede[_0x4445('0x4')][_0x4445('0x35')](),'app':_0x4445('0x36'),'appdata':_0x4445('0x40'),'context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34['exten'],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});_0x494361[_0x4445('0x8')]({'type':_0x370ede[_0x4445('0x4')][_0x4445('0x35')](),'app':_0x4445('0x9'),'appdata':_0x4445('0x41'),'context':_0x3eca34['context'],'exten':_0x3eca34[_0x4445('0x6')],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});}else{_0x494361['push']({'type':_0x370ede[_0x4445('0x4')][_0x4445('0x35')](),'app':_0x4445('0x36'),'appdata':_0x4445('0x42'),'context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34[_0x4445('0x6')],'priority':_0x370ede[_0x4445('0x30')]['length']+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});_0x494361[_0x4445('0x8')]({'type':_0x370ede[_0x4445('0x4')][_0x4445('0x35')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34['exten'],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});}}}}for(var _0x362235=0x0;_0x362235<_0x370ede[_0x4445('0x30')][_0x4445('0x22')];_0x362235++){var _0x229b41=_0x524c81+_0x370ede[_0x4445('0x30')]['length'];var _0x323a53=_0x362235===_0x370ede['intervals']['length']-0x1?_0x524c81+_0x494361[_0x4445('0x22')]+_0x5b42c4[_0x4445('0x22')]+0x2:_0x524c81+_0x362235+0x1;_0x494361[_0x4445('0x43')](_0x362235,0x0,{'type':_0x3eca34[_0x4445('0x4')],'app':'GotoIfTime','appdata':_0x370ede[_0x4445('0x30')][_0x362235]+'?'+_0x3eca34[_0x4445('0xa')]+_0x4445('0x44')+_0x229b41+':'+_0x3eca34[_0x4445('0xa')]+_0x4445('0x44')+_0x323a53,'exten':_0x3eca34[_0x4445('0x6')],'context':_0x3eca34[_0x4445('0xa')],'priority':_0x524c81+_0x362235,'VoiceExtensionId':_0x3eca34['id']});}if(_0x370ede[_0x4445('0x45')]==='outboundDial'){_0x370ede[_0x4445('0x46')]=_0x144520(_0x3eca34,_0x370ede[_0x4445('0x46')]);}if(_0x370ede[_0x4445('0x45')]===_0x4445('0x47')){_0x494361[_0x4445('0x8')]({'type':_0x370ede['type'][_0x4445('0x35')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x3eca34[_0x4445('0xa')],'exten':_0x3eca34['exten'],'priority':_0x370ede[_0x4445('0x30')][_0x4445('0x22')]+_0x524c81+_0x4ac2f1++,'VoiceExtensionId':_0x3eca34['id']});}_0x370ede[_0x4445('0x48')]=_0x494361[_0x4445('0x22')]?_['last'](_0x494361)['priority']+0x1:_0x524c81;_0x396309=_['concat'](_0x396309,_0x494361,[_0x370ede],_0x5b42c4);_0x524c81=_[_0x4445('0x49')](_0x396309)['priority']+0x1;}return _0x174f29(_0x396309);})[_0x4445('0x4a')](function(_0x4bb4e9){_0x22ff34(_0x4bb4e9);});});}return _0x44fb06[_0x4445('0x4b')](_0x4445('0x4c'),attributes,{'tableName':_0x4445('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4af7e3){var _0x288cc9=this['get']({'plain':!![]});var _0x4750f0=_0x288cc9[_0x4445('0x4')]==='outbound'?_0x4d208b(_0x288cc9):_0x16fe3c(_0x288cc9);return _0x2d3033(_0x288cc9,_0x4af7e3,_[_0x4445('0x49')](_0x4750f0)[_0x4445('0x48')]+0x1)[_0x4445('0x2e')](function(_0x12e490){var _0xfe3556=_[_0x4445('0x4e')](_0x4750f0,_0x12e490);_0xfe3556[_0x4445('0x8')]({'type':_0x288cc9[_0x4445('0x4')],'app':_0x4445('0x4f'),'exten':_0x288cc9[_0x4445('0x6')],'context':_0x288cc9[_0x4445('0xa')],'priority':_[_0x4445('0x49')](_0xfe3556)['priority']+0x1,'VoiceExtensionId':_0x288cc9['id']});return _0xfe3556;});}}});}; \ No newline at end of file +var _0xd2b2=['last','catch','define','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','url','length','name','split','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','interval','then','*,*,*,*','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','intervals','callerID','NoOp(No\x20number\x20available)','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority'];(function(_0x15de7b,_0x1f9e4e){var _0x1456c4=function(_0x2132fc){while(--_0x2132fc){_0x15de7b['push'](_0x15de7b['shift']());}};_0x1456c4(++_0x1f9e4e);}(_0xd2b2,0x13e));var _0x2d2b=function(_0x1bcff9,_0x46a878){_0x1bcff9=_0x1bcff9-0x0;var _0x319860=_0xd2b2[_0x1bcff9];return _0x319860;};'use strict';var _=require(_0x2d2b('0x0'));var attributes=require(_0x2d2b('0x1'));module[_0x2d2b('0x2')]=function(_0x433735){var _0x2e01d5=_0x433735[_0x2d2b('0x3')];function _0x2ef5cd(_0x171bc8){var _0x31aff5=0x2;var _0x54dd16=[{'type':_0x171bc8[_0x2d2b('0x4')],'app':'Set','appdata':_0x2d2b('0x5')+_0x171bc8[_0x2d2b('0x4')],'context':_0x171bc8[_0x2d2b('0x6')],'exten':_0x171bc8[_0x2d2b('0x7')],'priority':_0x31aff5++,'VoiceExtensionId':_0x171bc8['id']}];if(_0x171bc8[_0x2d2b('0x4')]===_0x2d2b('0x8')){_0x54dd16[_0x2d2b('0x9')]({'type':_0x2d2b('0x8'),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0xb')+_0x171bc8['id'],'context':_0x171bc8[_0x2d2b('0x6')],'exten':_0x171bc8[_0x2d2b('0x7')],'priority':_0x31aff5++,'VoiceExtensionId':_0x171bc8['id']});}_0x54dd16[_0x2d2b('0x9')]({'type':_0x171bc8[_0x2d2b('0x4')],'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0xc'),'context':_0x171bc8[_0x2d2b('0x6')],'exten':_0x171bc8[_0x2d2b('0x7')],'priority':_0x31aff5++,'VoiceExtensionId':_0x171bc8['id']},{'type':_0x171bc8[_0x2d2b('0x4')],'app':_0x2d2b('0xa'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x171bc8[_0x2d2b('0x6')],'exten':_0x171bc8['exten'],'priority':_0x31aff5++,'VoiceExtensionId':_0x171bc8['id']},{'type':_0x171bc8[_0x2d2b('0x4')],'app':_0x2d2b('0xa'),'appdata':'MONITOR_OPTIONS=ab','context':_0x171bc8[_0x2d2b('0x6')],'exten':_0x171bc8[_0x2d2b('0x7')],'priority':_0x31aff5++,'VoiceExtensionId':_0x171bc8['id']});return _0x54dd16;}function _0x5e2714(_0x2f4a5b){var _0xebcafc=0x2;var _0x57f081=[{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0xe'),'context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':'Set','appdata':_0x2d2b('0xf')+(_0x2f4a5b[_0x2d2b('0x10')]?_0x2d2b('0x11')+_0x2f4a5b[_0x2d2b('0x10')]+'}':_0x2d2b('0x12')),'context':_0x2f4a5b['context'],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':'CDR(routeid)='+_0x2f4a5b['id'],'context':_0x2f4a5b['context'],'exten':_0x2f4a5b['exten'],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':'outbound','app':_0x2d2b('0x13'),'appdata':_0x2d2b('0x14')+(_0xebcafc+0x2)+'):Goto('+(_0xebcafc+0x1)+')','context':_0x2f4a5b['context'],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':'outbound','app':_0x2d2b('0xa'),'appdata':_0x2f4a5b[_0x2d2b('0x10')]?_0x2d2b('0x15')+_0x2f4a5b[_0x2d2b('0x10')]+'}':_0x2d2b('0x16'),'context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0xc'),'context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':'outbound','app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x17'),'context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b['exten'],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':'outboundrouteid='+_0x2f4a5b['id'],'context':_0x2f4a5b[_0x2d2b('0x6')],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']}];if(_0x2f4a5b[_0x2d2b('0x18')]('recordingFormat')&&_0x2f4a5b['recordingFormat']!==_0x2d2b('0x19')){_0x57f081[_0x2d2b('0x9')]({'type':'outbound','app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x1a'),'context':_0x2f4a5b['context'],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']},{'type':_0x2d2b('0xd'),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x1b')+_0x2f4a5b[_0x2d2b('0x1c')]||_0x2d2b('0x1d'),'context':_0x2f4a5b['context'],'exten':_0x2f4a5b[_0x2d2b('0x7')],'priority':_0xebcafc++,'VoiceExtensionId':_0x2f4a5b['id']});}return _0x57f081;}function _0x5165fb(_0x15607c,_0x3f2e6d){var _0x3c46fd=[{'name':_0x2d2b('0x1e'),'param':0x0},{'name':_0x2d2b('0x1f'),'param':0x1},{'name':_0x2d2b('0x20'),'param':0x2},{'name':_0x2d2b('0x21'),'param':0x3}];var _0x3349f8={};var _0x15ff48=_0x3f2e6d['split'](',');var _0xc148bd=[];for(var _0x52ac46=0x0;_0x52ac46<_0x3c46fd[_0x2d2b('0x22')];_0x52ac46++){switch(_0x3c46fd[_0x52ac46][_0x2d2b('0x23')]){case _0x2d2b('0x1e'):_0x3349f8[_0x2d2b('0x1e')]=_0x15ff48[_0x3c46fd[_0x52ac46]['param']][_0x2d2b('0x24')]('/')[0x1];_0x3349f8['phone']=_0x15ff48[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]][_0x2d2b('0x24')]('/')[0x2];_0x3349f8['prefix']=_0x3349f8[_0x2d2b('0x26')]?_0x3349f8[_0x2d2b('0x26')]['split']('$')[0x0]:undefined;_0x3349f8[_0x2d2b('0x26')]=_0x15607c['cutdigits']?(_0x3349f8[_0x2d2b('0x27')]||'')+_0x2d2b('0x11')+_0x15607c['cutdigits']+'}':(_0x3349f8[_0x2d2b('0x27')]||'')+_0x2d2b('0x12');_0xc148bd[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]]=[_0x2d2b('0x28'),_0x3349f8[_0x2d2b('0x1e')],_0x3349f8[_0x2d2b('0x26')]][_0x2d2b('0x29')]('/');break;case _0x2d2b('0x20'):_0x3349f8[_0x2d2b('0x20')]=_0x15ff48[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]];if(_0x15607c[_0x2d2b('0x1c')]!==_0x2d2b('0x19')){if(_0x3349f8[_0x2d2b('0x20')][_0x2d2b('0x2a')](_0x2d2b('0x2b'))<0x0){_0x3349f8[_0x2d2b('0x20')]+='U(xcally-mixmonitor-context)';}}else{_0x3349f8['options']=_0x3349f8[_0x2d2b('0x20')][_0x2d2b('0x2c')](_0x2d2b('0x2b'),'');}_0xc148bd[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]]=_0x3349f8[_0x2d2b('0x20')];break;default:_0xc148bd[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]]=_0x15ff48[_0x3c46fd[_0x52ac46][_0x2d2b('0x25')]];}}return _0xc148bd[_0x2d2b('0x29')](',');}function _0x40e327(_0x4458ca,_0x1532ac,_0x53c594){return new Promise(function(_0x24ed3e,_0x4cb077){var _0xc7bf8d=[];if(_[_0x2d2b('0x2d')](_0x1532ac))return _0x24ed3e(_0xc7bf8d);_0x2e01d5['Interval']['findAll']({'attributes':['id',_0x2d2b('0x2e'),'IntervalId'],'raw':!![]})[_0x2d2b('0x2f')](function(_0x56e74b){for(var _0x3f7852=0x0,_0x55be70=0x0;_0x3f7852<_0x1532ac[_0x2d2b('0x22')];_0x3f7852++,_0x55be70=0x0){var _0x36ca63=_0x1532ac[_0x3f7852];var _0x430ef2=[];var _0xe2d8ce=[];delete _0x36ca63['id'];if(_0x36ca63[_0x2d2b('0x2e')]!==_0x2d2b('0x30')){_0x36ca63['intervals']=[_0x36ca63[_0x2d2b('0x2e')]];}else{_0x36ca63['intervals']=_0x36ca63[_0x2d2b('0x31')]?_[_0x2d2b('0x32')](_[_0x2d2b('0x33')](_0x56e74b,{'IntervalId':_0x36ca63[_0x2d2b('0x31')]}),'interval'):[];}_0x36ca63[_0x2d2b('0x6')]=_0x4458ca[_0x2d2b('0x6')];_0x36ca63['exten']=_0x4458ca[_0x2d2b('0x7')];if(_0x36ca63[_0x2d2b('0x4')])_0x36ca63['type']=_0x36ca63[_0x2d2b('0x4')][_0x2d2b('0x34')]();if(_0x4458ca[_0x2d2b('0x4')]===_0x2d2b('0xd')){if(_0x36ca63[_0x2d2b('0x18')](_0x2d2b('0x35'))&&_0x36ca63[_0x2d2b('0x35')]&&_0x36ca63[_0x2d2b('0x35')]!=='--'){_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63[_0x2d2b('0x4')][_0x2d2b('0x34')](),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x36')+_0x36ca63[_0x2d2b('0x35')],'context':_0x4458ca[_0x2d2b('0x6')],'exten':_0x4458ca['exten'],'priority':_0x36ca63[_0x2d2b('0x37')]['length']+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});}_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63[_0x2d2b('0x4')][_0x2d2b('0x34')](),'app':_0x2d2b('0x13'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x36ca63[_0x2d2b('0x38')]?'Set(CALLERID(all)='+_0x36ca63[_0x2d2b('0x38')]+')':_0x2d2b('0x39')),'context':_0x4458ca['context'],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63['intervals']['length']+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});}else{if(_0x36ca63['hasOwnProperty']('answer')){if(['queue','playback']['includes'](_0x36ca63[_0x2d2b('0x3a')][_0x2d2b('0x34')]())&&_0x36ca63[_0x2d2b('0x3b')]!==_0x2d2b('0x3c')){if(_0x36ca63[_0x2d2b('0x3d')]){_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63[_0x2d2b('0x4')][_0x2d2b('0x34')](),'app':_0x2d2b('0x13'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4458ca[_0x2d2b('0x6')],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63[_0x2d2b('0x37')][_0x2d2b('0x22')]+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63[_0x2d2b('0x4')][_0x2d2b('0x34')](),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x3e'),'context':_0x4458ca['context'],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63[_0x2d2b('0x37')][_0x2d2b('0x22')]+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});}else{_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63[_0x2d2b('0x4')]['toLowerCase'](),'app':_0x2d2b('0x13'),'appdata':_0x2d2b('0x3f'),'context':_0x4458ca[_0x2d2b('0x6')],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63[_0x2d2b('0x37')][_0x2d2b('0x22')]+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63['type'][_0x2d2b('0x34')](),'app':_0x2d2b('0xa'),'appdata':_0x2d2b('0x40'),'context':_0x4458ca['context'],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63[_0x2d2b('0x37')]['length']+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});}}}}for(var _0x44d5e9=0x0;_0x44d5e9<_0x36ca63['intervals'][_0x2d2b('0x22')];_0x44d5e9++){var _0x1b7e07=_0x53c594+_0x36ca63[_0x2d2b('0x37')]['length'];var _0x392232=_0x44d5e9===_0x36ca63[_0x2d2b('0x37')][_0x2d2b('0x22')]-0x1?_0x53c594+_0x430ef2[_0x2d2b('0x22')]+_0xe2d8ce[_0x2d2b('0x22')]+0x2:_0x53c594+_0x44d5e9+0x1;_0x430ef2[_0x2d2b('0x41')](_0x44d5e9,0x0,{'type':_0x4458ca[_0x2d2b('0x4')],'app':_0x2d2b('0x42'),'appdata':_0x36ca63[_0x2d2b('0x37')][_0x44d5e9]+'?'+_0x4458ca[_0x2d2b('0x6')]+',${EXTEN},'+_0x1b7e07+':'+_0x4458ca[_0x2d2b('0x6')]+_0x2d2b('0x43')+_0x392232,'exten':_0x4458ca['exten'],'context':_0x4458ca['context'],'priority':_0x53c594+_0x44d5e9,'VoiceExtensionId':_0x4458ca['id']});}if(_0x36ca63[_0x2d2b('0x3b')]===_0x2d2b('0x44')){_0x36ca63[_0x2d2b('0x45')]=_0x5165fb(_0x4458ca,_0x36ca63[_0x2d2b('0x45')]);}if(_0x36ca63[_0x2d2b('0x3b')]===_0x2d2b('0x46')){_0x430ef2[_0x2d2b('0x9')]({'type':_0x36ca63['type'][_0x2d2b('0x34')](),'app':_0x2d2b('0xa'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x4458ca['context'],'exten':_0x4458ca[_0x2d2b('0x7')],'priority':_0x36ca63[_0x2d2b('0x37')][_0x2d2b('0x22')]+_0x53c594+_0x55be70++,'VoiceExtensionId':_0x4458ca['id']});}_0x36ca63[_0x2d2b('0x47')]=_0x430ef2[_0x2d2b('0x22')]?_[_0x2d2b('0x48')](_0x430ef2)[_0x2d2b('0x47')]+0x1:_0x53c594;_0xc7bf8d=_['concat'](_0xc7bf8d,_0x430ef2,[_0x36ca63],_0xe2d8ce);_0x53c594=_['last'](_0xc7bf8d)[_0x2d2b('0x47')]+0x1;}return _0x24ed3e(_0xc7bf8d);})[_0x2d2b('0x49')](function(_0x1ff107){_0x4cb077(_0x1ff107);});});}return _0x433735[_0x2d2b('0x4a')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1b2ce5){var _0x1dc4e6=this[_0x2d2b('0x4b')]({'plain':!![]});var _0x163556=_0x1dc4e6['type']===_0x2d2b('0xd')?_0x5e2714(_0x1dc4e6):_0x2ef5cd(_0x1dc4e6);return _0x40e327(_0x1dc4e6,_0x1b2ce5,_[_0x2d2b('0x48')](_0x163556)['priority']+0x1)[_0x2d2b('0x2f')](function(_0x7932bd){var _0x476caa=_[_0x2d2b('0x4c')](_0x163556,_0x7932bd);_0x476caa[_0x2d2b('0x9')]({'type':_0x1dc4e6[_0x2d2b('0x4')],'app':_0x2d2b('0x4d'),'exten':_0x1dc4e6[_0x2d2b('0x7')],'context':_0x1dc4e6[_0x2d2b('0x6')],'priority':_[_0x2d2b('0x48')](_0x476caa)[_0x2d2b('0x47')]+0x1,'VoiceExtensionId':_0x1dc4e6['id']});return _0x476caa;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ab21ada..9dbc3e7 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 _0x737d=['message','result','VoiceExtension','options','raw','where','limit','include','map','model','attributes','GetVoiceExtension','catch','lodash','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s'];(function(_0x5edbc6,_0x5b966e){var _0x2bfc62=function(_0x362c1f){while(--_0x362c1f){_0x5edbc6['push'](_0x5edbc6['shift']());}};_0x2bfc62(++_0x5b966e);}(_0x737d,0xbc));var _0xd737=function(_0x5f3d46,_0x40283b){_0x5f3d46=_0x5f3d46-0x0;var _0x574dc1=_0x737d[_0x5f3d46];return _0x574dc1;};'use strict';var _=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd737('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd737('0x3'))('rpc');var config=require(_0xd737('0x4'));var jayson=require(_0xd737('0x5'));var client=jayson[_0xd737('0x6')][_0xd737('0x7')]({'port':0x232a});config[_0xd737('0x8')]=_[_0xd737('0x9')](config[_0xd737('0x8')],{'host':_0xd737('0xa'),'port':0x18eb});var socket=require(_0xd737('0xb'))(new Redis(config[_0xd737('0x8')]));require('./voiceExtension.socket')[_0xd737('0xc')](socket);function respondWithRpcPromise(_0xb243eb,_0x51a15d,_0x1c604d){return new BPromise(function(_0x42afa9,_0x4f8018){return client[_0xd737('0xd')](_0xb243eb,_0x1c604d)[_0xd737('0xe')](function(_0x578842){logger[_0xd737('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x51a15d,_0xd737('0x10'));logger[_0xd737('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x51a15d,'request\x20sent',JSON[_0xd737('0x12')](_0x578842));if(_0x578842[_0xd737('0x13')]){if(_0x578842['error'][_0xd737('0x14')]===0x1f4){logger[_0xd737('0x13')](_0xd737('0x15'),_0x51a15d,_0x578842[_0xd737('0x13')][_0xd737('0x16')]);return _0x4f8018(_0x578842[_0xd737('0x13')][_0xd737('0x16')]);}logger[_0xd737('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x51a15d,_0x578842['error'][_0xd737('0x16')]);return _0x42afa9(_0x578842[_0xd737('0x13')][_0xd737('0x16')]);}else{logger[_0xd737('0xf')](_0xd737('0x15'),_0x51a15d,_0xd737('0x10'));_0x42afa9(_0x578842[_0xd737('0x17')][_0xd737('0x16')]);}})['catch'](function(_0x5901da){logger[_0xd737('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x51a15d,_0x5901da);_0x4f8018(_0x5901da);});});}exports['GetVoiceExtension']=function(_0x4df39d){var _0x50327b=this;return new Promise(function(_0x798cf2,_0x2ec215){return db[_0xd737('0x18')]['findAll']({'raw':_0x4df39d[_0xd737('0x19')]?_0x4df39d['options'][_0xd737('0x1a')]===undefined?!![]:![]:!![],'where':_0x4df39d[_0xd737('0x19')]?_0x4df39d[_0xd737('0x19')][_0xd737('0x1b')]||null:null,'attributes':_0x4df39d['options']?_0x4df39d[_0xd737('0x19')]['attributes']||null:null,'limit':_0x4df39d[_0xd737('0x19')]?_0x4df39d['options'][_0xd737('0x1c')]||null:null,'include':_0x4df39d[_0xd737('0x19')]?_0x4df39d[_0xd737('0x19')][_0xd737('0x1d')]?_[_0xd737('0x1e')](_0x4df39d['options']['include'],function(_0x24c6ca){return{'model':db[_0x24c6ca[_0xd737('0x1f')]],'as':_0x24c6ca['as'],'attributes':_0x24c6ca['attributes'],'include':_0x24c6ca[_0xd737('0x1d')]?_[_0xd737('0x1e')](_0x24c6ca[_0xd737('0x1d')],function(_0x305db0){return{'model':db[_0x305db0[_0xd737('0x1f')]],'as':_0x305db0['as'],'attributes':_0x305db0[_0xd737('0x20')],'include':_0x305db0['include']?_[_0xd737('0x1e')](_0x305db0[_0xd737('0x1d')],function(_0x20650b){return{'model':db[_0x20650b[_0xd737('0x1f')]],'as':_0x20650b['as'],'attributes':_0x20650b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x286c94){logger['info'](_0xd737('0x21'),_0x4df39d);logger[_0xd737('0x11')]('GetVoiceExtension',_0x4df39d,JSON[_0xd737('0x12')](_0x286c94));_0x798cf2(_0x286c94);})[_0xd737('0x22')](function(_0x1f4528){logger[_0xd737('0x13')](_0xd737('0x21'),_0x1f4528[_0xd737('0x16')],_0x4df39d);_0x2ec215(_0x50327b['error'](0x1f4,_0x1f4528[_0xd737('0x16')]));});});}; \ 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(_0x3f1d11,_0x5e3836){var _0x38755f=function(_0x2d3dfe){while(--_0x2d3dfe){_0x3f1d11['push'](_0x3f1d11['shift']());}};_0x38755f(++_0x5e3836);}(_0x48e3,0xe9));var _0x348e=function(_0x37c284,_0x274130){_0x37c284=_0x37c284-0x0;var _0x40be18=_0x48e3[_0x37c284];return _0x40be18;};'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 a434599..124b07d 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x515007,_0x577c11){var _0x3dcc03=function(_0x255c64){while(--_0x255c64){_0x515007['push'](_0x515007['shift']());}};_0x3dcc03(++_0x577c11);}(_0x326f,0xd1));var _0xf326=function(_0x2534ea,_0x35db86){_0x2534ea=_0x2534ea-0x0;var _0x3c18c6=_0x326f[_0x2534ea];return _0x3c18c6;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x403431,_0x4929f9){var _0xc10279=function(_0x1a6dfe){while(--_0x1a6dfe){_0x403431['push'](_0x403431['shift']());}};_0xc10279(++_0x4929f9);}(_0x326f,0xd1));var _0xf326=function(_0x41506c,_0x1bdbd5){_0x41506c=_0x41506c-0x0;var _0x2f720a=_0x326f[_0x41506c];return _0x2f720a;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index e42f953..237a02e 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 _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x19e1c8,_0x3ca38a){var _0x51cb9e=function(_0x4fec2f){while(--_0x4fec2f){_0x19e1c8['push'](_0x19e1c8['shift']());}};_0x51cb9e(++_0x3ca38a);}(_0xeda8,0x104));var _0x8eda=function(_0x29a9ac,_0x467e7a){_0x29a9ac=_0x29a9ac-0x0;var _0x163c60=_0xeda8[_0x29a9ac];return _0x163c60;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router; \ No newline at end of file +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x39a177,_0x2a09ae){var _0x184850=function(_0x5e4801){while(--_0x5e4801){_0x39a177['push'](_0x39a177['shift']());}};_0x184850(++_0x2a09ae);}(_0x7b84,0x17c));var _0x47b8=function(_0x2aab4d,_0x346b0){_0x2aab4d=_0x2aab4d-0x0;var _0x5b37e9=_0x7b84[_0x2aab4d];return _0x5b37e9;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);module[_0x47b8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index c2e71cc..31291a1 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 _0x727e=['email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x946156,_0x4902e0){var _0x5a7488=function(_0x4ad37b){while(--_0x4ad37b){_0x946156['push'](_0x946156['shift']());}};_0x5a7488(++_0x4902e0);}(_0x727e,0x8b));var _0xe727=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x727e[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xe727('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xe727('0x1')]},'context':{'type':Sequelize[_0xe727('0x1')],'defaultValue':_0xe727('0x2'),'unique':_0xe727('0x3')},'mailbox':{'type':Sequelize[_0xe727('0x1')],'defaultValue':'','allowNull':![],'unique':_0xe727('0x3')},'password':{'type':Sequelize[_0xe727('0x1')]},'fullname':{'type':Sequelize[_0xe727('0x1')]},'email':{'type':Sequelize[_0xe727('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4708aa){this[_0xe727('0x4')](_0xe727('0x5'),typeof _0x4708aa===_0xe727('0x6')&&_0x4708aa[_0xe727('0x7')]()?_0x4708aa['trim']():null);}},'pager':{'type':Sequelize[_0xe727('0x1')]},'tz':{'type':Sequelize[_0xe727('0x1')],'defaultValue':_0xe727('0x8')},'attach':{'type':Sequelize['ENUM'](_0xe727('0x9'),'no'),'defaultValue':_0xe727('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe727('0x1')]},'callback':{'type':Sequelize[_0xe727('0x1')]},'review':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe727('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe727('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe727('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe727('0xa')](_0xe727('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe727('0x9'),'no'),'defaultValue':_0xe727('0x9'),'allowNull':![]},'stamp':{'type':_0xe727('0xb')},'emailsubject':{'type':Sequelize[_0xe727('0x1')]},'emailbody':{'type':Sequelize[_0xe727('0x1')]},'maxsecs':{'type':Sequelize[_0xe727('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe727('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe727('0xd')],'get':function(){return this['getDataValue'](_0xe727('0xe'))+_0xe727('0xf')+this[_0xe727('0x10')](_0xe727('0x11'));}}}; \ No newline at end of file +var _0x9e86=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x448774,_0x45ddc7){var _0x46b2f6=function(_0x1dee94){while(--_0x1dee94){_0x448774['push'](_0x448774['shift']());}};_0x46b2f6(++_0x45ddc7);}(_0x9e86,0x14a));var _0x69e8=function(_0x518a39,_0x3b378d){_0x518a39=_0x518a39-0x0;var _0x4126de=_0x9e86[_0x518a39];return _0x4126de;};'use strict';var Sequelize=require(_0x69e8('0x0'));module[_0x69e8('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x69e8('0x2')],'defaultValue':_0x69e8('0x3'),'unique':_0x69e8('0x4')},'mailbox':{'type':Sequelize[_0x69e8('0x2')],'defaultValue':'','allowNull':![],'unique':_0x69e8('0x4')},'password':{'type':Sequelize[_0x69e8('0x2')]},'fullname':{'type':Sequelize[_0x69e8('0x2')]},'email':{'type':Sequelize[_0x69e8('0x2')],'validate':{'isEmail':!![]},'set':function(_0x50adc7){this[_0x69e8('0x5')](_0x69e8('0x6'),typeof _0x50adc7===_0x69e8('0x7')&&_0x50adc7[_0x69e8('0x8')]()?_0x50adc7[_0x69e8('0x8')]():null);}},'pager':{'type':Sequelize[_0x69e8('0x2')]},'tz':{'type':Sequelize[_0x69e8('0x2')],'defaultValue':_0x69e8('0x9')},'attach':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x69e8('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x69e8('0x2')]},'callback':{'type':Sequelize[_0x69e8('0x2')]},'review':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x69e8('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x69e8('0xa')](_0x69e8('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x69e8('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x69e8('0xb'),'no'),'defaultValue':_0x69e8('0xb'),'allowNull':![]},'stamp':{'type':_0x69e8('0xd')},'emailsubject':{'type':Sequelize[_0x69e8('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x69e8('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x69e8('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x69e8('0xf')],'get':function(){return this[_0x69e8('0x10')](_0x69e8('0x11'))+_0x69e8('0x12')+this['getDataValue'](_0x69e8('0x13'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3400b5c..b678df4 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 _0xb9be=['filter','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','create','body','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','VoiceMail','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xb9be[_0x3bab09];return _0x164376;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];function respondWithStatusCode(_0x3df18a,_0x2a01df){_0x2a01df=_0x2a01df||0xcc;return function(_0x51598f){if(_0x51598f){return _0x3df18a['sendStatus'](_0x2a01df);}return _0x3df18a['status'](_0x2a01df)[_0xeb9b('0x19')]();};}function respondWithResult(_0x1ef03f,_0x2674e6){_0x2674e6=_0x2674e6||0xc8;return function(_0x4ec46d){if(_0x4ec46d){return _0x1ef03f['status'](_0x2674e6)['json'](_0x4ec46d);}};}function respondWithFilteredResult(_0x32538b,_0x1a5f27){return function(_0x406afd){if(_0x406afd){var _0x3fa308=typeof _0x1a5f27[_0xeb9b('0x1a')]===_0xeb9b('0x1b')&&typeof _0x1a5f27[_0xeb9b('0x1c')]==='undefined';var _0x2e8645=_0x406afd[_0xeb9b('0x1d')];var _0x21aca6=_0x3fa308?0x0:_0x1a5f27[_0xeb9b('0x1a')];var _0x3cbe3e=_0x3fa308?_0x406afd[_0xeb9b('0x1d')]:_0x1a5f27[_0xeb9b('0x1a')]+_0x1a5f27[_0xeb9b('0x1c')];var _0x2c199f;if(_0x3cbe3e>=_0x2e8645){_0x3cbe3e=_0x2e8645;_0x2c199f=0xc8;}else{_0x2c199f=0xce;}_0x32538b[_0xeb9b('0x1e')](_0x2c199f);return _0x32538b['set'](_0xeb9b('0x1f'),_0x21aca6+'-'+_0x3cbe3e+'/'+_0x2e8645)['json'](_0x406afd);}return null;};}function patchUpdates(_0x5d5f54){return function(_0x580498){try{jsonpatch[_0xeb9b('0x20')](_0x580498,_0x5d5f54,!![]);}catch(_0x4ab4b8){return BPromise[_0xeb9b('0x21')](_0x4ab4b8);}return _0x580498[_0xeb9b('0x22')]();};}function saveUpdates(_0x37935c,_0x37d7e0){return function(_0x3c8be7){if(_0x3c8be7){return _0x3c8be7[_0xeb9b('0x23')](_0x37935c)[_0xeb9b('0x24')](function(_0x15e5b8){return _0x15e5b8;});}return null;};}function removeEntity(_0x142d1c,_0x46df93){return function(_0x61c86d){if(_0x61c86d){return _0x61c86d[_0xeb9b('0x25')]()[_0xeb9b('0x24')](function(){var _0xe6d3e1=_0x61c86d[_0xeb9b('0x26')]({'plain':!![]});var _0x434461='Voicemails';return db[_0xeb9b('0x27')]['destroy']({'where':{'type':_0x434461,'resourceId':_0xe6d3e1['id']}})[_0xeb9b('0x24')](function(){return _0x61c86d;});})['then'](function(){_0x142d1c[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x19')]();});}};}function handleEntityNotFound(_0x7e0134,_0xe3eda5){return function(_0x52f6c1){if(!_0x52f6c1){_0x7e0134[_0xeb9b('0x28')](0x194);}return _0x52f6c1;};}function handleError(_0x42fe78,_0x54ab67){_0x54ab67=_0x54ab67||0x1f4;return function(_0x35ff07){logger[_0xeb9b('0x29')](_0x35ff07['stack']);if(_0x35ff07[_0xeb9b('0x2a')]){delete _0x35ff07[_0xeb9b('0x2a')];}_0x42fe78[_0xeb9b('0x1e')](_0x54ab67)['send'](_0x35ff07);};}exports[_0xeb9b('0x2b')]=function(_0x5336f2,_0x6bb66){var _0x4c1331={},_0x411467={},_0x54c659={'count':0x0,'rows':[]};var _0x27578d=_['map'](db[_0xeb9b('0x2c')]['rawAttributes'],function(_0x25b8da){return{'name':_0x25b8da[_0xeb9b('0x2d')],'type':_0x25b8da[_0xeb9b('0x2e')][_0xeb9b('0x2f')]};});_0x411467[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x27578d,_0xeb9b('0x2a'));_0x411467[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x5336f2[_0xeb9b('0x32')]);_0x411467['filters']=_[_0xeb9b('0x34')](_0x411467[_0xeb9b('0x30')],_0x411467[_0xeb9b('0x32')]);_0x4c1331[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x411467[_0xeb9b('0x30')],qs[_0xeb9b('0x36')](_0x5336f2['query'][_0xeb9b('0x36')]));_0x4c1331[_0xeb9b('0x35')]=_0x4c1331[_0xeb9b('0x35')]['length']?_0x4c1331[_0xeb9b('0x35')]:_0x411467[_0xeb9b('0x30')];if(!_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x37')](_0xeb9b('0x38'))){_0x4c1331[_0xeb9b('0x1c')]=qs['limit'](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x1c')]);_0x4c1331['offset']=qs[_0xeb9b('0x1a')](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x1a')]);}_0x4c1331[_0xeb9b('0x39')]=qs[_0xeb9b('0x3a')](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x3a')]);_0x4c1331['where']=qs[_0xeb9b('0x3b')](_[_0xeb9b('0x3c')](_0x5336f2[_0xeb9b('0x32')],_0x411467['filters']),_0x27578d);if(_0x5336f2['query']['filter']){_0x4c1331[_0xeb9b('0x3d')]=_[_0xeb9b('0x3e')](_0x4c1331[_0xeb9b('0x3d')],{'$or':_['map'](_0x27578d,function(_0x409ce6){if(_0x409ce6[_0xeb9b('0x2e')]!==_0xeb9b('0x3f')){var _0x20da52={};_0x20da52[_0x409ce6[_0xeb9b('0x2a')]]={'$like':'%'+_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x40')]+'%'};return _0x20da52;}})});}_0x4c1331=_['merge']({},_0x4c1331,_0x5336f2[_0xeb9b('0x41')]);var _0x3ccf45={'where':_0x4c1331[_0xeb9b('0x3d')]};return db['VoiceMail']['count'](_0x3ccf45)[_0xeb9b('0x24')](function(_0x110122){_0x54c659['count']=_0x110122;if(_0x5336f2[_0xeb9b('0x32')]['includeAll']){_0x4c1331[_0xeb9b('0x42')]=[{'all':!![]}];}return db[_0xeb9b('0x2c')][_0xeb9b('0x43')](_0x4c1331);})[_0xeb9b('0x24')](function(_0xbee63e){_0x54c659[_0xeb9b('0x44')]=_0xbee63e;return _0x54c659;})[_0xeb9b('0x24')](respondWithFilteredResult(_0x6bb66,_0x4c1331))[_0xeb9b('0x45')](handleError(_0x6bb66,null));};exports[_0xeb9b('0x46')]=function(_0x311e7d,_0x21bcf1){var _0x761d18={'raw':!![],'where':{'id':_0x311e7d['params']['id']}},_0x5e270a={};_0x5e270a[_0xeb9b('0x30')]=_['keys'](db[_0xeb9b('0x2c')][_0xeb9b('0x47')]);_0x5e270a[_0xeb9b('0x32')]=_['keys'](_0x311e7d[_0xeb9b('0x32')]);_0x5e270a[_0xeb9b('0x3b')]=_['intersection'](_0x5e270a[_0xeb9b('0x30')],_0x5e270a[_0xeb9b('0x32')]);_0x761d18[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x5e270a[_0xeb9b('0x30')],qs[_0xeb9b('0x36')](_0x311e7d[_0xeb9b('0x32')][_0xeb9b('0x36')]));_0x761d18['attributes']=_0x761d18['attributes'][_0xeb9b('0x48')]?_0x761d18['attributes']:_0x5e270a['model'];if(_0x311e7d[_0xeb9b('0x32')][_0xeb9b('0x49')]){_0x761d18[_0xeb9b('0x42')]=[{'all':!![]}];}_0x761d18=_[_0xeb9b('0x3e')]({},_0x761d18,_0x311e7d[_0xeb9b('0x41')]);return db[_0xeb9b('0x2c')]['find'](_0x761d18)['then'](handleEntityNotFound(_0x21bcf1,null))['then'](respondWithResult(_0x21bcf1,null))[_0xeb9b('0x45')](handleError(_0x21bcf1,null));};exports['create']=function(_0x4901b0,_0x2ee59c){return db[_0xeb9b('0x2c')][_0xeb9b('0x4a')](_0x4901b0[_0xeb9b('0x4b')],{})[_0xeb9b('0x24')](function(_0x202ef3){var _0x1a2189=_0x4901b0[_0xeb9b('0x4c')][_0xeb9b('0x26')]({'plain':!![]});if(!_0x1a2189)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a2189['role']===_0xeb9b('0x4c')){var _0x21c93a=_0x202ef3['get']({'plain':!![]});var _0x19bfe9='Voicemails';return db[_0xeb9b('0x4d')][_0xeb9b('0x4e')]({'where':{'name':_0x19bfe9,'userProfileId':_0x1a2189['userProfileId']},'raw':!![]})['then'](function(_0x530c1c){if(_0x530c1c&&_0x530c1c[_0xeb9b('0x4f')]===0x0){return db[_0xeb9b('0x27')][_0xeb9b('0x4a')]({'name':_0x21c93a['name'],'resourceId':_0x21c93a['id'],'type':_0x530c1c['name'],'sectionId':_0x530c1c['id']},{})[_0xeb9b('0x24')](function(){return _0x202ef3;});}else{return _0x202ef3;}})[_0xeb9b('0x45')](function(_0x3e6e73){logger[_0xeb9b('0x29')](_0xeb9b('0x50'),_0x3e6e73);throw _0x3e6e73;});}return _0x202ef3;})[_0xeb9b('0x24')](respondWithResult(_0x2ee59c,0xc9))['catch'](handleError(_0x2ee59c,null));};exports[_0xeb9b('0x23')]=function(_0x1fab7a,_0x47e84a){if(_0x1fab7a[_0xeb9b('0x4b')]['id']){delete _0x1fab7a['body']['id'];}return db[_0xeb9b('0x2c')][_0xeb9b('0x4e')]({'where':{'id':_0x1fab7a['params']['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x47e84a,null))['then'](saveUpdates(_0x1fab7a[_0xeb9b('0x4b')],null))[_0xeb9b('0x24')](respondWithResult(_0x47e84a,null))[_0xeb9b('0x45')](handleError(_0x47e84a,null));};exports[_0xeb9b('0x25')]=function(_0x5c769e,_0x5a641a){return db[_0xeb9b('0x2c')][_0xeb9b('0x4e')]({'where':{'id':_0x5c769e[_0xeb9b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a641a,null))[_0xeb9b('0x24')](removeEntity(_0x5a641a,null))[_0xeb9b('0x45')](handleError(_0x5a641a,null));};exports[_0xeb9b('0x52')]=function(_0x24444e,_0x2d0ba9,_0x114132){return db[_0xeb9b('0x2c')][_0xeb9b('0x53')]({'where':{'id':_0x24444e[_0xeb9b('0x51')]['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x2d0ba9,null))[_0xeb9b('0x24')](function(_0x58e550){var _0x5531a4;var _0x4b2506={},_0x83d48a={};_0x83d48a['model']=_[_0xeb9b('0x33')](db[_0xeb9b('0x54')][_0xeb9b('0x47')]);_0x83d48a['query']=_[_0xeb9b('0x33')](_0x24444e[_0xeb9b('0x32')]);_0x83d48a[_0xeb9b('0x3b')]=_[_0xeb9b('0x34')](_0x83d48a[_0xeb9b('0x30')],_0x83d48a[_0xeb9b('0x32')]);_0x4b2506[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x83d48a['model'],qs['fields'](_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x36')]));_0x4b2506[_0xeb9b('0x35')]=_0x4b2506['attributes'][_0xeb9b('0x48')]?_0x4b2506['attributes']:_0x83d48a[_0xeb9b('0x30')];if(!_0x24444e['query'][_0xeb9b('0x37')](_0xeb9b('0x38'))){_0x4b2506[_0xeb9b('0x1c')]=qs[_0xeb9b('0x1c')](_0x24444e[_0xeb9b('0x32')]['limit']);_0x4b2506[_0xeb9b('0x1a')]=qs[_0xeb9b('0x1a')](_0x24444e['query']['offset']);}_0x4b2506[_0xeb9b('0x39')]=qs[_0xeb9b('0x3a')](_0x24444e['query'][_0xeb9b('0x3a')]);_0x4b2506['where']=qs[_0xeb9b('0x3b')](_['pick'](_0x24444e[_0xeb9b('0x32')],_0x83d48a[_0xeb9b('0x3b')]));if(_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x40')]){_0x4b2506[_0xeb9b('0x3d')]=_[_0xeb9b('0x3e')](_0x4b2506['where'],{'$or':_[_0xeb9b('0x31')](_0x4b2506[_0xeb9b('0x35')],function(_0x5b670b){var _0x1acf82={};_0x1acf82[_0x5b670b]={'$like':'%'+_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x40')]+'%'};return _0x1acf82;})});}_0x4b2506[_0xeb9b('0x3d')]=_['merge'](_0x4b2506[_0xeb9b('0x3d')],{'mailboxuser':_0x58e550[_0xeb9b('0x55')]});_0x4b2506=_['merge']({},_0x4b2506,_0x24444e[_0xeb9b('0x41')]);return db[_0xeb9b('0x54')][_0xeb9b('0x56')](_0x4b2506)[_0xeb9b('0x24')](respondWithFilteredResult(_0x2d0ba9,_0x4b2506));})[_0xeb9b('0x45')](handleError(_0x2d0ba9,null));}; \ No newline at end of file +var _0xde2c=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','find','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','get','Voicemails','UserProfileResource','then','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key'];(function(_0x3d46cf,_0x1d39e9){var _0x1e048e=function(_0x22de66){while(--_0x22de66){_0x3d46cf['push'](_0x3d46cf['shift']());}};_0x1e048e(++_0x1d39e9);}(_0xde2c,0x7f));var _0xcde2=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xde2c[_0x56825b];return _0x69ce77;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){var _0x593aa4=_0xb2123c[_0xcde2('0x26')]({'plain':!![]});var _0x207a12=_0xcde2('0x27');return db[_0xcde2('0x28')][_0xcde2('0x25')]({'where':{'type':_0x207a12,'resourceId':_0x593aa4['id']}})['then'](function(){return _0xb2123c;});})[_0xcde2('0x29')](function(){_0x52368b[_0xcde2('0x1c')](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x513965,_0x2487eb){return function(_0x348ca1){if(!_0x348ca1){_0x513965[_0xcde2('0x1a')](0x194);}return _0x348ca1;};}function handleError(_0x40309d,_0xd7019){_0xd7019=_0xd7019||0x1f4;return function(_0x5b2b7){logger[_0xcde2('0x2a')](_0x5b2b7[_0xcde2('0x2b')]);if(_0x5b2b7['name']){delete _0x5b2b7[_0xcde2('0x2c')];}_0x40309d['status'](_0xd7019)[_0xcde2('0x2d')](_0x5b2b7);};}exports[_0xcde2('0x2e')]=function(_0x43706c,_0x49cb58){var _0xae46dc={},_0x28fedd={},_0x58afb1={'count':0x0,'rows':[]};var _0x26ec42=_[_0xcde2('0x2f')](db[_0xcde2('0x30')][_0xcde2('0x31')],function(_0x14f784){return{'name':_0x14f784[_0xcde2('0x32')],'type':_0x14f784[_0xcde2('0x33')][_0xcde2('0x34')]};});_0x28fedd['model']=_[_0xcde2('0x2f')](_0x26ec42,_0xcde2('0x2c'));_0x28fedd[_0xcde2('0x35')]=_[_0xcde2('0x36')](_0x43706c['query']);_0x28fedd[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],_0x28fedd[_0xcde2('0x35')]);_0xae46dc['attributes']=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x43706c[_0xcde2('0x35')]['fields']));_0xae46dc[_0xcde2('0x3b')]=_0xae46dc[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0xae46dc[_0xcde2('0x3b')]:_0x28fedd[_0xcde2('0x39')];if(!_0x43706c['query'][_0xcde2('0x3d')](_0xcde2('0x3e'))){_0xae46dc[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x43706c['query']['limit']);_0xae46dc[_0xcde2('0x20')]=qs[_0xcde2('0x20')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x20')]);}_0xae46dc[_0xcde2('0x3f')]=qs[_0xcde2('0x40')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x40')]);_0xae46dc[_0xcde2('0x41')]=qs['filters'](_[_0xcde2('0x42')](_0x43706c[_0xcde2('0x35')],_0x28fedd[_0xcde2('0x37')]),_0x26ec42);if(_0x43706c[_0xcde2('0x35')][_0xcde2('0x43')]){_0xae46dc['where']=_['merge'](_0xae46dc[_0xcde2('0x41')],{'$or':_[_0xcde2('0x2f')](_0x26ec42,function(_0x20dfad){if(_0x20dfad[_0xcde2('0x33')]!==_0xcde2('0x44')){var _0x1939a0={};_0x1939a0[_0x20dfad['name']]={'$like':'%'+_0x43706c['query']['filter']+'%'};return _0x1939a0;}})});}_0xae46dc=_[_0xcde2('0x45')]({},_0xae46dc,_0x43706c[_0xcde2('0x46')]);var _0x1cfe20={'where':_0xae46dc[_0xcde2('0x41')]};return db[_0xcde2('0x30')][_0xcde2('0x47')](_0x1cfe20)[_0xcde2('0x29')](function(_0x49b862){_0x58afb1['count']=_0x49b862;if(_0x43706c[_0xcde2('0x35')]['includeAll']){_0xae46dc[_0xcde2('0x48')]=[{'all':!![]}];}return db['VoiceMail'][_0xcde2('0x49')](_0xae46dc);})[_0xcde2('0x29')](function(_0x2cf372){_0x58afb1['rows']=_0x2cf372;return _0x58afb1;})[_0xcde2('0x29')](respondWithFilteredResult(_0x49cb58,_0xae46dc))['catch'](handleError(_0x49cb58,null));};exports[_0xcde2('0x4a')]=function(_0x24a46a,_0x1e661f){var _0x79e073={'raw':!![],'where':{'id':_0x24a46a[_0xcde2('0x4b')]['id']}},_0xcafd7={};_0xcafd7['model']=_['keys'](db[_0xcde2('0x30')]['rawAttributes']);_0xcafd7['query']=_[_0xcde2('0x36')](_0x24a46a['query']);_0xcafd7[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0xcafd7['model'],_0xcafd7[_0xcde2('0x35')]);_0x79e073['attributes']=_['intersection'](_0xcafd7[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x24a46a['query'][_0xcde2('0x3a')]));_0x79e073['attributes']=_0x79e073[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0x79e073[_0xcde2('0x3b')]:_0xcafd7[_0xcde2('0x39')];if(_0x24a46a[_0xcde2('0x35')]['includeAll']){_0x79e073[_0xcde2('0x48')]=[{'all':!![]}];}_0x79e073=_[_0xcde2('0x45')]({},_0x79e073,_0x24a46a[_0xcde2('0x46')]);return db[_0xcde2('0x30')]['find'](_0x79e073)['then'](handleEntityNotFound(_0x1e661f,null))[_0xcde2('0x29')](respondWithResult(_0x1e661f,null))['catch'](handleError(_0x1e661f,null));};exports[_0xcde2('0x4c')]=function(_0x3e9e79,_0x381bd4){return db[_0xcde2('0x30')][_0xcde2('0x4c')](_0x3e9e79[_0xcde2('0x4d')],{})['then'](function(_0x1ce5fe){var _0x5b996d=_0x3e9e79[_0xcde2('0x4e')]['get']({'plain':!![]});if(!_0x5b996d)throw new Error(_0xcde2('0x4f'));if(_0x5b996d[_0xcde2('0x50')]===_0xcde2('0x4e')){var _0x16cddb=_0x1ce5fe[_0xcde2('0x26')]({'plain':!![]});var _0x5071ce='Voicemails';return db[_0xcde2('0x51')]['find']({'where':{'name':_0x5071ce,'userProfileId':_0x5b996d[_0xcde2('0x52')]},'raw':!![]})[_0xcde2('0x29')](function(_0x3d2ce7){if(_0x3d2ce7&&_0x3d2ce7[_0xcde2('0x53')]===0x0){return db[_0xcde2('0x28')][_0xcde2('0x4c')]({'name':_0x16cddb[_0xcde2('0x2c')],'resourceId':_0x16cddb['id'],'type':_0x3d2ce7[_0xcde2('0x2c')],'sectionId':_0x3d2ce7['id']},{})[_0xcde2('0x29')](function(){return _0x1ce5fe;});}else{return _0x1ce5fe;}})[_0xcde2('0x54')](function(_0x3c5a17){logger[_0xcde2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c5a17);throw _0x3c5a17;});}return _0x1ce5fe;})['then'](respondWithResult(_0x381bd4,0xc9))['catch'](handleError(_0x381bd4,null));};exports[_0xcde2('0x24')]=function(_0x59a64d,_0x1751dd){if(_0x59a64d[_0xcde2('0x4d')]['id']){delete _0x59a64d[_0xcde2('0x4d')]['id'];}return db['VoiceMail'][_0xcde2('0x55')]({'where':{'id':_0x59a64d['params']['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x1751dd,null))['then'](saveUpdates(_0x59a64d[_0xcde2('0x4d')],null))[_0xcde2('0x29')](respondWithResult(_0x1751dd,null))['catch'](handleError(_0x1751dd,null));};exports[_0xcde2('0x25')]=function(_0x4dfabb,_0x5e6fd3){return db[_0xcde2('0x30')][_0xcde2('0x55')]({'where':{'id':_0x4dfabb[_0xcde2('0x4b')]['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x5e6fd3,null))[_0xcde2('0x29')](removeEntity(_0x5e6fd3,null))[_0xcde2('0x54')](handleError(_0x5e6fd3,null));};exports['getMessages']=function(_0x47329f,_0x44b3fb,_0x21b4e6){return db[_0xcde2('0x30')][_0xcde2('0x56')]({'where':{'id':_0x47329f[_0xcde2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44b3fb,null))['then'](function(_0x30dee3){var _0x35c6e5;var _0x6a9fa4={},_0x109472={};_0x109472['model']=_[_0xcde2('0x36')](db[_0xcde2('0x57')][_0xcde2('0x31')]);_0x109472[_0xcde2('0x35')]=_[_0xcde2('0x36')](_0x47329f[_0xcde2('0x35')]);_0x109472['filters']=_[_0xcde2('0x38')](_0x109472[_0xcde2('0x39')],_0x109472['query']);_0x6a9fa4[_0xcde2('0x3b')]=_[_0xcde2('0x38')](_0x109472[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x47329f[_0xcde2('0x35')][_0xcde2('0x3a')]));_0x6a9fa4[_0xcde2('0x3b')]=_0x6a9fa4[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0x6a9fa4[_0xcde2('0x3b')]:_0x109472['model'];if(!_0x47329f[_0xcde2('0x35')][_0xcde2('0x3d')]('nolimit')){_0x6a9fa4[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x47329f[_0xcde2('0x35')]['limit']);_0x6a9fa4[_0xcde2('0x20')]=qs[_0xcde2('0x20')](_0x47329f[_0xcde2('0x35')][_0xcde2('0x20')]);}_0x6a9fa4[_0xcde2('0x3f')]=qs[_0xcde2('0x40')](_0x47329f[_0xcde2('0x35')][_0xcde2('0x40')]);_0x6a9fa4[_0xcde2('0x41')]=qs[_0xcde2('0x37')](_[_0xcde2('0x42')](_0x47329f['query'],_0x109472['filters']));if(_0x47329f[_0xcde2('0x35')][_0xcde2('0x43')]){_0x6a9fa4[_0xcde2('0x41')]=_['merge'](_0x6a9fa4['where'],{'$or':_['map'](_0x6a9fa4[_0xcde2('0x3b')],function(_0x367bad){var _0x161a8b={};_0x161a8b[_0x367bad]={'$like':'%'+_0x47329f[_0xcde2('0x35')][_0xcde2('0x43')]+'%'};return _0x161a8b;})});}_0x6a9fa4[_0xcde2('0x41')]=_['merge'](_0x6a9fa4['where'],{'mailboxuser':_0x30dee3[_0xcde2('0x58')]});_0x6a9fa4=_[_0xcde2('0x45')]({},_0x6a9fa4,_0x47329f[_0xcde2('0x46')]);return db[_0xcde2('0x57')][_0xcde2('0x59')](_0x6a9fa4)[_0xcde2('0x29')](respondWithFilteredResult(_0x44b3fb,_0x6a9fa4));})[_0xcde2('0x54')](handleError(_0x44b3fb,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4ee2fa6..d11c5a2 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 _0x0c61=['path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x219283,_0x464464){var _0x39af69=function(_0x40dcfe){while(--_0x40dcfe){_0x219283['push'](_0x219283['shift']());}};_0x39af69(++_0x464464);}(_0x0c61,0x120));var _0x10c6=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x0c61[_0x479509];return _0x382da8;};'use strict';var _=require(_0x10c6('0x0'));var util=require(_0x10c6('0x1'));var logger=require(_0x10c6('0x2'))(_0x10c6('0x3'));var moment=require(_0x10c6('0x4'));var BPromise=require(_0x10c6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10c6('0x6'));var rimraf=require(_0x10c6('0x7'));var config=require(_0x10c6('0x8'));var attributes=require(_0x10c6('0x9'));module[_0x10c6('0xa')]=function(_0x35249b,_0x254b2b){return _0x35249b[_0x10c6('0xb')]('VoiceMail',attributes,{'tableName':_0x10c6('0xc'),'paranoid':![],'indexes':[{'name':_0x10c6('0xd'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf406=['path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf406,0xcd));var _0x6f40=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0xf406[_0x42bfb7];return _0x5c497d;};'use strict';var _=require(_0x6f40('0x0'));var util=require(_0x6f40('0x1'));var logger=require(_0x6f40('0x2'))('api');var moment=require(_0x6f40('0x3'));var BPromise=require(_0x6f40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f40('0x5'));var rimraf=require(_0x6f40('0x6'));var config=require(_0x6f40('0x7'));var attributes=require(_0x6f40('0x8'));module[_0x6f40('0x9')]=function(_0x21d28f,_0x5cd358){return _0x21d28f[_0x6f40('0xa')]('VoiceMail',attributes,{'tableName':_0x6f40('0xb'),'paranoid':![],'indexes':[{'name':_0x6f40('0xc'),'fields':[_0x6f40('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5700339..5466fee 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 _0xa460=['result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x1aa153,_0x2a37b6){var _0x48a885=function(_0x9fb527){while(--_0x9fb527){_0x1aa153['push'](_0x1aa153['shift']());}};_0x48a885(++_0x2a37b6);}(_0xa460,0xfe));var _0x0a46=function(_0x46ce21,_0x254327){_0x46ce21=_0x46ce21-0x0;var _0x4901ba=_0xa460[_0x46ce21];return _0x4901ba;};'use strict';var _=require(_0x0a46('0x0'));var util=require(_0x0a46('0x1'));var moment=require('moment');var BPromise=require(_0x0a46('0x2'));var rs=require(_0x0a46('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a46('0x4'));var logger=require('../../config/logger')(_0x0a46('0x5'));var config=require(_0x0a46('0x6'));var jayson=require(_0x0a46('0x7'));var client=jayson[_0x0a46('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a070a,_0x39a8ec,_0xa5d676){return new BPromise(function(_0x2624f2,_0x48cc90){return client['request'](_0x2a070a,_0xa5d676)['then'](function(_0xb44701){logger[_0x0a46('0x9')](_0x0a46('0xa'),_0x39a8ec,'request\x20sent');logger[_0x0a46('0xb')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x39a8ec,_0x0a46('0xc'),JSON[_0x0a46('0xd')](_0xb44701));if(_0xb44701[_0x0a46('0xe')]){if(_0xb44701[_0x0a46('0xe')]['code']===0x1f4){logger[_0x0a46('0xe')](_0x0a46('0xa'),_0x39a8ec,_0xb44701[_0x0a46('0xe')]['message']);return _0x48cc90(_0xb44701[_0x0a46('0xe')]['message']);}logger[_0x0a46('0xe')](_0x0a46('0xa'),_0x39a8ec,_0xb44701[_0x0a46('0xe')]['message']);return _0x2624f2(_0xb44701[_0x0a46('0xe')][_0x0a46('0xf')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x39a8ec,_0x0a46('0xc'));_0x2624f2(_0xb44701[_0x0a46('0x10')][_0x0a46('0xf')]);}})[_0x0a46('0x11')](function(_0xc60692){logger['error'](_0x0a46('0xa'),_0x39a8ec,_0xc60692);_0x48cc90(_0xc60692);});});} \ No newline at end of file +var _0xd617=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','VoiceMail,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x736213,_0xbfb2c6){var _0xaf13c7=function(_0x102c08){while(--_0x102c08){_0x736213['push'](_0x736213['shift']());}};_0xaf13c7(++_0xbfb2c6);}(_0xd617,0xb6));var _0x7d61=function(_0x503ddb,_0x29e841){_0x503ddb=_0x503ddb-0x0;var _0xe0cc10=_0xd617[_0x503ddb];return _0xe0cc10;};'use strict';var _=require('lodash');var util=require(_0x7d61('0x0'));var moment=require(_0x7d61('0x1'));var BPromise=require(_0x7d61('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d61('0x3'));var db=require(_0x7d61('0x4'))['db'];var utils=require(_0x7d61('0x5'));var logger=require(_0x7d61('0x6'))(_0x7d61('0x7'));var config=require(_0x7d61('0x8'));var jayson=require(_0x7d61('0x9'));var client=jayson['client'][_0x7d61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x313ac3,_0x2e6d34,_0x9e8f19){return new BPromise(function(_0x494e0b,_0x3fdcde){return client[_0x7d61('0xb')](_0x313ac3,_0x9e8f19)[_0x7d61('0xc')](function(_0x3cc93f){logger[_0x7d61('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2e6d34,_0x7d61('0xe'));logger[_0x7d61('0xf')](_0x7d61('0x10'),_0x2e6d34,_0x7d61('0xe'),JSON['stringify'](_0x3cc93f));if(_0x3cc93f[_0x7d61('0x11')]){if(_0x3cc93f[_0x7d61('0x11')]['code']===0x1f4){logger[_0x7d61('0x11')](_0x7d61('0x12'),_0x2e6d34,_0x3cc93f['error'][_0x7d61('0x13')]);return _0x3fdcde(_0x3cc93f[_0x7d61('0x11')][_0x7d61('0x13')]);}logger[_0x7d61('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2e6d34,_0x3cc93f['error'][_0x7d61('0x13')]);return _0x494e0b(_0x3cc93f[_0x7d61('0x11')]['message']);}else{logger['info'](_0x7d61('0x12'),_0x2e6d34,'request\x20sent');_0x494e0b(_0x3cc93f['result'][_0x7d61('0x13')]);}})[_0x7d61('0x14')](function(_0x59000f){logger[_0x7d61('0x11')](_0x7d61('0x12'),_0x2e6d34,_0x59000f);_0x3fdcde(_0x59000f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c2c2a78..07ed24f 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 _0x5542=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','index','/:id','show','get','/:id/download','isAuthenticated','post','create','put','update','delete'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5542,0xde));var _0x2554=function(_0x4c7ee1,_0xdd33ba){_0x4c7ee1=_0x4c7ee1-0x0;var _0x3576fb=_0x5542[_0x4c7ee1];return _0x3576fb;};'use strict';var multer=require('multer');var util=require(_0x2554('0x0'));var path=require(_0x2554('0x1'));var timeout=require(_0x2554('0x2'));var express=require(_0x2554('0x3'));var router=express[_0x2554('0x4')]();var fs_extra=require(_0x2554('0x5'));var auth=require(_0x2554('0x6'));var interaction=require(_0x2554('0x7'));var config=require('../../config/environment');var controller=require(_0x2554('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2554('0x9')]);router['get'](_0x2554('0xa'),auth['isAuthenticated'](),controller[_0x2554('0xb')]);router[_0x2554('0xc')](_0x2554('0xd'),auth[_0x2554('0xe')](),controller['download']);router[_0x2554('0xf')]('/',auth[_0x2554('0xe')](),controller[_0x2554('0x10')]);router[_0x2554('0x11')]('/:id',auth[_0x2554('0xe')](),controller[_0x2554('0x12')]);router[_0x2554('0x13')](_0x2554('0xa'),auth['isAuthenticated'](),controller[_0x2554('0x14')]);module[_0x2554('0x15')]=router; \ No newline at end of file +var _0xba7a=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba7a,0x1ca));var _0xaba7=function(_0x32642c,_0x576eb0){_0x32642c=_0x32642c-0x0;var _0x3a1d97=_0xba7a[_0x32642c];return _0x3a1d97;};'use strict';var multer=require(_0xaba7('0x0'));var util=require(_0xaba7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaba7('0x2'));var router=express[_0xaba7('0x3')]();var fs_extra=require(_0xaba7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaba7('0x5'));var config=require(_0xaba7('0x6'));var controller=require(_0xaba7('0x7'));router[_0xaba7('0x8')]('/',auth[_0xaba7('0x9')](),controller[_0xaba7('0xa')]);router['get']('/:id',auth[_0xaba7('0x9')](),controller['show']);router[_0xaba7('0x8')](_0xaba7('0xb'),auth[_0xaba7('0x9')](),controller[_0xaba7('0xc')]);router[_0xaba7('0xd')]('/',auth['isAuthenticated'](),controller[_0xaba7('0xe')]);router[_0xaba7('0xf')](_0xaba7('0x10'),auth[_0xaba7('0x9')](),controller[_0xaba7('0x11')]);router[_0xaba7('0x12')](_0xaba7('0x10'),auth['isAuthenticated'](),controller[_0xaba7('0x13')]);module[_0xaba7('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b3a1ad9..4733d0d 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 _0xa434=['exports','VIRTUAL','INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x534682,_0x46fa1c){var _0xd06232=function(_0x278979){while(--_0x278979){_0x534682['push'](_0x534682['shift']());}};_0xd06232(++_0x46fa1c);}(_0xa434,0x1af));var _0x4a43=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xa434[_0x25efdf];return _0x22c495;};'use strict';var Sequelize=require(_0x4a43('0x0'));module[_0x4a43('0x1')]={'name':{'type':Sequelize[_0x4a43('0x2')],'get':function(_0x3877c9){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x4a43('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x4a43('0x5')](_0x4a43('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4a43('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x4a43('0x7')](_0x4a43('0x8'))}}; \ No newline at end of file +var _0xddaa=['STRING','BLOB','long','TIMESTAMP','exports','VIRTUAL','INTEGER'];(function(_0xf4d811,_0x11d532){var _0x1677f9=function(_0x55208f){while(--_0x55208f){_0xf4d811['push'](_0xf4d811['shift']());}};_0x1677f9(++_0x11d532);}(_0xddaa,0x12a));var _0xadda=function(_0x4811c1,_0x36c714){_0x4811c1=_0x4811c1-0x0;var _0x41c604=_0xddaa[_0x4811c1];return _0x41c604;};'use strict';var Sequelize=require('sequelize');module[_0xadda('0x0')]={'name':{'type':Sequelize[_0xadda('0x1')],'get':function(_0x5d8f3e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xadda('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xadda('0x4')](_0xadda('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xadda('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xadda('0x6'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c6c723d..200e1cf 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 _0x0074=['VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','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','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','length','find','create','body','update','download','recording','msg_id','Sequelize','ValidationError'];(function(_0x646883,_0x581aa3){var _0x6dc0bf=function(_0x1a578c){while(--_0x1a578c){_0x646883['push'](_0x646883['shift']());}};_0x6dc0bf(++_0x581aa3);}(_0x0074,0x19f));var _0x4007=function(_0x12a41d,_0xb014a5){_0x12a41d=_0x12a41d-0x0;var _0x2a98a9=_0x0074[_0x12a41d];return _0x2a98a9;};'use strict';var emlformat=require(_0x4007('0x0'));var rimraf=require(_0x4007('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4007('0x2'));var rp=require(_0x4007('0x3'));var moment=require('moment');var BPromise=require(_0x4007('0x4'));var Mustache=require(_0x4007('0x5'));var util=require(_0x4007('0x6'));var path=require(_0x4007('0x7'));var sox=require(_0x4007('0x8'));var csv=require(_0x4007('0x9'));var ejs=require(_0x4007('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4007('0xb'));var squel=require(_0x4007('0xc'));var crypto=require('crypto');var jsforce=require(_0x4007('0xd'));var deskjs=require(_0x4007('0xe'));var toCsv=require(_0x4007('0x9'));var querystring=require('querystring');var Papa=require(_0x4007('0xf'));var Redis=require(_0x4007('0x10'));var authService=require(_0x4007('0x11'));var qs=require(_0x4007('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4007('0x13'));var logger=require(_0x4007('0x14'))('api');var utils=require(_0x4007('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4007('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f56a9,_0x43fdd2){_0x43fdd2=_0x43fdd2||0xcc;return function(_0x553942){if(_0x553942){return _0x2f56a9[_0x4007('0x17')](_0x43fdd2);}return _0x2f56a9[_0x4007('0x18')](_0x43fdd2)[_0x4007('0x19')]();};}function respondWithResult(_0x13441f,_0x33bba7){_0x33bba7=_0x33bba7||0xc8;return function(_0x5eb28b){if(_0x5eb28b){return _0x13441f[_0x4007('0x18')](_0x33bba7)[_0x4007('0x1a')](_0x5eb28b);}};}function respondWithFilteredResult(_0x2a38b0,_0x2b0848){return function(_0x203dad){if(_0x203dad){var _0x162f52=typeof _0x2b0848[_0x4007('0x1b')]===_0x4007('0x1c')&&typeof _0x2b0848[_0x4007('0x1d')]===_0x4007('0x1c');var _0x16d30e=_0x203dad[_0x4007('0x1e')];var _0x5e8774=_0x162f52?0x0:_0x2b0848[_0x4007('0x1b')];var _0x479668=_0x162f52?_0x203dad[_0x4007('0x1e')]:_0x2b0848['offset']+_0x2b0848[_0x4007('0x1d')];var _0x292a98;if(_0x479668>=_0x16d30e){_0x479668=_0x16d30e;_0x292a98=0xc8;}else{_0x292a98=0xce;}_0x2a38b0[_0x4007('0x18')](_0x292a98);return _0x2a38b0[_0x4007('0x1f')]('Content-Range',_0x5e8774+'-'+_0x479668+'/'+_0x16d30e)[_0x4007('0x1a')](_0x203dad);}return null;};}function patchUpdates(_0x219437){return function(_0x581041){try{jsonpatch['apply'](_0x581041,_0x219437,!![]);}catch(_0x3c352d){return BPromise['reject'](_0x3c352d);}return _0x581041[_0x4007('0x20')]();};}function saveUpdates(_0x23c423,_0x58e96b){return function(_0x489e1d){if(_0x489e1d){return _0x489e1d['update'](_0x23c423)[_0x4007('0x21')](function(_0x3c2645){return _0x3c2645;});}return null;};}function removeEntity(_0x268a4d,_0x329f79){return function(_0x4fa237){if(_0x4fa237){return _0x4fa237[_0x4007('0x22')]()[_0x4007('0x21')](function(){_0x268a4d[_0x4007('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e70de,_0x5f19cc){return function(_0x2b6b66){if(!_0x2b6b66){_0x2e70de[_0x4007('0x17')](0x194);}return _0x2b6b66;};}function handleError(_0x512da7,_0x1aef96){_0x1aef96=_0x1aef96||0x1f4;return function(_0x4da901){logger['error'](_0x4da901[_0x4007('0x23')]);if(_0x4da901[_0x4007('0x24')]){delete _0x4da901[_0x4007('0x24')];}_0x512da7[_0x4007('0x18')](_0x1aef96)[_0x4007('0x25')](_0x4da901);};}exports[_0x4007('0x26')]=function(_0x41b5a5,_0x409d12){var _0x17d106={},_0x10c60b={},_0x3b5aac={'count':0x0,'rows':[]};var _0x415697=_[_0x4007('0x27')](db[_0x4007('0x28')]['rawAttributes'],function(_0x3684d0){return{'name':_0x3684d0[_0x4007('0x29')],'type':_0x3684d0[_0x4007('0x2a')][_0x4007('0x2b')]};});_0x10c60b[_0x4007('0x2c')]=_['differenceBy'](_[_0x4007('0x27')](_0x415697,'name'),[_0x4007('0x24')]);_0x10c60b[_0x4007('0x2d')]=_[_0x4007('0x2e')](_0x41b5a5[_0x4007('0x2d')]);_0x10c60b[_0x4007('0x2f')]=_[_0x4007('0x30')](_0x10c60b[_0x4007('0x2c')],_0x10c60b[_0x4007('0x2d')]);_0x17d106[_0x4007('0x31')]=_[_0x4007('0x30')](_0x10c60b[_0x4007('0x2c')],qs['fields'](_0x41b5a5[_0x4007('0x2d')]['fields']));_0x17d106[_0x4007('0x31')]=_0x17d106[_0x4007('0x31')]['length']?_0x17d106[_0x4007('0x31')]:_0x10c60b['model'];if(!_0x41b5a5[_0x4007('0x2d')][_0x4007('0x32')](_0x4007('0x33'))){_0x17d106['limit']=qs[_0x4007('0x1d')](_0x41b5a5[_0x4007('0x2d')][_0x4007('0x1d')]);_0x17d106['offset']=qs[_0x4007('0x1b')](_0x41b5a5[_0x4007('0x2d')][_0x4007('0x1b')]);}_0x17d106['order']=qs[_0x4007('0x34')](_0x41b5a5['query'][_0x4007('0x34')]);_0x17d106[_0x4007('0x35')]=qs[_0x4007('0x2f')](_[_0x4007('0x36')](_0x41b5a5['query'],_0x10c60b['filters']),_0x415697);if(_0x41b5a5[_0x4007('0x2d')]['filter']){_0x17d106[_0x4007('0x35')]=_[_0x4007('0x37')](_0x17d106[_0x4007('0x35')],{'$or':_[_0x4007('0x27')](_0x415697,function(_0x2c0692){if(_0x2c0692['type']!==_0x4007('0x38')){var _0x205003={};_0x205003[_0x2c0692[_0x4007('0x24')]]={'$like':'%'+_0x41b5a5[_0x4007('0x2d')][_0x4007('0x39')]+'%'};return _0x205003;}})});}_0x17d106=_[_0x4007('0x37')]({},_0x17d106,_0x41b5a5[_0x4007('0x3a')]);var _0x4d569b={'where':_0x17d106[_0x4007('0x35')]};return db['VoiceMailMessage']['count'](_0x4d569b)[_0x4007('0x21')](function(_0x41b0d0){_0x3b5aac[_0x4007('0x1e')]=_0x41b0d0;if(_0x41b5a5[_0x4007('0x2d')][_0x4007('0x3b')]){_0x17d106[_0x4007('0x3c')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x4007('0x3d')](_0x17d106);})[_0x4007('0x21')](function(_0x76443b){_0x3b5aac['rows']=_0x76443b;return _0x3b5aac;})['then'](respondWithFilteredResult(_0x409d12,_0x17d106))[_0x4007('0x3e')](handleError(_0x409d12,null));};exports[_0x4007('0x3f')]=function(_0x5d1457,_0x2fae88){var _0x2186e3={'raw':!![],'where':{'id':_0x5d1457[_0x4007('0x40')]['id']}},_0x63b639={};_0x63b639[_0x4007('0x2c')]=_['keys'](db['VoiceMailMessage'][_0x4007('0x41')]);_0x63b639['query']=_[_0x4007('0x2e')](_0x5d1457['query']);_0x63b639[_0x4007('0x2f')]=_[_0x4007('0x30')](_0x63b639['model'],_0x63b639['query']);_0x2186e3[_0x4007('0x31')]=_[_0x4007('0x30')](_0x63b639[_0x4007('0x2c')],qs[_0x4007('0x42')](_0x5d1457[_0x4007('0x2d')][_0x4007('0x42')]));_0x2186e3[_0x4007('0x31')]=_0x2186e3[_0x4007('0x31')][_0x4007('0x43')]?_0x2186e3['attributes']:_0x63b639[_0x4007('0x2c')];if(_0x5d1457[_0x4007('0x2d')][_0x4007('0x3b')]){_0x2186e3['include']=[{'all':!![]}];}_0x2186e3=_['merge']({},_0x2186e3,_0x5d1457[_0x4007('0x3a')]);return db[_0x4007('0x28')][_0x4007('0x44')](_0x2186e3)[_0x4007('0x21')](handleEntityNotFound(_0x2fae88,null))[_0x4007('0x21')](respondWithResult(_0x2fae88,null))[_0x4007('0x3e')](handleError(_0x2fae88,null));};exports[_0x4007('0x45')]=function(_0x3e8a6a,_0x3d2c39){return db['VoiceMailMessage']['create'](_0x3e8a6a[_0x4007('0x46')],{})['then'](respondWithResult(_0x3d2c39,0xc9))[_0x4007('0x3e')](handleError(_0x3d2c39,null));};exports[_0x4007('0x47')]=function(_0x35614f,_0xd0c4e3){if(_0x35614f[_0x4007('0x46')]['id']){delete _0x35614f[_0x4007('0x46')]['id'];}return db[_0x4007('0x28')][_0x4007('0x44')]({'where':{'id':_0x35614f['params']['id']}})[_0x4007('0x21')](handleEntityNotFound(_0xd0c4e3,null))[_0x4007('0x21')](saveUpdates(_0x35614f[_0x4007('0x46')],null))[_0x4007('0x21')](respondWithResult(_0xd0c4e3,null))[_0x4007('0x3e')](handleError(_0xd0c4e3,null));};exports['destroy']=function(_0x4aecc3,_0x12df78){return db['VoiceMailMessage'][_0x4007('0x44')]({'where':{'id':_0x4aecc3['params']['id']}})['then'](handleEntityNotFound(_0x12df78,null))[_0x4007('0x21')](removeEntity(_0x12df78,null))['catch'](handleError(_0x12df78,null));};exports[_0x4007('0x48')]=function(_0x23139f,_0x5093d5,_0x5b981b){return db[_0x4007('0x28')][_0x4007('0x44')]({'where':{'id':_0x23139f['params']['id']},'attributes':['id',_0x4007('0x49'),_0x4007('0x4a')]})[_0x4007('0x21')](handleEntityNotFound(_0x5093d5,null))[_0x4007('0x21')](function(_0xd5d28b){if(_0xd5d28b){if(!_0xd5d28b['recording']){throw new db[(_0x4007('0x4b'))][(_0x4007('0x4c'))](_0x4007('0x4d'));}var _0x27282e={'Content-Type':_0x4007('0x4e'),'Content-Disposition':_0x4007('0x4f')};if(_0xd5d28b[_0x4007('0x4a')]){_0x27282e[_0x4007('0x50')]='attachment;\x20filename=\x22'+_0xd5d28b[_0x4007('0x4a')]+_0x4007('0x51');}_0x5093d5[_0x4007('0x1f')](_0x27282e);return _0x5093d5['send'](new Buffer(_0xd5d28b[_0x4007('0x49')]));}})[_0x4007('0x3e')](handleError(_0x5093d5,null));}; \ No newline at end of file +var _0x64bb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','options','create','body','find','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','msg_id','Content-Disposition','.wav\x22','set','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x532a48,_0x3a228e){var _0x4a3b6b=function(_0x21f0d1){while(--_0x21f0d1){_0x532a48['push'](_0x532a48['shift']());}};_0x4a3b6b(++_0x3a228e);}(_0x64bb,0x152));var _0xb64b=function(_0x1cde36,_0x3f07b6){_0x1cde36=_0x1cde36-0x0;var _0x208a2c=_0x64bb[_0x1cde36];return _0x208a2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb64b('0x0'));var zipdir=require(_0xb64b('0x1'));var jsonpatch=require(_0xb64b('0x2'));var rp=require('request-promise');var moment=require(_0xb64b('0x3'));var BPromise=require(_0xb64b('0x4'));var Mustache=require(_0xb64b('0x5'));var util=require(_0xb64b('0x6'));var path=require(_0xb64b('0x7'));var sox=require(_0xb64b('0x8'));var csv=require(_0xb64b('0x9'));var ejs=require(_0xb64b('0xa'));var fs=require('fs');var fs_extra=require(_0xb64b('0xb'));var _=require(_0xb64b('0xc'));var squel=require(_0xb64b('0xd'));var crypto=require(_0xb64b('0xe'));var jsforce=require(_0xb64b('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb64b('0x10'));var Papa=require(_0xb64b('0x11'));var Redis=require(_0xb64b('0x12'));var authService=require(_0xb64b('0x13'));var qs=require(_0xb64b('0x14'));var as=require(_0xb64b('0x15'));var hardwareService=require(_0xb64b('0x16'));var logger=require(_0xb64b('0x17'))(_0xb64b('0x18'));var utils=require(_0xb64b('0x19'));var config=require(_0xb64b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb64b('0x1b'))['db'];function respondWithStatusCode(_0x5de152,_0x1be7b8){_0x1be7b8=_0x1be7b8||0xcc;return function(_0x173984){if(_0x173984){return _0x5de152[_0xb64b('0x1c')](_0x1be7b8);}return _0x5de152['status'](_0x1be7b8)[_0xb64b('0x1d')]();};}function respondWithResult(_0x4217ba,_0x1116e5){_0x1116e5=_0x1116e5||0xc8;return function(_0x8e01f7){if(_0x8e01f7){return _0x4217ba['status'](_0x1116e5)[_0xb64b('0x1e')](_0x8e01f7);}};}function respondWithFilteredResult(_0xdd71b9,_0x461b57){return function(_0xa24e32){if(_0xa24e32){var _0x427ea3=typeof _0x461b57[_0xb64b('0x1f')]===_0xb64b('0x20')&&typeof _0x461b57[_0xb64b('0x21')]===_0xb64b('0x20');var _0x1a9a53=_0xa24e32[_0xb64b('0x22')];var _0x33266d=_0x427ea3?0x0:_0x461b57[_0xb64b('0x1f')];var _0x28358a=_0x427ea3?_0xa24e32[_0xb64b('0x22')]:_0x461b57[_0xb64b('0x1f')]+_0x461b57[_0xb64b('0x21')];var _0x114005;if(_0x28358a>=_0x1a9a53){_0x28358a=_0x1a9a53;_0x114005=0xc8;}else{_0x114005=0xce;}_0xdd71b9['status'](_0x114005);return _0xdd71b9['set'](_0xb64b('0x23'),_0x33266d+'-'+_0x28358a+'/'+_0x1a9a53)[_0xb64b('0x1e')](_0xa24e32);}return null;};}function patchUpdates(_0x4b0e62){return function(_0xad3ea1){try{jsonpatch[_0xb64b('0x24')](_0xad3ea1,_0x4b0e62,!![]);}catch(_0x4bd2b2){return BPromise[_0xb64b('0x25')](_0x4bd2b2);}return _0xad3ea1[_0xb64b('0x26')]();};}function saveUpdates(_0xad3282,_0x3a0cc4){return function(_0x3a5cf3){if(_0x3a5cf3){return _0x3a5cf3[_0xb64b('0x27')](_0xad3282)[_0xb64b('0x28')](function(_0x36bb73){return _0x36bb73;});}return null;};}function removeEntity(_0x366426,_0x31f51f){return function(_0x103022){if(_0x103022){return _0x103022[_0xb64b('0x29')]()[_0xb64b('0x28')](function(){_0x366426[_0xb64b('0x2a')](0xcc)[_0xb64b('0x1d')]();});}};}function handleEntityNotFound(_0x9e3bfd,_0x5c05bb){return function(_0x1d17a1){if(!_0x1d17a1){_0x9e3bfd['sendStatus'](0x194);}return _0x1d17a1;};}function handleError(_0x26a81e,_0x101c34){_0x101c34=_0x101c34||0x1f4;return function(_0xb546c){logger[_0xb64b('0x2b')](_0xb546c[_0xb64b('0x2c')]);if(_0xb546c[_0xb64b('0x2d')]){delete _0xb546c['name'];}_0x26a81e[_0xb64b('0x2a')](_0x101c34)[_0xb64b('0x2e')](_0xb546c);};}exports[_0xb64b('0x2f')]=function(_0x43ef0d,_0x20624c){var _0x568406={},_0x295f03={},_0x5a236c={'count':0x0,'rows':[]};var _0x6ad9e7=_['map'](db[_0xb64b('0x30')][_0xb64b('0x31')],function(_0x528bbb){return{'name':_0x528bbb[_0xb64b('0x32')],'type':_0x528bbb[_0xb64b('0x33')][_0xb64b('0x34')]};});_0x295f03['model']=_[_0xb64b('0x35')](_[_0xb64b('0x36')](_0x6ad9e7,_0xb64b('0x2d')),[_0xb64b('0x2d')]);_0x295f03['query']=_['keys'](_0x43ef0d[_0xb64b('0x37')]);_0x295f03[_0xb64b('0x38')]=_[_0xb64b('0x39')](_0x295f03[_0xb64b('0x3a')],_0x295f03['query']);_0x568406[_0xb64b('0x3b')]=_[_0xb64b('0x39')](_0x295f03[_0xb64b('0x3a')],qs['fields'](_0x43ef0d[_0xb64b('0x37')]['fields']));_0x568406[_0xb64b('0x3b')]=_0x568406[_0xb64b('0x3b')][_0xb64b('0x3c')]?_0x568406[_0xb64b('0x3b')]:_0x295f03['model'];if(!_0x43ef0d[_0xb64b('0x37')][_0xb64b('0x3d')](_0xb64b('0x3e'))){_0x568406['limit']=qs[_0xb64b('0x21')](_0x43ef0d['query'][_0xb64b('0x21')]);_0x568406[_0xb64b('0x1f')]=qs[_0xb64b('0x1f')](_0x43ef0d[_0xb64b('0x37')][_0xb64b('0x1f')]);}_0x568406[_0xb64b('0x3f')]=qs[_0xb64b('0x40')](_0x43ef0d[_0xb64b('0x37')][_0xb64b('0x40')]);_0x568406[_0xb64b('0x41')]=qs['filters'](_[_0xb64b('0x42')](_0x43ef0d[_0xb64b('0x37')],_0x295f03['filters']),_0x6ad9e7);if(_0x43ef0d['query'][_0xb64b('0x43')]){_0x568406[_0xb64b('0x41')]=_[_0xb64b('0x44')](_0x568406[_0xb64b('0x41')],{'$or':_[_0xb64b('0x36')](_0x6ad9e7,function(_0x7162fb){if(_0x7162fb[_0xb64b('0x33')]!==_0xb64b('0x45')){var _0x423820={};_0x423820[_0x7162fb['name']]={'$like':'%'+_0x43ef0d[_0xb64b('0x37')][_0xb64b('0x43')]+'%'};return _0x423820;}})});}_0x568406=_[_0xb64b('0x44')]({},_0x568406,_0x43ef0d['options']);var _0x291bce={'where':_0x568406[_0xb64b('0x41')]};return db['VoiceMailMessage'][_0xb64b('0x22')](_0x291bce)[_0xb64b('0x28')](function(_0xbe0510){_0x5a236c[_0xb64b('0x22')]=_0xbe0510;if(_0x43ef0d[_0xb64b('0x37')][_0xb64b('0x46')]){_0x568406[_0xb64b('0x47')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xb64b('0x48')](_0x568406);})['then'](function(_0x47e508){_0x5a236c[_0xb64b('0x49')]=_0x47e508;return _0x5a236c;})[_0xb64b('0x28')](respondWithFilteredResult(_0x20624c,_0x568406))[_0xb64b('0x4a')](handleError(_0x20624c,null));};exports['show']=function(_0x53be88,_0x54f1fa){var _0x4c5d5a={'raw':!![],'where':{'id':_0x53be88['params']['id']}},_0x2eec40={};_0x2eec40[_0xb64b('0x3a')]=_[_0xb64b('0x4b')](db[_0xb64b('0x30')][_0xb64b('0x31')]);_0x2eec40['query']=_[_0xb64b('0x4b')](_0x53be88[_0xb64b('0x37')]);_0x2eec40[_0xb64b('0x38')]=_[_0xb64b('0x39')](_0x2eec40[_0xb64b('0x3a')],_0x2eec40[_0xb64b('0x37')]);_0x4c5d5a[_0xb64b('0x3b')]=_['intersection'](_0x2eec40[_0xb64b('0x3a')],qs['fields'](_0x53be88[_0xb64b('0x37')]['fields']));_0x4c5d5a['attributes']=_0x4c5d5a['attributes'][_0xb64b('0x3c')]?_0x4c5d5a[_0xb64b('0x3b')]:_0x2eec40[_0xb64b('0x3a')];if(_0x53be88['query'][_0xb64b('0x46')]){_0x4c5d5a[_0xb64b('0x47')]=[{'all':!![]}];}_0x4c5d5a=_['merge']({},_0x4c5d5a,_0x53be88[_0xb64b('0x4c')]);return db[_0xb64b('0x30')]['find'](_0x4c5d5a)[_0xb64b('0x28')](handleEntityNotFound(_0x54f1fa,null))[_0xb64b('0x28')](respondWithResult(_0x54f1fa,null))[_0xb64b('0x4a')](handleError(_0x54f1fa,null));};exports[_0xb64b('0x4d')]=function(_0x290af5,_0x1dfc00){return db[_0xb64b('0x30')][_0xb64b('0x4d')](_0x290af5[_0xb64b('0x4e')],{})[_0xb64b('0x28')](respondWithResult(_0x1dfc00,0xc9))[_0xb64b('0x4a')](handleError(_0x1dfc00,null));};exports['update']=function(_0x514e21,_0x56095f){if(_0x514e21[_0xb64b('0x4e')]['id']){delete _0x514e21[_0xb64b('0x4e')]['id'];}return db['VoiceMailMessage'][_0xb64b('0x4f')]({'where':{'id':_0x514e21[_0xb64b('0x50')]['id']}})['then'](handleEntityNotFound(_0x56095f,null))['then'](saveUpdates(_0x514e21[_0xb64b('0x4e')],null))[_0xb64b('0x28')](respondWithResult(_0x56095f,null))['catch'](handleError(_0x56095f,null));};exports['destroy']=function(_0x383bd8,_0x3d9b9c){return db[_0xb64b('0x30')]['find']({'where':{'id':_0x383bd8[_0xb64b('0x50')]['id']}})[_0xb64b('0x28')](handleEntityNotFound(_0x3d9b9c,null))[_0xb64b('0x28')](removeEntity(_0x3d9b9c,null))[_0xb64b('0x4a')](handleError(_0x3d9b9c,null));};exports[_0xb64b('0x51')]=function(_0x45a41f,_0x3e95ee,_0xc8ccb2){return db[_0xb64b('0x30')]['find']({'where':{'id':_0x45a41f[_0xb64b('0x50')]['id']},'attributes':['id','recording','msg_id']})[_0xb64b('0x28')](handleEntityNotFound(_0x3e95ee,null))['then'](function(_0x4a6590){if(_0x4a6590){if(!_0x4a6590[_0xb64b('0x52')]){throw new db[(_0xb64b('0x53'))][(_0xb64b('0x54'))](_0xb64b('0x55'));}var _0x46d18e={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x4a6590[_0xb64b('0x56')]){_0x46d18e[_0xb64b('0x57')]='attachment;\x20filename=\x22'+_0x4a6590[_0xb64b('0x56')]+_0xb64b('0x58');}_0x3e95ee[_0xb64b('0x59')](_0x46d18e);return _0x3e95ee[_0xb64b('0x2e')](new Buffer(_0x4a6590[_0xb64b('0x52')]));}})[_0xb64b('0x4a')](handleError(_0x3e95ee,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b3f714a..58a2ce3 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 _0x4967=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x10d3b8,_0xa5a30a){var _0x31e093=function(_0x591846){while(--_0x591846){_0x10d3b8['push'](_0x10d3b8['shift']());}};_0x31e093(++_0xa5a30a);}(_0x4967,0x15d));var _0x7496=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x4967[_0xf4666e];return _0x1853f1;};'use strict';var _=require(_0x7496('0x0'));var util=require(_0x7496('0x1'));var logger=require(_0x7496('0x2'))(_0x7496('0x3'));var moment=require('moment');var BPromise=require(_0x7496('0x4'));var rp=require(_0x7496('0x5'));var fs=require('fs');var path=require(_0x7496('0x6'));var rimraf=require(_0x7496('0x7'));var config=require('../../config/environment');var attributes=require(_0x7496('0x8'));module[_0x7496('0x9')]=function(_0x2adc74,_0x4d4586){return _0x2adc74[_0x7496('0xa')](_0x7496('0xb'),attributes,{'tableName':_0x7496('0xc'),'paranoid':![],'indexes':[{'name':_0x7496('0xd'),'fields':[_0x7496('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xec1c=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','dir','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4f4bb8,_0x32e15d){var _0xf6e91f=function(_0x2d1fd6){while(--_0x2d1fd6){_0x4f4bb8['push'](_0x4f4bb8['shift']());}};_0xf6e91f(++_0x32e15d);}(_0xec1c,0xae));var _0xcec1=function(_0x27deda,_0x300d08){_0x27deda=_0x27deda-0x0;var _0x29c0eb=_0xec1c[_0x27deda];return _0x29c0eb;};'use strict';var _=require(_0xcec1('0x0'));var util=require('util');var logger=require(_0xcec1('0x1'))(_0xcec1('0x2'));var moment=require(_0xcec1('0x3'));var BPromise=require(_0xcec1('0x4'));var rp=require(_0xcec1('0x5'));var fs=require('fs');var path=require(_0xcec1('0x6'));var rimraf=require(_0xcec1('0x7'));var config=require(_0xcec1('0x8'));var attributes=require(_0xcec1('0x9'));module[_0xcec1('0xa')]=function(_0x50c052,_0x4684f0){return _0x50c052['define']('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xcec1('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5c14c76..7ddf02a 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 _0x7989=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7989,0x18d));var _0x9798=function(_0x2384bb,_0x39682f){_0x2384bb=_0x2384bb-0x0;var _0x299201=_0x7989[_0x2384bb];return _0x299201;};'use strict';var _=require(_0x9798('0x0'));var util=require(_0x9798('0x1'));var moment=require(_0x9798('0x2'));var BPromise=require(_0x9798('0x3'));var rs=require(_0x9798('0x4'));var fs=require('fs');var Redis=require(_0x9798('0x5'));var db=require(_0x9798('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9798('0x7'))(_0x9798('0x8'));var config=require(_0x9798('0x9'));var jayson=require(_0x9798('0xa'));var client=jayson['client'][_0x9798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcdd6d7,_0x4dd252,_0x4a9796){return new BPromise(function(_0x40c8fd,_0x15d34e){return client[_0x9798('0xc')](_0xcdd6d7,_0x4a9796)['then'](function(_0x54a2d5){logger['info'](_0x9798('0xd'),_0x4dd252,_0x9798('0xe'));logger[_0x9798('0xf')](_0x9798('0x10'),_0x4dd252,_0x9798('0xe'),JSON[_0x9798('0x11')](_0x54a2d5));if(_0x54a2d5['error']){if(_0x54a2d5[_0x9798('0x12')][_0x9798('0x13')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4dd252,_0x54a2d5['error'][_0x9798('0x14')]);return _0x15d34e(_0x54a2d5[_0x9798('0x12')]['message']);}logger['error'](_0x9798('0xd'),_0x4dd252,_0x54a2d5[_0x9798('0x12')][_0x9798('0x14')]);return _0x40c8fd(_0x54a2d5[_0x9798('0x12')]['message']);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4dd252,_0x9798('0xe'));_0x40c8fd(_0x54a2d5[_0x9798('0x15')]['message']);}})[_0x9798('0x16')](function(_0x54c9f2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4dd252,_0x54c9f2);_0x15d34e(_0x54c9f2);});});} \ No newline at end of file +var _0xdc1b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','moment','bluebird','randomstring'];(function(_0x220d2d,_0x23d33f){var _0x57feaf=function(_0x23fbbc){while(--_0x23fbbc){_0x220d2d['push'](_0x220d2d['shift']());}};_0x57feaf(++_0x23d33f);}(_0xdc1b,0x1a0));var _0xbdc1=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xdc1b[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var util=require(_0xbdc1('0x0'));var moment=require(_0xbdc1('0x1'));var BPromise=require(_0xbdc1('0x2'));var rs=require(_0xbdc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbdc1('0x4'));var logger=require(_0xbdc1('0x5'))(_0xbdc1('0x6'));var config=require(_0xbdc1('0x7'));var jayson=require(_0xbdc1('0x8'));var client=jayson[_0xbdc1('0x9')][_0xbdc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x169240,_0x5a64b1,_0x291020){return new BPromise(function(_0x270744,_0x269bcb){return client[_0xbdc1('0xb')](_0x169240,_0x291020)['then'](function(_0x34ed6d){logger['info'](_0xbdc1('0xc'),_0x5a64b1,_0xbdc1('0xd'));logger[_0xbdc1('0xe')](_0xbdc1('0xf'),_0x5a64b1,_0xbdc1('0xd'),JSON['stringify'](_0x34ed6d));if(_0x34ed6d[_0xbdc1('0x10')]){if(_0x34ed6d[_0xbdc1('0x10')][_0xbdc1('0x11')]===0x1f4){logger[_0xbdc1('0x10')](_0xbdc1('0xc'),_0x5a64b1,_0x34ed6d[_0xbdc1('0x10')][_0xbdc1('0x12')]);return _0x269bcb(_0x34ed6d['error'][_0xbdc1('0x12')]);}logger[_0xbdc1('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x5a64b1,_0x34ed6d[_0xbdc1('0x10')][_0xbdc1('0x12')]);return _0x270744(_0x34ed6d[_0xbdc1('0x10')][_0xbdc1('0x12')]);}else{logger[_0xbdc1('0x13')](_0xbdc1('0xc'),_0x5a64b1,_0xbdc1('0xd'));_0x270744(_0x34ed6d['result'][_0xbdc1('0x12')]);}})[_0xbdc1('0x14')](function(_0x210eeb){logger['error'](_0xbdc1('0xc'),_0x5a64b1,_0x210eeb);_0x269bcb(_0x210eeb);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0436dac..1df7dc3 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 _0x368b=['delete','destroy','/:id/sounds/:id2','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getSounds','post','/:id/sounds','addSound','put','update'];(function(_0x3a8df4,_0x3bfac0){var _0x317c40=function(_0x41e05a){while(--_0x41e05a){_0x3a8df4['push'](_0x3a8df4['shift']());}};_0x317c40(++_0x3bfac0);}(_0x368b,0x138));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb368('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb368('0x1'));var express=require(_0xb368('0x2'));var router=express[_0xb368('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb368('0x4'));var interaction=require(_0xb368('0x5'));var config=require(_0xb368('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xb368('0x7')]('/',auth['isAuthenticated'](),controller[_0xb368('0x8')]);router[_0xb368('0x7')](_0xb368('0x9'),auth[_0xb368('0xa')](),controller[_0xb368('0xb')]);router['get']('/:id/sounds',auth[_0xb368('0xa')](),controller[_0xb368('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb368('0xd')](_0xb368('0xe'),auth[_0xb368('0xa')](),controller[_0xb368('0xf')]);router[_0xb368('0x10')](_0xb368('0x9'),auth[_0xb368('0xa')](),controller[_0xb368('0x11')]);router[_0xb368('0x12')](_0xb368('0x9'),auth[_0xb368('0xa')](),controller[_0xb368('0x13')]);router['delete'](_0xb368('0x14'),auth[_0xb368('0xa')](),controller['removeSound']);module[_0xb368('0x15')]=router; \ No newline at end of file +var _0x12ed=['isAuthenticated','getSounds','post','create','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','/:id','show','/:id/sounds'];(function(_0x1cb7fc,_0x21c4ff){var _0x2b72a7=function(_0x26436c){while(--_0x26436c){_0x1cb7fc['push'](_0x1cb7fc['shift']());}};_0x2b72a7(++_0x21c4ff);}(_0x12ed,0xe5));var _0xd12e=function(_0x5d570a,_0xd351b6){_0x5d570a=_0x5d570a-0x0;var _0x1dd28b=_0x12ed[_0x5d570a];return _0x1dd28b;};'use strict';var multer=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var path=require(_0xd12e('0x2'));var timeout=require(_0xd12e('0x3'));var express=require(_0xd12e('0x4'));var router=express['Router']();var fs_extra=require(_0xd12e('0x5'));var auth=require(_0xd12e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd12e('0x7')](_0xd12e('0x8'),auth['isAuthenticated'](),controller[_0xd12e('0x9')]);router[_0xd12e('0x7')](_0xd12e('0xa'),auth[_0xd12e('0xb')](),controller[_0xd12e('0xc')]);router[_0xd12e('0xd')]('/',auth[_0xd12e('0xb')](),controller[_0xd12e('0xe')]);router[_0xd12e('0xd')](_0xd12e('0xa'),auth[_0xd12e('0xb')](),controller['addSound']);router['put'](_0xd12e('0x8'),auth[_0xd12e('0xb')](),controller[_0xd12e('0xf')]);router[_0xd12e('0x10')]('/:id',auth[_0xd12e('0xb')](),controller[_0xd12e('0x11')]);router[_0xd12e('0x10')](_0xd12e('0x12'),auth['isAuthenticated'](),controller[_0xd12e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 14dc74c..6479050 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 _0x85aa=['mp3nb','quietmp3','alpha','STRING','ENUM','files'];(function(_0x1513e7,_0x2afd32){var _0x502a60=function(_0x295917){while(--_0x295917){_0x1513e7['push'](_0x1513e7['shift']());}};_0x502a60(++_0x2afd32);}(_0x85aa,0xc3));var _0xa85a=function(_0xd1c04f,_0x5810fd){_0xd1c04f=_0xd1c04f-0x0;var _0x16bfe7=_0x85aa[_0xd1c04f];return _0x16bfe7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa85a('0x0')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa85a('0x1')]('custom',_0xa85a('0x2'),_0xa85a('0x3'),'quietmp3nb',_0xa85a('0x4'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xa85a('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xa85a('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa85a('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa85a('0x0')],'allowNull':!![],'defaultValue':_0xa85a('0x5')},'format':{'type':Sequelize[_0xa85a('0x0')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfe6d=['TIMESTAMP','sequelize','exports','STRING','name','ENUM','files','mp3','alpha'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xfe6d,0xfd));var _0xdfe6=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xfe6d[_0x28d18d];return _0x470640;};'use strict';var Sequelize=require(_0xdfe6('0x0'));module[_0xdfe6('0x1')]={'name':{'type':Sequelize[_0xdfe6('0x2')],'allowNull':![],'unique':_0xdfe6('0x3')},'mode':{'type':Sequelize[_0xdfe6('0x4')]('custom',_0xdfe6('0x5'),'mp3nb','quietmp3nb','quietmp3',_0xdfe6('0x6')),'allowNull':!![],'defaultValue':_0xdfe6('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xdfe6('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdfe6('0x2')],'allowNull':!![],'defaultValue':_0xdfe6('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xdfe6('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 6fb7b7d..58d6a41 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 _0xb007=['rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','body','sequelize','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','message','removeSound','id2','getSounds','order','hasOwnProperty','eml-format'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xb007,0xdf));var _0x7b00=function(_0x50bd30,_0x45ecd0){_0x50bd30=_0x50bd30-0x0;var _0x5bdd72=_0xb007[_0x50bd30];return _0x5bdd72;};'use strict';var emlformat=require(_0x7b00('0x0'));var rimraf=require(_0x7b00('0x1'));var zipdir=require(_0x7b00('0x2'));var jsonpatch=require(_0x7b00('0x3'));var rp=require(_0x7b00('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7b00('0x5'));var csv=require(_0x7b00('0x6'));var ejs=require(_0x7b00('0x7'));var fs=require('fs');var fs_extra=require(_0x7b00('0x8'));var _=require(_0x7b00('0x9'));var squel=require(_0x7b00('0xa'));var crypto=require(_0x7b00('0xb'));var jsforce=require(_0x7b00('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7b00('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b00('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7b00('0xe'));var hardwareService=require(_0x7b00('0xf'));var logger=require(_0x7b00('0x10'))(_0x7b00('0x11'));var utils=require(_0x7b00('0x12'));var config=require(_0x7b00('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b00('0x14'))['db'];function respondWithStatusCode(_0x3fb682,_0x277eb4){_0x277eb4=_0x277eb4||0xcc;return function(_0x3c0893){if(_0x3c0893){return _0x3fb682[_0x7b00('0x15')](_0x277eb4);}return _0x3fb682['status'](_0x277eb4)[_0x7b00('0x16')]();};}function respondWithResult(_0x1ef26e,_0x4e60cc){_0x4e60cc=_0x4e60cc||0xc8;return function(_0x11f92c){if(_0x11f92c){return _0x1ef26e[_0x7b00('0x17')](_0x4e60cc)['json'](_0x11f92c);}};}function respondWithFilteredResult(_0x28b0d9,_0x5c2162){return function(_0x37a30b){if(_0x37a30b){var _0x7aeedf=typeof _0x5c2162[_0x7b00('0x18')]===_0x7b00('0x19')&&typeof _0x5c2162['limit']===_0x7b00('0x19');var _0x65bc96=_0x37a30b['count'];var _0x3f6885=_0x7aeedf?0x0:_0x5c2162[_0x7b00('0x18')];var _0x4a98f4=_0x7aeedf?_0x37a30b[_0x7b00('0x1a')]:_0x5c2162[_0x7b00('0x18')]+_0x5c2162[_0x7b00('0x1b')];var _0x1a67e8;if(_0x4a98f4>=_0x65bc96){_0x4a98f4=_0x65bc96;_0x1a67e8=0xc8;}else{_0x1a67e8=0xce;}_0x28b0d9['status'](_0x1a67e8);return _0x28b0d9[_0x7b00('0x1c')]('Content-Range',_0x3f6885+'-'+_0x4a98f4+'/'+_0x65bc96)[_0x7b00('0x1d')](_0x37a30b);}return null;};}function patchUpdates(_0x17c15c){return function(_0x109d2a){try{jsonpatch[_0x7b00('0x1e')](_0x109d2a,_0x17c15c,!![]);}catch(_0x1d4d0a){return BPromise[_0x7b00('0x1f')](_0x1d4d0a);}return _0x109d2a[_0x7b00('0x20')]();};}function saveUpdates(_0xbbd756,_0x488f5b){return function(_0x5dcfae){if(_0x5dcfae){return _0x5dcfae[_0x7b00('0x21')](_0xbbd756)[_0x7b00('0x22')](function(_0x4cf6e8){return _0x4cf6e8;});}return null;};}function removeEntity(_0x7445c8,_0x117e31){return function(_0x347b26){if(_0x347b26){return _0x347b26[_0x7b00('0x23')]()[_0x7b00('0x22')](function(){var _0x2a6fa1=_0x347b26['get']({'plain':!![]});var _0x3bcf50=_0x7b00('0x24');return db[_0x7b00('0x25')][_0x7b00('0x23')]({'where':{'type':_0x3bcf50,'resourceId':_0x2a6fa1['id']}})['then'](function(){return _0x347b26;});})['then'](function(){_0x7445c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5783fe,_0x221bfe){return function(_0x411f28){if(!_0x411f28){_0x5783fe[_0x7b00('0x15')](0x194);}return _0x411f28;};}function handleError(_0x28f478,_0x5e61b9){_0x5e61b9=_0x5e61b9||0x1f4;return function(_0x335840){logger[_0x7b00('0x26')](_0x335840[_0x7b00('0x27')]);if(_0x335840[_0x7b00('0x28')]){delete _0x335840['name'];}_0x28f478['status'](_0x5e61b9)[_0x7b00('0x29')](_0x335840);};}exports[_0x7b00('0x2a')]=function(_0x4bf171,_0x4cf374){var _0x5cb527={},_0x412c87={},_0x2deb7e={'count':0x0,'rows':[]};var _0x39cd5d=_[_0x7b00('0x2b')](db[_0x7b00('0x2c')][_0x7b00('0x2d')],function(_0x3d4e58){return{'name':_0x3d4e58[_0x7b00('0x2e')],'type':_0x3d4e58[_0x7b00('0x2f')][_0x7b00('0x30')]};});_0x412c87[_0x7b00('0x31')]=_[_0x7b00('0x2b')](_0x39cd5d,_0x7b00('0x28'));_0x412c87[_0x7b00('0x32')]=_[_0x7b00('0x33')](_0x4bf171[_0x7b00('0x32')]);_0x412c87[_0x7b00('0x34')]=_['intersection'](_0x412c87[_0x7b00('0x31')],_0x412c87['query']);_0x5cb527[_0x7b00('0x35')]=_['intersection'](_0x412c87[_0x7b00('0x31')],qs[_0x7b00('0x36')](_0x4bf171[_0x7b00('0x32')]['fields']));_0x5cb527['attributes']=_0x5cb527[_0x7b00('0x35')][_0x7b00('0x37')]?_0x5cb527[_0x7b00('0x35')]:_0x412c87['model'];if(!_0x4bf171[_0x7b00('0x32')]['hasOwnProperty'](_0x7b00('0x38'))){_0x5cb527['limit']=qs[_0x7b00('0x1b')](_0x4bf171[_0x7b00('0x32')]['limit']);_0x5cb527['offset']=qs['offset'](_0x4bf171[_0x7b00('0x32')][_0x7b00('0x18')]);}_0x5cb527['order']=qs['sort'](_0x4bf171[_0x7b00('0x32')]['sort']);delete _0x4bf171['query'][_0x7b00('0x39')];_0x5cb527[_0x7b00('0x3a')]=qs['filters'](_[_0x7b00('0x3b')](_0x4bf171['query'],_0x412c87[_0x7b00('0x34')]),_0x39cd5d);if(_0x4bf171[_0x7b00('0x32')][_0x7b00('0x3c')]){_0x5cb527[_0x7b00('0x3a')]=_[_0x7b00('0x3d')](_0x5cb527['where'],{'$or':_[_0x7b00('0x2b')](_0x39cd5d,function(_0xab6012){if(_0xab6012[_0x7b00('0x2f')]!==_0x7b00('0x3e')){var _0x5d4fe3={};_0x5d4fe3[_0xab6012[_0x7b00('0x28')]]={'$like':'%'+_0x4bf171[_0x7b00('0x32')][_0x7b00('0x3c')]+'%'};return _0x5d4fe3;}})});}_0x5cb527=_['merge']({},_0x5cb527,_0x4bf171[_0x7b00('0x3f')]);var _0x53812a={'where':_0x5cb527[_0x7b00('0x3a')]};return db[_0x7b00('0x2c')]['count'](_0x53812a)[_0x7b00('0x22')](function(_0x20a5a2){_0x2deb7e[_0x7b00('0x1a')]=_0x20a5a2;if(_0x4bf171['query'][_0x7b00('0x40')]){_0x5cb527['include']=[{'all':!![]}];}return db[_0x7b00('0x2c')]['findAll'](_0x5cb527);})[_0x7b00('0x22')](function(_0x346377){_0x2deb7e[_0x7b00('0x41')]=_0x346377;return _0x2deb7e;})[_0x7b00('0x22')](respondWithFilteredResult(_0x4cf374,_0x5cb527))[_0x7b00('0x42')](handleError(_0x4cf374,null));};exports[_0x7b00('0x43')]=function(_0x246ed4,_0x370fe9){var _0x145a9d={'raw':![],'where':{'id':_0x246ed4[_0x7b00('0x44')]['id']}},_0x4c18ed={};_0x4c18ed[_0x7b00('0x31')]=_[_0x7b00('0x33')](db[_0x7b00('0x2c')][_0x7b00('0x2d')]);_0x4c18ed[_0x7b00('0x32')]=_[_0x7b00('0x33')](_0x246ed4[_0x7b00('0x32')]);_0x4c18ed[_0x7b00('0x34')]=_[_0x7b00('0x45')](_0x4c18ed[_0x7b00('0x31')],_0x4c18ed[_0x7b00('0x32')]);_0x145a9d[_0x7b00('0x35')]=_[_0x7b00('0x45')](_0x4c18ed[_0x7b00('0x31')],qs[_0x7b00('0x36')](_0x246ed4[_0x7b00('0x32')][_0x7b00('0x36')]));_0x145a9d[_0x7b00('0x35')]=_0x145a9d['attributes'][_0x7b00('0x37')]?_0x145a9d['attributes']:_0x4c18ed[_0x7b00('0x31')];if(_0x246ed4[_0x7b00('0x32')][_0x7b00('0x40')]){_0x145a9d[_0x7b00('0x46')]=[{'all':!![]}];}_0x145a9d=_[_0x7b00('0x3d')]({},_0x145a9d,_0x246ed4[_0x7b00('0x3f')]);return db[_0x7b00('0x2c')][_0x7b00('0x47')](_0x145a9d)[_0x7b00('0x22')](handleEntityNotFound(_0x370fe9,null))[_0x7b00('0x22')](respondWithResult(_0x370fe9,null))['catch'](handleError(_0x370fe9,null));};exports['update']=function(_0x32f833,_0x491e4f){if(_0x32f833[_0x7b00('0x48')]['id']){delete _0x32f833['body']['id'];}return db[_0x7b00('0x2c')][_0x7b00('0x47')]({'where':{'id':_0x32f833[_0x7b00('0x44')]['id']}})['then'](handleEntityNotFound(_0x491e4f,null))['then'](saveUpdates(_0x32f833[_0x7b00('0x48')],null))[_0x7b00('0x22')](respondWithResult(_0x491e4f,null))[_0x7b00('0x42')](handleError(_0x491e4f,null));};exports['create']=function(_0x56ce6c,_0x323a51,_0x4a94c9){return db[_0x7b00('0x49')][_0x7b00('0x4a')](function(_0x10cd96){if(_0x56ce6c[_0x7b00('0x48')][_0x7b00('0x4b')]===_0x7b00('0x4c')){_0x56ce6c[_0x7b00('0x48')][_0x7b00('0x4d')]=path[_0x7b00('0x4e')](config[_0x7b00('0x4f')],_0x7b00('0x50'),_0x56ce6c['body']['name']);}return db[_0x7b00('0x2c')][_0x7b00('0x51')](_0x56ce6c[_0x7b00('0x48')],{'transaction':_0x10cd96})[_0x7b00('0x22')](function(_0x297e2d){if(_0x56ce6c[_0x7b00('0x48')][_0x7b00('0x4b')]===_0x7b00('0x4c')){fs[_0x7b00('0x52')](_0x297e2d['directory'],parseInt(_0x7b00('0x53'),0x8));}var _0x16dac9=_0x56ce6c[_0x7b00('0x54')][_0x7b00('0x55')]({'plain':!![]});if(!_0x16dac9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16dac9['role']===_0x7b00('0x54')){var _0x4d653d=_0x297e2d['get']({'plain':!![]});return db[_0x7b00('0x56')][_0x7b00('0x47')]({'where':{'name':_0x7b00('0x24'),'userProfileId':_0x16dac9[_0x7b00('0x57')]},'raw':!![]})[_0x7b00('0x22')](function(_0x23fe25){if(_0x23fe25&&_0x23fe25['autoAssociation']===0x0){return db[_0x7b00('0x25')]['create']({'name':_0x4d653d['name'],'resourceId':_0x4d653d['id'],'type':_0x23fe25[_0x7b00('0x28')],'sectionId':_0x23fe25['id']},{})[_0x7b00('0x22')](function(){return _0x297e2d;});}else{return _0x297e2d;}})[_0x7b00('0x42')](function(_0x1305b7){logger[_0x7b00('0x26')](_0x7b00('0x58'),_0x1305b7);});}return _0x297e2d;});})[_0x7b00('0x22')](respondWithResult(_0x323a51,0xc9))[_0x7b00('0x42')](handleError(_0x323a51,null));};exports[_0x7b00('0x23')]=function(_0x1bb0c8,_0x373725,_0x48372e){var _0xcf5ea5;return db[_0x7b00('0x2c')]['find']({'where':{'id':_0x1bb0c8['params']['id']}})[_0x7b00('0x22')](function(_0x252c94){if(_0x252c94){return db['sequelize'][_0x7b00('0x4a')](function(_0x1757c8){return _0x252c94[_0x7b00('0x23')]({'transaction':_0x1757c8,'raw':!![]})[_0x7b00('0x22')](function(_0x67863e){if(_0x67863e['directory']){fs[_0x7b00('0x59')](_0x67863e[_0x7b00('0x4d')])['forEach'](function(_0x58fda3){fs[_0x7b00('0x5a')](path[_0x7b00('0x4e')](_0x67863e['directory'],_0x58fda3));});fs[_0x7b00('0x5b')](_0x67863e[_0x7b00('0x4d')]);}return _0x67863e;});})['catch'](function(_0x210a09){throw new db[(_0x7b00('0x5c'))]['ValidationError'](_0x210a09['message']);});}})[_0x7b00('0x22')](handleEntityNotFound(_0x373725,null))[_0x7b00('0x22')](removeEntity(_0x373725,null))[_0x7b00('0x42')](handleError(_0x373725,null));};exports[_0x7b00('0x5d')]=function(_0x61f8bd,_0x5b0bb6,_0x54529a){return db['sequelize'][_0x7b00('0x4a')](function(_0x1a763b){var _0x5d8d7c;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x61f8bd['params']['id']}})[_0x7b00('0x22')](function(_0x25eba1){if(_0x25eba1){_0x5d8d7c=_0x25eba1;return _0x25eba1['addSound'](_0x61f8bd[_0x7b00('0x48')]['id'],{'transaction':_0x1a763b});}})['then'](function(_0x3d4354){if(_0x3d4354){return db[_0x7b00('0x5e')][_0x7b00('0x5f')]({'where':{'id':_0x61f8bd[_0x7b00('0x48')]['id']},'attributes':['id','name',_0x7b00('0x60'),'converted_format',_0x7b00('0x61')],'raw':!![]});}})[_0x7b00('0x22')](function(_0xb4b3db){if(_0xb4b3db){var _0x285bb7=path[_0x7b00('0x4e')](config[_0x7b00('0x4f')],_0x7b00('0x62'),util[_0x7b00('0x63')](_0x7b00('0x64'),path[_0x7b00('0x65')](_0xb4b3db[_0x7b00('0x60')],path[_0x7b00('0x66')](_0xb4b3db[_0x7b00('0x60')])),_0xb4b3db['converted_format']));var _0x33d562=path[_0x7b00('0x4e')](config[_0x7b00('0x4f')],_0x7b00('0x50'),_0x5d8d7c[_0x7b00('0x28')],util['format']('%s.%s',_0xb4b3db['name'],_0xb4b3db[_0x7b00('0x67')]));fs[_0x7b00('0x68')](_0x285bb7,_0x33d562);return _0xb4b3db;}})[_0x7b00('0x42')](function(_0x5ba778){throw new db[(_0x7b00('0x5c'))][(_0x7b00('0x69'))](_0x5ba778[_0x7b00('0x6a')]);});})[_0x7b00('0x22')](handleEntityNotFound(_0x5b0bb6,null))[_0x7b00('0x22')](respondWithResult(_0x5b0bb6,0xc9))['catch'](handleError(_0x5b0bb6,null));};exports[_0x7b00('0x6b')]=function(_0x2a251b,_0x55b303,_0x52d10a){return db['sequelize'][_0x7b00('0x4a')](function(_0x3e9453){var _0x3ea724;return db[_0x7b00('0x2c')][_0x7b00('0x5f')]({'where':{'id':_0x2a251b['params']['id']}})[_0x7b00('0x22')](handleEntityNotFound(_0x55b303,null))[_0x7b00('0x22')](function(_0x529a36){if(_0x529a36){_0x3ea724=_0x529a36;return _0x529a36[_0x7b00('0x6b')](_0x2a251b[_0x7b00('0x44')][_0x7b00('0x6c')]);}})[_0x7b00('0x22')](function(_0x363ff4){if(_0x363ff4){return db[_0x7b00('0x5e')]['findOne']({'where':{'id':_0x2a251b[_0x7b00('0x44')][_0x7b00('0x6c')]},'attributes':['id',_0x7b00('0x28'),_0x7b00('0x60'),'converted_format','createdAt'],'raw':!![]});}})[_0x7b00('0x22')](function(_0x2412bc){if(_0x2412bc){fs['unlinkSync'](path[_0x7b00('0x4e')](_0x3ea724[_0x7b00('0x4d')],util['format'](_0x7b00('0x64'),_0x2412bc[_0x7b00('0x28')],_0x2412bc[_0x7b00('0x67')])));return _0x2412bc;}})[_0x7b00('0x42')](function(_0x448c39){throw new db[(_0x7b00('0x5c'))]['ValidationError'](_0x448c39[_0x7b00('0x6a')]);});})[_0x7b00('0x22')](handleEntityNotFound(_0x55b303,null))['then'](respondWithStatusCode(_0x55b303,0xcc))['catch'](handleError(_0x55b303,null));};exports[_0x7b00('0x6d')]=function(_0x4c3913,_0x179489,_0x4b9984){var _0x1d0d3e={};var _0x451043={};var _0x418fde;var _0x2353ce;return db[_0x7b00('0x2c')]['findOne']({'where':{'id':_0x4c3913['params']['id']}})[_0x7b00('0x22')](handleEntityNotFound(_0x179489,null))[_0x7b00('0x22')](function(_0xaf3786){if(_0xaf3786){_0x418fde=_0xaf3786;_0x451043['model']=_[_0x7b00('0x33')](db['Sound'][_0x7b00('0x2d')]);_0x451043[_0x7b00('0x32')]=_[_0x7b00('0x33')](_0x4c3913[_0x7b00('0x32')]);_0x451043['filters']=_[_0x7b00('0x45')](_0x451043[_0x7b00('0x31')],_0x451043[_0x7b00('0x32')]);_0x1d0d3e[_0x7b00('0x35')]=_[_0x7b00('0x45')](_0x451043[_0x7b00('0x31')],qs[_0x7b00('0x36')](_0x4c3913[_0x7b00('0x32')][_0x7b00('0x36')]));_0x1d0d3e[_0x7b00('0x35')]=_0x1d0d3e[_0x7b00('0x35')][_0x7b00('0x37')]?_0x1d0d3e[_0x7b00('0x35')]:_0x451043[_0x7b00('0x31')];_0x1d0d3e[_0x7b00('0x6e')]=qs[_0x7b00('0x39')](_0x4c3913[_0x7b00('0x32')][_0x7b00('0x39')]);_0x1d0d3e['where']=qs[_0x7b00('0x34')](_[_0x7b00('0x3b')](_0x4c3913[_0x7b00('0x32')],_0x451043['filters']));if(_0x4c3913[_0x7b00('0x32')]['filter']){_0x1d0d3e[_0x7b00('0x3a')]=_[_0x7b00('0x3d')](_0x1d0d3e[_0x7b00('0x3a')],{'$or':_[_0x7b00('0x2b')](_0x1d0d3e[_0x7b00('0x35')],function(_0x3ecd70){var _0x257ad2={};_0x257ad2[_0x3ecd70]={'$like':'%'+_0x4c3913[_0x7b00('0x32')][_0x7b00('0x3c')]+'%'};return _0x257ad2;})});}_0x1d0d3e=_[_0x7b00('0x3d')]({},_0x1d0d3e,_0x4c3913[_0x7b00('0x3f')]);return _0x418fde['getSounds'](_0x1d0d3e);}})[_0x7b00('0x22')](function(_0x232e11){if(_0x232e11){_0x2353ce=_0x232e11[_0x7b00('0x37')];if(!_0x4c3913[_0x7b00('0x32')][_0x7b00('0x6f')]('nolimit')){_0x1d0d3e[_0x7b00('0x1b')]=qs[_0x7b00('0x1b')](_0x4c3913[_0x7b00('0x32')][_0x7b00('0x1b')]);_0x1d0d3e[_0x7b00('0x18')]=qs['offset'](_0x4c3913[_0x7b00('0x32')][_0x7b00('0x18')]);}return _0x418fde['getSounds'](_0x1d0d3e);}})[_0x7b00('0x22')](function(_0x1d8a23){if(_0x1d8a23){return _0x1d8a23?{'count':_0x2353ce,'rows':_0x1d8a23}:null;}})[_0x7b00('0x22')](respondWithResult(_0x179489,null))[_0x7b00('0x42')](handleError(_0x179489,null));}; \ No newline at end of file +var _0x28fd=['show','params','body','create','sequelize','transaction','mode','files','directory','server/files/moh','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','converted_format','createdAt','join','root','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','symlinkSync','removeSound','findOne','id2','order','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x406c9e,_0x2c67c2){var _0x1b7f53=function(_0x3b6a5d){while(--_0x3b6a5d){_0x406c9e['push'](_0x406c9e['shift']());}};_0x1b7f53(++_0x2c67c2);}(_0x28fd,0x9f));var _0xd28f=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x28fd[_0x21a2b3];return _0x4651a7;};'use strict';var emlformat=require(_0xd28f('0x0'));var rimraf=require(_0xd28f('0x1'));var zipdir=require(_0xd28f('0x2'));var jsonpatch=require(_0xd28f('0x3'));var rp=require(_0xd28f('0x4'));var moment=require(_0xd28f('0x5'));var BPromise=require(_0xd28f('0x6'));var Mustache=require(_0xd28f('0x7'));var util=require(_0xd28f('0x8'));var path=require(_0xd28f('0x9'));var sox=require(_0xd28f('0xa'));var csv=require(_0xd28f('0xb'));var ejs=require(_0xd28f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd28f('0xd'));var crypto=require(_0xd28f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd28f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd28f('0x10'));var Papa=require(_0xd28f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd28f('0x12'));var as=require(_0xd28f('0x13'));var hardwareService=require(_0xd28f('0x14'));var logger=require('../../config/logger')(_0xd28f('0x15'));var utils=require(_0xd28f('0x16'));var config=require(_0xd28f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd28f('0x18'))['db'];function respondWithStatusCode(_0x48db1a,_0x4cd063){_0x4cd063=_0x4cd063||0xcc;return function(_0x19dabe){if(_0x19dabe){return _0x48db1a[_0xd28f('0x19')](_0x4cd063);}return _0x48db1a[_0xd28f('0x1a')](_0x4cd063)['end']();};}function respondWithResult(_0x3068f6,_0x39a53d){_0x39a53d=_0x39a53d||0xc8;return function(_0x2c9906){if(_0x2c9906){return _0x3068f6[_0xd28f('0x1a')](_0x39a53d)[_0xd28f('0x1b')](_0x2c9906);}};}function respondWithFilteredResult(_0x453a74,_0x447391){return function(_0x5642){if(_0x5642){var _0x5a0f73=typeof _0x447391[_0xd28f('0x1c')]===_0xd28f('0x1d')&&typeof _0x447391[_0xd28f('0x1e')]===_0xd28f('0x1d');var _0x57fb08=_0x5642[_0xd28f('0x1f')];var _0x10ffbe=_0x5a0f73?0x0:_0x447391['offset'];var _0x36b4bd=_0x5a0f73?_0x5642[_0xd28f('0x1f')]:_0x447391[_0xd28f('0x1c')]+_0x447391['limit'];var _0x4ca840;if(_0x36b4bd>=_0x57fb08){_0x36b4bd=_0x57fb08;_0x4ca840=0xc8;}else{_0x4ca840=0xce;}_0x453a74[_0xd28f('0x1a')](_0x4ca840);return _0x453a74[_0xd28f('0x20')]('Content-Range',_0x10ffbe+'-'+_0x36b4bd+'/'+_0x57fb08)[_0xd28f('0x1b')](_0x5642);}return null;};}function patchUpdates(_0x18ca04){return function(_0xbc5f0){try{jsonpatch[_0xd28f('0x21')](_0xbc5f0,_0x18ca04,!![]);}catch(_0x5f0df7){return BPromise['reject'](_0x5f0df7);}return _0xbc5f0[_0xd28f('0x22')]();};}function saveUpdates(_0x15d84e,_0x127294){return function(_0x2d4552){if(_0x2d4552){return _0x2d4552[_0xd28f('0x23')](_0x15d84e)[_0xd28f('0x24')](function(_0x25f782){return _0x25f782;});}return null;};}function removeEntity(_0x3c25b1,_0x2c0b08){return function(_0x1b1fb9){if(_0x1b1fb9){return _0x1b1fb9[_0xd28f('0x25')]()['then'](function(){var _0x55d2db=_0x1b1fb9[_0xd28f('0x26')]({'plain':!![]});var _0x175ac9=_0xd28f('0x27');return db[_0xd28f('0x28')][_0xd28f('0x25')]({'where':{'type':_0x175ac9,'resourceId':_0x55d2db['id']}})[_0xd28f('0x24')](function(){return _0x1b1fb9;});})['then'](function(){_0x3c25b1[_0xd28f('0x1a')](0xcc)[_0xd28f('0x29')]();});}};}function handleEntityNotFound(_0x46a208,_0x28ae41){return function(_0x1773e5){if(!_0x1773e5){_0x46a208[_0xd28f('0x19')](0x194);}return _0x1773e5;};}function handleError(_0x2cd934,_0xcb3d5d){_0xcb3d5d=_0xcb3d5d||0x1f4;return function(_0x539b2){logger['error'](_0x539b2[_0xd28f('0x2a')]);if(_0x539b2[_0xd28f('0x2b')]){delete _0x539b2[_0xd28f('0x2b')];}_0x2cd934['status'](_0xcb3d5d)[_0xd28f('0x2c')](_0x539b2);};}exports[_0xd28f('0x2d')]=function(_0x2f8ab2,_0x2ae5c3){var _0x2dfdbb={},_0x2bb051={},_0x58fcf4={'count':0x0,'rows':[]};var _0x575564=_[_0xd28f('0x2e')](db[_0xd28f('0x2f')][_0xd28f('0x30')],function(_0x46bdf6){return{'name':_0x46bdf6[_0xd28f('0x31')],'type':_0x46bdf6[_0xd28f('0x32')][_0xd28f('0x33')]};});_0x2bb051[_0xd28f('0x34')]=_[_0xd28f('0x2e')](_0x575564,_0xd28f('0x2b'));_0x2bb051[_0xd28f('0x35')]=_[_0xd28f('0x36')](_0x2f8ab2[_0xd28f('0x35')]);_0x2bb051[_0xd28f('0x37')]=_[_0xd28f('0x38')](_0x2bb051[_0xd28f('0x34')],_0x2bb051['query']);_0x2dfdbb[_0xd28f('0x39')]=_[_0xd28f('0x38')](_0x2bb051[_0xd28f('0x34')],qs[_0xd28f('0x3a')](_0x2f8ab2[_0xd28f('0x35')][_0xd28f('0x3a')]));_0x2dfdbb[_0xd28f('0x39')]=_0x2dfdbb[_0xd28f('0x39')][_0xd28f('0x3b')]?_0x2dfdbb[_0xd28f('0x39')]:_0x2bb051[_0xd28f('0x34')];if(!_0x2f8ab2[_0xd28f('0x35')][_0xd28f('0x3c')]('nolimit')){_0x2dfdbb['limit']=qs[_0xd28f('0x1e')](_0x2f8ab2[_0xd28f('0x35')][_0xd28f('0x1e')]);_0x2dfdbb[_0xd28f('0x1c')]=qs[_0xd28f('0x1c')](_0x2f8ab2[_0xd28f('0x35')][_0xd28f('0x1c')]);}_0x2dfdbb['order']=qs[_0xd28f('0x3d')](_0x2f8ab2['query'][_0xd28f('0x3d')]);delete _0x2f8ab2[_0xd28f('0x35')]['sort'];_0x2dfdbb[_0xd28f('0x3e')]=qs[_0xd28f('0x37')](_[_0xd28f('0x3f')](_0x2f8ab2['query'],_0x2bb051[_0xd28f('0x37')]),_0x575564);if(_0x2f8ab2[_0xd28f('0x35')][_0xd28f('0x40')]){_0x2dfdbb[_0xd28f('0x3e')]=_[_0xd28f('0x41')](_0x2dfdbb[_0xd28f('0x3e')],{'$or':_[_0xd28f('0x2e')](_0x575564,function(_0x4538cc){if(_0x4538cc[_0xd28f('0x32')]!==_0xd28f('0x42')){var _0x1af236={};_0x1af236[_0x4538cc[_0xd28f('0x2b')]]={'$like':'%'+_0x2f8ab2[_0xd28f('0x35')]['filter']+'%'};return _0x1af236;}})});}_0x2dfdbb=_[_0xd28f('0x41')]({},_0x2dfdbb,_0x2f8ab2[_0xd28f('0x43')]);var _0x22ff24={'where':_0x2dfdbb[_0xd28f('0x3e')]};return db[_0xd28f('0x2f')][_0xd28f('0x1f')](_0x22ff24)['then'](function(_0x4682b4){_0x58fcf4[_0xd28f('0x1f')]=_0x4682b4;if(_0x2f8ab2['query'][_0xd28f('0x44')]){_0x2dfdbb[_0xd28f('0x45')]=[{'all':!![]}];}return db[_0xd28f('0x2f')][_0xd28f('0x46')](_0x2dfdbb);})[_0xd28f('0x24')](function(_0x3700d6){_0x58fcf4[_0xd28f('0x47')]=_0x3700d6;return _0x58fcf4;})[_0xd28f('0x24')](respondWithFilteredResult(_0x2ae5c3,_0x2dfdbb))[_0xd28f('0x48')](handleError(_0x2ae5c3,null));};exports[_0xd28f('0x49')]=function(_0x3436f0,_0x2a69d5){var _0x37a4df={'raw':![],'where':{'id':_0x3436f0[_0xd28f('0x4a')]['id']}},_0xdc1eed={};_0xdc1eed[_0xd28f('0x34')]=_['keys'](db[_0xd28f('0x2f')][_0xd28f('0x30')]);_0xdc1eed[_0xd28f('0x35')]=_['keys'](_0x3436f0[_0xd28f('0x35')]);_0xdc1eed['filters']=_[_0xd28f('0x38')](_0xdc1eed[_0xd28f('0x34')],_0xdc1eed[_0xd28f('0x35')]);_0x37a4df[_0xd28f('0x39')]=_[_0xd28f('0x38')](_0xdc1eed[_0xd28f('0x34')],qs[_0xd28f('0x3a')](_0x3436f0[_0xd28f('0x35')][_0xd28f('0x3a')]));_0x37a4df[_0xd28f('0x39')]=_0x37a4df[_0xd28f('0x39')][_0xd28f('0x3b')]?_0x37a4df[_0xd28f('0x39')]:_0xdc1eed[_0xd28f('0x34')];if(_0x3436f0[_0xd28f('0x35')]['includeAll']){_0x37a4df['include']=[{'all':!![]}];}_0x37a4df=_[_0xd28f('0x41')]({},_0x37a4df,_0x3436f0[_0xd28f('0x43')]);return db[_0xd28f('0x2f')]['find'](_0x37a4df)['then'](handleEntityNotFound(_0x2a69d5,null))[_0xd28f('0x24')](respondWithResult(_0x2a69d5,null))[_0xd28f('0x48')](handleError(_0x2a69d5,null));};exports['update']=function(_0x3fa94a,_0x18f46f){if(_0x3fa94a[_0xd28f('0x4b')]['id']){delete _0x3fa94a['body']['id'];}return db[_0xd28f('0x2f')]['find']({'where':{'id':_0x3fa94a[_0xd28f('0x4a')]['id']}})[_0xd28f('0x24')](handleEntityNotFound(_0x18f46f,null))['then'](saveUpdates(_0x3fa94a[_0xd28f('0x4b')],null))[_0xd28f('0x24')](respondWithResult(_0x18f46f,null))[_0xd28f('0x48')](handleError(_0x18f46f,null));};exports[_0xd28f('0x4c')]=function(_0x554719,_0x218a0a,_0x4efb3b){return db[_0xd28f('0x4d')][_0xd28f('0x4e')](function(_0x21e786){if(_0x554719[_0xd28f('0x4b')][_0xd28f('0x4f')]===_0xd28f('0x50')){_0x554719[_0xd28f('0x4b')][_0xd28f('0x51')]=path['join'](config['root'],_0xd28f('0x52'),_0x554719['body'][_0xd28f('0x2b')]);}return db[_0xd28f('0x2f')][_0xd28f('0x4c')](_0x554719['body'],{'transaction':_0x21e786})[_0xd28f('0x24')](function(_0x5dca3e){if(_0x554719[_0xd28f('0x4b')][_0xd28f('0x4f')]==='files'){fs['mkdirSync'](_0x5dca3e['directory'],parseInt(_0xd28f('0x53'),0x8));}var _0x1689ae=_0x554719['user'][_0xd28f('0x26')]({'plain':!![]});if(!_0x1689ae)throw new Error(_0xd28f('0x54'));if(_0x1689ae[_0xd28f('0x55')]==='user'){var _0xf02887=_0x5dca3e[_0xd28f('0x26')]({'plain':!![]});return db[_0xd28f('0x56')][_0xd28f('0x57')]({'where':{'name':_0xd28f('0x27'),'userProfileId':_0x1689ae[_0xd28f('0x58')]},'raw':!![]})[_0xd28f('0x24')](function(_0x66eba1){if(_0x66eba1&&_0x66eba1[_0xd28f('0x59')]===0x0){return db[_0xd28f('0x28')][_0xd28f('0x4c')]({'name':_0xf02887[_0xd28f('0x2b')],'resourceId':_0xf02887['id'],'type':_0x66eba1[_0xd28f('0x2b')],'sectionId':_0x66eba1['id']},{})[_0xd28f('0x24')](function(){return _0x5dca3e;});}else{return _0x5dca3e;}})[_0xd28f('0x48')](function(_0x5a46dd){logger[_0xd28f('0x5a')](_0xd28f('0x5b'),_0x5a46dd);});}return _0x5dca3e;});})[_0xd28f('0x24')](respondWithResult(_0x218a0a,0xc9))[_0xd28f('0x48')](handleError(_0x218a0a,null));};exports['destroy']=function(_0x47529d,_0x6e9830,_0x50ee7a){var _0xc5235e;return db[_0xd28f('0x2f')]['find']({'where':{'id':_0x47529d[_0xd28f('0x4a')]['id']}})[_0xd28f('0x24')](function(_0x52647d){if(_0x52647d){return db[_0xd28f('0x4d')][_0xd28f('0x4e')](function(_0x1ec504){return _0x52647d[_0xd28f('0x25')]({'transaction':_0x1ec504,'raw':!![]})['then'](function(_0x55f201){if(_0x55f201['directory']){fs['readdirSync'](_0x55f201[_0xd28f('0x51')])[_0xd28f('0x5c')](function(_0x53a42f){fs[_0xd28f('0x5d')](path['join'](_0x55f201[_0xd28f('0x51')],_0x53a42f));});fs['rmdirSync'](_0x55f201[_0xd28f('0x51')]);}return _0x55f201;});})[_0xd28f('0x48')](function(_0x5732c7){throw new db[(_0xd28f('0x5e'))][(_0xd28f('0x5f'))](_0x5732c7[_0xd28f('0x60')]);});}})['then'](handleEntityNotFound(_0x6e9830,null))[_0xd28f('0x24')](removeEntity(_0x6e9830,null))[_0xd28f('0x48')](handleError(_0x6e9830,null));};exports[_0xd28f('0x61')]=function(_0x3a8880,_0x394bef,_0x15d856){return db[_0xd28f('0x4d')][_0xd28f('0x4e')](function(_0x489712){var _0x50bc45;return db[_0xd28f('0x2f')][_0xd28f('0x57')]({'where':{'id':_0x3a8880[_0xd28f('0x4a')]['id']}})[_0xd28f('0x24')](function(_0x2510c7){if(_0x2510c7){_0x50bc45=_0x2510c7;return _0x2510c7['addSound'](_0x3a8880['body']['id'],{'transaction':_0x489712});}})[_0xd28f('0x24')](function(_0x391115){if(_0x391115){return db[_0xd28f('0x62')]['findOne']({'where':{'id':_0x3a8880[_0xd28f('0x4b')]['id']},'attributes':['id','name','save_name',_0xd28f('0x63'),_0xd28f('0x64')],'raw':!![]});}})[_0xd28f('0x24')](function(_0x4bae04){if(_0x4bae04){var _0x519879=path[_0xd28f('0x65')](config[_0xd28f('0x66')],_0xd28f('0x67'),util[_0xd28f('0x68')](_0xd28f('0x69'),path[_0xd28f('0x6a')](_0x4bae04[_0xd28f('0x6b')],path[_0xd28f('0x6c')](_0x4bae04[_0xd28f('0x6b')])),_0x4bae04[_0xd28f('0x63')]));var _0x5ecf58=path[_0xd28f('0x65')](config[_0xd28f('0x66')],_0xd28f('0x52'),_0x50bc45[_0xd28f('0x2b')],util[_0xd28f('0x68')]('%s.%s',_0x4bae04['name'],_0x4bae04['converted_format']));fs[_0xd28f('0x6d')](_0x519879,_0x5ecf58);return _0x4bae04;}})[_0xd28f('0x48')](function(_0x35f633){throw new db[(_0xd28f('0x5e'))][(_0xd28f('0x5f'))](_0x35f633['message']);});})[_0xd28f('0x24')](handleEntityNotFound(_0x394bef,null))['then'](respondWithResult(_0x394bef,0xc9))[_0xd28f('0x48')](handleError(_0x394bef,null));};exports[_0xd28f('0x6e')]=function(_0x4803e7,_0x186ebe,_0x28e9e0){return db[_0xd28f('0x4d')][_0xd28f('0x4e')](function(_0x3048f7){var _0x37a0ff;return db['VoiceMusicOnHold'][_0xd28f('0x6f')]({'where':{'id':_0x4803e7[_0xd28f('0x4a')]['id']}})[_0xd28f('0x24')](handleEntityNotFound(_0x186ebe,null))[_0xd28f('0x24')](function(_0x587586){if(_0x587586){_0x37a0ff=_0x587586;return _0x587586[_0xd28f('0x6e')](_0x4803e7[_0xd28f('0x4a')][_0xd28f('0x70')]);}})['then'](function(_0x37df5a){if(_0x37df5a){return db['Sound'][_0xd28f('0x6f')]({'where':{'id':_0x4803e7[_0xd28f('0x4a')][_0xd28f('0x70')]},'attributes':['id',_0xd28f('0x2b'),'save_name','converted_format',_0xd28f('0x64')],'raw':!![]});}})[_0xd28f('0x24')](function(_0x290891){if(_0x290891){fs['unlinkSync'](path['join'](_0x37a0ff[_0xd28f('0x51')],util[_0xd28f('0x68')](_0xd28f('0x69'),_0x290891[_0xd28f('0x2b')],_0x290891[_0xd28f('0x63')])));return _0x290891;}})[_0xd28f('0x48')](function(_0x1ba900){throw new db[(_0xd28f('0x5e'))][(_0xd28f('0x5f'))](_0x1ba900[_0xd28f('0x60')]);});})[_0xd28f('0x24')](handleEntityNotFound(_0x186ebe,null))[_0xd28f('0x24')](respondWithStatusCode(_0x186ebe,0xcc))[_0xd28f('0x48')](handleError(_0x186ebe,null));};exports['getSounds']=function(_0x9c6693,_0x21089b,_0x55eb89){var _0x4e935d={};var _0x55b0cc={};var _0x34ab31;var _0x3a222f;return db[_0xd28f('0x2f')]['findOne']({'where':{'id':_0x9c6693[_0xd28f('0x4a')]['id']}})[_0xd28f('0x24')](handleEntityNotFound(_0x21089b,null))[_0xd28f('0x24')](function(_0x2cc06e){if(_0x2cc06e){_0x34ab31=_0x2cc06e;_0x55b0cc[_0xd28f('0x34')]=_[_0xd28f('0x36')](db[_0xd28f('0x62')]['rawAttributes']);_0x55b0cc[_0xd28f('0x35')]=_[_0xd28f('0x36')](_0x9c6693[_0xd28f('0x35')]);_0x55b0cc[_0xd28f('0x37')]=_[_0xd28f('0x38')](_0x55b0cc[_0xd28f('0x34')],_0x55b0cc['query']);_0x4e935d[_0xd28f('0x39')]=_[_0xd28f('0x38')](_0x55b0cc[_0xd28f('0x34')],qs[_0xd28f('0x3a')](_0x9c6693[_0xd28f('0x35')][_0xd28f('0x3a')]));_0x4e935d['attributes']=_0x4e935d[_0xd28f('0x39')][_0xd28f('0x3b')]?_0x4e935d[_0xd28f('0x39')]:_0x55b0cc['model'];_0x4e935d[_0xd28f('0x71')]=qs['sort'](_0x9c6693[_0xd28f('0x35')]['sort']);_0x4e935d[_0xd28f('0x3e')]=qs['filters'](_[_0xd28f('0x3f')](_0x9c6693[_0xd28f('0x35')],_0x55b0cc[_0xd28f('0x37')]));if(_0x9c6693[_0xd28f('0x35')][_0xd28f('0x40')]){_0x4e935d['where']=_[_0xd28f('0x41')](_0x4e935d[_0xd28f('0x3e')],{'$or':_[_0xd28f('0x2e')](_0x4e935d[_0xd28f('0x39')],function(_0xc900fe){var _0xf88304={};_0xf88304[_0xc900fe]={'$like':'%'+_0x9c6693['query'][_0xd28f('0x40')]+'%'};return _0xf88304;})});}_0x4e935d=_[_0xd28f('0x41')]({},_0x4e935d,_0x9c6693[_0xd28f('0x43')]);return _0x34ab31[_0xd28f('0x72')](_0x4e935d);}})[_0xd28f('0x24')](function(_0x4f562a){if(_0x4f562a){_0x3a222f=_0x4f562a[_0xd28f('0x3b')];if(!_0x9c6693['query'][_0xd28f('0x3c')](_0xd28f('0x73'))){_0x4e935d['limit']=qs[_0xd28f('0x1e')](_0x9c6693['query'][_0xd28f('0x1e')]);_0x4e935d[_0xd28f('0x1c')]=qs[_0xd28f('0x1c')](_0x9c6693[_0xd28f('0x35')][_0xd28f('0x1c')]);}return _0x34ab31[_0xd28f('0x72')](_0x4e935d);}})[_0xd28f('0x24')](function(_0x1398e0){if(_0x1398e0){return _0x1398e0?{'count':_0x3a222f,'rows':_0x1398e0}:null;}})['then'](respondWithResult(_0x21089b,null))[_0xd28f('0x48')](handleError(_0x21089b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 52b8bd2..f7b6c75 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 _0x88bc=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','../../config/logger','api','moment'];(function(_0x105618,_0x2b2d47){var _0x5d91d2=function(_0x5f511b){while(--_0x5f511b){_0x105618['push'](_0x105618['shift']());}};_0x5d91d2(++_0x2b2d47);}(_0x88bc,0x175));var _0xc88b=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x88bc[_0x408d22];return _0x58effd;};'use strict';var _=require(_0xc88b('0x0'));var util=require('util');var logger=require(_0xc88b('0x1'))(_0xc88b('0x2'));var moment=require(_0xc88b('0x3'));var BPromise=require(_0xc88b('0x4'));var rp=require(_0xc88b('0x5'));var fs=require('fs');var path=require(_0xc88b('0x6'));var rimraf=require(_0xc88b('0x7'));var config=require(_0xc88b('0x8'));var attributes=require(_0xc88b('0x9'));module[_0xc88b('0xa')]=function(_0x1234a2,_0x253b1c){return _0x1234a2[_0xc88b('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0xc88b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf026=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x44251f,_0x5889a1){var _0xbef371=function(_0x24c25a){while(--_0x24c25a){_0x44251f['push'](_0x44251f['shift']());}};_0xbef371(++_0x5889a1);}(_0xf026,0x17d));var _0x6f02=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf026[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x6f02('0x0'));var util=require(_0x6f02('0x1'));var logger=require(_0x6f02('0x2'))(_0x6f02('0x3'));var moment=require('moment');var BPromise=require(_0x6f02('0x4'));var rp=require(_0x6f02('0x5'));var fs=require('fs');var path=require(_0x6f02('0x6'));var rimraf=require(_0x6f02('0x7'));var config=require(_0x6f02('0x8'));var attributes=require(_0x6f02('0x9'));module[_0x6f02('0xa')]=function(_0x281471,_0x193657){return _0x281471[_0x6f02('0xb')](_0x6f02('0xc'),attributes,{'tableName':_0x6f02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index adafd97..b05184b 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x4a57cf,_0x5c3a0a){var _0x377f92=function(_0x4057b7){while(--_0x4057b7){_0x4a57cf['push'](_0x4a57cf['shift']());}};_0x377f92(++_0x5c3a0a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xcb91[_0x3430aa];return _0x2ac5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ff58d,_0x1a1729){var _0xa847a7=function(_0xce1bbd){while(--_0xce1bbd){_0x2ff58d['push'](_0x2ff58d['shift']());}};_0xa847a7(++_0x1a1729);}(_0xe706,0xa3));var _0x6e70=function(_0x3b562e,_0x3c47de){_0x3b562e=_0x3b562e-0x0;var _0x43664d=_0xe706[_0x3b562e];return _0x43664d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 73b712c..97fa585 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 _0x3dd6=['addTeams','update','delete','destroy','removeAgents','removeTeams','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','/:id','show','getAgents','/:id/teams','post','create','addAgents'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x3dd6,0xcf));var _0x63dd=function(_0x450aaf,_0x1c1a8c){_0x450aaf=_0x450aaf-0x0;var _0x199a88=_0x3dd6[_0x450aaf];return _0x199a88;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x63dd('0x0'));var express=require(_0x63dd('0x1'));var router=express[_0x63dd('0x2')]();var fs_extra=require(_0x63dd('0x3'));var auth=require(_0x63dd('0x4'));var interaction=require(_0x63dd('0x5'));var config=require('../../config/environment');var controller=require(_0x63dd('0x6'));router['get']('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0x8')]);router[_0x63dd('0x9')](_0x63dd('0xa'),auth[_0x63dd('0x7')](),controller['describe']);router[_0x63dd('0x9')](_0x63dd('0xb'),auth[_0x63dd('0x7')](),controller[_0x63dd('0xc')]);router['get']('/:id/users',auth[_0x63dd('0x7')](),controller[_0x63dd('0xd')]);router[_0x63dd('0x9')](_0x63dd('0xe'),auth[_0x63dd('0x7')](),controller['getTeams']);router[_0x63dd('0xf')]('/',auth[_0x63dd('0x7')](),controller[_0x63dd('0x10')]);router[_0x63dd('0xf')]('/:id/users',auth[_0x63dd('0x7')](),controller[_0x63dd('0x11')]);router[_0x63dd('0xf')](_0x63dd('0xe'),auth[_0x63dd('0x7')](),controller[_0x63dd('0x12')]);router['put']('/:id',auth[_0x63dd('0x7')](),controller[_0x63dd('0x13')]);router[_0x63dd('0x14')]('/:id',auth[_0x63dd('0x7')](),controller[_0x63dd('0x15')]);router[_0x63dd('0x14')]('/:id/users',auth[_0x63dd('0x7')](),controller[_0x63dd('0x16')]);router[_0x63dd('0x14')](_0x63dd('0xe'),auth[_0x63dd('0x7')](),controller[_0x63dd('0x17')]);module[_0x63dd('0x18')]=router; \ No newline at end of file +var _0x9f75=['post','addTeams','update','destroy','delete','removeAgents','removeTeams','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','create','addAgents'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0x9f75,0x15a));var _0x59f7=function(_0x3883ba,_0xedf80f){_0x3883ba=_0x3883ba-0x0;var _0x430e29=_0x9f75[_0x3883ba];return _0x430e29;};'use strict';var multer=require(_0x59f7('0x0'));var util=require('util');var path=require(_0x59f7('0x1'));var timeout=require(_0x59f7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x59f7('0x3'));var auth=require(_0x59f7('0x4'));var interaction=require(_0x59f7('0x5'));var config=require(_0x59f7('0x6'));var controller=require('./voicePrefix.controller');router[_0x59f7('0x7')]('/',auth[_0x59f7('0x8')](),controller['index']);router['get'](_0x59f7('0x9'),auth[_0x59f7('0x8')](),controller[_0x59f7('0xa')]);router[_0x59f7('0x7')](_0x59f7('0xb'),auth[_0x59f7('0x8')](),controller['show']);router[_0x59f7('0x7')](_0x59f7('0xc'),auth[_0x59f7('0x8')](),controller[_0x59f7('0xd')]);router['get'](_0x59f7('0xe'),auth['isAuthenticated'](),controller[_0x59f7('0xf')]);router['post']('/',auth[_0x59f7('0x8')](),controller[_0x59f7('0x10')]);router['post']('/:id/users',auth[_0x59f7('0x8')](),controller[_0x59f7('0x11')]);router[_0x59f7('0x12')](_0x59f7('0xe'),auth[_0x59f7('0x8')](),controller[_0x59f7('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x59f7('0x14')]);router['delete'](_0x59f7('0xb'),auth[_0x59f7('0x8')](),controller[_0x59f7('0x15')]);router[_0x59f7('0x16')](_0x59f7('0xc'),auth[_0x59f7('0x8')](),controller[_0x59f7('0x17')]);router[_0x59f7('0x16')](_0x59f7('0xe'),auth[_0x59f7('0x8')](),controller[_0x59f7('0x18')]);module[_0x59f7('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 78f836d..1a3829d 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 _0xb613=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x4fcf31,_0x1ec900){var _0x2a9e9b=function(_0x31591a){while(--_0x31591a){_0x4fcf31['push'](_0x4fcf31['shift']());}};_0x2a9e9b(++_0x1ec900);}(_0xb613,0x1ce));var _0x3b61=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xb613[_0x1cbcf1];return _0x3a06f0;};'use strict';var Sequelize=require(_0x3b61('0x0'));module[_0x3b61('0x1')]={'name':{'type':Sequelize[_0x3b61('0x2')],'allowNull':![],'unique':_0x3b61('0x3')},'prefix':{'type':Sequelize[_0x3b61('0x4')],'get':function(_0x798de8){return _0x3b61('0x5')+this[_0x3b61('0x6')](_0x3b61('0x3'))+'-';}},'description':{'type':Sequelize[_0x3b61('0x2')]},'callerIdAll':{'type':Sequelize[_0x3b61('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x844f=['INTEGER','sequelize','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0xe09089,_0x23bcef){var _0x40cb69=function(_0x4684db){while(--_0x4684db){_0xe09089['push'](_0xe09089['shift']());}};_0x40cb69(++_0x23bcef);}(_0x844f,0x189));var _0xf844=function(_0x5114aa,_0x4596b9){_0x5114aa=_0x5114aa-0x0;var _0x1841bc=_0x844f[_0x5114aa];return _0x1841bc;};'use strict';var Sequelize=require(_0xf844('0x0'));module['exports']={'name':{'type':Sequelize[_0xf844('0x1')],'allowNull':![],'unique':_0xf844('0x2')},'prefix':{'type':Sequelize[_0xf844('0x3')],'get':function(_0x5c1beb){return _0xf844('0x4')+this[_0xf844('0x5')](_0xf844('0x2'))+'-';}},'description':{'type':Sequelize[_0xf844('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xf844('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9cf4e59..faaa834 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 _0xe1e3=['union','compact','value','isEmpty','forEach','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','localhost','./voicePrefix.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','update','then','UserProfileResource','destroy','end','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','VoicePrefix','includeAll','findAll','rows','show','filters','length','merge','find','catch','params','describe','create','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','prefix','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','system-','sequelize','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','each','UserVoicePrefix','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all'];(function(_0xb9fcb7,_0x2ddadd){var _0x52f6a5=function(_0xd8b711){while(--_0xd8b711){_0xb9fcb7['push'](_0xb9fcb7['shift']());}};_0x52f6a5(++_0x2ddadd);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x1d8944,_0x2689d8){_0x1d8944=_0x1d8944-0x0;var _0x414089=_0xe1e3[_0x1d8944];return _0x414089;};'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'];config['redis']=_['defaults'](config['redis'],{'host':_0x3e1e('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3e1e('0x15'))[_0x3e1e('0x16')](socket);function respondWithStatusCode(_0x78ee54,_0x50f221){_0x50f221=_0x50f221||0xcc;return function(_0x5b34ec){if(_0x5b34ec){return _0x78ee54[_0x3e1e('0x17')](_0x50f221);}return _0x78ee54[_0x3e1e('0x18')](_0x50f221)['end']();};}function respondWithResult(_0x26cb35,_0x1f0af9){_0x1f0af9=_0x1f0af9||0xc8;return function(_0x570212){if(_0x570212){return _0x26cb35[_0x3e1e('0x18')](_0x1f0af9)['json'](_0x570212);}};}function respondWithFilteredResult(_0x23228c,_0x247daa){return function(_0x1d786c){if(_0x1d786c){var _0x39eaa7=typeof _0x247daa[_0x3e1e('0x19')]===_0x3e1e('0x1a')&&typeof _0x247daa['limit']==='undefined';var _0x4a9497=_0x1d786c[_0x3e1e('0x1b')];var _0x30acbf=_0x39eaa7?0x0:_0x247daa[_0x3e1e('0x19')];var _0x57c660=_0x39eaa7?_0x1d786c[_0x3e1e('0x1b')]:_0x247daa['offset']+_0x247daa[_0x3e1e('0x1c')];var _0x33ec1d;if(_0x57c660>=_0x4a9497){_0x57c660=_0x4a9497;_0x33ec1d=0xc8;}else{_0x33ec1d=0xce;}_0x23228c[_0x3e1e('0x18')](_0x33ec1d);return _0x23228c['set'](_0x3e1e('0x1d'),_0x30acbf+'-'+_0x57c660+'/'+_0x4a9497)[_0x3e1e('0x1e')](_0x1d786c);}return null;};}function patchUpdates(_0xefa098){return function(_0x55dc62){try{jsonpatch['apply'](_0x55dc62,_0xefa098,!![]);}catch(_0x13d7ac){return BPromise[_0x3e1e('0x1f')](_0x13d7ac);}return _0x55dc62['save']();};}function saveUpdates(_0x60e6bc,_0x56ae51){return function(_0x164b15){if(_0x164b15){return _0x164b15[_0x3e1e('0x20')](_0x60e6bc)[_0x3e1e('0x21')](function(_0x159212){return _0x159212;});}return null;};}function removeEntity(_0x43d583,_0x21c898){return function(_0x4ee2b5){if(_0x4ee2b5){return _0x4ee2b5['destroy']()[_0x3e1e('0x21')](function(){var _0x541ef1=_0x4ee2b5['get']({'plain':!![]});var _0x4be84e='VoicePrefixes';return db[_0x3e1e('0x22')][_0x3e1e('0x23')]({'where':{'type':_0x4be84e,'resourceId':_0x541ef1['id']}})['then'](function(){return _0x4ee2b5;});})[_0x3e1e('0x21')](function(){_0x43d583['status'](0xcc)[_0x3e1e('0x24')]();});}};}function handleEntityNotFound(_0x176bb4,_0x53a6ff){return function(_0x43e029){if(!_0x43e029){_0x176bb4[_0x3e1e('0x17')](0x194);}return _0x43e029;};}function handleError(_0x45ed0e,_0x4d3695){_0x4d3695=_0x4d3695||0x1f4;return function(_0xdef39){logger['error'](_0xdef39['stack']);if(_0xdef39['name']){delete _0xdef39[_0x3e1e('0x25')];}_0x45ed0e['status'](_0x4d3695)['send'](_0xdef39);};}exports[_0x3e1e('0x26')]=function(_0x468336,_0x1c57c2){var _0x233b18={},_0xc9762c={},_0x54df5a={'count':0x0,'rows':[]};var _0x5522ba=_['map'](db['VoicePrefix'][_0x3e1e('0x27')],function(_0x417419){return{'name':_0x417419[_0x3e1e('0x28')],'type':_0x417419[_0x3e1e('0x29')][_0x3e1e('0x2a')]};});_0xc9762c[_0x3e1e('0x2b')]=_[_0x3e1e('0x2c')](_0x5522ba,_0x3e1e('0x25'));_0xc9762c['query']=_[_0x3e1e('0x2d')](_0x468336[_0x3e1e('0x2e')]);_0xc9762c['filters']=_[_0x3e1e('0x2f')](_0xc9762c[_0x3e1e('0x2b')],_0xc9762c[_0x3e1e('0x2e')]);_0x233b18[_0x3e1e('0x30')]=_['intersection'](_0xc9762c['model'],qs[_0x3e1e('0x31')](_0x468336[_0x3e1e('0x2e')]['fields']));_0x233b18[_0x3e1e('0x30')]=_0x233b18[_0x3e1e('0x30')]['length']?_0x233b18[_0x3e1e('0x30')]:_0xc9762c[_0x3e1e('0x2b')];if(!_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x32')](_0x3e1e('0x33'))){_0x233b18['limit']=qs[_0x3e1e('0x1c')](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x233b18[_0x3e1e('0x19')]=qs['offset'](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x19')]);}_0x233b18[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x35')]);_0x233b18[_0x3e1e('0x36')]=qs['filters'](_[_0x3e1e('0x37')](_0x468336['query'],_0xc9762c['filters']),_0x5522ba);if(_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x38')]){_0x233b18[_0x3e1e('0x36')]=_['merge'](_0x233b18[_0x3e1e('0x36')],{'$or':_[_0x3e1e('0x2c')](_0x5522ba,function(_0x4d372a){if(_0x4d372a[_0x3e1e('0x29')]!==_0x3e1e('0x39')){var _0x4b3d0f={};_0x4b3d0f[_0x4d372a['name']]={'$like':'%'+_0x468336[_0x3e1e('0x2e')]['filter']+'%'};return _0x4b3d0f;}})});}_0x233b18=_['merge']({},_0x233b18,_0x468336[_0x3e1e('0x3a')]);var _0x3d4a8d={'where':_0x233b18[_0x3e1e('0x36')]};return db[_0x3e1e('0x3b')][_0x3e1e('0x1b')](_0x3d4a8d)['then'](function(_0x5b32ad){_0x54df5a[_0x3e1e('0x1b')]=_0x5b32ad;if(_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x3c')]){_0x233b18['include']=[{'all':!![]}];}return db[_0x3e1e('0x3b')][_0x3e1e('0x3d')](_0x233b18);})[_0x3e1e('0x21')](function(_0x4ad5fd){_0x54df5a[_0x3e1e('0x3e')]=_0x4ad5fd;return _0x54df5a;})['then'](respondWithFilteredResult(_0x1c57c2,_0x233b18))['catch'](handleError(_0x1c57c2,null));};exports[_0x3e1e('0x3f')]=function(_0x9053cd,_0x2a1373){var _0x3d6627={'raw':![],'where':{'id':_0x9053cd['params']['id']}},_0x4a2cfb={};_0x4a2cfb['model']=_['keys'](db[_0x3e1e('0x3b')][_0x3e1e('0x27')]);_0x4a2cfb['query']=_['keys'](_0x9053cd[_0x3e1e('0x2e')]);_0x4a2cfb[_0x3e1e('0x40')]=_[_0x3e1e('0x2f')](_0x4a2cfb['model'],_0x4a2cfb[_0x3e1e('0x2e')]);_0x3d6627['attributes']=_[_0x3e1e('0x2f')](_0x4a2cfb[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x9053cd[_0x3e1e('0x2e')][_0x3e1e('0x31')]));_0x3d6627[_0x3e1e('0x30')]=_0x3d6627['attributes'][_0x3e1e('0x41')]?_0x3d6627[_0x3e1e('0x30')]:_0x4a2cfb['model'];if(_0x9053cd[_0x3e1e('0x2e')][_0x3e1e('0x3c')]){_0x3d6627['include']=[{'all':!![]}];}_0x3d6627=_[_0x3e1e('0x42')]({},_0x3d6627,_0x9053cd[_0x3e1e('0x3a')]);return db[_0x3e1e('0x3b')][_0x3e1e('0x43')](_0x3d6627)['then'](handleEntityNotFound(_0x2a1373,null))[_0x3e1e('0x21')](respondWithResult(_0x2a1373,null))[_0x3e1e('0x44')](handleError(_0x2a1373,null));};exports[_0x3e1e('0x23')]=function(_0xb086d4,_0x4bce83){return db[_0x3e1e('0x3b')][_0x3e1e('0x43')]({'where':{'id':_0xb086d4[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x4bce83,null))[_0x3e1e('0x21')](removeEntity(_0x4bce83,null))[_0x3e1e('0x44')](handleError(_0x4bce83,null));};exports[_0x3e1e('0x46')]=function(_0x238a7d,_0x5df608){return db[_0x3e1e('0x3b')]['describe']()['then'](respondWithResult(_0x5df608,null))['catch'](handleError(_0x5df608,null));};exports[_0x3e1e('0x47')]=function(_0x17641c,_0x5147a2){var _0x13b076;return db['sequelize']['transaction'](function(_0x3eaf76){return db['VoicePrefix']['create'](_0x17641c['body'],{'transaction':_0x3eaf76})[_0x3e1e('0x21')](function(_0xe577b2){_0x13b076=_0xe577b2[_0x3e1e('0x48')]({'plain':!![]});return db[_0x3e1e('0x49')][_0x3e1e('0x43')]({'where':{'id':_0x13b076[_0x3e1e('0x4a')]},'raw':!![]})[_0x3e1e('0x21')](function(_0x5b71a6){return createVoicePrefixExtensions(_0x13b076,_0x5b71a6,_0x3eaf76);});});})[_0x3e1e('0x21')](function(){var _0x5f5587=_0x17641c[_0x3e1e('0x4b')][_0x3e1e('0x48')]({'plain':!![]});if(!_0x5f5587)throw new Error(_0x3e1e('0x4c'));if(_0x5f5587['role']==='user'){var _0xba8d16=_0x13b076;return db[_0x3e1e('0x4d')]['find']({'where':{'name':_0x3e1e('0x4e'),'userProfileId':_0x5f5587['userProfileId']},'raw':!![]})['then'](function(_0x284cc7){if(_0x284cc7&&_0x284cc7[_0x3e1e('0x4f')]===0x0){return db['UserProfileResource'][_0x3e1e('0x47')]({'name':_0xba8d16['name'],'resourceId':_0xba8d16['id'],'type':_0x284cc7['name'],'sectionId':_0x284cc7['id']},{})[_0x3e1e('0x21')](function(){return _0x13b076;});}else{return _0x13b076;}})['catch'](function(_0x3ab043){logger['error'](_0x3e1e('0x50'),_0x3ab043);throw _0x3ab043;});}return _0x13b076;})['then'](respondWithResult(_0x5147a2,null))[_0x3e1e('0x44')](handleError(_0x5147a2,null));};function Extension(_0x8a4987,_0x48be40,_0x4dfc6d,_0x499abc){this[_0x3e1e('0x51')]=_0x3e1e('0x52');this[_0x3e1e('0x53')]=_0x8a4987;this['app']=_0x4dfc6d;this[_0x3e1e('0x29')]=_0x3e1e('0x54');this[_0x3e1e('0x55')]='Voice\x20Prefix\x20Extension';this['priority']=_0x48be40;this[_0x3e1e('0x56')]=_0x499abc;}function createVoicePrefixExtensions(_0x48f406,_0x3b97a2,_0x6c0364){return new BPromise(function(_0x13eefb,_0x5a76c2){var _0x2bdd35=new Extension(formatPrefixName(_0x48f406['prefix']),0x1,_0x3e1e('0x57'),_0x3e1e('0x58'));_0x2bdd35['VoicePrefixId']=_0x48f406['id'];return db[_0x3e1e('0x49')]['create'](_0x2bdd35,{'transaction':_0x6c0364})[_0x3e1e('0x21')](function(_0x574c30){var _0x4dafe9=_0x574c30['get']({'plain':!![]});var _0x31062e=_[_0x3e1e('0x2c')](addVoicePrefixExtensions(_0x48f406,_0x3b97a2),function(_0x3457a1){_0x3457a1['VoiceExtensionId']=_0x4dafe9['id'];_0x3457a1[_0x3e1e('0x59')]=_0x48f406['id'];return _0x3457a1;});return db[_0x3e1e('0x49')]['bulkCreate'](_0x31062e,{'transaction':_0x6c0364})[_0x3e1e('0x21')](function(_0x583535){if(!_0x583535){return _0x5a76c2('Extensions\x20creation\x20failed');}else{return _0x13eefb(_0x583535);}})['catch'](function(_0x182da4){return _0x5a76c2(_0x182da4);});});;});};function addVoicePrefixExtensions(_0x3e6e12,_0x384ee6){var _0x4b0944=[];var _0x35d915=formatPrefixName(_0x3e6e12[_0x3e1e('0x5a')]);_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x2,'Set',_0x3e1e('0x5c')+_0x3e6e12[_0x3e1e('0x25')]));if(_0x3e6e12[_0x3e1e('0x5d')]){_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x3,_0x3e1e('0x5e'),_0x3e1e('0x5f')+_0x3e6e12[_0x3e1e('0x5d')]));}else{_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x3,'NoOp','No\x20callerid\x20available'));}_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x4,_0x3e1e('0x60'),_0x384ee6[_0x3e1e('0x51')]+','+_0x3e1e('0x61')+(0x8+_0x3e6e12[_0x3e1e('0x25')][_0x3e1e('0x41')])+'}'+','+0x1));return _0x4b0944;}function formatPrefixName(_0x35c9c3){var _0x112a22='_';for(var _0x2b78d5=0x0;_0x2b78d5<_0x35c9c3[_0x3e1e('0x41')];_0x2b78d5++){if(_0x35c9c3[_0x3e1e('0x62')](_0x2b78d5)=='-'){_0x112a22+=_0x35c9c3[_0x3e1e('0x62')](_0x2b78d5);}else{_0x112a22+='['+_0x35c9c3['charAt'](_0x2b78d5)+']';}}_0x112a22+='.';return _0x112a22;}exports['update']=function(_0x20bc4d,_0x29ddc4,_0x477e64){var _0x1d6135=_0x20bc4d[_0x3e1e('0x63')];_0x1d6135['prefix']=_0x3e1e('0x64')+_0x1d6135[_0x3e1e('0x25')]+'-';return db[_0x3e1e('0x65')][_0x3e1e('0x66')](function(_0x522637){return db['VoicePrefix'][_0x3e1e('0x20')](_0x1d6135,{'where':{'id':_0x1d6135['id']},'transaction':_0x522637})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x49')][_0x3e1e('0x23')]({'where':{'VoicePrefixId':_0x1d6135['id']},'transaction':_0x522637})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x49')]['find']({'where':{'id':_0x1d6135[_0x3e1e('0x4a')]},'raw':!![]})[_0x3e1e('0x21')](function(_0x34f093){return createVoicePrefixExtensions(_0x1d6135,_0x34f093,_0x522637);});});});})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x3b')][_0x3e1e('0x67')](_0x1d6135['id']);})['then'](respondWithResult(_0x29ddc4,null))[_0x3e1e('0x44')](handleError(_0x29ddc4,null));};exports[_0x3e1e('0x68')]=function(_0x4b78de,_0x109407,_0x2aef1b){return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0x4b78de[_0x3e1e('0x45')]['id']}})['then'](handleEntityNotFound(_0x109407,null))[_0x3e1e('0x21')](function(_0x17c054){if(_0x17c054){return _0x17c054['addAgents'](_0x4b78de[_0x3e1e('0x63')][_0x3e1e('0x69')],_[_0x3e1e('0x6a')](_0x4b78de[_0x3e1e('0x63')],['ids','id'])||{})[_0x3e1e('0x6b')](function(_0x4a7dcc){for(var _0x2d6bb0=0x0;_0x2d6bb0<_0x4b78de[_0x3e1e('0x63')][_0x3e1e('0x69')][_0x3e1e('0x41')];_0x2d6bb0+=0x1){socket[_0x3e1e('0x6c')](_0x3e1e('0x6d'),{'UserId':Number(_0x4b78de['body'][_0x3e1e('0x69')][_0x2d6bb0]),'VoicePrefixId':Number(_0x4b78de[_0x3e1e('0x45')]['id'])});}return _0x4a7dcc;});}})[_0x3e1e('0x21')](respondWithResult(_0x109407,null))[_0x3e1e('0x44')](handleError(_0x109407,null));};exports['removeAgents']=function(_0x1ddf4a,_0x11eb0a,_0x437724){return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0x1ddf4a[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x11eb0a,null))[_0x3e1e('0x21')](function(_0x2161a4){if(_0x2161a4){return _0x2161a4[_0x3e1e('0x6e')](_0x1ddf4a[_0x3e1e('0x2e')]['ids'])['then'](function(){if(_['isArray'](_0x1ddf4a[_0x3e1e('0x2e')]['ids'])){for(var _0x321aa4=0x0;_0x321aa4<_0x1ddf4a['query'][_0x3e1e('0x69')][_0x3e1e('0x41')];_0x321aa4+=0x1){socket[_0x3e1e('0x6c')](_0x3e1e('0x6f'),{'UserId':Number(_0x1ddf4a['query'][_0x3e1e('0x69')][_0x321aa4]),'VoicePrefixId':Number(_0x1ddf4a['params']['id'])});}}else{socket[_0x3e1e('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ddf4a[_0x3e1e('0x2e')][_0x3e1e('0x69')]),'VoicePrefixId':Number(_0x1ddf4a['params']['id'])});}});}})[_0x3e1e('0x21')](respondWithStatusCode(_0x11eb0a,null))[_0x3e1e('0x44')](handleError(_0x11eb0a,null));};exports[_0x3e1e('0x70')]=function(_0x4ad5e2,_0x53ba1b,_0x185a4d){var _0x20bb6d={};var _0x120618={};var _0x4dac94;var _0x2fced0;return db['VoicePrefix']['findOne']({'where':{'id':_0x4ad5e2['params']['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x53ba1b,null))['then'](function(_0x44c0ee){if(_0x44c0ee){_0x4dac94=_0x44c0ee;_0x120618[_0x3e1e('0x2b')]=_[_0x3e1e('0x2d')](db[_0x3e1e('0x71')][_0x3e1e('0x27')]);_0x120618[_0x3e1e('0x2e')]=_[_0x3e1e('0x2d')](_0x4ad5e2[_0x3e1e('0x2e')]);_0x120618[_0x3e1e('0x40')]=_['intersection'](_0x120618['model'],_0x120618[_0x3e1e('0x2e')]);_0x20bb6d[_0x3e1e('0x30')]=_[_0x3e1e('0x2f')](_0x120618[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x31')]));_0x20bb6d[_0x3e1e('0x30')]=_0x20bb6d[_0x3e1e('0x30')]['length']?_0x20bb6d[_0x3e1e('0x30')]:_0x120618[_0x3e1e('0x2b')];_0x20bb6d[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x35')]);_0x20bb6d[_0x3e1e('0x36')]=qs[_0x3e1e('0x40')](_[_0x3e1e('0x37')](_0x4ad5e2[_0x3e1e('0x2e')],_0x120618[_0x3e1e('0x40')]));if(_0x4ad5e2[_0x3e1e('0x2e')]['filter']){_0x20bb6d[_0x3e1e('0x36')]=_[_0x3e1e('0x42')](_0x20bb6d['where'],{'$or':_[_0x3e1e('0x2c')](_0x20bb6d[_0x3e1e('0x30')],function(_0x1b7e29){var _0x292efb={};_0x292efb[_0x1b7e29]={'$like':'%'+_0x4ad5e2['query'][_0x3e1e('0x38')]+'%'};return _0x292efb;})});}_0x20bb6d=_[_0x3e1e('0x42')]({},_0x20bb6d,_0x4ad5e2[_0x3e1e('0x3a')]);return _0x4dac94[_0x3e1e('0x70')](_0x20bb6d);}})[_0x3e1e('0x21')](function(_0x285f83){if(_0x285f83){_0x2fced0=_0x285f83[_0x3e1e('0x41')];if(!_0x4ad5e2[_0x3e1e('0x2e')]['hasOwnProperty'](_0x3e1e('0x33'))){_0x20bb6d['limit']=qs[_0x3e1e('0x1c')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x20bb6d[_0x3e1e('0x19')]=qs['offset'](_0x4ad5e2[_0x3e1e('0x2e')]['offset']);}return _0x4dac94[_0x3e1e('0x70')](_0x20bb6d);}})['then'](function(_0x1be666){if(_0x1be666){return _0x1be666?{'count':_0x2fced0,'rows':_0x1be666}:null;}})[_0x3e1e('0x21')](respondWithResult(_0x53ba1b,null))['catch'](handleError(_0x53ba1b,null));};exports[_0x3e1e('0x72')]=function(_0x1ed174,_0x54723b,_0x3d2406){var _0x2f07d3={};var _0x3b6af5={};var _0x23c86b;var _0x38a5b0;return db[_0x3e1e('0x3b')][_0x3e1e('0x73')]({'where':{'id':_0x1ed174['params']['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x54723b,null))[_0x3e1e('0x21')](function(_0x5c5d32){if(_0x5c5d32){_0x23c86b=_0x5c5d32;_0x3b6af5[_0x3e1e('0x2b')]=_[_0x3e1e('0x2d')](db[_0x3e1e('0x74')]['rawAttributes']);_0x3b6af5[_0x3e1e('0x2e')]=_[_0x3e1e('0x2d')](_0x1ed174[_0x3e1e('0x2e')]);_0x3b6af5['filters']=_[_0x3e1e('0x2f')](_0x3b6af5['model'],_0x3b6af5[_0x3e1e('0x2e')]);_0x2f07d3[_0x3e1e('0x30')]=_[_0x3e1e('0x2f')](_0x3b6af5[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x1ed174['query'][_0x3e1e('0x31')]));_0x2f07d3[_0x3e1e('0x30')]=_0x2f07d3[_0x3e1e('0x30')][_0x3e1e('0x41')]?_0x2f07d3[_0x3e1e('0x30')]:_0x3b6af5[_0x3e1e('0x2b')];_0x2f07d3[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x1ed174[_0x3e1e('0x2e')]['sort']);_0x2f07d3[_0x3e1e('0x36')]=qs[_0x3e1e('0x40')](_[_0x3e1e('0x37')](_0x1ed174[_0x3e1e('0x2e')],_0x3b6af5[_0x3e1e('0x40')]));if(_0x1ed174['query'][_0x3e1e('0x38')]){_0x2f07d3[_0x3e1e('0x36')]=_[_0x3e1e('0x42')](_0x2f07d3[_0x3e1e('0x36')],{'$or':_[_0x3e1e('0x2c')](_0x2f07d3[_0x3e1e('0x30')],function(_0x1047de){var _0xe0eeab={};_0xe0eeab[_0x1047de]={'$like':'%'+_0x1ed174[_0x3e1e('0x2e')]['filter']+'%'};return _0xe0eeab;})});}_0x2f07d3=_[_0x3e1e('0x42')]({},_0x2f07d3,_0x1ed174[_0x3e1e('0x3a')]);return _0x23c86b['getTeams'](_0x2f07d3);}})[_0x3e1e('0x21')](function(_0x537072){if(_0x537072){_0x38a5b0=_0x537072[_0x3e1e('0x41')];if(!_0x1ed174[_0x3e1e('0x2e')][_0x3e1e('0x32')](_0x3e1e('0x33'))){_0x2f07d3[_0x3e1e('0x1c')]=qs[_0x3e1e('0x1c')](_0x1ed174[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x2f07d3[_0x3e1e('0x19')]=qs[_0x3e1e('0x19')](_0x1ed174['query']['offset']);}return _0x23c86b[_0x3e1e('0x72')](_0x2f07d3);}})[_0x3e1e('0x21')](function(_0x548cba){if(_0x548cba){return _0x548cba?{'count':_0x38a5b0,'rows':_0x548cba}:null;}})[_0x3e1e('0x21')](respondWithResult(_0x54723b,null))[_0x3e1e('0x44')](handleError(_0x54723b,null));};exports[_0x3e1e('0x75')]=function(_0x4a33f5,_0x5a6cb2,_0x2ec5e9){var _0xbfc033=_0x4a33f5[_0x3e1e('0x63')]['ids'];var _0x3049c4;return db['Team']['findAll']({'where':{'id':_0xbfc033},'attributes':['id'],'include':[{'model':db[_0x3e1e('0x71')],'as':_0x3e1e('0x76'),'attributes':['id','name',_0x3e1e('0x77'),_0x3e1e('0x78'),_0x3e1e('0x79')],'raw':!![]}]})[_0x3e1e('0x21')](function(_0x1ca30f){if(_0x1ca30f){_0x3049c4=_0x1ca30f;var _0x285ae4=_[_0x3e1e('0x7a')](_0x1ca30f,function(_0x32c3cf){var _0x201d18=_0x32c3cf[_0x3e1e('0x48')]({'plain':!![]});return _0x201d18[_0x3e1e('0x76')];});return db['VoicePrefix']['find']({'where':{'id':_0x4a33f5[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](function(_0x416b06){return db[_0x3e1e('0x65')]['transaction'](function(_0x2dea8b){return _0x416b06[_0x3e1e('0x75')](_0xbfc033,{'transaction':_0x2dea8b})['then'](function(){return BPromise['each'](_0x3049c4,function(_0x34c4c8){return db[_0x3e1e('0x7b')]['upsert']({'TeamId':_0x34c4c8['id'],'VoicePrefixId':_0x4a33f5[_0x3e1e('0x45')]['id']},{'transaction':_0x2dea8b});});})[_0x3e1e('0x21')](function(){return BPromise[_0x3e1e('0x7c')](_0x285ae4,function(_0x4332db){return db[_0x3e1e('0x7d')]['findOrCreate']({'where':{'UserId':_0x4332db['id'],'VoicePrefixId':_0x4a33f5[_0x3e1e('0x45')]['id']},'transaction':_0x2dea8b});});})[_0x3e1e('0x21')](function(){_0x285ae4['forEach'](function(_0x838800){socket['emit']('userVoicePrefix:save',{'UserId':_0x838800['id'],'VoicePrefixId':_0x416b06['id']});});});});});}})[_0x3e1e('0x21')](respondWithStatusCode(_0x5a6cb2,null))[_0x3e1e('0x44')](handleError(_0x5a6cb2,null));};exports[_0x3e1e('0x7e')]=function(_0xe57be2,_0x3ad5b0,_0x5788ea){return db[_0x3e1e('0x74')][_0x3e1e('0x3d')]({'where':{'id':_0xe57be2[_0x3e1e('0x2e')][_0x3e1e('0x69')]},'attributes':['id'],'include':[{'model':db[_0x3e1e('0x71')],'as':_0x3e1e('0x76'),'attributes':['id'],'raw':!![]}]})[_0x3e1e('0x21')](handleEntityNotFound(_0x3ad5b0,null))['then'](function(_0x2511d2){var _0x2d29d7=_[_0x3e1e('0x2c')](_0x2511d2,'id');var _0x161aa2=[];var _0x61318=[];var _0x20fa70=squel[_0x3e1e('0x7f')]();_0x20fa70['field'](_0x3e1e('0x80'))['from'](_0x3e1e('0x81'),'tq')[_0x3e1e('0x82')](_0x3e1e('0x83'),'ut',_0x3e1e('0x84'))[_0x3e1e('0x36')]('VoicePrefixId\x20=\x20?',_0xe57be2[_0x3e1e('0x45')]['id']);for(var _0x463428=0x0;_0x463428<_0x2511d2[_0x3e1e('0x41')];_0x463428+=0x1){let _0x5c6ba6=_0x2511d2[_0x463428];for(var _0x37eb53=0x0;_0x37eb53<_0x5c6ba6[_0x3e1e('0x76')]['length'];_0x37eb53+=0x1){let _0x3ae731=_0x5c6ba6['Agents'][_0x37eb53];var _0x2a2e80=_0x20fa70[_0x3e1e('0x85')]();_0x2a2e80[_0x3e1e('0x36')](_0x3e1e('0x86'),_0x3ae731['id']);_0x61318['push'](db[_0x3e1e('0x65')][_0x3e1e('0x2e')](_0x2a2e80[_0x3e1e('0x87')](),{'type':db[_0x3e1e('0x65')][_0x3e1e('0x88')][_0x3e1e('0x89')]})[_0x3e1e('0x21')](function(_0x415c88){if(_0x415c88[_0x3e1e('0x41')]===0x1){return _0x3ae731['id'];}else{var _0x187048=_[_0x3e1e('0x8a')](_[_0x3e1e('0x2c')](_0x415c88,'TeamId'),function(_0x244a5d){return _[_0x3e1e('0x8b')](_0x2d29d7,_0x244a5d);});if(_0x187048){return _0x3ae731['id'];}}}));}}return BPromise[_0x3e1e('0x8c')](_0x61318)[_0x3e1e('0x21')](function(_0x4afad1){_0x161aa2=_(_0x161aa2)[_0x3e1e('0x8d')](_0x4afad1)[_0x3e1e('0x8e')]()[_0x3e1e('0x8f')]();return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0xe57be2[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](function(_0x5ef204){return db[_0x3e1e('0x65')][_0x3e1e('0x66')](function(_0x487d3f){return _0x5ef204[_0x3e1e('0x7e')](_0xe57be2[_0x3e1e('0x2e')][_0x3e1e('0x69')],{'transaction':_0x487d3f})[_0x3e1e('0x21')](function(){if(!_[_0x3e1e('0x90')](_0x161aa2)){return _0x5ef204['removeAgents'](_0x161aa2,{'transaction':_0x487d3f});}})[_0x3e1e('0x21')](function(){_0x161aa2[_0x3e1e('0x91')](function(_0x22d774){socket['emit'](_0x3e1e('0x6f'),{'UserId':_0x22d774,'VoicePrefixId':_0x5ef204['id']});});});});});});})[_0x3e1e('0x21')](respondWithStatusCode(_0x3ad5b0,null))[_0x3e1e('0x44')](handleError(_0x3ad5b0,null));}; \ No newline at end of file +var _0xd4a2=['appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','nolimit','getTeams','Team','Agents','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','isEmpty','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','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','include','options','find','catch','params','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a2,0x173));var _0x2d4a=function(_0xda5fd7,_0x4c742a){_0xda5fd7=_0xda5fd7-0x0;var _0x3585cd=_0xd4a2[_0xda5fd7];return _0x3585cd;};'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'];config[_0x2d4a('0x17')]=_[_0x2d4a('0x18')](config[_0x2d4a('0x17')],{'host':_0x2d4a('0x19'),'port':0x18eb});var socket=require(_0x2d4a('0x1a'))(new Redis(config[_0x2d4a('0x17')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x2a1d0f,_0x5b6c4f){_0x5b6c4f=_0x5b6c4f||0xcc;return function(_0x11c64a){if(_0x11c64a){return _0x2a1d0f[_0x2d4a('0x1b')](_0x5b6c4f);}return _0x2a1d0f[_0x2d4a('0x1c')](_0x5b6c4f)[_0x2d4a('0x1d')]();};}function respondWithResult(_0x4c5287,_0x5f825d){_0x5f825d=_0x5f825d||0xc8;return function(_0x5a6378){if(_0x5a6378){return _0x4c5287[_0x2d4a('0x1c')](_0x5f825d)['json'](_0x5a6378);}};}function respondWithFilteredResult(_0x435687,_0xd1dd52){return function(_0x2188b2){if(_0x2188b2){var _0x388371=typeof _0xd1dd52['offset']==='undefined'&&typeof _0xd1dd52['limit']===_0x2d4a('0x1e');var _0x1966d1=_0x2188b2[_0x2d4a('0x1f')];var _0x419df5=_0x388371?0x0:_0xd1dd52[_0x2d4a('0x20')];var _0x2e4069=_0x388371?_0x2188b2['count']:_0xd1dd52['offset']+_0xd1dd52[_0x2d4a('0x21')];var _0x1f3e17;if(_0x2e4069>=_0x1966d1){_0x2e4069=_0x1966d1;_0x1f3e17=0xc8;}else{_0x1f3e17=0xce;}_0x435687[_0x2d4a('0x1c')](_0x1f3e17);return _0x435687[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x419df5+'-'+_0x2e4069+'/'+_0x1966d1)[_0x2d4a('0x24')](_0x2188b2);}return null;};}function patchUpdates(_0x22dd0b){return function(_0xa43fb1){try{jsonpatch['apply'](_0xa43fb1,_0x22dd0b,!![]);}catch(_0x26e7b8){return BPromise[_0x2d4a('0x25')](_0x26e7b8);}return _0xa43fb1[_0x2d4a('0x26')]();};}function saveUpdates(_0x42d813,_0x2c845c){return function(_0xed2822){if(_0xed2822){return _0xed2822[_0x2d4a('0x27')](_0x42d813)[_0x2d4a('0x28')](function(_0x54c910){return _0x54c910;});}return null;};}function removeEntity(_0x544b9b,_0x5cc7d8){return function(_0x2bb9f0){if(_0x2bb9f0){return _0x2bb9f0['destroy']()[_0x2d4a('0x28')](function(){var _0x3a2fd3=_0x2bb9f0[_0x2d4a('0x29')]({'plain':!![]});var _0x1d2fa6=_0x2d4a('0x2a');return db[_0x2d4a('0x2b')][_0x2d4a('0x2c')]({'where':{'type':_0x1d2fa6,'resourceId':_0x3a2fd3['id']}})[_0x2d4a('0x28')](function(){return _0x2bb9f0;});})['then'](function(){_0x544b9b[_0x2d4a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221602,_0x9bac28){return function(_0xc497ce){if(!_0xc497ce){_0x221602[_0x2d4a('0x1b')](0x194);}return _0xc497ce;};}function handleError(_0x101382,_0x1dfc5d){_0x1dfc5d=_0x1dfc5d||0x1f4;return function(_0x25ac5c){logger[_0x2d4a('0x2d')](_0x25ac5c['stack']);if(_0x25ac5c[_0x2d4a('0x2e')]){delete _0x25ac5c[_0x2d4a('0x2e')];}_0x101382[_0x2d4a('0x1c')](_0x1dfc5d)[_0x2d4a('0x2f')](_0x25ac5c);};}exports[_0x2d4a('0x30')]=function(_0x57bf71,_0x217653){var _0x31d8ae={},_0x27015d={},_0x24bcc2={'count':0x0,'rows':[]};var _0x2bb93d=_['map'](db[_0x2d4a('0x31')][_0x2d4a('0x32')],function(_0x46b623){return{'name':_0x46b623[_0x2d4a('0x33')],'type':_0x46b623[_0x2d4a('0x34')][_0x2d4a('0x35')]};});_0x27015d['model']=_[_0x2d4a('0x36')](_0x2bb93d,_0x2d4a('0x2e'));_0x27015d[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x57bf71[_0x2d4a('0x37')]);_0x27015d['filters']=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],_0x27015d['query']);_0x31d8ae[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0x31d8ae['attributes']=_0x31d8ae[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x31d8ae[_0x2d4a('0x3b')]:_0x27015d[_0x2d4a('0x3a')];if(!_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3e')]('nolimit')){_0x31d8ae['limit']=qs[_0x2d4a('0x21')](_0x57bf71['query'][_0x2d4a('0x21')]);_0x31d8ae[_0x2d4a('0x20')]=qs['offset'](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x20')]);}_0x31d8ae[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0x31d8ae[_0x2d4a('0x41')]=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x57bf71[_0x2d4a('0x37')],_0x27015d[_0x2d4a('0x42')]),_0x2bb93d);if(_0x57bf71['query'][_0x2d4a('0x44')]){_0x31d8ae[_0x2d4a('0x41')]=_[_0x2d4a('0x45')](_0x31d8ae[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0x2bb93d,function(_0x483a40){if(_0x483a40['type']!=='VIRTUAL'){var _0x5af510={};_0x5af510[_0x483a40[_0x2d4a('0x2e')]]={'$like':'%'+_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x44')]+'%'};return _0x5af510;}})});}_0x31d8ae=_[_0x2d4a('0x45')]({},_0x31d8ae,_0x57bf71['options']);var _0x155f2d={'where':_0x31d8ae[_0x2d4a('0x41')]};return db['VoicePrefix'][_0x2d4a('0x1f')](_0x155f2d)[_0x2d4a('0x28')](function(_0x8a9375){_0x24bcc2[_0x2d4a('0x1f')]=_0x8a9375;if(_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x31d8ae['include']=[{'all':!![]}];}return db[_0x2d4a('0x31')][_0x2d4a('0x47')](_0x31d8ae);})[_0x2d4a('0x28')](function(_0x365399){_0x24bcc2[_0x2d4a('0x48')]=_0x365399;return _0x24bcc2;})[_0x2d4a('0x28')](respondWithFilteredResult(_0x217653,_0x31d8ae))['catch'](handleError(_0x217653,null));};exports[_0x2d4a('0x49')]=function(_0x1f08a3,_0x10b723){var _0x4e1901={'raw':![],'where':{'id':_0x1f08a3['params']['id']}},_0x2585db={};_0x2585db[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x31')][_0x2d4a('0x32')]);_0x2585db[_0x2d4a('0x37')]=_['keys'](_0x1f08a3['query']);_0x2585db[_0x2d4a('0x42')]=_[_0x2d4a('0x39')](_0x2585db['model'],_0x2585db[_0x2d4a('0x37')]);_0x4e1901['attributes']=_[_0x2d4a('0x39')](_0x2585db[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x1f08a3['query'][_0x2d4a('0x3c')]));_0x4e1901['attributes']=_0x4e1901[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4e1901[_0x2d4a('0x3b')]:_0x2585db[_0x2d4a('0x3a')];if(_0x1f08a3[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x4e1901[_0x2d4a('0x4a')]=[{'all':!![]}];}_0x4e1901=_[_0x2d4a('0x45')]({},_0x4e1901,_0x1f08a3[_0x2d4a('0x4b')]);return db[_0x2d4a('0x31')][_0x2d4a('0x4c')](_0x4e1901)['then'](handleEntityNotFound(_0x10b723,null))[_0x2d4a('0x28')](respondWithResult(_0x10b723,null))[_0x2d4a('0x4d')](handleError(_0x10b723,null));};exports[_0x2d4a('0x2c')]=function(_0x1467ab,_0x2d2e24){return db['VoicePrefix'][_0x2d4a('0x4c')]({'where':{'id':_0x1467ab[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2d2e24,null))[_0x2d4a('0x28')](removeEntity(_0x2d2e24,null))[_0x2d4a('0x4d')](handleError(_0x2d2e24,null));};exports['describe']=function(_0x4b9a52,_0x43e74a){return db[_0x2d4a('0x31')]['describe']()[_0x2d4a('0x28')](respondWithResult(_0x43e74a,null))[_0x2d4a('0x4d')](handleError(_0x43e74a,null));};exports[_0x2d4a('0x4f')]=function(_0x19109b,_0x52a468){var _0x31576d;return db['sequelize'][_0x2d4a('0x50')](function(_0x3fe91b){return db[_0x2d4a('0x31')][_0x2d4a('0x4f')](_0x19109b[_0x2d4a('0x51')],{'transaction':_0x3fe91b})[_0x2d4a('0x28')](function(_0x25fb59){_0x31576d=_0x25fb59[_0x2d4a('0x29')]({'plain':!![]});return db['VoiceExtension'][_0x2d4a('0x4c')]({'where':{'id':_0x31576d[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x67ddff){return createVoicePrefixExtensions(_0x31576d,_0x67ddff,_0x3fe91b);});});})[_0x2d4a('0x28')](function(){var _0x334d6a=_0x19109b[_0x2d4a('0x53')][_0x2d4a('0x29')]({'plain':!![]});if(!_0x334d6a)throw new Error(_0x2d4a('0x54'));if(_0x334d6a[_0x2d4a('0x55')]===_0x2d4a('0x53')){var _0x113bc4=_0x31576d;return db[_0x2d4a('0x56')][_0x2d4a('0x4c')]({'where':{'name':_0x2d4a('0x2a'),'userProfileId':_0x334d6a[_0x2d4a('0x57')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x4cce5e){if(_0x4cce5e&&_0x4cce5e[_0x2d4a('0x58')]===0x0){return db[_0x2d4a('0x2b')]['create']({'name':_0x113bc4[_0x2d4a('0x2e')],'resourceId':_0x113bc4['id'],'type':_0x4cce5e[_0x2d4a('0x2e')],'sectionId':_0x4cce5e['id']},{})[_0x2d4a('0x28')](function(){return _0x31576d;});}else{return _0x31576d;}})[_0x2d4a('0x4d')](function(_0x165c00){logger[_0x2d4a('0x2d')](_0x2d4a('0x59'),_0x165c00);throw _0x165c00;});}return _0x31576d;})[_0x2d4a('0x28')](respondWithResult(_0x52a468,null))[_0x2d4a('0x4d')](handleError(_0x52a468,null));};function Extension(_0x352b50,_0x346f2b,_0x302323,_0x5c7cf9){this[_0x2d4a('0x5a')]=_0x2d4a('0x5b');this['exten']=_0x352b50;this[_0x2d4a('0x5c')]=_0x302323;this[_0x2d4a('0x34')]=_0x2d4a('0x5d');this[_0x2d4a('0x5e')]=_0x2d4a('0x5f');this[_0x2d4a('0x60')]=_0x346f2b;this[_0x2d4a('0x61')]=_0x5c7cf9;}function createVoicePrefixExtensions(_0x43e6a6,_0x1034d2,_0x282df8){return new BPromise(function(_0x5bbc96,_0x2bd137){var _0x8ae6bd=new Extension(formatPrefixName(_0x43e6a6[_0x2d4a('0x62')]),0x1,'NoOp',_0x2d4a('0x63'));_0x8ae6bd[_0x2d4a('0x64')]=_0x43e6a6['id'];return db[_0x2d4a('0x65')][_0x2d4a('0x4f')](_0x8ae6bd,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x278bbc){var _0x7e2699=_0x278bbc[_0x2d4a('0x29')]({'plain':!![]});var _0x1ed616=_['map'](addVoicePrefixExtensions(_0x43e6a6,_0x1034d2),function(_0x21b8e9){_0x21b8e9[_0x2d4a('0x52')]=_0x7e2699['id'];_0x21b8e9[_0x2d4a('0x64')]=_0x43e6a6['id'];return _0x21b8e9;});return db[_0x2d4a('0x65')][_0x2d4a('0x66')](_0x1ed616,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x53f52b){if(!_0x53f52b){return _0x2bd137(_0x2d4a('0x67'));}else{return _0x5bbc96(_0x53f52b);}})[_0x2d4a('0x4d')](function(_0x22707f){return _0x2bd137(_0x22707f);});});;});};function addVoicePrefixExtensions(_0x4809af,_0x465c89){var _0x442691=[];var _0x4f4a09=formatPrefixName(_0x4809af[_0x2d4a('0x62')]);_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x2,'Set',_0x2d4a('0x69')+_0x4809af['name']));if(_0x4809af['callerIdAll']){_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6a'),_0x2d4a('0x6b')+_0x4809af[_0x2d4a('0x6c')]));}else{_0x442691['push'](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6d'),_0x2d4a('0x6e')));}_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x4,_0x2d4a('0x6f'),_0x465c89['context']+','+'${EXTEN:'+(0x8+_0x4809af[_0x2d4a('0x2e')][_0x2d4a('0x3d')])+'}'+','+0x1));return _0x442691;}function formatPrefixName(_0x2a2441){var _0x2aa9e8='_';for(var _0x9e6321=0x0;_0x9e6321<_0x2a2441[_0x2d4a('0x3d')];_0x9e6321++){if(_0x2a2441[_0x2d4a('0x70')](_0x9e6321)=='-'){_0x2aa9e8+=_0x2a2441['charAt'](_0x9e6321);}else{_0x2aa9e8+='['+_0x2a2441[_0x2d4a('0x70')](_0x9e6321)+']';}}_0x2aa9e8+='.';return _0x2aa9e8;}exports[_0x2d4a('0x27')]=function(_0xf3d514,_0x398439,_0x59810d){var _0x299bdf=_0xf3d514[_0x2d4a('0x51')];_0x299bdf[_0x2d4a('0x62')]=_0x2d4a('0x71')+_0x299bdf['name']+'-';return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x55d565){return db[_0x2d4a('0x31')][_0x2d4a('0x27')](_0x299bdf,{'where':{'id':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db['VoiceExtension'][_0x2d4a('0x2c')]({'where':{'VoicePrefixId':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db[_0x2d4a('0x65')][_0x2d4a('0x4c')]({'where':{'id':_0x299bdf[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x3bc965){return createVoicePrefixExtensions(_0x299bdf,_0x3bc965,_0x55d565);});});});})['then'](function(){return db[_0x2d4a('0x31')][_0x2d4a('0x73')](_0x299bdf['id']);})[_0x2d4a('0x28')](respondWithResult(_0x398439,null))[_0x2d4a('0x4d')](handleError(_0x398439,null));};exports[_0x2d4a('0x74')]=function(_0x55ebbb,_0x38e623,_0x5aead3){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x55ebbb[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x38e623,null))[_0x2d4a('0x28')](function(_0x2ba9c2){if(_0x2ba9c2){return _0x2ba9c2[_0x2d4a('0x74')](_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')],_[_0x2d4a('0x76')](_0x55ebbb['body'],[_0x2d4a('0x75'),'id'])||{})['spread'](function(_0x3d7d7d){for(var _0x3c284d=0x0;_0x3c284d<_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x3c284d+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':Number(_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x3c284d]),'VoicePrefixId':Number(_0x55ebbb['params']['id'])});}return _0x3d7d7d;});}})[_0x2d4a('0x28')](respondWithResult(_0x38e623,null))[_0x2d4a('0x4d')](handleError(_0x38e623,null));};exports[_0x2d4a('0x79')]=function(_0xcdf787,_0x574285,_0x36d253){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0xcdf787[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x574285,null))[_0x2d4a('0x28')](function(_0x5769be){if(_0x5769be){return _0x5769be[_0x2d4a('0x79')](_0xcdf787[_0x2d4a('0x37')]['ids'])[_0x2d4a('0x28')](function(){if(_[_0x2d4a('0x7a')](_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')])){for(var _0x429579=0x0;_0x429579<_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x429579+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787['query'][_0x2d4a('0x75')][_0x429579]),'VoicePrefixId':Number(_0xcdf787['params']['id'])});}}else{socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')]),'VoicePrefixId':Number(_0xcdf787[_0x2d4a('0x4e')]['id'])});}});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x574285,null))[_0x2d4a('0x4d')](handleError(_0x574285,null));};exports['getAgents']=function(_0x119c59,_0x2ebb9e,_0xc11b2e){var _0xfc7b53={};var _0x47377e={};var _0x5e7f23;var _0x4ebda1;return db['VoicePrefix'][_0x2d4a('0x7c')]({'where':{'id':_0x119c59[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2ebb9e,null))['then'](function(_0x135f58){if(_0x135f58){_0x5e7f23=_0x135f58;_0x47377e[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x7d')][_0x2d4a('0x32')]);_0x47377e[_0x2d4a('0x37')]=_['keys'](_0x119c59[_0x2d4a('0x37')]);_0x47377e['filters']=_[_0x2d4a('0x39')](_0x47377e[_0x2d4a('0x3a')],_0x47377e['query']);_0xfc7b53[_0x2d4a('0x3b')]=_['intersection'](_0x47377e['model'],qs['fields'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0xfc7b53[_0x2d4a('0x3b')]=_0xfc7b53['attributes'][_0x2d4a('0x3d')]?_0xfc7b53[_0x2d4a('0x3b')]:_0x47377e[_0x2d4a('0x3a')];_0xfc7b53[_0x2d4a('0x3f')]=qs['sort'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0xfc7b53['where']=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x119c59['query'],_0x47377e[_0x2d4a('0x42')]));if(_0x119c59['query']['filter']){_0xfc7b53[_0x2d4a('0x41')]=_['merge'](_0xfc7b53[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0xfc7b53[_0x2d4a('0x3b')],function(_0x44d3b3){var _0x5e939f={};_0x5e939f[_0x44d3b3]={'$like':'%'+_0x119c59[_0x2d4a('0x37')]['filter']+'%'};return _0x5e939f;})});}_0xfc7b53=_[_0x2d4a('0x45')]({},_0xfc7b53,_0x119c59[_0x2d4a('0x4b')]);return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x45f6b7){if(_0x45f6b7){_0x4ebda1=_0x45f6b7['length'];if(!_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0xfc7b53['limit']=qs[_0x2d4a('0x21')](_0x119c59['query']['limit']);_0xfc7b53[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x20')]);}return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x2bffb4){if(_0x2bffb4){return _0x2bffb4?{'count':_0x4ebda1,'rows':_0x2bffb4}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x2ebb9e,null))[_0x2d4a('0x4d')](handleError(_0x2ebb9e,null));};exports[_0x2d4a('0x80')]=function(_0x5ecf3e,_0x16c4fd,_0x2b29b1){var _0x4647cb={};var _0x10d86c={};var _0x36b067;var _0x1cb5b3;return db[_0x2d4a('0x31')][_0x2d4a('0x7c')]({'where':{'id':_0x5ecf3e['params']['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x16c4fd,null))[_0x2d4a('0x28')](function(_0xa4c947){if(_0xa4c947){_0x36b067=_0xa4c947;_0x10d86c['model']=_[_0x2d4a('0x38')](db['Team'][_0x2d4a('0x32')]);_0x10d86c[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x5ecf3e[_0x2d4a('0x37')]);_0x10d86c['filters']=_[_0x2d4a('0x39')](_0x10d86c['model'],_0x10d86c[_0x2d4a('0x37')]);_0x4647cb[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x10d86c['model'],qs[_0x2d4a('0x3c')](_0x5ecf3e['query'][_0x2d4a('0x3c')]));_0x4647cb[_0x2d4a('0x3b')]=_0x4647cb[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4647cb[_0x2d4a('0x3b')]:_0x10d86c[_0x2d4a('0x3a')];_0x4647cb[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x5ecf3e[_0x2d4a('0x37')]['sort']);_0x4647cb['where']=qs['filters'](_[_0x2d4a('0x43')](_0x5ecf3e['query'],_0x10d86c[_0x2d4a('0x42')]));if(_0x5ecf3e['query'][_0x2d4a('0x44')]){_0x4647cb[_0x2d4a('0x41')]=_['merge'](_0x4647cb['where'],{'$or':_[_0x2d4a('0x36')](_0x4647cb['attributes'],function(_0x279c26){var _0x643012={};_0x643012[_0x279c26]={'$like':'%'+_0x5ecf3e[_0x2d4a('0x37')]['filter']+'%'};return _0x643012;})});}_0x4647cb=_[_0x2d4a('0x45')]({},_0x4647cb,_0x5ecf3e[_0x2d4a('0x4b')]);return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x1c3c0f){if(_0x1c3c0f){_0x1cb5b3=_0x1c3c0f[_0x2d4a('0x3d')];if(!_0x5ecf3e[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0x4647cb[_0x2d4a('0x21')]=qs[_0x2d4a('0x21')](_0x5ecf3e[_0x2d4a('0x37')]['limit']);_0x4647cb[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x5ecf3e[_0x2d4a('0x37')]['offset']);}return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x250a9c){if(_0x250a9c){return _0x250a9c?{'count':_0x1cb5b3,'rows':_0x250a9c}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x16c4fd,null))[_0x2d4a('0x4d')](handleError(_0x16c4fd,null));};exports['addTeams']=function(_0x438769,_0x1483af,_0x5413c1){var _0x2d5122=_0x438769['body'][_0x2d4a('0x75')];var _0x1cd7fd;return db[_0x2d4a('0x81')][_0x2d4a('0x47')]({'where':{'id':_0x2d5122},'attributes':['id'],'include':[{'model':db[_0x2d4a('0x7d')],'as':_0x2d4a('0x82'),'attributes':['id',_0x2d4a('0x2e'),'online',_0x2d4a('0x83'),_0x2d4a('0x84')],'raw':!![]}]})[_0x2d4a('0x28')](function(_0x1e5be2){if(_0x1e5be2){_0x1cd7fd=_0x1e5be2;var _0x139e4e=_[_0x2d4a('0x85')](_0x1e5be2,function(_0x58b196){var _0x23577f=_0x58b196[_0x2d4a('0x29')]({'plain':!![]});return _0x23577f[_0x2d4a('0x82')];});return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x438769['params']['id']}})['then'](function(_0x3e276d){return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x2fee11){return _0x3e276d[_0x2d4a('0x86')](_0x2d5122,{'transaction':_0x2fee11})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x1cd7fd,function(_0x1adcbc){return db[_0x2d4a('0x88')]['upsert']({'TeamId':_0x1adcbc['id'],'VoicePrefixId':_0x438769['params']['id']},{'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x139e4e,function(_0x3b4585){return db[_0x2d4a('0x89')][_0x2d4a('0x8a')]({'where':{'UserId':_0x3b4585['id'],'VoicePrefixId':_0x438769[_0x2d4a('0x4e')]['id']},'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){_0x139e4e[_0x2d4a('0x8b')](function(_0x12914d){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':_0x12914d['id'],'VoicePrefixId':_0x3e276d['id']});});});});});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x1483af,null))['catch'](handleError(_0x1483af,null));};exports['removeTeams']=function(_0x51cba2,_0x448b4d,_0x4cefec){return db['Team'][_0x2d4a('0x47')]({'where':{'id':_0x51cba2[_0x2d4a('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2d4a('0x28')](handleEntityNotFound(_0x448b4d,null))[_0x2d4a('0x28')](function(_0x1e05c5){var _0x3e199a=_[_0x2d4a('0x36')](_0x1e05c5,'id');var _0x357dfc=[];var _0xd80165=[];var _0x448664=squel[_0x2d4a('0x8c')]();_0x448664[_0x2d4a('0x8d')]('tq.TeamId')[_0x2d4a('0x8e')](_0x2d4a('0x8f'),'tq')[_0x2d4a('0x90')](_0x2d4a('0x91'),'ut',_0x2d4a('0x92'))[_0x2d4a('0x41')]('VoicePrefixId\x20=\x20?',_0x51cba2[_0x2d4a('0x4e')]['id']);for(var _0x3030e1=0x0;_0x3030e1<_0x1e05c5['length'];_0x3030e1+=0x1){let _0xc5500=_0x1e05c5[_0x3030e1];for(var _0xe198b=0x0;_0xe198b<_0xc5500['Agents']['length'];_0xe198b+=0x1){let _0x497b03=_0xc5500['Agents'][_0xe198b];var _0xb81202=_0x448664['clone']();_0xb81202[_0x2d4a('0x41')](_0x2d4a('0x93'),_0x497b03['id']);_0xd80165[_0x2d4a('0x68')](db[_0x2d4a('0x72')][_0x2d4a('0x37')](_0xb81202[_0x2d4a('0x94')](),{'type':db[_0x2d4a('0x72')]['QueryTypes'][_0x2d4a('0x95')]})['then'](function(_0x2b6040){if(_0x2b6040[_0x2d4a('0x3d')]===0x1){return _0x497b03['id'];}else{var _0x137c57=_[_0x2d4a('0x96')](_[_0x2d4a('0x36')](_0x2b6040,_0x2d4a('0x97')),function(_0x29108f){return _['includes'](_0x3e199a,_0x29108f);});if(_0x137c57){return _0x497b03['id'];}}}));}}return BPromise[_0x2d4a('0x98')](_0xd80165)['then'](function(_0x1d4cc3){_0x357dfc=_(_0x357dfc)[_0x2d4a('0x99')](_0x1d4cc3)[_0x2d4a('0x9a')]()['value']();return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x51cba2[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](function(_0x108cd1){return db[_0x2d4a('0x72')]['transaction'](function(_0x29a294){return _0x108cd1['removeTeams'](_0x51cba2[_0x2d4a('0x37')]['ids'],{'transaction':_0x29a294})['then'](function(){if(!_[_0x2d4a('0x9b')](_0x357dfc)){return _0x108cd1['removeAgents'](_0x357dfc,{'transaction':_0x29a294});}})['then'](function(){_0x357dfc[_0x2d4a('0x8b')](function(_0x206717){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':_0x206717,'VoicePrefixId':_0x108cd1['id']});});});});});});})[_0x2d4a('0x28')](respondWithStatusCode(_0x448b4d,null))[_0x2d4a('0x4d')](handleError(_0x448b4d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index ada8bae..f3561cc 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 _0xd30a=['save','update','remove','emit','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x26b4e7,_0x20cffe){var _0x2e3484=function(_0x25f3e6){while(--_0x25f3e6){_0x26b4e7['push'](_0x26b4e7['shift']());}};_0x2e3484(++_0x20cffe);}(_0xd30a,0x1d1));var _0xad30=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xd30a[_0x139a3c];return _0x2b375b;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xad30('0x0'))['db'][_0xad30('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xad30('0x2')](0x0);var events={'afterCreate':_0xad30('0x3'),'afterUpdate':_0xad30('0x4'),'afterDestroy':_0xad30('0x5')};function emitEvent(_0x5d75c5){return function(_0x35dda5,_0x57e169,_0xeeec10){VoicePrefixEvents[_0xad30('0x6')](_0x5d75c5+':'+_0x35dda5['id'],_0x35dda5);VoicePrefixEvents[_0xad30('0x6')](_0x5d75c5,_0x35dda5);_0xeeec10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xad30('0x7')](e,emitEvent(event));}}module[_0xad30('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x2fca=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoicePrefix'];(function(_0x3bbc8e,_0x177f47){var _0x15e0c2=function(_0xf38d3e){while(--_0xf38d3e){_0x3bbc8e['push'](_0x3bbc8e['shift']());}};_0x15e0c2(++_0x177f47);}(_0x2fca,0x1d4));var _0xa2fc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fca[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xa2fc('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xa2fc('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa2fc('0x2')](0x0);var events={'afterCreate':_0xa2fc('0x3'),'afterUpdate':_0xa2fc('0x4'),'afterDestroy':_0xa2fc('0x5')};function emitEvent(_0x2b3aba){return function(_0x223107,_0x101134,_0x1d2a88){VoicePrefixEvents[_0xa2fc('0x6')](_0x2b3aba+':'+_0x223107['id'],_0x223107);VoicePrefixEvents['emit'](_0x2b3aba,_0x223107);_0x1d2a88(null);};}for(var e in events){if(events[_0xa2fc('0x7')](e)){var event=events[e];VoicePrefix[_0xa2fc('0x8')](e,emitEvent(event));}}module[_0xa2fc('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8904789..887c363 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 _0x693c=['rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x28f386,_0x5db8bf){var _0x143b12=function(_0x2284c5){while(--_0x2284c5){_0x28f386['push'](_0x28f386['shift']());}};_0x143b12(++_0x5db8bf);}(_0x693c,0x16e));var _0xc693=function(_0x486e8c,_0x2c5d01){_0x486e8c=_0x486e8c-0x0;var _0x2af45e=_0x693c[_0x486e8c];return _0x2af45e;};'use strict';var _=require(_0xc693('0x0'));var util=require(_0xc693('0x1'));var logger=require(_0xc693('0x2'))('api');var moment=require(_0xc693('0x3'));var BPromise=require('bluebird');var rp=require(_0xc693('0x4'));var fs=require('fs');var path=require(_0xc693('0x5'));var rimraf=require(_0xc693('0x6'));var config=require(_0xc693('0x7'));var attributes=require(_0xc693('0x8'));module['exports']=function(_0x15cc68,_0xecf85){return _0x15cc68[_0xc693('0x9')](_0xc693('0xa'),attributes,{'tableName':_0xc693('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47ad=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x47ad,0x15b));var _0xd47a=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0x47ad[_0x4b7e4d];return _0x38d6af;};'use strict';var _=require(_0xd47a('0x0'));var util=require(_0xd47a('0x1'));var logger=require(_0xd47a('0x2'))(_0xd47a('0x3'));var moment=require(_0xd47a('0x4'));var BPromise=require(_0xd47a('0x5'));var rp=require(_0xd47a('0x6'));var fs=require('fs');var path=require(_0xd47a('0x7'));var rimraf=require(_0xd47a('0x8'));var config=require(_0xd47a('0x9'));var attributes=require(_0xd47a('0xa'));module['exports']=function(_0x5256d4,_0x1f4d56){return _0x5256d4[_0xd47a('0xb')]('VoicePrefix',attributes,{'tableName':_0xd47a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index ad5fd9f..0188c92 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 _0xcac3=['register','request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket'];(function(_0x7835a,_0x7ef740){var _0xd46e11=function(_0xe43fad){while(--_0xe43fad){_0x7835a['push'](_0x7835a['shift']());}};_0xd46e11(++_0x7ef740);}(_0xcac3,0x193));var _0x3cac=function(_0x45c536,_0x52a556){_0x45c536=_0x45c536-0x0;var _0x10e06d=_0xcac3[_0x45c536];return _0x10e06d;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});config[_0x3cac('0xd')]=_[_0x3cac('0xe')](config[_0x3cac('0xd')],{'host':_0x3cac('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cac('0xd')]));require(_0x3cac('0x10'))[_0x3cac('0x11')](socket);function respondWithRpcPromise(_0x306664,_0x131e0d,_0x5a3ece){return new BPromise(function(_0x1e8fef,_0x169e39){return client[_0x3cac('0x12')](_0x306664,_0x5a3ece)[_0x3cac('0x13')](function(_0x1c5c70){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x131e0d,_0x3cac('0x14'));logger[_0x3cac('0x15')](_0x3cac('0x16'),_0x131e0d,_0x3cac('0x14'),JSON[_0x3cac('0x17')](_0x1c5c70));if(_0x1c5c70[_0x3cac('0x18')]){if(_0x1c5c70[_0x3cac('0x18')]['code']===0x1f4){logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);return _0x169e39(_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);}logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);return _0x1e8fef(_0x1c5c70[_0x3cac('0x18')][_0x3cac('0x1a')]);}else{logger[_0x3cac('0x1b')](_0x3cac('0x19'),_0x131e0d,_0x3cac('0x14'));_0x1e8fef(_0x1c5c70[_0x3cac('0x1c')][_0x3cac('0x1a')]);}})[_0x3cac('0x1d')](function(_0x3cb08f){logger[_0x3cac('0x18')](_0x3cac('0x19'),_0x131e0d,_0x3cb08f);_0x169e39(_0x3cb08f);});});} \ No newline at end of file +var _0xee87=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xee87,0x10d));var _0x7ee8=function(_0x40be25,_0x1df1c1){_0x40be25=_0x40be25-0x0;var _0x3adb82=_0xee87[_0x40be25];return _0x3adb82;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require(_0x7ee8('0x1'));var BPromise=require(_0x7ee8('0x2'));var rs=require(_0x7ee8('0x3'));var fs=require('fs');var Redis=require(_0x7ee8('0x4'));var db=require(_0x7ee8('0x5'))['db'];var utils=require(_0x7ee8('0x6'));var logger=require(_0x7ee8('0x7'))(_0x7ee8('0x8'));var config=require(_0x7ee8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0xa')]['http']({'port':0x232a});config[_0x7ee8('0xb')]=_[_0x7ee8('0xc')](config[_0x7ee8('0xb')],{'host':_0x7ee8('0xd'),'port':0x18eb});var socket=require(_0x7ee8('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x7ee8('0xf')](socket);function respondWithRpcPromise(_0x5f37d6,_0x511d54,_0x210095){return new BPromise(function(_0x21309c,_0x2edb4a){return client[_0x7ee8('0x10')](_0x5f37d6,_0x210095)[_0x7ee8('0x11')](function(_0x4dd890){logger['info'](_0x7ee8('0x12'),_0x511d54,_0x7ee8('0x13'));logger[_0x7ee8('0x14')](_0x7ee8('0x15'),_0x511d54,_0x7ee8('0x13'),JSON[_0x7ee8('0x16')](_0x4dd890));if(_0x4dd890[_0x7ee8('0x17')]){if(_0x4dd890[_0x7ee8('0x17')][_0x7ee8('0x18')]===0x1f4){logger[_0x7ee8('0x17')](_0x7ee8('0x12'),_0x511d54,_0x4dd890[_0x7ee8('0x17')][_0x7ee8('0x19')]);return _0x2edb4a(_0x4dd890[_0x7ee8('0x17')][_0x7ee8('0x19')]);}logger[_0x7ee8('0x17')](_0x7ee8('0x12'),_0x511d54,_0x4dd890[_0x7ee8('0x17')][_0x7ee8('0x19')]);return _0x21309c(_0x4dd890[_0x7ee8('0x17')][_0x7ee8('0x19')]);}else{logger[_0x7ee8('0x1a')](_0x7ee8('0x12'),_0x511d54,_0x7ee8('0x13'));_0x21309c(_0x4dd890[_0x7ee8('0x1b')]['message']);}})[_0x7ee8('0x1c')](function(_0x5e4ef1){logger[_0x7ee8('0x17')](_0x7ee8('0x12'),_0x511d54,_0x5e4ef1);_0x2edb4a(_0x5e4ef1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 356918e..4330e0e 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 _0x049e=['register','length','./voicePrefix.events','save','update','emit'];(function(_0x2fe0fc,_0x230bfc){var _0x2fd1cc=function(_0x104956){while(--_0x104956){_0x2fe0fc['push'](_0x2fe0fc['shift']());}};_0x2fd1cc(++_0x230bfc);}(_0x049e,0x16a));var _0xe049=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x049e[_0x37d3f3];return _0x185c9c;};'use strict';var VoicePrefixEvents=require(_0xe049('0x0'));var events=[_0xe049('0x1'),'remove',_0xe049('0x2')];function createListener(_0x47aa93,_0x155cb3){return function(_0x13cc6a){_0x155cb3[_0xe049('0x3')](_0x47aa93,_0x13cc6a);};}function removeListener(_0x4001a8,_0x2abd06){return function(){VoicePrefixEvents['removeListener'](_0x4001a8,_0x2abd06);};}exports[_0xe049('0x4')]=function(_0x196af2){for(var _0x22e8f5=0x0,_0x221a5f=events[_0xe049('0x5')];_0x22e8f5<_0x221a5f;_0x22e8f5++){var _0x17945b=events[_0x22e8f5];var _0x22abb2=createListener('voicePrefix:'+_0x17945b,_0x196af2);VoicePrefixEvents['on'](_0x17945b,_0x22abb2);}}; \ No newline at end of file +var _0x94dc=['register','voicePrefix:','./voicePrefix.events','remove','removeListener'];(function(_0x571e16,_0x4c28bc){var _0x3cb735=function(_0x7cbfd5){while(--_0x7cbfd5){_0x571e16['push'](_0x571e16['shift']());}};_0x3cb735(++_0x4c28bc);}(_0x94dc,0xb1));var _0xc94d=function(_0xd6ce87,_0x4f0cda){_0xd6ce87=_0xd6ce87-0x0;var _0x4aed07=_0x94dc[_0xd6ce87];return _0x4aed07;};'use strict';var VoicePrefixEvents=require(_0xc94d('0x0'));var events=['save',_0xc94d('0x1'),'update'];function createListener(_0x1645b0,_0x1b2070){return function(_0x40e7d8){_0x1b2070['emit'](_0x1645b0,_0x40e7d8);};}function removeListener(_0x306706,_0x41d4ec){return function(){VoicePrefixEvents[_0xc94d('0x2')](_0x306706,_0x41d4ec);};}exports[_0xc94d('0x3')]=function(_0x3c0601){for(var _0x344188=0x0,_0xb7275c=events['length'];_0x344188<_0xb7275c;_0x344188++){var _0x2f9757=events[_0x344188];var _0xbe5904=createListener(_0xc94d('0x4')+_0x2f9757,_0x3c0601);VoicePrefixEvents['on'](_0x2f9757,_0xbe5904);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index dedb7ee..32e9bd9 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0xb10b,0x12a));var _0xbb10=function(_0x542d6b,_0x1615bd){_0x542d6b=_0x542d6b-0x0;var _0x22d616=_0xb10b[_0x542d6b];return _0x22d616;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x16e5d1,_0x9cf085){var _0x3f72e6=function(_0x26c06a){while(--_0x26c06a){_0x16e5d1['push'](_0x16e5d1['shift']());}};_0x3f72e6(++_0x9cf085);}(_0xb10b,0x12a));var _0xbb10=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0xb10b[_0x408de5];return _0x2015a1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 1decb2a..a91e3ce 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 _0xe299=['preview','rrmemory','includes','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod'];(function(_0x22be7e,_0x9190fd){var _0x4b4a36=function(_0x36e1c2){while(--_0x36e1c2){_0x22be7e['push'](_0x22be7e['shift']());}};_0x4b4a36(++_0x9190fd);}(_0xe299,0x137));var _0x9e29=function(_0x1b618e,_0x531ac4){_0x1b618e=_0x1b618e-0x0;var _0x351ebf=_0xe299[_0x1b618e];return _0x351ebf;};'use strict';var Sequelize=require('sequelize');module[_0x9e29('0x0')]={'name':{'type':Sequelize[_0x9e29('0x1')],'allowNull':![],'unique':_0x9e29('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x4'),_0x9e29('0x5')),'allowNull':![],'defaultValue':_0x9e29('0x4')},'musiconhold':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':_0x9e29('0x6')},'announce':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9e29('0x3')]('rr',_0x9e29('0x7'),_0x9e29('0x8'),'fewestcalls','random','rrmemory',_0x9e29('0x9'),_0x9e29('0xa'),_0x9e29('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x424ab2){this[_0x9e29('0xc')](_0x9e29('0xd'),_0x424ab2?_0x424ab2:'rrmemory');},'get':function(){var _0x1903b7=this[_0x9e29('0xe')](_0x9e29('0xf'));var _0x1134db=this[_0x9e29('0xe')](_0x9e29('0x10'));var _0x15f3b0=this[_0x9e29('0xe')](_0x9e29('0xd'));if(_0x1903b7==='outbound'){if(_0x1134db===_0x9e29('0x11')){return null;}if(_0x1134db==='booked'&&![_0x9e29('0x12'),'roundrobin'][_0x9e29('0x13')](_0x15f3b0)){this['setDataValue']('strategy',_0x9e29('0x12'));}}return _0x15f3b0;}},'servicelevel':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9e29('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9e29('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9e29('0x15')},'autopause':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no',_0x9e29('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9e29('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x9e29('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9e29('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9e29('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9e29('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9e29('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':_0x9e29('0x15')},'announce_holdtime':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no',_0x9e29('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9e29('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9e29('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9e29('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x9e29('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x9e29('0x1')]},'queue_less_than':{'type':Sequelize[_0x9e29('0x1')]},'periodic_announce':{'type':Sequelize[_0x9e29('0x18')],'set':function(_0x476f67){this[_0x9e29('0xc')](_0x9e29('0x19'),_0x476f67?_0x476f67['join'](','):[]);},'get':function(){return this['getDataValue'](_0x9e29('0x19'))?this['getDataValue'](_0x9e29('0x19'))[_0x9e29('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':'yes','set':function(_0xa3d114){this[_0x9e29('0xc')](_0x9e29('0x1b'),_0xa3d114?_0xa3d114[_0x9e29('0x1c')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this['getDataValue']('joinempty')[_0x9e29('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':'no','set':function(_0x4cc23f){this[_0x9e29('0xc')](_0x9e29('0x1d'),_0x4cc23f?_0x4cc23f['join'](','):undefined);},'get':function(){return this[_0x9e29('0xe')](_0x9e29('0x1d'))?this[_0x9e29('0xe')](_0x9e29('0x1d'))[_0x9e29('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9e29('0x1')]},'description':{'type':Sequelize[_0x9e29('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3817a0){this[_0x9e29('0xc')](_0x9e29('0x1e'),_0x3817a0);if(_0x3817a0){if(this[_0x9e29('0xe')](_0x9e29('0x1f'))<0x2){this[_0x9e29('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9e29('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x11'),_0x9e29('0x20'),_0x9e29('0x21'),_0x9e29('0x22'),_0x9e29('0x23')),'defaultValue':_0x9e29('0x20'),'comment':_0x9e29('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9e29('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x9e29('0x14')](0x4)[_0x9e29('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9e29('0x26')},'dialPowerLevel':{'type':Sequelize[_0x9e29('0x27')](0x2)[_0x9e29('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9e29('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x9e29('0x3')](_0x9e29('0x29'),_0x9e29('0x2a')),'defaultValue':_0x9e29('0x2a'),'comment':_0x9e29('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9e29('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9e29('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x9e29('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9e29('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9e29('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9e29('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':'tTxX','comment':_0x9e29('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x9e29('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x30')},'dialQueueProject':{'type':Sequelize[_0x9e29('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e29('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e29('0x25')],'defaultValue':0x3,'comment':_0x9e29('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x9e29('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9e29('0x3')]('always','never',_0x9e29('0x36')),'defaultValue':_0x9e29('0x37')},'dialAMDActive':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':0x0,'comment':_0x9e29('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9e29('0x14')](0x9)[_0x9e29('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x9e29('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9e29('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9e29('0x14')](0x9)[_0x9e29('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9e29('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9e29('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9e29('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x9e29('0x14')](0x9)[_0x9e29('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9e29('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9e29('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9e29('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9e29('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9e29('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9e29('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x9e29('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':0x0,'comment':_0x9e29('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9e29('0x3')]('DESC',_0x9e29('0x41')),'defaultValue':_0x9e29('0x42')},'dialQueueProject2':{'type':Sequelize[_0x9e29('0x1')],'comment':_0x9e29('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9e29('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9e29('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9e29('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e29('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9e29('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e29('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e29('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9e29('0x14')](0x5)[_0x9e29('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e29('0x14')],'allowNull':!![],'comment':_0x9e29('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':![],'comment':_0x9e29('0x4f'),'set':function(_0x17650b){if(!_0x17650b)this[_0x9e29('0xc')](_0x9e29('0x50'),null);this[_0x9e29('0xc')](_0x9e29('0x51'),_0x17650b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9e29('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9e29('0x14')](0x3)[_0x9e29('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9e29('0x38')],'defaultValue':![]}}; \ No newline at end of file +var _0x166e=['all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy','outbound','preview','booked','roundrobin','INTEGER','yes'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0x166e,0x7e));var _0xe166=function(_0x1ccf17,_0x1ce7f9){_0x1ccf17=_0x1ccf17-0x0;var _0x4d939b=_0x166e[_0x1ccf17];return _0x4d939b;};'use strict';var Sequelize=require(_0xe166('0x0'));module['exports']={'name':{'type':Sequelize[_0xe166('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xe166('0x3')},'musiconhold':{'type':Sequelize[_0xe166('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xe166('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe166('0x2')]('rr',_0xe166('0x4'),_0xe166('0x5'),_0xe166('0x6'),_0xe166('0x7'),_0xe166('0x8'),_0xe166('0x9'),_0xe166('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0xe166('0x4'),'set':function(_0x9ca11){this[_0xe166('0xb')]('strategy',_0x9ca11?_0x9ca11:'rrmemory');},'get':function(){var _0x513980=this[_0xe166('0xc')](_0xe166('0xd'));var _0x57b8a7=this[_0xe166('0xc')](_0xe166('0xe'));var _0x1d78ee=this[_0xe166('0xc')](_0xe166('0xf'));if(_0x513980===_0xe166('0x10')){if(_0x57b8a7===_0xe166('0x11')){return null;}if(_0x57b8a7===_0xe166('0x12')&&!['rrmemory',_0xe166('0x13')]['includes'](_0x1d78ee)){this[_0xe166('0xb')](_0xe166('0xf'),_0xe166('0x8'));}}return _0x1d78ee;}},'servicelevel':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe166('0x14')](0xb)},'timeout':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe166('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no'),'defaultValue':_0xe166('0x15')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0xe166('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe166('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xe166('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xe166('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe166('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe166('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe166('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no'),'defaultValue':_0xe166('0x15')},'announce_holdtime':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no',_0xe166('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xe166('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe166('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe166('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe166('0x1')]},'queue_quantity1':{'type':Sequelize[_0xe166('0x1')]},'queue_quantity2':{'type':Sequelize[_0xe166('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xe166('0x1')]},'queue_less_than':{'type':Sequelize[_0xe166('0x1')]},'periodic_announce':{'type':Sequelize[_0xe166('0x18')],'set':function(_0x2bfa50){this[_0xe166('0xb')](_0xe166('0x19'),_0x2bfa50?_0x2bfa50[_0xe166('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0xe166('0x19'))?this[_0xe166('0xc')](_0xe166('0x19'))[_0xe166('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xe166('0x1')],'defaultValue':_0xe166('0x15'),'set':function(_0x336111){this[_0xe166('0xb')](_0xe166('0x1c'),_0x336111?_0x336111[_0xe166('0x1a')](','):undefined);},'get':function(){return this[_0xe166('0xc')](_0xe166('0x1c'))?this[_0xe166('0xc')](_0xe166('0x1c'))[_0xe166('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4526cd){this['setDataValue'](_0xe166('0x1d'),_0x4526cd?_0x4526cd[_0xe166('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xe166('0x1d'))?this['getDataValue']('leavewhenempty')[_0xe166('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xe166('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe166('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe166('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe166('0x1')]},'description':{'type':Sequelize[_0xe166('0x1')]},'acw':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':0x0,'set':function(_0x200f4c){this['setDataValue']('acw',_0x200f4c);if(_0x200f4c){if(this[_0xe166('0xc')]('wrapuptime')<0x2){this[_0xe166('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':0x0,'comment':_0xe166('0x1f')},'dialMethod':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x11'),_0xe166('0x20'),_0xe166('0x21'),_0xe166('0x22'),_0xe166('0x12')),'defaultValue':'progressive','comment':_0xe166('0x23')},'dialLimitChannel':{'type':Sequelize[_0xe166('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe166('0x24')},'dialLimitQueue':{'type':Sequelize[_0xe166('0x14')](0x4)[_0xe166('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xe166('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xe166('0x2')](_0xe166('0x26'),_0xe166('0x27')),'defaultValue':_0xe166('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe166('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe166('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe166('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x29')},'dialQueueOptions':{'type':Sequelize[_0xe166('0x1')],'defaultValue':'tTxX','comment':_0xe166('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xe166('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe166('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'comment':_0xe166('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe166('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe166('0x1')],'defaultValue':_0xe166('0x31')},'dialPrefix':{'type':Sequelize[_0xe166('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe166('0x2')]('always',_0xe166('0x32'),'onlyIfOpen'),'defaultValue':_0xe166('0x33')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe166('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0xe166('0x14')](0x9)[_0xe166('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe166('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe166('0x14')](0x9)[_0xe166('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe166('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe166('0x14')](0x9)[_0xe166('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe166('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0xe166('0x14')](0x9)[_0xe166('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe166('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe166('0x37')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe166('0x14')](0x9)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe166('0x38')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe166('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe166('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe166('0x3a')},'dialRecallInQueue':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':0x0,'comment':_0xe166('0x3b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe166('0x2')]('DESC','ASC'),'defaultValue':_0xe166('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xe166('0x1')],'comment':_0xe166('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe166('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe166('0x3d')},'dialCutDigit':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe166('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe166('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x41')},'dialDropRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe166('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe166('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe166('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe166('0x14')](0x5)[_0xe166('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe166('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe166('0x14')],'allowNull':!![],'comment':_0xe166('0x46')},'mandatoryDisposition':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':![],'comment':_0xe166('0x47'),'set':function(_0x32e7b3){if(!_0x32e7b3)this[_0xe166('0xb')](_0xe166('0x48'),null);this[_0xe166('0xb')](_0xe166('0x49'),_0x32e7b3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe166('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe166('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe166('0x14')](0x3)[_0xe166('0x25')],'defaultValue':0x4},'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 a4ede18..f9eae65 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x51e3be,_0x520722){var _0x467872=function(_0x338f6d){while(--_0x338f6d){_0x51e3be['push'](_0x51e3be['shift']());}};_0x467872(++_0x520722);}(_0x55ca,0x126));var _0xa55c=function(_0x51708f,_0x511834){_0x51708f=_0x51708f-0x0;var _0x5c60a3=_0x55ca[_0x51708f];return _0x5c60a3;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file +var _0xa41a=['createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','rawAttributes','key','where','include','VoiceQueue','findAll','rows','catch','params','model','query','keys','attributes','intersection','fields','length','merge','options','create','body','user','role','VoiceQueues','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit'];(function(_0x2d1a9e,_0x4bc4a7){var _0x42d260=function(_0x2ee4c6){while(--_0x2ee4c6){_0x2d1a9e['push'](_0x2d1a9e['shift']());}};_0x42d260(++_0x4bc4a7);}(_0xa41a,0x6b));var _0xaa41=function(_0x15e00c,_0x48340c){_0x15e00c=_0x15e00c-0x0;var _0x5ce6b6=_0xa41a[_0x15e00c];return _0x5ce6b6;};'use strict';var moment=require(_0xaa41('0x0'));var BPromise=require(_0xaa41('0x1'));var util=require('util');var _=require(_0xaa41('0x2'));var squel=require(_0xaa41('0x3'));var Redis=require(_0xaa41('0x4'));var qs=require(_0xaa41('0x5'));var logger=require(_0xaa41('0x6'))(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var db=require(_0xaa41('0x9'))['db'];config['redis']=_[_0xaa41('0xa')](config[_0xaa41('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xb')]));require(_0xaa41('0xc'))['register'](socket);function respondWithStatusCode(_0x31df43,_0x33f66b){_0x33f66b=_0x33f66b||0xcc;return function(_0x409dab){if(_0x409dab){return _0x31df43[_0xaa41('0xd')](_0x33f66b);}return _0x31df43[_0xaa41('0xe')](_0x33f66b)[_0xaa41('0xf')]();};}function respondWithResult(_0x806f08,_0x423a19){_0x423a19=_0x423a19||0xc8;return function(_0x1c291e){if(_0x1c291e){return _0x806f08['status'](_0x423a19)[_0xaa41('0x10')](_0x1c291e);}};}function respondWithFilteredResult(_0x10cda9,_0x524cab){return function(_0x54827c){if(_0x54827c){var _0x1d0a54=typeof _0x524cab['offset']===_0xaa41('0x11')&&typeof _0x524cab[_0xaa41('0x12')]===_0xaa41('0x11');var _0x889d44=_0x54827c[_0xaa41('0x13')];var _0x4eaf81=_0x1d0a54?0x0:_0x524cab[_0xaa41('0x14')];var _0x178170=_0x1d0a54?_0x54827c[_0xaa41('0x13')]:_0x524cab[_0xaa41('0x14')]+_0x524cab[_0xaa41('0x12')];var _0x2005ae;if(_0x178170>=_0x889d44){_0x178170=_0x889d44;_0x2005ae=0xc8;}else{_0x2005ae=0xce;}_0x10cda9[_0xaa41('0xe')](_0x2005ae);return _0x10cda9['set'](_0xaa41('0x15'),_0x4eaf81+'-'+_0x178170+'/'+_0x889d44)[_0xaa41('0x10')](_0x54827c);}return null;};}function saveUpdates(_0x4210fa){return function(_0x391b01){if(_0x391b01){return _0x391b01[_0xaa41('0x16')](_0x4210fa)[_0xaa41('0x17')](function(_0x29efe5){return _0x29efe5;});}return null;};}function removeEntity(_0x46e6d3){return function(_0x150ddf){if(_0x150ddf){return _0x150ddf['destroy']()['then'](function(){var _0x1f502a=_0x150ddf[_0xaa41('0x18')]({'plain':!![]});var _0x35c753=[{'name':'VoiceQueues','value':_0xaa41('0x19'),'ignore':![]},{'name':_0xaa41('0x1a'),'value':'outbound','ignore':![]}];var _0x513c61=_(_0x35c753)[_0xaa41('0x1b')]('ignore')[_0xaa41('0x1c')](_0xaa41('0x1d'))[_0xaa41('0x1d')]();if(_[_0xaa41('0x1e')](_0x513c61,_0x1f502a[_0xaa41('0x1f')])){return;}var _0x4eb01f=_[_0xaa41('0x20')](_0x35c753,[_0xaa41('0x1d'),_0x1f502a[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x22')][_0xaa41('0x23')]({'where':{'type':_0x4eb01f,'resourceId':_0x1f502a['id']}})['then'](function(){return _0x150ddf;});})['then'](function(){_0x46e6d3[_0xaa41('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493a10){return function(_0x12e362){if(!_0x12e362){_0x493a10['sendStatus'](0x194);}return _0x12e362;};}function handleError(_0x536bed,_0x2d0ac0){_0x2d0ac0=_0x2d0ac0||0x1f4;return function(_0x9c8c21){logger[_0xaa41('0x24')](_0x9c8c21[_0xaa41('0x25')]);if(_0x9c8c21[_0xaa41('0x21')]){delete _0x9c8c21[_0xaa41('0x21')];}_0x536bed['status'](_0x2d0ac0)[_0xaa41('0x26')](_0x9c8c21);};}exports[_0xaa41('0x27')]=function(_0x63c18c,_0x9a16e3){var _0x1d8c2b={};var _0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x1c')](db['VoiceQueue'][_0xaa41('0x28')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x1f')][_0xaa41('0x29')]};});_0x1d8c2b=qs['getOptions'](_0x30f88e,_0x63c18c);var _0x392b5d={'where':_0x1d8c2b[_0xaa41('0x2a')]};return db['VoiceQueue']['count'](_0x392b5d)['then'](function(_0x1cf3da){_0x4466a3[_0xaa41('0x13')]=_0x1cf3da;_0x1d8c2b[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x63c18c['query']);return db[_0xaa41('0x2c')][_0xaa41('0x2d')](_0x1d8c2b);})[_0xaa41('0x17')](function(_0x4de770){_0x4466a3[_0xaa41('0x2e')]=_0x4de770;return _0x4466a3;})[_0xaa41('0x17')](respondWithFilteredResult(_0x9a16e3,_0x1d8c2b))[_0xaa41('0x2f')](handleError(_0x9a16e3,null));};exports['show']=function(_0x252c62,_0x374117){var _0x57fe1d={'raw':![],'where':{'id':_0x252c62[_0xaa41('0x30')]['id']}},_0x23eb50={};_0x23eb50[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x2c')]['rawAttributes']);_0x23eb50[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x252c62[_0xaa41('0x32')]);_0x23eb50['filters']=_['intersection'](_0x23eb50['model'],_0x23eb50[_0xaa41('0x32')]);_0x57fe1d[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x23eb50[_0xaa41('0x31')],qs['fields'](_0x252c62['query'][_0xaa41('0x36')]));_0x57fe1d[_0xaa41('0x34')]=_0x57fe1d[_0xaa41('0x34')][_0xaa41('0x37')]?_0x57fe1d[_0xaa41('0x34')]:_0x23eb50[_0xaa41('0x31')];if(_0x252c62[_0xaa41('0x32')]['includeAll']){_0x57fe1d[_0xaa41('0x2b')]=[{'all':!![]}];}_0x57fe1d=_[_0xaa41('0x38')]({},_0x57fe1d,_0x252c62[_0xaa41('0x39')]);return db[_0xaa41('0x2c')]['find'](_0x57fe1d)['then'](handleEntityNotFound(_0x374117,null))[_0xaa41('0x17')](respondWithResult(_0x374117,null))[_0xaa41('0x2f')](handleError(_0x374117,null));};exports['create']=function(_0x4101ab,_0x563687){return db[_0xaa41('0x2c')][_0xaa41('0x3a')](_0x4101ab[_0xaa41('0x3b')],{})[_0xaa41('0x17')](function(_0x3e6cac){var _0x12ba1a=_0x4101ab[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x12ba1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ba1a[_0xaa41('0x3d')]===_0xaa41('0x3c')){var _0x35c685=_0x3e6cac[_0xaa41('0x18')]({'plain':!![]});var _0xc84fb8=[{'name':_0xaa41('0x3e'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0x4f9086=_[_0xaa41('0x20')](_0xc84fb8,[_0xaa41('0x1d'),_0x35c685[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x40')][_0xaa41('0x20')]({'where':{'name':_0x4f9086,'userProfileId':_0x12ba1a[_0xaa41('0x41')]},'raw':!![]})['then'](function(_0x124992){if(_0x124992&&_0x124992['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x3a')]({'name':_0x35c685['name'],'resourceId':_0x35c685['id'],'type':_0x124992['name'],'sectionId':_0x124992['id']},{})['then'](function(){return _0x3e6cac;});}else{return _0x3e6cac;}})[_0xaa41('0x2f')](function(_0x525b09){logger[_0xaa41('0x24')](_0xaa41('0x42'),_0x525b09);throw _0x525b09;});}return _0x3e6cac;})['then'](respondWithResult(_0x563687,0xc9))['catch'](handleError(_0x563687,null));};exports[_0xaa41('0x43')]=function(_0x1b7b97,_0x1bb973){var _0x2af8ba={'where':{'id':_0x1b7b97[_0xaa41('0x30')]['id']}},_0x3fe1a9={};_0x3fe1a9[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x2c')]['rawAttributes']);_0x2af8ba[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x3fe1a9[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x36')]));_0x2af8ba['attributes']=_0x2af8ba[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2af8ba[_0xaa41('0x34')]:_0x3fe1a9[_0xaa41('0x31')];if(_0x1b7b97['query'][_0xaa41('0x44')]){_0x2af8ba['include']=[{'all':!![]}];}_0x2af8ba=_['merge']({},_0x2af8ba,_0x1b7b97[_0xaa41('0x39')]);return db[_0xaa41('0x2c')][_0xaa41('0x20')](_0x2af8ba)['then'](handleEntityNotFound(_0x1bb973,null))[_0xaa41('0x17')](function(_0x3e1a73){if(_0x3e1a73){var _0x853ccb=_0x3e1a73['get']({'plain':!![]});_0x853ccb=qs[_0xaa41('0x45')](_0x853ccb,['id',_0xaa41('0x46'),_0xaa41('0x47')]);_0x1b7b97[_0xaa41('0x3b')]=_[_0xaa41('0x45')](_0x1b7b97[_0xaa41('0x3b')],['id',_0xaa41('0x46'),_0xaa41('0x47')]);return db['VoiceQueue'][_0xaa41('0x3a')](_['merge'](_0x853ccb,_0x1b7b97['body']),{'include':_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x44')]?[{'all':!![]}]:undefined})[_0xaa41('0x17')](function(_0x11f7d9){var _0x14aab0=_0x1b7b97[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x14aab0)throw new Error(_0xaa41('0x48'));if(_0x14aab0['role']===_0xaa41('0x3c')){var _0x14b0f0=_0x11f7d9[_0xaa41('0x18')]({'plain':!![]});var _0x4f9e92=[{'name':_0xaa41('0x3e'),'value':_0xaa41('0x19')},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0xd36d1a=_[_0xaa41('0x20')](_0x4f9e92,['value',_0x14b0f0[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db['UserProfileSection']['find']({'where':{'name':_0xd36d1a,'userProfileId':_0x14aab0[_0xaa41('0x41')]},'raw':!![]})[_0xaa41('0x17')](function(_0x3a29d2){if(_0x3a29d2&&_0x3a29d2['autoAssociation']===0x0){return db[_0xaa41('0x22')][_0xaa41('0x3a')]({'name':_0x14b0f0[_0xaa41('0x21')],'resourceId':_0x14b0f0['id'],'type':_0x3a29d2[_0xaa41('0x21')],'sectionId':_0x3a29d2['id']},{})[_0xaa41('0x17')](function(){return _0x11f7d9;});}else{return _0x11f7d9;}})['catch'](function(_0x2ae70c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ae70c);throw _0x2ae70c;});}return _0x11f7d9;});}})[_0xaa41('0x17')](respondWithResult(_0x1bb973,0xc9))['catch'](handleError(_0x1bb973,null));};exports[_0xaa41('0x16')]=function(_0xbbf261,_0x169ddf){if(_0xbbf261['body']['id']){delete _0xbbf261[_0xaa41('0x3b')]['id'];}return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0xbbf261[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x169ddf,null))[_0xaa41('0x17')](saveUpdates(_0xbbf261[_0xaa41('0x3b')],null))[_0xaa41('0x17')](respondWithResult(_0x169ddf,null))[_0xaa41('0x2f')](handleError(_0x169ddf,null));};exports['destroy']=function(_0x35a09e,_0x40cdfc){return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x35a09e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x40cdfc,null))[_0xaa41('0x17')](removeEntity(_0x40cdfc,null))[_0xaa41('0x2f')](handleError(_0x40cdfc,null));};exports[_0xaa41('0x49')]=function(_0xfbe748,_0x320ce7){var _0x5ea056={'raw':![],'where':{}};var _0x55a85c={};var _0x5cb34d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xfbe748['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x320ce7,null))['then'](function(_0x576e6e){if(_0x576e6e){_0x55a85c[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x4a')][_0xaa41('0x28')]);_0x55a85c['query']=_[_0xaa41('0x33')](_0xfbe748[_0xaa41('0x32')]);_0x55a85c[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],_0x55a85c[_0xaa41('0x32')]);_0x5ea056[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],qs['fields'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5ea056['attributes']=_0x5ea056['attributes']['length']?_0x5ea056[_0xaa41('0x34')]:_0x55a85c['model'];if(!_0xfbe748[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x5ea056[_0xaa41('0x12')]=qs['limit'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5ea056[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xfbe748['query']['offset']);}_0x5ea056[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfbe748['query']['sort']);_0x5ea056[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfbe748[_0xaa41('0x32')],_0x55a85c[_0xaa41('0x4b')]));_0x5ea056['where'][_0xaa41('0x50')]=_0x576e6e['id'];if(_0xfbe748['query']['filter']){_0x5ea056['where']=_[_0xaa41('0x38')](_0x5ea056[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5ea056['attributes'],function(_0x229297){var _0x2adf93={};_0x2adf93[_0x229297]={'$like':'%'+_0xfbe748[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x2adf93;})});}_0x5ea056=_[_0xaa41('0x38')]({},_0x5ea056,_0xfbe748[_0xaa41('0x39')]);return db[_0xaa41('0x4a')]['count']({'where':_0x5ea056[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x40b47c){_0x5cb34d[_0xaa41('0x13')]=_0x40b47c;if(_0xfbe748['query'][_0xaa41('0x44')]){_0x5ea056['include']=[{'all':!![]}];}return db[_0xaa41('0x4a')][_0xaa41('0x2d')](_0x5ea056);})[_0xaa41('0x17')](function(_0x143ef0){_0x5cb34d['rows']=_0x143ef0;return _0x5cb34d;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x320ce7,_0x5ea056))[_0xaa41('0x2f')](handleError(_0x320ce7,null));};exports[_0xaa41('0x51')]=function(_0x304aad,_0x59052d){var _0x140d78={'raw':!![],'where':{}};var _0x50197b={};var _0x55d380={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x304aad[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x59052d,null))[_0xaa41('0x17')](function(_0x582d79){if(_0x582d79){_0x50197b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x52')][_0xaa41('0x28')]);_0x50197b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x304aad[_0xaa41('0x32')]);_0x50197b['filters']=_[_0xaa41('0x35')](_0x50197b[_0xaa41('0x31')],_0x50197b[_0xaa41('0x32')]);_0x140d78['attributes']=_['intersection'](_0x50197b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x304aad['query'][_0xaa41('0x36')]));_0x140d78[_0xaa41('0x34')]=_0x140d78['attributes'][_0xaa41('0x37')]?_0x140d78[_0xaa41('0x34')]:_0x50197b[_0xaa41('0x31')];if(!_0x304aad[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x140d78[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x304aad['query']['limit']);_0x140d78[_0xaa41('0x14')]=qs['offset'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x140d78[_0xaa41('0x4d')]=qs['sort'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x140d78[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x304aad[_0xaa41('0x32')],_0x50197b['filters']));_0x140d78[_0xaa41('0x2a')]['VoiceQueueId']=_0x582d79['id'];if(_0x304aad['query'][_0xaa41('0x1b')]){_0x140d78[_0xaa41('0x2a')]=_['merge'](_0x140d78['where'],{'$or':_[_0xaa41('0x1c')](_0x140d78[_0xaa41('0x34')],function(_0x3c189d){var _0x447183={};_0x447183[_0x3c189d]={'$like':'%'+_0x304aad['query'][_0xaa41('0x1b')]+'%'};return _0x447183;})});}_0x140d78=_[_0xaa41('0x38')]({},_0x140d78,_0x304aad[_0xaa41('0x39')]);return db['CmHopperHistory'][_0xaa41('0x13')]({'where':_0x140d78[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x5697b6){_0x55d380[_0xaa41('0x13')]=_0x5697b6;if(_0x304aad['query']['includeAll']){_0x140d78[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x52')]['findAll'](_0x140d78);})[_0xaa41('0x17')](function(_0x9e8ebb){_0x55d380[_0xaa41('0x2e')]=_0x9e8ebb;return _0x55d380;});}})['then'](respondWithFilteredResult(_0x59052d,_0x140d78))[_0xaa41('0x2f')](handleError(_0x59052d,null));};exports[_0xaa41('0x54')]=function(_0x1a2deb,_0x16dcac){var _0x38f5d0={'raw':!![],'where':{}};var _0x4e087d={};var _0x24eb2e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x1a2deb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x16dcac,null))[_0xaa41('0x17')](function(_0x33ec81){if(_0x33ec81){_0x4e087d[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x56')][_0xaa41('0x28')]);_0x4e087d[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x1a2deb['query']);_0x4e087d[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x4e087d['model'],_0x4e087d[_0xaa41('0x32')]);_0x38f5d0['attributes']=_[_0xaa41('0x35')](_0x4e087d[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x36')]));_0x38f5d0[_0xaa41('0x34')]=_0x38f5d0[_0xaa41('0x34')]['length']?_0x38f5d0[_0xaa41('0x34')]:_0x4e087d[_0xaa41('0x31')];if(!_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x38f5d0[_0xaa41('0x12')]=qs['limit'](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x12')]);_0x38f5d0[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x1a2deb[_0xaa41('0x32')]['offset']);}_0x38f5d0[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x1a2deb['query'][_0xaa41('0x4e')]);_0x38f5d0[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x1a2deb[_0xaa41('0x32')],_0x4e087d[_0xaa41('0x4b')]));_0x38f5d0[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x33ec81['id'];if(_0x1a2deb['query'][_0xaa41('0x1b')]){_0x38f5d0[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x38f5d0[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x38f5d0[_0xaa41('0x34')],function(_0x5489be){var _0x56f5ff={};_0x56f5ff[_0x5489be]={'$like':'%'+_0x1a2deb['query'][_0xaa41('0x1b')]+'%'};return _0x56f5ff;})});}_0x38f5d0=_[_0xaa41('0x38')]({},_0x38f5d0,_0x1a2deb['options']);return db[_0xaa41('0x56')][_0xaa41('0x13')]({'where':_0x38f5d0['where']})[_0xaa41('0x17')](function(_0x1da898){_0x24eb2e[_0xaa41('0x13')]=_0x1da898;if(_0x1a2deb[_0xaa41('0x32')]['includeAll']){_0x38f5d0[_0xaa41('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xaa41('0x2d')](_0x38f5d0);})[_0xaa41('0x17')](function(_0x374873){_0x24eb2e[_0xaa41('0x2e')]=_0x374873;return _0x24eb2e;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x16dcac,_0x38f5d0))[_0xaa41('0x2f')](handleError(_0x16dcac,null));};exports[_0xaa41('0x57')]=function(_0x27363e,_0x25cac8){var _0x5381d5={'raw':!![],'where':{}};var _0x276013={};var _0x3135c3={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x27363e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25cac8,null))[_0xaa41('0x17')](function(_0x408d95){if(_0x408d95){_0x276013[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x58')][_0xaa41('0x28')]);_0x276013[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x27363e[_0xaa41('0x32')]);_0x276013['filters']=_[_0xaa41('0x35')](_0x276013[_0xaa41('0x31')],_0x276013[_0xaa41('0x32')]);_0x5381d5[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x276013['model'],qs['fields'](_0x27363e[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5381d5['attributes']=_0x5381d5[_0xaa41('0x34')][_0xaa41('0x37')]?_0x5381d5['attributes']:_0x276013['model'];if(!_0x27363e['query'][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x5381d5[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5381d5[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x5381d5[_0xaa41('0x4d')]=qs['sort'](_0x27363e['query'][_0xaa41('0x4e')]);_0x5381d5[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x27363e['query'],_0x276013[_0xaa41('0x4b')]));_0x5381d5[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x408d95['id'];if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x5381d5[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x5381d5[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5381d5['attributes'],function(_0x56bd21){var _0x56661a={};_0x56661a[_0x56bd21]={'$like':'%'+_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x56661a;})});}_0x5381d5=_['merge']({},_0x5381d5,_0x27363e['options']);return db[_0xaa41('0x58')][_0xaa41('0x13')]({'where':_0x5381d5['where']})['then'](function(_0xf651b7){_0x3135c3['count']=_0xf651b7;if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x44')]){_0x5381d5[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x58')][_0xaa41('0x2d')](_0x5381d5);})[_0xaa41('0x17')](function(_0x211455){_0x3135c3[_0xaa41('0x2e')]=_0x211455;return _0x3135c3;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x25cac8,_0x5381d5))['catch'](handleError(_0x25cac8,null));};exports['getTeams']=function(_0x38884d,_0x25d938){var _0x337655={};var _0x415705={};var _0x3efb43;var _0xae746;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x38884d[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25d938,null))[_0xaa41('0x17')](function(_0x17442e){if(_0x17442e){_0x3efb43=_0x17442e;_0x415705[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x59')]['rawAttributes']);_0x415705[_0xaa41('0x32')]=_['keys'](_0x38884d[_0xaa41('0x32')]);_0x415705[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],_0x415705[_0xaa41('0x32')]);_0x337655[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],qs['fields'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x36')]));_0x337655[_0xaa41('0x34')]=_0x337655[_0xaa41('0x34')][_0xaa41('0x37')]?_0x337655[_0xaa41('0x34')]:_0x415705[_0xaa41('0x31')];_0x337655[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x38884d[_0xaa41('0x32')]['sort']);_0x337655['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x38884d[_0xaa41('0x32')],_0x415705[_0xaa41('0x4b')]));if(_0x38884d[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x337655[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x337655[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x337655['attributes'],function(_0x49b468){var _0x17018e={};_0x17018e[_0x49b468]={'$like':'%'+_0x38884d[_0xaa41('0x32')]['filter']+'%'};return _0x17018e;})});}_0x337655=_[_0xaa41('0x38')]({},_0x337655,_0x38884d['options']);return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x50e03d){if(_0x50e03d){_0xae746=_0x50e03d['length'];if(!_0x38884d[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x337655['limit']=qs['limit'](_0x38884d[_0xaa41('0x32')]['limit']);_0x337655[_0xaa41('0x14')]=qs['offset'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x182b0b){if(_0x182b0b){return _0x182b0b?{'count':_0xae746,'rows':_0x182b0b}:null;}})[_0xaa41('0x17')](respondWithResult(_0x25d938,null))[_0xaa41('0x2f')](handleError(_0x25d938,null));};exports['addTeams']=function(_0x4363b5,_0x1fa1f5){var _0x50883c=_0x4363b5[_0xaa41('0x3b')][_0xaa41('0x5b')];var _0x1c3d7f=_[_0xaa41('0x1c')](_0x50883c,'id');return db['Team'][_0xaa41('0x2d')]({'where':{'id':_0x1c3d7f},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]}]})[_0xaa41('0x17')](function(_0xe2574a){if(_0xe2574a){var _0x4d83ce=_['flatMap'](_0xe2574a,function(_0x214ebe){var _0x2df75c=_0x214ebe[_0xaa41('0x18')]({'plain':!![]});_0x2df75c[_0xaa41('0x5d')][_0xaa41('0x61')](function(_0x401586){_0x401586['penalty']=_[_0xaa41('0x20')](_0x50883c,{'id':_0x2df75c['id']})[_0xaa41('0x62')];});return _0x2df75c[_0xaa41('0x5d')];});return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x4363b5[_0xaa41('0x30')]['id']}})['then'](function(_0xe8076e){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4cf0c5){return _0xe8076e[_0xaa41('0x65')](_0x1c3d7f,{'transaction':_0x4cf0c5})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x50883c,function(_0x255e76){return db[_0xaa41('0x67')][_0xaa41('0x68')]({'TeamId':_0x255e76['id'],'VoiceQueueId':_0x4363b5[_0xaa41('0x30')]['id'],'penalty':_0x255e76[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x4d83ce,function(_0x19a42c){return db[_0xaa41('0x69')][_0xaa41('0x6a')]({'where':{'UserId':_0x19a42c['id'],'VoiceQueueId':_0x4363b5['params']['id']},'defaults':{'penalty':_0x19a42c['penalty']},'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_[_0xaa41('0x1b')](_0x4d83ce,{'online':!![]}),function(_0x2c4595){return db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x2c4595[_0xaa41('0x21')],'UserId':_0x2c4595['id'],'queue_name':_0xe8076e['name'],'VoiceQueueId':_0xe8076e['id'],'interface':_[_0xaa41('0x6c')](_0x2c4595[_0xaa41('0x60')])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x2c4595[_0xaa41('0x21')]):_0x2c4595[_0xaa41('0x60')],'paused':_0x2c4595[_0xaa41('0x5f')]||![],'penalty':_0x2c4595[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){_0x4d83ce[_0xaa41('0x61')](function(_0x3f2dbb){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':_0x3f2dbb['id'],'VoiceQueueId':_0xe8076e['id']});});});});});}})[_0xaa41('0x17')](respondWithStatusCode(_0x1fa1f5,null))[_0xaa41('0x2f')](handleError(_0x1fa1f5,null));};exports['removeTeams']=function(_0x33f008,_0x1489fe){return db[_0xaa41('0x59')][_0xaa41('0x2d')]({'where':{'id':_0x33f008['query'][_0xaa41('0x70')]},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id'],'raw':!![]}]})[_0xaa41('0x17')](handleEntityNotFound(_0x1489fe,null))[_0xaa41('0x17')](function(_0x4baae3){var _0xc59a12=_['map'](_0x4baae3,'id');var _0x50a526=[];var _0x3dd3fa=[];var _0x552493=squel['select']();_0x552493[_0xaa41('0x71')](_0xaa41('0x72'))[_0xaa41('0x73')]('team_has_voice_queues','tq')[_0xaa41('0x74')](_0xaa41('0x75'),'ut',_0xaa41('0x76'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x33f008[_0xaa41('0x30')]['id']);for(var _0x29d34a=0x0;_0x29d34a<_0x4baae3[_0xaa41('0x37')];_0x29d34a+=0x1){let _0x48e2cf=_0x4baae3[_0x29d34a];for(var _0x410d6e=0x0;_0x410d6e<_0x48e2cf[_0xaa41('0x5d')][_0xaa41('0x37')];_0x410d6e+=0x1){let _0x3361f5=_0x48e2cf[_0xaa41('0x5d')][_0x410d6e];var _0x4f1bcb=_0x552493['clone']();_0x4f1bcb[_0xaa41('0x2a')](_0xaa41('0x78'),_0x3361f5['id']);_0x3dd3fa[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x4f1bcb[_0xaa41('0x7a')](),{'type':db['sequelize'][_0xaa41('0x7b')][_0xaa41('0x7c')]})['then'](function(_0x40f4ce){if(_0x40f4ce[_0xaa41('0x37')]===0x1){return _0x3361f5['id'];}else{var _0x95300a=_[_0xaa41('0x7d')](_[_0xaa41('0x1c')](_0x40f4ce,_0xaa41('0x7e')),function(_0x1926bd){return _['includes'](_0xc59a12,_0x1926bd);});if(_0x95300a){return _0x3361f5['id'];}}}));}}return BPromise[_0xaa41('0x7f')](_0x3dd3fa)[_0xaa41('0x17')](function(_0x5404cd){_0x50a526=_(_0x50a526)[_0xaa41('0x80')](_0x5404cd)[_0xaa41('0x81')]()[_0xaa41('0x1d')]();return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x33f008[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(_0x339537){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4b84bc){return _0x339537[_0xaa41('0x82')](_0x33f008[_0xaa41('0x32')]['ids'],{'transaction':_0x4b84bc})['then'](function(){if(!_[_0xaa41('0x83')](_0x50a526)){return _0x339537[_0xaa41('0x84')](_0x50a526,{'transaction':_0x4b84bc})[_0xaa41('0x17')](function(){return db[_0xaa41('0x6b')][_0xaa41('0x23')]({'where':{'VoiceQueueId':_0x33f008[_0xaa41('0x30')]['id'],'UserId':_0x50a526},'transaction':_0x4b84bc});});}})['then'](function(){_0x50a526['forEach'](function(_0x395323){socket[_0xaa41('0x6f')]('userVoiceQueue:remove',{'UserId':_0x395323,'VoiceQueueId':_0x339537['id']});});});});});});})['then'](respondWithStatusCode(_0x1489fe,null))[_0xaa41('0x2f')](handleError(_0x1489fe,null));};exports[_0xaa41('0x85')]=function(_0x2fe50f,_0x520b50){var _0x50122d,_0x1d609e;return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2fe50f['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x520b50,null))[_0xaa41('0x17')](function(_0x5a0791){if(_0x5a0791){_0x1d609e=_0x5a0791;return _0x5a0791['addAgents'](_0x2fe50f[_0xaa41('0x3b')]['ids'],_[_0xaa41('0x45')](_0x2fe50f[_0xaa41('0x3b')],[_0xaa41('0x70'),'id'])||{})[_0xaa41('0x86')](function(_0x1d7c2e){for(var _0xdc0493=0x0;_0xdc0493<_0x2fe50f[_0xaa41('0x3b')]['ids'][_0xaa41('0x37')];_0xdc0493+=0x1){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':Number(_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')][_0xdc0493]),'VoiceQueueId':Number(_0x2fe50f[_0xaa41('0x30')]['id'])});}return _0x1d7c2e;});}})[_0xaa41('0x17')](function(_0x2af16e){_0x50122d=_0x2af16e||[];if(_0x1d609e){return db[_0xaa41('0x5c')]['findAll']({'where':{'id':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')]},'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]});}})[_0xaa41('0x17')](function(_0x5083ff){if(!_[_0xaa41('0x83')](_0x5083ff)){var _0x3c4e89=[];for(var _0x415acc=0x0;_0x415acc<_0x5083ff['length'];_0x415acc++){if(_0x5083ff[_0x415acc]['online']){_0x3c4e89['push'](db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x5083ff[_0x415acc][_0xaa41('0x21')],'UserId':_0x5083ff[_0x415acc]['id'],'queue_name':_0x1d609e[_0xaa41('0x21')],'VoiceQueueId':_0x1d609e['id'],'interface':_[_0xaa41('0x6c')](_0x5083ff[_0x415acc]['interface'])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x5083ff[_0x415acc][_0xaa41('0x21')]):_0x5083ff[_0x415acc][_0xaa41('0x60')],'paused':_0x5083ff[_0x415acc][_0xaa41('0x5f')]||![],'penalty':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x62')]||0x0}));}}return BPromise['all'](_0x3c4e89);}})[_0xaa41('0x17')](function(){return _0x50122d;})[_0xaa41('0x17')](respondWithResult(_0x520b50,null))[_0xaa41('0x2f')](handleError(_0x520b50,null));};exports['removeAgents']=function(_0x16a173,_0x53a519){return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x16a173['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x53a519,null))[_0xaa41('0x17')](function(_0x366705){if(_0x366705){return _0x366705[_0xaa41('0x84')](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])[_0xaa41('0x17')](function(){if(_['isArray'](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])){for(var _0x3ee9e3=0x0;_0x3ee9e3<_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0xaa41('0x37')];_0x3ee9e3+=0x1){socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0x3ee9e3]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}}else{socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}});}})['then'](function(_0x29b27e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x16a173['params']['id'],'UserId':_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]}})['then'](function(){return _0x29b27e;});})[_0xaa41('0x17')](respondWithStatusCode(_0x53a519,null))[_0xaa41('0x2f')](handleError(_0x53a519,null));};exports[_0xaa41('0x88')]=function(_0x15bb60,_0x232732){var _0x34d857={};var _0x239f1b={};var _0x445925;var _0x1e8591;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x15bb60[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x232732,null))[_0xaa41('0x17')](function(_0x7bae82){if(_0x7bae82){_0x445925=_0x7bae82;_0x239f1b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['User'][_0xaa41('0x28')]);_0x239f1b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x15bb60[_0xaa41('0x32')]);_0x239f1b['filters']=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],_0x239f1b['query']);_0x34d857[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x36')]));_0x34d857[_0xaa41('0x34')]=_0x34d857[_0xaa41('0x34')][_0xaa41('0x37')]?_0x34d857[_0xaa41('0x34')]:_0x239f1b['model'];_0x34d857[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x34d857[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_['pick'](_0x15bb60[_0xaa41('0x32')],_0x239f1b['filters']));if(_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x34d857[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x34d857[_0xaa41('0x2a')],{'$or':_['map'](_0x34d857[_0xaa41('0x34')],function(_0x345002){var _0x5f39b4={};_0x5f39b4[_0x345002]={'$like':'%'+_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x5f39b4;})});}_0x34d857=_[_0xaa41('0x38')]({},_0x34d857,_0x15bb60[_0xaa41('0x39')]);return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0x38b3be){if(_0x38b3be){_0x1e8591=_0x38b3be[_0xaa41('0x37')];if(!_0x15bb60[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x34d857[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x15bb60[_0xaa41('0x32')]['limit']);_0x34d857['offset']=qs[_0xaa41('0x14')](_0x15bb60['query']['offset']);}return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0xa4dbd3){if(_0xa4dbd3){return _0xa4dbd3?{'count':_0x1e8591,'rows':_0xa4dbd3}:null;}})[_0xaa41('0x17')](respondWithResult(_0x232732,null))['catch'](handleError(_0x232732,null));};exports['getMembers']=function(_0xa63e60,_0xf4f13f){var _0xef0e44={};var _0x46d37f={};var _0x6a6081;var _0x5e3bb2;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0xa63e60['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0xf4f13f,null))[_0xaa41('0x17')](function(_0x4b4a4a){if(_0x4b4a4a){_0x6a6081=_0x4b4a4a;_0x46d37f[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['UserVoiceQueueRt'][_0xaa41('0x28')]);_0x46d37f[_0xaa41('0x32')]=_['keys'](_0xa63e60[_0xaa41('0x32')]);_0x46d37f['filters']=_['intersection'](_0x46d37f[_0xaa41('0x31')],_0x46d37f[_0xaa41('0x32')]);_0xef0e44[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x46d37f[_0xaa41('0x31')],qs['fields'](_0xa63e60[_0xaa41('0x32')]['fields']));_0xef0e44['attributes']=_0xef0e44[_0xaa41('0x34')][_0xaa41('0x37')]?_0xef0e44[_0xaa41('0x34')]:_0x46d37f[_0xaa41('0x31')];_0xef0e44[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xa63e60[_0xaa41('0x32')]['sort']);_0xef0e44[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xa63e60[_0xaa41('0x32')],_0x46d37f[_0xaa41('0x4b')]));if(_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0xef0e44[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0xef0e44[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0xef0e44[_0xaa41('0x34')],function(_0x5a2ba0){var _0x4fc7d6={};_0x4fc7d6[_0x5a2ba0]={'$like':'%'+_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x4fc7d6;})});}_0xef0e44=_[_0xaa41('0x38')]({},_0xef0e44,_0xa63e60['options']);return _0x6a6081[_0xaa41('0x89')](_0xef0e44);}})[_0xaa41('0x17')](function(_0x15bc15){if(_0x15bc15){_0x5e3bb2=_0x15bc15[_0xaa41('0x37')];if(!_0xa63e60[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0xef0e44[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x12')]);_0xef0e44[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x6a6081['getMembers'](_0xef0e44);}})[_0xaa41('0x17')](function(_0x28c109){return _0x28c109?{'count':_0x5e3bb2,'rows':_0x28c109}:null;})[_0xaa41('0x17')](respondWithResult(_0xf4f13f,null))['catch'](handleError(_0xf4f13f,null));};exports[_0xaa41('0x8a')]=function(_0xfc1e24,_0x35c48f){var _0x2b0bf9={};var _0x21c0c6={};var _0x1138d0;var _0x394987;return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0xfc1e24[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x35c48f,null))[_0xaa41('0x17')](function(_0x2fc4b1){if(_0x2fc4b1){_0x1138d0=_0x2fc4b1;_0x21c0c6[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x8b')]['rawAttributes']);_0x21c0c6[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0xfc1e24[_0xaa41('0x32')]);_0x21c0c6[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],_0x21c0c6[_0xaa41('0x32')]);_0x2b0bf9[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0xfc1e24[_0xaa41('0x32')]['fields']));_0x2b0bf9['attributes']=_0x2b0bf9[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2b0bf9[_0xaa41('0x34')]:_0x21c0c6[_0xaa41('0x31')];_0x2b0bf9[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfc1e24['query'][_0xaa41('0x4e')]);_0x2b0bf9['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfc1e24[_0xaa41('0x32')],_0x21c0c6[_0xaa41('0x4b')]));if(_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x2b0bf9['where']=_['merge'](_0x2b0bf9[_0xaa41('0x2a')],{'$or':_['map'](_0x2b0bf9[_0xaa41('0x34')],function(_0x3f8296){var _0x438fcf={};_0x438fcf[_0x3f8296]={'$like':'%'+_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x438fcf;})});}_0x2b0bf9=_[_0xaa41('0x38')]({},_0x2b0bf9,_0xfc1e24[_0xaa41('0x39')]);return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x2667bd){if(_0x2667bd){_0x394987=_0x2667bd[_0xaa41('0x37')];if(!_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x2b0bf9['limit']=qs[_0xaa41('0x12')](_0xfc1e24['query'][_0xaa41('0x12')]);_0x2b0bf9['offset']=qs[_0xaa41('0x14')](_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x3dafc6){if(_0x3dafc6){return _0x3dafc6?{'count':_0x394987,'rows':_0x3dafc6}:null;}})[_0xaa41('0x17')](respondWithResult(_0x35c48f,null))['catch'](handleError(_0x35c48f,null));};exports[_0xaa41('0x8c')]=function(_0x533f4b,_0x47ca9d){var _0xd1f9ba=moment()[_0xaa41('0x6d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2c4930,_0x1285ed;return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x533f4b[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x47ca9d,null))['then'](function(_0x3ecde6){if(_0x3ecde6){_0x1285ed=_0x3ecde6;return _0x3ecde6['addLists'](_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x533f4b[_0xaa41('0x3b')],['ids','id'])||{});}return null;})[_0xaa41('0x86')](function(_0x32a07e){var _0x2b8b73;_0x2c4930=_0x32a07e||[];var _0x49e4a5=[];if(_0x32a07e){for(var _0xda8e73=0x0;_0xda8e73<_0x32a07e[_0xaa41('0x37')];_0xda8e73+=0x1){var _0x25f5ba=_0x32a07e[_0xda8e73][_0xaa41('0x18')]({'plain':!![]});_0x1285ed[_0xaa41('0x8d')]=_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x8d')]?_0x533f4b[_0xaa41('0x3b')]['dialCheckDuplicateType']:_0x1285ed[_0xaa41('0x8d')];switch(_0x1285ed['dialCheckDuplicateType']){case _0xaa41('0x8e'):_0x2b8b73=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0x91'))[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),'ListId')[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')]['toString']())[_0xaa41('0x2a')](_0xaa41('0x9b'))['where'](_0xaa41('0x9c'),squel['select']()[_0xaa41('0x71')](_0xaa41('0x9d'))[_0xaa41('0x73')](_0xaa41('0x9e'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]()))[_0xaa41('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xaa41('0x71')](_0xaa41('0x9f'))['from'](_0xaa41('0x91'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x533f4b['params']['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;case _0xaa41('0xa0'):_0x2b8b73=squel['insert']()[_0xaa41('0x90')](_0xaa41('0x91'))['fromQuery'](['phone',_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),'createdAt',_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))['field']('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27','createdAt')[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')]('deletedAt\x20IS\x20NULL')[_0xaa41('0x2a')]('ListId\x20=\x20?',_0x25f5ba[_0xaa41('0x98')]['toString']())['where'](_0xaa41('0x9b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xaa41('0x97')]()[_0xaa41('0x71')](_0xaa41('0x9f'))[_0xaa41('0x73')](_0xaa41('0x91'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;default:_0x2b8b73=squel['insert']()[_0xaa41('0x90')]('cm_hopper')[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),'ListId','VoiceQueueId',_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')]['toString'](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))['from'](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))[_0xaa41('0x7a')]();}_0x49e4a5[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x2b8b73));}return BPromise[_0xaa41('0x7f')](_0x49e4a5);}})['then'](function(){var _0x58f009=[];var _0x405eba=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')]('cm_hopper_additional_phones')[_0xaa41('0x92')]([_0xaa41('0xa2'),_0xaa41('0x93'),_0xaa41('0xa3'),_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()[_0xaa41('0x71')](_0xaa41('0xa4'))[_0xaa41('0x71')](_0xaa41('0xa5'))['field'](_0xaa41('0xa6'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27','updatedAt')[_0xaa41('0x73')](_0xaa41('0xa7'),'ci')[_0xaa41('0x74')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0xaa41('0x2a')](_0xaa41('0xa8'),_0xd1f9ba)[_0xaa41('0x2a')](_0xaa41('0xa9'),_0xaa41('0xaa')))[_0xaa41('0x7a')]();_0x58f009['push'](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x405eba));return BPromise[_0xaa41('0x7f')](_0x58f009);})[_0xaa41('0x17')](function(){return _0x2c4930;})[_0xaa41('0x17')](respondWithResult(_0x47ca9d,null))[_0xaa41('0x2f')](handleError(_0x47ca9d,null));};exports[_0xaa41('0xab')]=function(_0x718a84,_0x151c5f){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x718a84['params']['id']}})['then'](handleEntityNotFound(_0x151c5f,null))[_0xaa41('0x17')](function(_0x293a1d){if(_0x293a1d){return _0x293a1d['removeLists'](_0x718a84[_0xaa41('0x32')][_0xaa41('0x70')]);}})['then'](function(_0x490a6c){if(_0x490a6c){return db[_0xaa41('0x4a')][_0xaa41('0x23')]({'where':{'ListId':_0x718a84[_0xaa41('0x32')]['ids'],'VoiceQueueId':_0x718a84[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x490a6c;});}})['then'](respondWithStatusCode(_0x151c5f,null))[_0xaa41('0x2f')](handleError(_0x151c5f,null));};exports[_0xaa41('0xac')]=function(_0x536cdb,_0x431b75){var _0x18499f={};var _0x49cbd7={};var _0x515f91;var _0x4b5953;return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x536cdb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x431b75,null))[_0xaa41('0x17')](function(_0x4ca8f7){if(_0x4ca8f7){_0x515f91=_0x4ca8f7;_0x49cbd7['model']=_[_0xaa41('0x33')](db['CmList'][_0xaa41('0x28')]);_0x49cbd7[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x536cdb[_0xaa41('0x32')]);_0x49cbd7['filters']=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],_0x49cbd7[_0xaa41('0x32')]);_0x18499f[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x536cdb[_0xaa41('0x32')]['fields']));_0x18499f['attributes']=_0x18499f[_0xaa41('0x34')][_0xaa41('0x37')]?_0x18499f[_0xaa41('0x34')]:_0x49cbd7[_0xaa41('0x31')];_0x18499f[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x536cdb[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x18499f[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x536cdb[_0xaa41('0x32')],_0x49cbd7[_0xaa41('0x4b')]));if(_0x536cdb['query'][_0xaa41('0x1b')]){_0x18499f[_0xaa41('0x2a')]=_['merge'](_0x18499f[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x18499f[_0xaa41('0x34')],function(_0x5cd79d){var _0x558583={};_0x558583[_0x5cd79d]={'$like':'%'+_0x536cdb[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x558583;})});}_0x18499f=_['merge']({},_0x18499f,_0x536cdb['options']);return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x117841){if(_0x117841){_0x4b5953=_0x117841[_0xaa41('0x37')];if(!_0x536cdb[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x18499f[_0xaa41('0x12')]=qs['limit'](_0x536cdb['query'][_0xaa41('0x12')]);_0x18499f[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x536cdb[_0xaa41('0x32')]['offset']);}return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x1be3c1){if(_0x1be3c1){return _0x1be3c1?{'count':_0x4b5953,'rows':_0x1be3c1}:null;}})[_0xaa41('0x17')](respondWithResult(_0x431b75,null))[_0xaa41('0x2f')](handleError(_0x431b75,null));};exports[_0xaa41('0xad')]=function(_0x42ae0c,_0x4fa4ca){var _0x1e41b5;return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x42ae0c[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4fa4ca,null))[_0xaa41('0x17')](function(_0x135f31){if(_0x135f31){return _0x135f31[_0xaa41('0xad')](_0x42ae0c[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x42ae0c['body'],[_0xaa41('0x70'),'id'])||{});}return null;})['spread'](function(_0x5eac30){var _0x3e28b7;_0x1e41b5=_0x5eac30||[];var _0x1ac854=[];if(_0x5eac30){for(var _0x187bf9=0x0;_0x187bf9<_0x5eac30['length'];_0x187bf9+=0x1){var _0x50fa22=_0x5eac30[_0x187bf9][_0xaa41('0x18')]({'plain':!![]});_0x3e28b7=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0xae'))['fromQuery']([_0xaa41('0x93'),'ContactId',_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),'updatedAt'],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x50fa22['CmListId'][_0xaa41('0x7a')](),'ListId')['field'](_0x42ae0c['params']['id'][_0xaa41('0x7a')](),'VoiceQueueId')[_0xaa41('0x71')]('NOW()','createdAt')[_0xaa41('0x71')](_0xaa41('0xaf'),_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))[_0xaa41('0x2a')](_0xaa41('0x9a'),_0x50fa22['CmListId'][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))['toString']();_0x1ac854[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x3e28b7));}return BPromise['all'](_0x1ac854);}})[_0xaa41('0x17')](function(){return _0x1e41b5;})[_0xaa41('0x17')](respondWithResult(_0x4fa4ca,null))['catch'](handleError(_0x4fa4ca,null));};exports[_0xaa41('0xb0')]=function(_0x2edb93,_0x4e34c2){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4e34c2,null))[_0xaa41('0x17')](function(_0x17b359){if(_0x17b359){return _0x17b359['removeBlackLists'](_0x2edb93['query']['ids']);}})['then'](function(_0x5b820b){if(_0x5b820b){return db[_0xaa41('0x58')][_0xaa41('0x23')]({'where':{'ListId':_0x2edb93[_0xaa41('0x32')][_0xaa41('0x70')],'VoiceQueueId':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x5b820b;});}})[_0xaa41('0x17')](respondWithStatusCode(_0x4e34c2,null))[_0xaa41('0x2f')](handleError(_0x4e34c2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 73b8e66..8bb9779 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 _0x2caa=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4edec6,_0x2205eb){var _0x711f42=function(_0x2b463a){while(--_0x2b463a){_0x4edec6['push'](_0x4edec6['shift']());}};_0x711f42(++_0x2205eb);}(_0x2caa,0x1c9));var _0xa2ca=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x2caa[_0xc77819];return _0x1c9434;};'use strict';var EventEmitter=require(_0xa2ca('0x0'));var VoiceQueue=require(_0xa2ca('0x1'))['db'][_0xa2ca('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa2ca('0x3')](0x0);var events={'afterCreate':_0xa2ca('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e0d9d){return function(_0x159259,_0x24c71b,_0xc9e5dc){VoiceQueueEvents[_0xa2ca('0x5')](_0x4e0d9d+':'+_0x159259['id'],_0x159259);VoiceQueueEvents[_0xa2ca('0x5')](_0x4e0d9d,_0x159259);_0xc9e5dc(null);};}for(var e in events){if(events[_0xa2ca('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xa2ca('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x9530=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9530,0xa1));var _0x0953=function(_0x26f830,_0x48f9ca){_0x26f830=_0x26f830-0x0;var _0x50b0e5=_0x9530[_0x26f830];return _0x50b0e5;};'use strict';var EventEmitter=require(_0x0953('0x0'));var VoiceQueue=require(_0x0953('0x1'))['db'][_0x0953('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0953('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0953('0x4'),'afterDestroy':_0x0953('0x5')};function emitEvent(_0x37d93b){return function(_0x1ce3df,_0x37d468,_0x599f4a){VoiceQueueEvents['emit'](_0x37d93b+':'+_0x1ce3df['id'],_0x1ce3df);VoiceQueueEvents[_0x0953('0x6')](_0x37d93b,_0x1ce3df);_0x599f4a(null);};}for(var e in events){if(events[_0x0953('0x7')](e)){var event=events[e];VoiceQueue[_0x0953('0x8')](e,emitEvent(event));}}module[_0x0953('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 17487f2..7fd2868 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3f9dc9,_0x7bdc2c){var _0x1276ae=function(_0x560b6e){while(--_0x560b6e){_0x3f9dc9['push'](_0x3f9dc9['shift']());}};_0x1276ae(++_0x7bdc2c);}(_0x34e8,0x12c));var _0x834e=function(_0x357c0e,_0x3b844e){_0x357c0e=_0x357c0e-0x0;var _0x57815a=_0x34e8[_0x357c0e];return _0x57815a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x008c,0x188));var _0xc008=function(_0x1a61db,_0x3ad3af){_0x1a61db=_0x1a61db-0x0;var _0x5ac3bf=_0x008c[_0x1a61db];return _0x5ac3bf;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 0620d58..ee07632 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 _0xcb31=['map','model','GetVoiceQueue','ShowVoiceQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xcb31,0x155));var _0x1cb3=function(_0xfa7822,_0x48848e){_0xfa7822=_0xfa7822-0x0;var _0x378620=_0xcb31[_0xfa7822];return _0x378620;};'use strict';var _=require(_0x1cb3('0x0'));var util=require(_0x1cb3('0x1'));var moment=require('moment');var BPromise=require(_0x1cb3('0x2'));var rs=require(_0x1cb3('0x3'));var fs=require('fs');var Redis=require(_0x1cb3('0x4'));var db=require(_0x1cb3('0x5'))['db'];var utils=require(_0x1cb3('0x6'));var logger=require('../../config/logger')(_0x1cb3('0x7'));var config=require(_0x1cb3('0x8'));var jayson=require(_0x1cb3('0x9'));var client=jayson[_0x1cb3('0xa')][_0x1cb3('0xb')]({'port':0x232a});config[_0x1cb3('0xc')]=_[_0x1cb3('0xd')](config['redis'],{'host':_0x1cb3('0xe'),'port':0x18eb});var socket=require(_0x1cb3('0xf'))(new Redis(config[_0x1cb3('0xc')]));require('./voiceQueue.socket')[_0x1cb3('0x10')](socket);function respondWithRpcPromise(_0x11f39c,_0x1cfe5f,_0x2ce95c){return new BPromise(function(_0x13aa97,_0x4760fa){return client[_0x1cb3('0x11')](_0x11f39c,_0x2ce95c)[_0x1cb3('0x12')](function(_0x25d11b){logger[_0x1cb3('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x1cfe5f,_0x1cb3('0x14'));logger[_0x1cb3('0x15')](_0x1cb3('0x16'),_0x1cfe5f,_0x1cb3('0x14'),JSON['stringify'](_0x25d11b));if(_0x25d11b[_0x1cb3('0x17')]){if(_0x25d11b[_0x1cb3('0x17')][_0x1cb3('0x18')]===0x1f4){logger[_0x1cb3('0x17')](_0x1cb3('0x19'),_0x1cfe5f,_0x25d11b[_0x1cb3('0x17')][_0x1cb3('0x1a')]);return _0x4760fa(_0x25d11b[_0x1cb3('0x17')]['message']);}logger[_0x1cb3('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x1cfe5f,_0x25d11b[_0x1cb3('0x17')][_0x1cb3('0x1a')]);return _0x13aa97(_0x25d11b[_0x1cb3('0x17')][_0x1cb3('0x1a')]);}else{logger[_0x1cb3('0x13')](_0x1cb3('0x19'),_0x1cfe5f,_0x1cb3('0x14'));_0x13aa97(_0x25d11b[_0x1cb3('0x1b')][_0x1cb3('0x1a')]);}})[_0x1cb3('0x1c')](function(_0x321a8d){logger[_0x1cb3('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x1cfe5f,_0x321a8d);_0x4760fa(_0x321a8d);});});}exports['GetVoiceQueue']=function(_0x1a1ae0){var _0x8f3457=this;return new Promise(function(_0x3c1ce4,_0x464e6e){return db[_0x1cb3('0x1d')][_0x1cb3('0x1e')]({'raw':_0x1a1ae0[_0x1cb3('0x1f')]?_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x20')]===undefined?!![]:![]:!![],'where':_0x1a1ae0['options']?_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x21')]||null:null,'attributes':_0x1a1ae0['options']?_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x22')]||null:null,'limit':_0x1a1ae0[_0x1cb3('0x1f')]?_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x23')]||null:null,'include':_0x1a1ae0[_0x1cb3('0x1f')]?_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x24')]?_[_0x1cb3('0x25')](_0x1a1ae0[_0x1cb3('0x1f')][_0x1cb3('0x24')],function(_0x58f343){return{'model':db[_0x58f343[_0x1cb3('0x26')]],'as':_0x58f343['as'],'attributes':_0x58f343[_0x1cb3('0x22')],'include':_0x58f343[_0x1cb3('0x24')]?_[_0x1cb3('0x25')](_0x58f343[_0x1cb3('0x24')],function(_0x1ad7d2){return{'model':db[_0x1ad7d2[_0x1cb3('0x26')]],'as':_0x1ad7d2['as'],'attributes':_0x1ad7d2[_0x1cb3('0x22')],'include':_0x1ad7d2[_0x1cb3('0x24')]?_['map'](_0x1ad7d2['include'],function(_0x5e7768){return{'model':db[_0x5e7768[_0x1cb3('0x26')]],'as':_0x5e7768['as'],'attributes':_0x5e7768[_0x1cb3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196d8f){logger[_0x1cb3('0x13')](_0x1cb3('0x27'),_0x1a1ae0);logger[_0x1cb3('0x15')]('GetVoiceQueue',_0x1a1ae0,JSON['stringify'](_0x196d8f));_0x3c1ce4(_0x196d8f);})[_0x1cb3('0x1c')](function(_0x1bac00){logger['error'](_0x1cb3('0x27'),_0x1bac00[_0x1cb3('0x1a')],_0x1a1ae0);_0x464e6e(_0x8f3457[_0x1cb3('0x17')](0x1f4,_0x1bac00[_0x1cb3('0x1a')]));});});};exports[_0x1cb3('0x28')]=function(_0x56806f){var _0xa5bb60=this;return new Promise(function(_0x59fbd0,_0x5189e7){return db['VoiceQueue']['find']({'raw':_0x56806f['options']?_0x56806f[_0x1cb3('0x1f')][_0x1cb3('0x20')]===undefined?!![]:![]:!![],'where':_0x56806f[_0x1cb3('0x1f')]?_0x56806f['options'][_0x1cb3('0x21')]||null:null,'attributes':_0x56806f[_0x1cb3('0x1f')]?_0x56806f['options'][_0x1cb3('0x22')]||null:null,'include':_0x56806f[_0x1cb3('0x1f')]?_0x56806f[_0x1cb3('0x1f')][_0x1cb3('0x24')]?_[_0x1cb3('0x25')](_0x56806f[_0x1cb3('0x1f')][_0x1cb3('0x24')],function(_0x5a4d21){return{'model':db[_0x5a4d21['model']],'as':_0x5a4d21['as'],'attributes':_0x5a4d21['attributes'],'include':_0x5a4d21['include']?_['map'](_0x5a4d21[_0x1cb3('0x24')],function(_0xde3940){return{'model':db[_0xde3940[_0x1cb3('0x26')]],'as':_0xde3940['as'],'attributes':_0xde3940[_0x1cb3('0x22')],'include':_0xde3940[_0x1cb3('0x24')]?_[_0x1cb3('0x25')](_0xde3940[_0x1cb3('0x24')],function(_0x146c98){return{'model':db[_0x146c98[_0x1cb3('0x26')]],'as':_0x146c98['as'],'attributes':_0x146c98[_0x1cb3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37107c){logger[_0x1cb3('0x13')](_0x1cb3('0x28'),_0x56806f);logger['debug'](_0x1cb3('0x28'),_0x56806f,JSON[_0x1cb3('0x29')](_0x37107c));_0x59fbd0(_0x37107c);})[_0x1cb3('0x1c')](function(_0x576d05){logger[_0x1cb3('0x17')](_0x1cb3('0x28'),_0x576d05[_0x1cb3('0x1a')],_0x56806f);_0x5189e7(_0xa5bb60[_0x1cb3('0x17')](0x1f4,_0x576d05['message']));});});}; \ No newline at end of file +var _0x2827=['find','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','include','map','attributes','model','debug','stringify','ShowVoiceQueue'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x2827,0x7a));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7282('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7282('0x1'));var rs=require(_0x7282('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7282('0x3'))['db'];var utils=require(_0x7282('0x4'));var logger=require(_0x7282('0x5'))(_0x7282('0x6'));var config=require(_0x7282('0x7'));var jayson=require(_0x7282('0x8'));var client=jayson[_0x7282('0x9')][_0x7282('0xa')]({'port':0x232a});config[_0x7282('0xb')]=_[_0x7282('0xc')](config[_0x7282('0xb')],{'host':_0x7282('0xd'),'port':0x18eb});var socket=require(_0x7282('0xe'))(new Redis(config[_0x7282('0xb')]));require(_0x7282('0xf'))[_0x7282('0x10')](socket);function respondWithRpcPromise(_0x12829a,_0x26786d,_0x3b1d3b){return new BPromise(function(_0x12cdf6,_0x88d5bf){return client[_0x7282('0x11')](_0x12829a,_0x3b1d3b)[_0x7282('0x12')](function(_0x3eda53){logger[_0x7282('0x13')](_0x7282('0x14'),_0x26786d,_0x7282('0x15'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x26786d,'request\x20sent',JSON['stringify'](_0x3eda53));if(_0x3eda53[_0x7282('0x16')]){if(_0x3eda53[_0x7282('0x16')][_0x7282('0x17')]===0x1f4){logger[_0x7282('0x16')](_0x7282('0x14'),_0x26786d,_0x3eda53['error'][_0x7282('0x18')]);return _0x88d5bf(_0x3eda53['error'][_0x7282('0x18')]);}logger[_0x7282('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x26786d,_0x3eda53[_0x7282('0x16')][_0x7282('0x18')]);return _0x12cdf6(_0x3eda53['error']['message']);}else{logger[_0x7282('0x13')](_0x7282('0x14'),_0x26786d,_0x7282('0x15'));_0x12cdf6(_0x3eda53[_0x7282('0x19')][_0x7282('0x18')]);}})[_0x7282('0x1a')](function(_0x1ae5b2){logger[_0x7282('0x16')](_0x7282('0x14'),_0x26786d,_0x1ae5b2);_0x88d5bf(_0x1ae5b2);});});}exports[_0x7282('0x1b')]=function(_0x28975a){var _0x100933=this;return new Promise(function(_0x487a3a,_0x9a75f0){return db[_0x7282('0x1c')]['findAll']({'raw':_0x28975a[_0x7282('0x1d')]?_0x28975a[_0x7282('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x28975a[_0x7282('0x1d')]?_0x28975a[_0x7282('0x1d')][_0x7282('0x1e')]||null:null,'attributes':_0x28975a[_0x7282('0x1d')]?_0x28975a[_0x7282('0x1d')]['attributes']||null:null,'limit':_0x28975a[_0x7282('0x1d')]?_0x28975a['options']['limit']||null:null,'include':_0x28975a[_0x7282('0x1d')]?_0x28975a[_0x7282('0x1d')][_0x7282('0x1f')]?_[_0x7282('0x20')](_0x28975a[_0x7282('0x1d')][_0x7282('0x1f')],function(_0x45a235){return{'model':db[_0x45a235['model']],'as':_0x45a235['as'],'attributes':_0x45a235[_0x7282('0x21')],'include':_0x45a235['include']?_[_0x7282('0x20')](_0x45a235['include'],function(_0x31d5b8){return{'model':db[_0x31d5b8[_0x7282('0x22')]],'as':_0x31d5b8['as'],'attributes':_0x31d5b8[_0x7282('0x21')],'include':_0x31d5b8[_0x7282('0x1f')]?_[_0x7282('0x20')](_0x31d5b8['include'],function(_0x4ef9a2){return{'model':db[_0x4ef9a2[_0x7282('0x22')]],'as':_0x4ef9a2['as'],'attributes':_0x4ef9a2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c617b){logger['info'](_0x7282('0x1b'),_0x28975a);logger[_0x7282('0x23')](_0x7282('0x1b'),_0x28975a,JSON[_0x7282('0x24')](_0x2c617b));_0x487a3a(_0x2c617b);})[_0x7282('0x1a')](function(_0x3e7832){logger[_0x7282('0x16')](_0x7282('0x1b'),_0x3e7832['message'],_0x28975a);_0x9a75f0(_0x100933[_0x7282('0x16')](0x1f4,_0x3e7832[_0x7282('0x18')]));});});};exports[_0x7282('0x25')]=function(_0x44a4d2){var _0x1c5b21=this;return new Promise(function(_0x2ea555,_0x5b576b){return db[_0x7282('0x1c')][_0x7282('0x26')]({'raw':_0x44a4d2['options']?_0x44a4d2[_0x7282('0x1d')][_0x7282('0x27')]===undefined?!![]:![]:!![],'where':_0x44a4d2['options']?_0x44a4d2[_0x7282('0x1d')][_0x7282('0x1e')]||null:null,'attributes':_0x44a4d2[_0x7282('0x1d')]?_0x44a4d2[_0x7282('0x1d')]['attributes']||null:null,'include':_0x44a4d2[_0x7282('0x1d')]?_0x44a4d2[_0x7282('0x1d')]['include']?_['map'](_0x44a4d2[_0x7282('0x1d')][_0x7282('0x1f')],function(_0x218975){return{'model':db[_0x218975[_0x7282('0x22')]],'as':_0x218975['as'],'attributes':_0x218975[_0x7282('0x21')],'include':_0x218975[_0x7282('0x1f')]?_[_0x7282('0x20')](_0x218975['include'],function(_0x4ec7f3){return{'model':db[_0x4ec7f3['model']],'as':_0x4ec7f3['as'],'attributes':_0x4ec7f3[_0x7282('0x21')],'include':_0x4ec7f3[_0x7282('0x1f')]?_[_0x7282('0x20')](_0x4ec7f3[_0x7282('0x1f')],function(_0x30db8e){return{'model':db[_0x30db8e[_0x7282('0x22')]],'as':_0x30db8e['as'],'attributes':_0x30db8e[_0x7282('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e4227){logger[_0x7282('0x13')](_0x7282('0x25'),_0x44a4d2);logger[_0x7282('0x23')](_0x7282('0x25'),_0x44a4d2,JSON[_0x7282('0x24')](_0x5e4227));_0x2ea555(_0x5e4227);})[_0x7282('0x1a')](function(_0x58d5a6){logger[_0x7282('0x16')](_0x7282('0x25'),_0x58d5a6[_0x7282('0x18')],_0x44a4d2);_0x5b576b(_0x1c5b21[_0x7282('0x16')](0x1f4,_0x58d5a6[_0x7282('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c70191c..d620f41 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 _0xef10=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x4b5db9,_0x4d8616){var _0x397126=function(_0x2c5ba1){while(--_0x2c5ba1){_0x4b5db9['push'](_0x4b5db9['shift']());}};_0x397126(++_0x4d8616);}(_0xef10,0x97));var _0x0ef1=function(_0x5e4cb9,_0x2c41fb){_0x5e4cb9=_0x5e4cb9-0x0;var _0x1b8b0c=_0xef10[_0x5e4cb9];return _0x1b8b0c;};'use strict';var VoiceQueueEvents=require(_0x0ef1('0x0'));var events=[_0x0ef1('0x1'),_0x0ef1('0x2'),_0x0ef1('0x3')];function createListener(_0x26c6fb,_0x5ae4a3){return function(_0x139f7a){_0x5ae4a3[_0x0ef1('0x4')](_0x26c6fb,_0x139f7a);};}function removeListener(_0x382ce2,_0x442887){return function(){VoiceQueueEvents[_0x0ef1('0x5')](_0x382ce2,_0x442887);};}exports[_0x0ef1('0x6')]=function(_0x26aa38){for(var _0x72b521=0x0,_0x57d885=events[_0x0ef1('0x7')];_0x72b521<_0x57d885;_0x72b521++){var _0xc66d8c=events[_0x72b521];var _0x6aee62=createListener(_0x0ef1('0x8')+_0xc66d8c,_0x26aa38);VoiceQueueEvents['on'](_0xc66d8c,_0x6aee62);}}; \ No newline at end of file +var _0xc734=['register','length','voiceQueue:','save','remove','update','emit','removeListener'];(function(_0x2e3e2a,_0x55a830){var _0x29feb4=function(_0x5c90b1){while(--_0x5c90b1){_0x2e3e2a['push'](_0x2e3e2a['shift']());}};_0x29feb4(++_0x55a830);}(_0xc734,0x73));var _0x4c73=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xc734[_0x2a56ad];return _0x425175;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x4c73('0x0'),_0x4c73('0x1'),_0x4c73('0x2')];function createListener(_0xd74c6e,_0x5d4ead){return function(_0x2fb07e){_0x5d4ead[_0x4c73('0x3')](_0xd74c6e,_0x2fb07e);};}function removeListener(_0x4ff92c,_0x227ca0){return function(){VoiceQueueEvents[_0x4c73('0x4')](_0x4ff92c,_0x227ca0);};}exports[_0x4c73('0x5')]=function(_0x3f478d){for(var _0x27cfc2=0x0,_0x212daa=events[_0x4c73('0x6')];_0x27cfc2<_0x212daa;_0x27cfc2++){var _0x45285f=events[_0x27cfc2];var _0x4d7681=createListener(_0x4c73('0x7')+_0x45285f,_0x3f478d);VoiceQueueEvents['on'](_0x45285f,_0x4d7681);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 94feddc..1522b28 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 _0xf949=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xf949,0xf9));var _0x9f94=function(_0x1ed16b,_0x544467){_0x1ed16b=_0x1ed16b-0x0;var _0x104dfa=_0xf949[_0x1ed16b];return _0x104dfa;};'use strict';var multer=require(_0x9f94('0x0'));var util=require(_0x9f94('0x1'));var path=require(_0x9f94('0x2'));var timeout=require(_0x9f94('0x3'));var express=require(_0x9f94('0x4'));var router=express[_0x9f94('0x5')]();var fs_extra=require(_0x9f94('0x6'));var auth=require(_0x9f94('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x9f94('0x8')](),controller[_0x9f94('0x9')]);router[_0x9f94('0xa')](_0x9f94('0xb'),auth[_0x9f94('0x8')](),controller[_0x9f94('0xc')]);router[_0x9f94('0xa')](_0x9f94('0xd'),auth[_0x9f94('0x8')](),controller[_0x9f94('0xe')]);router[_0x9f94('0xa')]('/:id',auth[_0x9f94('0x8')](),controller['show']);router[_0x9f94('0xf')]('/',auth[_0x9f94('0x8')](),controller[_0x9f94('0x10')]);router[_0x9f94('0x11')](_0x9f94('0x12'),auth[_0x9f94('0x8')](),controller[_0x9f94('0x13')]);router['delete'](_0x9f94('0x12'),auth['isAuthenticated'](),controller[_0x9f94('0x14')]);module[_0x9f94('0x15')]=router; \ No newline at end of file +var _0x650d=['/:id','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','getVoiceQueuesReport'];(function(_0x244e6b,_0xf444b4){var _0x7a0bd6=function(_0x24b66c){while(--_0x24b66c){_0x244e6b['push'](_0x244e6b['shift']());}};_0x7a0bd6(++_0xf444b4);}(_0x650d,0x1af));var _0xd650=function(_0x24c086,_0x58503a){_0x24c086=_0x24c086-0x0;var _0x437816=_0x650d[_0x24c086];return _0x437816;};'use strict';var multer=require(_0xd650('0x0'));var util=require('util');var path=require(_0xd650('0x1'));var timeout=require(_0xd650('0x2'));var express=require(_0xd650('0x3'));var router=express['Router']();var fs_extra=require(_0xd650('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd650('0x5'));var config=require('../../config/environment');var controller=require(_0xd650('0x6'));router[_0xd650('0x7')]('/',auth[_0xd650('0x8')](),controller['index']);router['get'](_0xd650('0x9'),auth[_0xd650('0x8')](),controller['describe']);router[_0xd650('0x7')]('/index',auth[_0xd650('0x8')](),controller[_0xd650('0xa')]);router[_0xd650('0x7')](_0xd650('0xb'),auth[_0xd650('0x8')](),controller['show']);router[_0xd650('0xc')]('/',auth[_0xd650('0x8')](),controller['create']);router[_0xd650('0xd')](_0xd650('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd650('0xe')](_0xd650('0xb'),auth[_0xd650('0x8')](),controller[_0xd650('0xf')]);module[_0xd650('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index fae24cf..a19b7d7 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 _0x5aa7=['seconds','setDataValue','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5aa7,0x12b));var _0x75aa=function(_0x49dc86,_0x1fe338){_0x49dc86=_0x49dc86-0x0;var _0x5c7a9e=_0x5aa7[_0x49dc86];return _0x5c7a9e;};'use strict';var Sequelize=require(_0x75aa('0x0'));var moment=require(_0x75aa('0x1'));module[_0x75aa('0x2')]={'type':{'type':Sequelize[_0x75aa('0x3')]},'uniqueid':{'type':Sequelize[_0x75aa('0x3')]},'calleridnum':{'type':Sequelize[_0x75aa('0x3')]},'calleridname':{'type':Sequelize[_0x75aa('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x75aa('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x75aa('0x4')],'set':function(_0x4359eb){var _0x3dc13f=moment(_0x4359eb);var _0x5c1859=moment(this['getDataValue'](_0x75aa('0x5')))[_0x75aa('0x6')](_0x75aa('0x7'));var _0x5692a0=_0x3dc13f[_0x75aa('0x8')](_0x5c1859,_0x75aa('0x9'));this[_0x75aa('0xa')]('queuecallerleaveAt',_0x4359eb);this[_0x75aa('0xa')]('holdtime',_0x5692a0||null);}},'position':{'type':Sequelize[_0x75aa('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x75aa('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x75aa('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x75aa('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x75aa('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x75aa('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x75aa('0x3')]},'connectedlinename':{'type':Sequelize[_0x75aa('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x75aa('0x3')]},'exten':{'type':Sequelize[_0x75aa('0x3')]},'priority':{'type':Sequelize[_0x75aa('0x3')]},'holdtime':{'type':Sequelize[_0x75aa('0xb')]},'mohtime':{'type':Sequelize[_0x75aa('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x75aa('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x75aa('0x3')],'comment':_0x75aa('0xd')},'transferexten':{'type':Sequelize[_0x75aa('0x3')]},'transferuniqueid':{'type':Sequelize[_0x75aa('0x3')]},'disposition':{'type':Sequelize[_0x75aa('0x3')]},'secondDisposition':{'type':Sequelize[_0x75aa('0x3')]},'thirdDisposition':{'type':Sequelize[_0x75aa('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x75aa('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x75aa('0x3')]}}; \ No newline at end of file +var _0x548a=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER'];(function(_0x4aaa94,_0x3005e7){var _0x29aec2=function(_0x373437){while(--_0x373437){_0x4aaa94['push'](_0x4aaa94['shift']());}};_0x29aec2(++_0x3005e7);}(_0x548a,0xbe));var _0xa548=function(_0x43f235,_0x39b271){_0x43f235=_0x43f235-0x0;var _0x29cdda=_0x548a[_0x43f235];return _0x29cdda;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa548('0x0'));module[_0xa548('0x1')]={'type':{'type':Sequelize[_0xa548('0x2')]},'uniqueid':{'type':Sequelize[_0xa548('0x2')]},'calleridnum':{'type':Sequelize[_0xa548('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa548('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xa548('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1a1f35){var _0x107d98=moment(_0x1a1f35);var _0x45a97d=moment(this[_0xa548('0x4')](_0xa548('0x5')))[_0xa548('0x6')](_0xa548('0x7'));var _0x1fc0a7=_0x107d98[_0xa548('0x8')](_0x45a97d,_0xa548('0x9'));this['setDataValue'](_0xa548('0xa'),_0x1a1f35);this[_0xa548('0xb')](_0xa548('0xc'),_0x1fc0a7||null);}},'position':{'type':Sequelize[_0xa548('0xd')]},'count':{'type':Sequelize[_0xa548('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xa548('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa548('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xa548('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xa548('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa548('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xa548('0x2')],'comment':_0xa548('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xa548('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa548('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa548('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa548('0x2')]},'holdtime':{'type':Sequelize[_0xa548('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa548('0x2')]},'transfer':{'type':Sequelize[_0xa548('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa548('0x2')],'comment':_0xa548('0x10')},'transferexten':{'type':Sequelize[_0xa548('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa548('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xa548('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xa548('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index b4b437d..d985a04 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 _0x4068=['crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','VoiceQueueReport','fieldName','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x25ca7b,_0x15613c){var _0x4802ff=function(_0x154774){while(--_0x154774){_0x25ca7b['push'](_0x25ca7b['shift']());}};_0x4802ff(++_0x15613c);}(_0x4068,0x134));var _0x8406=function(_0x123b73,_0x304aa6){_0x123b73=_0x123b73-0x0;var _0x46844b=_0x4068[_0x123b73];return _0x46844b;};'use strict';var emlformat=require(_0x8406('0x0'));var rimraf=require(_0x8406('0x1'));var zipdir=require(_0x8406('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8406('0x3'));var BPromise=require(_0x8406('0x4'));var Mustache=require(_0x8406('0x5'));var util=require(_0x8406('0x6'));var path=require('path');var sox=require(_0x8406('0x7'));var csv=require(_0x8406('0x8'));var ejs=require(_0x8406('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8406('0xa'));var squel=require(_0x8406('0xb'));var crypto=require(_0x8406('0xc'));var jsforce=require(_0x8406('0xd'));var deskjs=require(_0x8406('0xe'));var toCsv=require(_0x8406('0x8'));var querystring=require(_0x8406('0xf'));var Papa=require('papaparse');var Redis=require(_0x8406('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8406('0x11'));var as=require(_0x8406('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8406('0x13'))(_0x8406('0x14'));var utils=require(_0x8406('0x15'));var config=require(_0x8406('0x16'));var licenseUtil=require(_0x8406('0x17'));var db=require(_0x8406('0x18'))['db'];config[_0x8406('0x19')]=_[_0x8406('0x1a')](config[_0x8406('0x19')],{'host':_0x8406('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8406('0x1c'))['register'](socket);function respondWithStatusCode(_0x34085a,_0x53ef12){_0x53ef12=_0x53ef12||0xcc;return function(_0x19bb33){if(_0x19bb33){return _0x34085a['sendStatus'](_0x53ef12);}return _0x34085a[_0x8406('0x1d')](_0x53ef12)['end']();};}function respondWithResult(_0x3ec972,_0x5ce6af){_0x5ce6af=_0x5ce6af||0xc8;return function(_0x1483b3){if(_0x1483b3){return _0x3ec972['status'](_0x5ce6af)[_0x8406('0x1e')](_0x1483b3);}};}function respondWithFilteredResult(_0x23a35b,_0x1a2fbd){return function(_0x1836a8){if(_0x1836a8){var _0x1edcef=typeof _0x1a2fbd[_0x8406('0x1f')]===_0x8406('0x20')&&typeof _0x1a2fbd[_0x8406('0x21')]===_0x8406('0x20');var _0x1b4537=_0x1836a8[_0x8406('0x22')];var _0x49e795=_0x1edcef?0x0:_0x1a2fbd['offset'];var _0x3e5db2=_0x1edcef?_0x1836a8[_0x8406('0x22')]:_0x1a2fbd['offset']+_0x1a2fbd[_0x8406('0x21')];var _0x52b3d7;if(_0x3e5db2>=_0x1b4537){_0x3e5db2=_0x1b4537;_0x52b3d7=0xc8;}else{_0x52b3d7=0xce;}_0x23a35b[_0x8406('0x1d')](_0x52b3d7);return _0x23a35b[_0x8406('0x23')](_0x8406('0x24'),_0x49e795+'-'+_0x3e5db2+'/'+_0x1b4537)[_0x8406('0x1e')](_0x1836a8);}return null;};}function patchUpdates(_0x5f03a5){return function(_0x22a926){try{jsonpatch[_0x8406('0x25')](_0x22a926,_0x5f03a5,!![]);}catch(_0x55ae57){return BPromise[_0x8406('0x26')](_0x55ae57);}return _0x22a926[_0x8406('0x27')]();};}function saveUpdates(_0x35a482,_0x430673){return function(_0x10bba0){if(_0x10bba0){return _0x10bba0[_0x8406('0x28')](_0x35a482)['then'](function(_0xd2132b){return _0xd2132b;});}return null;};}function removeEntity(_0x1066f0,_0x5cc5f7){return function(_0xc07d6f){if(_0xc07d6f){return _0xc07d6f[_0x8406('0x29')]()[_0x8406('0x2a')](function(){_0x1066f0[_0x8406('0x1d')](0xcc)[_0x8406('0x2b')]();});}};}function handleEntityNotFound(_0x107f41,_0x4309c0){return function(_0x3ecdea){if(!_0x3ecdea){_0x107f41[_0x8406('0x2c')](0x194);}return _0x3ecdea;};}function handleError(_0x4ca94e,_0x43bfef){_0x43bfef=_0x43bfef||0x1f4;return function(_0x25ada8){logger[_0x8406('0x2d')](_0x25ada8[_0x8406('0x2e')]);if(_0x25ada8[_0x8406('0x2f')]){delete _0x25ada8[_0x8406('0x2f')];}_0x4ca94e[_0x8406('0x1d')](_0x43bfef)['send'](_0x25ada8);};}exports[_0x8406('0x30')]=function(_0x5583ee,_0x1915c5){var _0x396a30={},_0x2159d2={},_0x3ac2e9={'count':0x0,'rows':[]};var _0x1eff2d=_[_0x8406('0x31')](db[_0x8406('0x32')]['rawAttributes'],function(_0x303355){return{'name':_0x303355[_0x8406('0x33')],'type':_0x303355['type']['key']};});_0x2159d2['model']=_[_0x8406('0x31')](_0x1eff2d,_0x8406('0x2f'));_0x2159d2[_0x8406('0x34')]=_[_0x8406('0x35')](_0x5583ee[_0x8406('0x34')]);_0x2159d2['filters']=_['intersection'](_0x2159d2[_0x8406('0x36')],_0x2159d2[_0x8406('0x34')]);_0x396a30[_0x8406('0x37')]=_[_0x8406('0x38')](_0x2159d2[_0x8406('0x36')],qs[_0x8406('0x39')](_0x5583ee[_0x8406('0x34')][_0x8406('0x39')]));_0x396a30[_0x8406('0x37')]=_0x396a30[_0x8406('0x37')][_0x8406('0x3a')]?_0x396a30['attributes']:_0x2159d2[_0x8406('0x36')];if(!_0x5583ee[_0x8406('0x34')]['hasOwnProperty'](_0x8406('0x3b'))){_0x396a30['limit']=qs[_0x8406('0x21')](_0x5583ee[_0x8406('0x34')][_0x8406('0x21')]);_0x396a30['offset']=qs[_0x8406('0x1f')](_0x5583ee['query']['offset']);}_0x396a30[_0x8406('0x3c')]=qs['sort'](_0x5583ee[_0x8406('0x34')][_0x8406('0x3d')]);_0x396a30[_0x8406('0x3e')]=qs[_0x8406('0x3f')](_[_0x8406('0x40')](_0x5583ee['query'],_0x2159d2[_0x8406('0x3f')]),_0x1eff2d);if(_0x5583ee['query']['filter']){_0x396a30[_0x8406('0x3e')]=_[_0x8406('0x41')](_0x396a30[_0x8406('0x3e')],{'$or':_[_0x8406('0x31')](_0x1eff2d,function(_0x39fdd7){if(_0x39fdd7['type']!=='VIRTUAL'){var _0x57385b={};_0x57385b[_0x39fdd7['name']]={'$like':'%'+_0x5583ee[_0x8406('0x34')][_0x8406('0x42')]+'%'};return _0x57385b;}})});}_0x396a30=_[_0x8406('0x41')]({},_0x396a30,_0x5583ee[_0x8406('0x43')]);var _0x26ed3d={'where':_0x396a30['where']};return db[_0x8406('0x32')][_0x8406('0x22')](_0x26ed3d)['then'](function(_0x36426a){_0x3ac2e9[_0x8406('0x22')]=_0x36426a;if(_0x5583ee[_0x8406('0x34')]['includeAll']){_0x396a30[_0x8406('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8406('0x45')](_0x396a30);})[_0x8406('0x2a')](function(_0x3d64b0){_0x3ac2e9[_0x8406('0x46')]=_0x3d64b0;return _0x3ac2e9;})['then'](respondWithFilteredResult(_0x1915c5,_0x396a30))[_0x8406('0x47')](handleError(_0x1915c5,null));};exports['show']=function(_0x109ebb,_0x85c3e9){var _0x4ac967={'raw':![],'where':{'id':_0x109ebb['params']['id']}},_0x1dd7a5={};_0x1dd7a5[_0x8406('0x36')]=_['keys'](db['VoiceQueueReport'][_0x8406('0x48')]);_0x1dd7a5[_0x8406('0x34')]=_[_0x8406('0x35')](_0x109ebb[_0x8406('0x34')]);_0x1dd7a5[_0x8406('0x3f')]=_[_0x8406('0x38')](_0x1dd7a5[_0x8406('0x36')],_0x1dd7a5[_0x8406('0x34')]);_0x4ac967[_0x8406('0x37')]=_[_0x8406('0x38')](_0x1dd7a5[_0x8406('0x36')],qs['fields'](_0x109ebb[_0x8406('0x34')][_0x8406('0x39')]));_0x4ac967[_0x8406('0x37')]=_0x4ac967[_0x8406('0x37')]['length']?_0x4ac967['attributes']:_0x1dd7a5[_0x8406('0x36')];if(_0x109ebb[_0x8406('0x34')][_0x8406('0x49')]){_0x4ac967['include']=[{'all':!![]}];}_0x4ac967=_[_0x8406('0x41')]({},_0x4ac967,_0x109ebb[_0x8406('0x43')]);return db[_0x8406('0x32')][_0x8406('0x4a')](_0x4ac967)[_0x8406('0x2a')](handleEntityNotFound(_0x85c3e9,null))[_0x8406('0x2a')](respondWithResult(_0x85c3e9,null))['catch'](handleError(_0x85c3e9,null));};exports['create']=function(_0x4497f3,_0x5398a3){return db[_0x8406('0x32')][_0x8406('0x4b')](_0x4497f3['body'],{})[_0x8406('0x2a')](respondWithResult(_0x5398a3,0xc9))['catch'](handleError(_0x5398a3,null));};exports['update']=function(_0x482b2d,_0x24711b){if(_0x482b2d[_0x8406('0x4c')]['id']){delete _0x482b2d[_0x8406('0x4c')]['id'];}return db[_0x8406('0x32')]['find']({'where':{'id':_0x482b2d[_0x8406('0x4d')]['id']}})[_0x8406('0x2a')](handleEntityNotFound(_0x24711b,null))[_0x8406('0x2a')](saveUpdates(_0x482b2d[_0x8406('0x4c')],null))['then'](respondWithResult(_0x24711b,null))[_0x8406('0x47')](handleError(_0x24711b,null));};exports[_0x8406('0x29')]=function(_0xb5af66,_0x2a642c){return db[_0x8406('0x32')][_0x8406('0x4a')]({'where':{'id':_0xb5af66[_0x8406('0x4d')]['id']}})[_0x8406('0x2a')](handleEntityNotFound(_0x2a642c,null))[_0x8406('0x2a')](removeEntity(_0x2a642c,null))['catch'](handleError(_0x2a642c,null));};exports[_0x8406('0x4e')]=function(_0x3297af,_0x136b9c){return db[_0x8406('0x32')][_0x8406('0x4e')]()[_0x8406('0x2a')](respondWithResult(_0x136b9c,null))[_0x8406('0x47')](handleError(_0x136b9c,null));};exports['getVoiceQueuesReport']=function(_0x39b7d0,_0x3a28ef){var _0x22fcc6={},_0xb7f99a={},_0x2d410c={'count':0x0,'rows':[]};_0xb7f99a[_0x8406('0x36')]=_[_0x8406('0x35')](db['VoiceQueueReport']['rawAttributes']);_0xb7f99a[_0x8406('0x34')]=_['keys'](_0x39b7d0[_0x8406('0x34')]);_0xb7f99a[_0x8406('0x3f')]=_['intersection'](_0xb7f99a[_0x8406('0x36')],_0xb7f99a[_0x8406('0x34')]);_0x22fcc6[_0x8406('0x37')]=_[_0x8406('0x38')](_0xb7f99a[_0x8406('0x36')],qs[_0x8406('0x39')](_0x39b7d0[_0x8406('0x34')]['fields']));_0x22fcc6[_0x8406('0x37')]=_0x22fcc6[_0x8406('0x37')][_0x8406('0x3a')]?_0x22fcc6[_0x8406('0x37')]:_0xb7f99a[_0x8406('0x36')];if(!_0x39b7d0[_0x8406('0x34')]['hasOwnProperty'](_0x8406('0x3b'))){_0x22fcc6[_0x8406('0x21')]=qs[_0x8406('0x21')](_0x39b7d0[_0x8406('0x34')]['limit']);_0x22fcc6[_0x8406('0x1f')]=qs['offset'](_0x39b7d0[_0x8406('0x34')][_0x8406('0x1f')]);}_0x22fcc6[_0x8406('0x3c')]=qs['sort'](_0x39b7d0['query']['sort']);_0x22fcc6[_0x8406('0x3e')]=qs[_0x8406('0x3f')](_[_0x8406('0x40')](_0x39b7d0[_0x8406('0x34')],_0xb7f99a[_0x8406('0x3f')]));if(_0x39b7d0[_0x8406('0x34')][_0x8406('0x42')]){_0x22fcc6[_0x8406('0x3e')]=_['merge'](_0x22fcc6[_0x8406('0x3e')],{'$or':_[_0x8406('0x31')](_0x22fcc6[_0x8406('0x37')],function(_0x55b61c){var _0x47d512={};_0x47d512[_0x55b61c]={'$like':'%'+_0x39b7d0['query']['filter']+'%'};return _0x47d512;})});}_0x22fcc6=_['merge']({},_0x22fcc6,_0x39b7d0[_0x8406('0x43')]);var _0x12f911={'where':_0x22fcc6[_0x8406('0x3e')]};return db['VoiceQueueReport']['count'](_0x12f911)[_0x8406('0x2a')](function(_0x2b2e1e){_0x2d410c[_0x8406('0x22')]=_0x2b2e1e;if(_0x39b7d0[_0x8406('0x34')]['includeAll']){_0x22fcc6[_0x8406('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8406('0x45')](_0x22fcc6);})[_0x8406('0x2a')](function(_0x3ef349){_0x2d410c['rows']=_0x3ef349;return _0x2d410c;})[_0x8406('0x2a')](respondWithFilteredResult(_0x3a28ef,_0x22fcc6,'getVoiceQueuesReport'))[_0x8406('0x47')](handleError(_0x3a28ef,null,_0x8406('0x4f')));}; \ No newline at end of file +var _0xaf2d=['describe','getVoiceQueuesReport','nolimit','includeAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','include','VoiceQueueReport','findAll','rows','catch','show','params','keys','create','body','find'];(function(_0x379366,_0x149a3a){var _0x131499=function(_0x2ba8c6){while(--_0x2ba8c6){_0x379366['push'](_0x379366['shift']());}};_0x131499(++_0x149a3a);}(_0xaf2d,0x154));var _0xdaf2=function(_0x4aacc,_0x5e1c1c){_0x4aacc=_0x4aacc-0x0;var _0x238a13=_0xaf2d[_0x4aacc];return _0x238a13;};'use strict';var emlformat=require(_0xdaf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaf2('0x1'));var jsonpatch=require(_0xdaf2('0x2'));var rp=require('request-promise');var moment=require(_0xdaf2('0x3'));var BPromise=require(_0xdaf2('0x4'));var Mustache=require(_0xdaf2('0x5'));var util=require(_0xdaf2('0x6'));var path=require(_0xdaf2('0x7'));var sox=require(_0xdaf2('0x8'));var csv=require('to-csv');var ejs=require(_0xdaf2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaf2('0xa'));var squel=require('squel');var crypto=require(_0xdaf2('0xb'));var jsforce=require(_0xdaf2('0xc'));var deskjs=require(_0xdaf2('0xd'));var toCsv=require(_0xdaf2('0xe'));var querystring=require('querystring');var Papa=require(_0xdaf2('0xf'));var Redis=require('ioredis');var authService=require(_0xdaf2('0x10'));var qs=require(_0xdaf2('0x11'));var as=require(_0xdaf2('0x12'));var hardwareService=require(_0xdaf2('0x13'));var logger=require(_0xdaf2('0x14'))(_0xdaf2('0x15'));var utils=require(_0xdaf2('0x16'));var config=require(_0xdaf2('0x17'));var licenseUtil=require(_0xdaf2('0x18'));var db=require(_0xdaf2('0x19'))['db'];config[_0xdaf2('0x1a')]=_[_0xdaf2('0x1b')](config[_0xdaf2('0x1a')],{'host':_0xdaf2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdaf2('0x1a')]));require(_0xdaf2('0x1d'))['register'](socket);function respondWithStatusCode(_0x1102bd,_0x1533f2){_0x1533f2=_0x1533f2||0xcc;return function(_0xa0c814){if(_0xa0c814){return _0x1102bd[_0xdaf2('0x1e')](_0x1533f2);}return _0x1102bd['status'](_0x1533f2)['end']();};}function respondWithResult(_0x930637,_0x45c3de){_0x45c3de=_0x45c3de||0xc8;return function(_0x2e44ed){if(_0x2e44ed){return _0x930637['status'](_0x45c3de)[_0xdaf2('0x1f')](_0x2e44ed);}};}function respondWithFilteredResult(_0x1f2882,_0x485d3b){return function(_0x5ae3d9){if(_0x5ae3d9){var _0x47c241=typeof _0x485d3b[_0xdaf2('0x20')]===_0xdaf2('0x21')&&typeof _0x485d3b['limit']==='undefined';var _0x189514=_0x5ae3d9[_0xdaf2('0x22')];var _0x34b10d=_0x47c241?0x0:_0x485d3b['offset'];var _0x333f5f=_0x47c241?_0x5ae3d9['count']:_0x485d3b[_0xdaf2('0x20')]+_0x485d3b[_0xdaf2('0x23')];var _0x114512;if(_0x333f5f>=_0x189514){_0x333f5f=_0x189514;_0x114512=0xc8;}else{_0x114512=0xce;}_0x1f2882[_0xdaf2('0x24')](_0x114512);return _0x1f2882[_0xdaf2('0x25')](_0xdaf2('0x26'),_0x34b10d+'-'+_0x333f5f+'/'+_0x189514)[_0xdaf2('0x1f')](_0x5ae3d9);}return null;};}function patchUpdates(_0x54d375){return function(_0x3e5f9d){try{jsonpatch[_0xdaf2('0x27')](_0x3e5f9d,_0x54d375,!![]);}catch(_0x3ecab2){return BPromise[_0xdaf2('0x28')](_0x3ecab2);}return _0x3e5f9d[_0xdaf2('0x29')]();};}function saveUpdates(_0x165aa3,_0x1cdd21){return function(_0x1029fc){if(_0x1029fc){return _0x1029fc[_0xdaf2('0x2a')](_0x165aa3)[_0xdaf2('0x2b')](function(_0x80186){return _0x80186;});}return null;};}function removeEntity(_0x146b0c,_0x63d6c6){return function(_0x11a745){if(_0x11a745){return _0x11a745['destroy']()[_0xdaf2('0x2b')](function(){_0x146b0c[_0xdaf2('0x24')](0xcc)[_0xdaf2('0x2c')]();});}};}function handleEntityNotFound(_0x36f439,_0x15083d){return function(_0x5c33a9){if(!_0x5c33a9){_0x36f439[_0xdaf2('0x1e')](0x194);}return _0x5c33a9;};}function handleError(_0x412c7a,_0x412f7e){_0x412f7e=_0x412f7e||0x1f4;return function(_0x2ad886){logger[_0xdaf2('0x2d')](_0x2ad886[_0xdaf2('0x2e')]);if(_0x2ad886['name']){delete _0x2ad886[_0xdaf2('0x2f')];}_0x412c7a[_0xdaf2('0x24')](_0x412f7e)[_0xdaf2('0x30')](_0x2ad886);};}exports[_0xdaf2('0x31')]=function(_0x14d32d,_0x4681e3){var _0x27e859={},_0x4b4b1e={},_0x1f8d60={'count':0x0,'rows':[]};var _0x209e6f=_['map'](db['VoiceQueueReport'][_0xdaf2('0x32')],function(_0xc47837){return{'name':_0xc47837['fieldName'],'type':_0xc47837[_0xdaf2('0x33')][_0xdaf2('0x34')]};});_0x4b4b1e[_0xdaf2('0x35')]=_[_0xdaf2('0x36')](_0x209e6f,'name');_0x4b4b1e[_0xdaf2('0x37')]=_['keys'](_0x14d32d[_0xdaf2('0x37')]);_0x4b4b1e[_0xdaf2('0x38')]=_[_0xdaf2('0x39')](_0x4b4b1e['model'],_0x4b4b1e[_0xdaf2('0x37')]);_0x27e859[_0xdaf2('0x3a')]=_[_0xdaf2('0x39')](_0x4b4b1e[_0xdaf2('0x35')],qs[_0xdaf2('0x3b')](_0x14d32d['query'][_0xdaf2('0x3b')]));_0x27e859['attributes']=_0x27e859['attributes'][_0xdaf2('0x3c')]?_0x27e859['attributes']:_0x4b4b1e[_0xdaf2('0x35')];if(!_0x14d32d[_0xdaf2('0x37')][_0xdaf2('0x3d')]('nolimit')){_0x27e859[_0xdaf2('0x23')]=qs[_0xdaf2('0x23')](_0x14d32d['query'][_0xdaf2('0x23')]);_0x27e859['offset']=qs['offset'](_0x14d32d['query'][_0xdaf2('0x20')]);}_0x27e859['order']=qs['sort'](_0x14d32d[_0xdaf2('0x37')][_0xdaf2('0x3e')]);_0x27e859['where']=qs[_0xdaf2('0x38')](_[_0xdaf2('0x3f')](_0x14d32d['query'],_0x4b4b1e[_0xdaf2('0x38')]),_0x209e6f);if(_0x14d32d[_0xdaf2('0x37')]['filter']){_0x27e859[_0xdaf2('0x40')]=_[_0xdaf2('0x41')](_0x27e859[_0xdaf2('0x40')],{'$or':_[_0xdaf2('0x36')](_0x209e6f,function(_0x43db4b){if(_0x43db4b[_0xdaf2('0x33')]!==_0xdaf2('0x42')){var _0x903104={};_0x903104[_0x43db4b[_0xdaf2('0x2f')]]={'$like':'%'+_0x14d32d[_0xdaf2('0x37')][_0xdaf2('0x43')]+'%'};return _0x903104;}})});}_0x27e859=_['merge']({},_0x27e859,_0x14d32d[_0xdaf2('0x44')]);var _0x3c69df={'where':_0x27e859[_0xdaf2('0x40')]};return db['VoiceQueueReport']['count'](_0x3c69df)[_0xdaf2('0x2b')](function(_0x3856db){_0x1f8d60['count']=_0x3856db;if(_0x14d32d[_0xdaf2('0x37')]['includeAll']){_0x27e859[_0xdaf2('0x45')]=[{'all':!![]}];}return db[_0xdaf2('0x46')][_0xdaf2('0x47')](_0x27e859);})['then'](function(_0x55bff1){_0x1f8d60[_0xdaf2('0x48')]=_0x55bff1;return _0x1f8d60;})[_0xdaf2('0x2b')](respondWithFilteredResult(_0x4681e3,_0x27e859))[_0xdaf2('0x49')](handleError(_0x4681e3,null));};exports[_0xdaf2('0x4a')]=function(_0x3048c2,_0x42556c){var _0x1449dc={'raw':![],'where':{'id':_0x3048c2[_0xdaf2('0x4b')]['id']}},_0x59ec10={};_0x59ec10[_0xdaf2('0x35')]=_[_0xdaf2('0x4c')](db[_0xdaf2('0x46')][_0xdaf2('0x32')]);_0x59ec10['query']=_['keys'](_0x3048c2['query']);_0x59ec10[_0xdaf2('0x38')]=_['intersection'](_0x59ec10[_0xdaf2('0x35')],_0x59ec10['query']);_0x1449dc[_0xdaf2('0x3a')]=_[_0xdaf2('0x39')](_0x59ec10['model'],qs[_0xdaf2('0x3b')](_0x3048c2['query'][_0xdaf2('0x3b')]));_0x1449dc[_0xdaf2('0x3a')]=_0x1449dc['attributes']['length']?_0x1449dc[_0xdaf2('0x3a')]:_0x59ec10[_0xdaf2('0x35')];if(_0x3048c2[_0xdaf2('0x37')]['includeAll']){_0x1449dc[_0xdaf2('0x45')]=[{'all':!![]}];}_0x1449dc=_[_0xdaf2('0x41')]({},_0x1449dc,_0x3048c2[_0xdaf2('0x44')]);return db[_0xdaf2('0x46')]['find'](_0x1449dc)['then'](handleEntityNotFound(_0x42556c,null))[_0xdaf2('0x2b')](respondWithResult(_0x42556c,null))[_0xdaf2('0x49')](handleError(_0x42556c,null));};exports[_0xdaf2('0x4d')]=function(_0x49c6ff,_0x423195){return db['VoiceQueueReport'][_0xdaf2('0x4d')](_0x49c6ff[_0xdaf2('0x4e')],{})[_0xdaf2('0x2b')](respondWithResult(_0x423195,0xc9))[_0xdaf2('0x49')](handleError(_0x423195,null));};exports['update']=function(_0x11c5a5,_0x296a7e){if(_0x11c5a5[_0xdaf2('0x4e')]['id']){delete _0x11c5a5[_0xdaf2('0x4e')]['id'];}return db['VoiceQueueReport'][_0xdaf2('0x4f')]({'where':{'id':_0x11c5a5[_0xdaf2('0x4b')]['id']}})[_0xdaf2('0x2b')](handleEntityNotFound(_0x296a7e,null))[_0xdaf2('0x2b')](saveUpdates(_0x11c5a5[_0xdaf2('0x4e')],null))['then'](respondWithResult(_0x296a7e,null))['catch'](handleError(_0x296a7e,null));};exports['destroy']=function(_0x49f08b,_0x5544df){return db[_0xdaf2('0x46')][_0xdaf2('0x4f')]({'where':{'id':_0x49f08b['params']['id']}})['then'](handleEntityNotFound(_0x5544df,null))[_0xdaf2('0x2b')](removeEntity(_0x5544df,null))[_0xdaf2('0x49')](handleError(_0x5544df,null));};exports[_0xdaf2('0x50')]=function(_0x580782,_0x15ef7a){return db['VoiceQueueReport'][_0xdaf2('0x50')]()[_0xdaf2('0x2b')](respondWithResult(_0x15ef7a,null))[_0xdaf2('0x49')](handleError(_0x15ef7a,null));};exports[_0xdaf2('0x51')]=function(_0x1e1cbc,_0x122e8f){var _0x223975={},_0x2a3880={},_0x1d0a4c={'count':0x0,'rows':[]};_0x2a3880['model']=_[_0xdaf2('0x4c')](db[_0xdaf2('0x46')]['rawAttributes']);_0x2a3880['query']=_[_0xdaf2('0x4c')](_0x1e1cbc['query']);_0x2a3880['filters']=_['intersection'](_0x2a3880['model'],_0x2a3880[_0xdaf2('0x37')]);_0x223975[_0xdaf2('0x3a')]=_[_0xdaf2('0x39')](_0x2a3880[_0xdaf2('0x35')],qs[_0xdaf2('0x3b')](_0x1e1cbc[_0xdaf2('0x37')][_0xdaf2('0x3b')]));_0x223975[_0xdaf2('0x3a')]=_0x223975[_0xdaf2('0x3a')][_0xdaf2('0x3c')]?_0x223975[_0xdaf2('0x3a')]:_0x2a3880[_0xdaf2('0x35')];if(!_0x1e1cbc['query']['hasOwnProperty'](_0xdaf2('0x52'))){_0x223975[_0xdaf2('0x23')]=qs[_0xdaf2('0x23')](_0x1e1cbc['query']['limit']);_0x223975['offset']=qs[_0xdaf2('0x20')](_0x1e1cbc[_0xdaf2('0x37')][_0xdaf2('0x20')]);}_0x223975['order']=qs[_0xdaf2('0x3e')](_0x1e1cbc['query'][_0xdaf2('0x3e')]);_0x223975[_0xdaf2('0x40')]=qs[_0xdaf2('0x38')](_[_0xdaf2('0x3f')](_0x1e1cbc[_0xdaf2('0x37')],_0x2a3880['filters']));if(_0x1e1cbc[_0xdaf2('0x37')][_0xdaf2('0x43')]){_0x223975[_0xdaf2('0x40')]=_[_0xdaf2('0x41')](_0x223975['where'],{'$or':_[_0xdaf2('0x36')](_0x223975['attributes'],function(_0x3d52b3){var _0x276413={};_0x276413[_0x3d52b3]={'$like':'%'+_0x1e1cbc[_0xdaf2('0x37')]['filter']+'%'};return _0x276413;})});}_0x223975=_[_0xdaf2('0x41')]({},_0x223975,_0x1e1cbc[_0xdaf2('0x44')]);var _0x540139={'where':_0x223975[_0xdaf2('0x40')]};return db['VoiceQueueReport'][_0xdaf2('0x22')](_0x540139)[_0xdaf2('0x2b')](function(_0x5f1e55){_0x1d0a4c[_0xdaf2('0x22')]=_0x5f1e55;if(_0x1e1cbc[_0xdaf2('0x37')][_0xdaf2('0x53')]){_0x223975[_0xdaf2('0x45')]=[{'all':!![]}];}return db[_0xdaf2('0x46')][_0xdaf2('0x47')](_0x223975);})[_0xdaf2('0x2b')](function(_0x44e391){_0x1d0a4c['rows']=_0x44e391;return _0x1d0a4c;})[_0xdaf2('0x2b')](respondWithFilteredResult(_0x122e8f,_0x223975,_0xdaf2('0x51')))[_0xdaf2('0x49')](handleError(_0x122e8f,null,_0xdaf2('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 991a532..96a0360 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 _0xd39d=['update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x58b02d,_0x2c6ddf){var _0x447261=function(_0x4d8c1f){while(--_0x4d8c1f){_0x58b02d['push'](_0x58b02d['shift']());}};_0x447261(++_0x2c6ddf);}(_0xd39d,0x8b));var _0xdd39=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xd39d[_0x516927];return _0x30749b;};'use strict';var EventEmitter=require(_0xdd39('0x0'));var VoiceQueueReport=require(_0xdd39('0x1'))['db'][_0xdd39('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdd39('0x3')](0x0);var events={'afterCreate':_0xdd39('0x4'),'afterUpdate':_0xdd39('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1bf29d){return function(_0x125fb9,_0x3002a9,_0x13407a){VoiceQueueReportEvents['emit'](_0x1bf29d+':'+_0x125fb9['id'],_0x125fb9);VoiceQueueReportEvents[_0xdd39('0x6')](_0x1bf29d,_0x125fb9);_0x13407a(null);};}for(var e in events){if(events[_0xdd39('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xdd39('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4825=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','save','update','emit'];(function(_0x3364f7,_0x3ee4b0){var _0x3d2089=function(_0x56658d){while(--_0x56658d){_0x3364f7['push'](_0x3364f7['shift']());}};_0x3d2089(++_0x3ee4b0);}(_0x4825,0x1d2));var _0x5482=function(_0x4be611,_0x596afb){_0x4be611=_0x4be611-0x0;var _0x3bcb70=_0x4825[_0x4be611];return _0x3bcb70;};'use strict';var EventEmitter=require(_0x5482('0x0'));var VoiceQueueReport=require(_0x5482('0x1'))['db'][_0x5482('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5482('0x3'),'afterUpdate':_0x5482('0x4'),'afterDestroy':'remove'};function emitEvent(_0x57f9bf){return function(_0x5b89ec,_0x39a90b,_0x13a1aa){VoiceQueueReportEvents[_0x5482('0x5')](_0x57f9bf+':'+_0x5b89ec['id'],_0x5b89ec);VoiceQueueReportEvents[_0x5482('0x5')](_0x57f9bf,_0x5b89ec);_0x13a1aa(null);};}for(var e in events){if(events[_0x5482('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5482('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 8e001c1..2cd7b8f 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 _0x4ae3=['uniqueid','calleridnum','lodash','../../config/logger','api','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue'];(function(_0x494667,_0x694cfa){var _0x194cb1=function(_0x3bf26b){while(--_0x3bf26b){_0x494667['push'](_0x494667['shift']());}};_0x194cb1(++_0x694cfa);}(_0x4ae3,0x10a));var _0x34ae=function(_0x2c0c8d,_0x4a86c7){_0x2c0c8d=_0x2c0c8d-0x0;var _0x114e7a=_0x4ae3[_0x2c0c8d];return _0x114e7a;};'use strict';var _=require(_0x34ae('0x0'));var util=require('util');var logger=require(_0x34ae('0x1'))(_0x34ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x34ae('0x3'));var fs=require('fs');var path=require(_0x34ae('0x4'));var rimraf=require('rimraf');var config=require(_0x34ae('0x5'));var attributes=require(_0x34ae('0x6'));module['exports']=function(_0x567d85,_0x1c32cf){return _0x567d85[_0x34ae('0x7')](_0x34ae('0x8'),attributes,{'tableName':_0x34ae('0x9'),'paranoid':![],'indexes':[{'fields':[_0x34ae('0xa')]},{'fields':[_0x34ae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x83f3=['./voiceQueueReport.attributes','exports','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5183aa,_0x54277c){var _0x73ac67=function(_0x14759c){while(--_0x14759c){_0x5183aa['push'](_0x5183aa['shift']());}};_0x73ac67(++_0x54277c);}(_0x83f3,0x1d0));var _0x383f=function(_0x273a05,_0x21100b){_0x273a05=_0x273a05-0x0;var _0x4597f0=_0x83f3[_0x273a05];return _0x4597f0;};'use strict';var _=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var logger=require(_0x383f('0x2'))(_0x383f('0x3'));var moment=require(_0x383f('0x4'));var BPromise=require('bluebird');var rp=require(_0x383f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x383f('0x6'));module[_0x383f('0x7')]=function(_0xa270bd,_0x1c741e){return _0xa270bd['define']('VoiceQueueReport',attributes,{'tableName':_0x383f('0x8'),'paranoid':![],'indexes':[{'fields':[_0x383f('0x9')]},{'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 1d6a389..2adc672 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 _0xa0f9=['model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa0f9,0x15f));var _0x9a0f=function(_0x53b0f8,_0x459130){_0x53b0f8=_0x53b0f8-0x0;var _0x133415=_0xa0f9[_0x53b0f8];return _0x133415;};'use strict';var _=require(_0x9a0f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9a0f('0x1'));var rs=require(_0x9a0f('0x2'));var fs=require('fs');var Redis=require(_0x9a0f('0x3'));var db=require(_0x9a0f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a0f('0x5'))(_0x9a0f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a0f('0x7')][_0x9a0f('0x8')]({'port':0x232a});config[_0x9a0f('0x9')]=_[_0x9a0f('0xa')](config['redis'],{'host':_0x9a0f('0xb'),'port':0x18eb});var socket=require(_0x9a0f('0xc'))(new Redis(config[_0x9a0f('0x9')]));require(_0x9a0f('0xd'))[_0x9a0f('0xe')](socket);function respondWithRpcPromise(_0x50a6b6,_0x53c81c,_0xf4d60c){return new BPromise(function(_0x1c7818,_0x55f930){return client[_0x9a0f('0xf')](_0x50a6b6,_0xf4d60c)[_0x9a0f('0x10')](function(_0x1af8a3){logger['info'](_0x9a0f('0x11'),_0x53c81c,_0x9a0f('0x12'));logger[_0x9a0f('0x13')](_0x9a0f('0x14'),_0x53c81c,_0x9a0f('0x12'),JSON[_0x9a0f('0x15')](_0x1af8a3));if(_0x1af8a3[_0x9a0f('0x16')]){if(_0x1af8a3[_0x9a0f('0x16')][_0x9a0f('0x17')]===0x1f4){logger[_0x9a0f('0x16')](_0x9a0f('0x11'),_0x53c81c,_0x1af8a3['error']['message']);return _0x55f930(_0x1af8a3[_0x9a0f('0x16')][_0x9a0f('0x18')]);}logger['error'](_0x9a0f('0x11'),_0x53c81c,_0x1af8a3[_0x9a0f('0x16')]['message']);return _0x1c7818(_0x1af8a3[_0x9a0f('0x16')][_0x9a0f('0x18')]);}else{logger[_0x9a0f('0x19')](_0x9a0f('0x11'),_0x53c81c,_0x9a0f('0x12'));_0x1c7818(_0x1af8a3[_0x9a0f('0x1a')][_0x9a0f('0x18')]);}})[_0x9a0f('0x1b')](function(_0x16de97){logger['error'](_0x9a0f('0x11'),_0x53c81c,_0x16de97);_0x55f930(_0x16de97);});});}exports['GetVoiceQueueReport']=function(_0x4a1e3f){var _0x3340a0=this;return new Promise(function(_0x4bf43f,_0xd1f2a){return db[_0x9a0f('0x1c')][_0x9a0f('0x1d')]({'raw':_0x4a1e3f[_0x9a0f('0x1e')]?_0x4a1e3f[_0x9a0f('0x1e')][_0x9a0f('0x1f')]===undefined?!![]:![]:!![],'where':_0x4a1e3f[_0x9a0f('0x1e')]?_0x4a1e3f['options']['where']||null:null,'attributes':_0x4a1e3f[_0x9a0f('0x1e')]?_0x4a1e3f[_0x9a0f('0x1e')][_0x9a0f('0x20')]||null:null,'limit':_0x4a1e3f[_0x9a0f('0x1e')]?_0x4a1e3f[_0x9a0f('0x1e')][_0x9a0f('0x21')]||null:null,'include':_0x4a1e3f[_0x9a0f('0x1e')]?_0x4a1e3f[_0x9a0f('0x1e')][_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x4a1e3f['options'][_0x9a0f('0x22')],function(_0x59095d){return{'model':db[_0x59095d[_0x9a0f('0x24')]],'as':_0x59095d['as'],'attributes':_0x59095d['attributes'],'include':_0x59095d['include']?_[_0x9a0f('0x23')](_0x59095d[_0x9a0f('0x22')],function(_0x2d8ca5){return{'model':db[_0x2d8ca5[_0x9a0f('0x24')]],'as':_0x2d8ca5['as'],'attributes':_0x2d8ca5[_0x9a0f('0x20')],'include':_0x2d8ca5[_0x9a0f('0x22')]?_[_0x9a0f('0x23')](_0x2d8ca5[_0x9a0f('0x22')],function(_0x22b42e){return{'model':db[_0x22b42e['model']],'as':_0x22b42e['as'],'attributes':_0x22b42e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a0f('0x10')](function(_0x4ac013){logger[_0x9a0f('0x19')](_0x9a0f('0x25'),_0x4a1e3f);logger['debug'](_0x9a0f('0x25'),_0x4a1e3f,JSON[_0x9a0f('0x15')](_0x4ac013));_0x4bf43f(_0x4ac013);})[_0x9a0f('0x1b')](function(_0x2c69a6){logger[_0x9a0f('0x16')](_0x9a0f('0x25'),_0x2c69a6[_0x9a0f('0x18')],_0x4a1e3f);_0xd1f2a(_0x3340a0[_0x9a0f('0x16')](0x1f4,_0x2c69a6[_0x9a0f('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x18140e){var _0x2d4b0d=this;return new Promise(function(_0x6b48a7,_0x433e2c){return db[_0x9a0f('0x1c')][_0x9a0f('0x26')](_0x18140e[_0x9a0f('0x27')],{'raw':_0x18140e[_0x9a0f('0x1e')]?_0x18140e[_0x9a0f('0x1e')][_0x9a0f('0x1f')]===undefined?!![]:![]:!![]})[_0x9a0f('0x10')](function(_0x19ed07){logger[_0x9a0f('0x19')](_0x9a0f('0x28'),_0x18140e);logger[_0x9a0f('0x13')](_0x9a0f('0x28'),_0x18140e,JSON[_0x9a0f('0x15')](_0x19ed07));_0x6b48a7(_0x19ed07);})[_0x9a0f('0x1b')](function(_0x2e4bd8){logger[_0x9a0f('0x16')](_0x9a0f('0x28'),_0x2e4bd8[_0x9a0f('0x18')],_0x18140e);_0x433e2c(_0x2d4b0d['error'](0x1f4,_0x2e4bd8['message']));});});};exports[_0x9a0f('0x29')]=function(_0x403743){var _0x45332a=this;return new Promise(function(_0x400e5e,_0x35a421){return db[_0x9a0f('0x1c')]['update'](_0x403743[_0x9a0f('0x27')],{'raw':_0x403743[_0x9a0f('0x1e')]?_0x403743[_0x9a0f('0x1e')][_0x9a0f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x403743[_0x9a0f('0x1e')]?_0x403743['options'][_0x9a0f('0x2a')]||null:null,'attributes':_0x403743[_0x9a0f('0x1e')]?_0x403743['options']['attributes']||null:null,'limit':_0x403743['options']?_0x403743[_0x9a0f('0x1e')]['limit']||null:null})[_0x9a0f('0x10')](function(_0x23efd5){logger[_0x9a0f('0x19')]('UpdateVoiceQueueReport',_0x403743);logger['debug'](_0x9a0f('0x29'),_0x403743,JSON[_0x9a0f('0x15')](_0x23efd5));_0x400e5e(_0x23efd5);})[_0x9a0f('0x1b')](function(_0x22c191){logger[_0x9a0f('0x16')](_0x9a0f('0x29'),_0x22c191[_0x9a0f('0x18')],_0x403743);_0x35a421(_0x45332a[_0x9a0f('0x16')](0x1f4,_0x22c191[_0x9a0f('0x18')]));});});}; \ No newline at end of file +var _0xe462=['update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','localhost','socket.io-emitter','redis','register','request','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','CreateVoiceQueueReport','body','raw','then','UpdateVoiceQueueReport'];(function(_0x4284b0,_0x1da437){var _0x322fed=function(_0x335f75){while(--_0x335f75){_0x4284b0['push'](_0x4284b0['shift']());}};_0x322fed(++_0x1da437);}(_0xe462,0x1e2));var _0x2e46=function(_0x160f99,_0x8de3ad){_0x160f99=_0x160f99-0x0;var _0x405e09=_0xe462[_0x160f99];return _0x405e09;};'use strict';var _=require(_0x2e46('0x0'));var util=require(_0x2e46('0x1'));var moment=require(_0x2e46('0x2'));var BPromise=require(_0x2e46('0x3'));var rs=require(_0x2e46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e46('0x5'))['db'];var utils=require(_0x2e46('0x6'));var logger=require(_0x2e46('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2e46('0x8'));var client=jayson[_0x2e46('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2e46('0xa'),'port':0x18eb});var socket=require(_0x2e46('0xb'))(new Redis(config[_0x2e46('0xc')]));require('./voiceQueueReport.socket')[_0x2e46('0xd')](socket);function respondWithRpcPromise(_0x4d709c,_0x3e362b,_0x3a7dd2){return new BPromise(function(_0x4b19d1,_0x7ec601){return client[_0x2e46('0xe')](_0x4d709c,_0x3a7dd2)['then'](function(_0x1d7505){logger[_0x2e46('0xf')](_0x2e46('0x10'),_0x3e362b,'request\x20sent');logger[_0x2e46('0x11')](_0x2e46('0x12'),_0x3e362b,_0x2e46('0x13'),JSON[_0x2e46('0x14')](_0x1d7505));if(_0x1d7505[_0x2e46('0x15')]){if(_0x1d7505[_0x2e46('0x15')]['code']===0x1f4){logger[_0x2e46('0x15')](_0x2e46('0x10'),_0x3e362b,_0x1d7505[_0x2e46('0x15')][_0x2e46('0x16')]);return _0x7ec601(_0x1d7505[_0x2e46('0x15')][_0x2e46('0x16')]);}logger[_0x2e46('0x15')](_0x2e46('0x10'),_0x3e362b,_0x1d7505[_0x2e46('0x15')][_0x2e46('0x16')]);return _0x4b19d1(_0x1d7505[_0x2e46('0x15')]['message']);}else{logger[_0x2e46('0xf')](_0x2e46('0x10'),_0x3e362b,'request\x20sent');_0x4b19d1(_0x1d7505['result'][_0x2e46('0x16')]);}})[_0x2e46('0x17')](function(_0x36efc7){logger[_0x2e46('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x3e362b,_0x36efc7);_0x7ec601(_0x36efc7);});});}exports[_0x2e46('0x18')]=function(_0x355215){var _0x1ae8fe=this;return new Promise(function(_0x3ade99,_0x418886){return db[_0x2e46('0x19')][_0x2e46('0x1a')]({'raw':_0x355215[_0x2e46('0x1b')]?_0x355215[_0x2e46('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x355215['options']?_0x355215[_0x2e46('0x1b')]['where']||null:null,'attributes':_0x355215[_0x2e46('0x1b')]?_0x355215[_0x2e46('0x1b')][_0x2e46('0x1c')]||null:null,'limit':_0x355215[_0x2e46('0x1b')]?_0x355215[_0x2e46('0x1b')][_0x2e46('0x1d')]||null:null,'include':_0x355215[_0x2e46('0x1b')]?_0x355215[_0x2e46('0x1b')]['include']?_[_0x2e46('0x1e')](_0x355215[_0x2e46('0x1b')][_0x2e46('0x1f')],function(_0xb2d801){return{'model':db[_0xb2d801['model']],'as':_0xb2d801['as'],'attributes':_0xb2d801[_0x2e46('0x1c')],'include':_0xb2d801[_0x2e46('0x1f')]?_['map'](_0xb2d801['include'],function(_0x167955){return{'model':db[_0x167955[_0x2e46('0x20')]],'as':_0x167955['as'],'attributes':_0x167955[_0x2e46('0x1c')],'include':_0x167955[_0x2e46('0x1f')]?_[_0x2e46('0x1e')](_0x167955[_0x2e46('0x1f')],function(_0x3807fd){return{'model':db[_0x3807fd[_0x2e46('0x20')]],'as':_0x3807fd['as'],'attributes':_0x3807fd[_0x2e46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bc810){logger[_0x2e46('0xf')](_0x2e46('0x18'),_0x355215);logger[_0x2e46('0x11')]('GetVoiceQueueReport',_0x355215,JSON[_0x2e46('0x14')](_0x3bc810));_0x3ade99(_0x3bc810);})[_0x2e46('0x17')](function(_0x436117){logger['error']('GetVoiceQueueReport',_0x436117[_0x2e46('0x16')],_0x355215);_0x418886(_0x1ae8fe[_0x2e46('0x15')](0x1f4,_0x436117[_0x2e46('0x16')]));});});};exports[_0x2e46('0x21')]=function(_0x182559){var _0x4dbee5=this;return new Promise(function(_0x558fcb,_0x22a2ce){return db['VoiceQueueReport']['create'](_0x182559[_0x2e46('0x22')],{'raw':_0x182559['options']?_0x182559[_0x2e46('0x1b')][_0x2e46('0x23')]===undefined?!![]:![]:!![]})[_0x2e46('0x24')](function(_0x3d8b2d){logger[_0x2e46('0xf')]('CreateVoiceQueueReport',_0x182559);logger[_0x2e46('0x11')](_0x2e46('0x21'),_0x182559,JSON[_0x2e46('0x14')](_0x3d8b2d));_0x558fcb(_0x3d8b2d);})['catch'](function(_0x5719ae){logger[_0x2e46('0x15')](_0x2e46('0x21'),_0x5719ae[_0x2e46('0x16')],_0x182559);_0x22a2ce(_0x4dbee5['error'](0x1f4,_0x5719ae['message']));});});};exports[_0x2e46('0x25')]=function(_0x2560c0){var _0x3ac396=this;return new Promise(function(_0x47c28d,_0x23ff5a){return db[_0x2e46('0x19')][_0x2e46('0x26')](_0x2560c0[_0x2e46('0x22')],{'raw':_0x2560c0['options']?_0x2560c0[_0x2e46('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2560c0['options']?_0x2560c0['options'][_0x2e46('0x27')]||null:null,'attributes':_0x2560c0[_0x2e46('0x1b')]?_0x2560c0[_0x2e46('0x1b')]['attributes']||null:null,'limit':_0x2560c0[_0x2e46('0x1b')]?_0x2560c0[_0x2e46('0x1b')]['limit']||null:null})[_0x2e46('0x24')](function(_0x211419){logger[_0x2e46('0xf')](_0x2e46('0x25'),_0x2560c0);logger[_0x2e46('0x11')]('UpdateVoiceQueueReport',_0x2560c0,JSON['stringify'](_0x211419));_0x47c28d(_0x211419);})[_0x2e46('0x17')](function(_0x104ed0){logger[_0x2e46('0x15')](_0x2e46('0x25'),_0x104ed0[_0x2e46('0x16')],_0x2560c0);_0x23ff5a(_0x3ac396[_0x2e46('0x15')](0x1f4,_0x104ed0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f4e30bf..0c32e92 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 _0xaced=['update','emit','register','length','./voiceQueueReport.events','save','remove'];(function(_0x18255f,_0x22db1f){var _0x3c68de=function(_0x3b5538){while(--_0x3b5538){_0x18255f['push'](_0x18255f['shift']());}};_0x3c68de(++_0x22db1f);}(_0xaced,0x18c));var _0xdace=function(_0x202713,_0x374128){_0x202713=_0x202713-0x0;var _0x58f37d=_0xaced[_0x202713];return _0x58f37d;};'use strict';var VoiceQueueReportEvents=require(_0xdace('0x0'));var events=[_0xdace('0x1'),_0xdace('0x2'),_0xdace('0x3')];function createListener(_0x44b792,_0x58f547){return function(_0x36bfd5){_0x58f547[_0xdace('0x4')](_0x44b792,_0x36bfd5);};}function removeListener(_0x1ba367,_0x46522e){return function(){VoiceQueueReportEvents['removeListener'](_0x1ba367,_0x46522e);};}exports[_0xdace('0x5')]=function(_0x4d7f80){for(var _0x5f5d92=0x0,_0x198ca1=events[_0xdace('0x6')];_0x5f5d92<_0x198ca1;_0x5f5d92++){var _0x3521d8=events[_0x5f5d92];var _0x199697=createListener('voiceQueueReport:'+_0x3521d8,_0x4d7f80);VoiceQueueReportEvents['on'](_0x3521d8,_0x199697);}}; \ No newline at end of file +var _0xc1f1=['save','remove','removeListener','length','voiceQueueReport:'];(function(_0x24e6d3,_0x5a83be){var _0x4731f6=function(_0x41b97a){while(--_0x41b97a){_0x24e6d3['push'](_0x24e6d3['shift']());}};_0x4731f6(++_0x5a83be);}(_0xc1f1,0x122));var _0x1c1f=function(_0x2bb6dd,_0x252667){_0x2bb6dd=_0x2bb6dd-0x0;var _0x2a07dc=_0xc1f1[_0x2bb6dd];return _0x2a07dc;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x1c1f('0x0'),_0x1c1f('0x1'),'update'];function createListener(_0x293182,_0x5c0aec){return function(_0x218bc8){_0x5c0aec['emit'](_0x293182,_0x218bc8);};}function removeListener(_0x223189,_0x5f1d2e){return function(){VoiceQueueReportEvents[_0x1c1f('0x2')](_0x223189,_0x5f1d2e);};}exports['register']=function(_0x1940d7){for(var _0x2d91a5=0x0,_0x3d44be=events[_0x1c1f('0x3')];_0x2d91a5<_0x3d44be;_0x2d91a5++){var _0x2dd1e4=events[_0x2d91a5];var _0x34b9fc=createListener(_0x1c1f('0x4')+_0x2dd1e4,_0x1940d7);VoiceQueueReportEvents['on'](_0x2dd1e4,_0x34b9fc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a776d4f..b0aeaf9 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 _0x3bef=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40bfa6,_0x4ca51f){var _0x3f1ddc=function(_0x25c481){while(--_0x25c481){_0x40bfa6['push'](_0x40bfa6['shift']());}};_0x3f1ddc(++_0x4ca51f);}(_0x3bef,0x185));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf3be('0x0'));var util=require(_0xf3be('0x1'));var path=require(_0xf3be('0x2'));var timeout=require(_0xf3be('0x3'));var express=require(_0xf3be('0x4'));var router=express[_0xf3be('0x5')]();var fs_extra=require(_0xf3be('0x6'));var auth=require(_0xf3be('0x7'));var interaction=require(_0xf3be('0x8'));var config=require(_0xf3be('0x9'));var controller=require('./voiceQueuesLog.controller');router[_0xf3be('0xa')]('/',auth[_0xf3be('0xb')](),controller[_0xf3be('0xc')]);router[_0xf3be('0xa')](_0xf3be('0xd'),auth['isAuthenticated'](),controller[_0xf3be('0xe')]);router[_0xf3be('0xf')]('/',auth[_0xf3be('0xb')](),controller[_0xf3be('0x10')]);router['put'](_0xf3be('0xd'),auth[_0xf3be('0xb')](),controller[_0xf3be('0x11')]);router[_0xf3be('0x12')](_0xf3be('0xd'),auth['isAuthenticated'](),controller[_0xf3be('0x13')]);module[_0xf3be('0x14')]=router; \ No newline at end of file +var _0xded4=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0xded4,0x19c));var _0x4ded=function(_0x5a60ad,_0x46c5f0){_0x5a60ad=_0x5a60ad-0x0;var _0xf49e04=_0xded4[_0x5a60ad];return _0xf49e04;};'use strict';var multer=require(_0x4ded('0x0'));var util=require(_0x4ded('0x1'));var path=require(_0x4ded('0x2'));var timeout=require(_0x4ded('0x3'));var express=require(_0x4ded('0x4'));var router=express[_0x4ded('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ded('0x6'));var config=require('../../config/environment');var controller=require(_0x4ded('0x7'));router[_0x4ded('0x8')]('/',auth[_0x4ded('0x9')](),controller['index']);router[_0x4ded('0x8')]('/:id',auth[_0x4ded('0x9')](),controller[_0x4ded('0xa')]);router[_0x4ded('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ded('0xc')]);router['put']('/:id',auth[_0x4ded('0x9')](),controller['update']);router[_0x4ded('0xd')](_0x4ded('0xe'),auth[_0x4ded('0x9')](),controller[_0x4ded('0xf')]);module[_0x4ded('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 891affc..93342db 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 _0x2fe1=['DATE','moment','exports','STRING'];(function(_0x44d5ea,_0xdc8802){var _0x502d79=function(_0x70efd5){while(--_0x70efd5){_0x44d5ea['push'](_0x44d5ea['shift']());}};_0x502d79(++_0xdc8802);}(_0x2fe1,0xc9));var _0x12fe=function(_0x546833,_0x50c05b){_0x546833=_0x546833-0x0;var _0x197a6d=_0x2fe1[_0x546833];return _0x197a6d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x12fe('0x0'));module[_0x12fe('0x1')]={'time':{'type':Sequelize[_0x12fe('0x2')]},'callid':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x12fe('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x12fe('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xa867=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','exports','STRING'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa867,0x1a1));var _0x7a86=function(_0x52937e,_0x4a47da){_0x52937e=_0x52937e-0x0;var _0x51be71=_0xa867[_0x52937e];return _0x51be71;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7a86('0x0'));module[_0x7a86('0x1')]={'time':{'type':Sequelize[_0x7a86('0x2')]},'callid':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7a86('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7a86('0x3')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x7a86('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 4f90cac..ce1d21b 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 _0x622c=['findAll','rows','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','sendStatus','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x23f81d,_0x74a4c5){var _0x244b49=function(_0x143332){while(--_0x143332){_0x23f81d['push'](_0x23f81d['shift']());}};_0x244b49(++_0x74a4c5);}(_0x622c,0x130));var _0xc622=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x622c[_0x3df223];return _0x562d11;};'use strict';var emlformat=require(_0xc622('0x0'));var rimraf=require(_0xc622('0x1'));var zipdir=require(_0xc622('0x2'));var jsonpatch=require(_0xc622('0x3'));var rp=require(_0xc622('0x4'));var moment=require(_0xc622('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc622('0x6'));var util=require(_0xc622('0x7'));var path=require('path');var sox=require(_0xc622('0x8'));var csv=require(_0xc622('0x9'));var ejs=require(_0xc622('0xa'));var fs=require('fs');var fs_extra=require(_0xc622('0xb'));var _=require(_0xc622('0xc'));var squel=require('squel');var crypto=require(_0xc622('0xd'));var jsforce=require(_0xc622('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc622('0xf'));var Papa=require(_0xc622('0x10'));var Redis=require(_0xc622('0x11'));var authService=require(_0xc622('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc622('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc622('0x14'))(_0xc622('0x15'));var utils=require(_0xc622('0x16'));var config=require(_0xc622('0x17'));var licenseUtil=require(_0xc622('0x18'));var db=require(_0xc622('0x19'))['db'];function respondWithStatusCode(_0x4a3348,_0xe6d0af){_0xe6d0af=_0xe6d0af||0xcc;return function(_0x3ad249){if(_0x3ad249){return _0x4a3348['sendStatus'](_0xe6d0af);}return _0x4a3348[_0xc622('0x1a')](_0xe6d0af)[_0xc622('0x1b')]();};}function respondWithResult(_0x5e42a2,_0x2ca6e9){_0x2ca6e9=_0x2ca6e9||0xc8;return function(_0x22c1c1){if(_0x22c1c1){return _0x5e42a2['status'](_0x2ca6e9)[_0xc622('0x1c')](_0x22c1c1);}};}function respondWithFilteredResult(_0x361454,_0x881d24){return function(_0x1098c2){if(_0x1098c2){var _0x4454eb=typeof _0x881d24[_0xc622('0x1d')]==='undefined'&&typeof _0x881d24[_0xc622('0x1e')]==='undefined';var _0x446543=_0x1098c2[_0xc622('0x1f')];var _0x3b9bcb=_0x4454eb?0x0:_0x881d24['offset'];var _0x1c25ac=_0x4454eb?_0x1098c2[_0xc622('0x1f')]:_0x881d24['offset']+_0x881d24[_0xc622('0x1e')];var _0xd3df13;if(_0x1c25ac>=_0x446543){_0x1c25ac=_0x446543;_0xd3df13=0xc8;}else{_0xd3df13=0xce;}_0x361454[_0xc622('0x1a')](_0xd3df13);return _0x361454[_0xc622('0x20')](_0xc622('0x21'),_0x3b9bcb+'-'+_0x1c25ac+'/'+_0x446543)[_0xc622('0x1c')](_0x1098c2);}return null;};}function patchUpdates(_0xbedfb9){return function(_0x3be1b5){try{jsonpatch['apply'](_0x3be1b5,_0xbedfb9,!![]);}catch(_0x15dcd8){return BPromise[_0xc622('0x22')](_0x15dcd8);}return _0x3be1b5[_0xc622('0x23')]();};}function saveUpdates(_0x19b0a4,_0x59eb7f){return function(_0x35bbc9){if(_0x35bbc9){return _0x35bbc9[_0xc622('0x24')](_0x19b0a4)[_0xc622('0x25')](function(_0x54b09b){return _0x54b09b;});}return null;};}function removeEntity(_0x16f48e,_0x5d54df){return function(_0x5dbd98){if(_0x5dbd98){return _0x5dbd98['destroy']()[_0xc622('0x25')](function(){_0x16f48e[_0xc622('0x1a')](0xcc)[_0xc622('0x1b')]();});}};}function handleEntityNotFound(_0x147a02,_0x1012b9){return function(_0x511af6){if(!_0x511af6){_0x147a02[_0xc622('0x26')](0x194);}return _0x511af6;};}function handleError(_0x5ad003,_0x478723){_0x478723=_0x478723||0x1f4;return function(_0x2db8ba){logger['error'](_0x2db8ba['stack']);if(_0x2db8ba['name']){delete _0x2db8ba[_0xc622('0x27')];}_0x5ad003['status'](_0x478723)[_0xc622('0x28')](_0x2db8ba);};}exports['index']=function(_0x33d5d7,_0x2cb83f){var _0x365eb2={},_0x234841={},_0x492b71={'count':0x0,'rows':[]};var _0x149f81=_[_0xc622('0x29')](db[_0xc622('0x2a')][_0xc622('0x2b')],function(_0x1acebd){return{'name':_0x1acebd[_0xc622('0x2c')],'type':_0x1acebd[_0xc622('0x2d')][_0xc622('0x2e')]};});_0x234841['model']=_['map'](_0x149f81,'name');_0x234841['query']=_[_0xc622('0x2f')](_0x33d5d7[_0xc622('0x30')]);_0x234841[_0xc622('0x31')]=_[_0xc622('0x32')](_0x234841['model'],_0x234841[_0xc622('0x30')]);_0x365eb2['attributes']=_[_0xc622('0x32')](_0x234841[_0xc622('0x33')],qs['fields'](_0x33d5d7[_0xc622('0x30')][_0xc622('0x34')]));_0x365eb2['attributes']=_0x365eb2[_0xc622('0x35')][_0xc622('0x36')]?_0x365eb2[_0xc622('0x35')]:_0x234841[_0xc622('0x33')];if(!_0x33d5d7[_0xc622('0x30')][_0xc622('0x37')](_0xc622('0x38'))){_0x365eb2['limit']=qs[_0xc622('0x1e')](_0x33d5d7[_0xc622('0x30')][_0xc622('0x1e')]);_0x365eb2[_0xc622('0x1d')]=qs[_0xc622('0x1d')](_0x33d5d7[_0xc622('0x30')][_0xc622('0x1d')]);}_0x365eb2[_0xc622('0x39')]=qs[_0xc622('0x3a')](_0x33d5d7[_0xc622('0x30')][_0xc622('0x3a')]);_0x365eb2[_0xc622('0x3b')]=qs[_0xc622('0x31')](_['pick'](_0x33d5d7['query'],_0x234841[_0xc622('0x31')]),_0x149f81);if(_0x33d5d7[_0xc622('0x30')][_0xc622('0x3c')]){_0x365eb2[_0xc622('0x3b')]=_[_0xc622('0x3d')](_0x365eb2[_0xc622('0x3b')],{'$or':_[_0xc622('0x29')](_0x149f81,function(_0x4b01de){if(_0x4b01de[_0xc622('0x2d')]!==_0xc622('0x3e')){var _0x4f052d={};_0x4f052d[_0x4b01de[_0xc622('0x27')]]={'$like':'%'+_0x33d5d7[_0xc622('0x30')][_0xc622('0x3c')]+'%'};return _0x4f052d;}})});}_0x365eb2=_[_0xc622('0x3d')]({},_0x365eb2,_0x33d5d7[_0xc622('0x3f')]);var _0x57bd13={'where':_0x365eb2[_0xc622('0x3b')]};return db[_0xc622('0x2a')][_0xc622('0x1f')](_0x57bd13)[_0xc622('0x25')](function(_0x253707){_0x492b71[_0xc622('0x1f')]=_0x253707;if(_0x33d5d7[_0xc622('0x30')][_0xc622('0x40')]){_0x365eb2[_0xc622('0x41')]=[{'all':!![]}];}return db[_0xc622('0x2a')][_0xc622('0x42')](_0x365eb2);})[_0xc622('0x25')](function(_0x1999c0){_0x492b71[_0xc622('0x43')]=_0x1999c0;return _0x492b71;})[_0xc622('0x25')](respondWithFilteredResult(_0x2cb83f,_0x365eb2))[_0xc622('0x44')](handleError(_0x2cb83f,null));};exports['show']=function(_0x6627f4,_0x79a04c){var _0x3be260={'raw':!![],'where':{'id':_0x6627f4['params']['id']}},_0xdf3104={};_0xdf3104[_0xc622('0x33')]=_[_0xc622('0x2f')](db[_0xc622('0x2a')][_0xc622('0x2b')]);_0xdf3104[_0xc622('0x30')]=_[_0xc622('0x2f')](_0x6627f4[_0xc622('0x30')]);_0xdf3104[_0xc622('0x31')]=_[_0xc622('0x32')](_0xdf3104['model'],_0xdf3104[_0xc622('0x30')]);_0x3be260[_0xc622('0x35')]=_[_0xc622('0x32')](_0xdf3104['model'],qs['fields'](_0x6627f4['query']['fields']));_0x3be260[_0xc622('0x35')]=_0x3be260[_0xc622('0x35')][_0xc622('0x36')]?_0x3be260[_0xc622('0x35')]:_0xdf3104['model'];if(_0x6627f4['query'][_0xc622('0x40')]){_0x3be260[_0xc622('0x41')]=[{'all':!![]}];}_0x3be260=_[_0xc622('0x3d')]({},_0x3be260,_0x6627f4[_0xc622('0x3f')]);return db[_0xc622('0x2a')][_0xc622('0x45')](_0x3be260)['then'](handleEntityNotFound(_0x79a04c,null))[_0xc622('0x25')](respondWithResult(_0x79a04c,null))[_0xc622('0x44')](handleError(_0x79a04c,null));};exports['create']=function(_0x2d4ffb,_0x3fefa0){return db[_0xc622('0x2a')][_0xc622('0x46')](_0x2d4ffb[_0xc622('0x47')],{})[_0xc622('0x25')](respondWithResult(_0x3fefa0,0xc9))[_0xc622('0x44')](handleError(_0x3fefa0,null));};exports['update']=function(_0x10df4f,_0x3e3bcd){if(_0x10df4f[_0xc622('0x47')]['id']){delete _0x10df4f[_0xc622('0x47')]['id'];}return db[_0xc622('0x2a')][_0xc622('0x45')]({'where':{'id':_0x10df4f[_0xc622('0x48')]['id']}})[_0xc622('0x25')](handleEntityNotFound(_0x3e3bcd,null))[_0xc622('0x25')](saveUpdates(_0x10df4f[_0xc622('0x47')],null))[_0xc622('0x25')](respondWithResult(_0x3e3bcd,null))[_0xc622('0x44')](handleError(_0x3e3bcd,null));};exports[_0xc622('0x49')]=function(_0x523200,_0x441476){return db[_0xc622('0x2a')][_0xc622('0x45')]({'where':{'id':_0x523200[_0xc622('0x48')]['id']}})[_0xc622('0x25')](handleEntityNotFound(_0x441476,null))[_0xc622('0x25')](removeEntity(_0x441476,null))['catch'](handleError(_0x441476,null));}; \ No newline at end of file +var _0x5c80=['VoiceQueuesLog','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','type','options','where','include','findAll','show','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x32cab5,_0x2d689a){var _0x2d637f=function(_0x23bfa1){while(--_0x23bfa1){_0x32cab5['push'](_0x32cab5['shift']());}};_0x2d637f(++_0x2d689a);}(_0x5c80,0x136));var _0x05c8=function(_0x224745,_0x265df8){_0x224745=_0x224745-0x0;var _0x12d491=_0x5c80[_0x224745];return _0x12d491;};'use strict';var emlformat=require(_0x05c8('0x0'));var rimraf=require(_0x05c8('0x1'));var zipdir=require(_0x05c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c8('0x3'));var moment=require(_0x05c8('0x4'));var BPromise=require(_0x05c8('0x5'));var Mustache=require('mustache');var util=require(_0x05c8('0x6'));var path=require(_0x05c8('0x7'));var sox=require('sox');var csv=require(_0x05c8('0x8'));var ejs=require(_0x05c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x05c8('0xa'));var crypto=require(_0x05c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x05c8('0xc'));var toCsv=require(_0x05c8('0x8'));var querystring=require('querystring');var Papa=require(_0x05c8('0xd'));var Redis=require(_0x05c8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x05c8('0xf'));var as=require(_0x05c8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05c8('0x11'))('api');var utils=require(_0x05c8('0x12'));var config=require(_0x05c8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x05c8('0x14'))['db'];function respondWithStatusCode(_0x4de8e8,_0x3a865d){_0x3a865d=_0x3a865d||0xcc;return function(_0x3af427){if(_0x3af427){return _0x4de8e8[_0x05c8('0x15')](_0x3a865d);}return _0x4de8e8[_0x05c8('0x16')](_0x3a865d)[_0x05c8('0x17')]();};}function respondWithResult(_0x16b2e2,_0x24b3c5){_0x24b3c5=_0x24b3c5||0xc8;return function(_0x1f7c60){if(_0x1f7c60){return _0x16b2e2[_0x05c8('0x16')](_0x24b3c5)['json'](_0x1f7c60);}};}function respondWithFilteredResult(_0x4b8fec,_0x73e758){return function(_0x57379b){if(_0x57379b){var _0x124ee6=typeof _0x73e758[_0x05c8('0x18')]===_0x05c8('0x19')&&typeof _0x73e758[_0x05c8('0x1a')]==='undefined';var _0x456aa5=_0x57379b[_0x05c8('0x1b')];var _0x34c843=_0x124ee6?0x0:_0x73e758[_0x05c8('0x18')];var _0x5b4f75=_0x124ee6?_0x57379b[_0x05c8('0x1b')]:_0x73e758[_0x05c8('0x18')]+_0x73e758[_0x05c8('0x1a')];var _0x4a68b9;if(_0x5b4f75>=_0x456aa5){_0x5b4f75=_0x456aa5;_0x4a68b9=0xc8;}else{_0x4a68b9=0xce;}_0x4b8fec[_0x05c8('0x16')](_0x4a68b9);return _0x4b8fec[_0x05c8('0x1c')]('Content-Range',_0x34c843+'-'+_0x5b4f75+'/'+_0x456aa5)['json'](_0x57379b);}return null;};}function patchUpdates(_0x3c9127){return function(_0x1c6a05){try{jsonpatch[_0x05c8('0x1d')](_0x1c6a05,_0x3c9127,!![]);}catch(_0x3f548b){return BPromise[_0x05c8('0x1e')](_0x3f548b);}return _0x1c6a05[_0x05c8('0x1f')]();};}function saveUpdates(_0x1af640,_0x4d36e3){return function(_0x1078cd){if(_0x1078cd){return _0x1078cd[_0x05c8('0x20')](_0x1af640)[_0x05c8('0x21')](function(_0x5e1379){return _0x5e1379;});}return null;};}function removeEntity(_0x107097,_0x43b10a){return function(_0x42f56a){if(_0x42f56a){return _0x42f56a['destroy']()[_0x05c8('0x21')](function(){_0x107097[_0x05c8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306b29,_0x547d7b){return function(_0x1dc6ed){if(!_0x1dc6ed){_0x306b29['sendStatus'](0x194);}return _0x1dc6ed;};}function handleError(_0x121c14,_0xbc54e){_0xbc54e=_0xbc54e||0x1f4;return function(_0x56971c){logger[_0x05c8('0x22')](_0x56971c[_0x05c8('0x23')]);if(_0x56971c[_0x05c8('0x24')]){delete _0x56971c[_0x05c8('0x24')];}_0x121c14[_0x05c8('0x16')](_0xbc54e)[_0x05c8('0x25')](_0x56971c);};}exports[_0x05c8('0x26')]=function(_0x17ca28,_0x3d1261){var _0x1c7aed={},_0x25baf9={},_0x3a5c1b={'count':0x0,'rows':[]};var _0x571458=_[_0x05c8('0x27')](db[_0x05c8('0x28')][_0x05c8('0x29')],function(_0x485bdb){return{'name':_0x485bdb[_0x05c8('0x2a')],'type':_0x485bdb['type']['key']};});_0x25baf9[_0x05c8('0x2b')]=_['map'](_0x571458,_0x05c8('0x24'));_0x25baf9[_0x05c8('0x2c')]=_[_0x05c8('0x2d')](_0x17ca28[_0x05c8('0x2c')]);_0x25baf9[_0x05c8('0x2e')]=_[_0x05c8('0x2f')](_0x25baf9[_0x05c8('0x2b')],_0x25baf9['query']);_0x1c7aed[_0x05c8('0x30')]=_[_0x05c8('0x2f')](_0x25baf9[_0x05c8('0x2b')],qs[_0x05c8('0x31')](_0x17ca28[_0x05c8('0x2c')][_0x05c8('0x31')]));_0x1c7aed[_0x05c8('0x30')]=_0x1c7aed[_0x05c8('0x30')][_0x05c8('0x32')]?_0x1c7aed[_0x05c8('0x30')]:_0x25baf9[_0x05c8('0x2b')];if(!_0x17ca28['query'][_0x05c8('0x33')](_0x05c8('0x34'))){_0x1c7aed[_0x05c8('0x1a')]=qs[_0x05c8('0x1a')](_0x17ca28[_0x05c8('0x2c')]['limit']);_0x1c7aed[_0x05c8('0x18')]=qs[_0x05c8('0x18')](_0x17ca28['query'][_0x05c8('0x18')]);}_0x1c7aed['order']=qs[_0x05c8('0x35')](_0x17ca28[_0x05c8('0x2c')][_0x05c8('0x35')]);_0x1c7aed['where']=qs['filters'](_[_0x05c8('0x36')](_0x17ca28[_0x05c8('0x2c')],_0x25baf9[_0x05c8('0x2e')]),_0x571458);if(_0x17ca28[_0x05c8('0x2c')][_0x05c8('0x37')]){_0x1c7aed['where']=_[_0x05c8('0x38')](_0x1c7aed['where'],{'$or':_[_0x05c8('0x27')](_0x571458,function(_0x5ac74a){if(_0x5ac74a[_0x05c8('0x39')]!=='VIRTUAL'){var _0x18ad50={};_0x18ad50[_0x5ac74a[_0x05c8('0x24')]]={'$like':'%'+_0x17ca28[_0x05c8('0x2c')]['filter']+'%'};return _0x18ad50;}})});}_0x1c7aed=_['merge']({},_0x1c7aed,_0x17ca28[_0x05c8('0x3a')]);var _0x850f80={'where':_0x1c7aed[_0x05c8('0x3b')]};return db['VoiceQueuesLog']['count'](_0x850f80)[_0x05c8('0x21')](function(_0x3122fc){_0x3a5c1b[_0x05c8('0x1b')]=_0x3122fc;if(_0x17ca28[_0x05c8('0x2c')]['includeAll']){_0x1c7aed[_0x05c8('0x3c')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x05c8('0x3d')](_0x1c7aed);})[_0x05c8('0x21')](function(_0x54cdd4){_0x3a5c1b['rows']=_0x54cdd4;return _0x3a5c1b;})['then'](respondWithFilteredResult(_0x3d1261,_0x1c7aed))['catch'](handleError(_0x3d1261,null));};exports[_0x05c8('0x3e')]=function(_0x139b97,_0x558629){var _0x17d66a={'raw':!![],'where':{'id':_0x139b97['params']['id']}},_0x2e5ccb={};_0x2e5ccb['model']=_['keys'](db['VoiceQueuesLog'][_0x05c8('0x29')]);_0x2e5ccb[_0x05c8('0x2c')]=_[_0x05c8('0x2d')](_0x139b97[_0x05c8('0x2c')]);_0x2e5ccb['filters']=_[_0x05c8('0x2f')](_0x2e5ccb[_0x05c8('0x2b')],_0x2e5ccb[_0x05c8('0x2c')]);_0x17d66a[_0x05c8('0x30')]=_[_0x05c8('0x2f')](_0x2e5ccb[_0x05c8('0x2b')],qs[_0x05c8('0x31')](_0x139b97[_0x05c8('0x2c')][_0x05c8('0x31')]));_0x17d66a['attributes']=_0x17d66a[_0x05c8('0x30')]['length']?_0x17d66a[_0x05c8('0x30')]:_0x2e5ccb[_0x05c8('0x2b')];if(_0x139b97[_0x05c8('0x2c')][_0x05c8('0x3f')]){_0x17d66a[_0x05c8('0x3c')]=[{'all':!![]}];}_0x17d66a=_[_0x05c8('0x38')]({},_0x17d66a,_0x139b97[_0x05c8('0x3a')]);return db[_0x05c8('0x28')][_0x05c8('0x40')](_0x17d66a)['then'](handleEntityNotFound(_0x558629,null))[_0x05c8('0x21')](respondWithResult(_0x558629,null))[_0x05c8('0x41')](handleError(_0x558629,null));};exports[_0x05c8('0x42')]=function(_0x22ef87,_0x172ce2){return db[_0x05c8('0x28')][_0x05c8('0x42')](_0x22ef87[_0x05c8('0x43')],{})[_0x05c8('0x21')](respondWithResult(_0x172ce2,0xc9))[_0x05c8('0x41')](handleError(_0x172ce2,null));};exports['update']=function(_0x31d210,_0x3b886c){if(_0x31d210[_0x05c8('0x43')]['id']){delete _0x31d210[_0x05c8('0x43')]['id'];}return db[_0x05c8('0x28')][_0x05c8('0x40')]({'where':{'id':_0x31d210[_0x05c8('0x44')]['id']}})[_0x05c8('0x21')](handleEntityNotFound(_0x3b886c,null))[_0x05c8('0x21')](saveUpdates(_0x31d210[_0x05c8('0x43')],null))[_0x05c8('0x21')](respondWithResult(_0x3b886c,null))[_0x05c8('0x41')](handleError(_0x3b886c,null));};exports[_0x05c8('0x45')]=function(_0x30e009,_0x4b7e2f){return db[_0x05c8('0x28')]['find']({'where':{'id':_0x30e009[_0x05c8('0x44')]['id']}})[_0x05c8('0x21')](handleEntityNotFound(_0x4b7e2f,null))[_0x05c8('0x21')](removeEntity(_0x4b7e2f,null))['catch'](handleError(_0x4b7e2f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 0501737..c795706 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 _0x6e2d=['./voiceQueuesLog.attributes','exports','define','event','dtm','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x4b49cc,_0x24c7f5){var _0x3e60aa=function(_0x7c2fd8){while(--_0x7c2fd8){_0x4b49cc['push'](_0x4b49cc['shift']());}};_0x3e60aa(++_0x24c7f5);}(_0x6e2d,0x7d));var _0xd6e2=function(_0x4244c0,_0x35dec2){_0x4244c0=_0x4244c0-0x0;var _0x105c30=_0x6e2d[_0x4244c0];return _0x105c30;};'use strict';var _=require(_0xd6e2('0x0'));var util=require(_0xd6e2('0x1'));var logger=require('../../config/logger')(_0xd6e2('0x2'));var moment=require(_0xd6e2('0x3'));var BPromise=require(_0xd6e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6e2('0x5'));var rimraf=require('rimraf');var config=require(_0xd6e2('0x6'));var attributes=require(_0xd6e2('0x7'));module[_0xd6e2('0x8')]=function(_0x5398a9,_0x39b711){return _0x5398a9[_0xd6e2('0x9')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xd6e2('0xa'),_0xd6e2('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2953=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','event','dtm'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x2953,0x1cc));var _0x3295=function(_0x3adea2,_0x329477){_0x3adea2=_0x3adea2-0x0;var _0x2cf6aa=_0x2953[_0x3adea2];return _0x2cf6aa;};'use strict';var _=require(_0x3295('0x0'));var util=require('util');var logger=require(_0x3295('0x1'))(_0x3295('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3295('0x3'));var fs=require('fs');var path=require(_0x3295('0x4'));var rimraf=require(_0x3295('0x5'));var config=require(_0x3295('0x6'));var attributes=require(_0x3295('0x7'));module['exports']=function(_0x43a7b9,_0x37063b){return _0x43a7b9['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x3295('0x8'),_0x3295('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index d567815..ab726ce 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 _0x5668=['debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x501183,_0x178dc9){var _0x39a5e8=function(_0x483f3d){while(--_0x483f3d){_0x501183['push'](_0x501183['shift']());}};_0x39a5e8(++_0x178dc9);}(_0x5668,0x8b));var _0x8566=function(_0x201145,_0x548e7d){_0x201145=_0x201145-0x0;var _0x2e9e15=_0x5668[_0x201145];return _0x2e9e15;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var moment=require(_0x8566('0x2'));var BPromise=require(_0x8566('0x3'));var rs=require(_0x8566('0x4'));var fs=require('fs');var Redis=require(_0x8566('0x5'));var db=require(_0x8566('0x6'))['db'];var utils=require(_0x8566('0x7'));var logger=require(_0x8566('0x8'))(_0x8566('0x9'));var config=require(_0x8566('0xa'));var jayson=require(_0x8566('0xb'));var client=jayson[_0x8566('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355fce,_0x2ffec4,_0x49f55a){return new BPromise(function(_0x4aaf3f,_0x4045ed){return client['request'](_0x355fce,_0x49f55a)['then'](function(_0x1a01a2){logger['info'](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));logger[_0x8566('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2ffec4,_0x8566('0xe'),JSON[_0x8566('0x10')](_0x1a01a2));if(_0x1a01a2['error']){if(_0x1a01a2['error']['code']===0x1f4){logger['error'](_0x8566('0xd'),_0x2ffec4,_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);return _0x4045ed(_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2ffec4,_0x1a01a2['error']['message']);return _0x4aaf3f(_0x1a01a2['error'][_0x8566('0x12')]);}else{logger[_0x8566('0x13')](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));_0x4aaf3f(_0x1a01a2[_0x8566('0x14')]['message']);}})[_0x8566('0x15')](function(_0xe208c7){logger[_0x8566('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2ffec4,_0xe208c7);_0x4045ed(_0xe208c7);});});} \ No newline at end of file +var _0xcdc2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f011c,_0x36b16a){var _0x41123e=function(_0x263f05){while(--_0x263f05){_0x1f011c['push'](_0x1f011c['shift']());}};_0x41123e(++_0x36b16a);}(_0xcdc2,0x13d));var _0x2cdc=function(_0xa3fc0d,_0x253920){_0xa3fc0d=_0xa3fc0d-0x0;var _0x2ec8ab=_0xcdc2[_0xa3fc0d];return _0x2ec8ab;};'use strict';var _=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var moment=require(_0x2cdc('0x2'));var BPromise=require(_0x2cdc('0x3'));var rs=require(_0x2cdc('0x4'));var fs=require('fs');var Redis=require(_0x2cdc('0x5'));var db=require(_0x2cdc('0x6'))['db'];var utils=require(_0x2cdc('0x7'));var logger=require('../../config/logger')(_0x2cdc('0x8'));var config=require(_0x2cdc('0x9'));var jayson=require(_0x2cdc('0xa'));var client=jayson[_0x2cdc('0xb')][_0x2cdc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb2bdfd,_0x5e438b,_0x492329){return new BPromise(function(_0xe2c158,_0x3e5b2a){return client[_0x2cdc('0xd')](_0xb2bdfd,_0x492329)[_0x2cdc('0xe')](function(_0x5e7b2a){logger[_0x2cdc('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5e438b,'request\x20sent');logger[_0x2cdc('0x10')](_0x2cdc('0x11'),_0x5e438b,_0x2cdc('0x12'),JSON[_0x2cdc('0x13')](_0x5e7b2a));if(_0x5e7b2a['error']){if(_0x5e7b2a[_0x2cdc('0x14')][_0x2cdc('0x15')]===0x1f4){logger['error'](_0x2cdc('0x16'),_0x5e438b,_0x5e7b2a[_0x2cdc('0x14')][_0x2cdc('0x17')]);return _0x3e5b2a(_0x5e7b2a[_0x2cdc('0x14')][_0x2cdc('0x17')]);}logger[_0x2cdc('0x14')](_0x2cdc('0x16'),_0x5e438b,_0x5e7b2a[_0x2cdc('0x14')][_0x2cdc('0x17')]);return _0xe2c158(_0x5e7b2a['error']['message']);}else{logger[_0x2cdc('0xf')](_0x2cdc('0x16'),_0x5e438b,_0x2cdc('0x12'));_0xe2c158(_0x5e7b2a['result'][_0x2cdc('0x17')]);}})[_0x2cdc('0x18')](function(_0x5697df){logger[_0x2cdc('0x14')](_0x2cdc('0x16'),_0x5e438b,_0x5697df);_0x3e5b2a(_0x5697df);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5a2e18f..00b8c2d 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 _0xefb9=['runTranscribe','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe'];(function(_0x35eafb,_0x428b6a){var _0x283b4b=function(_0xa0bdd0){while(--_0xa0bdd0){_0x35eafb['push'](_0x35eafb['shift']());}};_0x283b4b(++_0x428b6a);}(_0xefb9,0x18a));var _0x9efb=function(_0x227cfb,_0x4f42cf){_0x227cfb=_0x227cfb-0x0;var _0x131407=_0xefb9[_0x227cfb];return _0x131407;};'use strict';var multer=require(_0x9efb('0x0'));var util=require(_0x9efb('0x1'));var path=require(_0x9efb('0x2'));var timeout=require(_0x9efb('0x3'));var express=require('express');var router=express[_0x9efb('0x4')]();var fs_extra=require(_0x9efb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9efb('0x6'));var config=require(_0x9efb('0x7'));var controller=require('./voiceRecording.controller');router[_0x9efb('0x8')]('/',auth['isAuthenticated'](),controller[_0x9efb('0x9')]);router[_0x9efb('0x8')](_0x9efb('0xa'),auth[_0x9efb('0xb')](),controller[_0x9efb('0xc')]);router['get'](_0x9efb('0xd'),auth[_0x9efb('0xb')](),controller['show']);router[_0x9efb('0x8')](_0x9efb('0xe'),auth[_0x9efb('0xb')](),controller[_0x9efb('0xf')]);router['get'](_0x9efb('0x10'),controller[_0x9efb('0x11')]);router['get']('/:id/transcribe',auth[_0x9efb('0xb')](),controller[_0x9efb('0x12')]);router['post']('/',auth[_0x9efb('0xb')](),controller[_0x9efb('0x13')]);router[_0x9efb('0x14')](_0x9efb('0x15'),auth[_0x9efb('0xb')](),controller[_0x9efb('0x16')]);router['put'](_0x9efb('0xd'),auth[_0x9efb('0xb')](),controller[_0x9efb('0x17')]);router[_0x9efb('0x18')](_0x9efb('0xd'),auth[_0x9efb('0xb')](),controller['destroy']);module[_0x9efb('0x19')]=router; \ No newline at end of file +var _0xa7e8=['fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','show','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','/:id','update','delete','connect-timeout'];(function(_0x35a384,_0x1e102e){var _0x3d6e8e=function(_0xd06b9a){while(--_0xd06b9a){_0x35a384['push'](_0x35a384['shift']());}};_0x3d6e8e(++_0x1e102e);}(_0xa7e8,0xaf));var _0x8a7e=function(_0x39e146,_0x22d96e){_0x39e146=_0x39e146-0x0;var _0x4e6678=_0xa7e8[_0x39e146];return _0x4e6678;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8a7e('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a7e('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8a7e('0x2'));var config=require(_0x8a7e('0x3'));var controller=require(_0x8a7e('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a7e('0x5')]);router[_0x8a7e('0x6')](_0x8a7e('0x7'),auth[_0x8a7e('0x8')](),controller[_0x8a7e('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8a7e('0xa')]);router[_0x8a7e('0x6')]('/:id/download',auth[_0x8a7e('0x8')](),controller['download']);router[_0x8a7e('0x6')](_0x8a7e('0xb'),controller[_0x8a7e('0xc')]);router[_0x8a7e('0x6')](_0x8a7e('0xd'),auth[_0x8a7e('0x8')](),controller[_0x8a7e('0xe')]);router[_0x8a7e('0xf')]('/',auth[_0x8a7e('0x8')](),controller[_0x8a7e('0x10')]);router[_0x8a7e('0xf')](_0x8a7e('0xd'),auth['isAuthenticated'](),controller[_0x8a7e('0x11')]);router[_0x8a7e('0x12')](_0x8a7e('0x13'),auth[_0x8a7e('0x8')](),controller[_0x8a7e('0x14')]);router[_0x8a7e('0x15')](_0x8a7e('0x13'),auth[_0x8a7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a76a069..d7af5ac 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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 0968bff..df95b9c 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 _0x1edd=['key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','length','includeAll','create','body','find','params','describe','download','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','Not\x20found','downloads','../../components/encryptor','sequelize','col','token','$and','push','filename','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type'];(function(_0x45847e,_0x4f3f8c){var _0x1afeaf=function(_0x1ae165){while(--_0x1ae165){_0x45847e['push'](_0x45847e['shift']());}};_0x1afeaf(++_0x4f3f8c);}(_0x1edd,0xf9));var _0xd1ed=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x1edd[_0x3e69ae];return _0x3d7f42;};'use strict';var emlformat=require(_0xd1ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd1ed('0x1'));var rp=require('request-promise');var moment=require(_0xd1ed('0x2'));var BPromise=require(_0xd1ed('0x3'));var Mustache=require(_0xd1ed('0x4'));var util=require(_0xd1ed('0x5'));var path=require(_0xd1ed('0x6'));var sox=require(_0xd1ed('0x7'));var csv=require(_0xd1ed('0x8'));var ejs=require(_0xd1ed('0x9'));var fs=require('fs');var fs_extra=require(_0xd1ed('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd1ed('0xb'));var jsforce=require(_0xd1ed('0xc'));var deskjs=require(_0xd1ed('0xd'));var toCsv=require(_0xd1ed('0x8'));var querystring=require('querystring');var Papa=require(_0xd1ed('0xe'));var AWS=require(_0xd1ed('0xf'));var uuidv4=require(_0xd1ed('0x10'));var Redis=require('ioredis');var authService=require(_0xd1ed('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd1ed('0x12'));var hardwareService=require(_0xd1ed('0x13'));var logger=require(_0xd1ed('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd1ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x595d58,_0x78144){_0x78144=_0x78144||0xcc;return function(_0x3c4163){if(_0x3c4163){return _0x595d58[_0xd1ed('0x16')](_0x78144);}return _0x595d58[_0xd1ed('0x17')](_0x78144)[_0xd1ed('0x18')]();};}function respondWithResult(_0x3de1ee,_0x337018){_0x337018=_0x337018||0xc8;return function(_0x18e5e1){if(_0x18e5e1){return _0x3de1ee['status'](_0x337018)['json'](_0x18e5e1);}};}function respondWithFilteredResult(_0x1cd5ee,_0x4d0fc1){return function(_0x14089c){if(_0x14089c){var _0x212cfe=typeof _0x4d0fc1[_0xd1ed('0x19')]==='undefined'&&typeof _0x4d0fc1[_0xd1ed('0x1a')]===_0xd1ed('0x1b');var _0xd6eaf7=_0x14089c[_0xd1ed('0x1c')];var _0x486d02=_0x212cfe?0x0:_0x4d0fc1[_0xd1ed('0x19')];var _0x3ff3c6=_0x212cfe?_0x14089c[_0xd1ed('0x1c')]:_0x4d0fc1[_0xd1ed('0x19')]+_0x4d0fc1[_0xd1ed('0x1a')];var _0x3ed73f;if(_0x3ff3c6>=_0xd6eaf7){_0x3ff3c6=_0xd6eaf7;_0x3ed73f=0xc8;}else{_0x3ed73f=0xce;}_0x1cd5ee[_0xd1ed('0x17')](_0x3ed73f);return _0x1cd5ee[_0xd1ed('0x1d')]('Content-Range',_0x486d02+'-'+_0x3ff3c6+'/'+_0xd6eaf7)[_0xd1ed('0x1e')](_0x14089c);}return null;};}function patchUpdates(_0x4885c6){return function(_0x2644bd){try{jsonpatch[_0xd1ed('0x1f')](_0x2644bd,_0x4885c6,!![]);}catch(_0x5b7b2b){return BPromise[_0xd1ed('0x20')](_0x5b7b2b);}return _0x2644bd[_0xd1ed('0x21')]();};}function saveUpdates(_0x294646,_0x47469a){return function(_0x5d742e){if(_0x5d742e){return _0x5d742e[_0xd1ed('0x22')](_0x294646)[_0xd1ed('0x23')](function(_0x3296e4){return _0x3296e4;});}return null;};}function removeEntity(_0x3d5f39,_0x1a4bd4){return function(_0x515658){if(_0x515658){return _0x515658[_0xd1ed('0x24')]()['then'](function(){_0x3d5f39[_0xd1ed('0x17')](0xcc)[_0xd1ed('0x18')]();});}};}function handleEntityNotFound(_0x107a51,_0x451d29){return function(_0x4a87d6){if(!_0x4a87d6){_0x107a51[_0xd1ed('0x16')](0x194);}return _0x4a87d6;};}function handleError(_0x2157a5,_0x5705b6){_0x5705b6=_0x5705b6||0x1f4;return function(_0x3a4382){logger['error'](_0x3a4382[_0xd1ed('0x25')]);if(_0x3a4382[_0xd1ed('0x26')]){delete _0x3a4382['name'];}_0x2157a5['status'](_0x5705b6)[_0xd1ed('0x27')](_0x3a4382);};}exports['index']=function(_0x3fb5cb,_0x1824a0){var _0x3872b8={},_0x71f4f1={},_0x1293c5={'count':0x0,'rows':[]};var _0xe3ab8d=_[_0xd1ed('0x28')](db[_0xd1ed('0x29')][_0xd1ed('0x2a')],function(_0x5ce8cd){return{'name':_0x5ce8cd[_0xd1ed('0x2b')],'type':_0x5ce8cd[_0xd1ed('0x2c')][_0xd1ed('0x2d')]};});_0x71f4f1[_0xd1ed('0x2e')]=_[_0xd1ed('0x2f')](_[_0xd1ed('0x28')](_0xe3ab8d,_0xd1ed('0x26')),['format']);_0x71f4f1[_0xd1ed('0x30')]=_[_0xd1ed('0x31')](_0x3fb5cb[_0xd1ed('0x30')]);_0x71f4f1[_0xd1ed('0x32')]=_[_0xd1ed('0x33')](_0x71f4f1['model'],_0x71f4f1[_0xd1ed('0x30')]);_0x3872b8[_0xd1ed('0x34')]=_[_0xd1ed('0x33')](_0x71f4f1[_0xd1ed('0x2e')],qs[_0xd1ed('0x35')](_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x35')]));_0x3872b8[_0xd1ed('0x34')]=_0x3872b8[_0xd1ed('0x34')]['length']?_0x3872b8[_0xd1ed('0x34')]:_0x71f4f1[_0xd1ed('0x2e')];if(!_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x36')](_0xd1ed('0x37'))){_0x3872b8[_0xd1ed('0x1a')]=qs[_0xd1ed('0x1a')](_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x1a')]);_0x3872b8[_0xd1ed('0x19')]=qs[_0xd1ed('0x19')](_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x19')]);}_0x3872b8[_0xd1ed('0x38')]=qs[_0xd1ed('0x39')](_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x39')]);_0x3872b8[_0xd1ed('0x3a')]=qs[_0xd1ed('0x32')](_['pick'](_0x3fb5cb[_0xd1ed('0x30')],_0x71f4f1[_0xd1ed('0x32')]),_0xe3ab8d);if(_0x3fb5cb[_0xd1ed('0x30')]['filter']){_0x3872b8[_0xd1ed('0x3a')]=_[_0xd1ed('0x3b')](_0x3872b8[_0xd1ed('0x3a')],{'$or':_[_0xd1ed('0x28')](_0xe3ab8d,function(_0x496f17){if(_0x496f17[_0xd1ed('0x2c')]!==_0xd1ed('0x3c')){var _0x1852f9={};_0x1852f9[_0x496f17[_0xd1ed('0x26')]]={'$like':'%'+_0x3fb5cb[_0xd1ed('0x30')][_0xd1ed('0x3d')]+'%'};return _0x1852f9;}})});}_0x3872b8=_[_0xd1ed('0x3b')]({},_0x3872b8,_0x3fb5cb[_0xd1ed('0x3e')]);var _0x630250={'where':_0x3872b8[_0xd1ed('0x3a')]};return db[_0xd1ed('0x29')]['count'](_0x630250)[_0xd1ed('0x23')](function(_0x270289){_0x1293c5[_0xd1ed('0x1c')]=_0x270289;if(_0x3fb5cb[_0xd1ed('0x30')]['includeAll']){_0x3872b8[_0xd1ed('0x3f')]=[{'all':!![]}];}return db[_0xd1ed('0x29')][_0xd1ed('0x40')](_0x3872b8);})[_0xd1ed('0x23')](function(_0x455763){_0x1293c5['rows']=_0x455763;return _0x1293c5;})[_0xd1ed('0x23')](respondWithFilteredResult(_0x1824a0,_0x3872b8))[_0xd1ed('0x41')](handleError(_0x1824a0,null));};exports[_0xd1ed('0x42')]=function(_0x54b0fb,_0x9d85){var _0xa9b404={'raw':![],'where':{'id':_0x54b0fb['params']['id']}},_0x1b49a1={};_0x1b49a1[_0xd1ed('0x2e')]=_['keys'](db[_0xd1ed('0x29')]['rawAttributes']);_0x1b49a1[_0xd1ed('0x30')]=_[_0xd1ed('0x31')](_0x54b0fb[_0xd1ed('0x30')]);_0x1b49a1[_0xd1ed('0x32')]=_[_0xd1ed('0x33')](_0x1b49a1[_0xd1ed('0x2e')],_0x1b49a1[_0xd1ed('0x30')]);_0xa9b404[_0xd1ed('0x34')]=_[_0xd1ed('0x33')](_0x1b49a1[_0xd1ed('0x2e')],qs[_0xd1ed('0x35')](_0x54b0fb[_0xd1ed('0x30')]['fields']));_0xa9b404[_0xd1ed('0x34')]=_0xa9b404[_0xd1ed('0x34')][_0xd1ed('0x43')]?_0xa9b404[_0xd1ed('0x34')]:_0x1b49a1[_0xd1ed('0x2e')];if(_0x54b0fb[_0xd1ed('0x30')][_0xd1ed('0x44')]){_0xa9b404['include']=[{'all':!![]}];}_0xa9b404=_[_0xd1ed('0x3b')]({},_0xa9b404,_0x54b0fb['options']);return db['VoiceRecording']['find'](_0xa9b404)[_0xd1ed('0x23')](handleEntityNotFound(_0x9d85,null))[_0xd1ed('0x23')](respondWithResult(_0x9d85,null))[_0xd1ed('0x41')](handleError(_0x9d85,null));};exports[_0xd1ed('0x45')]=function(_0x5ba33e,_0x5b165f){return db['VoiceRecording']['create'](_0x5ba33e['body'],{})[_0xd1ed('0x23')](respondWithResult(_0x5b165f,0xc9))[_0xd1ed('0x41')](handleError(_0x5b165f,null));};exports[_0xd1ed('0x22')]=function(_0x8b1a89,_0x2d403b){if(_0x8b1a89['body']['id']){delete _0x8b1a89[_0xd1ed('0x46')]['id'];}return db[_0xd1ed('0x29')][_0xd1ed('0x47')]({'where':{'id':_0x8b1a89[_0xd1ed('0x48')]['id']}})[_0xd1ed('0x23')](handleEntityNotFound(_0x2d403b,null))[_0xd1ed('0x23')](saveUpdates(_0x8b1a89[_0xd1ed('0x46')],null))[_0xd1ed('0x23')](respondWithResult(_0x2d403b,null))['catch'](handleError(_0x2d403b,null));};exports[_0xd1ed('0x49')]=function(_0x56cf66,_0x5d2f1a){return db[_0xd1ed('0x29')][_0xd1ed('0x49')]()[_0xd1ed('0x23')](respondWithResult(_0x5d2f1a,null))[_0xd1ed('0x41')](handleError(_0x5d2f1a,null));};exports[_0xd1ed('0x4a')]=function(_0x4ee3de,_0x44d39f,_0x4767b6){var _0x381110=require('../../components/encryptor');var _0x6d109c=![];var _0x564ab2={};if(_0x4ee3de[_0xd1ed('0x30')]['type']&&_0x4ee3de[_0xd1ed('0x30')][_0xd1ed('0x2c')]===_0xd1ed('0x4b')){_0x564ab2[_0xd1ed('0x4b')]=_0x4ee3de[_0xd1ed('0x48')]['id'];}else{_0x564ab2['id']=_0x4ee3de[_0xd1ed('0x48')]['id'];}return db[_0xd1ed('0x29')][_0xd1ed('0x47')]({'where':_0x564ab2,'attributes':['id','value'],'raw':!![]})[_0xd1ed('0x23')](handleEntityNotFound(_0x44d39f,null))['then'](function(_0x4243b4){if(_0x4243b4){var _0x313b22=_0x4243b4['value'];var _0x3bbe23=util[_0xd1ed('0x4c')](_0xd1ed('0x4d'),_0x313b22);if(fs[_0xd1ed('0x4e')](_0x3bbe23)){_0x6d109c=!![];return _0x381110[_0xd1ed('0x4f')](_0x3bbe23,_0x313b22,config[_0xd1ed('0x50')][_0xd1ed('0x51')])[_0xd1ed('0x23')](function(){return _0x4243b4;});}return _0x4243b4;}})[_0xd1ed('0x23')](function(_0x34ec1e){if(_0x34ec1e){var _0xcada3d=_0x34ec1e[_0xd1ed('0x52')];if(!fs[_0xd1ed('0x4e')](_0xcada3d)){throw new db[(_0xd1ed('0x53'))][(_0xd1ed('0x54'))](_0xd1ed('0x55'));}if(_0x34ec1e['filename']){return _0x44d39f[_0xd1ed('0x4a')](_0xcada3d,_0x34ec1e['filename']+path[_0xd1ed('0x56')](_0xcada3d),function(){if(_0x6d109c){fs[_0xd1ed('0x57')](_0xcada3d);}});}else{return _0x44d39f['download'](_0xcada3d,function(_0x1872e3){if(_0x6d109c){fs[_0xd1ed('0x57')](_0xcada3d);}});}}})[_0xd1ed('0x41')](function(_0x688a10){if(_0x688a10['message']===_0xd1ed('0x55')){_0x44d39f[_0xd1ed('0x17')](0x194)[_0xd1ed('0x27')](_0xd1ed('0x58'));}else{return handleError(_0x44d39f,null);}});};exports[_0xd1ed('0x59')]=function(_0x125056,_0x20ae53,_0xbf8f17){var _0x4d41ec=require(_0xd1ed('0x5a'));var _0x1773a7=![];var _0x1d7e28={'$and':[db['sequelize'][_0xd1ed('0x3a')](db['sequelize']['fn']('MD5',db[_0xd1ed('0x5b')][_0xd1ed('0x5c')](_0xd1ed('0x4b'))),_0x125056[_0xd1ed('0x30')][_0xd1ed('0x5d')])]};if(_0x125056[_0xd1ed('0x30')][_0xd1ed('0x2c')]&&_0x125056[_0xd1ed('0x30')]['type']===_0xd1ed('0x4b')){_0x1d7e28[_0xd1ed('0x5e')][_0xd1ed('0x5f')]({'uniqueid':_0x125056['params']['id']});}else{_0x1d7e28[_0xd1ed('0x5e')][_0xd1ed('0x5f')]({'id':_0x125056[_0xd1ed('0x48')]['id']});}return db[_0xd1ed('0x29')][_0xd1ed('0x47')]({'where':_0x1d7e28,'attributes':['id',_0xd1ed('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x20ae53,null))[_0xd1ed('0x23')](function(_0x28f22a){if(_0x28f22a){var _0x33a5d7=util[_0xd1ed('0x4c')](_0xd1ed('0x4d'),_0x28f22a[_0xd1ed('0x52')]);if(fs['existsSync'](_0x33a5d7)){_0x1773a7=!![];return _0x4d41ec[_0xd1ed('0x4f')](_0x33a5d7,_0x28f22a[_0xd1ed('0x52')],config[_0xd1ed('0x50')][_0xd1ed('0x51')])['then'](function(){return _0x28f22a;});}return _0x28f22a;}})['then'](function(_0x3a699e){if(_0x3a699e){if(!fs[_0xd1ed('0x4e')](_0x3a699e[_0xd1ed('0x52')])){throw new db[(_0xd1ed('0x53'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x3a699e[_0xd1ed('0x60')]){return _0x20ae53[_0xd1ed('0x4a')](_0x3a699e[_0xd1ed('0x52')],_0x3a699e['filename']+path[_0xd1ed('0x56')](_0x3a699e[_0xd1ed('0x52')]),function(){if(_0x1773a7){fs[_0xd1ed('0x57')](_0x3a699e['value']);}});}else{return _0x20ae53[_0xd1ed('0x4a')](_0x3a699e[_0xd1ed('0x52')],function(_0x326a28){if(_0x1773a7){fs[_0xd1ed('0x57')](_0x3a699e[_0xd1ed('0x52')]);}});}}})[_0xd1ed('0x41')](handleError(_0x20ae53,null));};exports[_0xd1ed('0x24')]=function(_0x29c1d4,_0x18efb8){return db[_0xd1ed('0x29')]['find']({'where':{'id':_0x29c1d4[_0xd1ed('0x48')]['id']}})['then'](function(_0x3fcc92){if(_['isNil'](_0x3fcc92)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3fcc92;})['then'](function(_0x5b2e5f){var _0x5080fc=_0x5b2e5f[_0xd1ed('0x52')];logger[_0xd1ed('0x61')](_0xd1ed('0x62'),_0x5080fc);if(!_[_0xd1ed('0x63')](_0x5b2e5f['value'])&&fs[_0xd1ed('0x4e')](_0x5080fc)){logger[_0xd1ed('0x61')](_0xd1ed('0x64')+_0x5080fc+_0xd1ed('0x65'));fs[_0xd1ed('0x66')](_0x5080fc);}_0x5080fc=_0x5080fc+'.cypher';if(!_['isNil'](_0x5b2e5f['value'])&&fs['existsSync'](_0x5080fc)){logger[_0xd1ed('0x61')]('File:\x20\x22'+_0x5080fc+_0xd1ed('0x65'));fs[_0xd1ed('0x66')](_0x5080fc);}return _0x5b2e5f;})[_0xd1ed('0x23')](function(_0x36a7f0){if(!_0x36a7f0)throw new InternalError();return _0x36a7f0[_0xd1ed('0x24')]();})[_0xd1ed('0x23')](function(){_0x18efb8['status'](0xcc)[_0xd1ed('0x18')]();})[_0xd1ed('0x41')](handleError(_0x18efb8,null));};function getBucketslist(_0x116a40,_0x4ede9d,_0x2105b2){return new Promise(function(_0x2d1cf4,_0x55398f){var _0x3b8148=new AWS['S3']({'accessKeyId':_0x4ede9d,'secretAccessKey':_0x116a40,'region':_0x2105b2});_0x3b8148[_0xd1ed('0x67')]({},function(_0x21024a,_0x401ca8){if(_0x21024a){return _0x55398f(_0x21024a);}else{return _0x2d1cf4(_0x401ca8);}});});}function createBucket(_0x34666f,_0x3d8f2d,_0xc33597,_0x1cac70){return new Promise(function(_0x4cf494,_0x509284){var _0x2c1f1c=new AWS['S3']({'accessKeyId':_0x3d8f2d,'secretAccessKey':_0x34666f,'region':_0xc33597});_0x2c1f1c['createBucket']({'Bucket':_0x1cac70},function(_0xa9bf48,_0x5bfa44){if(_0xa9bf48){return _0x509284(_0xa9bf48);}else{return _0x4cf494(_0x5bfa44);}});});}function uploadFile(_0x26595a,_0x3cd409,_0x1c6f2a,_0x20ce5f,_0x23088e,_0x3e820e){return new Promise(function(_0x397c5e,_0x144465){var _0x2d8088=new AWS['S3']({'accessKeyId':_0x3cd409,'secretAccessKey':_0x26595a,'region':_0x1c6f2a});_0x2d8088[_0xd1ed('0x68')]({'Bucket':_0x20ce5f,'Key':_0x23088e,'Body':_0x3e820e},function(_0x34036f,_0x591d9a){if(_0x34036f){return _0x144465(_0x34036f);}else{return _0x397c5e(_0x591d9a);}});});}function startTranscribe(_0x1c748c,_0x4b2a74,_0x43bfeb,_0x14873c,_0x259350,_0x11c3da){return new Promise(function(_0x16df5b,_0x33118e){var _0x27b2f6=new AWS[(_0xd1ed('0x69'))]({'accessKeyId':_0x4b2a74,'secretAccessKey':_0x1c748c,'region':_0x43bfeb});_0x27b2f6['startTranscriptionJob']({'TranscriptionJobName':_0x14873c,'LanguageCode':_0x259350,'Media':{'MediaFileUri':_0x11c3da}},function(_0x56682e,_0x2c5917){if(_0x56682e){return _0x33118e(_0x56682e);}else{return _0x16df5b(_0x2c5917);}});});}function transcribe(_0x27ec13,_0x25fcf1,_0x3eb066,_0x10094d,_0x1cd872,_0x435002,_0x358921){return new Promise(function(_0x358ee9,_0x75d4bc){var _0x542a7b={};logger[_0xd1ed('0x61')](util['format'](_0xd1ed('0x6a'),_0x27ec13,_0x1cd872));return uploadFile(_0x25fcf1,_0x3eb066,_0x10094d,_0x1cd872,path[_0xd1ed('0x6b')](_0x435002),fs[_0xd1ed('0x6c')](_0x435002))[_0xd1ed('0x23')](function(_0x73992f){logger[_0xd1ed('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x27ec13,_0x1cd872,_0x73992f['Location']));_0x542a7b[_0xd1ed('0x6d')]=_0x73992f[_0xd1ed('0x6e')];_0x542a7b['location']=_0x73992f[_0xd1ed('0x6f')];logger[_0xd1ed('0x61')](util[_0xd1ed('0x4c')](_0xd1ed('0x70'),_0x27ec13));return startTranscribe(_0x25fcf1,_0x3eb066,_0x10094d,uuidv4(),_0x358921,_0x73992f[_0xd1ed('0x6f')]);})[_0xd1ed('0x23')](function(_0xef3cb1){logger[_0xd1ed('0x61')](util['format'](_0xd1ed('0x71'),_0x27ec13,_0xef3cb1[_0xd1ed('0x72')][_0xd1ed('0x73')]));_0x542a7b[_0xd1ed('0x74')]=_0xef3cb1[_0xd1ed('0x72')][_0xd1ed('0x73')];_0x542a7b['transcribeStatus']=_0xef3cb1[_0xd1ed('0x72')][_0xd1ed('0x75')];return _0x358ee9(_0x542a7b);})[_0xd1ed('0x41')](function(_0x165e93){return _0x75d4bc(_0x165e93);});});}exports['runTranscribe']=function(_0xc5bea,_0x50202e,_0x49acaf){var _0x36b47d;var _0x286617;var _0x3963e4;var _0x18643c=require(_0xd1ed('0x5a'));return db[_0xd1ed('0x29')][_0xd1ed('0x76')]({'where':{'id':_0xc5bea[_0xd1ed('0x48')]['id']}})['then'](function(_0x5a17fc){if(_0x5a17fc){var _0x3e4547=util[_0xd1ed('0x4c')]('%s.cypher',_0x5a17fc[_0xd1ed('0x52')]);if(fs[_0xd1ed('0x4e')](_0x3e4547)){cypher=!![];return _0x18643c['decryptFile'](_0x3e4547,_0x5a17fc['value'],config['secrets'][_0xd1ed('0x51')])['then'](function(){return _0x5a17fc;});}return _0x5a17fc;}})[_0xd1ed('0x23')](function(_0x4a73ce){if(!_0x4a73ce){throw new db[(_0xd1ed('0x53'))]['ValidationError'](_0xd1ed('0x77'));}_0x286617=_0x4a73ce;return db[_0xd1ed('0x78')]['findOne']({'where':{'id':0x1}});})[_0xd1ed('0x23')](handleEntityNotFound(_0x50202e,null))[_0xd1ed('0x23')](function(_0xd0fb48){if(_0xd0fb48){_0x36b47d=_0xd0fb48;if(!_0x36b47d[_0xd1ed('0x79')]||!_0x36b47d['transcribeAccountId']||!_0x36b47d[_0xd1ed('0x7a')]||!_0x36b47d[_0xd1ed('0x7b')]||!_0x36b47d['bucket']){throw new db[(_0xd1ed('0x53'))][(_0xd1ed('0x54'))]('Transcribe\x20not\x20configured');}if(_0xc5bea[_0xd1ed('0x46')][_0xd1ed('0x7c')]&&(!_0x36b47d[_0xd1ed('0x7d')]||!_0x36b47d[_0xd1ed('0x7e')]||!_0x36b47d[_0xd1ed('0x7f')]||!_0x36b47d['language']||!_0x36b47d['bucket'])){throw new db[(_0xd1ed('0x53'))][(_0xd1ed('0x54'))](_0xd1ed('0x80'));}return db[_0xd1ed('0x81')][_0xd1ed('0x76')]({'where':{'id':_0x36b47d['transcribeAccountId']}});}})[_0xd1ed('0x23')](function(_0x4728cd){if(!_0x4728cd){throw new db[(_0xd1ed('0x53'))][(_0xd1ed('0x54'))](_0xd1ed('0x82'));}if(!_0x4728cd[_0xd1ed('0x83')]||!_0x4728cd[_0xd1ed('0x84')]){throw new db[(_0xd1ed('0x53'))][(_0xd1ed('0x54'))]('Cloud\x20Provider\x20not\x20configured');}_0x3963e4=_0x4728cd;return getBucketslist(_0x3963e4[_0xd1ed('0x83')],_0x3963e4[_0xd1ed('0x84')],_0x36b47d[_0xd1ed('0x7a')]);})['then'](function(_0x2fbfa0){if(_0x2fbfa0&&_0x2fbfa0[_0xd1ed('0x85')]){var _0x8da7c9=_[_0xd1ed('0x47')](_0x2fbfa0['Buckets'],function(_0x1bf88e){return _0x1bf88e[_0xd1ed('0x86')]===_0x36b47d[_0xd1ed('0x6d')];});if(!_0x8da7c9){logger[_0xd1ed('0x61')](util[_0xd1ed('0x4c')](_0xd1ed('0x87'),_0xc5bea[_0xd1ed('0x48')]['id'],_0x36b47d[_0xd1ed('0x6d')]));return createBucket(_0x3963e4['data1'],_0x3963e4[_0xd1ed('0x84')],_0x36b47d[_0xd1ed('0x7a')],_0x36b47d[_0xd1ed('0x6d')]);}logger[_0xd1ed('0x61')](util[_0xd1ed('0x4c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xc5bea[_0xd1ed('0x48')]['id'],_0x36b47d['bucket']));return;}})[_0xd1ed('0x23')](function(_0x2426b7){if(_0x286617[_0xd1ed('0x88')]===_0xd1ed('0x89')){return transcribe(_0xc5bea[_0xd1ed('0x48')]['id'],_0x3963e4[_0xd1ed('0x83')],_0x3963e4[_0xd1ed('0x84')],_0x36b47d[_0xd1ed('0x7a')],_0x36b47d[_0xd1ed('0x6d')],_0x286617[_0xd1ed('0x52')],_0x36b47d['language']);}else{logger['info'](util[_0xd1ed('0x4c')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xc5bea[_0xd1ed('0x48')]['id']));return{'transcribeStatus':_0xd1ed('0x8a')};}})[_0xd1ed('0x23')](function(_0x358483){if(_0x358483){_0x358483[_0xd1ed('0x8b')]=_0xc5bea[_0xd1ed('0x46')][_0xd1ed('0x7c')];return _0x286617[_0xd1ed('0x8c')](_0x358483);}})[_0xd1ed('0x23')](respondWithResult(_0x50202e,null))['catch'](handleError(_0x50202e,null));};function writeFile(_0xeaef74,_0x45c867){return new Promise(function(_0x9b6bbd,_0xeaeb33){fs['writeFile'](_0x45c867,_0xeaef74,function(_0x165845,_0x4fc737){if(_0x165845){return _0xeaeb33(_0x165845);}else{return _0x9b6bbd(_0x4fc737);}});});}exports[_0xd1ed('0x8d')]=function(_0x5ac4e6,_0x48b861,_0x34e38a){return db[_0xd1ed('0x29')]['findOne']({'where':{'id':_0x5ac4e6[_0xd1ed('0x48')]['id']}})[_0xd1ed('0x23')](handleEntityNotFound(_0x48b861))[_0xd1ed('0x23')](function(_0x2c222b){if(_0x2c222b&&_0x2c222b[_0xd1ed('0x8e')]){var _0x317695=_0x2c222b[_0xd1ed('0x8e')];var _0x40fe64=config[_0xd1ed('0x8f')]+_0xd1ed('0x90')+_0x2c222b['id']+_0xd1ed('0x91');if(fs['existsSync'](_0x40fe64)){return _0x40fe64;}return writeFile(_0x317695,_0x40fe64)['then'](function(){return _0x40fe64;});}else{throw new db[(_0xd1ed('0x53'))]['ValidationError'](_0xd1ed('0x92'));}})[_0xd1ed('0x23')](function(_0x19c534){return _0x48b861[_0xd1ed('0x4a')](_0x19c534);})[_0xd1ed('0x41')](handleError(_0x48b861));}; \ No newline at end of file +var _0xef07=['VoiceRecording','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','params','rawAttributes','length','include','find','create','body','describe','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','token','$and','push','decryptFile','Sequelize','ValidationError','download','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../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','save','update','then','destroy','error','name','send','map'];(function(_0x1b72bd,_0x61af1c){var _0x241917=function(_0x176122){while(--_0x176122){_0x1b72bd['push'](_0x1b72bd['shift']());}};_0x241917(++_0x61af1c);}(_0xef07,0xfa));var _0x7ef0=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xef07[_0x1bb58c];return _0x277586;};'use strict';var emlformat=require(_0x7ef0('0x0'));var rimraf=require(_0x7ef0('0x1'));var zipdir=require(_0x7ef0('0x2'));var jsonpatch=require(_0x7ef0('0x3'));var rp=require(_0x7ef0('0x4'));var moment=require('moment');var BPromise=require(_0x7ef0('0x5'));var Mustache=require(_0x7ef0('0x6'));var util=require(_0x7ef0('0x7'));var path=require('path');var sox=require(_0x7ef0('0x8'));var csv=require(_0x7ef0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ef0('0xa'));var _=require(_0x7ef0('0xb'));var squel=require(_0x7ef0('0xc'));var crypto=require('crypto');var jsforce=require(_0x7ef0('0xd'));var deskjs=require(_0x7ef0('0xe'));var toCsv=require(_0x7ef0('0x9'));var querystring=require(_0x7ef0('0xf'));var Papa=require(_0x7ef0('0x10'));var AWS=require(_0x7ef0('0x11'));var uuidv4=require(_0x7ef0('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ef0('0x13'));var as=require(_0x7ef0('0x14'));var hardwareService=require(_0x7ef0('0x15'));var logger=require('../../config/logger')(_0x7ef0('0x16'));var utils=require(_0x7ef0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7ef0('0x18'));var db=require(_0x7ef0('0x19'))['db'];function respondWithStatusCode(_0x16a16f,_0x4a87c3){_0x4a87c3=_0x4a87c3||0xcc;return function(_0x576507){if(_0x576507){return _0x16a16f[_0x7ef0('0x1a')](_0x4a87c3);}return _0x16a16f[_0x7ef0('0x1b')](_0x4a87c3)[_0x7ef0('0x1c')]();};}function respondWithResult(_0x53f66f,_0x31d0c7){_0x31d0c7=_0x31d0c7||0xc8;return function(_0x2215a7){if(_0x2215a7){return _0x53f66f[_0x7ef0('0x1b')](_0x31d0c7)[_0x7ef0('0x1d')](_0x2215a7);}};}function respondWithFilteredResult(_0x1847d1,_0xa5f8c4){return function(_0x31f194){if(_0x31f194){var _0x2bea21=typeof _0xa5f8c4[_0x7ef0('0x1e')]===_0x7ef0('0x1f')&&typeof _0xa5f8c4[_0x7ef0('0x20')]===_0x7ef0('0x1f');var _0x35edae=_0x31f194[_0x7ef0('0x21')];var _0x695434=_0x2bea21?0x0:_0xa5f8c4[_0x7ef0('0x1e')];var _0x2defd2=_0x2bea21?_0x31f194['count']:_0xa5f8c4[_0x7ef0('0x1e')]+_0xa5f8c4['limit'];var _0x24f6e0;if(_0x2defd2>=_0x35edae){_0x2defd2=_0x35edae;_0x24f6e0=0xc8;}else{_0x24f6e0=0xce;}_0x1847d1['status'](_0x24f6e0);return _0x1847d1[_0x7ef0('0x22')](_0x7ef0('0x23'),_0x695434+'-'+_0x2defd2+'/'+_0x35edae)['json'](_0x31f194);}return null;};}function patchUpdates(_0x28d89e){return function(_0x198d3d){try{jsonpatch['apply'](_0x198d3d,_0x28d89e,!![]);}catch(_0x112dda){return BPromise['reject'](_0x112dda);}return _0x198d3d[_0x7ef0('0x24')]();};}function saveUpdates(_0xc98523,_0x522c06){return function(_0x420488){if(_0x420488){return _0x420488[_0x7ef0('0x25')](_0xc98523)[_0x7ef0('0x26')](function(_0x309e8d){return _0x309e8d;});}return null;};}function removeEntity(_0x382860,_0x4c317a){return function(_0x27a574){if(_0x27a574){return _0x27a574[_0x7ef0('0x27')]()[_0x7ef0('0x26')](function(){_0x382860[_0x7ef0('0x1b')](0xcc)[_0x7ef0('0x1c')]();});}};}function handleEntityNotFound(_0x247112,_0x1a570c){return function(_0x1df3bd){if(!_0x1df3bd){_0x247112[_0x7ef0('0x1a')](0x194);}return _0x1df3bd;};}function handleError(_0x1ce54a,_0x4ec34b){_0x4ec34b=_0x4ec34b||0x1f4;return function(_0x5e6fdc){logger[_0x7ef0('0x28')](_0x5e6fdc['stack']);if(_0x5e6fdc['name']){delete _0x5e6fdc[_0x7ef0('0x29')];}_0x1ce54a[_0x7ef0('0x1b')](_0x4ec34b)[_0x7ef0('0x2a')](_0x5e6fdc);};}exports['index']=function(_0x4f372a,_0x33c79c){var _0x1085c2={},_0x16a1cf={},_0x2119a1={'count':0x0,'rows':[]};var _0x15885c=_[_0x7ef0('0x2b')](db[_0x7ef0('0x2c')]['rawAttributes'],function(_0x4094f0){return{'name':_0x4094f0[_0x7ef0('0x2d')],'type':_0x4094f0[_0x7ef0('0x2e')][_0x7ef0('0x2f')]};});_0x16a1cf['model']=_[_0x7ef0('0x30')](_['map'](_0x15885c,_0x7ef0('0x29')),['format']);_0x16a1cf[_0x7ef0('0x31')]=_[_0x7ef0('0x32')](_0x4f372a[_0x7ef0('0x31')]);_0x16a1cf[_0x7ef0('0x33')]=_[_0x7ef0('0x34')](_0x16a1cf['model'],_0x16a1cf[_0x7ef0('0x31')]);_0x1085c2[_0x7ef0('0x35')]=_[_0x7ef0('0x34')](_0x16a1cf['model'],qs[_0x7ef0('0x36')](_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x36')]));_0x1085c2[_0x7ef0('0x35')]=_0x1085c2[_0x7ef0('0x35')]['length']?_0x1085c2[_0x7ef0('0x35')]:_0x16a1cf[_0x7ef0('0x37')];if(!_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x38')]('nolimit')){_0x1085c2[_0x7ef0('0x20')]=qs[_0x7ef0('0x20')](_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x20')]);_0x1085c2[_0x7ef0('0x1e')]=qs['offset'](_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x1e')]);}_0x1085c2[_0x7ef0('0x39')]=qs[_0x7ef0('0x3a')](_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x3a')]);_0x1085c2[_0x7ef0('0x3b')]=qs[_0x7ef0('0x33')](_[_0x7ef0('0x3c')](_0x4f372a[_0x7ef0('0x31')],_0x16a1cf[_0x7ef0('0x33')]),_0x15885c);if(_0x4f372a['query'][_0x7ef0('0x3d')]){_0x1085c2[_0x7ef0('0x3b')]=_[_0x7ef0('0x3e')](_0x1085c2['where'],{'$or':_[_0x7ef0('0x2b')](_0x15885c,function(_0x1c22e8){if(_0x1c22e8[_0x7ef0('0x2e')]!==_0x7ef0('0x3f')){var _0x1e1c8f={};_0x1e1c8f[_0x1c22e8[_0x7ef0('0x29')]]={'$like':'%'+_0x4f372a[_0x7ef0('0x31')][_0x7ef0('0x3d')]+'%'};return _0x1e1c8f;}})});}_0x1085c2=_['merge']({},_0x1085c2,_0x4f372a[_0x7ef0('0x40')]);var _0x5aa288={'where':_0x1085c2[_0x7ef0('0x3b')]};return db['VoiceRecording']['count'](_0x5aa288)[_0x7ef0('0x26')](function(_0x548c81){_0x2119a1[_0x7ef0('0x21')]=_0x548c81;if(_0x4f372a['query']['includeAll']){_0x1085c2['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x1085c2);})[_0x7ef0('0x26')](function(_0x1f23fe){_0x2119a1['rows']=_0x1f23fe;return _0x2119a1;})[_0x7ef0('0x26')](respondWithFilteredResult(_0x33c79c,_0x1085c2))[_0x7ef0('0x41')](handleError(_0x33c79c,null));};exports[_0x7ef0('0x42')]=function(_0x485f5e,_0x54206b){var _0x420b91={'raw':![],'where':{'id':_0x485f5e[_0x7ef0('0x43')]['id']}},_0x4660e5={};_0x4660e5[_0x7ef0('0x37')]=_['keys'](db['VoiceRecording'][_0x7ef0('0x44')]);_0x4660e5['query']=_['keys'](_0x485f5e['query']);_0x4660e5[_0x7ef0('0x33')]=_[_0x7ef0('0x34')](_0x4660e5[_0x7ef0('0x37')],_0x4660e5['query']);_0x420b91[_0x7ef0('0x35')]=_['intersection'](_0x4660e5['model'],qs['fields'](_0x485f5e['query'][_0x7ef0('0x36')]));_0x420b91[_0x7ef0('0x35')]=_0x420b91[_0x7ef0('0x35')][_0x7ef0('0x45')]?_0x420b91[_0x7ef0('0x35')]:_0x4660e5[_0x7ef0('0x37')];if(_0x485f5e[_0x7ef0('0x31')]['includeAll']){_0x420b91[_0x7ef0('0x46')]=[{'all':!![]}];}_0x420b91=_['merge']({},_0x420b91,_0x485f5e[_0x7ef0('0x40')]);return db[_0x7ef0('0x2c')][_0x7ef0('0x47')](_0x420b91)[_0x7ef0('0x26')](handleEntityNotFound(_0x54206b,null))[_0x7ef0('0x26')](respondWithResult(_0x54206b,null))[_0x7ef0('0x41')](handleError(_0x54206b,null));};exports['create']=function(_0x460b36,_0x738983){return db[_0x7ef0('0x2c')][_0x7ef0('0x48')](_0x460b36['body'],{})[_0x7ef0('0x26')](respondWithResult(_0x738983,0xc9))['catch'](handleError(_0x738983,null));};exports[_0x7ef0('0x25')]=function(_0x7ebce0,_0xc92c10){if(_0x7ebce0[_0x7ef0('0x49')]['id']){delete _0x7ebce0['body']['id'];}return db[_0x7ef0('0x2c')][_0x7ef0('0x47')]({'where':{'id':_0x7ebce0['params']['id']}})['then'](handleEntityNotFound(_0xc92c10,null))[_0x7ef0('0x26')](saveUpdates(_0x7ebce0[_0x7ef0('0x49')],null))['then'](respondWithResult(_0xc92c10,null))[_0x7ef0('0x41')](handleError(_0xc92c10,null));};exports[_0x7ef0('0x4a')]=function(_0xa55d7e,_0x3ee540){return db[_0x7ef0('0x2c')]['describe']()['then'](respondWithResult(_0x3ee540,null))[_0x7ef0('0x41')](handleError(_0x3ee540,null));};exports['download']=function(_0x19fbae,_0x510d77,_0x33ab8b){var _0x2f1581=require(_0x7ef0('0x4b'));var _0x1a77c7=![];var _0x21f293={};if(_0x19fbae[_0x7ef0('0x31')][_0x7ef0('0x2e')]&&_0x19fbae[_0x7ef0('0x31')][_0x7ef0('0x2e')]===_0x7ef0('0x4c')){_0x21f293['uniqueid']=_0x19fbae[_0x7ef0('0x43')]['id'];}else{_0x21f293['id']=_0x19fbae[_0x7ef0('0x43')]['id'];}return db[_0x7ef0('0x2c')][_0x7ef0('0x47')]({'where':_0x21f293,'attributes':['id',_0x7ef0('0x4d')],'raw':!![]})[_0x7ef0('0x26')](handleEntityNotFound(_0x510d77,null))[_0x7ef0('0x26')](function(_0x449d8e){if(_0x449d8e){var _0x5006c9=_0x449d8e[_0x7ef0('0x4d')];var _0x43178e=util[_0x7ef0('0x4e')](_0x7ef0('0x4f'),_0x5006c9);if(fs[_0x7ef0('0x50')](_0x43178e)){_0x1a77c7=!![];return _0x2f1581['decryptFile'](_0x43178e,_0x5006c9,config[_0x7ef0('0x51')][_0x7ef0('0x52')])[_0x7ef0('0x26')](function(){return _0x449d8e;});}return _0x449d8e;}})['then'](function(_0x101943){if(_0x101943){var _0x51dd52=_0x101943['value'];if(!fs['existsSync'](_0x51dd52)){throw new db['Sequelize']['ValidationError'](_0x7ef0('0x53'));}if(_0x101943[_0x7ef0('0x54')]){return _0x510d77['download'](_0x51dd52,_0x101943[_0x7ef0('0x54')]+path[_0x7ef0('0x55')](_0x51dd52),function(){if(_0x1a77c7){fs[_0x7ef0('0x56')](_0x51dd52);}});}else{return _0x510d77['download'](_0x51dd52,function(_0x2926d0){if(_0x1a77c7){fs[_0x7ef0('0x56')](_0x51dd52);}});}}})[_0x7ef0('0x41')](function(_0x556814){if(_0x556814['message']===_0x7ef0('0x53')){_0x510d77[_0x7ef0('0x1b')](0x194)['send'](_0x7ef0('0x57'));}else{return handleError(_0x510d77,null);}});};exports[_0x7ef0('0x58')]=function(_0x526699,_0x59c944,_0x577a77){var _0x290f30=require(_0x7ef0('0x4b'));var _0x4295b9=![];var _0x23b0ee={'$and':[db[_0x7ef0('0x59')]['where'](db[_0x7ef0('0x59')]['fn'](_0x7ef0('0x5a'),db['sequelize']['col']('uniqueid')),_0x526699[_0x7ef0('0x31')][_0x7ef0('0x5b')])]};if(_0x526699['query']['type']&&_0x526699[_0x7ef0('0x31')]['type']==='uniqueid'){_0x23b0ee[_0x7ef0('0x5c')]['push']({'uniqueid':_0x526699[_0x7ef0('0x43')]['id']});}else{_0x23b0ee[_0x7ef0('0x5c')][_0x7ef0('0x5d')]({'id':_0x526699[_0x7ef0('0x43')]['id']});}return db[_0x7ef0('0x2c')][_0x7ef0('0x47')]({'where':_0x23b0ee,'attributes':['id',_0x7ef0('0x4d')],'raw':!![]})[_0x7ef0('0x26')](handleEntityNotFound(_0x59c944,null))[_0x7ef0('0x26')](function(_0x57e8d4){if(_0x57e8d4){var _0x10cb1c=util[_0x7ef0('0x4e')](_0x7ef0('0x4f'),_0x57e8d4[_0x7ef0('0x4d')]);if(fs[_0x7ef0('0x50')](_0x10cb1c)){_0x4295b9=!![];return _0x290f30[_0x7ef0('0x5e')](_0x10cb1c,_0x57e8d4[_0x7ef0('0x4d')],config[_0x7ef0('0x51')][_0x7ef0('0x52')])['then'](function(){return _0x57e8d4;});}return _0x57e8d4;}})[_0x7ef0('0x26')](function(_0x135892){if(_0x135892){if(!fs[_0x7ef0('0x50')](_0x135892[_0x7ef0('0x4d')])){throw new db[(_0x7ef0('0x5f'))][(_0x7ef0('0x60'))](_0x7ef0('0x53'));}if(_0x135892['filename']){return _0x59c944[_0x7ef0('0x61')](_0x135892[_0x7ef0('0x4d')],_0x135892[_0x7ef0('0x54')]+path[_0x7ef0('0x55')](_0x135892[_0x7ef0('0x4d')]),function(){if(_0x4295b9){fs['unlink'](_0x135892[_0x7ef0('0x4d')]);}});}else{return _0x59c944['download'](_0x135892[_0x7ef0('0x4d')],function(_0x45827c){if(_0x4295b9){fs[_0x7ef0('0x56')](_0x135892[_0x7ef0('0x4d')]);}});}}})[_0x7ef0('0x41')](handleError(_0x59c944,null));};exports[_0x7ef0('0x27')]=function(_0x42979f,_0x16a92b){return db[_0x7ef0('0x2c')][_0x7ef0('0x47')]({'where':{'id':_0x42979f['params']['id']}})['then'](function(_0x217dd6){if(_['isNil'](_0x217dd6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x217dd6;})[_0x7ef0('0x26')](function(_0x46e8a2){var _0x782150=_0x46e8a2['value'];logger['info'](_0x7ef0('0x62'),_0x782150);if(!_[_0x7ef0('0x63')](_0x46e8a2[_0x7ef0('0x4d')])&&fs['existsSync'](_0x782150)){logger[_0x7ef0('0x64')](_0x7ef0('0x65')+_0x782150+_0x7ef0('0x66'));fs[_0x7ef0('0x67')](_0x782150);}_0x782150=_0x782150+_0x7ef0('0x68');if(!_[_0x7ef0('0x63')](_0x46e8a2['value'])&&fs[_0x7ef0('0x50')](_0x782150)){logger['info'](_0x7ef0('0x65')+_0x782150+_0x7ef0('0x66'));fs[_0x7ef0('0x67')](_0x782150);}return _0x46e8a2;})[_0x7ef0('0x26')](function(_0x501df4){if(!_0x501df4)throw new InternalError();return _0x501df4['destroy']();})[_0x7ef0('0x26')](function(){_0x16a92b[_0x7ef0('0x1b')](0xcc)['end']();})['catch'](handleError(_0x16a92b,null));};function getBucketslist(_0x1a4100,_0x26bbf7,_0x15cab7){return new Promise(function(_0x2beb3a,_0x397650){var _0x49a944=new AWS['S3']({'accessKeyId':_0x26bbf7,'secretAccessKey':_0x1a4100,'region':_0x15cab7});_0x49a944[_0x7ef0('0x69')]({},function(_0x154ec7,_0x5b33ef){if(_0x154ec7){return _0x397650(_0x154ec7);}else{return _0x2beb3a(_0x5b33ef);}});});}function createBucket(_0x5b1141,_0x5e7312,_0xda3cc9,_0x325ae3){return new Promise(function(_0x313226,_0x111187){var _0x4193f6=new AWS['S3']({'accessKeyId':_0x5e7312,'secretAccessKey':_0x5b1141,'region':_0xda3cc9});_0x4193f6[_0x7ef0('0x6a')]({'Bucket':_0x325ae3},function(_0xf53d91,_0x1319a5){if(_0xf53d91){return _0x111187(_0xf53d91);}else{return _0x313226(_0x1319a5);}});});}function uploadFile(_0x3ad151,_0x165c1d,_0x4e91a5,_0x261a86,_0x201789,_0x490e8c){return new Promise(function(_0xf5878,_0xc8f3b2){var _0x3a12f3=new AWS['S3']({'accessKeyId':_0x165c1d,'secretAccessKey':_0x3ad151,'region':_0x4e91a5});_0x3a12f3['upload']({'Bucket':_0x261a86,'Key':_0x201789,'Body':_0x490e8c},function(_0x3ea111,_0x167d45){if(_0x3ea111){return _0xc8f3b2(_0x3ea111);}else{return _0xf5878(_0x167d45);}});});}function startTranscribe(_0x5dd34b,_0x31734e,_0x57eabe,_0x49f967,_0x13b64,_0x30f27e){return new Promise(function(_0x283fa5,_0x49cb20){var _0x2d2c77=new AWS[(_0x7ef0('0x6b'))]({'accessKeyId':_0x31734e,'secretAccessKey':_0x5dd34b,'region':_0x57eabe});_0x2d2c77['startTranscriptionJob']({'TranscriptionJobName':_0x49f967,'LanguageCode':_0x13b64,'Media':{'MediaFileUri':_0x30f27e}},function(_0x2e29be,_0x158a54){if(_0x2e29be){return _0x49cb20(_0x2e29be);}else{return _0x283fa5(_0x158a54);}});});}function transcribe(_0x3c9004,_0x529aa0,_0x56a837,_0x2eebc3,_0x325d4e,_0x5c1869,_0x9ff285){return new Promise(function(_0x2bbad0,_0x4c4277){var _0x47fffa={};logger[_0x7ef0('0x64')](util[_0x7ef0('0x4e')](_0x7ef0('0x6c'),_0x3c9004,_0x325d4e));return uploadFile(_0x529aa0,_0x56a837,_0x2eebc3,_0x325d4e,path['basename'](_0x5c1869),fs[_0x7ef0('0x6d')](_0x5c1869))[_0x7ef0('0x26')](function(_0x4b14b5){logger['info'](util[_0x7ef0('0x4e')](_0x7ef0('0x6e'),_0x3c9004,_0x325d4e,_0x4b14b5['Location']));_0x47fffa[_0x7ef0('0x6f')]=_0x4b14b5[_0x7ef0('0x70')];_0x47fffa[_0x7ef0('0x71')]=_0x4b14b5[_0x7ef0('0x72')];logger[_0x7ef0('0x64')](util[_0x7ef0('0x4e')](_0x7ef0('0x73'),_0x3c9004));return startTranscribe(_0x529aa0,_0x56a837,_0x2eebc3,uuidv4(),_0x9ff285,_0x4b14b5['Location']);})[_0x7ef0('0x26')](function(_0x20c77b){logger[_0x7ef0('0x64')](util['format'](_0x7ef0('0x74'),_0x3c9004,_0x20c77b[_0x7ef0('0x75')]['TranscriptionJobName']));_0x47fffa['transcribeName']=_0x20c77b[_0x7ef0('0x75')][_0x7ef0('0x76')];_0x47fffa[_0x7ef0('0x77')]=_0x20c77b[_0x7ef0('0x75')]['TranscriptionJobStatus'];return _0x2bbad0(_0x47fffa);})[_0x7ef0('0x41')](function(_0x3618c6){return _0x4c4277(_0x3618c6);});});}exports[_0x7ef0('0x78')]=function(_0x377a1d,_0xd52e26,_0x116c2d){var _0x3c0cb0;var _0x10588a;var _0x2f5284;var _0x5dcc7a=require(_0x7ef0('0x4b'));return db['VoiceRecording'][_0x7ef0('0x79')]({'where':{'id':_0x377a1d[_0x7ef0('0x43')]['id']}})[_0x7ef0('0x26')](function(_0x2d763e){if(_0x2d763e){var _0x4f4ee8=util[_0x7ef0('0x4e')](_0x7ef0('0x4f'),_0x2d763e[_0x7ef0('0x4d')]);if(fs[_0x7ef0('0x50')](_0x4f4ee8)){cypher=!![];return _0x5dcc7a['decryptFile'](_0x4f4ee8,_0x2d763e['value'],config[_0x7ef0('0x51')][_0x7ef0('0x52')])[_0x7ef0('0x26')](function(){return _0x2d763e;});}return _0x2d763e;}})[_0x7ef0('0x26')](function(_0x326b81){if(!_0x326b81){throw new db['Sequelize'][(_0x7ef0('0x60'))](_0x7ef0('0x7a'));}_0x10588a=_0x326b81;return db[_0x7ef0('0x7b')][_0x7ef0('0x79')]({'where':{'id':0x1}});})[_0x7ef0('0x26')](handleEntityNotFound(_0xd52e26,null))[_0x7ef0('0x26')](function(_0x4fd609){if(_0x4fd609){_0x3c0cb0=_0x4fd609;if(!_0x3c0cb0[_0x7ef0('0x7c')]||!_0x3c0cb0['transcribeAccountId']||!_0x3c0cb0[_0x7ef0('0x7d')]||!_0x3c0cb0[_0x7ef0('0x7e')]||!_0x3c0cb0[_0x7ef0('0x6f')]){throw new db[(_0x7ef0('0x5f'))][(_0x7ef0('0x60'))]('Transcribe\x20not\x20configured');}if(_0x377a1d[_0x7ef0('0x49')]['runSentiment']&&(!_0x3c0cb0['sentiment']||!_0x3c0cb0[_0x7ef0('0x7f')]||!_0x3c0cb0[_0x7ef0('0x80')]||!_0x3c0cb0[_0x7ef0('0x7e')]||!_0x3c0cb0[_0x7ef0('0x6f')])){throw new db['Sequelize'][(_0x7ef0('0x60'))](_0x7ef0('0x81'));}return db['CloudProvider'][_0x7ef0('0x79')]({'where':{'id':_0x3c0cb0[_0x7ef0('0x82')]}});}})[_0x7ef0('0x26')](function(_0x154a1a){if(!_0x154a1a){throw new db[(_0x7ef0('0x5f'))]['ValidationError'](_0x7ef0('0x83'));}if(!_0x154a1a[_0x7ef0('0x84')]||!_0x154a1a[_0x7ef0('0x85')]){throw new db[(_0x7ef0('0x5f'))]['ValidationError'](_0x7ef0('0x86'));}_0x2f5284=_0x154a1a;return getBucketslist(_0x2f5284[_0x7ef0('0x84')],_0x2f5284[_0x7ef0('0x85')],_0x3c0cb0[_0x7ef0('0x7d')]);})[_0x7ef0('0x26')](function(_0x5f5169){if(_0x5f5169&&_0x5f5169['Buckets']){var _0x2dc1ae=_['find'](_0x5f5169[_0x7ef0('0x87')],function(_0x5dbb32){return _0x5dbb32['Name']===_0x3c0cb0['bucket'];});if(!_0x2dc1ae){logger[_0x7ef0('0x64')](util[_0x7ef0('0x4e')](_0x7ef0('0x88'),_0x377a1d[_0x7ef0('0x43')]['id'],_0x3c0cb0[_0x7ef0('0x6f')]));return createBucket(_0x2f5284['data1'],_0x2f5284[_0x7ef0('0x85')],_0x3c0cb0[_0x7ef0('0x7d')],_0x3c0cb0['bucket']);}logger['info'](util[_0x7ef0('0x4e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x377a1d[_0x7ef0('0x43')]['id'],_0x3c0cb0[_0x7ef0('0x6f')]));return;}})[_0x7ef0('0x26')](function(_0x138157){if(_0x10588a['transcribeStatus']===_0x7ef0('0x89')){return transcribe(_0x377a1d['params']['id'],_0x2f5284['data1'],_0x2f5284[_0x7ef0('0x85')],_0x3c0cb0[_0x7ef0('0x7d')],_0x3c0cb0[_0x7ef0('0x6f')],_0x10588a['value'],_0x3c0cb0[_0x7ef0('0x7e')]);}else{logger[_0x7ef0('0x64')](util['format'](_0x7ef0('0x8a'),_0x377a1d[_0x7ef0('0x43')]['id']));return{'transcribeStatus':_0x7ef0('0x8b')};}})[_0x7ef0('0x26')](function(_0x3e75d6){if(_0x3e75d6){_0x3e75d6['tempSentiment']=_0x377a1d[_0x7ef0('0x49')][_0x7ef0('0x8c')];return _0x10588a[_0x7ef0('0x8d')](_0x3e75d6);}})['then'](respondWithResult(_0xd52e26,null))[_0x7ef0('0x41')](handleError(_0xd52e26,null));};function writeFile(_0x3a0f6f,_0xf79272){return new Promise(function(_0x226d35,_0x1d80be){fs['writeFile'](_0xf79272,_0x3a0f6f,function(_0x41d767,_0x4148ea){if(_0x41d767){return _0x1d80be(_0x41d767);}else{return _0x226d35(_0x4148ea);}});});}exports[_0x7ef0('0x8e')]=function(_0xad1e42,_0x11523d,_0x35ce82){return db['VoiceRecording'][_0x7ef0('0x79')]({'where':{'id':_0xad1e42[_0x7ef0('0x43')]['id']}})[_0x7ef0('0x26')](handleEntityNotFound(_0x11523d))['then'](function(_0x4af5f5){if(_0x4af5f5&&_0x4af5f5[_0x7ef0('0x8f')]){var _0x5a2063=_0x4af5f5[_0x7ef0('0x8f')];var _0x2f22ef=config[_0x7ef0('0x90')]+_0x7ef0('0x91')+_0x4af5f5['id']+'.txt';if(fs[_0x7ef0('0x50')](_0x2f22ef)){return _0x2f22ef;}return writeFile(_0x5a2063,_0x2f22ef)[_0x7ef0('0x26')](function(){return _0x2f22ef;});}else{throw new db[(_0x7ef0('0x5f'))][(_0x7ef0('0x60'))](_0x7ef0('0x92'));}})[_0x7ef0('0x26')](function(_0x56a00c){return _0x11523d[_0x7ef0('0x61')](_0x56a00c);})[_0x7ef0('0x41')](handleError(_0x11523d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 571b013..28e72b1 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 _0x4156=['transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x3e0fe9,_0x4f8fa7){var _0x5b98ad=function(_0x264781){while(--_0x264781){_0x3e0fe9['push'](_0x3e0fe9['shift']());}};_0x5b98ad(++_0x4f8fa7);}(_0x4156,0xf1));var _0x6415=function(_0x36fbb7,_0x4845f3){_0x36fbb7=_0x36fbb7-0x0;var _0x3b3bb7=_0x4156[_0x36fbb7];return _0x3b3bb7;};'use strict';var attributes=require(_0x6415('0x0'));module[_0x6415('0x1')]=function(_0x283016,_0x30c6e5){return _0x283016[_0x6415('0x2')]('VoiceRecording',attributes,{'tableName':_0x6415('0x3'),'paranoid':![],'indexes':[{'name':_0x6415('0x4'),'fields':[_0x6415('0x4')]},{'name':_0x6415('0x5'),'fields':[_0x6415('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed95=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x3d66fa,_0x5ae112){var _0x5a0a7f=function(_0x52f7d7){while(--_0x52f7d7){_0x3d66fa['push'](_0x3d66fa['shift']());}};_0x5a0a7f(++_0x5ae112);}(_0xed95,0xb9));var _0x5ed9=function(_0x183c90,_0x3cd577){_0x183c90=_0x183c90-0x0;var _0x33e844=_0xed95[_0x183c90];return _0x33e844;};'use strict';var attributes=require(_0x5ed9('0x0'));module[_0x5ed9('0x1')]=function(_0xbff47,_0x1f8d72){return _0xbff47[_0x5ed9('0x2')](_0x5ed9('0x3'),attributes,{'tableName':_0x5ed9('0x4'),'paranoid':![],'indexes':[{'name':_0x5ed9('0x5'),'fields':[_0x5ed9('0x5')]},{'name':_0x5ed9('0x6'),'fields':[_0x5ed9('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index c1bc38f..735f364 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 _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x32f4,0x154));var _0x432f=function(_0x3a0579,_0x17d535){_0x3a0579=_0x3a0579-0x0;var _0xa6faf3=_0x32f4[_0x3a0579];return _0xa6faf3;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file +var _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x4975,0x86));var _0x5497=function(_0x56d925,_0x2bb994){_0x56d925=_0x56d925-0x0;var _0x32dac1=_0x4975[_0x56d925];return _0x32dac1;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1fab347..620c8dc 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 _0xccf0=['index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x5ea810,_0x292637){var _0x158e25=function(_0x57d0a3){while(--_0x57d0a3){_0x5ea810['push'](_0x5ea810['shift']());}};_0x158e25(++_0x292637);}(_0xccf0,0x1ed));var _0x0ccf=function(_0x2140c4,_0xb8a951){_0x2140c4=_0x2140c4-0x0;var _0x4f5501=_0xccf0[_0x2140c4];return _0x4f5501;};'use strict';var multer=require(_0x0ccf('0x0'));var util=require(_0x0ccf('0x1'));var path=require(_0x0ccf('0x2'));var timeout=require(_0x0ccf('0x3'));var express=require(_0x0ccf('0x4'));var router=express[_0x0ccf('0x5')]();var fs_extra=require(_0x0ccf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0ccf('0x7'));var config=require('../../config/environment');var controller=require(_0x0ccf('0x8'));router[_0x0ccf('0x9')]('/',auth[_0x0ccf('0xa')](),controller[_0x0ccf('0xb')]);router[_0x0ccf('0x9')](_0x0ccf('0xc'),auth[_0x0ccf('0xa')](),controller['describe']);router['get'](_0x0ccf('0xd'),auth[_0x0ccf('0xa')](),controller[_0x0ccf('0xe')]);router[_0x0ccf('0xf')]('/',auth[_0x0ccf('0xa')](),controller[_0x0ccf('0x10')]);router[_0x0ccf('0x11')]('/:id',auth[_0x0ccf('0xa')](),controller[_0x0ccf('0x12')]);router[_0x0ccf('0x13')](_0x0ccf('0xd'),auth[_0x0ccf('0xa')](),controller[_0x0ccf('0x14')]);module['exports']=router; \ No newline at end of file +var _0x12ef=['exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','put','update','delete','destroy'];(function(_0x3250f3,_0x1cd63e){var _0x2c5c69=function(_0x440092){while(--_0x440092){_0x3250f3['push'](_0x3250f3['shift']());}};_0x2c5c69(++_0x1cd63e);}(_0x12ef,0xac));var _0xf12e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x12ef[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0xf12e('0x0'));var util=require('util');var path=require(_0xf12e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf12e('0x2'));var router=express[_0xf12e('0x3')]();var fs_extra=require(_0xf12e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf12e('0x5'));var config=require(_0xf12e('0x6'));var controller=require(_0xf12e('0x7'));router['get']('/',auth[_0xf12e('0x8')](),controller[_0xf12e('0x9')]);router[_0xf12e('0xa')](_0xf12e('0xb'),auth[_0xf12e('0x8')](),controller['describe']);router[_0xf12e('0xa')](_0xf12e('0xc'),auth['isAuthenticated'](),controller[_0xf12e('0xd')]);router['post']('/',auth[_0xf12e('0x8')](),controller['create']);router[_0xf12e('0xe')](_0xf12e('0xc'),auth[_0xf12e('0x8')](),controller[_0xf12e('0xf')]);router[_0xf12e('0x10')](_0xf12e('0xc'),auth[_0xf12e('0x8')](),controller[_0xf12e('0x11')]);module[_0xf12e('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 eaa536e..f47d0cc 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 _0xcd77=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x4d7a30,_0x4c81f2){var _0x797e47=function(_0x400799){while(--_0x400799){_0x4d7a30['push'](_0x4d7a30['shift']());}};_0x797e47(++_0x4c81f2);}(_0xcd77,0x100));var _0x7cd7=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcd77[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x7cd7('0x0'));var moment=require(_0x7cd7('0x1'));module['exports']={'type':{'type':Sequelize[_0x7cd7('0x2')](_0x7cd7('0x3'),_0x7cd7('0x4'))},'result':{'type':Sequelize[_0x7cd7('0x5')]},'transfererchannel':{'type':Sequelize[_0x7cd7('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x7cd7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7cd7('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x7cd7('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7cd7('0x5')]},'transferercontext':{'type':Sequelize[_0x7cd7('0x5')]},'transfererexten':{'type':Sequelize[_0x7cd7('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x7cd7('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x7cd7('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x7cd7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7cd7('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7cd7('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x7cd7('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x7cd7('0x5')]},'isexternal':{'type':Sequelize[_0x7cd7('0x2')](_0x7cd7('0x6'),'No')},'context':{'type':Sequelize[_0x7cd7('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb89a=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0xb89a,0x9c));var _0xab89=function(_0x567751,_0x4287c3){_0x567751=_0x567751-0x0;var _0x21a84c=_0xb89a[_0x567751];return _0x21a84c;};'use strict';var Sequelize=require(_0xab89('0x0'));var moment=require(_0xab89('0x1'));module[_0xab89('0x2')]={'type':{'type':Sequelize[_0xab89('0x3')](_0xab89('0x4'),_0xab89('0x5'))},'result':{'type':Sequelize[_0xab89('0x6')]},'transfererchannel':{'type':Sequelize[_0xab89('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xab89('0x6')]},'transferercalleridname':{'type':Sequelize[_0xab89('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xab89('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xab89('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xab89('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xab89('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xab89('0x6')]},'transfereecontext':{'type':Sequelize[_0xab89('0x6')]},'transfereeexten':{'type':Sequelize[_0xab89('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xab89('0x6')]},'isexternal':{'type':Sequelize[_0xab89('0x3')](_0xab89('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xab89('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a91ed6f..bbc757e 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 _0x7db5=['limit','undefined','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','VoiceTransferReport','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','body','find','describe','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xe0095e,_0x56eb1f){var _0x29e5e9=function(_0x11f7f0){while(--_0x11f7f0){_0xe0095e['push'](_0xe0095e['shift']());}};_0x29e5e9(++_0x56eb1f);}(_0x7db5,0x6b));var _0x57db=function(_0x321645,_0x2512fd){_0x321645=_0x321645-0x0;var _0x17df1a=_0x7db5[_0x321645];return _0x17df1a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x57db('0x0'));var rp=require(_0x57db('0x1'));var moment=require('moment');var BPromise=require(_0x57db('0x2'));var Mustache=require('mustache');var util=require(_0x57db('0x3'));var path=require(_0x57db('0x4'));var sox=require(_0x57db('0x5'));var csv=require(_0x57db('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57db('0x7'));var _=require(_0x57db('0x8'));var squel=require(_0x57db('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x57db('0xa'));var toCsv=require(_0x57db('0x6'));var querystring=require('querystring');var Papa=require(_0x57db('0xb'));var Redis=require(_0x57db('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x57db('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57db('0xe'));var utils=require('../../config/utils');var config=require(_0x57db('0xf'));var licenseUtil=require(_0x57db('0x10'));var db=require(_0x57db('0x11'))['db'];function respondWithStatusCode(_0x51640c,_0xf8688b){_0xf8688b=_0xf8688b||0xcc;return function(_0x41e448){if(_0x41e448){return _0x51640c[_0x57db('0x12')](_0xf8688b);}return _0x51640c[_0x57db('0x13')](_0xf8688b)[_0x57db('0x14')]();};}function respondWithResult(_0x26af70,_0x4c9ded){_0x4c9ded=_0x4c9ded||0xc8;return function(_0x5989da){if(_0x5989da){return _0x26af70[_0x57db('0x13')](_0x4c9ded)[_0x57db('0x15')](_0x5989da);}};}function respondWithFilteredResult(_0x483a69,_0xacf239){return function(_0x11b8c4){if(_0x11b8c4){var _0x7188ef=typeof _0xacf239[_0x57db('0x16')]==='undefined'&&typeof _0xacf239[_0x57db('0x17')]===_0x57db('0x18');var _0x23fe33=_0x11b8c4['count'];var _0x1336e1=_0x7188ef?0x0:_0xacf239[_0x57db('0x16')];var _0x3cff9c=_0x7188ef?_0x11b8c4[_0x57db('0x19')]:_0xacf239[_0x57db('0x16')]+_0xacf239[_0x57db('0x17')];var _0x4a55cb;if(_0x3cff9c>=_0x23fe33){_0x3cff9c=_0x23fe33;_0x4a55cb=0xc8;}else{_0x4a55cb=0xce;}_0x483a69['status'](_0x4a55cb);return _0x483a69[_0x57db('0x1a')](_0x57db('0x1b'),_0x1336e1+'-'+_0x3cff9c+'/'+_0x23fe33)[_0x57db('0x15')](_0x11b8c4);}return null;};}function patchUpdates(_0x5e402b){return function(_0x2c957b){try{jsonpatch['apply'](_0x2c957b,_0x5e402b,!![]);}catch(_0x32f3fd){return BPromise[_0x57db('0x1c')](_0x32f3fd);}return _0x2c957b[_0x57db('0x1d')]();};}function saveUpdates(_0xbd38b7,_0x328f59){return function(_0x31d710){if(_0x31d710){return _0x31d710[_0x57db('0x1e')](_0xbd38b7)['then'](function(_0x110b45){return _0x110b45;});}return null;};}function removeEntity(_0x32f6d6,_0x1b469f){return function(_0x4da1e3){if(_0x4da1e3){return _0x4da1e3['destroy']()[_0x57db('0x1f')](function(){_0x32f6d6['status'](0xcc)[_0x57db('0x14')]();});}};}function handleEntityNotFound(_0x2a74ac,_0x51f0b4){return function(_0x47e66e){if(!_0x47e66e){_0x2a74ac[_0x57db('0x12')](0x194);}return _0x47e66e;};}function handleError(_0x1e0feb,_0x46d5ed){_0x46d5ed=_0x46d5ed||0x1f4;return function(_0x17f8db){logger['error'](_0x17f8db[_0x57db('0x20')]);if(_0x17f8db[_0x57db('0x21')]){delete _0x17f8db['name'];}_0x1e0feb[_0x57db('0x13')](_0x46d5ed)[_0x57db('0x22')](_0x17f8db);};}exports[_0x57db('0x23')]=function(_0x2947c6,_0x1d80f1){var _0x4728d0={},_0x4f2b0b={},_0x37ce96={'count':0x0,'rows':[]};var _0x3581dc=_[_0x57db('0x24')](db[_0x57db('0x25')][_0x57db('0x26')],function(_0x1d5bd1){return{'name':_0x1d5bd1['fieldName'],'type':_0x1d5bd1['type'][_0x57db('0x27')]};});_0x4f2b0b[_0x57db('0x28')]=_['map'](_0x3581dc,'name');_0x4f2b0b['query']=_[_0x57db('0x29')](_0x2947c6[_0x57db('0x2a')]);_0x4f2b0b[_0x57db('0x2b')]=_[_0x57db('0x2c')](_0x4f2b0b[_0x57db('0x28')],_0x4f2b0b[_0x57db('0x2a')]);_0x4728d0['attributes']=_[_0x57db('0x2c')](_0x4f2b0b[_0x57db('0x28')],qs[_0x57db('0x2d')](_0x2947c6['query']['fields']));_0x4728d0[_0x57db('0x2e')]=_0x4728d0[_0x57db('0x2e')][_0x57db('0x2f')]?_0x4728d0['attributes']:_0x4f2b0b[_0x57db('0x28')];if(!_0x2947c6['query']['hasOwnProperty'](_0x57db('0x30'))){_0x4728d0[_0x57db('0x17')]=qs[_0x57db('0x17')](_0x2947c6[_0x57db('0x2a')][_0x57db('0x17')]);_0x4728d0['offset']=qs['offset'](_0x2947c6[_0x57db('0x2a')][_0x57db('0x16')]);}_0x4728d0[_0x57db('0x31')]=qs[_0x57db('0x32')](_0x2947c6[_0x57db('0x2a')][_0x57db('0x32')]);_0x4728d0[_0x57db('0x33')]=qs[_0x57db('0x2b')](_[_0x57db('0x34')](_0x2947c6[_0x57db('0x2a')],_0x4f2b0b[_0x57db('0x2b')]),_0x3581dc);if(_0x2947c6[_0x57db('0x2a')]['filter']){_0x4728d0['where']=_[_0x57db('0x35')](_0x4728d0[_0x57db('0x33')],{'$or':_[_0x57db('0x24')](_0x3581dc,function(_0x4f955d){if(_0x4f955d['type']!==_0x57db('0x36')){var _0x10c660={};_0x10c660[_0x4f955d[_0x57db('0x21')]]={'$like':'%'+_0x2947c6[_0x57db('0x2a')]['filter']+'%'};return _0x10c660;}})});}_0x4728d0=_[_0x57db('0x35')]({},_0x4728d0,_0x2947c6[_0x57db('0x37')]);var _0x5913da={'where':_0x4728d0[_0x57db('0x33')]};return db['VoiceTransferReport']['count'](_0x5913da)[_0x57db('0x1f')](function(_0x4670ea){_0x37ce96[_0x57db('0x19')]=_0x4670ea;if(_0x2947c6[_0x57db('0x2a')][_0x57db('0x38')]){_0x4728d0['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x57db('0x39')](_0x4728d0);})['then'](function(_0xbe2c27){_0x37ce96[_0x57db('0x3a')]=_0xbe2c27;return _0x37ce96;})[_0x57db('0x1f')](respondWithFilteredResult(_0x1d80f1,_0x4728d0))[_0x57db('0x3b')](handleError(_0x1d80f1,null));};exports[_0x57db('0x3c')]=function(_0x205944,_0x20cddb){var _0x26402e={'raw':!![],'where':{'id':_0x205944[_0x57db('0x3d')]['id']}},_0x4416ff={};_0x4416ff[_0x57db('0x28')]=_[_0x57db('0x29')](db['VoiceTransferReport'][_0x57db('0x26')]);_0x4416ff[_0x57db('0x2a')]=_['keys'](_0x205944['query']);_0x4416ff[_0x57db('0x2b')]=_[_0x57db('0x2c')](_0x4416ff[_0x57db('0x28')],_0x4416ff[_0x57db('0x2a')]);_0x26402e[_0x57db('0x2e')]=_[_0x57db('0x2c')](_0x4416ff[_0x57db('0x28')],qs[_0x57db('0x2d')](_0x205944[_0x57db('0x2a')]['fields']));_0x26402e[_0x57db('0x2e')]=_0x26402e[_0x57db('0x2e')][_0x57db('0x2f')]?_0x26402e[_0x57db('0x2e')]:_0x4416ff[_0x57db('0x28')];if(_0x205944[_0x57db('0x2a')][_0x57db('0x38')]){_0x26402e['include']=[{'all':!![]}];}_0x26402e=_[_0x57db('0x35')]({},_0x26402e,_0x205944['options']);return db[_0x57db('0x25')]['find'](_0x26402e)[_0x57db('0x1f')](handleEntityNotFound(_0x20cddb,null))[_0x57db('0x1f')](respondWithResult(_0x20cddb,null))[_0x57db('0x3b')](handleError(_0x20cddb,null));};exports['create']=function(_0x22b4e1,_0x309d91){return db['VoiceTransferReport']['create'](_0x22b4e1[_0x57db('0x3e')],{})[_0x57db('0x1f')](respondWithResult(_0x309d91,0xc9))[_0x57db('0x3b')](handleError(_0x309d91,null));};exports[_0x57db('0x1e')]=function(_0x45610a,_0x25690e){if(_0x45610a[_0x57db('0x3e')]['id']){delete _0x45610a[_0x57db('0x3e')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x45610a[_0x57db('0x3d')]['id']}})['then'](handleEntityNotFound(_0x25690e,null))[_0x57db('0x1f')](saveUpdates(_0x45610a[_0x57db('0x3e')],null))[_0x57db('0x1f')](respondWithResult(_0x25690e,null))[_0x57db('0x3b')](handleError(_0x25690e,null));};exports['destroy']=function(_0x1c8c5e,_0x3b714e){return db[_0x57db('0x25')][_0x57db('0x3f')]({'where':{'id':_0x1c8c5e['params']['id']}})[_0x57db('0x1f')](handleEntityNotFound(_0x3b714e,null))[_0x57db('0x1f')](removeEntity(_0x3b714e,null))[_0x57db('0x3b')](handleError(_0x3b714e,null));};exports[_0x57db('0x40')]=function(_0x182d52,_0x7e8d33){return db[_0x57db('0x25')][_0x57db('0x40')]()[_0x57db('0x1f')](respondWithResult(_0x7e8d33,null))['catch'](handleError(_0x7e8d33,null));}; \ No newline at end of file +var _0xec67=['error','stack','name','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','fields','nolimit','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','intersection','attributes','length','includeAll','find','create','body','destroy','describe','rimraf','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xec67,0xf4));var _0x7ec6=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xec67[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ec6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7ec6('0x1'));var moment=require(_0x7ec6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7ec6('0x3'));var util=require(_0x7ec6('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7ec6('0x5'));var ejs=require(_0x7ec6('0x6'));var fs=require('fs');var fs_extra=require(_0x7ec6('0x7'));var _=require(_0x7ec6('0x8'));var squel=require(_0x7ec6('0x9'));var crypto=require(_0x7ec6('0xa'));var jsforce=require(_0x7ec6('0xb'));var deskjs=require(_0x7ec6('0xc'));var toCsv=require(_0x7ec6('0x5'));var querystring=require(_0x7ec6('0xd'));var Papa=require('papaparse');var Redis=require(_0x7ec6('0xe'));var authService=require(_0x7ec6('0xf'));var qs=require(_0x7ec6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ec6('0x11'));var logger=require(_0x7ec6('0x12'))(_0x7ec6('0x13'));var utils=require(_0x7ec6('0x14'));var config=require(_0x7ec6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x447360,_0x445a48){_0x445a48=_0x445a48||0xcc;return function(_0xdc5254){if(_0xdc5254){return _0x447360['sendStatus'](_0x445a48);}return _0x447360[_0x7ec6('0x16')](_0x445a48)[_0x7ec6('0x17')]();};}function respondWithResult(_0x15dd6e,_0x35ac21){_0x35ac21=_0x35ac21||0xc8;return function(_0x34d127){if(_0x34d127){return _0x15dd6e[_0x7ec6('0x16')](_0x35ac21)['json'](_0x34d127);}};}function respondWithFilteredResult(_0x371586,_0x81a4ef){return function(_0x4cc33d){if(_0x4cc33d){var _0x44a691=typeof _0x81a4ef[_0x7ec6('0x18')]==='undefined'&&typeof _0x81a4ef[_0x7ec6('0x19')]==='undefined';var _0x18da1f=_0x4cc33d[_0x7ec6('0x1a')];var _0x30167c=_0x44a691?0x0:_0x81a4ef[_0x7ec6('0x18')];var _0x5e1a44=_0x44a691?_0x4cc33d[_0x7ec6('0x1a')]:_0x81a4ef[_0x7ec6('0x18')]+_0x81a4ef[_0x7ec6('0x19')];var _0x37e46e;if(_0x5e1a44>=_0x18da1f){_0x5e1a44=_0x18da1f;_0x37e46e=0xc8;}else{_0x37e46e=0xce;}_0x371586['status'](_0x37e46e);return _0x371586[_0x7ec6('0x1b')](_0x7ec6('0x1c'),_0x30167c+'-'+_0x5e1a44+'/'+_0x18da1f)[_0x7ec6('0x1d')](_0x4cc33d);}return null;};}function patchUpdates(_0xf8f9c7){return function(_0x396780){try{jsonpatch[_0x7ec6('0x1e')](_0x396780,_0xf8f9c7,!![]);}catch(_0xe8fc0b){return BPromise[_0x7ec6('0x1f')](_0xe8fc0b);}return _0x396780[_0x7ec6('0x20')]();};}function saveUpdates(_0x3c6bb2,_0x344ef3){return function(_0x539eae){if(_0x539eae){return _0x539eae[_0x7ec6('0x21')](_0x3c6bb2)[_0x7ec6('0x22')](function(_0x3bf1a0){return _0x3bf1a0;});}return null;};}function removeEntity(_0x57cdf2,_0x30c5ec){return function(_0x2ceffb){if(_0x2ceffb){return _0x2ceffb['destroy']()[_0x7ec6('0x22')](function(){_0x57cdf2[_0x7ec6('0x16')](0xcc)[_0x7ec6('0x17')]();});}};}function handleEntityNotFound(_0x2509bb,_0x5d66a3){return function(_0x183108){if(!_0x183108){_0x2509bb[_0x7ec6('0x23')](0x194);}return _0x183108;};}function handleError(_0x36c924,_0x5a9644){_0x5a9644=_0x5a9644||0x1f4;return function(_0x31f8ad){logger[_0x7ec6('0x24')](_0x31f8ad[_0x7ec6('0x25')]);if(_0x31f8ad['name']){delete _0x31f8ad[_0x7ec6('0x26')];}_0x36c924[_0x7ec6('0x16')](_0x5a9644)['send'](_0x31f8ad);};}exports[_0x7ec6('0x27')]=function(_0x33f1c9,_0xe2ca73){var _0x2fa0de={},_0x22546c={},_0x1413ee={'count':0x0,'rows':[]};var _0x19234f=_[_0x7ec6('0x28')](db[_0x7ec6('0x29')]['rawAttributes'],function(_0x453db4){return{'name':_0x453db4[_0x7ec6('0x2a')],'type':_0x453db4[_0x7ec6('0x2b')][_0x7ec6('0x2c')]};});_0x22546c[_0x7ec6('0x2d')]=_[_0x7ec6('0x28')](_0x19234f,_0x7ec6('0x26'));_0x22546c[_0x7ec6('0x2e')]=_[_0x7ec6('0x2f')](_0x33f1c9[_0x7ec6('0x2e')]);_0x22546c[_0x7ec6('0x30')]=_['intersection'](_0x22546c[_0x7ec6('0x2d')],_0x22546c['query']);_0x2fa0de['attributes']=_['intersection'](_0x22546c[_0x7ec6('0x2d')],qs['fields'](_0x33f1c9[_0x7ec6('0x2e')][_0x7ec6('0x31')]));_0x2fa0de['attributes']=_0x2fa0de['attributes']['length']?_0x2fa0de['attributes']:_0x22546c['model'];if(!_0x33f1c9[_0x7ec6('0x2e')]['hasOwnProperty'](_0x7ec6('0x32'))){_0x2fa0de['limit']=qs[_0x7ec6('0x19')](_0x33f1c9['query'][_0x7ec6('0x19')]);_0x2fa0de[_0x7ec6('0x18')]=qs[_0x7ec6('0x18')](_0x33f1c9[_0x7ec6('0x2e')][_0x7ec6('0x18')]);}_0x2fa0de['order']=qs['sort'](_0x33f1c9[_0x7ec6('0x2e')]['sort']);_0x2fa0de[_0x7ec6('0x33')]=qs[_0x7ec6('0x30')](_[_0x7ec6('0x34')](_0x33f1c9[_0x7ec6('0x2e')],_0x22546c[_0x7ec6('0x30')]),_0x19234f);if(_0x33f1c9[_0x7ec6('0x2e')][_0x7ec6('0x35')]){_0x2fa0de[_0x7ec6('0x33')]=_[_0x7ec6('0x36')](_0x2fa0de[_0x7ec6('0x33')],{'$or':_[_0x7ec6('0x28')](_0x19234f,function(_0x25ef2f){if(_0x25ef2f['type']!==_0x7ec6('0x37')){var _0xd8934f={};_0xd8934f[_0x25ef2f[_0x7ec6('0x26')]]={'$like':'%'+_0x33f1c9['query'][_0x7ec6('0x35')]+'%'};return _0xd8934f;}})});}_0x2fa0de=_['merge']({},_0x2fa0de,_0x33f1c9[_0x7ec6('0x38')]);var _0x359d94={'where':_0x2fa0de[_0x7ec6('0x33')]};return db[_0x7ec6('0x29')][_0x7ec6('0x1a')](_0x359d94)['then'](function(_0x813437){_0x1413ee[_0x7ec6('0x1a')]=_0x813437;if(_0x33f1c9[_0x7ec6('0x2e')]['includeAll']){_0x2fa0de[_0x7ec6('0x39')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x2fa0de);})['then'](function(_0x287fef){_0x1413ee[_0x7ec6('0x3a')]=_0x287fef;return _0x1413ee;})['then'](respondWithFilteredResult(_0xe2ca73,_0x2fa0de))[_0x7ec6('0x3b')](handleError(_0xe2ca73,null));};exports['show']=function(_0x46ff9e,_0x1f0fec){var _0x40f95b={'raw':!![],'where':{'id':_0x46ff9e[_0x7ec6('0x3c')]['id']}},_0x4baabb={};_0x4baabb[_0x7ec6('0x2d')]=_[_0x7ec6('0x2f')](db[_0x7ec6('0x29')]['rawAttributes']);_0x4baabb[_0x7ec6('0x2e')]=_[_0x7ec6('0x2f')](_0x46ff9e[_0x7ec6('0x2e')]);_0x4baabb[_0x7ec6('0x30')]=_[_0x7ec6('0x3d')](_0x4baabb[_0x7ec6('0x2d')],_0x4baabb[_0x7ec6('0x2e')]);_0x40f95b[_0x7ec6('0x3e')]=_[_0x7ec6('0x3d')](_0x4baabb[_0x7ec6('0x2d')],qs[_0x7ec6('0x31')](_0x46ff9e['query'][_0x7ec6('0x31')]));_0x40f95b[_0x7ec6('0x3e')]=_0x40f95b['attributes'][_0x7ec6('0x3f')]?_0x40f95b[_0x7ec6('0x3e')]:_0x4baabb[_0x7ec6('0x2d')];if(_0x46ff9e[_0x7ec6('0x2e')][_0x7ec6('0x40')]){_0x40f95b[_0x7ec6('0x39')]=[{'all':!![]}];}_0x40f95b=_[_0x7ec6('0x36')]({},_0x40f95b,_0x46ff9e['options']);return db[_0x7ec6('0x29')][_0x7ec6('0x41')](_0x40f95b)[_0x7ec6('0x22')](handleEntityNotFound(_0x1f0fec,null))['then'](respondWithResult(_0x1f0fec,null))[_0x7ec6('0x3b')](handleError(_0x1f0fec,null));};exports[_0x7ec6('0x42')]=function(_0x3b1ffc,_0x1f3ec7){return db[_0x7ec6('0x29')][_0x7ec6('0x42')](_0x3b1ffc[_0x7ec6('0x43')],{})[_0x7ec6('0x22')](respondWithResult(_0x1f3ec7,0xc9))[_0x7ec6('0x3b')](handleError(_0x1f3ec7,null));};exports[_0x7ec6('0x21')]=function(_0x2ccc11,_0x29464b){if(_0x2ccc11[_0x7ec6('0x43')]['id']){delete _0x2ccc11[_0x7ec6('0x43')]['id'];}return db[_0x7ec6('0x29')][_0x7ec6('0x41')]({'where':{'id':_0x2ccc11[_0x7ec6('0x3c')]['id']}})[_0x7ec6('0x22')](handleEntityNotFound(_0x29464b,null))[_0x7ec6('0x22')](saveUpdates(_0x2ccc11[_0x7ec6('0x43')],null))['then'](respondWithResult(_0x29464b,null))['catch'](handleError(_0x29464b,null));};exports[_0x7ec6('0x44')]=function(_0x12d375,_0x1bec28){return db[_0x7ec6('0x29')][_0x7ec6('0x41')]({'where':{'id':_0x12d375[_0x7ec6('0x3c')]['id']}})[_0x7ec6('0x22')](handleEntityNotFound(_0x1bec28,null))[_0x7ec6('0x22')](removeEntity(_0x1bec28,null))[_0x7ec6('0x3b')](handleError(_0x1bec28,null));};exports[_0x7ec6('0x45')]=function(_0x18261e,_0x5b4174){return db[_0x7ec6('0x29')][_0x7ec6('0x45')]()['then'](respondWithResult(_0x5b4174,null))['catch'](handleError(_0x5b4174,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index bc31068..2018206 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 _0xd3ad=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','util'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0xd3ad,0x197));var _0xdd3a=function(_0xbe8a9a,_0x58ebf2){_0xbe8a9a=_0xbe8a9a-0x0;var _0x2ca573=_0xd3ad[_0xbe8a9a];return _0x2ca573;};'use strict';var _=require('lodash');var util=require(_0xdd3a('0x0'));var logger=require(_0xdd3a('0x1'))(_0xdd3a('0x2'));var moment=require(_0xdd3a('0x3'));var BPromise=require(_0xdd3a('0x4'));var rp=require(_0xdd3a('0x5'));var fs=require('fs');var path=require(_0xdd3a('0x6'));var rimraf=require(_0xdd3a('0x7'));var config=require(_0xdd3a('0x8'));var attributes=require(_0xdd3a('0x9'));module[_0xdd3a('0xa')]=function(_0x2d2bf8,_0x24e360){return _0x2d2bf8['define']('VoiceTransferReport',attributes,{'tableName':_0xdd3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9719=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','../../config/logger','api'];(function(_0x4aefc9,_0x27bfdc){var _0x1537a4=function(_0x3836a6){while(--_0x3836a6){_0x4aefc9['push'](_0x4aefc9['shift']());}};_0x1537a4(++_0x27bfdc);}(_0x9719,0x8e));var _0x9971=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9719[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9971('0x0'))(_0x9971('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9971('0x2'));var rimraf=require(_0x9971('0x3'));var config=require(_0x9971('0x4'));var attributes=require(_0x9971('0x5'));module[_0x9971('0x6')]=function(_0x2fb7fa,_0x2e54c9){return _0x2fb7fa['define'](_0x9971('0x7'),attributes,{'tableName':_0x9971('0x8'),'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 822ed3f..7b0ceb0 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 _0x3444=['error','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3444,0x192));var _0x4344=function(_0x5e1d8a,_0xdb30c0){_0x5e1d8a=_0x5e1d8a-0x0;var _0x264cb1=_0x3444[_0x5e1d8a];return _0x264cb1;};'use strict';var _=require(_0x4344('0x0'));var util=require(_0x4344('0x1'));var moment=require(_0x4344('0x2'));var BPromise=require('bluebird');var rs=require(_0x4344('0x3'));var fs=require('fs');var Redis=require(_0x4344('0x4'));var db=require(_0x4344('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4344('0x6'));var config=require(_0x4344('0x7'));var jayson=require(_0x4344('0x8'));var client=jayson[_0x4344('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bfbd1,_0x487479,_0x3d8d1a){return new BPromise(function(_0x29b9a8,_0x443367){return client[_0x4344('0xa')](_0x2bfbd1,_0x3d8d1a)[_0x4344('0xb')](function(_0x36a6bc){logger[_0x4344('0xc')](_0x4344('0xd'),_0x487479,'request\x20sent');logger[_0x4344('0xe')](_0x4344('0xf'),_0x487479,_0x4344('0x10'),JSON[_0x4344('0x11')](_0x36a6bc));if(_0x36a6bc[_0x4344('0x12')]){if(_0x36a6bc[_0x4344('0x12')]['code']===0x1f4){logger[_0x4344('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x487479,_0x36a6bc['error'][_0x4344('0x13')]);return _0x443367(_0x36a6bc[_0x4344('0x12')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x487479,_0x36a6bc[_0x4344('0x12')][_0x4344('0x13')]);return _0x29b9a8(_0x36a6bc[_0x4344('0x12')]['message']);}else{logger[_0x4344('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x487479,_0x4344('0x10'));_0x29b9a8(_0x36a6bc[_0x4344('0x14')][_0x4344('0x13')]);}})[_0x4344('0x15')](function(_0x2887fa){logger[_0x4344('0x12')](_0x4344('0xd'),_0x487479,_0x2887fa);_0x443367(_0x2887fa);});});}exports['CreateVoiceTransferReport']=function(_0x10f261){var _0x37439b=this;return new Promise(function(_0x140688,_0x295377){return db[_0x4344('0x16')][_0x4344('0x17')](_0x10f261[_0x4344('0x18')],{'raw':_0x10f261[_0x4344('0x19')]?_0x10f261['options'][_0x4344('0x1a')]===undefined?!![]:![]:!![]})[_0x4344('0xb')](function(_0x35e842){logger['info'](_0x4344('0x1b'),_0x10f261);logger['debug'](_0x4344('0x1b'),_0x10f261,JSON[_0x4344('0x11')](_0x35e842));_0x140688(_0x35e842);})['catch'](function(_0x374837){logger['error']('CreateVoiceTransferReport',_0x374837[_0x4344('0x13')],_0x10f261);_0x295377(_0x37439b[_0x4344('0x12')](0x1f4,_0x374837[_0x4344('0x13')]));});});}; \ No newline at end of file +var _0x4a38=['CreateVoiceTransferReport','VoiceTransferReport','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4a38,0x18a));var _0x84a3=function(_0x55f6c4,_0x3434e3){_0x55f6c4=_0x55f6c4-0x0;var _0x3c90bd=_0x4a38[_0x55f6c4];return _0x3c90bd;};'use strict';var _=require(_0x84a3('0x0'));var util=require(_0x84a3('0x1'));var moment=require(_0x84a3('0x2'));var BPromise=require(_0x84a3('0x3'));var rs=require(_0x84a3('0x4'));var fs=require('fs');var Redis=require(_0x84a3('0x5'));var db=require(_0x84a3('0x6'))['db'];var utils=require(_0x84a3('0x7'));var logger=require(_0x84a3('0x8'))(_0x84a3('0x9'));var config=require(_0x84a3('0xa'));var jayson=require(_0x84a3('0xb'));var client=jayson[_0x84a3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x225c97,_0x4e239d,_0x344ab1){return new BPromise(function(_0x35989a,_0x5885a9){return client['request'](_0x225c97,_0x344ab1)['then'](function(_0x175b00){logger[_0x84a3('0xd')](_0x84a3('0xe'),_0x4e239d,_0x84a3('0xf'));logger[_0x84a3('0x10')](_0x84a3('0x11'),_0x4e239d,_0x84a3('0xf'),JSON['stringify'](_0x175b00));if(_0x175b00[_0x84a3('0x12')]){if(_0x175b00[_0x84a3('0x12')][_0x84a3('0x13')]===0x1f4){logger[_0x84a3('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e239d,_0x175b00[_0x84a3('0x12')][_0x84a3('0x14')]);return _0x5885a9(_0x175b00['error']['message']);}logger['error'](_0x84a3('0xe'),_0x4e239d,_0x175b00[_0x84a3('0x12')][_0x84a3('0x14')]);return _0x35989a(_0x175b00['error'][_0x84a3('0x14')]);}else{logger[_0x84a3('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e239d,_0x84a3('0xf'));_0x35989a(_0x175b00['result'][_0x84a3('0x14')]);}})[_0x84a3('0x15')](function(_0x53e88a){logger[_0x84a3('0x12')](_0x84a3('0xe'),_0x4e239d,_0x53e88a);_0x5885a9(_0x53e88a);});});}exports[_0x84a3('0x16')]=function(_0x2b89fc){var _0x2ea54c=this;return new Promise(function(_0x22a8be,_0x50cb51){return db[_0x84a3('0x17')][_0x84a3('0x18')](_0x2b89fc['body'],{'raw':_0x2b89fc[_0x84a3('0x19')]?_0x2b89fc['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28be5c){logger[_0x84a3('0xd')]('CreateVoiceTransferReport',_0x2b89fc);logger[_0x84a3('0x10')](_0x84a3('0x16'),_0x2b89fc,JSON['stringify'](_0x28be5c));_0x22a8be(_0x28be5c);})[_0x84a3('0x15')](function(_0xc8c310){logger[_0x84a3('0x12')](_0x84a3('0x16'),_0xc8c310[_0x84a3('0x14')],_0x2b89fc);_0x50cb51(_0x2ea54c[_0x84a3('0x12')](0x1f4,_0xc8c310[_0x84a3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 414df7a..9ff5361 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 _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x374cca,_0x5554db){var _0x52b2b8=function(_0x425071){while(--_0x425071){_0x374cca['push'](_0x374cca['shift']());}};_0x52b2b8(++_0x5554db);}(_0xaa88,0x137));var _0x8aa8=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0xaa88[_0x51a6d6];return _0x5ef1a8;};'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 +var _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x774a25,_0x46f547){var _0x3dc2fd=function(_0x27de02){while(--_0x27de02){_0x774a25['push'](_0x774a25['shift']());}};_0x3dc2fd(++_0x46f547);}(_0x91a7,0xe7));var _0x791a=function(_0x48c2e3,_0x59c92c){_0x48c2e3=_0x48c2e3-0x0;var _0x335409=_0x91a7[_0x48c2e3];return _0x335409;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 77c34ee..36198cd 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 _0xa07e=['../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','emit','log','handleError:','error','name','status','send','request','then','code','message','catch','User','findOne','agent','VoiceChannels','all','filter','rows','length','\x20not\x20found!','originate\x20fired:','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20executed!','calls\x20fired:','UserId','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','client','http'];(function(_0x5e356c,_0xda116d){var _0x4ecd44=function(_0x2ea73b){while(--_0x2ea73b){_0x5e356c['push'](_0x5e356c['shift']());}};_0x4ecd44(++_0xda116d);}(_0xa07e,0xda));var _0xea07=function(_0x51c8c4,_0x44d471){_0x51c8c4=_0x51c8c4-0x0;var _0x52e415=_0xa07e[_0x51c8c4];return _0x52e415;};'use strict';var path=require(_0xea07('0x0'));var fs=require('fs');var _=require(_0xea07('0x1'));var db=require(_0xea07('0x2'))['db'];var config=require(_0xea07('0x3'));var util=require('util');var BPromise=require(_0xea07('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xea07('0x5')][_0xea07('0x6')]({'port':0x232a});var logger=require(_0xea07('0x7'))('webbarapi');var Redis=require(_0xea07('0x8'));config[_0xea07('0x9')]=_[_0xea07('0xa')](config[_0xea07('0x9')],{'host':_0xea07('0xb'),'port':0x18eb});var io=require(_0xea07('0xc'))(new Redis(config[_0xea07('0x9')]));var Schema=require(_0xea07('0xd'));var originateValidation=new Schema({'userId':{'type':_0xea07('0xe'),'required':[!![],_0xea07('0xf')]},'callNumber':{'type':'string','required':[!![],_0xea07('0x10')]},'callerId':{'type':_0xea07('0x11')},'callbackUrl':{'type':_0xea07('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xea07('0xe'),'required':[!![],_0xea07('0xf')]},'sessionId':{'type':_0xea07('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xea07('0xf')]},'sessionId':{'type':_0xea07('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xea07('0x11'),'required':[!![],_0xea07('0x12')]},'transferNumber':{'type':_0xea07('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xea07('0xf')]},'sessionId':{'type':_0xea07('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xea07('0xe'),'required':[!![],_0xea07('0xf')]},'sessionId':{'type':_0xea07('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xea07('0xe'),'required':[!![],_0xea07('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0xea07('0xe'),'required':[!![],_0xea07('0xf')]}});function emit(_0x39a9e9,_0x25f7f6,_0x34c1dd){logger[_0xea07('0x13')](_0x39a9e9,_0x25f7f6,JSON['stringify'](_0x34c1dd));io['to'](_0x39a9e9)[_0xea07('0x14')](_0x25f7f6,_0x34c1dd);}function handleError(_0x1f8a0d){return function(_0x34662a){console[_0xea07('0x15')](_0xea07('0x16'),_0x34662a,_0x34662a instanceof RangeError);logger[_0xea07('0x17')](_0x34662a['stack']);if(_0x34662a instanceof RangeError){if(_0x34662a[_0xea07('0x18')]){delete _0x34662a[_0xea07('0x18')];}_0x1f8a0d[_0xea07('0x19')](0x194)[_0xea07('0x1a')](_0x34662a);}else{if(_0x34662a[_0xea07('0x18')]){delete _0x34662a[_0xea07('0x18')];}_0x1f8a0d[_0xea07('0x19')](0x1f4)[_0xea07('0x1a')](_0x34662a);}};}function checkError(){return function(_0x5cc221){if(!_0x5cc221){throw new RangeError('NotFound');}return _0x5cc221;};}function respondWithRpcPromise(_0x2b8aef,_0xdf7209){return new BPromise(function(_0x2fb591,_0xd3a1aa){var _0x5267b3=amiClient;return _0x5267b3[_0xea07('0x1b')](_0x2b8aef,_0xdf7209)[_0xea07('0x1c')](function(_0x42fd68){if(_0x42fd68[_0xea07('0x17')]){if(_0x42fd68[_0xea07('0x17')][_0xea07('0x1d')]===0x1f4){return _0xd3a1aa(_0x42fd68[_0xea07('0x17')][_0xea07('0x1e')]);}return _0x2fb591(_0x42fd68[_0xea07('0x17')][_0xea07('0x1e')]);}else{_0x2fb591(_0x42fd68['result']);}})[_0xea07('0x1f')](function(_0x246406){_0xd3a1aa(_0x246406);});});}function getAgent(_0x575235){return db[_0xea07('0x20')][_0xea07('0x21')]({'where':{'id':_0x575235,'role':_0xea07('0x22')}})['then'](checkError());}function getAgentCheckSession(_0x180b21,_0x2d3903){return new BPromise(function(_0x2dae04,_0x369986){var _0x42b64e=respondWithRpcPromise(_0xea07('0x23'));var _0x37b781=getAgent(_0x180b21);Promise[_0xea07('0x24')]([_0x42b64e,_0x37b781])[_0xea07('0x1c')](function(_0x2dbf9b){var _0x246957=_0x2dbf9b[0x0];var _0x3cc35d=_0x2dbf9b[0x1];var _0x55c39a=_[_0xea07('0x25')](_0x246957[_0xea07('0x26')],function(_0x5cd92f){return _0x5cd92f['UserId']==_0x3cc35d['id']&&_0x5cd92f['sessionId']==_0x2d3903;});if(_0x55c39a[_0xea07('0x27')]==0x1){_0x2dae04(_0x3cc35d);}else{_0x369986(new RangeError('sessionId\x20'+_0x2d3903+_0xea07('0x28')));}});});}exports['originate']=function(_0x498627,_0x2cd086){logger[_0xea07('0x13')](_0xea07('0x29'),_0x498627[_0xea07('0x2a')]);var _0x3a64d9=originateValidation[_0xea07('0xd')](_0x498627['body']);if(_0x3a64d9[_0xea07('0x27')]>0x0){return _0x2cd086[_0xea07('0x19')](0x190)['json'](_0x3a64d9);}var _0x5f58a5=_0x498627[_0xea07('0x2a')]['userId'];var _0x102425=_0x498627[_0xea07('0x2a')][_0xea07('0x2b')];var _0x13bc6c=_0x498627[_0xea07('0x2a')][_0xea07('0x2c')];var _0x333b05=_0x498627[_0xea07('0x2a')][_0xea07('0x2d')];return getAgent(_0x5f58a5)[_0xea07('0x1c')](function(_0x69d351){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x69d351[_0xea07('0x18')]);emit(util[_0xea07('0x2f')](_0xea07('0x30'),_0x69d351['name']),_0xea07('0x31'),{'callNumber':_0x102425,'callerId':_0x13bc6c,'callbackUrl':_0x333b05});return _0x2cd086['status'](0xc8)[_0xea07('0x32')]({'error':![],'message':_0xea07('0x33')});})['catch'](handleError(_0x2cd086));};exports[_0xea07('0x34')]=function(_0x57dbc1,_0x2846f9){logger[_0xea07('0x13')](_0xea07('0x35'),_0x57dbc1[_0xea07('0x2a')]);var _0x246ad5=hangupValidation[_0xea07('0xd')](_0x57dbc1[_0xea07('0x2a')]);if(_0x246ad5['length']>0x0){return _0x2846f9[_0xea07('0x19')](0x190)[_0xea07('0x32')](_0x246ad5);}var _0xc71926=_0x57dbc1[_0xea07('0x2a')][_0xea07('0x36')];var _0x94f0bd=_0x57dbc1[_0xea07('0x2a')][_0xea07('0x37')];return getAgent(_0xc71926)[_0xea07('0x1c')](function(_0x4f0f3b){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x4f0f3b['name']);emit(util['format'](_0xea07('0x30'),_0x4f0f3b[_0xea07('0x18')]),_0xea07('0x38'),{'sessionId':_0x94f0bd});return _0x2846f9[_0xea07('0x19')](0xc8)['json']({'error':![],'message':_0xea07('0x39')});})[_0xea07('0x1f')](handleError(_0x2846f9));};exports[_0xea07('0x3a')]=function(_0x183f9a,_0x2a86f3){logger[_0xea07('0x13')]('answer\x20fired:',_0x183f9a[_0xea07('0x2a')]);var _0x9ef089=answerValidation[_0xea07('0xd')](_0x183f9a[_0xea07('0x2a')]);if(_0x9ef089[_0xea07('0x27')]>0x0){return _0x2a86f3[_0xea07('0x19')](0x190)[_0xea07('0x32')](_0x9ef089);}var _0x4eb6a7=_0x183f9a[_0xea07('0x2a')][_0xea07('0x36')];var _0x3ac20b=_0x183f9a[_0xea07('0x2a')][_0xea07('0x37')];return getAgent(_0x4eb6a7)[_0xea07('0x1c')](function(_0x25323f){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x25323f[_0xea07('0x18')]);emit(util[_0xea07('0x2f')](_0xea07('0x30'),_0x25323f[_0xea07('0x18')]),_0xea07('0x3b'),{'sessionId':_0x3ac20b});return _0x2a86f3[_0xea07('0x19')](0xc8)['json']({'error':![],'message':_0xea07('0x3c')});})[_0xea07('0x1f')](handleError(_0x2a86f3));};exports[_0xea07('0x3d')]=function(_0x4f1874,_0x27311a){logger[_0xea07('0x13')](_0xea07('0x3e'),_0x4f1874['body']);var _0x1358bb=holdValidation[_0xea07('0xd')](_0x4f1874['body']);if(_0x1358bb[_0xea07('0x27')]>0x0){return _0x27311a['status'](0x190)[_0xea07('0x32')](_0x1358bb);}var _0x29a9bd=_0x4f1874[_0xea07('0x2a')][_0xea07('0x36')];var _0x52976b=_0x4f1874[_0xea07('0x2a')]['sessionId'];return getAgent(_0x29a9bd)[_0xea07('0x1c')](function(_0x3a8052){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x3a8052[_0xea07('0x18')]);emit(util['format'](_0xea07('0x30'),_0x3a8052[_0xea07('0x18')]),_0xea07('0x3f'),{'sessionId':_0x52976b});return _0x27311a[_0xea07('0x19')](0xc8)[_0xea07('0x32')]({'error':![],'message':_0xea07('0x40')});})[_0xea07('0x1f')](handleError(_0x27311a));};exports[_0xea07('0x41')]=function(_0x1dc89a,_0x31d3e4){logger[_0xea07('0x13')]('unhold\x20fired:',_0x1dc89a[_0xea07('0x2a')]);var _0x1fd0b2=unholdValidation[_0xea07('0xd')](_0x1dc89a[_0xea07('0x2a')]);if(_0x1fd0b2[_0xea07('0x27')]>0x0){return _0x31d3e4[_0xea07('0x19')](0x190)['json'](_0x1fd0b2);}var _0x33853c=_0x1dc89a[_0xea07('0x2a')][_0xea07('0x36')];var _0x32f3dd=_0x1dc89a['body'][_0xea07('0x37')];return getAgent(_0x33853c)['then'](function(_0x39dd73){logger[_0xea07('0x13')]('entityFound:',_0x39dd73['name']);emit(util[_0xea07('0x2f')](_0xea07('0x30'),_0x39dd73[_0xea07('0x18')]),'webbar:unhold',{'sessionId':_0x32f3dd});return _0x31d3e4[_0xea07('0x19')](0xc8)[_0xea07('0x32')]({'error':![],'message':_0xea07('0x42')});})[_0xea07('0x1f')](handleError(_0x31d3e4));};exports['calls']=function(_0x10b068,_0x2452e8){logger[_0xea07('0x13')](_0xea07('0x43'),_0x2452e8[_0xea07('0x2a')]);var _0x3f080c=callsValidation[_0xea07('0xd')](_0x10b068[_0xea07('0x2a')]);if(_0x3f080c[_0xea07('0x27')]>0x0){return _0x2452e8[_0xea07('0x19')](0x190)[_0xea07('0x32')](_0x3f080c);}var _0x262e38=_0x10b068[_0xea07('0x2a')][_0xea07('0x36')];var _0x40d998=respondWithRpcPromise(_0xea07('0x23'));var _0x496440=getAgent(_0x262e38);return Promise[_0xea07('0x24')]([_0x40d998,_0x496440])['then'](function(_0x57be48){var _0x48adb8=_0x57be48[0x0];var _0x2a11ed=_0x57be48[0x1];var _0x4e1a9e=_[_0xea07('0x25')](_0x48adb8[_0xea07('0x26')],function(_0x409eb2){return _0x409eb2[_0xea07('0x44')]==_0x2a11ed['id'];});return _0x2452e8['status'](0xc8)[_0xea07('0x32')]({'count':_0x4e1a9e[_0xea07('0x27')],'rows':_0x4e1a9e});})['catch'](handleError(_0x2452e8));};exports['conference']=function(_0x2220b1,_0x380899){logger[_0xea07('0x13')](_0xea07('0x45'),_0x2220b1[_0xea07('0x2a')]);var _0x3db037=conferenceValidation[_0xea07('0xd')](_0x2220b1[_0xea07('0x2a')]);if(_0x3db037['length']>0x0){return _0x380899[_0xea07('0x19')](0x190)[_0xea07('0x32')](_0x3db037);}var _0x5b0db3=_0x2220b1[_0xea07('0x2a')][_0xea07('0x36')];return getAgent(_0x5b0db3)[_0xea07('0x1c')](function(_0x515d31){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x515d31[_0xea07('0x18')]);emit(util[_0xea07('0x2f')]('user:%s',_0x515d31[_0xea07('0x18')]),'webbar:conference');return _0x380899[_0xea07('0x19')](0xc8)['json']({'error':![],'message':_0xea07('0x46')});})[_0xea07('0x1f')](handleError(_0x380899));};exports[_0xea07('0x47')]=function(_0x1ed2fe,_0x3e1a8a){logger[_0xea07('0x13')](_0xea07('0x48'),_0x1ed2fe['body']);var _0x39330b=transferValidation[_0xea07('0xd')](_0x1ed2fe[_0xea07('0x2a')]);if(_0x39330b['length']>0x0){return _0x3e1a8a[_0xea07('0x19')](0x190)[_0xea07('0x32')](_0x39330b);}var _0x4f4af4=_0x1ed2fe[_0xea07('0x2a')][_0xea07('0x36')];var _0x479d4e=_0x1ed2fe[_0xea07('0x2a')][_0xea07('0x37')];var _0x55cb9c=_0x1ed2fe[_0xea07('0x2a')]['transferNumber'];return getAgent(_0x4f4af4)['then'](function(_0x3ba5be){logger[_0xea07('0x13')](_0xea07('0x2e'),_0x3ba5be[_0xea07('0x18')]);emit(util[_0xea07('0x2f')](_0xea07('0x30'),_0x3ba5be['name']),_0xea07('0x49'),{'sessionId':_0x479d4e,'transferNumber':_0x55cb9c});return _0x3e1a8a['status'](0xc8)[_0xea07('0x32')]({'error':![],'message':_0xea07('0x4a')});})['catch'](handleError(_0x3e1a8a));}; \ No newline at end of file +var _0x5fc6=['webbar:originate','hangup','hangup\x20fired:','userId','sessionId','format','webbar:hangup','hangup\x20executed!','catch','answer','webbar:answer','answer\x20executed!','hold','unhold','webbar:unhold','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','originate','info','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s'];(function(_0x235939,_0x1437c8){var _0x10a825=function(_0x570d5b){while(--_0x570d5b){_0x235939['push'](_0x235939['shift']());}};_0x10a825(++_0x1437c8);}(_0x5fc6,0xfc));var _0x65fc=function(_0x57a612,_0x8a37fb){_0x57a612=_0x57a612-0x0;var _0x10c358=_0x5fc6[_0x57a612];return _0x10c358;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x65fc('0x0'));var db=require(_0x65fc('0x1'))['db'];var config=require(_0x65fc('0x2'));var util=require('util');var BPromise=require(_0x65fc('0x3'));var jayson=require(_0x65fc('0x4'));var amiClient=jayson[_0x65fc('0x5')][_0x65fc('0x6')]({'port':0x232a});var logger=require(_0x65fc('0x7'))('webbarapi');var Redis=require(_0x65fc('0x8'));config[_0x65fc('0x9')]=_[_0x65fc('0xa')](config[_0x65fc('0x9')],{'host':_0x65fc('0xb'),'port':0x18eb});var io=require(_0x65fc('0xc'))(new Redis(config[_0x65fc('0x9')]));var Schema=require(_0x65fc('0xd'));var originateValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x65fc('0xf'),'required':[!![],_0x65fc('0x10')]},'callerId':{'type':_0x65fc('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]},'sessionId':{'type':_0x65fc('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]},'sessionId':{'type':_0x65fc('0xf'),'required':[!![],_0x65fc('0x12')]},'transferNumber':{'type':_0x65fc('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]},'sessionId':{'type':_0x65fc('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],_0x65fc('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x65fc('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0xfbf80b,_0x396a51,_0x46fe01){logger['info'](_0xfbf80b,_0x396a51,JSON['stringify'](_0x46fe01));io['to'](_0xfbf80b)[_0x65fc('0x13')](_0x396a51,_0x46fe01);}function handleError(_0x40fc80){return function(_0x19ca60){console[_0x65fc('0x14')](_0x65fc('0x15'),_0x19ca60,_0x19ca60 instanceof RangeError);logger['error'](_0x19ca60[_0x65fc('0x16')]);if(_0x19ca60 instanceof RangeError){if(_0x19ca60['name']){delete _0x19ca60[_0x65fc('0x17')];}_0x40fc80['status'](0x194)['send'](_0x19ca60);}else{if(_0x19ca60[_0x65fc('0x17')]){delete _0x19ca60[_0x65fc('0x17')];}_0x40fc80[_0x65fc('0x18')](0x1f4)[_0x65fc('0x19')](_0x19ca60);}};}function checkError(){return function(_0x2d18f4){if(!_0x2d18f4){throw new RangeError(_0x65fc('0x1a'));}return _0x2d18f4;};}function respondWithRpcPromise(_0x2328aa,_0x45983a){return new BPromise(function(_0x501f98,_0x55ad22){var _0x3d209b=amiClient;return _0x3d209b[_0x65fc('0x1b')](_0x2328aa,_0x45983a)[_0x65fc('0x1c')](function(_0x414206){if(_0x414206[_0x65fc('0x1d')]){if(_0x414206[_0x65fc('0x1d')][_0x65fc('0x1e')]===0x1f4){return _0x55ad22(_0x414206[_0x65fc('0x1d')][_0x65fc('0x1f')]);}return _0x501f98(_0x414206['error']['message']);}else{_0x501f98(_0x414206[_0x65fc('0x20')]);}})['catch'](function(_0xa06883){_0x55ad22(_0xa06883);});});}function getAgent(_0x5310df){return db[_0x65fc('0x21')][_0x65fc('0x22')]({'where':{'id':_0x5310df,'role':_0x65fc('0x23')}})[_0x65fc('0x1c')](checkError());}function getAgentCheckSession(_0x3685a3,_0x59a63c){return new BPromise(function(_0x4ee52a,_0x3ef582){var _0x2b078e=respondWithRpcPromise(_0x65fc('0x24'));var _0x57b23c=getAgent(_0x3685a3);Promise[_0x65fc('0x25')]([_0x2b078e,_0x57b23c])['then'](function(_0x7ab48b){var _0x2c39eb=_0x7ab48b[0x0];var _0x4b8e6c=_0x7ab48b[0x1];var _0x587bf2=_[_0x65fc('0x26')](_0x2c39eb[_0x65fc('0x27')],function(_0x28a480){return _0x28a480[_0x65fc('0x28')]==_0x4b8e6c['id']&&_0x28a480['sessionId']==_0x59a63c;});if(_0x587bf2[_0x65fc('0x29')]==0x1){_0x4ee52a(_0x4b8e6c);}else{_0x3ef582(new RangeError(_0x65fc('0x2a')+_0x59a63c+'\x20not\x20found!'));}});});}exports[_0x65fc('0x2b')]=function(_0x3dc6de,_0x1a459e){logger[_0x65fc('0x2c')]('originate\x20fired:',_0x3dc6de[_0x65fc('0x2d')]);var _0x4d4cc9=originateValidation[_0x65fc('0xd')](_0x3dc6de[_0x65fc('0x2d')]);if(_0x4d4cc9['length']>0x0){return _0x1a459e[_0x65fc('0x18')](0x190)[_0x65fc('0x2e')](_0x4d4cc9);}var _0x21f98f=_0x3dc6de[_0x65fc('0x2d')]['userId'];var _0x45e666=_0x3dc6de[_0x65fc('0x2d')][_0x65fc('0x2f')];var _0x4365f4=_0x3dc6de['body'][_0x65fc('0x30')];var _0x4d19c4=_0x3dc6de[_0x65fc('0x2d')][_0x65fc('0x31')];return getAgent(_0x21f98f)['then'](function(_0x40ee09){logger[_0x65fc('0x2c')](_0x65fc('0x32'),_0x40ee09[_0x65fc('0x17')]);emit(util['format'](_0x65fc('0x33'),_0x40ee09[_0x65fc('0x17')]),_0x65fc('0x34'),{'callNumber':_0x45e666,'callerId':_0x4365f4,'callbackUrl':_0x4d19c4});return _0x1a459e[_0x65fc('0x18')](0xc8)[_0x65fc('0x2e')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x1a459e));};exports[_0x65fc('0x35')]=function(_0x530262,_0x33d92d){logger[_0x65fc('0x2c')](_0x65fc('0x36'),_0x530262['body']);var _0x116d8f=hangupValidation[_0x65fc('0xd')](_0x530262[_0x65fc('0x2d')]);if(_0x116d8f[_0x65fc('0x29')]>0x0){return _0x33d92d[_0x65fc('0x18')](0x190)[_0x65fc('0x2e')](_0x116d8f);}var _0x17e896=_0x530262[_0x65fc('0x2d')][_0x65fc('0x37')];var _0x450ae8=_0x530262[_0x65fc('0x2d')][_0x65fc('0x38')];return getAgent(_0x17e896)[_0x65fc('0x1c')](function(_0x27ec89){logger[_0x65fc('0x2c')](_0x65fc('0x32'),_0x27ec89['name']);emit(util[_0x65fc('0x39')](_0x65fc('0x33'),_0x27ec89['name']),_0x65fc('0x3a'),{'sessionId':_0x450ae8});return _0x33d92d[_0x65fc('0x18')](0xc8)['json']({'error':![],'message':_0x65fc('0x3b')});})[_0x65fc('0x3c')](handleError(_0x33d92d));};exports[_0x65fc('0x3d')]=function(_0x40dabc,_0x522432){logger[_0x65fc('0x2c')]('answer\x20fired:',_0x40dabc['body']);var _0x571a72=answerValidation[_0x65fc('0xd')](_0x40dabc[_0x65fc('0x2d')]);if(_0x571a72[_0x65fc('0x29')]>0x0){return _0x522432['status'](0x190)['json'](_0x571a72);}var _0x288d3f=_0x40dabc[_0x65fc('0x2d')][_0x65fc('0x37')];var _0x45f466=_0x40dabc['body'][_0x65fc('0x38')];return getAgent(_0x288d3f)['then'](function(_0x1c426){logger[_0x65fc('0x2c')]('entityFound:',_0x1c426[_0x65fc('0x17')]);emit(util[_0x65fc('0x39')]('user:%s',_0x1c426[_0x65fc('0x17')]),_0x65fc('0x3e'),{'sessionId':_0x45f466});return _0x522432[_0x65fc('0x18')](0xc8)[_0x65fc('0x2e')]({'error':![],'message':_0x65fc('0x3f')});})['catch'](handleError(_0x522432));};exports[_0x65fc('0x40')]=function(_0x15a11b,_0x51d094){logger[_0x65fc('0x2c')]('hold\x20fired:',_0x15a11b[_0x65fc('0x2d')]);var _0x39b09e=holdValidation[_0x65fc('0xd')](_0x15a11b[_0x65fc('0x2d')]);if(_0x39b09e[_0x65fc('0x29')]>0x0){return _0x51d094[_0x65fc('0x18')](0x190)[_0x65fc('0x2e')](_0x39b09e);}var _0x39bbfe=_0x15a11b['body']['userId'];var _0xe232cc=_0x15a11b[_0x65fc('0x2d')]['sessionId'];return getAgent(_0x39bbfe)[_0x65fc('0x1c')](function(_0x3e8338){logger[_0x65fc('0x2c')](_0x65fc('0x32'),_0x3e8338['name']);emit(util['format'](_0x65fc('0x33'),_0x3e8338[_0x65fc('0x17')]),'webbar:hold',{'sessionId':_0xe232cc});return _0x51d094['status'](0xc8)[_0x65fc('0x2e')]({'error':![],'message':'hold\x20executed!'});})[_0x65fc('0x3c')](handleError(_0x51d094));};exports[_0x65fc('0x41')]=function(_0x400d1e,_0x449e3e){logger[_0x65fc('0x2c')]('unhold\x20fired:',_0x400d1e[_0x65fc('0x2d')]);var _0x5a7e84=unholdValidation['validate'](_0x400d1e[_0x65fc('0x2d')]);if(_0x5a7e84[_0x65fc('0x29')]>0x0){return _0x449e3e[_0x65fc('0x18')](0x190)['json'](_0x5a7e84);}var _0x4f1a2f=_0x400d1e[_0x65fc('0x2d')][_0x65fc('0x37')];var _0x4a34fa=_0x400d1e[_0x65fc('0x2d')][_0x65fc('0x38')];return getAgent(_0x4f1a2f)[_0x65fc('0x1c')](function(_0x4b5fa2){logger['info']('entityFound:',_0x4b5fa2[_0x65fc('0x17')]);emit(util[_0x65fc('0x39')](_0x65fc('0x33'),_0x4b5fa2[_0x65fc('0x17')]),_0x65fc('0x42'),{'sessionId':_0x4a34fa});return _0x449e3e['status'](0xc8)[_0x65fc('0x2e')]({'error':![],'message':'unhold\x20executed!'});})[_0x65fc('0x3c')](handleError(_0x449e3e));};exports[_0x65fc('0x43')]=function(_0x55853e,_0x30494f){logger[_0x65fc('0x2c')](_0x65fc('0x44'),_0x30494f[_0x65fc('0x2d')]);var _0x35fb22=callsValidation[_0x65fc('0xd')](_0x55853e[_0x65fc('0x2d')]);if(_0x35fb22[_0x65fc('0x29')]>0x0){return _0x30494f[_0x65fc('0x18')](0x190)['json'](_0x35fb22);}var _0x4912c4=_0x55853e[_0x65fc('0x2d')][_0x65fc('0x37')];var _0x58d72a=respondWithRpcPromise(_0x65fc('0x24'));var _0x31a781=getAgent(_0x4912c4);return Promise[_0x65fc('0x25')]([_0x58d72a,_0x31a781])[_0x65fc('0x1c')](function(_0x2b4288){var _0x46a04a=_0x2b4288[0x0];var _0x5a7daf=_0x2b4288[0x1];var _0x58ba82=_[_0x65fc('0x26')](_0x46a04a[_0x65fc('0x27')],function(_0x90be17){return _0x90be17[_0x65fc('0x28')]==_0x5a7daf['id'];});return _0x30494f[_0x65fc('0x18')](0xc8)[_0x65fc('0x2e')]({'count':_0x58ba82['length'],'rows':_0x58ba82});})['catch'](handleError(_0x30494f));};exports[_0x65fc('0x45')]=function(_0x39a829,_0x4205fc){logger['info'](_0x65fc('0x46'),_0x39a829['body']);var _0x9c5fcb=conferenceValidation[_0x65fc('0xd')](_0x39a829[_0x65fc('0x2d')]);if(_0x9c5fcb[_0x65fc('0x29')]>0x0){return _0x4205fc[_0x65fc('0x18')](0x190)[_0x65fc('0x2e')](_0x9c5fcb);}var _0x251fe6=_0x39a829[_0x65fc('0x2d')][_0x65fc('0x37')];return getAgent(_0x251fe6)[_0x65fc('0x1c')](function(_0x7565b6){logger[_0x65fc('0x2c')](_0x65fc('0x32'),_0x7565b6['name']);emit(util[_0x65fc('0x39')]('user:%s',_0x7565b6[_0x65fc('0x17')]),_0x65fc('0x47'));return _0x4205fc[_0x65fc('0x18')](0xc8)['json']({'error':![],'message':_0x65fc('0x48')});})['catch'](handleError(_0x4205fc));};exports[_0x65fc('0x49')]=function(_0x5f38e1,_0x2ca1a0){logger[_0x65fc('0x2c')](_0x65fc('0x4a'),_0x5f38e1[_0x65fc('0x2d')]);var _0x2212ee=transferValidation['validate'](_0x5f38e1['body']);if(_0x2212ee[_0x65fc('0x29')]>0x0){return _0x2ca1a0['status'](0x190)[_0x65fc('0x2e')](_0x2212ee);}var _0x4a5be8=_0x5f38e1['body'][_0x65fc('0x37')];var _0x5e7472=_0x5f38e1[_0x65fc('0x2d')][_0x65fc('0x38')];var _0x48bc20=_0x5f38e1[_0x65fc('0x2d')]['transferNumber'];return getAgent(_0x4a5be8)['then'](function(_0x47f48a){logger[_0x65fc('0x2c')]('entityFound:',_0x47f48a[_0x65fc('0x17')]);emit(util[_0x65fc('0x39')](_0x65fc('0x33'),_0x47f48a[_0x65fc('0x17')]),_0x65fc('0x4b'),{'sessionId':_0x5e7472,'transferNumber':_0x48bc20});return _0x2ca1a0['status'](0xc8)[_0x65fc('0x2e')]({'error':![],'message':'transfer\x20executed!'});})[_0x65fc('0x3c')](handleError(_0x2ca1a0));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 44f2722..d69aae8 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 _0x4e79=['isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','addAgents','/:id/notify','/:id/send','send','put','destroy','delete','/:id/dispositions','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xc6ea98,_0x1f0fe7){var _0x154999=function(_0x5c0555){while(--_0x5c0555){_0xc6ea98['push'](_0xc6ea98['shift']());}};_0x154999(++_0x1f0fe7);}(_0x4e79,0x116));var _0x94e7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e79[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x94e7('0x0'));var util=require(_0x94e7('0x1'));var path=require(_0x94e7('0x2'));var timeout=require(_0x94e7('0x3'));var express=require('express');var router=express[_0x94e7('0x4')]();var fs_extra=require(_0x94e7('0x5'));var auth=require(_0x94e7('0x6'));var interaction=require(_0x94e7('0x7'));var config=require(_0x94e7('0x8'));var controller=require('./whatsappAccount.controller');router[_0x94e7('0x9')]('/',auth[_0x94e7('0xa')](),controller[_0x94e7('0xb')]);router[_0x94e7('0x9')]('/describe',auth[_0x94e7('0xa')](),controller[_0x94e7('0xc')]);router['get'](_0x94e7('0xd'),auth[_0x94e7('0xa')](),controller[_0x94e7('0xe')]);router[_0x94e7('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x94e7('0xf')]);router[_0x94e7('0x9')](_0x94e7('0x10'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x11')]);router[_0x94e7('0x9')](_0x94e7('0x12'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x13')]);router['get'](_0x94e7('0x14'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x15')]);router[_0x94e7('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/dispositions',auth[_0x94e7('0xa')](),controller[_0x94e7('0x17')]);router[_0x94e7('0x16')](_0x94e7('0x10'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x18')]);router[_0x94e7('0x16')](_0x94e7('0x12'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x19')]);router[_0x94e7('0x16')](_0x94e7('0x14'),auth[_0x94e7('0xa')](),controller['addApplications']);router[_0x94e7('0x16')](_0x94e7('0x1a'),controller['notify']);router[_0x94e7('0x16')](_0x94e7('0x1b'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x1c')]);router[_0x94e7('0x1d')](_0x94e7('0xd'),auth[_0x94e7('0xa')](),controller['update']);router['delete'](_0x94e7('0xd'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x1e')]);router[_0x94e7('0x1f')](_0x94e7('0x20'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x21')]);router[_0x94e7('0x1f')](_0x94e7('0x10'),auth[_0x94e7('0xa')](),controller[_0x94e7('0x22')]);router[_0x94e7('0x1f')](_0x94e7('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x94e7('0x23')]=router; \ No newline at end of file +var _0xa44b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','index','get','/describe','isAuthenticated','/:id','show','getDispositions','getAgents','getApplications','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xa44b,0x1dc));var _0xba44=function(_0x466b8c,_0x492ed0){_0x466b8c=_0x466b8c-0x0;var _0x3f461d=_0xa44b[_0x466b8c];return _0x3f461d;};'use strict';var multer=require(_0xba44('0x0'));var util=require(_0xba44('0x1'));var path=require(_0xba44('0x2'));var timeout=require(_0xba44('0x3'));var express=require(_0xba44('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xba44('0x5'));var interaction=require(_0xba44('0x6'));var config=require(_0xba44('0x7'));var controller=require(_0xba44('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xba44('0x9')]);router[_0xba44('0xa')](_0xba44('0xb'),auth[_0xba44('0xc')](),controller['describe']);router[_0xba44('0xa')](_0xba44('0xd'),auth[_0xba44('0xc')](),controller[_0xba44('0xe')]);router[_0xba44('0xa')]('/:id/dispositions',auth[_0xba44('0xc')](),controller[_0xba44('0xf')]);router['get']('/:id/canned_answers',auth[_0xba44('0xc')](),controller['getAnswers']);router[_0xba44('0xa')]('/:id/users',auth[_0xba44('0xc')](),controller[_0xba44('0x10')]);router[_0xba44('0xa')]('/:id/applications',auth[_0xba44('0xc')](),controller[_0xba44('0x11')]);router[_0xba44('0x12')]('/',auth[_0xba44('0xc')](),controller['create']);router[_0xba44('0x12')](_0xba44('0x13'),auth[_0xba44('0xc')](),controller[_0xba44('0x14')]);router[_0xba44('0x12')](_0xba44('0x15'),auth[_0xba44('0xc')](),controller[_0xba44('0x16')]);router[_0xba44('0x12')](_0xba44('0x17'),auth[_0xba44('0xc')](),controller[_0xba44('0x18')]);router[_0xba44('0x12')](_0xba44('0x19'),auth[_0xba44('0xc')](),controller[_0xba44('0x1a')]);router['post'](_0xba44('0x1b'),controller[_0xba44('0x1c')]);router['post'](_0xba44('0x1d'),auth[_0xba44('0xc')](),controller[_0xba44('0x1e')]);router[_0xba44('0x1f')](_0xba44('0xd'),auth[_0xba44('0xc')](),controller[_0xba44('0x20')]);router[_0xba44('0x21')](_0xba44('0xd'),auth[_0xba44('0xc')](),controller[_0xba44('0x22')]);router[_0xba44('0x21')](_0xba44('0x13'),auth[_0xba44('0xc')](),controller['removeDispositions']);router[_0xba44('0x21')]('/:id/canned_answers',auth[_0xba44('0xc')](),controller[_0xba44('0x23')]);router['delete'](_0xba44('0x17'),auth['isAuthenticated'](),controller[_0xba44('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index e9decb9..d5cbe24 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 _0xcb59=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x43e2e4,_0x4ad3b4){var _0x1b71d0=function(_0x45812a){while(--_0x45812a){_0x43e2e4['push'](_0x43e2e4['shift']());}};_0x1b71d0(++_0x4ad3b4);}(_0xcb59,0x146));var _0x9cb5=function(_0x35c9c1,_0x155376){_0x35c9c1=_0x35c9c1-0x0;var _0x48c02c=_0xcb59[_0x35c9c1];return _0x48c02c;};'use strict';var Sequelize=require(_0x9cb5('0x0'));var rs=require('randomstring');module[_0x9cb5('0x1')]={'name':{'type':Sequelize[_0x9cb5('0x2')],'unique':_0x9cb5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9cb5('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9cb5('0x2')],'defaultValue':function(){return rs[_0x9cb5('0x4')]();}},'phone':{'type':Sequelize[_0x9cb5('0x2')]},'type':{'type':Sequelize[_0x9cb5('0x5')](_0x9cb5('0x6'),_0x9cb5('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x9cb5('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9cb5('0x8')],'defaultValue':function(){return _0x9cb5('0x9');}},'notificationSound':{'type':Sequelize[_0x9cb5('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cb5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9cb5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9cb5('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cb5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cb5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cb5('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9cb5('0xa')],'defaultValue':![],'comment':_0x9cb5('0xc'),'set':function(_0x1aa378){if(!_0x1aa378){this[_0x9cb5('0xd')](_0x9cb5('0xe'),null);}this[_0x9cb5('0xd')](_0x9cb5('0xf'),_0x1aa378);}},'description':{'type':Sequelize[_0x9cb5('0x2')]}}; \ No newline at end of file +var _0xc44c=['name','generate','ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x594cb5,_0x14dee8){var _0x3df1d5=function(_0x277fbe){while(--_0x277fbe){_0x594cb5['push'](_0x594cb5['shift']());}};_0x3df1d5(++_0x14dee8);}(_0xc44c,0xfb));var _0xcc44=function(_0x722419,_0x4bd14a){_0x722419=_0x722419-0x0;var _0x439ff1=_0xc44c[_0x722419];return _0x439ff1;};'use strict';var Sequelize=require(_0xcc44('0x0'));var rs=require(_0xcc44('0x1'));module[_0xcc44('0x2')]={'name':{'type':Sequelize[_0xcc44('0x3')],'unique':_0xcc44('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xcc44('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcc44('0x3')],'defaultValue':function(){return rs[_0xcc44('0x5')]();}},'phone':{'type':Sequelize[_0xcc44('0x3')]},'type':{'type':Sequelize[_0xcc44('0x6')](_0xcc44('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0xcc44('0x3')]},'baseUrl':{'type':Sequelize[_0xcc44('0x3')]},'authToken':{'type':Sequelize[_0xcc44('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcc44('0x8');}},'notificationSound':{'type':Sequelize[_0xcc44('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcc44('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcc44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xcc44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcc44('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcc44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcc44('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcc44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcc44('0xa')],'comment':_0xcc44('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcc44('0xc'),'set':function(_0x5cd8d2){if(!_0x5cd8d2){this['setDataValue'](_0xcc44('0xd'),null);}this['setDataValue'](_0xcc44('0xe'),_0x5cd8d2);}},'description':{'type':Sequelize[_0xcc44('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 6c23533..be0d25c 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 _0x6069=['From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','ContactId','UserId','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','\x0a','to\x20is\x20mandatory','List','DESC','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','WhatsappAccount','includeAll','findAll','rows','show','params','keys','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','describe','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6069,0x1c1));var _0x9606=function(_0x21aa95,_0x3f9265){_0x21aa95=_0x21aa95-0x0;var _0x4a275a=_0x6069[_0x21aa95];return _0x4a275a;};'use strict';var emlformat=require(_0x9606('0x0'));var rimraf=require(_0x9606('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9606('0x2'));var rp=require(_0x9606('0x3'));var moment=require(_0x9606('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9606('0x5'));var util=require(_0x9606('0x6'));var path=require(_0x9606('0x7'));var sox=require(_0x9606('0x8'));var csv=require(_0x9606('0x9'));var ejs=require(_0x9606('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9606('0xb'));var crypto=require(_0x9606('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9606('0x9'));var querystring=require(_0x9606('0xd'));var Papa=require(_0x9606('0xe'));var Redis=require(_0x9606('0xf'));var authService=require(_0x9606('0x10'));var qs=require(_0x9606('0x11'));var as=require(_0x9606('0x12'));var hardwareService=require(_0x9606('0x13'));var logger=require(_0x9606('0x14'))(_0x9606('0x15'));var utils=require(_0x9606('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9606('0x17'))['db'];config['redis']=_[_0x9606('0x18')](config[_0x9606('0x19')],{'host':_0x9606('0x1a'),'port':0x18eb});var socket=require(_0x9606('0x1b'))(new Redis(config[_0x9606('0x19')]));require(_0x9606('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9606('0x1d')][_0x9606('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5947c0,_0x35e72c,_0x130da6,_0x48f6f8){return new BPromise(function(_0x1f4e6c,_0x389475){var _0x36eb78=_0x48f6f8||client;return _0x36eb78[_0x9606('0x1f')](_0x5947c0,_0x130da6)['then'](function(_0x381f10){logger[_0x9606('0x20')](_0x9606('0x21'),_0x35e72c,'request\x20sent');logger['debug'](_0x9606('0x22'),_0x35e72c,_0x9606('0x23'),JSON[_0x9606('0x24')](_0x381f10));if(_0x381f10['error']){if(_0x381f10['error'][_0x9606('0x25')]===0x1f4){logger['error'](_0x9606('0x21'),_0x35e72c,_0x381f10[_0x9606('0x26')][_0x9606('0x27')]);return _0x389475(_0x381f10['error'][_0x9606('0x27')]);}logger[_0x9606('0x26')](_0x9606('0x21'),_0x35e72c,_0x381f10['error'][_0x9606('0x27')]);return _0x1f4e6c(_0x381f10[_0x9606('0x26')][_0x9606('0x27')]);}else{logger[_0x9606('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x35e72c,_0x9606('0x23'));_0x1f4e6c(_0x381f10['result'][_0x9606('0x27')]);}})['catch'](function(_0xfd3d76){logger[_0x9606('0x26')](_0x9606('0x21'),_0x35e72c,_0xfd3d76);_0x389475(_0xfd3d76);});});}function respondWithStatusCode(_0x4c077f,_0x1d8956){_0x1d8956=_0x1d8956||0xcc;return function(_0x54627f){if(_0x54627f){return _0x4c077f[_0x9606('0x28')](_0x1d8956);}return _0x4c077f[_0x9606('0x29')](_0x1d8956)[_0x9606('0x2a')]();};}function respondWithResult(_0x2e448a,_0xb22295){_0xb22295=_0xb22295||0xc8;return function(_0x21c72a){if(_0x21c72a){return _0x2e448a[_0x9606('0x29')](_0xb22295)[_0x9606('0x2b')](_0x21c72a);}};}function respondWithFilteredResult(_0x11528d,_0x3fab55){return function(_0x52855a){if(_0x52855a){var _0xbd38d6=typeof _0x3fab55[_0x9606('0x2c')]==='undefined'&&typeof _0x3fab55[_0x9606('0x2d')]===_0x9606('0x2e');var _0x2c2b8a=_0x52855a[_0x9606('0x2f')];var _0x32466e=_0xbd38d6?0x0:_0x3fab55[_0x9606('0x2c')];var _0x5b431b=_0xbd38d6?_0x52855a[_0x9606('0x2f')]:_0x3fab55[_0x9606('0x2c')]+_0x3fab55['limit'];var _0x1c2c27;if(_0x5b431b>=_0x2c2b8a){_0x5b431b=_0x2c2b8a;_0x1c2c27=0xc8;}else{_0x1c2c27=0xce;}_0x11528d[_0x9606('0x29')](_0x1c2c27);return _0x11528d['set'](_0x9606('0x30'),_0x32466e+'-'+_0x5b431b+'/'+_0x2c2b8a)[_0x9606('0x2b')](_0x52855a);}return null;};}function patchUpdates(_0x5340b4){return function(_0x3c44b8){try{jsonpatch[_0x9606('0x31')](_0x3c44b8,_0x5340b4,!![]);}catch(_0x1ac210){return BPromise[_0x9606('0x32')](_0x1ac210);}return _0x3c44b8['save']();};}function saveUpdates(_0x5a95f9,_0x138ee9){return function(_0xdb6e38){if(_0xdb6e38){return _0xdb6e38[_0x9606('0x33')](_0x5a95f9)['then'](function(_0x50ea98){return _0x50ea98;});}return null;};}function removeEntity(_0x24c896,_0x513387){return function(_0x5bd819){if(_0x5bd819){return _0x5bd819['destroy']()[_0x9606('0x34')](function(){var _0x3f19aa=_0x5bd819[_0x9606('0x35')]({'plain':!![]});var _0x23c55f='WhatsappAccounts';return db[_0x9606('0x36')][_0x9606('0x37')]({'where':{'type':_0x23c55f,'resourceId':_0x3f19aa['id']}})[_0x9606('0x34')](function(){return _0x5bd819;});})[_0x9606('0x34')](function(){_0x24c896[_0x9606('0x29')](0xcc)[_0x9606('0x2a')]();});}};}function handleEntityNotFound(_0x548de4,_0x5e201d){return function(_0xce60d3){if(!_0xce60d3){_0x548de4[_0x9606('0x28')](0x194);}return _0xce60d3;};}function handleError(_0x208f39,_0x1df525){_0x1df525=_0x1df525||0x1f4;return function(_0x3ca769){logger[_0x9606('0x26')](_0x3ca769['stack']);if(_0x3ca769[_0x9606('0x38')]){delete _0x3ca769[_0x9606('0x38')];}_0x208f39[_0x9606('0x29')](_0x1df525)[_0x9606('0x39')](_0x3ca769);};}exports[_0x9606('0x3a')]=function(_0x21d39b,_0x563156){var _0x3f7fc2={'include':[{'model':db[_0x9606('0x3b')],'as':_0x9606('0x3c')}]},_0x3e0309={},_0x1f7ca5={'count':0x0,'rows':[]};var _0xf57325=_[_0x9606('0x3d')](db['WhatsappAccount'][_0x9606('0x3e')],function(_0x64544f){return{'name':_0x64544f[_0x9606('0x3f')],'type':_0x64544f[_0x9606('0x40')][_0x9606('0x41')]};});_0x3e0309[_0x9606('0x42')]=_[_0x9606('0x3d')](_0xf57325,_0x9606('0x38'));_0x3e0309[_0x9606('0x43')]=_['keys'](_0x21d39b[_0x9606('0x43')]);_0x3e0309['filters']=_['intersection'](_0x3e0309['model'],_0x3e0309[_0x9606('0x43')]);_0x3f7fc2[_0x9606('0x44')]=_[_0x9606('0x45')](_0x3e0309[_0x9606('0x42')],qs['fields'](_0x21d39b[_0x9606('0x43')][_0x9606('0x46')]));_0x3f7fc2[_0x9606('0x44')]=_0x3f7fc2[_0x9606('0x44')]['length']?_0x3f7fc2['attributes']:_0x3e0309[_0x9606('0x42')];if(!_0x21d39b['query'][_0x9606('0x47')](_0x9606('0x48'))){_0x3f7fc2['limit']=qs['limit'](_0x21d39b['query'][_0x9606('0x2d')]);_0x3f7fc2['offset']=qs['offset'](_0x21d39b[_0x9606('0x43')][_0x9606('0x2c')]);}_0x3f7fc2[_0x9606('0x49')]=qs[_0x9606('0x4a')](_0x21d39b[_0x9606('0x43')][_0x9606('0x4a')]);_0x3f7fc2['where']=qs[_0x9606('0x4b')](_[_0x9606('0x4c')](_0x21d39b['query'],_0x3e0309[_0x9606('0x4b')]),_0xf57325);if(_0x21d39b[_0x9606('0x43')][_0x9606('0x4d')]){_0x3f7fc2[_0x9606('0x4e')]=_['merge'](_0x3f7fc2['where'],{'$or':_[_0x9606('0x3d')](_0xf57325,function(_0x3c0b1c){if(_0x3c0b1c['type']!==_0x9606('0x4f')){var _0x32b0ad={};_0x32b0ad[_0x3c0b1c['name']]={'$like':'%'+_0x21d39b[_0x9606('0x43')][_0x9606('0x4d')]+'%'};return _0x32b0ad;}})});}_0x3f7fc2=_[_0x9606('0x50')]({},_0x3f7fc2,_0x21d39b[_0x9606('0x51')]);var _0x1ec593={'where':_0x3f7fc2[_0x9606('0x4e')]};return db[_0x9606('0x52')][_0x9606('0x2f')](_0x1ec593)[_0x9606('0x34')](function(_0x37c335){_0x1f7ca5[_0x9606('0x2f')]=_0x37c335;if(_0x21d39b[_0x9606('0x43')][_0x9606('0x53')]){_0x3f7fc2['include']=[{'all':!![]}];}return db[_0x9606('0x52')][_0x9606('0x54')](_0x3f7fc2);})[_0x9606('0x34')](function(_0x885364){_0x1f7ca5[_0x9606('0x55')]=_0x885364;return _0x1f7ca5;})['then'](respondWithFilteredResult(_0x563156,_0x3f7fc2))['catch'](handleError(_0x563156,null));};exports[_0x9606('0x56')]=function(_0x2fbeb3,_0x5a8251){var _0x3060bd={'raw':![],'where':{'id':_0x2fbeb3[_0x9606('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x9606('0x3c')}]},_0x166a31={};_0x166a31[_0x9606('0x42')]=_[_0x9606('0x58')](db[_0x9606('0x52')][_0x9606('0x3e')]);_0x166a31[_0x9606('0x43')]=_['keys'](_0x2fbeb3[_0x9606('0x43')]);_0x166a31[_0x9606('0x4b')]=_[_0x9606('0x45')](_0x166a31[_0x9606('0x42')],_0x166a31[_0x9606('0x43')]);_0x3060bd[_0x9606('0x44')]=_[_0x9606('0x45')](_0x166a31[_0x9606('0x42')],qs['fields'](_0x2fbeb3[_0x9606('0x43')][_0x9606('0x46')]));_0x3060bd[_0x9606('0x44')]=_0x3060bd['attributes'][_0x9606('0x59')]?_0x3060bd[_0x9606('0x44')]:_0x166a31[_0x9606('0x42')];if(_0x2fbeb3[_0x9606('0x43')]['includeAll']){_0x3060bd[_0x9606('0x5a')]=[{'all':!![]}];}_0x3060bd=_[_0x9606('0x50')]({},_0x3060bd,_0x2fbeb3['options']);return db[_0x9606('0x52')][_0x9606('0x5b')](_0x3060bd)[_0x9606('0x34')](handleEntityNotFound(_0x5a8251,null))[_0x9606('0x34')](respondWithResult(_0x5a8251,null))[_0x9606('0x5c')](handleError(_0x5a8251,null));};exports[_0x9606('0x5d')]=function(_0x49599f,_0x2c4eb1){return db[_0x9606('0x52')][_0x9606('0x5d')](_0x49599f[_0x9606('0x5e')],{})['then'](function(_0x50c6ef){var _0x1f458f=_0x49599f[_0x9606('0x5f')][_0x9606('0x35')]({'plain':!![]});if(!_0x1f458f)throw new Error(_0x9606('0x60'));if(_0x1f458f[_0x9606('0x61')]===_0x9606('0x5f')){var _0x48e1a4=_0x50c6ef[_0x9606('0x35')]({'plain':!![]});var _0x362ac0=_0x9606('0x62');return db['UserProfileSection'][_0x9606('0x5b')]({'where':{'name':_0x362ac0,'userProfileId':_0x1f458f['userProfileId']},'raw':!![]})[_0x9606('0x34')](function(_0x3787d){if(_0x3787d&&_0x3787d['autoAssociation']===0x0){return db['UserProfileResource'][_0x9606('0x5d')]({'name':_0x48e1a4[_0x9606('0x38')],'resourceId':_0x48e1a4['id'],'type':_0x3787d[_0x9606('0x38')],'sectionId':_0x3787d['id']},{})[_0x9606('0x34')](function(){return _0x50c6ef;});}else{return _0x50c6ef;}})[_0x9606('0x5c')](function(_0x3a76b6){logger[_0x9606('0x26')](_0x9606('0x63'),_0x3a76b6);throw _0x3a76b6;});}return _0x50c6ef;})[_0x9606('0x34')](respondWithResult(_0x2c4eb1,0xc9))[_0x9606('0x5c')](handleError(_0x2c4eb1,null));};exports[_0x9606('0x33')]=function(_0x481d23,_0x500ce9){if(_0x481d23[_0x9606('0x5e')]['id']){delete _0x481d23[_0x9606('0x5e')]['id'];}return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0x481d23[_0x9606('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x9606('0x3c')}]})[_0x9606('0x34')](handleEntityNotFound(_0x500ce9,null))[_0x9606('0x34')](saveUpdates(_0x481d23['body'],null))['then'](respondWithResult(_0x500ce9,null))[_0x9606('0x5c')](handleError(_0x500ce9,null));};exports['destroy']=function(_0x478129,_0x5d5eac){return db['WhatsappAccount'][_0x9606('0x5b')]({'where':{'id':_0x478129[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x5d5eac,null))[_0x9606('0x34')](removeEntity(_0x5d5eac,null))[_0x9606('0x5c')](handleError(_0x5d5eac,null));};exports['describe']=function(_0x20d1b8,_0x3a75e6){return db[_0x9606('0x52')]['describe']()['then'](respondWithResult(_0x3a75e6,null))[_0x9606('0x5c')](handleError(_0x3a75e6,null));};exports[_0x9606('0x64')]=function(_0x1af6ef,_0x4588cf,_0x4b5fd3){if(_0x1af6ef[_0x9606('0x5e')]['id']){delete _0x1af6ef[_0x9606('0x5e')]['id'];}return db['WhatsappAccount'][_0x9606('0x5b')]({'where':{'id':_0x1af6ef[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x4588cf,null))[_0x9606('0x34')](function(_0x5ba787){if(_0x5ba787){_0x1af6ef[_0x9606('0x5e')][_0x9606('0x65')]=_0x5ba787['id'];return db[_0x9606('0x66')][_0x9606('0x5d')](_0x1af6ef[_0x9606('0x5e')]);}})[_0x9606('0x34')](respondWithResult(_0x4588cf,null))[_0x9606('0x5c')](handleError(_0x4588cf,null));};exports[_0x9606('0x67')]=function(_0xfb3498,_0x3b5a3c,_0x415d97){var _0xcb4e70={'raw':![],'where':{}};var _0x41aced={};var _0x29e3b3={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0xfb3498[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x3b5a3c,null))[_0x9606('0x34')](function(_0x130a80){if(_0x130a80){_0x41aced[_0x9606('0x42')]=_[_0x9606('0x58')](db[_0x9606('0x66')]['rawAttributes']);_0x41aced[_0x9606('0x43')]=_['keys'](_0xfb3498['query']);_0x41aced[_0x9606('0x4b')]=_[_0x9606('0x45')](_0x41aced['model'],_0x41aced[_0x9606('0x43')]);_0xcb4e70['attributes']=_[_0x9606('0x45')](_0x41aced['model'],qs[_0x9606('0x46')](_0xfb3498['query']['fields']));_0xcb4e70[_0x9606('0x44')]=_0xcb4e70[_0x9606('0x44')][_0x9606('0x59')]?_0xcb4e70['attributes']:_0x41aced[_0x9606('0x42')];if(!_0xfb3498[_0x9606('0x43')]['hasOwnProperty']('nolimit')){_0xcb4e70['limit']=qs[_0x9606('0x2d')](_0xfb3498['query'][_0x9606('0x2d')]);_0xcb4e70[_0x9606('0x2c')]=qs[_0x9606('0x2c')](_0xfb3498[_0x9606('0x43')]['offset']);}_0xcb4e70[_0x9606('0x49')]=qs['sort'](_0xfb3498[_0x9606('0x43')]['sort']);_0xcb4e70[_0x9606('0x4e')]=qs['filters'](_[_0x9606('0x4c')](_0xfb3498[_0x9606('0x43')],_0x41aced[_0x9606('0x4b')]));_0xcb4e70[_0x9606('0x4e')][_0x9606('0x65')]=_0x130a80['id'];if(_0xfb3498[_0x9606('0x43')][_0x9606('0x4d')]){_0xcb4e70[_0x9606('0x4e')]=_[_0x9606('0x50')](_0xcb4e70[_0x9606('0x4e')],{'$or':_[_0x9606('0x3d')](_0xcb4e70[_0x9606('0x44')],function(_0x32e4c1){var _0x58e1ff={};_0x58e1ff[_0x32e4c1]={'$like':'%'+_0xfb3498['query'][_0x9606('0x4d')]+'%'};return _0x58e1ff;})});}_0xcb4e70=_[_0x9606('0x50')]({},_0xcb4e70,_0xfb3498[_0x9606('0x51')]);return db[_0x9606('0x66')]['count']({'where':_0xcb4e70['where']})[_0x9606('0x34')](function(_0x23ffe0){_0x29e3b3[_0x9606('0x2f')]=_0x23ffe0;if(_0xfb3498[_0x9606('0x43')][_0x9606('0x53')]){_0xcb4e70[_0x9606('0x5a')]=[{'all':!![]}];}return db[_0x9606('0x66')][_0x9606('0x54')](_0xcb4e70);})['then'](function(_0x421c2d){_0x29e3b3[_0x9606('0x55')]=_0x421c2d;return _0x29e3b3;});}})['then'](respondWithFilteredResult(_0x3b5a3c,_0xcb4e70))[_0x9606('0x5c')](handleError(_0x3b5a3c,null));};exports[_0x9606('0x68')]=function(_0xd9622,_0x703808,_0xf53f64){return db[_0x9606('0x52')]['find']({'where':{'id':_0xd9622['params']['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x703808,null))[_0x9606('0x34')](function(_0x583838){if(_0x583838){return _0x583838['removeDispositions'](_0xd9622[_0x9606('0x43')][_0x9606('0x69')]);}})[_0x9606('0x34')](respondWithStatusCode(_0x703808,null))[_0x9606('0x5c')](handleError(_0x703808,null));};exports[_0x9606('0x6a')]=function(_0x385ba2,_0x4f0a1b,_0x5bf7fd){if(_0x385ba2['body']['id']){delete _0x385ba2[_0x9606('0x5e')]['id'];}return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0x385ba2[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x4f0a1b,null))['then'](function(_0x5973be){if(_0x5973be){_0x385ba2[_0x9606('0x5e')][_0x9606('0x65')]=_0x5973be['id'];return db[_0x9606('0x6b')][_0x9606('0x5d')](_0x385ba2[_0x9606('0x5e')]);}})[_0x9606('0x34')](respondWithResult(_0x4f0a1b,null))[_0x9606('0x5c')](handleError(_0x4f0a1b,null));};exports[_0x9606('0x6c')]=function(_0x1de713,_0x192ebe,_0x36fe28){var _0x4bcf0b={'raw':![],'where':{}};var _0x4454b6={};var _0x1a6629={'count':0x0,'rows':[]};return db[_0x9606('0x52')][_0x9606('0x6d')]({'where':{'id':_0x1de713['params']['id']}})['then'](handleEntityNotFound(_0x192ebe,null))['then'](function(_0x3d37f6){if(_0x3d37f6){_0x4454b6[_0x9606('0x42')]=_[_0x9606('0x58')](db[_0x9606('0x6b')]['rawAttributes']);_0x4454b6['query']=_[_0x9606('0x58')](_0x1de713[_0x9606('0x43')]);_0x4454b6[_0x9606('0x4b')]=_[_0x9606('0x45')](_0x4454b6['model'],_0x4454b6[_0x9606('0x43')]);_0x4bcf0b['attributes']=_[_0x9606('0x45')](_0x4454b6[_0x9606('0x42')],qs[_0x9606('0x46')](_0x1de713[_0x9606('0x43')][_0x9606('0x46')]));_0x4bcf0b[_0x9606('0x44')]=_0x4bcf0b[_0x9606('0x44')][_0x9606('0x59')]?_0x4bcf0b[_0x9606('0x44')]:_0x4454b6['model'];if(!_0x1de713['query']['hasOwnProperty'](_0x9606('0x48'))){_0x4bcf0b[_0x9606('0x2d')]=qs[_0x9606('0x2d')](_0x1de713[_0x9606('0x43')][_0x9606('0x2d')]);_0x4bcf0b['offset']=qs[_0x9606('0x2c')](_0x1de713[_0x9606('0x43')][_0x9606('0x2c')]);}_0x4bcf0b[_0x9606('0x49')]=qs[_0x9606('0x4a')](_0x1de713[_0x9606('0x43')][_0x9606('0x4a')]);_0x4bcf0b[_0x9606('0x4e')]=qs[_0x9606('0x4b')](_[_0x9606('0x4c')](_0x1de713[_0x9606('0x43')],_0x4454b6[_0x9606('0x4b')]));_0x4bcf0b[_0x9606('0x4e')][_0x9606('0x65')]=_0x3d37f6['id'];if(_0x1de713[_0x9606('0x43')]['filter']){_0x4bcf0b[_0x9606('0x4e')]=_['merge'](_0x4bcf0b[_0x9606('0x4e')],{'$or':_[_0x9606('0x3d')](_0x4bcf0b[_0x9606('0x44')],function(_0x3201d){var _0x4e29d2={};_0x4e29d2[_0x3201d]={'$like':'%'+_0x1de713[_0x9606('0x43')][_0x9606('0x4d')]+'%'};return _0x4e29d2;})});}_0x4bcf0b=_['merge']({},_0x4bcf0b,_0x1de713[_0x9606('0x51')]);return db[_0x9606('0x6b')]['count']({'where':_0x4bcf0b['where']})[_0x9606('0x34')](function(_0x2e291c){_0x1a6629[_0x9606('0x2f')]=_0x2e291c;if(_0x1de713[_0x9606('0x43')][_0x9606('0x53')]){_0x4bcf0b[_0x9606('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9606('0x54')](_0x4bcf0b);})[_0x9606('0x34')](function(_0xe6eb5c){_0x1a6629[_0x9606('0x55')]=_0xe6eb5c;return _0x1a6629;});}})[_0x9606('0x34')](respondWithFilteredResult(_0x192ebe,_0x4bcf0b))['catch'](handleError(_0x192ebe,null));};exports[_0x9606('0x6e')]=function(_0x1f67aa,_0x249f91,_0x5eaa84){return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0x1f67aa[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x249f91,null))[_0x9606('0x34')](function(_0x570219){if(_0x570219){return _0x570219[_0x9606('0x6e')](_0x1f67aa[_0x9606('0x43')][_0x9606('0x69')]);}})[_0x9606('0x34')](respondWithStatusCode(_0x249f91,null))[_0x9606('0x5c')](handleError(_0x249f91,null));};exports['addAgents']=function(_0x2e293c,_0xa05a69,_0x3ea1de){return db['WhatsappAccount'][_0x9606('0x5b')]({'where':{'id':_0x2e293c[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0xa05a69,null))[_0x9606('0x34')](function(_0x10325e){if(_0x10325e){return _0x10325e[_0x9606('0x6f')](_0x2e293c[_0x9606('0x5e')]['ids'],_['omit'](_0x2e293c[_0x9606('0x5e')],[_0x9606('0x69'),'id'])||{})[_0x9606('0x70')](function(_0x53116a){for(var _0x51713c=0x0;_0x51713c<_0x2e293c[_0x9606('0x5e')][_0x9606('0x69')][_0x9606('0x59')];_0x51713c+=0x1){socket['emit'](_0x9606('0x71'),{'UserId':Number(_0x2e293c['body'][_0x9606('0x69')][_0x51713c]),'WhatsappAccountId':Number(_0x2e293c[_0x9606('0x57')]['id'])});}return _0x53116a;});}})['then'](respondWithResult(_0xa05a69,null))['catch'](handleError(_0xa05a69,null));};exports[_0x9606('0x72')]=function(_0xca7408,_0x507022,_0xe75419){return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0xca7408[_0x9606('0x57')]['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x507022,null))['then'](function(_0x186526){if(_0x186526){return _0x186526['removeAgents'](_0xca7408[_0x9606('0x43')][_0x9606('0x69')])[_0x9606('0x34')](function(){if(_[_0x9606('0x73')](_0xca7408['query'][_0x9606('0x69')])){for(var _0x436c0f=0x0;_0x436c0f<_0xca7408['query']['ids'][_0x9606('0x59')];_0x436c0f+=0x1){socket[_0x9606('0x74')](_0x9606('0x75'),{'UserId':Number(_0xca7408[_0x9606('0x43')]['ids'][_0x436c0f]),'WhatsappAccountId':Number(_0xca7408[_0x9606('0x57')]['id'])});}}else{socket[_0x9606('0x74')](_0x9606('0x75'),{'UserId':Number(_0xca7408[_0x9606('0x43')][_0x9606('0x69')]),'WhatsappAccountId':Number(_0xca7408['params']['id'])});}});}})['then'](respondWithStatusCode(_0x507022,null))['catch'](handleError(_0x507022,null));};exports[_0x9606('0x76')]=function(_0x363d57,_0x39a379,_0x174a11){var _0x161425={};var _0x865f15={};var _0x214c04;var _0x419c83;return db[_0x9606('0x52')][_0x9606('0x6d')]({'where':{'id':_0x363d57['params']['id']}})[_0x9606('0x34')](handleEntityNotFound(_0x39a379,null))[_0x9606('0x34')](function(_0xb07382){if(_0xb07382){_0x214c04=_0xb07382;_0x865f15[_0x9606('0x42')]=_['keys'](db['User'][_0x9606('0x3e')]);_0x865f15['query']=_['keys'](_0x363d57[_0x9606('0x43')]);_0x865f15[_0x9606('0x4b')]=_['intersection'](_0x865f15['model'],_0x865f15[_0x9606('0x43')]);_0x161425[_0x9606('0x44')]=_[_0x9606('0x45')](_0x865f15[_0x9606('0x42')],qs[_0x9606('0x46')](_0x363d57[_0x9606('0x43')][_0x9606('0x46')]));_0x161425['attributes']=_0x161425[_0x9606('0x44')]['length']?_0x161425[_0x9606('0x44')]:_0x865f15[_0x9606('0x42')];_0x161425[_0x9606('0x49')]=qs[_0x9606('0x4a')](_0x363d57[_0x9606('0x43')][_0x9606('0x4a')]);_0x161425[_0x9606('0x4e')]=qs[_0x9606('0x4b')](_[_0x9606('0x4c')](_0x363d57[_0x9606('0x43')],_0x865f15[_0x9606('0x4b')]));if(_0x363d57['query'][_0x9606('0x4d')]){_0x161425['where']=_[_0x9606('0x50')](_0x161425['where'],{'$or':_['map'](_0x161425['attributes'],function(_0x1a14ce){var _0x206e7f={};_0x206e7f[_0x1a14ce]={'$like':'%'+_0x363d57[_0x9606('0x43')][_0x9606('0x4d')]+'%'};return _0x206e7f;})});}_0x161425=_['merge']({},_0x161425,_0x363d57['options']);return _0x214c04['getAgents'](_0x161425);}})['then'](function(_0x23787f){if(_0x23787f){_0x419c83=_0x23787f[_0x9606('0x59')];if(!_0x363d57[_0x9606('0x43')]['hasOwnProperty'](_0x9606('0x48'))){_0x161425[_0x9606('0x2d')]=qs['limit'](_0x363d57[_0x9606('0x43')][_0x9606('0x2d')]);_0x161425[_0x9606('0x2c')]=qs[_0x9606('0x2c')](_0x363d57[_0x9606('0x43')][_0x9606('0x2c')]);}return _0x214c04[_0x9606('0x76')](_0x161425);}})[_0x9606('0x34')](function(_0x33c34e){if(_0x33c34e){return _0x33c34e?{'count':_0x419c83,'rows':_0x33c34e}:null;}})[_0x9606('0x34')](respondWithResult(_0x39a379,null))[_0x9606('0x5c')](handleError(_0x39a379,null));};exports[_0x9606('0x77')]=function(_0x345933,_0x2aa778){var _0x61dfa7=_0x345933[_0x9606('0x57')]['id'];var _0x577b14=_0x345933[_0x9606('0x5e')];var _0x450475=0xc8;var _0x2553e9=null;return db[_0x9606('0x78')][_0x9606('0x79')]({'isolationLevel':db[_0x9606('0x78')][_0x9606('0x7a')][_0x9606('0x7b')][_0x9606('0x7c')]},function(_0x4bf6f8){return db['WhatsappAccount'][_0x9606('0x6d')]({'where':{'id':_0x61dfa7},'transaction':_0x4bf6f8})['then'](function(_0x39ebcf){if(_0x39ebcf){return db[_0x9606('0x7d')][_0x9606('0x37')]({'where':{'WhatsappAccountId':_0x61dfa7},'transaction':_0x4bf6f8})[_0x9606('0x34')](function(){var _0x12d0e4=_['map'](_0x577b14,function(_0x2647c3){_0x2647c3[_0x9606('0x65')]=_0x61dfa7;return _0x2647c3;});return db[_0x9606('0x7d')]['bulkCreate'](_0x12d0e4,{'transaction':_0x4bf6f8});});}else{_0x450475=0x194;_0x2553e9=[];}});})[_0x9606('0x34')](function(){if(_0x450475!==0x194){return db[_0x9606('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x61dfa7},'order':_0x9606('0x7e')})[_0x9606('0x34')](function(_0x4e5d87){_0x2553e9=_0x4e5d87;});}})[_0x9606('0x5c')](function(_0x2ea488){_0x450475=0x1f4;logger[_0x9606('0x26')](_0x2ea488[_0x9606('0x7f')]);if(_0x2ea488['name']){delete _0x2ea488['name'];}_0x2553e9=_0x2ea488;})[_0x9606('0x80')](function(){if(_0x2553e9===null){_0x2aa778['sendStatus'](_0x450475);}else{if(_0x450475===0x1f4){_0x2aa778[_0x9606('0x29')](_0x450475)[_0x9606('0x39')](_0x2553e9);}else{_0x2aa778[_0x9606('0x29')](_0x450475)[_0x9606('0x2b')](_0x2553e9);}}});};exports['getApplications']=function(_0x13d386,_0xf4e34e,_0x282e51){var _0x538e31={};var _0x136890={};var _0x2052f2;var _0x2ddd44;return db['WhatsappAccount']['findOne']({'where':{'id':_0x13d386[_0x9606('0x57')]['id']}})['then'](handleEntityNotFound(_0xf4e34e,null))[_0x9606('0x34')](function(_0x24cabd){if(_0x24cabd){_0x2052f2=_0x24cabd;_0x136890[_0x9606('0x42')]=_['keys'](db['WhatsappApplication'][_0x9606('0x3e')]);_0x136890['query']=_[_0x9606('0x58')](_0x13d386[_0x9606('0x43')]);_0x136890[_0x9606('0x4b')]=_[_0x9606('0x45')](_0x136890[_0x9606('0x42')],_0x136890[_0x9606('0x43')]);_0x538e31[_0x9606('0x44')]=_['intersection'](_0x136890[_0x9606('0x42')],qs[_0x9606('0x46')](_0x13d386['query'][_0x9606('0x46')]));_0x538e31[_0x9606('0x44')]=_0x538e31[_0x9606('0x44')]['length']?_0x538e31[_0x9606('0x44')]:_0x136890['model'];_0x538e31[_0x9606('0x49')]=qs['sort'](_0x13d386['query'][_0x9606('0x4a')]);_0x538e31['where']=qs[_0x9606('0x4b')](_[_0x9606('0x4c')](_0x13d386[_0x9606('0x43')],_0x136890[_0x9606('0x4b')]));if(_0x13d386[_0x9606('0x43')][_0x9606('0x4d')]){_0x538e31['where']=_[_0x9606('0x50')](_0x538e31[_0x9606('0x4e')],{'$or':_[_0x9606('0x3d')](_0x538e31['attributes'],function(_0x4dfa7e){var _0x3cfc54={};_0x3cfc54[_0x4dfa7e]={'$like':'%'+_0x13d386[_0x9606('0x43')][_0x9606('0x4d')]+'%'};return _0x3cfc54;})});}_0x538e31=_['merge']({},_0x538e31,_0x13d386[_0x9606('0x51')]);return _0x2052f2[_0x9606('0x81')](_0x538e31);}})[_0x9606('0x34')](function(_0x269782){if(_0x269782){_0x2ddd44=_0x269782[_0x9606('0x59')];if(!_0x13d386[_0x9606('0x43')]['hasOwnProperty'](_0x9606('0x48'))){_0x538e31['limit']=qs['limit'](_0x13d386[_0x9606('0x43')][_0x9606('0x2d')]);_0x538e31[_0x9606('0x2c')]=qs[_0x9606('0x2c')](_0x13d386['query']['offset']);}return _0x2052f2[_0x9606('0x81')](_0x538e31);}})[_0x9606('0x34')](function(_0x1e933c){if(_0x1e933c){return _0x1e933c?{'count':_0x2ddd44,'rows':_0x1e933c}:null;}})[_0x9606('0x34')](respondWithResult(_0xf4e34e,null))[_0x9606('0x5c')](handleError(_0xf4e34e,null));};exports[_0x9606('0x82')]=function(_0x3a38a9,_0xe5b542,_0x3e3250){var _0x313088={'channel':_0x9606('0x83')};var _0x19f678=[];var _0x777b8c=[];var _0x25ef4c={};return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0x3a38a9[_0x9606('0x57')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9606('0x84')}]})['then'](handleEntityNotFound(_0xe5b542,null))[_0x9606('0x34')](function(_0x48069e){_0x313088[_0x9606('0x85')]=_0x48069e;if(_0x313088[_0x9606('0x85')]&&_0x313088[_0x9606('0x85')][_0x9606('0x40')]===_0x9606('0x86')&&_0x3a38a9['body'][_0x9606('0x87')]){if(_0x3a38a9[_0x9606('0x5e')][_0x9606('0x87')][_0x9606('0x59')]===0x0)return;if(_0x3a38a9[_0x9606('0x5e')][_0x9606('0x87')][0x0][_0x9606('0x88')]!==_0x9606('0x89'))return;return db[_0x9606('0x8a')][_0x9606('0x33')]({'read':!![],'readAt':_0x3a38a9[_0x9606('0x5e')]['statuses'][0x0][_0x9606('0x8b')]},{'where':{'messageId':_0x3a38a9[_0x9606('0x5e')][_0x9606('0x87')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x2ef4c1){return _0xe5b542['status'](0xc8)['json'](_0x2ef4c1);});}_0x313088[_0x9606('0x8c')]=_[_0x9606('0x8d')](_0x48069e[_0x9606('0x84')],['priority'],[_0x9606('0x8e')]);if(_0x313088[_0x9606('0x85')][_0x9606('0x84')]){delete _0x313088[_0x9606('0x85')][_0x9606('0x84')];}return db[_0x9606('0x8f')][_0x9606('0x90')]()[_0x9606('0x34')](function(_0x253743){if(!_0x253743){throw new db[(_0x9606('0x91'))]['ValidationError']('no\x20available\x20attributes');}_0x19f678=_[_0x9606('0x92')](_[_0x9606('0x58')](_0x253743),[_0x9606('0x93'),'updatedAt']);_0x777b8c=_[_0x9606('0x92')](_[_0x9606('0x58')](_0x253743),[_0x9606('0x93'),_0x9606('0x94'),_0x9606('0x95'),_0x9606('0x96')]);_0x313088['body']={'mapKey':_0x9606('0x97')};if(_0x313088[_0x9606('0x85')]&&_0x313088['account'][_0x9606('0x40')]===_0x9606('0x98')){_0x313088[_0x9606('0x5e')][_0x9606('0x99')]=_0x3a38a9[_0x9606('0x5e')][_0x9606('0x9a')][_0x9606('0x9b')](_0x9606('0x9c'),'');_0x313088[_0x9606('0x5e')]['body']=_0x3a38a9[_0x9606('0x5e')][_0x9606('0x9d')];_0x313088[_0x9606('0x5e')][_0x9606('0x9e')]=_0x3a38a9[_0x9606('0x5e')][_0x9606('0x9f')];}if(_0x313088['account']&&_0x313088['account'][_0x9606('0x40')]===_0x9606('0x86')){_0x313088[_0x9606('0x5e')]['from']=_0x3a38a9[_0x9606('0x5e')][_0x9606('0xa0')][0x0][_0x9606('0x99')];_0x313088[_0x9606('0x5e')][_0x9606('0x5e')]=_0x3a38a9[_0x9606('0x5e')][_0x9606('0xa0')][0x0][_0x9606('0x27')]['body'];_0x313088[_0x9606('0x5e')]['messageId']=_0x3a38a9[_0x9606('0x5e')][_0x9606('0xa0')][0x0]['message_id'];}if(_0x313088['body']['id']){delete _0x313088[_0x9606('0x5e')]['id'];}if(_[_0x9606('0xa1')](_0x313088['body'][_0x9606('0x99')])){throw new db[(_0x9606('0x91'))][(_0x9606('0xa2'))](_0x9606('0xa3'));}if(_[_0x9606('0xa1')](_0x313088[_0x9606('0x5e')]['body'])||_0x313088['body'][_0x9606('0x5e')]===''){throw new db[(_0x9606('0x91'))]['ValidationError'](_0x9606('0xa4'));}if(_[_0x9606('0xa1')](_0x313088['body'][_0x9606('0xa5')])){throw new db[(_0x9606('0x91'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x777b8c);}if(!_[_0x9606('0xa6')](_0x777b8c,_0x313088[_0x9606('0x5e')][_0x9606('0xa5')])){throw new db[(_0x9606('0x91'))]['ValidationError'](_0x9606('0xa7')+_0x777b8c);}_0x25ef4c[_0x313088[_0x9606('0x5e')]['mapKey']]=_0x313088['body'][_0x9606('0x99')];return db[_0x9606('0xa8')][_0x9606('0x5b')]({'where':{'id':_0x313088['account'][_0x9606('0x96')]},'include':[{'model':db[_0x9606('0x8f')],'as':_0x9606('0xa9'),'where':_0x25ef4c,'limit':0x1,'order':[[_0x9606('0x94'),'DESC']]}]});})[_0x9606('0x34')](handleEntityNotFound(_0xe5b542,null))['then'](function(_0x539640){if(_0x539640){_0x313088[_0x9606('0xaa')]=_['omit'](_0x539640,[_0x9606('0xa9')]);if(_0x539640[_0x9606('0xa9')]['length']){return _0x539640['Contacts'][0x0];}var _0x5c5c09=_[_0x9606('0x18')](_0x313088[_0x9606('0x5e')],{'firstName':_0x313088['body']['from'],'ListId':_0x539640['id']});_0x5c5c09[_0x313088['body'][_0x9606('0xa5')]]=_0x313088['body'][_0x9606('0x99')];return db['CmContact'][_0x9606('0x5d')](_0x5c5c09,{'fields':_0x19f678,'raw':!![]});}})[_0x9606('0x34')](handleEntityNotFound(_0xe5b542,null))[_0x9606('0x34')](function(_0xabde1c){if(_0xabde1c){_0x313088[_0x9606('0xab')]=_0xabde1c;var _0x5c98cb={'ContactId':_0xabde1c['id'],'phone':_0x313088[_0x9606('0x5e')][_0x9606('0x99')],'WhatsappAccountId':_0x3a38a9[_0x9606('0x57')]['id']};var _0x2f425f={'ContactId':_0xabde1c['id'],'WhatsappAccountId':_0x3a38a9[_0x9606('0x57')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x2f425f})[_0x9606('0x34')](function(_0x4cf1f6){if(_0x4cf1f6){return[_0x4cf1f6,![]];}return db[_0x9606('0xac')][_0x9606('0x5d')](_0x5c98cb)[_0x9606('0x34')](function(_0xb03d1b){return[_0xb03d1b,!![]];});});}})[_0x9606('0x70')](function(_0xaf73c4,_0x2ed800){_0x313088[_0x9606('0xad')]=_0xaf73c4[_0x9606('0x35')]({'plain':!![]});_0x313088[_0x9606('0xad')][_0x9606('0xae')]=![];if(_0x2ed800){if(_0x313088[_0x9606('0x85')][_0x9606('0xaf')]){_0x313088[_0x9606('0x8c')][_0x9606('0xb0')]({'id':0x0,'priority':_0x313088['applications'][_0x9606('0x59')]+0x1,'app':_0x9606('0xb1'),'appdata':'unmanaged','interval':_0x9606('0xb2')});}_0x313088[_0x9606('0xad')][_0x9606('0xae')]=!![];}return db['WhatsappMessage'][_0x9606('0x5d')]({'phone':_0x313088[_0x9606('0x5e')][_0x9606('0x99')],'messageId':_0x313088[_0x9606('0x5e')][_0x9606('0x9e')],'body':_0x313088['body'][_0x9606('0x5e')],'WhatsappAccountId':_0x3a38a9[_0x9606('0x57')]['id'],'WhatsappInteractionId':_0xaf73c4['id'],'direction':'in','ContactId':_0xaf73c4[_0x9606('0xb3')],'AttachmentId':_0x313088['body']['AttachmentId']});})[_0x9606('0x34')](function(_0x48014a){_0x313088[_0x9606('0x27')]=_0x48014a;if(!_0x313088[_0x9606('0xad')]['UserId'])return;return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x313088[_0x9606('0xad')][_0x9606('0xb4')]}});})[_0x9606('0x34')](function(_0x2eb51c){if(_0x2eb51c){_0x313088['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x9606('0xb5'),'appdata':_0x2eb51c[_0x9606('0x38')]+','+(_0x313088['account'][_0x9606('0xb6')]||0xa),'interval':_0x9606('0xb2')});}if(!_0x313088[_0x9606('0xad')][_0x9606('0xb7')])return;return db[_0x9606('0xb8')][_0x9606('0x5b')]({'attributes':['id',_0x9606('0x38')],'where':{'id':_0x313088[_0x9606('0xad')]['queueId']}});})[_0x9606('0x34')](function(_0x316d39){if(_0x316d39){_0x313088['applications'][_0x9606('0xb9')]({'id':0x0,'priority':0x1,'app':_0x9606('0xba'),'appdata':_0x316d39['name']+','+(_0x313088[_0x9606('0x85')][_0x9606('0xbb')]||0x12c),'interval':_0x9606('0xb2')});}return respondWithRpcPromise('Start',_0x9606('0xbc'),_0x313088);})[_0x9606('0x34')](function(_0x13b662){if(_0x13b662){var _0x5f84a2=0xc8;var _0x1d2b64=_0x9606('0xbd');logger['info'](_0x9606('0x22'),_0x1d2b64,_0x5f84a2,'entity\x20found');logger[_0x9606('0xbe')](_0x9606('0xbf'),_0x1d2b64,_0x5f84a2,_0x9606('0xc0'),JSON[_0x9606('0x24')](_0x13b662));if(_0x313088[_0x9606('0x85')][_0x9606('0x40')]===_0x9606('0x98')){return _0xe5b542[_0x9606('0x29')](_0x5f84a2)[_0x9606('0xc1')](_0x9606('0xc2'),'text/xml')[_0x9606('0x39')](_0x9606('0xc3'));}else{return _0xe5b542['status'](_0x5f84a2)[_0x9606('0x2b')](_0x13b662);}}});})[_0x9606('0x5c')](handleError(_0xe5b542,null));};exports['send']=function(_0x2b1ba0,_0x50f5c2,_0x4a3f70){var _0x29688a,_0x5859bd,_0x1d0ca2;if(_[_0x9606('0xa1')](_0x2b1ba0['body']['body'])||_0x2b1ba0[_0x9606('0x5e')][_0x9606('0x5e')]===''){throw new db['Sequelize'][(_0x9606('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9606('0xa1')](_0x2b1ba0['body']['to'])){throw new db[(_0x9606('0x91'))]['ValidationError'](_0x9606('0xc4'));}_0x29688a=_0x2b1ba0[_0x9606('0x5e')]['to'];return db[_0x9606('0x52')][_0x9606('0x5b')]({'where':{'id':_0x2b1ba0[_0x9606('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x9606('0xc5'),'include':[{'model':db[_0x9606('0x8f')],'as':_0x9606('0xa9'),'where':{'mobile':_0x29688a},'limit':0x1,'order':[[_0x9606('0x94'),_0x9606('0xc6')]]}]}]})[_0x9606('0x34')](handleEntityNotFound(_0x50f5c2,null))[_0x9606('0x34')](function(_0x1def2f){if(_0x1def2f&&_0x1def2f[_0x9606('0xc5')]){_0x5859bd=_0x1def2f[_0x9606('0x35')]({'plain':!![]});if(_0x5859bd['List']&&_0x5859bd[_0x9606('0xc5')][_0x9606('0xa9')][_0x9606('0x59')]){return _0x5859bd[_0x9606('0xc5')][_0x9606('0xa9')][0x0];}return db[_0x9606('0x8f')]['create'](_[_0x9606('0x18')](_0x2b1ba0[_0x9606('0x5e')],{'firstName':_0x29688a,'mobile':_0x29688a,'phone':_0x29688a,'ListId':_0x5859bd[_0x9606('0x96')]}));}})[_0x9606('0x34')](handleEntityNotFound(_0x50f5c2,null))[_0x9606('0x34')](function(_0x3b70d5){if(_0x3b70d5){_0x1d0ca2=_0x3b70d5;return db[_0x9606('0xac')]['find']({'where':{'ContactId':_0x1d0ca2['id'],'closed':![],'WhatsappAccountId':_0x5859bd['id']}})['then'](function(_0x2297b8){if(_0x2297b8){return[_0x2297b8,![]];}return db[_0x9606('0xac')][_0x9606('0x5d')]({'UserId':_0x2b1ba0[_0x9606('0x5f')]['id'],'ContactId':_0x1d0ca2['id'],'WhatsappAccountId':_0x5859bd['id'],'phone':_0x29688a,'firstMsgDirection':'out','Messages':[_[_0x9606('0x50')](_0x2b1ba0[_0x9606('0x5e')],{'read':![],'body':_0x2b1ba0[_0x9606('0x5e')][_0x9606('0x5e')],'phone':_0x29688a,'WhatsappAccountId':_0x5859bd['id'],'UserId':_0x2b1ba0[_0x9606('0x5f')]['id'],'ContactId':_0x1d0ca2['id']})]},{'include':[{'model':db[_0x9606('0x8a')],'as':'Messages'}]})['then'](function(_0x5d661d){return[_0x5d661d,!![]];});});}})[_0x9606('0x70')](function(_0x271540,_0x3afecf){if(_0x3afecf){return _0x271540;}return db[_0x9606('0x8a')][_0x9606('0x5d')](_[_0x9606('0x50')](_0x2b1ba0[_0x9606('0x5e')],{'read':![],'body':_0x2b1ba0[_0x9606('0x5e')][_0x9606('0x5e')],'phone':_0x29688a,'WhatsappAccountId':_0x5859bd['id'],'WhatsappInteractionId':_0x271540['id'],'UserId':_0x2b1ba0['user']['id'],'ContactId':_0x1d0ca2['id']}))[_0x9606('0x34')](function(_0x480904){_0x271540[_0x9606('0xc7')][_0x9606('0xc8')]=[];_0x271540['dataValues'][_0x9606('0xc8')][_0x9606('0xb0')](_0x480904[_0x9606('0xc7')]);return _0x271540;});})[_0x9606('0x34')](respondWithResult(_0x50f5c2,null))[_0x9606('0x5c')](handleError(_0x50f5c2,null));}; \ No newline at end of file +var _0xba3c=['options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','replace','Body','MessageSid','notifications','messageId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','omit','WhatsappInteraction','interaction','created','autoclose','push','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','WhatsappQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','\x0a','CmList','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','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','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','save','update','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xba3c,0x1f2));var _0xcba3=function(_0x13c25f,_0x24938b){_0x13c25f=_0x13c25f-0x0;var _0x249f30=_0xba3c[_0x13c25f];return _0x249f30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcba3('0x0'));var zipdir=require(_0xcba3('0x1'));var jsonpatch=require(_0xcba3('0x2'));var rp=require(_0xcba3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcba3('0x4'));var util=require(_0xcba3('0x5'));var path=require(_0xcba3('0x6'));var sox=require(_0xcba3('0x7'));var csv=require(_0xcba3('0x8'));var ejs=require(_0xcba3('0x9'));var fs=require('fs');var fs_extra=require(_0xcba3('0xa'));var _=require(_0xcba3('0xb'));var squel=require(_0xcba3('0xc'));var crypto=require('crypto');var jsforce=require(_0xcba3('0xd'));var deskjs=require(_0xcba3('0xe'));var toCsv=require(_0xcba3('0x8'));var querystring=require(_0xcba3('0xf'));var Papa=require(_0xcba3('0x10'));var Redis=require(_0xcba3('0x11'));var authService=require(_0xcba3('0x12'));var qs=require(_0xcba3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcba3('0x14'));var logger=require(_0xcba3('0x15'))('api');var utils=require(_0xcba3('0x16'));var config=require(_0xcba3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcba3('0x18'))['db'];config[_0xcba3('0x19')]=_[_0xcba3('0x1a')](config[_0xcba3('0x19')],{'host':_0xcba3('0x1b'),'port':0x18eb});var socket=require(_0xcba3('0x1c'))(new Redis(config[_0xcba3('0x19')]));require('./whatsappAccount.socket')[_0xcba3('0x1d')](socket);var jayson=require(_0xcba3('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x43ce39,_0x4c6140,_0x504cb0,_0xabc4c3){return new BPromise(function(_0x5f007d,_0x2e1a85){var _0x305848=_0xabc4c3||client;return _0x305848[_0xcba3('0x1f')](_0x43ce39,_0x504cb0)[_0xcba3('0x20')](function(_0x577066){logger[_0xcba3('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x4c6140,_0xcba3('0x22'));logger[_0xcba3('0x23')](_0xcba3('0x24'),_0x4c6140,_0xcba3('0x22'),JSON[_0xcba3('0x25')](_0x577066));if(_0x577066[_0xcba3('0x26')]){if(_0x577066[_0xcba3('0x26')][_0xcba3('0x27')]===0x1f4){logger[_0xcba3('0x26')](_0xcba3('0x28'),_0x4c6140,_0x577066[_0xcba3('0x26')]['message']);return _0x2e1a85(_0x577066[_0xcba3('0x26')][_0xcba3('0x29')]);}logger[_0xcba3('0x26')](_0xcba3('0x28'),_0x4c6140,_0x577066[_0xcba3('0x26')][_0xcba3('0x29')]);return _0x5f007d(_0x577066[_0xcba3('0x26')][_0xcba3('0x29')]);}else{logger['info'](_0xcba3('0x28'),_0x4c6140,_0xcba3('0x22'));_0x5f007d(_0x577066['result']['message']);}})[_0xcba3('0x2a')](function(_0xc51bf0){logger[_0xcba3('0x26')](_0xcba3('0x28'),_0x4c6140,_0xc51bf0);_0x2e1a85(_0xc51bf0);});});}function respondWithStatusCode(_0x21f5b8,_0x20faf4){_0x20faf4=_0x20faf4||0xcc;return function(_0x11140e){if(_0x11140e){return _0x21f5b8[_0xcba3('0x2b')](_0x20faf4);}return _0x21f5b8['status'](_0x20faf4)[_0xcba3('0x2c')]();};}function respondWithResult(_0x5ac09d,_0x2b3c24){_0x2b3c24=_0x2b3c24||0xc8;return function(_0x16bed9){if(_0x16bed9){return _0x5ac09d['status'](_0x2b3c24)['json'](_0x16bed9);}};}function respondWithFilteredResult(_0x136028,_0x3da2ea){return function(_0x12c38b){if(_0x12c38b){var _0xa61b4d=typeof _0x3da2ea[_0xcba3('0x2d')]==='undefined'&&typeof _0x3da2ea[_0xcba3('0x2e')]===_0xcba3('0x2f');var _0x383462=_0x12c38b[_0xcba3('0x30')];var _0xdf65fd=_0xa61b4d?0x0:_0x3da2ea[_0xcba3('0x2d')];var _0xaffce3=_0xa61b4d?_0x12c38b[_0xcba3('0x30')]:_0x3da2ea['offset']+_0x3da2ea[_0xcba3('0x2e')];var _0x1502f8;if(_0xaffce3>=_0x383462){_0xaffce3=_0x383462;_0x1502f8=0xc8;}else{_0x1502f8=0xce;}_0x136028[_0xcba3('0x31')](_0x1502f8);return _0x136028[_0xcba3('0x32')](_0xcba3('0x33'),_0xdf65fd+'-'+_0xaffce3+'/'+_0x383462)['json'](_0x12c38b);}return null;};}function patchUpdates(_0x5193e4){return function(_0x1c8abf){try{jsonpatch['apply'](_0x1c8abf,_0x5193e4,!![]);}catch(_0x4554e2){return BPromise['reject'](_0x4554e2);}return _0x1c8abf[_0xcba3('0x34')]();};}function saveUpdates(_0x395259,_0x2564db){return function(_0x4dc3b9){if(_0x4dc3b9){return _0x4dc3b9[_0xcba3('0x35')](_0x395259)['then'](function(_0x1898c6){return _0x1898c6;});}return null;};}function removeEntity(_0xef9d97,_0x56086f){return function(_0x5b2ae8){if(_0x5b2ae8){return _0x5b2ae8['destroy']()[_0xcba3('0x20')](function(){var _0x34e430=_0x5b2ae8[_0xcba3('0x36')]({'plain':!![]});var _0x1892cf=_0xcba3('0x37');return db[_0xcba3('0x38')][_0xcba3('0x39')]({'where':{'type':_0x1892cf,'resourceId':_0x34e430['id']}})[_0xcba3('0x20')](function(){return _0x5b2ae8;});})['then'](function(){_0xef9d97[_0xcba3('0x31')](0xcc)[_0xcba3('0x2c')]();});}};}function handleEntityNotFound(_0x4223de,_0x5f5c9c){return function(_0x399ce3){if(!_0x399ce3){_0x4223de[_0xcba3('0x2b')](0x194);}return _0x399ce3;};}function handleError(_0x376d31,_0x44eefd){_0x44eefd=_0x44eefd||0x1f4;return function(_0x427696){logger[_0xcba3('0x26')](_0x427696[_0xcba3('0x3a')]);if(_0x427696[_0xcba3('0x3b')]){delete _0x427696[_0xcba3('0x3b')];}_0x376d31[_0xcba3('0x31')](_0x44eefd)[_0xcba3('0x3c')](_0x427696);};}exports[_0xcba3('0x3d')]=function(_0x43f613,_0x19a1de){var _0x5cb2b4={'include':[{'model':db[_0xcba3('0x3e')],'as':_0xcba3('0x3f')}]},_0x59376={},_0x1d9b55={'count':0x0,'rows':[]};var _0x5874e0=_[_0xcba3('0x40')](db[_0xcba3('0x41')]['rawAttributes'],function(_0xd975b9){return{'name':_0xd975b9[_0xcba3('0x42')],'type':_0xd975b9[_0xcba3('0x43')]['key']};});_0x59376['model']=_[_0xcba3('0x40')](_0x5874e0,'name');_0x59376[_0xcba3('0x44')]=_[_0xcba3('0x45')](_0x43f613[_0xcba3('0x44')]);_0x59376['filters']=_[_0xcba3('0x46')](_0x59376[_0xcba3('0x47')],_0x59376[_0xcba3('0x44')]);_0x5cb2b4[_0xcba3('0x48')]=_[_0xcba3('0x46')](_0x59376[_0xcba3('0x47')],qs[_0xcba3('0x49')](_0x43f613[_0xcba3('0x44')][_0xcba3('0x49')]));_0x5cb2b4[_0xcba3('0x48')]=_0x5cb2b4[_0xcba3('0x48')][_0xcba3('0x4a')]?_0x5cb2b4['attributes']:_0x59376[_0xcba3('0x47')];if(!_0x43f613[_0xcba3('0x44')][_0xcba3('0x4b')](_0xcba3('0x4c'))){_0x5cb2b4[_0xcba3('0x2e')]=qs[_0xcba3('0x2e')](_0x43f613[_0xcba3('0x44')]['limit']);_0x5cb2b4['offset']=qs[_0xcba3('0x2d')](_0x43f613['query'][_0xcba3('0x2d')]);}_0x5cb2b4['order']=qs[_0xcba3('0x4d')](_0x43f613['query'][_0xcba3('0x4d')]);_0x5cb2b4['where']=qs['filters'](_[_0xcba3('0x4e')](_0x43f613[_0xcba3('0x44')],_0x59376[_0xcba3('0x4f')]),_0x5874e0);if(_0x43f613['query'][_0xcba3('0x50')]){_0x5cb2b4['where']=_[_0xcba3('0x51')](_0x5cb2b4[_0xcba3('0x52')],{'$or':_[_0xcba3('0x40')](_0x5874e0,function(_0x4d7654){if(_0x4d7654['type']!==_0xcba3('0x53')){var _0x433c21={};_0x433c21[_0x4d7654[_0xcba3('0x3b')]]={'$like':'%'+_0x43f613['query'][_0xcba3('0x50')]+'%'};return _0x433c21;}})});}_0x5cb2b4=_[_0xcba3('0x51')]({},_0x5cb2b4,_0x43f613[_0xcba3('0x54')]);var _0x44282c={'where':_0x5cb2b4[_0xcba3('0x52')]};return db[_0xcba3('0x41')][_0xcba3('0x30')](_0x44282c)[_0xcba3('0x20')](function(_0x137aa0){_0x1d9b55['count']=_0x137aa0;if(_0x43f613['query'][_0xcba3('0x55')]){_0x5cb2b4[_0xcba3('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcba3('0x57')](_0x5cb2b4);})[_0xcba3('0x20')](function(_0x1b51b0){_0x1d9b55[_0xcba3('0x58')]=_0x1b51b0;return _0x1d9b55;})[_0xcba3('0x20')](respondWithFilteredResult(_0x19a1de,_0x5cb2b4))[_0xcba3('0x2a')](handleError(_0x19a1de,null));};exports[_0xcba3('0x59')]=function(_0x58f33a,_0x262b1c){var _0xd55669={'raw':![],'where':{'id':_0x58f33a[_0xcba3('0x5a')]['id']},'include':[{'model':db[_0xcba3('0x3e')],'as':_0xcba3('0x3f')}]},_0x147580={};_0x147580['model']=_['keys'](db[_0xcba3('0x41')][_0xcba3('0x5b')]);_0x147580[_0xcba3('0x44')]=_['keys'](_0x58f33a['query']);_0x147580[_0xcba3('0x4f')]=_[_0xcba3('0x46')](_0x147580[_0xcba3('0x47')],_0x147580[_0xcba3('0x44')]);_0xd55669['attributes']=_[_0xcba3('0x46')](_0x147580[_0xcba3('0x47')],qs['fields'](_0x58f33a['query'][_0xcba3('0x49')]));_0xd55669[_0xcba3('0x48')]=_0xd55669[_0xcba3('0x48')][_0xcba3('0x4a')]?_0xd55669[_0xcba3('0x48')]:_0x147580[_0xcba3('0x47')];if(_0x58f33a[_0xcba3('0x44')][_0xcba3('0x55')]){_0xd55669[_0xcba3('0x56')]=[{'all':!![]}];}_0xd55669=_[_0xcba3('0x51')]({},_0xd55669,_0x58f33a['options']);return db['WhatsappAccount'][_0xcba3('0x5c')](_0xd55669)['then'](handleEntityNotFound(_0x262b1c,null))[_0xcba3('0x20')](respondWithResult(_0x262b1c,null))[_0xcba3('0x2a')](handleError(_0x262b1c,null));};exports['create']=function(_0x5df362,_0x2cee87){return db['WhatsappAccount']['create'](_0x5df362[_0xcba3('0x5d')],{})[_0xcba3('0x20')](function(_0x108730){var _0x2b6781=_0x5df362[_0xcba3('0x5e')][_0xcba3('0x36')]({'plain':!![]});if(!_0x2b6781)throw new Error(_0xcba3('0x5f'));if(_0x2b6781[_0xcba3('0x60')]===_0xcba3('0x5e')){var _0x46d0cc=_0x108730[_0xcba3('0x36')]({'plain':!![]});var _0x5d3fdc=_0xcba3('0x37');return db[_0xcba3('0x61')][_0xcba3('0x5c')]({'where':{'name':_0x5d3fdc,'userProfileId':_0x2b6781['userProfileId']},'raw':!![]})[_0xcba3('0x20')](function(_0x3a1060){if(_0x3a1060&&_0x3a1060['autoAssociation']===0x0){return db[_0xcba3('0x38')]['create']({'name':_0x46d0cc[_0xcba3('0x3b')],'resourceId':_0x46d0cc['id'],'type':_0x3a1060[_0xcba3('0x3b')],'sectionId':_0x3a1060['id']},{})[_0xcba3('0x20')](function(){return _0x108730;});}else{return _0x108730;}})[_0xcba3('0x2a')](function(_0xc8e6f2){logger[_0xcba3('0x26')](_0xcba3('0x62'),_0xc8e6f2);throw _0xc8e6f2;});}return _0x108730;})[_0xcba3('0x20')](respondWithResult(_0x2cee87,0xc9))[_0xcba3('0x2a')](handleError(_0x2cee87,null));};exports[_0xcba3('0x35')]=function(_0x30a1bc,_0x41a34d){if(_0x30a1bc['body']['id']){delete _0x30a1bc[_0xcba3('0x5d')]['id'];}return db['WhatsappAccount'][_0xcba3('0x5c')]({'where':{'id':_0x30a1bc[_0xcba3('0x5a')]['id']},'include':[{'model':db[_0xcba3('0x3e')],'as':_0xcba3('0x3f')}]})[_0xcba3('0x20')](handleEntityNotFound(_0x41a34d,null))[_0xcba3('0x20')](saveUpdates(_0x30a1bc['body'],null))[_0xcba3('0x20')](respondWithResult(_0x41a34d,null))['catch'](handleError(_0x41a34d,null));};exports[_0xcba3('0x39')]=function(_0x3a1590,_0x5b9b5d){return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x3a1590['params']['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0x5b9b5d,null))[_0xcba3('0x20')](removeEntity(_0x5b9b5d,null))['catch'](handleError(_0x5b9b5d,null));};exports[_0xcba3('0x63')]=function(_0xf5a97e,_0x1b74f6){return db['WhatsappAccount'][_0xcba3('0x63')]()[_0xcba3('0x20')](respondWithResult(_0x1b74f6,null))[_0xcba3('0x2a')](handleError(_0x1b74f6,null));};exports[_0xcba3('0x64')]=function(_0x296fb9,_0x5cd788,_0x25ff90){if(_0x296fb9[_0xcba3('0x5d')]['id']){delete _0x296fb9[_0xcba3('0x5d')]['id'];}return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x296fb9[_0xcba3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5cd788,null))[_0xcba3('0x20')](function(_0x579a88){if(_0x579a88){_0x296fb9[_0xcba3('0x5d')][_0xcba3('0x65')]=_0x579a88['id'];return db[_0xcba3('0x66')][_0xcba3('0x67')](_0x296fb9['body']);}})[_0xcba3('0x20')](respondWithResult(_0x5cd788,null))[_0xcba3('0x2a')](handleError(_0x5cd788,null));};exports[_0xcba3('0x68')]=function(_0x24ecd3,_0x2a6e32,_0xfa4841){var _0x421567={'raw':![],'where':{}};var _0x3e3b3a={};var _0xc79b0b={'count':0x0,'rows':[]};return db[_0xcba3('0x41')][_0xcba3('0x69')]({'where':{'id':_0x24ecd3[_0xcba3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2a6e32,null))[_0xcba3('0x20')](function(_0x46059b){if(_0x46059b){_0x3e3b3a[_0xcba3('0x47')]=_[_0xcba3('0x45')](db[_0xcba3('0x66')][_0xcba3('0x5b')]);_0x3e3b3a[_0xcba3('0x44')]=_[_0xcba3('0x45')](_0x24ecd3[_0xcba3('0x44')]);_0x3e3b3a[_0xcba3('0x4f')]=_['intersection'](_0x3e3b3a[_0xcba3('0x47')],_0x3e3b3a[_0xcba3('0x44')]);_0x421567[_0xcba3('0x48')]=_[_0xcba3('0x46')](_0x3e3b3a[_0xcba3('0x47')],qs['fields'](_0x24ecd3['query'][_0xcba3('0x49')]));_0x421567[_0xcba3('0x48')]=_0x421567[_0xcba3('0x48')][_0xcba3('0x4a')]?_0x421567[_0xcba3('0x48')]:_0x3e3b3a[_0xcba3('0x47')];if(!_0x24ecd3[_0xcba3('0x44')]['hasOwnProperty']('nolimit')){_0x421567[_0xcba3('0x2e')]=qs[_0xcba3('0x2e')](_0x24ecd3[_0xcba3('0x44')]['limit']);_0x421567[_0xcba3('0x2d')]=qs[_0xcba3('0x2d')](_0x24ecd3[_0xcba3('0x44')][_0xcba3('0x2d')]);}_0x421567[_0xcba3('0x6a')]=qs[_0xcba3('0x4d')](_0x24ecd3[_0xcba3('0x44')][_0xcba3('0x4d')]);_0x421567[_0xcba3('0x52')]=qs[_0xcba3('0x4f')](_['pick'](_0x24ecd3['query'],_0x3e3b3a[_0xcba3('0x4f')]));_0x421567[_0xcba3('0x52')]['WhatsappAccountId']=_0x46059b['id'];if(_0x24ecd3['query'][_0xcba3('0x50')]){_0x421567[_0xcba3('0x52')]=_[_0xcba3('0x51')](_0x421567['where'],{'$or':_[_0xcba3('0x40')](_0x421567[_0xcba3('0x48')],function(_0x253f6e){var _0x3078c3={};_0x3078c3[_0x253f6e]={'$like':'%'+_0x24ecd3[_0xcba3('0x44')]['filter']+'%'};return _0x3078c3;})});}_0x421567=_[_0xcba3('0x51')]({},_0x421567,_0x24ecd3[_0xcba3('0x54')]);return db[_0xcba3('0x66')][_0xcba3('0x30')]({'where':_0x421567[_0xcba3('0x52')]})[_0xcba3('0x20')](function(_0x537c62){_0xc79b0b['count']=_0x537c62;if(_0x24ecd3[_0xcba3('0x44')][_0xcba3('0x55')]){_0x421567[_0xcba3('0x56')]=[{'all':!![]}];}return db[_0xcba3('0x66')][_0xcba3('0x57')](_0x421567);})[_0xcba3('0x20')](function(_0x1558a5){_0xc79b0b[_0xcba3('0x58')]=_0x1558a5;return _0xc79b0b;});}})[_0xcba3('0x20')](respondWithFilteredResult(_0x2a6e32,_0x421567))[_0xcba3('0x2a')](handleError(_0x2a6e32,null));};exports[_0xcba3('0x6b')]=function(_0x323c0a,_0x5a507c,_0xad15e9){return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x323c0a['params']['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0x5a507c,null))['then'](function(_0x330b95){if(_0x330b95){return _0x330b95[_0xcba3('0x6b')](_0x323c0a[_0xcba3('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x5a507c,null))[_0xcba3('0x2a')](handleError(_0x5a507c,null));};exports['addAnswer']=function(_0x30552b,_0x53e6a6,_0x17237a){if(_0x30552b[_0xcba3('0x5d')]['id']){delete _0x30552b['body']['id'];}return db['WhatsappAccount'][_0xcba3('0x5c')]({'where':{'id':_0x30552b[_0xcba3('0x5a')]['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0x53e6a6,null))[_0xcba3('0x20')](function(_0x3a273c){if(_0x3a273c){_0x30552b[_0xcba3('0x5d')][_0xcba3('0x65')]=_0x3a273c['id'];return db[_0xcba3('0x6c')][_0xcba3('0x67')](_0x30552b['body']);}})[_0xcba3('0x20')](respondWithResult(_0x53e6a6,null))[_0xcba3('0x2a')](handleError(_0x53e6a6,null));};exports[_0xcba3('0x6d')]=function(_0x256bbd,_0xe20965,_0x3d20f7){var _0xd37ab4={'raw':![],'where':{}};var _0x1b3602={};var _0x5ed396={'count':0x0,'rows':[]};return db[_0xcba3('0x41')]['findOne']({'where':{'id':_0x256bbd[_0xcba3('0x5a')]['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0xe20965,null))[_0xcba3('0x20')](function(_0x1eef55){if(_0x1eef55){_0x1b3602[_0xcba3('0x47')]=_[_0xcba3('0x45')](db[_0xcba3('0x6c')][_0xcba3('0x5b')]);_0x1b3602[_0xcba3('0x44')]=_[_0xcba3('0x45')](_0x256bbd[_0xcba3('0x44')]);_0x1b3602[_0xcba3('0x4f')]=_[_0xcba3('0x46')](_0x1b3602[_0xcba3('0x47')],_0x1b3602['query']);_0xd37ab4[_0xcba3('0x48')]=_['intersection'](_0x1b3602[_0xcba3('0x47')],qs[_0xcba3('0x49')](_0x256bbd['query'][_0xcba3('0x49')]));_0xd37ab4[_0xcba3('0x48')]=_0xd37ab4['attributes']['length']?_0xd37ab4[_0xcba3('0x48')]:_0x1b3602['model'];if(!_0x256bbd[_0xcba3('0x44')][_0xcba3('0x4b')]('nolimit')){_0xd37ab4['limit']=qs[_0xcba3('0x2e')](_0x256bbd[_0xcba3('0x44')][_0xcba3('0x2e')]);_0xd37ab4[_0xcba3('0x2d')]=qs['offset'](_0x256bbd[_0xcba3('0x44')]['offset']);}_0xd37ab4[_0xcba3('0x6a')]=qs[_0xcba3('0x4d')](_0x256bbd['query'][_0xcba3('0x4d')]);_0xd37ab4[_0xcba3('0x52')]=qs[_0xcba3('0x4f')](_[_0xcba3('0x4e')](_0x256bbd[_0xcba3('0x44')],_0x1b3602['filters']));_0xd37ab4['where']['WhatsappAccountId']=_0x1eef55['id'];if(_0x256bbd[_0xcba3('0x44')][_0xcba3('0x50')]){_0xd37ab4[_0xcba3('0x52')]=_[_0xcba3('0x51')](_0xd37ab4[_0xcba3('0x52')],{'$or':_[_0xcba3('0x40')](_0xd37ab4[_0xcba3('0x48')],function(_0x368037){var _0x3d2eca={};_0x3d2eca[_0x368037]={'$like':'%'+_0x256bbd[_0xcba3('0x44')]['filter']+'%'};return _0x3d2eca;})});}_0xd37ab4=_['merge']({},_0xd37ab4,_0x256bbd[_0xcba3('0x54')]);return db[_0xcba3('0x6c')]['count']({'where':_0xd37ab4['where']})[_0xcba3('0x20')](function(_0x5e96c1){_0x5ed396[_0xcba3('0x30')]=_0x5e96c1;if(_0x256bbd['query'][_0xcba3('0x55')]){_0xd37ab4[_0xcba3('0x56')]=[{'all':!![]}];}return db[_0xcba3('0x6c')][_0xcba3('0x57')](_0xd37ab4);})[_0xcba3('0x20')](function(_0xf3398d){_0x5ed396[_0xcba3('0x58')]=_0xf3398d;return _0x5ed396;});}})['then'](respondWithFilteredResult(_0xe20965,_0xd37ab4))[_0xcba3('0x2a')](handleError(_0xe20965,null));};exports[_0xcba3('0x6e')]=function(_0x26da34,_0x11172b,_0x4ae981){return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x26da34['params']['id']}})['then'](handleEntityNotFound(_0x11172b,null))[_0xcba3('0x20')](function(_0x2f391b){if(_0x2f391b){return _0x2f391b[_0xcba3('0x6e')](_0x26da34[_0xcba3('0x44')][_0xcba3('0x6f')]);}})['then'](respondWithStatusCode(_0x11172b,null))[_0xcba3('0x2a')](handleError(_0x11172b,null));};exports['addAgents']=function(_0x39c0e0,_0x1b8617,_0x2f663e){return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x39c0e0[_0xcba3('0x5a')]['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0x1b8617,null))[_0xcba3('0x20')](function(_0x1ff63a){if(_0x1ff63a){return _0x1ff63a[_0xcba3('0x70')](_0x39c0e0[_0xcba3('0x5d')]['ids'],_['omit'](_0x39c0e0['body'],[_0xcba3('0x6f'),'id'])||{})[_0xcba3('0x71')](function(_0x5de21e){for(var _0x9ae77=0x0;_0x9ae77<_0x39c0e0[_0xcba3('0x5d')][_0xcba3('0x6f')][_0xcba3('0x4a')];_0x9ae77+=0x1){socket[_0xcba3('0x72')](_0xcba3('0x73'),{'UserId':Number(_0x39c0e0[_0xcba3('0x5d')][_0xcba3('0x6f')][_0x9ae77]),'WhatsappAccountId':Number(_0x39c0e0[_0xcba3('0x5a')]['id'])});}return _0x5de21e;});}})[_0xcba3('0x20')](respondWithResult(_0x1b8617,null))[_0xcba3('0x2a')](handleError(_0x1b8617,null));};exports[_0xcba3('0x74')]=function(_0x4ce114,_0x636216,_0x53497d){return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x4ce114[_0xcba3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x636216,null))[_0xcba3('0x20')](function(_0x137879){if(_0x137879){return _0x137879[_0xcba3('0x74')](_0x4ce114['query'][_0xcba3('0x6f')])[_0xcba3('0x20')](function(){if(_[_0xcba3('0x75')](_0x4ce114[_0xcba3('0x44')][_0xcba3('0x6f')])){for(var _0xfaa008=0x0;_0xfaa008<_0x4ce114['query']['ids'][_0xcba3('0x4a')];_0xfaa008+=0x1){socket['emit'](_0xcba3('0x76'),{'UserId':Number(_0x4ce114['query'][_0xcba3('0x6f')][_0xfaa008]),'WhatsappAccountId':Number(_0x4ce114[_0xcba3('0x5a')]['id'])});}}else{socket[_0xcba3('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x4ce114[_0xcba3('0x44')][_0xcba3('0x6f')]),'WhatsappAccountId':Number(_0x4ce114[_0xcba3('0x5a')]['id'])});}});}})[_0xcba3('0x20')](respondWithStatusCode(_0x636216,null))[_0xcba3('0x2a')](handleError(_0x636216,null));};exports[_0xcba3('0x77')]=function(_0x312383,_0x140b56,_0x3a13fe){var _0x56b159={};var _0x38b810={};var _0x5bfd3f;var _0x438f9a;return db[_0xcba3('0x41')][_0xcba3('0x69')]({'where':{'id':_0x312383['params']['id']}})['then'](handleEntityNotFound(_0x140b56,null))[_0xcba3('0x20')](function(_0x56d3b8){if(_0x56d3b8){_0x5bfd3f=_0x56d3b8;_0x38b810[_0xcba3('0x47')]=_[_0xcba3('0x45')](db['User'][_0xcba3('0x5b')]);_0x38b810['query']=_[_0xcba3('0x45')](_0x312383['query']);_0x38b810[_0xcba3('0x4f')]=_[_0xcba3('0x46')](_0x38b810['model'],_0x38b810[_0xcba3('0x44')]);_0x56b159[_0xcba3('0x48')]=_['intersection'](_0x38b810[_0xcba3('0x47')],qs['fields'](_0x312383[_0xcba3('0x44')][_0xcba3('0x49')]));_0x56b159[_0xcba3('0x48')]=_0x56b159['attributes'][_0xcba3('0x4a')]?_0x56b159[_0xcba3('0x48')]:_0x38b810['model'];_0x56b159[_0xcba3('0x6a')]=qs[_0xcba3('0x4d')](_0x312383[_0xcba3('0x44')][_0xcba3('0x4d')]);_0x56b159[_0xcba3('0x52')]=qs[_0xcba3('0x4f')](_['pick'](_0x312383['query'],_0x38b810['filters']));if(_0x312383['query'][_0xcba3('0x50')]){_0x56b159[_0xcba3('0x52')]=_[_0xcba3('0x51')](_0x56b159[_0xcba3('0x52')],{'$or':_[_0xcba3('0x40')](_0x56b159[_0xcba3('0x48')],function(_0x358382){var _0x3cb70a={};_0x3cb70a[_0x358382]={'$like':'%'+_0x312383[_0xcba3('0x44')][_0xcba3('0x50')]+'%'};return _0x3cb70a;})});}_0x56b159=_['merge']({},_0x56b159,_0x312383[_0xcba3('0x54')]);return _0x5bfd3f['getAgents'](_0x56b159);}})['then'](function(_0x5a8850){if(_0x5a8850){_0x438f9a=_0x5a8850[_0xcba3('0x4a')];if(!_0x312383['query'][_0xcba3('0x4b')]('nolimit')){_0x56b159[_0xcba3('0x2e')]=qs[_0xcba3('0x2e')](_0x312383[_0xcba3('0x44')][_0xcba3('0x2e')]);_0x56b159['offset']=qs[_0xcba3('0x2d')](_0x312383[_0xcba3('0x44')][_0xcba3('0x2d')]);}return _0x5bfd3f[_0xcba3('0x77')](_0x56b159);}})[_0xcba3('0x20')](function(_0x1bbbfc){if(_0x1bbbfc){return _0x1bbbfc?{'count':_0x438f9a,'rows':_0x1bbbfc}:null;}})['then'](respondWithResult(_0x140b56,null))[_0xcba3('0x2a')](handleError(_0x140b56,null));};exports[_0xcba3('0x78')]=function(_0x4e0302,_0x2a32b0){var _0xb28548=_0x4e0302[_0xcba3('0x5a')]['id'];var _0x3d9fbc=_0x4e0302[_0xcba3('0x5d')];var _0x301ba8=0xc8;var _0x523ecf=null;return db[_0xcba3('0x79')][_0xcba3('0x7a')]({'isolationLevel':db[_0xcba3('0x79')][_0xcba3('0x7b')]['ISOLATION_LEVELS'][_0xcba3('0x7c')]},function(_0x42595e){return db[_0xcba3('0x41')][_0xcba3('0x69')]({'where':{'id':_0xb28548},'transaction':_0x42595e})[_0xcba3('0x20')](function(_0xb1606a){if(_0xb1606a){return db[_0xcba3('0x7d')][_0xcba3('0x39')]({'where':{'WhatsappAccountId':_0xb28548},'transaction':_0x42595e})['then'](function(){var _0x2598be=_[_0xcba3('0x40')](_0x3d9fbc,function(_0x40d149){_0x40d149['WhatsappAccountId']=_0xb28548;return _0x40d149;});return db[_0xcba3('0x7d')][_0xcba3('0x7e')](_0x2598be,{'transaction':_0x42595e});});}else{_0x301ba8=0x194;_0x523ecf=[];}});})[_0xcba3('0x20')](function(){if(_0x301ba8!==0x194){return db[_0xcba3('0x7d')][_0xcba3('0x7f')]({'where':{'WhatsappAccountId':_0xb28548},'order':_0xcba3('0x80')})['then'](function(_0x2f3789){_0x523ecf=_0x2f3789;});}})['catch'](function(_0x12613c){_0x301ba8=0x1f4;logger[_0xcba3('0x26')](_0x12613c['stack']);if(_0x12613c[_0xcba3('0x3b')]){delete _0x12613c[_0xcba3('0x3b')];}_0x523ecf=_0x12613c;})['finally'](function(){if(_0x523ecf===null){_0x2a32b0[_0xcba3('0x2b')](_0x301ba8);}else{if(_0x301ba8===0x1f4){_0x2a32b0['status'](_0x301ba8)[_0xcba3('0x3c')](_0x523ecf);}else{_0x2a32b0[_0xcba3('0x31')](_0x301ba8)[_0xcba3('0x81')](_0x523ecf);}}});};exports[_0xcba3('0x82')]=function(_0x3c64a4,_0x36911a,_0x1f2734){var _0x263236={};var _0x550723={};var _0x2ac168;var _0x520f8a;return db[_0xcba3('0x41')][_0xcba3('0x69')]({'where':{'id':_0x3c64a4['params']['id']}})[_0xcba3('0x20')](handleEntityNotFound(_0x36911a,null))[_0xcba3('0x20')](function(_0xa6b51e){if(_0xa6b51e){_0x2ac168=_0xa6b51e;_0x550723[_0xcba3('0x47')]=_['keys'](db[_0xcba3('0x7d')][_0xcba3('0x5b')]);_0x550723[_0xcba3('0x44')]=_['keys'](_0x3c64a4[_0xcba3('0x44')]);_0x550723['filters']=_[_0xcba3('0x46')](_0x550723['model'],_0x550723[_0xcba3('0x44')]);_0x263236[_0xcba3('0x48')]=_[_0xcba3('0x46')](_0x550723[_0xcba3('0x47')],qs[_0xcba3('0x49')](_0x3c64a4[_0xcba3('0x44')][_0xcba3('0x49')]));_0x263236[_0xcba3('0x48')]=_0x263236[_0xcba3('0x48')][_0xcba3('0x4a')]?_0x263236[_0xcba3('0x48')]:_0x550723[_0xcba3('0x47')];_0x263236[_0xcba3('0x6a')]=qs[_0xcba3('0x4d')](_0x3c64a4['query'][_0xcba3('0x4d')]);_0x263236[_0xcba3('0x52')]=qs[_0xcba3('0x4f')](_[_0xcba3('0x4e')](_0x3c64a4[_0xcba3('0x44')],_0x550723['filters']));if(_0x3c64a4[_0xcba3('0x44')][_0xcba3('0x50')]){_0x263236['where']=_['merge'](_0x263236[_0xcba3('0x52')],{'$or':_[_0xcba3('0x40')](_0x263236[_0xcba3('0x48')],function(_0x30f5ce){var _0x4216db={};_0x4216db[_0x30f5ce]={'$like':'%'+_0x3c64a4[_0xcba3('0x44')][_0xcba3('0x50')]+'%'};return _0x4216db;})});}_0x263236=_['merge']({},_0x263236,_0x3c64a4[_0xcba3('0x54')]);return _0x2ac168['getApplications'](_0x263236);}})['then'](function(_0x1c14e6){if(_0x1c14e6){_0x520f8a=_0x1c14e6[_0xcba3('0x4a')];if(!_0x3c64a4[_0xcba3('0x44')]['hasOwnProperty']('nolimit')){_0x263236[_0xcba3('0x2e')]=qs['limit'](_0x3c64a4[_0xcba3('0x44')]['limit']);_0x263236[_0xcba3('0x2d')]=qs[_0xcba3('0x2d')](_0x3c64a4[_0xcba3('0x44')]['offset']);}return _0x2ac168[_0xcba3('0x82')](_0x263236);}})[_0xcba3('0x20')](function(_0x491cf3){if(_0x491cf3){return _0x491cf3?{'count':_0x520f8a,'rows':_0x491cf3}:null;}})[_0xcba3('0x20')](respondWithResult(_0x36911a,null))['catch'](handleError(_0x36911a,null));};exports[_0xcba3('0x83')]=function(_0x4b53f8,_0x36228a,_0x2cb66d){var _0x133808={'channel':_0xcba3('0x84')};var _0x98a8f9=[];var _0x3f995e=[];var _0x1e15b8={};return db[_0xcba3('0x41')][_0xcba3('0x5c')]({'where':{'id':_0x4b53f8['params']['id']},'include':[{'model':db[_0xcba3('0x7d')],'as':_0xcba3('0x85')}]})['then'](handleEntityNotFound(_0x36228a,null))[_0xcba3('0x20')](function(_0x2a6ddf){_0x133808['account']=_0x2a6ddf;if(_0x133808[_0xcba3('0x86')]&&_0x133808[_0xcba3('0x86')][_0xcba3('0x43')]===_0xcba3('0x87')&&_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x88')]){if(_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x88')][_0xcba3('0x4a')]===0x0)return;if(_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x88')][0x0][_0xcba3('0x89')]!==_0xcba3('0x8a'))return;return db[_0xcba3('0x8b')][_0xcba3('0x35')]({'read':!![],'readAt':_0x4b53f8[_0xcba3('0x5d')]['statuses'][0x0][_0xcba3('0x8c')]},{'where':{'messageId':_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x88')][0x0][_0xcba3('0x8d')]},'individualHooks':!![]})[_0xcba3('0x20')](function(_0x2805cb){return _0x36228a[_0xcba3('0x31')](0xc8)[_0xcba3('0x81')](_0x2805cb);});}_0x133808[_0xcba3('0x8e')]=_['orderBy'](_0x2a6ddf['Applications'],[_0xcba3('0x80')],[_0xcba3('0x8f')]);if(_0x133808['account'][_0xcba3('0x85')]){delete _0x133808[_0xcba3('0x86')][_0xcba3('0x85')];}return db[_0xcba3('0x90')][_0xcba3('0x63')]()['then'](function(_0x4192b7){if(!_0x4192b7){throw new db[(_0xcba3('0x91'))][(_0xcba3('0x92'))](_0xcba3('0x93'));}_0x98a8f9=_[_0xcba3('0x94')](_[_0xcba3('0x45')](_0x4192b7),[_0xcba3('0x95'),_0xcba3('0x96')]);_0x3f995e=_['difference'](_[_0xcba3('0x45')](_0x4192b7),[_0xcba3('0x95'),_0xcba3('0x96'),_0xcba3('0x97'),'ListId']);_0x133808[_0xcba3('0x5d')]={'mapKey':_0xcba3('0x98')};if(_0x133808[_0xcba3('0x86')]&&_0x133808[_0xcba3('0x86')]['type']===_0xcba3('0x99')){_0x133808[_0xcba3('0x5d')][_0xcba3('0x9a')]=_0x4b53f8[_0xcba3('0x5d')]['From'][_0xcba3('0x9b')]('whatsapp:','');_0x133808[_0xcba3('0x5d')]['body']=_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x9c')];_0x133808[_0xcba3('0x5d')]['messageId']=_0x4b53f8['body'][_0xcba3('0x9d')];}if(_0x133808[_0xcba3('0x86')]&&_0x133808[_0xcba3('0x86')]['type']==='sinch'){_0x133808[_0xcba3('0x5d')][_0xcba3('0x9a')]=_0x4b53f8[_0xcba3('0x5d')]['notifications'][0x0][_0xcba3('0x9a')];_0x133808[_0xcba3('0x5d')][_0xcba3('0x5d')]=_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x9e')][0x0][_0xcba3('0x29')]['body'];_0x133808[_0xcba3('0x5d')][_0xcba3('0x9f')]=_0x4b53f8[_0xcba3('0x5d')][_0xcba3('0x9e')][0x0][_0xcba3('0x8d')];}if(_0x133808['body']['id']){delete _0x133808[_0xcba3('0x5d')]['id'];}if(_['isNil'](_0x133808[_0xcba3('0x5d')][_0xcba3('0x9a')])){throw new db['Sequelize'][(_0xcba3('0x92'))]('from\x20is\x20mandatory');}if(_[_0xcba3('0xa0')](_0x133808[_0xcba3('0x5d')][_0xcba3('0x5d')])||_0x133808['body'][_0xcba3('0x5d')]===''){throw new db[(_0xcba3('0x91'))][(_0xcba3('0x92'))](_0xcba3('0xa1'));}if(_[_0xcba3('0xa0')](_0x133808[_0xcba3('0x5d')][_0xcba3('0xa2')])){throw new db['Sequelize'][(_0xcba3('0x92'))](_0xcba3('0xa3')+_0x3f995e);}if(!_[_0xcba3('0xa4')](_0x3f995e,_0x133808[_0xcba3('0x5d')][_0xcba3('0xa2')])){throw new db[(_0xcba3('0x91'))][(_0xcba3('0x92'))](_0xcba3('0xa5')+_0x3f995e);}_0x1e15b8[_0x133808[_0xcba3('0x5d')][_0xcba3('0xa2')]]=_0x133808['body'][_0xcba3('0x9a')];return db['CmList']['find']({'where':{'id':_0x133808[_0xcba3('0x86')][_0xcba3('0xa6')]},'include':[{'model':db[_0xcba3('0x90')],'as':_0xcba3('0xa7'),'where':_0x1e15b8,'limit':0x1,'order':[[_0xcba3('0x96'),_0xcba3('0xa8')]]}]});})[_0xcba3('0x20')](handleEntityNotFound(_0x36228a,null))[_0xcba3('0x20')](function(_0x26908d){if(_0x26908d){_0x133808['list']=_[_0xcba3('0xa9')](_0x26908d,[_0xcba3('0xa7')]);if(_0x26908d[_0xcba3('0xa7')][_0xcba3('0x4a')]){return _0x26908d['Contacts'][0x0];}var _0x58e670=_[_0xcba3('0x1a')](_0x133808[_0xcba3('0x5d')],{'firstName':_0x133808[_0xcba3('0x5d')][_0xcba3('0x9a')],'ListId':_0x26908d['id']});_0x58e670[_0x133808[_0xcba3('0x5d')][_0xcba3('0xa2')]]=_0x133808[_0xcba3('0x5d')]['from'];return db[_0xcba3('0x90')][_0xcba3('0x67')](_0x58e670,{'fields':_0x98a8f9,'raw':!![]});}})[_0xcba3('0x20')](handleEntityNotFound(_0x36228a,null))['then'](function(_0x4800da){if(_0x4800da){_0x133808['contact']=_0x4800da;var _0x201f8f={'ContactId':_0x4800da['id'],'phone':_0x133808[_0xcba3('0x5d')]['from'],'WhatsappAccountId':_0x4b53f8[_0xcba3('0x5a')]['id']};var _0x5e6b52={'ContactId':_0x4800da['id'],'WhatsappAccountId':_0x4b53f8[_0xcba3('0x5a')]['id'],'closed':![]};return db[_0xcba3('0xaa')][_0xcba3('0x5c')]({'where':_0x5e6b52})[_0xcba3('0x20')](function(_0x519cf2){if(_0x519cf2){return[_0x519cf2,![]];}return db[_0xcba3('0xaa')][_0xcba3('0x67')](_0x201f8f)[_0xcba3('0x20')](function(_0x514f34){return[_0x514f34,!![]];});});}})['spread'](function(_0x578606,_0x46ab64){_0x133808[_0xcba3('0xab')]=_0x578606['get']({'plain':!![]});_0x133808[_0xcba3('0xab')][_0xcba3('0xac')]=![];if(_0x46ab64){if(_0x133808[_0xcba3('0x86')][_0xcba3('0xad')]){_0x133808[_0xcba3('0x8e')][_0xcba3('0xae')]({'id':0x0,'priority':_0x133808[_0xcba3('0x8e')][_0xcba3('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xcba3('0xaf')});}_0x133808[_0xcba3('0xab')][_0xcba3('0xac')]=!![];}return db[_0xcba3('0x8b')][_0xcba3('0x67')]({'phone':_0x133808[_0xcba3('0x5d')]['from'],'messageId':_0x133808[_0xcba3('0x5d')][_0xcba3('0x9f')],'body':_0x133808[_0xcba3('0x5d')][_0xcba3('0x5d')],'WhatsappAccountId':_0x4b53f8['params']['id'],'WhatsappInteractionId':_0x578606['id'],'direction':'in','ContactId':_0x578606[_0xcba3('0xb0')],'AttachmentId':_0x133808[_0xcba3('0x5d')][_0xcba3('0xb1')]});})['then'](function(_0x35ab72){_0x133808['message']=_0x35ab72;if(!_0x133808[_0xcba3('0xab')]['UserId'])return;return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x133808['interaction'][_0xcba3('0xb2')]}});})[_0xcba3('0x20')](function(_0x2e4bf4){if(_0x2e4bf4){_0x133808['applications'][_0xcba3('0xb3')]({'id':0x0,'priority':0x0,'app':_0xcba3('0xb4'),'appdata':_0x2e4bf4[_0xcba3('0x3b')]+','+(_0x133808['account']['waitForTheAssignedAgent']||0xa),'interval':_0xcba3('0xaf')});}if(!_0x133808['interaction']['queueId'])return;return db[_0xcba3('0xb5')]['find']({'attributes':['id',_0xcba3('0x3b')],'where':{'id':_0x133808[_0xcba3('0xab')]['queueId']}});})[_0xcba3('0x20')](function(_0x23de53){if(_0x23de53){_0x133808[_0xcba3('0x8e')][_0xcba3('0xb3')]({'id':0x0,'priority':0x1,'app':_0xcba3('0xb6'),'appdata':_0x23de53[_0xcba3('0x3b')]+','+(_0x133808[_0xcba3('0x86')][_0xcba3('0xb7')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xcba3('0xb8'),'startRouting',_0x133808);})[_0xcba3('0x20')](function(_0x55eccb){if(_0x55eccb){var _0x53360f=0xc8;var _0x1e1421=_0xcba3('0xb9');logger[_0xcba3('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1e1421,_0x53360f,'entity\x20found');logger[_0xcba3('0x23')](_0xcba3('0xba'),_0x1e1421,_0x53360f,_0xcba3('0xbb'),JSON['stringify'](_0x55eccb));if(_0x133808['account'][_0xcba3('0x43')]==='twilio'){return _0x36228a[_0xcba3('0x31')](_0x53360f)['set']('Content-Type','text/xml')[_0xcba3('0x3c')](_0xcba3('0xbc'));}else{return _0x36228a[_0xcba3('0x31')](_0x53360f)[_0xcba3('0x81')](_0x55eccb);}}});})[_0xcba3('0x2a')](handleError(_0x36228a,null));};exports[_0xcba3('0x3c')]=function(_0x56b097,_0x50b992,_0x9755db){var _0x3da9cb,_0x1e998f,_0x42cce4;if(_[_0xcba3('0xa0')](_0x56b097['body'][_0xcba3('0x5d')])||_0x56b097[_0xcba3('0x5d')][_0xcba3('0x5d')]===''){throw new db[(_0xcba3('0x91'))][(_0xcba3('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcba3('0xa0')](_0x56b097['body']['to'])){throw new db[(_0xcba3('0x91'))]['ValidationError']('to\x20is\x20mandatory');}_0x3da9cb=_0x56b097[_0xcba3('0x5d')]['to'];return db[_0xcba3('0x41')]['find']({'where':{'id':_0x56b097['params']['id']},'include':[{'model':db[_0xcba3('0xbd')],'as':_0xcba3('0xbe'),'include':[{'model':db[_0xcba3('0x90')],'as':_0xcba3('0xa7'),'where':{'mobile':_0x3da9cb},'limit':0x1,'order':[[_0xcba3('0x96'),_0xcba3('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x50b992,null))[_0xcba3('0x20')](function(_0x331648){if(_0x331648&&_0x331648[_0xcba3('0xbe')]){_0x1e998f=_0x331648[_0xcba3('0x36')]({'plain':!![]});if(_0x1e998f['List']&&_0x1e998f[_0xcba3('0xbe')][_0xcba3('0xa7')][_0xcba3('0x4a')]){return _0x1e998f['List'][_0xcba3('0xa7')][0x0];}return db[_0xcba3('0x90')][_0xcba3('0x67')](_[_0xcba3('0x1a')](_0x56b097[_0xcba3('0x5d')],{'firstName':_0x3da9cb,'mobile':_0x3da9cb,'phone':_0x3da9cb,'ListId':_0x1e998f['ListId']}));}})[_0xcba3('0x20')](handleEntityNotFound(_0x50b992,null))[_0xcba3('0x20')](function(_0x2cd2a3){if(_0x2cd2a3){_0x42cce4=_0x2cd2a3;return db[_0xcba3('0xaa')][_0xcba3('0x5c')]({'where':{'ContactId':_0x42cce4['id'],'closed':![],'WhatsappAccountId':_0x1e998f['id']}})[_0xcba3('0x20')](function(_0x37fe43){if(_0x37fe43){return[_0x37fe43,![]];}return db['WhatsappInteraction'][_0xcba3('0x67')]({'UserId':_0x56b097[_0xcba3('0x5e')]['id'],'ContactId':_0x42cce4['id'],'WhatsappAccountId':_0x1e998f['id'],'phone':_0x3da9cb,'firstMsgDirection':_0xcba3('0xbf'),'Messages':[_[_0xcba3('0x51')](_0x56b097[_0xcba3('0x5d')],{'read':![],'body':_0x56b097[_0xcba3('0x5d')][_0xcba3('0x5d')],'phone':_0x3da9cb,'WhatsappAccountId':_0x1e998f['id'],'UserId':_0x56b097[_0xcba3('0x5e')]['id'],'ContactId':_0x42cce4['id']})]},{'include':[{'model':db[_0xcba3('0x8b')],'as':_0xcba3('0xc0')}]})[_0xcba3('0x20')](function(_0x30d36a){return[_0x30d36a,!![]];});});}})[_0xcba3('0x71')](function(_0x32a763,_0x4e13dc){if(_0x4e13dc){return _0x32a763;}return db['WhatsappMessage']['create'](_['merge'](_0x56b097['body'],{'read':![],'body':_0x56b097[_0xcba3('0x5d')][_0xcba3('0x5d')],'phone':_0x3da9cb,'WhatsappAccountId':_0x1e998f['id'],'WhatsappInteractionId':_0x32a763['id'],'UserId':_0x56b097[_0xcba3('0x5e')]['id'],'ContactId':_0x42cce4['id']}))[_0xcba3('0x20')](function(_0x25e40f){_0x32a763[_0xcba3('0xc1')][_0xcba3('0xc0')]=[];_0x32a763[_0xcba3('0xc1')]['Messages'][_0xcba3('0xae')](_0x25e40f[_0xcba3('0xc1')]);return _0x32a763;});})[_0xcba3('0x20')](respondWithResult(_0x50b992,null))['catch'](handleError(_0x50b992,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 4c95858..e8fc5ad 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 _0xe004=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe004,0x1e1));var _0x4e00=function(_0x190940,_0x1886ae){_0x190940=_0x190940-0x0;var _0x34f9e2=_0xe004[_0x190940];return _0x34f9e2;};'use strict';var EventEmitter=require(_0x4e00('0x0'));var WhatsappAccount=require(_0x4e00('0x1'))['db'][_0x4e00('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4e00('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e00('0x4'),'afterDestroy':_0x4e00('0x5')};function emitEvent(_0x50cae9){return function(_0x4145f8,_0x5bb873,_0x37ecf7){WhatsappAccountEvents[_0x4e00('0x6')](_0x50cae9+':'+_0x4145f8['id'],_0x4145f8);WhatsappAccountEvents['emit'](_0x50cae9,_0x4145f8);_0x37ecf7(null);};}for(var e in events){if(events[_0x4e00('0x7')](e)){var event=events[e];WhatsappAccount[_0x4e00('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x82aa=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x17b5bb,_0x1ec2dd){var _0x452f90=function(_0x42f5c0){while(--_0x42f5c0){_0x17b5bb['push'](_0x17b5bb['shift']());}};_0x452f90(++_0x1ec2dd);}(_0x82aa,0x7f));var _0xa82a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x82aa[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xa82a('0x0'));var WhatsappAccount=require(_0xa82a('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa82a('0x2')](0x0);var events={'afterCreate':_0xa82a('0x3'),'afterUpdate':_0xa82a('0x4'),'afterDestroy':_0xa82a('0x5')};function emitEvent(_0x1e4f95){return function(_0x31fc58,_0x3fefcd,_0x5b17a3){WhatsappAccountEvents[_0xa82a('0x6')](_0x1e4f95+':'+_0x31fc58['id'],_0x31fc58);WhatsappAccountEvents[_0xa82a('0x6')](_0x1e4f95,_0x31fc58);_0x5b17a3(null);};}for(var e in events){if(events[_0xa82a('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xa82a('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index dc22e9b..88eb689 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 _0xa355=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3a8b07,_0x3b3fcd){var _0x3ab9e7=function(_0x40e99b){while(--_0x40e99b){_0x3a8b07['push'](_0x3a8b07['shift']());}};_0x3ab9e7(++_0x3b3fcd);}(_0xa355,0x1d4));var _0x5a35=function(_0x39c4b0,_0x2f6bd6){_0x39c4b0=_0x39c4b0-0x0;var _0x5c244f=_0xa355[_0x39c4b0];return _0x5c244f;};'use strict';var _=require('lodash');var util=require(_0x5a35('0x0'));var logger=require(_0x5a35('0x1'))(_0x5a35('0x2'));var moment=require('moment');var BPromise=require(_0x5a35('0x3'));var rp=require(_0x5a35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a35('0x5'));var config=require(_0x5a35('0x6'));var attributes=require(_0x5a35('0x7'));module[_0x5a35('0x8')]=function(_0x2dbf3d,_0x2560fa){return _0x2dbf3d[_0x5a35('0x9')](_0x5a35('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec4b=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x60cce0,_0x1cfc18){var _0xbd2b=function(_0x2b3673){while(--_0x2b3673){_0x60cce0['push'](_0x60cce0['shift']());}};_0xbd2b(++_0x1cfc18);}(_0xec4b,0x9a));var _0xbec4=function(_0x2a0b50,_0x179f09){_0x2a0b50=_0x2a0b50-0x0;var _0x5dc5a5=_0xec4b[_0x2a0b50];return _0x5dc5a5;};'use strict';var _=require(_0xbec4('0x0'));var util=require(_0xbec4('0x1'));var logger=require(_0xbec4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbec4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbec4('0x4'));var rimraf=require(_0xbec4('0x5'));var config=require(_0xbec4('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xbec4('0x7')]=function(_0x5290a1,_0x449b72){return _0x5290a1[_0xbec4('0x8')](_0xbec4('0x9'),attributes,{'tableName':_0xbec4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 79277f1..d998a55 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 _0x58a3=['./whatsappAccount.socket','register','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','model','attributes','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x29a2ce,_0x5d6558){var _0x2fa9ea=function(_0x526d35){while(--_0x526d35){_0x29a2ce['push'](_0x29a2ce['shift']());}};_0x2fa9ea(++_0x5d6558);}(_0x58a3,0xfc));var _0x358a=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x58a3[_0x17e771];return _0x1f3a6d;};'use strict';var _=require(_0x358a('0x0'));var util=require(_0x358a('0x1'));var moment=require('moment');var BPromise=require(_0x358a('0x2'));var rs=require(_0x358a('0x3'));var fs=require('fs');var Redis=require(_0x358a('0x4'));var db=require(_0x358a('0x5'))['db'];var utils=require(_0x358a('0x6'));var logger=require(_0x358a('0x7'))(_0x358a('0x8'));var config=require(_0x358a('0x9'));var jayson=require(_0x358a('0xa'));var client=jayson[_0x358a('0xb')]['http']({'port':0x232a});config[_0x358a('0xc')]=_['defaults'](config[_0x358a('0xc')],{'host':_0x358a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x358a('0xc')]));require(_0x358a('0xe'))[_0x358a('0xf')](socket);function respondWithRpcPromise(_0x22f9a4,_0xe75f2c,_0x1e19fc){return new BPromise(function(_0x5f2c70,_0x20f4f9){return client['request'](_0x22f9a4,_0x1e19fc)[_0x358a('0x10')](function(_0x2ed614){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0xe75f2c,_0x358a('0x11'));logger['debug'](_0x358a('0x12'),_0xe75f2c,_0x358a('0x11'),JSON['stringify'](_0x2ed614));if(_0x2ed614[_0x358a('0x13')]){if(_0x2ed614['error'][_0x358a('0x14')]===0x1f4){logger['error'](_0x358a('0x15'),_0xe75f2c,_0x2ed614['error'][_0x358a('0x16')]);return _0x20f4f9(_0x2ed614[_0x358a('0x13')]['message']);}logger['error'](_0x358a('0x15'),_0xe75f2c,_0x2ed614[_0x358a('0x13')][_0x358a('0x16')]);return _0x5f2c70(_0x2ed614[_0x358a('0x13')]['message']);}else{logger[_0x358a('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0xe75f2c,_0x358a('0x11'));_0x5f2c70(_0x2ed614[_0x358a('0x18')][_0x358a('0x16')]);}})[_0x358a('0x19')](function(_0x4cac52){logger[_0x358a('0x13')](_0x358a('0x15'),_0xe75f2c,_0x4cac52);_0x20f4f9(_0x4cac52);});});}exports[_0x358a('0x1a')]=function(_0x1520ef){var _0x1d10df=this;return new Promise(function(_0x9161b1,_0x38bdb7){return db[_0x358a('0x1b')][_0x358a('0x1c')]({'raw':_0x1520ef['options']?_0x1520ef[_0x358a('0x1d')][_0x358a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1520ef['options']?_0x1520ef[_0x358a('0x1d')][_0x358a('0x1f')]||null:null,'attributes':_0x1520ef[_0x358a('0x1d')]?_0x1520ef[_0x358a('0x1d')]['attributes']||null:null,'include':_0x1520ef[_0x358a('0x1d')]?_0x1520ef['options'][_0x358a('0x20')]?_[_0x358a('0x21')](_0x1520ef[_0x358a('0x1d')][_0x358a('0x20')],function(_0x4584b7){return{'model':db[_0x4584b7[_0x358a('0x22')]],'as':_0x4584b7['as'],'attributes':_0x4584b7[_0x358a('0x23')],'include':_0x4584b7['include']?_[_0x358a('0x21')](_0x4584b7['include'],function(_0x20131e){return{'model':db[_0x20131e[_0x358a('0x22')]],'as':_0x20131e['as'],'attributes':_0x20131e[_0x358a('0x23')],'include':_0x20131e[_0x358a('0x20')]?_[_0x358a('0x21')](_0x20131e[_0x358a('0x20')],function(_0x49043b){return{'model':db[_0x49043b[_0x358a('0x22')]],'as':_0x49043b['as'],'attributes':_0x49043b[_0x358a('0x23')]};}):[]};}):[]};}):[]:[]})[_0x358a('0x10')](function(_0x46c592){logger[_0x358a('0x17')](_0x358a('0x1a'),_0x1520ef);logger[_0x358a('0x24')](_0x358a('0x1a'),_0x1520ef,JSON[_0x358a('0x25')](_0x46c592));_0x9161b1(_0x46c592);})[_0x358a('0x19')](function(_0x1f3e4b){logger[_0x358a('0x13')](_0x358a('0x1a'),_0x1f3e4b[_0x358a('0x16')],_0x1520ef);_0x38bdb7(_0x1d10df['error'](0x1f4,_0x1f3e4b[_0x358a('0x16')]));});});}; \ No newline at end of file +var _0x8001=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappAccount','options','raw','attributes','include','model','map','ShowWhatsappAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c92fb,_0x4a657f){var _0x47289c=function(_0x57e5ba){while(--_0x57e5ba){_0x5c92fb['push'](_0x5c92fb['shift']());}};_0x47289c(++_0x4a657f);}(_0x8001,0xac));var _0x1800=function(_0x26706f,_0x38ab5e){_0x26706f=_0x26706f-0x0;var _0x3bf23c=_0x8001[_0x26706f];return _0x3bf23c;};'use strict';var _=require(_0x1800('0x0'));var util=require(_0x1800('0x1'));var moment=require(_0x1800('0x2'));var BPromise=require(_0x1800('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1800('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1800('0x5'));var logger=require(_0x1800('0x6'))(_0x1800('0x7'));var config=require(_0x1800('0x8'));var jayson=require(_0x1800('0x9'));var client=jayson[_0x1800('0xa')][_0x1800('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1800('0xc')],{'host':_0x1800('0xd'),'port':0x18eb});var socket=require(_0x1800('0xe'))(new Redis(config[_0x1800('0xc')]));require('./whatsappAccount.socket')[_0x1800('0xf')](socket);function respondWithRpcPromise(_0x3b0ac3,_0x453aa5,_0x3adb78){return new BPromise(function(_0x201b01,_0x4f6c05){return client['request'](_0x3b0ac3,_0x3adb78)[_0x1800('0x10')](function(_0x2f9c68){logger[_0x1800('0x11')](_0x1800('0x12'),_0x453aa5,'request\x20sent');logger[_0x1800('0x13')](_0x1800('0x14'),_0x453aa5,_0x1800('0x15'),JSON[_0x1800('0x16')](_0x2f9c68));if(_0x2f9c68[_0x1800('0x17')]){if(_0x2f9c68[_0x1800('0x17')][_0x1800('0x18')]===0x1f4){logger[_0x1800('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x453aa5,_0x2f9c68[_0x1800('0x17')][_0x1800('0x19')]);return _0x4f6c05(_0x2f9c68['error'][_0x1800('0x19')]);}logger[_0x1800('0x17')](_0x1800('0x12'),_0x453aa5,_0x2f9c68['error'][_0x1800('0x19')]);return _0x201b01(_0x2f9c68['error'][_0x1800('0x19')]);}else{logger[_0x1800('0x11')](_0x1800('0x12'),_0x453aa5,'request\x20sent');_0x201b01(_0x2f9c68[_0x1800('0x1a')][_0x1800('0x19')]);}})[_0x1800('0x1b')](function(_0x21a586){logger['error'](_0x1800('0x12'),_0x453aa5,_0x21a586);_0x4f6c05(_0x21a586);});});}exports['ShowWhatsappAccount']=function(_0xc59744){var _0x599379=this;return new Promise(function(_0x3a0f24,_0x524ce0){return db[_0x1800('0x1c')]['find']({'raw':_0xc59744[_0x1800('0x1d')]?_0xc59744['options'][_0x1800('0x1e')]===undefined?!![]:![]:!![],'where':_0xc59744[_0x1800('0x1d')]?_0xc59744[_0x1800('0x1d')]['where']||null:null,'attributes':_0xc59744[_0x1800('0x1d')]?_0xc59744[_0x1800('0x1d')][_0x1800('0x1f')]||null:null,'include':_0xc59744['options']?_0xc59744[_0x1800('0x1d')][_0x1800('0x20')]?_['map'](_0xc59744[_0x1800('0x1d')][_0x1800('0x20')],function(_0x85b6b5){return{'model':db[_0x85b6b5[_0x1800('0x21')]],'as':_0x85b6b5['as'],'attributes':_0x85b6b5[_0x1800('0x1f')],'include':_0x85b6b5[_0x1800('0x20')]?_[_0x1800('0x22')](_0x85b6b5[_0x1800('0x20')],function(_0x486e99){return{'model':db[_0x486e99[_0x1800('0x21')]],'as':_0x486e99['as'],'attributes':_0x486e99['attributes'],'include':_0x486e99[_0x1800('0x20')]?_[_0x1800('0x22')](_0x486e99['include'],function(_0x54e998){return{'model':db[_0x54e998[_0x1800('0x21')]],'as':_0x54e998['as'],'attributes':_0x54e998[_0x1800('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1800('0x10')](function(_0xdf700a){logger[_0x1800('0x11')]('ShowWhatsappAccount',_0xc59744);logger[_0x1800('0x13')](_0x1800('0x23'),_0xc59744,JSON['stringify'](_0xdf700a));_0x3a0f24(_0xdf700a);})[_0x1800('0x1b')](function(_0xf8702d){logger[_0x1800('0x17')](_0x1800('0x23'),_0xf8702d['message'],_0xc59744);_0x524ce0(_0x599379['error'](0x1f4,_0xf8702d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a6a79b9..a3cdbd3 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 _0x33d8=['save','update','emit','register','length','whatsappAccount:'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x33d8,0xc0));var _0x833d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x33d8[_0x199572];return _0x13cfa3;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x833d('0x0'),'remove',_0x833d('0x1')];function createListener(_0x3defbb,_0x65ed61){return function(_0x294223){_0x65ed61[_0x833d('0x2')](_0x3defbb,_0x294223);};}function removeListener(_0x5c14cc,_0x1f931a){return function(){WhatsappAccountEvents['removeListener'](_0x5c14cc,_0x1f931a);};}exports[_0x833d('0x3')]=function(_0x13ab1c){for(var _0x249660=0x0,_0x353a14=events[_0x833d('0x4')];_0x249660<_0x353a14;_0x249660++){var _0x2b103b=events[_0x249660];var _0x5ca789=createListener(_0x833d('0x5')+_0x2b103b,_0x13ab1c);WhatsappAccountEvents['on'](_0x2b103b,_0x5ca789);}}; \ No newline at end of file +var _0x05c5=['length','whatsappAccount:','remove','update','emit','removeListener','register'];(function(_0x3ffcae,_0x250b6a){var _0x4c79e3=function(_0x14f7ee){while(--_0x14f7ee){_0x3ffcae['push'](_0x3ffcae['shift']());}};_0x4c79e3(++_0x250b6a);}(_0x05c5,0x16e));var _0x505c=function(_0x2822b3,_0x49842b){_0x2822b3=_0x2822b3-0x0;var _0x4b9178=_0x05c5[_0x2822b3];return _0x4b9178;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x505c('0x0'),_0x505c('0x1')];function createListener(_0x17f301,_0x155dae){return function(_0x139f17){_0x155dae[_0x505c('0x2')](_0x17f301,_0x139f17);};}function removeListener(_0x4e5994,_0x1e8abc){return function(){WhatsappAccountEvents[_0x505c('0x3')](_0x4e5994,_0x1e8abc);};}exports[_0x505c('0x4')]=function(_0x558924){for(var _0x416510=0x0,_0x5291b1=events[_0x505c('0x5')];_0x416510<_0x5291b1;_0x416510++){var _0xf8b130=events[_0x416510];var _0x277f4a=createListener(_0x505c('0x6')+_0xf8b130,_0x558924);WhatsappAccountEvents['on'](_0xf8b130,_0x277f4a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 68274ba..e155d08 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 _0x789e=['../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x48776a,_0x9af593){var _0x5d344b=function(_0x4b2a41){while(--_0x4b2a41){_0x48776a['push'](_0x48776a['shift']());}};_0x5d344b(++_0x9af593);}(_0x789e,0x151));var _0xe789=function(_0x115dcc,_0x285eb2){_0x115dcc=_0x115dcc-0x0;var _0x6a907c=_0x789e[_0x115dcc];return _0x6a907c;};'use strict';var multer=require(_0xe789('0x0'));var util=require(_0xe789('0x1'));var path=require(_0xe789('0x2'));var timeout=require('connect-timeout');var express=require(_0xe789('0x3'));var router=express[_0xe789('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe789('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe789('0x6'));var controller=require(_0xe789('0x7'));router['get']('/',auth[_0xe789('0x8')](),controller['index']);router['get'](_0xe789('0x9'),auth[_0xe789('0x8')](),controller[_0xe789('0xa')]);router[_0xe789('0xb')]('/',auth['isAuthenticated'](),controller[_0xe789('0xc')]);router[_0xe789('0xd')](_0xe789('0x9'),auth[_0xe789('0x8')](),controller[_0xe789('0xe')]);router[_0xe789('0xf')](_0xe789('0x9'),auth['isAuthenticated'](),controller[_0xe789('0x10')]);module[_0xe789('0x11')]=router; \ No newline at end of file +var _0x3afb=['post','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show'];(function(_0x2973eb,_0x116234){var _0x2b704a=function(_0x4e3d83){while(--_0x4e3d83){_0x2973eb['push'](_0x2973eb['shift']());}};_0x2b704a(++_0x116234);}(_0x3afb,0x1eb));var _0xb3af=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0x3afb[_0x41b0a8];return _0x3a83d4;};'use strict';var multer=require(_0xb3af('0x0'));var util=require('util');var path=require(_0xb3af('0x1'));var timeout=require(_0xb3af('0x2'));var express=require('express');var router=express[_0xb3af('0x3')]();var fs_extra=require(_0xb3af('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb3af('0x5'));var config=require(_0xb3af('0x6'));var controller=require(_0xb3af('0x7'));router[_0xb3af('0x8')]('/',auth['isAuthenticated'](),controller[_0xb3af('0x9')]);router[_0xb3af('0x8')](_0xb3af('0xa'),auth[_0xb3af('0xb')](),controller[_0xb3af('0xc')]);router[_0xb3af('0xd')]('/',auth[_0xb3af('0xb')](),controller[_0xb3af('0xe')]);router[_0xb3af('0xf')](_0xb3af('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xb3af('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb3af('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index a2653aa..2d1d6d1 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 _0xc763=['STRING','*,*,*,*'];(function(_0xbf2ab1,_0x100416){var _0x1cd4d6=function(_0x3f4c4d){while(--_0x3f4c4d){_0xbf2ab1['push'](_0xbf2ab1['shift']());}};_0x1cd4d6(++_0x100416);}(_0xc763,0x7e));var _0x3c76=function(_0x1c675a,_0x51cff0){_0x1c675a=_0x1c675a-0x0;var _0x40f5f8=_0xc763[_0x1c675a];return _0x40f5f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3c76('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3c76('0x0')]},'interval':{'type':Sequelize[_0x3c76('0x0')],'defaultValue':_0x3c76('0x1')}}; \ No newline at end of file +var _0xb0a9=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x17e771,_0x55fd17){var _0x1f3a6d=function(_0x346ee3){while(--_0x346ee3){_0x17e771['push'](_0x17e771['shift']());}};_0x1f3a6d(++_0x55fd17);}(_0xb0a9,0x16a));var _0x9b0a=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0xb0a9[_0x53f402];return _0x45a76d;};'use strict';var Sequelize=require(_0x9b0a('0x0'));module[_0x9b0a('0x1')]={'priority':{'type':Sequelize[_0x9b0a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9b0a('0x3')],'allowNull':![],'defaultValue':_0x9b0a('0x4')},'appdata':{'type':Sequelize[_0x9b0a('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9b0a('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 9aa61d2..c54d721 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 _0x7374=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x8523ad,_0x395663){var _0x4dfb2d=function(_0x455b13){while(--_0x455b13){_0x8523ad['push'](_0x8523ad['shift']());}};_0x4dfb2d(++_0x395663);}(_0x7374,0x1b9));var _0x4737=function(_0x5be01d,_0x374600){_0x5be01d=_0x5be01d-0x0;var _0x54baf4=_0x7374[_0x5be01d];return _0x54baf4;};'use strict';var emlformat=require(_0x4737('0x0'));var rimraf=require(_0x4737('0x1'));var zipdir=require(_0x4737('0x2'));var jsonpatch=require(_0x4737('0x3'));var rp=require(_0x4737('0x4'));var moment=require('moment');var BPromise=require(_0x4737('0x5'));var Mustache=require(_0x4737('0x6'));var util=require(_0x4737('0x7'));var path=require(_0x4737('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4737('0x9'));var fs=require('fs');var fs_extra=require(_0x4737('0xa'));var _=require(_0x4737('0xb'));var squel=require(_0x4737('0xc'));var crypto=require('crypto');var jsforce=require(_0x4737('0xd'));var deskjs=require(_0x4737('0xe'));var toCsv=require(_0x4737('0xf'));var querystring=require(_0x4737('0x10'));var Papa=require(_0x4737('0x11'));var Redis=require('ioredis');var authService=require(_0x4737('0x12'));var qs=require(_0x4737('0x13'));var as=require(_0x4737('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4737('0x15'));var utils=require(_0x4737('0x16'));var config=require(_0x4737('0x17'));var licenseUtil=require(_0x4737('0x18'));var db=require(_0x4737('0x19'))['db'];function respondWithStatusCode(_0xe662e8,_0x438f1d){_0x438f1d=_0x438f1d||0xcc;return function(_0xa7c11){if(_0xa7c11){return _0xe662e8[_0x4737('0x1a')](_0x438f1d);}return _0xe662e8['status'](_0x438f1d)[_0x4737('0x1b')]();};}function respondWithResult(_0x301753,_0x69f87b){_0x69f87b=_0x69f87b||0xc8;return function(_0xc7fceb){if(_0xc7fceb){return _0x301753[_0x4737('0x1c')](_0x69f87b)['json'](_0xc7fceb);}};}function respondWithFilteredResult(_0x4c1a5a,_0xeb4aa2){return function(_0x48a8c3){if(_0x48a8c3){var _0x470ed4=typeof _0xeb4aa2[_0x4737('0x1d')]==='undefined'&&typeof _0xeb4aa2[_0x4737('0x1e')]===_0x4737('0x1f');var _0xef032a=_0x48a8c3['count'];var _0x2d2c32=_0x470ed4?0x0:_0xeb4aa2['offset'];var _0x37b74d=_0x470ed4?_0x48a8c3[_0x4737('0x20')]:_0xeb4aa2[_0x4737('0x1d')]+_0xeb4aa2[_0x4737('0x1e')];var _0x1b2183;if(_0x37b74d>=_0xef032a){_0x37b74d=_0xef032a;_0x1b2183=0xc8;}else{_0x1b2183=0xce;}_0x4c1a5a['status'](_0x1b2183);return _0x4c1a5a[_0x4737('0x21')](_0x4737('0x22'),_0x2d2c32+'-'+_0x37b74d+'/'+_0xef032a)[_0x4737('0x23')](_0x48a8c3);}return null;};}function patchUpdates(_0x354b71){return function(_0x54c899){try{jsonpatch[_0x4737('0x24')](_0x54c899,_0x354b71,!![]);}catch(_0x5d9ed4){return BPromise[_0x4737('0x25')](_0x5d9ed4);}return _0x54c899[_0x4737('0x26')]();};}function saveUpdates(_0x4c1292,_0x67fac){return function(_0x1c004f){if(_0x1c004f){return _0x1c004f[_0x4737('0x27')](_0x4c1292)[_0x4737('0x28')](function(_0x56d82f){return _0x56d82f;});}return null;};}function removeEntity(_0x116ef4,_0x2ce99e){return function(_0x49eddf){if(_0x49eddf){return _0x49eddf[_0x4737('0x29')]()['then'](function(){_0x116ef4[_0x4737('0x1c')](0xcc)[_0x4737('0x1b')]();});}};}function handleEntityNotFound(_0x3df6c5,_0x10685f){return function(_0xe8e844){if(!_0xe8e844){_0x3df6c5[_0x4737('0x1a')](0x194);}return _0xe8e844;};}function handleError(_0x542c14,_0x1cc0c7){_0x1cc0c7=_0x1cc0c7||0x1f4;return function(_0x52c764){logger[_0x4737('0x2a')](_0x52c764['stack']);if(_0x52c764[_0x4737('0x2b')]){delete _0x52c764[_0x4737('0x2b')];}_0x542c14[_0x4737('0x1c')](_0x1cc0c7)['send'](_0x52c764);};}exports['index']=function(_0x2d7486,_0x43d44a){var _0x14e4a2={},_0x2d587c={},_0x235f7b={'count':0x0,'rows':[]};var _0x5d6a2a=_[_0x4737('0x2c')](db[_0x4737('0x2d')][_0x4737('0x2e')],function(_0x31f2cd){return{'name':_0x31f2cd[_0x4737('0x2f')],'type':_0x31f2cd[_0x4737('0x30')][_0x4737('0x31')]};});_0x2d587c[_0x4737('0x32')]=_['map'](_0x5d6a2a,_0x4737('0x2b'));_0x2d587c[_0x4737('0x33')]=_[_0x4737('0x34')](_0x2d7486[_0x4737('0x33')]);_0x2d587c[_0x4737('0x35')]=_[_0x4737('0x36')](_0x2d587c[_0x4737('0x32')],_0x2d587c[_0x4737('0x33')]);_0x14e4a2[_0x4737('0x37')]=_['intersection'](_0x2d587c['model'],qs[_0x4737('0x38')](_0x2d7486[_0x4737('0x33')]['fields']));_0x14e4a2[_0x4737('0x37')]=_0x14e4a2[_0x4737('0x37')][_0x4737('0x39')]?_0x14e4a2[_0x4737('0x37')]:_0x2d587c[_0x4737('0x32')];if(!_0x2d7486[_0x4737('0x33')][_0x4737('0x3a')](_0x4737('0x3b'))){_0x14e4a2[_0x4737('0x1e')]=qs[_0x4737('0x1e')](_0x2d7486['query'][_0x4737('0x1e')]);_0x14e4a2[_0x4737('0x1d')]=qs[_0x4737('0x1d')](_0x2d7486[_0x4737('0x33')]['offset']);}_0x14e4a2['order']=qs[_0x4737('0x3c')](_0x2d7486['query'][_0x4737('0x3c')]);_0x14e4a2[_0x4737('0x3d')]=qs['filters'](_[_0x4737('0x3e')](_0x2d7486[_0x4737('0x33')],_0x2d587c[_0x4737('0x35')]),_0x5d6a2a);if(_0x2d7486[_0x4737('0x33')][_0x4737('0x3f')]){_0x14e4a2[_0x4737('0x3d')]=_[_0x4737('0x40')](_0x14e4a2['where'],{'$or':_[_0x4737('0x2c')](_0x5d6a2a,function(_0x133744){if(_0x133744[_0x4737('0x30')]!==_0x4737('0x41')){var _0x658ea3={};_0x658ea3[_0x133744[_0x4737('0x2b')]]={'$like':'%'+_0x2d7486['query'][_0x4737('0x3f')]+'%'};return _0x658ea3;}})});}_0x14e4a2=_[_0x4737('0x40')]({},_0x14e4a2,_0x2d7486[_0x4737('0x42')]);var _0x4bd105={'where':_0x14e4a2['where']};return db[_0x4737('0x2d')][_0x4737('0x20')](_0x4bd105)['then'](function(_0x27bc72){_0x235f7b[_0x4737('0x20')]=_0x27bc72;if(_0x2d7486[_0x4737('0x33')][_0x4737('0x43')]){_0x14e4a2[_0x4737('0x44')]=[{'all':!![]}];}return db[_0x4737('0x2d')][_0x4737('0x45')](_0x14e4a2);})[_0x4737('0x28')](function(_0x90fea6){_0x235f7b[_0x4737('0x46')]=_0x90fea6;return _0x235f7b;})[_0x4737('0x28')](respondWithFilteredResult(_0x43d44a,_0x14e4a2))[_0x4737('0x47')](handleError(_0x43d44a,null));};exports[_0x4737('0x48')]=function(_0x1d3620,_0x5eccca){var _0x28ca8a={'raw':!![],'where':{'id':_0x1d3620[_0x4737('0x49')]['id']}},_0xce2e64={};_0xce2e64[_0x4737('0x32')]=_[_0x4737('0x34')](db[_0x4737('0x2d')][_0x4737('0x2e')]);_0xce2e64[_0x4737('0x33')]=_[_0x4737('0x34')](_0x1d3620['query']);_0xce2e64[_0x4737('0x35')]=_[_0x4737('0x36')](_0xce2e64[_0x4737('0x32')],_0xce2e64['query']);_0x28ca8a[_0x4737('0x37')]=_[_0x4737('0x36')](_0xce2e64[_0x4737('0x32')],qs[_0x4737('0x38')](_0x1d3620[_0x4737('0x33')]['fields']));_0x28ca8a['attributes']=_0x28ca8a[_0x4737('0x37')][_0x4737('0x39')]?_0x28ca8a[_0x4737('0x37')]:_0xce2e64[_0x4737('0x32')];if(_0x1d3620[_0x4737('0x33')]['includeAll']){_0x28ca8a[_0x4737('0x44')]=[{'all':!![]}];}_0x28ca8a=_[_0x4737('0x40')]({},_0x28ca8a,_0x1d3620[_0x4737('0x42')]);return db[_0x4737('0x2d')][_0x4737('0x4a')](_0x28ca8a)[_0x4737('0x28')](handleEntityNotFound(_0x5eccca,null))[_0x4737('0x28')](respondWithResult(_0x5eccca,null))['catch'](handleError(_0x5eccca,null));};exports['create']=function(_0x4a78d,_0x2ba038){return db[_0x4737('0x2d')]['create'](_0x4a78d[_0x4737('0x4b')],{})['then'](respondWithResult(_0x2ba038,0xc9))[_0x4737('0x47')](handleError(_0x2ba038,null));};exports[_0x4737('0x27')]=function(_0x2f63d8,_0xffb923){if(_0x2f63d8[_0x4737('0x4b')]['id']){delete _0x2f63d8[_0x4737('0x4b')]['id'];}return db[_0x4737('0x2d')][_0x4737('0x4a')]({'where':{'id':_0x2f63d8[_0x4737('0x49')]['id']}})['then'](handleEntityNotFound(_0xffb923,null))[_0x4737('0x28')](saveUpdates(_0x2f63d8[_0x4737('0x4b')],null))[_0x4737('0x28')](respondWithResult(_0xffb923,null))['catch'](handleError(_0xffb923,null));};exports[_0x4737('0x29')]=function(_0x3608b2,_0x1ffd12){return db['WhatsappApplication'][_0x4737('0x4a')]({'where':{'id':_0x3608b2[_0x4737('0x49')]['id']}})[_0x4737('0x28')](handleEntityNotFound(_0x1ffd12,null))[_0x4737('0x28')](removeEntity(_0x1ffd12,null))[_0x4737('0x47')](handleError(_0x1ffd12,null));}; \ No newline at end of file +var _0xb91a=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','keys','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x35c9a2,_0x43765b){var _0x2e2376=function(_0x5b3439){while(--_0x5b3439){_0x35c9a2['push'](_0x35c9a2['shift']());}};_0x2e2376(++_0x43765b);}(_0xb91a,0xe5));var _0xab91=function(_0x44424e,_0x49ee3e){_0x44424e=_0x44424e-0x0;var _0x2c7f1a=_0xb91a[_0x44424e];return _0x2c7f1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab91('0x0'));var zipdir=require(_0xab91('0x1'));var jsonpatch=require(_0xab91('0x2'));var rp=require(_0xab91('0x3'));var moment=require('moment');var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require('util');var path=require(_0xab91('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab91('0x7'));var fs=require('fs');var fs_extra=require(_0xab91('0x8'));var _=require('lodash');var squel=require(_0xab91('0x9'));var crypto=require(_0xab91('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xab91('0xb'));var toCsv=require(_0xab91('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab91('0xd'));var qs=require(_0xab91('0xe'));var as=require(_0xab91('0xf'));var hardwareService=require(_0xab91('0x10'));var logger=require('../../config/logger')(_0xab91('0x11'));var utils=require(_0xab91('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xab91('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x381007,_0x56295c){_0x56295c=_0x56295c||0xcc;return function(_0x4c74ad){if(_0x4c74ad){return _0x381007[_0xab91('0x14')](_0x56295c);}return _0x381007['status'](_0x56295c)[_0xab91('0x15')]();};}function respondWithResult(_0x3d7004,_0x2f22d6){_0x2f22d6=_0x2f22d6||0xc8;return function(_0x29fadc){if(_0x29fadc){return _0x3d7004[_0xab91('0x16')](_0x2f22d6)[_0xab91('0x17')](_0x29fadc);}};}function respondWithFilteredResult(_0x490325,_0x20896){return function(_0x52614f){if(_0x52614f){var _0x23c3d8=typeof _0x20896[_0xab91('0x18')]===_0xab91('0x19')&&typeof _0x20896[_0xab91('0x1a')]==='undefined';var _0x434dcd=_0x52614f[_0xab91('0x1b')];var _0x1ece47=_0x23c3d8?0x0:_0x20896['offset'];var _0x489ef5=_0x23c3d8?_0x52614f[_0xab91('0x1b')]:_0x20896[_0xab91('0x18')]+_0x20896[_0xab91('0x1a')];var _0x1f9fa9;if(_0x489ef5>=_0x434dcd){_0x489ef5=_0x434dcd;_0x1f9fa9=0xc8;}else{_0x1f9fa9=0xce;}_0x490325[_0xab91('0x16')](_0x1f9fa9);return _0x490325[_0xab91('0x1c')](_0xab91('0x1d'),_0x1ece47+'-'+_0x489ef5+'/'+_0x434dcd)[_0xab91('0x17')](_0x52614f);}return null;};}function patchUpdates(_0x3ed266){return function(_0x32f85e){try{jsonpatch['apply'](_0x32f85e,_0x3ed266,!![]);}catch(_0x25f2d3){return BPromise[_0xab91('0x1e')](_0x25f2d3);}return _0x32f85e[_0xab91('0x1f')]();};}function saveUpdates(_0x5006ce,_0x580d67){return function(_0xad9571){if(_0xad9571){return _0xad9571[_0xab91('0x20')](_0x5006ce)[_0xab91('0x21')](function(_0x5995de){return _0x5995de;});}return null;};}function removeEntity(_0x5ef7d3,_0x2d7a9f){return function(_0x5b0c6a){if(_0x5b0c6a){return _0x5b0c6a[_0xab91('0x22')]()['then'](function(){_0x5ef7d3['status'](0xcc)[_0xab91('0x15')]();});}};}function handleEntityNotFound(_0x43f334,_0x1a57e2){return function(_0x2a1e5e){if(!_0x2a1e5e){_0x43f334[_0xab91('0x14')](0x194);}return _0x2a1e5e;};}function handleError(_0x70e00e,_0x26c96f){_0x26c96f=_0x26c96f||0x1f4;return function(_0x17a1f3){logger['error'](_0x17a1f3[_0xab91('0x23')]);if(_0x17a1f3[_0xab91('0x24')]){delete _0x17a1f3[_0xab91('0x24')];}_0x70e00e[_0xab91('0x16')](_0x26c96f)['send'](_0x17a1f3);};}exports[_0xab91('0x25')]=function(_0x284270,_0x5ec525){var _0x59e66a={},_0x3e3a94={},_0x2d45c8={'count':0x0,'rows':[]};var _0x223df1=_[_0xab91('0x26')](db[_0xab91('0x27')][_0xab91('0x28')],function(_0x11cdd8){return{'name':_0x11cdd8[_0xab91('0x29')],'type':_0x11cdd8[_0xab91('0x2a')][_0xab91('0x2b')]};});_0x3e3a94[_0xab91('0x2c')]=_['map'](_0x223df1,_0xab91('0x24'));_0x3e3a94[_0xab91('0x2d')]=_['keys'](_0x284270[_0xab91('0x2d')]);_0x3e3a94[_0xab91('0x2e')]=_[_0xab91('0x2f')](_0x3e3a94['model'],_0x3e3a94[_0xab91('0x2d')]);_0x59e66a['attributes']=_[_0xab91('0x2f')](_0x3e3a94[_0xab91('0x2c')],qs['fields'](_0x284270[_0xab91('0x2d')][_0xab91('0x30')]));_0x59e66a['attributes']=_0x59e66a[_0xab91('0x31')][_0xab91('0x32')]?_0x59e66a[_0xab91('0x31')]:_0x3e3a94['model'];if(!_0x284270[_0xab91('0x2d')][_0xab91('0x33')]('nolimit')){_0x59e66a[_0xab91('0x1a')]=qs[_0xab91('0x1a')](_0x284270[_0xab91('0x2d')]['limit']);_0x59e66a['offset']=qs[_0xab91('0x18')](_0x284270['query']['offset']);}_0x59e66a[_0xab91('0x34')]=qs[_0xab91('0x35')](_0x284270['query'][_0xab91('0x35')]);_0x59e66a[_0xab91('0x36')]=qs[_0xab91('0x2e')](_[_0xab91('0x37')](_0x284270[_0xab91('0x2d')],_0x3e3a94[_0xab91('0x2e')]),_0x223df1);if(_0x284270['query'][_0xab91('0x38')]){_0x59e66a[_0xab91('0x36')]=_[_0xab91('0x39')](_0x59e66a[_0xab91('0x36')],{'$or':_[_0xab91('0x26')](_0x223df1,function(_0x2bcfb0){if(_0x2bcfb0[_0xab91('0x2a')]!=='VIRTUAL'){var _0x4fd11c={};_0x4fd11c[_0x2bcfb0[_0xab91('0x24')]]={'$like':'%'+_0x284270[_0xab91('0x2d')]['filter']+'%'};return _0x4fd11c;}})});}_0x59e66a=_['merge']({},_0x59e66a,_0x284270[_0xab91('0x3a')]);var _0x4e32cf={'where':_0x59e66a[_0xab91('0x36')]};return db['WhatsappApplication'][_0xab91('0x1b')](_0x4e32cf)[_0xab91('0x21')](function(_0x591192){_0x2d45c8['count']=_0x591192;if(_0x284270[_0xab91('0x2d')][_0xab91('0x3b')]){_0x59e66a['include']=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x59e66a);})[_0xab91('0x21')](function(_0x2a2024){_0x2d45c8[_0xab91('0x3c')]=_0x2a2024;return _0x2d45c8;})['then'](respondWithFilteredResult(_0x5ec525,_0x59e66a))[_0xab91('0x3d')](handleError(_0x5ec525,null));};exports[_0xab91('0x3e')]=function(_0x4714cc,_0x20354d){var _0x1a2fdf={'raw':!![],'where':{'id':_0x4714cc[_0xab91('0x3f')]['id']}},_0x1a3bdf={};_0x1a3bdf[_0xab91('0x2c')]=_[_0xab91('0x40')](db[_0xab91('0x27')][_0xab91('0x28')]);_0x1a3bdf['query']=_[_0xab91('0x40')](_0x4714cc[_0xab91('0x2d')]);_0x1a3bdf[_0xab91('0x2e')]=_[_0xab91('0x2f')](_0x1a3bdf[_0xab91('0x2c')],_0x1a3bdf[_0xab91('0x2d')]);_0x1a2fdf[_0xab91('0x31')]=_[_0xab91('0x2f')](_0x1a3bdf[_0xab91('0x2c')],qs[_0xab91('0x30')](_0x4714cc[_0xab91('0x2d')][_0xab91('0x30')]));_0x1a2fdf[_0xab91('0x31')]=_0x1a2fdf['attributes'][_0xab91('0x32')]?_0x1a2fdf['attributes']:_0x1a3bdf['model'];if(_0x4714cc[_0xab91('0x2d')]['includeAll']){_0x1a2fdf[_0xab91('0x41')]=[{'all':!![]}];}_0x1a2fdf=_[_0xab91('0x39')]({},_0x1a2fdf,_0x4714cc[_0xab91('0x3a')]);return db[_0xab91('0x27')][_0xab91('0x42')](_0x1a2fdf)[_0xab91('0x21')](handleEntityNotFound(_0x20354d,null))['then'](respondWithResult(_0x20354d,null))[_0xab91('0x3d')](handleError(_0x20354d,null));};exports[_0xab91('0x43')]=function(_0x5dfbf9,_0x3bb98e){return db[_0xab91('0x27')][_0xab91('0x43')](_0x5dfbf9[_0xab91('0x44')],{})[_0xab91('0x21')](respondWithResult(_0x3bb98e,0xc9))[_0xab91('0x3d')](handleError(_0x3bb98e,null));};exports['update']=function(_0x5648ad,_0xb02842){if(_0x5648ad[_0xab91('0x44')]['id']){delete _0x5648ad['body']['id'];}return db[_0xab91('0x27')]['find']({'where':{'id':_0x5648ad[_0xab91('0x3f')]['id']}})['then'](handleEntityNotFound(_0xb02842,null))[_0xab91('0x21')](saveUpdates(_0x5648ad[_0xab91('0x44')],null))[_0xab91('0x21')](respondWithResult(_0xb02842,null))[_0xab91('0x3d')](handleError(_0xb02842,null));};exports[_0xab91('0x22')]=function(_0xecec47,_0x279fbf){return db[_0xab91('0x27')]['find']({'where':{'id':_0xecec47[_0xab91('0x3f')]['id']}})[_0xab91('0x21')](handleEntityNotFound(_0x279fbf,null))[_0xab91('0x21')](removeEntity(_0x279fbf,null))['catch'](handleError(_0x279fbf,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 72daa4a..ab6b045 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 _0x544a=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x544a,0xbd));var _0xa544=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x544a[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require(_0xa544('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa544('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa544('0x4'));var rimraf=require(_0xa544('0x5'));var config=require('../../config/environment');var attributes=require(_0xa544('0x6'));module[_0xa544('0x7')]=function(_0x2f5992,_0x15a604){return _0x2f5992[_0xa544('0x8')]('WhatsappApplication',attributes,{'tableName':_0xa544('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa544('0xa')});}; \ No newline at end of file +var _0xeb5d=['../../config/logger','api','moment','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x27ec84,_0x5c44b9){var _0x3cea02=function(_0x1ecb24){while(--_0x1ecb24){_0x27ec84['push'](_0x27ec84['shift']());}};_0x3cea02(++_0x5c44b9);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xeb5d[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var logger=require(_0xdeb5('0x1'))(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb5('0x4'));var rimraf=require(_0xdeb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdeb5('0x6'));module[_0xdeb5('0x7')]=function(_0x164ecb,_0x33af72){return _0x164ecb[_0xdeb5('0x8')](_0xdeb5('0x9'),attributes,{'tableName':_0xdeb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb5('0xb'),'collate':_0xdeb5('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 4c167b7..710e661 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2c18b1,_0xd84121){var _0x147339=function(_0x1ed50e){while(--_0x1ed50e){_0x2c18b1['push'](_0x2c18b1['shift']());}};_0x147339(++_0xd84121);}(_0xe14d,0x1ee));var _0xde14=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe14d[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x8ebc5a,_0x3b01c2){var _0x20d39f=function(_0x520b19){while(--_0x520b19){_0x8ebc5a['push'](_0x8ebc5a['shift']());}};_0x20d39f(++_0x3b01c2);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 62f22a0..1a4c3cf 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 _0xd101=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x397d60,_0x11b0e8){var _0x38246a=function(_0x9f13a0){while(--_0x9f13a0){_0x397d60['push'](_0x397d60['shift']());}};_0x38246a(++_0x11b0e8);}(_0xd101,0xc1));var _0x1d10=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xd101[_0x22663b];return _0x310d0a;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0x9')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x9')](_0x1d10('0x10'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x9')](_0x1d10('0x12'),auth['isAuthenticated'](),controller[_0x1d10('0x13')]);router[_0x1d10('0x14')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0x15')]);router[_0x1d10('0x14')]('/:id/messages',auth[_0x1d10('0xa')](),controller[_0x1d10('0x16')]);router[_0x1d10('0x14')](_0x1d10('0x17'),auth[_0x1d10('0xa')](),interaction[_0x1d10('0x18')]('whatsapp',_0x1d10('0x19')),controller[_0x1d10('0x1a')]);router[_0x1d10('0x1b')](_0x1d10('0xe'),auth['isAuthenticated'](),interaction[_0x1d10('0x18')](_0x1d10('0x1c'),_0x1d10('0x1d')),controller[_0x1d10('0x1e')]);router[_0x1d10('0x1f')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),interaction['tracked'](_0x1d10('0x1c'),_0x1d10('0x20')),controller[_0x1d10('0x21')]);router[_0x1d10('0x1f')](_0x1d10('0x17'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1d10('0x22')]=router; \ No newline at end of file +var _0x9505=['describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x4be178,_0x364f41){var _0x31f7b0=function(_0x28d669){while(--_0x28d669){_0x4be178['push'](_0x4be178['shift']());}};_0x31f7b0(++_0x364f41);}(_0x9505,0x1e5));var _0x5950=function(_0xa4d52,_0x507edb){_0xa4d52=_0xa4d52-0x0;var _0x2096dd=_0x9505[_0xa4d52];return _0x2096dd;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require('path');var timeout=require(_0x5950('0x2'));var express=require(_0x5950('0x3'));var router=express[_0x5950('0x4')]();var fs_extra=require(_0x5950('0x5'));var auth=require(_0x5950('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get']('/describe',auth[_0x5950('0x9')](),controller[_0x5950('0xb')]);router[_0x5950('0x8')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0xd')]);router[_0x5950('0x8')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller['getMessages']);router[_0x5950('0x8')](_0x5950('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x5950('0x10')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0x11')]);router[_0x5950('0x10')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller[_0x5950('0x12')]);router[_0x5950('0x10')](_0x5950('0x13'),auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x16')),controller[_0x5950('0x17')]);router[_0x5950('0x18')](_0x5950('0xc'),auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x19')),controller[_0x5950('0x1a')]);router['delete']('/:id',auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x1b')),controller[_0x5950('0x1c')]);router['delete']('/:id/tags',auth[_0x5950('0x9')](),controller[_0x5950('0x1d')]);module[_0x5950('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index cef1244..8088bb8 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 _0x73a1=['out','DATE','INTEGER','exports','BOOLEAN','STRING','ENUM'];(function(_0x2330cf,_0x5add9f){var _0x5e230f=function(_0x1f44f7){while(--_0x1f44f7){_0x2330cf['push'](_0x2330cf['shift']());}};_0x5e230f(++_0x5add9f);}(_0x73a1,0x161));var _0x173a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x73a1[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x173a('0x0')]={'closed':{'type':Sequelize[_0x173a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x173a('0x2')]},'secondDisposition':{'type':Sequelize[_0x173a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x173a('0x2')]},'note':{'type':Sequelize[_0x173a('0x2')]},'phone':{'type':Sequelize[_0x173a('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x173a('0x3')]('in',_0x173a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x173a('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x173a('0x3')]('in',_0x173a('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x173a('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x173a('0x6')]}}; \ No newline at end of file +var _0xd0da=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x4e1217,_0x45a98a){var _0x1ecdce=function(_0x554f04){while(--_0x554f04){_0x4e1217['push'](_0x4e1217['shift']());}};_0x1ecdce(++_0x45a98a);}(_0xd0da,0x1b1));var _0xad0d=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xd0da[_0x548627];return _0x844a84;};'use strict';var Sequelize=require(_0xad0d('0x0'));var moment=require(_0xad0d('0x1'));module[_0xad0d('0x2')]={'closed':{'type':Sequelize[_0xad0d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xad0d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xad0d('0x5')]},'thirdDisposition':{'type':Sequelize[_0xad0d('0x5')]},'note':{'type':Sequelize[_0xad0d('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xad0d('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xad0d('0x6')]('in',_0xad0d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xad0d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xad0d('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index d148905..c340b47 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 _0x9efd=['spread','color','emit','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','push','Messages','createdAt','direction','secret','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','fullname','N.A.','toString','filter','Attachment','basename','existsSync','createWriteStream','out','System','Contact','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','update','then','error','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','whatsapp','query','user','catch','show','params','filters','intersection','attributes','model','fields','length','includeAll','options','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','keys','hasOwnProperty','nolimit','limit','order','sort','pick','where','WhatsappInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','findAll','addTags','setTags'];(function(_0x4cc730,_0x4c6616){var _0x1bf5d9=function(_0xc27888){while(--_0xc27888){_0x4cc730['push'](_0x4cc730['shift']());}};_0x1bf5d9(++_0x4c6616);}(_0x9efd,0xae));var _0xd9ef=function(_0x293c1f,_0xb75e5c){_0x293c1f=_0x293c1f-0x0;var _0xea03e9=_0x9efd[_0x293c1f];return _0xea03e9;};'use strict';var rimraf=require(_0xd9ef('0x0'));var zipdir=require(_0xd9ef('0x1'));var moment=require(_0xd9ef('0x2'));var BPromise=require(_0xd9ef('0x3'));var util=require('util');var path=require(_0xd9ef('0x4'));var ejs=require(_0xd9ef('0x5'));var fs=require('fs');var _=require(_0xd9ef('0x6'));var Redis=require(_0xd9ef('0x7'));var interaction=require(_0xd9ef('0x8'));var qs=require(_0xd9ef('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0xd9ef('0xa'));var db=require(_0xd9ef('0xb'))['db'];config[_0xd9ef('0xc')]=_[_0xd9ef('0xd')](config[_0xd9ef('0xc')],{'host':_0xd9ef('0xe'),'port':0x18eb});var socket=require(_0xd9ef('0xf'))(new Redis(config[_0xd9ef('0xc')]));require(_0xd9ef('0x10'))[_0xd9ef('0x11')](socket);function respondWithStatusCode(_0x2487a1,_0x51464f){_0x51464f=_0x51464f||0xcc;return function(_0x309ede){if(_0x309ede){return _0x2487a1[_0xd9ef('0x12')](_0x51464f);}return _0x2487a1[_0xd9ef('0x13')](_0x51464f)[_0xd9ef('0x14')]();};}function respondWithResult(_0x11109e,_0x5293f3){_0x5293f3=_0x5293f3||0xc8;return function(_0x59176e){if(_0x59176e){return _0x11109e[_0xd9ef('0x13')](_0x5293f3)['json'](_0x59176e);}};}function respondWithFilteredResult(_0x131c9d,_0x36145b){return function(_0x2dfece){if(_0x2dfece){var _0x4e76bf=typeof _0x36145b[_0xd9ef('0x15')]==='undefined'&&typeof _0x36145b['limit']===_0xd9ef('0x16');var _0x2744ef=_0x2dfece[_0xd9ef('0x17')];var _0x5c7559=_0x4e76bf?0x0:_0x36145b[_0xd9ef('0x15')];var _0x161657=_0x4e76bf?_0x2dfece[_0xd9ef('0x17')]:_0x36145b['offset']+_0x36145b['limit'];var _0x163e2c;if(_0x161657>=_0x2744ef){_0x161657=_0x2744ef;_0x163e2c=0xc8;}else{_0x163e2c=0xce;}_0x131c9d[_0xd9ef('0x13')](_0x163e2c);return _0x131c9d[_0xd9ef('0x18')](_0xd9ef('0x19'),_0x5c7559+'-'+_0x161657+'/'+_0x2744ef)[_0xd9ef('0x1a')](_0x2dfece);}return null;};}function saveUpdates(_0x22dc2f){return function(_0x498799){if(_0x498799){return _0x498799[_0xd9ef('0x1b')](_0x22dc2f)[_0xd9ef('0x1c')](function(_0x521882){return _0x521882;});}return null;};}function removeEntity(_0x4a049d){return function(_0x487418){if(_0x487418){return _0x487418['destroy']()[_0xd9ef('0x1c')](function(){_0x4a049d[_0xd9ef('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d8d5a){return function(_0x2733d1){if(!_0x2733d1){_0x3d8d5a[_0xd9ef('0x12')](0x194);}return _0x2733d1;};}function handleError(_0x57d643,_0x12af06){_0x12af06=_0x12af06||0x1f4;return function(_0x374988){logger[_0xd9ef('0x1d')](_0x374988['stack']);if(_0x374988[_0xd9ef('0x1e')]){delete _0x374988[_0xd9ef('0x1e')];}_0x57d643[_0xd9ef('0x13')](_0x12af06)[_0xd9ef('0x1f')](_0x374988);};}exports[_0xd9ef('0x20')]=function(_0x31db28,_0x3d7c63){var _0x48a34e={};var _0x4406c9=_[_0xd9ef('0x21')](db[_0xd9ef('0x22')][_0xd9ef('0x23')],function(_0x56e66e){return{'name':_0x56e66e[_0xd9ef('0x24')],'type':_0x56e66e[_0xd9ef('0x25')]['key']};});_0x48a34e=qs[_0xd9ef('0x26')](_0x4406c9,_0x31db28);return interaction['findAll'](_0xd9ef('0x27'),_0x31db28[_0xd9ef('0x28')],_0x31db28[_0xd9ef('0x29')],_0x48a34e,_0x4406c9)[_0xd9ef('0x1c')](respondWithFilteredResult(_0x3d7c63,_0x48a34e))[_0xd9ef('0x2a')](handleError(_0x3d7c63,null));};exports[_0xd9ef('0x2b')]=function(_0x3a619b,_0x1563bc){var _0x108599={'raw':![],'where':{'id':_0x3a619b[_0xd9ef('0x2c')]['id']}},_0x11ef2e={};_0x11ef2e['model']=_['keys'](db[_0xd9ef('0x22')][_0xd9ef('0x23')]);_0x11ef2e[_0xd9ef('0x28')]=_['keys'](_0x3a619b[_0xd9ef('0x28')]);_0x11ef2e[_0xd9ef('0x2d')]=_[_0xd9ef('0x2e')](_0x11ef2e['model'],_0x11ef2e['query']);_0x108599[_0xd9ef('0x2f')]=_['intersection'](_0x11ef2e[_0xd9ef('0x30')],qs[_0xd9ef('0x31')](_0x3a619b['query'][_0xd9ef('0x31')]));_0x108599[_0xd9ef('0x2f')]=_0x108599[_0xd9ef('0x2f')][_0xd9ef('0x32')]?_0x108599['attributes']:_0x11ef2e[_0xd9ef('0x30')];if(_0x3a619b[_0xd9ef('0x28')][_0xd9ef('0x33')]){_0x108599['include']=[{'all':!![]}];}_0x108599=_['merge']({},_0x108599,_0x3a619b[_0xd9ef('0x34')]);return db[_0xd9ef('0x22')][_0xd9ef('0x35')](_0x108599)[_0xd9ef('0x1c')](handleEntityNotFound(_0x1563bc,null))[_0xd9ef('0x1c')](respondWithResult(_0x1563bc,null))[_0xd9ef('0x2a')](handleError(_0x1563bc,null));};exports[_0xd9ef('0x36')]=function(_0x1c5fc3,_0x5ae20d){return db[_0xd9ef('0x22')]['create'](_0x1c5fc3[_0xd9ef('0x37')],{})[_0xd9ef('0x1c')](respondWithResult(_0x5ae20d,0xc9))['catch'](handleError(_0x5ae20d,null));};exports[_0xd9ef('0x1b')]=function(_0x2c39d4,_0x5b4971){if(_0x2c39d4[_0xd9ef('0x37')]['id']){delete _0x2c39d4[_0xd9ef('0x37')]['id'];}return db[_0xd9ef('0x22')][_0xd9ef('0x35')]({'where':{'id':_0x2c39d4[_0xd9ef('0x2c')]['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x5b4971,null))[_0xd9ef('0x1c')](saveUpdates(_0x2c39d4[_0xd9ef('0x37')],null))['then'](respondWithResult(_0x5b4971,null))[_0xd9ef('0x2a')](handleError(_0x5b4971,null));};exports[_0xd9ef('0x38')]=function(_0x39b0c6,_0x42ffd6){return db[_0xd9ef('0x22')][_0xd9ef('0x35')]({'where':{'id':_0x39b0c6[_0xd9ef('0x2c')]['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x42ffd6,null))[_0xd9ef('0x1c')](removeEntity(_0x42ffd6,null))[_0xd9ef('0x2a')](handleError(_0x42ffd6,null));};exports[_0xd9ef('0x39')]=function(_0x39d998,_0x55c37c){return db[_0xd9ef('0x22')][_0xd9ef('0x39')]()[_0xd9ef('0x1c')](respondWithResult(_0x55c37c,null))[_0xd9ef('0x2a')](handleError(_0x55c37c,null));};exports[_0xd9ef('0x3a')]=function(_0x263866,_0x344cf4){return db[_0xd9ef('0x3b')][_0xd9ef('0x35')]({'where':{'id':_0x263866[_0xd9ef('0x2c')]['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x344cf4,null))['then'](function(_0x36b4ca){if(_0x36b4ca){return _0x36b4ca[_0xd9ef('0x3a')](_0x263866[_0xd9ef('0x37')][_0xd9ef('0x3c')],_[_0xd9ef('0x3d')](_0x263866[_0xd9ef('0x37')],[_0xd9ef('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x344cf4,null))[_0xd9ef('0x2a')](handleError(_0x344cf4,null));};exports[_0xd9ef('0x3e')]=function(_0x488298,_0x1c1cde){var _0x467ce8={'raw':![],'where':{}};var _0x5875e7={};var _0x504f79={'count':0x0,'rows':[]};return db[_0xd9ef('0x22')]['findOne']({'where':{'id':_0x488298['params']['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x1c1cde,null))[_0xd9ef('0x1c')](function(_0x12faae){if(_0x12faae){_0x5875e7[_0xd9ef('0x30')]=_[_0xd9ef('0x3f')](db['WhatsappMessage'][_0xd9ef('0x23')]);_0x5875e7[_0xd9ef('0x28')]=_['keys'](_0x488298[_0xd9ef('0x28')]);_0x5875e7['filters']=_[_0xd9ef('0x2e')](_0x5875e7['model'],_0x5875e7[_0xd9ef('0x28')]);_0x467ce8[_0xd9ef('0x2f')]=_[_0xd9ef('0x2e')](_0x5875e7['model'],qs[_0xd9ef('0x31')](_0x488298[_0xd9ef('0x28')]['fields']));_0x467ce8['attributes']=_0x467ce8['attributes'][_0xd9ef('0x32')]?_0x467ce8[_0xd9ef('0x2f')]:_0x5875e7[_0xd9ef('0x30')];if(!_0x488298[_0xd9ef('0x28')][_0xd9ef('0x40')](_0xd9ef('0x41'))){_0x467ce8[_0xd9ef('0x42')]=qs[_0xd9ef('0x42')](_0x488298[_0xd9ef('0x28')][_0xd9ef('0x42')]);_0x467ce8[_0xd9ef('0x15')]=qs['offset'](_0x488298[_0xd9ef('0x28')][_0xd9ef('0x15')]);}_0x467ce8[_0xd9ef('0x43')]=qs[_0xd9ef('0x44')](_0x488298[_0xd9ef('0x28')][_0xd9ef('0x44')]);_0x467ce8['where']=qs[_0xd9ef('0x2d')](_[_0xd9ef('0x45')](_0x488298[_0xd9ef('0x28')],_0x5875e7[_0xd9ef('0x2d')]));_0x467ce8[_0xd9ef('0x46')][_0xd9ef('0x47')]=_0x12faae['id'];if(_0x488298[_0xd9ef('0x28')]['filter']){_0x467ce8[_0xd9ef('0x46')]=_['merge'](_0x467ce8['where'],{'$or':_[_0xd9ef('0x21')](_0x467ce8[_0xd9ef('0x2f')],function(_0x48dac9){var _0x4fcd57={};_0x4fcd57[_0x48dac9]={'$like':'%'+_0x488298[_0xd9ef('0x28')]['filter']+'%'};return _0x4fcd57;})});}if(_0x488298['query']['$gte']){var _0x5d6945=_0x488298['query'][_0xd9ef('0x48')][_0xd9ef('0x49')](',');var _0x39317c={};_0x39317c[_0x5d6945[0x0]]={'$gte':moment(_0x5d6945[0x1])[_0xd9ef('0x4a')](_0xd9ef('0x4b'))};_0x467ce8[_0xd9ef('0x46')]=_[_0xd9ef('0x4c')](_0x467ce8[_0xd9ef('0x46')],_0x39317c);}_0x467ce8=_[_0xd9ef('0x4c')]({},_0x467ce8,_0x488298[_0xd9ef('0x34')]);return db[_0xd9ef('0x3b')]['count']({'where':_0x467ce8[_0xd9ef('0x46')]})[_0xd9ef('0x1c')](function(_0x5e611f){_0x504f79[_0xd9ef('0x17')]=_0x5e611f;if(_0x488298[_0xd9ef('0x28')][_0xd9ef('0x33')]){_0x467ce8['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xd9ef('0x4d')](_0x467ce8);})[_0xd9ef('0x1c')](function(_0x572442){_0x504f79['rows']=_0x572442;return _0x504f79;});}})[_0xd9ef('0x1c')](respondWithFilteredResult(_0x1c1cde,_0x467ce8))[_0xd9ef('0x2a')](handleError(_0x1c1cde,null));};exports[_0xd9ef('0x4e')]=function(_0x43942a,_0x194552){return db[_0xd9ef('0x22')]['find']({'where':{'id':_0x43942a[_0xd9ef('0x2c')]['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x194552,null))['then'](function(_0x46f8ac){if(_0x46f8ac){return _0x46f8ac[_0xd9ef('0x4f')](_0x43942a[_0xd9ef('0x37')]['ids'],_[_0xd9ef('0x3d')](_0x43942a[_0xd9ef('0x37')],[_0xd9ef('0x3c'),'id'])||{})[_0xd9ef('0x50')](function(){return db['Tag'][_0xd9ef('0x4d')]({'attributes':['id',_0xd9ef('0x1e'),_0xd9ef('0x51')],'where':{'id':_0x43942a[_0xd9ef('0x37')]['ids']}});})[_0xd9ef('0x1c')](function(_0x21aa8d){socket[_0xd9ef('0x52')]('whatsappInteractionTags:save',{'id':Number(_0x43942a[_0xd9ef('0x2c')]['id']),'tags':_0x21aa8d||[]});return{'id':Number(_0x43942a[_0xd9ef('0x2c')]['id']),'tags':_0x21aa8d||[]};});}})['then'](respondWithResult(_0x194552,null))[_0xd9ef('0x2a')](handleError(_0x194552,null));};exports['removeTags']=function(_0x2539e4,_0x1ae0f2){return db[_0xd9ef('0x22')][_0xd9ef('0x35')]({'where':{'id':_0x2539e4[_0xd9ef('0x2c')]['id']}})[_0xd9ef('0x1c')](handleEntityNotFound(_0x1ae0f2,null))[_0xd9ef('0x1c')](function(_0x120fd2){if(_0x120fd2){return _0x120fd2[_0xd9ef('0x53')](_0x2539e4['query'][_0xd9ef('0x3c')]);}})[_0xd9ef('0x1c')](respondWithStatusCode(_0x1ae0f2,null))[_0xd9ef('0x2a')](handleError(_0x1ae0f2,null));};exports[_0xd9ef('0x54')]=function(_0xc1399f,_0x142e95){var _0x1464c4=moment()[_0xd9ef('0x55')]()['toString']();var _0x2685b8=path[_0xd9ef('0x56')](config[_0xd9ef('0x57')],'server',_0xd9ef('0x58'),'tmp');var _0x5e5450=path[_0xd9ef('0x56')](config['root'],_0xd9ef('0x59'),_0xd9ef('0x58'),_0xd9ef('0x5a'));var _0x15d9b4=path[_0xd9ef('0x56')](_0x2685b8,_0x1464c4);var _0x1ab6d8=util[_0xd9ef('0x4a')](_0xd9ef('0x5b'),_0xc1399f[_0xd9ef('0x2c')]['id'],_0x1464c4);var _0x385806=path[_0xd9ef('0x56')](_0x2685b8,_0x1ab6d8);var _0x50266e=[];_0x50266e['push']({'model':db[_0xd9ef('0x5c')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x50266e['push']({'model':db[_0xd9ef('0x5d')],'as':'Contact','attributes':['id',_0xd9ef('0x5e'),_0xd9ef('0x5f')],'raw':!![]});if(_0xc1399f[_0xd9ef('0x28')]['attachments']){_0x50266e[_0xd9ef('0x60')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x596a0b=[{'model':db[_0xd9ef('0x3b')],'as':_0xd9ef('0x61'),'attributes':['id','body',_0xd9ef('0x62'),_0xd9ef('0x63'),_0xd9ef('0x64'),'read'],'include':_0x50266e}];_0x596a0b[_0xd9ef('0x60')]({'model':db[_0xd9ef('0x65')],'as':'Account','attributes':['id',_0xd9ef('0x1e')]});_0x596a0b['push']({'model':db[_0xd9ef('0x5c')],'as':'Owner','attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0xc1399f[_0xd9ef('0x2c')]['id']},'include':_0x596a0b})['then'](handleEntityNotFound(_0x142e95,null))[_0xd9ef('0x1c')](function(_0x54e32b){if(_0x54e32b){var _0x2344a9=_0x54e32b[_0xd9ef('0x66')]({'plain':!![]});fs[_0xd9ef('0x67')](_0x15d9b4);var _0x2e5cdc={'channel':_0xd9ef('0x68'),'account':_0x2344a9[_0xd9ef('0x69')][_0xd9ef('0x1e')],'agent':_0x2344a9['Owner']?_0x2344a9[_0xd9ef('0x6a')][_0xd9ef('0x6b')]:_0xd9ef('0x6c'),'createdAt':moment(_0x2344a9[_0xd9ef('0x62')])[_0xd9ef('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ef('0x6d')](),'closedAt':_0x2344a9['closed']?moment(_0x2344a9['closedAt'])['format'](_0xd9ef('0x4b'))['toString']():'','disposition':_0x2344a9['disposition'],'messages':_(_0x2344a9[_0xd9ef('0x61')])[_0xd9ef('0x6e')]({'secret':![]})[_0xd9ef('0x21')](function(_0x38f091){if(_0x38f091[_0xd9ef('0x6f')]){var _0x5c6a0b=path['join'](_0x5e5450,_0x38f091[_0xd9ef('0x6f')][_0xd9ef('0x70')]);if(fs[_0xd9ef('0x71')](_0x5c6a0b)){fs['createReadStream'](_0x5c6a0b)['pipe'](fs[_0xd9ef('0x72')](path['join'](_0x15d9b4,_0x38f091['Attachment']['basename'])));}}return{'date':moment(_0x38f091[_0xd9ef('0x62')])[_0xd9ef('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x38f091[_0xd9ef('0x63')]===_0xd9ef('0x73')?_0x38f091[_0xd9ef('0x5c')]?_0x38f091[_0xd9ef('0x5c')]['fullname']:_0xd9ef('0x74'):_0x38f091[_0xd9ef('0x75')][_0xd9ef('0x5e')]+(_0x38f091['Contact'][_0xd9ef('0x5f')]?'\x20'+_0x38f091[_0xd9ef('0x75')][_0xd9ef('0x5f')]:''),'body':_0x38f091[_0xd9ef('0x6f')]?_0x38f091[_0xd9ef('0x6f')]['basename']:_0x38f091[_0xd9ef('0x37')],'direction':_0x38f091[_0xd9ef('0x63')]===_0xd9ef('0x73')?'A':'C','secret':_0x38f091[_0xd9ef('0x64')],'read':_0x38f091[_0xd9ef('0x76')],'attachment':_0x38f091[_0xd9ef('0x6f')]};})[_0xd9ef('0x77')]()};return ejs[_0xd9ef('0x78')](path[_0xd9ef('0x56')](config[_0xd9ef('0x57')],_0xd9ef('0x59'),_0xd9ef('0x79'),_0xd9ef('0x7a')),{'interaction':_0x2e5cdc})[_0xd9ef('0x1c')](function(_0x474f90){var _0x57580b=path[_0xd9ef('0x56')](_0x15d9b4,_0xd9ef('0x7b')+_0x2344a9['id']+'-'+_0x1464c4+_0xd9ef('0x7c'));var _0x32b6f2={'path':_0x57580b,'channel':'Whatsapp','interactionId':_0x2344a9['id']};return pdf['createPdfFromHTML'](_0x474f90,_0x32b6f2);})[_0xd9ef('0x1c')](function(){return new BPromise(function(_0x5bb2c,_0x10b2eb){zipdir(_0x15d9b4,{'saveTo':_0x385806},function(_0xdcae1d,_0xbcecd7){if(_0xdcae1d)return _0x10b2eb(_0xdcae1d);return _0x5bb2c(_0xbcecd7);});})['then'](function(){return new BPromise(function(_0x1f6fa0,_0x43d0b2){rimraf(_0x15d9b4,function(_0x569bbf){if(_0x569bbf)_0x43d0b2(_0x569bbf);return _0x1f6fa0();});});})[_0xd9ef('0x1c')](function(){return _0x142e95[_0xd9ef('0x54')](_0x385806,_0x1ab6d8,function(_0x1471b9){if(_0x1471b9){console[_0xd9ef('0x7d')](_0xd9ef('0x7e'),_0x1471b9);}else{fs['unlinkSync'](_0x385806);}});});});}else{return _0x142e95[_0xd9ef('0x12')](0xc8);}})['catch'](handleError(_0x142e95,null));}; \ No newline at end of file +var _0x4444=['User','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','direction','out','value','renderFile','views','.pdf','download','log','err','unlinkSync','rimraf','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','findAll','whatsapp','then','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','Contact','lastName','push','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account'];(function(_0xb1285f,_0x243cea){var _0x125a12=function(_0x32a76b){while(--_0x32a76b){_0xb1285f['push'](_0xb1285f['shift']());}};_0x125a12(++_0x243cea);}(_0x4444,0x17e));var _0x4444=function(_0xe8fa1f,_0x12bba1){_0xe8fa1f=_0xe8fa1f-0x0;var _0x4b3a65=_0x4444[_0xe8fa1f];return _0x4b3a65;};'use strict';var rimraf=require(_0x4444('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x4444('0x1'));var path=require(_0x4444('0x2'));var ejs=require(_0x4444('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4444('0x4'));var interaction=require(_0x4444('0x5'));var qs=require(_0x4444('0x6'));var pdf=require(_0x4444('0x7'));var logger=require(_0x4444('0x8'))('api');var config=require(_0x4444('0x9'));var db=require('../../mysqldb')['db'];config[_0x4444('0xa')]=_['defaults'](config[_0x4444('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4444('0xa')]));require('./whatsappInteraction.socket')[_0x4444('0xb')](socket);function respondWithStatusCode(_0x2b9a77,_0x11c668){_0x11c668=_0x11c668||0xcc;return function(_0x5c5e5a){if(_0x5c5e5a){return _0x2b9a77[_0x4444('0xc')](_0x11c668);}return _0x2b9a77[_0x4444('0xd')](_0x11c668)[_0x4444('0xe')]();};}function respondWithResult(_0x37f69c,_0x4f8d18){_0x4f8d18=_0x4f8d18||0xc8;return function(_0x29b342){if(_0x29b342){return _0x37f69c['status'](_0x4f8d18)[_0x4444('0xf')](_0x29b342);}};}function respondWithFilteredResult(_0x178a72,_0x41acf7){return function(_0xa04a68){if(_0xa04a68){var _0x5b25d7=typeof _0x41acf7['offset']===_0x4444('0x10')&&typeof _0x41acf7[_0x4444('0x11')]==='undefined';var _0x52b82c=_0xa04a68[_0x4444('0x12')];var _0x113fb5=_0x5b25d7?0x0:_0x41acf7[_0x4444('0x13')];var _0x168525=_0x5b25d7?_0xa04a68['count']:_0x41acf7[_0x4444('0x13')]+_0x41acf7[_0x4444('0x11')];var _0x5cda30;if(_0x168525>=_0x52b82c){_0x168525=_0x52b82c;_0x5cda30=0xc8;}else{_0x5cda30=0xce;}_0x178a72['status'](_0x5cda30);return _0x178a72[_0x4444('0x14')](_0x4444('0x15'),_0x113fb5+'-'+_0x168525+'/'+_0x52b82c)['json'](_0xa04a68);}return null;};}function saveUpdates(_0x597a44){return function(_0x3a8ecd){if(_0x3a8ecd){return _0x3a8ecd[_0x4444('0x16')](_0x597a44)['then'](function(_0x3de324){return _0x3de324;});}return null;};}function removeEntity(_0x490e3d){return function(_0x7b1c62){if(_0x7b1c62){return _0x7b1c62[_0x4444('0x17')]()['then'](function(){_0x490e3d['status'](0xcc)[_0x4444('0xe')]();});}};}function handleEntityNotFound(_0x4b263f){return function(_0x4a6ad0){if(!_0x4a6ad0){_0x4b263f['sendStatus'](0x194);}return _0x4a6ad0;};}function handleError(_0x315aac,_0x40489a){_0x40489a=_0x40489a||0x1f4;return function(_0x8ccc03){logger['error'](_0x8ccc03[_0x4444('0x18')]);if(_0x8ccc03[_0x4444('0x19')]){delete _0x8ccc03[_0x4444('0x19')];}_0x315aac[_0x4444('0xd')](_0x40489a)[_0x4444('0x1a')](_0x8ccc03);};}exports['index']=function(_0x53d4cd,_0x474532){var _0x264a81={};var _0x36afba=_[_0x4444('0x1b')](db[_0x4444('0x1c')][_0x4444('0x1d')],function(_0x3c6263){return{'name':_0x3c6263[_0x4444('0x1e')],'type':_0x3c6263[_0x4444('0x1f')]['key']};});_0x264a81=qs['getOptions'](_0x36afba,_0x53d4cd);return interaction[_0x4444('0x20')](_0x4444('0x21'),_0x53d4cd['query'],_0x53d4cd['user'],_0x264a81,_0x36afba)[_0x4444('0x22')](respondWithFilteredResult(_0x474532,_0x264a81))[_0x4444('0x23')](handleError(_0x474532,null));};exports[_0x4444('0x24')]=function(_0x2ccc84,_0x2b189f){var _0x2bb1f6={'raw':![],'where':{'id':_0x2ccc84[_0x4444('0x25')]['id']}},_0x188723={};_0x188723[_0x4444('0x26')]=_[_0x4444('0x27')](db[_0x4444('0x1c')][_0x4444('0x1d')]);_0x188723[_0x4444('0x28')]=_[_0x4444('0x27')](_0x2ccc84[_0x4444('0x28')]);_0x188723[_0x4444('0x29')]=_[_0x4444('0x2a')](_0x188723[_0x4444('0x26')],_0x188723[_0x4444('0x28')]);_0x2bb1f6[_0x4444('0x2b')]=_[_0x4444('0x2a')](_0x188723[_0x4444('0x26')],qs[_0x4444('0x2c')](_0x2ccc84[_0x4444('0x28')][_0x4444('0x2c')]));_0x2bb1f6[_0x4444('0x2b')]=_0x2bb1f6[_0x4444('0x2b')][_0x4444('0x2d')]?_0x2bb1f6[_0x4444('0x2b')]:_0x188723['model'];if(_0x2ccc84['query'][_0x4444('0x2e')]){_0x2bb1f6[_0x4444('0x2f')]=[{'all':!![]}];}_0x2bb1f6=_[_0x4444('0x30')]({},_0x2bb1f6,_0x2ccc84[_0x4444('0x31')]);return db[_0x4444('0x1c')]['find'](_0x2bb1f6)[_0x4444('0x22')](handleEntityNotFound(_0x2b189f,null))[_0x4444('0x22')](respondWithResult(_0x2b189f,null))['catch'](handleError(_0x2b189f,null));};exports['create']=function(_0x252941,_0x664d51){return db[_0x4444('0x1c')][_0x4444('0x32')](_0x252941[_0x4444('0x33')],{})[_0x4444('0x22')](respondWithResult(_0x664d51,0xc9))[_0x4444('0x23')](handleError(_0x664d51,null));};exports[_0x4444('0x16')]=function(_0x5d562b,_0x476c18){if(_0x5d562b['body']['id']){delete _0x5d562b[_0x4444('0x33')]['id'];}return db[_0x4444('0x1c')]['find']({'where':{'id':_0x5d562b['params']['id']}})[_0x4444('0x22')](handleEntityNotFound(_0x476c18,null))['then'](saveUpdates(_0x5d562b[_0x4444('0x33')],null))[_0x4444('0x22')](respondWithResult(_0x476c18,null))[_0x4444('0x23')](handleError(_0x476c18,null));};exports['destroy']=function(_0x137dfe,_0xb38fec){return db[_0x4444('0x1c')][_0x4444('0x34')]({'where':{'id':_0x137dfe[_0x4444('0x25')]['id']}})[_0x4444('0x22')](handleEntityNotFound(_0xb38fec,null))[_0x4444('0x22')](removeEntity(_0xb38fec,null))[_0x4444('0x23')](handleError(_0xb38fec,null));};exports[_0x4444('0x35')]=function(_0x1c21a2,_0x231745){return db[_0x4444('0x1c')]['describe']()[_0x4444('0x22')](respondWithResult(_0x231745,null))[_0x4444('0x23')](handleError(_0x231745,null));};exports[_0x4444('0x36')]=function(_0x19211d,_0xbb5a3e){return db[_0x4444('0x37')][_0x4444('0x34')]({'where':{'id':_0x19211d['params']['id']}})[_0x4444('0x22')](handleEntityNotFound(_0xbb5a3e,null))[_0x4444('0x22')](function(_0x9030d2){if(_0x9030d2){return _0x9030d2[_0x4444('0x36')](_0x19211d[_0x4444('0x33')]['ids'],_[_0x4444('0x38')](_0x19211d['body'],[_0x4444('0x39'),'id'])||{});}})['then'](respondWithResult(_0xbb5a3e,null))[_0x4444('0x23')](handleError(_0xbb5a3e,null));};exports[_0x4444('0x3a')]=function(_0xf99b36,_0x4c06ac){var _0x5324ab={'raw':![],'where':{}};var _0x127628={};var _0x59c0b1={'count':0x0,'rows':[]};return db[_0x4444('0x1c')][_0x4444('0x3b')]({'where':{'id':_0xf99b36[_0x4444('0x25')]['id']}})[_0x4444('0x22')](handleEntityNotFound(_0x4c06ac,null))[_0x4444('0x22')](function(_0x49ff6a){if(_0x49ff6a){_0x127628[_0x4444('0x26')]=_[_0x4444('0x27')](db[_0x4444('0x37')][_0x4444('0x1d')]);_0x127628[_0x4444('0x28')]=_['keys'](_0xf99b36['query']);_0x127628[_0x4444('0x29')]=_[_0x4444('0x2a')](_0x127628[_0x4444('0x26')],_0x127628[_0x4444('0x28')]);_0x5324ab[_0x4444('0x2b')]=_[_0x4444('0x2a')](_0x127628[_0x4444('0x26')],qs['fields'](_0xf99b36[_0x4444('0x28')][_0x4444('0x2c')]));_0x5324ab[_0x4444('0x2b')]=_0x5324ab['attributes'][_0x4444('0x2d')]?_0x5324ab[_0x4444('0x2b')]:_0x127628['model'];if(!_0xf99b36['query'][_0x4444('0x3c')](_0x4444('0x3d'))){_0x5324ab[_0x4444('0x11')]=qs[_0x4444('0x11')](_0xf99b36[_0x4444('0x28')][_0x4444('0x11')]);_0x5324ab[_0x4444('0x13')]=qs['offset'](_0xf99b36['query'][_0x4444('0x13')]);}_0x5324ab[_0x4444('0x3e')]=qs[_0x4444('0x3f')](_0xf99b36['query']['sort']);_0x5324ab['where']=qs[_0x4444('0x29')](_['pick'](_0xf99b36[_0x4444('0x28')],_0x127628[_0x4444('0x29')]));_0x5324ab[_0x4444('0x40')][_0x4444('0x41')]=_0x49ff6a['id'];if(_0xf99b36['query']['filter']){_0x5324ab[_0x4444('0x40')]=_[_0x4444('0x30')](_0x5324ab[_0x4444('0x40')],{'$or':_['map'](_0x5324ab['attributes'],function(_0xf4643){var _0x4a4fc3={};_0x4a4fc3[_0xf4643]={'$like':'%'+_0xf99b36['query'][_0x4444('0x42')]+'%'};return _0x4a4fc3;})});}if(_0xf99b36['query'][_0x4444('0x43')]){var _0x20414d=_0xf99b36[_0x4444('0x28')][_0x4444('0x43')][_0x4444('0x44')](',');var _0x4caf21={};_0x4caf21[_0x20414d[0x0]]={'$gte':moment(_0x20414d[0x1])[_0x4444('0x45')](_0x4444('0x46'))};_0x5324ab[_0x4444('0x40')]=_[_0x4444('0x30')](_0x5324ab[_0x4444('0x40')],_0x4caf21);}_0x5324ab=_[_0x4444('0x30')]({},_0x5324ab,_0xf99b36['options']);return db['WhatsappMessage']['count']({'where':_0x5324ab[_0x4444('0x40')]})[_0x4444('0x22')](function(_0x56dff5){_0x59c0b1[_0x4444('0x12')]=_0x56dff5;if(_0xf99b36['query'][_0x4444('0x2e')]){_0x5324ab[_0x4444('0x2f')]=[{'all':!![]}];}return db[_0x4444('0x37')][_0x4444('0x20')](_0x5324ab);})[_0x4444('0x22')](function(_0x17d75d){_0x59c0b1[_0x4444('0x47')]=_0x17d75d;return _0x59c0b1;});}})[_0x4444('0x22')](respondWithFilteredResult(_0x4c06ac,_0x5324ab))[_0x4444('0x23')](handleError(_0x4c06ac,null));};exports[_0x4444('0x48')]=function(_0x37c5af,_0x1b4585){return db['WhatsappInteraction'][_0x4444('0x34')]({'where':{'id':_0x37c5af[_0x4444('0x25')]['id']}})[_0x4444('0x22')](handleEntityNotFound(_0x1b4585,null))[_0x4444('0x22')](function(_0x11f613){if(_0x11f613){return _0x11f613[_0x4444('0x49')](_0x37c5af[_0x4444('0x33')]['ids'],_[_0x4444('0x38')](_0x37c5af['body'],[_0x4444('0x39'),'id'])||{})['spread'](function(){return db[_0x4444('0x4a')]['findAll']({'attributes':['id',_0x4444('0x19'),_0x4444('0x4b')],'where':{'id':_0x37c5af['body'][_0x4444('0x39')]}});})[_0x4444('0x22')](function(_0x2f0669){socket[_0x4444('0x4c')](_0x4444('0x4d'),{'id':Number(_0x37c5af[_0x4444('0x25')]['id']),'tags':_0x2f0669||[]});return{'id':Number(_0x37c5af['params']['id']),'tags':_0x2f0669||[]};});}})[_0x4444('0x22')](respondWithResult(_0x1b4585,null))[_0x4444('0x23')](handleError(_0x1b4585,null));};exports[_0x4444('0x4e')]=function(_0x2b42ed,_0x36404d){return db[_0x4444('0x1c')][_0x4444('0x34')]({'where':{'id':_0x2b42ed['params']['id']}})[_0x4444('0x22')](handleEntityNotFound(_0x36404d,null))['then'](function(_0x20c12c){if(_0x20c12c){return _0x20c12c[_0x4444('0x4e')](_0x2b42ed['query'][_0x4444('0x39')]);}})[_0x4444('0x22')](respondWithStatusCode(_0x36404d,null))[_0x4444('0x23')](handleError(_0x36404d,null));};exports['download']=function(_0x8951ab,_0x5a4ee6){var _0xde1cf9=moment()['unix']()[_0x4444('0x4f')]();var _0x1b8029=path[_0x4444('0x50')](config[_0x4444('0x51')],_0x4444('0x52'),_0x4444('0x53'),_0x4444('0x54'));var _0x2e3065=path[_0x4444('0x50')](config[_0x4444('0x51')],'server','files',_0x4444('0x55'));var _0x28f979=path[_0x4444('0x50')](_0x1b8029,_0xde1cf9);var _0x54574d=util[_0x4444('0x45')](_0x4444('0x56'),_0x8951ab[_0x4444('0x25')]['id'],_0xde1cf9);var _0x236806=path[_0x4444('0x50')](_0x1b8029,_0x54574d);var _0x4516b0=[];_0x4516b0['push']({'model':db['User'],'as':'User','attributes':['id',_0x4444('0x57')],'raw':!![]});_0x4516b0['push']({'model':db['CmContact'],'as':_0x4444('0x58'),'attributes':['id','firstName',_0x4444('0x59')],'raw':!![]});if(_0x8951ab[_0x4444('0x28')][_0x4444('0x55')]){_0x4516b0[_0x4444('0x5a')]({'model':db['Attachment'],'as':_0x4444('0x5b'),'raw':!![]});}var _0x5461d5=[{'model':db[_0x4444('0x37')],'as':_0x4444('0x5c'),'attributes':['id',_0x4444('0x33'),_0x4444('0x5d'),'direction',_0x4444('0x5e'),_0x4444('0x5f')],'include':_0x4516b0}];_0x5461d5['push']({'model':db[_0x4444('0x60')],'as':_0x4444('0x61'),'attributes':['id','name']});_0x5461d5[_0x4444('0x5a')]({'model':db[_0x4444('0x62')],'as':_0x4444('0x63'),'attributes':['id',_0x4444('0x57')]});return db[_0x4444('0x1c')][_0x4444('0x34')]({'where':{'id':_0x8951ab[_0x4444('0x25')]['id']},'include':_0x5461d5})[_0x4444('0x22')](handleEntityNotFound(_0x5a4ee6,null))['then'](function(_0xafd98c){if(_0xafd98c){var _0x1a8596=_0xafd98c[_0x4444('0x64')]({'plain':!![]});fs[_0x4444('0x65')](_0x28f979);var _0x4bc37e={'channel':'Whatsapp','account':_0x1a8596[_0x4444('0x61')]['name'],'agent':_0x1a8596[_0x4444('0x63')]?_0x1a8596[_0x4444('0x63')][_0x4444('0x57')]:_0x4444('0x66'),'createdAt':moment(_0x1a8596[_0x4444('0x5d')])['format'](_0x4444('0x46'))[_0x4444('0x4f')](),'closedAt':_0x1a8596[_0x4444('0x67')]?moment(_0x1a8596[_0x4444('0x68')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4444('0x4f')]():'','disposition':_0x1a8596[_0x4444('0x69')],'messages':_(_0x1a8596[_0x4444('0x5c')])['filter']({'secret':![]})[_0x4444('0x1b')](function(_0x53f8cd){if(_0x53f8cd[_0x4444('0x5b')]){var _0x262494=path[_0x4444('0x50')](_0x2e3065,_0x53f8cd[_0x4444('0x5b')][_0x4444('0x6a')]);if(fs[_0x4444('0x6b')](_0x262494)){fs['createReadStream'](_0x262494)[_0x4444('0x6c')](fs[_0x4444('0x6d')](path['join'](_0x28f979,_0x53f8cd[_0x4444('0x5b')][_0x4444('0x6a')])));}}return{'date':moment(_0x53f8cd[_0x4444('0x5d')])['format'](_0x4444('0x46'))[_0x4444('0x4f')](),'sender':_0x53f8cd[_0x4444('0x6e')]===_0x4444('0x6f')?_0x53f8cd[_0x4444('0x62')]?_0x53f8cd[_0x4444('0x62')][_0x4444('0x57')]:'System':_0x53f8cd['Contact']['firstName']+(_0x53f8cd[_0x4444('0x58')]['lastName']?'\x20'+_0x53f8cd[_0x4444('0x58')][_0x4444('0x59')]:''),'body':_0x53f8cd[_0x4444('0x5b')]?_0x53f8cd[_0x4444('0x5b')][_0x4444('0x6a')]:_0x53f8cd['body'],'direction':_0x53f8cd[_0x4444('0x6e')]===_0x4444('0x6f')?'A':'C','secret':_0x53f8cd[_0x4444('0x5e')],'read':_0x53f8cd[_0x4444('0x5f')],'attachment':_0x53f8cd[_0x4444('0x5b')]};})[_0x4444('0x70')]()};return ejs[_0x4444('0x71')](path[_0x4444('0x50')](config[_0x4444('0x51')],'server',_0x4444('0x72'),'downloadInteraction.ejs'),{'interaction':_0x4bc37e})[_0x4444('0x22')](function(_0x96664c){var _0x288897=path['join'](_0x28f979,'transcript-'+_0x1a8596['id']+'-'+_0xde1cf9+_0x4444('0x73'));var _0x9eb1bf={'path':_0x288897,'channel':'Whatsapp','interactionId':_0x1a8596['id']};return pdf['createPdfFromHTML'](_0x96664c,_0x9eb1bf);})[_0x4444('0x22')](function(){return new BPromise(function(_0x175795,_0x40d261){zipdir(_0x28f979,{'saveTo':_0x236806},function(_0x5e21ea,_0x623b97){if(_0x5e21ea)return _0x40d261(_0x5e21ea);return _0x175795(_0x623b97);});})['then'](function(){return new BPromise(function(_0xc881ea,_0x79371d){rimraf(_0x28f979,function(_0xd209d0){if(_0xd209d0)_0x79371d(_0xd209d0);return _0xc881ea();});});})[_0x4444('0x22')](function(){return _0x5a4ee6[_0x4444('0x74')](_0x236806,_0x54574d,function(_0x4facad){if(_0x4facad){console[_0x4444('0x75')](_0x4444('0x76'),_0x4facad);}else{fs[_0x4444('0x77')](_0x236806);}});});});}else{return _0x5a4ee6['sendStatus'](0xc8);}})['catch'](handleError(_0x5a4ee6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 1e20a39..9834ec0 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 _0x4e34=['setDataValue','Users','map','length','emit','hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','save','remove','getUsers','then'];(function(_0x400c8d,_0x3be0c7){var _0x46914e=function(_0x125054){while(--_0x125054){_0x400c8d['push'](_0x400c8d['shift']());}};_0x46914e(++_0x3be0c7);}(_0x4e34,0x19e));var _0x44e3=function(_0x59af83,_0x676065){_0x59af83=_0x59af83-0x0;var _0x422123=_0x4e34[_0x59af83];return _0x422123;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x44e3('0x0')];var WhatsappMessage=require(_0x44e3('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x44e3('0x2'),'afterUpdate':'update','afterDestroy':_0x44e3('0x3')};function emitEvent(_0x36cbe3){return function(_0xa14d1e,_0x5a0287,_0x50805a){_0xa14d1e[_0x44e3('0x4')]({'attributes':['id'],'raw':!![]})[_0x44e3('0x5')](function(_0x163879){_0xa14d1e[_0x44e3('0x6')](_0x44e3('0x7'),_0x163879[_0x44e3('0x8')](function(_0x1a296b){return{'id':_0x1a296b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xa14d1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x44e3('0x5')](function(_0xc041c6){_0xa14d1e['setDataValue']('unreadMessages',_0xc041c6[_0x44e3('0x9')]);WhatsappInteractionEvents[_0x44e3('0xa')](_0x36cbe3+':'+_0xa14d1e['id'],_0xa14d1e);WhatsappInteractionEvents['emit'](_0x36cbe3,_0xa14d1e);_0x50805a(null);})['catch'](_0x50805a(null));};}for(var e in events){if(events[_0x44e3('0xb')](e)){var event=events[e];WhatsappInteraction[_0x44e3('0xc')](e,emitEvent(event));}}module[_0x44e3('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xbf83=['../../mysqldb','WhatsappMessage','setMaxListeners','save','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','WhatsappInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf83,0x11e));var _0x3bf8=function(_0x1fabf2,_0x335418){_0x1fabf2=_0x1fabf2-0x0;var _0x3acb8f=_0xbf83[_0x1fabf2];return _0x3acb8f;};'use strict';var EventEmitter=require(_0x3bf8('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x3bf8('0x1')];var WhatsappMessage=require(_0x3bf8('0x2'))['db'][_0x3bf8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3bf8('0x4')](0x0);var events={'afterCreate':_0x3bf8('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x459aef){return function(_0x2f9c37,_0x18a698,_0x251445){_0x2f9c37['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x168a20){_0x2f9c37[_0x3bf8('0x6')]('Users',_0x168a20[_0x3bf8('0x7')](function(_0x538bec){return{'id':_0x538bec['id']};}));return WhatsappMessage[_0x3bf8('0x8')]({'where':{'WhatsappInteractionId':_0x2f9c37['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3bf8('0x9')](function(_0x1e36df){_0x2f9c37[_0x3bf8('0x6')](_0x3bf8('0xa'),_0x1e36df[_0x3bf8('0xb')]);WhatsappInteractionEvents[_0x3bf8('0xc')](_0x459aef+':'+_0x2f9c37['id'],_0x2f9c37);WhatsappInteractionEvents['emit'](_0x459aef,_0x2f9c37);_0x251445(null);})[_0x3bf8('0xd')](_0x251445(null));};}for(var e in events){if(events[_0x3bf8('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x3bf8('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 170b094..158fd47 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 _0xe295=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x19a4ac,_0x5d763d){var _0x8f3876=function(_0x26047d){while(--_0x26047d){_0x19a4ac['push'](_0x19a4ac['shift']());}};_0x8f3876(++_0x5d763d);}(_0xe295,0x143));var _0x5e29=function(_0x4cd685,_0x472697){_0x4cd685=_0x4cd685-0x0;var _0x37743e=_0xe295[_0x4cd685];return _0x37743e;};'use strict';var _=require('lodash');var util=require(_0x5e29('0x0'));var logger=require(_0x5e29('0x1'))(_0x5e29('0x2'));var moment=require(_0x5e29('0x3'));var BPromise=require(_0x5e29('0x4'));var rp=require(_0x5e29('0x5'));var fs=require('fs');var path=require(_0x5e29('0x6'));var rimraf=require('rimraf');var config=require(_0x5e29('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x5e29('0x8')]=function(_0x5751a0,_0x3567ca){return _0x5751a0[_0x5e29('0x9')](_0x5e29('0xa'),attributes,{'tableName':_0x5e29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38f2c4,_0xd3d39b,_0x17e2d1){if(_0x38f2c4[_0x5e29('0xc')](_0x5e29('0xd'))){_0x38f2c4[_0x5e29('0xe')]=moment()[_0x5e29('0xf')](_0x5e29('0x10'));}_0x17e2d1(null,_0x38f2c4);}}});}; \ No newline at end of file +var _0x4105=['request-promise','path','./whatsappInteraction.attributes','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird'];(function(_0xc75d2f,_0x183b3b){var _0x65af36=function(_0x219d13){while(--_0x219d13){_0xc75d2f['push'](_0xc75d2f['shift']());}};_0x65af36(++_0x183b3b);}(_0x4105,0xda));var _0x5410=function(_0x7213b4,_0x391106){_0x7213b4=_0x7213b4-0x0;var _0x54dc97=_0x4105[_0x7213b4];return _0x54dc97;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5410('0x0'))(_0x5410('0x1'));var moment=require('moment');var BPromise=require(_0x5410('0x2'));var rp=require(_0x5410('0x3'));var fs=require('fs');var path=require(_0x5410('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5410('0x5'));module['exports']=function(_0xc3b333,_0x386d52){return _0xc3b333[_0x5410('0x6')]('WhatsappInteraction',attributes,{'tableName':_0x5410('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x411541,_0x125489,_0x1402af){if(_0x411541[_0x5410('0x8')](_0x5410('0x9'))){_0x411541[_0x5410('0xa')]=moment()[_0x5410('0xb')](_0x5410('0xc'));}_0x1402af(null,_0x411541);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d97a6cf..6ddff27 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 _0x0587=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','limit','AddTagsToWhatsappInteraction','addTags','body','ids','omit','AddTags','stringify','lodash','util','randomstring','ioredis'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x0587,0x13c));var _0x7058=function(_0x5887f2,_0x23a73c){_0x5887f2=_0x5887f2-0x0;var _0x489c62=_0x0587[_0x5887f2];return _0x489c62;};'use strict';var _=require(_0x7058('0x0'));var util=require(_0x7058('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7058('0x2'));var fs=require('fs');var Redis=require(_0x7058('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7058('0x4'));var logger=require(_0x7058('0x5'))(_0x7058('0x6'));var config=require(_0x7058('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7058('0x8')][_0x7058('0x9')]({'port':0x232a});config[_0x7058('0xa')]=_[_0x7058('0xb')](config['redis'],{'host':_0x7058('0xc'),'port':0x18eb});var socket=require(_0x7058('0xd'))(new Redis(config['redis']));require(_0x7058('0xe'))[_0x7058('0xf')](socket);function respondWithRpcPromise(_0x301c90,_0x550177,_0x4f923b){return new BPromise(function(_0x13120e,_0x56ef14){return client[_0x7058('0x10')](_0x301c90,_0x4f923b)[_0x7058('0x11')](function(_0x24498b){logger[_0x7058('0x12')](_0x7058('0x13'),_0x550177,_0x7058('0x14'));logger[_0x7058('0x15')](_0x7058('0x16'),_0x550177,_0x7058('0x14'),JSON['stringify'](_0x24498b));if(_0x24498b['error']){if(_0x24498b[_0x7058('0x17')]['code']===0x1f4){logger['error'](_0x7058('0x13'),_0x550177,_0x24498b[_0x7058('0x17')][_0x7058('0x18')]);return _0x56ef14(_0x24498b['error']['message']);}logger[_0x7058('0x17')](_0x7058('0x13'),_0x550177,_0x24498b[_0x7058('0x17')]['message']);return _0x13120e(_0x24498b[_0x7058('0x17')][_0x7058('0x18')]);}else{logger[_0x7058('0x12')](_0x7058('0x13'),_0x550177,_0x7058('0x14'));_0x13120e(_0x24498b[_0x7058('0x19')][_0x7058('0x18')]);}})[_0x7058('0x1a')](function(_0x2b4483){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x550177,_0x2b4483);_0x56ef14(_0x2b4483);});});}exports[_0x7058('0x1b')]=function(_0x2a8784){var _0x560a0b=this;return new Promise(function(_0x14cd8d,_0x13d7f6){return db[_0x7058('0x1c')]['update'](_0x2a8784['body'],{'raw':_0x2a8784[_0x7058('0x1d')]?_0x2a8784[_0x7058('0x1d')][_0x7058('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a8784[_0x7058('0x1d')]?_0x2a8784[_0x7058('0x1d')][_0x7058('0x1f')]||null:null,'attributes':_0x2a8784[_0x7058('0x1d')]?_0x2a8784[_0x7058('0x1d')]['attributes']||null:null,'limit':_0x2a8784['options']?_0x2a8784['options'][_0x7058('0x20')]||null:null})[_0x7058('0x11')](function(_0x2a1f4a){logger[_0x7058('0x12')](_0x7058('0x1b'),_0x2a8784);logger[_0x7058('0x15')]('UpdateWhatsappInteraction',_0x2a8784,JSON['stringify'](_0x2a1f4a));_0x14cd8d(_0x2a1f4a);})[_0x7058('0x1a')](function(_0x4f64ee){logger['error'](_0x7058('0x1b'),_0x4f64ee[_0x7058('0x18')],_0x2a8784);_0x13d7f6(_0x560a0b[_0x7058('0x17')](0x1f4,_0x4f64ee[_0x7058('0x18')]));});});};exports[_0x7058('0x21')]=function(_0x1c8104){return new Promise(function(_0x4249e8,_0x4dbad8){return db[_0x7058('0x1c')]['find']({'where':_0x1c8104[_0x7058('0x1d')]?_0x1c8104[_0x7058('0x1d')][_0x7058('0x1f')]||null:null})[_0x7058('0x11')](function(_0xc144b8){if(_0xc144b8){return _0xc144b8[_0x7058('0x22')](_0x1c8104[_0x7058('0x23')][_0x7058('0x24')],_[_0x7058('0x25')](_0x1c8104[_0x7058('0x23')],[_0x7058('0x24'),'id'])||{});}})['spread'](function(_0x445ac0){logger['info'](_0x7058('0x26'),_0x1c8104);logger['debug'](_0x7058('0x26'),_0x1c8104,JSON[_0x7058('0x27')](_0x445ac0));_0x4249e8(_0x445ac0);})[_0x7058('0x1a')](function(_0x523f11){logger[_0x7058('0x17')](_0x7058('0x26'),_0x523f11[_0x7058('0x18')],_0x1c8104);_0x4dbad8(_this[_0x7058('0x17')](0x1f4,_0x523f11[_0x7058('0x18')]));});});}; \ No newline at end of file +var _0x0d03=['WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','limit','AddTagsToWhatsappInteraction','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x1dce05,_0x3d43f7){var _0x3dabb1=function(_0x415a5b){while(--_0x415a5b){_0x1dce05['push'](_0x1dce05['shift']());}};_0x3dabb1(++_0x3d43f7);}(_0x0d03,0x1c8));var _0x30d0=function(_0x17e546,_0x5b000b){_0x17e546=_0x17e546-0x0;var _0x5ec43c=_0x0d03[_0x17e546];return _0x5ec43c;};'use strict';var _=require(_0x30d0('0x0'));var util=require(_0x30d0('0x1'));var moment=require(_0x30d0('0x2'));var BPromise=require(_0x30d0('0x3'));var rs=require(_0x30d0('0x4'));var fs=require('fs');var Redis=require(_0x30d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x30d0('0x6'))(_0x30d0('0x7'));var config=require(_0x30d0('0x8'));var jayson=require(_0x30d0('0x9'));var client=jayson['client'][_0x30d0('0xa')]({'port':0x232a});config[_0x30d0('0xb')]=_[_0x30d0('0xc')](config['redis'],{'host':_0x30d0('0xd'),'port':0x18eb});var socket=require(_0x30d0('0xe'))(new Redis(config[_0x30d0('0xb')]));require(_0x30d0('0xf'))[_0x30d0('0x10')](socket);function respondWithRpcPromise(_0x1d3dfd,_0x5de6ca,_0x503b78){return new BPromise(function(_0xfebf84,_0x2d81c7){return client[_0x30d0('0x11')](_0x1d3dfd,_0x503b78)[_0x30d0('0x12')](function(_0x49da0c){logger[_0x30d0('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x5de6ca,'request\x20sent');logger[_0x30d0('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5de6ca,_0x30d0('0x15'),JSON[_0x30d0('0x16')](_0x49da0c));if(_0x49da0c[_0x30d0('0x17')]){if(_0x49da0c[_0x30d0('0x17')]['code']===0x1f4){logger[_0x30d0('0x17')](_0x30d0('0x18'),_0x5de6ca,_0x49da0c['error'][_0x30d0('0x19')]);return _0x2d81c7(_0x49da0c[_0x30d0('0x17')]['message']);}logger[_0x30d0('0x17')](_0x30d0('0x18'),_0x5de6ca,_0x49da0c[_0x30d0('0x17')][_0x30d0('0x19')]);return _0xfebf84(_0x49da0c[_0x30d0('0x17')][_0x30d0('0x19')]);}else{logger[_0x30d0('0x13')](_0x30d0('0x18'),_0x5de6ca,'request\x20sent');_0xfebf84(_0x49da0c['result']['message']);}})[_0x30d0('0x1a')](function(_0x458a66){logger[_0x30d0('0x17')](_0x30d0('0x18'),_0x5de6ca,_0x458a66);_0x2d81c7(_0x458a66);});});}exports[_0x30d0('0x1b')]=function(_0x53bd6a){var _0x387bb9=this;return new Promise(function(_0x1df62d,_0x4ad146){return db[_0x30d0('0x1c')]['update'](_0x53bd6a[_0x30d0('0x1d')],{'raw':_0x53bd6a[_0x30d0('0x1e')]?_0x53bd6a[_0x30d0('0x1e')][_0x30d0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53bd6a[_0x30d0('0x1e')]?_0x53bd6a[_0x30d0('0x1e')]['where']||null:null,'attributes':_0x53bd6a['options']?_0x53bd6a['options']['attributes']||null:null,'limit':_0x53bd6a[_0x30d0('0x1e')]?_0x53bd6a[_0x30d0('0x1e')][_0x30d0('0x20')]||null:null})[_0x30d0('0x12')](function(_0x51df4f){logger[_0x30d0('0x13')](_0x30d0('0x1b'),_0x53bd6a);logger[_0x30d0('0x14')](_0x30d0('0x1b'),_0x53bd6a,JSON[_0x30d0('0x16')](_0x51df4f));_0x1df62d(_0x51df4f);})[_0x30d0('0x1a')](function(_0x16f44d){logger[_0x30d0('0x17')]('UpdateWhatsappInteraction',_0x16f44d[_0x30d0('0x19')],_0x53bd6a);_0x4ad146(_0x387bb9['error'](0x1f4,_0x16f44d['message']));});});};exports[_0x30d0('0x21')]=function(_0x405b2a){return new Promise(function(_0x1f0885,_0x57c4ff){return db['WhatsappInteraction']['find']({'where':_0x405b2a[_0x30d0('0x1e')]?_0x405b2a['options'][_0x30d0('0x22')]||null:null})['then'](function(_0x1b939a){if(_0x1b939a){return _0x1b939a[_0x30d0('0x23')](_0x405b2a['body'][_0x30d0('0x24')],_[_0x30d0('0x25')](_0x405b2a[_0x30d0('0x1d')],[_0x30d0('0x24'),'id'])||{});}})[_0x30d0('0x26')](function(_0x163824){logger[_0x30d0('0x13')](_0x30d0('0x27'),_0x405b2a);logger[_0x30d0('0x14')]('AddTags',_0x405b2a,JSON[_0x30d0('0x16')](_0x163824));_0x1f0885(_0x163824);})['catch'](function(_0xf88653){logger[_0x30d0('0x17')]('AddTags',_0xf88653['message'],_0x405b2a);_0x57c4ff(_this[_0x30d0('0x17')](0x1f4,_0xf88653[_0x30d0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3940b97..76b15e5 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 _0x5abe=['update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x19855e,_0x182536){var _0x333853=function(_0x6f2865){while(--_0x6f2865){_0x19855e['push'](_0x19855e['shift']());}};_0x333853(++_0x182536);}(_0x5abe,0x1e0));var _0xe5ab=function(_0x6e68a2,_0xd8d3b1){_0x6e68a2=_0x6e68a2-0x0;var _0x37cf8c=_0x5abe[_0x6e68a2];return _0x37cf8c;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0xe5ab('0x0')];function createListener(_0x449e6e,_0x36ee93){return function(_0x3f2c24){_0x36ee93[_0xe5ab('0x1')](_0x449e6e,_0x3f2c24);};}function removeListener(_0xdc95db,_0x3121e6){return function(){WhatsappInteractionEvents[_0xe5ab('0x2')](_0xdc95db,_0x3121e6);};}exports[_0xe5ab('0x3')]=function(_0x5c2e1f){for(var _0x22bd3a=0x0,_0x3929a8=events[_0xe5ab('0x4')];_0x22bd3a<_0x3929a8;_0x22bd3a++){var _0x47c602=events[_0x22bd3a];var _0x256cfc=createListener(_0xe5ab('0x5')+_0x47c602,_0x5c2e1f);WhatsappInteractionEvents['on'](_0x47c602,_0x256cfc);}}; \ No newline at end of file +var _0xdcd3=['length','whatsappInteraction:','./whatsappInteraction.events','save','update','removeListener','register'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xdcd3,0xa3));var _0x3dcd=function(_0xc073d4,_0x1ecb13){_0xc073d4=_0xc073d4-0x0;var _0x24850a=_0xdcd3[_0xc073d4];return _0x24850a;};'use strict';var WhatsappInteractionEvents=require(_0x3dcd('0x0'));var events=[_0x3dcd('0x1'),'remove',_0x3dcd('0x2')];function createListener(_0x261f6e,_0x28a9d8){return function(_0x5de46d){_0x28a9d8['emit'](_0x261f6e,_0x5de46d);};}function removeListener(_0x476ec2,_0x696f9d){return function(){WhatsappInteractionEvents[_0x3dcd('0x3')](_0x476ec2,_0x696f9d);};}exports[_0x3dcd('0x4')]=function(_0x36b623){for(var _0x35a1e8=0x0,_0x3aee8e=events[_0x3dcd('0x5')];_0x35a1e8<_0x3aee8e;_0x35a1e8++){var _0x25a6ca=events[_0x35a1e8];var _0x2ca700=createListener(_0x3dcd('0x6')+_0x25a6ca,_0x36b623);WhatsappInteractionEvents['on'](_0x25a6ca,_0x2ca700);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 378557a..6a619ee 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 _0x3009=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','show','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer'];(function(_0x4bd430,_0x4a4ffc){var _0x906922=function(_0x1b270d){while(--_0x1b270d){_0x4bd430['push'](_0x4bd430['shift']());}};_0x906922(++_0x4a4ffc);}(_0x3009,0x1a3));var _0x9300=function(_0x38ad1d,_0xcc227b){_0x38ad1d=_0x38ad1d-0x0;var _0x440595=_0x3009[_0x38ad1d];return _0x440595;};'use strict';var multer=require(_0x9300('0x0'));var util=require(_0x9300('0x1'));var path=require(_0x9300('0x2'));var timeout=require(_0x9300('0x3'));var express=require(_0x9300('0x4'));var router=express[_0x9300('0x5')]();var fs_extra=require(_0x9300('0x6'));var auth=require(_0x9300('0x7'));var interaction=require(_0x9300('0x8'));var config=require('../../config/environment');var controller=require(_0x9300('0x9'));router['get']('/',auth[_0x9300('0xa')](),controller[_0x9300('0xb')]);router[_0x9300('0xc')](_0x9300('0xd'),auth['isAuthenticated'](),controller[_0x9300('0xe')]);router[_0x9300('0xc')]('/:id',auth[_0x9300('0xa')](),controller[_0x9300('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x9300('0x10')](_0x9300('0x11'),_0x9300('0x12')),controller[_0x9300('0x13')]);router['post']('/:id/status',controller[_0x9300('0x14')]);router[_0x9300('0x15')](_0x9300('0x16'),auth[_0x9300('0xa')](),controller[_0x9300('0x17')]);router[_0x9300('0x15')](_0x9300('0x18'),auth['isAuthenticated'](),controller[_0x9300('0x19')]);router[_0x9300('0x15')](_0x9300('0x1a'),auth[_0x9300('0xa')](),controller['reject']);router[_0x9300('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x9300('0x1c')]);module[_0x9300('0x1d')]=router; \ No newline at end of file +var _0x6518=['./whatsappMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x573815,_0x1428a7){var _0x5ec4d2=function(_0x1f99e4){while(--_0x1f99e4){_0x573815['push'](_0x573815['shift']());}};_0x5ec4d2(++_0x1428a7);}(_0x6518,0x154));var _0x8651=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x6518[_0x2c0dc0];return _0x4c0990;};'use strict';var multer=require(_0x8651('0x0'));var util=require(_0x8651('0x1'));var path=require(_0x8651('0x2'));var timeout=require('connect-timeout');var express=require(_0x8651('0x3'));var router=express[_0x8651('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8651('0x5'));var interaction=require(_0x8651('0x6'));var config=require(_0x8651('0x7'));var controller=require(_0x8651('0x8'));router['get']('/',auth[_0x8651('0x9')](),controller[_0x8651('0xa')]);router['get'](_0x8651('0xb'),auth[_0x8651('0x9')](),controller[_0x8651('0xc')]);router[_0x8651('0xd')](_0x8651('0xe'),auth['isAuthenticated'](),controller[_0x8651('0xf')]);router[_0x8651('0x10')]('/',auth['isAuthenticated'](),interaction[_0x8651('0x11')](_0x8651('0x12'),_0x8651('0x13')),controller[_0x8651('0x14')]);router[_0x8651('0x10')]('/:id/status',controller[_0x8651('0x15')]);router[_0x8651('0x16')](_0x8651('0xe'),auth[_0x8651('0x9')](),controller[_0x8651('0x17')]);router[_0x8651('0x16')](_0x8651('0x18'),auth[_0x8651('0x9')](),controller[_0x8651('0x19')]);router[_0x8651('0x16')](_0x8651('0x1a'),auth[_0x8651('0x9')](),controller[_0x8651('0x1b')]);router[_0x8651('0x1c')](_0x8651('0xe'),auth[_0x8651('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 71d33ea..b86f18f 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 _0x4ca7=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x158e62,_0x4c437e){var _0x216d31=function(_0x144fe8){while(--_0x144fe8){_0x158e62['push'](_0x158e62['shift']());}};_0x216d31(++_0x4c437e);}(_0x4ca7,0x165));var _0x74ca=function(_0x593013,_0x5fa42f){_0x593013=_0x593013-0x0;var _0x4cf032=_0x4ca7[_0x593013];return _0x4cf032;};'use strict';var Sequelize=require(_0x74ca('0x0'));module[_0x74ca('0x1')]={'body':{'type':Sequelize[_0x74ca('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x74ca('0x4')]('in',_0x74ca('0x5')),'defaultValue':_0x74ca('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x74ca('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x74ca('0x6')]},'providerResponse':{'type':Sequelize[_0x74ca('0x2')]}}; \ No newline at end of file +var _0x951c=['BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT','medium'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x951c,0x13d));var _0xc951=function(_0x5eb12d,_0x1ce90f){_0x5eb12d=_0x5eb12d-0x0;var _0x295852=_0x951c[_0x5eb12d];return _0x295852;};'use strict';var Sequelize=require('sequelize');module[_0xc951('0x0')]={'body':{'type':Sequelize[_0xc951('0x1')](_0xc951('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc951('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc951('0x4')]('in','out'),'defaultValue':_0xc951('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc951('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc951('0x6')]},'readAt':{'type':Sequelize[_0xc951('0x7')]},'secret':{'type':Sequelize[_0xc951('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc951('0x6')]},'providerResponse':{'type':Sequelize[_0xc951('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 8695ee6..abf2cc5 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 _0x06c1=['whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','interface','motionChannel','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','map','query','filters','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','intersection','include','create','body','find','describe','../../config/logger','whatsapp-interactions','accept','read','readAt','UserId','user','get','WhatsappInteraction','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','SIP/%s','channel','event','EventManager'];(function(_0x59915,_0x1991f7){var _0x4762d7=function(_0x2f8903){while(--_0x2f8903){_0x59915['push'](_0x59915['shift']());}};_0x4762d7(++_0x1991f7);}(_0x06c1,0x122));var _0x106c=function(_0x4bf943,_0x507c27){_0x4bf943=_0x4bf943-0x0;var _0x458bab=_0x06c1[_0x4bf943];return _0x458bab;};'use strict';var emlformat=require(_0x106c('0x0'));var rimraf=require(_0x106c('0x1'));var zipdir=require(_0x106c('0x2'));var jsonpatch=require(_0x106c('0x3'));var rp=require(_0x106c('0x4'));var moment=require(_0x106c('0x5'));var BPromise=require(_0x106c('0x6'));var Mustache=require('mustache');var util=require(_0x106c('0x7'));var path=require(_0x106c('0x8'));var sox=require('sox');var csv=require(_0x106c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x106c('0xa'));var _=require(_0x106c('0xb'));var squel=require('squel');var crypto=require(_0x106c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x106c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x106c('0xe'));var Papa=require(_0x106c('0xf'));var Redis=require('ioredis');var authService=require(_0x106c('0x10'));var qs=require(_0x106c('0x11'));var as=require(_0x106c('0x12'));var hardwareService=require(_0x106c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x106c('0x14'));var config=require(_0x106c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x106c('0x16'))['db'];config['redis']=_[_0x106c('0x17')](config[_0x106c('0x18')],{'host':_0x106c('0x19'),'port':0x18eb});var socket=require(_0x106c('0x1a'))(new Redis(config['redis']));require(_0x106c('0x1b'))[_0x106c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x106c('0x1d')][_0x106c('0x1e')]({'port':0x232c});var client9002=jayson[_0x106c('0x1d')][_0x106c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x35040e,_0x150a5f,_0x1e716c,_0x29c552){return new BPromise(function(_0x153fb5,_0x2826d5){var _0x597fb6=_0x29c552||client;return _0x597fb6[_0x106c('0x1f')](_0x35040e,_0x1e716c)[_0x106c('0x20')](function(_0x3af19c){logger[_0x106c('0x21')](_0x106c('0x22'),_0x150a5f,_0x106c('0x23'));logger[_0x106c('0x24')](_0x106c('0x25'),_0x150a5f,_0x106c('0x23'),JSON['stringify'](_0x3af19c));if(_0x3af19c['error']){if(_0x3af19c[_0x106c('0x26')][_0x106c('0x27')]===0x1f4){logger['error'](_0x106c('0x22'),_0x150a5f,_0x3af19c['error']['message']);return _0x2826d5(_0x3af19c[_0x106c('0x26')][_0x106c('0x28')]);}logger[_0x106c('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x150a5f,_0x3af19c[_0x106c('0x26')][_0x106c('0x28')]);return _0x153fb5(_0x3af19c[_0x106c('0x26')][_0x106c('0x28')]);}else{logger[_0x106c('0x21')](_0x106c('0x22'),_0x150a5f,'request\x20sent');_0x153fb5(_0x3af19c['result'][_0x106c('0x28')]);}})['catch'](function(_0x5111ea){logger[_0x106c('0x26')](_0x106c('0x22'),_0x150a5f,_0x5111ea);_0x2826d5(_0x5111ea);});});}function respondWithStatusCode(_0x3a9f2b,_0x3eaaf4){_0x3eaaf4=_0x3eaaf4||0xcc;return function(_0x3e4783){if(_0x3e4783){return _0x3a9f2b[_0x106c('0x29')](_0x3eaaf4);}return _0x3a9f2b[_0x106c('0x2a')](_0x3eaaf4)['end']();};}function respondWithResult(_0x24c13d,_0x6dd1e){_0x6dd1e=_0x6dd1e||0xc8;return function(_0x366ee6){if(_0x366ee6){return _0x24c13d[_0x106c('0x2a')](_0x6dd1e)[_0x106c('0x2b')](_0x366ee6);}};}function respondWithFilteredResult(_0x4f7f3e,_0x12f9a1){return function(_0x3a6610){if(_0x3a6610){var _0x383620=typeof _0x12f9a1[_0x106c('0x2c')]===_0x106c('0x2d')&&typeof _0x12f9a1['limit']===_0x106c('0x2d');var _0x4ecc3a=_0x3a6610[_0x106c('0x2e')];var _0x5399c5=_0x383620?0x0:_0x12f9a1[_0x106c('0x2c')];var _0x278fc3=_0x383620?_0x3a6610[_0x106c('0x2e')]:_0x12f9a1[_0x106c('0x2c')]+_0x12f9a1[_0x106c('0x2f')];var _0x38aca4;if(_0x278fc3>=_0x4ecc3a){_0x278fc3=_0x4ecc3a;_0x38aca4=0xc8;}else{_0x38aca4=0xce;}_0x4f7f3e[_0x106c('0x2a')](_0x38aca4);return _0x4f7f3e[_0x106c('0x30')](_0x106c('0x31'),_0x5399c5+'-'+_0x278fc3+'/'+_0x4ecc3a)['json'](_0x3a6610);}return null;};}function patchUpdates(_0x3e87d6){return function(_0x32b372){try{jsonpatch[_0x106c('0x32')](_0x32b372,_0x3e87d6,!![]);}catch(_0x4b4839){return BPromise[_0x106c('0x33')](_0x4b4839);}return _0x32b372['save']();};}function saveUpdates(_0x38f99a,_0x46cfa8){return function(_0x1081af){if(_0x1081af){return _0x1081af[_0x106c('0x34')](_0x38f99a)[_0x106c('0x20')](function(_0x1df9af){return _0x1df9af;});}return null;};}function removeEntity(_0x4bcdd0,_0x162132){return function(_0x305508){if(_0x305508){return _0x305508[_0x106c('0x35')]()['then'](function(){_0x4bcdd0[_0x106c('0x2a')](0xcc)[_0x106c('0x36')]();});}};}function handleEntityNotFound(_0x571b65,_0x3b28ad){return function(_0x26e419){if(!_0x26e419){_0x571b65[_0x106c('0x29')](0x194);}return _0x26e419;};}function handleError(_0x24907a,_0x2383a1){_0x2383a1=_0x2383a1||0x1f4;return function(_0x52a667){logger['error'](_0x52a667[_0x106c('0x37')]);if(_0x52a667[_0x106c('0x38')]){delete _0x52a667[_0x106c('0x38')];}_0x24907a[_0x106c('0x2a')](_0x2383a1)[_0x106c('0x39')](_0x52a667);};}exports[_0x106c('0x3a')]=function(_0x1d4c33,_0x4d4781){var _0x16fd05={},_0x5d259f={},_0x1fdbeb={'count':0x0,'rows':[]};var _0x4acfd9=_['map'](db[_0x106c('0x3b')][_0x106c('0x3c')],function(_0x491621){return{'name':_0x491621[_0x106c('0x3d')],'type':_0x491621['type'][_0x106c('0x3e')]};});_0x5d259f['model']=_[_0x106c('0x3f')](_0x4acfd9,_0x106c('0x38'));_0x5d259f[_0x106c('0x40')]=_['keys'](_0x1d4c33[_0x106c('0x40')]);_0x5d259f[_0x106c('0x41')]=_['intersection'](_0x5d259f['model'],_0x5d259f[_0x106c('0x40')]);_0x16fd05['attributes']=_['intersection'](_0x5d259f['model'],qs[_0x106c('0x42')](_0x1d4c33['query']['fields']));_0x16fd05['attributes']=_0x16fd05[_0x106c('0x43')]['length']?_0x16fd05['attributes']:_0x5d259f[_0x106c('0x44')];if(!_0x1d4c33[_0x106c('0x40')][_0x106c('0x45')](_0x106c('0x46'))){_0x16fd05[_0x106c('0x2f')]=qs[_0x106c('0x2f')](_0x1d4c33[_0x106c('0x40')]['limit']);_0x16fd05[_0x106c('0x2c')]=qs[_0x106c('0x2c')](_0x1d4c33['query'][_0x106c('0x2c')]);}_0x16fd05[_0x106c('0x47')]=qs[_0x106c('0x48')](_0x1d4c33[_0x106c('0x40')][_0x106c('0x48')]);_0x16fd05[_0x106c('0x49')]=qs[_0x106c('0x41')](_[_0x106c('0x4a')](_0x1d4c33[_0x106c('0x40')],_0x5d259f['filters']),_0x4acfd9);if(_0x1d4c33[_0x106c('0x40')][_0x106c('0x4b')]){_0x16fd05[_0x106c('0x49')]=_[_0x106c('0x4c')](_0x16fd05[_0x106c('0x49')],{'$or':_[_0x106c('0x3f')](_0x4acfd9,function(_0x411956){if(_0x411956[_0x106c('0x4d')]!==_0x106c('0x4e')){var _0x1f3049={};_0x1f3049[_0x411956[_0x106c('0x38')]]={'$like':'%'+_0x1d4c33[_0x106c('0x40')]['filter']+'%'};return _0x1f3049;}})});}_0x16fd05=_[_0x106c('0x4c')]({},_0x16fd05,_0x1d4c33[_0x106c('0x4f')]);var _0x27102e={'where':_0x16fd05['where']};return db['WhatsappMessage'][_0x106c('0x2e')](_0x27102e)['then'](function(_0x55c39f){_0x1fdbeb[_0x106c('0x2e')]=_0x55c39f;if(_0x1d4c33[_0x106c('0x40')]['includeAll']){_0x16fd05['include']=[{'all':!![]}];}return db[_0x106c('0x3b')][_0x106c('0x50')](_0x16fd05);})[_0x106c('0x20')](function(_0x3040e4){_0x1fdbeb[_0x106c('0x51')]=_0x3040e4;return _0x1fdbeb;})['then'](respondWithFilteredResult(_0x4d4781,_0x16fd05))[_0x106c('0x52')](handleError(_0x4d4781,null));};exports[_0x106c('0x53')]=function(_0x56208f,_0x3a6dce){var _0x378fc4={'raw':!![],'where':{'id':_0x56208f[_0x106c('0x54')]['id']}},_0x31cb2c={};_0x31cb2c[_0x106c('0x44')]=_[_0x106c('0x55')](db[_0x106c('0x3b')][_0x106c('0x3c')]);_0x31cb2c[_0x106c('0x40')]=_['keys'](_0x56208f[_0x106c('0x40')]);_0x31cb2c['filters']=_['intersection'](_0x31cb2c[_0x106c('0x44')],_0x31cb2c[_0x106c('0x40')]);_0x378fc4[_0x106c('0x43')]=_[_0x106c('0x56')](_0x31cb2c[_0x106c('0x44')],qs[_0x106c('0x42')](_0x56208f[_0x106c('0x40')]['fields']));_0x378fc4[_0x106c('0x43')]=_0x378fc4[_0x106c('0x43')]['length']?_0x378fc4[_0x106c('0x43')]:_0x31cb2c['model'];if(_0x56208f[_0x106c('0x40')]['includeAll']){_0x378fc4[_0x106c('0x57')]=[{'all':!![]}];}_0x378fc4=_[_0x106c('0x4c')]({},_0x378fc4,_0x56208f['options']);return db[_0x106c('0x3b')]['find'](_0x378fc4)[_0x106c('0x20')](handleEntityNotFound(_0x3a6dce,null))[_0x106c('0x20')](respondWithResult(_0x3a6dce,null))['catch'](handleError(_0x3a6dce,null));};exports[_0x106c('0x58')]=function(_0x53e5bc,_0x3f7a38){return db[_0x106c('0x3b')][_0x106c('0x58')](_0x53e5bc[_0x106c('0x59')],{})['then'](respondWithResult(_0x3f7a38,0xc9))['catch'](handleError(_0x3f7a38,null));};exports[_0x106c('0x34')]=function(_0x3c0b29,_0x2e4ec9){if(_0x3c0b29[_0x106c('0x59')]['id']){delete _0x3c0b29[_0x106c('0x59')]['id'];}return db[_0x106c('0x3b')][_0x106c('0x5a')]({'where':{'id':_0x3c0b29[_0x106c('0x54')]['id']}})[_0x106c('0x20')](handleEntityNotFound(_0x2e4ec9,null))[_0x106c('0x20')](saveUpdates(_0x3c0b29['body'],null))[_0x106c('0x20')](respondWithResult(_0x2e4ec9,null))[_0x106c('0x52')](handleError(_0x2e4ec9,null));};exports[_0x106c('0x35')]=function(_0x263748,_0x54e49e){return db[_0x106c('0x3b')]['find']({'where':{'id':_0x263748[_0x106c('0x54')]['id']}})[_0x106c('0x20')](handleEntityNotFound(_0x54e49e,null))['then'](removeEntity(_0x54e49e,null))[_0x106c('0x52')](handleError(_0x54e49e,null));};exports[_0x106c('0x5b')]=function(_0x5c6e3b,_0x18bb6b){return db[_0x106c('0x3b')][_0x106c('0x5b')]()[_0x106c('0x20')](respondWithResult(_0x18bb6b,null))['catch'](handleError(_0x18bb6b,null));};var interaction_log=require(_0x106c('0x5c'))(_0x106c('0x5d'));exports[_0x106c('0x5e')]=function(_0x481492,_0x3aae62,_0x426e72){var _0xd3ef17={'agent':{},'channel':'whatsapp'};if(_0x481492['body']['id']){delete _0x481492['body']['id'];}_0x481492[_0x106c('0x59')][_0x106c('0x5f')]=!![];_0x481492[_0x106c('0x59')][_0x106c('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x481492[_0x106c('0x59')][_0x106c('0x61')]=_0x481492[_0x106c('0x59')][_0x106c('0x61')]||_0x481492[_0x106c('0x62')]['id'];_0xd3ef17['agent']['id']=_0x481492[_0x106c('0x59')][_0x106c('0x61')];return db['WhatsappMessage'][_0x106c('0x5a')]({'where':{'id':_0x481492[_0x106c('0x54')]['id'],'UserId':null}})[_0x106c('0x20')](handleEntityNotFound(_0x3aae62,null))[_0x106c('0x20')](saveUpdates(_0x481492[_0x106c('0x59')],null))[_0x106c('0x20')](function(_0x190a5d){if(_0x190a5d){_0xd3ef17[_0x106c('0x28')]=_0x190a5d[_0x106c('0x63')]({'plain':!![]});return db[_0x106c('0x64')][_0x106c('0x5a')]({'where':{'id':_0x190a5d['WhatsappInteractionId']}});}return null;})[_0x106c('0x20')](handleEntityNotFound(_0x3aae62,null))[_0x106c('0x20')](function(_0x1bd302){if(_0x1bd302){return _0x1bd302['update']({'UserId':_0x481492[_0x106c('0x59')][_0x106c('0x61')],'read1stAt':_[_0x106c('0x65')](_0x1bd302[_0x106c('0x66')])?moment()[_0x106c('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x46fdb2){if(_0x46fdb2){_0xd3ef17[_0x106c('0x68')]=_0x46fdb2['get']({'plain':!![]});interaction_log[_0x106c('0x21')](_0x106c('0x69'),_0x481492[_0x106c('0x62')]['id'],_0x481492[_0x106c('0x62')][_0x106c('0x38')],_0x481492[_0x106c('0x62')][_0x106c('0x6a')],_0xd3ef17[_0x106c('0x68')]['id'],_0x481492[_0x106c('0x59')]?JSON['stringify'](_0x481492[_0x106c('0x59')]):_0x106c('0x6b'));return respondWithRpcPromise(_0x106c('0x6c'),_0x106c('0x6d'),_0xd3ef17);}return null;})[_0x106c('0x20')](function(_0x36d3d8){var _0x393b82=_0x106c('0x6e')+_0x36d3d8[_0x106c('0x28')][_0x106c('0x6f')];return db[_0x106c('0x70')][_0x106c('0x40')](_0x393b82,{'type':db['Sequelize'][_0x106c('0x71')][_0x106c('0x72')],'raw':!![]})[_0x106c('0x20')](function(_0x4ab236){return _0x4ab236;});})[_0x106c('0x20')](function(_0x5542c9){if(_0x5542c9){_0xd3ef17[_0x106c('0x28')]['contact']=_0x5542c9[0x0];if(!_0x481492[_0x106c('0x59')]['UserId'])return;return db[_0x106c('0x73')][_0x106c('0x5a')]({'where':{'id':_0x481492[_0x106c('0x59')][_0x106c('0x61')],'role':_0x106c('0x74')},'attributes':['id',_0x106c('0x38'),_0x106c('0x75'),_0x106c('0x76'),_0x106c('0x77')],'raw':!![]});}return null;})[_0x106c('0x20')](function(_0x355d3e){if(!_0x355d3e)return null;_0xd3ef17[_0x106c('0x28')][_0x106c('0x74')]=_0x355d3e;return _0xd3ef17;})['then'](function(_0x7c6259){if(_0x7c6259){if(_0x481492[_0x106c('0x59')]['manual']){_0xd3ef17[_0x106c('0x28')]['interface']=util[_0x106c('0x67')](_0x106c('0x78'),_0x481492['user'][_0x106c('0x38')]);_0xd3ef17[_0x106c('0x28')][_0x106c('0x79')]=_0xd3ef17['channel'];_0xd3ef17[_0x106c('0x28')]['motionChannel']=_0xd3ef17[_0x106c('0x79')];_0xd3ef17[_0x106c('0x28')][_0x106c('0x7a')]=_0x106c('0x5e');return respondWithRpcPromise(_0x106c('0x7b'),_0x106c('0x7b'),{'event':'acceptmessage','message':_0xd3ef17[_0x106c('0x28')]},client9002)[_0x106c('0x20')](function(){return _0xd3ef17;});}return _0xd3ef17;}return null;})['then'](respondWithResult(_0x3aae62,null))[_0x106c('0x52')](handleError(_0x3aae62,null));};var interaction_log=require(_0x106c('0x5c'))(_0x106c('0x5d'));exports['reject']=function(_0x42a019,_0x206ec3,_0x4d1178){var _0x12030b={'agent':{},'channel':_0x106c('0x7c')};if(_0x42a019[_0x106c('0x59')]['id']){delete _0x42a019[_0x106c('0x59')]['id'];}_0x42a019[_0x106c('0x59')][_0x106c('0x61')]=_0x42a019['body'][_0x106c('0x61')]||_0x42a019[_0x106c('0x62')]['id'];_0x12030b[_0x106c('0x74')]['id']=_0x42a019['body']['UserId'];return db[_0x106c('0x3b')][_0x106c('0x5a')]({'where':{'id':_0x42a019[_0x106c('0x54')]['id'],'UserId':null}})[_0x106c('0x20')](handleEntityNotFound(_0x206ec3,null))[_0x106c('0x20')](function(_0x5b5412){if(_0x5b5412){_0x12030b[_0x106c('0x28')]=_0x5b5412['get']({'plain':!![]});return db[_0x106c('0x64')][_0x106c('0x5a')]({'where':{'id':_0x5b5412['WhatsappInteractionId']}});}return null;})[_0x106c('0x20')](handleEntityNotFound(_0x206ec3,null))[_0x106c('0x20')](function(_0x669e10){if(_0x669e10){_0x12030b[_0x106c('0x68')]=_0x669e10[_0x106c('0x63')]({'plain':!![]});interaction_log['info'](_0x106c('0x7d'),_0x42a019['user']['id'],_0x42a019['user'][_0x106c('0x38')],_0x42a019['user'][_0x106c('0x6a')],_0x12030b[_0x106c('0x68')]['id'],_0x42a019[_0x106c('0x59')]?JSON['stringify'](_0x42a019['body']):_0x106c('0x6b'));return respondWithRpcPromise('RejectMessage',_0x106c('0x7e'),_0x12030b);}return null;})[_0x106c('0x20')](function(_0x16eb1b){var _0xcc3efc=_0x106c('0x6e')+_0x16eb1b[_0x106c('0x28')]['ContactId'];return db[_0x106c('0x70')][_0x106c('0x40')](_0xcc3efc,{'type':db[_0x106c('0x7f')]['QueryTypes'][_0x106c('0x72')],'raw':!![]})[_0x106c('0x20')](function(_0x2dc9f3){return _0x2dc9f3;});})[_0x106c('0x20')](function(_0x2a24a6){if(_0x2a24a6){_0x12030b[_0x106c('0x28')]['contact']=_0x2a24a6[0x0];if(!_0x42a019[_0x106c('0x59')][_0x106c('0x61')])return;return db[_0x106c('0x73')][_0x106c('0x5a')]({'where':{'id':_0x42a019[_0x106c('0x59')][_0x106c('0x61')],'role':_0x106c('0x74')},'attributes':['id','name',_0x106c('0x75'),_0x106c('0x76'),_0x106c('0x77')],'raw':!![]});}return null;})[_0x106c('0x20')](function(_0x3ee680){if(!_0x3ee680)return null;_0x12030b[_0x106c('0x28')]['agent']=_0x3ee680;return _0x12030b;})['then'](function(_0x13798a){if(_0x13798a){_0x13798a['message'][_0x106c('0x80')]=util['format'](_0x106c('0x78'),_0x42a019[_0x106c('0x62')]['name']);_0x13798a[_0x106c('0x28')]['channel']=_0x12030b[_0x106c('0x79')];_0x13798a[_0x106c('0x28')][_0x106c('0x81')]=_0x12030b[_0x106c('0x79')];_0x13798a[_0x106c('0x28')][_0x106c('0x7a')]=_0x106c('0x33');respondWithRpcPromise(_0x106c('0x7b'),_0x106c('0x7b'),{'event':_0x106c('0x82'),'message':_0x13798a[_0x106c('0x28')]},client9002);return _0x12030b;}return null;})[_0x106c('0x20')](respondWithResult(_0x206ec3,null))[_0x106c('0x52')](handleError(_0x206ec3,null));};exports['status']=function(_0x2ee89a,_0x535398,_0x295445){if(_0x2ee89a[_0x106c('0x59')]['id']){delete _0x2ee89a[_0x106c('0x59')]['id'];}var _0x483feb;return db[_0x106c('0x3b')][_0x106c('0x5a')]({'where':{'id':_0x2ee89a[_0x106c('0x54')]['id']}})[_0x106c('0x20')](handleEntityNotFound(_0x535398,null))[_0x106c('0x20')](function(_0x144bd9){if(_0x144bd9){_0x483feb=_0x144bd9;return db['WhatsappAccount'][_0x106c('0x5a')]({'where':{'id':_0x144bd9['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x535398,null))[_0x106c('0x20')](function(_0x385635){if(_0x385635){logger['debug'](_0x106c('0x83'),_0x106c('0x2a'),_0x106c('0x84'),_0x385635[_0x106c('0x4d')],util[_0x106c('0x85')](_0x2ee89a[_0x106c('0x59')],{'showHidden':![],'depth':null}));switch(_0x385635[_0x106c('0x4d')]){case _0x106c('0x86'):if(_0x2ee89a[_0x106c('0x59')][_0x106c('0x87')]&&_0x2ee89a[_0x106c('0x59')][_0x106c('0x87')]===_0x483feb[_0x106c('0x88')]&&_0x2ee89a['body']['MessageStatus']&&_0x2ee89a[_0x106c('0x59')]['MessageStatus']===_0x106c('0x5f')){return _0x483feb[_0x106c('0x34')]({'read':!![]});}else{logger['error'](_0x106c('0x89'),_0x106c('0x2a'),_0x106c('0x86'),util[_0x106c('0x85')](_0x2ee89a['body'],{'showHidden':![],'depth':null}));}break;}return _0x483feb;}})[_0x106c('0x20')](respondWithResult(_0x535398,null))[_0x106c('0x52')](handleError(_0x535398,null));}; \ No newline at end of file +var _0x3b39=['received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','pick','merge','VIRTUAL','filter','options','WhatsappMessage','findAll','rows','show','params','length','includeAll','include','create','body','find','describe','../../config/logger','whatsapp-interactions','whatsapp','read','readAt','format','UserId','user','agent','WhatsappInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','event','accept','EventManager','acceptmessage','info','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','interface','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5253c2,_0xbc3136){var _0xfbd13f=function(_0x1da932){while(--_0x1da932){_0x5253c2['push'](_0x5253c2['shift']());}};_0xfbd13f(++_0xbc3136);}(_0x3b39,0x121));var _0x93b3=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0x3b39[_0x1d211b];return _0x47c88b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93b3('0x0'));var zipdir=require(_0x93b3('0x1'));var jsonpatch=require(_0x93b3('0x2'));var rp=require('request-promise');var moment=require(_0x93b3('0x3'));var BPromise=require(_0x93b3('0x4'));var Mustache=require(_0x93b3('0x5'));var util=require(_0x93b3('0x6'));var path=require(_0x93b3('0x7'));var sox=require('sox');var csv=require(_0x93b3('0x8'));var ejs=require(_0x93b3('0x9'));var fs=require('fs');var fs_extra=require(_0x93b3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x93b3('0xb'));var jsforce=require(_0x93b3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x93b3('0xd'));var Papa=require(_0x93b3('0xe'));var Redis=require(_0x93b3('0xf'));var authService=require(_0x93b3('0x10'));var qs=require(_0x93b3('0x11'));var as=require(_0x93b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x93b3('0x13'));var utils=require(_0x93b3('0x14'));var config=require(_0x93b3('0x15'));var licenseUtil=require(_0x93b3('0x16'));var db=require(_0x93b3('0x17'))['db'];config[_0x93b3('0x18')]=_[_0x93b3('0x19')](config[_0x93b3('0x18')],{'host':_0x93b3('0x1a'),'port':0x18eb});var socket=require(_0x93b3('0x1b'))(new Redis(config[_0x93b3('0x18')]));require(_0x93b3('0x1c'))['register'](socket);var jayson=require(_0x93b3('0x1d'));var client=jayson['client'][_0x93b3('0x1e')]({'port':0x232c});var client9002=jayson[_0x93b3('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0f495,_0x43e94b,_0x455fe9,_0x4dd91f){return new BPromise(function(_0x4c3a9a,_0x17cf7e){var _0x44cf8a=_0x4dd91f||client;return _0x44cf8a[_0x93b3('0x20')](_0xd0f495,_0x455fe9)[_0x93b3('0x21')](function(_0x47c36d){logger['info'](_0x93b3('0x22'),_0x43e94b,_0x93b3('0x23'));logger[_0x93b3('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x43e94b,_0x93b3('0x23'),JSON[_0x93b3('0x25')](_0x47c36d));if(_0x47c36d[_0x93b3('0x26')]){if(_0x47c36d[_0x93b3('0x26')][_0x93b3('0x27')]===0x1f4){logger[_0x93b3('0x26')](_0x93b3('0x22'),_0x43e94b,_0x47c36d[_0x93b3('0x26')][_0x93b3('0x28')]);return _0x17cf7e(_0x47c36d[_0x93b3('0x26')][_0x93b3('0x28')]);}logger[_0x93b3('0x26')](_0x93b3('0x22'),_0x43e94b,_0x47c36d[_0x93b3('0x26')]['message']);return _0x4c3a9a(_0x47c36d[_0x93b3('0x26')][_0x93b3('0x28')]);}else{logger['info'](_0x93b3('0x22'),_0x43e94b,_0x93b3('0x23'));_0x4c3a9a(_0x47c36d[_0x93b3('0x29')]['message']);}})[_0x93b3('0x2a')](function(_0x5230c1){logger[_0x93b3('0x26')](_0x93b3('0x22'),_0x43e94b,_0x5230c1);_0x17cf7e(_0x5230c1);});});}function respondWithStatusCode(_0x4720cf,_0x3ce14e){_0x3ce14e=_0x3ce14e||0xcc;return function(_0xc88e1d){if(_0xc88e1d){return _0x4720cf[_0x93b3('0x2b')](_0x3ce14e);}return _0x4720cf[_0x93b3('0x2c')](_0x3ce14e)[_0x93b3('0x2d')]();};}function respondWithResult(_0x17d2e8,_0x4876a6){_0x4876a6=_0x4876a6||0xc8;return function(_0x30b4b0){if(_0x30b4b0){return _0x17d2e8[_0x93b3('0x2c')](_0x4876a6)[_0x93b3('0x2e')](_0x30b4b0);}};}function respondWithFilteredResult(_0x2562ba,_0x7f5d8d){return function(_0x57ccb1){if(_0x57ccb1){var _0x3738e1=typeof _0x7f5d8d[_0x93b3('0x2f')]===_0x93b3('0x30')&&typeof _0x7f5d8d[_0x93b3('0x31')]===_0x93b3('0x30');var _0xf8afa3=_0x57ccb1[_0x93b3('0x32')];var _0x67d61f=_0x3738e1?0x0:_0x7f5d8d['offset'];var _0x1c0a10=_0x3738e1?_0x57ccb1[_0x93b3('0x32')]:_0x7f5d8d[_0x93b3('0x2f')]+_0x7f5d8d[_0x93b3('0x31')];var _0x59a898;if(_0x1c0a10>=_0xf8afa3){_0x1c0a10=_0xf8afa3;_0x59a898=0xc8;}else{_0x59a898=0xce;}_0x2562ba[_0x93b3('0x2c')](_0x59a898);return _0x2562ba['set'](_0x93b3('0x33'),_0x67d61f+'-'+_0x1c0a10+'/'+_0xf8afa3)[_0x93b3('0x2e')](_0x57ccb1);}return null;};}function patchUpdates(_0x28dede){return function(_0x5e41b7){try{jsonpatch[_0x93b3('0x34')](_0x5e41b7,_0x28dede,!![]);}catch(_0x18d9ed){return BPromise[_0x93b3('0x35')](_0x18d9ed);}return _0x5e41b7[_0x93b3('0x36')]();};}function saveUpdates(_0x176c5a,_0x211217){return function(_0x202fbf){if(_0x202fbf){return _0x202fbf[_0x93b3('0x37')](_0x176c5a)['then'](function(_0x2e88c3){return _0x2e88c3;});}return null;};}function removeEntity(_0x2be725,_0x220e4f){return function(_0x4000e6){if(_0x4000e6){return _0x4000e6[_0x93b3('0x38')]()[_0x93b3('0x21')](function(){_0x2be725[_0x93b3('0x2c')](0xcc)[_0x93b3('0x2d')]();});}};}function handleEntityNotFound(_0xbc3361,_0x6b1328){return function(_0x3becc8){if(!_0x3becc8){_0xbc3361[_0x93b3('0x2b')](0x194);}return _0x3becc8;};}function handleError(_0x3c0f6d,_0x57ea87){_0x57ea87=_0x57ea87||0x1f4;return function(_0x2f5b37){logger[_0x93b3('0x26')](_0x2f5b37[_0x93b3('0x39')]);if(_0x2f5b37[_0x93b3('0x3a')]){delete _0x2f5b37[_0x93b3('0x3a')];}_0x3c0f6d[_0x93b3('0x2c')](_0x57ea87)[_0x93b3('0x3b')](_0x2f5b37);};}exports['index']=function(_0x1967a1,_0x1c1f7a){var _0x4b9b18={},_0xd289c0={},_0x224650={'count':0x0,'rows':[]};var _0x554496=_[_0x93b3('0x3c')](db['WhatsappMessage'][_0x93b3('0x3d')],function(_0x1d3249){return{'name':_0x1d3249[_0x93b3('0x3e')],'type':_0x1d3249[_0x93b3('0x3f')][_0x93b3('0x40')]};});_0xd289c0[_0x93b3('0x41')]=_['map'](_0x554496,_0x93b3('0x3a'));_0xd289c0[_0x93b3('0x42')]=_[_0x93b3('0x43')](_0x1967a1['query']);_0xd289c0[_0x93b3('0x44')]=_[_0x93b3('0x45')](_0xd289c0['model'],_0xd289c0[_0x93b3('0x42')]);_0x4b9b18[_0x93b3('0x46')]=_['intersection'](_0xd289c0[_0x93b3('0x41')],qs[_0x93b3('0x47')](_0x1967a1[_0x93b3('0x42')]['fields']));_0x4b9b18[_0x93b3('0x46')]=_0x4b9b18[_0x93b3('0x46')]['length']?_0x4b9b18[_0x93b3('0x46')]:_0xd289c0[_0x93b3('0x41')];if(!_0x1967a1[_0x93b3('0x42')]['hasOwnProperty']('nolimit')){_0x4b9b18[_0x93b3('0x31')]=qs[_0x93b3('0x31')](_0x1967a1[_0x93b3('0x42')]['limit']);_0x4b9b18[_0x93b3('0x2f')]=qs[_0x93b3('0x2f')](_0x1967a1['query']['offset']);}_0x4b9b18[_0x93b3('0x48')]=qs['sort'](_0x1967a1[_0x93b3('0x42')]['sort']);_0x4b9b18['where']=qs[_0x93b3('0x44')](_[_0x93b3('0x49')](_0x1967a1[_0x93b3('0x42')],_0xd289c0[_0x93b3('0x44')]),_0x554496);if(_0x1967a1[_0x93b3('0x42')]['filter']){_0x4b9b18['where']=_[_0x93b3('0x4a')](_0x4b9b18['where'],{'$or':_[_0x93b3('0x3c')](_0x554496,function(_0x3562ce){if(_0x3562ce[_0x93b3('0x3f')]!==_0x93b3('0x4b')){var _0x2e3f0a={};_0x2e3f0a[_0x3562ce[_0x93b3('0x3a')]]={'$like':'%'+_0x1967a1[_0x93b3('0x42')][_0x93b3('0x4c')]+'%'};return _0x2e3f0a;}})});}_0x4b9b18=_[_0x93b3('0x4a')]({},_0x4b9b18,_0x1967a1[_0x93b3('0x4d')]);var _0x342d6a={'where':_0x4b9b18['where']};return db[_0x93b3('0x4e')][_0x93b3('0x32')](_0x342d6a)[_0x93b3('0x21')](function(_0x4e3f60){_0x224650[_0x93b3('0x32')]=_0x4e3f60;if(_0x1967a1[_0x93b3('0x42')]['includeAll']){_0x4b9b18['include']=[{'all':!![]}];}return db[_0x93b3('0x4e')][_0x93b3('0x4f')](_0x4b9b18);})[_0x93b3('0x21')](function(_0x260874){_0x224650[_0x93b3('0x50')]=_0x260874;return _0x224650;})[_0x93b3('0x21')](respondWithFilteredResult(_0x1c1f7a,_0x4b9b18))['catch'](handleError(_0x1c1f7a,null));};exports[_0x93b3('0x51')]=function(_0x51d56c,_0x12269a){var _0x531bd9={'raw':!![],'where':{'id':_0x51d56c[_0x93b3('0x52')]['id']}},_0xafd9cd={};_0xafd9cd[_0x93b3('0x41')]=_[_0x93b3('0x43')](db[_0x93b3('0x4e')]['rawAttributes']);_0xafd9cd[_0x93b3('0x42')]=_[_0x93b3('0x43')](_0x51d56c['query']);_0xafd9cd[_0x93b3('0x44')]=_[_0x93b3('0x45')](_0xafd9cd[_0x93b3('0x41')],_0xafd9cd['query']);_0x531bd9[_0x93b3('0x46')]=_[_0x93b3('0x45')](_0xafd9cd[_0x93b3('0x41')],qs[_0x93b3('0x47')](_0x51d56c['query'][_0x93b3('0x47')]));_0x531bd9[_0x93b3('0x46')]=_0x531bd9[_0x93b3('0x46')][_0x93b3('0x53')]?_0x531bd9[_0x93b3('0x46')]:_0xafd9cd['model'];if(_0x51d56c[_0x93b3('0x42')][_0x93b3('0x54')]){_0x531bd9[_0x93b3('0x55')]=[{'all':!![]}];}_0x531bd9=_[_0x93b3('0x4a')]({},_0x531bd9,_0x51d56c[_0x93b3('0x4d')]);return db[_0x93b3('0x4e')]['find'](_0x531bd9)[_0x93b3('0x21')](handleEntityNotFound(_0x12269a,null))[_0x93b3('0x21')](respondWithResult(_0x12269a,null))[_0x93b3('0x2a')](handleError(_0x12269a,null));};exports[_0x93b3('0x56')]=function(_0x50d7e9,_0x2b3936){return db[_0x93b3('0x4e')]['create'](_0x50d7e9[_0x93b3('0x57')],{})[_0x93b3('0x21')](respondWithResult(_0x2b3936,0xc9))[_0x93b3('0x2a')](handleError(_0x2b3936,null));};exports[_0x93b3('0x37')]=function(_0x1763b3,_0x240d56){if(_0x1763b3[_0x93b3('0x57')]['id']){delete _0x1763b3['body']['id'];}return db[_0x93b3('0x4e')][_0x93b3('0x58')]({'where':{'id':_0x1763b3[_0x93b3('0x52')]['id']}})[_0x93b3('0x21')](handleEntityNotFound(_0x240d56,null))[_0x93b3('0x21')](saveUpdates(_0x1763b3[_0x93b3('0x57')],null))[_0x93b3('0x21')](respondWithResult(_0x240d56,null))['catch'](handleError(_0x240d56,null));};exports[_0x93b3('0x38')]=function(_0x5c93ae,_0x4e02c5){return db['WhatsappMessage'][_0x93b3('0x58')]({'where':{'id':_0x5c93ae['params']['id']}})[_0x93b3('0x21')](handleEntityNotFound(_0x4e02c5,null))[_0x93b3('0x21')](removeEntity(_0x4e02c5,null))[_0x93b3('0x2a')](handleError(_0x4e02c5,null));};exports[_0x93b3('0x59')]=function(_0xe7e73b,_0x5dde91){return db[_0x93b3('0x4e')][_0x93b3('0x59')]()['then'](respondWithResult(_0x5dde91,null))[_0x93b3('0x2a')](handleError(_0x5dde91,null));};var interaction_log=require(_0x93b3('0x5a'))(_0x93b3('0x5b'));exports['accept']=function(_0x47fbd4,_0xb911a9,_0x5281e4){var _0x9a17f4={'agent':{},'channel':_0x93b3('0x5c')};if(_0x47fbd4[_0x93b3('0x57')]['id']){delete _0x47fbd4['body']['id'];}_0x47fbd4['body'][_0x93b3('0x5d')]=!![];_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x5e')]=moment()[_0x93b3('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x47fbd4['body']['UserId']=_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x60')]||_0x47fbd4[_0x93b3('0x61')]['id'];_0x9a17f4[_0x93b3('0x62')]['id']=_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x60')];return db['WhatsappMessage'][_0x93b3('0x58')]({'where':{'id':_0x47fbd4[_0x93b3('0x52')]['id'],'UserId':null}})[_0x93b3('0x21')](handleEntityNotFound(_0xb911a9,null))[_0x93b3('0x21')](saveUpdates(_0x47fbd4['body'],null))[_0x93b3('0x21')](function(_0x3b8cee){if(_0x3b8cee){_0x9a17f4[_0x93b3('0x28')]=_0x3b8cee['get']({'plain':!![]});return db[_0x93b3('0x63')][_0x93b3('0x58')]({'where':{'id':_0x3b8cee['WhatsappInteractionId']}});}return null;})[_0x93b3('0x21')](handleEntityNotFound(_0xb911a9,null))[_0x93b3('0x21')](function(_0x20a788){if(_0x20a788){return _0x20a788[_0x93b3('0x37')]({'UserId':_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x60')],'read1stAt':_['isNil'](_0x20a788[_0x93b3('0x64')])?moment()[_0x93b3('0x5f')](_0x93b3('0x65')):undefined});}return null;})[_0x93b3('0x21')](function(_0x4b1b02){if(_0x4b1b02){_0x9a17f4['interaction']=_0x4b1b02[_0x93b3('0x66')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47fbd4[_0x93b3('0x61')]['id'],_0x47fbd4[_0x93b3('0x61')][_0x93b3('0x3a')],_0x47fbd4[_0x93b3('0x61')]['role'],_0x9a17f4[_0x93b3('0x67')]['id'],_0x47fbd4['body']?JSON['stringify'](_0x47fbd4[_0x93b3('0x57')]):_0x93b3('0x68'));return respondWithRpcPromise(_0x93b3('0x69'),_0x93b3('0x6a'),_0x9a17f4);}return null;})[_0x93b3('0x21')](function(_0x50f3ac){var _0x503eef='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50f3ac[_0x93b3('0x28')][_0x93b3('0x6b')];return db[_0x93b3('0x6c')][_0x93b3('0x42')](_0x503eef,{'type':db[_0x93b3('0x6d')][_0x93b3('0x6e')][_0x93b3('0x6f')],'raw':!![]})[_0x93b3('0x21')](function(_0x1f4590){return _0x1f4590;});})['then'](function(_0x404758){if(_0x404758){_0x9a17f4[_0x93b3('0x28')][_0x93b3('0x70')]=_0x404758[0x0];if(!_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x60')])return;return db[_0x93b3('0x71')][_0x93b3('0x58')]({'where':{'id':_0x47fbd4[_0x93b3('0x57')][_0x93b3('0x60')],'role':_0x93b3('0x62')},'attributes':['id',_0x93b3('0x3a'),_0x93b3('0x72'),_0x93b3('0x73'),_0x93b3('0x74')],'raw':!![]});}return null;})[_0x93b3('0x21')](function(_0x389b07){if(!_0x389b07)return null;_0x9a17f4[_0x93b3('0x28')][_0x93b3('0x62')]=_0x389b07;return _0x9a17f4;})[_0x93b3('0x21')](function(_0x5bacc2){if(_0x5bacc2){if(_0x47fbd4[_0x93b3('0x57')]['manual']){_0x9a17f4[_0x93b3('0x28')]['interface']=util[_0x93b3('0x5f')](_0x93b3('0x75'),_0x47fbd4[_0x93b3('0x61')][_0x93b3('0x3a')]);_0x9a17f4['message']['channel']=_0x9a17f4[_0x93b3('0x76')];_0x9a17f4[_0x93b3('0x28')]['motionChannel']=_0x9a17f4['channel'];_0x9a17f4[_0x93b3('0x28')][_0x93b3('0x77')]=_0x93b3('0x78');return respondWithRpcPromise(_0x93b3('0x79'),_0x93b3('0x79'),{'event':_0x93b3('0x7a'),'message':_0x9a17f4['message']},client9002)['then'](function(){return _0x9a17f4;});}return _0x9a17f4;}return null;})['then'](respondWithResult(_0xb911a9,null))['catch'](handleError(_0xb911a9,null));};var interaction_log=require(_0x93b3('0x5a'))(_0x93b3('0x5b'));exports[_0x93b3('0x35')]=function(_0x32a9fe,_0x24878a,_0x7505be){var _0x2bf06c={'agent':{},'channel':_0x93b3('0x5c')};if(_0x32a9fe[_0x93b3('0x57')]['id']){delete _0x32a9fe['body']['id'];}_0x32a9fe['body'][_0x93b3('0x60')]=_0x32a9fe[_0x93b3('0x57')][_0x93b3('0x60')]||_0x32a9fe['user']['id'];_0x2bf06c[_0x93b3('0x62')]['id']=_0x32a9fe['body']['UserId'];return db[_0x93b3('0x4e')]['find']({'where':{'id':_0x32a9fe[_0x93b3('0x52')]['id'],'UserId':null}})[_0x93b3('0x21')](handleEntityNotFound(_0x24878a,null))[_0x93b3('0x21')](function(_0x304b6e){if(_0x304b6e){_0x2bf06c[_0x93b3('0x28')]=_0x304b6e[_0x93b3('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x93b3('0x58')]({'where':{'id':_0x304b6e['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x24878a,null))[_0x93b3('0x21')](function(_0x471bc5){if(_0x471bc5){_0x2bf06c[_0x93b3('0x67')]=_0x471bc5[_0x93b3('0x66')]({'plain':!![]});interaction_log[_0x93b3('0x7b')](_0x93b3('0x7c'),_0x32a9fe[_0x93b3('0x61')]['id'],_0x32a9fe[_0x93b3('0x61')][_0x93b3('0x3a')],_0x32a9fe[_0x93b3('0x61')][_0x93b3('0x7d')],_0x2bf06c[_0x93b3('0x67')]['id'],_0x32a9fe[_0x93b3('0x57')]?JSON[_0x93b3('0x25')](_0x32a9fe['body']):_0x93b3('0x68'));return respondWithRpcPromise(_0x93b3('0x7e'),_0x93b3('0x7f'),_0x2bf06c);}return null;})[_0x93b3('0x21')](function(_0x5dec85){var _0x2845b9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5dec85[_0x93b3('0x28')][_0x93b3('0x6b')];return db[_0x93b3('0x6c')][_0x93b3('0x42')](_0x2845b9,{'type':db[_0x93b3('0x6d')][_0x93b3('0x6e')][_0x93b3('0x6f')],'raw':!![]})['then'](function(_0x5ddb1d){return _0x5ddb1d;});})['then'](function(_0x22dd46){if(_0x22dd46){_0x2bf06c['message'][_0x93b3('0x70')]=_0x22dd46[0x0];if(!_0x32a9fe[_0x93b3('0x57')][_0x93b3('0x60')])return;return db[_0x93b3('0x71')][_0x93b3('0x58')]({'where':{'id':_0x32a9fe[_0x93b3('0x57')][_0x93b3('0x60')],'role':'agent'},'attributes':['id',_0x93b3('0x3a'),_0x93b3('0x72'),'email',_0x93b3('0x74')],'raw':!![]});}return null;})['then'](function(_0x235dc5){if(!_0x235dc5)return null;_0x2bf06c[_0x93b3('0x28')][_0x93b3('0x62')]=_0x235dc5;return _0x2bf06c;})[_0x93b3('0x21')](function(_0x287a07){if(_0x287a07){_0x287a07[_0x93b3('0x28')][_0x93b3('0x80')]=util['format'](_0x93b3('0x75'),_0x32a9fe['user'][_0x93b3('0x3a')]);_0x287a07[_0x93b3('0x28')]['channel']=_0x2bf06c[_0x93b3('0x76')];_0x287a07[_0x93b3('0x28')][_0x93b3('0x81')]=_0x2bf06c[_0x93b3('0x76')];_0x287a07[_0x93b3('0x28')][_0x93b3('0x77')]=_0x93b3('0x35');respondWithRpcPromise(_0x93b3('0x79'),'EventManager',{'event':_0x93b3('0x82'),'message':_0x287a07[_0x93b3('0x28')]},client9002);return _0x2bf06c;}return null;})[_0x93b3('0x21')](respondWithResult(_0x24878a,null))[_0x93b3('0x2a')](handleError(_0x24878a,null));};exports['status']=function(_0x1b26b0,_0x1312f3,_0x5b7e57){if(_0x1b26b0[_0x93b3('0x57')]['id']){delete _0x1b26b0[_0x93b3('0x57')]['id'];}var _0x11e0cf;return db[_0x93b3('0x4e')][_0x93b3('0x58')]({'where':{'id':_0x1b26b0['params']['id']}})['then'](handleEntityNotFound(_0x1312f3,null))[_0x93b3('0x21')](function(_0x34db8a){if(_0x34db8a){_0x11e0cf=_0x34db8a;return db[_0x93b3('0x83')][_0x93b3('0x58')]({'where':{'id':_0x34db8a[_0x93b3('0x84')]}});}})[_0x93b3('0x21')](handleEntityNotFound(_0x1312f3,null))[_0x93b3('0x21')](function(_0x222c4b){if(_0x222c4b){logger[_0x93b3('0x24')](_0x93b3('0x85'),_0x93b3('0x2c'),_0x93b3('0x86'),_0x222c4b[_0x93b3('0x3f')],util[_0x93b3('0x87')](_0x1b26b0[_0x93b3('0x57')],{'showHidden':![],'depth':null}));switch(_0x222c4b[_0x93b3('0x3f')]){case'twilio':if(_0x1b26b0[_0x93b3('0x57')]['MessageSid']&&_0x1b26b0[_0x93b3('0x57')][_0x93b3('0x88')]===_0x11e0cf[_0x93b3('0x89')]&&_0x1b26b0[_0x93b3('0x57')][_0x93b3('0x8a')]&&_0x1b26b0[_0x93b3('0x57')][_0x93b3('0x8a')]===_0x93b3('0x5d')){return _0x11e0cf[_0x93b3('0x37')]({'read':!![]});}else{logger['error'](_0x93b3('0x8b'),_0x93b3('0x2c'),_0x93b3('0x8c'),util[_0x93b3('0x87')](_0x1b26b0['body'],{'showHidden':![],'depth':null}));}break;}return _0x11e0cf;}})[_0x93b3('0x21')](respondWithResult(_0x1312f3,null))[_0x93b3('0x2a')](handleError(_0x1312f3,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index c9991ba..9b5b03b 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 _0x2e54=['update','remove','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x276d67,_0x256e0b){var _0x925e8d=function(_0x5dd663){while(--_0x5dd663){_0x276d67['push'](_0x276d67['shift']());}};_0x925e8d(++_0x256e0b);}(_0x2e54,0x1dd));var _0x42e5=function(_0x44d515,_0x2fe9c5){_0x44d515=_0x44d515-0x0;var _0x5628b2=_0x2e54[_0x44d515];return _0x5628b2;};'use strict';var EventEmitter=require(_0x42e5('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x42e5('0x1')](0x0);var events={'afterCreate':_0x42e5('0x2'),'afterUpdate':_0x42e5('0x3'),'afterDestroy':_0x42e5('0x4')};function emitEvent(_0x326371){return function(_0x153440,_0x42736b,_0x528772){WhatsappMessageEvents[_0x42e5('0x5')](_0x326371+':'+_0x153440['id'],_0x153440);WhatsappMessageEvents[_0x42e5('0x5')](_0x326371,_0x153440);_0x528772(null);};}for(var e in events){if(events[_0x42e5('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x42e5('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x5ec6=['../../mysqldb','WhatsappMessage','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x3202ab,_0x291b88){var _0x33b443=function(_0x52824a){while(--_0x52824a){_0x3202ab['push'](_0x3202ab['shift']());}};_0x33b443(++_0x291b88);}(_0x5ec6,0x7f));var _0x65ec=function(_0x53c93c,_0x2d5fd9){_0x53c93c=_0x53c93c-0x0;var _0xf4e605=_0x5ec6[_0x53c93c];return _0xf4e605;};'use strict';var EventEmitter=require(_0x65ec('0x0'));var WhatsappMessage=require(_0x65ec('0x1'))['db'][_0x65ec('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x65ec('0x3'),'afterUpdate':'update','afterDestroy':_0x65ec('0x4')};function emitEvent(_0x4c659e){return function(_0x33751d,_0x4c1772,_0xf2c7b7){WhatsappMessageEvents['emit'](_0x4c659e+':'+_0x33751d['id'],_0x33751d);WhatsappMessageEvents[_0x65ec('0x5')](_0x4c659e,_0x33751d);_0xf2c7b7(null);};}for(var e in events){if(events[_0x65ec('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x65ec('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index cd28df3..397a6f6 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 _0x3fb8=['WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','baseUrl','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x4857d4,_0x475859){var _0x8cc318=function(_0x3e1a2d){while(--_0x3e1a2d){_0x4857d4['push'](_0x4857d4['shift']());}};_0x8cc318(++_0x475859);}(_0x3fb8,0x11e));var _0x83fb=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x3fb8[_0x705b98];return _0x47b72f;};'use strict';var _=require('lodash');var util=require(_0x83fb('0x0'));var logger=require(_0x83fb('0x1'))(_0x83fb('0x2'));var moment=require(_0x83fb('0x3'));var BPromise=require(_0x83fb('0x4'));var rp=require(_0x83fb('0x5'));var fetch=require(_0x83fb('0x6'));var fs=require('fs');var path=require(_0x83fb('0x7'));var rimraf=require(_0x83fb('0x8'));var config=require(_0x83fb('0x9'));var attributes=require(_0x83fb('0xa'));module[_0x83fb('0xb')]=function(_0x53fe98,_0x3acd64){return _0x53fe98[_0x83fb('0xc')]('WhatsappMessage',attributes,{'tableName':_0x83fb('0xd'),'paranoid':![],'indexes':[{'name':_0x83fb('0xe'),'fields':[_0x83fb('0xe')]},{'name':_0x83fb('0xf'),'fields':['body'],'type':_0x83fb('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x396c2c,_0x5ce5dd,_0x43af66){var _0x403086=_0x53fe98[_0x83fb('0x11')];var _0x59aa8a=_0x396c2c[_0x83fb('0x12')]({'plain':!![]});if(_0x59aa8a[_0x83fb('0x13')][_0x83fb('0x14')]()==='in'||_0x59aa8a[_0x83fb('0x13')][_0x83fb('0x14')]()==='out'&&!_0x59aa8a[_0x83fb('0x15')]&&!_[_0x83fb('0x16')](_0x59aa8a[_0x83fb('0x17')])){_0x403086[_0x83fb('0x18')]['findOne']({'where':{'id':_0x59aa8a[_0x83fb('0x19')]}})[_0x83fb('0x1a')](function(_0x255a29){if(_0x255a29){_0x255a29[_0x83fb('0x1b')]({'lastMsgAt':_0x59aa8a[_0x83fb('0x1c')],'lastMsgDirection':_0x59aa8a['direction'][_0x83fb('0x14')]()});}})[_0x83fb('0x1d')](function(_0x5609a3){console[_0x83fb('0x1e')](_0x5609a3);});}if(_0x59aa8a[_0x83fb('0x13')]===_0x83fb('0x1f')&&!_0x59aa8a[_0x83fb('0x15')]){var _0x2eaa9d;_0x403086[_0x83fb('0x20')]['find']({'where':{'id':_0x59aa8a[_0x83fb('0x21')]},'raw':!![]})['then'](function(_0x4ff9d3){_0x2eaa9d=_0x4ff9d3;if(_0x2eaa9d&&_0x2eaa9d[_0x83fb('0x22')]){switch(_0x2eaa9d[_0x83fb('0x22')]){case _0x83fb('0x23'):var _0x331313=require(_0x83fb('0x23'));if(_0x2eaa9d[_0x83fb('0x24')]&&_0x2eaa9d[_0x83fb('0x25')]&&_0x2eaa9d[_0x83fb('0x26')]){var _0x198ff2=new _0x331313(_0x2eaa9d[_0x83fb('0x24')],_0x2eaa9d['authToken']);_0x198ff2['messages'][_0x83fb('0x27')]({'body':_0x59aa8a[_0x83fb('0x28')],'to':_0x83fb('0x29')+_0x59aa8a[_0x83fb('0x26')],'from':_0x83fb('0x29')+_0x2eaa9d[_0x83fb('0x26')],'statusCallback':_0x2eaa9d[_0x83fb('0x2a')]+_0x83fb('0x2b')+_0x59aa8a['id']+_0x83fb('0x2c')+_0x2eaa9d[_0x83fb('0x2d')]})[_0x83fb('0x1a')](function(_0x4418f6){if(_0x4418f6[_0x83fb('0x2e')]){return _0x396c2c[_0x83fb('0x1b')]({'messageId':_0x4418f6[_0x83fb('0x2e')]});}})[_0x83fb('0x1d')](function(_0x153485){logger[_0x83fb('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x83fb('0x2f'),_0x83fb('0x23'),util[_0x83fb('0x30')](_0x153485,{'showHidden':![],'depth':null}));});}else{logger[_0x83fb('0x1e')](_0x83fb('0x31'),_0x83fb('0x2f'),_0x83fb('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4fc395=_0x2eaa9d[_0x83fb('0x24')];var _0x5dc44c=_0x2eaa9d[_0x83fb('0x25')];var _0x22c2d8=_0x2eaa9d[_0x83fb('0x32')]+_0x83fb('0x33')+_0x4fc395+'/messages/';var _0x16a372={'to':[_0x59aa8a[_0x83fb('0x26')]],'message':{'type':_0x83fb('0x34'),'text':_0x59aa8a[_0x83fb('0x28')]}};var _0x3c4df8={'method':'POST','uri':_0x22c2d8,'headers':{'Authorization':_0x83fb('0x35')+_0x5dc44c,'Content-Type':_0x83fb('0x36')},'body':_0x16a372,'json':!![]};rp(_0x3c4df8)['then'](function(_0x4be198){if(_0x4be198[_0x83fb('0x37')][0x0][_0x83fb('0x38')]){return _0x396c2c['update']({'messageId':_0x4be198[_0x83fb('0x37')][0x0]['message_id']});}})[_0x83fb('0x1d')](function(_0x57c6cc){logger[_0x83fb('0x39')](_0x83fb('0x3a'),_0x57c6cc);});break;}}})[_0x83fb('0x3b')](function(){_0x43af66();});}else{_0x43af66();}}},'charset':_0x83fb('0x3c'),'collate':_0x83fb('0x3d')});}; \ No newline at end of file +var _0xbb53=['text','POST','Bearer\x20','application/json','message_id','statuses','err','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','out','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/'];(function(_0x38cef3,_0x3bcd63){var _0x4b79b4=function(_0x4cbf4a){while(--_0x4cbf4a){_0x38cef3['push'](_0x38cef3['shift']());}};_0x4b79b4(++_0x3bcd63);}(_0xbb53,0x1ea));var _0x3bb5=function(_0xb5556b,_0x3cb6e7){_0xb5556b=_0xb5556b-0x0;var _0x39c106=_0xbb53[_0xb5556b];return _0x39c106;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3bb5('0x0'))(_0x3bb5('0x1'));var moment=require('moment');var BPromise=require(_0x3bb5('0x2'));var rp=require('request-promise');var fetch=require(_0x3bb5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3bb5('0x4'));var config=require(_0x3bb5('0x5'));var attributes=require(_0x3bb5('0x6'));module[_0x3bb5('0x7')]=function(_0x5aefb5,_0xab315d){return _0x5aefb5['define'](_0x3bb5('0x8'),attributes,{'tableName':_0x3bb5('0x9'),'paranoid':![],'indexes':[{'name':_0x3bb5('0xa'),'fields':['messageId']},{'name':_0x3bb5('0xb'),'fields':[_0x3bb5('0xc')],'type':_0x3bb5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1577f9,_0x32793e,_0x2d58ea){var _0x3727d7=_0x5aefb5[_0x3bb5('0xe')];var _0x209bf7=_0x1577f9[_0x3bb5('0xf')]({'plain':!![]});if(_0x209bf7['direction'][_0x3bb5('0x10')]()==='in'||_0x209bf7[_0x3bb5('0x11')][_0x3bb5('0x10')]()==='out'&&!_0x209bf7[_0x3bb5('0x12')]&&!_[_0x3bb5('0x13')](_0x209bf7[_0x3bb5('0x14')])){_0x3727d7[_0x3bb5('0x15')][_0x3bb5('0x16')]({'where':{'id':_0x209bf7[_0x3bb5('0x17')]}})[_0x3bb5('0x18')](function(_0x5f4713){if(_0x5f4713){_0x5f4713[_0x3bb5('0x19')]({'lastMsgAt':_0x209bf7['createdAt'],'lastMsgDirection':_0x209bf7[_0x3bb5('0x11')][_0x3bb5('0x10')]()});}})[_0x3bb5('0x1a')](function(_0x308bcd){console['error'](_0x308bcd);});}if(_0x209bf7['direction']===_0x3bb5('0x1b')&&!_0x209bf7[_0x3bb5('0x12')]){var _0x18e51a;_0x3727d7['WhatsappAccount'][_0x3bb5('0x1c')]({'where':{'id':_0x209bf7[_0x3bb5('0x1d')]},'raw':!![]})[_0x3bb5('0x18')](function(_0x31eda6){_0x18e51a=_0x31eda6;if(_0x18e51a&&_0x18e51a[_0x3bb5('0x1e')]){switch(_0x18e51a[_0x3bb5('0x1e')]){case _0x3bb5('0x1f'):var _0x2d4e64=require(_0x3bb5('0x1f'));if(_0x18e51a['accountSid']&&_0x18e51a[_0x3bb5('0x20')]&&_0x18e51a[_0x3bb5('0x21')]){var _0x94e948=new _0x2d4e64(_0x18e51a[_0x3bb5('0x22')],_0x18e51a['authToken']);_0x94e948[_0x3bb5('0x23')]['create']({'body':_0x209bf7[_0x3bb5('0xc')],'to':_0x3bb5('0x24')+_0x209bf7[_0x3bb5('0x21')],'from':'whatsapp:'+_0x18e51a[_0x3bb5('0x21')],'statusCallback':_0x18e51a['remote']+_0x3bb5('0x25')+_0x209bf7['id']+_0x3bb5('0x26')+_0x18e51a[_0x3bb5('0x27')]})[_0x3bb5('0x18')](function(_0xf7b53b){if(_0xf7b53b[_0x3bb5('0x28')]){return _0x1577f9[_0x3bb5('0x19')]({'messageId':_0xf7b53b[_0x3bb5('0x28')]});}})[_0x3bb5('0x1a')](function(_0x20fc44){logger['error'](_0x3bb5('0x29'),_0x3bb5('0x2a'),_0x3bb5('0x1f'),util[_0x3bb5('0x2b')](_0x20fc44,{'showHidden':![],'depth':null}));});}else{logger[_0x3bb5('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3bb5('0x1f'),_0x3bb5('0x2d'));}break;case _0x3bb5('0x2e'):var _0x5979ee=_0x18e51a[_0x3bb5('0x22')];var _0x250fc6=_0x18e51a['authToken'];var _0x30a6f5=_0x18e51a[_0x3bb5('0x2f')]+_0x3bb5('0x30')+_0x5979ee+_0x3bb5('0x31');var _0x5d2554={'to':[_0x209bf7[_0x3bb5('0x21')]],'message':{'type':_0x3bb5('0x32'),'text':_0x209bf7[_0x3bb5('0xc')]}};var _0x2110de={'method':_0x3bb5('0x33'),'uri':_0x30a6f5,'headers':{'Authorization':_0x3bb5('0x34')+_0x250fc6,'Content-Type':_0x3bb5('0x35')},'body':_0x5d2554,'json':!![]};rp(_0x2110de)[_0x3bb5('0x18')](function(_0x3ab886){if(_0x3ab886['statuses'][0x0][_0x3bb5('0x36')]){return _0x1577f9[_0x3bb5('0x19')]({'messageId':_0x3ab886[_0x3bb5('0x37')][0x0]['message_id']});}})[_0x3bb5('0x1a')](function(_0x280223){logger[_0x3bb5('0x38')]('WhatsappMessage,\x20%s',_0x280223);});break;}}})[_0x3bb5('0x39')](function(){_0x2d58ea();});}else{_0x2d58ea();}}},'charset':_0x3bb5('0x3a'),'collate':_0x3bb5('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index b8cfd96..3b57d66 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 _0x0ac1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','WhatsappMessage','create','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1dff53,_0x19d083){var _0x448eae=function(_0x8fe120){while(--_0x8fe120){_0x1dff53['push'](_0x1dff53['shift']());}};_0x448eae(++_0x19d083);}(_0x0ac1,0xe1));var _0x10ac=function(_0x47ad3a,_0x2ffb92){_0x47ad3a=_0x47ad3a-0x0;var _0x2d1ccc=_0x0ac1[_0x47ad3a];return _0x2d1ccc;};'use strict';var _=require('lodash');var util=require(_0x10ac('0x0'));var moment=require(_0x10ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x10ac('0x2'));var fs=require('fs');var Redis=require(_0x10ac('0x3'));var db=require(_0x10ac('0x4'))['db'];var utils=require(_0x10ac('0x5'));var logger=require(_0x10ac('0x6'))(_0x10ac('0x7'));var config=require(_0x10ac('0x8'));var jayson=require(_0x10ac('0x9'));var client=jayson[_0x10ac('0xa')]['http']({'port':0x232a});config[_0x10ac('0xb')]=_['defaults'](config['redis'],{'host':_0x10ac('0xc'),'port':0x18eb});var socket=require(_0x10ac('0xd'))(new Redis(config['redis']));require(_0x10ac('0xe'))[_0x10ac('0xf')](socket);function respondWithRpcPromise(_0x3a8878,_0x2abff0,_0x2d2e6a){return new BPromise(function(_0x4c5ae5,_0x33a3b4){return client[_0x10ac('0x10')](_0x3a8878,_0x2d2e6a)[_0x10ac('0x11')](function(_0x12e94b){logger[_0x10ac('0x12')](_0x10ac('0x13'),_0x2abff0,_0x10ac('0x14'));logger[_0x10ac('0x15')](_0x10ac('0x16'),_0x2abff0,_0x10ac('0x14'),JSON['stringify'](_0x12e94b));if(_0x12e94b[_0x10ac('0x17')]){if(_0x12e94b[_0x10ac('0x17')][_0x10ac('0x18')]===0x1f4){logger[_0x10ac('0x17')](_0x10ac('0x13'),_0x2abff0,_0x12e94b[_0x10ac('0x17')]['message']);return _0x33a3b4(_0x12e94b[_0x10ac('0x17')][_0x10ac('0x19')]);}logger[_0x10ac('0x17')](_0x10ac('0x13'),_0x2abff0,_0x12e94b[_0x10ac('0x17')][_0x10ac('0x19')]);return _0x4c5ae5(_0x12e94b[_0x10ac('0x17')][_0x10ac('0x19')]);}else{logger[_0x10ac('0x12')](_0x10ac('0x13'),_0x2abff0,_0x10ac('0x14'));_0x4c5ae5(_0x12e94b[_0x10ac('0x1a')][_0x10ac('0x19')]);}})[_0x10ac('0x1b')](function(_0x3a6945){logger['error'](_0x10ac('0x13'),_0x2abff0,_0x3a6945);_0x33a3b4(_0x3a6945);});});}exports['CreateWhatsappMessage']=function(_0x14f429){var _0x3fca23=this;return new Promise(function(_0x55069f,_0x6e0ae8){return db[_0x10ac('0x1c')][_0x10ac('0x1d')](_0x14f429['body'],{'raw':_0x14f429[_0x10ac('0x1e')]?_0x14f429['options'][_0x10ac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x34767c){logger[_0x10ac('0x12')]('CreateWhatsappMessage',_0x14f429);logger[_0x10ac('0x15')]('CreateWhatsappMessage',_0x14f429,JSON[_0x10ac('0x20')](_0x34767c));_0x55069f(_0x34767c);})['catch'](function(_0x3c7be5){logger[_0x10ac('0x17')]('CreateWhatsappMessage',_0x3c7be5[_0x10ac('0x19')],_0x14f429);_0x6e0ae8(_0x3fca23['error'](0x1f4,_0x3c7be5['message']));});});}; \ No newline at end of file +var _0x2900=['then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappMessage','options','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request'];(function(_0x1aefae,_0x45a7fa){var _0x292f09=function(_0x57526a){while(--_0x57526a){_0x1aefae['push'](_0x1aefae['shift']());}};_0x292f09(++_0x45a7fa);}(_0x2900,0x94));var _0x0290=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x2900[_0x22868f];return _0x97bc75;};'use strict';var _=require(_0x0290('0x0'));var util=require('util');var moment=require(_0x0290('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0290('0x2'));var db=require(_0x0290('0x3'))['db'];var utils=require(_0x0290('0x4'));var logger=require('../../config/logger')(_0x0290('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0290('0x6')][_0x0290('0x7')]({'port':0x232a});config['redis']=_[_0x0290('0x8')](config['redis'],{'host':_0x0290('0x9'),'port':0x18eb});var socket=require(_0x0290('0xa'))(new Redis(config['redis']));require(_0x0290('0xb'))[_0x0290('0xc')](socket);function respondWithRpcPromise(_0xd1e37f,_0x21fb1d,_0x16c0f9){return new BPromise(function(_0x57413d,_0x1c2a48){return client[_0x0290('0xd')](_0xd1e37f,_0x16c0f9)[_0x0290('0xe')](function(_0x398d99){logger[_0x0290('0xf')](_0x0290('0x10'),_0x21fb1d,_0x0290('0x11'));logger[_0x0290('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x21fb1d,_0x0290('0x11'),JSON[_0x0290('0x13')](_0x398d99));if(_0x398d99[_0x0290('0x14')]){if(_0x398d99[_0x0290('0x14')][_0x0290('0x15')]===0x1f4){logger['error'](_0x0290('0x10'),_0x21fb1d,_0x398d99[_0x0290('0x14')][_0x0290('0x16')]);return _0x1c2a48(_0x398d99[_0x0290('0x14')][_0x0290('0x16')]);}logger[_0x0290('0x14')](_0x0290('0x10'),_0x21fb1d,_0x398d99['error'][_0x0290('0x16')]);return _0x57413d(_0x398d99[_0x0290('0x14')][_0x0290('0x16')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x21fb1d,_0x0290('0x11'));_0x57413d(_0x398d99[_0x0290('0x17')][_0x0290('0x16')]);}})[_0x0290('0x18')](function(_0x8890bc){logger[_0x0290('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x21fb1d,_0x8890bc);_0x1c2a48(_0x8890bc);});});}exports[_0x0290('0x19')]=function(_0x3ac9c0){var _0x1cf9dd=this;return new Promise(function(_0x3158df,_0x531c88){return db['WhatsappMessage']['create'](_0x3ac9c0['body'],{'raw':_0x3ac9c0[_0x0290('0x1a')]?_0x3ac9c0[_0x0290('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0290('0xe')](function(_0x2f09e2){logger[_0x0290('0xf')](_0x0290('0x19'),_0x3ac9c0);logger[_0x0290('0x12')](_0x0290('0x19'),_0x3ac9c0,JSON[_0x0290('0x13')](_0x2f09e2));_0x3158df(_0x2f09e2);})[_0x0290('0x18')](function(_0x473f62){logger[_0x0290('0x14')](_0x0290('0x19'),_0x473f62[_0x0290('0x16')],_0x3ac9c0);_0x531c88(_0x1cf9dd[_0x0290('0x14')](0x1f4,_0x473f62[_0x0290('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 0651efa..cef6ad3 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 _0x700e=['remove','emit','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x333f33,_0x4daa1f){var _0x135acd=function(_0x433212){while(--_0x433212){_0x333f33['push'](_0x333f33['shift']());}};_0x135acd(++_0x4daa1f);}(_0x700e,0x11d));var _0xe700=function(_0x333991,_0xbb51a3){_0x333991=_0x333991-0x0;var _0x5287ec=_0x700e[_0x333991];return _0x5287ec;};'use strict';var WhatsappMessageEvents=require(_0xe700('0x0'));var events=[_0xe700('0x1'),_0xe700('0x2'),'update'];function createListener(_0x35a8aa,_0x25a119){return function(_0x4ea411){_0x25a119[_0xe700('0x3')](_0x35a8aa,_0x4ea411);};}function removeListener(_0x133f73,_0x3a24e7){return function(){WhatsappMessageEvents['removeListener'](_0x133f73,_0x3a24e7);};}exports[_0xe700('0x4')]=function(_0x1d6081){for(var _0x25fff6=0x0,_0x8beab5=events[_0xe700('0x5')];_0x25fff6<_0x8beab5;_0x25fff6++){var _0x3bf05a=events[_0x25fff6];var _0x5022c7=createListener(_0xe700('0x6')+_0x3bf05a,_0x1d6081);WhatsappMessageEvents['on'](_0x3bf05a,_0x5022c7);}}; \ No newline at end of file +var _0x626d=['length','whatsappMessage:','save','remove','emit','removeListener'];(function(_0x4a8cd2,_0xc0f6f3){var _0x1022ba=function(_0x3082bc){while(--_0x3082bc){_0x4a8cd2['push'](_0x4a8cd2['shift']());}};_0x1022ba(++_0xc0f6f3);}(_0x626d,0x1d0));var _0xd626=function(_0x176189,_0x28d57b){_0x176189=_0x176189-0x0;var _0x475624=_0x626d[_0x176189];return _0x475624;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xd626('0x0'),_0xd626('0x1'),'update'];function createListener(_0x56f229,_0x5d0ae1){return function(_0x4a018e){_0x5d0ae1[_0xd626('0x2')](_0x56f229,_0x4a018e);};}function removeListener(_0x110c03,_0x2e51be){return function(){WhatsappMessageEvents[_0xd626('0x3')](_0x110c03,_0x2e51be);};}exports['register']=function(_0x1b217d){for(var _0x1b624d=0x0,_0x5716a0=events[_0xd626('0x4')];_0x1b624d<_0x5716a0;_0x1b624d++){var _0x350e9f=events[_0x1b624d];var _0x2e82d3=createListener(_0xd626('0x5')+_0x350e9f,_0x1b217d);WhatsappMessageEvents['on'](_0x350e9f,_0x2e82d3);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index f773209..fae7264 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 _0xe0ef=['/:id/users','getAgents','post','addTeams','put','/:id','delete','destroy','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','describe','get','show','getMembers','/:id/teams','getTeams'];(function(_0x4ca922,_0x11f8d6){var _0x3feb75=function(_0x4e8db2){while(--_0x4e8db2){_0x4ca922['push'](_0x4ca922['shift']());}};_0x3feb75(++_0x11f8d6);}(_0xe0ef,0x183));var _0xfe0e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe0ef[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xfe0e('0x0'));var util=require(_0xfe0e('0x1'));var path=require(_0xfe0e('0x2'));var timeout=require(_0xfe0e('0x3'));var express=require('express');var router=express[_0xfe0e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfe0e('0x5'));var interaction=require(_0xfe0e('0x6'));var config=require(_0xfe0e('0x7'));var controller=require(_0xfe0e('0x8'));router['get']('/',auth[_0xfe0e('0x9')](),controller[_0xfe0e('0xa')]);router['get'](_0xfe0e('0xb'),auth[_0xfe0e('0x9')](),controller[_0xfe0e('0xc')]);router[_0xfe0e('0xd')]('/:id',auth[_0xfe0e('0x9')](),controller[_0xfe0e('0xe')]);router[_0xfe0e('0xd')]('/:id/members',auth[_0xfe0e('0x9')](),controller[_0xfe0e('0xf')]);router[_0xfe0e('0xd')](_0xfe0e('0x10'),auth['isAuthenticated'](),controller[_0xfe0e('0x11')]);router[_0xfe0e('0xd')](_0xfe0e('0x12'),auth[_0xfe0e('0x9')](),controller[_0xfe0e('0x13')]);router[_0xfe0e('0x14')]('/',auth[_0xfe0e('0x9')](),controller['create']);router[_0xfe0e('0x14')](_0xfe0e('0x10'),auth['isAuthenticated'](),controller[_0xfe0e('0x15')]);router[_0xfe0e('0x14')](_0xfe0e('0x12'),auth[_0xfe0e('0x9')](),controller['addAgents']);router[_0xfe0e('0x16')](_0xfe0e('0x17'),auth[_0xfe0e('0x9')](),controller['update']);router[_0xfe0e('0x18')](_0xfe0e('0x17'),auth['isAuthenticated'](),controller[_0xfe0e('0x19')]);router[_0xfe0e('0x18')](_0xfe0e('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xfe0e('0x18')](_0xfe0e('0x12'),auth[_0xfe0e('0x9')](),controller[_0xfe0e('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x08ca=['update','delete','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x08ca,0xf5));var _0xa08c=function(_0x1edf2a,_0x55c423){_0x1edf2a=_0x1edf2a-0x0;var _0x5698f0=_0x08ca[_0x1edf2a];return _0x5698f0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa08c('0x0')]();var fs_extra=require(_0xa08c('0x1'));var auth=require(_0xa08c('0x2'));var interaction=require(_0xa08c('0x3'));var config=require('../../config/environment');var controller=require(_0xa08c('0x4'));router[_0xa08c('0x5')]('/',auth[_0xa08c('0x6')](),controller[_0xa08c('0x7')]);router[_0xa08c('0x5')]('/describe',auth[_0xa08c('0x6')](),controller['describe']);router[_0xa08c('0x5')](_0xa08c('0x8'),auth[_0xa08c('0x6')](),controller[_0xa08c('0x9')]);router[_0xa08c('0x5')](_0xa08c('0xa'),auth['isAuthenticated'](),controller[_0xa08c('0xb')]);router[_0xa08c('0x5')](_0xa08c('0xc'),auth['isAuthenticated'](),controller[_0xa08c('0xd')]);router['get'](_0xa08c('0xe'),auth[_0xa08c('0x6')](),controller[_0xa08c('0xf')]);router[_0xa08c('0x10')]('/',auth[_0xa08c('0x6')](),controller['create']);router[_0xa08c('0x10')](_0xa08c('0xc'),auth[_0xa08c('0x6')](),controller[_0xa08c('0x11')]);router[_0xa08c('0x10')]('/:id/users',auth[_0xa08c('0x6')](),controller[_0xa08c('0x12')]);router['put'](_0xa08c('0x8'),auth[_0xa08c('0x6')](),controller[_0xa08c('0x13')]);router[_0xa08c('0x14')]('/:id',auth[_0xa08c('0x6')](),controller['destroy']);router[_0xa08c('0x14')](_0xa08c('0xc'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xa08c('0x14')]('/:id/users',auth[_0xa08c('0x6')](),controller['removeAgents']);module[_0xa08c('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a8d078d..60dd3ce 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 _0xe205=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0xe205,0xa7));var _0x5e20=function(_0x24e1ca,_0x4ed24e){_0x24e1ca=_0x24e1ca-0x0;var _0x2f37d2=_0xe205[_0x24e1ca];return _0x2f37d2;};'use strict';var Sequelize=require(_0x5e20('0x0'));module[_0x5e20('0x1')]={'name':{'type':Sequelize[_0x5e20('0x2')],'unique':_0x5e20('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5e20('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5e20('0x5')](_0x5e20('0x6'),_0x5e20('0x7'),_0x5e20('0x8'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa25c=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x3ca4ad,_0x198733){var _0x2ad230=function(_0xbc0c39){while(--_0xbc0c39){_0x3ca4ad['push'](_0x3ca4ad['shift']());}};_0x2ad230(++_0x198733);}(_0xa25c,0x13f));var _0xca25=function(_0x10b95c,_0x134f5a){_0x10b95c=_0x10b95c-0x0;var _0x53fbf8=_0xa25c[_0x10b95c];return _0x53fbf8;};'use strict';var Sequelize=require('sequelize');module[_0xca25('0x0')]={'name':{'type':Sequelize[_0xca25('0x1')],'unique':_0xca25('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xca25('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca25('0x4')](_0xca25('0x5'),_0xca25('0x6'),_0xca25('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index bbe097c..5a6347e 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 _0xa96f=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','where','WhatsappQueue','include','query','findAll','rows','show','params','model','keys','filters','intersection','attributes','fields','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','WhatsappQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','sort','pick','WhatsappQueueId','merge','map','filter','User','findAndCountAll','agent','whatsappPause','updatedAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','sequelize','each','UserWhatsappQueue','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end'];(function(_0x1d2e88,_0x410d1d){var _0x42794b=function(_0x292a66){while(--_0x292a66){_0x1d2e88['push'](_0x1d2e88['shift']());}};_0x42794b(++_0x410d1d);}(_0xa96f,0x1d9));var _0xfa96=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0xa96f[_0x55fb83];return _0x59a87a;};'use strict';var BPromise=require('bluebird');var util=require(_0xfa96('0x0'));var _=require('lodash');var squel=require(_0xfa96('0x1'));var Redis=require('ioredis');var qs=require(_0xfa96('0x2'));var logger=require(_0xfa96('0x3'))(_0xfa96('0x4'));var config=require(_0xfa96('0x5'));var db=require('../../mysqldb')['db'];config[_0xfa96('0x6')]=_[_0xfa96('0x7')](config[_0xfa96('0x6')],{'host':_0xfa96('0x8'),'port':0x18eb});var socket=require(_0xfa96('0x9'))(new Redis(config[_0xfa96('0x6')]));require(_0xfa96('0xa'))[_0xfa96('0xb')](socket);function respondWithStatusCode(_0x267482,_0x5259c7){_0x5259c7=_0x5259c7||0xcc;return function(_0x303b05){if(_0x303b05){return _0x267482[_0xfa96('0xc')](_0x5259c7);}return _0x267482[_0xfa96('0xd')](_0x5259c7)[_0xfa96('0xe')]();};}function respondWithResult(_0xd1c0b1,_0x48fecc){_0x48fecc=_0x48fecc||0xc8;return function(_0x9637da){if(_0x9637da){return _0xd1c0b1[_0xfa96('0xd')](_0x48fecc)[_0xfa96('0xf')](_0x9637da);}};}function respondWithFilteredResult(_0x32c92c,_0xc60373){return function(_0x23b965){if(_0x23b965){var _0xa83d1=typeof _0xc60373[_0xfa96('0x10')]===_0xfa96('0x11')&&typeof _0xc60373[_0xfa96('0x12')]==='undefined';var _0x2d97dd=_0x23b965[_0xfa96('0x13')];var _0x21bc2f=_0xa83d1?0x0:_0xc60373['offset'];var _0x21c8ca=_0xa83d1?_0x23b965[_0xfa96('0x13')]:_0xc60373['offset']+_0xc60373[_0xfa96('0x12')];var _0x213de8;if(_0x21c8ca>=_0x2d97dd){_0x21c8ca=_0x2d97dd;_0x213de8=0xc8;}else{_0x213de8=0xce;}_0x32c92c[_0xfa96('0xd')](_0x213de8);return _0x32c92c[_0xfa96('0x14')](_0xfa96('0x15'),_0x21bc2f+'-'+_0x21c8ca+'/'+_0x2d97dd)[_0xfa96('0xf')](_0x23b965);}return null;};}function saveUpdates(_0x486eca){return function(_0xa71321){if(_0xa71321){return _0xa71321[_0xfa96('0x16')](_0x486eca)[_0xfa96('0x17')](function(_0x135837){return _0x135837;});}return null;};}function removeEntity(_0x5ac979){return function(_0x28df63){if(_0x28df63){return _0x28df63[_0xfa96('0x18')]()[_0xfa96('0x17')](function(){var _0x54577d=_0x28df63['get']({'plain':!![]});var _0xa8e851='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xa8e851,'resourceId':_0x54577d['id']}})[_0xfa96('0x17')](function(){return _0x28df63;});})[_0xfa96('0x17')](function(){_0x5ac979[_0xfa96('0xd')](0xcc)[_0xfa96('0xe')]();});}};}function handleEntityNotFound(_0x37df4a){return function(_0x397c99){if(!_0x397c99){_0x37df4a[_0xfa96('0xc')](0x194);}return _0x397c99;};}function handleError(_0x452a79,_0x173afb){_0x173afb=_0x173afb||0x1f4;return function(_0x3c6ca7){logger[_0xfa96('0x19')](_0x3c6ca7[_0xfa96('0x1a')]);if(_0x3c6ca7[_0xfa96('0x1b')]){delete _0x3c6ca7[_0xfa96('0x1b')];}_0x452a79[_0xfa96('0xd')](_0x173afb)[_0xfa96('0x1c')](_0x3c6ca7);};}exports[_0xfa96('0x1d')]=function(_0x1f1faa,_0x2f014c){var _0x59b228={};var _0xd88a7c={'count':0x0,'rows':[]};var _0x22b3ce=_['map'](db['WhatsappQueue'][_0xfa96('0x1e')],function(_0x52cc69){return{'name':_0x52cc69[_0xfa96('0x1f')],'type':_0x52cc69[_0xfa96('0x20')][_0xfa96('0x21')]};});_0x59b228=qs['getOptions'](_0x22b3ce,_0x1f1faa);var _0x41b8f3={'where':_0x59b228[_0xfa96('0x22')]};return db[_0xfa96('0x23')]['count'](_0x41b8f3)[_0xfa96('0x17')](function(_0x796d83){_0xd88a7c[_0xfa96('0x13')]=_0x796d83;_0x59b228[_0xfa96('0x24')]=qs[_0xfa96('0x24')](_0x1f1faa[_0xfa96('0x25')]);return db[_0xfa96('0x23')][_0xfa96('0x26')](_0x59b228);})[_0xfa96('0x17')](function(_0x130cae){_0xd88a7c[_0xfa96('0x27')]=_0x130cae;return _0xd88a7c;})[_0xfa96('0x17')](respondWithFilteredResult(_0x2f014c,_0x59b228))['catch'](handleError(_0x2f014c,null));};exports[_0xfa96('0x28')]=function(_0x3144ab,_0x39e5ff){var _0x21c1d2={'raw':!![],'where':{'id':_0x3144ab[_0xfa96('0x29')]['id']}},_0x2f8911={};_0x2f8911[_0xfa96('0x2a')]=_[_0xfa96('0x2b')](db[_0xfa96('0x23')]['rawAttributes']);_0x2f8911[_0xfa96('0x25')]=_[_0xfa96('0x2b')](_0x3144ab[_0xfa96('0x25')]);_0x2f8911[_0xfa96('0x2c')]=_[_0xfa96('0x2d')](_0x2f8911[_0xfa96('0x2a')],_0x2f8911[_0xfa96('0x25')]);_0x21c1d2[_0xfa96('0x2e')]=_[_0xfa96('0x2d')](_0x2f8911[_0xfa96('0x2a')],qs[_0xfa96('0x2f')](_0x3144ab[_0xfa96('0x25')][_0xfa96('0x2f')]));_0x21c1d2[_0xfa96('0x2e')]=_0x21c1d2['attributes'][_0xfa96('0x30')]?_0x21c1d2[_0xfa96('0x2e')]:_0x2f8911[_0xfa96('0x2a')];if(_0x3144ab[_0xfa96('0x25')]['includeAll']){_0x21c1d2[_0xfa96('0x24')]=[{'all':!![]}];}_0x21c1d2=_['merge']({},_0x21c1d2,_0x3144ab[_0xfa96('0x31')]);return db[_0xfa96('0x23')][_0xfa96('0x32')](_0x21c1d2)[_0xfa96('0x17')](handleEntityNotFound(_0x39e5ff,null))[_0xfa96('0x17')](respondWithResult(_0x39e5ff,null))[_0xfa96('0x33')](handleError(_0x39e5ff,null));};exports[_0xfa96('0x34')]=function(_0x362a59,_0xb8025){return db['WhatsappQueue'][_0xfa96('0x34')](_0x362a59[_0xfa96('0x35')],{})[_0xfa96('0x17')](function(_0x59d1bf){var _0x1b7441=_0x362a59[_0xfa96('0x36')]['get']({'plain':!![]});if(!_0x1b7441)throw new Error(_0xfa96('0x37'));if(_0x1b7441['role']===_0xfa96('0x36')){var _0xa87c14=_0x59d1bf[_0xfa96('0x38')]({'plain':!![]});var _0x5335c9=_0xfa96('0x39');return db['UserProfileSection'][_0xfa96('0x32')]({'where':{'name':_0x5335c9,'userProfileId':_0x1b7441[_0xfa96('0x3a')]},'raw':!![]})[_0xfa96('0x17')](function(_0x261658){if(_0x261658&&_0x261658[_0xfa96('0x3b')]===0x0){return db[_0xfa96('0x3c')][_0xfa96('0x34')]({'name':_0xa87c14[_0xfa96('0x1b')],'resourceId':_0xa87c14['id'],'type':_0x261658['name'],'sectionId':_0x261658['id']},{})[_0xfa96('0x17')](function(){return _0x59d1bf;});}else{return _0x59d1bf;}})['catch'](function(_0x4002c7){logger[_0xfa96('0x19')](_0xfa96('0x3d'),_0x4002c7);throw _0x4002c7;});}return _0x59d1bf;})['then'](respondWithResult(_0xb8025,0xc9))[_0xfa96('0x33')](handleError(_0xb8025,null));};exports['update']=function(_0x48f62b,_0x247f66){if(_0x48f62b[_0xfa96('0x35')]['id']){delete _0x48f62b[_0xfa96('0x35')]['id'];}return db[_0xfa96('0x23')][_0xfa96('0x32')]({'where':{'id':_0x48f62b[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x247f66,null))['then'](saveUpdates(_0x48f62b[_0xfa96('0x35')],null))['then'](respondWithResult(_0x247f66,null))[_0xfa96('0x33')](handleError(_0x247f66,null));};exports[_0xfa96('0x18')]=function(_0x341eca,_0x3ab6af){return db[_0xfa96('0x23')][_0xfa96('0x32')]({'where':{'id':_0x341eca[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x3ab6af,null))[_0xfa96('0x17')](removeEntity(_0x3ab6af,null))[_0xfa96('0x33')](handleError(_0x3ab6af,null));};exports['describe']=function(_0x5e0584,_0x46147f){return db[_0xfa96('0x23')][_0xfa96('0x3e')]()[_0xfa96('0x17')](respondWithResult(_0x46147f,null))[_0xfa96('0x33')](handleError(_0x46147f,null));};exports[_0xfa96('0x3f')]=function(_0x52af76,_0x43dbd9){var _0x19f7e1={'raw':!![],'where':{}},_0x3d3cb1={},_0x44296d;return db[_0xfa96('0x23')][_0xfa96('0x40')]({'where':{'id':_0x52af76['params']['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x43dbd9,null))[_0xfa96('0x17')](function(_0x3b2975){if(_0x3b2975){_0x44296d=_0x3b2975['get']({'plain':!![]});_0x3d3cb1[_0xfa96('0x2a')]=_[_0xfa96('0x2b')](db['UserWhatsappQueue'][_0xfa96('0x1e')]);_0x3d3cb1[_0xfa96('0x25')]=_[_0xfa96('0x2b')](_0x52af76[_0xfa96('0x25')]);_0x3d3cb1[_0xfa96('0x2c')]=_['intersection'](_0x3d3cb1[_0xfa96('0x2a')],_0x3d3cb1[_0xfa96('0x25')]);_0x19f7e1[_0xfa96('0x2e')]=_['intersection'](_0x3d3cb1[_0xfa96('0x2a')],qs[_0xfa96('0x2f')](_0x52af76['query']['fields']));_0x19f7e1[_0xfa96('0x2e')]=_0x19f7e1[_0xfa96('0x2e')][_0xfa96('0x30')]?_0x19f7e1[_0xfa96('0x2e')]:_0x3d3cb1[_0xfa96('0x2a')];if(!_0x52af76[_0xfa96('0x25')][_0xfa96('0x41')](_0xfa96('0x42'))){_0x19f7e1[_0xfa96('0x12')]=qs[_0xfa96('0x12')](_0x52af76[_0xfa96('0x25')][_0xfa96('0x12')]);_0x19f7e1['offset']=qs[_0xfa96('0x10')](_0x52af76[_0xfa96('0x25')]['offset']);}_0x19f7e1['order']=qs[_0xfa96('0x43')](_0x52af76['query'][_0xfa96('0x43')]);_0x19f7e1[_0xfa96('0x22')]=qs[_0xfa96('0x2c')](_[_0xfa96('0x44')](_0x52af76[_0xfa96('0x25')],_0x3d3cb1[_0xfa96('0x2c')]));_0x19f7e1[_0xfa96('0x22')][_0xfa96('0x45')]=_0x3b2975['id'];if(_0x52af76[_0xfa96('0x25')]['filter']){_0x19f7e1[_0xfa96('0x22')]=_[_0xfa96('0x46')](_0x19f7e1[_0xfa96('0x22')],{'$or':_[_0xfa96('0x47')](_0x19f7e1[_0xfa96('0x2e')],function(_0x3e8c8b){var _0x39585b={};_0x39585b[_0x3e8c8b]={'$like':'%'+_0x52af76[_0xfa96('0x25')][_0xfa96('0x48')]+'%'};return _0x39585b;})});}_0x19f7e1=_[_0xfa96('0x46')]({},_0x19f7e1,_0x52af76['options']);return db['UserWhatsappQueue'][_0xfa96('0x26')](_0x19f7e1);}})[_0xfa96('0x17')](function(_0x1563c8){if(_0x1563c8){return db[_0xfa96('0x49')][_0xfa96('0x4a')]({'where':{'id':_[_0xfa96('0x47')](_0x1563c8,'UserId'),'role':_0xfa96('0x4b')},'attributes':['id',_0xfa96('0x1b'),_0xfa96('0x4c'),_0xfa96('0x4d'),'createdAt']});}})['then'](function(_0x2827c7){if(_0x2827c7){return{'count':_0x2827c7['count'],'rows':_[_0xfa96('0x47')](_0x2827c7[_0xfa96('0x27')],function(_0x1f1e42){return{'membername':_0x1f1e42[_0xfa96('0x1b')],'UserId':_0x1f1e42['id'],'queue_name':_0x44296d[_0xfa96('0x1b')],'WhatsappQueueId':_0x44296d['id'],'interface':util[_0xfa96('0x4e')](_0xfa96('0x4f'),_0xfa96('0x50'),_0x1f1e42[_0xfa96('0x1b')]),'penalty':0x0,'paused':_0x1f1e42['whatsappPause'],'createdAt':_0x1f1e42['createdAt'],'updatedAt':_0x1f1e42[_0xfa96('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfa96('0x17')](respondWithFilteredResult(_0x43dbd9,_0x19f7e1))[_0xfa96('0x33')](handleError(_0x43dbd9,null));};exports[_0xfa96('0x51')]=function(_0x36bec3,_0x4812e6){var _0x1292ca={};var _0x332278={};var _0x480e00;var _0xd22f31;return db[_0xfa96('0x23')][_0xfa96('0x40')]({'where':{'id':_0x36bec3[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x4812e6,null))[_0xfa96('0x17')](function(_0x13c1b2){if(_0x13c1b2){_0x480e00=_0x13c1b2;_0x332278[_0xfa96('0x2a')]=_[_0xfa96('0x2b')](db[_0xfa96('0x52')][_0xfa96('0x1e')]);_0x332278[_0xfa96('0x25')]=_[_0xfa96('0x2b')](_0x36bec3[_0xfa96('0x25')]);_0x332278[_0xfa96('0x2c')]=_[_0xfa96('0x2d')](_0x332278[_0xfa96('0x2a')],_0x332278['query']);_0x1292ca[_0xfa96('0x2e')]=_[_0xfa96('0x2d')](_0x332278[_0xfa96('0x2a')],qs['fields'](_0x36bec3[_0xfa96('0x25')][_0xfa96('0x2f')]));_0x1292ca[_0xfa96('0x2e')]=_0x1292ca['attributes'][_0xfa96('0x30')]?_0x1292ca[_0xfa96('0x2e')]:_0x332278[_0xfa96('0x2a')];_0x1292ca[_0xfa96('0x53')]=qs[_0xfa96('0x43')](_0x36bec3[_0xfa96('0x25')][_0xfa96('0x43')]);_0x1292ca[_0xfa96('0x22')]=qs['filters'](_[_0xfa96('0x44')](_0x36bec3[_0xfa96('0x25')],_0x332278[_0xfa96('0x2c')]));if(_0x36bec3[_0xfa96('0x25')]['filter']){_0x1292ca[_0xfa96('0x22')]=_[_0xfa96('0x46')](_0x1292ca[_0xfa96('0x22')],{'$or':_['map'](_0x1292ca[_0xfa96('0x2e')],function(_0x56bc25){var _0x2a4da4={};_0x2a4da4[_0x56bc25]={'$like':'%'+_0x36bec3[_0xfa96('0x25')][_0xfa96('0x48')]+'%'};return _0x2a4da4;})});}_0x1292ca=_[_0xfa96('0x46')]({},_0x1292ca,_0x36bec3[_0xfa96('0x31')]);return _0x480e00['getTeams'](_0x1292ca);}})[_0xfa96('0x17')](function(_0x2fcd40){if(_0x2fcd40){_0xd22f31=_0x2fcd40[_0xfa96('0x30')];if(!_0x36bec3[_0xfa96('0x25')]['hasOwnProperty'](_0xfa96('0x42'))){_0x1292ca[_0xfa96('0x12')]=qs[_0xfa96('0x12')](_0x36bec3['query'][_0xfa96('0x12')]);_0x1292ca[_0xfa96('0x10')]=qs[_0xfa96('0x10')](_0x36bec3[_0xfa96('0x25')][_0xfa96('0x10')]);}return _0x480e00['getTeams'](_0x1292ca);}})[_0xfa96('0x17')](function(_0x22e0aa){if(_0x22e0aa){return _0x22e0aa?{'count':_0xd22f31,'rows':_0x22e0aa}:null;}})[_0xfa96('0x17')](respondWithResult(_0x4812e6,null))[_0xfa96('0x33')](handleError(_0x4812e6,null));};exports[_0xfa96('0x54')]=function(_0x4563e0,_0x51f463){var _0x590cfe=_0x4563e0['body'][_0xfa96('0x55')];return db[_0xfa96('0x52')][_0xfa96('0x26')]({'where':{'id':_0x590cfe},'attributes':['id'],'include':[{'model':db[_0xfa96('0x49')],'as':_0xfa96('0x56'),'attributes':['id',_0xfa96('0x1b'),_0xfa96('0x57'),_0xfa96('0x58'),'interface'],'raw':!![]}]})['then'](function(_0xd11789){if(_0xd11789){var _0x51a460=_['flatMap'](_0xd11789,function(_0x49f666){var _0xac5314=_0x49f666[_0xfa96('0x38')]({'plain':!![]});return _0xac5314[_0xfa96('0x56')];});return db[_0xfa96('0x23')][_0xfa96('0x32')]({'where':{'id':_0x4563e0[_0xfa96('0x29')]['id']}})['then'](function(_0xd7ef2c){return db[_0xfa96('0x59')]['transaction'](function(_0x406e29){return _0xd7ef2c[_0xfa96('0x54')](_0x590cfe,{'transaction':_0x406e29})[_0xfa96('0x17')](function(){return BPromise[_0xfa96('0x5a')](_0x51a460,function(_0x32771a){return db[_0xfa96('0x5b')]['findOrCreate']({'where':{'UserId':_0x32771a['id'],'WhatsappQueueId':_0x4563e0[_0xfa96('0x29')]['id']},'transaction':_0x406e29});});})[_0xfa96('0x17')](function(){_0x51a460[_0xfa96('0x5c')](function(_0x5d05d5){socket[_0xfa96('0x5d')](_0xfa96('0x5e'),{'UserId':_0x5d05d5['id'],'WhatsappQueueId':_0xd7ef2c['id']});});});});});}})[_0xfa96('0x17')](respondWithStatusCode(_0x51f463,null))['catch'](handleError(_0x51f463,null));};exports[_0xfa96('0x5f')]=function(_0x3c922b,_0x3634c3){return db[_0xfa96('0x52')]['findAll']({'where':{'id':_0x3c922b[_0xfa96('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfa96('0x49')],'as':_0xfa96('0x56'),'attributes':['id'],'raw':!![]}]})[_0xfa96('0x17')](handleEntityNotFound(_0x3634c3,null))[_0xfa96('0x17')](function(_0x9b75db){var _0x507bcb=_[_0xfa96('0x47')](_0x9b75db,'id');var _0x2d08cf=[];var _0x444e1e=[];var _0x2c2fa5=squel[_0xfa96('0x60')]();_0x2c2fa5[_0xfa96('0x61')](_0xfa96('0x62'))[_0xfa96('0x63')]('team_has_whatsapp_queues','tq')[_0xfa96('0x64')](_0xfa96('0x65'),'ut',_0xfa96('0x66'))['where']('WhatsappQueueId\x20=\x20?',_0x3c922b[_0xfa96('0x29')]['id']);for(var _0x1f4594=0x0;_0x1f4594<_0x9b75db[_0xfa96('0x30')];_0x1f4594+=0x1){let _0x5942e7=_0x9b75db[_0x1f4594];for(var _0x477f72=0x0;_0x477f72<_0x5942e7[_0xfa96('0x56')][_0xfa96('0x30')];_0x477f72+=0x1){let _0x174569=_0x5942e7[_0xfa96('0x56')][_0x477f72];var _0x533b6e=_0x2c2fa5[_0xfa96('0x67')]();_0x533b6e['where'](_0xfa96('0x68'),_0x174569['id']);_0x444e1e[_0xfa96('0x69')](db[_0xfa96('0x59')][_0xfa96('0x25')](_0x533b6e[_0xfa96('0x6a')](),{'type':db[_0xfa96('0x59')][_0xfa96('0x6b')][_0xfa96('0x6c')]})[_0xfa96('0x17')](function(_0x391794){if(_0x391794[_0xfa96('0x30')]===0x1){return _0x174569['id'];}else{var _0x1fe4aa=_['every'](_[_0xfa96('0x47')](_0x391794,_0xfa96('0x6d')),function(_0x3913c5){return _[_0xfa96('0x6e')](_0x507bcb,_0x3913c5);});if(_0x1fe4aa){return _0x174569['id'];}}}));}}return BPromise[_0xfa96('0x6f')](_0x444e1e)[_0xfa96('0x17')](function(_0x3a8b84){_0x2d08cf=_(_0x2d08cf)[_0xfa96('0x70')](_0x3a8b84)[_0xfa96('0x71')]()[_0xfa96('0x72')]();return db[_0xfa96('0x23')][_0xfa96('0x32')]({'where':{'id':_0x3c922b[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](function(_0x4aa869){return db['sequelize']['transaction'](function(_0x4cc4b6){return _0x4aa869['removeTeams'](_0x3c922b[_0xfa96('0x25')]['ids'],{'transaction':_0x4cc4b6})[_0xfa96('0x17')](function(){if(!_['isEmpty'](_0x2d08cf)){return _0x4aa869[_0xfa96('0x73')](_0x2d08cf,{'transaction':_0x4cc4b6});}})[_0xfa96('0x17')](function(){_0x2d08cf[_0xfa96('0x5c')](function(_0x4c0311){socket[_0xfa96('0x5d')](_0xfa96('0x74'),{'UserId':_0x4c0311,'WhatsappQueueId':_0x4aa869['id']});});});});});});})[_0xfa96('0x17')](respondWithStatusCode(_0x3634c3,null))[_0xfa96('0x33')](handleError(_0x3634c3,null));};exports[_0xfa96('0x75')]=function(_0x18b628,_0x242a16){return db[_0xfa96('0x23')][_0xfa96('0x32')]({'where':{'id':_0x18b628[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x242a16,null))[_0xfa96('0x17')](function(_0x578a79){if(_0x578a79){return _0x578a79[_0xfa96('0x75')](_0x18b628[_0xfa96('0x35')]['ids'],_[_0xfa96('0x76')](_0x18b628['body'],['ids','id'])||{})[_0xfa96('0x77')](function(_0x6f2259){for(var _0x41d447=0x0;_0x41d447<_0x18b628['body'][_0xfa96('0x55')]['length'];_0x41d447+=0x1){socket[_0xfa96('0x5d')](_0xfa96('0x5e'),{'UserId':Number(_0x18b628[_0xfa96('0x35')]['ids'][_0x41d447]),'WhatsappQueueId':Number(_0x18b628[_0xfa96('0x29')]['id'])});}return _0x6f2259;});}})[_0xfa96('0x17')](respondWithResult(_0x242a16,null))['catch'](handleError(_0x242a16,null));};exports[_0xfa96('0x73')]=function(_0x39355d,_0x196d2a){return db[_0xfa96('0x23')]['find']({'where':{'id':_0x39355d[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x196d2a,null))['then'](function(_0x31f3ec){if(_0x31f3ec){return _0x31f3ec['removeAgents'](_0x39355d[_0xfa96('0x25')]['ids'])['then'](function(){if(_[_0xfa96('0x78')](_0x39355d[_0xfa96('0x25')][_0xfa96('0x55')])){for(var _0x4d94cc=0x0;_0x4d94cc<_0x39355d['query'][_0xfa96('0x55')]['length'];_0x4d94cc+=0x1){socket['emit'](_0xfa96('0x74'),{'UserId':Number(_0x39355d[_0xfa96('0x25')]['ids'][_0x4d94cc]),'WhatsappQueueId':Number(_0x39355d[_0xfa96('0x29')]['id'])});}}else{socket[_0xfa96('0x5d')](_0xfa96('0x74'),{'UserId':Number(_0x39355d[_0xfa96('0x25')][_0xfa96('0x55')]),'WhatsappQueueId':Number(_0x39355d[_0xfa96('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x196d2a,null))[_0xfa96('0x33')](handleError(_0x196d2a,null));};exports[_0xfa96('0x79')]=function(_0x5f09e1,_0x2f1140){var _0x5be272={};var _0x614c70={};var _0x2b5cc4;var _0x5b9cc9;return db[_0xfa96('0x23')][_0xfa96('0x40')]({'where':{'id':_0x5f09e1[_0xfa96('0x29')]['id']}})[_0xfa96('0x17')](handleEntityNotFound(_0x2f1140,null))[_0xfa96('0x17')](function(_0x919676){if(_0x919676){_0x2b5cc4=_0x919676;_0x614c70['model']=_[_0xfa96('0x2b')](db[_0xfa96('0x49')][_0xfa96('0x1e')]);_0x614c70['query']=_['keys'](_0x5f09e1[_0xfa96('0x25')]);_0x614c70[_0xfa96('0x2c')]=_[_0xfa96('0x2d')](_0x614c70[_0xfa96('0x2a')],_0x614c70[_0xfa96('0x25')]);_0x5be272[_0xfa96('0x2e')]=_[_0xfa96('0x2d')](_0x614c70[_0xfa96('0x2a')],qs['fields'](_0x5f09e1[_0xfa96('0x25')]['fields']));_0x5be272[_0xfa96('0x2e')]=_0x5be272[_0xfa96('0x2e')][_0xfa96('0x30')]?_0x5be272[_0xfa96('0x2e')]:_0x614c70[_0xfa96('0x2a')];_0x5be272[_0xfa96('0x53')]=qs[_0xfa96('0x43')](_0x5f09e1['query'][_0xfa96('0x43')]);_0x5be272[_0xfa96('0x22')]=qs[_0xfa96('0x2c')](_['pick'](_0x5f09e1['query'],_0x614c70[_0xfa96('0x2c')]));if(_0x5f09e1['query'][_0xfa96('0x48')]){_0x5be272[_0xfa96('0x22')]=_[_0xfa96('0x46')](_0x5be272['where'],{'$or':_[_0xfa96('0x47')](_0x5be272[_0xfa96('0x2e')],function(_0x21963d){var _0x36f04c={};_0x36f04c[_0x21963d]={'$like':'%'+_0x5f09e1[_0xfa96('0x25')][_0xfa96('0x48')]+'%'};return _0x36f04c;})});}_0x5be272=_[_0xfa96('0x46')]({},_0x5be272,_0x5f09e1[_0xfa96('0x31')]);return _0x2b5cc4[_0xfa96('0x79')](_0x5be272);}})['then'](function(_0x23addb){if(_0x23addb){_0x5b9cc9=_0x23addb[_0xfa96('0x30')];if(!_0x5f09e1[_0xfa96('0x25')][_0xfa96('0x41')](_0xfa96('0x42'))){_0x5be272[_0xfa96('0x12')]=qs[_0xfa96('0x12')](_0x5f09e1[_0xfa96('0x25')][_0xfa96('0x12')]);_0x5be272[_0xfa96('0x10')]=qs['offset'](_0x5f09e1[_0xfa96('0x25')]['offset']);}return _0x2b5cc4['getAgents'](_0x5be272);}})[_0xfa96('0x17')](function(_0x4428d6){if(_0x4428d6){return _0x4428d6?{'count':_0x5b9cc9,'rows':_0x4428d6}:null;}})[_0xfa96('0x17')](respondWithResult(_0x2f1140,null))[_0xfa96('0x33')](handleError(_0x2f1140,null));}; \ No newline at end of file +var _0xd8b9=['isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','describe','getMembers','findOne','UserWhatsappQueue','sort','pick','filter','User','findAndCountAll','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','order','hasOwnProperty','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8b9,0x84));var _0x9d8b=function(_0x432903,_0x4b8388){_0x432903=_0x432903-0x0;var _0x250f81=_0xd8b9[_0x432903];return _0x250f81;};'use strict';var BPromise=require(_0x9d8b('0x0'));var util=require(_0x9d8b('0x1'));var _=require(_0x9d8b('0x2'));var squel=require(_0x9d8b('0x3'));var Redis=require(_0x9d8b('0x4'));var qs=require(_0x9d8b('0x5'));var logger=require('../../config/logger')(_0x9d8b('0x6'));var config=require(_0x9d8b('0x7'));var db=require(_0x9d8b('0x8'))['db'];config[_0x9d8b('0x9')]=_[_0x9d8b('0xa')](config['redis'],{'host':_0x9d8b('0xb'),'port':0x18eb});var socket=require(_0x9d8b('0xc'))(new Redis(config[_0x9d8b('0x9')]));require('./whatsappQueue.socket')[_0x9d8b('0xd')](socket);function respondWithStatusCode(_0xefdafd,_0x2da382){_0x2da382=_0x2da382||0xcc;return function(_0x3d288c){if(_0x3d288c){return _0xefdafd[_0x9d8b('0xe')](_0x2da382);}return _0xefdafd[_0x9d8b('0xf')](_0x2da382)[_0x9d8b('0x10')]();};}function respondWithResult(_0x4eb57a,_0x111752){_0x111752=_0x111752||0xc8;return function(_0x4ac08d){if(_0x4ac08d){return _0x4eb57a[_0x9d8b('0xf')](_0x111752)[_0x9d8b('0x11')](_0x4ac08d);}};}function respondWithFilteredResult(_0x29f091,_0x394208){return function(_0x581e14){if(_0x581e14){var _0x3a60f1=typeof _0x394208[_0x9d8b('0x12')]===_0x9d8b('0x13')&&typeof _0x394208[_0x9d8b('0x14')]===_0x9d8b('0x13');var _0x1ab606=_0x581e14[_0x9d8b('0x15')];var _0x48a421=_0x3a60f1?0x0:_0x394208[_0x9d8b('0x12')];var _0x12da87=_0x3a60f1?_0x581e14['count']:_0x394208[_0x9d8b('0x12')]+_0x394208['limit'];var _0x154df9;if(_0x12da87>=_0x1ab606){_0x12da87=_0x1ab606;_0x154df9=0xc8;}else{_0x154df9=0xce;}_0x29f091[_0x9d8b('0xf')](_0x154df9);return _0x29f091[_0x9d8b('0x16')]('Content-Range',_0x48a421+'-'+_0x12da87+'/'+_0x1ab606)[_0x9d8b('0x11')](_0x581e14);}return null;};}function saveUpdates(_0x858687){return function(_0x5d6a74){if(_0x5d6a74){return _0x5d6a74[_0x9d8b('0x17')](_0x858687)[_0x9d8b('0x18')](function(_0x17c5f6){return _0x17c5f6;});}return null;};}function removeEntity(_0x524a68){return function(_0x2b7652){if(_0x2b7652){return _0x2b7652[_0x9d8b('0x19')]()[_0x9d8b('0x18')](function(){var _0x323fe0=_0x2b7652[_0x9d8b('0x1a')]({'plain':!![]});var _0x220291=_0x9d8b('0x1b');return db[_0x9d8b('0x1c')]['destroy']({'where':{'type':_0x220291,'resourceId':_0x323fe0['id']}})[_0x9d8b('0x18')](function(){return _0x2b7652;});})[_0x9d8b('0x18')](function(){_0x524a68[_0x9d8b('0xf')](0xcc)[_0x9d8b('0x10')]();});}};}function handleEntityNotFound(_0x35bd7c){return function(_0x127b49){if(!_0x127b49){_0x35bd7c['sendStatus'](0x194);}return _0x127b49;};}function handleError(_0x1ae88c,_0x21df87){_0x21df87=_0x21df87||0x1f4;return function(_0x832458){logger[_0x9d8b('0x1d')](_0x832458[_0x9d8b('0x1e')]);if(_0x832458['name']){delete _0x832458[_0x9d8b('0x1f')];}_0x1ae88c[_0x9d8b('0xf')](_0x21df87)[_0x9d8b('0x20')](_0x832458);};}exports['index']=function(_0x3d0a78,_0x4777a2){var _0x3c22d8={};var _0x4f6453={'count':0x0,'rows':[]};var _0x5f4df7=_[_0x9d8b('0x21')](db[_0x9d8b('0x22')][_0x9d8b('0x23')],function(_0x8ca9f5){return{'name':_0x8ca9f5[_0x9d8b('0x24')],'type':_0x8ca9f5[_0x9d8b('0x25')][_0x9d8b('0x26')]};});_0x3c22d8=qs[_0x9d8b('0x27')](_0x5f4df7,_0x3d0a78);var _0x53b6c8={'where':_0x3c22d8[_0x9d8b('0x28')]};return db[_0x9d8b('0x22')][_0x9d8b('0x15')](_0x53b6c8)[_0x9d8b('0x18')](function(_0x30c304){_0x4f6453['count']=_0x30c304;_0x3c22d8['include']=qs[_0x9d8b('0x29')](_0x3d0a78[_0x9d8b('0x2a')]);return db['WhatsappQueue'][_0x9d8b('0x2b')](_0x3c22d8);})[_0x9d8b('0x18')](function(_0x55d3f2){_0x4f6453[_0x9d8b('0x2c')]=_0x55d3f2;return _0x4f6453;})[_0x9d8b('0x18')](respondWithFilteredResult(_0x4777a2,_0x3c22d8))[_0x9d8b('0x2d')](handleError(_0x4777a2,null));};exports['show']=function(_0x52afca,_0x5496bf){var _0x32105b={'raw':!![],'where':{'id':_0x52afca[_0x9d8b('0x2e')]['id']}},_0x2ea5bd={};_0x2ea5bd[_0x9d8b('0x2f')]=_[_0x9d8b('0x30')](db[_0x9d8b('0x22')][_0x9d8b('0x23')]);_0x2ea5bd[_0x9d8b('0x2a')]=_[_0x9d8b('0x30')](_0x52afca[_0x9d8b('0x2a')]);_0x2ea5bd[_0x9d8b('0x31')]=_[_0x9d8b('0x32')](_0x2ea5bd[_0x9d8b('0x2f')],_0x2ea5bd['query']);_0x32105b[_0x9d8b('0x33')]=_[_0x9d8b('0x32')](_0x2ea5bd[_0x9d8b('0x2f')],qs[_0x9d8b('0x34')](_0x52afca[_0x9d8b('0x2a')][_0x9d8b('0x34')]));_0x32105b[_0x9d8b('0x33')]=_0x32105b[_0x9d8b('0x33')][_0x9d8b('0x35')]?_0x32105b[_0x9d8b('0x33')]:_0x2ea5bd[_0x9d8b('0x2f')];if(_0x52afca[_0x9d8b('0x2a')][_0x9d8b('0x36')]){_0x32105b[_0x9d8b('0x29')]=[{'all':!![]}];}_0x32105b=_[_0x9d8b('0x37')]({},_0x32105b,_0x52afca[_0x9d8b('0x38')]);return db[_0x9d8b('0x22')][_0x9d8b('0x39')](_0x32105b)[_0x9d8b('0x18')](handleEntityNotFound(_0x5496bf,null))[_0x9d8b('0x18')](respondWithResult(_0x5496bf,null))[_0x9d8b('0x2d')](handleError(_0x5496bf,null));};exports[_0x9d8b('0x3a')]=function(_0x150788,_0x3e1243){return db[_0x9d8b('0x22')]['create'](_0x150788['body'],{})[_0x9d8b('0x18')](function(_0x50cc31){var _0x551648=_0x150788[_0x9d8b('0x3b')][_0x9d8b('0x1a')]({'plain':!![]});if(!_0x551648)throw new Error(_0x9d8b('0x3c'));if(_0x551648[_0x9d8b('0x3d')]===_0x9d8b('0x3b')){var _0x5d02bf=_0x50cc31['get']({'plain':!![]});var _0x3a8a04='WhatsappQueues';return db[_0x9d8b('0x3e')][_0x9d8b('0x39')]({'where':{'name':_0x3a8a04,'userProfileId':_0x551648[_0x9d8b('0x3f')]},'raw':!![]})[_0x9d8b('0x18')](function(_0x45f42b){if(_0x45f42b&&_0x45f42b['autoAssociation']===0x0){return db[_0x9d8b('0x1c')]['create']({'name':_0x5d02bf[_0x9d8b('0x1f')],'resourceId':_0x5d02bf['id'],'type':_0x45f42b[_0x9d8b('0x1f')],'sectionId':_0x45f42b['id']},{})['then'](function(){return _0x50cc31;});}else{return _0x50cc31;}})['catch'](function(_0x4a387c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a387c);throw _0x4a387c;});}return _0x50cc31;})[_0x9d8b('0x18')](respondWithResult(_0x3e1243,0xc9))[_0x9d8b('0x2d')](handleError(_0x3e1243,null));};exports['update']=function(_0x3786f2,_0x21f8a5){if(_0x3786f2['body']['id']){delete _0x3786f2['body']['id'];}return db[_0x9d8b('0x22')][_0x9d8b('0x39')]({'where':{'id':_0x3786f2['params']['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x21f8a5,null))[_0x9d8b('0x18')](saveUpdates(_0x3786f2[_0x9d8b('0x40')],null))['then'](respondWithResult(_0x21f8a5,null))['catch'](handleError(_0x21f8a5,null));};exports['destroy']=function(_0x2ae754,_0x3588eb){return db[_0x9d8b('0x22')]['find']({'where':{'id':_0x2ae754[_0x9d8b('0x2e')]['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x3588eb,null))[_0x9d8b('0x18')](removeEntity(_0x3588eb,null))[_0x9d8b('0x2d')](handleError(_0x3588eb,null));};exports[_0x9d8b('0x41')]=function(_0x482f08,_0x1f26be){return db[_0x9d8b('0x22')][_0x9d8b('0x41')]()[_0x9d8b('0x18')](respondWithResult(_0x1f26be,null))[_0x9d8b('0x2d')](handleError(_0x1f26be,null));};exports[_0x9d8b('0x42')]=function(_0x202481,_0x232b99){var _0x5ad79e={'raw':!![],'where':{}},_0x5159df={},_0x2707b7;return db[_0x9d8b('0x22')][_0x9d8b('0x43')]({'where':{'id':_0x202481[_0x9d8b('0x2e')]['id']}})['then'](handleEntityNotFound(_0x232b99,null))['then'](function(_0x5ef456){if(_0x5ef456){_0x2707b7=_0x5ef456[_0x9d8b('0x1a')]({'plain':!![]});_0x5159df[_0x9d8b('0x2f')]=_[_0x9d8b('0x30')](db[_0x9d8b('0x44')][_0x9d8b('0x23')]);_0x5159df['query']=_[_0x9d8b('0x30')](_0x202481['query']);_0x5159df[_0x9d8b('0x31')]=_[_0x9d8b('0x32')](_0x5159df['model'],_0x5159df[_0x9d8b('0x2a')]);_0x5ad79e[_0x9d8b('0x33')]=_['intersection'](_0x5159df['model'],qs[_0x9d8b('0x34')](_0x202481[_0x9d8b('0x2a')][_0x9d8b('0x34')]));_0x5ad79e['attributes']=_0x5ad79e[_0x9d8b('0x33')][_0x9d8b('0x35')]?_0x5ad79e[_0x9d8b('0x33')]:_0x5159df[_0x9d8b('0x2f')];if(!_0x202481[_0x9d8b('0x2a')]['hasOwnProperty']('nolimit')){_0x5ad79e[_0x9d8b('0x14')]=qs[_0x9d8b('0x14')](_0x202481[_0x9d8b('0x2a')][_0x9d8b('0x14')]);_0x5ad79e[_0x9d8b('0x12')]=qs[_0x9d8b('0x12')](_0x202481['query'][_0x9d8b('0x12')]);}_0x5ad79e['order']=qs[_0x9d8b('0x45')](_0x202481[_0x9d8b('0x2a')][_0x9d8b('0x45')]);_0x5ad79e['where']=qs[_0x9d8b('0x31')](_[_0x9d8b('0x46')](_0x202481[_0x9d8b('0x2a')],_0x5159df[_0x9d8b('0x31')]));_0x5ad79e['where']['WhatsappQueueId']=_0x5ef456['id'];if(_0x202481[_0x9d8b('0x2a')][_0x9d8b('0x47')]){_0x5ad79e[_0x9d8b('0x28')]=_[_0x9d8b('0x37')](_0x5ad79e[_0x9d8b('0x28')],{'$or':_['map'](_0x5ad79e[_0x9d8b('0x33')],function(_0x4b0217){var _0x4b0fda={};_0x4b0fda[_0x4b0217]={'$like':'%'+_0x202481[_0x9d8b('0x2a')][_0x9d8b('0x47')]+'%'};return _0x4b0fda;})});}_0x5ad79e=_['merge']({},_0x5ad79e,_0x202481[_0x9d8b('0x38')]);return db[_0x9d8b('0x44')]['findAll'](_0x5ad79e);}})[_0x9d8b('0x18')](function(_0x170a82){if(_0x170a82){return db[_0x9d8b('0x48')][_0x9d8b('0x49')]({'where':{'id':_['map'](_0x170a82,'UserId'),'role':'agent'},'attributes':['id',_0x9d8b('0x1f'),_0x9d8b('0x4a'),'updatedAt',_0x9d8b('0x4b')]});}})['then'](function(_0x19575c){if(_0x19575c){return{'count':_0x19575c[_0x9d8b('0x15')],'rows':_[_0x9d8b('0x21')](_0x19575c[_0x9d8b('0x2c')],function(_0x56ff95){return{'membername':_0x56ff95[_0x9d8b('0x1f')],'UserId':_0x56ff95['id'],'queue_name':_0x2707b7['name'],'WhatsappQueueId':_0x2707b7['id'],'interface':util[_0x9d8b('0x4c')](_0x9d8b('0x4d'),_0x9d8b('0x4e'),_0x56ff95[_0x9d8b('0x1f')]),'penalty':0x0,'paused':_0x56ff95[_0x9d8b('0x4a')],'createdAt':_0x56ff95[_0x9d8b('0x4b')],'updatedAt':_0x56ff95[_0x9d8b('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9d8b('0x18')](respondWithFilteredResult(_0x232b99,_0x5ad79e))[_0x9d8b('0x2d')](handleError(_0x232b99,null));};exports[_0x9d8b('0x50')]=function(_0x5d07cc,_0x4064d3){var _0x2d9f35={};var _0x61e771={};var _0x35f959;var _0x2fd62a;return db[_0x9d8b('0x22')][_0x9d8b('0x43')]({'where':{'id':_0x5d07cc[_0x9d8b('0x2e')]['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x4064d3,null))[_0x9d8b('0x18')](function(_0x5b824b){if(_0x5b824b){_0x35f959=_0x5b824b;_0x61e771['model']=_[_0x9d8b('0x30')](db[_0x9d8b('0x51')][_0x9d8b('0x23')]);_0x61e771['query']=_['keys'](_0x5d07cc['query']);_0x61e771[_0x9d8b('0x31')]=_[_0x9d8b('0x32')](_0x61e771[_0x9d8b('0x2f')],_0x61e771[_0x9d8b('0x2a')]);_0x2d9f35[_0x9d8b('0x33')]=_[_0x9d8b('0x32')](_0x61e771[_0x9d8b('0x2f')],qs[_0x9d8b('0x34')](_0x5d07cc[_0x9d8b('0x2a')][_0x9d8b('0x34')]));_0x2d9f35['attributes']=_0x2d9f35[_0x9d8b('0x33')]['length']?_0x2d9f35[_0x9d8b('0x33')]:_0x61e771[_0x9d8b('0x2f')];_0x2d9f35[_0x9d8b('0x52')]=qs[_0x9d8b('0x45')](_0x5d07cc[_0x9d8b('0x2a')][_0x9d8b('0x45')]);_0x2d9f35['where']=qs[_0x9d8b('0x31')](_[_0x9d8b('0x46')](_0x5d07cc[_0x9d8b('0x2a')],_0x61e771['filters']));if(_0x5d07cc[_0x9d8b('0x2a')][_0x9d8b('0x47')]){_0x2d9f35[_0x9d8b('0x28')]=_['merge'](_0x2d9f35['where'],{'$or':_[_0x9d8b('0x21')](_0x2d9f35[_0x9d8b('0x33')],function(_0x250caf){var _0xab61a4={};_0xab61a4[_0x250caf]={'$like':'%'+_0x5d07cc[_0x9d8b('0x2a')][_0x9d8b('0x47')]+'%'};return _0xab61a4;})});}_0x2d9f35=_[_0x9d8b('0x37')]({},_0x2d9f35,_0x5d07cc[_0x9d8b('0x38')]);return _0x35f959[_0x9d8b('0x50')](_0x2d9f35);}})['then'](function(_0x356103){if(_0x356103){_0x2fd62a=_0x356103['length'];if(!_0x5d07cc['query'][_0x9d8b('0x53')]('nolimit')){_0x2d9f35[_0x9d8b('0x14')]=qs['limit'](_0x5d07cc['query']['limit']);_0x2d9f35[_0x9d8b('0x12')]=qs['offset'](_0x5d07cc[_0x9d8b('0x2a')][_0x9d8b('0x12')]);}return _0x35f959[_0x9d8b('0x50')](_0x2d9f35);}})[_0x9d8b('0x18')](function(_0x40d77f){if(_0x40d77f){return _0x40d77f?{'count':_0x2fd62a,'rows':_0x40d77f}:null;}})[_0x9d8b('0x18')](respondWithResult(_0x4064d3,null))[_0x9d8b('0x2d')](handleError(_0x4064d3,null));};exports['addTeams']=function(_0x2512b1,_0x55201d){var _0x177b0e=_0x2512b1[_0x9d8b('0x40')][_0x9d8b('0x54')];return db[_0x9d8b('0x51')]['findAll']({'where':{'id':_0x177b0e},'attributes':['id'],'include':[{'model':db[_0x9d8b('0x48')],'as':_0x9d8b('0x55'),'attributes':['id',_0x9d8b('0x1f'),_0x9d8b('0x56'),_0x9d8b('0x57'),'interface'],'raw':!![]}]})['then'](function(_0x3d3a14){if(_0x3d3a14){var _0x12b980=_[_0x9d8b('0x58')](_0x3d3a14,function(_0x5b589a){var _0x578909=_0x5b589a['get']({'plain':!![]});return _0x578909[_0x9d8b('0x55')];});return db[_0x9d8b('0x22')][_0x9d8b('0x39')]({'where':{'id':_0x2512b1['params']['id']}})['then'](function(_0x21c9e7){return db[_0x9d8b('0x59')][_0x9d8b('0x5a')](function(_0x1777d9){return _0x21c9e7[_0x9d8b('0x5b')](_0x177b0e,{'transaction':_0x1777d9})[_0x9d8b('0x18')](function(){return BPromise[_0x9d8b('0x5c')](_0x12b980,function(_0x4b43bf){return db[_0x9d8b('0x44')][_0x9d8b('0x5d')]({'where':{'UserId':_0x4b43bf['id'],'WhatsappQueueId':_0x2512b1[_0x9d8b('0x2e')]['id']},'transaction':_0x1777d9});});})[_0x9d8b('0x18')](function(){_0x12b980[_0x9d8b('0x5e')](function(_0x10b736){socket[_0x9d8b('0x5f')](_0x9d8b('0x60'),{'UserId':_0x10b736['id'],'WhatsappQueueId':_0x21c9e7['id']});});});});});}})[_0x9d8b('0x18')](respondWithStatusCode(_0x55201d,null))[_0x9d8b('0x2d')](handleError(_0x55201d,null));};exports[_0x9d8b('0x61')]=function(_0x5d0581,_0x242d50){return db['Team'][_0x9d8b('0x2b')]({'where':{'id':_0x5d0581[_0x9d8b('0x2a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9d8b('0x48')],'as':_0x9d8b('0x55'),'attributes':['id'],'raw':!![]}]})[_0x9d8b('0x18')](handleEntityNotFound(_0x242d50,null))['then'](function(_0x3b7bc){var _0x16663d=_['map'](_0x3b7bc,'id');var _0x283c25=[];var _0x1db4c2=[];var _0x366087=squel['select']();_0x366087['field'](_0x9d8b('0x62'))[_0x9d8b('0x63')]('team_has_whatsapp_queues','tq')[_0x9d8b('0x64')](_0x9d8b('0x65'),'ut',_0x9d8b('0x66'))[_0x9d8b('0x28')]('WhatsappQueueId\x20=\x20?',_0x5d0581[_0x9d8b('0x2e')]['id']);for(var _0x2a3ede=0x0;_0x2a3ede<_0x3b7bc[_0x9d8b('0x35')];_0x2a3ede+=0x1){let _0x3ded6d=_0x3b7bc[_0x2a3ede];for(var _0x248c62=0x0;_0x248c62<_0x3ded6d[_0x9d8b('0x55')][_0x9d8b('0x35')];_0x248c62+=0x1){let _0x1a2efe=_0x3ded6d['Agents'][_0x248c62];var _0x569ad0=_0x366087['clone']();_0x569ad0[_0x9d8b('0x28')](_0x9d8b('0x67'),_0x1a2efe['id']);_0x1db4c2[_0x9d8b('0x68')](db[_0x9d8b('0x59')][_0x9d8b('0x2a')](_0x569ad0[_0x9d8b('0x69')](),{'type':db[_0x9d8b('0x59')][_0x9d8b('0x6a')][_0x9d8b('0x6b')]})[_0x9d8b('0x18')](function(_0x57d50c){if(_0x57d50c[_0x9d8b('0x35')]===0x1){return _0x1a2efe['id'];}else{var _0x238a38=_[_0x9d8b('0x6c')](_[_0x9d8b('0x21')](_0x57d50c,_0x9d8b('0x6d')),function(_0x4d8033){return _[_0x9d8b('0x6e')](_0x16663d,_0x4d8033);});if(_0x238a38){return _0x1a2efe['id'];}}}));}}return BPromise[_0x9d8b('0x6f')](_0x1db4c2)[_0x9d8b('0x18')](function(_0x570f49){_0x283c25=_(_0x283c25)[_0x9d8b('0x70')](_0x570f49)[_0x9d8b('0x71')]()['value']();return db[_0x9d8b('0x22')]['find']({'where':{'id':_0x5d0581['params']['id']}})['then'](function(_0x193e90){return db['sequelize'][_0x9d8b('0x5a')](function(_0x48c695){return _0x193e90[_0x9d8b('0x61')](_0x5d0581[_0x9d8b('0x2a')]['ids'],{'transaction':_0x48c695})[_0x9d8b('0x18')](function(){if(!_[_0x9d8b('0x72')](_0x283c25)){return _0x193e90[_0x9d8b('0x73')](_0x283c25,{'transaction':_0x48c695});}})[_0x9d8b('0x18')](function(){_0x283c25['forEach'](function(_0x18a339){socket['emit'](_0x9d8b('0x74'),{'UserId':_0x18a339,'WhatsappQueueId':_0x193e90['id']});});});});});});})[_0x9d8b('0x18')](respondWithStatusCode(_0x242d50,null))['catch'](handleError(_0x242d50,null));};exports[_0x9d8b('0x75')]=function(_0x6deda8,_0x3931b3){return db['WhatsappQueue'][_0x9d8b('0x39')]({'where':{'id':_0x6deda8[_0x9d8b('0x2e')]['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x3931b3,null))[_0x9d8b('0x18')](function(_0x98a40c){if(_0x98a40c){return _0x98a40c['addAgents'](_0x6deda8['body'][_0x9d8b('0x54')],_[_0x9d8b('0x76')](_0x6deda8[_0x9d8b('0x40')],[_0x9d8b('0x54'),'id'])||{})[_0x9d8b('0x77')](function(_0x48aa4b){for(var _0x31e97c=0x0;_0x31e97c<_0x6deda8[_0x9d8b('0x40')][_0x9d8b('0x54')]['length'];_0x31e97c+=0x1){socket['emit'](_0x9d8b('0x60'),{'UserId':Number(_0x6deda8[_0x9d8b('0x40')][_0x9d8b('0x54')][_0x31e97c]),'WhatsappQueueId':Number(_0x6deda8[_0x9d8b('0x2e')]['id'])});}return _0x48aa4b;});}})[_0x9d8b('0x18')](respondWithResult(_0x3931b3,null))[_0x9d8b('0x2d')](handleError(_0x3931b3,null));};exports[_0x9d8b('0x73')]=function(_0x2192f7,_0x309077){return db[_0x9d8b('0x22')][_0x9d8b('0x39')]({'where':{'id':_0x2192f7['params']['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x309077,null))[_0x9d8b('0x18')](function(_0x1ce0c7){if(_0x1ce0c7){return _0x1ce0c7[_0x9d8b('0x73')](_0x2192f7[_0x9d8b('0x2a')][_0x9d8b('0x54')])[_0x9d8b('0x18')](function(){if(_[_0x9d8b('0x78')](_0x2192f7[_0x9d8b('0x2a')][_0x9d8b('0x54')])){for(var _0x1f06c1=0x0;_0x1f06c1<_0x2192f7[_0x9d8b('0x2a')][_0x9d8b('0x54')][_0x9d8b('0x35')];_0x1f06c1+=0x1){socket[_0x9d8b('0x5f')](_0x9d8b('0x74'),{'UserId':Number(_0x2192f7[_0x9d8b('0x2a')][_0x9d8b('0x54')][_0x1f06c1]),'WhatsappQueueId':Number(_0x2192f7[_0x9d8b('0x2e')]['id'])});}}else{socket[_0x9d8b('0x5f')](_0x9d8b('0x74'),{'UserId':Number(_0x2192f7['query'][_0x9d8b('0x54')]),'WhatsappQueueId':Number(_0x2192f7['params']['id'])});}});}})[_0x9d8b('0x18')](respondWithStatusCode(_0x309077,null))[_0x9d8b('0x2d')](handleError(_0x309077,null));};exports[_0x9d8b('0x79')]=function(_0x162988,_0x460d4c){var _0x1f8437={};var _0x23aa4b={};var _0x336086;var _0x2c1876;return db['WhatsappQueue']['findOne']({'where':{'id':_0x162988[_0x9d8b('0x2e')]['id']}})[_0x9d8b('0x18')](handleEntityNotFound(_0x460d4c,null))[_0x9d8b('0x18')](function(_0x36dd8b){if(_0x36dd8b){_0x336086=_0x36dd8b;_0x23aa4b[_0x9d8b('0x2f')]=_[_0x9d8b('0x30')](db['User'][_0x9d8b('0x23')]);_0x23aa4b['query']=_[_0x9d8b('0x30')](_0x162988['query']);_0x23aa4b[_0x9d8b('0x31')]=_[_0x9d8b('0x32')](_0x23aa4b[_0x9d8b('0x2f')],_0x23aa4b['query']);_0x1f8437[_0x9d8b('0x33')]=_[_0x9d8b('0x32')](_0x23aa4b['model'],qs['fields'](_0x162988['query']['fields']));_0x1f8437['attributes']=_0x1f8437[_0x9d8b('0x33')][_0x9d8b('0x35')]?_0x1f8437['attributes']:_0x23aa4b[_0x9d8b('0x2f')];_0x1f8437['order']=qs[_0x9d8b('0x45')](_0x162988['query'][_0x9d8b('0x45')]);_0x1f8437[_0x9d8b('0x28')]=qs[_0x9d8b('0x31')](_[_0x9d8b('0x46')](_0x162988[_0x9d8b('0x2a')],_0x23aa4b['filters']));if(_0x162988[_0x9d8b('0x2a')][_0x9d8b('0x47')]){_0x1f8437[_0x9d8b('0x28')]=_[_0x9d8b('0x37')](_0x1f8437[_0x9d8b('0x28')],{'$or':_[_0x9d8b('0x21')](_0x1f8437[_0x9d8b('0x33')],function(_0x3ab3f2){var _0xbad850={};_0xbad850[_0x3ab3f2]={'$like':'%'+_0x162988[_0x9d8b('0x2a')][_0x9d8b('0x47')]+'%'};return _0xbad850;})});}_0x1f8437=_[_0x9d8b('0x37')]({},_0x1f8437,_0x162988[_0x9d8b('0x38')]);return _0x336086[_0x9d8b('0x79')](_0x1f8437);}})[_0x9d8b('0x18')](function(_0x549fd6){if(_0x549fd6){_0x2c1876=_0x549fd6[_0x9d8b('0x35')];if(!_0x162988[_0x9d8b('0x2a')]['hasOwnProperty'](_0x9d8b('0x7a'))){_0x1f8437[_0x9d8b('0x14')]=qs['limit'](_0x162988['query'][_0x9d8b('0x14')]);_0x1f8437['offset']=qs[_0x9d8b('0x12')](_0x162988['query'][_0x9d8b('0x12')]);}return _0x336086[_0x9d8b('0x79')](_0x1f8437);}})[_0x9d8b('0x18')](function(_0x33fa6b){if(_0x33fa6b){return _0x33fa6b?{'count':_0x2c1876,'rows':_0x33fa6b}:null;}})['then'](respondWithResult(_0x460d4c,null))['catch'](handleError(_0x460d4c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3499c78..3f643e6 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 _0xc5a2=['WhatsappQueue','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x239935,_0x3bff41){var _0x14b806=function(_0x5d5c39){while(--_0x5d5c39){_0x239935['push'](_0x239935['shift']());}};_0x14b806(++_0x3bff41);}(_0xc5a2,0x156));var _0x2c5a=function(_0x4f4e1a,_0x22be5b){_0x4f4e1a=_0x4f4e1a-0x0;var _0x5d7ebb=_0xc5a2[_0x4f4e1a];return _0x5d7ebb;};'use strict';var EventEmitter=require(_0x2c5a('0x0'));var WhatsappQueue=require(_0x2c5a('0x1'))['db'][_0x2c5a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c5a('0x3'),'afterUpdate':_0x2c5a('0x4'),'afterDestroy':_0x2c5a('0x5')};function emitEvent(_0x16974d){return function(_0x13f27d,_0x2cc514,_0x4adc23){WhatsappQueueEvents[_0x2c5a('0x6')](_0x16974d+':'+_0x13f27d['id'],_0x13f27d);WhatsappQueueEvents['emit'](_0x16974d,_0x13f27d);_0x4adc23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x2c5a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x7e42=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x155731,_0x3366d5){var _0xe2ffd0=function(_0x3f3925){while(--_0x3f3925){_0x155731['push'](_0x155731['shift']());}};_0xe2ffd0(++_0x3366d5);}(_0x7e42,0x1ca));var _0x27e4=function(_0x542bbf,_0x1f5a5b){_0x542bbf=_0x542bbf-0x0;var _0x167d36=_0x7e42[_0x542bbf];return _0x167d36;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x27e4('0x0'))['db'][_0x27e4('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x27e4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27e4('0x3'),'afterDestroy':_0x27e4('0x4')};function emitEvent(_0x1ba3fa){return function(_0x5d6fc2,_0x27e343,_0x1f6903){WhatsappQueueEvents[_0x27e4('0x5')](_0x1ba3fa+':'+_0x5d6fc2['id'],_0x5d6fc2);WhatsappQueueEvents[_0x27e4('0x5')](_0x1ba3fa,_0x5d6fc2);_0x1f6903(null);};}for(var e in events){if(events[_0x27e4('0x6')](e)){var event=events[e];WhatsappQueue[_0x27e4('0x7')](e,emitEvent(event));}}module[_0x27e4('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 680c154..547a183 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 _0xa4a0=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x4dccf2,_0x5cfcd7){var _0x12640e=function(_0x1fb2c7){while(--_0x1fb2c7){_0x4dccf2['push'](_0x4dccf2['shift']());}};_0x12640e(++_0x5cfcd7);}(_0xa4a0,0x118));var _0x0a4a=function(_0x2bcdfa,_0x32e1e0){_0x2bcdfa=_0x2bcdfa-0x0;var _0x50d0d9=_0xa4a0[_0x2bcdfa];return _0x50d0d9;};'use strict';var _=require('lodash');var util=require(_0x0a4a('0x0'));var logger=require(_0x0a4a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0a4a('0x2'));var rp=require(_0x0a4a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a4a('0x4'));var config=require(_0x0a4a('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x0a4a('0x6')]=function(_0x42a429,_0x184bbf){return _0x42a429[_0x0a4a('0x7')](_0x0a4a('0x8'),attributes,{'tableName':_0x0a4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4700=['request-promise','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','api'];(function(_0x25d494,_0xad99ef){var _0x56b739=function(_0x435345){while(--_0x435345){_0x25d494['push'](_0x25d494['shift']());}};_0x56b739(++_0xad99ef);}(_0x4700,0x1a1));var _0x0470=function(_0x3eff9c,_0x3ffe0c){_0x3eff9c=_0x3eff9c-0x0;var _0x102fca=_0x4700[_0x3eff9c];return _0x102fca;};'use strict';var _=require(_0x0470('0x0'));var util=require(_0x0470('0x1'));var logger=require('../../config/logger')(_0x0470('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0470('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0470('0x4'));module[_0x0470('0x5')]=function(_0x227c7b,_0x5c6389){return _0x227c7b['define']('WhatsappQueue',attributes,{'tableName':_0x0470('0x6'),'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 c8fc152..e8baac9 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 _0x34c0=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','where','attributes','include','map','model','find','raw','ShowWhatsappQueue','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x34c0,0x187));var _0x034c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x034c('0x0'));var BPromise=require(_0x034c('0x1'));var rs=require(_0x034c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x034c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x034c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x034c('0x5'));var client=jayson[_0x034c('0x6')][_0x034c('0x7')]({'port':0x232a});config[_0x034c('0x8')]=_[_0x034c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x034c('0xa'))(new Redis(config[_0x034c('0x8')]));require(_0x034c('0xb'))[_0x034c('0xc')](socket);function respondWithRpcPromise(_0x50aa96,_0x30445b,_0x1282c0){return new BPromise(function(_0x320f55,_0x31bd58){return client[_0x034c('0xd')](_0x50aa96,_0x1282c0)[_0x034c('0xe')](function(_0x39cf5f){logger[_0x034c('0xf')](_0x034c('0x10'),_0x30445b,'request\x20sent');logger[_0x034c('0x11')](_0x034c('0x12'),_0x30445b,_0x034c('0x13'),JSON[_0x034c('0x14')](_0x39cf5f));if(_0x39cf5f[_0x034c('0x15')]){if(_0x39cf5f[_0x034c('0x15')]['code']===0x1f4){logger[_0x034c('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x30445b,_0x39cf5f[_0x034c('0x15')][_0x034c('0x16')]);return _0x31bd58(_0x39cf5f[_0x034c('0x15')]['message']);}logger[_0x034c('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x30445b,_0x39cf5f['error'][_0x034c('0x16')]);return _0x320f55(_0x39cf5f['error']['message']);}else{logger[_0x034c('0xf')](_0x034c('0x10'),_0x30445b,_0x034c('0x13'));_0x320f55(_0x39cf5f[_0x034c('0x17')]['message']);}})[_0x034c('0x18')](function(_0x5848ba){logger[_0x034c('0x15')](_0x034c('0x10'),_0x30445b,_0x5848ba);_0x31bd58(_0x5848ba);});});}exports[_0x034c('0x19')]=function(_0x4f63b9){var _0x3ab872=this;return new Promise(function(_0x256460,_0x5e48a2){return db[_0x034c('0x1a')]['findAll']({'raw':_0x4f63b9[_0x034c('0x1b')]?_0x4f63b9[_0x034c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f63b9[_0x034c('0x1b')]?_0x4f63b9['options'][_0x034c('0x1c')]||null:null,'attributes':_0x4f63b9[_0x034c('0x1b')]?_0x4f63b9[_0x034c('0x1b')][_0x034c('0x1d')]||null:null,'limit':_0x4f63b9[_0x034c('0x1b')]?_0x4f63b9[_0x034c('0x1b')]['limit']||null:null,'include':_0x4f63b9[_0x034c('0x1b')]?_0x4f63b9[_0x034c('0x1b')][_0x034c('0x1e')]?_[_0x034c('0x1f')](_0x4f63b9[_0x034c('0x1b')][_0x034c('0x1e')],function(_0x2dead7){return{'model':db[_0x2dead7[_0x034c('0x20')]],'as':_0x2dead7['as'],'attributes':_0x2dead7['attributes'],'include':_0x2dead7['include']?_[_0x034c('0x1f')](_0x2dead7[_0x034c('0x1e')],function(_0x3d4e16){return{'model':db[_0x3d4e16[_0x034c('0x20')]],'as':_0x3d4e16['as'],'attributes':_0x3d4e16[_0x034c('0x1d')],'include':_0x3d4e16['include']?_['map'](_0x3d4e16[_0x034c('0x1e')],function(_0x14369d){return{'model':db[_0x14369d['model']],'as':_0x14369d['as'],'attributes':_0x14369d[_0x034c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x034c('0xe')](function(_0x4a3afa){logger[_0x034c('0xf')]('GetWhatsappQueue',_0x4f63b9);logger[_0x034c('0x11')](_0x034c('0x19'),_0x4f63b9,JSON[_0x034c('0x14')](_0x4a3afa));_0x256460(_0x4a3afa);})[_0x034c('0x18')](function(_0x175022){logger[_0x034c('0x15')](_0x034c('0x19'),_0x175022['message'],_0x4f63b9);_0x5e48a2(_0x3ab872['error'](0x1f4,_0x175022[_0x034c('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x1229e7){var _0x138428=this;return new Promise(function(_0x16095b,_0x4ea977){return db[_0x034c('0x1a')][_0x034c('0x21')]({'raw':_0x1229e7[_0x034c('0x1b')]?_0x1229e7[_0x034c('0x1b')][_0x034c('0x22')]===undefined?!![]:![]:!![],'where':_0x1229e7[_0x034c('0x1b')]?_0x1229e7['options'][_0x034c('0x1c')]||null:null,'attributes':_0x1229e7[_0x034c('0x1b')]?_0x1229e7[_0x034c('0x1b')][_0x034c('0x1d')]||null:null,'include':_0x1229e7['options']?_0x1229e7['options'][_0x034c('0x1e')]?_[_0x034c('0x1f')](_0x1229e7['options'][_0x034c('0x1e')],function(_0xe9409c){return{'model':db[_0xe9409c[_0x034c('0x20')]],'as':_0xe9409c['as'],'attributes':_0xe9409c['attributes'],'include':_0xe9409c['include']?_['map'](_0xe9409c[_0x034c('0x1e')],function(_0x1e129b){return{'model':db[_0x1e129b[_0x034c('0x20')]],'as':_0x1e129b['as'],'attributes':_0x1e129b[_0x034c('0x1d')],'include':_0x1e129b[_0x034c('0x1e')]?_[_0x034c('0x1f')](_0x1e129b['include'],function(_0x1c229f){return{'model':db[_0x1c229f[_0x034c('0x20')]],'as':_0x1c229f['as'],'attributes':_0x1c229f[_0x034c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8ec512){logger[_0x034c('0xf')](_0x034c('0x23'),_0x1229e7);logger[_0x034c('0x11')](_0x034c('0x23'),_0x1229e7,JSON[_0x034c('0x14')](_0x8ec512));_0x16095b(_0x8ec512);})[_0x034c('0x18')](function(_0x1e4497){logger[_0x034c('0x15')](_0x034c('0x23'),_0x1e4497[_0x034c('0x16')],_0x1229e7);_0x4ea977(_0x138428[_0x034c('0x15')](0x1f4,_0x1e4497['message']));});});}; \ No newline at end of file +var _0x0721=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','limit','include','map','model','debug','find','raw','where','ShowWhatsappQueue','lodash','moment','bluebird'];(function(_0x3b7738,_0x5e8a15){var _0x311dc9=function(_0x2340fc){while(--_0x2340fc){_0x3b7738['push'](_0x3b7738['shift']());}};_0x311dc9(++_0x5e8a15);}(_0x0721,0x1d1));var _0x1072=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x0721[_0x57a50d];return _0x1b25b3;};'use strict';var _=require(_0x1072('0x0'));var util=require('util');var moment=require(_0x1072('0x1'));var BPromise=require(_0x1072('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1072('0x3'))['db'];var utils=require(_0x1072('0x4'));var logger=require(_0x1072('0x5'))(_0x1072('0x6'));var config=require(_0x1072('0x7'));var jayson=require(_0x1072('0x8'));var client=jayson[_0x1072('0x9')]['http']({'port':0x232a});config[_0x1072('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1072('0xb'))(new Redis(config[_0x1072('0xa')]));require(_0x1072('0xc'))[_0x1072('0xd')](socket);function respondWithRpcPromise(_0x561f43,_0x113771,_0x584f69){return new BPromise(function(_0x3eefe9,_0x30a17b){return client[_0x1072('0xe')](_0x561f43,_0x584f69)[_0x1072('0xf')](function(_0x376a91){logger[_0x1072('0x10')](_0x1072('0x11'),_0x113771,_0x1072('0x12'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x113771,_0x1072('0x12'),JSON[_0x1072('0x13')](_0x376a91));if(_0x376a91[_0x1072('0x14')]){if(_0x376a91['error'][_0x1072('0x15')]===0x1f4){logger['error'](_0x1072('0x11'),_0x113771,_0x376a91[_0x1072('0x14')][_0x1072('0x16')]);return _0x30a17b(_0x376a91['error'][_0x1072('0x16')]);}logger['error'](_0x1072('0x11'),_0x113771,_0x376a91[_0x1072('0x14')][_0x1072('0x16')]);return _0x3eefe9(_0x376a91['error']['message']);}else{logger[_0x1072('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x113771,'request\x20sent');_0x3eefe9(_0x376a91[_0x1072('0x17')]['message']);}})[_0x1072('0x18')](function(_0x561bcd){logger[_0x1072('0x14')](_0x1072('0x11'),_0x113771,_0x561bcd);_0x30a17b(_0x561bcd);});});}exports[_0x1072('0x19')]=function(_0x4fb1a5){var _0x3bf439=this;return new Promise(function(_0x3af584,_0x1bdba9){return db[_0x1072('0x1a')][_0x1072('0x1b')]({'raw':_0x4fb1a5[_0x1072('0x1c')]?_0x4fb1a5[_0x1072('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4fb1a5[_0x1072('0x1c')]?_0x4fb1a5[_0x1072('0x1c')]['where']||null:null,'attributes':_0x4fb1a5[_0x1072('0x1c')]?_0x4fb1a5[_0x1072('0x1c')][_0x1072('0x1d')]||null:null,'limit':_0x4fb1a5['options']?_0x4fb1a5['options'][_0x1072('0x1e')]||null:null,'include':_0x4fb1a5['options']?_0x4fb1a5[_0x1072('0x1c')][_0x1072('0x1f')]?_[_0x1072('0x20')](_0x4fb1a5[_0x1072('0x1c')][_0x1072('0x1f')],function(_0x4e14f4){return{'model':db[_0x4e14f4[_0x1072('0x21')]],'as':_0x4e14f4['as'],'attributes':_0x4e14f4[_0x1072('0x1d')],'include':_0x4e14f4['include']?_['map'](_0x4e14f4[_0x1072('0x1f')],function(_0x4c1da3){return{'model':db[_0x4c1da3[_0x1072('0x21')]],'as':_0x4c1da3['as'],'attributes':_0x4c1da3['attributes'],'include':_0x4c1da3[_0x1072('0x1f')]?_[_0x1072('0x20')](_0x4c1da3[_0x1072('0x1f')],function(_0x5152df){return{'model':db[_0x5152df[_0x1072('0x21')]],'as':_0x5152df['as'],'attributes':_0x5152df[_0x1072('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1072('0xf')](function(_0xe3e854){logger[_0x1072('0x10')](_0x1072('0x19'),_0x4fb1a5);logger[_0x1072('0x22')]('GetWhatsappQueue',_0x4fb1a5,JSON[_0x1072('0x13')](_0xe3e854));_0x3af584(_0xe3e854);})[_0x1072('0x18')](function(_0x1dc9d4){logger[_0x1072('0x14')](_0x1072('0x19'),_0x1dc9d4[_0x1072('0x16')],_0x4fb1a5);_0x1bdba9(_0x3bf439['error'](0x1f4,_0x1dc9d4[_0x1072('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x24f8fe){var _0x5a0ed4=this;return new Promise(function(_0x56bbd5,_0x2bb002){return db['WhatsappQueue'][_0x1072('0x23')]({'raw':_0x24f8fe[_0x1072('0x1c')]?_0x24f8fe[_0x1072('0x1c')][_0x1072('0x24')]===undefined?!![]:![]:!![],'where':_0x24f8fe[_0x1072('0x1c')]?_0x24f8fe[_0x1072('0x1c')][_0x1072('0x25')]||null:null,'attributes':_0x24f8fe[_0x1072('0x1c')]?_0x24f8fe[_0x1072('0x1c')][_0x1072('0x1d')]||null:null,'include':_0x24f8fe[_0x1072('0x1c')]?_0x24f8fe[_0x1072('0x1c')]['include']?_[_0x1072('0x20')](_0x24f8fe[_0x1072('0x1c')][_0x1072('0x1f')],function(_0x8efeb7){return{'model':db[_0x8efeb7[_0x1072('0x21')]],'as':_0x8efeb7['as'],'attributes':_0x8efeb7[_0x1072('0x1d')],'include':_0x8efeb7[_0x1072('0x1f')]?_['map'](_0x8efeb7['include'],function(_0x234f6b){return{'model':db[_0x234f6b[_0x1072('0x21')]],'as':_0x234f6b['as'],'attributes':_0x234f6b[_0x1072('0x1d')],'include':_0x234f6b['include']?_['map'](_0x234f6b[_0x1072('0x1f')],function(_0x53f180){return{'model':db[_0x53f180[_0x1072('0x21')]],'as':_0x53f180['as'],'attributes':_0x53f180[_0x1072('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1072('0xf')](function(_0x3e22aa){logger[_0x1072('0x10')](_0x1072('0x26'),_0x24f8fe);logger[_0x1072('0x22')](_0x1072('0x26'),_0x24f8fe,JSON[_0x1072('0x13')](_0x3e22aa));_0x56bbd5(_0x3e22aa);})[_0x1072('0x18')](function(_0x31fde3){logger[_0x1072('0x14')](_0x1072('0x26'),_0x31fde3[_0x1072('0x16')],_0x24f8fe);_0x2bb002(_0x5a0ed4[_0x1072('0x14')](0x1f4,_0x31fde3[_0x1072('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6c68ea5..87ab325 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 _0x0059=['emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x3ec312,_0x54363d){var _0x342581=function(_0x5127f3){while(--_0x5127f3){_0x3ec312['push'](_0x3ec312['shift']());}};_0x342581(++_0x54363d);}(_0x0059,0x125));var _0x9005=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x0059[_0xf44d98];return _0x5ebb04;};'use strict';var WhatsappQueueEvents=require(_0x9005('0x0'));var events=[_0x9005('0x1'),_0x9005('0x2'),_0x9005('0x3')];function createListener(_0x3219e2,_0x1260b3){return function(_0x1c78cc){_0x1260b3[_0x9005('0x4')](_0x3219e2,_0x1c78cc);};}function removeListener(_0x2fa3cd,_0x4e20e2){return function(){WhatsappQueueEvents[_0x9005('0x5')](_0x2fa3cd,_0x4e20e2);};}exports[_0x9005('0x6')]=function(_0x56a408){for(var _0x388307=0x0,_0xe51bdd=events[_0x9005('0x7')];_0x388307<_0xe51bdd;_0x388307++){var _0x5d6fa7=events[_0x388307];var _0x48f264=createListener(_0x9005('0x8')+_0x5d6fa7,_0x56a408);WhatsappQueueEvents['on'](_0x5d6fa7,_0x48f264);}}; \ No newline at end of file +var _0x4945=['remove','update','emit','register','length'];(function(_0x771076,_0x404e0a){var _0x3f9fa7=function(_0x3881f4){while(--_0x3881f4){_0x771076['push'](_0x771076['shift']());}};_0x3f9fa7(++_0x404e0a);}(_0x4945,0x172));var _0x5494=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4945[_0x413feb];return _0x40ee88;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x5494('0x0'),_0x5494('0x1')];function createListener(_0x29c9f1,_0x3d4780){return function(_0x274770){_0x3d4780[_0x5494('0x2')](_0x29c9f1,_0x274770);};}function removeListener(_0x19d7cf,_0x3321c8){return function(){WhatsappQueueEvents['removeListener'](_0x19d7cf,_0x3321c8);};}exports[_0x5494('0x3')]=function(_0x43953b){for(var _0x55eba6=0x0,_0x2f892c=events[_0x5494('0x4')];_0x55eba6<_0x2f892c;_0x55eba6++){var _0x481876=events[_0x55eba6];var _0x239079=createListener('whatsappQueue:'+_0x481876,_0x43953b);WhatsappQueueEvents['on'](_0x481876,_0x239079);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 9752a5b..854ef18 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 _0xa28d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x435850,_0x32aa47){var _0x5453e4=function(_0x17b32a){while(--_0x17b32a){_0x435850['push'](_0x435850['shift']());}};_0x5453e4(++_0x32aa47);}(_0xa28d,0xf1));var _0xda28=function(_0x1e30dd,_0x2a4f8d){_0x1e30dd=_0x1e30dd-0x0;var _0x3e3fa4=_0xa28d[_0x1e30dd];return _0x3e3fa4;};'use strict';var multer=require('multer');var util=require(_0xda28('0x0'));var path=require(_0xda28('0x1'));var timeout=require(_0xda28('0x2'));var express=require('express');var router=express[_0xda28('0x3')]();var fs_extra=require(_0xda28('0x4'));var auth=require(_0xda28('0x5'));var interaction=require(_0xda28('0x6'));var config=require(_0xda28('0x7'));var controller=require(_0xda28('0x8'));router[_0xda28('0x9')]('/',auth[_0xda28('0xa')](),controller[_0xda28('0xb')]);router['get'](_0xda28('0xc'),auth[_0xda28('0xa')](),controller[_0xda28('0xd')]);router[_0xda28('0x9')](_0xda28('0xe'),auth[_0xda28('0xa')](),controller[_0xda28('0xf')]);router[_0xda28('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xda28('0x11')](_0xda28('0xe'),auth['isAuthenticated'](),controller[_0xda28('0x12')]);router[_0xda28('0x13')](_0xda28('0xe'),auth['isAuthenticated'](),controller[_0xda28('0x14')]);module[_0xda28('0x15')]=router; \ No newline at end of file +var _0xb65a=['post','create','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','describe','get','/:id','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb65a,0x114));var _0xab65=function(_0x237c43,_0x1ea492){_0x237c43=_0x237c43-0x0;var _0x2624ee=_0xb65a[_0x237c43];return _0x2624ee;};'use strict';var multer=require(_0xab65('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xab65('0x1'));var express=require(_0xab65('0x2'));var router=express[_0xab65('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab65('0x4'));var config=require(_0xab65('0x5'));var controller=require(_0xab65('0x6'));router['get']('/',auth[_0xab65('0x7')](),controller['index']);router['get']('/describe',auth[_0xab65('0x7')](),controller[_0xab65('0x8')]);router[_0xab65('0x9')](_0xab65('0xa'),auth['isAuthenticated'](),controller[_0xab65('0xb')]);router[_0xab65('0xc')]('/',auth[_0xab65('0x7')](),controller[_0xab65('0xd')]);router[_0xab65('0xe')](_0xab65('0xa'),auth[_0xab65('0x7')](),controller[_0xab65('0xf')]);router[_0xab65('0x10')]('/:id',auth[_0xab65('0x7')](),controller['destroy']);module[_0xab65('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 19c4685..c492d6a 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3a64c3,_0x48d2a8){var _0x39f7e0=function(_0x219172){while(--_0x219172){_0x3a64c3['push'](_0x3a64c3['shift']());}};_0x39f7e0(++_0x48d2a8);}(_0x7a54,0x106));var _0x47a5=function(_0x40e6bd,_0xb95c38){_0x40e6bd=_0x40e6bd-0x0;var _0xd741ea=_0x7a54[_0x40e6bd];return _0xd741ea;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5913ab,_0x496137){var _0x13a89a=function(_0x2a8517){while(--_0x2a8517){_0x5913ab['push'](_0x5913ab['shift']());}};_0x13a89a(++_0x496137);}(_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 45c0f83..e28a012 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 _0x3423=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4bcae7,_0x2de970){var _0x9d62ca=function(_0x57a9a2){while(--_0x57a9a2){_0x4bcae7['push'](_0x4bcae7['shift']());}};_0x9d62ca(++_0x2de970);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3342('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716d80,_0x36e1f4){_0x36e1f4=_0x36e1f4||0xcc;return function(_0x592ba8){if(_0x592ba8){return _0x716d80[_0x3342('0x16')](_0x36e1f4);}return _0x716d80[_0x3342('0x17')](_0x36e1f4)[_0x3342('0x18')]();};}function respondWithResult(_0xe4689e,_0x61fcc0){_0x61fcc0=_0x61fcc0||0xc8;return function(_0x104077){if(_0x104077){return _0xe4689e[_0x3342('0x17')](_0x61fcc0)['json'](_0x104077);}};}function respondWithFilteredResult(_0x3e44f3,_0x19bd71){return function(_0x49afe3){if(_0x49afe3){var _0x40d609=typeof _0x19bd71[_0x3342('0x19')]==='undefined'&&typeof _0x19bd71['limit']===_0x3342('0x1a');var _0x143cf1=_0x49afe3[_0x3342('0x1b')];var _0x2075cb=_0x40d609?0x0:_0x19bd71[_0x3342('0x19')];var _0x156c24=_0x40d609?_0x49afe3[_0x3342('0x1b')]:_0x19bd71[_0x3342('0x19')]+_0x19bd71[_0x3342('0x1c')];var _0x4f4c2a;if(_0x156c24>=_0x143cf1){_0x156c24=_0x143cf1;_0x4f4c2a=0xc8;}else{_0x4f4c2a=0xce;}_0x3e44f3[_0x3342('0x17')](_0x4f4c2a);return _0x3e44f3[_0x3342('0x1d')](_0x3342('0x1e'),_0x2075cb+'-'+_0x156c24+'/'+_0x143cf1)['json'](_0x49afe3);}return null;};}function patchUpdates(_0x3cb86f){return function(_0x463324){try{jsonpatch['apply'](_0x463324,_0x3cb86f,!![]);}catch(_0xe774b7){return BPromise[_0x3342('0x1f')](_0xe774b7);}return _0x463324['save']();};}function saveUpdates(_0x4e1b19,_0x5a0658){return function(_0x3f271c){if(_0x3f271c){return _0x3f271c[_0x3342('0x20')](_0x4e1b19)[_0x3342('0x21')](function(_0x2dbad1){return _0x2dbad1;});}return null;};}function removeEntity(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(_0x26eb87){return _0x26eb87[_0x3342('0x22')]()['then'](function(){_0xd2b87d[_0x3342('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51cf45,_0x986ab0){return function(_0x52ba65){if(!_0x52ba65){_0x51cf45['sendStatus'](0x194);}return _0x52ba65;};}function handleError(_0x247ee4,_0x58f0f5){_0x58f0f5=_0x58f0f5||0x1f4;return function(_0x37df78){logger['error'](_0x37df78['stack']);if(_0x37df78['name']){delete _0x37df78[_0x3342('0x23')];}_0x247ee4[_0x3342('0x17')](_0x58f0f5)[_0x3342('0x24')](_0x37df78);};}exports['index']=function(_0xc275a1,_0x1275e2){var _0x1cc542={},_0x272a52={},_0x4fbfb7={'count':0x0,'rows':[]};var _0x27e25b=_[_0x3342('0x25')](db[_0x3342('0x26')][_0x3342('0x27')],function(_0xf82530){return{'name':_0xf82530[_0x3342('0x28')],'type':_0xf82530[_0x3342('0x29')]['key']};});_0x272a52[_0x3342('0x2a')]=_['map'](_0x27e25b,_0x3342('0x23'));_0x272a52[_0x3342('0x2b')]=_['keys'](_0xc275a1[_0x3342('0x2b')]);_0x272a52[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],_0x272a52['query']);_0x1cc542[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x2f')]));_0x1cc542[_0x3342('0x2e')]=_0x1cc542[_0x3342('0x2e')][_0x3342('0x30')]?_0x1cc542[_0x3342('0x2e')]:_0x272a52[_0x3342('0x2a')];if(!_0xc275a1[_0x3342('0x2b')]['hasOwnProperty']('nolimit')){_0x1cc542[_0x3342('0x1c')]=qs['limit'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x1c')]);_0x1cc542[_0x3342('0x19')]=qs[_0x3342('0x19')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x19')]);}_0x1cc542[_0x3342('0x31')]=qs['sort'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x32')]);_0x1cc542[_0x3342('0x33')]=qs[_0x3342('0x2c')](_[_0x3342('0x34')](_0xc275a1['query'],_0x272a52[_0x3342('0x2c')]),_0x27e25b);if(_0xc275a1['query'][_0x3342('0x35')]){_0x1cc542[_0x3342('0x33')]=_[_0x3342('0x36')](_0x1cc542[_0x3342('0x33')],{'$or':_['map'](_0x27e25b,function(_0x370cfa){if(_0x370cfa['type']!==_0x3342('0x37')){var _0x128657={};_0x128657[_0x370cfa[_0x3342('0x23')]]={'$like':'%'+_0xc275a1[_0x3342('0x2b')][_0x3342('0x35')]+'%'};return _0x128657;}})});}_0x1cc542=_[_0x3342('0x36')]({},_0x1cc542,_0xc275a1[_0x3342('0x38')]);var _0x52cdc0={'where':_0x1cc542[_0x3342('0x33')]};return db[_0x3342('0x26')]['count'](_0x52cdc0)[_0x3342('0x21')](function(_0x1f336c){_0x4fbfb7['count']=_0x1f336c;if(_0xc275a1[_0x3342('0x2b')][_0x3342('0x39')]){_0x1cc542['include']=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x1cc542);})[_0x3342('0x21')](function(_0x41e727){_0x4fbfb7['rows']=_0x41e727;return _0x4fbfb7;})[_0x3342('0x21')](respondWithFilteredResult(_0x1275e2,_0x1cc542))[_0x3342('0x3a')](handleError(_0x1275e2,null));};exports[_0x3342('0x3b')]=function(_0x17fd01,_0x126ee4){var _0x308363={'raw':!![],'where':{'id':_0x17fd01[_0x3342('0x3c')]['id']}},_0x34de7b={};_0x34de7b['model']=_['keys'](db[_0x3342('0x26')][_0x3342('0x27')]);_0x34de7b[_0x3342('0x2b')]=_[_0x3342('0x3d')](_0x17fd01[_0x3342('0x2b')]);_0x34de7b[_0x3342('0x2c')]=_['intersection'](_0x34de7b[_0x3342('0x2a')],_0x34de7b[_0x3342('0x2b')]);_0x308363[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x34de7b[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0x17fd01['query'][_0x3342('0x2f')]));_0x308363['attributes']=_0x308363[_0x3342('0x2e')][_0x3342('0x30')]?_0x308363[_0x3342('0x2e')]:_0x34de7b[_0x3342('0x2a')];if(_0x17fd01['query'][_0x3342('0x39')]){_0x308363[_0x3342('0x3e')]=[{'all':!![]}];}_0x308363=_['merge']({},_0x308363,_0x17fd01[_0x3342('0x38')]);return db[_0x3342('0x26')][_0x3342('0x3f')](_0x308363)[_0x3342('0x21')](handleEntityNotFound(_0x126ee4,null))['then'](respondWithResult(_0x126ee4,null))[_0x3342('0x3a')](handleError(_0x126ee4,null));};exports[_0x3342('0x40')]=function(_0x56b465,_0x1fc491){return db['WhatsappQueueReport']['create'](_0x56b465[_0x3342('0x41')],{})[_0x3342('0x21')](respondWithResult(_0x1fc491,0xc9))[_0x3342('0x3a')](handleError(_0x1fc491,null));};exports[_0x3342('0x20')]=function(_0x23925e,_0x171387){if(_0x23925e[_0x3342('0x41')]['id']){delete _0x23925e['body']['id'];}return db['WhatsappQueueReport'][_0x3342('0x3f')]({'where':{'id':_0x23925e['params']['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x171387,null))['then'](saveUpdates(_0x23925e['body'],null))['then'](respondWithResult(_0x171387,null))[_0x3342('0x3a')](handleError(_0x171387,null));};exports[_0x3342('0x22')]=function(_0x29ccb6,_0x186a2a){return db['WhatsappQueueReport'][_0x3342('0x3f')]({'where':{'id':_0x29ccb6[_0x3342('0x3c')]['id']}})['then'](handleEntityNotFound(_0x186a2a,null))[_0x3342('0x21')](removeEntity(_0x186a2a,null))[_0x3342('0x3a')](handleError(_0x186a2a,null));};exports[_0x3342('0x42')]=function(_0x4c0dc0,_0x189b68){return db[_0x3342('0x26')][_0x3342('0x42')]()[_0x3342('0x21')](respondWithResult(_0x189b68,null))[_0x3342('0x3a')](handleError(_0x189b68,null));}; \ No newline at end of file +var _0x3de3=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','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','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','destroy','describe'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x3de3,0x1ce));var _0x33de=function(_0x1741d0,_0x1e93d5){_0x1741d0=_0x1741d0-0x0;var _0x211b9e=_0x3de3[_0x1741d0];return _0x211b9e;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];function respondWithStatusCode(_0x27d1d8,_0x5170ad){_0x5170ad=_0x5170ad||0xcc;return function(_0x6b1a4c){if(_0x6b1a4c){return _0x27d1d8[_0x33de('0x19')](_0x5170ad);}return _0x27d1d8['status'](_0x5170ad)['end']();};}function respondWithResult(_0x4164ab,_0x22bda8){_0x22bda8=_0x22bda8||0xc8;return function(_0x2b3748){if(_0x2b3748){return _0x4164ab[_0x33de('0x1a')](_0x22bda8)['json'](_0x2b3748);}};}function respondWithFilteredResult(_0x11e6b5,_0x1b1166){return function(_0x522ba0){if(_0x522ba0){var _0x4ff69f=typeof _0x1b1166[_0x33de('0x1b')]===_0x33de('0x1c')&&typeof _0x1b1166[_0x33de('0x1d')]==='undefined';var _0x2db887=_0x522ba0[_0x33de('0x1e')];var _0x52cfa0=_0x4ff69f?0x0:_0x1b1166[_0x33de('0x1b')];var _0x201ff3=_0x4ff69f?_0x522ba0['count']:_0x1b1166['offset']+_0x1b1166[_0x33de('0x1d')];var _0x52d718;if(_0x201ff3>=_0x2db887){_0x201ff3=_0x2db887;_0x52d718=0xc8;}else{_0x52d718=0xce;}_0x11e6b5[_0x33de('0x1a')](_0x52d718);return _0x11e6b5[_0x33de('0x1f')](_0x33de('0x20'),_0x52cfa0+'-'+_0x201ff3+'/'+_0x2db887)[_0x33de('0x21')](_0x522ba0);}return null;};}function patchUpdates(_0xc4f1a4){return function(_0x40a8e6){try{jsonpatch[_0x33de('0x22')](_0x40a8e6,_0xc4f1a4,!![]);}catch(_0x493263){return BPromise['reject'](_0x493263);}return _0x40a8e6[_0x33de('0x23')]();};}function saveUpdates(_0x5af3fa,_0x8acd8d){return function(_0x4cd8db){if(_0x4cd8db){return _0x4cd8db[_0x33de('0x24')](_0x5af3fa)[_0x33de('0x25')](function(_0x575e88){return _0x575e88;});}return null;};}function removeEntity(_0x2dbcf2,_0x5cd77e){return function(_0x67d040){if(_0x67d040){return _0x67d040['destroy']()[_0x33de('0x25')](function(){_0x2dbcf2[_0x33de('0x1a')](0xcc)[_0x33de('0x26')]();});}};}function handleEntityNotFound(_0x5b79d7,_0x3bdba4){return function(_0x2d206b){if(!_0x2d206b){_0x5b79d7[_0x33de('0x19')](0x194);}return _0x2d206b;};}function handleError(_0x5cd31e,_0x34fba3){_0x34fba3=_0x34fba3||0x1f4;return function(_0x5585a2){logger['error'](_0x5585a2[_0x33de('0x27')]);if(_0x5585a2[_0x33de('0x28')]){delete _0x5585a2[_0x33de('0x28')];}_0x5cd31e[_0x33de('0x1a')](_0x34fba3)[_0x33de('0x29')](_0x5585a2);};}exports[_0x33de('0x2a')]=function(_0x3f22fb,_0x1b4703){var _0x59bc3b={},_0x5ae0e8={},_0x2755e6={'count':0x0,'rows':[]};var _0x1420d2=_[_0x33de('0x2b')](db[_0x33de('0x2c')][_0x33de('0x2d')],function(_0x20f393){return{'name':_0x20f393[_0x33de('0x2e')],'type':_0x20f393['type'][_0x33de('0x2f')]};});_0x5ae0e8[_0x33de('0x30')]=_[_0x33de('0x2b')](_0x1420d2,_0x33de('0x28'));_0x5ae0e8['query']=_[_0x33de('0x31')](_0x3f22fb[_0x33de('0x32')]);_0x5ae0e8['filters']=_['intersection'](_0x5ae0e8['model'],_0x5ae0e8[_0x33de('0x32')]);_0x59bc3b[_0x33de('0x33')]=_['intersection'](_0x5ae0e8[_0x33de('0x30')],qs['fields'](_0x3f22fb['query'][_0x33de('0x34')]));_0x59bc3b[_0x33de('0x33')]=_0x59bc3b[_0x33de('0x33')][_0x33de('0x35')]?_0x59bc3b[_0x33de('0x33')]:_0x5ae0e8[_0x33de('0x30')];if(!_0x3f22fb[_0x33de('0x32')][_0x33de('0x36')]('nolimit')){_0x59bc3b[_0x33de('0x1d')]=qs['limit'](_0x3f22fb[_0x33de('0x32')]['limit']);_0x59bc3b['offset']=qs[_0x33de('0x1b')](_0x3f22fb[_0x33de('0x32')][_0x33de('0x1b')]);}_0x59bc3b[_0x33de('0x37')]=qs[_0x33de('0x38')](_0x3f22fb[_0x33de('0x32')]['sort']);_0x59bc3b[_0x33de('0x39')]=qs[_0x33de('0x3a')](_[_0x33de('0x3b')](_0x3f22fb[_0x33de('0x32')],_0x5ae0e8[_0x33de('0x3a')]),_0x1420d2);if(_0x3f22fb[_0x33de('0x32')][_0x33de('0x3c')]){_0x59bc3b['where']=_[_0x33de('0x3d')](_0x59bc3b[_0x33de('0x39')],{'$or':_[_0x33de('0x2b')](_0x1420d2,function(_0x3e11eb){if(_0x3e11eb[_0x33de('0x3e')]!==_0x33de('0x3f')){var _0x1126b6={};_0x1126b6[_0x3e11eb['name']]={'$like':'%'+_0x3f22fb[_0x33de('0x32')][_0x33de('0x3c')]+'%'};return _0x1126b6;}})});}_0x59bc3b=_[_0x33de('0x3d')]({},_0x59bc3b,_0x3f22fb[_0x33de('0x40')]);var _0x23c2c4={'where':_0x59bc3b[_0x33de('0x39')]};return db['WhatsappQueueReport'][_0x33de('0x1e')](_0x23c2c4)['then'](function(_0x13dedd){_0x2755e6[_0x33de('0x1e')]=_0x13dedd;if(_0x3f22fb['query'][_0x33de('0x41')]){_0x59bc3b[_0x33de('0x42')]=[{'all':!![]}];}return db[_0x33de('0x2c')][_0x33de('0x43')](_0x59bc3b);})[_0x33de('0x25')](function(_0x4251e3){_0x2755e6[_0x33de('0x44')]=_0x4251e3;return _0x2755e6;})[_0x33de('0x25')](respondWithFilteredResult(_0x1b4703,_0x59bc3b))[_0x33de('0x45')](handleError(_0x1b4703,null));};exports['show']=function(_0x5101b9,_0x417d9b){var _0x1f75f7={'raw':!![],'where':{'id':_0x5101b9[_0x33de('0x46')]['id']}},_0x20d04f={};_0x20d04f['model']=_[_0x33de('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x20d04f[_0x33de('0x32')]=_[_0x33de('0x31')](_0x5101b9[_0x33de('0x32')]);_0x20d04f[_0x33de('0x3a')]=_[_0x33de('0x47')](_0x20d04f[_0x33de('0x30')],_0x20d04f[_0x33de('0x32')]);_0x1f75f7['attributes']=_[_0x33de('0x47')](_0x20d04f['model'],qs[_0x33de('0x34')](_0x5101b9['query'][_0x33de('0x34')]));_0x1f75f7[_0x33de('0x33')]=_0x1f75f7['attributes'][_0x33de('0x35')]?_0x1f75f7[_0x33de('0x33')]:_0x20d04f[_0x33de('0x30')];if(_0x5101b9['query']['includeAll']){_0x1f75f7[_0x33de('0x42')]=[{'all':!![]}];}_0x1f75f7=_[_0x33de('0x3d')]({},_0x1f75f7,_0x5101b9['options']);return db['WhatsappQueueReport'][_0x33de('0x48')](_0x1f75f7)['then'](handleEntityNotFound(_0x417d9b,null))['then'](respondWithResult(_0x417d9b,null))['catch'](handleError(_0x417d9b,null));};exports[_0x33de('0x49')]=function(_0x2d6001,_0x9a816c){return db[_0x33de('0x2c')]['create'](_0x2d6001['body'],{})[_0x33de('0x25')](respondWithResult(_0x9a816c,0xc9))[_0x33de('0x45')](handleError(_0x9a816c,null));};exports['update']=function(_0x1d016b,_0xc23633){if(_0x1d016b[_0x33de('0x4a')]['id']){delete _0x1d016b[_0x33de('0x4a')]['id'];}return db[_0x33de('0x2c')]['find']({'where':{'id':_0x1d016b[_0x33de('0x46')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0xc23633,null))['then'](saveUpdates(_0x1d016b[_0x33de('0x4a')],null))[_0x33de('0x25')](respondWithResult(_0xc23633,null))[_0x33de('0x45')](handleError(_0xc23633,null));};exports[_0x33de('0x4b')]=function(_0xbbb376,_0x40f1b7){return db[_0x33de('0x2c')][_0x33de('0x48')]({'where':{'id':_0xbbb376[_0x33de('0x46')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0x40f1b7,null))['then'](removeEntity(_0x40f1b7,null))[_0x33de('0x45')](handleError(_0x40f1b7,null));};exports[_0x33de('0x4c')]=function(_0x2e2cd7,_0x464502){return db[_0x33de('0x2c')][_0x33de('0x4c')]()[_0x33de('0x25')](respondWithResult(_0x464502,null))['catch'](handleError(_0x464502,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 18935b5..eae423b 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 _0x3cc9=['util','api','moment','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid'];(function(_0x14d7df,_0x3fe7aa){var _0x91dede=function(_0x50b23d){while(--_0x50b23d){_0x14d7df['push'](_0x14d7df['shift']());}};_0x91dede(++_0x3fe7aa);}(_0x3cc9,0xa0));var _0x93cc=function(_0x1f6352,_0x33c298){_0x1f6352=_0x1f6352-0x0;var _0x38d31b=_0x3cc9[_0x1f6352];return _0x38d31b;};'use strict';var _=require('lodash');var util=require(_0x93cc('0x0'));var logger=require('../../config/logger')(_0x93cc('0x1'));var moment=require(_0x93cc('0x2'));var BPromise=require('bluebird');var rp=require(_0x93cc('0x3'));var fs=require('fs');var path=require(_0x93cc('0x4'));var rimraf=require('rimraf');var config=require(_0x93cc('0x5'));var attributes=require(_0x93cc('0x6'));module[_0x93cc('0x7')]=function(_0x1ba02b,_0x5ed254){return _0x1ba02b[_0x93cc('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x93cc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x023c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x1fff6a,_0x38f96b){var _0x3a957c=function(_0x12ebf7){while(--_0x12ebf7){_0x1fff6a['push'](_0x1fff6a['shift']());}};_0x3a957c(++_0x38f96b);}(_0x023c,0xb4));var _0xc023=function(_0xc427e5,_0x59926e){_0xc427e5=_0xc427e5-0x0;var _0x2549fc=_0x023c[_0xc427e5];return _0x2549fc;};'use strict';var _=require(_0xc023('0x0'));var util=require(_0xc023('0x1'));var logger=require(_0xc023('0x2'))(_0xc023('0x3'));var moment=require(_0xc023('0x4'));var BPromise=require(_0xc023('0x5'));var rp=require(_0xc023('0x6'));var fs=require('fs');var path=require(_0xc023('0x7'));var rimraf=require(_0xc023('0x8'));var config=require(_0xc023('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0xc023('0xa')]=function(_0x5dfab5,_0x4ac26d){return _0x5dfab5['define'](_0xc023('0xb'),attributes,{'tableName':_0xc023('0xc'),'paranoid':![],'indexes':[{'name':_0xc023('0xd'),'fields':[_0xc023('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 3afb9b8..82a7c78 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 _0x5280=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options','raw','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x5280,0xee));var _0x0528=function(_0x5272b2,_0x59f060){_0x5272b2=_0x5272b2-0x0;var _0x2ca6c5=_0x5280[_0x5272b2];return _0x2ca6c5;};'use strict';var _=require(_0x0528('0x0'));var util=require(_0x0528('0x1'));var moment=require('moment');var BPromise=require(_0x0528('0x2'));var rs=require(_0x0528('0x3'));var fs=require('fs');var Redis=require(_0x0528('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0528('0x5'));var logger=require(_0x0528('0x6'))(_0x0528('0x7'));var config=require(_0x0528('0x8'));var jayson=require(_0x0528('0x9'));var client=jayson[_0x0528('0xa')][_0x0528('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d131f,_0x6d8283,_0x3fb36c){return new BPromise(function(_0x197c50,_0x3fa8f5){return client[_0x0528('0xc')](_0x5d131f,_0x3fb36c)[_0x0528('0xd')](function(_0xb95dc4){logger[_0x0528('0xe')](_0x0528('0xf'),_0x6d8283,_0x0528('0x10'));logger[_0x0528('0x11')](_0x0528('0x12'),_0x6d8283,_0x0528('0x10'),JSON['stringify'](_0xb95dc4));if(_0xb95dc4[_0x0528('0x13')]){if(_0xb95dc4[_0x0528('0x13')][_0x0528('0x14')]===0x1f4){logger['error'](_0x0528('0xf'),_0x6d8283,_0xb95dc4[_0x0528('0x13')][_0x0528('0x15')]);return _0x3fa8f5(_0xb95dc4[_0x0528('0x13')]['message']);}logger[_0x0528('0x13')](_0x0528('0xf'),_0x6d8283,_0xb95dc4['error'][_0x0528('0x15')]);return _0x197c50(_0xb95dc4['error'][_0x0528('0x15')]);}else{logger[_0x0528('0xe')](_0x0528('0xf'),_0x6d8283,_0x0528('0x10'));_0x197c50(_0xb95dc4[_0x0528('0x16')][_0x0528('0x15')]);}})[_0x0528('0x17')](function(_0x392607){logger[_0x0528('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x6d8283,_0x392607);_0x3fa8f5(_0x392607);});});}exports['CreateWhatsappQueueReport']=function(_0x2228ef){var _0x25b589=this;return new Promise(function(_0x1579ae,_0x14c4a2){return db['WhatsappQueueReport'][_0x0528('0x18')](_0x2228ef[_0x0528('0x19')],{'raw':_0x2228ef[_0x0528('0x1a')]?_0x2228ef['options'][_0x0528('0x1b')]===undefined?!![]:![]:!![]})[_0x0528('0xd')](function(_0x10e6ba){logger['info'](_0x0528('0x1c'),_0x2228ef);logger[_0x0528('0x11')](_0x0528('0x1c'),_0x2228ef,JSON[_0x0528('0x1d')](_0x10e6ba));_0x1579ae(_0x10e6ba);})[_0x0528('0x17')](function(_0xf1e98a){logger[_0x0528('0x13')]('CreateWhatsappQueueReport',_0xf1e98a[_0x0528('0x15')],_0x2228ef);_0x14c4a2(_0x25b589[_0x0528('0x13')](0x1f4,_0xf1e98a[_0x0528('0x15')]));});});};exports[_0x0528('0x1e')]=function(_0x54ffca){var _0x2d301e=this;return new Promise(function(_0x342ee7,_0x4b8243){return db[_0x0528('0x1f')]['update'](_0x54ffca['body'],{'raw':_0x54ffca['options']?_0x54ffca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54ffca[_0x0528('0x1a')]?_0x54ffca[_0x0528('0x1a')][_0x0528('0x20')]||null:null,'attributes':_0x54ffca[_0x0528('0x1a')]?_0x54ffca[_0x0528('0x1a')][_0x0528('0x21')]||null:null,'limit':_0x54ffca[_0x0528('0x1a')]?_0x54ffca[_0x0528('0x1a')][_0x0528('0x22')]||null:null})[_0x0528('0xd')](function(_0x2c45f5){logger[_0x0528('0xe')](_0x0528('0x1e'),_0x54ffca);logger['debug'](_0x0528('0x1e'),_0x54ffca,JSON['stringify'](_0x2c45f5));_0x342ee7(_0x2c45f5);})[_0x0528('0x17')](function(_0x3015a6){logger[_0x0528('0x13')](_0x0528('0x1e'),_0x3015a6[_0x0528('0x15')],_0x54ffca);_0x4b8243(_0x2d301e[_0x0528('0x13')](0x1f4,_0x3015a6[_0x0528('0x15')]));});});}; \ No newline at end of file +var _0xfdcb=['request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','catch','UpdateWhatsappQueueReport','update','where','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5207d3,_0x1b67d4){var _0x36785c=function(_0x11a1d3){while(--_0x11a1d3){_0x5207d3['push'](_0x5207d3['shift']());}};_0x36785c(++_0x1b67d4);}(_0xfdcb,0x10f));var _0xbfdc=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xfdcb[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbfdc('0x0'));var BPromise=require('bluebird');var rs=require(_0xbfdc('0x1'));var fs=require('fs');var Redis=require(_0xbfdc('0x2'));var db=require(_0xbfdc('0x3'))['db'];var utils=require(_0xbfdc('0x4'));var logger=require(_0xbfdc('0x5'))(_0xbfdc('0x6'));var config=require(_0xbfdc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbfdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39f350,_0x5276b0,_0x37fd4c){return new BPromise(function(_0x2a6ba5,_0x4a0d6d){return client[_0xbfdc('0x9')](_0x39f350,_0x37fd4c)[_0xbfdc('0xa')](function(_0x32f63f){logger['info'](_0xbfdc('0xb'),_0x5276b0,_0xbfdc('0xc'));logger[_0xbfdc('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5276b0,_0xbfdc('0xc'),JSON[_0xbfdc('0xe')](_0x32f63f));if(_0x32f63f[_0xbfdc('0xf')]){if(_0x32f63f['error']['code']===0x1f4){logger[_0xbfdc('0xf')](_0xbfdc('0xb'),_0x5276b0,_0x32f63f[_0xbfdc('0xf')][_0xbfdc('0x10')]);return _0x4a0d6d(_0x32f63f[_0xbfdc('0xf')]['message']);}logger['error'](_0xbfdc('0xb'),_0x5276b0,_0x32f63f['error'][_0xbfdc('0x10')]);return _0x2a6ba5(_0x32f63f[_0xbfdc('0xf')][_0xbfdc('0x10')]);}else{logger[_0xbfdc('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5276b0,_0xbfdc('0xc'));_0x2a6ba5(_0x32f63f['result'][_0xbfdc('0x10')]);}})['catch'](function(_0xfaf522){logger[_0xbfdc('0xf')](_0xbfdc('0xb'),_0x5276b0,_0xfaf522);_0x4a0d6d(_0xfaf522);});});}exports[_0xbfdc('0x12')]=function(_0x4439be){var _0x46df0f=this;return new Promise(function(_0xb4e11,_0x3258e9){return db[_0xbfdc('0x13')]['create'](_0x4439be[_0xbfdc('0x14')],{'raw':_0x4439be[_0xbfdc('0x15')]?_0x4439be['options'][_0xbfdc('0x16')]===undefined?!![]:![]:!![]})[_0xbfdc('0xa')](function(_0x5c53cc){logger['info'](_0xbfdc('0x12'),_0x4439be);logger['debug'](_0xbfdc('0x12'),_0x4439be,JSON['stringify'](_0x5c53cc));_0xb4e11(_0x5c53cc);})[_0xbfdc('0x17')](function(_0xf3a828){logger[_0xbfdc('0xf')]('CreateWhatsappQueueReport',_0xf3a828[_0xbfdc('0x10')],_0x4439be);_0x3258e9(_0x46df0f[_0xbfdc('0xf')](0x1f4,_0xf3a828[_0xbfdc('0x10')]));});});};exports[_0xbfdc('0x18')]=function(_0xf74498){var _0x2e2223=this;return new Promise(function(_0x11057a,_0x495e40){return db[_0xbfdc('0x13')][_0xbfdc('0x19')](_0xf74498['body'],{'raw':_0xf74498['options']?_0xf74498[_0xbfdc('0x15')][_0xbfdc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf74498[_0xbfdc('0x15')]?_0xf74498[_0xbfdc('0x15')][_0xbfdc('0x1a')]||null:null,'attributes':_0xf74498[_0xbfdc('0x15')]?_0xf74498[_0xbfdc('0x15')][_0xbfdc('0x1b')]||null:null,'limit':_0xf74498['options']?_0xf74498[_0xbfdc('0x15')]['limit']||null:null})[_0xbfdc('0xa')](function(_0x19b283){logger[_0xbfdc('0x11')](_0xbfdc('0x18'),_0xf74498);logger[_0xbfdc('0xd')]('UpdateWhatsappQueueReport',_0xf74498,JSON[_0xbfdc('0xe')](_0x19b283));_0x11057a(_0x19b283);})[_0xbfdc('0x17')](function(_0x3232cf){logger[_0xbfdc('0xf')](_0xbfdc('0x18'),_0x3232cf[_0xbfdc('0x10')],_0xf74498);_0x495e40(_0x2e2223[_0xbfdc('0xf')](0x1f4,_0x3232cf[_0xbfdc('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 024e93b..71452ac 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 _0xa4ec=['/describe','isAuthenticated','describe','show','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa4ec,0xd1));var _0xca4e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa4ec[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xca4e('0x0'));var util=require(_0xca4e('0x1'));var path=require(_0xca4e('0x2'));var timeout=require(_0xca4e('0x3'));var express=require(_0xca4e('0x4'));var router=express[_0xca4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xca4e('0x6'));var config=require(_0xca4e('0x7'));var controller=require(_0xca4e('0x8'));router[_0xca4e('0x9')]('/',auth['isAuthenticated'](),controller[_0xca4e('0xa')]);router[_0xca4e('0x9')](_0xca4e('0xb'),auth[_0xca4e('0xc')](),controller[_0xca4e('0xd')]);router[_0xca4e('0x9')]('/:id',auth[_0xca4e('0xc')](),controller[_0xca4e('0xe')]);router['post']('/',auth[_0xca4e('0xc')](),controller[_0xca4e('0xf')]);router['put'](_0xca4e('0x10'),auth[_0xca4e('0xc')](),controller[_0xca4e('0x11')]);router[_0xca4e('0x12')]('/:id',auth[_0xca4e('0xc')](),controller['destroy']);module[_0xca4e('0x13')]=router; \ No newline at end of file +var _0xee82=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x206b05,_0x459d9f){var _0x3b81d0=function(_0x260937){while(--_0x260937){_0x206b05['push'](_0x206b05['shift']());}};_0x3b81d0(++_0x459d9f);}(_0xee82,0x1b5));var _0x2ee8=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xee82[_0x5d88c0];return _0x1b40f0;};'use strict';var multer=require(_0x2ee8('0x0'));var util=require(_0x2ee8('0x1'));var path=require(_0x2ee8('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ee8('0x3'));var router=express[_0x2ee8('0x4')]();var fs_extra=require(_0x2ee8('0x5'));var auth=require(_0x2ee8('0x6'));var interaction=require(_0x2ee8('0x7'));var config=require(_0x2ee8('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x2ee8('0x9')]('/',auth[_0x2ee8('0xa')](),controller[_0x2ee8('0xb')]);router[_0x2ee8('0x9')]('/describe',auth[_0x2ee8('0xa')](),controller[_0x2ee8('0xc')]);router['get'](_0x2ee8('0xd'),auth[_0x2ee8('0xa')](),controller[_0x2ee8('0xe')]);router[_0x2ee8('0xf')]('/',auth[_0x2ee8('0xa')](),controller[_0x2ee8('0x10')]);router[_0x2ee8('0x11')](_0x2ee8('0xd'),auth[_0x2ee8('0xa')](),controller[_0x2ee8('0x12')]);router['delete'](_0x2ee8('0xd'),auth[_0x2ee8('0xa')](),controller[_0x2ee8('0x13')]);module[_0x2ee8('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index bead181..c624bcf 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 _0x30d6=['sequelize','exports','ENUM','agent','queue','DATE'];(function(_0x3b7fa8,_0x484faa){var _0x4f2543=function(_0x163dfe){while(--_0x163dfe){_0x3b7fa8['push'](_0x3b7fa8['shift']());}};_0x4f2543(++_0x484faa);}(_0x30d6,0x1b0));var _0x630d=function(_0x1c2e29,_0x3ad48a){_0x1c2e29=_0x1c2e29-0x0;var _0x39174d=_0x30d6[_0x1c2e29];return _0x39174d;};'use strict';var Sequelize=require(_0x630d('0x0'));module[_0x630d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x630d('0x2')]('account',_0x630d('0x3'),_0x630d('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x630d('0x5')]}}; \ No newline at end of file +var _0xaa2d=['exports','agent','queue','DATE'];(function(_0x48f791,_0x57dbd7){var _0x5ec5ea=function(_0x1b8718){while(--_0x1b8718){_0x48f791['push'](_0x48f791['shift']());}};_0x5ec5ea(++_0x57dbd7);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdaa2('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xdaa2('0x1'),_0xdaa2('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdaa2('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index cffdb93..5db7e6b 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 _0x8316=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','apply','reject','save','then','destroy','end','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8316,0x137));var _0x6831=function(_0x409033,_0x6a6f70){_0x409033=_0x409033-0x0;var _0x4d6bb2=_0x8316[_0x409033];return _0x4d6bb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6831('0x0'));var zipdir=require(_0x6831('0x1'));var jsonpatch=require(_0x6831('0x2'));var rp=require(_0x6831('0x3'));var moment=require(_0x6831('0x4'));var BPromise=require(_0x6831('0x5'));var Mustache=require(_0x6831('0x6'));var util=require('util');var path=require(_0x6831('0x7'));var sox=require(_0x6831('0x8'));var csv=require(_0x6831('0x9'));var ejs=require(_0x6831('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6831('0xb'));var squel=require(_0x6831('0xc'));var crypto=require(_0x6831('0xd'));var jsforce=require(_0x6831('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6831('0x9'));var querystring=require(_0x6831('0xf'));var Papa=require(_0x6831('0x10'));var Redis=require(_0x6831('0x11'));var authService=require(_0x6831('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6831('0x13'));var hardwareService=require(_0x6831('0x14'));var logger=require(_0x6831('0x15'))(_0x6831('0x16'));var utils=require(_0x6831('0x17'));var config=require(_0x6831('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6831('0x19'))['db'];function respondWithStatusCode(_0x5e5976,_0x4661e5){_0x4661e5=_0x4661e5||0xcc;return function(_0x211e0a){if(_0x211e0a){return _0x5e5976[_0x6831('0x1a')](_0x4661e5);}return _0x5e5976[_0x6831('0x1b')](_0x4661e5)['end']();};}function respondWithResult(_0xc5311b,_0x14c6f1){_0x14c6f1=_0x14c6f1||0xc8;return function(_0x2c7af7){if(_0x2c7af7){return _0xc5311b['status'](_0x14c6f1)[_0x6831('0x1c')](_0x2c7af7);}};}function respondWithFilteredResult(_0x15d9df,_0x29cf36){return function(_0x3efa33){if(_0x3efa33){var _0x4a1cf3=typeof _0x29cf36['offset']===_0x6831('0x1d')&&typeof _0x29cf36['limit']===_0x6831('0x1d');var _0x1796d9=_0x3efa33['count'];var _0x10feab=_0x4a1cf3?0x0:_0x29cf36[_0x6831('0x1e')];var _0x2f0bec=_0x4a1cf3?_0x3efa33[_0x6831('0x1f')]:_0x29cf36[_0x6831('0x1e')]+_0x29cf36[_0x6831('0x20')];var _0x5300d3;if(_0x2f0bec>=_0x1796d9){_0x2f0bec=_0x1796d9;_0x5300d3=0xc8;}else{_0x5300d3=0xce;}_0x15d9df[_0x6831('0x1b')](_0x5300d3);return _0x15d9df['set']('Content-Range',_0x10feab+'-'+_0x2f0bec+'/'+_0x1796d9)[_0x6831('0x1c')](_0x3efa33);}return null;};}function patchUpdates(_0x10d84b){return function(_0x4bb13e){try{jsonpatch[_0x6831('0x21')](_0x4bb13e,_0x10d84b,!![]);}catch(_0x56eb93){return BPromise[_0x6831('0x22')](_0x56eb93);}return _0x4bb13e[_0x6831('0x23')]();};}function saveUpdates(_0x2f8f33,_0x4b3b6c){return function(_0x15f12){if(_0x15f12){return _0x15f12['update'](_0x2f8f33)[_0x6831('0x24')](function(_0x41a108){return _0x41a108;});}return null;};}function removeEntity(_0x2e5c0b,_0x4e69b6){return function(_0x58bf60){if(_0x58bf60){return _0x58bf60[_0x6831('0x25')]()[_0x6831('0x24')](function(){_0x2e5c0b['status'](0xcc)[_0x6831('0x26')]();});}};}function handleEntityNotFound(_0x5d3029,_0x3e0fae){return function(_0x7e53a8){if(!_0x7e53a8){_0x5d3029[_0x6831('0x1a')](0x194);}return _0x7e53a8;};}function handleError(_0x3f896c,_0x51cfb6){_0x51cfb6=_0x51cfb6||0x1f4;return function(_0x51bdbb){logger[_0x6831('0x27')](_0x51bdbb[_0x6831('0x28')]);if(_0x51bdbb[_0x6831('0x29')]){delete _0x51bdbb['name'];}_0x3f896c[_0x6831('0x1b')](_0x51cfb6)['send'](_0x51bdbb);};}exports[_0x6831('0x2a')]=function(_0x57b03e,_0x344668){var _0x226532={},_0x4f2b78={},_0x35b889={'count':0x0,'rows':[]};var _0x337f12=_[_0x6831('0x2b')](db[_0x6831('0x2c')][_0x6831('0x2d')],function(_0x36ab5b){return{'name':_0x36ab5b[_0x6831('0x2e')],'type':_0x36ab5b[_0x6831('0x2f')][_0x6831('0x30')]};});_0x4f2b78[_0x6831('0x31')]=_[_0x6831('0x2b')](_0x337f12,'name');_0x4f2b78[_0x6831('0x32')]=_[_0x6831('0x33')](_0x57b03e[_0x6831('0x32')]);_0x4f2b78['filters']=_[_0x6831('0x34')](_0x4f2b78[_0x6831('0x31')],_0x4f2b78[_0x6831('0x32')]);_0x226532[_0x6831('0x35')]=_[_0x6831('0x34')](_0x4f2b78['model'],qs[_0x6831('0x36')](_0x57b03e[_0x6831('0x32')][_0x6831('0x36')]));_0x226532[_0x6831('0x35')]=_0x226532['attributes'][_0x6831('0x37')]?_0x226532[_0x6831('0x35')]:_0x4f2b78[_0x6831('0x31')];if(!_0x57b03e[_0x6831('0x32')][_0x6831('0x38')](_0x6831('0x39'))){_0x226532[_0x6831('0x20')]=qs['limit'](_0x57b03e['query'][_0x6831('0x20')]);_0x226532[_0x6831('0x1e')]=qs[_0x6831('0x1e')](_0x57b03e['query']['offset']);}_0x226532[_0x6831('0x3a')]=qs[_0x6831('0x3b')](_0x57b03e['query'][_0x6831('0x3b')]);_0x226532[_0x6831('0x3c')]=qs[_0x6831('0x3d')](_[_0x6831('0x3e')](_0x57b03e['query'],_0x4f2b78['filters']),_0x337f12);if(_0x57b03e['query'][_0x6831('0x3f')]){_0x226532['where']=_[_0x6831('0x40')](_0x226532[_0x6831('0x3c')],{'$or':_[_0x6831('0x2b')](_0x337f12,function(_0x9e47ae){if(_0x9e47ae['type']!==_0x6831('0x41')){var _0x670a49={};_0x670a49[_0x9e47ae[_0x6831('0x29')]]={'$like':'%'+_0x57b03e[_0x6831('0x32')][_0x6831('0x3f')]+'%'};return _0x670a49;}})});}_0x226532=_[_0x6831('0x40')]({},_0x226532,_0x57b03e['options']);var _0x37d189={'where':_0x226532[_0x6831('0x3c')]};return db[_0x6831('0x2c')][_0x6831('0x1f')](_0x37d189)[_0x6831('0x24')](function(_0x2e0bab){_0x35b889[_0x6831('0x1f')]=_0x2e0bab;if(_0x57b03e['query'][_0x6831('0x42')]){_0x226532[_0x6831('0x43')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x6831('0x44')](_0x226532);})['then'](function(_0x1228a2){_0x35b889['rows']=_0x1228a2;return _0x35b889;})[_0x6831('0x24')](respondWithFilteredResult(_0x344668,_0x226532))[_0x6831('0x45')](handleError(_0x344668,null));};exports[_0x6831('0x46')]=function(_0x13f876,_0x56a751){var _0x1ead07={'raw':!![],'where':{'id':_0x13f876[_0x6831('0x47')]['id']}},_0x4d1696={};_0x4d1696[_0x6831('0x31')]=_['keys'](db[_0x6831('0x2c')][_0x6831('0x2d')]);_0x4d1696[_0x6831('0x32')]=_[_0x6831('0x33')](_0x13f876['query']);_0x4d1696['filters']=_['intersection'](_0x4d1696[_0x6831('0x31')],_0x4d1696[_0x6831('0x32')]);_0x1ead07[_0x6831('0x35')]=_['intersection'](_0x4d1696[_0x6831('0x31')],qs['fields'](_0x13f876[_0x6831('0x32')]['fields']));_0x1ead07[_0x6831('0x35')]=_0x1ead07[_0x6831('0x35')][_0x6831('0x37')]?_0x1ead07[_0x6831('0x35')]:_0x4d1696[_0x6831('0x31')];if(_0x13f876[_0x6831('0x32')][_0x6831('0x42')]){_0x1ead07[_0x6831('0x43')]=[{'all':!![]}];}_0x1ead07=_[_0x6831('0x40')]({},_0x1ead07,_0x13f876['options']);return db['WhatsappTransferReport'][_0x6831('0x48')](_0x1ead07)[_0x6831('0x24')](handleEntityNotFound(_0x56a751,null))[_0x6831('0x24')](respondWithResult(_0x56a751,null))[_0x6831('0x45')](handleError(_0x56a751,null));};exports[_0x6831('0x49')]=function(_0x34da54,_0x136ac1){return db[_0x6831('0x2c')][_0x6831('0x49')](_0x34da54['body'],{})['then'](respondWithResult(_0x136ac1,0xc9))[_0x6831('0x45')](handleError(_0x136ac1,null));};exports['update']=function(_0x56f2fd,_0x1c16a7){if(_0x56f2fd[_0x6831('0x4a')]['id']){delete _0x56f2fd[_0x6831('0x4a')]['id'];}return db[_0x6831('0x2c')]['find']({'where':{'id':_0x56f2fd['params']['id']}})[_0x6831('0x24')](handleEntityNotFound(_0x1c16a7,null))[_0x6831('0x24')](saveUpdates(_0x56f2fd[_0x6831('0x4a')],null))[_0x6831('0x24')](respondWithResult(_0x1c16a7,null))['catch'](handleError(_0x1c16a7,null));};exports[_0x6831('0x25')]=function(_0x5d665a,_0x1ac87f){return db[_0x6831('0x2c')][_0x6831('0x48')]({'where':{'id':_0x5d665a['params']['id']}})[_0x6831('0x24')](handleEntityNotFound(_0x1ac87f,null))[_0x6831('0x24')](removeEntity(_0x1ac87f,null))[_0x6831('0x45')](handleError(_0x1ac87f,null));};exports['describe']=function(_0x3be64d,_0x19781f){return db[_0x6831('0x2c')]['describe']()['then'](respondWithResult(_0x19781f,null))[_0x6831('0x45')](handleError(_0x19781f,null));}; \ No newline at end of file +var _0xae7e=['filters','intersection','model','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','catch','keys','create','body','find','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','index','map','WhatsappTransferReport','rawAttributes','type'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xae7e,0xf2));var _0xeae7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xae7e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xeae7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeae7('0x1'));var rp=require(_0xeae7('0x2'));var moment=require(_0xeae7('0x3'));var BPromise=require(_0xeae7('0x4'));var Mustache=require(_0xeae7('0x5'));var util=require('util');var path=require(_0xeae7('0x6'));var sox=require(_0xeae7('0x7'));var csv=require(_0xeae7('0x8'));var ejs=require(_0xeae7('0x9'));var fs=require('fs');var fs_extra=require(_0xeae7('0xa'));var _=require(_0xeae7('0xb'));var squel=require(_0xeae7('0xc'));var crypto=require(_0xeae7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeae7('0xe'));var toCsv=require(_0xeae7('0x8'));var querystring=require('querystring');var Papa=require(_0xeae7('0xf'));var Redis=require(_0xeae7('0x10'));var authService=require(_0xeae7('0x11'));var qs=require(_0xeae7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeae7('0x13'));var logger=require('../../config/logger')(_0xeae7('0x14'));var utils=require(_0xeae7('0x15'));var config=require(_0xeae7('0x16'));var licenseUtil=require(_0xeae7('0x17'));var db=require(_0xeae7('0x18'))['db'];function respondWithStatusCode(_0x2f1886,_0x5469e0){_0x5469e0=_0x5469e0||0xcc;return function(_0x3d2734){if(_0x3d2734){return _0x2f1886[_0xeae7('0x19')](_0x5469e0);}return _0x2f1886[_0xeae7('0x1a')](_0x5469e0)[_0xeae7('0x1b')]();};}function respondWithResult(_0x5b8568,_0x59abb0){_0x59abb0=_0x59abb0||0xc8;return function(_0x3ceb2b){if(_0x3ceb2b){return _0x5b8568[_0xeae7('0x1a')](_0x59abb0)[_0xeae7('0x1c')](_0x3ceb2b);}};}function respondWithFilteredResult(_0x131cd5,_0x50dcb9){return function(_0x2b20e8){if(_0x2b20e8){var _0x50e202=typeof _0x50dcb9[_0xeae7('0x1d')]===_0xeae7('0x1e')&&typeof _0x50dcb9[_0xeae7('0x1f')]===_0xeae7('0x1e');var _0x131fe1=_0x2b20e8[_0xeae7('0x20')];var _0x151eef=_0x50e202?0x0:_0x50dcb9[_0xeae7('0x1d')];var _0x1ab9a2=_0x50e202?_0x2b20e8[_0xeae7('0x20')]:_0x50dcb9[_0xeae7('0x1d')]+_0x50dcb9['limit'];var _0x4c7bc1;if(_0x1ab9a2>=_0x131fe1){_0x1ab9a2=_0x131fe1;_0x4c7bc1=0xc8;}else{_0x4c7bc1=0xce;}_0x131cd5[_0xeae7('0x1a')](_0x4c7bc1);return _0x131cd5[_0xeae7('0x21')](_0xeae7('0x22'),_0x151eef+'-'+_0x1ab9a2+'/'+_0x131fe1)[_0xeae7('0x1c')](_0x2b20e8);}return null;};}function patchUpdates(_0x19ee7d){return function(_0x9508f3){try{jsonpatch['apply'](_0x9508f3,_0x19ee7d,!![]);}catch(_0x29dd14){return BPromise[_0xeae7('0x23')](_0x29dd14);}return _0x9508f3[_0xeae7('0x24')]();};}function saveUpdates(_0x589046,_0x57714d){return function(_0x2dcc56){if(_0x2dcc56){return _0x2dcc56['update'](_0x589046)[_0xeae7('0x25')](function(_0x42b64e){return _0x42b64e;});}return null;};}function removeEntity(_0x2af073,_0x4a34ce){return function(_0xc9fbcc){if(_0xc9fbcc){return _0xc9fbcc[_0xeae7('0x26')]()[_0xeae7('0x25')](function(){_0x2af073['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc400c9,_0xa175f5){return function(_0x50bc89){if(!_0x50bc89){_0xc400c9[_0xeae7('0x19')](0x194);}return _0x50bc89;};}function handleError(_0xd6af54,_0x53809f){_0x53809f=_0x53809f||0x1f4;return function(_0xbff6bf){logger[_0xeae7('0x27')](_0xbff6bf[_0xeae7('0x28')]);if(_0xbff6bf['name']){delete _0xbff6bf['name'];}_0xd6af54[_0xeae7('0x1a')](_0x53809f)['send'](_0xbff6bf);};}exports[_0xeae7('0x29')]=function(_0x1ae906,_0x56a5de){var _0x57461d={},_0x235c44={},_0x10536c={'count':0x0,'rows':[]};var _0x2d2269=_[_0xeae7('0x2a')](db[_0xeae7('0x2b')][_0xeae7('0x2c')],function(_0x24f0a0){return{'name':_0x24f0a0['fieldName'],'type':_0x24f0a0[_0xeae7('0x2d')]['key']};});_0x235c44['model']=_[_0xeae7('0x2a')](_0x2d2269,'name');_0x235c44['query']=_['keys'](_0x1ae906['query']);_0x235c44[_0xeae7('0x2e')]=_[_0xeae7('0x2f')](_0x235c44[_0xeae7('0x30')],_0x235c44['query']);_0x57461d[_0xeae7('0x31')]=_[_0xeae7('0x2f')](_0x235c44[_0xeae7('0x30')],qs[_0xeae7('0x32')](_0x1ae906[_0xeae7('0x33')][_0xeae7('0x32')]));_0x57461d[_0xeae7('0x31')]=_0x57461d[_0xeae7('0x31')][_0xeae7('0x34')]?_0x57461d[_0xeae7('0x31')]:_0x235c44[_0xeae7('0x30')];if(!_0x1ae906['query']['hasOwnProperty'](_0xeae7('0x35'))){_0x57461d[_0xeae7('0x1f')]=qs[_0xeae7('0x1f')](_0x1ae906[_0xeae7('0x33')][_0xeae7('0x1f')]);_0x57461d[_0xeae7('0x1d')]=qs[_0xeae7('0x1d')](_0x1ae906[_0xeae7('0x33')]['offset']);}_0x57461d[_0xeae7('0x36')]=qs[_0xeae7('0x37')](_0x1ae906[_0xeae7('0x33')][_0xeae7('0x37')]);_0x57461d[_0xeae7('0x38')]=qs[_0xeae7('0x2e')](_[_0xeae7('0x39')](_0x1ae906['query'],_0x235c44[_0xeae7('0x2e')]),_0x2d2269);if(_0x1ae906['query'][_0xeae7('0x3a')]){_0x57461d[_0xeae7('0x38')]=_[_0xeae7('0x3b')](_0x57461d[_0xeae7('0x38')],{'$or':_[_0xeae7('0x2a')](_0x2d2269,function(_0x5b735d){if(_0x5b735d[_0xeae7('0x2d')]!==_0xeae7('0x3c')){var _0xd271ff={};_0xd271ff[_0x5b735d[_0xeae7('0x3d')]]={'$like':'%'+_0x1ae906['query']['filter']+'%'};return _0xd271ff;}})});}_0x57461d=_[_0xeae7('0x3b')]({},_0x57461d,_0x1ae906[_0xeae7('0x3e')]);var _0x5b6cf4={'where':_0x57461d[_0xeae7('0x38')]};return db[_0xeae7('0x2b')]['count'](_0x5b6cf4)[_0xeae7('0x25')](function(_0x39288a){_0x10536c['count']=_0x39288a;if(_0x1ae906[_0xeae7('0x33')][_0xeae7('0x3f')]){_0x57461d['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xeae7('0x40')](_0x57461d);})[_0xeae7('0x25')](function(_0x3e71e2){_0x10536c['rows']=_0x3e71e2;return _0x10536c;})[_0xeae7('0x25')](respondWithFilteredResult(_0x56a5de,_0x57461d))[_0xeae7('0x41')](handleError(_0x56a5de,null));};exports['show']=function(_0x5ae32a,_0x64252b){var _0x3dcd85={'raw':!![],'where':{'id':_0x5ae32a['params']['id']}},_0x2789a3={};_0x2789a3[_0xeae7('0x30')]=_[_0xeae7('0x42')](db[_0xeae7('0x2b')][_0xeae7('0x2c')]);_0x2789a3[_0xeae7('0x33')]=_['keys'](_0x5ae32a[_0xeae7('0x33')]);_0x2789a3[_0xeae7('0x2e')]=_[_0xeae7('0x2f')](_0x2789a3['model'],_0x2789a3['query']);_0x3dcd85[_0xeae7('0x31')]=_[_0xeae7('0x2f')](_0x2789a3[_0xeae7('0x30')],qs[_0xeae7('0x32')](_0x5ae32a[_0xeae7('0x33')][_0xeae7('0x32')]));_0x3dcd85['attributes']=_0x3dcd85['attributes'][_0xeae7('0x34')]?_0x3dcd85['attributes']:_0x2789a3[_0xeae7('0x30')];if(_0x5ae32a[_0xeae7('0x33')]['includeAll']){_0x3dcd85['include']=[{'all':!![]}];}_0x3dcd85=_[_0xeae7('0x3b')]({},_0x3dcd85,_0x5ae32a[_0xeae7('0x3e')]);return db[_0xeae7('0x2b')]['find'](_0x3dcd85)['then'](handleEntityNotFound(_0x64252b,null))[_0xeae7('0x25')](respondWithResult(_0x64252b,null))[_0xeae7('0x41')](handleError(_0x64252b,null));};exports['create']=function(_0x293fac,_0x549130){return db[_0xeae7('0x2b')][_0xeae7('0x43')](_0x293fac[_0xeae7('0x44')],{})[_0xeae7('0x25')](respondWithResult(_0x549130,0xc9))[_0xeae7('0x41')](handleError(_0x549130,null));};exports['update']=function(_0x280a20,_0x1580ed){if(_0x280a20['body']['id']){delete _0x280a20[_0xeae7('0x44')]['id'];}return db['WhatsappTransferReport'][_0xeae7('0x45')]({'where':{'id':_0x280a20[_0xeae7('0x46')]['id']}})[_0xeae7('0x25')](handleEntityNotFound(_0x1580ed,null))[_0xeae7('0x25')](saveUpdates(_0x280a20[_0xeae7('0x44')],null))[_0xeae7('0x25')](respondWithResult(_0x1580ed,null))[_0xeae7('0x41')](handleError(_0x1580ed,null));};exports[_0xeae7('0x26')]=function(_0x4c6892,_0x5f7f57){return db[_0xeae7('0x2b')][_0xeae7('0x45')]({'where':{'id':_0x4c6892[_0xeae7('0x46')]['id']}})[_0xeae7('0x25')](handleEntityNotFound(_0x5f7f57,null))[_0xeae7('0x25')](removeEntity(_0x5f7f57,null))[_0xeae7('0x41')](handleError(_0x5f7f57,null));};exports[_0xeae7('0x47')]=function(_0x4cba34,_0xb38f0e){return db[_0xeae7('0x2b')][_0xeae7('0x47')]()[_0xeae7('0x25')](respondWithResult(_0xb38f0e,null))[_0xeae7('0x41')](handleError(_0xb38f0e,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e462109..edfad64 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 _0xc289=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappTransferReport.attributes','exports'];(function(_0x165b06,_0x4d6a98){var _0x288559=function(_0x2e2726){while(--_0x2e2726){_0x165b06['push'](_0x165b06['shift']());}};_0x288559(++_0x4d6a98);}(_0xc289,0x146));var _0x9c28=function(_0x38c18e,_0x27ba7a){_0x38c18e=_0x38c18e-0x0;var _0x156a9e=_0xc289[_0x38c18e];return _0x156a9e;};'use strict';var _=require(_0x9c28('0x0'));var util=require(_0x9c28('0x1'));var logger=require(_0x9c28('0x2'))(_0x9c28('0x3'));var moment=require(_0x9c28('0x4'));var BPromise=require(_0x9c28('0x5'));var rp=require(_0x9c28('0x6'));var fs=require('fs');var path=require(_0x9c28('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c28('0x8'));module[_0x9c28('0x9')]=function(_0x5389e0,_0x274b9a){return _0x5389e0[_0x9c28('0xa')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9c28('0xb'),'fields':[_0x9c28('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x176e=['api','moment','bluebird','path','../../config/environment','./whatsappTransferReport.attributes','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x176e,0x111));var _0xe176=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x176e[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xe176('0x0'));var util=require(_0xe176('0x1'));var logger=require(_0xe176('0x2'))(_0xe176('0x3'));var moment=require(_0xe176('0x4'));var BPromise=require(_0xe176('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe176('0x6'));var rimraf=require('rimraf');var config=require(_0xe176('0x7'));var attributes=require(_0xe176('0x8'));module['exports']=function(_0x366c7e,_0x4363f4){return _0x366c7e[_0xe176('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0xe176('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe176('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 55e931b..2830d26 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 _0x7dd3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x2bff28,_0x1c5c85){var _0x154de0=function(_0x395cc9){while(--_0x395cc9){_0x2bff28['push'](_0x2bff28['shift']());}};_0x154de0(++_0x1c5c85);}(_0x7dd3,0xc4));var _0x37dd=function(_0x42f154,_0x32110c){_0x42f154=_0x42f154-0x0;var _0x471993=_0x7dd3[_0x42f154];return _0x471993;};'use strict';var _=require(_0x37dd('0x0'));var util=require(_0x37dd('0x1'));var moment=require(_0x37dd('0x2'));var BPromise=require(_0x37dd('0x3'));var rs=require(_0x37dd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37dd('0x5'))['db'];var utils=require(_0x37dd('0x6'));var logger=require('../../config/logger')(_0x37dd('0x7'));var config=require(_0x37dd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x37dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38dfe4,_0x37718b,_0xd224f7){return new BPromise(function(_0x2b1b38,_0x27ea5a){return client[_0x37dd('0xa')](_0x38dfe4,_0xd224f7)[_0x37dd('0xb')](function(_0x36a4aa){logger[_0x37dd('0xc')](_0x37dd('0xd'),_0x37718b,_0x37dd('0xe'));logger[_0x37dd('0xf')](_0x37dd('0x10'),_0x37718b,_0x37dd('0xe'),JSON['stringify'](_0x36a4aa));if(_0x36a4aa[_0x37dd('0x11')]){if(_0x36a4aa[_0x37dd('0x11')][_0x37dd('0x12')]===0x1f4){logger[_0x37dd('0x11')](_0x37dd('0xd'),_0x37718b,_0x36a4aa['error'][_0x37dd('0x13')]);return _0x27ea5a(_0x36a4aa[_0x37dd('0x11')][_0x37dd('0x13')]);}logger[_0x37dd('0x11')](_0x37dd('0xd'),_0x37718b,_0x36a4aa[_0x37dd('0x11')][_0x37dd('0x13')]);return _0x2b1b38(_0x36a4aa[_0x37dd('0x11')][_0x37dd('0x13')]);}else{logger[_0x37dd('0xc')](_0x37dd('0xd'),_0x37718b,_0x37dd('0xe'));_0x2b1b38(_0x36a4aa[_0x37dd('0x14')]['message']);}})[_0x37dd('0x15')](function(_0x27a7b8){logger[_0x37dd('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x37718b,_0x27a7b8);_0x27ea5a(_0x27a7b8);});});} \ No newline at end of file +var _0xf4d9=['error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xf4d9,0xae));var _0x9f4d=function(_0x581aa0,_0x35a8e3){_0x581aa0=_0x581aa0-0x0;var _0x159d2c=_0xf4d9[_0x581aa0];return _0x159d2c;};'use strict';var _=require(_0x9f4d('0x0'));var util=require(_0x9f4d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f4d('0x2'));var fs=require('fs');var Redis=require(_0x9f4d('0x3'));var db=require(_0x9f4d('0x4'))['db'];var utils=require(_0x9f4d('0x5'));var logger=require('../../config/logger')(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var jayson=require(_0x9f4d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51ca55,_0x504e32,_0x52731b){return new BPromise(function(_0x1a57ba,_0x1e5a36){return client['request'](_0x51ca55,_0x52731b)[_0x9f4d('0x9')](function(_0x494c5b){logger[_0x9f4d('0xa')](_0x9f4d('0xb'),_0x504e32,_0x9f4d('0xc'));logger[_0x9f4d('0xd')](_0x9f4d('0xe'),_0x504e32,_0x9f4d('0xc'),JSON[_0x9f4d('0xf')](_0x494c5b));if(_0x494c5b[_0x9f4d('0x10')]){if(_0x494c5b[_0x9f4d('0x10')]['code']===0x1f4){logger[_0x9f4d('0x10')](_0x9f4d('0xb'),_0x504e32,_0x494c5b[_0x9f4d('0x10')]['message']);return _0x1e5a36(_0x494c5b[_0x9f4d('0x10')][_0x9f4d('0x11')]);}logger[_0x9f4d('0x10')](_0x9f4d('0xb'),_0x504e32,_0x494c5b[_0x9f4d('0x10')]['message']);return _0x1a57ba(_0x494c5b[_0x9f4d('0x10')][_0x9f4d('0x11')]);}else{logger[_0x9f4d('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x504e32,_0x9f4d('0xc'));_0x1a57ba(_0x494c5b[_0x9f4d('0x12')][_0x9f4d('0x11')]);}})['catch'](function(_0x8b67ad){logger[_0x9f4d('0x10')](_0x9f4d('0xb'),_0x504e32,_0x8b67ad);_0x1e5a36(_0x8b67ad);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d4b64ec..a7a05d4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15b2=['exit','./mysqldb','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','info','Online\x20apps:','filter','online','Offline\x20apps:','status','join','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15b2,0x145));var _0x215b=function(_0x12f35c,_0x23fe06){_0x12f35c=_0x12f35c-0x0;var _0xe7442a=_0x15b2[_0x12f35c];return _0xe7442a;};'use strict';var _=require('lodash');var db=require(_0x215b('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x215b('0x1'));var rpc=require(_0x215b('0x2'));var config=require('./config/environment');var logger=require(_0x215b('0x3'))(_0x215b('0x4'));var pm2=require(_0x215b('0x5'));var pm2Config=require(_0x215b('0x6'));var schedule=require('./config/schedule');var chat=require(_0x215b('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x215b('0x8'));var provider=require(_0x215b('0x9'));function main(){return db[_0x215b('0xa')][_0x215b('0xb')]()[_0x215b('0xc')](function(){if(config[_0x215b('0xd')]){return seedDb['default']();}})[_0x215b('0xc')](function(){return checkLicense[_0x215b('0xe')]();})['then'](function(){return rpc[_0x215b('0xf')]();})[_0x215b('0xc')](function(_0x5578e4){logger['info'](_0x5578e4);return chat[_0x215b('0x10')]();})['then'](function(){return whatsapp[_0x215b('0x10')]();})[_0x215b('0xc')](function(){return schedule['start']();})[_0x215b('0xc')](function(){return transcribe['start']();})['then'](function(){return provider[_0x215b('0x10')]();})['then'](function(_0x1465ee){logger['info'](_0x1465ee);return pm2[_0x215b('0x10')](pm2Config);})[_0x215b('0xc')](function(_0x38d765){var _0x4ed24c=_0x38d765['filter'](function(_0x4c39d1){return typeof _0x4c39d1[_0x215b('0x11')]===_0x215b('0x12')&&_0x4c39d1[_0x215b('0x11')]>=0x0;});if(_0x4ed24c[_0x215b('0x13')]>0x0){throw new Error(_0x4ed24c[_0x215b('0x13')]+_0x215b('0x14')+_[_0x215b('0x15')](_0x4ed24c,function(_0x4a27aa){return'\x22'+_0x4a27aa[_0x215b('0x16')][_0x215b('0x17')]+'\x22';}));}logger[_0x215b('0x18')](_0x215b('0x19'),_[_0x215b('0x15')](_[_0x215b('0x1a')](_0x38d765,{'status':_0x215b('0x1b')}),_0x215b('0x17'))['join']());logger['info'](_0x215b('0x1c'),_['map'](_[_0x215b('0x1a')](_0x38d765,function(_0xac9792){return _0xac9792[_0x215b('0x1d')]!==_0x215b('0x1b');}),_0x215b('0x17'))[_0x215b('0x1e')]()||_0x215b('0x1f'));console[_0x215b('0x20')]('App\x20Ready!');})['catch'](function(_0x33ef47){console['log'](_0x215b('0x21'),_0x33ef47);logger[_0x215b('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x33ef47);process[_0x215b('0x23')](0x1);});}main(); \ No newline at end of file +var _0xa0a1=['filter','exitCode','number','length','map','name','Online\x20apps:','join','status','online','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','info','start'];(function(_0x5d5cd0,_0x13c45e){var _0x22d189=function(_0x1642f2){while(--_0x1642f2){_0x5d5cd0['push'](_0x5d5cd0['shift']());}};_0x22d189(++_0x13c45e);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x584adb,_0x5f3218){_0x584adb=_0x584adb-0x0;var _0x36b606=_0xa0a1[_0x584adb];return _0x36b606;};'use strict';var _=require(_0x1a0a('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x1a0a('0x1'));var checkLicense=require(_0x1a0a('0x2'));var rpc=require(_0x1a0a('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0x1a0a('0x4'));var pm2=require(_0x1a0a('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x1a0a('0x6'));var chat=require(_0x1a0a('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x1a0a('0x8'));var provider=require(_0x1a0a('0x9'));function main(){return db[_0x1a0a('0xa')][_0x1a0a('0xb')]()[_0x1a0a('0xc')](function(){if(config['seedDB']){return seedDb[_0x1a0a('0xd')]();}})[_0x1a0a('0xc')](function(){return checkLicense[_0x1a0a('0xd')]();})['then'](function(){return rpc['listen']();})['then'](function(_0x42277a){logger[_0x1a0a('0xe')](_0x42277a);return chat[_0x1a0a('0xf')]();})['then'](function(){return whatsapp[_0x1a0a('0xf')]();})['then'](function(){return schedule[_0x1a0a('0xf')]();})[_0x1a0a('0xc')](function(){return transcribe[_0x1a0a('0xf')]();})[_0x1a0a('0xc')](function(){return provider[_0x1a0a('0xf')]();})[_0x1a0a('0xc')](function(_0x3f34d2){logger['info'](_0x3f34d2);return pm2[_0x1a0a('0xf')](pm2Config);})[_0x1a0a('0xc')](function(_0x3c531c){var _0x26c1df=_0x3c531c[_0x1a0a('0x10')](function(_0x4c8080){return typeof _0x4c8080[_0x1a0a('0x11')]===_0x1a0a('0x12')&&_0x4c8080[_0x1a0a('0x11')]>=0x0;});if(_0x26c1df['length']>0x0){throw new Error(_0x26c1df[_0x1a0a('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x1a0a('0x14')](_0x26c1df,function(_0x57f65d){return'\x22'+_0x57f65d['pm2_env'][_0x1a0a('0x15')]+'\x22';}));}logger[_0x1a0a('0xe')](_0x1a0a('0x16'),_[_0x1a0a('0x14')](_['filter'](_0x3c531c,{'status':'online'}),_0x1a0a('0x15'))[_0x1a0a('0x17')]());logger[_0x1a0a('0xe')]('Offline\x20apps:',_[_0x1a0a('0x14')](_[_0x1a0a('0x10')](_0x3c531c,function(_0x5bb4bd){return _0x5bb4bd[_0x1a0a('0x18')]!==_0x1a0a('0x19');}),_0x1a0a('0x15'))['join']()||_0x1a0a('0x1a'));console[_0x1a0a('0x1b')](_0x1a0a('0x1c'));})['catch'](function(_0x33fcf4){console['log'](_0x1a0a('0x1d'),_0x33fcf4);logger[_0x1a0a('0x1e')](_0x1a0a('0x1f'),_0x33fcf4);process[_0x1a0a('0x20')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 84ce9e3..30c9214 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 _0x7656=['startsWith','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','apikey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','randomBytes','toString','hex','floor','now','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','query','forceDownload','status','disposition','unmanaged','json','Unmanaged.','catch','headers','authorization'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x7656,0xce));var _0x6765=function(_0x4c84a6,_0x5a2dad){_0x4c84a6=_0x4c84a6-0x0;var _0x1754d5=_0x7656[_0x4c84a6];return _0x1754d5;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x6765('0x0'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x6765('0x1'));var _=require(_0x6765('0x2'));var jwt=require(_0x6765('0x3'));var expressJwt=require(_0x6765('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x6765('0x5'));var BPromise=require(_0x6765('0x6'));var util=require(_0x6765('0x7'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x6765('0x8')][_0x6765('0x9')]});var userAttributes=['id',_0x6765('0xa'),'fullname',_0x6765('0xb'),_0x6765('0xc'),_0x6765('0xd'),'userpic',_0x6765('0xe'),_0x6765('0xf'),_0x6765('0x10'),_0x6765('0x11'),_0x6765('0x12'),'faxPause',_0x6765('0x13'),_0x6765('0x14'),_0x6765('0x15'),_0x6765('0x16'),_0x6765('0x17'),_0x6765('0x18'),_0x6765('0x19'),_0x6765('0x1a'),_0x6765('0x1b'),_0x6765('0x1c'),_0x6765('0x1d'),_0x6765('0x1e'),'phoneBarDnd',_0x6765('0x1f'),_0x6765('0x20'),'phoneBarEnableSettings',_0x6765('0x21'),'phoneBarPrefixRequired',_0x6765('0x22'),'phoneBarRemoteControlPort',_0x6765('0x23'),_0x6765('0x24'),_0x6765('0x25'),'privacyEnabled',_0x6765('0x26'),_0x6765('0x27'),_0x6765('0x28'),_0x6765('0x29'),_0x6765('0x2a'),'ignorePauseForPreviewCalls',_0x6765('0x2b'),_0x6765('0x2c'),_0x6765('0x2d'),_0x6765('0x2e'),_0x6765('0x2f'),_0x6765('0x30'),_0x6765('0x31'),_0x6765('0x32'),'openchannelAutoanswerDelay',_0x6765('0x33'),_0x6765('0x34'),'whatsappAutoanswer',_0x6765('0x35'),_0x6765('0x36')];exports[_0x6765('0x37')]=function(){return this[_0x6765('0x38')](!![])[_0x6765('0x39')](function(_0x85a7ee,_0x3a7d3f,_0x2ff756){if(_0x85a7ee[_0x6765('0x3a')]){_0x2ff756();}else{return db[_0x6765('0x3b')][_0x6765('0x3c')]({'where':{'id':_0x85a7ee[_0x6765('0x3d')]['id']},'attributes':['id',_0x6765('0x3e'),'disposition'],'raw':!![]})[_0x6765('0x3f')](function(_0x3891d3){if(_0x3891d3&&_0x3891d3['closed']&&!_0x85a7ee[_0x6765('0x40')][_0x6765('0x41')]){return _0x3a7d3f[_0x6765('0x42')](_0x3891d3[_0x6765('0x43')]===_0x6765('0x44')?0x195:0x193)[_0x6765('0x45')]({'message':_0x3891d3['disposition']===_0x6765('0x44')?_0x6765('0x46'):'Forbidden.'});}else{_0x2ff756();}})[_0x6765('0x47')](function(_0xea2e81){_0x2ff756(_0xea2e81);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2ccead){return compose()[_0x6765('0x39')](function(_0x475ffe,_0x3a4d88,_0x40ced8){var _0x49d9af;if(_0x475ffe[_0x6765('0x48')][_0x6765('0x49')]){if(_[_0x6765('0x4a')](_0x475ffe['headers'][_0x6765('0x49')],_0x6765('0x4b'))){var _0x49483b=basicAuth(_0x475ffe);db[_0x6765('0x4c')][_0x6765('0x4d')]({'where':{'name':_0x49483b[_0x6765('0xb')]}})[_0x6765('0x3f')](function(_0x328115){if(!_0x328115||!_0x328115[_0x6765('0x4e')](_0x49483b['pass'])){return _0x3a4d88['status'](0x191)[_0x6765('0x45')]({'message':_0x6765('0x4f')});}_0x475ffe[_0x6765('0x3a')]={'id':_0x328115['id']};_0x40ced8();})['catch'](function(_0x1b574f){_0x40ced8(_0x1b574f);});}else if(_[_0x6765('0x4a')](_0x475ffe[_0x6765('0x48')][_0x6765('0x49')],_0x6765('0x50'))){validateJwt(_0x475ffe,_0x3a4d88,_0x40ced8);}else{if(_0x2ccead){_0x40ced8();}else{return _0x3a4d88['status'](0x193)[_0x6765('0x45')]({'message':_0x6765('0x51')});}}}else if(_0x475ffe['query']['apikey']){try{var _0xba43f4={'audience':hardwareConf[_0x6765('0x52')](),'issuer':hardwareConf[_0x6765('0x52')]()};verifyJwt(_0x475ffe['query']['apikey'],_0xba43f4)[_0x6765('0x3f')](function(_0x3cb71d){return db[_0x6765('0x4c')]['find']({'where':{'id':_0x3cb71d[_0x6765('0x53')]}})['then'](function(_0x572536){_0x49d9af=_0x572536;return db[_0x6765('0x54')][_0x6765('0x3c')]({'where':{'id':0x1},'attributes':[_0x6765('0x55'),_0x6765('0x56')],'raw':!![]});})[_0x6765('0x3f')](function(_0x597f7d){if(!_0x49d9af||!_['isEqual'](_0x49d9af['apiKeyNonce'],_0x3cb71d[_0x6765('0x57')])){return _0x3a4d88[_0x6765('0x42')](0x191)[_0x6765('0x45')]({'message':_0x6765('0x58')});}if(_0x49d9af[_0x6765('0x59')]){return _0x3a4d88[_0x6765('0x42')](0x191)[_0x6765('0x45')]({'message':_0x6765('0x5a')});}if(_0x49d9af['blocked']){if(_0x597f7d[_0x6765('0x56')]>0x0){if(moment(_0x49d9af[_0x6765('0x5b')])[_0x6765('0x5c')](_0x597f7d[_0x6765('0x56')],'minutes')>moment()){return _0x3a4d88[_0x6765('0x42')](0x191)[_0x6765('0x45')]({'message':_0x6765('0x5a')});}}else{return _0x3a4d88[_0x6765('0x42')](0x191)[_0x6765('0x45')]({'message':_0x6765('0x5a')});}}_0x475ffe[_0x6765('0x3a')]={'id':_0x49d9af['id']};_0x40ced8();});})[_0x6765('0x47')](function(){return _0x3a4d88[_0x6765('0x42')](0x191)[_0x6765('0x45')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x15221c){_0x40ced8(_0x15221c);}}else if(_0x2ccead){_0x40ced8();}else{return _0x3a4d88[_0x6765('0x42')](0x193)[_0x6765('0x45')]({'message':'Unknown\x20authorization\x20format'});}})[_0x6765('0x39')](function(_0x4cc9dc,_0x1329f1,_0x43941c){if(_0x4cc9dc[_0x6765('0x3a')]){db[_0x6765('0x4c')][_0x6765('0x4d')]({'where':{'id':_0x4cc9dc[_0x6765('0x3a')]['id']},'attributes':userAttributes})[_0x6765('0x3f')](function(_0x465249){if(!_0x465249){return _0x1329f1[_0x6765('0x42')](0x194)[_0x6765('0x45')]({'message':'User\x20not\x20found.'});}_0x4cc9dc['user']=_0x465249;_0x43941c();})[_0x6765('0x47')](function(_0x350e30){_0x43941c(_0x350e30);});}else if(_0x2ccead){_0x43941c();}else{return _0x1329f1['status'](0x194)[_0x6765('0x45')]({'message':_0x6765('0x5d')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x6765('0x39')](function(_0x2bdaaa,_0x34e87d,_0x3305f0){return licenseUtil[_0x6765('0x5e')]()[_0x6765('0x3f')](function(_0x1ce2d0){if(_0x1ce2d0[_0x6765('0x5f')]){_0x3305f0();}else{return _0x34e87d[_0x6765('0x42')](0x193)[_0x6765('0x45')]({'message':_0x6765('0x60')});}})[_0x6765('0x47')](function(_0xf7565){_0x3305f0(_0xf7565);});});};exports[_0x6765('0x61')]=function isWebrtcLicence(){return compose()[_0x6765('0x39')](function(_0x7f91f9,_0x308d51,_0x1069eb){return licenseUtil[_0x6765('0x5e')]()[_0x6765('0x3f')](function(_0x17dbbb){if(_0x17dbbb[_0x6765('0x62')]){_0x1069eb();}else{return _0x308d51[_0x6765('0x42')](0x193)['json']({'message':_0x6765('0x60')});}})[_0x6765('0x47')](function(_0x2d2c3d){_0x1069eb(_0x2d2c3d);});});};exports[_0x6765('0x63')]=function(_0x5cc40d,_0x42d526,_0x1462ca){_0x5cc40d[_0x6765('0x63')]=!![];return _0x1462ca();};exports[_0x6765('0x64')]=function signToken(_0x2dd303){return signJwt(_0x2dd303);};exports[_0x6765('0x65')]=function(_0x441738,_0x4104e6){if(!_0x441738[_0x6765('0x3a')]){return _0x4104e6[_0x6765('0x42')](0x194)[_0x6765('0x45')]({'message':_0x6765('0x66')});}var _0x40026f={'payload':{'id':_0x441738[_0x6765('0x3a')]['id'],'role':_0x441738[_0x6765('0x3a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x40026f)[_0x6765('0x3f')](function(_0xaeca67){_0x4104e6[_0x6765('0x67')](_0x6765('0x68'),_0xaeca67);_0x4104e6['redirect'](_0x6765('0x69'));})['catch'](function(_0x51a10e){return _0x4104e6[_0x6765('0x42')](0x1f4)[_0x6765('0x6a')](_0x51a10e);});};exports[_0x6765('0x6b')]=function(_0x57cc87){if(_[_0x6765('0x6c')](_0x57cc87[_0x6765('0x6d')])||_[_0x6765('0x6c')](_0x57cc87[_0x6765('0x6e')])){return null;}else{return createJwt(_0x57cc87);}};exports['generateApiKey']=function(_0x5a26af){_0x5a26af['apiKeyNonce']=generateNonce();_0x5a26af['apiKeyIat']=generateIssuedAt();return createJwt(_0x5a26af);};exports[_0x6765('0x6f')]=function(_0x38610f,_0x17631f){var _0x403c31=_0x38610f[_0x6765('0x40')][_0x6765('0x70')];if(_0x403c31){var _0x5b198b={'nonce':_0x17631f[_0x6765('0x6d')],'iat':_0x17631f[_0x6765('0x6e')],'audience':hardwareConf[_0x6765('0x52')](),'issuer':hardwareConf[_0x6765('0x52')]()};return verifyJwt(_0x403c31,_0x5b198b)[_0x6765('0x3f')](function(){return generateApiKey(_0x17631f);});}else{throw{'message':_0x6765('0x71')};}};exports[_0x6765('0x72')]=function(_0x341af8){var _0x2af80e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2af80e[_0x6765('0x73')](_0x341af8))throw new db['Sequelize']['ValidationError'](_0x6765('0x74'));return;};exports['validatePasswordHistory']=function(_0x883557,_0x40c1ed,_0x33516b){var _0xd769ad=encryptor['decryptString'](_0x40c1ed)[_0x6765('0x75')](',');for(var _0x1126b0=0x0;_0x1126b0<_0x33516b;_0x1126b0++){if(!_0xd769ad[_0x1126b0])break;if(_0x883557[_0x6765('0x76')]()===_0xd769ad[_0x1126b0]['toLowerCase']()){var _0x78ec13=util[_0x6765('0x77')](_0x6765('0x78'),_0x33516b);if(_0x33516b===0x1){_0x78ec13=_0x6765('0x79');}throw new db[(_0x6765('0x7a'))][(_0x6765('0x7b'))](_0x78ec13);}}return;};exports[_0x6765('0x7c')]=function(_0x34b499,_0x46c49b){var _0x1037f6=_0x46c49b?encryptor['decryptString'](_0x46c49b)[_0x6765('0x75')](','):[];if(_0x1037f6[_0x6765('0x7d')]===0x5){_0x1037f6[_0x6765('0x7e')](-0x1,0x1);}_0x1037f6[_0x6765('0x7f')](_0x34b499);return encryptor[_0x6765('0x80')](_0x1037f6[_0x6765('0x81')](','));};function signJwt(_0x43237b){var _0x40569d=BPromise[_0x6765('0x82')](jwt[_0x6765('0x83')],{'context':jwt});var _0x392cc7=_0x43237b[_0x6765('0x84')]||config[_0x6765('0x8')][_0x6765('0x9')];return new BPromise(function(_0x125514,_0x25276d){_0x40569d(_0x43237b[_0x6765('0x85')],_0x392cc7,_0x43237b[_0x6765('0x86')])[_0x6765('0x3f')](function(_0x51e01a){_0x125514(_0x51e01a);})[_0x6765('0x47')](function(_0x2768df){_0x25276d(_0x2768df);});});}function verifyJwt(_0x1f6c76,_0x5c2836,_0x4b6574){var _0x46081b=BPromise[_0x6765('0x82')](jwt['verify'],{'context':jwt});var _0x3b03ee=_0x4b6574||config[_0x6765('0x8')]['session'];return new BPromise(function(_0x2e3760,_0x38b3a6){_0x46081b(_0x1f6c76,_0x3b03ee,_0x5c2836)[_0x6765('0x3f')](function(_0x5efef6){_0x2e3760(_0x5efef6);})['catch'](function(_0x2cd3e9){_0x38b3a6(_0x2cd3e9);});});}function generateNonce(){return crypto[_0x6765('0x87')](0x10)[_0x6765('0x88')](_0x6765('0x89'));}function generateIssuedAt(){return Math[_0x6765('0x8a')](Date[_0x6765('0x8b')]()/0x3e8)[_0x6765('0x88')]();}function createJwt(_0xc181d7){var _0x2f3363={'payload':{'iat':_0xc181d7[_0x6765('0x6e')],'nonce':_0xc181d7[_0x6765('0x6d')]},'options':{'algorithm':'HS512','subject':_0xc181d7['id']['toString'](),'issuer':hardwareConf[_0x6765('0x52')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2f3363)[_0x6765('0x3f')](function(_0x1f0f2f){return{'iat':_0xc181d7['apiKeyIat'],'nonce':_0xc181d7[_0x6765('0x6d')],'token':_0x1f0f2f};});} \ No newline at end of file +var _0xcf41=['Wrong\x20credentials.','Bearer','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','Unknown\x20authorization\x20format','User\x20not\x20found.','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','Sequelize','updatePasswordsHistory','length','splice','encryptString','join','promisify','sign','secret','session','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','showWebBar','lastPauseAt','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','query','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','then','pass'];(function(_0x45560d,_0x4499fe){var _0x28a6b1=function(_0x3abe55){while(--_0x3abe55){_0x45560d['push'](_0x45560d['shift']());}};_0x28a6b1(++_0x4499fe);}(_0xcf41,0x155));var _0x1cf4=function(_0x340d34,_0x40228e){_0x340d34=_0x340d34-0x0;var _0x55d597=_0xcf41[_0x340d34];return _0x55d597;};'use strict';var db=require(_0x1cf4('0x0'))['db'];var config=require(_0x1cf4('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x1cf4('0x2'));var encryptor=require(_0x1cf4('0x3'));var _=require(_0x1cf4('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x1cf4('0x5'));var compose=require(_0x1cf4('0x6'));var basicAuth=require(_0x1cf4('0x7'));var crypto=require(_0x1cf4('0x8'));var BPromise=require(_0x1cf4('0x9'));var util=require(_0x1cf4('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x1cf4('0xb')]['session']});var userAttributes=['id',_0x1cf4('0xc'),_0x1cf4('0xd'),_0x1cf4('0xe'),_0x1cf4('0xf'),_0x1cf4('0x10'),_0x1cf4('0x11'),_0x1cf4('0x12'),_0x1cf4('0x13'),_0x1cf4('0x14'),_0x1cf4('0x15'),_0x1cf4('0x16'),_0x1cf4('0x17'),'smsPause','openchannelPause','pauseType',_0x1cf4('0x18'),'lastLoginAt',_0x1cf4('0x19'),'crudPermissions','allowmessenger',_0x1cf4('0x1a'),_0x1cf4('0x1b'),_0x1cf4('0x1c'),_0x1cf4('0x1d'),_0x1cf4('0x1e'),_0x1cf4('0x1f'),_0x1cf4('0x20'),_0x1cf4('0x21'),_0x1cf4('0x22'),_0x1cf4('0x23'),_0x1cf4('0x24'),_0x1cf4('0x25'),_0x1cf4('0x26'),'interface',_0x1cf4('0x27'),_0x1cf4('0x28'),_0x1cf4('0x29'),_0x1cf4('0x2a'),'downloadVoiceRecordings',_0x1cf4('0x2b'),_0x1cf4('0x2c'),_0x1cf4('0x2d'),'selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay',_0x1cf4('0x2e'),_0x1cf4('0x2f'),'smsAutoanswer',_0x1cf4('0x30'),_0x1cf4('0x31'),_0x1cf4('0x32'),_0x1cf4('0x33'),'faxAutoanswerDelay',_0x1cf4('0x34'),_0x1cf4('0x35'),_0x1cf4('0x36')];exports[_0x1cf4('0x37')]=function(){return this[_0x1cf4('0x38')](!![])[_0x1cf4('0x39')](function(_0x517143,_0x28e73f,_0x1f7e1c){if(_0x517143[_0x1cf4('0x3a')]){_0x1f7e1c();}else{return db[_0x1cf4('0x3b')][_0x1cf4('0x3c')]({'where':{'id':_0x517143[_0x1cf4('0x3d')]['id']},'attributes':['id',_0x1cf4('0x3e'),'disposition'],'raw':!![]})['then'](function(_0x762542){if(_0x762542&&_0x762542[_0x1cf4('0x3e')]&&!_0x517143[_0x1cf4('0x3f')]['forceDownload']){return _0x28e73f[_0x1cf4('0x40')](_0x762542[_0x1cf4('0x41')]===_0x1cf4('0x42')?0x195:0x193)[_0x1cf4('0x43')]({'message':_0x762542[_0x1cf4('0x41')]==='unmanaged'?_0x1cf4('0x44'):_0x1cf4('0x45')});}else{_0x1f7e1c();}})[_0x1cf4('0x46')](function(_0x100096){_0x1f7e1c(_0x100096);});}});};exports[_0x1cf4('0x38')]=function isAuthenticated(_0x524fdf){return compose()['use'](function(_0x230c2a,_0x217f88,_0x2c1de5){var _0x46bb36;if(_0x230c2a[_0x1cf4('0x47')][_0x1cf4('0x48')]){if(_[_0x1cf4('0x49')](_0x230c2a[_0x1cf4('0x47')][_0x1cf4('0x48')],_0x1cf4('0x4a'))){var _0x339f65=basicAuth(_0x230c2a);db[_0x1cf4('0x4b')][_0x1cf4('0x4c')]({'where':{'name':_0x339f65[_0x1cf4('0xe')]}})[_0x1cf4('0x4d')](function(_0x1e60ab){if(!_0x1e60ab||!_0x1e60ab['authenticate'](_0x339f65[_0x1cf4('0x4e')])){return _0x217f88[_0x1cf4('0x40')](0x191)[_0x1cf4('0x43')]({'message':_0x1cf4('0x4f')});}_0x230c2a[_0x1cf4('0x3a')]={'id':_0x1e60ab['id']};_0x2c1de5();})[_0x1cf4('0x46')](function(_0x294f50){_0x2c1de5(_0x294f50);});}else if(_['startsWith'](_0x230c2a[_0x1cf4('0x47')][_0x1cf4('0x48')],_0x1cf4('0x50'))){validateJwt(_0x230c2a,_0x217f88,_0x2c1de5);}else{if(_0x524fdf){_0x2c1de5();}else{return _0x217f88[_0x1cf4('0x40')](0x193)[_0x1cf4('0x43')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x230c2a[_0x1cf4('0x3f')][_0x1cf4('0x51')]){try{var _0x1357c6={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x1cf4('0x52')]()};verifyJwt(_0x230c2a['query'][_0x1cf4('0x51')],_0x1357c6)[_0x1cf4('0x4d')](function(_0xec153a){return db[_0x1cf4('0x4b')][_0x1cf4('0x4c')]({'where':{'id':_0xec153a[_0x1cf4('0x53')]}})[_0x1cf4('0x4d')](function(_0x482e8d){_0x46bb36=_0x482e8d;return db[_0x1cf4('0x54')][_0x1cf4('0x3c')]({'where':{'id':0x1},'attributes':[_0x1cf4('0x55'),_0x1cf4('0x56')],'raw':!![]});})[_0x1cf4('0x4d')](function(_0x299eb1){if(!_0x46bb36||!_[_0x1cf4('0x57')](_0x46bb36[_0x1cf4('0x58')],_0xec153a[_0x1cf4('0x59')])){return _0x217f88['status'](0x191)[_0x1cf4('0x43')]({'message':_0x1cf4('0x5a')});}if(_0x46bb36[_0x1cf4('0x5b')]){return _0x217f88[_0x1cf4('0x40')](0x191)[_0x1cf4('0x43')]({'message':_0x1cf4('0x5c')});}if(_0x46bb36['blocked']){if(_0x299eb1[_0x1cf4('0x56')]>0x0){if(moment(_0x46bb36[_0x1cf4('0x5d')])[_0x1cf4('0x5e')](_0x299eb1[_0x1cf4('0x56')],'minutes')>moment()){return _0x217f88[_0x1cf4('0x40')](0x191)[_0x1cf4('0x43')]({'message':_0x1cf4('0x5c')});}}else{return _0x217f88[_0x1cf4('0x40')](0x191)[_0x1cf4('0x43')]({'message':_0x1cf4('0x5c')});}}_0x230c2a['user']={'id':_0x46bb36['id']};_0x2c1de5();});})[_0x1cf4('0x46')](function(){return _0x217f88[_0x1cf4('0x40')](0x191)['json']({'message':_0x1cf4('0x5c')});});}catch(_0x557578){_0x2c1de5(_0x557578);}}else if(_0x524fdf){_0x2c1de5();}else{return _0x217f88[_0x1cf4('0x40')](0x193)[_0x1cf4('0x43')]({'message':_0x1cf4('0x5f')});}})[_0x1cf4('0x39')](function(_0x38450f,_0x5d8a84,_0x423acb){if(_0x38450f[_0x1cf4('0x3a')]){db['User'][_0x1cf4('0x4c')]({'where':{'id':_0x38450f[_0x1cf4('0x3a')]['id']},'attributes':userAttributes})[_0x1cf4('0x4d')](function(_0x33c1ba){if(!_0x33c1ba){return _0x5d8a84['status'](0x194)[_0x1cf4('0x43')]({'message':_0x1cf4('0x60')});}_0x38450f['user']=_0x33c1ba;_0x423acb();})[_0x1cf4('0x46')](function(_0x422110){_0x423acb(_0x422110);});}else if(_0x524fdf){_0x423acb();}else{return _0x5d8a84['status'](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x1cf4('0x39')](function(_0x1113c5,_0x4c1dd9,_0x2f3dbe){return licenseUtil['getLicense']()[_0x1cf4('0x4d')](function(_0x4c8c75){if(_0x4c8c75[_0x1cf4('0x61')]){_0x2f3dbe();}else{return _0x4c1dd9[_0x1cf4('0x40')](0x193)['json']({'message':_0x1cf4('0x62')});}})[_0x1cf4('0x46')](function(_0x12f104){_0x2f3dbe(_0x12f104);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x1cf4('0x39')](function(_0x5482c9,_0x336776,_0x42ce8f){return licenseUtil['getLicense']()['then'](function(_0x21443f){if(_0x21443f[_0x1cf4('0x63')]){_0x42ce8f();}else{return _0x336776['status'](0x193)[_0x1cf4('0x43')]({'message':_0x1cf4('0x62')});}})[_0x1cf4('0x46')](function(_0x6d77c3){_0x42ce8f(_0x6d77c3);});});};exports[_0x1cf4('0x64')]=function(_0x89f804,_0x34d695,_0x15ea48){_0x89f804[_0x1cf4('0x64')]=!![];return _0x15ea48();};exports[_0x1cf4('0x65')]=function signToken(_0x3b59d9){return signJwt(_0x3b59d9);};exports[_0x1cf4('0x66')]=function(_0x5358ec,_0x500609){if(!_0x5358ec[_0x1cf4('0x3a')]){return _0x500609['status'](0x194)['json']({'message':_0x1cf4('0x67')});}var _0x52e12e={'payload':{'id':_0x5358ec[_0x1cf4('0x3a')]['id'],'role':_0x5358ec['user'][_0x1cf4('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x52e12e)[_0x1cf4('0x4d')](function(_0x13f023){_0x500609['cookie'](_0x1cf4('0x68'),_0x13f023);_0x500609['redirect'](_0x1cf4('0x69'));})[_0x1cf4('0x46')](function(_0x1bc249){return _0x500609['status'](0x1f4)[_0x1cf4('0x6a')](_0x1bc249);});};exports[_0x1cf4('0x6b')]=function(_0x5b327e){if(_[_0x1cf4('0x6c')](_0x5b327e[_0x1cf4('0x58')])||_[_0x1cf4('0x6c')](_0x5b327e[_0x1cf4('0x6d')])){return null;}else{return createJwt(_0x5b327e);}};exports[_0x1cf4('0x6e')]=function(_0xbddab3){_0xbddab3[_0x1cf4('0x58')]=generateNonce();_0xbddab3[_0x1cf4('0x6d')]=generateIssuedAt();return createJwt(_0xbddab3);};exports[_0x1cf4('0x6f')]=function(_0x2a913c,_0x2c9a92){var _0x376ff8=_0x2a913c['query']['apikey'];if(_0x376ff8){var _0x2e442d={'nonce':_0x2c9a92[_0x1cf4('0x58')],'iat':_0x2c9a92[_0x1cf4('0x6d')],'audience':hardwareConf[_0x1cf4('0x52')](),'issuer':hardwareConf[_0x1cf4('0x52')]()};return verifyJwt(_0x376ff8,_0x2e442d)[_0x1cf4('0x4d')](function(){return generateApiKey(_0x2c9a92);});}else{throw{'message':_0x1cf4('0x70')};}};exports[_0x1cf4('0x71')]=function(_0x1d6c0b){var _0x3bbaaf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3bbaaf[_0x1cf4('0x72')](_0x1d6c0b))throw new db['Sequelize'][(_0x1cf4('0x73'))](_0x1cf4('0x74'));return;};exports[_0x1cf4('0x75')]=function(_0x28e940,_0x2b0c33,_0x180061){var _0x254bc0=encryptor[_0x1cf4('0x76')](_0x2b0c33)[_0x1cf4('0x77')](',');for(var _0x435a3c=0x0;_0x435a3c<_0x180061;_0x435a3c++){if(!_0x254bc0[_0x435a3c])break;if(_0x28e940[_0x1cf4('0x78')]()===_0x254bc0[_0x435a3c]['toLowerCase']()){var _0x559583=util[_0x1cf4('0x79')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x180061);if(_0x180061===0x1){_0x559583='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x1cf4('0x7a'))][(_0x1cf4('0x73'))](_0x559583);}}return;};exports[_0x1cf4('0x7b')]=function(_0x43b6da,_0x5f27f9){var _0x4ea573=_0x5f27f9?encryptor['decryptString'](_0x5f27f9)['split'](','):[];if(_0x4ea573[_0x1cf4('0x7c')]===0x5){_0x4ea573[_0x1cf4('0x7d')](-0x1,0x1);}_0x4ea573['unshift'](_0x43b6da);return encryptor[_0x1cf4('0x7e')](_0x4ea573[_0x1cf4('0x7f')](','));};function signJwt(_0x45cbe2){var _0x4432e7=BPromise[_0x1cf4('0x80')](jwt[_0x1cf4('0x81')],{'context':jwt});var _0x33b348=_0x45cbe2[_0x1cf4('0x82')]||config['secrets'][_0x1cf4('0x83')];return new BPromise(function(_0x32f36f,_0x38acf4){_0x4432e7(_0x45cbe2['payload'],_0x33b348,_0x45cbe2[_0x1cf4('0x84')])['then'](function(_0x164205){_0x32f36f(_0x164205);})[_0x1cf4('0x46')](function(_0x13c114){_0x38acf4(_0x13c114);});});}function verifyJwt(_0x365372,_0x9ba1cd,_0x2f1b40){var _0x28e225=BPromise['promisify'](jwt[_0x1cf4('0x85')],{'context':jwt});var _0xdc6272=_0x2f1b40||config[_0x1cf4('0xb')][_0x1cf4('0x83')];return new BPromise(function(_0x4ebece,_0x4b57e5){_0x28e225(_0x365372,_0xdc6272,_0x9ba1cd)['then'](function(_0x1ec8df){_0x4ebece(_0x1ec8df);})[_0x1cf4('0x46')](function(_0x54648f){_0x4b57e5(_0x54648f);});});}function generateNonce(){return crypto[_0x1cf4('0x86')](0x10)[_0x1cf4('0x87')](_0x1cf4('0x88'));}function generateIssuedAt(){return Math[_0x1cf4('0x89')](Date[_0x1cf4('0x8a')]()/0x3e8)[_0x1cf4('0x87')]();}function createJwt(_0x9bb6c4){var _0x111842={'payload':{'iat':_0x9bb6c4[_0x1cf4('0x6d')],'nonce':_0x9bb6c4[_0x1cf4('0x58')]},'options':{'algorithm':_0x1cf4('0x8b'),'subject':_0x9bb6c4['id']['toString'](),'issuer':hardwareConf[_0x1cf4('0x52')](),'audience':hardwareConf[_0x1cf4('0x52')]()}};return signJwt(_0x111842)[_0x1cf4('0x4d')](function(_0x47aeae){return{'iat':_0x9bb6c4[_0x1cf4('0x6d')],'nonce':_0x9bb6c4[_0x1cf4('0x58')],'token':_0x47aeae};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index ed1e6aa..3e5f2f9 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0034=['CmCustomField','findOne','slice','length','cf_','fieldType','lodash','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','filter','tags','user','skip','checkListsRestrictions','tag','count','User','buildContactsQuery','fields','getFilteredContacts','rows','catch','describe','keys','startsWith'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0x0034,0xed));var _0x4003=function(_0x2730ad,_0x4d247d){_0x2730ad=_0x2730ad-0x0;var _0x1d4363=_0x0034[_0x2730ad];return _0x1d4363;};'use strict';var _=require(_0x4003('0x0'));var sqlUtils=require('./sql-utils');var db=require('../../mysqldb')['db'];exports[_0x4003('0x1')]=function(_0x5799ec,_0x22a4b6,_0x339033,_0x3175bb){var _0x49e493={'count':0x0,'rows':[]};var _0x83222b=sqlUtils[_0x4003('0x2')](_0x22a4b6,_0x5799ec);if(_0x83222b){return Promise[_0x4003('0x3')](_0x49e493);}var _0x3a4670=sqlUtils[_0x4003('0x4')]();var _0x489c8e={};var _0x2e8bd4=![];var _0x2cce22=![];return Promise[_0x4003('0x3')]()[_0x4003('0x5')](function(){if(_0x5799ec[_0x4003('0x6')]){return sqlUtils[_0x4003('0x7')](_0x5799ec[_0x4003('0x6')],_0x3175bb);}else{return sqlUtils[_0x4003('0x8')](_0x5799ec,_0x3175bb);}})['then'](function(_0x5039fe){_0x3a4670[_0x4003('0x9')](_0x5039fe[_0x4003('0xa')]);_0x3a4670[_0x4003('0x9')](_0x5039fe['fields']);_0x3a4670['where'](_0x5039fe[_0x4003('0xb')]);_0x3a4670['where'](_0x5039fe['user']['clause']);_0x489c8e=_0x5039fe[_0x4003('0xc')];_0x2cce22=_0x5039fe[_0x4003('0xd')][_0x4003('0xe')];return sqlUtils[_0x4003('0xf')](_0x22a4b6,_0x5799ec,_0x2cce22);})[_0x4003('0x5')](function(_0x1ee72c){_0x3a4670[_0x4003('0x9')](_0x1ee72c);var _0x33155b=_0x5799ec['search']?_0x489c8e['ids']:_0x5799ec[_0x4003('0x10')];_0x2e8bd4=_0x33155b?!![]:![];return sqlUtils['countFilteredContacts'](_0x3a4670,_0x33155b);})[_0x4003('0x5')](function(_0x50efd5){_0x49e493[_0x4003('0x11')]=_0x50efd5;if(_0x49e493[_0x4003('0x11')]===0x0){return;}if(_0x5799ec[_0x4003('0x12')]){_0x2cce22=!![];}return sqlUtils[_0x4003('0x13')](_0x3a4670,_0x5799ec[_0x4003('0x14')],_0x339033,_0x2e8bd4,_0x489c8e['clause'],_0x2cce22);})[_0x4003('0x5')](function(_0x1c885b){if(!_0x1c885b){return[];}return sqlUtils[_0x4003('0x15')](_0x1c885b,_0x5799ec,_0x339033);})[_0x4003('0x5')](function(_0xdb9dda){_0x49e493[_0x4003('0x16')]=_0xdb9dda;return _0x49e493;})[_0x4003('0x17')](function(_0x148b50){throw _0x148b50;});};exports[_0x4003('0x18')]=function(){var _0x525cdc={};var _0x4efe3a=[];return db['CmContact'][_0x4003('0x18')]()[_0x4003('0x5')](function(_0x22e81a){_0x525cdc=_0x22e81a;var _0x3393cf=Object[_0x4003('0x19')](_0x525cdc)[_0x4003('0xb')](function(_0x59b93b){return _[_0x4003('0x1a')](_0x59b93b,'cf_')?_0x59b93b:undefined;});var _0x587938=_0x3393cf['map'](function(_0x11b6fb){return db[_0x4003('0x1b')][_0x4003('0x1c')]({'where':{'id':_0x11b6fb[_0x4003('0x1d')](0x3)},'raw':!![]});});return Promise['all'](_0x587938);})[_0x4003('0x5')](function(_0x3e09dd){for(var _0xfdc23f=0x0;_0xfdc23f<_0x3e09dd[_0x4003('0x1e')];_0xfdc23f++){if(_0x3e09dd[_0xfdc23f]){var _0xc4611e=_0x4003('0x1f')+_0x3e09dd[_0xfdc23f]['id'];_0x525cdc[_0xc4611e][_0x4003('0x20')]=_0x3e09dd[_0xfdc23f]['type'];}}_0x4efe3a=_['map'](Object[_0x4003('0x19')](_0x525cdc),function(_0x33a19c){return{'name':_0x33a19c,'type':_0x525cdc[_0x33a19c]['type']};});return _0x4efe3a;})[_0x4003('0x17')](function(_0x1b0a3f){throw _0x1b0a3f;});}; \ No newline at end of file +var _0x8b38=['startsWith','cf_','CmCustomField','findOne','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','filter','user','clause','checkListsRestrictions','tag','count','buildContactsQuery','fields','getFilteredContacts','rows','catch','describe','keys'];(function(_0x56dda4,_0x3cb025){var _0x210c67=function(_0xbb20ba){while(--_0xbb20ba){_0x56dda4['push'](_0x56dda4['shift']());}};_0x210c67(++_0x3cb025);}(_0x8b38,0x147));var _0x88b3=function(_0x3aa0ac,_0x5f5da6){_0x3aa0ac=_0x3aa0ac-0x0;var _0x568a11=_0x8b38[_0x3aa0ac];return _0x568a11;};'use strict';var _=require(_0x88b3('0x0'));var sqlUtils=require(_0x88b3('0x1'));var db=require(_0x88b3('0x2'))['db'];exports[_0x88b3('0x3')]=function(_0x58f0d3,_0x12b67b,_0xacdd9b,_0x5dbca6){var _0xa1f98e={'count':0x0,'rows':[]};var _0xefcb36=sqlUtils['skipContactsQuery'](_0x12b67b,_0x58f0d3);if(_0xefcb36){return Promise[_0x88b3('0x4')](_0xa1f98e);}var _0x9d82d=sqlUtils[_0x88b3('0x5')]();var _0xbb9ac8={};var _0x4be89f=![];var _0x59aa08=![];return Promise[_0x88b3('0x4')]()[_0x88b3('0x6')](function(){if(_0x58f0d3[_0x88b3('0x7')]){return sqlUtils[_0x88b3('0x8')](_0x58f0d3[_0x88b3('0x7')],_0x5dbca6);}else{return sqlUtils[_0x88b3('0x9')](_0x58f0d3,_0x5dbca6);}})[_0x88b3('0x6')](function(_0xb7f5f4){_0x9d82d[_0x88b3('0xa')](_0xb7f5f4[_0x88b3('0xb')]);_0x9d82d[_0x88b3('0xa')](_0xb7f5f4['fields']);_0x9d82d['where'](_0xb7f5f4[_0x88b3('0xc')]);_0x9d82d[_0x88b3('0xa')](_0xb7f5f4[_0x88b3('0xd')][_0x88b3('0xe')]);_0xbb9ac8=_0xb7f5f4['tags'];_0x59aa08=_0xb7f5f4['user']['skip'];return sqlUtils[_0x88b3('0xf')](_0x12b67b,_0x58f0d3,_0x59aa08);})[_0x88b3('0x6')](function(_0x179268){_0x9d82d[_0x88b3('0xa')](_0x179268);var _0x1e15d8=_0x58f0d3['search']?_0xbb9ac8['ids']:_0x58f0d3[_0x88b3('0x10')];_0x4be89f=_0x1e15d8?!![]:![];return sqlUtils['countFilteredContacts'](_0x9d82d,_0x1e15d8);})[_0x88b3('0x6')](function(_0x303e8a){_0xa1f98e[_0x88b3('0x11')]=_0x303e8a;if(_0xa1f98e[_0x88b3('0x11')]===0x0){return;}if(_0x58f0d3['User']){_0x59aa08=!![];}return sqlUtils[_0x88b3('0x12')](_0x9d82d,_0x58f0d3[_0x88b3('0x13')],_0xacdd9b,_0x4be89f,_0xbb9ac8['clause'],_0x59aa08);})[_0x88b3('0x6')](function(_0x26530a){if(!_0x26530a){return[];}return sqlUtils[_0x88b3('0x14')](_0x26530a,_0x58f0d3,_0xacdd9b);})[_0x88b3('0x6')](function(_0x3519c9){_0xa1f98e[_0x88b3('0x15')]=_0x3519c9;return _0xa1f98e;})[_0x88b3('0x16')](function(_0xe5920d){throw _0xe5920d;});};exports['describe']=function(){var _0x1ae080={};var _0x39c875=[];return db['CmContact'][_0x88b3('0x17')]()['then'](function(_0x1b12ee){_0x1ae080=_0x1b12ee;var _0x4733bc=Object[_0x88b3('0x18')](_0x1ae080)[_0x88b3('0xc')](function(_0xd1f6f0){return _[_0x88b3('0x19')](_0xd1f6f0,_0x88b3('0x1a'))?_0xd1f6f0:undefined;});var _0xe52122=_0x4733bc['map'](function(_0x1dc2ba){return db[_0x88b3('0x1b')][_0x88b3('0x1c')]({'where':{'id':_0x1dc2ba['slice'](0x3)},'raw':!![]});});return Promise['all'](_0xe52122);})[_0x88b3('0x6')](function(_0x2278c0){for(var _0x42a110=0x0;_0x42a110<_0x2278c0[_0x88b3('0x1d')];_0x42a110++){if(_0x2278c0[_0x42a110]){var _0x122a35=_0x88b3('0x1a')+_0x2278c0[_0x42a110]['id'];_0x1ae080[_0x122a35][_0x88b3('0x1e')]=_0x2278c0[_0x42a110][_0x88b3('0x1f')];}}_0x39c875=_['map'](Object['keys'](_0x1ae080),function(_0x24c191){return{'name':_0x24c191,'type':_0x1ae080[_0x24c191][_0x88b3('0x1f')]};});return _0x39c875;})[_0x88b3('0x16')](function(_0x4b20ef){throw _0x4b20ef;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index a3a9e63..11d637c 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91b3=['dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','default','text','start','value','end','Tag','map','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','skip','some','compact','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','filter','role','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x91b3,0xaa));var _0x391b=function(_0x566e96,_0x5ec8aa){_0x566e96=_0x566e96-0x0;var _0x2bef4e=_0x91b3[_0x566e96];return _0x2bef4e;};'use strict';var _=require(_0x391b('0x0'));var squel=require(_0x391b('0x1'));var as=require(_0x391b('0x2'));var qs=require(_0x391b('0x3'));var utils=require(_0x391b('0x4'));var db=require(_0x391b('0x5'))['db'];function skipContactsQuery(_0x4eb5bd,_0x7937fd){var _0x5e9ff1=![];if(_0x4eb5bd['role']===_0x391b('0x6')&&!_0x7937fd[_0x391b('0x7')]&&!_0x7937fd[_0x391b('0x8')]&&_0x7937fd[_0x391b('0x9')]!==_0x391b('0xa')){_0x5e9ff1=!![];}return _0x5e9ff1;}function getContactsSubquery(){return squel[_0x391b('0xb')]()[_0x391b('0xc')](_0x391b('0xd'),'c')[_0x391b('0xe')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x40857a,_0xb60af8){var _0x4d99f1=_0xb60af8?'c':_0x391b('0xf');_0x40857a['left_join'](_0x391b('0x10'),'uc',_0x391b('0x11')+_0x4d99f1+_0x391b('0x12'))[_0x391b('0x13')]('cm_contact_has_tags','ct',_0x391b('0x14')+_0x4d99f1+_0x391b('0x12'))[_0x391b('0x13')](_0x391b('0x15'),'t',_0x391b('0x16'));return _0x40857a;}function addFieldsToQuery(_0x416716,_0x34ff99,_0x3f9315,_0x53119c,_0x2a982d){var _0x58f2e2=_0x2a982d?'c':'subqry';if(!_0x34ff99){_0x34ff99=['id',_0x391b('0x17'),'lastName',_0x391b('0x18'),_0x391b('0x19'),_0x391b('0x1a'),_0x391b('0x1b'),_0x391b('0x8'),_0x391b('0x1c'),_0x391b('0x1d'),_0x391b('0x1e'),_0x391b('0x1f'),_0x391b('0x20')];}else if(!_0x34ff99[_0x391b('0x21')]('id')){_0x34ff99[_0x391b('0x22')]('id');}var _0x4fb31f=_0x3f9315&&_0x2a982d||!_0x3f9315&&!_0x2a982d;if(_0x53119c){_0x4fb31f=_0x53119c&&_0x2a982d||!_0x53119c&&!_0x2a982d;}_0x34ff99['forEach'](function(_0x2dfcbb){if(_0x2dfcbb==='TagIds'){if(_0x4fb31f){_0x416716[_0x391b('0x23')](_0x391b('0x24'),_0x2dfcbb);}else if(_0x3f9315||_0x53119c){_0x416716[_0x391b('0x23')](_0x58f2e2+'.'+_0x2dfcbb);}}else{_0x416716[_0x391b('0x23')](_0x58f2e2+'.'+_0x2dfcbb);}});return _0x416716;}function getSqlClauses(){var _0x30fcd6={'default':squel[_0x391b('0x25')](),'fields':squel[_0x391b('0x25')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x391b('0x25')](),'ids':null},'user':{'clause':squel[_0x391b('0x25')](),'skip':![]}};return _0x30fcd6;}function parseTagParameter(_0x3681de){var _0x345ac1=squel[_0x391b('0x25')]();if(_0x3681de){var _0x4127cc=utils[_0x391b('0x26')](_0x3681de);_0x4127cc[_0x391b('0x27')](function(_0x60dc3){_0x345ac1['or'](_0x391b('0x28'),'%,'+_0x60dc3+',%');});}return _0x345ac1;}function parseSearchFilter(_0x5ef461){var _0x4ac84a=squel[_0x391b('0x25')]();if(_0x5ef461){var _0x2e9f28=_0x5ef461[_0x391b('0x29')]('\x5c','\x5c\x5c')[_0x391b('0x29')](/'/g,'\x27\x27');if(_0x2e9f28[_0x391b('0x2a')]('\x20')[_0x391b('0x2b')]>0x1){_0x4ac84a['or'](_0x391b('0x2c'),qs[_0x391b('0x2d')](_0x2e9f28,!![]),null);}else{if(qs['isNumeric'](_0x2e9f28)){_0x4ac84a['or'](_0x391b('0x2e'),_0x2e9f28+'%');_0x4ac84a['or']('c.phone\x20LIKE\x20?',_0x2e9f28+'%');_0x4ac84a['or'](_0x391b('0x2f'),_0x2e9f28+'%');_0x4ac84a['or'](_0x391b('0x30'),_0x2e9f28+'%');}else if(qs[_0x391b('0x31')](_0x2e9f28)){_0x4ac84a['or']('c.email\x20LIKE\x20?',_0x2e9f28+'%');}else{_0x4ac84a['or'](_0x391b('0x32'),'%'+_0x2e9f28+'%');_0x4ac84a['or'](_0x391b('0x33'),'%'+_0x2e9f28+'%');_0x4ac84a['or']('c.email\x20LIKE\x20?','%'+_0x2e9f28+'%');}}}return _0x4ac84a;}function parseAdvancedSearchFilter(_0x5eee3b,_0x3cab10){var _0x386315=getSqlClauses();var _0x5a9fc6=as[_0x391b('0x34')](_0x5eee3b);var _0x4b33f0=_0x5a9fc6[_0x391b('0x35')];for(var _0x31cf0c=0x0;_0x31cf0c<_0x5a9fc6[_0x391b('0x36')][_0x391b('0x2b')];_0x31cf0c++){var _0x4115ed=_0x5a9fc6[_0x391b('0x36')][_0x31cf0c];var _0x1c6d9f='c';var _0x16eb20=_['find'](_0x3cab10,[_0x391b('0x37'),_0x4115ed[_0x391b('0x23')]]);if(_0x16eb20){if(_0x4115ed[_0x391b('0x23')]===_0x391b('0x38')||_0x16eb20[_0x391b('0x39')]===_0x391b('0x3a')){_0x4115ed[_0x391b('0x3b')]=_0x391b('0x3c');}var _0x542a9f=as[_0x391b('0x3d')](_0x1c6d9f,_0x16eb20['type'],_0x4115ed);_0x386315[_0x391b('0x3e')][_0x4b33f0](_0x542a9f[_0x391b('0x3f')],_0x542a9f['value'][_0x391b('0x40')],_0x542a9f[_0x391b('0x41')][_0x391b('0x42')]);}else{if(_0x4115ed[_0x391b('0x23')]===_0x391b('0x43')){var _0x36c4f6=_0x4115ed[_0x391b('0x41')][_0x391b('0x2a')](',')[_0x391b('0x44')](function(_0x9e0da0){return Number(_0x9e0da0);});var _0xecd052=parseTagParameter(_0x36c4f6);_0x386315[_0x391b('0x45')]['clause'][_0x391b('0x46')](_0xecd052);_0x386315[_0x391b('0x45')][_0x391b('0x47')]=_0x36c4f6;}else if(_0x4115ed[_0x391b('0x23')]===_0x391b('0x48')){_0x386315[_0x391b('0x49')][_0x391b('0x4a')][_0x391b('0x46')](_0x391b('0x4b'),_0x4115ed[_0x391b('0x41')]);_0x386315[_0x391b('0x49')][_0x391b('0x4c')]=!![];}}}return _0x386315;}function parseModelFields(_0x1660d9,_0x3992c3){var _0x959403=squel['expr']();var _0x1ab5eb=_(_0x1660d9)['keys']()[_0x391b('0x44')](function(_0x1edb5a){return _[_0x391b('0x4d')](_0x3992c3,['name',_0x1edb5a])?_0x1edb5a:undefined;})[_0x391b('0x4e')]()[_0x391b('0x41')]();if(_0x1660d9['Contact']){_0x1ab5eb['push'](_0x391b('0x4f'));}if(_0x1660d9[_0x391b('0x48')]){_0x1ab5eb['push'](_0x391b('0x48'));}if(_0x1ab5eb[_0x391b('0x2b')]>0x0){_0x1ab5eb[_0x391b('0x27')](function(_0x7c4611){if(_0x7c4611===_0x391b('0x8')){_0x959403['and'](_0x391b('0x50'),[][_0x391b('0x51')](_0x1660d9[_0x7c4611]));}else if(_0x7c4611==='Contact'){var _0x3b4838='%'+_0x1660d9[_0x7c4611]+'%';_0x959403['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x3b4838);}else if(_0x7c4611===_0x391b('0x48')){_0x959403['and'](_0x391b('0x4b'),_0x1660d9[_0x7c4611]);}else{_0x959403[_0x391b('0x46')]('c.'+_0x7c4611+_0x391b('0x52'),_0x1660d9[_0x7c4611]);}});}return _0x959403;}function parseQueryParameters(_0x39fdfd,_0x22a21e){var _0x2ce9a1=getSqlClauses();return Promise[_0x391b('0x53')]()[_0x391b('0x54')](function(){return parseModelFields(_0x39fdfd,_0x22a21e);})[_0x391b('0x54')](function(_0x3ff628){_0x2ce9a1[_0x391b('0x55')][_0x391b('0x46')](_0x3ff628);return parseTagParameter(_0x39fdfd['tag']);})[_0x391b('0x54')](function(_0x192020){_0x2ce9a1[_0x391b('0x45')]['clause'][_0x391b('0x46')](_0x192020);return parseSearchFilter(_0x39fdfd[_0x391b('0x56')]);})['then'](function(_0x11b458){_0x2ce9a1[_0x391b('0x56')]=_0x11b458;return _0x2ce9a1;});}function checkListsRestrictions(_0x44290b,_0x4862db,_0x463da6){var _0x209ed1=squel['expr']();return Promise[_0x391b('0x53')]()[_0x391b('0x54')](function(){if(_0x4862db[_0x391b('0x7')]&&_0x44290b[_0x391b('0x57')]===_0x391b('0x6')&&!_0x463da6){return _0x44290b['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x12efd4){if(_0x12efd4){if(_0x12efd4[_0x391b('0x2b')]===0x0){_0x209ed1[_0x391b('0x46')](_0x391b('0x58'));}else{_0x209ed1[_0x391b('0x46')](_0x391b('0x50'),_['map'](_0x12efd4,'id'));}}})[_0x391b('0x54')](function(){return _0x209ed1;});}function buildContactsQuery(_0x73716c,_0x4b1654,_0x262429,_0x4528c6,_0x4842a3,_0x205189){if(_0x4b1654){_0x4b1654=_0x262429[_0x391b('0x59')];}_0x73716c=addFieldsToQuery(_0x73716c,_0x4b1654,_0x4528c6,_0x205189,!![]);var _0x2339a3=squel[_0x391b('0xb')]();_0x2339a3=addFieldsToQuery(_0x2339a3,_0x4b1654,_0x4528c6,_0x205189,![]);if(_0x4528c6||_0x205189){_0x73716c=applyJoinClauses(_0x73716c,!![]);_0x73716c[_0x391b('0x5a')]('c.id');if(_0x262429[_0x391b('0x5b')]){_0x2339a3[_0x391b('0x5b')](_0x262429[_0x391b('0x5b')]);}if(_0x262429['offset']){_0x2339a3[_0x391b('0x5c')](_0x262429['offset']);}}else{_0x2339a3=applyJoinClauses(_0x2339a3,![]);_0x2339a3[_0x391b('0x5a')](_0x391b('0x5d'));if(_0x262429['limit']){_0x73716c[_0x391b('0x5b')](_0x262429[_0x391b('0x5b')]);}if(_0x262429[_0x391b('0x5c')]){_0x73716c['offset'](_0x262429['offset']);}}_0x2339a3[_0x391b('0x5e')](_0x4842a3);if(_0x262429[_0x391b('0x5f')]){_0x262429[_0x391b('0x5f')][_0x391b('0x27')](function(_0x4c949b){_0x73716c['order']('c.'+_0x4c949b[0x0],_0x4c949b[0x1]===_0x391b('0x60')?![]:!![]);_0x2339a3[_0x391b('0x5f')](_0x391b('0x61')+_0x4c949b[0x0],_0x4c949b[0x1]==='DESC'?![]:!![]);});}_0x2339a3[_0x391b('0xc')](_0x73716c,_0x391b('0xf'));return _0x2339a3;}function getFilteredContacts(_0x374b4c){var _0x2141f1=[];return db[_0x391b('0x43')][_0x391b('0x62')]({'attributes':['id',_0x391b('0x37'),'color'],'raw':!![]})['then'](function(_0x514d38){_0x2141f1=_[_0x391b('0x63')](_0x514d38,'id');var _0x269425={'type':db[_0x391b('0x64')][_0x391b('0x65')][_0x391b('0x66')],'model':db[_0x391b('0x67')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x391b('0x68')][_0x391b('0x69')](_0x374b4c[_0x391b('0x6a')](),_0x269425);})[_0x391b('0x54')](function(_0x3be6f6){_0x3be6f6[_0x391b('0x27')](function(_0x224a66){if(_0x224a66['TagIds']){_0x224a66[_0x391b('0x6b')]=[];_0x224a66[_0x391b('0x20')][_0x391b('0x2a')](',')[_0x391b('0x27')](function(_0x16b11e){_0x224a66['Tags'][_0x391b('0x22')](_0x2141f1[_0x16b11e]);});}delete _0x224a66[_0x391b('0x20')];});return _0x3be6f6;});}function countFilteredContacts(_0x98e852,_0x225ff5){var _0x51c45a=_0x98e852[_0x391b('0x6c')]();_0x51c45a[_0x391b('0x23')](_0x391b('0x6d'));_0x51c45a=applyJoinClauses(_0x51c45a,!![]);_0x98e852[_0x391b('0x5a')]('c.id');var _0x36eb60=utils[_0x391b('0x26')](_0x225ff5);if(!_[_0x391b('0x6e')](_0x36eb60)){_0x51c45a[_0x391b('0xe')](_0x391b('0x6f'),_0x36eb60);}var _0x41d611={'type':db[_0x391b('0x64')][_0x391b('0x65')][_0x391b('0x66')],'raw':!![]};return db[_0x391b('0x68')][_0x391b('0x69')](_0x51c45a[_0x391b('0x6a')](),_0x41d611)[_0x391b('0x54')](function(_0x571e68){return _0x571e68[0x0]['COUNT(*)'];});}module[_0x391b('0x70')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xe768=['value','start','Tag','map','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','keys','name','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','c.ListId\x20IS\x20NULL','attributes','select','c.id','limit','offset','group','having','order','DESC','subqry.','color','keyBy','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','Sequelize','exports','lodash','squel','../parsers/qs','../../mysqldb','role','agent','search','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','ListId','createdAt','updatedAt','deletedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','parseSearch','sqlOperator','conditions','find','fieldType','castTo','buildExpression','default','text'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xe768,0x164));var _0x8e76=function(_0x5ddc66,_0x1961b0){_0x5ddc66=_0x5ddc66-0x0;var _0x422030=_0xe768[_0x5ddc66];return _0x422030;};'use strict';var _=require(_0x8e76('0x0'));var squel=require(_0x8e76('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x8e76('0x2'));var utils=require('../interaction/utils');var db=require(_0x8e76('0x3'))['db'];function skipContactsQuery(_0x49dbe5,_0x5e335f){var _0x3991d2=![];if(_0x49dbe5[_0x8e76('0x4')]===_0x8e76('0x5')&&!_0x5e335f[_0x8e76('0x6')]&&!_0x5e335f['ListId']&&_0x5e335f[_0x8e76('0x7')]!==_0x8e76('0x8')){_0x3991d2=!![];}return _0x3991d2;}function getContactsSubquery(){return squel['select']()[_0x8e76('0x9')](_0x8e76('0xa'),'c')[_0x8e76('0xb')](_0x8e76('0xc'));}function applyJoinClauses(_0x24366c,_0x36e940){var _0x27a7f5=_0x36e940?'c':_0x8e76('0xd');_0x24366c[_0x8e76('0xe')](_0x8e76('0xf'),'uc',_0x8e76('0x10')+_0x27a7f5+_0x8e76('0x11'))[_0x8e76('0xe')](_0x8e76('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x27a7f5+_0x8e76('0x11'))['left_join'](_0x8e76('0x13'),'t',_0x8e76('0x14'));return _0x24366c;}function addFieldsToQuery(_0x28f4f8,_0x2f7b41,_0x189447,_0x33f424,_0x88a99){var _0x2c1d49=_0x88a99?'c':_0x8e76('0xd');if(!_0x2f7b41){_0x2f7b41=['id',_0x8e76('0x15'),_0x8e76('0x16'),_0x8e76('0x17'),_0x8e76('0x18'),_0x8e76('0x19'),_0x8e76('0x1a'),_0x8e76('0x1b'),'CompanyId',_0x8e76('0x1c'),_0x8e76('0x1d'),_0x8e76('0x1e'),_0x8e76('0x1f')];}else if(!_0x2f7b41['includes']('id')){_0x2f7b41['push']('id');}var _0x512f4c=_0x189447&&_0x88a99||!_0x189447&&!_0x88a99;if(_0x33f424){_0x512f4c=_0x33f424&&_0x88a99||!_0x33f424&&!_0x88a99;}_0x2f7b41[_0x8e76('0x20')](function(_0x16b939){if(_0x16b939===_0x8e76('0x1f')){if(_0x512f4c){_0x28f4f8[_0x8e76('0x21')](_0x8e76('0x22'),_0x16b939);}else if(_0x189447||_0x33f424){_0x28f4f8[_0x8e76('0x21')](_0x2c1d49+'.'+_0x16b939);}}else{_0x28f4f8[_0x8e76('0x21')](_0x2c1d49+'.'+_0x16b939);}});return _0x28f4f8;}function getSqlClauses(){var _0x29eae6={'default':squel[_0x8e76('0x23')](),'fields':squel['expr'](),'filter':squel[_0x8e76('0x23')](),'tags':{'clause':squel[_0x8e76('0x23')](),'ids':null},'user':{'clause':squel[_0x8e76('0x23')](),'skip':![]}};return _0x29eae6;}function parseTagParameter(_0x1e22e9){var _0x2f025a=squel[_0x8e76('0x23')]();if(_0x1e22e9){var _0x14b90c=utils[_0x8e76('0x24')](_0x1e22e9);_0x14b90c[_0x8e76('0x20')](function(_0x226ef9){_0x2f025a['or'](_0x8e76('0x25'),'%,'+_0x226ef9+',%');});}return _0x2f025a;}function parseSearchFilter(_0x31e9d5){var _0x3d68a3=squel[_0x8e76('0x23')]();if(_0x31e9d5){var _0x590329=_0x31e9d5[_0x8e76('0x26')]('\x5c','\x5c\x5c')[_0x8e76('0x26')](/'/g,'\x27\x27');if(_0x590329[_0x8e76('0x27')]('\x20')[_0x8e76('0x28')]>0x1){_0x3d68a3['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8e76('0x29')](_0x590329,!![]),null);}else{if(qs[_0x8e76('0x2a')](_0x590329)){_0x3d68a3['or'](_0x8e76('0x2b'),_0x590329+'%');_0x3d68a3['or'](_0x8e76('0x2c'),_0x590329+'%');_0x3d68a3['or']('c.mobile\x20LIKE\x20?',_0x590329+'%');_0x3d68a3['or'](_0x8e76('0x2d'),_0x590329+'%');}else if(qs[_0x8e76('0x2e')](_0x590329)){_0x3d68a3['or']('c.email\x20LIKE\x20?',_0x590329+'%');}else{_0x3d68a3['or']('c.firstName\x20LIKE\x20?','%'+_0x590329+'%');_0x3d68a3['or']('c.lastName\x20LIKE\x20?','%'+_0x590329+'%');_0x3d68a3['or']('c.email\x20LIKE\x20?','%'+_0x590329+'%');}}}return _0x3d68a3;}function parseAdvancedSearchFilter(_0x5cec38,_0x4893be){var _0x587c8f=getSqlClauses();var _0xe79bce=as[_0x8e76('0x2f')](_0x5cec38);var _0x1a8225=_0xe79bce[_0x8e76('0x30')];for(var _0x41fd60=0x0;_0x41fd60<_0xe79bce[_0x8e76('0x31')][_0x8e76('0x28')];_0x41fd60++){var _0x151521=_0xe79bce['conditions'][_0x41fd60];var _0x253c28='c';var _0x1b5320=_[_0x8e76('0x32')](_0x4893be,['name',_0x151521[_0x8e76('0x21')]]);if(_0x1b5320){if(_0x151521[_0x8e76('0x21')]==='dateOfBirth'||_0x1b5320[_0x8e76('0x33')]==='datetime'){_0x151521[_0x8e76('0x34')]='DATE';}var _0x503b65=as[_0x8e76('0x35')](_0x253c28,_0x1b5320['type'],_0x151521);_0x587c8f[_0x8e76('0x36')][_0x1a8225](_0x503b65[_0x8e76('0x37')],_0x503b65[_0x8e76('0x38')][_0x8e76('0x39')],_0x503b65[_0x8e76('0x38')]['end']);}else{if(_0x151521[_0x8e76('0x21')]===_0x8e76('0x3a')){var _0x1a8e3a=_0x151521[_0x8e76('0x38')]['split'](',')[_0x8e76('0x3b')](function(_0x12cf70){return Number(_0x12cf70);});var _0x58bf70=parseTagParameter(_0x1a8e3a);_0x587c8f[_0x8e76('0x3c')]['clause'][_0x8e76('0x3d')](_0x58bf70);_0x587c8f[_0x8e76('0x3c')][_0x8e76('0x3e')]=_0x1a8e3a;}else if(_0x151521[_0x8e76('0x21')]===_0x8e76('0x3f')){_0x587c8f[_0x8e76('0x40')][_0x8e76('0x41')]['and'](_0x8e76('0x42'),_0x151521[_0x8e76('0x38')]);_0x587c8f[_0x8e76('0x40')]['skip']=!![];}}}return _0x587c8f;}function parseModelFields(_0x2a0a3a,_0x4aa1ee){var _0xf0bf6a=squel[_0x8e76('0x23')]();var _0x29c0a8=_(_0x2a0a3a)[_0x8e76('0x43')]()[_0x8e76('0x3b')](function(_0x2f1410){return _['some'](_0x4aa1ee,[_0x8e76('0x44'),_0x2f1410])?_0x2f1410:undefined;})['compact']()[_0x8e76('0x38')]();if(_0x2a0a3a[_0x8e76('0x45')]){_0x29c0a8['push'](_0x8e76('0x45'));}if(_0x2a0a3a[_0x8e76('0x3f')]){_0x29c0a8['push'](_0x8e76('0x3f'));}if(_0x29c0a8[_0x8e76('0x28')]>0x0){_0x29c0a8[_0x8e76('0x20')](function(_0x3cdd0a){if(_0x3cdd0a==='ListId'){_0xf0bf6a['and'](_0x8e76('0x46'),[][_0x8e76('0x47')](_0x2a0a3a[_0x3cdd0a]));}else if(_0x3cdd0a===_0x8e76('0x45')){var _0x3ac654='%'+_0x2a0a3a[_0x3cdd0a]+'%';_0xf0bf6a['and'](_0x8e76('0x48'),_0x3ac654);}else if(_0x3cdd0a===_0x8e76('0x3f')){_0xf0bf6a[_0x8e76('0x3d')](_0x8e76('0x42'),_0x2a0a3a[_0x3cdd0a]);}else{_0xf0bf6a[_0x8e76('0x3d')]('c.'+_0x3cdd0a+_0x8e76('0x49'),_0x2a0a3a[_0x3cdd0a]);}});}return _0xf0bf6a;}function parseQueryParameters(_0x3d1cfb,_0x56c5a5){var _0x40d0fa=getSqlClauses();return Promise[_0x8e76('0x4a')]()['then'](function(){return parseModelFields(_0x3d1cfb,_0x56c5a5);})[_0x8e76('0x4b')](function(_0x11d2c6){_0x40d0fa[_0x8e76('0x4c')][_0x8e76('0x3d')](_0x11d2c6);return parseTagParameter(_0x3d1cfb['tag']);})[_0x8e76('0x4b')](function(_0xdd063a){_0x40d0fa[_0x8e76('0x3c')]['clause'][_0x8e76('0x3d')](_0xdd063a);return parseSearchFilter(_0x3d1cfb[_0x8e76('0x4d')]);})['then'](function(_0x26dc0b){_0x40d0fa[_0x8e76('0x4d')]=_0x26dc0b;return _0x40d0fa;});}function checkListsRestrictions(_0x357d73,_0x501b29,_0x9645b6){var _0x4c0ec6=squel[_0x8e76('0x23')]();return Promise[_0x8e76('0x4a')]()[_0x8e76('0x4b')](function(){if(_0x501b29[_0x8e76('0x6')]&&_0x357d73[_0x8e76('0x4')]===_0x8e76('0x5')&&!_0x9645b6){return _0x357d73['getLists']({'attributes':['id'],'raw':!![]});}})[_0x8e76('0x4b')](function(_0xb4fe96){if(_0xb4fe96){if(_0xb4fe96[_0x8e76('0x28')]===0x0){_0x4c0ec6['and'](_0x8e76('0x4e'));}else{_0x4c0ec6[_0x8e76('0x3d')](_0x8e76('0x46'),_[_0x8e76('0x3b')](_0xb4fe96,'id'));}}})[_0x8e76('0x4b')](function(){return _0x4c0ec6;});}function buildContactsQuery(_0x4357f8,_0x41d39b,_0xc70f4e,_0x48bf08,_0x43fca0,_0x1419d3){if(_0x41d39b){_0x41d39b=_0xc70f4e[_0x8e76('0x4f')];}_0x4357f8=addFieldsToQuery(_0x4357f8,_0x41d39b,_0x48bf08,_0x1419d3,!![]);var _0x52e546=squel[_0x8e76('0x50')]();_0x52e546=addFieldsToQuery(_0x52e546,_0x41d39b,_0x48bf08,_0x1419d3,![]);if(_0x48bf08||_0x1419d3){_0x4357f8=applyJoinClauses(_0x4357f8,!![]);_0x4357f8['group'](_0x8e76('0x51'));if(_0xc70f4e[_0x8e76('0x52')]){_0x52e546[_0x8e76('0x52')](_0xc70f4e[_0x8e76('0x52')]);}if(_0xc70f4e['offset']){_0x52e546['offset'](_0xc70f4e[_0x8e76('0x53')]);}}else{_0x52e546=applyJoinClauses(_0x52e546,![]);_0x52e546[_0x8e76('0x54')]('subqry.id');if(_0xc70f4e[_0x8e76('0x52')]){_0x4357f8[_0x8e76('0x52')](_0xc70f4e[_0x8e76('0x52')]);}if(_0xc70f4e[_0x8e76('0x53')]){_0x4357f8[_0x8e76('0x53')](_0xc70f4e[_0x8e76('0x53')]);}}_0x52e546[_0x8e76('0x55')](_0x43fca0);if(_0xc70f4e['order']){_0xc70f4e[_0x8e76('0x56')][_0x8e76('0x20')](function(_0x5b1d77){_0x4357f8[_0x8e76('0x56')]('c.'+_0x5b1d77[0x0],_0x5b1d77[0x1]===_0x8e76('0x57')?![]:!![]);_0x52e546[_0x8e76('0x56')](_0x8e76('0x58')+_0x5b1d77[0x0],_0x5b1d77[0x1]===_0x8e76('0x57')?![]:!![]);});}_0x52e546[_0x8e76('0x9')](_0x4357f8,'subqry');return _0x52e546;}function getFilteredContacts(_0x17663b){var _0x5cc7a6=[];return db[_0x8e76('0x3a')]['findAll']({'attributes':['id','name',_0x8e76('0x59')],'raw':!![]})[_0x8e76('0x4b')](function(_0x3e05c6){_0x5cc7a6=_[_0x8e76('0x5a')](_0x3e05c6,'id');var _0x174f42={'type':db['Sequelize'][_0x8e76('0x5b')][_0x8e76('0x5c')],'model':db[_0x8e76('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8e76('0x5e')][_0x8e76('0x5f')](_0x17663b[_0x8e76('0x60')](),_0x174f42);})[_0x8e76('0x4b')](function(_0x4db850){_0x4db850[_0x8e76('0x20')](function(_0x16e769){if(_0x16e769[_0x8e76('0x1f')]){_0x16e769[_0x8e76('0x61')]=[];_0x16e769[_0x8e76('0x1f')]['split'](',')['forEach'](function(_0x8073cc){_0x16e769[_0x8e76('0x61')]['push'](_0x5cc7a6[_0x8073cc]);});}delete _0x16e769[_0x8e76('0x1f')];});return _0x4db850;});}function countFilteredContacts(_0x3cac4e,_0x40c12f){var _0x1882fc=_0x3cac4e[_0x8e76('0x62')]();_0x1882fc[_0x8e76('0x21')](_0x8e76('0x63'));_0x1882fc=applyJoinClauses(_0x1882fc,!![]);_0x3cac4e[_0x8e76('0x54')](_0x8e76('0x51'));var _0x1b3736=utils['getSelectedTags'](_0x40c12f);if(!_[_0x8e76('0x64')](_0x1b3736)){_0x1882fc[_0x8e76('0xb')]('t.id\x20IN\x20?',_0x1b3736);}var _0x59fc09={'type':db[_0x8e76('0x65')]['QueryTypes'][_0x8e76('0x5c')],'raw':!![]};return db[_0x8e76('0x5e')][_0x8e76('0x5f')](_0x1882fc[_0x8e76('0x60')](),_0x59fc09)[_0x8e76('0x4b')](function(_0x2ccb8f){return _0x2ccb8f[0x0][_0x8e76('0x63')];});}module[_0x8e76('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index ad996f4..956823a 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 _0x26e7=['hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','write','final','binary','close','createDecipher','update','end','unlink','secret','utf8','base64','decryptString','crypto','../../config/environment','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf'];(function(_0x3ca2d2,_0x4e596e){var _0x3c52b4=function(_0x1661f3){while(--_0x1661f3){_0x3ca2d2['push'](_0x3ca2d2['shift']());}};_0x3c52b4(++_0x4e596e);}(_0x26e7,0x10a));var _0x726e=function(_0xca54f9,_0x1d837b){_0xca54f9=_0xca54f9-0x0;var _0x183c63=_0x26e7[_0xca54f9];return _0x183c63;};'use strict';var crypto=require(_0x726e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x726e('0x1'));var logger=require(_0x726e('0x2'))(_0x726e('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x726e('0x4')][_0x726e('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x726e('0x6')};if(config[_0x726e('0x7')]&&config[_0x726e('0x7')][_0x726e('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x726e('0x8')]=config[_0x726e('0x7')][_0x726e('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x726e('0x9')](',\x20');logger['error'](config[_0x726e('0x7')]['algorithm'],_0x726e('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x17bbd2){return AES_SUPPORTED_RX['test'](_0x17bbd2);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x726e('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x41b5e4){return getSupportedCiphers()[_0x726e('0xc')](_0x41b5e4)>-0x1;}function combineOptions(_0x259ceb){var _0x30b37b={};for(var _0x587b3d in fileOptions){if(fileOptions[_0x726e('0xd')](_0x587b3d)){_0x30b37b[_0x587b3d]=fileOptions[_0x587b3d];}}if(_0x259ceb){for(var _0x47763f in _0x259ceb){if(_0x259ceb['hasOwnProperty'](_0x47763f)){_0x30b37b[_0x47763f]=_0x259ceb[_0x47763f];}}}return _0x30b37b;}exports[_0x726e('0xe')]=function(_0x357fa2,_0x5660d2,_0x5465e4,_0x383cf4){return new BPromise(function(_0x49f921,_0x3916e6){_0x383cf4=combineOptions(_0x383cf4);var _0x24b7bc=new Buffer(_0x5465e4);var _0x5747dc=fs[_0x726e('0xf')](_0x357fa2);var _0x1fec9c=fs[_0x726e('0x10')](_0x5660d2);var _0x293cf8=crypto[_0x726e('0x11')](_0x383cf4[_0x726e('0x8')],_0x24b7bc);_0x5747dc['on'](_0x726e('0x12'),function(_0x566928){var _0x561ea5=new Buffer(_0x293cf8['update'](_0x566928),'binary');_0x1fec9c[_0x726e('0x13')](_0x561ea5);});_0x5747dc['on']('end',function(){try{var _0x2a3e42=new Buffer(_0x293cf8[_0x726e('0x14')](_0x726e('0x15')),'binary');_0x1fec9c[_0x726e('0x13')](_0x2a3e42);_0x1fec9c['end']();_0x1fec9c['on'](_0x726e('0x16'),function(){return _0x49f921(_0x5660d2);});}catch(_0x52ce99){fs['unlink'](_0x5660d2);return _0x3916e6(_0x52ce99);}});});};exports['decryptFile']=function(_0x2ceb65,_0x40e4f9,_0xe58ffd,_0x3968a1){return new BPromise(function(_0x2262c8,_0xf6da2d){_0x3968a1=combineOptions(_0x3968a1);var _0x44b34f=new Buffer(_0xe58ffd);var _0x266582=fs[_0x726e('0xf')](_0x2ceb65);var _0x2921df=fs['createWriteStream'](_0x40e4f9);var _0x18a515=crypto[_0x726e('0x17')](_0x3968a1[_0x726e('0x8')],_0x44b34f);_0x266582['on'](_0x726e('0x12'),function(_0x460118){var _0x5f0ac8=new Buffer(_0x18a515[_0x726e('0x18')](_0x460118),_0x726e('0x15'));_0x2921df['write'](_0x5f0ac8);});_0x266582['on'](_0x726e('0x19'),function(){try{var _0x129813=new Buffer(_0x18a515[_0x726e('0x14')](_0x726e('0x15')),_0x726e('0x15'));_0x2921df[_0x726e('0x13')](_0x129813);_0x2921df[_0x726e('0x19')]();_0x2921df['on']('close',function(){return _0x2262c8(_0x40e4f9);});}catch(_0x290d5){fs[_0x726e('0x1a')](_0x40e4f9);return _0xf6da2d(_0x290d5);}});});};exports['encryptString']=function(_0x4883fb,_0x7d116a,_0x116d04){var _0x23e50a=_0x116d04||stringOptions['algorithm'];var _0x52c5b0=_0x7d116a||stringOptions[_0x726e('0x1b')];var _0x2839ae=crypto[_0x726e('0x11')](_0x23e50a,_0x52c5b0);var _0x3f1512=_0x2839ae['update'](_0x4883fb,_0x726e('0x1c'),_0x726e('0x1d'));_0x3f1512+=_0x2839ae['final'](_0x726e('0x1d'));return _0x3f1512;};exports[_0x726e('0x1e')]=function(_0x369872,_0x497c5a,_0x297a3b){var _0x5caaeb=_0x297a3b||stringOptions[_0x726e('0x8')];var _0x41d179=_0x497c5a||stringOptions[_0x726e('0x1b')];var _0x24aec9=crypto[_0x726e('0x17')](_0x5caaeb,_0x41d179);var _0xe7e0b6=_0x24aec9[_0x726e('0x18')](_0x369872,_0x726e('0x1d'),_0x726e('0x1c'));_0xe7e0b6+=_0x24aec9[_0x726e('0x14')]('utf8');return _0xe7e0b6;}; \ No newline at end of file +var _0xefa8=['unlink','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','final','write','end','close'];(function(_0x2b8bbe,_0x37eb6a){var _0x1bb210=function(_0x116173){while(--_0x116173){_0x2b8bbe['push'](_0x2b8bbe['shift']());}};_0x1bb210(++_0x37eb6a);}(_0xefa8,0x14b));var _0x8efa=function(_0xcbb92a,_0x56dcfc){_0xcbb92a=_0xcbb92a-0x0;var _0x37ae52=_0xefa8[_0xcbb92a];return _0x37ae52;};'use strict';var crypto=require(_0x8efa('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x8efa('0x1'));var config=require(_0x8efa('0x2'));var logger=require(_0x8efa('0x3'))(_0x8efa('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8efa('0x5')][_0x8efa('0x6')],'algorithm':_0x8efa('0x7')};const fileOptions={'algorithm':_0x8efa('0x8')};if(config[_0x8efa('0x9')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8efa('0x9')]['algorithm']);if(isSupported){fileOptions[_0x8efa('0xa')]=config[_0x8efa('0x9')][_0x8efa('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8efa('0xb')](',\x20');logger[_0x8efa('0xc')](config[_0x8efa('0x9')][_0x8efa('0xa')],_0x8efa('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x53a796){return AES_SUPPORTED_RX[_0x8efa('0xe')](_0x53a796);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x8efa('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x33cbd8){return getSupportedCiphers()[_0x8efa('0x10')](_0x33cbd8)>-0x1;}function combineOptions(_0x48ac4b){var _0x3207f9={};for(var _0x332e1a in fileOptions){if(fileOptions[_0x8efa('0x11')](_0x332e1a)){_0x3207f9[_0x332e1a]=fileOptions[_0x332e1a];}}if(_0x48ac4b){for(var _0x37c423 in _0x48ac4b){if(_0x48ac4b[_0x8efa('0x11')](_0x37c423)){_0x3207f9[_0x37c423]=_0x48ac4b[_0x37c423];}}}return _0x3207f9;}exports[_0x8efa('0x12')]=function(_0x1fa669,_0x4cdca1,_0x1c1bc9,_0x570b13){return new BPromise(function(_0x147cb1,_0x2c1e66){_0x570b13=combineOptions(_0x570b13);var _0x4fda1c=new Buffer(_0x1c1bc9);var _0x528c05=fs[_0x8efa('0x13')](_0x1fa669);var _0xfce50c=fs[_0x8efa('0x14')](_0x4cdca1);var _0x4d48c6=crypto[_0x8efa('0x15')](_0x570b13[_0x8efa('0xa')],_0x4fda1c);_0x528c05['on'](_0x8efa('0x16'),function(_0x3fcf02){var _0x217de4=new Buffer(_0x4d48c6[_0x8efa('0x17')](_0x3fcf02),_0x8efa('0x18'));_0xfce50c['write'](_0x217de4);});_0x528c05['on']('end',function(){try{var _0x451736=new Buffer(_0x4d48c6[_0x8efa('0x19')]('binary'),_0x8efa('0x18'));_0xfce50c[_0x8efa('0x1a')](_0x451736);_0xfce50c[_0x8efa('0x1b')]();_0xfce50c['on'](_0x8efa('0x1c'),function(){return _0x147cb1(_0x4cdca1);});}catch(_0x3f3873){fs[_0x8efa('0x1d')](_0x4cdca1);return _0x2c1e66(_0x3f3873);}});});};exports['decryptFile']=function(_0x5d9be5,_0x29e554,_0x13a601,_0xa85fd9){return new BPromise(function(_0x5cded6,_0x1382d4){_0xa85fd9=combineOptions(_0xa85fd9);var _0x55cc29=new Buffer(_0x13a601);var _0x53506d=fs[_0x8efa('0x13')](_0x5d9be5);var _0x31d0be=fs[_0x8efa('0x14')](_0x29e554);var _0x443505=crypto[_0x8efa('0x1e')](_0xa85fd9[_0x8efa('0xa')],_0x55cc29);_0x53506d['on'](_0x8efa('0x16'),function(_0x52dd59){var _0x770d2f=new Buffer(_0x443505[_0x8efa('0x17')](_0x52dd59),'binary');_0x31d0be['write'](_0x770d2f);});_0x53506d['on'](_0x8efa('0x1b'),function(){try{var _0x348c9f=new Buffer(_0x443505['final']('binary'),'binary');_0x31d0be[_0x8efa('0x1a')](_0x348c9f);_0x31d0be[_0x8efa('0x1b')]();_0x31d0be['on']('close',function(){return _0x5cded6(_0x29e554);});}catch(_0x3bb18c){fs[_0x8efa('0x1d')](_0x29e554);return _0x1382d4(_0x3bb18c);}});});};exports[_0x8efa('0x1f')]=function(_0x303aa7,_0x39adcf,_0x9a019){var _0x99866e=_0x9a019||stringOptions[_0x8efa('0xa')];var _0x56471e=_0x39adcf||stringOptions[_0x8efa('0x20')];var _0x34ece5=crypto[_0x8efa('0x15')](_0x99866e,_0x56471e);var _0x1b8671=_0x34ece5[_0x8efa('0x17')](_0x303aa7,_0x8efa('0x21'),'base64');_0x1b8671+=_0x34ece5[_0x8efa('0x19')](_0x8efa('0x22'));return _0x1b8671;};exports[_0x8efa('0x23')]=function(_0x5da35c,_0x16e138,_0x3a37ec){var _0x49924d=_0x3a37ec||stringOptions[_0x8efa('0xa')];var _0x53c1f6=_0x16e138||stringOptions['secret'];var _0x229b7b=crypto[_0x8efa('0x1e')](_0x49924d,_0x53c1f6);var _0x52a232=_0x229b7b[_0x8efa('0x17')](_0x5da35c,'base64',_0x8efa('0x21'));_0x52a232+=_0x229b7b['final']('utf8');return _0x52a232;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index d3c9c68..9ca9e14 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 _0xb537=['range','num','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','each','then','csv','join','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','to-csv','bluebird','rimraf','dbH','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length'];(function(_0x594c5d,_0x286bd7){var _0x1c9f2a=function(_0x55a7c){while(--_0x55a7c){_0x594c5d['push'](_0x594c5d['shift']());}};_0x1c9f2a(++_0x286bd7);}(_0xb537,0x139));var _0x7b53=function(_0x2181d7,_0x39696d){_0x2181d7=_0x2181d7-0x0;var _0x3efc47=_0xb537[_0x2181d7];return _0x3efc47;};'use strict';var util=require('util');var path=require(_0x7b53('0x0'));var _=require(_0x7b53('0x1'));var csv=require(_0x7b53('0x2'));var fs=require('fs');var BPromise=require(_0x7b53('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x7b53('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7b53('0x5')];var logger=require('../../config/logger')(_0x7b53('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7b53('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x13cc9d,_0x2a79f6){var _0x2de10a={'status':_0x13cc9d};var _0x1cd90e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a79f6){_0x2de10a['savename']=_0x2a79f6;}return db[_0x7b53('0x8')][_0x7b53('0x9')](_0x2de10a,_0x1cd90e);}function main(){var _0x40701b=0x1388;var _0x3dffce;logger[_0x7b53('0xa')](util['format'](_0x7b53('0xb'),EXTRACTED_REPORT_ID,_0x7b53('0xc')));return db[_0x7b53('0xd')][_0x7b53('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7b53('0xf'),'splitSizeCsv']})['then'](function(_0x4e5353){if(_0x4e5353){_0x3dffce=_0x4e5353;_0x40701b=_0x3dffce[_0x7b53('0x10')]||0x1388;}})['then'](function(){return dbH[_0x7b53('0x11')][_0x7b53('0x12')](util['format'](_0x7b53('0x13'),QUERY),{'type':dbH['sequelize'][_0x7b53('0x14')]['SELECT']});})['then'](function(_0x406438){if(!_0x406438[0x0]['num']){return analyticExtractedReport(_0x7b53('0x15'));}var _0x1d7fd0=[];var _0xbcc80=0x0;if(_0x3dffce[_0x7b53('0xf')]){if(_0x406438&&_0x406438[_0x7b53('0x16')]){var _0x56e484=_[_0x7b53('0x17')](_0x406438[0x0][_0x7b53('0x18')]/_0x40701b);var _0x25543a=Number[_0x7b53('0x19')](_0x406438[0x0][_0x7b53('0x18')]/_0x40701b)?_0x406438[0x0][_0x7b53('0x18')]%_0x40701b:0x0;_0x56e484[_0x7b53('0x1a')](function(_0x28bfda){if(_0x28bfda>0x0){_0xbcc80+=_0x40701b;}_0x1d7fd0[_0x7b53('0x1b')](dbH[_0x7b53('0x11')][_0x7b53('0x12')](util[_0x7b53('0x1c')](_0x7b53('0x1d'),QUERY,_0x40701b,_0xbcc80),{'type':dbH['sequelize'][_0x7b53('0x14')][_0x7b53('0x1e')]}));});if(_0x25543a>0x0){_0xbcc80+=_0x40701b;_0x1d7fd0[_0x7b53('0x1b')](dbH[_0x7b53('0x11')][_0x7b53('0x12')](util[_0x7b53('0x1c')](_0x7b53('0x1d'),QUERY,_0x25543a,_0xbcc80),{'type':dbH[_0x7b53('0x11')][_0x7b53('0x14')][_0x7b53('0x1e')]}));}}}else{_0x1d7fd0[_0x7b53('0x1b')](dbH[_0x7b53('0x11')]['query'](QUERY,{'type':dbH[_0x7b53('0x11')][_0x7b53('0x14')][_0x7b53('0x1e')]}));}var _0x1bad23=path[_0x7b53('0x1f')](PATH);var _0xdd03e4=path[_0x7b53('0x20')](PATH,_0x7b53('0x21'));var _0x622622=_0x3dffce[_0x7b53('0xf')]&&_0x1d7fd0[_0x7b53('0x16')]>0x1;var _0x3fe642=[];if(!fs[_0x7b53('0x22')](path['join'](_0x1bad23,_0xdd03e4))&&_0x622622){fs['mkdirSync'](path['join'](_0x1bad23,_0xdd03e4));}return BPromise[_0x7b53('0x23')](_0x1d7fd0,function(_0x28d896){_0x3fe642[_0x7b53('0x1b')](_0x28d896);})[_0x7b53('0x24')](function(){for(var _0x206cf2=0x0;_0x206cf2<_0x3fe642[_0x7b53('0x16')];_0x206cf2+=0x1){var _0x4fa2c4;var _0x22329a=_0x3fe642[_0x206cf2];if(_0x622622){_0x4fa2c4=path['join'](_0x1bad23,_0xdd03e4,util[_0x7b53('0x1c')]('%s%d.%s',_0xdd03e4,_0x206cf2,_0x7b53('0x25')));}else{_0x4fa2c4=path[_0x7b53('0x26')](_0x1bad23,util[_0x7b53('0x1c')](_0x7b53('0x27'),_0xdd03e4,_0x7b53('0x25')));}fs[_0x7b53('0x28')](_0x4fa2c4,csv(_0x22329a));}})['then'](function(){if(_0x622622){return new Promise(function(_0x4cf1ed){zipdir(path[_0x7b53('0x26')](_0x1bad23,_0xdd03e4),{'saveTo':path[_0x7b53('0x26')](_0x1bad23,util[_0x7b53('0x1c')]('%s.%s',_0xdd03e4,_0x7b53('0x29')))},function(_0x2f9bfb,_0x3e1f4e){rimraf(path[_0x7b53('0x26')](_0x1bad23,_0xdd03e4),function(){});_0x4cf1ed('zip\x20finished');});});}})[_0x7b53('0x24')](function(){logger[_0x7b53('0xa')](util[_0x7b53('0x1c')](_0x7b53('0x2a'),EXTRACTED_REPORT_ID,_0x7b53('0xc')));return analyticExtractedReport('Completed',_0x622622?util[_0x7b53('0x1c')](_0x7b53('0x27'),_0xdd03e4,_0x622622?_0x7b53('0x29'):_0x7b53('0x25')):null);});})[_0x7b53('0x2b')](function(_0x58477b){logger['info'](util[_0x7b53('0x1c')](_0x7b53('0x2c'),EXTRACTED_REPORT_ID,_0x7b53('0xc')),util[_0x7b53('0x2d')](_0x58477b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7b53('0x2e'));})[_0x7b53('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa526=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','sequelize','QueryTypes','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','basename','.csv','length','existsSync','join','%s%d.%s','%s.%s','writeFileSync','zip\x20finished','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','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport'];(function(_0x4c43c1,_0x240778){var _0x5e344c=function(_0x439289){while(--_0x439289){_0x4c43c1['push'](_0x4c43c1['shift']());}};_0x5e344c(++_0x240778);}(_0xa526,0x165));var _0x6a52=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa526[_0x82129b];return _0x2ae5dc;};'use strict';var util=require(_0x6a52('0x0'));var path=require(_0x6a52('0x1'));var _=require(_0x6a52('0x2'));var csv=require(_0x6a52('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x6a52('0x4'));var rimraf=require(_0x6a52('0x5'));var db=require(_0x6a52('0x6'))['db'];var dbH=require(_0x6a52('0x6'))[_0x6a52('0x7')];var logger=require(_0x6a52('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6a52('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xbfa0ea,_0x3631b8){var _0x1191d5={'status':_0xbfa0ea};var _0x9c3f9e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3631b8){_0x1191d5['savename']=_0x3631b8;}return db[_0x6a52('0xa')][_0x6a52('0xb')](_0x1191d5,_0x9c3f9e);}function main(){var _0x1ff1f8=0x1388;var _0xe30a67;logger[_0x6a52('0xc')](util[_0x6a52('0xd')](_0x6a52('0xe'),EXTRACTED_REPORT_ID,_0x6a52('0xf')));return db[_0x6a52('0x10')][_0x6a52('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6a52('0x12'),'splitSizeCsv']})[_0x6a52('0x13')](function(_0x5a461d){if(_0x5a461d){_0xe30a67=_0x5a461d;_0x1ff1f8=_0xe30a67['splitSizeCsv']||0x1388;}})[_0x6a52('0x13')](function(){return dbH[_0x6a52('0x14')]['query'](util[_0x6a52('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x6a52('0x15')]['SELECT']});})[_0x6a52('0x13')](function(_0x9fae0b){if(!_0x9fae0b[0x0][_0x6a52('0x16')]){return analyticExtractedReport(_0x6a52('0x17'));}var _0x39d658=[];var _0x7f233f=0x0;if(_0xe30a67[_0x6a52('0x12')]){if(_0x9fae0b&&_0x9fae0b['length']){var _0x4503b7=_[_0x6a52('0x18')](_0x9fae0b[0x0][_0x6a52('0x16')]/_0x1ff1f8);var _0x8e0041=Number[_0x6a52('0x19')](_0x9fae0b[0x0][_0x6a52('0x16')]/_0x1ff1f8)?_0x9fae0b[0x0][_0x6a52('0x16')]%_0x1ff1f8:0x0;_0x4503b7['forEach'](function(_0x4d9c20){if(_0x4d9c20>0x0){_0x7f233f+=_0x1ff1f8;}_0x39d658[_0x6a52('0x1a')](dbH[_0x6a52('0x14')]['query'](util[_0x6a52('0xd')](_0x6a52('0x1b'),QUERY,_0x1ff1f8,_0x7f233f),{'type':dbH[_0x6a52('0x14')][_0x6a52('0x15')][_0x6a52('0x1c')]}));});if(_0x8e0041>0x0){_0x7f233f+=_0x1ff1f8;_0x39d658['push'](dbH[_0x6a52('0x14')][_0x6a52('0x1d')](util[_0x6a52('0xd')](_0x6a52('0x1b'),QUERY,_0x8e0041,_0x7f233f),{'type':dbH[_0x6a52('0x14')]['QueryTypes'][_0x6a52('0x1c')]}));}}}else{_0x39d658[_0x6a52('0x1a')](dbH[_0x6a52('0x14')][_0x6a52('0x1d')](QUERY,{'type':dbH[_0x6a52('0x14')]['QueryTypes']['SELECT']}));}var _0x43905a=path['dirname'](PATH);var _0x562ed2=path[_0x6a52('0x1e')](PATH,_0x6a52('0x1f'));var _0x5e5fe6=_0xe30a67[_0x6a52('0x12')]&&_0x39d658[_0x6a52('0x20')]>0x1;var _0x4dc470=[];if(!fs[_0x6a52('0x21')](path[_0x6a52('0x22')](_0x43905a,_0x562ed2))&&_0x5e5fe6){fs['mkdirSync'](path[_0x6a52('0x22')](_0x43905a,_0x562ed2));}return BPromise['each'](_0x39d658,function(_0x18d338){_0x4dc470[_0x6a52('0x1a')](_0x18d338);})['then'](function(){for(var _0x2a675f=0x0;_0x2a675f<_0x4dc470[_0x6a52('0x20')];_0x2a675f+=0x1){var _0x563863;var _0x117b25=_0x4dc470[_0x2a675f];if(_0x5e5fe6){_0x563863=path[_0x6a52('0x22')](_0x43905a,_0x562ed2,util['format'](_0x6a52('0x23'),_0x562ed2,_0x2a675f,'csv'));}else{_0x563863=path[_0x6a52('0x22')](_0x43905a,util[_0x6a52('0xd')](_0x6a52('0x24'),_0x562ed2,'csv'));}fs[_0x6a52('0x25')](_0x563863,csv(_0x117b25));}})['then'](function(){if(_0x5e5fe6){return new Promise(function(_0x3220f8){zipdir(path[_0x6a52('0x22')](_0x43905a,_0x562ed2),{'saveTo':path[_0x6a52('0x22')](_0x43905a,util[_0x6a52('0xd')](_0x6a52('0x24'),_0x562ed2,'zip'))},function(_0x258528,_0x2303a5){rimraf(path[_0x6a52('0x22')](_0x43905a,_0x562ed2),function(){});_0x3220f8(_0x6a52('0x26'));});});}})[_0x6a52('0x13')](function(){logger[_0x6a52('0xc')](util[_0x6a52('0xd')](_0x6a52('0x27'),EXTRACTED_REPORT_ID,_0x6a52('0xf')));return analyticExtractedReport(_0x6a52('0x28'),_0x5e5fe6?util[_0x6a52('0xd')](_0x6a52('0x24'),_0x562ed2,_0x5e5fe6?'zip':'csv'):null);});})[_0x6a52('0x29')](function(_0x4d3f70){logger['info'](util['format'](_0x6a52('0x2a'),EXTRACTED_REPORT_ID,_0x6a52('0xf')),util['inspect'](_0x4d3f70,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6a52('0x2b'));})[_0x6a52('0x2c')](function(){process[_0x6a52('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 8b4a71e..08ecfb6 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 _0xac1b=['exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','pipe','createWriteStream','finish','error','createPdfFromHTML','catch','path','moment','html-to-pdfmake','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','body','push','chunk','name','startDate','format','endDate','header','before','landscape','\x20/\x20','footer','Arial','num','Setting','find','splitSizePdf','then','split','range','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','.pdf','existsSync','mkdirSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','info','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed'];(function(_0x1d0f87,_0x3c8bfe){var _0x1bc6ad=function(_0x528991){while(--_0x528991){_0x1d0f87['push'](_0x1d0f87['shift']());}};_0x1bc6ad(++_0x3c8bfe);}(_0xac1b,0xb6));var _0xbac1=function(_0x262863,_0x3d10d1){_0x262863=_0x262863-0x0;var _0x39db98=_0xac1b[_0x262863];return _0x39db98;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xbac1('0x0'));var moment=require(_0xbac1('0x1'));var htmlToPdfmake=require(_0xbac1('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xbac1('0x3'));var JSDOM=require(_0xbac1('0x4'))[_0xbac1('0x5')];var window=new JSDOM('')[_0xbac1('0x6')];var BPromise=require('bluebird');var db=require(_0xbac1('0x7'))['db'];var dbH=require(_0xbac1('0x7'))[_0xbac1('0x8')];var logger=require(_0xbac1('0x9'))(_0xbac1('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xbac1('0xb')][0x2]);var QUERY=process[_0xbac1('0xb')][0x3];var PATH=process[_0xbac1('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xbac1('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x499a5d,_0x44ff00){var _0x525aba={'status':_0x499a5d};var _0x41ad4f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x44ff00){_0x525aba['savename']=_0x44ff00;}return db[_0xbac1('0xd')][_0xbac1('0xe')](_0x525aba,_0x41ad4f);}function getHeaders(_0x217ee8){return _[_0xbac1('0xf')](_0x217ee8,function(_0x3fcaa2){return{'text':_0x3fcaa2,'style':_0xbac1('0x10')};});}function getRows(_0x41a246,_0x53e70f){return _[_0xbac1('0xf')](_0x53e70f,function(_0x27b6ea){return _(_0x27b6ea)[_0xbac1('0x11')](_0x41a246)[_0xbac1('0xf')](function(_0x4b0c4b){return _0x4b0c4b?_[_0xbac1('0x12')](_0x4b0c4b):'';})[_0xbac1('0x13')]();});}function createTable(_0x162786,_0x279043){var _0x17ffe3={'widths':_[_0xbac1('0x14')](Array(_0x162786[_0xbac1('0x15')]),0x91),'heights':function(_0x1d39d2){return _0x1d39d2===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x488825=getHeaders(_0x162786);_0x17ffe3[_0xbac1('0x16')][_0xbac1('0x17')](_0x488825);var _0x4cb905=getRows(_0x162786,_0x279043);_0x17ffe3['body']=_0x17ffe3[_0xbac1('0x16')]['concat'](_0x4cb905);return _0x17ffe3;}function createTables(_0x3bf494){var _0x21a3d9=[];var _0xf8ac4c=_[_0xbac1('0x18')](Object['keys'](_0x3bf494[0x0]),0x5);_0xf8ac4c['forEach'](function(_0x148da3){_0x21a3d9[_0xbac1('0x17')](createTable(_0x148da3,_0x3bf494));});return _0x21a3d9;}function getPDFDocDefinition(_0x974537){var _0x5a39f3=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xbac1('0x19')],moment(EXTRACTED_REPORT[_0xbac1('0x1a')])[_0xbac1('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xbac1('0x1c')])[_0xbac1('0x1b')](FORMAT));var _0x18d898=[];for(var _0x196d54=0x0;_0x196d54<_0x974537['length'];_0x196d54++){var _0x1f6cff=[];if(_0x196d54===0x0){_0x1f6cff[_0xbac1('0x17')]({'text':_0x5a39f3,'style':_0xbac1('0x1d')});}var _0x1911bc={'table':_0x974537[_0x196d54]};if(_0x196d54>0x0){_0x1911bc['pageBreak']=_0xbac1('0x1e');_0x1911bc['margin']=[0x0,0x46,0x0,0x0];}_0x1f6cff[_0xbac1('0x17')](_0x1911bc);_0x18d898['push'](_0x1f6cff);}return{'pageSize':'A4','pageOrientation':_0xbac1('0x1f'),'content':_0x18d898,'footer':function(_0x4424ec,_0x30b9d1){return{'text':_0x4424ec[_0xbac1('0x12')]()+_0xbac1('0x20')+_0x30b9d1,'style':_0xbac1('0x21')};},'defaultStyle':{'font':_0xbac1('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xccb4fe){var _0x599c7a=0x1388;var _0x2c25f3;if(!_0xccb4fe[0x0][_0xbac1('0x23')]){return analyticExtractedReport('Empty');}return db[_0xbac1('0x24')][_0xbac1('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xbac1('0x26')]})[_0xbac1('0x27')](function(_0x35b86d){if(_0x35b86d){_0x2c25f3=_0x35b86d;_0x599c7a=_0x2c25f3[_0xbac1('0x26')]||0x3e8;}})[_0xbac1('0x27')](function(){var _0x530c65=[];var _0x41bcc5=0x0;if(_0x2c25f3[_0xbac1('0x28')]){if(_0xccb4fe&&_0xccb4fe[_0xbac1('0x15')]){var _0xeab93d=_[_0xbac1('0x29')](_0xccb4fe[0x0][_0xbac1('0x23')]/_0x599c7a);var _0x44adba=Number['isInteger'](_0xccb4fe[0x0][_0xbac1('0x23')]/_0x599c7a)?_0xccb4fe[0x0]['num']%_0x599c7a:0x0;_0xeab93d[_0xbac1('0x2a')](function(_0x8b9356){if(_0x8b9356>0x0){_0x41bcc5+=_0x599c7a;}_0x530c65[_0xbac1('0x17')](dbH[_0xbac1('0x2b')]['query'](util[_0xbac1('0x1b')](_0xbac1('0x2c'),QUERY,_0x599c7a,_0x41bcc5),{'type':dbH['sequelize'][_0xbac1('0x2d')]['SELECT']}));});if(_0x44adba>0x0){_0x41bcc5+=_0x599c7a;_0x530c65[_0xbac1('0x17')](dbH[_0xbac1('0x2b')]['query'](util[_0xbac1('0x1b')](_0xbac1('0x2c'),QUERY,_0x44adba,_0x41bcc5),{'type':dbH[_0xbac1('0x2b')][_0xbac1('0x2d')][_0xbac1('0x2e')]}));}}}else{_0x530c65[_0xbac1('0x17')](dbH['sequelize'][_0xbac1('0x2f')](QUERY,{'type':dbH[_0xbac1('0x2b')][_0xbac1('0x2d')][_0xbac1('0x2e')]}));}var _0x30bdc6=path['dirname'](PATH);var _0xe4a12d=path['basename'](PATH,_0xbac1('0x30'));var _0x44f240=_0x2c25f3[_0xbac1('0x28')]&&_0x530c65[_0xbac1('0x15')]>0x1;var _0x4ea9a3=[];if(!fs[_0xbac1('0x31')](path['join'](_0x30bdc6,_0xe4a12d))&&_0x44f240){fs[_0xbac1('0x32')](path[_0xbac1('0x33')](_0x30bdc6,_0xe4a12d));}return BPromise['each'](_0x530c65,function(_0x47b549){_0x4ea9a3['push'](_0x47b549);})[_0xbac1('0x27')](function(){var _0x616a6d=[];for(var _0x26dfc5=0x0;_0x26dfc5<_0x4ea9a3[_0xbac1('0x15')];_0x26dfc5+=0x1){var _0x2f93f9=_0x4ea9a3[_0x26dfc5];var _0x45add5=createTables(_[_0xbac1('0x34')](_0x2f93f9));var _0x39cfd5;var _0x475b39=getPDFDocDefinition(_0x45add5);var _0x236cfe=getPDFPrinter();var _0xfa3af9=_0x236cfe[_0xbac1('0x35')](_0x475b39);if(_0x44f240){_0x39cfd5=path['join'](_0x30bdc6,_0xe4a12d,util[_0xbac1('0x1b')](_0xbac1('0x36'),_0xe4a12d,_0x26dfc5,_0xbac1('0x37')));}else{_0x39cfd5=path[_0xbac1('0x33')](_0x30bdc6,util[_0xbac1('0x1b')](_0xbac1('0x38'),_0xe4a12d,'pdf'));}_0x616a6d[_0xbac1('0x17')](writePDFDocument(_0xfa3af9,_0x39cfd5));}return Promise[_0xbac1('0x39')](_0x616a6d);})[_0xbac1('0x27')](function(){if(_0x44f240){return new Promise(function(_0x1aa1dd){zipdir(path[_0xbac1('0x33')](_0x30bdc6,_0xe4a12d),{'saveTo':path[_0xbac1('0x33')](_0x30bdc6,util[_0xbac1('0x1b')](_0xbac1('0x38'),_0xe4a12d,'zip'))},function(){rimraf(path[_0xbac1('0x33')](_0x30bdc6,_0xe4a12d),function(){});_0x1aa1dd('zip\x20finished');});});}})[_0xbac1('0x27')](function(){if(!_0x44f240)return;rimraf(path[_0xbac1('0x33')](_0x30bdc6,_0xe4a12d),function(){});})[_0xbac1('0x27')](function(){logger[_0xbac1('0x3a')](util[_0xbac1('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xbac1('0x3b'),_0x44f240?util[_0xbac1('0x1b')]('%s.%s',_0xe4a12d,_0x44f240?_0xbac1('0x3c'):_0xbac1('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbac1('0x3a')](util[_0xbac1('0x1b')](_0xbac1('0x3d'),EXTRACTED_REPORT_ID,_0xbac1('0x3e')));return db['AnalyticExtractedReport'][_0xbac1('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbac1('0x27')](function(_0x52fc14){EXTRACTED_REPORT=_0x52fc14;return dbH['sequelize'][_0xbac1('0x2f')](util[_0xbac1('0x1b')](_0xbac1('0x40'),QUERY),{'type':dbH[_0xbac1('0x2b')][_0xbac1('0x2d')]['SELECT']});})[_0xbac1('0x27')](extractReport)['catch'](function(_0x5d962e){logger[_0xbac1('0x3a')](util[_0xbac1('0x1b')](_0xbac1('0x41'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x5d962e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbac1('0x42'));})['finally'](function(){process[_0xbac1('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x227556=new PdfPrinter({'Arial':{'normal':__dirname+_0xbac1('0x44'),'bold':__dirname+_0xbac1('0x45'),'italics':__dirname+_0xbac1('0x46'),'bolditalics':__dirname+_0xbac1('0x47')}});return _0x227556;}function getPDFDocDefinitionFromHTML(_0x13b99,_0x4fe6c6){var _0x590f51=util[_0xbac1('0x1b')](_0xbac1('0x48'),_0x4fe6c6[_0xbac1('0x49')],_0x4fe6c6[_0xbac1('0x4a')]);var _0x2a343b=moment()[_0xbac1('0x1b')](_0xbac1('0x4b'))['toString']();var _0x175e0b=htmlToPdfmake(_0x13b99,{'window':window,'tableAutoSize':!![]});return{'content':[_0x175e0b],'defaultStyle':{'font':_0xbac1('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbac1('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbac1('0x4c')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xbac1('0x1d')}];},'footer':function(_0x5447bc,_0x423ea5){return[{'text':util[_0xbac1('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x590f51,_0x5447bc,_0x423ea5,_0x2a343b),'style':_0xbac1('0x21')}];}};}function writePDFDocument(_0x211104,_0x3c08a4){return new Promise(function(_0x59e018,_0x56e778){var _0x4c6393=_0x211104[_0xbac1('0x4d')](fs[_0xbac1('0x4e')](_0x3c08a4));_0x4c6393['on'](_0xbac1('0x4f'),function(){_0x59e018(_0xbac1('0x4f'));});_0x4c6393['on'](_0xbac1('0x50'),function(_0x1d98c9){_0x56e778(_0x1d98c9);});_0x211104['end']();});}exports[_0xbac1('0x51')]=function(_0x4ee2df,_0x294aad){var _0x4927fa=getPDFPrinter();var _0x586e57=getPDFDocDefinitionFromHTML(_0x4ee2df,_0x294aad);var _0x41210d=_0x4927fa[_0xbac1('0x35')](_0x586e57);return writePDFDocument(_0x41210d,_0x294aad[_0xbac1('0x0')])[_0xbac1('0x52')](function(_0x40caf2){throw _0x40caf2;});}; \ No newline at end of file +var _0xcbaa=['map','value','fill','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','footer','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','existsSync','join','mkdirSync','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','util','moment','pdfmake/src/printer','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x32ee3b,_0x13bae3){var _0x275c0c=function(_0x13d14e){while(--_0x13d14e){_0x32ee3b['push'](_0x32ee3b['shift']());}};_0x275c0c(++_0x13bae3);}(_0xcbaa,0x1e4));var _0xacba=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xcbaa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xacba('0x0'));var fs=require('fs');var util=require(_0xacba('0x1'));var path=require('path');var moment=require(_0xacba('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xacba('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xacba('0x4')];var window=new JSDOM('')[_0xacba('0x5')];var BPromise=require(_0xacba('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xacba('0x7')];var logger=require(_0xacba('0x8'))(_0xacba('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xacba('0xa')][0x2]);var QUERY=process[_0xacba('0xa')][0x3];var PATH=process[_0xacba('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xacba('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d03bd,_0x388779){var _0x73a25e={'status':_0x5d03bd};var _0x4ac414={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x388779){_0x73a25e[_0xacba('0xc')]=_0x388779;}return db[_0xacba('0xd')]['update'](_0x73a25e,_0x4ac414);}function getHeaders(_0x1a99bb){return _['map'](_0x1a99bb,function(_0x52d573){return{'text':_0x52d573,'style':'tableHeader'};});}function getRows(_0x241991,_0x5df0f2){return _[_0xacba('0xe')](_0x5df0f2,function(_0x31ac6a){return _(_0x31ac6a)['pick'](_0x241991)['map'](function(_0x18b956){return _0x18b956?_['toString'](_0x18b956):'';})[_0xacba('0xf')]();});}function createTable(_0x1de23e,_0x5eeeef){var _0x173c65={'widths':_[_0xacba('0x10')](Array(_0x1de23e[_0xacba('0x11')]),0x91),'heights':function(_0x37e1ab){return _0x37e1ab===0x0?_0xacba('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x18f109=getHeaders(_0x1de23e);_0x173c65[_0xacba('0x13')][_0xacba('0x14')](_0x18f109);var _0x394ac7=getRows(_0x1de23e,_0x5eeeef);_0x173c65[_0xacba('0x13')]=_0x173c65['body']['concat'](_0x394ac7);return _0x173c65;}function createTables(_0x5a19ae){var _0x5468cf=[];var _0x227a4d=_[_0xacba('0x15')](Object[_0xacba('0x16')](_0x5a19ae[0x0]),0x5);_0x227a4d[_0xacba('0x17')](function(_0x5b0587){_0x5468cf[_0xacba('0x14')](createTable(_0x5b0587,_0x5a19ae));});return _0x5468cf;}function getPDFDocDefinition(_0x509031){var _0x572cfb=util[_0xacba('0x18')](_0xacba('0x19'),NAME,EXTRACTED_REPORT[_0xacba('0x1a')],moment(EXTRACTED_REPORT[_0xacba('0x1b')])[_0xacba('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0xacba('0x1c')])[_0xacba('0x18')](FORMAT));var _0x4be284=[];for(var _0xfbec4d=0x0;_0xfbec4d<_0x509031[_0xacba('0x11')];_0xfbec4d++){var _0x136b65=[];if(_0xfbec4d===0x0){_0x136b65['push']({'text':_0x572cfb,'style':_0xacba('0x1d')});}var _0x1d2a44={'table':_0x509031[_0xfbec4d]};if(_0xfbec4d>0x0){_0x1d2a44['pageBreak']=_0xacba('0x1e');_0x1d2a44[_0xacba('0x1f')]=[0x0,0x46,0x0,0x0];}_0x136b65[_0xacba('0x14')](_0x1d2a44);_0x4be284['push'](_0x136b65);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4be284,'footer':function(_0x155c66,_0x119d48){return{'text':_0x155c66['toString']()+'\x20/\x20'+_0x119d48,'style':_0xacba('0x20')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xacba('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x54ec02){var _0x9a5262=0x1388;var _0x48cca2;if(!_0x54ec02[0x0][_0xacba('0x22')]){return analyticExtractedReport(_0xacba('0x23'));}return db[_0xacba('0x24')][_0xacba('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xacba('0x26')]})[_0xacba('0x27')](function(_0x1f01ab){if(_0x1f01ab){_0x48cca2=_0x1f01ab;_0x9a5262=_0x48cca2[_0xacba('0x26')]||0x3e8;}})[_0xacba('0x27')](function(){var _0x5b4aa4=[];var _0x50c10a=0x0;if(_0x48cca2[_0xacba('0x28')]){if(_0x54ec02&&_0x54ec02[_0xacba('0x11')]){var _0x81d77e=_[_0xacba('0x29')](_0x54ec02[0x0][_0xacba('0x22')]/_0x9a5262);var _0xe8c0e1=Number[_0xacba('0x2a')](_0x54ec02[0x0][_0xacba('0x22')]/_0x9a5262)?_0x54ec02[0x0][_0xacba('0x22')]%_0x9a5262:0x0;_0x81d77e['forEach'](function(_0x59cc6e){if(_0x59cc6e>0x0){_0x50c10a+=_0x9a5262;}_0x5b4aa4[_0xacba('0x14')](dbH[_0xacba('0x2b')][_0xacba('0x2c')](util[_0xacba('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x9a5262,_0x50c10a),{'type':dbH['sequelize']['QueryTypes'][_0xacba('0x2d')]}));});if(_0xe8c0e1>0x0){_0x50c10a+=_0x9a5262;_0x5b4aa4['push'](dbH[_0xacba('0x2b')][_0xacba('0x2c')](util[_0xacba('0x18')](_0xacba('0x2e'),QUERY,_0xe8c0e1,_0x50c10a),{'type':dbH[_0xacba('0x2b')][_0xacba('0x2f')]['SELECT']}));}}}else{_0x5b4aa4[_0xacba('0x14')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xacba('0x2b')][_0xacba('0x2f')]['SELECT']}));}var _0x228f1f=path['dirname'](PATH);var _0x1bcbcb=path['basename'](PATH,'.pdf');var _0xe21e8f=_0x48cca2[_0xacba('0x28')]&&_0x5b4aa4[_0xacba('0x11')]>0x1;var _0x29eed2=[];if(!fs[_0xacba('0x30')](path[_0xacba('0x31')](_0x228f1f,_0x1bcbcb))&&_0xe21e8f){fs[_0xacba('0x32')](path[_0xacba('0x31')](_0x228f1f,_0x1bcbcb));}return BPromise['each'](_0x5b4aa4,function(_0x38ff85){_0x29eed2[_0xacba('0x14')](_0x38ff85);})[_0xacba('0x27')](function(){var _0x49c5f0=[];for(var _0x2e7e61=0x0;_0x2e7e61<_0x29eed2['length'];_0x2e7e61+=0x1){var _0x13780b=_0x29eed2[_0x2e7e61];var _0x5c42f3=createTables(_['flatten'](_0x13780b));var _0x6f40a4;var _0x271e33=getPDFDocDefinition(_0x5c42f3);var _0x30a9d3=getPDFPrinter();var _0x22bc80=_0x30a9d3[_0xacba('0x33')](_0x271e33);if(_0xe21e8f){_0x6f40a4=path['join'](_0x228f1f,_0x1bcbcb,util[_0xacba('0x18')](_0xacba('0x34'),_0x1bcbcb,_0x2e7e61,_0xacba('0x35')));}else{_0x6f40a4=path[_0xacba('0x31')](_0x228f1f,util['format'](_0xacba('0x36'),_0x1bcbcb,_0xacba('0x35')));}_0x49c5f0[_0xacba('0x14')](writePDFDocument(_0x22bc80,_0x6f40a4));}return Promise[_0xacba('0x37')](_0x49c5f0);})[_0xacba('0x27')](function(){if(_0xe21e8f){return new Promise(function(_0xa37061){zipdir(path[_0xacba('0x31')](_0x228f1f,_0x1bcbcb),{'saveTo':path[_0xacba('0x31')](_0x228f1f,util[_0xacba('0x18')](_0xacba('0x36'),_0x1bcbcb,_0xacba('0x38')))},function(){rimraf(path[_0xacba('0x31')](_0x228f1f,_0x1bcbcb),function(){});_0xa37061('zip\x20finished');});});}})['then'](function(){if(!_0xe21e8f)return;rimraf(path['join'](_0x228f1f,_0x1bcbcb),function(){});})[_0xacba('0x27')](function(){logger[_0xacba('0x39')](util['format'](_0xacba('0x3a'),EXTRACTED_REPORT_ID,_0xacba('0x3b')));return analyticExtractedReport('Completed',_0xe21e8f?util[_0xacba('0x18')](_0xacba('0x36'),_0x1bcbcb,_0xe21e8f?_0xacba('0x38'):_0xacba('0x35')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xacba('0x39')](util[_0xacba('0x18')](_0xacba('0x3c'),EXTRACTED_REPORT_ID,_0xacba('0x3b')));return db[_0xacba('0xd')][_0xacba('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xacba('0x27')](function(_0x3cd10b){EXTRACTED_REPORT=_0x3cd10b;return dbH[_0xacba('0x2b')][_0xacba('0x2c')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xacba('0x2f')]['SELECT']});})[_0xacba('0x27')](extractReport)[_0xacba('0x3e')](function(_0x29b9ac){logger[_0xacba('0x39')](util['format'](_0xacba('0x3f'),EXTRACTED_REPORT_ID,_0xacba('0x3b')),util[_0xacba('0x40')](_0x29b9ac,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xacba('0x41')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3ae2ef=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xacba('0x42'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xacba('0x43')}});return _0x3ae2ef;}function getPDFDocDefinitionFromHTML(_0x5df0b4,_0x5c9c7d){var _0x59b644=util[_0xacba('0x18')](_0xacba('0x44'),_0x5c9c7d[_0xacba('0x45')],_0x5c9c7d['interactionId']);var _0x1d4f66=moment()[_0xacba('0x18')](_0xacba('0x46'))[_0xacba('0x47')]();var _0x42cfb6=htmlToPdfmake(_0x5df0b4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x42cfb6],'defaultStyle':{'font':_0xacba('0x48')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xacba('0x49'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xacba('0x49'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xacba('0x49')}},'header':function(){return[{'text':_0xacba('0x4a'),'style':_0xacba('0x1d')}];},'footer':function(_0x2526f8,_0x2ed610){return[{'text':util['format'](_0xacba('0x4b'),_0x59b644,_0x2526f8,_0x2ed610,_0x1d4f66),'style':_0xacba('0x20')}];}};}function writePDFDocument(_0x339ff2,_0x25925e){return new Promise(function(_0x493739,_0x144105){var _0x512a8c=_0x339ff2[_0xacba('0x4c')](fs[_0xacba('0x4d')](_0x25925e));_0x512a8c['on']('finish',function(){_0x493739(_0xacba('0x4e'));});_0x512a8c['on'](_0xacba('0x4f'),function(_0x3668ff){_0x144105(_0x3668ff);});_0x339ff2[_0xacba('0x50')]();});}exports[_0xacba('0x51')]=function(_0x133e7e,_0x7de9a5){var _0x5d8900=getPDFPrinter();var _0x61048=getPDFDocDefinitionFromHTML(_0x133e7e,_0x7de9a5);var _0x5cd130=_0x5d8900[_0xacba('0x33')](_0x61048);return writePDFDocument(_0x5cd130,_0x7de9a5[_0xacba('0x52')])[_0xacba('0x3e')](function(_0x267a1a){throw _0x267a1a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 07ad500..5593e0a 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 _0x1a58=['existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname'];(function(_0x55a26f,_0x16f9bd){var _0x32590e=function(_0x52c912){while(--_0x52c912){_0x55a26f['push'](_0x55a26f['shift']());}};_0x32590e(++_0x16f9bd);}(_0x1a58,0x1b6));var _0x81a5=function(_0x4a302f,_0x242e37){_0x4a302f=_0x4a302f-0x0;var _0x1177e0=_0x1a58[_0x4a302f];return _0x1177e0;};'use strict';var util=require(_0x81a5('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x81a5('0x1'));var zipdir=require(_0x81a5('0x2'));var rimraf=require(_0x81a5('0x3'));var db=require(_0x81a5('0x4'))['db'];var dbH=require(_0x81a5('0x4'))[_0x81a5('0x5')];var logger=require(_0x81a5('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x81a5('0x7')][0x2]);var QUERY=process[_0x81a5('0x7')][0x3];var PATH=process[_0x81a5('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x230901,_0x2eefaf){var _0x5b6070={'status':_0x230901};var _0x2dafee={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2eefaf){_0x5b6070[_0x81a5('0x8')]=_0x2eefaf;}return db[_0x81a5('0x9')][_0x81a5('0xa')](_0x5b6070,_0x2dafee);}function main(){var _0xba10b0=0x1388;var _0x476bf6;logger[_0x81a5('0xb')](util[_0x81a5('0xc')](_0x81a5('0xd'),EXTRACTED_REPORT_ID,_0x81a5('0xe')));return db[_0x81a5('0xf')][_0x81a5('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x81a5('0x11'),_0x81a5('0x12')]})[_0x81a5('0x13')](function(_0x149e6d){if(_0x149e6d){_0x476bf6=_0x149e6d;_0xba10b0=_0x476bf6[_0x81a5('0x12')]||0x1388;}})[_0x81a5('0x13')](function(){return dbH[_0x81a5('0x14')][_0x81a5('0x15')](util['format'](_0x81a5('0x16'),QUERY),{'type':dbH[_0x81a5('0x14')]['QueryTypes'][_0x81a5('0x17')]});})[_0x81a5('0x13')](function(_0xde1c43){if(!_0xde1c43[0x0][_0x81a5('0x18')]){return analyticExtractedReport(_0x81a5('0x19'));}var _0x59e859=[];var _0x5e424f=0x0;if(_0x476bf6[_0x81a5('0x11')]){if(_0xde1c43&&_0xde1c43[_0x81a5('0x1a')]){var _0x282d0e=_['range'](_0xde1c43[0x0]['num']/_0xba10b0);var _0x2c4cff=Number['isInteger'](_0xde1c43[0x0][_0x81a5('0x18')]/_0xba10b0)?_0xde1c43[0x0][_0x81a5('0x18')]%_0xba10b0:0x0;_0x282d0e[_0x81a5('0x1b')](function(_0x6aa320){if(_0x6aa320>0x0){_0x5e424f+=_0xba10b0;}_0x59e859['push'](dbH[_0x81a5('0x14')]['query'](util[_0x81a5('0xc')](_0x81a5('0x1c'),QUERY,_0xba10b0,_0x5e424f),{'type':dbH[_0x81a5('0x14')][_0x81a5('0x1d')][_0x81a5('0x17')]}));});if(_0x2c4cff>0x0){_0x5e424f+=_0xba10b0;_0x59e859[_0x81a5('0x1e')](dbH[_0x81a5('0x14')]['query'](util[_0x81a5('0xc')](_0x81a5('0x1c'),QUERY,_0x2c4cff,_0x5e424f),{'type':dbH[_0x81a5('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x59e859['push'](dbH[_0x81a5('0x14')][_0x81a5('0x15')](QUERY,{'type':dbH[_0x81a5('0x14')][_0x81a5('0x1d')][_0x81a5('0x17')]}));}var _0x2b3267=path[_0x81a5('0x1f')](PATH);var _0x68e33c=path['basename'](PATH,'.xlsx');var _0x329267=_0x476bf6[_0x81a5('0x11')]&&_0x59e859[_0x81a5('0x1a')]>0x1;var _0x52c9ae=[];if(!fs[_0x81a5('0x20')](path[_0x81a5('0x21')](_0x2b3267,_0x68e33c))&&_0x329267){fs[_0x81a5('0x22')](path[_0x81a5('0x21')](_0x2b3267,_0x68e33c));}return BPromise['each'](_0x59e859,function(_0x1b378b){_0x52c9ae['push'](_0x1b378b);})['then'](function(){for(var _0x24aeec=0x0;_0x24aeec<_0x52c9ae[_0x81a5('0x1a')];_0x24aeec+=0x1){var _0x104aa3;var _0x2e01d7=_0x52c9ae[_0x24aeec];if(_0x329267){_0x104aa3=path[_0x81a5('0x21')](_0x2b3267,_0x68e33c,util['format'](_0x81a5('0x23'),_0x68e33c,_0x24aeec,_0x81a5('0x24')));}else{_0x104aa3=path['join'](_0x2b3267,util[_0x81a5('0xc')](_0x81a5('0x25'),_0x68e33c,_0x81a5('0x24')));}fs['writeFileSync'](_0x104aa3,json2xls(_0x2e01d7),_0x81a5('0x26'));}})[_0x81a5('0x13')](function(){if(_0x329267){return new Promise(function(_0x2d06ee){zipdir(path[_0x81a5('0x21')](_0x2b3267,_0x68e33c),{'saveTo':path[_0x81a5('0x21')](_0x2b3267,util[_0x81a5('0xc')](_0x81a5('0x25'),_0x68e33c,'zip'))},function(_0x3b21dd,_0x29d45b){rimraf(path[_0x81a5('0x21')](_0x2b3267,_0x68e33c),function(){});_0x2d06ee(_0x81a5('0x27'));});});}})[_0x81a5('0x13')](function(){logger[_0x81a5('0xb')](util[_0x81a5('0xc')](_0x81a5('0x28'),EXTRACTED_REPORT_ID,_0x81a5('0xe')));return analyticExtractedReport(_0x81a5('0x29'),_0x329267?util[_0x81a5('0xc')](_0x81a5('0x25'),_0x68e33c,_0x329267?'zip':'xlsx'):null);});})[_0x81a5('0x2a')](function(_0x3a3d10){logger[_0x81a5('0xb')](util[_0x81a5('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x81a5('0x2b')](_0x3a3d10,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x81a5('0x2c'));})[_0x81a5('0x2d')](function(){process[_0x81a5('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x75a6=['basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','info','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','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname'];(function(_0x3e6d7c,_0x4ce27c){var _0x2e0e1a=function(_0x1c08cf){while(--_0x1c08cf){_0x3e6d7c['push'](_0x3e6d7c['shift']());}};_0x2e0e1a(++_0x4ce27c);}(_0x75a6,0x11d));var _0x675a=function(_0x4e845c,_0x183036){_0x4e845c=_0x4e845c-0x0;var _0x7a81bf=_0x75a6[_0x4e845c];return _0x7a81bf;};'use strict';var util=require(_0x675a('0x0'));var path=require(_0x675a('0x1'));var _=require(_0x675a('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x675a('0x3'));var zipdir=require(_0x675a('0x4'));var rimraf=require(_0x675a('0x5'));var db=require(_0x675a('0x6'))['db'];var dbH=require(_0x675a('0x6'))[_0x675a('0x7')];var logger=require(_0x675a('0x8'))(_0x675a('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x675a('0xa')][0x3];var PATH=process[_0x675a('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x339f61,_0x12a618){var _0xdc63e1={'status':_0x339f61};var _0x368d22={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12a618){_0xdc63e1['savename']=_0x12a618;}return db[_0x675a('0xb')]['update'](_0xdc63e1,_0x368d22);}function main(){var _0x5c8599=0x1388;var _0x2b255b;logger['info'](util[_0x675a('0xc')](_0x675a('0xd'),EXTRACTED_REPORT_ID,_0x675a('0xe')));return db[_0x675a('0xf')][_0x675a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x675a('0x11'),_0x675a('0x12')]})[_0x675a('0x13')](function(_0x1c5da3){if(_0x1c5da3){_0x2b255b=_0x1c5da3;_0x5c8599=_0x2b255b['splitSizeXlsx']||0x1388;}})[_0x675a('0x13')](function(){return dbH[_0x675a('0x14')]['query'](util['format'](_0x675a('0x15'),QUERY),{'type':dbH[_0x675a('0x14')][_0x675a('0x16')][_0x675a('0x17')]});})['then'](function(_0x2a473f){if(!_0x2a473f[0x0][_0x675a('0x18')]){return analyticExtractedReport(_0x675a('0x19'));}var _0x2b6d12=[];var _0x1bd2f0=0x0;if(_0x2b255b['split']){if(_0x2a473f&&_0x2a473f[_0x675a('0x1a')]){var _0x3ed759=_['range'](_0x2a473f[0x0]['num']/_0x5c8599);var _0x5592ed=Number[_0x675a('0x1b')](_0x2a473f[0x0][_0x675a('0x18')]/_0x5c8599)?_0x2a473f[0x0][_0x675a('0x18')]%_0x5c8599:0x0;_0x3ed759[_0x675a('0x1c')](function(_0xfafe90){if(_0xfafe90>0x0){_0x1bd2f0+=_0x5c8599;}_0x2b6d12[_0x675a('0x1d')](dbH[_0x675a('0x14')]['query'](util[_0x675a('0xc')](_0x675a('0x1e'),QUERY,_0x5c8599,_0x1bd2f0),{'type':dbH['sequelize'][_0x675a('0x16')]['SELECT']}));});if(_0x5592ed>0x0){_0x1bd2f0+=_0x5c8599;_0x2b6d12['push'](dbH[_0x675a('0x14')]['query'](util[_0x675a('0xc')](_0x675a('0x1e'),QUERY,_0x5592ed,_0x1bd2f0),{'type':dbH[_0x675a('0x14')][_0x675a('0x16')][_0x675a('0x17')]}));}}}else{_0x2b6d12[_0x675a('0x1d')](dbH[_0x675a('0x14')][_0x675a('0x1f')](QUERY,{'type':dbH[_0x675a('0x14')][_0x675a('0x16')][_0x675a('0x17')]}));}var _0x3c9a1a=path[_0x675a('0x20')](PATH);var _0x1b6258=path[_0x675a('0x21')](PATH,_0x675a('0x22'));var _0x59f3ce=_0x2b255b[_0x675a('0x11')]&&_0x2b6d12[_0x675a('0x1a')]>0x1;var _0x3b4fc9=[];if(!fs[_0x675a('0x23')](path['join'](_0x3c9a1a,_0x1b6258))&&_0x59f3ce){fs['mkdirSync'](path[_0x675a('0x24')](_0x3c9a1a,_0x1b6258));}return BPromise[_0x675a('0x25')](_0x2b6d12,function(_0x1ab954){_0x3b4fc9[_0x675a('0x1d')](_0x1ab954);})[_0x675a('0x13')](function(){for(var _0x4053ad=0x0;_0x4053ad<_0x3b4fc9[_0x675a('0x1a')];_0x4053ad+=0x1){var _0x4edf6d;var _0x98c4a6=_0x3b4fc9[_0x4053ad];if(_0x59f3ce){_0x4edf6d=path['join'](_0x3c9a1a,_0x1b6258,util[_0x675a('0xc')](_0x675a('0x26'),_0x1b6258,_0x4053ad,_0x675a('0x27')));}else{_0x4edf6d=path['join'](_0x3c9a1a,util[_0x675a('0xc')](_0x675a('0x28'),_0x1b6258,_0x675a('0x27')));}fs[_0x675a('0x29')](_0x4edf6d,json2xls(_0x98c4a6),_0x675a('0x2a'));}})[_0x675a('0x13')](function(){if(_0x59f3ce){return new Promise(function(_0xe8b083){zipdir(path[_0x675a('0x24')](_0x3c9a1a,_0x1b6258),{'saveTo':path[_0x675a('0x24')](_0x3c9a1a,util[_0x675a('0xc')](_0x675a('0x28'),_0x1b6258,'zip'))},function(_0x4689ae,_0x4e03f1){rimraf(path[_0x675a('0x24')](_0x3c9a1a,_0x1b6258),function(){});_0xe8b083(_0x675a('0x2b'));});});}})[_0x675a('0x13')](function(){logger[_0x675a('0x2c')](util['format'](_0x675a('0x2d'),EXTRACTED_REPORT_ID,_0x675a('0xe')));return analyticExtractedReport(_0x675a('0x2e'),_0x59f3ce?util['format'](_0x675a('0x28'),_0x1b6258,_0x59f3ce?_0x675a('0x2f'):'xlsx'):null);});})[_0x675a('0x30')](function(_0x2d605d){logger[_0x675a('0x2c')](util[_0x675a('0xc')](_0x675a('0x31'),EXTRACTED_REPORT_ID,_0x675a('0xe')),util[_0x675a('0x32')](_0x2d605d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x675a('0x33')](function(){process[_0x675a('0x34')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 7cfa9aa..10480a3 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 _0x75a2=['IntervalId','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extensions','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','cutdigits','${EXTEN:','extension','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension'];(function(_0x16e29c,_0x474035){var _0x589e32=function(_0x1924cc){while(--_0x1924cc){_0x16e29c['push'](_0x16e29c['shift']());}};_0x589e32(++_0x474035);}(_0x75a2,0x11c));var _0x275a=function(_0x2eb69e,_0x4893af){_0x2eb69e=_0x2eb69e-0x0;var _0x3e21b9=_0x75a2[_0x2eb69e];return _0x3e21b9;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));function rewrite(_0x54e032,_0x3157f0){var _0x382e3d=this;return _0x54e032[_0x275a('0x2')][_0x275a('0x3')][_0x275a('0x4')]({'raw':!![]})[_0x275a('0x5')](function(_0x4fea95){_0x382e3d[_0x275a('0x6')]=_0x4fea95;return _0x54e032['models'][_0x275a('0x7')][_0x275a('0x4')]({'where':{'IntervalId':_0x3157f0[_0x275a('0x8')]},'raw':!![]});})[_0x275a('0x5')](function(_0x4a20f8){return _0x54e032['models']['VoiceExtension'][_0x275a('0x4')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x4a20f8,_0x275a('0x9')))}},'order':[{'raw':_0x275a('0xa')}],'raw':!![]});})[_0x275a('0x5')](function(_0x2d1fe6){var _0x13b1fa=_[_0x275a('0xb')](_0x2d1fe6,{'priority':'1'});var _0x19cd2a=_[_0x275a('0xb')](_0x2d1fe6,{'isApp':0x1});var _0x35a35f=_[_0x275a('0xc')](_0x19cd2a,_0x275a('0x9'));var _0x2e488c=['queue',_0x275a('0xd')];var _0x3d30e5=[];var _0x505284=[];for(var _0x3d2cd3 in _0x35a35f){if(_0x35a35f['hasOwnProperty'](_0x3d2cd3)){_0x382e3d[_0x275a('0xe')]=0x2;_0x382e3d[_0x275a('0xf')]=[];_0x382e3d['extension']=_[_0x275a('0x10')](_0x13b1fa,{'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')]});_0x382e3d[_0x275a('0xf')]['push']({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':util[_0x275a('0x13')](_0x275a('0x14'),_0x35a35f[_0x3d2cd3][0x0]['type']),'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});if(_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')]===_0x275a('0x17')){_0x382e3d['extensions'][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':_0x275a('0x19')+_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')],'context':_0x35a35f[_0x3d2cd3][0x0]['context'],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});}else if(_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')]===_0x275a('0x1a')){if(_0x382e3d['extension']){_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':'CDR(destination)='+(_0x382e3d['extension'][_0x275a('0x1b')]?_0x275a('0x1c')+_0x382e3d[_0x275a('0x1d')][_0x275a('0x1b')]+'}':_0x275a('0x1e')),'context':_0x35a35f[_0x3d2cd3][0x0]['context'],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0]['VoiceExtensionId']});}_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':_0x275a('0x19')+_0x35a35f[_0x3d2cd3][0x0]['VoiceExtensionId'],'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0]['VoiceExtensionId']});var _0x47528d=_0x382e3d[_0x275a('0xe')]++;_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':'ExecIf','appdata':_0x275a('0x1f')+(_0x47528d+0x2)+_0x275a('0x20')+(_0x47528d+0x1)+')','context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x47528d,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});if(_0x382e3d[_0x275a('0x1d')]){_0x382e3d['extensions'][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':_0x382e3d[_0x275a('0x1d')][_0x275a('0x1b')]?_0x275a('0x21')+_0x382e3d[_0x275a('0x1d')][_0x275a('0x1b')]+'}':_0x275a('0x22'),'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0]['exten'],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});}_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':_0x275a('0x23')+_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')],'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});if(_0x382e3d['extension']&&_0x382e3d[_0x275a('0x1d')][_0x275a('0x24')](_0x275a('0x25'))&&_0x382e3d[_0x275a('0x1d')][_0x275a('0x25')]!==_0x275a('0x26')){_0x382e3d['extensions'][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':_0x275a('0x27'),'context':_0x35a35f[_0x3d2cd3][0x0]['context'],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d['priority']++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0]['VoiceExtensionId']});_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':_0x275a('0x28')+_0x382e3d[_0x275a('0x1d')][_0x275a('0x25')]||_0x275a('0x29'),'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});}}_0x382e3d[_0x275a('0xf')]['push']({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':_0x275a('0x2a'),'context':_0x35a35f[_0x3d2cd3][0x0]['context'],'exten':_0x35a35f[_0x3d2cd3][0x0]['exten'],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0]['VoiceExtensionId']});_0x382e3d[_0x275a('0xf')]['push']({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x35a35f[_0x3d2cd3][0x0]['context'],'exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});_0x382e3d['extensions'][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0]['type'],'app':_0x275a('0x12'),'appdata':_0x275a('0x2b'),'context':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x15')],'exten':_0x35a35f[_0x3d2cd3][0x0]['exten'],'priority':_0x382e3d[_0x275a('0xe')]++,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});for(var _0x216e2a=0x0,_0x4485db=0x0;_0x216e2a<_0x35a35f[_0x3d2cd3][_0x275a('0x2c')];_0x216e2a+=0x1,_0x4485db=0x0){var _0x1c5dde=_0x35a35f[_0x3d2cd3][_0x216e2a];if(_0x1c5dde[_0x275a('0x11')]){_0x1c5dde[_0x275a('0x11')]=_0x1c5dde[_0x275a('0x11')]['toLowerCase']();}var _0x3a87cd=[];var _0x29168f=[];delete _0x1c5dde['id'];delete _0x1c5dde[_0x275a('0x2d')];delete _0x1c5dde['updatedAt'];var _0x5b5a9d=_0x1c5dde['interval']!==_0x275a('0x2e')?[_0x1c5dde[_0x275a('0x2f')]]:_0x1c5dde['IntervalId']?_[_0x275a('0x30')](_['filter'](_0x382e3d[_0x275a('0x6')],{'IntervalId':_0x1c5dde['IntervalId']}),_0x275a('0x2f')):[];if(_0x1c5dde[_0x275a('0x24')](_0x275a('0x31'))){if(_0x1c5dde[_0x275a('0x31')]&&_0x1c5dde['tag']!=='--'){_0x3a87cd[_0x275a('0x18')]({'type':_0x1c5dde['type'],'app':_0x275a('0x12'),'appdata':_0x275a('0x32')+_0x1c5dde[_0x275a('0x31')],'context':_0x1c5dde['context'],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d['length']+_0x382e3d[_0x275a('0xe')]+_0x4485db++,'VoiceExtensionId':_0x1c5dde['VoiceExtensionId']});}}if(_0x1c5dde[_0x275a('0x11')]===_0x275a('0x1a')&&_0x1c5dde[_0x275a('0x24')](_0x275a('0x33'))){if(_0x1c5dde[_0x275a('0x33')]){_0x3a87cd['push']({'type':_0x1c5dde[_0x275a('0x11')],'app':_0x275a('0x34'),'appdata':_0x275a('0x35')+_0x1c5dde[_0x275a('0x33')]+')','context':_0x1c5dde[_0x275a('0x15')],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d['length']+_0x382e3d[_0x275a('0xe')]+_0x4485db++,'VoiceExtensionId':_0x1c5dde[_0x275a('0x16')]});}else{_0x3a87cd[_0x275a('0x18')]({'type':_0x1c5dde[_0x275a('0x11')],'app':'ExecIf','appdata':_0x275a('0x36'),'context':_0x1c5dde['context'],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d[_0x275a('0x2c')]+_0x382e3d[_0x275a('0xe')]+_0x4485db++,'VoiceExtensionId':_0x1c5dde[_0x275a('0x16')]});}}if(_0x1c5dde[_0x275a('0x24')]('answer')){if(_0x2e488c[_0x275a('0x37')](_0x1c5dde[_0x275a('0x38')][_0x275a('0x39')]())>=0x0&&_0x1c5dde['appType']!==_0x275a('0x3a')){if(_0x1c5dde[_0x275a('0x3b')]){_0x3a87cd[_0x275a('0x18')]({'type':_0x1c5dde['type'],'app':_0x275a('0x34'),'appdata':_0x275a('0x3c'),'context':_0x1c5dde['context'],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d[_0x275a('0x2c')]+_0x382e3d['priority']+_0x4485db++,'VoiceExtensionId':_0x1c5dde[_0x275a('0x16')]});_0x3a87cd[_0x275a('0x18')]({'type':_0x1c5dde[_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1c5dde[_0x275a('0x15')],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d[_0x275a('0x2c')]+_0x382e3d[_0x275a('0xe')]+_0x4485db++,'VoiceExtensionId':_0x1c5dde[_0x275a('0x16')]});}else{_0x3a87cd['push']({'type':_0x1c5dde['type'],'app':_0x275a('0x34'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1c5dde['context'],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d['length']+_0x382e3d[_0x275a('0xe')]+_0x4485db++,'VoiceExtensionId':_0x1c5dde['VoiceExtensionId']});_0x3a87cd[_0x275a('0x18')]({'type':_0x1c5dde[_0x275a('0x11')],'app':_0x275a('0x12'),'appdata':_0x275a('0x3d'),'context':_0x1c5dde[_0x275a('0x15')],'exten':_0x1c5dde[_0x275a('0x9')],'priority':_0x5b5a9d[_0x275a('0x2c')]+_0x382e3d['priority']+_0x4485db++,'VoiceExtensionId':_0x1c5dde[_0x275a('0x16')]});}}}for(var _0x58a1b3=0x0;_0x58a1b3<_0x5b5a9d[_0x275a('0x2c')];_0x58a1b3+=0x1){var _0x729210=_0x382e3d[_0x275a('0xe')]+_0x5b5a9d['length'];var _0x5c234e=_0x58a1b3===_0x5b5a9d[_0x275a('0x2c')]-0x1?_0x382e3d[_0x275a('0xe')]+_0x3a87cd[_0x275a('0x2c')]+_0x29168f[_0x275a('0x2c')]+0x2:_0x382e3d[_0x275a('0xe')]+_0x58a1b3+0x1;_0x3a87cd['splice'](_0x58a1b3,0x0,{'type':_0x1c5dde[_0x275a('0x11')],'app':_0x275a('0x3e'),'appdata':_0x5b5a9d[_0x58a1b3]+'?'+_0x1c5dde['context']+',${EXTEN},'+_0x729210+':'+_0x1c5dde['context']+_0x275a('0x3f')+_0x5c234e,'exten':_0x1c5dde['exten'],'context':_0x1c5dde[_0x275a('0x15')],'priority':_0x382e3d[_0x275a('0xe')]+_0x58a1b3,'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});}_0x1c5dde[_0x275a('0xe')]=_0x3a87cd[_0x275a('0x2c')]?_[_0x275a('0x40')](_0x3a87cd)['priority']+0x1:_0x382e3d[_0x275a('0xe')];_0x382e3d[_0x275a('0xe')]=(_0x29168f[_0x275a('0x2c')]?_['last'](_0x29168f)['priority']:_0x1c5dde[_0x275a('0xe')])+0x1;_0x382e3d['extensions']=_[_0x275a('0x41')](_0x382e3d[_0x275a('0xf')],_0x3a87cd,[_0x1c5dde],_0x29168f);}_0x382e3d[_0x275a('0xf')][_0x275a('0x18')]({'type':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x11')],'app':'Hangup','exten':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x9')],'context':_0x35a35f[_0x3d2cd3][0x0]['context'],'priority':_0x382e3d[_0x275a('0xe')],'VoiceExtensionId':_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]});_0x3d30e5[_0x275a('0x18')](_0x35a35f[_0x3d2cd3][0x0][_0x275a('0x16')]);_0x505284=_[_0x275a('0x41')](_0x505284,_0x382e3d[_0x275a('0xf')]);}}return _0x54e032[_0x275a('0x42')](function(_0x2f9fd9){return _0x54e032[_0x275a('0x2')]['VoiceExtension'][_0x275a('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x3d30e5}},'transaction':_0x2f9fd9})[_0x275a('0x5')](function(_0x211381){return _0x54e032[_0x275a('0x2')]['VoiceExtension'][_0x275a('0x44')](_[_0x275a('0x45')](_0x505284,'priority'),{'transaction':_0x2f9fd9});});});})[_0x275a('0x46')](function(_0x159fb9){console[_0x275a('0x47')](_0x159fb9);});}exports[_0x275a('0x48')]=rewrite; \ No newline at end of file +var _0x9b76=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','util','Interval','then','intervals','models','VoiceExtension','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='];(function(_0x2f8707,_0x4328a8){var _0x21f664=function(_0x1f1c1d){while(--_0x1f1c1d){_0x2f8707['push'](_0x2f8707['shift']());}};_0x21f664(++_0x4328a8);}(_0x9b76,0xa5));var _0x69b7=function(_0x5280fc,_0x4f0916){_0x5280fc=_0x5280fc-0x0;var _0x373384=_0x9b76[_0x5280fc];return _0x373384;};'use strict';var _=require('lodash');var util=require(_0x69b7('0x0'));function rewrite(_0x307f0d,_0x2ee1fe){var _0x5bb928=this;return _0x307f0d['models'][_0x69b7('0x1')]['findAll']({'raw':!![]})[_0x69b7('0x2')](function(_0x40e54f){_0x5bb928[_0x69b7('0x3')]=_0x40e54f;return _0x307f0d[_0x69b7('0x4')][_0x69b7('0x5')][_0x69b7('0x6')]({'where':{'IntervalId':_0x2ee1fe['IntervalId']},'raw':!![]});})[_0x69b7('0x2')](function(_0x2aa901){return _0x307f0d[_0x69b7('0x4')][_0x69b7('0x5')][_0x69b7('0x6')]({'where':{'exten':{'$in':_[_0x69b7('0x7')](_[_0x69b7('0x8')](_0x2aa901,_0x69b7('0x9')))}},'order':[{'raw':_0x69b7('0xa')}],'raw':!![]});})[_0x69b7('0x2')](function(_0xfffc9){var _0x56702a=_[_0x69b7('0xb')](_0xfffc9,{'priority':'1'});var _0x42bdcb=_[_0x69b7('0xb')](_0xfffc9,{'isApp':0x1});var _0x57e6bc=_[_0x69b7('0xc')](_0x42bdcb,_0x69b7('0x9'));var _0x9e11ab=[_0x69b7('0xd'),_0x69b7('0xe')];var _0xce7120=[];var _0x214b91=[];for(var _0xdd1278 in _0x57e6bc){if(_0x57e6bc[_0x69b7('0xf')](_0xdd1278)){_0x5bb928[_0x69b7('0x10')]=0x2;_0x5bb928[_0x69b7('0x11')]=[];_0x5bb928[_0x69b7('0x12')]=_[_0x69b7('0x13')](_0x56702a,{'exten':_0x57e6bc[_0xdd1278][0x0]['exten']});_0x5bb928[_0x69b7('0x11')]['push']({'type':_0x57e6bc[_0xdd1278][0x0]['type'],'app':_0x69b7('0x14'),'appdata':util[_0x69b7('0x15')](_0x69b7('0x16'),_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')]),'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});if(_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')]===_0x69b7('0x1a')){_0x5bb928[_0x69b7('0x11')]['push']({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':'Set','appdata':_0x69b7('0x1b')+_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')],'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});}else if(_0x57e6bc[_0xdd1278][0x0]['type']===_0x69b7('0x1c')){if(_0x5bb928[_0x69b7('0x12')]){_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':_0x69b7('0x1e')+(_0x5bb928[_0x69b7('0x12')][_0x69b7('0x1f')]?_0x69b7('0x20')+_0x5bb928[_0x69b7('0x12')]['cutdigits']+'}':_0x69b7('0x21')),'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});}_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':'Set','appdata':_0x69b7('0x1b')+_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')],'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});var _0x90dc20=_0x5bb928[_0x69b7('0x10')]++;_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':_0x69b7('0x22'),'appdata':_0x69b7('0x23')+(_0x90dc20+0x2)+_0x69b7('0x24')+(_0x90dc20+0x1)+')','context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0]['exten'],'priority':_0x90dc20,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});if(_0x5bb928[_0x69b7('0x12')]){_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':'Set','appdata':_0x5bb928[_0x69b7('0x12')][_0x69b7('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x5bb928[_0x69b7('0x12')][_0x69b7('0x1f')]+'}':_0x69b7('0x25'),'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});}_0x5bb928['extensions'][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':_0x69b7('0x26')+_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')],'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});if(_0x5bb928[_0x69b7('0x12')]&&_0x5bb928[_0x69b7('0x12')][_0x69b7('0xf')](_0x69b7('0x27'))&&_0x5bb928['extension'][_0x69b7('0x27')]!=='none'){_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x57e6bc[_0xdd1278][0x0]['context'],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0]['type'],'app':'Set','appdata':_0x69b7('0x28')+_0x5bb928[_0x69b7('0x12')]['recordingFormat']||_0x69b7('0x29'),'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0]['exten'],'priority':_0x5bb928['priority']++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});}}_0x5bb928['extensions'][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':_0x69b7('0x2a'),'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});_0x5bb928[_0x69b7('0x11')][_0x69b7('0x1d')]({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928['priority']++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});_0x5bb928[_0x69b7('0x11')]['push']({'type':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x17')],'app':'Set','appdata':_0x69b7('0x2b'),'context':_0x57e6bc[_0xdd1278][0x0]['context'],'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'priority':_0x5bb928[_0x69b7('0x10')]++,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});for(var _0x272e12=0x0,_0x5f1d0c=0x0;_0x272e12<_0x57e6bc[_0xdd1278][_0x69b7('0x2c')];_0x272e12+=0x1,_0x5f1d0c=0x0){var _0x509043=_0x57e6bc[_0xdd1278][_0x272e12];if(_0x509043[_0x69b7('0x17')]){_0x509043[_0x69b7('0x17')]=_0x509043[_0x69b7('0x17')][_0x69b7('0x2d')]();}var _0x363a39=[];var _0x154f89=[];delete _0x509043['id'];delete _0x509043[_0x69b7('0x2e')];delete _0x509043[_0x69b7('0x2f')];var _0x53d39e=_0x509043[_0x69b7('0x30')]!==_0x69b7('0x31')?[_0x509043[_0x69b7('0x30')]]:_0x509043[_0x69b7('0x32')]?_['map'](_['filter'](_0x5bb928[_0x69b7('0x3')],{'IntervalId':_0x509043[_0x69b7('0x32')]}),_0x69b7('0x30')):[];if(_0x509043['hasOwnProperty'](_0x69b7('0x33'))){if(_0x509043[_0x69b7('0x33')]&&_0x509043[_0x69b7('0x33')]!=='--'){_0x363a39[_0x69b7('0x1d')]({'type':_0x509043[_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':'CDR(tag)='+_0x509043['tag'],'context':_0x509043[_0x69b7('0x18')],'exten':_0x509043[_0x69b7('0x9')],'priority':_0x53d39e[_0x69b7('0x2c')]+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043['VoiceExtensionId']});}}if(_0x509043['type']===_0x69b7('0x1c')&&_0x509043[_0x69b7('0xf')](_0x69b7('0x34'))){if(_0x509043[_0x69b7('0x34')]){_0x363a39[_0x69b7('0x1d')]({'type':_0x509043['type'],'app':_0x69b7('0x22'),'appdata':_0x69b7('0x35')+_0x509043['callerID']+')','context':_0x509043['context'],'exten':_0x509043['exten'],'priority':_0x53d39e[_0x69b7('0x2c')]+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043[_0x69b7('0x19')]});}else{_0x363a39[_0x69b7('0x1d')]({'type':_0x509043[_0x69b7('0x17')],'app':_0x69b7('0x22'),'appdata':_0x69b7('0x36'),'context':_0x509043[_0x69b7('0x18')],'exten':_0x509043['exten'],'priority':_0x53d39e[_0x69b7('0x2c')]+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043[_0x69b7('0x19')]});}}if(_0x509043[_0x69b7('0xf')](_0x69b7('0x37'))){if(_0x9e11ab['indexOf'](_0x509043[_0x69b7('0x38')][_0x69b7('0x2d')]())>=0x0&&_0x509043[_0x69b7('0x39')]!==_0x69b7('0x3a')){if(_0x509043['answer']){_0x363a39[_0x69b7('0x1d')]({'type':_0x509043[_0x69b7('0x17')],'app':_0x69b7('0x22'),'appdata':_0x69b7('0x3b'),'context':_0x509043[_0x69b7('0x18')],'exten':_0x509043['exten'],'priority':_0x53d39e[_0x69b7('0x2c')]+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043['VoiceExtensionId']});_0x363a39[_0x69b7('0x1d')]({'type':_0x509043[_0x69b7('0x17')],'app':_0x69b7('0x14'),'appdata':_0x69b7('0x3c'),'context':_0x509043['context'],'exten':_0x509043[_0x69b7('0x9')],'priority':_0x53d39e['length']+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043[_0x69b7('0x19')]});}else{_0x363a39[_0x69b7('0x1d')]({'type':_0x509043['type'],'app':_0x69b7('0x22'),'appdata':_0x69b7('0x3d'),'context':_0x509043['context'],'exten':_0x509043[_0x69b7('0x9')],'priority':_0x53d39e[_0x69b7('0x2c')]+_0x5bb928['priority']+_0x5f1d0c++,'VoiceExtensionId':_0x509043[_0x69b7('0x19')]});_0x363a39[_0x69b7('0x1d')]({'type':_0x509043['type'],'app':'Set','appdata':_0x69b7('0x3e'),'context':_0x509043['context'],'exten':_0x509043[_0x69b7('0x9')],'priority':_0x53d39e['length']+_0x5bb928[_0x69b7('0x10')]+_0x5f1d0c++,'VoiceExtensionId':_0x509043[_0x69b7('0x19')]});}}}for(var _0x20464f=0x0;_0x20464f<_0x53d39e[_0x69b7('0x2c')];_0x20464f+=0x1){var _0x10de5=_0x5bb928[_0x69b7('0x10')]+_0x53d39e[_0x69b7('0x2c')];var _0x30af44=_0x20464f===_0x53d39e['length']-0x1?_0x5bb928[_0x69b7('0x10')]+_0x363a39[_0x69b7('0x2c')]+_0x154f89['length']+0x2:_0x5bb928[_0x69b7('0x10')]+_0x20464f+0x1;_0x363a39[_0x69b7('0x3f')](_0x20464f,0x0,{'type':_0x509043[_0x69b7('0x17')],'app':'GotoIfTime','appdata':_0x53d39e[_0x20464f]+'?'+_0x509043[_0x69b7('0x18')]+_0x69b7('0x40')+_0x10de5+':'+_0x509043['context']+_0x69b7('0x40')+_0x30af44,'exten':_0x509043[_0x69b7('0x9')],'context':_0x509043[_0x69b7('0x18')],'priority':_0x5bb928[_0x69b7('0x10')]+_0x20464f,'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0]['VoiceExtensionId']});}_0x509043[_0x69b7('0x10')]=_0x363a39['length']?_[_0x69b7('0x41')](_0x363a39)[_0x69b7('0x10')]+0x1:_0x5bb928['priority'];_0x5bb928['priority']=(_0x154f89[_0x69b7('0x2c')]?_[_0x69b7('0x41')](_0x154f89)['priority']:_0x509043[_0x69b7('0x10')])+0x1;_0x5bb928['extensions']=_['concat'](_0x5bb928[_0x69b7('0x11')],_0x363a39,[_0x509043],_0x154f89);}_0x5bb928[_0x69b7('0x11')]['push']({'type':_0x57e6bc[_0xdd1278][0x0]['type'],'app':_0x69b7('0x42'),'exten':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x9')],'context':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x18')],'priority':_0x5bb928[_0x69b7('0x10')],'VoiceExtensionId':_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]});_0xce7120[_0x69b7('0x1d')](_0x57e6bc[_0xdd1278][0x0][_0x69b7('0x19')]);_0x214b91=_['concat'](_0x214b91,_0x5bb928['extensions']);}}return _0x307f0d[_0x69b7('0x43')](function(_0xfb6cf3){return _0x307f0d[_0x69b7('0x4')][_0x69b7('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0xce7120}},'transaction':_0xfb6cf3})['then'](function(_0x44c363){return _0x307f0d[_0x69b7('0x4')][_0x69b7('0x5')][_0x69b7('0x44')](_[_0x69b7('0x45')](_0x214b91,_0x69b7('0x10')),{'transaction':_0xfb6cf3});});});})[_0x69b7('0x46')](function(_0x13c608){console[_0x69b7('0x47')](_0x13c608);});}exports[_0x69b7('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 934cb01..9035189 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 _0xabe1=['map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','duplicate','Duplicate\x20Contact','create','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','insert','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_contacts','str','VoiceQueue','findAll','outbound','CmList','then','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','catch','onlyIfOpen','BlackLists','all','Campaign','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','api','redis','defaults','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors'];(function(_0x48669e,_0x1155ca){var _0x1678a9=function(_0x5433e3){while(--_0x5433e3){_0x48669e['push'](_0x48669e['shift']());}};_0x1678a9(++_0x1155ca);}(_0xabe1,0x124));var _0x1abe=function(_0x1ba612,_0x55de76){_0x1ba612=_0x1ba612-0x0;var _0x414074=_0xabe1[_0x1ba612];return _0x414074;};'use strict';var BPromise=require(_0x1abe('0x0'));var util=require(_0x1abe('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x1abe('0x2'));var db=require(_0x1abe('0x3'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1abe('0x4'));config[_0x1abe('0x5')]=_[_0x1abe('0x6')](config[_0x1abe('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1abe('0x5')]));require('../../../api/cmContact/cmContact.socket')[_0x1abe('0x7')](socket);try{if(!process[_0x1abe('0x8')][0x2]||process[_0x1abe('0x8')][0x2]===_0x1abe('0x9')||process[_0x1abe('0x8')][0x2]===_0x1abe('0xa')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x1abe('0x8')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x1abe('0x9')||process[_0x1abe('0x8')][0x3]==='null'||!process[_0x1abe('0x8')][0x4]||process[_0x1abe('0x8')][0x4]===_0x1abe('0x9')||process[_0x1abe('0x8')][0x4]===_0x1abe('0xa')){throw new Error(_0x1abe('0xb'));}var FIELDS=_['zipObject'](process[_0x1abe('0x8')][0x3][_0x1abe('0xc')](','),process['argv'][0x4][_0x1abe('0xc')](','));if(!process[_0x1abe('0x8')][0x5]||process['argv'][0x5]===_0x1abe('0x9')||process['argv'][0x5]===_0x1abe('0xa')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x1abe('0x8')][0x5];var COMPANYID=process[_0x1abe('0x8')][0x6]&&process['argv'][0x6]!==_0x1abe('0x9')&&process[_0x1abe('0x8')][0x6]!==_0x1abe('0xa')?process[_0x1abe('0x8')][0x6]:null;var DUPLICATES=process[_0x1abe('0x8')][0x7]&&process[_0x1abe('0x8')][0x7]!=='undefined'&&process[_0x1abe('0x8')][0x7]!=='null'?process[_0x1abe('0x8')][0x7]:null;if(!process['argv'][0x8]||process[_0x1abe('0x8')][0x8]==='undefined'||process['argv'][0x8]===_0x1abe('0xa')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1abe('0x8')][0x8];}catch(_0x1e3261){logger[_0x1abe('0xd')](_0x1e3261);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(_0x20a19c,_0x3ce62a,_0x1fdd78,_0xa1e377){var _0x1d4420={'message':_0x3ce62a};_0x1d4420[_0x20a19c]=!![];if(_0x1fdd78){_0x1d4420[_0x1abe('0xe')]=_0x1fdd78;}if(_0xa1e377){_0x1d4420[_0x1abe('0xf')]=_0xa1e377;}return _0x1d4420;}function isEmail(_0x488801){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))*$/[_0x1abe('0x10')](_0x488801);}function checkRow(_0xd05001,_0x56efcf,_0x160814){return new BPromise(function(_0x51765e,_0x400331){if(_[_0x1abe('0x11')](_0xd05001)){return _0x400331(handleCheckRowError('error',_0x1abe('0x12'),null,_0x160814));}if(_0xd05001[_0x1abe('0x13')]&&_0xd05001['errors']['length']){var _0x3957d1=_[_0x1abe('0x14')](_0xd05001['errors'],_0x1abe('0x15'))[_0x1abe('0x16')](';');return _0x400331(handleCheckRowError(_0x1abe('0xd'),_0x3957d1,null,_0x160814));}var _0x354316={};for(var _0x23348b in FIELDS){if(FIELDS[_0x1abe('0x17')](_0x23348b)&&FIELDS[_0x23348b]){_0x354316[_0x23348b]=_0xd05001[_0x1abe('0x18')][0x0][FIELDS[_0x23348b]]||_0xd05001[_0x1abe('0x18')][0x0]['\ufeff'+FIELDS[_0x23348b]];}}if(!_0x354316[_0x1abe('0x19')]){return _0x400331(handleCheckRowError('error',_0x1abe('0x1a'),null,_0x160814));}if(!_0x354316[_0x1abe('0x1b')]){return _0x400331(handleCheckRowError(_0x1abe('0xd'),_0x1abe('0x1c'),null,_0x160814));}if(_0x354316['birthDate']){var _0x230704=moment(_0x354316['birthDate'],'YYYY-MM-DD');if(!_0x230704['isValid']()){return _0x400331(handleCheckRowError(_0x1abe('0xd'),_0x1abe('0x1d'),null,_0x160814));}}if(_0x354316[_0x1abe('0x1e')]){if(!isEmail(_0x354316[_0x1abe('0x1e')])){return _0x400331(handleCheckRowError('error',_0x1abe('0x1f'),null,_0x160814));}}_0x354316[_0x1abe('0x20')]=LISTID;_0x354316['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1abe('0x21')]&&_0x56efcf){var _0x1979db={};for(var _0x44706f=0x0,_0x5052d3=DUPLICATES['length'];_0x44706f<_0x5052d3;_0x44706f+=0x1){_0x1979db[DUPLICATES[_0x44706f]]=_0x354316[DUPLICATES[_0x44706f]];}var _0x56fa40=_['find'](_0x56efcf,_0x1979db);if(_0x56fa40){return _0x400331(handleCheckRowError(_0x1abe('0x22'),_0x1abe('0x23'),_0x56fa40,_0x160814));}}return db['CmContact'][_0x1abe('0x24')](_0x354316,{'raw':!![],'hooks':![],'fields':_[_0x1abe('0x25')](_0x354316)})['then'](function(_0x3345dd){if(DUPLICATES&&DUPLICATES[_0x1abe('0x21')]&&_0x56efcf){_0x56efcf[_0x1abe('0x26')](_[_0x1abe('0x27')](_0x354316,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3345dd['id'];return _0x51765e();})['catch'](function(_0x1fb235){return _0x400331(handleCheckRowError(_0x1abe('0xd'),_0x1abe('0x28')+(_0x1fb235['message']||JSON[_0x1abe('0x29')](_0x1fb235)),null,_0x160814));});});}function checkHopper(){function _0x99bf69(){return function(_0x4721a4){logger[_0x1abe('0xd')]('cmContact',_0x1abe('0x2a'),util[_0x1abe('0x2b')](_0x4721a4,{'showHidden':![],'depth':null}));};}var _0x40a2ea=function(_0x43fb63,_0x2920b1){var _0x572ae8=squel['insert']()[_0x1abe('0x2c')](_0x1abe('0x2d'))[_0x1abe('0x2e')]([_0x1abe('0x1b'),'scheduledAt',_0x1abe('0x2f'),'ListId',_0x2920b1,_0x1abe('0x30'),_0x1abe('0x31')],squel[_0x1abe('0x32')]()[_0x1abe('0x33')](_0x1abe('0x1b'),'phone')[_0x1abe('0x33')](_0x1abe('0x34'),_0x1abe('0x35'))[_0x1abe('0x33')]('id',_0x1abe('0x2f'))['field'](LISTID[_0x1abe('0x36')](),_0x1abe('0x20'))[_0x1abe('0x33')](_0x43fb63['id'][_0x1abe('0x36')](),_0x2920b1)['field']('NOW()',_0x1abe('0x30'))[_0x1abe('0x33')](_0x1abe('0x34'),_0x1abe('0x31'))['from']('cm_contacts')[_0x1abe('0x37')](_0x1abe('0x38'))[_0x1abe('0x37')]('ListId\x20=\x20?',LISTID[_0x1abe('0x36')]())[_0x1abe('0x37')](_0x1abe('0x39'))[_0x1abe('0x37')](_0x1abe('0x3a'),squel[_0x1abe('0x32')]()['field']('phone')[_0x1abe('0x3b')](_0x1abe('0x2d'))[_0x1abe('0x37')](_0x2920b1+_0x1abe('0x3c'),_0x43fb63['id']['toString']())))[_0x1abe('0x36')]();return _0x572ae8;};var _0x1d481f=function(_0x32ec48,_0x23a035){var _0x4be82f=squel[_0x1abe('0x3d')]()[_0x1abe('0x2c')](_0x1abe('0x2d'))[_0x1abe('0x2e')]([_0x1abe('0x1b'),'scheduledAt',_0x1abe('0x2f'),'ListId',_0x23a035,_0x1abe('0x30'),_0x1abe('0x31')],squel[_0x1abe('0x32')]()[_0x1abe('0x33')]('phone','phone')[_0x1abe('0x33')](_0x1abe('0x34'),_0x1abe('0x35'))[_0x1abe('0x33')]('id',_0x1abe('0x2f'))[_0x1abe('0x33')](LISTID['toString'](),_0x1abe('0x20'))[_0x1abe('0x33')](_0x32ec48['id']['toString'](),_0x23a035)[_0x1abe('0x33')](_0x1abe('0x34'),'createdAt')[_0x1abe('0x33')]('NOW()','updatedAt')[_0x1abe('0x3b')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x1abe('0x37')](_0x1abe('0x3e'),LISTID[_0x1abe('0x36')]())[_0x1abe('0x37')](_0x1abe('0x3f'),squel['str'](hopperContacts))[_0x1abe('0x37')](_0x1abe('0x39'))[_0x1abe('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1abe('0x32')]()[_0x1abe('0x33')](_0x1abe('0x40'))[_0x1abe('0x3b')]('cm_hopper_final')[_0x1abe('0x37')](_0x23a035+_0x1abe('0x3c'),_0x32ec48['id'][_0x1abe('0x36')]()))['where'](_0x1abe('0x3a'),squel['select']()[_0x1abe('0x33')]('phone')[_0x1abe('0x3b')](_0x1abe('0x2d'))[_0x1abe('0x37')](_0x23a035+_0x1abe('0x3c'),_0x32ec48['id'][_0x1abe('0x36')]())))[_0x1abe('0x36')]();return _0x4be82f;};function _0x54f53b(_0x220ee6,_0x49f98e){var _0x33b8ce=squel['insert']()[_0x1abe('0x2c')](_0x1abe('0x2d'))[_0x1abe('0x2e')]([_0x1abe('0x1b'),_0x1abe('0x35'),_0x1abe('0x2f'),_0x1abe('0x20'),_0x49f98e,_0x1abe('0x30'),'updatedAt'],squel[_0x1abe('0x32')]()['field'](_0x1abe('0x1b'),_0x1abe('0x1b'))[_0x1abe('0x33')](_0x1abe('0x34'),_0x1abe('0x35'))[_0x1abe('0x33')]('id',_0x1abe('0x2f'))[_0x1abe('0x33')](LISTID[_0x1abe('0x36')](),_0x1abe('0x20'))['field'](_0x220ee6['id'][_0x1abe('0x36')](),_0x49f98e)[_0x1abe('0x33')](_0x1abe('0x34'),'createdAt')[_0x1abe('0x33')](_0x1abe('0x34'),_0x1abe('0x31'))[_0x1abe('0x3b')](_0x1abe('0x41'))[_0x1abe('0x37')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x1abe('0x36')]())['where'](_0x1abe('0x3f'),squel['str'](hopperContacts))['where'](_0x1abe('0x39')))['toString']();return _0x33b8ce;}function _0x1c170d(_0x5c4e99,_0x547016){var _0x497b13=squel[_0x1abe('0x3d')]()[_0x1abe('0x2c')]('cm_hopper_black')[_0x1abe('0x2e')]([_0x1abe('0x1b'),_0x1abe('0x2f'),_0x1abe('0x20'),_0x547016,_0x1abe('0x30'),_0x1abe('0x31')],squel['select']()[_0x1abe('0x33')](_0x1abe('0x1b'),_0x1abe('0x1b'))[_0x1abe('0x33')]('id',_0x1abe('0x2f'))[_0x1abe('0x33')](LISTID[_0x1abe('0x36')](),_0x1abe('0x20'))[_0x1abe('0x33')](_0x5c4e99['id'][_0x1abe('0x36')](),_0x547016)[_0x1abe('0x33')](_0x1abe('0x34'),'createdAt')[_0x1abe('0x33')]('NOW()',_0x1abe('0x31'))[_0x1abe('0x3b')]('cm_contacts')[_0x1abe('0x37')](_0x1abe('0x38'))['where'](_0x1abe('0x3e'),LISTID[_0x1abe('0x36')]())[_0x1abe('0x37')](_0x1abe('0x3f'),squel[_0x1abe('0x42')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x497b13;}return db[_0x1abe('0x43')][_0x1abe('0x44')]({'where':{'type':_0x1abe('0x45')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1abe('0x46')],'as':'Lists','where':{'id':LISTID}}]})[_0x1abe('0x47')](function(_0x4ad705){var _0x5313a2=[];if(_0x4ad705){var _0x3cfcfe;for(var _0x547493=0x0,_0x553820;_0x547493<_0x4ad705[_0x1abe('0x21')];_0x547493+=0x1){_0x553820=_0x4ad705[_0x547493][_0x1abe('0x48')]({'plain':!![]});switch(_0x553820[_0x1abe('0x49')]){case'always':_0x5313a2[_0x1abe('0x26')](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x1d481f(_0x553820,_0x1abe('0x4c')))[_0x1abe('0x47')](function(){})[_0x1abe('0x4d')](_0x99bf69()));break;case _0x1abe('0x4e'):_0x5313a2[_0x1abe('0x26')](db['sequelize'][_0x1abe('0x4b')](_0x40a2ea(_0x553820,_0x1abe('0x4c')))[_0x1abe('0x47')](function(){})[_0x1abe('0x4d')](_0x99bf69()));break;default:_0x5313a2['push'](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x54f53b(_0x553820,_0x1abe('0x4c')))[_0x1abe('0x47')](function(){})[_0x1abe('0x4d')](_0x99bf69()));}}}return _0x5313a2;})['all']()[_0x1abe('0x47')](function(){return db[_0x1abe('0x43')][_0x1abe('0x44')]({'where':{'type':_0x1abe('0x45')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x1abe('0x4f'),'where':{'id':LISTID}}]})[_0x1abe('0x47')](function(_0x5bc4a3){var _0x35ddcf=[];if(_0x5bc4a3){var _0x91ffd9;for(var _0x3832b7=0x0,_0x2494f6;_0x3832b7<_0x5bc4a3['length'];_0x3832b7+=0x1){_0x2494f6=_0x5bc4a3[_0x3832b7][_0x1abe('0x48')]({'plain':!![]});_0x35ddcf[_0x1abe('0x26')](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x1c170d(_0x2494f6,_0x1abe('0x4c')))['then'](function(){})['catch'](_0x99bf69()));}}return _0x35ddcf;})[_0x1abe('0x50')]();})[_0x1abe('0x47')](function(){return db[_0x1abe('0x51')]['findAll']({'attributes':['id',_0x1abe('0x49')],'include':[{'model':db[_0x1abe('0x46')],'as':'Lists','where':{'id':LISTID}}]})[_0x1abe('0x47')](function(_0x59398b){var _0x9190ac=[];if(_0x59398b){for(var _0x4180d2=0x0,_0x39a38c;_0x4180d2<_0x59398b[_0x1abe('0x21')];_0x4180d2+=0x1){_0x39a38c=_0x59398b[_0x4180d2][_0x1abe('0x48')]({'plain':!![]});switch(_0x39a38c[_0x1abe('0x49')]){case _0x1abe('0x52'):_0x9190ac[_0x1abe('0x26')](db['sequelize'][_0x1abe('0x4b')](_0x1d481f(_0x39a38c,_0x1abe('0x53')))[_0x1abe('0x47')](function(){})[_0x1abe('0x4d')](_0x99bf69()));break;case _0x1abe('0x4e'):_0x9190ac[_0x1abe('0x26')](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x40a2ea(_0x39a38c,_0x1abe('0x53')))[_0x1abe('0x47')](function(){})['catch'](_0x99bf69()));break;default:_0x9190ac[_0x1abe('0x26')](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x54f53b(_0x39a38c,_0x1abe('0x53')))[_0x1abe('0x47')](function(){})['catch'](_0x99bf69()));}}}return _0x9190ac;})[_0x1abe('0x50')]();})[_0x1abe('0x47')](function(){return db[_0x1abe('0x51')][_0x1abe('0x44')]({'attributes':['id'],'include':[{'model':db[_0x1abe('0x46')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1abe('0x47')](function(_0x182962){var _0x2fb8d0=[];if(_0x182962){for(var _0x18f6b9=0x0,_0x475c1a;_0x18f6b9<_0x182962[_0x1abe('0x21')];_0x18f6b9+=0x1){_0x475c1a=_0x182962[_0x18f6b9]['get']({'plain':!![]});_0x2fb8d0['push'](db[_0x1abe('0x4a')][_0x1abe('0x4b')](_0x1c170d(_0x475c1a,_0x1abe('0x53')))[_0x1abe('0x47')](function(){})[_0x1abe('0x4d')](_0x99bf69()));}}return _0x2fb8d0;})['all']();})['catch'](function(_0x1e1d61){logger[_0x1abe('0xd')](_0x1abe('0x54'),_0x1abe('0x55'),_0x1e1d61[_0x1abe('0x15')]);});}var processPromises=function(_0x4afc51){return BPromise[_0x1abe('0x50')](promises)['then'](function(_0x3ea8a4){})[_0x1abe('0x4d')](function(_0x4384e6){logger[_0x1abe('0xd')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x4384e6));})[_0x1abe('0x56')](function(){socket[_0x1abe('0x57')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4afc51){return _0x4afc51[_0x1abe('0x58')]();}});};var endCsv=function(){return BPromise[_0x1abe('0x59')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x1abe('0x57')](_0x1abe('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1abe('0x5b')](FILEPATH);}catch(_0x53114e){logger['error'](_0x1abe('0x5c'),JSON['stringify'](_0x53114e));}finally{process[_0x1abe('0x5d')](0x0);}});};process['on'](_0x1abe('0x5e'),function(){logger['info'](_0x1abe('0x5f'));endCsv();});function main(){return BPromise[_0x1abe('0x59')]()[_0x1abe('0x47')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x1abe('0x60')][_0x1abe('0x44')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1abe('0x47')](function(_0x326b45){var _0x52c424=fs[_0x1abe('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1abe('0x62')](_0x52c424,{'header':!![],'skipEmptyLines':!![],'step':function(_0x39feae,_0x5c3f90){total+=0x1;var _0x1e88a2=total;promises[_0x1abe('0x26')](checkRow(_0x39feae,_0x326b45,_0x1e88a2)[_0x1abe('0x47')](function(){success+=0x1;})[_0x1abe('0x4d')](function(_0x197564){if(_0x197564[_0x1abe('0xd')]){errors+=0x1;delete _0x197564[_0x1abe('0xd')];}else if(_0x197564['duplicate']){duplicates+=0x1;delete _0x197564['duplicate'];}rows[_0x1abe('0x26')](_0x197564);}));if(total%0xc8===0x0){_0x5c3f90[_0x1abe('0x63')]();return processPromises(_0x5c3f90);}},'complete':function(){return processPromises()[_0x1abe('0x47')](function(){logger[_0x1abe('0x64')](_0x1abe('0x65'));endCsv();});},'error':function(_0x501990,_0x396c10){logger[_0x1abe('0x64')](_0x1abe('0x66'),JSON[_0x1abe('0x29')](_0x501990));endCsv();}});})[_0x1abe('0x4d')](function(_0x1bf875){logger[_0x1abe('0xd')](_0x1abe('0x67'),JSON[_0x1abe('0x29')](_0x1bf875));});}main(); \ No newline at end of file +var _0x2bc8=['CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','ioredis','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','join','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','phone','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','createdAt','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','id\x20IN\x20?','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','VoiceQueue','BlackLists','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','pause'];(function(_0x1d178f,_0x512e41){var _0x282b5d=function(_0x11d9bb){while(--_0x11d9bb){_0x1d178f['push'](_0x1d178f['shift']());}};_0x282b5d(++_0x512e41);}(_0x2bc8,0xd7));var _0x82bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x82bc('0x0'));var util=require('util');var _=require(_0x82bc('0x1'));var fs=require('fs');var squel=require(_0x82bc('0x2'));var Papa=require('papaparse');var Redis=require(_0x82bc('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x82bc('0x4'));var logger=require('../../../config/logger')(_0x82bc('0x5'));config[_0x82bc('0x6')]=_['defaults'](config[_0x82bc('0x6')],{'host':_0x82bc('0x7'),'port':0x18eb});var socket=require(_0x82bc('0x8'))(new Redis(config[_0x82bc('0x6')]));require(_0x82bc('0x9'))[_0x82bc('0xa')](socket);try{if(!process[_0x82bc('0xb')][0x2]||process[_0x82bc('0xb')][0x2]===_0x82bc('0xc')||process['argv'][0x2]===_0x82bc('0xd')){throw new Error(_0x82bc('0xe'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x82bc('0xb')][0x3]==='undefined'||process['argv'][0x3]===_0x82bc('0xd')||!process[_0x82bc('0xb')][0x4]||process[_0x82bc('0xb')][0x4]==='undefined'||process[_0x82bc('0xb')][0x4]==='null'){throw new Error(_0x82bc('0xf'));}var FIELDS=_[_0x82bc('0x10')](process[_0x82bc('0xb')][0x3][_0x82bc('0x11')](','),process[_0x82bc('0xb')][0x4][_0x82bc('0x11')](','));if(!process[_0x82bc('0xb')][0x5]||process[_0x82bc('0xb')][0x5]==='undefined'||process[_0x82bc('0xb')][0x5]===_0x82bc('0xd')){throw new Error(_0x82bc('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x82bc('0xb')][0x6]&&process[_0x82bc('0xb')][0x6]!==_0x82bc('0xc')&&process[_0x82bc('0xb')][0x6]!==_0x82bc('0xd')?process[_0x82bc('0xb')][0x6]:null;var DUPLICATES=process[_0x82bc('0xb')][0x7]&&process[_0x82bc('0xb')][0x7]!==_0x82bc('0xc')&&process[_0x82bc('0xb')][0x7]!=='null'?process[_0x82bc('0xb')][0x7]:null;if(!process[_0x82bc('0xb')][0x8]||process[_0x82bc('0xb')][0x8]==='undefined'||process[_0x82bc('0xb')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3c0150){logger[_0x82bc('0x13')](_0x3c0150);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(_0x44e34c,_0x289641,_0xc5223b,_0x49fe08){var _0x41985f={'message':_0x289641};_0x41985f[_0x44e34c]=!![];if(_0xc5223b){_0x41985f[_0x82bc('0x14')]=_0xc5223b;}if(_0x49fe08){_0x41985f[_0x82bc('0x15')]=_0x49fe08;}return _0x41985f;}function isEmail(_0x297a02){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))*$/[_0x82bc('0x16')](_0x297a02);}function checkRow(_0xd10f67,_0x35c266,_0x341b84){return new BPromise(function(_0x3135f9,_0x4cddb8){if(_[_0x82bc('0x17')](_0xd10f67)){return _0x4cddb8(handleCheckRowError('error',_0x82bc('0x18'),null,_0x341b84));}if(_0xd10f67['errors']&&_0xd10f67['errors'][_0x82bc('0x19')]){var _0x16bc6a=_[_0x82bc('0x1a')](_0xd10f67['errors'],'message')[_0x82bc('0x1b')](';');return _0x4cddb8(handleCheckRowError('error',_0x16bc6a,null,_0x341b84));}var _0x372715={};for(var _0x58c6c5 in FIELDS){if(FIELDS['hasOwnProperty'](_0x58c6c5)&&FIELDS[_0x58c6c5]){_0x372715[_0x58c6c5]=_0xd10f67[_0x82bc('0x1c')][0x0][FIELDS[_0x58c6c5]]||_0xd10f67[_0x82bc('0x1c')][0x0]['\ufeff'+FIELDS[_0x58c6c5]];}}if(!_0x372715[_0x82bc('0x1d')]){return _0x4cddb8(handleCheckRowError(_0x82bc('0x13'),_0x82bc('0x1e'),null,_0x341b84));}if(!_0x372715['phone']){return _0x4cddb8(handleCheckRowError(_0x82bc('0x13'),'phone\x20not\x20specified!',null,_0x341b84));}if(_0x372715[_0x82bc('0x1f')]){var _0x3f00b5=moment(_0x372715[_0x82bc('0x1f')],_0x82bc('0x20'));if(!_0x3f00b5[_0x82bc('0x21')]()){return _0x4cddb8(handleCheckRowError('error',_0x82bc('0x22'),null,_0x341b84));}}if(_0x372715[_0x82bc('0x23')]){if(!isEmail(_0x372715[_0x82bc('0x23')])){return _0x4cddb8(handleCheckRowError(_0x82bc('0x13'),_0x82bc('0x24'),null,_0x341b84));}}_0x372715['ListId']=LISTID;_0x372715[_0x82bc('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x82bc('0x19')]&&_0x35c266){var _0x87ab73={};for(var _0x41c44c=0x0,_0x5d94f9=DUPLICATES['length'];_0x41c44c<_0x5d94f9;_0x41c44c+=0x1){_0x87ab73[DUPLICATES[_0x41c44c]]=_0x372715[DUPLICATES[_0x41c44c]];}var _0x31e4d8=_['find'](_0x35c266,_0x87ab73);if(_0x31e4d8){return _0x4cddb8(handleCheckRowError(_0x82bc('0x26'),'Duplicate\x20Contact',_0x31e4d8,_0x341b84));}}return db[_0x82bc('0x27')]['create'](_0x372715,{'raw':!![],'hooks':![],'fields':_[_0x82bc('0x28')](_0x372715)})[_0x82bc('0x29')](function(_0x4dff28){if(DUPLICATES&&DUPLICATES[_0x82bc('0x19')]&&_0x35c266){_0x35c266[_0x82bc('0x2a')](_[_0x82bc('0x2b')](_0x372715,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4dff28['id'];return _0x3135f9();})[_0x82bc('0x2c')](function(_0x335bd8){return _0x4cddb8(handleCheckRowError(_0x82bc('0x13'),_0x82bc('0x2d')+(_0x335bd8[_0x82bc('0x2e')]||JSON['stringify'](_0x335bd8)),null,_0x341b84));});});}function checkHopper(){function _0x17e079(){return function(_0x24eac0){logger[_0x82bc('0x13')](_0x82bc('0x2f'),_0x82bc('0x30'),util['inspect'](_0x24eac0,{'showHidden':![],'depth':null}));};}var _0x22f0f7=function(_0x1c950a,_0xe5d9fd){var _0x21d742=squel[_0x82bc('0x31')]()[_0x82bc('0x32')](_0x82bc('0x33'))[_0x82bc('0x34')](['phone',_0x82bc('0x35'),_0x82bc('0x36'),_0x82bc('0x37'),_0xe5d9fd,'createdAt',_0x82bc('0x38')],squel[_0x82bc('0x39')]()[_0x82bc('0x3a')](_0x82bc('0x3b'),_0x82bc('0x3b'))[_0x82bc('0x3a')](_0x82bc('0x3c'),_0x82bc('0x35'))['field']('id',_0x82bc('0x36'))['field'](LISTID[_0x82bc('0x3d')](),'ListId')[_0x82bc('0x3a')](_0x1c950a['id'][_0x82bc('0x3d')](),_0xe5d9fd)['field'](_0x82bc('0x3c'),'createdAt')[_0x82bc('0x3a')](_0x82bc('0x3c'),_0x82bc('0x38'))[_0x82bc('0x3e')](_0x82bc('0x3f'))[_0x82bc('0x40')](_0x82bc('0x41'))[_0x82bc('0x40')](_0x82bc('0x42'),LISTID['toString']())['where'](_0x82bc('0x43'))[_0x82bc('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x82bc('0x39')]()[_0x82bc('0x3a')]('phone')[_0x82bc('0x3e')](_0x82bc('0x33'))[_0x82bc('0x40')](_0xe5d9fd+_0x82bc('0x44'),_0x1c950a['id'][_0x82bc('0x3d')]())))['toString']();return _0x21d742;};var _0x41ed9b=function(_0x1d2a73,_0x1fc431){var _0x33d7be=squel[_0x82bc('0x31')]()[_0x82bc('0x32')](_0x82bc('0x33'))['fromQuery']([_0x82bc('0x3b'),_0x82bc('0x35'),_0x82bc('0x36'),_0x82bc('0x37'),_0x1fc431,_0x82bc('0x45'),_0x82bc('0x38')],squel[_0x82bc('0x39')]()[_0x82bc('0x3a')](_0x82bc('0x3b'),'phone')['field'](_0x82bc('0x3c'),'scheduledAt')[_0x82bc('0x3a')]('id','ContactId')[_0x82bc('0x3a')](LISTID['toString'](),_0x82bc('0x37'))[_0x82bc('0x3a')](_0x1d2a73['id'][_0x82bc('0x3d')](),_0x1fc431)['field']('NOW()','createdAt')[_0x82bc('0x3a')]('NOW()','updatedAt')[_0x82bc('0x3e')]('cm_contacts')[_0x82bc('0x40')](_0x82bc('0x41'))[_0x82bc('0x40')]('ListId\x20=\x20?',LISTID[_0x82bc('0x3d')]())[_0x82bc('0x40')]('id\x20IN\x20?',squel[_0x82bc('0x46')](hopperContacts))[_0x82bc('0x40')](_0x82bc('0x43'))[_0x82bc('0x40')](_0x82bc('0x47'),squel[_0x82bc('0x39')]()['field'](_0x82bc('0x48'))['from'](_0x82bc('0x49'))[_0x82bc('0x40')](_0x1fc431+_0x82bc('0x44'),_0x1d2a73['id'][_0x82bc('0x3d')]()))[_0x82bc('0x40')](_0x82bc('0x47'),squel[_0x82bc('0x39')]()['field'](_0x82bc('0x3b'))[_0x82bc('0x3e')](_0x82bc('0x33'))['where'](_0x1fc431+'\x20=\x20?',_0x1d2a73['id'][_0x82bc('0x3d')]())))[_0x82bc('0x3d')]();return _0x33d7be;};function _0xae6ba7(_0x13415f,_0x34d294){var _0x13e8e0=squel['insert']()[_0x82bc('0x32')](_0x82bc('0x33'))[_0x82bc('0x34')]([_0x82bc('0x3b'),_0x82bc('0x35'),_0x82bc('0x36'),_0x82bc('0x37'),_0x34d294,_0x82bc('0x45'),'updatedAt'],squel['select']()[_0x82bc('0x3a')](_0x82bc('0x3b'),_0x82bc('0x3b'))['field']('NOW()',_0x82bc('0x35'))[_0x82bc('0x3a')]('id',_0x82bc('0x36'))[_0x82bc('0x3a')](LISTID['toString'](),_0x82bc('0x37'))['field'](_0x13415f['id']['toString'](),_0x34d294)[_0x82bc('0x3a')](_0x82bc('0x3c'),_0x82bc('0x45'))[_0x82bc('0x3a')](_0x82bc('0x3c'),'updatedAt')[_0x82bc('0x3e')]('cm_contacts')[_0x82bc('0x40')](_0x82bc('0x41'))[_0x82bc('0x40')]('ListId\x20=\x20?',LISTID[_0x82bc('0x3d')]())[_0x82bc('0x40')](_0x82bc('0x4a'),squel[_0x82bc('0x46')](hopperContacts))[_0x82bc('0x40')](_0x82bc('0x43')))[_0x82bc('0x3d')]();return _0x13e8e0;}function _0x114efb(_0x406a1e,_0x4d54af){var _0x130fb1=squel[_0x82bc('0x31')]()[_0x82bc('0x32')]('cm_hopper_black')['fromQuery'](['phone',_0x82bc('0x36'),'ListId',_0x4d54af,'createdAt',_0x82bc('0x38')],squel[_0x82bc('0x39')]()[_0x82bc('0x3a')](_0x82bc('0x3b'),_0x82bc('0x3b'))[_0x82bc('0x3a')]('id','ContactId')[_0x82bc('0x3a')](LISTID['toString'](),_0x82bc('0x37'))['field'](_0x406a1e['id'][_0x82bc('0x3d')](),_0x4d54af)[_0x82bc('0x3a')](_0x82bc('0x3c'),'createdAt')['field'](_0x82bc('0x3c'),_0x82bc('0x38'))[_0x82bc('0x3e')](_0x82bc('0x3f'))[_0x82bc('0x40')](_0x82bc('0x41'))[_0x82bc('0x40')](_0x82bc('0x42'),LISTID[_0x82bc('0x3d')]())[_0x82bc('0x40')](_0x82bc('0x4a'),squel[_0x82bc('0x46')](hopperContacts))[_0x82bc('0x40')](_0x82bc('0x43')))['toString']();return _0x130fb1;}return db['VoiceQueue'][_0x82bc('0x4b')]({'where':{'type':_0x82bc('0x4c')},'attributes':['id',_0x82bc('0x4d')],'include':[{'model':db[_0x82bc('0x4e')],'as':_0x82bc('0x4f'),'where':{'id':LISTID}}]})[_0x82bc('0x29')](function(_0x401c4e){var _0x54790e=[];if(_0x401c4e){var _0x391d8e;for(var _0x18983f=0x0,_0x5e7307;_0x18983f<_0x401c4e[_0x82bc('0x19')];_0x18983f+=0x1){_0x5e7307=_0x401c4e[_0x18983f][_0x82bc('0x50')]({'plain':!![]});switch(_0x5e7307[_0x82bc('0x4d')]){case _0x82bc('0x51'):_0x54790e[_0x82bc('0x2a')](db['sequelize'][_0x82bc('0x52')](_0x41ed9b(_0x5e7307,_0x82bc('0x53')))[_0x82bc('0x29')](function(){})['catch'](_0x17e079()));break;case _0x82bc('0x54'):_0x54790e[_0x82bc('0x2a')](db['sequelize'][_0x82bc('0x52')](_0x22f0f7(_0x5e7307,_0x82bc('0x53')))[_0x82bc('0x29')](function(){})['catch'](_0x17e079()));break;default:_0x54790e[_0x82bc('0x2a')](db[_0x82bc('0x55')][_0x82bc('0x52')](_0xae6ba7(_0x5e7307,'VoiceQueueId'))[_0x82bc('0x29')](function(){})[_0x82bc('0x2c')](_0x17e079()));}}}return _0x54790e;})[_0x82bc('0x56')]()[_0x82bc('0x29')](function(){return db[_0x82bc('0x57')][_0x82bc('0x4b')]({'where':{'type':_0x82bc('0x4c')},'attributes':['id'],'include':[{'model':db[_0x82bc('0x4e')],'as':_0x82bc('0x58'),'where':{'id':LISTID}}]})[_0x82bc('0x29')](function(_0x4ace50){var _0x1aa478=[];if(_0x4ace50){var _0x31ed90;for(var _0x4fd539=0x0,_0x14b08b;_0x4fd539<_0x4ace50[_0x82bc('0x19')];_0x4fd539+=0x1){_0x14b08b=_0x4ace50[_0x4fd539][_0x82bc('0x50')]({'plain':!![]});_0x1aa478[_0x82bc('0x2a')](db[_0x82bc('0x55')][_0x82bc('0x52')](_0x114efb(_0x14b08b,_0x82bc('0x53')))[_0x82bc('0x29')](function(){})[_0x82bc('0x2c')](_0x17e079()));}}return _0x1aa478;})[_0x82bc('0x56')]();})['then'](function(){return db[_0x82bc('0x59')][_0x82bc('0x4b')]({'attributes':['id',_0x82bc('0x4d')],'include':[{'model':db['CmList'],'as':_0x82bc('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x37858f){var _0x56bf0c=[];if(_0x37858f){for(var _0x59a288=0x0,_0xeaef74;_0x59a288<_0x37858f[_0x82bc('0x19')];_0x59a288+=0x1){_0xeaef74=_0x37858f[_0x59a288][_0x82bc('0x50')]({'plain':!![]});switch(_0xeaef74[_0x82bc('0x4d')]){case _0x82bc('0x51'):_0x56bf0c[_0x82bc('0x2a')](db[_0x82bc('0x55')][_0x82bc('0x52')](_0x41ed9b(_0xeaef74,_0x82bc('0x5a')))['then'](function(){})[_0x82bc('0x2c')](_0x17e079()));break;case _0x82bc('0x54'):_0x56bf0c[_0x82bc('0x2a')](db['sequelize']['query'](_0x22f0f7(_0xeaef74,_0x82bc('0x5a')))['then'](function(){})[_0x82bc('0x2c')](_0x17e079()));break;default:_0x56bf0c[_0x82bc('0x2a')](db[_0x82bc('0x55')][_0x82bc('0x52')](_0xae6ba7(_0xeaef74,_0x82bc('0x5a')))[_0x82bc('0x29')](function(){})[_0x82bc('0x2c')](_0x17e079()));}}}return _0x56bf0c;})[_0x82bc('0x56')]();})[_0x82bc('0x29')](function(){return db[_0x82bc('0x59')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x82bc('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x6e4506){var _0x419257=[];if(_0x6e4506){for(var _0x295cb9=0x0,_0x3b578e;_0x295cb9<_0x6e4506[_0x82bc('0x19')];_0x295cb9+=0x1){_0x3b578e=_0x6e4506[_0x295cb9]['get']({'plain':!![]});_0x419257['push'](db[_0x82bc('0x55')][_0x82bc('0x52')](_0x114efb(_0x3b578e,_0x82bc('0x5a')))[_0x82bc('0x29')](function(){})['catch'](_0x17e079()));}}return _0x419257;})[_0x82bc('0x56')]();})['catch'](function(_0x47d94a){logger['error']('cmContact,\x20%s,\x20%s',_0x82bc('0x5b'),_0x47d94a[_0x82bc('0x2e')]);});}var processPromises=function(_0x4a266a){return BPromise[_0x82bc('0x56')](promises)[_0x82bc('0x29')](function(_0x1ee527){})[_0x82bc('0x2c')](function(_0x2b0be1){logger[_0x82bc('0x13')](_0x82bc('0x5c'),JSON[_0x82bc('0x5d')](_0x2b0be1));})[_0x82bc('0x5e')](function(){socket[_0x82bc('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4a266a){return _0x4a266a['resume']();}});};var endCsv=function(){return BPromise[_0x82bc('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x82bc('0x29')](function(){socket[_0x82bc('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x82bc('0x61')](FILEPATH);}catch(_0x119b5f){logger[_0x82bc('0x13')](_0x82bc('0x62'),JSON[_0x82bc('0x5d')](_0x119b5f));}finally{process[_0x82bc('0x63')](0x0);}});};process['on'](_0x82bc('0x64'),function(){logger[_0x82bc('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x82bc('0x60')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x82bc('0x11')](',');return db[_0x82bc('0x27')][_0x82bc('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x82bc('0x29')](function(_0x3b83b1){var _0x3e82ac=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3e82ac,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3cdeb5,_0x36b2fc){total+=0x1;var _0x1385a9=total;promises[_0x82bc('0x2a')](checkRow(_0x3cdeb5,_0x3b83b1,_0x1385a9)[_0x82bc('0x29')](function(){success+=0x1;})[_0x82bc('0x2c')](function(_0x21d174){if(_0x21d174['error']){errors+=0x1;delete _0x21d174['error'];}else if(_0x21d174[_0x82bc('0x26')]){duplicates+=0x1;delete _0x21d174[_0x82bc('0x26')];}rows[_0x82bc('0x2a')](_0x21d174);}));if(total%0xc8===0x0){_0x36b2fc[_0x82bc('0x66')]();return processPromises(_0x36b2fc);}},'complete':function(){return processPromises()[_0x82bc('0x29')](function(){logger[_0x82bc('0x65')](_0x82bc('0x67'));endCsv();});},'error':function(_0x23472c,_0x11b639){logger[_0x82bc('0x65')](_0x82bc('0x68'),JSON[_0x82bc('0x5d')](_0x23472c));endCsv();}});})[_0x82bc('0x2c')](function(_0x2a719f){logger[_0x82bc('0x13')](_0x82bc('0x69'),JSON[_0x82bc('0x5d')](_0x2a719f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0906426..c727826 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 _0x5943=['CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','\x20=\x20','where','CmContact','findAll','AdditionalPhones','then','length','push','split','all','isNil','filter','update','updated','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','ListId','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.UserId','recallme','fields','cm_contacts','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','scheduledAt','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','spread','timezones','utcOffset','set','offset','dialTimezone','info','main','stringify','start','binding','clone','socket_timestamp','.csv','keys','includes','header','name','_description','writeFileSync','data','rows','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_'];(function(_0x3f8667,_0x526ac1){var _0x413586=function(_0x5b4a70){while(--_0x5b4a70){_0x3f8667['push'](_0x3f8667['shift']());}};_0x413586(++_0x526ac1);}(_0x5943,0xe5));var _0x3594=function(_0x23e627,_0x18cd09){_0x23e627=_0x23e627-0x0;var _0xa6e714=_0x5943[_0x23e627];return _0xa6e714;};'use strict';var fs=require('fs');var path=require(_0x3594('0x0'));var _=require(_0x3594('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x3594('0x2'));var moment=require(_0x3594('0x3'));var squel=require(_0x3594('0x4'));var Redis=require(_0x3594('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x3594('0x6'));var shared=require(_0x3594('0x7'));var logger=require(_0x3594('0x8'))(_0x3594('0x9'));config[_0x3594('0xa')]=_[_0x3594('0xb')](config[_0x3594('0xa')],{'host':_0x3594('0xc'),'port':0x18eb});var socket=require(_0x3594('0xd'))(new Redis(config[_0x3594('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x3594('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x3594('0xe'));function isEmail(_0x6843ea){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))*$/[_0x3594('0xf')](_0x6843ea);}function selectNotIn(_0x1ecd10,_0x5b380a,_0x33e3f5,_0x18c684,_0x251be4){return squel[_0x3594('0x10')]()[_0x3594('0x11')]('phone')[_0x3594('0x12')](_0x18c684)[_0x3594('0x13')](_0x5b380a,null,_0x5b380a+_0x3594('0x14')+_0x18c684+'.'+_0x33e3f5)['where'](_0x18c684+'.'+_0x33e3f5+_0x3594('0x15')+_0x1ecd10+'.'+_0x33e3f5)[_0x3594('0x16')](_0x5b380a+'.dialCheckDuplicateType\x20IN\x20('+_0x251be4[_0x3594('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xb7a565,_0x5615c6){promisesAdditionalPhones=[];return db[_0x3594('0x17')][_0x3594('0x18')]({'raw':!![],'attributes':['id',_0x3594('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x3594('0x1a')](function(_0x3ba41c){if(_0x3ba41c!==null){var _0x410fe2=[];for(var _0x3b7c26=0x0;_0x3b7c26<_0x3ba41c[_0x3594('0x1b')];_0x3b7c26++){var _0x3e47ad=_0x3ba41c[_0x3b7c26];_0x410fe2[_0x3594('0x1c')](insertAdditionalPhones(_0x3e47ad));}}Promise['all'](_0x410fe2)[_0x3594('0x1a')](function(){_0xb7a565({'val':0x1});});});});}function insertAdditionalPhones(_0x1c4829){return new Promise(function(_0x2353fe,_0x400b18){var _0x535279=_0x1c4829['AdditionalPhones'];var _0x40cc27=_0x535279[_0x3594('0x1d')](';');var _0x3f1ae9=[];orderBy=0x0;for(var _0x565aaf=0x0;_0x565aaf<_0x40cc27[_0x3594('0x1b')];_0x565aaf++){_0x3f1ae9[_0x3594('0x1c')](splitAdditionalPhone(_0x1c4829['id'],_0x40cc27[_0x565aaf]));}Promise[_0x3594('0x1e')](_0x3f1ae9)[_0x3594('0x1a')](function(){_0x2353fe({'val':_0x40cc27[_0x3594('0x1b')]});});});}function splitAdditionalPhone(_0x11abac,_0x3eb963){return new Promise(function(_0x9350ea,_0x542555){var _0x284a79=_0x3eb963[_0x3594('0x1d')](':');var _0x3385d5=_0x284a79[0x0];var _0x9e6d44=_0x284a79[0x1];if(!_[_0x3594('0x1f')](_0x9e6d44)){var _0x2be2ae=_0x9e6d44[_0x3594('0x1d')]('|');var _0xfea35=[];for(var _0x2ec0=0x0;_0x2ec0<_0x2be2ae[_0x3594('0x1b')];_0x2ec0++){if(_0x2be2ae[_0x2ec0]!==''){var _0x32245a=_[_0x3594('0x20')](promisesAdditionalPhones,{'contactId':_0x11abac,'phone':_0x2be2ae[_0x2ec0]});if(_0x32245a[_0x3594('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x3594('0x1c')]({'contactId':_0x11abac,'contactTypeId':_0x3385d5,'phone':_0x2be2ae[_0x2ec0],'orderBy':orderBy});}}}_0x9350ea({'ok':0x1});}else _0x9350ea({'res':0x0});});}function createAdditionalPhone(_0x7e4a79,_0x21ccd8,_0x130799,_0x5102aa){var _0x353645='';var _0x1e8bd8='';var _0x4c2070=_0x130799['split']('§');_0x353645=_0x4c2070[0x0];if(_0x4c2070[_0x3594('0x1b')]==0x2)_0x1e8bd8=_0x4c2070[0x1];return new Promise(function(_0x390bcb,_0x2f093b){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x7e4a79,'item':_0x353645}})[_0x3594('0x1a')](function(_0xd73954){if(_0xd73954){return db['CmContactHasItem'][_0x3594('0x21')]({'ItemTypeId':_0x21ccd8,'description':_0x1e8bd8,'OrderBy':_0x5102aa},{'where':{'CmContactId':_0x7e4a79,'item':_0x353645}})[_0x3594('0x1a')](function(_0x35eb3b){_0x390bcb({'res':_0x3594('0x22')});});}else{return db[_0x3594('0x23')][_0x3594('0x24')]({'CmContactId':_0x7e4a79,'item':_0x353645,'description':_0x1e8bd8,'ItemTypeId':_0x21ccd8,'OrderBy':_0x5102aa,'ItemClass':_0x3594('0x25')})[_0x3594('0x1a')](function(_0x3aec00){_0x390bcb({'res':_0x3594('0x26')});});}});});}function insertCmHopper(_0x280a3c,_0x49995d,_0x3b503c,_0x39d376,_0x63e9f7){var _0x5dd026=[_0x3594('0x27'),_0x3594('0x28'),_0x3594('0x29'),_0x3594('0x2a'),_0x49995d+'.'+_0x39d376,'cm_contacts.createdAt',_0x3594('0x2b'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x63e9f7+'\x22'];return squel[_0x3594('0x2c')]()[_0x3594('0x2d')](_0x3594('0x2e'))[_0x3594('0x2f')]([_0x3594('0x30'),_0x3594('0x31'),_0x3594('0x32'),'ListId',_0x39d376,_0x3594('0x33'),_0x3594('0x34'),_0x3594('0x35'),_0x3594('0x36'),'recallme'],squel['select']()['fields'](_0x5dd026)[_0x3594('0x12')](_0x49995d)[_0x3594('0x13')]('cm_contacts',null,_0x3594('0x37')+_0x49995d+_0x3594('0x38'))[_0x3594('0x13')](_0x3b503c,null,_0x3b503c+'.id\x20=\x20'+_0x49995d+'.'+_0x39d376)['where'](_0x49995d+_0x3594('0x39'),_0x280a3c)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3594('0x3a'),selectNotIn(_0x49995d,_0x3b503c,_0x39d376,_0x3594('0x2e'),[_0x3594('0x3b'),_0x3594('0x3c')]))[_0x3594('0x16')](_0x3594('0x3a'),selectNotIn(_0x49995d,_0x3b503c,_0x39d376,_0x3594('0x2e'),[_0x3594('0x3b')])))[_0x3594('0x3d')]();}function insertCmHopperBlack(_0x4c6530,_0x3da1e6,_0x36c81f,_0x3145dd){var _0x44d146=[_0x3594('0x27'),'cm_contacts.id','cm_contacts.ListId',_0x3da1e6+'.'+_0x3145dd,_0x3594('0x3e'),_0x3594('0x2b')];return squel[_0x3594('0x2c')]()['into'](_0x3594('0x3f'))[_0x3594('0x2f')]([_0x3594('0x30'),_0x3594('0x32'),_0x3594('0x40'),_0x3145dd,_0x3594('0x33'),'updatedAt'],squel[_0x3594('0x10')]()['fields'](_0x44d146)[_0x3594('0x12')](_0x3da1e6)[_0x3594('0x13')]('cm_contacts',null,_0x3594('0x37')+_0x3da1e6+_0x3594('0x38'))['join'](_0x36c81f,null,_0x36c81f+_0x3594('0x14')+_0x3da1e6+'.'+_0x3145dd)[_0x3594('0x16')](_0x3da1e6+'.CmListId\x20=\x20?',_0x4c6530)[_0x3594('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3594('0x16')](_0x3594('0x3a'),squel['select']()['field'](_0x3594('0x30'))['from']('cm_hopper_black')[_0x3594('0x16')]('ListId\x20=\x20?',_0x4c6530)['where'](_0x3145dd+_0x3594('0x15')+_0x3da1e6+'.'+_0x3145dd)))[_0x3594('0x3d')]();}function insertTzCmHopper(_0x165c62,_0x591722,_0x58535a,_0xaf7522,_0x8839ef,_0x3796fd){var _0x459ed7=['cm_contacts.phone',_0x3594('0x41')+_0x3796fd+_0x3594('0x42'),'cm_contacts.id','cm_contacts.ListId',_0x591722+'.'+_0xaf7522,'cm_contacts.createdAt',_0x3594('0x2b'),_0x3594('0x43'),_0x3594('0x44'),'\x22'+_0x8839ef+'\x22'];var _0x2a579a=squel[_0x3594('0x2c')]()[_0x3594('0x2d')]('cm_hopper')[_0x3594('0x2f')](['phone',_0x3594('0x31'),_0x3594('0x32'),'ListId',_0xaf7522,_0x3594('0x33'),_0x3594('0x34'),_0x3594('0x35'),_0x3594('0x36'),_0x3594('0x45')],squel[_0x3594('0x10')]()[_0x3594('0x46')](_0x459ed7)[_0x3594('0x12')](_0x591722)[_0x3594('0x13')](_0x3594('0x47'),null,'cm_contacts.ListId\x20=\x20'+_0x591722+_0x3594('0x38'))[_0x3594('0x13')](_0x58535a,null,_0x58535a+_0x3594('0x14')+_0x591722+'.'+_0xaf7522)['join'](_0x3796fd,null,_0x3796fd+_0x3594('0x14')+_0x591722+'.'+_0xaf7522)[_0x3594('0x16')](_0x591722+'.CmListId\x20=\x20?',_0x165c62)[_0x3594('0x16')](_0x3594('0x48'),NOW)[_0x3594('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x591722,_0x58535a,_0xaf7522,_0x3594('0x2e'),[_0x3594('0x3b'),_0x3594('0x3c')]))[_0x3594('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x591722,_0x58535a,_0xaf7522,_0x3594('0x2e'),[_0x3594('0x3b')])))['toString']();return _0x2a579a;}function insertTzCmHopperBlack(_0x1cd267,_0x1d6970,_0x896ab2,_0x491414){var _0x55de47=[_0x3594('0x27'),_0x3594('0x29'),_0x3594('0x2a'),_0x1d6970+'.'+_0x491414,_0x3594('0x3e'),'cm_contacts.updatedAt'];return squel['insert']()[_0x3594('0x2d')](_0x3594('0x3f'))[_0x3594('0x2f')]([_0x3594('0x30'),_0x3594('0x32'),'ListId',_0x491414,_0x3594('0x33'),_0x3594('0x34')],squel[_0x3594('0x10')]()[_0x3594('0x46')](_0x55de47)[_0x3594('0x12')](_0x1d6970)[_0x3594('0x13')](_0x3594('0x47'),null,_0x3594('0x37')+_0x1d6970+_0x3594('0x38'))['join'](_0x896ab2,null,_0x896ab2+_0x3594('0x14')+_0x1d6970+'.'+_0x491414)['where'](_0x1d6970+_0x3594('0x39'),_0x1cd267)['where'](_0x3594('0x48'),NOW)[_0x3594('0x16')](_0x3594('0x3a'),squel[_0x3594('0x10')]()[_0x3594('0x11')](_0x3594('0x30'))[_0x3594('0x12')](_0x3594('0x3f'))[_0x3594('0x16')](_0x3594('0x49'),_0x1cd267)[_0x3594('0x16')](_0x491414+'\x20=\x20'+_0x1d6970+'.'+_0x491414)))[_0x3594('0x3d')]();}function insertCmHopperAdditionalPhones(_0x27bc53){var _0x582664=[_0x3594('0x4a'),_0x3594('0x4b'),_0x3594('0x4c'),_0x3594('0x4d'),_0x3594('0x4e')];return squel[_0x3594('0x2c')]()[_0x3594('0x2d')](_0x3594('0x4f'))[_0x3594('0x2f')]([_0x3594('0x50'),_0x3594('0x30'),_0x3594('0x51'),'createdAt',_0x3594('0x34')],squel[_0x3594('0x10')]()[_0x3594('0x46')](_0x582664)[_0x3594('0x12')](_0x3594('0x2e'))['join'](_0x3594('0x47'),null,_0x3594('0x52'))[_0x3594('0x13')]('cm_contact_has_items',null,_0x3594('0x53'))[_0x3594('0x16')](_0x3594('0x54'),_0x27bc53)[_0x3594('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x3e719a,_0x882ec0,_0x108a49,_0x5b72d6){var _0x4db4eb=_[_0x3594('0x55')](_['keys'](_0x5b72d6),[_0x3594('0x40'),'CompanyId',_0x3594('0x33'),_0x3594('0x34'),_0x3594('0x56')]);return squel['insert']()[_0x3594('0x2d')](_0x3594('0x47'))[_0x3594('0x2f')](_0x4db4eb,squel[_0x3594('0x10')]()[_0x3594('0x46')](_0x4db4eb)['from'](_0x882ec0)[_0x3594('0x16')]('('+_0x108a49[_0x3594('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x3594('0x10')]()[_0x3594('0x46')](_0x108a49)['from'](_0x3594('0x47'))[_0x3594('0x16')]('ListId\x20=\x20?',_0x3e719a)[_0x3594('0x16')](_0x3594('0x57')))[_0x3594('0x16')]('id\x20IN\x20?',squel[_0x3594('0x10')]()[_0x3594('0x11')](_0x3594('0x58'),_0x3594('0x59'))[_0x3594('0x12')](_0x882ec0)[_0x3594('0x5a')](_0x108a49[_0x3594('0x13')](','))))[_0x3594('0x3d')]();}function handleStop(){logger['info'](_0x3594('0x5b'));stopped=!![];}function handleUncaughtException(_0x23bee2){logger[_0x3594('0x5c')](_0x23bee2[_0x3594('0x5d')]);process[_0x3594('0x5e')](0x1);}function handleError(_0x50585f,_0x1ac89c){stats[_0x3594('0x5f')][_0x3594('0x1c')]({'name':_0x1ac89c[_0x3594('0x60')],'message':_0x1ac89c[_0x3594('0x5d')],'row':_0x50585f});}function handleQuery(_0x3834ac){logger['info'](_0x3834ac);return db[_0x3594('0x61')][_0x3594('0x62')](_0x3834ac)['spread'](function(_0x2698ab){results['push'](_0x2698ab);})['catch'](function(_0x5f2e32){logger[_0x3594('0x5c')](_0x5f2e32[_0x3594('0x5d')]);});}function updateTzCampaigns(_0x57918a){return new Promise(function(_0x2c1e1a,_0x27dd8c){var _0xa53ad4=squel[_0x3594('0x10')]()[_0x3594('0x46')](['campaigns.id',_0x3594('0x63')])['from'](_0x3594('0x64'))[_0x3594('0x13')](_0x3594('0x65'),null,_0x3594('0x66'))[_0x3594('0x16')](_0x3594('0x67')+_0x57918a);db[_0x3594('0x61')][_0x3594('0x62')](_0xa53ad4[_0x3594('0x3d')]())['spread'](function(_0xb0d6c8){var _0x1e2053=[];for(var _0x4e0bf3=0x0;_0x4e0bf3<_0xb0d6c8['length'];_0x4e0bf3++){_0x1e2053[_0x3594('0x1c')](getTimezoneData(_0xb0d6c8[_0x4e0bf3],tmp_campaigns));}BPromise[_0x3594('0x1e')](_0x1e2053)[_0x3594('0x1a')](function(){_0x2c1e1a({'val':0x1});});})[_0x3594('0x68')](function(_0x4d2e72){logger[_0x3594('0x5c')](_0x4d2e72[_0x3594('0x5d')]);_0x2c1e1a({'val':0x0});});});}function updateTzVoiceQueues(_0x3b9fd8){return new Promise(function(_0xe8ebcb,_0x3740ae){var _0x5c20c4=squel[_0x3594('0x10')]()[_0x3594('0x46')]([_0x3594('0x69'),_0x3594('0x6a')])[_0x3594('0x12')](_0x3594('0x6b'))[_0x3594('0x13')]('voice_queues_has_cm_lists',null,_0x3594('0x6c'))['where'](_0x3594('0x6d')+_0x3b9fd8);db[_0x3594('0x61')]['query'](_0x5c20c4[_0x3594('0x3d')]())[_0x3594('0x6e')](function(_0x136d7e){var _0x37d79e=[];for(var _0x28621b=0x0;_0x28621b<_0x136d7e[_0x3594('0x1b')];_0x28621b++){_0x37d79e[_0x3594('0x1c')](getTimezoneData(_0x136d7e[_0x28621b],tmp_voice_queues));}BPromise[_0x3594('0x1e')](_0x37d79e)['then'](function(){_0xe8ebcb({'val':0x1});});})['catch'](function(_0x1649d8){logger[_0x3594('0x5c')](_0x1649d8[_0x3594('0x5d')]);_0xe8ebcb({'val':0x0});});});}function getTimezoneData(_0x456038,_0x3e25d9){return new Promise(function(_0x1de917,_0xbe60c3){var _0xc36e10=shared[_0x3594('0x6f')];var _0x5a992f=_0xc36e10[_0x456038['dialTimezone']];if(_[_0x3594('0x1f')](_0x5a992f)){_0x1de917({'ret':0x1});}else{var _0x269400=_0x5a992f[_0x3594('0x70')];var _0x1a1cbc=squel[_0x3594('0x2c')]()[_0x3594('0x2d')](_0x3e25d9)[_0x3594('0x71')]('id',_0x456038['id'])[_0x3594('0x71')](_0x3594('0x72'),_0x269400)[_0x3594('0x71')](_0x3594('0x73'),_0x456038[_0x3594('0x73')])[_0x3594('0x3d')]();return db[_0x3594('0x61')]['query'](_0x1a1cbc)[_0x3594('0x6e')](function(_0x4d17a8){_0x1de917({'ret':0x1});})[_0x3594('0x68')](function(_0x4bd1b1){logger[_0x3594('0x5c')](_0x4bd1b1[_0x3594('0x5d')]);_0xbe60c3({'ret':0x1});});}});}function handleTZQuery(_0x65add1){logger[_0x3594('0x74')](_0x65add1);return db[_0x3594('0x61')]['query'](_0x65add1)[_0x3594('0x6e')](function(_0x3fb16b){})[_0x3594('0x68')](function(_0x28bd76){logger[_0x3594('0x5c')](_0x28bd76['message']);});}function main(_0x1e33e6,_0x59373d,_0x19f9ae,_0x33b6b4){logger[_0x3594('0x74')](_0x3594('0x75'),_0x1e33e6,JSON[_0x3594('0x76')](_0x59373d));process['send'](_0x3594('0x77'));var _0x2bd25b=_0x59373d[_0x3594('0x78')];var _0x2b9a57=_[_0x3594('0x79')](_0x2bd25b);var _0x602037=_0x59373d[_0x3594('0x7a')];var _0x367f8c=path[_0x3594('0x13')](config['root'],'server/files/tmp',_0x602037+_0x3594('0x7b'));hasTZ=_[_0x3594('0x7c')](_0x2bd25b)[_0x3594('0x7d')]('dialTimezone');var _0x649506=_['keys'](_0x2bd25b)[_0x3594('0x13')]();logger['info'](_0x3594('0x7e'),_0x649506);db['ContactItemType'][_0x3594('0x18')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x200112){for(var _0xc3e901=0x0;_0xc3e901<_0x200112[_0x3594('0x1b')];_0xc3e901++){if(_0x200112[_0xc3e901]['name']in _0x2bd25b){contactItemTypes[_0x3594('0x1c')](_0x200112[_0xc3e901]);delete _0x2b9a57[_0x200112[_0xc3e901][_0x3594('0x7f')]];hasAdditionalPhones=!![];}for(var _0x3e1234 in _0x2bd25b){if(_0x200112[_0xc3e901]['name']+_0x3594('0x80')===_0x3e1234){phoneDescriptions['push']({'itemTypeId':_0x200112[_0xc3e901]['id'],'description':_0x3e1234});delete _0x2b9a57[_0x3e1234];}}}if(hasAdditionalPhones)_0x2b9a57[_0x3594('0x19')]='';var _0x59bbae=_['keys'](_0x2b9a57)['join']();logger['info'](_0x3594('0x7e'),_0x59bbae);fs[_0x3594('0x81')](_0x367f8c,_0x59bbae+'\x0a');Papa['parse'](fs['createReadStream'](_0x1e33e6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x7fa633,_0x235955){try{for(var _0x254ebd=0x0,_0x598cb3=[];_0x254ebd<_0x7fa633[_0x3594('0x82')][_0x3594('0x1b')];_0x254ebd++){stats[_0x3594('0x83')]+=0x1;if(_0x7fa633['errors'][_0x254ebd]){handleError(_0x7fa633['data'][_0x254ebd],_0x7fa633[_0x3594('0x5f')][_0x254ebd]);}else{var _0xe5f74=[];var _0x581b09=[];var _0x290e2c={};for(var _0x1d2735 in _0x2bd25b){let _0x3a2e9c=contactItemTypes['find'](_0x30d542=>_0x30d542[_0x3594('0x7f')]===_0x1d2735);let _0xb59a11=contactItemTypes[_0x3594('0x84')](_0x5e6f47=>_0x5e6f47[_0x3594('0x7f')]+_0x3594('0x80')===_0x1d2735);if(_[_0x3594('0x1f')](_0x3a2e9c)&&_[_0x3594('0x1f')](_0xb59a11)){if(_0x2bd25b[_0x3594('0x85')](_0x1d2735)){if(_0x7fa633['data'][_0x254ebd][_0x2bd25b[_0x1d2735]]){var _0x4acfb0=_[_0x3594('0x86')](_0x7fa633[_0x3594('0x82')][_0x254ebd][_0x2bd25b[_0x1d2735]][_0x3594('0x87')](/"/g,'\x27'));switch(_0x1d2735){case _0x3594('0x31'):var _0x2b48ea=moment(_0x4acfb0,_0x3594('0xe'),!![]);if(_0x2b48ea[_0x3594('0x88')]()){_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');}else{_0xe5f74[_0x3594('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0xff0f86=parseInt(_0x4acfb0);_0x4acfb0=_[_0x3594('0x89')](_0xff0f86)||_0xff0f86<0x0||_0xff0f86>0x4?_0x33b6b4?0x3:0x2:_0xff0f86;_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');break;case'UserId':var _0xe7bde2=parseInt(_0x4acfb0);if(_[_0x3594('0x8a')](_0xe7bde2)&&_[_0x3594('0x7d')](_0x19f9ae,_0xe7bde2)){_0x598cb3[_0x3594('0x1c')]('\x22'+_0xe7bde2+'\x22');}else{_0xe5f74['push']('agent\x20not\x20exists');}break;case _0x3594('0x8b'):if(isEmail(_0x4acfb0)){_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');}else{_0xe5f74[_0x3594('0x1c')](_0x3594('0x8c'));}break;case _0x3594('0x8d'):var _0x7054a3=moment(_0x4acfb0,_0x3594('0x8e'),!![]);if(_0x7054a3[_0x3594('0x88')]()){_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');}else{_0xe5f74[_0x3594('0x1c')](_0x3594('0x8f'));}break;case _0x3594('0x73'):var _0x25a639=shared[_0x3594('0x6f')];var _0x534dbb=_0x25a639[_0x4acfb0];if(!_['isNil'](_0x534dbb)){var _0x21e033=_0x534dbb[_0x3594('0x70')];_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');_0x598cb3[_0x3594('0x1c')]('\x22'+_0x21e033+'\x22');}break;default:_0x598cb3[_0x3594('0x1c')]('\x22'+_0x4acfb0+'\x22');}}else{switch(_0x1d2735){case _0x3594('0x90'):case'phone':_0xe5f74[_0x3594('0x1c')](_0x1d2735+_0x3594('0x91'));break;default:_0x598cb3['push']('\x22\x22');}}}}else{var _0x4896ab='';if(!_[_0x3594('0x1f')](_0x3a2e9c)){if(!_0x290e2c['hasOwnProperty'](_0x3a2e9c['id'])){if(!_[_0x3594('0x1f')](_0x7fa633[_0x3594('0x82')][_0x254ebd][_0x2bd25b[_0x1d2735]])){var _0x4acfb0=_[_0x3594('0x86')](_0x7fa633['data'][_0x254ebd][_0x2bd25b[_0x1d2735]]['replace'](/"/g,'\x27'));var _0x549dbf=phoneDescriptions[_0x3594('0x84')](_0x3671e1=>_0x3671e1[_0x3594('0x92')]===_0x3a2e9c['id']);if(!_[_0x3594('0x1f')](_0x549dbf)){var _0x154fd2=_[_0x3594('0x86')](_0x7fa633[_0x3594('0x82')][_0x254ebd][_0x2bd25b[_0x549dbf[_0x3594('0x93')]]][_0x3594('0x87')](/"/g,'\x27'));if(!_[_0x3594('0x1f')](_0x154fd2))_0x4acfb0=_0x4acfb0+'§'+_0x154fd2;}if(_0x4896ab=='')_0x4896ab=_0x4acfb0;else _0x4896ab+='|'+_0x4acfb0;}_0x581b09['push'](_0x3a2e9c['id']+':'+_0x4896ab);_0x290e2c[_0x3a2e9c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x598cb3[_0x3594('0x1c')]('\x22'+_0x581b09[_0x3594('0x13')](';')+'\x22');}if(_0xe5f74[_0x3594('0x1b')]){handleError(_0x7fa633[_0x3594('0x82')][_0x254ebd],{'code':_0x3594('0x94'),'message':_0xe5f74[_0x3594('0x13')]()});}else{fs[_0x3594('0x95')](_0x367f8c,_0x598cb3[_0x3594('0x13')]()+'\x0a');}_0x598cb3=[];}if(!(stats[_0x3594('0x83')]%0xc8)){socket[_0x3594('0x96')]('contact:import:'+_0x602037,stats);stats[_0x3594('0x5f')]=[];}}if(stopped){logger['info'](_0x3594('0x97'));_0x235955[_0x3594('0x98')]();}}catch(_0x59654c){handleError(_0x7fa633[_0x3594('0x82')][_0x254ebd],{'code':_0x3594('0x99'),'message':_0x59654c['message']});logger['error'](_0x3594('0x9a'),_0x59654c[_0x3594('0x5d')]);}},'complete':function(){try{var _0x1b7eac=[];var _0x4036b3=[];var _0xc6256b='cm_contacts';if(_0x59373d[_0x3594('0x9b')]&&_0x59373d[_0x3594('0x9b')][_0x3594('0x1b')]){_0xc6256b=_0x3594('0x9c')+_0x602037;_0x1b7eac['push'](_0x3594('0x9d')+_0xc6256b+_0x3594('0x9e'));}tmp_campaigns=_0x3594('0x9f')+_0x602037;tmp_voice_queues='voice_queues_'+_0x602037;_0x4036b3['push'](_0x3594('0x9d')+tmp_campaigns+_0x3594('0xa0'));_0x4036b3[_0x3594('0x1c')](_0x3594('0x9d')+tmp_voice_queues+_0x3594('0xa0'));BPromise[_0x3594('0xa1')](_0x4036b3,handleTZQuery)['then'](function(_0x3f17a8){updateTzCampaigns(_0x59373d[_0x3594('0x40')])['then'](function(_0x4d8041){updateTzVoiceQueues(_0x59373d['ListId'])[_0x3594('0x1a')](function(_0x583770){if(hasTZ)_0x59bbae=_0x59bbae['replace']('dialTimezone',_0x3594('0xa2'));var _0x2468da=util['format'](_0x3594('0xa3'),_0x367f8c,_0xc6256b,_0x59bbae,_0x59373d[_0x3594('0x40')],_0x59373d[_0x3594('0xa4')]||null,NOW,NOW);if(_[_0x3594('0x1f')](_0x2bd25b[_0x3594('0x31')])){_0x2468da+=_0x3594('0xa5');}_0x1b7eac[_0x3594('0x1c')](_0x2468da);if(_0x59373d[_0x3594('0x9b')]&&_0x59373d[_0x3594('0x9b')][_0x3594('0x1b')]){_0x1b7eac['push'](insertCmContact(_0x59373d[_0x3594('0x40')],_0xc6256b,_0x59373d[_0x3594('0x9b')],_0x2bd25b));_0x1b7eac['push'](_0x3594('0xa6')+_0xc6256b+';');}BPromise[_0x3594('0xa1')](_0x1b7eac,handleQuery)[_0x3594('0x1a')](function(_0xb1cce9){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x1b7eac=[];for(var _0x1ec002=0x0;_0x1ec002\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','all','split','push','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','from','.CmListId\x20=\x20?','recallme','cm_hopper_black','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','errors','code','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','catch','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','isNil','set'];(function(_0x3cb004,_0x25d5d1){var _0x343ec2=function(_0xb9ac0e){while(--_0xb9ac0e){_0x3cb004['push'](_0x3cb004['shift']());}};_0x343ec2(++_0x25d5d1);}(_0x1c09,0x101));var _0x91c0=function(_0x1e0146,_0xe7f3e9){_0x1e0146=_0x1e0146-0x0;var _0x38338d=_0x1c09[_0x1e0146];return _0x38338d;};'use strict';var fs=require('fs');var path=require(_0x91c0('0x0'));var _=require('lodash');var Papa=require(_0x91c0('0x1'));var util=require(_0x91c0('0x2'));var BPromise=require(_0x91c0('0x3'));var moment=require(_0x91c0('0x4'));var squel=require(_0x91c0('0x5'));var Redis=require(_0x91c0('0x6'));var db=require(_0x91c0('0x7'))['db'];var config=require(_0x91c0('0x8'));var shared=require(_0x91c0('0x9'));var logger=require('../../../config/logger')(_0x91c0('0xa'));config[_0x91c0('0xb')]=_[_0x91c0('0xc')](config['redis'],{'host':_0x91c0('0xd'),'port':0x18eb});var socket=require(_0x91c0('0xe'))(new Redis(config[_0x91c0('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x91c0('0xf')](_0x91c0('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x58463d){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'](_0x58463d);}function selectNotIn(_0x147553,_0x285ee2,_0x156c6a,_0xb60f92,_0x11b9e3){return squel['select']()[_0x91c0('0x11')](_0x91c0('0x12'))['from'](_0xb60f92)[_0x91c0('0x13')](_0x285ee2,null,_0x285ee2+_0x91c0('0x14')+_0xb60f92+'.'+_0x156c6a)[_0x91c0('0x15')](_0xb60f92+'.'+_0x156c6a+_0x91c0('0x16')+_0x147553+'.'+_0x156c6a)[_0x91c0('0x15')](_0x285ee2+_0x91c0('0x17')+_0x11b9e3[_0x91c0('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x28cc4e,_0x3e0ccd){promisesAdditionalPhones=[];return db['CmContact'][_0x91c0('0x18')]({'raw':!![],'attributes':['id',_0x91c0('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x91c0('0x1a')](function(_0x178416){if(_0x178416!==null){var _0x385080=[];for(var _0x40fd17=0x0;_0x40fd17<_0x178416[_0x91c0('0x1b')];_0x40fd17++){var _0x559a89=_0x178416[_0x40fd17];_0x385080['push'](insertAdditionalPhones(_0x559a89));}}Promise[_0x91c0('0x1c')](_0x385080)[_0x91c0('0x1a')](function(){_0x28cc4e({'val':0x1});});});});}function insertAdditionalPhones(_0x2b98a2){return new Promise(function(_0x1df7e7,_0x5f590b){var _0x152138=_0x2b98a2[_0x91c0('0x19')];var _0x2c41a2=_0x152138[_0x91c0('0x1d')](';');var _0x1583a7=[];orderBy=0x0;for(var _0x25111c=0x0;_0x25111c<_0x2c41a2[_0x91c0('0x1b')];_0x25111c++){_0x1583a7[_0x91c0('0x1e')](splitAdditionalPhone(_0x2b98a2['id'],_0x2c41a2[_0x25111c]));}Promise[_0x91c0('0x1c')](_0x1583a7)[_0x91c0('0x1a')](function(){_0x1df7e7({'val':_0x2c41a2[_0x91c0('0x1b')]});});});}function splitAdditionalPhone(_0x44caa8,_0x578e3f){return new Promise(function(_0xd07f8d,_0x1ca4d0){var _0x597c79=_0x578e3f['split'](':');var _0x4c0a15=_0x597c79[0x0];var _0x4cc1f3=_0x597c79[0x1];if(!_['isNil'](_0x4cc1f3)){var _0x26173f=_0x4cc1f3[_0x91c0('0x1d')]('|');var _0x314a85=[];for(var _0x195b7a=0x0;_0x195b7a<_0x26173f[_0x91c0('0x1b')];_0x195b7a++){if(_0x26173f[_0x195b7a]!==''){var _0x4e3430=_[_0x91c0('0x1f')](promisesAdditionalPhones,{'contactId':_0x44caa8,'phone':_0x26173f[_0x195b7a]});if(_0x4e3430[_0x91c0('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x91c0('0x1e')]({'contactId':_0x44caa8,'contactTypeId':_0x4c0a15,'phone':_0x26173f[_0x195b7a],'orderBy':orderBy});}}}_0xd07f8d({'ok':0x1});}else _0xd07f8d({'res':0x0});});}function createAdditionalPhone(_0x2e770d,_0x2a2662,_0x4b1ef7,_0x140bbe){var _0x3c3ddb='';var _0x3b7337='';var _0x136ea1=_0x4b1ef7[_0x91c0('0x1d')]('§');_0x3c3ddb=_0x136ea1[0x0];if(_0x136ea1[_0x91c0('0x1b')]==0x2)_0x3b7337=_0x136ea1[0x1];return new Promise(function(_0x2f95f3,_0x2defcc){return db[_0x91c0('0x20')][_0x91c0('0x21')]({'where':{'CmContactId':_0x2e770d,'item':_0x3c3ddb}})[_0x91c0('0x1a')](function(_0x36fbce){if(_0x36fbce){return db[_0x91c0('0x20')][_0x91c0('0x22')]({'ItemTypeId':_0x2a2662,'description':_0x3b7337,'OrderBy':_0x140bbe},{'where':{'CmContactId':_0x2e770d,'item':_0x3c3ddb}})[_0x91c0('0x1a')](function(_0x147292){_0x2f95f3({'res':'updated'});});}else{return db[_0x91c0('0x20')][_0x91c0('0x23')]({'CmContactId':_0x2e770d,'item':_0x3c3ddb,'description':_0x3b7337,'ItemTypeId':_0x2a2662,'OrderBy':_0x140bbe,'ItemClass':_0x91c0('0x24')})[_0x91c0('0x1a')](function(_0x52bc2f){_0x2f95f3({'res':_0x91c0('0x25')});});}});});}function insertCmHopper(_0x2ee8a2,_0xb28636,_0x12318f,_0x3af055,_0x396357){var _0x58f00e=['cm_contacts.phone','cm_contacts.scheduledat',_0x91c0('0x26'),_0x91c0('0x27'),_0xb28636+'.'+_0x3af055,_0x91c0('0x28'),_0x91c0('0x29'),'cm_contacts.priority',_0x91c0('0x2a'),'\x22'+_0x396357+'\x22'];return squel[_0x91c0('0x2b')]()[_0x91c0('0x2c')](_0x91c0('0x2d'))[_0x91c0('0x2e')](['phone',_0x91c0('0x2f'),_0x91c0('0x30'),_0x91c0('0x31'),_0x3af055,_0x91c0('0x32'),_0x91c0('0x33'),_0x91c0('0x34'),_0x91c0('0x35'),'recallme'],squel[_0x91c0('0x36')]()[_0x91c0('0x37')](_0x58f00e)['from'](_0xb28636)[_0x91c0('0x13')](_0x91c0('0x38'),null,_0x91c0('0x39')+_0xb28636+_0x91c0('0x3a'))[_0x91c0('0x13')](_0x12318f,null,_0x12318f+'.id\x20=\x20'+_0xb28636+'.'+_0x3af055)['where'](_0xb28636+'.CmListId\x20=\x20?',_0x2ee8a2)[_0x91c0('0x15')](_0x91c0('0x3b'),NOW)[_0x91c0('0x15')](_0x91c0('0x3c'),selectNotIn(_0xb28636,_0x12318f,_0x3af055,_0x91c0('0x2d'),[_0x91c0('0x3d'),_0x91c0('0x3e')]))[_0x91c0('0x15')](_0x91c0('0x3c'),selectNotIn(_0xb28636,_0x12318f,_0x3af055,_0x91c0('0x2d'),[_0x91c0('0x3d')])))[_0x91c0('0x3f')]();}function insertCmHopperBlack(_0x2e24b6,_0x28b8d9,_0x1a903c,_0x2830c4){var _0x5081d8=[_0x91c0('0x40'),_0x91c0('0x26'),_0x91c0('0x27'),_0x28b8d9+'.'+_0x2830c4,_0x91c0('0x28'),_0x91c0('0x29')];return squel[_0x91c0('0x2b')]()[_0x91c0('0x2c')]('cm_hopper_black')[_0x91c0('0x2e')]([_0x91c0('0x12'),_0x91c0('0x30'),_0x91c0('0x31'),_0x2830c4,_0x91c0('0x32'),_0x91c0('0x33')],squel[_0x91c0('0x36')]()['fields'](_0x5081d8)[_0x91c0('0x41')](_0x28b8d9)[_0x91c0('0x13')](_0x91c0('0x38'),null,_0x91c0('0x39')+_0x28b8d9+'.CmListId')['join'](_0x1a903c,null,_0x1a903c+_0x91c0('0x14')+_0x28b8d9+'.'+_0x2830c4)[_0x91c0('0x15')](_0x28b8d9+_0x91c0('0x42'),_0x2e24b6)[_0x91c0('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x91c0('0x3c'),squel['select']()['field'](_0x91c0('0x12'))[_0x91c0('0x41')]('cm_hopper_black')[_0x91c0('0x15')]('ListId\x20=\x20?',_0x2e24b6)[_0x91c0('0x15')](_0x2830c4+_0x91c0('0x16')+_0x28b8d9+'.'+_0x2830c4)))['toString']();}function insertTzCmHopper(_0x258de0,_0x32ebe1,_0x50b6f2,_0x1bbeb9,_0x1d2c7d,_0x2e5b84){var _0x56118e=[_0x91c0('0x40'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2e5b84+'.offset-cm_contacts.utcOffset\x20minute)',_0x91c0('0x26'),_0x91c0('0x27'),_0x32ebe1+'.'+_0x1bbeb9,_0x91c0('0x28'),_0x91c0('0x29'),'cm_contacts.priority',_0x91c0('0x2a'),'\x22'+_0x1d2c7d+'\x22'];var _0x5ff5ad=squel['insert']()[_0x91c0('0x2c')](_0x91c0('0x2d'))[_0x91c0('0x2e')]([_0x91c0('0x12'),_0x91c0('0x2f'),_0x91c0('0x30'),'ListId',_0x1bbeb9,'createdAt',_0x91c0('0x33'),'priority',_0x91c0('0x35'),_0x91c0('0x43')],squel[_0x91c0('0x36')]()['fields'](_0x56118e)[_0x91c0('0x41')](_0x32ebe1)[_0x91c0('0x13')](_0x91c0('0x38'),null,_0x91c0('0x39')+_0x32ebe1+'.CmListId')[_0x91c0('0x13')](_0x50b6f2,null,_0x50b6f2+_0x91c0('0x14')+_0x32ebe1+'.'+_0x1bbeb9)[_0x91c0('0x13')](_0x2e5b84,null,_0x2e5b84+_0x91c0('0x14')+_0x32ebe1+'.'+_0x1bbeb9)[_0x91c0('0x15')](_0x32ebe1+_0x91c0('0x42'),_0x258de0)[_0x91c0('0x15')](_0x91c0('0x3b'),NOW)[_0x91c0('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x32ebe1,_0x50b6f2,_0x1bbeb9,_0x91c0('0x2d'),[_0x91c0('0x3d'),_0x91c0('0x3e')]))[_0x91c0('0x15')](_0x91c0('0x3c'),selectNotIn(_0x32ebe1,_0x50b6f2,_0x1bbeb9,_0x91c0('0x2d'),[_0x91c0('0x3d')])))[_0x91c0('0x3f')]();return _0x5ff5ad;}function insertTzCmHopperBlack(_0x26d641,_0x54f0c4,_0x21ab4d,_0x57582d){var _0x292408=['cm_contacts.phone','cm_contacts.id',_0x91c0('0x27'),_0x54f0c4+'.'+_0x57582d,_0x91c0('0x28'),_0x91c0('0x29')];return squel[_0x91c0('0x2b')]()[_0x91c0('0x2c')](_0x91c0('0x44'))[_0x91c0('0x2e')]([_0x91c0('0x12'),'ContactId',_0x91c0('0x31'),_0x57582d,_0x91c0('0x32'),'updatedAt'],squel['select']()['fields'](_0x292408)['from'](_0x54f0c4)[_0x91c0('0x13')](_0x91c0('0x38'),null,_0x91c0('0x39')+_0x54f0c4+'.CmListId')[_0x91c0('0x13')](_0x21ab4d,null,_0x21ab4d+'.id\x20=\x20'+_0x54f0c4+'.'+_0x57582d)[_0x91c0('0x15')](_0x54f0c4+_0x91c0('0x42'),_0x26d641)[_0x91c0('0x15')](_0x91c0('0x3b'),NOW)[_0x91c0('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x91c0('0x36')]()[_0x91c0('0x11')](_0x91c0('0x12'))[_0x91c0('0x41')](_0x91c0('0x44'))[_0x91c0('0x15')](_0x91c0('0x45'),_0x26d641)[_0x91c0('0x15')](_0x57582d+_0x91c0('0x16')+_0x54f0c4+'.'+_0x57582d)))[_0x91c0('0x3f')]();}function insertCmHopperAdditionalPhones(_0x3acb1f){var _0x501c9b=[_0x91c0('0x46'),_0x91c0('0x47'),_0x91c0('0x48'),_0x91c0('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0x91c0('0x2b')]()[_0x91c0('0x2c')](_0x91c0('0x4a'))[_0x91c0('0x2e')](['CmHopperId',_0x91c0('0x12'),_0x91c0('0x4b'),_0x91c0('0x32'),_0x91c0('0x33')],squel[_0x91c0('0x36')]()['fields'](_0x501c9b)['from'](_0x91c0('0x2d'))[_0x91c0('0x13')](_0x91c0('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x91c0('0x13')](_0x91c0('0x4c'),null,_0x91c0('0x4d'))[_0x91c0('0x15')]('cm_hopper.ListId\x20=\x20?',_0x3acb1f)[_0x91c0('0x15')](_0x91c0('0x3b'),NOW))['toString']();}function insertCmContact(_0x965145,_0x2151ff,_0x3d1576,_0x4b7656){var _0x29e532=_[_0x91c0('0x4e')](_[_0x91c0('0x4f')](_0x4b7656),['ListId',_0x91c0('0x50'),_0x91c0('0x32'),_0x91c0('0x33'),_0x91c0('0x51')]);return squel[_0x91c0('0x2b')]()['into']('cm_contacts')[_0x91c0('0x2e')](_0x29e532,squel['select']()[_0x91c0('0x37')](_0x29e532)[_0x91c0('0x41')](_0x2151ff)['where']('('+_0x3d1576['join'](',')+_0x91c0('0x52'),squel['select']()[_0x91c0('0x37')](_0x3d1576)[_0x91c0('0x41')](_0x91c0('0x38'))[_0x91c0('0x15')](_0x91c0('0x45'),_0x965145)[_0x91c0('0x15')]('deletedAt\x20IS\x20NULL'))[_0x91c0('0x15')]('id\x20IN\x20?',squel[_0x91c0('0x36')]()['field'](_0x91c0('0x53'),_0x91c0('0x54'))[_0x91c0('0x41')](_0x2151ff)[_0x91c0('0x55')](_0x3d1576['join'](','))))[_0x91c0('0x3f')]();}function handleStop(){logger[_0x91c0('0x56')](_0x91c0('0x57'));stopped=!![];}function handleUncaughtException(_0x40bcce){logger[_0x91c0('0x58')](_0x40bcce[_0x91c0('0x59')]);process['exit'](0x1);}function handleError(_0x3a89d1,_0x528ddb){stats[_0x91c0('0x5a')]['push']({'name':_0x528ddb[_0x91c0('0x5b')],'message':_0x528ddb[_0x91c0('0x59')],'row':_0x3a89d1});}function handleQuery(_0x564b64){logger['info'](_0x564b64);return db['sequelize'][_0x91c0('0x5c')](_0x564b64)[_0x91c0('0x5d')](function(_0x1cd0a2){results[_0x91c0('0x1e')](_0x1cd0a2);})['catch'](function(_0x5c1b47){logger[_0x91c0('0x58')](_0x5c1b47[_0x91c0('0x59')]);});}function updateTzCampaigns(_0x44d73f){return new Promise(function(_0x56a1b9,_0x2edfc5){var _0x33d0b1=squel['select']()[_0x91c0('0x37')]([_0x91c0('0x5e'),_0x91c0('0x5f')])[_0x91c0('0x41')](_0x91c0('0x60'))['join']('campaigns_has_cm_lists',null,_0x91c0('0x61'))[_0x91c0('0x15')](_0x91c0('0x62')+_0x44d73f);db[_0x91c0('0x63')][_0x91c0('0x5c')](_0x33d0b1[_0x91c0('0x3f')]())[_0x91c0('0x5d')](function(_0x519db2){var _0x10098f=[];for(var _0x5a484e=0x0;_0x5a484e<_0x519db2[_0x91c0('0x1b')];_0x5a484e++){_0x10098f[_0x91c0('0x1e')](getTimezoneData(_0x519db2[_0x5a484e],tmp_campaigns));}BPromise['all'](_0x10098f)['then'](function(){_0x56a1b9({'val':0x1});});})[_0x91c0('0x64')](function(_0x31c4b9){logger[_0x91c0('0x58')](_0x31c4b9[_0x91c0('0x59')]);_0x56a1b9({'val':0x0});});});}function updateTzVoiceQueues(_0x1cd130){return new Promise(function(_0x185b64,_0x7b44c0){var _0x63210b=squel[_0x91c0('0x36')]()[_0x91c0('0x37')](['voice_queues.id','voice_queues.dialTimezone'])[_0x91c0('0x41')](_0x91c0('0x65'))[_0x91c0('0x13')]('voice_queues_has_cm_lists',null,_0x91c0('0x66'))[_0x91c0('0x15')](_0x91c0('0x67')+_0x1cd130);db['sequelize'][_0x91c0('0x5c')](_0x63210b[_0x91c0('0x3f')]())['spread'](function(_0x22c9b1){var _0x536c84=[];for(var _0x32834c=0x0;_0x32834c<_0x22c9b1['length'];_0x32834c++){_0x536c84[_0x91c0('0x1e')](getTimezoneData(_0x22c9b1[_0x32834c],tmp_voice_queues));}BPromise['all'](_0x536c84)[_0x91c0('0x1a')](function(){_0x185b64({'val':0x1});});})['catch'](function(_0x2d5f56){logger[_0x91c0('0x58')](_0x2d5f56[_0x91c0('0x59')]);_0x185b64({'val':0x0});});});}function getTimezoneData(_0x38ce24,_0x12086d){return new Promise(function(_0x2a0790,_0x2013e0){var _0x216977=shared[_0x91c0('0x68')];var _0x11a73b=_0x216977[_0x38ce24['dialTimezone']];if(_[_0x91c0('0x69')](_0x11a73b)){_0x2a0790({'ret':0x1});}else{var _0x35bb75=_0x11a73b['utcOffset'];var _0x2c3819=squel['insert']()[_0x91c0('0x2c')](_0x12086d)[_0x91c0('0x6a')]('id',_0x38ce24['id'])[_0x91c0('0x6a')](_0x91c0('0x6b'),_0x35bb75)[_0x91c0('0x6a')]('dialTimezone',_0x38ce24[_0x91c0('0x6c')])[_0x91c0('0x3f')]();return db[_0x91c0('0x63')][_0x91c0('0x5c')](_0x2c3819)[_0x91c0('0x5d')](function(_0xfc6a9c){_0x2a0790({'ret':0x1});})['catch'](function(_0x5e23f1){logger[_0x91c0('0x58')](_0x5e23f1[_0x91c0('0x59')]);_0x2013e0({'ret':0x1});});}});}function handleTZQuery(_0xedb372){logger['info'](_0xedb372);return db['sequelize'][_0x91c0('0x5c')](_0xedb372)[_0x91c0('0x5d')](function(_0x308fc4){})['catch'](function(_0x3ff4b9){logger[_0x91c0('0x58')](_0x3ff4b9[_0x91c0('0x59')]);});}function main(_0x3fd747,_0x70635b,_0x226862,_0xc035fb){logger[_0x91c0('0x56')](_0x91c0('0x6d'),_0x3fd747,JSON['stringify'](_0x70635b));process[_0x91c0('0x6e')](_0x91c0('0x6f'));var _0x525f61=_0x70635b[_0x91c0('0x70')];var _0x4a5ae6=_[_0x91c0('0x71')](_0x525f61);var _0x230ce6=_0x70635b[_0x91c0('0x72')];var _0x4bc607=path[_0x91c0('0x13')](config['root'],_0x91c0('0x73'),_0x230ce6+'.csv');hasTZ=_[_0x91c0('0x4f')](_0x525f61)['includes']('dialTimezone');var _0x4eb992=_[_0x91c0('0x4f')](_0x525f61)[_0x91c0('0x13')]();logger[_0x91c0('0x56')]('header',_0x4eb992);db[_0x91c0('0x74')][_0x91c0('0x18')]({'raw':!![],'attributes':['id','name']})[_0x91c0('0x1a')](function(_0x71d9ed){for(var _0x1a226e=0x0;_0x1a226e<_0x71d9ed[_0x91c0('0x1b')];_0x1a226e++){if(_0x71d9ed[_0x1a226e][_0x91c0('0x75')]in _0x525f61){contactItemTypes[_0x91c0('0x1e')](_0x71d9ed[_0x1a226e]);delete _0x4a5ae6[_0x71d9ed[_0x1a226e][_0x91c0('0x75')]];hasAdditionalPhones=!![];}for(var _0x10cacb in _0x525f61){if(_0x71d9ed[_0x1a226e][_0x91c0('0x75')]+_0x91c0('0x76')===_0x10cacb){phoneDescriptions['push']({'itemTypeId':_0x71d9ed[_0x1a226e]['id'],'description':_0x10cacb});delete _0x4a5ae6[_0x10cacb];}}}if(hasAdditionalPhones)_0x4a5ae6[_0x91c0('0x19')]='';var _0x3a7c4b=_[_0x91c0('0x4f')](_0x4a5ae6)[_0x91c0('0x13')]();logger[_0x91c0('0x56')](_0x91c0('0x77'),_0x3a7c4b);fs[_0x91c0('0x78')](_0x4bc607,_0x3a7c4b+'\x0a');Papa[_0x91c0('0x79')](fs['createReadStream'](_0x3fd747),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4a08f3,_0x27317c){try{for(var _0xc11273=0x0,_0x837551=[];_0xc11273<_0x4a08f3[_0x91c0('0x7a')][_0x91c0('0x1b')];_0xc11273++){stats[_0x91c0('0x7b')]+=0x1;if(_0x4a08f3['errors'][_0xc11273]){handleError(_0x4a08f3[_0x91c0('0x7a')][_0xc11273],_0x4a08f3['errors'][_0xc11273]);}else{var _0x2e2b45=[];var _0x199aa1=[];var _0x347feb={};for(var _0x5b2f08 in _0x525f61){let _0x1f72f8=contactItemTypes[_0x91c0('0x7c')](_0x572d90=>_0x572d90[_0x91c0('0x75')]===_0x5b2f08);let _0x13e213=contactItemTypes[_0x91c0('0x7c')](_0xc7bf1f=>_0xc7bf1f[_0x91c0('0x75')]+_0x91c0('0x76')===_0x5b2f08);if(_[_0x91c0('0x69')](_0x1f72f8)&&_[_0x91c0('0x69')](_0x13e213)){if(_0x525f61['hasOwnProperty'](_0x5b2f08)){if(_0x4a08f3[_0x91c0('0x7a')][_0xc11273][_0x525f61[_0x5b2f08]]){var _0x7aa7b3=_['trim'](_0x4a08f3[_0x91c0('0x7a')][_0xc11273][_0x525f61[_0x5b2f08]][_0x91c0('0x7d')](/"/g,'\x27'));switch(_0x5b2f08){case _0x91c0('0x2f'):var _0x5875c0=moment(_0x7aa7b3,_0x91c0('0x10'),!![]);if(_0x5875c0[_0x91c0('0x7e')]()){_0x837551[_0x91c0('0x1e')]('\x22'+_0x7aa7b3+'\x22');}else{_0x2e2b45[_0x91c0('0x1e')](_0x91c0('0x7f'));}break;case _0x91c0('0x34'):var _0xa8ddcf=parseInt(_0x7aa7b3);_0x7aa7b3=_[_0x91c0('0x80')](_0xa8ddcf)||_0xa8ddcf<0x0||_0xa8ddcf>0x4?_0xc035fb?0x3:0x2:_0xa8ddcf;_0x837551[_0x91c0('0x1e')]('\x22'+_0x7aa7b3+'\x22');break;case _0x91c0('0x35'):var _0x27b5f0=parseInt(_0x7aa7b3);if(_[_0x91c0('0x81')](_0x27b5f0)&&_[_0x91c0('0x82')](_0x226862,_0x27b5f0)){_0x837551[_0x91c0('0x1e')]('\x22'+_0x27b5f0+'\x22');}else{_0x2e2b45[_0x91c0('0x1e')](_0x91c0('0x83'));}break;case _0x91c0('0x84'):if(isEmail(_0x7aa7b3)){_0x837551[_0x91c0('0x1e')]('\x22'+_0x7aa7b3+'\x22');}else{_0x2e2b45[_0x91c0('0x1e')](_0x91c0('0x85'));}break;case _0x91c0('0x86'):var _0x12be6a=moment(_0x7aa7b3,_0x91c0('0x87'),!![]);if(_0x12be6a[_0x91c0('0x7e')]()){_0x837551['push']('\x22'+_0x7aa7b3+'\x22');}else{_0x2e2b45[_0x91c0('0x1e')](_0x91c0('0x88'));}break;case _0x91c0('0x6c'):var _0x4eb578=shared[_0x91c0('0x68')];var _0x21c2d1=_0x4eb578[_0x7aa7b3];if(!_[_0x91c0('0x69')](_0x21c2d1)){var _0x333ac5=_0x21c2d1[_0x91c0('0x89')];_0x837551[_0x91c0('0x1e')]('\x22'+_0x7aa7b3+'\x22');_0x837551['push']('\x22'+_0x333ac5+'\x22');}break;default:_0x837551[_0x91c0('0x1e')]('\x22'+_0x7aa7b3+'\x22');}}else{switch(_0x5b2f08){case'firstName':case _0x91c0('0x12'):_0x2e2b45[_0x91c0('0x1e')](_0x5b2f08+_0x91c0('0x8a'));break;default:_0x837551[_0x91c0('0x1e')]('\x22\x22');}}}}else{var _0x114f66='';if(!_[_0x91c0('0x69')](_0x1f72f8)){if(!_0x347feb['hasOwnProperty'](_0x1f72f8['id'])){if(!_['isNil'](_0x4a08f3[_0x91c0('0x7a')][_0xc11273][_0x525f61[_0x5b2f08]])){var _0x7aa7b3=_[_0x91c0('0x8b')](_0x4a08f3[_0x91c0('0x7a')][_0xc11273][_0x525f61[_0x5b2f08]][_0x91c0('0x7d')](/"/g,'\x27'));var _0x4d965c=phoneDescriptions[_0x91c0('0x7c')](_0x508378=>_0x508378[_0x91c0('0x8c')]===_0x1f72f8['id']);if(!_[_0x91c0('0x69')](_0x4d965c)){var _0x5d7582=_['trim'](_0x4a08f3[_0x91c0('0x7a')][_0xc11273][_0x525f61[_0x4d965c['description']]][_0x91c0('0x7d')](/"/g,'\x27'));if(!_[_0x91c0('0x69')](_0x5d7582))_0x7aa7b3=_0x7aa7b3+'§'+_0x5d7582;}if(_0x114f66=='')_0x114f66=_0x7aa7b3;else _0x114f66+='|'+_0x7aa7b3;}_0x199aa1[_0x91c0('0x1e')](_0x1f72f8['id']+':'+_0x114f66);_0x347feb[_0x1f72f8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x837551[_0x91c0('0x1e')]('\x22'+_0x199aa1[_0x91c0('0x13')](';')+'\x22');}if(_0x2e2b45[_0x91c0('0x1b')]){handleError(_0x4a08f3['data'][_0xc11273],{'code':_0x91c0('0x8d'),'message':_0x2e2b45[_0x91c0('0x13')]()});}else{fs['appendFileSync'](_0x4bc607,_0x837551[_0x91c0('0x13')]()+'\x0a');}_0x837551=[];}if(!(stats[_0x91c0('0x7b')]%0xc8)){socket[_0x91c0('0x8e')](_0x91c0('0x8f')+_0x230ce6,stats);stats[_0x91c0('0x5a')]=[];}}if(stopped){logger[_0x91c0('0x56')]('Abort\x20parser');_0x27317c['abort']();}}catch(_0xa1dfca){handleError(_0x4a08f3[_0x91c0('0x7a')][_0xc11273],{'code':_0x91c0('0x90'),'message':_0xa1dfca[_0x91c0('0x59')]});logger['error'](_0x91c0('0x91'),_0xa1dfca[_0x91c0('0x59')]);}},'complete':function(){try{var _0xde31e0=[];var _0x20591c=[];var _0x3bea54=_0x91c0('0x38');if(_0x70635b['duplicates']&&_0x70635b[_0x91c0('0x92')][_0x91c0('0x1b')]){_0x3bea54='cm_contacts_'+_0x230ce6;_0xde31e0[_0x91c0('0x1e')](_0x91c0('0x93')+_0x3bea54+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x91c0('0x94')+_0x230ce6;tmp_voice_queues=_0x91c0('0x95')+_0x230ce6;_0x20591c[_0x91c0('0x1e')](_0x91c0('0x93')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x20591c['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x91c0('0x96'));BPromise[_0x91c0('0x97')](_0x20591c,handleTZQuery)[_0x91c0('0x1a')](function(_0x2c001d){updateTzCampaigns(_0x70635b[_0x91c0('0x31')])[_0x91c0('0x1a')](function(_0x1b5933){updateTzVoiceQueues(_0x70635b['ListId'])[_0x91c0('0x1a')](function(_0x4573f9){if(hasTZ)_0x3a7c4b=_0x3a7c4b[_0x91c0('0x7d')](_0x91c0('0x6c'),'dialTimezone,utcOffset');var _0x127b29=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',_0x4bc607,_0x3bea54,_0x3a7c4b,_0x70635b[_0x91c0('0x31')],_0x70635b[_0x91c0('0x50')]||null,NOW,NOW);if(_[_0x91c0('0x69')](_0x525f61[_0x91c0('0x2f')])){_0x127b29+=_0x91c0('0x98');}_0xde31e0[_0x91c0('0x1e')](_0x127b29);if(_0x70635b[_0x91c0('0x92')]&&_0x70635b[_0x91c0('0x92')][_0x91c0('0x1b')]){_0xde31e0[_0x91c0('0x1e')](insertCmContact(_0x70635b[_0x91c0('0x31')],_0x3bea54,_0x70635b[_0x91c0('0x92')],_0x525f61));_0xde31e0[_0x91c0('0x1e')](_0x91c0('0x99')+_0x3bea54+';');}BPromise[_0x91c0('0x97')](_0xde31e0,handleQuery)[_0x91c0('0x1a')](function(_0x2b46eb){BPromise[_0x91c0('0x1c')]([handleAdditionalPhones()])[_0x91c0('0x1a')](function(){_0xde31e0=[];for(var _0x365a6c=0x0;_0x365a6c_0x522058[_0x9fd4('0x6a')]===_0x2f5a46);let _0x188886=contactItemTypes[_0x9fd4('0x6e')](_0x322dbe=>_0x322dbe[_0x9fd4('0x6a')]+_0x9fd4('0x6b')===_0x2f5a46);if(_[_0x9fd4('0x19')](_0x1f449e)&&_[_0x9fd4('0x19')](_0x188886)){if(_0x332539[_0x9fd4('0x6f')](_0x2f5a46)){if(_0x33ed18[_0x9fd4('0x70')][_0x7e516f][_0x332539[_0x2f5a46]]){var _0x479b94=_[_0x9fd4('0x71')](_0x33ed18[_0x9fd4('0x70')][_0x7e516f][_0x332539[_0x2f5a46]][_0x9fd4('0x72')](/"/g,'\x27'));switch(_0x2f5a46){case _0x9fd4('0x36'):var _0x1dd12c=moment(_0x479b94,_0x9fd4('0xb'),!![]);if(_0x1dd12c[_0x9fd4('0x73')]()){_0xdf60ce['push']('\x22'+_0x479b94+'\x22');}else{_0x229814[_0x9fd4('0x1a')](_0x9fd4('0x74'));}break;case'priority':var _0x39758f=parseInt(_0x479b94);_0x479b94=_[_0x9fd4('0x75')](_0x39758f)||_0x39758f<0x0||_0x39758f>0x4?_0x516625?0x3:0x2:_0x39758f;_0xdf60ce[_0x9fd4('0x1a')]('\x22'+_0x479b94+'\x22');break;case _0x9fd4('0x3c'):var _0x436d93=parseInt(_0x479b94);if(_[_0x9fd4('0x76')](_0x436d93)&&_[_0x9fd4('0x77')](_0xfc1e16,_0x436d93)){_0xdf60ce[_0x9fd4('0x1a')]('\x22'+_0x436d93+'\x22');}else{_0x229814[_0x9fd4('0x1a')](_0x9fd4('0x78'));}break;case _0x9fd4('0x79'):if(isEmail(_0x479b94)){_0xdf60ce[_0x9fd4('0x1a')]('\x22'+_0x479b94+'\x22');}else{_0x229814[_0x9fd4('0x1a')]('email\x20wrong\x20format');}break;case _0x9fd4('0x7a'):var _0x2ab43a=moment(_0x479b94,_0x9fd4('0x7b'),!![]);if(_0x2ab43a[_0x9fd4('0x73')]()){_0xdf60ce['push']('\x22'+_0x479b94+'\x22');}else{_0x229814[_0x9fd4('0x1a')](_0x9fd4('0x7c'));}break;default:_0xdf60ce[_0x9fd4('0x1a')]('\x22'+_0x479b94+'\x22');}}else{switch(_0x2f5a46){case _0x9fd4('0x7d'):case _0x9fd4('0xe'):_0x229814[_0x9fd4('0x1a')](_0x2f5a46+_0x9fd4('0x7e'));break;default:_0xdf60ce[_0x9fd4('0x1a')]('\x22\x22');}}}}else{var _0x3cca7b='';if(!_['isNil'](_0x1f449e)){if(!_0x508dba[_0x9fd4('0x6f')](_0x1f449e['id'])){for(var _0xa38b27=0x0;_0xa38b27<_0x332539[_0x2f5a46][_0x9fd4('0x21')];_0xa38b27++){var _0x479b94=_[_0x9fd4('0x71')](_0x33ed18[_0x9fd4('0x70')][_0x7e516f][_0x332539[_0x2f5a46][_0xa38b27]][_0x9fd4('0x72')](/"/g,'\x27'));var _0x41c42d=phoneDescriptions[_0x9fd4('0x6e')](_0x37eef4=>_0x37eef4[_0x9fd4('0x7f')]===_0x1f449e['id']);if(!_[_0x9fd4('0x19')](_0x41c42d)){var _0x477567=_['trim'](_0x33ed18['data'][_0x7e516f][_0x332539[_0x41c42d[_0x9fd4('0x80')]][0x0]][_0x9fd4('0x72')](/"/g,'\x27'));if(!_[_0x9fd4('0x19')](_0x477567))_0x479b94=_0x479b94+'§'+_0x477567;}if(_0x3cca7b=='')_0x3cca7b=_0x479b94;else _0x3cca7b+='|'+_0x479b94;}_0x4a7c31[_0x9fd4('0x1a')](_0x1f449e['id']+':'+_0x3cca7b);_0x508dba[_0x1f449e['id']]=0x1;}}}}if(hasAdditionalPhones){_0xdf60ce[_0x9fd4('0x1a')]('\x22'+_0x4a7c31[_0x9fd4('0x10')](';')+'\x22');}if(_0x229814[_0x9fd4('0x21')]){handleError(_0x33ed18[_0x9fd4('0x70')][_0x7e516f],{'code':'SystemRow','message':_0x229814[_0x9fd4('0x10')]()});}else{fs[_0x9fd4('0x81')](_0x2571e1,_0xdf60ce[_0x9fd4('0x10')]()+'\x0a');}_0xdf60ce=[];}if(!(stats[_0x9fd4('0x6d')]%0xc8)){socket[_0x9fd4('0x82')](_0x9fd4('0x83')+_0xb7691e,stats);stats[_0x9fd4('0x5e')]=[];}}if(stopped){logger[_0x9fd4('0x5b')](_0x9fd4('0x84'));_0x110cde[_0x9fd4('0x85')]();}}catch(_0x5de9fa){handleError(_0x33ed18[_0x9fd4('0x70')][_0x7e516f],{'code':_0x9fd4('0x86'),'message':_0x5de9fa[_0x9fd4('0x5d')]});logger[_0x9fd4('0x1e')](_0x9fd4('0x87'),_0x5de9fa['message']);}},'complete':function(){try{var _0x49dbd2=[];var _0x135791=tempTableName;_0x49dbd2[_0x9fd4('0x1a')](_0x9fd4('0x88')+_0x135791+_0x9fd4('0x89'));logger['info'](_0x9fd4('0x8a'),contactItemTypes[_0x9fd4('0x21')]);var _0x27998d=util[_0x9fd4('0xa')](_0x9fd4('0x8b'),_0x2571e1,_0x135791,_0x348285,_0x5abeca[_0x9fd4('0x38')],_0x5abeca[_0x9fd4('0x56')]||null,NOW,NOW);if(_['isNil'](_0x332539[_0x9fd4('0x36')])){_0x27998d+=',\x20scheduledAt\x20=\x20NOW()';}_0x49dbd2[_0x9fd4('0x1a')](_0x27998d);BPromise[_0x9fd4('0x8c')](_0x49dbd2,handleQuery)[_0x9fd4('0x1c')](function(_0x446271){BPromise[_0x9fd4('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x49dbd2=[];for(var _0x56685c=0x0;_0x56685c\x20\x20');}var _0x522891=path[_0x9fd4('0x10')](config[_0x9fd4('0x66')],_0x9fd4('0x96'),process[_0x9fd4('0x95')][0x2]);if(!fs[_0x9fd4('0x97')](_0x522891)){throw new Error(_0x9fd4('0x98'));}var _0x4eafff={};try{_0x4eafff=JSON[_0x9fd4('0x99')](process[_0x9fd4('0x95')][0x3]);if(!_0x4eafff[_0x9fd4('0x9a')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x56b641=0x0;if(_0x4eafff[_0x9fd4('0x9a')][_0x9fd4('0x3c')]){_0x56b641=0x1;}if(!_0x4eafff[_0x9fd4('0x38')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x39cd4d){throw new Error(_0x9fd4('0x9b'));}var _0x3d1da9=[];try{_0x3d1da9=_[_0x9fd4('0x9c')](JSON['parse'](process[_0x9fd4('0x95')][0x4]),'id');}catch(_0x40e0d9){logger[_0x9fd4('0x5b')](_0x9fd4('0x9d'));}main(_0x522891,_0x4eafff,_0x3d1da9,_0x56b641);}validate();process['on'](_0x9fd4('0x9e'),handleStop);process['on'](_0x9fd4('0x9f'),handleUncaughtException); \ No newline at end of file +var _0x6582=['cm_contacts.UserId','insert','into','cm_hopper','scheduledat','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','fromQuery','ContactId','createdAt','updatedAt','select','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','exit','errors','query','main','stringify','socket_timestamp','server/files/tmp','body','ContactItemType','findAll','name','_description','writeFileSync','createReadStream','data','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','description','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','affectedRows','contact:import:','unlink','catch','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','push','all','then','error','message','AdditionalPhones','split','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt'];(function(_0x4bdd56,_0x219c46){var _0x5c1151=function(_0x34a036){while(--_0x34a036){_0x4bdd56['push'](_0x4bdd56['shift']());}};_0x5c1151(++_0x219c46);}(_0x6582,0x108));var _0x2658=function(_0x4c858f,_0xcd21d1){_0x4c858f=_0x4c858f-0x0;var _0x322921=_0x6582[_0x4c858f];return _0x322921;};'use strict';var fs=require('fs');var path=require(_0x2658('0x0'));var _=require(_0x2658('0x1'));var Papa=require(_0x2658('0x2'));var util=require(_0x2658('0x3'));var BPromise=require(_0x2658('0x4'));var moment=require('moment');var squel=require(_0x2658('0x5'));var Redis=require(_0x2658('0x6'));var db=require(_0x2658('0x7'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0x2658('0x8')]=_[_0x2658('0x9')](config[_0x2658('0x8')],{'host':_0x2658('0xa'),'port':0x18eb});var socket=require(_0x2658('0xb'))(new Redis(config[_0x2658('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x2658('0xc'));var tempTableName=_0x2658('0xd')+moment()[_0x2658('0xe')](_0x2658('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x455ff9){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))*$/[_0x2658('0x10')](_0x455ff9);}function selectNotIn(_0x3f22a5,_0x1aaaac,_0x428f52,_0x56a3c6,_0x20fe6d){return squel['select']()[_0x2658('0x11')](_0x2658('0x12'))[_0x2658('0x13')](_0x56a3c6)[_0x2658('0x14')](_0x1aaaac,null,_0x1aaaac+_0x2658('0x15')+_0x56a3c6+'.'+_0x428f52)[_0x2658('0x16')](_0x56a3c6+'.'+_0x428f52+_0x2658('0x17')+_0x3f22a5+'.'+_0x428f52)['where'](_0x1aaaac+_0x2658('0x18')+_0x20fe6d[_0x2658('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2187bd,_0x44422a){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2658('0x19')]['query'](_0x2658('0x1a')+tempTableName)[_0x2658('0x1b')](function(_0x15bd54){if(_0x15bd54!==null){var _0x496524=[];for(var _0xc820a=0x0;_0xc820a<_0x15bd54[_0x2658('0x1c')];_0xc820a++){var _0x3ebf10=_0x15bd54[_0xc820a];if(!_[_0x2658('0x1d')](_0x3ebf10['phone'])){if(!_[_0x2658('0x1d')](_0x3ebf10['AdditionalPhones']))_0x496524[_0x2658('0x1e')](insertAdditionalPhones(_0x3ebf10));promisesContact[_0x2658('0x1e')]({'contact':_0x3ebf10});}}}Promise[_0x2658('0x1f')](_0x496524)[_0x2658('0x20')](function(){_0x2187bd({'val':0x1});});})['catch'](function(_0x13b1d1){logger[_0x2658('0x21')](_0x13b1d1[_0x2658('0x22')]);});});}function insertAdditionalPhones(_0xb0dab8){return new Promise(function(_0x23cf70,_0x386294){var _0x587754=_0xb0dab8[_0x2658('0x23')];if(_['isNil'](_0x587754))_0x386294({'val':0x0});else{var _0x59c9e4=_0x587754[_0x2658('0x24')](';');var _0x132000=[];orderBy=0x0;for(var _0x499ca6=0x0;_0x499ca6<_0x59c9e4[_0x2658('0x1c')];_0x499ca6++){_0x132000['push'](splitAdditionalPhone(_0xb0dab8['id'],_0x59c9e4[_0x499ca6]));}Promise[_0x2658('0x1f')](_0x132000)[_0x2658('0x20')](function(){_0x23cf70({'val':_0x59c9e4[_0x2658('0x1c')]});});}});}function splitAdditionalPhone(_0x2e6d6a,_0x31231c){return new Promise(function(_0x2e80fc,_0xe9f81){var _0xaeaa95=_0x31231c[_0x2658('0x24')](':');var _0x43b6c0=_0xaeaa95[0x0];var _0x566cec=_0xaeaa95[0x1];if(_0x566cec!==''){var _0x2062ef=_0x566cec[_0x2658('0x24')]('|');var _0x338f06=[];for(var _0x3d251e=0x0;_0x3d251e<_0x2062ef[_0x2658('0x1c')];_0x3d251e++){if(_0x2062ef[_0x3d251e]!==''){var _0x3a4b45=_['filter'](promisesAdditionalPhones,{'contactId':_0x2e6d6a,'phone':_0x2062ef[_0x3d251e]});if(_0x3a4b45[_0x2658('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x2658('0x1e')]({'contactId':_0x2e6d6a,'contactTypeId':_0x43b6c0,'phone':_0x2062ef[_0x3d251e],'orderBy':orderBy});}}}_0x2e80fc({'ok':0x1});}else _0x2e80fc({'res':0x0});});}function createAdditionalPhone(_0x2a3141,_0x255759,_0x27e0f5,_0x1492cb){var _0x256172='';var _0xb8d245='';var _0xd891fe=_0x27e0f5[_0x2658('0x24')]('§');_0x256172=_0xd891fe[0x0];if(_0xd891fe[_0x2658('0x1c')]==0x2)_0xb8d245=_0xd891fe[0x1];return new Promise(function(_0x1433b0,_0x291bb4){return db[_0x2658('0x25')][_0x2658('0x26')]({'where':{'CmContactId':_0x2a3141,'item':_0x256172}})[_0x2658('0x20')](function(_0x89f2e2){if(_0x89f2e2){return db[_0x2658('0x25')]['update']({'ItemTypeId':_0x255759,'description':_0xb8d245,'OrderBy':_0x1492cb},{'where':{'CmContactId':_0x2a3141,'item':_0x256172}})[_0x2658('0x20')](function(_0x556dca){_0x1433b0({'res':_0x2658('0x27')});});}else{return db['CmContactHasItem'][_0x2658('0x28')]({'CmContactId':_0x2a3141,'item':_0x256172,'ItemTypeId':_0x255759,'description':_0xb8d245,'OrderBy':_0x1492cb,'ItemClass':_0x2658('0x29')})[_0x2658('0x20')](function(_0x5e9e6f){_0x1433b0({'res':_0x2658('0x2a')});});}});});}function updateContact(_0x3e6f3d){return new Promise(function(_0x324403,_0x455e1b){var _0x28b0bf=_0x3e6f3d['id'];delete _0x3e6f3d['id'];return db[_0x2658('0x2b')][_0x2658('0x2c')](_0x3e6f3d,{'where':{'id':_0x28b0bf}})[_0x2658('0x20')](function(_0xfc7d10){updatedRows+=0x1;return db['CmHopper'][_0x2658('0x2c')]({'phone':_0x3e6f3d[_0x2658('0x12')]},{'where':{'ContactId':_0x28b0bf}})[_0x2658('0x20')](function(_0x4e7578){_0x324403({'ret':'OK'});});});});}function insertCmHopper(_0x5d94b6,_0x5c0f51,_0x15e7ec,_0x202d6e,_0x8d636b){var _0x20fa0a=[_0x2658('0x2d'),_0x2658('0x2e'),'cm_contacts.id',_0x2658('0x2f'),_0x5c0f51+'.'+_0x202d6e,_0x2658('0x30'),_0x2658('0x31'),'cm_contacts.priority',_0x2658('0x32'),'\x22'+_0x8d636b+'\x22'];return squel[_0x2658('0x33')]()[_0x2658('0x34')](_0x2658('0x35'))['fromQuery']([_0x2658('0x12'),_0x2658('0x36'),'ContactId','ListId',_0x202d6e,'createdAt','updatedAt',_0x2658('0x37'),_0x2658('0x38'),_0x2658('0x39')],squel['select']()[_0x2658('0x3a')](_0x20fa0a)['from'](_0x5c0f51)['join'](_0x2658('0x3b'),null,_0x2658('0x3c')+_0x5c0f51+_0x2658('0x3d'))['join'](_0x15e7ec,null,_0x15e7ec+'.id\x20=\x20'+_0x5c0f51+'.'+_0x202d6e)['where'](_0x5c0f51+'.CmListId\x20=\x20?',_0x5d94b6)[_0x2658('0x16')](_0x2658('0x3e'),NOW)[_0x2658('0x16')](_0x2658('0x3f'),selectNotIn(_0x5c0f51,_0x15e7ec,_0x202d6e,'cm_hopper',[_0x2658('0x40'),_0x2658('0x41')]))[_0x2658('0x16')](_0x2658('0x3f'),selectNotIn(_0x5c0f51,_0x15e7ec,_0x202d6e,_0x2658('0x35'),['\x22always\x22'])))[_0x2658('0x42')]();}function insertCmHopperBlack(_0x3152c0,_0x3eec7f,_0x24e8dc,_0x120b41){var _0xd0bfb1=[_0x2658('0x2d'),_0x2658('0x43'),_0x2658('0x2f'),_0x3eec7f+'.'+_0x120b41,_0x2658('0x30'),_0x2658('0x31')];return squel[_0x2658('0x33')]()['into']('cm_hopper_black')[_0x2658('0x44')]([_0x2658('0x12'),_0x2658('0x45'),'ListId',_0x120b41,_0x2658('0x46'),_0x2658('0x47')],squel[_0x2658('0x48')]()[_0x2658('0x3a')](_0xd0bfb1)['from'](_0x3eec7f)[_0x2658('0x14')](_0x2658('0x3b'),null,_0x2658('0x3c')+_0x3eec7f+_0x2658('0x3d'))[_0x2658('0x14')](_0x24e8dc,null,_0x24e8dc+_0x2658('0x15')+_0x3eec7f+'.'+_0x120b41)['where'](_0x3eec7f+_0x2658('0x49'),_0x3152c0)['where'](_0x2658('0x3e'),NOW)[_0x2658('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2658('0x48')]()[_0x2658('0x11')]('phone')[_0x2658('0x13')](_0x2658('0x4a'))[_0x2658('0x16')](_0x2658('0x4b'),_0x3152c0)[_0x2658('0x16')](_0x120b41+'\x20=\x20?',_0x3eec7f+'.'+_0x120b41)))[_0x2658('0x42')]();}function insertCmHopperAdditionalPhones(_0x2a43f3){var _0x51e795=[_0x2658('0x4c'),_0x2658('0x4d'),_0x2658('0x4e'),_0x2658('0x4f'),'cm_contact_has_items.updatedAt'];return squel[_0x2658('0x33')]()[_0x2658('0x34')](_0x2658('0x50'))[_0x2658('0x44')]([_0x2658('0x51'),_0x2658('0x12'),_0x2658('0x52'),'createdAt',_0x2658('0x47')],squel['select']()[_0x2658('0x3a')](_0x51e795)['from'](_0x2658('0x35'))[_0x2658('0x14')](_0x2658('0x3b'),null,_0x2658('0x53'))[_0x2658('0x14')]('cm_contact_has_items',null,_0x2658('0x54'))[_0x2658('0x16')](_0x2658('0x55'),_0x2a43f3)['where'](_0x2658('0x3e'),NOW))[_0x2658('0x42')]();}function insertCmContact(_0x6cf818,_0x952c04,_0x519205,_0xacf7ae){var _0x4b85d5=_['concat'](_[_0x2658('0x56')](_0xacf7ae),[_0x2658('0x57'),_0x2658('0x58'),'createdAt',_0x2658('0x47')]);return squel[_0x2658('0x33')]()['into'](_0x2658('0x3b'))['fromQuery'](_0x4b85d5,squel['select']()[_0x2658('0x3a')](_0x4b85d5)[_0x2658('0x13')](_0x952c04)['where']('('+_0x519205[_0x2658('0x14')](',')+_0x2658('0x59'),squel[_0x2658('0x48')]()['fields'](_0x519205)['from'](_0x2658('0x3b'))['where']('ListId\x20=\x20?',_0x6cf818))[_0x2658('0x16')]('id\x20IN\x20?',squel[_0x2658('0x48')]()[_0x2658('0x11')](_0x2658('0x5a'),_0x2658('0x5b'))[_0x2658('0x13')](_0x952c04)[_0x2658('0x5c')](_0x519205[_0x2658('0x14')](','))))['toString']();}function handleStop(){logger[_0x2658('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3fad65){logger[_0x2658('0x21')](_0x3fad65[_0x2658('0x22')]);process[_0x2658('0x5e')](0x1);}function handleError(_0x4a9011,_0x5ee554){stats[_0x2658('0x5f')][_0x2658('0x1e')]({'name':_0x5ee554['code'],'message':_0x5ee554['message'],'row':_0x4a9011});}function handleQuery(_0x23c8e8){logger[_0x2658('0x5d')](_0x23c8e8);return db[_0x2658('0x19')][_0x2658('0x60')](_0x23c8e8)[_0x2658('0x1b')](function(_0x4f66b5){results[_0x2658('0x1e')](_0x4f66b5);})['catch'](function(_0x44abd2){logger[_0x2658('0x21')](_0x44abd2['message']);});}function main(_0x2ae859,_0x20a7bb,_0x55b1ec,_0x2405e3){logger[_0x2658('0x5d')](_0x2658('0x61'),_0x2ae859,JSON[_0x2658('0x62')](_0x20a7bb));process['send']('start');var _0x517b2e=_0x20a7bb['binding'];var _0x26edaa=_['clone'](_0x517b2e);var _0x1bf0cf=_0x20a7bb[_0x2658('0x63')];var _0x308db5=path[_0x2658('0x14')](config['root'],_0x2658('0x64'),_0x1bf0cf+'.csv');logger[_0x2658('0x5d')](_0x2658('0x65'),_0x20a7bb);db[_0x2658('0x66')][_0x2658('0x67')]({'raw':!![],'attributes':['id','name']})[_0x2658('0x20')](function(_0x4b1610){for(var _0x191889=0x0;_0x191889<_0x4b1610[_0x2658('0x1c')];_0x191889++){if(_0x4b1610[_0x191889][_0x2658('0x68')]in _0x517b2e){contactItemTypes[_0x2658('0x1e')](_0x4b1610[_0x191889]);delete _0x26edaa[_0x4b1610[_0x191889][_0x2658('0x68')]];hasAdditionalPhones=!![];}for(var _0x42a066 in _0x517b2e){if(_0x4b1610[_0x191889][_0x2658('0x68')]+_0x2658('0x69')===_0x42a066){phoneDescriptions['push']({'itemTypeId':_0x4b1610[_0x191889]['id'],'description':_0x42a066});delete _0x26edaa[_0x42a066];}}}if(hasAdditionalPhones)_0x26edaa[_0x2658('0x23')]='';var _0x1cc0ed=_[_0x2658('0x56')](_0x26edaa)['join']();logger[_0x2658('0x5d')]('header',_0x1cc0ed);fs[_0x2658('0x6a')](_0x308db5,_0x1cc0ed+'\x0a');Papa['parse'](fs[_0x2658('0x6b')](_0x2ae859),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf1665b,_0x3950e8){try{for(var _0x550509=0x0,_0x59d09c=[];_0x550509<_0xf1665b['data']['length'];_0x550509++){stats['rows']+=0x1;if(_0xf1665b[_0x2658('0x5f')][_0x550509]){handleError(_0xf1665b[_0x2658('0x6c')][_0x550509],_0xf1665b[_0x2658('0x5f')][_0x550509]);}else{var _0x107a9e=[];var _0x4e26f2=[];var _0x4267c1={};for(var _0x4383fa in _0x517b2e){let _0x50db6b=contactItemTypes[_0x2658('0x6d')](_0x57eeb7=>_0x57eeb7[_0x2658('0x68')]===_0x4383fa);let _0x3f62c9=contactItemTypes[_0x2658('0x6d')](_0x10848a=>_0x10848a[_0x2658('0x68')]+_0x2658('0x69')===_0x4383fa);if(_[_0x2658('0x1d')](_0x50db6b)&&_[_0x2658('0x1d')](_0x3f62c9)){if(_0x517b2e[_0x2658('0x6e')](_0x4383fa)){if(_0xf1665b['data'][_0x550509][_0x517b2e[_0x4383fa]]){var _0x13e029=_[_0x2658('0x6f')](_0xf1665b[_0x2658('0x6c')][_0x550509][_0x517b2e[_0x4383fa]][_0x2658('0x70')](/"/g,'\x27'));switch(_0x4383fa){case'scheduledat':var _0x335650=moment(_0x13e029,_0x2658('0xc'),!![]);if(_0x335650[_0x2658('0x71')]()){_0x59d09c[_0x2658('0x1e')]('\x22'+_0x13e029+'\x22');}else{_0x107a9e[_0x2658('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2658('0x37'):var _0x405ff4=parseInt(_0x13e029);_0x13e029=_[_0x2658('0x72')](_0x405ff4)||_0x405ff4<0x0||_0x405ff4>0x4?_0x2405e3?0x3:0x2:_0x405ff4;_0x59d09c['push']('\x22'+_0x13e029+'\x22');break;case _0x2658('0x38'):var _0x2f5445=parseInt(_0x13e029);if(_[_0x2658('0x73')](_0x2f5445)&&_[_0x2658('0x74')](_0x55b1ec,_0x2f5445)){_0x59d09c['push']('\x22'+_0x2f5445+'\x22');}else{_0x107a9e['push']('agent\x20not\x20exists');}break;case _0x2658('0x75'):if(isEmail(_0x13e029)){_0x59d09c[_0x2658('0x1e')]('\x22'+_0x13e029+'\x22');}else{_0x107a9e[_0x2658('0x1e')](_0x2658('0x76'));}break;case _0x2658('0x77'):var _0x169817=moment(_0x13e029,_0x2658('0x78'),!![]);if(_0x169817['isValid']()){_0x59d09c['push']('\x22'+_0x13e029+'\x22');}else{_0x107a9e[_0x2658('0x1e')](_0x2658('0x79'));}break;default:_0x59d09c['push']('\x22'+_0x13e029+'\x22');}}else{switch(_0x4383fa){case'firstName':case _0x2658('0x12'):_0x107a9e[_0x2658('0x1e')](_0x4383fa+_0x2658('0x7a'));break;default:_0x59d09c[_0x2658('0x1e')]('\x22\x22');}}}}else{var _0x41b4ee='';if(!_[_0x2658('0x1d')](_0x50db6b)){if(!_0x4267c1[_0x2658('0x6e')](_0x50db6b['id'])){for(var _0x4c526c=0x0;_0x4c526c<_0x517b2e[_0x4383fa]['length'];_0x4c526c++){var _0x13e029=_['trim'](_0xf1665b[_0x2658('0x6c')][_0x550509][_0x517b2e[_0x4383fa][_0x4c526c]][_0x2658('0x70')](/"/g,'\x27'));var _0x152bd0=phoneDescriptions[_0x2658('0x6d')](_0x358ea1=>_0x358ea1['itemTypeId']===_0x50db6b['id']);if(!_[_0x2658('0x1d')](_0x152bd0)){var _0x4318b7=_[_0x2658('0x6f')](_0xf1665b[_0x2658('0x6c')][_0x550509][_0x517b2e[_0x152bd0[_0x2658('0x7b')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x2658('0x1d')](_0x4318b7))_0x13e029=_0x13e029+'§'+_0x4318b7;}if(_0x41b4ee=='')_0x41b4ee=_0x13e029;else _0x41b4ee+='|'+_0x13e029;}_0x4e26f2['push'](_0x50db6b['id']+':'+_0x41b4ee);_0x4267c1[_0x50db6b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x59d09c[_0x2658('0x1e')]('\x22'+_0x4e26f2[_0x2658('0x14')](';')+'\x22');}if(_0x107a9e['length']){handleError(_0xf1665b[_0x2658('0x6c')][_0x550509],{'code':'SystemRow','message':_0x107a9e[_0x2658('0x14')]()});}else{fs[_0x2658('0x7c')](_0x308db5,_0x59d09c[_0x2658('0x14')]()+'\x0a');}_0x59d09c=[];}if(!(stats['rows']%0xc8)){socket[_0x2658('0x7d')]('contact:import:'+_0x1bf0cf,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x2658('0x7e'));_0x3950e8[_0x2658('0x7f')]();}}catch(_0x2711cd){handleError(_0xf1665b[_0x2658('0x6c')][_0x550509],{'code':_0x2658('0x80'),'message':_0x2711cd['message']});logger[_0x2658('0x21')](_0x2658('0x81'),_0x2711cd[_0x2658('0x22')]);}},'complete':function(){try{var _0x15ba41=[];var _0x368696=tempTableName;_0x15ba41[_0x2658('0x1e')](_0x2658('0x82')+_0x368696+'\x20LIKE\x20cm_contacts;');logger['info'](_0x2658('0x83'),contactItemTypes[_0x2658('0x1c')]);var _0x2fa9ce=util['format'](_0x2658('0x84'),_0x308db5,_0x368696,_0x1cc0ed,_0x20a7bb[_0x2658('0x57')],_0x20a7bb[_0x2658('0x58')]||null,NOW,NOW);if(_[_0x2658('0x1d')](_0x517b2e['scheduledat'])){_0x2fa9ce+=_0x2658('0x85');}_0x15ba41[_0x2658('0x1e')](_0x2fa9ce);BPromise[_0x2658('0x86')](_0x15ba41,handleQuery)['then'](function(_0x1a3d83){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x15ba41=[];for(var _0x2a131f=0x0;_0x2a131f\x20\x20');}var _0x40e652=path[_0x2658('0x14')](config[_0x2658('0x92')],_0x2658('0x64'),process['argv'][0x2]);if(!fs[_0x2658('0x93')](_0x40e652)){throw new Error(_0x2658('0x94'));}var _0x19c57f={};try{_0x19c57f=JSON[_0x2658('0x95')](process[_0x2658('0x91')][0x3]);if(!_0x19c57f[_0x2658('0x96')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x3aea50=0x0;if(_0x19c57f[_0x2658('0x96')]['UserId']){_0x3aea50=0x1;}if(!_0x19c57f[_0x2658('0x57')]){throw new Error(_0x2658('0x97'));}}catch(_0x1b0fcb){throw new Error(_0x2658('0x98'));}var _0x5b2fd4=[];try{_0x5b2fd4=_[_0x2658('0x99')](JSON[_0x2658('0x95')](process[_0x2658('0x91')][0x4]),'id');}catch(_0x38c519){logger[_0x2658('0x5d')](_0x2658('0x9a'));}main(_0x40e652,_0x19c57f,_0x5b2fd4,_0x3aea50);}validate();process['on'](_0x2658('0x9b'),handleStop);process['on'](_0x2658('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 5f769c0..287844c 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 _0xe3d3=['destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0x4ae17e,_0x3abff6){var _0x41704a=function(_0x4ba9d0){while(--_0x4ba9d0){_0x4ae17e['push'](_0x4ae17e['shift']());}};_0x41704a(++_0x3abff6);}(_0xe3d3,0xc5));var _0x3e3d=function(_0x2cee04,_0x158079){_0x2cee04=_0x2cee04-0x0;var _0x415121=_0xe3d3[_0x2cee04];return _0x415121;};'use strict';exports['getSubjects']=function(_0x560902,_0x4b6572){var _0x2e6186=[{'type':_0x3e3d('0x0'),'content':_0x3e3d('0x1'),'variableName':null}];switch(_0x560902[_0x3e3d('0x2')]()){case'voice':switch(_0x4b6572['toLowerCase']()){case _0x3e3d('0x3'):_0x2e6186[_0x3e3d('0x4')]({'type':_0x3e3d('0x5'),'content':'','variableName':_0x3e3d('0x6')});_0x2e6186[_0x3e3d('0x4')]({'type':_0x3e3d('0x5'),'content':'','variableName':_0x3e3d('0x7')});break;case _0x3e3d('0x8'):_0x2e6186[_0x3e3d('0x4')]({'type':_0x3e3d('0x0'),'content':_0x3e3d('0x9'),'variableName':null});_0x2e6186[_0x3e3d('0x4')]({'type':_0x3e3d('0x5'),'content':'','variableName':_0x3e3d('0xa')});break;}}return _0x2e6186;};exports[_0x3e3d('0xb')]=function(_0x3f380c,_0x177e16){var _0xd510a7=[];switch(_0x3f380c[_0x3e3d('0x2')]()){case'voice':switch(_0x177e16['toLowerCase']()){case'inbound':_0xd510a7=[{'type':'string','content':_0x3e3d('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x3e3d('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x3e3d('0x7')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0xe'),'keyType':'variable','variableName':'calleridname'},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0xf'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0x10')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x11'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0x6')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x12'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0x13')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x14'),'keyType':_0x3e3d('0x5'),'variableName':'agentcalledAt'},{'type':_0x3e3d('0x0'),'content':_0x3e3d('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x16'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0x17')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x18'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0xa')},{'type':'string','content':_0x3e3d('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3e3d('0x1a'),'keyType':_0x3e3d('0x5'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x3e3d('0x1b'),'keyType':'variable','variableName':_0x3e3d('0x1c')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x1d'),'keyType':_0x3e3d('0x5'),'variableName':'agentcompleteAt'},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x1e'),'keyType':'variable','variableName':'holdtime'},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x1f'),'keyType':_0x3e3d('0x5'),'variableName':_0x3e3d('0x20')}];break;case'outbound':_0xd510a7=[{'type':_0x3e3d('0x0'),'content':_0x3e3d('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0x3e3d('0x21'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x22'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':_0x3e3d('0x23')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x12'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':_0x3e3d('0x13')},{'type':'keyValue','content':'','key':_0x3e3d('0x14'),'keyType':'variable','keyContent':'','variableName':_0x3e3d('0x24')},{'type':'string','content':_0x3e3d('0x19')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x25'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x26'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':_0x3e3d('0x27')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x28'),'keyType':_0x3e3d('0x5'),'keyContent':'','variableName':_0x3e3d('0x29')},{'type':_0x3e3d('0xd'),'content':'','key':_0x3e3d('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x3e3d('0x2b')}];break;}}return _0xd510a7;}; \ No newline at end of file +var _0x6715=['push','queue','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','getDescriptions','voice','inbound','Caller\x20Number','Caller\x20Name','calleridname','keyValue','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','membername','UniqueId','uniqueid','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase'];(function(_0x1fff7d,_0x1146c0){var _0x2ce994=function(_0x16ee3e){while(--_0x16ee3e){_0x1fff7d['push'](_0x1fff7d['shift']());}};_0x2ce994(++_0x1146c0);}(_0x6715,0x104));var _0x5671=function(_0x374088,_0x235870){_0x374088=_0x374088-0x0;var _0x3f4de1=_0x6715[_0x374088];return _0x3f4de1;};'use strict';exports[_0x5671('0x0')]=function(_0x40bd89,_0x42d649){var _0x4ab322=[{'type':_0x5671('0x1'),'content':_0x5671('0x2'),'variableName':null}];switch(_0x40bd89[_0x5671('0x3')]()){case'voice':switch(_0x42d649[_0x5671('0x3')]()){case'inbound':_0x4ab322[_0x5671('0x4')]({'type':'variable','content':'','variableName':_0x5671('0x5')});_0x4ab322[_0x5671('0x4')]({'type':'variable','content':'','variableName':_0x5671('0x6')});break;case _0x5671('0x7'):_0x4ab322[_0x5671('0x4')]({'type':_0x5671('0x1'),'content':_0x5671('0x8'),'variableName':null});_0x4ab322['push']({'type':_0x5671('0x9'),'content':'','variableName':_0x5671('0xa')});break;}}return _0x4ab322;};exports[_0x5671('0xb')]=function(_0x5a9ae5,_0x140b9e){var _0x4cb9af=[];switch(_0x5a9ae5[_0x5671('0x3')]()){case _0x5671('0xc'):switch(_0x140b9e[_0x5671('0x3')]()){case _0x5671('0xd'):_0x4cb9af=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x5671('0xe'),'keyType':_0x5671('0x9'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x5671('0xf'),'keyType':_0x5671('0x9'),'variableName':_0x5671('0x10')},{'type':_0x5671('0x11'),'content':'','key':'Call\x20To','keyType':_0x5671('0x9'),'variableName':'destexten'},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x12'),'keyType':_0x5671('0x9'),'variableName':_0x5671('0x5')},{'type':_0x5671('0x11'),'content':'','key':'UniqueId','keyType':_0x5671('0x9'),'variableName':'uniqueid'},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x13'),'keyType':_0x5671('0x9'),'variableName':_0x5671('0x14')},{'type':_0x5671('0x1'),'content':_0x5671('0x15'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x5671('0x16'),'keyType':'variable','variableName':_0x5671('0x17')},{'type':'keyValue','content':'','key':_0x5671('0x18'),'keyType':_0x5671('0x9'),'variableName':'destcalleridnum'},{'type':_0x5671('0x1'),'content':_0x5671('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x1a'),'keyType':_0x5671('0x9'),'variableName':_0x5671('0x14')},{'type':'keyValue','content':'','key':_0x5671('0x1b'),'keyType':_0x5671('0x9'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x5671('0x1c'),'keyType':_0x5671('0x9'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x5671('0x9'),'variableName':_0x5671('0x1d')},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x1e'),'keyType':_0x5671('0x9'),'variableName':_0x5671('0x1f')}];break;case'outbound':_0x4cb9af=[{'type':_0x5671('0x1'),'content':_0x5671('0x20'),'variableName':null},{'type':_0x5671('0x11'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x5671('0x11'),'content':'','key':'Member\x20Name','keyType':_0x5671('0x9'),'keyContent':'','variableName':_0x5671('0x21')},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x22'),'keyType':'variable','keyContent':'','variableName':_0x5671('0x23')},{'type':_0x5671('0x11'),'content':'','key':'Date','keyType':_0x5671('0x9'),'keyContent':'','variableName':_0x5671('0x24')},{'type':_0x5671('0x1'),'content':_0x5671('0x19')},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x25'),'keyType':_0x5671('0x9'),'keyContent':'','variableName':'answertime'},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x26'),'keyType':_0x5671('0x9'),'keyContent':'','variableName':_0x5671('0x27')},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x28'),'keyType':_0x5671('0x9'),'keyContent':'','variableName':_0x5671('0x29')},{'type':_0x5671('0x11'),'content':'','key':_0x5671('0x2a'),'keyType':_0x5671('0x9'),'keyContent':'','variableName':_0x5671('0x2b')}];break;}}return _0x4cb9af;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 57399d0..f2268c8 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 _0x2ab9=['getFilteredInteractions','rows','catch','tracked','user','query','clone','omit','html','mobile','updateUser','./utils','findAll','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','where','body','contact','default','fields','filter','having','read','tags','checkAccountsRestrictions','group','i.id','count','clause','contactName','order','DESC','closed','getClosedOrderClause'];(function(_0x50b53f,_0x3ae2b1){var _0x390abb=function(_0x3edc52){while(--_0x3edc52){_0x50b53f['push'](_0x50b53f['shift']());}};_0x390abb(++_0x3ae2b1);}(_0x2ab9,0xc4));var _0x92ab=function(_0x664274,_0x235c54){_0x664274=_0x664274-0x0;var _0x4c31e9=_0x2ab9[_0x664274];return _0x4c31e9;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var utils=require(_0x92ab('0x0'));exports[_0x92ab('0x1')]=function(_0x540de5,_0x4002ad,_0x1f2896,_0x1a2177,_0x1a88e8){var _0x3b8a98={'count':0x0,'rows':[]};var _0x4eaa34=sqlUtils['skipInteractionsQuery'](_0x540de5,_0x1f2896,_0x4002ad);if(_0x4eaa34){return Promise[_0x92ab('0x2')](_0x3b8a98);}var _0x2ef275=sqlUtils[_0x92ab('0x3')](_0x540de5);var _0x4c2916={};return Promise['resolve']()[_0x92ab('0x4')](function(){if(_0x4002ad[_0x92ab('0x5')]){return sqlUtils[_0x92ab('0x6')](_0x4002ad['search'],_0x1a88e8);}else{return sqlUtils['parseQueryParameters'](_0x540de5,_0x4002ad,_0x1a88e8);}})[_0x92ab('0x4')](function(_0x5d91ae){_0x2ef275[_0x92ab('0x7')](_0x5d91ae[_0x92ab('0x8')]);_0x2ef275['where'](_0x5d91ae[_0x92ab('0x9')]);_0x2ef275[_0x92ab('0x7')](_0x5d91ae[_0x92ab('0xa')]);_0x2ef275[_0x92ab('0x7')](_0x5d91ae[_0x92ab('0xb')]);_0x2ef275[_0x92ab('0x7')](_0x5d91ae[_0x92ab('0xc')]);_0x2ef275[_0x92ab('0x7')](_0x5d91ae['user']);_0x2ef275[_0x92ab('0xd')](_0x5d91ae[_0x92ab('0xe')]);_0x4c2916=_0x5d91ae[_0x92ab('0xf')];return sqlUtils[_0x92ab('0x10')](_0x540de5,_0x1f2896,_0x4002ad);})[_0x92ab('0x4')](function(_0x2ce21e){_0x2ef275['where'](_0x2ce21e);_0x2ef275[_0x92ab('0x11')](_0x92ab('0x12'));var _0x5daae1=_0x4002ad[_0x92ab('0x5')]?_0x4c2916['ids']:_0x4002ad['tag'];return sqlUtils['countFilteredInteractions'](_0x2ef275,_0x5daae1);})[_0x92ab('0x4')](function(_0x226b0b){_0x3b8a98[_0x92ab('0x13')]=_0x226b0b['length'];if(_0x3b8a98['count']===0x0){return[];}_0x2ef275[_0x92ab('0xd')](_0x4c2916[_0x92ab('0x14')]);if(_0x1a2177['order']){_0x1a2177['order']['forEach'](function(_0x4ad476){var _0x44ac86=_0x4ad476[0x0]===_0x92ab('0x15')?_0x4ad476[0x0]:'i.'+_0x4ad476[0x0];_0x2ef275[_0x92ab('0x16')](_0x44ac86,_0x4ad476[0x1]===_0x92ab('0x17')?![]:!![]);if(_0x4ad476[0x0]===_0x92ab('0x18')){var _0x4fc00c=sqlUtils[_0x92ab('0x19')](_0x540de5,_0x4002ad);_0x2ef275['order'](_0x4fc00c,_0x4ad476[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0x92ab('0x1a')](_0x540de5,_0x2ef275,_0x4002ad,_0x1a2177);})[_0x92ab('0x4')](function(_0x25531b){_0x3b8a98[_0x92ab('0x1b')]=_0x25531b;return _0x3b8a98;})[_0x92ab('0x1c')](function(_0x4bb967){throw _0x4bb967;});};exports[_0x92ab('0x1d')]=function(_0x23e1dd,_0x9aac67){return function(_0x412a7e,_0x28149a,_0x6f13eb){var _0x2b9e2b=_0x412a7e[_0x92ab('0x1e')];var _0x13e4a2={};var _0x55ad3a=_0x412a7e[_0x92ab('0x1f')];if(_0x13e4a2){_0x13e4a2=_[_0x92ab('0x20')](_0x412a7e[_0x92ab('0x8')]);_0x13e4a2=_[_0x92ab('0x21')](_0x13e4a2,[_0x92ab('0x8'),_0x92ab('0x22'),'phone','fax',_0x92ab('0x23')]);}utils[_0x92ab('0x24')](_0x2b9e2b,_0x13e4a2,_0x55ad3a,_0x23e1dd,_0x9aac67);_0x6f13eb(null);};}; \ No newline at end of file +var _0x84a7=['body','contact','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','catch','tracked','clone','omit','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseQueryParameters','where'];(function(_0x5688f0,_0x3fce94){var _0x15121b=function(_0x1ab36f){while(--_0x1ab36f){_0x5688f0['push'](_0x5688f0['shift']());}};_0x15121b(++_0x3fce94);}(_0x84a7,0x178));var _0x784a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84a7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x784a('0x0'));var sqlUtils=require(_0x784a('0x1'));var utils=require(_0x784a('0x2'));exports[_0x784a('0x3')]=function(_0x1bcf5c,_0x5dfdc1,_0x795aaa,_0x5f99d,_0x1e0d70){var _0x1ae253={'count':0x0,'rows':[]};var _0x6d7a34=sqlUtils[_0x784a('0x4')](_0x1bcf5c,_0x795aaa,_0x5dfdc1);if(_0x6d7a34){return Promise[_0x784a('0x5')](_0x1ae253);}var _0x13cb51=sqlUtils[_0x784a('0x6')](_0x1bcf5c);var _0x3c6e8={};return Promise[_0x784a('0x5')]()[_0x784a('0x7')](function(){if(_0x5dfdc1[_0x784a('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x5dfdc1['search'],_0x1e0d70);}else{return sqlUtils[_0x784a('0x9')](_0x1bcf5c,_0x5dfdc1,_0x1e0d70);}})['then'](function(_0x257d8b){_0x13cb51[_0x784a('0xa')](_0x257d8b[_0x784a('0xb')]);_0x13cb51[_0x784a('0xa')](_0x257d8b[_0x784a('0xc')]);_0x13cb51[_0x784a('0xa')](_0x257d8b['default']);_0x13cb51['where'](_0x257d8b[_0x784a('0xd')]);_0x13cb51[_0x784a('0xa')](_0x257d8b[_0x784a('0xe')]);_0x13cb51[_0x784a('0xa')](_0x257d8b[_0x784a('0xf')]);_0x13cb51[_0x784a('0x10')](_0x257d8b[_0x784a('0x11')]);_0x3c6e8=_0x257d8b[_0x784a('0x12')];return sqlUtils[_0x784a('0x13')](_0x1bcf5c,_0x795aaa,_0x5dfdc1);})[_0x784a('0x7')](function(_0x13c6f1){_0x13cb51['where'](_0x13c6f1);_0x13cb51[_0x784a('0x14')](_0x784a('0x15'));var _0x4ba18a=_0x5dfdc1[_0x784a('0x8')]?_0x3c6e8[_0x784a('0x16')]:_0x5dfdc1[_0x784a('0x17')];return sqlUtils[_0x784a('0x18')](_0x13cb51,_0x4ba18a);})[_0x784a('0x7')](function(_0xa8599c){_0x1ae253[_0x784a('0x19')]=_0xa8599c[_0x784a('0x1a')];if(_0x1ae253[_0x784a('0x19')]===0x0){return[];}_0x13cb51[_0x784a('0x10')](_0x3c6e8[_0x784a('0x1b')]);if(_0x5f99d[_0x784a('0x1c')]){_0x5f99d[_0x784a('0x1c')]['forEach'](function(_0x27bcc4){var _0x1c1843=_0x27bcc4[0x0]==='contactName'?_0x27bcc4[0x0]:'i.'+_0x27bcc4[0x0];_0x13cb51[_0x784a('0x1c')](_0x1c1843,_0x27bcc4[0x1]===_0x784a('0x1d')?![]:!![]);if(_0x27bcc4[0x0]===_0x784a('0x1e')){var _0x29fffe=sqlUtils[_0x784a('0x1f')](_0x1bcf5c,_0x5dfdc1);_0x13cb51[_0x784a('0x1c')](_0x29fffe,_0x27bcc4[0x1]===_0x784a('0x1d')?![]:!![]);}});}return sqlUtils[_0x784a('0x20')](_0x1bcf5c,_0x13cb51,_0x5dfdc1,_0x5f99d);})['then'](function(_0x98cbad){_0x1ae253[_0x784a('0x21')]=_0x98cbad;return _0x1ae253;})[_0x784a('0x22')](function(_0x3403eb){throw _0x3403eb;});};exports[_0x784a('0x23')]=function(_0x458ba7,_0xe43764){return function(_0x413a4e,_0xa3349f,_0x460750){var _0x17c6dc=_0x413a4e[_0x784a('0xf')];var _0xfc0e0d={};var _0x9e0cd7=_0x413a4e['query'];if(_0xfc0e0d){_0xfc0e0d=_[_0x784a('0x24')](_0x413a4e[_0x784a('0xb')]);_0xfc0e0d=_[_0x784a('0x25')](_0xfc0e0d,['body',_0x784a('0x26'),_0x784a('0x27'),_0x784a('0x28'),_0x784a('0x29')]);}utils[_0x784a('0x2a')](_0x17c6dc,_0xfc0e0d,_0x9e0cd7,_0x458ba7,_0xe43764);_0x460750(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index d64696a..3acb048 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5691=['lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','_interactions','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','getInteractionsTables','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','tools_tags','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','type','default','text','value','start','end','unreadMessages','read','and','Contact','operator','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','split','map','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','keys','some','compact','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','tags','filter','get','capitalize','chat','Websites','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Interaction','sequelize','query','keyBy','merge','attributes','forEach','Account.mandatoryDisposition','a.email','i.id','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','toString','Setting','findOne','enableEmailPreview','all','clone','isEmpty','where','t.id\x20IN\x20?','QueryTypes','SELECT','exports'];(function(_0x3bc61d,_0x1ada0b){var _0xf758ee=function(_0x5972a4){while(--_0x5972a4){_0x3bc61d['push'](_0x3bc61d['shift']());}};_0xf758ee(++_0x1ada0b);}(_0x5691,0x1e6));var _0x1569=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5691[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1569('0x0'));var squel=require(_0x1569('0x1'));var as=require(_0x1569('0x2'));var qs=require(_0x1569('0x3'));var updateInteraction=require('./update-interaction')[_0x1569('0x4')];var utils=require(_0x1569('0x5'));var db=require(_0x1569('0x6'))['db'];function skipInteractionsQuery(_0x2fe6d8,_0x1563d0,_0x53b0a9){var _0x4e7dd8=![];var _0x3b361e=utils[_0x1569('0x7')](_0x2fe6d8);if(_0x1563d0[_0x1569('0x8')]===_0x1569('0x9')&&!_0x53b0a9[_0x1569('0xa')]&&!_0x53b0a9[_0x3b361e]){_0x4e7dd8=!![];}return _0x4e7dd8;}function getTagsQuery(){return squel[_0x1569('0xb')]()[_0x1569('0xc')]('id')[_0x1569('0xc')](_0x1569('0xd'))['field'](_0x1569('0xe'))['from']('tools_tags');}function getUsersQuery(_0x1c7699,_0x5462fc){var _0x12d543=utils['getInteractionFK'](_0x1c7699);var _0x4ca12b='user_has_'+_0x1c7699+_0x1569('0xf');var _0x255224=squel[_0x1569('0xb')]()['field'](_0x1569('0x10'))[_0x1569('0xc')](_0x1569('0x11'))['field'](_0x1569('0x12')+_0x12d543)[_0x1569('0x13')](_0x4ca12b,'ui')[_0x1569('0x14')](_0x1569('0x15'),'u',_0x1569('0x16'));if(_0x5462fc[_0x1569('0x17')]>0x0){_0x255224['where'](_0x1569('0x12')+_0x12d543+_0x1569('0x18'),_['map'](_0x5462fc,'id'));}return _0x255224;}function getInteractionsQuery(_0x49b4f4){var _0x5c437b=utils[_0x1569('0x19')](_0x49b4f4);var _0x1ab234=utils[_0x1569('0x7')](_0x49b4f4);var _0x4b3dae=utils[_0x1569('0x1a')](_0x49b4f4);return squel[_0x1569('0xb')]()['from'](_0x5c437b[_0x1569('0x1b')],'i')[_0x1569('0x14')](_0x1569('0x1c'),'c',_0x1569('0x1d'))['left_join'](_0x1569('0x15'),'o','o.id\x20=\x20i.UserId')[_0x1569('0x14')](_0x5c437b[_0x1569('0x1e')],'a',_0x1569('0x1f')+_0x1ab234)[_0x1569('0x14')](_0x5c437b[_0x1569('0x20')],'me',_0x1569('0x21')+_0x4b3dae+_0x1569('0x22'))[_0x1569('0x14')](_0x5c437b[_0x1569('0x23')],'it',_0x1569('0x24')+_0x4b3dae+_0x1569('0x22'))[_0x1569('0x14')](_0x1569('0x25'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x5e69c8={'body':squel[_0x1569('0x26')](),'contact':squel[_0x1569('0x26')](),'default':squel[_0x1569('0x26')](),'fields':squel[_0x1569('0x26')](),'filter':squel[_0x1569('0x26')](),'read':squel[_0x1569('0x26')](),'tags':{'clause':squel[_0x1569('0x26')](),'ids':null},'user':squel[_0x1569('0x26')]()};return _0x5e69c8;}function parseTagParameter(_0xcc0556){var _0x519900=squel[_0x1569('0x26')]();if(_0xcc0556){var _0x1b4e35=utils[_0x1569('0x27')](_0xcc0556);_0x1b4e35['forEach'](function(_0x1e81cb){_0x519900['or'](_0x1569('0x28'),'%,'+_0x1e81cb+',%');});}return _0x519900;}function parseReadParameter(_0x21e081){var _0x59bf2b='';if(_0x21e081){_0x59bf2b=_0x1569('0x29');if(_0x21e081==='1'){_0x59bf2b=_0x59bf2b[_0x1569('0x2a')]('{OPERATOR}','=');}else{_0x59bf2b=_0x59bf2b['replace'](_0x1569('0x2b'),'>');}}return _0x59bf2b;}function parseSearchFilter(_0x5065b7,_0xf02d3e){var _0x2aed77=squel['expr']();if(_0xf02d3e){var _0x31b377=_0xf02d3e[_0x1569('0x2a')]('\x5c','\x5c\x5c')[_0x1569('0x2a')](/'/g,'\x27\x27');if(qs[_0x1569('0x2c')](_0x31b377)){_0x2aed77['or'](_0x1569('0x2d'),_0x31b377+'%');if([_0x1569('0x2e'),_0x1569('0x2f')][_0x1569('0x30')](_0x5065b7)){_0x2aed77['or'](_0x1569('0x31'),_0x31b377+'%');}else if(_0x5065b7===_0x1569('0x32')){_0x2aed77['or'](_0x1569('0x33'),_0x31b377+'%');}else if(_0x5065b7===_0x1569('0x34')){_0x2aed77['or'](_0x1569('0x35'),_0x31b377+'%');}}else if(_0x5065b7===_0x1569('0x36')&&qs[_0x1569('0x37')](_0x31b377)){_0x2aed77['or'](_0x1569('0x38'),_0x31b377+'%');}else{if(_0x5065b7===_0x1569('0x36')){_0x2aed77['or'](_0x1569('0x39'),qs[_0x1569('0x3a')](_0x31b377,!![]))['or'](_0x1569('0x3b'),qs[_0x1569('0x3a')](_0x31b377));}else if(_0x5065b7!=='fax'){_0x2aed77['or'](_0x1569('0x3c'),qs[_0x1569('0x3a')](_0x31b377));}_0x2aed77['or'](_0x1569('0x3d'),qs[_0x1569('0x3a')](_0x31b377,!![]),null);}}return _0x2aed77;}function parseAdvancedSearchFilter(_0x18543a,_0x830f7c){var _0x41c24e=getSqlClauses();var _0x5dfdaa=as['parseSearch'](_0x18543a);var _0x411425=_0x5dfdaa[_0x1569('0x3e')];for(var _0x44f9da=0x0;_0x44f9da<_0x5dfdaa[_0x1569('0x3f')]['length'];_0x44f9da++){var _0x130b1f=_0x5dfdaa[_0x1569('0x3f')][_0x44f9da];var _0x1b0f6a='i';var _0x2ead9c=_['find'](_0x830f7c,[_0x1569('0xd'),_0x130b1f[_0x1569('0xc')]]);if(_0x2ead9c){var _0x36aed0=as['buildExpression'](_0x1b0f6a,_0x2ead9c[_0x1569('0x40')],_0x130b1f);_0x41c24e[_0x1569('0x41')][_0x411425](_0x36aed0[_0x1569('0x42')],_0x36aed0[_0x1569('0x43')][_0x1569('0x44')],_0x36aed0['value'][_0x1569('0x45')]);}else{switch(_0x130b1f[_0x1569('0xc')]){case _0x1569('0x46'):var _0x4d9f79=parseReadParameter(_0x130b1f[_0x1569('0x43')]);_0x41c24e[_0x1569('0x47')][_0x1569('0x48')](_0x4d9f79);break;case _0x1569('0x49'):if(_0x130b1f[_0x1569('0x4a')]==='$substring'){if(_0x130b1f['value']['split']('\x20')[_0x1569('0x17')]>0x1){_0x41c24e[_0x1569('0x4b')][_0x411425](_0x1569('0x3d'),qs['getFullTextValue'](_0x130b1f[_0x1569('0x43')],!![]),null);}else{var _0x1a12ed='%'+_0x130b1f[_0x1569('0x43')]+'%';_0x41c24e[_0x1569('0x4b')][_0x411425](_0x1569('0x4c'),_0x1a12ed,_0x1a12ed,_0x1a12ed);}}else{_0x2ead9c=_[_0x1569('0x4d')](_0x830f7c,[_0x1569('0xd'),_0x1569('0x4e')]);_0x130b1f[_0x1569('0xc')]=_0x1569('0x4e');_0x36aed0=as[_0x1569('0x4f')](_0x1b0f6a,_0x2ead9c['type'],_0x130b1f);_0x41c24e[_0x1569('0x4b')][_0x411425](_0x36aed0[_0x1569('0x42')],_0x36aed0[_0x1569('0x43')][_0x1569('0x44')],_0x36aed0[_0x1569('0x43')][_0x1569('0x45')]);}break;case'Tag':var _0x28bcac=_0x130b1f[_0x1569('0x43')][_0x1569('0x50')](',')[_0x1569('0x51')](function(_0x485a15){return Number(_0x485a15);});var _0x269f38=parseTagParameter(_0x28bcac);_0x41c24e['tags']['clause'][_0x1569('0x48')](_0x269f38);_0x41c24e['tags']['ids']=_0x28bcac;break;case _0x1569('0x52'):if(_0x130b1f[_0x1569('0x4a')]===_0x1569('0x53')){_0x41c24e['user'][_0x411425](_0x1569('0x54'),'%'+_0x130b1f[_0x1569('0x43')]+'%',null);}else{_0x2ead9c=_['find'](_0x830f7c,[_0x1569('0xd'),_0x1569('0x55')]);_0x130b1f[_0x1569('0xc')]=_0x1569('0x55');_0x36aed0=as[_0x1569('0x4f')](_0x1b0f6a,_0x2ead9c[_0x1569('0x40')],_0x130b1f);_0x41c24e[_0x1569('0x56')][_0x411425](_0x36aed0[_0x1569('0x42')],_0x36aed0[_0x1569('0x43')]['start'],_0x36aed0['value'][_0x1569('0x45')]);}break;case _0x1569('0x57'):case _0x1569('0x58'):_0x36aed0=as[_0x1569('0x4f')]('me',null,_0x130b1f);_0x41c24e[_0x1569('0x57')][_0x411425](_0x36aed0[_0x1569('0x42')],_0x36aed0[_0x1569('0x43')]['start'],_0x36aed0[_0x1569('0x43')]['end']);break;}}}return _0x41c24e;}function parseModelFields(_0x365cdd,_0x349878,_0x3fe5df){var _0x15ef45=utils['getAccountFK'](_0x365cdd);var _0x1fbc12=squel[_0x1569('0x26')]();var _0xadd62e=_(_0x349878)[_0x1569('0x59')]()['map'](function(_0x223084){return _[_0x1569('0x5a')](_0x3fe5df,[_0x1569('0xd'),_0x223084])?_0x223084:undefined;})[_0x1569('0x5b')]()['value']();if(_0xadd62e[_0x1569('0x17')]>0x0){_0xadd62e['forEach'](function(_0x58abab){if(_0x58abab===_0x15ef45){_0x1fbc12[_0x1569('0x48')]('i.'+_0x15ef45+_0x1569('0x18'),[]['concat'](_0x349878[_0x58abab]));}else if(_0x58abab===_0x1569('0x5c')){var _0x727c40=JSON[_0x1569('0x5d')](_0x349878[_0x58abab])[_0x1569('0x5e')];var _0x2e9aab=JSON[_0x1569('0x5d')](_0x349878[_0x58abab])[_0x1569('0x5f')];_0x1fbc12['and'](_0x1569('0x60'),_0x727c40,_0x2e9aab);}else{if(_0x349878[_0x58abab]==='null'){_0x1fbc12[_0x1569('0x48')]('i.'+_0x58abab+_0x1569('0x61'));}else{_0x1fbc12['and']('i.'+_0x58abab+_0x1569('0x62'),_0x349878[_0x58abab]);}}});}return _0x1fbc12;}function parseQueryParameters(_0x21a72f,_0x3980a4,_0x19e807){var _0x16c673=getSqlClauses();return Promise[_0x1569('0x63')]()[_0x1569('0x64')](function(){return parseModelFields(_0x21a72f,_0x3980a4,_0x19e807);})[_0x1569('0x64')](function(_0x4d7354){_0x16c673[_0x1569('0x65')]['and'](_0x4d7354);return parseReadParameter(_0x3980a4[_0x1569('0x47')]);})[_0x1569('0x64')](function(_0x1e65b2){_0x16c673[_0x1569('0x47')][_0x1569('0x48')](_0x1e65b2);return parseTagParameter(_0x3980a4[_0x1569('0x66')]);})['then'](function(_0x588b6c){_0x16c673[_0x1569('0x67')]['clause'][_0x1569('0x48')](_0x588b6c);return parseSearchFilter(_0x21a72f,_0x3980a4['filter']);})[_0x1569('0x64')](function(_0x29adaa){_0x16c673[_0x1569('0x68')]=_0x29adaa;return _0x16c673;});}function checkAccountsRestrictions(_0x40554e,_0x586492,_0x852870){var _0x2d034e=utils[_0x1569('0x7')](_0x40554e);var _0xdaaa4d=_0x1569('0x69')+_[_0x1569('0x6a')](_0x40554e)+(_0x40554e===_0x1569('0x6b')?_0x1569('0x6c'):'Accounts');var _0x3a70d4=squel['expr']();return Promise[_0x1569('0x63')]()['then'](function(){if(_0x852870[_0x1569('0xa')]&&_0x586492[_0x1569('0x8')]===_0x1569('0x9')){return _0x586492[_0xdaaa4d]({'attributes':['id'],'raw':!![]});}})[_0x1569('0x64')](function(_0x5b5ff8){if(_0x5b5ff8){if(_0x5b5ff8[_0x1569('0x17')]===0x0){_0x3a70d4[_0x1569('0x48')]('i.'+_0x2d034e+'\x20IS\x20NULL');}else{_0x3a70d4['and']('i.'+_0x2d034e+'\x20IN\x20?',_[_0x1569('0x51')](_0x5b5ff8,'id'));}}else if(!_0x852870[_0x2d034e]){_0x3a70d4[_0x1569('0x48')]('i.'+_0x2d034e+_0x1569('0x6d'));}})[_0x1569('0x64')](function(){return _0x3a70d4;});}function getClosedOrderClause(_0xdd85d0,_0x4d537f){var _0x36b44d='';var _0x411e29=[_0x1569('0x6e'),_0x1569('0x6f'),_0x1569('0x70')];if(_0xdd85d0==='mail'){_0x411e29[_0x1569('0x71')](_0x1569('0x72'));}if(_0x4d537f['closed']==='0'&&_0xdd85d0===_0x1569('0x36')){_0x36b44d=_0x1569('0x72');}else{if(_0x4d537f[_0x1569('0x73')]==='1'){_0x411e29[_0x1569('0x74')]();}_0x36b44d='CONCAT_WS(\x27\x27,\x20'+_0x411e29[_0x1569('0x75')](',\x20')+')';}return _0x36b44d;}function getFilteredInteractions(_0x41eb6a,_0x277c71,_0x2d9d7e,_0x2d7ef1){var _0x355113=utils['getInteractionFK'](_0x41eb6a);var _0x29f64c=_[_0x1569('0x6a')](_0x41eb6a)+_0x1569('0x76');var _0xb959f4=[];var _0x109cc7=getTagsQuery();var _0x1610f9={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x3ae198=[];var _0x3f5dd2=[];return db[_0x1569('0x77')][_0x1569('0x78')](_0x109cc7['toString'](),_0x1610f9)[_0x1569('0x64')](function(_0x227a48){_0xb959f4=_[_0x1569('0x79')](_0x227a48,'id');_0x1610f9=_[_0x1569('0x7a')](_0x1610f9,{'model':db[_0x29f64c],'mapToModel':!![],'nest':!![]});if(_0x2d9d7e[_0x1569('0x65')]){_0x2d7ef1[_0x1569('0x7b')][_0x1569('0x7c')](function(_0x5d67a4){_0x277c71[_0x1569('0xc')]('i.'+_0x5d67a4);});}else{_0x277c71[_0x1569('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x277c71[_0x1569('0xc')]('a.key','Account.key');_0x277c71[_0x1569('0xc')]('a.mandatoryDisposition',_0x1569('0x7d'));if(_0x41eb6a===_0x1569('0x36')){_0x277c71[_0x1569('0xc')](_0x1569('0x7e'),'Account.email');_0x277c71['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x277c71[_0x1569('0xc')](_0x1569('0x7f'));_0x277c71[_0x1569('0xc')]('i.createdAt');_0x277c71[_0x1569('0xc')](_0x1569('0x80'));_0x277c71[_0x1569('0xc')](_0x1569('0x81'));_0x277c71[_0x1569('0xc')](_0x1569('0x82'));_0x277c71['field']('i.attach');_0x277c71[_0x1569('0xc')]('i.lastMsgAt');_0x277c71[_0x1569('0xc')](_0x1569('0x83'));_0x277c71['field'](_0x1569('0x84'));_0x277c71[_0x1569('0xc')](_0x1569('0x70'));_0x277c71[_0x1569('0xc')](_0x1569('0x6f'));_0x277c71['field'](_0x1569('0x6e'));_0x277c71[_0x1569('0xc')](_0x1569('0x72'));_0x277c71[_0x1569('0xc')]('i.to');_0x277c71[_0x1569('0xc')](_0x1569('0x85'));_0x277c71['field'](_0x1569('0x86'));_0x277c71['field']('i.UserId');}else if(_0x41eb6a===_0x1569('0x34')){_0x277c71[_0x1569('0xc')](_0x1569('0x87'),_0x1569('0x88'));}else{_0x277c71['field'](_0x1569('0x89'),_0x1569('0x88'));}if(_0x41eb6a!==_0x1569('0x36')){_0x277c71['field'](_0x1569('0x8a'));}_0x277c71['field']('c.firstName',_0x1569('0x8b'));_0x277c71['field'](_0x1569('0x8c'),'Contact.lastName');_0x277c71['field']('c.email','Contact.email');_0x277c71[_0x1569('0xc')]('c.phone',_0x1569('0x8d'));_0x277c71['field'](_0x1569('0x8e'),_0x1569('0x8f'));_0x277c71[_0x1569('0xc')](_0x1569('0x90'),'Contact.fax');_0x277c71['field']('o.fullname','Owner.fullname');_0x277c71[_0x1569('0xc')](_0x1569('0x91'),_0x1569('0x92'));_0x277c71[_0x1569('0xc')](_0x1569('0x93'),'TagIds');}if(_0x2d7ef1[_0x1569('0x94')]){_0x277c71['limit'](_0x2d7ef1[_0x1569('0x94')]);}if(_0x2d7ef1[_0x1569('0x95')]){_0x277c71[_0x1569('0x95')](_0x2d7ef1[_0x1569('0x95')]);}return db[_0x1569('0x77')][_0x1569('0x78')](_0x277c71[_0x1569('0x96')](),_0x1610f9);})[_0x1569('0x64')](function(_0x3ee2a8){_0x3ae198=_0x3ee2a8;var _0x450b5c=getUsersQuery(_0x41eb6a,_0x3ae198);return db[_0x1569('0x77')][_0x1569('0x78')](_0x450b5c[_0x1569('0x96')](),_0x1610f9);})[_0x1569('0x64')](function(_0x59dbdd){_0x3f5dd2=_['groupBy'](_0x59dbdd,_0x355113);if(_0x41eb6a===_0x1569('0x36')){return db[_0x1569('0x97')][_0x1569('0x98')]({'attributes':[_0x1569('0x99')],'raw':!![]});}})['then'](function(_0x71fe7c){var _0x4ae30c=_0x71fe7c?_0x71fe7c['enableEmailPreview']:undefined;var _0x505365=_0x3ae198['map'](function(_0x291de9){return updateInteraction(_0x291de9,_0xb959f4,_0x3f5dd2,_0x4ae30c);});return Promise[_0x1569('0x9a')](_0x505365);});}function countFilteredInteractions(_0x3d04ed,_0x3a9d8a){var _0x27a925=_0x3d04ed[_0x1569('0x9b')]();_0x27a925[_0x1569('0xc')]('COUNT(*)');_0x27a925[_0x1569('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1569('0x46'));var _0xbd92fc=utils['getSelectedTags'](_0x3a9d8a);if(!_[_0x1569('0x9c')](_0xbd92fc)){_0x27a925[_0x1569('0x9d')](_0x1569('0x9e'),_0xbd92fc);}var _0x4dec4b={'type':db['Sequelize'][_0x1569('0x9f')][_0x1569('0xa0')],'raw':!![]};return db[_0x1569('0x77')][_0x1569('0x78')](_0x27a925[_0x1569('0x96')](),_0x4dec4b);}module[_0x1569('0xa1')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xb876=['{OPERATOR}','isNumeric','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','fax','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','length','conditions','find','default','text','value','start','end','unreadMessages','Contact','operator','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','contact','Tag','map','tags','clause','and','ids','user','UserId','body','plainBody','forEach','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','then','tag','filter','get','capitalize','chat','Websites','resolve','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','SELECT','sequelize','query','toString','keyBy','fields','attributes','a.key','Account.key','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','offset','groupBy','Setting','findOne','enableEmailPreview','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','updateInteraction','../../mysqldb','getAccountFK','role','search','select','field','name','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','where','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace'];(function(_0x1b5812,_0x5c31e3){var _0x3099b4=function(_0x179696){while(--_0x179696){_0x1b5812['push'](_0x1b5812['shift']());}};_0x3099b4(++_0x5c31e3);}(_0xb876,0x119));var _0x6b87=function(_0x349694,_0x5643e8){_0x349694=_0x349694-0x0;var _0x2e99bd=_0xb876[_0x349694];return _0x2e99bd;};'use strict';var _=require(_0x6b87('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x6b87('0x1')];var utils=require('./utils');var db=require(_0x6b87('0x2'))['db'];function skipInteractionsQuery(_0xe8c4b4,_0x2eef84,_0x2333c3){var _0x40ee25=![];var _0x1cb092=utils[_0x6b87('0x3')](_0xe8c4b4);if(_0x2eef84[_0x6b87('0x4')]==='agent'&&!_0x2333c3[_0x6b87('0x5')]&&!_0x2333c3[_0x1cb092]){_0x40ee25=!![];}return _0x40ee25;}function getTagsQuery(){return squel[_0x6b87('0x6')]()[_0x6b87('0x7')]('id')[_0x6b87('0x7')](_0x6b87('0x8'))[_0x6b87('0x7')]('color')['from']('tools_tags');}function getUsersQuery(_0x1dddbb,_0x24fd97){var _0x3c8bc8=utils[_0x6b87('0x9')](_0x1dddbb);var _0x487de3=_0x6b87('0xa')+_0x1dddbb+_0x6b87('0xb');var _0x22a7ea=squel[_0x6b87('0x6')]()[_0x6b87('0x7')](_0x6b87('0xc'))[_0x6b87('0x7')](_0x6b87('0xd'))[_0x6b87('0x7')](_0x6b87('0xe')+_0x3c8bc8)[_0x6b87('0xf')](_0x487de3,'ui')[_0x6b87('0x10')](_0x6b87('0x11'),'u',_0x6b87('0x12'));if(_0x24fd97['length']>0x0){_0x22a7ea[_0x6b87('0x13')](_0x6b87('0xe')+_0x3c8bc8+'\x20IN\x20?',_['map'](_0x24fd97,'id'));}return _0x22a7ea;}function getInteractionsQuery(_0x349830){var _0x52f044=utils[_0x6b87('0x14')](_0x349830);var _0x1182cd=utils[_0x6b87('0x3')](_0x349830);var _0x1e8f35=utils[_0x6b87('0x9')](_0x349830);return squel[_0x6b87('0x6')]()[_0x6b87('0xf')](_0x52f044[_0x6b87('0x15')],'i')[_0x6b87('0x10')](_0x6b87('0x16'),'c',_0x6b87('0x17'))[_0x6b87('0x10')](_0x6b87('0x11'),'o',_0x6b87('0x18'))[_0x6b87('0x10')](_0x52f044[_0x6b87('0x19')],'a','a.id\x20=\x20i.'+_0x1182cd)['left_join'](_0x52f044[_0x6b87('0x1a')],'me',_0x6b87('0x1b')+_0x1e8f35+_0x6b87('0x1c'))[_0x6b87('0x10')](_0x52f044[_0x6b87('0x1d')],'it',_0x6b87('0x1e')+_0x1e8f35+'\x20=\x20i.id')[_0x6b87('0x10')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x2bae9d={'body':squel[_0x6b87('0x1f')](),'contact':squel[_0x6b87('0x1f')](),'default':squel[_0x6b87('0x1f')](),'fields':squel[_0x6b87('0x1f')](),'filter':squel[_0x6b87('0x1f')](),'read':squel[_0x6b87('0x1f')](),'tags':{'clause':squel[_0x6b87('0x1f')](),'ids':null},'user':squel[_0x6b87('0x1f')]()};return _0x2bae9d;}function parseTagParameter(_0x4c5d3e){var _0x401a30=squel[_0x6b87('0x1f')]();if(_0x4c5d3e){var _0x24c55d=utils[_0x6b87('0x20')](_0x4c5d3e);_0x24c55d['forEach'](function(_0x2e2a9b){_0x401a30['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e2a9b+',%');});}return _0x401a30;}function parseReadParameter(_0x1e3ed2){var _0xa031='';if(_0x1e3ed2){_0xa031=_0x6b87('0x21');if(_0x1e3ed2==='1'){_0xa031=_0xa031[_0x6b87('0x22')](_0x6b87('0x23'),'=');}else{_0xa031=_0xa031[_0x6b87('0x22')]('{OPERATOR}','>');}}return _0xa031;}function parseSearchFilter(_0x47ef47,_0x1f75af){var _0x46f5ee=squel['expr']();if(_0x1f75af){var _0x648eae=_0x1f75af[_0x6b87('0x22')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6b87('0x24')](_0x648eae)){_0x46f5ee['or']('i.id\x20LIKE\x20?',_0x648eae+'%');if([_0x6b87('0x25'),_0x6b87('0x26')][_0x6b87('0x27')](_0x47ef47)){_0x46f5ee['or'](_0x6b87('0x28'),_0x648eae+'%');}else if(_0x47ef47==='fax'){_0x46f5ee['or'](_0x6b87('0x29'),_0x648eae+'%');}else if(_0x47ef47===_0x6b87('0x2a')){_0x46f5ee['or'](_0x6b87('0x2b'),_0x648eae+'%');}}else if(_0x47ef47==='mail'&&qs['isEmail'](_0x648eae)){_0x46f5ee['or'](_0x6b87('0x2c'),_0x648eae+'%');}else{if(_0x47ef47===_0x6b87('0x2d')){_0x46f5ee['or'](_0x6b87('0x2e'),qs[_0x6b87('0x2f')](_0x648eae,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6b87('0x2f')](_0x648eae));}else if(_0x47ef47!==_0x6b87('0x30')){_0x46f5ee['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x648eae));}_0x46f5ee['or'](_0x6b87('0x31'),qs[_0x6b87('0x2f')](_0x648eae,!![]),null);}}return _0x46f5ee;}function parseAdvancedSearchFilter(_0xca13fb,_0x4b6732){var _0x5e008c=getSqlClauses();var _0x389bca=as[_0x6b87('0x32')](_0xca13fb);var _0x4edab0=_0x389bca['sqlOperator'];for(var _0x3d848e=0x0;_0x3d848e<_0x389bca['conditions'][_0x6b87('0x33')];_0x3d848e++){var _0x4394d2=_0x389bca[_0x6b87('0x34')][_0x3d848e];var _0x1d11f9='i';var _0x5f2594=_[_0x6b87('0x35')](_0x4b6732,[_0x6b87('0x8'),_0x4394d2[_0x6b87('0x7')]]);if(_0x5f2594){var _0x317513=as['buildExpression'](_0x1d11f9,_0x5f2594['type'],_0x4394d2);_0x5e008c[_0x6b87('0x36')][_0x4edab0](_0x317513[_0x6b87('0x37')],_0x317513[_0x6b87('0x38')][_0x6b87('0x39')],_0x317513['value'][_0x6b87('0x3a')]);}else{switch(_0x4394d2[_0x6b87('0x7')]){case _0x6b87('0x3b'):var _0x390b34=parseReadParameter(_0x4394d2[_0x6b87('0x38')]);_0x5e008c['read']['and'](_0x390b34);break;case _0x6b87('0x3c'):if(_0x4394d2[_0x6b87('0x3d')]==='$substring'){if(_0x4394d2[_0x6b87('0x38')][_0x6b87('0x3e')]('\x20')[_0x6b87('0x33')]>0x1){_0x5e008c['contact'][_0x4edab0](_0x6b87('0x31'),qs[_0x6b87('0x2f')](_0x4394d2['value'],!![]),null);}else{var _0x4a2ff1='%'+_0x4394d2[_0x6b87('0x38')]+'%';_0x5e008c['contact'][_0x4edab0](_0x6b87('0x3f'),_0x4a2ff1,_0x4a2ff1,_0x4a2ff1);}}else{_0x5f2594=_[_0x6b87('0x35')](_0x4b6732,[_0x6b87('0x8'),_0x6b87('0x40')]);_0x4394d2['field']=_0x6b87('0x40');_0x317513=as[_0x6b87('0x41')](_0x1d11f9,_0x5f2594[_0x6b87('0x42')],_0x4394d2);_0x5e008c[_0x6b87('0x43')][_0x4edab0](_0x317513['text'],_0x317513['value']['start'],_0x317513[_0x6b87('0x38')][_0x6b87('0x3a')]);}break;case _0x6b87('0x44'):var _0x242cef=_0x4394d2['value'][_0x6b87('0x3e')](',')[_0x6b87('0x45')](function(_0x1ad472){return Number(_0x1ad472);});var _0x1f6703=parseTagParameter(_0x242cef);_0x5e008c[_0x6b87('0x46')][_0x6b87('0x47')][_0x6b87('0x48')](_0x1f6703);_0x5e008c['tags'][_0x6b87('0x49')]=_0x242cef;break;case'User':if(_0x4394d2[_0x6b87('0x3d')]==='$substring'){_0x5e008c[_0x6b87('0x4a')][_0x4edab0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4394d2['value']+'%',null);}else{_0x5f2594=_[_0x6b87('0x35')](_0x4b6732,[_0x6b87('0x8'),_0x6b87('0x4b')]);_0x4394d2[_0x6b87('0x7')]='UserId';_0x317513=as['buildExpression'](_0x1d11f9,_0x5f2594['type'],_0x4394d2);_0x5e008c[_0x6b87('0x4a')][_0x4edab0](_0x317513['text'],_0x317513['value'][_0x6b87('0x39')],_0x317513[_0x6b87('0x38')]['end']);}break;case _0x6b87('0x4c'):case _0x6b87('0x4d'):_0x317513=as['buildExpression']('me',null,_0x4394d2);_0x5e008c[_0x6b87('0x4c')][_0x4edab0](_0x317513[_0x6b87('0x37')],_0x317513[_0x6b87('0x38')][_0x6b87('0x39')],_0x317513[_0x6b87('0x38')][_0x6b87('0x3a')]);break;}}}return _0x5e008c;}function parseModelFields(_0x5ba470,_0x3a1137,_0x2d50b7){var _0x3bcc67=utils['getAccountFK'](_0x5ba470);var _0x2cd55a=squel[_0x6b87('0x1f')]();var _0x11e756=_(_0x3a1137)['keys']()[_0x6b87('0x45')](function(_0x14257f){return _['some'](_0x2d50b7,[_0x6b87('0x8'),_0x14257f])?_0x14257f:undefined;})['compact']()[_0x6b87('0x38')]();if(_0x11e756['length']>0x0){_0x11e756[_0x6b87('0x4e')](function(_0x320bd7){if(_0x320bd7===_0x3bcc67){_0x2cd55a[_0x6b87('0x48')]('i.'+_0x3bcc67+_0x6b87('0x4f'),[][_0x6b87('0x50')](_0x3a1137[_0x320bd7]));}else if(_0x320bd7===_0x6b87('0x51')){var _0x74f0ad=JSON[_0x6b87('0x52')](_0x3a1137[_0x320bd7])[_0x6b87('0x53')];var _0x216b5c=JSON[_0x6b87('0x52')](_0x3a1137[_0x320bd7])[_0x6b87('0x54')];_0x2cd55a['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x74f0ad,_0x216b5c);}else{if(_0x3a1137[_0x320bd7]===_0x6b87('0x55')){_0x2cd55a[_0x6b87('0x48')]('i.'+_0x320bd7+_0x6b87('0x56'));}else{_0x2cd55a[_0x6b87('0x48')]('i.'+_0x320bd7+_0x6b87('0x57'),_0x3a1137[_0x320bd7]);}}});}return _0x2cd55a;}function parseQueryParameters(_0xde979d,_0x188f41,_0x55f658){var _0x2afc1e=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0xde979d,_0x188f41,_0x55f658);})['then'](function(_0x302e65){_0x2afc1e['fields'][_0x6b87('0x48')](_0x302e65);return parseReadParameter(_0x188f41[_0x6b87('0x58')]);})[_0x6b87('0x59')](function(_0x556e43){_0x2afc1e[_0x6b87('0x58')][_0x6b87('0x48')](_0x556e43);return parseTagParameter(_0x188f41[_0x6b87('0x5a')]);})[_0x6b87('0x59')](function(_0x5a305e){_0x2afc1e['tags'][_0x6b87('0x47')][_0x6b87('0x48')](_0x5a305e);return parseSearchFilter(_0xde979d,_0x188f41[_0x6b87('0x5b')]);})[_0x6b87('0x59')](function(_0x36fde7){_0x2afc1e[_0x6b87('0x5b')]=_0x36fde7;return _0x2afc1e;});}function checkAccountsRestrictions(_0x17fd06,_0x51e6df,_0x1d0756){var _0x19ea9a=utils[_0x6b87('0x3')](_0x17fd06);var _0x26da65=_0x6b87('0x5c')+_[_0x6b87('0x5d')](_0x17fd06)+(_0x17fd06===_0x6b87('0x5e')?_0x6b87('0x5f'):'Accounts');var _0x321e8b=squel[_0x6b87('0x1f')]();return Promise[_0x6b87('0x60')]()[_0x6b87('0x59')](function(){if(_0x1d0756[_0x6b87('0x5')]&&_0x51e6df[_0x6b87('0x4')]===_0x6b87('0x61')){return _0x51e6df[_0x26da65]({'attributes':['id'],'raw':!![]});}})[_0x6b87('0x59')](function(_0x345485){if(_0x345485){if(_0x345485[_0x6b87('0x33')]===0x0){_0x321e8b['and']('i.'+_0x19ea9a+'\x20IS\x20NULL');}else{_0x321e8b['and']('i.'+_0x19ea9a+_0x6b87('0x4f'),_[_0x6b87('0x45')](_0x345485,'id'));}}else if(!_0x1d0756[_0x19ea9a]){_0x321e8b['and']('i.'+_0x19ea9a+_0x6b87('0x62'));}})['then'](function(){return _0x321e8b;});}function getClosedOrderClause(_0x237678,_0x64d24b){var _0x4eeb1a='';var _0x54417f=[_0x6b87('0x63'),_0x6b87('0x64'),_0x6b87('0x65')];if(_0x237678===_0x6b87('0x2d')){_0x54417f[_0x6b87('0x66')](_0x6b87('0x67'));}if(_0x64d24b[_0x6b87('0x68')]==='0'&&_0x237678==='mail'){_0x4eeb1a=_0x6b87('0x67');}else{if(_0x64d24b[_0x6b87('0x68')]==='1'){_0x54417f[_0x6b87('0x69')]();}_0x4eeb1a=_0x6b87('0x6a')+_0x54417f[_0x6b87('0x6b')](',\x20')+')';}return _0x4eeb1a;}function getFilteredInteractions(_0x372fb5,_0x4a7e53,_0x3408f8,_0x30bd9d){var _0x41cb9e=utils[_0x6b87('0x9')](_0x372fb5);var _0x2f5577=_[_0x6b87('0x5d')](_0x372fb5)+'Interaction';var _0x58835f=[];var _0x11ac8e=getTagsQuery();var _0x3dfda8={'type':db[_0x6b87('0x6c')]['QueryTypes'][_0x6b87('0x6d')],'raw':!![]};var _0x80e431=[];var _0x1e34ef=[];return db[_0x6b87('0x6e')][_0x6b87('0x6f')](_0x11ac8e[_0x6b87('0x70')](),_0x3dfda8)[_0x6b87('0x59')](function(_0x40fafe){_0x58835f=_[_0x6b87('0x71')](_0x40fafe,'id');_0x3dfda8=_['merge'](_0x3dfda8,{'model':db[_0x2f5577],'mapToModel':!![],'nest':!![]});if(_0x3408f8[_0x6b87('0x72')]){_0x30bd9d[_0x6b87('0x73')][_0x6b87('0x4e')](function(_0x486484){_0x4a7e53[_0x6b87('0x7')]('i.'+_0x486484);});}else{_0x4a7e53[_0x6b87('0x7')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x74'),_0x6b87('0x75'));_0x4a7e53[_0x6b87('0x7')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x372fb5===_0x6b87('0x2d')){_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x76'),_0x6b87('0x77'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x78'),_0x6b87('0x79'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x7a'));_0x4a7e53['field'](_0x6b87('0x7b'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x7c'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x7d'));_0x4a7e53['field'](_0x6b87('0x7e'));_0x4a7e53[_0x6b87('0x7')]('i.attach');_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x7f'));_0x4a7e53['field'](_0x6b87('0x80'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x81'));_0x4a7e53['field'](_0x6b87('0x65'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x64'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x63'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x67'));_0x4a7e53['field'](_0x6b87('0x82'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x83'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x84'));_0x4a7e53[_0x6b87('0x7')]('i.UserId');}else if(_0x372fb5===_0x6b87('0x2a')){_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x85'),_0x6b87('0x79'));}else{_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x86'),_0x6b87('0x79'));}if(_0x372fb5!==_0x6b87('0x2d')){_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x87'));}_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x88'),_0x6b87('0x89'));_0x4a7e53[_0x6b87('0x7')]('c.lastName','Contact.lastName');_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x8a'),_0x6b87('0x8b'));_0x4a7e53['field']('c.phone',_0x6b87('0x8c'));_0x4a7e53[_0x6b87('0x7')]('c.mobile',_0x6b87('0x8d'));_0x4a7e53[_0x6b87('0x7')]('c.fax',_0x6b87('0x8e'));_0x4a7e53['field'](_0x6b87('0x8f'),'Owner.fullname');_0x4a7e53['field'](_0x6b87('0x90'),_0x6b87('0x91'));_0x4a7e53[_0x6b87('0x7')](_0x6b87('0x92'),'TagIds');}if(_0x30bd9d['limit']){_0x4a7e53['limit'](_0x30bd9d['limit']);}if(_0x30bd9d[_0x6b87('0x93')]){_0x4a7e53['offset'](_0x30bd9d[_0x6b87('0x93')]);}return db[_0x6b87('0x6e')][_0x6b87('0x6f')](_0x4a7e53[_0x6b87('0x70')](),_0x3dfda8);})[_0x6b87('0x59')](function(_0x44722b){_0x80e431=_0x44722b;var _0x30d254=getUsersQuery(_0x372fb5,_0x80e431);return db[_0x6b87('0x6e')][_0x6b87('0x6f')](_0x30d254[_0x6b87('0x70')](),_0x3dfda8);})[_0x6b87('0x59')](function(_0x2dc714){_0x1e34ef=_[_0x6b87('0x94')](_0x2dc714,_0x41cb9e);if(_0x372fb5===_0x6b87('0x2d')){return db[_0x6b87('0x95')][_0x6b87('0x96')]({'attributes':[_0x6b87('0x97')],'raw':!![]});}})[_0x6b87('0x59')](function(_0x5ace90){var _0x11346b=_0x5ace90?_0x5ace90[_0x6b87('0x97')]:undefined;var _0x2e7875=_0x80e431[_0x6b87('0x45')](function(_0x1c7d70){return updateInteraction(_0x1c7d70,_0x58835f,_0x1e34ef,_0x11346b);});return Promise['all'](_0x2e7875);});}function countFilteredInteractions(_0x21f67f,_0x548f68){var _0x3b0b65=_0x21f67f['clone']();_0x3b0b65['field'](_0x6b87('0x98'));_0x3b0b65[_0x6b87('0x7')](_0x6b87('0x99'),'unreadMessages');var _0xfa3658=utils[_0x6b87('0x20')](_0x548f68);if(!_[_0x6b87('0x9a')](_0xfa3658)){_0x3b0b65[_0x6b87('0x13')](_0x6b87('0x9b'),_0xfa3658);}var _0x54c8e7={'type':db[_0x6b87('0x6c')][_0x6b87('0x9c')][_0x6b87('0x6d')],'raw':!![]};return db[_0x6b87('0x6e')][_0x6b87('0x6f')](_0x3b0b65[_0x6b87('0x70')](),_0x54c8e7);}module[_0x6b87('0x9d')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 42db5a5..7d7ba68 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdac5=['updateInteraction','Users','TagIds','then','Tags','catch','lodash','../../mysqldb','split','forEach','push','waiting','answered','unmanaged','abandoned','total','closed','disposition','UserId','talking','MailMessage','findOne','out','plainBody','-id','lastMsgText'];(function(_0x46e0e9,_0xc21d70){var _0x34cff8=function(_0x5f3d5b){while(--_0x5f3d5b){_0x46e0e9['push'](_0x46e0e9['shift']());}};_0x34cff8(++_0xc21d70);}(_0xdac5,0x1f4));var _0x5dac=function(_0x5d716f,_0x1dd829){_0x5d716f=_0x5d716f-0x0;var _0x3b6574=_0xdac5[_0x5d716f];return _0x3b6574;};'use strict';var _=require(_0x5dac('0x0'));var db=require(_0x5dac('0x1'))['db'];function getInteractionUsers(_0x306a89,_0x4f0bd8){return new Promise(function(_0x443fce,_0x1c9a8d){try{var _0x3e2fa6=[];if(_0x4f0bd8[_0x306a89]){_0x3e2fa6=_0x4f0bd8[_0x306a89]['map'](function(_0x2ce828){return{'id':_0x2ce828['id'],'fullname':_0x2ce828['fullname']};});}return _0x443fce(_0x3e2fa6);}catch(_0x4f4eed){_0x1c9a8d(_0x4f4eed);}});}function getInteractionTags(_0x3c1694,_0x2beb55){var _0x55b067=[];if(_0x3c1694){_0x3c1694[_0x5dac('0x2')](',')[_0x5dac('0x3')](function(_0x2fd488){_0x55b067[_0x5dac('0x4')](_0x2beb55[_0x2fd488]);});}return _0x55b067;}function updateWaitingCounter(_0x166b79){if(_0x166b79['waiting']){_0x166b79[_0x5dac('0x5')]-=0x1;}}function updateInteractionCounters(_0x2b9fc4){_0x2b9fc4[_0x5dac('0x5')]=0x0;_0x2b9fc4['talking']=0x0;_0x2b9fc4[_0x5dac('0x6')]=0x0;_0x2b9fc4[_0x5dac('0x7')]=0x0;_0x2b9fc4[_0x5dac('0x8')]=0x0;_0x2b9fc4[_0x5dac('0x9')]=0x0;if(_0x2b9fc4[_0x5dac('0xa')]){if(_0x2b9fc4[_0x5dac('0xb')]==='abandoned'){_0x2b9fc4[_0x5dac('0x8')]+=0x1;updateWaitingCounter(_0x2b9fc4);}if(_0x2b9fc4[_0x5dac('0xc')]){_0x2b9fc4['answered']+=0x1;if(_0x2b9fc4[_0x5dac('0xd')]){_0x2b9fc4[_0x5dac('0xd')]-=0x1;}}else{if(_0x2b9fc4[_0x5dac('0xb')]){_0x2b9fc4[_0x5dac('0x7')]+=0x1;updateWaitingCounter(_0x2b9fc4);}}}else{if(!_0x2b9fc4[_0x5dac('0xc')]){_0x2b9fc4['waiting']+=0x1;}if(_0x2b9fc4[_0x5dac('0xc')]){_0x2b9fc4[_0x5dac('0xd')]+=0x1;updateWaitingCounter(_0x2b9fc4);}}_0x2b9fc4[_0x5dac('0x9')]+=0x1;return _0x2b9fc4;}function getLastMessageText(_0x562c59){return db[_0x5dac('0xe')][_0x5dac('0xf')]({'where':{'$and':[{'MailInteractionId':_0x562c59['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5dac('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5dac('0x11')],'order':_0x5dac('0x12'),'raw':!![]})['then'](function(_0x3a9d7a){if(_0x3a9d7a&&_0x3a9d7a[_0x5dac('0x11')]){_0x562c59[_0x5dac('0x13')]=_['trimStart'](_0x3a9d7a[_0x5dac('0x11')]);}return _0x562c59;})['catch'](function(_0x26f6bc){throw _0x26f6bc;});}exports[_0x5dac('0x14')]=function(_0x102fe6,_0x227ffb,_0x5a3920,_0x30061a){return new Promise(function(_0x422b98,_0x3ec80b){return getInteractionUsers(_0x102fe6['id'],_0x5a3920)['then'](function(_0x584b6){_0x102fe6[_0x5dac('0x15')]=_0x584b6;return getInteractionTags(_0x102fe6[_0x5dac('0x16')],_0x227ffb);})[_0x5dac('0x17')](function(_0x1370f4){_0x102fe6[_0x5dac('0x18')]=_0x1370f4;delete _0x102fe6[_0x5dac('0x16')];return updateInteractionCounters(_0x102fe6);})['then'](function(_0x55a333){if(_0x30061a){return getLastMessageText(_0x55a333);}else{return _0x55a333;}})[_0x5dac('0x17')](function(_0x36d8cd){_0x422b98(_0x36d8cd);})[_0x5dac('0x19')](function(_0x54333a){_0x3ec80b(_0x54333a);});});}; \ No newline at end of file +var _0x6819=['unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','out','plainBody','-id','catch','updateInteraction','TagIds','Tags','then','lodash','../../mysqldb','map','fullname','split','push','waiting','talking'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6819,0x6b));var _0x9681=function(_0x3daefd,_0x5ed99c){_0x3daefd=_0x3daefd-0x0;var _0x2c1315=_0x6819[_0x3daefd];return _0x2c1315;};'use strict';var _=require(_0x9681('0x0'));var db=require(_0x9681('0x1'))['db'];function getInteractionUsers(_0x134446,_0x103ad1){return new Promise(function(_0x5ccb24,_0x3f08e4){try{var _0x3bcf47=[];if(_0x103ad1[_0x134446]){_0x3bcf47=_0x103ad1[_0x134446][_0x9681('0x2')](function(_0x2a5c61){return{'id':_0x2a5c61['id'],'fullname':_0x2a5c61[_0x9681('0x3')]};});}return _0x5ccb24(_0x3bcf47);}catch(_0x8b2d65){_0x3f08e4(_0x8b2d65);}});}function getInteractionTags(_0x3cd5e8,_0x5ba314){var _0x11a53a=[];if(_0x3cd5e8){_0x3cd5e8[_0x9681('0x4')](',')['forEach'](function(_0x5c8fae){_0x11a53a[_0x9681('0x5')](_0x5ba314[_0x5c8fae]);});}return _0x11a53a;}function updateWaitingCounter(_0x525de8){if(_0x525de8[_0x9681('0x6')]){_0x525de8['waiting']-=0x1;}}function updateInteractionCounters(_0x5ddaae){_0x5ddaae[_0x9681('0x6')]=0x0;_0x5ddaae[_0x9681('0x7')]=0x0;_0x5ddaae['answered']=0x0;_0x5ddaae[_0x9681('0x8')]=0x0;_0x5ddaae[_0x9681('0x9')]=0x0;_0x5ddaae[_0x9681('0xa')]=0x0;if(_0x5ddaae[_0x9681('0xb')]){if(_0x5ddaae[_0x9681('0xc')]===_0x9681('0x9')){_0x5ddaae[_0x9681('0x9')]+=0x1;updateWaitingCounter(_0x5ddaae);}if(_0x5ddaae[_0x9681('0xd')]){_0x5ddaae['answered']+=0x1;if(_0x5ddaae[_0x9681('0x7')]){_0x5ddaae[_0x9681('0x7')]-=0x1;}}else{if(_0x5ddaae['disposition']){_0x5ddaae[_0x9681('0x8')]+=0x1;updateWaitingCounter(_0x5ddaae);}}}else{if(!_0x5ddaae[_0x9681('0xd')]){_0x5ddaae[_0x9681('0x6')]+=0x1;}if(_0x5ddaae[_0x9681('0xd')]){_0x5ddaae[_0x9681('0x7')]+=0x1;updateWaitingCounter(_0x5ddaae);}}_0x5ddaae[_0x9681('0xa')]+=0x1;return _0x5ddaae;}function getLastMessageText(_0x3d948a){return db[_0x9681('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x3d948a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9681('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9681('0x10')],'order':_0x9681('0x11'),'raw':!![]})['then'](function(_0x48ac7c){if(_0x48ac7c&&_0x48ac7c[_0x9681('0x10')]){_0x3d948a['lastMsgText']=_['trimStart'](_0x48ac7c[_0x9681('0x10')]);}return _0x3d948a;})[_0x9681('0x12')](function(_0xd915f4){throw _0xd915f4;});}exports[_0x9681('0x13')]=function(_0x2d46f4,_0x2da5b3,_0x12b6a1,_0x478d3f){return new Promise(function(_0x331797,_0x13a7c6){return getInteractionUsers(_0x2d46f4['id'],_0x12b6a1)['then'](function(_0x38466e){_0x2d46f4['Users']=_0x38466e;return getInteractionTags(_0x2d46f4[_0x9681('0x14')],_0x2da5b3);})['then'](function(_0x3abeb0){_0x2d46f4[_0x9681('0x15')]=_0x3abeb0;delete _0x2d46f4['TagIds'];return updateInteractionCounters(_0x2d46f4);})[_0x9681('0x16')](function(_0x409404){if(_0x478d3f){return getLastMessageText(_0x409404);}else{return _0x409404;}})[_0x9681('0x16')](function(_0x50966e){_0x331797(_0x50966e);})[_0x9681('0x12')](function(_0x17d135){_0x13a7c6(_0x17d135);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 7d30919..e8c160e 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25cb=['user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','info','catch','exports','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages'];(function(_0x184a95,_0x500731){var _0x55eadf=function(_0x49fcd7){while(--_0x49fcd7){_0x184a95['push'](_0x184a95['shift']());}};_0x55eadf(++_0x500731);}(_0x25cb,0x1bf));var _0xb25c=function(_0x312931,_0x22e92b){_0x312931=_0x312931-0x0;var _0xdf26e5=_0x25cb[_0x312931];return _0xdf26e5;};'use strict';var _=require(_0xb25c('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xb25c('0x1'))(_0xb25c('0x2')),'mail':require(_0xb25c('0x1'))('mail-interactions'),'fax':require(_0xb25c('0x1'))(_0xb25c('0x3')),'sms':require(_0xb25c('0x1'))(_0xb25c('0x4')),'chat':require(_0xb25c('0x1'))(_0xb25c('0x5')),'whatsapp':require(_0xb25c('0x1'))(_0xb25c('0x6'))};function getAccountFK(_0x272931){return _[_0xb25c('0x7')](_0x272931)+(_0x272931===_0xb25c('0x8')?_0xb25c('0x9'):_0xb25c('0xa'))+'Id';}function getInteractionFK(_0x371742){return _[_0xb25c('0x7')](_0x371742)+_0xb25c('0xb');}function getInteractionId(_0x5d8dfa,_0x2bcdd2,_0x188434){if(_0x5d8dfa&&_0x5d8dfa[_[_0xb25c('0xc')](_0x188434)+_0xb25c('0xb')]){return _0x5d8dfa[_[_0xb25c('0xc')](_0x188434)+_0xb25c('0xb')];}else if(_0x5d8dfa&&_0x5d8dfa['id']){return _0x5d8dfa['id'];}else if(_0x2bcdd2&&_0x2bcdd2['id']){return _0x2bcdd2['id'];}else{return _0xb25c('0xd');}}function getInteractionsTables(_0x50461c){return{'accounts':_0x50461c+'_'+(_0x50461c===_0xb25c('0x8')?_0xb25c('0xe'):_0xb25c('0xf')),'interactions':_0x50461c+_0xb25c('0x10'),'interactionsTags':_0x50461c+'_interaction_has_tags','messages':_0x50461c+_0xb25c('0x11'),'userInteractions':_0xb25c('0x12')+_0x50461c+_0xb25c('0x10')};}function getSelectedTags(_0x44391f){var _0x56e829=[];if(_0x44391f){_0x56e829=Array[_0xb25c('0x13')](_0x44391f)?_0x44391f:[_0x44391f];}return _0x56e829;}function log(_0x3dd8e6,_0x630e5f,_0x6bb718,_0x3964c8,_0x196629,_0x600b3b){loggers[_0x196629['toLowerCase']()][_0x3dd8e6](_0xb25c('0x14'),_0x600b3b[_0xb25c('0x15')](),_0x630e5f?_0x630e5f['id']:null,_0x630e5f?_0x630e5f[_0xb25c('0x16')]:null,_0x630e5f?_0x630e5f['role']:null,getInteractionId(_0x6bb718,_0x3964c8,_0x196629),_0x6bb718?JSON[_0xb25c('0x17')](_0x6bb718):_0xb25c('0x18'));}function updateUser(_0x1de85e,_0x4bc26b,_0x3699bf,_0x3417ac,_0x5763f7){db[_[_0xb25c('0xc')](_0x3417ac)+_0xb25c('0x19')][_0xb25c('0x1a')]({'where':{'id':getInteractionId(_0x4bc26b,_0x3699bf,_0x3417ac)}})[_0xb25c('0x1b')](function(_0x3b6750){if(_0x3b6750){return _0x3b6750['update']({'UserId':_0x1de85e?_0x1de85e['id']:null});}})[_0xb25c('0x1b')](function(_0x4654d0){if(_0x4654d0){log(_0xb25c('0x1c'),_0x1de85e,_0x4bc26b,_0x3699bf,_0x3417ac,_0x5763f7);}})[_0xb25c('0x1d')](function(){log('error',_0x1de85e,_0x4bc26b,_0x3699bf,_0x3417ac,_0x5763f7);});}module[_0xb25c('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x83e5=['_interaction_has_tags','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','then','update','info','catch','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','unknown','websites','accounts'];(function(_0x3655e5,_0x469eae){var _0x37dfac=function(_0x4378d2){while(--_0x4378d2){_0x3655e5['push'](_0x3655e5['shift']());}};_0x37dfac(++_0x469eae);}(_0x83e5,0xc9));var _0x583e=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x83e5[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0x583e('0x0'));var db=require(_0x583e('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x583e('0x2')),'mail':require(_0x583e('0x3'))(_0x583e('0x4')),'fax':require(_0x583e('0x3'))(_0x583e('0x5')),'sms':require(_0x583e('0x3'))(_0x583e('0x6')),'chat':require(_0x583e('0x3'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x583e('0x7'))};function getAccountFK(_0x5a3c8e){return _[_0x583e('0x8')](_0x5a3c8e)+(_0x5a3c8e===_0x583e('0x9')?_0x583e('0xa'):_0x583e('0xb'))+'Id';}function getInteractionFK(_0x539f46){return _[_0x583e('0x8')](_0x539f46)+'InteractionId';}function getInteractionId(_0x571308,_0x316588,_0xa9da7e){if(_0x571308&&_0x571308[_['upperFirst'](_0xa9da7e)+_0x583e('0xc')]){return _0x571308[_['upperFirst'](_0xa9da7e)+_0x583e('0xc')];}else if(_0x571308&&_0x571308['id']){return _0x571308['id'];}else if(_0x316588&&_0x316588['id']){return _0x316588['id'];}else{return _0x583e('0xd');}}function getInteractionsTables(_0x11d445){return{'accounts':_0x11d445+'_'+(_0x11d445===_0x583e('0x9')?_0x583e('0xe'):_0x583e('0xf')),'interactions':_0x11d445+'_interactions','interactionsTags':_0x11d445+_0x583e('0x10'),'messages':_0x11d445+'_messages','userInteractions':'user_has_'+_0x11d445+_0x583e('0x11')};}function getSelectedTags(_0x519c9b){var _0x4c6553=[];if(_0x519c9b){_0x4c6553=Array[_0x583e('0x12')](_0x519c9b)?_0x519c9b:[_0x519c9b];}return _0x4c6553;}function log(_0x57a4ec,_0x261f1a,_0x14b516,_0x4f7054,_0x4d5162,_0x4af5a6){loggers[_0x4d5162[_0x583e('0x13')]()][_0x57a4ec](_0x583e('0x14'),_0x4af5a6['toUpperCase'](),_0x261f1a?_0x261f1a['id']:null,_0x261f1a?_0x261f1a[_0x583e('0x15')]:null,_0x261f1a?_0x261f1a[_0x583e('0x16')]:null,getInteractionId(_0x14b516,_0x4f7054,_0x4d5162),_0x14b516?JSON[_0x583e('0x17')](_0x14b516):_0x583e('0x18'));}function updateUser(_0x181ad0,_0x591193,_0x21b086,_0x265f22,_0x34ccc0){db[_['upperFirst'](_0x265f22)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x591193,_0x21b086,_0x265f22)}})[_0x583e('0x19')](function(_0x1151ee){if(_0x1151ee){return _0x1151ee[_0x583e('0x1a')]({'UserId':_0x181ad0?_0x181ad0['id']:null});}})['then'](function(_0x3c90fb){if(_0x3c90fb){log(_0x583e('0x1b'),_0x181ad0,_0x591193,_0x21b086,_0x265f22,_0x34ccc0);}})[_0x583e('0x1c')](function(){log(_0x583e('0x1d'),_0x181ad0,_0x591193,_0x21b086,_0x265f22,_0x34ccc0);});}module[_0x583e('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index bc7e1a8..f77004b 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 _0x3d2b=['createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','license','data1','split'];(function(_0x24a3f1,_0x5a50ac){var _0x1c8443=function(_0x582a4e){while(--_0x582a4e){_0x24a3f1['push'](_0x24a3f1['shift']());}};_0x1c8443(++_0x5a50ac);}(_0x3d2b,0x1a3));var _0xb3d2=function(_0x3ed370,_0x2c5ed5){_0x3ed370=_0x3ed370-0x0;var _0x407134=_0x3d2b[_0x3ed370];return _0x407134;};'use strict';var crypto=require(_0xb3d2('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0xb3d2('0x1'))['db'];var config=require(_0xb3d2('0x2'));function getValueFromLicense(_0x167465,_0x31a6e0){if(_0x167465&&_0x31a6e0){if(_0x31a6e0['data1']&&_0x31a6e0[_0xb3d2('0x3')]){var _0x16afee=_0x31a6e0[_0xb3d2('0x4')];var _0x48c5fc=_0x31a6e0[_0xb3d2('0x3')];var _0x287672=_0x16afee[_0xb3d2('0x5')]('-')[0x4];var _0x37b0a4=_0x16afee[_0xb3d2('0x5')]('-')[0x0];var _0x3eab8f=crypto[_0xb3d2('0x6')](_0xb3d2('0x7'),util[_0xb3d2('0x8')]('%s:%s:%s',_0x287672,_0x16afee,_0x37b0a4));var _0x181438=_0x3eab8f[_0xb3d2('0x9')](_0x48c5fc,_0xb3d2('0xa'),_0xb3d2('0xb'));_0x181438+=_0x3eab8f[_0xb3d2('0xc')](_0xb3d2('0xb'));var _0x3e7c2c=JSON[_0xb3d2('0xd')](_0x181438);return _0x3e7c2c[_0xb3d2('0xe')](_0x167465)?_0x3e7c2c[_0x167465]:null;}}return null;}function isLimit(_0x2be33d,_0xe4888a,_0xef5a56,_0xb5fa92){var _0x1681fb=_0xe4888a;return compose()[_0xb3d2('0xf')](function(_0x3334a1,_0x4dde9d,_0x2631ab){return db[_0xb3d2('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xb3d2('0x11')](function(_0x465e63){var _0x204400=getValueFromLicense(_0x2be33d,_0x465e63);return _0x204400?_0x204400:_0x1681fb;})[_0xb3d2('0x11')](function(_0xaeef73){_0x1681fb=_0xaeef73;return _0xef5a56[_0xb3d2('0x12')](_0xb5fa92);})[_0xb3d2('0x11')](function(_0x21189b){if(_0x21189b>=_0x1681fb){return _0x4dde9d['status'](0x193)['json']({'message':util[_0xb3d2('0x8')](_0xb3d2('0x13'),_0x2be33d)});}_0x2631ab();})['catch'](function(_0x3bcac8){_0x2631ab(_0x3bcac8);});});}function isUserLimit(){return isLimit(_0xb3d2('0x14'),0x1,db[_0xb3d2('0x15')],{'where':{'$or':[{'role':_0xb3d2('0x16')},{'role':_0xb3d2('0x17')}]}});}exports[_0xb3d2('0x18')]=isUserLimit; \ No newline at end of file +var _0x3abe=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','update','base64','utf8','final','parse','License','then','format'];(function(_0x15011,_0x5553f5){var _0x4fe3ec=function(_0x35e426){while(--_0x35e426){_0x15011['push'](_0x15011['shift']());}};_0x4fe3ec(++_0x5553f5);}(_0x3abe,0xcd));var _0xe3ab=function(_0xd46e4,_0x44fe54){_0xd46e4=_0xd46e4-0x0;var _0x37a7c1=_0x3abe[_0xd46e4];return _0x37a7c1;};'use strict';var crypto=require(_0xe3ab('0x0'));var util=require('util');var compose=require(_0xe3ab('0x1'));var db=require(_0xe3ab('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x53d3b5,_0x55f3fd){if(_0x53d3b5&&_0x55f3fd){if(_0x55f3fd[_0xe3ab('0x3')]&&_0x55f3fd[_0xe3ab('0x4')]){var _0x147837=_0x55f3fd['data1'];var _0x435110=_0x55f3fd[_0xe3ab('0x4')];var _0xcc4452=_0x147837[_0xe3ab('0x5')]('-')[0x4];var _0x38b700=_0x147837['split']('-')[0x0];var _0x2cca40=crypto[_0xe3ab('0x6')]('aes-256-ctr',util['format']('%s:%s:%s',_0xcc4452,_0x147837,_0x38b700));var _0x3f996b=_0x2cca40[_0xe3ab('0x7')](_0x435110,_0xe3ab('0x8'),_0xe3ab('0x9'));_0x3f996b+=_0x2cca40[_0xe3ab('0xa')](_0xe3ab('0x9'));var _0x516de1=JSON[_0xe3ab('0xb')](_0x3f996b);return _0x516de1['hasOwnProperty'](_0x53d3b5)?_0x516de1[_0x53d3b5]:null;}}return null;}function isLimit(_0x3da4de,_0x4995b0,_0xa236d2,_0x3ecc3d){var _0x4b5bfc=_0x4995b0;return compose()['use'](function(_0x5b6a48,_0x110720,_0x1c2f39){return db[_0xe3ab('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe3ab('0xd')](function(_0x1b5a71){var _0x3ca92d=getValueFromLicense(_0x3da4de,_0x1b5a71);return _0x3ca92d?_0x3ca92d:_0x4b5bfc;})[_0xe3ab('0xd')](function(_0x3a59c6){_0x4b5bfc=_0x3a59c6;return _0xa236d2['count'](_0x3ecc3d);})[_0xe3ab('0xd')](function(_0xfd8820){if(_0xfd8820>=_0x4b5bfc){return _0x110720['status'](0x193)['json']({'message':util[_0xe3ab('0xe')](_0xe3ab('0xf'),_0x3da4de)});}_0x1c2f39();})[_0xe3ab('0x10')](function(_0x598ae7){_0x1c2f39(_0x598ae7);});});}function isUserLimit(){return isLimit(_0xe3ab('0x11'),0x1,db[_0xe3ab('0x12')],{'where':{'$or':[{'role':_0xe3ab('0x13')},{'role':_0xe3ab('0x14')}]}});}exports[_0xe3ab('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 479cde4..285cedc 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 _0x051d=['field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','DATE','utcOffset','format','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','length','slice','shift','match','forEach','filter','indexOf','map','conditions','push','operator','$eq','$between','value','includes','$gt','add','YYYY-MM-DD','castTo','text'];(function(_0x145dba,_0x4e114d){var _0x456210=function(_0x4c0ea3){while(--_0x4c0ea3){_0x145dba['push'](_0x145dba['shift']());}};_0x456210(++_0x4e114d);}(_0x051d,0x192));var _0xd051=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x051d[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xd051('0x0'));var moment=require(_0xd051('0x1'));exports[_0xd051('0x2')]=function(_0x586f20){var _0x286169={'conditions':[]};_0x286169[_0xd051('0x3')]=_[_0xd051('0x4')](_0x586f20,_0xd051('0x5'))?'or':_0xd051('0x6');var _0x15ca90=_0x586f20['replace'](_0xd051('0x7'),'')[_0xd051('0x8')](_0xd051('0x5'),'')[_0xd051('0x9')]('||');for(var _0x446a02=0x0;_0x446a02<_0x15ca90[_0xd051('0xa')];_0x446a02++){var _0x114b24=_0x15ca90[_0x446a02][_0xd051('0x9')](':=');var _0x382f1d=_0x114b24[0x0];var _0x422964=_0x114b24[_0xd051('0xb')](0x1);_0x422964['forEach'](function(_0x5e07fb){var _0xea3694=_0x5e07fb['split']('[')[_0xd051('0xc')]();var _0x4bd49f=_0x5e07fb[_0xd051('0xd')](/\[(.*?)\]/g);_0x4bd49f[_0xd051('0xe')](function(_0x24d327){var _0x19ddfb=_0x24d327['split']('[')[_0xd051('0xf')](function(_0x2f81c5){return _0x2f81c5[_0xd051('0x10')](']')>-0x1;})[_0xd051('0x11')](function(_0x315ddf){return _0x315ddf[_0xd051('0x9')](']')[0x0];})[0x0];_0x286169[_0xd051('0x12')][_0xd051('0x13')]({'field':_0x382f1d,'operator':_0xea3694,'value':_0x19ddfb});});});}return _0x286169;};exports['buildExpression']=function(_0xb20e87,_0x286624,_0x3e47dd){var _0x5bcd86={};if(_0x286624==='DATE'){if(_0x3e47dd[_0xd051('0x14')]===_0xd051('0x15')){_0x3e47dd[_0xd051('0x14')]=_0xd051('0x16');_0x3e47dd[_0xd051('0x17')]+=','+_0x3e47dd[_0xd051('0x17')];}else if(_[_0xd051('0x18')]([_0xd051('0x19'),'$lte'],_0x3e47dd[_0xd051('0x14')])){_0x3e47dd['value']=moment(_0x3e47dd[_0xd051('0x17')])[_0xd051('0x1a')](0x1,'days')['format'](_0xd051('0x1b'));}}if(_0x3e47dd['castTo']){_0x286624=_0x3e47dd[_0xd051('0x1c')];_0x5bcd86[_0xd051('0x1d')]='CAST('+_0xb20e87+'.'+_0x3e47dd[_0xd051('0x1e')]+_0xd051('0x1f')+_0x3e47dd[_0xd051('0x1c')]+')\x20'+parseOperator(_0x3e47dd[_0xd051('0x14')]);}else{_0x5bcd86[_0xd051('0x1d')]=_0xb20e87+'.'+_0x3e47dd[_0xd051('0x1e')]+'\x20'+parseOperator(_0x3e47dd[_0xd051('0x14')]);}if(_[_0xd051('0x18')]([_0xd051('0x20'),_0xd051('0x21')],_0x3e47dd[_0xd051('0x14')]))_0x5bcd86[_0xd051('0x1d')]='('+_0x5bcd86['text']+_0xd051('0x22')+_0xb20e87+'.'+_0x3e47dd[_0xd051('0x1e')]+_0xd051('0x23');_0x5bcd86[_0xd051('0x17')]=parseValue(_0x286624,_0x3e47dd[_0xd051('0x14')],_0x3e47dd[_0xd051('0x17')]);return _0x5bcd86;};function parseOperator(_0x2ae83f){var _0x15cd60;switch(_0x2ae83f){case'$in':_0x15cd60='IN\x20?';break;case _0xd051('0x21'):_0x15cd60=_0xd051('0x24');break;case _0xd051('0x15'):_0x15cd60=_0xd051('0x25');break;case _0xd051('0x20'):_0x15cd60=_0xd051('0x26');break;case _0xd051('0x27'):case _0xd051('0x28'):case'$endsWith':_0x15cd60='LIKE\x20?';break;case _0xd051('0x29'):_0x15cd60=_0xd051('0x2a');break;case _0xd051('0x19'):_0x15cd60='>\x20?';break;case _0xd051('0x2b'):_0x15cd60=_0xd051('0x2c');break;case _0xd051('0x2d'):_0x15cd60='>=\x20?';break;case _0xd051('0x16'):_0x15cd60=_0xd051('0x2e');break;}return _0x15cd60;}function parseValue(_0x4c4239,_0x5442b2,_0x190773){var _0xc8e6aa={'start':undefined,'end':undefined};switch(_0x5442b2){case'$in':case _0xd051('0x21'):_0xc8e6aa[_0xd051('0x2f')]=_0x190773[_0xd051('0x9')](',');break;case _0xd051('0x27'):_0xc8e6aa['start']='%'+_0x190773+'%';break;case'$startsWith':_0xc8e6aa[_0xd051('0x2f')]=_0x190773+'%';break;case _0xd051('0x30'):_0xc8e6aa[_0xd051('0x2f')]='%'+_0x190773;break;case _0xd051('0x16'):var _0x450436=_0x190773['split'](',');var _0x190773=_0x450436[_0xd051('0xc')]();var _0x466a1f=_0x450436[_0xd051('0x31')]();if(_0x4c4239===_0xd051('0x32')){_0x190773=moment(_0x190773)[_0xd051('0x33')](0x0,!![])[_0xd051('0x34')]();_0x466a1f=moment(_0x466a1f)[_0xd051('0x33')](0x0,!![])['add'](0x17,'hours')[_0xd051('0x1a')](0x3b,'minutes')[_0xd051('0x1a')](0x3b,_0xd051('0x35'))[_0xd051('0x34')]();}_0xc8e6aa={'start':_0x190773,'end':_0x466a1f};break;default:_0xc8e6aa[_0xd051('0x2f')]=_0x190773;break;}return _0xc8e6aa;} \ No newline at end of file +var _0xfa78=['NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$lt','$gt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','$between','shift','pop','utcOffset','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','forEach','match','filter','indexOf','buildExpression','DATE','operator','$eq','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0xfa78,0x1d4));var _0x8fa7=function(_0xd0c6b5,_0x5c7ce8){_0xd0c6b5=_0xd0c6b5-0x0;var _0x4b4d90=_0xfa78[_0xd0c6b5];return _0x4b4d90;};'use strict';var _=require('lodash');var moment=require(_0x8fa7('0x0'));exports[_0x8fa7('0x1')]=function(_0x56b866){var _0x5d7507={'conditions':[]};_0x5d7507[_0x8fa7('0x2')]=_[_0x8fa7('0x3')](_0x56b866,_0x8fa7('0x4'))?'or':'and';var _0x3a1d92=_0x56b866[_0x8fa7('0x5')]('[$and]','')[_0x8fa7('0x5')](_0x8fa7('0x4'),'')[_0x8fa7('0x6')]('||');for(var _0x4091c4=0x0;_0x4091c4<_0x3a1d92[_0x8fa7('0x7')];_0x4091c4++){var _0x406213=_0x3a1d92[_0x4091c4]['split'](':=');var _0x1d0d93=_0x406213[0x0];var _0x5558fc=_0x406213['slice'](0x1);_0x5558fc[_0x8fa7('0x8')](function(_0x3fbc41){var _0x14836e=_0x3fbc41[_0x8fa7('0x6')]('[')['shift']();var _0x255c77=_0x3fbc41[_0x8fa7('0x9')](/\[(.*?)\]/g);_0x255c77[_0x8fa7('0x8')](function(_0x4dedaa){var _0x129f17=_0x4dedaa[_0x8fa7('0x6')]('[')[_0x8fa7('0xa')](function(_0x46038a){return _0x46038a[_0x8fa7('0xb')](']')>-0x1;})['map'](function(_0x12550d){return _0x12550d[_0x8fa7('0x6')](']')[0x0];})[0x0];_0x5d7507['conditions']['push']({'field':_0x1d0d93,'operator':_0x14836e,'value':_0x129f17});});});}return _0x5d7507;};exports[_0x8fa7('0xc')]=function(_0xb82681,_0x2c57b4,_0x38d437){var _0x373670={};if(_0x2c57b4===_0x8fa7('0xd')){if(_0x38d437[_0x8fa7('0xe')]===_0x8fa7('0xf')){_0x38d437[_0x8fa7('0xe')]='$between';_0x38d437[_0x8fa7('0x10')]+=','+_0x38d437[_0x8fa7('0x10')];}else if(_[_0x8fa7('0x11')](['$gt',_0x8fa7('0x12')],_0x38d437[_0x8fa7('0xe')])){_0x38d437[_0x8fa7('0x10')]=moment(_0x38d437['value'])[_0x8fa7('0x13')](0x1,_0x8fa7('0x14'))[_0x8fa7('0x15')](_0x8fa7('0x16'));}}if(_0x38d437[_0x8fa7('0x17')]){_0x2c57b4=_0x38d437['castTo'];_0x373670[_0x8fa7('0x18')]=_0x8fa7('0x19')+_0xb82681+'.'+_0x38d437[_0x8fa7('0x1a')]+_0x8fa7('0x1b')+_0x38d437[_0x8fa7('0x17')]+')\x20'+parseOperator(_0x38d437[_0x8fa7('0xe')]);}else{_0x373670[_0x8fa7('0x18')]=_0xb82681+'.'+_0x38d437[_0x8fa7('0x1a')]+'\x20'+parseOperator(_0x38d437[_0x8fa7('0xe')]);}if(_[_0x8fa7('0x11')](['$ne',_0x8fa7('0x1c')],_0x38d437[_0x8fa7('0xe')]))_0x373670[_0x8fa7('0x18')]='('+_0x373670[_0x8fa7('0x18')]+_0x8fa7('0x1d')+_0xb82681+'.'+_0x38d437[_0x8fa7('0x1a')]+_0x8fa7('0x1e');_0x373670[_0x8fa7('0x10')]=parseValue(_0x2c57b4,_0x38d437[_0x8fa7('0xe')],_0x38d437[_0x8fa7('0x10')]);return _0x373670;};function parseOperator(_0x4412ef){var _0x318e93;switch(_0x4412ef){case'$in':_0x318e93=_0x8fa7('0x1f');break;case'$notIn':_0x318e93=_0x8fa7('0x20');break;case _0x8fa7('0xf'):_0x318e93='=\x20?';break;case _0x8fa7('0x21'):_0x318e93=_0x8fa7('0x22');break;case _0x8fa7('0x23'):case _0x8fa7('0x24'):case'$endsWith':_0x318e93='LIKE\x20?';break;case _0x8fa7('0x25'):_0x318e93='<\x20?';break;case _0x8fa7('0x26'):_0x318e93=_0x8fa7('0x27');break;case _0x8fa7('0x12'):_0x318e93=_0x8fa7('0x28');break;case _0x8fa7('0x29'):_0x318e93='>=\x20?';break;case'$between':_0x318e93=_0x8fa7('0x2a');break;}return _0x318e93;}function parseValue(_0x60abb6,_0x253e2e,_0x1def76){var _0x487d51={'start':undefined,'end':undefined};switch(_0x253e2e){case _0x8fa7('0x2b'):case _0x8fa7('0x1c'):_0x487d51[_0x8fa7('0x2c')]=_0x1def76[_0x8fa7('0x6')](',');break;case _0x8fa7('0x23'):_0x487d51[_0x8fa7('0x2c')]='%'+_0x1def76+'%';break;case _0x8fa7('0x24'):_0x487d51[_0x8fa7('0x2c')]=_0x1def76+'%';break;case'$endsWith':_0x487d51[_0x8fa7('0x2c')]='%'+_0x1def76;break;case _0x8fa7('0x2d'):var _0x2adac2=_0x1def76['split'](',');var _0x1def76=_0x2adac2[_0x8fa7('0x2e')]();var _0x301b71=_0x2adac2[_0x8fa7('0x2f')]();if(_0x60abb6==='DATE'){_0x1def76=moment(_0x1def76)[_0x8fa7('0x30')](0x0,!![])[_0x8fa7('0x15')]();_0x301b71=moment(_0x301b71)[_0x8fa7('0x30')](0x0,!![])[_0x8fa7('0x13')](0x17,'hours')['add'](0x3b,'minutes')[_0x8fa7('0x13')](0x3b,_0x8fa7('0x31'))[_0x8fa7('0x15')]();}_0x487d51={'start':_0x1def76,'end':_0x301b71};break;default:_0x487d51['start']=_0x1def76;break;}return _0x487d51;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bb23e84..fb5ebbb 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 _0xcb26=['parse','keys','includes','alias','fields','raw','split','filters','isEmpty','find','type','isPlainObject','format','utc','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isObject','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','where','pick','filter','columns','value','merge','VIRTUAL','lower','include','includeAll','sequelize','moment','../../mysqldb'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xcb26,0x14c));var _0x6cb2=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xcb26[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var sequelize=require(_0x6cb2('0x0'));var moment=require(_0x6cb2('0x1'));var db=require(_0x6cb2('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x310da3){var _0x2c7ad2=['ne'];try{var _0x5b31c1=JSON[_0x6cb2('0x3')](_0x310da3);var _0x4bd770=Object[_0x6cb2('0x4')](_0x5b31c1)[0x0];return _0x2c7ad2[_0x6cb2('0x5')](_0x4bd770);}catch(_0x24180d){return![];}}function getOperatorValue(_0x2d8bce){var _0x172745=JSON[_0x6cb2('0x3')](_0x2d8bce);var _0x5e05b3=Object['keys'](_0x172745)[0x0];var _0x2a295b=_0x172745[_0x5e05b3];return{['$'+_0x5e05b3]:_0x2a295b};}function parseIncludeModel(_0x39aa99){var _0x73954e=JSON[_0x6cb2('0x3')](_0x39aa99);return{'model':db[_0x73954e['model']],'as':_0x73954e[_0x6cb2('0x6')],'attributes':_0x73954e[_0x6cb2('0x7')],'raw':_0x73954e[_0x6cb2('0x8')]};}exports[_0x6cb2('0x7')]=function(_0x59032f){var _0x230b5f=null;if(_0x59032f){_0x230b5f=_0x59032f[_0x6cb2('0x9')](',');}return _0x230b5f;};exports[_0x6cb2('0xa')]=function(_0x5c126b,_0x54af35){var _0xf186fb={};if(!_[_0x6cb2('0xb')](_0x5c126b)){_['forOwn'](_0x5c126b,function(_0x546d65,_0x3ae294){try{if(_0x54af35){var _0x2eb2d4=_[_0x6cb2('0xc')](_0x54af35,{'name':_0x3ae294})||{};if(hasSequelizeOperator(_0x546d65)){_0xf186fb[_0x3ae294]=getOperatorValue(_0x546d65);}else if(_0x2eb2d4[_0x6cb2('0xd')]==='DATE'&&_[_0x6cb2('0xe')](_0x546d65)){var _0x51398c=JSON['parse'](_0x546d65);var _0x40706f={'$gte':moment(moment(_0x51398c['$gte'])[_0x6cb2('0xf')]('YYYY-MM-DD'))[_0x6cb2('0x10')]()[_0x6cb2('0xf')](),'$lte':moment(moment(_0x51398c['$lte'])[_0x6cb2('0xf')](_0x6cb2('0x11')))[_0x6cb2('0x10')]()[_0x6cb2('0x12')](0x1,'s')[_0x6cb2('0xf')]()};_0xf186fb[_0x3ae294]=_0x40706f;}else if(_0x2eb2d4[_0x6cb2('0x13')]===_0x6cb2('0x14')){_0xf186fb[_0x3ae294]=_0x546d65;}else{_0xf186fb[_0x3ae294]=_['isArray'](_0x546d65)?_0x546d65:JSON[_0x6cb2('0x3')](_0x546d65);}}else{_0xf186fb[_0x3ae294]=_[_0x6cb2('0x15')](_0x546d65)?_0x546d65:JSON[_0x6cb2('0x3')](_0x546d65);}}catch(_0x3ae9da){_0xf186fb[_0x3ae294]=_0x546d65[_0x6cb2('0x9')](',');}});}return _0xf186fb;};exports[_0x6cb2('0x16')]=function(_0x1073ae){_0x1073ae=parseInt(_0x1073ae,0xa);if(!_0x1073ae||_0x1073ae<0x0){_0x1073ae=LIMIT_VALUE;}return _0x1073ae;};exports[_0x6cb2('0x17')]=function(_0x4a2e67){_0x4a2e67=parseInt(_0x4a2e67,0xa);if(!_0x4a2e67||_0x4a2e67<0x0){_0x4a2e67=0x0;}return _0x4a2e67;};exports[_0x6cb2('0x18')]=function(_0x4d1dd6){var _0x6c3eff,_0x4c3bba=null;if(_0x4d1dd6){_0x6c3eff=_0x4d1dd6[_0x6cb2('0x9')](',');_0x4c3bba=_[_0x6cb2('0x19')](_0x6c3eff,function(_0x5f5688){if(_0x5f5688[_0x6cb2('0x1a')]('-')===0x0){return[_0x5f5688===_0x6cb2('0x1b')?sequelize[_0x6cb2('0x1c')](sequelize[_0x6cb2('0x1d')](_0x6cb2('0x1b')),_0x6cb2('0x1e')):_0x5f5688[_0x6cb2('0x1f')](0x1),'DESC'];}else{return[_0x5f5688===_0x6cb2('0x1b')?sequelize[_0x6cb2('0x1c')](sequelize['col'](_0x6cb2('0x1b')),'unsigned'):_0x5f5688,_0x6cb2('0x20')];}});}return _0x4c3bba;};exports[_0x6cb2('0x21')]=function(_0x22bc15,_0x1ac21e){if(_['isEmpty'](_0x22bc15)){return _0x22bc15;}if(_[_0x6cb2('0x15')](_0x22bc15)){for(var _0x5253da=0x0;_0x5253da<_0x22bc15['length'];_0x5253da+=0x1){_0x22bc15[_0x5253da]=this[_0x6cb2('0x21')](_0x22bc15[_0x5253da],_0x1ac21e);}return _0x22bc15;}if(!_[_0x6cb2('0x22')](_0x22bc15)){return _0x22bc15;}if(_['isString'](_0x1ac21e)){_0x1ac21e=[_0x1ac21e];}if(!_[_0x6cb2('0x15')](_0x1ac21e)){return _0x22bc15;}for(var _0x48db52=0x0;_0x48db52<_0x1ac21e[_0x6cb2('0x23')];_0x48db52+=0x1){_[_0x6cb2('0x24')](_0x22bc15,_0x1ac21e[_0x48db52]);}for(var _0x5cc052 in _0x22bc15){if(_0x22bc15[_0x6cb2('0x25')](_0x5cc052)){_0x22bc15[_0x5cc052]=this[_0x6cb2('0x21')](_0x22bc15[_0x5cc052],_0x1ac21e);}}return _0x22bc15;};exports[_0x6cb2('0x26')]=function(_0x5ce14e){return _0x5ce14e[_0x6cb2('0x27')](RegExp(_0x6cb2('0x28')))?!![]:![];};exports[_0x6cb2('0x29')]=function(_0x25c7bd){return _0x25c7bd['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x6cb2('0x2a')]=function(_0x4f4092,_0x298331){var _0x520001=[];var _0xed1b51=/[ `!@#$%^&*()_\-?~]/;var _0x2c27d4=_0x298331?_0x6cb2('0x2b'):_0x6cb2('0x2c');_0x4f4092[_0x6cb2('0x9')](/[ ,]+/)[_0x6cb2('0x2d')](function(_0x21aadc){_0x21aadc=_0x21aadc[_0x6cb2('0x2e')](/([^:]")"+/g,'$1');_0x21aadc='+'+_0x21aadc+'*';var _0x525c6a=_0x21aadc[_0x6cb2('0x27')](_0xed1b51);if(_0x525c6a){_0x21aadc='\x22'+_0x21aadc+'\x22';}_0x520001[_0x6cb2('0x2f')](_0x21aadc);});_0x2c27d4=_0x2c27d4[_0x6cb2('0x2e')](_0x6cb2('0x2c'),_0x520001[_0x6cb2('0x30')]('\x20'));return _0x2c27d4;};exports[_0x6cb2('0x31')]=function(_0x818ccd,_0x30b7f8,_0x46aa45){var _0x4739b4={},_0x24888f={};if(_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x33')]){_0x30b7f8['query']['id']=_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x33')];delete _0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x33')];}_0x4739b4[_0x6cb2('0x34')]=_[_0x6cb2('0x19')](_0x818ccd,_0x6cb2('0x13'));_0x4739b4[_0x6cb2('0x32')]=_[_0x6cb2('0x4')](_0x30b7f8[_0x6cb2('0x32')]);_0x4739b4[_0x6cb2('0xa')]=_[_0x6cb2('0x35')](_0x4739b4['model'],_0x4739b4[_0x6cb2('0x32')]);_0x24888f[_0x6cb2('0x36')]=_[_0x6cb2('0x35')](_0x4739b4['model'],this[_0x6cb2('0x7')](_0x30b7f8[_0x6cb2('0x32')]['fields']));_0x24888f[_0x6cb2('0x36')]=_0x24888f[_0x6cb2('0x36')][_0x6cb2('0x23')]?_0x24888f[_0x6cb2('0x36')]:_0x4739b4['model'];if(!_0x30b7f8[_0x6cb2('0x32')]['hasOwnProperty'](_0x6cb2('0x37'))){_0x24888f['limit']=this[_0x6cb2('0x16')](_0x30b7f8[_0x6cb2('0x32')]['limit']);_0x24888f[_0x6cb2('0x17')]=this['offset'](_0x30b7f8[_0x6cb2('0x32')]['offset']);}_0x24888f[_0x6cb2('0x38')]=this[_0x6cb2('0x18')](_0x30b7f8[_0x6cb2('0x32')]['sort']);_0x24888f[_0x6cb2('0x39')]=this[_0x6cb2('0xa')](_[_0x6cb2('0x3a')](_0x30b7f8[_0x6cb2('0x32')],_0x4739b4[_0x6cb2('0xa')]),_0x818ccd);if(_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x3b')]){var _0x518e80=_0x818ccd;var _0x2de2d0=_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x3b')];if(typeof _0x2de2d0==='object'){_0x518e80=_[_0x6cb2('0x3b')](_0x818ccd,function(_0x2a4d84){return _[_0x6cb2('0x5')](_0x2de2d0[_0x6cb2('0x3c')],_0x2a4d84[_0x6cb2('0x13')]);});_0x2de2d0=_0x2de2d0[_0x6cb2('0x3d')];}_0x24888f[_0x6cb2('0x39')]=_[_0x6cb2('0x3e')](_0x24888f[_0x6cb2('0x39')],{'$or':_['map'](_0x518e80,function(_0xbac530){if(_0xbac530[_0x6cb2('0xd')]!==_0x6cb2('0x3f')){if(_0x46aa45){return sequelize[_0x6cb2('0x39')](sequelize['fn'](_0x6cb2('0x40'),sequelize[_0x6cb2('0x1d')](_0xbac530[_0x6cb2('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x3b')]+'%')});}else{var _0x574ecc={};_0x574ecc[_0xbac530[_0x6cb2('0x13')]]={'$like':'%'+_0x30b7f8[_0x6cb2('0x32')][_0x6cb2('0x3b')]+'%'};return _0x574ecc;}}})});}_0x24888f=_['merge']({},_0x24888f,_0x30b7f8['options']);return _0x24888f;};exports[_0x6cb2('0x41')]=function(_0x425e98){var _0x1edb56=[];if(_0x425e98[_0x6cb2('0x42')]){_0x1edb56['push']({'all':!![]});}else if(_0x425e98[_0x6cb2('0x41')]){if(Array[_0x6cb2('0x15')](_0x425e98[_0x6cb2('0x41')])){_0x1edb56=Object[_0x6cb2('0x4')](_0x425e98[_0x6cb2('0x41')])[_0x6cb2('0x19')](function(_0x46a4a0){return parseIncludeModel(_0x425e98[_0x6cb2('0x41')][_0x46a4a0]);});}else{var _0x588140=parseIncludeModel(_0x425e98[_0x6cb2('0x41')]);_0x1edb56[_0x6cb2('0x2f')](_0x588140);}}return _0x1edb56;}; \ No newline at end of file +var _0x58f4=['isEmail','getFullTextValue','\x22{EXPR}\x22','replace','push','{EXPR}','join','getOptions','query','$id','name','intersection','attributes','nolimit','offset','order','sort','where','pick','filter','object','value','VIRTUAL','lower','merge','include','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$'];(function(_0xd46054,_0xfced24){var _0x1200d2=function(_0x5d7c28){while(--_0x5d7c28){_0xd46054['push'](_0xd46054['shift']());}};_0x1200d2(++_0xfced24);}(_0x58f4,0x1b2));var _0x458f=function(_0x3d9327,_0x57463e){_0x3d9327=_0x3d9327-0x0;var _0x5eef27=_0x58f4[_0x3d9327];return _0x5eef27;};'use strict';var _=require('lodash');var sequelize=require(_0x458f('0x0'));var moment=require(_0x458f('0x1'));var db=require(_0x458f('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x7f727c){var _0x467122=['ne'];try{var _0x1ea809=JSON[_0x458f('0x3')](_0x7f727c);var _0x1a7469=Object[_0x458f('0x4')](_0x1ea809)[0x0];return _0x467122[_0x458f('0x5')](_0x1a7469);}catch(_0x19fac1){return![];}}function getOperatorValue(_0x103d54){var _0x5a1908=JSON['parse'](_0x103d54);var _0x5ad8b4=Object['keys'](_0x5a1908)[0x0];var _0x2a5c36=_0x5a1908[_0x5ad8b4];return{['$'+_0x5ad8b4]:_0x2a5c36};}function parseIncludeModel(_0x38f16c){var _0x4fdba0=JSON[_0x458f('0x3')](_0x38f16c);return{'model':db[_0x4fdba0[_0x458f('0x6')]],'as':_0x4fdba0[_0x458f('0x7')],'attributes':_0x4fdba0[_0x458f('0x8')],'raw':_0x4fdba0[_0x458f('0x9')]};}exports[_0x458f('0x8')]=function(_0x71289e){var _0x52cf4e=null;if(_0x71289e){_0x52cf4e=_0x71289e[_0x458f('0xa')](',');}return _0x52cf4e;};exports[_0x458f('0xb')]=function(_0x3c7d85,_0xc17327){var _0x15dfdb={};if(!_[_0x458f('0xc')](_0x3c7d85)){_[_0x458f('0xd')](_0x3c7d85,function(_0x15614f,_0x217cd7){try{if(_0xc17327){var _0x515ea4=_[_0x458f('0xe')](_0xc17327,{'name':_0x217cd7})||{};if(hasSequelizeOperator(_0x15614f)){_0x15dfdb[_0x217cd7]=getOperatorValue(_0x15614f);}else if(_0x515ea4[_0x458f('0xf')]===_0x458f('0x10')&&_['isPlainObject'](_0x15614f)){var _0xa6fd16=JSON['parse'](_0x15614f);var _0x17972e={'$gte':moment(moment(_0xa6fd16[_0x458f('0x11')])[_0x458f('0x12')](_0x458f('0x13')))[_0x458f('0x14')]()['format'](),'$lte':moment(moment(_0xa6fd16[_0x458f('0x15')])[_0x458f('0x12')](_0x458f('0x13')))[_0x458f('0x14')]()[_0x458f('0x16')](0x1,'s')[_0x458f('0x12')]()};_0x15dfdb[_0x217cd7]=_0x17972e;}else if(_0x515ea4['name']===_0x458f('0x17')){_0x15dfdb[_0x217cd7]=_0x15614f;}else{_0x15dfdb[_0x217cd7]=_[_0x458f('0x18')](_0x15614f)?_0x15614f:JSON[_0x458f('0x3')](_0x15614f);}}else{_0x15dfdb[_0x217cd7]=_[_0x458f('0x18')](_0x15614f)?_0x15614f:JSON[_0x458f('0x3')](_0x15614f);}}catch(_0x4008d3){_0x15dfdb[_0x217cd7]=_0x15614f['split'](',');}});}return _0x15dfdb;};exports[_0x458f('0x19')]=function(_0x3ec921){_0x3ec921=parseInt(_0x3ec921,0xa);if(!_0x3ec921||_0x3ec921<0x0){_0x3ec921=LIMIT_VALUE;}return _0x3ec921;};exports['offset']=function(_0x43303a){_0x43303a=parseInt(_0x43303a,0xa);if(!_0x43303a||_0x43303a<0x0){_0x43303a=0x0;}return _0x43303a;};exports['sort']=function(_0x51dc6c){var _0x34167b,_0x1a225f=null;if(_0x51dc6c){_0x34167b=_0x51dc6c['split'](',');_0x1a225f=_[_0x458f('0x1a')](_0x34167b,function(_0x252dc6){if(_0x252dc6[_0x458f('0x1b')]('-')===0x0){return[_0x252dc6===_0x458f('0x1c')?sequelize[_0x458f('0x1d')](sequelize[_0x458f('0x1e')](_0x458f('0x1c')),_0x458f('0x1f')):_0x252dc6['substr'](0x1),_0x458f('0x20')];}else{return[_0x252dc6===_0x458f('0x1c')?sequelize[_0x458f('0x1d')](sequelize[_0x458f('0x1e')]('priority'),_0x458f('0x1f')):_0x252dc6,_0x458f('0x21')];}});}return _0x1a225f;};exports[_0x458f('0x22')]=function(_0x1360d6,_0x5e4ffd){if(_[_0x458f('0xc')](_0x1360d6)){return _0x1360d6;}if(_[_0x458f('0x18')](_0x1360d6)){for(var _0x4f5573=0x0;_0x4f5573<_0x1360d6[_0x458f('0x23')];_0x4f5573+=0x1){_0x1360d6[_0x4f5573]=this[_0x458f('0x22')](_0x1360d6[_0x4f5573],_0x5e4ffd);}return _0x1360d6;}if(!_[_0x458f('0x24')](_0x1360d6)){return _0x1360d6;}if(_[_0x458f('0x25')](_0x5e4ffd)){_0x5e4ffd=[_0x5e4ffd];}if(!_[_0x458f('0x18')](_0x5e4ffd)){return _0x1360d6;}for(var _0x5e9f04=0x0;_0x5e9f04<_0x5e4ffd[_0x458f('0x23')];_0x5e9f04+=0x1){_['unset'](_0x1360d6,_0x5e4ffd[_0x5e9f04]);}for(var _0x4ddc44 in _0x1360d6){if(_0x1360d6[_0x458f('0x26')](_0x4ddc44)){_0x1360d6[_0x4ddc44]=this[_0x458f('0x22')](_0x1360d6[_0x4ddc44],_0x5e4ffd);}}return _0x1360d6;};exports[_0x458f('0x27')]=function(_0x4be211){return _0x4be211[_0x458f('0x28')](RegExp(_0x458f('0x29')))?!![]:![];};exports[_0x458f('0x2a')]=function(_0x3e6903){return _0x3e6903[_0x458f('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x458f('0x2b')]=function(_0x2c2b0e,_0x26fa0d){var _0x23eaa8=[];var _0x42b33b=/[ `!@#$%^&*()_\-?~]/;var _0x3773ca=_0x26fa0d?_0x458f('0x2c'):'{EXPR}';_0x2c2b0e[_0x458f('0xa')](/[ ,]+/)['forEach'](function(_0x2b090b){_0x2b090b=_0x2b090b[_0x458f('0x2d')](/([^:]")"+/g,'$1');_0x2b090b='+'+_0x2b090b+'*';var _0x5a1fb1=_0x2b090b[_0x458f('0x28')](_0x42b33b);if(_0x5a1fb1){_0x2b090b='\x22'+_0x2b090b+'\x22';}_0x23eaa8[_0x458f('0x2e')](_0x2b090b);});_0x3773ca=_0x3773ca[_0x458f('0x2d')](_0x458f('0x2f'),_0x23eaa8[_0x458f('0x30')]('\x20'));return _0x3773ca;};exports[_0x458f('0x31')]=function(_0xc63af,_0x5ab5c2,_0x22bb03){var _0x481c96={},_0x5c0a88={};if(_0x5ab5c2['query']['$id']){_0x5ab5c2[_0x458f('0x32')]['id']=_0x5ab5c2[_0x458f('0x32')]['$id'];delete _0x5ab5c2[_0x458f('0x32')][_0x458f('0x33')];}_0x481c96['model']=_['map'](_0xc63af,_0x458f('0x34'));_0x481c96[_0x458f('0x32')]=_['keys'](_0x5ab5c2['query']);_0x481c96[_0x458f('0xb')]=_[_0x458f('0x35')](_0x481c96[_0x458f('0x6')],_0x481c96['query']);_0x5c0a88[_0x458f('0x36')]=_[_0x458f('0x35')](_0x481c96[_0x458f('0x6')],this[_0x458f('0x8')](_0x5ab5c2[_0x458f('0x32')][_0x458f('0x8')]));_0x5c0a88[_0x458f('0x36')]=_0x5c0a88[_0x458f('0x36')][_0x458f('0x23')]?_0x5c0a88['attributes']:_0x481c96[_0x458f('0x6')];if(!_0x5ab5c2['query'][_0x458f('0x26')](_0x458f('0x37'))){_0x5c0a88[_0x458f('0x19')]=this[_0x458f('0x19')](_0x5ab5c2[_0x458f('0x32')]['limit']);_0x5c0a88['offset']=this[_0x458f('0x38')](_0x5ab5c2[_0x458f('0x32')][_0x458f('0x38')]);}_0x5c0a88[_0x458f('0x39')]=this[_0x458f('0x3a')](_0x5ab5c2[_0x458f('0x32')][_0x458f('0x3a')]);_0x5c0a88[_0x458f('0x3b')]=this[_0x458f('0xb')](_[_0x458f('0x3c')](_0x5ab5c2[_0x458f('0x32')],_0x481c96[_0x458f('0xb')]),_0xc63af);if(_0x5ab5c2[_0x458f('0x32')]['filter']){var _0x36fa8c=_0xc63af;var _0x20be52=_0x5ab5c2[_0x458f('0x32')][_0x458f('0x3d')];if(typeof _0x20be52===_0x458f('0x3e')){_0x36fa8c=_[_0x458f('0x3d')](_0xc63af,function(_0x32ed3a){return _[_0x458f('0x5')](_0x20be52['columns'],_0x32ed3a[_0x458f('0x34')]);});_0x20be52=_0x20be52[_0x458f('0x3f')];}_0x5c0a88[_0x458f('0x3b')]=_['merge'](_0x5c0a88[_0x458f('0x3b')],{'$or':_[_0x458f('0x1a')](_0x36fa8c,function(_0xb435d7){if(_0xb435d7[_0x458f('0xf')]!==_0x458f('0x40')){if(_0x22bb03){return sequelize['where'](sequelize['fn']('lower',sequelize['col'](_0xb435d7[_0x458f('0x34')])),{'$like':sequelize['fn'](_0x458f('0x41'),'%'+_0x5ab5c2[_0x458f('0x32')][_0x458f('0x3d')]+'%')});}else{var _0x58a574={};_0x58a574[_0xb435d7[_0x458f('0x34')]]={'$like':'%'+_0x5ab5c2[_0x458f('0x32')]['filter']+'%'};return _0x58a574;}}})});}_0x5c0a88=_[_0x458f('0x42')]({},_0x5c0a88,_0x5ab5c2['options']);return _0x5c0a88;};exports[_0x458f('0x43')]=function(_0x11e511){var _0x2ef86b=[];if(_0x11e511['includeAll']){_0x2ef86b['push']({'all':!![]});}else if(_0x11e511[_0x458f('0x43')]){if(Array[_0x458f('0x18')](_0x11e511[_0x458f('0x43')])){_0x2ef86b=Object[_0x458f('0x4')](_0x11e511[_0x458f('0x43')])[_0x458f('0x1a')](function(_0x5bccb1){return parseIncludeModel(_0x11e511[_0x458f('0x43')][_0x5bccb1]);});}else{var _0xa4236e=parseIncludeModel(_0x11e511[_0x458f('0x43')]);_0x2ef86b['push'](_0xa4236e);}}return _0x2ef86b;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index d0f551d..07e741d 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb79a=['filterAgentAttributes','role','lastLoginAt','whatsappStatusTime','chatCapacity','faxCapacity','smsCapacity','mailCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','chatPause','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','ringing','isNil','voiceStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','result','error','merge','catch','getRealtimeAgents','unknown','pause','getAgentStatus','isArray','startCase','Queue','map','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','busy','getAgentIdsByStatus','resolve','User','name','faxPause','openchannelPause','pauseType','find','globalStatus','split','fields','order','startsWith','DESC','ASC','fullname','indexOf','validateSortParameter','sort','toLowerCase','userpic','online','lastPauseAt','internal','address','openchannelCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatus','smsStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab79('0x0'));var jayson=require(_0xab79('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xab79('0x2')][_0xab79('0x3')]({'port':0x232a});var routingClient=jayson[_0xab79('0x2')][_0xab79('0x3')]({'port':0x232c});function isAgentPaused(_0x3756b0,_0x40fa8a){var _0x55116=[_0x3756b0[_0xab79('0x4')],_0x3756b0['faxPause'],_0x3756b0[_0xab79('0x5')],_0x3756b0['openchannelPause'],_0x3756b0[_0xab79('0x6')],_0x3756b0[_0xab79('0x7')],_0x3756b0[_0xab79('0x8')]];if(!_0x40fa8a)return _[_0xab79('0x9')](_0x55116);var _0x4585fe=_[_0xab79('0xa')](_0x55116);return _0x4585fe[_0xab79('0xb')]>0x0&&_0x4585fe[_0xab79('0xb')]<_0x55116[_0xab79('0xb')]?!![]:![];}function isIdle(_0x283acc){return _0x283acc===_0xab79('0xc')||_0x283acc==='unknown'||_0x283acc==='unavailable'||_0x283acc===_0xab79('0xd')||_[_0xab79('0xe')](_0x283acc);}function isAgentIdle(_0x2a06c7){if(_0x2a06c7[_0xab79('0xf')]!==_0xab79('0xc')&&_0x2a06c7[_0xab79('0x7')]){_0x2a06c7['voiceStatus']='pause';return![];}return _[_0xab79('0x9')]([_0x2a06c7['chatStatus'],_0x2a06c7[_0xab79('0x10')],_0x2a06c7[_0xab79('0x11')],_0x2a06c7[_0xab79('0x12')],_0x2a06c7['smsStatus'],_0x2a06c7['voiceStatus'],_0x2a06c7['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xab79('0x13'),{})[_0xab79('0x14')](function(_0x4ae6d8){if(_0x4ae6d8['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x3e42cb=_0x4ae6d8[_0xab79('0x15')];return routingClient['request'](_0xab79('0x13'),{})[_0xab79('0x14')](function(_0x3393de){if(_0x3393de[_0xab79('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x2716ef=_0x3393de[_0xab79('0x15')];return _[_0xab79('0x17')]({},_0x3e42cb,_0x2716ef);});})[_0xab79('0x18')](function(_0x4e71b8){throw _0x4e71b8;});}exports[_0xab79('0x19')]=getRealtimeAgents;function getAgentStatus(_0x2b49e8){var _0x3777aa=_0xab79('0x1a');if(isAgentPaused(_0x2b49e8))_0x3777aa=_0xab79('0x1b');else if(isAgentPaused(_0x2b49e8,!![]))_0x3777aa='*pause';else if(isAgentIdle(_0x2b49e8))_0x3777aa=_0xab79('0xc');else _0x3777aa='busy';return _0x3777aa;}exports[_0xab79('0x1c')]=getAgentStatus;function getAgentIdsByQueues(_0x3a0e04,_0x37e1d5){var _0x1bea71=_[_0xab79('0x1d')](_0x3a0e04)?_0x3a0e04:[_0x3a0e04];var _0x9315bd=_[_0xab79('0x1e')](_0x37e1d5)+_0xab79('0x1f');var _0x397ce4=_[_0xab79('0x20')](_0x1bea71,function(_0xb669a){return db[_0x9315bd]['findOne']({'where':{'id':_0xb669a}})[_0xab79('0x14')](function(_0x1e6ac1){if(!_0x1e6ac1)return[];return _0x1e6ac1[_0xab79('0x21')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xab79('0x22')](_0x397ce4)[_0xab79('0x14')](function(_0x241c89){var _0x441b08=_(_0x241c89)[_0xab79('0x23')]()['map']('id')[_0xab79('0x24')]()[_0xab79('0x25')]();return _0x441b08;});}exports[_0xab79('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4eecc3,_0x4d5d2f,_0x16edca){try{if(_0x4d5d2f[_0xab79('0xb')]>0x0){_0x4eecc3=_0x4eecc3['filter'](function(_0x2f6dc3){return _0x4d5d2f[_0xab79('0x27')](_0x2f6dc3['id']);});}var _0x3295c0=_0x4eecc3['filter'](function(_0x58e8a4){var _0x9fc678=_0xab79('0x28');if(isAgentIdle(_0x58e8a4)){_0x9fc678='idle';}return _0x9fc678===_0x16edca;});return _[_0xab79('0x20')](_0x3295c0,'id');}catch(_0x4b5396){throw _0x4b5396;}}exports[_0xab79('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x18e9bf,_0x5520bd,_0x42f534){return Promise[_0xab79('0x2a')]()[_0xab79('0x14')](function(){if(_0x5520bd[_0xab79('0xb')]>0x0){_0x18e9bf=_0x18e9bf[_0xab79('0xa')](function(_0x5abac9){return _0x5520bd[_0xab79('0x27')](_0x5abac9['id']);});}return _0x18e9bf;})['then'](function(){return db[_0xab79('0x2b')]['findAll']({'attributes':['id',_0xab79('0x2c'),'fullname',_0xab79('0x4'),_0xab79('0x2d'),_0xab79('0x5'),_0xab79('0x2e'),_0xab79('0x6'),'voicePause',_0xab79('0x8'),_0xab79('0x2f')],'where':{'id':{'$in':_['map'](_0x18e9bf,'id')}},'raw':!![]});})[_0xab79('0x14')](function(_0x5333be){return _0x5333be[_0xab79('0x20')](function(_0x523c2f){var _0x3d9fa9=_[_0xab79('0x30')](_0x18e9bf,['id',_0x523c2f['id']]);var _0x1305d2=filterAgentAttributes(_0x3d9fa9);_[_0xab79('0x17')](_0x523c2f,_0x1305d2);_0x523c2f[_0xab79('0x31')]=getAgentStatus(_0x523c2f);return _0x523c2f;});})['then'](function(_0x5e6fa4){var _0x4d8396=sortAgentsByStatus(_0x5e6fa4,_0x42f534);return _['map'](_0x4d8396,'id');})[_0xab79('0x18')](function(_0x23070d){throw _0x23070d;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xe4246){var _0x4c1f1a={'fields':[],'order':null};var _0x39c587=_0xe4246[_0xab79('0x32')](',');_0x4c1f1a[_0xab79('0x33')]=_[_0xab79('0xa')](_0x39c587,function(_0x29e104){if(!_0x29e104[_0xab79('0x27')](_0xab79('0x31'))){return!![];}_0x4c1f1a[_0xab79('0x34')]=_[_0xab79('0x35')](_0x29e104,'-')?_0xab79('0x36'):_0xab79('0x37');return![];});return _0x4c1f1a;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x3637eb){if(!_0x3637eb){_0x3637eb='fullname,internal';}if(_0x3637eb['includes'](_0xab79('0x38'))&&!_0x3637eb[_0xab79('0x27')]('internal')){var _0x3f6676=_0x3637eb['substring'](0x0,_0x3637eb[_0xab79('0x39')](_0xab79('0x38')));_0x3637eb+=','+_0x3f6676+'internal';}return _0x3637eb;}exports[_0xab79('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x4db42d,_0x37780f){var _0x49d766=_0x4db42d[_0xab79('0x3b')](function(_0x1214f4,_0x4bd32e){if(_0x1214f4[_0xab79('0x31')]===_0x4bd32e['globalStatus']){if(_0x1214f4[_0xab79('0x31')]===_0xab79('0x1b')){if(_0x37780f===_0xab79('0x36')){return(_0x1214f4['pauseType']||'')<(_0x4bd32e[_0xab79('0x2f')]||'')||_0x1214f4[_0xab79('0x38')][_0xab79('0x3c')]()>_0x4bd32e[_0xab79('0x38')][_0xab79('0x3c')]()?0x1:-0x1;}else{return(_0x1214f4['pauseType']||'')<(_0x4bd32e['pauseType']||'')||_0x1214f4['fullname'][_0xab79('0x3c')]()>_0x4bd32e['fullname'][_0xab79('0x3c')]()?-0x1:0x1;}}else{if(_0x37780f===_0xab79('0x36')){return _0x1214f4[_0xab79('0x38')][_0xab79('0x3c')]()<_0x4bd32e[_0xab79('0x38')]['toLowerCase']()?0x1:-0x1;}else{return _0x1214f4[_0xab79('0x38')][_0xab79('0x3c')]()<_0x4bd32e[_0xab79('0x38')][_0xab79('0x3c')]()?-0x1:0x1;}}}else{if(_0x37780f===_0xab79('0x36')){return _0x1214f4[_0xab79('0x31')]<_0x4bd32e[_0xab79('0x31')]?0x1:-0x1;}else{return _0x1214f4['globalStatus']<_0x4bd32e[_0xab79('0x31')]?-0x1:0x1;}}});return _0x49d766;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x649e1){var _0x1005fd=[_0xab79('0x3d'),_0xab79('0x3e'),'lastLoginAt','lastPauseAt',_0xab79('0x2f'),_0xab79('0x3f'),_0xab79('0x40'),_0xab79('0x41'),'chatPause',_0xab79('0x2e'),_0xab79('0x5'),_0xab79('0x6'),_0xab79('0x8'),'faxPause',_0xab79('0x7'),'chatCapacity',_0xab79('0x42'),_0xab79('0x43'),'smsCapacity','whatsappCapacity','faxCapacity',_0xab79('0x44'),_0xab79('0x45'),'mailCurrentCapacity',_0xab79('0x46'),_0xab79('0x47'),'faxCurrentCapacity',_0xab79('0x48'),_0xab79('0x12'),_0xab79('0x11'),_0xab79('0x49'),_0xab79('0x4a'),'faxStatus',_0xab79('0xf'),_0xab79('0x4b'),_0xab79('0x4c'),_0xab79('0x4d'),_0xab79('0x4e'),'whatsappStatusTime',_0xab79('0x4f'),_0xab79('0x50'),_0xab79('0x51'),_0xab79('0x52'),_0xab79('0x53'),_0xab79('0x54'),_0xab79('0x55')];var _0x2e8d73=[_0xab79('0x4'),_0xab79('0x2e'),_0xab79('0x5'),_0xab79('0x6'),_0xab79('0x8'),_0xab79('0x2d'),_0xab79('0x7'),'online'];var _0x36aad7=_(_0x649e1)[_0xab79('0x56')](_0x2e8d73)['pick'](_0x1005fd)[_0xab79('0x25')]();return _0x36aad7;}exports[_0xab79('0x57')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xab79('0x2c'),_0xab79('0x38'),_0xab79('0x58'),'internal',_0xab79('0x3e'),'globalStatus',_0xab79('0x3d'),_0xab79('0x59'),'pauseType',_0xab79('0x3f'),_0xab79('0x2d'),'chatPause',_0xab79('0x5'),_0xab79('0x2e'),_0xab79('0x6'),_0xab79('0x7'),_0xab79('0x8'),_0xab79('0x48'),_0xab79('0x10'),_0xab79('0x11'),_0xab79('0x12'),_0xab79('0x49'),_0xab79('0xf'),_0xab79('0x4a'),'chatStatusTime',_0xab79('0x4f'),_0xab79('0x4d'),'openchannelStatusTime',_0xab79('0x4e'),_0xab79('0x50'),_0xab79('0x5a'),_0xab79('0x5b'),_0xab79('0x5c'),_0xab79('0x43'),_0xab79('0x42'),_0xab79('0x5d'),'whatsappCapacity',_0xab79('0x44'),'faxCurrentCapacity',_0xab79('0x5e'),_0xab79('0x45'),_0xab79('0x46'),_0xab79('0x47'),_0xab79('0x54'),'phoneBarEnableAutomaticScreenRecording',_0xab79('0x52'),_0xab79('0x5f'),_0xab79('0x51'),_0xab79('0x53')];}exports[_0xab79('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xad9f=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','name','role','lastLoginAt','chatStatusTime','voiceStatusTime','whatsappStatusTime','chatCapacity','smsCapacity','whatsappCapacity','faxCurrentCapacity','smsCurrentCapacity','phoneBarEnableScreenRecordingByAgent','destconnectedlinenum','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','client','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','includes','getAgentIdsByStatus','resolve','User','fullname','pauseType','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','fullname,internal','substring','indexOf','internal','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','chatPause','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0xad9f,0x1be));var _0xfad9=function(_0x5bed93,_0x3df8a8){_0x5bed93=_0x5bed93-0x0;var _0x158df2=_0xad9f[_0x5bed93];return _0x158df2;};'use strict';var _=require(_0xfad9('0x0'));var jayson=require(_0xfad9('0x1'));var db=require(_0xfad9('0x2'))['db'];var amiClient=jayson['client'][_0xfad9('0x3')]({'port':0x232a});var routingClient=jayson[_0xfad9('0x4')][_0xfad9('0x3')]({'port':0x232c});function isAgentPaused(_0x1a9d9b,_0x596189){var _0x39910f=[_0x1a9d9b['chatPause'],_0x1a9d9b[_0xfad9('0x5')],_0x1a9d9b[_0xfad9('0x6')],_0x1a9d9b[_0xfad9('0x7')],_0x1a9d9b[_0xfad9('0x8')],_0x1a9d9b[_0xfad9('0x9')],_0x1a9d9b[_0xfad9('0xa')]];if(!_0x596189)return _['every'](_0x39910f);var _0x5580be=_[_0xfad9('0xb')](_0x39910f);return _0x5580be[_0xfad9('0xc')]>0x0&&_0x5580be[_0xfad9('0xc')]<_0x39910f[_0xfad9('0xc')]?!![]:![];}function isIdle(_0x22dca1){return _0x22dca1===_0xfad9('0xd')||_0x22dca1===_0xfad9('0xe')||_0x22dca1===_0xfad9('0xf')||_0x22dca1==='ringing'||_[_0xfad9('0x10')](_0x22dca1);}function isAgentIdle(_0x2da607){if(_0x2da607[_0xfad9('0x11')]!==_0xfad9('0xd')&&_0x2da607[_0xfad9('0x9')]){_0x2da607[_0xfad9('0x11')]=_0xfad9('0x12');return![];}return _[_0xfad9('0x13')]([_0x2da607[_0xfad9('0x14')],_0x2da607[_0xfad9('0x15')],_0x2da607[_0xfad9('0x16')],_0x2da607['openchannelStatus'],_0x2da607[_0xfad9('0x17')],_0x2da607[_0xfad9('0x11')],_0x2da607[_0xfad9('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xfad9('0x19')](_0xfad9('0x1a'),{})[_0xfad9('0x1b')](function(_0x567e45){if(_0x567e45[_0xfad9('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x1f6808=_0x567e45[_0xfad9('0x1d')];return routingClient['request']('Agents',{})[_0xfad9('0x1b')](function(_0x18e48a){if(_0x18e48a[_0xfad9('0x1c')]){throw new Error(_0xfad9('0x1e'));}var _0x2843ce=_0x18e48a[_0xfad9('0x1d')];return _[_0xfad9('0x1f')]({},_0x1f6808,_0x2843ce);});})[_0xfad9('0x20')](function(_0x97cc3a){throw _0x97cc3a;});}exports[_0xfad9('0x21')]=getRealtimeAgents;function getAgentStatus(_0x55b775){var _0x5e73fd='unknown';if(isAgentPaused(_0x55b775))_0x5e73fd=_0xfad9('0x12');else if(isAgentPaused(_0x55b775,!![]))_0x5e73fd=_0xfad9('0x22');else if(isAgentIdle(_0x55b775))_0x5e73fd=_0xfad9('0xd');else _0x5e73fd=_0xfad9('0x23');return _0x5e73fd;}exports[_0xfad9('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x25c53c,_0x5c157f){var _0x46e091=_[_0xfad9('0x25')](_0x25c53c)?_0x25c53c:[_0x25c53c];var _0x63d6c7=_[_0xfad9('0x26')](_0x5c157f)+_0xfad9('0x27');var _0x1371dc=_[_0xfad9('0x28')](_0x46e091,function(_0x120f2d){return db[_0x63d6c7][_0xfad9('0x29')]({'where':{'id':_0x120f2d}})['then'](function(_0x179c9d){if(!_0x179c9d)return[];return _0x179c9d[_0xfad9('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xfad9('0x2b')](_0x1371dc)[_0xfad9('0x1b')](function(_0x39f094){var _0x51ee01=_(_0x39f094)[_0xfad9('0x2c')]()['map']('id')[_0xfad9('0x2d')]()[_0xfad9('0x2e')]();return _0x51ee01;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57e717,_0x3d5f4b,_0xa2449e){try{if(_0x3d5f4b['length']>0x0){_0x57e717=_0x57e717[_0xfad9('0xb')](function(_0x5e61c9){return _0x3d5f4b[_0xfad9('0x2f')](_0x5e61c9['id']);});}var _0x5a3ecb=_0x57e717[_0xfad9('0xb')](function(_0x4957eb){var _0x3dda71=_0xfad9('0x23');if(isAgentIdle(_0x4957eb)){_0x3dda71='idle';}return _0x3dda71===_0xa2449e;});return _[_0xfad9('0x28')](_0x5a3ecb,'id');}catch(_0x44c125){throw _0x44c125;}}exports[_0xfad9('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5dbb54,_0x2893a2,_0x276856){return Promise[_0xfad9('0x31')]()[_0xfad9('0x1b')](function(){if(_0x2893a2[_0xfad9('0xc')]>0x0){_0x5dbb54=_0x5dbb54['filter'](function(_0x3fbdbd){return _0x2893a2[_0xfad9('0x2f')](_0x3fbdbd['id']);});}return _0x5dbb54;})[_0xfad9('0x1b')](function(){return db[_0xfad9('0x32')]['findAll']({'attributes':['id','name',_0xfad9('0x33'),'chatPause',_0xfad9('0x5'),_0xfad9('0x6'),_0xfad9('0x7'),_0xfad9('0x8'),_0xfad9('0x9'),_0xfad9('0xa'),_0xfad9('0x34')],'where':{'id':{'$in':_[_0xfad9('0x28')](_0x5dbb54,'id')}},'raw':!![]});})['then'](function(_0x3ead13){return _0x3ead13[_0xfad9('0x28')](function(_0x29af3a){var _0x21898a=_['find'](_0x5dbb54,['id',_0x29af3a['id']]);var _0x262255=filterAgentAttributes(_0x21898a);_[_0xfad9('0x1f')](_0x29af3a,_0x262255);_0x29af3a['globalStatus']=getAgentStatus(_0x29af3a);return _0x29af3a;});})['then'](function(_0xe8cba8){var _0x4bdf5a=sortAgentsByStatus(_0xe8cba8,_0x276856);return _[_0xfad9('0x28')](_0x4bdf5a,'id');})[_0xfad9('0x20')](function(_0x4d84c4){throw _0x4d84c4;});}exports[_0xfad9('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x57c77f){var _0x5f4105={'fields':[],'order':null};var _0x35199b=_0x57c77f[_0xfad9('0x36')](',');_0x5f4105[_0xfad9('0x37')]=_[_0xfad9('0xb')](_0x35199b,function(_0x6869af){if(!_0x6869af[_0xfad9('0x2f')](_0xfad9('0x38'))){return!![];}_0x5f4105[_0xfad9('0x39')]=_[_0xfad9('0x3a')](_0x6869af,'-')?'DESC':_0xfad9('0x3b');return![];});return _0x5f4105;}exports[_0xfad9('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0xfd3896){if(!_0xfd3896){_0xfd3896=_0xfad9('0x3d');}if(_0xfd3896[_0xfad9('0x2f')](_0xfad9('0x33'))&&!_0xfd3896[_0xfad9('0x2f')]('internal')){var _0x4e2abe=_0xfd3896[_0xfad9('0x3e')](0x0,_0xfd3896[_0xfad9('0x3f')](_0xfad9('0x33')));_0xfd3896+=','+_0x4e2abe+_0xfad9('0x40');}return _0xfd3896;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x1c6925,_0x86994){var _0x202979=_0x1c6925[_0xfad9('0x41')](function(_0x7274f3,_0x3a89e8){if(_0x7274f3[_0xfad9('0x38')]===_0x3a89e8['globalStatus']){if(_0x7274f3[_0xfad9('0x38')]===_0xfad9('0x12')){if(_0x86994===_0xfad9('0x42')){return(_0x7274f3[_0xfad9('0x34')]||'')<(_0x3a89e8[_0xfad9('0x34')]||'')||_0x7274f3[_0xfad9('0x33')]['toLowerCase']()>_0x3a89e8[_0xfad9('0x33')][_0xfad9('0x43')]()?0x1:-0x1;}else{return(_0x7274f3['pauseType']||'')<(_0x3a89e8[_0xfad9('0x34')]||'')||_0x7274f3[_0xfad9('0x33')]['toLowerCase']()>_0x3a89e8['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x86994===_0xfad9('0x42')){return _0x7274f3['fullname']['toLowerCase']()<_0x3a89e8[_0xfad9('0x33')][_0xfad9('0x43')]()?0x1:-0x1;}else{return _0x7274f3[_0xfad9('0x33')]['toLowerCase']()<_0x3a89e8[_0xfad9('0x33')][_0xfad9('0x43')]()?-0x1:0x1;}}}else{if(_0x86994===_0xfad9('0x42')){return _0x7274f3[_0xfad9('0x38')]<_0x3a89e8[_0xfad9('0x38')]?0x1:-0x1;}else{return _0x7274f3[_0xfad9('0x38')]<_0x3a89e8['globalStatus']?-0x1:0x1;}}});return _0x202979;}exports[_0xfad9('0x44')]=sortAgentsByStatus;function filterAgentAttributes(_0x1c5673){var _0xe651c2=[_0xfad9('0x45'),_0xfad9('0x46'),'lastLoginAt',_0xfad9('0x47'),'pauseType','lastPauseAt',_0xfad9('0x40'),_0xfad9('0x48'),_0xfad9('0x49'),_0xfad9('0x7'),'mailPause',_0xfad9('0x8'),_0xfad9('0xa'),'faxPause',_0xfad9('0x9'),'chatCapacity',_0xfad9('0x4a'),_0xfad9('0x4b'),'smsCapacity','whatsappCapacity',_0xfad9('0x4c'),'chatCurrentCapacity',_0xfad9('0x4d'),_0xfad9('0x4e'),'smsCurrentCapacity',_0xfad9('0x4f'),'faxCurrentCapacity',_0xfad9('0x14'),_0xfad9('0x50'),_0xfad9('0x16'),'smsStatus',_0xfad9('0x18'),_0xfad9('0x15'),_0xfad9('0x11'),'chatStatusTime',_0xfad9('0x51'),_0xfad9('0x52'),_0xfad9('0x53'),'whatsappStatusTime',_0xfad9('0x54'),'voiceStatusTime',_0xfad9('0x55'),'destconnectedlinenum',_0xfad9('0x56'),'phoneBarEnableScreenRecordingByAgent',_0xfad9('0x57')];var _0x5620af=[_0xfad9('0x49'),_0xfad9('0x7'),_0xfad9('0x6'),_0xfad9('0x8'),_0xfad9('0xa'),_0xfad9('0x5'),_0xfad9('0x9'),_0xfad9('0x46')];var _0x175d8f=_(_0x1c5673)[_0xfad9('0x58')](_0x5620af)[_0xfad9('0x59')](_0xe651c2)[_0xfad9('0x2e')]();return _0x175d8f;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xfad9('0x5a'),_0xfad9('0x33'),_0xfad9('0x5b'),_0xfad9('0x40'),'online',_0xfad9('0x38'),'userpic',_0xfad9('0x5c'),_0xfad9('0x34'),_0xfad9('0x47'),'faxPause',_0xfad9('0x49'),_0xfad9('0x6'),_0xfad9('0x7'),_0xfad9('0x8'),'voicePause',_0xfad9('0xa'),_0xfad9('0x14'),_0xfad9('0x15'),'mailStatus',_0xfad9('0x50'),'smsStatus','voiceStatus',_0xfad9('0x18'),_0xfad9('0x5d'),_0xfad9('0x54'),_0xfad9('0x52'),_0xfad9('0x51'),'smsStatusTime',_0xfad9('0x5e'),_0xfad9('0x5f'),_0xfad9('0x60'),_0xfad9('0x4c'),'mailCapacity',_0xfad9('0x4a'),_0xfad9('0x61'),_0xfad9('0x62'),'chatCurrentCapacity',_0xfad9('0x63'),_0xfad9('0x4e'),_0xfad9('0x4d'),_0xfad9('0x64'),_0xfad9('0x4f'),_0xfad9('0x65'),_0xfad9('0x57'),_0xfad9('0x66'),_0xfad9('0x67'),_0xfad9('0x55'),'screenrecording'];}exports[_0xfad9('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index cd33eee..83450a3 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb5b=['ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','error','format','catch','concat','outbound','get','loggedInDb','available','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','paused','waiting','inUse','notInUse','onHold'];(function(_0x4f30c2,_0x46dd06){var _0x4028c5=function(_0x5505db){while(--_0x5505db){_0x4f30c2['push'](_0x4f30c2['shift']());}};_0x4028c5(++_0x46dd06);}(_0xdb5b,0x1b8));var _0xbdb5=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xdb5b[_0x543084];return _0x306a57;};'use strict';var _=require(_0xbdb5('0x0'));var jayson=require(_0xbdb5('0x1'));var util=require(_0xbdb5('0x2'));var amiClient=jayson[_0xbdb5('0x3')][_0xbdb5('0x4')]({'port':0x232a});var routingClient=jayson[_0xbdb5('0x3')][_0xbdb5('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0xbdb5('0x5'),_0xbdb5('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xbdb5('0x7'),'invalid','loggedInDb',_0xbdb5('0x8'),_0xbdb5('0x9'),_0xbdb5('0xa'),_0xbdb5('0xb'),_0xbdb5('0xc'),_0xbdb5('0xd'),_0xbdb5('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xbdb5('0xf'),_0xbdb5('0x10'),'message',_0xbdb5('0x11'),_0xbdb5('0x12'),_0xbdb5('0x13'),_0xbdb5('0x14'),'startPredictive','startProgressive',_0xbdb5('0x15'),_0xbdb5('0x16'),'erlangAbandonmentRate',_0xbdb5('0x17'),'dialPredictiveInterval',_0xbdb5('0x18'),_0xbdb5('0x19'),_0xbdb5('0x1a'),_0xbdb5('0x1b'),'predictiveIntervalAnsweredCalls',_0xbdb5('0x1c'),'predictiveIntervalDroppedCallsCallersExit',_0xbdb5('0x1d'),_0xbdb5('0x1e')];function getRealtimeQueues(_0x49cbb5,_0x43972e){var _0x16ae1f=_0x43972e===_0xbdb5('0x1f')?amiClient:routingClient;return _0x16ae1f[_0xbdb5('0x20')](_['startCase'](_0x43972e)+'Queues',_0x49cbb5)['then'](function(_0x4730fa){if(_0x4730fa[_0xbdb5('0x21')])throw new Error(util[_0xbdb5('0x22')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x43972e));return _0x4730fa['result'];})[_0xbdb5('0x23')](function(_0x558453){throw _0x558453;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x5d233f,_0x4b8356,_0xe4d41c,_0x2230ee){var _0x1d63cf=DEFAULT_QUEUE_ATTRIBUTES;if(_0xe4d41c===_0xbdb5('0x1f')){if(_0x2230ee==='inbound'){_0x1d63cf=_0x1d63cf[_0xbdb5('0x24')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2230ee===_0xbdb5('0x25')){_0x1d63cf=_0x1d63cf[_0xbdb5('0x24')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5d233f['map'](function(_0x1c6c74){var _0x18edf9=_0x1c6c74[_0xbdb5('0x26')]({'plain':!![]});_0x18edf9['paused']=0x0;_0x18edf9[_0xbdb5('0x27')]=0x0;_0x18edf9['loggedIn']=0x0;_0x18edf9[_0xbdb5('0x28')]=0x0;_0x18edf9[_0xbdb5('0x6')]=0x0;if(_0xe4d41c==='voice'){_0x18edf9[_0xbdb5('0xc')]=0x0;_0x18edf9['busy']=0x0;if(_0x2230ee==='outbound'){_0x18edf9[_0xbdb5('0xf')]=0x0;_0x18edf9['originated']=0x0;}}var _0x1c68f3=_[_0xbdb5('0x29')](_0x4b8356,['id',_0x18edf9['id']]);if(_0x1c68f3){_[_0xbdb5('0x2a')](_0x18edf9,_[_0xbdb5('0x2b')](_0x1c68f3,_0x1d63cf));}return _0x18edf9;});}exports[_0xbdb5('0x2c')]=initializeQueues; \ No newline at end of file +var _0x91b4=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','result','catch','getRealtimeQueues','voice','inbound','concat','map','get','paused','loggedInDb','outbound','pTalking','originated','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','busy','inUse','invalid','notInUse','onHold','unavailable','unknown','message','statusMessage','dialActive','dialMethod','startPredictive','startProgressive'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x91b4,0xbb));var _0x491b=function(_0x235cbb,_0x3639fa){_0x235cbb=_0x235cbb-0x0;var _0x59886d=_0x91b4[_0x235cbb];return _0x59886d;};'use strict';var _=require(_0x491b('0x0'));var jayson=require(_0x491b('0x1'));var util=require(_0x491b('0x2'));var amiClient=jayson[_0x491b('0x3')][_0x491b('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x491b('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x491b('0x5'),_0x491b('0x6'),'paused',_0x491b('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x491b('0x8'),_0x491b('0x9'),_0x491b('0xa'),'loggedInDb',_0x491b('0xb'),_0x491b('0xc'),'ringing','ringInUse','talking',_0x491b('0xd'),_0x491b('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x491b('0xf'),_0x491b('0x10'),_0x491b('0x11'),_0x491b('0x12'),'Trunk',_0x491b('0x13'),_0x491b('0x14'),_0x491b('0x15'),_0x491b('0x16'),_0x491b('0x17'),_0x491b('0x18'),_0x491b('0x19'),_0x491b('0x1a'),_0x491b('0x1b'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0x491b('0x1c'),_0x491b('0x1d')];function getRealtimeQueues(_0x62c98,_0x216d91){var _0x1b3c50=_0x216d91==='voice'?amiClient:routingClient;return _0x1b3c50[_0x491b('0x1e')](_[_0x491b('0x1f')](_0x216d91)+_0x491b('0x20'),_0x62c98)[_0x491b('0x21')](function(_0x3f1f43){if(_0x3f1f43[_0x491b('0x22')])throw new Error(util[_0x491b('0x23')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x216d91));return _0x3f1f43[_0x491b('0x24')];})[_0x491b('0x25')](function(_0x157fc8){throw _0x157fc8;});}exports[_0x491b('0x26')]=getRealtimeQueues;function initializeQueues(_0x2bb2e2,_0x4c553d,_0x24e828,_0x1384eb){var _0x53e5a1=DEFAULT_QUEUE_ATTRIBUTES;if(_0x24e828===_0x491b('0x27')){if(_0x1384eb===_0x491b('0x28')){_0x53e5a1=_0x53e5a1[_0x491b('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1384eb==='outbound'){_0x53e5a1=_0x53e5a1[_0x491b('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2bb2e2[_0x491b('0x2a')](function(_0x7fcbee){var _0x22df5a=_0x7fcbee[_0x491b('0x2b')]({'plain':!![]});_0x22df5a[_0x491b('0x2c')]=0x0;_0x22df5a[_0x491b('0x2d')]=0x0;_0x22df5a['loggedIn']=0x0;_0x22df5a['available']=0x0;_0x22df5a[_0x491b('0x7')]=0x0;if(_0x24e828===_0x491b('0x27')){_0x22df5a['talking']=0x0;_0x22df5a[_0x491b('0x8')]=0x0;if(_0x1384eb===_0x491b('0x2e')){_0x22df5a[_0x491b('0x2f')]=0x0;_0x22df5a[_0x491b('0x30')]=0x0;}}var _0xc46317=_[_0x491b('0x31')](_0x4c553d,['id',_0x22df5a['id']]);if(_0xc46317){_[_0x491b('0x32')](_0x22df5a,_['pick'](_0xc46317,_0x53e5a1));}return _0x22df5a;});}exports[_0x491b('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index ba9a6b1..d692986 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _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(_0x24fe45,_0x2d4a63){var _0xd02f17=function(_0x261008){while(--_0x261008){_0x24fe45['push'](_0x24fe45['shift']());}};_0xd02f17(++_0x2d4a63);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 f0ab87b..bf8e088 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 _0x7594=['dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','createHash','digest','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','md5','update','hex','getUuid','licenseToken','test','win32'];(function(_0xdfd8d0,_0x563599){var _0x31ef41=function(_0x5c0bfe){while(--_0x5c0bfe){_0xdfd8d0['push'](_0xdfd8d0['shift']());}};_0x31ef41(++_0x563599);}(_0x7594,0x1db));var _0x4759=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x7594[_0x2706da];return _0x3ba87e;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4759('0x0'));var machine=require(_0x4759('0x1'));var exec=require(_0x4759('0x2'))[_0x4759('0x3')];var config=require(_0x4759('0x4'));function getInterfaces(){var _0x5e4d3d=[];var _0x10dc2c=os[_0x4759('0x5')]();var _0x2311ed=_[_0x4759('0x6')](_[_0x4759('0x7')](_0x10dc2c));for(var _0xae329b=0x0;_0xae329b<_0x2311ed[_0x4759('0x8')];_0xae329b++){var _0x5bbba8=_0x10dc2c[_0x2311ed[_0xae329b]][_0x4759('0x9')](function(_0x5cbd26){return _0x5cbd26['family']===_0x4759('0xa')&&_0x5cbd26[_0x4759('0xb')]===![];});_0x5e4d3d=_0x5e4d3d[_0x4759('0xc')](_0x5bbba8);}return _0x5e4d3d;}function getFirstInterface(){var _0x585858=_[_0x4759('0xd')](getInterfaces());return{'macAddress':_0x585858&&_0x585858[_0x4759('0xe')]?_0x585858[_0x4759('0xe')]:_0x4759('0xf'),'ipAddress':_0x585858&&_0x585858['address']?_0x585858[_0x4759('0x10')]:_0x4759('0x11')};}exports[_0x4759('0x12')]=getFirstInterface;function getCPUhash(){var _0x5aa8d2=_[_0x4759('0x6')](os[_0x4759('0x13')]()[_0x4759('0x14')](function(_0x5a6fc0){return _0x5a6fc0['model'];}))[_0x4759('0x15')](':');return crypto['createHash'](_0x4759('0x16'))[_0x4759('0x17')](_0x5aa8d2)['digest'](_0x4759('0x18'));}exports[_0x4759('0x19')]=function(){var _0x4c2889=os['platform']();var _0x166c63=/[0-9a-f-]{36}/;if(config[_0x4759('0x1a')]&&_0x166c63[_0x4759('0x1b')](config['licenseToken'])){return config['licenseToken'];}else if(_0x4c2889===_0x4759('0x1c')){return exec(_0x4759('0x1d'),{'encoding':_0x4759('0x1e')})[_0x4759('0x1f')]('\x0d\x0a','');}else{var _0x31d02b=getFirstInterface();var _0x5d23f2=getCPUhash();var _0x1e6165=_0x5d23f2+'|'+os['hostname']()+'|'+_0x31d02b['macAddress']+'|'+_0x31d02b[_0x4759('0x20')];var _0x35275c=crypto[_0x4759('0x21')](_0x4759('0x16'))[_0x4759('0x17')](_0x1e6165)[_0x4759('0x22')](_0x4759('0x18'));return _0x35275c[_0x4759('0x23')](0x0,0x8)+'-'+_0x35275c[_0x4759('0x23')](0x8,0xc)+'-'+_0x35275c[_0x4759('0x23')](0xc,0x10)+'-'+_0x35275c['substring'](0x10,0x14)+'-'+_0x35275c[_0x4759('0x23')](0x14);}}; \ No newline at end of file +var _0xda76=['getFirstInterface','cpus','map','join','createHash','md5','update','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','family','IPv4','internal','mac','address','127.0.0.1'];(function(_0x5da063,_0x4d3ac9){var _0x1b0c58=function(_0x871c09){while(--_0x871c09){_0x5da063['push'](_0x5da063['shift']());}};_0x1b0c58(++_0x4d3ac9);}(_0xda76,0xea));var _0x6da7=function(_0x4be5a5,_0x2889fa){_0x4be5a5=_0x4be5a5-0x0;var _0x3b8a21=_0xda76[_0x4be5a5];return _0x3b8a21;};'use strict';var _=require(_0x6da7('0x0'));var os=require('os');var crypto=require(_0x6da7('0x1'));var machine=require(_0x6da7('0x2'));var exec=require(_0x6da7('0x3'))[_0x6da7('0x4')];var config=require('../environment');function getInterfaces(){var _0x54fe76=[];var _0x59da20=os['networkInterfaces']();var _0x17b560=_[_0x6da7('0x5')](_[_0x6da7('0x6')](_0x59da20));for(var _0x309223=0x0;_0x309223<_0x17b560[_0x6da7('0x7')];_0x309223++){var _0x1e4c00=_0x59da20[_0x17b560[_0x309223]]['filter'](function(_0xc49d2b){return _0xc49d2b[_0x6da7('0x8')]===_0x6da7('0x9')&&_0xc49d2b[_0x6da7('0xa')]===![];});_0x54fe76=_0x54fe76['concat'](_0x1e4c00);}return _0x54fe76;}function getFirstInterface(){var _0x3603e=_['head'](getInterfaces());return{'macAddress':_0x3603e&&_0x3603e[_0x6da7('0xb')]?_0x3603e['mac']:'00:00:00:00:00:00','ipAddress':_0x3603e&&_0x3603e[_0x6da7('0xc')]?_0x3603e[_0x6da7('0xc')]:_0x6da7('0xd')};}exports[_0x6da7('0xe')]=getFirstInterface;function getCPUhash(){var _0x570d51=_[_0x6da7('0x5')](os[_0x6da7('0xf')]()[_0x6da7('0x10')](function(_0x2fac7e){return _0x2fac7e['model'];}))[_0x6da7('0x11')](':');return crypto[_0x6da7('0x12')](_0x6da7('0x13'))[_0x6da7('0x14')](_0x570d51)['digest'](_0x6da7('0x15'));}exports['getUuid']=function(){var _0xf9b6c2=os[_0x6da7('0x16')]();var _0xb25b11=/[0-9a-f-]{36}/;if(config[_0x6da7('0x17')]&&_0xb25b11[_0x6da7('0x18')](config[_0x6da7('0x17')])){return config[_0x6da7('0x17')];}else if(_0xf9b6c2===_0x6da7('0x19')){return exec(_0x6da7('0x1a'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x44da94=getFirstInterface();var _0x16d8a8=getCPUhash();var _0x5b03c3=_0x16d8a8+'|'+os[_0x6da7('0x1b')]()+'|'+_0x44da94[_0x6da7('0x1c')]+'|'+_0x44da94[_0x6da7('0x1d')];var _0x162bbc=crypto[_0x6da7('0x12')](_0x6da7('0x13'))[_0x6da7('0x14')](_0x5b03c3)['digest']('hex');return _0x162bbc[_0x6da7('0x1e')](0x0,0x8)+'-'+_0x162bbc[_0x6da7('0x1e')](0x8,0xc)+'-'+_0x162bbc[_0x6da7('0x1e')](0xc,0x10)+'-'+_0x162bbc[_0x6da7('0x1e')](0x10,0x14)+'-'+_0x162bbc['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index ed623dc..0e95341 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 _0x815f=['license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','format','exports','GET','then','get','data2','data1','active'];(function(_0x3fd4e1,_0x5a8e13){var _0x1df9c7=function(_0xe3a9e){while(--_0xe3a9e){_0x3fd4e1['push'](_0x3fd4e1['shift']());}};_0x1df9c7(++_0x5a8e13);}(_0x815f,0xff));var _0xf815=function(_0x40db6a,_0x3a0df8){_0x40db6a=_0x40db6a-0x0;var _0x51e5a5=_0x815f[_0x40db6a];return _0x51e5a5;};'use strict';var util=require(_0xf815('0x0'));var moment=require(_0xf815('0x1'));var rp=require(_0xf815('0x2'));var BPromise=require(_0xf815('0x3'));var pkginfo=require(_0xf815('0x4'))(module,_0xf815('0x5'));var db=require(_0xf815('0x6'))['db'];var encryptor=require(_0xf815('0x7'));var hardware=require(_0xf815('0x8'));var logger=require(_0xf815('0x9'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x48272c){return new BPromise(function(_0x29a08c,_0x369f81){var _0x205b2d=util[_0xf815('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x48272c,module['exports'][_0xf815('0x5')]);if(oldToken){_0x205b2d=util[_0xf815('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x48272c,module[_0xf815('0xb')][_0xf815('0x5')],oldToken);}var _0x3ff095={'uri':_0x205b2d,'method':_0xf815('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3ff095)[_0xf815('0xd')](function(_0x538bcc){_0x29a08c(_0x538bcc);})['catch'](function(_0x2d2ba4){_0x369f81(_0x2d2ba4);});});}function manageLicense(_0x1cd4a4,_0x32abba){var _0x56d038=_0x32abba[_0xf815('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x56d038['data1']!==_0x1cd4a4&&!_0x56d038[_0xf815('0xf')]){oldToken=_0x56d038[_0xf815('0x10')];}httpRequest(_0x1cd4a4)['then'](function(_0x344fea){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x344fea[_0xf815('0x11')]){isOldTokenSent=![];if(!_0x56d038['license']&&_0x56d038[_0xf815('0x12')]!=_0x344fea[_0xf815('0x12')]||_0x56d038[_0xf815('0x12')]&&_0x56d038['data2']){logger['info'](_0xf815('0x13'));}if(_0x56d038[_0xf815('0x12')]&&!_0x56d038['data2']&&_0x56d038[_0xf815('0x12')]!=_0x344fea[_0xf815('0x12')]){logger[_0xf815('0x14')](_0xf815('0x15'));}if(_0x56d038[_0xf815('0x12')]&&!_0x56d038[_0xf815('0xf')]&&_0x56d038['license']==_0x344fea[_0xf815('0x12')]){return _0x32abba;}return _0x32abba[_0xf815('0x16')]({'data1':_0x1cd4a4,'data2':null,'license':_0x344fea[_0xf815('0x12')]});}else{if(_0x344fea['license']||_0x56d038[_0xf815('0x12')]){if(!_0x56d038[_0xf815('0xf')]){if(_0x56d038[_0xf815('0x10')]==_0x1cd4a4){GRAY_PERIOD_REASON=_0xf815('0x17');logger[_0xf815('0x14')](_0xf815('0x18'));}else{GRAY_PERIOD_REASON=_0xf815('0x19');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56d038[_0xf815('0x10')],_0x1cd4a4);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xf815('0x1a')](),moment()['format'](_0xf815('0x1b')));return _0x32abba[_0xf815('0x16')]({'data2':encryptor[_0xf815('0x1c')](moment()[_0xf815('0xa')](_0xf815('0x1b')))});}else{if(moment()[_0xf815('0x1d')](encryptor['decryptString'](_0x56d038[_0xf815('0xf')]),_0xf815('0x1e'))>DAYS){logger[_0xf815('0x14')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xf815('0x1b')));isOldTokenSent=![];return _0x32abba['update']({'data1':_0x1cd4a4,'data2':null,'license':null});}}}else{if(_0x56d038[_0xf815('0x10')]!=_0x1cd4a4){logger['info'](_0xf815('0x1f'),_0x56d038[_0xf815('0x10')],_0x1cd4a4);return _0x32abba[_0xf815('0x16')]({'data1':_0x1cd4a4,'data2':null,'license':null});}}}return _0x32abba;})['then'](function(_0x2adcc6){_0x32abba=_0x2adcc6;})[_0xf815('0x20')](function(_0x2dcf78){logger['error'](_0x2dcf78[_0xf815('0x21')]);})[_0xf815('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x32abba);},TIME);});}function defaultLicense(){var _0x56b8f0=hardware[_0xf815('0x23')]();if(_0x56b8f0){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x56b8f0}})[_0xf815('0x24')](function(_0x26f03c,_0x34f33b){logger[_0xf815('0x14')](_0xf815('0x25'),_0x56b8f0);manageLicense(_0x56b8f0,_0x26f03c);})['catch'](function(_0x2fb8da){logger['error'](_0x2fb8da[_0xf815('0x21')]);});}}exports[_0xf815('0x26')]=defaultLicense; \ No newline at end of file +var _0x0ab7=['license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','util','request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then'];(function(_0x3937c4,_0x208957){var _0x3fb9f1=function(_0x4f0958){while(--_0x4f0958){_0x3937c4['push'](_0x3937c4['shift']());}};_0x3fb9f1(++_0x208957);}(_0x0ab7,0x1aa));var _0x70ab=function(_0x2fdb06,_0x10145b){_0x2fdb06=_0x2fdb06-0x0;var _0x47a340=_0x0ab7[_0x2fdb06];return _0x47a340;};'use strict';var util=require(_0x70ab('0x0'));var moment=require('moment');var rp=require(_0x70ab('0x1'));var BPromise=require(_0x70ab('0x2'));var pkginfo=require(_0x70ab('0x3'))(module,_0x70ab('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x70ab('0x5'));var hardware=require('./hardware');var logger=require(_0x70ab('0x6'))('license');var HOST=_0x70ab('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5a92d3){return new BPromise(function(_0x2b678d,_0x3ea6c0){var _0x53a8d4=util[_0x70ab('0x8')](_0x70ab('0x9'),HOST,_0x5a92d3,module[_0x70ab('0xa')][_0x70ab('0x4')]);if(oldToken){_0x53a8d4=util[_0x70ab('0x8')](_0x70ab('0xb'),HOST,_0x5a92d3,module[_0x70ab('0xa')][_0x70ab('0x4')],oldToken);}var _0x3e7cea={'uri':_0x53a8d4,'method':_0x70ab('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3e7cea)['then'](function(_0x4b9480){_0x2b678d(_0x4b9480);})[_0x70ab('0xd')](function(_0x63f13e){_0x3ea6c0(_0x63f13e);});});}function manageLicense(_0x4cb981,_0x4b5942){var _0x1e490d=_0x4b5942[_0x70ab('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x1e490d[_0x70ab('0xf')]!==_0x4cb981&&!_0x1e490d[_0x70ab('0x10')]){oldToken=_0x1e490d[_0x70ab('0xf')];}httpRequest(_0x4cb981)[_0x70ab('0x11')](function(_0x1dcaa7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1dcaa7['active']){isOldTokenSent=![];if(!_0x1e490d[_0x70ab('0x12')]&&_0x1e490d[_0x70ab('0x12')]!=_0x1dcaa7[_0x70ab('0x12')]||_0x1e490d[_0x70ab('0x12')]&&_0x1e490d[_0x70ab('0x10')]){logger[_0x70ab('0x13')](_0x70ab('0x14'));}if(_0x1e490d['license']&&!_0x1e490d['data2']&&_0x1e490d[_0x70ab('0x12')]!=_0x1dcaa7[_0x70ab('0x12')]){logger['info'](_0x70ab('0x15'));}if(_0x1e490d[_0x70ab('0x12')]&&!_0x1e490d[_0x70ab('0x10')]&&_0x1e490d[_0x70ab('0x12')]==_0x1dcaa7['license']){return _0x4b5942;}return _0x4b5942[_0x70ab('0x16')]({'data1':_0x4cb981,'data2':null,'license':_0x1dcaa7[_0x70ab('0x12')]});}else{if(_0x1dcaa7[_0x70ab('0x12')]||_0x1e490d[_0x70ab('0x12')]){if(!_0x1e490d[_0x70ab('0x10')]){if(_0x1e490d[_0x70ab('0xf')]==_0x4cb981){GRAY_PERIOD_REASON=_0x70ab('0x17');logger[_0x70ab('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x70ab('0x18');logger[_0x70ab('0x13')](_0x70ab('0x19'),_0x1e490d[_0x70ab('0xf')],_0x4cb981);}logger['info'](_0x70ab('0x1a'),GRAY_PERIOD_REASON[_0x70ab('0x1b')](),moment()[_0x70ab('0x8')](_0x70ab('0x1c')));return _0x4b5942['update']({'data2':encryptor['encryptString'](moment()[_0x70ab('0x8')](_0x70ab('0x1c')))});}else{if(moment()['diff'](encryptor[_0x70ab('0x1d')](_0x1e490d[_0x70ab('0x10')]),'days')>DAYS){logger[_0x70ab('0x13')](_0x70ab('0x1e'),moment()[_0x70ab('0x8')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4b5942[_0x70ab('0x16')]({'data1':_0x4cb981,'data2':null,'license':null});}}}else{if(_0x1e490d['data1']!=_0x4cb981){logger[_0x70ab('0x13')](_0x70ab('0x19'),_0x1e490d[_0x70ab('0xf')],_0x4cb981);return _0x4b5942[_0x70ab('0x16')]({'data1':_0x4cb981,'data2':null,'license':null});}}}return _0x4b5942;})[_0x70ab('0x11')](function(_0x4b7353){_0x4b5942=_0x4b7353;})[_0x70ab('0xd')](function(_0x552f7d){logger[_0x70ab('0x1f')](_0x552f7d[_0x70ab('0x20')]);})[_0x70ab('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x70ab('0x22')](),_0x4b5942);},TIME);});}function defaultLicense(){var _0x504783=hardware[_0x70ab('0x22')]();if(_0x504783){return db[_0x70ab('0x23')][_0x70ab('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x504783}})['spread'](function(_0x2628be,_0x46b0ed){logger[_0x70ab('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x504783);manageLicense(_0x504783,_0x2628be);})[_0x70ab('0xd')](function(_0x39e5c6){logger[_0x70ab('0x1f')](_0x39e5c6[_0x70ab('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 03ba0ae..2ce8408 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 _0xa2a0=['message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','gray','days','changed','disabled'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xa2a0,0x95));var _0x0a2a=function(_0x48f1ed,_0x39ae8c){_0x48f1ed=_0x48f1ed-0x0;var _0x1bf2dc=_0xa2a0[_0x48f1ed];return _0x1bf2dc;};'use strict';var util=require(_0x0a2a('0x0'));var _=require(_0x0a2a('0x1'));var moment=require(_0x0a2a('0x2'));var BPromise=require(_0x0a2a('0x3'));var hardware=require(_0x0a2a('0x4'));var encryptor=require(_0x0a2a('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0a2a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x0a2a('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0a2a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0a2a('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x115695){return new BPromise(function(_0x5cbd64,_0x25a49a){return db[_0x0a2a('0x9')]['find'](_['defaults'](_0x115695,{'raw':!![],'where':{'id':0x1}}))[_0x0a2a('0xa')](function(_0x279558){return checkLicense(_0x279558,null);})['then'](function(_0xc894c3){_0x5cbd64(_0xc894c3);return;})[_0x0a2a('0xb')](function(_0x40d7f3){_0x25a49a(_0x40d7f3);});});}function checkLicense(_0x56d9a3,_0x483d06){if(!_0x56d9a3){demoLicense[_0x0a2a('0xc')]=_0x56d9a3[_0x0a2a('0xd')];return demoLicense;}try{var _0x416891=_0x483d06||_0x56d9a3['license'];if(_[_0x0a2a('0xe')](_0x416891)){throw new Error(_0x0a2a('0xf'));}var _0x1aa2a5=_0x56d9a3[_0x0a2a('0xd')];var _0x6c65f5=_0x56d9a3[_0x0a2a('0x10')];var _0x51faf7=_0x1aa2a5[_0x0a2a('0x11')]('-')[0x4];var _0x26c74c=_0x1aa2a5[_0x0a2a('0x11')]('-')[0x0];var _0x2af35a=encryptor[_0x0a2a('0x12')](_0x416891,util[_0x0a2a('0x13')]('%s:%s:%s',_0x51faf7,_0x1aa2a5,_0x26c74c));var _0x32d624=JSON[_0x0a2a('0x14')](_0x2af35a);_0x32d624[_0x0a2a('0x15')]=![];_0x32d624[_0x0a2a('0xc')]=_0x1aa2a5;_0x32d624[_0x0a2a('0x16')]=hardware[_0x0a2a('0x7')]();if(_0x6c65f5){var _0x41ffea=encryptor[_0x0a2a('0x12')](_0x6c65f5);_0x32d624[_0x0a2a('0x17')]=_0x41ffea;_0x32d624['deadline']=moment(_0x41ffea)['add'](0x7,_0x0a2a('0x18'))['format']();_0x32d624['grayReason']=_0x32d624['uuid']!=_0x32d624[_0x0a2a('0x16')]?_0x0a2a('0x19'):_0x0a2a('0x1a');}return _0x32d624;}catch(_0x3df0f8){breakingLicense[_0x0a2a('0xc')]=_0x56d9a3[_0x0a2a('0xd')];breakingLicense[_0x0a2a('0x1b')]=_0x3df0f8[_0x0a2a('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xb3605,_0x579a02){getLicense()[_0x0a2a('0xa')](function(_0x216012){return db[_0x0a2a('0x1c')][_0x0a2a('0x1d')]({'attributes':[_0x0a2a('0x1e'),[db[_0x0a2a('0x1f')]['fn'](_0x0a2a('0x20'),db[_0x0a2a('0x1f')][_0x0a2a('0x21')](_0x0a2a('0x1e'))),_0x0a2a('0x22')]],'group':_0x0a2a('0x1e'),'where':{'role':{'$or':[_0x0a2a('0x23'),_0x0a2a('0x24'),_0x0a2a('0x25')]}},'raw':!![]})[_0x0a2a('0xa')](function(_0x330c7f){var _0x93a828={'user':_0x216012[_0x0a2a('0x26')]||0x0,'telephone':_0x216012['telephones']||0x0};_0x330c7f[_0x0a2a('0x27')](function(_0x1d1584){var _0x37ec8c=_0x1d1584[_0x0a2a('0x1e')]==='admin'?_0x0a2a('0x24'):_0x1d1584[_0x0a2a('0x1e')];_0x93a828[_0x37ec8c]-=_0x1d1584[_0x0a2a('0x22')];if(_0x93a828[_0x37ec8c]<0x0)_0x93a828[_0x37ec8c]=0x0;});_0xb3605(_0x93a828);return;});})['catch'](function(_0x5d6646){_0x579a02(_0x5d6646);});});}function checkUserLimits(_0x5b0c06){return new BPromise(function(_0x34ea7c,_0x5df5dd){getLimits()[_0x0a2a('0xa')](function(_0x1468a1){var _0x55eebd=_['pick'](_[_0x0a2a('0x28')](_0x5b0c06,_0x0a2a('0x1e')),[_0x0a2a('0x23'),_0x0a2a('0x24'),'telephone']);var _0x3cbe43=(_0x55eebd['admin']||0x0)+(_0x55eebd[_0x0a2a('0x24')]||0x0);var _0x2765f9=_0x55eebd['telephone']||0x0;if(_0x3cbe43>_0x1468a1['user'])return _0x5df5dd(_0x0a2a('0x29'));if(_0x2765f9>_0x1468a1[_0x0a2a('0x25')])return _0x5df5dd(_0x0a2a('0x2a'));return _0x34ea7c();})[_0x0a2a('0xb')](function(_0x444f63){_0x5df5dd(_0x444f63);});});}module[_0x0a2a('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xa31e=['Demo\x20license','getUuid','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xa31e,0x187));var _0xea31=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0xa31e[_0x2de020];return _0x182b7c;};'use strict';var util=require('util');var _=require(_0xea31('0x0'));var moment=require(_0xea31('0x1'));var BPromise=require(_0xea31('0x2'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0xea31('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xea31('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xea31('0x5'),'machineUuid':hardware[_0xea31('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xea31('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xea31('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4081f4){return new BPromise(function(_0x4dbe4f,_0x575851){return db['License'][_0xea31('0x7')](_[_0xea31('0x8')](_0x4081f4,{'raw':!![],'where':{'id':0x1}}))[_0xea31('0x9')](function(_0x9a4f5){return checkLicense(_0x9a4f5,null);})['then'](function(_0x2e3e5c){_0x4dbe4f(_0x2e3e5c);return;})[_0xea31('0xa')](function(_0x22b1ec){_0x575851(_0x22b1ec);});});}function checkLicense(_0x403a0a,_0x3558cf){if(!_0x403a0a){demoLicense[_0xea31('0xb')]=_0x403a0a[_0xea31('0xc')];return demoLicense;}try{var _0x3f176d=_0x3558cf||_0x403a0a['license'];if(_[_0xea31('0xd')](_0x3f176d)){throw new Error(_0xea31('0xe'));}var _0x573efa=_0x403a0a[_0xea31('0xc')];var _0xed6adb=_0x403a0a[_0xea31('0xf')];var _0xbb2718=_0x573efa[_0xea31('0x10')]('-')[0x4];var _0x11c683=_0x573efa[_0xea31('0x10')]('-')[0x0];var _0x343814=encryptor[_0xea31('0x11')](_0x3f176d,util[_0xea31('0x12')](_0xea31('0x13'),_0xbb2718,_0x573efa,_0x11c683));var _0x2391f9=JSON[_0xea31('0x14')](_0x343814);_0x2391f9[_0xea31('0x15')]=![];_0x2391f9[_0xea31('0xb')]=_0x573efa;_0x2391f9[_0xea31('0x16')]=hardware[_0xea31('0x6')]();if(_0xed6adb){var _0x5c23be=encryptor[_0xea31('0x11')](_0xed6adb);_0x2391f9[_0xea31('0x17')]=_0x5c23be;_0x2391f9[_0xea31('0x18')]=moment(_0x5c23be)[_0xea31('0x19')](0x7,'days')[_0xea31('0x12')]();_0x2391f9['grayReason']=_0x2391f9['uuid']!=_0x2391f9['machineUuid']?'changed':'disabled';}return _0x2391f9;}catch(_0x4f52a7){breakingLicense['uuid']=_0x403a0a[_0xea31('0xc')];breakingLicense['message']=_0x4f52a7[_0xea31('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x235483,_0x5d3fd0){getLicense()[_0xea31('0x9')](function(_0x2d2525){return db[_0xea31('0x1b')][_0xea31('0x1c')]({'attributes':[_0xea31('0x1d'),[db[_0xea31('0x1e')]['fn'](_0xea31('0x1f'),db['sequelize'][_0xea31('0x20')]('role')),_0xea31('0x21')]],'group':_0xea31('0x1d'),'where':{'role':{'$or':[_0xea31('0x22'),'user',_0xea31('0x23')]}},'raw':!![]})[_0xea31('0x9')](function(_0x4fd635){var _0xf440ec={'user':_0x2d2525[_0xea31('0x24')]||0x0,'telephone':_0x2d2525[_0xea31('0x25')]||0x0};_0x4fd635[_0xea31('0x26')](function(_0x418934){var _0x19f7a7=_0x418934[_0xea31('0x1d')]===_0xea31('0x22')?_0xea31('0x27'):_0x418934[_0xea31('0x1d')];_0xf440ec[_0x19f7a7]-=_0x418934[_0xea31('0x21')];if(_0xf440ec[_0x19f7a7]<0x0)_0xf440ec[_0x19f7a7]=0x0;});_0x235483(_0xf440ec);return;});})[_0xea31('0xa')](function(_0x3f9529){_0x5d3fd0(_0x3f9529);});});}function checkUserLimits(_0x3426c4){return new BPromise(function(_0x426fe2,_0x5c3bb6){getLimits()[_0xea31('0x9')](function(_0x4313c7){var _0x16bd77=_[_0xea31('0x28')](_['countBy'](_0x3426c4,'role'),[_0xea31('0x22'),_0xea31('0x27'),_0xea31('0x23')]);var _0x3ddff0=(_0x16bd77[_0xea31('0x22')]||0x0)+(_0x16bd77['user']||0x0);var _0x18f964=_0x16bd77[_0xea31('0x23')]||0x0;if(_0x3ddff0>_0x4313c7['user'])return _0x5c3bb6(_0xea31('0x29'));if(_0x18f964>_0x4313c7[_0xea31('0x23')])return _0x5c3bb6(_0xea31('0x2a'));return _0x426fe2();})[_0xea31('0xa')](function(_0x3e6825){_0x5c3bb6(_0x3e6825);});});}module[_0xea31('0x2b')]={'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 2f853aa..4674209 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 _0x3423=['app-id','secret','myappanuglar-secret'];(function(_0x260492,_0x2a00e6){var _0x647031=function(_0x403c41){while(--_0x403c41){_0x260492['push'](_0x260492['shift']());}};_0x647031(++_0x2a00e6);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3342('0x0'),'GOOGLE_ID':_0x3342('0x1'),'GOOGLE_SECRET':_0x3342('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x5204=['http://localhost:9000','app-id','secret','exports'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x5204,0xdf));var _0x4520=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5204[_0x1c8c28];return _0x1f59b4;};'use strict';module[_0x4520('0x0')]={'DOMAIN':_0x4520('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4520('0x2'),'GOOGLE_SECRET':_0x4520('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 64c2069..c2c2146 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd9c=['exports','../utils/loggers','fileLogger'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xdd9c,0x136));var _0xcdd9=function(_0x4328dc,_0x22e089){_0x4328dc=_0x4328dc-0x0;var _0x66a21d=_0xdd9c[_0x4328dc];return _0x66a21d;};'use strict';var fileLogger=require(_0xcdd9('0x0'))[_0xcdd9('0x1')];module[_0xcdd9('0x2')]=fileLogger; \ No newline at end of file +var _0x26fa=['fileLogger','exports','../utils/loggers'];(function(_0x22bd20,_0x4802d5){var _0x590d41=function(_0x1934bc){while(--_0x1934bc){_0x22bd20['push'](_0x22bd20['shift']());}};_0x590d41(++_0x4802d5);}(_0x26fa,0x86));var _0xa26f=function(_0x5b1ae3,_0x2ceced){_0x5b1ae3=_0x5b1ae3-0x0;var _0x1af885=_0x26fa[_0x5b1ae3];return _0x1af885;};'use strict';var fileLogger=require(_0xa26f('0x0'))[_0xa26f('0x1')];module[_0xa26f('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 37396f7..2f36a4d 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 _0x787d=['xdr','../../services/xdr/index.js','path','resolve','join','legacy-libs','express','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0xa6aa71,_0x2a5f0c){var _0x3c02cb=function(_0x3b57e2){while(--_0x3b57e2){_0xa6aa71['push'](_0xa6aa71['shift']());}};_0x3c02cb(++_0x2a5f0c);}(_0x787d,0x13d));var _0xd787=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x787d[_0x20589d];return _0x422de9;};'use strict';var path=require(_0xd787('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0xd787('0x1')](path[_0xd787('0x2')](cfg['root'],_0xd787('0x3')))};var pm2config={'apps':[{'name':_0xd787('0x4'),'script':path[_0xd787('0x2')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xd787('0x5'),'script':path[_0xd787('0x2')](__dirname,_0xd787('0x6')),'env':env},{'name':_0xd787('0x7'),'script':path[_0xd787('0x2')](__dirname,_0xd787('0x8')),'env':env},{'name':_0xd787('0x9'),'script':path[_0xd787('0x2')](__dirname,_0xd787('0xa')),'env':env},{'name':_0xd787('0xb'),'script':path[_0xd787('0x2')](__dirname,_0xd787('0xc')),'env':env},{'name':_0xd787('0xd'),'script':path[_0xd787('0x2')](__dirname,_0xd787('0xe')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xfce5=['resolve','join','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment'];(function(_0x35f214,_0x3451c3){var _0x50b58e=function(_0x6be7e3){while(--_0x6be7e3){_0x35f214['push'](_0x35f214['shift']());}};_0x50b58e(++_0x3451c3);}(_0xfce5,0x11e));var _0x5fce=function(_0xd19f1f,_0x4e9015){_0xd19f1f=_0xd19f1f-0x0;var _0x409c77=_0xfce5[_0xd19f1f];return _0x409c77;};'use strict';var path=require(_0x5fce('0x0'));var cfg=require(_0x5fce('0x1'));var env={'NODE_PATH':path[_0x5fce('0x2')](path[_0x5fce('0x3')](cfg['root'],_0x5fce('0x4')))};var pm2config={'apps':[{'name':_0x5fce('0x5'),'script':path['join'](__dirname,_0x5fce('0x6')),'env':env},{'name':'ami','script':path[_0x5fce('0x3')](__dirname,_0x5fce('0x7')),'env':env},{'name':_0x5fce('0x8'),'script':path[_0x5fce('0x3')](__dirname,_0x5fce('0x9')),'env':env},{'name':'email','script':path['join'](__dirname,_0x5fce('0xa')),'env':env},{'name':_0x5fce('0xb'),'script':path[_0x5fce('0x3')](__dirname,_0x5fce('0xc')),'env':env},{'name':_0x5fce('0xd'),'script':path[_0x5fce('0x3')](__dirname,_0x5fce('0xe')),'env':env}]};module[_0x5fce('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 54228c8..6d5b6ca 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 _0xbb0e=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xbb0e,0x1a2));var _0xebb0=function(_0x349b60,_0x299597){_0x349b60=_0x349b60-0x0;var _0x29cfa0=_0xbb0e[_0x349b60];return _0x29cfa0;};'use strict';var pm2=require('pm2');var BPromise=require(_0xebb0('0x0'));var config=require(_0xebb0('0x1'));function connect(){return new BPromise(function(_0x48dd2c,_0x4de4d7){return pm2[_0xebb0('0x2')](function(_0x2071df){if(_0x2071df){return _0x4de4d7(_0x2071df);}return _0x48dd2c(_0xebb0('0x3'));});});};exports[_0xebb0('0x4')]=function(_0x456054){return connect()[_0xebb0('0x5')](function(){return new BPromise(function(_0x22ef41,_0x32d200){return pm2[_0xebb0('0x4')](_0x456054,function(_0x595b93,_0xbb3609){if(_0x595b93){return _0x32d200(_0x595b93);}pm2[_0xebb0('0x6')]();return _0x22ef41(_0xbb3609);});});});};exports[_0xebb0('0x7')]=function(_0x585407){return connect()[_0xebb0('0x5')](function(){return new BPromise(function(_0x23fe25,_0x3742f1){return pm2[_0xebb0('0x7')](_0x585407,function(_0x458dc7,_0x26f468){if(_0x458dc7){return _0x3742f1(_0x458dc7);}pm2[_0xebb0('0x6')]();return _0x23fe25(_0x26f468);});});});};exports['restart']=function(_0x5876b8){return connect()['then'](function(){return new BPromise(function(_0x2d588b,_0x559077){return pm2[_0xebb0('0x8')](_0x5876b8,function(_0x3e2fe6,_0x3c0650){if(_0x3e2fe6){return _0x559077(_0x3e2fe6);}pm2[_0xebb0('0x6')]();return _0x2d588b(_0x3c0650);});});});};exports[_0xebb0('0x9')]=function(){return connect()[_0xebb0('0x5')](function(){return new BPromise(function(_0xb7804a,_0x14a68a){return pm2[_0xebb0('0x9')](function(_0x32a602,_0x5ccb6e){if(_0x32a602){return _0x14a68a(_0x32a602);}pm2[_0xebb0('0x6')]();return _0xb7804a(_0x5ccb6e);});});});};exports[_0xebb0('0xa')]=function(_0x351c07){return connect()[_0xebb0('0x5')](function(){return new BPromise(function(_0xa90ff6,_0x5b197c){return pm2[_0xebb0('0xa')](_0x351c07,function(_0x173240,_0x53c062){if(_0x173240){return _0x5b197c(_0x173240);}pm2['disconnect']();return _0xa90ff6(_0x53c062);});});});};exports[_0xebb0('0xb')]=function(_0x19054b){return connect()[_0xebb0('0x5')](function(){return new BPromise(function(_0x2153ee,_0x12cce9){return pm2[_0xebb0('0xb')](_0x19054b,function(_0x1edfe4,_0x16b54f){if(_0x1edfe4){return _0x12cce9(_0x1edfe4);}pm2[_0xebb0('0x6')]();return _0x2153ee(_0x16b54f);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x54a222,_0x47a965){return pm2[_0xebb0('0xc')](function(_0x1decbb){if(_0x1decbb){return _0x47a965(_0x1decbb);}return _0x54a222(_0xebb0('0xd'));});});});}; \ No newline at end of file +var _0xdf86=['stop','then','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0xdaa895,_0x2557ae){var _0x4d173d=function(_0xbc428d){while(--_0xbc428d){_0xdaa895['push'](_0xdaa895['shift']());}};_0x4d173d(++_0x2557ae);}(_0xdf86,0xbd));var _0x6df8=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0xdf86[_0x2e3545];return _0xcf18f;};'use strict';var pm2=require(_0x6df8('0x0'));var BPromise=require(_0x6df8('0x1'));var config=require(_0x6df8('0x2'));function connect(){return new BPromise(function(_0x1d6b88,_0x10fac0){return pm2[_0x6df8('0x3')](function(_0x455e7e){if(_0x455e7e){return _0x10fac0(_0x455e7e);}return _0x1d6b88(_0x6df8('0x4'));});});};exports[_0x6df8('0x5')]=function(_0x15788f){return connect()['then'](function(){return new BPromise(function(_0x11a64b,_0x54d94f){return pm2[_0x6df8('0x5')](_0x15788f,function(_0x563fc2,_0xfc8335){if(_0x563fc2){return _0x54d94f(_0x563fc2);}pm2['disconnect']();return _0x11a64b(_0xfc8335);});});});};exports[_0x6df8('0x6')]=function(_0x368612){return connect()[_0x6df8('0x7')](function(){return new BPromise(function(_0x157a95,_0x31fec0){return pm2[_0x6df8('0x6')](_0x368612,function(_0x417a6b,_0x44ca4b){if(_0x417a6b){return _0x31fec0(_0x417a6b);}pm2[_0x6df8('0x8')]();return _0x157a95(_0x44ca4b);});});});};exports['restart']=function(_0x4da73a){return connect()[_0x6df8('0x7')](function(){return new BPromise(function(_0x454bbf,_0x334a67){return pm2[_0x6df8('0x9')](_0x4da73a,function(_0x2ad21b,_0x16a5ff){if(_0x2ad21b){return _0x334a67(_0x2ad21b);}pm2[_0x6df8('0x8')]();return _0x454bbf(_0x16a5ff);});});});};exports[_0x6df8('0xa')]=function(){return connect()[_0x6df8('0x7')](function(){return new BPromise(function(_0x379763,_0xced69a){return pm2[_0x6df8('0xa')](function(_0x22213d,_0x25a748){if(_0x22213d){return _0xced69a(_0x22213d);}pm2[_0x6df8('0x8')]();return _0x379763(_0x25a748);});});});};exports[_0x6df8('0xb')]=function(_0x49e61b){return connect()['then'](function(){return new BPromise(function(_0x2adf84,_0x1d768b){return pm2['describe'](_0x49e61b,function(_0x3d2a8a,_0x1c6cfe){if(_0x3d2a8a){return _0x1d768b(_0x3d2a8a);}pm2['disconnect']();return _0x2adf84(_0x1c6cfe);});});});};exports['delete']=function(_0xb50d2b){return connect()[_0x6df8('0x7')](function(){return new BPromise(function(_0x54a9fc,_0xbd08af){return pm2[_0x6df8('0xc')](_0xb50d2b,function(_0x15f6b0,_0x2c3bb9){if(_0x15f6b0){return _0xbd08af(_0x15f6b0);}pm2[_0x6df8('0x8')]();return _0x54a9fc(_0x2c3bb9);});});});};exports[_0x6df8('0xd')]=function(){return connect()[_0x6df8('0x7')](function(){return new BPromise(function(_0xc365ac,_0x22cbd7){return pm2['dump'](function(_0x3629a4){if(_0x3629a4){return _0x22cbd7(_0x3629a4);}return _0xc365ac(_0x6df8('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index cb7d922..7c3c271 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 _0x13fa=['../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util'];(function(_0x118129,_0x18ce7c){var _0x556949=function(_0x305a52){while(--_0x305a52){_0x118129['push'](_0x118129['shift']());}};_0x556949(++_0x18ce7c);}(_0x13fa,0x152));var _0xa13f=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0x13fa[_0xff659d];return _0x19c170;};'use strict';var _=require(_0xa13f('0x0'));var moment=require(_0xa13f('0x1'));var Redis=require('ioredis');var util=require(_0xa13f('0x2'));var config=require(_0xa13f('0x3'));var db=require(_0xa13f('0x4'))['db'];var logger=require(_0xa13f('0x5'))('schedule');config[_0xa13f('0x6')]=_['defaults'](config['redis'],{'host':_0xa13f('0x7'),'port':0x18eb});var io=require(_0xa13f('0x8'))(new Redis(config[_0xa13f('0x6')]));function closeInteractions(){var _0x5073fc=0x0;var _0x5612a4=[];return db[_0xa13f('0x9')][_0xa13f('0xa')]({'raw':!![],'attributes':['id',_0xa13f('0xb')],'where':{'id':0x1}})['then'](function(_0x2bbc65){_0x5073fc=_0x2bbc65[_0xa13f('0xb')];if(_0x5073fc){return db[_0xa13f('0xc')][_0xa13f('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2bbc65[_0xa13f('0xb')],_0xa13f('0xe'))}}});}else{return[];}})['then'](function(_0x5c41d8){if(_0x5c41d8&&_0x5c41d8[_0xa13f('0xf')]){_0x5612a4=_[_0xa13f('0x10')](_0x5c41d8||[],'id');logger[_0xa13f('0x11')](_0xa13f('0x12'),_0x5612a4['join']());return db['ChatInteraction'][_0xa13f('0x13')]({'closeReason':'system','disposition':_0xa13f('0x14'),'closed':!![],'closedAt':moment()[_0xa13f('0x15')](_0xa13f('0x16'))},{'where':{'id':_0x5612a4}});}})[_0xa13f('0x17')](function(){if(_0x5612a4&&_0x5612a4[_0xa13f('0xf')]){logger[_0xa13f('0x11')](_0xa13f('0x18'),_0x5612a4[_0xa13f('0x19')]());for(var _0x24ea93=0x0;_0x24ea93<_0x5612a4[_0xa13f('0xf')];_0x24ea93++){io[_0xa13f('0x1a')]('chatInteraction:update',{'id':_0x5612a4[_0x24ea93],'closed':!![]});}}})[_0xa13f('0x1b')](function(_0x1bd509){logger[_0xa13f('0x1c')](_0xa13f('0x1d'),_0x1bd509?util[_0xa13f('0x1e')](_0x1bd509,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd53d=['emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53d,0x10d));var _0xdd53=function(_0x5c33b7,_0xdfd18e){_0x5c33b7=_0x5c33b7-0x0;var _0x4dc885=_0xd53d[_0x5c33b7];return _0x4dc885;};'use strict';var _=require(_0xdd53('0x0'));var moment=require(_0xdd53('0x1'));var Redis=require(_0xdd53('0x2'));var util=require(_0xdd53('0x3'));var config=require(_0xdd53('0x4'));var db=require(_0xdd53('0x5'))['db'];var logger=require(_0xdd53('0x6'))(_0xdd53('0x7'));config[_0xdd53('0x8')]=_[_0xdd53('0x9')](config[_0xdd53('0x8')],{'host':_0xdd53('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdd53('0x8')]));function closeInteractions(){var _0xa74290=0x0;var _0x38c9b7=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xdd53('0xb')],'where':{'id':0x1}})[_0xdd53('0xc')](function(_0x5b89aa){_0xa74290=_0x5b89aa[_0xdd53('0xb')];if(_0xa74290){return db['ChatInteraction'][_0xdd53('0xd')]({'raw':!![],'attributes':['id',_0xdd53('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xdd53('0xf')](_0x5b89aa[_0xdd53('0xb')],_0xdd53('0x10'))}}});}else{return[];}})[_0xdd53('0xc')](function(_0x588e53){if(_0x588e53&&_0x588e53[_0xdd53('0x11')]){_0x38c9b7=_[_0xdd53('0x12')](_0x588e53||[],'id');logger[_0xdd53('0x13')](_0xdd53('0x14'),_0x38c9b7[_0xdd53('0x15')]());return db[_0xdd53('0x16')][_0xdd53('0x17')]({'closeReason':_0xdd53('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xdd53('0x19')](_0xdd53('0x1a'))},{'where':{'id':_0x38c9b7}});}})[_0xdd53('0xc')](function(){if(_0x38c9b7&&_0x38c9b7[_0xdd53('0x11')]){logger[_0xdd53('0x13')](_0xdd53('0x1b'),_0x38c9b7[_0xdd53('0x15')]());for(var _0x87527b=0x0;_0x87527b<_0x38c9b7['length'];_0x87527b++){io[_0xdd53('0x1c')]('chatInteraction:update',{'id':_0x38c9b7[_0x87527b],'closed':!![]});}}})[_0xdd53('0x1d')](function(_0x1a72d2){logger[_0xdd53('0x1e')](_0xdd53('0x1f'),_0x1a72d2?util['inspect'](_0x1a72d2,{'showHidden':![],'depth':null}):'');});}exports[_0xdd53('0x20')]=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 801f07a..ece99a1 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 _0x28db=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x30e7c8,_0x274a96){var _0x3c0f94=function(_0x5b6d98){while(--_0x5b6d98){_0x30e7c8['push'](_0x30e7c8['shift']());}};_0x3c0f94(++_0x274a96);}(_0x28db,0x1e9));var _0xb28d=function(_0x4bb63c,_0x381028){_0x4bb63c=_0x4bb63c-0x0;var _0x354a13=_0x28db[_0x4bb63c];return _0x354a13;};'use strict';function start(){var _0x45ed5a=require(_0xb28d('0x0'));return _0x45ed5a[_0xb28d('0x1')]();}module[_0xb28d('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x8f44=['exports'];(function(_0x47adc7,_0x1fae6f){var _0x9beb15=function(_0x7a791f){while(--_0x7a791f){_0x47adc7['push'](_0x47adc7['shift']());}};_0x9beb15(++_0x1fae6f);}(_0x8f44,0xc8));var _0x48f4=function(_0x2121f1,_0x1804fc){_0x2121f1=_0x2121f1-0x0;var _0x4f9864=_0x8f44[_0x2121f1];return _0x4f9864;};'use strict';function start(){var _0x365519=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x365519['startAllRefreshIntervals']();}module[_0x48f4('0x0')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index a595015..ddd11b1 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 _0x20e6=['CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','toString','difference','intersection','exists','delete\x20cron','toRun','resolve','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','length','update','update\x20cron','deleteJob','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','number','findOne','error','info','Try\x20to\x20send\x20a\x20mail\x20to','email','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','%s.%s','basename','savename','extname','zip','join','existsSync','status','Sent','attachments','message','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','Empty','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Failed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error\x20mail','email\x20sent','catch','case\x20loading','retries','job','data','stop','operation','retry','still\x20loading','case\x20completed','case\x20empty','case\x20failed','Unrecognized\x20status:','entity','dataValues','attempt','Job\x20ID\x20','report\x20status:','MailAccount','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport'];(function(_0x100d32,_0x23ae21){var _0xd3ed5e=function(_0xd3d35a){while(--_0xd3d35a){_0x100d32['push'](_0x100d32['shift']());}};_0xd3ed5e(++_0x23ae21);}(_0x20e6,0x8b));var _0x620e=function(_0x918107,_0x5aa320){_0x918107=_0x918107-0x0;var _0x12d7e9=_0x20e6[_0x918107];return _0x12d7e9;};'use strict';var fs=require('fs');var util=require(_0x620e('0x0'));var path=require('path');var _=require(_0x620e('0x1'));var moment=require(_0x620e('0x2'));var CronJobManager=require(_0x620e('0x3'));var jayson=require(_0x620e('0x4'));var BPromise=require(_0x620e('0x5'));var logger=require(_0x620e('0x6'))('schedule');var db=require(_0x620e('0x7'))['db'];const retry=require('retry');var analyticCustomReportController=require(_0x620e('0x8'));var analyticDefaultReportController=require(_0x620e('0x9'));var client=jayson[_0x620e('0xa')][_0x620e('0xb')]({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x36c838){const _0x1f3718={};if(typeof _0x36c838===_0x620e('0xc')){_0x1f3718['id']=_0x36c838;}return db['AnalyticExtractedReport'][_0x620e('0xd')]({'where':_0x1f3718})['then'](function(_0x2b01ab){return _0x2b01ab;})['catch'](function(_0x519187){logger[_0x620e('0xe')](_0x519187);});}function handleSendEmail(_0xad5d0a,_0x36aaf9){logger[_0x620e('0xf')](_0x620e('0x10'),_0xad5d0a[_0x620e('0x11')]);var _0x39856d=!![];var _0x16cf2d=_0xad5d0a['MailAccount']['getSmtpOptions']();var _0x5d28e5={'account':_0x16cf2d,'message':{'from':util[_0x620e('0x12')](_0x620e('0x13'),_0xad5d0a['MailAccount'][_0x620e('0x14')],_0xad5d0a['MailAccount'][_0x620e('0x11')]||_0xad5d0a['MailAccount'][_0x620e('0x15')][_0x620e('0x16')]),'to':_0xad5d0a[_0x620e('0x11')],'cc':_0xad5d0a['cc'],'bcc':_0xad5d0a[_0x620e('0x17')],'subject':util[_0x620e('0x12')](_0x620e('0x18'),_0x36aaf9[_0x620e('0x14')],_0xad5d0a[_0x620e('0x19')],_0xad5d0a['subtractUnit'])}};var _0x1e6d61=path['join'](__dirname,_0x620e('0x1a'));var _0x4f58b5=_0x36aaf9['savename'];var _0x321764=util['format'](_0x620e('0x1b'),path[_0x620e('0x1c')](_0x36aaf9[_0x620e('0x1d')],path[_0x620e('0x1e')](_0x36aaf9[_0x620e('0x1d')])),_0x620e('0x1f'));var _0x4606fc=path[_0x620e('0x20')](_0x1e6d61,_0x4f58b5);var _0x4a4c8d=path[_0x620e('0x20')](_0x1e6d61,_0x321764);if(fs[_0x620e('0x21')](_0x4606fc)){_0x36aaf9[_0x620e('0x22')]=_0x620e('0x23');_0x5d28e5['message'][_0x620e('0x24')]=[{'filename':_0x4f58b5,'path':_0x4606fc}];_0x5d28e5[_0x620e('0x25')][_0x620e('0x26')]=util['format'](_0x620e('0x27'),JSON[_0x620e('0x28')](_0x36aaf9,null,0x2));}else if(fs['existsSync'](_0x4a4c8d)){_0x36aaf9['status']=_0x620e('0x23');_0x5d28e5[_0x620e('0x25')][_0x620e('0x24')]=[{'filename':_0x321764,'path':_0x4a4c8d}];}else{if(_0x36aaf9[_0x620e('0x22')]===_0x620e('0x29')){_0x5d28e5['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xad5d0a[_0x620e('0x2a')]){_0x39856d=![];logger['info'](_0x620e('0x2b'));}}else if(_0x36aaf9[_0x620e('0x22')]===_0x620e('0x2c')){_0x5d28e5[_0x620e('0x25')][_0x620e('0x26')]='Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else if(_0x36aaf9[_0x620e('0x22')]===_0x620e('0x2d')){_0x5d28e5[_0x620e('0x25')][_0x620e('0x26')]=_0x620e('0x2e');}else if(_0x36aaf9[_0x620e('0x22')]===_0x620e('0x2f')){_0x5d28e5[_0x620e('0x25')]['text']=_0x620e('0x30');}else{logger[_0x620e('0xe')]('[handleSendEmail]\x20Unrecognized\x20status:',_0x36aaf9[_0x620e('0x22')]);}}if(_0x39856d){return client[_0x620e('0x31')](_0x620e('0x32'),_0x5d28e5)[_0x620e('0x33')](function(_0x6ee096){if(_0x6ee096[_0x620e('0xe')]){return logger[_0x620e('0xe')](_0x620e('0x34'),JSON[_0x620e('0x28')](_0x6ee096));}return logger[_0x620e('0xf')](_0x620e('0x35'));})[_0x620e('0x36')](function(_0x4861f0){return logger['error']('error\x20mail',JSON[_0x620e('0x28')](_0x4861f0));});}}function handleError(){return function(_0x1f3671){return logger[_0x620e('0xe')](JSON[_0x620e('0x28')](_0x1f3671));};}function loading(_0x3b08e9){logger[_0x620e('0xf')](_0x620e('0x37'));if(_0x3b08e9['currentAttempt']===_0x3b08e9['retryOptions'][_0x620e('0x38')]){handleSendEmail(_0x3b08e9[_0x620e('0x39')],_0x3b08e9[_0x620e('0x3a')]);_0x3b08e9['operation'][_0x620e('0x3b')]();}else{_0x3b08e9[_0x620e('0x3c')][_0x620e('0x3d')](_0x620e('0x3e'));}}function completed(_0x53a821){logger[_0x620e('0xf')](_0x620e('0x3f'));handleSendEmail(_0x53a821[_0x620e('0x39')],_0x53a821['data']);_0x53a821['operation'][_0x620e('0x3b')]();}function empty(_0x2d4c9c){logger[_0x620e('0xf')](_0x620e('0x40'));handleSendEmail(_0x2d4c9c[_0x620e('0x39')],_0x2d4c9c[_0x620e('0x3a')]);_0x2d4c9c[_0x620e('0x3c')]['stop']();}function failed(_0x46c7bb){logger[_0x620e('0xf')](_0x620e('0x41'));handleSendEmail(_0x46c7bb['job'],_0x46c7bb[_0x620e('0x3a')]);_0x46c7bb[_0x620e('0x3c')][_0x620e('0x3b')]();}function urecognized(_0x3277e8){logger[_0x620e('0xe')](_0x620e('0x42'),_0x3277e8[_0x620e('0x43')][_0x620e('0x44')][_0x620e('0x22')]);_0x3277e8[_0x620e('0x3c')][_0x620e('0x3b')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x1e4571,_0x5bddb9){const _0x42b852={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x12d3de=retry[_0x620e('0x3c')](_0x42b852);_0x12d3de[_0x620e('0x45')](_0x5dbc4e=>{logger['info'](_0x620e('0x46')+_0x1e4571['id']+'\x20Attempt\x20#:'+_0x5dbc4e);try{getReportData(_0x5bddb9['id'])[_0x620e('0x33')](function(_0x37e12f){_0x5bddb9=_0x37e12f;logger[_0x620e('0xf')]('report\x20status:',_0x37e12f[_0x620e('0x44')][_0x620e('0x22')]);if(!reportStatusStrategies[_0x37e12f[_0x620e('0x44')][_0x620e('0x22')]]){logger[_0x620e('0xe')](_0x620e('0x47'),_0x37e12f[_0x620e('0x44')][_0x620e('0x22')]);_0x12d3de[_0x620e('0x3d')]();}reportStatusStrategies[_0x37e12f[_0x620e('0x44')]['status']]({'operation':_0x12d3de,'currentAttempt':_0x5dbc4e,'retryOptions':_0x42b852,'job':_0x1e4571,'data':_0x5bddb9,'entity':_0x37e12f});});}catch(_0x9c1963){_0x12d3de[_0x620e('0x3d')](_0x9c1963);}});}function handleResult(_0x4924e1){return function(_0x292e5d){if(_0x4924e1['sendMail']&&_0x4924e1[_0x620e('0x48')]&&_0x4924e1['MailAccount']['Smtp']&&!_[_0x620e('0x49')](_0x4924e1[_0x620e('0x11')])){retryer(_0x4924e1,_0x292e5d);}};}function handleJob(_0x123431){return function(){try{if(_['isNil'](_0x123431[_0x620e('0x19')])){return logger[_0x620e('0xf')](_0x620e('0x4a'));}if(_[_0x620e('0x49')](_0x123431['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5d37f2={'startDate':moment()[_0x620e('0x4b')](_0x123431[_0x620e('0x19')],_0x123431[_0x620e('0x4c')])['format'](_0x620e('0x4d')),'endDate':moment()['format'](_0x620e('0x4d')),'type':_0x620e('0x4e'),'output':_0x123431[_0x620e('0x4f')],'name':_0x123431[_0x620e('0x14')]};if(!_[_0x620e('0x49')](_0x123431[_0x620e('0x50')])){logger[_0x620e('0xf')](_0x620e('0x51'),_0x123431['DefaultReportId']);return analyticDefaultReportController[_0x620e('0x52')]({'id':_0x123431['DefaultReportId']},_0x5d37f2)[_0x620e('0x33')](handleResult(_0x123431))['catch'](handleError());}if(!_[_0x620e('0x49')](_0x123431[_0x620e('0x53')])){logger[_0x620e('0xf')]('exec\x20custom\x20report\x20id:%s',_0x123431[_0x620e('0x53')]);return analyticCustomReportController[_0x620e('0x52')]({'id':_0x123431[_0x620e('0x53')]},_0x5d37f2)[_0x620e('0x33')](handleResult(_0x123431))['catch'](handleError());}}catch(_0x28dc29){logger[_0x620e('0xe')](JSON[_0x620e('0x28')](_0x28dc29));}return logger['info'](_0x620e('0x54'));};}function getJobs(_0x90f74c){var _0x19f07f={};if(_0x90f74c){_0x19f07f['id']=_0x90f74c;}return db[_0x620e('0x55')][_0x620e('0x56')]({'where':_0x19f07f,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x620e('0x11')],'include':[{'model':db['MailServerOut'],'as':_0x620e('0x15'),'include':[{'model':db[_0x620e('0x57')],'as':_0x620e('0x57')}]}]}]})[_0x620e('0x33')](function(_0x13098c){var _0x379bd1=_[_0x620e('0x58')](manager[_0x620e('0x59')]);var _0x850212=_[_0x620e('0x5a')](_0x13098c,function(_0x364d37){return _0x364d37['id'][_0x620e('0x5b')]();});var _0x324842=_['keyBy'](_0x13098c,function(_0x4ab5e5){return _0x4ab5e5['id']['toString']();});var _0x14bf3d=_0x90f74c?_0x850212:_[_0x620e('0x5c')](_0x850212,_0x379bd1);var _0x57f5f5=_[_0x620e('0x5d')](_0x850212,_0x379bd1);var _0x40e478=_['difference'](_0x379bd1,_0x850212);var _0x3a5f6d;var _0x3b0dc3;for(_0x3a5f6d=0x0;_0x3a5f6d<_0x40e478['length']&&!_0x90f74c;_0x3a5f6d+=0x1){_0x3b0dc3=_0x40e478[_0x3a5f6d][_0x620e('0x5b')]();if(manager[_0x620e('0x5e')](_0x3b0dc3)){manager[_0x620e('0x3b')](_0x3b0dc3);manager['deleteJob'](_0x3b0dc3);logger[_0x620e('0xf')](_0x620e('0x5f'),_0x3b0dc3);}}logger['info'](_0x620e('0x60'),JSON[_0x620e('0x28')](_0x14bf3d));for(_0x3a5f6d=0x0;_0x3a5f6d<_0x14bf3d['length'];_0x3a5f6d+=0x1){_0x3b0dc3=_0x14bf3d[_0x3a5f6d][_0x620e('0x5b')]();if(_0x90f74c){logger[_0x620e('0xf')](JSON[_0x620e('0x28')](_0x324842[_0x3b0dc3]));BPromise[_0x620e('0x61')]()[_0x620e('0x33')](handleJob(_0x324842[_0x3b0dc3]));logger[_0x620e('0xf')]('run\x20job',_0x324842[_0x3b0dc3][_0x620e('0x14')],_0x324842[_0x3b0dc3]['cron']);}else if(_0x324842[_0x3b0dc3][_0x620e('0x62')]&&_0x324842[_0x3b0dc3][_0x620e('0x63')]&&moment()[_0x620e('0x64')](_0x324842[_0x3b0dc3]['startAt'],_0x324842[_0x3b0dc3][_0x620e('0x65')])){manager[_0x620e('0x66')](_0x3b0dc3,_0x324842[_0x3b0dc3][_0x620e('0x62')],handleJob(_0x324842[_0x3b0dc3]));manager[_0x620e('0x67')](_0x3b0dc3);logger[_0x620e('0xf')](_0x620e('0x68'),_0x324842[_0x3b0dc3][_0x620e('0x14')],_0x324842[_0x3b0dc3][_0x620e('0x62')]);}else if(manager[_0x620e('0x5e')](_0x3b0dc3)){manager[_0x620e('0x3b')](_0x3b0dc3);manager['deleteJob'](_0x3b0dc3);logger[_0x620e('0xf')](_0x620e('0x69'),_0x324842[_0x3b0dc3][_0x620e('0x14')],_0x324842[_0x3b0dc3][_0x620e('0x62')]);}}for(_0x3a5f6d=0x0,_0x3b0dc3;_0x3a5f6d<_0x57f5f5[_0x620e('0x6a')]&&!_0x90f74c;_0x3a5f6d+=0x1){_0x3b0dc3=_0x57f5f5[_0x3a5f6d][_0x620e('0x5b')]();if(manager[_0x620e('0x5e')](_0x3b0dc3)){if(_0x324842[_0x3b0dc3][_0x620e('0x62')]&&_0x324842[_0x3b0dc3]['active']&&moment()[_0x620e('0x64')](_0x324842[_0x3b0dc3]['startAt'],_0x324842[_0x3b0dc3][_0x620e('0x65')])){manager[_0x620e('0x6b')](_0x3b0dc3,_0x324842[_0x3b0dc3][_0x620e('0x62')],handleJob(_0x324842[_0x3b0dc3]));logger['info'](_0x620e('0x6c'),_0x324842[_0x3b0dc3][_0x620e('0x14')],_0x324842[_0x3b0dc3][_0x620e('0x62')]);}else{manager[_0x620e('0x3b')](_0x3b0dc3);manager[_0x620e('0x6d')](_0x3b0dc3);logger[_0x620e('0xf')](_0x620e('0x69'),_0x324842[_0x3b0dc3][_0x620e('0x14')],_0x324842[_0x3b0dc3][_0x620e('0x62')]);}}}})['catch'](function(_0x15bb3b){logger[_0x620e('0xe')](JSON[_0x620e('0x28')](_0x15bb3b));});}exports[_0x620e('0x6e')]=function(_0x3fbacb){return getJobs(_0x3fbacb);};exports[_0x620e('0x67')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb477=['exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','difference','intersection','deleteJob','delete\x20cron','length','toString','resolve','run\x20job','cron','isBetween','startAt','endAt','add\x20cron','exists','stop\x20cron','active','update','update\x20cron','run','util','path','lodash','cron-job-manager','schedule','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','AnalyticExtractedReport','findOne','error','info','Try\x20to\x20send\x20a\x20mail\x20to','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','user','email','bcc','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','join','existsSync','Sent','message','attachments','text','stringify','status','Empty','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','[handleSendEmail]\x20Unrecognized\x20status:','request','then','error\x20mail','email\x20sent','catch','case\x20loading','currentAttempt','retryOptions','retries','job','data','operation','still\x20loading','case\x20completed','stop','case\x20empty','case\x20failed','entity','dataValues','Job\x20ID\x20','\x20Attempt\x20#:','report\x20status:','Smtp','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output'];(function(_0x5ddb0c,_0x1b10db){var _0x4b3b0c=function(_0x4dc7c4){while(--_0x4dc7c4){_0x5ddb0c['push'](_0x5ddb0c['shift']());}};_0x4b3b0c(++_0x1b10db);}(_0xb477,0x84));var _0x7b47=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb477[_0x4b055c];return _0x4b62bb;};'use strict';var fs=require('fs');var util=require(_0x7b47('0x0'));var path=require(_0x7b47('0x1'));var _=require(_0x7b47('0x2'));var moment=require('moment');var CronJobManager=require(_0x7b47('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../logger')(_0x7b47('0x4'));var db=require(_0x7b47('0x5'))['db'];const retry=require(_0x7b47('0x6'));var analyticCustomReportController=require(_0x7b47('0x7'));var analyticDefaultReportController=require(_0x7b47('0x8'));var client=jayson[_0x7b47('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x12a0a6){const _0x4eb89c={};if(typeof _0x12a0a6==='number'){_0x4eb89c['id']=_0x12a0a6;}return db[_0x7b47('0xa')][_0x7b47('0xb')]({'where':_0x4eb89c})['then'](function(_0x4b02b0){return _0x4b02b0;})['catch'](function(_0xd10a3e){logger[_0x7b47('0xc')](_0xd10a3e);});}function handleSendEmail(_0xc43613,_0x141593){logger[_0x7b47('0xd')](_0x7b47('0xe'),_0xc43613['email']);var _0x12622d=!![];var _0xb76b8d=_0xc43613['MailAccount'][_0x7b47('0xf')]();var _0x39e68c={'account':_0xb76b8d,'message':{'from':util[_0x7b47('0x10')](_0x7b47('0x11'),_0xc43613['MailAccount']['name'],_0xc43613[_0x7b47('0x12')]['email']||_0xc43613['MailAccount']['Smtp'][_0x7b47('0x13')]),'to':_0xc43613[_0x7b47('0x14')],'cc':_0xc43613['cc'],'bcc':_0xc43613[_0x7b47('0x15')],'subject':util[_0x7b47('0x10')]('Report\x20%s\x20last\x20%s\x20%s',_0x141593[_0x7b47('0x16')],_0xc43613[_0x7b47('0x17')],_0xc43613[_0x7b47('0x18')])}};var _0x48f5f4=path['join'](__dirname,_0x7b47('0x19'));var _0xc56aba=_0x141593[_0x7b47('0x1a')];var _0x4d3ff3=util[_0x7b47('0x10')](_0x7b47('0x1b'),path[_0x7b47('0x1c')](_0x141593[_0x7b47('0x1a')],path['extname'](_0x141593[_0x7b47('0x1a')])),'zip');var _0x40893c=path['join'](_0x48f5f4,_0xc56aba);var _0x2ee9cb=path[_0x7b47('0x1d')](_0x48f5f4,_0x4d3ff3);if(fs[_0x7b47('0x1e')](_0x40893c)){_0x141593['status']=_0x7b47('0x1f');_0x39e68c[_0x7b47('0x20')][_0x7b47('0x21')]=[{'filename':_0xc56aba,'path':_0x40893c}];_0x39e68c[_0x7b47('0x20')][_0x7b47('0x22')]=util[_0x7b47('0x10')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x7b47('0x23')](_0x141593,null,0x2));}else if(fs[_0x7b47('0x1e')](_0x2ee9cb)){_0x141593['status']=_0x7b47('0x1f');_0x39e68c[_0x7b47('0x20')]['attachments']=[{'filename':_0x4d3ff3,'path':_0x2ee9cb}];}else{if(_0x141593[_0x7b47('0x24')]===_0x7b47('0x25')){_0x39e68c['message'][_0x7b47('0x22')]=_0x7b47('0x26');if(!_0xc43613['sendIfEmpty']){_0x12622d=![];logger[_0x7b47('0xd')]('empty\x20file,\x20email\x20not\x20sent');}}else if(_0x141593[_0x7b47('0x24')]===_0x7b47('0x27')){_0x39e68c[_0x7b47('0x20')][_0x7b47('0x22')]=_0x7b47('0x28');}else if(_0x141593[_0x7b47('0x24')]===_0x7b47('0x29')){_0x39e68c[_0x7b47('0x20')]['text']='Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else if(_0x141593['status']==='Failed'){_0x39e68c[_0x7b47('0x20')][_0x7b47('0x22')]=_0x7b47('0x2a');}else{logger[_0x7b47('0xc')](_0x7b47('0x2b'),_0x141593[_0x7b47('0x24')]);}}if(_0x12622d){return client[_0x7b47('0x2c')]('SendMail',_0x39e68c)[_0x7b47('0x2d')](function(_0x5b861e){if(_0x5b861e[_0x7b47('0xc')]){return logger[_0x7b47('0xc')](_0x7b47('0x2e'),JSON[_0x7b47('0x23')](_0x5b861e));}return logger[_0x7b47('0xd')](_0x7b47('0x2f'));})[_0x7b47('0x30')](function(_0x4a95e9){return logger[_0x7b47('0xc')](_0x7b47('0x2e'),JSON[_0x7b47('0x23')](_0x4a95e9));});}}function handleError(){return function(_0x30c5c2){return logger['error'](JSON[_0x7b47('0x23')](_0x30c5c2));};}function loading(_0x5578c3){logger[_0x7b47('0xd')](_0x7b47('0x31'));if(_0x5578c3[_0x7b47('0x32')]===_0x5578c3[_0x7b47('0x33')][_0x7b47('0x34')]){handleSendEmail(_0x5578c3[_0x7b47('0x35')],_0x5578c3[_0x7b47('0x36')]);_0x5578c3[_0x7b47('0x37')]['stop']();}else{_0x5578c3[_0x7b47('0x37')][_0x7b47('0x6')](_0x7b47('0x38'));}}function completed(_0xba1e0b){logger[_0x7b47('0xd')](_0x7b47('0x39'));handleSendEmail(_0xba1e0b['job'],_0xba1e0b[_0x7b47('0x36')]);_0xba1e0b[_0x7b47('0x37')][_0x7b47('0x3a')]();}function empty(_0x1d81f7){logger['info'](_0x7b47('0x3b'));handleSendEmail(_0x1d81f7[_0x7b47('0x35')],_0x1d81f7['data']);_0x1d81f7[_0x7b47('0x37')][_0x7b47('0x3a')]();}function failed(_0x38ebce){logger[_0x7b47('0xd')](_0x7b47('0x3c'));handleSendEmail(_0x38ebce[_0x7b47('0x35')],_0x38ebce[_0x7b47('0x36')]);_0x38ebce['operation'][_0x7b47('0x3a')]();}function urecognized(_0x278f3e){logger[_0x7b47('0xc')]('Unrecognized\x20status:',_0x278f3e[_0x7b47('0x3d')][_0x7b47('0x3e')][_0x7b47('0x24')]);_0x278f3e['operation'][_0x7b47('0x3a')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x2ff8d4,_0x28238d){const _0x38ed3c={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0xee2706=retry['operation'](_0x38ed3c);_0xee2706['attempt'](_0x4c9a9b=>{logger['info'](_0x7b47('0x3f')+_0x2ff8d4['id']+_0x7b47('0x40')+_0x4c9a9b);try{getReportData(_0x28238d['id'])[_0x7b47('0x2d')](function(_0x173206){_0x28238d=_0x173206;logger[_0x7b47('0xd')](_0x7b47('0x41'),_0x173206[_0x7b47('0x3e')]['status']);if(!reportStatusStrategies[_0x173206[_0x7b47('0x3e')][_0x7b47('0x24')]]){logger[_0x7b47('0xc')]('report\x20status:',_0x173206[_0x7b47('0x3e')][_0x7b47('0x24')]);_0xee2706[_0x7b47('0x6')]();}reportStatusStrategies[_0x173206[_0x7b47('0x3e')]['status']]({'operation':_0xee2706,'currentAttempt':_0x4c9a9b,'retryOptions':_0x38ed3c,'job':_0x2ff8d4,'data':_0x28238d,'entity':_0x173206});});}catch(_0x2151d8){_0xee2706['retry'](_0x2151d8);}});}function handleResult(_0x61514e){return function(_0x325932){if(_0x61514e['sendMail']&&_0x61514e['MailAccount']&&_0x61514e[_0x7b47('0x12')][_0x7b47('0x42')]&&!_[_0x7b47('0x43')](_0x61514e[_0x7b47('0x14')])){retryer(_0x61514e,_0x325932);}};}function handleJob(_0x56c43a){return function(){try{if(_[_0x7b47('0x43')](_0x56c43a[_0x7b47('0x17')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7b47('0x43')](_0x56c43a[_0x7b47('0x18')])){return logger[_0x7b47('0xd')](_0x7b47('0x44'));}var _0x1ab2bf={'startDate':moment()[_0x7b47('0x45')](_0x56c43a[_0x7b47('0x17')],_0x56c43a[_0x7b47('0x18')])[_0x7b47('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x7b47('0x46')),'type':'scheduled','output':_0x56c43a[_0x7b47('0x47')],'name':_0x56c43a[_0x7b47('0x16')]};if(!_[_0x7b47('0x43')](_0x56c43a['DefaultReportId'])){logger[_0x7b47('0xd')](_0x7b47('0x48'),_0x56c43a[_0x7b47('0x49')]);return analyticDefaultReportController['runReport']({'id':_0x56c43a[_0x7b47('0x49')]},_0x1ab2bf)[_0x7b47('0x2d')](handleResult(_0x56c43a))[_0x7b47('0x30')](handleError());}if(!_['isNil'](_0x56c43a[_0x7b47('0x4a')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x56c43a['CustomReportId']);return analyticCustomReportController[_0x7b47('0x4b')]({'id':_0x56c43a[_0x7b47('0x4a')]},_0x1ab2bf)['then'](handleResult(_0x56c43a))[_0x7b47('0x30')](handleError());}}catch(_0x2eb0e0){logger[_0x7b47('0xc')](JSON[_0x7b47('0x23')](_0x2eb0e0));}return logger[_0x7b47('0xd')](_0x7b47('0x4c'));};}function getJobs(_0xa398ae){var _0x833e={};if(_0xa398ae){_0x833e['id']=_0xa398ae;}return db['Schedule'][_0x7b47('0x4d')]({'where':_0x833e,'include':[{'model':db[_0x7b47('0x12')],'attributes':['id',_0x7b47('0x16'),_0x7b47('0x14')],'include':[{'model':db[_0x7b47('0x4e')],'as':_0x7b47('0x42'),'include':[{'model':db['CloudProvider'],'as':_0x7b47('0x4f')}]}]}]})[_0x7b47('0x2d')](function(_0x47af5f){var _0x30a619=_[_0x7b47('0x50')](manager[_0x7b47('0x51')]);var _0x5da04e=_[_0x7b47('0x52')](_0x47af5f,function(_0x1dedaf){return _0x1dedaf['id']['toString']();});var _0x283d75=_['keyBy'](_0x47af5f,function(_0x31556b){return _0x31556b['id']['toString']();});var _0x96dd0d=_0xa398ae?_0x5da04e:_[_0x7b47('0x53')](_0x5da04e,_0x30a619);var _0x180730=_[_0x7b47('0x54')](_0x5da04e,_0x30a619);var _0x1a8600=_['difference'](_0x30a619,_0x5da04e);var _0x389c75;var _0x240899;for(_0x389c75=0x0;_0x389c75<_0x1a8600['length']&&!_0xa398ae;_0x389c75+=0x1){_0x240899=_0x1a8600[_0x389c75]['toString']();if(manager['exists'](_0x240899)){manager['stop'](_0x240899);manager[_0x7b47('0x55')](_0x240899);logger[_0x7b47('0xd')](_0x7b47('0x56'),_0x240899);}}logger[_0x7b47('0xd')]('toRun',JSON[_0x7b47('0x23')](_0x96dd0d));for(_0x389c75=0x0;_0x389c75<_0x96dd0d[_0x7b47('0x57')];_0x389c75+=0x1){_0x240899=_0x96dd0d[_0x389c75][_0x7b47('0x58')]();if(_0xa398ae){logger[_0x7b47('0xd')](JSON[_0x7b47('0x23')](_0x283d75[_0x240899]));BPromise[_0x7b47('0x59')]()[_0x7b47('0x2d')](handleJob(_0x283d75[_0x240899]));logger['info'](_0x7b47('0x5a'),_0x283d75[_0x240899][_0x7b47('0x16')],_0x283d75[_0x240899][_0x7b47('0x5b')]);}else if(_0x283d75[_0x240899][_0x7b47('0x5b')]&&_0x283d75[_0x240899]['active']&&moment()[_0x7b47('0x5c')](_0x283d75[_0x240899][_0x7b47('0x5d')],_0x283d75[_0x240899][_0x7b47('0x5e')])){manager['add'](_0x240899,_0x283d75[_0x240899]['cron'],handleJob(_0x283d75[_0x240899]));manager['start'](_0x240899);logger[_0x7b47('0xd')](_0x7b47('0x5f'),_0x283d75[_0x240899]['name'],_0x283d75[_0x240899]['cron']);}else if(manager[_0x7b47('0x60')](_0x240899)){manager['stop'](_0x240899);manager['deleteJob'](_0x240899);logger['info'](_0x7b47('0x61'),_0x283d75[_0x240899][_0x7b47('0x16')],_0x283d75[_0x240899][_0x7b47('0x5b')]);}}for(_0x389c75=0x0,_0x240899;_0x389c75<_0x180730[_0x7b47('0x57')]&&!_0xa398ae;_0x389c75+=0x1){_0x240899=_0x180730[_0x389c75][_0x7b47('0x58')]();if(manager[_0x7b47('0x60')](_0x240899)){if(_0x283d75[_0x240899][_0x7b47('0x5b')]&&_0x283d75[_0x240899][_0x7b47('0x62')]&&moment()[_0x7b47('0x5c')](_0x283d75[_0x240899][_0x7b47('0x5d')],_0x283d75[_0x240899][_0x7b47('0x5e')])){manager[_0x7b47('0x63')](_0x240899,_0x283d75[_0x240899]['cron'],handleJob(_0x283d75[_0x240899]));logger[_0x7b47('0xd')](_0x7b47('0x64'),_0x283d75[_0x240899]['name'],_0x283d75[_0x240899]['cron']);}else{manager['stop'](_0x240899);manager[_0x7b47('0x55')](_0x240899);logger[_0x7b47('0xd')](_0x7b47('0x61'),_0x283d75[_0x240899][_0x7b47('0x16')],_0x283d75[_0x240899][_0x7b47('0x5b')]);}}}})[_0x7b47('0x30')](function(_0x1cbc32){logger[_0x7b47('0xc')](JSON[_0x7b47('0x23')](_0x1cbc32));});}exports[_0x7b47('0x65')]=function(_0x57a3ce){return getJobs(_0x57a3ce);};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 5fa4c2c..3dcf040 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 _0xfb71=['SequelizeValidationError','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','getTranscriptionJob','substring','info','transcribeName','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[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','findOne','sentimentAccountId','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','COMPLETED','catch','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x394722,_0x3d5029){_0x394722=_0x394722-0x0;var _0x242a89=_0xfb71[_0x394722];return _0x242a89;};var _=require(_0x1fb7('0x0'));var AWS=require(_0x1fb7('0x1'));var rp=require(_0x1fb7('0x2'));var util=require(_0x1fb7('0x3'));var BPromise=require(_0x1fb7('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1fb7('0x5'));function getTranscriptionJob(_0x31aa32,_0x17a8d7,_0x4b9066,_0x45ed1c){return new Promise(function(_0x29532a,_0x2babe0){var _0x2112f8=new AWS[(_0x1fb7('0x6'))]({'accessKeyId':_0x17a8d7,'secretAccessKey':_0x31aa32,'region':_0x4b9066});_0x2112f8[_0x1fb7('0x7')]({'TranscriptionJobName':_0x45ed1c},function(_0x4abac2,_0x287b4a){if(_0x4abac2){return _0x2babe0(_0x4abac2);}else{return _0x29532a(_0x287b4a);}});});}function sentiment(_0x1a9e9e,_0x4e98ec,_0x968df9,_0x181677,_0xdc2350){return new Promise(function(_0x3ed2a3,_0x412503){var _0x437f79=new AWS['Comprehend']({'accessKeyId':_0x4e98ec,'secretAccessKey':_0x1a9e9e,'region':_0x968df9});_0x437f79['detectSentiment']({'Text':_0x181677,'LanguageCode':_0xdc2350[_0x1fb7('0x8')](0x0,0x2)},function(_0x2fde8d,_0x3d230c){if(_0x2fde8d){return _0x412503(_0x2fde8d);}else{return _0x3ed2a3(_0x3d230c);}});});}function checkTranscribeJob(_0x55f8ae,_0x49ac10,_0x195eb2){var _0x3cc07d;return new BPromise(function(_0x52ce28,_0x498776){logger[_0x1fb7('0x9')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x55f8ae['id'],_0x55f8ae[_0x1fb7('0xa')]));return getTranscriptionJob(_0x195eb2['data1'],_0x195eb2[_0x1fb7('0xb')],_0x49ac10[_0x1fb7('0xc')],_0x55f8ae[_0x1fb7('0xa')])[_0x1fb7('0xd')](function(_0xf4c50f){logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')](_0x1fb7('0xf'),_0x55f8ae['id'],_0x55f8ae[_0x1fb7('0xa')],_0xf4c50f['TranscriptionJob'][_0x1fb7('0x10')]));if(!_0x55f8ae[_0x1fb7('0x11')]){switch(_0xf4c50f[_0x1fb7('0x12')]['TranscriptionJobStatus']){case'COMPLETED':var _0xbb110c={'transcribeStatus':_0xf4c50f[_0x1fb7('0x12')][_0x1fb7('0x10')],'fileUri':_0xf4c50f[_0x1fb7('0x12')][_0x1fb7('0x13')]['TranscriptFileUri']};logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x14'),_0x55f8ae['id']));return rp({'uri':_0xf4c50f['TranscriptionJob'][_0x1fb7('0x13')][_0x1fb7('0x15')],'json':!![]})['then'](function(_0x5792d1){logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')](_0x1fb7('0x16'),_0x55f8ae['id']));if(_0x5792d1&&_0x5792d1[_0x1fb7('0x17')]&&_0x5792d1[_0x1fb7('0x17')][_0x1fb7('0x18')]&&_0x5792d1[_0x1fb7('0x17')]['transcripts'][_0x1fb7('0x19')]){_0xbb110c[_0x1fb7('0x11')]='';for(var _0x538ac2=0x0;_0x538ac2<_0x5792d1[_0x1fb7('0x17')]['transcripts']['length'];_0x538ac2++){_0xbb110c[_0x1fb7('0x11')]+=_0x5792d1[_0x1fb7('0x17')][_0x1fb7('0x18')][_0x538ac2]['transcript']+'';}}return _0x55f8ae[_0x1fb7('0x1a')](_0xbb110c);})[_0x1fb7('0xd')](function(){logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')](_0x1fb7('0x1b'),_0x55f8ae['id']));if(!_0x55f8ae[_0x1fb7('0x1c')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x1f'));}if(!_0x49ac10[_0x1fb7('0x20')]||!_0x49ac10['sentimentAccountId']||!_0x49ac10[_0x1fb7('0x21')]||!_0x49ac10[_0x1fb7('0x22')]||!_0x49ac10[_0x1fb7('0x23')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x24'));}if(!_0xbb110c['fileText']){throw new Error(_0x1fb7('0x25'));}if(_0x49ac10['sentimentAccountId']===_0x195eb2['id']){return _0x195eb2;}else{return db['CloudProvider'][_0x1fb7('0x26')]({'where':{'id':_settings[_0x1fb7('0x27')]}});}})[_0x1fb7('0xd')](function(_0x241573){if(!_0x241573){throw new db['Sequelize'][(_0x1fb7('0x1e'))](_0x1fb7('0x28'));}if(!_0x241573['data1']||!_0x241573[_0x1fb7('0xb')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x29'));}_0x3cc07d=_0x241573;logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x2a'),_0x55f8ae['id']));return sentiment(_0x3cc07d[_0x1fb7('0x2b')],_0x3cc07d[_0x1fb7('0xb')],_0x49ac10[_0x1fb7('0x21')],_0xbb110c[_0x1fb7('0x11')],_0x49ac10[_0x1fb7('0x22')]);})[_0x1fb7('0xd')](function(_0x55c3dd){logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x2c'),_0x55f8ae['id']));return _0x55f8ae[_0x1fb7('0x1a')]({'sentiment':_0x55c3dd[_0x1fb7('0x2d')],'sPositive':_0x55c3dd[_0x1fb7('0x2e')][_0x1fb7('0x2f')],'sNegative':_0x55c3dd[_0x1fb7('0x2e')][_0x1fb7('0x30')],'sMixed':_0x55c3dd[_0x1fb7('0x2e')][_0x1fb7('0x31')],'sNeutral':_0x55c3dd[_0x1fb7('0x2e')][_0x1fb7('0x32')]});})[_0x1fb7('0xd')](function(){logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x55f8ae['id']));_0x52ce28();});case _0x1fb7('0x33'):return _0x55f8ae[_0x1fb7('0x1a')]({'transcribeStatus':_0x1fb7('0x33'),'failureReason':_0xf4c50f[_0x1fb7('0x12')]['FailureReason']})[_0x1fb7('0xd')](function(){logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x1b'),_0x55f8ae['id']));_0x52ce28();});default:logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x34'),_0x55f8ae['id']));break;}}else{return BPromise[_0x1fb7('0x35')]()[_0x1fb7('0xd')](function(){if(!_0x55f8ae[_0x1fb7('0x1c')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x1f'));}if(!_0x49ac10[_0x1fb7('0x20')]||!_0x49ac10[_0x1fb7('0x27')]||!_0x49ac10[_0x1fb7('0x21')]||!_0x49ac10[_0x1fb7('0x22')]||!_0x49ac10[_0x1fb7('0x23')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x24'));}if(!_0x55f8ae['fileText']){throw new Error(_0x1fb7('0x25'));}if(_0x49ac10[_0x1fb7('0x27')]===_0x195eb2['id']){return _0x195eb2;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x1fb7('0x27')]}});}})[_0x1fb7('0xd')](function(_0x516431){if(!_0x516431){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x28'));}if(!_0x516431['data1']||!_0x516431[_0x1fb7('0xb')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x29'));}_0x3cc07d=_0x516431;logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')](_0x1fb7('0x2a'),_0x55f8ae['id']));return sentiment(_0x3cc07d[_0x1fb7('0x2b')],_0x3cc07d[_0x1fb7('0xb')],_0x49ac10['sentimentRegion'],_0x55f8ae[_0x1fb7('0x11')],_0x49ac10[_0x1fb7('0x22')]);})[_0x1fb7('0xd')](function(_0x1e621d){logger['info'](util[_0x1fb7('0xe')](_0x1fb7('0x2c'),_0x55f8ae['id']));return _0x55f8ae[_0x1fb7('0x1a')]({'sentiment':_0x1e621d[_0x1fb7('0x2d')],'sPositive':_0x1e621d[_0x1fb7('0x2e')][_0x1fb7('0x2f')],'sNegative':_0x1e621d[_0x1fb7('0x2e')][_0x1fb7('0x30')],'sMixed':_0x1e621d['SentimentScore'][_0x1fb7('0x31')],'sNeutral':_0x1e621d[_0x1fb7('0x2e')][_0x1fb7('0x32')],'transcribeStatus':_0x1fb7('0x36')});})[_0x1fb7('0xd')](function(){logger[_0x1fb7('0x9')](util[_0x1fb7('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x55f8ae['id']));_0x52ce28();});}})[_0x1fb7('0x37')](function(_0x209d69){if(_0x209d69){if(!_0x209d69['name']||_0x209d69[_0x1fb7('0x38')]!==_0x1fb7('0x39')){logger['error'](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x55f8ae['id']),util[_0x1fb7('0x3a')](_0x209d69,{'showHidden':![],'depth':null}));}}_0x52ce28();});});}function checkTranscribe(){var _0x10f371;var _0x496726;var _0x368685;return db[_0x1fb7('0x3b')][_0x1fb7('0x3c')]({'where':{'transcribeStatus':_0x1fb7('0x3d')}})[_0x1fb7('0xd')](function(_0x438734){if(!_0x438734||!_0x438734[_0x1fb7('0x19')]){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x3e'));}_0x10f371=_0x438734;return db['Setting'][_0x1fb7('0x26')]({'where':{'id':0x1}});})['then'](function(_0x5a233d){if(!_0x5a233d){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x3f'));}_0x496726=_0x5a233d;if(!_0x496726['transcribe']||!_0x496726[_0x1fb7('0x40')]||!_0x496726[_0x1fb7('0xc')]||!_0x496726[_0x1fb7('0x22')]||!_0x496726['bucket']){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x1fb7('0x26')]({'where':{'id':_0x496726['transcribeAccountId']}});})['then'](function(_0x9c5766){if(!_0x9c5766){throw new db[(_0x1fb7('0x1d'))][(_0x1fb7('0x1e'))](_0x1fb7('0x28'));}if(!_0x9c5766[_0x1fb7('0x2b')]||!_0x9c5766[_0x1fb7('0xb')]){throw new db[(_0x1fb7('0x1d'))]['ValidationError'](_0x1fb7('0x29'));}_0x368685=_0x9c5766;var _0x8aa405=[];_0x10f371[_0x1fb7('0x41')](function(_0x21f345){_0x8aa405[_0x1fb7('0x42')](checkTranscribeJob(_0x21f345,_0x496726,_0x368685));});return BPromise[_0x1fb7('0x43')](_0x8aa405);})[_0x1fb7('0x37')](function(_0x4dc26f){if(_0x4dc26f){if(!_0x4dc26f[_0x1fb7('0x38')]||_0x4dc26f[_0x1fb7('0x38')]!=='SequelizeValidationError'){logger['error'](util[_0x1fb7('0x3a')](_0x4dc26f,{'showHidden':![],'depth':null}));}}});}exports[_0x1fb7('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xeffd=['data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','inspect','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','findOne'];(function(_0x624b39,_0x30b01e){var _0x450f82=function(_0x496c70){while(--_0x496c70){_0x624b39['push'](_0x624b39['shift']());}};_0x450f82(++_0x30b01e);}(_0xeffd,0x6b));var _0xdeff=function(_0x3a75c3,_0x2257b1){_0x3a75c3=_0x3a75c3-0x0;var _0x14695a=_0xeffd[_0x3a75c3];return _0x14695a;};var _=require(_0xdeff('0x0'));var AWS=require('aws-sdk');var rp=require(_0xdeff('0x1'));var util=require(_0xdeff('0x2'));var BPromise=require(_0xdeff('0x3'));var db=require(_0xdeff('0x4'))['db'];var logger=require(_0xdeff('0x5'))(_0xdeff('0x6'));function getTranscriptionJob(_0x298274,_0x2881fd,_0x8315d4,_0x1c4628){return new Promise(function(_0x1ed641,_0x132631){var _0x281ad7=new AWS[(_0xdeff('0x7'))]({'accessKeyId':_0x2881fd,'secretAccessKey':_0x298274,'region':_0x8315d4});_0x281ad7[_0xdeff('0x8')]({'TranscriptionJobName':_0x1c4628},function(_0x12e953,_0x24897a){if(_0x12e953){return _0x132631(_0x12e953);}else{return _0x1ed641(_0x24897a);}});});}function sentiment(_0x540ae6,_0x3ae201,_0x45a8a6,_0xf6d58d,_0x51fcb7){return new Promise(function(_0x1ff265,_0x4423e9){var _0x3c1482=new AWS[(_0xdeff('0x9'))]({'accessKeyId':_0x3ae201,'secretAccessKey':_0x540ae6,'region':_0x45a8a6});_0x3c1482[_0xdeff('0xa')]({'Text':_0xf6d58d,'LanguageCode':_0x51fcb7[_0xdeff('0xb')](0x0,0x2)},function(_0x2e9783,_0x402075){if(_0x2e9783){return _0x4423e9(_0x2e9783);}else{return _0x1ff265(_0x402075);}});});}function checkTranscribeJob(_0x505d0c,_0x461699,_0x116bf9){var _0x4952f2;return new BPromise(function(_0x2e614c,_0x4e7526){logger['info'](util[_0xdeff('0xc')](_0xdeff('0xd'),_0x505d0c['id'],_0x505d0c[_0xdeff('0xe')]));return getTranscriptionJob(_0x116bf9[_0xdeff('0xf')],_0x116bf9['data2'],_0x461699[_0xdeff('0x10')],_0x505d0c[_0xdeff('0xe')])[_0xdeff('0x11')](function(_0x391633){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x505d0c['id'],_0x505d0c['transcribeName'],_0x391633[_0xdeff('0x13')]['TranscriptionJobStatus']));if(!_0x505d0c['fileText']){switch(_0x391633[_0xdeff('0x13')][_0xdeff('0x14')]){case'COMPLETED':var _0x2de203={'transcribeStatus':_0x391633[_0xdeff('0x13')][_0xdeff('0x14')],'fileUri':_0x391633[_0xdeff('0x13')][_0xdeff('0x15')][_0xdeff('0x16')]};logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x505d0c['id']));return rp({'uri':_0x391633['TranscriptionJob']['Transcript'][_0xdeff('0x16')],'json':!![]})['then'](function(_0x189627){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x17'),_0x505d0c['id']));if(_0x189627&&_0x189627[_0xdeff('0x18')]&&_0x189627['results']['transcripts']&&_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0xdeff('0x1a')]){_0x2de203[_0xdeff('0x1b')]='';for(var _0x32add9=0x0;_0x32add9<_0x189627['results'][_0xdeff('0x19')][_0xdeff('0x1a')];_0x32add9++){_0x2de203[_0xdeff('0x1b')]+=_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0x32add9][_0xdeff('0x1c')]+'';}}return _0x505d0c[_0xdeff('0x1d')](_0x2de203);})['then'](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));if(!_0x505d0c['tempSentiment']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699[_0xdeff('0x21')]||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699['bucket']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x25'));}if(!_0x2de203['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_settings[_0xdeff('0x22')]}});}})[_0xdeff('0x11')](function(_0x5af6b2){if(!_0x5af6b2){throw new db[(_0xdeff('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5af6b2[_0xdeff('0xf')]||!_0x5af6b2[_0xdeff('0x27')]){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x4952f2=_0x5af6b2;logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x2de203[_0xdeff('0x1b')],_0x461699['language']);})[_0xdeff('0x11')](function(_0x5cef77){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x5cef77[_0xdeff('0x2a')],'sPositive':_0x5cef77[_0xdeff('0x2b')]['Positive'],'sNegative':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x5cef77['SentimentScore'][_0xdeff('0x2d')],'sNeutral':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2e')]});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});case _0xdeff('0x30'):return _0x505d0c['update']({'transcribeStatus':_0xdeff('0x30'),'failureReason':_0x391633['TranscriptionJob'][_0xdeff('0x31')]})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});default:logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x32'),_0x505d0c['id']));break;}}else{return BPromise[_0xdeff('0x33')]()['then'](function(){if(!_0x505d0c[_0xdeff('0x34')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699['sentiment']||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699[_0xdeff('0x35')]){throw new db[(_0xdeff('0x1e'))]['ValidationError'](_0xdeff('0x25'));}if(!_0x505d0c[_0xdeff('0x1b')]){throw new Error(_0xdeff('0x36'));}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db[_0xdeff('0x37')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xdeff('0x11')](function(_0x1f5411){if(!_0x1f5411){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x1f5411[_0xdeff('0xf')]||!_0x1f5411[_0xdeff('0x27')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0x4952f2=_0x1f5411;logger[_0xdeff('0x12')](util['format'](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x505d0c['fileText'],_0x461699[_0xdeff('0x24')]);})[_0xdeff('0x11')](function(_0x8fe480){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x8fe480[_0xdeff('0x2a')],'sPositive':_0x8fe480['SentimentScore'][_0xdeff('0x3a')],'sNegative':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2d')],'sNeutral':_0x8fe480['SentimentScore'][_0xdeff('0x2e')],'transcribeStatus':_0xdeff('0x3b')});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));_0x2e614c();});}})[_0xdeff('0x3c')](function(_0x4e7316){if(_0x4e7316){if(!_0x4e7316[_0xdeff('0x3d')]||_0x4e7316[_0xdeff('0x3d')]!==_0xdeff('0x3e')){logger[_0xdeff('0x3f')](util[_0xdeff('0xc')](_0xdeff('0x40'),_0x505d0c['id']),util['inspect'](_0x4e7316,{'showHidden':![],'depth':null}));}}_0x2e614c();});});}function checkTranscribe(){var _0x49bc0b;var _0x71b5a5;var _0xf91a72;return db[_0xdeff('0x41')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xdeff('0x11')](function(_0x344218){if(!_0x344218||!_0x344218['length']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x42'));}_0x49bc0b=_0x344218;return db['Setting'][_0xdeff('0x26')]({'where':{'id':0x1}});})[_0xdeff('0x11')](function(_0x1ca376){if(!_0x1ca376){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x43'));}_0x71b5a5=_0x1ca376;if(!_0x71b5a5[_0xdeff('0x6')]||!_0x71b5a5[_0xdeff('0x44')]||!_0x71b5a5[_0xdeff('0x10')]||!_0x71b5a5[_0xdeff('0x24')]||!_0x71b5a5[_0xdeff('0x35')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x45'));}return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_0x71b5a5[_0xdeff('0x44')]}});})[_0xdeff('0x11')](function(_0x33482b){if(!_0x33482b){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x33482b[_0xdeff('0xf')]||!_0x33482b['data2']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0xf91a72=_0x33482b;var _0x552749=[];_0x49bc0b['forEach'](function(_0x1e43a6){_0x552749[_0xdeff('0x46')](checkTranscribeJob(_0x1e43a6,_0x71b5a5,_0xf91a72));});return BPromise[_0xdeff('0x47')](_0x552749);})[_0xdeff('0x3c')](function(_0x440053){if(_0x440053){if(!_0x440053[_0xdeff('0x3d')]||_0x440053['name']!=='SequelizeValidationError'){logger[_0xdeff('0x3f')](util[_0xdeff('0x48')](_0x440053,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index c160800..44efe5f 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 _0xd651=['util','../../config/environment','../../mysqldb','schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','join','update','system','timeout','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','start','lodash','ioredis'];(function(_0x2eb35d,_0x4a7a45){var _0x1f9854=function(_0x5eb6f9){while(--_0x5eb6f9){_0x2eb35d['push'](_0x2eb35d['shift']());}};_0x1f9854(++_0x4a7a45);}(_0xd651,0xad));var _0x1d65=function(_0x28e5d,_0x4eb934){_0x28e5d=_0x28e5d-0x0;var _0x195ac9=_0xd651[_0x28e5d];return _0x195ac9;};'use strict';var _=require(_0x1d65('0x0'));var moment=require('moment');var Redis=require(_0x1d65('0x1'));var util=require(_0x1d65('0x2'));var config=require(_0x1d65('0x3'));var db=require(_0x1d65('0x4'))['db'];var logger=require('../logger')(_0x1d65('0x5'));config[_0x1d65('0x6')]=_[_0x1d65('0x7')](config[_0x1d65('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x359320=[];return db[_0x1d65('0x8')][_0x1d65('0x9')]({'raw':!![],'attributes':['id',_0x1d65('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1d65('0xb')](0x18,_0x1d65('0xc'))}}})[_0x1d65('0xd')](function(_0x1ef59d){if(_0x1ef59d&&_0x1ef59d[_0x1d65('0xe')]){_0x359320=_[_0x1d65('0xf')](_0x1ef59d||[],'id');logger[_0x1d65('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x359320[_0x1d65('0x11')]());return db[_0x1d65('0x8')][_0x1d65('0x12')]({'closeReason':_0x1d65('0x13'),'disposition':_0x1d65('0x14'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x359320}});}})['then'](function(){if(_0x359320&&_0x359320[_0x1d65('0xe')]){logger[_0x1d65('0x10')](_0x1d65('0x15'),_0x359320[_0x1d65('0x11')]());for(var _0x90c952=0x0;_0x90c952<_0x359320[_0x1d65('0xe')];_0x90c952++){io[_0x1d65('0x16')](_0x1d65('0x17'),{'id':_0x359320[_0x90c952],'closed':!![]});}}})['catch'](function(_0xc74608){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xc74608?util['inspect'](_0xc74608,{'showHidden':![],'depth':null}):'');});}exports[_0x1d65('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb450=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','WhatsappInteraction','hours','length','map','info'];(function(_0x4a3d6b,_0x1d293f){var _0x1fb408=function(_0x5f5d84){while(--_0x5f5d84){_0x4a3d6b['push'](_0x4a3d6b['shift']());}};_0x1fb408(++_0x1d293f);}(_0xb450,0x19b));var _0x0b45=function(_0x362fce,_0xd44c62){_0x362fce=_0x362fce-0x0;var _0x12c2b3=_0xb450[_0x362fce];return _0x12c2b3;};'use strict';var _=require('lodash');var moment=require(_0x0b45('0x0'));var Redis=require(_0x0b45('0x1'));var util=require(_0x0b45('0x2'));var config=require(_0x0b45('0x3'));var db=require(_0x0b45('0x4'))['db'];var logger=require(_0x0b45('0x5'))('schedule');config[_0x0b45('0x6')]=_[_0x0b45('0x7')](config[_0x0b45('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0b45('0x8'))(new Redis(config[_0x0b45('0x6')]));function closeInteractions(){var _0x4791e2=[];return db[_0x0b45('0x9')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x0b45('0xa'))}}})['then'](function(_0x18ca73){if(_0x18ca73&&_0x18ca73[_0x0b45('0xb')]){_0x4791e2=_[_0x0b45('0xc')](_0x18ca73||[],'id');logger[_0x0b45('0xd')](_0x0b45('0xe'),_0x4791e2[_0x0b45('0xf')]());return db['WhatsappInteraction'][_0x0b45('0x10')]({'closeReason':_0x0b45('0x11'),'disposition':_0x0b45('0x12'),'closed':!![],'closedAt':moment()[_0x0b45('0x13')](_0x0b45('0x14'))},{'where':{'id':_0x4791e2}});}})['then'](function(){if(_0x4791e2&&_0x4791e2[_0x0b45('0xb')]){logger[_0x0b45('0xd')](_0x0b45('0x15'),_0x4791e2[_0x0b45('0xf')]());for(var _0x7d955f=0x0;_0x7d955f<_0x4791e2[_0x0b45('0xb')];_0x7d955f++){io[_0x0b45('0x16')]('whatsappInteraction:update',{'id':_0x4791e2[_0x7d955f],'closed':!![]});}}})[_0x0b45('0x17')](function(_0x3dcc2a){logger['error'](_0x0b45('0x18'),_0x3dcc2a?util['inspect'](_0x3dcc2a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index f961df4..cddd574 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9ef=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then'];(function(_0x4da276,_0x4cfc63){var _0x439ff1=function(_0x12f4d6){while(--_0x12f4d6){_0x4da276['push'](_0x4da276['shift']());}};_0x439ff1(++_0x4cfc63);}(_0xa9ef,0x116));var _0xfa9e=function(_0x4dfc30,_0x2f8ea3){_0x4dfc30=_0x4dfc30-0x0;var _0x4cabbe=_0xa9ef[_0x4dfc30];return _0x4cabbe;};'use strict';var util=require('util');var db=require(_0xfa9e('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfa9e('0x1')]({'id':i,'firstName':_0xfa9e('0x2')+i,'lastName':_0xfa9e('0x3')+i,'phone':0xf879fb460+i,'email':_0xfa9e('0x4')+i+_0xfa9e('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xfa9e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfa9e('0x6')](),'updatedAt':Date[_0xfa9e('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xfa9e('0x1')]({'id':i,'firstName':_0xfa9e('0x2')+i,'lastName':_0xfa9e('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xfa9e('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xfa9e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfa9e('0x6')](),'updatedAt':Date[_0xfa9e('0x6')]()});}db[_0xfa9e('0x7')][_0xfa9e('0x8')]({'where':{}})[_0xfa9e('0x9')](function(){return db[_0xfa9e('0x7')][_0xfa9e('0xa')](contacts);})[_0xfa9e('0x9')](function(){console[_0xfa9e('0xb')](_0xfa9e('0xc'),_0xfa9e('0xd'));return db[_0xfa9e('0xe')][_0xfa9e('0x8')]({'where':{}});})[_0xfa9e('0x9')](function(){return db[_0xfa9e('0xe')][_0xfa9e('0xa')](hopper);})['then'](function(){console[_0xfa9e('0xb')](_0xfa9e('0xc'),_0xfa9e('0xf'));return db[_0xfa9e('0x7')][_0xfa9e('0xa')](contacts2);})[_0xfa9e('0x9')](function(){console[_0xfa9e('0xb')](_0xfa9e('0xc'),_0xfa9e('0x10'));return db[_0xfa9e('0xe')][_0xfa9e('0xa')](hopper2);})[_0xfa9e('0x9')](function(){console['log'](_0xfa9e('0xc'),_0xfa9e('0x11'));})['catch'](function(_0x51777d){console[_0xfa9e('0xb')](_0x51777d);}); \ No newline at end of file +var _0xf63a=['CmHopper','destroy','hopper1','hopper2','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','log','finished\x20populating','contacts1'];(function(_0x41dfc4,_0x22590f){var _0x2db6df=function(_0x1ed39d){while(--_0x1ed39d){_0x41dfc4['push'](_0x41dfc4['shift']());}};_0x2db6df(++_0x22590f);}(_0xf63a,0x164));var _0xaf63=function(_0x4c335d,_0x419504){_0x4c335d=_0x4c335d-0x0;var _0x947bcd=_0xf63a[_0x4c335d];return _0x947bcd;};'use strict';var util=require('util');var db=require(_0xaf63('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaf63('0x1')]({'id':i,'firstName':_0xaf63('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaf63('0x3')+i+_0xaf63('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xaf63('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf63('0x5')](),'updatedAt':Date[_0xaf63('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xaf63('0x1')]({'id':i,'firstName':_0xaf63('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaf63('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xaf63('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf63('0x5')](),'updatedAt':Date[_0xaf63('0x5')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db[_0xaf63('0x6')][_0xaf63('0x7')](contacts);})[_0xaf63('0x8')](function(){console[_0xaf63('0x9')](_0xaf63('0xa'),_0xaf63('0xb'));return db[_0xaf63('0xc')][_0xaf63('0xd')]({'where':{}});})[_0xaf63('0x8')](function(){return db['CmHopper'][_0xaf63('0x7')](hopper);})[_0xaf63('0x8')](function(){console[_0xaf63('0x9')](_0xaf63('0xa'),_0xaf63('0xe'));return db[_0xaf63('0x6')]['bulkCreate'](contacts2);})['then'](function(){console[_0xaf63('0x9')](_0xaf63('0xa'),'contacts2');return db[_0xaf63('0xc')][_0xaf63('0x7')](hopper2);})[_0xaf63('0x8')](function(){console[_0xaf63('0x9')](_0xaf63('0xa'),_0xaf63('0xf'));})['catch'](function(_0x143840){console[_0xaf63('0x9')](_0x143840);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7f3edfa..4268e11 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd39=['agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','format','%s%s'];(function(_0x53cc17,_0x4ccfc3){var _0x4cc547=function(_0x11acc4){while(--_0x11acc4){_0x53cc17['push'](_0x53cc17['shift']());}};_0x4cc547(++_0x4ccfc3);}(_0xbd39,0x1dd));var _0x9bd3=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xbd39[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x9bd3('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x9bd3('0x1')](_0x9bd3('0x2'),_0x9bd3('0x3'),i),'fullname':util[_0x9bd3('0x1')](_0x9bd3('0x2'),_0x9bd3('0x3'),i),'email':util[_0x9bd3('0x1')]('%s%s@xcally.com','agent',i),'role':'agent','password':_0x9bd3('0x4'),'internal':0xfa0+i,'type':_0x9bd3('0x5'),'transport':[_0x9bd3('0x6'),'ws',_0x9bd3('0x7')],'disallow':[_0x9bd3('0x8')],'allow':[_0x9bd3('0x9')],'defaultuser':util[_0x9bd3('0x1')]('%s%s','agent',i),'encryption':_0x9bd3('0xa'),'avpf':_0x9bd3('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x9bd3('0xa'),'dtlsverify':'no','dtlscertfile':_0x9bd3('0xb'),'dtlsprivatekey':_0x9bd3('0xc'),'dtlssetup':_0x9bd3('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x9bd3('0x1')](_0x9bd3('0x2'),'agent',i),0xfa0+i)});}db[_0x9bd3('0xe')][_0x9bd3('0xf')](users)[_0x9bd3('0x10')](function(){console[_0x9bd3('0x11')](_0x9bd3('0x12'));})[_0x9bd3('0x13')](function(_0x2a2813){console[_0x9bd3('0x11')](_0x2a2813);}); \ No newline at end of file +var _0xdeae=['then','add\x20user','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate'];(function(_0x5ac550,_0x25e1dd){var _0x58629c=function(_0x304cd5){while(--_0x304cd5){_0x5ac550['push'](_0x5ac550['shift']());}};_0x58629c(++_0x25e1dd);}(_0xdeae,0x17c));var _0xedea=function(_0x1da9f9,_0x3b96e3){_0x1da9f9=_0x1da9f9-0x0;var _0x3d0bde=_0xdeae[_0x1da9f9];return _0x3d0bde;};'use strict';var util=require(_0xedea('0x0'));var db=require(_0xedea('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xedea('0x2')](_0xedea('0x3'),'agent',i),'fullname':util[_0xedea('0x2')](_0xedea('0x3'),_0xedea('0x4'),i),'email':util['format'](_0xedea('0x5'),_0xedea('0x4'),i),'role':_0xedea('0x4'),'password':'password','internal':0xfa0+i,'type':_0xedea('0x6'),'transport':[_0xedea('0x7'),'ws',_0xedea('0x8')],'disallow':[_0xedea('0x9')],'allow':['ulaw'],'defaultuser':util['format'](_0xedea('0x3'),_0xedea('0x4'),i),'encryption':_0xedea('0xa'),'avpf':_0xedea('0xa'),'force_avp':_0xedea('0xa'),'icesupport':_0xedea('0xa'),'dtlsenable':_0xedea('0xa'),'dtlsverify':'no','dtlscertfile':_0xedea('0xb'),'dtlsprivatekey':_0xedea('0xc'),'dtlssetup':_0xedea('0xd'),'callerid':util[_0xedea('0x2')]('\x22%s\x22\x20<%s>',util[_0xedea('0x2')](_0xedea('0x3'),'agent',i),0xfa0+i)});}db[_0xedea('0xe')][_0xedea('0xf')](users)[_0xedea('0x10')](function(){console['log'](_0xedea('0x11'));})['catch'](function(_0x1c9f7e){console['log'](_0x1c9f7e);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 202ffa3..fae25c9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd185=['include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','Trunk','user','SmsQueue','OpenchannelQueues','OpenchannelQueue','WhatsappQueues','getChatQueues','getFaxQueues','getWhatsappQueues','all','voice','fax','mail','openchannel','whatsapp','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','remoteAddress','remotePort','SocketIO\x20','disconnect','CONNECTED','lodash','../mysqldb','./environment','Agents','User','name','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty'];(function(_0x29b8e3,_0x508f07){var _0x4039f0=function(_0xbf770b){while(--_0xbf770b){_0x29b8e3['push'](_0x29b8e3['shift']());}};_0x4039f0(++_0x508f07);}(_0xd185,0x92));var _0x5d18=function(_0x3a83c5,_0x20a5f8){_0x3a83c5=_0x3a83c5-0x0;var _0x4787d9=_0xd185[_0x3a83c5];return _0x4787d9;};'use strict';var _=require(_0x5d18('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x5d18('0x1'))['db'];var config=require(_0x5d18('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x5d18('0x3'),'model':db[_0x5d18('0x4')],'attributes':['id',_0x5d18('0x5'),_0x5d18('0x6')],'raw':!![],'where':{'role':_0x5d18('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x5d18('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x5d18('0x5')],'where':{'role':_0x5d18('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5d18('0x5'),_0x5d18('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4a6c8d,_0x44ef76,_0x57e272){return db[_0x5d18('0x9')][_0x5d18('0xa')]({'where':{'name':_0x4a6c8d,'userProfileId':_0x44ef76},'raw':!![]})[_0x5d18('0xb')](function(_0x1408d1){if(_0x1408d1){if(_0x1408d1[_0x5d18('0xc')]){switch(_0x4a6c8d){case _0x5d18('0xd'):case _0x5d18('0xe'):case _0x5d18('0xf'):case _0x5d18('0x10'):case _0x5d18('0x11'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x57e272]['findAll'](queryQueues);case _0x5d18('0x12'):return db[_0x57e272][_0x5d18('0x13')](queryTelephones);case _0x5d18('0x14'):return db[_0x57e272][_0x5d18('0x13')](queryTrunks);case _0x5d18('0x15'):return db[_0x57e272][_0x5d18('0x13')](queryCampaigns);}}else{return db[_0x5d18('0x16')]['findAll']({'attributes':[_0x5d18('0x17')],'where':{'sectionId':_0x1408d1['id']},'raw':!![]})[_0x5d18('0xb')](function(_0x535b9f){if(_0x535b9f){var _0x1fcc3b={'where':{'id':_[_0x5d18('0x18')](_0x535b9f,_0x5d18('0x17'))},'raw':!![]};switch(_0x57e272){case'User':_0x1fcc3b[_0x5d18('0x19')][_0x5d18('0x6')]=_0x5d18('0x1a');break;case _0x5d18('0x1b'):_0x1fcc3b['where'][_0x5d18('0x8')]='ivr';break;}return db[_0x57e272][_0x5d18('0x13')](_0x1fcc3b);}else{return[];}});}}else{return[];}})[_0x5d18('0xb')](function(_0x17f0ce){return _0x17f0ce;});}function joinOrLeaveQueues(_0x51fbd2,_0x5db197,_0x1283ba,_0x1c7423){_0x51fbd2[_0x5db197](util[_0x5d18('0x1c')](_0x5d18('0x1d'),_0x1283ba,_0x1c7423[_0x5d18('0x5')]));if(_0x1c7423[_0x5d18('0x3')]){for(var _0x2a6354=0x0;_0x2a6354<_0x1c7423[_0x5d18('0x3')][_0x5d18('0x1e')];_0x2a6354+=0x1){_0x51fbd2[_0x5db197](util['format'](_0x5d18('0x1f'),_0x1c7423[_0x5d18('0x3')][_0x2a6354][_0x5d18('0x5')]));}}}function joinOrLeave(_0x1c2dc7,_0x152a33,_0x2cc9a8){var _0x2e612b;if(_0x1c2dc7[_0x5d18('0x20')][_0x5d18('0x21')]['id']){db['User'][_0x5d18('0x22')]({'attributes':['id',_0x5d18('0x5'),'role',_0x5d18('0x23')],'where':{'id':_0x1c2dc7[_0x5d18('0x20')][_0x5d18('0x21')]['id']},'include':[{'model':db[_0x5d18('0x24')],'as':_0x5d18('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5d18('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5d18('0x27')],'as':_0x5d18('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5d18('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x5d18('0x2a')],'as':_0x5d18('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x5d18('0x2c')],'as':_0x5d18('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x5d18('0xb')](function(_0x3a9301){if(_0x3a9301){_0x2e612b=_0x3a9301;_0x1c2dc7[_0x152a33](util[_0x5d18('0x1c')](_0x5d18('0x1f'),_0x3a9301[_0x5d18('0x5')]));var _0x51212d=[];switch(_0x3a9301['role']){case _0x5d18('0x2e'):_0x1c2dc7[_0x152a33](_0x5d18('0x2f'));_0x1c2dc7[_0x152a33](_0x5d18('0x30'));if(queryQueues[_0x5d18('0x31')]('include')){delete queryQueues[_0x5d18('0x32')];}_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x34')][_0x5d18('0x13')](queryQueues));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x35')]['findAll'](queryQueues));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x36')]['findAll'](queryQueues));_0x51212d[_0x5d18('0x33')](db['SmsQueue'][_0x5d18('0x13')](queryQueues));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x37')]['findAll'](queryQueues));_0x51212d[_0x5d18('0x33')](db['OpenchannelQueue']['findAll'](queryQueues));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x38')][_0x5d18('0x13')](queryQueues));_0x51212d['push'](db[_0x5d18('0x4')][_0x5d18('0x13')](queryTelephones));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x39')][_0x5d18('0x13')](queryTrunks));_0x51212d['push'](db[_0x5d18('0x1b')]['findAll'](queryCampaigns));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x4')][_0x5d18('0x13')](queryAgents));break;case _0x5d18('0x3a'):_0x1c2dc7[_0x152a33](_0x5d18('0x2f'));_0x1c2dc7[_0x152a33](_0x5d18('0x30'));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0xd'),_0x3a9301[_0x5d18('0x23')],_0x5d18('0x34')));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0xe'),_0x3a9301[_0x5d18('0x23')],_0x5d18('0x35')));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0xf'),_0x3a9301[_0x5d18('0x23')],'FaxQueue'));_0x51212d['push'](getAssociatedResources('SmsQueues',_0x3a9301[_0x5d18('0x23')],_0x5d18('0x3b')));_0x51212d[_0x5d18('0x33')](getAssociatedResources('MailQueues',_0x3a9301['userProfileId'],_0x5d18('0x37')));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0x3c'),_0x3a9301[_0x5d18('0x23')],_0x5d18('0x3d')));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0x3e'),_0x3a9301[_0x5d18('0x23')],_0x5d18('0x38')));_0x51212d[_0x5d18('0x33')](getAssociatedResources('Telephones',_0x3a9301[_0x5d18('0x23')],_0x5d18('0x4')));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0x14'),_0x3a9301[_0x5d18('0x23')],'Trunk'));_0x51212d[_0x5d18('0x33')](getAssociatedResources(_0x5d18('0x15'),_0x3a9301['userProfileId'],_0x5d18('0x1b')));_0x51212d[_0x5d18('0x33')](db[_0x5d18('0x4')][_0x5d18('0x13')](queryAgents));break;case'agent':_0x1c2dc7[_0x152a33](_0x5d18('0x2f'));_0x1c2dc7[_0x152a33]('voice:outbound');_0x51212d[_0x5d18('0x33')](_0x3a9301['getVoiceQueues']({'attributes':['id',_0x5d18('0x5')]}));_0x51212d[_0x5d18('0x33')](_0x3a9301[_0x5d18('0x3f')]({'attributes':['id','name']}));_0x51212d[_0x5d18('0x33')](_0x3a9301[_0x5d18('0x40')]({'attributes':['id',_0x5d18('0x5')]}));_0x51212d[_0x5d18('0x33')](_0x3a9301['getSmsQueues']({'attributes':['id',_0x5d18('0x5')]}));_0x51212d[_0x5d18('0x33')](_0x3a9301['getMailQueues']({'attributes':['id',_0x5d18('0x5')]}));_0x51212d['push'](_0x3a9301['getOpenchannelQueues']({'attributes':['id',_0x5d18('0x5')]}));_0x51212d[_0x5d18('0x33')](_0x3a9301[_0x5d18('0x41')]({'attributes':['id',_0x5d18('0x5')]}));break;}return BPromise[_0x5d18('0x42')](_0x51212d);}})[_0x5d18('0xb')](function(_0x3cabca){if(_0x3cabca&&_0x3cabca[_0x5d18('0x1e')]){for(var _0x5dfebe=0x0;_0x5dfebe<_0x3cabca[_0x5d18('0x1e')];_0x5dfebe+=0x1){for(var _0x4f56ce=0x0;_0x4f56ce<_0x3cabca[_0x5dfebe][_0x5d18('0x1e')];_0x4f56ce+=0x1){switch(_0x5dfebe){case 0x0:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,_0x5d18('0x43'),_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x1:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,'chat',_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x2:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,_0x5d18('0x44'),_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x3:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,'sms',_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x4:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,_0x5d18('0x45'),_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x5:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,_0x5d18('0x46'),_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x6:joinOrLeaveQueues(_0x1c2dc7,_0x152a33,_0x5d18('0x47'),_0x3cabca[_0x5dfebe][_0x4f56ce]);break;case 0x7:if(_0x2e612b[_0x5d18('0x6')]!=='agent')_0x1c2dc7[_0x152a33](util[_0x5d18('0x1c')]('telephone:%s',_0x3cabca[_0x5dfebe][_0x4f56ce]['name']));break;case 0x8:if(_0x2e612b[_0x5d18('0x6')]!==_0x5d18('0x7'))_0x1c2dc7[_0x152a33](util['format']('trunk:%s',_0x3cabca[_0x5dfebe][_0x4f56ce][_0x5d18('0x5')]));break;case 0x9:if(_0x2e612b['role']!==_0x5d18('0x7'))_0x1c2dc7[_0x152a33](util['format'](_0x5d18('0x48'),_0x3cabca[_0x5dfebe][_0x4f56ce]['type'],_0x3cabca[_0x5dfebe][_0x4f56ce][_0x5d18('0x5')]));break;case 0xa:_0x1c2dc7[_0x152a33](util[_0x5d18('0x1c')](_0x5d18('0x1f'),_0x3cabca[_0x5dfebe][_0x4f56ce][_0x5d18('0x5')]));break;}}}}})[_0x5d18('0xb')](function(){if(_0x152a33==='leave'){var _0x52800b=_[_0x5d18('0x18')](_0x2e612b['ChatInteractions'],'id');return _0x2e612b[_0x5d18('0x49')](_0x52800b)[_0x5d18('0xb')](function(){for(var _0x3bed07=0x0;_0x3bed07<_0x52800b['length'];_0x3bed07+=0x1){_0x2cc9a8[_0x5d18('0x4a')](_0x5d18('0x4b'),{'ChatInteractionId':Number(_0x52800b[_0x3bed07]),'UserId':Number(_0x2e612b['id'])});}});}})[_0x5d18('0xb')](function(){if(_0x152a33===_0x5d18('0x4c')){var _0x2aed32=_[_0x5d18('0x18')](_0x2e612b[_0x5d18('0x4d')],'id');return _0x2e612b[_0x5d18('0x4e')](_0x2aed32)['then'](function(){for(var _0x5b2fdd=0x0;_0x5b2fdd<_0x2aed32[_0x5d18('0x1e')];_0x5b2fdd+=0x1){_0x2cc9a8[_0x5d18('0x4a')](_0x5d18('0x4f'),{'MailInteractionId':Number(_0x2aed32[_0x5b2fdd]),'UserId':Number(_0x2e612b['id'])});}});}})[_0x5d18('0xb')](function(){if(_0x152a33===_0x5d18('0x4c')){var _0x3e9762=_[_0x5d18('0x18')](_0x2e612b['FaxInteractions'],'id');return _0x2e612b[_0x5d18('0x50')](_0x3e9762)['then'](function(){for(var _0x26401e=0x0;_0x26401e<_0x3e9762[_0x5d18('0x1e')];_0x26401e+=0x1){_0x2cc9a8[_0x5d18('0x4a')](_0x5d18('0x51'),{'FaxInteractionId':Number(_0x3e9762[_0x26401e]),'UserId':Number(_0x2e612b['id'])});}});}})[_0x5d18('0xb')](function(){if(_0x152a33==='leave'){var _0x45ad2e=_[_0x5d18('0x18')](_0x2e612b[_0x5d18('0x29')],'id');return _0x2e612b[_0x5d18('0x52')](_0x45ad2e)[_0x5d18('0xb')](function(){for(var _0x2a0f9=0x0;_0x2a0f9<_0x45ad2e[_0x5d18('0x1e')];_0x2a0f9+=0x1){_0x2cc9a8['emit'](_0x5d18('0x53'),{'SmsInteractionId':Number(_0x45ad2e[_0x2a0f9]),'UserId':Number(_0x2e612b['id'])});}});}})[_0x5d18('0xb')](function(){if(_0x152a33===_0x5d18('0x4c')){var _0x124729=_['map'](_0x2e612b[_0x5d18('0x2b')],'id');return _0x2e612b[_0x5d18('0x54')](_0x124729)['then'](function(){for(var _0x380edf=0x0;_0x380edf<_0x124729[_0x5d18('0x1e')];_0x380edf+=0x1){_0x2cc9a8[_0x5d18('0x4a')](_0x5d18('0x55'),{'OpenchannelInteractionId':Number(_0x124729[_0x380edf]),'UserId':Number(_0x2e612b['id'])});}});}})['then'](function(){if(_0x152a33===_0x5d18('0x4c')){var _0x191b71=_['map'](_0x2e612b[_0x5d18('0x2d')],'id');return _0x2e612b['removeWhatsappInteractions'](_0x191b71)[_0x5d18('0xb')](function(){for(var _0x355bf3=0x0;_0x355bf3<_0x191b71[_0x5d18('0x1e')];_0x355bf3+=0x1){_0x2cc9a8[_0x5d18('0x4a')](_0x5d18('0x56'),{'WhatsappInteractionId':Number(_0x191b71[_0x355bf3]),'UserId':Number(_0x2e612b['id'])});}});}})[_0x5d18('0x57')](function(_0x1f8324){_0x1c2dc7[_0x5d18('0x58')](_0x1f8324);});}}function onDisconnect(_0x56d508,_0x4cf2d0){joinOrLeave(_0x56d508,_0x5d18('0x4c'),_0x4cf2d0);}function onConnect(_0x8c025){joinOrLeave(_0x8c025,_0x5d18('0x59'));}exports[_0x5d18('0x5a')]=function(_0x2ce32d){_0x2ce32d['on'](_0x5d18('0x5b'),function(_0x39ae75){_0x39ae75['setMaxListeners'](0x0);_0x39ae75[_0x5d18('0x5c')]=_0x39ae75['request'][_0x5d18('0x5b')][_0x5d18('0x5d')]+':'+_0x39ae75['request'][_0x5d18('0x5b')][_0x5d18('0x5e')];_0x39ae75['connectedAt']=new Date();_0x39ae75['log']=function(_0x38c448){console[_0x5d18('0x58')](_0x5d18('0x5f')+_0x39ae75['nsp']['name']+'['+_0x39ae75['address']+']',_0x38c448);};_0x39ae75['on'](_0x5d18('0x60'),function(){onDisconnect(_0x39ae75,_0x2ce32d);_0x39ae75[_0x5d18('0x58')]('DISCONNECTED');});onConnect(_0x39ae75);_0x39ae75[_0x5d18('0x58')](_0x5d18('0x61'));});}; \ No newline at end of file +var _0x0427=['remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','then','map','resourceId','Campaign','format','%s:queue:%s','length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','voice:inbound','include','push','ChatQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','VoiceQueue','FaxQueues','FaxQueue','SmsQueue','MailQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','join','default','connection','setMaxListeners','address','request'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x0427,0x6c));var _0x7042=function(_0x51d851,_0x3db37a){_0x51d851=_0x51d851-0x0;var _0x13d3ff=_0x0427[_0x51d851];return _0x13d3ff;};'use strict';var _=require(_0x7042('0x0'));var util=require(_0x7042('0x1'));var BPromise=require('bluebird');var db=require(_0x7042('0x2'))['db'];var config=require(_0x7042('0x3'));var queryQueues={'attributes':['id',_0x7042('0x4')],'include':[{'as':_0x7042('0x5'),'model':db[_0x7042('0x6')],'attributes':['id','name',_0x7042('0x7')],'raw':!![],'where':{'role':_0x7042('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7042('0x4')],'where':{'role':_0x7042('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7042('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x7042('0x4')],'where':{'role':_0x7042('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x7042('0xa')],'where':{'type':_0x7042('0xb')}};function getAssociatedResources(_0x1d34ae,_0x4464f1,_0x57fde3){return db[_0x7042('0xc')][_0x7042('0xd')]({'where':{'name':_0x1d34ae,'userProfileId':_0x4464f1},'raw':!![]})['then'](function(_0x5bf9a1){if(_0x5bf9a1){if(_0x5bf9a1[_0x7042('0xe')]){switch(_0x1d34ae){case _0x7042('0xf'):case _0x7042('0x10'):case'FaxQueues':case _0x7042('0x11'):case _0x7042('0x12'):case _0x7042('0x13'):case _0x7042('0x14'):return db[_0x57fde3][_0x7042('0x15')](queryQueues);case _0x7042('0x16'):return db[_0x57fde3][_0x7042('0x15')](queryTelephones);case _0x7042('0x17'):return db[_0x57fde3][_0x7042('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x57fde3][_0x7042('0x15')](queryCampaigns);}}else{return db[_0x7042('0x18')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x5bf9a1['id']},'raw':!![]})[_0x7042('0x19')](function(_0x183358){if(_0x183358){var _0x5be5e4={'where':{'id':_[_0x7042('0x1a')](_0x183358,_0x7042('0x1b'))},'raw':!![]};switch(_0x57fde3){case _0x7042('0x6'):_0x5be5e4['where'][_0x7042('0x7')]=_0x7042('0x9');break;case _0x7042('0x1c'):_0x5be5e4['where'][_0x7042('0xa')]=_0x7042('0xb');break;}return db[_0x57fde3][_0x7042('0x15')](_0x5be5e4);}else{return[];}});}}else{return[];}})[_0x7042('0x19')](function(_0x2eecab){return _0x2eecab;});}function joinOrLeaveQueues(_0x1a7df9,_0x4a4ffa,_0x4c6c9c,_0x50b7fa){_0x1a7df9[_0x4a4ffa](util[_0x7042('0x1d')](_0x7042('0x1e'),_0x4c6c9c,_0x50b7fa[_0x7042('0x4')]));if(_0x50b7fa[_0x7042('0x5')]){for(var _0x30dcae=0x0;_0x30dcae<_0x50b7fa[_0x7042('0x5')][_0x7042('0x1f')];_0x30dcae+=0x1){_0x1a7df9[_0x4a4ffa](util['format']('user:%s',_0x50b7fa['Agents'][_0x30dcae][_0x7042('0x4')]));}}}function joinOrLeave(_0x13bbcf,_0x2d30f3,_0x265850){var _0x529d5a;if(_0x13bbcf[_0x7042('0x20')][_0x7042('0x21')]['id']){db[_0x7042('0x6')]['find']({'attributes':['id','name',_0x7042('0x7'),_0x7042('0x22')],'where':{'id':_0x13bbcf['handshake'][_0x7042('0x21')]['id']},'include':[{'model':db[_0x7042('0x23')],'as':_0x7042('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7042('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7042('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7042('0x27')],'as':_0x7042('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x7042('0x29')],'as':_0x7042('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x7042('0x2b')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x7042('0x19')](function(_0x3a6704){if(_0x3a6704){_0x529d5a=_0x3a6704;_0x13bbcf[_0x2d30f3](util[_0x7042('0x1d')](_0x7042('0x2c'),_0x3a6704[_0x7042('0x4')]));var _0x5d2136=[];switch(_0x3a6704[_0x7042('0x7')]){case'admin':_0x13bbcf[_0x2d30f3](_0x7042('0x2d'));_0x13bbcf[_0x2d30f3]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x7042('0x2e'))){delete queryQueues[_0x7042('0x2e')];}_0x5d2136[_0x7042('0x2f')](db['VoiceQueue'][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db[_0x7042('0x30')][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db['FaxQueue'][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db['SmsQueue'][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db['MailQueue'][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db[_0x7042('0x31')][_0x7042('0x15')](queryQueues));_0x5d2136[_0x7042('0x2f')](db[_0x7042('0x32')]['findAll'](queryQueues));_0x5d2136[_0x7042('0x2f')](db[_0x7042('0x6')]['findAll'](queryTelephones));_0x5d2136['push'](db[_0x7042('0x33')][_0x7042('0x15')](queryTrunks));_0x5d2136['push'](db['Campaign']['findAll'](queryCampaigns));_0x5d2136[_0x7042('0x2f')](db[_0x7042('0x6')]['findAll'](queryAgents));break;case _0x7042('0x34'):_0x13bbcf[_0x2d30f3](_0x7042('0x2d'));_0x13bbcf[_0x2d30f3](_0x7042('0x35'));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0xf'),_0x3a6704[_0x7042('0x22')],_0x7042('0x36')));_0x5d2136['push'](getAssociatedResources(_0x7042('0x10'),_0x3a6704['userProfileId'],_0x7042('0x30')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0x37'),_0x3a6704['userProfileId'],_0x7042('0x38')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources('SmsQueues',_0x3a6704['userProfileId'],_0x7042('0x39')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0x12'),_0x3a6704[_0x7042('0x22')],_0x7042('0x3a')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0x13'),_0x3a6704[_0x7042('0x22')],_0x7042('0x31')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0x14'),_0x3a6704['userProfileId'],_0x7042('0x32')));_0x5d2136['push'](getAssociatedResources('Telephones',_0x3a6704[_0x7042('0x22')],'User'));_0x5d2136[_0x7042('0x2f')](getAssociatedResources(_0x7042('0x17'),_0x3a6704[_0x7042('0x22')],_0x7042('0x33')));_0x5d2136[_0x7042('0x2f')](getAssociatedResources('IvrCampaigns',_0x3a6704[_0x7042('0x22')],_0x7042('0x1c')));_0x5d2136[_0x7042('0x2f')](db['User'][_0x7042('0x15')](queryAgents));break;case'agent':_0x13bbcf[_0x2d30f3](_0x7042('0x2d'));_0x13bbcf[_0x2d30f3](_0x7042('0x35'));_0x5d2136[_0x7042('0x2f')](_0x3a6704[_0x7042('0x3b')]({'attributes':['id',_0x7042('0x4')]}));_0x5d2136['push'](_0x3a6704['getChatQueues']({'attributes':['id',_0x7042('0x4')]}));_0x5d2136[_0x7042('0x2f')](_0x3a6704[_0x7042('0x3c')]({'attributes':['id',_0x7042('0x4')]}));_0x5d2136[_0x7042('0x2f')](_0x3a6704[_0x7042('0x3d')]({'attributes':['id',_0x7042('0x4')]}));_0x5d2136['push'](_0x3a6704[_0x7042('0x3e')]({'attributes':['id',_0x7042('0x4')]}));_0x5d2136['push'](_0x3a6704['getOpenchannelQueues']({'attributes':['id',_0x7042('0x4')]}));_0x5d2136[_0x7042('0x2f')](_0x3a6704[_0x7042('0x3f')]({'attributes':['id',_0x7042('0x4')]}));break;}return BPromise[_0x7042('0x40')](_0x5d2136);}})[_0x7042('0x19')](function(_0x5f1fb1){if(_0x5f1fb1&&_0x5f1fb1[_0x7042('0x1f')]){for(var _0x4dedfb=0x0;_0x4dedfb<_0x5f1fb1[_0x7042('0x1f')];_0x4dedfb+=0x1){for(var _0xef9be9=0x0;_0xef9be9<_0x5f1fb1[_0x4dedfb][_0x7042('0x1f')];_0xef9be9+=0x1){switch(_0x4dedfb){case 0x0:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x41'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x1:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x42'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x2:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x43'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x3:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x44'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x4:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x45'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x5:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x46'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x6:joinOrLeaveQueues(_0x13bbcf,_0x2d30f3,_0x7042('0x47'),_0x5f1fb1[_0x4dedfb][_0xef9be9]);break;case 0x7:if(_0x529d5a[_0x7042('0x7')]!==_0x7042('0x8'))_0x13bbcf[_0x2d30f3](util[_0x7042('0x1d')]('telephone:%s',_0x5f1fb1[_0x4dedfb][_0xef9be9][_0x7042('0x4')]));break;case 0x8:if(_0x529d5a['role']!=='agent')_0x13bbcf[_0x2d30f3](util[_0x7042('0x1d')](_0x7042('0x48'),_0x5f1fb1[_0x4dedfb][_0xef9be9][_0x7042('0x4')]));break;case 0x9:if(_0x529d5a[_0x7042('0x7')]!=='agent')_0x13bbcf[_0x2d30f3](util[_0x7042('0x1d')]('campaign:%s:%s',_0x5f1fb1[_0x4dedfb][_0xef9be9][_0x7042('0xa')],_0x5f1fb1[_0x4dedfb][_0xef9be9][_0x7042('0x4')]));break;case 0xa:_0x13bbcf[_0x2d30f3](util[_0x7042('0x1d')]('user:%s',_0x5f1fb1[_0x4dedfb][_0xef9be9][_0x7042('0x4')]));break;}}}}})['then'](function(){if(_0x2d30f3===_0x7042('0x49')){var _0x54d67c=_['map'](_0x529d5a[_0x7042('0x24')],'id');return _0x529d5a[_0x7042('0x4a')](_0x54d67c)[_0x7042('0x19')](function(){for(var _0x234018=0x0;_0x234018<_0x54d67c['length'];_0x234018+=0x1){_0x265850[_0x7042('0x4b')](_0x7042('0x4c'),{'ChatInteractionId':Number(_0x54d67c[_0x234018]),'UserId':Number(_0x529d5a['id'])});}});}})[_0x7042('0x19')](function(){if(_0x2d30f3===_0x7042('0x49')){var _0x5afd36=_[_0x7042('0x1a')](_0x529d5a[_0x7042('0x4d')],'id');return _0x529d5a[_0x7042('0x4e')](_0x5afd36)[_0x7042('0x19')](function(){for(var _0x8bca56=0x0;_0x8bca56<_0x5afd36[_0x7042('0x1f')];_0x8bca56+=0x1){_0x265850[_0x7042('0x4b')](_0x7042('0x4f'),{'MailInteractionId':Number(_0x5afd36[_0x8bca56]),'UserId':Number(_0x529d5a['id'])});}});}})['then'](function(){if(_0x2d30f3===_0x7042('0x49')){var _0xe1c6ee=_[_0x7042('0x1a')](_0x529d5a[_0x7042('0x50')],'id');return _0x529d5a['removeFaxInteractions'](_0xe1c6ee)[_0x7042('0x19')](function(){for(var _0x12824a=0x0;_0x12824a<_0xe1c6ee[_0x7042('0x1f')];_0x12824a+=0x1){_0x265850['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xe1c6ee[_0x12824a]),'UserId':Number(_0x529d5a['id'])});}});}})[_0x7042('0x19')](function(){if(_0x2d30f3===_0x7042('0x49')){var _0x33ba46=_['map'](_0x529d5a[_0x7042('0x28')],'id');return _0x529d5a['removeSmsInteractions'](_0x33ba46)['then'](function(){for(var _0xdd7d78=0x0;_0xdd7d78<_0x33ba46[_0x7042('0x1f')];_0xdd7d78+=0x1){_0x265850[_0x7042('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x33ba46[_0xdd7d78]),'UserId':Number(_0x529d5a['id'])});}});}})[_0x7042('0x19')](function(){if(_0x2d30f3===_0x7042('0x49')){var _0x2c6c07=_[_0x7042('0x1a')](_0x529d5a[_0x7042('0x2a')],'id');return _0x529d5a[_0x7042('0x51')](_0x2c6c07)[_0x7042('0x19')](function(){for(var _0x24f150=0x0;_0x24f150<_0x2c6c07['length'];_0x24f150+=0x1){_0x265850['emit'](_0x7042('0x52'),{'OpenchannelInteractionId':Number(_0x2c6c07[_0x24f150]),'UserId':Number(_0x529d5a['id'])});}});}})['then'](function(){if(_0x2d30f3===_0x7042('0x49')){var _0x531007=_[_0x7042('0x1a')](_0x529d5a[_0x7042('0x53')],'id');return _0x529d5a[_0x7042('0x54')](_0x531007)[_0x7042('0x19')](function(){for(var _0x2f7f7b=0x0;_0x2f7f7b<_0x531007[_0x7042('0x1f')];_0x2f7f7b+=0x1){_0x265850[_0x7042('0x4b')](_0x7042('0x55'),{'WhatsappInteractionId':Number(_0x531007[_0x2f7f7b]),'UserId':Number(_0x529d5a['id'])});}});}})['catch'](function(_0x1ea494){_0x13bbcf['log'](_0x1ea494);});}}function onDisconnect(_0x35d0f6,_0x19bdd8){joinOrLeave(_0x35d0f6,_0x7042('0x49'),_0x19bdd8);}function onConnect(_0x40d34b){joinOrLeave(_0x40d34b,_0x7042('0x56'));}exports[_0x7042('0x57')]=function(_0x5c5825){_0x5c5825['on'](_0x7042('0x58'),function(_0x2245b5){_0x2245b5[_0x7042('0x59')](0x0);_0x2245b5[_0x7042('0x5a')]=_0x2245b5[_0x7042('0x5b')]['connection'][_0x7042('0x5c')]+':'+_0x2245b5[_0x7042('0x5b')]['connection'][_0x7042('0x5d')];_0x2245b5[_0x7042('0x5e')]=new Date();_0x2245b5[_0x7042('0x5f')]=function(_0x145fdc){console['log'](_0x7042('0x60')+_0x2245b5[_0x7042('0x61')][_0x7042('0x4')]+'['+_0x2245b5[_0x7042('0x5a')]+']',_0x145fdc);};_0x2245b5['on']('disconnect',function(){onDisconnect(_0x2245b5,_0x5c5825);_0x2245b5[_0x7042('0x5f')](_0x7042('0x62'));});onConnect(_0x2245b5);_0x2245b5[_0x7042('0x5f')](_0x7042('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b36a01e..485830c 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 _0xaa3d=['afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','Trigger,\x20%s','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','contact','UserId','format','SIP/%s','incomingmessage','outgoingmessage','catch','AfterCreateMessage','get','offlineMessage','name','agent','changed','closed','substatus','sequelize','SELECT','User','find','fullname','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','util','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xaa3d,0x120));var _0xdaa3=function(_0x4c7d16,_0x4d7c04){_0x4c7d16=_0x4c7d16-0x0;var _0x167186=_0xaa3d[_0x4c7d16];return _0x167186;};'use strict';var util=require(_0xdaa3('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdaa3('0x1'));var logger=require(_0xdaa3('0x2'))(_0xdaa3('0x3'));var client=jayson[_0xdaa3('0x4')][_0xdaa3('0x5')]({'port':0x232a});var triggers=[{'channel':_0xdaa3('0x6'),'model':_0xdaa3('0x7'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0x9'),'callback':afterCreate},{'channel':_0xdaa3('0x6'),'model':_0xdaa3('0x7'),'event':_0xdaa3('0xa'),'condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':_0xdaa3('0x6'),'model':_0xdaa3('0xc'),'event':'afterCreate','condition':_0xdaa3('0xd'),'callback':afterCreateMessage},{'channel':_0xdaa3('0x6'),'model':_0xdaa3('0xe'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0xdaa3('0xf'),'model':_0xdaa3('0x10'),'event':'afterCreate','condition':_0xdaa3('0x9'),'callback':afterCreate},{'channel':_0xdaa3('0xf'),'model':_0xdaa3('0x10'),'event':'afterUpdate','condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':_0xdaa3('0xf'),'model':_0xdaa3('0x11'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0xd'),'callback':afterCreateMessage},{'channel':_0xdaa3('0x12'),'model':_0xdaa3('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xdaa3('0x12'),'model':_0xdaa3('0x13'),'event':_0xdaa3('0xa'),'condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':_0xdaa3('0x12'),'model':_0xdaa3('0x14'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0xd'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xdaa3('0x15'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0x9'),'callback':afterCreate},{'channel':_0xdaa3('0x16'),'model':_0xdaa3('0x15'),'event':_0xdaa3('0xa'),'condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':_0xdaa3('0x16'),'model':'FaxMessage','event':_0xdaa3('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdaa3('0x17'),'model':_0xdaa3('0x18'),'event':'afterCreate','condition':_0xdaa3('0x9'),'callback':afterCreate},{'channel':'Mail','model':_0xdaa3('0x18'),'event':_0xdaa3('0xa'),'condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':_0xdaa3('0x17'),'model':_0xdaa3('0x19'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0xd'),'callback':afterCreateMessage},{'channel':_0xdaa3('0x1a'),'model':_0xdaa3('0x1b'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0x9'),'callback':afterCreate},{'channel':_0xdaa3('0x1a'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0xdaa3('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xdaa3('0x1c'),'event':_0xdaa3('0x8'),'condition':_0xdaa3('0xd'),'callback':afterCreateMessage}];function request(_0x44c218){return client[_0xdaa3('0x1d')](_0xdaa3('0x1e'),_0x44c218)[_0xdaa3('0x1f')](function(_0x3fba70){logger[_0xdaa3('0x20')]('Trigger,\x20%s',_0xdaa3('0x1e'),_0x3fba70);if(_0x3fba70['error']){if(_0x3fba70[_0xdaa3('0x21')]['code']===0x1f4){logger[_0xdaa3('0x21')](_0xdaa3('0x22'),_0xdaa3('0x1e'),_0x3fba70[_0xdaa3('0x21')]);}}})['catch'](function(_0x5034c3){logger[_0xdaa3('0x21')]('Trigger,\x20%s',_0xdaa3('0x1e'),_0x5034c3);});}function afterCreateMessage(_0x3190fe){return function(_0x308af4){_0x308af4=_0x308af4['get']({'plain':!![]});_0x308af4[_0xdaa3('0x23')]=_0x3190fe;_0x308af4[_0xdaa3('0x24')]=_0x3190fe;_0x308af4[_0xdaa3('0x25')]=_0x308af4[_0xdaa3('0x26')];Promise[_0xdaa3('0x27')]()[_0xdaa3('0x1f')](function(){if(typeof _0x308af4[_0xdaa3('0x28')]===_0xdaa3('0x29'))return null;var _0x397fb3=_0xdaa3('0x2a')+_0x308af4[_0xdaa3('0x28')];return db['sequelize'][_0xdaa3('0x2b')](_0x397fb3,{'type':db[_0xdaa3('0x2c')][_0xdaa3('0x2d')]['SELECT'],'raw':!![]});})['then'](function(_0x209244){if(_0x209244){_0x308af4[_0xdaa3('0x2e')]=_0x209244[0x0];}if(typeof _0x308af4[_0xdaa3('0x2f')]==='undefined')return;return getAgent(_0x308af4[_0xdaa3('0x2f')]);})[_0xdaa3('0x1f')](function(_0x48aeea){if(_0x48aeea){_0x308af4['interface']=util[_0xdaa3('0x30')](_0xdaa3('0x31'),_0x48aeea['name']);_0x308af4['agent']=_0x48aeea;_0x308af4[_0xdaa3('0x23')]=_0x3190fe;return request({'event':_0xdaa3('0x32'),'message':_0x308af4});}else{return request({'event':_0xdaa3('0x33'),'message':_0x308af4});}})[_0xdaa3('0x34')](function(_0x28c30b){logger[_0xdaa3('0x21')]('Trigger,\x20%s',_0xdaa3('0x35'),_0x28c30b);});};}function afterCreateOfflineMessage(_0x262c34){return function(_0x56b002){_0x56b002=_0x56b002[_0xdaa3('0x36')]({'plain':!![]});_0x56b002[_0xdaa3('0x23')]=_0x262c34;_0x56b002[_0xdaa3('0x24')]=_0x262c34;_0x56b002[_0xdaa3('0x25')]=_0xdaa3('0x37');return request({'event':_0x56b002[_0xdaa3('0x25')],'message':_0x56b002});};}function afterCreate(_0x364a54,_0x42d59b){return function(_0x162fe8){_0x162fe8=_0x162fe8['get']({'plain':!![]});_0x162fe8[_0xdaa3('0x23')]=_0x364a54;_0x162fe8[_0xdaa3('0x24')]=_0x364a54;_0x162fe8[_0xdaa3('0x25')]='opened';Promise['resolve']()[_0xdaa3('0x1f')](function(){var _0xd77c53=_0xdaa3('0x2a')+_0x162fe8[_0xdaa3('0x28')];return db['sequelize'][_0xdaa3('0x2b')](_0xd77c53,{'type':db['Sequelize'][_0xdaa3('0x2d')]['SELECT'],'raw':!![]});})['then'](function(_0xc255c2){if(_0xc255c2){_0x162fe8[_0xdaa3('0x2e')]=_0xc255c2[0x0];}if(typeof _0x162fe8[_0xdaa3('0x2f')]==='undefined')return;return getAgent(_0x162fe8[_0xdaa3('0x2f')]);})['then'](function(_0x149ede){if(_0x149ede){_0x162fe8['interface']=util['format']('SIP/%s',_0x149ede[_0xdaa3('0x38')]);_0x162fe8[_0xdaa3('0x39')]=_0x149ede;}return request({'event':_0x42d59b,'message':_0x162fe8});})['catch'](function(_0x43cb81){logger[_0xdaa3('0x21')](_0xdaa3('0x22'),'AfterCreate',_0x43cb81);});};}function afterUpdate(_0x44b419){return function(_0x59d5d0){var _0x1beb80=_0x59d5d0[_0xdaa3('0x3a')](_0xdaa3('0x3b'))&&_0x59d5d0[_0xdaa3('0x3b')];var _0x46dc08=_0x59d5d0[_0xdaa3('0x3a')](_0xdaa3('0x3c'));if(_0x1beb80||_0x46dc08){var _0x185a9d=_0x1beb80?'closedinteraction':_0xdaa3('0x3c');var _0x10b3b6=_0x59d5d0['get']({'plain':!![]});_0x10b3b6['channel']=_0x44b419;_0x10b3b6['motionChannel']=_0x44b419;_0x10b3b6[_0xdaa3('0x25')]=_0x1beb80?'closed':_0xdaa3('0x3c');var _0x167b09='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x10b3b6[_0xdaa3('0x28')];return db[_0xdaa3('0x3d')][_0xdaa3('0x2b')](_0x167b09,{'type':db['Sequelize'][_0xdaa3('0x2d')][_0xdaa3('0x3e')],'raw':!![]})[_0xdaa3('0x1f')](function(_0x27f468){if(_0x27f468){_0x10b3b6[_0xdaa3('0x2e')]=_0x27f468[0x0];}if(typeof _0x10b3b6[_0xdaa3('0x2f')]==='undefined')return;return getAgent(_0x10b3b6[_0xdaa3('0x2f')]);})['then'](function(_0x5866ab){if(_0x5866ab){_0x10b3b6['interface']=util[_0xdaa3('0x30')](_0xdaa3('0x31'),_0x5866ab[_0xdaa3('0x38')]);_0x10b3b6[_0xdaa3('0x39')]=_0x5866ab;}return request({'event':_0x185a9d,'message':_0x10b3b6});})[_0xdaa3('0x34')](function(_0x1839e0){logger[_0xdaa3('0x21')](_0xdaa3('0x22'),'AfterUpdate',_0x1839e0);});}};}function getAgent(_0x137850){return db[_0xdaa3('0x3f')][_0xdaa3('0x40')]({'where':{'id':_0x137850},'attributes':['id',_0xdaa3('0x38'),_0xdaa3('0x41'),'email',_0xdaa3('0x42')],'raw':!![]})[_0xdaa3('0x1f')](function(_0x203500){return _0x203500;});}exports[_0xdaa3('0x43')]=function(){for(var _0x11b613=0x0;_0x11b613=_0x497224['agents']){throw Error(_0x6781('0x18'));}_0x537e2a(_0x1c26bc);})[_0x6781('0x19')](function(_0x1c4b4c){_0x52cb63(_0x1c4b4c);});});}; \ No newline at end of file +var _0xa6c3=['./license/util','voice','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb'];(function(_0x4574d9,_0x224f1a){var _0x30cea4=function(_0x4d26a5){while(--_0x4d26a5){_0x4574d9['push'](_0x4574d9['shift']());}};_0x30cea4(++_0x224f1a);}(_0xa6c3,0x132));var _0x3a6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa6c3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var BPromise=require(_0x3a6c('0x0'));var db=require(_0x3a6c('0x1'))['db'];var util=require(_0x3a6c('0x2'));var channels=[_0x3a6c('0x3'),'mail','chat',_0x3a6c('0x4'),_0x3a6c('0x5'),_0x3a6c('0x6'),_0x3a6c('0x7')];exports[_0x3a6c('0x8')]=function(){return channels;};exports[_0x3a6c('0x9')]=function(_0x16a264){_0x16a264=_0x16a264[_0x3a6c('0xa')]();return _['includes'](channels,_0x16a264);};exports[_0x3a6c('0xb')]=function(_0x2ba22e,_0x124885,_0x13328e,_0x10d9ec){var _0x20c17c={'loginAttempts':_0x124885,'blocked':_0x13328e};if(!_[_0x3a6c('0xc')](_0x10d9ec)){_0x20c17c[_0x3a6c('0xd')]=_0x10d9ec;}return _0x2ba22e['updateAttributes'](_0x20c17c);};exports[_0x3a6c('0xe')]=function(_0x1e713b){return new BPromise(function(_0xadf484,_0x4f2f92){var _0x4515dd=0x0;if(_0x1e713b[_0x3a6c('0xf')]!==_0x3a6c('0x10')){_0xadf484(_0x1e713b);}db[_0x3a6c('0x11')][_0x3a6c('0x12')]({'where':{'role':_0x3a6c('0x10'),'online':!![],'id':{'$ne':_0x1e713b['id']}}})[_0x3a6c('0x13')](function(_0x32df24){_0x4515dd=_0x32df24;return util['getLicense']();})[_0x3a6c('0x13')](function(_0x6ff8af){if(_0x6ff8af&&_0x6ff8af[_0x3a6c('0x14')]&&_0x4515dd>=_0x6ff8af[_0x3a6c('0x14')]){throw Error(_0x3a6c('0x15'));}_0xadf484(_0x1e713b);})['catch'](function(_0x263fb1){_0x4f2f92(_0x263fb1);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 04be950..63ebf38 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187c=['name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','Conflict','stack','statusMessage','send','exports','util','../config/logger','message','Internal\x20Server\x20Error'];(function(_0x3d5ec4,_0x118658){var _0x4e9e5f=function(_0xb919de){while(--_0xb919de){_0x3d5ec4['push'](_0x3d5ec4['shift']());}};_0x4e9e5f(++_0x118658);}(_0x187c,0x74));var _0xc187=function(_0x26b126,_0x267c28){_0x26b126=_0x26b126-0x0;var _0x2e11e8=_0x187c[_0x26b126];return _0x2e11e8;};'use strict';var util=require(_0xc187('0x0'));var logger=require(_0xc187('0x1'))('api');var APIError=function(_0xc1de40,_0x39b41f){this[_0xc187('0x2')]=_0xc1de40||_0xc187('0x3');this[_0xc187('0x4')]=_0x39b41f||_0xc187('0x5');util[_0xc187('0x6')](APIError,Error);};var APIBadRequestError=function(_0x39585c){this[_0xc187('0x2')]=_0x39585c||_0xc187('0x7');this['name']=_0xc187('0x7');util[_0xc187('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0xe984af){this[_0xc187('0x2')]=_0xe984af||_0xc187('0x8');this[_0xc187('0x4')]=_0xc187('0x8');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x5d5107){this[_0xc187('0x2')]=_0x5d5107||_0xc187('0x9');this[_0xc187('0x4')]=_0xc187('0xa');util[_0xc187('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x45501f){this[_0xc187('0x2')]=_0x45501f||_0xc187('0xb');this[_0xc187('0x4')]=_0xc187('0xc');this[_0xc187('0xd')]=0x193;this[_0xc187('0xe')]={'type':'OutOfInterval'};util[_0xc187('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x11e831){this['message']=_0x11e831||'Resource\x20Conflict';this[_0xc187('0x4')]=_0xc187('0xf');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x17cdea){switch(_0x17cdea){case _0xc187('0x7'):return 0x190;case _0xc187('0x8'),_0xc187('0xc'):return 0x193;case _0xc187('0xa'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x3b57f1){if(_0x3b57f1==='Out\x20Of\x20Interval')return _0x3b57f1;return null;}function handleError(_0x356b6f){return function(_0x53db94){logger['error'](_0x53db94[_0xc187('0x10')]);var _0x3d85b8=getStatusCode(_0x53db94['name']);var _0x2e41f4=getCustomStatusMessage(_0x53db94[_0xc187('0x4')]);if(_0x53db94[_0xc187('0x4')]){delete _0x53db94[_0xc187('0x4')];}if(_0x2e41f4){_0x356b6f[_0xc187('0x11')]=_0x2e41f4;}return _0x356b6f['status'](_0x3d85b8)[_0xc187('0x12')](_0x53db94);};}module[_0xc187('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x244b=['code','details','OutOfInterval','Resource\x20Conflict','Conflict','error','stack','send','exports','util','api','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval'];(function(_0x224ded,_0x1b2757){var _0x3f2c61=function(_0xb06dea){while(--_0xb06dea){_0x224ded['push'](_0x224ded['shift']());}};_0x3f2c61(++_0x1b2757);}(_0x244b,0x169));var _0xb244=function(_0x219ac7,_0x548dec){_0x219ac7=_0x219ac7-0x0;var _0x5964da=_0x244b[_0x219ac7];return _0x5964da;};'use strict';var util=require(_0xb244('0x0'));var logger=require('../config/logger')(_0xb244('0x1'));var APIError=function(_0x442993,_0x3f9db9){this[_0xb244('0x2')]=_0x442993||_0xb244('0x3');this[_0xb244('0x4')]=_0x3f9db9||_0xb244('0x5');util[_0xb244('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3fdb25){this[_0xb244('0x2')]=_0x3fdb25||_0xb244('0x7');this[_0xb244('0x4')]=_0xb244('0x7');util[_0xb244('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x46b17d){this[_0xb244('0x2')]=_0x46b17d||_0xb244('0x8');this[_0xb244('0x4')]=_0xb244('0x8');util[_0xb244('0x6')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x3bed5d){this[_0xb244('0x2')]=_0x3bed5d||_0xb244('0x9');this[_0xb244('0x4')]=_0xb244('0xa');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x5f09ca){this[_0xb244('0x2')]=_0x5f09ca||_0xb244('0xb');this[_0xb244('0x4')]=_0xb244('0xc');this[_0xb244('0xd')]=0x193;this[_0xb244('0xe')]={'type':_0xb244('0xf')};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x5a54fa){this[_0xb244('0x2')]=_0x5a54fa||_0xb244('0x10');this[_0xb244('0x4')]=_0xb244('0x11');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x3c9276){switch(_0x3c9276){case _0xb244('0x7'):return 0x190;case'Forbidden',_0xb244('0xc'):return 0x193;case _0xb244('0xa'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x3548f3){if(_0x3548f3===_0xb244('0xc'))return _0x3548f3;return null;}function handleError(_0x3a5c89){return function(_0x16d8fe){logger[_0xb244('0x12')](_0x16d8fe[_0xb244('0x13')]);var _0xb15c1f=getStatusCode(_0x16d8fe['name']);var _0x359412=getCustomStatusMessage(_0x16d8fe[_0xb244('0x4')]);if(_0x16d8fe[_0xb244('0x4')]){delete _0x16d8fe[_0xb244('0x4')];}if(_0x359412){_0x3a5c89['statusMessage']=_0x359412;}return _0x3a5c89['status'](_0xb15c1f)[_0xb244('0x14')](_0x16d8fe);};}module[_0xb244('0x15')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f4ae90e..59fcb2e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x915a=['json','exports','404','render','status'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x915a,0x1d2));var _0xa915=function(_0x4dee31,_0x381ab4){_0x4dee31=_0x4dee31-0x0;var _0x3341d8=_0x915a[_0x4dee31];return _0x3341d8;};'use strict';module[_0xa915('0x0')][0x194]=function pageNotFound(_0x43b7a7,_0xace4e4){var _0x3b516c=_0xa915('0x1');var _0x5aa65b=0x194;var _0x1ca3fc={'status':_0x5aa65b};_0xace4e4['status'](_0x1ca3fc['status']);_0xace4e4[_0xa915('0x2')](_0x3b516c,{},function(_0x422023,_0xf654ba){if(_0x422023){return _0xace4e4[_0xa915('0x3')](_0x1ca3fc[_0xa915('0x3')])[_0xa915('0x4')](_0x1ca3fc);}_0xace4e4['send'](_0xf654ba);});}; \ No newline at end of file +var _0x5201=['render','exports','404','status'];(function(_0x3b891d,_0x2154c3){var _0xcbaf13=function(_0x318121){while(--_0x318121){_0x3b891d['push'](_0x3b891d['shift']());}};_0xcbaf13(++_0x2154c3);}(_0x5201,0xf5));var _0x1520=function(_0x512473,_0x1ab86a){_0x512473=_0x512473-0x0;var _0x5dc405=_0x5201[_0x512473];return _0x5dc405;};'use strict';module[_0x1520('0x0')][0x194]=function pageNotFound(_0x14a22a,_0x2fb783){var _0x5b2aed=_0x1520('0x1');var _0x5a0614=0x194;var _0x5e4de1={'status':_0x5a0614};_0x2fb783[_0x1520('0x2')](_0x5e4de1[_0x1520('0x2')]);_0x2fb783[_0x1520('0x3')](_0x5b2aed,{},function(_0x2e133d,_0x4234f0){if(_0x2e133d){return _0x2fb783['status'](_0x5e4de1[_0x1520('0x2')])['json'](_0x5e4de1);}_0x2fb783['send'](_0x4234f0);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1eac126..5105c76 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7889=['../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','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','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/attachment/attachment.model','Plugin','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','CmHopper','SET\x20NULL','belongsTo','belongsToMany','chat_group_has_users','Contacts','CmList','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','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','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','Trunk','TrunkId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Interactions','List','MailInteractionId','Account','Owner','Tag','Tags','mail_interaction_has_tags','Users','Attachment','Interaction','ChatWebsite','ChatOfflineMessageId','ListId','Dashboard','Answers','FaxAccountId','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','CompanyId','CmContactId','HopperHistories','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','TriggerAnyId','AnalyticFieldReport','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','DescriptionId','FieldId','SalesforceAccount','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','SugarcrmField','Descriptions','Subject','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_mail_queues','team_has_whatsapp_queues','TrunkBackup','TrunkBackupId','SquareProjectId','Lists','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','WhatsappQueueId','user','../config/environment','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','sequelizeHistory','defaultsDeep','motion2','utf8','utf8_general_ci','database','username','password','options','User','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','UserFaxQueue','UserSmsQueue'];(function(_0x1253e1,_0xa94ef9){var _0x5ecfde=function(_0x4c75af){while(--_0x4c75af){_0x1253e1['push'](_0x1253e1['shift']());}};_0x5ecfde(++_0xa94ef9);}(_0x7889,0x1cc));var _0x9788=function(_0x18f990,_0x28e812){_0x18f990=_0x18f990-0x0;var _0x37a777=_0x7889[_0x18f990];return _0x37a777;};'use strict';var config=require(_0x9788('0x0'));var Sequelize=require(_0x9788('0x1'));var _=require(_0x9788('0x2'));var jstz=require(_0x9788('0x3'));var timezone=jstz[_0x9788('0x4')]();config[_0x9788('0x1')]=_['defaultsDeep'](config[_0x9788('0x1')],{'database':'motion2','username':_0x9788('0x5'),'password':_0x9788('0x6'),'options':{'host':_0x9788('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9788('0x8')},'logging':![],'timezone':timezone[_0x9788('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x9788('0xa')]=_[_0x9788('0xb')](config[_0x9788('0xa')],{'database':_0x9788('0xc'),'username':_0x9788('0x5'),'password':_0x9788('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9788('0x8')},'logging':![],'timezone':timezone[_0x9788('0x9')](),'define':{'charset':_0x9788('0xd'),'collate':_0x9788('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9788('0x1')][_0x9788('0xf')],config[_0x9788('0x1')][_0x9788('0x10')],config[_0x9788('0x1')][_0x9788('0x11')],config['sequelize'][_0x9788('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9788('0xa')][_0x9788('0xf')],config[_0x9788('0xa')]['username'],config[_0x9788('0xa')]['password'],config[_0x9788('0xa')][_0x9788('0x12')])};db[_0x9788('0x13')]=db['sequelize'][_0x9788('0x14')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x9788('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x15'));db[_0x9788('0x16')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x17'));db[_0x9788('0x18')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x19'));db['VoiceQueue']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x1a'));db[_0x9788('0x1b')]=db['sequelize'][_0x9788('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x9788('0x1c')]=db['sequelize'][_0x9788('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x9788('0x1')]['import']('../api/voiceMail/voiceMail.model');db[_0x9788('0x1d')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x1e'));db['VoiceCallReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x1f'));db[_0x9788('0x20')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x21'));db[_0x9788('0x22')]=db[_0x9788('0x1')]['import'](_0x9788('0x23'));db[_0x9788('0x24')]=db[_0x9788('0x1')]['import'](_0x9788('0x25'));db['Trunk']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/trunk/trunk.model');db[_0x9788('0x26')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x27'));db[_0x9788('0x28')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x29'));db['UserVoiceQueue']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x2a'));db[_0x9788('0x2b')]=db['sequelize'][_0x9788('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x9788('0x2c')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x9788('0x2d')]=db[_0x9788('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x9788('0x2e')]=db[_0x9788('0x1')]['import'](_0x9788('0x2f'));db[_0x9788('0x30')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x31'));db['UserWhatsappQueue']=db['sequelize']['import'](_0x9788('0x32'));db[_0x9788('0x33')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x34'));db[_0x9788('0x35')]=db[_0x9788('0x1')]['import'](_0x9788('0x36'));db[_0x9788('0x37')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x38'));db[_0x9788('0x39')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x9788('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x9788('0x3a')]=db['sequelize']['import'](_0x9788('0x3b'));db[_0x9788('0x3c')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/mailMessage/mailMessage.model');db[_0x9788('0x3d')]=db[_0x9788('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0x9788('0x3e')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x3f'));db['Dashboard']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/dashboard/dashboard.model');db[_0x9788('0x40')]=db[_0x9788('0x1')]['import'](_0x9788('0x41'));db[_0x9788('0x42')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x43'));db[_0x9788('0x44')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x45'));db[_0x9788('0x46')]=db[_0x9788('0x1')]['import'](_0x9788('0x47'));db[_0x9788('0x48')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x49'));db[_0x9788('0x4a')]=db[_0x9788('0x1')]['import'](_0x9788('0x4b'));db[_0x9788('0x4c')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x4d'));db[_0x9788('0x4e')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x4f'));db[_0x9788('0x50')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x51'));db[_0x9788('0x52')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x53'));db[_0x9788('0x54')]=db[_0x9788('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0x9788('0x55')]=db['sequelize']['import'](_0x9788('0x56'));db[_0x9788('0x57')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x9788('0x58')]=db['sequelize'][_0x9788('0x14')](_0x9788('0x59'));db['OpenchannelInteraction']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x5a'));db[_0x9788('0x5b')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x5c'));db[_0x9788('0x5d')]=db['sequelize'][_0x9788('0x14')](_0x9788('0x5e'));db['ChatWebsite']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x5f'));db[_0x9788('0x60')]=db['sequelize']['import'](_0x9788('0x61'));db[_0x9788('0x62')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x63'));db['ChatInteraction']=db['sequelize']['import'](_0x9788('0x64'));db['ChatMessage']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x65'));db[_0x9788('0x66')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x67'));db[_0x9788('0x68')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x69'));db[_0x9788('0x6a')]=db[_0x9788('0x1')]['import'](_0x9788('0x6b'));db[_0x9788('0x6c')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x6d'));db[_0x9788('0x6e')]=db['sequelize']['import'](_0x9788('0x6f'));db['CmHopper']=db['sequelize'][_0x9788('0x14')](_0x9788('0x70'));db[_0x9788('0x71')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x72'));db[_0x9788('0x73')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x74'));db[_0x9788('0x75')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x9788('0x76')]=db[_0x9788('0x1')]['import'](_0x9788('0x77'));db['CmCustomField']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x78'));db['Action']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x79'));db[_0x9788('0x7a')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x7b'));db[_0x9788('0x7c')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x9788('0x7d')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x7e'));db[_0x9788('0x7f')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x9788('0x1')]['import'](_0x9788('0x80'));db[_0x9788('0x81')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x82'));db[_0x9788('0x83')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x84'));db['VoiceQueuesLog']=db[_0x9788('0x1')]['import'](_0x9788('0x85'));db[_0x9788('0x86')]=db[_0x9788('0x1')]['import']('../api/schedule/schedule.model');db[_0x9788('0x87')]=db['sequelize'][_0x9788('0x14')](_0x9788('0x88'));db['Tag']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x89'));db[_0x9788('0x8a')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x8b'));db[_0x9788('0x8c')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x8d'));db[_0x9788('0x8e')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x9788('0x8f')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x90'));db[_0x9788('0x91')]=db[_0x9788('0x1')]['import'](_0x9788('0x92'));db[_0x9788('0x93')]=db[_0x9788('0x1')]['import']('../api/variable/variable.model');db[_0x9788('0x94')]=db['sequelize'][_0x9788('0x14')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x95'));db['AnalyticCustomReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x96'));db[_0x9788('0x97')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x9788('0x98')]=db[_0x9788('0x1')]['import'](_0x9788('0x99'));db['AnalyticMetric']=db[_0x9788('0x1')]['import'](_0x9788('0x9a'));db['AnalyticFieldReport']=db['sequelize'][_0x9788('0x14')](_0x9788('0x9b'));db[_0x9788('0x9c')]=db['sequelize'][_0x9788('0x14')](_0x9788('0x9d'));db['SalesforceAccount']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x9788('0x9e')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x9788('0x9f')]=db[_0x9788('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x9788('0xa0')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xa1'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x9788('0xa2'));db['SugarcrmField']=db[_0x9788('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db['sequelize'][_0x9788('0x14')](_0x9788('0xa3'));db[_0x9788('0xa4')]=db[_0x9788('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x9788('0xa5')]=db['sequelize'][_0x9788('0x14')]('../api/intDeskField/intDeskField.model');db[_0x9788('0xa6')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xa7'));db[_0x9788('0xa8')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xa9'));db[_0x9788('0xaa')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xab'));db[_0x9788('0xac')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xad'));db[_0x9788('0xae')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xaf'));db[_0x9788('0xb0')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xb1'));db[_0x9788('0xb2')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xb3'));db[_0x9788('0xb4')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x9788('0xb5')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xb6'));db[_0x9788('0xb7')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xb8'));db[_0x9788('0xb9')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x9788('0xba')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x9788('0xbb')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xbc'));db[_0x9788('0xbd')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xbe'));db[_0x9788('0xbf')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xc0'));db[_0x9788('0xc1')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xc2'));db[_0x9788('0xc3')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x9788('0xc4')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xc5'));db['FreshsalesConfiguration']=db['sequelize'][_0x9788('0x14')](_0x9788('0xc6'));db['FreshsalesField']=db[_0x9788('0x1')]['import'](_0x9788('0xc7'));db[_0x9788('0x94')]=db[_0x9788('0x1')]['import'](_0x9788('0xc8'));db['Network']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xc9'));db[_0x9788('0xca')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xcb'));db[_0x9788('0xcc')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xcd'));db['JscriptyAnswerReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xce'));db['JscriptyQuestionReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xcf'));db[_0x9788('0xd0')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x9788('0xd1')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xd2'));db[_0x9788('0xd3')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xd4'));db[_0x9788('0xd5')]=db[_0x9788('0x1')]['import'](_0x9788('0xd6'));db[_0x9788('0xd7')]=db['sequelize']['import'](_0x9788('0xd8'));db['Setting']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/setting/setting.model');db['SquareOdbc']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xd9'));db[_0x9788('0xda')]=db[_0x9788('0x1')]['import'](_0x9788('0xdb'));db[_0x9788('0xdc')]=db[_0x9788('0x1')]['import'](_0x9788('0xdd'));db['SquareMessage']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xde'));db[_0x9788('0xdf')]=db[_0x9788('0x1')]['import']('../api/team/team.model');db[_0x9788('0xe0')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/license/license.model');db['Campaign']=db[_0x9788('0x1')]['import']('../api/campaign/campaign.model');db['Migration']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/migration/migration.model');db['Attachment']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xe1'));db[_0x9788('0xe2')]=db[_0x9788('0x1')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize'][_0x9788('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x9788('0xe3')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xe4'));db['FaxTransferReport']=db['sequelize'][_0x9788('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0x9788('0xe5')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xe6'));db[_0x9788('0xe7')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xe8'));db['CmList']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xe9'));db[_0x9788('0xea')]=db['sequelize']['import']('../api/voicePrefix/voicePrefix.model');db[_0x9788('0xeb')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/userProfile/userProfile.model');db[_0x9788('0xec')]=db['sequelize']['import'](_0x9788('0xed'));db['UserProfileResource']=db[_0x9788('0x1')][_0x9788('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x9788('0xee')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xef'));db[_0x9788('0xf0')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xf1'));db[_0x9788('0xf2')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xf3'));db[_0x9788('0xf4')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x9788('0xf5')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0x9788('0xf6')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xf7'));db['WhatsappTransferReport']=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xf8'));db[_0x9788('0xf9')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0xfa'));db['CloudProvider']=db['sequelize'][_0x9788('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x9788('0xfb')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xfc'));db[_0x9788('0xfd')]=db[_0x9788('0x1')][_0x9788('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x9788('0xfe')]=db['sequelize'][_0x9788('0x14')](_0x9788('0xff'));db[_0x9788('0x100')]=db[_0x9788('0x1')][_0x9788('0x14')](_0x9788('0x101'));db[_0x9788('0x102')]=db[_0x9788('0x1')]['import'](_0x9788('0x103'));db[_0x9788('0x13')][_0x9788('0x104')](db[_0x9788('0x105')],{'as':_0x9788('0x105'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')][_0x9788('0x104')](db[_0x9788('0x100')],{'as':_0x9788('0x108'),'onDelete':_0x9788('0x106'),'foreignKey':'UserId'});db[_0x9788('0x13')][_0x9788('0x109')](db[_0x9788('0x1b')],{'as':_0x9788('0x10a'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')][_0x9788('0x109')](db[_0x9788('0x28')],{'as':_0x9788('0x10b'),'foreignKey':_0x9788('0x107')});db['User'][_0x9788('0x109')](db[_0x9788('0x16')],{'as':_0x9788('0x10c'),'onDelete':_0x9788('0x106'),'hooks':!![]});db[_0x9788('0x13')][_0x9788('0x109')](db['CmHopperFinal'],{'as':_0x9788('0x10d'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')]['hasMany'](db[_0x9788('0x75')],{'as':_0x9788('0x10e'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')][_0x9788('0x109')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x9788('0x107')});db[_0x9788('0x13')]['hasMany'](db[_0x9788('0x10f')],{'as':_0x9788('0x110'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')][_0x9788('0x109')](db[_0x9788('0x111')],{'as':_0x9788('0x112'),'foreignKey':'UserId'});db['User']['hasMany'](db['SmsInteraction'],{'as':_0x9788('0x113'),'foreignKey':'UserId'});db[_0x9788('0x13')][_0x9788('0x109')](db[_0x9788('0x46')],{'as':_0x9788('0x114'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')][_0x9788('0x109')](db['MailInteraction'],{'as':_0x9788('0x115'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')]['hasMany'](db[_0x9788('0xf4')],{'as':_0x9788('0x116'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x13')]['hasMany'](db['UserNotification'],{'as':_0x9788('0x117'),'foreignKey':_0x9788('0x118')});db[_0x9788('0x13')][_0x9788('0x109')](db[_0x9788('0x119')],{'as':'Hoppers','foreignKey':_0x9788('0x107'),'onDelete':_0x9788('0x11a')});db[_0x9788('0x13')][_0x9788('0x11b')](db[_0x9788('0xeb')],{'as':_0x9788('0xeb'),'foreignKey':'userProfileId'});db['User'][_0x9788('0x11c')](db[_0x9788('0x6a')],{'as':'Groups','through':_0x9788('0x11d')});db[_0x9788('0x13')]['belongsToMany'](db['CmContact'],{'as':_0x9788('0x11e'),'through':'cm_user_has_contacts'});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x11f')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x9788('0x13')]['belongsToMany'](db[_0x9788('0xdf')],{'through':_0x9788('0x120')});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x3a')],{'as':'MailInteractions','through':_0x9788('0x121')});db[_0x9788('0x13')][_0x9788('0x11c')](db['ChatInteraction'],{'as':_0x9788('0x112'),'through':_0x9788('0x122')});db[_0x9788('0x13')]['belongsToMany'](db[_0x9788('0x46')],{'as':_0x9788('0x114'),'through':_0x9788('0x123')});db['User'][_0x9788('0x11c')](db['SmsInteraction'],{'as':_0x9788('0x113'),'through':_0x9788('0x124')});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x10f')],{'as':_0x9788('0x110'),'through':_0x9788('0x125')});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0xf4')],{'as':'WhatsappInteractions','through':_0x9788('0x126')});db['User']['belongsToMany'](db[_0x9788('0x127')],{'as':'VoiceQueues','through':_0x9788('0x128'),'required':![]});db[_0x9788('0x13')][_0x9788('0x11c')](db['VoicePrefix'],{'as':_0x9788('0x129'),'through':_0x9788('0xfe'),'required':![]});db['User'][_0x9788('0x11c')](db[_0x9788('0x39')],{'as':_0x9788('0x12a'),'through':'UserMailQueue','required':![]});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x68')],{'as':_0x9788('0x12b'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x9788('0x4a')],{'as':_0x9788('0x12c'),'through':_0x9788('0x2d'),'required':![]});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x55')],{'as':_0x9788('0x12d'),'through':'UserSmsQueue','required':![]});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x5d')],{'as':'OpenchannelQueues','through':_0x9788('0x30'),'required':![]});db['User']['belongsToMany'](db[_0x9788('0xf9')],{'as':_0x9788('0x12e'),'through':_0x9788('0x12f'),'required':![]});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0x11f')],{'through':_0x9788('0x130')});db[_0x9788('0x13')][_0x9788('0x11c')](db['ChatWebsite'],{'as':_0x9788('0x131'),'through':_0x9788('0x132')});db[_0x9788('0x13')]['belongsToMany'](db['FaxAccount'],{'as':_0x9788('0x133'),'through':_0x9788('0x134')});db['User']['belongsToMany'](db[_0x9788('0x37')],{'as':_0x9788('0x135'),'through':_0x9788('0x136')});db[_0x9788('0x13')][_0x9788('0x11c')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x9788('0x137')});db[_0x9788('0x13')]['belongsToMany'](db[_0x9788('0x4e')],{'as':_0x9788('0x138'),'through':_0x9788('0x139')});db[_0x9788('0x13')][_0x9788('0x11c')](db[_0x9788('0xf0')],{'as':_0x9788('0x13a'),'through':_0x9788('0x13b')});db['VoiceChanSpy'][_0x9788('0x109')](db[_0x9788('0x16')],{'as':_0x9788('0x13c'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x13d')});db['VoiceContext'][_0x9788('0x109')](db[_0x9788('0x16')],{'onDelete':_0x9788('0x106')});db[_0x9788('0x16')][_0x9788('0x109')](db[_0x9788('0x16')],{'as':_0x9788('0x13e'),'onDelete':_0x9788('0x106')});db[_0x9788('0x18')]['belongsToMany'](db['Sound'],{'as':'Sounds','through':_0x9788('0x13f')});db[_0x9788('0x127')]['hasMany'](db[_0x9788('0x28')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x9788('0x109')](db[_0x9788('0x119')],{'as':_0x9788('0x140'),'foreignKey':'VoiceQueueId'});db[_0x9788('0x127')][_0x9788('0x109')](db[_0x9788('0x73')],{'as':_0x9788('0x10d'),'foreignKey':_0x9788('0x141')});db[_0x9788('0x127')][_0x9788('0x109')](db[_0x9788('0x75')],{'as':'HopperHistories','foreignKey':_0x9788('0x141')});db[_0x9788('0x127')]['hasMany'](db[_0x9788('0x76')],{'as':_0x9788('0x76'),'foreignKey':_0x9788('0x141')});db[_0x9788('0x127')][_0x9788('0x109')](db[_0x9788('0x71')],{'as':_0x9788('0x142'),'foreignKey':_0x9788('0x141')});db['VoiceQueue']['hasMany'](db[_0x9788('0xd0')],{'as':_0x9788('0x143'),'foreignKey':_0x9788('0x141')});db[_0x9788('0x127')][_0x9788('0x11b')](db[_0x9788('0x144')],{'as':_0x9788('0x144'),'foreignKey':_0x9788('0x145')});db[_0x9788('0x127')][_0x9788('0x11b')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x9788('0x127')][_0x9788('0x11b')](db[_0x9788('0x146')],{'as':_0x9788('0x146'),'foreignKey':_0x9788('0x147')});db[_0x9788('0x127')]['belongsTo'](db[_0x9788('0x81')],{'as':_0x9788('0x148'),'foreignKey':_0x9788('0x149')});db[_0x9788('0x127')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x9788('0x127')][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x14a'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x9788('0x11c')](db[_0x9788('0xdf')],{'as':_0x9788('0x14b'),'through':_0x9788('0xfb')});db[_0x9788('0x127')][_0x9788('0x11c')](db['CmList'],{'as':'BlackLists','through':_0x9788('0x14c')});db[_0x9788('0x1b')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x13'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x1c')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x13'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x105')][_0x9788('0x109')](db[_0x9788('0x1d')],{'as':_0x9788('0x14d'),'onDelete':'cascade','foreignKey':_0x9788('0x14e'),'sourceKey':_0x9788('0x14f')});db[_0x9788('0x1d')][_0x9788('0x11b')](db[_0x9788('0x105')],{'foreignKey':_0x9788('0x14e'),'targetKey':_0x9788('0x14f')});db[_0x9788('0x150')][_0x9788('0x109')](db[_0x9788('0x22')],{'as':'QueueCalls','foreignKey':_0x9788('0x151'),'constraints':![]});db[_0x9788('0x150')][_0x9788('0x109')](db[_0x9788('0x152')],{'as':'AgentReports','foreignKey':_0x9788('0x151'),'constraints':![]});db[_0x9788('0x150')][_0x9788('0x11b')](db['User'],{'as':'User','foreignKey':_0x9788('0x107')});db['VoiceCallReport'][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x33')][_0x9788('0x11b')](db[_0x9788('0x37')],{'as':_0x9788('0x37'),'foreignKey':_0x9788('0x155')});db['MailServerIn']['belongsTo'](db[_0x9788('0x156')],{'as':_0x9788('0x156'),'foreignKey':_0x9788('0x157'),'onDelete':_0x9788('0x158')});db[_0x9788('0x35')][_0x9788('0x11b')](db['MailAccount'],{'as':_0x9788('0x37'),'foreignKey':_0x9788('0x155')});db[_0x9788('0x35')][_0x9788('0x11b')](db['CloudProvider'],{'as':_0x9788('0x156'),'foreignKey':_0x9788('0x157'),'onDelete':_0x9788('0x158')});db[_0x9788('0x37')][_0x9788('0x104')](db[_0x9788('0x33')],{'as':_0x9788('0x159'),'onDelete':_0x9788('0x106')});db[_0x9788('0x37')][_0x9788('0x104')](db[_0x9788('0x35')],{'as':_0x9788('0x15a'),'onDelete':_0x9788('0x106')});db[_0x9788('0x37')]['hasMany'](db[_0x9788('0x7d')],{'as':_0x9788('0x15b'),'foreignKey':_0x9788('0x155'),'onDelete':'cascade'});db[_0x9788('0x37')]['hasMany'](db[_0x9788('0x7c')],{'as':'Answers','foreignKey':_0x9788('0x155')});db[_0x9788('0x37')][_0x9788('0x109')](db['MailMessage'],{'as':_0x9788('0x14d'),'foreignKey':_0x9788('0x155')});db[_0x9788('0x37')][_0x9788('0x109')](db['MailInteraction'],{'as':_0x9788('0x15c')});db[_0x9788('0x37')]['hasMany'](db[_0x9788('0x3d')],{'as':_0x9788('0x13e'),'foreignKey':_0x9788('0x155'),'onDelete':_0x9788('0x106')});db[_0x9788('0x37')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':'ListId'});db[_0x9788('0x37')][_0x9788('0x11b')](db[_0x9788('0x8f')],{'as':_0x9788('0x8f'),'foreignKey':'TemplateId'});db[_0x9788('0x37')][_0x9788('0x11b')](db['Pause'],{'as':_0x9788('0x148'),'foreignKey':_0x9788('0x149')});db['MailAccount'][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x14a'),'through':'user_has_mail_accounts'});db[_0x9788('0x39')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x2c')});db[_0x9788('0x39')][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':'team_has_mail_queues','as':_0x9788('0x14b')});db[_0x9788('0x3a')]['hasMany'](db['MailMessage'],{'as':_0x9788('0x14d'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x15e')});db[_0x9788('0x3a')][_0x9788('0x11b')](db[_0x9788('0x37')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x155')});db[_0x9788('0x3a')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':'ContactId'});db['MailInteraction'][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x160'),'foreignKey':_0x9788('0x107')});db['MailInteraction'][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':'mail_interaction_has_tags','as':_0x9788('0x162')});db[_0x9788('0x3a')][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x163'),'as':'ThroughTags'});db[_0x9788('0x3a')][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x164'),'through':'user_has_mail_interactions','foreignKey':_0x9788('0x15e')});db[_0x9788('0x3c')][_0x9788('0x109')](db[_0x9788('0x165')],{'as':'Attachments','onDelete':_0x9788('0x106')});db[_0x9788('0x3c')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x13')});db[_0x9788('0x3c')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'onDelete':'cascade','as':_0x9788('0x153')});db['MailMessage'][_0x9788('0x11b')](db['MailInteraction'],{'as':_0x9788('0x166'),'foreignKey':'MailInteractionId'});db[_0x9788('0x3c')][_0x9788('0x11b')](db['MailAccount'],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x155')});db['MailMessage'][_0x9788('0x11b')](db[_0x9788('0x167')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x9788('0x3c')][_0x9788('0x11b')](db[_0x9788('0x66')],{'as':_0x9788('0x66'),'foreignKey':_0x9788('0x168')});db[_0x9788('0x3d')][_0x9788('0x11b')](db['User'],{'onDelete':_0x9788('0x158')});db[_0x9788('0x3d')][_0x9788('0x11b')](db['MailQueue'],{'onDelete':_0x9788('0x158')});db[_0x9788('0x3d')][_0x9788('0x11b')](db[_0x9788('0x37')],{'onDelete':_0x9788('0x158')});db[_0x9788('0x3d')][_0x9788('0x11b')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x9788('0x147')});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':_0x9788('0x158'),'foreignKey':'TagId'});db[_0x9788('0x3e')]['belongsTo'](db[_0x9788('0x37')],{});db[_0x9788('0x3e')][_0x9788('0x11b')](db['CmList'],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db['MailQueueReport'][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x3e')][_0x9788('0x11b')](db['MailInteraction'],{});db[_0x9788('0x3e')][_0x9788('0x11b')](db['MailMessage'],{});db[_0x9788('0x3e')][_0x9788('0x11b')](db[_0x9788('0x13')],{});db['MailQueueReport'][_0x9788('0x11b')](db[_0x9788('0x39')],{});db[_0x9788('0x16a')]['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0x9788('0x106')});db[_0x9788('0x42')][_0x9788('0x109')](db[_0x9788('0x7d')],{'as':_0x9788('0x15b'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0x9788('0x42')][_0x9788('0x109')](db['CannedAnswer'],{'as':_0x9788('0x16b'),'foreignKey':_0x9788('0x16c')});db[_0x9788('0x42')]['hasMany'](db[_0x9788('0x46')],{'as':_0x9788('0x15c')});db[_0x9788('0x42')]['hasMany'](db[_0x9788('0x44')],{'as':_0x9788('0x13e'),'foreignKey':_0x9788('0x16c'),'onDelete':_0x9788('0x106')});db['FaxAccount'][_0x9788('0x109')](db[_0x9788('0x16')],{'as':_0x9788('0x16d'),'onDelete':_0x9788('0x106')});db[_0x9788('0x42')][_0x9788('0x109')](db[_0x9788('0x48')],{'as':_0x9788('0x14d')});db[_0x9788('0x42')][_0x9788('0x11b')](db['Trunk'],{'as':_0x9788('0x144')});db[_0x9788('0x42')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':'ListId'});db[_0x9788('0x42')][_0x9788('0x11b')](db[_0x9788('0x81')],{'as':_0x9788('0x148'),'foreignKey':_0x9788('0x149')});db['FaxAccount'][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x134')});db['FaxApplication'][_0x9788('0x11b')](db[_0x9788('0x13')],{'onDelete':_0x9788('0x158')});db['FaxApplication'][_0x9788('0x11b')](db[_0x9788('0x4a')],{'onDelete':_0x9788('0x158')});db[_0x9788('0x44')][_0x9788('0x11b')](db[_0x9788('0x42')],{'onDelete':_0x9788('0x158')});db[_0x9788('0x44')][_0x9788('0x11b')](db[_0x9788('0x161')],{'onDelete':_0x9788('0x158'),'foreignKey':_0x9788('0x16e')});db[_0x9788('0x46')][_0x9788('0x109')](db['FaxMessage'],{'as':_0x9788('0x14d'),'onDelete':'cascade','foreignKey':_0x9788('0x16f')});db['FaxInteraction']['belongsTo'](db[_0x9788('0x42')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x16c')});db[_0x9788('0x46')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x46')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x160'),'foreignKey':'UserId'});db['FaxInteraction'][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x170'),'as':_0x9788('0x162')});db[_0x9788('0x46')][_0x9788('0x11c')](db['Tag'],{'through':_0x9788('0x170'),'as':_0x9788('0x171')});db[_0x9788('0x46')]['belongsToMany'](db[_0x9788('0x13')],{'as':_0x9788('0x164'),'through':_0x9788('0x123'),'foreignKey':_0x9788('0x16f')});db[_0x9788('0x48')][_0x9788('0x11b')](db[_0x9788('0x13')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x13')});db[_0x9788('0x48')][_0x9788('0x11b')](db[_0x9788('0x46')],{'as':_0x9788('0x166'),'foreignKey':_0x9788('0x16f')});db[_0x9788('0x48')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'onDelete':'cascade','as':_0x9788('0x153')});db[_0x9788('0x48')][_0x9788('0x11b')](db[_0x9788('0x165')],{'as':_0x9788('0x165'),'foreignKey':_0x9788('0x172')});db[_0x9788('0x48')][_0x9788('0x11b')](db[_0x9788('0x42')],{'as':'Account','foreignKey':_0x9788('0x16c')});db[_0x9788('0x4a')]['belongsToMany'](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x2d')});db[_0x9788('0x4a')][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':_0x9788('0x173'),'as':_0x9788('0x14b')});db['FaxQueueReport'][_0x9788('0x11b')](db[_0x9788('0x42')],{});db[_0x9788('0x4c')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db['FaxQueueReport'][_0x9788('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0x9788('0x154')});db[_0x9788('0x4c')][_0x9788('0x11b')](db[_0x9788('0x46')],{});db[_0x9788('0x4c')][_0x9788('0x11b')](db[_0x9788('0x48')],{});db[_0x9788('0x4c')][_0x9788('0x11b')](db[_0x9788('0x13')],{});db[_0x9788('0x4c')][_0x9788('0x11b')](db[_0x9788('0x4a')],{});db[_0x9788('0x4e')][_0x9788('0x109')](db[_0x9788('0x7d')],{'as':'Dispositions','foreignKey':_0x9788('0x174'),'onDelete':_0x9788('0x106')});db['SmsAccount']['hasMany'](db[_0x9788('0x7c')],{'as':_0x9788('0x16b'),'foreignKey':_0x9788('0x174')});db['SmsAccount'][_0x9788('0x109')](db[_0x9788('0x54')],{'as':_0x9788('0x14d'),'foreignKey':_0x9788('0x174')});db['SmsAccount'][_0x9788('0x109')](db[_0x9788('0x52')],{'as':'Interactions'});db['SmsAccount'][_0x9788('0x109')](db[_0x9788('0x50')],{'as':_0x9788('0x13e'),'foreignKey':_0x9788('0x174'),'onDelete':_0x9788('0x106')});db[_0x9788('0x4e')]['belongsTo'](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db['SmsAccount'][_0x9788('0x11b')](db['Pause'],{'as':_0x9788('0x148'),'foreignKey':_0x9788('0x149')});db['SmsAccount'][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x139')});db[_0x9788('0x50')]['belongsTo'](db[_0x9788('0x13')],{'onDelete':_0x9788('0x158')});db['SmsApplication']['belongsTo'](db[_0x9788('0x55')],{'onDelete':_0x9788('0x158')});db[_0x9788('0x50')][_0x9788('0x11b')](db[_0x9788('0x4e')],{'onDelete':'restrict'});db[_0x9788('0x50')]['belongsTo'](db[_0x9788('0x146')],{'onDelete':_0x9788('0x158'),'foreignKey':_0x9788('0x147')});db[_0x9788('0x50')][_0x9788('0x11b')](db[_0x9788('0x161')],{'onDelete':_0x9788('0x158'),'foreignKey':_0x9788('0x16e')});db[_0x9788('0x52')][_0x9788('0x109')](db[_0x9788('0x54')],{'as':_0x9788('0x14d'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x9788('0x52')]['belongsTo'](db[_0x9788('0x4e')],{'as':_0x9788('0x15f'),'foreignKey':'SmsAccountId'});db[_0x9788('0x52')]['belongsTo'](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x52')][_0x9788('0x11b')](db['User'],{'as':_0x9788('0x160'),'foreignKey':'UserId'});db['SmsInteraction'][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x175'),'as':_0x9788('0x162')});db[_0x9788('0x52')][_0x9788('0x11c')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x9788('0x52')][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x164'),'through':_0x9788('0x124'),'foreignKey':'SmsInteractionId'});db['SmsMessage']['belongsTo'](db[_0x9788('0x13')],{'as':_0x9788('0x13')});db[_0x9788('0x54')]['belongsTo'](db[_0x9788('0x6e')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x153')});db[_0x9788('0x54')]['belongsTo'](db[_0x9788('0x52')],{'onDelete':'cascade','as':_0x9788('0x166'),'foreignKey':_0x9788('0x176')});db[_0x9788('0x54')]['belongsTo'](db[_0x9788('0x4e')],{'as':_0x9788('0x15f'),'foreignKey':'SmsAccountId'});db[_0x9788('0x55')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':'UserSmsQueue','foreignKey':_0x9788('0x177')});db[_0x9788('0x55')][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':_0x9788('0x178'),'as':_0x9788('0x14b')});db[_0x9788('0x57')][_0x9788('0x109')](db[_0x9788('0x7d')],{'as':'Dispositions','foreignKey':_0x9788('0x179'),'onDelete':_0x9788('0x106')});db['OpenchannelAccount'][_0x9788('0x109')](db['CannedAnswer'],{'as':_0x9788('0x16b'),'foreignKey':_0x9788('0x179')});db[_0x9788('0x57')][_0x9788('0x109')](db[_0x9788('0x10f')],{'as':_0x9788('0x15c'),'foreignKey':_0x9788('0x179')});db[_0x9788('0x57')][_0x9788('0x109')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x9788('0x57')][_0x9788('0x109')](db[_0x9788('0x58')],{'as':'Applications','foreignKey':_0x9788('0x179'),'onDelete':_0x9788('0x106')});db[_0x9788('0x57')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x9788('0x11b')](db[_0x9788('0x81')],{'as':_0x9788('0x148'),'foreignKey':_0x9788('0x149')});db[_0x9788('0x57')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x137')});db[_0x9788('0x58')][_0x9788('0x11b')](db[_0x9788('0x13')],{'onDelete':'restrict'});db[_0x9788('0x58')][_0x9788('0x11b')](db[_0x9788('0x5d')],{'onDelete':_0x9788('0x158'),'foreignKey':_0x9788('0x17a')});db[_0x9788('0x58')][_0x9788('0x11b')](db[_0x9788('0x57')],{'onDelete':'restrict','foreignKey':_0x9788('0x179')});db['OpenchannelApplication'][_0x9788('0x11b')](db[_0x9788('0x146')],{'onDelete':'restrict','foreignKey':_0x9788('0x147')});db[_0x9788('0x58')][_0x9788('0x11b')](db[_0x9788('0x161')],{'onDelete':_0x9788('0x158'),'foreignKey':'TagId'});db[_0x9788('0x10f')][_0x9788('0x109')](db['OpenchannelMessage'],{'as':_0x9788('0x14d'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x17b')});db[_0x9788('0x10f')][_0x9788('0x11b')](db[_0x9788('0x57')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x179')});db[_0x9788('0x10f')]['belongsTo'](db['CmContact'],{'as':_0x9788('0x153'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0x9788('0x10f')][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':'openchannel_interaction_has_tags','as':_0x9788('0x162')});db['OpenchannelInteraction'][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x17c'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x164'),'through':_0x9788('0x125'),'foreignKey':'OpenchannelInteractionId'});db[_0x9788('0x5b')][_0x9788('0x11b')](db[_0x9788('0x13')],{'onDelete':'cascade','as':'User'});db[_0x9788('0x5b')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'onDelete':_0x9788('0x106'),'as':'Contact'});db[_0x9788('0x5b')][_0x9788('0x11b')](db[_0x9788('0x10f')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x166'),'foreignKey':'OpenchannelInteractionId'});db[_0x9788('0x5b')]['belongsTo'](db[_0x9788('0x165')],{'as':_0x9788('0x165'),'foreignKey':'AttachmentId'});db[_0x9788('0x5b')][_0x9788('0x11b')](db[_0x9788('0x57')],{'as':'Account','foreignKey':_0x9788('0x179')});db['OpenchannelQueue'][_0x9788('0x11c')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x9788('0x17a')});db[_0x9788('0x5d')][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':_0x9788('0x17d'),'as':_0x9788('0x14b')});db[_0x9788('0x167')]['hasMany'](db[_0x9788('0x7d')],{'as':_0x9788('0x15b'),'foreignKey':_0x9788('0x17e'),'onDelete':_0x9788('0x106')});db[_0x9788('0x167')][_0x9788('0x109')](db['CannedAnswer'],{'as':_0x9788('0x16b'),'foreignKey':_0x9788('0x17e')});db[_0x9788('0x167')][_0x9788('0x109')](db[_0x9788('0x6c')],{'as':_0x9788('0x17f')});db[_0x9788('0x167')]['hasMany'](db[_0x9788('0x111')],{'as':_0x9788('0x15c')});db[_0x9788('0x167')]['hasMany'](db['ChatApplication'],{'as':'Applications','foreignKey':_0x9788('0x17e'),'onDelete':_0x9788('0x106')});db['ChatWebsite'][_0x9788('0x109')](db[_0x9788('0x180')],{'as':_0x9788('0x14d')});db[_0x9788('0x167')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db[_0x9788('0x167')]['belongsTo'](db[_0x9788('0x146')],{'as':_0x9788('0x146'),'foreignKey':_0x9788('0x147')});db[_0x9788('0x167')][_0x9788('0x11b')](db['MailAccount'],{'as':_0x9788('0x37'),'foreignKey':_0x9788('0x155')});db['ChatWebsite'][_0x9788('0x11b')](db['Pause'],{'as':_0x9788('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite']['belongsToMany'](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':'user_has_chat_websites'});db[_0x9788('0x60')][_0x9788('0x11b')](db[_0x9788('0x57')],{});db[_0x9788('0x60')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':'ListId'});db[_0x9788('0x60')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x60')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x9788('0x60')][_0x9788('0x11b')](db[_0x9788('0x5b')],{});db[_0x9788('0x60')]['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0x9788('0x11b')](db[_0x9788('0x5d')],{});db['ChatApplication']['belongsTo'](db[_0x9788('0x13')],{'as':_0x9788('0x181'),'foreignKey':_0x9788('0x107'),'onDelete':'restrict'});db[_0x9788('0x62')][_0x9788('0x11b')](db[_0x9788('0x68')],{'as':_0x9788('0x182'),'foreignKey':_0x9788('0x183'),'onDelete':_0x9788('0x158')});db[_0x9788('0x62')][_0x9788('0x11b')](db[_0x9788('0x167')],{'as':_0x9788('0x184'),'foreignKey':_0x9788('0x17e'),'onDelete':_0x9788('0x158')});db[_0x9788('0x62')]['belongsTo'](db[_0x9788('0x161')],{'onDelete':'restrict','foreignKey':_0x9788('0x16e')});db['ChatInteraction'][_0x9788('0x109')](db[_0x9788('0x180')],{'as':_0x9788('0x14d'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x185')});db[_0x9788('0x111')][_0x9788('0x11b')](db[_0x9788('0x167')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x17e')});db[_0x9788('0x111')]['belongsTo'](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x111')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x160'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x111')][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x186'),'as':_0x9788('0x162')});db[_0x9788('0x111')]['belongsToMany'](db[_0x9788('0x161')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x9788('0x111')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x164'),'through':_0x9788('0x122'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x9788('0x11b')](db['User'],{'onDelete':_0x9788('0x106'),'as':'User'});db[_0x9788('0x180')]['belongsTo'](db[_0x9788('0x6e')],{'onDelete':_0x9788('0x106'),'as':'Contact','foreignKey':_0x9788('0x154')});db['ChatMessage'][_0x9788('0x11b')](db[_0x9788('0x111')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x166'),'foreignKey':'ChatInteractionId'});db[_0x9788('0x180')][_0x9788('0x11b')](db['Attachment'],{'as':_0x9788('0x165'),'foreignKey':_0x9788('0x172')});db['ChatMessage']['belongsTo'](db[_0x9788('0x167')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x17e')});db['ChatOfflineMessage'][_0x9788('0x109')](db[_0x9788('0x165')],{'as':_0x9788('0x187'),'foreignKey':_0x9788('0x168'),'onDelete':_0x9788('0x106'),'hooks':!![]});db['ChatOfflineMessage'][_0x9788('0x11b')](db[_0x9788('0x6e')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x66')][_0x9788('0x11b')](db[_0x9788('0x167')],{'as':_0x9788('0x15f'),'foreignKey':'ChatWebsiteId'});db[_0x9788('0x68')]['belongsToMany'](db[_0x9788('0x13')],{'as':'Agents','through':_0x9788('0x2b'),'hooks':!![]});db[_0x9788('0x68')][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':_0x9788('0x188'),'as':_0x9788('0x14b')});db[_0x9788('0x6a')][_0x9788('0x109')](db[_0x9788('0xcc')],{'as':_0x9788('0x14d'),'foreignKey':'ChatGroupId','onDelete':_0x9788('0x106')});db[_0x9788('0x6a')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':'Members','through':'chat_group_has_users'});db[_0x9788('0x6c')][_0x9788('0x11b')](db[_0x9788('0x167')],{'as':_0x9788('0x184'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x9788('0x6e')],{'as':_0x9788('0x11e'),'foreignKey':_0x9788('0x189')});db[_0x9788('0x6e')][_0x9788('0x109')](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x9788('0x18a')});db[_0x9788('0x6e')]['hasMany'](db['CmHopper'],{'as':_0x9788('0x140'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x6e')][_0x9788('0x109')](db['CmHopperFinal'],{'as':_0x9788('0x10d'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x6e')]['hasMany'](db[_0x9788('0x75')],{'as':_0x9788('0x18b'),'foreignKey':_0x9788('0x154')});db[_0x9788('0x6e')][_0x9788('0x109')](db[_0x9788('0x76')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db['CmContact'][_0x9788('0x109')](db[_0x9788('0xd0')],{'as':_0x9788('0x143'),'foreignKey':'ContactId'});db[_0x9788('0x6e')][_0x9788('0x109')](db[_0x9788('0x10f')],{'as':_0x9788('0x110'),'foreignKey':'ContactId','onDelete':_0x9788('0x158')});db[_0x9788('0x6e')]['hasMany'](db[_0x9788('0x111')],{'as':'ChatInteractions','foreignKey':_0x9788('0x154'),'onDelete':_0x9788('0x158')});db[_0x9788('0x6e')]['hasMany'](db[_0x9788('0x52')],{'as':_0x9788('0x113'),'foreignKey':_0x9788('0x154'),'onDelete':'restrict'});db[_0x9788('0x6e')][_0x9788('0x109')](db[_0x9788('0x46')],{'as':_0x9788('0x114'),'foreignKey':'ContactId','onDelete':_0x9788('0x158')});db[_0x9788('0x6e')][_0x9788('0x109')](db[_0x9788('0x3a')],{'as':'MailInteractions','foreignKey':_0x9788('0x154'),'onDelete':'restrict'});db[_0x9788('0x6e')][_0x9788('0x11b')](db[_0x9788('0x18c')],{'as':_0x9788('0x18d'),'foreignKey':_0x9788('0x189')});db[_0x9788('0x6e')]['belongsTo'](db[_0x9788('0x11f')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x9788('0x6e')][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x164'),'through':_0x9788('0x18e')});db['CmContact']['belongsToMany'](db[_0x9788('0x161')],{'as':_0x9788('0x162'),'through':_0x9788('0x18f')});db[_0x9788('0x6e')][_0x9788('0x11c')](db['Tag'],{'through':'cm_contact_has_tags','as':_0x9788('0x171')});db[_0x9788('0x119')][_0x9788('0x109')](db[_0x9788('0x8e')],{'as':_0x9788('0x190'),'foreignKey':_0x9788('0x191')});db[_0x9788('0x119')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':'ListId','onDelete':_0x9788('0x106')});db[_0x9788('0x119')][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x181'),'foreignKey':_0x9788('0x107')});db[_0x9788('0x119')]['belongsTo'](db[_0x9788('0x127')],{'as':_0x9788('0x182'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0x9788('0x11b')](db[_0x9788('0x192')],{'as':_0x9788('0x192'),'foreignKey':_0x9788('0x193'),'onDelete':'cascade'});db['CmHopper'][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':'Owner','foreignKey':_0x9788('0x194')});db[_0x9788('0x71')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154'),'onDelete':_0x9788('0x106')});db[_0x9788('0x71')]['belongsTo'](db['CmList'],{'as':_0x9788('0x15d'),'foreignKey':'ListId','onDelete':_0x9788('0x106')});db[_0x9788('0x71')][_0x9788('0x11b')](db[_0x9788('0x127')],{'as':_0x9788('0x182'),'foreignKey':_0x9788('0x141'),'onDelete':_0x9788('0x106')});db[_0x9788('0x71')][_0x9788('0x11b')](db['Campaign'],{'as':_0x9788('0x192'),'foreignKey':_0x9788('0x193'),'onDelete':'cascade'});db[_0x9788('0x7a')]['hasMany'](db[_0x9788('0x7f')],{'as':{'plural':_0x9788('0x195'),'singular':_0x9788('0x196')},'foreignKey':_0x9788('0x197'),'onDelete':_0x9788('0x106'),'hooks':!![]});db[_0x9788('0x7a')][_0x9788('0x109')](db[_0x9788('0x7f')],{'as':{'plural':'Any','singular':_0x9788('0x198')},'foreignKey':_0x9788('0x199'),'onDelete':_0x9788('0x106'),'hooks':!![]});db['Automation']['hasMany'](db[_0x9788('0x19a')],{'as':_0x9788('0x19b'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db[_0x9788('0x7d')],{'as':'Dispositions','foreignKey':_0x9788('0x19c'),'onDelete':_0x9788('0x106')});db['Interval'][_0x9788('0x109')](db[_0x9788('0x146')],{'as':_0x9788('0x19d'),'foreignKey':_0x9788('0x147'),'onDelete':_0x9788('0x106'),'hooks':!![],'required':![]});db[_0x9788('0x146')][_0x9788('0x109')](db[_0x9788('0x16')],{'as':_0x9788('0x10c'),'foreignKey':'IntervalId','onDelete':_0x9788('0x158')});db[_0x9788('0x146')][_0x9788('0x109')](db[_0x9788('0x3d')],{'as':'MailApplications','foreignKey':_0x9788('0x147')});db[_0x9788('0x146')][_0x9788('0x109')](db[_0x9788('0x62')],{'as':_0x9788('0x19e'),'foreignKey':_0x9788('0x147')});db[_0x9788('0x146')][_0x9788('0x109')](db[_0x9788('0x44')],{'as':_0x9788('0x19f'),'foreignKey':'IntervalId'});db[_0x9788('0x146')]['hasMany'](db[_0x9788('0x50')],{'as':_0x9788('0x1a0'),'foreignKey':'IntervalId'});db[_0x9788('0x86')][_0x9788('0x11b')](db[_0x9788('0x37')],{});db['Schedule'][_0x9788('0x11b')](db[_0x9788('0x97')],{'foreignKey':_0x9788('0x1a1')});db[_0x9788('0x86')][_0x9788('0x11b')](db[_0x9788('0x1a2')],{'foreignKey':'CustomReportId'});db[_0x9788('0x87')][_0x9788('0x11c')](db[_0x9788('0x18')],{'as':_0x9788('0x1a3'),'through':_0x9788('0x13f'),'onDelete':'restrict'});db[_0x9788('0x161')][_0x9788('0x11c')](db[_0x9788('0x6e')],{'through':_0x9788('0x18f')});db[_0x9788('0x161')]['belongsToMany'](db[_0x9788('0x111')],{'through':_0x9788('0x186')});db['Tag']['belongsToMany'](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x9788('0x161')][_0x9788('0x11c')](db[_0x9788('0x52')],{'through':_0x9788('0x175')});db[_0x9788('0x161')]['belongsToMany'](db['FaxInteraction'],{'through':_0x9788('0x170')});db[_0x9788('0x161')]['belongsToMany'](db[_0x9788('0x10f')],{'through':_0x9788('0x17c')});db['Tag'][_0x9788('0x11c')](db[_0x9788('0xf4')],{'through':_0x9788('0x1a4')});db[_0x9788('0x8c')]['belongsTo'](db['ContactItemType'],{'as':_0x9788('0x1a5'),'foreignKey':_0x9788('0x1a6')});db['CmHopperAdditionalPhone']['belongsTo'](db[_0x9788('0x119')],{'as':_0x9788('0x1a7'),'foreignKey':_0x9788('0x191')});db[_0x9788('0x8c')][_0x9788('0x11b')](db['CmContact'],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x18a')});db[_0x9788('0x91')][_0x9788('0x109')](db['Condition'],{'as':{'plural':_0x9788('0x1a8'),'singular':_0x9788('0x1a9')},'foreignKey':_0x9788('0x1aa'),'onDelete':_0x9788('0x106'),'hooks':!![]});db[_0x9788('0x91')][_0x9788('0x109')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x9788('0x1ab'),'onDelete':_0x9788('0x106'),'hooks':!![]});db['Trigger'][_0x9788('0x109')](db['Action'],{'as':_0x9788('0x19b'),'foreignKey':'TriggerId','onDelete':_0x9788('0x106'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x9788('0x1ac')],{'as':_0x9788('0x1ad'),'onDelete':'cascade','foreignKey':_0x9788('0x1ae'),'hooks':!![]});db[_0x9788('0x97')][_0x9788('0x109')](db[_0x9788('0x1ac')],{'as':'Fields','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1a1')});db[_0x9788('0x1af')][_0x9788('0x109')](db[_0x9788('0x1ac')],{'as':_0x9788('0x1ad'),'onDelete':_0x9788('0x106'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x9788('0x11b')](db[_0x9788('0x1af')],{'foreignKey':_0x9788('0x1b0')});db['SalesforceAccount']['hasMany'](db[_0x9788('0x9e')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0x9e')][_0x9788('0x109')](db['SalesforceField'],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':'SubjectId'});db['SalesforceConfiguration']['hasMany'](db[_0x9788('0x9f')],{'as':'Descriptions','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0x9e')][_0x9788('0x109')](db[_0x9788('0x9f')],{'as':'Fields','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0x9e')][_0x9788('0x11b')](db[_0x9788('0x1b6')],{'as':_0x9788('0x15f'),'foreignKey':'AccountId'});db['SalesforceField'][_0x9788('0x109')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x9788('0x1b7')});db[_0x9788('0x9f')]['hasMany'](db[_0x9788('0x9f')],{'as':_0x9788('0x1b8'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x9788('0x109')](db[_0x9788('0x9f')],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0x9f')][_0x9788('0x11b')](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db['SugarcrmAccount'][_0x9788('0x109')](db[_0x9788('0x1bb')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0x1bb')]['hasMany'](db['SugarcrmField'],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b7')});db['SugarcrmConfiguration'][_0x9788('0x109')](db[_0x9788('0x1bc')],{'as':_0x9788('0x1bd'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0x1bb')][_0x9788('0x109')](db[_0x9788('0x1bc')],{'as':_0x9788('0x1ad'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0x1bb')][_0x9788('0x11b')](db[_0x9788('0xa0')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db['SugarcrmField'][_0x9788('0x109')](db['SugarcrmField'],{'as':_0x9788('0x1be'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0x1bc')][_0x9788('0x109')](db[_0x9788('0x1bc')],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db['SugarcrmField']['hasMany'](db[_0x9788('0x1bc')],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db['SugarcrmField'][_0x9788('0x11b')](db['Variable'],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db[_0x9788('0x1bf')]['hasMany'](db[_0x9788('0xa4')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0xa4')][_0x9788('0x109')](db['DeskField'],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xa4')][_0x9788('0x109')](db[_0x9788('0xa5')],{'as':'Descriptions','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xa4')][_0x9788('0x109')](db[_0x9788('0xa5')],{'as':_0x9788('0x1ad'),'onDelete':_0x9788('0x106'),'foreignKey':'FieldId'});db[_0x9788('0xa4')][_0x9788('0x11b')](db[_0x9788('0x1bf')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0xa4')][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x1c0')});db[_0x9788('0xa5')][_0x9788('0x109')](db[_0x9788('0xa5')],{'as':_0x9788('0x1be'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xa5')][_0x9788('0x109')](db[_0x9788('0xa5')],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xa5')]['hasMany'](db[_0x9788('0xa5')],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0xa5')][_0x9788('0x11b')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount'][_0x9788('0x109')](db['ZohoConfiguration'],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0xa8')][_0x9788('0x109')](db['ZohoField'],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':'SubjectId'});db[_0x9788('0xa8')][_0x9788('0x109')](db[_0x9788('0xaa')],{'as':_0x9788('0x1bd'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xa8')]['hasMany'](db[_0x9788('0xaa')],{'as':'Fields','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b5')});db['ZohoConfiguration'][_0x9788('0x11b')](db['ZohoAccount'],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db['ZohoField'][_0x9788('0x109')](db[_0x9788('0xaa')],{'as':_0x9788('0x1be'),'foreignKey':_0x9788('0x1b7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x9788('0x1b8'),'foreignKey':'DescriptionId'});db[_0x9788('0xaa')][_0x9788('0x109')](db[_0x9788('0xaa')],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0xaa')][_0x9788('0x11b')](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db[_0x9788('0xac')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':'AccountId'});db[_0x9788('0xae')][_0x9788('0x109')](db[_0x9788('0xb0')],{'as':_0x9788('0x1b3'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xae')][_0x9788('0x109')](db[_0x9788('0xb0')],{'as':_0x9788('0x1bd'),'foreignKey':_0x9788('0x1b4')});db['ZendeskConfiguration']['hasMany'](db[_0x9788('0xb0')],{'as':_0x9788('0x1ad'),'foreignKey':_0x9788('0x1b5')});db['ZendeskConfiguration'][_0x9788('0x11b')](db[_0x9788('0xac')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0xae')]['belongsToMany'](db[_0x9788('0x161')],{'through':_0x9788('0x1c1')});db[_0x9788('0xb0')][_0x9788('0x109')](db[_0x9788('0xb0')],{'as':_0x9788('0x1be'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xb0')][_0x9788('0x109')](db[_0x9788('0xb0')],{'as':_0x9788('0x1b8'),'foreignKey':'DescriptionId'});db[_0x9788('0xb0')]['hasMany'](db['ZendeskField'],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0xb0')][_0x9788('0x11b')](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db[_0x9788('0xb2')][_0x9788('0x109')](db['FreshdeskConfiguration'],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x9788('0x109')](db['FreshdeskField'],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xb4')][_0x9788('0x109')](db[_0x9788('0xb5')],{'as':_0x9788('0x1bd'),'onDelete':_0x9788('0x106'),'foreignKey':'DescriptionId'});db[_0x9788('0xb4')][_0x9788('0x109')](db[_0x9788('0xb5')],{'as':_0x9788('0x1ad'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0xb4')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x9788('0xb4')][_0x9788('0x11c')](db[_0x9788('0x161')],{'through':_0x9788('0x1c2')});db['FreshdeskField'][_0x9788('0x109')](db[_0x9788('0xb5')],{'as':_0x9788('0x1be'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xb5')][_0x9788('0x109')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x9788('0xb5')],{'as':_0x9788('0x1b9'),'foreignKey':'FieldId'});db[_0x9788('0xb5')][_0x9788('0x11b')](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db[_0x9788('0xb7')]['hasMany'](db[_0x9788('0xb9')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db['VtigerConfiguration'][_0x9788('0x109')](db[_0x9788('0xba')],{'as':_0x9788('0x1b3'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xb9')][_0x9788('0x109')](db[_0x9788('0xba')],{'as':_0x9788('0x1bd'),'foreignKey':_0x9788('0x1b4')});db['VtigerConfiguration'][_0x9788('0x109')](db['VtigerField'],{'as':'Fields','foreignKey':_0x9788('0x1b5')});db[_0x9788('0xb9')][_0x9788('0x11b')](db['VtigerAccount'],{'as':_0x9788('0x15f'),'foreignKey':'AccountId'});db[_0x9788('0xba')]['hasMany'](db[_0x9788('0xba')],{'as':'Subject','foreignKey':_0x9788('0x1b7')});db[_0x9788('0xba')][_0x9788('0x109')](db[_0x9788('0xba')],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xba')][_0x9788('0x109')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x9788('0xba')][_0x9788('0x11b')](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':'VariableId'});db[_0x9788('0xbb')][_0x9788('0x109')](db[_0x9788('0xbd')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0xbd')][_0x9788('0x109')](db[_0x9788('0xbf')],{'as':_0x9788('0x1b3'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0xbd')][_0x9788('0x109')](db[_0x9788('0xbf')],{'as':_0x9788('0x1bd'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xbd')][_0x9788('0x109')](db['ServicenowField'],{'as':_0x9788('0x1ad'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0x9788('0xbb')],{'as':_0x9788('0x15f'),'foreignKey':'AccountId'});db[_0x9788('0xbf')][_0x9788('0x109')](db[_0x9788('0xbf')],{'as':_0x9788('0x1be'),'foreignKey':'SubjectId'});db[_0x9788('0xbf')][_0x9788('0x109')](db[_0x9788('0xbf')],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xbf')][_0x9788('0x109')](db['ServicenowField'],{'as':_0x9788('0x1b9'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0xbf')]['belongsTo'](db[_0x9788('0x93')],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db['Dynamics365Account'][_0x9788('0x109')](db[_0x9788('0xc1')],{'as':'Configurations','onDelete':_0x9788('0x106'),'foreignKey':'AccountId'});db[_0x9788('0x1c3')][_0x9788('0x11b')](db['CloudProvider'],{'as':_0x9788('0x156'),'foreignKey':_0x9788('0x157')});db['Dynamics365Configuration']['hasMany'](db[_0x9788('0xc3')],{'as':_0x9788('0x1b3'),'onDelete':_0x9788('0x106'),'foreignKey':'SubjectId'});db[_0x9788('0xc1')]['hasMany'](db[_0x9788('0xc3')],{'as':_0x9788('0x1bd'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xc1')]['hasMany'](db[_0x9788('0xc3')],{'as':_0x9788('0x1ad'),'onDelete':_0x9788('0x106'),'foreignKey':'FieldId'});db[_0x9788('0xc1')][_0x9788('0x11b')](db['Dynamics365Account'],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db['Dynamics365Field'][_0x9788('0x109')](db[_0x9788('0xc3')],{'as':_0x9788('0x1be'),'foreignKey':'SubjectId'});db[_0x9788('0xc3')]['hasMany'](db[_0x9788('0xc3')],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db[_0x9788('0xc3')]['hasMany'](db[_0x9788('0xc3')],{'as':_0x9788('0x1b9'),'foreignKey':'FieldId'});db[_0x9788('0xc3')][_0x9788('0x11b')](db['Variable'],{'as':_0x9788('0x93'),'foreignKey':_0x9788('0x1ba')});db['FreshsalesAccount'][_0x9788('0x109')](db[_0x9788('0x1c4')],{'as':_0x9788('0x1b1'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0x1c4')][_0x9788('0x109')](db[_0x9788('0x1c5')],{'as':_0x9788('0x1b3'),'foreignKey':_0x9788('0x1b7')});db[_0x9788('0x1c4')]['hasMany'](db[_0x9788('0x1c5')],{'as':_0x9788('0x1bd'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db[_0x9788('0x1c5')],{'as':_0x9788('0x1ad'),'foreignKey':_0x9788('0x1b5')});db[_0x9788('0x1c4')][_0x9788('0x11b')](db[_0x9788('0xc4')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1b2')});db[_0x9788('0x1c5')][_0x9788('0x109')](db[_0x9788('0x1c5')],{'as':_0x9788('0x1be'),'foreignKey':'SubjectId'});db[_0x9788('0x1c5')][_0x9788('0x109')](db['FreshsalesField'],{'as':_0x9788('0x1b8'),'foreignKey':_0x9788('0x1b4')});db['FreshsalesField'][_0x9788('0x109')](db[_0x9788('0x1c5')],{'as':_0x9788('0x1b9'),'foreignKey':'FieldId'});db[_0x9788('0x1c5')]['belongsTo'](db[_0x9788('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9788('0xca')][_0x9788('0x11b')](db[_0x9788('0x167')],{});db[_0x9788('0xca')][_0x9788('0x11b')](db['CmList'],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db['ChatQueueReport'][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0xca')]['belongsTo'](db[_0x9788('0x111')],{});db[_0x9788('0xca')]['belongsTo'](db[_0x9788('0x180')],{});db['ChatQueueReport'][_0x9788('0x11b')](db[_0x9788('0x13')],{});db[_0x9788('0xca')]['belongsTo'](db[_0x9788('0x68')],{});db['ChatInternalMessage']['belongsTo'](db[_0x9788('0x13')],{'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1c6')});db[_0x9788('0xcc')][_0x9788('0x11b')](db[_0x9788('0x13')],{'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1c7')});db[_0x9788('0xd0')][_0x9788('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x9788('0x1c8'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x9788('0x109')](db[_0x9788('0x1c9')],{'foreignKey':_0x9788('0x1c8'),'onDelete':_0x9788('0x106')});db[_0x9788('0xd1')]['belongsTo'](db['SmsAccount'],{});db[_0x9788('0xd1')][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db[_0x9788('0xd1')][_0x9788('0x11b')](db['CmContact'],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0xd1')][_0x9788('0x11b')](db[_0x9788('0x52')],{});db['SmsQueueReport'][_0x9788('0x11b')](db[_0x9788('0x54')],{});db[_0x9788('0xd1')][_0x9788('0x11b')](db[_0x9788('0x13')],{});db['SmsQueueReport'][_0x9788('0x11b')](db[_0x9788('0x55')],{});db['JscriptyProject'][_0x9788('0x109')](db[_0x9788('0xd0')],{'foreignKey':_0x9788('0x1ca')});db[_0x9788('0xd7')][_0x9788('0x109')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x9788('0xd7')][_0x9788('0x109')](db['JscriptyAnswerReport'],{'foreignKey':_0x9788('0x1ca')});db[_0x9788('0xdf')][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x14a'),'through':_0x9788('0x120')});db[_0x9788('0xdf')]['belongsToMany'](db[_0x9788('0x127')],{'through':_0x9788('0xfb'),'as':_0x9788('0x1cb')});db['Team']['belongsToMany'](db[_0x9788('0x39')],{'through':_0x9788('0x1cc'),'as':'MailQueues'});db[_0x9788('0xdf')][_0x9788('0x11c')](db[_0x9788('0x68')],{'through':_0x9788('0x188'),'as':_0x9788('0x12b')});db[_0x9788('0xdf')][_0x9788('0x11c')](db['FaxQueue'],{'through':_0x9788('0x173'),'as':_0x9788('0x12c')});db[_0x9788('0xdf')][_0x9788('0x11c')](db[_0x9788('0x55')],{'through':_0x9788('0x178'),'as':_0x9788('0x12d')});db[_0x9788('0xdf')][_0x9788('0x11c')](db[_0x9788('0x5d')],{'through':_0x9788('0x17d'),'as':'OpenchannelQueues'});db[_0x9788('0xdf')][_0x9788('0x11c')](db[_0x9788('0xf9')],{'through':_0x9788('0x1cd'),'as':_0x9788('0x12e')});db[_0x9788('0xdf')][_0x9788('0x11c')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x9788('0x129')});db[_0x9788('0x192')][_0x9788('0x109')](db[_0x9788('0x119')],{'as':_0x9788('0x140'),'foreignKey':_0x9788('0x193')});db[_0x9788('0x192')][_0x9788('0x109')](db[_0x9788('0x73')],{'as':_0x9788('0x10d'),'foreignKey':_0x9788('0x193')});db[_0x9788('0x192')][_0x9788('0x109')](db[_0x9788('0x75')],{'as':_0x9788('0x18b'),'foreignKey':_0x9788('0x193')});db[_0x9788('0x192')][_0x9788('0x109')](db[_0x9788('0x71')],{'as':_0x9788('0x142'),'foreignKey':_0x9788('0x193')});db[_0x9788('0x192')][_0x9788('0x11b')](db['Trunk'],{'as':_0x9788('0x144'),'foreignKey':_0x9788('0x145')});db[_0x9788('0x192')][_0x9788('0x11b')](db['Trunk'],{'as':_0x9788('0x1ce'),'foreignKey':_0x9788('0x1cf')});db[_0x9788('0x192')][_0x9788('0x11b')](db[_0x9788('0x146')],{'as':_0x9788('0x146'),'foreignKey':_0x9788('0x147')});db[_0x9788('0x192')][_0x9788('0x11b')](db[_0x9788('0xda')],{'as':_0x9788('0xda'),'foreignKey':_0x9788('0x1d0')});db['Campaign']['belongsToMany'](db[_0x9788('0x11f')],{'as':_0x9788('0x1d1'),'through':_0x9788('0x1d2')});db[_0x9788('0x192')][_0x9788('0x11c')](db['CmList'],{'as':_0x9788('0x1d3'),'through':_0x9788('0x1d4')});db[_0x9788('0x165')]['belongsTo'](db[_0x9788('0x66')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x9788('0x1d5')]['belongsTo'](db[_0x9788('0x3c')],{});db[_0x9788('0x1d5')][_0x9788('0x11b')](db[_0x9788('0x3a')],{});db[_0x9788('0x1d5')]['belongsTo'](db[_0x9788('0x37')],{'foreignKey':'FromMailAccountId','as':_0x9788('0x1d6')});db[_0x9788('0x1d5')][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':_0x9788('0x1d7'),'as':'FromAgent'});db['MailTransferReport'][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':'ToUserId','as':_0x9788('0x1d8')});db['MailTransferReport'][_0x9788('0x11b')](db[_0x9788('0x39')],{'foreignKey':_0x9788('0x1d9'),'as':_0x9788('0x1da')});db[_0x9788('0x1d5')]['belongsTo'](db[_0x9788('0x37')],{'foreignKey':_0x9788('0x1db'),'as':_0x9788('0x1dc')});db['ChatTransferReport'][_0x9788('0x11b')](db[_0x9788('0x180')],{});db[_0x9788('0xe3')]['belongsTo'](db[_0x9788('0x111')],{});db[_0x9788('0xe3')][_0x9788('0x11b')](db[_0x9788('0x167')],{'foreignKey':_0x9788('0x1dd'),'as':_0x9788('0x1d6')});db['ChatTransferReport'][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':_0x9788('0x1d7'),'as':_0x9788('0x1de')});db[_0x9788('0xe3')][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':_0x9788('0x1df'),'as':_0x9788('0x1d8')});db['ChatTransferReport'][_0x9788('0x11b')](db['ChatQueue'],{'foreignKey':_0x9788('0x1e0'),'as':'ToQueue'});db[_0x9788('0xe3')][_0x9788('0x11b')](db['ChatWebsite'],{'foreignKey':_0x9788('0x1e1'),'as':_0x9788('0x1dc')});db[_0x9788('0x1e2')][_0x9788('0x11b')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x9788('0x46')],{});db['FaxTransferReport'][_0x9788('0x11b')](db['FaxAccount'],{'foreignKey':_0x9788('0x1e3'),'as':_0x9788('0x1d6')});db[_0x9788('0x1e2')][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':'FromUserId','as':_0x9788('0x1de')});db[_0x9788('0x1e2')][_0x9788('0x11b')](db['User'],{'foreignKey':_0x9788('0x1df'),'as':_0x9788('0x1d8')});db[_0x9788('0x1e2')][_0x9788('0x11b')](db[_0x9788('0x4a')],{'foreignKey':_0x9788('0x1e4'),'as':'ToQueue'});db[_0x9788('0x1e2')][_0x9788('0x11b')](db[_0x9788('0x42')],{'foreignKey':_0x9788('0x1e5'),'as':'ToAccount'});db[_0x9788('0xe5')][_0x9788('0x11b')](db['OpenchannelMessage'],{});db[_0x9788('0xe5')][_0x9788('0x11b')](db[_0x9788('0x10f')],{});db[_0x9788('0xe5')][_0x9788('0x11b')](db[_0x9788('0x57')],{'foreignKey':_0x9788('0x1e6'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x9788('0x11b')](db['User'],{'foreignKey':_0x9788('0x1d7'),'as':_0x9788('0x1de')});db['OpenchannelTransferReport'][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9788('0xe5')]['belongsTo'](db[_0x9788('0x5d')],{'foreignKey':_0x9788('0x1e7'),'as':_0x9788('0x1da')});db[_0x9788('0xe5')][_0x9788('0x11b')](db[_0x9788('0x57')],{'foreignKey':_0x9788('0x1e8'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x9788('0x54')],{});db[_0x9788('0xe7')][_0x9788('0x11b')](db[_0x9788('0x52')],{});db[_0x9788('0xe7')]['belongsTo'](db[_0x9788('0x4e')],{'foreignKey':_0x9788('0x1e9'),'as':'FromAccount'});db['SmsTransferReport'][_0x9788('0x11b')](db['User'],{'foreignKey':_0x9788('0x1d7'),'as':_0x9788('0x1de')});db['SmsTransferReport'][_0x9788('0x11b')](db['User'],{'foreignKey':_0x9788('0x1df'),'as':'ToAgent'});db[_0x9788('0xe7')][_0x9788('0x11b')](db[_0x9788('0x55')],{'foreignKey':_0x9788('0x1ea'),'as':_0x9788('0x1da')});db[_0x9788('0xe7')][_0x9788('0x11b')](db[_0x9788('0x4e')],{'foreignKey':_0x9788('0x1eb'),'as':_0x9788('0x1dc')});db[_0x9788('0x11f')]['hasMany'](db[_0x9788('0x7d')],{'as':_0x9788('0x15b'),'foreignKey':_0x9788('0x169'),'onDelete':_0x9788('0x106')});db['CmList'][_0x9788('0x109')](db[_0x9788('0x1ec')],{'as':_0x9788('0x1ed'),'foreignKey':_0x9788('0x169')});db[_0x9788('0x11f')][_0x9788('0x109')](db[_0x9788('0x6e')],{'as':_0x9788('0x11e'),'onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x169')});db[_0x9788('0x11f')]['hasMany'](db['CmHopperFinal'],{'as':_0x9788('0x10d'),'foreignKey':_0x9788('0x169')});db[_0x9788('0x11f')][_0x9788('0x109')](db[_0x9788('0x75')],{'as':'HopperHistory','foreignKey':_0x9788('0x169')});db[_0x9788('0x11f')]['hasMany'](db['ReportAgentPreview'],{'as':_0x9788('0x76'),'foreignKey':_0x9788('0x169')});db[_0x9788('0x11f')][_0x9788('0x11c')](db['VoiceQueue'],{'as':_0x9788('0x1ee'),'through':_0x9788('0x1ef')});db[_0x9788('0x11f')]['belongsToMany'](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x130')});db[_0x9788('0xea')]['hasMany'](db[_0x9788('0x16')],{'as':_0x9788('0x10c'),'onDelete':_0x9788('0x106')});db[_0x9788('0xea')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0xfe')});db['VoicePrefix'][_0x9788('0x11c')](db[_0x9788('0xdf')],{'through':'TeamVoicePrefix','as':_0x9788('0x14b')});db[_0x9788('0xeb')][_0x9788('0x109')](db[_0x9788('0x13')],{'as':_0x9788('0x164'),'foreignKey':_0x9788('0x1f0')});db[_0x9788('0xeb')][_0x9788('0x109')](db[_0x9788('0xec')],{'as':_0x9788('0x1f1'),'foreignKey':_0x9788('0x1f0'),'onDelete':_0x9788('0x106')});db['UserProfileSection'][_0x9788('0x109')](db[_0x9788('0x1f2')],{'as':_0x9788('0x1f3'),'foreignKey':_0x9788('0x1f4'),'onDelete':_0x9788('0x106')});db[_0x9788('0xf0')][_0x9788('0x109')](db[_0x9788('0x7d')],{'as':_0x9788('0x15b'),'foreignKey':_0x9788('0x1f5'),'onDelete':_0x9788('0x106')});db['WhatsappAccount'][_0x9788('0x109')](db[_0x9788('0x7c')],{'as':_0x9788('0x16b'),'foreignKey':_0x9788('0x1f5')});db[_0x9788('0xf0')][_0x9788('0x109')](db['WhatsappMessage'],{'as':_0x9788('0x14d'),'foreignKey':'WhatsappAccountId'});db[_0x9788('0xf0')][_0x9788('0x109')](db[_0x9788('0xf4')],{'as':_0x9788('0x15c')});db[_0x9788('0xf0')][_0x9788('0x109')](db[_0x9788('0xf2')],{'as':_0x9788('0x13e'),'foreignKey':'WhatsappAccountId','onDelete':_0x9788('0x106')});db[_0x9788('0xf0')][_0x9788('0x11b')](db['CmList'],{'as':_0x9788('0x15d'),'foreignKey':'ListId'});db[_0x9788('0xf0')]['belongsTo'](db[_0x9788('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x9788('0x149')});db[_0x9788('0xf0')]['belongsToMany'](db[_0x9788('0x13')],{'as':_0x9788('0x14a'),'through':_0x9788('0x13b')});db[_0x9788('0xf2')]['belongsTo'](db[_0x9788('0x13')],{'onDelete':'restrict'});db[_0x9788('0xf2')][_0x9788('0x11b')](db[_0x9788('0xf9')],{'onDelete':_0x9788('0x158')});db[_0x9788('0xf2')][_0x9788('0x11b')](db[_0x9788('0xf0')],{'onDelete':_0x9788('0x158')});db[_0x9788('0xf2')]['belongsTo'](db[_0x9788('0x146')],{'onDelete':_0x9788('0x158'),'foreignKey':'IntervalId'});db[_0x9788('0xf2')]['belongsTo'](db[_0x9788('0x161')],{'onDelete':_0x9788('0x158'),'foreignKey':_0x9788('0x16e')});db[_0x9788('0xf4')][_0x9788('0x109')](db[_0x9788('0xf5')],{'as':'Messages','onDelete':_0x9788('0x106'),'foreignKey':_0x9788('0x1f6')});db[_0x9788('0xf4')][_0x9788('0x11b')](db[_0x9788('0xf0')],{'as':_0x9788('0x15f'),'foreignKey':_0x9788('0x1f5')});db[_0x9788('0xf4')][_0x9788('0x11b')](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db['WhatsappInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x9788('0x107')});db['WhatsappInteraction'][_0x9788('0x11c')](db['Tag'],{'through':_0x9788('0x1a4'),'as':_0x9788('0x162')});db[_0x9788('0xf4')][_0x9788('0x11c')](db['Tag'],{'through':_0x9788('0x1a4'),'as':_0x9788('0x171')});db[_0x9788('0xf4')][_0x9788('0x11c')](db[_0x9788('0x13')],{'as':_0x9788('0x164'),'through':_0x9788('0x126'),'foreignKey':'WhatsappInteractionId'});db[_0x9788('0xf5')][_0x9788('0x11b')](db['User'],{'as':_0x9788('0x13')});db[_0x9788('0xf5')][_0x9788('0x11b')](db['CmContact'],{'onDelete':_0x9788('0x106'),'as':'Contact'});db[_0x9788('0xf5')][_0x9788('0x11b')](db[_0x9788('0xf4')],{'onDelete':_0x9788('0x106'),'as':_0x9788('0x166'),'foreignKey':_0x9788('0x1f6')});db[_0x9788('0xf5')][_0x9788('0x11b')](db[_0x9788('0xf0')],{'as':'Account','foreignKey':_0x9788('0x1f5')});db[_0x9788('0xf6')][_0x9788('0x11b')](db[_0x9788('0xf0')],{});db['WhatsappQueueReport'][_0x9788('0x11b')](db[_0x9788('0x11f')],{'as':_0x9788('0x15d'),'foreignKey':_0x9788('0x169')});db[_0x9788('0xf6')]['belongsTo'](db[_0x9788('0x6e')],{'as':_0x9788('0x153'),'foreignKey':_0x9788('0x154')});db[_0x9788('0xf6')]['belongsTo'](db[_0x9788('0xf4')],{});db[_0x9788('0xf6')][_0x9788('0x11b')](db[_0x9788('0xf9')],{});db['WhatsappQueueReport'][_0x9788('0x11b')](db[_0x9788('0xf5')],{});db[_0x9788('0xf6')][_0x9788('0x11b')](db[_0x9788('0x13')],{});db[_0x9788('0x1f7')][_0x9788('0x11b')](db[_0x9788('0xf5')],{});db[_0x9788('0x1f7')][_0x9788('0x11b')](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x9788('0xf0')],{'foreignKey':'FromWhatsappAccountId','as':_0x9788('0x1d6')});db[_0x9788('0x1f7')][_0x9788('0x11b')](db[_0x9788('0xf0')],{'foreignKey':_0x9788('0x1f8'),'as':_0x9788('0x1dc')});db[_0x9788('0x1f7')][_0x9788('0x11b')](db[_0x9788('0xf9')],{'foreignKey':'ToQueueId','as':_0x9788('0x1da')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x9788('0x1d7'),'as':'FromAgent'});db[_0x9788('0x1f7')][_0x9788('0x11b')](db[_0x9788('0x13')],{'foreignKey':_0x9788('0x1df'),'as':'ToAgent'});db['WhatsappQueue'][_0x9788('0x11c')](db['User'],{'as':_0x9788('0x14a'),'through':_0x9788('0x12f'),'foreignKey':_0x9788('0x1f9')});db[_0x9788('0xf9')]['belongsToMany'](db[_0x9788('0xdf')],{'through':_0x9788('0x1cd'),'as':_0x9788('0x14b')});db['UserSetting'][_0x9788('0x11b')](db[_0x9788('0x13')],{'as':_0x9788('0x1fa'),'foreignKey':_0x9788('0x107'),'onDelete':_0x9788('0x106'),'hooks':!![]});db['CloudProvider'][_0x9788('0x104')](db['Dynamics365Account'],{'as':_0x9788('0x1c3'),'onDelete':_0x9788('0x158')});db['CloudProvider'][_0x9788('0x104')](db['MailServerIn'],{'as':'Imap','onDelete':'restrict'});db[_0x9788('0x156')][_0x9788('0x104')](db['MailServerOut'],{'as':'Smtp','onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x8e3b=['mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Disposition','CannedAnswer','Answers','List','ListId','TemplateId','Pause','team_has_mail_queues','Teams','Tag','mail_interaction_has_tags','Tags','ThroughTags','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Dashboard','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','Users','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','ChatProactiveAction','ChatApplication','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','chat_group_has_users','Website','CmCompany','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OneAll','AutomationAllId','Any','AutomationAnyId','Action','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Actions','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Field','DeskAccount','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','Description','VariableId','ZendeskField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Configuration','SessionId','ProjectId','team_has_openchannel_queues','WhatsappQueue','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','HopperHistory','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','motion2','name','options','database','username','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','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','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','User','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceExtension','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','MailInteractions','SenderId','Hoppers','SET\x20NULL','belongsTo','userProfileId','ChatGroup','Groups','Contacts','belongsToMany','CmList','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteraction','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefix','VoicePrefixes','MailQueue','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','VoiceQueueId','CmHopper','CmHopperHistory','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','TrunkBackupId','IntervalId'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x8e3b,0xaa));var _0xb8e3=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0x8e3b[_0x198247];return _0x2b18bc;};'use strict';var config=require(_0xb8e3('0x0'));var Sequelize=require(_0xb8e3('0x1'));var _=require(_0xb8e3('0x2'));var jstz=require(_0xb8e3('0x3'));var timezone=jstz[_0xb8e3('0x4')]();config[_0xb8e3('0x1')]=_[_0xb8e3('0x5')](config[_0xb8e3('0x1')],{'database':'motion2','username':_0xb8e3('0x6'),'password':_0xb8e3('0x7'),'options':{'host':_0xb8e3('0x8'),'port':0xcea,'dialect':_0xb8e3('0x9'),'dialectOptions':{'charset':_0xb8e3('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xb8e3('0xb'),'collate':_0xb8e3('0xc')}}});config[_0xb8e3('0xd')]=_['defaultsDeep'](config[_0xb8e3('0xd')],{'database':_0xb8e3('0xe'),'username':_0xb8e3('0x6'),'password':'xC@LL1234','options':{'host':_0xb8e3('0x8'),'port':0xcea,'dialect':_0xb8e3('0x9'),'dialectOptions':{'charset':_0xb8e3('0xa')},'logging':![],'timezone':timezone[_0xb8e3('0xf')](),'define':{'charset':'utf8','collate':_0xb8e3('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0xb8e3('0x1')]['username'],config[_0xb8e3('0x1')]['password'],config[_0xb8e3('0x1')][_0xb8e3('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb8e3('0xd')][_0xb8e3('0x11')],config['sequelizeHistory'][_0xb8e3('0x12')],config[_0xb8e3('0xd')]['password'],config['sequelizeHistory']['options'])};db['User']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x14'));db[_0xb8e3('0x15')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x16'));db['VoiceContext']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x17'));db['VoiceExtension']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x18'));db[_0xb8e3('0x19')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xb8e3('0x1a')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x1b'));db[_0xb8e3('0x1c')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x1d'));db[_0xb8e3('0x1e')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0xb8e3('0x1f')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x20'));db[_0xb8e3('0x21')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x22'));db[_0xb8e3('0x23')]=db[_0xb8e3('0x1')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xb8e3('0x24')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x25'));db[_0xb8e3('0x26')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x27'));db[_0xb8e3('0x28')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x29'));db['MemberReport']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x2a'));db['Trunk']=db['sequelize'][_0xb8e3('0x13')]('../api/trunk/trunk.model');db[_0xb8e3('0x2b')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x2c'));db[_0xb8e3('0x2d')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x2e'));db['UserVoiceQueue']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x2f'));db[_0xb8e3('0x30')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x31'));db[_0xb8e3('0x32')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x33'));db[_0xb8e3('0x34')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x35'));db[_0xb8e3('0x36')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x37'));db[_0xb8e3('0x38')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x39'));db[_0xb8e3('0x3a')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x3b'));db[_0xb8e3('0x3c')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x3d'));db[_0xb8e3('0x3e')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x3f'));db[_0xb8e3('0x40')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x41'));db['MailQueue']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x42'));db[_0xb8e3('0x43')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x44'));db[_0xb8e3('0x45')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xb8e3('0x46')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x47'));db[_0xb8e3('0x48')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x49'));db[_0xb8e3('0x4a')]=db[_0xb8e3('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x4b'));db[_0xb8e3('0x4c')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x4d'));db[_0xb8e3('0x4e')]=db['sequelize'][_0xb8e3('0x13')]('../api/faxAccount/faxAccount.model');db[_0xb8e3('0x4f')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x50'));db[_0xb8e3('0x51')]=db[_0xb8e3('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize'][_0xb8e3('0x13')]('../api/faxMessage/faxMessage.model');db[_0xb8e3('0x52')]=db[_0xb8e3('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0xb8e3('0x53')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x54'));db[_0xb8e3('0x55')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x56'));db[_0xb8e3('0x57')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x58'));db['SmsInteraction']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x59'));db[_0xb8e3('0x5a')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x5b'));db[_0xb8e3('0x5c')]=db['sequelize']['import'](_0xb8e3('0x5d'));db['OpenchannelAccount']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x5e'));db[_0xb8e3('0x5f')]=db['sequelize'][_0xb8e3('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xb8e3('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xb8e3('0x60')]=db['sequelize']['import'](_0xb8e3('0x61'));db[_0xb8e3('0x62')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x63'));db[_0xb8e3('0x64')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x65'));db[_0xb8e3('0x66')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x67'));db['ChatApplication']=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x68'));db[_0xb8e3('0x69')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x6a'));db[_0xb8e3('0x6b')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x6c'));db[_0xb8e3('0x6d')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x6e'));db['ChatQueue']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x6f'));db['ChatGroup']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x70'));db['ChatProactiveAction']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x71'));db['CmCompany']=db[_0xb8e3('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0xb8e3('0x72')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x73'));db[_0xb8e3('0x74')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x75'));db['CmHopperHistory']=db['sequelize']['import'](_0xb8e3('0x76'));db[_0xb8e3('0x77')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x78'));db[_0xb8e3('0x79')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x7a'));db['Action']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x7b'));db[_0xb8e3('0x7c')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x7d'));db['CannedAnswer']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x7e'));db['Disposition']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x7f'));db[_0xb8e3('0x80')]=db['sequelize'][_0xb8e3('0x13')]('../api/condition/condition.model');db[_0xb8e3('0x81')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x82'));db['Pause']=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x83'));db['Cdr']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x84'));db[_0xb8e3('0x85')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x86'));db[_0xb8e3('0x87')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x88'));db[_0xb8e3('0x89')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x8a'));db['Tag']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x8b'));db[_0xb8e3('0x8c')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x8d'));db[_0xb8e3('0x8e')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x8f'));db[_0xb8e3('0x90')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xb8e3('0x91')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x92'));db[_0xb8e3('0x93')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x94'));db[_0xb8e3('0x95')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/variable/variable.model');db[_0xb8e3('0x96')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x97'));db[_0xb8e3('0x98')]=db['sequelize'][_0xb8e3('0x13')]('../api/integrationReport/integrationReport.model');db[_0xb8e3('0x99')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x9a'));db['AnalyticDefaultReport']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x9b'));db['AnalyticExtractedReport']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x9c'));db[_0xb8e3('0x9d')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0xb8e3('0x9e')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x9f'));db['AnalyticTreeReport']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xa0'));db[_0xb8e3('0xa1')]=db['sequelize'][_0xb8e3('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xb8e3('0xa2')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xb8e3('0xa3')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xa4'));db[_0xb8e3('0xa5')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0xa6'));db[_0xb8e3('0xa7')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0xa8'));db[_0xb8e3('0xa9')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xaa'));db['DeskConfiguration']=db[_0xb8e3('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intDeskField/intDeskField.model');db[_0xb8e3('0xab')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xac'));db['ZohoConfiguration']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xad'));db[_0xb8e3('0xae')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xaf'));db['ZendeskAccount']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xb0'));db[_0xb8e3('0xb1')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xb2'));db['ZendeskField']=db['sequelize'][_0xb8e3('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0xb8e3('0xb3')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xb4'));db[_0xb8e3('0xb5')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xb6'));db[_0xb8e3('0xb7')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xb8e3('0xb8')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xb9'));db[_0xb8e3('0xba')]=db['sequelize'][_0xb8e3('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xb8e3('0xbb')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xbc'));db[_0xb8e3('0xbd')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xbe'));db[_0xb8e3('0xbf')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xc0'));db['ServicenowField']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xc1'));db[_0xb8e3('0xc2')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0xc3'));db['Dynamics365Configuration']=db[_0xb8e3('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xb8e3('0xc4')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xc5'));db[_0xb8e3('0xc6')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xc7'));db[_0xb8e3('0xc8')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xb8e3('0xc9')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x97'));db[_0xb8e3('0xca')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xcb'));db[_0xb8e3('0xcc')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0xcd'));db[_0xb8e3('0xce')]=db[_0xb8e3('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xb8e3('0xcf')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xd0'));db[_0xb8e3('0xd1')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xd2'));db[_0xb8e3('0xd3')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xd4'));db[_0xb8e3('0xd5')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xb8e3('0xd6')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xd7'));db[_0xb8e3('0xd8')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xd9'));db[_0xb8e3('0xda')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xdb'));db[_0xb8e3('0xdc')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xdd'));db['SquareOdbc']=db[_0xb8e3('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0xb8e3('0xde')]=db['sequelize']['import'](_0xb8e3('0xdf'));db[_0xb8e3('0xe0')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xe1'));db[_0xb8e3('0xe2')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xe3'));db[_0xb8e3('0xe4')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xe5'));db[_0xb8e3('0xe6')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xe7'));db[_0xb8e3('0xe8')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xe9'));db[_0xb8e3('0xea')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xeb'));db[_0xb8e3('0xec')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xed'));db[_0xb8e3('0xee')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/plugin/plugin.model');db[_0xb8e3('0xef')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xf0'));db['ChatTransferReport']=db['sequelize']['import'](_0xb8e3('0xf1'));db[_0xb8e3('0xf2')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xb8e3('0xf3')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0xf4'));db[_0xb8e3('0xf5')]=db[_0xb8e3('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xf6'));db['VoicePrefix']=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0xb8e3('0xf7')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xf8'));db[_0xb8e3('0xf9')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xfa'));db[_0xb8e3('0xfb')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0xfc'));db[_0xb8e3('0xfd')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/userNotification/userNotification.model');db[_0xb8e3('0xfe')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0xff'));db[_0xb8e3('0x100')]=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x101'));db[_0xb8e3('0x102')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x103'));db['WhatsappMessage']=db[_0xb8e3('0x1')]['import'](_0xb8e3('0x104'));db['WhatsappQueueReport']=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x105'));db[_0xb8e3('0x106')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x107'));db['WhatsappQueue']=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xb8e3('0x108')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x109'));db[_0xb8e3('0x10a')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x10b'));db[_0xb8e3('0x10c')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xb8e3('0x10d')]=db['sequelize'][_0xb8e3('0x13')](_0xb8e3('0x10e'));db[_0xb8e3('0x10f')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')](_0xb8e3('0x110'));db[_0xb8e3('0x111')]=db[_0xb8e3('0x1')][_0xb8e3('0x13')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db[_0xb8e3('0x112')][_0xb8e3('0x113')](db[_0xb8e3('0x1f')],{'as':'VoiceMail','onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')][_0xb8e3('0x113')](db['UserSetting'],{'as':_0xb8e3('0x116'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db[_0xb8e3('0x1c')],{'as':_0xb8e3('0x118'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db[_0xb8e3('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')]['hasMany'](db[_0xb8e3('0x119')],{'as':_0xb8e3('0x11a'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db['User'][_0xb8e3('0x117')](db[_0xb8e3('0x74')],{'as':_0xb8e3('0x11b'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xb8e3('0x115')});db['User']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xb8e3('0x11c'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')]['hasMany'](db[_0xb8e3('0x69')],{'as':_0xb8e3('0x11d'),'foreignKey':_0xb8e3('0x115')});db['User'][_0xb8e3('0x117')](db[_0xb8e3('0x11e')],{'as':'SmsInteractions','foreignKey':_0xb8e3('0x115')});db['User'][_0xb8e3('0x117')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db[_0xb8e3('0x45')],{'as':_0xb8e3('0x11f'),'foreignKey':'UserId'});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db[_0xb8e3('0x102')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db[_0xb8e3('0xfd')],{'as':'UserNotifications','foreignKey':_0xb8e3('0x120')});db[_0xb8e3('0x112')][_0xb8e3('0x117')](db['CmHopper'],{'as':_0xb8e3('0x121'),'foreignKey':_0xb8e3('0x115'),'onDelete':_0xb8e3('0x122')});db[_0xb8e3('0x112')][_0xb8e3('0x123')](db[_0xb8e3('0xf7')],{'as':_0xb8e3('0xf7'),'foreignKey':_0xb8e3('0x124')});db[_0xb8e3('0x112')]['belongsToMany'](db[_0xb8e3('0x125')],{'as':_0xb8e3('0x126'),'through':'chat_group_has_users'});db[_0xb8e3('0x112')]['belongsToMany'](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x127'),'through':'cm_user_has_contacts'});db['User'][_0xb8e3('0x128')](db[_0xb8e3('0x129')],{'as':'Lists','through':'cm_user_has_lists'});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'through':'user_has_teams'});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x45')],{'as':'MailInteractions','through':_0xb8e3('0x12a')});db[_0xb8e3('0x112')]['belongsToMany'](db['ChatInteraction'],{'as':_0xb8e3('0x11d'),'through':_0xb8e3('0x12b')});db['User']['belongsToMany'](db['FaxInteraction'],{'as':_0xb8e3('0x12c'),'through':_0xb8e3('0x12d')});db[_0xb8e3('0x112')]['belongsToMany'](db['SmsInteraction'],{'as':_0xb8e3('0x12e'),'through':_0xb8e3('0x12f')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x130')],{'as':_0xb8e3('0x11c'),'through':'user_has_openchannel_interactions'});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x102')],{'as':_0xb8e3('0x131'),'through':_0xb8e3('0x132')});db[_0xb8e3('0x112')]['belongsToMany'](db[_0xb8e3('0x1a')],{'as':_0xb8e3('0x133'),'through':_0xb8e3('0x134'),'required':![]});db[_0xb8e3('0x112')]['belongsToMany'](db[_0xb8e3('0x135')],{'as':_0xb8e3('0x136'),'through':'UserVoicePrefix','required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x137')],{'as':_0xb8e3('0x138'),'through':'UserMailQueue','required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x139')],{'as':_0xb8e3('0x13a'),'through':_0xb8e3('0x30'),'required':![],'hooks':!![]});db['User'][_0xb8e3('0x128')](db[_0xb8e3('0x52')],{'as':_0xb8e3('0x13b'),'through':_0xb8e3('0x34'),'required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x5c')],{'as':_0xb8e3('0x13c'),'through':'UserSmsQueue','required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x62')],{'as':_0xb8e3('0x13d'),'through':'UserOpenchannelQueue','required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0xb8e3('0x3a'),'required':![]});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x129')],{'through':_0xb8e3('0x13e')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db['ChatWebsite'],{'as':_0xb8e3('0x13f'),'through':_0xb8e3('0x140')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db['FaxAccount'],{'as':_0xb8e3('0x141'),'through':_0xb8e3('0x142')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db['MailAccount'],{'as':_0xb8e3('0x143'),'through':_0xb8e3('0x144')});db['User'][_0xb8e3('0x128')](db[_0xb8e3('0x145')],{'as':'OpenchannelAccounts','through':_0xb8e3('0x146')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db[_0xb8e3('0x55')],{'as':'SmsAccounts','through':_0xb8e3('0x147')});db[_0xb8e3('0x112')][_0xb8e3('0x128')](db['WhatsappAccount'],{'as':_0xb8e3('0x148'),'through':_0xb8e3('0x149')});db['VoiceChanSpy'][_0xb8e3('0x117')](db[_0xb8e3('0x119')],{'as':_0xb8e3('0x14a'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x14b')});db[_0xb8e3('0x14c')]['hasMany'](db[_0xb8e3('0x119')],{'onDelete':'cascade'});db[_0xb8e3('0x119')][_0xb8e3('0x117')](db[_0xb8e3('0x119')],{'as':_0xb8e3('0x14d'),'onDelete':_0xb8e3('0x114')});db['VoiceMusicOnHold'][_0xb8e3('0x128')](db['Sound'],{'as':_0xb8e3('0x14e'),'through':_0xb8e3('0x14f')});db['VoiceQueue'][_0xb8e3('0x117')](db[_0xb8e3('0x2d')],{'as':'Members','foreignKey':_0xb8e3('0x150')});db[_0xb8e3('0x1a')][_0xb8e3('0x117')](db[_0xb8e3('0x151')],{'as':_0xb8e3('0x121'),'foreignKey':'VoiceQueueId'});db[_0xb8e3('0x1a')]['hasMany'](db[_0xb8e3('0x74')],{'as':_0xb8e3('0x11b'),'foreignKey':_0xb8e3('0x150')});db[_0xb8e3('0x1a')]['hasMany'](db[_0xb8e3('0x152')],{'as':_0xb8e3('0x153'),'foreignKey':_0xb8e3('0x150')});db['VoiceQueue']['hasMany'](db[_0xb8e3('0x77')],{'as':_0xb8e3('0x77'),'foreignKey':_0xb8e3('0x150')});db[_0xb8e3('0x1a')][_0xb8e3('0x117')](db[_0xb8e3('0x154')],{'as':_0xb8e3('0x155'),'foreignKey':_0xb8e3('0x150')});db[_0xb8e3('0x1a')][_0xb8e3('0x117')](db[_0xb8e3('0xd3')],{'as':_0xb8e3('0x156'),'foreignKey':_0xb8e3('0x150')});db[_0xb8e3('0x1a')][_0xb8e3('0x123')](db[_0xb8e3('0x157')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xb8e3('0x1a')]['belongsTo'](db[_0xb8e3('0x157')],{'as':_0xb8e3('0x158'),'foreignKey':_0xb8e3('0x159')});db[_0xb8e3('0x1a')][_0xb8e3('0x123')](db['Interval'],{'as':_0xb8e3('0x81'),'foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x1a')][_0xb8e3('0x123')](db['Pause'],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db['VoiceQueue']['belongsToMany'](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x15d'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue']['belongsToMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x134')});db[_0xb8e3('0x1a')][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0xb8e3('0x128')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x15f'),'through':_0xb8e3('0x160')});db['VoiceRecording'][_0xb8e3('0x123')](db['User'],{'as':_0xb8e3('0x112'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x1e')][_0xb8e3('0x123')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0xb8e3('0x1f')][_0xb8e3('0x117')](db[_0xb8e3('0x21')],{'as':_0xb8e3('0x161'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x162'),'sourceKey':'mailbox'});db['VoiceMailMessage']['belongsTo'](db[_0xb8e3('0x1f')],{'foreignKey':_0xb8e3('0x162'),'targetKey':'mailbox'});db['VoiceCallReport'][_0xb8e3('0x117')](db[_0xb8e3('0x28')],{'as':_0xb8e3('0x163'),'foreignKey':_0xb8e3('0x164'),'constraints':![]});db['VoiceCallReport'][_0xb8e3('0x117')](db[_0xb8e3('0x26')],{'as':_0xb8e3('0x165'),'foreignKey':_0xb8e3('0x164'),'constraints':![]});db['VoiceCallReport'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x112'),'foreignKey':'UserId'});db[_0xb8e3('0x23')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x3c')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x3c')][_0xb8e3('0x123')](db[_0xb8e3('0x108')],{'as':'CloudProvider','foreignKey':_0xb8e3('0x169'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x3e')][_0xb8e3('0x123')](db['MailAccount'],{'as':_0xb8e3('0x40'),'foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x3e')][_0xb8e3('0x123')](db[_0xb8e3('0x108')],{'as':_0xb8e3('0x108'),'foreignKey':_0xb8e3('0x169'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x40')][_0xb8e3('0x113')](db['MailServerIn'],{'as':_0xb8e3('0x16b'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x40')][_0xb8e3('0x113')](db[_0xb8e3('0x3e')],{'as':_0xb8e3('0x16c'),'onDelete':_0xb8e3('0x114')});db['MailAccount']['hasMany'](db[_0xb8e3('0x16d')],{'as':'Dispositions','foreignKey':_0xb8e3('0x168'),'onDelete':'cascade'});db[_0xb8e3('0x40')][_0xb8e3('0x117')](db[_0xb8e3('0x16e')],{'as':_0xb8e3('0x16f'),'foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x40')]['hasMany'](db[_0xb8e3('0x46')],{'as':_0xb8e3('0x161'),'foreignKey':_0xb8e3('0x168')});db['MailAccount']['hasMany'](db[_0xb8e3('0x45')],{'as':'Interactions'});db['MailAccount'][_0xb8e3('0x117')](db['MailApplication'],{'as':_0xb8e3('0x14d'),'foreignKey':_0xb8e3('0x168'),'onDelete':_0xb8e3('0x114')});db['MailAccount'][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171')});db['MailAccount']['belongsTo'](db[_0xb8e3('0x91')],{'as':_0xb8e3('0x91'),'foreignKey':_0xb8e3('0x172')});db[_0xb8e3('0x40')][_0xb8e3('0x123')](db[_0xb8e3('0x173')],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db[_0xb8e3('0x40')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xb8e3('0x137')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x32')});db[_0xb8e3('0x137')][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'through':_0xb8e3('0x174'),'as':_0xb8e3('0x175')});db[_0xb8e3('0x45')][_0xb8e3('0x117')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0xb8e3('0x45')][_0xb8e3('0x123')](db[_0xb8e3('0x40')],{'as':'Account','foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x45')]['belongsTo'](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x45')][_0xb8e3('0x123')](db['User'],{'as':'Owner','foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x45')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x177'),'as':_0xb8e3('0x178')});db[_0xb8e3('0x45')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':'mail_interaction_has_tags','as':_0xb8e3('0x179')});db[_0xb8e3('0x45')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xb8e3('0x17a')});db['MailMessage']['hasMany'](db[_0xb8e3('0xec')],{'as':_0xb8e3('0x17b'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x46')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x112')});db[_0xb8e3('0x46')][_0xb8e3('0x123')](db['CmContact'],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x166')});db[_0xb8e3('0x46')][_0xb8e3('0x123')](db['MailInteraction'],{'as':_0xb8e3('0x17c'),'foreignKey':_0xb8e3('0x17a')});db[_0xb8e3('0x46')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x46')][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{'as':'ChatWebsite','foreignKey':_0xb8e3('0x17d')});db['MailMessage'][_0xb8e3('0x123')](db[_0xb8e3('0x6d')],{'as':_0xb8e3('0x6d'),'foreignKey':_0xb8e3('0x17e')});db[_0xb8e3('0x48')]['belongsTo'](db[_0xb8e3('0x112')],{'onDelete':'restrict'});db[_0xb8e3('0x48')][_0xb8e3('0x123')](db[_0xb8e3('0x137')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x48')]['belongsTo'](db[_0xb8e3('0x40')],{'onDelete':_0xb8e3('0x16a')});db['MailApplication']['belongsTo'](db[_0xb8e3('0x81')],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x15a')});db['MailApplication']['belongsTo'](db[_0xb8e3('0x176')],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x17f')});db[_0xb8e3('0x4a')]['belongsTo'](db[_0xb8e3('0x40')],{});db[_0xb8e3('0x4a')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':'ListId'});db[_0xb8e3('0x4a')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x4a')][_0xb8e3('0x123')](db[_0xb8e3('0x45')],{});db['MailQueueReport'][_0xb8e3('0x123')](db['MailMessage'],{});db['MailQueueReport'][_0xb8e3('0x123')](db['User'],{});db[_0xb8e3('0x4a')]['belongsTo'](db[_0xb8e3('0x137')],{});db[_0xb8e3('0x180')][_0xb8e3('0x117')](db['DashboardItem'],{'as':'Items','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x4e')][_0xb8e3('0x117')](db[_0xb8e3('0x16d')],{'as':_0xb8e3('0x181'),'foreignKey':_0xb8e3('0x182'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x4e')][_0xb8e3('0x117')](db[_0xb8e3('0x16e')],{'as':_0xb8e3('0x16f'),'foreignKey':_0xb8e3('0x182')});db[_0xb8e3('0x4e')][_0xb8e3('0x117')](db[_0xb8e3('0x51')],{'as':_0xb8e3('0x183')});db[_0xb8e3('0x4e')][_0xb8e3('0x117')](db[_0xb8e3('0x4f')],{'as':'Applications','foreignKey':_0xb8e3('0x182'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x4e')][_0xb8e3('0x117')](db[_0xb8e3('0x119')],{'as':_0xb8e3('0x184'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x4e')]['hasMany'](db[_0xb8e3('0x185')],{'as':_0xb8e3('0x161')});db['FaxAccount'][_0xb8e3('0x123')](db[_0xb8e3('0x157')],{'as':'Trunk'});db['FaxAccount'][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x4e')][_0xb8e3('0x123')](db['Pause'],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db[_0xb8e3('0x4e')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x4f')]['belongsTo'](db['FaxQueue'],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x4f')]['belongsTo'](db[_0xb8e3('0x4e')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x4f')][_0xb8e3('0x123')](db['Tag'],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x17f')});db[_0xb8e3('0x51')][_0xb8e3('0x117')](db[_0xb8e3('0x185')],{'as':'Messages','onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x186')});db[_0xb8e3('0x51')][_0xb8e3('0x123')](db[_0xb8e3('0x4e')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x182')});db[_0xb8e3('0x51')]['belongsTo'](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x51')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x188'),'foreignKey':_0xb8e3('0x115')});db['FaxInteraction'][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x189'),'as':_0xb8e3('0x178')});db[_0xb8e3('0x51')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':'fax_interaction_has_tags','as':_0xb8e3('0x179')});db[_0xb8e3('0x51')]['belongsToMany'](db[_0xb8e3('0x112')],{'as':'Users','through':_0xb8e3('0x12d'),'foreignKey':_0xb8e3('0x186')});db[_0xb8e3('0x185')][_0xb8e3('0x123')](db['User'],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x112')});db[_0xb8e3('0x185')][_0xb8e3('0x123')](db[_0xb8e3('0x51')],{'as':_0xb8e3('0x17c'),'foreignKey':_0xb8e3('0x186')});db[_0xb8e3('0x185')]['belongsTo'](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':'Contact'});db[_0xb8e3('0x185')]['belongsTo'](db[_0xb8e3('0xec')],{'as':'Attachment','foreignKey':_0xb8e3('0x18a')});db[_0xb8e3('0x185')][_0xb8e3('0x123')](db[_0xb8e3('0x4e')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x182')});db[_0xb8e3('0x52')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x34')});db[_0xb8e3('0x52')][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'through':_0xb8e3('0x18b'),'as':'Teams'});db[_0xb8e3('0x53')]['belongsTo'](db[_0xb8e3('0x4e')],{});db[_0xb8e3('0x53')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':'List','foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x53')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x53')][_0xb8e3('0x123')](db[_0xb8e3('0x51')],{});db['FaxQueueReport'][_0xb8e3('0x123')](db[_0xb8e3('0x185')],{});db[_0xb8e3('0x53')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{});db[_0xb8e3('0x53')][_0xb8e3('0x123')](db[_0xb8e3('0x52')],{});db[_0xb8e3('0x55')]['hasMany'](db[_0xb8e3('0x16d')],{'as':'Dispositions','foreignKey':_0xb8e3('0x18c'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xb8e3('0x16e')],{'as':_0xb8e3('0x16f'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xb8e3('0x117')](db[_0xb8e3('0x5a')],{'as':'Messages','foreignKey':_0xb8e3('0x18c')});db[_0xb8e3('0x55')][_0xb8e3('0x117')](db['SmsInteraction'],{'as':_0xb8e3('0x183')});db['SmsAccount']['hasMany'](db[_0xb8e3('0x57')],{'as':'Applications','foreignKey':_0xb8e3('0x18c'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x55')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171')});db['SmsAccount'][_0xb8e3('0x123')](db['Pause'],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db[_0xb8e3('0x55')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':'Agents','through':_0xb8e3('0x147')});db[_0xb8e3('0x57')]['belongsTo'](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x57')][_0xb8e3('0x123')](db[_0xb8e3('0x5c')],{'onDelete':_0xb8e3('0x16a')});db['SmsApplication'][_0xb8e3('0x123')](db[_0xb8e3('0x55')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x57')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x57')]['belongsTo'](db[_0xb8e3('0x176')],{'onDelete':'restrict','foreignKey':_0xb8e3('0x17f')});db['SmsInteraction'][_0xb8e3('0x117')](db[_0xb8e3('0x5a')],{'as':_0xb8e3('0x161'),'onDelete':_0xb8e3('0x114'),'foreignKey':'SmsInteractionId'});db[_0xb8e3('0x11e')][_0xb8e3('0x123')](db[_0xb8e3('0x55')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x18c')});db[_0xb8e3('0x11e')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db['SmsInteraction'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x188'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x11e')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xb8e3('0x178')});db['SmsInteraction'][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x18d'),'as':_0xb8e3('0x179')});db[_0xb8e3('0x11e')]['belongsToMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x18e'),'through':_0xb8e3('0x12f'),'foreignKey':'SmsInteractionId'});db[_0xb8e3('0x5a')][_0xb8e3('0x123')](db['User'],{'as':_0xb8e3('0x112')});db[_0xb8e3('0x5a')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x166')});db['SmsMessage']['belongsTo'](db[_0xb8e3('0x11e')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x17c'),'foreignKey':_0xb8e3('0x18f')});db[_0xb8e3('0x5a')][_0xb8e3('0x123')](db[_0xb8e3('0x55')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x18c')});db[_0xb8e3('0x5c')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x36'),'foreignKey':_0xb8e3('0x190')});db['SmsQueue']['belongsToMany'](db[_0xb8e3('0xe4')],{'through':_0xb8e3('0x191'),'as':_0xb8e3('0x175')});db[_0xb8e3('0x145')][_0xb8e3('0x117')](db[_0xb8e3('0x16d')],{'as':_0xb8e3('0x181'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xb8e3('0x145')][_0xb8e3('0x117')](db[_0xb8e3('0x16e')],{'as':_0xb8e3('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0xb8e3('0x145')][_0xb8e3('0x117')](db[_0xb8e3('0x130')],{'as':_0xb8e3('0x183'),'foreignKey':_0xb8e3('0x192')});db[_0xb8e3('0x145')][_0xb8e3('0x117')](db['OpenchannelMessage'],{'as':_0xb8e3('0x161'),'foreignKey':_0xb8e3('0x192')});db[_0xb8e3('0x145')][_0xb8e3('0x117')](db[_0xb8e3('0x5f')],{'as':_0xb8e3('0x14d'),'foreignKey':'OpenchannelAccountId','onDelete':_0xb8e3('0x114')});db['OpenchannelAccount'][_0xb8e3('0x123')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xb8e3('0x145')]['belongsTo'](db[_0xb8e3('0x173')],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db['OpenchannelAccount']['belongsToMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x146')});db[_0xb8e3('0x5f')]['belongsTo'](db['User'],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x5f')][_0xb8e3('0x123')](db[_0xb8e3('0x62')],{'onDelete':_0xb8e3('0x16a'),'foreignKey':'OpenchannelQueueId'});db[_0xb8e3('0x5f')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0xb8e3('0x192')});db['OpenchannelApplication'][_0xb8e3('0x123')](db['Interval'],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x5f')][_0xb8e3('0x123')](db[_0xb8e3('0x176')],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x17f')});db[_0xb8e3('0x130')][_0xb8e3('0x117')](db[_0xb8e3('0x60')],{'as':_0xb8e3('0x161'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x193')});db[_0xb8e3('0x130')][_0xb8e3('0x123')](db[_0xb8e3('0x145')],{'as':'Account','foreignKey':_0xb8e3('0x192')});db[_0xb8e3('0x130')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db['OpenchannelInteraction'][_0xb8e3('0x123')](db['User'],{'as':_0xb8e3('0x188'),'foreignKey':_0xb8e3('0x115')});db['OpenchannelInteraction'][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x194'),'as':'Tags'});db['OpenchannelInteraction'][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x194'),'as':_0xb8e3('0x179')});db['OpenchannelInteraction'][_0xb8e3('0x128')](db['User'],{'as':_0xb8e3('0x18e'),'through':_0xb8e3('0x195'),'foreignKey':_0xb8e3('0x193')});db['OpenchannelMessage']['belongsTo'](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x112')});db[_0xb8e3('0x60')]['belongsTo'](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x166')});db[_0xb8e3('0x60')]['belongsTo'](db[_0xb8e3('0x130')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x17c'),'foreignKey':_0xb8e3('0x193')});db[_0xb8e3('0x60')]['belongsTo'](db[_0xb8e3('0xec')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xb8e3('0x60')][_0xb8e3('0x123')](db[_0xb8e3('0x145')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x192')});db[_0xb8e3('0x62')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x38'),'foreignKey':_0xb8e3('0x196')});db[_0xb8e3('0x62')]['belongsToMany'](db[_0xb8e3('0xe4')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':_0xb8e3('0x181'),'foreignKey':_0xb8e3('0x17d'),'onDelete':_0xb8e3('0x114')});db['ChatWebsite']['hasMany'](db['CannedAnswer'],{'as':_0xb8e3('0x16f'),'foreignKey':_0xb8e3('0x17d')});db[_0xb8e3('0x64')][_0xb8e3('0x117')](db[_0xb8e3('0x197')],{'as':'ProactiveActions'});db[_0xb8e3('0x64')][_0xb8e3('0x117')](db['ChatInteraction'],{'as':_0xb8e3('0x183')});db[_0xb8e3('0x64')]['hasMany'](db['ChatApplication'],{'as':_0xb8e3('0x14d'),'foreignKey':_0xb8e3('0x17d'),'onDelete':'cascade'});db[_0xb8e3('0x64')]['hasMany'](db[_0xb8e3('0x6b')],{'as':_0xb8e3('0x161')});db[_0xb8e3('0x64')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':'List','foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x64')]['belongsTo'](db[_0xb8e3('0x81')],{'as':_0xb8e3('0x81'),'foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x64')][_0xb8e3('0x123')](db[_0xb8e3('0x40')],{'as':_0xb8e3('0x40'),'foreignKey':_0xb8e3('0x168')});db[_0xb8e3('0x64')]['belongsTo'](db[_0xb8e3('0x173')],{'as':_0xb8e3('0x15b'),'foreignKey':_0xb8e3('0x15c')});db[_0xb8e3('0x64')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xb8e3('0x123')](db[_0xb8e3('0x145')],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x66')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x66')][_0xb8e3('0x123')](db['OpenchannelInteraction'],{});db[_0xb8e3('0x66')][_0xb8e3('0x123')](db['OpenchannelMessage'],{});db[_0xb8e3('0x66')]['belongsTo'](db[_0xb8e3('0x112')],{});db[_0xb8e3('0x66')]['belongsTo'](db[_0xb8e3('0x62')],{});db[_0xb8e3('0x198')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':'Agent','foreignKey':'UserId','onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x198')][_0xb8e3('0x123')](db[_0xb8e3('0x139')],{'as':_0xb8e3('0x199'),'foreignKey':_0xb8e3('0x19a'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x198')][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{'as':'Website','foreignKey':_0xb8e3('0x17d'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x198')]['belongsTo'](db[_0xb8e3('0x176')],{'onDelete':_0xb8e3('0x16a'),'foreignKey':_0xb8e3('0x17f')});db['ChatInteraction']['hasMany'](db[_0xb8e3('0x6b')],{'as':_0xb8e3('0x161'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x19b')});db[_0xb8e3('0x69')][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{'as':'Account','foreignKey':_0xb8e3('0x17d')});db[_0xb8e3('0x69')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x69')][_0xb8e3('0x123')](db['User'],{'as':_0xb8e3('0x188'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x69')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x19c'),'as':_0xb8e3('0x178')});db[_0xb8e3('0x69')]['belongsToMany'](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x19c'),'as':_0xb8e3('0x179')});db[_0xb8e3('0x69')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x18e'),'through':_0xb8e3('0x12b'),'foreignKey':_0xb8e3('0x19b')});db['ChatMessage'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x112')});db[_0xb8e3('0x6b')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':'Contact','foreignKey':'ContactId'});db[_0xb8e3('0x6b')][_0xb8e3('0x123')](db['ChatInteraction'],{'onDelete':_0xb8e3('0x114'),'as':'Interaction','foreignKey':_0xb8e3('0x19b')});db[_0xb8e3('0x6b')][_0xb8e3('0x123')](db[_0xb8e3('0xec')],{'as':_0xb8e3('0xec'),'foreignKey':_0xb8e3('0x18a')});db[_0xb8e3('0x6b')][_0xb8e3('0x123')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xb8e3('0x17d')});db[_0xb8e3('0x6d')][_0xb8e3('0x117')](db[_0xb8e3('0xec')],{'as':_0xb8e3('0x17b'),'foreignKey':_0xb8e3('0x17e'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x6d')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db['ChatOfflineMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x17d')});db[_0xb8e3('0x139')]['belongsToMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x30'),'hooks':!![]});db[_0xb8e3('0x139')][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'through':_0xb8e3('0x19d'),'as':'Teams'});db[_0xb8e3('0x125')]['hasMany'](db['ChatInternalMessage'],{'as':_0xb8e3('0x161'),'foreignKey':_0xb8e3('0x19e'),'onDelete':_0xb8e3('0x114')});db['ChatGroup'][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x19f'),'through':_0xb8e3('0x1a0')});db[_0xb8e3('0x197')]['belongsTo'](db['ChatWebsite'],{'as':_0xb8e3('0x1a1'),'foreignKey':_0xb8e3('0x17d')});db[_0xb8e3('0x1a2')][_0xb8e3('0x117')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x127'),'foreignKey':_0xb8e3('0x1a3')});db[_0xb8e3('0x72')]['hasMany'](db[_0xb8e3('0x8e')],{'as':_0xb8e3('0x1a4'),'foreignKey':_0xb8e3('0x1a5')});db[_0xb8e3('0x72')][_0xb8e3('0x117')](db[_0xb8e3('0x151')],{'as':_0xb8e3('0x121'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x72')][_0xb8e3('0x117')](db[_0xb8e3('0x74')],{'as':'HopperFinals','foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x72')]['hasMany'](db[_0xb8e3('0x152')],{'as':_0xb8e3('0x153'),'foreignKey':'ContactId'});db['CmContact'][_0xb8e3('0x117')](db[_0xb8e3('0x77')],{'as':_0xb8e3('0x77'),'foreignKey':_0xb8e3('0x167')});db['CmContact']['hasMany'](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0xb8e3('0x117')](db[_0xb8e3('0x130')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x72')][_0xb8e3('0x117')](db[_0xb8e3('0x69')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0xb8e3('0x117')](db[_0xb8e3('0x11e')],{'as':'SmsInteractions','foreignKey':_0xb8e3('0x167'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x72')][_0xb8e3('0x117')](db[_0xb8e3('0x51')],{'as':_0xb8e3('0x12c'),'foreignKey':_0xb8e3('0x167'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x72')][_0xb8e3('0x117')](db[_0xb8e3('0x45')],{'as':_0xb8e3('0x11f'),'foreignKey':_0xb8e3('0x167'),'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x72')][_0xb8e3('0x123')](db[_0xb8e3('0x1a2')],{'as':_0xb8e3('0x1a6'),'foreignKey':_0xb8e3('0x1a3')});db[_0xb8e3('0x72')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171'),'onDelete':_0xb8e3('0x114')});db['CmContact'][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x18e'),'through':'cm_user_has_contacts'});db[_0xb8e3('0x72')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'as':_0xb8e3('0x178'),'through':_0xb8e3('0x1a7')});db['CmContact'][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x1a7'),'as':_0xb8e3('0x179')});db[_0xb8e3('0x151')]['hasMany'](db[_0xb8e3('0x90')],{'as':_0xb8e3('0x1a8'),'foreignKey':_0xb8e3('0x1a9')});db[_0xb8e3('0x151')][_0xb8e3('0x123')](db['CmContact'],{'as':_0xb8e3('0x166'),'foreignKey':'ContactId','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x151')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':'ListId','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x151')]['belongsTo'](db[_0xb8e3('0x112')],{'as':'Agent','foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x151')][_0xb8e3('0x123')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x151')]['belongsTo'](db[_0xb8e3('0xe8')],{'as':_0xb8e3('0xe8'),'foreignKey':_0xb8e3('0x1aa'),'onDelete':'cascade'});db[_0xb8e3('0x151')]['belongsTo'](db['User'],{'as':_0xb8e3('0x188'),'foreignKey':'OwnerId'});db[_0xb8e3('0x154')][_0xb8e3('0x123')](db['CmContact'],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x154')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x154')][_0xb8e3('0x123')](db[_0xb8e3('0x1a')],{'as':_0xb8e3('0x199'),'foreignKey':_0xb8e3('0x150'),'onDelete':_0xb8e3('0x114')});db['CmHopperBlack']['belongsTo'](db[_0xb8e3('0xe8')],{'as':'Campaign','foreignKey':_0xb8e3('0x1aa'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x7c')]['hasMany'](db[_0xb8e3('0x80')],{'as':{'plural':'All','singular':_0xb8e3('0x1ab')},'foreignKey':_0xb8e3('0x1ac'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db['Automation'][_0xb8e3('0x117')](db[_0xb8e3('0x80')],{'as':{'plural':_0xb8e3('0x1ad'),'singular':'OneAny'},'foreignKey':_0xb8e3('0x1ae'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x7c')]['hasMany'](db[_0xb8e3('0x1af')],{'as':'Actions','foreignKey':_0xb8e3('0x1b0'),'onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x81')]['hasMany'](db[_0xb8e3('0x81')],{'as':_0xb8e3('0x1b1'),'foreignKey':_0xb8e3('0x15a'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0xb8e3('0x117')](db[_0xb8e3('0x119')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x81')]['hasMany'](db[_0xb8e3('0x48')],{'as':_0xb8e3('0x1b2'),'foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x81')][_0xb8e3('0x117')](db['ChatApplication'],{'as':_0xb8e3('0x1b3'),'foreignKey':_0xb8e3('0x15a')});db['Interval']['hasMany'](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x81')][_0xb8e3('0x117')](db[_0xb8e3('0x57')],{'as':_0xb8e3('0x1b4'),'foreignKey':_0xb8e3('0x15a')});db['Schedule'][_0xb8e3('0x123')](db[_0xb8e3('0x40')],{});db[_0xb8e3('0x87')][_0xb8e3('0x123')](db[_0xb8e3('0x1b5')],{'foreignKey':_0xb8e3('0x1b6')});db[_0xb8e3('0x87')][_0xb8e3('0x123')](db['AnalyticCustomReport'],{'foreignKey':_0xb8e3('0x1b7')});db['Sound']['belongsToMany'](db[_0xb8e3('0x19')],{'as':_0xb8e3('0x1b8'),'through':_0xb8e3('0x14f'),'onDelete':_0xb8e3('0x16a')});db['Tag']['belongsToMany'](db[_0xb8e3('0x72')],{'through':'cm_contact_has_tags'});db[_0xb8e3('0x176')]['belongsToMany'](db[_0xb8e3('0x69')],{'through':_0xb8e3('0x19c')});db[_0xb8e3('0x176')][_0xb8e3('0x128')](db[_0xb8e3('0x45')],{'through':_0xb8e3('0x177')});db[_0xb8e3('0x176')]['belongsToMany'](db[_0xb8e3('0x11e')],{'through':_0xb8e3('0x18d')});db['Tag'][_0xb8e3('0x128')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xb8e3('0x176')][_0xb8e3('0x128')](db['OpenchannelInteraction'],{'through':_0xb8e3('0x194')});db['Tag'][_0xb8e3('0x128')](db[_0xb8e3('0x102')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem'][_0xb8e3('0x123')](db[_0xb8e3('0x8c')],{'as':'ItemType','foreignKey':_0xb8e3('0x1b9')});db['CmHopperAdditionalPhone'][_0xb8e3('0x123')](db['CmHopper'],{'as':_0xb8e3('0x1ba'),'foreignKey':_0xb8e3('0x1a9')});db[_0xb8e3('0x8e')][_0xb8e3('0x123')](db['CmContact'],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x1a5')});db[_0xb8e3('0x93')][_0xb8e3('0x117')](db[_0xb8e3('0x80')],{'as':{'plural':_0xb8e3('0x1bb'),'singular':_0xb8e3('0x1bc')},'foreignKey':_0xb8e3('0x1bd'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x93')][_0xb8e3('0x117')](db[_0xb8e3('0x80')],{'as':{'plural':_0xb8e3('0x1be'),'singular':'AnyCondition'},'foreignKey':_0xb8e3('0x1bf'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x93')][_0xb8e3('0x117')](db[_0xb8e3('0x1af')],{'as':_0xb8e3('0x1c0'),'foreignKey':'TriggerId','onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x99')][_0xb8e3('0x117')](db[_0xb8e3('0x9e')],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1b7'),'hooks':!![]});db[_0xb8e3('0x1b5')][_0xb8e3('0x117')](db[_0xb8e3('0x9e')],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1b6')});db[_0xb8e3('0x9d')][_0xb8e3('0x117')](db[_0xb8e3('0x9e')],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':'MetricId'});db[_0xb8e3('0x9e')][_0xb8e3('0x123')](db[_0xb8e3('0x9d')],{'foreignKey':_0xb8e3('0x1c2')});db[_0xb8e3('0xa1')][_0xb8e3('0x117')](db['SalesforceConfiguration'],{'as':_0xb8e3('0x1c3'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xb8e3('0xa2')][_0xb8e3('0x117')](db[_0xb8e3('0xa3')],{'as':_0xb8e3('0x1c4'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0xa2')][_0xb8e3('0x117')](db[_0xb8e3('0xa3')],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xa2')][_0xb8e3('0x117')](db['SalesforceField'],{'as':_0xb8e3('0x1c1'),'onDelete':'cascade','foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xa2')][_0xb8e3('0x123')](db[_0xb8e3('0xa1')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xa3')]['hasMany'](db['SalesforceField'],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0xa3')][_0xb8e3('0x117')](db[_0xb8e3('0xa3')],{'as':'Description','foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xa3')]['hasMany'](db[_0xb8e3('0xa3')],{'as':'Field','foreignKey':'FieldId'});db['SalesforceField']['belongsTo'](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':'VariableId'});db[_0xb8e3('0xa5')][_0xb8e3('0x117')](db[_0xb8e3('0xa7')],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xa7')][_0xb8e3('0x117')](db[_0xb8e3('0xa9')],{'as':_0xb8e3('0x1c4'),'onDelete':_0xb8e3('0x114'),'foreignKey':'SubjectId'});db[_0xb8e3('0xa7')][_0xb8e3('0x117')](db[_0xb8e3('0xa9')],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xa7')]['hasMany'](db[_0xb8e3('0xa9')],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c8')});db['SugarcrmConfiguration'][_0xb8e3('0x123')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xa9')][_0xb8e3('0x117')](db[_0xb8e3('0xa9')],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db['SugarcrmField'][_0xb8e3('0x117')](db[_0xb8e3('0xa9')],{'as':'Description','foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xa9')][_0xb8e3('0x117')](db[_0xb8e3('0xa9')],{'as':_0xb8e3('0x1cb'),'foreignKey':'FieldId'});db[_0xb8e3('0xa9')][_0xb8e3('0x123')](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':'VariableId'});db[_0xb8e3('0x1cc')][_0xb8e3('0x117')](db['DeskConfiguration'],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0x1cd')][_0xb8e3('0x117')](db['DeskField'],{'as':_0xb8e3('0x1c4'),'onDelete':'cascade','foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0x1cd')][_0xb8e3('0x117')](db['DeskField'],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0x1cd')][_0xb8e3('0x117')](db[_0xb8e3('0x1ce')],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c8')});db['DeskConfiguration'][_0xb8e3('0x123')](db[_0xb8e3('0x1cc')],{'as':_0xb8e3('0x187'),'foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x1cf')});db[_0xb8e3('0x1ce')][_0xb8e3('0x117')](db['DeskField'],{'as':_0xb8e3('0x1ca'),'foreignKey':'SubjectId'});db[_0xb8e3('0x1ce')][_0xb8e3('0x117')](db['DeskField'],{'as':'Description','foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0x1ce')][_0xb8e3('0x117')](db[_0xb8e3('0x1ce')],{'as':'Field','foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0x1ce')]['belongsTo'](db[_0xb8e3('0x95')],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount']['hasMany'](db['ZohoConfiguration'],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c9')});db['ZohoConfiguration'][_0xb8e3('0x117')](db[_0xb8e3('0xae')],{'as':_0xb8e3('0x1c4'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0x1d0')][_0xb8e3('0x117')](db[_0xb8e3('0xae')],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0x1d0')][_0xb8e3('0x117')](db[_0xb8e3('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['ZohoConfiguration']['belongsTo'](db[_0xb8e3('0xab')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xae')][_0xb8e3('0x117')](db[_0xb8e3('0xae')],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0xae')][_0xb8e3('0x117')](db['ZohoField'],{'as':_0xb8e3('0x1d1'),'foreignKey':'DescriptionId'});db['ZohoField']['hasMany'](db[_0xb8e3('0xae')],{'as':'Field','foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xae')][_0xb8e3('0x123')](db['Variable'],{'as':_0xb8e3('0x95'),'foreignKey':_0xb8e3('0x1d2')});db['ZendeskAccount']['hasMany'](db[_0xb8e3('0xb1')],{'as':'Configurations','onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xb1')][_0xb8e3('0x117')](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1c4'),'foreignKey':_0xb8e3('0x1c5')});db['ZendeskConfiguration']['hasMany'](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1c6'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xb1')][_0xb8e3('0x117')](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1c1'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xb1')][_0xb8e3('0x123')](db[_0xb8e3('0x1d4')],{'as':_0xb8e3('0x187'),'foreignKey':'AccountId'});db[_0xb8e3('0xb1')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x1d5')});db[_0xb8e3('0x1d3')][_0xb8e3('0x117')](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0x1d3')][_0xb8e3('0x117')](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1d1'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0x1d3')][_0xb8e3('0x117')](db[_0xb8e3('0x1d3')],{'as':_0xb8e3('0x1cb'),'foreignKey':'FieldId'});db[_0xb8e3('0x1d3')][_0xb8e3('0x123')](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':_0xb8e3('0x1d2')});db['FreshdeskAccount']['hasMany'](db['FreshdeskConfiguration'],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':'AccountId'});db[_0xb8e3('0xb5')][_0xb8e3('0x117')](db[_0xb8e3('0xb7')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xb8e3('0x117')](db[_0xb8e3('0xb7')],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xb8e3('0x117')](db[_0xb8e3('0xb7')],{'as':'Fields','onDelete':_0xb8e3('0x114'),'foreignKey':'FieldId'});db[_0xb8e3('0xb5')]['belongsTo'](db['FreshdeskAccount'],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xb5')][_0xb8e3('0x128')](db['Tag'],{'through':_0xb8e3('0x1d6')});db[_0xb8e3('0xb7')][_0xb8e3('0x117')](db[_0xb8e3('0xb7')],{'as':_0xb8e3('0x1ca'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0xb8e3('0xb7')],{'as':_0xb8e3('0x1d1'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xb7')][_0xb8e3('0x117')](db['FreshdeskField'],{'as':_0xb8e3('0x1cb'),'foreignKey':'FieldId'});db['FreshdeskField']['belongsTo'](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':_0xb8e3('0x1d2')});db[_0xb8e3('0xb8')][_0xb8e3('0x117')](db[_0xb8e3('0xba')],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0xb8e3('0x117')](db[_0xb8e3('0xbb')],{'as':_0xb8e3('0x1c4'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0xba')][_0xb8e3('0x117')](db[_0xb8e3('0xbb')],{'as':'Descriptions','foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xba')][_0xb8e3('0x117')](db[_0xb8e3('0xbb')],{'as':'Fields','foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xba')][_0xb8e3('0x123')](db[_0xb8e3('0xb8')],{'as':'Account','foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xbb')]['hasMany'](db['VtigerField'],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db['VtigerField']['hasMany'](db[_0xb8e3('0xbb')],{'as':_0xb8e3('0x1d1'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xbb')][_0xb8e3('0x117')](db['VtigerField'],{'as':_0xb8e3('0x1cb'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xbb')][_0xb8e3('0x123')](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':'VariableId'});db[_0xb8e3('0xbd')][_0xb8e3('0x117')](db[_0xb8e3('0xbf')],{'as':_0xb8e3('0x1c3'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xb8e3('0x117')](db[_0xb8e3('0x1d7')],{'as':'Subjects','foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0xbf')]['hasMany'](db[_0xb8e3('0x1d7')],{'as':_0xb8e3('0x1c6'),'foreignKey':_0xb8e3('0x1c7')});db['ServicenowConfiguration'][_0xb8e3('0x117')](db['ServicenowField'],{'as':_0xb8e3('0x1c1'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xbf')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xb8e3('0x1c9')});db['ServicenowField'][_0xb8e3('0x117')](db[_0xb8e3('0x1d7')],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db['ServicenowField'][_0xb8e3('0x117')](db[_0xb8e3('0x1d7')],{'as':_0xb8e3('0x1d1'),'foreignKey':'DescriptionId'});db[_0xb8e3('0x1d7')]['hasMany'](db[_0xb8e3('0x1d7')],{'as':_0xb8e3('0x1cb'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0x1d7')][_0xb8e3('0x123')](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':_0xb8e3('0x1d2')});db[_0xb8e3('0xc2')]['hasMany'](db[_0xb8e3('0x1d8')],{'as':_0xb8e3('0x1c3'),'onDelete':_0xb8e3('0x114'),'foreignKey':'AccountId'});db[_0xb8e3('0xc2')][_0xb8e3('0x123')](db[_0xb8e3('0x108')],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db[_0xb8e3('0x1d8')][_0xb8e3('0x117')](db[_0xb8e3('0xc4')],{'as':_0xb8e3('0x1c4'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c5')});db[_0xb8e3('0x1d8')][_0xb8e3('0x117')](db[_0xb8e3('0xc4')],{'as':_0xb8e3('0x1c6'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0x1d8')][_0xb8e3('0x117')](db['Dynamics365Field'],{'as':_0xb8e3('0x1c1'),'onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0x1d8')][_0xb8e3('0x123')](db[_0xb8e3('0xc2')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x1c9')});db[_0xb8e3('0xc4')][_0xb8e3('0x117')](db[_0xb8e3('0xc4')],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db['Dynamics365Field'][_0xb8e3('0x117')](db['Dynamics365Field'],{'as':_0xb8e3('0x1d1'),'foreignKey':_0xb8e3('0x1c7')});db['Dynamics365Field'][_0xb8e3('0x117')](db[_0xb8e3('0xc4')],{'as':_0xb8e3('0x1cb'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xc4')][_0xb8e3('0x123')](db['Variable'],{'as':_0xb8e3('0x95'),'foreignKey':'VariableId'});db[_0xb8e3('0xc6')][_0xb8e3('0x117')](db[_0xb8e3('0xc8')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xb8e3('0xc8')][_0xb8e3('0x117')](db[_0xb8e3('0xc9')],{'as':_0xb8e3('0x1c4'),'foreignKey':'SubjectId'});db[_0xb8e3('0xc8')]['hasMany'](db['FreshsalesField'],{'as':_0xb8e3('0x1c6'),'foreignKey':_0xb8e3('0x1c7')});db[_0xb8e3('0xc8')][_0xb8e3('0x117')](db['FreshsalesField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xb8e3('0xc8')][_0xb8e3('0x123')](db[_0xb8e3('0xc6')],{'as':_0xb8e3('0x187'),'foreignKey':'AccountId'});db['FreshsalesField'][_0xb8e3('0x117')](db['FreshsalesField'],{'as':_0xb8e3('0x1ca'),'foreignKey':_0xb8e3('0x1c5')});db['FreshsalesField'][_0xb8e3('0x117')](db[_0xb8e3('0xc9')],{'as':_0xb8e3('0x1d1'),'foreignKey':'DescriptionId'});db[_0xb8e3('0xc9')]['hasMany'](db[_0xb8e3('0xc9')],{'as':_0xb8e3('0x1cb'),'foreignKey':_0xb8e3('0x1c8')});db[_0xb8e3('0xc9')][_0xb8e3('0x123')](db[_0xb8e3('0x95')],{'as':_0xb8e3('0x95'),'foreignKey':_0xb8e3('0x1d2')});db[_0xb8e3('0xcc')][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{});db[_0xb8e3('0xcc')][_0xb8e3('0x123')](db['CmList'],{'as':_0xb8e3('0x170'),'foreignKey':'ListId'});db[_0xb8e3('0xcc')][_0xb8e3('0x123')](db['CmContact'],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0xcc')][_0xb8e3('0x123')](db[_0xb8e3('0x69')],{});db[_0xb8e3('0xcc')]['belongsTo'](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db[_0xb8e3('0x112')],{});db[_0xb8e3('0xcc')][_0xb8e3('0x123')](db[_0xb8e3('0x139')],{});db[_0xb8e3('0xce')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x114'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0xb8e3('0x112')],{'onDelete':_0xb8e3('0x114'),'foreignKey':'ToId'});db[_0xb8e3('0xd3')][_0xb8e3('0x117')](db[_0xb8e3('0xd1')],{'foreignKey':_0xb8e3('0x1d9'),'onDelete':_0xb8e3('0x114')});db['JscriptySessionReport'][_0xb8e3('0x117')](db[_0xb8e3('0xcf')],{'foreignKey':_0xb8e3('0x1d9'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0xd5')]['belongsTo'](db[_0xb8e3('0x55')],{});db[_0xb8e3('0xd5')]['belongsTo'](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':'ListId'});db[_0xb8e3('0xd5')][_0xb8e3('0x123')](db['CmContact'],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0xd5')][_0xb8e3('0x123')](db[_0xb8e3('0x11e')],{});db[_0xb8e3('0xd5')]['belongsTo'](db[_0xb8e3('0x5a')],{});db[_0xb8e3('0xd5')][_0xb8e3('0x123')](db['User'],{});db[_0xb8e3('0xd5')][_0xb8e3('0x123')](db['SmsQueue'],{});db['JscriptyProject'][_0xb8e3('0x117')](db[_0xb8e3('0xd3')],{'foreignKey':_0xb8e3('0x1da')});db[_0xb8e3('0xda')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xb8e3('0xda')][_0xb8e3('0x117')](db[_0xb8e3('0xcf')],{'foreignKey':_0xb8e3('0x1da')});db[_0xb8e3('0xe4')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':'user_has_teams'});db[_0xb8e3('0xe4')]['belongsToMany'](db['VoiceQueue'],{'through':_0xb8e3('0x10a'),'as':_0xb8e3('0x133')});db[_0xb8e3('0xe4')]['belongsToMany'](db[_0xb8e3('0x137')],{'through':_0xb8e3('0x174'),'as':_0xb8e3('0x138')});db[_0xb8e3('0xe4')]['belongsToMany'](db[_0xb8e3('0x139')],{'through':_0xb8e3('0x19d'),'as':'ChatQueues'});db[_0xb8e3('0xe4')][_0xb8e3('0x128')](db['FaxQueue'],{'through':_0xb8e3('0x18b'),'as':_0xb8e3('0x13b')});db[_0xb8e3('0xe4')]['belongsToMany'](db[_0xb8e3('0x5c')],{'through':'team_has_sms_queues','as':_0xb8e3('0x13c')});db['Team'][_0xb8e3('0x128')](db[_0xb8e3('0x62')],{'through':_0xb8e3('0x1db'),'as':'OpenchannelQueues'});db[_0xb8e3('0xe4')][_0xb8e3('0x128')](db[_0xb8e3('0x1dc')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xb8e3('0xe4')][_0xb8e3('0x128')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xb8e3('0x136')});db[_0xb8e3('0xe8')][_0xb8e3('0x117')](db[_0xb8e3('0x151')],{'as':_0xb8e3('0x121'),'foreignKey':_0xb8e3('0x1aa')});db[_0xb8e3('0xe8')][_0xb8e3('0x117')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'CampaignId'});db['Campaign'][_0xb8e3('0x117')](db[_0xb8e3('0x152')],{'as':_0xb8e3('0x153'),'foreignKey':_0xb8e3('0x1aa')});db['Campaign'][_0xb8e3('0x117')](db[_0xb8e3('0x154')],{'as':_0xb8e3('0x155'),'foreignKey':_0xb8e3('0x1aa')});db[_0xb8e3('0xe8')][_0xb8e3('0x123')](db[_0xb8e3('0x157')],{'as':'Trunk','foreignKey':_0xb8e3('0x1dd')});db[_0xb8e3('0xe8')]['belongsTo'](db['Trunk'],{'as':_0xb8e3('0x158'),'foreignKey':_0xb8e3('0x159')});db[_0xb8e3('0xe8')][_0xb8e3('0x123')](db[_0xb8e3('0x81')],{'as':'Interval','foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0xe8')]['belongsTo'](db[_0xb8e3('0xde')],{'as':'SquareProject','foreignKey':_0xb8e3('0x1de')});db['Campaign'][_0xb8e3('0x128')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x15d'),'through':_0xb8e3('0x1df')});db[_0xb8e3('0xe8')]['belongsToMany'](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x15f'),'through':_0xb8e3('0x1e0')});db[_0xb8e3('0xec')]['belongsTo'](db[_0xb8e3('0x6d')],{'as':_0xb8e3('0x6d'),'foreignKey':_0xb8e3('0x17e')});db[_0xb8e3('0xef')][_0xb8e3('0x123')](db[_0xb8e3('0x46')],{});db[_0xb8e3('0xef')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x40')],{'foreignKey':_0xb8e3('0x1e1'),'as':_0xb8e3('0x1e2')});db['MailTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1e3'),'as':_0xb8e3('0x1e4')});db[_0xb8e3('0xef')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':'ToUserId','as':_0xb8e3('0x1e5')});db[_0xb8e3('0xef')][_0xb8e3('0x123')](db[_0xb8e3('0x137')],{'foreignKey':_0xb8e3('0x1e6'),'as':_0xb8e3('0x1e7')});db[_0xb8e3('0xef')][_0xb8e3('0x123')](db['MailAccount'],{'foreignKey':_0xb8e3('0x1e8'),'as':_0xb8e3('0x1e9')});db[_0xb8e3('0x1ea')]['belongsTo'](db[_0xb8e3('0x6b')],{});db[_0xb8e3('0x1ea')][_0xb8e3('0x123')](db[_0xb8e3('0x69')],{});db[_0xb8e3('0x1ea')][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{'foreignKey':_0xb8e3('0x1eb'),'as':'FromAccount'});db[_0xb8e3('0x1ea')][_0xb8e3('0x123')](db['User'],{'foreignKey':'FromUserId','as':_0xb8e3('0x1e4')});db[_0xb8e3('0x1ea')]['belongsTo'](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1ec'),'as':_0xb8e3('0x1e5')});db[_0xb8e3('0x1ea')]['belongsTo'](db[_0xb8e3('0x139')],{'foreignKey':_0xb8e3('0x1ed'),'as':'ToQueue'});db['ChatTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x64')],{'foreignKey':_0xb8e3('0x1ee'),'as':_0xb8e3('0x1e9')});db['FaxTransferReport']['belongsTo'](db[_0xb8e3('0x185')],{});db[_0xb8e3('0xf2')][_0xb8e3('0x123')](db[_0xb8e3('0x51')],{});db[_0xb8e3('0xf2')]['belongsTo'](db[_0xb8e3('0x4e')],{'foreignKey':_0xb8e3('0x1ef'),'as':_0xb8e3('0x1e2')});db[_0xb8e3('0xf2')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1e3'),'as':_0xb8e3('0x1e4')});db[_0xb8e3('0xf2')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1ec'),'as':_0xb8e3('0x1e5')});db[_0xb8e3('0xf2')]['belongsTo'](db[_0xb8e3('0x52')],{'foreignKey':_0xb8e3('0x1f0'),'as':'ToQueue'});db[_0xb8e3('0xf2')][_0xb8e3('0x123')](db[_0xb8e3('0x4e')],{'foreignKey':_0xb8e3('0x1f1'),'as':'ToAccount'});db[_0xb8e3('0xf3')][_0xb8e3('0x123')](db[_0xb8e3('0x60')],{});db['OpenchannelTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x130')],{});db[_0xb8e3('0xf3')]['belongsTo'](db[_0xb8e3('0x145')],{'foreignKey':'FromOpenchannelAccountId','as':_0xb8e3('0x1e2')});db[_0xb8e3('0xf3')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1e3'),'as':_0xb8e3('0x1e4')});db[_0xb8e3('0xf3')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1ec'),'as':'ToAgent'});db[_0xb8e3('0xf3')]['belongsTo'](db[_0xb8e3('0x62')],{'foreignKey':_0xb8e3('0x1f2'),'as':'ToQueue'});db[_0xb8e3('0xf3')][_0xb8e3('0x123')](db[_0xb8e3('0x145')],{'foreignKey':_0xb8e3('0x1f3'),'as':_0xb8e3('0x1e9')});db[_0xb8e3('0xf5')][_0xb8e3('0x123')](db[_0xb8e3('0x5a')],{});db[_0xb8e3('0xf5')][_0xb8e3('0x123')](db[_0xb8e3('0x11e')],{});db['SmsTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x55')],{'foreignKey':_0xb8e3('0x1f4'),'as':_0xb8e3('0x1e2')});db[_0xb8e3('0xf5')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1e3'),'as':'FromAgent'});db[_0xb8e3('0xf5')]['belongsTo'](db[_0xb8e3('0x112')],{'foreignKey':'ToUserId','as':_0xb8e3('0x1e5')});db[_0xb8e3('0xf5')][_0xb8e3('0x123')](db[_0xb8e3('0x5c')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport']['belongsTo'](db[_0xb8e3('0x55')],{'foreignKey':_0xb8e3('0x1f5'),'as':_0xb8e3('0x1e9')});db[_0xb8e3('0x129')][_0xb8e3('0x117')](db[_0xb8e3('0x16d')],{'as':'Dispositions','foreignKey':_0xb8e3('0x171'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x129')]['hasMany'](db[_0xb8e3('0x79')],{'as':_0xb8e3('0x1f6'),'foreignKey':'ListId'});db['CmList'][_0xb8e3('0x117')](db['CmContact'],{'as':'Contacts','onDelete':_0xb8e3('0x114'),'foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x129')][_0xb8e3('0x117')](db[_0xb8e3('0x74')],{'as':_0xb8e3('0x11b'),'foreignKey':'ListId'});db[_0xb8e3('0x129')][_0xb8e3('0x117')](db[_0xb8e3('0x152')],{'as':_0xb8e3('0x1f7'),'foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x129')][_0xb8e3('0x117')](db[_0xb8e3('0x77')],{'as':_0xb8e3('0x77'),'foreignKey':'ListId'});db[_0xb8e3('0x129')][_0xb8e3('0x128')](db[_0xb8e3('0x1a')],{'as':'Queues','through':_0xb8e3('0x1f8')});db[_0xb8e3('0x129')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':_0xb8e3('0x13e')});db[_0xb8e3('0x135')][_0xb8e3('0x117')](db[_0xb8e3('0x119')],{'as':_0xb8e3('0x11a'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0x135')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':'UserVoicePrefix'});db['VoicePrefix']['belongsToMany'](db[_0xb8e3('0xe4')],{'through':_0xb8e3('0x10c'),'as':_0xb8e3('0x175')});db[_0xb8e3('0xf7')]['hasMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x18e'),'foreignKey':_0xb8e3('0x124')});db[_0xb8e3('0xf7')]['hasMany'](db['UserProfileSection'],{'as':_0xb8e3('0x1f9'),'foreignKey':_0xb8e3('0x124'),'onDelete':_0xb8e3('0x114')});db[_0xb8e3('0xf9')][_0xb8e3('0x117')](db[_0xb8e3('0xfb')],{'as':_0xb8e3('0x1fa'),'foreignKey':_0xb8e3('0x1fb'),'onDelete':'cascade'});db[_0xb8e3('0xfe')][_0xb8e3('0x117')](db[_0xb8e3('0x16d')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':_0xb8e3('0x114')});db[_0xb8e3('0xfe')]['hasMany'](db[_0xb8e3('0x16e')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xb8e3('0x117')](db['WhatsappMessage'],{'as':_0xb8e3('0x161'),'foreignKey':_0xb8e3('0x1fc')});db[_0xb8e3('0xfe')][_0xb8e3('0x117')](db[_0xb8e3('0x102')],{'as':_0xb8e3('0x183')});db['WhatsappAccount']['hasMany'](db[_0xb8e3('0x100')],{'as':_0xb8e3('0x14d'),'foreignKey':_0xb8e3('0x1fc'),'onDelete':_0xb8e3('0x114')});db['WhatsappAccount'][_0xb8e3('0x123')](db['CmList'],{'as':_0xb8e3('0x170'),'foreignKey':'ListId'});db[_0xb8e3('0xfe')][_0xb8e3('0x123')](db[_0xb8e3('0x173')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xb8e3('0xfe')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x15e'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0xb8e3('0x123')](db['User'],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x100')][_0xb8e3('0x123')](db[_0xb8e3('0x1dc')],{'onDelete':_0xb8e3('0x16a')});db[_0xb8e3('0x100')][_0xb8e3('0x123')](db[_0xb8e3('0xfe')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xb8e3('0x15a')});db[_0xb8e3('0x100')][_0xb8e3('0x123')](db['Tag'],{'onDelete':_0xb8e3('0x16a'),'foreignKey':'TagId'});db[_0xb8e3('0x102')][_0xb8e3('0x117')](db[_0xb8e3('0x1fd')],{'as':_0xb8e3('0x161'),'onDelete':_0xb8e3('0x114'),'foreignKey':'WhatsappInteractionId'});db[_0xb8e3('0x102')][_0xb8e3('0x123')](db['WhatsappAccount'],{'as':_0xb8e3('0x187'),'foreignKey':'WhatsappAccountId'});db[_0xb8e3('0x102')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x102')][_0xb8e3('0x123')](db['User'],{'as':_0xb8e3('0x188'),'foreignKey':_0xb8e3('0x115')});db[_0xb8e3('0x102')]['belongsToMany'](db[_0xb8e3('0x176')],{'through':_0xb8e3('0x1fe'),'as':'Tags'});db[_0xb8e3('0x102')][_0xb8e3('0x128')](db[_0xb8e3('0x176')],{'through':'whatsapp_interaction_has_tags','as':_0xb8e3('0x179')});db['WhatsappInteraction']['belongsToMany'](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x18e'),'through':'user_has_whatsapp_interactions','foreignKey':_0xb8e3('0x1ff')});db[_0xb8e3('0x1fd')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x112')});db[_0xb8e3('0x1fd')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x166')});db['WhatsappMessage'][_0xb8e3('0x123')](db[_0xb8e3('0x102')],{'onDelete':_0xb8e3('0x114'),'as':_0xb8e3('0x17c'),'foreignKey':_0xb8e3('0x1ff')});db[_0xb8e3('0x1fd')][_0xb8e3('0x123')](db[_0xb8e3('0xfe')],{'as':_0xb8e3('0x187'),'foreignKey':_0xb8e3('0x1fc')});db['WhatsappQueueReport'][_0xb8e3('0x123')](db['WhatsappAccount'],{});db[_0xb8e3('0x200')][_0xb8e3('0x123')](db[_0xb8e3('0x129')],{'as':_0xb8e3('0x170'),'foreignKey':_0xb8e3('0x171')});db[_0xb8e3('0x200')][_0xb8e3('0x123')](db[_0xb8e3('0x72')],{'as':_0xb8e3('0x166'),'foreignKey':_0xb8e3('0x167')});db[_0xb8e3('0x200')]['belongsTo'](db[_0xb8e3('0x102')],{});db['WhatsappQueueReport'][_0xb8e3('0x123')](db[_0xb8e3('0x1dc')],{});db[_0xb8e3('0x200')][_0xb8e3('0x123')](db[_0xb8e3('0x1fd')],{});db[_0xb8e3('0x200')]['belongsTo'](db[_0xb8e3('0x112')],{});db[_0xb8e3('0x106')]['belongsTo'](db[_0xb8e3('0x1fd')],{});db[_0xb8e3('0x106')][_0xb8e3('0x123')](db['WhatsappInteraction'],{});db[_0xb8e3('0x106')][_0xb8e3('0x123')](db['WhatsappAccount'],{'foreignKey':_0xb8e3('0x201'),'as':_0xb8e3('0x1e2')});db['WhatsappTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0xfe')],{'foreignKey':_0xb8e3('0x202'),'as':_0xb8e3('0x1e9')});db['WhatsappTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x1dc')],{'foreignKey':_0xb8e3('0x203'),'as':_0xb8e3('0x1e7')});db['WhatsappTransferReport'][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1e3'),'as':_0xb8e3('0x1e4')});db[_0xb8e3('0x106')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'foreignKey':_0xb8e3('0x1ec'),'as':_0xb8e3('0x1e5')});db[_0xb8e3('0x1dc')][_0xb8e3('0x128')](db[_0xb8e3('0x112')],{'as':'Agents','through':_0xb8e3('0x3a'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0xb8e3('0x128')](db[_0xb8e3('0xe4')],{'through':'team_has_whatsapp_queues','as':_0xb8e3('0x175')});db[_0xb8e3('0x10f')][_0xb8e3('0x123')](db[_0xb8e3('0x112')],{'as':_0xb8e3('0x204'),'foreignKey':_0xb8e3('0x115'),'onDelete':_0xb8e3('0x114'),'hooks':!![]});db[_0xb8e3('0x108')][_0xb8e3('0x113')](db[_0xb8e3('0xc2')],{'as':_0xb8e3('0xc2'),'onDelete':'restrict'});db[_0xb8e3('0x108')][_0xb8e3('0x113')](db[_0xb8e3('0x3c')],{'as':_0xb8e3('0x16b'),'onDelete':_0xb8e3('0x16a')});db['CloudProvider']['hasOne'](db[_0xb8e3('0x3e')],{'as':_0xb8e3('0x16c'),'onDelete':_0xb8e3('0x16a')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0dcbd7e..cbde315 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d0b=['/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/system','./api/system','/api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','route','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','./api/cmContact','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./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/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account'];(function(_0xdab413,_0x373924){var _0x10b733=function(_0x5b74a6){while(--_0x5b74a6){_0xdab413['push'](_0xdab413['shift']());}};_0x10b733(++_0x373924);}(_0x4d0b,0x67));var _0xb4d0=function(_0xb5af48,_0x79f239){_0xb5af48=_0xb5af48-0x0;var _0x3462b2=_0x4d0b[_0xb5af48];return _0x3462b2;};'use strict';var path=require(_0xb4d0('0x0'));var express=require(_0xb4d0('0x1'));var errors=require(_0xb4d0('0x2'));var config=require(_0xb4d0('0x3'));var setupLoggers=require(_0xb4d0('0x4'))[_0xb4d0('0x5')];var clientSideLogs=require(_0xb4d0('0x6'));exports[_0xb4d0('0x7')]=function(_0x29c082){return setupLoggers(_0x29c082)[_0xb4d0('0x8')](function(){_0x29c082['use'](_0xb4d0('0x9'),require(_0xb4d0('0xa')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xc'),require('./api/voiceChanSpy'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd'),require(_0xb4d0('0xe')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf'),require(_0xb4d0('0x10')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x11'),require(_0xb4d0('0x12')));_0x29c082[_0xb4d0('0xb')]('/api/voice/queues',require(_0xb4d0('0x13')));_0x29c082['use']('/api/voice/recordings',require(_0xb4d0('0x14')));_0x29c082[_0xb4d0('0xb')]('/api/screen/recordings',require('./api/screenRecording'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x15'),require(_0xb4d0('0x16')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x17'),require(_0xb4d0('0x18')));_0x29c082['use'](_0xb4d0('0x19'),require(_0xb4d0('0x1a')));_0x29c082[_0xb4d0('0xb')]('/api/voice/dials/reports',require(_0xb4d0('0x1b')));_0x29c082['use'](_0xb4d0('0x1c'),require(_0xb4d0('0x1d')));_0x29c082[_0xb4d0('0xb')]('/api/voice/queues/reports',require(_0xb4d0('0x1e')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x1f'),require(_0xb4d0('0x20')));_0x29c082['use']('/api/trunks',require(_0xb4d0('0x21')));_0x29c082[_0xb4d0('0xb')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x22'),require('./api/mailServerOut'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x23'),require('./api/mailAccount'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x24'),require('./api/mailQueue'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x25'),require(_0xb4d0('0x26')));_0x29c082['use']('/api/mail/interactions',require(_0xb4d0('0x27')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x28'),require('./api/mailMessage'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x29'),require(_0xb4d0('0x2a')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x2b'),require(_0xb4d0('0x2c')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x2d'),require(_0xb4d0('0x2e')));_0x29c082[_0xb4d0('0xb')]('/api/dashboards/items',require(_0xb4d0('0x2f')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x30'),require(_0xb4d0('0x31')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x32'),require('./api/faxApplication'));_0x29c082[_0xb4d0('0xb')]('/api/fax/interactions',require(_0xb4d0('0x33')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x34'),require(_0xb4d0('0x35')));_0x29c082[_0xb4d0('0xb')]('/api/fax/queues',require(_0xb4d0('0x36')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x37'),require(_0xb4d0('0x38')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x39'),require(_0xb4d0('0x3a')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x3b'),require('./api/smsApplication'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x3c'),require(_0xb4d0('0x3d')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x3e'),require(_0xb4d0('0x3f')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x40'),require(_0xb4d0('0x41')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x42'),require(_0xb4d0('0x43')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x44'),require(_0xb4d0('0x45')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x46'),require(_0xb4d0('0x47')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x48'),require(_0xb4d0('0x49')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x4a'),require('./api/openchannelQueue'));_0x29c082['use'](_0xb4d0('0x4b'),require(_0xb4d0('0x4c')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x4d'),require('./api/openchannelQueueReport'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x4e'),require('./api/chatApplication'));_0x29c082['use'](_0xb4d0('0x4f'),require(_0xb4d0('0x50')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x51'),require('./api/chatMessage'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x52'),require(_0xb4d0('0x53')));_0x29c082['use'](_0xb4d0('0x54'),require(_0xb4d0('0x55')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x56'),require('./api/chatGroup'));_0x29c082['use'](_0xb4d0('0x57'),require('./api/chatProactiveAction'));_0x29c082[_0xb4d0('0xb')]('/api/cm/companies',require(_0xb4d0('0x58')));_0x29c082['use']('/api/cm/contacts',require(_0xb4d0('0x59')));_0x29c082[_0xb4d0('0xb')]('/api/cm/hopper',require('./api/cmHopper'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x5a'),require('./api/cmHopperBlack'));_0x29c082[_0xb4d0('0xb')]('/api/cm/hopper_final',require(_0xb4d0('0x5b')));_0x29c082['use'](_0xb4d0('0x5c'),require(_0xb4d0('0x5d')));_0x29c082[_0xb4d0('0xb')]('/api/cm/custom_fields',require(_0xb4d0('0x5e')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x5f'),require(_0xb4d0('0x60')));_0x29c082['use'](_0xb4d0('0x61'),require(_0xb4d0('0x62')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x63'),require(_0xb4d0('0x64')));_0x29c082[_0xb4d0('0xb')]('/api/dispositions',require('./api/disposition'));_0x29c082[_0xb4d0('0xb')]('/api/conditions',require(_0xb4d0('0x65')));_0x29c082['use'](_0xb4d0('0x66'),require(_0xb4d0('0x67')));_0x29c082['use'](_0xb4d0('0x68'),require('./api/pause'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x69'),require(_0xb4d0('0x6a')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x6b'),require(_0xb4d0('0x6c')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x6d'),require(_0xb4d0('0x6e')));_0x29c082[_0xb4d0('0xb')]('/api/sounds',require(_0xb4d0('0x6f')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x70'),require(_0xb4d0('0x71')));_0x29c082[_0xb4d0('0xb')]('/api/contact_item_types',require(_0xb4d0('0x72')));_0x29c082['use'](_0xb4d0('0x73'),require(_0xb4d0('0x74')));_0x29c082['use'](_0xb4d0('0x75'),require(_0xb4d0('0x76')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x77'),require(_0xb4d0('0x78')));_0x29c082[_0xb4d0('0xb')]('/api/triggers',require('./api/trigger'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x79'),require('./api/variable'));_0x29c082['use'](_0xb4d0('0x7a'),require(_0xb4d0('0x7b')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x7c'),require(_0xb4d0('0x7d')));_0x29c082['use'](_0xb4d0('0x7e'),require(_0xb4d0('0x7f')));_0x29c082['use'](_0xb4d0('0x80'),require('./api/analyticDefaultReport'));_0x29c082['use'](_0xb4d0('0x81'),require('./api/analyticExtractedReport'));_0x29c082[_0xb4d0('0xb')]('/api/analytics/metrics',require(_0xb4d0('0x82')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x83'),require(_0xb4d0('0x84')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x85'),require(_0xb4d0('0x86')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x87'),require('./api/intSalesforceAccount'));_0x29c082['use']('/api/integrations/salesforce/configurations',require(_0xb4d0('0x88')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x89'),require(_0xb4d0('0x8a')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x8b'),require(_0xb4d0('0x8c')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x8d'),require(_0xb4d0('0x8e')));_0x29c082[_0xb4d0('0xb')]('/api/integrations/sugarcrm/fields',require(_0xb4d0('0x8f')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x90'),require('./api/intDeskAccount'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x91'),require(_0xb4d0('0x92')));_0x29c082[_0xb4d0('0xb')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x29c082[_0xb4d0('0xb')]('/api/integrations/zoho/accounts',require(_0xb4d0('0x93')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x94'),require(_0xb4d0('0x95')));_0x29c082[_0xb4d0('0xb')]('/api/integrations/zoho/fields',require(_0xb4d0('0x96')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x97'),require('./api/intZendeskAccount'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x98'),require('./api/intZendeskConfiguration'));_0x29c082['use'](_0xb4d0('0x99'),require('./api/intZendeskField'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x9a'),require('./api/intFreshdeskAccount'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x9b'),require('./api/intFreshdeskConfiguration'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x9c'),require(_0xb4d0('0x9d')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x9e'),require(_0xb4d0('0x9f')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xa0'),require(_0xb4d0('0xa1')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xa2'),require(_0xb4d0('0xa3')));_0x29c082['use'](_0xb4d0('0xa4'),require(_0xb4d0('0xa5')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xa6'),require(_0xb4d0('0xa7')));_0x29c082['use'](_0xb4d0('0xa8'),require(_0xb4d0('0xa9')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xaa'),require(_0xb4d0('0xab')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xac'),require(_0xb4d0('0xad')));_0x29c082['use'](_0xb4d0('0xae'),require(_0xb4d0('0xaf')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xb0'),require(_0xb4d0('0xb1')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xb2'),require(_0xb4d0('0xb3')));_0x29c082['use']('/api/integrations/freshsales/fields',require(_0xb4d0('0xb4')));_0x29c082[_0xb4d0('0xb')]('/api/networks',require('./api/network'));_0x29c082['use'](_0xb4d0('0xb5'),require(_0xb4d0('0xb6')));_0x29c082[_0xb4d0('0xb')]('/api/chat/internal/messages',require(_0xb4d0('0xb7')));_0x29c082['use']('/api/jscripty/answers/reports',require(_0xb4d0('0xb8')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xb9'),require(_0xb4d0('0xba')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xbb'),require(_0xb4d0('0xbc')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xbd'),require('./api/smsQueueReport'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xbe'),require(_0xb4d0('0xbf')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xc0'),require(_0xb4d0('0xc1')));_0x29c082[_0xb4d0('0xb')]('/api/jscripty/projects',require(_0xb4d0('0xc2')));_0x29c082[_0xb4d0('0xb')]('/api/settings',require(_0xb4d0('0xc3')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xc4'),require(_0xb4d0('0xc5')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xc6'),require(_0xb4d0('0xc7')));_0x29c082['use'](_0xb4d0('0xc8'),require(_0xb4d0('0xc9')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xca'),require(_0xb4d0('0xcb')));_0x29c082['use']('/api/teams',require(_0xb4d0('0xcc')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xcd'),require('./api/license'));_0x29c082[_0xb4d0('0xb')]('/api/campaigns',require('./api/campaign'));_0x29c082['use'](_0xb4d0('0xce'),require(_0xb4d0('0xcf')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd0'),require(_0xb4d0('0xd1')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd2'),require('./api/plugin'));_0x29c082[_0xb4d0('0xb')]('/api/mail/reports/transfer',require(_0xb4d0('0xd3')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd4'),require(_0xb4d0('0xd5')));_0x29c082['use']('/api/fax/reports/transfer',require(_0xb4d0('0xd6')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd7'),require(_0xb4d0('0xd8')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xd9'),require(_0xb4d0('0xda')));_0x29c082['use'](_0xb4d0('0xdb'),require(_0xb4d0('0xdc')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xdd'),require(_0xb4d0('0xde')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xdf'),require(_0xb4d0('0xe0')));_0x29c082[_0xb4d0('0xb')]('/api/userProfile/sections',require(_0xb4d0('0xe1')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xe2'),require(_0xb4d0('0xe3')));_0x29c082[_0xb4d0('0xb')]('/api/userNotifications',require(_0xb4d0('0xe4')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xe5'),require(_0xb4d0('0xe6')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xe7'),require(_0xb4d0('0xe8')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xe9'),require(_0xb4d0('0xea')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xeb'),require(_0xb4d0('0xec')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xed'),require(_0xb4d0('0xee')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xef'),require(_0xb4d0('0xf0')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf1'),require(_0xb4d0('0xf2')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf3'),require(_0xb4d0('0xf4')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf5'),require('./api/realtime'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf6'),require('./api/user-setting'));_0x29c082[_0xb4d0('0xb')]('/api/mail_interaction_has_tags',require(_0xb4d0('0xf7')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xf8'),require(_0xb4d0('0xf9')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xfa'),require(_0xb4d0('0xfb')));_0x29c082['use'](_0xb4d0('0xfc'),require(_0xb4d0('0xfd')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0xfe'),require(_0xb4d0('0xff')));_0x29c082[_0xb4d0('0xb')]('/api/rpc',require(_0xb4d0('0x100')));_0x29c082['use']('/api/version',require('./api/version'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x101'),require(_0xb4d0('0x102')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x103'),require('./api/pm2'));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x104'),require('./api/webbar'));_0x29c082['use'](_0xb4d0('0x105'),clientSideLogs);_0x29c082['use'](_0xb4d0('0x106'),express[_0xb4d0('0x107')](path[_0xb4d0('0x108')](config[_0xb4d0('0x109')],_0xb4d0('0x106'))));_0x29c082[_0xb4d0('0xb')]('/www',express['static'](path[_0xb4d0('0x108')](config[_0xb4d0('0x109')],_0xb4d0('0x10a'))));_0x29c082['use'](_0xb4d0('0x10b'),express[_0xb4d0('0x107')](path[_0xb4d0('0x108')](config['root'],_0xb4d0('0x10b'))));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x10c'),express['static'](path[_0xb4d0('0x108')](config[_0xb4d0('0x109')],'snippet','3.9.0')));_0x29c082[_0xb4d0('0xb')](_0xb4d0('0x10d'),express[_0xb4d0('0x107')](path[_0xb4d0('0x108')](config['root'],'/server/files/plugins')));_0x29c082[_0xb4d0('0x10e')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb4d0('0x10f')](errors[0x194]);_0x29c082[_0xb4d0('0x10e')]('/*')[_0xb4d0('0x10f')](function(_0xd310d7,_0xb9152e){_0xb9152e[_0xb4d0('0x110')](path[_0xb4d0('0x111')](_0x29c082[_0xb4d0('0x10f')]('appPath')+_0xb4d0('0x112')));});return _0x29c082;});}; \ No newline at end of file +var _0xda8a=['/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/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/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/schedules','/api/sounds','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/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/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/network','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/mail_interaction_has_tags','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','join','root','/www','static','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','/api/users','/api/voice/chanspy','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue'];(function(_0x4f993a,_0x273fff){var _0x260b3e=function(_0x29b5ce){while(--_0x29b5ce){_0x4f993a['push'](_0x4f993a['shift']());}};_0x260b3e(++_0x273fff);}(_0xda8a,0x1e4));var _0xada8=function(_0x4b53b4,_0x1d6c64){_0x4b53b4=_0x4b53b4-0x0;var _0x26b6c3=_0xda8a[_0x4b53b4];return _0x26b6c3;};'use strict';var path=require(_0xada8('0x0'));var express=require(_0xada8('0x1'));var errors=require(_0xada8('0x2'));var config=require(_0xada8('0x3'));var setupLoggers=require(_0xada8('0x4'))[_0xada8('0x5')];var clientSideLogs=require(_0xada8('0x6'));exports[_0xada8('0x7')]=function(_0x3c2a38){return setupLoggers(_0x3c2a38)['then'](function(){_0x3c2a38['use'](_0xada8('0x8'),require('./api/user'));_0x3c2a38['use'](_0xada8('0x9'),require('./api/voiceChanSpy'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xb'),require(_0xada8('0xc')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xd'),require(_0xada8('0xe')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xf'),require(_0xada8('0x10')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x11'),require(_0xada8('0x12')));_0x3c2a38['use'](_0xada8('0x13'),require('./api/voiceRecording'));_0x3c2a38[_0xada8('0xa')]('/api/screen/recordings',require(_0xada8('0x14')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x15'),require(_0xada8('0x16')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x17'),require(_0xada8('0x18')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x19'),require(_0xada8('0x1a')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x1b'),require('./api/voiceDialReport'));_0x3c2a38[_0xada8('0xa')]('/api/voice/agents/reports',require(_0xada8('0x1c')));_0x3c2a38['use'](_0xada8('0x1d'),require(_0xada8('0x1e')));_0x3c2a38[_0xada8('0xa')]('/api/members/reports',require(_0xada8('0x1f')));_0x3c2a38['use'](_0xada8('0x20'),require('./api/trunk'));_0x3c2a38[_0xada8('0xa')]('/api/voice/transfers/reports',require(_0xada8('0x21')));_0x3c2a38['use'](_0xada8('0x22'),require(_0xada8('0x23')));_0x3c2a38['use']('/api/mail/accounts',require('./api/mailAccount'));_0x3c2a38[_0xada8('0xa')]('/api/mail/queues',require('./api/mailQueue'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x24'),require(_0xada8('0x25')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x26'),require(_0xada8('0x27')));_0x3c2a38[_0xada8('0xa')]('/api/mail/messages',require('./api/mailMessage'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x28'),require('./api/mailApplication'));_0x3c2a38[_0xada8('0xa')]('/api/mail/reports/queue',require(_0xada8('0x29')));_0x3c2a38['use']('/api/dashboards',require(_0xada8('0x2a')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x2b'),require(_0xada8('0x2c')));_0x3c2a38['use']('/api/fax/accounts',require('./api/faxAccount'));_0x3c2a38['use'](_0xada8('0x2d'),require(_0xada8('0x2e')));_0x3c2a38['use']('/api/fax/interactions',require(_0xada8('0x2f')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x30'),require('./api/faxMessage'));_0x3c2a38['use'](_0xada8('0x31'),require(_0xada8('0x32')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x33'),require(_0xada8('0x34')));_0x3c2a38[_0xada8('0xa')]('/api/sms/accounts',require(_0xada8('0x35')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x36'),require(_0xada8('0x37')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x38'),require('./api/smsInteraction'));_0x3c2a38['use']('/api/sms/messages',require(_0xada8('0x39')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x3a'),require(_0xada8('0x3b')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x3c'),require(_0xada8('0x3d')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x3e'),require('./api/openchannelApplication'));_0x3c2a38['use'](_0xada8('0x3f'),require(_0xada8('0x40')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x41'),require(_0xada8('0x42')));_0x3c2a38['use'](_0xada8('0x43'),require(_0xada8('0x44')));_0x3c2a38['use']('/api/chat/websites',require(_0xada8('0x45')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x46'),require(_0xada8('0x47')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x48'),require(_0xada8('0x49')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x4a'),require(_0xada8('0x4b')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x4c'),require(_0xada8('0x4d')));_0x3c2a38['use'](_0xada8('0x4e'),require(_0xada8('0x4f')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x50'),require(_0xada8('0x51')));_0x3c2a38['use'](_0xada8('0x52'),require('./api/chatGroup'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x53'),require('./api/chatProactiveAction'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x54'),require(_0xada8('0x55')));_0x3c2a38['use']('/api/cm/contacts',require(_0xada8('0x56')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x57'),require('./api/cmHopper'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x58'),require(_0xada8('0x59')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x5a'),require(_0xada8('0x5b')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x5c'),require(_0xada8('0x5d')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x5e'),require(_0xada8('0x5f')));_0x3c2a38[_0xada8('0xa')]('/api/actions',require(_0xada8('0x60')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x61'),require(_0xada8('0x62')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x63'),require(_0xada8('0x64')));_0x3c2a38[_0xada8('0xa')]('/api/dispositions',require('./api/disposition'));_0x3c2a38[_0xada8('0xa')]('/api/conditions',require('./api/condition'));_0x3c2a38['use'](_0xada8('0x65'),require(_0xada8('0x66')));_0x3c2a38[_0xada8('0xa')]('/api/pauses',require(_0xada8('0x67')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x68'),require(_0xada8('0x69')));_0x3c2a38[_0xada8('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x6a'),require('./api/schedule'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x6b'),require('./api/sound'));_0x3c2a38[_0xada8('0xa')]('/api/tags',require(_0xada8('0x6c')));_0x3c2a38['use'](_0xada8('0x6d'),require(_0xada8('0x6e')));_0x3c2a38['use'](_0xada8('0x6f'),require(_0xada8('0x70')));_0x3c2a38[_0xada8('0xa')]('/api/cm_hopper_additional_phones',require(_0xada8('0x71')));_0x3c2a38['use'](_0xada8('0x72'),require(_0xada8('0x73')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x74'),require(_0xada8('0x75')));_0x3c2a38['use'](_0xada8('0x76'),require(_0xada8('0x77')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x78'),require(_0xada8('0x79')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x7a'),require(_0xada8('0x7b')));_0x3c2a38['use'](_0xada8('0x7c'),require('./api/analyticCustomReport'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x7d'),require(_0xada8('0x7e')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x7f'),require('./api/analyticExtractedReport'));_0x3c2a38[_0xada8('0xa')]('/api/analytics/metrics',require(_0xada8('0x80')));_0x3c2a38['use']('/api/analytics/field_reports',require(_0xada8('0x81')));_0x3c2a38[_0xada8('0xa')]('/api/analytics/tree_reports',require(_0xada8('0x82')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x83'),require(_0xada8('0x84')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x85'),require(_0xada8('0x86')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x87'),require(_0xada8('0x88')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x89'),require(_0xada8('0x8a')));_0x3c2a38['use'](_0xada8('0x8b'),require(_0xada8('0x8c')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x8d'),require(_0xada8('0x8e')));_0x3c2a38['use'](_0xada8('0x8f'),require(_0xada8('0x90')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x91'),require('./api/intDeskConfiguration'));_0x3c2a38['use'](_0xada8('0x92'),require(_0xada8('0x93')));_0x3c2a38['use']('/api/integrations/zoho/accounts',require(_0xada8('0x94')));_0x3c2a38['use'](_0xada8('0x95'),require(_0xada8('0x96')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x97'),require(_0xada8('0x98')));_0x3c2a38['use'](_0xada8('0x99'),require(_0xada8('0x9a')));_0x3c2a38['use'](_0xada8('0x9b'),require(_0xada8('0x9c')));_0x3c2a38['use'](_0xada8('0x9d'),require(_0xada8('0x9e')));_0x3c2a38['use'](_0xada8('0x9f'),require('./api/intFreshdeskAccount'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xa0'),require('./api/intFreshdeskConfiguration'));_0x3c2a38[_0xada8('0xa')]('/api/integrations/freshdesk/fields',require(_0xada8('0xa1')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xa2'),require(_0xada8('0xa3')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xa4'),require(_0xada8('0xa5')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xa6'),require(_0xada8('0xa7')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xa8'),require('./api/intServicenowAccount'));_0x3c2a38['use'](_0xada8('0xa9'),require(_0xada8('0xaa')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xab'),require(_0xada8('0xac')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xad'),require(_0xada8('0xae')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xaf'),require(_0xada8('0xb0')));_0x3c2a38[_0xada8('0xa')]('/api/integrations/dynamics365/fields',require(_0xada8('0xb1')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xb2'),require(_0xada8('0xb3')));_0x3c2a38['use'](_0xada8('0xb4'),require('./api/intFreshsalesConfiguration'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xb5'),require('./api/intFreshsalesField'));_0x3c2a38[_0xada8('0xa')]('/api/networks',require(_0xada8('0xb6')));_0x3c2a38[_0xada8('0xa')]('/api/chat/reports/queue',require(_0xada8('0xb7')));_0x3c2a38[_0xada8('0xa')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x3c2a38['use'](_0xada8('0xb8'),require(_0xada8('0xb9')));_0x3c2a38['use'](_0xada8('0xba'),require(_0xada8('0xbb')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xbc'),require('./api/jscriptySessionReport'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xbd'),require(_0xada8('0xbe')));_0x3c2a38[_0xada8('0xa')]('/api/square/reports',require('./api/squareReport'));_0x3c2a38['use'](_0xada8('0xbf'),require(_0xada8('0xc0')));_0x3c2a38[_0xada8('0xa')]('/api/jscripty/projects',require(_0xada8('0xc1')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xc2'),require('./api/setting'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xc3'),require(_0xada8('0xc4')));_0x3c2a38[_0xada8('0xa')]('/api/square/projects',require(_0xada8('0xc5')));_0x3c2a38[_0xada8('0xa')]('/api/square/recordings',require(_0xada8('0xc6')));_0x3c2a38['use'](_0xada8('0xc7'),require(_0xada8('0xc8')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xc9'),require(_0xada8('0xca')));_0x3c2a38[_0xada8('0xa')]('/api/license',require('./api/license'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xcb'),require(_0xada8('0xcc')));_0x3c2a38['use'](_0xada8('0xcd'),require(_0xada8('0xce')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xcf'),require(_0xada8('0xd0')));_0x3c2a38['use'](_0xada8('0xd1'),require(_0xada8('0xd2')));_0x3c2a38[_0xada8('0xa')]('/api/mail/reports/transfer',require(_0xada8('0xd3')));_0x3c2a38['use'](_0xada8('0xd4'),require(_0xada8('0xd5')));_0x3c2a38['use'](_0xada8('0xd6'),require('./api/faxTransferReport'));_0x3c2a38['use'](_0xada8('0xd7'),require('./api/openchannelTransferReport'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xd8'),require(_0xada8('0xd9')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xda'),require('./api/cmList'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xdb'),require('./api/voicePrefix'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xdc'),require(_0xada8('0xdd')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xde'),require(_0xada8('0xdf')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xe0'),require(_0xada8('0xe1')));_0x3c2a38[_0xada8('0xa')]('/api/userNotifications',require(_0xada8('0xe2')));_0x3c2a38['use'](_0xada8('0xe3'),require(_0xada8('0xe4')));_0x3c2a38[_0xada8('0xa')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x3c2a38[_0xada8('0xa')]('/api/whatsapp/interactions',require(_0xada8('0xe5')));_0x3c2a38['use'](_0xada8('0xe6'),require(_0xada8('0xe7')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xe8'),require(_0xada8('0xe9')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xea'),require('./api/whatsappTransferReport'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xeb'),require(_0xada8('0xec')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xed'),require(_0xada8('0xee')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xef'),require(_0xada8('0xf0')));_0x3c2a38['use'](_0xada8('0xf1'),require('./api/user-setting'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xf2'),require('./api/mailInteractionHasTag'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xf3'),require(_0xada8('0xf4')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xf5'),require(_0xada8('0xf6')));_0x3c2a38['use'](_0xada8('0xf7'),require(_0xada8('0xf8')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xf9'),require('./api/jira'));_0x3c2a38['use'](_0xada8('0xfa'),require(_0xada8('0xfb')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xfc'),require(_0xada8('0xfd')));_0x3c2a38[_0xada8('0xa')](_0xada8('0xfe'),require('./api/system'));_0x3c2a38[_0xada8('0xa')](_0xada8('0xff'),require('./api/pm2'));_0x3c2a38[_0xada8('0xa')](_0xada8('0x100'),require(_0xada8('0x101')));_0x3c2a38[_0xada8('0xa')]('/api/logs',clientSideLogs);_0x3c2a38['use']('/apidoc',express['static'](path[_0xada8('0x102')](config[_0xada8('0x103')],'/apidoc')));_0x3c2a38[_0xada8('0xa')](_0xada8('0x104'),express[_0xada8('0x105')](path['join'](config[_0xada8('0x103')],_0xada8('0x104'))));_0x3c2a38[_0xada8('0xa')](_0xada8('0x106'),express[_0xada8('0x105')](path['join'](config['root'],_0xada8('0x106'))));_0x3c2a38['use'](_0xada8('0x107'),express[_0xada8('0x105')](path[_0xada8('0x102')](config[_0xada8('0x103')],_0xada8('0x108'),'3.9.0')));_0x3c2a38['use'](_0xada8('0x109'),express[_0xada8('0x105')](path[_0xada8('0x102')](config['root'],'/server/files/plugins')));_0x3c2a38[_0xada8('0x10a')](_0xada8('0x10b'))[_0xada8('0x10c')](errors[0x194]);_0x3c2a38[_0xada8('0x10a')]('/*')[_0xada8('0x10c')](function(_0x55a1f9,_0x36718e){_0x36718e[_0xada8('0x10d')](path['resolve'](_0x3c2a38['get'](_0xada8('0x10e'))+_0xada8('0x10f')));});return _0x3c2a38;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 32fbac3..a64206d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5958=['../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/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.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/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc'];(function(_0x3abd7e,_0x3399f7){var _0x2b10d5=function(_0x5e5c9a){while(--_0x5e5c9a){_0x3abd7e['push'](_0x3abd7e['shift']());}};_0x2b10d5(++_0x3399f7);}(_0x5958,0x14e));var _0x8595=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0x5958[_0x286726];return _0xcd4fe9;};'use strict';var jayson=require(_0x8595('0x0'));var _=require(_0x8595('0x1'));var config=require(_0x8595('0x2'));exports[_0x8595('0x3')]=function(){return new Promise(function(_0x3b6de6,_0x31fb94){var _0x3ab096={};_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x4')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/voiceExtension/voiceExtension.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x6')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x7')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x8')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x9')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0xa')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0xb')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0xc')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0xd')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0xe')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0xf')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x10')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/mailAccount/mailAccount.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/mailQueue/mailQueue.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x11')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x12')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x13')));_0x3ab096=_['merge'](_0x3ab096,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x14')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x15')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x16')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/faxMessage/faxMessage.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x17')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x18')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x19')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x1a')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/smsMessage/smsMessage.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x1b')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x1c')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x1d')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x1e')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x1f')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x20')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x21')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x22')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x23')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x24')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x25')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x26')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x27')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x28')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x29')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x2a')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x2b')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x2c')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x2d')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x2e')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x2f')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x30')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x31')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x32')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x33')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x34')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x35')));_0x3ab096=_['merge'](_0x3ab096,require(_0x8595('0x36')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x37')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x38')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x39')));_0x3ab096=_['merge'](_0x3ab096,require('../api/squareProject/squareProject.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x3a')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/squareMessage/squareMessage.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x3b')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/attachment/attachment.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/plugin/plugin.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x3c')));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x3ab096=_[_0x8595('0x5')](_0x3ab096,require(_0x8595('0x3d')));var _0x298519=jayson[_0x8595('0x3e')](_0x3ab096)['http']();var _0x2da691=config['rpc'][_0x8595('0x3f')]||config['port']+0x1;var _0x56b846=config[_0x8595('0x40')]['ip']||_0x8595('0x41');_0x298519['on']('error',function(_0x35e13b){return _0x31fb94(_0x35e13b);});_0x298519[_0x8595('0x3')](_0x2da691,_0x56b846,function(){console['log'](_0x8595('0x42'),_0x56b846,_0x2da691);require(_0x8595('0x43'))['default']();return _0x3b6de6(_0x8595('0x44')+_0x56b846+':'+_0x2da691);});});}; \ No newline at end of file +var _0x3eea=['../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.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','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x5f3f60,_0x5623b3){var _0x3f0e96=function(_0x2cd826){while(--_0x2cd826){_0x5f3f60['push'](_0x5f3f60['shift']());}};_0x3f0e96(++_0x5623b3);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x238774,_0x49bce6){_0x238774=_0x238774-0x0;var _0x5c7b9a=_0x3eea[_0x238774];return _0x5c7b9a;};'use strict';var jayson=require(_0xa3ee('0x0'));var _=require('lodash');var config=require(_0xa3ee('0x1'));exports[_0xa3ee('0x2')]=function(){return new Promise(function(_0x16512c,_0x1c6a49){var _0x46acfa={};_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x4')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x5')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x6')));_0x46acfa=_['merge'](_0x46acfa,require('../api/voiceRecording/voiceRecording.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x7')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/trunk/trunk.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x8')));_0x46acfa=_['merge'](_0x46acfa,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x9')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0xa')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0xb')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0xc')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0xd')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/mailApplication/mailApplication.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0xe')));_0x46acfa=_['merge'](_0x46acfa,require('../api/faxAccount/faxAccount.rpc'));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0xf')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x10')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/faxMessage/faxMessage.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x11')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x12')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/smsAccount/smsAccount.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x13')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x14')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x15')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x16')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x17')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x18')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x19')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x1a')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x1b')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x1c')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x1d')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x1e')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x1f')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x20')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x21')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x22')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x23')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/sound/sound.rpc'));_0x46acfa=_['merge'](_0x46acfa,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/template/template.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x24')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x25')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x26')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x27')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x28')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x29')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x2a')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x2b')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x2c')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x2d')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/squareReport/squareReport.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/setting/setting.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/squareOdbc/squareOdbc.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x2e')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x2f')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x30')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x31')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x32')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x33')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x34')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x35')));_0x46acfa=_['merge'](_0x46acfa,require(_0xa3ee('0x36')));_0x46acfa=_[_0xa3ee('0x3')](_0x46acfa,require(_0xa3ee('0x37')));var _0x5b95e3=jayson[_0xa3ee('0x38')](_0x46acfa)[_0xa3ee('0x39')]();var _0x5f4d6f=config[_0xa3ee('0x3a')][_0xa3ee('0x3b')]||config['port']+0x1;var _0x2a8e02=config[_0xa3ee('0x3a')]['ip']||_0xa3ee('0x3c');_0x5b95e3['on'](_0xa3ee('0x3d'),function(_0x1f0023){return _0x1c6a49(_0x1f0023);});_0x5b95e3[_0xa3ee('0x2')](_0x5f4d6f,_0x2a8e02,function(){console[_0xa3ee('0x3e')](_0xa3ee('0x3f'),_0x2a8e02,_0x5f4d6f);require(_0xa3ee('0x40'))[_0xa3ee('0x41')]();return _0x16512c(_0xa3ee('0x42')+_0x2a8e02+':'+_0x5f4d6f);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1b9a893..1d352dd 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 _0x8f05=['./reply','setTimeout','setEncoding','utf8','line','toLowerCase','hangup','emit','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substring','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','answer','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','exports','util','lodash','events'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0x8f05,0x1cb));var _0x58f0=function(_0x2bfb84,_0x4ad284){_0x2bfb84=_0x2bfb84-0x0;var _0xbe9591=_0x8f05[_0x2bfb84];return _0xbe9591;};'use strict';var util=require(_0x58f0('0x0'));var _=require(_0x58f0('0x1'));var EventEmitter=require(_0x58f0('0x2'))['EventEmitter'];var AGIReply=require(_0x58f0('0x3'));var AGIError=require('./error');function AGIChannel(_0x489772){var _0x2bf931=this,_0x54ad1f=new AGIReply(),_0x1e1ca8=![],_0x8902ba={};EventEmitter['call'](_0x2bf931);_0x489772['setEncoding']('utf8');_0x489772[_0x58f0('0x4')](0x8*0x3c*0x3c*0x3e8);_0x54ad1f[_0x58f0('0x5')](_0x58f0('0x6'));_0x54ad1f['on']('headers',function(_0x148bf1){for(var _0x6dda3b in _0x148bf1){_0x2bf931[_0x6dda3b]=_0x148bf1[_0x6dda3b];}_0x2bf931['emit']('ready');});_0x54ad1f['on'](_0x58f0('0x7'),function(_0x21df17){if(_0x21df17[_0x58f0('0x8')]()==_0x58f0('0x9')){_0x2bf931[_0x58f0('0xa')](_0x58f0('0x9'));return;}if(_0x21df17['substring'](0x0,0xb)==_0x58f0('0xb')){_0x1e1ca8=!![];}if(_0x1e1ca8){_0x8902ba['rx']+=_0x21df17+'\x0a';if(_0x21df17[_0x58f0('0xc')](_0x58f0('0xd'))!=-0x1){_0x1e1ca8=![];}}else{_0x8902ba['rx']=_0x21df17;}if(_0x1e1ca8){return;}if(typeof _0x8902ba['cb']==_0x58f0('0xe')){var _0x56e8f1=_0x8902ba['rx']['substring'](0x0,0x3),_0x4d3d9b=null,_0x3e5f2f=null;_0x56e8f1=parseInt(_0x56e8f1);if(isNaN(_0x56e8f1)){_0x8902ba['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x58f0('0xf')});return;}if(_0x56e8f1!=0xc8){_0x8902ba['cb'](null,{'code':_0x56e8f1,'result':-0x1,'extra':'KO'});return;}_0x4d3d9b=_0x8902ba['rx'][_0x58f0('0x10')](0x4)[_0x58f0('0x11')](_0x58f0('0x12'),'');if(_0x4d3d9b[_0x58f0('0x13')]('\x20')!=-0x1){_0x4d3d9b=_0x4d3d9b[_0x58f0('0x14')](0x0,_0x4d3d9b['indexOf']('\x20'));}if(_[_0x58f0('0x15')](_0x4d3d9b,'-1')){_0x4d3d9b=parseInt(_0x4d3d9b);}_0x3e5f2f=_0x8902ba['rx'][_0x58f0('0x16')]('\x20');if(_0x3e5f2f[_0x58f0('0x17')]==0x3){_0x3e5f2f=_0x3e5f2f[0x2][_0x58f0('0x10')](0x1,_0x3e5f2f[0x2][_0x58f0('0x17')]-0x1);}else if(_0x3e5f2f['length']>0x3){var _0x3b40a8=/\((.+)\)/;var _0x4fc680=_0x8902ba['rx'][_0x58f0('0x18')](_0x3b40a8);if(_0x4fc680){_0x3e5f2f=_0x4fc680[0x1];}else{_0x3e5f2f=null;}}else{_0x3e5f2f=null;}_0x8902ba['cb'](null,{'code':_0x56e8f1,'result':_0x4d3d9b,'extra':_0x3e5f2f});}});_0x489772['on'](_0x58f0('0x19'),function(_0x476371){_0x2bf931[_0x58f0('0xa')](_0x58f0('0x19'),new AGIError(_0x58f0('0x1a'),_0x476371[_0x58f0('0x1b')]));});_0x489772['on'](_0x58f0('0x1c'),function(){_0x2bf931['emit'](_0x58f0('0x1c'),new AGIError(_0x58f0('0x1d')));});_0x489772['on']('timeout',function(){_0x2bf931[_0x58f0('0xa')](_0x58f0('0x1e'),new AGIError(_0x58f0('0x1f')));_0x489772[_0x58f0('0x20')]();});_0x489772[_0x58f0('0x21')](_0x54ad1f);this[_0x58f0('0x22')]=function(_0x3c3ebc,_0x37109a){var _0x3c3ebc=_0x3c3ebc||'',_0x37109a=typeof _0x37109a==_0x58f0('0xe')?_0x37109a:new Function();_0x8902ba={'tx':_0x3c3ebc,'rx':'','cb':_0x37109a};_0x489772[_0x58f0('0x23')](_0x3c3ebc+'\x0a');},this[_0x58f0('0x1c')]=function(){_0x489772[_0x58f0('0x20')]();};}util[_0x58f0('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x58f0('0x25')]['sendRequest']=function(_0x4f04ec){return this[_0x58f0('0x22')]['sync'](this,_0x4f04ec);};AGIChannel[_0x58f0('0x25')][_0x58f0('0x26')]=function(){return this[_0x58f0('0x27')](_0x58f0('0x28'));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x29')]=function(_0x42b43a,_0x3b9b9d,_0x15c9aa){_0x42b43a=_0x42b43a===undefined?_0x58f0('0x2a'):_0x42b43a;_0x3b9b9d=_0x3b9b9d===undefined?'5':_0x3b9b9d;_0x15c9aa=_0x15c9aa===undefined?'1':_0x15c9aa;return this[_0x58f0('0x27')](util['format'](_0x58f0('0x2b'),_0x42b43a,_0x3b9b9d*0x3e8,_0x15c9aa));};AGIChannel[_0x58f0('0x25')]['noop']=function(_0x56975c){_0x56975c=_0x56975c||'NO\x20MESSAGE';return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x2d'),_0x56975c));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x2e')]=function(_0x750e0e,_0x1d4384){if(_[_0x58f0('0x2f')](_0x1d4384)){return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x30'),_0x750e0e,_0x1d4384['join'](',')));}return this[_0x58f0('0x27')](util['format'](_0x58f0('0x30'),_0x750e0e,_0x1d4384));};AGIChannel[_0x58f0('0x25')]['setContext']=function(_0x299eb7){return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x31'),_0x299eb7));};AGIChannel['prototype'][_0x58f0('0x32')]=function(_0x3f324e){return this['sendRequest'](util[_0x58f0('0x2c')](_0x58f0('0x33'),_0x3f324e));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x34')]=function(_0x5c04fa){return this['sendRequest'](util[_0x58f0('0x2c')](_0x58f0('0x35'),_0x5c04fa));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x9')]=function(){return this[_0x58f0('0x27')](_0x58f0('0x36'));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x37')]=function(_0x4faadb,_0x5e080f){var _0x374ab4=_[_0x58f0('0x38')](_0x5e080f)||_[_0x58f0('0x39')](_0x5e080f)?_0x5e080f[_0x58f0('0x3a')]():_0x5e080f;return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x3b'),_0x4faadb,_0x374ab4?_0x374ab4[_0x58f0('0x3a')]()[_0x58f0('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x58f0('0x25')]['sayNumber']=function(_0x46f4a8,_0x438a3a){return this[_0x58f0('0x27')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x46f4a8,_0x438a3a));};AGIChannel['prototype'][_0x58f0('0x3c')]=function(_0x202b35,_0x1d1c05){return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x3d'),_0x202b35,_0x1d1c05));};AGIChannel['prototype']['sayPhonetic']=function(_0x452c57,_0x4f05da){return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x3e'),_0x452c57,_0x4f05da));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x3f')]=function(_0x1e6b10,_0x495b50,_0x56e46e){_0x495b50=_0x495b50||this['extension'];_0x56e46e=_0x56e46e||0x1;this[_0x58f0('0x40')](_0x1e6b10);this['setExtension'](_0x495b50);this[_0x58f0('0x34')](_0x56e46e);return this[_0x58f0('0x41')](util['format'](_0x58f0('0x42'),_0x1e6b10,_0x495b50,_0x56e46e));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x43')]=function(_0x3979f9){return this[_0x58f0('0x27')](util[_0x58f0('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3979f9));};AGIChannel['prototype'][_0x58f0('0x44')]=function(_0x30ad19,_0x5ecd1e,_0x267c1d,_0x1bd0e9,_0x1c8749,_0x5a18db){_0x5ecd1e=_0x5ecd1e||_0x58f0('0x45');_0x267c1d=_0x267c1d||'';_0x1bd0e9=_0x1bd0e9===undefined?-0x1:_0x1bd0e9==='-1'?-0x1:_0x1bd0e9*0x3e8;_0x1c8749=_0x1c8749===undefined?'':'s='+_0x1c8749;_0x5a18db=_0x5a18db?'BEEP':'';return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x46'),_0x30ad19,_0x5ecd1e,_0x267c1d,_0x1bd0e9,_0x5a18db,_0x1c8749));};AGIChannel['prototype']['streamFile']=function(_0x8109d6,_0xe725f6){_0xe725f6=_0xe725f6||'';return this[_0x58f0('0x27')](util[_0x58f0('0x2c')](_0x58f0('0x47'),_0x8109d6,_0xe725f6));};AGIChannel[_0x58f0('0x25')][_0x58f0('0x48')]=function(_0x8af81e){return this['exec'](_0x58f0('0x49'),_0x8af81e);};AGIChannel[_0x58f0('0x25')][_0x58f0('0x4a')]=function(_0x37e1df){return this['exec']('WAIT',_0x37e1df);};AGIChannel[_0x58f0('0x25')]['error']=function(_0x1931be,_0x4a90ed){this[_0x58f0('0x41')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1931be['id'],_0x1931be[_0x58f0('0x4b')],_0x4a90ed));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x58f0('0x4c')]=AGIChannel; \ No newline at end of file +var _0x12c2=['./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','prototype','sendRequest','sync','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','format','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0x12c2,0xdc));var _0x212c=function(_0x5a97b8,_0x5a7945){_0x5a97b8=_0x5a97b8-0x0;var _0x54b165=_0x12c2[_0x5a97b8];return _0x54b165;};'use strict';var util=require('util');var _=require(_0x212c('0x0'));var EventEmitter=require('events')[_0x212c('0x1')];var AGIReply=require(_0x212c('0x2'));var AGIError=require(_0x212c('0x3'));function AGIChannel(_0x3741a8){var _0x371c5f=this,_0x29c99e=new AGIReply(),_0x183fcc=![],_0x15a9eb={};EventEmitter[_0x212c('0x4')](_0x371c5f);_0x3741a8[_0x212c('0x5')](_0x212c('0x6'));_0x3741a8[_0x212c('0x7')](0x8*0x3c*0x3c*0x3e8);_0x29c99e['setEncoding'](_0x212c('0x6'));_0x29c99e['on'](_0x212c('0x8'),function(_0x57c432){for(var _0x25f9cd in _0x57c432){_0x371c5f[_0x25f9cd]=_0x57c432[_0x25f9cd];}_0x371c5f[_0x212c('0x9')]('ready');});_0x29c99e['on']('line',function(_0x26cb81){if(_0x26cb81[_0x212c('0xa')]()==_0x212c('0xb')){_0x371c5f[_0x212c('0x9')](_0x212c('0xb'));return;}if(_0x26cb81[_0x212c('0xc')](0x0,0xb)==_0x212c('0xd')){_0x183fcc=!![];}if(_0x183fcc){_0x15a9eb['rx']+=_0x26cb81+'\x0a';if(_0x26cb81[_0x212c('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x183fcc=![];}}else{_0x15a9eb['rx']=_0x26cb81;}if(_0x183fcc){return;}if(typeof _0x15a9eb['cb']=='function'){var _0xe9c21c=_0x15a9eb['rx'][_0x212c('0xc')](0x0,0x3),_0x1ff515=null,_0x6f2902=null;_0xe9c21c=parseInt(_0xe9c21c);if(isNaN(_0xe9c21c)){_0x15a9eb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x212c('0xf')});return;}if(_0xe9c21c!=0xc8){_0x15a9eb['cb'](null,{'code':_0xe9c21c,'result':-0x1,'extra':'KO'});return;}_0x1ff515=_0x15a9eb['rx'][_0x212c('0xc')](0x4)[_0x212c('0x10')]('result=','');if(_0x1ff515[_0x212c('0x11')]('\x20')!=-0x1){_0x1ff515=_0x1ff515[_0x212c('0x12')](0x0,_0x1ff515[_0x212c('0x11')]('\x20'));}if(_[_0x212c('0x13')](_0x1ff515,'-1')){_0x1ff515=parseInt(_0x1ff515);}_0x6f2902=_0x15a9eb['rx'][_0x212c('0x14')]('\x20');if(_0x6f2902[_0x212c('0x15')]==0x3){_0x6f2902=_0x6f2902[0x2][_0x212c('0xc')](0x1,_0x6f2902[0x2][_0x212c('0x15')]-0x1);}else if(_0x6f2902[_0x212c('0x15')]>0x3){var _0x15e38f=/\((.+)\)/;var _0xf60d67=_0x15a9eb['rx'][_0x212c('0x16')](_0x15e38f);if(_0xf60d67){_0x6f2902=_0xf60d67[0x1];}else{_0x6f2902=null;}}else{_0x6f2902=null;}_0x15a9eb['cb'](null,{'code':_0xe9c21c,'result':_0x1ff515,'extra':_0x6f2902});}});_0x3741a8['on'](_0x212c('0x17'),function(_0x14ef56){_0x371c5f[_0x212c('0x9')](_0x212c('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x14ef56[_0x212c('0x18')]));});_0x3741a8['on']('close',function(){_0x371c5f[_0x212c('0x9')](_0x212c('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3741a8['on'](_0x212c('0x1a'),function(){_0x371c5f[_0x212c('0x9')]('timeout',new AGIError(_0x212c('0x1b')));_0x3741a8[_0x212c('0x1c')]();});_0x3741a8['pipe'](_0x29c99e);this[_0x212c('0x1d')]=function(_0x1cdb9e,_0x20f77a){var _0x1cdb9e=_0x1cdb9e||'',_0x20f77a=typeof _0x20f77a==_0x212c('0x1e')?_0x20f77a:new Function();_0x15a9eb={'tx':_0x1cdb9e,'rx':'','cb':_0x20f77a};_0x3741a8[_0x212c('0x1f')](_0x1cdb9e+'\x0a');},this[_0x212c('0x19')]=function(){_0x3741a8[_0x212c('0x1c')]();};}util[_0x212c('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x212c('0x21')][_0x212c('0x22')]=function(_0x2ff09b){return this[_0x212c('0x1d')][_0x212c('0x23')](this,_0x2ff09b);};AGIChannel[_0x212c('0x21')]['answer']=function(){return this[_0x212c('0x22')]('ANSWER');};AGIChannel['prototype'][_0x212c('0x24')]=function(_0x58a800,_0x5417d6,_0x1590a8){_0x58a800=_0x58a800===undefined?'beep':_0x58a800;_0x5417d6=_0x5417d6===undefined?'5':_0x5417d6;_0x1590a8=_0x1590a8===undefined?'1':_0x1590a8;return this[_0x212c('0x22')](util['format'](_0x212c('0x25'),_0x58a800,_0x5417d6*0x3e8,_0x1590a8));};AGIChannel[_0x212c('0x21')][_0x212c('0x26')]=function(_0x576892){_0x576892=_0x576892||_0x212c('0x27');return this[_0x212c('0x22')](util['format']('VERBOSE\x20\x22%s\x22',_0x576892));};AGIChannel[_0x212c('0x21')][_0x212c('0x28')]=function(_0x49f841,_0x4cb1ed){if(_[_0x212c('0x29')](_0x4cb1ed)){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x2b'),_0x49f841,_0x4cb1ed['join'](',')));}return this[_0x212c('0x22')](util['format'](_0x212c('0x2b'),_0x49f841,_0x4cb1ed));};AGIChannel[_0x212c('0x21')]['setContext']=function(_0x4266c5){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x2c'),_0x4266c5));};AGIChannel[_0x212c('0x21')]['setExtension']=function(_0x437e10){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x2d'),_0x437e10));};AGIChannel[_0x212c('0x21')][_0x212c('0x2e')]=function(_0x1e7b18){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x2f'),_0x1e7b18));};AGIChannel[_0x212c('0x21')][_0x212c('0xb')]=function(){return this[_0x212c('0x22')](_0x212c('0x30'));};AGIChannel[_0x212c('0x21')][_0x212c('0x31')]=function(_0x5e68b3,_0x446438){var _0x51de92=_[_0x212c('0x32')](_0x446438)||_[_0x212c('0x33')](_0x446438)?_0x446438[_0x212c('0x34')]():_0x446438;return this['sendRequest'](util[_0x212c('0x2a')](_0x212c('0x35'),_0x5e68b3,_0x51de92?_0x51de92['toString']()[_0x212c('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x212c('0x36')]=function(_0x2e5ee9,_0x165286){return this[_0x212c('0x22')](util['format'](_0x212c('0x37'),_0x2e5ee9,_0x165286));};AGIChannel[_0x212c('0x21')]['sayDigits']=function(_0x51d14c,_0x2a1ef3){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x38'),_0x51d14c,_0x2a1ef3));};AGIChannel['prototype'][_0x212c('0x39')]=function(_0x1e4179,_0x350928){return this[_0x212c('0x22')](util[_0x212c('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1e4179,_0x350928));};AGIChannel[_0x212c('0x21')][_0x212c('0x3a')]=function(_0x3ae538,_0x3001cd,_0x15ca82){_0x3001cd=_0x3001cd||this[_0x212c('0x3b')];_0x15ca82=_0x15ca82||0x1;this[_0x212c('0x3c')](_0x3ae538);this['setExtension'](_0x3001cd);this[_0x212c('0x2e')](_0x15ca82);return this[_0x212c('0x26')](util['format'](_0x212c('0x3d'),_0x3ae538,_0x3001cd,_0x15ca82));};AGIChannel[_0x212c('0x21')][_0x212c('0x3e')]=function(_0x1affd0){return this[_0x212c('0x22')](util[_0x212c('0x2a')](_0x212c('0x3f'),_0x1affd0));};AGIChannel[_0x212c('0x21')][_0x212c('0x40')]=function(_0x2aee7d,_0x2ba412,_0xd8e890,_0x2fb0b7,_0x5981e5,_0xcacf7e){_0x2ba412=_0x2ba412||_0x212c('0x41');_0xd8e890=_0xd8e890||'';_0x2fb0b7=_0x2fb0b7===undefined?-0x1:_0x2fb0b7==='-1'?-0x1:_0x2fb0b7*0x3e8;_0x5981e5=_0x5981e5===undefined?'':'s='+_0x5981e5;_0xcacf7e=_0xcacf7e?_0x212c('0x42'):'';return this[_0x212c('0x22')](util[_0x212c('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2aee7d,_0x2ba412,_0xd8e890,_0x2fb0b7,_0xcacf7e,_0x5981e5));};AGIChannel['prototype'][_0x212c('0x43')]=function(_0x4fcc43,_0x1d18a1){_0x1d18a1=_0x1d18a1||'';return this['sendRequest'](util[_0x212c('0x2a')](_0x212c('0x44'),_0x4fcc43,_0x1d18a1));};AGIChannel[_0x212c('0x21')]['agi']=function(_0x93a1b3){return this[_0x212c('0x28')](_0x212c('0x45'),_0x93a1b3);};AGIChannel[_0x212c('0x21')][_0x212c('0x46')]=function(_0x3c8ed7){return this[_0x212c('0x28')]('WAIT',_0x3c8ed7);};AGIChannel[_0x212c('0x21')][_0x212c('0x17')]=function(_0x51055c,_0x4ff81e){this[_0x212c('0x26')](util[_0x212c('0x2a')](_0x212c('0x47'),_0x51055c['id'],_0x51055c[_0x212c('0x48')],_0x4ff81e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x212c('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 909eb53..e0c0021 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 _0x02a0=['[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.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x02a0,0x1a5));var _0x002a=function(_0x51e86a,_0x4f6fa4){_0x51e86a=_0x51e86a-0x0;var _0x46f4ee=_0x02a0[_0x51e86a];return _0x46f4ee;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x002a('0x0'),'E_AGI_ARGUMENT_PORT':_0x002a('0x1'),'E_AGI_SERVER_ERROR':_0x002a('0x2'),'E_AGI_SERVER_CLOSE':_0x002a('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x002a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x002a('0x5'),'E_AGI_SOCKET_ERROR':_0x002a('0x6'),'E_AGI_SOCKET_CLOSE':_0x002a('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x002a('0x8'),'E_AGI_COMMAND_EMPTY':_0x002a('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x002a('0xa'),'E_AGI_IVR_ENTRY':_0x002a('0xb')};function AGIError(_0xd242a6){var _0xd242a6=_0xd242a6||null,_0x548beb=_0x548beb||[],_0x23d37c=0x1,_0x14a34d='';if(!error[_0xd242a6]){_0xd242a6=_0x002a('0xc');}_0x548beb['push'](error[_0xd242a6]);while(arguments[_0x23d37c]){_0x548beb[_0x002a('0xd')](arguments[_0x23d37c]);_0x23d37c++;}_0x14a34d=util[_0x002a('0xe')]['apply'](util,_0x548beb);this[_0x002a('0xf')]=_0x14a34d;this[_0x002a('0x10')]=_0xd242a6;}module['exports']=AGIError; \ No newline at end of file +var _0x2385=['format','apply','message','name','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x193c13,_0x2fc1ee){var _0x24eb7e=function(_0x3a2b5d){while(--_0x3a2b5d){_0x193c13['push'](_0x193c13['shift']());}};_0x24eb7e(++_0x2fc1ee);}(_0x2385,0xa0));var _0x5238=function(_0xdd5b2f,_0x4bd07a){_0xdd5b2f=_0xdd5b2f-0x0;var _0xcebecd=_0x2385[_0xdd5b2f];return _0xcebecd;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x5238('0x0'),'E_AGI_SERVER_ERROR':_0x5238('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5238('0x2'),'E_AGI_SOCKET_ERROR':_0x5238('0x3'),'E_AGI_SOCKET_CLOSE':_0x5238('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x5238('0x5'),'E_AGI_COMMAND_EMPTY':_0x5238('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5238('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4187fe){var _0x4187fe=_0x4187fe||null,_0x520fb3=_0x520fb3||[],_0x2e764f=0x1,_0x4665fe='';if(!error[_0x4187fe]){_0x4187fe=_0x5238('0x8');}_0x520fb3['push'](error[_0x4187fe]);while(arguments[_0x2e764f]){_0x520fb3['push'](arguments[_0x2e764f]);_0x2e764f++;}_0x4665fe=util[_0x5238('0x9')][_0x5238('0xa')](util,_0x520fb3);this[_0x5238('0xb')]=_0x4665fe;this[_0x5238('0xc')]=_0x4187fe;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index d793103..2800591 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d12=['agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x9d12,0x17d));var _0x29d1=function(_0x1c4fd8,_0x5da1aa){_0x1c4fd8=_0x1c4fd8-0x0;var _0x1669e5=_0x9d12[_0x1c4fd8];return _0x1669e5;};'use strict';var _=require('lodash');var EventEmitter=require(_0x29d1('0x0'))[_0x29d1('0x1')];var Redis=require(_0x29d1('0x2'));var AGIError=require(_0x29d1('0x3'));var config=require(_0x29d1('0x4'));config[_0x29d1('0x5')]=_[_0x29d1('0x6')](config[_0x29d1('0x5')],{'host':_0x29d1('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x29d1('0x5')]);sub[_0x29d1('0x8')](_0x29d1('0x9'),function(_0x539cab){if(_0x539cab)return eventEmitter[_0x29d1('0xa')]('error',new AGIError(_0x29d1('0xb'),_0x539cab));});sub['on'](_0x29d1('0xc'),function(_0x62e7d7,_0x26fcc8){if(_0x62e7d7!==_0x29d1('0x9'))return;try{var _0x4fdd0e=JSON['parse'](_0x26fcc8);eventEmitter[_0x29d1('0xa')](_0x29d1('0xd'),_0x4fdd0e);}catch(_0x16659a){eventEmitter[_0x29d1('0xa')](_0x29d1('0xe'),new AGIError(_0x29d1('0xb'),_0x16659a));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x07c0=['localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','exports','lodash','EventEmitter','ioredis','./error','../../config/environment','redis','defaults'];(function(_0x2997fc,_0x47c18a){var _0x227fda=function(_0x57cea4){while(--_0x57cea4){_0x2997fc['push'](_0x2997fc['shift']());}};_0x227fda(++_0x47c18a);}(_0x07c0,0xb4));var _0x007c=function(_0x1846e2,_0xe66a3a){_0x1846e2=_0x1846e2-0x0;var _0x626282=_0x07c0[_0x1846e2];return _0x626282;};'use strict';var _=require(_0x007c('0x0'));var EventEmitter=require('events')[_0x007c('0x1')];var Redis=require(_0x007c('0x2'));var AGIError=require(_0x007c('0x3'));var config=require(_0x007c('0x4'));config[_0x007c('0x5')]=_[_0x007c('0x6')](config[_0x007c('0x5')],{'host':_0x007c('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x007c('0x8')]('agi',function(_0x405711){if(_0x405711)return eventEmitter[_0x007c('0x9')](_0x007c('0xa'),new AGIError(_0x007c('0xb'),_0x405711));});sub['on'](_0x007c('0xc'),function(_0x1a28bd,_0x33cf85){if(_0x1a28bd!==_0x007c('0xd'))return;try{var _0x3174c2=JSON[_0x007c('0xe')](_0x33cf85);eventEmitter['emit'](_0x007c('0xf'),_0x3174c2);}catch(_0x1b7c20){eventEmitter[_0x007c('0x9')](_0x007c('0xa'),new AGIError(_0x007c('0xb'),_0x1b7c20));}});module[_0x007c('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ebecc3c..50ee807 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 _0x3add=['no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','max\x20retry\x20reach','lodash','../../../config/logger','agi','menu','getdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length'];(function(_0x2b6a8f,_0x294599){var _0x2d2036=function(_0x1ea077){while(--_0x1ea077){_0x2b6a8f['push'](_0x2b6a8f['shift']());}};_0x2d2036(++_0x294599);}(_0x3add,0x10e));var _0xd3ad=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x3add[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xd3ad('0x0'));var logger=require(_0xd3ad('0x1'))(_0xd3ad('0x2'));var verticesWithRetry=[_0xd3ad('0x3'),_0xd3ad('0x4'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0xd3ad('0x5')]={};this[_0xd3ad('0x6')]=0x0;};Graph[_0xd3ad('0x7')][_0xd3ad('0x8')]=function(_0x50574c){this['vertices'][_0x50574c['id']]=_0x50574c;this['edges'][_0x50574c['id']]=[];};Graph[_0xd3ad('0x7')][_0xd3ad('0x9')]=function(_0x4b4579,_0x33a722,_0x4ca709){this[_0xd3ad('0x5')][_0x4b4579][_0xd3ad('0xa')]({'target':_0x33a722,'condition':_0x4ca709});this['numberOfEdges']+=0x1;};Graph['prototype'][_0xd3ad('0xb')]=function(){return _[_0xd3ad('0xb')](this[_0xd3ad('0xc')]);};Graph['prototype'][_0xd3ad('0xd')]=function(){return this[_0xd3ad('0x6')];};Graph[_0xd3ad('0x7')][_0xd3ad('0xe')]=function(_0x2461d8){return this[_0xd3ad('0xc')][_0x2461d8];};Graph[_0xd3ad('0x7')][_0xd3ad('0xf')]=function(_0x5bc90d,_0x3b52a8){if(!this[_0xd3ad('0xc')][_0x5bc90d]){return logger[_0xd3ad('0x10')](_0xd3ad('0x11'));}var _0x4a461d=_0x3b52a8(this['vertices'][_0x5bc90d]);if(!_0x4a461d){return logger[_0xd3ad('0x10')](_0xd3ad('0x12'));}if(this[_0xd3ad('0x5')][_0x5bc90d][_0xd3ad('0x13')]===0x0){return logger[_0xd3ad('0x10')](_0xd3ad('0x14'));}for(var _0x351235=0x0,_0x37d502=[],_0x15a59f=![];_0x351235\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','debug','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','lodash','util','agi','../../config/license/util','./rpc','./project','EventEmitter','defaults','127.0.0.1','nextTick','error','findIndex','deleted','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname'];(function(_0x15d038,_0x507bcc){var _0x435986=function(_0x40461c){while(--_0x40461c){_0x15d038['push'](_0x15d038['shift']());}};_0x435986(++_0x507bcc);}(_0xd513,0x87));var _0x3d51=function(_0xf44538,_0x35d043){_0xf44538=_0xf44538-0x0;var _0x596ec3=_0xd513[_0xf44538];return _0x596ec3;};'use strict';var _=require(_0x3d51('0x0'));var syncho=require('syncho');var util=require(_0x3d51('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x3d51('0x2'));var utilLicense=require(_0x3d51('0x3'));var rpc=require(_0x3d51('0x4'));var Project=require(_0x3d51('0x5'));var AGIEmitter=require('./events')[_0x3d51('0x6')];var projects=[];config[_0x3d51('0x2')]=_[_0x3d51('0x7')](config[_0x3d51('0x2')],{'ip':_0x3d51('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x56e6ce){process[_0x3d51('0x9')](function(){syncho(function(){try{setChannelVariables(_0x56e6ce);agiHandler(_0x56e6ce);}catch(_0x87993c){logger[_0x3d51('0xa')](_0x87993c['stack']);}});});}function projectUpdateHandler(_0x10e4a9){try{var _0x581e2e=_[_0x3d51('0xb')](projects,['id',_0x10e4a9['id']]);if(_0x581e2e>-0x1){if(_0x10e4a9[_0x3d51('0xc')]===!![]){projects[_0x3d51('0xd')](_0x581e2e,0x1);}else{projects[_0x581e2e]=_0x10e4a9;}}else{projects[_0x3d51('0xe')](_0x10e4a9);}}catch(_0x3e0147){logger[_0x3d51('0xa')](_0x3e0147[_0x3d51('0xf')]);}}function listeningHandler(){console[_0x3d51('0x10')](_0x3d51('0x11'),config[_0x3d51('0x2')]['port']);logger[_0x3d51('0x12')](util[_0x3d51('0x13')](_0x3d51('0x14'),config[_0x3d51('0x2')]['ip'],config['agi'][_0x3d51('0x15')]));}function errorHandler(_0x290f52){if(_0x290f52&&_0x290f52[_0x3d51('0x16')]&&_0x290f52['message']){logger[_0x3d51('0xa')](util[_0x3d51('0x13')](_0x3d51('0x17'),_0x290f52[_0x3d51('0x16')],_0x290f52[_0x3d51('0x18')]));}else{logger[_0x3d51('0xa')](util[_0x3d51('0x13')](_0x3d51('0x19'),_0x290f52[_0x3d51('0xf')]));}}function closeHandler(){logger[_0x3d51('0x12')](util[_0x3d51('0x13')](_0x3d51('0x1a'),this[_0x3d51('0x1b')],this['calleridname'],this[_0x3d51('0x1c')],this[_0x3d51('0x1d')],this[_0x3d51('0x1e')]));try{createSquareReport(this);}catch(_0xdd70f2){logger[_0x3d51('0xa')](_0xdd70f2[_0x3d51('0xf')]);}}function timeoutHandler(){logger['info'](util[_0x3d51('0x13')](_0x3d51('0x1f'),this[_0x3d51('0x1b')],this[_0x3d51('0x20')],this[_0x3d51('0x1c')],this[_0x3d51('0x1d')],this[_0x3d51('0x1e')]));}function hangupHandler(){logger['info'](util['format'](_0x3d51('0x21'),this[_0x3d51('0x1b')],this[_0x3d51('0x20')],this[_0x3d51('0x1c')],this['dnid'],this[_0x3d51('0x1e')]));this[_0x3d51('0x22')]=!![];}function createSquareReport(_0x563814,_0x5423a8){rpc[_0x3d51('0x23')](_0x563814)[_0x3d51('0x24')](function(_0x2fa9b9){if(_0x5423a8){_0x5423a8(null,_0x2fa9b9);}})[_0x3d51('0x25')](function(_0x2a7875){if(_0x5423a8){_0x5423a8(null,_0x2a7875);}});}function setChannelVariables(_0x5ae74e){for(var _0x19f10d in _0x5ae74e){if(_0x5ae74e[_0x3d51('0x26')](_0x19f10d)){if(_0x19f10d[_0x3d51('0x27')]('agi_')===0x0){_0x5ae74e[_0x19f10d['substring'](0x4)]=_0x5ae74e[_0x19f10d];delete _0x5ae74e[_0x19f10d];}}}}function agiHandler(_0x309a21){logger[_0x3d51('0x28')]('variables',JSON['stringify'](_0x309a21,null,0x2));logger[_0x3d51('0x12')](util[_0x3d51('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x309a21[_0x3d51('0x1b')],_0x309a21['calleridname'],_0x309a21[_0x3d51('0x1c')],_0x309a21[_0x3d51('0x1d')],_0x309a21[_0x3d51('0x1e')]));_0x309a21['on']('error',errorHandler);_0x309a21['on'](_0x3d51('0x29'),closeHandler);_0x309a21['on'](_0x3d51('0x2a'),timeoutHandler);_0x309a21[_0x3d51('0x22')]=![];_0x309a21['on'](_0x3d51('0x2b'),hangupHandler);var _0x52d29d=_[_0x3d51('0x2c')](projects,[_0x3d51('0x16'),_0x309a21[_0x3d51('0x1b')]]);if(!_0x52d29d)return Project[_0x3d51('0x2d')](_0x309a21);if(!_0x52d29d[_0x3d51('0x2e')])return Project[_0x3d51('0x2f')](_0x309a21);return Project['initialize'](_0x52d29d,_0x309a21);}function main(){var _0x30a418;return utilLicense['getLicense']()[_0x3d51('0x24')](function(_0x2da1a2){if(!_0x2da1a2)return;if(_0x2da1a2[_0x3d51('0x30')]){if(_0x2da1a2[_0x3d51('0x31')]&&_0x2da1a2[_0x3d51('0x31')]>0x0){logger[_0x3d51('0x12')](util[_0x3d51('0x13')](_0x3d51('0x32'),_0x2da1a2[_0x3d51('0x31')]));_0x30a418=_0x2da1a2[_0x3d51('0x31')];}else{logger[_0x3d51('0x12')](_0x3d51('0x33'));}}else{logger[_0x3d51('0x12')](_0x3d51('0x34'));_0x30a418=-0x1;}})['then'](function(){return Project['getAll']();})[_0x3d51('0x24')](function(_0x2b7cbe){projects=_0x2b7cbe;return;})[_0x3d51('0x25')](function(_0x1b4c1b){logger[_0x3d51('0xa')](_0x3d51('0x35'),_0x1b4c1b[_0x3d51('0xf')]);})['finally'](function(){var _0xb3aceb=require('./server')(config['agi'][_0x3d51('0x15')],config[_0x3d51('0x2')]['ip'],_0x30a418);_0xb3aceb['on'](_0x3d51('0xa'),errorHandler);_0xb3aceb['on'](_0x3d51('0x36'),listeningHandler);_0xb3aceb['on'](_0x3d51('0x37'),connectionHandler);_0xb3aceb['on'](_0x3d51('0x29'),closeHandler);});}main(); \ No newline at end of file +var _0x5534=['lodash','syncho','util','../../config/environment','./project','EventEmitter','agi','defaults','127.0.0.1','nextTick','stack','findIndex','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','error','[%s]\x20%s','[ERROR]\x20%s','calleridname','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','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','production','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','./server','listening','connection'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0x5534,0xa5));var _0x4553=function(_0x1b5d93,_0x4f20c8){_0x1b5d93=_0x1b5d93-0x0;var _0x4f54ed=_0x5534[_0x1b5d93];return _0x4f54ed;};'use strict';var _=require(_0x4553('0x0'));var syncho=require(_0x4553('0x1'));var util=require(_0x4553('0x2'));var config=require(_0x4553('0x3'));var logger=require('../../config/logger')('agi');var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x4553('0x4'));var AGIEmitter=require('./events')[_0x4553('0x5')];var projects=[];config[_0x4553('0x6')]=_[_0x4553('0x7')](config[_0x4553('0x6')],{'ip':_0x4553('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x23fcc0){process[_0x4553('0x9')](function(){syncho(function(){try{setChannelVariables(_0x23fcc0);agiHandler(_0x23fcc0);}catch(_0xd41113){logger['error'](_0xd41113[_0x4553('0xa')]);}});});}function projectUpdateHandler(_0xa69384){try{var _0x26d4ce=_[_0x4553('0xb')](projects,['id',_0xa69384['id']]);if(_0x26d4ce>-0x1){if(_0xa69384['deleted']===!![]){projects['splice'](_0x26d4ce,0x1);}else{projects[_0x26d4ce]=_0xa69384;}}else{projects[_0x4553('0xc')](_0xa69384);}}catch(_0x3c649f){logger['error'](_0x3c649f[_0x4553('0xa')]);}}function listeningHandler(){console[_0x4553('0xd')](_0x4553('0xe'),config['agi'][_0x4553('0xf')]);logger['info'](util[_0x4553('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x4553('0x6')]['ip'],config[_0x4553('0x6')][_0x4553('0xf')]));}function errorHandler(_0x4bd39e){if(_0x4bd39e&&_0x4bd39e[_0x4553('0x11')]&&_0x4bd39e[_0x4553('0x12')]){logger[_0x4553('0x13')](util['format'](_0x4553('0x14'),_0x4bd39e[_0x4553('0x11')],_0x4bd39e[_0x4553('0x12')]));}else{logger[_0x4553('0x13')](util['format'](_0x4553('0x15'),_0x4bd39e[_0x4553('0xa')]));}}function closeHandler(){logger['info'](util[_0x4553('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x4553('0x16')],this[_0x4553('0x17')],this[_0x4553('0x18')],this[_0x4553('0x19')]));try{createSquareReport(this);}catch(_0x567bc9){logger[_0x4553('0x13')](_0x567bc9[_0x4553('0xa')]);}}function timeoutHandler(){logger[_0x4553('0x1a')](util[_0x4553('0x10')](_0x4553('0x1b'),this[_0x4553('0x1c')],this['calleridname'],this['callerid'],this[_0x4553('0x18')],this[_0x4553('0x19')]));}function hangupHandler(){logger[_0x4553('0x1a')](util['format'](_0x4553('0x1d'),this['arg_1'],this[_0x4553('0x16')],this['callerid'],this[_0x4553('0x18')],this['uniqueid']));this[_0x4553('0x1e')]=!![];}function createSquareReport(_0x98976f,_0x5ecda3){rpc[_0x4553('0x1f')](_0x98976f)[_0x4553('0x20')](function(_0x443b74){if(_0x5ecda3){_0x5ecda3(null,_0x443b74);}})[_0x4553('0x21')](function(_0xef7bb3){if(_0x5ecda3){_0x5ecda3(null,_0xef7bb3);}});}function setChannelVariables(_0x28fafd){for(var _0x2faaf0 in _0x28fafd){if(_0x28fafd[_0x4553('0x22')](_0x2faaf0)){if(_0x2faaf0[_0x4553('0x23')](_0x4553('0x24'))===0x0){_0x28fafd[_0x2faaf0['substring'](0x4)]=_0x28fafd[_0x2faaf0];delete _0x28fafd[_0x2faaf0];}}}}function agiHandler(_0x5f3ef6){logger[_0x4553('0x25')]('variables',JSON[_0x4553('0x26')](_0x5f3ef6,null,0x2));logger[_0x4553('0x1a')](util[_0x4553('0x10')](_0x4553('0x27'),_0x5f3ef6[_0x4553('0x1c')],_0x5f3ef6[_0x4553('0x16')],_0x5f3ef6[_0x4553('0x17')],_0x5f3ef6['dnid'],_0x5f3ef6[_0x4553('0x19')]));_0x5f3ef6['on']('error',errorHandler);_0x5f3ef6['on'](_0x4553('0x28'),closeHandler);_0x5f3ef6['on'](_0x4553('0x29'),timeoutHandler);_0x5f3ef6['evtHangup']=![];_0x5f3ef6['on']('hangup',hangupHandler);var _0xf86490=_[_0x4553('0x2a')](projects,[_0x4553('0x11'),_0x5f3ef6[_0x4553('0x1c')]]);if(!_0xf86490)return Project['handleNotFound'](_0x5f3ef6);if(!_0xf86490[_0x4553('0x2b')])return Project['handleUnpublished'](_0x5f3ef6);return Project[_0x4553('0x2c')](_0xf86490,_0x5f3ef6);}function main(){var _0x35e808;return utilLicense[_0x4553('0x2d')]()[_0x4553('0x20')](function(_0x2ae595){if(!_0x2ae595)return;if(_0x2ae595[_0x4553('0x2e')]){if(_0x2ae595[_0x4553('0x2f')]&&_0x2ae595[_0x4553('0x2f')]>0x0){logger[_0x4553('0x1a')](util[_0x4553('0x10')](_0x4553('0x30'),_0x2ae595[_0x4553('0x2f')]));_0x35e808=_0x2ae595[_0x4553('0x2f')];}else{logger[_0x4553('0x1a')](_0x4553('0x31'));}}else{logger[_0x4553('0x1a')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x35e808=-0x1;}})[_0x4553('0x20')](function(){return Project[_0x4553('0x32')]();})[_0x4553('0x20')](function(_0x279948){projects=_0x279948;return;})[_0x4553('0x21')](function(_0x124c61){logger[_0x4553('0x13')](_0x4553('0x33'),_0x124c61[_0x4553('0xa')]);})['finally'](function(){var _0x5475e9=require(_0x4553('0x34'))(config[_0x4553('0x6')][_0x4553('0xf')],config[_0x4553('0x6')]['ip'],_0x35e808);_0x5475e9['on'](_0x4553('0x13'),errorHandler);_0x5475e9['on'](_0x4553('0x35'),listeningHandler);_0x5475e9['on'](_0x4553('0x36'),connectionHandler);_0x5475e9['on'](_0x4553('0x28'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 6ba4b49..78cea7d 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 _0x2fee=['sendMailMessage','SendMail','bluebird','jayson/promise','http','request','error','message','result','catch'];(function(_0x2c8fe6,_0x257f32){var _0x1203c0=function(_0xd36352){while(--_0xd36352){_0x2c8fe6['push'](_0x2c8fe6['shift']());}};_0x1203c0(++_0x257f32);}(_0x2fee,0x11a));var _0xe2fe=function(_0x2eaedf,_0x481885){_0x2eaedf=_0x2eaedf-0x0;var _0x4b0bf8=_0x2fee[_0x2eaedf];return _0x4b0bf8;};'use strict';var BPromise=require(_0xe2fe('0x0'));var jayson=require(_0xe2fe('0x1'));var client=jayson['client'][_0xe2fe('0x2')]({'port':0x232b});function request(_0x58eb5f,_0x16c3c8){return new BPromise(function(_0x1df3b,_0x21d8f7){return client[_0xe2fe('0x3')](_0x58eb5f,_0x16c3c8)['then'](function(_0x1d222f){if(_0x1d222f[_0xe2fe('0x4')]){return _0x21d8f7(_0x1d222f[_0xe2fe('0x4')][_0xe2fe('0x5')]);}else{return _0x1df3b(_0x1d222f[_0xe2fe('0x6')]);}})[_0xe2fe('0x7')](function(_0x397f99){return _0x21d8f7(_0x397f99);});});}exports[_0xe2fe('0x8')]=function(_0x42d2ff,_0x354135){return request(_0xe2fe('0x9'),{'account':_0x42d2ff,'message':_0x354135});}; \ No newline at end of file +var _0x8bfb=['result','catch','sendMailMessage','SendMail','bluebird','client','request','error'];(function(_0x46809b,_0xf62788){var _0x14d974=function(_0x357258){while(--_0x357258){_0x46809b['push'](_0x46809b['shift']());}};_0x14d974(++_0xf62788);}(_0x8bfb,0x1f4));var _0xb8bf=function(_0x32e820,_0x1f9a44){_0x32e820=_0x32e820-0x0;var _0x43bc7a=_0x8bfb[_0x32e820];return _0x43bc7a;};'use strict';var BPromise=require(_0xb8bf('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb8bf('0x1')]['http']({'port':0x232b});function request(_0x7ee6f2,_0x4a2887){return new BPromise(function(_0x430a54,_0x3ff36b){return client[_0xb8bf('0x2')](_0x7ee6f2,_0x4a2887)['then'](function(_0x33ceb0){if(_0x33ceb0[_0xb8bf('0x3')]){return _0x3ff36b(_0x33ceb0[_0xb8bf('0x3')]['message']);}else{return _0x430a54(_0x33ceb0[_0xb8bf('0x4')]);}})[_0xb8bf('0x5')](function(_0x539a94){return _0x3ff36b(_0x539a94);});});}exports[_0xb8bf('0x6')]=function(_0x4349b7,_0x8e5490){return request(_0xb8bf('0x7'),{'account':_0x4349b7,'message':_0x8e5490});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 8535686..4de67f3 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 _0x2ef7=['Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','mxGraphModel','root','inspect','production','start','debug','stringify','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','vertex','context','extension','priority','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util','agi','./rpc','./mailRpc','./graph','./vertices','catch','error'];(function(_0x331c34,_0x4ec4dc){var _0x246192=function(_0x395c1b){while(--_0x395c1b){_0x331c34['push'](_0x331c34['shift']());}};_0x246192(++_0x4ec4dc);}(_0x2ef7,0x6b));var _0x72ef=function(_0x5c099a,_0x3a573f){_0x5c099a=_0x5c099a-0x0;var _0x373d62=_0x2ef7[_0x5c099a];return _0x373d62;};'use strict';var _=require(_0x72ef('0x0'));var moment=require(_0x72ef('0x1'));var parser=require(_0x72ef('0x2'));var util=require(_0x72ef('0x3'));var logger=require('../../config/logger')(_0x72ef('0x4'));var rpc=require(_0x72ef('0x5'));var mailRpc=require(_0x72ef('0x6'));var Graph=require(_0x72ef('0x7'));var Vertices=require(_0x72ef('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x72ef('0x9')](function(_0x1903e0){logger[_0x72ef('0xa')](_0x72ef('0xb'),_0x1903e0[_0x72ef('0xc')]);return[];});}function addVertex(_0x46309e,_0x2e9e24,_0x43d00d){_0x2e9e24[_0x72ef('0xd')]=_0x43d00d;if(_0x2e9e24['hasOwnProperty'](_0x72ef('0xe'))){_0x2e9e24[_0x72ef('0xf')]=parseInt(_0x2e9e24[_0x72ef('0xe')],0xa);}_0x46309e[_0x72ef('0x10')](_[_0x72ef('0x11')](_0x2e9e24,_0x72ef('0x12')));}function initGraph(_0x499664,_0x41c537){var _0x3b9edd=new Graph();for(var _0x20d6ce in _0x499664){if(_0x499664['hasOwnProperty'](_0x20d6ce)){if(_[_0x72ef('0x13')](_0x499664[_0x20d6ce])){for(var _0x221b96=0x0;_0x221b96<_0x499664[_0x20d6ce][_0x72ef('0x14')];_0x221b96+=0x1){addVertex(_0x3b9edd,_0x499664[_0x20d6ce][_0x221b96],_0x20d6ce);}}else{addVertex(_0x3b9edd,_0x499664[_0x20d6ce],_0x20d6ce);}}}for(var _0x509573=0x0;_0x509573<_0x41c537['length'];_0x509573+=0x1){if(_0x41c537[_0x509573][_0x72ef('0x15')]&&_0x41c537[_0x509573][_0x72ef('0x16')]){_0x3b9edd[_0x72ef('0x17')](_0x41c537[_0x509573]['source'],_0x41c537[_0x509573]['target'],_0x41c537[_0x509573]['value']);}}return _0x3b9edd;}function getRoot(_0x49a33a){return parser['toJson'](_0x49a33a,{'object':!![]})[_0x72ef('0x18')][_0x72ef('0x19')];}function inspect(_0x510aec){return util[_0x72ef('0x1a')](_0x510aec,{'showHidden':![],'depth':null});}function initialize(_0xe96013,_0x56ca10){var _0x496638=getRoot(_0xe96013[_0x72ef('0x1b')]);if(!_0x496638||!_0x496638[_0x72ef('0x1c')])return;var _0x1f52bc,_0x541cc2,_0x323942;logger[_0x72ef('0x1d')](_0x72ef('0x19'),JSON[_0x72ef('0x1e')](_0x496638,null,0x2));_0x56ca10['joinAt']=moment()[_0x72ef('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f52bc=initGraph(_[_0x72ef('0x11')](_0x496638,_0x72ef('0x12')),_0x496638['mxCell']);_0x541cc2=new Vertices(_0x56ca10,rpc,mailRpc);logger[_0x72ef('0x20')](util['format'](_0x72ef('0x21'),_0x56ca10[_0x72ef('0x22')],_0x56ca10[_0x72ef('0x23')],_0x56ca10[_0x72ef('0x24')],_0x56ca10[_0x72ef('0x25')],_0x56ca10[_0x72ef('0x26')]));_0x1f52bc[_0x72ef('0x27')](_0x496638[_0x72ef('0x1c')]['id'],function(_0x5e0856){try{_0x5e0856=_0x541cc2['clear'](_0x5e0856);logger['debug'](_0x72ef('0x28'),JSON[_0x72ef('0x1e')](_0x5e0856,null,0x2));if(_0x5e0856[_0x72ef('0xd')]==='gotoc'){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x56ca10[_0x72ef('0x29')]=_0x5e0856['context']||_0x56ca10[_0x72ef('0x29')];_0x56ca10[_0x72ef('0x2a')]=_0x5e0856[_0x72ef('0x2a')];_0x56ca10[_0x72ef('0x2b')]=_0x5e0856[_0x72ef('0x2b')]?_0x5e0856['priority']-0x1:0x1;return null;}else if(_0x5e0856&&_0x541cc2[_0x5e0856[_0x72ef('0xd')]]){_0x323942=_0x541cc2[_0x5e0856[_0x72ef('0xd')]](_0x5e0856);logger[_0x72ef('0x20')]('response',JSON[_0x72ef('0x1e')](_0x323942,null,0x2));if(_0x323942&&_0x323942['code']===AGI_CODE_SUCCESS&&_0x323942[_0x72ef('0x2c')]!==AGI_RESULT_ERROR&&!_0x56ca10[_0x72ef('0x2d')]){logger[_0x72ef('0x1d')](_0x72ef('0x2e'),inspect(_0x323942));return _[_0x72ef('0x2f')](_0x323942[_0x72ef('0x2c')])?null:_0x323942['result'][_0x72ef('0x30')]();}else{logger[_0x72ef('0xa')](_0x72ef('0x2e'),inspect(_0x323942));return null;}}else{logger['error'](_0x72ef('0x31'));return null;}}catch(_0x5eadbe){logger['error'](_0x5eadbe[_0x72ef('0xc')]);return null;}});if(_0x496638[_0x72ef('0x32')]){logger[_0x72ef('0x20')](util[_0x72ef('0x1f')](_0x72ef('0x33'),_0x56ca10['arg_1'],_0x56ca10[_0x72ef('0x23')],_0x56ca10[_0x72ef('0x24')],_0x56ca10['dnid'],_0x56ca10[_0x72ef('0x26')]));_0x1f52bc['traverseBFS'](_0x496638[_0x72ef('0x32')]['id'],function(_0x5d030b){try{_0x5d030b=_0x541cc2[_0x72ef('0x34')](_0x5d030b);logger[_0x72ef('0x1d')](_0x72ef('0x28'),JSON[_0x72ef('0x1e')](_0x5d030b,null,0x2));if(_0x5d030b&&_0x541cc2[_0x5d030b[_0x72ef('0xd')]]){_0x323942=_0x541cc2[_0x5d030b['agicommand']](_0x5d030b);if(_0x323942){logger[_0x72ef('0x1d')](_0x72ef('0x2e'),inspect(_0x323942));return _[_0x72ef('0x2f')](_0x323942[_0x72ef('0x2c')])?null:_0x323942['result'][_0x72ef('0x30')]();}else{logger[_0x72ef('0xa')](_0x72ef('0x2e'),inspect(_0x323942));return null;}}else{logger['error'](_0x72ef('0x31'));return null;}}catch(_0x1ac44e){logger[_0x72ef('0xa')](_0x1ac44e['stack']);return null;}});}logger[_0x72ef('0x20')](util['format'](_0x72ef('0x35'),_0x56ca10['arg_1'],_0x56ca10[_0x72ef('0x23')],_0x56ca10[_0x72ef('0x24')],_0x56ca10[_0x72ef('0x25')],_0x56ca10[_0x72ef('0x26')]));logger[_0x72ef('0x20')](util[_0x72ef('0x1f')](_0x72ef('0x36'),_0x56ca10[_0x72ef('0x29')],_0x56ca10[_0x72ef('0x2a')],parseInt(_0x56ca10[_0x72ef('0x2b')],0xa)+0x1));_0x56ca10[_0x72ef('0x37')](_0x56ca10['context'],_0x56ca10[_0x72ef('0x2a')],parseInt(_0x56ca10[_0x72ef('0x2b')],0xa)+0x1);_0x56ca10[_0x72ef('0x38')]();}function handleNotFound(_0xdd8238){logger['error'](util['format'](_0x72ef('0x39'),_0xdd8238[_0x72ef('0x22')]));_0xdd8238[_0x72ef('0x37')](_0xdd8238[_0x72ef('0x29')],_0xdd8238[_0x72ef('0x2a')],parseInt(_0xdd8238['priority'],0xa)+0x1);_0xdd8238['close']();}function handleUnpublished(_0xbaa992){logger['error'](util[_0x72ef('0x1f')](_0x72ef('0x3a'),_0xbaa992[_0x72ef('0x22')]));_0xbaa992[_0x72ef('0x37')](_0xbaa992['context'],_0xbaa992['extension'],parseInt(_0xbaa992[_0x72ef('0x2b')],0xa)+0x1);_0xbaa992[_0x72ef('0x38')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xda3e=['addVertex','mxCell','length','target','source','value','toJson','mxGraphModel','root','production','start','stringify','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','traverseBFS','clear','debug','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','stack','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','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','context','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','./rpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry'];(function(_0x4573f2,_0x51000f){var _0x49f692=function(_0x3488c3){while(--_0x3488c3){_0x4573f2['push'](_0x4573f2['shift']());}};_0x49f692(++_0x51000f);}(_0xda3e,0xa4));var _0xeda3=function(_0x10f746,_0x180311){_0x10f746=_0x10f746-0x0;var _0xcaf5f8=_0xda3e[_0x10f746];return _0xcaf5f8;};'use strict';var _=require(_0xeda3('0x0'));var moment=require(_0xeda3('0x1'));var parser=require(_0xeda3('0x2'));var util=require(_0xeda3('0x3'));var logger=require('../../config/logger')('agi');var rpc=require(_0xeda3('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0xeda3('0x5'));var Vertices=require(_0xeda3('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xeda3('0x7')](function(_0x190564){logger[_0xeda3('0x8')](_0xeda3('0x9'),_0x190564['stack']);return[];});}function addVertex(_0x4eb031,_0x590909,_0x13011f){_0x590909[_0xeda3('0xa')]=_0x13011f;if(_0x590909[_0xeda3('0xb')]('retry')){_0x590909['maxRetry']=parseInt(_0x590909[_0xeda3('0xc')],0xa);}_0x4eb031[_0xeda3('0xd')](_['omit'](_0x590909,_0xeda3('0xe')));}function initGraph(_0x304f36,_0xdbe2f9){var _0x5513dd=new Graph();for(var _0x5b3652 in _0x304f36){if(_0x304f36[_0xeda3('0xb')](_0x5b3652)){if(_['isArray'](_0x304f36[_0x5b3652])){for(var _0x53984d=0x0;_0x53984d<_0x304f36[_0x5b3652][_0xeda3('0xf')];_0x53984d+=0x1){addVertex(_0x5513dd,_0x304f36[_0x5b3652][_0x53984d],_0x5b3652);}}else{addVertex(_0x5513dd,_0x304f36[_0x5b3652],_0x5b3652);}}}for(var _0x21dde2=0x0;_0x21dde2<_0xdbe2f9[_0xeda3('0xf')];_0x21dde2+=0x1){if(_0xdbe2f9[_0x21dde2]['source']&&_0xdbe2f9[_0x21dde2][_0xeda3('0x10')]){_0x5513dd['addEdge'](_0xdbe2f9[_0x21dde2][_0xeda3('0x11')],_0xdbe2f9[_0x21dde2][_0xeda3('0x10')],_0xdbe2f9[_0x21dde2][_0xeda3('0x12')]);}}return _0x5513dd;}function getRoot(_0x3f4cb4){return parser[_0xeda3('0x13')](_0x3f4cb4,{'object':!![]})[_0xeda3('0x14')][_0xeda3('0x15')];}function inspect(_0x1a1eb6){return util['inspect'](_0x1a1eb6,{'showHidden':![],'depth':null});}function initialize(_0x562002,_0xefff8b){var _0x404a2a=getRoot(_0x562002[_0xeda3('0x16')]);if(!_0x404a2a||!_0x404a2a[_0xeda3('0x17')])return;var _0x26a9c4,_0x4d167d,_0x3f99aa;logger['debug'](_0xeda3('0x15'),JSON[_0xeda3('0x18')](_0x404a2a,null,0x2));_0xefff8b['joinAt']=moment()[_0xeda3('0x19')](_0xeda3('0x1a'));_0x26a9c4=initGraph(_['omit'](_0x404a2a,_0xeda3('0xe')),_0x404a2a[_0xeda3('0xe')]);_0x4d167d=new Vertices(_0xefff8b,rpc,mailRpc);logger['info'](util[_0xeda3('0x19')](_0xeda3('0x1b'),_0xefff8b[_0xeda3('0x1c')],_0xefff8b[_0xeda3('0x1d')],_0xefff8b[_0xeda3('0x1e')],_0xefff8b['dnid'],_0xefff8b['uniqueid']));_0x26a9c4[_0xeda3('0x1f')](_0x404a2a[_0xeda3('0x17')]['id'],function(_0x5daf66){try{_0x5daf66=_0x4d167d[_0xeda3('0x20')](_0x5daf66);logger[_0xeda3('0x21')](_0xeda3('0x22'),JSON[_0xeda3('0x18')](_0x5daf66,null,0x2));if(_0x5daf66[_0xeda3('0xa')]===_0xeda3('0x23')){logger[_0xeda3('0x24')](_0xeda3('0x25'));_0xefff8b['context']=_0x5daf66['context']||_0xefff8b['context'];_0xefff8b[_0xeda3('0x26')]=_0x5daf66[_0xeda3('0x26')];_0xefff8b[_0xeda3('0x27')]=_0x5daf66[_0xeda3('0x27')]?_0x5daf66[_0xeda3('0x27')]-0x1:0x1;return null;}else if(_0x5daf66&&_0x4d167d[_0x5daf66['agicommand']]){_0x3f99aa=_0x4d167d[_0x5daf66[_0xeda3('0xa')]](_0x5daf66);logger[_0xeda3('0x24')](_0xeda3('0x28'),JSON[_0xeda3('0x18')](_0x3f99aa,null,0x2));if(_0x3f99aa&&_0x3f99aa[_0xeda3('0x29')]===AGI_CODE_SUCCESS&&_0x3f99aa[_0xeda3('0x2a')]!==AGI_RESULT_ERROR&&!_0xefff8b[_0xeda3('0x2b')]){logger[_0xeda3('0x21')](_0xeda3('0x28'),inspect(_0x3f99aa));return _[_0xeda3('0x2c')](_0x3f99aa['result'])?null:_0x3f99aa[_0xeda3('0x2a')][_0xeda3('0x2d')]();}else{logger['error'](_0xeda3('0x28'),inspect(_0x3f99aa));return null;}}else{logger[_0xeda3('0x8')](_0xeda3('0x2e'));return null;}}catch(_0x478ff0){logger[_0xeda3('0x8')](_0x478ff0[_0xeda3('0x2f')]);return null;}});if(_0x404a2a['finally']){logger[_0xeda3('0x24')](util['format'](_0xeda3('0x30'),_0xefff8b[_0xeda3('0x1c')],_0xefff8b[_0xeda3('0x1d')],_0xefff8b[_0xeda3('0x1e')],_0xefff8b[_0xeda3('0x31')],_0xefff8b[_0xeda3('0x32')]));_0x26a9c4[_0xeda3('0x1f')](_0x404a2a[_0xeda3('0x33')]['id'],function(_0x5a42e5){try{_0x5a42e5=_0x4d167d['clear'](_0x5a42e5);logger[_0xeda3('0x21')](_0xeda3('0x22'),JSON[_0xeda3('0x18')](_0x5a42e5,null,0x2));if(_0x5a42e5&&_0x4d167d[_0x5a42e5[_0xeda3('0xa')]]){_0x3f99aa=_0x4d167d[_0x5a42e5['agicommand']](_0x5a42e5);if(_0x3f99aa){logger[_0xeda3('0x21')](_0xeda3('0x28'),inspect(_0x3f99aa));return _[_0xeda3('0x2c')](_0x3f99aa[_0xeda3('0x2a')])?null:_0x3f99aa[_0xeda3('0x2a')][_0xeda3('0x2d')]();}else{logger[_0xeda3('0x8')](_0xeda3('0x28'),inspect(_0x3f99aa));return null;}}else{logger[_0xeda3('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x132a0a){logger[_0xeda3('0x8')](_0x132a0a[_0xeda3('0x2f')]);return null;}});}logger['info'](util[_0xeda3('0x19')](_0xeda3('0x34'),_0xefff8b[_0xeda3('0x1c')],_0xefff8b[_0xeda3('0x1d')],_0xefff8b[_0xeda3('0x1e')],_0xefff8b[_0xeda3('0x31')],_0xefff8b['uniqueid']));logger[_0xeda3('0x24')](util[_0xeda3('0x19')](_0xeda3('0x35'),_0xefff8b[_0xeda3('0x36')],_0xefff8b['extension'],parseInt(_0xefff8b[_0xeda3('0x27')],0xa)+0x1));_0xefff8b[_0xeda3('0x37')](_0xefff8b[_0xeda3('0x36')],_0xefff8b[_0xeda3('0x26')],parseInt(_0xefff8b['priority'],0xa)+0x1);_0xefff8b[_0xeda3('0x38')]();}function handleNotFound(_0x46262c){logger[_0xeda3('0x8')](util['format']('Project\x20%s\x20not\x20found',_0x46262c[_0xeda3('0x1c')]));_0x46262c['continueAt'](_0x46262c['context'],_0x46262c['extension'],parseInt(_0x46262c['priority'],0xa)+0x1);_0x46262c['close']();}function handleUnpublished(_0x66dbf2){logger[_0xeda3('0x8')](util['format'](_0xeda3('0x39'),_0x66dbf2[_0xeda3('0x1c')]));_0x66dbf2[_0xeda3('0x37')](_0x66dbf2[_0xeda3('0x36')],_0x66dbf2[_0xeda3('0x26')],parseInt(_0x66dbf2[_0xeda3('0x27')],0xa)+0x1);_0x66dbf2[_0xeda3('0x38')]();}module[_0xeda3('0x3a')]={'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 dbf04b7..6867b4b 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 _0xa226=['_transform','toString','substring','length','indexOf','slice','trim','emit','headers','exports','stream','call','_localBuffer','_inBody','prototype'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0xa226,0x64));var _0x6a22=function(_0x34010b,_0x25590f){_0x34010b=_0x34010b-0x0;var _0xd1b7b2=_0xa226[_0x34010b];return _0xd1b7b2;};'use strict';var util=require('util');var Transform=require(_0x6a22('0x0'))['Transform'];function AGIReply(_0x1077ff){Transform[_0x6a22('0x1')](this,_0x1077ff);this[_0x6a22('0x2')]='';this[_0x6a22('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x6a22('0x4')][_0x6a22('0x5')]=function(_0xd3658d,_0x911097,_0x4d4fa4){var _0x3b03e4='\x0a',_0x1a7067=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4c6879=-0x1,_0x59ae55=-0x1,_0x373744='',_0x266173=0x0,_0x3543d1='',_0x43c2d5='';this[_0x6a22('0x2')]+=_0xd3658d[_0x6a22('0x6')]();_0x3543d1=this[_0x6a22('0x2')];if(!this['_inBody']){_0x266173=0x0;while(_0x1a7067[_0x266173]){while((_0x59ae55=_0x3543d1['indexOf'](_0x1a7067[_0x266173]))!=-0x1){_0x373744=_0x1a7067[_0x266173];_0x43c2d5=_0x3543d1[_0x6a22('0x7')](0x0,_0x59ae55);_0x3543d1=_0x3543d1[_0x6a22('0x7')](_0x59ae55+_0x373744[_0x6a22('0x8')]);var _0x143444=_0x43c2d5['split'](_0x3b03e4),_0x39c4d3=0x0,_0x42b537={},_0x1b29c1='',_0x223a9a='',_0x16158d=-0x1;while(_0x143444[_0x39c4d3]){_0x16158d=_0x143444[_0x39c4d3][_0x6a22('0x9')](':');if(_0x16158d!=-0x1){_0x1b29c1=_0x143444[_0x39c4d3][_0x6a22('0xa')](0x0,_0x16158d)[_0x6a22('0xb')]();_0x223a9a=_0x143444[_0x39c4d3]['slice'](_0x16158d+0x1)[_0x6a22('0xb')]();if(_0x1b29c1[_0x6a22('0x8')]>0x0){_0x42b537[_0x1b29c1]=_0x223a9a;}}else{}_0x39c4d3++;}this[_0x6a22('0xc')](_0x6a22('0xd'),_0x42b537);this[_0x6a22('0x3')]=!![];}_0x266173++;}this[_0x6a22('0x2')]=_0x3543d1;}else{while((_0x4c6879=_0x3543d1[_0x6a22('0x9')](_0x3b03e4))!=-0x1){_0x43c2d5=_0x3543d1['substring'](0x0,_0x4c6879);this[_0x6a22('0xc')]('line',_0x43c2d5);_0x3543d1=_0x3543d1[_0x6a22('0x7')](_0x4c6879+_0x3b03e4['length']);}this['_localBuffer']=_0x3543d1;}_0x4d4fa4();};module[_0x6a22('0xe')]=AGIReply; \ No newline at end of file +var _0x76c1=['_inBody','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','exports','util','stream','Transform','call','_localBuffer'];(function(_0x5b080b,_0xe34631){var _0x3d724c=function(_0x3175ac){while(--_0x3175ac){_0x5b080b['push'](_0x5b080b['shift']());}};_0x3d724c(++_0xe34631);}(_0x76c1,0x1b5));var _0x176c=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x76c1[_0x2db12b];return _0x20990b;};'use strict';var util=require(_0x176c('0x0'));var Transform=require(_0x176c('0x1'))[_0x176c('0x2')];function AGIReply(_0x1eac65){Transform[_0x176c('0x3')](this,_0x1eac65);this[_0x176c('0x4')]='';this[_0x176c('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x176c('0x6')]['_transform']=function(_0x5a2f77,_0x4c7aae,_0x4b15ba){var _0xf5f1fa='\x0a',_0x146f8e=['\x0a\x0a',_0x176c('0x7')],_0x52e5c2=-0x1,_0x1ac8a2=-0x1,_0x160ab1='',_0x57990a=0x0,_0xf5c5c5='',_0x39f0c9='';this['_localBuffer']+=_0x5a2f77[_0x176c('0x8')]();_0xf5c5c5=this['_localBuffer'];if(!this[_0x176c('0x5')]){_0x57990a=0x0;while(_0x146f8e[_0x57990a]){while((_0x1ac8a2=_0xf5c5c5[_0x176c('0x9')](_0x146f8e[_0x57990a]))!=-0x1){_0x160ab1=_0x146f8e[_0x57990a];_0x39f0c9=_0xf5c5c5[_0x176c('0xa')](0x0,_0x1ac8a2);_0xf5c5c5=_0xf5c5c5[_0x176c('0xa')](_0x1ac8a2+_0x160ab1[_0x176c('0xb')]);var _0x792a=_0x39f0c9[_0x176c('0xc')](_0xf5f1fa),_0x31e6b4=0x0,_0x5b0b49={},_0x13b3f6='',_0x4436b8='',_0x830623=-0x1;while(_0x792a[_0x31e6b4]){_0x830623=_0x792a[_0x31e6b4][_0x176c('0x9')](':');if(_0x830623!=-0x1){_0x13b3f6=_0x792a[_0x31e6b4][_0x176c('0xd')](0x0,_0x830623)[_0x176c('0xe')]();_0x4436b8=_0x792a[_0x31e6b4][_0x176c('0xd')](_0x830623+0x1)[_0x176c('0xe')]();if(_0x13b3f6[_0x176c('0xb')]>0x0){_0x5b0b49[_0x13b3f6]=_0x4436b8;}}else{}_0x31e6b4++;}this[_0x176c('0xf')]('headers',_0x5b0b49);this[_0x176c('0x5')]=!![];}_0x57990a++;}this[_0x176c('0x4')]=_0xf5c5c5;}else{while((_0x52e5c2=_0xf5c5c5[_0x176c('0x9')](_0xf5f1fa))!=-0x1){_0x39f0c9=_0xf5c5c5[_0x176c('0xa')](0x0,_0x52e5c2);this[_0x176c('0xf')]('line',_0x39f0c9);_0xf5c5c5=_0xf5c5c5[_0x176c('0xa')](_0x52e5c2+_0xf5f1fa[_0x176c('0xb')]);}this['_localBuffer']=_0xf5c5c5;}_0x4b15ba();};module[_0x176c('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 0d9b3c4..dbef111 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 _0xcabc=['YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','moment','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format'];(function(_0x5d2e29,_0x1aa0a7){var _0x1f82d4=function(_0x530482){while(--_0x530482){_0x5d2e29['push'](_0x5d2e29['shift']());}};_0x1f82d4(++_0x1aa0a7);}(_0xcabc,0x16a));var _0xccab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcabc[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var moment=require(_0xccab('0x0'));var jayson=require(_0xccab('0x1'));var client=jayson[_0xccab('0x2')][_0xccab('0x3')]({'port':0x2329});function request(_0x313bc9,_0x4cac16){return new Promise(function(_0x2b1e99,_0x38a3af){return client['request'](_0x313bc9,_0x4cac16)[_0xccab('0x4')](function(_0x316f83){if(_0x316f83[_0xccab('0x5')]){return _0x38a3af(_0x316f83['error'][_0xccab('0x6')]);}else{return _0x2b1e99(_0x316f83[_0xccab('0x7')]);}})[_0xccab('0x8')](function(_0x4a6f3c){return _0x38a3af(_0x4a6f3c);});});}exports[_0xccab('0x9')]=function(){return request(_0xccab('0xa'),{'options':{'raw':![],'attributes':['id','name',_0xccab('0xb')]}});};exports[_0xccab('0xc')]=function(_0x1186c9){return request(_0xccab('0xd'),{'options':{'raw':![],'where':{'name':_0x1186c9},'attributes':[_0xccab('0xb')]}});};exports['getMailAccountById']=function(_0x557654){return request(_0xccab('0xe'),{'options':{'raw':![],'where':{'id':_0x557654},'include':[{'model':_0xccab('0xf'),'as':_0xccab('0x10'),'include':[{'model':_0xccab('0x11'),'as':_0xccab('0x11')}]}],'attributes':['id',_0xccab('0x12'),_0xccab('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x100bc8){return request(_0xccab('0xd'),{'options':{'where':{'id':_0x100bc8},'attributes':['name']}});};exports[_0xccab('0x14')]=function(_0x4f0643){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4f0643},'attributes':[_0xccab('0x12')]}});};exports[_0xccab('0x15')]=function(_0x2b571b){return request('ShowVariable',{'options':{'where':{'id':_0x2b571b},'attributes':[_0xccab('0x12')]}});};exports[_0xccab('0x16')]=function(_0x5afd11){return request(_0xccab('0x17'),{'options':{'where':{'id':_0x5afd11},'attributes':[_0xccab('0x18')]}});};exports[_0xccab('0x19')]=function(_0x2aace1){return request(_0xccab('0x1a'),{'options':{'where':{'id':_0x2aace1},'attributes':['name']}});};exports['getContactByPhone']=function(_0x1960e7){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1960e7[_0xccab('0x1b')]},'attributes':['id']}});};exports[_0xccab('0x1c')]=function(_0x10c8fc){return request('ShowTrunk',{'options':{'where':{'id':_0x10c8fc},'attributes':['name']}});};exports[_0xccab('0x1d')]=function(_0x37da0b){return request(_0xccab('0x1e'),{'options':{'where':{'id':_0x37da0b},'attributes':['save_name']}});};exports[_0xccab('0x1f')]=function(_0x51a221){return request(_0xccab('0x20'),{'options':{'raw':![],'where':{'id':_0x51a221},'include':[{'model':_0xccab('0x21'),'as':'Intervals'}]}});};exports[_0xccab('0x22')]=function(_0x1fbb90){return request(_0xccab('0x23'),{'options':{'where':{'id':_0x1fbb90},'attributes':['id',_0xccab('0x12')]}});};exports[_0xccab('0x24')]=function(_0x111fde){return request(_0xccab('0x25'),{'body':_0x111fde});};exports[_0xccab('0x26')]=function(_0x325683){return request(_0xccab('0x27'),{'body':_0x325683});};exports['createSquareReport']=function(_0x416437){return request(_0xccab('0x28'),{'body':_['merge'](_0x416437,{'project_name':_0x416437[_0xccab('0x29')],'prev_project_name':_0x416437[_0xccab('0x2a')]||'','is_subproject':_0x416437[_0xccab('0x2a')]?!![]:![],'leaveAt':moment()[_0xccab('0x2b')](_0xccab('0x2c'))})});};exports[_0xccab('0x2d')]=function(_0xaff45e){return request(_0xccab('0x2e'),{'body':_0xaff45e});};exports[_0xccab('0x2f')]=function(_0x1db304){return request(_0xccab('0x30'),{'body':_0x1db304});};exports[_0xccab('0x31')]=function(_0x23912f){return request(_0xccab('0x32'),{'options':{'raw':![],'where':{'phone':_0x23912f[_0xccab('0x1b')],'ListId':_0x23912f['ListId']}}})[_0xccab('0x4')](function(_0x3bbed1){if(_0x3bbed1){return _0x3bbed1;}return request('CreateCmContact',{'body':_0x23912f});});};exports[_0xccab('0x33')]=function(_0x54b7c9){return request(_0xccab('0x34'),{'options':{'where':{'id':_0x54b7c9},'attributes':[_0xccab('0x12')]}});};exports[_0xccab('0x35')]=function(_0x468d19,_0x490320){return request(_0xccab('0x36'),{'body':{'interface':_0x490320},'options':{'where':_0x468d19}});};exports[_0xccab('0x37')]=function(_0x470f34,_0x2976e8,_0x4a1fb1){return request(_0xccab('0x38'),{'body':{'type':_0x2976e8,'uniqueid':_0x4a1fb1},'options':{'where':_0x470f34}});};exports['agentUnpause']=function(_0x5ef7bc){return request(_0xccab('0x39'),{'body':{},'options':{'where':_0x5ef7bc}});};exports['agentLogout']=function(_0x2ec9f4){return request('LogoutUser',{'body':{},'options':{'where':_0x2ec9f4}});}; \ No newline at end of file +var _0x0faf=['production','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','name','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','lodash','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject'];(function(_0xb7a519,_0x5e2a9e){var _0x294b55=function(_0x50ff79){while(--_0x50ff79){_0xb7a519['push'](_0xb7a519['shift']());}};_0x294b55(++_0x5e2a9e);}(_0x0faf,0x132));var _0xf0fa=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x0faf[_0x24392f];return _0x591e33;};'use strict';var _=require(_0xf0fa('0x0'));var moment=require('moment');var jayson=require(_0xf0fa('0x1'));var client=jayson[_0xf0fa('0x2')][_0xf0fa('0x3')]({'port':0x2329});function request(_0x35a260,_0xccb93e){return new Promise(function(_0xdc9ce3,_0x515b12){return client[_0xf0fa('0x4')](_0x35a260,_0xccb93e)[_0xf0fa('0x5')](function(_0x5d9b58){if(_0x5d9b58[_0xf0fa('0x6')]){return _0x515b12(_0x5d9b58[_0xf0fa('0x6')][_0xf0fa('0x7')]);}else{return _0xdc9ce3(_0x5d9b58[_0xf0fa('0x8')]);}})[_0xf0fa('0x9')](function(_0x587865){return _0x515b12(_0x587865);});});}exports[_0xf0fa('0xa')]=function(){return request(_0xf0fa('0xb'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xf0fa('0xc')]=function(_0x1e8cc0){return request(_0xf0fa('0xd'),{'options':{'raw':![],'where':{'name':_0x1e8cc0},'attributes':[_0xf0fa('0xe')]}});};exports[_0xf0fa('0xf')]=function(_0x1151ea){return request(_0xf0fa('0x10'),{'options':{'raw':![],'where':{'id':_0x1151ea},'include':[{'model':_0xf0fa('0x11'),'as':'Smtp','include':[{'model':_0xf0fa('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xf0fa('0x13'),'email'],'smtp':!![]}});};exports[_0xf0fa('0x14')]=function(_0x17326f){return request(_0xf0fa('0xd'),{'options':{'where':{'id':_0x17326f},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x42591b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x42591b},'attributes':[_0xf0fa('0x13')]}});};exports[_0xf0fa('0x15')]=function(_0x10ce43){return request(_0xf0fa('0x16'),{'options':{'where':{'id':_0x10ce43},'attributes':[_0xf0fa('0x13')]}});};exports[_0xf0fa('0x17')]=function(_0x28bab8){return request(_0xf0fa('0x18'),{'options':{'where':{'id':_0x28bab8},'attributes':['dsn']}});};exports[_0xf0fa('0x19')]=function(_0x477914){return request(_0xf0fa('0x1a'),{'options':{'where':{'id':_0x477914},'attributes':[_0xf0fa('0x13')]}});};exports[_0xf0fa('0x1b')]=function(_0x386e5f){return request('GetContactByPhone',{'options':{'where':{'phone':_0x386e5f['phone']},'attributes':['id']}});};exports[_0xf0fa('0x1c')]=function(_0x2751cc){return request(_0xf0fa('0x1d'),{'options':{'where':{'id':_0x2751cc},'attributes':[_0xf0fa('0x13')]}});};exports[_0xf0fa('0x1e')]=function(_0x403e7d){return request(_0xf0fa('0x1f'),{'options':{'where':{'id':_0x403e7d},'attributes':[_0xf0fa('0x20')]}});};exports[_0xf0fa('0x21')]=function(_0x15942b){return request(_0xf0fa('0x22'),{'options':{'raw':![],'where':{'id':_0x15942b},'include':[{'model':'Interval','as':_0xf0fa('0x23')}]}});};exports[_0xf0fa('0x24')]=function(_0x39e82d){return request(_0xf0fa('0x25'),{'options':{'where':{'id':_0x39e82d},'attributes':['id',_0xf0fa('0x13')]}});};exports[_0xf0fa('0x26')]=function(_0x3901aa){return request(_0xf0fa('0x27'),{'body':_0x3901aa});};exports[_0xf0fa('0x28')]=function(_0x4a897f){return request(_0xf0fa('0x29'),{'body':_0x4a897f});};exports[_0xf0fa('0x2a')]=function(_0x56134e){return request(_0xf0fa('0x2b'),{'body':_[_0xf0fa('0x2c')](_0x56134e,{'project_name':_0x56134e[_0xf0fa('0x2d')],'prev_project_name':_0x56134e['arg_2']||'','is_subproject':_0x56134e[_0xf0fa('0x2e')]?!![]:![],'leaveAt':moment()[_0xf0fa('0x2f')](_0xf0fa('0x30'))})});};exports[_0xf0fa('0x31')]=function(_0x4e6eef){return request('CreateSquareRecording',{'body':_0x4e6eef});};exports[_0xf0fa('0x32')]=function(_0x1c5eaf){return request(_0xf0fa('0x33'),{'body':_0x1c5eaf});};exports[_0xf0fa('0x34')]=function(_0x57b8e9){return request(_0xf0fa('0x35'),{'options':{'raw':![],'where':{'phone':_0x57b8e9[_0xf0fa('0x36')],'ListId':_0x57b8e9[_0xf0fa('0x37')]}}})['then'](function(_0x9ad0e3){if(_0x9ad0e3){return _0x9ad0e3;}return request('CreateCmContact',{'body':_0x57b8e9});});};exports[_0xf0fa('0x38')]=function(_0x1e3875){return request(_0xf0fa('0x39'),{'options':{'where':{'id':_0x1e3875},'attributes':['name']}});};exports[_0xf0fa('0x3a')]=function(_0x33cc64,_0x574ba7){return request(_0xf0fa('0x3b'),{'body':{'interface':_0x574ba7},'options':{'where':_0x33cc64}});};exports[_0xf0fa('0x3c')]=function(_0x9436e3,_0x490613,_0x534c10){return request(_0xf0fa('0x3d'),{'body':{'type':_0x490613,'uniqueid':_0x534c10},'options':{'where':_0x9436e3}});};exports[_0xf0fa('0x3e')]=function(_0x485fe2){return request(_0xf0fa('0x3f'),{'body':{},'options':{'where':_0x485fe2}});};exports['agentLogout']=function(_0x5ca1b2){return request('LogoutUser',{'body':{},'options':{'where':_0x5ca1b2}});}; \ 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 be4e894..ac1b7e6 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 _0x63f2=['./polly','./lex','exports'];(function(_0x1626c4,_0x1d4694){var _0x3b5725=function(_0x52f549){while(--_0x52f549){_0x1626c4['push'](_0x1626c4['shift']());}};_0x3b5725(++_0x1d4694);}(_0x63f2,0x19b));var _0x263f=function(_0x2ef7da,_0x4e5b4b){_0x2ef7da=_0x2ef7da-0x0;var _0x3546cc=_0x63f2[_0x2ef7da];return _0x3546cc;};var polly=require(_0x263f('0x0'));var lex=require(_0x263f('0x1'));module[_0x263f('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x770d=['./lex','exports','./polly'];(function(_0x256c40,_0x36b434){var _0x35b78d=function(_0x33e3d6){while(--_0x33e3d6){_0x256c40['push'](_0x256c40['shift']());}};_0x35b78d(++_0x36b434);}(_0x770d,0x122));var _0xd770=function(_0x1ba9fe,_0x905f0d){_0x1ba9fe=_0x1ba9fe-0x0;var _0x35734f=_0x770d[_0x1ba9fe];return _0x35734f;};var polly=require(_0xd770('0x0'));var lex=require(_0xd770('0x1'));module[_0xd770('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 844be17..3f2f30a 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 _0xaa88=['exports','./lib/api'];(function(_0x311556,_0x25c2a4){var _0x44ad0c=function(_0x7572f4){while(--_0x7572f4){_0x311556['push'](_0x311556['shift']());}};_0x44ad0c(++_0x25c2a4);}(_0xaa88,0x137));var _0x8aa8=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xaa88[_0x5c4f6b];return _0x104c4e;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x546e8d,_0x340638){var _0x546bdb=function(_0x1299e6){while(--_0x1299e6){_0x546e8d['push'](_0x546e8d['shift']());}};_0x546bdb(++_0x340638);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ 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 247ea83..dfd5adf 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(_0x31b446,_0x10f5bb){var _0x5db0a8=function(_0x227950){while(--_0x227950){_0x31b446['push'](_0x31b446['shift']());}};_0x5db0a8(++_0x10f5bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x219ece,_0x4965b5){var _0x34bf11=function(_0x41b5f1){while(--_0x41b5f1){_0x219ece['push'](_0x219ece['shift']());}};_0x34bf11(++_0x4965b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 7975173..f89f2ac 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 _0xbbd7=['./lib/api'];(function(_0x1f4449,_0xe1b863){var _0x1c860a=function(_0x89df4f){while(--_0x89df4f){_0x1f4449['push'](_0x1f4449['shift']());}};_0x1c860a(++_0xe1b863);}(_0xbbd7,0x128));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0x7bbd('0x0'));module['exports']=function(_0x3d0898,_0x24c0d1,_0x58ceb2,_0x1739c9,_0x4d1ff7,_0x54b7cf,_0x48c6e6){return polly(_0x3d0898,_0x24c0d1,_0x58ceb2,_0x1739c9,_0x4d1ff7,_0x54b7cf,_0x48c6e6);}; \ No newline at end of file +var _0x8166=['exports','./lib/api'];(function(_0x292285,_0x43e3cd){var _0x3cc006=function(_0x438ad5){while(--_0x438ad5){_0x292285['push'](_0x292285['shift']());}};_0x3cc006(++_0x43e3cd);}(_0x8166,0x119));var _0x6816=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x8166[_0x263f9d];return _0x4c4efa;};'use strict';var polly=require(_0x6816('0x0'));module[_0x6816('0x1')]=function(_0x22f592,_0x4e075a,_0x4d996a,_0x264fe1,_0x291fb2,_0x43c4b6,_0xc131da){return polly(_0x22f592,_0x4e075a,_0x4d996a,_0x264fe1,_0x291fb2,_0x43c4b6,_0xc131da);}; \ 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 5e29c19..b99776b 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 _0x016b=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x533431,_0x18f1f1){var _0x405534=function(_0x3b95fd){while(--_0x3b95fd){_0x533431['push'](_0x533431['shift']());}};_0x405534(++_0x18f1f1);}(_0x016b,0xe1));var _0xb016=function(_0x59e11b,_0x177051){_0x59e11b=_0x59e11b-0x0;var _0x5ade72=_0x016b[_0x59e11b];return _0x5ade72;};'use strict';var fs=require('fs');var path=require(_0xb016('0x0'));var BPromise=require(_0xb016('0x1'));var rs=require('randomstring');var AWS=require(_0xb016('0x2'));function pollyResult(_0x230a21,_0x1bdf5a,_0x450bf0){return new BPromise(function(_0x3a9bb3,_0x1ecea0){_0x230a21[_0xb016('0x3')](_0x1bdf5a,function(_0x1a2761,_0x4d9abf){if(_0x1a2761){_0x1ecea0(_0x1a2761);}else if(_0x4d9abf){if(_0x4d9abf[_0xb016('0x4')]instanceof Buffer){fs[_0xb016('0x5')](_0x450bf0,_0x4d9abf[_0xb016('0x4')],function(_0x1a116b){if(_0x1a116b){_0x1ecea0(_0x1a116b);}else{_0x3a9bb3();}});}else{_0x1ecea0(new Error(_0xb016('0x6')));}}else{_0x1ecea0(new Error(_0xb016('0x7')));}});});}module['exports']=function(_0x51def2,_0x4a7c29,_0x3e1531,_0x4be7fb,_0x1312b3,_0x1faff0,_0x5c863a){var _0x1916c4=new AWS['Polly']({'accessKeyId':_0x51def2,'secretAccessKey':_0x4a7c29,'region':_0x3e1531});var _0x2520f4={'Text':_0x1312b3,'TextType':_0x1faff0||_0xb016('0x8'),'OutputFormat':_0xb016('0x9'),'VoiceId':_0x4be7fb};return pollyResult(_0x1916c4,_0x2520f4,_0x5c863a);}; \ No newline at end of file +var _0x86b1=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x1fcfe1,_0x5c0093){var _0x544c27=function(_0x4e3a3b){while(--_0x4e3a3b){_0x1fcfe1['push'](_0x1fcfe1['shift']());}};_0x544c27(++_0x5c0093);}(_0x86b1,0xc6));var _0x186b=function(_0x164697,_0x20473f){_0x164697=_0x164697-0x0;var _0x270ec4=_0x86b1[_0x164697];return _0x270ec4;};'use strict';var fs=require('fs');var path=require(_0x186b('0x0'));var BPromise=require(_0x186b('0x1'));var rs=require(_0x186b('0x2'));var AWS=require(_0x186b('0x3'));function pollyResult(_0x4bd32f,_0x19596b,_0x26e2af){return new BPromise(function(_0x4a8bfc,_0x26432c){_0x4bd32f[_0x186b('0x4')](_0x19596b,function(_0x5bf47a,_0xca384f){if(_0x5bf47a){_0x26432c(_0x5bf47a);}else if(_0xca384f){if(_0xca384f[_0x186b('0x5')]instanceof Buffer){fs[_0x186b('0x6')](_0x26e2af,_0xca384f[_0x186b('0x5')],function(_0xea3bde){if(_0xea3bde){_0x26432c(_0xea3bde);}else{_0x4a8bfc();}});}else{_0x26432c(new Error(_0x186b('0x7')));}}else{_0x26432c(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x186b('0x8')]=function(_0x5d516d,_0x356c98,_0x41b0e7,_0x5574bf,_0x7939aa,_0x29775a,_0x1c589a){var _0x17c062=new AWS[(_0x186b('0x9'))]({'accessKeyId':_0x5d516d,'secretAccessKey':_0x356c98,'region':_0x41b0e7});var _0x8db5a6={'Text':_0x7939aa,'TextType':_0x29775a||_0x186b('0xa'),'OutputFormat':'mp3','VoiceId':_0x5574bf};return pollyResult(_0x17c062,_0x8db5a6,_0x1c589a);}; \ 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 abb8da1..74ff122 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 _0xa9d1=['./lib/api','exports'];(function(_0x58953b,_0x321ab8){var _0x4ef006=function(_0x30b448){while(--_0x30b448){_0x58953b['push'](_0x58953b['shift']());}};_0x4ef006(++_0x321ab8);}(_0xa9d1,0x166));var _0x1a9d=function(_0x5131d1,_0x16c250){_0x5131d1=_0x5131d1-0x0;var _0x5c5d77=_0xa9d1[_0x5131d1];return _0x5c5d77;};'use strict';var asr=require(_0x1a9d('0x0'));module[_0x1a9d('0x1')]=function(_0x25c0f9,_0x1dbb9c,_0x258683,_0x509088){return asr(_0x25c0f9,_0x1dbb9c,_0x258683);}; \ No newline at end of file +var _0x1d10=['./lib/api','exports'];(function(_0x43634a,_0x2a7f51){var _0x2aa5b4=function(_0x6f7a10){while(--_0x6f7a10){_0x43634a['push'](_0x43634a['shift']());}};_0x2aa5b4(++_0x2a7f51);}(_0x1d10,0x188));var _0x01d1=function(_0x206c5a,_0x435bbc){_0x206c5a=_0x206c5a-0x0;var _0x575836=_0x1d10[_0x206c5a];return _0x575836;};'use strict';var asr=require(_0x01d1('0x0'));module[_0x01d1('0x1')]=function(_0x58eefa,_0x14a547,_0x6e2575,_0x1f63be){return asr(_0x58eefa,_0x14a547,_0x6e2575);}; \ 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 7d5e4d7..9e24b01 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 _0x8a55=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a55,0x185));var _0x58a5=function(_0x1a7fda,_0x5a7eb1){_0x1a7fda=_0x1a7fda-0x0;var _0x1a7b13=_0x8a55[_0x1a7fda];return _0x1a7b13;};'use strict';var url=require(_0x58a5('0x0'));var BPromise=require(_0x58a5('0x1'));var fs=require('fs');var host=_0x58a5('0x2');module[_0x58a5('0x3')]=function(_0x2befd3,_0x1cfb30,_0x2ae19a){return new BPromise(function(_0x1f68ef,_0x5d7d07){var _0x3d864a;if(typeof _0x2befd3!==_0x58a5('0x4')||_0x2befd3[_0x58a5('0x5')]===0x0){return _0x5d7d07(_0x58a5('0x6'));}if(typeof _0x1cfb30!==_0x58a5('0x4')||_0x1cfb30[_0x58a5('0x5')]===0x0){return _0x5d7d07(_0x58a5('0x7'));}if(typeof _0x2ae19a!==_0x58a5('0x8')&&(typeof _0x2ae19a!==_0x58a5('0x4')||_0x2ae19a['length']===0x0)){return _0x5d7d07(_0x58a5('0x9'));}try{_0x3d864a=fs[_0x58a5('0xa')](_0x2befd3)[_0x58a5('0xb')](_0x58a5('0xc'));}catch(_0x3b13fe){return _0x5d7d07(_0x3b13fe);}return _0x1f68ef({'method':_0x58a5('0xd'),'uri':host+_0x58a5('0xe')+_0x1cfb30,'body':{'config':{'encoding':_0x58a5('0xf'),'sampleRateHertz':_0x58a5('0x10'),'languageCode':_0x2ae19a},'audio':{'content':_0x3d864a}},'json':!![]});});}; \ No newline at end of file +var _0xd52a=['LINEAR16','8000','bluebird','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','toString','/v1/speech:recognize?key='];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd52a,0xca));var _0xad52=function(_0x3b8040,_0x77de75){_0x3b8040=_0x3b8040-0x0;var _0xf73bc6=_0xd52a[_0x3b8040];return _0xf73bc6;};'use strict';var url=require('url');var BPromise=require(_0xad52('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xad52('0x1')]=function(_0x7b9789,_0x30b335,_0x572592){return new BPromise(function(_0x3f4207,_0x383c44){var _0x130d6d;if(typeof _0x7b9789!==_0xad52('0x2')||_0x7b9789['length']===0x0){return _0x383c44('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x30b335!=='string'||_0x30b335[_0xad52('0x3')]===0x0){return _0x383c44('key\x20should\x20be\x20a\x20string');}if(typeof _0x572592!==_0xad52('0x4')&&(typeof _0x572592!=='string'||_0x572592[_0xad52('0x3')]===0x0)){return _0x383c44(_0xad52('0x5'));}try{_0x130d6d=fs['readFileSync'](_0x7b9789)[_0xad52('0x6')]('base64');}catch(_0x46fbc5){return _0x383c44(_0x46fbc5);}return _0x3f4207({'method':'POST','uri':host+_0xad52('0x7')+_0x30b335,'body':{'config':{'encoding':_0xad52('0x8'),'sampleRateHertz':_0xad52('0x9'),'languageCode':_0x572592},'audio':{'content':_0x130d6d}},'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 8758655..58b2d11 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 _0xd110=['./asr'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0xd110,0xc1));var _0x0d11=function(_0x260450,_0x4aeca8){_0x260450=_0x260450-0x0;var _0x2e29dd=_0xd110[_0x260450];return _0x2e29dd;};var asr=require(_0x0d11('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x7858=['./asr'];(function(_0x302ab3,_0x21ab7b){var _0x12c0ca=function(_0x91ebf6){while(--_0x91ebf6){_0x302ab3['push'](_0x302ab3['shift']());}};_0x12c0ca(++_0x21ab7b);}(_0x7858,0xbe));var _0x8785=function(_0x26fdde,_0x58f5cc){_0x26fdde=_0x26fdde-0x0;var _0x17f97a=_0x7858[_0x26fdde];return _0x17f97a;};var asr=require(_0x8785('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 f1d05d3..7e3e9ea 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 _0x699d=['textRequest','source','result','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','parse','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','https:','end','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','slice','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','googleASR','asr','uri','results','map','alternatives','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow'];(function(_0x636c18,_0x294d88){var _0x3d7574=function(_0x3625e5){while(--_0x3625e5){_0x636c18['push'](_0x636c18['shift']());}};_0x3d7574(++_0x294d88);}(_0x699d,0x1ca));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xd699('0x0'));var fs=require('fs');var http=require(_0xd699('0x1'));var https=require(_0xd699('0x2'));var md5=require('md5');var path=require(_0xd699('0x3'));var querystring=require(_0xd699('0x4'));var rp=require(_0xd699('0x5'));var rs=require(_0xd699('0x6'));var sox=require(_0xd699('0x7'));var tts=require(_0xd699('0x8'));var urlParse=require(_0xd699('0x9'))['parse'];var util=require(_0xd699('0xa'));var aws=require(_0xd699('0xb'));var google=require(_0xd699('0xc'));var sestek=require(_0xd699('0xd'));var tilde=require(_0xd699('0xe'));var logger=require(_0xd699('0xf'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x22b249,_0x12a288){return new BPromise(function(_0x404a6f,_0x303ad8){var _0x788ce0=urlParse(_0x22b249);var _0x2c0c59=_0x788ce0[_0xd699('0x10')]==='https:'?https:http;var _0x4bdb8e={'host':_0x788ce0[_0xd699('0x11')],'path':_0x788ce0['path'],'headers':{'user-agent':_0xd699('0x12')}};_0x2c0c59[_0xd699('0x13')](_0x4bdb8e,function(_0x527e8a){if(_0x527e8a['statusCode']!==0xc8){logger[_0xd699('0x14')](_0xd699('0x15')+_0x22b249+_0xd699('0x16')+_0x527e8a[_0xd699('0x17')]+'\x20('+_0x527e8a[_0xd699('0x18')]+')');_0x303ad8(new Error(_0xd699('0x15')+_0x22b249+'\x20failed,\x20status\x20code\x20=\x20'+_0x527e8a[_0xd699('0x17')]+'\x20('+_0x527e8a['statusMessage']+')'));return;}var _0x2e06a2=fs[_0xd699('0x19')](_0x12a288);_0x2e06a2['on']('finish',function(){logger[_0xd699('0x1a')](_0xd699('0x1b'));_0x2e06a2[_0xd699('0x1c')](_0x404a6f);});_0x2e06a2['on']('error',function(_0x583cdc){fs[_0xd699('0x1d')](_0x12a288);logger[_0xd699('0x14')](_0xd699('0x1e'),_0x583cdc);_0x303ad8(_0x583cdc);});_0x527e8a[_0xd699('0x1f')](_0x2e06a2);})['on'](_0xd699('0x14'),function(_0x280d09){logger[_0xd699('0x14')](_0x280d09);_0x303ad8(_0x280d09);})['end']();});}function uploadFile(_0x25b9d8){return new BPromise(function(_0x5443de,_0x5b50fa){var _0x29a2a8=urlParse(_0x25b9d8);var _0x1002f8=_0x29a2a8[_0xd699('0x10')]===_0xd699('0x20')?https:http;var _0x35576f={'host':_0x29a2a8[_0xd699('0x11')],'path':_0x29a2a8[_0xd699('0x3')],'headers':{'user-agent':_0xd699('0x12')}};_0x1002f8['get'](_0x35576f,function(_0x49dee5){if(_0x49dee5[_0xd699('0x17')]!==0xc8){_0x5b50fa(new Error(_0xd699('0x15')+_0x25b9d8+_0xd699('0x16')+_0x49dee5[_0xd699('0x17')]+'\x20('+_0x49dee5[_0xd699('0x18')]+')'));return;}var _0x4e20b4='';_0x49dee5['on']('data',function(_0x1c5d5c){_0x4e20b4+=_0x1c5d5c;});_0x49dee5['on'](_0xd699('0x21'),function(){_0x5443de(_0x4e20b4);});})['on'](_0xd699('0x14'),function(_0x91b934){_0x5b50fa(_0x91b934);})[_0xd699('0x21')]();});}function convertFile(_0x536400,_0x302edc){return new BPromise(function(_0xb102d3,_0x3cd9f1){var _0x3351e6=sox['transcode'](_0x536400,_0x302edc,{'sampleRate':0x1f40,'format':_0xd699('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3351e6['on']('error',function(_0x580426){logger[_0xd699('0x14')]('error\x20convert',_0x580426);_0x3cd9f1(_0x580426);});_0x3351e6['on']('end',function(){logger[_0xd699('0x1a')](_0xd699('0x23'));_0xb102d3();});_0x3351e6[_0xd699('0x24')]();});}function base64Decode(_0x5c63ed,_0x301d33){var _0x4e3ccf=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+_0xd699('0x28'));fs[_0xd699('0x29')](_0x4e3ccf,_0x5c63ed,_0xd699('0x2a'));return convertFile(_0x4e3ccf,_0x301d33)[_0xd699('0x2b')](function(){try{fs['unlink'](_0x4e3ccf);fs[_0xd699('0x2c')](_0x301d33,_0xd699('0x2d'));}catch(_0x215855){logger[_0xd699('0x14')](_0x215855);}return _0x301d33[_0xd699('0x2e')]('.')[0x0];});}function base64Encode(_0x548613){var _0x344e91=fs['readFileSync'](_0x548613);return new Buffer(_0x344e91)['toString'](_0xd699('0x2a'));}exports[_0xd699('0x2f')]=function(_0x346e2a,_0x5608c9,_0x321b33,_0x3b38ba,_0x3ef50f,_0x3bc0a7){var _0x50f999,_0x256cc0;var _0xff6301=_0xd699('0x30');var _0x11f278=_0xd699('0x31')+_0x346e2a;var _0x23df94={};if(_0x5608c9==='ssml'){_0x23df94['input']={'ssml':_0x321b33};}else{_0x23df94[_0xd699('0x32')]={'text':_0x321b33};};_0x23df94[_0xd699('0x33')]={'languageCode':_0x3b38ba,'ssmlGender':_0x3ef50f};_0x23df94[_0xd699('0x34')]={'audioEncoding':_0xd699('0x35'),'sampleRateHertz':0x1f40};var _0x690764={'url':_0xff6301+_0xd699('0x36')+_0x11f278,'method':_0xd699('0x37'),'json':!![],'body':_0x23df94};return rp(_0x690764)['then'](function(_0x4bfa3b){return new BPromise(function(_0x37a23f,_0x59d8ad){_0x50f999=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs['generate'](0x4)+'.mp3');var _0x3c44bd=Buffer[_0xd699('0x38')](_0x4bfa3b[_0xd699('0x39')],_0xd699('0x2a'));return fs['writeFile'](_0x50f999,_0x3c44bd,function(_0x256dd7){_0x59d8ad(_0x256dd7);},function(_0x525d70){fs[_0xd699('0x2c')](_0x50f999,_0xd699('0x2d'));_0x37a23f(_0x525d70);});});})[_0xd699('0x2b')](function(_0x2b9c5c){_0x256cc0=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+_0xd699('0x28'));return convertFile(_0x50f999,_0x256cc0);})[_0xd699('0x2b')](function(){try{fs[_0xd699('0x1d')](_0x50f999);fs[_0xd699('0x2c')](_0x256cc0,_0xd699('0x2d'));}catch(_0x2ece65){logger[_0xd699('0x14')](_0x2ece65);}logger[_0xd699('0x1a')](_0xd699('0x3a'),_0x256cc0[_0xd699('0x2e')]('.')[0x0]);return _0x256cc0[_0xd699('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x1d6167,_0x112342){var _0x9ea835=_0xd699('0x3b');var _0x4f01be,_0x316920;var _0x10e30c;var _0x2d1f0e={'encoding':_0xd699('0x3c'),'method':_0xd699('0x37'),'timeout':0x2710,'url':_0x9ea835,'headers':{'Content-Type':_0xd699('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0xd699('0x3e')]([[[_0xd699('0x3f'),JSON[_0xd699('0x3e')]([_0x1d6167,_0x112342||'en',![],_0xd699('0x40')]),null,'generic']]]))};return rp(_0x2d1f0e)['then'](function(_0x185d72){try{_0x10e30c=eval(_0x185d72[_0xd699('0x41')](0x5))[0x0][0x2];}catch(_0x53f699){throw new Error('parse\x20response\x20failed:\x0a'+_0x185d72[_0xd699('0x42')]);}if(!_0x10e30c){if(_0x1d6167[_0xd699('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xd699('0x44')+_0x112342+_0xd699('0x45'));}}try{_0x10e30c=eval(_0x10e30c)[0x0];}catch(_0x161e4f){throw new Error(_0xd699('0x46')+res[_0xd699('0x42')]);}const _0x2bd2fa=_0x10e30c;_0x4f01be=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs['generate'](0x4)+_0xd699('0x47'));fs['writeFileSync'](_0x4f01be,_0x10e30c,{'encoding':_0xd699('0x2a')});_0x316920=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+_0xd699('0x28'));return convertFile(_0x4f01be,_0x316920);})['then'](function(){try{fs[_0xd699('0x1d')](_0x4f01be);fs[_0xd699('0x2c')](_0x316920,_0xd699('0x2d'));}catch(_0x4c964b){logger['error'](_0x4c964b);}logger[_0xd699('0x1a')]('goggleTTS\x20path',_0x316920[_0xd699('0x2e')]('.')[0x0]);return _0x316920[_0xd699('0x2e')]('.')[0x0];});};exports[_0xd699('0x48')]=function(_0x3f3499,_0x171c31,_0xde998c){return google[_0xd699('0x49')](_0x3f3499,_0x171c31,_0xde998c)[_0xd699('0x2b')](function(_0xce39cb){logger[_0xd699('0x1a')](_0xce39cb[_0xd699('0x4a')]);return rp(_0xce39cb);})[_0xd699('0x2b')](function(_0x2c115b){var _0x3e48e4='';var _0x47f0b9=0x0;try{fs[_0xd699('0x1d')](_0x3f3499);}catch(_0x37cf51){logger[_0xd699('0x14')](_0x37cf51);}if(_0x2c115b&&_0x2c115b[_0xd699('0x4b')]){_0x3e48e4=_0x2c115b['results'][_0xd699('0x4c')](function(_0x44fced){return _0x44fced&&_0x44fced[_0xd699('0x4d')][0x0]&&_0x44fced['alternatives'][0x0]['transcript']?_0x44fced[_0xd699('0x4d')][0x0]['transcript']:'';})[_0xd699('0x4e')]('\x0a');_0x47f0b9=_0x2c115b['results']['map'](function(_0x524641){return _0x524641&&_0x524641['alternatives'][0x0]&&_0x524641['alternatives'][0x0]['confidence']?_0x524641[_0xd699('0x4d')][0x0]['confidence']:0x0;})[_0xd699('0x4e')]('\x0a');}logger[_0xd699('0x1a')](_0xd699('0x4f'),_0x3e48e4);logger[_0xd699('0x1a')](_0xd699('0x50'),_0x47f0b9);return{'transcript':_0x3e48e4,'confidence':_0x47f0b9};})[_0xd699('0x51')](function(_0x2e0d62){logger['error'](_0xd699('0x52'),_0x2e0d62['statusCode'],_0x2e0d62[_0xd699('0x53')],_0x2e0d62[_0xd699('0x54')]);});};exports[_0xd699('0x55')]=function(_0x5e9025,_0x46c6af,_0x5abe48,_0x2d5409){var _0x250208=apiai(_0x46c6af,{'language':_0x2d5409||'en'});return _0x250208[_0xd699('0x56')](_0x5abe48,{'sessionId':md5(_0x5e9025)})['then'](function(_0x5bf7a2){logger[_0xd699('0x1a')](JSON['stringify'](_0x5bf7a2));return{'source':_0x5bf7a2['result'][_0xd699('0x57')],'resolvedQuery':_0x5bf7a2[_0xd699('0x58')]['resolvedQuery'],'action':_0x5bf7a2[_0xd699('0x58')][_0xd699('0x59')],'actionIncomplete':_0x5bf7a2['result'][_0xd699('0x5a')],'speech':_0x5bf7a2[_0xd699('0x58')]['fulfillment'][_0xd699('0x5b')],'score':_0x5bf7a2['result'][_0xd699('0x5c')],'statusCode':_0x5bf7a2[_0xd699('0x5d')][_0xd699('0x5e')],'endConversation':_0x5bf7a2[_0xd699('0x58')][_0xd699('0x5f')][_0xd699('0x60')]||![],'isFallbackIntent':_0x5bf7a2['result'][_0xd699('0x5f')][_0xd699('0x61')]};});};exports[_0xd699('0x62')]=function(_0x242e62,_0x23255b,_0x4b7562,_0x1b0e0b,_0x5d9dc7,_0x247400){var _0xebfd08=_0x1b0e0b['replace'](/\\n/g,'\x0a');var _0x2893d8={'credentials':{'private_key':_0xebfd08,'client_email':_0x4b7562}};var _0x1fdf4c=new dialogflow[(_0xd699('0x63'))](_0x2893d8);var _0x3c8343=_0x1fdf4c[_0xd699('0x64')](_0x23255b,md5(_0x242e62));var _0x1b3a70={'session':_0x3c8343,'queryInput':{'text':{'text':_0x5d9dc7,'languageCode':_0x247400}}};return _0x1fdf4c['detectIntent'](_0x1b3a70)[_0xd699('0x2b')](function(_0x1f6f0f){if(_0x1f6f0f&&_0x1f6f0f['length']){logger[_0xd699('0x1a')](_0xd699('0x65'),JSON[_0xd699('0x3e')](_0x1f6f0f));var _0x36063a=_0x1f6f0f[0x0];if(_0x36063a){var _0x435b04={'action':_0x36063a['queryResult'][_0xd699('0x59')],'allRequiredParamsPresent':_0x36063a[_0xd699('0x66')][_0xd699('0x67')],'endConversation':_0x36063a[_0xd699('0x66')][_0xd699('0x68')]&&_0x36063a['queryResult']['diagnosticInfo'][_0xd699('0x69')]?_0x36063a[_0xd699('0x66')][_0xd699('0x68')]['fields']['end_conversation'][_0xd699('0x6a')]:![],'fulfillmentText':_0x36063a[_0xd699('0x66')][_0xd699('0x6b')],'intentName':_0x36063a[_0xd699('0x66')][_0xd699('0x6c')][_0xd699('0x53')],'intentDisplayName':_0x36063a[_0xd699('0x66')]['intent']['displayName'],'isFallbackIntent':_0x36063a[_0xd699('0x66')]['intent']['isFallback'],'languageCode':_0x36063a[_0xd699('0x66')][_0xd699('0x6d')],'queryText':_0x36063a[_0xd699('0x66')][_0xd699('0x6e')],'responseId':_0x36063a[_0xd699('0x6f')],'score':_0x36063a['queryResult'][_0xd699('0x70')],'speech':_0x36063a['queryResult']['fulfillmentText'],'providerResponse':JSON['stringify'](_0x1f6f0f)};return _0x435b04;}}});};exports[_0xd699('0x71')]=function(_0x5be94b,_0x1091d2,_0x3e5c26,_0x28602a){return tilde[_0xd699('0x49')](_0x5be94b,_0x1091d2,_0x3e5c26,_0x28602a)[_0xd699('0x2b')](function(_0xad7aed){try{fs[_0xd699('0x1d')](_0x5be94b);}catch(_0x2b2759){logger[_0xd699('0x14')](_0x2b2759);}logger[_0xd699('0x1a')](_0xd699('0x72'),_0xad7aed[_0xd699('0x73')]);logger[_0xd699('0x1a')]('Tilde\x20ASR\x20confidence',_0xad7aed[_0xd699('0x74')]);return _0xad7aed;});};exports[_0xd699('0x75')]=function(_0xad8907,_0x4e6e6d,_0x26ce06,_0x238ee0,_0x123984,_0x3c2585){var _0x4aa569=path['resolve'](__dirname,_0xd699('0x26'),rs['generate'](0x4)+_0xd699('0x47'));var _0x1c0d2d;return aws[_0xd699('0x76')](_0xad8907,_0x4e6e6d,_0x26ce06,_0x238ee0,_0x123984,_0x3c2585,_0x4aa569)['then'](function(){_0x1c0d2d=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+'.wav');return convertFile(_0x4aa569,_0x1c0d2d);})['then'](function(){try{fs['unlink'](_0x4aa569);fs['chmodSync'](_0x1c0d2d,'777');}catch(_0x1bd5a7){logger[_0xd699('0x14')](_0x1bd5a7);}return _0x1c0d2d['split']('.')[0x0];});};exports[_0xd699('0x77')]=function(_0x160ce7,_0x2082d3,_0x5278d3,_0x25373e,_0x21ec79,_0x30e9c5){return aws[_0xd699('0x78')](_0x160ce7,_0x2082d3,_0x5278d3,_0x25373e,_0x21ec79,_0x30e9c5)[_0xd699('0x2b')](function(_0x2a4386){logger[_0xd699('0x1a')](JSON['stringify'](_0x2a4386));return _0x2a4386;});};exports[_0xd699('0x79')]=function(_0x3e0571,_0x3fd447,_0x3edffe,_0x2d6980){var _0x17370e=util[_0xd699('0x7a')](_0xd699('0x7b'),ISPEECH_API,_0x3e0571,encodeURIComponent(_0x3fd447),_0x3edffe,_0x2d6980);var _0x5c076d=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+_0xd699('0x47'));var _0xd00afe;return downloadFile(_0x17370e,_0x5c076d)[_0xd699('0x2b')](function(){_0xd00afe=path[_0xd699('0x25')](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+_0xd699('0x28'));return convertFile(_0x5c076d,_0xd00afe);})[_0xd699('0x2b')](function(){try{fs[_0xd699('0x1d')](_0x5c076d);fs[_0xd699('0x2c')](_0xd00afe,'777');}catch(_0x5dc8c5){logger[_0xd699('0x14')](_0x5dc8c5);}return _0xd00afe[_0xd699('0x2e')]('.')[0x0];});};exports[_0xd699('0x7c')]=function(_0x510f37,_0xc446,_0xf57e7e,_0x5975c2){var _0x28c92b=util[_0xd699('0x7a')](_0xd699('0x7d'),ISPEECH_API,_0xc446,_0xf57e7e,base64Encode(_0x510f37),_0x5975c2?util['format']('model=%s',encodeURIComponent(_0x5975c2)):_0xd699('0x7e'));return uploadFile(_0x28c92b)[_0xd699('0x2b')](function(_0x7a4164){return querystring[_0xd699('0x7f')](_0x7a4164);});};exports['sestekNDA']=function(_0x375fa8,_0x2a4b76){return sestek[_0xd699('0x80')](_0x375fa8,_0x2a4b76)[_0xd699('0x2b')](function(_0xcebd2b){logger['info'](JSON['stringify'](_0xcebd2b));var _0xa09644={'speech':_0xcebd2b[_0xd699('0x81')],'action':_0xcebd2b[_0xd699('0x82')]?_0xcebd2b[_0xd699('0x82')][_0xd699('0x83')]:undefined,'actiondata':_0xcebd2b['channelData']?_0xcebd2b[_0xd699('0x82')][_0xd699('0x84')]:undefined};if(_0xcebd2b[_0xd699('0x82')]&&_0xcebd2b[_0xd699('0x82')][_0xd699('0x85')]){return base64Decode(_0xcebd2b[_0xd699('0x82')][_0xd699('0x85')]['Data'],path['resolve'](__dirname,_0xd699('0x26'),rs[_0xd699('0x27')](0x4)+'.wav'))[_0xd699('0x2b')](function(_0x13763c){_0xa09644[_0xd699('0x86')]=_0x13763c;return _0xa09644;});}return _0xa09644;});};exports[_0xd699('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0x3dd6=['end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','stringify','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','POST','resolve','.mp3','from','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','null','slice','length','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3dd6,0x130));var _0x63dd=function(_0x290c31,_0x534b8a){_0x290c31=_0x290c31-0x0;var _0x2eb0ac=_0x3dd6[_0x290c31];return _0x2eb0ac;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x63dd('0x0'));var dialogflow=require(_0x63dd('0x1'));var fs=require('fs');var http=require(_0x63dd('0x2'));var https=require(_0x63dd('0x3'));var md5=require(_0x63dd('0x4'));var path=require(_0x63dd('0x5'));var querystring=require('querystring');var rp=require(_0x63dd('0x6'));var rs=require(_0x63dd('0x7'));var sox=require(_0x63dd('0x8'));var tts=require(_0x63dd('0x9'));var urlParse=require(_0x63dd('0xa'))[_0x63dd('0xb')];var util=require(_0x63dd('0xc'));var aws=require('./aws');var google=require(_0x63dd('0xd'));var sestek=require(_0x63dd('0xe'));var tilde=require(_0x63dd('0xf'));var logger=require(_0x63dd('0x10'))(_0x63dd('0x11'));var ISPEECH_API=_0x63dd('0x12');function downloadFile(_0x38be48,_0x39c836){return new BPromise(function(_0x52dd6c,_0xeaa86){var _0x474951=urlParse(_0x38be48);var _0x24c550=_0x474951[_0x63dd('0x13')]===_0x63dd('0x14')?https:http;var _0x2ad406={'host':_0x474951[_0x63dd('0x15')],'path':_0x474951[_0x63dd('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x24c550[_0x63dd('0x16')](_0x2ad406,function(_0x35075e){if(_0x35075e[_0x63dd('0x17')]!==0xc8){logger[_0x63dd('0x18')](_0x63dd('0x19')+_0x38be48+_0x63dd('0x1a')+_0x35075e['statusCode']+'\x20('+_0x35075e[_0x63dd('0x1b')]+')');_0xeaa86(new Error(_0x63dd('0x19')+_0x38be48+_0x63dd('0x1a')+_0x35075e[_0x63dd('0x17')]+'\x20('+_0x35075e[_0x63dd('0x1b')]+')'));return;}var _0x14ac94=fs[_0x63dd('0x1c')](_0x39c836);_0x14ac94['on'](_0x63dd('0x1d'),function(){logger[_0x63dd('0x1e')](_0x63dd('0x1f'));_0x14ac94[_0x63dd('0x20')](_0x52dd6c);});_0x14ac94['on']('error',function(_0x41315d){fs[_0x63dd('0x21')](_0x39c836);logger[_0x63dd('0x18')](_0x63dd('0x22'),_0x41315d);_0xeaa86(_0x41315d);});_0x35075e[_0x63dd('0x23')](_0x14ac94);})['on'](_0x63dd('0x18'),function(_0x17c3ff){logger['error'](_0x17c3ff);_0xeaa86(_0x17c3ff);})[_0x63dd('0x24')]();});}function uploadFile(_0x5579c3){return new BPromise(function(_0x5cc753,_0x495c3a){var _0x1e8d17=urlParse(_0x5579c3);var _0x4c0c1a=_0x1e8d17[_0x63dd('0x13')]===_0x63dd('0x14')?https:http;var _0x4e909a={'host':_0x1e8d17[_0x63dd('0x15')],'path':_0x1e8d17[_0x63dd('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4c0c1a[_0x63dd('0x16')](_0x4e909a,function(_0x82a2ac){if(_0x82a2ac[_0x63dd('0x17')]!==0xc8){_0x495c3a(new Error(_0x63dd('0x19')+_0x5579c3+_0x63dd('0x1a')+_0x82a2ac['statusCode']+'\x20('+_0x82a2ac['statusMessage']+')'));return;}var _0x4d38ac='';_0x82a2ac['on'](_0x63dd('0x25'),function(_0x455657){_0x4d38ac+=_0x455657;});_0x82a2ac['on'](_0x63dd('0x24'),function(){_0x5cc753(_0x4d38ac);});})['on']('error',function(_0x3d7def){_0x495c3a(_0x3d7def);})[_0x63dd('0x24')]();});}function convertFile(_0x49f598,_0xe07393){return new BPromise(function(_0x361f6d,_0x10c8f8){var _0x178a6c=sox[_0x63dd('0x26')](_0x49f598,_0xe07393,{'sampleRate':0x1f40,'format':_0x63dd('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x178a6c['on'](_0x63dd('0x18'),function(_0x256180){logger[_0x63dd('0x18')](_0x63dd('0x28'),_0x256180);_0x10c8f8(_0x256180);});_0x178a6c['on'](_0x63dd('0x24'),function(){logger['info'](_0x63dd('0x29'));_0x361f6d();});_0x178a6c[_0x63dd('0x2a')]();});}function base64Decode(_0x5e7881,_0x33fc50){var _0x3746e0=path['resolve'](__dirname,_0x63dd('0x2b'),rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x2d'));fs[_0x63dd('0x2e')](_0x3746e0,_0x5e7881,_0x63dd('0x2f'));return convertFile(_0x3746e0,_0x33fc50)[_0x63dd('0x30')](function(){try{fs[_0x63dd('0x21')](_0x3746e0);fs[_0x63dd('0x31')](_0x33fc50,_0x63dd('0x32'));}catch(_0x3c0c10){logger[_0x63dd('0x18')](_0x3c0c10);}return _0x33fc50[_0x63dd('0x33')]('.')[0x0];});}function base64Encode(_0x586458){var _0x37da04=fs[_0x63dd('0x34')](_0x586458);return new Buffer(_0x37da04)[_0x63dd('0x35')]('base64');}exports[_0x63dd('0x36')]=function(_0x41e72b,_0x1d2900,_0x58e740,_0x5deb20,_0x23f872,_0x3f76fe){var _0xde57f4,_0x11dfb7;var _0x56f46d=_0x63dd('0x37');var _0x2ef57f=_0x63dd('0x38')+_0x41e72b;var _0x3bdf75={};if(_0x1d2900===_0x63dd('0x39')){_0x3bdf75[_0x63dd('0x3a')]={'ssml':_0x58e740};}else{_0x3bdf75[_0x63dd('0x3a')]={'text':_0x58e740};};_0x3bdf75['voice']={'languageCode':_0x5deb20,'ssmlGender':_0x23f872};_0x3bdf75['audioConfig']={'audioEncoding':_0x63dd('0x3b'),'sampleRateHertz':0x1f40};var _0x5b3f0c={'url':_0x56f46d+_0x63dd('0x3c')+_0x2ef57f,'method':_0x63dd('0x3d'),'json':!![],'body':_0x3bdf75};return rp(_0x5b3f0c)['then'](function(_0x4bae9b){return new BPromise(function(_0x28b191,_0x291638){_0xde57f4=path[_0x63dd('0x3e')](__dirname,'tmp',rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x3f'));var _0x1802b9=Buffer[_0x63dd('0x40')](_0x4bae9b['audioContent'],_0x63dd('0x2f'));return fs[_0x63dd('0x41')](_0xde57f4,_0x1802b9,function(_0x5004e0){_0x291638(_0x5004e0);},function(_0x4dce71){fs[_0x63dd('0x31')](_0xde57f4,_0x63dd('0x32'));_0x28b191(_0x4dce71);});});})[_0x63dd('0x30')](function(_0xe9ba9){_0x11dfb7=path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs[_0x63dd('0x2c')](0x4)+'.wav');return convertFile(_0xde57f4,_0x11dfb7);})['then'](function(){try{fs[_0x63dd('0x21')](_0xde57f4);fs[_0x63dd('0x31')](_0x11dfb7,_0x63dd('0x32'));}catch(_0x4e83e7){logger[_0x63dd('0x18')](_0x4e83e7);}logger['info'](_0x63dd('0x42'),_0x11dfb7[_0x63dd('0x33')]('.')[0x0]);return _0x11dfb7[_0x63dd('0x33')]('.')[0x0];});};exports[_0x63dd('0x43')]=function(_0x4b16c7,_0x69ac47){var _0x5474f5=_0x63dd('0x44');var _0xdc83ab,_0x509542;var _0x5c0571;var _0x244d92={'encoding':_0x63dd('0x45'),'method':'POST','timeout':0x2710,'url':_0x5474f5,'headers':{'Content-Type':_0x63dd('0x46')},'body':_0x63dd('0x47')+encodeURIComponent(JSON['stringify']([[[_0x63dd('0x48'),JSON['stringify']([_0x4b16c7,_0x69ac47||'en',![],_0x63dd('0x49')]),null,'generic']]]))};return rp(_0x244d92)[_0x63dd('0x30')](function(_0x3b31f3){try{_0x5c0571=eval(_0x3b31f3[_0x63dd('0x4a')](0x5))[0x0][0x2];}catch(_0x3092d4){throw new Error('parse\x20response\x20failed:\x0a'+_0x3b31f3['data']);}if(!_0x5c0571){if(_0x4b16c7[_0x63dd('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x69ac47+_0x63dd('0x4c'));}}try{_0x5c0571=eval(_0x5c0571)[0x0];}catch(_0x4d1dec){throw new Error(_0x63dd('0x4d')+res[_0x63dd('0x25')]);}const _0x46fb77=_0x5c0571;_0xdc83ab=path[_0x63dd('0x3e')](__dirname,'tmp',rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x3f'));fs['writeFileSync'](_0xdc83ab,_0x5c0571,{'encoding':_0x63dd('0x2f')});_0x509542=path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x2d'));return convertFile(_0xdc83ab,_0x509542);})[_0x63dd('0x30')](function(){try{fs['unlink'](_0xdc83ab);fs['chmodSync'](_0x509542,_0x63dd('0x32'));}catch(_0x1ebdde){logger[_0x63dd('0x18')](_0x1ebdde);}logger[_0x63dd('0x1e')](_0x63dd('0x4e'),_0x509542['split']('.')[0x0]);return _0x509542[_0x63dd('0x33')]('.')[0x0];});};exports[_0x63dd('0x4f')]=function(_0x518801,_0x109f83,_0x521726){return google[_0x63dd('0x50')](_0x518801,_0x109f83,_0x521726)['then'](function(_0x3d0248){logger['info'](_0x3d0248['uri']);return rp(_0x3d0248);})[_0x63dd('0x30')](function(_0x51ece6){var _0x1b23e0='';var _0x173146=0x0;try{fs[_0x63dd('0x21')](_0x518801);}catch(_0x1f1725){logger['error'](_0x1f1725);}if(_0x51ece6&&_0x51ece6['results']){_0x1b23e0=_0x51ece6['results'][_0x63dd('0x51')](function(_0x4960de){return _0x4960de&&_0x4960de[_0x63dd('0x52')][0x0]&&_0x4960de[_0x63dd('0x52')][0x0][_0x63dd('0x53')]?_0x4960de[_0x63dd('0x52')][0x0][_0x63dd('0x53')]:'';})[_0x63dd('0x54')]('\x0a');_0x173146=_0x51ece6['results'][_0x63dd('0x51')](function(_0x34493e){return _0x34493e&&_0x34493e[_0x63dd('0x52')][0x0]&&_0x34493e['alternatives'][0x0][_0x63dd('0x55')]?_0x34493e[_0x63dd('0x52')][0x0][_0x63dd('0x55')]:0x0;})[_0x63dd('0x54')]('\x0a');}logger[_0x63dd('0x1e')](_0x63dd('0x56'),_0x1b23e0);logger['info'](_0x63dd('0x57'),_0x173146);return{'transcript':_0x1b23e0,'confidence':_0x173146};})['catch'](function(_0x3f80e3){logger[_0x63dd('0x18')](_0x63dd('0x58'),_0x3f80e3[_0x63dd('0x17')],_0x3f80e3[_0x63dd('0x59')],_0x3f80e3[_0x63dd('0x5a')]);});};exports[_0x63dd('0x5b')]=function(_0x286316,_0x36ddaa,_0x147027,_0x451910){var _0xf46626=apiai(_0x36ddaa,{'language':_0x451910||'en'});return _0xf46626[_0x63dd('0x5c')](_0x147027,{'sessionId':md5(_0x286316)})['then'](function(_0x2e96cf){logger[_0x63dd('0x1e')](JSON['stringify'](_0x2e96cf));return{'source':_0x2e96cf[_0x63dd('0x5d')]['source'],'resolvedQuery':_0x2e96cf['result'][_0x63dd('0x5e')],'action':_0x2e96cf[_0x63dd('0x5d')][_0x63dd('0x5f')],'actionIncomplete':_0x2e96cf[_0x63dd('0x5d')][_0x63dd('0x60')],'speech':_0x2e96cf[_0x63dd('0x5d')][_0x63dd('0x61')][_0x63dd('0x62')],'score':_0x2e96cf[_0x63dd('0x5d')][_0x63dd('0x63')],'statusCode':_0x2e96cf['status'][_0x63dd('0x64')],'endConversation':_0x2e96cf[_0x63dd('0x5d')][_0x63dd('0x65')][_0x63dd('0x66')]||![],'isFallbackIntent':_0x2e96cf[_0x63dd('0x5d')]['metadata'][_0x63dd('0x67')]};});};exports[_0x63dd('0x68')]=function(_0x1bb853,_0x5416b4,_0x596ed2,_0xbd0f64,_0x22a856,_0x2c8805){var _0x33e59f=_0xbd0f64['replace'](/\\n/g,'\x0a');var _0x3a59ab={'credentials':{'private_key':_0x33e59f,'client_email':_0x596ed2}};var _0x19eb9c=new dialogflow[(_0x63dd('0x69'))](_0x3a59ab);var _0x209cec=_0x19eb9c[_0x63dd('0x6a')](_0x5416b4,md5(_0x1bb853));var _0x4d3c09={'session':_0x209cec,'queryInput':{'text':{'text':_0x22a856,'languageCode':_0x2c8805}}};return _0x19eb9c[_0x63dd('0x6b')](_0x4d3c09)[_0x63dd('0x30')](function(_0x173622){if(_0x173622&&_0x173622[_0x63dd('0x4b')]){logger[_0x63dd('0x1e')](_0x63dd('0x6c'),JSON['stringify'](_0x173622));var _0x5c2fbb=_0x173622[0x0];if(_0x5c2fbb){var _0x1d08e1={'action':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x5f')],'allRequiredParamsPresent':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x6e')],'endConversation':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x6f')]&&_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x6f')][_0x63dd('0x70')]?_0x5c2fbb['queryResult'][_0x63dd('0x6f')][_0x63dd('0x70')][_0x63dd('0x71')][_0x63dd('0x72')]:![],'fulfillmentText':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x73')],'intentName':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x74')][_0x63dd('0x59')],'intentDisplayName':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x74')][_0x63dd('0x75')],'isFallbackIntent':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x74')][_0x63dd('0x76')],'languageCode':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x77')],'queryText':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x78')],'responseId':_0x5c2fbb[_0x63dd('0x79')],'score':_0x5c2fbb[_0x63dd('0x6d')][_0x63dd('0x7a')],'speech':_0x5c2fbb['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x63dd('0x7b')](_0x173622)};return _0x1d08e1;}}});};exports[_0x63dd('0x7c')]=function(_0x49f342,_0x2082f3,_0x342010,_0x6fa8e0){return tilde[_0x63dd('0x50')](_0x49f342,_0x2082f3,_0x342010,_0x6fa8e0)[_0x63dd('0x30')](function(_0x179878){try{fs[_0x63dd('0x21')](_0x49f342);}catch(_0xbd8677){logger[_0x63dd('0x18')](_0xbd8677);}logger[_0x63dd('0x1e')](_0x63dd('0x7d'),_0x179878[_0x63dd('0x53')]);logger[_0x63dd('0x1e')](_0x63dd('0x7e'),_0x179878[_0x63dd('0x55')]);return _0x179878;});};exports['awsPolly']=function(_0x3ac9a1,_0x1131e5,_0x225817,_0x9e29e2,_0x381968,_0x5fa250){var _0x1dc375=path[_0x63dd('0x3e')](__dirname,'tmp',rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x3f'));var _0x5e8d55;return aws[_0x63dd('0x7f')](_0x3ac9a1,_0x1131e5,_0x225817,_0x9e29e2,_0x381968,_0x5fa250,_0x1dc375)[_0x63dd('0x30')](function(){_0x5e8d55=path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs['generate'](0x4)+_0x63dd('0x2d'));return convertFile(_0x1dc375,_0x5e8d55);})[_0x63dd('0x30')](function(){try{fs[_0x63dd('0x21')](_0x1dc375);fs['chmodSync'](_0x5e8d55,_0x63dd('0x32'));}catch(_0x58c8ce){logger[_0x63dd('0x18')](_0x58c8ce);}return _0x5e8d55[_0x63dd('0x33')]('.')[0x0];});};exports['awsLex']=function(_0x21f071,_0x10d5bc,_0x17b06b,_0x121c2c,_0xcca081,_0x2889e0){return aws['lex'](_0x21f071,_0x10d5bc,_0x17b06b,_0x121c2c,_0xcca081,_0x2889e0)[_0x63dd('0x30')](function(_0x680d7e){logger['info'](JSON[_0x63dd('0x7b')](_0x680d7e));return _0x680d7e;});};exports[_0x63dd('0x80')]=function(_0x177786,_0x38f9b7,_0xb93478,_0x122aac){var _0x27e885=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x177786,encodeURIComponent(_0x38f9b7),_0xb93478,_0x122aac);var _0x2c91b1=path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x3f'));var _0x2885e0;return downloadFile(_0x27e885,_0x2c91b1)[_0x63dd('0x30')](function(){_0x2885e0=path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs['generate'](0x4)+'.wav');return convertFile(_0x2c91b1,_0x2885e0);})['then'](function(){try{fs[_0x63dd('0x21')](_0x2c91b1);fs[_0x63dd('0x31')](_0x2885e0,'777');}catch(_0x3679ad){logger[_0x63dd('0x18')](_0x3679ad);}return _0x2885e0[_0x63dd('0x33')]('.')[0x0];});};exports['ispeechASR']=function(_0x3402b9,_0xdf5f87,_0x48afd5,_0xb7e5d0){var _0x37edd7=util[_0x63dd('0x81')](_0x63dd('0x82'),ISPEECH_API,_0xdf5f87,_0x48afd5,base64Encode(_0x3402b9),_0xb7e5d0?util[_0x63dd('0x81')](_0x63dd('0x83'),encodeURIComponent(_0xb7e5d0)):_0x63dd('0x84'));return uploadFile(_0x37edd7)['then'](function(_0x2c05d7){return querystring[_0x63dd('0xb')](_0x2c05d7);});};exports['sestekNDA']=function(_0x3d0ea5,_0x43f79b){return sestek[_0x63dd('0x85')](_0x3d0ea5,_0x43f79b)[_0x63dd('0x30')](function(_0x1a1649){logger[_0x63dd('0x1e')](JSON[_0x63dd('0x7b')](_0x1a1649));var _0x35c482={'speech':_0x1a1649[_0x63dd('0x86')],'action':_0x1a1649[_0x63dd('0x87')]?_0x1a1649[_0x63dd('0x87')][_0x63dd('0x88')]:undefined,'actiondata':_0x1a1649[_0x63dd('0x87')]?_0x1a1649[_0x63dd('0x87')]['CustomActionData']:undefined};if(_0x1a1649['channelData']&&_0x1a1649[_0x63dd('0x87')]['AudioFromTts']){return base64Decode(_0x1a1649['channelData']['AudioFromTts']['Data'],path[_0x63dd('0x3e')](__dirname,_0x63dd('0x2b'),rs[_0x63dd('0x2c')](0x4)+_0x63dd('0x2d')))[_0x63dd('0x30')](function(_0xc0daf8){_0x35c482[_0x63dd('0x89')]=_0xc0daf8;return _0x35c482;});}return _0x35c482;});};exports[_0x63dd('0x8a')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 08ba999..5f3349e 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 _0x92f1=['exports'];(function(_0x369e7d,_0x5f2b34){var _0x2a65c7=function(_0x3c27b4){while(--_0x3c27b4){_0x369e7d['push'](_0x369e7d['shift']());}};_0x2a65c7(++_0x5f2b34);}(_0x92f1,0x192));var _0x192f=function(_0x377fe3,_0x3c995f){_0x377fe3=_0x377fe3-0x0;var _0x35d535=_0x92f1[_0x377fe3];return _0x35d535;};var nda=require('./nda');module[_0x192f('0x0')]={'nda':nda}; \ No newline at end of file +var _0x9184=['exports','./nda'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9184,0x12f));var _0x4918=function(_0x4dd943,_0x5f379e){_0x4dd943=_0x4dd943-0x0;var _0x4e06ee=_0x9184[_0x4dd943];return _0x4e06ee;};var nda=require(_0x4918('0x0'));module[_0x4918('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 e34b538..e927ad4 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 _0xcecc=['request-promise','../../../../../config/logger','POST','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','CustomAction','custom_action','custom_action_data','CustomActionData'];(function(_0x7dcb63,_0x181059){var _0x657fee=function(_0x3ab29b){while(--_0x3ab29b){_0x7dcb63['push'](_0x7dcb63['shift']());}};_0x657fee(++_0x181059);}(_0xcecc,0x186));var _0xccec=function(_0x508d70,_0x4fca98){_0x508d70=_0x508d70-0x0;var _0x1ce3c4=_0xcecc[_0x508d70];return _0x1ce3c4;};'use strict';var rp=require(_0xccec('0x0'));var url=require('url');var logger=require(_0xccec('0x1'))('agi');module['exports']=function(_0xf0bdcc,_0x38cf71){var _0x338b16={'method':_0xccec('0x2'),'uri':url['resolve'](_0x38cf71['ndauth_url'],_0xccec('0x3')),'form':{'grant_type':'password','username':_0x38cf71[_0xccec('0x4')],'password':_0x38cf71[_0xccec('0x5')]},'json':!![]};return rp(_0x338b16)[_0xccec('0x6')](function(_0x5788aa){var _0x372ea6={'method':_0xccec('0x2'),'uri':url['resolve'](_0x38cf71[_0xccec('0x7')],_0xccec('0x8')),'body':{'type':_0x38cf71[_0xccec('0x9')]||_0xccec('0xa'),'channelId':'Nda','conversation':{'id':_0xf0bdcc[_0xccec('0xb')]},'from':{'id':_0xf0bdcc['callerid'],'name':_0xf0bdcc[_0xccec('0xc')]},'recipient':{'id':_0xf0bdcc[_0xccec('0xd')],'name':_0xf0bdcc['extension']},'text':_0x38cf71[_0xccec('0xe')],'channelData':{}},'headers':{'Authorization':_0xccec('0xf')+_0x5788aa[_0xccec('0x10')]},'json':!![]};if(_0x38cf71['project']){_0x372ea6[_0xccec('0x11')][_0xccec('0x12')][_0xccec('0x13')]=_0x38cf71[_0xccec('0x14')];}if(_0x38cf71[_0xccec('0x15')]=='1'){_0x372ea6['body'][_0xccec('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x38cf71['custom_action']){_0x372ea6[_0xccec('0x11')][_0xccec('0x12')][_0xccec('0x16')]=_0x38cf71[_0xccec('0x17')];if(_0x38cf71[_0xccec('0x18')]){_0x372ea6[_0xccec('0x11')][_0xccec('0x12')][_0xccec('0x19')]=_0x38cf71[_0xccec('0x18')];}}logger['info'](JSON['stringify'](_0x372ea6));return rp(_0x372ea6);});}; \ No newline at end of file +var _0xd49c=['then','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','url','agi','exports','POST','ndauth_url','/token','password','username'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xd49c,0x1d8));var _0xcd49=function(_0x2a938c,_0x3c0bcf){_0x2a938c=_0x2a938c-0x0;var _0x175e87=_0xd49c[_0x2a938c];return _0x175e87;};'use strict';var rp=require('request-promise');var url=require(_0xcd49('0x0'));var logger=require('../../../../../config/logger')(_0xcd49('0x1'));module[_0xcd49('0x2')]=function(_0x5bda72,_0x1181d4){var _0x52362d={'method':_0xcd49('0x3'),'uri':url['resolve'](_0x1181d4[_0xcd49('0x4')],_0xcd49('0x5')),'form':{'grant_type':_0xcd49('0x6'),'username':_0x1181d4[_0xcd49('0x7')],'password':_0x1181d4[_0xcd49('0x6')]},'json':!![]};return rp(_0x52362d)[_0xcd49('0x8')](function(_0x321013){var _0x17f26f={'method':_0xcd49('0x3'),'uri':url[_0xcd49('0x9')](_0x1181d4[_0xcd49('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x1181d4[_0xcd49('0xb')]||_0xcd49('0xc'),'channelId':_0xcd49('0xd'),'conversation':{'id':_0x5bda72[_0xcd49('0xe')]},'from':{'id':_0x5bda72[_0xcd49('0xf')],'name':_0x5bda72[_0xcd49('0x10')]},'recipient':{'id':_0x5bda72[_0xcd49('0x11')],'name':_0x5bda72[_0xcd49('0x12')]},'text':_0x1181d4[_0xcd49('0x13')],'channelData':{}},'headers':{'Authorization':_0xcd49('0x14')+_0x321013['access_token']},'json':!![]};if(_0x1181d4['project']){_0x17f26f[_0xcd49('0x15')][_0xcd49('0x16')][_0xcd49('0x17')]=_0x1181d4['project'];}if(_0x1181d4[_0xcd49('0x18')]=='1'){_0x17f26f[_0xcd49('0x15')]['channelData'][_0xcd49('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcd49('0x1a')};}if(_0x1181d4[_0xcd49('0x1b')]){_0x17f26f[_0xcd49('0x15')][_0xcd49('0x16')][_0xcd49('0x1c')]=_0x1181d4['custom_action'];if(_0x1181d4['custom_action_data']){_0x17f26f['body']['channelData'][_0xcd49('0x1d')]=_0x1181d4[_0xcd49('0x1e')];}}logger[_0xcd49('0x1f')](JSON['stringify'](_0x17f26f));return rp(_0x17f26f);});}; \ 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 48baada..6018533 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 _0x5e31=['./lib/api'];(function(_0x38a660,_0x3a6593){var _0x5a601c=function(_0x2190a8){while(--_0x2190a8){_0x38a660['push'](_0x38a660['shift']());}};_0x5a601c(++_0x3a6593);}(_0x5e31,0x8a));var _0x15e3=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x5e31[_0x3bcf9e];return _0x1bb37c;};'use strict';var asr=require(_0x15e3('0x0'));module['exports']=function(_0x3e5837,_0x2242dc,_0x3ce2bf,_0x33b185){return asr(_0x3e5837,_0x2242dc,_0x3ce2bf,_0x33b185);}; \ No newline at end of file +var _0xcd29=['exports','./lib/api'];(function(_0x57932a,_0x4c8aa8){var _0x2e3c29=function(_0x594f8f){while(--_0x594f8f){_0x57932a['push'](_0x57932a['shift']());}};_0x2e3c29(++_0x4c8aa8);}(_0xcd29,0xcb));var _0x9cd2=function(_0x1696f1,_0x903e1a){_0x1696f1=_0x1696f1-0x0;var _0x26aefb=_0xcd29[_0x1696f1];return _0x26aefb;};'use strict';var asr=require(_0x9cd2('0x0'));module[_0x9cd2('0x1')]=function(_0x56f28b,_0x97b522,_0x1009d9,_0x48c554){return asr(_0x56f28b,_0x97b522,_0x1009d9,_0x48c554);}; \ 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 2fecacb..7b552f0 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 _0x385f=['hex','Open\x20Tilde\x20ASR\x20socket','unix','send','close','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../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','update','digest'];(function(_0x617a61,_0x69aa58){var _0x5e0274=function(_0xfc09a9){while(--_0xfc09a9){_0x617a61['push'](_0x617a61['shift']());}};_0x5e0274(++_0x69aa58);}(_0x385f,0x6b));var _0xf385=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x385f[_0x3a78a0];return _0x48e917;};'use strict';var BPromise=require(_0xf385('0x0'));var _=require(_0xf385('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf385('0x2'));var crypto=require('crypto');var logger=require(_0xf385('0x3'))(_0xf385('0x4'));module[_0xf385('0x5')]=function(_0x1611c5,_0x3e3b23,_0x22d00d,_0x52bba9){return new BPromise(function(_0x5e8422,_0x17e6a2){logger[_0xf385('0x6')](_0xf385('0x7'),_0x52bba9||_0xf385('0x8'));var _0x466ee6=new WebSocket(_0x52bba9||_0xf385('0x8'),{'perMessageDeflate':![]});var _0xfff26d='';var _0x5be3c5='0';var _0x5cc789='1';var _0x495df5=_0xf385('0x9');function _0x4eeed6(_0x41a722){var _0x2a84a4=crypto[_0xf385('0xa')]('sha1');_0x2a84a4[_0xf385('0xb')](_0x41a722);return _0x2a84a4[_0xf385('0xc')](_0xf385('0xd'));}function _0x1958df(){try{logger[_0xf385('0x6')](_0xf385('0xe'));var _0x290e1e=moment()[_0xf385('0xf')]();var _0x216d6e=_0x4eeed6(_0x290e1e+_0x3e3b23+_0x22d00d);_0x466ee6[_0xf385('0x10')](JSON['stringify']({'appID':_0x3e3b23,'timestamp':_0x290e1e,'appKey':_0x216d6e}));var _0x3ab534=fs['createReadStream'](_0x1611c5);_0x3ab534['on']('data',function(_0x37fb93){_0x466ee6['send'](_0x37fb93);});_0x3ab534['on'](_0xf385('0x11'),function(){_0x466ee6[_0xf385('0x10')]('EOS');});}catch(_0x31fff8){logger[_0xf385('0x12')](_0xf385('0x13'),JSON[_0xf385('0x14')](_0x31fff8));_0x466ee6[_0xf385('0x15')]();}}function _0x3244e8(_0x2e26a6){try{if(_0x2e26a6){var _0x1ab24e=JSON[_0xf385('0x16')](_0x2e26a6);switch(_0x1ab24e['status']){case 0x0:if(_0x1ab24e[_0xf385('0x17')]){if(_0x1ab24e[_0xf385('0x17')][_0xf385('0x18')]){logger[_0xf385('0x6')](_0xf385('0x19'),JSON[_0xf385('0x14')](_0x1ab24e[_0xf385('0x17')][_0xf385('0x1a')]));_0xfff26d=_0x1ab24e[_0xf385('0x17')][_0xf385('0x1a')][0x0][_0xf385('0x1b')];_0x5be3c5=_0x1ab24e[_0xf385('0x17')][_0xf385('0x1a')][0x0]['likelihood'];_0x5cc789='0';_0x495df5=_0xf385('0x1c');_0x466ee6[_0xf385('0x15')]();}}break;case 0x1:logger[_0xf385('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5cc789='1';_0x495df5=_0xf385('0x9');break;case 0x2:logger[_0xf385('0x6')](_0xf385('0x1d'));_0x5cc789='2';_0x495df5='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xf385('0x1e'));_0x5cc789='9';_0x495df5=_0xf385('0x1e');break;case 0xa:logger['info'](_0xf385('0x1f'));_0x5cc789='10';_0x495df5=_0xf385('0x1f');break;case 0xb:logger[_0xf385('0x6')](_0xf385('0x20'));_0x5cc789='11';_0x495df5=_0xf385('0x20');}}}catch(_0x34e8a5){logger[_0xf385('0x12')](_0xf385('0x21'),JSON[_0xf385('0x14')](_0x34e8a5));_0x466ee6[_0xf385('0x15')]();}}function _0x5504db(){logger['info'](_0xf385('0x22'));_0x5e8422({'transcript':_0xfff26d,'confidence':_0x5be3c5,'status':_0x5cc789,'status_message':_0x495df5});}function _0x2d4c3d(_0x1bbf71){logger[_0xf385('0x12')](_0xf385('0x23'));if(!_[_0xf385('0x24')](_0x1bbf71)){logger['error'](_[_0xf385('0x25')](_0x1bbf71)?JSON[_0xf385('0x14')](_0x1bbf71):_0x1bbf71);}}_0x466ee6['on'](_0xf385('0x26'),_0x1958df);_0x466ee6['on'](_0xf385('0x27'),_0x3244e8);_0x466ee6['on'](_0xf385('0x11'),_0x5504db);_0x466ee6['on'](_0xf385('0x12'),_0x2d4c3d);});}; \ No newline at end of file +var _0x4509=['result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status'];(function(_0x58b2ca,_0x27e9cd){var _0x46ed6c=function(_0x3b159d){while(--_0x3b159d){_0x58b2ca['push'](_0x58b2ca['shift']());}};_0x46ed6c(++_0x27e9cd);}(_0x4509,0x8b));var _0x9450=function(_0x3e6f35,_0xd4121f){_0x3e6f35=_0x3e6f35-0x0;var _0x4dd6f7=_0x4509[_0x3e6f35];return _0x4dd6f7;};'use strict';var BPromise=require(_0x9450('0x0'));var _=require(_0x9450('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9450('0x2'));var crypto=require(_0x9450('0x3'));var logger=require(_0x9450('0x4'))('agi');module[_0x9450('0x5')]=function(_0xc6d337,_0xa0bb13,_0x154f57,_0x1049bd){return new BPromise(function(_0x47547a,_0x339357){logger[_0x9450('0x6')](_0x9450('0x7'),_0x1049bd||_0x9450('0x8'));var _0x30b43e=new WebSocket(_0x1049bd||_0x9450('0x8'),{'perMessageDeflate':![]});var _0x14c2f0='';var _0x55ab1f='0';var _0x380cbe='1';var _0x2fc793=_0x9450('0x9');function _0x115186(_0x18ee0c){var _0x5e7e15=crypto['createHash'](_0x9450('0xa'));_0x5e7e15[_0x9450('0xb')](_0x18ee0c);return _0x5e7e15['digest'](_0x9450('0xc'));}function _0x1d072d(){try{logger['info'](_0x9450('0xd'));var _0x13cfd2=moment()[_0x9450('0xe')]();var _0x3b5cfd=_0x115186(_0x13cfd2+_0xa0bb13+_0x154f57);_0x30b43e[_0x9450('0xf')](JSON['stringify']({'appID':_0xa0bb13,'timestamp':_0x13cfd2,'appKey':_0x3b5cfd}));var _0x19ad46=fs[_0x9450('0x10')](_0xc6d337);_0x19ad46['on'](_0x9450('0x11'),function(_0x5014a7){_0x30b43e[_0x9450('0xf')](_0x5014a7);});_0x19ad46['on']('close',function(){_0x30b43e[_0x9450('0xf')](_0x9450('0x12'));});}catch(_0x102ebb){logger[_0x9450('0x13')](_0x9450('0x14'),JSON[_0x9450('0x15')](_0x102ebb));_0x30b43e[_0x9450('0x16')]();}}function _0x292361(_0x125372){try{if(_0x125372){var _0x5709aa=JSON[_0x9450('0x17')](_0x125372);switch(_0x5709aa[_0x9450('0x18')]){case 0x0:if(_0x5709aa[_0x9450('0x19')]){if(_0x5709aa['result'][_0x9450('0x1a')]){logger[_0x9450('0x6')](_0x9450('0x1b'),JSON[_0x9450('0x15')](_0x5709aa['result'][_0x9450('0x1c')]));_0x14c2f0=_0x5709aa['result'][_0x9450('0x1c')][0x0][_0x9450('0x1d')];_0x55ab1f=_0x5709aa[_0x9450('0x19')][_0x9450('0x1c')][0x0][_0x9450('0x1e')];_0x380cbe='0';_0x2fc793='Success.';_0x30b43e['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x380cbe='1';_0x2fc793=_0x9450('0x9');break;case 0x2:logger[_0x9450('0x6')](_0x9450('0x1f'));_0x380cbe='2';_0x2fc793=_0x9450('0x1f');break;case 0x9:logger[_0x9450('0x6')](_0x9450('0x20'));_0x380cbe='9';_0x2fc793=_0x9450('0x20');break;case 0xa:logger[_0x9450('0x6')](_0x9450('0x21'));_0x380cbe='10';_0x2fc793=_0x9450('0x21');break;case 0xb:logger[_0x9450('0x6')](_0x9450('0x22'));_0x380cbe='11';_0x2fc793=_0x9450('0x22');}}}catch(_0x57c766){logger['error'](_0x9450('0x23'),JSON['stringify'](_0x57c766));_0x30b43e['terminate']();}}function _0xc00840(){logger[_0x9450('0x6')](_0x9450('0x24'));_0x47547a({'transcript':_0x14c2f0,'confidence':_0x55ab1f,'status':_0x380cbe,'status_message':_0x2fc793});}function _0x1293c9(_0x507ae2){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x9450('0x25')](_0x507ae2)){logger[_0x9450('0x13')](_[_0x9450('0x26')](_0x507ae2)?JSON[_0x9450('0x15')](_0x507ae2):_0x507ae2);}}_0x30b43e['on'](_0x9450('0x27'),_0x1d072d);_0x30b43e['on'](_0x9450('0x28'),_0x292361);_0x30b43e['on']('close',_0xc00840);_0x30b43e['on'](_0x9450('0x13'),_0x1293c9);});}; \ 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 fab88f6..4eddac4 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 _0xbc88=['exports','./asr'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xbc88,0x11d));var _0x8bc8=function(_0x401c70,_0x54ed38){_0x401c70=_0x401c70-0x0;var _0x31e33e=_0xbc88[_0x401c70];return _0x31e33e;};var asr=require(_0x8bc8('0x0'));module[_0x8bc8('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2d6b=['./asr'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x2d6b,0x7e));var _0xb2d6=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x2d6b[_0x29d94e];return _0x106237;};var asr=require(_0xb2d6('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 74354f9..e445fda 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x5515a7,_0x2c4af1){var _0x43f4bf=function(_0x3d519d){while(--_0x3d519d){_0x5515a7['push'](_0x5515a7['shift']());}};_0x43f4bf(++_0x2c4af1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 518a099..b114e0c 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 _0x3937=['trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','no\x20variable\x20selected\x20for\x20the\x20result','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayPhonetic','sendMail','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','host','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','.wav','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','moment','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','name','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','PUT','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','length','%s.%s','replaceObjectAllVariables','stringify','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','forEach','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','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','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3937,0xbf));var _0x7393=function(_0xb36881,_0x368c51){_0xb36881=_0xb36881-0x0;var _0x501be2=_0x3937[_0xb36881];return _0x501be2;};'use strict';var fs=require('fs');var util=require(_0x7393('0x0'));var _=require('lodash');var sh=require(_0x7393('0x1'));var odbc=require(_0x7393('0x2'))();var rs=require('randomstring');var moment=require(_0x7393('0x3'));var Mustache=require('mustache');var rp=require(_0x7393('0x4'));var logger=require('../../config/logger')(_0x7393('0x5'));var config=require(_0x7393('0x6'));var scripts=require(_0x7393('0x7'));var FILES_PATH=_0x7393('0x8');var recursiveMapAttributes=[_0x7393('0x9'),_0x7393('0xa')];var verticesWithRetry=[_0x7393('0xb'),_0x7393('0xc'),_0x7393('0xd')];var AGIVertices=function(_0x4efb50,_0x565ab6,_0x287359){this[_0x7393('0xe')]=_0x4efb50;this[_0x7393('0xf')]=_0x565ab6;this['mailRpc']=_0x287359;};AGIVertices[_0x7393('0x10')]['getVariable']=function(_0x56ed4c,_0x47c5c6){this['rpc'][_0x7393('0x11')](_0x56ed4c)[_0x7393('0x12')](function(_0x29d8cc){_0x47c5c6(null,_0x29d8cc?_0x29d8cc['name']:![]);})[_0x7393('0x13')](function(_0x470f09){_0x47c5c6(_0x470f09);});};AGIVertices[_0x7393('0x10')][_0x7393('0x14')]=function(_0xe86cf4,_0x1fe171){this[_0x7393('0xf')][_0x7393('0x15')](_0xe86cf4)[_0x7393('0x12')](function(_0x4e521c){_0x1fe171(null,_0x4e521c?_0x4e521c['name']:![]);})[_0x7393('0x13')](function(_0x5d0d2b){_0x1fe171(_0x5d0d2b);});};AGIVertices['prototype']['getSquareProject']=function(_0x82f5fa,_0x54dc47){this[_0x7393('0xf')][_0x7393('0x16')](_0x82f5fa)['then'](function(_0x459abf){_0x54dc47(null,_0x459abf?_0x459abf['name']:![]);})['catch'](function(_0x31c8c2){_0x54dc47(_0x31c8c2);});};AGIVertices[_0x7393('0x10')][_0x7393('0x17')]=function(_0x1dc3e3,_0x31902f){this[_0x7393('0xf')][_0x7393('0x18')](_0x1dc3e3)[_0x7393('0x12')](function(_0x546642){_0x31902f(null,_0x546642?_0x546642['dsn']:![]);})[_0x7393('0x13')](function(_0x16f617){_0x31902f(_0x16f617);});};AGIVertices[_0x7393('0x10')][_0x7393('0x19')]=function(_0x131667,_0x52f716){this['rpc']['getUserById'](_0x131667)[_0x7393('0x12')](function(_0x5b5ca9){_0x52f716(null,_0x5b5ca9?_0x5b5ca9['name']:![]);})[_0x7393('0x13')](function(_0xa8f852){_0x52f716(_0xa8f852);});};AGIVertices['prototype'][_0x7393('0x1a')]=function(_0x2b0389,_0x1ac912){this[_0x7393('0xf')][_0x7393('0x1b')](_0x2b0389)[_0x7393('0x12')](function(_0x1b31b8){_0x1ac912(null,_0x1b31b8?_0x1b31b8[_0x7393('0x1c')]:![]);})[_0x7393('0x13')](function(_0x3d8773){_0x1ac912(_0x3d8773);});};AGIVertices[_0x7393('0x10')][_0x7393('0x1d')]=function(_0x19160c,_0x4e1fea){var _0x39d95f=this;this[_0x7393('0xf')][_0x7393('0x1e')](_0x19160c)[_0x7393('0x12')](function(_0x1013aa){_0x4e1fea(null,_0x1013aa?_0x39d95f[_0x7393('0x1f')](_0x1013aa['save_name']):![]);})[_0x7393('0x13')](function(_0x4befa4){_0x4e1fea(_0x4befa4);});};AGIVertices[_0x7393('0x10')]['getMailAccount']=function(_0x6749ff,_0x3a04dd){this[_0x7393('0xf')][_0x7393('0x20')](_0x6749ff)[_0x7393('0x12')](function(_0x1107f6){_0x3a04dd(null,_0x1107f6?_0x1107f6:![]);})[_0x7393('0x13')](function(_0x28ff33){_0x3a04dd(_0x28ff33);});};AGIVertices[_0x7393('0x10')][_0x7393('0x21')]=function(_0x46e91f,_0x2a3824,_0x55ebdd){this['mailRpc'][_0x7393('0x21')](_0x46e91f,_0x2a3824)['then'](function(){_0x55ebdd(null);})[_0x7393('0x13')](function(_0x489f32){_0x55ebdd(_0x489f32);});};AGIVertices[_0x7393('0x10')]['getIntervals']=function(_0x224b4b,_0x3fe138){this[_0x7393('0xf')][_0x7393('0x22')](_0x224b4b)[_0x7393('0x12')](function(_0x34217a){if(_0x34217a){if(_0x34217a[_0x7393('0x23')]){_0x3fe138(null,[_0x34217a[_0x7393('0x24')]]);}else{_0x3fe138(null,_[_0x7393('0x25')](_0x34217a[_0x7393('0x26')],'interval'));}}else{_0x3fe138(null,![]);}})[_0x7393('0x13')](function(_0x4c957d){_0x3fe138(_0x4c957d);});};AGIVertices[_0x7393('0x10')]['getSoundPath']=function(_0x1ffbea){return util[_0x7393('0x27')](_0x7393('0x28'),FILES_PATH,_0x1ffbea);};AGIVertices[_0x7393('0x10')][_0x7393('0x29')]=function(_0x487a9b,_0x14ee6e,_0x596f49){odbc[_0x7393('0x2a')](_0x487a9b,function(_0x1237ae){if(_0x1237ae){logger[_0x7393('0x2b')](_0x7393('0x2c'),_0x1237ae);_0x596f49(_0x1237ae);}else{logger[_0x7393('0x2d')]('ODBC\x20connection\x20successfully');odbc['query'](_0x14ee6e,function(_0x1b5d87,_0xfc12ab){if(_0x1b5d87){logger[_0x7393('0x2d')](_0x7393('0x2e'),_0x14ee6e);_0x596f49(_0x1b5d87);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x14ee6e);odbc['close'](function(_0x264393){if(_0x264393){logger[_0x7393('0x2b')](_0x7393('0x2f'),_0x264393);}_0x596f49(null,_0xfc12ab);});}});}});};AGIVertices[_0x7393('0x10')][_0x7393('0x30')]=function(_0x406b35,_0x146afb){this[_0x7393('0xf')][_0x7393('0x31')](_0x406b35)[_0x7393('0x12')](function(_0xc39c05){_0x146afb(null,_0xc39c05?_0xc39c05:![]);})[_0x7393('0x13')](function(_0x7c5976){_0x146afb(_0x7c5976);});};AGIVertices[_0x7393('0x10')][_0x7393('0x32')]=function(_0x13e53c,_0x1644ac){this[_0x7393('0xf')][_0x7393('0x32')](_0x13e53c)[_0x7393('0x12')](function(_0x300858){_0x1644ac(null,_0x300858);})[_0x7393('0x13')](function(_0x49990d){_0x1644ac(_0x49990d);});};AGIVertices[_0x7393('0x10')][_0x7393('0x33')]=function(_0x25a2a6,_0x40ab6d,_0x1517c2){this[_0x7393('0xf')][_0x7393('0x33')]({'uniqueid':this[_0x7393('0xe')]['uniqueid'],'node':_0x25a2a6['label'],'application':_0x25a2a6[_0x7393('0x34')],'data':_0x40ab6d||null,'project_name':this['channel'][_0x7393('0x35')],'callerid':this[_0x7393('0xe')][_0x7393('0x36')]})[_0x7393('0x12')](function(_0x19f751){if(_0x1517c2){_0x1517c2(null,_0x19f751);}})[_0x7393('0x13')](function(_0x585c89){if(_0x1517c2){_0x1517c2(_0x585c89);}});};AGIVertices[_0x7393('0x10')][_0x7393('0x37')]=function(_0x1cff7a,_0x227e6b,_0x1b616e,_0x5421a5){this['rpc'][_0x7393('0x37')]({'uniqueid':this['channel'][_0x7393('0x38')],'callerid':this[_0x7393('0xe')][_0x7393('0x36')],'calleridname':this[_0x7393('0xe')][_0x7393('0x39')],'context':this[_0x7393('0xe')][_0x7393('0x3a')],'extension':this[_0x7393('0xe')][_0x7393('0x3b')],'priority':this[_0x7393('0xe')][_0x7393('0x3c')],'accountcode':this[_0x7393('0xe')][_0x7393('0x3d')],'dnid':this[_0x7393('0xe')][_0x7393('0x3e')],'projectName':this['channel'][_0x7393('0x35')],'saveName':_0x227e6b,'filename':_0x1cff7a[_0x7393('0x3f')]||_0x227e6b,'savePath':_0x1b616e})[_0x7393('0x12')](function(_0x351ba9){_0x5421a5(null,_0x351ba9);})['catch'](function(_0x103a90){_0x5421a5(_0x103a90);});};AGIVertices[_0x7393('0x10')][_0x7393('0x40')]=function(_0x275192,_0x1deca3,_0x2bf8bd,_0x26af1e,_0x8cac53){this[_0x7393('0xf')]['createSquareMessage']({'uniqueid':this[_0x7393('0xe')][_0x7393('0x38')],'body':_0x275192,'direction':_0x1deca3,'providerName':_0x2bf8bd,'providerResponse':_0x26af1e})[_0x7393('0x12')](function(_0x5b82d4){if(_0x8cac53){_0x8cac53(null,_0x5b82d4);}})[_0x7393('0x13')](function(_0x3150c5){if(_0x8cac53){_0x8cac53(_0x3150c5);}});};AGIVertices['prototype'][_0x7393('0x41')]=function(_0x57ee59,_0x396992){this['rpc'][_0x7393('0x41')]({'firstName':_[_0x7393('0x42')](_0x57ee59['name'])||_[_0x7393('0x43')](_0x57ee59[_0x7393('0x1c')])?_0x7393('0x44')+Math[_0x7393('0x45')]():_0x57ee59['name'],'lastName':_['isEmpty'](_0x57ee59['lastName'])||_[_0x7393('0x43')](_0x57ee59[_0x7393('0x46')])?null:_0x57ee59[_0x7393('0x46')],'phone':_0x57ee59[_0x7393('0x47')],'ListId':_0x57ee59[_0x7393('0x48')],'scheduledat':_0x57ee59[_0x7393('0x49')],'callbackUniqueid':this[_0x7393('0xe')][_0x7393('0x38')],'tags':_0x7393('0x4a'),'description':_0x7393('0x4b')+_0x57ee59[_0x7393('0x49')][_0x7393('0x4c')](),'priority':_0x57ee59[_0x7393('0x4d')]})[_0x7393('0x12')](function(_0x4594a1){_0x396992(null,_0x4594a1);})[_0x7393('0x13')](function(_0x48fc92){_0x396992(_0x48fc92);});};AGIVertices['prototype'][_0x7393('0x4e')]=function(_0x5560af,_0x5e97cd){this['rpc'][_0x7393('0x4f')](_0x5560af)['then'](function(_0x4645bd){_0x5e97cd(null,_0x4645bd?_0x4645bd['name']:![]);})['catch'](function(_0x17a94b){_0x5e97cd(_0x17a94b);});};AGIVertices['prototype'][_0x7393('0x50')]=function(_0x4a0642,_0x11c739,_0x5f7d6c){var _0x1ebcf5={'role':_0x7393('0x51')};_0x1ebcf5[_0x4a0642]=this['channel'][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x50')](_0x1ebcf5,_0x11c739,this['channel'][_0x7393('0x38')])['then'](function(_0x4bf1dc){_0x5f7d6c(null,_['isNil'](_0x4bf1dc)?![]:!![]);})[_0x7393('0x13')](function(_0x27a3b0){logger[_0x7393('0x2b')](_0x27a3b0);_0x5f7d6c(null,![]);});};AGIVertices[_0x7393('0x10')]['agentUnpause']=function(_0x4e3917,_0x5995af){var _0x452153={'role':'agent'};_0x452153[_0x4e3917]=this[_0x7393('0xe')][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x52')](_0x452153)[_0x7393('0x12')](function(_0x10dbef){_0x5995af(null,_['isNil'](_0x10dbef)?![]:!![]);})[_0x7393('0x13')](function(_0x177335){logger['error'](_0x177335);_0x5995af(null,![]);});};AGIVertices[_0x7393('0x10')][_0x7393('0x53')]=function(_0x182f95,_0x57c8b5){var _0x406bb1={'role':'agent'};_0x406bb1[_0x182f95]=this['channel'][_0x7393('0x36')];this[_0x7393('0xf')][_0x7393('0x53')](_0x406bb1)['then'](function(_0x22397a){_0x57c8b5(null,_[_0x7393('0x43')](_0x22397a)?![]:!![]);})['catch'](function(_0x56190d){logger['error'](_0x56190d);_0x57c8b5(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x469209,_0x1e50a2){var _0x3ae0fb={'role':_0x7393('0x51')};_0x3ae0fb[_0x469209]=this['channel']['callerid'];var _0x11ff30=_0x469209!=_0x7393('0x54')?util[_0x7393('0x27')](_0x7393('0x55'),_0x7393('0x56'),this['channel'][_0x7393('0x36')]):undefined;this[_0x7393('0xf')][_0x7393('0x57')](_0x3ae0fb,_0x11ff30)['then'](function(_0x1a42c8){_0x1e50a2(null,_['isNil'](_0x1a42c8)?![]:!![]);})[_0x7393('0x13')](function(_0x5c1a25){logger['error'](_0x5c1a25);_0x1e50a2(null,![]);});};AGIVertices[_0x7393('0x10')][_0x7393('0x58')]=function(_0x2a99e7,_0x1d7b59){sh[_0x7393('0x59')](_[_0x7393('0x5a')](_0x2a99e7),function(_0x574736,_0x531e32){var _0x2ccdcd=_0x531e32[_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1d7b59(null,_0x2ccdcd);});};AGIVertices[_0x7393('0x10')][_0x7393('0x5c')]=function(_0x5a07d0,_0x1c9656){scripts[_0x7393('0x5c')](_0x5a07d0[_0x7393('0x5d')],_0x5a07d0['google_cloud_tts_text_type']||_0x7393('0x5e'),_0x5a07d0[_0x7393('0x5e')],_0x5a07d0[_0x7393('0x5f')]||_0x7393('0x60'),_0x5a07d0[_0x7393('0x61')]||_0x7393('0x62'),_0x5a07d0[_0x7393('0x63')]||_0x7393('0x64'))[_0x7393('0x12')](function(_0xe197ef){_0x1c9656(null,_0xe197ef);})['catch'](function(_0x33edce){_0x1c9656(_0x33edce);});};AGIVertices[_0x7393('0x10')][_0x7393('0x65')]=function(_0x2f80b6,_0x5e42f3){scripts[_0x7393('0x65')](_0x2f80b6[_0x7393('0x5e')],_0x2f80b6[_0x7393('0x66')]||'en',0x1)[_0x7393('0x12')](function(_0x135b5b){_0x5e42f3(null,_0x135b5b);})[_0x7393('0x13')](function(_0x10c081){_0x5e42f3(_0x10c081);});};AGIVertices[_0x7393('0x10')][_0x7393('0x67')]=function(_0x923d80,_0x52e070){var _0x5e4ad6={'uri':_0x923d80['url'],'method':_0x923d80[_0x7393('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x923d80[_0x7393('0x69')])==='number'&&parseInt(_0x923d80[_0x7393('0x69')])>=0x1?parseInt(_0x923d80[_0x7393('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x7393('0x6a')]([_0x7393('0x6b'),_0x7393('0x6c')],_0x5e4ad6[_0x7393('0x68')]['toUpperCase']())){try{_0x5e4ad6[_0x7393('0x6d')]=_0x923d80[_0x7393('0xa')]?JSON[_0x7393('0x6e')](_0x923d80[_0x7393('0xa')]):{};}catch(_0x3899ad){logger[_0x7393('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3899ad);}}try{_0x5e4ad6[_0x7393('0x6f')]=_0x923d80[_0x7393('0x9')]?JSON[_0x7393('0x6e')](_0x923d80['rawHeaders']):{};}catch(_0x93c792){logger[_0x7393('0x2b')](_0x7393('0x70'),_0x93c792);}if(_0x923d80[_0x7393('0x71')]){try{var _0x430bfd=require(_0x923d80[_0x7393('0x71')])[_0x7393('0x72')](this,_0x5e4ad6);_0x5e4ad6[_0x7393('0x73')]=Mustache[_0x7393('0x74')](_0x923d80[_0x7393('0x75')],_0x430bfd,{},['$$','$$']);if(_0x5e4ad6[_0x7393('0x6f')]){_0x5e4ad6[_0x7393('0x6f')]=JSON[_0x7393('0x6e')](Mustache[_0x7393('0x74')](JSON['stringify'](_0x5e4ad6[_0x7393('0x6f')]),_0x430bfd,{},['$$','$$']));}if(_0x5e4ad6[_0x7393('0x6d')]){_0x5e4ad6[_0x7393('0x6d')]=JSON['parse'](Mustache[_0x7393('0x74')](JSON['stringify'](_0x5e4ad6[_0x7393('0x6d')]),_0x430bfd,{},['$$','$$']));}}catch(_0x38486b){logger['error'](_0x7393('0x76'),_0x38486b);}}rp(_0x5e4ad6)[_0x7393('0x12')](function(_0x3c7614){var _0x1a8799={'statusCode':_0x3c7614['statusCode']||0xc8,'statusMessage':_0x3c7614[_0x7393('0x77')]||'OK','headers':_0x3c7614['headers']||{},'body':_0x3c7614[_0x7393('0x6d')]||{}};_0x52e070(null,_0x1a8799);})[_0x7393('0x13')](function(_0x41224e){var _0x508bf5={'statusCode':_0x41224e['statusCode']||0x1f4,'statusMessage':_0x41224e['message']||_0x7393('0x78'),'headers':_0x41224e['options']['headers']||{},'body':_0x41224e[_0x7393('0x79')][_0x7393('0x6d')]||{}};_0x52e070(null,_0x508bf5);});};AGIVertices[_0x7393('0x10')][_0x7393('0x7a')]=function(_0x52111c,_0x3b3d59){scripts[_0x7393('0x7a')](this[_0x7393('0xe')]['uniqueid'],_0x52111c[_0x7393('0x7b')],_0x52111c['text'],_0x52111c[_0x7393('0x7c')]||'en')[_0x7393('0x12')](function(_0x29f0bb){_0x3b3d59(null,_0x29f0bb);})[_0x7393('0x13')](function(_0xf1692e){_0x3b3d59(_0xf1692e);});};AGIVertices[_0x7393('0x10')][_0x7393('0x7d')]=function(_0x5e40c3,_0x5f3d52){scripts[_0x7393('0x7d')](this[_0x7393('0xe')]['uniqueid'],_0x5e40c3[_0x7393('0x7e')],_0x5e40c3['client_email'],_0x5e40c3['private_key'],_0x5e40c3[_0x7393('0x5e')],_0x5e40c3[_0x7393('0x7f')]||'en')['then'](function(_0x3c048c){_0x5f3d52(null,_0x3c048c);})[_0x7393('0x13')](function(_0x14a5bd){_0x5f3d52(_0x14a5bd);});};AGIVertices[_0x7393('0x10')]['sestekNDA']=function(_0x506285,_0x127abf){scripts[_0x7393('0x80')](this[_0x7393('0xe')],_0x506285)[_0x7393('0x12')](function(_0x52da15){_0x127abf(null,_0x52da15);})[_0x7393('0x13')](function(_0x5947be){_0x127abf(_0x5947be);});};AGIVertices[_0x7393('0x10')][_0x7393('0x81')]=function(_0x29f655,_0xb7e7a0){scripts[_0x7393('0x81')](_0x29f655[_0x7393('0x7b')],_0x29f655['text'],_0x29f655[_0x7393('0x82')]||_0x7393('0x60'),_0x29f655[_0x7393('0x83')])[_0x7393('0x12')](function(_0x4f1449){_0xb7e7a0(null,_0x4f1449);})[_0x7393('0x13')](function(_0x4f2ae9){_0xb7e7a0(_0x4f2ae9);});};AGIVertices['prototype'][_0x7393('0x84')]=function(_0x3697e6,_0x3bd6f7,_0x57cf0a){scripts[_0x7393('0x84')](_0x3bd6f7,_0x3697e6[_0x7393('0x7b')],_0x3697e6[_0x7393('0x85')]||'en-US',this[_0x7393('0x86')](_0x3697e6[_0x7393('0x87')])?_0x3697e6[_0x7393('0x87')]:undefined)['then'](function(_0x13fd17){_0x57cf0a(null,_0x13fd17);})[_0x7393('0x13')](function(_0x3403d9){_0x57cf0a(_0x3403d9);});};AGIVertices[_0x7393('0x10')]['awsPolly']=function(_0x13b18c,_0x366372){scripts[_0x7393('0x88')](_0x13b18c[_0x7393('0x89')],_0x13b18c[_0x7393('0x8a')],_0x13b18c[_0x7393('0x8b')],_0x13b18c[_0x7393('0x8c')]||'Amy',_0x13b18c[_0x7393('0x5e')],_0x13b18c[_0x7393('0x8d')]||_0x7393('0x5e'))['then'](function(_0x5dc60e){_0x366372(null,_0x5dc60e);})[_0x7393('0x13')](function(_0x4298df){_0x366372(_0x4298df);});};AGIVertices[_0x7393('0x10')]['awsLex']=function(_0x3507ea,_0x34f4b8){scripts[_0x7393('0x8e')](this[_0x7393('0xe')][_0x7393('0x38')],_0x3507ea['aws_access_key_id'],_0x3507ea[_0x7393('0x8a')],_0x3507ea[_0x7393('0x8f')],_0x3507ea['text'],_0x3507ea[_0x7393('0x90')])[_0x7393('0x12')](function(_0x31e7ac){_0x34f4b8(null,_0x31e7ac);})[_0x7393('0x13')](function(_0x5f1b35){_0x34f4b8(_0x5f1b35);});};AGIVertices[_0x7393('0x10')]['googleASR']=function(_0x469767,_0x282ff7,_0x54eaba){scripts[_0x7393('0x91')](_0x282ff7,_0x469767[_0x7393('0x7b')],_0x469767[_0x7393('0x92')]||_0x7393('0x60'))[_0x7393('0x12')](function(_0x270af9){_0x54eaba(null,_0x270af9);})[_0x7393('0x13')](function(_0x3f54bb){_0x54eaba(_0x3f54bb);});};AGIVertices[_0x7393('0x10')]['tildeASR']=function(_0x1921d6,_0x4e0acf,_0x392bff){scripts[_0x7393('0x93')](_0x4e0acf,_0x1921d6[_0x7393('0x94')],_0x1921d6['appsecret'],_0x1921d6[_0x7393('0x73')])[_0x7393('0x12')](function(_0x353e21){_0x392bff(null,_0x353e21);})[_0x7393('0x13')](function(_0x244c2c){_0x392bff(_0x244c2c);});};AGIVertices['prototype'][_0x7393('0x95')]=function(_0xeadd09){var _0x3c9069=_['includes'](verticesWithRetry,_0xeadd09[_0x7393('0x34')])?_0xeadd09:_[_0x7393('0x96')](_0xeadd09);for(var _0x31ab6e in _0x3c9069){if(_0x3c9069[_0x7393('0x97')](_0x31ab6e)){if(_0x3c9069[_0x31ab6e]&&_[_0x7393('0x98')](_0x3c9069[_0x31ab6e])){if(_[_0x7393('0x6a')](recursiveMapAttributes,_0x31ab6e)){_0x3c9069[_0x31ab6e]=this['replaceObjectAllVariables'](_0x3c9069[_0x31ab6e]);}else{_0x3c9069[_0x31ab6e]=this['replaceAllVariables'](_0x3c9069[_0x31ab6e]);}}}}return _0x3c9069;};AGIVertices['prototype'][_0x7393('0x99')]=function(_0x2e225e){for(var _0x1994b6 in _0x2e225e){if(_0x2e225e[_0x7393('0x97')](_0x1994b6)){if(_[_0x7393('0x9a')](_0x2e225e[_0x1994b6])){this[_0x7393('0x99')](_0x2e225e[_0x1994b6]);}else if(_[_0x7393('0x9b')](_0x2e225e[_0x1994b6])){for(var _0x50fd0d=0x0;_0x50fd0d<_0x2e225e[_0x1994b6]['length'];_0x50fd0d++){this['recursiveNodeIndex'](_0x2e225e[_0x1994b6][_0x50fd0d]);}}else if(_['isString'](_0x2e225e[_0x1994b6])){_0x2e225e[_0x1994b6]=this[_0x7393('0x9c')](_0x2e225e[_0x1994b6]);}}}};AGIVertices['prototype'][_0x7393('0x9d')]=function(_0x324eca,_0x1b6b5c){for(var _0x4c47c2 in _0x324eca){if(_0x324eca[_0x7393('0x97')](_0x4c47c2)){if(_[_0x7393('0x9a')](_0x324eca[_0x4c47c2])){if(!_[_0x7393('0x42')](_0x324eca[_0x4c47c2])){this[_0x7393('0x9d')](_0x324eca[_0x4c47c2],util[_0x7393('0x27')]('%s.%s',_0x1b6b5c,_0x4c47c2));}}else if(_[_0x7393('0x9b')](_0x324eca[_0x4c47c2])){for(var _0x54e4b5=0x0;_0x54e4b5<_0x324eca[_0x4c47c2][_0x7393('0x9e')];_0x54e4b5++){this[_0x7393('0x9d')](_0x324eca[_0x4c47c2][_0x54e4b5],util[_0x7393('0x27')](_0x7393('0x9f'),_0x1b6b5c,_0x4c47c2+'['+_0x54e4b5+']'));}}else{if(!_[_0x7393('0x43')](_0x324eca[_0x4c47c2])){this[_0x7393('0xe')]['setVariable'](util['format'](_0x7393('0x9f'),_0x1b6b5c,_0x4c47c2),_0x324eca[_0x4c47c2]);}}}}};AGIVertices[_0x7393('0x10')][_0x7393('0xa0')]=function(_0x5d16bd){try{var _0x52b5de=JSON[_0x7393('0x6e')](_0x5d16bd);this[_0x7393('0x99')](_0x52b5de);return JSON[_0x7393('0xa1')](_0x52b5de);}catch(_0x4370ac){return this[_0x7393('0x9c')](_0x5d16bd);}};AGIVertices['prototype'][_0x7393('0x9c')]=function(_0x256ade){var _0x3e59b2=_0x256ade[_0x7393('0xa2')]('{');for(var _0x411c06=0x1;_0x411c06<_0x3e59b2['length'];_0x411c06+=0x1){var _0x50d7af=_0x3e59b2[_0x411c06][_0x7393('0xa2')]('}');if(_0x50d7af['length']>0x1){_0x256ade=_0x256ade[_0x7393('0xa3')]('{'+_0x50d7af[0x0]+'}',this[_0x7393('0xe')][_0x7393('0xa4')](_0x50d7af[0x0])[_0x7393('0xa5')]||_0x50d7af[0x0]);}}if(_0x3e59b2[_0x7393('0x9e')]===0x1){return _0x256ade[_0x7393('0x4c')]();}return this['replaceAllVariables'](_0x256ade);};AGIVertices[_0x7393('0x10')]['getAndSetVariable']=function(_0x358c9c,_0x5e6045){var _0x4fbc19=this[_0x7393('0xe')]['getVariable'](_0x358c9c);if(_0x4fbc19[_0x7393('0xa6')]===-0x1){return _0x4fbc19;}logger['info'](util['format'](_0x7393('0xa7'),_0x5e6045,_0x4fbc19['extra']));return this['channel'][_0x7393('0xa8')](_0x5e6045,_0x4fbc19['extra']);};AGIVertices[_0x7393('0x10')][_0x7393('0x86')]=function(_0x5b2b42){return _0x5b2b42&&_0x5b2b42!=='0'&&_0x5b2b42!=='-1'&&_0x5b2b42!=='';};AGIVertices[_0x7393('0x10')][_0x7393('0xa9')]=function(_0x26535a){this[_0x7393('0x33')][_0x7393('0x72')](this,_0x26535a,'-');_0x26535a[_0x7393('0xaa')]=_0x26535a[_0x7393('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7393('0x10')][_0x7393('0xab')]=function(_0xae034b){logger['info'](util[_0x7393('0x27')](_0x7393('0xac'),_0xae034b[_0x7393('0xad')]));if(!this['isConfigured'](_0xae034b[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}var _0x5358d1='\x22'+_0xae034b[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0xae034b[_0x7393('0x79')])){_0x5358d1+=','+_0xae034b[_0x7393('0x79')];}var _0x30ba26=this[_0x7393('0xe')]['exec'](_0x7393('0xb0'),_0x5358d1);if(_0x30ba26[_0x7393('0xa6')]===-0x1){return _0x30ba26;}return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xb1'),_0x5358d1));};AGIVertices['prototype']['mrcprecog']=function(_0x2318df){logger['info'](util['format'](_0x7393('0xb2'),_0x2318df[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x2318df[_0x7393('0xb3')])){return this['channel']['noop'](_0x7393('0xb4'));}var _0x955e5c=_0x2318df[_0x7393('0xb3')];if(this['isConfigured'](_0x2318df[_0x7393('0x79')])){_0x955e5c+=','+_0x2318df[_0x7393('0x79')];}var _0x1510c7=this[_0x7393('0xe')]['exec'](_0x7393('0xb5'),_0x955e5c);if(_0x1510c7[_0x7393('0xa6')]===-0x1){return _0x1510c7;}var _0x53096d=this['getAndSetVariable'](_0x7393('0xb6'),_0x7393('0xb7'));if(_0x53096d[_0x7393('0xa6')]===-0x1){return _0x53096d;}var _0x2f3e8d=this[_0x7393('0xb8')](_0x7393('0xb9'),'MRCP_RECOG_TRANSCRIPT');if(_0x2f3e8d[_0x7393('0xa6')]===-0x1){return _0x2f3e8d;}var _0x801e00=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xbb'));if(_0x801e00['result']===-0x1){return _0x801e00;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xbc'),_0x955e5c));};AGIVertices[_0x7393('0x10')]['agi']=function(_0x3401a2){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xbd'),_0x3401a2[_0x7393('0xad')]));return this['channel'][_0x7393('0x5')]([_0x3401a2[_0x7393('0xbe')],_0x3401a2[_0x7393('0xbf')]]);};AGIVertices['prototype'][_0x7393('0xc0')]=function(_0x381a94){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xc1'),_0x381a94[_0x7393('0xad')]));if(this[_0x7393('0x86')](_0x381a94['timeout'])){logger['info'](util[_0x7393('0x27')](_0x7393('0xc2'),_0x381a94[_0x7393('0x69')]));var _0x48f3d0=this['channel']['wait'](_0x381a94[_0x7393('0x69')]);if(_0x48f3d0[_0x7393('0xa6')]===-0x1){return _0x48f3d0;}}return this['channel']['answer']();};AGIVertices[_0x7393('0x10')][_0x7393('0x4a')]=function(_0x886a9){logger['info'](util[_0x7393('0x27')](_0x7393('0xc3'),_0x886a9[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x886a9[_0x7393('0x48')])){return this['channel'][_0x7393('0x2b')](_0x886a9,_0x7393('0xc4'));}_0x886a9[_0x7393('0x49')]=moment();if(this[_0x7393('0x86')](_0x886a9['delay'])){_0x886a9[_0x7393('0x49')]=moment()[_0x7393('0xc5')](_0x886a9[_0x7393('0xc6')],_0x7393('0xc7'));}if(!this[_0x7393('0x86')](_0x886a9[_0x7393('0x4d')])){_0x886a9['callback_priority']=0x2;}this[_0x7393('0x41')][_0x7393('0x72')](this,_0x886a9);return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x886a9[_0x7393('0x47')],_0x886a9['list_id'],_0x886a9[_0x7393('0x49')]));};AGIVertices[_0x7393('0x10')][_0x7393('0xc8')]=function(_0x2a47be){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a47be['label']));var _0x101c04=this['channel'][_0x7393('0x59')](_0x2a47be[_0x7393('0xc9')],_0x2a47be['options']);if(_0x101c04[_0x7393('0xa6')]===-0x1){return _0x101c04;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xca'),_0x2a47be['application'],_0x2a47be[_0x7393('0x79')]));};AGIVertices[_0x7393('0x10')][_0x7393('0xcb')]=function(_0x16d390){logger[_0x7393('0x2d')](util['format'](_0x7393('0xcc'),_0x16d390['label']));if(!this[_0x7393('0x86')](_0x16d390[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20text\x20configured');}var _0x1f82dc='\x22'+_0x16d390[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0x16d390['options'])){_0x1f82dc+=','+_0x16d390[_0x7393('0x79')];}var _0x42ccac=this['channel'][_0x7393('0x59')](_0x7393('0xb0'),_0x1f82dc);if(_0x42ccac[_0x7393('0xa6')]===-0x1){return _0x42ccac;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xb1'),_0x1f82dc));};AGIVertices['prototype'][_0x7393('0xcd')]=function(_0x527781){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xce'),_0x527781[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x527781[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20text\x20configured');}var _0x1458a0='\x22'+_0x527781[_0x7393('0x5e')]+'\x22';if(this[_0x7393('0x86')](_0x527781[_0x7393('0x79')])){_0x1458a0+=','+_0x527781[_0x7393('0x79')];}var _0x6855e=this[_0x7393('0xe')][_0x7393('0x59')]('MRCPSynth',_0x1458a0);if(_0x6855e[_0x7393('0xa6')]===-0x1){return _0x6855e;}return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xb1'),_0x1458a0));};AGIVertices['prototype'][_0x7393('0xcf')]=function(_0x3c6da7){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3c6da7[_0x7393('0xad')]));if(!this['isConfigured'](_0x3c6da7[_0x7393('0xb3')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20grammar\x20configured');}var _0x406060=_0x3c6da7['grammar'];if(this[_0x7393('0x86')](_0x3c6da7[_0x7393('0x79')])){_0x406060+=','+_0x3c6da7['options'];}var _0x3cc376=this['channel'][_0x7393('0x59')](_0x7393('0xb5'),_0x406060);if(_0x3cc376['result']===-0x1){return _0x3cc376;}var _0x21727e=this[_0x7393('0xb8')](_0x7393('0xb6'),_0x7393('0xd0'));if(_0x21727e['result']===-0x1){return _0x21727e;}var _0x13d167=this[_0x7393('0xb8')]('RECOG_INPUT()',_0x7393('0xd1'));if(_0x13d167['result']===-0x1){return _0x13d167;}var _0x36347b=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xd2'));if(_0x36347b['result']===-0x1){return _0x36347b;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x406060));};AGIVertices[_0x7393('0x10')]['sestekasr']=function(_0x2debcf){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xd3'),_0x2debcf[_0x7393('0xad')]));if(!this['isConfigured'](_0x2debcf['grammar'])){return this[_0x7393('0xe')]['noop'](_0x7393('0xb4'));}var _0x4c2716=_0x2debcf['grammar'];if(this[_0x7393('0x86')](_0x2debcf[_0x7393('0x79')])){_0x4c2716+=','+_0x2debcf[_0x7393('0x79')];}var _0x2dffbb=this[_0x7393('0xe')][_0x7393('0x59')]('MRCPRecog',_0x4c2716);if(_0x2dffbb[_0x7393('0xa6')]===-0x1){return _0x2dffbb;}var _0xe22872=this[_0x7393('0xb8')](_0x7393('0xb6'),_0x7393('0xd4'));if(_0xe22872[_0x7393('0xa6')]===-0x1){return _0xe22872;}var _0x126b16=this['getAndSetVariable']('RECOG_INPUT()',_0x7393('0xd5'));if(_0x126b16[_0x7393('0xa6')]===-0x1){return _0x126b16;}var _0x410ab4=this[_0x7393('0xb8')](_0x7393('0xba'),_0x7393('0xd6'));if(_0x410ab4[_0x7393('0xa6')]===-0x1){return _0x410ab4;}return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xbc'),_0x4c2716));};AGIVertices[_0x7393('0x10')][_0x7393('0xd7')]=function(_0x3c4355){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xd8'),_0x3c4355[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x3c4355[_0x7393('0xd9')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3c4355,_0x7393('0xda'));}var _0x7fd7b6=this[_0x7393('0x17')]['sync'](this,_0x3c4355[_0x7393('0xd9')]);if(!_0x7fd7b6){return this['channel'][_0x7393('0x2b')](_0x3c4355,_0x7393('0xdb'));}if(!this['isConfigured'](_0x3c4355[_0x7393('0xdc')])){return this[_0x7393('0xe')]['error'](_0x3c4355,_0x7393('0xdd'));}var _0x56987e=_0x3c4355[_0x7393('0xdc')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xde'),_0x56987e));var _0x2ab7d8=this[_0x7393('0x29')][_0x7393('0x72')](this,_0x7fd7b6,_0x56987e);this['createSquareDetailsReport'][_0x7393('0x72')](this,_0x3c4355,_0x56987e);if(!this[_0x7393('0x86')](_0x3c4355['variable_id'])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3e6959=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3c4355[_0x7393('0xdf')]);if(!_0x3e6959){return this['channel']['error'](_0x3c4355,'no\x20variable\x20found');}var _0x381ff2=this;_0x2ab7d8['forEach'](function(_0x255995,_0x471a64){Object['keys'](_0x255995)[_0x7393('0xe0')](function(_0x159db3){_0x381ff2[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0xe1'),_0x3e6959,_0x471a64,_0x159db3),_0x255995[_0x159db3]);});});this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0xe2'),_0x3e6959),_0x2ab7d8[_0x7393('0x9e')]);return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('variable\x20%s\x20set',_0x3e6959));};AGIVertices[_0x7393('0x10')]['dial']=function(_0x566679){logger[_0x7393('0xe3')](util[_0x7393('0x27')](_0x7393('0xe4'),_0x566679[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x566679[_0x7393('0xe5')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x566679,_0x7393('0xe6'));}var _0xc169c7=this[_0x7393('0x19')][_0x7393('0x72')](this,_0x566679[_0x7393('0xe5')]);if(!_0xc169c7){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x566679,_0x7393('0xe7'));}var _0x3456d6=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0xe8'),[util[_0x7393('0x27')]('SIP/%s',_0xc169c7),_0x566679['timeout'],_0x566679[_0x7393('0xe9')],_0x566679[_0x7393('0x75')]]);if(_0x3456d6[_0x7393('0xa6')]===-0x1){return _0x3456d6;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xea'),'DIAL'));};AGIVertices['prototype'][_0x7393('0xeb')]=function(_0x1a9c51){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1a9c51['label']));if(!this[_0x7393('0x86')](_0x1a9c51['key'])){return this[_0x7393('0xe')]['noop']('no\x20key\x20configured');}if(!this[_0x7393('0x86')](_0x1a9c51['text'])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x1a9c51);this[_0x7393('0x40')](_0x1a9c51[_0x7393('0x5e')],'in','','');this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xed'),_0x1a9c51[_0x7393('0x5e')]));var _0x17017a=this[_0x7393('0x7a')][_0x7393('0x72')](this,_0x1a9c51);if(_0x17017a){for(var _0x175c4c in _0x17017a){if(_0x17017a[_0x7393('0x97')](_0x175c4c)){this['channel'][_0x7393('0xa8')](util[_0x7393('0x27')]('DIALOGFLOW_%s',_0x175c4c[_0x7393('0xee')]()),_0x17017a[_0x175c4c]);}}this[_0x7393('0x40')](_0x17017a[_0x7393('0xef')],_0x7393('0xf0'),_0x7393('0xeb'),'');return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xf1'),_0x17017a[_0x7393('0xef')]));}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a9c51,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x7393('0x10')][_0x7393('0xf2')]=function(_0x5045b1){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xf3'),_0x5045b1[_0x7393('0xad')]));if(!this['isConfigured'](_0x5045b1[_0x7393('0x7e')])){return this['channel'][_0x7393('0xae')](_0x7393('0xf4'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0xf5')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf6'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0xf7')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf8'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0x7f')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xf9'));}if(!this[_0x7393('0x86')](_0x5045b1[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x5045b1);this[_0x7393('0x40')](_0x5045b1[_0x7393('0x5e')],'in','','');this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xfa'),_0x5045b1[_0x7393('0x5e')]));var _0x20215a=this[_0x7393('0x7d')][_0x7393('0x72')](this,_0x5045b1);if(_0x20215a){for(var _0x3d910f in _0x20215a){if(_0x20215a['hasOwnProperty'](_0x3d910f)){if(_0x3d910f!==_0x7393('0xfb')){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('DIALOGFLOW_%s',_0x3d910f['toUpperCase']()),_0x20215a[_0x3d910f]);}}}this[_0x7393('0x40')](_0x20215a[_0x7393('0xef')],'out',_0x7393('0xf2'),_0x20215a['providerResponse']);return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xfc'),_0x20215a[_0x7393('0xef')]));}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x5045b1,_0x7393('0xfd'));};AGIVertices[_0x7393('0x10')][_0x7393('0xfe')]=function(_0x185a29){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0xff'),_0x185a29['label']));if(!this[_0x7393('0x86')](_0x185a29[_0x7393('0x100')])){return this['channel'][_0x7393('0xae')](_0x7393('0x101'));}if(!this[_0x7393('0x86')](_0x185a29[_0x7393('0x102')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x103'));}if(!this[_0x7393('0x86')](_0x185a29['password'])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x104'));}if(!this['isConfigured'](_0x185a29[_0x7393('0x105')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xec')]=!![];this[_0x7393('0x33')](_0x185a29);this[_0x7393('0x40')](_0x185a29[_0x7393('0x5e')],'in','','');this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x106'),_0x185a29[_0x7393('0x5e')]));var _0x2b0911=this[_0x7393('0x80')][_0x7393('0x72')](this,_0x185a29);if(_0x2b0911){for(var _0x5c286f in _0x2b0911){if(_0x2b0911[_0x7393('0x97')](_0x5c286f)){this['channel'][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0x107'),_0x5c286f[_0x7393('0xee')]()),_0x2b0911[_0x5c286f]);}}this['createSquareMessage'](_0x2b0911[_0x7393('0xef')],_0x7393('0xf0'),_0x7393('0xfe'),'');if(_0x2b0911[_0x7393('0x108')]){this['channel'][_0x7393('0xae')](util['format'](_0x7393('0x109'),_0x2b0911[_0x7393('0x108')]));var _0x1996b4=this['channel'][_0x7393('0x10a')](_0x2b0911[_0x7393('0x108')]);try{fs['unlink'](_0x2b0911[_0x7393('0x108')]+'.wav');}catch(_0x4d6da1){logger[_0x7393('0x2b')](_0x4d6da1);}return _0x1996b4;}else{return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x10b'),_0x2b0911[_0x7393('0xef')]));}}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x185a29,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x7393('0x10c')]=function(_0x2e90ad){logger['info'](util[_0x7393('0x27')](_0x7393('0x10d'),_0x2e90ad[_0x7393('0xad')]));return this['channel'][_0x7393('0xae')](_0x7393('0x10c'));};AGIVertices['prototype'][_0x7393('0x10e')]=function(_0x52f451){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x52f451[_0x7393('0xad')]));var _0x3f43c0='';if(_0x52f451[_0x7393('0x10f')]){if(!this[_0x7393('0x86')](_0x52f451['trunk_id'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x110'));}else{var _0x560646=parseInt(_0x52f451[_0x7393('0x10f')],0xa);if(isNaN(_0x560646)){_0x3f43c0=_0x52f451[_0x7393('0x10f')];}else{_0x3f43c0=this['getTrunk']['sync'](this,_0x52f451[_0x7393('0x10f')]);if(!_0x3f43c0){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x111'));}}}}else if(_0x52f451[_0x7393('0x112')]){_0x3f43c0=_0x52f451[_0x7393('0x112')];}else{return this[_0x7393('0xe')][_0x7393('0x2b')](_0x52f451,_0x7393('0x110'));}var _0x36b487=this[_0x7393('0xe')]['exec'](_0x7393('0xe8'),[util[_0x7393('0x27')](_0x7393('0x113'),_0x3f43c0,_0x52f451[_0x7393('0x47')]),_0x52f451['timeout'],_0x52f451[_0x7393('0xe9')],_0x52f451[_0x7393('0x75')]]);if(_0x36b487[_0x7393('0xa6')]===-0x1){return _0x36b487;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0xea'),_0x7393('0xe8')));};AGIVertices[_0x7393('0x10')][_0x7393('0x114')]=function(_0x49baff){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x115'),_0x49baff[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x114'));};AGIVertices['prototype'][_0x7393('0xc')]=function(_0x3ff801){logger['info'](util[_0x7393('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3ff801[_0x7393('0xad')]));if(_0x3ff801[_0x7393('0xaa')]===0x0){return this['maxRetry'](_0x3ff801);}_0x3ff801['retry']-=0x1;if(!this['isConfigured'](_0x3ff801[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x117'));}var _0x56e6c9=this['getSound']['sync'](this,_0x3ff801['file_id']);if(!_0x56e6c9){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x118'));}if(!this['isConfigured'](_0x3ff801['variable_id'])){return this[_0x7393('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x478a9d=this[_0x7393('0xe')][_0x7393('0x119')](_0x56e6c9,_0x3ff801[_0x7393('0x11a')],_0x3ff801[_0x7393('0x11b')]);var _0x19c9fa=_0x478a9d[_0x7393('0xa6')]?_0x478a9d[_0x7393('0xa6')]['toString']():'';logger['info']('test',JSON[_0x7393('0xa1')](_0x478a9d));if(_0x478a9d[_0x7393('0xa6')]===-0x1){this[_0x7393('0x33')]['sync'](this,_0x3ff801,_0x19c9fa);return _0x478a9d;}else if(_0x478a9d[_0x7393('0xa5')]===_0x7393('0x69')){_0x478a9d['result']=_0x19c9fa['length']>=parseInt(_0x3ff801['mindigit'])?'x':'i';}else{_0x478a9d[_0x7393('0xa6')]=_0x19c9fa[_0x7393('0x9e')]>=parseInt(_0x3ff801[_0x7393('0x11c')])&&_0x19c9fa['length']<=parseInt(_0x3ff801['maxdigit'])?'x':'i';}var _0x44bd6d=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3ff801[_0x7393('0xdf')]);if(!_0x44bd6d){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x3ff801,_0x7393('0x11d'));}this['channel'][_0x7393('0xa8')](_0x44bd6d,_0x19c9fa);if(this[_0x7393('0x86')](_0x3ff801[_0x7393('0x11e')])){var _0x2875a1=parseInt(_0x3ff801[_0x7393('0x11e')],0xa);var _0x3a192b=rs['generate']({'charset':'*','length':_0x2875a1});var _0x555c75=_0x19c9fa[_0x7393('0x9e')];if(_0x555c75>0x0){if(_0x555c75>_0x2875a1){this[_0x7393('0x33')]['sync'](this,_0x3ff801,_0x3ff801[_0x7393('0x11f')]===_0x7393('0x120')?_0x3a192b+_0x19c9fa['substr'](_0x2875a1):_0x19c9fa[_0x7393('0x121')](0x0,_0x555c75-_0x2875a1)+_0x3a192b);}else{this[_0x7393('0x33')][_0x7393('0x72')](this,_0x3ff801,rs[_0x7393('0x122')]({'charset':'*','length':_0x555c75}));}}else{this['createSquareDetailsReport']['sync'](this,_0x3ff801,'');}}else{this[_0x7393('0x33')][_0x7393('0x72')](this,_0x3ff801,_0x19c9fa);}return _0x478a9d;};AGIVertices[_0x7393('0x10')][_0x7393('0xd')]=function(_0x363c53){logger[_0x7393('0x2d')](util['format'](_0x7393('0x123'),_0x363c53[_0x7393('0xad')]));return this[_0x7393('0xc')](_0x363c53);};AGIVertices[_0x7393('0x10')][_0x7393('0x124')]=function(_0x8330b3){logger['info'](util['format'](_0x7393('0x125'),_0x8330b3[_0x7393('0xad')]));this[_0x7393('0x33')][_0x7393('0x72')](this,_0x8330b3,_0x8330b3[_0x7393('0x126')]);return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x127'),_0x8330b3[_0x7393('0x126')]));};AGIVertices[_0x7393('0x10')]['awspolly']=function(_0x2e0cf0){logger[_0x7393('0x2d')](util['format'](_0x7393('0x128'),_0x2e0cf0[_0x7393('0xad')]));if(!this['isConfigured'](_0x2e0cf0[_0x7393('0x89')])||!this[_0x7393('0x86')](_0x2e0cf0[_0x7393('0x8a')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x129'));}if(!this['isConfigured'](_0x2e0cf0[_0x7393('0x5e')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0xaf'));}this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x12a'),_0x2e0cf0['text']));var _0x1b6281=this[_0x7393('0x88')][_0x7393('0x72')](this,_0x2e0cf0);if(_0x1b6281){this[_0x7393('0xe')]['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x1b6281));var _0x5f04f3=this[_0x7393('0xe')][_0x7393('0x10a')](_0x1b6281);try{fs[_0x7393('0x12b')](_0x1b6281+'.wav');}catch(_0x4e597a){logger[_0x7393('0x2b')](_0x4e597a);}return _0x5f04f3;}return this[_0x7393('0xe')]['error'](_0x2e0cf0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x7393('0x10')][_0x7393('0x12c')]=function(_0x529bf2){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x12d'),_0x529bf2['label']));if(!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x89')])||!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x8a')])){return this['channel'][_0x7393('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x7393('0x86')](_0x529bf2['aws_bot_name'])){return this['channel'][_0x7393('0xae')]('no\x20bot\x20name\x20configured');}if(!this[_0x7393('0x86')](_0x529bf2[_0x7393('0x5e')])){return this['channel'][_0x7393('0xae')](_0x7393('0xaf'));}this['channel'][_0x7393('0xec')]=!![];this['createSquareDetailsReport'](_0x529bf2);this[_0x7393('0x40')](_0x529bf2[_0x7393('0x5e')],'in','','');this[_0x7393('0xe')][_0x7393('0xae')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x529bf2[_0x7393('0x5e')]));var _0x3bcdc3=this[_0x7393('0x8e')][_0x7393('0x72')](this,_0x529bf2);if(_0x3bcdc3){for(var _0x666ef8 in _0x3bcdc3){if(_0x3bcdc3[_0x7393('0x97')](_0x666ef8)&&_[_0x7393('0x98')](_0x3bcdc3[_0x666ef8])){this['channel'][_0x7393('0xa8')](util['format'](_0x7393('0x12e'),_0x666ef8['toUpperCase']()),_0x3bcdc3[_0x666ef8]);}}if(_[_0x7393('0x43')](_0x3bcdc3[_0x7393('0x12f')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x130'));}else{this[_0x7393('0x40')](_0x3bcdc3[_0x7393('0x12f')],_0x7393('0xf0'),_0x7393('0x131'),'');return this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x132'),_0x3bcdc3[_0x7393('0x12f')]));}}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x529bf2,_0x7393('0x133'));};AGIVertices[_0x7393('0x10')][_0x7393('0x134')]=function(_0x13d49c){logger[_0x7393('0x2d')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x13d49c[_0x7393('0xad')],_0x13d49c[_0x7393('0x69')]));if(!this[_0x7393('0x86')](_0x13d49c[_0x7393('0x7b')])){return this['channel'][_0x7393('0xae')]('no\x20key\x20configured');}var _0x355908=_0x7393('0x135');var _0x1ffdee=util[_0x7393('0x27')](_0x7393('0x136'),FILES_PATH,rs['generate'](0x4));var _0x34947a=util['format'](_0x7393('0x9f'),_0x1ffdee,_0x355908);var _0x3a3c91=!![];if(_0x13d49c[_0x7393('0x137')]===_0x7393('0x138')){_0x3a3c91=![];}var _0xb484fe=this[_0x7393('0xe')][_0x7393('0x139')](_0x1ffdee,_0x355908,_0x13d49c['intKey'],_0x13d49c['timeout'],undefined,_0x3a3c91);if(_0xb484fe[_0x7393('0xa6')]!==-0x1){this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x13a'),_0x34947a));var _0xd7dc74=this[_0x7393('0x91')][_0x7393('0x72')](this,_0x13d49c,_0x34947a);if(_0xd7dc74){for(var _0x235a8b in _0xd7dc74){if(_0xd7dc74['hasOwnProperty'](_0x235a8b)){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')](_0x7393('0x13b'),_0x235a8b[_0x7393('0xee')]()),_0xd7dc74[_0x235a8b]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x13c'),JSON[_0x7393('0xa1')](_0xd7dc74)));}}return _0xb484fe;};AGIVertices['prototype'][_0x7393('0x13d')]=function(_0x22a5bd){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x13e'),_0x22a5bd['label']));if(!this[_0x7393('0x86')](_0x22a5bd[_0x7393('0x94')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x13f'));}if(!this['isConfigured'](_0x22a5bd[_0x7393('0x140')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x141'));}var _0x2c3873='wav';var _0x37f660=util['format'](_0x7393('0x136'),FILES_PATH,rs[_0x7393('0x122')](0x4));var _0x48a17c=util[_0x7393('0x27')](_0x7393('0x9f'),_0x37f660,_0x2c3873);var _0x6b6d7e=!![];if(_0x22a5bd['beep']===_0x7393('0x138')){_0x6b6d7e=![];}var _0x6d4a95=this[_0x7393('0xe')][_0x7393('0x139')](_0x37f660,_0x2c3873,_0x22a5bd[_0x7393('0x142')],_0x22a5bd['timeout'],undefined,_0x6b6d7e);if(_0x6d4a95['result']!==-0x1){this['channel'][_0x7393('0xae')](util[_0x7393('0x27')]('tilde\x20%s\x20file\x20created',_0x48a17c));var _0x401943=this[_0x7393('0x93')][_0x7393('0x72')](this,_0x22a5bd,_0x48a17c);if(_0x401943){for(var _0x311ba5 in _0x401943){if(_0x401943[_0x7393('0x97')](_0x311ba5)){this[_0x7393('0xe')]['setVariable'](util[_0x7393('0x27')](_0x7393('0x143'),_0x311ba5[_0x7393('0xee')]()),_0x401943[_0x311ba5]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x7393('0xa1')](_0x401943)));}}return _0x6d4a95;};AGIVertices['prototype'][_0x7393('0x144')]=function(_0x3d253d){logger['info'](util[_0x7393('0x27')](_0x7393('0x145'),_0x3d253d[_0x7393('0xad')]));return this[_0x7393('0xe')]['continueAt'](_0x3d253d[_0x7393('0x3a')],_0x3d253d[_0x7393('0x3b')],_0x3d253d[_0x7393('0x3c')]);};AGIVertices['prototype']['gotoif']=function(_0x265da7){logger['info'](util[_0x7393('0x27')](_0x7393('0x146'),_0x265da7['label']));if(!this['isConfigured'](_0x265da7[_0x7393('0x147')])){return this['channel'][_0x7393('0x2b')](_0x265da7,'no\x20condition\x20configured');}try{var _0x22ef8c=eval(_0x265da7[_0x7393('0x147')])?'true':_0x7393('0x148');this[_0x7393('0xe')][_0x7393('0xae')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x265da7[_0x7393('0x147')],_0x22ef8c));return{'code':0xc8,'result':_0x22ef8c};}catch(_0x97e1c8){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7393('0x10')][_0x7393('0x149')]=function(_0x2e5cb6){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14a'),_0x2e5cb6[_0x7393('0xad')]));if(!this['isConfigured'](_0x2e5cb6[_0x7393('0x14b')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2e5cb6,_0x7393('0x14c'));}var _0x148dde=this['getIntervals'][_0x7393('0x72')](this,_0x2e5cb6[_0x7393('0x14b')]);if(!_0x148dde){return this['channel']['error'](_0x2e5cb6,_0x7393('0x14d'));}for(var _0x292cbd=0x0;_0x292cbd<_0x148dde[_0x7393('0x9e')];_0x292cbd+=0x1){var _0x10958c=this['channel']['getVariable'](util[_0x7393('0x27')]('IFTIME(%s?true:false)',_0x148dde[_0x292cbd]));if(_0x10958c[_0x7393('0xa6')]===-0x1){return _0x10958c;}logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x10958c[_0x7393('0xa5')]));if(_0x10958c['extra']===_0x7393('0x14f')){logger['info'](util['format'](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x14f')));this[_0x7393('0xe')][_0x7393('0xae')](util['format']('IFTIME\x20%s\x20%s',_0x148dde[_0x292cbd],_0x7393('0x14f')));return{'code':0xc8,'result':_0x7393('0x14f')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x148')));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x14e'),_0x148dde[_0x292cbd],_0x7393('0x148')));}}return{'code':0xc8,'result':_0x7393('0x148')};};AGIVertices[_0x7393('0x10')][_0x7393('0x150')]=function(_0x3c26a7){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3c26a7[_0x7393('0xad')]));return this[_0x7393('0xe')]['hangup']();};AGIVertices[_0x7393('0x10')][_0x7393('0x151')]=function(_0x32844a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x152'),_0x32844a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x32844a['key'])){return this['channel'][_0x7393('0xae')](_0x7393('0x153'));}var _0x57e824='wav';var _0x2f13dd=util[_0x7393('0x27')](_0x7393('0x136'),FILES_PATH,rs['generate'](0x4));var _0xf842ec=util[_0x7393('0x27')](_0x7393('0x9f'),_0x2f13dd,_0x57e824);var _0x192680=!![];if(_0x32844a[_0x7393('0x137')]===_0x7393('0x138')){_0x192680=![];}var _0x1c3bf5=this[_0x7393('0xe')]['recordFile'](_0x2f13dd,_0x57e824,_0x32844a[_0x7393('0x142')],_0x32844a['timeout'],undefined,_0x192680);if(_0x1c3bf5[_0x7393('0xa6')]!==-0x1){this[_0x7393('0xe')]['noop'](util['format'](_0x7393('0x154'),_0xf842ec));var _0x21f09a=this['ispeechASR'][_0x7393('0x72')](this,_0x32844a,_0xf842ec);if(_0x21f09a){for(var _0x18b6e1 in _0x21f09a){if(_0x21f09a[_0x7393('0x97')](_0x18b6e1)){this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('ISPEECH_ASR_%s',_0x18b6e1[_0x7393('0xee')]()),_0x21f09a[_0x18b6e1]);}}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x155'),JSON[_0x7393('0xa1')](_0x21f09a)));}}return _0x1c3bf5;};AGIVertices[_0x7393('0x10')][_0x7393('0x156')]=function(_0x15667b){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x157'),_0x15667b[_0x7393('0xad')]));if(!this['isConfigured'](_0x15667b[_0x7393('0x7b')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x153'));}if(!this['isConfigured'](_0x15667b[_0x7393('0x5e')])){return this[_0x7393('0xe')]['noop'](_0x7393('0xaf'));}this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x158'),_0x15667b[_0x7393('0x5e')]));var _0x4d36b8=this[_0x7393('0x81')]['sync'](this,_0x15667b);if(_0x4d36b8){this['channel']['noop'](util['format'](_0x7393('0x154'),_0x4d36b8));var _0x38b30c=this[_0x7393('0xe')][_0x7393('0x10a')](_0x4d36b8,_0x15667b[_0x7393('0x142')]);try{fs[_0x7393('0x12b')](_0x4d36b8+'.wav');}catch(_0x31c849){logger[_0x7393('0x2b')](_0x31c849);}return _0x38b30c;}return this['channel'][_0x7393('0x2b')](_0x15667b,_0x7393('0x159'));};AGIVertices[_0x7393('0x10')][_0x7393('0x15a')]=function(_0x59859a){logger['info'](util[_0x7393('0x27')](_0x7393('0x15b'),_0x59859a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x59859a[_0x7393('0x15c')])){return this['channel']['error'](_0x59859a,_0x7393('0x15d'));}logger['info'](util['format'](_0x7393('0x15e'),this['channel'][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));var _0xc68a66=this[_0x7393('0x57')]['sync'](this,_0x59859a[_0x7393('0x15c')]);if(_0xc68a66){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this['channel'][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x59859a[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7393('0xe')]['callerid'],_0x59859a[_0x7393('0x15c')]));this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x59859a[_0x7393('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x530d8a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x161'),_0x530d8a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x530d8a[_0x7393('0x15c')])){return this[_0x7393('0xe')]['error'](_0x530d8a,_0x7393('0x15d'));}logger['info'](util[_0x7393('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));var _0x45bf9d=this[_0x7393('0x53')][_0x7393('0x72')](this,_0x530d8a[_0x7393('0x15c')]);if(_0x45bf9d){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x530d8a['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a['findBy']));this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x530d8a[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x163')};}};AGIVertices[_0x7393('0x10')]['math']=function(_0x33bfdd){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x164'),_0x33bfdd[_0x7393('0xad')]));if(!this['isConfigured'](_0x33bfdd['operation'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x33bfdd,'no\x20operation\x20configured');}this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x165'),_0x33bfdd['operation']));var _0x5e54e6=eval(_0x33bfdd[_0x7393('0x166')]);if(!this[_0x7393('0x86')](_0x33bfdd[_0x7393('0xdf')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x220660=this[_0x7393('0xa4')]['sync'](this,_0x33bfdd['variable_id']);if(!_0x220660){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x33bfdd,_0x7393('0x11d'));}if(_['isArray'](_0x5e54e6)){var _0x1ced1c=this;_0x5e54e6[_0x7393('0xe0')](function(_0x4a89d1,_0x548653){_0x1ced1c['channel'][_0x7393('0xa8')](util[_0x7393('0x27')]('%s[%s]',_0x220660,_0x548653),_0x4a89d1);});return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x167'),_0x220660));}else{return this[_0x7393('0xe')][_0x7393('0xa8')](_0x220660,_0x5e54e6);}};AGIVertices[_0x7393('0x10')][_0x7393('0xb')]=function(_0x1a012a){logger['info'](util[_0x7393('0x27')](_0x7393('0x168'),_0x1a012a[_0x7393('0xad')]));if(_0x1a012a[_0x7393('0xaa')]===0x0){return this[_0x7393('0xa9')](_0x1a012a);}_0x1a012a[_0x7393('0xaa')]-=0x1;if(!this[_0x7393('0x86')](_0x1a012a[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20file\x20audio\x20selected');}var _0x1d13b6=this[_0x7393('0x1d')]['sync'](this,_0x1a012a['file_id']);if(!_0x1d13b6){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20file\x20audio\x20found');}var _0x38a23f=this[_0x7393('0xe')][_0x7393('0x119')](_0x1d13b6,_0x1a012a[_0x7393('0x11a')],_0x1a012a[_0x7393('0x169')]);var _0x503915=_0x38a23f['result'];if(_0x38a23f[_0x7393('0xa6')]===-0x1){this[_0x7393('0x33')][_0x7393('0x72')](this,_0x1a012a,'-1');return _0x38a23f;}else if(_0x38a23f[_0x7393('0xa5')]===_0x7393('0x69')){_0x38a23f['result']=_0x38a23f['result'][_0x7393('0x9e')]>0x0?_0x38a23f[_0x7393('0xa6')]:'t';}else if(_[_0x7393('0x42')](_0x38a23f[_0x7393('0xa6')])){_0x38a23f[_0x7393('0xa6')]='#';_0x503915='#';}if(!this[_0x7393('0x86')](_0x1a012a['variable_id'])){this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x16a'));}else{var _0x2e6889=this[_0x7393('0xa4')]['sync'](this,_0x1a012a[_0x7393('0xdf')]);if(!_0x2e6889){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x1a012a,'no\x20variable\x20found');}this[_0x7393('0xe')]['setVariable'](_0x2e6889,_0x503915);}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x1a012a,_0x503915);return _0x38a23f;};AGIVertices['prototype'][_0x7393('0xae')]=function(_0x155bbd){logger['info'](util[_0x7393('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x155bbd['label']));return this['channel']['noop'](_0x155bbd[_0x7393('0x16b')]||_0x155bbd[_0x7393('0xad')]);};AGIVertices[_0x7393('0x10')]['pause']=function(_0x140c3f){logger[_0x7393('0x2d')](util['format'](_0x7393('0x16c'),_0x140c3f[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x140c3f['findBy'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x140c3f,_0x7393('0x15d'));}logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15e'),this[_0x7393('0xe')]['callerid'],_0x140c3f[_0x7393('0x15c')]));var _0x44e66f=this[_0x7393('0x4e')][_0x7393('0x72')](this,_0x140c3f[_0x7393('0x16d')]);var _0x1c3b7d=this['agentPause']['sync'](this,_0x140c3f[_0x7393('0x15c')],_0x44e66f);if(_0x1c3b7d){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7393('0xe')][_0x7393('0x36')],_0x140c3f[_0x7393('0x15c')]));this[_0x7393('0xe')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x140c3f[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7393('0xe')]['callerid'],_0x140c3f['findBy']));this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')]['callerid'],_0x140c3f[_0x7393('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x7393('0x16e')]=function(_0x47af62){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x16f'),_0x47af62['label']));if(!this[_0x7393('0x86')](_0x47af62[_0x7393('0x116')])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x47af62,_0x7393('0x117'));}var _0x1b90b3=this[_0x7393('0x1d')][_0x7393('0x72')](this,_0x47af62['file_id']);if(!_0x1b90b3){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x47af62,_0x7393('0x118'));}var _0x62045e=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0x170'),[_0x1b90b3,_0x47af62['opts']]);if(_0x62045e['result']===-0x1){return _0x62045e;}return this['channel']['noop'](util[_0x7393('0x27')](_0x7393('0xca'),'PLAYBACK',_0x1b90b3));};AGIVertices[_0x7393('0x10')][_0x7393('0x171')]=function(_0x28d65a){logger[_0x7393('0x2d')](util['format'](_0x7393('0x172'),_0x28d65a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x28d65a[_0x7393('0x173')])){return this[_0x7393('0xe')]['error'](_0x28d65a,_0x7393('0x174'));}var _0x397bd1='';var _0x3ec50f=parseInt(_0x28d65a[_0x7393('0x173')],0xa);if(isNaN(_0x3ec50f)){_0x397bd1=_0x28d65a[_0x7393('0x173')];}else{_0x397bd1=this['getVoiceQueue'][_0x7393('0x72')](this,_0x28d65a['queue_id']);if(!_0x397bd1){return this[_0x7393('0xe')]['error'](_0x28d65a,_0x7393('0x175'));}}var _0x10382a='';if(this[_0x7393('0x86')](_0x28d65a[_0x7393('0x116')])){var _0x5dec0e=this[_0x7393('0x1d')]['sync'](this,_0x28d65a[_0x7393('0x116')]);if(_0x5dec0e){_0x10382a=_0x5dec0e;}}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x28d65a,_0x397bd1);if(_0x28d65a[_0x7393('0xe9')]['indexOf']('x')<0x0){_0x28d65a[_0x7393('0xe9')]+='x';}if(_0x28d65a[_0x7393('0xe9')]['indexOf']('X')<0x0){_0x28d65a[_0x7393('0xe9')]+='X';}this[_0x7393('0xe')]['setVariable'](_0x7393('0x176'),_0x397bd1?_0x397bd1[_0x7393('0x177')]():'');var _0x12cef7=this[_0x7393('0xe')][_0x7393('0x59')]('QUEUE',[_0x397bd1,_0x28d65a[_0x7393('0xe9')],_0x28d65a[_0x7393('0x75')],_0x10382a,_0x28d65a['timeout'],_0x28d65a['agi'],_0x28d65a['macro'],_0x28d65a[_0x7393('0x178')],'',_0x28d65a[_0x7393('0x179')]]);if(_0x12cef7[_0x7393('0xa6')]===-0x1){return _0x12cef7;}return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0xca'),'QUEUE',_0x397bd1));};AGIVertices[_0x7393('0x10')]['record']=function(_0xa39ce9){logger['info'](util[_0x7393('0x27')](_0x7393('0x17a'),_0xa39ce9['label']));var _0x28bb8f=_0xa39ce9[_0x7393('0x17b')]||_0x7393('0x135');var _0x587a80=util['format'](_0x7393('0x17c'),this[_0x7393('0xe')]['uniqueid'],rs[_0x7393('0x122')](0x5));var _0x285a25=util[_0x7393('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x587a80,_0x28bb8f);var _0x191423=util['format']('%s/recordings/%s',FILES_PATH,_0x587a80);this[_0x7393('0x37')]['sync'](this,_0xa39ce9,_0x587a80,_0x285a25);this['channel']['setVariable']('RECORDING_SAVENAME',_0x587a80);logger[_0x7393('0x2d')](_0x7393('0x17d'),_0x191423,_0x28bb8f,_0xa39ce9[_0x7393('0x17e')],_0xa39ce9[_0x7393('0x69')]);return this['channel'][_0x7393('0x139')](_0x191423,_0x28bb8f,_0xa39ce9[_0x7393('0x17e')],_0xa39ce9[_0x7393('0x69')],undefined,!![]);};AGIVertices[_0x7393('0x10')][_0x7393('0x17f')]=function(_0x2df09e){logger['info'](util[_0x7393('0x27')](_0x7393('0x180'),_0x2df09e[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x2df09e[_0x7393('0x75')])){return this[_0x7393('0xe')]['noop'](_0x7393('0x181'));}var _0x1ab8d8=this['restAPI'][_0x7393('0x72')](this,_0x2df09e);logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x182'),util[_0x7393('0x183')](_0x1ab8d8,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x2df09e[_0x7393('0xdf')])){return this['channel'][_0x7393('0xae')](_0x7393('0x184'));}var _0x2d0c8a=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x2df09e['variable_id']);if(!_0x2d0c8a){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2df09e,_0x7393('0x11d'));}this[_0x7393('0xe')][_0x7393('0xa8')](util['format'](_0x7393('0x185'),_0x2d0c8a),_0x1ab8d8[_0x7393('0x186')]?_0x1ab8d8[_0x7393('0x186')]:_0x7393('0x187'));this[_0x7393('0xe')][_0x7393('0xa8')](util[_0x7393('0x27')]('%s_STATUS_MESSAGE',_0x2d0c8a),_0x1ab8d8['statusMessage']?_0x1ab8d8['statusMessage']:'OK');if(_0x1ab8d8[_0x7393('0x6d')]){try{this[_0x7393('0x9d')](_0x1ab8d8['body'],_0x2d0c8a);}catch(_0x3aa8ca){logger[_0x7393('0x2b')](util[_0x7393('0x27')](_0x7393('0x188'),_0x2d0c8a));}}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x189'),_0x2d0c8a));};AGIVertices[_0x7393('0x10')][_0x7393('0x18a')]=function(_0xe9237f){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x18b'),_0xe9237f[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x18c')](_0xe9237f[_0x7393('0x18d')][_0x7393('0x5b')](/\s+/g,''),_0xe9237f[_0x7393('0x17e')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x18e')]=function(_0x55004e){logger['info'](util[_0x7393('0x27')](_0x7393('0x18f'),_0x55004e[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x190')](_0x55004e[_0x7393('0x191')][_0x7393('0x5b')](/\s+/g,''),_0x55004e[_0x7393('0x17e')]);};AGIVertices['prototype']['sayphonetic']=function(_0x510523){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x510523[_0x7393('0xad')]));return this[_0x7393('0xe')][_0x7393('0x192')](_0x510523[_0x7393('0x5e')],_0x510523[_0x7393('0x17e')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x193')]=function(_0x5af3c2){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5af3c2['label']));if(!this[_0x7393('0x86')](_0x5af3c2[_0x7393('0x194')])){return this[_0x7393('0xe')][_0x7393('0xae')]('no\x20mail\x20account\x20configured');}var _0x65dc50=this[_0x7393('0x195')]['sync'](this,_0x5af3c2[_0x7393('0x194')]);if(!_0x65dc50||!_0x65dc50[_0x7393('0x196')]){return this[_0x7393('0xe')]['error'](_0x5af3c2,_0x7393('0x197'));}var _0x56bb49={'from':util[_0x7393('0x27')](_0x7393('0x198'),_0x65dc50['name'],_0x65dc50[_0x7393('0x199')]||_0x65dc50[_0x7393('0x196')]['user']),'to':_0x5af3c2['to']||'','cc':_0x5af3c2['cc']||'','bcc':_0x5af3c2[_0x7393('0x19a')]||'','subject':_0x5af3c2[_0x7393('0x19b')],'html':_0x5af3c2[_0x7393('0x5e')],'text':_0x5af3c2['text']};if(this[_0x7393('0x86')](_0x5af3c2['template_id'])){}logger[_0x7393('0xe3')]('sendMail\x20message',JSON['stringify'](_0x56bb49));this[_0x7393('0x33')]['sync'](this,_0x5af3c2,_0x5af3c2[_0x7393('0x194')]);this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x19c'),_0x65dc50[_0x7393('0x1c')]));this[_0x7393('0x21')][_0x7393('0x72')](this,_0x65dc50[_0x7393('0x19d')],_0x56bb49);return this[_0x7393('0xe')]['noop'](_0x7393('0x19e'));};AGIVertices['prototype'][_0x7393('0x19f')]=function(_0x553c9e){logger[_0x7393('0x2d')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x553c9e['label']));return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1a0'));};AGIVertices[_0x7393('0x10')][_0x7393('0x1a1')]=function(_0x18515a){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x18515a[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x18515a[_0x7393('0x1a2')])){return this[_0x7393('0xe')]['noop'](_0x7393('0x1a3'));}var _0xc15778=this[_0x7393('0x30')][_0x7393('0x72')](this,_0x18515a[_0x7393('0x1a2')]);if(!_0xc15778){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x18515a,_0x7393('0x1a4'));}var _0x4af0f6={'body':_0x18515a['sms_text'],'phone':_0x18515a['to']||'','SmsAccountId':_0xc15778['id']};logger[_0x7393('0xe3')](_0x7393('0x1a5'),JSON['stringify'](_0x4af0f6));this[_0x7393('0x33')]['sync'](this,_0x18515a,_0x18515a['sms_account_id']);this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1a6'),_0xc15778[_0x7393('0x1c')]));this['createSmsMessage']['sync'](this,_0x4af0f6);return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1a7'));};AGIVertices['prototype']['set']=function(_0x20ba7e){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1a8'),_0x20ba7e[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x20ba7e[_0x7393('0xdf')])){return this[_0x7393('0xe')]['error'](_0x20ba7e,_0x7393('0x1a9'));}var _0x5d0681=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x20ba7e[_0x7393('0xdf')]);if(!_0x5d0681){return this[_0x7393('0xe')]['error'](_0x20ba7e,_0x7393('0x11d'));}return this[_0x7393('0xe')][_0x7393('0xa8')](_0x5d0681,_0x20ba7e[_0x7393('0x1aa')]);};AGIVertices[_0x7393('0x10')][_0x7393('0x1ab')]=function(_0x53cbc5){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1ac'),_0x53cbc5[_0x7393('0xad')]));this[_0x7393('0xe')]['noop'](_0x7393('0x1ad'));var _0x18cab1=this[_0x7393('0xe')][_0x7393('0xa4')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x18cab1[_0x7393('0xa5')])){this['channel']['uniqueid']=_0x18cab1[_0x7393('0xa5')];}if(_0x53cbc5['answer']==='yes'){this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1ae'));return this[_0x7393('0xe')][_0x7393('0xc0')]();}return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1af'));};AGIVertices['prototype'][_0x7393('0x1b0')]=function(_0x181a6b){logger[_0x7393('0x2d')](util['format'](_0x7393('0x1b1'),_0x181a6b[_0x7393('0xad')]));if(!this['isConfigured'](_0x181a6b['project_id'])){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x181a6b,_0x7393('0x1b2'));}var _0x522fdc=this[_0x7393('0x1b3')][_0x7393('0x72')](this,_0x181a6b[_0x7393('0x1b4')]);if(!this[_0x7393('0x86')](_0x522fdc)){return this[_0x7393('0xe')][_0x7393('0x2b')](_0x181a6b,util[_0x7393('0x27')](_0x7393('0x1b5'),_0x181a6b['project_id']));}if(_0x522fdc===this[_0x7393('0xe')]['arg_1']){return this[_0x7393('0xe')]['error'](_0x181a6b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7393('0x33')][_0x7393('0x72')](this,_0x181a6b,_0x522fdc);var _0x3f5b19=this['channel']['exec']('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x7393('0x1b6')]||'127.0.0.1',_0x522fdc,this[_0x7393('0xe')]['arg_1']));if(_0x3f5b19[_0x7393('0xa6')]===-0x1){return _0x3f5b19;}return this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0xca'),_0x7393('0x1b7'),_0x522fdc));};AGIVertices['prototype'][_0x7393('0x1b8')]=function(_0x4ed0e6){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4ed0e6['label']));var _0x134baf=this[_0x7393('0x58')]['sync'](this,_0x4ed0e6['command']);this['createSquareDetailsReport'][_0x7393('0x72')](this,_0x4ed0e6,_0x4ed0e6[_0x7393('0xbe')]);if(this[_0x7393('0x86')](_0x4ed0e6[_0x7393('0xdf')])){var _0x587c4b=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x4ed0e6[_0x7393('0xdf')]);if(_0x587c4b){this[_0x7393('0xe')]['setVariable'](_0x587c4b,_0x134baf);return this[_0x7393('0xe')]['noop'](util[_0x7393('0x27')](_0x7393('0x1b9'),_0x4ed0e6[_0x7393('0xbe')],_0x587c4b));}}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1ba'),_0x4ed0e6[_0x7393('0xbe')]));};AGIVertices[_0x7393('0x10')][_0x7393('0x1bb')]=function(_0x2ea58f){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1bc'),_0x2ea58f['label']));_0x2ea58f['text']=_0x2ea58f[_0x7393('0x5e')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7393('0x86')](_0x2ea58f[_0x7393('0x5d')])){return this[_0x7393('0xe')][_0x7393('0xae')](_0x7393('0x1bd'));}if(!this[_0x7393('0x86')](_0x2ea58f['text'])){return this['channel'][_0x7393('0xae')]('no\x20text\x20configured');}this['channel'][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1be'),_0x2ea58f['text']));var _0x217334=this[_0x7393('0x5c')][_0x7393('0x72')](this,_0x2ea58f);if(_0x217334){this[_0x7393('0xe')][_0x7393('0xae')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x217334));var _0x1837da=this[_0x7393('0xe')][_0x7393('0x10a')](_0x217334);try{fs['unlink'](_0x217334+'.wav');}catch(_0x1ee305){logger[_0x7393('0x2b')](_0x1ee305);}return _0x1837da;}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x2ea58f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7393('0x1bf')]=function(_0x4e667e){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1c0'),_0x4e667e[_0x7393('0xad')]));_0x4e667e[_0x7393('0x5e')]=_0x4e667e[_0x7393('0x5e')][_0x7393('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7393('0x86')](_0x4e667e[_0x7393('0x5e')])){return this['channel'][_0x7393('0xae')]('no\x20text\x20configured');}this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1c1'),_0x4e667e['text']));var _0x3a14e0=this[_0x7393('0x65')][_0x7393('0x72')](this,_0x4e667e);if(_0x3a14e0){this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')](_0x7393('0x1c2'),_0x3a14e0));var _0x23719f=this[_0x7393('0xe')]['streamFile'](_0x3a14e0);try{fs[_0x7393('0x12b')](_0x3a14e0+_0x7393('0x1c3'));}catch(_0x23ae9f){logger['error'](_0x23ae9f);}return _0x23719f;}return this[_0x7393('0xe')][_0x7393('0x2b')](_0x4e667e,_0x7393('0x1c4'));};AGIVertices['prototype'][_0x7393('0x1c5')]=function(_0x38282d){logger[_0x7393('0x2d')](util[_0x7393('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x38282d[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x38282d[_0x7393('0x15c')])){return this[_0x7393('0xe')]['error'](_0x38282d,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x7393('0x15e'),this['channel']['callerid'],_0x38282d['findBy']));var _0x39d2c1=this[_0x7393('0x52')]['sync'](this,_0x38282d[_0x7393('0x15c')]);if(_0x39d2c1){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x15f'),this[_0x7393('0xe')][_0x7393('0x36')],_0x38282d['findBy']));this['channel'][_0x7393('0xae')](util[_0x7393('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x160')};}else{logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x162'),this[_0x7393('0xe')][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));this[_0x7393('0xe')][_0x7393('0xae')](util['format'](_0x7393('0x162'),this['channel'][_0x7393('0x36')],_0x38282d[_0x7393('0x15c')]));return{'code':0xc8,'result':_0x7393('0x163')};}};AGIVertices[_0x7393('0x10')][_0x7393('0x1c6')]=function(_0x1b4545){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1c7'),_0x1b4545['label']));var _0x39f716=this[_0x7393('0xe')][_0x7393('0x59')](_0x7393('0x1c8'),[_0x1b4545[_0x7393('0x1c9')],_0x1b4545['options']]);if(_0x39f716['result']===-0x1){return _0x39f716;}return this[_0x7393('0xe')][_0x7393('0xae')](util[_0x7393('0x27')]('Executed\x20command\x20%s\x20%s',_0x7393('0x1c8'),_0x1b4545['mailbox']));};AGIVertices['prototype'][_0x7393('0x1ca')]=function(_0x3ba761){logger[_0x7393('0x2d')](util[_0x7393('0x27')](_0x7393('0x1cb'),_0x3ba761[_0x7393('0xad')]));if(!this[_0x7393('0x86')](_0x3ba761[_0x7393('0xdf')])){return this['channel'][_0x7393('0x2b')](_0x3ba761,_0x7393('0x1a9'));}var _0x467121=this[_0x7393('0xa4')][_0x7393('0x72')](this,_0x3ba761[_0x7393('0xdf')]);if(!_0x467121){return this[_0x7393('0xe')]['error'](_0x3ba761,_0x7393('0x11d'));}var _0x2d185c=this[_0x7393('0xe')][_0x7393('0xa4')](_0x467121);return{'code':0xc8,'result':_0x2d185c[_0x7393('0xa5')]?_0x2d185c[_0x7393('0xa5')]:'-'};};String[_0x7393('0x10')][_0x7393('0xa3')]=function(_0x24a136,_0x143ca3){return this['split'](_0x24a136)[_0x7393('0x1cc')](_0x143ca3);};module[_0x7393('0x1cd')]=AGIVertices; \ No newline at end of file +var _0xe14b=['aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','%s/recordings/%s','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','randomstring','moment','request-promise','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','extension','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','split','replaceAll','extra','getAndSetVariable','getVariable','result','setVariable','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','args','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','sync','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe14b,0x93));var _0xbe14=function(_0x199e95,_0x5404f3){_0x199e95=_0x199e95-0x0;var _0x2a250a=_0xe14b[_0x199e95];return _0x2a250a;};'use strict';var fs=require('fs');var util=require(_0xbe14('0x0'));var _=require(_0xbe14('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var Mustache=require('mustache');var rp=require(_0xbe14('0x4'));var logger=require('../../config/logger')('agi');var config=require(_0xbe14('0x5'));var scripts=require(_0xbe14('0x6'));var FILES_PATH=_0xbe14('0x7');var recursiveMapAttributes=[_0xbe14('0x8'),_0xbe14('0x9')];var verticesWithRetry=[_0xbe14('0xa'),_0xbe14('0xb'),'getsecretdigits'];var AGIVertices=function(_0x50f909,_0x496063,_0x30c355){this[_0xbe14('0xc')]=_0x50f909;this[_0xbe14('0xd')]=_0x496063;this[_0xbe14('0xe')]=_0x30c355;};AGIVertices['prototype']['getVariable']=function(_0x113243,_0x3f70cb){this['rpc'][_0xbe14('0xf')](_0x113243)[_0xbe14('0x10')](function(_0x886a5e){_0x3f70cb(null,_0x886a5e?_0x886a5e[_0xbe14('0x11')]:![]);})[_0xbe14('0x12')](function(_0x3b898d){_0x3f70cb(_0x3b898d);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x14')]=function(_0x16893f,_0xa2cf72){this[_0xbe14('0xd')][_0xbe14('0x15')](_0x16893f)[_0xbe14('0x10')](function(_0x530538){_0xa2cf72(null,_0x530538?_0x530538['name']:![]);})[_0xbe14('0x12')](function(_0x3dc4a9){_0xa2cf72(_0x3dc4a9);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x16')]=function(_0x4e8f34,_0x21c789){this[_0xbe14('0xd')][_0xbe14('0x17')](_0x4e8f34)[_0xbe14('0x10')](function(_0x38f1ea){_0x21c789(null,_0x38f1ea?_0x38f1ea[_0xbe14('0x11')]:![]);})[_0xbe14('0x12')](function(_0x5ea1f8){_0x21c789(_0x5ea1f8);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x18')]=function(_0x329588,_0x433459){this[_0xbe14('0xd')][_0xbe14('0x19')](_0x329588)['then'](function(_0x24f820){_0x433459(null,_0x24f820?_0x24f820[_0xbe14('0x1a')]:![]);})[_0xbe14('0x12')](function(_0xc12977){_0x433459(_0xc12977);});};AGIVertices[_0xbe14('0x13')]['getUser']=function(_0xe60f42,_0x56d845){this[_0xbe14('0xd')]['getUserById'](_0xe60f42)[_0xbe14('0x10')](function(_0x4a25fa){_0x56d845(null,_0x4a25fa?_0x4a25fa[_0xbe14('0x11')]:![]);})[_0xbe14('0x12')](function(_0x505dbd){_0x56d845(_0x505dbd);});};AGIVertices[_0xbe14('0x13')]['getTrunk']=function(_0x4587a8,_0x4851f8){this[_0xbe14('0xd')][_0xbe14('0x1b')](_0x4587a8)[_0xbe14('0x10')](function(_0x39cc81){_0x4851f8(null,_0x39cc81?_0x39cc81[_0xbe14('0x11')]:![]);})[_0xbe14('0x12')](function(_0x55d001){_0x4851f8(_0x55d001);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x1c')]=function(_0x391556,_0x169369){var _0x5dd475=this;this[_0xbe14('0xd')][_0xbe14('0x1d')](_0x391556)['then'](function(_0x3c3613){_0x169369(null,_0x3c3613?_0x5dd475[_0xbe14('0x1e')](_0x3c3613[_0xbe14('0x1f')]):![]);})[_0xbe14('0x12')](function(_0x34d648){_0x169369(_0x34d648);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x20')]=function(_0x2b05cb,_0x4168c8){this[_0xbe14('0xd')][_0xbe14('0x21')](_0x2b05cb)[_0xbe14('0x10')](function(_0x39dc0a){_0x4168c8(null,_0x39dc0a?_0x39dc0a:![]);})[_0xbe14('0x12')](function(_0x223f7a){_0x4168c8(_0x223f7a);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x22')]=function(_0x2ff48e,_0x29e76a,_0x14e7c4){this['mailRpc'][_0xbe14('0x22')](_0x2ff48e,_0x29e76a)['then'](function(){_0x14e7c4(null);})['catch'](function(_0x46c2d1){_0x14e7c4(_0x46c2d1);});};AGIVertices['prototype'][_0xbe14('0x23')]=function(_0x345b0,_0x52a25c){this['rpc']['getIntervalById'](_0x345b0)[_0xbe14('0x10')](function(_0xa3d24){if(_0xa3d24){if(_0xa3d24['IntervalId']){_0x52a25c(null,[_0xa3d24[_0xbe14('0x24')]]);}else{_0x52a25c(null,_[_0xbe14('0x25')](_0xa3d24[_0xbe14('0x26')],_0xbe14('0x24')));}}else{_0x52a25c(null,![]);}})[_0xbe14('0x12')](function(_0x5ef1e5){_0x52a25c(_0x5ef1e5);});};AGIVertices['prototype'][_0xbe14('0x1e')]=function(_0x52b24c){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x52b24c);};AGIVertices[_0xbe14('0x13')][_0xbe14('0x27')]=function(_0x2bb45,_0x3dbacb,_0x172e79){odbc[_0xbe14('0x28')](_0x2bb45,function(_0xcdc50){if(_0xcdc50){logger[_0xbe14('0x29')](_0xbe14('0x2a'),_0xcdc50);_0x172e79(_0xcdc50);}else{logger[_0xbe14('0x2b')](_0xbe14('0x2c'));odbc[_0xbe14('0x2d')](_0x3dbacb,function(_0x539c41,_0x4f51f8){if(_0x539c41){logger[_0xbe14('0x2b')](_0xbe14('0x2e'),_0x3dbacb);_0x172e79(_0x539c41);}else{logger[_0xbe14('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x3dbacb);odbc[_0xbe14('0x2f')](function(_0x2aa453){if(_0x2aa453){logger[_0xbe14('0x29')](_0xbe14('0x30'),_0x2aa453);}_0x172e79(null,_0x4f51f8);});}});}});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x31')]=function(_0x19fa30,_0x128843){this[_0xbe14('0xd')]['getSmsAccountById'](_0x19fa30)[_0xbe14('0x10')](function(_0x841b71){_0x128843(null,_0x841b71?_0x841b71:![]);})[_0xbe14('0x12')](function(_0x1b3118){_0x128843(_0x1b3118);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x32')]=function(_0x548d17,_0xb0f143){this[_0xbe14('0xd')][_0xbe14('0x32')](_0x548d17)[_0xbe14('0x10')](function(_0x5cf713){_0xb0f143(null,_0x5cf713);})['catch'](function(_0x38611d){_0xb0f143(_0x38611d);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x33')]=function(_0x51c859,_0x5d5318,_0x6b6aa8){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0xbe14('0xc')][_0xbe14('0x34')],'node':_0x51c859[_0xbe14('0x35')],'application':_0x51c859['agicommand'],'data':_0x5d5318||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xbe14('0xc')][_0xbe14('0x36')]})[_0xbe14('0x10')](function(_0x562325){if(_0x6b6aa8){_0x6b6aa8(null,_0x562325);}})[_0xbe14('0x12')](function(_0xcb0680){if(_0x6b6aa8){_0x6b6aa8(_0xcb0680);}});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x37')]=function(_0x58351f,_0x4a1a4b,_0x3e2fd3,_0x34ffa0){this[_0xbe14('0xd')][_0xbe14('0x37')]({'uniqueid':this[_0xbe14('0xc')]['uniqueid'],'callerid':this['channel'][_0xbe14('0x36')],'calleridname':this[_0xbe14('0xc')][_0xbe14('0x38')],'context':this[_0xbe14('0xc')]['context'],'extension':this[_0xbe14('0xc')][_0xbe14('0x39')],'priority':this['channel'][_0xbe14('0x3a')],'accountcode':this[_0xbe14('0xc')][_0xbe14('0x3b')],'dnid':this[_0xbe14('0xc')]['dnid'],'projectName':this['channel'][_0xbe14('0x3c')],'saveName':_0x4a1a4b,'filename':_0x58351f[_0xbe14('0x3d')]||_0x4a1a4b,'savePath':_0x3e2fd3})['then'](function(_0x5acf90){_0x34ffa0(null,_0x5acf90);})[_0xbe14('0x12')](function(_0x5d3726){_0x34ffa0(_0x5d3726);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x3e')]=function(_0xdbc6e1,_0xd04fd5,_0x10cd86,_0x5a4068,_0xf32e93){this[_0xbe14('0xd')][_0xbe14('0x3e')]({'uniqueid':this[_0xbe14('0xc')][_0xbe14('0x34')],'body':_0xdbc6e1,'direction':_0xd04fd5,'providerName':_0x10cd86,'providerResponse':_0x5a4068})['then'](function(_0x3a221b){if(_0xf32e93){_0xf32e93(null,_0x3a221b);}})[_0xbe14('0x12')](function(_0x35126f){if(_0xf32e93){_0xf32e93(_0x35126f);}});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x3f')]=function(_0x2dbeb1,_0x505829){this['rpc'][_0xbe14('0x3f')]({'firstName':_[_0xbe14('0x40')](_0x2dbeb1[_0xbe14('0x11')])||_['isNil'](_0x2dbeb1['name'])?_0xbe14('0x41')+Math[_0xbe14('0x42')]():_0x2dbeb1['name'],'lastName':_[_0xbe14('0x40')](_0x2dbeb1[_0xbe14('0x43')])||_['isNil'](_0x2dbeb1[_0xbe14('0x43')])?null:_0x2dbeb1['lastName'],'phone':_0x2dbeb1[_0xbe14('0x44')],'ListId':_0x2dbeb1[_0xbe14('0x45')],'scheduledat':_0x2dbeb1[_0xbe14('0x46')],'callbackUniqueid':this['channel'][_0xbe14('0x34')],'tags':_0xbe14('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x2dbeb1[_0xbe14('0x46')][_0xbe14('0x48')](),'priority':_0x2dbeb1[_0xbe14('0x49')]})[_0xbe14('0x10')](function(_0x49322f){_0x505829(null,_0x49322f);})['catch'](function(_0x42a346){_0x505829(_0x42a346);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x4a')]=function(_0x243b9e,_0x32968f){this[_0xbe14('0xd')][_0xbe14('0x4b')](_0x243b9e)['then'](function(_0x72c875){_0x32968f(null,_0x72c875?_0x72c875[_0xbe14('0x11')]:![]);})[_0xbe14('0x12')](function(_0x1201e2){_0x32968f(_0x1201e2);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x4c')]=function(_0xd8f78f,_0x32df3c,_0x285b6e){var _0xc61103={'role':_0xbe14('0x4d')};_0xc61103[_0xd8f78f]=this['channel']['callerid'];this['rpc'][_0xbe14('0x4c')](_0xc61103,_0x32df3c,this[_0xbe14('0xc')][_0xbe14('0x34')])[_0xbe14('0x10')](function(_0x1cf828){_0x285b6e(null,_[_0xbe14('0x4e')](_0x1cf828)?![]:!![]);})[_0xbe14('0x12')](function(_0x22bf69){logger[_0xbe14('0x29')](_0x22bf69);_0x285b6e(null,![]);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x4f')]=function(_0x4346e8,_0x2088e4){var _0xeb915b={'role':_0xbe14('0x4d')};_0xeb915b[_0x4346e8]=this[_0xbe14('0xc')][_0xbe14('0x36')];this[_0xbe14('0xd')][_0xbe14('0x4f')](_0xeb915b)[_0xbe14('0x10')](function(_0x5f394c){_0x2088e4(null,_[_0xbe14('0x4e')](_0x5f394c)?![]:!![]);})[_0xbe14('0x12')](function(_0x2c426d){logger[_0xbe14('0x29')](_0x2c426d);_0x2088e4(null,![]);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x50')]=function(_0x198b55,_0x310311){var _0x23cb36={'role':_0xbe14('0x4d')};_0x23cb36[_0x198b55]=this['channel'][_0xbe14('0x36')];this[_0xbe14('0xd')][_0xbe14('0x50')](_0x23cb36)[_0xbe14('0x10')](function(_0x3ac6d8){_0x310311(null,_['isNil'](_0x3ac6d8)?![]:!![]);})[_0xbe14('0x12')](function(_0x120077){logger[_0xbe14('0x29')](_0x120077);_0x310311(null,![]);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x51')]=function(_0x5ed9b3,_0x48da19){var _0x14f064={'role':_0xbe14('0x4d')};_0x14f064[_0x5ed9b3]=this[_0xbe14('0xc')][_0xbe14('0x36')];var _0x289c4d=_0x5ed9b3!=_0xbe14('0x52')?util[_0xbe14('0x53')]('%s/%s@from-sip/n',_0xbe14('0x54'),this[_0xbe14('0xc')][_0xbe14('0x36')]):undefined;this[_0xbe14('0xd')][_0xbe14('0x51')](_0x14f064,_0x289c4d)[_0xbe14('0x10')](function(_0x445302){_0x48da19(null,_['isNil'](_0x445302)?![]:!![]);})['catch'](function(_0x12941d){logger[_0xbe14('0x29')](_0x12941d);_0x48da19(null,![]);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x55')]=function(_0x312504,_0x28cade){sh[_0xbe14('0x56')](_[_0xbe14('0x57')](_0x312504),function(_0x50e644,_0x5ca835){var _0x1007e3=_0x5ca835[_0xbe14('0x58')](/(\r\n|\n|\r)/gm,'');_0x28cade(null,_0x1007e3);});};AGIVertices[_0xbe14('0x13')]['googleCloudTTS']=function(_0x76e91e,_0x16bca1){scripts[_0xbe14('0x59')](_0x76e91e[_0xbe14('0x5a')],_0x76e91e[_0xbe14('0x5b')]||_0xbe14('0x5c'),_0x76e91e[_0xbe14('0x5c')],_0x76e91e['languageCode']||_0xbe14('0x5d'),_0x76e91e[_0xbe14('0x5e')]||_0xbe14('0x5f'),_0x76e91e[_0xbe14('0x60')]||_0xbe14('0x61'))[_0xbe14('0x10')](function(_0xeccc28){_0x16bca1(null,_0xeccc28);})['catch'](function(_0x3952c7){_0x16bca1(_0x3952c7);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x62')]=function(_0x1c0932,_0x28da4a){scripts[_0xbe14('0x62')](_0x1c0932[_0xbe14('0x5c')],_0x1c0932[_0xbe14('0x63')]||'en',0x1)['then'](function(_0x1e5ce1){_0x28da4a(null,_0x1e5ce1);})[_0xbe14('0x12')](function(_0x362999){_0x28da4a(_0x362999);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x64')]=function(_0x17576b,_0x4d59ce){var _0x176099={'uri':_0x17576b[_0xbe14('0x65')],'method':_0x17576b[_0xbe14('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x17576b[_0xbe14('0x67')])==='number'&&parseInt(_0x17576b[_0xbe14('0x67')])>=0x1?parseInt(_0x17576b[_0xbe14('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xbe14('0x68')]([_0xbe14('0x69'),_0xbe14('0x6a')],_0x176099[_0xbe14('0x66')][_0xbe14('0x6b')]())){try{_0x176099['body']=_0x17576b[_0xbe14('0x9')]?JSON['parse'](_0x17576b[_0xbe14('0x9')]):{};}catch(_0x5d85d3){logger[_0xbe14('0x29')](_0xbe14('0x6c'),_0x5d85d3);}}try{_0x176099[_0xbe14('0x6d')]=_0x17576b['rawHeaders']?JSON[_0xbe14('0x6e')](_0x17576b[_0xbe14('0x8')]):{};}catch(_0x18f6b7){logger['error'](_0xbe14('0x6f'),_0x18f6b7);}if(_0x17576b[_0xbe14('0x70')]){try{var _0x1737a8=require(_0x17576b[_0xbe14('0x70')])['sync'](this,_0x176099);_0x176099[_0xbe14('0x71')]=Mustache[_0xbe14('0x72')](_0x17576b[_0xbe14('0x65')],_0x1737a8,{},['$$','$$']);if(_0x176099[_0xbe14('0x6d')]){_0x176099[_0xbe14('0x6d')]=JSON[_0xbe14('0x6e')](Mustache[_0xbe14('0x72')](JSON['stringify'](_0x176099[_0xbe14('0x6d')]),_0x1737a8,{},['$$','$$']));}if(_0x176099[_0xbe14('0x73')]){_0x176099[_0xbe14('0x73')]=JSON['parse'](Mustache[_0xbe14('0x72')](JSON[_0xbe14('0x74')](_0x176099[_0xbe14('0x73')]),_0x1737a8,{},['$$','$$']));}}catch(_0x5bc52b){logger[_0xbe14('0x29')](_0xbe14('0x75'),_0x5bc52b);}}rp(_0x176099)['then'](function(_0x2be969){var _0x49990b={'statusCode':_0x2be969[_0xbe14('0x76')]||0xc8,'statusMessage':_0x2be969[_0xbe14('0x77')]||'OK','headers':_0x2be969['headers']||{},'body':_0x2be969['body']||{}};_0x4d59ce(null,_0x49990b);})[_0xbe14('0x12')](function(_0x3db955){var _0x29287a={'statusCode':_0x3db955['statusCode']||0x1f4,'statusMessage':_0x3db955[_0xbe14('0x78')]||_0xbe14('0x79'),'headers':_0x3db955[_0xbe14('0x7a')][_0xbe14('0x6d')]||{},'body':_0x3db955['options']['body']||{}};_0x4d59ce(null,_0x29287a);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x7b')]=function(_0xc8d0f6,_0x215d5b){scripts[_0xbe14('0x7b')](this[_0xbe14('0xc')][_0xbe14('0x34')],_0xc8d0f6['key'],_0xc8d0f6[_0xbe14('0x5c')],_0xc8d0f6['dialogflow_language']||'en')[_0xbe14('0x10')](function(_0x3a01bb){_0x215d5b(null,_0x3a01bb);})[_0xbe14('0x12')](function(_0x2382c4){_0x215d5b(_0x2382c4);});};AGIVertices['prototype'][_0xbe14('0x7c')]=function(_0xa8dd0c,_0xdfbd5b){scripts['googleDialogflowV2'](this[_0xbe14('0xc')][_0xbe14('0x34')],_0xa8dd0c[_0xbe14('0x7d')],_0xa8dd0c[_0xbe14('0x7e')],_0xa8dd0c[_0xbe14('0x7f')],_0xa8dd0c[_0xbe14('0x5c')],_0xa8dd0c[_0xbe14('0x80')]||'en')[_0xbe14('0x10')](function(_0xd2fef4){_0xdfbd5b(null,_0xd2fef4);})[_0xbe14('0x12')](function(_0x2bf94c){_0xdfbd5b(_0x2bf94c);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x81')]=function(_0x2a4946,_0x2fc475){scripts[_0xbe14('0x81')](this[_0xbe14('0xc')],_0x2a4946)[_0xbe14('0x10')](function(_0x1679bd){_0x2fc475(null,_0x1679bd);})[_0xbe14('0x12')](function(_0x52afc9){_0x2fc475(_0x52afc9);});};AGIVertices[_0xbe14('0x13')]['ispeechTTS']=function(_0x8d4c96,_0x1b8733){scripts[_0xbe14('0x82')](_0x8d4c96[_0xbe14('0x83')],_0x8d4c96[_0xbe14('0x5c')],_0x8d4c96['ispeech_tts_language']||'en-US',_0x8d4c96[_0xbe14('0x84')])[_0xbe14('0x10')](function(_0x13a732){_0x1b8733(null,_0x13a732);})[_0xbe14('0x12')](function(_0x4c1ad2){_0x1b8733(_0x4c1ad2);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x85')]=function(_0x4d6a75,_0x186225,_0x3b8b45){scripts[_0xbe14('0x85')](_0x186225,_0x4d6a75[_0xbe14('0x83')],_0x4d6a75['ispeech_asr_language']||_0xbe14('0x5d'),this['isConfigured'](_0x4d6a75['model'])?_0x4d6a75[_0xbe14('0x86')]:undefined)[_0xbe14('0x10')](function(_0x110603){_0x3b8b45(null,_0x110603);})[_0xbe14('0x12')](function(_0x3e8655){_0x3b8b45(_0x3e8655);});};AGIVertices['prototype'][_0xbe14('0x87')]=function(_0x1584f6,_0x5dc793){scripts['awsPolly'](_0x1584f6[_0xbe14('0x88')],_0x1584f6[_0xbe14('0x89')],_0x1584f6['aws_polly_region'],_0x1584f6[_0xbe14('0x8a')]||'Amy',_0x1584f6[_0xbe14('0x5c')],_0x1584f6['aws_text_type']||_0xbe14('0x5c'))['then'](function(_0x371ddd){_0x5dc793(null,_0x371ddd);})['catch'](function(_0x20a085){_0x5dc793(_0x20a085);});};AGIVertices[_0xbe14('0x13')]['awsLex']=function(_0x519ffc,_0x143f18){scripts['awsLex'](this['channel'][_0xbe14('0x34')],_0x519ffc[_0xbe14('0x88')],_0x519ffc[_0xbe14('0x89')],_0x519ffc[_0xbe14('0x8b')],_0x519ffc[_0xbe14('0x5c')],_0x519ffc[_0xbe14('0x8c')])[_0xbe14('0x10')](function(_0x57ad22){_0x143f18(null,_0x57ad22);})[_0xbe14('0x12')](function(_0x3aa921){_0x143f18(_0x3aa921);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x8d')]=function(_0x59779a,_0x26372a,_0x3c5097){scripts[_0xbe14('0x8d')](_0x26372a,_0x59779a['key'],_0x59779a[_0xbe14('0x8e')]||_0xbe14('0x5d'))['then'](function(_0x360cee){_0x3c5097(null,_0x360cee);})['catch'](function(_0x82cbcf){_0x3c5097(_0x82cbcf);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x8f')]=function(_0x50007a,_0x4b71ec,_0x5e2106){scripts[_0xbe14('0x8f')](_0x4b71ec,_0x50007a['appid'],_0x50007a['appsecret'],_0x50007a[_0xbe14('0x71')])['then'](function(_0xab74eb){_0x5e2106(null,_0xab74eb);})['catch'](function(_0x34e288){_0x5e2106(_0x34e288);});};AGIVertices[_0xbe14('0x13')][_0xbe14('0x90')]=function(_0x275e0f){var _0x463667=_[_0xbe14('0x68')](verticesWithRetry,_0x275e0f[_0xbe14('0x91')])?_0x275e0f:_[_0xbe14('0x92')](_0x275e0f);for(var _0x466f7f in _0x463667){if(_0x463667[_0xbe14('0x93')](_0x466f7f)){if(_0x463667[_0x466f7f]&&_[_0xbe14('0x94')](_0x463667[_0x466f7f])){if(_[_0xbe14('0x68')](recursiveMapAttributes,_0x466f7f)){_0x463667[_0x466f7f]=this[_0xbe14('0x95')](_0x463667[_0x466f7f]);}else{_0x463667[_0x466f7f]=this['replaceAllVariables'](_0x463667[_0x466f7f]);}}}}return _0x463667;};AGIVertices[_0xbe14('0x13')][_0xbe14('0x96')]=function(_0x342992){for(var _0x17b44a in _0x342992){if(_0x342992[_0xbe14('0x93')](_0x17b44a)){if(_['isPlainObject'](_0x342992[_0x17b44a])){this['recursiveNodeIndex'](_0x342992[_0x17b44a]);}else if(_[_0xbe14('0x97')](_0x342992[_0x17b44a])){for(var _0x1a9cdc=0x0;_0x1a9cdc<_0x342992[_0x17b44a][_0xbe14('0x98')];_0x1a9cdc++){this[_0xbe14('0x96')](_0x342992[_0x17b44a][_0x1a9cdc]);}}else if(_[_0xbe14('0x94')](_0x342992[_0x17b44a])){_0x342992[_0x17b44a]=this[_0xbe14('0x99')](_0x342992[_0x17b44a]);}}}};AGIVertices[_0xbe14('0x13')][_0xbe14('0x9a')]=function(_0x1a3e87,_0x26e7a7){for(var _0x761b3d in _0x1a3e87){if(_0x1a3e87[_0xbe14('0x93')](_0x761b3d)){if(_[_0xbe14('0x9b')](_0x1a3e87[_0x761b3d])){if(!_[_0xbe14('0x40')](_0x1a3e87[_0x761b3d])){this[_0xbe14('0x9a')](_0x1a3e87[_0x761b3d],util[_0xbe14('0x53')](_0xbe14('0x9c'),_0x26e7a7,_0x761b3d));}}else if(_[_0xbe14('0x97')](_0x1a3e87[_0x761b3d])){for(var _0x44c62f=0x0;_0x44c62f<_0x1a3e87[_0x761b3d][_0xbe14('0x98')];_0x44c62f++){this[_0xbe14('0x9a')](_0x1a3e87[_0x761b3d][_0x44c62f],util[_0xbe14('0x53')](_0xbe14('0x9c'),_0x26e7a7,_0x761b3d+'['+_0x44c62f+']'));}}else{if(!_[_0xbe14('0x4e')](_0x1a3e87[_0x761b3d])){this[_0xbe14('0xc')]['setVariable'](util[_0xbe14('0x53')](_0xbe14('0x9c'),_0x26e7a7,_0x761b3d),_0x1a3e87[_0x761b3d]);}}}}};AGIVertices[_0xbe14('0x13')][_0xbe14('0x95')]=function(_0x40727d){try{var _0x1d2c37=JSON['parse'](_0x40727d);this['recursiveNodeIndex'](_0x1d2c37);return JSON[_0xbe14('0x74')](_0x1d2c37);}catch(_0x4a44e0){return this[_0xbe14('0x99')](_0x40727d);}};AGIVertices['prototype'][_0xbe14('0x99')]=function(_0x59000b){var _0x11aa49=_0x59000b[_0xbe14('0x9d')]('{');for(var _0x278184=0x1;_0x278184<_0x11aa49[_0xbe14('0x98')];_0x278184+=0x1){var _0x3781ec=_0x11aa49[_0x278184][_0xbe14('0x9d')]('}');if(_0x3781ec[_0xbe14('0x98')]>0x1){_0x59000b=_0x59000b[_0xbe14('0x9e')]('{'+_0x3781ec[0x0]+'}',this[_0xbe14('0xc')]['getVariable'](_0x3781ec[0x0])[_0xbe14('0x9f')]||_0x3781ec[0x0]);}}if(_0x11aa49[_0xbe14('0x98')]===0x1){return _0x59000b[_0xbe14('0x48')]();}return this[_0xbe14('0x99')](_0x59000b);};AGIVertices['prototype'][_0xbe14('0xa0')]=function(_0x4c3090,_0x2481fe){var _0x4eb6c2=this[_0xbe14('0xc')][_0xbe14('0xa1')](_0x4c3090);if(_0x4eb6c2[_0xbe14('0xa2')]===-0x1){return _0x4eb6c2;}logger['info'](util[_0xbe14('0x53')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2481fe,_0x4eb6c2[_0xbe14('0x9f')]));return this[_0xbe14('0xc')][_0xbe14('0xa3')](_0x2481fe,_0x4eb6c2[_0xbe14('0x9f')]);};AGIVertices[_0xbe14('0x13')][_0xbe14('0xa4')]=function(_0x1f3a86){return _0x1f3a86&&_0x1f3a86!=='0'&&_0x1f3a86!=='-1'&&_0x1f3a86!=='';};AGIVertices[_0xbe14('0x13')][_0xbe14('0xa5')]=function(_0x5a7724){this[_0xbe14('0x33')]['sync'](this,_0x5a7724,'-');_0x5a7724[_0xbe14('0xa6')]=_0x5a7724[_0xbe14('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbe14('0x13')]['mrcpsynth']=function(_0x275df5){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0xa7'),_0x275df5[_0xbe14('0x35')]));if(!this['isConfigured'](_0x275df5['text'])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xa8'));}var _0x36d6a6='\x22'+_0x275df5[_0xbe14('0x5c')]+'\x22';if(this[_0xbe14('0xa4')](_0x275df5['options'])){_0x36d6a6+=','+_0x275df5[_0xbe14('0x7a')];}var _0x34af71=this['channel'][_0xbe14('0x56')](_0xbe14('0xa9'),_0x36d6a6);if(_0x34af71[_0xbe14('0xa2')]===-0x1){return _0x34af71;}return this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')](_0xbe14('0xaa'),_0x36d6a6));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xab')]=function(_0x3b7920){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0xac'),_0x3b7920[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x3b7920['grammar'])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xae'));}var _0x678716=_0x3b7920['grammar'];if(this[_0xbe14('0xa4')](_0x3b7920[_0xbe14('0x7a')])){_0x678716+=','+_0x3b7920[_0xbe14('0x7a')];}var _0x4b00ae=this[_0xbe14('0xc')][_0xbe14('0x56')](_0xbe14('0xaf'),_0x678716);if(_0x4b00ae[_0xbe14('0xa2')]===-0x1){return _0x4b00ae;}var _0x3d328c=this[_0xbe14('0xa0')](_0xbe14('0xb0'),'MRCP_RECOG_CONFIDENCE');if(_0x3d328c[_0xbe14('0xa2')]===-0x1){return _0x3d328c;}var _0x4844b4=this[_0xbe14('0xa0')](_0xbe14('0xb1'),_0xbe14('0xb2'));if(_0x4844b4[_0xbe14('0xa2')]===-0x1){return _0x4844b4;}var _0x415f16=this['getAndSetVariable']('RECOG_INSTANCE()',_0xbe14('0xb3'));if(_0x415f16[_0xbe14('0xa2')]===-0x1){return _0x415f16;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0xb4'),_0x678716));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xb5')]=function(_0x54e986){logger[_0xbe14('0x2b')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x54e986[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0xb5')]([_0x54e986['command'],_0x54e986[_0xbe14('0xb6')]]);};AGIVertices[_0xbe14('0x13')]['answer']=function(_0x4443a7){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4443a7[_0xbe14('0x35')]));if(this[_0xbe14('0xa4')](_0x4443a7[_0xbe14('0x67')])){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4443a7[_0xbe14('0x67')]));var _0x2dc3a6=this[_0xbe14('0xc')]['wait'](_0x4443a7[_0xbe14('0x67')]);if(_0x2dc3a6[_0xbe14('0xa2')]===-0x1){return _0x2dc3a6;}}return this[_0xbe14('0xc')][_0xbe14('0xb7')]();};AGIVertices[_0xbe14('0x13')][_0xbe14('0x47')]=function(_0x1b22a0){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0xb8'),_0x1b22a0[_0xbe14('0x35')]));if(!this['isConfigured'](_0x1b22a0[_0xbe14('0x45')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x1b22a0,'no\x20list\x20selected');}_0x1b22a0[_0xbe14('0x46')]=moment();if(this[_0xbe14('0xa4')](_0x1b22a0[_0xbe14('0xb9')])){_0x1b22a0['scheduledAt']=moment()[_0xbe14('0xba')](_0x1b22a0['delay'],_0xbe14('0xbb'));}if(!this[_0xbe14('0xa4')](_0x1b22a0['callback_priority'])){_0x1b22a0[_0xbe14('0x49')]=0x2;}this[_0xbe14('0x3f')]['sync'](this,_0x1b22a0);return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xbc'),_0x1b22a0[_0xbe14('0x44')],_0x1b22a0[_0xbe14('0x45')],_0x1b22a0['scheduledAt']));};AGIVertices['prototype'][_0xbe14('0xbd')]=function(_0x339504){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x339504[_0xbe14('0x35')]));var _0x4cb29c=this[_0xbe14('0xc')][_0xbe14('0x56')](_0x339504['application'],_0x339504[_0xbe14('0x7a')]);if(_0x4cb29c[_0xbe14('0xa2')]===-0x1){return _0x4cb29c;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xbe'),_0x339504[_0xbe14('0xbf')],_0x339504[_0xbe14('0x7a')]));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xc0')]=function(_0x337dab){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0xc1'),_0x337dab[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x337dab[_0xbe14('0x5c')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xa8'));}var _0x4a3d11='\x22'+_0x337dab[_0xbe14('0x5c')]+'\x22';if(this[_0xbe14('0xa4')](_0x337dab[_0xbe14('0x7a')])){_0x4a3d11+=','+_0x337dab['options'];}var _0x22822f=this[_0xbe14('0xc')][_0xbe14('0x56')](_0xbe14('0xa9'),_0x4a3d11);if(_0x22822f[_0xbe14('0xa2')]===-0x1){return _0x22822f;}return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xaa'),_0x4a3d11));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xc2')]=function(_0x5370c5){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0xc3'),_0x5370c5[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x5370c5[_0xbe14('0x5c')])){return this[_0xbe14('0xc')][_0xbe14('0xad')]('no\x20text\x20configured');}var _0x5c25dc='\x22'+_0x5370c5[_0xbe14('0x5c')]+'\x22';if(this[_0xbe14('0xa4')](_0x5370c5[_0xbe14('0x7a')])){_0x5c25dc+=','+_0x5370c5[_0xbe14('0x7a')];}var _0x4c83af=this['channel'][_0xbe14('0x56')](_0xbe14('0xa9'),_0x5c25dc);if(_0x4c83af[_0xbe14('0xa2')]===-0x1){return _0x4c83af;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xaa'),_0x5c25dc));};AGIVertices[_0xbe14('0x13')]['lumenvoxasr']=function(_0xf6da38){logger[_0xbe14('0x2b')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xf6da38[_0xbe14('0x35')]));if(!this['isConfigured'](_0xf6da38[_0xbe14('0xc4')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xae'));}var _0x7499d0=_0xf6da38['grammar'];if(this[_0xbe14('0xa4')](_0xf6da38[_0xbe14('0x7a')])){_0x7499d0+=','+_0xf6da38[_0xbe14('0x7a')];}var _0x1ad663=this[_0xbe14('0xc')][_0xbe14('0x56')]('MRCPRecog',_0x7499d0);if(_0x1ad663['result']===-0x1){return _0x1ad663;}var _0x2e681e=this['getAndSetVariable'](_0xbe14('0xb0'),_0xbe14('0xc5'));if(_0x2e681e[_0xbe14('0xa2')]===-0x1){return _0x2e681e;}var _0x5edd44=this[_0xbe14('0xa0')](_0xbe14('0xb1'),_0xbe14('0xc6'));if(_0x5edd44[_0xbe14('0xa2')]===-0x1){return _0x5edd44;}var _0x41a064=this[_0xbe14('0xa0')](_0xbe14('0xc7'),'LUMENVOX_ASR_INSTANCE');if(_0x41a064[_0xbe14('0xa2')]===-0x1){return _0x41a064;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x7499d0));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xc8')]=function(_0x579f45){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0xc9'),_0x579f45['label']));if(!this[_0xbe14('0xa4')](_0x579f45[_0xbe14('0xc4')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xae'));}var _0x5b3cfc=_0x579f45[_0xbe14('0xc4')];if(this[_0xbe14('0xa4')](_0x579f45[_0xbe14('0x7a')])){_0x5b3cfc+=','+_0x579f45[_0xbe14('0x7a')];}var _0x4de9eb=this['channel']['exec'](_0xbe14('0xaf'),_0x5b3cfc);if(_0x4de9eb[_0xbe14('0xa2')]===-0x1){return _0x4de9eb;}var _0x3826cf=this[_0xbe14('0xa0')](_0xbe14('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0x3826cf['result']===-0x1){return _0x3826cf;}var _0x295c4f=this[_0xbe14('0xa0')](_0xbe14('0xb1'),_0xbe14('0xca'));if(_0x295c4f[_0xbe14('0xa2')]===-0x1){return _0x295c4f;}var _0x53c194=this[_0xbe14('0xa0')]('RECOG_INSTANCE()',_0xbe14('0xcb'));if(_0x53c194[_0xbe14('0xa2')]===-0x1){return _0x53c194;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0xb4'),_0x5b3cfc));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xcc')]=function(_0x242f07){logger['info'](util[_0xbe14('0x53')](_0xbe14('0xcd'),_0x242f07[_0xbe14('0x35')]));if(!this['isConfigured'](_0x242f07['odbc_id'])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x242f07,_0xbe14('0xce'));}var _0x5cbe18=this[_0xbe14('0x18')][_0xbe14('0xcf')](this,_0x242f07[_0xbe14('0xd0')]);if(!_0x5cbe18){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x242f07,_0xbe14('0xd1'));}if(!this['isConfigured'](_0x242f07[_0xbe14('0x2d')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x242f07,_0xbe14('0xd2'));}var _0x38ea63=_0x242f07['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')]('query:\x20%s',_0x38ea63));var _0x20c7e6=this[_0xbe14('0x27')][_0xbe14('0xcf')](this,_0x5cbe18,_0x38ea63);this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x242f07,_0x38ea63);if(!this[_0xbe14('0xa4')](_0x242f07[_0xbe14('0xd3')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xd4'));}var _0x303d01=this[_0xbe14('0xa1')][_0xbe14('0xcf')](this,_0x242f07[_0xbe14('0xd3')]);if(!_0x303d01){return this['channel'][_0xbe14('0x29')](_0x242f07,_0xbe14('0xd5'));}var _0x44e08b=this;_0x20c7e6[_0xbe14('0xd6')](function(_0x106d94,_0x267497){Object[_0xbe14('0xd7')](_0x106d94)[_0xbe14('0xd6')](function(_0x557ff1){_0x44e08b[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0xd8'),_0x303d01,_0x267497,_0x557ff1),_0x106d94[_0x557ff1]);});});this[_0xbe14('0xc')][_0xbe14('0xa3')](util['format']('%s_ROWS_COUNT',_0x303d01),_0x20c7e6['length']);return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')]('variable\x20%s\x20set',_0x303d01));};AGIVertices[_0xbe14('0x13')]['dial']=function(_0x22da6c){logger[_0xbe14('0xd9')](util[_0xbe14('0x53')](_0xbe14('0xda'),_0x22da6c[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x22da6c['sip_id'])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x22da6c,_0xbe14('0xdb'));}var _0x2778f9=this[_0xbe14('0xdc')][_0xbe14('0xcf')](this,_0x22da6c[_0xbe14('0xdd')]);if(!_0x2778f9){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x22da6c,'no\x20user\x20found');}var _0x2eb5e6=this['channel'][_0xbe14('0x56')]('DIAL',[util['format'](_0xbe14('0xde'),_0x2778f9),_0x22da6c[_0xbe14('0x67')],_0x22da6c[_0xbe14('0xdf')],_0x22da6c['url']]);if(_0x2eb5e6[_0xbe14('0xa2')]===-0x1){return _0x2eb5e6;}return this['channel'][_0xbe14('0xad')](util['format'](_0xbe14('0xe0'),_0xbe14('0xe1')));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xe2')]=function(_0x331b17){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0xe3'),_0x331b17[_0xbe14('0x35')]));if(!this['isConfigured'](_0x331b17['key'])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xe4'));}if(!this[_0xbe14('0xa4')](_0x331b17[_0xbe14('0x5c')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xa8'));}this['channel'][_0xbe14('0xe5')]=!![];this[_0xbe14('0x33')](_0x331b17);this[_0xbe14('0x3e')](_0x331b17['text'],'in','','');this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('Trying\x20Dialogflow:\x20%s',_0x331b17['text']));var _0x1f446b=this['googleDialogflow'][_0xbe14('0xcf')](this,_0x331b17);if(_0x1f446b){for(var _0x3ba691 in _0x1f446b){if(_0x1f446b[_0xbe14('0x93')](_0x3ba691)){this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')]('DIALOGFLOW_%s',_0x3ba691[_0xbe14('0x6b')]()),_0x1f446b[_0x3ba691]);}}this['createSquareMessage'](_0x1f446b[_0xbe14('0xe6')],_0xbe14('0xe7'),_0xbe14('0xe2'),'');return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')]('Dialogflow\x20Result\x20%s',_0x1f446b['speech']));}return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x331b17,_0xbe14('0xe8'));};AGIVertices['prototype'][_0xbe14('0xe9')]=function(_0x34126e){logger['info'](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x34126e['label']));if(!this[_0xbe14('0xa4')](_0x34126e[_0xbe14('0x7d')])){return this['channel']['noop'](_0xbe14('0xea'));}if(!this[_0xbe14('0xa4')](_0x34126e[_0xbe14('0x7e')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xeb'));}if(!this[_0xbe14('0xa4')](_0x34126e[_0xbe14('0x7f')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xec'));}if(!this['isConfigured'](_0x34126e[_0xbe14('0x80')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xed'));}if(!this[_0xbe14('0xa4')](_0x34126e['text'])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xa8'));}this[_0xbe14('0xc')][_0xbe14('0xe5')]=!![];this['createSquareDetailsReport'](_0x34126e);this[_0xbe14('0x3e')](_0x34126e[_0xbe14('0x5c')],'in','','');this['channel'][_0xbe14('0xad')](util['format'](_0xbe14('0xee'),_0x34126e[_0xbe14('0x5c')]));var _0x55a5f1=this[_0xbe14('0x7c')][_0xbe14('0xcf')](this,_0x34126e);if(_0x55a5f1){for(var _0x3c900a in _0x55a5f1){if(_0x55a5f1[_0xbe14('0x93')](_0x3c900a)){if(_0x3c900a!==_0xbe14('0xef')){this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')]('DIALOGFLOW_%s',_0x3c900a[_0xbe14('0x6b')]()),_0x55a5f1[_0x3c900a]);}}}this[_0xbe14('0x3e')](_0x55a5f1[_0xbe14('0xe6')],'out','dialogflowV2',_0x55a5f1['providerResponse']);return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('DialogflowV2\x20Result\x20%s',_0x55a5f1['speech']));}return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x34126e,_0xbe14('0xf0'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0xf1')]=function(_0x3d381e){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0xf2'),_0x3d381e['label']));if(!this[_0xbe14('0xa4')](_0x3d381e[_0xbe14('0xf3')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xf4'));}if(!this['isConfigured'](_0x3d381e[_0xbe14('0xf5')])){return this['channel']['noop'](_0xbe14('0xf6'));}if(!this[_0xbe14('0xa4')](_0x3d381e['password'])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xf7'));}if(!this[_0xbe14('0xa4')](_0x3d381e[_0xbe14('0xf8')])){return this[_0xbe14('0xc')]['noop']('no\x20text\x20configured');}this[_0xbe14('0xc')]['bot']=!![];this[_0xbe14('0x33')](_0x3d381e);this[_0xbe14('0x3e')](_0x3d381e['text'],'in','','');this['channel']['noop'](util[_0xbe14('0x53')]('Trying\x20SestekNDA:\x20%s',_0x3d381e[_0xbe14('0x5c')]));var _0x418e8c=this['sestekNDA'][_0xbe14('0xcf')](this,_0x3d381e);if(_0x418e8c){for(var _0x30657c in _0x418e8c){if(_0x418e8c[_0xbe14('0x93')](_0x30657c)){this[_0xbe14('0xc')][_0xbe14('0xa3')](util['format'](_0xbe14('0xf9'),_0x30657c[_0xbe14('0x6b')]()),_0x418e8c[_0x30657c]);}}this[_0xbe14('0x3e')](_0x418e8c[_0xbe14('0xe6')],_0xbe14('0xe7'),'sesteknda','');if(_0x418e8c[_0xbe14('0xfa')]){this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x418e8c[_0xbe14('0xfa')]));var _0x4370be=this[_0xbe14('0xc')][_0xbe14('0xfb')](_0x418e8c[_0xbe14('0xfa')]);try{fs[_0xbe14('0xfc')](_0x418e8c['audiofile']+_0xbe14('0xfd'));}catch(_0x2632aa){logger[_0xbe14('0x29')](_0x2632aa);}return _0x4370be;}else{return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xfe'),_0x418e8c[_0xbe14('0xe6')]));}}return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x3d381e,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xbe14('0x13')][_0xbe14('0xff')]=function(_0x5869dd){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x100'),_0x5869dd[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xff'));};AGIVertices[_0xbe14('0x13')]['ext_dial']=function(_0x4514b2){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x101'),_0x4514b2[_0xbe14('0x35')]));var _0x4069a4='';if(_0x4514b2[_0xbe14('0x102')]){if(!this[_0xbe14('0xa4')](_0x4514b2[_0xbe14('0x102')])){return this['channel']['error'](_0x4514b2,'no\x20trunk\x20selected');}else{var _0xd97eb5=parseInt(_0x4514b2[_0xbe14('0x102')],0xa);if(isNaN(_0xd97eb5)){_0x4069a4=_0x4514b2['trunk_id'];}else{_0x4069a4=this[_0xbe14('0x103')][_0xbe14('0xcf')](this,_0x4514b2[_0xbe14('0x102')]);if(!_0x4069a4){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4514b2,_0xbe14('0x104'));}}}}else if(_0x4514b2[_0xbe14('0x105')]){_0x4069a4=_0x4514b2[_0xbe14('0x105')];}else{return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4514b2,_0xbe14('0x106'));}var _0x4de631=this[_0xbe14('0xc')]['exec'](_0xbe14('0xe1'),[util[_0xbe14('0x53')](_0xbe14('0x107'),_0x4069a4,_0x4514b2['phone']),_0x4514b2[_0xbe14('0x67')],_0x4514b2[_0xbe14('0xdf')],_0x4514b2['url']]);if(_0x4de631[_0xbe14('0xa2')]===-0x1){return _0x4de631;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0xe0'),_0xbe14('0xe1')));};AGIVertices['prototype'][_0xbe14('0x108')]=function(_0x514cf6){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x109'),_0x514cf6[_0xbe14('0x35')]));return this['channel']['noop'](_0xbe14('0x108'));};AGIVertices[_0xbe14('0x13')]['getdigits']=function(_0x5138e2){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x10a'),_0x5138e2[_0xbe14('0x35')]));if(_0x5138e2[_0xbe14('0xa6')]===0x0){return this[_0xbe14('0xa5')](_0x5138e2);}_0x5138e2[_0xbe14('0xa6')]-=0x1;if(!this[_0xbe14('0xa4')](_0x5138e2[_0xbe14('0x10b')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x5138e2,_0xbe14('0x10c'));}var _0x4958a4=this['getSound']['sync'](this,_0x5138e2[_0xbe14('0x10b')]);if(!_0x4958a4){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x5138e2,_0xbe14('0x10d'));}if(!this[_0xbe14('0xa4')](_0x5138e2[_0xbe14('0xd3')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0xbe14('0xd4'));}var _0x553ad2=this[_0xbe14('0xc')][_0xbe14('0x10e')](_0x4958a4,_0x5138e2[_0xbe14('0x10f')],_0x5138e2['maxdigit']);var _0x474eb4=_0x553ad2[_0xbe14('0xa2')]?_0x553ad2[_0xbe14('0xa2')][_0xbe14('0x48')]():'';logger[_0xbe14('0x2b')](_0xbe14('0x110'),JSON[_0xbe14('0x74')](_0x553ad2));if(_0x553ad2['result']===-0x1){this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x5138e2,_0x474eb4);return _0x553ad2;}else if(_0x553ad2['extra']==='timeout'){_0x553ad2[_0xbe14('0xa2')]=_0x474eb4[_0xbe14('0x98')]>=parseInt(_0x5138e2[_0xbe14('0x111')])?'x':'i';}else{_0x553ad2['result']=_0x474eb4[_0xbe14('0x98')]>=parseInt(_0x5138e2[_0xbe14('0x111')])&&_0x474eb4[_0xbe14('0x98')]<=parseInt(_0x5138e2[_0xbe14('0x112')])?'x':'i';}var _0x2f05cb=this[_0xbe14('0xa1')]['sync'](this,_0x5138e2[_0xbe14('0xd3')]);if(!_0x2f05cb){return this['channel'][_0xbe14('0x29')](_0x5138e2,_0xbe14('0xd5'));}this[_0xbe14('0xc')]['setVariable'](_0x2f05cb,_0x474eb4);if(this[_0xbe14('0xa4')](_0x5138e2[_0xbe14('0x113')])){var _0x5c69aa=parseInt(_0x5138e2[_0xbe14('0x113')],0xa);var _0x5ec2da=rs[_0xbe14('0x114')]({'charset':'*','length':_0x5c69aa});var _0x4afd57=_0x474eb4[_0xbe14('0x98')];if(_0x4afd57>0x0){if(_0x4afd57>_0x5c69aa){this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x5138e2,_0x5138e2[_0xbe14('0x115')]===_0xbe14('0x116')?_0x5ec2da+_0x474eb4[_0xbe14('0x117')](_0x5c69aa):_0x474eb4[_0xbe14('0x117')](0x0,_0x4afd57-_0x5c69aa)+_0x5ec2da);}else{this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x5138e2,rs[_0xbe14('0x114')]({'charset':'*','length':_0x4afd57}));}}else{this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x5138e2,'');}}else{this[_0xbe14('0x33')]['sync'](this,_0x5138e2,_0x474eb4);}return _0x553ad2;};AGIVertices[_0xbe14('0x13')][_0xbe14('0x118')]=function(_0x14803b){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x119'),_0x14803b[_0xbe14('0x35')]));return this[_0xbe14('0xb')](_0x14803b);};AGIVertices['prototype'][_0xbe14('0x11a')]=function(_0x4072de){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x11b'),_0x4072de[_0xbe14('0x35')]));this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x4072de,_0x4072de[_0xbe14('0x11c')]);return this['channel'][_0xbe14('0xad')](util['format']('GOAL\x20%s',_0x4072de[_0xbe14('0x11c')]));};AGIVertices[_0xbe14('0x13')]['awspolly']=function(_0x35abdc){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x11d'),_0x35abdc[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x35abdc[_0xbe14('0x88')])||!this[_0xbe14('0xa4')](_0x35abdc[_0xbe14('0x89')])){return this['channel']['noop'](_0xbe14('0x11e'));}if(!this['isConfigured'](_0x35abdc[_0xbe14('0x5c')])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xa8'));}this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x11f'),_0x35abdc[_0xbe14('0x5c')]));var _0x54bcf4=this['awsPolly']['sync'](this,_0x35abdc);if(_0x54bcf4){this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x120'),_0x54bcf4));var _0x25bd48=this[_0xbe14('0xc')][_0xbe14('0xfb')](_0x54bcf4);try{fs[_0xbe14('0xfc')](_0x54bcf4+'.wav');}catch(_0x9249c9){logger[_0xbe14('0x29')](_0x9249c9);}return _0x25bd48;}return this[_0xbe14('0xc')]['error'](_0x35abdc,_0xbe14('0x121'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x122')]=function(_0x41fc99){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x123'),_0x41fc99[_0xbe14('0x35')]));if(!this['isConfigured'](_0x41fc99[_0xbe14('0x88')])||!this[_0xbe14('0xa4')](_0x41fc99[_0xbe14('0x89')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0x11e'));}if(!this[_0xbe14('0xa4')](_0x41fc99['aws_bot_name'])){return this[_0xbe14('0xc')][_0xbe14('0xad')]('no\x20bot\x20name\x20configured');}if(!this[_0xbe14('0xa4')](_0x41fc99[_0xbe14('0x5c')])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xa8'));}this[_0xbe14('0xc')][_0xbe14('0xe5')]=!![];this[_0xbe14('0x33')](_0x41fc99);this[_0xbe14('0x3e')](_0x41fc99[_0xbe14('0x5c')],'in','','');this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x124'),_0x41fc99[_0xbe14('0x5c')]));var _0xa30e04=this[_0xbe14('0x125')][_0xbe14('0xcf')](this,_0x41fc99);if(_0xa30e04){for(var _0x4cb28e in _0xa30e04){if(_0xa30e04[_0xbe14('0x93')](_0x4cb28e)&&_[_0xbe14('0x94')](_0xa30e04[_0x4cb28e])){this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x126'),_0x4cb28e['toUpperCase']()),_0xa30e04[_0x4cb28e]);}}if(_['isNil'](_0xa30e04['message'])){return this[_0xbe14('0xc')][_0xbe14('0xad')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xbe14('0x3e')](_0xa30e04[_0xbe14('0x78')],_0xbe14('0xe7'),_0xbe14('0x127'),'');return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')]('Amazon\x20Lex\x20Result\x20%s',_0xa30e04[_0xbe14('0x78')]));}}return this['channel']['error'](_0x41fc99,_0xbe14('0x128'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x129')]=function(_0x4e82ee){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x12a'),_0x4e82ee[_0xbe14('0x35')],_0x4e82ee[_0xbe14('0x67')]));if(!this['isConfigured'](_0x4e82ee[_0xbe14('0x83')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xe4'));}var _0x398ead=_0xbe14('0x12b');var _0x610c2a=util[_0xbe14('0x53')]('%s/recordings/%s',FILES_PATH,rs[_0xbe14('0x114')](0x4));var _0x25206c=util['format']('%s.%s',_0x610c2a,_0x398ead);var _0x6a0f29=!![];if(_0x4e82ee[_0xbe14('0x12c')]===_0xbe14('0x12d')){_0x6a0f29=![];}var _0x1c4d28=this[_0xbe14('0xc')][_0xbe14('0x12e')](_0x610c2a,_0x398ead,_0x4e82ee['intKey'],_0x4e82ee[_0xbe14('0x67')],undefined,_0x6a0f29);if(_0x1c4d28[_0xbe14('0xa2')]!==-0x1){this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x12f'),_0x25206c));var _0x404327=this[_0xbe14('0x8d')][_0xbe14('0xcf')](this,_0x4e82ee,_0x25206c);if(_0x404327){for(var _0x14cec7 in _0x404327){if(_0x404327['hasOwnProperty'](_0x14cec7)){this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x130'),_0x14cec7[_0xbe14('0x6b')]()),_0x404327[_0x14cec7]);}}return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('GoogleASR\x20Result\x20%s',JSON[_0xbe14('0x74')](_0x404327)));}}return _0x1c4d28;};AGIVertices[_0xbe14('0x13')][_0xbe14('0x131')]=function(_0x4c7833){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x132'),_0x4c7833['label']));if(!this[_0xbe14('0xa4')](_0x4c7833['appid'])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x133'));}if(!this[_0xbe14('0xa4')](_0x4c7833[_0xbe14('0x134')])){return this[_0xbe14('0xc')][_0xbe14('0xad')]('no\x20appsecret\x20configured');}var _0x1cedec=_0xbe14('0x12b');var _0x1457f0=util[_0xbe14('0x53')](_0xbe14('0x135'),FILES_PATH,rs[_0xbe14('0x114')](0x4));var _0x2dac86=util['format'](_0xbe14('0x9c'),_0x1457f0,_0x1cedec);var _0x447653=!![];if(_0x4c7833[_0xbe14('0x12c')]===_0xbe14('0x12d')){_0x447653=![];}var _0x37a538=this[_0xbe14('0xc')][_0xbe14('0x12e')](_0x1457f0,_0x1cedec,_0x4c7833[_0xbe14('0x136')],_0x4c7833[_0xbe14('0x67')],undefined,_0x447653);if(_0x37a538[_0xbe14('0xa2')]!==-0x1){this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x137'),_0x2dac86));var _0x2c1fcc=this['tildeASR']['sync'](this,_0x4c7833,_0x2dac86);if(_0x2c1fcc){for(var _0x276bac in _0x2c1fcc){if(_0x2c1fcc[_0xbe14('0x93')](_0x276bac)){this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x138'),_0x276bac[_0xbe14('0x6b')]()),_0x2c1fcc[_0x276bac]);}}return this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')]('TildeASR\x20Result\x20%s',JSON[_0xbe14('0x74')](_0x2c1fcc)));}}return _0x37a538;};AGIVertices[_0xbe14('0x13')][_0xbe14('0x139')]=function(_0x1d343a){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1d343a['label']));return this['channel']['continueAt'](_0x1d343a['context'],_0x1d343a[_0xbe14('0x39')],_0x1d343a[_0xbe14('0x3a')]);};AGIVertices['prototype']['gotoif']=function(_0x40aec8){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x13a'),_0x40aec8[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x40aec8[_0xbe14('0x13b')])){return this[_0xbe14('0xc')]['error'](_0x40aec8,_0xbe14('0x13c'));}try{var _0x4b249c=eval(_0x40aec8[_0xbe14('0x13b')])?_0xbe14('0x13d'):_0xbe14('0x13e');this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x13f'),_0x40aec8[_0xbe14('0x13b')],_0x4b249c));return{'code':0xc8,'result':_0x4b249c};}catch(_0x38368c){return{'code':0xc8,'result':_0xbe14('0x13e')};}};AGIVertices[_0xbe14('0x13')]['gotoiftime']=function(_0x14e7b9){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x140'),_0x14e7b9[_0xbe14('0x35')]));if(!this['isConfigured'](_0x14e7b9['interval_id'])){return this[_0xbe14('0xc')]['error'](_0x14e7b9,'no\x20interval\x20configured');}var _0x11e166=this['getIntervals'][_0xbe14('0xcf')](this,_0x14e7b9[_0xbe14('0x141')]);if(!_0x11e166){return this['channel'][_0xbe14('0x29')](_0x14e7b9,'no\x20intervals\x20found');}for(var _0x28d646=0x0;_0x28d646<_0x11e166['length'];_0x28d646+=0x1){var _0x1f11dd=this[_0xbe14('0xc')][_0xbe14('0xa1')](util[_0xbe14('0x53')](_0xbe14('0x142'),_0x11e166[_0x28d646]));if(_0x1f11dd[_0xbe14('0xa2')]===-0x1){return _0x1f11dd;}logger['info'](util['format'](_0xbe14('0x143'),_0x11e166[_0x28d646],_0x1f11dd[_0xbe14('0x9f')]));if(_0x1f11dd[_0xbe14('0x9f')]===_0xbe14('0x13d')){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x143'),_0x11e166[_0x28d646],_0xbe14('0x13d')));this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('IFTIME\x20%s\x20%s',_0x11e166[_0x28d646],_0xbe14('0x13d')));return{'code':0xc8,'result':_0xbe14('0x13d')};}else{logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x143'),_0x11e166[_0x28d646],_0xbe14('0x13e')));this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x143'),_0x11e166[_0x28d646],_0xbe14('0x13e')));}}return{'code':0xc8,'result':_0xbe14('0x13e')};};AGIVertices['prototype']['hangup']=function(_0x5ddefd){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5ddefd[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0x144')]();};AGIVertices['prototype']['ispeechasr']=function(_0x42aa9f){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x145'),_0x42aa9f[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x42aa9f[_0xbe14('0x83')])){return this[_0xbe14('0xc')][_0xbe14('0xad')]('no\x20key\x20configured');}var _0x1013d7='wav';var _0x1f354a=util[_0xbe14('0x53')]('%s/recordings/%s',FILES_PATH,rs[_0xbe14('0x114')](0x4));var _0x41c648=util[_0xbe14('0x53')](_0xbe14('0x9c'),_0x1f354a,_0x1013d7);var _0x1d8912=!![];if(_0x42aa9f[_0xbe14('0x12c')]===_0xbe14('0x12d')){_0x1d8912=![];}var _0x2b53f8=this['channel'][_0xbe14('0x12e')](_0x1f354a,_0x1013d7,_0x42aa9f[_0xbe14('0x136')],_0x42aa9f[_0xbe14('0x67')],undefined,_0x1d8912);if(_0x2b53f8[_0xbe14('0xa2')]!==-0x1){this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x146'),_0x41c648));var _0x2c0438=this[_0xbe14('0x85')][_0xbe14('0xcf')](this,_0x42aa9f,_0x41c648);if(_0x2c0438){for(var _0x55ce2c in _0x2c0438){if(_0x2c0438[_0xbe14('0x93')](_0x55ce2c)){this['channel'][_0xbe14('0xa3')](util['format'](_0xbe14('0x147'),_0x55ce2c['toUpperCase']()),_0x2c0438[_0x55ce2c]);}}return this['channel'][_0xbe14('0xad')](util['format'](_0xbe14('0x148'),JSON['stringify'](_0x2c0438)));}}return _0x2b53f8;};AGIVertices[_0xbe14('0x13')]['ispeechtts']=function(_0x4743c2){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x149'),_0x4743c2[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x4743c2[_0xbe14('0x83')])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xe4'));}if(!this[_0xbe14('0xa4')](_0x4743c2[_0xbe14('0x5c')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xa8'));}this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('Trying\x20ispeech\x20TTS\x20%s',_0x4743c2[_0xbe14('0x5c')]));var _0x4252ea=this[_0xbe14('0x82')][_0xbe14('0xcf')](this,_0x4743c2);if(_0x4252ea){this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x146'),_0x4252ea));var _0x41df90=this[_0xbe14('0xc')][_0xbe14('0xfb')](_0x4252ea,_0x4743c2[_0xbe14('0x136')]);try{fs[_0xbe14('0xfc')](_0x4252ea+_0xbe14('0xfd'));}catch(_0x15832c){logger[_0xbe14('0x29')](_0x15832c);}return _0x41df90;}return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4743c2,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbe14('0x13')][_0xbe14('0x14a')]=function(_0x180f0c){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x14b'),_0x180f0c['label']));if(!this[_0xbe14('0xa4')](_0x180f0c[_0xbe14('0x14c')])){return this[_0xbe14('0xc')]['error'](_0x180f0c,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbe14('0xc')]['callerid'],_0x180f0c[_0xbe14('0x14c')]));var _0x2b4270=this[_0xbe14('0x51')][_0xbe14('0xcf')](this,_0x180f0c['findBy']);if(_0x2b4270){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x180f0c[_0xbe14('0x14c')]));this['channel'][_0xbe14('0xad')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')]['callerid'],_0x180f0c[_0xbe14('0x14c')]));return{'code':0xc8,'result':_0xbe14('0x14d')};}else{logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x14e'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x180f0c[_0xbe14('0x14c')]));this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x14e'),this['channel'][_0xbe14('0x36')],_0x180f0c[_0xbe14('0x14c')]));return{'code':0xc8,'result':_0xbe14('0x14f')};}};AGIVertices[_0xbe14('0x13')][_0xbe14('0x150')]=function(_0x537ec3){logger[_0xbe14('0x2b')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x537ec3[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x537ec3[_0xbe14('0x14c')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x537ec3,'no\x20find\x20by\x20configured');}logger['info'](util[_0xbe14('0x53')](_0xbe14('0x151'),this['channel'][_0xbe14('0x36')],_0x537ec3[_0xbe14('0x14c')]));var _0x30903d=this['agentLogout']['sync'](this,_0x537ec3[_0xbe14('0x14c')]);if(_0x30903d){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x537ec3['findBy']));this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x152'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x537ec3['findBy']));return{'code':0xc8,'result':_0xbe14('0x14d')};}else{logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x14e'),this[_0xbe14('0xc')]['callerid'],_0x537ec3[_0xbe14('0x14c')]));this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x14e'),this[_0xbe14('0xc')]['callerid'],_0x537ec3[_0xbe14('0x14c')]));return{'code':0xc8,'result':_0xbe14('0x14f')};}};AGIVertices['prototype']['math']=function(_0x4251f9){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x153'),_0x4251f9[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x4251f9['operation'])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4251f9,_0xbe14('0x154'));}this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0x155'),_0x4251f9[_0xbe14('0x156')]));var _0x3d4966=eval(_0x4251f9[_0xbe14('0x156')]);if(!this[_0xbe14('0xa4')](_0x4251f9[_0xbe14('0xd3')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0xd4'));}var _0x39806e=this['getVariable'][_0xbe14('0xcf')](this,_0x4251f9['variable_id']);if(!_0x39806e){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4251f9,'no\x20variable\x20found');}if(_[_0xbe14('0x97')](_0x3d4966)){var _0x5f2767=this;_0x3d4966[_0xbe14('0xd6')](function(_0x5ca292,_0x578551){_0x5f2767['channel'][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x157'),_0x39806e,_0x578551),_0x5ca292);});return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('variable\x20%s[key]\x20set',_0x39806e));}else{return this[_0xbe14('0xc')][_0xbe14('0xa3')](_0x39806e,_0x3d4966);}};AGIVertices[_0xbe14('0x13')][_0xbe14('0xa')]=function(_0x424422){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x158'),_0x424422['label']));if(_0x424422[_0xbe14('0xa6')]===0x0){return this[_0xbe14('0xa5')](_0x424422);}_0x424422[_0xbe14('0xa6')]-=0x1;if(!this[_0xbe14('0xa4')](_0x424422[_0xbe14('0x10b')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x424422,_0xbe14('0x10c'));}var _0x1a84a9=this['getSound'][_0xbe14('0xcf')](this,_0x424422['file_id']);if(!_0x1a84a9){return this['channel'][_0xbe14('0x29')](_0x424422,_0xbe14('0x10d'));}var _0x56df7f=this[_0xbe14('0xc')][_0xbe14('0x10e')](_0x1a84a9,_0x424422[_0xbe14('0x10f')],_0x424422[_0xbe14('0x159')]);var _0xfc3180=_0x56df7f[_0xbe14('0xa2')];if(_0x56df7f[_0xbe14('0xa2')]===-0x1){this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x424422,'-1');return _0x56df7f;}else if(_0x56df7f[_0xbe14('0x9f')]===_0xbe14('0x67')){_0x56df7f[_0xbe14('0xa2')]=_0x56df7f['result'][_0xbe14('0x98')]>0x0?_0x56df7f['result']:'t';}else if(_[_0xbe14('0x40')](_0x56df7f[_0xbe14('0xa2')])){_0x56df7f[_0xbe14('0xa2')]='#';_0xfc3180='#';}if(!this[_0xbe14('0xa4')](_0x424422['variable_id'])){this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0xd4'));}else{var _0x32f6d6=this[_0xbe14('0xa1')][_0xbe14('0xcf')](this,_0x424422[_0xbe14('0xd3')]);if(!_0x32f6d6){return this['channel'][_0xbe14('0x29')](_0x424422,_0xbe14('0xd5'));}this[_0xbe14('0xc')][_0xbe14('0xa3')](_0x32f6d6,_0xfc3180);}this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x424422,_0xfc3180);return _0x56df7f;};AGIVertices[_0xbe14('0x13')][_0xbe14('0xad')]=function(_0x4062d2){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x15a'),_0x4062d2[_0xbe14('0x35')]));return this[_0xbe14('0xc')]['noop'](_0x4062d2[_0xbe14('0x15b')]||_0x4062d2[_0xbe14('0x35')]);};AGIVertices[_0xbe14('0x13')]['pause']=function(_0x17fa4b){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x15c'),_0x17fa4b[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x17fa4b[_0xbe14('0x14c')])){return this['channel'][_0xbe14('0x29')](_0x17fa4b,_0xbe14('0x15d'));}logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x151'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x17fa4b[_0xbe14('0x14c')]));var _0x1ea046=this[_0xbe14('0x4a')][_0xbe14('0xcf')](this,_0x17fa4b['pause_id']);var _0x2b2a2b=this['agentPause'][_0xbe14('0xcf')](this,_0x17fa4b[_0xbe14('0x14c')],_0x1ea046);if(_0x2b2a2b){logger['info'](util['format'](_0xbe14('0x152'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x17fa4b[_0xbe14('0x14c')]));this[_0xbe14('0xc')][_0xbe14('0xad')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x17fa4b['findBy']));return{'code':0xc8,'result':_0xbe14('0x14d')};}else{logger['info'](util[_0xbe14('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x17fa4b['findBy']));this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x152'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x17fa4b['findBy']));return{'code':0xc8,'result':_0xbe14('0x14f')};}};AGIVertices[_0xbe14('0x13')]['playback']=function(_0x52232d){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x15e'),_0x52232d['label']));if(!this[_0xbe14('0xa4')](_0x52232d[_0xbe14('0x10b')])){return this[_0xbe14('0xc')]['error'](_0x52232d,_0xbe14('0x10c'));}var _0x5acfca=this[_0xbe14('0x1c')][_0xbe14('0xcf')](this,_0x52232d[_0xbe14('0x10b')]);if(!_0x5acfca){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x52232d,_0xbe14('0x10d'));}var _0x5b8223=this[_0xbe14('0xc')][_0xbe14('0x56')]('PLAYBACK',[_0x5acfca,_0x52232d[_0xbe14('0xdf')]]);if(_0x5b8223['result']===-0x1){return _0x5b8223;}return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')]('Executed\x20command\x20%s\x20%s',_0xbe14('0x15f'),_0x5acfca));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x160')]=function(_0x301d43){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x161'),_0x301d43[_0xbe14('0x35')]));if(!this['isConfigured'](_0x301d43['queue_id'])){return this['channel'][_0xbe14('0x29')](_0x301d43,'no\x20queue\x20selected');}var _0x5cc749='';var _0x6ddb17=parseInt(_0x301d43[_0xbe14('0x162')],0xa);if(isNaN(_0x6ddb17)){_0x5cc749=_0x301d43[_0xbe14('0x162')];}else{_0x5cc749=this['getVoiceQueue']['sync'](this,_0x301d43[_0xbe14('0x162')]);if(!_0x5cc749){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x301d43,_0xbe14('0x163'));}}var _0x35b93a='';if(this[_0xbe14('0xa4')](_0x301d43[_0xbe14('0x10b')])){var _0x59d566=this[_0xbe14('0x1c')][_0xbe14('0xcf')](this,_0x301d43[_0xbe14('0x10b')]);if(_0x59d566){_0x35b93a=_0x59d566;}}this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x301d43,_0x5cc749);if(_0x301d43[_0xbe14('0xdf')]['indexOf']('x')<0x0){_0x301d43[_0xbe14('0xdf')]+='x';}if(_0x301d43[_0xbe14('0xdf')]['indexOf']('X')<0x0){_0x301d43[_0xbe14('0xdf')]+='X';}this[_0xbe14('0xc')][_0xbe14('0xa3')](_0xbe14('0x164'),_0x5cc749?_0x5cc749[_0xbe14('0x165')]():'');var _0x4a1e5a=this[_0xbe14('0xc')][_0xbe14('0x56')](_0xbe14('0x166'),[_0x5cc749,_0x301d43[_0xbe14('0xdf')],_0x301d43[_0xbe14('0x65')],_0x35b93a,_0x301d43['timeout'],_0x301d43[_0xbe14('0xb5')],_0x301d43['macro'],_0x301d43[_0xbe14('0x167')],'',_0x301d43[_0xbe14('0x168')]]);if(_0x4a1e5a['result']===-0x1){return _0x4a1e5a;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xbe'),_0xbe14('0x166'),_0x5cc749));};AGIVertices[_0xbe14('0x13')]['record']=function(_0x180362){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x169'),_0x180362[_0xbe14('0x35')]));var _0x14f5f6=_0x180362[_0xbe14('0x16a')]||_0xbe14('0x12b');var _0xe6a6ee=util[_0xbe14('0x53')]('%s_%s',this[_0xbe14('0xc')][_0xbe14('0x34')],rs[_0xbe14('0x114')](0x5));var _0x12a598=util[_0xbe14('0x53')]('%s/recordings/%s.%s',FILES_PATH,_0xe6a6ee,_0x14f5f6);var _0x41ed52=util['format'](_0xbe14('0x135'),FILES_PATH,_0xe6a6ee);this[_0xbe14('0x37')]['sync'](this,_0x180362,_0xe6a6ee,_0x12a598);this[_0xbe14('0xc')][_0xbe14('0xa3')](_0xbe14('0x16b'),_0xe6a6ee);logger[_0xbe14('0x2b')](_0xbe14('0x16c'),_0x41ed52,_0x14f5f6,_0x180362[_0xbe14('0x16d')],_0x180362[_0xbe14('0x67')]);return this[_0xbe14('0xc')][_0xbe14('0x12e')](_0x41ed52,_0x14f5f6,_0x180362[_0xbe14('0x16d')],_0x180362[_0xbe14('0x67')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x11dfb2){logger['info'](util[_0xbe14('0x53')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x11dfb2[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x11dfb2[_0xbe14('0x65')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0x16e'));}var _0x338729=this[_0xbe14('0x64')][_0xbe14('0xcf')](this,_0x11dfb2);logger['info'](util[_0xbe14('0x53')](_0xbe14('0x16f'),util['inspect'](_0x338729,{'showHidden':![],'depth':null})));if(!this[_0xbe14('0xa4')](_0x11dfb2[_0xbe14('0xd3')])){return this['channel'][_0xbe14('0xad')](_0xbe14('0x170'));}var _0x166b13=this['getVariable']['sync'](this,_0x11dfb2[_0xbe14('0xd3')]);if(!_0x166b13){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x11dfb2,_0xbe14('0xd5'));}this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x171'),_0x166b13),_0x338729[_0xbe14('0x76')]?_0x338729[_0xbe14('0x76')]:'200');this[_0xbe14('0xc')][_0xbe14('0xa3')](util[_0xbe14('0x53')](_0xbe14('0x172'),_0x166b13),_0x338729[_0xbe14('0x77')]?_0x338729[_0xbe14('0x77')]:'OK');if(_0x338729[_0xbe14('0x73')]){try{this[_0xbe14('0x9a')](_0x338729[_0xbe14('0x73')],_0x166b13);}catch(_0x35d02a){logger[_0xbe14('0x29')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x166b13));}}return this['channel']['noop'](util[_0xbe14('0x53')](_0xbe14('0x173'),_0x166b13));};AGIVertices['prototype'][_0xbe14('0x174')]=function(_0x28bd09){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x175'),_0x28bd09[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0x176')](_0x28bd09[_0xbe14('0x177')][_0xbe14('0x58')](/\s+/g,''),_0x28bd09['escape_digits']);};AGIVertices[_0xbe14('0x13')][_0xbe14('0x178')]=function(_0x148d0d){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x179'),_0x148d0d[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0x17a')](_0x148d0d[_0xbe14('0x17b')][_0xbe14('0x58')](/\s+/g,''),_0x148d0d[_0xbe14('0x16d')]);};AGIVertices[_0xbe14('0x13')][_0xbe14('0x17c')]=function(_0x16aade){logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x17d'),_0x16aade[_0xbe14('0x35')]));return this['channel'][_0xbe14('0x17e')](_0x16aade[_0xbe14('0x5c')],_0x16aade[_0xbe14('0x16d')]);};AGIVertices[_0xbe14('0x13')]['sendMail']=function(_0x3b35f4){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x17f'),_0x3b35f4[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x3b35f4[_0xbe14('0x180')])){return this[_0xbe14('0xc')]['noop']('no\x20mail\x20account\x20configured');}var _0x292b46=this['getMailAccount']['sync'](this,_0x3b35f4[_0xbe14('0x180')]);if(!_0x292b46||!_0x292b46[_0xbe14('0x181')]){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x3b35f4,_0xbe14('0x182'));}var _0x550dc2={'from':util[_0xbe14('0x53')](_0xbe14('0x183'),_0x292b46[_0xbe14('0x11')],_0x292b46[_0xbe14('0x184')]||_0x292b46[_0xbe14('0x181')][_0xbe14('0x185')]),'to':_0x3b35f4['to']||'','cc':_0x3b35f4['cc']||'','bcc':_0x3b35f4[_0xbe14('0x186')]||'','subject':_0x3b35f4['subject'],'html':_0x3b35f4[_0xbe14('0x5c')],'text':_0x3b35f4[_0xbe14('0x5c')]};if(this[_0xbe14('0xa4')](_0x3b35f4['template_id'])){}logger[_0xbe14('0xd9')]('sendMail\x20message',JSON[_0xbe14('0x74')](_0x550dc2));this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x3b35f4,_0x3b35f4['account_id']);this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x187'),_0x292b46['name']));this['sendMailMessage'][_0xbe14('0xcf')](this,_0x292b46[_0xbe14('0x188')],_0x550dc2);return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x189'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x18a')]=function(_0x9cf913){logger['info'](util[_0xbe14('0x53')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x9cf913[_0xbe14('0x35')]));return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x18b'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x18c')]=function(_0x84680){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x18d'),_0x84680[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x84680[_0xbe14('0x18e')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x18f'));}var _0x31ba8f=this[_0xbe14('0x31')]['sync'](this,_0x84680[_0xbe14('0x18e')]);if(!_0x31ba8f){return this['channel']['error'](_0x84680,_0xbe14('0x190'));}var _0x4fc628={'body':_0x84680['sms_text'],'phone':_0x84680['to']||'','SmsAccountId':_0x31ba8f['id']};logger[_0xbe14('0xd9')](_0xbe14('0x191'),JSON[_0xbe14('0x74')](_0x4fc628));this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x84680,_0x84680[_0xbe14('0x18e')]);this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')](_0xbe14('0x192'),_0x31ba8f[_0xbe14('0x11')]));this[_0xbe14('0x32')][_0xbe14('0xcf')](this,_0x4fc628);return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x193'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x194')]=function(_0x4389e0){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4389e0[_0xbe14('0x35')]));if(!this['isConfigured'](_0x4389e0[_0xbe14('0xd3')])){return this[_0xbe14('0xc')]['error'](_0x4389e0,_0xbe14('0x195'));}var _0x248f6e=this[_0xbe14('0xa1')][_0xbe14('0xcf')](this,_0x4389e0[_0xbe14('0xd3')]);if(!_0x248f6e){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x4389e0,_0xbe14('0xd5'));}return this['channel'][_0xbe14('0xa3')](_0x248f6e,_0x4389e0[_0xbe14('0x196')]);};AGIVertices['prototype'][_0xbe14('0x197')]=function(_0x11cc51){logger[_0xbe14('0x2b')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x11cc51[_0xbe14('0x35')]));this['channel'][_0xbe14('0xad')](_0xbe14('0x198'));var _0x1b35b7=this[_0xbe14('0xc')]['getVariable']('XMCS-UNIQUEID');if(!_['isEmpty'](_0x1b35b7['extra'])){this['channel'][_0xbe14('0x34')]=_0x1b35b7['extra'];}if(_0x11cc51[_0xbe14('0xb7')]===_0xbe14('0x199')){this[_0xbe14('0xc')][_0xbe14('0xad')]('Answer');return this['channel'][_0xbe14('0xb7')]();}return this['channel']['noop'](_0xbe14('0x19a'));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x19b')]=function(_0x535de5){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x19c'),_0x535de5[_0xbe14('0x35')]));if(!this['isConfigured'](_0x535de5[_0xbe14('0x19d')])){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x535de5,_0xbe14('0x19e'));}var _0xe1af62=this['getSquareProject'][_0xbe14('0xcf')](this,_0x535de5['project_id']);if(!this[_0xbe14('0xa4')](_0xe1af62)){return this['channel']['error'](_0x535de5,util['format'](_0xbe14('0x19f'),_0x535de5[_0xbe14('0x19d')]));}if(_0xe1af62===this[_0xbe14('0xc')]['arg_1']){return this[_0xbe14('0xc')]['error'](_0x535de5,_0xbe14('0x1a0'));}this['createSquareDetailsReport'][_0xbe14('0xcf')](this,_0x535de5,_0xe1af62);var _0x301db4=this[_0xbe14('0xc')][_0xbe14('0x56')](_0xbe14('0x1a1'),util[_0xbe14('0x53')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0xbe14('0x1a2'),_0xe1af62,this['channel']['arg_1']));if(_0x301db4[_0xbe14('0xa2')]===-0x1){return _0x301db4;}return this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xbe'),_0xbe14('0x1a1'),_0xe1af62));};AGIVertices[_0xbe14('0x13')]['system']=function(_0x296ced){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x296ced[_0xbe14('0x35')]));var _0x1ee2c2=this[_0xbe14('0x55')][_0xbe14('0xcf')](this,_0x296ced[_0xbe14('0x1a3')]);this[_0xbe14('0x33')][_0xbe14('0xcf')](this,_0x296ced,_0x296ced[_0xbe14('0x1a3')]);if(this['isConfigured'](_0x296ced[_0xbe14('0xd3')])){var _0x897ee1=this['getVariable']['sync'](this,_0x296ced[_0xbe14('0xd3')]);if(_0x897ee1){this[_0xbe14('0xc')][_0xbe14('0xa3')](_0x897ee1,_0x1ee2c2);return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x296ced['command'],_0x897ee1));}}return this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')](_0xbe14('0x1a4'),_0x296ced[_0xbe14('0x1a3')]));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x1a5')]=function(_0x1a057b){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x1a6'),_0x1a057b['label']));_0x1a057b[_0xbe14('0x5c')]=_0x1a057b[_0xbe14('0x5c')][_0xbe14('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbe14('0xa4')](_0x1a057b[_0xbe14('0x5a')])){return this[_0xbe14('0xc')][_0xbe14('0xad')](_0xbe14('0x1a7'));}if(!this['isConfigured'](_0x1a057b[_0xbe14('0x5c')])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xa8'));}this['channel'][_0xbe14('0xad')](util[_0xbe14('0x53')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1a057b[_0xbe14('0x5c')]));var _0x54debf=this['googleCloudTTS'][_0xbe14('0xcf')](this,_0x1a057b);if(_0x54debf){this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')](_0xbe14('0x1a8'),_0x54debf));var _0x52e21f=this[_0xbe14('0xc')][_0xbe14('0xfb')](_0x54debf);try{fs[_0xbe14('0xfc')](_0x54debf+_0xbe14('0xfd'));}catch(_0x22d382){logger['error'](_0x22d382);}return _0x52e21f;}return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x1a057b,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbe14('0x13')]['tts']=function(_0x375ad6){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x375ad6[_0xbe14('0x35')]));_0x375ad6[_0xbe14('0x5c')]=_0x375ad6['text'][_0xbe14('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x375ad6[_0xbe14('0x5c')])){return this[_0xbe14('0xc')]['noop'](_0xbe14('0xa8'));}this[_0xbe14('0xc')][_0xbe14('0xad')](util['format'](_0xbe14('0x1a9'),_0x375ad6[_0xbe14('0x5c')]));var _0x1baa53=this['googleTTS']['sync'](this,_0x375ad6);if(_0x1baa53){this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('Google\x20TTS\x20%s\x20file\x20created',_0x1baa53));var _0x27c20e=this[_0xbe14('0xc')]['streamFile'](_0x1baa53);try{fs[_0xbe14('0xfc')](_0x1baa53+'.wav');}catch(_0x5af6c7){logger[_0xbe14('0x29')](_0x5af6c7);}return _0x27c20e;}return this['channel'][_0xbe14('0x29')](_0x375ad6,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbe14('0x13')][_0xbe14('0x1aa')]=function(_0x204a86){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x1ab'),_0x204a86[_0xbe14('0x35')]));if(!this['isConfigured'](_0x204a86[_0xbe14('0x14c')])){return this['channel'][_0xbe14('0x29')](_0x204a86,_0xbe14('0x15d'));}logger['info'](util[_0xbe14('0x53')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbe14('0xc')]['callerid'],_0x204a86['findBy']));var _0x184963=this['agentUnpause'][_0xbe14('0xcf')](this,_0x204a86['findBy']);if(_0x184963){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x204a86[_0xbe14('0x14c')]));this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbe14('0xc')][_0xbe14('0x36')],_0x204a86[_0xbe14('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbe14('0x2b')](util['format'](_0xbe14('0x14e'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x204a86[_0xbe14('0x14c')]));this[_0xbe14('0xc')]['noop'](util[_0xbe14('0x53')](_0xbe14('0x14e'),this[_0xbe14('0xc')][_0xbe14('0x36')],_0x204a86[_0xbe14('0x14c')]));return{'code':0xc8,'result':_0xbe14('0x14f')};}};AGIVertices[_0xbe14('0x13')]['voicemail']=function(_0x5ee130){logger['info'](util[_0xbe14('0x53')](_0xbe14('0x1ac'),_0x5ee130[_0xbe14('0x35')]));var _0x214a80=this[_0xbe14('0xc')][_0xbe14('0x56')](_0xbe14('0x1ad'),[_0x5ee130[_0xbe14('0x1ae')],_0x5ee130['options']]);if(_0x214a80[_0xbe14('0xa2')]===-0x1){return _0x214a80;}return this[_0xbe14('0xc')][_0xbe14('0xad')](util[_0xbe14('0x53')](_0xbe14('0xbe'),_0xbe14('0x1ad'),_0x5ee130['mailbox']));};AGIVertices[_0xbe14('0x13')][_0xbe14('0x1af')]=function(_0x564b31){logger[_0xbe14('0x2b')](util[_0xbe14('0x53')](_0xbe14('0x1b0'),_0x564b31[_0xbe14('0x35')]));if(!this[_0xbe14('0xa4')](_0x564b31[_0xbe14('0xd3')])){return this['channel']['error'](_0x564b31,_0xbe14('0x195'));}var _0x43bf1c=this[_0xbe14('0xa1')][_0xbe14('0xcf')](this,_0x564b31[_0xbe14('0xd3')]);if(!_0x43bf1c){return this[_0xbe14('0xc')][_0xbe14('0x29')](_0x564b31,_0xbe14('0xd5'));}var _0x262655=this[_0xbe14('0xc')][_0xbe14('0xa1')](_0x43bf1c);return{'code':0xc8,'result':_0x262655[_0xbe14('0x9f')]?_0x262655[_0xbe14('0x9f')]:'-'};};String['prototype'][_0xbe14('0x9e')]=function(_0x598fb2,_0x4c9caf){return this[_0xbe14('0x9d')](_0x598fb2)[_0xbe14('0x1b1')](_0x4c9caf);};module[_0xbe14('0x1b2')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 994fd28..a539787 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 _0x4213=['[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','isUndefined','linkedid','attended','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','syncAgentRingNoAnswer','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','prototype','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','getAgent','voicePause','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','finally','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer'];(function(_0x589370,_0x5c801c){var _0x336554=function(_0x555b19){while(--_0x555b19){_0x589370['push'](_0x589370['shift']());}};_0x336554(++_0x5c801c);}(_0x4213,0x77));var _0x3421=function(_0x3e5f2c,_0x54a371){_0x3e5f2c=_0x3e5f2c-0x0;var _0x4bc57e=_0x4213[_0x3e5f2c];return _0x4bc57e;};'use strict';var _=require(_0x3421('0x0'));var moment=require(_0x3421('0x1'));var ami=require(_0x3421('0x2'));var logger=require(_0x3421('0x3'))(_0x3421('0x4'));var RpcUser=require(_0x3421('0x5'));var RpcVoiceAgentReport=require(_0x3421('0x6'));function Acw(_0x5a303d){this[_0x3421('0x7')]=_0x5a303d['voiceQueues'];this[_0x3421('0x8')]=_0x5a303d[_0x3421('0x8')];this[_0x3421('0x9')]=_0x5a303d[_0x3421('0x9')];this['channels']={};ami['on'](_0x3421('0xa'),this[_0x3421('0xb')][_0x3421('0xc')](this));ami['on'](_0x3421('0xd'),this[_0x3421('0xe')]['bind'](this));ami['on'](_0x3421('0xf'),this['syncHangup']['bind'](this));ami['on'](_0x3421('0x10'),this['syncAgentRingNoAnswer'][_0x3421('0xc')](this));ami['on'](_0x3421('0x11'),this[_0x3421('0x12')][_0x3421('0xc')](this));ami['on'](_0x3421('0x13'),this[_0x3421('0x14')][_0x3421('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0x3421('0x15')][_0x3421('0xc')](this));}function getDiff(_0xb4ea90){var _0x15eef0=moment()[_0x3421('0x16')](0x0);var _0x3f4672=moment(_0xb4ea90)[_0x3421('0x16')](0x0);return _0x15eef0['diff'](_0x3f4672,_0x3421('0x17'));}Acw['prototype'][_0x3421('0x18')]=function(_0x5257ad,_0x59ae45){var _0x1e33ab=this;var _0x4c6f7b=getDiff(_0x1e33ab[_0x3421('0x9')][_0x5257ad][_0x3421('0x19')]);clearTimeout(_0x1e33ab['timers'][_0x5257ad][_0x3421('0x1a')]);_0x1e33ab[_0x3421('0x9')][_0x5257ad][_0x3421('0x1a')]=![];return RpcVoiceAgentReport[_0x3421('0x1b')]({'acwtime':_0x4c6f7b},_0x1e33ab[_0x3421('0x9')][_0x5257ad][_0x3421('0x1c')],_0x5257ad)[_0x3421('0x1d')](function(_0x66a57a){logger[_0x3421('0x1e')](_0x3421('0x1f'),_0x59ae45,_0x4c6f7b,_0x66a57a);})[_0x3421('0x20')](function(_0x50d9a5){logger[_0x3421('0x21')]('[%s][UPDATE][ERRORS:%s]',_0x59ae45,_0x50d9a5);})['finally'](function(){delete _0x1e33ab['timers'][_0x5257ad];});};Acw[_0x3421('0x22')][_0x3421('0x23')]=function(_0x45f826){try{var _0x256cc5=this;var _0x132e8e=this[_0x3421('0x24')][_0x45f826][_0x3421('0x25')];var _0x705591=this[_0x3421('0x24')][_0x45f826][_0x3421('0x26')];var _0x48fb3d=this['voiceQueues'][_0x705591];var _0x494423=![];var _0x3fef90=_0x3421('0x27');if(_0x48fb3d[_0x3421('0x28')]&&_0x48fb3d['mandatoryDispositionPause']['name']){_0x494423=!![];_0x3fef90=_0x48fb3d[_0x3421('0x29')]['name'];}return ami[_0x3421('0x2a')]({'action':'QueuePause','interface':_0x132e8e,'paused':!![],'reason':_0x3fef90})[_0x3421('0x1d')](function(){if(_0x256cc5[_0x3421('0x8')][_0x132e8e]){return RpcUser[_0x3421('0x2b')](_0x256cc5[_0x3421('0x8')][_0x132e8e]['id'])[_0x3421('0x1d')](function(_0x5df4dc){if(!_0x5df4dc||_0x5df4dc[_0x3421('0x2c')]){logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x45f826,_0x132e8e,_0x705591);return;}logger[_0x3421('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x45f826,_0x132e8e,_0x705591);var _0x5074a2=_0x256cc5[_0x3421('0x24')][_0x45f826]['attended']&&_0x256cc5[_0x3421('0x24')][_0x45f826]['destlinkedid']?_0x256cc5[_0x3421('0x24')][_0x45f826][_0x3421('0x2d')]:_0x45f826;return RpcUser['savePause'](_0x256cc5[_0x3421('0x8')][_0x132e8e],_0x3fef90,_0x5074a2)[_0x3421('0x1d')](function(_0x420349){_0x256cc5['voiceQueues'][_0x705591][_0x3421('0x2e')]-=0x1;_0x256cc5['voiceQueues'][_0x705591][_0x3421('0x2f')]+=0x1;return _0x420349;});})[_0x3421('0x1d')](function(_0x1045ab){if(_0x494423||!_0x1045ab){return;}_0x256cc5[_0x3421('0x9')][_0x132e8e]={};logger[_0x3421('0x1e')](_0x3421('0x30'),_0x45f826,_0x256cc5[_0x3421('0x7')][_0x705591][_0x3421('0x31')],_0x132e8e,_0x705591);_0x256cc5[_0x3421('0x9')][_0x132e8e][_0x3421('0x1a')]=setTimeout(_0x256cc5['stopAcw']['bind'](_0x256cc5,_0x132e8e),_0x256cc5[_0x3421('0x7')][_0x705591][_0x3421('0x31')]*0x3e8);_0x256cc5['timers'][_0x132e8e][_0x3421('0x19')]=moment()[_0x3421('0x32')](_0x3421('0x33'));_0x256cc5[_0x3421('0x9')][_0x132e8e][_0x3421('0x1c')]=_0x45f826;_0x256cc5['timers'][_0x132e8e][_0x3421('0x26')]=_0x705591;_0x256cc5[_0x3421('0x9')][_0x132e8e][_0x3421('0x18')]=_0x256cc5['updateAcw'][_0x3421('0xc')](_0x256cc5,_0x132e8e,_0x45f826);});}})['catch'](function(){logger[_0x3421('0x21')](_0x3421('0x30'),_0x45f826,_0x256cc5[_0x3421('0x7')][_0x705591][_0x3421('0x31')],_0x132e8e,_0x705591);})[_0x3421('0x34')](function(){delete _0x256cc5[_0x3421('0x24')][_0x45f826];});}catch(_0x22f45e){logger['error']('[ACW][START]\x20%s',_0x22f45e['message']);}};Acw[_0x3421('0x22')]['stopAcw']=function(_0x5a56b8){try{var _0xbe9181=this;if(_0xbe9181['timers'][_0x5a56b8]){_0xbe9181[_0x3421('0x9')][_0x5a56b8][_0x3421('0x1a')]=![];var _0x497aa3=_0xbe9181[_0x3421('0x9')][_0x5a56b8][_0x3421('0x1c')];var _0x83cb95=_0xbe9181[_0x3421('0x9')][_0x5a56b8]['queue'];var _0x39990d=_0xbe9181[_0x3421('0x7')][_0x83cb95][_0x3421('0x31')];logger[_0x3421('0x1e')](_0x3421('0x35'),_0x497aa3,_0x5a56b8);RpcUser['getAgent'](this[_0x3421('0x8')][_0x5a56b8]['id'])[_0x3421('0x1d')](function(_0x5e3a2f){if(_0x5e3a2f[_0x3421('0x36')]==='ACW'){return RpcUser['saveUnpause'](_0xbe9181['agents'][_0x5a56b8]);}});RpcVoiceAgentReport[_0x3421('0x1b')]({'acwtime':_0x39990d,'agentacw':!![]},_0x497aa3,_0x5a56b8)[_0x3421('0x1d')](function(_0x41bdb7){logger[_0x3421('0x1e')](_0x3421('0x1f'),_0x497aa3,_0x39990d,_0x41bdb7);})[_0x3421('0x20')](function(_0xe7fdfb){logger[_0x3421('0x21')](_0x3421('0x37'),_0x497aa3,_0xe7fdfb);});}else{logger[_0x3421('0x21')](_0x3421('0x38'),_0x5a56b8);if(_0xbe9181[_0x3421('0x9')]){logger[_0x3421('0x1e')](_0x3421('0x39'),JSON['stringify'](_0xbe9181[_0x3421('0x9')]));}}}catch(_0x2e7c59){logger[_0x3421('0x21')](_0x3421('0x3a'),_0x2e7c59['message']);}};Acw[_0x3421('0x22')]['syncAgentConnect']=function(_0x2e8761){try{if(this[_0x3421('0x7')][_0x2e8761[_0x3421('0x26')]]&&(this[_0x3421('0x7')][_0x2e8761[_0x3421('0x26')]][_0x3421('0x4')]||this[_0x3421('0x7')][_0x2e8761[_0x3421('0x26')]][_0x3421('0x28')])){if(this[_0x3421('0x8')][_0x2e8761[_0x3421('0x25')]]){this[_0x3421('0x24')][_0x2e8761[_0x3421('0x1c')]]={'queue':_0x2e8761['queue'],'interface':_0x2e8761[_0x3421('0x25')],'destlinkedid':_0x2e8761['destlinkedid']};}}}catch(_0x1a029b){logger[_0x3421('0x21')](_0x3421('0x3b'),_0x1a029b[_0x3421('0x3c')]);}};Acw[_0x3421('0x22')][_0x3421('0x15')]=function(_0x2a11a3){try{if(this[_0x3421('0x7')][_0x2a11a3[_0x3421('0x26')]]&&(this[_0x3421('0x7')][_0x2a11a3['queue']][_0x3421('0x4')]||this[_0x3421('0x7')][_0x2a11a3[_0x3421('0x26')]]['mandatoryDisposition'])){if(this['agents'][_0x2a11a3[_0x3421('0x25')]]){this[_0x3421('0x24')][_0x2a11a3[_0x3421('0x1c')]]={'queue':_0x2a11a3['queue'],'interface':_0x2a11a3[_0x3421('0x25')]};}}}catch(_0x18eba6){logger[_0x3421('0x21')](_0x3421('0x3d'),_0x18eba6['message']);}};Acw[_0x3421('0x22')][_0x3421('0xe')]=function(_0x3f7ff3){try{if(this['channels'][_0x3f7ff3['uniqueid']]&&_['isUndefined'](this[_0x3421('0x24')][_0x3f7ff3[_0x3421('0x1c')]]['attended'])){logger['info'](_0x3421('0x3e'),_0x3f7ff3[_0x3421('0x1c')]);this[_0x3421('0x23')](_0x3f7ff3[_0x3421('0x1c')]);}else if(this[_0x3421('0x24')][_0x3f7ff3['linkedid']]&&_[_0x3421('0x3f')](this[_0x3421('0x24')][_0x3f7ff3[_0x3421('0x40')]][_0x3421('0x41')])){logger['info'](_0x3421('0x42'),_0x3f7ff3[_0x3421('0x40')]);this[_0x3421('0x23')](_0x3f7ff3['linkedid']);}}catch(_0x5f97d5){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x5f97d5[_0x3421('0x3c')]);}};Acw['prototype'][_0x3421('0x43')]=function(_0x7e0c6c){try{if(this[_0x3421('0x24')][_0x7e0c6c['uniqueid']]&&this[_0x3421('0x24')][_0x7e0c6c[_0x3421('0x1c')]][_0x3421('0x41')]){logger[_0x3421('0x1e')](_0x3421('0x44'),_0x7e0c6c[_0x3421('0x1c')]);this[_0x3421('0x23')](_0x7e0c6c[_0x3421('0x1c')]);}else if(this[_0x3421('0x24')][_0x7e0c6c['linkedid']]&&this[_0x3421('0x24')][_0x7e0c6c[_0x3421('0x40')]]['attended']){logger[_0x3421('0x1e')](_0x3421('0x45'),_0x7e0c6c[_0x3421('0x40')]);this['startAcw'](_0x7e0c6c[_0x3421('0x40')]);}}catch(_0x27085d){logger[_0x3421('0x21')](_0x3421('0x46'),_0x27085d[_0x3421('0x3c')]);}};Acw[_0x3421('0x22')][_0x3421('0x12')]=function(_0x3254aa){try{if(!_[_0x3421('0x47')](this[_0x3421('0x24')][_0x3254aa[_0x3421('0x48')]])){this[_0x3421('0x23')](_0x3254aa[_0x3421('0x48')]);if(this[_0x3421('0x24')][_0x3254aa[_0x3421('0x49')]]){this['channels'][_0x3254aa[_0x3421('0x49')]][_0x3421('0x41')]=!![];this[_0x3421('0x24')][_0x3254aa[_0x3421('0x4a')]]=this[_0x3421('0x24')][_0x3254aa[_0x3421('0x49')]];delete this[_0x3421('0x24')][_0x3254aa[_0x3421('0x49')]];}}else if(!_['isNil'](this[_0x3421('0x24')][_0x3254aa['transfertargetuniqueid']])){this[_0x3421('0x23')](_0x3254aa[_0x3421('0x4a')]);if(this[_0x3421('0x24')][_0x3254aa[_0x3421('0x4b')]]){this['channels'][_0x3254aa[_0x3421('0x4b')]][_0x3421('0x41')]=!![];this[_0x3421('0x24')][_0x3254aa[_0x3421('0x48')]]=this[_0x3421('0x24')][_0x3254aa[_0x3421('0x4b')]];delete this['channels'][_0x3254aa[_0x3421('0x4b')]];}}}catch(_0x1d23f1){logger[_0x3421('0x21')](_0x3421('0x4c'),_0x1d23f1[_0x3421('0x3c')]);}};Acw[_0x3421('0x22')][_0x3421('0x14')]=function(_0x3d7c9a){try{if(this['channels'][_0x3d7c9a[_0x3421('0x4d')]]){logger[_0x3421('0x1e')](_0x3421('0x4e'),JSON[_0x3421('0x4f')](_0x3d7c9a[_0x3421('0x4d')]));this['startAcw'](_0x3d7c9a['transfereruniqueid']);}else if(this[_0x3421('0x24')][_0x3d7c9a[_0x3421('0x50')]]){logger[_0x3421('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x3421('0x4f')](_0x3d7c9a['transfererlinkedid']));this[_0x3421('0x23')](_0x3d7c9a['transfererlinkedid']);}}catch(_0x4f23c5){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x4f23c5['message']);}};Acw[_0x3421('0x22')][_0x3421('0x51')]=function(_0x2f64a4){try{if(this[_0x3421('0x7')][_0x2f64a4[_0x3421('0x26')]]&&this[_0x3421('0x7')][_0x2f64a4[_0x3421('0x26')]][_0x3421('0x52')]===_0x3421('0x53')){if(this[_0x3421('0x8')][_0x2f64a4['interface']]){logger[_0x3421('0x1e')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2f64a4[_0x3421('0x1c')],_0x2f64a4[_0x3421('0x25')],_0x2f64a4[_0x3421('0x26')]);return RpcUser[_0x3421('0x54')](this[_0x3421('0x8')][_0x2f64a4[_0x3421('0x25')]],_0x3421('0x55'),_0x2f64a4[_0x3421('0x1c')]);}}}catch(_0x475c8e){logger['error'](_0x3421('0x56'),_0x475c8e[_0x3421('0x3c')]);}};module[_0x3421('0x57')]=Acw; \ No newline at end of file +var _0x563d=['lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','finally','prototype','interface','ACW','mandatoryDisposition','name','Action','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','format','queue','error','acwTimeout','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','attended','[%s][HANGUP:UNIQUEID]','startAcw','isUndefined','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x563d,0xaa));var _0xd563=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x563d[_0x347471];return _0x422b6a;};'use strict';var _=require(_0xd563('0x0'));var moment=require(_0xd563('0x1'));var ami=require(_0xd563('0x2'));var logger=require('../../../config/logger')(_0xd563('0x3'));var RpcUser=require(_0xd563('0x4'));var RpcVoiceAgentReport=require(_0xd563('0x5'));function Acw(_0x4d933c){this['voiceQueues']=_0x4d933c[_0xd563('0x6')];this[_0xd563('0x7')]=_0x4d933c[_0xd563('0x7')];this[_0xd563('0x8')]=_0x4d933c['timers'];this[_0xd563('0x9')]={};ami['on'](_0xd563('0xa'),this['syncAgentConnect'][_0xd563('0xb')](this));ami['on'](_0xd563('0xc'),this[_0xd563('0xd')][_0xd563('0xb')](this));ami['on'](_0xd563('0xe'),this['syncHangup'][_0xd563('0xb')](this));ami['on'](_0xd563('0xf'),this[_0xd563('0x10')][_0xd563('0xb')](this));ami['on'](_0xd563('0x11'),this[_0xd563('0x12')]['bind'](this));ami['on'](_0xd563('0x13'),this[_0xd563('0x14')][_0xd563('0xb')](this));ami['on'](_0xd563('0x15'),this[_0xd563('0x16')]['bind'](this));}function getDiff(_0x483bf0){var _0x54a862=moment()['milliseconds'](0x0);var _0x3a06f8=moment(_0x483bf0)[_0xd563('0x17')](0x0);return _0x54a862[_0xd563('0x18')](_0x3a06f8,_0xd563('0x19'));}Acw['prototype'][_0xd563('0x1a')]=function(_0x254cc3,_0x36e8e2){var _0x4b202e=this;var _0x1020fd=getDiff(_0x4b202e[_0xd563('0x8')][_0x254cc3][_0xd563('0x1b')]);clearTimeout(_0x4b202e[_0xd563('0x8')][_0x254cc3]['timer']);_0x4b202e[_0xd563('0x8')][_0x254cc3][_0xd563('0x1c')]=![];return RpcVoiceAgentReport[_0xd563('0x1d')]({'acwtime':_0x1020fd},_0x4b202e[_0xd563('0x8')][_0x254cc3][_0xd563('0x1e')],_0x254cc3)[_0xd563('0x1f')](function(_0x27959c){logger[_0xd563('0x20')](_0xd563('0x21'),_0x36e8e2,_0x1020fd,_0x27959c);})[_0xd563('0x22')](function(_0x5b80bf){logger['error'](_0xd563('0x23'),_0x36e8e2,_0x5b80bf);})[_0xd563('0x24')](function(){delete _0x4b202e['timers'][_0x254cc3];});};Acw[_0xd563('0x25')]['startAcw']=function(_0x288de8){try{var _0x41e3ba=this;var _0xd65494=this[_0xd563('0x9')][_0x288de8][_0xd563('0x26')];var _0xea5590=this[_0xd563('0x9')][_0x288de8]['queue'];var _0x4bfdc0=this[_0xd563('0x6')][_0xea5590];var _0x59c741=![];var _0x4246c6=_0xd563('0x27');if(_0x4bfdc0[_0xd563('0x28')]&&_0x4bfdc0['mandatoryDispositionPause'][_0xd563('0x29')]){_0x59c741=!![];_0x4246c6=_0x4bfdc0['mandatoryDispositionPause'][_0xd563('0x29')];}return ami[_0xd563('0x2a')]({'action':'QueuePause','interface':_0xd65494,'paused':!![],'reason':_0x4246c6})[_0xd563('0x1f')](function(){if(_0x41e3ba[_0xd563('0x7')][_0xd65494]){return RpcUser[_0xd563('0x2b')](_0x41e3ba[_0xd563('0x7')][_0xd65494]['id'])[_0xd563('0x1f')](function(_0x7ea3f7){if(!_0x7ea3f7||_0x7ea3f7['voicePause']){logger[_0xd563('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x288de8,_0xd65494,_0xea5590);return;}logger['info'](_0xd563('0x2c'),_0x288de8,_0xd65494,_0xea5590);var _0x6e9064=_0x41e3ba[_0xd563('0x9')][_0x288de8]['attended']&&_0x41e3ba[_0xd563('0x9')][_0x288de8][_0xd563('0x2d')]?_0x41e3ba[_0xd563('0x9')][_0x288de8][_0xd563('0x2d')]:_0x288de8;return RpcUser[_0xd563('0x2e')](_0x41e3ba[_0xd563('0x7')][_0xd65494],_0x4246c6,_0x6e9064)[_0xd563('0x1f')](function(_0x2957f9){_0x41e3ba[_0xd563('0x6')][_0xea5590][_0xd563('0x2f')]-=0x1;_0x41e3ba[_0xd563('0x6')][_0xea5590][_0xd563('0x30')]+=0x1;return _0x2957f9;});})['then'](function(_0x2889f1){if(_0x59c741||!_0x2889f1){return;}_0x41e3ba['timers'][_0xd65494]={};logger[_0xd563('0x20')](_0xd563('0x31'),_0x288de8,_0x41e3ba['voiceQueues'][_0xea5590]['acwTimeout'],_0xd65494,_0xea5590);_0x41e3ba[_0xd563('0x8')][_0xd65494]['timer']=setTimeout(_0x41e3ba[_0xd563('0x32')][_0xd563('0xb')](_0x41e3ba,_0xd65494),_0x41e3ba['voiceQueues'][_0xea5590]['acwTimeout']*0x3e8);_0x41e3ba['timers'][_0xd65494][_0xd563('0x1b')]=moment()[_0xd563('0x33')]('YYYY-MM-DD\x20HH:mm:ss');_0x41e3ba[_0xd563('0x8')][_0xd65494][_0xd563('0x1e')]=_0x288de8;_0x41e3ba[_0xd563('0x8')][_0xd65494][_0xd563('0x34')]=_0xea5590;_0x41e3ba[_0xd563('0x8')][_0xd65494][_0xd563('0x1a')]=_0x41e3ba[_0xd563('0x1a')][_0xd563('0xb')](_0x41e3ba,_0xd65494,_0x288de8);});}})[_0xd563('0x22')](function(){logger[_0xd563('0x35')](_0xd563('0x31'),_0x288de8,_0x41e3ba['voiceQueues'][_0xea5590][_0xd563('0x36')],_0xd65494,_0xea5590);})[_0xd563('0x24')](function(){delete _0x41e3ba[_0xd563('0x9')][_0x288de8];});}catch(_0x2f220f){logger['error']('[ACW][START]\x20%s',_0x2f220f['message']);}};Acw[_0xd563('0x25')][_0xd563('0x32')]=function(_0x1fea85){try{var _0x227257=this;if(_0x227257[_0xd563('0x8')][_0x1fea85]){_0x227257['timers'][_0x1fea85][_0xd563('0x1c')]=![];var _0x5c87a4=_0x227257[_0xd563('0x8')][_0x1fea85][_0xd563('0x1e')];var _0x5affb0=_0x227257[_0xd563('0x8')][_0x1fea85][_0xd563('0x34')];var _0x5250bc=_0x227257['voiceQueues'][_0x5affb0][_0xd563('0x36')];logger[_0xd563('0x20')](_0xd563('0x37'),_0x5c87a4,_0x1fea85);RpcUser[_0xd563('0x2b')](this[_0xd563('0x7')][_0x1fea85]['id'])[_0xd563('0x1f')](function(_0x150e2a){if(_0x150e2a[_0xd563('0x38')]===_0xd563('0x27')){return RpcUser[_0xd563('0x39')](_0x227257[_0xd563('0x7')][_0x1fea85]);}});RpcVoiceAgentReport[_0xd563('0x1d')]({'acwtime':_0x5250bc,'agentacw':!![]},_0x5c87a4,_0x1fea85)[_0xd563('0x1f')](function(_0x2ab878){logger[_0xd563('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x5c87a4,_0x5250bc,_0x2ab878);})['catch'](function(_0x228764){logger[_0xd563('0x35')](_0xd563('0x23'),_0x5c87a4,_0x228764);});}else{logger[_0xd563('0x35')](_0xd563('0x3a'),_0x1fea85);if(_0x227257[_0xd563('0x8')]){logger[_0xd563('0x20')](_0xd563('0x3b'),JSON[_0xd563('0x3c')](_0x227257[_0xd563('0x8')]));}}}catch(_0x2dadcb){logger[_0xd563('0x35')](_0xd563('0x3d'),_0x2dadcb['message']);}};Acw[_0xd563('0x25')]['syncAgentConnect']=function(_0x37291c){try{if(this['voiceQueues'][_0x37291c[_0xd563('0x34')]]&&(this[_0xd563('0x6')][_0x37291c[_0xd563('0x34')]][_0xd563('0x3')]||this[_0xd563('0x6')][_0x37291c['queue']][_0xd563('0x28')])){if(this[_0xd563('0x7')][_0x37291c[_0xd563('0x26')]]){this[_0xd563('0x9')][_0x37291c['uniqueid']]={'queue':_0x37291c[_0xd563('0x34')],'interface':_0x37291c[_0xd563('0x26')],'destlinkedid':_0x37291c[_0xd563('0x2d')]};}}}catch(_0x49e62b){logger[_0xd563('0x35')](_0xd563('0x3e'),_0x49e62b['message']);}};Acw[_0xd563('0x25')][_0xd563('0x16')]=function(_0x1724d9){try{if(this[_0xd563('0x6')][_0x1724d9[_0xd563('0x34')]]&&(this['voiceQueues'][_0x1724d9[_0xd563('0x34')]][_0xd563('0x3')]||this[_0xd563('0x6')][_0x1724d9[_0xd563('0x34')]][_0xd563('0x28')])){if(this['agents'][_0x1724d9['interface']]){this[_0xd563('0x9')][_0x1724d9[_0xd563('0x1e')]]={'queue':_0x1724d9[_0xd563('0x34')],'interface':_0x1724d9[_0xd563('0x26')]};}}}catch(_0x321498){logger[_0xd563('0x35')]('[ACW][syncAgentConnectPreview]\x20%s',_0x321498[_0xd563('0x3f')]);}};Acw[_0xd563('0x25')][_0xd563('0xd')]=function(_0x44b639){try{if(this[_0xd563('0x9')][_0x44b639[_0xd563('0x1e')]]&&_['isUndefined'](this[_0xd563('0x9')][_0x44b639[_0xd563('0x1e')]][_0xd563('0x40')])){logger['info'](_0xd563('0x41'),_0x44b639[_0xd563('0x1e')]);this[_0xd563('0x42')](_0x44b639[_0xd563('0x1e')]);}else if(this[_0xd563('0x9')][_0x44b639['linkedid']]&&_[_0xd563('0x43')](this[_0xd563('0x9')][_0x44b639['linkedid']]['attended'])){logger[_0xd563('0x20')](_0xd563('0x44'),_0x44b639['linkedid']);this['startAcw'](_0x44b639[_0xd563('0x45')]);}}catch(_0x41766a){logger[_0xd563('0x35')](_0xd563('0x46'),_0x41766a[_0xd563('0x3f')]);}};Acw[_0xd563('0x25')]['syncHangup']=function(_0x1c1f50){try{if(this[_0xd563('0x9')][_0x1c1f50[_0xd563('0x1e')]]&&this['channels'][_0x1c1f50[_0xd563('0x1e')]]['attended']){logger[_0xd563('0x20')](_0xd563('0x47'),_0x1c1f50['uniqueid']);this[_0xd563('0x42')](_0x1c1f50[_0xd563('0x1e')]);}else if(this[_0xd563('0x9')][_0x1c1f50[_0xd563('0x45')]]&&this[_0xd563('0x9')][_0x1c1f50['linkedid']]['attended']){logger[_0xd563('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1c1f50[_0xd563('0x45')]);this['startAcw'](_0x1c1f50[_0xd563('0x45')]);}}catch(_0x117c7d){logger[_0xd563('0x35')]('[ACW][syncHangup]\x20%s',_0x117c7d[_0xd563('0x3f')]);}};Acw[_0xd563('0x25')][_0xd563('0x12')]=function(_0x4f2c0c){try{if(!_[_0xd563('0x48')](this['channels'][_0x4f2c0c[_0xd563('0x49')]])){this[_0xd563('0x42')](_0x4f2c0c['transfereeuniqueid']);if(this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4a')]]){this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4a')]]['attended']=!![];this['channels'][_0x4f2c0c[_0xd563('0x4b')]]=this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4a')]];delete this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4a')]];}}else if(!_[_0xd563('0x48')](this['channels'][_0x4f2c0c[_0xd563('0x4b')]])){this['startAcw'](_0x4f2c0c[_0xd563('0x4b')]);if(this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4c')]]){this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4c')]]['attended']=!![];this['channels'][_0x4f2c0c[_0xd563('0x49')]]=this[_0xd563('0x9')][_0x4f2c0c['origtransfereruniqueid']];delete this[_0xd563('0x9')][_0x4f2c0c[_0xd563('0x4c')]];}}}catch(_0x3b3e7f){logger[_0xd563('0x35')](_0xd563('0x4d'),_0x3b3e7f[_0xd563('0x3f')]);}};Acw[_0xd563('0x25')][_0xd563('0x14')]=function(_0x38cc9d){try{if(this['channels'][_0x38cc9d[_0xd563('0x4e')]]){logger[_0xd563('0x20')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xd563('0x3c')](_0x38cc9d[_0xd563('0x4e')]));this[_0xd563('0x42')](_0x38cc9d[_0xd563('0x4e')]);}else if(this[_0xd563('0x9')][_0x38cc9d[_0xd563('0x4f')]]){logger[_0xd563('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd563('0x3c')](_0x38cc9d[_0xd563('0x4f')]));this[_0xd563('0x42')](_0x38cc9d[_0xd563('0x4f')]);}}catch(_0x337ad7){logger[_0xd563('0x35')](_0xd563('0x50'),_0x337ad7['message']);}};Acw[_0xd563('0x25')][_0xd563('0x10')]=function(_0x5ee82a){try{if(this[_0xd563('0x6')][_0x5ee82a[_0xd563('0x34')]]&&this['voiceQueues'][_0x5ee82a[_0xd563('0x34')]][_0xd563('0x51')]==='all'){if(this['agents'][_0x5ee82a[_0xd563('0x26')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5ee82a['uniqueid'],_0x5ee82a['interface'],_0x5ee82a[_0xd563('0x34')]);return RpcUser[_0xd563('0x2e')](this[_0xd563('0x7')][_0x5ee82a['interface']],_0xd563('0x52'),_0x5ee82a[_0xd563('0x1e')]);}}}catch(_0x2a1b57){logger[_0xd563('0x35')](_0xd563('0x53'),_0x2a1b57[_0xd563('0x3f')]);}};module[_0xd563('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index aaee07b..b93ab11 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 _0x6b92=['asterisk','port','username','password','keepConnected','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','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','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','actionQueueSummary','catch','[ami.js][fullybooted]','close','asterisk-manager','ami'];(function(_0x230bb8,_0xa1718){var _0x16cb9a=function(_0x2848fe){while(--_0x2848fe){_0x230bb8['push'](_0x230bb8['shift']());}};_0x16cb9a(++_0xa1718);}(_0x6b92,0xd6));var _0x26b9=function(_0x13bf54,_0xadc752){_0x13bf54=_0x13bf54-0x0;var _0x268d8b=_0x6b92[_0x13bf54];return _0x268d8b;};'use strict';var Manager=require(_0x26b9('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require('../../config/logger')(_0x26b9('0x1'));var config=require('../../config/environment');var ami=new Manager(config[_0x26b9('0x2')][_0x26b9('0x3')],config['asterisk']['ip'],config[_0x26b9('0x2')][_0x26b9('0x4')],config['asterisk'][_0x26b9('0x5')],!![]);ami[_0x26b9('0x6')]();ami[_0x26b9('0x7')]=BPromise[_0x26b9('0x8')](ami['action']);function error(_0x138b88){logger[_0x26b9('0x9')](util[_0x26b9('0xa')](_0x26b9('0xb'),config[_0x26b9('0x2')]['username'],config[_0x26b9('0x2')]['ip'],config['asterisk'][_0x26b9('0x3')],util[_0x26b9('0xc')](_0x138b88,![],null)));}function close(){logger[_0x26b9('0x9')](util[_0x26b9('0xa')](_0x26b9('0xd'),config[_0x26b9('0x2')]['username'],config[_0x26b9('0x2')]['ip'],config[_0x26b9('0x2')][_0x26b9('0x3')]));}ami[_0x26b9('0xe')]=function(){return function(){return ami[_0x26b9('0x7')]({'action':_0x26b9('0xf')});};};ami[_0x26b9('0x10')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x26b9('0x11')]=function(){return function(){return ami['Action']({'action':_0x26b9('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x26b9('0x7')]({'action':_0x26b9('0x13')});};};ami[_0x26b9('0x14')]=function(){return function(){return ami[_0x26b9('0x7')]({'action':_0x26b9('0x15')});};};function connect(){logger[_0x26b9('0x16')](util[_0x26b9('0xa')](_0x26b9('0x17'),config[_0x26b9('0x2')][_0x26b9('0x4')],config['asterisk']['ip'],config[_0x26b9('0x2')][_0x26b9('0x3')]));ami[_0x26b9('0x18')](_0x26b9('0x9'),error);ami['once']('close',close);}ami['on'](_0x26b9('0x19'),connect);ami['on'](_0x26b9('0x1a'),function(_0x44ad52){logger['info'](util[_0x26b9('0xa')](_0x26b9('0x1b'),config[_0x26b9('0x2')][_0x26b9('0x4')],config[_0x26b9('0x2')]['ip'],config['asterisk']['port'],util[_0x26b9('0xc')](_0x44ad52,![],null)));});ami['on'](_0x26b9('0x1c'),function(){logger[_0x26b9('0x16')](util[_0x26b9('0xa')](_0x26b9('0x1d'),config[_0x26b9('0x2')][_0x26b9('0x4')],config[_0x26b9('0x2')]['ip'],config[_0x26b9('0x2')][_0x26b9('0x3')]));return Promise[_0x26b9('0x1e')]()[_0x26b9('0x1f')](ami['actionSipShowRegistry']())[_0x26b9('0x1f')](ami['actionDeviceStateList']())[_0x26b9('0x1f')](ami[_0x26b9('0x11')]())[_0x26b9('0x1f')](ami[_0x26b9('0x20')]())['then'](ami[_0x26b9('0x14')]())[_0x26b9('0x21')](function(_0x114651){logger[_0x26b9('0x9')](_0x26b9('0x22'),util[_0x26b9('0xc')](_0x114651,{'showHidden':![],'depth':null}));});});ami[_0x26b9('0x18')](_0x26b9('0x9'),error);ami[_0x26b9('0x18')](_0x26b9('0x23'),close);module['exports']=ami; \ No newline at end of file +var _0xe910=['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','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action'];(function(_0xcf6d6b,_0x2b15b7){var _0x337966=function(_0x1aba20){while(--_0x1aba20){_0xcf6d6b['push'](_0xcf6d6b['shift']());}};_0x337966(++_0x2b15b7);}(_0xe910,0x1ed));var _0x0e91=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xe910[_0x3a07c1];return _0x2bbe15;};'use strict';var Manager=require(_0x0e91('0x0'));var BPromise=require(_0x0e91('0x1'));var util=require(_0x0e91('0x2'));var logger=require(_0x0e91('0x3'))(_0x0e91('0x4'));var config=require(_0x0e91('0x5'));var ami=new Manager(config[_0x0e91('0x6')][_0x0e91('0x7')],config[_0x0e91('0x6')]['ip'],config[_0x0e91('0x6')][_0x0e91('0x8')],config[_0x0e91('0x6')][_0x0e91('0x9')],!![]);ami[_0x0e91('0xa')]();ami[_0x0e91('0xb')]=BPromise[_0x0e91('0xc')](ami[_0x0e91('0xd')]);function error(_0x3a4866){logger[_0x0e91('0xe')](util[_0x0e91('0xf')](_0x0e91('0x10'),config['asterisk'][_0x0e91('0x8')],config[_0x0e91('0x6')]['ip'],config[_0x0e91('0x6')][_0x0e91('0x7')],util[_0x0e91('0x11')](_0x3a4866,![],null)));}function close(){logger['error'](util[_0x0e91('0xf')](_0x0e91('0x12'),config[_0x0e91('0x6')][_0x0e91('0x8')],config[_0x0e91('0x6')]['ip'],config['asterisk'][_0x0e91('0x7')]));}ami[_0x0e91('0x13')]=function(){return function(){return ami[_0x0e91('0xb')]({'action':_0x0e91('0x14')});};};ami[_0x0e91('0x15')]=function(){return function(){return ami[_0x0e91('0xb')]({'action':'devicestatelist'});};};ami[_0x0e91('0x16')]=function(){return function(){return ami[_0x0e91('0xb')]({'action':_0x0e91('0x17')});};};ami[_0x0e91('0x18')]=function(){return function(){return ami[_0x0e91('0xb')]({'action':_0x0e91('0x19')});};};ami[_0x0e91('0x1a')]=function(){return function(){return ami[_0x0e91('0xb')]({'action':'coreshowchannels'});};};function connect(){logger[_0x0e91('0x1b')](util['format'](_0x0e91('0x1c'),config[_0x0e91('0x6')][_0x0e91('0x8')],config[_0x0e91('0x6')]['ip'],config[_0x0e91('0x6')][_0x0e91('0x7')]));ami[_0x0e91('0x1d')]('error',error);ami[_0x0e91('0x1d')](_0x0e91('0x1e'),close);}ami['on'](_0x0e91('0x1f'),connect);ami['on'](_0x0e91('0x20'),function(_0x45127a){logger['info'](util[_0x0e91('0xf')](_0x0e91('0x21'),config[_0x0e91('0x6')][_0x0e91('0x8')],config['asterisk']['ip'],config[_0x0e91('0x6')][_0x0e91('0x7')],util[_0x0e91('0x11')](_0x45127a,![],null)));});ami['on'](_0x0e91('0x22'),function(){logger[_0x0e91('0x1b')](util['format'](_0x0e91('0x23'),config[_0x0e91('0x6')][_0x0e91('0x8')],config['asterisk']['ip'],config[_0x0e91('0x6')]['port']));return Promise['resolve']()[_0x0e91('0x24')](ami[_0x0e91('0x13')]())[_0x0e91('0x24')](ami[_0x0e91('0x15')]())[_0x0e91('0x24')](ami[_0x0e91('0x16')]())[_0x0e91('0x24')](ami[_0x0e91('0x18')]())[_0x0e91('0x24')](ami[_0x0e91('0x1a')]())['catch'](function(_0x2d5575){logger[_0x0e91('0xe')](_0x0e91('0x25'),util['inspect'](_0x2d5575,{'showHidden':![],'depth':null}));});});ami[_0x0e91('0x1d')](_0x0e91('0xe'),error);ami[_0x0e91('0x1d')](_0x0e91('0x1e'),close);module[_0x0e91('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index cfbabaf..609391f 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x51ca5b,_0x326c16){var _0x5bef49=function(_0xb54662){while(--_0xb54662){_0x51ca5b['push'](_0x51ca5b['shift']());}};_0x5bef49(++_0x326c16);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x287c49,_0x1b4ef2){var _0x51cddb=function(_0x277b61){while(--_0x277b61){_0x287c49['push'](_0x287c49['shift']());}};_0x51cddb(++_0x1b4ef2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b48a21d..5fdeef7 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 _0x26be=['countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','dialMachineMaxRetry','dialMachineRetryFrequency','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','Unknow','[syncHangupIvr][createHistory]','running','resolve','statusMessage','available','inUse','talking','ACTIVE','queueSummaryCountersUpdated','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','[uniqueid]','[actions]','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','Agent','user:dialPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','setXMDContactVariables','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','xcally-motion-dialer','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalDroppedCallsTimeout','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\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]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','[busyFactor]','p\x20=\x20','Umin\x20=\x20','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','startPredictive','ivrOriginated','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','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','erlangBusyFactor','merge','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','checkContactLowerLimitOriginate','inspect','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','message','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','status','reachable','SIP/%s','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','interval','timezones','then','content','indexOf','true','catch','iftime\x20%s,%s','OVERTIME_GLOBAL_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agiafterat','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','countdropretry','dialDropMaxRetry','add','ContactId','ListId','VoiceQueueId','CampaignId','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','statedesc','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','dialAbandonedRetryFrequency','minutes','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','roundrobin','locked','paused','stateinterface','rrmemory','queueBooked','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','outboundAnswerAgiCallsDay','Machine'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26be,0x104));var _0xe26b=function(_0x2bb3a6,_0x54e837){_0x2bb3a6=_0x2bb3a6-0x0;var _0x279fa1=_0x26be[_0x2bb3a6];return _0x279fa1;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0xe26b('0x0'));var moment=require(_0xe26b('0x1'));var rr=require('rr');var Redis=require(_0xe26b('0x2'));var utils=require(_0xe26b('0x3'));var hopperUtils=require(_0xe26b('0x4'));var ut=require(_0xe26b('0x5'));var config=require(_0xe26b('0x6'));var logger=require(_0xe26b('0x7'))(_0xe26b('0x8'));var loggerBooked=require('../../../config/logger')(_0xe26b('0x9'));var loggerPredictive=require(_0xe26b('0x7'))(_0xe26b('0xa'));var loggerPredictiveCalls=require(_0xe26b('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xe26b('0x7'))(_0xe26b('0xb'));var ami=require(_0xe26b('0xc'));config[_0xe26b('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xe26b('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xe26b('0xf'));var Interval=require(_0xe26b('0x10'));var Action=require(_0xe26b('0x11'));var History=require(_0xe26b('0x12'));var Final=require(_0xe26b('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xe26b('0x14'));var ipAgi=process['env'][_0xe26b('0x15')]||_0xe26b('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe26b('0x17')][_0xe26b('0x18')]=function(_0x1b3e1f){this[_0xe26b('0x19')]=this[_0xe26b('0x19')]?this[_0xe26b('0x19')][_0xe26b('0x1a')](_0x1b3e1f):_0x1b3e1f();};function Dialer(_0x2e320c,_0x41f70a){this[_0xe26b('0x1b')]=new Sequence();this[_0xe26b('0x1c')]=_0x41f70a;this[_0xe26b('0x1d')]=_0x2e320c[_0xe26b('0x1d')];this[_0xe26b('0x1e')]=_0x2e320c[_0xe26b('0x1e')];this[_0xe26b('0x1f')]=_0x2e320c[_0xe26b('0x1f')];this[_0xe26b('0x20')]=_0x2e320c['trunks'];this['maxNumberOriginate']=config[_0xe26b('0x21')]||0x2;this[_0xe26b('0x22')]={};this[_0xe26b('0x23')]={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0xe26b('0x24')]={};this['startProgressive']={};this[_0xe26b('0x25')]={};this['queueBooked']={};this['queueBookedRR']={};this[_0xe26b('0x26')]={};ami['on'](_0xe26b('0x27'),this[_0xe26b('0x28')][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x2a'),this[_0xe26b('0x2b')][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x2c'),this['syncOriginateResponse'][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x2d'),this[_0xe26b('0x2e')][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x2f'),this['syncQueueSummary'][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x30'),this[_0xe26b('0x31')][_0xe26b('0x29')](this));ami['on']('hangup',this[_0xe26b('0x32')][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x33'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xe26b('0x34')]['bind'](this));ami['on'](_0xe26b('0x35'),this[_0xe26b('0x36')][_0xe26b('0x29')](this));ami['on'](_0xe26b('0x37'),this[_0xe26b('0x38')]['bind'](this));this[_0xe26b('0x39')]();this[_0xe26b('0x3a')]();RpcSetting[_0xe26b('0x3b')]()['then'](function(_0x1d0bec){previewRecallmeReminderInterval=_0x1d0bec[_0xe26b('0x3c')];});}function isNotNull(_0x1d1574){return _0x1d1574!==null&&!_['isUndefined'](_0x1d1574);}function msgResponse(_0x413547,_0x2e94e4,_0x2b2c44){return{'action':_0x413547,'response':_0x2e94e4,'message':_0x2b2c44,'stack':_0x2b2c44};}function emit(_0x2fde9c,_0x1686ac,_0x4b369c){io['to'](_0x2fde9c)[_0xe26b('0x3d')](_0x1686ac,_0x4b369c);}function emitOutboundVoiceQueueSummary(_0x3796d5){if(_0x3796d5[_0xe26b('0x3e')]===_0xe26b('0x3f')){logger[_0xe26b('0x40')](_0xe26b('0x41'),util['inspect'](_0x3796d5,{'showHidden':![],'depth':null}));emit(util[_0xe26b('0x42')](_0xe26b('0x43'),_0x3796d5[_0xe26b('0x44')]),_0xe26b('0x45'),_0x3796d5);}}function checkGetDataPredictive(_0x24485e){if(isNotNull(_0x24485e)&&!_[_0xe26b('0x46')](_0x24485e)){loggerPredictive[_0xe26b('0x47')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xe26b('0x47')](_0xe26b('0x48'),_0x24485e[_0xe26b('0x49')]);loggerPredictive[_0xe26b('0x47')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24485e[_0xe26b('0x4a')]);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x4b'),_0x24485e['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x4c'),_0x24485e[_0xe26b('0x4d')]);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x4e'),_0x24485e['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x4f'),_0x24485e[_0xe26b('0x50')]);loggerPredictive['info'](_0xe26b('0x51'));if(_0x24485e[_0xe26b('0x49')]>0x0){if(!_[_0xe26b('0x52')](_0x24485e[_0xe26b('0x50')])&&_0x24485e[_0xe26b('0x50')]>0x0){return!![];}loggerPredictive[_0xe26b('0x47')](_0xe26b('0x53'));if(!_[_0xe26b('0x52')](_0x24485e[_0xe26b('0x54')])&&_0x24485e['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xe26b('0x47')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xe26b('0x47')](_0xe26b('0x55'));}return![];}function mergeDataErlangB(_0xaa2ea8){return function(_0x338c84){loggerPredictive['info'](_0xe26b('0x56'));loggerPredictive[_0xe26b('0x47')](_0xe26b('0x57'),_0x338c84[_0xe26b('0x58')]);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x59'),_0x338c84[_0xe26b('0x5a')]);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x5b'),_0x338c84[_0xe26b('0x5c')]);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x5d'),_0x338c84[_0xe26b('0x5e')]);loggerPredictive['info'](_0xe26b('0x5b'),_0x338c84['erlangAbandonmentRate']);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x51'));_[_0xe26b('0x5f')](_0xaa2ea8,_0x338c84);};}function ifInterval(_0x157589,_0x5d7ea5){if(_[_0xe26b('0x52')](_0x5d7ea5)){return![];}return utils['getSeconds'](undefined,_0x5d7ea5)<_0x157589*0x3c;}function clearPredictiveAttributes(_0xdf5e5d){if(_0xdf5e5d[_0xe26b('0x60')]){_0xdf5e5d[_0xe26b('0x60')]=undefined;loggerPredictive[_0xe26b('0x40')](_0xdf5e5d[_0xe26b('0x44')],_0xe26b('0x61'));}if(_0xdf5e5d[_0xe26b('0x24')]){_0xdf5e5d[_0xe26b('0x24')]=undefined;loggerPredictive['debug'](_0xdf5e5d[_0xe26b('0x44')],_0xe26b('0x62'));}if(_0xdf5e5d[_0xe26b('0x63')]){clearInterval(_0xdf5e5d[_0xe26b('0x63')]);_0xdf5e5d['handlePredictive']=undefined;loggerPredictive[_0xe26b('0x40')](_0xdf5e5d[_0xe26b('0x44')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x971a25,_0x50ba05){return function(_0x538b46){loggerPredictive[_0xe26b('0x64')](_0x50ba05[_0xe26b('0x44')],_0x971a25);loggerPredictive[_0xe26b('0x64')](_0x538b46['stack']);clearPredictiveAttributes(_0x50ba05);};}function loggerCatch(_0x274cd2){return function(_0x2a83c6){logger[_0xe26b('0x64')](_0x274cd2,util['inspect'](_0x2a83c6,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x183c7a,_0x2cfd44,_0x2f8deb){return function(_0x1a508d){utils[_0xe26b('0x65')](_0x2cfd44,_0x2f8deb,0x0);_0x2cfd44['temp']=0x0;logger[_0xe26b('0x64')](_0x183c7a,util[_0xe26b('0x66')](_0x1a508d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x40b8fe){return function(_0x6dbfdc){if(isNotNull(_0x6dbfdc)&&isNotNull(_0x6dbfdc[0x0])){if(_0x6dbfdc[0x0][_0xe26b('0x67')]>0x0){_0x40b8fe['message']=utils[_0xe26b('0x68')][_0xe26b('0x69')];logger[_0xe26b('0x47')](_0xe26b('0x6a')+_0x40b8fe[_0xe26b('0x44')],_0x6dbfdc[0x0][_0xe26b('0x67')],_0xe26b('0x6b'));}else{_0x40b8fe['message']=utils[_0xe26b('0x68')][_0xe26b('0x6c')];logger[_0xe26b('0x47')](_0xe26b('0x6d')+_0x40b8fe[_0xe26b('0x44')]);}}};}function createObjHistory(_0x27cec4,_0x3ea739,_0x50852f,_0x234e53,_0xa72bb0){_0x27cec4['message']=_0x50852f;var _0x6b9e0d=new Action(_0x27cec4,_0x3ea739);var _0x59f147=new History(_0x6b9e0d);_0x59f147[_0xe26b('0x6e')]=_0x234e53;_0x59f147['statedesc']=_0xa72bb0;_0x59f147['endtime']=_0x6b9e0d[_0xe26b('0x6f')];return _0x59f147;}function unlockQueueStatus(_0x29f7d3,_0x35074e){setTimeout(function(){if(_[_0xe26b('0x52')](_0x29f7d3[_0xe26b('0x70')])){loggerBooked[_0xe26b('0x64')](_0xe26b('0x71'),_0x35074e);}_0x29f7d3['queueStatusComplete']=!![];loggerBooked[_0xe26b('0x47')](_0xe26b('0x72'),_0x35074e,JSON[_0xe26b('0x73')](_[_0xe26b('0x74')](_0x29f7d3,['name',_0xe26b('0x70')])));},0x1f3);}function checkInterval(_0x1068f4){return function(){if(!isNotNull(_0x1068f4[_0xe26b('0x75')])){_0x1068f4[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x77')];throw _0x1068f4[_0xe26b('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x1068f4['Interval'][_0xe26b('0x78')])){_0x1068f4[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x77')];throw _0x1068f4[_0xe26b('0x44')]+_0xe26b('0x79');}if(!isNotNull(_['isEmpty'](_0x1068f4[_0xe26b('0x75')]['Intervals']))){_0x1068f4['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x1068f4['name']+_0xe26b('0x79');}};}function checkIsIVRCampaignActive(_0x309734){return function(){if(!utils[_0xe26b('0x7a')](_0x309734)){_0x309734[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x7b')];throw _0x309734[_0xe26b('0x44')]+_0xe26b('0x7c');}};}function emitCampaignSummary(_0x5df13b){if(utils[_0xe26b('0x7d')](_0x5df13b)){emit(util[_0xe26b('0x42')](_0xe26b('0x7e'),_0x5df13b[_0xe26b('0x44')]),_0xe26b('0x7f'),_0x5df13b);}}function loggerCatchQueueSummary(_0x5d2cee,_0x4fee87){return function(_0x377bdb){clearPredictiveAttributes(_0x4fee87);emitCampaignSummary(_0x4fee87);loggerSyncQueueSummary['debug'](_0x5d2cee,util[_0xe26b('0x66')](_0x377bdb,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5f2d8d){if(_0x5f2d8d['sendMessageOneNotActive']){if(_0x5f2d8d[_0xe26b('0x80')]===0x0){_0x5f2d8d[_0xe26b('0x81')]=![];_0x5f2d8d['message']=utils[_0xe26b('0x68')]['INACTIVE'];loggerSyncQueueSummary[_0xe26b('0x40')](_0xe26b('0x82'),_0x5f2d8d[_0xe26b('0x44')],_0xe26b('0x83'));}else{_0x5f2d8d[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x84')];loggerSyncQueueSummary[_0xe26b('0x40')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5f2d8d[_0xe26b('0x44')],_0xe26b('0x85'));}emitCampaignSummary(_0x5f2d8d);}}function myreject(_0xd78718){return function(_0x4f58b3){return _0xd78718(msgResponse(_0xe26b('0x86'),'Error',JSON[_0xe26b('0x73')](_0x4f58b3)));};}Dialer[_0xe26b('0x17')][_0xe26b('0x87')]=function(_0x232186){return!_['isUndefined'](_0x232186)&&_0x232186&&!_[_0xe26b('0x52')](_0x232186[_0xe26b('0x44')])&&!_[_0xe26b('0x52')](_0x232186[_0xe26b('0x88')])&&_0x232186[_0xe26b('0x88')]&&(this[_0xe26b('0x20')][util[_0xe26b('0x42')]('SIP/%s',_0x232186['name'])][_0xe26b('0x89')]===_0xe26b('0x8a')||this[_0xe26b('0x20')][util[_0xe26b('0x42')](_0xe26b('0x8b'),_0x232186[_0xe26b('0x44')])][_0xe26b('0x89')]==='unmonitored');};Dialer['prototype'][_0xe26b('0x8c')]=function(_0x482bf7){var _0x34d4c5=this;return function(){if(!_0x34d4c5['isTrunkReachable'](_0x482bf7[_0xe26b('0x8d')])){if(!_0x34d4c5[_0xe26b('0x87')](_0x482bf7[_0xe26b('0x8e')])){_0x482bf7[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x8f')];throw _0x482bf7[_0xe26b('0x44')]+_0xe26b('0x90');}}};};Dialer[_0xe26b('0x17')][_0xe26b('0x91')]=function(_0x43800a,_0x2c54f0,_0x2e5a49,_0x3fbbc3){var _0x264c90=this;return function(){var _0x4146c1=!![];return _0x264c90[_0xe26b('0x92')](_0x43800a,_0x2c54f0,_0x2e5a49,_0x3fbbc3,_0x4146c1);};};Dialer[_0xe26b('0x17')][_0xe26b('0x93')]=function(_0x165468,_0x50652a,_0x2fd7b1,_0x1f3e0d){var _0x589f9e=this;return function(){var _0x2b225a=![];return _0x589f9e[_0xe26b('0x92')](_0x165468['Intervals'],_0x50652a,_0x2fd7b1,_0x1f3e0d,_0x2b225a);};};Dialer[_0xe26b('0x17')][_0xe26b('0x92')]=function(_0x52cd42,_0x4d815b,_0x1916c4,_0x41a7ed,_0x5ae09a){var _0x13da9f=[];return new Promise(function(_0x5dc689,_0x10a607){if(!isNotNull(_0x52cd42)){_0x41a7ed[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x77')];return _0x10a607(msgResponse(_0xe26b('0x94'),_0xe26b('0x95'),_0x1916c4+_0xe26b('0x96')));}if(_[_0xe26b('0x46')](_0x52cd42)){_0x41a7ed[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x97')];return _0x10a607(msgResponse(_0xe26b('0x94'),_0xe26b('0x95'),_0x1916c4+_0xe26b('0x98')));}if(_0x4d815b&&_['isUndefined'](config['timezones'][_0x4d815b])){_0x41a7ed[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x99')];return _0x10a607(msgResponse('ifTime',_0xe26b('0x95'),_0x1916c4+_0xe26b('0x9a')+_0x4d815b));}if(_[_0xe26b('0x9b')](_0x52cd42)){for(var _0x2d17fc=0x0;_0x2d17fc<_0x52cd42[_0xe26b('0x9c')];_0x2d17fc+=0x1){_0x13da9f[_0xe26b('0x9d')](ami[_0xe26b('0x9e')]({'action':'command','command':util[_0xe26b('0x42')]('iftime\x20%s,%s',_0x52cd42[_0x2d17fc][_0xe26b('0x9f')],!_['isUndefined'](config[_0xe26b('0xa0')][_0x4d815b])?_0x4d815b:'')})[_0xe26b('0xa1')](function(_0x59e929){return _0x59e929[_0xe26b('0xa2')][_0xe26b('0xa3')](_0xe26b('0xa4'))>=0x0;})[_0xe26b('0xa5')](myreject(_0x10a607)));}}else{_0x13da9f[_0xe26b('0x9d')](ami['Action']({'action':'command','command':util[_0xe26b('0x42')](_0xe26b('0xa6'),_0x52cd42,!_[_0xe26b('0x52')](config['timezones'][_0x4d815b])?_0x4d815b:'')})[_0xe26b('0xa1')](function(_0x270466){return _0x270466['content']['indexOf'](_0xe26b('0xa4'))>=0x0;})[_0xe26b('0xa5')](myreject(_0x10a607)));}Promise['all'](_0x13da9f)[_0xe26b('0xa1')](function(_0x56f0b6){var _0x36464c=_['some'](_0x56f0b6);if(_0x36464c){return _0x5dc689(_0x36464c);}else{_0x41a7ed[_0xe26b('0x76')]=_0x5ae09a?utils['CAMPAIGN_STATUS'][_0xe26b('0xa7')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x10a607(msgResponse('[ifTime][promiseAll]','Failure',_0xe26b('0xa8')+_0x5ae09a+'\x20'+_0x1916c4+_0xe26b('0xa9')+util[_0xe26b('0x66')](_0x52cd42,{'showHidden':![],'depth':null})+_0xe26b('0xaa')+_0x4d815b));}})[_0xe26b('0xa5')](function(_0x21a68b){return _0x10a607(msgResponse(_0xe26b('0x94'),'Failure',JSON[_0xe26b('0x73')](_0x21a68b)));});});};Dialer[_0xe26b('0x17')][_0xe26b('0x39')]=function(){var _0x5ab131=this;return cmHopper[_0xe26b('0xab')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5ab131[_0xe26b('0xac')]();},0x3e8);});};Dialer[_0xe26b('0x17')][_0xe26b('0xac')]=function(){var _0x118236=this;var _0x964504;for(var _0x20894d in this[_0xe26b('0x1e')]){if(typeof this['campaigns'][_0x20894d]!==_0xe26b('0xad')){_0x964504=this[_0xe26b('0x1e')][_0x20894d];if(utils[_0xe26b('0x7d')](_0x964504)&&utils['isIVRCampaignActive'](_0x964504)){_0x964504[_0xe26b('0x81')]=!![];Promise['resolve']()[_0xe26b('0xa1')](checkIsIVRCampaignActive(_0x964504))[_0xe26b('0xa1')](checkInterval(_0x964504))[_0xe26b('0xa1')](_0x118236['checkIsTrunkReachable'](_0x964504))[_0xe26b('0xa1')](_0x118236[_0xe26b('0x91')](_0x964504[_0xe26b('0xae')],_0x964504[_0xe26b('0xaf')],_0x964504[_0xe26b('0x44')],_0x964504))['then'](_0x118236[_0xe26b('0x93')](_0x964504['Interval'],_0x964504['dialTimezone'],_0x964504['name'],_0x964504))[_0xe26b('0xa1')](_0x118236[_0xe26b('0xb0')](_0x964504))[_0xe26b('0xa5')](loggerCatchQueueSummary(_0xe26b('0xb1'),_0x964504));}else{notSendMessagesCampaign(_0x964504);}}}};Dialer[_0xe26b('0x17')][_0xe26b('0xb2')]=function(_0x30cf0e){if(_0x30cf0e['dialMethod']!==_0xe26b('0xa')){clearPredictiveAttributes(_0x30cf0e);}switch(_0x30cf0e[_0xe26b('0xb3')]){case'progressive':this[_0xe26b('0xb4')](_0x30cf0e,0x1);break;case'power':this[_0xe26b('0xb4')](_0x30cf0e,_0x30cf0e[_0xe26b('0xb5')]);break;case _0xe26b('0xa'):this['predictive'](_0x30cf0e);break;case _0xe26b('0x9'):this['handlePower'](_0x30cf0e,0x1);break;default:logger[_0xe26b('0x64')](_0xe26b('0xb6'),_0x30cf0e[_0xe26b('0x44')],_0xe26b('0xb7'));}};Dialer['prototype'][_0xe26b('0x94')]=function(_0x1b7045,_0x22d935){var _0xa55934=_0x1b7045[_0xe26b('0xaf')];var _0x2341e8=_0x22d935?_0x1b7045[_0xe26b('0xae')]:_0x1b7045['Interval'][_0xe26b('0x78')];logger[_0xe26b('0xb8')](_0xe26b('0xb9'),_0x2341e8,_0xa55934,_0x1b7045[_0xe26b('0x44')],util['format'](_0xe26b('0xba'),_0x1b7045['name'],_0x1b7045['id']));var _0x4ca2cf=null;return Interval[_0xe26b('0xbb')](_0x2341e8,_0xa55934)['then'](function(_0x464df5){if(_0x464df5===!![]){return _0x464df5;}else{_0x1b7045['message']=_0x22d935?utils[_0xe26b('0x68')][_0xe26b('0xa7')]:utils[_0xe26b('0x68')][_0xe26b('0xbc')];_0x4ca2cf=msgResponse(_0xe26b('0xbd'),_0xe26b('0x95'),_0xe26b('0xa8')+_0x22d935+'\x20'+_0x1b7045['name']+_0xe26b('0xa9')+util['inspect'](_0x2341e8,{'showHidden':![],'depth':null})+_0xe26b('0xaa')+_0xa55934);}if(_0x4ca2cf!==null){logger[_0xe26b('0xb8')](_0xe26b('0xbe'),_0x4ca2cf);_0x4ca2cf[_0xe26b('0xbf')]=_0x22d935;throw _0x4ca2cf;}})[_0xe26b('0xa5')](function(_0x22709a){logger['error'](_0xe26b('0xc0'),_0x22709a);throw msgResponse('[ifTime][Action]',_0xe26b('0xc1'),util['inspect'](_0x22709a,{'showHidden':![],'depth':null}));});};Dialer[_0xe26b('0x17')]['syncAgentConnect']=function(_0x5cc4be){if(this[_0xe26b('0x1d')][_0x5cc4be[_0xe26b('0xc2')]]){if(this[_0xe26b('0xc3')][_0x5cc4be[_0xe26b('0xc4')]]&&this[_0xe26b('0xc3')][_0x5cc4be[_0xe26b('0xc4')]][_0xe26b('0x3e')]!==_0xe26b('0xc5')){this['updateOriginated'](this[_0xe26b('0x1d')][_0x5cc4be[_0xe26b('0xc2')]]);this[_0xe26b('0xc3')][_0x5cc4be[_0xe26b('0xc4')]][_0xe26b('0xc6')]=moment()['format'](_0xe26b('0xc7'));}}};Dialer[_0xe26b('0x17')]['syncAgentComplete']=function(_0x5a37e2){var _0x650936=this[_0xe26b('0xc3')][_0x5a37e2['uniqueid']];if(this[_0xe26b('0x1d')][_0x5a37e2[_0xe26b('0xc2')]]){if(_0x650936&&_0x650936[_0xe26b('0x3e')]!==_0xe26b('0xc5')){delete this[_0xe26b('0xc3')][_0x5a37e2['uniqueid']];this[_0xe26b('0x1d')][_0x5a37e2[_0xe26b('0xc2')]][_0xe26b('0xc8')]+=0x1;var _0x1a5b27=new AgentComplete(_0x650936,_0x5a37e2);if(_0x5a37e2[_0xe26b('0xc9')]==='agent'){_0x1a5b27[_0xe26b('0xca')]=this[_0xe26b('0x1d')][_0x5a37e2[_0xe26b('0xc2')]]['dialQueueProject2']&&this['voiceQueues'][_0x5a37e2[_0xe26b('0xc2')]]['dialAgiAfterHangupAgent']?moment()[_0xe26b('0x42')](_0xe26b('0xc7')):undefined;}hopperUtils[_0xe26b('0xcb')](_0x1a5b27)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0xcc')));hopperUtils[_0xe26b('0xcd')](_0x1a5b27)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0xce')));}}};Dialer[_0xe26b('0x17')][_0xe26b('0x2b')]=function(_0x3696ad){var _0x53eac2=this['uniqueId'][_0x3696ad['uniqueid']];var _0x5fb2a1=this;var _0x1640c7=![];var _0x14579e;var _0x48cc1d;if(this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]]){if(_0x53eac2&&_0x53eac2['type']!=='ivr'){delete this[_0xe26b('0xc3')][_0x3696ad['uniqueid']];this['updateOriginated'](this[_0xe26b('0x1d')][_0x3696ad['queue']]);_0x53eac2[_0xe26b('0xcf')]=moment()[_0xe26b('0x42')](_0xe26b('0xc7'));var _0x21e517=new QueueCallerAbandon(_0x53eac2,_0x3696ad);if(utils[_0xe26b('0xd0')](_0x53eac2[_0xe26b('0xcf')],_0x53eac2[_0xe26b('0xd1')])>=_0x53eac2[_0xe26b('0xd2')]){this['voiceQueues'][_0x3696ad[_0xe26b('0xc2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xd3')]+=0x1;this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xd4')]+=0x1;_0x21e517[_0xe26b('0x6e')]=0xa;_0x21e517['statedesc']=_0xe26b('0xd5');_0x21e517[_0xe26b('0xd6')]=_0xe26b('0xd7');_0x21e517[_0xe26b('0xca')]=this['voiceQueues'][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xd8')]?moment()[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x21e517['countdropretry']+=0x1;_0x21e517['countglobal']+=0x1;_0x14579e=this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xd9')];_0x48cc1d=this[_0xe26b('0x1d')][_0x3696ad['queue']][_0xe26b('0xda')];hopperUtils[_0xe26b('0xdb')](_0x21e517,_0x21e517[_0xe26b('0x6e')],_0x53eac2[_0xe26b('0xdc')])[_0xe26b('0xa1')](function(_0x5f4d66){_0x1640c7=_0x5f4d66['additional']==0x1;if(_0x21e517[_0xe26b('0xdd')]>=_0x5fb2a1['voiceQueues'][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xde')]){_0x5fb2a1['queueCallerAbandonCreateState'](_0x21e517,_0x5f4d66['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x21e517[_0xe26b('0xdd')],'scheduledat':moment()[_0xe26b('0xdf')](_0x5fb2a1[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xd9')],'minutes')[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53eac2[_0xe26b('0xe0')],'ListId':_0x53eac2[_0xe26b('0xe1')],'VoiceQueueId':_0x53eac2[_0xe26b('0xe2')]||undefined,'CampaignId':_0x53eac2[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch('[rescheduleContact][Drop]'));var _0x59529c=new History(_0x21e517);_0x59529c[_0xe26b('0x6e')]=0xa;_0x59529c['statedesc']='Drop';_0x59529c[_0xe26b('0x6f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x59529c[_0xe26b('0xe4')]=_0x59529c[_0xe26b('0x6f')];_0x59529c[_0xe26b('0xe5')]=_0x21e517[_0xe26b('0xe5')];_0x59529c[_0xe26b('0xe6')]=_0x21e517[_0xe26b('0xe6')];hopperUtils[_0xe26b('0xcb')](_0x59529c)['catch'](loggerCatch(_0xe26b('0xe7')));}})[_0xe26b('0xa1')](function(){if(_0x1640c7)hopperUtils[_0xe26b('0xe8')](_0x21e517,_0x14579e,_0x48cc1d)['then'](function(){return 0x1;});});}else{this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xe9')]+=0x1;_0x21e517[_0xe26b('0x6e')]=0xb;_0x21e517[_0xe26b('0xea')]=_0xe26b('0xeb');_0x21e517['dropreason']=_0xe26b('0xec');_0x21e517[_0xe26b('0xed')]+=0x1;_0x21e517['countglobal']+=0x1;_0x14579e=this[_0xe26b('0x1d')][_0x3696ad['queue']]['dialAbandonedRetryFrequency'];_0x48cc1d=this[_0xe26b('0x1d')][_0x3696ad['queue']][_0xe26b('0xda')];hopperUtils[_0xe26b('0xdb')](_0x21e517,_0x21e517[_0xe26b('0x6e')],_0x53eac2[_0xe26b('0xdc')])[_0xe26b('0xa1')](function(_0x145634){if(_0x21e517[_0xe26b('0xed')]>=_0x5fb2a1[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xee')]){_0x5fb2a1[_0xe26b('0xef')](_0x21e517,_0x145634[_0xe26b('0xf0')]);}else{hopperUtils[_0xe26b('0xf1')]({'active':![],'countabandonedretry':_0x21e517[_0xe26b('0xed')],'scheduledat':moment()[_0xe26b('0xdf')](_0x5fb2a1[_0xe26b('0x1d')][_0x3696ad[_0xe26b('0xc2')]][_0xe26b('0xf2')],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x53eac2[_0xe26b('0xe0')],'ListId':_0x53eac2['ListId'],'VoiceQueueId':_0x53eac2[_0xe26b('0xe2')]||undefined,'CampaignId':_0x53eac2['CampaignId']||undefined})[_0xe26b('0xa5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x31adc8=new History(_0x21e517);_0x31adc8['state']=0xb;_0x31adc8['statedesc']='Abandoned';_0x31adc8[_0xe26b('0x6f')]=moment()[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x31adc8[_0xe26b('0xe4')]=_0x31adc8[_0xe26b('0x6f')];_0x31adc8[_0xe26b('0xe5')]=_0x21e517[_0xe26b('0xe5')];_0x31adc8[_0xe26b('0xe6')]=_0x21e517[_0xe26b('0xe6')];hopperUtils[_0xe26b('0xcb')](_0x31adc8)['catch'](loggerCatch(_0xe26b('0xf4')));}})[_0xe26b('0xa1')](function(){if(_0x1640c7)hopperUtils['swapAdditionalPhones'](_0x21e517,_0x14579e,_0x48cc1d)[_0xe26b('0xa1')](function(){return 0x1;});});}}}};Dialer[_0xe26b('0x17')]['syncNewExten']=function(_0x3f5e7e){if(this[_0xe26b('0x23')][_0x3f5e7e[_0xe26b('0xc4')]]){this[_0xe26b('0x23')][_0x3f5e7e['uniqueid']][_0xe26b('0xf5')]=_0x3f5e7e[_0xe26b('0xf5')];}if(this[_0xe26b('0xc3')][_0x3f5e7e[_0xe26b('0xc4')]]){this['uniqueId'][_0x3f5e7e[_0xe26b('0xc4')]][_0xe26b('0xf5')]=_0x3f5e7e['channel'];}};Dialer['prototype'][_0xe26b('0x36')]=function(_0x2c7c8c){if(!this['actions'][_0x2c7c8c[_0xe26b('0xf6')]]){return;}var _0x450521=this[_0xe26b('0x1d')][this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]]['queue']][_0xe26b('0xf7')]||'rrmemory';if(_0x450521===_0xe26b('0xf8')){if(this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]]&&_['isNil'](this[_0xe26b('0x23')][_0x2c7c8c['actionid']][_0xe26b('0xf9')])&&_0x2c7c8c['status']==='1'&&_0x2c7c8c[_0xe26b('0xfa')]==='0'){if(this[_0xe26b('0x1f')][_0x2c7c8c[_0xe26b('0xfb')]]){if(!this[_0xe26b('0x1f')][_0x2c7c8c[_0xe26b('0xfb')]]['locked']){this[_0xe26b('0x1f')][_0x2c7c8c[_0xe26b('0xfb')]][_0xe26b('0xf9')]=!![];this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]][_0xe26b('0xf9')]=!![];this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]]['stateinterface']=_0x2c7c8c[_0xe26b('0xfb')];}}}}else if(_0x450521===_0xe26b('0xfc')){if(this['actions'][_0x2c7c8c[_0xe26b('0xf6')]]){if(this[_0xe26b('0x1f')][_0x2c7c8c[_0xe26b('0xfb')]]){this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]]['stateinterface']=_0x2c7c8c[_0xe26b('0xfb')];if(_['isNil'](this[_0xe26b('0xfd')][this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]]['queue']])){this['queueBooked'][this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]][_0xe26b('0xc2')]]=[];}this[_0xe26b('0xfd')][this[_0xe26b('0x23')][_0x2c7c8c['actionid']]['queue']][_0xe26b('0x9d')](_[_0xe26b('0x5f')](_['pick'](this[_0xe26b('0x23')][_0x2c7c8c[_0xe26b('0xf6')]],['idHopper',_0xe26b('0xfb')]),{'status':_0x2c7c8c[_0xe26b('0x89')],'paused':_0x2c7c8c[_0xe26b('0xfa')]}));}}}};Dialer['prototype'][_0xe26b('0x38')]=function(_0x1ceed0){if(!this[_0xe26b('0x23')][_0x1ceed0['actionid']]){return;}var _0x3d980f=this;var _0x339f11=this[_0xe26b('0x1d')][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]]['queue']];var _0x4df5ba=_0x339f11[_0xe26b('0xf7')]||_0xe26b('0xfc');if(_0x4df5ba===_0xe26b('0xf8')){if(this[_0xe26b('0x23')][_0x1ceed0['actionid']]&&this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]]['stateinterface']){this[_0xe26b('0x1c')][_0xe26b('0xfe')](this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xff')],this[_0xe26b('0x23')][_0x1ceed0['actionid']][_0xe26b('0xfb')])['catch'](function(_0x58536b){logger['error'](_0xe26b('0x100'),util[_0xe26b('0x66')](_0x58536b,{'showHidden':![],'depth':null}));})[_0xe26b('0x1a')](function(){_0x3d980f[_0xe26b('0x101')](_0x3d980f[_0xe26b('0x1d')][_0x3d980f['actions'][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]]);_0x3d980f['agents'][_0x3d980f[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xfb')]][_0xe26b('0xf9')]=![];delete _0x3d980f[_0xe26b('0x23')][_0x1ceed0['actionid']];unlockQueueStatus(_0x339f11);});}else{this[_0xe26b('0x101')](this[_0xe26b('0x1d')][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]]);hopperUtils[_0xe26b('0xf1')]({'active':![],'ContactId':this[_0xe26b('0x23')][_0x1ceed0['actionid']][_0xe26b('0xe0')],'ListId':this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xe1')],'VoiceQueueId':this[_0xe26b('0x23')][_0x1ceed0['actionid']][_0xe26b('0xe2')]||undefined,'CampaignId':this['actions'][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x102')));delete this[_0xe26b('0x23')][_0x1ceed0['actionid']];unlockQueueStatus(_0x339f11);}}else if(_0x4df5ba===_0xe26b('0xfc')){var _0x3e57fc;if(this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]]&&!_[_0xe26b('0x46')](this[_0xe26b('0xfd')][this[_0xe26b('0x23')][_0x1ceed0['actionid']][_0xe26b('0xc2')]])){if(this['queueBookedRR'][_0x3d980f[_0xe26b('0x23')][_0x1ceed0['actionid']]['queue']]){this['queueBookedRR'][_0x3d980f['actions'][_0x1ceed0['actionid']][_0xe26b('0xc2')]]=this[_0xe26b('0x103')][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]]?this['queueBookedRR'][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]]:this['queueBooked'][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]]?this[_0xe26b('0xfd')][this['actions'][_0x1ceed0[_0xe26b('0xf6')]][_0xe26b('0xc2')]][_0xe26b('0x104')]||0x0:0x0;}this[_0xe26b('0xfd')][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]]['queue']][_0xe26b('0x104')]=this[_0xe26b('0x103')][this[_0xe26b('0x23')][_0x1ceed0[_0xe26b('0xf6')]]['queue']];for(var _0x11d19d=0x0;_0x11d19d=_0x1acea3[_0xe26b('0x127')]){_0x1f435c[_0xe26b('0x128')](_0x169efc,_0x1f6ccd,_0x197033,_0xe26b('0x129'));}else{if(_0x169efc[_0xe26b('0x11f')]>=_0x1acea3['dialMachineMaxRetry']){_0x1f435c[_0xe26b('0x12a')](_0x169efc,_0x1f6ccd,_0x197033,_0xe26b('0x12b'));}else{hopperUtils[_0xe26b('0xf1')]({'active':![],'countmachineretry':_0x169efc[_0xe26b('0x11f')],'scheduledat':moment()[_0xe26b('0xdf')](_0x1acea3['dialMachineRetryFrequency'],_0xe26b('0xf3'))[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x169efc[_0xe26b('0xe0')],'ListId':_0x169efc[_0xe26b('0xe1')],'VoiceQueueId':_0x169efc['VoiceQueueId']||undefined,'CampaignId':_0x169efc[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x12c')));_0x1f6ccd({'reschedule':0x1});}}});}if(_0x285d71[_0xe26b('0x3e')]===_0xe26b('0xc5')&&this[_0xe26b('0x1e')][_0x285d71['queue']][_0xe26b('0x113')]&&_0x23e1b1['value']===_0xe26b('0x115')){delete this[_0xe26b('0xc3')][_0x23e1b1[_0xe26b('0xc4')]];this[_0xe26b('0x101')](this[_0xe26b('0x1e')][_0x285d71['queue']]);_0x1570c3=new Hangup(_0x285d71,_0x23e1b1);_0x1570c3[_0xe26b('0x6e')]=0x12;_0x1570c3[_0xe26b('0xea')]=_0xe26b('0x12d');_0x1570c3['membername']='AMD';ami[_0xe26b('0x3d')](_0xe26b('0x118'),ut[_0xe26b('0x119')](_0x1570c3,_0xe26b('0x121')));this[_0xe26b('0x11a')](_0x1570c3,_0xe26b('0x12e'),_0xe26b('0x12f'));}if(_0x285d71[_0xe26b('0x3e')]===_0xe26b('0xc5')&&this[_0xe26b('0x1e')][_0x285d71['queue']][_0xe26b('0x113')]&&_0x23e1b1[_0xe26b('0x114')]===_0xe26b('0x11c')){return new Promise(function(_0x56bb0c,_0x293fd3){delete _0x1f435c[_0xe26b('0xc3')][_0x23e1b1[_0xe26b('0xc4')]];_0x1f435c[_0xe26b('0x101')](_0x1f435c['campaigns'][_0x285d71['queue']]);_0x1f435c[_0xe26b('0x1e')][_0x285d71['queue']][_0xe26b('0xc8')]+=0x1;_0x1f435c['campaigns'][_0x285d71[_0xe26b('0xc2')]][_0xe26b('0x11d')]+=0x1;var _0x491f97=_0x1f435c[_0xe26b('0x1e')][_0x285d71[_0xe26b('0xc2')]];var _0x1dd40a=new Hangup(_0x285d71,_0x23e1b1);_0x1dd40a[_0xe26b('0x6e')]=0x13;_0x1dd40a[_0xe26b('0xea')]='Machine';_0x1dd40a[_0xe26b('0x116')]=_0xe26b('0x117');_0x1dd40a[_0xe26b('0x11f')]+=0x1;_0x1dd40a[_0xe26b('0x120')]+=0x1;_0x1dd40a['amd']=!![];ami[_0xe26b('0x3d')](_0xe26b('0x118'),ut['buildObj'](_0x1dd40a,_0xe26b('0x121')));hopperUtils['createHistory'](_0x1dd40a)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x122')));if(_0x1dd40a[_0xe26b('0x130')]+_0x1dd40a['countcongestionretry']+_0x1dd40a[_0xe26b('0x124')]+_0x1dd40a[_0xe26b('0x125')]+_0x1dd40a[_0xe26b('0xdd')]+_0x1dd40a[_0xe26b('0xed')]+_0x1dd40a[_0xe26b('0x11f')]+_0x1dd40a['countagentrejectretry']>=_0x491f97[_0xe26b('0x127')]){_0x1f435c[_0xe26b('0x128')](_0x1dd40a,_0x56bb0c,_0x293fd3,_0xe26b('0x129'));}else{if(_0x1dd40a['countmachineretry']>=_0x491f97[_0xe26b('0x131')]){_0x1f435c[_0xe26b('0x12a')](_0x1dd40a,_0x56bb0c,_0x293fd3,'reason\x2019\x20machine....');}else{hopperUtils[_0xe26b('0xf1')]({'active':![],'countmachineretry':_0x1dd40a[_0xe26b('0x11f')],'scheduledat':moment()[_0xe26b('0xdf')](_0x491f97[_0xe26b('0x132')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1dd40a[_0xe26b('0xe0')],'ListId':_0x1dd40a['ListId'],'VoiceQueueId':_0x1dd40a[_0xe26b('0xe2')]||undefined,'CampaignId':_0x1dd40a[_0xe26b('0xe3')]||undefined})['catch'](loggerCatch(_0xe26b('0x12c')));_0x56bb0c({'reschedule':0x1});}}});}}};Dialer[_0xe26b('0x17')][_0xe26b('0x32')]=function(_0x1a4252){var _0x485ac6=this[_0xe26b('0xc3')][_0x1a4252[_0xe26b('0xc4')]];var _0x4c790f;if(_0x485ac6&&_0x485ac6[_0xe26b('0x3e')]===_0xe26b('0xc5')){delete this[_0xe26b('0xc3')][_0x1a4252[_0xe26b('0xc4')]];this['updateOriginated'](this[_0xe26b('0x1e')][_0x485ac6[_0xe26b('0xc2')]]);this[_0xe26b('0x1e')][_0x485ac6[_0xe26b('0xc2')]]['ivrAnswerCallsDay']+=0x1;_0x4c790f=new Hangup(_0x485ac6,_0x1a4252);hopperUtils['createHistory'](_0x4c790f)[_0xe26b('0xa5')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xe26b('0xcd')](_0x4c790f)['catch'](loggerCatch(_0xe26b('0x133')));}if(_0x485ac6&&_0x485ac6[_0xe26b('0x3e')]!==_0xe26b('0xc5')&&isNotNull(this[_0xe26b('0x1d')][_0x485ac6[_0xe26b('0xc2')]][_0xe26b('0x134')])){delete this[_0xe26b('0xc3')][_0x1a4252[_0xe26b('0xc4')]];this[_0xe26b('0x101')](this['voiceQueues'][_0x485ac6[_0xe26b('0xc2')]]);this[_0xe26b('0x1d')][_0x485ac6[_0xe26b('0xc2')]][_0xe26b('0xc8')]+=0x1;this[_0xe26b('0x1d')][_0x485ac6[_0xe26b('0xc2')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4c790f=new Hangup(_0x485ac6,_0x1a4252);_0x4c790f['state']=0x10;_0x4c790f[_0xe26b('0xea')]='AnswerAGI';_0x4c790f[_0xe26b('0x116')]=_0xe26b('0x135');hopperUtils[_0xe26b('0xcb')](_0x4c790f)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xe26b('0xcd')](_0x4c790f)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x133')));}if(_0x485ac6&&_0x485ac6[_0xe26b('0x3e')]!=='ivr'&&!isNotNull(this[_0xe26b('0x1d')][_0x485ac6[_0xe26b('0xc2')]][_0xe26b('0x134')])){if(_0x1a4252[_0xe26b('0x136')]===_0xe26b('0x137')){delete this[_0xe26b('0xc3')][_0x1a4252[_0xe26b('0xc4')]];this[_0xe26b('0x1d')][_0x485ac6['queue']][_0xe26b('0xc8')]+=0x1;const _0x540cf1=new AgentComplete(_0x485ac6,_0x1a4252);_0x540cf1[_0xe26b('0xe3')]=this['voiceQueues'][_0x485ac6['queue']]['id'];hopperUtils['createHistory'](_0x540cf1)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0xcc')));hopperUtils[_0xe26b('0xcd')](_0x540cf1)['catch'](loggerCatch(_0xe26b('0xce')));}else{delete this[_0xe26b('0xc3')][_0x1a4252['uniqueid']];this['updateOriginated'](this[_0xe26b('0x1d')][_0x485ac6[_0xe26b('0xc2')]]);this[_0xe26b('0x1d')][_0x485ac6['queue']][_0xe26b('0x138')]+=0x1;_0x4c790f=new Hangup(_0x485ac6,_0x1a4252);_0x4c790f[_0xe26b('0x6e')]=0xc;_0x4c790f[_0xe26b('0xea')]=_0x1a4252[_0xe26b('0x136')];_0x4c790f[_0xe26b('0x116')]=_0xe26b('0x139');hopperUtils[_0xe26b('0xcb')](_0x4c790f)['catch'](loggerCatch(_0xe26b('0x13a')));hopperUtils[_0xe26b('0xcd')](_0x4c790f)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x133')));}}};Dialer['prototype'][_0xe26b('0xb')]=function(_0x2f40e7){var _0x3f0c81=this;if(!_0x3f0c81[_0xe26b('0x26')][_0x2f40e7['name']]){_0x3f0c81['queuesSummary'][_0x2f40e7[_0xe26b('0x44')]]={'running':![]};}else if(_0x3f0c81['queuesSummary'][_0x2f40e7[_0xe26b('0x44')]]['running']===!![]){return;}else if(_0x3f0c81[_0xe26b('0x26')][_0x2f40e7[_0xe26b('0x44')]][_0xe26b('0x13b')]===![]){_0x3f0c81['queuesSummary'][_0x2f40e7[_0xe26b('0x44')]]['running']=!![];}var _0x29eb04=_0x3f0c81[_0xe26b('0x1d')][_0x2f40e7['name']];var _0x6071d=_0x29eb04[_0xe26b('0x76')]!==utils[_0xe26b('0x68')][_0xe26b('0x7b')];var _0x371b98=utils['isPreviewCampaign'](_0x29eb04);_0x29eb04['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x29eb04,_0x3f0c81[_0xe26b('0x20')]);Promise[_0xe26b('0x13c')]()[_0xe26b('0xa1')](function(){if(_0x29eb04[_0xe26b('0x13d')]===utils[_0xe26b('0x68')]['INACTIVE']){if(_0x6071d){clearPredictiveAttributes(_0x29eb04);_0x2f40e7['startPredictive']=undefined;_0x2f40e7[_0xe26b('0x60')]=undefined;}if(_0x29eb04[_0xe26b('0x13d')]===utils[_0xe26b('0x68')][_0xe26b('0x7b')]){_0x2f40e7[_0xe26b('0x13e')]=0x0;_0x2f40e7[_0xe26b('0xfa')]=0x0;_0x2f40e7[_0xe26b('0x13f')]=0x0;_0x2f40e7[_0xe26b('0x140')]=0x0;_0x2f40e7['pTalking']=0x0;}}else if(_0x29eb04[_0xe26b('0x13d')]===utils[_0xe26b('0x68')][_0xe26b('0x141')]&&!_0x371b98){return _0x3f0c81[_0xe26b('0x94')](_0x29eb04,!![])['then'](function(){return _0x3f0c81[_0xe26b('0x94')](_0x29eb04,![]);})[_0xe26b('0xa1')](function(){return _0x3f0c81[_0xe26b('0xb2')](_0x29eb04);})[_0xe26b('0xa5')](function(_0x34219a){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0xe26b('0x66')](_0x34219a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x29eb04);});}else{clearPredictiveAttributes(_0x29eb04);}})['then'](function(){var _0x228ae5=_0x2f40e7['compareToOutboundQueue'](_0x29eb04);if(_0x228ae5||_0x29eb04['queueSummaryCountersUpdated']){_0x29eb04[_0xe26b('0x142')]=![];_0x2f40e7['updateReportFromOutboundQueue'](_0x29eb04);Object['assign'](_0x29eb04,_0x2f40e7);emitOutboundVoiceQueueSummary(_0x2f40e7);}_0x3f0c81[_0xe26b('0x26')][_0x29eb04[_0xe26b('0x44')]]['running']=![];})[_0xe26b('0xa5')](function(_0xbe2c8c){logger['error'](_0xe26b('0x143'),util[_0xe26b('0x66')](_0xbe2c8c,{'showHidden':![],'depth':null}));_0x3f0c81['queuesSummary'][_0x29eb04[_0xe26b('0x44')]][_0xe26b('0x13b')]=![];});};Dialer['prototype'][_0xe26b('0x31')]=_[_0xe26b('0x144')](function(){var _0x5e2e35=_['filter'](this['voiceQueues'],function(_0x4babc2){return _0x4babc2[_0xe26b('0x145')];});var _0x5bffee=_[_0xe26b('0x146')](this[_0xe26b('0x1f')],function(_0xdbbe56){return _0xdbbe56['online']&&_0xdbbe56[_0xe26b('0x89')]===_0xe26b('0x8a');});if(_0x5e2e35[_0xe26b('0x9c')]>0x0&&_0x5bffee[_0xe26b('0x9c')]>0x0){return Promise[_0xe26b('0x13c')]()[_0xe26b('0xa1')](cmHopper[_0xe26b('0x147')](_['map'](_0x5e2e35,'id'),previewRecallmeReminderInterval,_[_0xe26b('0x148')](_0x5bffee,'id')))[_0xe26b('0xa1')](function(_0x203063){for(var _0x35264f=0x0;_0x35264f<_0x203063[_0xe26b('0x9c')];_0x35264f++){var _0x1e2851=_0x203063[_0x35264f]['Agent'][_0xe26b('0x44')];if(_0x1e2851)io['to'](util[_0xe26b('0x42')](_0xe26b('0x149'),_0x1e2851))[_0xe26b('0x3d')]('user:dialPreviewRecallReminder',{'hopper':_0x203063[_0x35264f]});}})[_0xe26b('0xa5')](function(_0x7e2ccd){logger[_0xe26b('0x64')](_0xe26b('0x14a'),_0x7e2ccd);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xe26b('0x17')][_0xe26b('0x3a')]=function(){var _0x2ed13a=this;setInterval(function(){_0x2ed13a['clearZombieChannels'](_0x2ed13a['uniqueId'],_0xe26b('0x14b'));_0x2ed13a['clearZombieChannels'](_0x2ed13a['actions'],_0xe26b('0x14c'));},0x32c8);};Dialer[_0xe26b('0x17')][_0xe26b('0x14d')]=function(_0x19458f,_0x108f49){var _0x2ca212=this;for(var _0x29bc8b in _0x19458f){if(typeof _0x19458f[_0x29bc8b]!==_0xe26b('0xad')){this[_0xe26b('0x1b')][_0xe26b('0x18')](function(){if(!_[_0xe26b('0x10f')](_0x19458f[_0x29bc8b])){return ami[_0xe26b('0x9e')]({'action':_0xe26b('0x89'),'channel':_0x19458f[_0x29bc8b][_0xe26b('0xf5')]})[_0xe26b('0xa5')](function(_0x3e6abd){if(_0x3e6abd[_0xe26b('0x76')]===_0xe26b('0x14e')){setTimeout(function(){if(_0x19458f[_0x29bc8b]&&_0x19458f[_0x29bc8b]['type']!=='ivr'){_0x2ca212['updateOriginated'](_0x2ca212[_0xe26b('0x1d')][_0x19458f[_0x29bc8b][_0xe26b('0xc2')]]);logger[_0xe26b('0x64')]('[Dialer][checkChannel]',_0x108f49,_0x29bc8b,_0x19458f[_0x29bc8b]['queue']);delete _0x19458f[_0x29bc8b];}if(_0x19458f[_0x29bc8b]&&_0x19458f[_0x29bc8b][_0xe26b('0x3e')]==='ivr'){_0x2ca212[_0xe26b('0x101')](_0x2ca212[_0xe26b('0x1e')][_0x19458f[_0x29bc8b][_0xe26b('0xc2')]]);logger[_0xe26b('0x64')](_0xe26b('0x14f'),_0x108f49,_0x29bc8b,_0x19458f[_0x29bc8b][_0xe26b('0xc2')]);delete _0x19458f[_0x29bc8b];}},0x2328);}});}});}}};Dialer[_0xe26b('0x17')]['getVoiceQueueRtPauses']=function(_0x4b9731){return Promise[_0xe26b('0x13c')]()[_0xe26b('0xa1')](voiceQueueRt[_0xe26b('0x150')](_0x4b9731))[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x151')));};Dialer[_0xe26b('0x17')][_0xe26b('0x101')]=function(_0x1b8b16){if(!_[_0xe26b('0x52')](_0x1b8b16)&&_0x1b8b16!==null){if(typeof _0x1b8b16[_0xe26b('0x80')]!==_0xe26b('0xad')){if(_0x1b8b16[_0xe26b('0x80')]>0x0){_0x1b8b16['originated']-=0x1;}else{logger[_0xe26b('0x64')](_0xe26b('0x152'));}}}else{logger[_0xe26b('0x64')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x5b9239,_0x5a59d1){var _0x245069=this;return function(_0x2732f3){_0x245069[_0xe26b('0x101')](_0x5a59d1);logger[_0xe26b('0x64')](_0x5b9239,util[_0xe26b('0x66')](_0x2732f3,{'showHidden':![],'depth':null}));};};Dialer[_0xe26b('0x17')][_0xe26b('0x153')]=function(_0x56d729,_0x19606b,_0x4103e2){var _0x2e341c={'state':0x19,'statedesc':_0xe26b('0x154')};this[_0xe26b('0x101')](_0x19606b);this[_0xe26b('0x11a')](_[_0xe26b('0x5f')](_0x2e341c,_[_0xe26b('0x74')](_0x4103e2,['ContactId',_0xe26b('0xe1'),_0xe26b('0x155'),_0xe26b('0xe2'),_0xe26b('0xe3')])),_0xe26b('0x156'),_0xe26b('0x157'));logger[_0xe26b('0x64')](_0x56d729);};Dialer[_0xe26b('0x17')][_0xe26b('0x11a')]=function(_0x18469f,_0x989258,_0x1d6773){hopperUtils[_0xe26b('0xcb')](_0x18469f)['catch'](loggerCatch(_0x989258));hopperUtils[_0xe26b('0xcd')](_0x18469f)[_0xe26b('0xa5')](loggerCatch(_0x1d6773));};Dialer['prototype'][_0xe26b('0xef')]=function(_0x139fef,_0x7f94ec){hopperUtils[_0xe26b('0xcb')](_0x139fef)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0xcc')));if(_0x7f94ec==0x0){hopperUtils[_0xe26b('0xcd')](_0x139fef)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x42e229){return Promise[_0xe26b('0x13c')]()[_0xe26b('0xa1')](cmHopper['handlePreviewRecallNotifications'](_0x42e229['id'],previewRecallmeReminderInterval))[_0xe26b('0xa1')](function(_0x45681a){for(var _0x33ecc3=0x0;_0x33ecc3<_0x45681a['length'];_0x33ecc3++){var _0x310f54=_0x45681a[_0x33ecc3][_0xe26b('0x158')]['name'];if(_0x310f54)io['to'](util[_0xe26b('0x42')](_0xe26b('0x149'),_0x310f54))[_0xe26b('0x3d')](_0xe26b('0x159'),{'hopper':_0x45681a[_0x33ecc3]});}})['catch'](function(){});};Dialer[_0xe26b('0x17')][_0xe26b('0xb0')]=function(_0x5c7a80){var _0x18b455=this;return function(){_0x18b455['handleIvr'](_0x5c7a80);};};Dialer[_0xe26b('0x17')][_0xe26b('0x15a')]=function(_0x299c54,_0x2a5c4c){var _0x572160=this;var _0x1520cb=uuid['v4']();this['actions'][_0x1520cb]=new Action(_0x299c54,_0x2a5c4c,_0x1520cb);return new Promise(function(_0x29285a,_0x2ed6cb){if(_['isUndefined'](_0x299c54)&&typeof _0x299c54!==_0xe26b('0x15b')){return _0x2ed6cb(msgResponse(_0xe26b('0x15c'),_0xe26b('0x95'),_0xe26b('0x15d')));}if(_[_0xe26b('0x52')](_0x2a5c4c['phone'])||_0x2a5c4c[_0xe26b('0x15e')]===null){return _0x2ed6cb(msgResponse(_0xe26b('0x15c'),_0xe26b('0x95'),_0xe26b('0x15f')));}var _0x1f2b4e={'XMD-CALLERID':_0x572160['actions'][_0x1520cb][_0xe26b('0x160')](),'XMD-AGI':_0x299c54[_0xe26b('0x134')]?util[_0xe26b('0x42')](_0xe26b('0x161'),ipAgi,_0x299c54['dialQueueProject']):_0xe26b('0x162'),'XMD-AGIAFTER':_0x299c54['dialQueueProject2']?util[_0xe26b('0x42')]('\x22agi://%s/square,%s\x22',ipAgi,_0x299c54['dialQueueProject2']):_0xe26b('0x162'),'XMD-QUEUE':utils[_0xe26b('0x163')](_0x299c54)?util[_0xe26b('0x42')](_0xe26b('0x164'),_0x299c54[_0xe26b('0x44')],_0x299c54[_0xe26b('0x165')]||'',_0x299c54[_0xe26b('0x166')]?'c':'',_0x299c54['dialQueueTimeout']||0x3):_0xe26b('0x162'),'XMD-CONTACTID':_0x2a5c4c[_0xe26b('0xe0')],'XMD-CDRTYPE':_0xe26b('0x8'),'CALLERID(all)':_0x572160[_0xe26b('0x23')][_0x1520cb]['getCaller'](),'XMD-AMD':_0x299c54['dialAMDActive']?'ACTIVE':_0xe26b('0x162'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x299c54[_0xe26b('0x113')]){_0x1f2b4e[_0xe26b('0x167')]=_0x299c54[_0xe26b('0x168')]||0x9c4;_0x1f2b4e['XMD-AMDGREETING']=_0x299c54[_0xe26b('0x169')]||0x5dc;_0x1f2b4e[_0xe26b('0x16a')]=_0x299c54['dialAMDAfterGreetingSilence']||0x320;_0x1f2b4e[_0xe26b('0x16b')]=_0x299c54[_0xe26b('0x16c')]||0x1388;_0x1f2b4e[_0xe26b('0x16d')]=_0x299c54['dialAMDMinWordLength']||0x64;_0x1f2b4e[_0xe26b('0x16e')]=_0x299c54['dialAMDBetweenWordsSilence']||0x32;_0x1f2b4e[_0xe26b('0x16f')]=_0x299c54[_0xe26b('0x170')]||0x3;_0x1f2b4e['XMD-AMDSILENCETHRESHOLD']=_0x299c54[_0xe26b('0x171')]||0x100;_0x1f2b4e[_0xe26b('0x172')]=_0x299c54['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xe26b('0x163')](_0x299c54)){_0x1f2b4e['XMD-VOICEQUEUEID']=_0x2a5c4c[_0xe26b('0xe2')];}else{_0x1f2b4e[_0xe26b('0x173')]=_0x2a5c4c[_0xe26b('0xe3')];}var _0x295381=utils[_0xe26b('0x174')](_0x2a5c4c['Contact']);Object['assign'](_0x1f2b4e,_0x295381);var _0xc5c751=_0x572160['isTrunkReachable'](_0x299c54[_0xe26b('0x8d')])?utils[_0xe26b('0x175')](_0x299c54[_0xe26b('0x8d')][_0xe26b('0x176')],_0x299c54[_0xe26b('0x177')],_0x299c54[_0xe26b('0x178')]>0x0?utils[_0xe26b('0x179')](_0x299c54['dialOriginateCallerIdNumber'],_0x299c54['dialRandomLastDigitCallerIdNumber']):_0x299c54[_0xe26b('0x17a')]):utils[_0xe26b('0x175')](_[_0xe26b('0x10f')](_0x299c54[_0xe26b('0x8e')])?_0x299c54[_0xe26b('0x8d')][_0xe26b('0x176')]:_0x299c54[_0xe26b('0x8e')]['callerid'],_0x299c54[_0xe26b('0x177')],_0x299c54[_0xe26b('0x178')]>0x0?utils[_0xe26b('0x179')](_0x299c54[_0xe26b('0x17a')],_0x299c54[_0xe26b('0x178')]):_0x299c54[_0xe26b('0x17a')]);if(_0xc5c751){_0x1f2b4e['XMD-ORIGINATECALLERIDNAME']=_0x572160[_0xe26b('0x23')][_0x1520cb][_0xe26b('0x17b')]=utils[_0xe26b('0x17c')](_0xc5c751);_0x1f2b4e['XMD-ORIGINATECALLERIDNUM']=_0x2a5c4c['phone'];}_0x299c54[_0xe26b('0x17d')]=_0x1f2b4e;return ami[_0xe26b('0x9e')]({'actionid':_0x1520cb,'action':_0xe26b('0x15c'),'channel':_0x572160[_0xe26b('0x87')](_0x299c54[_0xe26b('0x8d')])?util[_0xe26b('0x42')](_0xe26b('0x17e'),_0x299c54[_0xe26b('0x8d')]['name'],isNotNull(_0x299c54[_0xe26b('0x17f')])?_0x299c54['dialPrefix']['trim']()||'':'',_0x299c54[_0xe26b('0x180')]>0x0?_0x2a5c4c['phone'][_0xe26b('0x181')](_0x299c54[_0xe26b('0x180')]):_0x2a5c4c['phone']):util[_0xe26b('0x42')](_0xe26b('0x17e'),_[_0xe26b('0x10f')](_0x299c54[_0xe26b('0x8e')])?_0x299c54[_0xe26b('0x8d')][_0xe26b('0x44')]:_0x299c54[_0xe26b('0x8e')][_0xe26b('0x44')],isNotNull(_0x299c54['dialPrefix'])?_0x299c54[_0xe26b('0x17f')][_0xe26b('0x182')]()||'':'',_0x299c54['dialCutDigit']>0x0?_0x2a5c4c[_0xe26b('0x15e')][_0xe26b('0x181')](_0x299c54[_0xe26b('0x180')]):_0x2a5c4c[_0xe26b('0x15e')]),'callerid':_0xc5c751,'Exten':_0xe26b('0x183'),'Context':'from-sip','Priority':'1','variable':_0x1f2b4e,'timeout':(_0x299c54[_0xe26b('0x184')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1520cb})[_0xe26b('0xa1')](function(_0x301729){return _0x29285a(_0x301729);})[_0xe26b('0xa5')](function(_0x1fad5e){_0x299c54[_0xe26b('0x185')]+=0x1;var _0x214ba8=new History(_0x572160[_0xe26b('0x23')][_0x1520cb]);logger[_0xe26b('0x64')](util[_0xe26b('0x42')](_0xe26b('0x186'),JSON[_0xe26b('0x73')](_0x1fad5e)));_0x214ba8[_0xe26b('0x6e')]=0xe;_0x214ba8[_0xe26b('0xea')]=_0xe26b('0x187');_0x214ba8['starttime']=moment()[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x214ba8['endtime']=_0x214ba8[_0xe26b('0x6f')];hopperUtils['createHistory'](_0x214ba8)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x188')));_0x572160['moveContactManagedDialer'](_0x214ba8)['catch'](loggerCatch(_0xe26b('0x188')))[_0xe26b('0x1a')](function(){delete _0x572160['actions'][_0x1520cb];return _0x2ed6cb(msgResponse('originate','Error',_0xe26b('0x189')));});});});};Dialer[_0xe26b('0x17')]['checkRetriveMax']=function(_0x206436,_0x152af5,_0x2a4a9b){var _0x7c36e5=new History(_0x152af5);if(_0x7c36e5[_0xe26b('0x130')]+_0x7c36e5[_0xe26b('0x123')]+_0x7c36e5[_0xe26b('0x124')]+_0x7c36e5['countnosuchnumberretry']+_0x7c36e5[_0xe26b('0xdd')]+_0x7c36e5['countabandonedretry']+_0x7c36e5[_0xe26b('0x11f')]+_0x7c36e5[_0xe26b('0x126')]>=_0x2a4a9b['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x206436){case 0x3:if(_0x7c36e5[_0xe26b('0x124')]>=_0x2a4a9b[_0xe26b('0x18a')]-0x1){return!![];}hopperUtils[_0xe26b('0xf1')]({'active':![],'countnoanswerretry':_0x7c36e5[_0xe26b('0x124')]+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b[_0xe26b('0x18b')],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5['VoiceQueueId']||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x18c')));break;case 0x5:if(_0x7c36e5[_0xe26b('0x130')]>=_0x2a4a9b[_0xe26b('0x18d')]-0x1){return!![];}hopperUtils[_0xe26b('0xf1')]({'active':![],'countbusyretry':_0x7c36e5[_0xe26b('0x130')]+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b[_0xe26b('0x18e')],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x18f')));break;case 0x8:if(_0x7c36e5[_0xe26b('0x123')]>=_0x2a4a9b[_0xe26b('0x190')]-0x1){return!![];}hopperUtils[_0xe26b('0xf1')]({'active':![],'countcongestionretry':_0x7c36e5[_0xe26b('0x123')]+=0x1,'scheduledat':moment()['add'](_0x2a4a9b[_0xe26b('0x191')],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x7c36e5[_0xe26b('0x125')]>=_0x2a4a9b[_0xe26b('0x192')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x7c36e5[_0xe26b('0x125')]+=0x1,'scheduledat':moment()['add'](_0x2a4a9b[_0xe26b('0x193')],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})['catch'](loggerCatch(_0xe26b('0x194')));}break;case 0xa:if(_0x7c36e5[_0xe26b('0xdd')]>=_0x2a4a9b[_0xe26b('0xde')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x7c36e5['countdropretry']+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b[_0xe26b('0xd9')],'minutes')[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5['CampaignId']||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x195')));break;case 0xb:if(_0x7c36e5['countabandonedretry']>=_0x2a4a9b[_0xe26b('0xee')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x7c36e5[_0xe26b('0xed')]+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b['dialAbandonedRetryFrequency'],_0xe26b('0xf3'))[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5['VoiceQueueId']||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x196')));break;case 0x13:if(_0x7c36e5['countmachineretry']>=_0x2a4a9b[_0xe26b('0x131')]-0x1){return!![];}hopperUtils[_0xe26b('0xf1')]({'active':![],'countmachineretry':_0x7c36e5[_0xe26b('0x11f')]+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b[_0xe26b('0x132')],_0xe26b('0xf3'))[_0xe26b('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5['CampaignId']||undefined})['catch'](loggerCatch(_0xe26b('0x12c')));break;case 0x14:if(_0x7c36e5[_0xe26b('0x126')]>=_0x2a4a9b['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xe26b('0xf1')]({'active':![],'countagentrejectretry':_0x7c36e5['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xe26b('0xdf')](_0x2a4a9b['dialAgentRejectRetryFrequency'],'minutes')[_0xe26b('0x42')](_0xe26b('0xc7')),'ContactId':_0x7c36e5[_0xe26b('0xe0')],'ListId':_0x7c36e5[_0xe26b('0xe1')],'VoiceQueueId':_0x7c36e5[_0xe26b('0xe2')]||undefined,'CampaignId':_0x7c36e5[_0xe26b('0xe3')]||undefined})['catch'](loggerCatch(_0xe26b('0x197')));break;default:return!![];}};Dialer['prototype'][_0xe26b('0x10e')]=function(_0xf53dca,_0x3fda51,_0x49c610){var _0x92211c=this;var _0x5dd5df=new History(_0xf53dca);var _0x1baaf7=![];var _0x316b44;var _0xfd5e4f;return new Promise(function(_0x4bb8f1,_0x37c5c4){if(_[_0xe26b('0x52')](_0x3fda51)&&typeof _0x3fda51!=='object'){return _0x37c5c4(msgResponse(_0xe26b('0x198'),'Failure',_0xe26b('0x199')));}if(_[_0xe26b('0x52')](_0x49c610)&&typeof _0x49c610!==_0xe26b('0x15b')){return _0x37c5c4(msgResponse(_0xe26b('0x198'),'Failure',_0xe26b('0x19a')));}hopperUtils[_0xe26b('0xdb')](_0x5dd5df,_0x49c610[_0xe26b('0xc9')],_0x3fda51)[_0xe26b('0xa1')](function(_0x351c1e){if(_0x351c1e['additional']==0x1)_0x1baaf7=!![];switch(_0x49c610[_0xe26b('0xc9')]){case'0':_0x3fda51[_0xe26b('0x19b')]+=0x1;_0x5dd5df[_0xe26b('0x6e')]=0x0;_0x5dd5df[_0xe26b('0xea')]='NoSuchNumber';_0x5dd5df[_0xe26b('0x125')]+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;ami[_0xe26b('0x3d')](_0xe26b('0x19c'),ut[_0xe26b('0x119')](_0xf53dca,_0xe26b('0x19d')));_0x316b44=_0x3fda51[_0xe26b('0x193')];_0xfd5e4f=_0x3fda51[_0xe26b('0xda')];hopperUtils['createHistory'](_0x5dd5df)['catch'](loggerCatch(_0xe26b('0x122')));if(_0x92211c[_0xe26b('0x19e')](0x0,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0x125')]>=_0x3fda51['dialNoSuchNumberMaxRetry']){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x19f'));}else{_0x92211c['stateGlobal'](_0x5dd5df,_0x4bb8f1,_0x37c5c4,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x3fda51[_0xe26b('0x1a0')]+=0x1;_0x5dd5df['state']=0x3;_0x5dd5df[_0xe26b('0xea')]=_0xe26b('0x1a1');_0x5dd5df[_0xe26b('0x124')]+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;var _0x14de9f=ut[_0xe26b('0x1a2')](_0xf53dca,_0x3fda51);ami[_0xe26b('0x3d')](_0xe26b('0x1a3'),_0x14de9f);_0x316b44=_0x3fda51['dialNoAnswerRetryFrequency'];_0xfd5e4f=_0x3fda51['callAdditionalPhoneAfterMin'];hopperUtils[_0xe26b('0xcb')](_0x5dd5df)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1a4')));if(_0x92211c['checkRetriveMax'](0x3,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0x124')]>=_0x3fda51[_0xe26b('0x18a')]){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1a5'));}else{_0x92211c['stateGlobal'](_0x5dd5df,_0x4bb8f1,_0x37c5c4,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3fda51[_0xe26b('0x1a6')]+=0x1;_0x5dd5df[_0xe26b('0x6e')]=0x5;_0x5dd5df[_0xe26b('0xea')]='Busy';_0x5dd5df[_0xe26b('0x130')]+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;ami[_0xe26b('0x3d')](_0xe26b('0x1a7'),ut[_0xe26b('0x119')](_0xf53dca,_0xe26b('0x1a8')));_0x316b44=_0x3fda51[_0xe26b('0x18e')];_0xfd5e4f=_0x3fda51[_0xe26b('0xda')];hopperUtils[_0xe26b('0xcb')](_0x5dd5df)['catch'](loggerCatch(_0xe26b('0x1a9')));if(_0x92211c[_0xe26b('0x19e')](0x5,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0x130')]>=_0x3fda51[_0xe26b('0x18d')]){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,'reason\x205\x20busy');}else{_0x92211c[_0xe26b('0x128')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1aa'));}}break;case'8':_0x3fda51[_0xe26b('0x1ab')]+=0x1;_0x5dd5df[_0xe26b('0x6e')]=0x8;_0x5dd5df[_0xe26b('0xea')]=_0xe26b('0x1ac');_0x5dd5df['countcongestionretry']+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;_0x316b44=_0x3fda51[_0xe26b('0x191')];_0xfd5e4f=_0x3fda51[_0xe26b('0xda')];ami[_0xe26b('0x3d')](_0xe26b('0x1ad'),ut[_0xe26b('0x119')](_0xf53dca,_0xe26b('0x1ae')));hopperUtils[_0xe26b('0xcb')](_0x5dd5df)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1af')));if(_0x92211c[_0xe26b('0x19e')](0x8,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df['countcongestionretry']>=_0x3fda51[_0xe26b('0x190')]){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b0'));}else{_0x92211c[_0xe26b('0x128')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b0'));}}break;case'11':_0x3fda51[_0xe26b('0x1b1')]+=0x1;_0x5dd5df['state']=0xb;_0x5dd5df[_0xe26b('0xea')]=_0xe26b('0xeb');_0x5dd5df['countabandonedretry']+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;_0x316b44=_0x3fda51[_0xe26b('0xf2')];_0xfd5e4f=_0x3fda51['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x5dd5df)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0xf4')));if(_0x92211c['checkRetriveMax'](0xb,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0xed')]>=_0x3fda51[_0xe26b('0xee')]){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b2'));}else{_0x92211c[_0xe26b('0x128')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b2'));}}break;case'20':_0x3fda51[_0xe26b('0x1b3')]+=0x1;_0x5dd5df[_0xe26b('0x6e')]=0x14;_0x5dd5df[_0xe26b('0xea')]=_0xe26b('0x1b4');_0x5dd5df[_0xe26b('0x126')]+=0x1;_0x5dd5df[_0xe26b('0x120')]+=0x1;_0x316b44=_0x3fda51[_0xe26b('0x1b5')];_0xfd5e4f=_0x3fda51[_0xe26b('0xda')];ami[_0xe26b('0x3d')]('custom:agentreject',ut[_0xe26b('0x119')](_0xf53dca,_0xe26b('0x1b6')));hopperUtils[_0xe26b('0xcb')](_0x5dd5df)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1b7')));if(_0x92211c[_0xe26b('0x19e')](0x14,_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0x126')]>=_0x3fda51[_0xe26b('0x1b8')]){_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b9'));}else{_0x92211c[_0xe26b('0x128')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0xe26b('0x1b9'));}}break;default:_0x3fda51['outboundUnknownCallsDay']+=0x1;_0x5dd5df[_0xe26b('0x6e')]=0xc;_0x5dd5df['statedesc']=_0x49c610['reason'];_0x316b44=_0x3fda51['dialAgentRejectRetryFrequency'];_0xfd5e4f=_0x3fda51[_0xe26b('0xda')];hopperUtils['createHistory'](_0x5dd5df)[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1ba')));if(_0x92211c[_0xe26b('0x19e')](_0x49c610['reason'],_0xf53dca,_0x3fda51)&&!_0x1baaf7){if(_0x5dd5df[_0xe26b('0x130')]+_0x5dd5df[_0xe26b('0x123')]+_0x5dd5df[_0xe26b('0x124')]+_0x5dd5df[_0xe26b('0x125')]+_0x5dd5df[_0xe26b('0xdd')]+_0x5dd5df[_0xe26b('0xed')]+_0x5dd5df[_0xe26b('0x11f')]+_0x5dd5df[_0xe26b('0x126')]>=_0x3fda51[_0xe26b('0x127')]){_0x92211c[_0xe26b('0x128')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0x49c610[_0xe26b('0xc9')]);}else{_0x92211c[_0xe26b('0x12a')](_0x5dd5df,_0x4bb8f1,_0x37c5c4,_0x49c610[_0xe26b('0xc9')]);}}}})[_0xe26b('0xa1')](function(){if(_0x1baaf7){hopperUtils['swapAdditionalPhones'](_0x5dd5df,_0x316b44,_0xfd5e4f)[_0xe26b('0xa1')](function(){return _0x4bb8f1(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x36a66b,_0x4851f8,_0x587446,_0x22168f){var _0x1d3a06=new Final(_0x36a66b);_0x1d3a06['state']=0xf;_0x1d3a06['statedesc']=_0xe26b('0x1bb');this[_0xe26b('0x12a')](_0x1d3a06,_0x4851f8,_0x587446,_0x22168f);};Dialer['prototype'][_0xe26b('0x12a')]=function(_0x4f039f,_0x4c7709,_0x130d74,_0x3f1085){hopperUtils[_0xe26b('0xcd')](_0x4f039f)[_0xe26b('0xa1')](function(){return _0x4c7709(msgResponse('[callProgressDetecting]',_0xe26b('0x1bc'),_0x3f1085));})[_0xe26b('0xa5')](function(){return _0x130d74(msgResponse(_0xe26b('0x1bd'),_0xe26b('0x95'),_0xe26b('0x1be')));});};Dialer[_0xe26b('0x17')][_0xe26b('0xa')]=function(_0x30275d){var _0x3723ea=_0x30275d[_0xe26b('0x1bf')]/0x64;var _0x2f249f=_0x30275d[_0xe26b('0xd3')]/(_0x30275d[_0xe26b('0xd3')]+_0x30275d['outboundAnswerCallsDay']);var _0x4b9e8b=Math['round'](_0x30275d[_0xe26b('0x1c0')]*(_0x30275d[_0xe26b('0x1c1')]/0x64));var _0x21a467=Math[_0xe26b('0x1c2')](_0x30275d[_0xe26b('0x1c0')]*(_0x30275d[_0xe26b('0x1c3')]/0x64));var _0x3d96e2=_0x30275d[_0xe26b('0x13e')]+_0x30275d['talking'];var _0x324d00=Math[_0xe26b('0x1c4')](_0x30275d[_0xe26b('0x58')]*_0x30275d[_0xe26b('0x5c')]*_0x30275d[_0xe26b('0x1c5')]*_0x30275d[_0xe26b('0x1c6')]);if(_[_0xe26b('0x52')](_0x30275d['startProgressive'])){if(!_[_0xe26b('0x52')](_0x30275d[_0xe26b('0x24')])){_0x30275d[_0xe26b('0x24')]=undefined;loggerPredictive['error'](_0xe26b('0x1c7'),_0xe26b('0x1c8'));}if(!_[_0xe26b('0x52')](_0x30275d['handlePredictive'])){loggerPredictive[_0xe26b('0x64')]('[startMethodPredictive][StartProgressive]',_0xe26b('0x1c9'));clearInterval(_0x30275d['handlePredictive']);_0x30275d[_0xe26b('0x63')]=undefined;}_0x30275d['startProgressive']=moment()['format'](_0xe26b('0xc7'));loggerPredictive[_0xe26b('0x47')](_0x30275d[_0xe26b('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x30275d[_0xe26b('0x60')]);this[_0xe26b('0xb4')](_0x30275d,0x1);}else if(ifInterval(_0x30275d['dialPredictiveInterval'],_0x30275d[_0xe26b('0x60')])){this['handlePower'](_0x30275d,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x30275d[_0xe26b('0x60')],_0x30275d[_0xe26b('0x44')]);_0x30275d['erlangCalls']=0x0;_0x30275d[_0xe26b('0xd4')]=0x0;}else if(_0x3723ea<_0x2f249f&&_0x30275d[_0xe26b('0x1ca')]===_0xe26b('0x1cb')){clearPredictiveAttributes(_0x30275d);loggerPredictive[_0xe26b('0x47')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x2f249f,'startProgressive',_0x30275d[_0xe26b('0x44')]);}else if(_0x324d00<_0x30275d['predictiveIntervalErlangCallsDroppedCalls']&&_0x30275d[_0xe26b('0x1ca')]===_0xe26b('0x1cb')){clearPredictiveAttributes(_0x30275d);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x1cc'),_0xe26b('0x1cd'),_0x324d00,_0xe26b('0x1ce'),_0x30275d[_0xe26b('0xd4')],_0xe26b('0x60'),_0x30275d['name']);}else if(!ifInterval(_0x30275d[_0xe26b('0x1cf')],_0x30275d[_0xe26b('0x60')])&&_[_0xe26b('0x52')](_0x30275d['startPredictive'])&&!_[_0xe26b('0x52')](_0x30275d[_0xe26b('0x60')])){_0x30275d[_0xe26b('0x24')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe26b('0x47')](_0x30275d[_0xe26b('0x44')],_0xe26b('0x1d0'),_0x30275d[_0xe26b('0x24')]);hopperUtils[_0xe26b('0x1d1')](_0x30275d['dialPredictiveInterval'])[_0xe26b('0xa1')](this[_0xe26b('0x1d2')](_0x30275d))[_0xe26b('0xa1')](mergeDataErlangB(_0x30275d))[_0xe26b('0xa1')](this[_0xe26b('0x1d3')](_0x30275d))[_0xe26b('0xa5')](loggerCatchPredictive(_0xe26b('0x1d4'),_0x30275d));}else if(!ifInterval(_0x30275d[_0xe26b('0x1cf')],_0x30275d[_0xe26b('0x24')])){_0x30275d[_0xe26b('0xd4')]=0x0;_0x30275d[_0xe26b('0x24')]=moment()['format'](_0xe26b('0xc7'));loggerPredictive[_0xe26b('0x47')](_0x30275d['name'],_0xe26b('0x1d5'),_0x30275d[_0xe26b('0x24')]);clearInterval(_0x30275d['handlePredictive']);_0x30275d[_0xe26b('0x63')]=undefined;hopperUtils['avgHandleTime'](_0x30275d[_0xe26b('0x1cf')])[_0xe26b('0xa1')](this['getDataPredictive'](_0x30275d))['then'](mergeDataErlangB(_0x30275d))[_0xe26b('0xa1')](this[_0xe26b('0x1d3')](_0x30275d))[_0xe26b('0xa5')](loggerCatchPredictive(_0xe26b('0x1d6'),_0x30275d));}else if(_0x30275d['predictiveIntervalAvailable']&&_0x3d96e2<_0x30275d['predictiveIntervalAvailable']-_0x21a467){clearPredictiveAttributes(_0x30275d);loggerPredictive[_0xe26b('0x47')](_0x30275d['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3d96e2,_0xe26b('0x1d7'),_0x30275d[_0xe26b('0x1c0')],'-',_0x21a467,'=',_0x30275d[_0xe26b('0x1c0')]-_0x21a467,')');}else if(_0x30275d[_0xe26b('0x1c0')]&&_0x3d96e2>_0x30275d['predictiveIntervalAvailable']+_0x4b9e8b){clearPredictiveAttributes(_0x30275d);loggerPredictive[_0xe26b('0x47')](_0x30275d[_0xe26b('0x44')],_0xe26b('0x1d8'),_0x3d96e2,')\x20are\x20more\x20than\x20threshold\x20(',_0x30275d['predictiveIntervalAvailable'],'+',_0x4b9e8b,'=',_0x30275d[_0xe26b('0x1c0')]+_0x4b9e8b,')');}};Dialer[_0xe26b('0x17')][_0xe26b('0x1d2')]=function(_0x59d8c5){var _0x2ea3c9=this;return function(_0x39a024){return new Promise(function(_0x4528d4,_0x148959){_['merge'](_0x59d8c5,_0x39a024[0x0]);if(checkGetDataPredictive(_0x39a024[0x0])){var _0xd6c769=_0x59d8c5[_0xe26b('0x1c0')]=_0x59d8c5[_0xe26b('0x140')]+_0x59d8c5[_0xe26b('0x13e')];var _0x5c5362=_0x59d8c5[_0xe26b('0x1cf')]*0x3c;var _0x56ba1b=_0x39a024[0x0][_0xe26b('0x50')]+_0x39a024[0x0][_0xe26b('0x54')];var _0x3e5ba1=(_0x39a024[0x0]['predictiveIntervalAnsweredCalls']+_0x39a024[0x0][_0xe26b('0x1d9')]+_0x39a024[0x0][_0xe26b('0x4d')])/_0x39a024[0x0]['predictiveIntervalTotalCalls'];_0x59d8c5[_0xe26b('0x1c5')]=_0x3e5ba1>0x0?_0x3e5ba1:0x1;switch(_0x59d8c5['dialPredictiveOptimization']){case _0xe26b('0x1cb'):var _0x2b2018=_0x59d8c5['dialPredictiveOptimizationPercentage']/0x64;return _0x2ea3c9[_0xe26b('0x1da')](_0xd6c769,_0x5c5362,_0x56ba1b,_0x3e5ba1,_0x2b2018)[_0xe26b('0xa1')](function(_0x48d917){return _0x4528d4(_0x48d917);});case _0xe26b('0x1db'):var _0x24c519=_0x59d8c5[_0xe26b('0x1bf')]/0x64;return _0x2ea3c9[_0xe26b('0x1dc')](_0xd6c769,_0x5c5362,_0x56ba1b,_0x3e5ba1,_0x24c519)[_0xe26b('0xa1')](function(_0x1d1d92){return _0x4528d4(_0x1d1d92);});default:return _0x148959(msgResponse(_0xe26b('0x1dd'),'Failure',_0xe26b('0x1de')));}}else{return _0x148959(msgResponse('[getDataPredictive]',_0xe26b('0x95'),_0xe26b('0x1df')));}});};};Dialer[_0xe26b('0x17')][_0xe26b('0x1e0')]=function(_0x1a1e54){var _0x2083ab=this;return function(_0x57d598){return new Promise(function(_0x168ad6,_0x3d7e00){_['merge'](_0x1a1e54,_0x57d598[0x0]);if(checkGetDataPredictive(_0x57d598[0x0])){loggerPredictive[_0xe26b('0x47')](JSON[_0xe26b('0x73')](_0x57d598[0x0]));if(_0x1a1e54[_0xe26b('0x1ca')]==='dropRate'){return _0x2083ab[_0xe26b('0x150')](_0x1a1e54['id'])[_0xe26b('0xa1')](function(_0x3b9c6a){var _0x4f1491=_0x1a1e54[_0xe26b('0x1e1')]-_0x3b9c6a[0x0]['outboundQueuePauses'];var _0x5ad023=_0x1a1e54['dialPredictiveInterval']*0x3c;var _0x2d0c62=_0x57d598[0x0][_0xe26b('0x50')]+_0x57d598[0x0]['predictiveIntervalAvgHoldtime'];var _0x5005b5=(_0x57d598[0x0][_0xe26b('0x4a')]+_0x57d598[0x0][_0xe26b('0x1d9')]+_0x57d598[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57d598[0x0][_0xe26b('0x49')];var _0x498e40=_0x1a1e54[_0xe26b('0x1bf')]/0x64;_0x1a1e54['predictiveIntervalPauses']=_0x3b9c6a[0x0][_0xe26b('0x1e2')]||0x0;_0x1a1e54['predictiveIntervalHitRate']=_0x5005b5>0x0?_0x5005b5:0x1;return _0x2083ab[_0xe26b('0x1da')](_0x4f1491,_0x5ad023,_0x2d0c62,_0x5005b5,_0x498e40);})[_0xe26b('0xa1')](function(_0x31ae63){return _0x168ad6(_0x31ae63);})[_0xe26b('0xa5')](function(_0x26a5f1){return _0x3d7e00(msgResponse(_0xe26b('0x1e3'),_0xe26b('0x95'),JSON[_0xe26b('0x73')](_0x26a5f1)));});}if(_0x1a1e54[_0xe26b('0x1ca')]===_0xe26b('0x1db')){return _0x2083ab['getVoiceQueueRtPauses'](_0x1a1e54['id'])[_0xe26b('0xa1')](function(_0x286a6c){var _0x1e4dea=_0x1a1e54[_0xe26b('0x1e1')]-_0x286a6c[0x0][_0xe26b('0x1e2')];var _0x5b0978=_0x1a1e54['dialPredictiveInterval']*0x3c;var _0x4d06bb=_0x57d598[0x0][_0xe26b('0x50')]+_0x57d598[0x0][_0xe26b('0x54')];var _0x91faa9=(_0x57d598[0x0][_0xe26b('0x4a')]+_0x57d598[0x0][_0xe26b('0x1d9')]+_0x57d598[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57d598[0x0][_0xe26b('0x49')];var _0x526a89=_0x1a1e54['dialPredictiveOptimizationPercentage']/0x64;_0x1a1e54['predictiveIntervalPauses']=_0x286a6c[0x0][_0xe26b('0x1e2')]||0x0;_0x1a1e54['predictiveIntervalHitRate']=_0x91faa9>0x0?_0x91faa9:0x1;return _0x2083ab[_0xe26b('0x1dc')](_0x1e4dea,_0x5b0978,_0x4d06bb,_0x91faa9,_0x526a89);})['then'](function(_0x63e765){return _0x168ad6(_0x63e765);})[_0xe26b('0xa5')](function(_0x3fe554){return _0x3d7e00(msgResponse(_0xe26b('0x1e3'),'Failure',JSON[_0xe26b('0x73')](_0x3fe554)));});}}else{return _0x3d7e00(msgResponse(_0xe26b('0x1dd'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xe26b('0x1d3')]=function(_0x569f3e){var _0x3c576c=this;return function(){var _0x371a16=0x0;var _0x342b04=Math[_0xe26b('0x1c4')](_0x569f3e[_0xe26b('0x5a')]*0x3e8);if(_0x342b04>0x0){_0x342b04=_0x342b04<0x64?0x64:_0x342b04;loggerPredictive['info'](_0x569f3e[_0xe26b('0x44')],_0xe26b('0x1e4'),_0x342b04,_0xe26b('0x1e5'));_0x569f3e['handlePredictive']=setInterval(function(){_0x3c576c['handlePredictive'](_0x569f3e);loggerPredictiveCalls[_0xe26b('0x47')](_0xe26b('0x1e6'),_0x371a16+=0x1);},_0x342b04);}else{loggerPredictive[_0xe26b('0x47')](_0x569f3e[_0xe26b('0x44')],_0xe26b('0x1e7'));}};};Dialer[_0xe26b('0x17')][_0xe26b('0x1e8')]=function(_0x39a1ad,_0x5a2527){var _0x28a970=this;return function(_0x477dc1){if(_[_0xe26b('0x46')](_0x477dc1)){if(_[_0xe26b('0x10f')](_0x5a2527[_0xe26b('0x155')])||!_0x5a2527[_0xe26b('0x1e9')]){if(_0x39a1ad[_0xe26b('0xb3')]===_0xe26b('0x9')){_0x39a1ad['queueStatusComplete']=_['isUndefined'](_0x39a1ad[_0xe26b('0x70')])?!![]:_0x39a1ad[_0xe26b('0x70')];var _0x46cc85=uuid['v4']();_0x28a970[_0xe26b('0x23')][_0x46cc85]=new Action(_0x39a1ad,_0x5a2527,_0x46cc85);loggerBooked[_0xe26b('0x47')](_0xe26b('0x1ea'),_0x46cc85,'queueStatusComplete:\x20',JSON[_0xe26b('0x73')](_0x39a1ad[_0xe26b('0x70')]),_0xe26b('0x1eb'),_0x39a1ad['name']);if(_0x39a1ad[_0xe26b('0x70')]){_0x39a1ad[_0xe26b('0x70')]=![];_0x28a970[_0xe26b('0xfd')][_0x28a970['actions'][_0x46cc85][_0xe26b('0xc2')]]=[];ami['Action']({'actionid':_0x46cc85,'action':_0xe26b('0x1ec'),'queue':_0x39a1ad['name']})[_0xe26b('0xa5')](function(){_0x28a970[_0xe26b('0x101')](_0x39a1ad);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x28a970[_0xe26b('0x23')][_0x46cc85][_0xe26b('0xe0')],'ListId':_0x28a970['actions'][_0x46cc85]['ListId'],'VoiceQueueId':_0x28a970[_0xe26b('0x23')][_0x46cc85][_0xe26b('0xe2')]||undefined,'CampaignId':_0x28a970['actions'][_0x46cc85][_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1ed')));delete _0x28a970['actions'][_0x46cc85];});}else{loggerBooked[_0xe26b('0x47')](_0xe26b('0x1ee'),JSON[_0xe26b('0x73')](_0x39a1ad['queueStatusComplete']),_0xe26b('0x1eb'),_0x39a1ad['name']);_0x28a970[_0xe26b('0x101')](_0x39a1ad);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x28a970[_0xe26b('0x23')][_0x46cc85][_0xe26b('0xe0')],'ListId':_0x28a970[_0xe26b('0x23')][_0x46cc85][_0xe26b('0xe1')],'VoiceQueueId':_0x28a970['actions'][_0x46cc85]['VoiceQueueId']||undefined,'CampaignId':_0x28a970[_0xe26b('0x23')][_0x46cc85][_0xe26b('0xe3')]||undefined})[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1ed')));delete _0x28a970[_0xe26b('0x23')][_0x46cc85];}}else{return _0x28a970[_0xe26b('0x15a')](_0x39a1ad,_0x5a2527);}}else{if(utils['getSeconds'](undefined,_0x5a2527['scheduledat'])<_0x39a1ad[_0xe26b('0x1ef')]*0x3c){if(_0x5a2527[_0xe26b('0x158')]&&!_0x5a2527[_0xe26b('0x158')][_0xe26b('0x1f0')]){_0x28a970[_0xe26b('0x1c')][_0xe26b('0xfe')](_0x5a2527['id'])[_0xe26b('0x1a')](function(){_0x28a970[_0xe26b('0x101')](_0x39a1ad);});}else{hopperUtils['unlockContact']({'active':![]},_0x5a2527['id'],0x1)[_0xe26b('0x1a')](function(){_0x28a970[_0xe26b('0x101')](_0x39a1ad);});}}else{_0x39a1ad[_0xe26b('0x1f1')]+=0x1;_0x28a970[_0xe26b('0x101')](_0x39a1ad);if(_0x39a1ad['dialRecallInQueue']){hopperUtils[_0xe26b('0xf1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a2527[_0xe26b('0xe0')],'ListId':_0x5a2527[_0xe26b('0xe1')],'VoiceQueueId':_0x5a2527[_0xe26b('0xe2')]||undefined,'CampaignId':_0x5a2527[_0xe26b('0xe3')]||undefined})['catch'](loggerCatch(_0xe26b('0x1f2')));hopperUtils[_0xe26b('0xcb')](createObjHistory(_0x39a1ad,_0x5a2527,utils[_0xe26b('0x68')][_0xe26b('0x1f3')],0x17,_0xe26b('0x1f4')))[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x1f5')));}else{_0x28a970[_0xe26b('0x11a')](createObjHistory(_0x39a1ad,_0x5a2527,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0xe26b('0x1f6'),_0xe26b('0x1f7'));}}}}else{_0x39a1ad[_0xe26b('0x1f8')]+=0x1;_0x28a970[_0xe26b('0x11a')](createObjHistory(_0x39a1ad,_0x5a2527,utils[_0xe26b('0x68')]['BLACKLIST'],0xd,_0xe26b('0x1f9')),'[Originate][historyBlacklist]',_0xe26b('0x1fa'));throw _0xe26b('0x1fb');}};};Dialer[_0xe26b('0x17')][_0xe26b('0x1fc')]=function(_0x2e3299){var _0x44cacf=this;var _0x12c76f=_0x2e3299[_0xe26b('0x1fd')]-_0x2e3299[_0xe26b('0x80')];emitCampaignSummary(_0x2e3299);if(_0x12c76f>0x0&&_0x2e3299[_0xe26b('0x1fe')]==0x0){if(_0x12c76f>this[_0xe26b('0x21')]){_0x12c76f=this[_0xe26b('0x21')];}_0x2e3299['temp']=0x1;hopperUtils[_0xe26b('0x1ff')](_0x2e3299,_0x12c76f)[_0xe26b('0xa1')](function(_0x321a58){_0x2e3299[_0xe26b('0x1fe')]=0x0;if(_0x321a58){if(!utils['checkContactEmpty'](_0x321a58)){_0x2e3299[_0xe26b('0x76')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0xe26b('0x47')](_0xe26b('0x200')+_0x2e3299['name']);}else{_0x2e3299[_0xe26b('0x80')]+=_0x321a58['length'];_0x2e3299['message']=utils[_0xe26b('0x68')][_0xe26b('0x201')];for(var _0x15d10a=0x0;_0x15d10a<_0x321a58[_0xe26b('0x9c')];_0x15d10a+=0x1){_0x2e3299[_0xe26b('0x202')]+=0x1;if(_['isNil'](_0x321a58[_0x15d10a])||_[_0xe26b('0x10f')](_0x321a58[_0x15d10a][_0xe26b('0x203')])||_['isNil'](_0x321a58[_0x15d10a][_0xe26b('0x15e')])){_0x44cacf[_0xe26b('0x153')](_0xe26b('0x204'),_0x2e3299,_0x321a58[_0x15d10a]);}else{hopperUtils[_0xe26b('0x205')](_[_0xe26b('0x74')](_0x321a58[_0x15d10a],[_0xe26b('0xe3'),_0xe26b('0x15e')]))[_0xe26b('0xa1')](_0x44cacf[_0xe26b('0x1e8')](_0x2e3299,_0x321a58[_0x15d10a]))[_0xe26b('0xa5')](_0x44cacf[_0xe26b('0x206')](_0xe26b('0x207'),_0x2e3299));}}}}})[_0xe26b('0xa5')](loggerGetContactDialer(_0xe26b('0x208'),_0x2e3299,_0x12c76f));}};Dialer[_0xe26b('0x17')]['handlePower']=function(_0x15d741,_0x11c445){var _0x40b8bf=this;var _0x5e802e=[];if(_0x11c445<0x1||_0x15d741[_0xe26b('0xb3')]==='booked'){_0x11c445=0x1;}var _0xf89a33=Math[_0xe26b('0x1c4')](_0x15d741[_0xe26b('0x13e')]*_0x11c445)-_0x15d741[_0xe26b('0x80')];if(_0x15d741[_0xe26b('0x209')]>0x0){var _0x89ef37=_0x15d741[_0xe26b('0x209')]-_0x15d741[_0xe26b('0x80')]-_0x15d741[_0xe26b('0x140')]-_0x15d741[_0xe26b('0x20a')];if(_0xf89a33>_0x89ef37){_0xf89a33=_0x89ef37;}}if(_0xf89a33>0x0&&_0x15d741[_0xe26b('0x1fe')]==0x0){if(_0x15d741[_0xe26b('0xb3')]==='booked'){_0xf89a33=0x1;}if(_0xf89a33>this['maxNumberOriginate']){_0xf89a33=this[_0xe26b('0x21')];}for(var _0x3a4173 in this['agents']){if(typeof this[_0xe26b('0x1f')][_0x3a4173]!==_0xe26b('0xad')){if(this[_0xe26b('0x1f')][_0x3a4173][_0xe26b('0x6e')]===_0xe26b('0x20b')&&this[_0xe26b('0x1f')][_0x3a4173]['status']===_0xe26b('0x8a')){_0x5e802e[_0xe26b('0x9d')](this[_0xe26b('0x1f')][_0x3a4173]['id']);}}}_0x15d741[_0xe26b('0x1fe')]=0x1;hopperUtils[_0xe26b('0x20c')](_0x15d741,_0x5e802e,_0xf89a33)[_0xe26b('0xa1')](function(_0x4247fb){_0x15d741[_0xe26b('0x1fe')]=0x0;if(_0x4247fb){if(!utils[_0xe26b('0x20d')](_0x4247fb)){hopperUtils[_0xe26b('0x20e')](_0x15d741)[_0xe26b('0xa1')](sendMessageReschedule(_0x15d741))[_0xe26b('0xa5')](loggerCatch(_0xe26b('0x20f')));}else{_0x15d741[_0xe26b('0x80')]+=_0x4247fb['length'];_0x15d741['message']=_0x15d741['dialMethod']==='booked'?utils[_0xe26b('0x68')][_0xe26b('0x141')]:utils[_0xe26b('0x68')][_0xe26b('0x201')];for(var _0x6e1cd6=0x0;_0x6e1cd6<_0x4247fb[_0xe26b('0x9c')];_0x6e1cd6+=0x1){if(_['isNil'](_0x4247fb[_0x6e1cd6])||_[_0xe26b('0x10f')](_0x4247fb[_0x6e1cd6][_0xe26b('0x203')])||_[_0xe26b('0x10f')](_0x4247fb[_0x6e1cd6][_0xe26b('0x15e')])){_0x40b8bf[_0xe26b('0x153')](_0xe26b('0x204'),_0x15d741,_0x4247fb[_0x6e1cd6]);}else{hopperUtils[_0xe26b('0x210')](_['pick'](_0x4247fb[_0x6e1cd6],[_0xe26b('0xe2'),_0xe26b('0x15e')]))[_0xe26b('0xa1')](_0x40b8bf[_0xe26b('0x1e8')](_0x15d741,_0x4247fb[_0x6e1cd6]))[_0xe26b('0xa5')](_0x40b8bf['loggerHandler'](_0xe26b('0x204'),_0x15d741));}}}}})[_0xe26b('0xa5')](loggerGetContactDialer(_0xe26b('0x211'),_0x15d741,_0xf89a33));}};Dialer[_0xe26b('0x17')][_0xe26b('0x63')]=function(_0x3eceb2){if(_0x3eceb2[_0xe26b('0x209')]>0x0){var _0x16d401=_0x3eceb2[_0xe26b('0x209')]-_0x3eceb2[_0xe26b('0x80')]-_0x3eceb2[_0xe26b('0x140')];if(_0x16d401>0x0&&_0x3eceb2[_0xe26b('0x1fe')]==0x0){this[_0xe26b('0x212')](_0x3eceb2);}else{loggerPredictiveCalls[_0xe26b('0x47')]('[handlePredictive][limitChannel]');}}else{this[_0xe26b('0x212')](_0x3eceb2);}};Dialer[_0xe26b('0x17')][_0xe26b('0x212')]=function(_0x2b7be4){var _0x45adc7=this;var _0x180546=[];_0x2b7be4[_0xe26b('0x80')]+=0x1;for(var _0xd8b94d in this[_0xe26b('0x1f')]){if(typeof this['agents'][_0xd8b94d]!==_0xe26b('0xad')){if(this[_0xe26b('0x1f')][_0xd8b94d][_0xe26b('0x6e')]===_0xe26b('0x20b')&&this[_0xe26b('0x1f')][_0xd8b94d][_0xe26b('0x89')]===_0xe26b('0x8a')){_0x180546[_0xe26b('0x9d')](this[_0xe26b('0x1f')][_0xd8b94d]['id']);}}}_0x2b7be4[_0xe26b('0x1fe')]=0x1;return this['getContactDialer'](_0x2b7be4['id'],_0x180546,0x1,_0x2b7be4[_0xe26b('0x213')],_0x2b7be4)[_0xe26b('0xa1')](function(_0x475629){_0x2b7be4['temp']=0x1;if(_0x475629){if(!utils[_0xe26b('0x20d')](_0x475629)){utils[_0xe26b('0x65')](_0x2b7be4,0x1,0x0);return hopperUtils[_0xe26b('0x20e')](_0x2b7be4)[_0xe26b('0xa1')](sendMessageReschedule(_0x2b7be4))['catch'](loggerCatch(_0xe26b('0x20f')));}else{_0x2b7be4[_0xe26b('0x76')]=utils[_0xe26b('0x68')][_0xe26b('0x201')];if(_[_0xe26b('0x10f')](_0x475629[0x0])||_[_0xe26b('0x10f')](_0x475629[0x0][_0xe26b('0x203')])||_[_0xe26b('0x10f')](_0x475629[0x0][_0xe26b('0x15e')])){_0x45adc7[_0xe26b('0x153')](_0xe26b('0x204'),_0x2b7be4,_0x475629[0x0]);}else{return hopperUtils[_0xe26b('0x210')](_[_0xe26b('0x74')](_0x475629[0x0],[_0xe26b('0xe2'),_0xe26b('0x15e')]))[_0xe26b('0xa1')](_0x45adc7['checkContactBlack'](_0x2b7be4,_0x475629[0x0]))[_0xe26b('0xa5')](_0x45adc7[_0xe26b('0x206')](_0xe26b('0x214'),_0x2b7be4));}}}})[_0xe26b('0xa5')](loggerGetContactDialer('[getContactDialerPredictive]',_0x2b7be4,0x1));};Dialer[_0xe26b('0x17')][_0xe26b('0x1da')]=function(_0x30c445,_0x439eda,_0x2b718b,_0x1c4884,_0x53d8ad,_0x30d756){loggerPredictive[_0xe26b('0x47')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe26b('0x47')]('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',_0x30c445);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x215'),_0x439eda);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x216'),_0x2b718b);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x217'),_0x1c4884);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x218'),_0x53d8ad);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x51'));return new Promise(function(_0x5e07c3,_0x309aae){if(_0x30c445<=0x0||isNaN(_0x30c445)){return _0x309aae(msgResponse(_0xe26b('0x219'),'Error',_0xe26b('0x21a')+_0x30c445));}if(_0x2b718b<=0x0||isNaN(_0x2b718b)){return _0x309aae(msgResponse('[abandonmentRate]','Error',_0xe26b('0x21b')+_0x2b718b));}if(_0x1c4884<=0x0||isNaN(_0x1c4884)){return _0x309aae(msgResponse(_0xe26b('0x219'),_0xe26b('0xc1'),'p\x20=\x20'+_0x1c4884));}if(_0x439eda<=0x0||isNaN(_0x439eda)){return _0x309aae(msgResponse('[abandonmentRate]',_0xe26b('0xc1'),_0xe26b('0x21c')+_0x439eda));}if(_0x53d8ad<=0x0||isNaN(_0x53d8ad)){return _0x309aae(msgResponse(_0xe26b('0x219'),_0xe26b('0xc1'),_0xe26b('0x21d')+_0x53d8ad));}_0x30d756=_0x30d756||0x0;var _0x1f36a7=0x1/_0x2b718b;var _0x5145c4=0x0;var _0x1db2c6=0x0;var _0x40c05a=0x0;var _0x226bc2=0x0;for(var _0x1171f5=0x0;_0x40c05a<_0x53d8ad;_0x1171f5+=0x1){_0x1db2c6=_0x1171f5/_0x439eda;_0x5145c4=(_0x1c4884*_0x1db2c6+_0x30d756)/_0x1f36a7;_0x40c05a=utils[_0xe26b('0x21e')](_0x5145c4,_0x30c445);_0x226bc2=_0x5145c4/_0x30c445*(0x1-utils['erlangb'](_0x5145c4,_0x30c445));}return _0x5e07c3({'erlangCalls':_0x1171f5,'erlangCallToSecond':_0x439eda/_0x1171f5,'erlangAbandonmentRate':_0x40c05a,'erlangBusyFactor':_0x226bc2});});};Dialer[_0xe26b('0x17')][_0xe26b('0x1dc')]=function(_0x4dfdff,_0x42f6c6,_0x387d02,_0x437165,_0x1f7eba,_0x39ba86){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xe26b('0x21f'),_0x4dfdff);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x215'),_0x42f6c6);loggerPredictive[_0xe26b('0x47')](_0xe26b('0x216'),_0x387d02);loggerPredictive['info'](_0xe26b('0x217'),_0x437165);loggerPredictive[_0xe26b('0x47')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f7eba);loggerPredictive['info'](_0xe26b('0x51'));return new Promise(function(_0x185582,_0x165f03){if(_0x4dfdff<=0x0||isNaN(_0x4dfdff)){return _0x165f03(msgResponse(_0xe26b('0x220'),_0xe26b('0xc1'),_0xe26b('0x21a')+_0x4dfdff));}if(_0x387d02<=0x0||isNaN(_0x387d02)){return _0x165f03(msgResponse('[busyFactor]',_0xe26b('0xc1'),_0xe26b('0x21b')+_0x387d02));}if(_0x437165<=0x0||isNaN(_0x437165)){return _0x165f03(msgResponse(_0xe26b('0x220'),'Error',_0xe26b('0x221')+_0x437165));}if(_0x42f6c6<=0x0||isNaN(_0x42f6c6)){return _0x165f03(msgResponse(_0xe26b('0x220'),_0xe26b('0xc1'),_0xe26b('0x21c')+_0x42f6c6));}if(_0x1f7eba<=0x0||isNaN(_0x1f7eba)){return _0x165f03(msgResponse(_0xe26b('0x220'),_0xe26b('0xc1'),_0xe26b('0x222')+_0x1f7eba));}_0x39ba86=_0x39ba86||0x0;var _0x547b5c=0x1/_0x387d02;var _0x4e524f=0x0;var _0x5aa867=0x0;var _0x2b6c23=0x0;var _0x127779=0x0;for(var _0x54f8f8=0x0;_0x127779<_0x1f7eba;_0x54f8f8+=0x1){_0x5aa867=_0x54f8f8/_0x42f6c6;_0x4e524f=(_0x437165*_0x5aa867+_0x39ba86)/_0x547b5c;_0x2b6c23=utils[_0xe26b('0x21e')](_0x4e524f,_0x4dfdff);_0x127779=_0x4e524f/_0x4dfdff*(0x1-utils[_0xe26b('0x21e')](_0x4e524f,_0x4dfdff));}return _0x185582({'erlangCalls':_0x54f8f8,'erlangCallToSecond':_0x42f6c6/_0x54f8f8,'erlangAbandonmentRate':_0x2b6c23,'erlangBusyFactor':_0x127779});});};module['exports']=Dialer; \ No newline at end of file +var _0xf15b=['queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','---------------------------','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','isIVRCampaign','originated','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','isTrunkReachable','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','length','command','iftime\x20%s,%s','interval','content','true','catch','push','Action','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','campaigns','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','ivr','updateOriginated','queue','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','countabandonedretry','dialAbandonedMaxRetry','CampaignId','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','stateinterface','locked','agents','merge','idHopper','paused','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','membername','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','dialMachineRetryFrequency','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','AGI','dialQueueProject','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countagentrejectretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','maxNumberOriginate','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','undefined','not_inuse','getContactDialer','[countReScheduled]\x20','Contact','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\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]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','trunks','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked'];(function(_0x3f5330,_0x362afa){var _0x17c626=function(_0x1274a8){while(--_0x1274a8){_0x3f5330['push'](_0x3f5330['shift']());}};_0x17c626(++_0x362afa);}(_0xf15b,0x1f1));var _0xbf15=function(_0x307df8,_0x5c687c){_0x307df8=_0x307df8-0x0;var _0x2c5855=_0xf15b[_0x307df8];return _0x2c5855;};'use strict';var util=require(_0xbf15('0x0'));var _=require(_0xbf15('0x1'));var uuid=require(_0xbf15('0x2'));var moment=require(_0xbf15('0x3'));var rr=require('rr');var Redis=require(_0xbf15('0x4'));var utils=require(_0xbf15('0x5'));var hopperUtils=require(_0xbf15('0x6'));var ut=require(_0xbf15('0x7'));var config=require(_0xbf15('0x8'));var logger=require(_0xbf15('0x9'))('dialer');var loggerBooked=require(_0xbf15('0x9'))(_0xbf15('0xa'));var loggerPredictive=require(_0xbf15('0x9'))(_0xbf15('0xb'));var loggerPredictiveCalls=require(_0xbf15('0x9'))(_0xbf15('0xc'));var loggerSyncQueueSummary=require(_0xbf15('0x9'))(_0xbf15('0xd'));var ami=require(_0xbf15('0xe'));config[_0xbf15('0xf')]=_['defaults'](config[_0xbf15('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0xbf15('0x10'))(new Redis(config[_0xbf15('0xf')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xbf15('0x11'));var RpcSetting=require(_0xbf15('0x12'));var Interval=require(_0xbf15('0x13'));var Action=require(_0xbf15('0x14'));var History=require(_0xbf15('0x15'));var Final=require(_0xbf15('0x16'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xbf15('0x17'));var ipAgi=process['env'][_0xbf15('0x18')]||_0xbf15('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xbf15('0x1a')][_0xbf15('0x1b')]=function(_0x577e44){this[_0xbf15('0x1c')]=this[_0xbf15('0x1c')]?this[_0xbf15('0x1c')][_0xbf15('0x1d')](_0x577e44):_0x577e44();};function Dialer(_0x29e191,_0x324bb3){this[_0xbf15('0x1e')]=new Sequence();this[_0xbf15('0x1f')]=_0x324bb3;this[_0xbf15('0x20')]=_0x29e191[_0xbf15('0x20')];this['campaigns']=_0x29e191['campaigns'];this['agents']=_0x29e191['agents'];this[_0xbf15('0x21')]=_0x29e191[_0xbf15('0x21')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xbf15('0x22')]={};this[_0xbf15('0x23')]={};this[_0xbf15('0x24')]={};this[_0xbf15('0x25')]={};this[_0xbf15('0x26')]={};this[_0xbf15('0x27')]={};this['startProgressive']={};this[_0xbf15('0x28')]={};this[_0xbf15('0x29')]={};this[_0xbf15('0x2a')]={};this[_0xbf15('0x2b')]={};ami['on'](_0xbf15('0x2c'),this[_0xbf15('0x2d')][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x2f'),this['syncQueueCallerAbandon'][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x30'),this[_0xbf15('0x31')][_0xbf15('0x2e')](this));ami['on']('agentcomplete',this[_0xbf15('0x32')][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x33'),this[_0xbf15('0xd')][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x34'),this['syncQueueSummaryComplete'][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x35'),this['syncHangup'][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x36'),this['syncNewExten'][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x37'),this[_0xbf15('0x38')]['bind'](this));ami['on'](_0xbf15('0x39'),this[_0xbf15('0x3a')][_0xbf15('0x2e')](this));ami['on'](_0xbf15('0x3b'),this['syncQueueStatusComplete'][_0xbf15('0x2e')](this));this[_0xbf15('0x3c')]();this[_0xbf15('0x3d')]();RpcSetting['getSettings']()[_0xbf15('0x3e')](function(_0x44e8b1){previewRecallmeReminderInterval=_0x44e8b1[_0xbf15('0x3f')];});}function isNotNull(_0x540957){return _0x540957!==null&&!_[_0xbf15('0x40')](_0x540957);}function msgResponse(_0x21e6a1,_0x30b54d,_0x3860d9){return{'action':_0x21e6a1,'response':_0x30b54d,'message':_0x3860d9,'stack':_0x3860d9};}function emit(_0x25b701,_0x20aeea,_0x449aab){io['to'](_0x25b701)['emit'](_0x20aeea,_0x449aab);}function emitOutboundVoiceQueueSummary(_0x183029){if(_0x183029[_0xbf15('0x41')]==='outbound'){logger[_0xbf15('0x42')](_0xbf15('0x43'),util[_0xbf15('0x44')](_0x183029,{'showHidden':![],'depth':null}));emit(util[_0xbf15('0x45')]('voice:queue:%s',_0x183029['name']),_0xbf15('0x46'),_0x183029);}}function checkGetDataPredictive(_0x53fbe4){if(isNotNull(_0x53fbe4)&&!_[_0xbf15('0x47')](_0x53fbe4)){loggerPredictive[_0xbf15('0x48')](_0xbf15('0x49'));loggerPredictive[_0xbf15('0x48')](_0xbf15('0x4a'),_0x53fbe4[_0xbf15('0x4b')]);loggerPredictive[_0xbf15('0x48')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53fbe4[_0xbf15('0x4c')]);loggerPredictive[_0xbf15('0x48')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53fbe4[_0xbf15('0x4d')]);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x4e'),_0x53fbe4[_0xbf15('0x4f')]);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x50'),_0x53fbe4[_0xbf15('0x51')]);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x52'),_0x53fbe4[_0xbf15('0x53')]);loggerPredictive[_0xbf15('0x48')]('---------------------------');if(_0x53fbe4[_0xbf15('0x4b')]>0x0){if(!_[_0xbf15('0x40')](_0x53fbe4[_0xbf15('0x53')])&&_0x53fbe4['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xbf15('0x48')](_0xbf15('0x54'));if(!_[_0xbf15('0x40')](_0x53fbe4['predictiveIntervalAvgHoldtime'])&&_0x53fbe4[_0xbf15('0x51')]>0x0){return!![];}loggerPredictive[_0xbf15('0x48')](_0xbf15('0x55'));}else{loggerPredictive[_0xbf15('0x48')](_0xbf15('0x56'));}}else{loggerPredictive[_0xbf15('0x48')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2a077f){return function(_0x23c1a5){loggerPredictive[_0xbf15('0x48')](_0xbf15('0x57'));loggerPredictive[_0xbf15('0x48')](_0xbf15('0x58'),_0x23c1a5['erlangCalls']);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x59'),_0x23c1a5[_0xbf15('0x5a')]);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x5b'),_0x23c1a5['erlangAbandonmentRate']);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x5c'),_0x23c1a5[_0xbf15('0x5d')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23c1a5[_0xbf15('0x5e')]);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x5f'));_['merge'](_0x2a077f,_0x23c1a5);};}function ifInterval(_0x2a023e,_0x2bb26b){if(_[_0xbf15('0x40')](_0x2bb26b)){return![];}return utils[_0xbf15('0x60')](undefined,_0x2bb26b)<_0x2a023e*0x3c;}function clearPredictiveAttributes(_0x3f8057){if(_0x3f8057['startProgressive']){_0x3f8057[_0xbf15('0x61')]=undefined;loggerPredictive[_0xbf15('0x42')](_0x3f8057[_0xbf15('0x62')],_0xbf15('0x63'));}if(_0x3f8057[_0xbf15('0x27')]){_0x3f8057['startPredictive']=undefined;loggerPredictive[_0xbf15('0x42')](_0x3f8057['name'],_0xbf15('0x64'));}if(_0x3f8057[_0xbf15('0x65')]){clearInterval(_0x3f8057['handlePredictive']);_0x3f8057['handlePredictive']=undefined;loggerPredictive[_0xbf15('0x42')](_0x3f8057[_0xbf15('0x62')],_0xbf15('0x66'));}}function loggerCatchPredictive(_0x3f7839,_0x37195d){return function(_0x13d229){loggerPredictive[_0xbf15('0x67')](_0x37195d[_0xbf15('0x62')],_0x3f7839);loggerPredictive[_0xbf15('0x67')](_0x13d229[_0xbf15('0x68')]);clearPredictiveAttributes(_0x37195d);};}function loggerCatch(_0x1a6eda){return function(_0x1300b5){logger['error'](_0x1a6eda,util[_0xbf15('0x44')](_0x1300b5,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x8b6a61,_0x3da51d,_0x400472){return function(_0x356184){utils[_0xbf15('0x69')](_0x3da51d,_0x400472,0x0);_0x3da51d[_0xbf15('0x6a')]=0x0;logger[_0xbf15('0x67')](_0x8b6a61,util['inspect'](_0x356184,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3feb3b){return function(_0x458198){if(isNotNull(_0x458198)&&isNotNull(_0x458198[0x0])){if(_0x458198[0x0][_0xbf15('0x6b')]>0x0){_0x3feb3b['message']=utils[_0xbf15('0x6c')][_0xbf15('0x6d')];logger[_0xbf15('0x48')](_0xbf15('0x6e')+_0x3feb3b[_0xbf15('0x62')],_0x458198[0x0][_0xbf15('0x6b')],_0xbf15('0x6f'));}else{_0x3feb3b[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x71')];logger[_0xbf15('0x48')](_0xbf15('0x72')+_0x3feb3b['name']);}}};}function createObjHistory(_0x175cc5,_0x14b547,_0x175ef4,_0x1bbfd5,_0x355f56){_0x175cc5['message']=_0x175ef4;var _0x4790fb=new Action(_0x175cc5,_0x14b547);var _0x514cd5=new History(_0x4790fb);_0x514cd5[_0xbf15('0x73')]=_0x1bbfd5;_0x514cd5['statedesc']=_0x355f56;_0x514cd5[_0xbf15('0x74')]=_0x4790fb['starttime'];return _0x514cd5;}function unlockQueueStatus(_0x467911,_0x4666dc){setTimeout(function(){if(_['isUndefined'](_0x467911[_0xbf15('0x75')])){loggerBooked[_0xbf15('0x67')]('[unlockQueueStatus][undefined]',_0x4666dc);}_0x467911[_0xbf15('0x75')]=!![];loggerBooked['info'](_0xbf15('0x76'),_0x4666dc,JSON[_0xbf15('0x77')](_[_0xbf15('0x78')](_0x467911,[_0xbf15('0x62'),_0xbf15('0x75')])));},0x1f3);}function checkInterval(_0x3dd497){return function(){if(!isNotNull(_0x3dd497[_0xbf15('0x79')])){_0x3dd497[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x7a')];throw _0x3dd497[_0xbf15('0x62')]+_0xbf15('0x7b');}if(!isNotNull(_0x3dd497[_0xbf15('0x79')]['Intervals'])){_0x3dd497[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x7a')];throw _0x3dd497['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbf15('0x47')](_0x3dd497['Interval']['Intervals']))){_0x3dd497[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x7a')];throw _0x3dd497[_0xbf15('0x62')]+_0xbf15('0x7b');}};}function checkIsIVRCampaignActive(_0x5c3e01){return function(){if(!utils[_0xbf15('0x7c')](_0x5c3e01)){_0x5c3e01[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x7d')];throw _0x5c3e01[_0xbf15('0x62')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x2f5d06){if(utils[_0xbf15('0x7e')](_0x2f5d06)){emit(util[_0xbf15('0x45')]('campaign:ivr:%s',_0x2f5d06[_0xbf15('0x62')]),'campaign:save',_0x2f5d06);}}function loggerCatchQueueSummary(_0x29adca,_0x5eeaab){return function(_0x53bc90){clearPredictiveAttributes(_0x5eeaab);emitCampaignSummary(_0x5eeaab);loggerSyncQueueSummary[_0xbf15('0x42')](_0x29adca,util[_0xbf15('0x44')](_0x53bc90,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x494c03){if(_0x494c03['sendMessageOneNotActive']){if(_0x494c03[_0xbf15('0x7f')]===0x0){_0x494c03[_0xbf15('0x80')]=![];_0x494c03[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x7d')];loggerSyncQueueSummary[_0xbf15('0x42')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x494c03[_0xbf15('0x62')],_0xbf15('0x81'));}else{_0x494c03['message']=utils[_0xbf15('0x6c')][_0xbf15('0x82')];loggerSyncQueueSummary['debug'](_0xbf15('0x83'),_0x494c03[_0xbf15('0x62')],'is\x20disactive');}emitCampaignSummary(_0x494c03);}}function myreject(_0xf832be){return function(_0x5f20f8){return _0xf832be(msgResponse(_0xbf15('0x84'),_0xbf15('0x85'),JSON[_0xbf15('0x77')](_0x5f20f8)));};}Dialer[_0xbf15('0x1a')]['isTrunkReachable']=function(_0x382f35){return!_[_0xbf15('0x40')](_0x382f35)&&_0x382f35&&!_['isUndefined'](_0x382f35[_0xbf15('0x62')])&&!_[_0xbf15('0x40')](_0x382f35[_0xbf15('0x86')])&&_0x382f35[_0xbf15('0x86')]&&(this[_0xbf15('0x21')][util[_0xbf15('0x45')]('SIP/%s',_0x382f35['name'])][_0xbf15('0x87')]===_0xbf15('0x88')||this[_0xbf15('0x21')][util['format'](_0xbf15('0x89'),_0x382f35[_0xbf15('0x62')])][_0xbf15('0x87')]===_0xbf15('0x8a'));};Dialer[_0xbf15('0x1a')][_0xbf15('0x8b')]=function(_0x3bda9c){var _0x3fbf0c=this;return function(){if(!_0x3fbf0c[_0xbf15('0x8c')](_0x3bda9c['Trunk'])){if(!_0x3fbf0c['isTrunkReachable'](_0x3bda9c['TrunkBackup'])){_0x3bda9c[_0xbf15('0x70')]=utils['CAMPAIGN_STATUS'][_0xbf15('0x8d')];throw _0x3bda9c[_0xbf15('0x62')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xbf15('0x8e')]=function(_0x57f695,_0x15b784,_0x42a555,_0x33329e){var _0x1dcf11=this;return function(){var _0x31eb4d=!![];return _0x1dcf11[_0xbf15('0x8f')](_0x57f695,_0x15b784,_0x42a555,_0x33329e,_0x31eb4d);};};Dialer[_0xbf15('0x1a')][_0xbf15('0x90')]=function(_0x26720f,_0x549153,_0x1566da,_0x52def7){var _0x1c9151=this;return function(){var _0xcbf75=![];return _0x1c9151[_0xbf15('0x8f')](_0x26720f[_0xbf15('0x91')],_0x549153,_0x1566da,_0x52def7,_0xcbf75);};};Dialer['prototype']['ifTimeIvr']=function(_0x576263,_0x2c0df1,_0x1f3b56,_0x34e757,_0x1ffd8a){var _0x44e7e5=[];return new Promise(function(_0x1703ae,_0xf7ab6){if(!isNotNull(_0x576263)){_0x34e757[_0xbf15('0x70')]=utils['CAMPAIGN_STATUS'][_0xbf15('0x7a')];return _0xf7ab6(msgResponse(_0xbf15('0x92'),_0xbf15('0x93'),_0x1f3b56+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xbf15('0x47')](_0x576263)){_0x34e757[_0xbf15('0x70')]=utils[_0xbf15('0x6c')]['EMPTY_INTERVAL'];return _0xf7ab6(msgResponse('ifTime',_0xbf15('0x93'),_0x1f3b56+_0xbf15('0x94')));}if(_0x2c0df1&&_[_0xbf15('0x40')](config[_0xbf15('0x95')][_0x2c0df1])){_0x34e757['message']=utils[_0xbf15('0x6c')][_0xbf15('0x96')];return _0xf7ab6(msgResponse(_0xbf15('0x92'),_0xbf15('0x93'),_0x1f3b56+'\x20Timezone\x20unknow\x20'+_0x2c0df1));}if(_['isArray'](_0x576263)){for(var _0x5c2fb1=0x0;_0x5c2fb1<_0x576263[_0xbf15('0x97')];_0x5c2fb1+=0x1){_0x44e7e5['push'](ami['Action']({'action':_0xbf15('0x98'),'command':util[_0xbf15('0x45')](_0xbf15('0x99'),_0x576263[_0x5c2fb1][_0xbf15('0x9a')],!_[_0xbf15('0x40')](config[_0xbf15('0x95')][_0x2c0df1])?_0x2c0df1:'')})[_0xbf15('0x3e')](function(_0x497103){return _0x497103[_0xbf15('0x9b')]['indexOf'](_0xbf15('0x9c'))>=0x0;})[_0xbf15('0x9d')](myreject(_0xf7ab6)));}}else{_0x44e7e5[_0xbf15('0x9e')](ami[_0xbf15('0x9f')]({'action':_0xbf15('0x98'),'command':util['format'](_0xbf15('0x99'),_0x576263,!_[_0xbf15('0x40')](config['timezones'][_0x2c0df1])?_0x2c0df1:'')})['then'](function(_0x16de96){return _0x16de96['content']['indexOf'](_0xbf15('0x9c'))>=0x0;})[_0xbf15('0x9d')](myreject(_0xf7ab6)));}Promise[_0xbf15('0xa0')](_0x44e7e5)[_0xbf15('0x3e')](function(_0x3cecf2){var _0x37ae06=_[_0xbf15('0xa1')](_0x3cecf2);if(_0x37ae06){return _0x1703ae(_0x37ae06);}else{_0x34e757['message']=_0x1ffd8a?utils[_0xbf15('0x6c')][_0xbf15('0xa2')]:utils[_0xbf15('0x6c')][_0xbf15('0xa3')];return _0xf7ab6(msgResponse('[ifTime][promiseAll]',_0xbf15('0x93'),_0xbf15('0xa4')+_0x1ffd8a+'\x20'+_0x1f3b56+_0xbf15('0xa5')+util[_0xbf15('0x44')](_0x576263,{'showHidden':![],'depth':null})+_0xbf15('0xa6')+_0x2c0df1));}})[_0xbf15('0x9d')](function(_0x229944){return _0xf7ab6(msgResponse('ifTime','Failure',JSON['stringify'](_0x229944)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x31aee2=this;return cmHopper[_0xbf15('0xa7')]({'active':![]},{'where':{'active':!![]}})[_0xbf15('0x3e')](function(){setInterval(function(){_0x31aee2['syncCampaigns']();},0x3e8);});};Dialer[_0xbf15('0x1a')][_0xbf15('0xa8')]=function(){var _0x2dca7a=this;var _0xb53ffa;for(var _0x133e43 in this['campaigns']){if(typeof this[_0xbf15('0xa9')][_0x133e43]!=='undefined'){_0xb53ffa=this[_0xbf15('0xa9')][_0x133e43];if(utils['isIVRCampaign'](_0xb53ffa)&&utils[_0xbf15('0x7c')](_0xb53ffa)){_0xb53ffa[_0xbf15('0x80')]=!![];Promise[_0xbf15('0xaa')]()[_0xbf15('0x3e')](checkIsIVRCampaignActive(_0xb53ffa))['then'](checkInterval(_0xb53ffa))[_0xbf15('0x3e')](_0x2dca7a['checkIsTrunkReachable'](_0xb53ffa))[_0xbf15('0x3e')](_0x2dca7a[_0xbf15('0x8e')](_0xb53ffa[_0xbf15('0xab')],_0xb53ffa[_0xbf15('0xac')],_0xb53ffa[_0xbf15('0x62')],_0xb53ffa))[_0xbf15('0x3e')](_0x2dca7a[_0xbf15('0x90')](_0xb53ffa['Interval'],_0xb53ffa[_0xbf15('0xac')],_0xb53ffa[_0xbf15('0x62')],_0xb53ffa))[_0xbf15('0x3e')](_0x2dca7a['launchHandleIvr'](_0xb53ffa))[_0xbf15('0x9d')](loggerCatchQueueSummary(_0xbf15('0xad'),_0xb53ffa));}else{notSendMessagesCampaign(_0xb53ffa);}}}};Dialer[_0xbf15('0x1a')][_0xbf15('0xae')]=function(_0xee19ae){if(_0xee19ae[_0xbf15('0xaf')]!=='predictive'){clearPredictiveAttributes(_0xee19ae);}switch(_0xee19ae[_0xbf15('0xaf')]){case _0xbf15('0xb0'):this[_0xbf15('0xb1')](_0xee19ae,0x1);break;case _0xbf15('0xb2'):this['handlePower'](_0xee19ae,_0xee19ae['dialPowerLevel']);break;case'predictive':this[_0xbf15('0xb')](_0xee19ae);break;case _0xbf15('0xa'):this['handlePower'](_0xee19ae,0x1);break;default:logger['error'](_0xbf15('0xb3'),_0xee19ae[_0xbf15('0x62')],_0xbf15('0xb4'));}};Dialer[_0xbf15('0x1a')]['ifTime']=function(_0x21e4b4,_0x114525){var _0x42e114=_0x21e4b4['dialTimezone'];var _0x5817b6=_0x114525?_0x21e4b4[_0xbf15('0xab')]:_0x21e4b4[_0xbf15('0x79')]['Intervals'];logger[_0xbf15('0xb5')](_0xbf15('0xb6'),_0x5817b6,_0x42e114,_0x21e4b4[_0xbf15('0x62')],util['format'](_0xbf15('0xb7'),_0x21e4b4[_0xbf15('0x62')],_0x21e4b4['id']));var _0x584505=null;return Interval[_0xbf15('0xb8')](_0x5817b6,_0x42e114)[_0xbf15('0x3e')](function(_0x1fc8df){if(_0x1fc8df===!![]){return _0x1fc8df;}else{_0x21e4b4['message']=_0x114525?utils[_0xbf15('0x6c')][_0xbf15('0xa2')]:utils['CAMPAIGN_STATUS'][_0xbf15('0xa3')];_0x584505=msgResponse(_0xbf15('0xb9'),'Failure',_0xbf15('0xa4')+_0x114525+'\x20'+_0x21e4b4[_0xbf15('0x62')]+_0xbf15('0xa5')+util[_0xbf15('0x44')](_0x5817b6,{'showHidden':![],'depth':null})+_0xbf15('0xa6')+_0x42e114);}if(_0x584505!==null){logger['silly'](_0xbf15('0xba'),_0x584505);_0x584505[_0xbf15('0xbb')]=_0x114525;throw _0x584505;}})[_0xbf15('0x9d')](function(_0x36500c){logger[_0xbf15('0x67')](_0xbf15('0xbc'),_0x36500c);throw msgResponse(_0xbf15('0x84'),'Error',util['inspect'](_0x36500c,{'showHidden':![],'depth':null}));});};Dialer[_0xbf15('0x1a')][_0xbf15('0x2d')]=function(_0x296dc1){if(this['voiceQueues'][_0x296dc1['queue']]){if(this[_0xbf15('0x25')][_0x296dc1[_0xbf15('0xbd')]]&&this['uniqueId'][_0x296dc1[_0xbf15('0xbd')]][_0xbf15('0x41')]!==_0xbf15('0xbe')){this[_0xbf15('0xbf')](this['voiceQueues'][_0x296dc1[_0xbf15('0xc0')]]);this['uniqueId'][_0x296dc1[_0xbf15('0xbd')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbf15('0x1a')][_0xbf15('0x32')]=function(_0x1921f6){var _0x4b411e=this['uniqueId'][_0x1921f6[_0xbf15('0xbd')]];if(this[_0xbf15('0x20')][_0x1921f6[_0xbf15('0xc0')]]){if(_0x4b411e&&_0x4b411e[_0xbf15('0x41')]!=='ivr'){delete this['uniqueId'][_0x1921f6['uniqueid']];this[_0xbf15('0x20')][_0x1921f6[_0xbf15('0xc0')]][_0xbf15('0xc1')]+=0x1;var _0x3f3e0b=new AgentComplete(_0x4b411e,_0x1921f6);if(_0x1921f6[_0xbf15('0xc2')]===_0xbf15('0xc3')){_0x3f3e0b[_0xbf15('0xc4')]=this['voiceQueues'][_0x1921f6[_0xbf15('0xc0')]][_0xbf15('0xc5')]&&this[_0xbf15('0x20')][_0x1921f6['queue']][_0xbf15('0xc6')]?moment()[_0xbf15('0x45')](_0xbf15('0xc7')):undefined;}hopperUtils[_0xbf15('0xc8')](_0x3f3e0b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xc9')));hopperUtils['moveContactManagedDialer'](_0x3f3e0b)['catch'](loggerCatch(_0xbf15('0xca')));}}};Dialer[_0xbf15('0x1a')][_0xbf15('0xcb')]=function(_0x26b693){var _0x488a5f=this[_0xbf15('0x25')][_0x26b693['uniqueid']];var _0x3172e5=this;var _0x1c3cea=![];var _0x5649c0;var _0x206b1d;if(this[_0xbf15('0x20')][_0x26b693['queue']]){if(_0x488a5f&&_0x488a5f[_0xbf15('0x41')]!==_0xbf15('0xbe')){delete this[_0xbf15('0x25')][_0x26b693['uniqueid']];this[_0xbf15('0xbf')](this[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]]);_0x488a5f[_0xbf15('0xcc')]=moment()[_0xbf15('0x45')](_0xbf15('0xc7'));var _0x1803fc=new QueueCallerAbandon(_0x488a5f,_0x26b693);if(utils['getSeconds'](_0x488a5f[_0xbf15('0xcc')],_0x488a5f[_0xbf15('0xcd')])>=_0x488a5f[_0xbf15('0xce')]){this['voiceQueues'][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0x4d')]+=0x1;this[_0xbf15('0x20')][_0x26b693['queue']][_0xbf15('0xcf')]+=0x1;this['voiceQueues'][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xd0')]+=0x1;_0x1803fc['state']=0xa;_0x1803fc[_0xbf15('0xd1')]=_0xbf15('0xd2');_0x1803fc[_0xbf15('0xd3')]=_0xbf15('0xd4');_0x1803fc[_0xbf15('0xc4')]=this[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]]['dialQueueProject2']?moment()[_0xbf15('0x45')](_0xbf15('0xc7')):undefined;_0x1803fc[_0xbf15('0xd5')]+=0x1;_0x1803fc[_0xbf15('0xd6')]+=0x1;_0x5649c0=this[_0xbf15('0x20')][_0x26b693['queue']][_0xbf15('0xd7')];_0x206b1d=this[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xd8')];hopperUtils[_0xbf15('0xd9')](_0x1803fc,_0x1803fc[_0xbf15('0x73')],_0x488a5f[_0xbf15('0xda')])[_0xbf15('0x3e')](function(_0x56428e){_0x1c3cea=_0x56428e[_0xbf15('0xdb')]==0x1;if(_0x1803fc[_0xbf15('0xd5')]>=_0x3172e5[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]]['dialDropMaxRetry']){_0x3172e5[_0xbf15('0xdc')](_0x1803fc,_0x56428e[_0xbf15('0xdb')]);}else{hopperUtils[_0xbf15('0xdd')]({'active':![],'countdropretry':_0x1803fc[_0xbf15('0xd5')],'scheduledat':moment()[_0xbf15('0xde')](_0x3172e5[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xd7')],_0xbf15('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x488a5f[_0xbf15('0xe0')],'ListId':_0x488a5f[_0xbf15('0xe1')],'VoiceQueueId':_0x488a5f[_0xbf15('0xe2')]||undefined,'CampaignId':_0x488a5f['CampaignId']||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xe3')));var _0x521479=new History(_0x1803fc);_0x521479[_0xbf15('0x73')]=0xa;_0x521479[_0xbf15('0xd1')]=_0xbf15('0xd2');_0x521479[_0xbf15('0xe4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x521479['endtime']=_0x521479[_0xbf15('0xe4')];_0x521479[_0xbf15('0xe5')]=_0x1803fc['calleridname'];_0x521479[_0xbf15('0xe6')]=_0x1803fc[_0xbf15('0xe6')];hopperUtils[_0xbf15('0xc8')](_0x521479)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xe7')));}})[_0xbf15('0x3e')](function(){if(_0x1c3cea)hopperUtils['swapAdditionalPhones'](_0x1803fc,_0x5649c0,_0x206b1d)[_0xbf15('0x3e')](function(){return 0x1;});});}else{this[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0x4f')]+=0x1;this[_0xbf15('0x20')][_0x26b693['queue']][_0xbf15('0xe8')]+=0x1;_0x1803fc[_0xbf15('0x73')]=0xb;_0x1803fc[_0xbf15('0xd1')]=_0xbf15('0xe9');_0x1803fc[_0xbf15('0xd3')]=_0xbf15('0xea');_0x1803fc['countabandonedretry']+=0x1;_0x1803fc[_0xbf15('0xd6')]+=0x1;_0x5649c0=this[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xeb')];_0x206b1d=this['voiceQueues'][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xd8')];hopperUtils['verifyAdditionalPhones'](_0x1803fc,_0x1803fc['state'],_0x488a5f[_0xbf15('0xda')])[_0xbf15('0x3e')](function(_0x4e7198){if(_0x1803fc[_0xbf15('0xec')]>=_0x3172e5[_0xbf15('0x20')][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xed')]){_0x3172e5['queueCallerAbandonCreateState'](_0x1803fc,_0x4e7198['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1803fc['countabandonedretry'],'scheduledat':moment()[_0xbf15('0xde')](_0x3172e5['voiceQueues'][_0x26b693[_0xbf15('0xc0')]][_0xbf15('0xeb')],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x488a5f[_0xbf15('0xe0')],'ListId':_0x488a5f[_0xbf15('0xe1')],'VoiceQueueId':_0x488a5f[_0xbf15('0xe2')]||undefined,'CampaignId':_0x488a5f[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x23964b=new History(_0x1803fc);_0x23964b['state']=0xb;_0x23964b['statedesc']='Abandoned';_0x23964b[_0xbf15('0xe4')]=moment()[_0xbf15('0x45')](_0xbf15('0xc7'));_0x23964b[_0xbf15('0x74')]=_0x23964b[_0xbf15('0xe4')];_0x23964b[_0xbf15('0xe5')]=_0x1803fc['calleridname'];_0x23964b[_0xbf15('0xe6')]=_0x1803fc[_0xbf15('0xe6')];hopperUtils['createHistory'](_0x23964b)['catch'](loggerCatch(_0xbf15('0xef')));}})[_0xbf15('0x3e')](function(){if(_0x1c3cea)hopperUtils[_0xbf15('0xf0')](_0x1803fc,_0x5649c0,_0x206b1d)[_0xbf15('0x3e')](function(){return 0x1;});});}}}};Dialer[_0xbf15('0x1a')][_0xbf15('0xf1')]=function(_0x47db6f){if(this['actions'][_0x47db6f[_0xbf15('0xbd')]]){this['actions'][_0x47db6f['uniqueid']][_0xbf15('0xf2')]=_0x47db6f[_0xbf15('0xf2')];}if(this[_0xbf15('0x25')][_0x47db6f[_0xbf15('0xbd')]]){this[_0xbf15('0x25')][_0x47db6f[_0xbf15('0xbd')]][_0xbf15('0xf2')]=_0x47db6f[_0xbf15('0xf2')];}};Dialer[_0xbf15('0x1a')]['syncQueueMember']=function(_0x5359be){if(!this[_0xbf15('0x23')][_0x5359be['actionid']]){return;}var _0xbd1f89=this[_0xbf15('0x20')][this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]][_0xbf15('0xc0')]][_0xbf15('0xf4')]||_0xbf15('0xf5');if(_0xbd1f89===_0xbf15('0xf6')){if(this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]]&&_[_0xbf15('0xf7')](this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]]['locked'])&&_0x5359be[_0xbf15('0x87')]==='1'&&_0x5359be['paused']==='0'){if(this['agents'][_0x5359be[_0xbf15('0xf8')]]){if(!this['agents'][_0x5359be['stateinterface']]['locked']){this['agents'][_0x5359be[_0xbf15('0xf8')]][_0xbf15('0xf9')]=!![];this[_0xbf15('0x23')][_0x5359be['actionid']][_0xbf15('0xf9')]=!![];this['actions'][_0x5359be[_0xbf15('0xf3')]][_0xbf15('0xf8')]=_0x5359be['stateinterface'];}}}}else if(_0xbd1f89===_0xbf15('0xf5')){if(this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]]){if(this[_0xbf15('0xfa')][_0x5359be[_0xbf15('0xf8')]]){this['actions'][_0x5359be[_0xbf15('0xf3')]][_0xbf15('0xf8')]=_0x5359be['stateinterface'];if(_[_0xbf15('0xf7')](this['queueBooked'][this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]][_0xbf15('0xc0')]])){this[_0xbf15('0x29')][this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]]['queue']]=[];}this['queueBooked'][this[_0xbf15('0x23')][_0x5359be[_0xbf15('0xf3')]][_0xbf15('0xc0')]][_0xbf15('0x9e')](_[_0xbf15('0xfb')](_[_0xbf15('0x78')](this[_0xbf15('0x23')][_0x5359be['actionid']],[_0xbf15('0xfc'),_0xbf15('0xf8')]),{'status':_0x5359be['status'],'paused':_0x5359be[_0xbf15('0xfd')]}));}}}};Dialer[_0xbf15('0x1a')]['syncQueueStatusComplete']=function(_0x5a7f87){if(!this[_0xbf15('0x23')][_0x5a7f87['actionid']]){return;}var _0x502354=this;var _0x51a5a9=this[_0xbf15('0x20')][this['actions'][_0x5a7f87[_0xbf15('0xf3')]]['queue']];var _0x5b59d0=_0x51a5a9[_0xbf15('0xf4')]||_0xbf15('0xf5');if(_0x5b59d0===_0xbf15('0xf6')){if(this[_0xbf15('0x23')][_0x5a7f87['actionid']]&&this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xf8')]){this['preview'][_0xbf15('0xfe')](this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xfc')],this['actions'][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xf8')])[_0xbf15('0x9d')](function(_0xdd905a){logger[_0xbf15('0x67')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0xdd905a,{'showHidden':![],'depth':null}));})['finally'](function(){_0x502354[_0xbf15('0xbf')](_0x502354[_0xbf15('0x20')][_0x502354['actions'][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]);_0x502354[_0xbf15('0xfa')][_0x502354[_0xbf15('0x23')][_0x5a7f87['actionid']][_0xbf15('0xf8')]]['locked']=![];delete _0x502354['actions'][_0x5a7f87['actionid']];unlockQueueStatus(_0x51a5a9);});}else{this[_0xbf15('0xbf')](this['voiceQueues'][this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]);hopperUtils[_0xbf15('0xdd')]({'active':![],'ContactId':this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xe0')],'ListId':this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xe1')],'VoiceQueueId':this[_0xbf15('0x23')][_0x5a7f87['actionid']][_0xbf15('0xe2')]||undefined,'CampaignId':this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xee')]||undefined})['catch'](loggerCatch(_0xbf15('0xff')));delete this['actions'][_0x5a7f87[_0xbf15('0xf3')]];unlockQueueStatus(_0x51a5a9);}}else if(_0x5b59d0===_0xbf15('0xf5')){var _0x195d4c;if(this[_0xbf15('0x23')][_0x5a7f87['actionid']]&&!_[_0xbf15('0x47')](this[_0xbf15('0x29')][this['actions'][_0x5a7f87['actionid']][_0xbf15('0xc0')]])){if(this['queueBookedRR'][_0x502354[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]){this[_0xbf15('0x2a')][_0x502354[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]=this[_0xbf15('0x2a')][this[_0xbf15('0x23')][_0x5a7f87['actionid']][_0xbf15('0xc0')]]?this[_0xbf15('0x2a')][this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]:this[_0xbf15('0x29')][this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]]?this[_0xbf15('0x29')][this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]]['queue']]['_rr']||0x0:0x0;}this[_0xbf15('0x29')][this[_0xbf15('0x23')][_0x5a7f87['actionid']][_0xbf15('0xc0')]][_0xbf15('0x100')]=this[_0xbf15('0x2a')][this[_0xbf15('0x23')][_0x5a7f87[_0xbf15('0xf3')]][_0xbf15('0xc0')]];for(var _0x41b840=0x0;_0x41b840=_0x4e84ac['dialGlobalMaxRetry']){_0x1bbf10[_0xbf15('0x11f')](_0x5dbe62,_0x5d63ba,_0x2f08b7,_0xbf15('0x120'));}else{if(_0x5dbe62[_0xbf15('0x121')]>=_0x4e84ac[_0xbf15('0x122')]){_0x1bbf10[_0xbf15('0x123')](_0x5dbe62,_0x5d63ba,_0x2f08b7,_0xbf15('0x124'));}else{hopperUtils[_0xbf15('0xdd')]({'active':![],'countmachineretry':_0x5dbe62['countmachineretry'],'scheduledat':moment()[_0xbf15('0xde')](_0x4e84ac['dialMachineRetryFrequency'],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x5dbe62[_0xbf15('0xe0')],'ListId':_0x5dbe62[_0xbf15('0xe1')],'VoiceQueueId':_0x5dbe62[_0xbf15('0xe2')]||undefined,'CampaignId':_0x5dbe62[_0xbf15('0xee')]||undefined})['catch'](loggerCatch(_0xbf15('0x125')));_0x5d63ba({'reschedule':0x1});}}});}if(_0x3758ef[_0xbf15('0x41')]===_0xbf15('0xbe')&&this[_0xbf15('0xa9')][_0x3758ef[_0xbf15('0xc0')]][_0xbf15('0x10c')]&&_0x19eff3['value']===_0xbf15('0x10e')){delete this[_0xbf15('0x25')][_0x19eff3['uniqueid']];this[_0xbf15('0xbf')](this[_0xbf15('0xa9')][_0x3758ef[_0xbf15('0xc0')]]);_0x70110c=new Hangup(_0x3758ef,_0x19eff3);_0x70110c[_0xbf15('0x73')]=0x12;_0x70110c[_0xbf15('0xd1')]=_0xbf15('0x110');_0x70110c[_0xbf15('0x118')]='AMD';ami[_0xbf15('0x119')](_0xbf15('0x112'),ut[_0xbf15('0x113')](_0x70110c,_0xbf15('0x114')));this['saveInDb'](_0x70110c,'[syncHangupInAMDIvr][createHistory]',_0xbf15('0x126'));}if(_0x3758ef[_0xbf15('0x41')]===_0xbf15('0xbe')&&this[_0xbf15('0xa9')][_0x3758ef[_0xbf15('0xc0')]][_0xbf15('0x10c')]&&_0x19eff3[_0xbf15('0x10d')]==='MACHINE'){return new Promise(function(_0xb8caa6,_0x2d1d85){delete _0x1bbf10[_0xbf15('0x25')][_0x19eff3[_0xbf15('0xbd')]];_0x1bbf10['updateOriginated'](_0x1bbf10[_0xbf15('0xa9')][_0x3758ef[_0xbf15('0xc0')]]);_0x1bbf10[_0xbf15('0xa9')][_0x3758ef[_0xbf15('0xc0')]][_0xbf15('0xc1')]+=0x1;_0x1bbf10['campaigns'][_0x3758ef[_0xbf15('0xc0')]][_0xbf15('0x10f')]+=0x1;var _0x4cb4c3=_0x1bbf10['campaigns'][_0x3758ef[_0xbf15('0xc0')]];var _0x36a90b=new Hangup(_0x3758ef,_0x19eff3);_0x36a90b[_0xbf15('0x73')]=0x13;_0x36a90b[_0xbf15('0xd1')]=_0xbf15('0x117');_0x36a90b[_0xbf15('0x118')]=_0xbf15('0x111');_0x36a90b[_0xbf15('0x121')]+=0x1;_0x36a90b[_0xbf15('0xd6')]+=0x1;_0x36a90b[_0xbf15('0x114')]=!![];ami['emit'](_0xbf15('0x112'),ut[_0xbf15('0x113')](_0x36a90b,_0xbf15('0x114')));hopperUtils[_0xbf15('0xc8')](_0x36a90b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x11a')));if(_0x36a90b[_0xbf15('0x11b')]+_0x36a90b[_0xbf15('0x11c')]+_0x36a90b[_0xbf15('0x11d')]+_0x36a90b['countnosuchnumberretry']+_0x36a90b['countdropretry']+_0x36a90b[_0xbf15('0xec')]+_0x36a90b[_0xbf15('0x121')]+_0x36a90b['countagentrejectretry']>=_0x4cb4c3[_0xbf15('0x127')]){_0x1bbf10[_0xbf15('0x11f')](_0x36a90b,_0xb8caa6,_0x2d1d85,_0xbf15('0x120'));}else{if(_0x36a90b[_0xbf15('0x121')]>=_0x4cb4c3[_0xbf15('0x122')]){_0x1bbf10['createStateFinal'](_0x36a90b,_0xb8caa6,_0x2d1d85,'reason\x2019\x20machine....');}else{hopperUtils[_0xbf15('0xdd')]({'active':![],'countmachineretry':_0x36a90b[_0xbf15('0x121')],'scheduledat':moment()[_0xbf15('0xde')](_0x4cb4c3[_0xbf15('0x128')],'minutes')[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x36a90b[_0xbf15('0xe0')],'ListId':_0x36a90b[_0xbf15('0xe1')],'VoiceQueueId':_0x36a90b[_0xbf15('0xe2')]||undefined,'CampaignId':_0x36a90b[_0xbf15('0xee')]||undefined})['catch'](loggerCatch(_0xbf15('0x125')));_0xb8caa6({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xbf15('0x129')]=function(_0x5ae782){var _0x34f88b=this[_0xbf15('0x25')][_0x5ae782[_0xbf15('0xbd')]];var _0x50db2b;if(_0x34f88b&&_0x34f88b[_0xbf15('0x41')]===_0xbf15('0xbe')){delete this['uniqueId'][_0x5ae782['uniqueid']];this[_0xbf15('0xbf')](this['campaigns'][_0x34f88b[_0xbf15('0xc0')]]);this[_0xbf15('0xa9')][_0x34f88b['queue']][_0xbf15('0x12a')]+=0x1;_0x50db2b=new Hangup(_0x34f88b,_0x5ae782);hopperUtils[_0xbf15('0xc8')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12b')));hopperUtils[_0xbf15('0x12c')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12d')));}if(_0x34f88b&&_0x34f88b['type']!==_0xbf15('0xbe')&&isNotNull(this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]]['dialQueueProject'])){delete this[_0xbf15('0x25')][_0x5ae782[_0xbf15('0xbd')]];this[_0xbf15('0xbf')](this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]]);this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]]['outboundAnswerCallsDay']+=0x1;this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]][_0xbf15('0x10f')]+=0x1;_0x50db2b=new Hangup(_0x34f88b,_0x5ae782);_0x50db2b[_0xbf15('0x73')]=0x10;_0x50db2b[_0xbf15('0xd1')]='AnswerAGI';_0x50db2b[_0xbf15('0x118')]=_0xbf15('0x12e');hopperUtils[_0xbf15('0xc8')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12b')));hopperUtils[_0xbf15('0x12c')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12d')));}if(_0x34f88b&&_0x34f88b[_0xbf15('0x41')]!=='ivr'&&!isNotNull(this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]][_0xbf15('0x12f')])){if(_0x5ae782[_0xbf15('0x130')]===_0xbf15('0x131')){delete this[_0xbf15('0x25')][_0x5ae782['uniqueid']];this['voiceQueues'][_0x34f88b[_0xbf15('0xc0')]]['outboundAnswerCallsDay']+=0x1;const _0x59c415=new AgentComplete(_0x34f88b,_0x5ae782);_0x59c415[_0xbf15('0xee')]=this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]]['id'];hopperUtils[_0xbf15('0xc8')](_0x59c415)[_0xbf15('0x9d')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xbf15('0x12c')](_0x59c415)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xca')));}else{delete this[_0xbf15('0x25')][_0x5ae782[_0xbf15('0xbd')]];this[_0xbf15('0xbf')](this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]]);this[_0xbf15('0x20')][_0x34f88b[_0xbf15('0xc0')]][_0xbf15('0x132')]+=0x1;_0x50db2b=new Hangup(_0x34f88b,_0x5ae782);_0x50db2b[_0xbf15('0x73')]=0xc;_0x50db2b[_0xbf15('0xd1')]=_0x5ae782[_0xbf15('0x130')];_0x50db2b[_0xbf15('0x118')]='Unknow';hopperUtils[_0xbf15('0xc8')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12b')));hopperUtils[_0xbf15('0x12c')](_0x50db2b)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x12d')));}}};Dialer[_0xbf15('0x1a')][_0xbf15('0xd')]=function(_0x1f3f64){var _0x1623e1=this;if(!_0x1623e1[_0xbf15('0x2b')][_0x1f3f64[_0xbf15('0x62')]]){_0x1623e1['queuesSummary'][_0x1f3f64[_0xbf15('0x62')]]={'running':![]};}else if(_0x1623e1[_0xbf15('0x2b')][_0x1f3f64[_0xbf15('0x62')]][_0xbf15('0x133')]===!![]){return;}else if(_0x1623e1[_0xbf15('0x2b')][_0x1f3f64[_0xbf15('0x62')]]['running']===![]){_0x1623e1[_0xbf15('0x2b')][_0x1f3f64['name']][_0xbf15('0x133')]=!![];}var _0x18b25e=_0x1623e1['voiceQueues'][_0x1f3f64[_0xbf15('0x62')]];var _0x44cb3d=_0x18b25e[_0xbf15('0x70')]!==utils[_0xbf15('0x6c')][_0xbf15('0x7d')];var _0x9fb56=utils[_0xbf15('0x134')](_0x18b25e);_0x18b25e[_0xbf15('0x135')]=utils[_0xbf15('0x136')](_0x18b25e,_0x1623e1['trunks']);Promise[_0xbf15('0xaa')]()['then'](function(){if(_0x18b25e[_0xbf15('0x135')]===utils[_0xbf15('0x6c')][_0xbf15('0x7d')]){if(_0x44cb3d){clearPredictiveAttributes(_0x18b25e);_0x1f3f64[_0xbf15('0x27')]=undefined;_0x1f3f64[_0xbf15('0x61')]=undefined;}if(_0x18b25e[_0xbf15('0x135')]===utils[_0xbf15('0x6c')][_0xbf15('0x7d')]){_0x1f3f64['available']=0x0;_0x1f3f64[_0xbf15('0xfd')]=0x0;_0x1f3f64[_0xbf15('0x137')]=0x0;_0x1f3f64[_0xbf15('0x138')]=0x0;_0x1f3f64[_0xbf15('0x139')]=0x0;}}else if(_0x18b25e[_0xbf15('0x135')]===utils[_0xbf15('0x6c')][_0xbf15('0x13a')]&&!_0x9fb56){return _0x1623e1[_0xbf15('0x92')](_0x18b25e,!![])[_0xbf15('0x3e')](function(){return _0x1623e1[_0xbf15('0x92')](_0x18b25e,![]);})['then'](function(){return _0x1623e1[_0xbf15('0xae')](_0x18b25e);})[_0xbf15('0x9d')](function(_0x37e894){loggerSyncQueueSummary['debug'](_0xbf15('0x13b'),util[_0xbf15('0x44')](_0x37e894,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x18b25e);});}else{clearPredictiveAttributes(_0x18b25e);}})[_0xbf15('0x3e')](function(){var _0xc7dc8f=_0x1f3f64[_0xbf15('0x13c')](_0x18b25e);if(_0xc7dc8f||_0x18b25e[_0xbf15('0x13d')]){_0x18b25e[_0xbf15('0x13d')]=![];_0x1f3f64['updateReportFromOutboundQueue'](_0x18b25e);Object[_0xbf15('0x13e')](_0x18b25e,_0x1f3f64);emitOutboundVoiceQueueSummary(_0x1f3f64);}_0x1623e1[_0xbf15('0x2b')][_0x18b25e[_0xbf15('0x62')]][_0xbf15('0x133')]=![];})[_0xbf15('0x9d')](function(_0x10c686){logger[_0xbf15('0x67')](_0xbf15('0x13b'),util[_0xbf15('0x44')](_0x10c686,{'showHidden':![],'depth':null}));_0x1623e1[_0xbf15('0x2b')][_0x18b25e['name']][_0xbf15('0x133')]=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0xbf15('0x13f')](function(){var _0x1436fb=_[_0xbf15('0x140')](this['voiceQueues'],function(_0x26c452){return _0x26c452[_0xbf15('0x141')];});var _0x5528a6=_[_0xbf15('0x140')](this[_0xbf15('0xfa')],function(_0x3a1d9d){return _0x3a1d9d['online']&&_0x3a1d9d[_0xbf15('0x87')]===_0xbf15('0x88');});if(_0x1436fb[_0xbf15('0x97')]>0x0&&_0x5528a6[_0xbf15('0x97')]>0x0){return Promise[_0xbf15('0xaa')]()['then'](cmHopper[_0xbf15('0x142')](_[_0xbf15('0x143')](_0x1436fb,'id'),previewRecallmeReminderInterval,_[_0xbf15('0x143')](_0x5528a6,'id')))[_0xbf15('0x3e')](function(_0x1fe040){for(var _0x51ecf5=0x0;_0x51ecf5<_0x1fe040['length'];_0x51ecf5++){var _0x50a0bb=_0x1fe040[_0x51ecf5][_0xbf15('0x144')][_0xbf15('0x62')];if(_0x50a0bb)io['to'](util[_0xbf15('0x45')](_0xbf15('0x145'),_0x50a0bb))[_0xbf15('0x119')](_0xbf15('0x146'),{'hopper':_0x1fe040[_0x51ecf5]});}})[_0xbf15('0x9d')](function(_0x3e443b){logger[_0xbf15('0x67')]('checkPreviewRecallReminder',_0x3e443b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xbf15('0x3d')]=function(){var _0x202fa=this;setInterval(function(){_0x202fa[_0xbf15('0x147')](_0x202fa[_0xbf15('0x25')],'[uniqueid]');_0x202fa['clearZombieChannels'](_0x202fa['actions'],'[actions]');},0x32c8);};Dialer[_0xbf15('0x1a')][_0xbf15('0x147')]=function(_0x3f04e8,_0x314500){var _0x3ed802=this;for(var _0x3f8a6b in _0x3f04e8){if(typeof _0x3f04e8[_0x3f8a6b]!=='undefined'){this['sequence'][_0xbf15('0x1b')](function(){if(!_[_0xbf15('0xf7')](_0x3f04e8[_0x3f8a6b])){return ami[_0xbf15('0x9f')]({'action':'status','channel':_0x3f04e8[_0x3f8a6b][_0xbf15('0xf2')]})[_0xbf15('0x9d')](function(_0x88f68d){if(_0x88f68d['message']===_0xbf15('0x148')){setTimeout(function(){if(_0x3f04e8[_0x3f8a6b]&&_0x3f04e8[_0x3f8a6b][_0xbf15('0x41')]!==_0xbf15('0xbe')){_0x3ed802[_0xbf15('0xbf')](_0x3ed802[_0xbf15('0x20')][_0x3f04e8[_0x3f8a6b][_0xbf15('0xc0')]]);logger[_0xbf15('0x67')](_0xbf15('0x149'),_0x314500,_0x3f8a6b,_0x3f04e8[_0x3f8a6b][_0xbf15('0xc0')]);delete _0x3f04e8[_0x3f8a6b];}if(_0x3f04e8[_0x3f8a6b]&&_0x3f04e8[_0x3f8a6b][_0xbf15('0x41')]===_0xbf15('0xbe')){_0x3ed802[_0xbf15('0xbf')](_0x3ed802[_0xbf15('0xa9')][_0x3f04e8[_0x3f8a6b][_0xbf15('0xc0')]]);logger['error'](_0xbf15('0x14a'),_0x314500,_0x3f8a6b,_0x3f04e8[_0x3f8a6b][_0xbf15('0xc0')]);delete _0x3f04e8[_0x3f8a6b];}},0x2328);}});}});}}};Dialer['prototype'][_0xbf15('0x14b')]=function(_0x5a6661){return Promise[_0xbf15('0xaa')]()[_0xbf15('0x3e')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5a6661))[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x14c')));};Dialer[_0xbf15('0x1a')][_0xbf15('0xbf')]=function(_0x59f413){if(!_[_0xbf15('0x40')](_0x59f413)&&_0x59f413!==null){if(typeof _0x59f413[_0xbf15('0x7f')]!=='undefined'){if(_0x59f413[_0xbf15('0x7f')]>0x0){_0x59f413['originated']-=0x1;}else{logger[_0xbf15('0x67')](_0xbf15('0x14d'));}}}else{logger[_0xbf15('0x67')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x21ab90,_0x52826f){var _0x2ca746=this;return function(_0x307be7){_0x2ca746[_0xbf15('0xbf')](_0x52826f);logger[_0xbf15('0x67')](_0x21ab90,util[_0xbf15('0x44')](_0x307be7,{'showHidden':![],'depth':null}));};};Dialer[_0xbf15('0x1a')][_0xbf15('0x14e')]=function(_0x97f14c,_0x1b7342,_0x3f8a6e){var _0x2f14c7={'state':0x19,'statedesc':_0xbf15('0x14f')};this[_0xbf15('0xbf')](_0x1b7342);this[_0xbf15('0x150')](_['merge'](_0x2f14c7,_[_0xbf15('0x78')](_0x3f8a6e,[_0xbf15('0xe0'),_0xbf15('0xe1'),_0xbf15('0x151'),_0xbf15('0xe2'),_0xbf15('0xee')])),_0xbf15('0x152'),_0xbf15('0x153'));logger[_0xbf15('0x67')](_0x97f14c);};Dialer[_0xbf15('0x1a')]['saveInDb']=function(_0x4870ce,_0x369e61,_0x581c52){hopperUtils['createHistory'](_0x4870ce)['catch'](loggerCatch(_0x369e61));hopperUtils[_0xbf15('0x12c')](_0x4870ce)[_0xbf15('0x9d')](loggerCatch(_0x581c52));};Dialer[_0xbf15('0x1a')][_0xbf15('0xdc')]=function(_0x54f3d7,_0x41d4d5){hopperUtils[_0xbf15('0xc8')](_0x54f3d7)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xc9')));if(_0x41d4d5==0x0){hopperUtils[_0xbf15('0x12c')](_0x54f3d7)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x154')));}};Dialer[_0xbf15('0x1a')][_0xbf15('0x155')]=function(_0x349409){return Promise[_0xbf15('0xaa')]()[_0xbf15('0x3e')](cmHopper['handlePreviewRecallNotifications'](_0x349409['id'],previewRecallmeReminderInterval))[_0xbf15('0x3e')](function(_0x5ac41a){for(var _0x4a4562=0x0;_0x4a4562<_0x5ac41a[_0xbf15('0x97')];_0x4a4562++){var _0x17753a=_0x5ac41a[_0x4a4562][_0xbf15('0x144')][_0xbf15('0x62')];if(_0x17753a)io['to'](util[_0xbf15('0x45')]('user:%s',_0x17753a))[_0xbf15('0x119')]('user:dialPreviewRecallReminder',{'hopper':_0x5ac41a[_0x4a4562]});}})['catch'](function(){});};Dialer[_0xbf15('0x1a')]['launchHandleIvr']=function(_0x124d9e){var _0x571f59=this;return function(){_0x571f59['handleIvr'](_0x124d9e);};};Dialer['prototype'][_0xbf15('0x156')]=function(_0x520140,_0x23e5a4){var _0x43a9ed=this;var _0xeb9248=uuid['v4']();this['actions'][_0xeb9248]=new Action(_0x520140,_0x23e5a4,_0xeb9248);return new Promise(function(_0x5da216,_0x34b071){if(_[_0xbf15('0x40')](_0x520140)&&typeof _0x520140!==_0xbf15('0x157')){return _0x34b071(msgResponse(_0xbf15('0x158'),_0xbf15('0x93'),_0xbf15('0x159')));}if(_[_0xbf15('0x40')](_0x23e5a4[_0xbf15('0x15a')])||_0x23e5a4[_0xbf15('0x15a')]===null){return _0x34b071(msgResponse(_0xbf15('0x158'),_0xbf15('0x93'),_0xbf15('0x15b')));}var _0x39bb64={'XMD-CALLERID':_0x43a9ed['actions'][_0xeb9248][_0xbf15('0x15c')](),'XMD-AGI':_0x520140[_0xbf15('0x12f')]?util['format'](_0xbf15('0x15d'),ipAgi,_0x520140['dialQueueProject']):_0xbf15('0x15e'),'XMD-AGIAFTER':_0x520140[_0xbf15('0xc5')]?util['format'](_0xbf15('0x15d'),ipAgi,_0x520140['dialQueueProject2']):_0xbf15('0x15e'),'XMD-QUEUE':utils[_0xbf15('0x15f')](_0x520140)?util[_0xbf15('0x45')](_0xbf15('0x160'),_0x520140[_0xbf15('0x62')],_0x520140[_0xbf15('0x161')]||'',_0x520140[_0xbf15('0xc6')]?'c':'',_0x520140[_0xbf15('0xce')]||0x3):_0xbf15('0x15e'),'XMD-CONTACTID':_0x23e5a4[_0xbf15('0xe0')],'XMD-CDRTYPE':_0xbf15('0x162'),'CALLERID(all)':_0x43a9ed[_0xbf15('0x23')][_0xeb9248][_0xbf15('0x15c')](),'XMD-AMD':_0x520140[_0xbf15('0x10c')]?'ACTIVE':_0xbf15('0x15e'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x520140[_0xbf15('0x10c')]){_0x39bb64['XMD-AMDINITIALSILENCE']=_0x520140[_0xbf15('0x163')]||0x9c4;_0x39bb64[_0xbf15('0x164')]=_0x520140[_0xbf15('0x165')]||0x5dc;_0x39bb64[_0xbf15('0x166')]=_0x520140['dialAMDAfterGreetingSilence']||0x320;_0x39bb64[_0xbf15('0x167')]=_0x520140[_0xbf15('0x168')]||0x1388;_0x39bb64[_0xbf15('0x169')]=_0x520140[_0xbf15('0x16a')]||0x64;_0x39bb64['XMD-AMDBETWEENWORDSSILENCE']=_0x520140[_0xbf15('0x16b')]||0x32;_0x39bb64[_0xbf15('0x16c')]=_0x520140['dialAMDMaximumNumberOfWords']||0x3;_0x39bb64['XMD-AMDSILENCETHRESHOLD']=_0x520140[_0xbf15('0x16d')]||0x100;_0x39bb64['XMD-AMDMAXIMUMWORDLENGTH']=_0x520140[_0xbf15('0x16e')]||0x1388;}if(utils[_0xbf15('0x15f')](_0x520140)){_0x39bb64[_0xbf15('0x16f')]=_0x23e5a4[_0xbf15('0xe2')];}else{_0x39bb64[_0xbf15('0x170')]=_0x23e5a4[_0xbf15('0xee')];}var _0xe0d348=utils[_0xbf15('0x171')](_0x23e5a4['Contact']);Object[_0xbf15('0x13e')](_0x39bb64,_0xe0d348);var _0x492256=_0x43a9ed[_0xbf15('0x8c')](_0x520140[_0xbf15('0x172')])?utils['getCallerId'](_0x520140['Trunk'][_0xbf15('0x173')],_0x520140[_0xbf15('0x174')],_0x520140[_0xbf15('0x175')]>0x0?utils[_0xbf15('0x176')](_0x520140[_0xbf15('0x177')],_0x520140[_0xbf15('0x175')]):_0x520140[_0xbf15('0x177')]):utils[_0xbf15('0x178')](_['isNil'](_0x520140[_0xbf15('0x179')])?_0x520140[_0xbf15('0x172')][_0xbf15('0x173')]:_0x520140[_0xbf15('0x179')]['callerid'],_0x520140['dialOriginateCallerIdName'],_0x520140[_0xbf15('0x175')]>0x0?utils[_0xbf15('0x176')](_0x520140[_0xbf15('0x177')],_0x520140['dialRandomLastDigitCallerIdNumber']):_0x520140[_0xbf15('0x177')]);if(_0x492256){_0x39bb64[_0xbf15('0x17a')]=_0x43a9ed[_0xbf15('0x23')][_0xeb9248]['originatecalleridname']=utils['extractCalleridName'](_0x492256);_0x39bb64[_0xbf15('0x17b')]=_0x23e5a4[_0xbf15('0x15a')];}_0x520140[_0xbf15('0x17c')]=_0x39bb64;return ami[_0xbf15('0x9f')]({'actionid':_0xeb9248,'action':_0xbf15('0x158'),'channel':_0x43a9ed['isTrunkReachable'](_0x520140['Trunk'])?util['format'](_0xbf15('0x17d'),_0x520140['Trunk'][_0xbf15('0x62')],isNotNull(_0x520140[_0xbf15('0x17e')])?_0x520140[_0xbf15('0x17e')][_0xbf15('0x17f')]()||'':'',_0x520140[_0xbf15('0x180')]>0x0?_0x23e5a4[_0xbf15('0x15a')][_0xbf15('0x181')](_0x520140[_0xbf15('0x180')]):_0x23e5a4[_0xbf15('0x15a')]):util[_0xbf15('0x45')](_0xbf15('0x17d'),_[_0xbf15('0xf7')](_0x520140['TrunkBackup'])?_0x520140[_0xbf15('0x172')][_0xbf15('0x62')]:_0x520140[_0xbf15('0x179')][_0xbf15('0x62')],isNotNull(_0x520140[_0xbf15('0x17e')])?_0x520140[_0xbf15('0x17e')][_0xbf15('0x17f')]()||'':'',_0x520140[_0xbf15('0x180')]>0x0?_0x23e5a4['phone'][_0xbf15('0x181')](_0x520140[_0xbf15('0x180')]):_0x23e5a4[_0xbf15('0x15a')]),'callerid':_0x492256,'Exten':'xcally-motion-dialer','Context':_0xbf15('0x182'),'Priority':'1','variable':_0x39bb64,'timeout':(_0x520140[_0xbf15('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0xeb9248})[_0xbf15('0x3e')](function(_0x4741a3){return _0x5da216(_0x4741a3);})[_0xbf15('0x9d')](function(_0x34087f){_0x520140[_0xbf15('0x184')]+=0x1;var _0x587d72=new History(_0x43a9ed['actions'][_0xeb9248]);logger[_0xbf15('0x67')](util['format'](_0xbf15('0x185'),JSON[_0xbf15('0x77')](_0x34087f)));_0x587d72[_0xbf15('0x73')]=0xe;_0x587d72[_0xbf15('0xd1')]=_0xbf15('0x186');_0x587d72[_0xbf15('0xe4')]=moment()['format'](_0xbf15('0xc7'));_0x587d72[_0xbf15('0x74')]=_0x587d72[_0xbf15('0xe4')];hopperUtils[_0xbf15('0xc8')](_0x587d72)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x187')));_0x43a9ed[_0xbf15('0x12c')](_0x587d72)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x187')))['finally'](function(){delete _0x43a9ed[_0xbf15('0x23')][_0xeb9248];return _0x34b071(msgResponse(_0xbf15('0x158'),'Error',_0xbf15('0x188')));});});});};Dialer[_0xbf15('0x1a')][_0xbf15('0x189')]=function(_0x3199ba,_0x1f085d,_0x305d9e){var _0x561ee3=new History(_0x1f085d);if(_0x561ee3[_0xbf15('0x11b')]+_0x561ee3[_0xbf15('0x11c')]+_0x561ee3[_0xbf15('0x11d')]+_0x561ee3['countnosuchnumberretry']+_0x561ee3[_0xbf15('0xd5')]+_0x561ee3[_0xbf15('0xec')]+_0x561ee3['countmachineretry']+_0x561ee3[_0xbf15('0x18a')]>=_0x305d9e['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3199ba){case 0x3:if(_0x561ee3[_0xbf15('0x11d')]>=_0x305d9e['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xbf15('0xdd')]({'active':![],'countnoanswerretry':_0x561ee3[_0xbf15('0x11d')]+=0x1,'scheduledat':moment()[_0xbf15('0xde')](_0x305d9e[_0xbf15('0x18b')],'minutes')[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3['ListId'],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3['CampaignId']||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x18c')));break;case 0x5:if(_0x561ee3['countbusyretry']>=_0x305d9e[_0xbf15('0x18d')]-0x1){return!![];}hopperUtils[_0xbf15('0xdd')]({'active':![],'countbusyretry':_0x561ee3[_0xbf15('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x305d9e[_0xbf15('0x18e')],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3[_0xbf15('0xe1')],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})['catch'](loggerCatch(_0xbf15('0x18f')));break;case 0x8:if(_0x561ee3[_0xbf15('0x11c')]>=_0x305d9e[_0xbf15('0x190')]-0x1){return!![];}hopperUtils[_0xbf15('0xdd')]({'active':![],'countcongestionretry':_0x561ee3[_0xbf15('0x11c')]+=0x1,'scheduledat':moment()[_0xbf15('0xde')](_0x305d9e[_0xbf15('0x191')],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3['ContactId'],'ListId':_0x561ee3[_0xbf15('0xe1')],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x561ee3[_0xbf15('0x11e')]>=_0x305d9e[_0xbf15('0x192')]-0x1){return!![];}else{hopperUtils[_0xbf15('0xdd')]({'active':![],'countnosuchnumberretry':_0x561ee3[_0xbf15('0x11e')]+=0x1,'scheduledat':moment()[_0xbf15('0xde')](_0x305d9e['dialNoSuchNumberRetryFrequency'],_0xbf15('0xdf'))[_0xbf15('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3[_0xbf15('0xe1')],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x193')));}break;case 0xa:if(_0x561ee3[_0xbf15('0xd5')]>=_0x305d9e['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xbf15('0xdd')]({'active':![],'countdropretry':_0x561ee3['countdropretry']+=0x1,'scheduledat':moment()[_0xbf15('0xde')](_0x305d9e['dialDropRetryFrequency'],_0xbf15('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x561ee3['ContactId'],'ListId':_0x561ee3[_0xbf15('0xe1')],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xe3')));break;case 0xb:if(_0x561ee3['countabandonedretry']>=_0x305d9e['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x561ee3['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x305d9e[_0xbf15('0xeb')],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3['ListId'],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x194')));break;case 0x13:if(_0x561ee3['countmachineretry']>=_0x305d9e[_0xbf15('0x122')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x561ee3['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x305d9e[_0xbf15('0x128')],_0xbf15('0xdf'))[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3['ListId'],'VoiceQueueId':_0x561ee3[_0xbf15('0xe2')]||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x125')));break;case 0x14:if(_0x561ee3[_0xbf15('0x18a')]>=_0x305d9e[_0xbf15('0x195')]-0x1){return!![];}hopperUtils[_0xbf15('0xdd')]({'active':![],'countagentrejectretry':_0x561ee3['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xbf15('0xde')](_0x305d9e['dialAgentRejectRetryFrequency'],'minutes')[_0xbf15('0x45')](_0xbf15('0xc7')),'ContactId':_0x561ee3[_0xbf15('0xe0')],'ListId':_0x561ee3[_0xbf15('0xe1')],'VoiceQueueId':_0x561ee3['VoiceQueueId']||undefined,'CampaignId':_0x561ee3[_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x196')));break;default:return!![];}};Dialer[_0xbf15('0x1a')][_0xbf15('0x197')]=function(_0x37d635,_0x481ca0,_0x8af4c3){var _0x439981=this;var _0x417436=new History(_0x37d635);var _0x26d49e=![];var _0x490c15;var _0x53c504;return new Promise(function(_0x59b003,_0x310777){if(_[_0xbf15('0x40')](_0x481ca0)&&typeof _0x481ca0!=='object'){return _0x310777(msgResponse(_0xbf15('0x198'),_0xbf15('0x93'),_0xbf15('0x199')));}if(_[_0xbf15('0x40')](_0x8af4c3)&&typeof _0x8af4c3!==_0xbf15('0x157')){return _0x310777(msgResponse(_0xbf15('0x198'),_0xbf15('0x93'),_0xbf15('0x19a')));}hopperUtils[_0xbf15('0xd9')](_0x417436,_0x8af4c3[_0xbf15('0xc2')],_0x481ca0)[_0xbf15('0x3e')](function(_0x1434b3){if(_0x1434b3[_0xbf15('0xdb')]==0x1)_0x26d49e=!![];switch(_0x8af4c3[_0xbf15('0xc2')]){case'0':_0x481ca0[_0xbf15('0x19b')]+=0x1;_0x417436[_0xbf15('0x73')]=0x0;_0x417436[_0xbf15('0xd1')]=_0xbf15('0x19c');_0x417436[_0xbf15('0x11e')]+=0x1;_0x417436['countglobal']+=0x1;ami[_0xbf15('0x119')](_0xbf15('0x19d'),ut[_0xbf15('0x113')](_0x37d635,_0xbf15('0x19e')));_0x490c15=_0x481ca0[_0xbf15('0x19f')];_0x53c504=_0x481ca0['callAdditionalPhoneAfterMin'];hopperUtils[_0xbf15('0xc8')](_0x417436)['catch'](loggerCatch(_0xbf15('0x11a')));if(_0x439981[_0xbf15('0x189')](0x0,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436[_0xbf15('0x11e')]>=_0x481ca0[_0xbf15('0x192')]){_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1a0'));}else{_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1a0'));}}break;case'3':_0x481ca0['outboundNoAnswerCallsDay']+=0x1;_0x417436['state']=0x3;_0x417436[_0xbf15('0xd1')]=_0xbf15('0x1a1');_0x417436[_0xbf15('0x11d')]+=0x1;_0x417436[_0xbf15('0xd6')]+=0x1;var _0x13a92b=ut[_0xbf15('0x1a2')](_0x37d635,_0x481ca0);ami[_0xbf15('0x119')](_0xbf15('0x1a3'),_0x13a92b);_0x490c15=_0x481ca0['dialNoAnswerRetryFrequency'];_0x53c504=_0x481ca0['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x417436)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x1a4')));if(_0x439981['checkRetriveMax'](0x3,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436[_0xbf15('0x11d')]>=_0x481ca0['dialNoAnswerMaxRetry']){_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,'reason\x203\x20ringing\x20no\x20answer');}else{_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1a5'));}}break;case'5':_0x481ca0['outboundBusyCallsDay']+=0x1;_0x417436['state']=0x5;_0x417436['statedesc']=_0xbf15('0x1a6');_0x417436['countbusyretry']+=0x1;_0x417436['countglobal']+=0x1;ami['emit'](_0xbf15('0x1a7'),ut[_0xbf15('0x113')](_0x37d635,'busy'));_0x490c15=_0x481ca0[_0xbf15('0x18e')];_0x53c504=_0x481ca0[_0xbf15('0xd8')];hopperUtils[_0xbf15('0xc8')](_0x417436)[_0xbf15('0x9d')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x439981[_0xbf15('0x189')](0x5,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436[_0xbf15('0x11b')]>=_0x481ca0[_0xbf15('0x18d')]){_0x439981['createStateFinal'](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1a8'));}else{_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1a8'));}}break;case'8':_0x481ca0[_0xbf15('0x1a9')]+=0x1;_0x417436[_0xbf15('0x73')]=0x8;_0x417436[_0xbf15('0xd1')]=_0xbf15('0x1aa');_0x417436[_0xbf15('0x11c')]+=0x1;_0x417436[_0xbf15('0xd6')]+=0x1;_0x490c15=_0x481ca0[_0xbf15('0x191')];_0x53c504=_0x481ca0[_0xbf15('0xd8')];ami['emit']('custom:agentcongestion',ut[_0xbf15('0x113')](_0x37d635,'congestion'));hopperUtils['createHistory'](_0x417436)['catch'](loggerCatch(_0xbf15('0x1ab')));if(_0x439981[_0xbf15('0x189')](0x8,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436['countcongestionretry']>=_0x481ca0[_0xbf15('0x190')]){_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1ac'));}else{_0x439981['stateGlobal'](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1ac'));}}break;case'11':_0x481ca0['outboundAbandonedCallsDay']+=0x1;_0x417436[_0xbf15('0x73')]=0xb;_0x417436[_0xbf15('0xd1')]='Abandoned';_0x417436[_0xbf15('0xec')]+=0x1;_0x417436[_0xbf15('0xd6')]+=0x1;_0x490c15=_0x481ca0[_0xbf15('0xeb')];_0x53c504=_0x481ca0['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x417436)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0xef')));if(_0x439981[_0xbf15('0x189')](0xb,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436[_0xbf15('0xec')]>=_0x481ca0[_0xbf15('0xed')]){_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1ad'));}else{_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,'reason\x2011\x20abandoned');}}break;case'20':_0x481ca0[_0xbf15('0x1ae')]+=0x1;_0x417436[_0xbf15('0x73')]=0x14;_0x417436[_0xbf15('0xd1')]='AgentReject';_0x417436[_0xbf15('0x18a')]+=0x1;_0x417436[_0xbf15('0xd6')]+=0x1;_0x490c15=_0x481ca0[_0xbf15('0x1af')];_0x53c504=_0x481ca0[_0xbf15('0xd8')];ami[_0xbf15('0x119')](_0xbf15('0x1b0'),ut['buildObj'](_0x37d635,_0xbf15('0x1b1')));hopperUtils['createHistory'](_0x417436)['catch'](loggerCatch(_0xbf15('0x1b2')));if(_0x439981[_0xbf15('0x189')](0x14,_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436[_0xbf15('0x18a')]>=_0x481ca0[_0xbf15('0x195')]){_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,'reason\x2020\x20agentreject');}else{_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,_0xbf15('0x1b3'));}}break;default:_0x481ca0[_0xbf15('0x132')]+=0x1;_0x417436['state']=0xc;_0x417436[_0xbf15('0xd1')]=_0x8af4c3[_0xbf15('0xc2')];_0x490c15=_0x481ca0[_0xbf15('0x1af')];_0x53c504=_0x481ca0['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x417436)[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x1b4')));if(_0x439981['checkRetriveMax'](_0x8af4c3[_0xbf15('0xc2')],_0x37d635,_0x481ca0)&&!_0x26d49e){if(_0x417436['countbusyretry']+_0x417436['countcongestionretry']+_0x417436[_0xbf15('0x11d')]+_0x417436['countnosuchnumberretry']+_0x417436['countdropretry']+_0x417436[_0xbf15('0xec')]+_0x417436['countmachineretry']+_0x417436[_0xbf15('0x18a')]>=_0x481ca0['dialGlobalMaxRetry']){_0x439981[_0xbf15('0x11f')](_0x417436,_0x59b003,_0x310777,_0x8af4c3[_0xbf15('0xc2')]);}else{_0x439981[_0xbf15('0x123')](_0x417436,_0x59b003,_0x310777,_0x8af4c3[_0xbf15('0xc2')]);}}}})[_0xbf15('0x3e')](function(){if(_0x26d49e){hopperUtils[_0xbf15('0xf0')](_0x417436,_0x490c15,_0x53c504)['then'](function(){return _0x59b003(0x1);});}});});};Dialer[_0xbf15('0x1a')]['stateGlobal']=function(_0x451050,_0x3ec474,_0x9220b4,_0xc8350d){var _0x4a59d7=new Final(_0x451050);_0x4a59d7['state']=0xf;_0x4a59d7[_0xbf15('0xd1')]='Global';this['createStateFinal'](_0x4a59d7,_0x3ec474,_0x9220b4,_0xc8350d);};Dialer['prototype'][_0xbf15('0x123')]=function(_0x5e0c8f,_0x1f2d36,_0x5adce9,_0x50ce0f){hopperUtils[_0xbf15('0x12c')](_0x5e0c8f)[_0xbf15('0x3e')](function(){return _0x1f2d36(msgResponse(_0xbf15('0x198'),_0xbf15('0x109'),_0x50ce0f));})['catch'](function(){return _0x5adce9(msgResponse(_0xbf15('0x1b5'),_0xbf15('0x93'),_0xbf15('0x1b6')));});};Dialer[_0xbf15('0x1a')][_0xbf15('0xb')]=function(_0x5e3c4){var _0x1b881c=_0x5e3c4[_0xbf15('0x1b7')]/0x64;var _0x39fe0b=_0x5e3c4[_0xbf15('0xcf')]/(_0x5e3c4['outboundDropCallsDayTimeout']+_0x5e3c4['outboundAnswerCallsDay']);var _0x2e19eb=Math[_0xbf15('0x1b8')](_0x5e3c4[_0xbf15('0x1b9')]*(_0x5e3c4[_0xbf15('0x1ba')]/0x64));var _0x48bdb2=Math[_0xbf15('0x1b8')](_0x5e3c4[_0xbf15('0x1b9')]*(_0x5e3c4[_0xbf15('0x1bb')]/0x64));var _0x850238=_0x5e3c4[_0xbf15('0x1bc')]+_0x5e3c4[_0xbf15('0x138')];var _0x538f09=Math['floor'](_0x5e3c4[_0xbf15('0x1bd')]*_0x5e3c4[_0xbf15('0x5e')]*_0x5e3c4[_0xbf15('0x1be')]*_0x5e3c4[_0xbf15('0x1bf')]);if(_[_0xbf15('0x40')](_0x5e3c4[_0xbf15('0x61')])){if(!_['isUndefined'](_0x5e3c4[_0xbf15('0x27')])){_0x5e3c4[_0xbf15('0x27')]=undefined;loggerPredictive[_0xbf15('0x67')](_0xbf15('0x1c0'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x5e3c4[_0xbf15('0x65')])){loggerPredictive[_0xbf15('0x67')](_0xbf15('0x1c0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5e3c4[_0xbf15('0x65')]);_0x5e3c4[_0xbf15('0x65')]=undefined;}_0x5e3c4['startProgressive']=moment()[_0xbf15('0x45')](_0xbf15('0xc7'));loggerPredictive['info'](_0x5e3c4[_0xbf15('0x62')],_0xbf15('0x1c1'),_0x5e3c4[_0xbf15('0x61')]);this['handlePower'](_0x5e3c4,0x1);}else if(ifInterval(_0x5e3c4[_0xbf15('0x1c2')],_0x5e3c4[_0xbf15('0x61')])){this[_0xbf15('0xb1')](_0x5e3c4,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x5e3c4[_0xbf15('0x61')],_0x5e3c4['name']);_0x5e3c4[_0xbf15('0x1bd')]=0x0;_0x5e3c4[_0xbf15('0xd0')]=0x0;}else if(_0x1b881c<_0x39fe0b&&_0x5e3c4[_0xbf15('0x1c3')]===_0xbf15('0x1c4')){clearPredictiveAttributes(_0x5e3c4);loggerPredictive[_0xbf15('0x48')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xbf15('0x1c5'),_0x39fe0b,_0xbf15('0x61'),_0x5e3c4[_0xbf15('0x62')]);}else if(_0x538f09<_0x5e3c4[_0xbf15('0xd0')]&&_0x5e3c4[_0xbf15('0x1c3')]===_0xbf15('0x1c4')){clearPredictiveAttributes(_0x5e3c4);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x1c6'),'Max\x20Drop\x20',_0x538f09,_0xbf15('0x1c7'),_0x5e3c4[_0xbf15('0xd0')],_0xbf15('0x61'),_0x5e3c4[_0xbf15('0x62')]);}else if(!ifInterval(_0x5e3c4['dialPredictiveInterval'],_0x5e3c4[_0xbf15('0x61')])&&_['isUndefined'](_0x5e3c4[_0xbf15('0x27')])&&!_[_0xbf15('0x40')](_0x5e3c4[_0xbf15('0x61')])){_0x5e3c4[_0xbf15('0x27')]=moment()[_0xbf15('0x45')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbf15('0x48')](_0x5e3c4[_0xbf15('0x62')],'started\x20in\x20predictive\x20at',_0x5e3c4[_0xbf15('0x27')]);hopperUtils[_0xbf15('0x1c8')](_0x5e3c4['dialPredictiveInterval'])[_0xbf15('0x3e')](this[_0xbf15('0x1c9')](_0x5e3c4))[_0xbf15('0x3e')](mergeDataErlangB(_0x5e3c4))['then'](this[_0xbf15('0x1ca')](_0x5e3c4))[_0xbf15('0x9d')](loggerCatchPredictive(_0xbf15('0x1cb'),_0x5e3c4));}else if(!ifInterval(_0x5e3c4[_0xbf15('0x1c2')],_0x5e3c4[_0xbf15('0x27')])){_0x5e3c4[_0xbf15('0xd0')]=0x0;_0x5e3c4['startPredictive']=moment()[_0xbf15('0x45')](_0xbf15('0xc7'));loggerPredictive['info'](_0x5e3c4[_0xbf15('0x62')],_0xbf15('0x1cc'),_0x5e3c4['startPredictive']);clearInterval(_0x5e3c4[_0xbf15('0x65')]);_0x5e3c4['handlePredictive']=undefined;hopperUtils[_0xbf15('0x1c8')](_0x5e3c4[_0xbf15('0x1c2')])[_0xbf15('0x3e')](this['getDataPredictive'](_0x5e3c4))[_0xbf15('0x3e')](mergeDataErlangB(_0x5e3c4))['then'](this['startMethodPredictive'](_0x5e3c4))[_0xbf15('0x9d')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5e3c4));}else if(_0x5e3c4[_0xbf15('0x1b9')]&&_0x850238<_0x5e3c4[_0xbf15('0x1b9')]-_0x48bdb2){clearPredictiveAttributes(_0x5e3c4);loggerPredictive[_0xbf15('0x48')](_0x5e3c4[_0xbf15('0x62')],_0xbf15('0x1cd'),_0x850238,')\x20are\x20less\x20than\x20threshold\x20(',_0x5e3c4[_0xbf15('0x1b9')],'-',_0x48bdb2,'=',_0x5e3c4[_0xbf15('0x1b9')]-_0x48bdb2,')');}else if(_0x5e3c4[_0xbf15('0x1b9')]&&_0x850238>_0x5e3c4['predictiveIntervalAvailable']+_0x2e19eb){clearPredictiveAttributes(_0x5e3c4);loggerPredictive['info'](_0x5e3c4[_0xbf15('0x62')],_0xbf15('0x1cd'),_0x850238,_0xbf15('0x1ce'),_0x5e3c4[_0xbf15('0x1b9')],'+',_0x2e19eb,'=',_0x5e3c4[_0xbf15('0x1b9')]+_0x2e19eb,')');}};Dialer[_0xbf15('0x1a')]['getDataPredictive']=function(_0x42132d){var _0x2b0988=this;return function(_0x27b571){return new Promise(function(_0x6f0c80,_0xe5f9b5){_[_0xbf15('0xfb')](_0x42132d,_0x27b571[0x0]);if(checkGetDataPredictive(_0x27b571[0x0])){var _0x445ce7=_0x42132d['predictiveIntervalAvailable']=_0x42132d['talking']+_0x42132d['available'];var _0x3e28b8=_0x42132d['dialPredictiveInterval']*0x3c;var _0x2e46b0=_0x27b571[0x0][_0xbf15('0x53')]+_0x27b571[0x0][_0xbf15('0x51')];var _0xaafafd=(_0x27b571[0x0][_0xbf15('0x4c')]+_0x27b571[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x27b571[0x0][_0xbf15('0x4f')])/_0x27b571[0x0][_0xbf15('0x4b')];_0x42132d[_0xbf15('0x1be')]=_0xaafafd>0x0?_0xaafafd:0x1;switch(_0x42132d[_0xbf15('0x1c3')]){case _0xbf15('0x1c4'):var _0x5f4aa4=_0x42132d['dialPredictiveOptimizationPercentage']/0x64;return _0x2b0988['abandonmentRate'](_0x445ce7,_0x3e28b8,_0x2e46b0,_0xaafafd,_0x5f4aa4)[_0xbf15('0x3e')](function(_0x5674e0){return _0x6f0c80(_0x5674e0);});case _0xbf15('0x1cf'):var _0x3a6e85=_0x42132d[_0xbf15('0x1b7')]/0x64;return _0x2b0988[_0xbf15('0x1d0')](_0x445ce7,_0x3e28b8,_0x2e46b0,_0xaafafd,_0x3a6e85)[_0xbf15('0x3e')](function(_0x5d1100){return _0x6f0c80(_0x5d1100);});default:return _0xe5f9b5(msgResponse('[getDataPredictive]','Failure',_0xbf15('0x1d1')));}}else{return _0xe5f9b5(msgResponse(_0xbf15('0x1d2'),_0xbf15('0x93'),_0xbf15('0x1d3')));}});};};Dialer[_0xbf15('0x1a')]['getDataPredictiveOld']=function(_0x23b9a5){var _0x1aed9d=this;return function(_0x340616){return new Promise(function(_0x44aaff,_0x281c02){_['merge'](_0x23b9a5,_0x340616[0x0]);if(checkGetDataPredictive(_0x340616[0x0])){loggerPredictive[_0xbf15('0x48')](JSON[_0xbf15('0x77')](_0x340616[0x0]));if(_0x23b9a5['dialPredictiveOptimization']==='dropRate'){return _0x1aed9d[_0xbf15('0x14b')](_0x23b9a5['id'])['then'](function(_0x209041){var _0x52b0cb=_0x23b9a5[_0xbf15('0x1d4')]-_0x209041[0x0][_0xbf15('0x1d5')];var _0x2ae053=_0x23b9a5[_0xbf15('0x1c2')]*0x3c;var _0x1604a9=_0x340616[0x0][_0xbf15('0x53')]+_0x340616[0x0]['predictiveIntervalAvgHoldtime'];var _0x4ac9aa=(_0x340616[0x0][_0xbf15('0x4c')]+_0x340616[0x0][_0xbf15('0x4d')]+_0x340616[0x0][_0xbf15('0x4f')])/_0x340616[0x0][_0xbf15('0x4b')];var _0x276459=_0x23b9a5[_0xbf15('0x1b7')]/0x64;_0x23b9a5[_0xbf15('0x1d6')]=_0x209041[0x0]['outboundQueuePauses']||0x0;_0x23b9a5['predictiveIntervalHitRate']=_0x4ac9aa>0x0?_0x4ac9aa:0x1;return _0x1aed9d[_0xbf15('0x1d7')](_0x52b0cb,_0x2ae053,_0x1604a9,_0x4ac9aa,_0x276459);})[_0xbf15('0x3e')](function(_0x487e15){return _0x44aaff(_0x487e15);})[_0xbf15('0x9d')](function(_0x2919e5){return _0x281c02(msgResponse(_0xbf15('0x1d8'),_0xbf15('0x93'),JSON[_0xbf15('0x77')](_0x2919e5)));});}if(_0x23b9a5[_0xbf15('0x1c3')]==='agentBusyFactor'){return _0x1aed9d[_0xbf15('0x14b')](_0x23b9a5['id'])[_0xbf15('0x3e')](function(_0x2f22b7){var _0x44b54a=_0x23b9a5[_0xbf15('0x1d4')]-_0x2f22b7[0x0][_0xbf15('0x1d5')];var _0x156882=_0x23b9a5[_0xbf15('0x1c2')]*0x3c;var _0x1ac894=_0x340616[0x0]['predictiveIntervalAvgTalktime']+_0x340616[0x0]['predictiveIntervalAvgHoldtime'];var _0x8534c9=(_0x340616[0x0]['predictiveIntervalAnsweredCalls']+_0x340616[0x0][_0xbf15('0x4d')]+_0x340616[0x0][_0xbf15('0x4f')])/_0x340616[0x0][_0xbf15('0x4b')];var _0xf30f62=_0x23b9a5['dialPredictiveOptimizationPercentage']/0x64;_0x23b9a5[_0xbf15('0x1d6')]=_0x2f22b7[0x0][_0xbf15('0x1d5')]||0x0;_0x23b9a5[_0xbf15('0x1be')]=_0x8534c9>0x0?_0x8534c9:0x1;return _0x1aed9d['busyFactor'](_0x44b54a,_0x156882,_0x1ac894,_0x8534c9,_0xf30f62);})[_0xbf15('0x3e')](function(_0x47650d){return _0x44aaff(_0x47650d);})[_0xbf15('0x9d')](function(_0x5e6a5e){return _0x281c02(msgResponse(_0xbf15('0x1d8'),'Failure',JSON['stringify'](_0x5e6a5e)));});}}else{return _0x281c02(msgResponse(_0xbf15('0x1d2'),_0xbf15('0x93'),'check\x20failure'));}});};};Dialer['prototype'][_0xbf15('0x1ca')]=function(_0x3763e1){var _0x23783e=this;return function(){var _0x62e0b4=0x0;var _0x316b7d=Math[_0xbf15('0x1d9')](_0x3763e1[_0xbf15('0x5a')]*0x3e8);if(_0x316b7d>0x0){_0x316b7d=_0x316b7d<0x64?0x64:_0x316b7d;loggerPredictive['info'](_0x3763e1[_0xbf15('0x62')],_0xbf15('0x1da'),_0x316b7d,'milliseconds');_0x3763e1[_0xbf15('0x65')]=setInterval(function(){_0x23783e[_0xbf15('0x65')](_0x3763e1);loggerPredictiveCalls[_0xbf15('0x48')]('[handlePredictive]',_0x62e0b4+=0x1);},_0x316b7d);}else{loggerPredictive[_0xbf15('0x48')](_0x3763e1[_0xbf15('0x62')],_0xbf15('0x1db'));}};};Dialer[_0xbf15('0x1a')][_0xbf15('0x1dc')]=function(_0x4291e4,_0x535515){var _0x59f1e0=this;return function(_0x4101fc){if(_[_0xbf15('0x47')](_0x4101fc)){if(_[_0xbf15('0xf7')](_0x535515[_0xbf15('0x151')])||!_0x535515[_0xbf15('0x1dd')]){if(_0x4291e4[_0xbf15('0xaf')]===_0xbf15('0xa')){_0x4291e4[_0xbf15('0x75')]=_[_0xbf15('0x40')](_0x4291e4[_0xbf15('0x75')])?!![]:_0x4291e4[_0xbf15('0x75')];var _0x595139=uuid['v4']();_0x59f1e0[_0xbf15('0x23')][_0x595139]=new Action(_0x4291e4,_0x535515,_0x595139);loggerBooked[_0xbf15('0x48')]('[booked][checkContactBlack]',_0x595139,_0xbf15('0x1de'),JSON[_0xbf15('0x77')](_0x4291e4[_0xbf15('0x75')]),_0xbf15('0x1df'),_0x4291e4[_0xbf15('0x62')]);if(_0x4291e4[_0xbf15('0x75')]){_0x4291e4[_0xbf15('0x75')]=![];_0x59f1e0[_0xbf15('0x29')][_0x59f1e0[_0xbf15('0x23')][_0x595139][_0xbf15('0xc0')]]=[];ami['Action']({'actionid':_0x595139,'action':_0xbf15('0x1e0'),'queue':_0x4291e4[_0xbf15('0x62')]})[_0xbf15('0x9d')](function(){_0x59f1e0[_0xbf15('0xbf')](_0x4291e4);hopperUtils[_0xbf15('0xdd')]({'active':![],'ContactId':_0x59f1e0[_0xbf15('0x23')][_0x595139]['ContactId'],'ListId':_0x59f1e0['actions'][_0x595139][_0xbf15('0xe1')],'VoiceQueueId':_0x59f1e0[_0xbf15('0x23')][_0x595139][_0xbf15('0xe2')]||undefined,'CampaignId':_0x59f1e0['actions'][_0x595139][_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x1e1')));delete _0x59f1e0['actions'][_0x595139];});}else{loggerBooked[_0xbf15('0x48')](_0xbf15('0x1e2'),JSON[_0xbf15('0x77')](_0x4291e4[_0xbf15('0x75')]),_0xbf15('0x1df'),_0x4291e4[_0xbf15('0x62')]);_0x59f1e0[_0xbf15('0xbf')](_0x4291e4);hopperUtils[_0xbf15('0xdd')]({'active':![],'ContactId':_0x59f1e0[_0xbf15('0x23')][_0x595139][_0xbf15('0xe0')],'ListId':_0x59f1e0[_0xbf15('0x23')][_0x595139]['ListId'],'VoiceQueueId':_0x59f1e0['actions'][_0x595139][_0xbf15('0xe2')]||undefined,'CampaignId':_0x59f1e0[_0xbf15('0x23')][_0x595139][_0xbf15('0xee')]||undefined})[_0xbf15('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x59f1e0['actions'][_0x595139];}}else{return _0x59f1e0[_0xbf15('0x156')](_0x4291e4,_0x535515);}}else{if(utils[_0xbf15('0x60')](undefined,_0x535515[_0xbf15('0x1e3')])<_0x4291e4[_0xbf15('0x1e4')]*0x3c){if(_0x535515[_0xbf15('0x144')]&&!_0x535515[_0xbf15('0x144')][_0xbf15('0x1e5')]){_0x59f1e0['preview'][_0xbf15('0xfe')](_0x535515['id'])['finally'](function(){_0x59f1e0[_0xbf15('0xbf')](_0x4291e4);});}else{hopperUtils['unlockContact']({'active':![]},_0x535515['id'],0x1)[_0xbf15('0x1d')](function(){_0x59f1e0[_0xbf15('0xbf')](_0x4291e4);});}}else{_0x4291e4['outboundReCallsDay']+=0x1;_0x59f1e0[_0xbf15('0xbf')](_0x4291e4);if(_0x4291e4[_0xbf15('0x1e6')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x535515['ContactId'],'ListId':_0x535515['ListId'],'VoiceQueueId':_0x535515[_0xbf15('0xe2')]||undefined,'CampaignId':_0x535515[_0xbf15('0xee')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xbf15('0xc8')](createObjHistory(_0x4291e4,_0x535515,utils[_0xbf15('0x6c')][_0xbf15('0x1e7')],0x17,_0xbf15('0x1e8')))['catch'](loggerCatch(_0xbf15('0x1e9')));}else{_0x59f1e0['saveInDb'](createObjHistory(_0x4291e4,_0x535515,utils[_0xbf15('0x6c')][_0xbf15('0x1ea')],0x16,'RecallFailedTimeout'),_0xbf15('0x1eb'),'[Originate][HistoryRecallClose]');}}}}else{_0x4291e4[_0xbf15('0x1ec')]+=0x1;_0x59f1e0[_0xbf15('0x150')](createObjHistory(_0x4291e4,_0x535515,utils[_0xbf15('0x6c')][_0xbf15('0x1ed')],0xd,_0xbf15('0x1ee')),'[Originate][historyBlacklist]',_0xbf15('0x1ef'));throw _0xbf15('0x1f0');}};};Dialer['prototype'][_0xbf15('0x1f1')]=function(_0x126dfb){var _0x5eeb6d=this;var _0x234990=_0x126dfb[_0xbf15('0x1f2')]-_0x126dfb[_0xbf15('0x7f')];emitCampaignSummary(_0x126dfb);if(_0x234990>0x0&&_0x126dfb[_0xbf15('0x6a')]==0x0){if(_0x234990>this[_0xbf15('0x1f3')]){_0x234990=this[_0xbf15('0x1f3')];}_0x126dfb[_0xbf15('0x6a')]=0x1;hopperUtils['getContactDialerIvr'](_0x126dfb,_0x234990)['then'](function(_0x33bce0){_0x126dfb[_0xbf15('0x6a')]=0x0;if(_0x33bce0){if(!utils[_0xbf15('0x1f4')](_0x33bce0)){_0x126dfb[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x71')];logger[_0xbf15('0x48')](_0xbf15('0x1f5')+_0x126dfb['name']);}else{_0x126dfb[_0xbf15('0x7f')]+=_0x33bce0['length'];_0x126dfb[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x1f6')];for(var _0x5dde1e=0x0;_0x5dde1e<_0x33bce0['length'];_0x5dde1e+=0x1){_0x126dfb['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x33bce0[_0x5dde1e])||_[_0xbf15('0xf7')](_0x33bce0[_0x5dde1e]['Contact'])||_['isNil'](_0x33bce0[_0x5dde1e][_0xbf15('0x15a')])){_0x5eeb6d[_0xbf15('0x14e')](_0xbf15('0x1f7'),_0x126dfb,_0x33bce0[_0x5dde1e]);}else{hopperUtils[_0xbf15('0x1f8')](_[_0xbf15('0x78')](_0x33bce0[_0x5dde1e],[_0xbf15('0xee'),_0xbf15('0x15a')]))[_0xbf15('0x3e')](_0x5eeb6d[_0xbf15('0x1dc')](_0x126dfb,_0x33bce0[_0x5dde1e]))[_0xbf15('0x9d')](_0x5eeb6d[_0xbf15('0x1f9')](_0xbf15('0x1fa'),_0x126dfb));}}}}})[_0xbf15('0x9d')](loggerGetContactDialer('[getContactCampaign2]',_0x126dfb,_0x234990));}};Dialer[_0xbf15('0x1a')][_0xbf15('0xb1')]=function(_0x25c05c,_0xdc6d38){var _0x248482=this;var _0x1644b5=[];if(_0xdc6d38<0x1||_0x25c05c['dialMethod']===_0xbf15('0xa')){_0xdc6d38=0x1;}var _0x26bbce=Math[_0xbf15('0x1d9')](_0x25c05c[_0xbf15('0x1bc')]*_0xdc6d38)-_0x25c05c['originated'];if(_0x25c05c[_0xbf15('0x1fb')]>0x0){var _0x2ca917=_0x25c05c[_0xbf15('0x1fb')]-_0x25c05c['originated']-_0x25c05c['talking']-_0x25c05c['pTalking'];if(_0x26bbce>_0x2ca917){_0x26bbce=_0x2ca917;}}if(_0x26bbce>0x0&&_0x25c05c[_0xbf15('0x6a')]==0x0){if(_0x25c05c[_0xbf15('0xaf')]===_0xbf15('0xa')){_0x26bbce=0x1;}if(_0x26bbce>this['maxNumberOriginate']){_0x26bbce=this['maxNumberOriginate'];}for(var _0x4a00e9 in this[_0xbf15('0xfa')]){if(typeof this[_0xbf15('0xfa')][_0x4a00e9]!==_0xbf15('0x1fc')){if(this[_0xbf15('0xfa')][_0x4a00e9]['state']===_0xbf15('0x1fd')&&this[_0xbf15('0xfa')][_0x4a00e9][_0xbf15('0x87')]===_0xbf15('0x88')){_0x1644b5[_0xbf15('0x9e')](this[_0xbf15('0xfa')][_0x4a00e9]['id']);}}}_0x25c05c['temp']=0x1;hopperUtils[_0xbf15('0x1fe')](_0x25c05c,_0x1644b5,_0x26bbce)[_0xbf15('0x3e')](function(_0x4226d2){_0x25c05c[_0xbf15('0x6a')]=0x0;if(_0x4226d2){if(!utils[_0xbf15('0x1f4')](_0x4226d2)){hopperUtils['countReScheduled'](_0x25c05c)[_0xbf15('0x3e')](sendMessageReschedule(_0x25c05c))[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x1ff')));}else{_0x25c05c[_0xbf15('0x7f')]+=_0x4226d2[_0xbf15('0x97')];_0x25c05c['message']=_0x25c05c[_0xbf15('0xaf')]===_0xbf15('0xa')?utils[_0xbf15('0x6c')][_0xbf15('0x13a')]:utils['CAMPAIGN_STATUS'][_0xbf15('0x1f6')];for(var _0x43d712=0x0;_0x43d712<_0x4226d2[_0xbf15('0x97')];_0x43d712+=0x1){if(_['isNil'](_0x4226d2[_0x43d712])||_[_0xbf15('0xf7')](_0x4226d2[_0x43d712][_0xbf15('0x200')])||_[_0xbf15('0xf7')](_0x4226d2[_0x43d712][_0xbf15('0x15a')])){_0x248482['emptyContact'](_0xbf15('0x1f7'),_0x25c05c,_0x4226d2[_0x43d712]);}else{hopperUtils[_0xbf15('0x201')](_[_0xbf15('0x78')](_0x4226d2[_0x43d712],[_0xbf15('0xe2'),_0xbf15('0x15a')]))[_0xbf15('0x3e')](_0x248482[_0xbf15('0x1dc')](_0x25c05c,_0x4226d2[_0x43d712]))[_0xbf15('0x9d')](_0x248482['loggerHandler'](_0xbf15('0x1f7'),_0x25c05c));}}}}})['catch'](loggerGetContactDialer(_0xbf15('0x202'),_0x25c05c,_0x26bbce));}};Dialer[_0xbf15('0x1a')]['handlePredictive']=function(_0x3b73f5){if(_0x3b73f5[_0xbf15('0x1fb')]>0x0){var _0x46a0f5=_0x3b73f5[_0xbf15('0x1fb')]-_0x3b73f5['originated']-_0x3b73f5[_0xbf15('0x138')];if(_0x46a0f5>0x0&&_0x3b73f5['temp']==0x0){this[_0xbf15('0x203')](_0x3b73f5);}else{loggerPredictiveCalls['info'](_0xbf15('0x204'));}}else{this['tryOriginatePredictive'](_0x3b73f5);}};Dialer[_0xbf15('0x1a')][_0xbf15('0x203')]=function(_0x128674){var _0x11d8d1=this;var _0x3126e7=[];_0x128674[_0xbf15('0x7f')]+=0x1;for(var _0x57f8ac in this['agents']){if(typeof this['agents'][_0x57f8ac]!==_0xbf15('0x1fc')){if(this[_0xbf15('0xfa')][_0x57f8ac][_0xbf15('0x73')]===_0xbf15('0x1fd')&&this['agents'][_0x57f8ac]['status']===_0xbf15('0x88')){_0x3126e7['push'](this[_0xbf15('0xfa')][_0x57f8ac]['id']);}}}_0x128674[_0xbf15('0x6a')]=0x1;return this['getContactDialer'](_0x128674['id'],_0x3126e7,0x1,_0x128674[_0xbf15('0x205')],_0x128674)[_0xbf15('0x3e')](function(_0x48bfa3){_0x128674[_0xbf15('0x6a')]=0x1;if(_0x48bfa3){if(!utils['checkContactEmpty'](_0x48bfa3)){utils[_0xbf15('0x69')](_0x128674,0x1,0x0);return hopperUtils[_0xbf15('0x206')](_0x128674)[_0xbf15('0x3e')](sendMessageReschedule(_0x128674))[_0xbf15('0x9d')](loggerCatch(_0xbf15('0x1ff')));}else{_0x128674[_0xbf15('0x70')]=utils[_0xbf15('0x6c')][_0xbf15('0x1f6')];if(_[_0xbf15('0xf7')](_0x48bfa3[0x0])||_[_0xbf15('0xf7')](_0x48bfa3[0x0]['Contact'])||_[_0xbf15('0xf7')](_0x48bfa3[0x0][_0xbf15('0x15a')])){_0x11d8d1['emptyContact'](_0xbf15('0x1f7'),_0x128674,_0x48bfa3[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x48bfa3[0x0],[_0xbf15('0xe2'),_0xbf15('0x15a')]))[_0xbf15('0x3e')](_0x11d8d1[_0xbf15('0x1dc')](_0x128674,_0x48bfa3[0x0]))[_0xbf15('0x9d')](_0x11d8d1[_0xbf15('0x1f9')](_0xbf15('0x207'),_0x128674));}}}})[_0xbf15('0x9d')](loggerGetContactDialer(_0xbf15('0x208'),_0x128674,0x1));};Dialer['prototype'][_0xbf15('0x1d7')]=function(_0xb1eda,_0x24203c,_0x10f708,_0x25054c,_0x5e86e3,_0x1ce2b0){loggerPredictive[_0xbf15('0x48')](_0xbf15('0x209'));loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20a'),_0xb1eda);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20b'),_0x24203c);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20c'),_0x10f708);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20d'),_0x25054c);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20e'),_0x5e86e3);loggerPredictive['info']('---------------------------');return new Promise(function(_0x275448,_0x1fcafe){if(_0xb1eda<=0x0||isNaN(_0xb1eda)){return _0x1fcafe(msgResponse(_0xbf15('0x20f'),_0xbf15('0x85'),_0xbf15('0x210')+_0xb1eda));}if(_0x10f708<=0x0||isNaN(_0x10f708)){return _0x1fcafe(msgResponse(_0xbf15('0x20f'),'Error',_0xbf15('0x211')+_0x10f708));}if(_0x25054c<=0x0||isNaN(_0x25054c)){return _0x1fcafe(msgResponse(_0xbf15('0x20f'),_0xbf15('0x85'),_0xbf15('0x212')+_0x25054c));}if(_0x24203c<=0x0||isNaN(_0x24203c)){return _0x1fcafe(msgResponse(_0xbf15('0x20f'),_0xbf15('0x85'),_0xbf15('0x213')+_0x24203c));}if(_0x5e86e3<=0x0||isNaN(_0x5e86e3)){return _0x1fcafe(msgResponse(_0xbf15('0x20f'),_0xbf15('0x85'),_0xbf15('0x214')+_0x5e86e3));}_0x1ce2b0=_0x1ce2b0||0x0;var _0x524dd8=0x1/_0x10f708;var _0x59e64f=0x0;var _0x34cc39=0x0;var _0x490864=0x0;var _0x385e6e=0x0;for(var _0x279385=0x0;_0x490864<_0x5e86e3;_0x279385+=0x1){_0x34cc39=_0x279385/_0x24203c;_0x59e64f=(_0x25054c*_0x34cc39+_0x1ce2b0)/_0x524dd8;_0x490864=utils[_0xbf15('0x215')](_0x59e64f,_0xb1eda);_0x385e6e=_0x59e64f/_0xb1eda*(0x1-utils[_0xbf15('0x215')](_0x59e64f,_0xb1eda));}return _0x275448({'erlangCalls':_0x279385,'erlangCallToSecond':_0x24203c/_0x279385,'erlangAbandonmentRate':_0x490864,'erlangBusyFactor':_0x385e6e});});};Dialer['prototype'][_0xbf15('0x1d0')]=function(_0x13ca69,_0x12c8c7,_0x213d6c,_0x43e946,_0x5c7c3d,_0x1e70aa){loggerPredictive[_0xbf15('0x48')](_0xbf15('0x216'));loggerPredictive['info']('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',_0x13ca69);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20b'),_0x12c8c7);loggerPredictive['info'](_0xbf15('0x20c'),_0x213d6c);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x20d'),_0x43e946);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x217'),_0x5c7c3d);loggerPredictive[_0xbf15('0x48')](_0xbf15('0x5f'));return new Promise(function(_0x4c2760,_0x2c0b0d){if(_0x13ca69<=0x0||isNaN(_0x13ca69)){return _0x2c0b0d(msgResponse('[busyFactor]',_0xbf15('0x85'),_0xbf15('0x210')+_0x13ca69));}if(_0x213d6c<=0x0||isNaN(_0x213d6c)){return _0x2c0b0d(msgResponse(_0xbf15('0x218'),_0xbf15('0x85'),_0xbf15('0x211')+_0x213d6c));}if(_0x43e946<=0x0||isNaN(_0x43e946)){return _0x2c0b0d(msgResponse('[busyFactor]',_0xbf15('0x85'),_0xbf15('0x212')+_0x43e946));}if(_0x12c8c7<=0x0||isNaN(_0x12c8c7)){return _0x2c0b0d(msgResponse(_0xbf15('0x218'),'Error',_0xbf15('0x213')+_0x12c8c7));}if(_0x5c7c3d<=0x0||isNaN(_0x5c7c3d)){return _0x2c0b0d(msgResponse('[busyFactor]','Error',_0xbf15('0x219')+_0x5c7c3d));}_0x1e70aa=_0x1e70aa||0x0;var _0x42be92=0x1/_0x213d6c;var _0x357795=0x0;var _0x3bec63=0x0;var _0x5b99fc=0x0;var _0xe3d94a=0x0;for(var _0xc7d1e=0x0;_0xe3d94a<_0x5c7c3d;_0xc7d1e+=0x1){_0x3bec63=_0xc7d1e/_0x12c8c7;_0x357795=(_0x43e946*_0x3bec63+_0x1e70aa)/_0x42be92;_0x5b99fc=utils['erlangb'](_0x357795,_0x13ca69);_0xe3d94a=_0x357795/_0x13ca69*(0x1-utils[_0xbf15('0x215')](_0x357795,_0x13ca69));}return _0x4c2760({'erlangCalls':_0xc7d1e,'erlangCallToSecond':_0x12c8c7/_0xc7d1e,'erlangAbandonmentRate':_0x5b99fc,'erlangBusyFactor':_0xe3d94a});});};module[_0xbf15('0x21a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index c7688c3..c0e0fa5 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f79=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','substring','dialCutDigit','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f79,0x15b));var _0x97f7=function(_0x5a7c0a,_0x5ef3b4){_0x5a7c0a=_0x5a7c0a-0x0;var _0x3066a4=_0x7f79[_0x5a7c0a];return _0x3066a4;};'use strict';var util=require(_0x97f7('0x0'));var _=require(_0x97f7('0x1'));var moment=require(_0x97f7('0x2'));function checkNameSurname(_0x4fd999,_0x286d72,_0x124720){var _0xa373f9='';if(!_[_0x97f7('0x3')](_0x286d72)&&'string'===typeof _0x286d72){_0xa373f9+=_0x286d72;}if(!_['isNil'](_0x124720)&&_0x97f7('0x4')===typeof _0x124720){_0xa373f9+='\x20'+_0x124720;}if(_0xa373f9!==''){return _0xa373f9;}return _0x4fd999;}function Action(_0x1e106a,_0x1a2da9,_0x58330d){this[_0x97f7('0x5')]=_0x1e106a;this[_0x97f7('0x6')]=_0x58330d||undefined;this[_0x97f7('0x7')]=checkNameSurname(_0x1a2da9[_0x97f7('0x8')][_0x97f7('0x9')],_0x1a2da9['Contact'][_0x97f7('0xa')],_0x1a2da9[_0x97f7('0x8')][_0x97f7('0xb')]);this[_0x97f7('0xc')]=_0x1a2da9[_0x97f7('0x9')];this[_0x97f7('0xd')]=_0x1e106a['name'];this['active']=_0x1a2da9[_0x97f7('0xe')]||![];this[_0x97f7('0xf')]=_0x1e106a['type'];this['dialQueueTimeout']=_0x1e106a[_0x97f7('0x10')]||0x3;this[_0x97f7('0x11')]=_0x1a2da9[_0x97f7('0x11')];this[_0x97f7('0x12')]=_0x1a2da9['countbusyretry'];this[_0x97f7('0x13')]=_0x1a2da9['countcongestionretry'];this[_0x97f7('0x14')]=_0x1a2da9['countnoanswerretry'];this[_0x97f7('0x15')]=_0x1a2da9[_0x97f7('0x15')];this['countdropretry']=_0x1a2da9[_0x97f7('0x16')];this[_0x97f7('0x17')]=_0x1a2da9[_0x97f7('0x17')];this[_0x97f7('0x18')]=_0x1a2da9[_0x97f7('0x18')];this['countagentrejectretry']=_0x1a2da9['countagentrejectretry'];this['ContactId']=_0x1a2da9['ContactId'];this['ListId']=_0x1a2da9[_0x97f7('0x19')];this[_0x97f7('0x1a')]=_0x1a2da9['UserId'];this['VoiceQueueId']=_0x1a2da9[_0x97f7('0x1b')];this[_0x97f7('0x1c')]=_0x1a2da9[_0x97f7('0x1c')];this[_0x97f7('0x1d')]=_0x1a2da9['id'];this[_0x97f7('0x1e')]=_0x1a2da9['Contact']['firstName']||'';this[_0x97f7('0x1f')]=moment()[_0x97f7('0x20')](_0x97f7('0x21'));this['callback']=_0x1a2da9[_0x97f7('0x22')];this[_0x97f7('0x23')]=_0x1a2da9[_0x97f7('0x23')];this[_0x97f7('0x24')]=_0x1a2da9[_0x97f7('0x24')];this[_0x97f7('0x25')]=_0x1a2da9[_0x97f7('0x25')];this[_0x97f7('0x26')]='';this[_0x97f7('0x27')]='';}Action['prototype']['getCaller']=function(){return util[_0x97f7('0x20')](_0x97f7('0x28'),this[_0x97f7('0x7')],this[_0x97f7('0x5')]['dialCutDigit']>0x0?this['number'][_0x97f7('0x29')](this[_0x97f7('0x5')][_0x97f7('0x2a')]):this[_0x97f7('0xc')]);};Action[_0x97f7('0x2b')][_0x97f7('0x2c')]=function(){return this[_0x97f7('0xd')];};module[_0x97f7('0x2d')]=Action; \ No newline at end of file +var _0x10b9=['exports','util','lodash','isNil','uniqueid','name','phone','firstName','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','callback','callbackuniqueid','callbackat','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring'];(function(_0x4fbf33,_0x318fbc){var _0x1997d2=function(_0xe41ffc){while(--_0xe41ffc){_0x4fbf33['push'](_0x4fbf33['shift']());}};_0x1997d2(++_0x318fbc);}(_0x10b9,0xc4));var _0x910b=function(_0x7dee36,_0x2dd3f0){_0x7dee36=_0x7dee36-0x0;var _0x2d6ce3=_0x10b9[_0x7dee36];return _0x2d6ce3;};'use strict';var util=require(_0x910b('0x0'));var _=require(_0x910b('0x1'));var moment=require('moment');function checkNameSurname(_0x39a19f,_0xe3b100,_0x2b1681){var _0x52a62e='';if(!_['isNil'](_0xe3b100)&&'string'===typeof _0xe3b100){_0x52a62e+=_0xe3b100;}if(!_[_0x910b('0x2')](_0x2b1681)&&'string'===typeof _0x2b1681){_0x52a62e+='\x20'+_0x2b1681;}if(_0x52a62e!==''){return _0x52a62e;}return _0x39a19f;}function Action(_0x6d365b,_0x2a4454,_0xcb6ed8){this['voiceQueue']=_0x6d365b;this[_0x910b('0x3')]=_0xcb6ed8||undefined;this[_0x910b('0x4')]=checkNameSurname(_0x2a4454['Contact'][_0x910b('0x5')],_0x2a4454['Contact'][_0x910b('0x6')],_0x2a4454[_0x910b('0x7')][_0x910b('0x8')]);this[_0x910b('0x9')]=_0x2a4454[_0x910b('0x5')];this[_0x910b('0xa')]=_0x6d365b[_0x910b('0x4')];this[_0x910b('0xb')]=_0x2a4454[_0x910b('0xb')]||![];this[_0x910b('0xc')]=_0x6d365b[_0x910b('0xc')];this[_0x910b('0xd')]=_0x6d365b[_0x910b('0xd')]||0x3;this['scheduledat']=_0x2a4454[_0x910b('0xe')];this[_0x910b('0xf')]=_0x2a4454[_0x910b('0xf')];this[_0x910b('0x10')]=_0x2a4454[_0x910b('0x10')];this['countnoanswerretry']=_0x2a4454['countnoanswerretry'];this[_0x910b('0x11')]=_0x2a4454[_0x910b('0x11')];this['countdropretry']=_0x2a4454[_0x910b('0x12')];this[_0x910b('0x13')]=_0x2a4454[_0x910b('0x13')];this[_0x910b('0x14')]=_0x2a4454[_0x910b('0x14')];this[_0x910b('0x15')]=_0x2a4454['countagentrejectretry'];this[_0x910b('0x16')]=_0x2a4454[_0x910b('0x16')];this['ListId']=_0x2a4454[_0x910b('0x17')];this[_0x910b('0x18')]=_0x2a4454['UserId'];this[_0x910b('0x19')]=_0x2a4454[_0x910b('0x19')];this[_0x910b('0x1a')]=_0x2a4454[_0x910b('0x1a')];this[_0x910b('0x1b')]=_0x2a4454['id'];this['ContactFirstName']=_0x2a4454[_0x910b('0x7')][_0x910b('0x6')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x910b('0x1c')]=_0x2a4454[_0x910b('0x1c')];this[_0x910b('0x1d')]=_0x2a4454[_0x910b('0x1d')];this[_0x910b('0x1e')]=_0x2a4454[_0x910b('0x1e')];this['recallme']=_0x2a4454['recallme'];this['originatecalleridnum']='';this[_0x910b('0x1f')]='';}Action[_0x910b('0x20')][_0x910b('0x21')]=function(){return util['format'](_0x910b('0x22'),this[_0x910b('0x4')],this[_0x910b('0x23')][_0x910b('0x24')]>0x0?this[_0x910b('0x9')][_0x910b('0x25')](this[_0x910b('0x23')][_0x910b('0x24')]):this['number']);};Action['prototype']['getQueue']=function(){return this[_0x910b('0xa')];};module[_0x910b('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index c584c8e..41f5c80 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7363=['state','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils'];(function(_0x2f6f15,_0x246a14){var _0x4cca06=function(_0x4db8f6){while(--_0x4db8f6){_0x2f6f15['push'](_0x2f6f15['shift']());}};_0x4cca06(++_0x246a14);}(_0x7363,0x146));var _0x3736=function(_0x331e6d,_0x100274){_0x331e6d=_0x331e6d-0x0;var _0x5b0021=_0x7363[_0x331e6d];return _0x5b0021;};'use strict';var moment=require(_0x3736('0x0'));var utils=require(_0x3736('0x1'));function AgentComplete(_0x538259,_0x1856ab){this[_0x3736('0x2')]=0x4;this['statedesc']=_0x3736('0x3');this[_0x3736('0x4')]=_0x538259[_0x3736('0x4')];this['type']=_0x538259[_0x3736('0x5')];this['campaigntype']=_0x538259[_0x3736('0x5')]==='outbound'?_0x3736('0x6'):_0x538259[_0x3736('0x5')];this[_0x3736('0x7')]=_0x538259[_0x3736('0x7')];this[_0x3736('0x8')]=_0x538259['countcongestionretry'];this[_0x3736('0x9')]=_0x538259[_0x3736('0x9')];this[_0x3736('0xa')]=_0x538259[_0x3736('0x7')]+_0x538259[_0x3736('0x8')]+_0x538259[_0x3736('0x9')]+_0x538259[_0x3736('0xb')]+_0x538259[_0x3736('0xc')]+_0x538259[_0x3736('0xd')]+_0x538259[_0x3736('0xe')]+_0x538259[_0x3736('0xf')];this[_0x3736('0xb')]=_0x538259[_0x3736('0xb')];this[_0x3736('0xc')]=_0x538259[_0x3736('0xc')];this[_0x3736('0xd')]=_0x538259[_0x3736('0xd')];this[_0x3736('0xe')]=_0x538259[_0x3736('0xe')];this[_0x3736('0xf')]=_0x538259[_0x3736('0xf')];this[_0x3736('0x10')]=_0x1856ab['uniqueid'];this[_0x3736('0x11')]=_0x538259[_0x3736('0x12')];this[_0x3736('0x13')]=_0x538259[_0x3736('0x14')];this['starttime']=_0x538259[_0x3736('0x15')];this[_0x3736('0x16')]=_0x538259[_0x3736('0x16')];this[_0x3736('0x17')]=_0x538259[_0x3736('0x17')];this['endtime']=moment()[_0x3736('0x18')](_0x3736('0x19'));this[_0x3736('0x1a')]=utils[_0x3736('0x1b')](_0x538259[_0x3736('0x16')],_0x538259[_0x3736('0x15')]);this['holdtime']=utils[_0x3736('0x1b')](_0x538259[_0x3736('0x17')],_0x538259['responsetime']);this['talktime']=utils['getSeconds'](this['endtime'],_0x538259[_0x3736('0x17')]);this['queue']=_0x1856ab[_0x3736('0x6')];this[_0x3736('0x1c')]=_0x1856ab[_0x3736('0x1c')];this[_0x3736('0x1d')]=_0x1856ab[_0x3736('0x1d')];this[_0x3736('0x1e')]=_0x538259[_0x3736('0x1e')];this[_0x3736('0x1f')]=_0x538259['callbackuniqueid'];this[_0x3736('0x20')]=_0x538259[_0x3736('0x20')];this['recallme']=_0x538259[_0x3736('0x21')];this[_0x3736('0x22')]=_0x538259[_0x3736('0x22')];this[_0x3736('0x23')]=_0x538259[_0x3736('0x23')];this[_0x3736('0x24')]=_0x538259[_0x3736('0x24')];this['VoiceQueueId']=_0x538259['VoiceQueueId'];this['CampaignId']=_0x538259[_0x3736('0x25')];this[_0x3736('0x26')]=_0x538259[_0x3736('0x26')]||'';this['originatecalleridname']=_0x538259[_0x3736('0x27')]||'';this[_0x3736('0x28')]=_0x538259[_0x3736('0x28')];}module['exports']=AgentComplete; \ No newline at end of file +var _0xe3f3=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','callback'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xe3f3,0xb8));var _0x3e3f=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe3f3[_0x11005e];return _0x29338f;};'use strict';var moment=require(_0x3e3f('0x0'));var utils=require(_0x3e3f('0x1'));function AgentComplete(_0x124d1a,_0x521c6b){this[_0x3e3f('0x2')]=0x4;this['statedesc']=_0x3e3f('0x3');this[_0x3e3f('0x4')]=_0x124d1a['scheduledat'];this[_0x3e3f('0x5')]=_0x124d1a['type'];this['campaigntype']=_0x124d1a[_0x3e3f('0x5')]===_0x3e3f('0x6')?_0x3e3f('0x7'):_0x124d1a[_0x3e3f('0x5')];this[_0x3e3f('0x8')]=_0x124d1a[_0x3e3f('0x8')];this[_0x3e3f('0x9')]=_0x124d1a[_0x3e3f('0x9')];this[_0x3e3f('0xa')]=_0x124d1a[_0x3e3f('0xa')];this[_0x3e3f('0xb')]=_0x124d1a[_0x3e3f('0x8')]+_0x124d1a[_0x3e3f('0x9')]+_0x124d1a[_0x3e3f('0xa')]+_0x124d1a['countnosuchnumberretry']+_0x124d1a[_0x3e3f('0xc')]+_0x124d1a[_0x3e3f('0xd')]+_0x124d1a['countmachineretry']+_0x124d1a[_0x3e3f('0xe')];this['countnosuchnumberretry']=_0x124d1a['countnosuchnumberretry'];this[_0x3e3f('0xc')]=_0x124d1a[_0x3e3f('0xc')];this['countabandonedretry']=_0x124d1a[_0x3e3f('0xd')];this[_0x3e3f('0xf')]=_0x124d1a[_0x3e3f('0xf')];this[_0x3e3f('0xe')]=_0x124d1a['countagentrejectretry'];this[_0x3e3f('0x10')]=_0x521c6b[_0x3e3f('0x10')];this[_0x3e3f('0x11')]=_0x124d1a[_0x3e3f('0x12')];this[_0x3e3f('0x13')]=_0x124d1a['number'];this['starttime']=_0x124d1a[_0x3e3f('0x14')];this['responsetime']=_0x124d1a[_0x3e3f('0x15')];this[_0x3e3f('0x16')]=_0x124d1a[_0x3e3f('0x16')];this[_0x3e3f('0x17')]=moment()[_0x3e3f('0x18')](_0x3e3f('0x19'));this['ringtime']=utils[_0x3e3f('0x1a')](_0x124d1a[_0x3e3f('0x15')],_0x124d1a[_0x3e3f('0x14')]);this[_0x3e3f('0x1b')]=utils['getSeconds'](_0x124d1a[_0x3e3f('0x16')],_0x124d1a['responsetime']);this[_0x3e3f('0x1c')]=utils[_0x3e3f('0x1a')](this['endtime'],_0x124d1a[_0x3e3f('0x16')]);this[_0x3e3f('0x7')]=_0x521c6b['queue'];this[_0x3e3f('0x1d')]=_0x521c6b['membername'];this['reason']=_0x521c6b['reason'];this[_0x3e3f('0x1e')]=_0x124d1a['callback'];this[_0x3e3f('0x1f')]=_0x124d1a[_0x3e3f('0x1f')];this['callbackat']=_0x124d1a[_0x3e3f('0x20')];this[_0x3e3f('0x21')]=_0x124d1a[_0x3e3f('0x21')];this[_0x3e3f('0x22')]=_0x124d1a[_0x3e3f('0x22')];this[_0x3e3f('0x23')]=_0x124d1a[_0x3e3f('0x23')];this[_0x3e3f('0x24')]=_0x124d1a[_0x3e3f('0x24')];this[_0x3e3f('0x25')]=_0x124d1a[_0x3e3f('0x25')];this['CampaignId']=_0x124d1a[_0x3e3f('0x26')];this[_0x3e3f('0x27')]=_0x124d1a[_0x3e3f('0x27')]||'';this[_0x3e3f('0x28')]=_0x124d1a[_0x3e3f('0x28')]||'';this[_0x3e3f('0x29')]=_0x124d1a[_0x3e3f('0x29')];}module[_0x3e3f('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 4e846d0..6b46550 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7855=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0x442812,_0x1448f5){var _0x5e312=function(_0x3cba31){while(--_0x3cba31){_0x442812['push'](_0x442812['shift']());}};_0x5e312(++_0x1448f5);}(_0x7855,0x1c7));var _0x5785=function(_0x4e422c,_0x23cace){_0x4e422c=_0x4e422c-0x0;var _0x54ebc9=_0x7855[_0x4e422c];return _0x54ebc9;};'use strict';function Final(_0x495e56){this[_0x5785('0x0')]=_0x495e56[_0x5785('0x0')];this[_0x5785('0x1')]=_0x495e56[_0x5785('0x1')];this['type']=_0x495e56[_0x5785('0x2')];this[_0x5785('0x3')]=_0x495e56[_0x5785('0x2')]===_0x5785('0x4')?'queue':_0x495e56[_0x5785('0x2')];this['countbusyretry']=_0x495e56[_0x5785('0x5')];this[_0x5785('0x6')]=_0x495e56[_0x5785('0x6')];this[_0x5785('0x7')]=_0x495e56['countnoanswerretry'];this['countglobal']=_0x495e56[_0x5785('0x5')]+_0x495e56['countcongestionretry']+_0x495e56[_0x5785('0x7')]+_0x495e56['countnosuchnumberretry']+_0x495e56[_0x5785('0x8')]+_0x495e56[_0x5785('0x9')]+_0x495e56[_0x5785('0xa')]+_0x495e56['countagentrejectretry'];this[_0x5785('0xb')]=_0x495e56[_0x5785('0xb')];this['countdropretry']=_0x495e56[_0x5785('0x8')];this[_0x5785('0x9')]=_0x495e56[_0x5785('0x9')];this[_0x5785('0xa')]=_0x495e56[_0x5785('0xa')];this[_0x5785('0xc')]=_0x495e56[_0x5785('0xc')];this[_0x5785('0xd')]=_0x495e56[_0x5785('0xd')];this['calleridname']=_0x495e56[_0x5785('0xe')];this[_0x5785('0xf')]=_0x495e56[_0x5785('0xf')];this[_0x5785('0x10')]=_0x495e56[_0x5785('0x10')];this[_0x5785('0x11')]=_0x495e56[_0x5785('0x11')];this[_0x5785('0x12')]=_0x495e56[_0x5785('0x11')];this[_0x5785('0x13')]=_0x495e56[_0x5785('0x13')]||0x0;this[_0x5785('0x14')]=_0x495e56[_0x5785('0x14')]||0x0;this[_0x5785('0x15')]=_0x495e56['talktime']||0x0;this[_0x5785('0x16')]=_0x495e56[_0x5785('0x16')];this['callbackuniqueid']=_0x495e56[_0x5785('0x17')];this['callbackat']=_0x495e56['callbackat'];this[_0x5785('0x18')]=_0x495e56[_0x5785('0x18')];this[_0x5785('0x19')]=_0x495e56[_0x5785('0x19')];this[_0x5785('0x1a')]=_0x495e56[_0x5785('0x1a')];this[_0x5785('0x1b')]=_0x495e56['UserId'];this['VoiceQueueId']=_0x495e56[_0x5785('0x1c')];this[_0x5785('0x1d')]=_0x495e56[_0x5785('0x1d')];this[_0x5785('0x1e')]=_0x495e56[_0x5785('0x1e')]||'';this['originatecalleridname']=_0x495e56[_0x5785('0x1f')]||'';this[_0x5785('0x20')]=_0x495e56[_0x5785('0x20')];this[_0x5785('0x21')]=_0x495e56[_0x5785('0x21')];}module[_0x5785('0x22')]=Final; \ No newline at end of file +var _0x68be=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum','starttime'];(function(_0x44f6f9,_0x584246){var _0x368d5c=function(_0x4af861){while(--_0x4af861){_0x44f6f9['push'](_0x44f6f9['shift']());}};_0x368d5c(++_0x584246);}(_0x68be,0xff));var _0xe68b=function(_0x46d962,_0x23ef3f){_0x46d962=_0x46d962-0x0;var _0x107945=_0x68be[_0x46d962];return _0x107945;};'use strict';function Final(_0x33e246){this[_0xe68b('0x0')]=_0x33e246[_0xe68b('0x0')];this[_0xe68b('0x1')]=_0x33e246[_0xe68b('0x1')];this[_0xe68b('0x2')]=_0x33e246[_0xe68b('0x2')];this[_0xe68b('0x3')]=_0x33e246[_0xe68b('0x2')]===_0xe68b('0x4')?_0xe68b('0x5'):_0x33e246[_0xe68b('0x2')];this['countbusyretry']=_0x33e246['countbusyretry'];this[_0xe68b('0x6')]=_0x33e246[_0xe68b('0x6')];this[_0xe68b('0x7')]=_0x33e246['countnoanswerretry'];this[_0xe68b('0x8')]=_0x33e246['countbusyretry']+_0x33e246[_0xe68b('0x6')]+_0x33e246[_0xe68b('0x7')]+_0x33e246['countnosuchnumberretry']+_0x33e246[_0xe68b('0x9')]+_0x33e246[_0xe68b('0xa')]+_0x33e246[_0xe68b('0xb')]+_0x33e246['countagentrejectretry'];this['countnosuchnumberretry']=_0x33e246[_0xe68b('0xc')];this['countdropretry']=_0x33e246[_0xe68b('0x9')];this[_0xe68b('0xa')]=_0x33e246['countabandonedretry'];this[_0xe68b('0xb')]=_0x33e246['countmachineretry'];this[_0xe68b('0xd')]=_0x33e246[_0xe68b('0xd')];this[_0xe68b('0x5')]=_0x33e246[_0xe68b('0x5')];this['calleridname']=_0x33e246[_0xe68b('0xe')];this[_0xe68b('0xf')]=_0x33e246[_0xe68b('0xf')];this[_0xe68b('0x10')]=_0x33e246[_0xe68b('0x10')];this[_0xe68b('0x11')]=_0x33e246[_0xe68b('0x11')];this[_0xe68b('0x12')]=_0x33e246['responsetime'];this[_0xe68b('0x13')]=_0x33e246[_0xe68b('0x13')]||0x0;this[_0xe68b('0x14')]=_0x33e246['holdtime']||0x0;this['talktime']=_0x33e246[_0xe68b('0x15')]||0x0;this[_0xe68b('0x16')]=_0x33e246[_0xe68b('0x16')];this[_0xe68b('0x17')]=_0x33e246[_0xe68b('0x17')];this['callbackat']=_0x33e246[_0xe68b('0x18')];this[_0xe68b('0x19')]=_0x33e246[_0xe68b('0x19')];this[_0xe68b('0x1a')]=_0x33e246[_0xe68b('0x1a')];this[_0xe68b('0x1b')]=_0x33e246[_0xe68b('0x1b')];this[_0xe68b('0x1c')]=_0x33e246['UserId'];this['VoiceQueueId']=_0x33e246[_0xe68b('0x1d')];this['CampaignId']=_0x33e246['CampaignId'];this[_0xe68b('0x1e')]=_0x33e246[_0xe68b('0x1e')]||'';this['originatecalleridname']=_0x33e246[_0xe68b('0x1f')]||'';this['state']=_0x33e246['state'];this['statedesc']=_0x33e246[_0xe68b('0x20')];}module[_0xe68b('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 27be2e9..3f4202e 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae0d=['moment','../utils','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xae0d,0x1b8));var _0xdae0=function(_0x5d9784,_0x552b0d){_0x5d9784=_0x5d9784-0x0;var _0x3c861d=_0xae0d[_0x5d9784];return _0x3c861d;};'use strict';var moment=require(_0xdae0('0x0'));var utils=require(_0xdae0('0x1'));function Hangup(_0x3acf7e,_0x314df6){this['state']=0x4;this[_0xdae0('0x2')]=_0xdae0('0x3');this[_0xdae0('0x4')]=_0x3acf7e['scheduledat'];this['type']=_0x3acf7e['type'];this[_0xdae0('0x5')]=_0x3acf7e[_0xdae0('0x6')]===_0xdae0('0x7')?_0xdae0('0x8'):_0x3acf7e[_0xdae0('0x6')];this[_0xdae0('0x9')]=_0x3acf7e[_0xdae0('0x9')]||![];this[_0xdae0('0xa')]=_0x3acf7e['countbusyretry'];this[_0xdae0('0xb')]=_0x3acf7e[_0xdae0('0xb')];this[_0xdae0('0xc')]=_0x3acf7e[_0xdae0('0xc')];this[_0xdae0('0xd')]=_0x3acf7e[_0xdae0('0xa')]+_0x3acf7e[_0xdae0('0xb')]+_0x3acf7e[_0xdae0('0xc')]+_0x3acf7e['countnosuchnumberretry']+_0x3acf7e[_0xdae0('0xe')]+_0x3acf7e[_0xdae0('0xf')]+_0x3acf7e[_0xdae0('0x10')]+_0x3acf7e[_0xdae0('0x11')];this['countnosuchnumberretry']=_0x3acf7e[_0xdae0('0x12')];this[_0xdae0('0xe')]=_0x3acf7e[_0xdae0('0xe')];this[_0xdae0('0xf')]=_0x3acf7e['countabandonedretry'];this[_0xdae0('0x10')]=_0x3acf7e['countmachineretry'];this['countagentrejectretry']=_0x3acf7e['countagentrejectretry'];this[_0xdae0('0x13')]=_0x314df6[_0xdae0('0x13')];this[_0xdae0('0x14')]=_0x3acf7e['name'];this['calleridnum']=_0x3acf7e['number'];this[_0xdae0('0x15')]=_0x3acf7e['starttime'];this[_0xdae0('0x16')]=_0x3acf7e[_0xdae0('0x16')];this[_0xdae0('0x17')]=moment()['format'](_0xdae0('0x18'));this[_0xdae0('0x19')]=utils[_0xdae0('0x1a')](_0x3acf7e[_0xdae0('0x16')],_0x3acf7e[_0xdae0('0x15')]);this[_0xdae0('0x1b')]=0x0;this['talktime']=utils[_0xdae0('0x1a')](this[_0xdae0('0x17')],_0x3acf7e[_0xdae0('0x16')]);this[_0xdae0('0x8')]=_0x3acf7e['queue'];this[_0xdae0('0x1c')]='IVR';this[_0xdae0('0x1d')]=_0x314df6['cause-txt'];this[_0xdae0('0x1e')]=_0x3acf7e['callback'];this[_0xdae0('0x1f')]=_0x3acf7e[_0xdae0('0x1f')];this['callbackat']=_0x3acf7e[_0xdae0('0x20')];this[_0xdae0('0x21')]=_0x3acf7e['recallme'];this[_0xdae0('0x22')]=_0x3acf7e[_0xdae0('0x22')];this[_0xdae0('0x23')]=_0x3acf7e[_0xdae0('0x23')];this[_0xdae0('0x24')]=_0x3acf7e[_0xdae0('0x24')];this[_0xdae0('0x25')]=_0x3acf7e[_0xdae0('0x25')];this[_0xdae0('0x26')]=_0x3acf7e[_0xdae0('0x26')];}module[_0xdae0('0x27')]=Hangup; \ No newline at end of file +var _0xdcc1=['countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry'];(function(_0x359a29,_0x35a736){var _0x2cdfea=function(_0x3f6d29){while(--_0x3f6d29){_0x359a29['push'](_0x359a29['shift']());}};_0x2cdfea(++_0x35a736);}(_0xdcc1,0xe3));var _0x1dcc=function(_0x4d86dc,_0x1b8520){_0x4d86dc=_0x4d86dc-0x0;var _0x19b295=_0xdcc1[_0x4d86dc];return _0x19b295;};'use strict';var moment=require(_0x1dcc('0x0'));var utils=require('../utils');function Hangup(_0x2e3ad9,_0x362615){this['state']=0x4;this['statedesc']=_0x1dcc('0x1');this[_0x1dcc('0x2')]=_0x2e3ad9[_0x1dcc('0x2')];this['type']=_0x2e3ad9[_0x1dcc('0x3')];this[_0x1dcc('0x4')]=_0x2e3ad9[_0x1dcc('0x3')]==='outbound'?_0x1dcc('0x5'):_0x2e3ad9['type'];this['amd']=_0x2e3ad9[_0x1dcc('0x6')]||![];this[_0x1dcc('0x7')]=_0x2e3ad9['countbusyretry'];this[_0x1dcc('0x8')]=_0x2e3ad9[_0x1dcc('0x8')];this[_0x1dcc('0x9')]=_0x2e3ad9[_0x1dcc('0x9')];this[_0x1dcc('0xa')]=_0x2e3ad9[_0x1dcc('0x7')]+_0x2e3ad9[_0x1dcc('0x8')]+_0x2e3ad9[_0x1dcc('0x9')]+_0x2e3ad9['countnosuchnumberretry']+_0x2e3ad9[_0x1dcc('0xb')]+_0x2e3ad9[_0x1dcc('0xc')]+_0x2e3ad9[_0x1dcc('0xd')]+_0x2e3ad9[_0x1dcc('0xe')];this[_0x1dcc('0xf')]=_0x2e3ad9['countnosuchnumberretry'];this[_0x1dcc('0xb')]=_0x2e3ad9[_0x1dcc('0xb')];this[_0x1dcc('0xc')]=_0x2e3ad9[_0x1dcc('0xc')];this['countmachineretry']=_0x2e3ad9['countmachineretry'];this[_0x1dcc('0xe')]=_0x2e3ad9[_0x1dcc('0xe')];this['uniqueid']=_0x362615[_0x1dcc('0x10')];this[_0x1dcc('0x11')]=_0x2e3ad9[_0x1dcc('0x12')];this[_0x1dcc('0x13')]=_0x2e3ad9['number'];this[_0x1dcc('0x14')]=_0x2e3ad9[_0x1dcc('0x14')];this['responsetime']=_0x2e3ad9[_0x1dcc('0x15')];this[_0x1dcc('0x16')]=moment()[_0x1dcc('0x17')](_0x1dcc('0x18'));this[_0x1dcc('0x19')]=utils['getSeconds'](_0x2e3ad9[_0x1dcc('0x15')],_0x2e3ad9['starttime']);this[_0x1dcc('0x1a')]=0x0;this['talktime']=utils[_0x1dcc('0x1b')](this[_0x1dcc('0x16')],_0x2e3ad9['responsetime']);this[_0x1dcc('0x5')]=_0x2e3ad9[_0x1dcc('0x5')];this['membername']=_0x1dcc('0x1c');this[_0x1dcc('0x1d')]=_0x362615[_0x1dcc('0x1e')];this[_0x1dcc('0x1f')]=_0x2e3ad9[_0x1dcc('0x1f')];this[_0x1dcc('0x20')]=_0x2e3ad9[_0x1dcc('0x20')];this[_0x1dcc('0x21')]=_0x2e3ad9['callbackat'];this['recallme']=_0x2e3ad9[_0x1dcc('0x22')];this['ContactId']=_0x2e3ad9[_0x1dcc('0x23')];this[_0x1dcc('0x24')]=_0x2e3ad9[_0x1dcc('0x24')];this[_0x1dcc('0x25')]=_0x2e3ad9[_0x1dcc('0x25')];this['VoiceQueueId']=_0x2e3ad9[_0x1dcc('0x26')];this[_0x1dcc('0x27')]=_0x2e3ad9[_0x1dcc('0x27')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index bb79923..8f03ac0 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bd2=['type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridnum','number','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','../utils','uniqueid','scheduledat'];(function(_0x36bcf7,_0x30dd85){var _0x5e0e42=function(_0x5e780f){while(--_0x5e780f){_0x36bcf7['push'](_0x36bcf7['shift']());}};_0x5e0e42(++_0x30dd85);}(_0x0bd2,0x165));var _0x20bd=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x0bd2[_0x3de8a4];return _0x4635cf;};'use strict';var utils=require(_0x20bd('0x0'));function History(_0x508432){this[_0x20bd('0x1')]=_0x508432[_0x20bd('0x1')];this['scheduledat']=_0x508432[_0x20bd('0x2')]||undefined;this[_0x20bd('0x3')]=_0x508432[_0x20bd('0x3')];this[_0x20bd('0x4')]=_0x508432[_0x20bd('0x3')]===_0x20bd('0x5')?'queue':_0x508432[_0x20bd('0x3')];this[_0x20bd('0x6')]=_0x508432[_0x20bd('0x6')];this[_0x20bd('0x7')]=_0x508432[_0x20bd('0x7')];this[_0x20bd('0x8')]=_0x508432[_0x20bd('0x8')];this[_0x20bd('0x9')]=_0x508432[_0x20bd('0x6')]+_0x508432['countcongestionretry']+_0x508432[_0x20bd('0x8')]+_0x508432[_0x20bd('0xa')]+_0x508432[_0x20bd('0xb')]+_0x508432['countabandonedretry']+_0x508432[_0x20bd('0xc')]+_0x508432[_0x20bd('0xd')];this['countnosuchnumberretry']=_0x508432[_0x20bd('0xa')];this[_0x20bd('0xb')]=_0x508432[_0x20bd('0xb')];this[_0x20bd('0xe')]=_0x508432['countabandonedretry'];this[_0x20bd('0xc')]=_0x508432['countmachineretry'];this[_0x20bd('0xd')]=_0x508432['countagentrejectretry'];this[_0x20bd('0xf')]=_0x508432[_0x20bd('0xf')];this['calleridname']=_0x508432['name'];this[_0x20bd('0x10')]=_0x508432[_0x20bd('0x11')];this[_0x20bd('0x12')]=_0x508432[_0x20bd('0x12')];this[_0x20bd('0x13')]=_0x508432[_0x20bd('0x13')];this['endtime']=_0x508432['responsetime'];this[_0x20bd('0x14')]=utils[_0x20bd('0x15')](_0x508432[_0x20bd('0x13')],_0x508432[_0x20bd('0x12')]);this[_0x20bd('0x16')]=0x0;this[_0x20bd('0x17')]=0x0;this[_0x20bd('0x18')]=_0x508432['callback'];this[_0x20bd('0x19')]=_0x508432[_0x20bd('0x19')];this[_0x20bd('0x1a')]=_0x508432['callbackat'];this[_0x20bd('0x1b')]=_0x508432[_0x20bd('0x1b')];this[_0x20bd('0x1c')]=_0x508432['ContactId'];this[_0x20bd('0x1d')]=_0x508432[_0x20bd('0x1d')];this[_0x20bd('0x1e')]=_0x508432['UserId'];this['VoiceQueueId']=_0x508432[_0x20bd('0x1f')];this[_0x20bd('0x20')]=_0x508432[_0x20bd('0x20')];this[_0x20bd('0x21')]=_0x508432[_0x20bd('0x21')]||'';this['originatecalleridname']=_0x508432['originatecalleridname']||'';this[_0x20bd('0x22')]=_0x508432['state'];this[_0x20bd('0x23')]=_0x508432[_0x20bd('0x23')];}module['exports']=History; \ No newline at end of file +var _0x9b49=['countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9b49,0xb5));var _0x99b4=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0x9b49[_0x2a94cf];return _0x22147f;};'use strict';var utils=require(_0x99b4('0x0'));function History(_0x106212){this[_0x99b4('0x1')]=_0x106212['uniqueid'];this[_0x99b4('0x2')]=_0x106212['scheduledat']||undefined;this[_0x99b4('0x3')]=_0x106212[_0x99b4('0x3')];this[_0x99b4('0x4')]=_0x106212[_0x99b4('0x3')]===_0x99b4('0x5')?_0x99b4('0x6'):_0x106212[_0x99b4('0x3')];this['countbusyretry']=_0x106212[_0x99b4('0x7')];this[_0x99b4('0x8')]=_0x106212[_0x99b4('0x8')];this[_0x99b4('0x9')]=_0x106212['countnoanswerretry'];this['countglobal']=_0x106212[_0x99b4('0x7')]+_0x106212['countcongestionretry']+_0x106212[_0x99b4('0x9')]+_0x106212['countnosuchnumberretry']+_0x106212['countdropretry']+_0x106212[_0x99b4('0xa')]+_0x106212[_0x99b4('0xb')]+_0x106212['countagentrejectretry'];this[_0x99b4('0xc')]=_0x106212['countnosuchnumberretry'];this[_0x99b4('0xd')]=_0x106212[_0x99b4('0xd')];this[_0x99b4('0xa')]=_0x106212[_0x99b4('0xa')];this['countmachineretry']=_0x106212[_0x99b4('0xb')];this[_0x99b4('0xe')]=_0x106212[_0x99b4('0xe')];this[_0x99b4('0x6')]=_0x106212['queue'];this['calleridname']=_0x106212['name'];this[_0x99b4('0xf')]=_0x106212['number'];this[_0x99b4('0x10')]=_0x106212[_0x99b4('0x10')];this[_0x99b4('0x11')]=_0x106212[_0x99b4('0x11')];this['endtime']=_0x106212[_0x99b4('0x11')];this[_0x99b4('0x12')]=utils['getSeconds'](_0x106212[_0x99b4('0x11')],_0x106212[_0x99b4('0x10')]);this[_0x99b4('0x13')]=0x0;this['talktime']=0x0;this['callback']=_0x106212[_0x99b4('0x14')];this[_0x99b4('0x15')]=_0x106212['callbackuniqueid'];this[_0x99b4('0x16')]=_0x106212[_0x99b4('0x16')];this[_0x99b4('0x17')]=_0x106212[_0x99b4('0x17')];this['ContactId']=_0x106212['ContactId'];this[_0x99b4('0x18')]=_0x106212['ListId'];this[_0x99b4('0x19')]=_0x106212[_0x99b4('0x19')];this[_0x99b4('0x1a')]=_0x106212[_0x99b4('0x1a')];this['CampaignId']=_0x106212['CampaignId'];this[_0x99b4('0x1b')]=_0x106212[_0x99b4('0x1b')]||'';this[_0x99b4('0x1c')]=_0x106212[_0x99b4('0x1c')]||'';this[_0x99b4('0x1d')]=_0x106212[_0x99b4('0x1d')];this[_0x99b4('0x1e')]=_0x106212[_0x99b4('0x1e')];}module[_0x99b4('0x1f')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 1cb3bb5..41832ec 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2516=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2516,0xb6));var _0x6251=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x2516[_0x50007c];return _0x5c1ec7;};'use strict';var utils=require(_0x6251('0x0'));function QueueCallerAbandon(_0x4cf716,_0x46e674){this[_0x6251('0x1')]=_0x4cf716[_0x6251('0x1')];this[_0x6251('0x2')]=_0x4cf716['type'];this[_0x6251('0x3')]=_0x4cf716['type']===_0x6251('0x4')?_0x6251('0x5'):_0x4cf716[_0x6251('0x2')];this[_0x6251('0x6')]=_0x4cf716['countbusyretry'];this[_0x6251('0x7')]=_0x4cf716['countcongestionretry'];this[_0x6251('0x8')]=_0x4cf716[_0x6251('0x8')];this['countglobal']=_0x4cf716['countbusyretry']+_0x4cf716[_0x6251('0x7')]+_0x4cf716[_0x6251('0x8')]+_0x4cf716['countnosuchnumberretry']+_0x4cf716[_0x6251('0x9')]+_0x4cf716[_0x6251('0xa')]+_0x4cf716[_0x6251('0xb')]+_0x4cf716[_0x6251('0xc')];this[_0x6251('0xd')]=_0x4cf716['countnosuchnumberretry'];this[_0x6251('0x9')]=_0x4cf716[_0x6251('0x9')];this[_0x6251('0xa')]=_0x4cf716['countabandonedretry'];this[_0x6251('0xb')]=_0x4cf716[_0x6251('0xb')];this[_0x6251('0xc')]=_0x4cf716[_0x6251('0xc')];this['uniqueid']=_0x46e674[_0x6251('0xe')];this[_0x6251('0xf')]=_0x4cf716[_0x6251('0x10')];this['calleridnum']=_0x4cf716[_0x6251('0x11')];this[_0x6251('0x12')]=_0x4cf716[_0x6251('0x12')];this[_0x6251('0x13')]=_0x4cf716[_0x6251('0x13')];this[_0x6251('0x14')]=_0x4cf716['droptime'];this['dropreason']=_0x4cf716[_0x6251('0x15')];this[_0x6251('0x16')]=this[_0x6251('0x14')];this[_0x6251('0x17')]=utils['getSeconds'](_0x4cf716['responsetime'],_0x4cf716['starttime']);this['holdtime']=utils[_0x6251('0x18')](this[_0x6251('0x14')],_0x4cf716[_0x6251('0x13')]);this[_0x6251('0x19')]=0x0;this[_0x6251('0x5')]=_0x46e674[_0x6251('0x5')];this[_0x6251('0x1a')]=_0x46e674[_0x6251('0x1b')];this['reason']=_0x46e674[_0x6251('0x1c')];this[_0x6251('0x1d')]=_0x4cf716[_0x6251('0x1d')];this[_0x6251('0x1e')]=_0x4cf716[_0x6251('0x1e')];this[_0x6251('0x1f')]=_0x4cf716[_0x6251('0x1f')];this[_0x6251('0x20')]=_0x4cf716[_0x6251('0x20')];this['ContactId']=_0x4cf716['ContactId'];this['ListId']=_0x4cf716[_0x6251('0x21')];this[_0x6251('0x22')]=_0x4cf716['UserId'];this[_0x6251('0x23')]=_0x4cf716[_0x6251('0x23')];this[_0x6251('0x24')]=_0x4cf716[_0x6251('0x24')];this[_0x6251('0x25')]=_0x4cf716[_0x6251('0x25')]||'';this[_0x6251('0x26')]=_0x4cf716[_0x6251('0x26')]||'';this[_0x6251('0x27')]=_0x4cf716[_0x6251('0x27')];this[_0x6251('0x28')]=_0x4cf716['state'];this[_0x6251('0x29')]=_0x4cf716['statedesc'];}module[_0x6251('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xe5c8=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x410b6d,_0x200838){var _0x40951d=function(_0x5688a2){while(--_0x5688a2){_0x410b6d['push'](_0x410b6d['shift']());}};_0x40951d(++_0x200838);}(_0xe5c8,0x135));var _0x8e5c=function(_0x1d51b2,_0x2b450a){_0x1d51b2=_0x1d51b2-0x0;var _0x4d3c8a=_0xe5c8[_0x1d51b2];return _0x4d3c8a;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x409b0a,_0x240544){this['scheduledat']=_0x409b0a[_0x8e5c('0x0')];this[_0x8e5c('0x1')]=_0x409b0a[_0x8e5c('0x1')];this['campaigntype']=_0x409b0a[_0x8e5c('0x1')]===_0x8e5c('0x2')?_0x8e5c('0x3'):_0x409b0a[_0x8e5c('0x1')];this[_0x8e5c('0x4')]=_0x409b0a[_0x8e5c('0x4')];this[_0x8e5c('0x5')]=_0x409b0a[_0x8e5c('0x5')];this['countnoanswerretry']=_0x409b0a[_0x8e5c('0x6')];this[_0x8e5c('0x7')]=_0x409b0a[_0x8e5c('0x4')]+_0x409b0a[_0x8e5c('0x5')]+_0x409b0a[_0x8e5c('0x6')]+_0x409b0a[_0x8e5c('0x8')]+_0x409b0a[_0x8e5c('0x9')]+_0x409b0a['countabandonedretry']+_0x409b0a[_0x8e5c('0xa')]+_0x409b0a[_0x8e5c('0xb')];this[_0x8e5c('0x8')]=_0x409b0a[_0x8e5c('0x8')];this[_0x8e5c('0x9')]=_0x409b0a[_0x8e5c('0x9')];this[_0x8e5c('0xc')]=_0x409b0a['countabandonedretry'];this[_0x8e5c('0xa')]=_0x409b0a[_0x8e5c('0xa')];this[_0x8e5c('0xb')]=_0x409b0a[_0x8e5c('0xb')];this[_0x8e5c('0xd')]=_0x240544['uniqueid'];this[_0x8e5c('0xe')]=_0x409b0a[_0x8e5c('0xf')];this[_0x8e5c('0x10')]=_0x409b0a[_0x8e5c('0x11')];this[_0x8e5c('0x12')]=_0x409b0a[_0x8e5c('0x12')];this[_0x8e5c('0x13')]=_0x409b0a['responsetime'];this[_0x8e5c('0x14')]=_0x409b0a[_0x8e5c('0x14')];this['dropreason']=_0x409b0a[_0x8e5c('0x15')];this[_0x8e5c('0x16')]=this[_0x8e5c('0x14')];this[_0x8e5c('0x17')]=utils['getSeconds'](_0x409b0a[_0x8e5c('0x13')],_0x409b0a[_0x8e5c('0x12')]);this[_0x8e5c('0x18')]=utils[_0x8e5c('0x19')](this[_0x8e5c('0x14')],_0x409b0a[_0x8e5c('0x13')]);this[_0x8e5c('0x1a')]=0x0;this['queue']=_0x240544[_0x8e5c('0x3')];this[_0x8e5c('0x1b')]=_0x240544[_0x8e5c('0x1c')];this[_0x8e5c('0x1d')]=_0x240544[_0x8e5c('0x1d')];this['callback']=_0x409b0a[_0x8e5c('0x1e')];this[_0x8e5c('0x1f')]=_0x409b0a[_0x8e5c('0x1f')];this[_0x8e5c('0x20')]=_0x409b0a['callbackat'];this[_0x8e5c('0x21')]=_0x409b0a['recallme'];this['ContactId']=_0x409b0a[_0x8e5c('0x22')];this[_0x8e5c('0x23')]=_0x409b0a[_0x8e5c('0x23')];this[_0x8e5c('0x24')]=_0x409b0a[_0x8e5c('0x24')];this['VoiceQueueId']=_0x409b0a[_0x8e5c('0x25')];this[_0x8e5c('0x26')]=_0x409b0a[_0x8e5c('0x26')];this[_0x8e5c('0x27')]=_0x409b0a[_0x8e5c('0x27')]||'';this[_0x8e5c('0x28')]=_0x409b0a['originatecalleridname']||'';this[_0x8e5c('0x29')]=_0x409b0a[_0x8e5c('0x29')];this[_0x8e5c('0x2a')]=_0x409b0a['state'];this[_0x8e5c('0x2b')]=_0x409b0a['statedesc'];}module[_0x8e5c('0x2c')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index f2a1030..d9fac5f 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa46e=['getContactDialerIvr','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]'];(function(_0x33298b,_0x42f55f){var _0x49bc13=function(_0x3cd0dc){while(--_0x3cd0dc){_0x33298b['push'](_0x33298b['shift']());}};_0x49bc13(++_0x42f55f);}(_0xa46e,0x8a));var _0xea46=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xa46e[_0x40d8d7];return _0x3454cc;};'use strict';var util=require(_0xea46('0x0'));var logger=require(_0xea46('0x1'))('dialer');var cmHopper=require(_0xea46('0x2'));var cmHopperAdditionalPhone=require(_0xea46('0x3'));var cmHopperBlack=require(_0xea46('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x19f135){return util['inspect'](_0x19f135,{'showHidden':![],'depth':null});}function getContactDialer(_0x3a2209,_0x47d633,_0x3599fc){return cmHopper['getContactDialer'](_0x3a2209['id'],_0x47d633,_0x3599fc,_0x3a2209[_0xea46('0x5')])[_0xea46('0x6')](function(_0x5f1cd1){_0x3a2209[_0xea46('0x7')]=0x0;logger[_0xea46('0x8')](_0xea46('0x9'),inspectError(_0x5f1cd1));});}exports[_0xea46('0xa')]=getContactDialer;function getContactDialerIvr(_0x468322,_0x4cf206){return cmHopper['getContactDialerIvr'](_0x468322['id'],_0x4cf206,_0x468322['dialOrderByScheduledAt'])[_0xea46('0x6')](function(_0x45550a){_0x468322['temp']=0x0;logger[_0xea46('0x8')](_0xea46('0xb'),inspectError(_0x45550a));});}exports[_0xea46('0xc')]=getContactDialerIvr;function countReScheduled(_0x594694){return cmHopper[_0xea46('0xd')](_0x594694)[_0xea46('0x6')](function(_0x4e10f3){logger[_0xea46('0x8')](_0xea46('0xe'),inspectError(_0x4e10f3));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x20955e){return cmHopper['rescheduleContact'](_0x20955e)[_0xea46('0x6')](function(_0x42c328){logger[_0xea46('0x8')](_0xea46('0xf'),inspectError(_0x42c328));});}exports[_0xea46('0x10')]=rescheduleContact;function unlockContact(_0x2ef436,_0x81ee45,_0x20a79c){return cmHopper[_0xea46('0x11')](_0x2ef436,_0x81ee45,_0x20a79c)['catch'](function(_0x2fa2f9){logger[_0xea46('0x8')](_0xea46('0x12'),inspectError(_0x2fa2f9));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x58b4da){return cmHopper[_0xea46('0x13')](_0x58b4da)[_0xea46('0x6')](function(_0x5cf5dd){logger['error'](_0xea46('0x14'),inspectError(_0x5cf5dd));});}exports[_0xea46('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x4ff93d){return cmHopperBlack[_0xea46('0x15')](_0x4ff93d)[_0xea46('0x6')](function(_0x1adba1){logger[_0xea46('0x8')]('[checkIsBlackList]',inspectError(_0x1adba1));});}exports[_0xea46('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x4e220f){return cmHopperBlack['checkIsBlackListIvr'](_0x4e220f)[_0xea46('0x6')](function(_0x59e431){logger['error']('[checkIsBlackListIvr]',inspectError(_0x59e431));});}exports[_0xea46('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x36f982,_0x3d1850,_0x5beb44){return cmHopperAdditionalPhone[_0xea46('0x17')](_0x36f982,_0x3d1850,_0x5beb44)['catch'](function(_0x12e688){logger[_0xea46('0x8')]('[verifyAdditionalPhone]',inspectError(_0x12e688));});}exports[_0xea46('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x5480eb,_0x2b3a8f,_0x114bf9){return cmHopperAdditionalPhone[_0xea46('0x18')](_0x5480eb,_0x2b3a8f,_0x114bf9)['catch'](function(_0x5d2de1){logger[_0xea46('0x8')](_0xea46('0x19'),inspectError(_0x5d2de1));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x3b3928){return cmHopperHistory['avgHandleTime'](_0x3b3928)[_0xea46('0x6')](function(_0x51ca27){logger[_0xea46('0x8')](_0xea46('0x1a'),inspectError(_0x51ca27));});}exports[_0xea46('0x1b')]=avgHandleTime;function createHistory(_0x44517d){return cmHopperHistory[_0xea46('0x1c')](_0x44517d)[_0xea46('0x6')](function(_0x4a5149){logger[_0xea46('0x8')](_0xea46('0x1d'),inspectError(_0x4a5149));});}exports[_0xea46('0x1c')]=createHistory; \ No newline at end of file +var _0x2ef3=['checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','catch','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','dialOrderByScheduledAt','[getContactDialerIvr]','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2ef3,0xba));var _0x32ef=function(_0x41bc56,_0x151bb0){_0x41bc56=_0x41bc56-0x0;var _0x184910=_0x2ef3[_0x41bc56];return _0x184910;};'use strict';var util=require(_0x32ef('0x0'));var logger=require(_0x32ef('0x1'))(_0x32ef('0x2'));var cmHopper=require(_0x32ef('0x3'));var cmHopperAdditionalPhone=require(_0x32ef('0x4'));var cmHopperBlack=require(_0x32ef('0x5'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x38f865){return util[_0x32ef('0x6')](_0x38f865,{'showHidden':![],'depth':null});}function getContactDialer(_0x524ab6,_0x402857,_0x37dd1d){return cmHopper['getContactDialer'](_0x524ab6['id'],_0x402857,_0x37dd1d,_0x524ab6['dialOrderByScheduledAt'])[_0x32ef('0x7')](function(_0x4bfcf8){_0x524ab6[_0x32ef('0x8')]=0x0;logger[_0x32ef('0x9')](_0x32ef('0xa'),inspectError(_0x4bfcf8));});}exports[_0x32ef('0xb')]=getContactDialer;function getContactDialerIvr(_0x2484a0,_0x2bbb50){return cmHopper[_0x32ef('0xc')](_0x2484a0['id'],_0x2bbb50,_0x2484a0[_0x32ef('0xd')])['catch'](function(_0x5780e9){_0x2484a0[_0x32ef('0x8')]=0x0;logger[_0x32ef('0x9')](_0x32ef('0xe'),inspectError(_0x5780e9));});}exports[_0x32ef('0xc')]=getContactDialerIvr;function countReScheduled(_0x5af651){return cmHopper[_0x32ef('0xf')](_0x5af651)['catch'](function(_0x1a5106){logger['error'](_0x32ef('0x10'),inspectError(_0x1a5106));});}exports[_0x32ef('0xf')]=countReScheduled;function rescheduleContact(_0x5c3eb9){return cmHopper['rescheduleContact'](_0x5c3eb9)[_0x32ef('0x7')](function(_0x4d8009){logger[_0x32ef('0x9')](_0x32ef('0x11'),inspectError(_0x4d8009));});}exports[_0x32ef('0x12')]=rescheduleContact;function unlockContact(_0x54c7f5,_0x57aff1,_0x55bf0b){return cmHopper['unlockContact'](_0x54c7f5,_0x57aff1,_0x55bf0b)[_0x32ef('0x7')](function(_0x3950e6){logger[_0x32ef('0x9')]('[unlockContact]',inspectError(_0x3950e6));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x1eb468){return cmHopper[_0x32ef('0x13')](_0x1eb468)[_0x32ef('0x7')](function(_0x57863c){logger[_0x32ef('0x9')](_0x32ef('0x14'),inspectError(_0x57863c));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x304505){return cmHopperBlack[_0x32ef('0x15')](_0x304505)[_0x32ef('0x7')](function(_0x251084){logger[_0x32ef('0x9')](_0x32ef('0x16'),inspectError(_0x251084));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x3c5b78){return cmHopperBlack['checkIsBlackListIvr'](_0x3c5b78)[_0x32ef('0x7')](function(_0x3a20ca){logger['error'](_0x32ef('0x17'),inspectError(_0x3a20ca));});}exports[_0x32ef('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x5e8898,_0x55f7f2,_0x57f5e5){return cmHopperAdditionalPhone[_0x32ef('0x19')](_0x5e8898,_0x55f7f2,_0x57f5e5)[_0x32ef('0x7')](function(_0x225feb){logger['error']('[verifyAdditionalPhone]',inspectError(_0x225feb));});}exports[_0x32ef('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x4d584b,_0x51a412,_0x278495){return cmHopperAdditionalPhone[_0x32ef('0x1a')](_0x4d584b,_0x51a412,_0x278495)[_0x32ef('0x7')](function(_0x1dbe98){logger[_0x32ef('0x9')](_0x32ef('0x1b'),inspectError(_0x1dbe98));});}exports[_0x32ef('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x38aed5){return cmHopperHistory[_0x32ef('0x1c')](_0x38aed5)[_0x32ef('0x7')](function(_0x1335e2){logger[_0x32ef('0x9')]('[avgHandleTime]',inspectError(_0x1335e2));});}exports[_0x32ef('0x1c')]=avgHandleTime;function createHistory(_0x2f5d06){return cmHopperHistory['createHistory'](_0x2f5d06)[_0x32ef('0x7')](function(_0x3c569d){logger[_0x32ef('0x9')](_0x32ef('0x1d'),inspectError(_0x3c569d));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 93aa2d4..0c0b936 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0ba=['RECALLINQUEUE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','toString','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','util','../../../../config/logger','dialer','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME'];(function(_0x2da0da,_0x3a967a){var _0x34fbe6=function(_0x3b6495){while(--_0x3b6495){_0x2da0da['push'](_0x2da0da['shift']());}};_0x34fbe6(++_0x3a967a);}(_0xf0ba,0x9f));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf0b('0x0'));var moment=require('moment');var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var timezones=require('../../../../config/environment/shared')[_0xaf0b('0x4')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xaf0b('0x5'),'CONTACTS_RESCHEDULED':_0xaf0b('0x6'),'DEACTIVATED':_0xaf0b('0x7'),'DISACTIVED':_0xaf0b('0x8'),'EMPTY_INTERVAL':_0xaf0b('0x9'),'INACTIVE':_0xaf0b('0xa'),'NO_AGENTS_LOGGED':_0xaf0b('0xb'),'NO_AVAILABLE_CONTACTS':_0xaf0b('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xaf0b('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xaf0b('0xe'),'QUEUE_RECALL':_0xaf0b('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xaf0b('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x20019c){return _0x20019c[_0xaf0b('0x11')]===_0xaf0b('0x12');}exports[_0xaf0b('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x3c167b){return _0x3c167b[_0xaf0b('0x14')]===_0xaf0b('0x15');}exports[_0xaf0b('0x16')]=isIVRCampaign;function isOutboundQueue(_0x1b529e){return _0x1b529e[_0xaf0b('0x14')]===_0xaf0b('0x17');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x43b111){return _0x43b111[_0xaf0b('0x18')];}exports[_0xaf0b('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5567e2){return _0x5567e2[_0xaf0b('0x1a')];}exports[_0xaf0b('0x1b')]=isIVRCampaignActive;function getSeconds(_0x419aaf,_0x59dd12){var _0x5695df=moment(_0x419aaf)[_0xaf0b('0x1c')](0x0);var _0x6c8578=moment(_0x59dd12)[_0xaf0b('0x1c')](0x0);return _0x5695df[_0xaf0b('0x1d')](_0x6c8578,'seconds');}exports[_0xaf0b('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0xa669c6,_0x46f052){var _0x481f73=![];var _0x3dbc6e=_0xa669c6['dialMethod']!==_0x46f052[_0xaf0b('0x11')]||_0xa669c6[_0xaf0b('0x18')]!==_0x46f052['dialActive']||_0xa669c6[_0xaf0b('0x1f')]!==_0x46f052['message'];var _0x4bed37=_0xa669c6[_0xaf0b('0x20')]!==_0x46f052[_0xaf0b('0x20')]||_0xa669c6[_0xaf0b('0x21')]!==_0x46f052['loggedIn']||_0xa669c6[_0xaf0b('0x22')]!==_0x46f052[_0xaf0b('0x22')]||_0xa669c6['paused']!==_0x46f052[_0xaf0b('0x23')]||_0xa669c6[_0xaf0b('0x24')]!==_0x46f052[_0xaf0b('0x24')]||_0xa669c6['pTalking']!==_0x46f052[_0xaf0b('0x25')]||_0xa669c6[_0xaf0b('0x26')]!==_0x46f052[_0xaf0b('0x26')]||_0xa669c6['inUse']!==_0x46f052[_0xaf0b('0x27')]||_0xa669c6['originated']!==_0x46f052[_0xaf0b('0x28')];if(_0xa669c6[_0xaf0b('0x29')]&&_0x46f052['Trunk']){_0x481f73=_0xa669c6[_0xaf0b('0x29')][_0xaf0b('0x2a')]!==_0x46f052[_0xaf0b('0x29')][_0xaf0b('0x2a')]||_0xa669c6[_0xaf0b('0x29')][_0xaf0b('0x1a')]!==_0x46f052[_0xaf0b('0x29')][_0xaf0b('0x1a')];}return _0x3dbc6e||_0x4bed37||_0x481f73;}exports[_0xaf0b('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x187916){var _0x2b3b88=null;var _0x5edc69=_0x187916[_0xaf0b('0x2c')];if(_[_0xaf0b('0x2d')](_0x187916['dialGlobalInterval'])||_[_0xaf0b('0x2d')](_0x187916[_0xaf0b('0x2e')])||_['isNil'](_0x187916[_0xaf0b('0x2e')][_0xaf0b('0x2f')])){_0x2b3b88=CAMPAIGN_STATUS[_0xaf0b('0x30')];}else if(_[_0xaf0b('0x31')](_0x187916[_0xaf0b('0x32')])||_['isEmpty'](_0x187916[_0xaf0b('0x2e')]['Intervals'])){_0x2b3b88=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5edc69&&!timezones[_0x5edc69]){_0x2b3b88=CAMPAIGN_STATUS[_0xaf0b('0x33')];}return _0x2b3b88;}function checkAnyValidTrunk(_0x39004f,_0x30484d){var _0x11a00a=null;var _0x4659b3=_0xaf0b('0x34');var _0x3ecec6=[_0xaf0b('0x35'),'unmonitored'];var _0x26a0c7=!![];if(_0x39004f[_0xaf0b('0x29')]&&_0x39004f[_0xaf0b('0x29')][_0xaf0b('0x1a')]){_0x4659b3+=_0x39004f[_0xaf0b('0x29')]['name'];_0x11a00a=_0x30484d[_0x4659b3];_0x26a0c7=_0x3ecec6[_0xaf0b('0x36')](_0x11a00a[_0xaf0b('0x37')]);}else if(_0x39004f[_0xaf0b('0x38')]&&_0x39004f['TrunkBackup']['active']){_0x4659b3+=_0x39004f[_0xaf0b('0x38')]['name'];_0x11a00a=_0x30484d[_0x4659b3];_0x26a0c7=_0x3ecec6[_0xaf0b('0x36')](_0x11a00a['status']);}return _0x26a0c7;}function getQueueCampaignStatusMessage(_0x1b42f1,_0xf4b0fc){var _0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x39')];var _0x4dbc56=isPreviewCampaign(_0x1b42f1);if(!isQueueCampaignActive(_0x1b42f1)){if(_0x4dbc56){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3a')];}else{if(_0x1b42f1[_0xaf0b('0x28')]===0x0&&_0x1b42f1[_0xaf0b('0x24')]===0x0&&_0x1b42f1[_0xaf0b('0x26')]===0x0&&(_0x1b42f1['pTalking']||0x0)===0x0){_0x99e017=CAMPAIGN_STATUS['INACTIVE'];}else{_0x99e017=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1b42f1[_0xaf0b('0x21')]===0x0){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3b')];}else if(!checkAnyValidTrunk(_0x1b42f1,_0xf4b0fc)){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3c')];}else if(!isPreviewCampaign(_0x1b42f1)){var _0x36d79c=checkAnyValidQueueCampaignInterval(_0x1b42f1);if(_0x36d79c){_0x99e017=_0x36d79c;}}return _0x99e017;}exports[_0xaf0b('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xc46876){var _0x3d38dc=CAMPAIGN_STATUS[_0xaf0b('0x3e')];if(_0xc46876[_0xaf0b('0x28')]===0x0&&_0xc46876[_0xaf0b('0x24')]===0x0&&_0xc46876['waiting']===0x0&&(_0xc46876[_0xaf0b('0x25')]||0x0)===0x0){_0x3d38dc=CAMPAIGN_STATUS['INACTIVE'];}return _0x3d38dc;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3d89d9){var _0x375cd1=_0x3d89d9[_0xaf0b('0x3f')](/"(.*?)"/);return _0x375cd1?_0x375cd1[0x1]:_0x3d89d9;}exports[_0xaf0b('0x40')]=extractCalleridName;function getCallerId(_0x397f69,_0x5c4641,_0x4793cf){if(!_[_0xaf0b('0x41')](_0x4793cf)&&typeof _0x4793cf===_0xaf0b('0x42')&&!_['isEmpty'](_0x4793cf)){if(!_['isUndefined'](_0x5c4641)&&typeof _0x5c4641===_0xaf0b('0x42')&&!_['isEmpty'](_0x5c4641)){return util[_0xaf0b('0x43')](_0xaf0b('0x44'),_0x5c4641,_0x4793cf);}return util['format'](_0xaf0b('0x44'),_0x4793cf,_0x4793cf);}if(!_[_0xaf0b('0x41')](_0x397f69)&&typeof _0x397f69==='string'&&!_[_0xaf0b('0x31')](_0x397f69)){return _0x397f69;}return _0xaf0b('0x45');}exports[_0xaf0b('0x46')]=getCallerId;function getCallerIdRandom(_0x2f0364,_0x16d2b3){var _0x311fba;var _0x3a592f;var _0x40d9a0;if(_0x16d2b3<=0x0){_0x16d2b3=0x1;}_0x311fba=new RegExp(_0xaf0b('0x47')+_0x16d2b3+'}$');_0x3a592f=Math[_0xaf0b('0x48')](0xa,_0x16d2b3-0x1);_0x40d9a0=Math['pow'](0xa,_0x16d2b3)-0x1;return util[_0xaf0b('0x43')]('%s',_['replace'](_0x2f0364,_0x311fba,_['random'](_0x3a592f,_0x40d9a0)[_0xaf0b('0x49')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x10e89b){if(_0x10e89b[_0xaf0b('0x28')]&&_0x10e89b[_0xaf0b('0x28')]>0x0){_0x10e89b[_0xaf0b('0x28')]-=0x1;}else{logger['error'](_0xaf0b('0x4a'));}}exports[_0xaf0b('0x4b')]=decrementOriginate;function checkContactEmpty(_0x5334e2){return _0x5334e2&&_0x5334e2[_0xaf0b('0x4c')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x395644,_0x26a5e3){if(_0x26a5e3===0x0){return 0x0;}var _0x11fe60=0x1;for(var _0x5dfb10=0x1;_0x5dfb10<=_0x26a5e3;_0x5dfb10+=0x1){_0x11fe60=0x1+_0x11fe60*_0x5dfb10/_0x395644;}return 0x1/_0x11fe60;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x5638ab,_0x4c1603,_0x43f3ba){if(_0x4c1603>_0x43f3ba){for(var _0x149845=0x0;_0x149845<_0x4c1603-_0x43f3ba;_0x149845+=0x1){decrementOriginate(_0x5638ab);}}}exports[_0xaf0b('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x592493){var _0x18eeaa={};var _0x1cfe1a=['id',_0xaf0b('0x4e'),_0xaf0b('0x4f'),_0xaf0b('0x50')];const _0x41bcb1=0xfa;if(_0x592493){for(var _0x34560d in _0x592493){if(typeof _0x592493[_0x34560d]!==_0xaf0b('0x51')){if(!_['isNil'](_0x592493[_0x34560d])&&!_0x1cfe1a['includes'](_0x34560d)){if(_0x34560d===_0xaf0b('0x52')&&_0x592493[_0x34560d]['length']>_0x41bcb1){_0x18eeaa[_0xaf0b('0x53')+_0x34560d[_0xaf0b('0x54')]()]=_0x592493[_0x34560d][_0xaf0b('0x49')]()[_0xaf0b('0x55')](0x0,_0x41bcb1);}else{_0x18eeaa[_0xaf0b('0x53')+_0x34560d[_0xaf0b('0x54')]()]=_0x592493[_0x34560d];}}}}}return _0x18eeaa;}exports[_0xaf0b('0x56')]=setXMDContactVariables; \ No newline at end of file +var _0x8f73=['Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','description','XMD-','substring','toUpperCase','setXMDContactVariables','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated'];(function(_0x3e81df,_0xb0f7e3){var _0x1c7c79=function(_0x2db358){while(--_0x2db358){_0x3e81df['push'](_0x3e81df['shift']());}};_0x1c7c79(++_0xb0f7e3);}(_0x8f73,0x82));var _0x38f7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8f73[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x38f7('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x38f7('0x1'))(_0x38f7('0x2'));var timezones=require('../../../../config/environment/shared')[_0x38f7('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x38f7('0x4'),'BLACKLIST':_0x38f7('0x5'),'CONTACTS_RESCHEDULED':_0x38f7('0x6'),'DEACTIVATED':_0x38f7('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x38f7('0x8'),'INACTIVE':_0x38f7('0x9'),'NO_AGENTS_LOGGED':_0x38f7('0xa'),'NO_AVAILABLE_CONTACTS':_0x38f7('0xb'),'NULL_INTERVAL':_0x38f7('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x38f7('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x38f7('0xe'),'RUNNING':_0x38f7('0xf'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x38f7('0x10')};exports[_0x38f7('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x553fc9){return _0x553fc9['dialMethod']===_0x38f7('0x12');}exports[_0x38f7('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x54380e){return _0x54380e[_0x38f7('0x14')]===_0x38f7('0x15');}exports[_0x38f7('0x16')]=isIVRCampaign;function isOutboundQueue(_0xb6f8){return _0xb6f8[_0x38f7('0x14')]===_0x38f7('0x17');}exports[_0x38f7('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x7653a4){return _0x7653a4[_0x38f7('0x19')];}exports[_0x38f7('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x10ffa5){return _0x10ffa5[_0x38f7('0x1b')];}exports[_0x38f7('0x1c')]=isIVRCampaignActive;function getSeconds(_0x599b84,_0x3b1f7f){var _0x10f508=moment(_0x599b84)['milliseconds'](0x0);var _0x19faf8=moment(_0x3b1f7f)[_0x38f7('0x1d')](0x0);return _0x10f508['diff'](_0x19faf8,'seconds');}exports[_0x38f7('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x20b46d,_0x10f554){var _0x505843=![];var _0x120ad9=_0x20b46d[_0x38f7('0x1f')]!==_0x10f554['dialMethod']||_0x20b46d[_0x38f7('0x19')]!==_0x10f554[_0x38f7('0x19')]||_0x20b46d[_0x38f7('0x20')]!==_0x10f554[_0x38f7('0x20')];var _0x4f3197=_0x20b46d['available']!==_0x10f554[_0x38f7('0x21')]||_0x20b46d[_0x38f7('0x22')]!==_0x10f554[_0x38f7('0x22')]||_0x20b46d[_0x38f7('0x23')]!==_0x10f554[_0x38f7('0x23')]||_0x20b46d[_0x38f7('0x24')]!==_0x10f554[_0x38f7('0x24')]||_0x20b46d['talking']!==_0x10f554[_0x38f7('0x25')]||_0x20b46d['pTalking']!==_0x10f554[_0x38f7('0x26')]||_0x20b46d[_0x38f7('0x27')]!==_0x10f554[_0x38f7('0x27')]||_0x20b46d[_0x38f7('0x28')]!==_0x10f554['inUse']||_0x20b46d[_0x38f7('0x29')]!==_0x10f554[_0x38f7('0x29')];if(_0x20b46d[_0x38f7('0x2a')]&&_0x10f554[_0x38f7('0x2a')]){_0x505843=_0x20b46d[_0x38f7('0x2a')][_0x38f7('0x2b')]!==_0x10f554['Trunk'][_0x38f7('0x2b')]||_0x20b46d[_0x38f7('0x2a')][_0x38f7('0x1b')]!==_0x10f554[_0x38f7('0x2a')][_0x38f7('0x1b')];}return _0x120ad9||_0x4f3197||_0x505843;}exports[_0x38f7('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1f94d4){var _0x207255=null;var _0x1cad60=_0x1f94d4['dialTimezone'];if(_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2e')])||_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2f')])||_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2f')][_0x38f7('0x30')])){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x31')];}else if(_[_0x38f7('0x32')](_0x1f94d4[_0x38f7('0x2e')])||_[_0x38f7('0x32')](_0x1f94d4['Interval'][_0x38f7('0x30')])){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x33')];}else if(_0x1cad60&&!timezones[_0x1cad60]){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x34')];}return _0x207255;}function checkAnyValidTrunk(_0x3d332c,_0x479f1a){var _0x234297=null;var _0x10c944=_0x38f7('0x35');var _0x166ce4=[_0x38f7('0x36'),'unmonitored'];var _0x530cd1=!![];if(_0x3d332c[_0x38f7('0x2a')]&&_0x3d332c[_0x38f7('0x2a')][_0x38f7('0x1b')]){_0x10c944+=_0x3d332c[_0x38f7('0x2a')]['name'];_0x234297=_0x479f1a[_0x10c944];_0x530cd1=_0x166ce4[_0x38f7('0x37')](_0x234297[_0x38f7('0x38')]);}else if(_0x3d332c[_0x38f7('0x39')]&&_0x3d332c[_0x38f7('0x39')][_0x38f7('0x1b')]){_0x10c944+=_0x3d332c[_0x38f7('0x39')][_0x38f7('0x2b')];_0x234297=_0x479f1a[_0x10c944];_0x530cd1=_0x166ce4[_0x38f7('0x37')](_0x234297[_0x38f7('0x38')]);}return _0x530cd1;}function getQueueCampaignStatusMessage(_0x4f5b2d,_0x47fa15){var _0x528af7=CAMPAIGN_STATUS[_0x38f7('0x4')];var _0x51772=isPreviewCampaign(_0x4f5b2d);if(!isQueueCampaignActive(_0x4f5b2d)){if(_0x51772){_0x528af7=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x4f5b2d[_0x38f7('0x29')]===0x0&&_0x4f5b2d[_0x38f7('0x25')]===0x0&&_0x4f5b2d[_0x38f7('0x27')]===0x0&&(_0x4f5b2d[_0x38f7('0x26')]||0x0)===0x0){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3a')];}else{_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3b')];}}}else if(_0x4f5b2d[_0x38f7('0x22')]===0x0){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3c')];}else if(!checkAnyValidTrunk(_0x4f5b2d,_0x47fa15)){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3d')];}else if(!isPreviewCampaign(_0x4f5b2d)){var _0x9688bb=checkAnyValidQueueCampaignInterval(_0x4f5b2d);if(_0x9688bb){_0x528af7=_0x9688bb;}}return _0x528af7;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x49335d){var _0x53edff=CAMPAIGN_STATUS[_0x38f7('0x3b')];if(_0x49335d[_0x38f7('0x29')]===0x0&&_0x49335d[_0x38f7('0x25')]===0x0&&_0x49335d[_0x38f7('0x27')]===0x0&&(_0x49335d[_0x38f7('0x26')]||0x0)===0x0){_0x53edff=CAMPAIGN_STATUS[_0x38f7('0x3a')];}return _0x53edff;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x80a36c){var _0x37727e=_0x80a36c[_0x38f7('0x3e')](/"(.*?)"/);return _0x37727e?_0x37727e[0x1]:_0x80a36c;}exports[_0x38f7('0x3f')]=extractCalleridName;function getCallerId(_0x17806b,_0x290118,_0x3d02d2){if(!_[_0x38f7('0x40')](_0x3d02d2)&&typeof _0x3d02d2===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x3d02d2)){if(!_[_0x38f7('0x40')](_0x290118)&&typeof _0x290118===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x290118)){return util[_0x38f7('0x42')]('\x22%s\x22\x20<%s>',_0x290118,_0x3d02d2);}return util[_0x38f7('0x42')](_0x38f7('0x43'),_0x3d02d2,_0x3d02d2);}if(!_[_0x38f7('0x40')](_0x17806b)&&typeof _0x17806b===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x17806b)){return _0x17806b;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x116da8,_0x42de6d){var _0x2a241d;var _0x1525c8;var _0x34f6c4;if(_0x42de6d<=0x0){_0x42de6d=0x1;}_0x2a241d=new RegExp(_0x38f7('0x44')+_0x42de6d+'}$');_0x1525c8=Math[_0x38f7('0x45')](0xa,_0x42de6d-0x1);_0x34f6c4=Math[_0x38f7('0x45')](0xa,_0x42de6d)-0x1;return util['format']('%s',_['replace'](_0x116da8,_0x2a241d,_[_0x38f7('0x46')](_0x1525c8,_0x34f6c4)[_0x38f7('0x47')]()));}exports[_0x38f7('0x48')]=getCallerIdRandom;function decrementOriginate(_0x5f2768){if(_0x5f2768[_0x38f7('0x29')]&&_0x5f2768[_0x38f7('0x29')]>0x0){_0x5f2768[_0x38f7('0x29')]-=0x1;}else{logger[_0x38f7('0x49')](_0x38f7('0x4a'));}}exports[_0x38f7('0x4b')]=decrementOriginate;function checkContactEmpty(_0x4fbc3d){return _0x4fbc3d&&_0x4fbc3d['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x4de22d,_0x56fda2){if(_0x56fda2===0x0){return 0x0;}var _0x1c2633=0x1;for(var _0x47faf0=0x1;_0x47faf0<=_0x56fda2;_0x47faf0+=0x1){_0x1c2633=0x1+_0x1c2633*_0x47faf0/_0x4de22d;}return 0x1/_0x1c2633;}exports[_0x38f7('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x17caa3,_0x4cdd66,_0x3d769f){if(_0x4cdd66>_0x3d769f){for(var _0x49cc15=0x0;_0x49cc15<_0x4cdd66-_0x3d769f;_0x49cc15+=0x1){decrementOriginate(_0x17caa3);}}}exports[_0x38f7('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x167e7b){var _0x412220={};var _0x2e45cb=['id',_0x38f7('0x4e'),'tags',_0x38f7('0x4f')];const _0x2738cb=0xfa;if(_0x167e7b){for(var _0x50f37d in _0x167e7b){if(typeof _0x167e7b[_0x50f37d]!==_0x38f7('0x50')){if(!_[_0x38f7('0x2d')](_0x167e7b[_0x50f37d])&&!_0x2e45cb['includes'](_0x50f37d)){if(_0x50f37d===_0x38f7('0x51')&&_0x167e7b[_0x50f37d]['length']>_0x2738cb){_0x412220[_0x38f7('0x52')+_0x50f37d['toUpperCase']()]=_0x167e7b[_0x50f37d][_0x38f7('0x47')]()[_0x38f7('0x53')](0x0,_0x2738cb);}else{_0x412220['XMD-'+_0x50f37d[_0x38f7('0x54')]()]=_0x167e7b[_0x50f37d];}}}}}return _0x412220;}exports[_0x38f7('0x55')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 7ff705a..cef6335 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(_0x839aca,_0xa0a811){var _0x6de2df=function(_0x3092af){while(--_0x3092af){_0x839aca['push'](_0x839aca['shift']());}};_0x6de2df(++_0xa0a811);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x3c53b5,_0x4cc9c0){var _0x59a507=function(_0x857f88){while(--_0x857f88){_0x3c53b5['push'](_0x3c53b5['shift']());}};_0x59a507(++_0x4cc9c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 fcf4e2d..25c1b8b 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 _0xe340=['logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','path','tiff2pdf','../../../config/logger','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','name','.pdf','then','fax','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe340,0x186));var _0x0e34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe340[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0e34('0x0'));var _=require(_0x0e34('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0e34('0x2'));var moment=require('moment');var path=require(_0x0e34('0x3'));var tiff2pdf=require(_0x0e34('0x4'));var gs=require('./util/gs');var logger=require(_0x0e34('0x5'))('fax');var ami=require(_0x0e34('0x6'));var rpcDb=require(_0x0e34('0x7'));var Channel=require(_0x0e34('0x8'));var ut=require('./util/util');var Action=require(_0x0e34('0x9'));var faxAccount=require(_0x0e34('0xa'));var attachment=require(_0x0e34('0xb'));var faxMessage=require(_0x0e34('0xc'));function Fax(_0x3a86cf){this[_0x0e34('0xd')]={};this[_0x0e34('0xe')]=_0x3a86cf[_0x0e34('0xe')];this['trunks']=_0x3a86cf[_0x0e34('0xf')];this[_0x0e34('0x10')]={};ami['on']('newchannel',this[_0x0e34('0x11')]['bind'](this));ami['on'](_0x0e34('0x12'),this[_0x0e34('0x13')][_0x0e34('0x14')](this));ami['on']('newstate',this[_0x0e34('0x15')][_0x0e34('0x14')](this));ami['on']('newexten',this[_0x0e34('0x16')][_0x0e34('0x14')](this));ami['on'](_0x0e34('0x17'),this[_0x0e34('0x18')][_0x0e34('0x14')](this));ami['on'](_0x0e34('0x19'),this['syncReceiveFax'][_0x0e34('0x14')](this));ami['on'](_0x0e34('0x1a'),this[_0x0e34('0x1b')][_0x0e34('0x14')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x0e34('0x14')](this));}Fax[_0x0e34('0x1c')][_0x0e34('0x11')]=function(_0x2d4f1b){if(_0x2d4f1b[_0x0e34('0x1d')]===_0x0e34('0x1e')){for(var _0x17c86e in this[_0x0e34('0xe')]){if(this['faxAccounts']['hasOwnProperty'](_0x17c86e)){if(_0x2d4f1b[_0x0e34('0x1f')]===this[_0x0e34('0xe')][_0x17c86e][_0x0e34('0x20')]){this['channels'][_0x2d4f1b[_0x0e34('0x21')]]={};this['channels'][_0x2d4f1b['uniqueid']][_0x0e34('0x22')]=_0x2d4f1b[_0x0e34('0x22')];this[_0x0e34('0xd')][_0x2d4f1b[_0x0e34('0x21')]]['id']=this[_0x0e34('0xe')][_0x17c86e]['id'];this[_0x0e34('0xd')][_0x2d4f1b[_0x0e34('0x21')]]['name']=this[_0x0e34('0xe')][_0x17c86e]['name'];logger[_0x0e34('0x23')](_0x2d4f1b['uniqueid'],_0x0e34('0x24'));}}}}if(this[_0x0e34('0x10')][_0x2d4f1b[_0x0e34('0x21')]]){this['channels'][_0x2d4f1b[_0x0e34('0x21')]]={};this['channels'][_0x2d4f1b['uniqueid']][_0x0e34('0x22')]=_0x2d4f1b[_0x0e34('0x22')];logger['info'](_0x2d4f1b[_0x0e34('0x21')],_0x0e34('0x24'));}};Fax[_0x0e34('0x1c')][_0x0e34('0x13')]=function(_0x5252d4){if(this['channels'][_0x5252d4[_0x0e34('0x21')]]){for(var _0x1e901b in _0x5252d4[_0x0e34('0x25')]){if(_0x5252d4[_0x0e34('0x25')][_0x0e34('0x26')](_0x1e901b)){this[_0x0e34('0xd')][_0x5252d4[_0x0e34('0x21')]][_0x1e901b]=_0x5252d4[_0x0e34('0x27')];}}}};Fax[_0x0e34('0x1c')][_0x0e34('0x15')]=function(_0x57299d){if(this[_0x0e34('0xd')][_0x57299d['uniqueid']]){this['channels'][_0x57299d[_0x0e34('0x21')]][_0x0e34('0x28')]=_0x57299d[_0x0e34('0x28')];this[_0x0e34('0xd')][_0x57299d[_0x0e34('0x21')]]['channelstatedesc']=_0x57299d[_0x0e34('0x29')];}};Fax[_0x0e34('0x1c')][_0x0e34('0x16')]=function(_0x5ec560){if(this[_0x0e34('0xd')][_0x5ec560[_0x0e34('0x21')]]){for(var _0x2551d0 in _0x5ec560[_0x0e34('0x25')]){if(_0x5ec560[_0x0e34('0x25')][_0x0e34('0x26')](_0x2551d0)){this[_0x0e34('0xd')][_0x5ec560[_0x0e34('0x21')]][_0x2551d0]=_0x5ec560[_0x0e34('0x27')];}}}};Fax['prototype'][_0x0e34('0x18')]=function(_0x140d75){if(this[_0x0e34('0xd')][_0x140d75[_0x0e34('0x21')]]){this[_0x0e34('0xd')][_0x140d75[_0x0e34('0x21')]][_0x0e34('0x2a')]=_0x140d75['operation'];this[_0x0e34('0xd')][_0x140d75[_0x0e34('0x21')]][_0x0e34('0x2b')]=_0x140d75['status'];this[_0x0e34('0xd')][_0x140d75[_0x0e34('0x21')]][_0x0e34('0x20')]=_0x140d75[_0x0e34('0x20')];this[_0x0e34('0xd')][_0x140d75[_0x0e34('0x21')]]['filename']=_0x140d75[_0x0e34('0x2c')];logger[_0x0e34('0x23')](_0x140d75['uniqueid'],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x0e34('0x2d')]=function(_0x362997){var _0x50e53e=this;if(this['channels'][_0x362997[_0x0e34('0x21')]]){var _0x2b4817=this[_0x0e34('0xd')][_0x362997['uniqueid']]['id'];this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]]['remotestationid']=_0x362997[_0x0e34('0x2e')];this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]][_0x0e34('0x2f')]=_0x362997[_0x0e34('0x2f')];this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]][_0x0e34('0x20')]=_0x362997['localstationid'];this[_0x0e34('0xd')][_0x362997['uniqueid']]['resolution']=_0x362997[_0x0e34('0x30')];this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]][_0x0e34('0x31')]=_0x362997[_0x0e34('0x31')];this[_0x0e34('0xd')][_0x362997['uniqueid']][_0x0e34('0x2c')]=_0x362997[_0x0e34('0x2c')];this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]]['calleridnum']=_0x362997[_0x0e34('0x32')];if(this[_0x0e34('0xd')][_0x362997[_0x0e34('0x21')]]['pagestransferred']>0x0){tiff2pdf(_0x362997['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3379ad){logger['info'](_0x362997[_0x0e34('0x21')],'\x20result\x20conversion\x20file\x20',_0x3379ad[_0x0e34('0x33')]);attachment[_0x0e34('0x34')]({'name':path[_0x0e34('0x35')](_0x362997[_0x0e34('0x2c')])['name'],'basename':path[_0x0e34('0x35')](_0x362997[_0x0e34('0x2c')])[_0x0e34('0x36')]+_0x0e34('0x37'),'type':'application/pdf'})[_0x0e34('0x38')](function(_0x332465){faxAccount['notify'](_0x2b4817,{'from':_0x362997['calleridnum'],'mapKey':_0x0e34('0x39'),'body':path['parse'](_0x362997[_0x0e34('0x2c')])['name']+_0x0e34('0x37'),'AttachmentId':_0x332465['id']})['catch'](function(_0x45b6e5){logger[_0x0e34('0x3a')](_0x362997['uniqueid'],_0x0e34('0x3b'),JSON['stringify'](_0x45b6e5));});})[_0x0e34('0x3c')](function(_0x4fec7c){logger[_0x0e34('0x3a')](_0x362997[_0x0e34('0x21')],_0x0e34('0x3d'),JSON[_0x0e34('0x3e')](_0x4fec7c));});});}logger[_0x0e34('0x23')](_0x362997[_0x0e34('0x21')],_0x0e34('0x3d'));}};Fax[_0x0e34('0x1c')][_0x0e34('0x3f')]=function(_0x1eb3a8){if(this[_0x0e34('0x10')][_0x1eb3a8['uniqueid']]){_[_0x0e34('0x40')](this['channels'][_0x1eb3a8[_0x0e34('0x21')]],_['pick'](_0x1eb3a8,[_0x0e34('0x41'),_0x0e34('0x42')]));}};function updateStatus(_0x209b17){if(_0x209b17[_0x0e34('0x43')]){faxMessage[_0x0e34('0x44')](_0x209b17['AttachmentId'],{'failMessage':_0x0e34('0x45')})[_0x0e34('0x38')](function(_0x10fe46){ut[_0x0e34('0x46')](_0x0e34('0x47'),_0x10fe46);})[_0x0e34('0x3c')](function(_0x2528eb){ut[_0x0e34('0x46')](_0x0e34('0x48'),_0x2528eb);});}else{ut[_0x0e34('0x46')](_0x0e34('0x49'));}}Fax[_0x0e34('0x1c')][_0x0e34('0x4a')]=function(_0x523490,_0x2d133c,_0x3ee821){var _0x2ff2e5=this;var _0x442bb3={};if(_0x2d133c){_0x442bb3={'read':_0x2d133c};}else{_0x442bb3={'failMessage':_0x3ee821};}if(this[_0x0e34('0x10')][_0x523490][_0x0e34('0x43')]){faxMessage[_0x0e34('0x44')](this[_0x0e34('0x10')][_0x523490][_0x0e34('0x43')],_0x442bb3)[_0x0e34('0x38')](function(_0x2c2895){ut['logger'](_0x0e34('0x4b'),_0x2c2895);})[_0x0e34('0x3c')](function(_0x1401af){ut[_0x0e34('0x46')](_0x0e34('0x4c'),_0x1401af);})[_0x0e34('0x4d')](function(){delete _0x2ff2e5[_0x0e34('0xd')][_0x523490];delete _0x2ff2e5[_0x0e34('0x10')][_0x523490];});}else{ut[_0x0e34('0x46')](_0x0e34('0x4e'));delete this[_0x0e34('0xd')][_0x523490];delete this[_0x0e34('0x10')][_0x523490];}};Fax[_0x0e34('0x1c')][_0x0e34('0x1b')]=function(_0x418d62){var _0x3ed398=this;if(this[_0x0e34('0xd')][_0x418d62[_0x0e34('0x21')]]){if(this['actions'][_0x418d62[_0x0e34('0x21')]]){this[_0x0e34('0xd')][_0x418d62[_0x0e34('0x21')]]['id']=this[_0x0e34('0x10')][_0x418d62[_0x0e34('0x21')]]['id'];this['channels'][_0x418d62[_0x0e34('0x21')]][_0x0e34('0x36')]=this[_0x0e34('0x10')][_0x418d62[_0x0e34('0x21')]][_0x0e34('0x36')];}logger[_0x0e34('0x23')](_0x418d62[_0x0e34('0x21')],this[_0x0e34('0x10')][_0x418d62[_0x0e34('0x21')]]?_0x0e34('0x4f'):_0x0e34('0x50'),JSON[_0x0e34('0x3e')](this['channels'][_0x418d62['uniqueid']]));if(this[_0x0e34('0x10')][_0x418d62['uniqueid']]){if(this[_0x0e34('0xd')][_0x418d62['uniqueid']]['faxpages']>0x0&&this[_0x0e34('0xd')][_0x418d62[_0x0e34('0x21')]][_0x0e34('0x17')]===_0x0e34('0x51')){this[_0x0e34('0x4a')](_0x418d62[_0x0e34('0x21')],!![]);}else{this[_0x0e34('0x4a')](_0x418d62[_0x0e34('0x21')],![],this[_0x0e34('0xd')][_0x418d62[_0x0e34('0x21')]][_0x0e34('0x52')]?_0x0e34('0x53')+this[_0x0e34('0xd')][_0x418d62[_0x0e34('0x21')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x0e34('0x1c')][_0x0e34('0x54')]=function(_0x4e0f3c){var _0x20d2ee=this;return new BPromise(function(_0x3e2a4c,_0x2a06ae){_0x20d2ee['execOriginate'](_0x4e0f3c,_0x20d2ee['faxAccounts'][_0x4e0f3c['FaxAccountId']])[_0x0e34('0x38')](function(_0x512bda){ut[_0x0e34('0x46')](_0x0e34('0x55'),_0x512bda);_0x3e2a4c(ut[_0x0e34('0x33')](_0x0e34('0x56')));})['catch'](function(_0x4204b){ut['logger'](_0x0e34('0x57'),_0x4204b);updateStatus(_0x4e0f3c);_0x2a06ae(ut[_0x0e34('0x33')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x2de915){var _0x5d2d03=this;return new BPromise(function(_0x4f6869,_0x2091c2){var _0xabd341=_0x5d2d03['checkTrunk'](_0x5d2d03['faxAccounts'][_0x2de915['FaxAccountId']][_0x0e34('0x58')],_0x2de915);if(_0xabd341[_0x0e34('0x59')]){_0x4f6869(ut[_0x0e34('0x33')](_0x0e34('0x5a')));}else{_0x2091c2(ut['message'](_0xabd341[_0x0e34('0x33')]));}});};function originate(_0x4f9cc6,_0x39ceec,_0x267d34){return new BPromise(function(_0x471237,_0x4fe852){if(_0x267d34){var _0x5e4302=util[_0x0e34('0x5b')](_0x0e34('0x5c'),path[_0x0e34('0x35')](_0x4f9cc6[_0x0e34('0x3')])[_0x0e34('0x36')],_0x4f9cc6[_0x0e34('0x3')]);gs['execute'](_0x5e4302)[_0x0e34('0x38')](function(){_0x4f9cc6['path']=util[_0x0e34('0x5b')]('%s/%s.tif',path[_0x0e34('0x35')](_0x4f9cc6[_0x0e34('0x3')])[_0x0e34('0x5d')],path[_0x0e34('0x35')](_0x4f9cc6[_0x0e34('0x3')])[_0x0e34('0x36')]);_0x39ceec[_0x0e34('0x5e')]=_0x4f9cc6['path'];ut[_0x0e34('0x46')](_0x0e34('0x5f'),'');ami['Action'](ut[_0x0e34('0x60')](_0x4f9cc6,_0x39ceec))[_0x0e34('0x38')](function(_0x457bea){_0x471237(_0x457bea);})[_0x0e34('0x3c')](function(_0x10762b){_0x4fe852(_0x10762b);});})[_0x0e34('0x3c')](function(_0x324d90){_0x4fe852(_0x324d90);});}else{ami[_0x0e34('0x61')](ut[_0x0e34('0x60')](_0x4f9cc6,_0x39ceec))[_0x0e34('0x38')](function(_0x33a6b2){_0x471237(_0x33a6b2);})[_0x0e34('0x3c')](function(_0xecc6b2){_0x4fe852(_0xecc6b2);});}});}Fax[_0x0e34('0x1c')][_0x0e34('0x62')]=function(_0xdeeb02,_0xee0add){var _0x1fe905=this;return new BPromise(function(_0x231b3f,_0x1ed28b){var _0x53b31e=uuid['v4']();var _0x37c5b0=ut[_0x0e34('0x63')](_0xdeeb02,_0xee0add);_0x1fe905[_0x0e34('0x10')][_0x53b31e]=new Action(_0x53b31e,_0xee0add,_0xdeeb02);var _0x243746=_0x1fe905[_0x0e34('0x10')][_0x53b31e];if(path[_0x0e34('0x35')](_0xdeeb02[_0x0e34('0x3')])[_0x0e34('0x64')]==='.pdf'){originate(_0x243746,_0x37c5b0,!![])[_0x0e34('0x38')](function(_0x7021aa){_0x231b3f(_0x7021aa);})[_0x0e34('0x3c')](function(_0xea3218){_0x1ed28b(_0xea3218);});}else{originate(_0x243746,_0x37c5b0,![])[_0x0e34('0x38')](function(_0x46f4e6){_0x231b3f(_0x46f4e6);})[_0x0e34('0x3c')](function(_0x400108){_0x1ed28b(_0x400108);});}});};Fax[_0x0e34('0x1c')][_0x0e34('0x65')]=function(_0x48096e){return!_[_0x0e34('0x66')](_0x48096e)&&!_[_0x0e34('0x66')](_0x48096e[_0x0e34('0x36')])&&!_[_0x0e34('0x66')](_0x48096e[_0x0e34('0x67')])&&_0x48096e[_0x0e34('0x67')]&&!_['isNil'](this[_0x0e34('0xf')][util[_0x0e34('0x5b')](_0x0e34('0x68'),_0x48096e['name'])])&&!_[_0x0e34('0x66')](this['trunks'][util['format']('SIP/%s',_0x48096e[_0x0e34('0x36')])][_0x0e34('0x2b')])&&(this[_0x0e34('0xf')][util[_0x0e34('0x5b')](_0x0e34('0x68'),_0x48096e[_0x0e34('0x36')])]['status']===_0x0e34('0x69')||this[_0x0e34('0xf')][util[_0x0e34('0x5b')](_0x0e34('0x68'),_0x48096e['name'])]['status']==='unmonitored');};Fax[_0x0e34('0x1c')][_0x0e34('0x6a')]=function(_0x32e03e,_0x2b6aa6){if(!this['isTrunkReachable'](_0x32e03e)){ut['logger'](_0x0e34('0x6b'),_['isNil'](_0x32e03e)?'':_0x32e03e[_0x0e34('0x36')]+_0x0e34('0x6c'));return{'isValid':![],'message':_0x0e34('0x6d')};}if(_[_0x0e34('0x66')](_0x2b6aa6['fax'])){ut['logger'](_0x0e34('0x6e'),JSON[_0x0e34('0x3e')](_0x2b6aa6));return{'isValid':![],'message':_0x0e34('0x6f')};}if(_['isNil'](_0x2b6aa6[_0x0e34('0x3')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x2b6aa6));return{'isValid':![],'message':_0x0e34('0x70')};}return{'isValid':!![],'message':_0x0e34('0x71')};};module[_0x0e34('0x72')]=Fax; \ No newline at end of file +var _0x6df5=['dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','then','notify','error','catch','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','path','%s/%s.tif'];(function(_0x3e22ec,_0x59e837){var _0x21669d=function(_0x46bd06){while(--_0x46bd06){_0x3e22ec['push'](_0x3e22ec['shift']());}};_0x21669d(++_0x59e837);}(_0x6df5,0x1e9));var _0x56df=function(_0xd158dc,_0x128608){_0xd158dc=_0xd158dc-0x0;var _0x12d25f=_0x6df5[_0xd158dc];return _0x12d25f;};'use strict';var util=require(_0x56df('0x0'));var _=require(_0x56df('0x1'));var BPromise=require(_0x56df('0x2'));var uuid=require(_0x56df('0x3'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x56df('0x4'));var gs=require(_0x56df('0x5'));var logger=require(_0x56df('0x6'))(_0x56df('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x56df('0x8'));var Action=require(_0x56df('0x9'));var faxAccount=require(_0x56df('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x56df('0xb'));function Fax(_0x364669){this[_0x56df('0xc')]={};this[_0x56df('0xd')]=_0x364669[_0x56df('0xd')];this['trunks']=_0x364669[_0x56df('0xe')];this[_0x56df('0xf')]={};ami['on']('newchannel',this[_0x56df('0x10')][_0x56df('0x11')](this));ami['on'](_0x56df('0x12'),this[_0x56df('0x13')][_0x56df('0x11')](this));ami['on'](_0x56df('0x14'),this[_0x56df('0x15')][_0x56df('0x11')](this));ami['on'](_0x56df('0x16'),this[_0x56df('0x17')][_0x56df('0x11')](this));ami['on'](_0x56df('0x18'),this['syncFaxStatus'][_0x56df('0x11')](this));ami['on']('receivefax',this[_0x56df('0x19')][_0x56df('0x11')](this));ami['on'](_0x56df('0x1a'),this[_0x56df('0x1b')]['bind'](this));ami['on'](_0x56df('0x1c'),this['syncOriginateResponse'][_0x56df('0x11')](this));}Fax[_0x56df('0x1d')]['syncNewchannel']=function(_0x20e396){if(_0x20e396[_0x56df('0x1e')]===_0x56df('0x1f')){for(var _0x17c43d in this[_0x56df('0xd')]){if(this['faxAccounts'][_0x56df('0x20')](_0x17c43d)){if(_0x20e396['exten']===this[_0x56df('0xd')][_0x17c43d][_0x56df('0x21')]){this[_0x56df('0xc')][_0x20e396[_0x56df('0x22')]]={};this[_0x56df('0xc')][_0x20e396['uniqueid']]['channel']=_0x20e396[_0x56df('0x23')];this['channels'][_0x20e396['uniqueid']]['id']=this[_0x56df('0xd')][_0x17c43d]['id'];this[_0x56df('0xc')][_0x20e396[_0x56df('0x22')]][_0x56df('0x24')]=this[_0x56df('0xd')][_0x17c43d][_0x56df('0x24')];logger[_0x56df('0x25')](_0x20e396[_0x56df('0x22')],_0x56df('0x26'));}}}}if(this[_0x56df('0xf')][_0x20e396[_0x56df('0x22')]]){this[_0x56df('0xc')][_0x20e396['uniqueid']]={};this[_0x56df('0xc')][_0x20e396[_0x56df('0x22')]][_0x56df('0x23')]=_0x20e396[_0x56df('0x23')];logger['info'](_0x20e396[_0x56df('0x22')],_0x56df('0x26'));}};Fax[_0x56df('0x1d')][_0x56df('0x13')]=function(_0x58dcf6){if(this[_0x56df('0xc')][_0x58dcf6[_0x56df('0x22')]]){for(var _0x337878 in _0x58dcf6[_0x56df('0x27')]){if(_0x58dcf6[_0x56df('0x27')][_0x56df('0x20')](_0x337878)){this[_0x56df('0xc')][_0x58dcf6[_0x56df('0x22')]][_0x337878]=_0x58dcf6[_0x56df('0x28')];}}}};Fax[_0x56df('0x1d')][_0x56df('0x15')]=function(_0x280a5b){if(this['channels'][_0x280a5b[_0x56df('0x22')]]){this['channels'][_0x280a5b[_0x56df('0x22')]][_0x56df('0x29')]=_0x280a5b[_0x56df('0x29')];this[_0x56df('0xc')][_0x280a5b['uniqueid']][_0x56df('0x2a')]=_0x280a5b[_0x56df('0x2a')];}};Fax[_0x56df('0x1d')][_0x56df('0x17')]=function(_0x52c421){if(this[_0x56df('0xc')][_0x52c421[_0x56df('0x22')]]){for(var _0x1e2622 in _0x52c421[_0x56df('0x27')]){if(_0x52c421[_0x56df('0x27')][_0x56df('0x20')](_0x1e2622)){this[_0x56df('0xc')][_0x52c421[_0x56df('0x22')]][_0x1e2622]=_0x52c421[_0x56df('0x28')];}}}};Fax['prototype'][_0x56df('0x2b')]=function(_0x310c60){if(this[_0x56df('0xc')][_0x310c60[_0x56df('0x22')]]){this[_0x56df('0xc')][_0x310c60[_0x56df('0x22')]][_0x56df('0x2c')]=_0x310c60[_0x56df('0x2c')];this[_0x56df('0xc')][_0x310c60[_0x56df('0x22')]][_0x56df('0x2d')]=_0x310c60['status'];this[_0x56df('0xc')][_0x310c60[_0x56df('0x22')]][_0x56df('0x21')]=_0x310c60['localstationid'];this[_0x56df('0xc')][_0x310c60[_0x56df('0x22')]][_0x56df('0x2e')]=_0x310c60[_0x56df('0x2e')];logger[_0x56df('0x25')](_0x310c60[_0x56df('0x22')],_0x56df('0x2f'));}};Fax[_0x56df('0x1d')][_0x56df('0x19')]=function(_0x5e160f){var _0x2a612c=this;if(this['channels'][_0x5e160f[_0x56df('0x22')]]){var _0x2cc8c1=this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]]['id'];this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]][_0x56df('0x30')]=_0x5e160f['remotestationid'];this[_0x56df('0xc')][_0x5e160f['uniqueid']][_0x56df('0x31')]=_0x5e160f[_0x56df('0x31')];this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]][_0x56df('0x21')]=_0x5e160f[_0x56df('0x21')];this[_0x56df('0xc')][_0x5e160f['uniqueid']][_0x56df('0x32')]=_0x5e160f[_0x56df('0x32')];this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]][_0x56df('0x33')]=_0x5e160f['transferrate'];this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]][_0x56df('0x2e')]=_0x5e160f[_0x56df('0x2e')];this[_0x56df('0xc')][_0x5e160f[_0x56df('0x22')]]['calleridnum']=_0x5e160f[_0x56df('0x34')];if(this['channels'][_0x5e160f['uniqueid']][_0x56df('0x31')]>0x0){tiff2pdf(_0x5e160f[_0x56df('0x2e')],_0x56df('0x35'),function(_0x3034c4){logger[_0x56df('0x25')](_0x5e160f['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x3034c4[_0x56df('0x36')]);attachment[_0x56df('0x37')]({'name':path[_0x56df('0x38')](_0x5e160f[_0x56df('0x2e')])['name'],'basename':path['parse'](_0x5e160f['filename'])[_0x56df('0x24')]+_0x56df('0x39'),'type':'application/pdf'})[_0x56df('0x3a')](function(_0x1ad608){faxAccount[_0x56df('0x3b')](_0x2cc8c1,{'from':_0x5e160f['calleridnum'],'mapKey':'fax','body':path[_0x56df('0x38')](_0x5e160f[_0x56df('0x2e')])[_0x56df('0x24')]+_0x56df('0x39'),'AttachmentId':_0x1ad608['id']})['catch'](function(_0x350d34){logger[_0x56df('0x3c')](_0x5e160f[_0x56df('0x22')],'\x20notify\x20',JSON['stringify'](_0x350d34));});})[_0x56df('0x3d')](function(_0x21a3c8){logger[_0x56df('0x3c')](_0x5e160f['uniqueid'],_0x56df('0x3e'),JSON[_0x56df('0x3f')](_0x21a3c8));});});}logger[_0x56df('0x25')](_0x5e160f[_0x56df('0x22')],_0x56df('0x3e'));}};Fax[_0x56df('0x1d')][_0x56df('0x40')]=function(_0x33c5bd){if(this[_0x56df('0xf')][_0x33c5bd[_0x56df('0x22')]]){_[_0x56df('0x41')](this[_0x56df('0xc')][_0x33c5bd[_0x56df('0x22')]],_[_0x56df('0x42')](_0x33c5bd,['response',_0x56df('0x43')]));}};function updateStatus(_0x1af62e){if(_0x1af62e[_0x56df('0x44')]){faxMessage[_0x56df('0x45')](_0x1af62e[_0x56df('0x44')],{'failMessage':_0x56df('0x46')})[_0x56df('0x3a')](function(_0xd65645){ut[_0x56df('0x47')](_0x56df('0x48'),_0xd65645);})[_0x56df('0x3d')](function(_0xe7040b){ut[_0x56df('0x47')]('[Fax][Message][Error][NoUpdate1]',_0xe7040b);});}else{ut[_0x56df('0x47')](_0x56df('0x49'));}}Fax['prototype'][_0x56df('0x4a')]=function(_0x30935f,_0x475af5,_0x3aee6a){var _0x4a365d=this;var _0x534b9a={};if(_0x475af5){_0x534b9a={'read':_0x475af5};}else{_0x534b9a={'failMessage':_0x3aee6a};}if(this[_0x56df('0xf')][_0x30935f]['AttachmentId']){faxMessage['update'](this['actions'][_0x30935f][_0x56df('0x44')],_0x534b9a)['then'](function(_0x1f9e27){ut[_0x56df('0x47')](_0x56df('0x4b'),_0x1f9e27);})[_0x56df('0x3d')](function(_0x389157){ut[_0x56df('0x47')]('[Fax][Message][NoUpdate1]',_0x389157);})['finally'](function(){delete _0x4a365d[_0x56df('0xc')][_0x30935f];delete _0x4a365d[_0x56df('0xf')][_0x30935f];});}else{ut[_0x56df('0x47')](_0x56df('0x4c'));delete this[_0x56df('0xc')][_0x30935f];delete this['actions'][_0x30935f];}};Fax[_0x56df('0x1d')]['syncHangup']=function(_0x103b9a){var _0x1a7bcc=this;if(this[_0x56df('0xc')][_0x103b9a['uniqueid']]){if(this[_0x56df('0xf')][_0x103b9a[_0x56df('0x22')]]){this[_0x56df('0xc')][_0x103b9a['uniqueid']]['id']=this[_0x56df('0xf')][_0x103b9a[_0x56df('0x22')]]['id'];this[_0x56df('0xc')][_0x103b9a[_0x56df('0x22')]][_0x56df('0x24')]=this[_0x56df('0xf')][_0x103b9a[_0x56df('0x22')]][_0x56df('0x24')];}logger['info'](_0x103b9a[_0x56df('0x22')],this[_0x56df('0xf')][_0x103b9a[_0x56df('0x22')]]?_0x56df('0x4d'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x103b9a[_0x56df('0x22')]]));if(this[_0x56df('0xf')][_0x103b9a['uniqueid']]){if(this[_0x56df('0xc')][_0x103b9a[_0x56df('0x22')]][_0x56df('0x4e')]>0x0&&this['channels'][_0x103b9a[_0x56df('0x22')]][_0x56df('0x18')]===_0x56df('0x4f')){this['updateStatus'](_0x103b9a[_0x56df('0x22')],!![]);}else{this[_0x56df('0x4a')](_0x103b9a['uniqueid'],![],this[_0x56df('0xc')][_0x103b9a['uniqueid']][_0x56df('0x50')]?_0x56df('0x51')+this['channels'][_0x103b9a[_0x56df('0x22')]][_0x56df('0x50')]:_0x56df('0x52'));}}}};Fax[_0x56df('0x1d')][_0x56df('0x53')]=function(_0x13019d){var _0x241990=this;return new BPromise(function(_0x170e24,_0x10fe39){_0x241990['execOriginate'](_0x13019d,_0x241990[_0x56df('0xd')][_0x13019d[_0x56df('0x54')]])[_0x56df('0x3a')](function(_0x355b4b){ut[_0x56df('0x47')]('[Fax][execOriginate][success]',_0x355b4b);_0x170e24(ut[_0x56df('0x36')](_0x56df('0x55')));})[_0x56df('0x3d')](function(_0x2a8d7a){ut[_0x56df('0x47')](_0x56df('0x56'),_0x2a8d7a);updateStatus(_0x13019d);_0x10fe39(ut[_0x56df('0x36')](_0x56df('0x57')));});});};Fax['prototype'][_0x56df('0x58')]=function(_0x5ef020){var _0x481bdc=this;return new BPromise(function(_0x5e7861,_0x5766b8){var _0x23ff3c=_0x481bdc[_0x56df('0x59')](_0x481bdc[_0x56df('0xd')][_0x5ef020[_0x56df('0x54')]][_0x56df('0x5a')],_0x5ef020);if(_0x23ff3c[_0x56df('0x5b')]){_0x5e7861(ut['message'](_0x56df('0x5c')));}else{_0x5766b8(ut['message'](_0x23ff3c[_0x56df('0x36')]));}});};function originate(_0x195ca2,_0x131293,_0x16df76){return new BPromise(function(_0x1fe7b6,_0x30645d){if(_0x16df76){var _0x5e0c23=util[_0x56df('0x5d')]('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[_0x56df('0x38')](_0x195ca2[_0x56df('0x5e')])[_0x56df('0x24')],_0x195ca2['path']);gs['execute'](_0x5e0c23)[_0x56df('0x3a')](function(){_0x195ca2[_0x56df('0x5e')]=util[_0x56df('0x5d')](_0x56df('0x5f'),path[_0x56df('0x38')](_0x195ca2['path'])[_0x56df('0x60')],path['parse'](_0x195ca2['path'])[_0x56df('0x24')]);_0x131293[_0x56df('0x61')]=_0x195ca2['path'];ut[_0x56df('0x47')](_0x56df('0x62'),'');ami[_0x56df('0x63')](ut['variablesAction'](_0x195ca2,_0x131293))[_0x56df('0x3a')](function(_0x14882c){_0x1fe7b6(_0x14882c);})[_0x56df('0x3d')](function(_0x5e39cf){_0x30645d(_0x5e39cf);});})[_0x56df('0x3d')](function(_0x2af76d){_0x30645d(_0x2af76d);});}else{ami['Action'](ut[_0x56df('0x64')](_0x195ca2,_0x131293))['then'](function(_0xdc6800){_0x1fe7b6(_0xdc6800);})[_0x56df('0x3d')](function(_0x3c349b){_0x30645d(_0x3c349b);});}});}Fax[_0x56df('0x1d')][_0x56df('0x65')]=function(_0x471091,_0x5df8e0){var _0xfd1420=this;return new BPromise(function(_0x586047,_0x2cc02b){var _0x562f3a=uuid['v4']();var _0x223f7c=ut[_0x56df('0x66')](_0x471091,_0x5df8e0);_0xfd1420[_0x56df('0xf')][_0x562f3a]=new Action(_0x562f3a,_0x5df8e0,_0x471091);var _0x111b45=_0xfd1420['actions'][_0x562f3a];if(path[_0x56df('0x38')](_0x471091[_0x56df('0x5e')])['ext']==='.pdf'){originate(_0x111b45,_0x223f7c,!![])[_0x56df('0x3a')](function(_0x204fe3){_0x586047(_0x204fe3);})[_0x56df('0x3d')](function(_0x1636ae){_0x2cc02b(_0x1636ae);});}else{originate(_0x111b45,_0x223f7c,![])[_0x56df('0x3a')](function(_0x1095f3){_0x586047(_0x1095f3);})['catch'](function(_0x2f7fda){_0x2cc02b(_0x2f7fda);});}});};Fax[_0x56df('0x1d')]['isTrunkReachable']=function(_0x3d10c5){return!_[_0x56df('0x67')](_0x3d10c5)&&!_[_0x56df('0x67')](_0x3d10c5[_0x56df('0x24')])&&!_[_0x56df('0x67')](_0x3d10c5[_0x56df('0x68')])&&_0x3d10c5[_0x56df('0x68')]&&!_[_0x56df('0x67')](this[_0x56df('0xe')][util[_0x56df('0x5d')](_0x56df('0x69'),_0x3d10c5[_0x56df('0x24')])])&&!_[_0x56df('0x67')](this['trunks'][util[_0x56df('0x5d')](_0x56df('0x69'),_0x3d10c5[_0x56df('0x24')])][_0x56df('0x2d')])&&(this[_0x56df('0xe')][util[_0x56df('0x5d')]('SIP/%s',_0x3d10c5[_0x56df('0x24')])]['status']===_0x56df('0x6a')||this[_0x56df('0xe')][util[_0x56df('0x5d')](_0x56df('0x69'),_0x3d10c5[_0x56df('0x24')])][_0x56df('0x2d')]===_0x56df('0x6b'));};Fax['prototype']['checkTrunk']=function(_0x30f9cd,_0x2f3f15){if(!this[_0x56df('0x6c')](_0x30f9cd)){ut[_0x56df('0x47')](_0x56df('0x6d'),_['isNil'](_0x30f9cd)?'':_0x30f9cd[_0x56df('0x24')]+_0x56df('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x56df('0x67')](_0x2f3f15['fax'])){ut['logger'](_0x56df('0x6f'),JSON[_0x56df('0x3f')](_0x2f3f15));return{'isValid':![],'message':_0x56df('0x70')};}if(_[_0x56df('0x67')](_0x2f3f15[_0x56df('0x5e')])){ut[_0x56df('0x47')](_0x56df('0x71'),JSON[_0x56df('0x3f')](_0x2f3f15));return{'isValid':![],'message':_0x56df('0x72')};}return{'isValid':!![],'message':_0x56df('0x73')};};module[_0x56df('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index a8abd38..ec39032 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 _0x0809=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','then'];(function(_0x55f254,_0x503e0f){var _0x501aa6=function(_0x294c9c){while(--_0x294c9c){_0x55f254['push'](_0x55f254['shift']());}};_0x501aa6(++_0x503e0f);}(_0x0809,0x85));var _0x9080=function(_0x3dd426,_0x225206){_0x3dd426=_0x3dd426-0x0;var _0x1abec0=_0x0809[_0x3dd426];return _0x1abec0;};'use strict';var util=require(_0x9080('0x0'));var BPromise=require(_0x9080('0x1'));var logger=require(_0x9080('0x2'))(_0x9080('0x3'));var _=require(_0x9080('0x4'));var faxAccount=require(_0x9080('0x5'));function loggerCatch(_0xdf5298){return function(_0x522df3){logger['error'](_0xdf5298,util[_0x9080('0x6')](_0x522df3,{'showHidden':![],'depth':null}));};}exports[_0x9080('0x7')]=function(_0x2b625c,_0x1ab241){return BPromise[_0x9080('0x8')]()[_0x9080('0x9')](faxAccount['notify'](_0x2b625c,_0x1ab241))['catch'](loggerCatch(_0x9080('0xa')));}; \ No newline at end of file +var _0xfe1e=['resolve','catch','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x444990,_0x44196a){var _0x4b99de=function(_0x93733b){while(--_0x93733b){_0x444990['push'](_0x444990['shift']());}};_0x4b99de(++_0x44196a);}(_0xfe1e,0x84));var _0xefe1=function(_0x168ca4,_0x3e41be){_0x168ca4=_0x168ca4-0x0;var _0x312090=_0xfe1e[_0x168ca4];return _0x312090;};'use strict';var util=require(_0xefe1('0x0'));var BPromise=require(_0xefe1('0x1'));var logger=require(_0xefe1('0x2'))('preview');var _=require(_0xefe1('0x3'));var faxAccount=require(_0xefe1('0x4'));function loggerCatch(_0x4836be){return function(_0x4e28a3){logger[_0xefe1('0x5')](_0x4836be,util[_0xefe1('0x6')](_0x4e28a3,{'showHidden':![],'depth':null}));};}exports[_0xefe1('0x7')]=function(_0x2ea11b,_0x101e93){return BPromise[_0xefe1('0x8')]()['then'](faxAccount[_0xefe1('0x7')](_0x2ea11b,_0x101e93))[_0xefe1('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index c871fbd..5cbe0dd 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 _0x5c7f=['Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x3d7a9f,_0x24e0f1){var _0x13f5f1=function(_0x1fbbda){while(--_0x1fbbda){_0x3d7a9f['push'](_0x3d7a9f['shift']());}};_0x13f5f1(++_0x24e0f1);}(_0x5c7f,0x142));var _0xf5c7=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x5c7f[_0x58e469];return _0x4c01c5;};'use strict';var util=require(_0xf5c7('0x0'));var logger=require(_0xf5c7('0x1'))(_0xf5c7('0x2'));var BPromise=require(_0xf5c7('0x3'));var exec=require(_0xf5c7('0x4'))[_0xf5c7('0x5')];exports[_0xf5c7('0x6')]=function(_0x24dd6f){return new BPromise(function(_0x5deb78,_0x2a0862){exec(_0x24dd6f,function(_0x146c5a,_0x150fcd,_0x4cf26f){logger[_0xf5c7('0x7')](_0xf5c7('0x8'),_0x150fcd);if(_0x146c5a){logger['info'](_0xf5c7('0x8'),'\x20Error\x20:',util[_0xf5c7('0x9')](_0x146c5a,{'showHidden':![],'depth':null}),_0x150fcd,_0x4cf26f);_0x2a0862(_0x146c5a);}_0x5deb78(_0x150fcd);});});}; \ No newline at end of file +var _0x71bd=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process'];(function(_0x70d596,_0x305add){var _0x1e68ab=function(_0x301339){while(--_0x301339){_0x70d596['push'](_0x70d596['shift']());}};_0x1e68ab(++_0x305add);}(_0x71bd,0x192));var _0xd71b=function(_0xbeceb,_0x3e71f3){_0xbeceb=_0xbeceb-0x0;var _0x170da3=_0x71bd[_0xbeceb];return _0x170da3;};'use strict';var util=require('util');var logger=require(_0xd71b('0x0'))(_0xd71b('0x1'));var BPromise=require('bluebird');var exec=require(_0xd71b('0x2'))[_0xd71b('0x3')];exports[_0xd71b('0x4')]=function(_0x554090){return new BPromise(function(_0x1cd0e8,_0x46f5f7){exec(_0x554090,function(_0x4c6031,_0x7283aa,_0x53c4b1){logger[_0xd71b('0x5')]('Exec\x20gs',_0x7283aa);if(_0x4c6031){logger[_0xd71b('0x5')](_0xd71b('0x6'),_0xd71b('0x7'),util[_0xd71b('0x8')](_0x4c6031,{'showHidden':![],'depth':null}),_0x7283aa,_0x53c4b1);_0x46f5f7(_0x4c6031);}_0x1cd0e8(_0x7283aa);});});}; \ 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 13f46e3..bb538eb 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 _0xc80c=['moment','../../../../config/logger','fax','logger','inspect','addVariables','ecm','minrate','maxrate','format','modem','faxdetect','t38timeout','localstationid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util','lodash'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xc80c,0x106));var _0xcc80=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xc80c[_0x51c819];return _0x15c5d2;};'use strict';var util=require(_0xcc80('0x0'));var _=require(_0xcc80('0x1'));var moment=require(_0xcc80('0x2'));var logger=require(_0xcc80('0x3'))(_0xcc80('0x4'));exports['message']=function(_0x27ac6e){return{'message':_0x27ac6e};};exports[_0xcc80('0x5')]=function(_0x11ce96,_0x10c185){logger['info'](_0x11ce96,util[_0xcc80('0x6')](_0x10c185,{'showHidden':![],'depth':null}));};exports[_0xcc80('0x7')]=function(_0x18b178,_0x4aded9){var _0x1ab005={'XMF-ECM':_0x4aded9[_0xcc80('0x8')],'XMF-HEADERINFO':_0x4aded9['headerinfo'],'XMF-MINRATE':_0x4aded9[_0xcc80('0x9')],'XMF-MAXRATE':_0x4aded9[_0xcc80('0xa')],'XMF-MODEM':util[_0xcc80('0xb')]('\x22%s\x22',_0x4aded9[_0xcc80('0xc')]),'XMF-GATEWAY':_0x4aded9['gateway'],'XMF-FAXDETECT':_0x4aded9[_0xcc80('0xd')],'XMF-T38TIMEOUT':_0x4aded9[_0xcc80('0xe')],'XMF-LOCALSTATIONID':_0x4aded9[_0xcc80('0xf')],'XMF-PATH':_0x18b178['path']};return _0x1ab005;};exports['variablesAction']=function(_0x2b47f7,_0x458248){return{'actionid':_0x2b47f7['uniqueid'],'action':'originate','channel':_0x2b47f7[_0xcc80('0x10')],'Exten':_0xcc80('0x11'),'Context':_0xcc80('0x12'),'Priority':'1','callerid':util[_0xcc80('0xb')](_0xcc80('0x13'),_0x2b47f7[_0xcc80('0x14')]?_0x2b47f7['headerinfo']:'',_0x2b47f7['localstationid']),'variable':_0x458248,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2b47f7[_0xcc80('0x15')]};}; \ No newline at end of file +var _0x6be9=['../../../../config/logger','fax','message','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','util','lodash','moment'];(function(_0x52c1f6,_0x4eda0b){var _0x4df981=function(_0x71aa7){while(--_0x71aa7){_0x52c1f6['push'](_0x52c1f6['shift']());}};_0x4df981(++_0x4eda0b);}(_0x6be9,0x123));var _0x96be=function(_0x4cc511,_0xe5bcd1){_0x4cc511=_0x4cc511-0x0;var _0x3e71c1=_0x6be9[_0x4cc511];return _0x3e71c1;};'use strict';var util=require(_0x96be('0x0'));var _=require(_0x96be('0x1'));var moment=require(_0x96be('0x2'));var logger=require(_0x96be('0x3'))(_0x96be('0x4'));exports[_0x96be('0x5')]=function(_0x3fc273){return{'message':_0x3fc273};};exports['logger']=function(_0x500463,_0x235691){logger['info'](_0x500463,util[_0x96be('0x6')](_0x235691,{'showHidden':![],'depth':null}));};exports[_0x96be('0x7')]=function(_0x1d1542,_0x107ba1){var _0x58364b={'XMF-ECM':_0x107ba1[_0x96be('0x8')],'XMF-HEADERINFO':_0x107ba1[_0x96be('0x9')],'XMF-MINRATE':_0x107ba1[_0x96be('0xa')],'XMF-MAXRATE':_0x107ba1[_0x96be('0xb')],'XMF-MODEM':util[_0x96be('0xc')](_0x96be('0xd'),_0x107ba1[_0x96be('0xe')]),'XMF-GATEWAY':_0x107ba1['gateway'],'XMF-FAXDETECT':_0x107ba1['faxdetect'],'XMF-T38TIMEOUT':_0x107ba1[_0x96be('0xf')],'XMF-LOCALSTATIONID':_0x107ba1[_0x96be('0x10')],'XMF-PATH':_0x1d1542[_0x96be('0x11')]};return _0x58364b;};exports[_0x96be('0x12')]=function(_0x302e98,_0x5dd051){return{'actionid':_0x302e98[_0x96be('0x13')],'action':'originate','channel':_0x302e98['channel'],'Exten':_0x96be('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x96be('0xc')]('\x22%s\x22\x20<%s>',_0x302e98[_0x96be('0x9')]?_0x302e98['headerinfo']:'',_0x302e98[_0x96be('0x10')]),'variable':_0x5dd051,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x302e98[_0x96be('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6644b60..283c7bb 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 _0x4d41=['initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts'];(function(_0xe3cdae,_0x152d75){var _0x427679=function(_0x58539b){while(--_0x58539b){_0xe3cdae['push'](_0xe3cdae['shift']());}};_0x427679(++_0x152d75);}(_0x4d41,0xeb));var _0x14d4=function(_0x2bbd2d,_0x37c3c4){_0x2bbd2d=_0x2bbd2d-0x0;var _0x257dc9=_0x4d41[_0x2bbd2d];return _0x257dc9;};'use strict';var util=require(_0x14d4('0x0'));var moment=require(_0x14d4('0x1'));var server=require(_0x14d4('0x2'));var Realtime=require(_0x14d4('0x3'));var Report=require(_0x14d4('0x4'));var Acw=require(_0x14d4('0x5'));var Trigger=require(_0x14d4('0x6'));var Dialer=require('./dialer');var Preview=require(_0x14d4('0x7'));var Fax=require(_0x14d4('0x8'));var user=require(_0x14d4('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x14d4('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x14d4('0xb'));var trigger=require(_0x14d4('0xc'));var template=require(_0x14d4('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x14d4('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x14d4('0xf'));var salesforce=require(_0x14d4('0x10'));var sugarcrm=require(_0x14d4('0x11'));var freshdesk=require(_0x14d4('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x14d4('0x13'));var freshsales=require(_0x14d4('0x14'));var servicenow=require(_0x14d4('0x15'));var dynamics365=require(_0x14d4('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x14d4('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x14d4('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x14d4('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x14d4('0x19')]()[_0x14d4('0x1a')](user[_0x14d4('0x1b')]())['then'](realtime[_0x14d4('0x1c')]())[_0x14d4('0x1a')](user[_0x14d4('0x1d')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x1e')]())[_0x14d4('0x1a')](trunk[_0x14d4('0x1f')]())['then'](realtime['initTrunks']())[_0x14d4('0x1a')](voiceQueue[_0x14d4('0x20')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x21')]())[_0x14d4('0x1a')](trigger[_0x14d4('0x22')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x23')]())[_0x14d4('0x1a')](template[_0x14d4('0x24')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x25')]())[_0x14d4('0x1a')](zendesk[_0x14d4('0x26')]())[_0x14d4('0x1a')](realtime['initZendeskAccounts']())[_0x14d4('0x1a')](salesforce[_0x14d4('0x27')]())['then'](realtime['initSalesforceAccounts']())[_0x14d4('0x1a')](sugarcrm[_0x14d4('0x28')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x29')]())[_0x14d4('0x1a')](freshdesk[_0x14d4('0x2a')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x2b')]())[_0x14d4('0x1a')](desk[_0x14d4('0x2c')]())['then'](realtime[_0x14d4('0x2d')]())['then'](zoho[_0x14d4('0x2e')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x2f')]())[_0x14d4('0x1a')](vtiger[_0x14d4('0x30')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x31')]())['then'](freshsales['getFreshsalesAccounts']())[_0x14d4('0x1a')](realtime[_0x14d4('0x32')]())[_0x14d4('0x1a')](servicenow[_0x14d4('0x33')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x34')]())[_0x14d4('0x1a')](dynamics365[_0x14d4('0x35')]())['then'](realtime[_0x14d4('0x36')]())[_0x14d4('0x1a')](campaign[_0x14d4('0x37')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x38')]())[_0x14d4('0x1a')](voiceExtension[_0x14d4('0x39')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x3a')]())['then'](faxAccount[_0x14d4('0x3b')]())['then'](realtime[_0x14d4('0x3c')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x14d4('0x19')]()[_0x14d4('0x1a')](voiceQueueReport[_0x14d4('0x3d')]())[_0x14d4('0x1a')](realtime[_0x14d4('0x3e')]())[_0x14d4('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x14d4('0x1a')](realtime[_0x14d4('0x3f')]())[_0x14d4('0x1a')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x14d4('0x40')]())[_0x14d4('0x1a')](voiceCallReport[_0x14d4('0x41')]())[_0x14d4('0x1a')](realtime['initVoiceCallReports']())[_0x14d4('0x42')](function(_0x497554){logger['error'](_0x14d4('0x43'),util[_0x14d4('0x44')](_0x497554,{'showHidden':![],'depth':null}));});}function main(){return server[_0x14d4('0x45')](realtime,preview,fax)[_0x14d4('0x1a')](function(){return initRealtime();})[_0x14d4('0x1a')](function(){return initParams();})[_0x14d4('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3becce){logger['error'](_0x14d4('0x46'),util[_0x14d4('0x44')](_0x3becce,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4856=['./trigger','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','listen','sync','[index.js][main]','inspect','util','./server','./report','./acw'];(function(_0x5d67be,_0x4c78cf){var _0x2e2a0a=function(_0x58c886){while(--_0x58c886){_0x5d67be['push'](_0x5d67be['shift']());}};_0x2e2a0a(++_0x4c78cf);}(_0x4856,0xc2));var _0x6485=function(_0x30806e,_0x41bb0d){_0x30806e=_0x30806e-0x0;var _0x2777c6=_0x4856[_0x30806e];return _0x2777c6;};'use strict';var util=require(_0x6485('0x0'));var moment=require('moment');var server=require(_0x6485('0x1'));var Realtime=require('./realtime');var Report=require(_0x6485('0x2'));var Acw=require(_0x6485('0x3'));var Trigger=require(_0x6485('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x6485('0x5'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x6485('0x6'));var voiceCallReport=require(_0x6485('0x7'));var trunk=require(_0x6485('0x8'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x6485('0x9'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x6485('0xa'));var zendesk=require(_0x6485('0xb'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x6485('0xc'));var freshdesk=require(_0x6485('0xd'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x6485('0xe'));var vtiger=require(_0x6485('0xf'));var freshsales=require(_0x6485('0x10'));var servicenow=require(_0x6485('0x11'));var dynamics365=require(_0x6485('0x12'));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(_0x6485('0x13'))(_0x6485('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6485('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x6485('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6485('0x17')]()[_0x6485('0x18')](user[_0x6485('0x19')]())['then'](realtime[_0x6485('0x1a')]())[_0x6485('0x18')](user[_0x6485('0x1b')]())[_0x6485('0x18')](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0x6485('0x18')](realtime[_0x6485('0x1c')]())[_0x6485('0x18')](voiceQueue['getVoiceQueues']())[_0x6485('0x18')](realtime[_0x6485('0x1d')]())[_0x6485('0x18')](trigger[_0x6485('0x1e')]())['then'](realtime[_0x6485('0x1f')]())[_0x6485('0x18')](template[_0x6485('0x20')]())[_0x6485('0x18')](realtime[_0x6485('0x21')]())[_0x6485('0x18')](zendesk['getZendeskAccounts']())['then'](realtime[_0x6485('0x22')]())['then'](salesforce[_0x6485('0x23')]())[_0x6485('0x18')](realtime[_0x6485('0x24')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x6485('0x18')](realtime[_0x6485('0x25')]())[_0x6485('0x18')](freshdesk[_0x6485('0x26')]())[_0x6485('0x18')](realtime[_0x6485('0x27')]())[_0x6485('0x18')](desk['getDeskAccounts']())[_0x6485('0x18')](realtime[_0x6485('0x28')]())[_0x6485('0x18')](zoho[_0x6485('0x29')]())[_0x6485('0x18')](realtime['initZohoAccounts']())[_0x6485('0x18')](vtiger[_0x6485('0x2a')]())[_0x6485('0x18')](realtime['initVtigerAccounts']())[_0x6485('0x18')](freshsales['getFreshsalesAccounts']())[_0x6485('0x18')](realtime[_0x6485('0x2b')]())[_0x6485('0x18')](servicenow[_0x6485('0x2c')]())[_0x6485('0x18')](realtime[_0x6485('0x2d')]())[_0x6485('0x18')](dynamics365['getDynamics365Accounts']())[_0x6485('0x18')](realtime[_0x6485('0x2e')]())[_0x6485('0x18')](campaign[_0x6485('0x2f')]())[_0x6485('0x18')](realtime[_0x6485('0x30')]())['then'](voiceExtension[_0x6485('0x31')]())[_0x6485('0x18')](realtime['initVoiceExtensions']())[_0x6485('0x18')](faxAccount[_0x6485('0x32')]())['then'](realtime[_0x6485('0x33')]())[_0x6485('0x18')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x6485('0x18')](voiceQueueReport[_0x6485('0x34')]())[_0x6485('0x18')](realtime[_0x6485('0x35')]())[_0x6485('0x18')](cmHopperHistory[_0x6485('0x36')]())[_0x6485('0x18')](realtime[_0x6485('0x37')]())['then'](cmHopperHistory[_0x6485('0x38')]())[_0x6485('0x18')](realtime[_0x6485('0x39')]())[_0x6485('0x18')](voiceCallReport[_0x6485('0x3a')]())['then'](realtime[_0x6485('0x3b')]())[_0x6485('0x3c')](function(_0xd93468){logger[_0x6485('0x3d')]('[index.js][initParams]',util['inspect'](_0xd93468,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6485('0x3e')](realtime,preview,fax)[_0x6485('0x18')](function(){return initRealtime();})[_0x6485('0x18')](function(){return initParams();})[_0x6485('0x18')](function(){report[_0x6485('0x3f')]();setInterval(initRealtime,0x1388);})[_0x6485('0x3c')](function(_0x1747c9){logger[_0x6485('0x3d')](_0x6485('0x40'),util[_0x6485('0x41')](_0x1747c9,{'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 30041f1..b997b49 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 _0xedcb=['state','status','unknown','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','idle','inuse','voiceStatus','statePause','toNumber','format','stateTime','stringify','user:%s','emit','user:ami:update','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname'];(function(_0xf495c4,_0x3cfb32){var _0xa1f638=function(_0x1ecec2){while(--_0x1ecec2){_0xf495c4['push'](_0xf495c4['shift']());}};_0xa1f638(++_0x3cfb32);}(_0xedcb,0x1eb));var _0xbedc=function(_0x49d23b,_0xe79152){_0x49d23b=_0x49d23b-0x0;var _0x35edd1=_0xedcb[_0x49d23b];return _0x35edd1;};'use strict';var _=require('lodash');var util=require(_0xbedc('0x0'));var moment=require(_0xbedc('0x1'));var md5=require(_0xbedc('0x2'));var Redis=require(_0xbedc('0x3'));var config=require(_0xbedc('0x4'));config[_0xbedc('0x5')]=_[_0xbedc('0x6')](config['redis'],{'host':_0xbedc('0x7'),'port':0x18eb});var io=require(_0xbedc('0x8'))(new Redis(config['redis']));function Agent(_0x51fc15){this['id']=_0x51fc15['id']||0x0;this['name']=_0x51fc15[_0xbedc('0x9')]||'';this['email']=_0x51fc15[_0xbedc('0xa')]||'';this[_0xbedc('0xb')]=_0x51fc15['accountcode']||'';this['fullname']=_0x51fc15[_0xbedc('0xc')]||'';this[_0xbedc('0xd')]='unknown';this['stateTime']=0x0;this[_0xbedc('0xe')]=_0xbedc('0xf');this[_0xbedc('0x10')]='';this[_0xbedc('0x11')]='';this[_0xbedc('0x12')]='';this[_0xbedc('0x13')]='';this[_0xbedc('0x14')]=_0x51fc15[_0xbedc('0x14')]||![];this['voiceStatus']='unknown';this[_0xbedc('0x15')]=0x0;this[_0xbedc('0x16')]='';this[_0xbedc('0x17')]='';this[_0xbedc('0x18')]=![];this[_0xbedc('0x19')]=![];this[_0xbedc('0x2')]='';}Agent[_0xbedc('0x1a')][_0xbedc('0x1b')]=function(_0x9054d3){var _0x3ea354;if(_0x9054d3&&_0x9054d3['state']){_0x3ea354=_0x9054d3[_0xbedc('0xd')]['toLowerCase']();switch(_0x3ea354){case _0xbedc('0x1c'):_0x3ea354=_0xbedc('0x1d');break;case _0xbedc('0x1e'):_0x3ea354='talking';break;}}if(_0x3ea354&&this[_0xbedc('0x1f')]!==_0x3ea354||_0x9054d3[_0xbedc('0x20')]){this[_0xbedc('0x15')]=_[_0xbedc('0x21')](moment()[_0xbedc('0x22')]('x'));}if(_0x3ea354){this[_0xbedc('0x1f')]=_0x3ea354;}var _0xbdb9b9={'id':this['id'],'name':this[_0xbedc('0x9')],'email':this['email'],'accountcode':this[_0xbedc('0xb')],'fullname':this[_0xbedc('0xc')],'state':this['state'],'stateTime':this[_0xbedc('0x23')],'status':this[_0xbedc('0xe')],'address':this[_0xbedc('0x10')],'online':this[_0xbedc('0x14')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xbedc('0x15')],'voiceStatusCallerIdNumber':this[_0xbedc('0x16')],'voiceStatusQueue':this[_0xbedc('0x17')],'interface':this['interface'],'onhold':this['onhold']};var _0x3f6ec9=md5(JSON[_0xbedc('0x24')](_0xbdb9b9));if(this['md5']!==_0x3f6ec9){this[_0xbedc('0x2')]=_0x3f6ec9;io['to'](util[_0xbedc('0x22')](_0xbedc('0x25'),_0xbdb9b9[_0xbedc('0x9')]))[_0xbedc('0x26')](_0xbedc('0x27'),_['omit'](_0xbdb9b9,[_0xbedc('0x14')]));io[_0xbedc('0x26')](_0xbedc('0x28'),_0xbdb9b9);}};module[_0xbedc('0x29')]=Agent; \ No newline at end of file +var _0x9d7a=['md5','prototype','updateStatusRealtime','toLowerCase','idle','inuse','statePause','voiceStatusQueue','stringify','format','user:%s','emit','user:ami:update','omit','user:presence','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local'];(function(_0x2215dc,_0x324ffa){var _0x171300=function(_0x4838ea){while(--_0x4838ea){_0x2215dc['push'](_0x2215dc['shift']());}};_0x171300(++_0x324ffa);}(_0x9d7a,0x18a));var _0xa9d7=function(_0x4ed96c,_0x273123){_0x4ed96c=_0x4ed96c-0x0;var _0x3e7abc=_0x9d7a[_0x4ed96c];return _0x3e7abc;};'use strict';var _=require(_0xa9d7('0x0'));var util=require(_0xa9d7('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xa9d7('0x2'));var config=require(_0xa9d7('0x3'));config[_0xa9d7('0x4')]=_[_0xa9d7('0x5')](config[_0xa9d7('0x4')],{'host':_0xa9d7('0x6'),'port':0x18eb});var io=require(_0xa9d7('0x7'))(new Redis(config['redis']));function Agent(_0x443a52){this['id']=_0x443a52['id']||0x0;this[_0xa9d7('0x8')]=_0x443a52[_0xa9d7('0x8')]||'';this[_0xa9d7('0x9')]=_0x443a52[_0xa9d7('0x9')]||'';this[_0xa9d7('0xa')]=_0x443a52['accountcode']||'';this[_0xa9d7('0xb')]=_0x443a52[_0xa9d7('0xb')]||'';this[_0xa9d7('0xc')]=_0xa9d7('0xd');this[_0xa9d7('0xe')]=0x0;this[_0xa9d7('0xf')]='unknown';this[_0xa9d7('0x10')]='';this[_0xa9d7('0x11')]='';this[_0xa9d7('0x12')]='';this[_0xa9d7('0x13')]='';this['online']=_0x443a52[_0xa9d7('0x14')]||![];this[_0xa9d7('0x15')]='unknown';this[_0xa9d7('0x16')]=0x0;this[_0xa9d7('0x17')]='';this['voiceStatusQueue']='';this[_0xa9d7('0x18')]=![];this[_0xa9d7('0x19')]=![];this[_0xa9d7('0x1a')]='';}Agent[_0xa9d7('0x1b')][_0xa9d7('0x1c')]=function(_0x1e1863){var _0x4b54d9;if(_0x1e1863&&_0x1e1863[_0xa9d7('0xc')]){_0x4b54d9=_0x1e1863[_0xa9d7('0xc')][_0xa9d7('0x1d')]();switch(_0x4b54d9){case'not_inuse':_0x4b54d9=_0xa9d7('0x1e');break;case _0xa9d7('0x1f'):_0x4b54d9='talking';break;}}if(_0x4b54d9&&this[_0xa9d7('0x15')]!==_0x4b54d9||_0x1e1863[_0xa9d7('0x20')]){this[_0xa9d7('0x16')]=_['toNumber'](moment()['format']('x'));}if(_0x4b54d9){this[_0xa9d7('0x15')]=_0x4b54d9;}var _0x123907={'id':this['id'],'name':this[_0xa9d7('0x8')],'email':this['email'],'accountcode':this[_0xa9d7('0xa')],'fullname':this[_0xa9d7('0xb')],'state':this[_0xa9d7('0xc')],'stateTime':this[_0xa9d7('0xe')],'status':this[_0xa9d7('0xf')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0xa9d7('0x15')],'voiceStatusTime':this[_0xa9d7('0x16')],'voiceStatusCallerIdNumber':this[_0xa9d7('0x17')],'voiceStatusQueue':this[_0xa9d7('0x21')],'interface':this[_0xa9d7('0x13')],'onhold':this['onhold']};var _0x5d22c7=md5(JSON[_0xa9d7('0x22')](_0x123907));if(this[_0xa9d7('0x1a')]!==_0x5d22c7){this['md5']=_0x5d22c7;io['to'](util[_0xa9d7('0x23')](_0xa9d7('0x24'),_0x123907[_0xa9d7('0x8')]))[_0xa9d7('0x25')](_0xa9d7('0x26'),_[_0xa9d7('0x27')](_0x123907,['online']));io[_0xa9d7('0x25')](_0xa9d7('0x28'),_0x123907);}};module[_0xa9d7('0x29')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a77df38..6d7e13a 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 _0x4ebf=['ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ebf,0xe7));var _0xf4eb=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x4ebf[_0x102e37];return _0x35a07c;};'use strict';function Campaign(_0x264386){this['id']=_0x264386['id']||0x0;this[_0xf4eb('0x0')]=_0x264386[_0xf4eb('0x0')]||'';this[_0xf4eb('0x1')]=_0x264386[_0xf4eb('0x1')]||_0xf4eb('0x2');this[_0xf4eb('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xf4eb('0x4')]=0x0;this[_0xf4eb('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xf4eb('0x6')]=_0x264386[_0xf4eb('0x6')];this[_0xf4eb('0x7')]=_0x264386[_0xf4eb('0x7')];this['dialTimezone']=_0x264386[_0xf4eb('0x8')]||null;this[_0xf4eb('0x9')]=_0x264386[_0xf4eb('0x9')]?_0x264386[_0xf4eb('0x9')]:null;this['dialOriginateCallerIdName']=_0x264386[_0xf4eb('0xa')];this[_0xf4eb('0xb')]=_0x264386[_0xf4eb('0xb')];this[_0xf4eb('0xc')]=_0x264386[_0xf4eb('0xc')]||0x1e;this[_0xf4eb('0xd')]=_0x264386[_0xf4eb('0xd')];this[_0xf4eb('0xe')]=_0x264386['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x264386[_0xf4eb('0xf')];this['dialBusyRetryFrequency']=_0x264386[_0xf4eb('0x10')];this[_0xf4eb('0x11')]=_0x264386[_0xf4eb('0x11')];this[_0xf4eb('0x12')]=_0x264386['dialNoAnswerRetryFrequency'];this[_0xf4eb('0x13')]=_0x264386[_0xf4eb('0x13')];this['dialNoSuchNumberMaxRetry']=_0x264386['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x264386[_0xf4eb('0x14')]||0x96;this['dialDropMaxRetry']=_0x264386[_0xf4eb('0x15')]||0x3;this[_0xf4eb('0x16')]=_0x264386[_0xf4eb('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x264386[_0xf4eb('0x17')]||0x3;this[_0xf4eb('0x18')]=_0x264386[_0xf4eb('0x18')]||0x96;this[_0xf4eb('0x19')]=_0x264386[_0xf4eb('0x19')]||0x3;this[_0xf4eb('0x1a')]=_0x264386[_0xf4eb('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x264386['dialAgentRejectMaxRetry']||0x3;this[_0xf4eb('0x1b')]=_0x264386[_0xf4eb('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x264386['dialOrderByScheduledAt']||'DESC';this[_0xf4eb('0x1c')]=_0x264386[_0xf4eb('0x1c')]||undefined;this[_0xf4eb('0x1d')]=_0x264386['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xf4eb('0x1e')]=_0x264386[_0xf4eb('0x1e')]||undefined;this[_0xf4eb('0x1f')]=_0x264386['TrunkBackup']?_0x264386[_0xf4eb('0x1f')]:undefined;this[_0xf4eb('0x20')]=_0x264386[_0xf4eb('0x20')]?_0x264386[_0xf4eb('0x20')]:undefined;this[_0xf4eb('0x21')]=_0x264386[_0xf4eb('0x21')]?_0x264386[_0xf4eb('0x21')]:undefined;this[_0xf4eb('0x22')]=_0x264386[_0xf4eb('0x22')]?_0x264386['SquareProject']:undefined;this[_0xf4eb('0x23')]=_0x264386[_0xf4eb('0x22')]?_0x264386[_0xf4eb('0x22')][_0xf4eb('0x0')]:undefined;this['dialAMDActive']=_0x264386[_0xf4eb('0x24')]||![];this[_0xf4eb('0x25')]=_0x264386[_0xf4eb('0x25')];this['dialAMDGreeting']=_0x264386[_0xf4eb('0x26')];this[_0xf4eb('0x27')]=_0x264386[_0xf4eb('0x27')];this['dialAMDTotalAnalysisTime']=_0x264386[_0xf4eb('0x28')];this[_0xf4eb('0x29')]=_0x264386[_0xf4eb('0x29')];this[_0xf4eb('0x2a')]=_0x264386[_0xf4eb('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x264386[_0xf4eb('0x2b')];this[_0xf4eb('0x2c')]=_0x264386[_0xf4eb('0x2c')];this['dialAMDMaximumWordLength']=_0x264386[_0xf4eb('0x2d')];}module[_0xf4eb('0x2e')]=Campaign; \ No newline at end of file +var _0x5bbe=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x5bbe,0x1a4));var _0xe5bb=function(_0x5bf61f,_0x12cafd){_0x5bf61f=_0x5bf61f-0x0;var _0x608e58=_0x5bbe[_0x5bf61f];return _0x608e58;};'use strict';function Campaign(_0x4464e1){this['id']=_0x4464e1['id']||0x0;this['name']=_0x4464e1[_0xe5bb('0x0')]||'';this['type']=_0x4464e1[_0xe5bb('0x1')]||'campaign';this[_0xe5bb('0x2')]=0x0;this[_0xe5bb('0x3')]=0x0;this[_0xe5bb('0x4')]=0x0;this[_0xe5bb('0x5')]=0x0;this['message']='';this[_0xe5bb('0x6')]=!![];this['active']=_0x4464e1[_0xe5bb('0x7')];this[_0xe5bb('0x8')]=_0x4464e1[_0xe5bb('0x8')];this['dialTimezone']=_0x4464e1[_0xe5bb('0x9')]||null;this[_0xe5bb('0xa')]=_0x4464e1['dialGlobalInterval']?_0x4464e1[_0xe5bb('0xa')]:null;this[_0xe5bb('0xb')]=_0x4464e1['dialOriginateCallerIdName'];this[_0xe5bb('0xc')]=_0x4464e1[_0xe5bb('0xc')];this['dialOriginateTimeout']=_0x4464e1[_0xe5bb('0xd')]||0x1e;this[_0xe5bb('0xe')]=_0x4464e1[_0xe5bb('0xe')];this[_0xe5bb('0xf')]=_0x4464e1['dialCongestionRetryFrequency'];this[_0xe5bb('0x10')]=_0x4464e1[_0xe5bb('0x10')];this[_0xe5bb('0x11')]=_0x4464e1[_0xe5bb('0x11')];this[_0xe5bb('0x12')]=_0x4464e1[_0xe5bb('0x12')];this[_0xe5bb('0x13')]=_0x4464e1[_0xe5bb('0x13')];this['dialGlobalMaxRetry']=_0x4464e1['dialGlobalMaxRetry'];this[_0xe5bb('0x14')]=_0x4464e1['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4464e1['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x4464e1['dialDropMaxRetry']||0x3;this[_0xe5bb('0x15')]=_0x4464e1[_0xe5bb('0x15')]||0x96;this[_0xe5bb('0x16')]=_0x4464e1[_0xe5bb('0x16')]||0x3;this[_0xe5bb('0x17')]=_0x4464e1['dialAbandonedRetryFrequency']||0x96;this[_0xe5bb('0x18')]=_0x4464e1['dialMachineMaxRetry']||0x3;this[_0xe5bb('0x19')]=_0x4464e1[_0xe5bb('0x19')]||0x96;this[_0xe5bb('0x1a')]=_0x4464e1[_0xe5bb('0x1a')]||0x3;this[_0xe5bb('0x1b')]=_0x4464e1[_0xe5bb('0x1b')]||0x96;this[_0xe5bb('0x1c')]=_0x4464e1['dialOrderByScheduledAt']||_0xe5bb('0x1d');this['dialPrefix']=_0x4464e1[_0xe5bb('0x1e')]||undefined;this[_0xe5bb('0x1f')]=_0x4464e1[_0xe5bb('0x1f')]||undefined;this[_0xe5bb('0x20')]=_0x4464e1['dialCutDigit']||undefined;this['TrunkBackup']=_0x4464e1['TrunkBackup']?_0x4464e1[_0xe5bb('0x21')]:undefined;this[_0xe5bb('0x22')]=_0x4464e1[_0xe5bb('0x22')]?_0x4464e1['Trunk']:undefined;this['Interval']=_0x4464e1[_0xe5bb('0x23')]?_0x4464e1['Interval']:undefined;this[_0xe5bb('0x24')]=_0x4464e1[_0xe5bb('0x24')]?_0x4464e1['SquareProject']:undefined;this[_0xe5bb('0x25')]=_0x4464e1[_0xe5bb('0x24')]?_0x4464e1[_0xe5bb('0x24')][_0xe5bb('0x0')]:undefined;this[_0xe5bb('0x26')]=_0x4464e1[_0xe5bb('0x26')]||![];this['dialAMDInitialSilence']=_0x4464e1[_0xe5bb('0x27')];this[_0xe5bb('0x28')]=_0x4464e1['dialAMDGreeting'];this[_0xe5bb('0x29')]=_0x4464e1[_0xe5bb('0x29')];this['dialAMDTotalAnalysisTime']=_0x4464e1[_0xe5bb('0x2a')];this[_0xe5bb('0x2b')]=_0x4464e1[_0xe5bb('0x2b')];this['dialAMDBetweenWordsSilence']=_0x4464e1[_0xe5bb('0x2c')];this[_0xe5bb('0x2d')]=_0x4464e1[_0xe5bb('0x2d')];this[_0xe5bb('0x2e')]=_0x4464e1['dialAMDSilenceThreshold'];this[_0xe5bb('0x2f')]=_0x4464e1[_0xe5bb('0x2f')];}module[_0xe5bb('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a266e8b..8733a23 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 _0xc306=['unmanaged','abandoned','lastdata','duration','billableseconds','type','monitor','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','linkedid','exten','answered','answertime','endtime'];(function(_0x464e81,_0x356c78){var _0xfc7ed6=function(_0x33b3f0){while(--_0x33b3f0){_0x464e81['push'](_0x464e81['shift']());}};_0xfc7ed6(++_0x356c78);}(_0xc306,0x1a9));var _0x6c30=function(_0x3b0e83,_0x56e1e3){_0x3b0e83=_0x3b0e83-0x0;var _0x4b4b9d=_0xc306[_0x3b0e83];return _0x4b4b9d;};'use strict';function Channel(){this[_0x6c30('0x0')]=null;this['channel']='';this[_0x6c30('0x1')]='';this[_0x6c30('0x2')]=0x0;this[_0x6c30('0x3')]='';this[_0x6c30('0x4')]=undefined;this[_0x6c30('0x5')]=undefined;this['accountcode']=0x0;this[_0x6c30('0x6')]='';this['uniqueid']=0x0;this[_0x6c30('0x7')]=0x0;this[_0x6c30('0x8')]=0x0;this[_0x6c30('0x9')]=![];this[_0x6c30('0xa')]=null;this[_0x6c30('0xb')]=null;this[_0x6c30('0xc')]=![];this[_0x6c30('0xd')]=![];this['lastapplication']='';this[_0x6c30('0xe')]='';this[_0x6c30('0xf')]=0x0;this[_0x6c30('0x10')]=0x0;this['holdtime']=0x0;this[_0x6c30('0x11')]=null;this['tag']=null;this['disposition']=null;this[_0x6c30('0x12')]=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this[_0x6c30('0x13')]=undefined;this[_0x6c30('0x14')]=undefined;this[_0x6c30('0x15')]=undefined;this['mohtime']=0x0;}module[_0x6c30('0x16')]=Channel; \ No newline at end of file +var _0x8ff4=['answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','type','disposition','monitor','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered'];(function(_0x23188a,_0x3da191){var _0x4e22dc=function(_0x27e405){while(--_0x27e405){_0x23188a['push'](_0x23188a['shift']());}};_0x4e22dc(++_0x3da191);}(_0x8ff4,0x11f));var _0x48ff=function(_0x722d30,_0x1633a3){_0x722d30=_0x722d30-0x0;var _0x22b826=_0x8ff4[_0x722d30];return _0x22b826;};'use strict';function Channel(){this[_0x48ff('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x48ff('0x1')]=0x0;this[_0x48ff('0x2')]='';this['connectedlinenum']=undefined;this[_0x48ff('0x3')]=undefined;this[_0x48ff('0x4')]=0x0;this[_0x48ff('0x5')]='';this[_0x48ff('0x6')]=0x0;this[_0x48ff('0x7')]=0x0;this[_0x48ff('0x8')]=0x0;this[_0x48ff('0x9')]=![];this[_0x48ff('0xa')]=null;this[_0x48ff('0xb')]=null;this[_0x48ff('0xc')]=![];this[_0x48ff('0xd')]=![];this[_0x48ff('0xe')]='';this[_0x48ff('0xf')]='';this[_0x48ff('0x10')]=0x0;this['billableseconds']=0x0;this[_0x48ff('0x11')]=0x0;this[_0x48ff('0x12')]=null;this['tag']=null;this[_0x48ff('0x13')]=null;this[_0x48ff('0x14')]=![];this['monitorFilename']=null;this[_0x48ff('0x15')]=null;this[_0x48ff('0x16')]=[];this['transfercalleridnum']=undefined;this[_0x48ff('0x17')]=undefined;this[_0x48ff('0x18')]=undefined;this[_0x48ff('0x19')]=0x0;}module[_0x48ff('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c20f032..0f7e8e3 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 _0x0b60=['type','Configurations','name','username','remoteUri','authType','password','consumerKey','token'];(function(_0x1ed579,_0x206ebc){var _0x793273=function(_0x56c373){while(--_0x56c373){_0x1ed579['push'](_0x1ed579['shift']());}};_0x793273(++_0x206ebc);}(_0x0b60,0x6e));var _0x00b6=function(_0x2c984d,_0x5a6f2f){_0x2c984d=_0x2c984d-0x0;var _0x31df62=_0x0b60[_0x2c984d];return _0x31df62;};'use strict';function DeskAccount(_0xcde2ea){this['id']=_0xcde2ea['id']||0x0;this['name']=_0xcde2ea[_0x00b6('0x0')]||'';this[_0x00b6('0x1')]=_0xcde2ea[_0x00b6('0x1')]||'';this[_0x00b6('0x2')]=_0xcde2ea[_0x00b6('0x2')]||'';this[_0x00b6('0x3')]=_0xcde2ea[_0x00b6('0x3')]||'';this[_0x00b6('0x4')]=_0xcde2ea['password']||'';this[_0x00b6('0x5')]=_0xcde2ea[_0x00b6('0x5')]||'';this['consumerSecret']=_0xcde2ea['consumerSecret']||'';this[_0x00b6('0x6')]=_0xcde2ea[_0x00b6('0x6')]||'';this['tokenSecret']=_0xcde2ea['tokenSecret']||'';this[_0x00b6('0x7')]=_0xcde2ea[_0x00b6('0x7')]||'';this['serverUrl']=_0xcde2ea['serverUrl']||'';this[_0x00b6('0x8')]=_0xcde2ea[_0x00b6('0x8')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xbf4d=['authType','password','consumerKey','consumerSecret','token','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x124da3,_0x52707f){var _0x4588bc=function(_0x3f34e4){while(--_0x3f34e4){_0x124da3['push'](_0x124da3['shift']());}};_0x4588bc(++_0x52707f);}(_0xbf4d,0x152));var _0xdbf4=function(_0x156e99,_0x2bf27e){_0x156e99=_0x156e99-0x0;var _0x18870e=_0xbf4d[_0x156e99];return _0x18870e;};'use strict';function DeskAccount(_0x3f3c5c){this['id']=_0x3f3c5c['id']||0x0;this[_0xdbf4('0x0')]=_0x3f3c5c[_0xdbf4('0x0')]||'';this[_0xdbf4('0x1')]=_0x3f3c5c[_0xdbf4('0x1')]||'';this[_0xdbf4('0x2')]=_0x3f3c5c['remoteUri']||'';this[_0xdbf4('0x3')]=_0x3f3c5c[_0xdbf4('0x3')]||'';this[_0xdbf4('0x4')]=_0x3f3c5c[_0xdbf4('0x4')]||'';this[_0xdbf4('0x5')]=_0x3f3c5c[_0xdbf4('0x5')]||'';this[_0xdbf4('0x6')]=_0x3f3c5c[_0xdbf4('0x6')]||'';this[_0xdbf4('0x7')]=_0x3f3c5c['token']||'';this['tokenSecret']=_0x3f3c5c['tokenSecret']||'';this['type']=_0x3f3c5c[_0xdbf4('0x8')]||'';this[_0xdbf4('0x9')]=_0x3f3c5c['serverUrl']||'';this[_0xdbf4('0xa')]=_0x3f3c5c['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ce2778a..827d2e8 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 _0x91ce=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x91ce,0x129));var _0xe91c=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0x91ce[_0x45ce90];return _0x313c45;};'use strict';function Dynamics365Account(_0x388637){this['id']=_0x388637['id']||0x0;this['name']=_0x388637[_0xe91c('0x0')]||'';this['username']=_0x388637[_0xe91c('0x1')]||'';this[_0xe91c('0x2')]=_0x388637[_0xe91c('0x2')]||'';this[_0xe91c('0x3')]=_0x388637[_0xe91c('0x3')]||'';this[_0xe91c('0x4')]=_0x388637[_0xe91c('0x4')]||'';this['clientId']=_0x388637[_0xe91c('0x5')]||'';this[_0xe91c('0x6')]=_0x388637[_0xe91c('0x6')]||{};this['serverUrl']=_0x388637[_0xe91c('0x7')]||'';this[_0xe91c('0x8')]=_0x388637[_0xe91c('0x8')]||![];this[_0xe91c('0x9')]=_0x388637[_0xe91c('0x9')]||{};this[_0xe91c('0xa')]=_0x388637[_0xe91c('0xa')]||{};}module[_0xe91c('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x57b3=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username'];(function(_0x4ab576,_0x198f34){var _0x458ae5=function(_0x2bcc12){while(--_0x2bcc12){_0x4ab576['push'](_0x4ab576['shift']());}};_0x458ae5(++_0x198f34);}(_0x57b3,0x195));var _0x357b=function(_0xd61039,_0x4c1371){_0xd61039=_0xd61039-0x0;var _0x2e9d81=_0x57b3[_0xd61039];return _0x2e9d81;};'use strict';function Dynamics365Account(_0x25e5d3){this['id']=_0x25e5d3['id']||0x0;this[_0x357b('0x0')]=_0x25e5d3[_0x357b('0x0')]||'';this[_0x357b('0x1')]=_0x25e5d3[_0x357b('0x1')]||'';this[_0x357b('0x2')]=_0x25e5d3[_0x357b('0x2')]||'';this[_0x357b('0x3')]=_0x25e5d3[_0x357b('0x3')]||'';this[_0x357b('0x4')]=_0x25e5d3[_0x357b('0x4')]||'';this['clientId']=_0x25e5d3[_0x357b('0x5')]||'';this[_0x357b('0x6')]=_0x25e5d3['clientSecret']||{};this['serverUrl']=_0x25e5d3[_0x357b('0x7')]||'';this['modernAuthentication']=_0x25e5d3[_0x357b('0x8')]||![];this[_0x357b('0x9')]=_0x25e5d3[_0x357b('0x9')]||{};this['CloudProvider']=_0x25e5d3[_0x357b('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 601b45d..14437c7 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 _0x129a=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x2aa87a,_0x4a251d){var _0x5b869b=function(_0x3e6c83){while(--_0x3e6c83){_0x2aa87a['push'](_0x2aa87a['shift']());}};_0x5b869b(++_0x4a251d);}(_0x129a,0x87));var _0xa129=function(_0x14e63a,_0x1e892d){_0x14e63a=_0x14e63a-0x0;var _0x53ac75=_0x129a[_0x14e63a];return _0x53ac75;};'use strict';function FaxAccount(_0x3c9545){this['id']=_0x3c9545['id']||0x0;this['name']=_0x3c9545['name']||'';this[_0xa129('0x0')]=_0x3c9545[_0xa129('0x0')];this[_0xa129('0x1')]=_0x3c9545['ecm'];this[_0xa129('0x2')]=_0x3c9545[_0xa129('0x2')];this[_0xa129('0x3')]=_0x3c9545['localstationid'];this[_0xa129('0x4')]=_0x3c9545[_0xa129('0x4')]||0x960;this[_0xa129('0x5')]=_0x3c9545[_0xa129('0x5')]||0x3840;this[_0xa129('0x6')]=_0x3c9545[_0xa129('0x6')]||_0xa129('0x7');this[_0xa129('0x8')]=_0x3c9545['gateway']||'no';this['faxdetect']=_0x3c9545[_0xa129('0x9')]||'no';this[_0xa129('0xa')]=_0x3c9545[_0xa129('0xa')]||0x1388;this[_0xa129('0xb')]=_0x3c9545[_0xa129('0xb')]||_0xa129('0xc');this[_0xa129('0xd')]=_0x3c9545['Trunk']?_0x3c9545[_0xa129('0xd')]:undefined;this[_0xa129('0xe')]=_0x3c9545[_0xa129('0xe')];this[_0xa129('0xf')]=_0x3c9545[_0xa129('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xa04a=['description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0x4ac7a4,_0x28825d){var _0x33d05b=function(_0x34d03f){while(--_0x34d03f){_0x4ac7a4['push'](_0x4ac7a4['shift']());}};_0x33d05b(++_0x28825d);}(_0xa04a,0x77));var _0xaa04=function(_0x479691,_0x1002be){_0x479691=_0x479691-0x0;var _0x32a5c1=_0xa04a[_0x479691];return _0x32a5c1;};'use strict';function FaxAccount(_0x4009c6){this['id']=_0x4009c6['id']||0x0;this[_0xaa04('0x0')]=_0x4009c6[_0xaa04('0x0')]||'';this[_0xaa04('0x1')]=_0x4009c6[_0xaa04('0x1')];this['ecm']=_0x4009c6[_0xaa04('0x2')];this['headerinfo']=_0x4009c6['headerinfo'];this[_0xaa04('0x3')]=_0x4009c6[_0xaa04('0x3')];this['minrate']=_0x4009c6[_0xaa04('0x4')]||0x960;this[_0xaa04('0x5')]=_0x4009c6[_0xaa04('0x5')]||0x3840;this[_0xaa04('0x6')]=_0x4009c6[_0xaa04('0x6')]||_0xaa04('0x7');this['gateway']=_0x4009c6['gateway']||'no';this[_0xaa04('0x8')]=_0x4009c6[_0xaa04('0x8')]||'no';this[_0xaa04('0x9')]=_0x4009c6[_0xaa04('0x9')]||0x1388;this[_0xaa04('0xa')]=_0x4009c6[_0xaa04('0xa')]||'SIP';this[_0xaa04('0xb')]=_0x4009c6[_0xaa04('0xb')]?_0x4009c6[_0xaa04('0xb')]:undefined;this[_0xaa04('0xc')]=_0x4009c6[_0xaa04('0xc')];this['key']=_0x4009c6[_0xaa04('0xd')];}module[_0xaa04('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b85605a..9601671 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 _0x66eb=['apiKey','token','serverUrl','Configurations','exports','name','username'];(function(_0x35a916,_0x83760d){var _0x37e891=function(_0x34f008){while(--_0x34f008){_0x35a916['push'](_0x35a916['shift']());}};_0x37e891(++_0x83760d);}(_0x66eb,0x1da));var _0xb66e=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x66eb[_0x4358f5];return _0x4d8104;};'use strict';function FreshdeskAccount(_0x412d63){this['id']=_0x412d63['id']||0x0;this['name']=_0x412d63[_0xb66e('0x0')]||'';this[_0xb66e('0x1')]=_0x412d63[_0xb66e('0x1')]||'';this[_0xb66e('0x2')]=_0x412d63[_0xb66e('0x3')]||'';this['remoteUri']=_0x412d63['remoteUri']||'';this[_0xb66e('0x4')]=_0x412d63[_0xb66e('0x4')]||'';this[_0xb66e('0x5')]=_0x412d63['Configurations']||{};}module[_0xb66e('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x6983=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x4579cd,_0x3ab780){var _0x42667a=function(_0x543940){while(--_0x543940){_0x4579cd['push'](_0x4579cd['shift']());}};_0x42667a(++_0x3ab780);}(_0x6983,0x10b));var _0x3698=function(_0x415df2,_0x11ef3d){_0x415df2=_0x415df2-0x0;var _0x210d6a=_0x6983[_0x415df2];return _0x210d6a;};'use strict';function FreshdeskAccount(_0x34ec9b){this['id']=_0x34ec9b['id']||0x0;this[_0x3698('0x0')]=_0x34ec9b[_0x3698('0x0')]||'';this[_0x3698('0x1')]=_0x34ec9b['username']||'';this['apiKey']=_0x34ec9b[_0x3698('0x2')]||'';this[_0x3698('0x3')]=_0x34ec9b[_0x3698('0x3')]||'';this['serverUrl']=_0x34ec9b[_0x3698('0x4')]||'';this['Configurations']=_0x34ec9b[_0x3698('0x5')]||{};}module[_0x3698('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 32837e7..7dd8468 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 _0x23f4=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x5ed855,_0x1dcffe){var _0x131c45=function(_0x162076){while(--_0x162076){_0x5ed855['push'](_0x5ed855['shift']());}};_0x131c45(++_0x1dcffe);}(_0x23f4,0x1ee));var _0x423f=function(_0x577dc5,_0x360c04){_0x577dc5=_0x577dc5-0x0;var _0x40c91e=_0x23f4[_0x577dc5];return _0x40c91e;};'use strict';function FreshsalesAccount(_0xdab65f){this['id']=_0xdab65f['id']||0x0;this[_0x423f('0x0')]=_0xdab65f['name']||'';this['username']=_0xdab65f[_0x423f('0x1')]||'';this[_0x423f('0x2')]=_0xdab65f[_0x423f('0x3')]||'';this[_0x423f('0x4')]=_0xdab65f[_0x423f('0x4')]||'';this[_0x423f('0x5')]=_0xdab65f[_0x423f('0x5')]||'';this[_0x423f('0x6')]=_0xdab65f[_0x423f('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x3f27=['Configurations','exports','name','username','token','remoteUri'];(function(_0xaddb5e,_0x372a9a){var _0x15ad8c=function(_0x39dfd3){while(--_0x39dfd3){_0xaddb5e['push'](_0xaddb5e['shift']());}};_0x15ad8c(++_0x372a9a);}(_0x3f27,0x1f4));var _0x73f2=function(_0x1fcbb9,_0x51e611){_0x1fcbb9=_0x1fcbb9-0x0;var _0x77bc9=_0x3f27[_0x1fcbb9];return _0x77bc9;};'use strict';function FreshsalesAccount(_0x1e2168){this['id']=_0x1e2168['id']||0x0;this[_0x73f2('0x0')]=_0x1e2168[_0x73f2('0x0')]||'';this[_0x73f2('0x1')]=_0x1e2168[_0x73f2('0x1')]||'';this['apiKey']=_0x1e2168[_0x73f2('0x2')]||'';this[_0x73f2('0x3')]=_0x1e2168['remoteUri']||'';this['serverUrl']=_0x1e2168['serverUrl']||'';this[_0x73f2('0x4')]=_0x1e2168[_0x73f2('0x4')]||{};}module[_0x73f2('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 73e4def..a019c3a 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 _0xa958=['variables','type','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','exten','holdtime','assigned','lastAssignedTo','motionChannel','mohtime'];(function(_0xa9891a,_0x333d1c){var _0x23a44a=function(_0x452aa5){while(--_0x452aa5){_0xa9891a['push'](_0xa9891a['shift']());}};_0x23a44a(++_0x333d1c);}(_0xa958,0x8b));var _0x8a95=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa958[_0x55e08b];return _0xd1a7ff;};'use strict';function QueueReport(){this[_0x8a95('0x0')]=_0x8a95('0x1');this[_0x8a95('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x8a95('0x3')]='';this[_0x8a95('0x4')]=null;this[_0x8a95('0x5')]=null;this[_0x8a95('0x6')]=0x1;this[_0x8a95('0x7')]=0x1;this[_0x8a95('0x8')]=![];this[_0x8a95('0x9')]=null;this[_0x8a95('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x8a95('0xb')]=![];this[_0x8a95('0xc')]=null;this[_0x8a95('0xd')]=0x1;this['channel']='';this[_0x8a95('0xe')]='';this['connectedlinename']='';this[_0x8a95('0xf')]='';this['context']='';this[_0x8a95('0x10')]='';this['priority']='';this[_0x8a95('0x11')]=0x0;this[_0x8a95('0x12')]=![];this[_0x8a95('0x13')]='';this[_0x8a95('0x14')]='voice';this[_0x8a95('0x15')]=0x0;this[_0x8a95('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xa217=['context','priority','holdtime','motionChannel','voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x94f760,_0x4f1b70){var _0x3aec01=function(_0x15c485){while(--_0x15c485){_0x94f760['push'](_0x94f760['shift']());}};_0x3aec01(++_0x4f1b70);}(_0xa217,0x188));var _0x7a21=function(_0x25949d,_0x49889d){_0x25949d=_0x25949d-0x0;var _0x321fac=_0xa217[_0x25949d];return _0x321fac;};'use strict';function QueueReport(){this[_0x7a21('0x0')]=_0x7a21('0x1');this['uniqueid']='';this[_0x7a21('0x2')]='';this[_0x7a21('0x3')]='';this[_0x7a21('0x4')]='';this['queuecallerjoinAt']=null;this[_0x7a21('0x5')]=null;this['position']=0x1;this[_0x7a21('0x6')]=0x1;this[_0x7a21('0x7')]=![];this[_0x7a21('0x8')]=null;this[_0x7a21('0x9')]=![];this[_0x7a21('0xa')]=null;this[_0x7a21('0xb')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x7a21('0xc')]='';this[_0x7a21('0xd')]='';this[_0x7a21('0xe')]='';this[_0x7a21('0xf')]='';this[_0x7a21('0x10')]='';this['exten']='';this[_0x7a21('0x11')]='';this[_0x7a21('0x12')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x7a21('0x13')]=_0x7a21('0x14');this[_0x7a21('0x15')]=0x0;this[_0x7a21('0x16')]={};}module[_0x7a21('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4de7afc..656089a 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 _0xb51d=['clientSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x35f7d1,_0x39d318){var _0x53ac5f=function(_0x30b171){while(--_0x30b171){_0x35f7d1['push'](_0x35f7d1['shift']());}};_0x53ac5f(++_0x39d318);}(_0xb51d,0x159));var _0xdb51=function(_0x1c4ea7,_0x10eafd){_0x1c4ea7=_0x1c4ea7-0x0;var _0xa159cc=_0xb51d[_0x1c4ea7];return _0xa159cc;};'use strict';function SalesforceAccount(_0x2b2b32){this['id']=_0x2b2b32['id']||0x0;this[_0xdb51('0x0')]=_0x2b2b32['name']||'';this[_0xdb51('0x1')]=_0x2b2b32[_0xdb51('0x1')]||'';this[_0xdb51('0x2')]=_0x2b2b32[_0xdb51('0x2')]||'';this[_0xdb51('0x3')]=_0x2b2b32[_0xdb51('0x3')]||'';this['clientId']=_0x2b2b32[_0xdb51('0x4')]||'';this[_0xdb51('0x5')]=_0x2b2b32[_0xdb51('0x5')]||'';this['securityToken']=_0x2b2b32['securityToken']||'';this[_0xdb51('0x6')]=_0x2b2b32['type']||'integrationTab';this[_0xdb51('0x7')]=_0x2b2b32[_0xdb51('0x7')]||'';this['Configurations']=_0x2b2b32[_0xdb51('0x8')]||{};}module[_0xdb51('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x874d=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x181048,_0xb3a60e){var _0x3e0ce3=function(_0x4c3b52){while(--_0x4c3b52){_0x181048['push'](_0x181048['shift']());}};_0x3e0ce3(++_0xb3a60e);}(_0x874d,0x1e8));var _0xd874=function(_0xc36d01,_0x3bf1a6){_0xc36d01=_0xc36d01-0x0;var _0xecb231=_0x874d[_0xc36d01];return _0xecb231;};'use strict';function SalesforceAccount(_0x3843a5){this['id']=_0x3843a5['id']||0x0;this[_0xd874('0x0')]=_0x3843a5[_0xd874('0x0')]||'';this[_0xd874('0x1')]=_0x3843a5['username']||'';this[_0xd874('0x2')]=_0x3843a5[_0xd874('0x2')]||'';this[_0xd874('0x3')]=_0x3843a5[_0xd874('0x3')]||'';this['clientId']=_0x3843a5[_0xd874('0x4')]||'';this[_0xd874('0x5')]=_0x3843a5[_0xd874('0x5')]||'';this[_0xd874('0x6')]=_0x3843a5[_0xd874('0x6')]||'';this['type']=_0x3843a5[_0xd874('0x7')]||_0xd874('0x8');this[_0xd874('0x9')]=_0x3843a5['serverUrl']||'';this['Configurations']=_0x3843a5[_0xd874('0xa')]||{};}module[_0xd874('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 2368bad..28a4923 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 _0x1aac=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1aac,0x139));var _0xc1aa=function(_0x5d47c8,_0xc6d09a){_0x5d47c8=_0x5d47c8-0x0;var _0x1bfc36=_0x1aac[_0x5d47c8];return _0x1bfc36;};'use strict';function ServicenowAccount(_0x251d52){this['id']=_0x251d52['id']||0x0;this['name']=_0x251d52[_0xc1aa('0x0')]||'';this[_0xc1aa('0x1')]=_0x251d52[_0xc1aa('0x1')]||'';this['password']=_0x251d52[_0xc1aa('0x2')]||'';this[_0xc1aa('0x3')]=_0x251d52[_0xc1aa('0x3')]||'';this['serverUrl']=_0x251d52[_0xc1aa('0x4')]||'';this[_0xc1aa('0x5')]=_0x251d52[_0xc1aa('0x5')]||{};}module[_0xc1aa('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x734e=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x2a0a8d,_0x4d47a5){var _0x3f41a8=function(_0x3b754a){while(--_0x3b754a){_0x2a0a8d['push'](_0x2a0a8d['shift']());}};_0x3f41a8(++_0x4d47a5);}(_0x734e,0x1c0));var _0xe734=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x734e[_0x3ec122];return _0x4ecf41;};'use strict';function ServicenowAccount(_0x3f772a){this['id']=_0x3f772a['id']||0x0;this[_0xe734('0x0')]=_0x3f772a['name']||'';this['username']=_0x3f772a[_0xe734('0x1')]||'';this[_0xe734('0x2')]=_0x3f772a[_0xe734('0x2')]||'';this[_0xe734('0x3')]=_0x3f772a[_0xe734('0x3')]||'';this['serverUrl']=_0x3f772a[_0xe734('0x4')]||'';this[_0xe734('0x5')]=_0x3f772a[_0xe734('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index bf76a9e..8743d5b 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 _0x5070=['Configurations','exports','name','remoteUri','serverUrl'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x5070,0xe8));var _0x0507=function(_0x1023ff,_0x5e6ade){_0x1023ff=_0x1023ff-0x0;var _0x1991c8=_0x5070[_0x1023ff];return _0x1991c8;};'use strict';function SugarcrmAccount(_0x190c5e){this['id']=_0x190c5e['id']||0x0;this['name']=_0x190c5e[_0x0507('0x0')]||'';this['username']=_0x190c5e['username']||'';this['password']=_0x190c5e['password']||'';this[_0x0507('0x1')]=_0x190c5e[_0x0507('0x1')]||'';this[_0x0507('0x2')]=_0x190c5e[_0x0507('0x2')]||'';this['Configurations']=_0x190c5e[_0x0507('0x3')]||{};}module[_0x0507('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0x3ae7=['password','remoteUri','serverUrl','exports','name','username'];(function(_0x217e94,_0x4ae301){var _0x18bd2f=function(_0x40c93c){while(--_0x40c93c){_0x217e94['push'](_0x217e94['shift']());}};_0x18bd2f(++_0x4ae301);}(_0x3ae7,0x1e4));var _0x73ae=function(_0x3807dd,_0x4eae4b){_0x3807dd=_0x3807dd-0x0;var _0xd808a9=_0x3ae7[_0x3807dd];return _0xd808a9;};'use strict';function SugarcrmAccount(_0x36f290){this['id']=_0x36f290['id']||0x0;this[_0x73ae('0x0')]=_0x36f290[_0x73ae('0x0')]||'';this[_0x73ae('0x1')]=_0x36f290['username']||'';this[_0x73ae('0x2')]=_0x36f290['password']||'';this[_0x73ae('0x3')]=_0x36f290['remoteUri']||'';this[_0x73ae('0x4')]=_0x36f290[_0x73ae('0x4')]||'';this['Configurations']=_0x36f290['Configurations']||{};}module[_0x73ae('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 3ac2fa8..20a867c 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 _0x28e1=['name','accountcode','unknown','stateTime','address','exports'];(function(_0x227d77,_0x353e99){var _0x4e44fb=function(_0x44870a){while(--_0x44870a){_0x227d77['push'](_0x227d77['shift']());}};_0x4e44fb(++_0x353e99);}(_0x28e1,0x1d4));var _0x128e=function(_0x4bfbb4,_0x5506d5){_0x4bfbb4=_0x4bfbb4-0x0;var _0x347a3d=_0x28e1[_0x4bfbb4];return _0x347a3d;};'use strict';function Telephone(_0x447dcf){this['id']=_0x447dcf['id']||0x0;this['name']=_0x447dcf[_0x128e('0x0')]||'';this[_0x128e('0x1')]=_0x447dcf[_0x128e('0x1')]||'';this['state']=_0x128e('0x2');this[_0x128e('0x3')]=0x0;this['status']=_0x128e('0x2');this[_0x128e('0x4')]='';}module[_0x128e('0x5')]=Telephone; \ No newline at end of file +var _0xa724=['address','accountcode','state','stateTime','status','unknown'];(function(_0x32b715,_0x8f0a4d){var _0x198fdd=function(_0x498aff){while(--_0x498aff){_0x32b715['push'](_0x32b715['shift']());}};_0x198fdd(++_0x8f0a4d);}(_0xa724,0xf1));var _0x4a72=function(_0x49fa8a,_0x37a488){_0x49fa8a=_0x49fa8a-0x0;var _0x24170b=_0xa724[_0x49fa8a];return _0x24170b;};'use strict';function Telephone(_0x4a91a1){this['id']=_0x4a91a1['id']||0x0;this['name']=_0x4a91a1['name']||'';this[_0x4a72('0x0')]=_0x4a91a1['accountcode']||'';this[_0x4a72('0x1')]='unknown';this[_0x4a72('0x2')]=0x0;this[_0x4a72('0x3')]=_0x4a72('0x4');this[_0x4a72('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index c3db426..731884c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x1ea5cc,_0x9cf24){var _0x349622=function(_0x1eea88){while(--_0x1eea88){_0x1ea5cc['push'](_0x1ea5cc['shift']());}};_0x349622(++_0x9cf24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x36840b,_0x28131b){var _0x3713bd=function(_0x2d8479){while(--_0x2d8479){_0x36840b['push'](_0x36840b['shift']());}};_0x3713bd(++_0x28131b);}(_0xb10b,0x12a));var _0xbb10=function(_0x33a89d,_0xed52ed){_0x33a89d=_0x33a89d-0x0;var _0x175025=_0xb10b[_0x33a89d];return _0x175025;};'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 92ca944..3d426e6 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x49fffd,_0x534844){var _0x4c90ed=function(_0x3c997a){while(--_0x3c997a){_0x49fffd['push'](_0x49fffd['shift']());}};_0x4c90ed(++_0x534844);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb7e7[_0x3c2a69];return _0x596bc8;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x23a88c,_0x37b4d9){var _0x8bfbf2=function(_0x43d8d4){while(--_0x43d8d4){_0x23a88c['push'](_0x23a88c['shift']());}};_0x8bfbf2(++_0x37b4d9);}(_0x8603,0x190));var _0x3860=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x8603[_0x399d76];return _0x3b19a1;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index bd66087..c10929b 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 _0x2a8b=['domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','port','domain'];(function(_0x4f2e69,_0x29bcdf){var _0x37aa9c=function(_0x5d0c2b){while(--_0x5d0c2b){_0x4f2e69['push'](_0x4f2e69['shift']());}};_0x37aa9c(++_0x29bcdf);}(_0x2a8b,0x1f3));var _0xb2a8=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2a8b[_0x56482c];return _0x5aae7a;};'use strict';function Trunk(_0xff459d){this['id']=_0xff459d['id']||0x0;this[_0xb2a8('0x0')]=_0xff459d['active']||![];this[_0xb2a8('0x1')]=_0xff459d[_0xb2a8('0x1')]||'';this[_0xb2a8('0x2')]=_0xb2a8('0x3');this[_0xb2a8('0x4')]=0x0;this['status']='unknown';this['registry']=_0xff459d[_0xb2a8('0x5')]&&_0xff459d[_0xb2a8('0x5')][_0xb2a8('0x6')](':')?_0xff459d[_0xb2a8('0x5')][_0xb2a8('0x7')](':')[0x0]:'';this[_0xb2a8('0x8')]='';this[_0xb2a8('0x9')]='';this[_0xb2a8('0xa')]='';this[_0xb2a8('0xb')]='';this[_0xb2a8('0xc')]='';this[_0xb2a8('0xd')]=_0xb2a8('0x3');this[_0xb2a8('0xe')]='';this['address']='';this[_0xb2a8('0xf')]=_0xff459d[_0xb2a8('0xf')]||'';}module[_0xb2a8('0x10')]=Trunk; \ No newline at end of file +var _0xf11f=['indexOf','split','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','stateTime','status','unknown','registry'];(function(_0x399fba,_0x2d00ec){var _0x2a033b=function(_0x58ab41){while(--_0x58ab41){_0x399fba['push'](_0x399fba['shift']());}};_0x2a033b(++_0x2d00ec);}(_0xf11f,0x1d5));var _0xff11=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xf11f[_0x996bc8];return _0x20b0ea;};'use strict';function Trunk(_0x42fb2f){this['id']=_0x42fb2f['id']||0x0;this[_0xff11('0x0')]=_0x42fb2f[_0xff11('0x0')]||![];this['name']=_0x42fb2f[_0xff11('0x1')]||'';this[_0xff11('0x2')]='unknown';this[_0xff11('0x3')]=0x0;this[_0xff11('0x4')]=_0xff11('0x5');this[_0xff11('0x6')]=_0x42fb2f[_0xff11('0x6')]&&_0x42fb2f[_0xff11('0x6')][_0xff11('0x7')](':')?_0x42fb2f[_0xff11('0x6')][_0xff11('0x8')](':')[0x0]:'';this['host']='';this[_0xff11('0x9')]='';this[_0xff11('0xa')]='';this[_0xff11('0xb')]='';this[_0xff11('0xc')]='';this[_0xff11('0xd')]=_0xff11('0x5');this[_0xff11('0xe')]='';this[_0xff11('0xf')]='';this[_0xff11('0x10')]=_0x42fb2f[_0xff11('0x10')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 733af7b..604a8f8 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 _0x8878=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x8878,0x1a0));var _0x8887=function(_0x2c43f8,_0x261d10){_0x2c43f8=_0x2c43f8-0x0;var _0x3c0c0f=_0x8878[_0x2c43f8];return _0x3c0c0f;};'use strict';function voiceExtension(_0x11cd49){this['id']=_0x11cd49['id']||0x0;this['exten']=_0x11cd49[_0x8887('0x0')]||'';this[_0x8887('0x1')]=_0x11cd49['recordingFormat']||_0x8887('0x2');this['mandatoryDisposition']=_0x11cd49[_0x8887('0x3')]||![];}module[_0x8887('0x4')]=voiceExtension; \ No newline at end of file +var _0x15d0=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x3c2366,_0x5de3bb){var _0x1af935=function(_0x3abc2f){while(--_0x3abc2f){_0x3c2366['push'](_0x3c2366['shift']());}};_0x1af935(++_0x5de3bb);}(_0x15d0,0xd4));var _0x015d=function(_0x4f7cdf,_0x375a8c){_0x4f7cdf=_0x4f7cdf-0x0;var _0x9382f4=_0x15d0[_0x4f7cdf];return _0x9382f4;};'use strict';function voiceExtension(_0x5e7423){this['id']=_0x5e7423['id']||0x0;this[_0x015d('0x0')]=_0x5e7423[_0x015d('0x0')]||'';this[_0x015d('0x1')]=_0x5e7423[_0x015d('0x1')]||'none';this[_0x015d('0x2')]=_0x5e7423['mandatoryDisposition']||![];}module[_0x015d('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b4ec25c..a4540b8 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 _0x0b78=['dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav49','gsm','fewestcalls','linear','random','rrordered','wrandom','name','monitor_format','type','inbound','answered','sumHoldTime','sumBillable','abandoned','available','busy','inUse','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName'];(function(_0x155582,_0x4aa010){var _0x15d5a9=function(_0xac1f32){while(--_0xac1f32){_0x155582['push'](_0x155582['shift']());}};_0x15d5a9(++_0x4aa010);}(_0x0b78,0x1d6));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x80b7('0x0'),'gsm':_0x80b7('0x1')};var strategy={'fewestcalls':_0x80b7('0x2'),'leastrecent':'leastrecent','linear':_0x80b7('0x3'),'random':_0x80b7('0x4'),'ringall':'ringall','rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0x80b7('0x5'),'wrandom':_0x80b7('0x6')};function VoiceQueue(_0x2809e7){this['id']=_0x2809e7['id']||0x0;this[_0x80b7('0x7')]=_0x2809e7[_0x80b7('0x7')]||'';this[_0x80b7('0x8')]=_0x2809e7['monitor_format']||'';this[_0x80b7('0x9')]=_0x2809e7[_0x80b7('0x9')]||_0x80b7('0xa');this['waiting']=0x0;this['total']=0x0;this[_0x80b7('0xb')]=0x0;this['sumDuration']=0x0;this[_0x80b7('0xc')]=0x0;this[_0x80b7('0xd')]=0x0;this['unmanaged']=0x0;this[_0x80b7('0xe')]=0x0;this[_0x80b7('0xf')]=0x0;this[_0x80b7('0x10')]=0x0;this[_0x80b7('0x11')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0x80b7('0x12')]=0x0;this[_0x80b7('0x13')]=0x0;this[_0x80b7('0x14')]=0x0;this[_0x80b7('0x15')]=0x0;this[_0x80b7('0x16')]=0x0;this[_0x80b7('0x17')]=0x0;this[_0x80b7('0x18')]=0x0;this[_0x80b7('0x19')]=0x0;this[_0x80b7('0x1a')]=_0x2809e7['acw']||![];this['acwTimeout']=_0x2809e7['acwTimeout']||0xa;this['autopause']=_0x2809e7[_0x80b7('0x1b')]||'no';this[_0x80b7('0x1c')]=!![];this[_0x80b7('0x1d')]='';this[_0x80b7('0x1e')]='';this[_0x80b7('0x1f')]=0x0;this[_0x80b7('0x20')]=0x0;this[_0x80b7('0x21')]=_0x2809e7[_0x80b7('0x21')]||null;this[_0x80b7('0x22')]=_0x2809e7[_0x80b7('0x22')]?_0x2809e7[_0x80b7('0x22')]:null;this[_0x80b7('0x23')]=_0x2809e7[_0x80b7('0x23')];this['dialMethod']=_0x2809e7[_0x80b7('0x24')]||_0x80b7('0x25');this[_0x80b7('0x26')]=_0x2809e7[_0x80b7('0x26')]||0x0;this[_0x80b7('0x27')]=_0x2809e7[_0x80b7('0x27')]||0x0;this[_0x80b7('0x28')]=_0x2809e7[_0x80b7('0x28')]||0x1;this[_0x80b7('0x29')]=_0x2809e7[_0x80b7('0x29')]||_0x80b7('0x2a');this[_0x80b7('0x2b')]=_0x2809e7['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x2809e7[_0x80b7('0x2c')]||0x258;this[_0x80b7('0x2d')]=_0x2809e7[_0x80b7('0x2d')]||'anonymous';this[_0x80b7('0x2e')]=_0x2809e7[_0x80b7('0x2e')]||_0x80b7('0x2f');this[_0x80b7('0x30')]=_0x2809e7[_0x80b7('0x30')]||0x1e;this[_0x80b7('0x31')]=_0x2809e7[_0x80b7('0x31')]||_0x80b7('0x32');this[_0x80b7('0x33')]=_0x2809e7[_0x80b7('0x33')]||0x3;this[_0x80b7('0x34')]=_0x2809e7['dialQueueProject']||undefined;this[_0x80b7('0x35')]=_0x2809e7[_0x80b7('0x35')]||0x3;this[_0x80b7('0x36')]=_0x2809e7[_0x80b7('0x36')]||0x96;this[_0x80b7('0x37')]=_0x2809e7[_0x80b7('0x37')]||0x3;this[_0x80b7('0x38')]=_0x2809e7[_0x80b7('0x38')]||0x96;this['dialNoAnswerMaxRetry']=_0x2809e7[_0x80b7('0x39')]||0x3;this[_0x80b7('0x3a')]=_0x2809e7[_0x80b7('0x3a')]||0x96;this[_0x80b7('0x3b')]=_0x2809e7[_0x80b7('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2809e7[_0x80b7('0x3c')]||0x96;this[_0x80b7('0x3d')]=_0x2809e7[_0x80b7('0x3d')]||0x3;this[_0x80b7('0x3e')]=_0x2809e7[_0x80b7('0x3e')]||0x96;this[_0x80b7('0x3f')]=_0x2809e7[_0x80b7('0x3f')]||0x3;this['dialAbandonedRetryFrequency']=_0x2809e7[_0x80b7('0x40')]||0x96;this[_0x80b7('0x41')]=_0x2809e7['dialMachineMaxRetry']||0x3;this[_0x80b7('0x42')]=_0x2809e7[_0x80b7('0x42')]||0x96;this[_0x80b7('0x43')]=_0x2809e7[_0x80b7('0x43')]||0x3;this[_0x80b7('0x44')]=_0x2809e7[_0x80b7('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x2809e7[_0x80b7('0x45')]||0x3;this[_0x80b7('0x46')]=_0x2809e7[_0x80b7('0x46')]||0x4;this['Trunk']=_0x2809e7[_0x80b7('0x47')]?_0x2809e7[_0x80b7('0x47')]:undefined;this[_0x80b7('0x48')]=_0x2809e7['TrunkBackup']?_0x2809e7[_0x80b7('0x48')]:undefined;this[_0x80b7('0x49')]=_0x2809e7[_0x80b7('0x49')]||undefined;this[_0x80b7('0x4a')]=_0x2809e7[_0x80b7('0x4a')]?_0x2809e7[_0x80b7('0x4a')]:undefined;this[_0x80b7('0x4b')]=_0x2809e7[_0x80b7('0x4b')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x2809e7[_0x80b7('0x4c')]||undefined;this[_0x80b7('0x4d')]=_0x2809e7[_0x80b7('0x4d')]||undefined;this[_0x80b7('0x4e')]=strategy[_0x2809e7['strategy']];this['queueStatusComplete']=!![];this[_0x80b7('0x4f')]=_0x2809e7[_0x80b7('0x4f')]||![];this[_0x80b7('0x50')]=_0x2809e7[_0x80b7('0x50')];this['dialAMDGreeting']=_0x2809e7[_0x80b7('0x51')];this[_0x80b7('0x52')]=_0x2809e7['dialAMDAfterGreetingSilence'];this[_0x80b7('0x53')]=_0x2809e7['dialAMDTotalAnalysisTime'];this[_0x80b7('0x54')]=_0x2809e7['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2809e7[_0x80b7('0x55')];this[_0x80b7('0x56')]=_0x2809e7[_0x80b7('0x56')];this[_0x80b7('0x57')]=_0x2809e7['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x2809e7[_0x80b7('0x58')];this['outboundRejectCallsDay']=0x0;this[_0x80b7('0x59')]=0x0;this[_0x80b7('0x5a')]=_0x2809e7['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x80b7('0x5b')]=0x0;this[_0x80b7('0x5c')]=0x0;this[_0x80b7('0x5d')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x80b7('0x5e')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x80b7('0x5f')]=0x0;this[_0x80b7('0x60')]=0x0;this[_0x80b7('0x61')]=0x0;this[_0x80b7('0x62')]=0x0;this[_0x80b7('0x63')]=0x0;this[_0x80b7('0x64')]=0x0;this[_0x80b7('0x65')]=undefined;this[_0x80b7('0x66')]=undefined;this[_0x80b7('0x67')]=undefined;this[_0x80b7('0x68')]=1.05;this[_0x80b7('0x69')]=0x0;this[_0x80b7('0x6a')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x80b7('0x6b')]=0x0;this[_0x80b7('0x6c')]=0x0;this[_0x80b7('0x6d')]=0x0;this[_0x80b7('0x6e')]=0x0;this[_0x80b7('0x6f')]=0x0;this[_0x80b7('0x70')]=_0x2809e7[_0x80b7('0x71')]||0x14;this[_0x80b7('0x72')]=_0x2809e7[_0x80b7('0x71')]||0xa;this[_0x80b7('0x73')]=0x0;this[_0x80b7('0x74')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x80b7('0x75')]=0x0;this['erlangCallToSecond']=0x0;this[_0x80b7('0x76')]=0x0;this[_0x80b7('0x77')]=0x0;this[_0x80b7('0x78')]=_0x2809e7[_0x80b7('0x78')]||0x1e;this['dialRecallInQueue']=_0x2809e7[_0x80b7('0x79')]||![];this[_0x80b7('0x7a')]=!!_0x2809e7['dialPreviewAutoRecallMe']||![];this[_0x80b7('0x7b')]=!!_0x2809e7[_0x80b7('0x7b')]||![];this['dialQueueProject2']=_0x2809e7[_0x80b7('0x7c')]||undefined;this[_0x80b7('0x7d')]=_0x2809e7['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x2809e7[_0x80b7('0x7e')]||![];this[_0x80b7('0x8')]=monitorFormat[_0x2809e7[_0x80b7('0x8')]]?monitorFormat[_0x2809e7[_0x80b7('0x8')]]:undefined;this[_0x80b7('0x7f')]=_0x2809e7[_0x80b7('0x7f')]||![];this[_0x80b7('0x80')]=_0x2809e7['mandatoryDispositionPause']?_0x2809e7['mandatoryDispositionPause']:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x867e=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','random','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unknown','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x587a00,_0x57ec6d){var _0x1e78b6=function(_0x3855e4){while(--_0x3855e4){_0x587a00['push'](_0x587a00['shift']());}};_0x1e78b6(++_0x57ec6d);}(_0x867e,0x1c5));var _0xe867=function(_0x377d7f,_0x2681e3){_0x377d7f=_0x377d7f-0x0;var _0x118579=_0x867e[_0x377d7f];return _0x118579;};'use strict';var monitorFormat={'wav':_0xe867('0x0'),'wav49':_0xe867('0x1'),'gsm':_0xe867('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xe867('0x3'),'linear':'linear','random':_0xe867('0x4'),'ringall':'ringall','rr':_0xe867('0x5'),'rrmemory':_0xe867('0x6'),'rrordered':_0xe867('0x7'),'wrandom':_0xe867('0x8')};function VoiceQueue(_0x3a184f){this['id']=_0x3a184f['id']||0x0;this[_0xe867('0x9')]=_0x3a184f[_0xe867('0x9')]||'';this[_0xe867('0xa')]=_0x3a184f[_0xe867('0xa')]||'';this[_0xe867('0xb')]=_0x3a184f[_0xe867('0xb')]||_0xe867('0xc');this[_0xe867('0xd')]=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xe867('0xe')]=0x0;this[_0xe867('0xf')]=0x0;this[_0xe867('0x10')]=0x0;this[_0xe867('0x11')]=0x0;this[_0xe867('0x12')]=0x0;this[_0xe867('0x13')]=0x0;this[_0xe867('0x14')]=0x0;this[_0xe867('0x15')]=0x0;this[_0xe867('0x16')]=0x0;this[_0xe867('0x17')]=0x0;this[_0xe867('0x18')]=0x0;this[_0xe867('0x19')]=0x0;this[_0xe867('0x1a')]=0x0;this[_0xe867('0x1b')]=0x0;this['talking']=0x0;this['unavailable']=0x0;this[_0xe867('0x1c')]=0x0;this[_0xe867('0x1d')]=_0x3a184f['acw']||![];this[_0xe867('0x1e')]=_0x3a184f[_0xe867('0x1e')]||0xa;this['autopause']=_0x3a184f[_0xe867('0x1f')]||'no';this['sendMessageOneNotActive']=!![];this[_0xe867('0x20')]='';this['statusMessage']='';this[_0xe867('0x21')]=0x0;this[_0xe867('0x22')]=0x0;this[_0xe867('0x23')]=_0x3a184f[_0xe867('0x23')]||null;this[_0xe867('0x24')]=_0x3a184f['dialGlobalInterval']?_0x3a184f['dialGlobalInterval']:null;this['dialActive']=_0x3a184f[_0xe867('0x25')];this['dialMethod']=_0x3a184f[_0xe867('0x26')]||_0xe867('0x27');this[_0xe867('0x28')]=_0x3a184f[_0xe867('0x28')]||0x0;this[_0xe867('0x29')]=_0x3a184f[_0xe867('0x29')]||0x0;this[_0xe867('0x2a')]=_0x3a184f[_0xe867('0x2a')]||0x1;this['dialPredictiveOptimization']=_0x3a184f[_0xe867('0x2b')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x3a184f[_0xe867('0x2c')]||0.03;this[_0xe867('0x2d')]=_0x3a184f[_0xe867('0x2d')]||0x258;this['dialOriginateCallerIdName']=_0x3a184f['dialOriginateCallerIdName']||'anonymous';this[_0xe867('0x2e')]=_0x3a184f[_0xe867('0x2e')]||_0xe867('0x2f');this[_0xe867('0x30')]=_0x3a184f[_0xe867('0x30')]||0x1e;this[_0xe867('0x31')]=_0x3a184f['dialQueueOptions']||_0xe867('0x32');this[_0xe867('0x33')]=_0x3a184f[_0xe867('0x33')]||0x3;this[_0xe867('0x34')]=_0x3a184f['dialQueueProject']||undefined;this[_0xe867('0x35')]=_0x3a184f[_0xe867('0x35')]||0x3;this[_0xe867('0x36')]=_0x3a184f[_0xe867('0x36')]||0x96;this[_0xe867('0x37')]=_0x3a184f[_0xe867('0x37')]||0x3;this[_0xe867('0x38')]=_0x3a184f['dialBusyRetryFrequency']||0x96;this[_0xe867('0x39')]=_0x3a184f[_0xe867('0x39')]||0x3;this[_0xe867('0x3a')]=_0x3a184f[_0xe867('0x3a')]||0x96;this[_0xe867('0x3b')]=_0x3a184f[_0xe867('0x3b')]||0x3;this[_0xe867('0x3c')]=_0x3a184f[_0xe867('0x3c')]||0x96;this['dialDropMaxRetry']=_0x3a184f[_0xe867('0x3d')]||0x3;this[_0xe867('0x3e')]=_0x3a184f[_0xe867('0x3e')]||0x96;this['dialAbandonedMaxRetry']=_0x3a184f[_0xe867('0x3f')]||0x3;this[_0xe867('0x40')]=_0x3a184f['dialAbandonedRetryFrequency']||0x96;this[_0xe867('0x41')]=_0x3a184f['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x3a184f[_0xe867('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x3a184f[_0xe867('0x43')]||0x3;this[_0xe867('0x44')]=_0x3a184f['dialAgentRejectRetryFrequency']||0x96;this[_0xe867('0x45')]=_0x3a184f[_0xe867('0x45')]||0x3;this['dialGlobalMaxRetry']=_0x3a184f[_0xe867('0x46')]||0x4;this[_0xe867('0x47')]=_0x3a184f[_0xe867('0x47')]?_0x3a184f[_0xe867('0x47')]:undefined;this['TrunkBackup']=_0x3a184f[_0xe867('0x48')]?_0x3a184f['TrunkBackup']:undefined;this['dialPrefix']=_0x3a184f[_0xe867('0x49')]||undefined;this[_0xe867('0x4a')]=_0x3a184f['Interval']?_0x3a184f[_0xe867('0x4a')]:undefined;this[_0xe867('0x4b')]=_0x3a184f['dialOrderByScheduledAt']||_0xe867('0x4c');this[_0xe867('0x4d')]=_0x3a184f[_0xe867('0x4d')]||undefined;this[_0xe867('0x4e')]=_0x3a184f['dialCutDigit']||undefined;this[_0xe867('0x4f')]=strategy[_0x3a184f[_0xe867('0x4f')]];this[_0xe867('0x50')]=!![];this[_0xe867('0x51')]=_0x3a184f[_0xe867('0x51')]||![];this[_0xe867('0x52')]=_0x3a184f[_0xe867('0x52')];this[_0xe867('0x53')]=_0x3a184f['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3a184f[_0xe867('0x54')];this[_0xe867('0x55')]=_0x3a184f[_0xe867('0x55')];this['dialAMDMinWordLength']=_0x3a184f[_0xe867('0x56')];this[_0xe867('0x57')]=_0x3a184f[_0xe867('0x57')];this[_0xe867('0x58')]=_0x3a184f[_0xe867('0x58')];this[_0xe867('0x59')]=_0x3a184f['dialAMDSilenceThreshold'];this[_0xe867('0x5a')]=_0x3a184f['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xe867('0x5b')]=0x0;this[_0xe867('0x5c')]=_0x3a184f[_0xe867('0x5c')];this[_0xe867('0x5d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xe867('0x5e')]=0x0;this[_0xe867('0x5f')]=0x0;this[_0xe867('0x60')]=0x0;this[_0xe867('0x61')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xe867('0x62')]=0x0;this[_0xe867('0x63')]=0x0;this[_0xe867('0x64')]=0x0;this['outboundReCallsDay']=0x0;this[_0xe867('0x65')]=0x0;this[_0xe867('0x66')]=undefined;this[_0xe867('0x67')]=undefined;this[_0xe867('0x68')]=undefined;this[_0xe867('0x69')]=1.05;this[_0xe867('0x6a')]=0x0;this[_0xe867('0x6b')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe867('0x6c')]=0x0;this[_0xe867('0x6d')]=0x0;this[_0xe867('0x6e')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe867('0x6f')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3a184f['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x3a184f[_0xe867('0x70')]||0xa;this[_0xe867('0x71')]=0x0;this[_0xe867('0x72')]=0x0;this[_0xe867('0x73')]=0x1;this[_0xe867('0x74')]=0x0;this[_0xe867('0x75')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xe867('0x76')]=0x0;this[_0xe867('0x77')]=_0x3a184f[_0xe867('0x77')]||0x1e;this[_0xe867('0x78')]=_0x3a184f['dialRecallInQueue']||![];this[_0xe867('0x79')]=!!_0x3a184f[_0xe867('0x79')]||![];this[_0xe867('0x7a')]=!!_0x3a184f['dialPreviewRecallmeReminder']||![];this[_0xe867('0x7b')]=_0x3a184f['dialQueueProject2']||undefined;this[_0xe867('0x7c')]=_0x3a184f[_0xe867('0x7c')]||![];this['dialAgiAfterHangupAgent']=_0x3a184f['dialAgiAfterHangupAgent']||![];this[_0xe867('0xa')]=monitorFormat[_0x3a184f[_0xe867('0xa')]]?monitorFormat[_0x3a184f[_0xe867('0xa')]]:undefined;this['mandatoryDisposition']=_0x3a184f['mandatoryDisposition']||![];this[_0xe867('0x7d')]=_0x3a184f[_0xe867('0x7d')]?_0x3a184f[_0xe867('0x7d')]:undefined;this[_0xe867('0x7e')]=![];}module[_0xe867('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 1604fb9..788b4bd 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc92f=['loggedInDb','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','online','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','outboundRejectCallsDay','preview','exports','available','loggedIn','paused','ringing','talking','answered','inUse','originated','outboundAnswerCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','invalid'];(function(_0x2a9eda,_0x218c0c){var _0x3bdf40=function(_0x4b3da6){while(--_0x4b3da6){_0x2a9eda['push'](_0x2a9eda['shift']());}};_0x3bdf40(++_0x218c0c);}(_0xc92f,0xf3));var _0xfc92=function(_0x2035c3,_0x1f5552){_0x2035c3=_0x2035c3-0x0;var _0x1b0b3e=_0xc92f[_0x2035c3];return _0x1b0b3e;};'use strict';var INBOUND_COUNTERS=[_0xfc92('0x0'),_0xfc92('0x1'),'loggedInDb',_0xfc92('0x2'),_0xfc92('0x3'),_0xfc92('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0xfc92('0x0'),_0xfc92('0x5'),_0xfc92('0x6'),'loggedIn','loggedInDb',_0xfc92('0x7'),'outboundAbandonedCallsDay',_0xfc92('0x8'),'outboundBlacklistCallsDay',_0xfc92('0x9'),'outboundCongestionCallsDay',_0xfc92('0xa'),_0xfc92('0xb'),_0xfc92('0xc'),'outboundRejectCallsDay',_0xfc92('0xd'),_0xfc92('0x2'),_0xfc92('0xe'),'talking',_0xfc92('0xf'),_0xfc92('0x10'),_0xfc92('0x11'),_0xfc92('0x12')];function VoiceQueueSummary(_0xed0a05){this['id']=_0xed0a05['id'];this[_0xfc92('0x13')]=_0xed0a05[_0xfc92('0x13')];this[_0xfc92('0x14')]=_0xed0a05[_0xfc92('0x14')];this[_0xfc92('0x15')]=_0xed0a05[_0xfc92('0x15')]||0x0;this[_0xfc92('0x5')]=_0xed0a05['answered']||0x0;this['available']=_0xed0a05['available']||0x0;this[_0xfc92('0x16')]=_0xed0a05[_0xfc92('0x16')]||0x0;this['inUse']=_0xed0a05[_0xfc92('0x6')]||0x0;this[_0xfc92('0x17')]=_0xed0a05[_0xfc92('0x17')]||0x0;this[_0xfc92('0x1')]=_0xed0a05[_0xfc92('0x1')]||0x0;this[_0xfc92('0x18')]=_0xed0a05['loggedInDb']||0x0;this[_0xfc92('0x19')]=_0xed0a05[_0xfc92('0x19')]||0x0;this[_0xfc92('0x1a')]=_0xed0a05[_0xfc92('0x1a')]||0x0;this['paused']=_0xed0a05['paused']||0x0;this[_0xfc92('0x3')]=_0xed0a05[_0xfc92('0x3')]||0x0;this['ringInUse']=_0xed0a05[_0xfc92('0x1b')];this[_0xfc92('0xf')]=_0xed0a05['sumBillable'];this[_0xfc92('0x10')]=_0xed0a05['sumDuration'];this[_0xfc92('0x1c')]=_0xed0a05[_0xfc92('0x1c')]||0x0;this[_0xfc92('0x4')]=_0xed0a05[_0xfc92('0x4')]||0x0;this[_0xfc92('0x11')]=_0xed0a05[_0xfc92('0x11')]||0x0;this['type']=_0xed0a05[_0xfc92('0x1d')];this['unavailable']=_0xed0a05[_0xfc92('0x1e')]||0x0;this[_0xfc92('0x1f')]=_0xed0a05[_0xfc92('0x1f')]||0x0;this['unmanaged']=_0xed0a05['unmanaged']||0x0;this['waiting']=_0xed0a05['waiting']||0x0;if(_0xed0a05[_0xfc92('0x1d')]===_0xfc92('0x20')){this[_0xfc92('0xe')]=_0xed0a05[_0xfc92('0xe')]||0x0;this[_0xfc92('0x21')]=_0xed0a05[_0xfc92('0x21')];this[_0xfc92('0x22')]=_0xed0a05[_0xfc92('0x22')];this['dialOriginateCallerIdName']=_0xed0a05[_0xfc92('0x23')];this[_0xfc92('0x24')]=_0xed0a05[_0xfc92('0x24')];this['dialOriginateTimeout']=_0xed0a05[_0xfc92('0x25')];this[_0xfc92('0x26')]=_0xed0a05['dialPrefix'];this['temp']=_0xed0a05[_0xfc92('0x27')];this[_0xfc92('0x28')]=_0xed0a05['outboundAnswerAgiCallsDay'];this[_0xfc92('0x8')]=_0xed0a05['outboundAnswerCallsDay'];this[_0xfc92('0x29')]=_0xed0a05[_0xfc92('0x29')];this['outboundBusyCallsDay']=_0xed0a05[_0xfc92('0x9')];this[_0xfc92('0x2a')]=_0xed0a05[_0xfc92('0x2a')];this[_0xfc92('0x2b')]=_0xed0a05[_0xfc92('0x2b')];this[_0xfc92('0x2c')]=_0xed0a05[_0xfc92('0x2c')];this[_0xfc92('0x2d')]=_0xed0a05[_0xfc92('0x2d')];this['outboundNoAnswerCallsDay']=_0xed0a05['outboundNoAnswerCallsDay'];this[_0xfc92('0xb')]=_0xed0a05['outboundNoSuchCallsDay'];this[_0xfc92('0x2e')]=_0xed0a05[_0xfc92('0x2e')];this[_0xfc92('0xc')]=_0xed0a05[_0xfc92('0xc')];this['outboundRejectCallsDay']=_0xed0a05['outboundRejectCallsDay'];this[_0xfc92('0xd')]=_0xed0a05[_0xfc92('0xd')];this[_0xfc92('0x2f')]=_0xed0a05[_0xfc92('0x2f')];this[_0xfc92('0x30')]=_0xed0a05[_0xfc92('0x30')];this[_0xfc92('0x31')]=_0xed0a05['predictiveIntervalAvgTalktime'];this[_0xfc92('0x32')]=_0xed0a05[_0xfc92('0x32')];this[_0xfc92('0x33')]=_0xed0a05[_0xfc92('0x33')];this['predictiveIntervalErlangCalls']=_0xed0a05[_0xfc92('0x34')];this['predictiveIntervalErlangCallsDroppedCalls']=_0xed0a05['predictiveIntervalErlangCallsDroppedCalls'];this[_0xfc92('0x35')]=_0xed0a05[_0xfc92('0x35')];this[_0xfc92('0x36')]=_0xed0a05['predictiveIntervalMultiplicativeFactor'];this[_0xfc92('0x37')]=_0xed0a05['predictiveIntervalPauses'];this[_0xfc92('0x38')]=_0xed0a05[_0xfc92('0x38')];this['predictiveIntervalTotalCalls']=_0xed0a05[_0xfc92('0x39')];this[_0xfc92('0x7')]=_0xed0a05['originated'];this[_0xfc92('0x3a')]=_0xed0a05[_0xfc92('0x3a')];this[_0xfc92('0x3b')]=_0xed0a05[_0xfc92('0x3b')];this['erlangAbandonmentRate']=_0xed0a05['erlangAbandonmentRate'];this[_0xfc92('0x3c')]=_0xed0a05[_0xfc92('0x3c')];this[_0xfc92('0x3d')]=_0xed0a05['startPredictive'];this['startProgressive']=_0xed0a05[_0xfc92('0x3e')];this[_0xfc92('0x3f')]=_0xed0a05[_0xfc92('0x3f')];this[_0xfc92('0x40')]=_0xed0a05[_0xfc92('0x40')];}if(_0xed0a05[_0xfc92('0x41')]){this[_0xfc92('0x41')]={'id':_0xed0a05[_0xfc92('0x41')]['id'],'name':_0xed0a05[_0xfc92('0x41')]['name'],'active':_0xed0a05[_0xfc92('0x41')][_0xfc92('0x42')],'callerid':_0xed0a05[_0xfc92('0x41')][_0xfc92('0x43')]};}}VoiceQueueSummary[_0xfc92('0x44')][_0xfc92('0x45')]=function(_0x2739ed,_0x376491,_0x340254,_0x54db01){this[_0xfc92('0x18')]=0x0;this['talking']=0x0;this[_0xfc92('0x2')]=0x0;this[_0xfc92('0x1f')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0xfc92('0x16')]=0x0;this[_0xfc92('0x17')]=0x0;this[_0xfc92('0x1e')]=0x0;this[_0xfc92('0x3')]=0x0;this[_0xfc92('0x1b')]=0x0;this[_0xfc92('0x19')]=0x0;if(_0x340254){if(_0x340254[_0xfc92('0x0')]){this['available']=Number(_0x340254[_0xfc92('0x0')]);}if(_0x340254[_0xfc92('0x46')]){this[_0xfc92('0x1')]=Number(_0x340254['loggedin']);}if(_0x340254[_0xfc92('0x47')]){this[_0xfc92('0x12')]=Number(_0x340254['callers']);}}for(var _0x1aaaca=0x0;_0x1aaaca<_0x2739ed[_0xfc92('0x48')];_0x1aaaca++){var _0x14168f=_0x376491['SIP/'+_0x2739ed[_0x1aaaca][_0xfc92('0x13')]];if(_0x14168f&&_0x14168f[_0xfc92('0x49')]){this[_0xfc92('0x18')]+=0x1;}if(_0x2739ed[_0x1aaaca][_0xfc92('0x4a')]==='1'){this[_0xfc92('0x4')]+=0x1;}if(_0x2739ed[_0x1aaaca][_0xfc92('0x2')]==='1'&&!['2','7','8']['includes'](_0x2739ed[_0x1aaaca]['status'])){this[_0xfc92('0x2')]+=0x1;}switch(_0x2739ed[_0x1aaaca][_0xfc92('0x4b')]){case'0':this[_0xfc92('0x1f')]+=0x1;break;case'1':this[_0xfc92('0x1a')]+=0x1;break;case'2':this[_0xfc92('0x6')]+=0x1;break;case'3':this[_0xfc92('0x16')]+=0x1;break;case'4':this[_0xfc92('0x17')]+=0x1;break;case'5':this[_0xfc92('0x1e')]+=0x1;break;case'6':this[_0xfc92('0x3')]+=0x1;break;case'7':this[_0xfc92('0x1b')]+=0x1;break;case'8':this[_0xfc92('0x19')]+=0x1;break;}}if(this[_0xfc92('0x22')]===_0xfc92('0x4c')){var _0xc3777f=Object[_0xfc92('0x4d')](_0x54db01);for(var _0x4b56af=0x0;_0x4b56af<_0xc3777f['length'];_0x4b56af++){var _0x4aa523=_0xc3777f[_0x4b56af];var _0x2168fd=_0x54db01[_0x4aa523];if(_0x2168fd[_0xfc92('0x4e')]===this['name']&&_0x2168fd[_0xfc92('0x1d')]===_0xfc92('0x4f')&&_0x2168fd[_0xfc92('0x50')]===_0xfc92('0x51')){this[_0xfc92('0x4')]+=0x1;}}if(this['talking']>this['inUse']){this[_0xfc92('0x4')]=this[_0xfc92('0x6')];}this[_0xfc92('0xe')]=0x0;}return this;};VoiceQueueSummary[_0xfc92('0x44')]['compareToInboundQueue']=function(_0x2bd1fd){var _0x21d17d=![];if(_0x2bd1fd){_0x21d17d=INBOUND_COUNTERS[_0xfc92('0x52')](function(_0x2b7e31){return this[_0x2b7e31]!==_0x2bd1fd[_0x2b7e31];},this);}return _0x21d17d;};VoiceQueueSummary[_0xfc92('0x44')][_0xfc92('0x53')]=function(_0x14908d){var _0x298803=![];var _0x410777=![];var _0x3af4b0=![];if(_0x14908d){_0x298803=this['dialMethod']!==_0x14908d['dialMethod']||this[_0xfc92('0x21')]!==_0x14908d[_0xfc92('0x21')]||this[_0xfc92('0x3f')]!==_0x14908d['message']||this[_0xfc92('0x40')]!==_0x14908d[_0xfc92('0x40')];_0x410777=OUTBOUND_COUNTERS[_0xfc92('0x52')](function(_0x56f016){return this[_0x56f016]!==_0x14908d[_0x56f016];},this);if(this['Trunk']&&_0x14908d[_0xfc92('0x41')]){_0x3af4b0=this[_0xfc92('0x41')][_0xfc92('0x13')]!==_0x14908d[_0xfc92('0x41')]['name']||this['Trunk'][_0xfc92('0x42')]!==_0x14908d[_0xfc92('0x41')]['active'];}}return _0x298803||_0x410777||_0x3af4b0;};VoiceQueueSummary[_0xfc92('0x44')][_0xfc92('0x54')]=function(_0x47525a){this[_0xfc92('0x5')]=_0x47525a[_0xfc92('0x5')];this[_0xfc92('0x3f')]=_0x47525a[_0xfc92('0x3f')];this['statusMessage']=_0x47525a[_0xfc92('0x40')];this[_0xfc92('0x7')]=_0x47525a['originated'];this[_0xfc92('0x55')]=_0x47525a[_0xfc92('0x55')];this[_0xfc92('0x8')]=_0x47525a[_0xfc92('0x8')];this[_0xfc92('0x29')]=_0x47525a[_0xfc92('0x29')];this[_0xfc92('0x9')]=_0x47525a[_0xfc92('0x9')];this[_0xfc92('0x2a')]=_0x47525a[_0xfc92('0x2a')];this[_0xfc92('0xa')]=_0x47525a[_0xfc92('0xa')];this[_0xfc92('0xb')]=_0x47525a[_0xfc92('0xb')];this[_0xfc92('0xc')]=_0x47525a[_0xfc92('0xc')];this[_0xfc92('0x56')]=_0x47525a[_0xfc92('0x56')];this[_0xfc92('0xd')]=_0x47525a[_0xfc92('0xd')];this['sumBillable']=_0x47525a[_0xfc92('0xf')];this[_0xfc92('0x10')]=_0x47525a[_0xfc92('0x10')];this[_0xfc92('0x11')]=_0x47525a['total'];if(this[_0xfc92('0x22')]===_0xfc92('0x57')){this[_0xfc92('0xe')]=_0x47525a[_0xfc92('0xe')];}};module[_0xfc92('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0x19da=['total','name','abandoned','available','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','loggedIn','paused','talking','waiting','answered','inUse','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','sumDuration'];(function(_0x1a632b,_0x485673){var _0x44c1df=function(_0xd4db2a){while(--_0xd4db2a){_0x1a632b['push'](_0x1a632b['shift']());}};_0x44c1df(++_0x485673);}(_0x19da,0x9f));var _0xa19d=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x19da[_0x3dea7d];return _0x53919a;};'use strict';var INBOUND_COUNTERS=['available',_0xa19d('0x0'),'loggedInDb',_0xa19d('0x1'),'ringing',_0xa19d('0x2'),_0xa19d('0x3')];var OUTBOUND_COUNTERS=['available',_0xa19d('0x4'),_0xa19d('0x5'),'loggedIn',_0xa19d('0x6'),_0xa19d('0x7'),_0xa19d('0x8'),_0xa19d('0x9'),_0xa19d('0xa'),_0xa19d('0xb'),_0xa19d('0xc'),'outboundNoAnswerCallsDay',_0xa19d('0xd'),_0xa19d('0xe'),_0xa19d('0xf'),'outboundUnknownCallsDay',_0xa19d('0x1'),_0xa19d('0x10'),_0xa19d('0x2'),_0xa19d('0x11'),_0xa19d('0x12'),_0xa19d('0x13'),'waiting'];function VoiceQueueSummary(_0x547799){this['id']=_0x547799['id'];this[_0xa19d('0x14')]=_0x547799[_0xa19d('0x14')];this['strategy']=_0x547799['strategy'];this[_0xa19d('0x15')]=_0x547799[_0xa19d('0x15')]||0x0;this['answered']=_0x547799[_0xa19d('0x4')]||0x0;this[_0xa19d('0x16')]=_0x547799[_0xa19d('0x16')]||0x0;this['busy']=_0x547799[_0xa19d('0x17')]||0x0;this['inUse']=_0x547799[_0xa19d('0x5')]||0x0;this[_0xa19d('0x18')]=_0x547799[_0xa19d('0x18')]||0x0;this[_0xa19d('0x0')]=_0x547799[_0xa19d('0x0')]||0x0;this[_0xa19d('0x6')]=_0x547799[_0xa19d('0x6')]||0x0;this[_0xa19d('0x19')]=_0x547799['onHold']||0x0;this[_0xa19d('0x1a')]=_0x547799['notInUse']||0x0;this[_0xa19d('0x1')]=_0x547799[_0xa19d('0x1')]||0x0;this[_0xa19d('0x1b')]=_0x547799[_0xa19d('0x1b')]||0x0;this[_0xa19d('0x1c')]=_0x547799[_0xa19d('0x1c')];this[_0xa19d('0x11')]=_0x547799['sumBillable'];this[_0xa19d('0x12')]=_0x547799[_0xa19d('0x12')];this[_0xa19d('0x1d')]=_0x547799[_0xa19d('0x1d')]||0x0;this[_0xa19d('0x2')]=_0x547799[_0xa19d('0x2')]||0x0;this[_0xa19d('0x13')]=_0x547799[_0xa19d('0x13')]||0x0;this[_0xa19d('0x1e')]=_0x547799['type'];this[_0xa19d('0x1f')]=_0x547799['unavailable']||0x0;this[_0xa19d('0x20')]=_0x547799[_0xa19d('0x20')]||0x0;this[_0xa19d('0x21')]=_0x547799[_0xa19d('0x21')]||0x0;this[_0xa19d('0x3')]=_0x547799[_0xa19d('0x3')]||0x0;if(_0x547799[_0xa19d('0x1e')]===_0xa19d('0x22')){this[_0xa19d('0x10')]=_0x547799[_0xa19d('0x10')]||0x0;this[_0xa19d('0x23')]=_0x547799[_0xa19d('0x23')];this[_0xa19d('0x24')]=_0x547799[_0xa19d('0x24')];this[_0xa19d('0x25')]=_0x547799[_0xa19d('0x25')];this[_0xa19d('0x26')]=_0x547799[_0xa19d('0x26')];this[_0xa19d('0x27')]=_0x547799[_0xa19d('0x27')];this[_0xa19d('0x28')]=_0x547799['dialPrefix'];this['temp']=_0x547799['temp'];this[_0xa19d('0x29')]=_0x547799[_0xa19d('0x29')];this[_0xa19d('0x9')]=_0x547799[_0xa19d('0x9')];this[_0xa19d('0xa')]=_0x547799['outboundBlacklistCallsDay'];this[_0xa19d('0xb')]=_0x547799[_0xa19d('0xb')];this[_0xa19d('0xc')]=_0x547799[_0xa19d('0xc')];this['outboundDropCallsDayACS']=_0x547799[_0xa19d('0x2a')];this[_0xa19d('0x2b')]=_0x547799[_0xa19d('0x2b')];this['outboundDropCallsDayTimeout']=_0x547799['outboundDropCallsDayTimeout'];this[_0xa19d('0x2c')]=_0x547799[_0xa19d('0x2c')];this['outboundNoSuchCallsDay']=_0x547799[_0xa19d('0xd')];this[_0xa19d('0x2d')]=_0x547799['outboundOriginateFailureCallsDay'];this[_0xa19d('0xe')]=_0x547799[_0xa19d('0xe')];this[_0xa19d('0xf')]=_0x547799[_0xa19d('0xf')];this[_0xa19d('0x2e')]=_0x547799['outboundUnknownCallsDay'];this[_0xa19d('0x2f')]=_0x547799[_0xa19d('0x2f')];this[_0xa19d('0x30')]=_0x547799[_0xa19d('0x30')];this[_0xa19d('0x31')]=_0x547799['predictiveIntervalAvgTalktime'];this[_0xa19d('0x32')]=_0x547799[_0xa19d('0x32')];this[_0xa19d('0x33')]=_0x547799[_0xa19d('0x33')];this[_0xa19d('0x34')]=_0x547799[_0xa19d('0x34')];this[_0xa19d('0x35')]=_0x547799[_0xa19d('0x35')];this['predictiveIntervalHitRate']=_0x547799['predictiveIntervalHitRate'];this[_0xa19d('0x36')]=_0x547799['predictiveIntervalMultiplicativeFactor'];this[_0xa19d('0x37')]=_0x547799[_0xa19d('0x37')];this['predictiveIntervalAvailable']=_0x547799[_0xa19d('0x38')];this[_0xa19d('0x39')]=_0x547799[_0xa19d('0x39')];this['originated']=_0x547799[_0xa19d('0x7')];this[_0xa19d('0x3a')]=_0x547799[_0xa19d('0x3a')];this['erlangCallToSecond']=_0x547799[_0xa19d('0x3b')];this[_0xa19d('0x3c')]=_0x547799[_0xa19d('0x3c')];this[_0xa19d('0x3d')]=_0x547799[_0xa19d('0x3d')];this[_0xa19d('0x3e')]=_0x547799[_0xa19d('0x3e')];this[_0xa19d('0x3f')]=_0x547799[_0xa19d('0x3f')];this[_0xa19d('0x40')]=_0x547799[_0xa19d('0x40')];this['statusMessage']=_0x547799[_0xa19d('0x41')];}if(_0x547799[_0xa19d('0x42')]){this['Trunk']={'id':_0x547799[_0xa19d('0x42')]['id'],'name':_0x547799[_0xa19d('0x42')][_0xa19d('0x14')],'active':_0x547799[_0xa19d('0x42')][_0xa19d('0x43')],'callerid':_0x547799[_0xa19d('0x42')][_0xa19d('0x44')]};}}VoiceQueueSummary[_0xa19d('0x45')][_0xa19d('0x46')]=function(_0x23d917,_0x5157e6,_0x32711c,_0xf561b1){this[_0xa19d('0x6')]=0x0;this[_0xa19d('0x2')]=0x0;this[_0xa19d('0x1')]=0x0;this[_0xa19d('0x20')]=0x0;this[_0xa19d('0x1a')]=0x0;this['inUse']=0x0;this['busy']=0x0;this['invalid']=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0xa19d('0x19')]=0x0;if(_0x32711c){if(_0x32711c['available']){this[_0xa19d('0x16')]=Number(_0x32711c[_0xa19d('0x16')]);}if(_0x32711c['loggedin']){this[_0xa19d('0x0')]=Number(_0x32711c[_0xa19d('0x47')]);}if(_0x32711c['callers']){this[_0xa19d('0x3')]=Number(_0x32711c[_0xa19d('0x48')]);}}for(var _0x2c3d44=0x0;_0x2c3d44<_0x23d917[_0xa19d('0x49')];_0x2c3d44++){var _0x484491=_0x5157e6[_0xa19d('0x4a')+_0x23d917[_0x2c3d44]['name']];if(_0x484491&&_0x484491[_0xa19d('0x4b')]){this['loggedInDb']+=0x1;}if(_0x23d917[_0x2c3d44][_0xa19d('0x4c')]==='1'){this[_0xa19d('0x2')]+=0x1;}if(_0x23d917[_0x2c3d44][_0xa19d('0x1')]==='1'&&!['2','7','8'][_0xa19d('0x4d')](_0x23d917[_0x2c3d44][_0xa19d('0x4e')])){this['paused']+=0x1;}switch(_0x23d917[_0x2c3d44][_0xa19d('0x4e')]){case'0':this[_0xa19d('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xa19d('0x5')]+=0x1;break;case'3':this[_0xa19d('0x17')]+=0x1;break;case'4':this[_0xa19d('0x18')]+=0x1;break;case'5':this[_0xa19d('0x1f')]+=0x1;break;case'6':this[_0xa19d('0x1b')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xa19d('0x19')]+=0x1;break;}}if(this[_0xa19d('0x24')]===_0xa19d('0x4f')){var _0x391d7c=Object[_0xa19d('0x50')](_0xf561b1);for(var _0x15904f=0x0;_0x15904f<_0x391d7c[_0xa19d('0x49')];_0x15904f++){var _0x1430cd=_0x391d7c[_0x15904f];var _0x1a95a8=_0xf561b1[_0x1430cd];if(_0x1a95a8[_0xa19d('0x51')]===this[_0xa19d('0x14')]&&_0x1a95a8['type']==='dialer'&&_0x1a95a8[_0xa19d('0x52')]==='xcally-motion-preview'){this[_0xa19d('0x2')]+=0x1;}}if(this[_0xa19d('0x2')]>this['inUse']){this[_0xa19d('0x2')]=this[_0xa19d('0x5')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xa19d('0x45')][_0xa19d('0x53')]=function(_0x491896){var _0x2f5c2b=![];if(_0x491896){_0x2f5c2b=INBOUND_COUNTERS[_0xa19d('0x54')](function(_0x5c646e){return this[_0x5c646e]!==_0x491896[_0x5c646e];},this);}return _0x2f5c2b;};VoiceQueueSummary[_0xa19d('0x45')][_0xa19d('0x55')]=function(_0x13a2b5){var _0x6d2418=![];var _0xdbd087=![];var _0x28e948=![];if(_0x13a2b5){_0x6d2418=this[_0xa19d('0x24')]!==_0x13a2b5['dialMethod']||this[_0xa19d('0x23')]!==_0x13a2b5[_0xa19d('0x23')]||this[_0xa19d('0x40')]!==_0x13a2b5[_0xa19d('0x40')]||this[_0xa19d('0x41')]!==_0x13a2b5[_0xa19d('0x41')];_0xdbd087=OUTBOUND_COUNTERS[_0xa19d('0x54')](function(_0x14ef63){return this[_0x14ef63]!==_0x13a2b5[_0x14ef63];},this);if(this[_0xa19d('0x42')]&&_0x13a2b5[_0xa19d('0x42')]){_0x28e948=this[_0xa19d('0x42')][_0xa19d('0x14')]!==_0x13a2b5['Trunk'][_0xa19d('0x14')]||this['Trunk'][_0xa19d('0x43')]!==_0x13a2b5[_0xa19d('0x42')][_0xa19d('0x43')];}}return _0x6d2418||_0xdbd087||_0x28e948;};VoiceQueueSummary[_0xa19d('0x45')][_0xa19d('0x56')]=function(_0xe6d631){this[_0xa19d('0x4')]=_0xe6d631[_0xa19d('0x4')];this['message']=_0xe6d631[_0xa19d('0x40')];this[_0xa19d('0x41')]=_0xe6d631[_0xa19d('0x41')];this[_0xa19d('0x7')]=_0xe6d631[_0xa19d('0x7')];this[_0xa19d('0x8')]=_0xe6d631[_0xa19d('0x8')];this[_0xa19d('0x9')]=_0xe6d631[_0xa19d('0x9')];this[_0xa19d('0xa')]=_0xe6d631[_0xa19d('0xa')];this[_0xa19d('0xb')]=_0xe6d631[_0xa19d('0xb')];this['outboundCongestionCallsDay']=_0xe6d631[_0xa19d('0xc')];this[_0xa19d('0x2c')]=_0xe6d631[_0xa19d('0x2c')];this[_0xa19d('0xd')]=_0xe6d631[_0xa19d('0xd')];this[_0xa19d('0xe')]=_0xe6d631['outboundReCallsDay'];this[_0xa19d('0xf')]=_0xe6d631[_0xa19d('0xf')];this[_0xa19d('0x2e')]=_0xe6d631[_0xa19d('0x2e')];this[_0xa19d('0x11')]=_0xe6d631[_0xa19d('0x11')];this[_0xa19d('0x12')]=_0xe6d631[_0xa19d('0x12')];this['total']=_0xe6d631[_0xa19d('0x13')];if(this[_0xa19d('0x24')]===_0xa19d('0x57')){this['pTalking']=_0xe6d631[_0xa19d('0x10')];}};module[_0xa19d('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9e59fd8..c9c81b1 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 _0xc8ba=['name','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x2f90d8,_0x2977dd){var _0x512d2d=function(_0x2a2f06){while(--_0x2a2f06){_0x2f90d8['push'](_0x2f90d8['shift']());}};_0x512d2d(++_0x2977dd);}(_0xc8ba,0x186));var _0xac8b=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0xc8ba[_0x5400a1];return _0x4006c7;};'use strict';function VtigerAccount(_0x241657){this['id']=_0x241657['id']||0x0;this[_0xac8b('0x0')]=_0x241657[_0xac8b('0x0')]||'';this['username']=_0x241657['username']||'';this[_0xac8b('0x1')]=_0x241657[_0xac8b('0x1')]||'';this[_0xac8b('0x2')]=_0x241657[_0xac8b('0x2')]||'';this['serverUrl']=_0x241657[_0xac8b('0x3')]||'';this[_0xac8b('0x4')]=_0x241657['Configurations']||{};}module[_0xac8b('0x5')]=VtigerAccount; \ No newline at end of file +var _0xb415=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x597070,_0x3f577b){var _0xea6b05=function(_0x2e86b6){while(--_0x2e86b6){_0x597070['push'](_0x597070['shift']());}};_0xea6b05(++_0x3f577b);}(_0xb415,0x131));var _0x5b41=function(_0x4c929a,_0x5e6cc7){_0x4c929a=_0x4c929a-0x0;var _0x25dec1=_0xb415[_0x4c929a];return _0x25dec1;};'use strict';function VtigerAccount(_0x5d7645){this['id']=_0x5d7645['id']||0x0;this[_0x5b41('0x0')]=_0x5d7645[_0x5b41('0x0')]||'';this[_0x5b41('0x1')]=_0x5d7645['username']||'';this[_0x5b41('0x2')]=_0x5d7645[_0x5b41('0x2')]||'';this[_0x5b41('0x3')]=_0x5d7645[_0x5b41('0x3')]||'';this['serverUrl']=_0x5d7645[_0x5b41('0x4')]||'';this[_0x5b41('0x5')]=_0x5d7645[_0x5b41('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 745b362..f3700c9 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 _0x8463=['Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x28e633,_0xe6024){var _0x4d714e=function(_0x4834bc){while(--_0x4834bc){_0x28e633['push'](_0x28e633['shift']());}};_0x4d714e(++_0xe6024);}(_0x8463,0x9b));var _0x3846=function(_0x469743,_0x239f9f){_0x469743=_0x469743-0x0;var _0x223ee9=_0x8463[_0x469743];return _0x223ee9;};'use strict';function ZendeskAccount(_0x36e86c){this['id']=_0x36e86c['id']||0x0;this[_0x3846('0x0')]=_0x36e86c[_0x3846('0x0')]||'';this[_0x3846('0x1')]=_0x36e86c[_0x3846('0x1')]||'';this[_0x3846('0x2')]=_0x36e86c[_0x3846('0x2')]||'';this[_0x3846('0x3')]=_0x36e86c[_0x3846('0x3')]||'';this['remoteUri']=_0x36e86c[_0x3846('0x4')]||'';this['authType']=_0x36e86c[_0x3846('0x5')]||'';this[_0x3846('0x6')]=_0x36e86c[_0x3846('0x6')]||'integrationTab';this['serverUrl']=_0x36e86c['serverUrl']||'';this[_0x3846('0x7')]=_0x36e86c[_0x3846('0x7')]||{};}module[_0x3846('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x91e7=['token','remoteUri','authType','type','integrationTab','serverUrl','exports','name','username','password'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0x91e7,0x15b));var _0x791e=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0x91e7[_0x1486e5];return _0x29d89b;};'use strict';function ZendeskAccount(_0x2f3ef8){this['id']=_0x2f3ef8['id']||0x0;this['name']=_0x2f3ef8[_0x791e('0x0')]||'';this[_0x791e('0x1')]=_0x2f3ef8[_0x791e('0x1')]||'';this[_0x791e('0x2')]=_0x2f3ef8[_0x791e('0x2')]||'';this[_0x791e('0x3')]=_0x2f3ef8['token']||'';this[_0x791e('0x4')]=_0x2f3ef8[_0x791e('0x4')]||'';this[_0x791e('0x5')]=_0x2f3ef8[_0x791e('0x5')]||'';this[_0x791e('0x6')]=_0x2f3ef8['type']||_0x791e('0x7');this[_0x791e('0x8')]=_0x2f3ef8['serverUrl']||'';this['Configurations']=_0x2f3ef8['Configurations']||{};}module[_0x791e('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 1582ad2..518d9dc 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 _0x331d=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x331d,0x186));var _0xd331=function(_0x40ffa9,_0x53bee4){_0x40ffa9=_0x40ffa9-0x0;var _0x5346ac=_0x331d[_0x40ffa9];return _0x5346ac;};'use strict';function ZohoAccount(_0x2f9833){this['id']=_0x2f9833['id']||0x0;this['name']=_0x2f9833[_0xd331('0x0')]||'';this['description']=_0x2f9833[_0xd331('0x1')]||'';this[_0xd331('0x2')]=_0x2f9833[_0xd331('0x2')]||'';this[_0xd331('0x3')]=_0x2f9833[_0xd331('0x3')]||'';this[_0xd331('0x4')]=_0x2f9833[_0xd331('0x4')]||'';this[_0xd331('0x5')]=_0x2f9833[_0xd331('0x5')]||'';this[_0xd331('0x6')]=_0x2f9833[_0xd331('0x6')]||'';this[_0xd331('0x7')]=_0x2f9833[_0xd331('0x7')]||'';this[_0xd331('0x8')]=_0x2f9833[_0xd331('0x8')]||'';this[_0xd331('0x9')]=_0x2f9833[_0xd331('0x9')]||{};}module[_0xd331('0xa')]=ZohoAccount; \ No newline at end of file +var _0xded3=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x3f88ba,_0x1cc8f2){var _0xd26dc4=function(_0x2e7339){while(--_0x2e7339){_0x3f88ba['push'](_0x3f88ba['shift']());}};_0xd26dc4(++_0x1cc8f2);}(_0xded3,0x127));var _0x3ded=function(_0x5dd1f6,_0x45a64e){_0x5dd1f6=_0x5dd1f6-0x0;var _0x57381b=_0xded3[_0x5dd1f6];return _0x57381b;};'use strict';function ZohoAccount(_0x4d2e33){this['id']=_0x4d2e33['id']||0x0;this[_0x3ded('0x0')]=_0x4d2e33[_0x3ded('0x0')]||'';this[_0x3ded('0x1')]=_0x4d2e33['description']||'';this[_0x3ded('0x2')]=_0x4d2e33[_0x3ded('0x2')]||'';this[_0x3ded('0x3')]=_0x4d2e33[_0x3ded('0x3')]||'';this[_0x3ded('0x4')]=_0x4d2e33['clientId']||'';this[_0x3ded('0x5')]=_0x4d2e33[_0x3ded('0x5')]||'';this[_0x3ded('0x6')]=_0x4d2e33['serverUrl']||'';this['code']=_0x4d2e33[_0x3ded('0x7')]||'';this[_0x3ded('0x8')]=_0x4d2e33[_0x3ded('0x8')]||'';this[_0x3ded('0x9')]=_0x4d2e33[_0x3ded('0x9')]||{};}module[_0x3ded('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 65eaddd..e1f104e 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 _0xd4a2=['type','campaigntype','dialAnswer','membername','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','isNil','string','uniqueid','idContact','queue','name'];(function(_0x34cda7,_0xfd20d4){var _0x2ae028=function(_0x33c78e){while(--_0x33c78e){_0x34cda7['push'](_0x34cda7['shift']());}};_0x2ae028(++_0xfd20d4);}(_0xd4a2,0x173));var _0x2d4a=function(_0x538565,_0x47a7e5){_0x538565=_0x538565-0x0;var _0x2197b7=_0xd4a2[_0x538565];return _0x2197b7;};'use strict';var util=require(_0x2d4a('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0xfba415,_0x576ffe,_0x2a8a71){var _0x57c5ca='';if(!_[_0x2d4a('0x1')](_0x576ffe)&&'string'===typeof _0x576ffe){_0x57c5ca+=_0x576ffe;}if(!_[_0x2d4a('0x1')](_0x2a8a71)&&_0x2d4a('0x2')===typeof _0x2a8a71){_0x57c5ca+='\x20'+_0x2a8a71;}if(_0x57c5ca!==''){return _0x57c5ca;}return _0xfba415;}function Action(_0x2624b5,_0x3a88e2,_0x1ca10b,_0x57058f,_0x45fefb){this[_0x2d4a('0x3')]=_0x1ca10b||undefined;this[_0x2d4a('0x4')]=_0x2624b5['id'];this[_0x2d4a('0x5')]=_0x3a88e2[_0x2d4a('0x6')];this[_0x2d4a('0x7')]=_0x3a88e2[_0x2d4a('0x7')];this[_0x2d4a('0x8')]=_0x2d4a('0x5');this[_0x2d4a('0x9')]=![];this[_0x2d4a('0xa')]=_[_0x2d4a('0x1')](_0x2624b5['Agent'])?undefined:_0x2624b5['Agent'][_0x2d4a('0x6')];this['channelAgent']=this[_0x2d4a('0xa')]?util[_0x2d4a('0xb')](_0x2d4a('0xc'),this[_0x2d4a('0xa')]):_0x57058f||undefined;this[_0x2d4a('0xd')]=checkNameSurname(_0x2624b5[_0x2d4a('0xe')][_0x2d4a('0xf')],_0x2624b5[_0x2d4a('0xe')]['firstName'],_0x2624b5['Contact'][_0x2d4a('0x10')]);this['active']=_0x2624b5[_0x2d4a('0x11')]||![];this[_0x2d4a('0x12')]=_0x2624b5[_0x2d4a('0xf')];this[_0x2d4a('0x13')]=_0x2624b5['scheduledat'];this[_0x2d4a('0x14')]=_0x2624b5['countbusyretry']||0x0;this[_0x2d4a('0x15')]=_0x2624b5['countcongestionretry']||0x0;this[_0x2d4a('0x16')]=_0x2624b5[_0x2d4a('0x16')]||0x0;this[_0x2d4a('0x17')]=(_0x2624b5[_0x2d4a('0x14')]||0x0)+(_0x2624b5['countcongestionretry']||0x0)+(_0x2624b5['countnoanswerretry']||0x0)+(_0x2624b5['countnosuchnumberretry']||0x0)+(_0x2624b5[_0x2d4a('0x18')]||0x0)+(_0x2624b5[_0x2d4a('0x19')]||0x0)+(_0x2624b5[_0x2d4a('0x1a')]||0x0)+(_0x2624b5[_0x2d4a('0x1b')]||0x0);this[_0x2d4a('0x1c')]=_0x2624b5[_0x2d4a('0x1c')]||0x0;this['countdropretry']=_0x2624b5['countdropretry']||0x0;this[_0x2d4a('0x19')]=_0x2624b5[_0x2d4a('0x19')]||0x0;this[_0x2d4a('0x1a')]=_0x2624b5[_0x2d4a('0x1a')]||0x0;this[_0x2d4a('0x1b')]=_0x2624b5[_0x2d4a('0x1b')]||0x0;this[_0x2d4a('0x1d')]=_0x2624b5[_0x2d4a('0x1d')];this['callbackuniqueid']=_0x2624b5[_0x2d4a('0x1e')];this[_0x2d4a('0x1f')]=_0x2624b5[_0x2d4a('0x1f')];this[_0x2d4a('0x20')]=_0x2624b5[_0x2d4a('0x20')];this[_0x2d4a('0x21')]=_0x2624b5[_0x2d4a('0x21')];this[_0x2d4a('0x22')]=_0x2624b5['ListId'];this['UserId']=_['isNil'](_0x2624b5[_0x2d4a('0x23')])?_0x2624b5['UserId']:_0x2624b5[_0x2d4a('0x23')]['id'];this[_0x2d4a('0x24')]=_0x2624b5[_0x2d4a('0x24')];this[_0x2d4a('0x25')]='';this[_0x2d4a('0x26')]='';}Action[_0x2d4a('0x27')][_0x2d4a('0x28')]=function(){return util[_0x2d4a('0xb')]('\x22%s\x22\x20<%s>',this[_0x2d4a('0xd')],this['number']);};module[_0x2d4a('0x29')]=Action; \ No newline at end of file +var _0xbbbc=['idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','Contact','phone','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','string','isNil','uniqueid'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x55c3d3,_0x3a9f5a){_0x55c3d3=_0x55c3d3-0x0;var _0x67f880=_0xbbbc[_0x55c3d3];return _0x67f880;};'use strict';var util=require(_0xcbbb('0x0'));var _=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));function checkNameSurname(_0x4538f9,_0x3ec75b,_0x3e91a2){var _0x464b75='';if(!_['isNil'](_0x3ec75b)&&_0xcbbb('0x3')===typeof _0x3ec75b){_0x464b75+=_0x3ec75b;}if(!_[_0xcbbb('0x4')](_0x3e91a2)&&_0xcbbb('0x3')===typeof _0x3e91a2){_0x464b75+='\x20'+_0x3e91a2;}if(_0x464b75!==''){return _0x464b75;}return _0x4538f9;}function Action(_0x3ccbf6,_0x43ff05,_0x4978a9,_0x388197,_0x1796b4){this[_0xcbbb('0x5')]=_0x4978a9||undefined;this[_0xcbbb('0x6')]=_0x3ccbf6['id'];this[_0xcbbb('0x7')]=_0x43ff05[_0xcbbb('0x8')];this[_0xcbbb('0x9')]=_0x43ff05['type'];this[_0xcbbb('0xa')]='queue';this['dialAnswer']=![];this[_0xcbbb('0xb')]=_['isNil'](_0x3ccbf6[_0xcbbb('0xc')])?undefined:_0x3ccbf6['Agent'][_0xcbbb('0x8')];this[_0xcbbb('0xd')]=this['membername']?util[_0xcbbb('0xe')]('SIP/%s',this[_0xcbbb('0xb')]):_0x388197||undefined;this['calleridname']=checkNameSurname(_0x3ccbf6[_0xcbbb('0xf')][_0xcbbb('0x10')],_0x3ccbf6[_0xcbbb('0xf')]['firstName'],_0x3ccbf6[_0xcbbb('0xf')][_0xcbbb('0x11')]);this[_0xcbbb('0x12')]=_0x3ccbf6[_0xcbbb('0x12')]||![];this['calleridnum']=_0x3ccbf6['phone'];this[_0xcbbb('0x13')]=_0x3ccbf6[_0xcbbb('0x13')];this[_0xcbbb('0x14')]=_0x3ccbf6[_0xcbbb('0x14')]||0x0;this['countcongestionretry']=_0x3ccbf6[_0xcbbb('0x15')]||0x0;this['countnoanswerretry']=_0x3ccbf6[_0xcbbb('0x16')]||0x0;this[_0xcbbb('0x17')]=(_0x3ccbf6[_0xcbbb('0x14')]||0x0)+(_0x3ccbf6['countcongestionretry']||0x0)+(_0x3ccbf6['countnoanswerretry']||0x0)+(_0x3ccbf6['countnosuchnumberretry']||0x0)+(_0x3ccbf6[_0xcbbb('0x18')]||0x0)+(_0x3ccbf6[_0xcbbb('0x19')]||0x0)+(_0x3ccbf6[_0xcbbb('0x1a')]||0x0)+(_0x3ccbf6[_0xcbbb('0x1b')]||0x0);this[_0xcbbb('0x1c')]=_0x3ccbf6[_0xcbbb('0x1c')]||0x0;this[_0xcbbb('0x18')]=_0x3ccbf6[_0xcbbb('0x18')]||0x0;this[_0xcbbb('0x19')]=_0x3ccbf6[_0xcbbb('0x19')]||0x0;this['countmachineretry']=_0x3ccbf6[_0xcbbb('0x1a')]||0x0;this[_0xcbbb('0x1b')]=_0x3ccbf6[_0xcbbb('0x1b')]||0x0;this[_0xcbbb('0x1d')]=_0x3ccbf6[_0xcbbb('0x1d')];this[_0xcbbb('0x1e')]=_0x3ccbf6[_0xcbbb('0x1e')];this[_0xcbbb('0x1f')]=_0x3ccbf6[_0xcbbb('0x1f')];this['recallme']=_0x3ccbf6[_0xcbbb('0x20')];this[_0xcbbb('0x21')]=_0x3ccbf6['ContactId'];this[_0xcbbb('0x22')]=_0x3ccbf6['ListId'];this['UserId']=_[_0xcbbb('0x4')](_0x3ccbf6[_0xcbbb('0xc')])?_0x3ccbf6['UserId']:_0x3ccbf6['Agent']['id'];this['VoiceQueueId']=_0x3ccbf6[_0xcbbb('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xcbbb('0x24')][_0xcbbb('0x25')]=function(){return util[_0xcbbb('0xe')](_0xcbbb('0x26'),this[_0xcbbb('0x27')],this[_0xcbbb('0x28')]);};module[_0xcbbb('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1d80749..1ce3e35 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x317f30,_0x3995c0){var _0x238020=function(_0x412ed9){while(--_0x412ed9){_0x317f30['push'](_0x317f30['shift']());}};_0x238020(++_0x3995c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4ed6c0,_0x1d0214){var _0x5ce369=function(_0x529ad1){while(--_0x529ad1){_0x4ed6c0['push'](_0x4ed6c0['shift']());}};_0x5ce369(++_0x1d0214);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 63a2757..dfc55fb 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 _0x87fb=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x87fb,0xe9));var _0xb87f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x87fb[_0x2d7f0e];return _0x110b07;};'use strict';var util=require(_0xb87f('0x0'));var BPromise=require(_0xb87f('0x1'));var logger=require(_0xb87f('0x2'))(_0xb87f('0x3'));var cmHopper=require(_0xb87f('0x4'));var cmHopperHistory=require(_0xb87f('0x5'));var cmHopperBlack=require(_0xb87f('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x5e9fcf){return function(_0xfaed74){logger[_0xb87f('0x7')](_0x5e9fcf,util[_0xb87f('0x8')](_0xfaed74,{'showHidden':![],'depth':null}));};}function create(_0x5796a0){return cmHopperHistory[_0xb87f('0x9')](_0x5796a0)[_0xb87f('0xa')](loggerCatch(_0xb87f('0xb')));}function createAgent(_0x1f279e){return BPromise[_0xb87f('0xc')]()[_0xb87f('0xd')](agentReportPreview[_0xb87f('0x9')](_0x1f279e))['catch'](loggerCatch(_0xb87f('0xb')));}function moveContact(_0x194661){return cmHopper[_0xb87f('0xe')](_0x194661,!![])[_0xb87f('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xb87f('0xf')]=function(_0x2edd53){return cmHopperBlack['checkIsBlackList'](_0x2edd53)[_0xb87f('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xb87f('0x10')]=function(_0x1dea03){return BPromise[_0xb87f('0xc')]()[_0xb87f('0xd')](cmHopper[_0xb87f('0x10')](_0x1dea03))[_0xb87f('0xa')](loggerCatch(_0xb87f('0x11')));};exports[_0xb87f('0x9')]=function(_0x1e15c8,_0x1d2487){create(_0x1e15c8)[_0xb87f('0xa')](loggerCatch(_0x1d2487));moveContact(_0x1e15c8)['catch'](loggerCatch(_0x1d2487));};exports[_0xb87f('0x12')]=function(_0x1eb26b,_0x73f527){createAgent(_0x1eb26b)[_0xb87f('0xa')](loggerCatch(_0x73f527));};exports[_0xb87f('0x13')]=function(_0x4d070a,_0x317122){create(_0x4d070a)[_0xb87f('0xa')](loggerCatch(_0x317122));};exports[_0xb87f('0x14')]=function(_0x27b9b5,_0x4c0ca8){moveContact(_0x27b9b5)[_0xb87f('0xa')](loggerCatch(_0x4c0ca8));};exports[_0xb87f('0x15')]=function(_0x5dcce4,_0x11e2a5,_0x4f7f6f){if(_0x11e2a5){_0x5dcce4[_0xb87f('0x16')]=null;}if(_0x4f7f6f){_0x5dcce4['active']=![];}return cmHopper[_0xb87f('0x15')](_0x5dcce4)[_0xb87f('0xa')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xb87f('0x17')]=function(_0x5882e7){return cmHopper[_0xb87f('0x17')](_0x5882e7)[_0xb87f('0xa')](loggerCatch(_0xb87f('0x18')));};exports[_0xb87f('0x19')]=function(_0x1353e1){return cmHopper[_0xb87f('0x19')]({'UserId':null},_0x1353e1,0x1)['catch'](loggerCatch(_0xb87f('0x1a')));};exports['disableContact']=function(_0x570c23){return cmHopper[_0xb87f('0x19')]({'active':![]},_0x570c23,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports[_0xb87f('0x1b')]=function(_0x2876cd){var _0xe52d59={};_0xe52d59[_0xb87f('0x1c')]=_0x2876cd['type'];_0xe52d59[_0xb87f('0x1d')]=_0x2876cd['uniqueid'];_0xe52d59[_0xb87f('0x1e')]=_0x2876cd[_0xb87f('0x1e')];_0xe52d59[_0xb87f('0x1f')]=_0x2876cd[_0xb87f('0x1f')];_0xe52d59[_0xb87f('0x20')]=_0x2876cd['queue'];_0xe52d59[_0xb87f('0x21')]=_0x2876cd['answertime'];_0xe52d59[_0xb87f('0x22')]=_0x2876cd['answertime'];_0xe52d59['queuecallercomplete']=0x1;_0xe52d59[_0xb87f('0x23')]=_0x2876cd[_0xb87f('0x24')];_0xe52d59[_0xb87f('0x25')]=_0x2876cd[_0xb87f('0x26')];_0xe52d59[_0xb87f('0x27')]=_0xb87f('0x28');_0xe52d59[_0xb87f('0x29')]=_0xb87f('0x2a');_0xe52d59[_0xb87f('0x2b')]=0x0;_0xe52d59['assigned']=0x1;_0xe52d59[_0xb87f('0x2c')]=_0x2876cd[_0xb87f('0x26')];_0xe52d59[_0xb87f('0x2d')]=_0xb87f('0x2e');return BPromise[_0xb87f('0xc')]()[_0xb87f('0xd')](voiceQueueReport[_0xb87f('0x2f')](_0xe52d59))['catch'](loggerCatch(_0xb87f('0x30')));};exports[_0xb87f('0x31')]=function(_0x4dc2ab,_0x4e1ecb){return BPromise[_0xb87f('0xc')]()['then'](cmHopper[_0xb87f('0x31')](_0x4dc2ab,_0x4e1ecb))[_0xb87f('0xa')](loggerCatch(_0xb87f('0x32')));};exports[_0xb87f('0x33')]=function(_0x379c62){return cmHopper['rescheduleContact'](_0x379c62,!![],!![])[_0xb87f('0xa')](loggerCatch(_0xb87f('0x34')));}; \ No newline at end of file +var _0x4638=['checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','moveContactManagedDialer','catch'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0x4638,0x1b8));var _0x8463=function(_0x284d7d,_0x2773a4){_0x284d7d=_0x284d7d-0x0;var _0x558628=_0x4638[_0x284d7d];return _0x558628;};'use strict';var util=require(_0x8463('0x0'));var BPromise=require(_0x8463('0x1'));var logger=require(_0x8463('0x2'))(_0x8463('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x8463('0x4'));var cmHopperBlack=require(_0x8463('0x5'));var agentReportPreview=require(_0x8463('0x6'));var voiceQueueReport=require(_0x8463('0x7'));function loggerCatch(_0x2028ed){return function(_0xa46cda){logger[_0x8463('0x8')](_0x2028ed,util[_0x8463('0x9')](_0xa46cda,{'showHidden':![],'depth':null}));};}function create(_0x398802){return cmHopperHistory[_0x8463('0xa')](_0x398802)['catch'](loggerCatch(_0x8463('0xb')));}function createAgent(_0x17f8e9){return BPromise[_0x8463('0xc')]()[_0x8463('0xd')](agentReportPreview[_0x8463('0xa')](_0x17f8e9))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2e2750){return cmHopper[_0x8463('0xe')](_0x2e2750,!![])[_0x8463('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x8463('0x10')]=function(_0x109dff){return cmHopperBlack[_0x8463('0x10')](_0x109dff)['catch'](loggerCatch(_0x8463('0x11')));};exports['getContactPreview']=function(_0x30b033){return BPromise[_0x8463('0xc')]()['then'](cmHopper[_0x8463('0x12')](_0x30b033))[_0x8463('0xf')](loggerCatch(_0x8463('0x13')));};exports[_0x8463('0xa')]=function(_0x207fea,_0x4cd2cf){create(_0x207fea)['catch'](loggerCatch(_0x4cd2cf));moveContact(_0x207fea)['catch'](loggerCatch(_0x4cd2cf));};exports[_0x8463('0x14')]=function(_0x48ae42,_0x23bbe5){createAgent(_0x48ae42)[_0x8463('0xf')](loggerCatch(_0x23bbe5));};exports[_0x8463('0x15')]=function(_0x10d01b,_0x421171){create(_0x10d01b)[_0x8463('0xf')](loggerCatch(_0x421171));};exports[_0x8463('0x16')]=function(_0x4a1d29,_0xf94b44){moveContact(_0x4a1d29)[_0x8463('0xf')](loggerCatch(_0xf94b44));};exports[_0x8463('0x17')]=function(_0x2c495a,_0xd5141c,_0x7ca404){if(_0xd5141c){_0x2c495a[_0x8463('0x18')]=null;}if(_0x7ca404){_0x2c495a['active']=![];}return cmHopper['rescheduleContact'](_0x2c495a)[_0x8463('0xf')](loggerCatch(_0x8463('0x19')));};exports[_0x8463('0x1a')]=function(_0x907abe){return cmHopper[_0x8463('0x1a')](_0x907abe)[_0x8463('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x8463('0x1b')]=function(_0x206198){return cmHopper[_0x8463('0x1b')]({'UserId':null},_0x206198,0x1)[_0x8463('0xf')](loggerCatch(_0x8463('0x1c')));};exports[_0x8463('0x1d')]=function(_0x279c06){return cmHopper[_0x8463('0x1b')]({'active':![]},_0x279c06,0x1)[_0x8463('0xf')](loggerCatch(_0x8463('0x1e')));};exports[_0x8463('0x1f')]=function(_0x33437b){var _0x583a76={};_0x583a76[_0x8463('0x20')]=_0x33437b[_0x8463('0x20')];_0x583a76[_0x8463('0x21')]=_0x33437b[_0x8463('0x21')];_0x583a76[_0x8463('0x22')]=_0x33437b[_0x8463('0x22')];_0x583a76[_0x8463('0x23')]=_0x33437b[_0x8463('0x23')];_0x583a76[_0x8463('0x24')]=_0x33437b['queue'];_0x583a76[_0x8463('0x25')]=_0x33437b[_0x8463('0x26')];_0x583a76[_0x8463('0x27')]=_0x33437b[_0x8463('0x26')];_0x583a76[_0x8463('0x28')]=0x1;_0x583a76[_0x8463('0x29')]=_0x33437b['endtime'];_0x583a76[_0x8463('0x2a')]=_0x33437b[_0x8463('0x2b')];_0x583a76[_0x8463('0x2c')]=_0x8463('0x2d');_0x583a76[_0x8463('0x2e')]=_0x8463('0x2f');_0x583a76['holdtime']=0x0;_0x583a76[_0x8463('0x30')]=0x1;_0x583a76[_0x8463('0x31')]=_0x33437b[_0x8463('0x2b')];_0x583a76[_0x8463('0x32')]=_0x8463('0x33');return BPromise[_0x8463('0xc')]()['then'](voiceQueueReport[_0x8463('0x34')](_0x583a76))[_0x8463('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x8463('0x35')]=function(_0xe32ddc,_0x520238){return BPromise[_0x8463('0xc')]()[_0x8463('0xd')](cmHopper[_0x8463('0x35')](_0xe32ddc,_0x520238))[_0x8463('0xf')](loggerCatch(_0x8463('0x36')));};exports[_0x8463('0x37')]=function(_0x13f015){return cmHopper[_0x8463('0x17')](_0x13f015,!![],!![])['catch'](loggerCatch(_0x8463('0x38')));}; \ 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 dc2d750..410f285 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 _0x609d=['bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','toLowerCase','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','error','inspect','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','answertime','Failure','variablesAction','calleridname','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countagentrejectretry','cloneAction','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','name','voice','mandatoryDisposition','buildObj','not_inuse','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','campaigntype','dialAnswer','countcongestionretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosloss'];(function(_0x203318,_0x1fa2b5){var _0x375caa=function(_0x1b296e){while(--_0x1b296e){_0x203318['push'](_0x203318['shift']());}};_0x375caa(++_0x1fa2b5);}(_0x609d,0x8e));var _0xd609=function(_0x2e0a85,_0x242749){_0x2e0a85=_0x2e0a85-0x0;var _0x2c49bb=_0x609d[_0x2e0a85];return _0x2c49bb;};'use strict';var util=require('util');var _=require(_0xd609('0x0'));var moment=require(_0xd609('0x1'));var logger=require(_0xd609('0x2'))('preview');var ipAgi=process['env'][_0xd609('0x3')]||'127.0.0.1';var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x2e0bbb){return function(_0x33e760){logger[_0xd609('0x4')](_0x2e0bbb,util[_0xd609('0x5')](_0x33e760,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3f5735,_0x47b0e2){logger[_0xd609('0x6')](_0x3f5735,util['inspect'](_0x47b0e2,{'showHidden':![],'depth':null}));};exports[_0xd609('0x7')]=function(_0x47fa74,_0x59f062){logger[_0xd609('0x4')](_0x47fa74,util['inspect'](_0x59f062,{'showHidden':![],'depth':null}));};exports[_0xd609('0x8')]=function(_0x137009){return function(_0x4df1de){logger[_0xd609('0x6')](_0x137009,util['inspect'](_0x4df1de,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x41d059,_0x32e6a0,_0x45ce81){return{'message':_0x41d059,'unlock':_0x32e6a0,'active':_0x45ce81};};exports[_0xd609('0x9')]=function(_0x1a4d41,_0x49531d,_0xac4bcc){if(!_[_0xd609('0xa')](_0xac4bcc)&&_0xd609('0xb')===typeof _0xac4bcc&&!_[_0xd609('0xc')](_0xac4bcc)){if(!_[_0xd609('0xa')](_0x49531d)&&_0xd609('0xb')===typeof _0x49531d&&!_[_0xd609('0xc')](_0x49531d)){return util[_0xd609('0xd')](_0xd609('0xe'),_0x49531d,_0xac4bcc);}return util[_0xd609('0xd')](_0xd609('0xe'),_0xac4bcc,_0xac4bcc);}if(!_[_0xd609('0xa')](_0x1a4d41)&&_0xd609('0xb')===typeof _0x1a4d41&&!_[_0xd609('0xc')](_0x1a4d41)){return _0x1a4d41;}return _0xd609('0xf');};exports['isActive']=function(_0x5049c1){if(_[_0xd609('0x10')](_0x5049c1)){return![];}return _0x5049c1;};exports[_0xd609('0x11')]=function(_0x392ef9,_0xe8df65,_0x2f2b11,_0x3d6413,_0x504494,_0x5d2cb6){var _0x15880d={'XMD-QUEUE':_0xe8df65[_0xd609('0x12')]?_0xe8df65['Queue']['name']:'','XMD-CALLERID':_0x3d6413,'XMD-CALLERID-PREVIEW':_0x5d2cb6?util[_0xd609('0xd')](_0xd609('0xe'),_0x5d2cb6['calleridname'],_0x5d2cb6[_0xd609('0x13')]):_0x3d6413,'XMD-DIALID':_0x504494,'XMD-CONTACTID':_0xe8df65[_0xd609('0x14')],'XMD-CDRTYPE':_0xd609('0x15'),'CALLERID(all)':_0x3d6413,'XMD-VOICEQUEUEID':_0xe8df65[_0xd609('0x16')],'XMD-DIALCHANNEL':_0x2f2b11,'XMD-DIALTIMEOUT':_0x392ef9['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd609('0xd')]('\x22rtTxX%s%s\x22',_0x392ef9[_0xd609('0x17')]?'g':'',_[_0xd609('0xc')](_0x392ef9['monitor_format'])?'':_0xd609('0x18')),'XMD-DIALURL':_0x392ef9[_0xd609('0x19')]||'','XMD-AGI':_0x392ef9[_0xd609('0x1a')]?util[_0xd609('0xd')]('\x22agi://%s/square,%s\x22',ipAgi,_0x392ef9[_0xd609('0x1a')]):_0xd609('0x1b'),'XMD-AGIAFTER':_0x392ef9[_0xd609('0x17')]?util[_0xd609('0xd')](_0xd609('0x1c'),ipAgi,_0x392ef9['dialQueueProject2']):_0xd609('0x1b'),'XMD-ORIGINATECALLERIDNUM':_0x5d2cb6?_0x5d2cb6[_0xd609('0x1d')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d2cb6?_0x5d2cb6[_0xd609('0x1e')]:'','XMD-DESTINATION':_0xd609('0x1f'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xd609('0xc')](_0x392ef9[_0xd609('0x20')])){_0x15880d[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x392ef9['monitor_format'];_0x15880d[util[_0xd609('0xd')]('%s',_0xd609('0x21'))]=_0x504494;}return _0x15880d;};exports[_0xd609('0x22')]=function(_0x41f2a2){var _0x183df2={};for(var _0x2147ad in _0x41f2a2){if(_0x41f2a2[_0xd609('0x23')](_0x2147ad)){_0x183df2[util[_0xd609('0xd')]('%s',_[_0xd609('0x24')](_0x2147ad))]=_0x41f2a2[_0x2147ad];}}return{'variables':_0x183df2};};exports['updateOriginated']=function(_0x982027,_0x120932){if(!_[_0xd609('0x10')](_0x982027)){if(_0x982027[_0xd609('0x23')](_0xd609('0x25'))){if(_0x982027['originated']>0x0){_0x982027[_0xd609('0x25')]-=0x1;}else{logger['error'](_0xd609('0x26'),_0x120932);}}}else{logger[_0xd609('0x4')](_0xd609('0x27'),_0x120932);}};exports[_0xd609('0x28')]=function(_0x1d4f20){var _0x4c18ba=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1d4f20[_0xd609('0x29')]=0xd;_0x1d4f20[_0xd609('0x2a')]=_0xd609('0x2b');_0x1d4f20[_0xd609('0x2c')]=_0x4c18ba;_0x1d4f20[_0xd609('0x2d')]=_0x4c18ba;_0x1d4f20[_0xd609('0x2e')]=_0x4c18ba;};exports[_0xd609('0x2f')]=function(_0x5ba2ff,_0xbe2f38,_0x3f3382){var _0x3c016e=moment()[_0xd609('0xd')](_0xd609('0x30'));_0x5ba2ff['state']=_0xbe2f38;_0x5ba2ff[_0xd609('0x2a')]=_0x3f3382;_0x5ba2ff[_0xd609('0x2d')]=_0x3c016e;_0x5ba2ff[_0xd609('0x31')]=utils[_0xd609('0x32')](_0x5ba2ff[_0xd609('0x2d')],_0x5ba2ff[_0xd609('0x2c')]);};exports[_0xd609('0x33')]=function(_0x482809,_0x1cb123,_0x3faebf){_0x482809[_0xd609('0x34')]=_0x1cb123;_0x482809[_0xd609('0x35')]=_0x3faebf;};exports[_0xd609('0x36')]=function(_0x36c88f,_0x1d5dda,_0x33ffac){var _0x20dd42=moment()[_0xd609('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x36c88f[_0xd609('0x29')]=_0x1d5dda;_0x36c88f['statedesc']=_0x33ffac;_0x36c88f[_0xd609('0x2d')]=_0x36c88f['responsetime']?_0x36c88f[_0xd609('0x2d')]:_0x20dd42;_0x36c88f[_0xd609('0x2e')]=_0x36c88f['endtime']?_0x36c88f['endtime']:_0x20dd42;_0x36c88f['ringtime']=utils[_0xd609('0x32')](_0x36c88f[_0xd609('0x2d')]||0x0,_0x36c88f[_0xd609('0x2c')]||0x0);_0x36c88f['talktime']=_0x36c88f[_0xd609('0x37')]?utils[_0xd609('0x32')](_0x36c88f[_0xd609('0x2e')],_0x36c88f[_0xd609('0x37')]):0x0;};exports['isFailure']=function(_0x433f71){return _0x433f71===_0xd609('0x38');};exports[_0xd609('0x39')]=function(_0x413660,_0x31d149,_0x32c9b3,_0x4b9d7f,_0x1ce281){var _0x5a06c9=_0x4b9d7f?'RECALL':_0x413660[_0xd609('0x3a')];_0x5a06c9=_0x1ce281?_0xd609('0x3b'):_0x5a06c9;return{'actionid':_0x413660[_0xd609('0x3c')],'action':'originate','channel':_0x413660[_0xd609('0x3d')],'callerid':util[_0xd609('0xd')]('\x22%s\x22\x20<%s>',_0x5a06c9,_0x413660[_0xd609('0x13')]),'Exten':_0xd609('0x1f'),'Context':_0xd609('0x3e'),'Priority':'1','variable':_0x32c9b3,'timeout':(_0x31d149[_0xd609('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x413660[_0xd609('0x3c')]};};exports[_0xd609('0x40')]=function(_0x371f17){return _0x371f17[_0xd609('0x41')]+_0x371f17['countcongestionretry']+_0x371f17['countnoanswerretry']+_0x371f17[_0xd609('0x42')]+_0x371f17['countnosuchnumberretry'];};exports[_0xd609('0x43')]=function(_0x45b2ee){var _0x3fc092=_['clone'](_0x45b2ee);_0x3fc092[_0xd609('0x29')]=0xf;_0x3fc092[_0xd609('0x2a')]='Global';return _0x3fc092;};exports[_0xd609('0x44')]=function(_0x5ab683,_0xa035fb,_0x31271f){var _0x1f5eda={};_0x1f5eda[_0xa035fb]=_0x5ab683[_0xa035fb];_0x1f5eda[_0xd609('0x45')]=![];_0x1f5eda[_0xd609('0x46')]=moment()[_0xd609('0x47')](_0x31271f,'minutes')[_0xd609('0xd')](_0xd609('0x30'));_0x1f5eda[_0xd609('0x14')]=_0x5ab683[_0xd609('0x14')];_0x1f5eda[_0xd609('0x48')]=_0x5ab683['ListId'];_0x1f5eda[_0xd609('0x16')]=_0x5ab683['VoiceQueueId']||undefined;return _0x1f5eda;};exports[_0xd609('0x49')]=function(_0x31bca1,_0x495782){if(!_[_0xd609('0x10')](_0x31bca1)){if(_0x31bca1[_0xd609('0x4a')]>0x0){_0x31bca1[_0xd609('0x4a')]-=0x1;}else{logger[_0xd609('0x4')](_0x495782,_0xd609('0x4b'));}}else{logger[_0xd609('0x4')](_0x495782,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xd609('0x4c')]=function(_0x353a4c){if(_0x353a4c<=0x0){return!![];}return![];};function buildObj(_0x17eb6d,_0x356156,_0x2c616d){_0x17eb6d['lastevent']=_0x356156;_0x17eb6d[_0xd609('0x4d')]=_0x17eb6d['queue'];_0x17eb6d['interface']=_0x17eb6d[_0xd609('0x3d')];_0x17eb6d['motionChannel']=_0xd609('0x4e');if(_0x2c616d){_0x17eb6d[_0xd609('0x4f')]=_0x2c616d[_0xd609('0x4f')];}return _0x17eb6d;}exports[_0xd609('0x50')]=buildObj;exports['agentReadyId']=function(_0x12cb49){var _0x568380=[];for(var _0x19540e in _0x12cb49){if(_0x12cb49[_0xd609('0x23')](_0x19540e)){if(!_[_0xd609('0x10')](_0x12cb49[_0x19540e])&&_0x12cb49[_0x19540e][_0xd609('0x29')]===_0xd609('0x51')&&_0x12cb49[_0x19540e]['status']===_0xd609('0x52')){_0x568380[_0xd609('0x53')](_0x12cb49[_0x19540e]['id']);}}}return _0x568380;};exports[_0xd609('0x54')]=function(_0xccddfa){var _0x51217b=moment()[_0xd609('0x55')](0x0);var _0x5bc0e=moment(_0xccddfa)[_0xd609('0x55')](0x0);return _0x51217b[_0xd609('0x56')](_0x5bc0e,_0xd609('0x57'));};exports[_0xd609('0x58')]=function(_0x19164a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x19164a[_0xd609('0x14')],'ListId':_0x19164a['ListId'],'VoiceQueueId':_0x19164a['VoiceQueueId']||undefined,'CampaignId':_0x19164a[_0xd609('0x59')]||undefined};};exports['filterKey']=function(_0x1c095){if(_0x1c095===_0xd609('0x3c')||_0x1c095===_0xd609('0x5a')||_0x1c095==='queue'||_0x1c095==='type'||_0x1c095===_0xd609('0x5b')||_0x1c095===_0xd609('0x5c')||_0x1c095===_0xd609('0x34')||_0x1c095===_0xd609('0x3d')||_0x1c095==='calleridname'||_0x1c095===_0xd609('0x45')||_0x1c095==='calleridnum'||_0x1c095===_0xd609('0x46')||_0x1c095===_0xd609('0x41')||_0x1c095===_0xd609('0x5d')||_0x1c095==='countnoanswerretry'||_0x1c095===_0xd609('0x5e')||_0x1c095==='callback'||_0x1c095===_0xd609('0x5f')||_0x1c095===_0xd609('0x60')||_0x1c095===_0xd609('0x61')||_0x1c095===_0xd609('0x14')||_0x1c095==='ListId'||_0x1c095===_0xd609('0x35')||_0x1c095===_0xd609('0x16')||_0x1c095===_0xd609('0x62')||_0x1c095==='xmd-voicequeueid'||_0x1c095===_0xd609('0x63')||_0x1c095===_0xd609('0x64')||_0x1c095===_0xd609('0x65')||_0x1c095===_0xd609('0x66')||_0x1c095===_0xd609('0x67')||_0x1c095===_0xd609('0x68')||_0x1c095===_0xd609('0x69')||_0x1c095==='xmd-dialchannel'||_0x1c095==='xmd-contactid'||_0x1c095===_0xd609('0x6a')||_0x1c095===_0xd609('0x6b')||_0x1c095===_0xd609('0x6c')||_0x1c095===_0xd609('0x6d')||_0x1c095==='rtpaudioqos'||_0x1c095===_0xd609('0x6e')||_0x1c095===_0xd609('0x6f')||_0x1c095===_0xd609('0x70')||_0x1c095==='rtpaudioqosloss'||_0x1c095===_0xd609('0x71')||_0x1c095===_0xd609('0x72')||_0x1c095===_0xd609('0x73')||_0x1c095===_0xd609('0x74')||_0x1c095===_0xd609('0x6e')||_0x1c095===_0xd609('0x6f')||_0x1c095===_0xd609('0x70')||_0x1c095===_0xd609('0x75')||_0x1c095==='rtpaudioqoslossbridged'||_0x1c095===_0xd609('0x72')||_0x1c095===_0xd609('0x73')||_0x1c095===_0xd609('0x76')||_0x1c095===_0xd609('0x77')||_0x1c095===_0xd609('0x29')||_0x1c095===_0xd609('0x2a')){return![];}return!![];};exports[_0xd609('0x78')]=function(_0x7feba3,_0x4fe469){var _0x24ab30,_0x486cfe,_0x4d8df9;if(_0x4fe469<=0x0){_0x4fe469=0x1;}_0x24ab30=new RegExp('\x5cw{0,'+_0x4fe469+'}$');_0x486cfe=Math[_0xd609('0x79')](0xa,_0x4fe469-0x1);_0x4d8df9=Math[_0xd609('0x79')](0xa,_0x4fe469)-0x1;return util[_0xd609('0xd')]('%s',_[_0xd609('0x7a')](_0x7feba3,_0x24ab30,_[_0xd609('0x7b')](_0x486cfe,_0x4d8df9)));};exports[_0xd609('0x7c')]=function(_0x1a2702){var _0x36faac=_0x1a2702[_0xd609('0x7d')](/"(.*?)"/);return _0x36faac?_0x36faac[0x1]:_0x1a2702;};exports[_0xd609('0x7e')]=function(_0x45ec72){var _0x5d0bc6=_0x45ec72[_0xd609('0x7d')](/<(.*?)>/);return _0x5d0bc6?_0x5d0bc6[0x1]:_0x45ec72;};function buildNoAnswerEventPayload(_0x223b3f,_0x3488ac){var _0x2bd943=buildObj(_0x223b3f,_0xd609('0x7f'));if(!_['isEmpty'](_0x3488ac[_0xd609('0x80')])){Object['keys'](_0x3488ac[_0xd609('0x80')])['forEach'](function(_0x3c4f61){_0x2bd943[_0x3c4f61[_0xd609('0x81')]()]=_0x3488ac['variables'][_0x3c4f61];});}return _0x2bd943;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x2d9d=['\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','endtime','logAgent','responsetime','ringtime','getSeconds','UserId','starttime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','name','queue','interface','motionChannel','mandatoryDisposition','buildObj','agentReadyId','status','reachable','push','milliseconds','diff','seconds','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject'];(function(_0x16e248,_0x3acc80){var _0x107821=function(_0x4e9cdc){while(--_0x4e9cdc){_0x16e248['push'](_0x16e248['shift']());}};_0x107821(++_0x3acc80);}(_0x2d9d,0x6f));var _0xd2d9=function(_0x2b9c17,_0xc8ac81){_0x2b9c17=_0x2b9c17-0x0;var _0x28711d=_0x2d9d[_0x2b9c17];return _0x28711d;};'use strict';var util=require('util');var _=require(_0xd2d9('0x0'));var moment=require(_0xd2d9('0x1'));var logger=require(_0xd2d9('0x2'))(_0xd2d9('0x3'));var ipAgi=process[_0xd2d9('0x4')][_0xd2d9('0x5')]||_0xd2d9('0x6');var utils=require('../../dialer/utils');exports[_0xd2d9('0x7')]=function(_0x436ea7){return function(_0x2d00b1){logger[_0xd2d9('0x8')](_0x436ea7,util[_0xd2d9('0x9')](_0x2d00b1,{'showHidden':![],'depth':null}));};};exports[_0xd2d9('0xa')]=function(_0x55f4a3,_0x5506ae){logger[_0xd2d9('0xb')](_0x55f4a3,util[_0xd2d9('0x9')](_0x5506ae,{'showHidden':![],'depth':null}));};exports[_0xd2d9('0xc')]=function(_0x2990a0,_0x2d3ff8){logger['error'](_0x2990a0,util[_0xd2d9('0x9')](_0x2d3ff8,{'showHidden':![],'depth':null}));};exports[_0xd2d9('0xd')]=function(_0x42a72b){return function(_0x966b28){logger['info'](_0x42a72b,util[_0xd2d9('0x9')](_0x966b28,{'showHidden':![],'depth':null}));};};exports[_0xd2d9('0xe')]=function(_0x2548fc,_0x2b6485,_0x4186d5){return{'message':_0x2548fc,'unlock':_0x2b6485,'active':_0x4186d5};};exports['getCallerId']=function(_0x36a4f6,_0x58d6f0,_0x309cc5){if(!_[_0xd2d9('0xf')](_0x309cc5)&&_0xd2d9('0x10')===typeof _0x309cc5&&!_['isEmpty'](_0x309cc5)){if(!_[_0xd2d9('0xf')](_0x58d6f0)&&_0xd2d9('0x10')===typeof _0x58d6f0&&!_[_0xd2d9('0x11')](_0x58d6f0)){return util['format'](_0xd2d9('0x12'),_0x58d6f0,_0x309cc5);}return util[_0xd2d9('0x13')]('\x22%s\x22\x20<%s>',_0x309cc5,_0x309cc5);}if(!_['isUndefined'](_0x36a4f6)&&'string'===typeof _0x36a4f6&&!_[_0xd2d9('0x11')](_0x36a4f6)){return _0x36a4f6;}return'\x22\x22\x20<>';};exports[_0xd2d9('0x14')]=function(_0x58b205){if(_['isNil'](_0x58b205)){return![];}return _0x58b205;};exports[_0xd2d9('0x15')]=function(_0x2b33cb,_0x4f5a14,_0x36de86,_0x26afce,_0x1f1083,_0xba144b){var _0x3af26c={'XMD-QUEUE':_0x4f5a14[_0xd2d9('0x16')]?_0x4f5a14[_0xd2d9('0x16')]['name']:'','XMD-CALLERID':_0x26afce,'XMD-CALLERID-PREVIEW':_0xba144b?util['format'](_0xd2d9('0x12'),_0xba144b[_0xd2d9('0x17')],_0xba144b[_0xd2d9('0x18')]):_0x26afce,'XMD-DIALID':_0x1f1083,'XMD-CONTACTID':_0x4f5a14[_0xd2d9('0x19')],'XMD-CDRTYPE':_0xd2d9('0x1a'),'CALLERID(all)':_0x26afce,'XMD-VOICEQUEUEID':_0x4f5a14['VoiceQueueId'],'XMD-DIALCHANNEL':_0x36de86,'XMD-DIALTIMEOUT':_0x2b33cb['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd2d9('0x13')](_0xd2d9('0x1b'),_0x2b33cb['dialQueueProject2']?'g':'',_[_0xd2d9('0x11')](_0x2b33cb[_0xd2d9('0x1c')])?'':_0xd2d9('0x1d')),'XMD-DIALURL':_0x2b33cb[_0xd2d9('0x1e')]||'','XMD-AGI':_0x2b33cb[_0xd2d9('0x1f')]?util[_0xd2d9('0x13')](_0xd2d9('0x20'),ipAgi,_0x2b33cb[_0xd2d9('0x1f')]):_0xd2d9('0x21'),'XMD-AGIAFTER':_0x2b33cb[_0xd2d9('0x22')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2b33cb['dialQueueProject2']):_0xd2d9('0x21'),'XMD-ORIGINATECALLERIDNUM':_0xba144b?_0xba144b[_0xd2d9('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0xba144b?_0xba144b[_0xd2d9('0x24')]:'','XMD-DESTINATION':_0xd2d9('0x25'),'SIPADDHEADER':_0xd2d9('0x26')};if(!_[_0xd2d9('0x11')](_0x2b33cb['monitor_format'])){_0x3af26c[util[_0xd2d9('0x13')]('%s',_0xd2d9('0x27'))]=_0x2b33cb[_0xd2d9('0x1c')];_0x3af26c[util['format']('%s',_0xd2d9('0x28'))]=_0x1f1083;}return _0x3af26c;};exports[_0xd2d9('0x29')]=function(_0x5401a1){var _0x362d66={};for(var _0x22ec15 in _0x5401a1){if(_0x5401a1[_0xd2d9('0x2a')](_0x22ec15)){_0x362d66[util['format']('%s',_[_0xd2d9('0x2b')](_0x22ec15))]=_0x5401a1[_0x22ec15];}}return{'variables':_0x362d66};};exports[_0xd2d9('0x2c')]=function(_0x5c44ab,_0x5a4d79){if(!_[_0xd2d9('0x2d')](_0x5c44ab)){if(_0x5c44ab[_0xd2d9('0x2a')]('originated')){if(_0x5c44ab[_0xd2d9('0x2e')]>0x0){_0x5c44ab[_0xd2d9('0x2e')]-=0x1;}else{logger['error'](_0xd2d9('0x2f'),_0x5a4d79);}}}else{logger[_0xd2d9('0x8')](_0xd2d9('0x30'),_0x5a4d79);}};exports[_0xd2d9('0x31')]=function(_0x3291d6){var _0x443cb9=moment()[_0xd2d9('0x13')](_0xd2d9('0x32'));_0x3291d6[_0xd2d9('0x33')]=0xd;_0x3291d6[_0xd2d9('0x34')]='Blacklist';_0x3291d6['starttime']=_0x443cb9;_0x3291d6['responsetime']=_0x443cb9;_0x3291d6[_0xd2d9('0x35')]=_0x443cb9;};exports[_0xd2d9('0x36')]=function(_0x23ca9f,_0x43dc57,_0x108db0){var _0x3e6460=moment()[_0xd2d9('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x23ca9f['state']=_0x43dc57;_0x23ca9f[_0xd2d9('0x34')]=_0x108db0;_0x23ca9f[_0xd2d9('0x37')]=_0x3e6460;_0x23ca9f[_0xd2d9('0x38')]=utils[_0xd2d9('0x39')](_0x23ca9f[_0xd2d9('0x37')],_0x23ca9f['starttime']);};exports['logLookAgent']=function(_0xd7d938,_0x3557f2,_0x29d874){_0xd7d938['membername']=_0x3557f2;_0xd7d938[_0xd2d9('0x3a')]=_0x29d874;};exports['logCustomer']=function(_0x1b5950,_0x4fdf2c,_0x42e381){var _0x54e52c=moment()[_0xd2d9('0x13')](_0xd2d9('0x32'));_0x1b5950['state']=_0x4fdf2c;_0x1b5950['statedesc']=_0x42e381;_0x1b5950['responsetime']=_0x1b5950[_0xd2d9('0x37')]?_0x1b5950[_0xd2d9('0x37')]:_0x54e52c;_0x1b5950['endtime']=_0x1b5950[_0xd2d9('0x35')]?_0x1b5950[_0xd2d9('0x35')]:_0x54e52c;_0x1b5950[_0xd2d9('0x38')]=utils[_0xd2d9('0x39')](_0x1b5950[_0xd2d9('0x37')]||0x0,_0x1b5950[_0xd2d9('0x3b')]||0x0);_0x1b5950[_0xd2d9('0x3c')]=_0x1b5950[_0xd2d9('0x3d')]?utils[_0xd2d9('0x39')](_0x1b5950[_0xd2d9('0x35')],_0x1b5950[_0xd2d9('0x3d')]):0x0;};exports['isFailure']=function(_0x413cd1){return _0x413cd1===_0xd2d9('0x3e');};exports[_0xd2d9('0x3f')]=function(_0x257b2c,_0x6bb963,_0x4241fd,_0x4d3687,_0x295185){var _0x4f9ad7=_0x4d3687?_0xd2d9('0x40'):_0x257b2c['calleridname'];_0x4f9ad7=_0x295185?_0xd2d9('0x41'):_0x4f9ad7;return{'actionid':_0x257b2c[_0xd2d9('0x42')],'action':_0xd2d9('0x43'),'channel':_0x257b2c[_0xd2d9('0x44')],'callerid':util['format'](_0xd2d9('0x12'),_0x4f9ad7,_0x257b2c[_0xd2d9('0x18')]),'Exten':_0xd2d9('0x25'),'Context':'from-sip','Priority':'1','variable':_0x4241fd,'timeout':(_0x6bb963[_0xd2d9('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x257b2c['uniqueid']};};exports[_0xd2d9('0x46')]=function(_0x11d13c){return _0x11d13c[_0xd2d9('0x47')]+_0x11d13c[_0xd2d9('0x48')]+_0x11d13c['countnoanswerretry']+_0x11d13c[_0xd2d9('0x49')]+_0x11d13c[_0xd2d9('0x4a')];};exports[_0xd2d9('0x4b')]=function(_0x5e4ea7){var _0x2dfcc9=_[_0xd2d9('0x4c')](_0x5e4ea7);_0x2dfcc9[_0xd2d9('0x33')]=0xf;_0x2dfcc9[_0xd2d9('0x34')]='Global';return _0x2dfcc9;};exports[_0xd2d9('0x4d')]=function(_0x3e9893,_0x91c909,_0x860b1d){var _0x2f3bcc={};_0x2f3bcc[_0x91c909]=_0x3e9893[_0x91c909];_0x2f3bcc[_0xd2d9('0x4e')]=![];_0x2f3bcc[_0xd2d9('0x4f')]=moment()['add'](_0x860b1d,_0xd2d9('0x50'))['format'](_0xd2d9('0x32'));_0x2f3bcc[_0xd2d9('0x19')]=_0x3e9893[_0xd2d9('0x19')];_0x2f3bcc[_0xd2d9('0x51')]=_0x3e9893[_0xd2d9('0x51')];_0x2f3bcc[_0xd2d9('0x52')]=_0x3e9893[_0xd2d9('0x52')]||undefined;return _0x2f3bcc;};exports['decrementTalkink']=function(_0x19fe53,_0x215963){if(!_[_0xd2d9('0x2d')](_0x19fe53)){if(_0x19fe53['pTalking']>0x0){_0x19fe53[_0xd2d9('0x53')]-=0x1;}else{logger['error'](_0x215963,_0xd2d9('0x54'));}}else{logger[_0xd2d9('0x8')](_0x215963,_0xd2d9('0x55'));}};exports['IsNotLoggedIn']=function(_0x3d8673){if(_0x3d8673<=0x0){return!![];}return![];};function buildObj(_0x35fdcf,_0x186141,_0x426353){_0x35fdcf['lastevent']=_0x186141;_0x35fdcf[_0xd2d9('0x56')]=_0x35fdcf[_0xd2d9('0x57')];_0x35fdcf[_0xd2d9('0x58')]=_0x35fdcf['channelAgent'];_0x35fdcf[_0xd2d9('0x59')]='voice';if(_0x426353){_0x35fdcf[_0xd2d9('0x5a')]=_0x426353[_0xd2d9('0x5a')];}return _0x35fdcf;}exports[_0xd2d9('0x5b')]=buildObj;exports[_0xd2d9('0x5c')]=function(_0x116c68){var _0xa79499=[];for(var _0x5760f4 in _0x116c68){if(_0x116c68[_0xd2d9('0x2a')](_0x5760f4)){if(!_[_0xd2d9('0x2d')](_0x116c68[_0x5760f4])&&_0x116c68[_0x5760f4][_0xd2d9('0x33')]==='not_inuse'&&_0x116c68[_0x5760f4][_0xd2d9('0x5d')]===_0xd2d9('0x5e')){_0xa79499[_0xd2d9('0x5f')](_0x116c68[_0x5760f4]['id']);}}}return _0xa79499;};exports['getDiff']=function(_0x39b504){var _0x2cf69b=moment()[_0xd2d9('0x60')](0x0);var _0x1f5584=moment(_0x39b504)[_0xd2d9('0x60')](0x0);return _0x2cf69b[_0xd2d9('0x61')](_0x1f5584,_0xd2d9('0x62'));};exports['createBody']=function(_0x25e4fb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x25e4fb[_0xd2d9('0x19')],'ListId':_0x25e4fb[_0xd2d9('0x51')],'VoiceQueueId':_0x25e4fb['VoiceQueueId']||undefined,'CampaignId':_0x25e4fb['CampaignId']||undefined};};exports['filterKey']=function(_0x2cfe37){if(_0x2cfe37==='uniqueid'||_0x2cfe37===_0xd2d9('0x63')||_0x2cfe37===_0xd2d9('0x57')||_0x2cfe37===_0xd2d9('0x64')||_0x2cfe37===_0xd2d9('0x65')||_0x2cfe37===_0xd2d9('0x66')||_0x2cfe37==='membername'||_0x2cfe37===_0xd2d9('0x44')||_0x2cfe37===_0xd2d9('0x17')||_0x2cfe37===_0xd2d9('0x4e')||_0x2cfe37===_0xd2d9('0x18')||_0x2cfe37===_0xd2d9('0x4f')||_0x2cfe37==='countbusyretry'||_0x2cfe37===_0xd2d9('0x48')||_0x2cfe37===_0xd2d9('0x67')||_0x2cfe37===_0xd2d9('0x68')||_0x2cfe37===_0xd2d9('0x69')||_0x2cfe37===_0xd2d9('0x6a')||_0x2cfe37===_0xd2d9('0x6b')||_0x2cfe37==='recallme'||_0x2cfe37===_0xd2d9('0x19')||_0x2cfe37===_0xd2d9('0x51')||_0x2cfe37===_0xd2d9('0x3a')||_0x2cfe37==='VoiceQueueId'||_0x2cfe37==='sipcallid'||_0x2cfe37===_0xd2d9('0x6c')||_0x2cfe37===_0xd2d9('0x6d')||_0x2cfe37===_0xd2d9('0x6e')||_0x2cfe37===_0xd2d9('0x6f')||_0x2cfe37===_0xd2d9('0x70')||_0x2cfe37===_0xd2d9('0x71')||_0x2cfe37===_0xd2d9('0x72')||_0x2cfe37===_0xd2d9('0x73')||_0x2cfe37===_0xd2d9('0x74')||_0x2cfe37===_0xd2d9('0x75')||_0x2cfe37===_0xd2d9('0x76')||_0x2cfe37===_0xd2d9('0x77')||_0x2cfe37===_0xd2d9('0x78')||_0x2cfe37==='xmd-agi'||_0x2cfe37===_0xd2d9('0x79')||_0x2cfe37===_0xd2d9('0x7a')||_0x2cfe37==='rtpaudioqosjitter'||_0x2cfe37===_0xd2d9('0x7b')||_0x2cfe37===_0xd2d9('0x7c')||_0x2cfe37===_0xd2d9('0x7d')||_0x2cfe37===_0xd2d9('0x7e')||_0x2cfe37===_0xd2d9('0x7f')||_0x2cfe37==='rtpaudioqos'||_0x2cfe37===_0xd2d9('0x7a')||_0x2cfe37===_0xd2d9('0x80')||_0x2cfe37===_0xd2d9('0x7b')||_0x2cfe37===_0xd2d9('0x7c')||_0x2cfe37==='rtpaudioqoslossbridged'||_0x2cfe37===_0xd2d9('0x7e')||_0x2cfe37==='rtpaudioqosrttbridged'||_0x2cfe37===_0xd2d9('0x81')||_0x2cfe37===_0xd2d9('0x82')||_0x2cfe37===_0xd2d9('0x33')||_0x2cfe37===_0xd2d9('0x34')){return![];}return!![];};exports[_0xd2d9('0x83')]=function(_0x565a7c,_0x3245b6){var _0x2ed541,_0x1468d1,_0xb19e56;if(_0x3245b6<=0x0){_0x3245b6=0x1;}_0x2ed541=new RegExp(_0xd2d9('0x84')+_0x3245b6+'}$');_0x1468d1=Math[_0xd2d9('0x85')](0xa,_0x3245b6-0x1);_0xb19e56=Math[_0xd2d9('0x85')](0xa,_0x3245b6)-0x1;return util[_0xd2d9('0x13')]('%s',_[_0xd2d9('0x86')](_0x565a7c,_0x2ed541,_[_0xd2d9('0x87')](_0x1468d1,_0xb19e56)));};exports[_0xd2d9('0x88')]=function(_0xe50f20){var _0x5c2d7c=_0xe50f20[_0xd2d9('0x89')](/"(.*?)"/);return _0x5c2d7c?_0x5c2d7c[0x1]:_0xe50f20;};exports[_0xd2d9('0x8a')]=function(_0x2662b6){var _0x2385fb=_0x2662b6[_0xd2d9('0x89')](/<(.*?)>/);return _0x2385fb?_0x2385fb[0x1]:_0x2662b6;};function buildNoAnswerEventPayload(_0x30670f,_0x5a3c6c){var _0x350fda=buildObj(_0x30670f,_0xd2d9('0x8b'));if(!_['isEmpty'](_0x5a3c6c[_0xd2d9('0x8c')])){Object['keys'](_0x5a3c6c[_0xd2d9('0x8c')])['forEach'](function(_0x5b1107){_0x350fda[_0x5b1107[_0xd2d9('0x8d')]()]=_0x5a3c6c['variables'][_0x5b1107];});}return _0x350fda;}exports[_0xd2d9('0x8e')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 753189a..4680c77 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 _0x7d0e=['string','number','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','queueadd'];(function(_0x501889,_0x5395d1){var _0x48590e=function(_0x597bec){while(--_0x597bec){_0x501889['push'](_0x501889['shift']());}};_0x48590e(++_0x5395d1);}(_0x7d0e,0x131));var _0xe7d0=function(_0x28d4cc,_0xeed642){_0x28d4cc=_0x28d4cc-0x0;var _0x39374b=_0x7d0e[_0x28d4cc];return _0x39374b;};'use strict';exports[_0xe7d0('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xe7d0('0x1'),'required':!![]},'penalty':{'type':_0xe7d0('0x2'),'required':![]},'paused':{'type':_0xe7d0('0x3'),'required':![]}};exports[_0xe7d0('0x4')]={'queue':{'type':_0xe7d0('0x1'),'required':!![]},'interface':{'type':_0xe7d0('0x1'),'required':!![]}};exports[_0xe7d0('0x5')]={'interface':{'type':_0xe7d0('0x1'),'required':!![]},'paused':{'type':_0xe7d0('0x3')},'reason':{'type':_0xe7d0('0x1'),'required':![]}};exports[_0xe7d0('0x6')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xe7d0('0x1'),'required':!![]}};exports[_0xe7d0('0x7')]={'uniqueid':{'type':_0xe7d0('0x1'),'required':!![]},'filename':{'type':_0xe7d0('0x1')},'format':{'type':_0xe7d0('0x1')},'mixmonitorid':{'type':_0xe7d0('0x1')}};exports[_0xe7d0('0x8')]={'uniqueid':{'type':_0xe7d0('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xe7d0('0x1'),'required':!![]},'exten':{'type':_0xe7d0('0x1'),'required':!![]},'context':{'type':_0xe7d0('0x1')}}; \ No newline at end of file +var _0xf551=['string','number','boolean','queueremove','reload','voicequeuechannel','voicequeuechannelredirect','queueadd'];(function(_0x4bd809,_0x4ea384){var _0x33a8aa=function(_0x2d48c3){while(--_0x2d48c3){_0x4bd809['push'](_0x4bd809['shift']());}};_0x33a8aa(++_0x4ea384);}(_0xf551,0xe7));var _0x1f55=function(_0x374eb7,_0x3e9edd){_0x374eb7=_0x374eb7-0x0;var _0x51b1ae=_0xf551[_0x374eb7];return _0x51b1ae;};'use strict';exports[_0x1f55('0x0')]={'queue':{'type':_0x1f55('0x1'),'required':!![]},'interface':{'type':_0x1f55('0x1'),'required':!![]},'membername':{'type':_0x1f55('0x1'),'required':!![]},'penalty':{'type':_0x1f55('0x2'),'required':![]},'paused':{'type':_0x1f55('0x3'),'required':![]}};exports[_0x1f55('0x4')]={'queue':{'type':_0x1f55('0x1'),'required':!![]},'interface':{'type':_0x1f55('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x1f55('0x3')},'reason':{'type':'string','required':![]}};exports[_0x1f55('0x5')]={'module':{'type':_0x1f55('0x1'),'required':![]}};exports[_0x1f55('0x6')]={'uniqueid':{'type':_0x1f55('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x1f55('0x1'),'required':!![]},'filename':{'type':_0x1f55('0x1')},'format':{'type':_0x1f55('0x1')},'mixmonitorid':{'type':_0x1f55('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x1f55('0x1'),'required':!![]}};exports[_0x1f55('0x7')]={'uniqueid':{'type':_0x1f55('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x1f55('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 109fcf0..823fb40 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 _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x22d450,_0x5df6a3){var _0x1d2eba=function(_0x37e1bf){while(--_0x37e1bf){_0x22d450['push'](_0x22d450['shift']());}};_0x1d2eba(++_0x5df6a3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x2378d7,_0xd46258){var _0x58dc15=function(_0x1bf0ba){while(--_0x1bf0ba){_0x2378d7['push'](_0x2378d7['shift']());}};_0x58dc15(++_0xd46258);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c52e6,_0x2a98fa){_0x5c52e6=_0x5c52e6-0x0;var _0x48c5ef=_0x5f2f[_0x5c52e6];return _0x48c5ef;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f7c1bae..5755ea7 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa62d=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x27b992,_0x42e849){var _0x46fc18=function(_0x585211){while(--_0x585211){_0x27b992['push'](_0x27b992['shift']());}};_0x46fc18(++_0x42e849);}(_0xa62d,0x1d3));var _0xda62=function(_0x568db8,_0x43490){_0x568db8=_0x568db8-0x0;var _0x209d13=_0xa62d[_0x568db8];return _0x209d13;};'use strict';function mergeDBDataToRealtime(_0x49810e,_0x4ebc64){var _0x2ecc71=Object[_0xda62('0x0')]({},_0x49810e);for(var _0x3b0c50 in _0x4ebc64){if(_0x2ecc71[_0xda62('0x1')](_0x3b0c50)){_0x2ecc71[_0x3b0c50]=_0x4ebc64[_0x3b0c50];}}return _0x2ecc71;}exports[_0xda62('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xe1fd=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x324f55,_0x2e6ca4){var _0x284952=function(_0x36ceae){while(--_0x36ceae){_0x324f55['push'](_0x324f55['shift']());}};_0x284952(++_0x2e6ca4);}(_0xe1fd,0x17e));var _0xde1f=function(_0x15afea,_0x22eb67){_0x15afea=_0x15afea-0x0;var _0x54005f=_0xe1fd[_0x15afea];return _0x54005f;};'use strict';function mergeDBDataToRealtime(_0x165f16,_0x5b79b7){var _0x42dc1b=Object['assign']({},_0x165f16);for(var _0x49c1f7 in _0x5b79b7){if(_0x42dc1b[_0xde1f('0x0')](_0x49c1f7)){_0x42dc1b[_0x49c1f7]=_0x5b79b7[_0x49c1f7];}}return _0x42dc1b;}exports[_0xde1f('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 9da1325..012a476 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 _0x1c30=['agents','telephones','prototype','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','getAgentByInternal','keys','getCallType','channel','internal','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','split','membername','create','monitor','monitors','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','realtime'];(function(_0x30ba85,_0x503490){var _0x58b533=function(_0x131acf){while(--_0x131acf){_0x30ba85['push'](_0x30ba85['shift']());}};_0x58b533(++_0x503490);}(_0x1c30,0x162));var _0x01c3=function(_0x54c695,_0x5d6677){_0x54c695=_0x54c695-0x0;var _0x3ce06b=_0x1c30[_0x54c695];return _0x3ce06b;};'use strict';var _=require(_0x01c3('0x0'));var moment=require(_0x01c3('0x1'));var util=require(_0x01c3('0x2'));var config=require('../../../config/environment');var ami=require(_0x01c3('0x3'));var RpcVoiceAgentReport=require(_0x01c3('0x4'));var RpcVoiceCallReport=require(_0x01c3('0x5'));var RpcVoiceDialReport=require(_0x01c3('0x6'));var RpcMemberReport=require(_0x01c3('0x7'));var RpcVoiceQueueReport=require(_0x01c3('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x01c3('0x9'));var VoiceQueueReport=require(_0x01c3('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x01c3('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x01c3('0xc'));function Report(_0x116268){this[_0x01c3('0xd')]=_0x116268;this[_0x01c3('0xe')]=_0x116268[_0x01c3('0xe')];this[_0x01c3('0xf')]=_0x116268[_0x01c3('0xf')];}Report[_0x01c3('0x10')]['sync']=function(_0x388504){var _0x20ee55=new VoiceQueueReport(this[_0x01c3('0xd')]);var _0x28b7c1=new VoiceAgentReport(this['realtime']);var _0x42160a=new VoiceDialReport(this[_0x01c3('0xd')]);var _0x4c4637=new VoiceCallReport(this[_0x01c3('0xd')]);var _0x36d0cf=new UserReport(this[_0x01c3('0xd')]);if(config['xdr']&&config['xdr'][_0x01c3('0x11')]){ami['on']('custom:voiceQueueReport',this[_0x01c3('0x12')][_0x01c3('0x13')](this));ami['on'](_0x01c3('0x14'),this[_0x01c3('0x15')][_0x01c3('0x13')](this));ami['on'](_0x01c3('0x16'),this[_0x01c3('0x17')][_0x01c3('0x13')](this));ami['on'](_0x01c3('0x18'),this['voiceDialReport'][_0x01c3('0x13')](this));ami['on'](_0x01c3('0x19'),this['blindTransfer'][_0x01c3('0x13')](this));ami['on'](_0x01c3('0x1a'),this[_0x01c3('0x1b')][_0x01c3('0x13')](this));}};Report[_0x01c3('0x10')][_0x01c3('0x1c')]=function(_0x44eaab){var _0x2a25fe;_0x2a25fe=_[_0x01c3('0x1d')](this[_0x01c3('0xe')],function(_0x2e8ade){return _0x2e8ade[_0x01c3('0x1e')]==_0x44eaab||_0x2e8ade[_0x01c3('0x1f')]==_0x44eaab;});if(_[_0x01c3('0x20')](_0x2a25fe)){var _0xde3262=_[_0x01c3('0x1d')](this['telephones'],function(_0x422cce){return _0x422cce[_0x01c3('0x1e')]==_0x44eaab||_0x422cce[_0x01c3('0x1f')]==_0x44eaab;});if(_0xde3262){_0x2a25fe=_['find'](this[_0x01c3('0xe')],function(_0x594213){return _0x594213[_0x01c3('0x21')]==util[_0x01c3('0x22')](_0x01c3('0x23'),_0xde3262[_0x01c3('0x1f')]);});}}return _0x2a25fe;};Report[_0x01c3('0x10')][_0x01c3('0x12')]=function(_0x38a42c){for(var _0x5b7663=0x0;_0x5b7663<_0x38a42c[_0x01c3('0x24')];_0x5b7663+=0x1){var _0x4ad4f4=this[_0x01c3('0x1c')](_0x38a42c[_0x5b7663][_0x01c3('0x25')]);if(_0x4ad4f4){_0x38a42c[_0x5b7663][_0x01c3('0x1e')]=_0x4ad4f4['accountcode'];_0x38a42c[_0x5b7663][_0x01c3('0x26')]=!![];_0x38a42c[_0x5b7663][_0x01c3('0x27')]=_0x4ad4f4[_0x01c3('0x1f')];_0x38a42c[_0x5b7663]['interface']=_[_0x01c3('0x20')](_0x4ad4f4[_0x01c3('0x21')])?util['format'](_0x01c3('0x23'),_0x4ad4f4[_0x01c3('0x1f')]):_0x4ad4f4[_0x01c3('0x21')];if(_0x38a42c[_0x5b7663][_0x01c3('0x28')]){_0x38a42c[_0x5b7663]['queuecallercompleteAt']=moment()[_0x01c3('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x38a42c[_0x5b7663][_0x01c3('0x29')]){_0x38a42c[_0x5b7663][_0x01c3('0x2a')]=moment()['format'](_0x01c3('0x2b'));}RpcMemberReport[_0x01c3('0x12')](_0x38a42c[_0x5b7663]);}RpcVoiceQueueReport['create'](_0x38a42c[_0x5b7663]);}};function extractCalleridNumber(_0x4359ae){var _0x3fd47c=_0x4359ae['match'](/<(.*?)>/);return _0x3fd47c?_0x3fd47c[0x1]:_0x4359ae;}Report['prototype'][_0x01c3('0x2c')]=function(_0x49be37){for(var _0x33e590=0x0;_0x33e590','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','create','isArray','forEach','startsWith','indexOf','phone','substring','transfererlinkedid','attendedTransfer','exports','moment','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport'];(function(_0x2436d0,_0x354b64){var _0x47562b=function(_0x16e99d){while(--_0x16e99d){_0x2436d0['push'](_0x2436d0['shift']());}};_0x47562b(++_0x354b64);}(_0x717b,0xa6));var _0xb717=function(_0x5abfc0,_0x770944){_0x5abfc0=_0x5abfc0-0x0;var _0x11dc30=_0x717b[_0x5abfc0];return _0x11dc30;};'use strict';var _=require('lodash');var moment=require(_0xb717('0x0'));var util=require('util');var config=require(_0xb717('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xb717('0x2'));var RpcVoiceCallReport=require(_0xb717('0x3'));var RpcVoiceDialReport=require(_0xb717('0x4'));var RpcMemberReport=require(_0xb717('0x5'));var RpcVoiceQueueReport=require(_0xb717('0x6'));var RpcVoiceRecording=require(_0xb717('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xb717('0x8'));var VoiceCallReport=require(_0xb717('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xb717('0xa'));var UserReport=require(_0xb717('0xb'));function Report(_0x123448){this[_0xb717('0xc')]=_0x123448;this[_0xb717('0xd')]=_0x123448[_0xb717('0xd')];this[_0xb717('0xe')]=_0x123448[_0xb717('0xe')];}Report[_0xb717('0xf')]['sync']=function(_0x4f39d1){var _0x1e50db=new VoiceQueueReport(this[_0xb717('0xc')]);var _0x8e3538=new VoiceAgentReport(this['realtime']);var _0x1fb77a=new VoiceDialReport(this[_0xb717('0xc')]);var _0x253a9f=new VoiceCallReport(this['realtime']);var _0x27ae71=new UserReport(this[_0xb717('0xc')]);if(config[_0xb717('0x10')]&&config[_0xb717('0x10')][_0xb717('0x11')]){ami['on'](_0xb717('0x12'),this[_0xb717('0x13')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xb717('0x14')][_0xb717('0x15')](this));ami['on'](_0xb717('0x16'),this[_0xb717('0x17')][_0xb717('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xb717('0x18')][_0xb717('0x15')](this));ami['on'](_0xb717('0x19'),this[_0xb717('0x1a')][_0xb717('0x15')](this));ami['on'](_0xb717('0x1b'),this['attendedTransfer'][_0xb717('0x15')](this));}};Report[_0xb717('0xf')][_0xb717('0x1c')]=function(_0x521f90){var _0x1742b2;_0x1742b2=_['find'](this[_0xb717('0xd')],function(_0xcb0564){return _0xcb0564[_0xb717('0x1d')]==_0x521f90||_0xcb0564[_0xb717('0x1e')]==_0x521f90;});if(_[_0xb717('0x1f')](_0x1742b2)){var _0x4ec0ce=_[_0xb717('0x20')](this[_0xb717('0xe')],function(_0x34c0fe){return _0x34c0fe[_0xb717('0x1d')]==_0x521f90||_0x34c0fe['name']==_0x521f90;});if(_0x4ec0ce){_0x1742b2=_[_0xb717('0x20')](this['agents'],function(_0x2ce2ca){return _0x2ce2ca[_0xb717('0x21')]==util['format'](_0xb717('0x22'),_0x4ec0ce[_0xb717('0x1e')]);});}}return _0x1742b2;};Report['prototype'][_0xb717('0x13')]=function(_0x56514e){for(var _0x22ed64=0x0;_0x22ed64<_0x56514e['length'];_0x22ed64+=0x1){var _0x130240=this[_0xb717('0x1c')](_0x56514e[_0x22ed64][_0xb717('0x23')]);if(_0x130240){_0x56514e[_0x22ed64][_0xb717('0x1d')]=_0x130240[_0xb717('0x1d')];_0x56514e[_0x22ed64][_0xb717('0x24')]=!![];_0x56514e[_0x22ed64][_0xb717('0x25')]=_0x130240[_0xb717('0x1e')];_0x56514e[_0x22ed64][_0xb717('0x21')]=_['isNil'](_0x130240[_0xb717('0x21')])?util['format'](_0xb717('0x22'),_0x130240[_0xb717('0x1e')]):_0x130240[_0xb717('0x21')];if(_0x56514e[_0x22ed64][_0xb717('0x26')]){_0x56514e[_0x22ed64]['queuecallercompleteAt']=moment()['format'](_0xb717('0x27'));}if(_0x56514e[_0x22ed64]['queuecallerexit']){_0x56514e[_0x22ed64]['queuecallerexitAt']=moment()[_0xb717('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xb717('0x13')](_0x56514e[_0x22ed64]);}RpcVoiceQueueReport['create'](_0x56514e[_0x22ed64]);}};function extractCalleridNumber(_0x5a5de8){var _0x12a55d=_0x5a5de8[_0xb717('0x29')](/<(.*?)>/);return _0x12a55d?_0x12a55d[0x1]:_0x5a5de8;}Report['prototype'][_0xb717('0x2a')]=function(_0x2e2562){for(var _0xc351e4=0x0;_0xc351e40x0?!![]:![];if(!_0x1ef81d){return this[_0xd1ad('0x1d')](this[_0xd1ad('0x18')][_0xd1ad('0x6a')]);}};VoiceQueueReport[_0xd1ad('0xc')]['syncQueueMember']=function(_0xe92664){var _0x4efcd4=this[_0xd1ad('0x18')]['id'];if(this['summary'][_0xd1ad('0x66')][_0x4efcd4]&&this[_0xd1ad('0x18')][_0xd1ad('0x66')][_0x4efcd4][_0xe92664[_0xd1ad('0x5e')]]){this[_0xd1ad('0x18')]['queuestatus'][_0x4efcd4][_0xe92664['actionid']][_0xd1ad('0x13')]['push'](_0xe92664);}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0x1a')]=function(_0x564c20){var _0x1da4fc=this;try{if(this[_0xd1ad('0x59')](_0x564c20)&&this['isNotNull'](_0x564c20[_0xd1ad('0x4e')])){logger[_0xd1ad('0x49')](_0xd1ad('0x6b'),util[_0xd1ad('0x42')](_0x564c20,{'showHidden':![],'depth':null}));var _0x3165a0=this['voiceQueues'][_0x564c20[_0xd1ad('0x4e')]];if(_0x3165a0){logger[_0xd1ad('0x49')](_0xd1ad('0x6c'),_0x3165a0['name']);this[_0xd1ad('0x18')][_0xd1ad('0x5b')][_0x3165a0['name']]={'summaryEvent':_0x564c20};this[_0xd1ad('0x18')][_0xd1ad('0x69')]+=0x1;return ami[_0xd1ad('0x3d')]({'action':'queuestatus','queue':_0x3165a0[_0xd1ad('0x62')]})[_0xd1ad('0x6d')](function(_0x48f341){if(!_0x1da4fc['summary'][_0xd1ad('0x66')][_0x564c20[_0xd1ad('0x5e')]]){_0x1da4fc[_0xd1ad('0x18')][_0xd1ad('0x66')][_0x564c20[_0xd1ad('0x5e')]]={};}_0x1da4fc['summary'][_0xd1ad('0x66')][_0x564c20[_0xd1ad('0x5e')]][_0x48f341[_0xd1ad('0x5e')]]={'queue':_0x3165a0[_0xd1ad('0x62')],'agents':[]};})[_0xd1ad('0x3f')](function(_0x1a0c92){throw _0x1a0c92;});}}}catch(_0xee0eb0){logger[_0xd1ad('0x41')]('[voiceQueueReport][queuesummary]',util[_0xd1ad('0x42')](_0xee0eb0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x1b92ac){if(this[_0xd1ad('0x18')]['statusRequests']>0x0){this[_0xd1ad('0x18')][_0xd1ad('0x6a')]=_0x1b92ac;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xd1ad('0x42')](_0x1b92ac,{'showHidden':![],'depth':null}));this[_0xd1ad('0x18')]=initializeSummary();ami[_0xd1ad('0x47')](_0xd1ad('0x6e'),{});};VoiceQueueReport['prototype'][_0xd1ad('0x21')]=function(_0x5e92f7){try{if(this[_0xd1ad('0x59')](_0x5e92f7)){logger[_0xd1ad('0x49')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5e92f7[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0x5e92f7,{'showHidden':![],'depth':null}));if(_[_0xd1ad('0x5a')](this[_0xd1ad('0x11')][_0x5e92f7[_0xd1ad('0x4b')]])){this[_0xd1ad('0x11')][_0x5e92f7[_0xd1ad('0x4b')]]=[];}if(_[_0xd1ad('0x5a')](this['channels'][_0x5e92f7[_0xd1ad('0x4b')]])){this['channels'][_0x5e92f7[_0xd1ad('0x4b')]]={};}var _0xba59c7=new QueueReport();_0xba59c7['queue']=_0x5e92f7[_0xd1ad('0x4e')];_0xba59c7[_0xd1ad('0x56')]=this[_0xd1ad('0x16')][_0xba59c7[_0xd1ad('0x4e')]]&&this[_0xd1ad('0x16')][_0xba59c7[_0xd1ad('0x4e')]][_0xd1ad('0x56')]?this['voiceQueues'][_0xba59c7[_0xd1ad('0x4e')]][_0xd1ad('0x56')]||_0xd1ad('0x57'):'inbound';_0xba59c7[_0xd1ad('0x6f')]=moment()[_0xd1ad('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0xba59c7[_0xd1ad('0x70')]=_0x5e92f7[_0xd1ad('0x70')];_0xba59c7[_0xd1ad('0x71')]=_0x5e92f7[_0xd1ad('0x71')];_0xba59c7['uniqueid']=_0x5e92f7['uniqueid'];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xba59c7[_0xd1ad('0x4e')],_0xba59c7[_0xd1ad('0x56')]);Object[_0xd1ad('0x72')](_0xba59c7,_[_0xd1ad('0x73')](_0x5e92f7,_['keys'](_0xba59c7)));this['queueReports'][_0x5e92f7[_0xd1ad('0x4b')]]['push'](_0xba59c7);this[_0xd1ad('0x14')][_0x5e92f7[_0xd1ad('0x4b')]]=_0xba59c7;this[_0xd1ad('0x48')](_0xba59c7,_0xd1ad('0x74'));}}catch(_0x40822c){logger[_0xd1ad('0x41')](_0xd1ad('0x75'),_0x5e92f7[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0x40822c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0x76')]=function(_0x3fa457){try{if(this[_0xd1ad('0x59')](_0x3fa457)){logger[_0xd1ad('0x49')](_0xd1ad('0x77'),_0x3fa457[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0x3fa457,{'showHidden':![],'depth':null}));if(this[_0xd1ad('0x11')][_0x3fa457[_0xd1ad('0x4b')]]){var _0x35f69d=_[_0xd1ad('0x78')](this[_0xd1ad('0x11')][_0x3fa457['uniqueid']]);_0x35f69d[_0xd1ad('0x79')]=![];_0x35f69d[_0xd1ad('0x7a')]=null;_0x35f69d[_0xd1ad('0x7b')]=_0x3fa457[_0xd1ad('0x7b')];_0x35f69d[_0xd1ad('0x7c')]=_0x3fa457[_0xd1ad('0x7c')];_0x35f69d[_0xd1ad('0x22')]=!![];_0x35f69d[_0xd1ad('0x7d')]=moment()['format'](_0xd1ad('0x7e'));_0x35f69d[_0xd1ad('0x52')]='ABANDONED';_0x35f69d['lastAssignedTo']=null;logger[_0xd1ad('0x7f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x35f69d['queue'],_0x35f69d['type']);this[_0xd1ad('0x14')][_0x3fa457['uniqueid']]=_0x35f69d;this[_0xd1ad('0x50')](_0x35f69d,_0xd1ad('0x22'));}}}catch(_0x37d6dd){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x3fa457[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0x37d6dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1ad('0xc')]['syncQueueCallerLeave']=function(_0x4c44fd){try{if(this[_0xd1ad('0x59')](_0x4c44fd)){logger['debug'](_0xd1ad('0x80'),_0x4c44fd[_0xd1ad('0x4b')],util['inspect'](_0x4c44fd,{'showHidden':![],'depth':null}));if(this[_0xd1ad('0x11')][_0x4c44fd['uniqueid']]){var _0x3a427c=_['last'](this[_0xd1ad('0x11')][_0x4c44fd[_0xd1ad('0x4b')]]);_0x3a427c[_0xd1ad('0x81')]=moment()['format'](_0xd1ad('0x7e'));_0x3a427c['connectedlinenum']=_0x4c44fd[_0xd1ad('0x82')];_0x3a427c['connectedlinename']=_0x4c44fd[_0xd1ad('0x83')];logger[_0xd1ad('0x7f')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3a427c['queue'],_0x3a427c[_0xd1ad('0x56')],_0x4c44fd[_0xd1ad('0x82')],_0x4c44fd[_0xd1ad('0x83')]);this[_0xd1ad('0x14')][_0x4c44fd[_0xd1ad('0x4b')]]=_0x3a427c;this[_0xd1ad('0x48')](_0x3a427c,_0xd1ad('0x23'));}}}catch(_0x1b1e3e){logger[_0xd1ad('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x4c44fd['uniqueid'],util[_0xd1ad('0x42')](_0x1b1e3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0x26')]=function(_0x2e618b){try{if(this['isNotNull'](_0x2e618b)){logger[_0xd1ad('0x49')]('[%s][voiceQueueReport][agentconnect]',_0x2e618b['uniqueid'],util[_0xd1ad('0x42')](_0x2e618b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e618b[_0xd1ad('0x4b')]]){var _0x4655b8=_['last'](this[_0xd1ad('0x11')][_0x2e618b[_0xd1ad('0x4b')]]);_0x4655b8[_0xd1ad('0x79')]=!![];_0x4655b8[_0xd1ad('0x52')]=_0xd1ad('0x84');logger[_0xd1ad('0x7f')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4655b8['queue'],_0x4655b8[_0xd1ad('0x56')]);}}}catch(_0xc1875d){logger['error'](_0xd1ad('0x85'),_0x2e618b[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0xc1875d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0x86')]=function(_0x3c6746){try{if(this[_0xd1ad('0x59')](_0x3c6746)){logger[_0xd1ad('0x49')](_0xd1ad('0x87'),_0x3c6746[_0xd1ad('0x4b')],util['inspect'](_0x3c6746,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3c6746[_0xd1ad('0x4b')]]){var _0x32b55d=_[_0xd1ad('0x78')](this['queueReports'][_0x3c6746[_0xd1ad('0x4b')]]);_0x32b55d[_0xd1ad('0x22')]=![];_0x32b55d['queuecallerabandonAt']=null;_0x32b55d[_0xd1ad('0x88')]=!![];_0x32b55d[_0xd1ad('0x89')]=_0x3c6746['membername'];_0x32b55d[_0xd1ad('0x7b')]=_0x3c6746['holdtime'];_0x32b55d[_0xd1ad('0x79')]=!![];_0x32b55d[_0xd1ad('0x3a')]=![];_0x32b55d[_0xd1ad('0x8a')]=null;if(!_0x32b55d['transfer']){if(_0x3c6746[_0xd1ad('0x8b')]==_0xd1ad('0x8c')){_0x32b55d[_0xd1ad('0x52')]=_0xd1ad('0x8d');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x32b55d['queue'],_0x32b55d['type']);}else{if(_['startsWith'](_0x3c6746[_0xd1ad('0x3e')]['toLowerCase'](),'local/')){if(this[_0xd1ad('0x11')][_0x3c6746[_0xd1ad('0x8e')]]){var _0x43136d=_[_0xd1ad('0x78')](this[_0xd1ad('0x11')][_0x3c6746[_0xd1ad('0x8e')]]);_0x43136d[_0xd1ad('0x79')]=![];_0x43136d['queuecallerexit']=!![];_0x43136d['queuecallerexitAt']=moment(_0x32b55d[_0xd1ad('0x6f')])[_0xd1ad('0x8f')](_0x3c6746['holdtime'],_0xd1ad('0x90'))[_0xd1ad('0x4c')](_0xd1ad('0x7e'));_0x43136d[_0xd1ad('0x52')]='FORWARDTRANSFER';_0x43136d[_0xd1ad('0x8c')]=!![];_0x43136d[_0xd1ad('0x91')]=_0xd1ad('0x92');_0x43136d[_0xd1ad('0x93')]=_0x3c6746[_0xd1ad('0x94')];_0x43136d[_0xd1ad('0x95')]=_0x3c6746[_0xd1ad('0x4b')];logger[_0xd1ad('0x7f')](_0xd1ad('0x96'),_0x43136d[_0xd1ad('0x4e')],_0x43136d[_0xd1ad('0x56')]);var _0x6d7079=this[_0xd1ad('0x11')][_0x3c6746[_0xd1ad('0x8e')]];this[_0xd1ad('0x11')][_0x3c6746[_0xd1ad('0x8e')]]=this['queueReports'][_0x3c6746[_0xd1ad('0x4b')]];this[_0xd1ad('0x11')][_0x3c6746['uniqueid']]=_0x6d7079;}}else{_0x32b55d[_0xd1ad('0x52')]=_0xd1ad('0x97')+_0x3c6746[_0xd1ad('0x8b')]['toUpperCase']();logger[_0xd1ad('0x7f')](_0xd1ad('0x98'),_0x32b55d[_0xd1ad('0x4e')],_0x32b55d[_0xd1ad('0x56')],_0x32b55d['queuecallerexitreason']);}}}this[_0xd1ad('0x14')][_0x3c6746[_0xd1ad('0x4b')]]=_0x32b55d;}}}catch(_0x224073){logger[_0xd1ad('0x41')](_0xd1ad('0x87'),_0x3c6746['uniqueid'],util[_0xd1ad('0x42')](_0x224073,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0x99')]=function(_0xcb87e2){try{if(this['isNotNull'](_0xcb87e2)){logger[_0xd1ad('0x49')]('[%s][voiceQueueReport][varset]',_0xcb87e2[_0xd1ad('0x4b')],util['inspect'](_0xcb87e2,{'showHidden':![],'depth':null}));this['addVariable'](_0xcb87e2[_0xd1ad('0x4b')],_[_0xd1ad('0x9a')](_0xcb87e2[_0xd1ad('0x9b')])[0x0],_0xcb87e2[_0xd1ad('0x9c')]);if(this[_0xd1ad('0x11')][_0xcb87e2[_0xd1ad('0x4b')]]){var _0x937641=_[_0xd1ad('0x78')](this[_0xd1ad('0x11')][_0xcb87e2[_0xd1ad('0x4b')]]);if(_0x937641){if(this[_0xd1ad('0x59')](_0xcb87e2[_0xd1ad('0x9b')])&&this[_0xd1ad('0x59')](_0xcb87e2[_0xd1ad('0x9b')][_0xd1ad('0x66')])){switch(_0xcb87e2['value']){case _0xd1ad('0x9d'):_0x937641[_0xd1ad('0x3a')]=![];_0x937641[_0xd1ad('0x8a')]=null;break;case _0xd1ad('0x9e'):_0x937641[_0xd1ad('0x9f')]=_0xd1ad('0xa0');_0x937641[_0xd1ad('0x3a')]=!![];_0x937641[_0xd1ad('0x8a')]=moment()[_0xd1ad('0x4c')](_0xd1ad('0x7e'));_0x937641[_0xd1ad('0x81')]=moment()[_0xd1ad('0x4c')](_0xd1ad('0x7e'));logger[_0xd1ad('0x49')](_0xd1ad('0xa1'),_0xcb87e2['uniqueid'],util[_0xd1ad('0x42')](_0x937641,{'showHidden':![],'depth':null}));ami['emit'](_0xd1ad('0xa2'),_0x937641);break;default:_0x937641[_0xd1ad('0x3a')]=!![];_0x937641[_0xd1ad('0x8a')]=moment()[_0xd1ad('0x4c')](_0xd1ad('0x7e'));_0x937641[_0xd1ad('0x81')]=moment()[_0xd1ad('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');}_0x937641[_0xd1ad('0x22')]=![];_0x937641[_0xd1ad('0x7d')]=null;_0x937641[_0xd1ad('0x52')]=_0xcb87e2[_0xd1ad('0x9c')];this['channels'][_0xcb87e2['uniqueid']]=_0x937641;this[_0xd1ad('0x50')](_0x937641,_0xd1ad('0xa3'));}else if(this[_0xd1ad('0x59')](_0xcb87e2[_0xd1ad('0x9b')])&&this[_0xd1ad('0x59')](_0xcb87e2['variable'][_0xd1ad('0xa4')])){if(!_0x937641[_0xd1ad('0x22')]){_0x937641['queuecallerexit']=!![];_0x937641[_0xd1ad('0x8a')]=moment()[_0xd1ad('0x4c')](_0xd1ad('0x7e'));_0x937641[_0xd1ad('0x52')]=_0xd1ad('0xa5');_0x937641[_0xd1ad('0x81')]=moment()['format'](_0xd1ad('0x7e'));this[_0xd1ad('0x14')][_0xcb87e2[_0xd1ad('0x4b')]]=_0x937641;}}logger[_0xd1ad('0x7f')](_0xd1ad('0xa6'),_0xcb87e2['uniqueid'],_0x937641[_0xd1ad('0x4e')],_0x937641[_0xd1ad('0x56')],_['keys'](_0xcb87e2[_0xd1ad('0x9b')])[0x0],_0xcb87e2[_0xd1ad('0x9c')]);_0x937641[_0xd1ad('0x19')]=this[_0xd1ad('0x19')][_0xcb87e2['uniqueid']];}}}}catch(_0x34a282){logger[_0xd1ad('0x41')](_0xd1ad('0xa7'),_0xcb87e2[_0xd1ad('0x4b')],util[_0xd1ad('0x42')](_0x34a282,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd1ad('0xa8')]=function(_0xdd6fa3,_0x5a1390,_0x4b95cb){var _0x1673d7=[_0xd1ad('0xa9'),_0xd1ad('0xaa'),_0xd1ad('0xab'),'rtpaudioqosjitterbridged',_0xd1ad('0xac'),_0xd1ad('0xad'),'rtpaudioqosrtt',_0xd1ad('0xae'),'sipcallid',_0xd1ad('0xaf'),_0xd1ad('0xb0'),'bridgepvtcallid','membercalls',_0xd1ad('0xb1'),_0xd1ad('0xb2'),_0xd1ad('0xb3'),'membername',_0xd1ad('0xb4'),_0xd1ad('0xb5')];if(!_[_0xd1ad('0xb6')](_0x5a1390)&&!_[_0xd1ad('0xb7')](_0x1673d7,_0x5a1390)){if(_[_0xd1ad('0x5a')](this['variables'][_0xdd6fa3])){this[_0xd1ad('0x19')][_0xdd6fa3]={};}this[_0xd1ad('0x19')][_0xdd6fa3][_0x5a1390]=_0x4b95cb;}};VoiceQueueReport[_0xd1ad('0xc')][_0xd1ad('0xb8')]=function(_0xf30eaa,_0x3caac9,_0x2fd681){try{var _0x4582b2={};if(this['queueReports'][_0xf30eaa]){for(var _0x28b207=0x0;_0x28b2070x0?!![]:![];if(!_0x161be4){return this[_0x580b('0x1c')](this[_0x580b('0x18')][_0x580b('0x6b')]);}};VoiceQueueReport[_0x580b('0xd')][_0x580b('0x1d')]=function(_0x2e14e7){var _0x10361a=this['summary']['id'];if(this[_0x580b('0x18')][_0x580b('0x61')][_0x10361a]&&this['summary'][_0x580b('0x61')][_0x10361a][_0x2e14e7[_0x580b('0x60')]]){this[_0x580b('0x18')][_0x580b('0x61')][_0x10361a][_0x2e14e7[_0x580b('0x60')]][_0x580b('0x14')]['push'](_0x2e14e7);}};VoiceQueueReport[_0x580b('0xd')]['syncQueueSummary']=function(_0x430f41){var _0x4241be=this;try{if(this[_0x580b('0x6c')](_0x430f41)&&this[_0x580b('0x6c')](_0x430f41['queue'])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0x580b('0x3f')](_0x430f41,{'showHidden':![],'depth':null}));var _0x6d99e8=this[_0x580b('0x16')][_0x430f41[_0x580b('0x52')]];if(_0x6d99e8){logger[_0x580b('0x58')](_0x580b('0x6d'),_0x6d99e8['name']);this[_0x580b('0x18')][_0x580b('0x5c')][_0x6d99e8['name']]={'summaryEvent':_0x430f41};this[_0x580b('0x18')][_0x580b('0x6a')]+=0x1;return ami[_0x580b('0x39')]({'action':'queuestatus','queue':_0x6d99e8[_0x580b('0x67')]})[_0x580b('0x5f')](function(_0x1e741a){if(!_0x4241be[_0x580b('0x18')][_0x580b('0x61')][_0x430f41[_0x580b('0x60')]]){_0x4241be[_0x580b('0x18')][_0x580b('0x61')][_0x430f41['actionid']]={};}_0x4241be['summary'][_0x580b('0x61')][_0x430f41[_0x580b('0x60')]][_0x1e741a[_0x580b('0x60')]]={'queue':_0x6d99e8[_0x580b('0x67')],'agents':[]};})[_0x580b('0x3c')](function(_0x3f4fdf){throw _0x3f4fdf;});}}}catch(_0x23feba){logger[_0x580b('0x43')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x23feba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x580b('0xd')]['syncQueueSummaryComplete']=function(_0x47acc0){if(this['summary'][_0x580b('0x6a')]>0x0){this[_0x580b('0x18')]['completeEvent']=_0x47acc0;return;}logger[_0x580b('0x58')](_0x580b('0x6e'),util['inspect'](_0x47acc0,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x580b('0x47')](_0x580b('0x6f'),{});};VoiceQueueReport['prototype'][_0x580b('0x1f')]=function(_0x1078c9){try{if(this[_0x580b('0x6c')](_0x1078c9)){logger[_0x580b('0x58')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1078c9[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x1078c9,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x1078c9['uniqueid']])){this[_0x580b('0x12')][_0x1078c9[_0x580b('0x4a')]]=[];}if(_['isUndefined'](this[_0x580b('0x15')][_0x1078c9[_0x580b('0x4a')]])){this[_0x580b('0x15')][_0x1078c9[_0x580b('0x4a')]]={};}var _0x3d1924=new QueueReport();_0x3d1924[_0x580b('0x52')]=_0x1078c9[_0x580b('0x52')];_0x3d1924[_0x580b('0x56')]=this[_0x580b('0x16')][_0x3d1924[_0x580b('0x52')]]&&this[_0x580b('0x16')][_0x3d1924['queue']][_0x580b('0x56')]?this[_0x580b('0x16')][_0x3d1924[_0x580b('0x52')]][_0x580b('0x56')]||_0x580b('0x57'):'inbound';_0x3d1924['queuecallerjoinAt']=moment()[_0x580b('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d1924[_0x580b('0x70')]=_0x1078c9['position'];_0x3d1924[_0x580b('0x71')]=_0x1078c9[_0x580b('0x71')];_0x3d1924[_0x580b('0x4a')]=_0x1078c9[_0x580b('0x4a')];logger['info'](_0x580b('0x72'),_0x3d1924[_0x580b('0x52')],_0x3d1924[_0x580b('0x56')]);Object[_0x580b('0x73')](_0x3d1924,_[_0x580b('0x74')](_0x1078c9,_[_0x580b('0x75')](_0x3d1924)));this['queueReports'][_0x1078c9[_0x580b('0x4a')]][_0x580b('0x76')](_0x3d1924);this[_0x580b('0x15')][_0x1078c9[_0x580b('0x4a')]]=_0x3d1924;this['emitVoiceQueueChannelSave'](_0x3d1924,_0x580b('0x1e'));}}catch(_0x24bc03){logger[_0x580b('0x43')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1078c9[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x24bc03,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x414b43){try{if(this[_0x580b('0x6c')](_0x414b43)){logger[_0x580b('0x58')](_0x580b('0x77'),_0x414b43['uniqueid'],util[_0x580b('0x3f')](_0x414b43,{'showHidden':![],'depth':null}));if(this[_0x580b('0x12')][_0x414b43[_0x580b('0x4a')]]){var _0x15aea4=_[_0x580b('0x78')](this[_0x580b('0x12')][_0x414b43['uniqueid']]);_0x15aea4['queuecallercomplete']=![];_0x15aea4[_0x580b('0x79')]=null;_0x15aea4[_0x580b('0x7a')]=_0x414b43[_0x580b('0x7a')];_0x15aea4[_0x580b('0x7b')]=_0x414b43[_0x580b('0x7b')];_0x15aea4[_0x580b('0x34')]=!![];_0x15aea4['queuecallerabandonAt']=moment()[_0x580b('0x4b')](_0x580b('0x7c'));_0x15aea4[_0x580b('0x50')]=_0x580b('0x7d');_0x15aea4[_0x580b('0x7e')]=null;logger[_0x580b('0x7f')](_0x580b('0x80'),_0x15aea4[_0x580b('0x52')],_0x15aea4[_0x580b('0x56')]);this[_0x580b('0x15')][_0x414b43[_0x580b('0x4a')]]=_0x15aea4;this['emitVoiceQueueChannelRemove'](_0x15aea4,_0x580b('0x34'));}}}catch(_0xe494f2){logger['error'](_0x580b('0x77'),_0x414b43['uniqueid'],util['inspect'](_0xe494f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x580b('0x21')]=function(_0x3de59d){try{if(this[_0x580b('0x6c')](_0x3de59d)){logger[_0x580b('0x58')]('[%s][voiceQueueReport][queuecallerleave]',_0x3de59d['uniqueid'],util[_0x580b('0x3f')](_0x3de59d,{'showHidden':![],'depth':null}));if(this[_0x580b('0x12')][_0x3de59d[_0x580b('0x4a')]]){var _0x540a61=_[_0x580b('0x78')](this[_0x580b('0x12')][_0x3de59d[_0x580b('0x4a')]]);_0x540a61['queuecallerleaveAt']=moment()[_0x580b('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x540a61[_0x580b('0x81')]=_0x3de59d['connectedlinenum'];_0x540a61[_0x580b('0x82')]=_0x3de59d[_0x580b('0x82')];logger[_0x580b('0x7f')](_0x580b('0x83'),_0x540a61[_0x580b('0x52')],_0x540a61[_0x580b('0x56')],_0x3de59d[_0x580b('0x81')],_0x3de59d['connectedlinename']);this[_0x580b('0x15')][_0x3de59d[_0x580b('0x4a')]]=_0x540a61;this[_0x580b('0x48')](_0x540a61,'queuecallerleave');}}}catch(_0x136246){logger[_0x580b('0x43')](_0x580b('0x84'),_0x3de59d[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x136246,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x580b('0xd')]['syncAgentConnect']=function(_0x381b3d){try{if(this[_0x580b('0x6c')](_0x381b3d)){logger[_0x580b('0x58')](_0x580b('0x85'),_0x381b3d['uniqueid'],util[_0x580b('0x3f')](_0x381b3d,{'showHidden':![],'depth':null}));if(this[_0x580b('0x12')][_0x381b3d[_0x580b('0x4a')]]){var _0x37edb2=_['last'](this[_0x580b('0x12')][_0x381b3d[_0x580b('0x4a')]]);_0x37edb2[_0x580b('0x35')]=!![];_0x37edb2['queuecallerexitreason']=_0x580b('0x86');logger[_0x580b('0x7f')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x37edb2[_0x580b('0x52')],_0x37edb2[_0x580b('0x56')]);}}}catch(_0x5cf028){logger[_0x580b('0x43')](_0x580b('0x85'),_0x381b3d[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x5cf028,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x580b('0xd')][_0x580b('0x87')]=function(_0x45088d){try{if(this[_0x580b('0x6c')](_0x45088d)){logger['debug'](_0x580b('0x88'),_0x45088d[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x45088d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x45088d[_0x580b('0x4a')]]){var _0x192b80=_[_0x580b('0x78')](this[_0x580b('0x12')][_0x45088d['uniqueid']]);_0x192b80[_0x580b('0x34')]=![];_0x192b80[_0x580b('0x89')]=null;_0x192b80['assigned']=!![];_0x192b80[_0x580b('0x7e')]=_0x45088d[_0x580b('0x8a')];_0x192b80[_0x580b('0x7a')]=_0x45088d[_0x580b('0x7a')];_0x192b80[_0x580b('0x35')]=!![];_0x192b80[_0x580b('0x8b')]=![];_0x192b80[_0x580b('0x8c')]=null;if(!_0x192b80['transfer']){if(_0x45088d[_0x580b('0x8d')]==_0x580b('0x8e')){_0x192b80[_0x580b('0x50')]='COMPLETED';logger[_0x580b('0x7f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x192b80[_0x580b('0x52')],_0x192b80['type']);}else{if(_[_0x580b('0x8f')](_0x45088d[_0x580b('0x3b')]['toLowerCase'](),_0x580b('0x90'))){if(this[_0x580b('0x12')][_0x45088d[_0x580b('0x91')]]){var _0x15768d=_['last'](this[_0x580b('0x12')][_0x45088d[_0x580b('0x91')]]);_0x15768d[_0x580b('0x35')]=![];_0x15768d[_0x580b('0x8b')]=!![];_0x15768d['queuecallerexitAt']=moment(_0x192b80[_0x580b('0x92')])[_0x580b('0x93')](_0x45088d[_0x580b('0x7a')],_0x580b('0x94'))[_0x580b('0x4b')](_0x580b('0x7c'));_0x15768d[_0x580b('0x50')]=_0x580b('0x95');_0x15768d[_0x580b('0x8e')]=!![];_0x15768d[_0x580b('0x96')]=_0x580b('0x97');_0x15768d[_0x580b('0x98')]=_0x45088d['destexten'];_0x15768d['transferuniqueid']=_0x45088d[_0x580b('0x4a')];logger[_0x580b('0x7f')](_0x580b('0x99'),_0x15768d[_0x580b('0x52')],_0x15768d[_0x580b('0x56')]);var _0x4bb6fc=this[_0x580b('0x12')][_0x45088d[_0x580b('0x91')]];this[_0x580b('0x12')][_0x45088d[_0x580b('0x91')]]=this[_0x580b('0x12')][_0x45088d[_0x580b('0x4a')]];this[_0x580b('0x12')][_0x45088d['uniqueid']]=_0x4bb6fc;}}else{_0x192b80['queuecallerexitreason']=_0x580b('0x9a')+_0x45088d[_0x580b('0x8d')][_0x580b('0x9b')]();logger['info'](_0x580b('0x9c'),_0x192b80[_0x580b('0x52')],_0x192b80['type'],_0x192b80[_0x580b('0x50')]);}}}this[_0x580b('0x15')][_0x45088d[_0x580b('0x4a')]]=_0x192b80;}}}catch(_0x3c6d5d){logger[_0x580b('0x43')](_0x580b('0x88'),_0x45088d['uniqueid'],util['inspect'](_0x3c6d5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x580b('0xd')]['syncVarSet']=function(_0x2bda25){try{if(this[_0x580b('0x6c')](_0x2bda25)){logger[_0x580b('0x58')]('[%s][voiceQueueReport][varset]',_0x2bda25[_0x580b('0x4a')],util[_0x580b('0x3f')](_0x2bda25,{'showHidden':![],'depth':null}));this['addVariable'](_0x2bda25[_0x580b('0x4a')],_['keys'](_0x2bda25[_0x580b('0x9d')])[0x0],_0x2bda25[_0x580b('0x9e')]);if(this[_0x580b('0x12')][_0x2bda25['uniqueid']]){var _0x136826=_[_0x580b('0x78')](this['queueReports'][_0x2bda25[_0x580b('0x4a')]]);if(_0x136826){if(this[_0x580b('0x6c')](_0x2bda25[_0x580b('0x9d')])&&this[_0x580b('0x6c')](_0x2bda25[_0x580b('0x9d')]['queuestatus'])){switch(_0x2bda25[_0x580b('0x9e')]){case _0x580b('0x9f'):_0x136826['queuecallerexit']=![];_0x136826['queuecallerexitAt']=null;break;case _0x580b('0xa0'):_0x136826[_0x580b('0xa1')]=_0x580b('0xa2');_0x136826[_0x580b('0x8b')]=!![];_0x136826[_0x580b('0x8c')]=moment()[_0x580b('0x4b')](_0x580b('0x7c'));_0x136826[_0x580b('0xa3')]=moment()['format'](_0x580b('0x7c'));logger['debug'](_0x580b('0xa4'),_0x2bda25[_0x580b('0x4a')],util['inspect'](_0x136826,{'showHidden':![],'depth':null}));ami[_0x580b('0x47')](_0x580b('0xa5'),_0x136826);break;default:_0x136826[_0x580b('0x8b')]=!![];_0x136826[_0x580b('0x8c')]=moment()[_0x580b('0x4b')](_0x580b('0x7c'));_0x136826['queuecallerleaveAt']=moment()[_0x580b('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');}_0x136826['queuecallerabandon']=![];_0x136826['queuecallerabandonAt']=null;_0x136826[_0x580b('0x50')]=_0x2bda25[_0x580b('0x9e')];this[_0x580b('0x15')][_0x2bda25[_0x580b('0x4a')]]=_0x136826;this[_0x580b('0x46')](_0x136826,_0x580b('0xa6'));}else if(this[_0x580b('0x6c')](_0x2bda25['variable'])&&this[_0x580b('0x6c')](_0x2bda25['variable'][_0x580b('0xa7')])){if(!_0x136826[_0x580b('0x34')]){_0x136826[_0x580b('0x8b')]=!![];_0x136826[_0x580b('0x8c')]=moment()[_0x580b('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x136826['queuecallerexitreason']='EXITWITHKEY';_0x136826[_0x580b('0xa3')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x580b('0x15')][_0x2bda25['uniqueid']]=_0x136826;}}logger[_0x580b('0x7f')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x2bda25[_0x580b('0x4a')],_0x136826[_0x580b('0x52')],_0x136826[_0x580b('0x56')],_[_0x580b('0x75')](_0x2bda25[_0x580b('0x9d')])[0x0],_0x2bda25[_0x580b('0x9e')]);_0x136826['variables']=this[_0x580b('0xa8')][_0x2bda25[_0x580b('0x4a')]];}}}}catch(_0xa4c49d){logger[_0x580b('0x43')](_0x580b('0xa9'),_0x2bda25[_0x580b('0x4a')],util[_0x580b('0x3f')](_0xa4c49d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x580b('0xd')]['addVariable']=function(_0x3c4f4f,_0x25f9d4,_0x54c24c){var _0x350ae9=[_0x580b('0xaa'),_0x580b('0xab'),_0x580b('0xac'),_0x580b('0xad'),_0x580b('0xae'),_0x580b('0xaf'),_0x580b('0xb0'),'rtpaudioqosrttbridged','sipcallid',_0x580b('0xb1'),'bridgepeer',_0x580b('0xb2'),_0x580b('0xb3'),_0x580b('0xb4'),_0x580b('0xb5'),'memberlastcall',_0x580b('0x8a'),_0x580b('0xb6'),_0x580b('0xb7')];if(!_[_0x580b('0x38')](_0x25f9d4)&&!_[_0x580b('0xb8')](_0x350ae9,_0x25f9d4)){if(_[_0x580b('0x5b')](this[_0x580b('0xa8')][_0x3c4f4f])){this[_0x580b('0xa8')][_0x3c4f4f]={};}this[_0x580b('0xa8')][_0x3c4f4f][_0x25f9d4]=_0x54c24c;}};VoiceQueueReport['prototype'][_0x580b('0xb9')]=function(_0x238792,_0x2ec1c7,_0x338dc8){try{var _0x51442f={};if(this['queueReports'][_0x238792]){for(var _0x3812ea=0x0;_0x3812ea=0x0?moment(_0x6ea90e[_0x53c1('0x19')])[_0x53c1('0xd')](_0x6ea90e[_0x53c1('0x17')],_0x53c1('0x18')):null,'data1':_0x53c1('0x1a'),'data2':_0x6ea90e[_0x53c1('0x12')],'data3':_0x6ea90e['exten'],'data4':_0x6ea90e[_0x53c1('0x1b')]||null,'role':'agent','internal':_0x6ea90e[_0x53c1('0x12')]?_[_0x53c1('0x13')](_0x6ea90e[_0x53c1('0x12')]):undefined,'uniqueid':_0x6ea90e[_0x53c1('0x1c')]},'log':_0x53c1('0x7')});}; \ No newline at end of file +var _0x786d=['exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','seconds','outbound','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','format','SIP/%s','interface','diff','queuecallerleaveAt','inbound','calleridnum'];(function(_0x73607a,_0x543ca9){var _0x1a1d7d=function(_0x56b1ed){while(--_0x56b1ed){_0x73607a['push'](_0x73607a['shift']());}};_0x1a1d7d(++_0x543ca9);}(_0x786d,0xbb));var _0xd786=function(_0xd1c8b0,_0x258c1f){_0xd1c8b0=_0xd1c8b0-0x0;var _0x14d10b=_0x786d[_0xd1c8b0];return _0x14d10b;};'use strict';var moment=require(_0xd786('0x0'));var _=require('lodash');var util=require(_0xd786('0x1'));var client=require(_0xd786('0x2'));exports[_0xd786('0x3')]=function(_0x241f61){var _0x2c01ff=_0x241f61[_0xd786('0x4')]||_0x241f61['queuecallerexitAt'];return client[_0xd786('0x5')](_0xd786('0x6'),{'body':{'channel':_0xd786('0x7'),'membername':_0x241f61[_0xd786('0x8')],'interface':_['isNil'](_0x241f61['interface'])?util[_0xd786('0x9')](_0xd786('0xa'),_0x241f61[_0xd786('0x8')]):_0x241f61[_0xd786('0xb')],'type':'TALKING','enterAt':_0x241f61['queuecallerleaveAt'],'exitAt':_0x2c01ff,'duration':moment(_0x2c01ff)[_0xd786('0xc')](_0x241f61[_0xd786('0xd')],'seconds'),'data1':_0xd786('0xe'),'data2':_0x241f61[_0xd786('0xf')],'data3':_0x241f61[_0xd786('0x10')],'data4':null,'data5':_0x241f61[_0xd786('0x11')],'role':'agent','internal':_0x241f61[_0xd786('0x12')]?_[_0xd786('0x13')](_0x241f61[_0xd786('0x12')]):undefined,'uniqueid':_0x241f61[_0xd786('0x14')]},'log':'CreateMemberReport'});};exports[_0xd786('0x15')]=function(_0x164bab){return client[_0xd786('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x164bab[_0xd786('0x16')],'interface':_0x164bab[_0xd786('0xb')],'type':_0xd786('0x17'),'enterAt':_0x164bab[_0xd786('0x18')],'exitAt':_0x164bab[_0xd786('0x19')],'duration':moment(_0x164bab[_0xd786('0x19')])[_0xd786('0xc')](_0x164bab['starttime'],_0xd786('0x1a'))>=0x0?moment(_0x164bab['endtime'])['diff'](_0x164bab['starttime'],_0xd786('0x1a')):null,'data1':_0xd786('0x1b'),'data2':_0x164bab[_0xd786('0x12')],'data3':_0x164bab[_0xd786('0x10')],'data4':_0x164bab[_0xd786('0x1c')]||null,'role':'agent','internal':_0x164bab[_0xd786('0x12')]?_[_0xd786('0x13')](_0x164bab[_0xd786('0x12')]):undefined,'uniqueid':_0x164bab[_0xd786('0x14')]},'log':_0xd786('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 93cfc9f..2ff0a7a 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 _0xd6d8=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x384fd5,_0xc66bc1){var _0x515055=function(_0x2a8fd0){while(--_0x2a8fd0){_0x384fd5['push'](_0x384fd5['shift']());}};_0x515055(++_0xc66bc1);}(_0xd6d8,0x1a8));var _0x8d6d=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0xd6d8[_0x4cc03b];return _0xf0358c;};'use strict';var client=require(_0x8d6d('0x0'));exports[_0x8d6d('0x1')]=function(){return client[_0x8d6d('0x2')](_0x8d6d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8d6d('0x4'),_0x8d6d('0x5')]},'log':_0x8d6d('0x6')});}; \ No newline at end of file +var _0x1d91=['../client','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0xdfc87d,_0x28e1a5){var _0x4e2a5e=function(_0x55f2f7){while(--_0x55f2f7){_0xdfc87d['push'](_0xdfc87d['shift']());}};_0x4e2a5e(++_0x28e1a5);}(_0x1d91,0x150));var _0x11d9=function(_0x3a1ed1,_0x1da176){_0x3a1ed1=_0x3a1ed1-0x0;var _0x1a282c=_0x1d91[_0x3a1ed1];return _0x1a282c;};'use strict';var client=require(_0x11d9('0x0'));exports[_0x11d9('0x1')]=function(){return client[_0x11d9('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x11d9('0x3'),_0x11d9('0x4')]},'log':_0x11d9('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5ae4e51..1c0c8db 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 _0x99bd=['GetTemplate','name','html','../client','Request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x99bd,0x116));var _0xd99b=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x99bd[_0x3511d3];return _0x5d6321;};'use strict';var client=require(_0xd99b('0x0'));exports['getTemplates']=function(_0x2cf66a){return function(_0xcaa1da){return client[_0xd99b('0x1')](_0xd99b('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd99b('0x3'),_0xd99b('0x4')]},'log':_0xd99b('0x2')});};}; \ No newline at end of file +var _0x5a13=['GetTemplate','name','getTemplates','Request'];(function(_0x3c2a87,_0x301e33){var _0x3a4efd=function(_0x2c5e19){while(--_0x2c5e19){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x3a4efd(++_0x301e33);}(_0x5a13,0x92));var _0x35a1=function(_0x43b58a,_0x3f502b){_0x43b58a=_0x43b58a-0x0;var _0x3d9f06=_0x5a13[_0x43b58a];return _0x3d9f06;};'use strict';var client=require('../client');exports[_0x35a1('0x0')]=function(_0x2447dc){return function(_0x12c089){return client[_0x35a1('0x1')](_0x35a1('0x2'),{'options':{'raw':!![],'attributes':['id',_0x35a1('0x3'),'html']},'log':_0x35a1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3b85a40..56151f9 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 _0x4832=['data7','../client','getTriggers','Request','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data5','data6'];(function(_0x368259,_0x3bead5){var _0x57b342=function(_0x5d60d6){while(--_0x5d60d6){_0x368259['push'](_0x368259['shift']());}};_0x57b342(++_0x3bead5);}(_0x4832,0x85));var _0x2483=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x4832[_0x58afd5];return _0x3e503b;};'use strict';var client=require(_0x2483('0x0'));exports[_0x2483('0x1')]=function(_0x4f32a8){return function(_0x2ce1f3){return client[_0x2483('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x2483('0x3'),_0x2483('0x4'),_0x2483('0x5')],'include':[{'model':_0x2483('0x6'),'as':_0x2483('0x7'),'attributes':['id',_0x2483('0x8'),_0x2483('0x9'),_0x2483('0xa')]},{'model':_0x2483('0x6'),'as':_0x2483('0xb'),'attributes':['id',_0x2483('0x8'),_0x2483('0x9'),_0x2483('0xa')]},{'model':_0x2483('0xc'),'as':_0x2483('0xd'),'attributes':['id',_0x2483('0xe'),_0x2483('0xf'),_0x2483('0x10'),_0x2483('0x11'),_0x2483('0x12'),_0x2483('0x13'),_0x2483('0x14'),_0x2483('0x15')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xb27a=['../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','value','AnyConditions','operator','Action','Actions','data2','data3','data4','data7'];(function(_0x18a31f,_0x5b4cc5){var _0x1bea03=function(_0x59b5ea){while(--_0x59b5ea){_0x18a31f['push'](_0x18a31f['shift']());}};_0x1bea03(++_0x5b4cc5);}(_0xb27a,0x1b5));var _0xab27=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xb27a[_0x2ca616];return _0x53155f;};'use strict';var client=require(_0xab27('0x0'));exports[_0xab27('0x1')]=function(_0x10e620){return function(_0x24c8cb){return client[_0xab27('0x2')](_0xab27('0x3'),{'options':{'raw':![],'attributes':['id',_0xab27('0x4'),_0xab27('0x5'),_0xab27('0x6')],'include':[{'model':_0xab27('0x7'),'as':_0xab27('0x8'),'attributes':['id',_0xab27('0x9'),'operator',_0xab27('0xa')]},{'model':_0xab27('0x7'),'as':_0xab27('0xb'),'attributes':['id',_0xab27('0x9'),_0xab27('0xc'),'value']},{'model':_0xab27('0xd'),'as':_0xab27('0xe'),'attributes':['id','action','data1',_0xab27('0xf'),_0xab27('0x10'),_0xab27('0x11'),'data5','data6',_0xab27('0x12')]}]},'log':_0xab27('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 025bab8..bccc490 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 _0xa43d=['defaultuser','getTrunks','name'];(function(_0x1f95f7,_0x361b99){var _0x1a0a51=function(_0x49275e){while(--_0x49275e){_0x1f95f7['push'](_0x1f95f7['shift']());}};_0x1a0a51(++_0x361b99);}(_0xa43d,0x172));var _0xda43=function(_0x9c6e38,_0x1fc24e){_0x9c6e38=_0x9c6e38-0x0;var _0x148e08=_0xa43d[_0x9c6e38];return _0x148e08;};'use strict';var client=require('../client');exports[_0xda43('0x0')]=function(_0x5f0c46){return function(_0x3c1c2a){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xda43('0x1'),'registry',_0xda43('0x2')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x2123=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x48a483,_0xbd8b1a){var _0x24e745=function(_0x50330a){while(--_0x50330a){_0x48a483['push'](_0x48a483['shift']());}};_0x24e745(++_0xbd8b1a);}(_0x2123,0x190));var _0x3212=function(_0x3adb57,_0x4fce3d){_0x3adb57=_0x3adb57-0x0;var _0x27ed5e=_0x2123[_0x3adb57];return _0x27ed5e;};'use strict';var client=require(_0x3212('0x0'));exports[_0x3212('0x1')]=function(_0x420d05){return function(_0x3424c2){return client[_0x3212('0x2')](_0x3212('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3212('0x4'),_0x3212('0x5'),_0x3212('0x6')]},'log':_0x3212('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 0fbc4eb..20a901d 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x273e0e,_0x4c535b){var _0x5b68c2=function(_0x4af46a){while(--_0x4af46a){_0x273e0e['push'](_0x273e0e['shift']());}};_0x5b68c2(++_0x4c535b);}(_0x70e0,0x17b));var _0x070e=function(_0xab2cc4,_0x19b3b0){_0xab2cc4=_0xab2cc4-0x0;var _0xfc4c2=_0x70e0[_0xab2cc4];return _0xfc4c2;};'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 +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x2281e0,_0x4cb815){var _0x17c112=function(_0x1ef32b){while(--_0x1ef32b){_0x2281e0['push'](_0x2281e0['shift']());}};_0x17c112(++_0x4cb815);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xcb91[_0xc8a931];return _0x28bd27;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c022290..f88ac88 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 _0xde8f=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1eba82,_0x507b9b){var _0x492a46=function(_0x28cded){while(--_0x28cded){_0x1eba82['push'](_0x1eba82['shift']());}};_0x492a46(++_0x507b9b);}(_0xde8f,0xb0));var _0xfde8=function(_0x323684,_0x25494b){_0x323684=_0x323684-0x0;var _0x32dd90=_0xde8f[_0x323684];return _0x32dd90;};'use strict';var client=require(_0xfde8('0x0'));exports[_0xfde8('0x1')]=function(_0x16c8ce){return client[_0xfde8('0x2')](_0xfde8('0x3'),{'body':_0x16c8ce,'log':_0xfde8('0x3')});};exports[_0xfde8('0x4')]=function(_0x35d7f2,_0x24d4db,_0x4349c3){return client[_0xfde8('0x2')](_0xfde8('0x5'),{'body':_0x35d7f2,'options':{'where':{'uniqueid':_0x24d4db,'interface':_0x4349c3,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xd24f=['create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0xd24f,0x1b2));var _0xfd24=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0xd24f[_0x2af160];return _0x439d67;};'use strict';var client=require(_0xfd24('0x0'));exports[_0xfd24('0x1')]=function(_0x2d3b8e){return client['Request'](_0xfd24('0x2'),{'body':_0x2d3b8e,'log':_0xfd24('0x2')});};exports[_0xfd24('0x3')]=function(_0xc2214d,_0x248d42,_0x40c93e){return client['Request'](_0xfd24('0x4'),{'body':_0xc2214d,'options':{'where':{'uniqueid':_0x248d42,'interface':_0x40c93e,'agentcomplete':!![]}},'log':_0xfd24('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 188153f..56784c7 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 _0x350b=['duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x226c11,_0x14c0a4){var _0x4dc73e=function(_0x17e242){while(--_0x17e242){_0x226c11['push'](_0x226c11['shift']());}};_0x4dc73e(++_0x14c0a4);}(_0x350b,0x1d1));var _0xb350=function(_0x103916,_0x47d594){_0x103916=_0x103916-0x0;var _0x205fa0=_0x350b[_0x103916];return _0x205fa0;};'use strict';var moment=require(_0xb350('0x0'));var util=require(_0xb350('0x1'));var _=require('lodash');var client=require(_0xb350('0x2'));exports[_0xb350('0x3')]=function(_0x2fd937){return client[_0xb350('0x4')](_0xb350('0x5'),{'body':_[_0xb350('0x6')](_0x2fd937,{'source':_0x2fd937[_0xb350('0x7')],'destinationcontext':_0x2fd937['context'],'callerid':_0x2fd937[_0xb350('0x8')],'amaflags':_0xb350('0x9')}),'log':_0xb350('0x5')});};exports[_0xb350('0xa')]=function(){return function(){return client[_0xb350('0x4')](_0xb350('0xb'),{'options':{'where':{'type':[_0xb350('0xc')],'createdAt':{'$between':[moment()[_0xb350('0xd')](_0xb350('0xe'))[_0xb350('0xf')](_0xb350('0x10')),moment()['endOf'](_0xb350('0xe'))[_0xb350('0xf')](_0xb350('0x10'))]}},'attributes':[_0xb350('0x11'),_0xb350('0x12'),_0xb350('0x13'),_0xb350('0x14')]},'log':_0xb350('0x15')});};}; \ No newline at end of file +var _0x3800=['calleridnum','context','callerid','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','create','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3800,0xc2));var _0x0380=function(_0x59445a,_0x3ed9dc){_0x59445a=_0x59445a-0x0;var _0xe5340c=_0x3800[_0x59445a];return _0xe5340c;};'use strict';var moment=require(_0x0380('0x0'));var util=require(_0x0380('0x1'));var _=require('lodash');var client=require('../client');exports[_0x0380('0x2')]=function(_0x27f60f){return client['Request']('CreateVoiceCallReport',{'body':_[_0x0380('0x3')](_0x27f60f,{'source':_0x27f60f[_0x0380('0x4')],'destinationcontext':_0x27f60f[_0x0380('0x5')],'callerid':_0x27f60f[_0x0380('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0x0380('0x7')});};exports[_0x0380('0x8')]=function(){return function(){return client[_0x0380('0x9')](_0x0380('0xa'),{'options':{'where':{'type':[_0x0380('0xb')],'createdAt':{'$between':[moment()[_0x0380('0xc')](_0x0380('0xd'))[_0x0380('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0380('0xf')](_0x0380('0xd'))['format'](_0x0380('0x10'))]}},'attributes':[_0x0380('0x11'),_0x0380('0x12'),_0x0380('0x13'),_0x0380('0x14')]},'log':_0x0380('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 56a65d7..f7987ce 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 _0xd4d9=['CreateVoiceDialReport','../client','create'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0xd4d9,0x145));var _0x9d4d=function(_0x44ab0c,_0x5939ce){_0x44ab0c=_0x44ab0c-0x0;var _0x3c1463=_0xd4d9[_0x44ab0c];return _0x3c1463;};'use strict';var client=require(_0x9d4d('0x0'));exports[_0x9d4d('0x1')]=function(_0x12b85b){return client['Request'](_0x9d4d('0x2'),{'body':_0x12b85b,'log':_0x9d4d('0x2')});}; \ No newline at end of file +var _0x351b=['../client','create','Request'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x351b,0x1c5));var _0xb351=function(_0x473be2,_0x3f0ab7){_0x473be2=_0x473be2-0x0;var _0x2bc8ba=_0x351b[_0x473be2];return _0x2bc8ba;};'use strict';var client=require(_0xb351('0x0'));exports[_0xb351('0x1')]=function(_0x20758c){return client[_0xb351('0x2')]('CreateVoiceDialReport',{'body':_0x20758c,'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 18924d3..8565dca 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 _0xf323=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x40fb20,_0x3a07d0){var _0x50b114=function(_0x100b4b){while(--_0x100b4b){_0x40fb20['push'](_0x40fb20['shift']());}};_0x50b114(++_0x3a07d0);}(_0xf323,0x1c6));var _0x3f32=function(_0x47b1a8,_0x145187){_0x47b1a8=_0x47b1a8-0x0;var _0x2f20b7=_0xf323[_0x47b1a8];return _0x2f20b7;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x3f32('0x0')](_0x3f32('0x1'),{'options':{'raw':!![],'attributes':['id','exten',_0x3f32('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x3f32('0x3')});};}; \ No newline at end of file +var _0x7d98=['recordingFormat','../client','Request','GetVoiceExtension','exten'];(function(_0x2a41a9,_0x569e2e){var _0x470725=function(_0x208a9b){while(--_0x208a9b){_0x2a41a9['push'](_0x2a41a9['shift']());}};_0x470725(++_0x569e2e);}(_0x7d98,0xe7));var _0x87d9=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x7d98[_0x202d24];return _0x2b3a8e;};'use strict';var client=require(_0x87d9('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x87d9('0x1')](_0x87d9('0x2'),{'options':{'raw':!![],'attributes':['id',_0x87d9('0x3'),_0x87d9('0x4')],'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 fb889f9..2065334 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 _0xd8ae=['Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup'];(function(_0x5900b6,_0x542703){var _0x33347b=function(_0x4971d6){while(--_0x4971d6){_0x5900b6['push'](_0x5900b6['shift']());}};_0x33347b(++_0x542703);}(_0xd8ae,0x183));var _0xed8a=function(_0x2441f1,_0xb92977){_0x2441f1=_0x2441f1-0x0;var _0x468aad=_0xd8ae[_0x2441f1];return _0x468aad;};'use strict';var client=require(_0xed8a('0x0'));exports[_0xed8a('0x1')]=function(){return function(){return client[_0xed8a('0x2')](_0xed8a('0x3'),{'options':{'raw':![],'attributes':['id',_0xed8a('0x4'),_0xed8a('0x5'),_0xed8a('0x6'),_0xed8a('0x7'),'monitor_format',_0xed8a('0x8'),_0xed8a('0x9'),_0xed8a('0xa'),_0xed8a('0xb'),'dialLimitQueue',_0xed8a('0xc'),_0xed8a('0xd'),_0xed8a('0xe'),_0xed8a('0xf'),_0xed8a('0x10'),_0xed8a('0x11'),_0xed8a('0x12'),_0xed8a('0x13'),_0xed8a('0x14'),_0xed8a('0x15'),_0xed8a('0x16'),_0xed8a('0x17'),_0xed8a('0x18'),_0xed8a('0x19'),_0xed8a('0x1a'),_0xed8a('0x1b'),_0xed8a('0x1c'),'dialTimezone',_0xed8a('0x1d'),'dialPrefix','dialCheckDuplicateType',_0xed8a('0x1e'),_0xed8a('0x1f'),_0xed8a('0x20'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xed8a('0x21'),_0xed8a('0x22'),_0xed8a('0x23'),_0xed8a('0x24'),_0xed8a('0x25'),_0xed8a('0x26'),_0xed8a('0x27'),_0xed8a('0x28'),_0xed8a('0x29'),'dialAgiAfterHangupAgent',_0xed8a('0x2a'),_0xed8a('0x2b'),'monitor_format','strategy',_0xed8a('0x2c'),'dialCutDigit',_0xed8a('0x2d'),_0xed8a('0x2e'),_0xed8a('0x2f'),_0xed8a('0x30'),'dialAbandonedMaxRetry',_0xed8a('0x31'),_0xed8a('0x32'),_0xed8a('0x33'),_0xed8a('0x34'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0xed8a('0x35'),'dialPredictiveIntervalMinThreshold',_0xed8a('0x36'),_0xed8a('0x37')],'include':[{'model':_0xed8a('0x38'),'as':'Trunk','attributes':['id',_0xed8a('0x4'),_0xed8a('0x39'),_0xed8a('0x3a')]},{'model':'Pause','as':_0xed8a('0x3b'),'attributes':['id',_0xed8a('0x4')]},{'model':_0xed8a('0x38'),'as':_0xed8a('0x3c'),'attributes':['id',_0xed8a('0x4'),_0xed8a('0x39'),_0xed8a('0x3a')]},{'model':_0xed8a('0x3d'),'as':'Interval','attributes':['id',_0xed8a('0x4')],'include':[{'model':_0xed8a('0x3d'),'as':_0xed8a('0x3e'),'attributes':['id',_0xed8a('0x4'),_0xed8a('0x3f')]}]}]},'log':_0xed8a('0x1')});};}; \ No newline at end of file +var _0x5a96=['callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','name','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk'];(function(_0x10ab8f,_0x134ca1){var _0x50ddaf=function(_0x536136){while(--_0x536136){_0x10ab8f['push'](_0x10ab8f['shift']());}};_0x50ddaf(++_0x134ca1);}(_0x5a96,0xf1));var _0x65a9=function(_0x482a73,_0x294046){_0x482a73=_0x482a73-0x0;var _0x39b97f=_0x5a96[_0x482a73];return _0x39b97f;};'use strict';var client=require(_0x65a9('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x65a9('0x1'),_0x65a9('0x2'),'acwTimeout',_0x65a9('0x3'),'monitor_format',_0x65a9('0x4'),_0x65a9('0x5'),_0x65a9('0x6'),_0x65a9('0x7'),_0x65a9('0x8'),_0x65a9('0x9'),_0x65a9('0xa'),'dialPredictiveOptimizationPercentage',_0x65a9('0xb'),_0x65a9('0xc'),_0x65a9('0xd'),'dialOriginateTimeout','dialQueueOptions',_0x65a9('0xe'),_0x65a9('0xf'),_0x65a9('0x10'),'dialCongestionRetryFrequency',_0x65a9('0x11'),_0x65a9('0x12'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x65a9('0x13'),'dialTimezone',_0x65a9('0x14'),_0x65a9('0x15'),_0x65a9('0x16'),'dialAMDActive',_0x65a9('0x17'),_0x65a9('0x18'),_0x65a9('0x19'),'dialAMDTotalAnalysisTime',_0x65a9('0x1a'),_0x65a9('0x1b'),'dialAMDMaximumNumberOfWords',_0x65a9('0x1c'),_0x65a9('0x1d'),_0x65a9('0x1e'),_0x65a9('0x1f'),_0x65a9('0x20'),'dialOrderByScheduledAt',_0x65a9('0x21'),_0x65a9('0x22'),'dialQueueProject2',_0x65a9('0x23'),_0x65a9('0x24'),'dialRandomLastDigitCallerIdNumber',_0x65a9('0x25'),'dialNoSuchNumberMaxRetry',_0x65a9('0x26'),'dialDropMaxRetry',_0x65a9('0x27'),_0x65a9('0x28'),_0x65a9('0x29'),_0x65a9('0x2a'),_0x65a9('0x2b'),_0x65a9('0x2c'),'dialAgentRejectRetryFrequency',_0x65a9('0x2d'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x65a9('0x2e'),_0x65a9('0x2f')],'include':[{'model':'Trunk','as':_0x65a9('0x30'),'attributes':['id',_0x65a9('0x1'),_0x65a9('0x31'),_0x65a9('0x32')]},{'model':_0x65a9('0x33'),'as':_0x65a9('0x34'),'attributes':['id',_0x65a9('0x1')]},{'model':_0x65a9('0x30'),'as':_0x65a9('0x35'),'attributes':['id',_0x65a9('0x1'),_0x65a9('0x31'),_0x65a9('0x32')]},{'model':'Interval','as':_0x65a9('0x36'),'attributes':['id',_0x65a9('0x1')],'include':[{'model':_0x65a9('0x36'),'as':_0x65a9('0x37'),'attributes':['id',_0x65a9('0x1'),_0x65a9('0x38')]}]}]},'log':_0x65a9('0x39')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4a5d97e..f9dc975 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(_0x516cd8,_0x3b48e6){var _0x1fd5fa=function(_0x47d973){while(--_0x47d973){_0x516cd8['push'](_0x516cd8['shift']());}};_0x1fd5fa(++_0x3b48e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x4fc3f9,_0xe76366){var _0x56d8dc=function(_0x86afff){while(--_0x86afff){_0x4fc3f9['push'](_0x4fc3f9['shift']());}};_0x56d8dc(++_0xe76366);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 466e95c..9720ce7 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 _0x13d5=['GetVoiceQueueRtPauses','Request'];(function(_0x3c02e0,_0x49fbc5){var _0x344759=function(_0x1c40ce){while(--_0x1c40ce){_0x3c02e0['push'](_0x3c02e0['shift']());}};_0x344759(++_0x49fbc5);}(_0x13d5,0xd5));var _0x513d=function(_0x4263c2,_0x22581f){_0x4263c2=_0x4263c2-0x0;var _0x1fd4d3=_0x13d5[_0x4263c2];return _0x1fd4d3;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x3c6362){return function(){return client[_0x513d('0x0')](_0x513d('0x1'),{'options':{'where':{'VoiceQueueId':_0x3c6362,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xaa8b=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x12dfa1,_0x36ff32){var _0x5db581=function(_0x3f1237){while(--_0x3f1237){_0x12dfa1['push'](_0x12dfa1['shift']());}};_0x5db581(++_0x36ff32);}(_0xaa8b,0x1d5));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xbaa8('0x0'));exports[_0xbaa8('0x1')]=function(_0x5d8885){return function(){return client[_0xbaa8('0x2')](_0xbaa8('0x3'),{'options':{'where':{'VoiceQueueId':_0x5d8885,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 23bbccd..91f3dc7 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x9bfdd1,_0x1399fd){var _0x23bdc2=function(_0xd62e0a){while(--_0xd62e0a){_0x9bfdd1['push'](_0x9bfdd1['shift']());}};_0x23bdc2(++_0x1399fd);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2f0138,_0x1252f0){var _0x96e492=function(_0x142936){while(--_0x142936){_0x2f0138['push'](_0x2f0138['shift']());}};_0x96e492(++_0x1252f0);}(_0x7a54,0x106));var _0x47a5=function(_0xc5fa7f,_0x309f45){_0xc5fa7f=_0xc5fa7f-0x0;var _0x3885c9=_0x7a54[_0xc5fa7f];return _0x3885c9;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index df428f3..68c5b61 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 _0xb37f=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel'];(function(_0x5e0089,_0xca7afa){var _0x382800=function(_0x4b2ed3){while(--_0x4b2ed3){_0x5e0089['push'](_0x5e0089['shift']());}};_0x382800(++_0xca7afa);}(_0xb37f,0x109));var _0xfb37=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xb37f[_0x31a371];return _0x2a5bd6;};'use strict';var client=require(_0xfb37('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x34d7d3){return client[_0xfb37('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x34d7d3['result'],'transfererchannel':_0x34d7d3[_0xfb37('0x2')],'transferercalleridnum':_0x34d7d3[_0xfb37('0x3')],'transferercalleridname':_0x34d7d3[_0xfb37('0x4')],'transfererconnectedlinenum':_0x34d7d3[_0xfb37('0x5')],'transfererconnectedlinename':_0x34d7d3[_0xfb37('0x6')],'transfereraccountcode':_0x34d7d3['transfereraccountcode'],'transferercontext':_0x34d7d3[_0xfb37('0x7')],'transfererexten':_0x34d7d3['transfererexten'],'transfererlinkedid':_0x34d7d3['transfererlinkedid'],'transfereechannel':_0x34d7d3[_0xfb37('0x8')],'transfereecalleridnum':_0x34d7d3[_0xfb37('0x9')],'transfereecalleridname':_0x34d7d3[_0xfb37('0xa')],'transfereeconnectedlinenum':_0x34d7d3[_0xfb37('0xb')],'transfereeconnectedlinename':_0x34d7d3['transfereeconnectedlinename'],'transfereeaccountcode':_0x34d7d3[_0xfb37('0xc')],'transfereecontext':_0x34d7d3[_0xfb37('0xd')],'transfereeexten':_0x34d7d3[_0xfb37('0xe')],'transfereelinkedid':_0x34d7d3[_0xfb37('0xf')],'isexternal':_0x34d7d3[_0xfb37('0x10')],'context':_0x34d7d3[_0xfb37('0x11')],'extension':_0x34d7d3['extension'],'type':_0xfb37('0x12')},'log':_0xfb37('0x13')});};exports[_0xfb37('0x14')]=function(_0x397522){return client[_0xfb37('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x397522[_0xfb37('0x15')],'transfererchannel':_0x397522[_0xfb37('0x16')],'transferercalleridnum':_0x397522['origtransferercalleridnum'],'transferercalleridname':_0x397522[_0xfb37('0x17')],'transfererconnectedlinenum':_0x397522[_0xfb37('0x18')],'transfererconnectedlinename':_0x397522[_0xfb37('0x19')],'transfereraccountcode':_0x397522[_0xfb37('0x1a')],'transferercontext':_0x397522[_0xfb37('0x1b')],'transfererexten':_0x397522[_0xfb37('0x1c')],'transfererlinkedid':_0x397522['origtransfererlinkedid'],'transfereechannel':_0x397522[_0xfb37('0x1d')],'transfereecalleridnum':_0x397522[_0xfb37('0x1e')],'transfereecalleridname':_0x397522['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x397522['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x397522[_0xfb37('0x1f')],'transfereeaccountcode':_0x397522['transfertargetaccountcode'],'transfereecontext':_0x397522['transfertargetcontext'],'transfereeexten':_0x397522[_0xfb37('0x20')],'transfereelinkedid':_0x397522[_0xfb37('0x21')],'isexternal':_0x397522[_0xfb37('0x10')],'context':_0x397522['origtransferercontext'],'extension':_0x397522[_0xfb37('0x22')],'type':_0xfb37('0x23')},'log':_0xfb37('0x13')});}; \ No newline at end of file +var _0xb44c=['transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb44c,0x68));var _0xcb44=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0xb44c[_0x17249c];return _0x324e7b;};'use strict';var client=require(_0xcb44('0x0'));exports[_0xcb44('0x1')]={};exports[_0xcb44('0x2')]=function(_0x51578e){return client[_0xcb44('0x3')](_0xcb44('0x4'),{'body':{'result':_0x51578e[_0xcb44('0x5')],'transfererchannel':_0x51578e['transfererchannel'],'transferercalleridnum':_0x51578e[_0xcb44('0x6')],'transferercalleridname':_0x51578e[_0xcb44('0x7')],'transfererconnectedlinenum':_0x51578e[_0xcb44('0x8')],'transfererconnectedlinename':_0x51578e[_0xcb44('0x9')],'transfereraccountcode':_0x51578e[_0xcb44('0xa')],'transferercontext':_0x51578e['transferercontext'],'transfererexten':_0x51578e['transfererexten'],'transfererlinkedid':_0x51578e[_0xcb44('0xb')],'transfereechannel':_0x51578e[_0xcb44('0xc')],'transfereecalleridnum':_0x51578e[_0xcb44('0xd')],'transfereecalleridname':_0x51578e[_0xcb44('0xe')],'transfereeconnectedlinenum':_0x51578e[_0xcb44('0xf')],'transfereeconnectedlinename':_0x51578e[_0xcb44('0x10')],'transfereeaccountcode':_0x51578e['transfereeaccountcode'],'transfereecontext':_0x51578e['transfereecontext'],'transfereeexten':_0x51578e['transfereeexten'],'transfereelinkedid':_0x51578e['transfereelinkedid'],'isexternal':_0x51578e[_0xcb44('0x11')],'context':_0x51578e[_0xcb44('0x12')],'extension':_0x51578e[_0xcb44('0x13')],'type':_0xcb44('0x14')},'log':_0xcb44('0x4')});};exports[_0xcb44('0x15')]=function(_0x65624b){return client[_0xcb44('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x65624b[_0xcb44('0x5')],'transfererchannel':_0x65624b[_0xcb44('0x16')],'transferercalleridnum':_0x65624b[_0xcb44('0x17')],'transferercalleridname':_0x65624b[_0xcb44('0x18')],'transfererconnectedlinenum':_0x65624b[_0xcb44('0x19')],'transfererconnectedlinename':_0x65624b[_0xcb44('0x1a')],'transfereraccountcode':_0x65624b['origtransfereraccountcode'],'transferercontext':_0x65624b['secondtransferercontext'],'transfererexten':_0x65624b[_0xcb44('0x1b')],'transfererlinkedid':_0x65624b['origtransfererlinkedid'],'transfereechannel':_0x65624b[_0xcb44('0x1c')],'transfereecalleridnum':_0x65624b[_0xcb44('0x1d')],'transfereecalleridname':_0x65624b[_0xcb44('0x1e')],'transfereeconnectedlinenum':_0x65624b[_0xcb44('0x1f')],'transfereeconnectedlinename':_0x65624b[_0xcb44('0x20')],'transfereeaccountcode':_0x65624b['transfertargetaccountcode'],'transfereecontext':_0x65624b[_0xcb44('0x21')],'transfereeexten':_0x65624b[_0xcb44('0x22')],'transfereelinkedid':_0x65624b['transfertargetlinkedid'],'isexternal':_0x65624b[_0xcb44('0x11')],'context':_0x65624b[_0xcb44('0x23')],'extension':_0x65624b[_0xcb44('0x24')],'type':'attended'},'log':_0xcb44('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5e2ce89..211011e 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x497dd2,_0x2b9235){var _0x5071a3=function(_0x4e21d0){while(--_0x4e21d0){_0x497dd2['push'](_0x497dd2['shift']());}};_0x5071a3(++_0x2b9235);}(_0xb10b,0x12a));var _0xbb10=function(_0xe8fa1f,_0x12bba1){_0xe8fa1f=_0xe8fa1f-0x0;var _0x4b3a65=_0xb10b[_0xe8fa1f];return _0x4b3a65;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x251645,_0x103496){var _0x2efcc0=function(_0x2a9540){while(--_0x2a9540){_0x251645['push'](_0x251645['shift']());}};_0x2efcc0(++_0x103496);}(_0xb10b,0x12a));var _0xbb10=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xb10b[_0x207811];return _0x170d56;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 8b11ae7..cd7ccd1 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 _0x01a4=['Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','action','merge','length','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','destcalleridnum','calleridnum','routeId','lastName','phone','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','firstName','calleridname',''];(function(_0x5ba3ac,_0x2d26d9){var _0x18b913=function(_0x51e3e2){while(--_0x51e3e2){_0x5ba3ac['push'](_0x5ba3ac['shift']());}};_0x18b913(++_0x2d26d9);}(_0x01a4,0x16d));var _0x401a=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x01a4[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x401a('0x0'));var BPromise=require('bluebird');var Redis=require(_0x401a('0x1'));var util=require(_0x401a('0x2'));var config=require(_0x401a('0x3'));var logger=require('../../../../config/logger')(_0x401a('0x4'));var cmContactRpc=require(_0x401a('0x5'));config[_0x401a('0x6')]=_[_0x401a('0x7')](config['redis'],{'host':_0x401a('0x8'),'port':0x18eb});var io=require(_0x401a('0x9'))(new Redis(config[_0x401a('0x6')]));function emit(_0xd8762d,_0x597344,_0x1cc468,_0x289961,_0x1d768e){logger[_0x401a('0xa')](_0x401a('0xb'),_0xd8762d,_0x597344['id'],_0x1cc468,_0x289961,JSON[_0x401a('0xc')](_0x1d768e));io['to'](_0x1cc468)[_0x401a('0xd')](_0x289961,_0x1d768e);}exports[_0x401a('0xe')]=function(_0x1d3bd2,_0x5e5c6b,_0x515e1c,_0x11a229){var _0x596ba0,_0x199292;var _0x43249a={};var _0x3335d9;var _0x37e6e0=Number(_0x515e1c[_0x401a('0xf')]);var _0x697a52=_0x515e1c[_0x401a('0x10')]?Boolean(Number(_0x515e1c[_0x401a('0x10')])):![];var _0x1fed65;var _0x21a5cd=![];if(!_['isNil'](_0x515e1c[_0x401a('0x11')])){if(_0x515e1c[_0x401a('0x11')]=='1')_0x21a5cd=!![];}if(!_0x21a5cd){if(_0x11a229[_0x401a('0x12')]){_0x43249a['id']=_0x11a229[_0x401a('0x12')];}}if(!_0x43249a['id']){_0x43249a[_0x401a('0x13')]=_0x37e6e0;_0x1fed65=_0x515e1c[_0x401a('0x14')]&&_0x515e1c[_0x401a('0x14')]!=='0'?_0x515e1c[_0x401a('0x14')][_0x401a('0x15')](','):['phone'];_0x43249a[_0x401a('0x16')]=_['map'](_0x1fed65,function(_0xe9c696){var _0x5614c4={};_0x5614c4[_0xe9c696]=_0x11a229['routeId']?_0x11a229[_0x401a('0x17')]:_0x11a229[_0x401a('0x18')];return _0x5614c4;});_0x3335d9=_0x11a229[_0x401a('0x19')]?_0x11a229['destcalleridnum']:_0x11a229[_0x401a('0x18')];}var _0x2b3153=['id','firstName',_0x401a('0x1a'),_0x401a('0x1b'),_0x401a('0x1c'),_0x401a('0x1d'),_0x401a('0x13'),_0x401a('0x1e'),_0x401a('0x1f'),'updatedAt'];var _0x3e461a=_[_0x401a('0x20')](_0x2b3153,_0x1fed65);BPromise[_0x401a('0x21')]()[_0x401a('0x22')](cmContactRpc[_0x401a('0x23')]({'attributes':_0x3e461a,'where':_0x43249a,'phone':_0x3335d9}))[_0x401a('0x22')](function(_0x27c528){_0x199292=_0x27c528;if(!_[_0x401a('0x24')](_0x199292)){if(_0x199292['length']===0x1){_0x596ba0=_0x199292[0x0];logger[_0x401a('0xa')](_0x401a('0x25'),_0x11a229[_0x401a('0x26')],_0x5e5c6b['id'],_0x596ba0['id']);}else{logger[_0x401a('0xa')](_0x401a('0x27'),_0x11a229[_0x401a('0x26')],_0x5e5c6b['id'],_[_0x401a('0x28')](_0x199292,'id')[_0x401a('0x29')](','));}return;}else{logger[_0x401a('0xa')](_0x401a('0x2a'),_0x11a229[_0x401a('0x26')],_0x5e5c6b['id']);var _0x395e13={'ListId':_0x37e6e0};var _0x3f8b77=_0x515e1c[_0x401a('0x2b')]&&_0x515e1c[_0x401a('0x2b')]!=='0'?_0x515e1c[_0x401a('0x2b')]:_0x401a('0x1b');if(_0x697a52){logger[_0x401a('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x11a229[_0x401a('0x26')],_0x5e5c6b['id']);_0x395e13[_0x3f8b77]=_[_0x401a('0x2c')](_0x11a229[_0x401a('0x19')])?_0x11a229[_0x401a('0x18')]:_0x11a229[_0x401a('0x17')];if(_['isNil'](_0x11a229['routeId'])){_0x395e13[_0x401a('0x2d')]=_0x11a229[_0x401a('0x2e')]&&_0x11a229[_0x401a('0x2e')]!==_0x401a('0x2f')?_0x11a229[_0x401a('0x2e')]:_0x401a('0x30');}else{_0x395e13[_0x401a('0x2d')]=_0x11a229[_0x401a('0x31')]&&_0x11a229[_0x401a('0x31')]!==_0x401a('0x2f')?_0x11a229[_0x401a('0x31')]:'Unknown';}return BPromise[_0x401a('0x21')]()[_0x401a('0x22')](cmContactRpc[_0x401a('0x32')](_0x395e13))['then'](function(_0x57d894){_0x596ba0=_0x57d894;_0x199292[_0x401a('0x33')](_0x57d894);if(_0x596ba0){logger['info'](_0x401a('0x34'),_0x11a229['uniqueid'],_0x5e5c6b['id'],_0x596ba0['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x11a229[_0x401a('0x26')],_0x5e5c6b['id']);_0x395e13[_0x3f8b77]=_['isNil'](_0x11a229[_0x401a('0x19')])?_0x11a229[_0x401a('0x18')]:_0x11a229[_0x401a('0x17')];if(_[_0x401a('0x2c')](_0x11a229['routeId'])){_0x395e13[_0x401a('0x2d')]=_0x11a229[_0x401a('0x2e')]&&_0x11a229[_0x401a('0x2e')]!==_0x401a('0x2f')?_0x11a229[_0x401a('0x2e')]:_0x401a('0x30');}else{_0x395e13[_0x401a('0x2d')]=_0x11a229[_0x401a('0x31')]&&_0x11a229[_0x401a('0x31')]!==_0x401a('0x2f')?_0x11a229[_0x401a('0x31')]:'Unknown';}_0x596ba0=_0x395e13;_0x199292[_0x401a('0x33')](_0x395e13);return;}}})[_0x401a('0x22')](function(){if(_0x1d3bd2){emit(_0x11a229[_0x401a('0x26')],_0x5e5c6b,util[_0x401a('0x35')](_0x401a('0x36'),_0x1d3bd2[_0x401a('0x37')]),util[_0x401a('0x35')]('trigger:%s',_0x515e1c[_0x401a('0x38')]['toLowerCase']()),{'evt':_[_0x401a('0x39')](_0x11a229,{'autoCreate':_0x697a52}),'contact':_0x596ba0===undefined?{}:_0x596ba0,'contacts':_0x199292[_0x401a('0x3a')]===0x0?undefined:_0x199292});}});}; \ No newline at end of file +var _0x69df=['calleridname','','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridname','format','user:%s','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName'];(function(_0x14f8ef,_0x1b1107){var _0x3b97f6=function(_0xebf2c2){while(--_0xebf2c2){_0x14f8ef['push'](_0x14f8ef['shift']());}};_0x3b97f6(++_0x1b1107);}(_0x69df,0x19c));var _0xf69d=function(_0x514ef1,_0x5d5cb1){_0x514ef1=_0x514ef1-0x0;var _0x3f5790=_0x69df[_0x514ef1];return _0x3f5790;};'use strict';var _=require('lodash');var BPromise=require(_0xf69d('0x0'));var Redis=require(_0xf69d('0x1'));var util=require(_0xf69d('0x2'));var config=require(_0xf69d('0x3'));var logger=require(_0xf69d('0x4'))(_0xf69d('0x5'));var cmContactRpc=require(_0xf69d('0x6'));config[_0xf69d('0x7')]=_['defaults'](config[_0xf69d('0x7')],{'host':_0xf69d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf69d('0x7')]));function emit(_0x319477,_0x4875cd,_0x5e1a09,_0x1c0549,_0x1be97a){logger[_0xf69d('0x9')](_0xf69d('0xa'),_0x319477,_0x4875cd['id'],_0x5e1a09,_0x1c0549,JSON[_0xf69d('0xb')](_0x1be97a));io['to'](_0x5e1a09)['emit'](_0x1c0549,_0x1be97a);}exports[_0xf69d('0xc')]=function(_0x3dce7d,_0x5ab5cb,_0x214e07,_0x34385f){var _0x559094,_0x238b26;var _0x4c1d7f={};var _0xbf05c9;var _0x23dd42=Number(_0x214e07[_0xf69d('0xd')]);var _0x51afe7=_0x214e07[_0xf69d('0xe')]?Boolean(Number(_0x214e07[_0xf69d('0xe')])):![];var _0xde0764;var _0x26d4c8=![];if(!_[_0xf69d('0xf')](_0x214e07['data5'])){if(_0x214e07['data5']=='1')_0x26d4c8=!![];}if(!_0x26d4c8){if(_0x34385f['xmd-contactid']){_0x4c1d7f['id']=_0x34385f['xmd-contactid'];}}if(!_0x4c1d7f['id']){_0x4c1d7f[_0xf69d('0x10')]=_0x23dd42;_0xde0764=_0x214e07[_0xf69d('0x11')]&&_0x214e07[_0xf69d('0x11')]!=='0'?_0x214e07[_0xf69d('0x11')][_0xf69d('0x12')](','):[_0xf69d('0x13')];_0x4c1d7f[_0xf69d('0x14')]=_['map'](_0xde0764,function(_0x5a6123){var _0x4db1ad={};_0x4db1ad[_0x5a6123]=_0x34385f[_0xf69d('0x15')]?_0x34385f[_0xf69d('0x16')]:_0x34385f[_0xf69d('0x17')];return _0x4db1ad;});_0xbf05c9=_0x34385f[_0xf69d('0x15')]?_0x34385f['destcalleridnum']:_0x34385f[_0xf69d('0x17')];}var _0x211e1e=['id','firstName',_0xf69d('0x18'),'phone',_0xf69d('0x19'),_0xf69d('0x1a'),'ListId',_0xf69d('0x1b'),_0xf69d('0x1c'),_0xf69d('0x1d')];var _0x41d728=_[_0xf69d('0x1e')](_0x211e1e,_0xde0764);BPromise[_0xf69d('0x1f')]()[_0xf69d('0x20')](cmContactRpc[_0xf69d('0x21')]({'attributes':_0x41d728,'where':_0x4c1d7f,'phone':_0xbf05c9}))[_0xf69d('0x20')](function(_0x53a116){_0x238b26=_0x53a116;if(!_[_0xf69d('0x22')](_0x238b26)){if(_0x238b26[_0xf69d('0x23')]===0x1){_0x559094=_0x238b26[0x0];logger[_0xf69d('0x9')](_0xf69d('0x24'),_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id'],_0x559094['id']);}else{logger[_0xf69d('0x9')](_0xf69d('0x26'),_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id'],_['map'](_0x238b26,'id')[_0xf69d('0x27')](','));}return;}else{logger['info'](_0xf69d('0x28'),_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id']);var _0x5ed3a0={'ListId':_0x23dd42};var _0x25b35a=_0x214e07[_0xf69d('0x29')]&&_0x214e07[_0xf69d('0x29')]!=='0'?_0x214e07[_0xf69d('0x29')]:_0xf69d('0x13');if(_0x51afe7){logger[_0xf69d('0x9')](_0xf69d('0x2a'),_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id']);_0x5ed3a0[_0x25b35a]=_[_0xf69d('0xf')](_0x34385f[_0xf69d('0x15')])?_0x34385f[_0xf69d('0x17')]:_0x34385f[_0xf69d('0x16')];if(_['isNil'](_0x34385f[_0xf69d('0x15')])){_0x5ed3a0[_0xf69d('0x2b')]=_0x34385f[_0xf69d('0x2c')]&&_0x34385f['calleridname']!==_0xf69d('0x2d')?_0x34385f['calleridname']:_0xf69d('0x2e');}else{_0x5ed3a0[_0xf69d('0x2b')]=_0x34385f['destcalleridname']&&_0x34385f['destcalleridname']!==_0xf69d('0x2d')?_0x34385f['destcalleridname']:_0xf69d('0x2e');}return BPromise['resolve']()['then'](cmContactRpc[_0xf69d('0x2f')](_0x5ed3a0))[_0xf69d('0x20')](function(_0x43080b){_0x559094=_0x43080b;_0x238b26[_0xf69d('0x30')](_0x43080b);if(_0x559094){logger['info'](_0xf69d('0x31'),_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id'],_0x559094['id']);}return;});}else{logger[_0xf69d('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x34385f[_0xf69d('0x25')],_0x5ab5cb['id']);_0x5ed3a0[_0x25b35a]=_[_0xf69d('0xf')](_0x34385f['routeId'])?_0x34385f[_0xf69d('0x17')]:_0x34385f[_0xf69d('0x16')];if(_[_0xf69d('0xf')](_0x34385f[_0xf69d('0x15')])){_0x5ed3a0['firstName']=_0x34385f[_0xf69d('0x2c')]&&_0x34385f[_0xf69d('0x2c')]!==''?_0x34385f['calleridname']:_0xf69d('0x2e');}else{_0x5ed3a0[_0xf69d('0x2b')]=_0x34385f['destcalleridname']&&_0x34385f['destcalleridname']!==''?_0x34385f[_0xf69d('0x32')]:_0xf69d('0x2e');}_0x559094=_0x5ed3a0;_0x238b26[_0xf69d('0x30')](_0x5ed3a0);return;}}})[_0xf69d('0x20')](function(){if(_0x3dce7d){emit(_0x34385f['uniqueid'],_0x5ab5cb,util[_0xf69d('0x33')](_0xf69d('0x34'),_0x3dce7d['name']),util[_0xf69d('0x33')](_0xf69d('0x35'),_0x214e07[_0xf69d('0x36')][_0xf69d('0x37')]()),{'evt':_[_0xf69d('0x38')](_0x34385f,{'autoCreate':_0x51afe7}),'contact':_0x559094===undefined?{}:_0x559094,'contacts':_0x238b26[_0xf69d('0x23')]===0x0?undefined:_0x238b26});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 1a965a2..01d2433 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 _0xa228=['../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','exec','queue','routeId','script','parse','query','AllConditions','every','AnyConditions','checkConditions','channel','checkTrigger:\x20trigger','evt','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','undefined','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa228,0x17b));var _0x8a22=function(_0x26afb8,_0x459a7e){_0x26afb8=_0x26afb8-0x0;var _0x5b5140=_0xa228[_0x26afb8];return _0x5b5140;};'use strict';var util=require(_0x8a22('0x0'));var _=require(_0x8a22('0x1'));var url=require(_0x8a22('0x2'));var Mustache=require(_0x8a22('0x3'));var Redis=require(_0x8a22('0x4'));var urlforward=require(_0x8a22('0x5'));var integration=require('./integration');var cmContact=require(_0x8a22('0x6'));var script=require(_0x8a22('0x7'));var config=require(_0x8a22('0x8'));var logger=require(_0x8a22('0x9'))(_0x8a22('0xa'));var ami=require(_0x8a22('0xb'));config[_0x8a22('0xc')]=_[_0x8a22('0xd')](config[_0x8a22('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x8a22('0xe'))(new Redis(config[_0x8a22('0xc')]));var operators={'equals':function(_0x72de22,_0x51374f){return _0x72de22==_0x51374f;},'not_equals':function(_0x5d8034,_0x555bcf){return _0x5d8034!=_0x555bcf;}};var barAndWebActions=[_0x8a22('0xf'),_0x8a22('0x2'),_0x8a22('0x10')];function Trigger(_0x47969b){this['triggers']=_0x47969b[_0x8a22('0x11')];this[_0x8a22('0x12')]=_0x47969b['agents'];this[_0x8a22('0x13')]=_0x47969b[_0x8a22('0x13')];this[_0x8a22('0x14')]=_0x47969b[_0x8a22('0x14')];this[_0x8a22('0x15')]=_0x47969b[_0x8a22('0x15')];this[_0x8a22('0x16')]=_0x47969b[_0x8a22('0x16')];this[_0x8a22('0x17')]=_0x47969b['freshdeskAccounts'];this[_0x8a22('0x18')]=_0x47969b[_0x8a22('0x18')];this[_0x8a22('0x19')]=_0x47969b[_0x8a22('0x19')];this[_0x8a22('0x1a')]=_0x47969b['zohoAccounts'];this['deskAccounts']=_0x47969b[_0x8a22('0x1b')];this[_0x8a22('0x1c')]=_0x47969b[_0x8a22('0x1c')];this[_0x8a22('0x1d')]=_0x47969b['servicenowAccounts'];this[_0x8a22('0x1e')]=_0x47969b[_0x8a22('0x1e')];this[_0x8a22('0x1f')]=_0x47969b[_0x8a22('0x1f')];this[_0x8a22('0x20')]={'zendesk':this[_0x8a22('0x16')],'salesforce':this[_0x8a22('0x18')],'freshdesk':this[_0x8a22('0x17')],'sugarcrm':this[_0x8a22('0x19')],'zoho':this[_0x8a22('0x1a')],'desk':this['deskAccounts'],'vtiger':this[_0x8a22('0x1c')],'dynamics365':this[_0x8a22('0x1e')],'freshsales':this[_0x8a22('0x1f')],'servicenow':this[_0x8a22('0x1d')]};ami['on']('custom:agentcalled',this[_0x8a22('0x21')]['bind'](this));ami['on']('custom:agentconnect',this['syncCustomEvent']['bind'](this));ami['on']('custom:agentringnoanswer',this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x23'),this['syncCustomEvent'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x24'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x25'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x26'),this[_0x8a22('0x21')]['bind'](this));ami['on']('custom:agentcongestion',this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on']('custom:agentreject',this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x27'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x28'),this['syncCustomEvent'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x29'),this[_0x8a22('0x21')]['bind'](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x2a'),this[_0x8a22('0x2b')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x2c'),this['syncAgentDial'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x2d'),this['syncCustomEvent'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x2e'),this[_0x8a22('0x21')]['bind'](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x2f'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x30'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x31'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x32'),this['syncCustomEvent'][_0x8a22('0x22')](this));ami['on'](_0x8a22('0x33'),this[_0x8a22('0x21')][_0x8a22('0x22')](this));}Trigger[_0x8a22('0x34')][_0x8a22('0x35')]=function(_0x2bc590,_0x5669c7,_0x1cd826){logger[_0x8a22('0x36')](_0x2bc590,_0x5669c7,JSON[_0x8a22('0x37')](_0x1cd826));io['to'](_0x2bc590)[_0x8a22('0x35')](_0x5669c7,_0x1cd826);};Trigger[_0x8a22('0x34')]['syncCustomEvent']=function(_0x18c49c){var _0x9629ea=_['clone'](_0x18c49c);if(typeof _0x9629ea[_0x8a22('0x38')]==='undefined'){_0x9629ea[_0x8a22('0x38')]=_0x8a22('0x39');}logger[_0x8a22('0x3a')](_0x8a22('0x21'),util[_0x8a22('0x3b')](_0x9629ea,{'showHidden':!![],'depth':null}));this[_0x8a22('0x3c')](_0x9629ea);};Trigger[_0x8a22('0x34')][_0x8a22('0x2b')]=function(_0x493dd4){if(this[_0x8a22('0x12')][_0x493dd4[_0x8a22('0x3d')]]){this[_0x8a22('0x21')](_0x493dd4);}};Trigger[_0x8a22('0x34')][_0x8a22('0x3c')]=function(_0x3bf6b8){var _0x38eaee;for(var _0x2afabd in this['triggers']){if(this[_0x8a22('0x11')][_0x8a22('0x3e')](_0x2afabd)){if(this['triggers'][_0x2afabd]['status']){_0x38eaee=this[_0x8a22('0x3f')](this[_0x8a22('0x11')][_0x2afabd],_0x3bf6b8);if(_0x38eaee){_[_0x8a22('0x40')](_0x3bf6b8,_0x3bf6b8[_0x8a22('0x41')]);for(var _0x54407c=0x0,_0x2d470e,_0x7ab46c,_0x108f9a;_0x54407c0x0){_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 _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','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','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x5fc3[_0x1a595a];return _0x33f008;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index d203b89..37c6c4b 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 _0xb0f5=['type','nameField','customField','idField','indexOf','content','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','queue','callDirection','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data2','data5','POST','clientId','password','access_token','error','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','userId','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','catch','toLowerCase','destcalleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist'];(function(_0x1add1b,_0x32f5fb){var _0x2821df=function(_0x34d3a5){while(--_0x34d3a5){_0x1add1b['push'](_0x1add1b['shift']());}};_0x2821df(++_0x32f5fb);}(_0xb0f5,0x1e1));var _0x5b0f=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xb0f5[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var rp=require(_0x5b0f('0x0'));var util=require('util');var intUtil=require('./util');var md5=require(_0x5b0f('0x1'));var Redis=require('ioredis');var logger=require(_0x5b0f('0x2'))(_0x5b0f('0x3'));var config=require(_0x5b0f('0x4'));config[_0x5b0f('0x5')]=_[_0x5b0f('0x6')](config['redis'],{'host':_0x5b0f('0x7'),'port':0x18eb});var io=require(_0x5b0f('0x8'))(new Redis(config['redis']));function getAuthToken(_0x61521f,_0x15233d,_0x2d9776){if(_0x61521f[_0x5b0f('0x9')]){_0x61521f[_0x5b0f('0xa')]=_0x61521f[_0x5b0f('0xb')][_0x5b0f('0xc')];_0x61521f['tenantId']=_0x61521f[_0x5b0f('0xb')][_0x5b0f('0xd')];return Promise['resolve'](_0x61521f[_0x5b0f('0xb')][_0x5b0f('0xe')]);}var _0x1f7c4c={'method':_0x5b0f('0xf'),'uri':_0x15233d,'form':{'client_id':_0x61521f[_0x5b0f('0x10')],'resource':_0x61521f[_0x5b0f('0xa')],'username':_0x61521f['username'],'password':_0x61521f[_0x5b0f('0x11')],'grant_type':'password','client_secret':_0x61521f['clientSecret']},'json':!![]};return rp(_0x1f7c4c)['then'](function(_0x6276b7){return _0x6276b7[_0x5b0f('0x12')];})['catch'](function(_0x3fd142){logger[_0x5b0f('0x13')]('['+[_0x2d9776[_0x5b0f('0x14')]()]+']\x20Wrong\x20credentials!');return _0x3fd142[_0x5b0f('0x15')];});}function getUser(_0x589ab3,_0x2d04f0,_0x351f30,_0x59b66f,_0x2fbf9d,_0x4d0780){return new Promise(function(_0x10775b,_0x10f4c6){return getAuthToken(_0x2d04f0,_0x59b66f,_0x4d0780)[_0x5b0f('0x16')](function(_0x25f61d){var _0x2fcc73={'method':_0x5b0f('0x17'),'uri':_0x2fbf9d+_0x5b0f('0x18'),'headers':{'Authorization':_0x5b0f('0x19')+_0x25f61d,'OData-Version':_0x5b0f('0x1a')},'json':!![]};return rp(_0x2fcc73);})[_0x5b0f('0x16')](function(_0x2d754e){var _0x2ecece=_0x2d754e[_0x5b0f('0x1b')];var _0x1d222c=![];var _0x42cf17=null;if(!_['isNil'](_0x351f30)){if(intUtil[_0x5b0f('0x1c')](_0x351f30[_0x5b0f('0x1d')])){_0x589ab3['userEmail']=_0x351f30[_0x5b0f('0x1d')];for(_0x42cf17=0x0;_0x42cf17<_0x2ecece[_0x5b0f('0x1e')];_0x42cf17++){if(_0x2ecece[_0x42cf17][_0x5b0f('0x1f')]===_0x351f30[_0x5b0f('0x1d')]&&!_0x2ecece[_0x42cf17][_0x5b0f('0x20')]){_0x1d222c=!![];logger[_0x5b0f('0x21')]('['+[_0x4d0780['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x2ecece[_0x42cf17][_0x5b0f('0x22')]+'!');_0x589ab3['userId']=_0x2ecece[_0x42cf17][_0x5b0f('0x22')];}}}}if(!_0x1d222c){logger[_0x5b0f('0x21')]('['+[_0x4d0780[_0x5b0f('0x14')]()]+_0x5b0f('0x23'));_0x589ab3[_0x5b0f('0x24')]=_0x2d04f0[_0x5b0f('0x25')];for(_0x42cf17=0x0;_0x42cf17<_0x2ecece[_0x5b0f('0x1e')];_0x42cf17++){if(_0x2ecece[_0x42cf17]['internalemailaddress']===_0x2d04f0[_0x5b0f('0x25')]){_0x589ab3[_0x5b0f('0x26')]=_0x2ecece[_0x42cf17][_0x5b0f('0x22')];}}}_0x10775b(_0x589ab3);})['catch'](function(_0x3a5d07){_0x10f4c6(_0x3a5d07[_0x5b0f('0x15')]);});});}function createEndUser(_0x2ae96,_0x225427,_0x4feda7,_0x1ea3fa,_0x5cb459,_0x472176,_0x5c5665){return new Promise(function(_0x271f5e,_0x57151){return getAuthToken(_0x225427,_0x4feda7,_0x472176)[_0x5b0f('0x16')](function(_0x44dafe){var _0x18cef9=_0x472176['toLowerCase']()===_0x5b0f('0x27')?_0x5cb459['destcalleridnum']:_0x5cb459[_0x5b0f('0x28')];var _0x127a1f={'method':_0x5b0f('0xf'),'uri':_0x1ea3fa+_0x5b0f('0x29'),'body':{'fullname':_0x18cef9,'firstname':_0x18cef9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5b0f('0x2a')+_0x2ae96[_0x5b0f('0x26')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x44dafe,'OData-Version':_0x5b0f('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x127a1f['body'][_0x5c5665]=_0x18cef9;return rp(_0x127a1f);})[_0x5b0f('0x16')](function(_0x3eaee5){var _0x7d234e=_0x3eaee5[_0x5b0f('0x2b')][_0x5b0f('0x2c')];var _0x128399=_0x7d234e[_0x5b0f('0x2d')](_0x7d234e[_0x5b0f('0x2e')]('(')+0x1,_0x7d234e[_0x5b0f('0x2e')](')'));_0x2ae96[_0x5b0f('0x2f')]=_0x128399;_0x271f5e(_0x2ae96);})[_0x5b0f('0x30')](function(_0x6b5c4f){_0x57151(_0x6b5c4f[_0x5b0f('0x15')]);});});}function getEndUser(_0x44d175,_0x1ffe8c,_0x37b2cb,_0x2ca967,_0x25778f,_0x228a65,_0x2ea257,_0x34e3fd){var _0x2c5c4d=_0x228a65[_0x5b0f('0x31')]()===_0x5b0f('0x27')?_0x25778f[_0x5b0f('0x32')]:_0x25778f['calleridnum'];return getAuthToken(_0x1ffe8c,_0x37b2cb,_0x228a65)[_0x5b0f('0x16')](function(_0x371919){_0x34e3fd=_0x34e3fd?_0x34e3fd:_0x5b0f('0x33');var _0x2ab246={'method':'GET','uri':_0x2ca967+'contacts?$select='+_0x34e3fd+_0x5b0f('0x34')+_0x34e3fd+_0x5b0f('0x35')+_0x2c5c4d[_0x5b0f('0x36')]('+',_0x5b0f('0x37'))+'\x27','headers':{'Authorization':_0x5b0f('0x19')+_0x371919,'If-None-Match':null,'OData-Version':_0x5b0f('0x1a')},'json':!![]};return rp(_0x2ab246);})[_0x5b0f('0x16')](function(_0x5be5ba){var _0x35072a=![];if(!_0x5be5ba)return _0x35072a;var _0x3b8bf5=_0x5be5ba[_0x5b0f('0x1b')];for(var _0x12c7f7=0x0;_0x12c7f7<_0x3b8bf5[_0x5b0f('0x1e')];_0x12c7f7++){if(_0x3b8bf5[_0x12c7f7][_0x34e3fd]===_0x2c5c4d){_0x35072a=!![];_0x44d175[_0x5b0f('0x2f')]=_0x3b8bf5[_0x12c7f7][_0x5b0f('0x38')];}}return _0x35072a;})[_0x5b0f('0x16')](function(_0x453b8c){if(_0x453b8c)return _0x44d175;if(_0x2ea257===_0x5b0f('0x39')){logger['info']('['+[_0x228a65[_0x5b0f('0x14')]()]+_0x5b0f('0x3a'));return _0x44d175;}return createEndUser(_0x44d175,_0x1ffe8c,_0x37b2cb,_0x2ca967,_0x25778f,_0x228a65,_0x34e3fd)['then'](function(_0xebbd5){logger[_0x5b0f('0x21')]('['+[_0x228a65[_0x5b0f('0x14')]()]+_0x5b0f('0x3b'),_0xebbd5['enduserId']);return _0xebbd5;});});}function getCustomFields(_0x51667d,_0x3f680d,_0x2948c1){var _0xdd2dc2={};if(_0x51667d['length']>0x0){_[_0x5b0f('0x3c')](_0x51667d,function(_0xb06e77){if(_[_0x5b0f('0x3d')]([_0x5b0f('0x3e'),_0x5b0f('0x3f')],_0xb06e77[_0x5b0f('0x40')])&&_0xb06e77[_0x5b0f('0x41')]&&!_0xb06e77[_0x5b0f('0x42')]){var _0xe89265=_0xb06e77[_0x5b0f('0x43')][_0x5b0f('0x31')]();var _0x1fe3ed=_0xe89265['substring'](0x0,_0xe89265[_0x5b0f('0x44')]('_'));var _0x288177=_0xe89265['substring'](_0xe89265['indexOf']('_')+0x1);if(_0x1fe3ed===_0x2948c1){_0xdd2dc2[_0x288177]=_0xb06e77[_0x5b0f('0x45')];}}});}return _0xdd2dc2;}function getTicket(_0x2b628e,_0x6dfda9,_0xc8d2db,_0x1a0743,_0x5d6c4e,_0x59e76a,_0x3753d3){return new Promise(function(_0x3baccd,_0x6a1b64){var _0x35e03b;return getAuthToken(_0x6dfda9,_0xc8d2db,_0x3753d3)['then'](function(_0x27ed2d){if(_0x59e76a['ticketType']==='incident'){_0x35e03b={'method':_0x5b0f('0xf'),'uri':_0x1a0743+'incidents','body':Object[_0x5b0f('0x46')]({},{'title':intUtil[_0x5b0f('0x47')](_0x59e76a[_0x5b0f('0x48')],_0x5d6c4e,'\x20'),'description':intUtil[_0x5b0f('0x47')](_0x59e76a[_0x5b0f('0x49')],_0x5d6c4e,'\x0a'),'customerid_contact@odata.bind':_0x2b628e['enduserId']?_0x5b0f('0x4a')+_0x2b628e[_0x5b0f('0x2f')]+')':undefined,'ownerid@odata.bind':_0x5b0f('0x2a')+_0x2b628e['userId']+')','caseorigincode':'1'},getCustomFields(_0x59e76a[_0x5b0f('0x4b')],_0x5d6c4e,_0x59e76a[_0x5b0f('0x4c')])),'headers':{'Authorization':'Bearer\x20'+_0x27ed2d,'OData-Version':_0x5b0f('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x59e76a[_0x5b0f('0x4c')]===_0x5b0f('0x4d')){var _0x5b6ed0=_0x2b628e['enduserId']?[{'partyid_systemuser@odata.bind':_0x5b0f('0x2a')+_0x2b628e[_0x5b0f('0x26')]+')','participationtypemask':_0x2b628e['callDirection']===_0x5b0f('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x5b0f('0x4a')+_0x2b628e[_0x5b0f('0x2f')]+')','participationtypemask':_0x2b628e[_0x5b0f('0x4f')]===_0x5b0f('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5b0f('0x2a')+_0x2b628e[_0x5b0f('0x26')]+')','participationtypemask':_0x2b628e[_0x5b0f('0x4f')]===_0x5b0f('0x4e')?0x2:0x1}];_0x35e03b={'method':'POST','uri':_0x1a0743+_0x5b0f('0x50'),'body':Object['assign']({},{'subject':intUtil[_0x5b0f('0x47')](_0x59e76a['Subjects'],_0x5d6c4e,'\x20'),'phonenumber':String(_0x5d6c4e['calleridnum']),'description':intUtil['getString'](_0x59e76a[_0x5b0f('0x49')],_0x5d6c4e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2b628e[_0x5b0f('0x2f')]?_0x5b0f('0x4a')+_0x2b628e[_0x5b0f('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2b628e['userId']+')','directioncode':_0x2b628e['callDirection']===_0x5b0f('0x4e')?![]:!![],'phonecall_activity_parties':_0x5b6ed0},getCustomFields(_0x59e76a['Fields'],_0x5d6c4e,_0x59e76a['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x27ed2d,'OData-Version':_0x5b0f('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35e03b);})[_0x5b0f('0x16')](function(_0x2ee354){var _0x16a951=_0x2ee354[_0x5b0f('0x2b')]['odata-entityid'];var _0x1aae8f=_0x16a951['substring'](_0x16a951[_0x5b0f('0x2e')]('(')+0x1,_0x16a951['lastIndexOf'](')'));_0x2b628e[_0x5b0f('0x51')]=_0x1aae8f;_0x3baccd(_0x2b628e);})['catch'](function(_0x1debf8){_0x6a1b64(_0x1debf8['message']);});});}function emit(_0x4402d6,_0x4109ad,_0x517ce5,_0x161030){var _0x5e6282={'uri':util[_0x5b0f('0x52')](_0x5b0f('0x53'),_0x4402d6,_0x517ce5,_0x161030)};io['to'](util[_0x5b0f('0x52')]('user:%s',_0x4109ad))['emit'](_0x5b0f('0x54'),_0x5e6282);}exports['cs']=function(_0x3773b2,_0x2114be,_0x26f4f8,_0x5d375a,_0x5e5f25,_0xaac4b0,_0xc1f9b7,_0x3cc80b){var _0x575568={};_0xaac4b0[_0x5b0f('0xa')]=_0xaac4b0[_0x5b0f('0x9')]?intUtil[_0x5b0f('0x55')](_0xaac4b0[_0x5b0f('0xb')][_0x5b0f('0xc')]):intUtil[_0x5b0f('0x55')](_0xaac4b0[_0x5b0f('0xa')]);_0xaac4b0[_0x5b0f('0x56')]=intUtil[_0x5b0f('0x55')](_0xaac4b0[_0x5b0f('0x56')]);_0x575568['callDirection']=_0x3cc80b===_0x5b0f('0x4e')||_0x3cc80b===_0x5b0f('0x57')?_0x5b0f('0x4e'):_0x5b0f('0x27');var _0x1a2272=_0xaac4b0[_0x5b0f('0x9')]?util[_0x5b0f('0x52')](_0x5b0f('0x58'),_0xaac4b0[_0x5b0f('0xb')][_0x5b0f('0xc')]):util[_0x5b0f('0x52')]('%s/api/data/v9.0/',_0xaac4b0['remoteUri']);var _0x36fdd2=util['format'](_0x5b0f('0x59'),_0xaac4b0[_0x5b0f('0x5a')]);var _0x3c244f=util[_0x5b0f('0x52')](_0x5b0f('0x5b'),_0xaac4b0[_0x5b0f('0x56')],_0x2114be[_0x5b0f('0x5c')],md5(_0x2114be[_0x5b0f('0x5c')]));if(_0x5e5f25&&_0x5e5f25[_0x5b0f('0x5d')]){logger['info'](_0x5b0f('0x5e'),_0x5b0f('0x5f'));_0x2114be[_0x5b0f('0x60')]=_0x3c244f;}else if(_0xc1f9b7&&_0xc1f9b7[_0x5b0f('0x61')]&&_0xc1f9b7[_0x5b0f('0x61')]!=='none'){logger['info'](_0x5b0f('0x62'),_0x5b0f('0x5f'));_0x2114be[_0x5b0f('0x60')]=_0x3c244f;}else{_0x2114be['recordingURL']='';}return getUser(_0x575568,_0xaac4b0,_0x5d375a,_0x36fdd2,_0x1a2272,_0x3cc80b)[_0x5b0f('0x16')](function(_0x4ebc57){logger[_0x5b0f('0x21')]('['+_0x3cc80b[_0x5b0f('0x14')]()+_0x5b0f('0x63'),_0x4ebc57[_0x5b0f('0x26')]);logger[_0x5b0f('0x21')]('['+_0x3cc80b[_0x5b0f('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x4ebc57[_0x5b0f('0x24')]);return getEndUser(_0x4ebc57,_0xaac4b0,_0x36fdd2,_0x1a2272,_0x2114be,_0x3cc80b,_0x26f4f8[_0x5b0f('0x64')],_0x26f4f8['additionalSearchContact']);})[_0x5b0f('0x16')](function(_0x5157a2){logger[_0x5b0f('0x21')]('['+_0x3cc80b[_0x5b0f('0x14')]()+_0x5b0f('0x65'),_0x5157a2['enduserId']);logger[_0x5b0f('0x21')]('['+_0x3cc80b['toUpperCase']()+_0x5b0f('0x66'),_0x2114be[_0x5b0f('0x28')]);return getTicket(_0x5157a2,_0xaac4b0,_0x36fdd2,_0x1a2272,_0x2114be,_0x26f4f8,_0x3cc80b);})[_0x5b0f('0x16')](function(_0xc1c11d){logger['info'](util[_0x5b0f('0x52')]('['+_0x3cc80b['toUpperCase']()+_0x5b0f('0x67'),_0x26f4f8[_0x5b0f('0x4c')],_0xc1c11d['ticketId']));logger['info'](util[_0x5b0f('0x52')]('['+_0x3cc80b[_0x5b0f('0x14')]()+_0x5b0f('0x68'),_0x3cc80b));if(_0x3cc80b!==_0x5b0f('0x57')&&_0x26f4f8[_0x5b0f('0x69')]){logger[_0x5b0f('0x21')]('['+_0x3cc80b[_0x5b0f('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xaac4b0[_0x5b0f('0xa')],_0x5d375a[_0x5b0f('0x6a')],_0x26f4f8[_0x5b0f('0x4c')],_0xc1c11d[_0x5b0f('0x51')]);}})['catch'](function(_0xf5bae1){logger['error']('['+_0x3cc80b['toUpperCase']()+_0x5b0f('0x6b'),_0xf5bae1[_0x5b0f('0x15')]);console['error'](_0x5b0f('0x6c'),_0xf5bae1);});}; \ No newline at end of file +var _0x7bf3=['ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','md5','ioredis','dynamics365','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','Bearer\x20','4.0','value','validateEmail','email','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','calleridnum','POST','contacts','body','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=','&$filter=','replace','length','nothing',']\x20Enduser\x20created!','string','nameField','customField','idField','indexOf','content'];(function(_0x51cc43,_0x39ec57){var _0x52b127=function(_0x8b75bc){while(--_0x8b75bc){_0x51cc43['push'](_0x51cc43['shift']());}};_0x52b127(++_0x39ec57);}(_0x7bf3,0x153));var _0x37bf=function(_0x2bf77d,_0x5bab3a){_0x2bf77d=_0x2bf77d-0x0;var _0x1f1e23=_0x7bf3[_0x2bf77d];return _0x1f1e23;};'use strict';var _=require('lodash');var rp=require(_0x37bf('0x0'));var util=require('util');var intUtil=require('./util');var md5=require(_0x37bf('0x1'));var Redis=require(_0x37bf('0x2'));var logger=require('../../../../config/logger')(_0x37bf('0x3'));var config=require('../../../../config/environment');config[_0x37bf('0x4')]=_[_0x37bf('0x5')](config['redis'],{'host':_0x37bf('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x37bf('0x4')]));function getAuthToken(_0x492b8b,_0x278d33,_0xe5cc2b){if(_0x492b8b[_0x37bf('0x7')]){_0x492b8b[_0x37bf('0x8')]=_0x492b8b[_0x37bf('0x9')][_0x37bf('0xa')];_0x492b8b[_0x37bf('0xb')]=_0x492b8b[_0x37bf('0x9')][_0x37bf('0xc')];return Promise['resolve'](_0x492b8b[_0x37bf('0x9')]['data5']);}var _0x326fe5={'method':'POST','uri':_0x278d33,'form':{'client_id':_0x492b8b['clientId'],'resource':_0x492b8b[_0x37bf('0x8')],'username':_0x492b8b[_0x37bf('0xd')],'password':_0x492b8b['password'],'grant_type':_0x37bf('0xe'),'client_secret':_0x492b8b[_0x37bf('0xf')]},'json':!![]};return rp(_0x326fe5)[_0x37bf('0x10')](function(_0x4c8c04){return _0x4c8c04[_0x37bf('0x11')];})[_0x37bf('0x12')](function(_0x477fc6){logger[_0x37bf('0x13')]('['+[_0xe5cc2b[_0x37bf('0x14')]()]+']\x20Wrong\x20credentials!');return _0x477fc6[_0x37bf('0x15')];});}function getUser(_0x1b9f08,_0x5a2ae7,_0x7b4d7c,_0xf1dd2d,_0xc191da,_0x17d1a7){return new Promise(function(_0x5ce336,_0x3da92f){return getAuthToken(_0x5a2ae7,_0xf1dd2d,_0x17d1a7)[_0x37bf('0x10')](function(_0x2ee91e){var _0x39dba8={'method':'GET','uri':_0xc191da+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x37bf('0x16')+_0x2ee91e,'OData-Version':_0x37bf('0x17')},'json':!![]};return rp(_0x39dba8);})[_0x37bf('0x10')](function(_0x1779f1){var _0x2bd632=_0x1779f1[_0x37bf('0x18')];var _0x1c01b0=![];var _0x373eeb=null;if(!_['isNil'](_0x7b4d7c)){if(intUtil[_0x37bf('0x19')](_0x7b4d7c[_0x37bf('0x1a')])){_0x1b9f08['userEmail']=_0x7b4d7c[_0x37bf('0x1a')];for(_0x373eeb=0x0;_0x373eeb<_0x2bd632['length'];_0x373eeb++){if(_0x2bd632[_0x373eeb][_0x37bf('0x1b')]===_0x7b4d7c[_0x37bf('0x1a')]&&!_0x2bd632[_0x373eeb][_0x37bf('0x1c')]){_0x1c01b0=!![];logger[_0x37bf('0x1d')]('['+[_0x17d1a7[_0x37bf('0x14')]()]+']\x20Agent\x20found\x20'+_0x2bd632[_0x373eeb][_0x37bf('0x1e')]+'!');_0x1b9f08[_0x37bf('0x1f')]=_0x2bd632[_0x373eeb][_0x37bf('0x1e')];}}}}if(!_0x1c01b0){logger[_0x37bf('0x1d')]('['+[_0x17d1a7['toUpperCase']()]+_0x37bf('0x20'));_0x1b9f08[_0x37bf('0x21')]=_0x5a2ae7['username'];for(_0x373eeb=0x0;_0x373eeb<_0x2bd632['length'];_0x373eeb++){if(_0x2bd632[_0x373eeb][_0x37bf('0x1b')]===_0x5a2ae7[_0x37bf('0xd')]){_0x1b9f08['userId']=_0x2bd632[_0x373eeb][_0x37bf('0x1e')];}}}_0x5ce336(_0x1b9f08);})['catch'](function(_0x367e71){_0x3da92f(_0x367e71['message']);});});}function createEndUser(_0x481438,_0x463336,_0x3ac1cd,_0x2546b6,_0x143425,_0x3b7d26,_0x409100){return new Promise(function(_0x5b47e1,_0x1f9646){return getAuthToken(_0x463336,_0x3ac1cd,_0x3b7d26)[_0x37bf('0x10')](function(_0xc81fb4){var _0x57928f=_0x3b7d26[_0x37bf('0x22')]()===_0x37bf('0x23')?_0x143425['destcalleridnum']:_0x143425[_0x37bf('0x24')];var _0x388415={'method':_0x37bf('0x25'),'uri':_0x2546b6+_0x37bf('0x26'),'body':{'fullname':_0x57928f,'firstname':_0x57928f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x481438[_0x37bf('0x1f')]+')'},'headers':{'Authorization':_0x37bf('0x16')+_0xc81fb4,'OData-Version':_0x37bf('0x17')},'json':!![],'resolveWithFullResponse':!![]};_0x388415[_0x37bf('0x27')][_0x409100]=_0x57928f;return rp(_0x388415);})[_0x37bf('0x10')](function(_0x59fe22){var _0x435b50=_0x59fe22[_0x37bf('0x28')][_0x37bf('0x29')];var _0x431cfe=_0x435b50[_0x37bf('0x2a')](_0x435b50[_0x37bf('0x2b')]('(')+0x1,_0x435b50[_0x37bf('0x2b')](')'));_0x481438[_0x37bf('0x2c')]=_0x431cfe;_0x5b47e1(_0x481438);})['catch'](function(_0x4f3e45){_0x1f9646(_0x4f3e45[_0x37bf('0x15')]);});});}function getEndUser(_0x57219f,_0x846c1a,_0x35c011,_0x1192b4,_0x334614,_0x5340cf,_0xb86a82,_0x5276d8){var _0x4b2317=_0x5340cf[_0x37bf('0x22')]()===_0x37bf('0x23')?_0x334614['destcalleridnum']:_0x334614[_0x37bf('0x24')];return getAuthToken(_0x846c1a,_0x35c011,_0x5340cf)[_0x37bf('0x10')](function(_0x9e9f45){_0x5276d8=_0x5276d8?_0x5276d8:'telephone1';var _0x179db7={'method':'GET','uri':_0x1192b4+_0x37bf('0x2d')+_0x5276d8+_0x37bf('0x2e')+_0x5276d8+'\x20eq\x20\x27'+_0x4b2317[_0x37bf('0x2f')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x9e9f45,'If-None-Match':null,'OData-Version':_0x37bf('0x17')},'json':!![]};return rp(_0x179db7);})[_0x37bf('0x10')](function(_0xde2407){var _0x15a529=![];if(!_0xde2407)return _0x15a529;var _0x5316aa=_0xde2407[_0x37bf('0x18')];for(var _0x26ee82=0x0;_0x26ee82<_0x5316aa[_0x37bf('0x30')];_0x26ee82++){if(_0x5316aa[_0x26ee82][_0x5276d8]===_0x4b2317){_0x15a529=!![];_0x57219f['enduserId']=_0x5316aa[_0x26ee82]['contactid'];}}return _0x15a529;})[_0x37bf('0x10')](function(_0x1be3de){if(_0x1be3de)return _0x57219f;if(_0xb86a82===_0x37bf('0x31')){logger[_0x37bf('0x1d')]('['+[_0x5340cf[_0x37bf('0x14')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x57219f;}return createEndUser(_0x57219f,_0x846c1a,_0x35c011,_0x1192b4,_0x334614,_0x5340cf,_0x5276d8)[_0x37bf('0x10')](function(_0x19d669){logger['info']('['+[_0x5340cf[_0x37bf('0x14')]()]+_0x37bf('0x32'),_0x19d669['enduserId']);return _0x19d669;});});}function getCustomFields(_0x262bb9,_0x4d7dd5,_0x505494){var _0x4bbf65={};if(_0x262bb9[_0x37bf('0x30')]>0x0){_['forEach'](_0x262bb9,function(_0x254720){if(_['includes']([_0x37bf('0x33'),'picklist'],_0x254720['type'])&&_0x254720[_0x37bf('0x34')]&&!_0x254720[_0x37bf('0x35')]){var _0x2ccd8b=_0x254720[_0x37bf('0x36')]['toLowerCase']();var _0x4744e7=_0x2ccd8b['substring'](0x0,_0x2ccd8b[_0x37bf('0x37')]('_'));var _0x23cbc1=_0x2ccd8b[_0x37bf('0x2a')](_0x2ccd8b['indexOf']('_')+0x1);if(_0x4744e7===_0x505494){_0x4bbf65[_0x23cbc1]=_0x254720[_0x37bf('0x38')];}}});}return _0x4bbf65;}function getTicket(_0xbc4260,_0x1da5a9,_0xb853a2,_0x4016c7,_0x406715,_0x54e432,_0x52283d){return new Promise(function(_0x1dad73,_0x22ca56){var _0x1d0ad8;return getAuthToken(_0x1da5a9,_0xb853a2,_0x52283d)['then'](function(_0x4f15b5){if(_0x54e432[_0x37bf('0x39')]===_0x37bf('0x3a')){_0x1d0ad8={'method':'POST','uri':_0x4016c7+_0x37bf('0x3b'),'body':Object[_0x37bf('0x3c')]({},{'title':intUtil[_0x37bf('0x3d')](_0x54e432[_0x37bf('0x3e')],_0x406715,'\x20'),'description':intUtil[_0x37bf('0x3d')](_0x54e432[_0x37bf('0x3f')],_0x406715,'\x0a'),'customerid_contact@odata.bind':_0xbc4260[_0x37bf('0x2c')]?_0x37bf('0x40')+_0xbc4260[_0x37bf('0x2c')]+')':undefined,'ownerid@odata.bind':_0x37bf('0x41')+_0xbc4260[_0x37bf('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x54e432[_0x37bf('0x42')],_0x406715,_0x54e432[_0x37bf('0x39')])),'headers':{'Authorization':_0x37bf('0x16')+_0x4f15b5,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x54e432['ticketType']===_0x37bf('0x43')){var _0x138bfc=_0xbc4260[_0x37bf('0x2c')]?[{'partyid_systemuser@odata.bind':_0x37bf('0x41')+_0xbc4260[_0x37bf('0x1f')]+')','participationtypemask':_0xbc4260[_0x37bf('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x37bf('0x40')+_0xbc4260[_0x37bf('0x2c')]+')','participationtypemask':_0xbc4260[_0x37bf('0x44')]===_0x37bf('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xbc4260[_0x37bf('0x1f')]+')','participationtypemask':_0xbc4260[_0x37bf('0x44')]===_0x37bf('0x45')?0x2:0x1}];_0x1d0ad8={'method':_0x37bf('0x25'),'uri':_0x4016c7+_0x37bf('0x46'),'body':Object[_0x37bf('0x3c')]({},{'subject':intUtil[_0x37bf('0x3d')](_0x54e432['Subjects'],_0x406715,'\x20'),'phonenumber':String(_0x406715[_0x37bf('0x24')]),'description':intUtil[_0x37bf('0x3d')](_0x54e432[_0x37bf('0x3f')],_0x406715,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbc4260[_0x37bf('0x2c')]?'/contacts('+_0xbc4260[_0x37bf('0x2c')]+')':undefined,'ownerid@odata.bind':_0x37bf('0x41')+_0xbc4260[_0x37bf('0x1f')]+')','directioncode':_0xbc4260['callDirection']===_0x37bf('0x45')?![]:!![],'phonecall_activity_parties':_0x138bfc},getCustomFields(_0x54e432['Fields'],_0x406715,_0x54e432[_0x37bf('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0x4f15b5,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1d0ad8);})[_0x37bf('0x10')](function(_0x10570){var _0x78c88b=_0x10570['headers'][_0x37bf('0x29')];var _0x46ba90=_0x78c88b[_0x37bf('0x2a')](_0x78c88b['lastIndexOf']('(')+0x1,_0x78c88b['lastIndexOf'](')'));_0xbc4260['ticketId']=_0x46ba90;_0x1dad73(_0xbc4260);})['catch'](function(_0xec0639){_0x22ca56(_0xec0639[_0x37bf('0x15')]);});});}function emit(_0x482f70,_0x3ed503,_0x3d39c7,_0x79de5c){var _0x55f22c={'uri':util[_0x37bf('0x47')](_0x37bf('0x48'),_0x482f70,_0x3d39c7,_0x79de5c)};io['to'](util[_0x37bf('0x47')](_0x37bf('0x49'),_0x3ed503))[_0x37bf('0x4a')](_0x37bf('0x4b'),_0x55f22c);}exports['cs']=function(_0x2b4d7,_0x2c544a,_0x5aea6c,_0x128ddf,_0x2a4478,_0x39d8c,_0x321746,_0x258003){var _0x1b663b={};_0x39d8c[_0x37bf('0x8')]=_0x39d8c[_0x37bf('0x7')]?intUtil['stripTrailingSlash'](_0x39d8c['CloudProvider']['data7']):intUtil[_0x37bf('0x4c')](_0x39d8c[_0x37bf('0x8')]);_0x39d8c[_0x37bf('0x4d')]=intUtil[_0x37bf('0x4c')](_0x39d8c['serverUrl']);_0x1b663b[_0x37bf('0x44')]=_0x258003==='queue'||_0x258003===_0x37bf('0x4e')?_0x37bf('0x45'):_0x37bf('0x23');var _0x5c610e=_0x39d8c['modernAuthentication']?util[_0x37bf('0x47')](_0x37bf('0x4f'),_0x39d8c[_0x37bf('0x9')]['data7']):util[_0x37bf('0x47')](_0x37bf('0x4f'),_0x39d8c[_0x37bf('0x8')]);var _0x126c14=util[_0x37bf('0x47')](_0x37bf('0x50'),_0x39d8c[_0x37bf('0xb')]);var _0x1d0070=util[_0x37bf('0x47')](_0x37bf('0x51'),_0x39d8c[_0x37bf('0x4d')],_0x2c544a[_0x37bf('0x52')],md5(_0x2c544a[_0x37bf('0x52')]));if(_0x2a4478&&_0x2a4478['monitor_format']){logger[_0x37bf('0x1d')](_0x37bf('0x53'),_0x37bf('0x54'));_0x2c544a[_0x37bf('0x55')]=_0x1d0070;}else if(_0x321746&&_0x321746[_0x37bf('0x56')]&&_0x321746[_0x37bf('0x56')]!==_0x37bf('0x57')){logger['info'](_0x37bf('0x58'),'Recording\x20is\x20enabled!');_0x2c544a['recordingURL']=_0x1d0070;}else{_0x2c544a[_0x37bf('0x55')]='';}return getUser(_0x1b663b,_0x39d8c,_0x128ddf,_0x126c14,_0x5c610e,_0x258003)[_0x37bf('0x10')](function(_0x354bf1){logger[_0x37bf('0x1d')]('['+_0x258003[_0x37bf('0x14')]()+_0x37bf('0x59'),_0x354bf1[_0x37bf('0x1f')]);logger[_0x37bf('0x1d')]('['+_0x258003[_0x37bf('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x354bf1[_0x37bf('0x21')]);return getEndUser(_0x354bf1,_0x39d8c,_0x126c14,_0x5c610e,_0x2c544a,_0x258003,_0x5aea6c['moduleCreate'],_0x5aea6c[_0x37bf('0x5a')]);})[_0x37bf('0x10')](function(_0x4a8c63){logger[_0x37bf('0x1d')]('['+_0x258003['toUpperCase']()+_0x37bf('0x5b'),_0x4a8c63[_0x37bf('0x2c')]);logger['info']('['+_0x258003['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x2c544a['calleridnum']);return getTicket(_0x4a8c63,_0x39d8c,_0x126c14,_0x5c610e,_0x2c544a,_0x5aea6c,_0x258003);})['then'](function(_0x50f449){logger[_0x37bf('0x1d')](util[_0x37bf('0x47')]('['+_0x258003['toUpperCase']()+_0x37bf('0x5c'),_0x5aea6c[_0x37bf('0x39')],_0x50f449[_0x37bf('0x5d')]));logger[_0x37bf('0x1d')](util[_0x37bf('0x47')]('['+_0x258003['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x258003));if(_0x258003!==_0x37bf('0x4e')&&_0x5aea6c[_0x37bf('0x5e')]){logger[_0x37bf('0x1d')]('['+_0x258003[_0x37bf('0x14')]()+']',_0x37bf('0x5f'));emit(_0x39d8c[_0x37bf('0x8')],_0x128ddf[_0x37bf('0x60')],_0x5aea6c[_0x37bf('0x39')],_0x50f449[_0x37bf('0x5d')]);}})[_0x37bf('0x12')](function(_0x36e433){logger['error']('['+_0x258003[_0x37bf('0x14')]()+_0x37bf('0x61'),_0x36e433[_0x37bf('0x15')]);console[_0x37bf('0x13')](_0x37bf('0x62'),_0x36e433);});}; \ 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 3a7d1ac..0b2c820 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 _0x1d56=['forEach','picklist','type','nameField','customField','toLowerCase','content','includes','idField','variable','variableName','customVariable','Variable','push','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','ioredis','../../../../config/environment','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET'];(function(_0x1aaabb,_0x42e18c){var _0x545e35=function(_0x1b631b){while(--_0x1b631b){_0x1aaabb['push'](_0x1aaabb['shift']());}};_0x545e35(++_0x42e18c);}(_0x1d56,0x1f3));var _0x61d5=function(_0x502b67,_0x5d48b2){_0x502b67=_0x502b67-0x0;var _0x13fd03=_0x1d56[_0x502b67];return _0x13fd03;};'use strict';var _=require(_0x61d5('0x0'));var rp=require('request-promise');var md5=require(_0x61d5('0x1'));var util=require('util');var Redis=require(_0x61d5('0x2'));var intUtil=require('./util');var config=require(_0x61d5('0x3'));var logger=require('../../../../config/logger')(_0x61d5('0x4'));config['redis']=_[_0x61d5('0x5')](config[_0x61d5('0x6')],{'host':_0x61d5('0x7'),'port':0x18eb});var io=require(_0x61d5('0x8'))(new Redis(config[_0x61d5('0x6')]));var headers={'Content-Type':_0x61d5('0x9'),'Accept':_0x61d5('0x9')};function emit(_0x174b57,_0x18418f,_0x51cad5){io['to'](_0x174b57)['emit'](_0x18418f,_0x51cad5);}function getTicket(_0x3bb2a3,_0x41f433,_0xaff770,_0x53d093,_0x58237b){logger['info'](_0x61d5('0xa'));var _0x41469d=_[_0x61d5('0xb')]({'responder_id':_0x41f433['id'],'requester_id':_0xaff770['id'],'name':util[_0x61d5('0xc')](_0x61d5('0xd'),_0x58237b['calleridname']),'phone':_0x58237b[_0x61d5('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x61d5('0xf')](_0x53d093[_0x61d5('0x10')],_0x58237b,'\x20'),'description':intUtil['getString'](_0x53d093[_0x61d5('0x11')],_0x58237b,'
'),'tags':getTags(_0x53d093[_0x61d5('0x12')],_0x61d5('0x13'))},getCustomFields(_0x53d093[_0x61d5('0x14')],_0x58237b));_0x41469d[_0x61d5('0x15')]=_[_0x61d5('0x16')](_[_0x61d5('0x17')](_0x41469d['custom_fields'],'id'),_0x61d5('0x18'));return request({'uri':util['format']('%s/api/v2/tickets',_0x3bb2a3[_0x61d5('0x19')]),'method':_0x61d5('0x1a'),'body':_0x41469d})[_0x61d5('0x1b')](function(_0x2b35f8){logger[_0x61d5('0x1c')](_0x61d5('0x1d'));return _0x2b35f8;});}function getUser(_0x2d4d39,_0x58148c){if(intUtil[_0x61d5('0x1e')](_0x58148c)){return request({'uri':util['format'](_0x61d5('0x1f'),_0x2d4d39['remoteUri']),'qs':{'email':_0x58148c}})['then'](function(_0x19bb90){if(_0x19bb90[_0x61d5('0x20')]){logger['info'](_0x61d5('0x21'));return _[_0x61d5('0x22')](_0x19bb90,function(_0x49d1c4){return _0x49d1c4[_0x61d5('0x23')][_0x61d5('0x24')]===_0x58148c;});}else{logger[_0x61d5('0x1c')](_0x61d5('0x25'));return request({'uri':util[_0x61d5('0xc')](_0x61d5('0x26'),_0x2d4d39['remoteUri'])})[_0x61d5('0x1b')](function(_0x1fe148){logger[_0x61d5('0x1c')](_0x61d5('0x27'));return _0x1fe148;});}});}else{logger[_0x61d5('0x1c')](_0x61d5('0x28'));return request({'uri':util[_0x61d5('0xc')](_0x61d5('0x26'),_0x2d4d39[_0x61d5('0x19')])})['then'](function(_0xf24d22){logger[_0x61d5('0x1c')](_0x61d5('0x27'));return _0xf24d22;});}}function getEndUser(_0x579eb2,_0x3245c3,_0x2de471){logger[_0x61d5('0x1c')](_0x61d5('0x29'),_0x2de471);return request({'uri':util[_0x61d5('0xc')](_0x61d5('0x2a'),_0x579eb2[_0x61d5('0x19')]),'qs':{'phone':_0x2de471}})[_0x61d5('0x1b')](function(_0x1b01c2){if(_0x1b01c2[_0x61d5('0x20')]){logger[_0x61d5('0x1c')](_0x61d5('0x2b'));return _['find'](_0x1b01c2,{'phone':_0x2de471});}else{logger[_0x61d5('0x1c')](_0x61d5('0x2c'));return request({'uri':util[_0x61d5('0xc')](_0x61d5('0x2a'),_0x579eb2[_0x61d5('0x19')]),'method':'POST','body':{'name':_0x3245c3,'phone':_0x2de471}})[_0x61d5('0x1b')](function(_0x495fbf){logger[_0x61d5('0x1c')](_0x61d5('0x2d'));return _0x495fbf;});}});}function getAuth(_0x4d7248){return util[_0x61d5('0xc')](_0x61d5('0x2e'),new Buffer(_0x4d7248[_0x61d5('0x2f')]+':X')[_0x61d5('0x30')]('base64'));}function request(_0xbb8d4b){logger[_0x61d5('0x31')](_0x61d5('0x32'),JSON[_0x61d5('0x33')](_0xbb8d4b));return rp(_['defaults'](_0xbb8d4b,{'method':_0x61d5('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x11b89a,_0x349568){var _0x225662=[];if(_0x11b89a&&_0x11b89a['length']>0x0){_0x225662=_['map'](_0x11b89a,_0x349568);}return _0x225662;}function getCustomFields(_0x2cb02b,_0x24090b){var _0xe745e2=[];var _0x5c732d={'custom_fields':[]};if(_0x2cb02b['length']>0x0){_[_0x61d5('0x35')](_0x2cb02b,function(_0x2cd4e1){if(_['includes'](['string',_0x61d5('0x36')],_0x2cd4e1[_0x61d5('0x37')])&&_0x2cd4e1[_0x61d5('0x38')]&&!_0x2cd4e1[_0x61d5('0x39')]){_0x5c732d[_0x2cd4e1[_0x61d5('0x38')][_0x61d5('0x3a')]()]=_0x2cd4e1[_0x61d5('0x3b')][_0x61d5('0x30')]();}else if(_[_0x61d5('0x3c')](['string','picklist'],_0x2cd4e1['type'])&&_0x2cd4e1[_0x61d5('0x3d')]&&_0x2cd4e1[_0x61d5('0x39')]){_0x5c732d['custom_fields']['push']({'id':_0x2cd4e1[_0x61d5('0x3d')],'value':_0x2cd4e1[_0x61d5('0x3b')][_0x61d5('0x30')]()});}else if(_0x2cd4e1[_0x61d5('0x37')]===_0x61d5('0x3e')&&_0x2cd4e1['variableName']&&_0x2cd4e1[_0x61d5('0x3d')]&&_0x2cd4e1[_0x61d5('0x39')]){_0x24090b[_0x2cd4e1['variableName']]&&_0x5c732d[_0x61d5('0x15')]['push']({'id':_0x2cd4e1[_0x61d5('0x3d')],'value':_0x24090b[_0x2cd4e1[_0x61d5('0x3f')]]['toString']()});}else if(_0x2cd4e1[_0x61d5('0x37')]===_0x61d5('0x40')&&_0x2cd4e1[_0x61d5('0x41')]&&_0x2cd4e1[_0x61d5('0x41')]['name']&&_0x2cd4e1[_0x61d5('0x3d')]&&_0x2cd4e1[_0x61d5('0x39')]){_0x24090b[_0x2cd4e1['Variable']['name'][_0x61d5('0x3a')]()]&&_0x5c732d[_0x61d5('0x15')][_0x61d5('0x42')]({'id':_0x2cd4e1['idField'],'value':_0x24090b[_0x2cd4e1[_0x61d5('0x41')][_0x61d5('0x13')][_0x61d5('0x3a')]()]['toString']()});}});}return _0x5c732d;}exports['queue']=function(_0x21456d,_0x1c1b08,_0x371388,_0x293c6c,_0x1bfe28,_0x105c2c){var _0x36d98a,_0x54fdb7;_0x105c2c[_0x61d5('0x19')]=intUtil['stripTrailingSlash'](_0x105c2c['remoteUri']);_0x105c2c[_0x61d5('0x43')]=intUtil[_0x61d5('0x44')](_0x105c2c['serverUrl']);if(_0x1bfe28&&_0x1bfe28[_0x61d5('0x45')]){logger[_0x61d5('0x1c')]('[QUEUE]',_0x61d5('0x46'));_0x1c1b08[_0x61d5('0x47')]=util[_0x61d5('0xc')](_0x61d5('0x48'),_0x105c2c[_0x61d5('0x43')],_0x1c1b08['uniqueid'],md5(_0x1c1b08[_0x61d5('0x49')]));}else{_0x1c1b08['recordingURL']='';}headers[_0x61d5('0x4a')]=getAuth(_0x105c2c);return getUser(_0x105c2c,_0x293c6c['email'])[_0x61d5('0x1b')](function(_0x52cf8f){_0x36d98a=_0x52cf8f;logger['info'](_0x61d5('0x4b'),_0x36d98a['id']);return getEndUser(_0x105c2c,_0x1c1b08['calleridname'],_0x1c1b08['calleridnum']);})[_0x61d5('0x1b')](function(_0x19715b){_0x54fdb7=_0x19715b;logger[_0x61d5('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x54fdb7['id']);return getTicket(_0x105c2c,_0x36d98a,_0x54fdb7,_0x371388,_0x1c1b08);})[_0x61d5('0x1b')](function(_0x247d07){if(_0x247d07&&_0x247d07['id']){logger[_0x61d5('0x1c')](_0x61d5('0x1d'));logger[_0x61d5('0x1c')](_0x61d5('0x4c'),_0x247d07['id']);logger['info'](_0x61d5('0x4d'),_0x61d5('0x4e'));emit(util[_0x61d5('0xc')](_0x61d5('0x4f'),_0x293c6c[_0x61d5('0x13')]),_0x61d5('0x50'),{'uri':util[_0x61d5('0xc')](_0x61d5('0x51'),_0x105c2c[_0x61d5('0x19')],_0x247d07['id'])});}})[_0x61d5('0x52')](function(_0x358e1b){logger[_0x61d5('0x53')]('[QUEUE]',JSON[_0x61d5('0x33')](_0x358e1b));});};exports['outbound']=function(_0x494e69,_0x24f5e6,_0x32d1f,_0x59f9c8,_0x2cae47,_0x1a4f1a,_0x340703){var _0x595942,_0x20b43e;_0x1a4f1a[_0x61d5('0x19')]=intUtil[_0x61d5('0x44')](_0x1a4f1a[_0x61d5('0x19')]);_0x1a4f1a[_0x61d5('0x43')]=intUtil[_0x61d5('0x44')](_0x1a4f1a[_0x61d5('0x43')]);if(_0x340703&&_0x340703[_0x61d5('0x54')]&&_0x340703[_0x61d5('0x54')]!==_0x61d5('0x55')){logger[_0x61d5('0x1c')]('[OUTBOUND]',_0x61d5('0x46'));_0x24f5e6[_0x61d5('0x47')]=util['format'](_0x61d5('0x48'),_0x1a4f1a['serverUrl'],_0x24f5e6['uniqueid'],md5(_0x24f5e6['uniqueid']));}headers['Authorization']=getAuth(_0x1a4f1a);return getUser(_0x1a4f1a,_0x59f9c8['email'])[_0x61d5('0x1b')](function(_0xe2bd03){_0x595942=_0xe2bd03;logger['info']('The\x20User\x20ID\x20is:',_0x595942['id']);return getEndUser(_0x1a4f1a,_0x24f5e6['destcalleridname'],_0x24f5e6[_0x61d5('0x56')]);})[_0x61d5('0x1b')](function(_0x58ef13){_0x20b43e=_0x58ef13;logger[_0x61d5('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x20b43e['id']);return getTicket(_0x1a4f1a,_0x595942,_0x20b43e,_0x32d1f,_0x24f5e6);})[_0x61d5('0x1b')](function(_0x5bc4c6){if(_0x5bc4c6&&_0x5bc4c6['id']){logger['info'](_0x61d5('0x1d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5bc4c6['id']);logger[_0x61d5('0x1c')](_0x61d5('0x57'),_0x61d5('0x4e'));emit(util[_0x61d5('0xc')](_0x61d5('0x4f'),_0x59f9c8[_0x61d5('0x13')]),_0x61d5('0x50'),{'uri':util[_0x61d5('0xc')](_0x61d5('0x51'),_0x1a4f1a[_0x61d5('0x19')],_0x5bc4c6['id'])});}})[_0x61d5('0x52')](function(_0x424e2){logger[_0x61d5('0x53')](_0x61d5('0x57'),JSON[_0x61d5('0x33')](_0x424e2));});};exports[_0x61d5('0x58')]=function(_0x13c74d,_0x26bb3d,_0x399a41,_0x22e5cf,_0x594c77,_0x5d03f6){var _0x446e9e,_0x391462;_0x5d03f6[_0x61d5('0x19')]=intUtil['stripTrailingSlash'](_0x5d03f6[_0x61d5('0x19')]);_0x5d03f6[_0x61d5('0x43')]=intUtil[_0x61d5('0x44')](_0x5d03f6[_0x61d5('0x43')]);if(_0x594c77&&_0x594c77['monitor_format']){logger[_0x61d5('0x1c')]('['+_0x26bb3d[_0x61d5('0x59')][_0x61d5('0x5a')]()+']',_0x61d5('0x46'));_0x26bb3d[_0x61d5('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d03f6[_0x61d5('0x43')],_0x26bb3d[_0x61d5('0x49')],md5(_0x26bb3d[_0x61d5('0x49')]));}else{_0x26bb3d[_0x61d5('0x47')]='';}headers[_0x61d5('0x4a')]=getAuth(_0x5d03f6);return getUser(_0x5d03f6,'')[_0x61d5('0x1b')](function(_0x1b670a){_0x446e9e=_0x1b670a;logger[_0x61d5('0x1c')](_0x61d5('0x4b'),_0x446e9e['id']);return getEndUser(_0x5d03f6,_0x26bb3d[_0x61d5('0x5b')],_0x26bb3d[_0x61d5('0xe')]);})[_0x61d5('0x1b')](function(_0x47f045){_0x391462=_0x47f045;logger[_0x61d5('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x391462['id']);return getTicket(_0x5d03f6,_0x446e9e,_0x391462,_0x399a41,_0x26bb3d);})[_0x61d5('0x1b')](function(_0x439f1a){if(_0x439f1a){logger[_0x61d5('0x1c')](_0x61d5('0x1d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x439f1a['id']);}})['catch'](function(_0x4c05e7){logger[_0x61d5('0x53')]('['+_0x26bb3d['lastevent'][_0x61d5('0x5a')]()+']',JSON[_0x61d5('0x33')](_0x4c05e7));});}; \ No newline at end of file +var _0xd71d=['remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','idField','push','content','toString','type','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','lodash','request-promise','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','keyBy','value','format','then','%s/api/v2/agents'];(function(_0x39b3f9,_0x39e2cd){var _0x356039=function(_0x1d7746){while(--_0x1d7746){_0x39b3f9['push'](_0x39b3f9['shift']());}};_0x356039(++_0x39e2cd);}(_0xd71d,0x9f));var _0xdd71=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xd71d[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0xdd71('0x0'));var rp=require(_0xdd71('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xdd71('0x2'));var intUtil=require('./util');var config=require(_0xdd71('0x3'));var logger=require(_0xdd71('0x4'))(_0xdd71('0x5'));config[_0xdd71('0x6')]=_[_0xdd71('0x7')](config['redis'],{'host':_0xdd71('0x8'),'port':0x18eb});var io=require(_0xdd71('0x9'))(new Redis(config[_0xdd71('0x6')]));var headers={'Content-Type':_0xdd71('0xa'),'Accept':_0xdd71('0xa')};function emit(_0x4e444b,_0x4d6136,_0x59fc31){io['to'](_0x4e444b)[_0xdd71('0xb')](_0x4d6136,_0x59fc31);}function getTicket(_0x5d5635,_0x1de71a,_0x31d284,_0x368484,_0x5f2ec2){logger[_0xdd71('0xc')](_0xdd71('0xd'));var _0xada70=_['merge']({'responder_id':_0x1de71a['id'],'requester_id':_0x31d284['id'],'name':util['format'](_0xdd71('0xe'),_0x5f2ec2[_0xdd71('0xf')]),'phone':_0x5f2ec2[_0xdd71('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdd71('0x11')](_0x368484[_0xdd71('0x12')],_0x5f2ec2,'\x20'),'description':intUtil[_0xdd71('0x11')](_0x368484[_0xdd71('0x13')],_0x5f2ec2,'
'),'tags':getTags(_0x368484[_0xdd71('0x14')],_0xdd71('0x15'))},getCustomFields(_0x368484[_0xdd71('0x16')],_0x5f2ec2));_0xada70[_0xdd71('0x17')]=_['mapValues'](_[_0xdd71('0x18')](_0xada70[_0xdd71('0x17')],'id'),_0xdd71('0x19'));return request({'uri':util[_0xdd71('0x1a')]('%s/api/v2/tickets',_0x5d5635['remoteUri']),'method':'POST','body':_0xada70})[_0xdd71('0x1b')](function(_0x53517b){logger['info']('Ticket\x20created!');return _0x53517b;});}function getUser(_0x43797c,_0x26f657){if(intUtil['validateEmail'](_0x26f657)){return request({'uri':util[_0xdd71('0x1a')](_0xdd71('0x1c'),_0x43797c[_0xdd71('0x1d')]),'qs':{'email':_0x26f657}})[_0xdd71('0x1b')](function(_0x216d48){if(_0x216d48[_0xdd71('0x1e')]){logger[_0xdd71('0xc')](_0xdd71('0x1f'));return _[_0xdd71('0x20')](_0x216d48,function(_0x30b8a1){return _0x30b8a1[_0xdd71('0x21')][_0xdd71('0x22')]===_0x26f657;});}else{logger[_0xdd71('0xc')](_0xdd71('0x23'));return request({'uri':util[_0xdd71('0x1a')]('%s/api/v2/agents/me',_0x43797c[_0xdd71('0x1d')])})['then'](function(_0x3b0b0a){logger[_0xdd71('0xc')]('Admin\x20account\x20selected.');return _0x3b0b0a;});}});}else{logger['info'](_0xdd71('0x24'));return request({'uri':util[_0xdd71('0x1a')](_0xdd71('0x25'),_0x43797c[_0xdd71('0x1d')])})[_0xdd71('0x1b')](function(_0x22d9d0){logger[_0xdd71('0xc')](_0xdd71('0x26'));return _0x22d9d0;});}}function getEndUser(_0x566011,_0x5ca746,_0x23691b){logger[_0xdd71('0xc')](_0xdd71('0x27'),_0x23691b);return request({'uri':util[_0xdd71('0x1a')]('%s/api/v2/contacts',_0x566011[_0xdd71('0x1d')]),'qs':{'phone':_0x23691b}})['then'](function(_0x44267d){if(_0x44267d[_0xdd71('0x1e')]){logger['info'](_0xdd71('0x28'));return _[_0xdd71('0x20')](_0x44267d,{'phone':_0x23691b});}else{logger[_0xdd71('0xc')](_0xdd71('0x29'));return request({'uri':util[_0xdd71('0x1a')](_0xdd71('0x2a'),_0x566011[_0xdd71('0x1d')]),'method':_0xdd71('0x2b'),'body':{'name':_0x5ca746,'phone':_0x23691b}})[_0xdd71('0x1b')](function(_0x46f41d){logger[_0xdd71('0xc')](_0xdd71('0x2c'));return _0x46f41d;});}});}function getAuth(_0x1a7ad5){return util['format'](_0xdd71('0x2d'),new Buffer(_0x1a7ad5[_0xdd71('0x2e')]+':X')['toString'](_0xdd71('0x2f')));}function request(_0xbccdc6){logger['debug']('[HTTP]',JSON[_0xdd71('0x30')](_0xbccdc6));return rp(_[_0xdd71('0x7')](_0xbccdc6,{'method':_0xdd71('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2b1e6f,_0x51de5a){var _0x5286a2=[];if(_0x2b1e6f&&_0x2b1e6f[_0xdd71('0x1e')]>0x0){_0x5286a2=_[_0xdd71('0x32')](_0x2b1e6f,_0x51de5a);}return _0x5286a2;}function getCustomFields(_0x430665,_0x5a5c1d){var _0x499e14=[];var _0x346f90={'custom_fields':[]};if(_0x430665[_0xdd71('0x1e')]>0x0){_[_0xdd71('0x33')](_0x430665,function(_0x1ef8fb){if(_[_0xdd71('0x34')]([_0xdd71('0x35'),_0xdd71('0x36')],_0x1ef8fb['type'])&&_0x1ef8fb[_0xdd71('0x37')]&&!_0x1ef8fb[_0xdd71('0x38')]){_0x346f90[_0x1ef8fb[_0xdd71('0x37')]['toLowerCase']()]=_0x1ef8fb['content']['toString']();}else if(_[_0xdd71('0x34')]([_0xdd71('0x35'),_0xdd71('0x36')],_0x1ef8fb['type'])&&_0x1ef8fb[_0xdd71('0x39')]&&_0x1ef8fb[_0xdd71('0x38')]){_0x346f90['custom_fields'][_0xdd71('0x3a')]({'id':_0x1ef8fb['idField'],'value':_0x1ef8fb[_0xdd71('0x3b')][_0xdd71('0x3c')]()});}else if(_0x1ef8fb[_0xdd71('0x3d')]===_0xdd71('0x3e')&&_0x1ef8fb[_0xdd71('0x3f')]&&_0x1ef8fb[_0xdd71('0x39')]&&_0x1ef8fb['customField']){_0x5a5c1d[_0x1ef8fb[_0xdd71('0x3f')]]&&_0x346f90[_0xdd71('0x17')]['push']({'id':_0x1ef8fb[_0xdd71('0x39')],'value':_0x5a5c1d[_0x1ef8fb[_0xdd71('0x3f')]][_0xdd71('0x3c')]()});}else if(_0x1ef8fb[_0xdd71('0x3d')]===_0xdd71('0x40')&&_0x1ef8fb[_0xdd71('0x41')]&&_0x1ef8fb[_0xdd71('0x41')][_0xdd71('0x15')]&&_0x1ef8fb[_0xdd71('0x39')]&&_0x1ef8fb[_0xdd71('0x38')]){_0x5a5c1d[_0x1ef8fb[_0xdd71('0x41')]['name'][_0xdd71('0x42')]()]&&_0x346f90[_0xdd71('0x17')][_0xdd71('0x3a')]({'id':_0x1ef8fb[_0xdd71('0x39')],'value':_0x5a5c1d[_0x1ef8fb['Variable']['name'][_0xdd71('0x42')]()][_0xdd71('0x3c')]()});}});}return _0x346f90;}exports[_0xdd71('0x43')]=function(_0x5c5427,_0x2c0de2,_0x2298f9,_0x27d398,_0x1ce81d,_0xd4948c){var _0x231569,_0x211895;_0xd4948c['remoteUri']=intUtil['stripTrailingSlash'](_0xd4948c[_0xdd71('0x1d')]);_0xd4948c[_0xdd71('0x44')]=intUtil[_0xdd71('0x45')](_0xd4948c[_0xdd71('0x44')]);if(_0x1ce81d&&_0x1ce81d[_0xdd71('0x46')]){logger[_0xdd71('0xc')](_0xdd71('0x47'),'Recording\x20is\x20enabled!');_0x2c0de2['recordingURL']=util[_0xdd71('0x1a')](_0xdd71('0x48'),_0xd4948c[_0xdd71('0x44')],_0x2c0de2['uniqueid'],md5(_0x2c0de2[_0xdd71('0x49')]));}else{_0x2c0de2[_0xdd71('0x4a')]='';}headers[_0xdd71('0x4b')]=getAuth(_0xd4948c);return getUser(_0xd4948c,_0x27d398[_0xdd71('0x22')])['then'](function(_0x11a0e0){_0x231569=_0x11a0e0;logger['info'](_0xdd71('0x4c'),_0x231569['id']);return getEndUser(_0xd4948c,_0x2c0de2[_0xdd71('0xf')],_0x2c0de2[_0xdd71('0x10')]);})[_0xdd71('0x1b')](function(_0x15031c){_0x211895=_0x15031c;logger[_0xdd71('0xc')]('The\x20Enduser\x20ID\x20is:',_0x211895['id']);return getTicket(_0xd4948c,_0x231569,_0x211895,_0x2298f9,_0x2c0de2);})[_0xdd71('0x1b')](function(_0x4cb1da){if(_0x4cb1da&&_0x4cb1da['id']){logger[_0xdd71('0xc')](_0xdd71('0x4d'));logger[_0xdd71('0xc')](_0xdd71('0x4e'),_0x4cb1da['id']);logger[_0xdd71('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xdd71('0x4f'),_0x27d398[_0xdd71('0x15')]),_0xdd71('0x50'),{'uri':util[_0xdd71('0x1a')](_0xdd71('0x51'),_0xd4948c[_0xdd71('0x1d')],_0x4cb1da['id'])});}})[_0xdd71('0x52')](function(_0x5619f8){logger[_0xdd71('0x53')](_0xdd71('0x47'),JSON['stringify'](_0x5619f8));});};exports[_0xdd71('0x54')]=function(_0x231440,_0x48c5dd,_0x271246,_0xf12d9a,_0x535913,_0x15e19a,_0x242ad9){var _0x49622a,_0x1b44c8;_0x15e19a[_0xdd71('0x1d')]=intUtil[_0xdd71('0x45')](_0x15e19a['remoteUri']);_0x15e19a[_0xdd71('0x44')]=intUtil['stripTrailingSlash'](_0x15e19a['serverUrl']);if(_0x242ad9&&_0x242ad9[_0xdd71('0x55')]&&_0x242ad9[_0xdd71('0x55')]!==_0xdd71('0x56')){logger[_0xdd71('0xc')](_0xdd71('0x57'),_0xdd71('0x58'));_0x48c5dd['recordingURL']=util[_0xdd71('0x1a')](_0xdd71('0x48'),_0x15e19a[_0xdd71('0x44')],_0x48c5dd[_0xdd71('0x49')],md5(_0x48c5dd[_0xdd71('0x49')]));}headers['Authorization']=getAuth(_0x15e19a);return getUser(_0x15e19a,_0xf12d9a['email'])['then'](function(_0x3ab4f5){_0x49622a=_0x3ab4f5;logger[_0xdd71('0xc')](_0xdd71('0x4c'),_0x49622a['id']);return getEndUser(_0x15e19a,_0x48c5dd[_0xdd71('0x59')],_0x48c5dd['destcalleridnum']);})[_0xdd71('0x1b')](function(_0x4bb1f0){_0x1b44c8=_0x4bb1f0;logger['info'](_0xdd71('0x5a'),_0x1b44c8['id']);return getTicket(_0x15e19a,_0x49622a,_0x1b44c8,_0x271246,_0x48c5dd);})[_0xdd71('0x1b')](function(_0x42f603){if(_0x42f603&&_0x42f603['id']){logger[_0xdd71('0xc')](_0xdd71('0x4d'));logger[_0xdd71('0xc')](_0xdd71('0x4e'),_0x42f603['id']);logger['info'](_0xdd71('0x57'),_0xdd71('0x5b'));emit(util[_0xdd71('0x1a')](_0xdd71('0x4f'),_0xf12d9a[_0xdd71('0x15')]),_0xdd71('0x50'),{'uri':util[_0xdd71('0x1a')]('%s/helpdesk/tickets/%d',_0x15e19a['remoteUri'],_0x42f603['id'])});}})[_0xdd71('0x52')](function(_0x44c102){logger[_0xdd71('0x53')](_0xdd71('0x57'),JSON[_0xdd71('0x30')](_0x44c102));});};exports[_0xdd71('0x5c')]=function(_0x1863aa,_0x2419b5,_0x463854,_0x59f994,_0x5cf5ea,_0x8f45f3){var _0x3ebe73,_0x2bc9f2;_0x8f45f3[_0xdd71('0x1d')]=intUtil['stripTrailingSlash'](_0x8f45f3[_0xdd71('0x1d')]);_0x8f45f3[_0xdd71('0x44')]=intUtil[_0xdd71('0x45')](_0x8f45f3[_0xdd71('0x44')]);if(_0x5cf5ea&&_0x5cf5ea['monitor_format']){logger[_0xdd71('0xc')]('['+_0x2419b5[_0xdd71('0x5d')]['toUpperCase']()+']',_0xdd71('0x58'));_0x2419b5[_0xdd71('0x4a')]=util[_0xdd71('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8f45f3[_0xdd71('0x44')],_0x2419b5[_0xdd71('0x49')],md5(_0x2419b5['uniqueid']));}else{_0x2419b5[_0xdd71('0x4a')]='';}headers[_0xdd71('0x4b')]=getAuth(_0x8f45f3);return getUser(_0x8f45f3,'')[_0xdd71('0x1b')](function(_0x308a1f){_0x3ebe73=_0x308a1f;logger[_0xdd71('0xc')](_0xdd71('0x4c'),_0x3ebe73['id']);return getEndUser(_0x8f45f3,_0x2419b5[_0xdd71('0xf')],_0x2419b5[_0xdd71('0x10')]);})[_0xdd71('0x1b')](function(_0x22f321){_0x2bc9f2=_0x22f321;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2bc9f2['id']);return getTicket(_0x8f45f3,_0x3ebe73,_0x2bc9f2,_0x463854,_0x2419b5);})['then'](function(_0x40542c){if(_0x40542c){logger[_0xdd71('0xc')]('Ticket\x20created!');logger[_0xdd71('0xc')](_0xdd71('0x4e'),_0x40542c['id']);}})[_0xdd71('0x52')](function(_0x381716){logger[_0xdd71('0x53')]('['+_0x2419b5['lastevent']['toUpperCase']()+']',JSON[_0xdd71('0x30')](_0x381716));});}; \ 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 834212f..ba77204 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 _0xeb22=['Admin\x20selected','adminEmail','/api/lookup?q=','&f=','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','Subjects','Contact','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId'];(function(_0x3de7eb,_0x1232d6){var _0x3c183f=function(_0x5d7ed0){while(--_0x5d7ed0){_0x3de7eb['push'](_0x3de7eb['shift']());}};_0x3c183f(++_0x1232d6);}(_0xeb22,0x114));var _0x2eb2=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0xeb22[_0x49588f];return _0x41b293;};'use strict';var _=require(_0x2eb2('0x0'));var rp=require(_0x2eb2('0x1'));var md5=require('md5');var util=require(_0x2eb2('0x2'));var moment=require('moment');var Promise=require(_0x2eb2('0x3'));var Redis=require('ioredis');var intUtil=require(_0x2eb2('0x4'));var config=require(_0x2eb2('0x5'));var logger=require(_0x2eb2('0x6'))('freshsales');config[_0x2eb2('0x7')]=_[_0x2eb2('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2eb2('0x7')]));function getAdminId(_0x49ab84,_0x50192f,_0x2d4acd,_0x5d9b91){return new Promise(function(_0x17a224,_0x5ab7ef){var _0x3c8df5=![];var _0x5e94ca={'method':_0x2eb2('0x9'),'uri':_0x5d9b91+_0x2eb2('0xa'),'json':!![]};_0x5e94ca['headers']=_0x2d4acd;logger[_0x2eb2('0xb')](_0x2eb2('0xc'));return rp(_0x5e94ca)[_0x2eb2('0xd')](function(_0x17fec6){if(_0x17fec6){var _0x20c249=_0x17fec6[_0x2eb2('0xe')];var _0x17da4f=null;for(_0x17da4f=0x0;_0x17da4f<_0x20c249['length'];_0x17da4f++){if(_0x20c249[_0x17da4f][_0x2eb2('0xf')]===_0x49ab84['adminEmail']){_0x49ab84['adminId']=_0x20c249[_0x17da4f]['id'];_0x3c8df5=!![];}}if(_0x3c8df5){logger[_0x2eb2('0xb')]('Admin\x20found:',_0x49ab84[_0x2eb2('0x10')]);_0x17a224(_0x49ab84);}else{_0x5ab7ef({'statusCode':0x194,'message':_0x2eb2('0x11')});}}else{_0x5ab7ef({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x2eb2('0x12')](function(_0x11bcb7){logger[_0x2eb2('0x13')]('['+[_0x50192f[_0x2eb2('0x14')]()]+']',_0x11bcb7[_0x2eb2('0x15')]);_0x5ab7ef(_0x11bcb7);});});}function getUser(_0x244dd2,_0x4e99b1,_0x275a20){return function(_0xe0c788){return new Promise(function(_0xcd13cc,_0xe2dfd1){var _0x205ecd={'method':_0x2eb2('0x9'),'uri':_0x275a20+'/api/selector/owners','json':!![]};_0x205ecd['headers']=_0x4e99b1;logger[_0x2eb2('0xb')](_0x2eb2('0x16'));return rp(_0x205ecd)[_0x2eb2('0xd')](function(_0x1d7776){if(_0x1d7776){var _0x2ddf6a=_0x1d7776[_0x2eb2('0xe')];var _0x4393de=![];var _0x10fbf7=null;if(_0xe0c788['agentEmail']!==null){logger[_0x2eb2('0xb')](_0x2eb2('0x17'),_0xe0c788[_0x2eb2('0x18')]);_0xe0c788[_0x2eb2('0x19')]=_0xe0c788['agentEmail'];for(_0x10fbf7=0x0;_0x10fbf7<_0x2ddf6a[_0x2eb2('0x1a')];_0x10fbf7++){if(_0x2ddf6a[_0x10fbf7][_0x2eb2('0xf')]===_0xe0c788['agentEmail']){_0x4393de=!![];_0xe0c788[_0x2eb2('0x1b')]=_0x2ddf6a[_0x10fbf7]['id'];logger[_0x2eb2('0xb')]('User\x20found:',_0xe0c788[_0x2eb2('0x1b')]);}}}if(!_0x4393de){logger[_0x2eb2('0xb')](_0x2eb2('0x1c'));_0xe0c788[_0x2eb2('0x19')]=_0xe0c788[_0x2eb2('0x1d')];_0xe0c788[_0x2eb2('0x1b')]=_0xe0c788[_0x2eb2('0x10')];_0x4393de=!![];}if(_0x4393de){_0xcd13cc(_0xe0c788);}else{_0xe2dfd1({'statusCode':0x194,'message':_0x2eb2('0x11')});}}else{_0xe2dfd1({'statusCode':0x194,'message':_0x2eb2('0x11')});}})[_0x2eb2('0x12')](function(_0x1b5abe){logger[_0x2eb2('0x13')]('['+[_0x244dd2[_0x2eb2('0x14')]()]+']',_0x1b5abe['message']);_0xe2dfd1(_0x1b5abe);});});};}function searchContact(_0x488f2a,_0x252333,_0x58bbb1,_0x1d7a12){return new Promise(function(_0x4c35dd,_0x4b637a){var _0x1502c9={'method':_0x2eb2('0x9'),'headers':_0x252333,'uri':_0x488f2a+_0x2eb2('0x1e')+_0x1d7a12+_0x2eb2('0x1f')+_0x58bbb1+'&entities=contact','json':!![]};rp(_0x1502c9)[_0x2eb2('0xd')](function(_0x20d1b3){var _0x2c169d=_[_0x2eb2('0x20')](_0x20d1b3[_0x2eb2('0x21')][_0x2eb2('0x21')],[_0x58bbb1,_0x1d7a12]);_0x4c35dd(_0x2c169d);})[_0x2eb2('0x12')](function(_0x1a6a41){_0x4b637a(_0x1a6a41);});});}function getEndUser(_0x285130,_0x23af4c,_0x200c6c){return function(_0x343cf4){return new Promise(function(_0x26dc12,_0x44dd33){logger[_0x2eb2('0xb')](util[_0x2eb2('0x22')]('Searching\x20contact\x20with\x20phone\x20%s',_0x343cf4[_0x2eb2('0x23')]));searchContact(_0x200c6c,_0x23af4c,'mobile_number',_0x343cf4[_0x2eb2('0x23')])['then'](function(_0x1fd3d6){if(_0x1fd3d6){_0x343cf4[_0x2eb2('0x24')]=_0x1fd3d6['id'];logger[_0x2eb2('0xb')](_0x2eb2('0x25'),_0x343cf4[_0x2eb2('0x24')]);return _0x26dc12(_0x343cf4);}searchContact(_0x200c6c,_0x23af4c,_0x2eb2('0x26'),_0x343cf4[_0x2eb2('0x23')])[_0x2eb2('0xd')](function(_0x21526d){if(_0x21526d){_0x343cf4['endUserId']=_0x21526d['id'];logger[_0x2eb2('0xb')](_0x2eb2('0x27'),_0x343cf4[_0x2eb2('0x24')]);return _0x26dc12(_0x343cf4);}createEndUser(_0x343cf4,_0x285130,_0x23af4c,_0x200c6c)[_0x2eb2('0xd')](function(_0x1df0ff){logger[_0x2eb2('0xb')](_0x2eb2('0x28'),_0x1df0ff[_0x2eb2('0x24')]);return _0x26dc12(_0x1df0ff);});});})[_0x2eb2('0x12')](function(_0x233a78){_0x44dd33(_0x233a78);});});};}function createEndUser(_0x28de3b,_0x11998a,_0x6b22b0,_0x2783c0){return new Promise(function(_0x6e1a19,_0x2886d6){var _0x4a0b19=moment();var _0x3e68c1={'method':_0x2eb2('0x29'),'uri':_0x2783c0+_0x2eb2('0x2a'),'body':{'contact':{'last_name':_0x28de3b['contactNumber'],'work_number':_0x28de3b[_0x2eb2('0x23')],'mobile_number':_0x28de3b[_0x2eb2('0x23')],'owner_id':_0x28de3b[_0x2eb2('0x1b')],'created_at':_0x4a0b19[_0x2eb2('0x22')](_0x2eb2('0x2b'))}},'json':!![]};_0x3e68c1[_0x2eb2('0x2c')]=_0x6b22b0;logger['info'](_0x2eb2('0x2d'));return rp(_0x3e68c1)[_0x2eb2('0xd')](function(_0x216d83){_0x28de3b[_0x2eb2('0x24')]=_0x216d83['contact']['id'];_0x6e1a19(_0x28de3b);})[_0x2eb2('0x12')](function(_0x2deb70){logger[_0x2eb2('0x13')]('['+[_0x11998a[_0x2eb2('0x14')]()]+']',_0x2deb70[_0x2eb2('0x15')]);_0x2886d6(_0x2deb70['message']);});});}function getTicket(_0x1272dd,_0xb7eef1,_0xdd89b0,_0x1e90aa,_0xa1546f){return function(_0x4c079a){logger[_0x2eb2('0xb')](_0x2eb2('0x2e'));return new Promise(function(_0x4ea7b9,_0x16b350){var _0x3422ac=moment();var _0x38e350={'method':_0x2eb2('0x29'),'uri':_0xdd89b0+'/api/tasks','body':{'title':intUtil['getString'](_0x1e90aa[_0x2eb2('0x2f')],_0xa1546f,'\x20'),'description':intUtil['getString'](_0x1e90aa['Descriptions'],_0xa1546f,'\x0a'),'owner_id':_0x4c079a[_0x2eb2('0x1b')],'creater_id':_0x4c079a[_0x2eb2('0x10')],'targetable_id':_0x4c079a['endUserId'],'targetable_type':_0x2eb2('0x30'),'created_at':_0x3422ac[_0x2eb2('0x22')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3422ac['add'](0x1e,'m')[_0x2eb2('0x22')](_0x2eb2('0x2b'))},'json':!![]};_0x38e350['headers']=_0xb7eef1;return rp(_0x38e350)[_0x2eb2('0xd')](function(_0x18cb7a){_0x4c079a[_0x2eb2('0x31')]=_0x18cb7a['task']['id'];logger['info'](_0x2eb2('0x32'),_0x4c079a[_0x2eb2('0x31')]);_0x4ea7b9(_0x4c079a);})[_0x2eb2('0x12')](function(_0x76c7cb){logger[_0x2eb2('0x13')]('['+[_0x1272dd[_0x2eb2('0x14')]()]+']',_0x76c7cb[_0x2eb2('0x15')]);_0x16b350(_0x76c7cb['message']);});});};}function emit(_0x5aa2a8,_0x1823e6,_0x223420){var _0x959beb={'uri':_0x5aa2a8+'/contacts/'+_0x223420};io['to'](util['format'](_0x2eb2('0x33'),_0x1823e6))[_0x2eb2('0x34')](_0x2eb2('0x35'),_0x959beb);}exports['cs']=function(_0x265691,_0xfe3f84,_0x506c94,_0x280422,_0x132726,_0x58fee7,_0x3cef6a,_0x86a9e6){var _0x2df1b9={};var _0x30287a={'Authorization':_0x2eb2('0x36')+_0x58fee7[_0x2eb2('0x37')]};_0x58fee7[_0x2eb2('0x38')]=intUtil[_0x2eb2('0x39')](_0x58fee7[_0x2eb2('0x38')]);_0x58fee7[_0x2eb2('0x3a')]=intUtil[_0x2eb2('0x39')](_0x58fee7[_0x2eb2('0x3a')]);var _0xaa4ff7=_0x58fee7[_0x2eb2('0x38')];_0x2df1b9[_0x2eb2('0x1d')]=_0x58fee7['username'];_0x2df1b9[_0x2eb2('0x23')]=_0x86a9e6[_0x2eb2('0x3b')]()===_0x2eb2('0x3c')?_0xfe3f84[_0x2eb2('0x3d')]:_0xfe3f84[_0x2eb2('0x3e')];_0x2df1b9[_0x2eb2('0x3f')]=_0x86a9e6===_0x2eb2('0x40')||_0x86a9e6===_0x2eb2('0x41')?_0x2eb2('0x40'):_0x2eb2('0x3c');if(_0x280422){_0x2df1b9[_0x2eb2('0x18')]=_0x280422[_0x2eb2('0xf')];}var _0x18bcfd=util[_0x2eb2('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58fee7[_0x2eb2('0x3a')],_0xfe3f84['uniqueid'],md5(_0xfe3f84[_0x2eb2('0x42')]));if(_0x132726&&_0x132726['monitor_format']){logger[_0x2eb2('0xb')](_0x2eb2('0x43'),_0x2eb2('0x44'));_0xfe3f84[_0x2eb2('0x45')]=_0x18bcfd;}else if(_0x3cef6a&&_0x3cef6a[_0x2eb2('0x46')]&&_0x3cef6a[_0x2eb2('0x46')]!=='none'){logger[_0x2eb2('0xb')](_0x2eb2('0x47'),_0x2eb2('0x44'));_0xfe3f84[_0x2eb2('0x45')]=_0x18bcfd;}else{_0xfe3f84[_0x2eb2('0x45')]='';}return getAdminId(_0x2df1b9,_0x86a9e6,_0x30287a,_0xaa4ff7)['then'](getUser(_0x86a9e6,_0x30287a,_0xaa4ff7))[_0x2eb2('0xd')](getEndUser(_0x86a9e6,_0x30287a,_0xaa4ff7))[_0x2eb2('0xd')](getTicket(_0x86a9e6,_0x30287a,_0xaa4ff7,_0x506c94,_0xfe3f84))[_0x2eb2('0xd')](function(_0x233f46){logger['info'](util[_0x2eb2('0x22')](_0x2eb2('0x48'),_0x233f46[_0x2eb2('0x31')]));if(_0x86a9e6!=='unmanaged'){logger[_0x2eb2('0xb')]('['+[_0x86a9e6[_0x2eb2('0x14')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0xaa4ff7,_0x280422[_0x2eb2('0x49')],_0x233f46[_0x2eb2('0x24')]);}})['catch'](function(_0x23ca36){logger[_0x2eb2('0x13')]('['+[_0x86a9e6['toUpperCase']()]+_0x2eb2('0x4a'),util[_0x2eb2('0x4b')](_0x23ca36,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7652=['then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','getString','Subjects','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','ticketId','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information'];(function(_0x465661,_0x150fd5){var _0x316de9=function(_0x21e996){while(--_0x21e996){_0x465661['push'](_0x465661['shift']());}};_0x316de9(++_0x150fd5);}(_0x7652,0xf2));var _0x2765=function(_0x85246a,_0x3407f1){_0x85246a=_0x85246a-0x0;var _0x337a3d=_0x7652[_0x85246a];return _0x337a3d;};'use strict';var _=require(_0x2765('0x0'));var rp=require('request-promise');var md5=require(_0x2765('0x1'));var util=require(_0x2765('0x2'));var moment=require(_0x2765('0x3'));var Promise=require(_0x2765('0x4'));var Redis=require(_0x2765('0x5'));var intUtil=require('./util');var config=require(_0x2765('0x6'));var logger=require(_0x2765('0x7'))(_0x2765('0x8'));config[_0x2765('0x9')]=_['defaults'](config[_0x2765('0x9')],{'host':_0x2765('0xa'),'port':0x18eb});var io=require(_0x2765('0xb'))(new Redis(config[_0x2765('0x9')]));function getAdminId(_0x56321e,_0x5dd391,_0x50d24d,_0x4fbfd3){return new Promise(function(_0x4e1c1a,_0x4133d6){var _0x3e146b=![];var _0x4cb485={'method':'GET','uri':_0x4fbfd3+_0x2765('0xc'),'json':!![]};_0x4cb485[_0x2765('0xd')]=_0x50d24d;logger[_0x2765('0xe')](_0x2765('0xf'));return rp(_0x4cb485)[_0x2765('0x10')](function(_0x5ae81c){if(_0x5ae81c){var _0x16fee0=_0x5ae81c[_0x2765('0x11')];var _0x281705=null;for(_0x281705=0x0;_0x281705<_0x16fee0[_0x2765('0x12')];_0x281705++){if(_0x16fee0[_0x281705][_0x2765('0x13')]===_0x56321e[_0x2765('0x14')]){_0x56321e[_0x2765('0x15')]=_0x16fee0[_0x281705]['id'];_0x3e146b=!![];}}if(_0x3e146b){logger[_0x2765('0xe')](_0x2765('0x16'),_0x56321e['adminId']);_0x4e1c1a(_0x56321e);}else{_0x4133d6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4133d6({'statusCode':0x194,'message':_0x2765('0x17')});}})['catch'](function(_0x20b478){logger[_0x2765('0x18')]('['+[_0x5dd391[_0x2765('0x19')]()]+']',_0x20b478[_0x2765('0x1a')]);_0x4133d6(_0x20b478);});});}function getUser(_0x56eebc,_0x4f6d0f,_0x152599){return function(_0x16f6b7){return new Promise(function(_0xb1ceb0,_0xe75181){var _0x3c0029={'method':_0x2765('0x1b'),'uri':_0x152599+'/api/selector/owners','json':!![]};_0x3c0029[_0x2765('0xd')]=_0x4f6d0f;logger['info'](_0x2765('0x1c'));return rp(_0x3c0029)['then'](function(_0x11c13a){if(_0x11c13a){var _0x32de17=_0x11c13a[_0x2765('0x11')];var _0x9e35e0=![];var _0x23fed7=null;if(_0x16f6b7[_0x2765('0x1d')]!==null){logger[_0x2765('0xe')](_0x2765('0x1e'),_0x16f6b7['agentEmail']);_0x16f6b7[_0x2765('0x1f')]=_0x16f6b7[_0x2765('0x1d')];for(_0x23fed7=0x0;_0x23fed7<_0x32de17['length'];_0x23fed7++){if(_0x32de17[_0x23fed7][_0x2765('0x13')]===_0x16f6b7[_0x2765('0x1d')]){_0x9e35e0=!![];_0x16f6b7[_0x2765('0x20')]=_0x32de17[_0x23fed7]['id'];logger[_0x2765('0xe')](_0x2765('0x21'),_0x16f6b7[_0x2765('0x20')]);}}}if(!_0x9e35e0){logger['info'](_0x2765('0x22'));_0x16f6b7['userEmail']=_0x16f6b7[_0x2765('0x14')];_0x16f6b7['userId']=_0x16f6b7[_0x2765('0x15')];_0x9e35e0=!![];}if(_0x9e35e0){_0xb1ceb0(_0x16f6b7);}else{_0xe75181({'statusCode':0x194,'message':_0x2765('0x17')});}}else{_0xe75181({'statusCode':0x194,'message':_0x2765('0x17')});}})[_0x2765('0x23')](function(_0x456c22){logger[_0x2765('0x18')]('['+[_0x56eebc[_0x2765('0x19')]()]+']',_0x456c22[_0x2765('0x1a')]);_0xe75181(_0x456c22);});});};}function searchContact(_0x5a8049,_0x4d90ce,_0x10779b,_0x3e5e09){return new Promise(function(_0x30bc39,_0x50439){var _0x418c44={'method':_0x2765('0x1b'),'headers':_0x4d90ce,'uri':_0x5a8049+_0x2765('0x24')+_0x3e5e09+_0x2765('0x25')+_0x10779b+'&entities=contact','json':!![]};rp(_0x418c44)[_0x2765('0x10')](function(_0x633933){var _0x49c68b=_[_0x2765('0x26')](_0x633933[_0x2765('0x27')][_0x2765('0x27')],[_0x10779b,_0x3e5e09]);_0x30bc39(_0x49c68b);})['catch'](function(_0x4a2fd1){_0x50439(_0x4a2fd1);});});}function getEndUser(_0x54e08a,_0x219cac,_0x25730c){return function(_0x38920c){return new Promise(function(_0x360537,_0x14b143){logger[_0x2765('0xe')](util[_0x2765('0x28')](_0x2765('0x29'),_0x38920c['contactNumber']));searchContact(_0x25730c,_0x219cac,'mobile_number',_0x38920c[_0x2765('0x2a')])[_0x2765('0x10')](function(_0x133419){if(_0x133419){_0x38920c[_0x2765('0x2b')]=_0x133419['id'];logger[_0x2765('0xe')]('Contact\x20found\x20mobile_number:',_0x38920c['endUserId']);return _0x360537(_0x38920c);}searchContact(_0x25730c,_0x219cac,_0x2765('0x2c'),_0x38920c['contactNumber'])[_0x2765('0x10')](function(_0x6f6da6){if(_0x6f6da6){_0x38920c[_0x2765('0x2b')]=_0x6f6da6['id'];logger['info'](_0x2765('0x2d'),_0x38920c[_0x2765('0x2b')]);return _0x360537(_0x38920c);}createEndUser(_0x38920c,_0x54e08a,_0x219cac,_0x25730c)['then'](function(_0x37a321){logger[_0x2765('0xe')](_0x2765('0x2e'),_0x37a321[_0x2765('0x2b')]);return _0x360537(_0x37a321);});});})[_0x2765('0x23')](function(_0x3d09c5){_0x14b143(_0x3d09c5);});});};}function createEndUser(_0x3b69f0,_0x4af131,_0x5dc1eb,_0x4fcf19){return new Promise(function(_0x2a4422,_0x15c036){var _0x1beb4b=moment();var _0x551dac={'method':'POST','uri':_0x4fcf19+'/api/contacts','body':{'contact':{'last_name':_0x3b69f0[_0x2765('0x2a')],'work_number':_0x3b69f0[_0x2765('0x2a')],'mobile_number':_0x3b69f0[_0x2765('0x2a')],'owner_id':_0x3b69f0[_0x2765('0x20')],'created_at':_0x1beb4b[_0x2765('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x551dac[_0x2765('0xd')]=_0x5dc1eb;logger['info'](_0x2765('0x2f'));return rp(_0x551dac)[_0x2765('0x10')](function(_0x4be15a){_0x3b69f0[_0x2765('0x2b')]=_0x4be15a[_0x2765('0x30')]['id'];_0x2a4422(_0x3b69f0);})[_0x2765('0x23')](function(_0x2188ea){logger[_0x2765('0x18')]('['+[_0x4af131[_0x2765('0x19')]()]+']',_0x2188ea[_0x2765('0x1a')]);_0x15c036(_0x2188ea[_0x2765('0x1a')]);});});}function getTicket(_0x4b3fa6,_0x4e6d32,_0x9aca02,_0x36c031,_0x269368){return function(_0x3759e3){logger[_0x2765('0xe')](_0x2765('0x31'));return new Promise(function(_0x3f727e,_0x564af1){var _0x558aae=moment();var _0x2bca7a={'method':_0x2765('0x32'),'uri':_0x9aca02+'/api/tasks','body':{'title':intUtil[_0x2765('0x33')](_0x36c031[_0x2765('0x34')],_0x269368,'\x20'),'description':intUtil['getString'](_0x36c031[_0x2765('0x35')],_0x269368,'\x0a'),'owner_id':_0x3759e3[_0x2765('0x20')],'creater_id':_0x3759e3[_0x2765('0x15')],'targetable_id':_0x3759e3[_0x2765('0x2b')],'targetable_type':_0x2765('0x36'),'created_at':_0x558aae[_0x2765('0x28')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x558aae[_0x2765('0x37')](0x1e,'m')[_0x2765('0x28')](_0x2765('0x38'))},'json':!![]};_0x2bca7a[_0x2765('0xd')]=_0x4e6d32;return rp(_0x2bca7a)[_0x2765('0x10')](function(_0x517c43){_0x3759e3['ticketId']=_0x517c43[_0x2765('0x39')]['id'];logger['info'](_0x2765('0x3a'),_0x3759e3['ticketId']);_0x3f727e(_0x3759e3);})['catch'](function(_0x103f69){logger[_0x2765('0x18')]('['+[_0x4b3fa6[_0x2765('0x19')]()]+']',_0x103f69[_0x2765('0x1a')]);_0x564af1(_0x103f69[_0x2765('0x1a')]);});});};}function emit(_0x5b91be,_0x2f6ef2,_0xfd6e58){var _0x173b92={'uri':_0x5b91be+_0x2765('0x3b')+_0xfd6e58};io['to'](util['format']('user:%s',_0x2f6ef2))[_0x2765('0x3c')](_0x2765('0x3d'),_0x173b92);}exports['cs']=function(_0x82b259,_0x455408,_0x3f380f,_0x24dc68,_0x2d9bea,_0x2c0e93,_0x31d75d,_0x4dabcb){var _0x116923={};var _0x2f48b2={'Authorization':_0x2765('0x3e')+_0x2c0e93[_0x2765('0x3f')]};_0x2c0e93[_0x2765('0x40')]=intUtil[_0x2765('0x41')](_0x2c0e93[_0x2765('0x40')]);_0x2c0e93[_0x2765('0x42')]=intUtil[_0x2765('0x41')](_0x2c0e93[_0x2765('0x42')]);var _0x3811d8=_0x2c0e93['remoteUri'];_0x116923[_0x2765('0x14')]=_0x2c0e93[_0x2765('0x43')];_0x116923[_0x2765('0x2a')]=_0x4dabcb[_0x2765('0x44')]()==='outbound'?_0x455408[_0x2765('0x45')]:_0x455408[_0x2765('0x46')];_0x116923[_0x2765('0x47')]=_0x4dabcb==='queue'||_0x4dabcb==='unmanaged'?_0x2765('0x48'):_0x2765('0x49');if(_0x24dc68){_0x116923['agentEmail']=_0x24dc68[_0x2765('0x13')];}var _0xb7c133=util[_0x2765('0x28')](_0x2765('0x4a'),_0x2c0e93[_0x2765('0x42')],_0x455408[_0x2765('0x4b')],md5(_0x455408[_0x2765('0x4b')]));if(_0x2d9bea&&_0x2d9bea['monitor_format']){logger[_0x2765('0xe')](_0x2765('0x4c'),_0x2765('0x4d'));_0x455408[_0x2765('0x4e')]=_0xb7c133;}else if(_0x31d75d&&_0x31d75d[_0x2765('0x4f')]&&_0x31d75d[_0x2765('0x4f')]!==_0x2765('0x50')){logger[_0x2765('0xe')](_0x2765('0x51'),_0x2765('0x4d'));_0x455408[_0x2765('0x4e')]=_0xb7c133;}else{_0x455408[_0x2765('0x4e')]='';}return getAdminId(_0x116923,_0x4dabcb,_0x2f48b2,_0x3811d8)['then'](getUser(_0x4dabcb,_0x2f48b2,_0x3811d8))[_0x2765('0x10')](getEndUser(_0x4dabcb,_0x2f48b2,_0x3811d8))[_0x2765('0x10')](getTicket(_0x4dabcb,_0x2f48b2,_0x3811d8,_0x3f380f,_0x455408))[_0x2765('0x10')](function(_0x389c66){logger[_0x2765('0xe')](util[_0x2765('0x28')]('The\x20ticket\x20ID\x20is:\x20%s',_0x389c66[_0x2765('0x52')]));if(_0x4dabcb!==_0x2765('0x53')){logger[_0x2765('0xe')]('['+[_0x4dabcb[_0x2765('0x19')]()]+']',_0x2765('0x54'));emit(_0x3811d8,_0x24dc68[_0x2765('0x55')],_0x389c66[_0x2765('0x2b')]);}})['catch'](function(_0x8dee36){logger[_0x2765('0x18')]('['+[_0x4dabcb['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x8dee36,{'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 cb5aa84..d69d9be 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 _0xd5f2=['freshsales','servicenow','includes','data1','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','zendesk','sugarcrm','freshdesk','desk','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','zoho','vtiger'];(function(_0x2bdbb,_0x55a171){var _0x108ac3=function(_0x1273c0){while(--_0x1273c0){_0x2bdbb['push'](_0x2bdbb['shift']());}};_0x108ac3(++_0x55a171);}(_0xd5f2,0x8a));var _0x2d5f=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xd5f2[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x2d5f('0x0'));var util=require(_0x2d5f('0x1'));var zendesk=require(_0x2d5f('0x2'));var salesforce=require(_0x2d5f('0x3'));var sugarcrm=require(_0x2d5f('0x4'));var freshdesk=require(_0x2d5f('0x5'));var zoho=require('./zoho');var desk=require(_0x2d5f('0x6'));var vtiger=require(_0x2d5f('0x7'));var servicenow=require(_0x2d5f('0x8'));var dynamics365=require(_0x2d5f('0x9'));var freshsales=require(_0x2d5f('0xa'));var integrations=['zendesk',_0x2d5f('0xb'),'sugarcrm','freshdesk',_0x2d5f('0xc'),'desk',_0x2d5f('0xd'),'dynamics365',_0x2d5f('0xe'),_0x2d5f('0xf')];exports['exec']=function(_0x499335,_0x2ae4b0,_0x5892df,_0x514bd6,_0x1552d9,_0x45e173){if(_0x5892df){if(_[_0x2d5f('0x10')](integrations,_0x499335['data1']['toLowerCase']())){try{var _0x390faa=null;var _0xcc3ddf='';var _0x5a1e0e=_0x5892df[_0x499335[_0x2d5f('0x11')]['toLowerCase']()];if(_0x5a1e0e){var _0x4958ee=_0x5a1e0e[_0x499335['data2']];if(_0x4958ee){var _0x20bce3=_[_0x2d5f('0x12')](_0x4958ee[_0x2d5f('0x13')],{'id':parseInt(_0x499335[_0x2d5f('0x14')],0xa)});if(_0x20bce3){if(_0x514bd6){if(_0x1552d9&&_0x2ae4b0['queue']){_0xcc3ddf=_0x2d5f('0x15');}else if(_0x2ae4b0['routeId']){_0xcc3ddf=_0x2d5f('0x16');}else{console[_0x2d5f('0x17')](_0x2d5f('0x18'),_0x2ae4b0);}}else{_0xcc3ddf=_0x2d5f('0x19');}switch(_0x499335[_0x2d5f('0x11')][_0x2d5f('0x1a')]()){case _0x2d5f('0x1b'):zendesk[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case _0x2d5f('0xb'):salesforce[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case _0x2d5f('0x1c'):sugarcrm[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case _0x2d5f('0x1d'):freshdesk[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case'zoho':zoho[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case _0x2d5f('0x1e'):desk[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case _0x2d5f('0xd'):vtiger[_0xcc3ddf](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173);break;case'freshsales':freshsales['cs'](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173,_0xcc3ddf);break;case'servicenow':servicenow['cs'](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173,_0xcc3ddf);break;case _0x2d5f('0x1f'):dynamics365['cs'](_0x499335,_0x2ae4b0,_0x20bce3,_0x514bd6,_0x1552d9,_0x4958ee,_0x45e173,_0xcc3ddf);break;default:console[_0x2d5f('0x17')](_0x2d5f('0x20'));}}else{_0x390faa=require(_0x2d5f('0x21'))(_0x499335[_0x2d5f('0x11')]['toLowerCase']());_0x390faa[_0x2d5f('0x22')](_0x2d5f('0x23'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x499335[_0x2d5f('0x11')]['toLowerCase'](),_0x499335[_0x2d5f('0x14')]));}}else{_0x390faa=require(_0x2d5f('0x21'))(_0x499335[_0x2d5f('0x11')]['toLowerCase']());_0x390faa[_0x2d5f('0x22')]('[EXEC]',util['format'](_0x2d5f('0x24'),_0x499335['data1'][_0x2d5f('0x1a')](),_0x499335[_0x2d5f('0x25')]));}}else{}}catch(_0x36eb0e){console[_0x2d5f('0x22')](_0x36eb0e);}}}}; \ No newline at end of file +var _0xf777=['freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','EVENT\x20UNKNOWN','salesforce','desk','log','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','error','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','vtiger','dynamics365'];(function(_0x13eaae,_0x11ec0a){var _0x4493db=function(_0xf9d8b1){while(--_0xf9d8b1){_0x13eaae['push'](_0x13eaae['shift']());}};_0x4493db(++_0x11ec0a);}(_0xf777,0x180));var _0x7f77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf777[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f77('0x0'));var util=require(_0x7f77('0x1'));var zendesk=require(_0x7f77('0x2'));var salesforce=require(_0x7f77('0x3'));var sugarcrm=require(_0x7f77('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x7f77('0x5'));var desk=require('./desk');var vtiger=require(_0x7f77('0x6'));var servicenow=require(_0x7f77('0x7'));var dynamics365=require(_0x7f77('0x8'));var freshsales=require(_0x7f77('0x9'));var integrations=[_0x7f77('0xa'),'salesforce',_0x7f77('0xb'),_0x7f77('0xc'),_0x7f77('0xd'),'desk',_0x7f77('0xe'),_0x7f77('0xf'),_0x7f77('0x10'),_0x7f77('0x11')];exports[_0x7f77('0x12')]=function(_0x1a90d0,_0x598af3,_0x197ceb,_0x5abde3,_0x254ed9,_0x478468){if(_0x197ceb){if(_[_0x7f77('0x13')](integrations,_0x1a90d0[_0x7f77('0x14')][_0x7f77('0x15')]())){try{var _0x236565=null;var _0xe0e471='';var _0x2d7951=_0x197ceb[_0x1a90d0[_0x7f77('0x14')][_0x7f77('0x15')]()];if(_0x2d7951){var _0x35aa01=_0x2d7951[_0x1a90d0[_0x7f77('0x16')]];if(_0x35aa01){var _0x1c2f5b=_[_0x7f77('0x17')](_0x35aa01[_0x7f77('0x18')],{'id':parseInt(_0x1a90d0['data3'],0xa)});if(_0x1c2f5b){if(_0x5abde3){if(_0x254ed9&&_0x598af3[_0x7f77('0x19')]){_0xe0e471=_0x7f77('0x19');}else if(_0x598af3[_0x7f77('0x1a')]){_0xe0e471=_0x7f77('0x1b');}else{console['log'](_0x7f77('0x1c'),_0x598af3);}}else{_0xe0e471='unmanaged';}switch(_0x1a90d0[_0x7f77('0x14')][_0x7f77('0x15')]()){case _0x7f77('0xa'):zendesk[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case _0x7f77('0x1d'):salesforce[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case'sugarcrm':sugarcrm[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case _0x7f77('0xc'):freshdesk[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case _0x7f77('0xd'):zoho[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case _0x7f77('0x1e'):desk[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case'vtiger':vtiger[_0xe0e471](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468);break;case _0x7f77('0x10'):freshsales['cs'](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468,_0xe0e471);break;case'servicenow':servicenow['cs'](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468,_0xe0e471);break;case'dynamics365':dynamics365['cs'](_0x1a90d0,_0x598af3,_0x1c2f5b,_0x5abde3,_0x254ed9,_0x35aa01,_0x478468,_0xe0e471);break;default:console[_0x7f77('0x1f')](_0x7f77('0x20'));}}else{_0x236565=require(_0x7f77('0x21'))(_0x1a90d0['data1'][_0x7f77('0x15')]());_0x236565['error'](_0x7f77('0x22'),util['format'](_0x7f77('0x23'),_0x1a90d0[_0x7f77('0x14')][_0x7f77('0x15')](),_0x1a90d0[_0x7f77('0x24')]));}}else{_0x236565=require(_0x7f77('0x21'))(_0x1a90d0['data1'][_0x7f77('0x15')]());_0x236565[_0x7f77('0x25')](_0x7f77('0x22'),util[_0x7f77('0x26')](_0x7f77('0x27'),_0x1a90d0['data1'][_0x7f77('0x15')](),_0x1a90d0[_0x7f77('0x16')]));}}else{}}catch(_0x463ca7){console[_0x7f77('0x25')](_0x463ca7);}}}}; \ 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 86f45a6..cfb14e4 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 _0x5c6c=['username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridnum','Fields','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','salesforce','redis','defaults','socket.io-emitter','emit','assign','Descriptions','ticketType','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','additionalSearchContact','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','','Company','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','forEach','picklist','toString','variableName','idField','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login'];(function(_0x1c7d58,_0x498abc){var _0x59673b=function(_0x2d664f){while(--_0x2d664f){_0x1c7d58['push'](_0x1c7d58['shift']());}};_0x59673b(++_0x498abc);}(_0x5c6c,0x97));var _0xc5c6=function(_0x5e141f,_0x240158){_0x5e141f=_0x5e141f-0x0;var _0x12b9f0=_0x5c6c[_0x5e141f];return _0x12b9f0;};'use strict';var _=require(_0xc5c6('0x0'));var rp=require(_0xc5c6('0x1'));var moment=require('moment');var BPromise=require(_0xc5c6('0x2'));var md5=require(_0xc5c6('0x3'));var jsforce=require(_0xc5c6('0x4'));var util=require(_0xc5c6('0x5'));var Redis=require(_0xc5c6('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xc5c6('0x7'));config[_0xc5c6('0x8')]=_[_0xc5c6('0x9')](config[_0xc5c6('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc5c6('0xa'))(new Redis(config[_0xc5c6('0x8')]));function emit(_0x54e50b,_0x5947b8,_0x305810){io['to'](_0x54e50b)[_0xc5c6('0xb')](_0x5947b8,_0x305810);}function getTicket(_0x261276,_0x545009,_0xc25bc,_0x426ebb,_0x3353aa,_0x1b4d7b,_0x16317c,_0x4fc360){var _0x4a729d=Object[_0xc5c6('0xc')]({},{'OwnerId':_0x545009['id'],'Subject':intUtil['getString'](_0x426ebb['Subjects'],_0x3353aa,'\x20'),'Description':intUtil['getString'](_0x426ebb[_0xc5c6('0xd')],_0x3353aa,'\x0a')},getCustomFields(_0x1b4d7b,_0x3353aa));if(_0xc25bc){if(_0x426ebb[_0xc5c6('0xe')]===_0xc5c6('0xf')){_0x4a729d['ActivityDate']=moment[_0xc5c6('0x10')]();_0x4a729d['IsReminderSet']=![];_0x4a729d[_0xc5c6('0x11')]=![];if(_0xc25bc[_0xc5c6('0x12')]===_0xc5c6('0x13')||_0xc25bc[_0xc5c6('0x12')]===_0xc5c6('0x14')){_0x4a729d[_0xc5c6('0x15')]=_0xc25bc['id'];}else if(_0xc25bc['endUserType']===_0xc5c6('0x16')){_0x4a729d[_0xc5c6('0x17')]=_0xc25bc['id'];}}else if(_0x426ebb[_0xc5c6('0xe')]===_0xc5c6('0x18')){if(_0xc25bc[_0xc5c6('0x12')]==='contact'){_0x4a729d[_0xc5c6('0x19')]=_0xc25bc['id'];}else if(_0xc25bc['endUserType']==='account'){_0x4a729d[_0xc5c6('0x1a')]=_0xc25bc['id'];}else if(_0xc25bc[_0xc5c6('0x12')]===_0xc5c6('0x14')&&_0x426ebb['leadId']){_0x4a729d[_0x426ebb[_0xc5c6('0x1b')]]=_0xc25bc['id'];}else{logger[_0xc5c6('0x1c')](_0xc5c6('0x1d'));}}}return _0x16317c[_0xc5c6('0x1e')](_0x426ebb[_0xc5c6('0xe')])['create'](_0x4a729d);}function getUser(_0x47b559,_0x2cce93,_0x1d4e37){if(!_[_0xc5c6('0x1f')](_0x2cce93)&&intUtil[_0xc5c6('0x20')](_0x2cce93)){var _0x20b7c2={'Email':_0x2cce93};var _0x31e7dc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1d4e37[_0xc5c6('0x1e')](_0xc5c6('0x21'))[_0xc5c6('0x22')](_0x20b7c2,_0x31e7dc)[_0xc5c6('0x23')]()[_0xc5c6('0x24')](function(_0x1fa970){if(_0x1fa970[_0xc5c6('0x25')]){var _0x12d099=_[_0xc5c6('0x22')](_0x1fa970,function(_0x258bb1){return _0x258bb1[_0xc5c6('0x26')]===_0x2cce93;});if(_0x12d099){logger[_0xc5c6('0x1c')](_0xc5c6('0x27'),_0x2cce93);return BPromise[_0xc5c6('0x28')]({'id':_0x12d099['Id'],'name':_0x12d099[_0xc5c6('0x29')]});}}else{logger[_0xc5c6('0x1c')](_0xc5c6('0x2a'),_0x2cce93);return _0x1d4e37['identity']()['then'](function(_0x35c970){return BPromise[_0xc5c6('0x28')]({'id':_0x35c970['user_id'],'name':_0x35c970['display_name']});});}});}else{logger[_0xc5c6('0x1c')](_0xc5c6('0x2a'),_0x2cce93);return _0x1d4e37['identity']()['then'](function(_0x23679d){return BPromise[_0xc5c6('0x28')]({'id':_0x23679d[_0xc5c6('0x2b')],'name':_0x23679d['display_name']});});}}function getEndUser(_0x5f10db,_0x4bcd4f,_0x75ff36,_0x303639,_0x2e09fe){var _0xcc2346={'$or':{'Phone':_0x303639}};var _0x299c9a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xc5c6('0x1c')](_0xc5c6('0x2c'),_0x303639,_0x4bcd4f[_0xc5c6('0x2d')]);switch(_0x4bcd4f[_0xc5c6('0x2d')]){case _0xc5c6('0x2e'):var _0x23e6bc=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f['additionalSearchContact']){var _0x3df0cf={};_0x3df0cf[_0x4bcd4f['additionalSearchContact']]=_0x303639;_['merge'](_0x23e6bc[_0xc5c6('0x30')],_0x3df0cf);}return _0x2e09fe[_0xc5c6('0x1e')](_0xc5c6('0x31'))[_0xc5c6('0x22')](_0x23e6bc,_0x299c9a)[_0xc5c6('0x23')]()[_0xc5c6('0x24')](function(_0x46e7dd){if(_0x46e7dd&&_0x46e7dd[_0xc5c6('0x25')]){return _0x46e7dd;}else{var _0xcca71e=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f[_0xc5c6('0x32')]){var _0x2c9b68={};_0x2c9b68[_0x4bcd4f[_0xc5c6('0x32')]]=_0x303639;_[_0xc5c6('0x33')](_0xcca71e[_0xc5c6('0x30')],_0x2c9b68);}return _0x2e09fe['sobject'](_0xc5c6('0x34'))[_0xc5c6('0x22')](_0xcca71e,_0x299c9a);}});case _0xc5c6('0x35'):var _0x49bf8c=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f[_0xc5c6('0x36')]){var _0x3df0cf={};_0x3df0cf[_0x4bcd4f[_0xc5c6('0x36')]]=_0x303639;_[_0xc5c6('0x33')](_0x49bf8c[_0xc5c6('0x30')],_0x3df0cf);}return _0x2e09fe[_0xc5c6('0x1e')]('Account')[_0xc5c6('0x22')](_0x49bf8c,_0x299c9a)[_0xc5c6('0x23')]()[_0xc5c6('0x24')](function(_0x147cc6){if(_0x147cc6&&_0x147cc6[_0xc5c6('0x25')]){return _0x147cc6;}else{var _0x89f85a=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f['additionalSearchContact']){var _0x4c86f9={};_0x4c86f9[_0x4bcd4f['additionalSearchContact']]=_0x303639;_[_0xc5c6('0x33')](_0x89f85a[_0xc5c6('0x30')],_0x4c86f9);}return _0x2e09fe[_0xc5c6('0x1e')](_0xc5c6('0x31'))['find'](_0x89f85a,_0x299c9a)[_0xc5c6('0x24')](function(_0x10dd4b){if(_0x10dd4b&&_0x10dd4b[_0xc5c6('0x25')]){return _0x10dd4b;}else{var _0x342154=_['cloneDeep'](_0xcc2346);if(_0x4bcd4f[_0xc5c6('0x32')]){var _0x3da005={};_0x3da005[_0x4bcd4f[_0xc5c6('0x32')]]=_0x303639;_['merge'](_0x342154[_0xc5c6('0x30')],_0x3da005);}return _0x2e09fe[_0xc5c6('0x1e')]('Lead')[_0xc5c6('0x22')](_0x342154,_0x299c9a);}});}});case'contact':var _0x23e6bc=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f['additionalSearchContact']){var _0x3df0cf={};_0x3df0cf[_0x4bcd4f[_0xc5c6('0x37')]]=_0x303639;_['merge'](_0x23e6bc[_0xc5c6('0x30')],_0x3df0cf);}return _0x2e09fe[_0xc5c6('0x1e')](_0xc5c6('0x31'))[_0xc5c6('0x22')](_0x23e6bc,_0x299c9a)[_0xc5c6('0x23')]();case _0xc5c6('0x14'):var _0x4b5573=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f[_0xc5c6('0x32')]){var _0x3df0cf={};_0x3df0cf[_0x4bcd4f[_0xc5c6('0x32')]]=_0x303639;_[_0xc5c6('0x33')](_0x4b5573[_0xc5c6('0x30')],_0x3df0cf);}return _0x2e09fe[_0xc5c6('0x1e')]('Lead')[_0xc5c6('0x22')](_0x4b5573,_0x299c9a);case'account':var _0x49bf8c=_[_0xc5c6('0x2f')](_0xcc2346);if(_0x4bcd4f[_0xc5c6('0x36')]){var _0x3df0cf={};_0x3df0cf[_0x4bcd4f[_0xc5c6('0x36')]]=_0x303639;_[_0xc5c6('0x33')](_0x49bf8c[_0xc5c6('0x30')],_0x3df0cf);}return _0x2e09fe[_0xc5c6('0x1e')](_0xc5c6('0x38'))['find'](_0x49bf8c,_0x299c9a);default:return null;}})[_0xc5c6('0x24')](function(_0x4d33c6){if(_0x4d33c6&&_0x4d33c6['length']){var _0x2a2ebf=_[_0xc5c6('0x39')](_0x4d33c6);if(_0x2a2ebf){return BPromise[_0xc5c6('0x28')]({'id':_0x2a2ebf['Id'],'name':_0x2a2ebf[_0xc5c6('0x29')],'phone':_0x2a2ebf[_0xc5c6('0x3a')],'endUserType':_0x2a2ebf[_0xc5c6('0x3b')][_0xc5c6('0x3c')][_0xc5c6('0x3d')]()});}}})[_0xc5c6('0x24')](function(_0x1b9a99){if(_0x1b9a99){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x1b9a99[_0xc5c6('0x12')],_0x303639);return BPromise['resolve'](_0x1b9a99);}else{logger[_0xc5c6('0x1c')](_0xc5c6('0x3e'),_0x303639);var _0x2b296a={'Phone':_0x303639};if(_0x4bcd4f[_0xc5c6('0x3f')]){if(_0x4bcd4f[_0xc5c6('0x3f')]==='contact'){logger[_0xc5c6('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x303639,_0x4bcd4f[_0xc5c6('0x3f')]);_0x2b296a[_0xc5c6('0x40')]=_0x75ff36!==''?_0x75ff36:util[_0xc5c6('0x41')](_0xc5c6('0x42'),_0x303639);}else if(_0x4bcd4f['moduleCreate']==='lead'){logger[_0xc5c6('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x303639,_0x4bcd4f[_0xc5c6('0x3f')]);_0x2b296a[_0xc5c6('0x40')]=_0x75ff36!==_0xc5c6('0x43')?_0x75ff36:util[_0xc5c6('0x41')](_0xc5c6('0x42'),_0x303639);_0x2b296a[_0xc5c6('0x44')]='No\x20Company';}else if(_0x4bcd4f[_0xc5c6('0x3f')]===_0xc5c6('0x16')){logger[_0xc5c6('0x1c')](_0xc5c6('0x45'),_0x303639,_0x4bcd4f[_0xc5c6('0x3f')]);_0x2b296a[_0xc5c6('0x29')]=_0x75ff36!==_0xc5c6('0x43')?_0x75ff36:util[_0xc5c6('0x41')](_0xc5c6('0x42'),_0x303639);}else{return null;}}return _0x2e09fe['sobject'](_[_0xc5c6('0x46')](_0x4bcd4f[_0xc5c6('0x3f')]))['create'](_0x2b296a)[_0xc5c6('0x24')](function(_0x2bc1cd){return BPromise[_0xc5c6('0x28')]({'id':_0x2bc1cd['id'],'endUserType':_0x4bcd4f[_0xc5c6('0x3f')]});});}});}function getCustomFields(_0x120d15,_0x5cd225){var _0x4ce84d={};if(_0x120d15['length']>0x0){_[_0xc5c6('0x47')](_0x120d15,function(_0x1c20cc){if(_['includes'](['string',_0xc5c6('0x48')],_0x1c20cc[_0xc5c6('0x3c')])&&_0x1c20cc['idField']){_0x4ce84d[_0x1c20cc['idField']]=_0x1c20cc['content'][_0xc5c6('0x49')]();}else if(_0x1c20cc[_0xc5c6('0x3c')]==='variable'&&_0x1c20cc[_0xc5c6('0x4a')]&&_0x1c20cc[_0xc5c6('0x4b')]){_0x5cd225[_0x1c20cc[_0xc5c6('0x4a')]]&&(_0x4ce84d[_0x1c20cc[_0xc5c6('0x4b')]]=_0x5cd225[_0x1c20cc['variableName']][_0xc5c6('0x49')]());}else if(_0x1c20cc[_0xc5c6('0x3c')]==='customVariable'&&_0x1c20cc[_0xc5c6('0x4c')]&&_0x1c20cc[_0xc5c6('0x4c')][_0xc5c6('0x4d')]&&_0x1c20cc['idField']){_0x5cd225[_0x1c20cc['Variable'][_0xc5c6('0x4d')][_0xc5c6('0x3d')]()]&&(_0x4ce84d[_0x1c20cc[_0xc5c6('0x4b')]]=_0x5cd225[_0x1c20cc['Variable'][_0xc5c6('0x4d')]['toLowerCase']()][_0xc5c6('0x49')]());}});}return _0x4ce84d;}function getConnection(_0x4e0354){var _0x52a847=_0x4e0354[_0xc5c6('0x4e')][_0xc5c6('0x4f')](_0x4e0354[_0xc5c6('0x50')]);var _0x28a02e=new jsforce[(_0xc5c6('0x51'))]({'oauth2':{'loginUrl':_0x4e0354[_0xc5c6('0x52')]||_0xc5c6('0x53'),'clientId':_0x4e0354[_0xc5c6('0x54')],'clientSecret':_0x4e0354[_0xc5c6('0x55')]}});return _0x28a02e[_0xc5c6('0x56')](_0x4e0354[_0xc5c6('0x57')],_0x52a847)[_0xc5c6('0x24')](function(){logger[_0xc5c6('0x1c')](_0xc5c6('0x58'));return _0x28a02e;});}exports[_0xc5c6('0x59')]=function(_0x5d3893,_0x507b4a,_0x44e4ff,_0x4926b8,_0x5c0d12,_0x2fdffc){var _0x13989e,_0x11581b,_0x51ef58,_0x7bffc1;_0x2fdffc[_0xc5c6('0x5a')]=intUtil[_0xc5c6('0x5b')](_0x2fdffc['serverUrl']);_0x2fdffc[_0xc5c6('0x52')]=intUtil[_0xc5c6('0x5b')](_0x2fdffc[_0xc5c6('0x52')]);if(_0x5c0d12&&_0x5c0d12[_0xc5c6('0x5c')]){logger['info'](_0xc5c6('0x5d'),'Recording\x20is\x20enabled!');_0x507b4a[_0xc5c6('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2fdffc[_0xc5c6('0x5a')],_0x507b4a[_0xc5c6('0x5f')],md5(_0x507b4a[_0xc5c6('0x5f')]));}else{_0x507b4a['recordingURL']='';}return getConnection(_0x2fdffc)['then'](function(_0x271c56){_0x7bffc1=_0x271c56;return getUser(_0x2fdffc,_0x4926b8['email'],_0x7bffc1);})[_0xc5c6('0x24')](function(_0x4d8d73){_0x13989e=_0x4d8d73;return getEndUser(_0x2fdffc,_0x44e4ff,_0x507b4a['calleridname'],_0x507b4a[_0xc5c6('0x60')],_0x7bffc1);})[_0xc5c6('0x24')](function(_0x2e89a0){_0x11581b=_0x2e89a0;return getTicket(_0x2fdffc,_0x13989e,_0x11581b,_0x44e4ff,_0x507b4a,_0x44e4ff[_0xc5c6('0x61')],_0x7bffc1,_0xc5c6('0x59'));})['then'](function(_0x471862){_0x51ef58=_0x471862;logger[_0xc5c6('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x51ef58['id']);logger[_0xc5c6('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x51ef58['id'],_0x4926b8[_0xc5c6('0x4d')],_0x2fdffc[_0xc5c6('0x3c')]);switch(_0x2fdffc['type']){case _0xc5c6('0x62'):emit(util[_0xc5c6('0x41')](_0xc5c6('0x63'),_0x4926b8[_0xc5c6('0x4d')]),'trigger:salesforce:display',{'recordId':_0x51ef58['id']});break;case'newTab':emit(util[_0xc5c6('0x41')]('user:%s',_0x4926b8[_0xc5c6('0x4d')]),_0xc5c6('0x64'),{'uri':util[_0xc5c6('0x41')](_0xc5c6('0x65'),_0x7bffc1[_0xc5c6('0x66')],_0x51ef58['id'])});break;default:logger[_0xc5c6('0x67')](_0xc5c6('0x68'));}})[_0xc5c6('0x69')](function(_0x5f7cdb){logger['error'](_0xc5c6('0x5d'),_0x5f7cdb);});};exports[_0xc5c6('0x6a')]=function(_0x277813,_0x5e5144,_0x4c693b,_0x52f12d,_0x4a0241,_0x51e07c,_0x427c05){var _0x460732,_0x2a0069,_0x581432,_0x3812c6;_0x51e07c['serverUrl']=intUtil[_0xc5c6('0x5b')](_0x51e07c[_0xc5c6('0x5a')]);_0x51e07c[_0xc5c6('0x52')]=intUtil[_0xc5c6('0x5b')](_0x51e07c[_0xc5c6('0x52')]);if(_0x427c05&&_0x427c05[_0xc5c6('0x6b')]&&_0x427c05[_0xc5c6('0x6b')]!=='none'){logger[_0xc5c6('0x1c')](_0xc5c6('0x6c'),_0xc5c6('0x6d'));_0x5e5144[_0xc5c6('0x5e')]=util[_0xc5c6('0x41')](_0xc5c6('0x6e'),_0x51e07c[_0xc5c6('0x5a')],_0x5e5144[_0xc5c6('0x5f')],md5(_0x5e5144[_0xc5c6('0x5f')]));}return getConnection(_0x51e07c)['then'](function(_0x2a2e41){_0x3812c6=_0x2a2e41;return getUser(_0x51e07c,_0x52f12d['email'],_0x3812c6);})[_0xc5c6('0x24')](function(_0x79ccae){_0x460732=_0x79ccae;return getEndUser(_0x51e07c,_0x4c693b,_0x5e5144['destcalleridname'],_0x5e5144[_0xc5c6('0x6f')],_0x3812c6);})[_0xc5c6('0x24')](function(_0x1fb6b0){_0x2a0069=_0x1fb6b0;return getTicket(_0x51e07c,_0x460732,_0x2a0069,_0x4c693b,_0x5e5144,_0x4c693b[_0xc5c6('0x61')],_0x3812c6,_0xc5c6('0x6a'));})['then'](function(_0x3e8882){_0x581432=_0x3e8882;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x581432['id']);logger[_0xc5c6('0x1c')](_0xc5c6('0x70'),_0x581432['id'],_0x52f12d['name'],_0x51e07c[_0xc5c6('0x3c')]);switch(_0x51e07c['type']){case _0xc5c6('0x62'):emit(util[_0xc5c6('0x41')](_0xc5c6('0x63'),_0x52f12d['name']),'trigger:salesforce:display',{'recordId':_0x581432['id']});break;case'newTab':emit(util[_0xc5c6('0x41')](_0xc5c6('0x63'),_0x52f12d[_0xc5c6('0x4d')]),_0xc5c6('0x64'),{'uri':util['format'](_0xc5c6('0x65'),_0x3812c6[_0xc5c6('0x66')],_0x581432['id'])});break;default:logger[_0xc5c6('0x67')]('[OUTBOUND]',_0xc5c6('0x71'));}})[_0xc5c6('0x69')](function(_0x225883){logger[_0xc5c6('0x67')](_0xc5c6('0x6c'),_0x225883);});};exports['unmanaged']=function(_0x4ce55d,_0x2235da,_0x1a50d2,_0x34de49,_0x3b4362,_0x105c83){var _0x228fec,_0x358b98,_0x3d5856,_0x348f36;_0x105c83[_0xc5c6('0x5a')]=intUtil[_0xc5c6('0x5b')](_0x105c83[_0xc5c6('0x5a')]);_0x105c83[_0xc5c6('0x52')]=intUtil[_0xc5c6('0x5b')](_0x105c83[_0xc5c6('0x52')]);if(_0x3b4362&&_0x3b4362[_0xc5c6('0x5c')]){logger[_0xc5c6('0x1c')]('['+_0x2235da[_0xc5c6('0x72')][_0xc5c6('0x73')]()+']',_0xc5c6('0x6d'));_0x2235da['recordingURL']=util[_0xc5c6('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x105c83[_0xc5c6('0x5a')],_0x2235da[_0xc5c6('0x5f')],md5(_0x2235da['uniqueid']));}else{_0x2235da[_0xc5c6('0x5e')]='';}return getConnection(_0x105c83)['then'](function(_0x57e994){_0x348f36=_0x57e994;if(!_[_0xc5c6('0x1f')](_0x34de49)){return getUser(_0x105c83,_0x34de49[_0xc5c6('0x4d')],_0x348f36);}else{return getUser(_0x105c83,null,_0x348f36);}})['then'](function(_0x46237c){_0x228fec=_0x46237c;return getEndUser(_0x105c83,_0x1a50d2,_0x2235da[_0xc5c6('0x74')],_0x2235da[_0xc5c6('0x60')],_0x348f36);})[_0xc5c6('0x24')](function(_0x31af65){_0x358b98=_0x31af65;return getTicket(_0x105c83,_0x228fec,_0x358b98,_0x1a50d2,_0x2235da,_0x1a50d2[_0xc5c6('0x61')],_0x348f36);})[_0xc5c6('0x24')](function(_0x57d9ae){_0x3d5856=_0x57d9ae;logger[_0xc5c6('0x1c')]('['+_0x2235da[_0xc5c6('0x72')][_0xc5c6('0x73')]()+_0xc5c6('0x75'),_0x3d5856['id']);logger[_0xc5c6('0x1c')]('['+_0x2235da[_0xc5c6('0x72')][_0xc5c6('0x73')]()+_0xc5c6('0x76'),_0x105c83['type']);})[_0xc5c6('0x69')](function(_0x23615b){logger['error']('['+_0x2235da['lastevent'][_0xc5c6('0x73')]()+']',_0x23615b);});}; \ No newline at end of file +var _0xf39b=['additionalSearchAccount','Account','execute','Lead','Phone','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','','Company','No\x20Company','forEach','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','Connection','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','newTab','user:%s','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','remoteUri','recordingFormat','none','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','trigger:browser:url','instanceUrl','[OUTBOUND]','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsRecurrence','contact','endUserType','WhatId','Case','account','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','length','find','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','then','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','Contact','additionalSearchLead','$or','account_contact_lead','cloneDeep'];(function(_0xf979b6,_0x53314){var _0x2711f0=function(_0x370797){while(--_0x370797){_0xf979b6['push'](_0xf979b6['shift']());}};_0x2711f0(++_0x53314);}(_0xf39b,0xc4));var _0xbf39=function(_0x4d4cda,_0x98a46f){_0x4d4cda=_0x4d4cda-0x0;var _0x4d9f5e=_0xf39b[_0x4d4cda];return _0x4d9f5e;};'use strict';var _=require(_0xbf39('0x0'));var rp=require(_0xbf39('0x1'));var moment=require(_0xbf39('0x2'));var BPromise=require(_0xbf39('0x3'));var md5=require(_0xbf39('0x4'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xbf39('0x5'));var config=require(_0xbf39('0x6'));var logger=require(_0xbf39('0x7'))(_0xbf39('0x8'));config[_0xbf39('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbf39('0xa'))(new Redis(config[_0xbf39('0x9')]));function emit(_0x43f7fc,_0x2e704a,_0x5e0f1a){io['to'](_0x43f7fc)[_0xbf39('0xb')](_0x2e704a,_0x5e0f1a);}function getTicket(_0x393c7d,_0x5722ed,_0x200470,_0x4b7773,_0x5784db,_0x815ba0,_0xf4a0a2,_0x47332a){var _0x3b6ed0=Object[_0xbf39('0xc')]({},{'OwnerId':_0x5722ed['id'],'Subject':intUtil[_0xbf39('0xd')](_0x4b7773[_0xbf39('0xe')],_0x5784db,'\x20'),'Description':intUtil[_0xbf39('0xd')](_0x4b7773[_0xbf39('0xf')],_0x5784db,'\x0a')},getCustomFields(_0x815ba0,_0x5784db));if(_0x200470){if(_0x4b7773[_0xbf39('0x10')]==='Task'){_0x3b6ed0[_0xbf39('0x11')]=moment[_0xbf39('0x12')]();_0x3b6ed0['IsReminderSet']=![];_0x3b6ed0[_0xbf39('0x13')]=![];if(_0x200470['endUserType']===_0xbf39('0x14')||_0x200470[_0xbf39('0x15')]==='lead'){_0x3b6ed0['WhoId']=_0x200470['id'];}else if(_0x200470['endUserType']==='account'){_0x3b6ed0[_0xbf39('0x16')]=_0x200470['id'];}}else if(_0x4b7773[_0xbf39('0x10')]===_0xbf39('0x17')){if(_0x200470['endUserType']==='contact'){_0x3b6ed0['ContactId']=_0x200470['id'];}else if(_0x200470[_0xbf39('0x15')]===_0xbf39('0x18')){_0x3b6ed0[_0xbf39('0x19')]=_0x200470['id'];}else if(_0x200470[_0xbf39('0x15')]===_0xbf39('0x1a')&&_0x4b7773[_0xbf39('0x1b')]){_0x3b6ed0[_0x4b7773[_0xbf39('0x1b')]]=_0x200470['id'];}else{logger['info'](_0xbf39('0x1c'));}}}return _0xf4a0a2[_0xbf39('0x1d')](_0x4b7773['ticketType'])[_0xbf39('0x1e')](_0x3b6ed0);}function getUser(_0x5f3fc6,_0x1abcc1,_0xcb4869){if(!_[_0xbf39('0x1f')](_0x1abcc1)&&intUtil[_0xbf39('0x20')](_0x1abcc1)){var _0x5d70b4={'Email':_0x1abcc1};var _0x492fe9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xcb4869[_0xbf39('0x1d')](_0xbf39('0x21'))['find'](_0x5d70b4,_0x492fe9)['execute']()['then'](function(_0x20bbe6){if(_0x20bbe6[_0xbf39('0x22')]){var _0x122972=_[_0xbf39('0x23')](_0x20bbe6,function(_0x39086c){return _0x39086c[_0xbf39('0x24')]===_0x1abcc1;});if(_0x122972){logger[_0xbf39('0x25')](_0xbf39('0x26'),_0x1abcc1);return BPromise[_0xbf39('0x27')]({'id':_0x122972['Id'],'name':_0x122972[_0xbf39('0x28')]});}}else{logger[_0xbf39('0x25')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1abcc1);return _0xcb4869[_0xbf39('0x29')]()[_0xbf39('0x2a')](function(_0xfc910b){return BPromise[_0xbf39('0x27')]({'id':_0xfc910b['user_id'],'name':_0xfc910b[_0xbf39('0x2b')]});});}});}else{logger[_0xbf39('0x25')](_0xbf39('0x2c'),_0x1abcc1);return _0xcb4869['identity']()[_0xbf39('0x2a')](function(_0x452982){return BPromise[_0xbf39('0x27')]({'id':_0x452982[_0xbf39('0x2d')],'name':_0x452982[_0xbf39('0x2b')]});});}}function getEndUser(_0x28e727,_0x116d0b,_0x2c01e8,_0x156995,_0x4466b4){var _0x596c48={'$or':{'Phone':_0x156995}};var _0x4a4b52={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbf39('0x27')]()['then'](function(){logger[_0xbf39('0x25')](_0xbf39('0x2e'),_0x156995,_0x116d0b[_0xbf39('0x2f')]);switch(_0x116d0b['moduleSearch']){case _0xbf39('0x30'):var _0x1fff16=_['cloneDeep'](_0x596c48);if(_0x116d0b[_0xbf39('0x31')]){var _0x230400={};_0x230400[_0x116d0b[_0xbf39('0x31')]]=_0x156995;_[_0xbf39('0x32')](_0x1fff16['$or'],_0x230400);}return _0x4466b4[_0xbf39('0x1d')](_0xbf39('0x33'))[_0xbf39('0x23')](_0x1fff16,_0x4a4b52)['execute']()['then'](function(_0x53dba2){if(_0x53dba2&&_0x53dba2[_0xbf39('0x22')]){return _0x53dba2;}else{var _0x6a3e0c=_['cloneDeep'](_0x596c48);if(_0x116d0b['additionalSearchLead']){var _0x2a0877={};_0x2a0877[_0x116d0b[_0xbf39('0x34')]]=_0x156995;_[_0xbf39('0x32')](_0x6a3e0c[_0xbf39('0x35')],_0x2a0877);}return _0x4466b4[_0xbf39('0x1d')]('Lead')[_0xbf39('0x23')](_0x6a3e0c,_0x4a4b52);}});case _0xbf39('0x36'):var _0x32b2e0=_[_0xbf39('0x37')](_0x596c48);if(_0x116d0b['additionalSearchAccount']){var _0x230400={};_0x230400[_0x116d0b[_0xbf39('0x38')]]=_0x156995;_[_0xbf39('0x32')](_0x32b2e0[_0xbf39('0x35')],_0x230400);}return _0x4466b4[_0xbf39('0x1d')](_0xbf39('0x39'))[_0xbf39('0x23')](_0x32b2e0,_0x4a4b52)[_0xbf39('0x3a')]()[_0xbf39('0x2a')](function(_0x201309){if(_0x201309&&_0x201309[_0xbf39('0x22')]){return _0x201309;}else{var _0x573ac9=_[_0xbf39('0x37')](_0x596c48);if(_0x116d0b['additionalSearchContact']){var _0x443b53={};_0x443b53[_0x116d0b['additionalSearchContact']]=_0x156995;_[_0xbf39('0x32')](_0x573ac9[_0xbf39('0x35')],_0x443b53);}return _0x4466b4[_0xbf39('0x1d')]('Contact')[_0xbf39('0x23')](_0x573ac9,_0x4a4b52)[_0xbf39('0x2a')](function(_0x3d636e){if(_0x3d636e&&_0x3d636e[_0xbf39('0x22')]){return _0x3d636e;}else{var _0xc1a16e=_['cloneDeep'](_0x596c48);if(_0x116d0b['additionalSearchLead']){var _0x4dbb22={};_0x4dbb22[_0x116d0b[_0xbf39('0x34')]]=_0x156995;_['merge'](_0xc1a16e[_0xbf39('0x35')],_0x4dbb22);}return _0x4466b4[_0xbf39('0x1d')]('Lead')[_0xbf39('0x23')](_0xc1a16e,_0x4a4b52);}});}});case _0xbf39('0x14'):var _0x1fff16=_[_0xbf39('0x37')](_0x596c48);if(_0x116d0b[_0xbf39('0x31')]){var _0x230400={};_0x230400[_0x116d0b[_0xbf39('0x31')]]=_0x156995;_[_0xbf39('0x32')](_0x1fff16[_0xbf39('0x35')],_0x230400);}return _0x4466b4['sobject'](_0xbf39('0x33'))[_0xbf39('0x23')](_0x1fff16,_0x4a4b52)['execute']();case _0xbf39('0x1a'):var _0x73999d=_[_0xbf39('0x37')](_0x596c48);if(_0x116d0b[_0xbf39('0x34')]){var _0x230400={};_0x230400[_0x116d0b['additionalSearchLead']]=_0x156995;_[_0xbf39('0x32')](_0x73999d[_0xbf39('0x35')],_0x230400);}return _0x4466b4['sobject'](_0xbf39('0x3b'))[_0xbf39('0x23')](_0x73999d,_0x4a4b52);case _0xbf39('0x18'):var _0x32b2e0=_[_0xbf39('0x37')](_0x596c48);if(_0x116d0b['additionalSearchAccount']){var _0x230400={};_0x230400[_0x116d0b[_0xbf39('0x38')]]=_0x156995;_[_0xbf39('0x32')](_0x32b2e0['$or'],_0x230400);}return _0x4466b4[_0xbf39('0x1d')](_0xbf39('0x39'))['find'](_0x32b2e0,_0x4a4b52);default:return null;}})[_0xbf39('0x2a')](function(_0x3904e1){if(_0x3904e1&&_0x3904e1['length']){var _0x43bc1b=_['first'](_0x3904e1);if(_0x43bc1b){return BPromise['resolve']({'id':_0x43bc1b['Id'],'name':_0x43bc1b['Name'],'phone':_0x43bc1b[_0xbf39('0x3c')],'endUserType':_0x43bc1b['attributes']['type'][_0xbf39('0x3d')]()});}}})[_0xbf39('0x2a')](function(_0x58e246){if(_0x58e246){logger[_0xbf39('0x25')](_0xbf39('0x3e'),_0x58e246[_0xbf39('0x15')],_0x156995);return BPromise['resolve'](_0x58e246);}else{logger[_0xbf39('0x25')](_0xbf39('0x3f'),_0x156995);var _0x277ef8={'Phone':_0x156995};if(_0x116d0b['moduleCreate']){if(_0x116d0b[_0xbf39('0x40')]===_0xbf39('0x14')){logger[_0xbf39('0x25')](_0xbf39('0x41'),_0x156995,_0x116d0b[_0xbf39('0x40')]);_0x277ef8['LastName']=_0x2c01e8!==''?_0x2c01e8:util[_0xbf39('0x42')](_0xbf39('0x43'),_0x156995);}else if(_0x116d0b['moduleCreate']===_0xbf39('0x1a')){logger['info'](_0xbf39('0x41'),_0x156995,_0x116d0b[_0xbf39('0x40')]);_0x277ef8[_0xbf39('0x44')]=_0x2c01e8!==_0xbf39('0x45')?_0x2c01e8:util['format'](_0xbf39('0x43'),_0x156995);_0x277ef8[_0xbf39('0x46')]=_0xbf39('0x47');}else if(_0x116d0b[_0xbf39('0x40')]===_0xbf39('0x18')){logger['info'](_0xbf39('0x41'),_0x156995,_0x116d0b[_0xbf39('0x40')]);_0x277ef8[_0xbf39('0x28')]=_0x2c01e8!==''?_0x2c01e8:util[_0xbf39('0x42')](_0xbf39('0x43'),_0x156995);}else{return null;}}return _0x4466b4['sobject'](_['upperFirst'](_0x116d0b['moduleCreate']))[_0xbf39('0x1e')](_0x277ef8)[_0xbf39('0x2a')](function(_0x422fe5){return BPromise[_0xbf39('0x27')]({'id':_0x422fe5['id'],'endUserType':_0x116d0b[_0xbf39('0x40')]});});}});}function getCustomFields(_0x596628,_0x44eb93){var _0x16cbda={};if(_0x596628[_0xbf39('0x22')]>0x0){_[_0xbf39('0x48')](_0x596628,function(_0xcca65){if(_[_0xbf39('0x49')](['string',_0xbf39('0x4a')],_0xcca65[_0xbf39('0x4b')])&&_0xcca65[_0xbf39('0x4c')]){_0x16cbda[_0xcca65[_0xbf39('0x4c')]]=_0xcca65[_0xbf39('0x4d')][_0xbf39('0x4e')]();}else if(_0xcca65[_0xbf39('0x4b')]===_0xbf39('0x4f')&&_0xcca65[_0xbf39('0x50')]&&_0xcca65[_0xbf39('0x4c')]){_0x44eb93[_0xcca65['variableName']]&&(_0x16cbda[_0xcca65[_0xbf39('0x4c')]]=_0x44eb93[_0xcca65[_0xbf39('0x50')]][_0xbf39('0x4e')]());}else if(_0xcca65[_0xbf39('0x4b')]===_0xbf39('0x51')&&_0xcca65['Variable']&&_0xcca65[_0xbf39('0x52')][_0xbf39('0x53')]&&_0xcca65[_0xbf39('0x4c')]){_0x44eb93[_0xcca65[_0xbf39('0x52')][_0xbf39('0x53')]['toLowerCase']()]&&(_0x16cbda[_0xcca65[_0xbf39('0x4c')]]=_0x44eb93[_0xcca65['Variable'][_0xbf39('0x53')][_0xbf39('0x3d')]()][_0xbf39('0x4e')]());}});}return _0x16cbda;}function getConnection(_0x486488){var _0x294ca6=_0x486488[_0xbf39('0x54')]['concat'](_0x486488['securityToken']);var _0xe8e67b=new jsforce[(_0xbf39('0x55'))]({'oauth2':{'loginUrl':_0x486488['remoteUri']||_0xbf39('0x56'),'clientId':_0x486488[_0xbf39('0x57')],'clientSecret':_0x486488[_0xbf39('0x58')]}});return _0xe8e67b['login'](_0x486488[_0xbf39('0x59')],_0x294ca6)[_0xbf39('0x2a')](function(){logger[_0xbf39('0x25')](_0xbf39('0x5a'));return _0xe8e67b;});}exports['queue']=function(_0x58ba61,_0x29ecae,_0x504703,_0x2eb44b,_0x3981f9,_0x48cd8c){var _0x56bb78,_0x35118a,_0x4013f6,_0x50cc3c;_0x48cd8c[_0xbf39('0x5b')]=intUtil['stripTrailingSlash'](_0x48cd8c[_0xbf39('0x5b')]);_0x48cd8c['remoteUri']=intUtil[_0xbf39('0x5c')](_0x48cd8c['remoteUri']);if(_0x3981f9&&_0x3981f9[_0xbf39('0x5d')]){logger[_0xbf39('0x25')](_0xbf39('0x5e'),_0xbf39('0x5f'));_0x29ecae['recordingURL']=util['format'](_0xbf39('0x60'),_0x48cd8c[_0xbf39('0x5b')],_0x29ecae[_0xbf39('0x61')],md5(_0x29ecae[_0xbf39('0x61')]));}else{_0x29ecae[_0xbf39('0x62')]='';}return getConnection(_0x48cd8c)[_0xbf39('0x2a')](function(_0x5050d3){_0x50cc3c=_0x5050d3;return getUser(_0x48cd8c,_0x2eb44b[_0xbf39('0x63')],_0x50cc3c);})[_0xbf39('0x2a')](function(_0x1e5f44){_0x56bb78=_0x1e5f44;return getEndUser(_0x48cd8c,_0x504703,_0x29ecae[_0xbf39('0x64')],_0x29ecae[_0xbf39('0x65')],_0x50cc3c);})[_0xbf39('0x2a')](function(_0x2063cb){_0x35118a=_0x2063cb;return getTicket(_0x48cd8c,_0x56bb78,_0x35118a,_0x504703,_0x29ecae,_0x504703[_0xbf39('0x66')],_0x50cc3c,_0xbf39('0x67'));})['then'](function(_0x2f4965){_0x4013f6=_0x2f4965;logger[_0xbf39('0x25')](_0xbf39('0x68'),_0x4013f6['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4013f6['id'],_0x2eb44b[_0xbf39('0x53')],_0x48cd8c[_0xbf39('0x4b')]);switch(_0x48cd8c['type']){case _0xbf39('0x69'):emit(util[_0xbf39('0x42')]('user:%s',_0x2eb44b['name']),'trigger:salesforce:display',{'recordId':_0x4013f6['id']});break;case _0xbf39('0x6a'):emit(util[_0xbf39('0x42')](_0xbf39('0x6b'),_0x2eb44b['name']),'trigger:browser:url',{'uri':util[_0xbf39('0x42')](_0xbf39('0x6c'),_0x50cc3c['instanceUrl'],_0x4013f6['id'])});break;default:logger[_0xbf39('0x6d')](_0xbf39('0x6e'));}})[_0xbf39('0x6f')](function(_0x26c8ed){logger['error'](_0xbf39('0x5e'),_0x26c8ed);});};exports[_0xbf39('0x70')]=function(_0x2d7fe7,_0x5c802a,_0x5c85a9,_0x28f4f0,_0x32024c,_0x3ab154,_0x59b0cc){var _0x37ac2c,_0x2c201d,_0x53af84,_0x130abe;_0x3ab154[_0xbf39('0x5b')]=intUtil[_0xbf39('0x5c')](_0x3ab154['serverUrl']);_0x3ab154[_0xbf39('0x71')]=intUtil['stripTrailingSlash'](_0x3ab154[_0xbf39('0x71')]);if(_0x59b0cc&&_0x59b0cc[_0xbf39('0x72')]&&_0x59b0cc[_0xbf39('0x72')]!==_0xbf39('0x73')){logger[_0xbf39('0x25')]('[OUTBOUND]',_0xbf39('0x5f'));_0x5c802a[_0xbf39('0x62')]=util[_0xbf39('0x42')](_0xbf39('0x60'),_0x3ab154[_0xbf39('0x5b')],_0x5c802a[_0xbf39('0x61')],md5(_0x5c802a[_0xbf39('0x61')]));}return getConnection(_0x3ab154)[_0xbf39('0x2a')](function(_0x522078){_0x130abe=_0x522078;return getUser(_0x3ab154,_0x28f4f0['email'],_0x130abe);})[_0xbf39('0x2a')](function(_0x177e77){_0x37ac2c=_0x177e77;return getEndUser(_0x3ab154,_0x5c85a9,_0x5c802a[_0xbf39('0x74')],_0x5c802a['destcalleridnum'],_0x130abe);})[_0xbf39('0x2a')](function(_0x4389d4){_0x2c201d=_0x4389d4;return getTicket(_0x3ab154,_0x37ac2c,_0x2c201d,_0x5c85a9,_0x5c802a,_0x5c85a9['Fields'],_0x130abe,_0xbf39('0x70'));})[_0xbf39('0x2a')](function(_0xe48349){_0x53af84=_0xe48349;logger[_0xbf39('0x25')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x53af84['id']);logger[_0xbf39('0x25')](_0xbf39('0x75'),_0x53af84['id'],_0x28f4f0['name'],_0x3ab154[_0xbf39('0x4b')]);switch(_0x3ab154[_0xbf39('0x4b')]){case _0xbf39('0x69'):emit(util[_0xbf39('0x42')](_0xbf39('0x6b'),_0x28f4f0['name']),_0xbf39('0x76'),{'recordId':_0x53af84['id']});break;case _0xbf39('0x6a'):emit(util['format'](_0xbf39('0x6b'),_0x28f4f0[_0xbf39('0x53')]),_0xbf39('0x77'),{'uri':util[_0xbf39('0x42')](_0xbf39('0x6c'),_0x130abe[_0xbf39('0x78')],_0x53af84['id'])});break;default:logger['error'](_0xbf39('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbf39('0x6f')](function(_0x10fd9b){logger['error']('[OUTBOUND]',_0x10fd9b);});};exports['unmanaged']=function(_0x1a1625,_0x730b9c,_0x95d127,_0x1de15b,_0x32679e,_0x1347df){var _0x1a17be,_0x161814,_0x53f91d,_0x131643;_0x1347df[_0xbf39('0x5b')]=intUtil['stripTrailingSlash'](_0x1347df[_0xbf39('0x5b')]);_0x1347df[_0xbf39('0x71')]=intUtil[_0xbf39('0x5c')](_0x1347df[_0xbf39('0x71')]);if(_0x32679e&&_0x32679e[_0xbf39('0x5d')]){logger[_0xbf39('0x25')]('['+_0x730b9c['lastevent'][_0xbf39('0x7a')]()+']','Recording\x20is\x20enabled!');_0x730b9c[_0xbf39('0x62')]=util[_0xbf39('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1347df[_0xbf39('0x5b')],_0x730b9c[_0xbf39('0x61')],md5(_0x730b9c[_0xbf39('0x61')]));}else{_0x730b9c[_0xbf39('0x62')]='';}return getConnection(_0x1347df)['then'](function(_0x168a19){_0x131643=_0x168a19;if(!_[_0xbf39('0x1f')](_0x1de15b)){return getUser(_0x1347df,_0x1de15b['name'],_0x131643);}else{return getUser(_0x1347df,null,_0x131643);}})[_0xbf39('0x2a')](function(_0x5d33c2){_0x1a17be=_0x5d33c2;return getEndUser(_0x1347df,_0x95d127,_0x730b9c[_0xbf39('0x64')],_0x730b9c[_0xbf39('0x65')],_0x131643);})[_0xbf39('0x2a')](function(_0x5daf3a){_0x161814=_0x5daf3a;return getTicket(_0x1347df,_0x1a17be,_0x161814,_0x95d127,_0x730b9c,_0x95d127[_0xbf39('0x66')],_0x131643);})[_0xbf39('0x2a')](function(_0x473bee){_0x53f91d=_0x473bee;logger[_0xbf39('0x25')]('['+_0x730b9c[_0xbf39('0x7b')][_0xbf39('0x7a')]()+_0xbf39('0x7c'),_0x53f91d['id']);logger['info']('['+_0x730b9c[_0xbf39('0x7b')]['toUpperCase']()+_0xbf39('0x7d'),_0x1347df[_0xbf39('0x4b')]);})[_0xbf39('0x6f')](function(_0x1a1358){logger[_0xbf39('0x6d')]('['+_0x730b9c[_0xbf39('0x7b')][_0xbf39('0x7a')]()+']',_0x1a1358);});}; \ 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 9f32e68..0dff97a 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 _0x5f96=['toUpperCase','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','error',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','ticketId','Incident\x20-\x20','push','all','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info'];(function(_0x5e5667,_0x2d9326){var _0x249ae2=function(_0x2d5625){while(--_0x2d5625){_0x5e5667['push'](_0x5e5667['shift']());}};_0x249ae2(++_0x2d9326);}(_0x5f96,0xbc));var _0x65f9=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x5f96[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x65f9('0x0'));var Promise=require(_0x65f9('0x1'));var rp=require(_0x65f9('0x2'));var util=require('util');var md5=require(_0x65f9('0x3'));var Redis=require(_0x65f9('0x4'));var intUtil=require(_0x65f9('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x65f9('0x6')]=_['defaults'](config[_0x65f9('0x6')],{'host':_0x65f9('0x7'),'port':0x18eb});var io=require(_0x65f9('0x8'))(new Redis(config[_0x65f9('0x6')]));function getAdminUser(_0x33c967,_0xa0ce52,_0x44ab39,_0x3f93db,_0x17bf55,_0x377f55){return new Promise(function(_0x313d30,_0x6d1b48){var _0x15829a={'method':_0x65f9('0x9'),'uri':_0x3f93db+_0x65f9('0xa')+'&'+_0x17bf55+'&'+_0x377f55,'auth':_0xa0ce52,'json':!![]};return rp(_0x15829a)[_0x65f9('0xb')](function(_0x2f1182){if(_0x2f1182[_0x65f9('0xc')][_0x65f9('0xd')]>0x0){_0x44ab39['adminId']=_0x2f1182[_0x65f9('0xc')][0x0][_0x65f9('0xe')];}logger[_0x65f9('0xf')]('['+[_0x33c967[_0x65f9('0x10')]()]+'],\x20getAdminUser\x20crm',_0x44ab39);_0x313d30(_0x44ab39);})[_0x65f9('0x11')](function(_0x5b6393){logger['error']('['+[_0x33c967[_0x65f9('0x10')]()]+']',_0x5b6393[_0x65f9('0x12')]);_0x6d1b48(_0x5b6393[_0x65f9('0x12')]);});});}function getUser(_0x2db834,_0x190907,_0x561a36,_0x20e773,_0x32bd22){return function(_0x4e9327){logger[_0x65f9('0xf')]('['+[_0x2db834[_0x65f9('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x4e9327);return new Promise(function(_0x205f34,_0x57bd2c){if(intUtil[_0x65f9('0x13')](_0x4e9327[_0x65f9('0x14')])){var _0x5d60be={'method':_0x65f9('0x9'),'uri':_0x561a36+_0x65f9('0x15')+_0x4e9327[_0x65f9('0x14')]+'&'+_0x20e773+'&'+_0x32bd22,'auth':_0x190907,'json':!![]};logger[_0x65f9('0xf')]('['+[_0x2db834[_0x65f9('0x10')]()]+_0x65f9('0x16'),_0x5d60be);return rp(_0x5d60be)[_0x65f9('0xb')](function(_0x30f456){logger[_0x65f9('0xf')]('['+[_0x2db834[_0x65f9('0x10')]()]+_0x65f9('0x17'),_0x30f456);if(_0x30f456[_0x65f9('0xc')][_0x65f9('0xd')]>0x0&&String(_0x30f456[_0x65f9('0xc')][0x0][_0x65f9('0x18')])===_0x65f9('0x19')){_0x4e9327[_0x65f9('0x1a')]=_0x30f456['result'][0x0][_0x65f9('0xe')];}else{_0x4e9327[_0x65f9('0x1a')]=_0x4e9327['adminId'];_0x4e9327[_0x65f9('0x14')]=_0x4e9327[_0x65f9('0x1b')];}logger['info']('['+[_0x2db834[_0x65f9('0x10')]()]+'],\x20getUser\x20crm',_0x4e9327);_0x205f34(_0x4e9327);})[_0x65f9('0x11')](function(_0x3ade33){logger[_0x65f9('0x1c')]('['+[_0x2db834['toUpperCase']()]+']',_0x3ade33[_0x65f9('0x12')]);_0x57bd2c(_0x3ade33[_0x65f9('0x12')]);});}else{logger[_0x65f9('0xf')]('['+[_0x2db834[_0x65f9('0x10')]()]+_0x65f9('0x1d'));_0x4e9327['userId']=_0x4e9327[_0x65f9('0x1e')];_0x4e9327[_0x65f9('0x14')]=_0x4e9327['adminEmail'];_0x205f34(_0x4e9327);}});};}function createEndUser(_0x5a44b1,_0x4c5d91,_0x5e0af2,_0x1c778c,_0x1b43c5){logger['info']('['+[_0x5a44b1[_0x65f9('0x10')]()]+_0x65f9('0x1f'),_0x5e0af2);return new Promise(function(_0x1c6ee8,_0x543ffc){var _0x5c5852={'method':_0x65f9('0x20'),'uri':_0x1c778c+_0x65f9('0x21')+_0x1b43c5,'body':{'user_name':_0x5e0af2[_0x65f9('0x22')],'roles':_0x65f9('0x23'),'first_name':_0x5e0af2[_0x65f9('0x22')],'active':_0x65f9('0x19'),'date_format':_0x65f9('0x24'),'phone':_0x5e0af2[_0x65f9('0x22')]},'auth':_0x4c5d91,'json':!![]};return rp(_0x5c5852)[_0x65f9('0xb')](function(_0x448c8e){logger[_0x65f9('0xf')]('['+[_0x5a44b1[_0x65f9('0x10')]()]+_0x65f9('0x25'),_0x448c8e[_0x65f9('0xc')]);_0x5e0af2['endUserId']=_0x448c8e[_0x65f9('0xc')][_0x65f9('0xe')];_0x1c6ee8(_0x5e0af2);})[_0x65f9('0x11')](function(_0x5c7fb9){logger['error']('['+[_0x5a44b1[_0x65f9('0x10')]()]+']',_0x5c7fb9[_0x65f9('0x12')]);_0x543ffc(_0x5c7fb9[_0x65f9('0x12')]);});});}function getEndUser(_0x1d6b56,_0x146e42,_0x49c741,_0x250b49,_0x4ee84d){return function(_0x2e4098){logger[_0x65f9('0xf')]('['+[_0x1d6b56['toUpperCase']()]+_0x65f9('0x26'),_0x2e4098);return new Promise(function(_0x46c2f9,_0x49d609){var _0x137736={'method':_0x65f9('0x9'),'uri':_0x49c741+_0x65f9('0x27')+_0x2e4098[_0x65f9('0x22')]+'&'+_0x250b49+'&'+_0x4ee84d,'auth':_0x146e42,'json':!![]};return rp(_0x137736)[_0x65f9('0xb')](function(_0x378ad9){if(_0x378ad9[_0x65f9('0xc')][_0x65f9('0xd')]>0x0){_0x2e4098['endUserId']=_0x378ad9[_0x65f9('0xc')][0x0][_0x65f9('0xe')];logger[_0x65f9('0xf')]('['+[_0x1d6b56[_0x65f9('0x10')]()]+_0x65f9('0x28'),_0x2e4098);_0x46c2f9(_0x2e4098);}else{return createEndUser(_0x1d6b56,_0x146e42,_0x2e4098,_0x49c741,_0x250b49)[_0x65f9('0xb')](function(_0x31d64e){logger['info']('['+[_0x1d6b56['toUpperCase']()]+_0x65f9('0x29'),_0x31d64e);_0x46c2f9(_0x31d64e);});}})[_0x65f9('0x11')](function(_0x4a2d9d){logger[_0x65f9('0x1c')]('['+[_0x1d6b56['toUpperCase']()]+']',_0x4a2d9d[_0x65f9('0x12')]);_0x49d609(_0x4a2d9d[_0x65f9('0x12')]);});});};}function getCustomFields(_0x549d00,_0x4c9b58){var _0x4978b0={};if(_0x549d00['length']>0x0){_[_0x65f9('0x2a')](_0x549d00,function(_0x4f1573){if(_[_0x65f9('0x2b')](['string',_0x65f9('0x2c')],_0x4f1573[_0x65f9('0x2d')])&&_0x4f1573[_0x65f9('0x2e')]&&!_0x4f1573[_0x65f9('0x2f')]){_0x4978b0[_0x4f1573[_0x65f9('0x2e')][_0x65f9('0x30')]()]=_0x4f1573[_0x65f9('0x31')][_0x65f9('0x32')]();}else if(_[_0x65f9('0x2b')](['string',_0x65f9('0x2c')],_0x4f1573[_0x65f9('0x2d')])&&_0x4f1573[_0x65f9('0x33')]&&_0x4f1573[_0x65f9('0x2f')]){_0x4978b0[_0x4f1573['idField'][_0x65f9('0x30')]()]=_0x4f1573[_0x65f9('0x31')]['toString']();}else if(_0x4f1573[_0x65f9('0x2d')]==='variable'&&_0x4f1573[_0x65f9('0x34')]&&_0x4f1573[_0x65f9('0x33')]&&_0x4f1573[_0x65f9('0x2f')]){_0x4978b0[_0x4f1573[_0x65f9('0x33')][_0x65f9('0x30')]()]=_0x4c9b58[_0x4f1573[_0x65f9('0x34')]][_0x65f9('0x32')]();}else if(_0x4f1573[_0x65f9('0x2d')]===_0x65f9('0x35')&&_0x4f1573[_0x65f9('0x36')]&&_0x4f1573['Variable']['name']&&_0x4f1573[_0x65f9('0x33')]&&_0x4f1573['customField']){_0x4978b0[_0x4f1573['idField'][_0x65f9('0x30')]()]=_0x4c9b58[_0x4f1573[_0x65f9('0x36')][_0x65f9('0x37')][_0x65f9('0x30')]()][_0x65f9('0x32')]();}});}return _0x4978b0;}function getTicket(_0x2baee2,_0x2162fd,_0x24e445,_0x3e9659,_0x5310f5,_0x3f034b){return function(_0x3b691c){logger['info']('['+[_0x2baee2['toUpperCase']()]+_0x65f9('0x38'),_0x3b691c);return new Promise(function(_0x2fabf5,_0x4feab3){var _0x1e0b04=_0x2baee2[_0x65f9('0x30')]()==='outbound'?_0x3b691c[_0x65f9('0x1a')]:_0x3b691c['endUserId'];var _0x1f39c9={'method':_0x65f9('0x20'),'uri':_0x24e445+_0x65f9('0x39')+'?'+_0x3f034b,'body':Object[_0x65f9('0x3a')]({},{'active':_0x65f9('0x19'),'caller_id':_0x1e0b04,'assigned_to':_0x3b691c['userId'],'short_description':intUtil[_0x65f9('0x3b')](_0x3e9659[_0x65f9('0x3c')],_0x5310f5,'\x20'),'description':intUtil[_0x65f9('0x3b')](_0x3e9659['Descriptions'],_0x5310f5,'\x0a')},getCustomFields(_0x3e9659[_0x65f9('0x3d')],_0x5310f5)),'auth':_0x2162fd,'json':!![]};return rp(_0x1f39c9)['then'](function(_0x6bc1c0){logger[_0x65f9('0xf')]('['+[_0x2baee2[_0x65f9('0x10')]()]+_0x65f9('0x3e'),_0x6bc1c0[_0x65f9('0xc')]);_0x3b691c['ticketId']=_0x6bc1c0[_0x65f9('0xc')]['sys_id'];_0x3b691c[_0x65f9('0x3f')]=_0x6bc1c0[_0x65f9('0xc')][_0x65f9('0x40')];logger[_0x65f9('0xf')]('['+[_0x2baee2[_0x65f9('0x10')]()]+']\x20getTicket\x20crm',_0x3b691c);_0x2fabf5(_0x3b691c);})['catch'](function(_0x16116a){logger['error']('['+[_0x2baee2[_0x65f9('0x10')]()]+']',_0x16116a[_0x65f9('0x12')]);_0x4feab3(_0x16116a[_0x65f9('0x12')]);});});};}function createRemoteTag(_0x2a4909,_0x125f24,_0x52751f,_0x3a86a0){return new Promise(function(_0x2bc631,_0x32ca72){var _0x16af89={'method':'POST','uri':_0x52751f+'label'+'?'+_0x3a86a0,'body':{'short_description':_0x2a4909,'global':!![],'active':!![],'name':_0x2a4909},'auth':_0x125f24,'json':!![]};return rp(_0x16af89)[_0x65f9('0xb')](function(_0x5eb08f){var _0x303185=_0x5eb08f['result']['sys_id'];_0x2bc631(_0x303185);});});}function getRemoteTag(_0x11bb96,_0x227171,_0x1fd25f,_0x28bb4d,_0x49cc40){return new Promise(function(_0x3ab7aa,_0x44eca0){var _0x2d730d={'method':_0x65f9('0x9'),'uri':_0x1fd25f+_0x65f9('0x41')+_0x65f9('0x42')+_0x11bb96+'&'+_0x28bb4d,'auth':_0x227171,'json':!![]};return rp(_0x2d730d)['then'](function(_0x535c93){if(_0x535c93[_0x65f9('0xc')]['length']>0x0){var _0x230613=_0x535c93[_0x65f9('0xc')][0x0]['sys_id'];_0x3ab7aa(_0x230613);}else{return createRemoteTag(_0x11bb96,_0x227171,_0x1fd25f,_0x28bb4d)[_0x65f9('0xb')](function(_0x56abe8){_0x3ab7aa(_0x56abe8);});}});});}function assignTagToIncident(_0x1a7fe1,_0x1769a8,_0x378e04,_0x1c62d1,_0x5e3116){return new Promise(function(_0x21ee08,_0x348520){var _0x3aa04a={'method':_0x65f9('0x20'),'uri':_0x378e04+'label_entry'+'?'+_0x5e3116,'body':{'label':_0x1a7fe1,'table':_0x65f9('0x39'),'id_type':'Incident','table_key':_0x1c62d1[_0x65f9('0x43')],'title':_0x65f9('0x44')+_0x1c62d1[_0x65f9('0x3f')],'id_display':_0x1c62d1['ticketNumber']},'auth':_0x1769a8,'json':!![]};return rp(_0x3aa04a)[_0x65f9('0xb')](function(_0x1e925a){_0x21ee08();})[_0x65f9('0x11')](function(){_0x21ee08();});});}function manageTags(_0x2f7bd6,_0x1448c2,_0x5b6685,_0x33e916,_0xf2e21a,_0x361b1e,_0x5854da){return new Promise(function(_0x46a22b,_0x125437){var _0x4b2c50=[];_0x1448c2[_0x65f9('0x2a')](function(_0x247c92){_0x4b2c50[_0x65f9('0x45')](getRemoteTag(_0x247c92,_0x5b6685,_0x33e916,_0x361b1e,_0x5854da));});return Promise['all'](_0x4b2c50)[_0x65f9('0xb')](function(_0xe2854d){if(_0xe2854d['length']){logger['info']('['+[_0x2f7bd6[_0x65f9('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xe2854d);var _0x112451=[];_0xe2854d[_0x65f9('0x2a')](function(_0x4552f4){_0x112451[_0x65f9('0x45')](assignTagToIncident(_0x4552f4,_0x5b6685,_0x33e916,_0xf2e21a,_0x361b1e));});return Promise[_0x65f9('0x46')](_0x112451)[_0x65f9('0xb')](function(){_0x46a22b();})[_0x65f9('0x11')](function(){_0x46a22b();});}else{_0x46a22b();}});});}function getTags(_0x326900,_0x5c3d1f,_0x20f36e,_0xb07fc7,_0x4be6d2,_0x1cbdd9){return function(_0x2d35d2){return new Promise(function(_0x5a59dc,_0x4e349f){var _0x2d5ad8=[];var _0x3f00fe=_0xb07fc7['Tags'];if(_0x3f00fe&&_0x3f00fe['length']>0x0){_0x2d5ad8=_['map'](_0x3f00fe,_0x65f9('0x37'));}if(_0x2d5ad8[_0x65f9('0xd')]>0x0){return manageTags(_0x326900,_0x2d5ad8,_0x5c3d1f,_0x20f36e,_0x2d35d2,_0x4be6d2,_0x1cbdd9)[_0x65f9('0xb')](function(){_0x5a59dc(_0x2d35d2);});}else{_0x5a59dc(_0x2d35d2);}});};}function emit(_0x57d7a0,_0x15f3cd,_0x152bc6){var _0x4abea3=_0x65f9('0x47')+_0x65f9('0x48')+_0x65f9('0x49')+'%255EORDERBYDESCnumber';var _0x467a9c={'uri':_0x57d7a0+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x152bc6+_0x4abea3};io['to'](util[_0x65f9('0x4a')](_0x65f9('0x4b'),_0x15f3cd))[_0x65f9('0x4c')](_0x65f9('0x4d'),_0x467a9c);}exports['cs']=function(_0x333ddf,_0x493c24,_0x1c63c2,_0x3ec1d4,_0x294dbc,_0x494645,_0x377c6f,_0x1313f9){var _0xc8395c={};var _0x430190={'user':_0x494645[_0x65f9('0x4e')],'pass':_0x494645[_0x65f9('0x4f')]};var _0xfe9aa3='sysparm_limit=1';var _0x1175f2=_0x65f9('0x50');_0x494645[_0x65f9('0x51')]=intUtil['stripTrailingSlash'](_0x494645['remoteUri']);_0x494645[_0x65f9('0x52')]=intUtil[_0x65f9('0x53')](_0x494645[_0x65f9('0x52')]);var _0x488fcf=util[_0x65f9('0x4a')](_0x65f9('0x54'),_0x494645['remoteUri']);_0xc8395c[_0x65f9('0x14')]=!_[_0x65f9('0x55')](_0x3ec1d4)?_0x3ec1d4[_0x65f9('0x56')]:null;_0xc8395c[_0x65f9('0x1b')]=_0x494645['email'];_0xc8395c[_0x65f9('0x22')]=_0x1313f9[_0x65f9('0x30')]()===_0x65f9('0x57')?_0x493c24[_0x65f9('0x58')]:_0x493c24[_0x65f9('0x59')];_0xc8395c[_0x65f9('0x5a')]=_0x1313f9===_0x65f9('0x5b')||_0x1313f9===_0x65f9('0x5c')?_0x65f9('0x5b'):_0x65f9('0x57');var _0x361597=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x494645[_0x65f9('0x52')],_0x493c24['uniqueid'],md5(_0x493c24[_0x65f9('0x5d')]));if(_0x294dbc&&_0x294dbc[_0x65f9('0x5e')]){logger[_0x65f9('0xf')]('[QUEUE]',_0x65f9('0x5f'));_0x493c24['recordingURL']=_0x361597;}else if(_0x377c6f&&_0x377c6f[_0x65f9('0x60')]&&_0x377c6f[_0x65f9('0x60')]!=='none'){logger[_0x65f9('0xf')]('[OUTBOUND]',_0x65f9('0x5f'));_0x493c24[_0x65f9('0x61')]=_0x361597;}else{_0x493c24[_0x65f9('0x61')]='';}return getAdminUser(_0x1313f9,_0x430190,_0xc8395c,_0x488fcf,_0x1175f2,_0xfe9aa3)[_0x65f9('0xb')](getUser(_0x1313f9,_0x430190,_0x488fcf,_0x1175f2,_0xfe9aa3))['then'](getEndUser(_0x1313f9,_0x430190,_0x488fcf,_0x1175f2,_0xfe9aa3))[_0x65f9('0xb')](getTicket(_0x1313f9,_0x430190,_0x488fcf,_0x1c63c2,_0x493c24,_0x1175f2))[_0x65f9('0xb')](function(_0x1eca7e){logger[_0x65f9('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x1eca7e[_0x65f9('0x43')]));logger[_0x65f9('0xf')](util['format'](_0x65f9('0x62'),_0x1313f9));if(_0x1313f9!=='unmanaged'){logger['info']('['+[_0x1313f9[_0x65f9('0x10')]()]+']',_0x65f9('0x63'));emit(_0x494645[_0x65f9('0x51')],_0x3ec1d4['name'],_0x1eca7e['ticketId']);}})[_0x65f9('0x11')](function(_0x1c9a2d){logger[_0x65f9('0x1c')]('['+[_0x1313f9['toUpperCase']()]+_0x65f9('0x64'),util[_0x65f9('0x65')](_0x1c9a2d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xde51=['format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','result','active','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20getEndUser\x20input\x20crm','sys_id','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','toLowerCase','content','toString','idField','customField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','true','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','label','label_entry','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber'];(function(_0x417081,_0x400fb0){var _0x443b7c=function(_0x3de2c4){while(--_0x3de2c4){_0x417081['push'](_0x417081['shift']());}};_0x443b7c(++_0x400fb0);}(_0xde51,0xe7));var _0x1de5=function(_0x5857a7,_0x3f8601){_0x5857a7=_0x5857a7-0x0;var _0x2c35e4=_0xde51[_0x5857a7];return _0x2c35e4;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x1de5('0x0'));var util=require(_0x1de5('0x1'));var md5=require(_0x1de5('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1de5('0x3'));var logger=require(_0x1de5('0x4'))(_0x1de5('0x5'));config['redis']=_[_0x1de5('0x6')](config[_0x1de5('0x7')],{'host':_0x1de5('0x8'),'port':0x18eb});var io=require(_0x1de5('0x9'))(new Redis(config[_0x1de5('0x7')]));function getAdminUser(_0x2b1767,_0x178332,_0x42a879,_0x4e9db0,_0x4190b6,_0x514615){return new Promise(function(_0x5c7d13,_0x175bd0){var _0x5e8885={'method':_0x1de5('0xa'),'uri':_0x4e9db0+_0x1de5('0xb')+'&'+_0x4190b6+'&'+_0x514615,'auth':_0x178332,'json':!![]};return rp(_0x5e8885)[_0x1de5('0xc')](function(_0x3d8bc8){if(_0x3d8bc8['result'][_0x1de5('0xd')]>0x0){_0x42a879[_0x1de5('0xe')]=_0x3d8bc8['result'][0x0]['sys_id'];}logger[_0x1de5('0xf')]('['+[_0x2b1767[_0x1de5('0x10')]()]+'],\x20getAdminUser\x20crm',_0x42a879);_0x5c7d13(_0x42a879);})[_0x1de5('0x11')](function(_0x295d94){logger[_0x1de5('0x12')]('['+[_0x2b1767[_0x1de5('0x10')]()]+']',_0x295d94[_0x1de5('0x13')]);_0x175bd0(_0x295d94[_0x1de5('0x13')]);});});}function getUser(_0xfa5045,_0x3114dc,_0x4a2e17,_0x5e1737,_0x10cbbe){return function(_0x2af2ed){logger['info']('['+[_0xfa5045[_0x1de5('0x10')]()]+_0x1de5('0x14'),_0x2af2ed);return new Promise(function(_0x29db94,_0x298b17){if(intUtil[_0x1de5('0x15')](_0x2af2ed['userEmail'])){var _0x4e9860={'method':'GET','uri':_0x4a2e17+_0x1de5('0x16')+_0x2af2ed[_0x1de5('0x17')]+'&'+_0x5e1737+'&'+_0x10cbbe,'auth':_0x3114dc,'json':!![]};logger[_0x1de5('0xf')]('['+[_0xfa5045[_0x1de5('0x10')]()]+_0x1de5('0x18'),_0x4e9860);return rp(_0x4e9860)[_0x1de5('0xc')](function(_0x50a68e){logger[_0x1de5('0xf')]('['+[_0xfa5045[_0x1de5('0x10')]()]+'],\x20getUser\x20entity',_0x50a68e);if(_0x50a68e[_0x1de5('0x19')]['length']>0x0&&String(_0x50a68e['result'][0x0][_0x1de5('0x1a')])==='true'){_0x2af2ed[_0x1de5('0x1b')]=_0x50a68e[_0x1de5('0x19')][0x0]['sys_id'];}else{_0x2af2ed[_0x1de5('0x1b')]=_0x2af2ed['adminId'];_0x2af2ed[_0x1de5('0x17')]=_0x2af2ed['adminEmail'];}logger['info']('['+[_0xfa5045['toUpperCase']()]+_0x1de5('0x1c'),_0x2af2ed);_0x29db94(_0x2af2ed);})[_0x1de5('0x11')](function(_0x3760a3){logger[_0x1de5('0x12')]('['+[_0xfa5045[_0x1de5('0x10')]()]+']',_0x3760a3['message']);_0x298b17(_0x3760a3[_0x1de5('0x13')]);});}else{logger[_0x1de5('0xf')]('['+[_0xfa5045[_0x1de5('0x10')]()]+_0x1de5('0x1d'));_0x2af2ed['userId']=_0x2af2ed[_0x1de5('0xe')];_0x2af2ed['userEmail']=_0x2af2ed['adminEmail'];_0x29db94(_0x2af2ed);}});};}function createEndUser(_0x18d320,_0x3d3b9f,_0x40b0a0,_0x9db5de,_0x2860ed){logger[_0x1de5('0xf')]('['+[_0x18d320[_0x1de5('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x40b0a0);return new Promise(function(_0x315f89,_0x343e1c){var _0x25ac49={'method':_0x1de5('0x1e'),'uri':_0x9db5de+_0x1de5('0x1f')+_0x2860ed,'body':{'user_name':_0x40b0a0[_0x1de5('0x20')],'roles':_0x1de5('0x21'),'first_name':_0x40b0a0[_0x1de5('0x20')],'active':'true','date_format':_0x1de5('0x22'),'phone':_0x40b0a0[_0x1de5('0x20')]},'auth':_0x3d3b9f,'json':!![]};return rp(_0x25ac49)[_0x1de5('0xc')](function(_0xee66c8){logger[_0x1de5('0xf')]('['+[_0x18d320[_0x1de5('0x10')]()]+'],\x20EndUser\x20schema',_0xee66c8[_0x1de5('0x19')]);_0x40b0a0['endUserId']=_0xee66c8[_0x1de5('0x19')]['sys_id'];_0x315f89(_0x40b0a0);})[_0x1de5('0x11')](function(_0x1346e6){logger['error']('['+[_0x18d320[_0x1de5('0x10')]()]+']',_0x1346e6[_0x1de5('0x13')]);_0x343e1c(_0x1346e6[_0x1de5('0x13')]);});});}function getEndUser(_0x530b56,_0x4f9f46,_0x2153c5,_0x242aa1,_0x50acda){return function(_0x5d2b46){logger[_0x1de5('0xf')]('['+[_0x530b56['toUpperCase']()]+_0x1de5('0x23'),_0x5d2b46);return new Promise(function(_0x2146b1,_0xb25543){var _0x26ddf1={'method':_0x1de5('0xa'),'uri':_0x2153c5+'sys_user?sysparm_query=phone%3D'+_0x5d2b46[_0x1de5('0x20')]+'&'+_0x242aa1+'&'+_0x50acda,'auth':_0x4f9f46,'json':!![]};return rp(_0x26ddf1)[_0x1de5('0xc')](function(_0xd1e6b5){if(_0xd1e6b5[_0x1de5('0x19')][_0x1de5('0xd')]>0x0){_0x5d2b46['endUserId']=_0xd1e6b5[_0x1de5('0x19')][0x0][_0x1de5('0x24')];logger[_0x1de5('0xf')]('['+[_0x530b56['toUpperCase']()]+_0x1de5('0x25'),_0x5d2b46);_0x2146b1(_0x5d2b46);}else{return createEndUser(_0x530b56,_0x4f9f46,_0x5d2b46,_0x2153c5,_0x242aa1)[_0x1de5('0xc')](function(_0x3f3022){logger['info']('['+[_0x530b56[_0x1de5('0x10')]()]+'],\x20createEndUser\x20crm',_0x3f3022);_0x2146b1(_0x3f3022);});}})[_0x1de5('0x11')](function(_0x9181b3){logger[_0x1de5('0x12')]('['+[_0x530b56['toUpperCase']()]+']',_0x9181b3[_0x1de5('0x13')]);_0xb25543(_0x9181b3['message']);});});};}function getCustomFields(_0xc7b0eb,_0xd9de51){var _0x4bb3ed={};if(_0xc7b0eb[_0x1de5('0xd')]>0x0){_[_0x1de5('0x26')](_0xc7b0eb,function(_0x9f9155){if(_[_0x1de5('0x27')]([_0x1de5('0x28'),_0x1de5('0x29')],_0x9f9155[_0x1de5('0x2a')])&&_0x9f9155['nameField']&&!_0x9f9155['customField']){_0x4bb3ed[_0x9f9155['nameField'][_0x1de5('0x2b')]()]=_0x9f9155[_0x1de5('0x2c')][_0x1de5('0x2d')]();}else if(_['includes']([_0x1de5('0x28'),_0x1de5('0x29')],_0x9f9155[_0x1de5('0x2a')])&&_0x9f9155[_0x1de5('0x2e')]&&_0x9f9155[_0x1de5('0x2f')]){_0x4bb3ed[_0x9f9155[_0x1de5('0x2e')][_0x1de5('0x2b')]()]=_0x9f9155['content'][_0x1de5('0x2d')]();}else if(_0x9f9155[_0x1de5('0x2a')]==='variable'&&_0x9f9155[_0x1de5('0x30')]&&_0x9f9155[_0x1de5('0x2e')]&&_0x9f9155['customField']){_0x4bb3ed[_0x9f9155[_0x1de5('0x2e')][_0x1de5('0x2b')]()]=_0xd9de51[_0x9f9155[_0x1de5('0x30')]][_0x1de5('0x2d')]();}else if(_0x9f9155[_0x1de5('0x2a')]===_0x1de5('0x31')&&_0x9f9155[_0x1de5('0x32')]&&_0x9f9155['Variable'][_0x1de5('0x33')]&&_0x9f9155[_0x1de5('0x2e')]&&_0x9f9155['customField']){_0x4bb3ed[_0x9f9155[_0x1de5('0x2e')][_0x1de5('0x2b')]()]=_0xd9de51[_0x9f9155[_0x1de5('0x32')][_0x1de5('0x33')][_0x1de5('0x2b')]()][_0x1de5('0x2d')]();}});}return _0x4bb3ed;}function getTicket(_0x4a77c0,_0x9a9909,_0x5edec1,_0x285920,_0x421519,_0x5bfa0a){return function(_0x3b6ca2){logger['info']('['+[_0x4a77c0[_0x1de5('0x10')]()]+_0x1de5('0x34'),_0x3b6ca2);return new Promise(function(_0x55106f,_0x4146e4){var _0x54db7f=_0x4a77c0[_0x1de5('0x2b')]()===_0x1de5('0x35')?_0x3b6ca2[_0x1de5('0x1b')]:_0x3b6ca2[_0x1de5('0x36')];var _0x1e07b4={'method':_0x1de5('0x1e'),'uri':_0x5edec1+_0x1de5('0x37')+'?'+_0x5bfa0a,'body':Object['assign']({},{'active':_0x1de5('0x38'),'caller_id':_0x54db7f,'assigned_to':_0x3b6ca2['userId'],'short_description':intUtil[_0x1de5('0x39')](_0x285920[_0x1de5('0x3a')],_0x421519,'\x20'),'description':intUtil[_0x1de5('0x39')](_0x285920['Descriptions'],_0x421519,'\x0a')},getCustomFields(_0x285920[_0x1de5('0x3b')],_0x421519)),'auth':_0x9a9909,'json':!![]};return rp(_0x1e07b4)['then'](function(_0x2e8272){logger[_0x1de5('0xf')]('['+[_0x4a77c0[_0x1de5('0x10')]()]+_0x1de5('0x3c'),_0x2e8272[_0x1de5('0x19')]);_0x3b6ca2['ticketId']=_0x2e8272['result']['sys_id'];_0x3b6ca2[_0x1de5('0x3d')]=_0x2e8272[_0x1de5('0x19')]['number'];logger[_0x1de5('0xf')]('['+[_0x4a77c0[_0x1de5('0x10')]()]+']\x20getTicket\x20crm',_0x3b6ca2);_0x55106f(_0x3b6ca2);})[_0x1de5('0x11')](function(_0x5711f9){logger[_0x1de5('0x12')]('['+[_0x4a77c0[_0x1de5('0x10')]()]+']',_0x5711f9[_0x1de5('0x13')]);_0x4146e4(_0x5711f9[_0x1de5('0x13')]);});});};}function createRemoteTag(_0x38883c,_0xeee969,_0x3e05f0,_0x519f26){return new Promise(function(_0x5862fa,_0x40dbf0){var _0x556549={'method':_0x1de5('0x1e'),'uri':_0x3e05f0+_0x1de5('0x3e')+'?'+_0x519f26,'body':{'short_description':_0x38883c,'global':!![],'active':!![],'name':_0x38883c},'auth':_0xeee969,'json':!![]};return rp(_0x556549)[_0x1de5('0xc')](function(_0x2cf7d5){var _0x1b46a7=_0x2cf7d5['result'][_0x1de5('0x24')];_0x5862fa(_0x1b46a7);});});}function getRemoteTag(_0x1fc107,_0x403201,_0x30966b,_0x4997f9,_0x137600){return new Promise(function(_0x2eabec,_0x3742c8){var _0x45fb04={'method':'GET','uri':_0x30966b+_0x1de5('0x3e')+'?sysparm_query=name%3D'+_0x1fc107+'&'+_0x4997f9,'auth':_0x403201,'json':!![]};return rp(_0x45fb04)[_0x1de5('0xc')](function(_0x1318a3){if(_0x1318a3[_0x1de5('0x19')][_0x1de5('0xd')]>0x0){var _0xb7f217=_0x1318a3[_0x1de5('0x19')][0x0]['sys_id'];_0x2eabec(_0xb7f217);}else{return createRemoteTag(_0x1fc107,_0x403201,_0x30966b,_0x4997f9)[_0x1de5('0xc')](function(_0x280050){_0x2eabec(_0x280050);});}});});}function assignTagToIncident(_0x254bc5,_0x3e47d3,_0xecef43,_0x29d122,_0x3fb9ea){return new Promise(function(_0x2b1214,_0xb69f2a){var _0x2b78b8={'method':_0x1de5('0x1e'),'uri':_0xecef43+_0x1de5('0x3f')+'?'+_0x3fb9ea,'body':{'label':_0x254bc5,'table':_0x1de5('0x37'),'id_type':_0x1de5('0x40'),'table_key':_0x29d122[_0x1de5('0x41')],'title':_0x1de5('0x42')+_0x29d122['ticketNumber'],'id_display':_0x29d122[_0x1de5('0x3d')]},'auth':_0x3e47d3,'json':!![]};return rp(_0x2b78b8)[_0x1de5('0xc')](function(_0x580cca){_0x2b1214();})[_0x1de5('0x11')](function(){_0x2b1214();});});}function manageTags(_0x3921f2,_0x14093d,_0x330a50,_0x1b45b9,_0x583616,_0x2ca7e8,_0x240bd4){return new Promise(function(_0x2b498a,_0x477687){var _0x5bd96b=[];_0x14093d['forEach'](function(_0x55040f){_0x5bd96b[_0x1de5('0x43')](getRemoteTag(_0x55040f,_0x330a50,_0x1b45b9,_0x2ca7e8,_0x240bd4));});return Promise[_0x1de5('0x44')](_0x5bd96b)[_0x1de5('0xc')](function(_0x549ebf){if(_0x549ebf[_0x1de5('0xd')]){logger[_0x1de5('0xf')]('['+[_0x3921f2[_0x1de5('0x10')]()]+_0x1de5('0x45'),_0x549ebf);var _0x3aecc1=[];_0x549ebf[_0x1de5('0x26')](function(_0x23053e){_0x3aecc1[_0x1de5('0x43')](assignTagToIncident(_0x23053e,_0x330a50,_0x1b45b9,_0x583616,_0x2ca7e8));});return Promise[_0x1de5('0x44')](_0x3aecc1)[_0x1de5('0xc')](function(){_0x2b498a();})[_0x1de5('0x11')](function(){_0x2b498a();});}else{_0x2b498a();}});});}function getTags(_0x209724,_0x3e4ad8,_0x200110,_0x1b7d97,_0x381a1d,_0x318315){return function(_0x94b6ae){return new Promise(function(_0x276945,_0x6e9ee5){var _0x58f1a8=[];var _0x29d3ed=_0x1b7d97[_0x1de5('0x46')];if(_0x29d3ed&&_0x29d3ed[_0x1de5('0xd')]>0x0){_0x58f1a8=_[_0x1de5('0x47')](_0x29d3ed,'name');}if(_0x58f1a8[_0x1de5('0xd')]>0x0){return manageTags(_0x209724,_0x58f1a8,_0x3e4ad8,_0x200110,_0x94b6ae,_0x381a1d,_0x318315)['then'](function(){_0x276945(_0x94b6ae);});}else{_0x276945(_0x94b6ae);}});};}function emit(_0x3eed43,_0x335327,_0x2addd1){var _0x47afc5=_0x1de5('0x48')+_0x1de5('0x49')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x1de5('0x4a');var _0x53fabc={'uri':_0x3eed43+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2addd1+_0x47afc5};io['to'](util[_0x1de5('0x4b')](_0x1de5('0x4c'),_0x335327))[_0x1de5('0x4d')](_0x1de5('0x4e'),_0x53fabc);}exports['cs']=function(_0x1ebb2a,_0x3dd08b,_0x1a702f,_0x4ca31c,_0x33480a,_0xc44597,_0xb2f16b,_0x42b47c){var _0x1a91bc={};var _0x4607c8={'user':_0xc44597[_0x1de5('0x4f')],'pass':_0xc44597[_0x1de5('0x50')]};var _0x48221a='sysparm_limit=1';var _0x5254a0=_0x1de5('0x51');_0xc44597[_0x1de5('0x52')]=intUtil[_0x1de5('0x53')](_0xc44597['remoteUri']);_0xc44597['serverUrl']=intUtil[_0x1de5('0x53')](_0xc44597['serverUrl']);var _0x14e518=util[_0x1de5('0x4b')](_0x1de5('0x54'),_0xc44597[_0x1de5('0x52')]);_0x1a91bc['userEmail']=!_[_0x1de5('0x55')](_0x4ca31c)?_0x4ca31c[_0x1de5('0x56')]:null;_0x1a91bc['adminEmail']=_0xc44597[_0x1de5('0x56')];_0x1a91bc[_0x1de5('0x20')]=_0x42b47c['toLowerCase']()===_0x1de5('0x35')?_0x3dd08b[_0x1de5('0x57')]:_0x3dd08b[_0x1de5('0x58')];_0x1a91bc[_0x1de5('0x59')]=_0x42b47c==='queue'||_0x42b47c===_0x1de5('0x5a')?_0x1de5('0x5b'):_0x1de5('0x35');var _0x1df31c=util[_0x1de5('0x4b')](_0x1de5('0x5c'),_0xc44597['serverUrl'],_0x3dd08b['uniqueid'],md5(_0x3dd08b[_0x1de5('0x5d')]));if(_0x33480a&&_0x33480a['monitor_format']){logger[_0x1de5('0xf')](_0x1de5('0x5e'),_0x1de5('0x5f'));_0x3dd08b[_0x1de5('0x60')]=_0x1df31c;}else if(_0xb2f16b&&_0xb2f16b[_0x1de5('0x61')]&&_0xb2f16b['recordingFormat']!=='none'){logger[_0x1de5('0xf')]('[OUTBOUND]',_0x1de5('0x5f'));_0x3dd08b[_0x1de5('0x60')]=_0x1df31c;}else{_0x3dd08b[_0x1de5('0x60')]='';}return getAdminUser(_0x42b47c,_0x4607c8,_0x1a91bc,_0x14e518,_0x5254a0,_0x48221a)[_0x1de5('0xc')](getUser(_0x42b47c,_0x4607c8,_0x14e518,_0x5254a0,_0x48221a))[_0x1de5('0xc')](getEndUser(_0x42b47c,_0x4607c8,_0x14e518,_0x5254a0,_0x48221a))['then'](getTicket(_0x42b47c,_0x4607c8,_0x14e518,_0x1a702f,_0x3dd08b,_0x5254a0))['then'](function(_0x16e98e){logger['info'](util[_0x1de5('0x4b')](_0x1de5('0x62'),_0x16e98e[_0x1de5('0x41')]));logger[_0x1de5('0xf')](util[_0x1de5('0x4b')](_0x1de5('0x63'),_0x42b47c));if(_0x42b47c!==_0x1de5('0x5a')){logger[_0x1de5('0xf')]('['+[_0x42b47c[_0x1de5('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xc44597[_0x1de5('0x52')],_0x4ca31c[_0x1de5('0x33')],_0x16e98e[_0x1de5('0x41')]);}})['catch'](function(_0x50ba7e){logger[_0x1de5('0x12')]('['+[_0x42b47c['toUpperCase']()]+_0x1de5('0x64'),util[_0x1de5('0x65')](_0x50ba7e,{'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 0164a87..d1e6190 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 _0x64e4=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','charAt','unmanaged','lastevent','calleridname','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','stringify','Calls','apiKey','toString','get_server_info','JSON','isNil','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','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!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','[HTTP]','merge','map','forEach','type','customField','toLowerCase','content','string','customVariable','Variable','custom_fields','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x2331ca,_0x126854){var _0x1ca355=function(_0xfd3868){while(--_0xfd3868){_0x2331ca['push'](_0x2331ca['shift']());}};_0x1ca355(++_0x126854);}(_0x64e4,0x88));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x464e('0x0'));var BPromise=require(_0x464e('0x1'));var md5=require(_0x464e('0x2'));var util=require(_0x464e('0x3'));var Redis=require(_0x464e('0x4'));var intUtil=require(_0x464e('0x5'));var config=require(_0x464e('0x6'));var logger=require(_0x464e('0x7'))(_0x464e('0x8'));config[_0x464e('0x9')]=_[_0x464e('0xa')](config[_0x464e('0x9')],{'host':_0x464e('0xb'),'port':0x18eb});var io=require(_0x464e('0xc'))(new Redis(config['redis']));var def={'method':_0x464e('0xd'),'json':!![]};function emit(_0x4ca091,_0x11763e,_0x4c2f8c){io['to'](_0x4ca091)['emit'](_0x11763e,_0x4c2f8c);}function getTicket(_0x118a2f,_0x481861,_0x2162de,_0x122df6,_0x5abed1,_0x1cdca5,_0x2aaec8,_0x1180b7){logger[_0x464e('0xe')](_0x464e('0xf'));var _0x4031b7=new Date();var _0x36cff7=[{'name':_0x464e('0x10'),'value':intUtil[_0x464e('0x11')](_0x122df6[_0x464e('0x12')],_0x5abed1,'\x20')},{'name':_0x464e('0x13'),'value':_0x481861['id']},{'name':_0x464e('0x14'),'value':_0x481861['id']},{'name':'description','value':intUtil[_0x464e('0x11')](_0x122df6[_0x464e('0x15')],_0x5abed1,'\x0a')},{'name':_0x464e('0x16'),'value':_0x4031b7['toISOString']()[_0x464e('0x17')](0x0,0x13)[_0x464e('0x18')]('T','\x20')},{'name':_0x464e('0x19'),'value':'0'},{'name':_0x464e('0x1a'),'value':'15'},{'name':'parent_id','value':_0x2162de['id']},{'name':'parent_type','value':_0x464e('0x1b')},{'name':_0x464e('0x1c'),'value':_0x2162de[_0x464e('0x10')]},{'name':_0x464e('0x1d'),'value':_0x1180b7}];if(_0x1cdca5[_0x464e('0x1e')]){_['forEach'](_0x1cdca5,function(_0x294829){if(_0x5abed1[_0x294829[_0x464e('0x1f')]]){_0x36cff7[_0x464e('0x20')]({'name':_0x294829[_0x464e('0x21')],'value':_0x5abed1[_0x294829[_0x464e('0x1f')]]});}});}return request({'form':{'method':_0x464e('0x22'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x464e('0x23')]({'session':_0x2aaec8['id'],'module_name':_0x464e('0x24'),'name_value_list':_0x36cff7})}});}function getAuth(_0x324889){return util['format']('Basic\x20%s',new Buffer(_0x324889[_0x464e('0x25')]+':X')[_0x464e('0x26')]('base64'));}function getServerInfo(_0x292084){return request({'form':{'method':_0x464e('0x27'),'input_type':_0x464e('0x28'),'response_type':_0x464e('0x28'),'rest_data':JSON[_0x464e('0x23')]({'session':_0x292084['id']})}});}function getUser(_0x13c7ca,_0x1868d3,_0x422234){if(!_[_0x464e('0x29')](_0x1868d3)){logger['info']('Getting\x20agent\x20with\x20name',_0x1868d3);return request({'form':{'method':_0x464e('0x2a'),'input_type':_0x464e('0x28'),'response_type':'JSON','rest_data':JSON[_0x464e('0x23')]({'session':_0x422234['id'],'module_name':'Employees','query':util[_0x464e('0x2b')](_0x464e('0x2c'),_0x1868d3),'order_by':'','offset':'0','select_fields':['id','name',_0x464e('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x464e('0x2e')](function(_0x2acc42){if(_0x2acc42[_0x464e('0x2f')]['length']){var _0xf963f6=_[_0x464e('0x30')](_0x2acc42[_0x464e('0x2f')],function(_0x2ba445){return _0x2ba445['name_value_list'][_0x464e('0x2d')][_0x464e('0x31')]===_0x1868d3;});if(_0xf963f6){logger[_0x464e('0xe')](_0x464e('0x32'));return BPromise[_0x464e('0x33')]({'id':_0xf963f6[_0x464e('0x34')]['id'][_0x464e('0x31')],'name':_0xf963f6['name_value_list'][_0x464e('0x10')][_0x464e('0x31')]});}}logger[_0x464e('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x464e('0x33')]({'id':_0x422234['name_value_list'][_0x464e('0x35')][_0x464e('0x31')],'name':_0x422234['name_value_list'][_0x464e('0x2d')][_0x464e('0x31')]});});}else{logger['info'](_0x464e('0x36'));return BPromise['resolve']({'id':_0x422234[_0x464e('0x34')][_0x464e('0x35')][_0x464e('0x31')],'name':_0x422234[_0x464e('0x34')][_0x464e('0x2d')][_0x464e('0x31')]});}}function getEndUser(_0x42cf59,_0x2e519c,_0x344ded,_0x3412ea){logger[_0x464e('0xe')](_0x464e('0x37'),_0x344ded);return request({'form':{'method':_0x464e('0x2a'),'input_type':_0x464e('0x28'),'response_type':'JSON','rest_data':JSON[_0x464e('0x23')]({'session':_0x3412ea['id'],'module_name':'Contacts','query':util['format'](_0x464e('0x38'),_0x344ded),'order_by':'','offset':'0','select_fields':['id','name',_0x464e('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5f95be){if(_0x5f95be[_0x464e('0x2f')][_0x464e('0x1e')]){var _0x44dcb4=_[_0x464e('0x30')](_0x5f95be[_0x464e('0x2f')],function(_0x58f964){return _0x58f964['name_value_list'][_0x464e('0x39')]['value']===_0x344ded;});if(_0x44dcb4){logger[_0x464e('0xe')]('Enduser\x20found!');return BPromise[_0x464e('0x33')]({'id':_0x44dcb4[_0x464e('0x34')]['id'][_0x464e('0x31')],'name':_0x44dcb4[_0x464e('0x34')]['name']['value'],'phone':_0x44dcb4['name_value_list'][_0x464e('0x39')]['value']});}}else{logger['info'](_0x464e('0x3a'));return request({'form':{'method':_0x464e('0x22'),'input_type':_0x464e('0x28'),'response_type':_0x464e('0x28'),'rest_data':JSON[_0x464e('0x23')]({'session':_0x3412ea['id'],'module_name':_0x464e('0x1b'),'name_value_list':[{'name':'first_name','value':_0x2e519c!==_0x464e('0x3b')?_0x2e519c:util[_0x464e('0x2b')](_0x464e('0x3c'),_0x344ded)},{'name':_0x464e('0x39'),'value':_0x344ded}]})}})[_0x464e('0x2e')](function(_0x39fdb6){logger[_0x464e('0xe')](_0x464e('0x3d'));return BPromise[_0x464e('0x33')]({'id':_0x39fdb6['id'],'name':_0x39fdb6[_0x464e('0x2f')][_0x464e('0x3e')][_0x464e('0x31')],'phone':_0x39fdb6[_0x464e('0x2f')][_0x464e('0x39')][_0x464e('0x31')]});});}});}function request(_0x147447){logger['debug'](_0x464e('0x3f'),JSON['stringify'](_0x147447));return rp(_[_0x464e('0x40')](def,_0x147447));}function getTags(_0x40e264,_0x3ff981){var _0x12f6de=[];if(_0x40e264&&_0x40e264[_0x464e('0x1e')]>0x0){_0x12f6de=_[_0x464e('0x41')](_0x40e264,_0x3ff981);}return _0x12f6de;}function getCustomFields(_0x62e636,_0x52701f){var _0x2b0564=[];var _0x133610={'custom_fields':[]};if(_0x62e636[_0x464e('0x1e')]>0x0){_[_0x464e('0x42')](_0x62e636,function(_0x125d20){if(_0x125d20[_0x464e('0x43')]==='string'&&_0x125d20['nameField']&&!_0x125d20[_0x464e('0x44')]){_0x133610[_0x125d20['nameField'][_0x464e('0x45')]()]=_0x125d20[_0x464e('0x46')]['toString']();}else if(_0x125d20[_0x464e('0x43')]===_0x464e('0x47')&&_0x125d20[_0x464e('0x21')]&&_0x125d20[_0x464e('0x44')]){_0x133610['custom_fields'][_0x464e('0x20')]({'id':_0x125d20[_0x464e('0x21')],'value':_0x125d20['content'][_0x464e('0x26')]()});}else if(_0x125d20[_0x464e('0x43')]==='variable'&&_0x125d20[_0x464e('0x1f')]&&_0x125d20[_0x464e('0x21')]&&_0x125d20[_0x464e('0x44')]){_0x52701f[_0x125d20[_0x464e('0x1f')]]&&_0x133610['custom_fields'][_0x464e('0x20')]({'id':_0x125d20[_0x464e('0x21')],'value':_0x52701f[_0x125d20[_0x464e('0x1f')]][_0x464e('0x26')]()});}else if(_0x125d20[_0x464e('0x43')]===_0x464e('0x48')&&_0x125d20[_0x464e('0x49')]&&_0x125d20[_0x464e('0x49')][_0x464e('0x10')]&&_0x125d20[_0x464e('0x21')]&&_0x125d20['customField']){_0x52701f[_0x125d20[_0x464e('0x49')][_0x464e('0x10')][_0x464e('0x45')]()]&&_0x133610[_0x464e('0x4a')]['push']({'id':_0x125d20[_0x464e('0x21')],'value':_0x52701f[_0x125d20['Variable'][_0x464e('0x10')][_0x464e('0x45')]()]['toString']()});}});}return _0x133610;}function getConnection(_0x4dbcee){return request({'method':'POST','form':{'method':'login','input_type':_0x464e('0x28'),'response_type':_0x464e('0x28'),'rest_data':JSON[_0x464e('0x23')]({'user_auth':{'user_name':_0x4dbcee[_0x464e('0x4b')],'password':_0x4dbcee[_0x464e('0x4c')],'encryption':_0x464e('0x4d')},'application':_0x464e('0x4e')})}})[_0x464e('0x2e')](function(_0x3c8e67){var _0x27067e=_0x3c8e67;if(_0x27067e['id']){def[_0x464e('0x4f')]=_0x27067e['id'];return BPromise[_0x464e('0x33')](_0x27067e);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x4dbcee['id']));}});}function setRelationship(_0x35cea3,_0x4c5651,_0x58df60,_0x291e97){return request({'form':{'method':_0x464e('0x50'),'input_type':_0x464e('0x28'),'response_type':'JSON','rest_data':JSON[_0x464e('0x23')]({'session':_0x35cea3['id'],'module_name':'Calls','module_id':_0x58df60['id'],'link_field_name':_0x291e97,'related_ids':[_0x4c5651['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5e8387,_0x49b65d,_0x4ce555,_0x28ecd6,_0x320101,_0x4b88a9){var _0x3187db,_0x11c7d6,_0x22fe8a,_0x3a8f4f;_0x4b88a9['remoteUri']=intUtil[_0x464e('0x51')](_0x4b88a9['remoteUri']);_0x4b88a9[_0x464e('0x52')]=intUtil[_0x464e('0x51')](_0x4b88a9[_0x464e('0x52')]);def[_0x464e('0x53')]=util[_0x464e('0x2b')](_0x464e('0x54'),_0x4b88a9[_0x464e('0x55')]);if(_0x320101&&_0x320101[_0x464e('0x56')]){logger[_0x464e('0xe')](_0x464e('0x57'),_0x464e('0x58'));_0x49b65d['recordingURL']=util[_0x464e('0x2b')](_0x464e('0x59'),_0x4b88a9[_0x464e('0x52')],_0x49b65d[_0x464e('0x5a')],md5(_0x49b65d[_0x464e('0x5a')]));}else{_0x49b65d[_0x464e('0x5b')]='';}return getConnection(_0x4b88a9)[_0x464e('0x2e')](function(_0x33df10){_0x3a8f4f=_0x33df10;return getUser(_0x4b88a9,_0x28ecd6[_0x464e('0x10')],_0x3a8f4f);})[_0x464e('0x2e')](function(_0x43161a){_0x3187db=_0x43161a;logger[_0x464e('0xe')](_0x464e('0x5c'),_0x3187db['id']);return getEndUser(_0x4b88a9,_0x49b65d['calleridname'],_0x49b65d[_0x464e('0x5d')],_0x3a8f4f);})[_0x464e('0x2e')](function(_0x11ec37){_0x11c7d6=_0x11ec37;logger[_0x464e('0xe')](_0x464e('0x5e'),_0x11c7d6['id']);return getTicket(_0x4b88a9,_0x3187db,_0x11c7d6,_0x4ce555,_0x49b65d,_0x4ce555['Fields'],_0x3a8f4f,_0x464e('0x5f'));})['then'](function(_0x7784ff){_0x22fe8a=_0x7784ff;logger['info'](_0x464e('0x60'));logger[_0x464e('0xe')](_0x464e('0x61'),_0x22fe8a['id']);return setRelationship(_0x3a8f4f,_0x3187db,_0x22fe8a,_0x464e('0x62'));})[_0x464e('0x2e')](function(){return setRelationship(_0x3a8f4f,_0x11c7d6,_0x22fe8a,_0x464e('0x63'));})['then'](function(){return getServerInfo(_0x3a8f4f);})[_0x464e('0x2e')](function(_0x500d73){var _0x18a122=parseInt(_0x500d73[_0x464e('0x64')]['charAt'](0x0));var _0x2cad16=util[_0x464e('0x2b')](_0x464e('0x65'),_0x4b88a9[_0x464e('0x55')],_0x22fe8a['id']);if(_0x18a122>0x6){_0x2cad16=util['format'](_0x464e('0x66'),_0x4b88a9['remoteUri'],_0x22fe8a['id']);}logger[_0x464e('0xe')]('[QUEUE]',_0x464e('0x67'));emit(util[_0x464e('0x2b')]('user:%s',_0x28ecd6[_0x464e('0x10')]),_0x464e('0x68'),{'uri':_0x2cad16});})[_0x464e('0x69')](function(_0x1dd142){logger[_0x464e('0x6a')](_0x464e('0x57'),JSON[_0x464e('0x23')](_0x1dd142));});};exports[_0x464e('0x6b')]=function(_0xca353f,_0x34002b,_0x51b8dc,_0x22a0cd,_0x3fc806,_0x2659f5,_0x451b0d){var _0x5470a0,_0x2526bc,_0x58f63e,_0x282ec8;_0x2659f5['remoteUri']=intUtil[_0x464e('0x51')](_0x2659f5[_0x464e('0x55')]);_0x2659f5[_0x464e('0x52')]=intUtil[_0x464e('0x51')](_0x2659f5[_0x464e('0x52')]);def[_0x464e('0x53')]=util[_0x464e('0x2b')](_0x464e('0x54'),_0x2659f5[_0x464e('0x55')]);if(_0x451b0d&&_0x451b0d[_0x464e('0x6c')]&&_0x451b0d[_0x464e('0x6c')]!==_0x464e('0x6d')){logger[_0x464e('0xe')](_0x464e('0x6e'),_0x464e('0x58'));_0x34002b[_0x464e('0x5b')]=util[_0x464e('0x2b')](_0x464e('0x59'),_0x2659f5[_0x464e('0x52')],_0x34002b[_0x464e('0x5a')],md5(_0x34002b[_0x464e('0x5a')]));}return getConnection(_0x2659f5)[_0x464e('0x2e')](function(_0x27fe4e){_0x282ec8=_0x27fe4e;return getUser(_0x2659f5,_0x22a0cd['name'],_0x282ec8);})[_0x464e('0x2e')](function(_0x501418){_0x5470a0=_0x501418;logger[_0x464e('0xe')]('The\x20User\x20ID\x20is:',_0x5470a0['id']);return getEndUser(_0x2659f5,_0x34002b[_0x464e('0x6f')],_0x34002b[_0x464e('0x70')],_0x282ec8);})['then'](function(_0x2c9ae9){_0x2526bc=_0x2c9ae9;logger[_0x464e('0xe')](_0x464e('0x5e'),_0x2526bc['id']);return getTicket(_0x2659f5,_0x5470a0,_0x2526bc,_0x51b8dc,_0x34002b,_0x51b8dc['Fields'],_0x282ec8,_0x464e('0x71'));})['then'](function(_0x545e0e){_0x58f63e=_0x545e0e;logger[_0x464e('0xe')](_0x464e('0x60'));logger[_0x464e('0xe')](_0x464e('0x61'),_0x58f63e['id']);return setRelationship(_0x282ec8,_0x5470a0,_0x58f63e,'users');})['then'](function(){return setRelationship(_0x282ec8,_0x2526bc,_0x58f63e,_0x464e('0x63'));})['then'](function(){return getServerInfo(_0x282ec8);})[_0x464e('0x2e')](function(_0x5b9417){var _0x1be74d=parseInt(_0x5b9417['version'][_0x464e('0x72')](0x0));var _0x3efc53=util[_0x464e('0x2b')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2659f5[_0x464e('0x55')],_0x58f63e['id']);if(_0x1be74d>0x6){_0x3efc53=util[_0x464e('0x2b')](_0x464e('0x66'),_0x2659f5['remoteUri'],_0x58f63e['id']);}logger[_0x464e('0xe')](_0x464e('0x6e'),_0x464e('0x67'));emit(util['format']('user:%s',_0x22a0cd[_0x464e('0x10')]),_0x464e('0x68'),{'uri':_0x3efc53});})[_0x464e('0x69')](function(_0x419b3e){logger[_0x464e('0x6a')]('[OUTBOUND]',JSON[_0x464e('0x23')](_0x419b3e));});};exports[_0x464e('0x73')]=function(_0x1cb95e,_0x510533,_0x1aa020,_0x389844,_0x1c2704,_0x221871){var _0x30ea96,_0xd0f6c3,_0x4725c3,_0x52fc9c;_0x221871[_0x464e('0x55')]=intUtil[_0x464e('0x51')](_0x221871[_0x464e('0x55')]);_0x221871[_0x464e('0x52')]=intUtil[_0x464e('0x51')](_0x221871[_0x464e('0x52')]);def['uri']=util[_0x464e('0x2b')]('%s/service/v4_1/rest.php',_0x221871[_0x464e('0x55')]);if(_0x1c2704&&_0x1c2704[_0x464e('0x56')]){logger[_0x464e('0xe')]('['+_0x510533[_0x464e('0x74')]['toUpperCase']()+']',_0x464e('0x58'));_0x510533[_0x464e('0x5b')]=util['format'](_0x464e('0x59'),_0x221871[_0x464e('0x52')],_0x510533[_0x464e('0x5a')],md5(_0x510533[_0x464e('0x5a')]));}else{_0x510533[_0x464e('0x5b')]='';}return getConnection(_0x221871)['then'](function(_0x4d18fe){_0x52fc9c=_0x4d18fe;if(!_['isNil'](_0x389844)){return getUser(_0x221871,_0x389844[_0x464e('0x10')],_0x52fc9c);}else{return getUser(_0x221871,null,_0x52fc9c);}})[_0x464e('0x2e')](function(_0xb97d94){_0x30ea96=_0xb97d94;logger[_0x464e('0xe')](_0x464e('0x5c'),_0x30ea96['id']);return getEndUser(_0x221871,_0x510533[_0x464e('0x75')],_0x510533[_0x464e('0x5d')],_0x52fc9c);})[_0x464e('0x2e')](function(_0x40d935){_0xd0f6c3=_0x40d935;logger[_0x464e('0xe')]('The\x20Enduser\x20ID\x20is:',_0xd0f6c3['id']);return getTicket(_0x221871,_0x30ea96,_0xd0f6c3,_0x1aa020,_0x510533,_0x1aa020['Fields'],_0x52fc9c,_0x464e('0x5f'));})[_0x464e('0x2e')](function(_0x242fdd){_0x4725c3=_0x242fdd;logger[_0x464e('0xe')]('Ticket\x20created!');logger[_0x464e('0xe')](_0x464e('0x61'),_0x4725c3['id']);return setRelationship(_0x52fc9c,_0x30ea96,_0x4725c3,'users');})[_0x464e('0x2e')](function(){return setRelationship(_0x52fc9c,_0xd0f6c3,_0x4725c3,'contacts');})[_0x464e('0x2e')](function(){return getServerInfo(_0x52fc9c);})[_0x464e('0x69')](function(_0x16b34f){logger[_0x464e('0x6a')]('['+_0x510533[_0x464e('0x74')][_0x464e('0x76')]()+']',JSON['stringify'](_0x16b34f));});}; \ No newline at end of file +var _0xcf33=['variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','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','user:%s','trigger:browser:url','catch','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','error','lastevent','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','direction','length','forEach','variableName','push','JSON','stringify','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','toLowerCase','content','toString','type','idField','customField','custom_fields'];(function(_0x490c45,_0x97b829){var _0x82738e=function(_0x215c17){while(--_0x215c17){_0x490c45['push'](_0x490c45['shift']());}};_0x82738e(++_0x97b829);}(_0xcf33,0x125));var _0x3cf3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xcf33[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var rp=require(_0x3cf3('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x3cf3('0x1'));var Redis=require(_0x3cf3('0x2'));var intUtil=require('./util');var config=require(_0x3cf3('0x3'));var logger=require(_0x3cf3('0x4'))(_0x3cf3('0x5'));config[_0x3cf3('0x6')]=_[_0x3cf3('0x7')](config[_0x3cf3('0x6')],{'host':_0x3cf3('0x8'),'port':0x18eb});var io=require(_0x3cf3('0x9'))(new Redis(config['redis']));var def={'method':_0x3cf3('0xa'),'json':!![]};function emit(_0x4ce1ac,_0x13c108,_0xbd2b22){io['to'](_0x4ce1ac)[_0x3cf3('0xb')](_0x13c108,_0xbd2b22);}function getTicket(_0x26ee34,_0x57e94c,_0x299a59,_0x44acac,_0x4102f1,_0x8c1b9c,_0x1a5725,_0x1a154a){logger[_0x3cf3('0xc')](_0x3cf3('0xd'));var _0x29997f=new Date();var _0x306a39=[{'name':'name','value':intUtil[_0x3cf3('0xe')](_0x44acac[_0x3cf3('0xf')],_0x4102f1,'\x20')},{'name':_0x3cf3('0x10'),'value':_0x57e94c['id']},{'name':_0x3cf3('0x11'),'value':_0x57e94c['id']},{'name':'description','value':intUtil['getString'](_0x44acac['Descriptions'],_0x4102f1,'\x0a')},{'name':_0x3cf3('0x12'),'value':_0x29997f[_0x3cf3('0x13')]()[_0x3cf3('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x3cf3('0x15'),'value':'0'},{'name':_0x3cf3('0x16'),'value':'15'},{'name':_0x3cf3('0x17'),'value':_0x299a59['id']},{'name':_0x3cf3('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x299a59['name']},{'name':_0x3cf3('0x19'),'value':_0x1a154a}];if(_0x8c1b9c[_0x3cf3('0x1a')]){_[_0x3cf3('0x1b')](_0x8c1b9c,function(_0x44a70e){if(_0x4102f1[_0x44a70e[_0x3cf3('0x1c')]]){_0x306a39[_0x3cf3('0x1d')]({'name':_0x44a70e['idField'],'value':_0x4102f1[_0x44a70e[_0x3cf3('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3cf3('0x1e'),'response_type':_0x3cf3('0x1e'),'rest_data':JSON[_0x3cf3('0x1f')]({'session':_0x1a5725['id'],'module_name':'Calls','name_value_list':_0x306a39})}});}function getAuth(_0x4f0ff7){return util[_0x3cf3('0x20')](_0x3cf3('0x21'),new Buffer(_0x4f0ff7[_0x3cf3('0x22')]+':X')['toString'](_0x3cf3('0x23')));}function getServerInfo(_0x37fd44){return request({'form':{'method':_0x3cf3('0x24'),'input_type':_0x3cf3('0x1e'),'response_type':_0x3cf3('0x1e'),'rest_data':JSON['stringify']({'session':_0x37fd44['id']})}});}function getUser(_0x16f7e2,_0xb656d4,_0x3a9c9b){if(!_[_0x3cf3('0x25')](_0xb656d4)){logger[_0x3cf3('0xc')]('Getting\x20agent\x20with\x20name',_0xb656d4);return request({'form':{'method':_0x3cf3('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3cf3('0x1f')]({'session':_0x3a9c9b['id'],'module_name':_0x3cf3('0x27'),'query':util[_0x3cf3('0x20')](_0x3cf3('0x28'),_0xb656d4),'order_by':'','offset':'0','select_fields':['id',_0x3cf3('0x29'),_0x3cf3('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3cf3('0x2b')](function(_0x36b253){if(_0x36b253[_0x3cf3('0x2c')]['length']){var _0x241178=_[_0x3cf3('0x2d')](_0x36b253[_0x3cf3('0x2c')],function(_0xed97f3){return _0xed97f3[_0x3cf3('0x2e')][_0x3cf3('0x2a')][_0x3cf3('0x2f')]===_0xb656d4;});if(_0x241178){logger['info'](_0x3cf3('0x30'));return BPromise[_0x3cf3('0x31')]({'id':_0x241178[_0x3cf3('0x2e')]['id'][_0x3cf3('0x2f')],'name':_0x241178[_0x3cf3('0x2e')][_0x3cf3('0x29')][_0x3cf3('0x2f')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3a9c9b[_0x3cf3('0x2e')]['user_id'][_0x3cf3('0x2f')],'name':_0x3a9c9b[_0x3cf3('0x2e')][_0x3cf3('0x2a')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3a9c9b['name_value_list']['user_id'][_0x3cf3('0x2f')],'name':_0x3a9c9b[_0x3cf3('0x2e')][_0x3cf3('0x2a')][_0x3cf3('0x2f')]});}}function getEndUser(_0x2fc133,_0x5666d6,_0x4c3603,_0x5d99b8){logger[_0x3cf3('0xc')](_0x3cf3('0x32'),_0x4c3603);return request({'form':{'method':_0x3cf3('0x26'),'input_type':_0x3cf3('0x1e'),'response_type':_0x3cf3('0x1e'),'rest_data':JSON[_0x3cf3('0x1f')]({'session':_0x5d99b8['id'],'module_name':_0x3cf3('0x33'),'query':util['format'](_0x3cf3('0x34'),_0x4c3603),'order_by':'','offset':'0','select_fields':['id','name',_0x3cf3('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x170240){if(_0x170240['entry_list'][_0x3cf3('0x1a')]){var _0x587279=_['find'](_0x170240[_0x3cf3('0x2c')],function(_0x7a3c6a){return _0x7a3c6a[_0x3cf3('0x2e')]['phone_home'][_0x3cf3('0x2f')]===_0x4c3603;});if(_0x587279){logger[_0x3cf3('0xc')](_0x3cf3('0x36'));return BPromise[_0x3cf3('0x31')]({'id':_0x587279['name_value_list']['id'][_0x3cf3('0x2f')],'name':_0x587279[_0x3cf3('0x2e')][_0x3cf3('0x29')][_0x3cf3('0x2f')],'phone':_0x587279[_0x3cf3('0x2e')]['phone_home'][_0x3cf3('0x2f')]});}}else{logger[_0x3cf3('0xc')](_0x3cf3('0x37'));return request({'form':{'method':_0x3cf3('0x38'),'input_type':_0x3cf3('0x1e'),'response_type':_0x3cf3('0x1e'),'rest_data':JSON[_0x3cf3('0x1f')]({'session':_0x5d99b8['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3cf3('0x39'),'value':_0x5666d6!==_0x3cf3('0x3a')?_0x5666d6:util[_0x3cf3('0x20')](_0x3cf3('0x3b'),_0x4c3603)},{'name':'phone_home','value':_0x4c3603}]})}})[_0x3cf3('0x2b')](function(_0x16adc5){logger['info'](_0x3cf3('0x3c'));return BPromise[_0x3cf3('0x31')]({'id':_0x16adc5['id'],'name':_0x16adc5[_0x3cf3('0x2c')]['first_name']['value'],'phone':_0x16adc5['entry_list'][_0x3cf3('0x35')][_0x3cf3('0x2f')]});});}});}function request(_0x2dc511){logger[_0x3cf3('0x3d')]('[HTTP]',JSON['stringify'](_0x2dc511));return rp(_[_0x3cf3('0x3e')](def,_0x2dc511));}function getTags(_0x7734c4,_0x32bc8d){var _0x3b9464=[];if(_0x7734c4&&_0x7734c4[_0x3cf3('0x1a')]>0x0){_0x3b9464=_[_0x3cf3('0x3f')](_0x7734c4,_0x32bc8d);}return _0x3b9464;}function getCustomFields(_0x254685,_0x5acae6){var _0x5d5c0d=[];var _0x422eb3={'custom_fields':[]};if(_0x254685['length']>0x0){_[_0x3cf3('0x1b')](_0x254685,function(_0x576f8d){if(_0x576f8d['type']===_0x3cf3('0x40')&&_0x576f8d['nameField']&&!_0x576f8d['customField']){_0x422eb3[_0x576f8d[_0x3cf3('0x41')][_0x3cf3('0x42')]()]=_0x576f8d[_0x3cf3('0x43')][_0x3cf3('0x44')]();}else if(_0x576f8d[_0x3cf3('0x45')]===_0x3cf3('0x40')&&_0x576f8d[_0x3cf3('0x46')]&&_0x576f8d[_0x3cf3('0x47')]){_0x422eb3[_0x3cf3('0x48')][_0x3cf3('0x1d')]({'id':_0x576f8d['idField'],'value':_0x576f8d['content'][_0x3cf3('0x44')]()});}else if(_0x576f8d['type']===_0x3cf3('0x49')&&_0x576f8d[_0x3cf3('0x1c')]&&_0x576f8d[_0x3cf3('0x46')]&&_0x576f8d[_0x3cf3('0x47')]){_0x5acae6[_0x576f8d['variableName']]&&_0x422eb3[_0x3cf3('0x48')][_0x3cf3('0x1d')]({'id':_0x576f8d['idField'],'value':_0x5acae6[_0x576f8d['variableName']][_0x3cf3('0x44')]()});}else if(_0x576f8d['type']==='customVariable'&&_0x576f8d[_0x3cf3('0x4a')]&&_0x576f8d[_0x3cf3('0x4a')][_0x3cf3('0x29')]&&_0x576f8d[_0x3cf3('0x46')]&&_0x576f8d[_0x3cf3('0x47')]){_0x5acae6[_0x576f8d[_0x3cf3('0x4a')][_0x3cf3('0x29')]['toLowerCase']()]&&_0x422eb3[_0x3cf3('0x48')][_0x3cf3('0x1d')]({'id':_0x576f8d[_0x3cf3('0x46')],'value':_0x5acae6[_0x576f8d['Variable'][_0x3cf3('0x29')]['toLowerCase']()][_0x3cf3('0x44')]()});}});}return _0x422eb3;}function getConnection(_0x5022a1){return request({'method':_0x3cf3('0xa'),'form':{'method':_0x3cf3('0x4b'),'input_type':_0x3cf3('0x1e'),'response_type':_0x3cf3('0x1e'),'rest_data':JSON[_0x3cf3('0x1f')]({'user_auth':{'user_name':_0x5022a1[_0x3cf3('0x4c')],'password':_0x5022a1[_0x3cf3('0x4d')],'encryption':_0x3cf3('0x4e')},'application':_0x3cf3('0x4f')})}})['then'](function(_0x8ab654){var _0x5580bf=_0x8ab654;if(_0x5580bf['id']){def[_0x3cf3('0x50')]=_0x5580bf['id'];return BPromise[_0x3cf3('0x31')](_0x5580bf);}else{throw new Error(util['format'](_0x3cf3('0x51'),_0x5022a1['id']));}});}function setRelationship(_0x227398,_0x372486,_0x408173,_0x457a10){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x227398['id'],'module_name':'Calls','module_id':_0x408173['id'],'link_field_name':_0x457a10,'related_ids':[_0x372486['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3cf3('0x52')]=function(_0x57ce1f,_0x540172,_0x1e33f2,_0x7fd054,_0x18dcf0,_0x2e1f29){var _0x551cf3,_0x3fe1fc,_0x5142d7,_0x43646a;_0x2e1f29[_0x3cf3('0x53')]=intUtil[_0x3cf3('0x54')](_0x2e1f29['remoteUri']);_0x2e1f29[_0x3cf3('0x55')]=intUtil[_0x3cf3('0x54')](_0x2e1f29[_0x3cf3('0x55')]);def['uri']=util[_0x3cf3('0x20')]('%s/service/v4_1/rest.php',_0x2e1f29[_0x3cf3('0x53')]);if(_0x18dcf0&&_0x18dcf0[_0x3cf3('0x56')]){logger[_0x3cf3('0xc')](_0x3cf3('0x57'),_0x3cf3('0x58'));_0x540172[_0x3cf3('0x59')]=util[_0x3cf3('0x20')](_0x3cf3('0x5a'),_0x2e1f29[_0x3cf3('0x55')],_0x540172['uniqueid'],md5(_0x540172[_0x3cf3('0x5b')]));}else{_0x540172[_0x3cf3('0x59')]='';}return getConnection(_0x2e1f29)['then'](function(_0x288dbc){_0x43646a=_0x288dbc;return getUser(_0x2e1f29,_0x7fd054[_0x3cf3('0x29')],_0x43646a);})['then'](function(_0x936aa8){_0x551cf3=_0x936aa8;logger['info'](_0x3cf3('0x5c'),_0x551cf3['id']);return getEndUser(_0x2e1f29,_0x540172[_0x3cf3('0x5d')],_0x540172['calleridnum'],_0x43646a);})[_0x3cf3('0x2b')](function(_0x5638f7){_0x3fe1fc=_0x5638f7;logger[_0x3cf3('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3fe1fc['id']);return getTicket(_0x2e1f29,_0x551cf3,_0x3fe1fc,_0x1e33f2,_0x540172,_0x1e33f2[_0x3cf3('0x5e')],_0x43646a,_0x3cf3('0x5f'));})[_0x3cf3('0x2b')](function(_0x283f86){_0x5142d7=_0x283f86;logger[_0x3cf3('0xc')](_0x3cf3('0x60'));logger[_0x3cf3('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5142d7['id']);return setRelationship(_0x43646a,_0x551cf3,_0x5142d7,_0x3cf3('0x61'));})[_0x3cf3('0x2b')](function(){return setRelationship(_0x43646a,_0x3fe1fc,_0x5142d7,_0x3cf3('0x62'));})[_0x3cf3('0x2b')](function(){return getServerInfo(_0x43646a);})[_0x3cf3('0x2b')](function(_0x2e89d0){var _0x2aa837=parseInt(_0x2e89d0[_0x3cf3('0x63')]['charAt'](0x0));var _0x3e4119=util['format'](_0x3cf3('0x64'),_0x2e1f29[_0x3cf3('0x53')],_0x5142d7['id']);if(_0x2aa837>0x6){_0x3e4119=util[_0x3cf3('0x20')](_0x3cf3('0x65'),_0x2e1f29[_0x3cf3('0x53')],_0x5142d7['id']);}logger[_0x3cf3('0xc')](_0x3cf3('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3cf3('0x20')](_0x3cf3('0x66'),_0x7fd054['name']),_0x3cf3('0x67'),{'uri':_0x3e4119});})[_0x3cf3('0x68')](function(_0x17aefd){logger['error'](_0x3cf3('0x57'),JSON[_0x3cf3('0x1f')](_0x17aefd));});};exports[_0x3cf3('0x69')]=function(_0x4472b6,_0x4c257f,_0x3aacc1,_0x4a115f,_0x2553a2,_0x36ffcf,_0x509034){var _0x3af99a,_0x11d99b,_0x3d9785,_0x464789;_0x36ffcf[_0x3cf3('0x53')]=intUtil[_0x3cf3('0x54')](_0x36ffcf['remoteUri']);_0x36ffcf[_0x3cf3('0x55')]=intUtil['stripTrailingSlash'](_0x36ffcf['serverUrl']);def[_0x3cf3('0x6a')]=util[_0x3cf3('0x20')](_0x3cf3('0x6b'),_0x36ffcf['remoteUri']);if(_0x509034&&_0x509034[_0x3cf3('0x6c')]&&_0x509034['recordingFormat']!==_0x3cf3('0x6d')){logger[_0x3cf3('0xc')](_0x3cf3('0x6e'),_0x3cf3('0x58'));_0x4c257f[_0x3cf3('0x59')]=util[_0x3cf3('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36ffcf['serverUrl'],_0x4c257f[_0x3cf3('0x5b')],md5(_0x4c257f[_0x3cf3('0x5b')]));}return getConnection(_0x36ffcf)[_0x3cf3('0x2b')](function(_0x109dbb){_0x464789=_0x109dbb;return getUser(_0x36ffcf,_0x4a115f[_0x3cf3('0x29')],_0x464789);})[_0x3cf3('0x2b')](function(_0x155f03){_0x3af99a=_0x155f03;logger['info'](_0x3cf3('0x5c'),_0x3af99a['id']);return getEndUser(_0x36ffcf,_0x4c257f['destcalleridname'],_0x4c257f[_0x3cf3('0x6f')],_0x464789);})[_0x3cf3('0x2b')](function(_0xf122de){_0x11d99b=_0xf122de;logger[_0x3cf3('0xc')]('The\x20Enduser\x20ID\x20is:',_0x11d99b['id']);return getTicket(_0x36ffcf,_0x3af99a,_0x11d99b,_0x3aacc1,_0x4c257f,_0x3aacc1[_0x3cf3('0x5e')],_0x464789,_0x3cf3('0x70'));})[_0x3cf3('0x2b')](function(_0x57a712){_0x3d9785=_0x57a712;logger[_0x3cf3('0xc')](_0x3cf3('0x60'));logger[_0x3cf3('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3d9785['id']);return setRelationship(_0x464789,_0x3af99a,_0x3d9785,_0x3cf3('0x61'));})[_0x3cf3('0x2b')](function(){return setRelationship(_0x464789,_0x11d99b,_0x3d9785,_0x3cf3('0x62'));})[_0x3cf3('0x2b')](function(){return getServerInfo(_0x464789);})['then'](function(_0xeb0cb0){var _0x572e05=parseInt(_0xeb0cb0[_0x3cf3('0x63')][_0x3cf3('0x71')](0x0));var _0x235c8e=util[_0x3cf3('0x20')](_0x3cf3('0x64'),_0x36ffcf['remoteUri'],_0x3d9785['id']);if(_0x572e05>0x6){_0x235c8e=util[_0x3cf3('0x20')](_0x3cf3('0x65'),_0x36ffcf[_0x3cf3('0x53')],_0x3d9785['id']);}logger[_0x3cf3('0xc')](_0x3cf3('0x6e'),_0x3cf3('0x72'));emit(util[_0x3cf3('0x20')](_0x3cf3('0x66'),_0x4a115f[_0x3cf3('0x29')]),'trigger:browser:url',{'uri':_0x235c8e});})[_0x3cf3('0x68')](function(_0x21a1b3){logger['error']('[OUTBOUND]',JSON[_0x3cf3('0x1f')](_0x21a1b3));});};exports[_0x3cf3('0x73')]=function(_0x424364,_0x26a93e,_0x6671b0,_0xfcdfdf,_0x3b45aa,_0x44a3e2){var _0xd4cb5b,_0x3ac93a,_0x47768a,_0x273fe1;_0x44a3e2[_0x3cf3('0x53')]=intUtil[_0x3cf3('0x54')](_0x44a3e2['remoteUri']);_0x44a3e2['serverUrl']=intUtil[_0x3cf3('0x54')](_0x44a3e2[_0x3cf3('0x55')]);def[_0x3cf3('0x6a')]=util[_0x3cf3('0x20')](_0x3cf3('0x6b'),_0x44a3e2[_0x3cf3('0x53')]);if(_0x3b45aa&&_0x3b45aa['monitor_format']){logger[_0x3cf3('0xc')]('['+_0x26a93e['lastevent'][_0x3cf3('0x74')]()+']','Recording\x20is\x20enabled!');_0x26a93e[_0x3cf3('0x59')]=util[_0x3cf3('0x20')](_0x3cf3('0x5a'),_0x44a3e2[_0x3cf3('0x55')],_0x26a93e[_0x3cf3('0x5b')],md5(_0x26a93e[_0x3cf3('0x5b')]));}else{_0x26a93e[_0x3cf3('0x59')]='';}return getConnection(_0x44a3e2)[_0x3cf3('0x2b')](function(_0x571039){_0x273fe1=_0x571039;if(!_[_0x3cf3('0x25')](_0xfcdfdf)){return getUser(_0x44a3e2,_0xfcdfdf[_0x3cf3('0x29')],_0x273fe1);}else{return getUser(_0x44a3e2,null,_0x273fe1);}})[_0x3cf3('0x2b')](function(_0x2a562c){_0xd4cb5b=_0x2a562c;logger[_0x3cf3('0xc')]('The\x20User\x20ID\x20is:',_0xd4cb5b['id']);return getEndUser(_0x44a3e2,_0x26a93e[_0x3cf3('0x5d')],_0x26a93e[_0x3cf3('0x75')],_0x273fe1);})[_0x3cf3('0x2b')](function(_0x204c12){_0x3ac93a=_0x204c12;logger[_0x3cf3('0xc')](_0x3cf3('0x76'),_0x3ac93a['id']);return getTicket(_0x44a3e2,_0xd4cb5b,_0x3ac93a,_0x6671b0,_0x26a93e,_0x6671b0[_0x3cf3('0x5e')],_0x273fe1,_0x3cf3('0x5f'));})[_0x3cf3('0x2b')](function(_0x915da1){_0x47768a=_0x915da1;logger[_0x3cf3('0xc')]('Ticket\x20created!');logger[_0x3cf3('0xc')](_0x3cf3('0x77'),_0x47768a['id']);return setRelationship(_0x273fe1,_0xd4cb5b,_0x47768a,_0x3cf3('0x61'));})[_0x3cf3('0x2b')](function(){return setRelationship(_0x273fe1,_0x3ac93a,_0x47768a,_0x3cf3('0x62'));})['then'](function(){return getServerInfo(_0x273fe1);})[_0x3cf3('0x68')](function(_0xe7828){logger[_0x3cf3('0x78')]('['+_0x26a93e[_0x3cf3('0x79')]['toUpperCase']()+']',JSON[_0x3cf3('0x1f')](_0xe7828));});}; \ 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 fe05436..c32c0dd 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 _0x6a8b=['toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','slice','lastIndexOf','isNil','test','lodash','util','sortBy','length','type','string','push','variable','variableName','toString','customVariable','Variable','name'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6a8b,0x1bb));var _0xb6a8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6a8b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xb6a8('0x0'));var util=require(_0xb6a8('0x1'));exports['getString']=function(_0xa5d5a1,_0xaa0f2b,_0x1ca011){var _0x44a401=[];if(_0xa5d5a1['length']>0x0){var _0x4a3791=_[_0xb6a8('0x2')](_0xa5d5a1,['id']);for(var _0x1e5825=0x0;_0x1e5825<_0x4a3791[_0xb6a8('0x3')];_0x1e5825++){var _0x361568=_0x4a3791[_0x1e5825];if(_0x361568[_0xb6a8('0x4')]===_0xb6a8('0x5')){_0x44a401[_0xb6a8('0x6')](_0x361568['content']);}else if(_0x361568[_0xb6a8('0x4')]===_0xb6a8('0x7')&&_0x361568[_0xb6a8('0x8')]){_0xaa0f2b[_0x361568[_0xb6a8('0x8')]]&&_0x44a401[_0xb6a8('0x6')](_0xaa0f2b[_0x361568[_0xb6a8('0x8')]][_0xb6a8('0x9')]());}else if(_0x361568['type']===_0xb6a8('0xa')&&_0x361568[_0xb6a8('0xb')]&&_0x361568[_0xb6a8('0xb')][_0xb6a8('0xc')]){_0xaa0f2b[_0x361568[_0xb6a8('0xb')][_0xb6a8('0xc')][_0xb6a8('0xd')]()]&&_0x44a401[_0xb6a8('0x6')](_0xaa0f2b[_0x361568[_0xb6a8('0xb')][_0xb6a8('0xc')][_0xb6a8('0xd')]()][_0xb6a8('0x9')]());}else if(_0x361568['type']===_0xb6a8('0xe')){if(_0x361568[_0xb6a8('0xf')]===_0xb6a8('0x5')&&_0x361568[_0xb6a8('0x10')]){_0x44a401[_0xb6a8('0x6')](util[_0xb6a8('0x11')](_0xb6a8('0x12'),_0x361568[_0xb6a8('0x10')],_0x361568[_0xb6a8('0x13')]));}else if(_0x361568[_0xb6a8('0xf')]==='variable'&&_0x361568[_0xb6a8('0x8')]&&_0x361568[_0xb6a8('0x10')]){_0xaa0f2b[_0x361568[_0xb6a8('0x8')]]&&_0x44a401['push'](util[_0xb6a8('0x11')]('%s:\x20%s',_0x361568[_0xb6a8('0x10')],_0xaa0f2b[_0x361568[_0xb6a8('0x8')]]));}else if(_0x361568[_0xb6a8('0xf')]===_0xb6a8('0xa')&&_0x361568[_0xb6a8('0xb')]&&_0x361568[_0xb6a8('0xb')]['name']&&_0x361568[_0xb6a8('0x10')]){_0xaa0f2b[_0x361568[_0xb6a8('0xb')][_0xb6a8('0xc')][_0xb6a8('0xd')]()]&&_0x44a401[_0xb6a8('0x6')](util[_0xb6a8('0x11')](_0xb6a8('0x12'),_0x361568[_0xb6a8('0x10')],_0xaa0f2b[_0x361568[_0xb6a8('0xb')][_0xb6a8('0xc')]['toLowerCase']()]));}}}}return _0x44a401['join'](_0x1ca011);};exports['stripTrailingSlash']=function(_0x4f1a0a){var _0x4784ad=_0x4f1a0a[_0xb6a8('0x14')](-0x1);if(_0x4784ad==='/'){_0x4f1a0a=_0x4f1a0a['substring'](0x0,_0x4f1a0a[_0xb6a8('0x15')](_0x4784ad));}return _0x4f1a0a;};exports['validateEmail']=function(_0x453a17){if(!_[_0xb6a8('0x16')](_0x453a17)&&_0x453a17!==''){var _0x3b38e8=/^(([^<>()\[\]\\.,;:\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 _0x3b38e8[_0xb6a8('0x17')](String(_0x453a17)[_0xb6a8('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x2ae3=['string','content','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','isNil','test','util','getString','sortBy','length','type'];(function(_0x248db3,_0x2a651b){var _0x45a189=function(_0x154de8){while(--_0x154de8){_0x248db3['push'](_0x248db3['shift']());}};_0x45a189(++_0x2a651b);}(_0x2ae3,0x9d));var _0x32ae=function(_0x320da8,_0x9d618b){_0x320da8=_0x320da8-0x0;var _0x2a73e3=_0x2ae3[_0x320da8];return _0x2a73e3;};'use strict';var _=require('lodash');var util=require(_0x32ae('0x0'));exports[_0x32ae('0x1')]=function(_0xc294ea,_0x4a120a,_0x5ed6e3){var _0x6a1787=[];if(_0xc294ea['length']>0x0){var _0x4ae5fa=_[_0x32ae('0x2')](_0xc294ea,['id']);for(var _0x57d9d9=0x0;_0x57d9d9<_0x4ae5fa[_0x32ae('0x3')];_0x57d9d9++){var _0x2a6266=_0x4ae5fa[_0x57d9d9];if(_0x2a6266[_0x32ae('0x4')]===_0x32ae('0x5')){_0x6a1787['push'](_0x2a6266[_0x32ae('0x6')]);}else if(_0x2a6266[_0x32ae('0x4')]==='variable'&&_0x2a6266[_0x32ae('0x7')]){_0x4a120a[_0x2a6266[_0x32ae('0x7')]]&&_0x6a1787[_0x32ae('0x8')](_0x4a120a[_0x2a6266[_0x32ae('0x7')]][_0x32ae('0x9')]());}else if(_0x2a6266[_0x32ae('0x4')]===_0x32ae('0xa')&&_0x2a6266[_0x32ae('0xb')]&&_0x2a6266[_0x32ae('0xb')]['name']){_0x4a120a[_0x2a6266[_0x32ae('0xb')][_0x32ae('0xc')][_0x32ae('0xd')]()]&&_0x6a1787[_0x32ae('0x8')](_0x4a120a[_0x2a6266[_0x32ae('0xb')][_0x32ae('0xc')][_0x32ae('0xd')]()][_0x32ae('0x9')]());}else if(_0x2a6266[_0x32ae('0x4')]===_0x32ae('0xe')){if(_0x2a6266[_0x32ae('0xf')]===_0x32ae('0x5')&&_0x2a6266[_0x32ae('0x10')]){_0x6a1787[_0x32ae('0x8')](util[_0x32ae('0x11')](_0x32ae('0x12'),_0x2a6266[_0x32ae('0x10')],_0x2a6266[_0x32ae('0x13')]));}else if(_0x2a6266[_0x32ae('0xf')]===_0x32ae('0x14')&&_0x2a6266[_0x32ae('0x7')]&&_0x2a6266[_0x32ae('0x10')]){_0x4a120a[_0x2a6266[_0x32ae('0x7')]]&&_0x6a1787[_0x32ae('0x8')](util[_0x32ae('0x11')](_0x32ae('0x12'),_0x2a6266[_0x32ae('0x10')],_0x4a120a[_0x2a6266[_0x32ae('0x7')]]));}else if(_0x2a6266[_0x32ae('0xf')]===_0x32ae('0xa')&&_0x2a6266[_0x32ae('0xb')]&&_0x2a6266[_0x32ae('0xb')][_0x32ae('0xc')]&&_0x2a6266[_0x32ae('0x10')]){_0x4a120a[_0x2a6266[_0x32ae('0xb')]['name'][_0x32ae('0xd')]()]&&_0x6a1787[_0x32ae('0x8')](util[_0x32ae('0x11')](_0x32ae('0x12'),_0x2a6266[_0x32ae('0x10')],_0x4a120a[_0x2a6266['Variable'][_0x32ae('0xc')][_0x32ae('0xd')]()]));}}}}return _0x6a1787[_0x32ae('0x15')](_0x5ed6e3);};exports[_0x32ae('0x16')]=function(_0x384693){var _0x166ece=_0x384693[_0x32ae('0x17')](-0x1);if(_0x166ece==='/'){_0x384693=_0x384693[_0x32ae('0x18')](0x0,_0x384693['lastIndexOf'](_0x166ece));}return _0x384693;};exports['validateEmail']=function(_0x59cf5e){if(!_[_0x32ae('0x19')](_0x59cf5e)&&_0x59cf5e!==''){var _0x55bf5e=/^(([^<>()\[\]\\.,;:\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 _0x55bf5e[_0x32ae('0x1a')](String(_0x59cf5e)['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 41fd6d4..322035a 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(_0xc83285,_0x3860f3){var _0x59ef36=function(_0x375eaf){while(--_0x375eaf){_0xc83285['push'](_0xc83285['shift']());}};_0x59ef36(++_0x3860f3);}(_0xe706,0xa3));var _0x6e70=function(_0x206498,_0x2fe953){_0x206498=_0x206498-0x0;var _0x54a0d0=_0xe706[_0x206498];return _0x54a0d0;};'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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 6d15346..b290602 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 _0x538c=['name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','count','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','includes','picklist','type','nameField','customField','toLowerCase','content','string','custom_fields','push','variable','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Authorization','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]','replace','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','remoteUri','POST','merge','Tags'];(function(_0x8d8650,_0x1c4c0d){var _0x4c9154=function(_0x1809dc){while(--_0x1809dc){_0x8d8650['push'](_0x8d8650['shift']());}};_0x4c9154(++_0x1c4c0d);}(_0x538c,0xd1));var _0xc538=function(_0xae8f4,_0x5e355c){_0xae8f4=_0xae8f4-0x0;var _0x48f5e9=_0x538c[_0xae8f4];return _0x48f5e9;};'use strict';var _=require(_0xc538('0x0'));var rp=require(_0xc538('0x1'));var md5=require(_0xc538('0x2'));var util=require(_0xc538('0x3'));var Redis=require(_0xc538('0x4'));var intUtil=require(_0xc538('0x5'));var config=require(_0xc538('0x6'));var logger=require(_0xc538('0x7'))('zendesk');config['redis']=_[_0xc538('0x8')](config[_0xc538('0x9')],{'host':_0xc538('0xa'),'port':0x18eb});var io=require(_0xc538('0xb'))(new Redis(config[_0xc538('0x9')]));function emit(_0x578e5c,_0x691b30,_0x369393){io['to'](_0x578e5c)[_0xc538('0xc')](_0x691b30,_0x369393);}var headers={'Content-Type':'application/json','Accept':_0xc538('0xd')};function getTicket(_0x42d461,_0x49329c,_0x4ca5c,_0x257026,_0x81bb66){logger[_0xc538('0xe')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x42d461[_0xc538('0xf')]),'method':_0xc538('0x10'),'body':{'ticket':_[_0xc538('0x11')]({'requester_id':_0x4ca5c['id'],'submitter_id':_0x49329c?_0x49329c['id']:undefined,'assignee_id':_0x49329c?_0x49329c['id']:undefined,'tags':getTags(_0x257026[_0xc538('0x12')],_0xc538('0x13')),'subject':intUtil[_0xc538('0x14')](_0x257026[_0xc538('0x15')],_0x81bb66,'\x20'),'description':intUtil['getString'](_0x257026[_0xc538('0x16')],_0x81bb66,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x257026['Descriptions'],_0x81bb66,'\x0a')}},getCustomFields(_0x257026[_0xc538('0x17')],_0x81bb66))}})[_0xc538('0x18')](function(_0x1f35f7){logger[_0xc538('0xe')](_0xc538('0x19'));return _0x1f35f7[_0xc538('0x1a')];});}function getUser(_0x24ac4d,_0x336a96){if(intUtil[_0xc538('0x1b')](_0x336a96)){logger['info'](_0xc538('0x1c'),_0x336a96);return request({'uri':util['format'](_0xc538('0x1d'),_0x24ac4d[_0xc538('0xf')]),'qs':{'query':util[_0xc538('0x1e')]('type:user\x20role:agent\x20email:%s',_0x336a96)}})[_0xc538('0x18')](function(_0x5ea623){if(_0x5ea623[_0xc538('0x1f')]){logger[_0xc538('0xe')]('Agent\x20found!');return _['find'](_0x5ea623['results'],{'email':_0x336a96,'role':'agent'});}else{logger[_0xc538('0xe')](_0xc538('0x20'));return request({'uri':util[_0xc538('0x1e')](_0xc538('0x21'),_0x24ac4d[_0xc538('0xf')])})[_0xc538('0x18')](function(_0x4280b1){logger[_0xc538('0xe')](_0xc538('0x22'));return _0x4280b1[_0xc538('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x24ac4d['remoteUri'])})[_0xc538('0x18')](function(_0x224603){logger[_0xc538('0xe')](_0xc538('0x22'));return _0x224603['user'];});}}function getEndUser(_0x4f2edf,_0x1f1fc8,_0x557a50){logger['info'](_0xc538('0x24'),_0x557a50);return request({'uri':util[_0xc538('0x1e')](_0xc538('0x1d'),_0x4f2edf[_0xc538('0xf')]),'qs':{'query':util['format'](_0xc538('0x25'),_0x557a50)}})[_0xc538('0x18')](function(_0x186744){var _0x5070dd;if(_0x186744[_0xc538('0x26')][_0xc538('0x27')]){_0x186744[_0xc538('0x26')]=_['filter'](_0x186744['results'],{'suspended':![],'role':_0xc538('0x28')});if(_0x186744[_0xc538('0x26')][_0xc538('0x27')]){_0x5070dd=_[_0xc538('0x29')](_0x186744[_0xc538('0x26')]);}}if(_0x5070dd){logger['info'](_0xc538('0x2a'));return _0x5070dd;}else{logger[_0xc538('0xe')](_0xc538('0x2b'));return request({'uri':util[_0xc538('0x1e')]('%s/users.json',_0x4f2edf['remoteUri']),'method':'POST','body':{'user':{'role':_0xc538('0x28'),'name':util[_0xc538('0x1e')](_0xc538('0x2c'),_0x1f1fc8||_0x557a50),'phone':_0x557a50}}})[_0xc538('0x18')](function(_0x3977da){logger[_0xc538('0xe')](_0xc538('0x2d'));return _0x3977da[_0xc538('0x23')];});}});}function getAuth(_0x50e127){var _0x319695;if(_0x50e127[_0xc538('0x2e')]===_0xc538('0x2f')){_0x319695=util[_0xc538('0x1e')]('%s:%s',_0x50e127[_0xc538('0x30')],_0x50e127['password']);}else if(_0x50e127[_0xc538('0x2e')]===_0xc538('0x31')){_0x319695=util[_0xc538('0x1e')]('%s/token:%s',_0x50e127[_0xc538('0x30')],_0x50e127[_0xc538('0x31')]);}return util['format'](_0xc538('0x32'),new Buffer(_0x319695)[_0xc538('0x33')](_0xc538('0x34')));}function request(_0x3ef9db){logger[_0xc538('0x35')](_0xc538('0x36'),JSON[_0xc538('0x37')](_0x3ef9db));return rp(_['defaults'](_0x3ef9db,{'method':_0xc538('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x1b7eb3,_0x3d27a3){var _0x5717b0=[];if(_0x1b7eb3&&_0x1b7eb3[_0xc538('0x27')]>0x0){_0x5717b0=_[_0xc538('0x39')](_0x1b7eb3,_0x3d27a3);}return _0x5717b0;}function getCustomFields(_0x81bb02,_0x20e04d){var _0x1e5f02=[];var _0x3be7f0={'custom_fields':[]};if(_0x81bb02[_0xc538('0x27')]>0x0){_['forEach'](_0x81bb02,function(_0x3dcc7e){if(_[_0xc538('0x3a')](['string',_0xc538('0x3b')],_0x3dcc7e[_0xc538('0x3c')])&&_0x3dcc7e[_0xc538('0x3d')]&&!_0x3dcc7e[_0xc538('0x3e')]){_0x3be7f0[_0x3dcc7e[_0xc538('0x3d')][_0xc538('0x3f')]()]=_0x3dcc7e[_0xc538('0x40')]['toString']();}else if(_['includes']([_0xc538('0x41'),'picklist'],_0x3dcc7e[_0xc538('0x3c')])&&_0x3dcc7e['idField']&&_0x3dcc7e[_0xc538('0x3e')]){_0x3be7f0[_0xc538('0x42')][_0xc538('0x43')]({'id':_0x3dcc7e['idField'],'value':_0x3dcc7e['content'][_0xc538('0x33')]()});}else if(_0x3dcc7e[_0xc538('0x3c')]===_0xc538('0x44')&&_0x3dcc7e['variableName']&&_0x3dcc7e[_0xc538('0x45')]&&_0x3dcc7e[_0xc538('0x3e')]){_0x20e04d[_0x3dcc7e[_0xc538('0x46')]]&&_0x3be7f0[_0xc538('0x42')][_0xc538('0x43')]({'id':_0x3dcc7e[_0xc538('0x45')],'value':_0x20e04d[_0x3dcc7e[_0xc538('0x46')]]['toString']()});}else if(_0x3dcc7e[_0xc538('0x3c')]===_0xc538('0x47')&&_0x3dcc7e[_0xc538('0x48')]&&_0x3dcc7e[_0xc538('0x48')]['name']&&_0x3dcc7e[_0xc538('0x45')]&&_0x3dcc7e['customField']){_0x20e04d[_0x3dcc7e['Variable'][_0xc538('0x13')][_0xc538('0x3f')]()]&&_0x3be7f0['custom_fields'][_0xc538('0x43')]({'id':_0x3dcc7e[_0xc538('0x45')],'value':_0x20e04d[_0x3dcc7e['Variable'][_0xc538('0x13')][_0xc538('0x3f')]()][_0xc538('0x33')]()});}});}return _0x3be7f0;}exports[_0xc538('0x49')]=function(_0x3f7d8d,_0x35cb4d,_0xcb3b0d,_0x56c872,_0x15ff88,_0x3dcd06){var _0x49d249,_0x55de5a;_0x3dcd06[_0xc538('0xf')]=intUtil[_0xc538('0x4a')](_0x3dcd06['remoteUri']);_0x3dcd06['serverUrl']=intUtil[_0xc538('0x4a')](_0x3dcd06[_0xc538('0x4b')]);if(_0x15ff88&&_0x15ff88[_0xc538('0x4c')]){logger['info']('[QUEUE]',_0xc538('0x4d'));_0x35cb4d[_0xc538('0x4e')]=util['format'](_0xc538('0x4f'),_0x3dcd06[_0xc538('0x4b')],_0x35cb4d[_0xc538('0x50')],md5(_0x35cb4d[_0xc538('0x50')]));}else{_0x35cb4d[_0xc538('0x4e')]='';}headers['Authorization']=getAuth(_0x3dcd06);return getUser(_0x3dcd06,_0x56c872[_0xc538('0x51')])[_0xc538('0x18')](function(_0x330eba){_0x49d249=_0x330eba;logger[_0xc538('0xe')](_0xc538('0x52'),_0x49d249['id']);return getEndUser(_0x3dcd06,_0x35cb4d[_0xc538('0x53')],_0x35cb4d[_0xc538('0x54')]);})[_0xc538('0x18')](function(_0x12a1ee){_0x55de5a=_0x12a1ee;logger[_0xc538('0xe')](_0xc538('0x55'),_0x55de5a['id']);return getTicket(_0x3dcd06,_0x49d249,_0x55de5a,_0xcb3b0d,_0x35cb4d);})[_0xc538('0x18')](function(_0x482b05){if(_0x482b05){logger[_0xc538('0xe')](_0xc538('0x56'),_0x482b05['id']);switch(_0x3dcd06['type']){case'integrationTab':logger['info']('[QUEUE]',_0xc538('0x57'));return request({'uri':util[_0xc538('0x1e')](_0xc538('0x58'),_0x3dcd06[_0xc538('0xf')],_0x49d249['id'],_0x482b05['id']),'method':_0xc538('0x10')});case _0xc538('0x59'):logger[_0xc538('0xe')](_0xc538('0x5a'),_0xc538('0x5b'));emit(util[_0xc538('0x1e')](_0xc538('0x5c'),_0x56c872[_0xc538('0x13')]),_0xc538('0x5d'),{'uri':util[_0xc538('0x1e')](_0xc538('0x5e'),_0x3dcd06[_0xc538('0xf')]['replace'](_0xc538('0x5f'),''),_0x482b05['id'])});break;default:logger[_0xc538('0x60')](_0xc538('0x5a'),_0xc538('0x61'));}}})[_0xc538('0x62')](function(_0x3ef42c){logger['error'](_0xc538('0x63'),util[_0xc538('0x64')](_0x3ef42c,{'showHidden':!![],'depth':null}));});};exports[_0xc538('0x65')]=function(_0x322fd2,_0x590d7,_0x3591d2,_0x1bb884,_0x3e7cf7,_0x1e9ea5,_0x592ae0){var _0x2d0a8f,_0x52faf8;_0x1e9ea5['remoteUri']=intUtil[_0xc538('0x4a')](_0x1e9ea5[_0xc538('0xf')]);_0x1e9ea5[_0xc538('0x4b')]=intUtil[_0xc538('0x4a')](_0x1e9ea5[_0xc538('0x4b')]);if(_0x592ae0&&_0x592ae0['recordingFormat']&&_0x592ae0[_0xc538('0x66')]!==_0xc538('0x67')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x590d7[_0xc538('0x4e')]=util[_0xc538('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e9ea5['serverUrl'],_0x590d7['uniqueid'],md5(_0x590d7['uniqueid']));}headers[_0xc538('0x68')]=getAuth(_0x1e9ea5);return getUser(_0x1e9ea5,_0x1bb884[_0xc538('0x51')])[_0xc538('0x18')](function(_0x5234bb){_0x2d0a8f=_0x5234bb;logger[_0xc538('0xe')]('The\x20User\x20ID\x20is:',_0x2d0a8f['id']);return getEndUser(_0x1e9ea5,_0x590d7[_0xc538('0x69')],_0x590d7[_0xc538('0x6a')]);})[_0xc538('0x18')](function(_0xc6eb56){_0x52faf8=_0xc6eb56;logger[_0xc538('0xe')](_0xc538('0x55'),_0x52faf8['id']);return getTicket(_0x1e9ea5,_0x2d0a8f,_0x52faf8,_0x3591d2,_0x590d7);})[_0xc538('0x18')](function(_0x623268){if(_0x623268){logger[_0xc538('0xe')](_0xc538('0x56'),_0x623268['id']);switch(_0x1e9ea5['type']){case _0xc538('0x6b'):logger[_0xc538('0xe')](_0xc538('0x6c'),_0xc538('0x57'));return request({'uri':util['format'](_0xc538('0x58'),_0x1e9ea5['remoteUri'],_0x2d0a8f['id'],_0x623268['id']),'method':_0xc538('0x10')});case _0xc538('0x59'):logger[_0xc538('0xe')](_0xc538('0x6c'),_0xc538('0x5b'));emit(util['format'](_0xc538('0x5c'),_0x1bb884[_0xc538('0x13')]),_0xc538('0x5d'),{'uri':util[_0xc538('0x1e')]('%s/agent/tickets/%s',_0x1e9ea5['remoteUri'][_0xc538('0x6d')](_0xc538('0x5f'),''),_0x623268['id'])});break;default:logger[_0xc538('0x60')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc538('0x62')](function(_0x107d60){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xc538('0x64')](_0x107d60,{'showHidden':!![],'depth':null}));});};exports[_0xc538('0x6e')]=function(_0x34936c,_0x13c283,_0x1ecdf0,_0x4f2c50,_0x3036a6,_0x255d1b){var _0x350a7e,_0x41027e;_0x255d1b[_0xc538('0xf')]=intUtil[_0xc538('0x4a')](_0x255d1b[_0xc538('0xf')]);_0x255d1b[_0xc538('0x4b')]=intUtil[_0xc538('0x4a')](_0x255d1b[_0xc538('0x4b')]);if(_0x3036a6&&_0x3036a6[_0xc538('0x4c')]){logger['info']('['+_0x13c283[_0xc538('0x6f')][_0xc538('0x70')]()+']','Recording\x20is\x20enabled!');_0x13c283['recordingURL']=util[_0xc538('0x1e')](_0xc538('0x4f'),_0x255d1b['serverUrl'],_0x13c283['uniqueid'],md5(_0x13c283[_0xc538('0x50')]));}else{_0x13c283[_0xc538('0x4e')]='';}headers[_0xc538('0x68')]=getAuth(_0x255d1b);return getUser(_0x255d1b)['then'](function(_0x12e4dc){_0x350a7e=_0x12e4dc;logger[_0xc538('0xe')](_0xc538('0x52'),_0x350a7e['id']);return getEndUser(_0x255d1b,_0x13c283[_0xc538('0x53')],_0x13c283['calleridnum']);})[_0xc538('0x18')](function(_0x501bdb){_0x41027e=_0x501bdb;logger[_0xc538('0xe')](_0xc538('0x55'),_0x41027e['id']);return getTicket(_0x255d1b,_0x350a7e,_0x41027e,_0x1ecdf0,_0x13c283);})[_0xc538('0x18')](function(_0x348e2f){if(_0x348e2f){logger['info'](_0xc538('0x56'),_0x348e2f['id']);}})['catch'](function(_0x1fd58f){logger[_0xc538('0x60')]('['+_0x13c283['lastevent']['toUpperCase']()+']'+_0xc538('0x71'),util[_0xc538('0x64')](_0x1fd58f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc3a6=['string','nameField','toLowerCase','content','picklist','type','custom_fields','push','idField','variable','variableName','customField','customVariable','Variable','queue','stripTrailingSlash','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','replace','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','util','ioredis','./util','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','remoteUri','POST','Tags','name','Subjects','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','%s:%s','password','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes'];(function(_0x1d5b3f,_0x4fc7af){var _0x303161=function(_0x49f75d){while(--_0x49f75d){_0x1d5b3f['push'](_0x1d5b3f['shift']());}};_0x303161(++_0x4fc7af);}(_0xc3a6,0x107));var _0x6c3a=function(_0x39fee5,_0x33f715){_0x39fee5=_0x39fee5-0x0;var _0x43c19d=_0xc3a6[_0x39fee5];return _0x43c19d;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x6c3a('0x0'));var Redis=require(_0x6c3a('0x1'));var intUtil=require(_0x6c3a('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x6c3a('0x3'));config[_0x6c3a('0x4')]=_[_0x6c3a('0x5')](config[_0x6c3a('0x4')],{'host':_0x6c3a('0x6'),'port':0x18eb});var io=require(_0x6c3a('0x7'))(new Redis(config[_0x6c3a('0x4')]));function emit(_0x5ecabb,_0x3dfce2,_0x5593f2){io['to'](_0x5ecabb)[_0x6c3a('0x8')](_0x3dfce2,_0x5593f2);}var headers={'Content-Type':_0x6c3a('0x9'),'Accept':'application/json'};function getTicket(_0x369424,_0x1c83a1,_0x506442,_0x500b8e,_0x2061c6){logger[_0x6c3a('0xa')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x369424[_0x6c3a('0xb')]),'method':_0x6c3a('0xc'),'body':{'ticket':_['merge']({'requester_id':_0x506442['id'],'submitter_id':_0x1c83a1?_0x1c83a1['id']:undefined,'assignee_id':_0x1c83a1?_0x1c83a1['id']:undefined,'tags':getTags(_0x500b8e[_0x6c3a('0xd')],_0x6c3a('0xe')),'subject':intUtil['getString'](_0x500b8e[_0x6c3a('0xf')],_0x2061c6,'\x20'),'description':intUtil[_0x6c3a('0x10')](_0x500b8e[_0x6c3a('0x11')],_0x2061c6,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x500b8e[_0x6c3a('0x11')],_0x2061c6,'\x0a')}},getCustomFields(_0x500b8e[_0x6c3a('0x12')],_0x2061c6))}})[_0x6c3a('0x13')](function(_0x57daeb){logger[_0x6c3a('0xa')]('Ticket\x20created!');return _0x57daeb[_0x6c3a('0x14')];});}function getUser(_0x2cb175,_0x37b9c7){if(intUtil[_0x6c3a('0x15')](_0x37b9c7)){logger['info'](_0x6c3a('0x16'),_0x37b9c7);return request({'uri':util[_0x6c3a('0x17')](_0x6c3a('0x18'),_0x2cb175[_0x6c3a('0xb')]),'qs':{'query':util[_0x6c3a('0x17')](_0x6c3a('0x19'),_0x37b9c7)}})['then'](function(_0xf2c3f){if(_0xf2c3f[_0x6c3a('0x1a')]){logger[_0x6c3a('0xa')]('Agent\x20found!');return _[_0x6c3a('0x1b')](_0xf2c3f[_0x6c3a('0x1c')],{'email':_0x37b9c7,'role':_0x6c3a('0x1d')});}else{logger[_0x6c3a('0xa')](_0x6c3a('0x1e'));return request({'uri':util[_0x6c3a('0x17')](_0x6c3a('0x1f'),_0x2cb175[_0x6c3a('0xb')])})[_0x6c3a('0x13')](function(_0x14180a){logger['info'](_0x6c3a('0x20'));return _0x14180a[_0x6c3a('0x21')];});}});}else{logger[_0x6c3a('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6c3a('0x17')](_0x6c3a('0x1f'),_0x2cb175[_0x6c3a('0xb')])})[_0x6c3a('0x13')](function(_0x23a423){logger[_0x6c3a('0xa')](_0x6c3a('0x20'));return _0x23a423[_0x6c3a('0x21')];});}}function getEndUser(_0x704655,_0x700205,_0x57cbaf){logger[_0x6c3a('0xa')](_0x6c3a('0x22'),_0x57cbaf);return request({'uri':util[_0x6c3a('0x17')](_0x6c3a('0x18'),_0x704655['remoteUri']),'qs':{'query':util['format'](_0x6c3a('0x23'),_0x57cbaf)}})['then'](function(_0x3ee446){var _0x294181;if(_0x3ee446[_0x6c3a('0x1c')]['length']){_0x3ee446['results']=_['filter'](_0x3ee446[_0x6c3a('0x1c')],{'suspended':![],'role':_0x6c3a('0x24')});if(_0x3ee446[_0x6c3a('0x1c')][_0x6c3a('0x25')]){_0x294181=_[_0x6c3a('0x26')](_0x3ee446[_0x6c3a('0x1c')]);}}if(_0x294181){logger[_0x6c3a('0xa')](_0x6c3a('0x27'));return _0x294181;}else{logger[_0x6c3a('0xa')](_0x6c3a('0x28'));return request({'uri':util[_0x6c3a('0x17')]('%s/users.json',_0x704655[_0x6c3a('0xb')]),'method':_0x6c3a('0xc'),'body':{'user':{'role':_0x6c3a('0x24'),'name':util[_0x6c3a('0x17')](_0x6c3a('0x29'),_0x700205||_0x57cbaf),'phone':_0x57cbaf}}})['then'](function(_0x583824){logger[_0x6c3a('0xa')]('Enduser\x20created.');return _0x583824[_0x6c3a('0x21')];});}});}function getAuth(_0x5915c0){var _0x27ac69;if(_0x5915c0[_0x6c3a('0x2a')]==='password'){_0x27ac69=util[_0x6c3a('0x17')](_0x6c3a('0x2b'),_0x5915c0['username'],_0x5915c0[_0x6c3a('0x2c')]);}else if(_0x5915c0[_0x6c3a('0x2a')]===_0x6c3a('0x2d')){_0x27ac69=util[_0x6c3a('0x17')](_0x6c3a('0x2e'),_0x5915c0['username'],_0x5915c0[_0x6c3a('0x2d')]);}return util['format']('Basic\x20%s',new Buffer(_0x27ac69)[_0x6c3a('0x2f')](_0x6c3a('0x30')));}function request(_0x58fc04){logger[_0x6c3a('0x31')](_0x6c3a('0x32'),JSON[_0x6c3a('0x33')](_0x58fc04));return rp(_['defaults'](_0x58fc04,{'method':_0x6c3a('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x95fa5,_0x36dadc){var _0x3022cc=[];if(_0x95fa5&&_0x95fa5['length']>0x0){_0x3022cc=_['map'](_0x95fa5,_0x36dadc);}return _0x3022cc;}function getCustomFields(_0x50c18c,_0x693064){var _0x3aabf5=[];var _0x1e84bf={'custom_fields':[]};if(_0x50c18c[_0x6c3a('0x25')]>0x0){_[_0x6c3a('0x35')](_0x50c18c,function(_0x1f7b95){if(_[_0x6c3a('0x36')]([_0x6c3a('0x37'),'picklist'],_0x1f7b95['type'])&&_0x1f7b95[_0x6c3a('0x38')]&&!_0x1f7b95['customField']){_0x1e84bf[_0x1f7b95['nameField'][_0x6c3a('0x39')]()]=_0x1f7b95[_0x6c3a('0x3a')][_0x6c3a('0x2f')]();}else if(_[_0x6c3a('0x36')]([_0x6c3a('0x37'),_0x6c3a('0x3b')],_0x1f7b95[_0x6c3a('0x3c')])&&_0x1f7b95['idField']&&_0x1f7b95['customField']){_0x1e84bf[_0x6c3a('0x3d')][_0x6c3a('0x3e')]({'id':_0x1f7b95[_0x6c3a('0x3f')],'value':_0x1f7b95[_0x6c3a('0x3a')][_0x6c3a('0x2f')]()});}else if(_0x1f7b95[_0x6c3a('0x3c')]===_0x6c3a('0x40')&&_0x1f7b95[_0x6c3a('0x41')]&&_0x1f7b95[_0x6c3a('0x3f')]&&_0x1f7b95[_0x6c3a('0x42')]){_0x693064[_0x1f7b95[_0x6c3a('0x41')]]&&_0x1e84bf[_0x6c3a('0x3d')][_0x6c3a('0x3e')]({'id':_0x1f7b95[_0x6c3a('0x3f')],'value':_0x693064[_0x1f7b95[_0x6c3a('0x41')]]['toString']()});}else if(_0x1f7b95[_0x6c3a('0x3c')]===_0x6c3a('0x43')&&_0x1f7b95['Variable']&&_0x1f7b95[_0x6c3a('0x44')][_0x6c3a('0xe')]&&_0x1f7b95[_0x6c3a('0x3f')]&&_0x1f7b95[_0x6c3a('0x42')]){_0x693064[_0x1f7b95[_0x6c3a('0x44')][_0x6c3a('0xe')][_0x6c3a('0x39')]()]&&_0x1e84bf[_0x6c3a('0x3d')][_0x6c3a('0x3e')]({'id':_0x1f7b95[_0x6c3a('0x3f')],'value':_0x693064[_0x1f7b95[_0x6c3a('0x44')][_0x6c3a('0xe')][_0x6c3a('0x39')]()][_0x6c3a('0x2f')]()});}});}return _0x1e84bf;}exports[_0x6c3a('0x45')]=function(_0x190a10,_0x533d7a,_0xf1d9c4,_0x1e7a8b,_0x2a3f5d,_0x45f6cc){var _0x57e99e,_0x55b783;_0x45f6cc[_0x6c3a('0xb')]=intUtil[_0x6c3a('0x46')](_0x45f6cc[_0x6c3a('0xb')]);_0x45f6cc['serverUrl']=intUtil['stripTrailingSlash'](_0x45f6cc['serverUrl']);if(_0x2a3f5d&&_0x2a3f5d['monitor_format']){logger['info']('[QUEUE]',_0x6c3a('0x47'));_0x533d7a['recordingURL']=util[_0x6c3a('0x17')](_0x6c3a('0x48'),_0x45f6cc[_0x6c3a('0x49')],_0x533d7a[_0x6c3a('0x4a')],md5(_0x533d7a[_0x6c3a('0x4a')]));}else{_0x533d7a[_0x6c3a('0x4b')]='';}headers[_0x6c3a('0x4c')]=getAuth(_0x45f6cc);return getUser(_0x45f6cc,_0x1e7a8b[_0x6c3a('0x4d')])[_0x6c3a('0x13')](function(_0x4378d3){_0x57e99e=_0x4378d3;logger[_0x6c3a('0xa')](_0x6c3a('0x4e'),_0x57e99e['id']);return getEndUser(_0x45f6cc,_0x533d7a[_0x6c3a('0x4f')],_0x533d7a[_0x6c3a('0x50')]);})['then'](function(_0x5a3cf7){_0x55b783=_0x5a3cf7;logger['info'](_0x6c3a('0x51'),_0x55b783['id']);return getTicket(_0x45f6cc,_0x57e99e,_0x55b783,_0xf1d9c4,_0x533d7a);})[_0x6c3a('0x13')](function(_0x2edc53){if(_0x2edc53){logger[_0x6c3a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2edc53['id']);switch(_0x45f6cc[_0x6c3a('0x3c')]){case _0x6c3a('0x52'):logger[_0x6c3a('0xa')](_0x6c3a('0x53'),_0x6c3a('0x54'));return request({'uri':util[_0x6c3a('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x45f6cc['remoteUri'],_0x57e99e['id'],_0x2edc53['id']),'method':_0x6c3a('0xc')});case'newTab':logger['info'](_0x6c3a('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6c3a('0x17')]('user:%s',_0x1e7a8b['name']),'trigger:browser:url',{'uri':util[_0x6c3a('0x17')]('%s/agent/tickets/%s',_0x45f6cc[_0x6c3a('0xb')][_0x6c3a('0x55')]('/api/v2',''),_0x2edc53['id'])});break;default:logger[_0x6c3a('0x56')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1fbd56){logger[_0x6c3a('0x56')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1fbd56,{'showHidden':!![],'depth':null}));});};exports[_0x6c3a('0x57')]=function(_0x22c04d,_0x35457c,_0x2f24aa,_0x3ed6ad,_0x5be852,_0x164c51,_0x1dc51a){var _0x51d0ea,_0x1f7061;_0x164c51[_0x6c3a('0xb')]=intUtil[_0x6c3a('0x46')](_0x164c51['remoteUri']);_0x164c51['serverUrl']=intUtil[_0x6c3a('0x46')](_0x164c51['serverUrl']);if(_0x1dc51a&&_0x1dc51a[_0x6c3a('0x58')]&&_0x1dc51a[_0x6c3a('0x58')]!==_0x6c3a('0x59')){logger[_0x6c3a('0xa')]('[OUTBOUND]',_0x6c3a('0x47'));_0x35457c[_0x6c3a('0x4b')]=util['format'](_0x6c3a('0x48'),_0x164c51[_0x6c3a('0x49')],_0x35457c['uniqueid'],md5(_0x35457c[_0x6c3a('0x4a')]));}headers['Authorization']=getAuth(_0x164c51);return getUser(_0x164c51,_0x3ed6ad[_0x6c3a('0x4d')])['then'](function(_0x485b7d){_0x51d0ea=_0x485b7d;logger['info']('The\x20User\x20ID\x20is:',_0x51d0ea['id']);return getEndUser(_0x164c51,_0x35457c[_0x6c3a('0x5a')],_0x35457c[_0x6c3a('0x5b')]);})[_0x6c3a('0x13')](function(_0x81045e){_0x1f7061=_0x81045e;logger[_0x6c3a('0xa')](_0x6c3a('0x51'),_0x1f7061['id']);return getTicket(_0x164c51,_0x51d0ea,_0x1f7061,_0x2f24aa,_0x35457c);})[_0x6c3a('0x13')](function(_0x504559){if(_0x504559){logger['info'](_0x6c3a('0x5c'),_0x504559['id']);switch(_0x164c51[_0x6c3a('0x3c')]){case _0x6c3a('0x52'):logger[_0x6c3a('0xa')](_0x6c3a('0x5d'),_0x6c3a('0x54'));return request({'uri':util[_0x6c3a('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x164c51[_0x6c3a('0xb')],_0x51d0ea['id'],_0x504559['id']),'method':'POST'});case _0x6c3a('0x5e'):logger['info']('[OUTBOUND]',_0x6c3a('0x5f'));emit(util[_0x6c3a('0x17')](_0x6c3a('0x60'),_0x3ed6ad[_0x6c3a('0xe')]),_0x6c3a('0x61'),{'uri':util[_0x6c3a('0x17')](_0x6c3a('0x62'),_0x164c51[_0x6c3a('0xb')][_0x6c3a('0x55')](_0x6c3a('0x63'),''),_0x504559['id'])});break;default:logger[_0x6c3a('0x56')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6c3a('0x64')](function(_0x38108f){logger['error'](_0x6c3a('0x65'),util[_0x6c3a('0x66')](_0x38108f,{'showHidden':!![],'depth':null}));});};exports[_0x6c3a('0x67')]=function(_0xdee081,_0x256e57,_0x9b478f,_0x153d47,_0x26c830,_0x4a3a60){var _0x15f5b0,_0x150946;_0x4a3a60[_0x6c3a('0xb')]=intUtil[_0x6c3a('0x46')](_0x4a3a60[_0x6c3a('0xb')]);_0x4a3a60['serverUrl']=intUtil[_0x6c3a('0x46')](_0x4a3a60[_0x6c3a('0x49')]);if(_0x26c830&&_0x26c830['monitor_format']){logger[_0x6c3a('0xa')]('['+_0x256e57[_0x6c3a('0x68')][_0x6c3a('0x69')]()+']',_0x6c3a('0x47'));_0x256e57[_0x6c3a('0x4b')]=util[_0x6c3a('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a3a60['serverUrl'],_0x256e57[_0x6c3a('0x4a')],md5(_0x256e57[_0x6c3a('0x4a')]));}else{_0x256e57[_0x6c3a('0x4b')]='';}headers[_0x6c3a('0x4c')]=getAuth(_0x4a3a60);return getUser(_0x4a3a60)[_0x6c3a('0x13')](function(_0x25526){_0x15f5b0=_0x25526;logger['info']('The\x20User\x20ID\x20is:',_0x15f5b0['id']);return getEndUser(_0x4a3a60,_0x256e57[_0x6c3a('0x4f')],_0x256e57[_0x6c3a('0x50')]);})[_0x6c3a('0x13')](function(_0x18fce1){_0x150946=_0x18fce1;logger['info'](_0x6c3a('0x51'),_0x150946['id']);return getTicket(_0x4a3a60,_0x15f5b0,_0x150946,_0x9b478f,_0x256e57);})['then'](function(_0x18be7b){if(_0x18be7b){logger['info']('The\x20Ticket\x20ID\x20is:',_0x18be7b['id']);}})[_0x6c3a('0x64')](function(_0x1a6edc){logger[_0x6c3a('0x56')]('['+_0x256e57['lastevent'][_0x6c3a('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x6c3a('0x66')](_0x1a6edc,{'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 a488a73..541c966 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 _0x403f=['ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','catch','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','enduserType','Error:\x20','log','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','talktime','answertime','endtime','Call_Duration','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','com','destcalleridname','Outbound','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','util','./util','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format'];(function(_0x331e28,_0x163e3c){var _0x42abb8=function(_0x2bdc7f){while(--_0x2bdc7f){_0x331e28['push'](_0x331e28['shift']());}};_0x42abb8(++_0x163e3c);}(_0x403f,0x103));var _0xf403=function(_0x1d7774,_0x5cead8){_0x1d7774=_0x1d7774-0x0;var _0x14c580=_0x403f[_0x1d7774];return _0x14c580;};'use strict';var _=require('lodash');var rp=require(_0xf403('0x0'));var md5=require('md5');var util=require(_0xf403('0x1'));var intUtil=require(_0xf403('0x2'));var moment=require('moment');var Redis=require(_0xf403('0x3'));var BPromise=require(_0xf403('0x4'));var config=require('../../../../config/environment');var logger=require(_0xf403('0x5'))(_0xf403('0x6'));config[_0xf403('0x7')]=_[_0xf403('0x8')](config[_0xf403('0x7')],{'host':_0xf403('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf403('0x7')]));function emit(_0x595612,_0x3e7247,_0x395f05){io['to'](_0x595612)[_0xf403('0xa')](_0x3e7247,_0x395f05);}function request(_0x4fca6f){logger[_0xf403('0xb')](_0xf403('0xc'),JSON[_0xf403('0xd')](_0x4fca6f));return rp(_0x4fca6f);}function getCustomFields(_0x2ef81f,_0x2a6d09){var _0x320728={};if(_0x2ef81f[_0xf403('0xe')]>0x0){_[_0xf403('0xf')](_0x2ef81f,function(_0x299f57){if(_['includes']([_0xf403('0x10'),_0xf403('0x11')],_0x299f57[_0xf403('0x12')])&&_0x299f57[_0xf403('0x13')]){_0x320728[_0x299f57['idField']]=_0x299f57[_0xf403('0x14')][_0xf403('0x15')]();}else if(_0x299f57[_0xf403('0x12')]==='variable'&&_0x299f57[_0xf403('0x16')]&&_0x299f57[_0xf403('0x13')]&&_0x2a6d09[_0x299f57['variableName']]){_0x320728[_0x299f57[_0xf403('0x13')]]=_0x2a6d09[_0x299f57[_0xf403('0x16')]]['toString']();}else if(_0x299f57[_0xf403('0x12')]===_0xf403('0x17')&&_0x299f57[_0xf403('0x18')]&&_0x299f57['Variable']['name']&&_0x299f57[_0xf403('0x13')]&&_0x2a6d09[_0x299f57[_0xf403('0x18')][_0xf403('0x19')][_0xf403('0x1a')]()]){_0x320728[_0x299f57[_0xf403('0x13')]]=_0x2a6d09[_0x299f57[_0xf403('0x18')][_0xf403('0x19')][_0xf403('0x1a')]()][_0xf403('0x15')]();}});}return _0x320728;}function getName(_0x4e5234){if(_0x4e5234[_0xf403('0x1b')]('\x20')>0x0){var _0x5faca5=_0x4e5234[_0xf403('0x1c')](/ (.+)/);if(_0x5faca5[0x1]){return _0x5faca5;}}return[_0x4e5234,_0x4e5234];}var accountsTokens={};function getAccessToken(_0x3a8f14){return new Promise(function(_0x506d3f,_0x5d8f34){if(!_['isNil'](accountsTokens[_0x3a8f14['id']])&&!_[_0xf403('0x1d')](accountsTokens[_0x3a8f14['id']][_0xf403('0x1e')])){if(moment()[_0xf403('0x1f')](accountsTokens[_0x3a8f14['id']][_0xf403('0x20')])){_0x506d3f(accountsTokens[_0x3a8f14['id']][_0xf403('0x1e')]);}}var _0x2b7704;switch(_0x3a8f14[_0xf403('0x21')]){case'US':_0x2b7704=_0xf403('0x22');break;case'AU':_0x2b7704=_0xf403('0x23');break;case'EU':_0x2b7704='https://accounts.zoho.eu';break;case'IN':_0x2b7704=_0xf403('0x24');break;case'CN':_0x2b7704=_0xf403('0x25');break;default:_0x2b7704=_0xf403('0x26');break;}var _0x1730a3={'method':_0xf403('0x27'),'uri':_0x2b7704+_0xf403('0x28'),'qs':{'refresh_token':_0x3a8f14[_0xf403('0x29')],'client_id':_0x3a8f14['clientId'],'client_secret':_0x3a8f14[_0xf403('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1730a3)[_0xf403('0x2b')](function(_0x4f6c33){accountsTokens[_0x3a8f14['id']]={'access_token':_0x4f6c33['access_token'],'expires_in':moment()[_0xf403('0x2c')](_0x4f6c33[_0xf403('0x20')],_0xf403('0x2d'))};_0x506d3f(_0x4f6c33[_0xf403('0x1e')]);})['catch'](function(_0x1a1a3c){logger['error'](_0xf403('0x2e'),_0x1a1a3c[_0xf403('0x2f')]);_0x5d8f34(_0x1a1a3c);});});}function getUser(_0xa68dd8,_0x49b42f,_0x43379c,_0x192922){logger['info'](_0xf403('0x30'));return request({'method':_0xf403('0x31'),'uri':util[_0xf403('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x49b42f),'qs':{'type':_0xf403('0x33')},'headers':{'Authorization':_0xf403('0x34')+_0xa68dd8},'json':!![]})[_0xf403('0x2b')](function(_0x2d6acc){if(_0x2d6acc[_0xf403('0x35')]){var _0x3c60bb=-0x1;if(_[_0xf403('0x36')](_0x2d6acc[_0xf403('0x35')])){if(!_[_0xf403('0x1d')](_0x192922)){_0x3c60bb=_[_0xf403('0x37')](_0x2d6acc['users'],function(_0x26b58f){return _0x26b58f[_0xf403('0x38')]===_0x192922;});}if(_0x3c60bb>=0x0){logger[_0xf403('0x39')]('Agent\x20found!');}else{logger[_0xf403('0x39')](_0xf403('0x3a'));_0x3c60bb=_[_0xf403('0x37')](_0x2d6acc[_0xf403('0x35')],function(_0x52aad1){return _0x52aad1[_0xf403('0x3b')][_0xf403('0x19')]===_0xf403('0x3c');});}return _0x2d6acc[_0xf403('0x35')][_0x3c60bb];}else{if(_0x2d6acc['user'][_0xf403('0x3b')][_0xf403('0x19')]===_0xf403('0x3c')){logger['info'](_0xf403('0x3a'));user=_0x2d6acc[_0xf403('0x3d')];return user;}else{logger[_0xf403('0x3e')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x2d6acc));throw new Error(_0xf403('0x3f')+JSON[_0xf403('0xd')](_0x2d6acc));}}}else{logger['error'](_0xf403('0x40'),JSON[_0xf403('0xd')](_0x2d6acc));throw new Error(_0xf403('0x3f')+JSON[_0xf403('0xd')](_0x2d6acc));}})[_0xf403('0x41')](function(_0x2f465c){console['error'](_0x2f465c);});}function getZohoUser(_0x430d52,_0x5a7ee0){return new BPromise(function(_0x4a5fe7,_0x2a0a18){request(_0x430d52)[_0xf403('0x2b')](function(_0x2e48b9){var _0x3706a4=null;if(_0x2e48b9){_0x3706a4=_0x2e48b9[_0xf403('0x42')][0x0];_0x3706a4['enduserType']=_0x5a7ee0;}_0x4a5fe7(_0x3706a4);})[_0xf403('0x41')](function(_0x42ebd0){_0x2a0a18(_0x42ebd0);});});}function createEndUser(_0x24317f,_0x44a9a1,_0x13c6f0,_0x5a065b,_0x863c67,_0x55e842){var _0x13c6f0=getName(_0x13c6f0);return request({'method':_0xf403('0x27'),'uri':_0xf403('0x43')+_0x44a9a1+_0xf403('0x44')+_[_0xf403('0x45')](_0x55e842[_0xf403('0x46')])+'s','body':{'data':[{'Last_Name':_0x13c6f0[0x1],'First_Name':_0x13c6f0[0x0],'Phone':_0x5a065b,'Owner':{'name':!_[_0xf403('0x1d')](_0x863c67['role'][_0xf403('0x19')])?_0x863c67[_0xf403('0x47')][_0xf403('0x19')]:!_[_0xf403('0x1d')](_0x863c67[_0xf403('0x48')])?_0x863c67['first_name']+'\x20'+_0x863c67['last_name']:_0x863c67[_0xf403('0x49')],'id':_0x863c67['id']}}]},'headers':{'Authorization':_0xf403('0x34')+_0x24317f},'json':!![]})[_0xf403('0x2b')](function(_0xb491ca){if(_0xb491ca&&_0xb491ca['data'][0x0][_0xf403('0x4a')]==='SUCCESS'){var _0x4e9c2d=_0xb491ca[_0xf403('0x42')][0x0][_0xf403('0x4b')];_0x4e9c2d[_0xf403('0x4c')]=_[_0xf403('0x45')](_0x55e842[_0xf403('0x46')])+'s';return _0x4e9c2d;}logger[_0xf403('0x3e')](_0xf403('0x40'),JSON['stringify'](data));throw new Error(_0xf403('0x4d')+JSON['stringify'](data));})[_0xf403('0x41')](function(_0x3e0ce4){console[_0xf403('0x4e')]('CREATE\x20ERROR',_0x3e0ce4);});}function getEndUser(_0x583a13,_0x25d8fe,_0x13812d,_0x4986b0,_0x49729d,_0x1243f1,_0x2bff0a){var _0x53cb0f={'method':'GET','uri':'','headers':{'Authorization':_0xf403('0x34')+_0x583a13},'json':!![]};switch(_0x2bff0a[_0xf403('0x4f')]){case _0xf403('0x50'):_0x53cb0f[_0xf403('0x51')]=_0xf403('0x43')+_0x25d8fe+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x49729d+'))';return getZohoUser(_0x53cb0f,_0xf403('0x52'))[_0xf403('0x2b')](function(_0x3958ce){if(_0x3958ce)return _0x3958ce;_0x53cb0f['uri']='https://www.zohoapis.'+_0x25d8fe+_0xf403('0x53')+_0x49729d+'))';return getZohoUser(_0x53cb0f,_0xf403('0x54'))[_0xf403('0x2b')](function(_0x3084c1){if(_0x3084c1)return _0x3084c1;if(_0x2bff0a[_0xf403('0x46')]!=_0xf403('0x55')){return createEndUser(_0x583a13,_0x25d8fe,_0x4986b0,_0x49729d,_0x1243f1,_0x2bff0a);}else{return{};}});});break;case _0xf403('0x56'):_0x53cb0f[_0xf403('0x51')]=_0xf403('0x43')+_0x25d8fe+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x49729d+'))';return getZohoUser(_0x53cb0f,_0xf403('0x52'))['then'](function(_0x4f0676){if(_0x4f0676)return _0x4f0676;if(_0x2bff0a[_0xf403('0x46')]!=_0xf403('0x55')){return createEndUser(_0x583a13,_0x25d8fe,_0x4986b0,_0x49729d,_0x1243f1,_0x2bff0a);}else{return{};}});break;case _0xf403('0x57'):_0x53cb0f[_0xf403('0x51')]=_0xf403('0x43')+_0x25d8fe+_0xf403('0x53')+_0x49729d+'))';return getZohoUser(_0x53cb0f,_0xf403('0x54'))['then'](function(_0x71fc4a){if(_0x71fc4a)return _0x71fc4a;if(_0x2bff0a[_0xf403('0x46')]!=_0xf403('0x55')){return createEndUser(_0x583a13,_0x25d8fe,_0x4986b0,_0x49729d,_0x1243f1,_0x2bff0a);}else{return{};}});break;}}function getCall(_0x50b529,_0x30c9ec,_0x14248e,_0x45980c,_0x1c005c,_0x4d40df,_0x29a23d,_0x49c2f5){logger[_0xf403('0x39')](_0xf403('0x58'));var _0x35c67a={};_0x35c67a[_0xf403('0x59')]={'name':!_[_0xf403('0x1d')](_0x45980c['role'][_0xf403('0x19')])&&!_['isNil'](_0x45980c[_0xf403('0x3b')]['name'])&&_0x45980c[_0xf403('0x3b')][_0xf403('0x19')]==='administrator'?_0x45980c['role'][_0xf403('0x19')]:!_[_0xf403('0x1d')](_0x45980c[_0xf403('0x48')])?_0x45980c[_0xf403('0x48')]+'\x20'+_0x45980c['last_name']:_0x45980c[_0xf403('0x49')],'id':_0x45980c['id']};_0x35c67a['Subject']=intUtil[_0xf403('0x5a')](_0x4d40df[_0xf403('0x5b')],_0x29a23d,'\x20');_0x35c67a[_0xf403('0x5c')]=intUtil[_0xf403('0x5a')](_0x4d40df[_0xf403('0x5d')],_0x29a23d,'\x0a');if(_0x1c005c['enduserType']===_0xf403('0x52')){_0x35c67a['Who_Id']={'name':!_[_0xf403('0x1d')](_0x1c005c[_0xf403('0x5e')])?_0x1c005c[_0xf403('0x5e')]:!_['isNil'](_0x1c005c[_0xf403('0x5f')])?_0x1c005c[_0xf403('0x5f')]+'\x20'+_0x1c005c[_0xf403('0x60')]:_0x1c005c[_0xf403('0x60')],'id':_0x1c005c['id']};}if(_0x1c005c[_0xf403('0x4c')]===_0xf403('0x54')){_0x35c67a['What_Id']={'name':!_[_0xf403('0x1d')](_0x1c005c[_0xf403('0x5e')])?_0x1c005c[_0xf403('0x5e')]:!_[_0xf403('0x1d')](_0x1c005c[_0xf403('0x5f')])?_0x1c005c[_0xf403('0x5f')]+'\x20'+_0x1c005c[_0xf403('0x60')]:_0x1c005c[_0xf403('0x60')],'id':_0x1c005c['id']};_0x35c67a['$se_module']=_['startCase'](_0x1c005c['enduserType']);}if(_0x29a23d[_0xf403('0x61')]){_0x35c67a['Call_Duration']=moment['utc'](parseInt(_0x29a23d['talktime'])*0x3e8)[_0xf403('0x32')]('mm:ss');}else if(_0x29a23d[_0xf403('0x62')]&&_0x29a23d[_0xf403('0x63')]){_0x35c67a[_0xf403('0x64')]=moment[_0xf403('0x65')](moment(_0x29a23d[_0xf403('0x63')],'YYYY-MM-DDTHH:mm:ss')[_0xf403('0x66')](moment(_0x29a23d[_0xf403('0x67')],_0xf403('0x68'))))[_0xf403('0x32')](_0xf403('0x69'));}switch(_0x29a23d['lastevent']){case'called':_0x35c67a[_0xf403('0x6a')]=_0xf403('0x6b');break;case _0xf403('0x6c'):case _0xf403('0x6d'):_0x35c67a[_0xf403('0x6a')]=_0xf403('0x6e');break;case _0xf403('0x6f'):_0x35c67a['Call_Result']=_0xf403('0x70');break;case _0xf403('0x71'):_0x35c67a[_0xf403('0x6a')]=_0xf403('0x72');break;case _0xf403('0x73'):_0x35c67a[_0xf403('0x6a')]='Timeout';default:}_0x35c67a[_0xf403('0x74')]=(_0x49c2f5===_0xf403('0x75')?moment(_0x29a23d['starttime'])['format'](_0xf403('0x68')):moment(_0x29a23d[_0xf403('0x76')])[_0xf403('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xf403('0x32')](_0xf403('0x68'));_0x35c67a['Call_Type']=_0x49c2f5||_0xf403('0x77');_0x35c67a=_[_0xf403('0x78')](_0x35c67a,getCustomFields(_0x4d40df[_0xf403('0x79')],_0x29a23d));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x30c9ec+_0xf403('0x7a'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x50b529},'body':{'data':[_0x35c67a]},'json':!![]})['then'](function(_0x50c4e2){if(_0x50c4e2&&_0x50c4e2['data'][0x0][_0xf403('0x4a')]===_0xf403('0x7b')){logger[_0xf403('0x39')](_0xf403('0x7c'));return{'id':_0x50c4e2['data'][0x0][_0xf403('0x4b')]['id']};}})['catch'](function(_0x250842){logger[_0xf403('0x39')](_0xf403('0x7d'),_0x250842[_0xf403('0x2f')]);console['log'](_0xf403('0x7d'),_0x250842);});}exports[_0xf403('0x7e')]=function(_0x3e5079,_0x5cb60d,_0x4540c0,_0x1ee0cb,_0x525312,_0x58ab1e){var _0x30ace8,_0x5be447,_0x4e55ac;_0x58ab1e[_0xf403('0x7f')]=intUtil[_0xf403('0x80')](_0x58ab1e[_0xf403('0x7f')]);_0x58ab1e[_0xf403('0x81')]=intUtil[_0xf403('0x80')](_0x58ab1e[_0xf403('0x81')]);if(_0x525312&&_0x525312['monitor_format']){logger[_0xf403('0x39')](_0xf403('0x82'),_0xf403('0x83'));_0x5cb60d[_0xf403('0x84')]=_0x58ab1e[_0xf403('0x81')]+_0xf403('0x85')+_0x5cb60d[_0xf403('0x86')]+_0xf403('0x87')+md5(_0x5cb60d['uniqueid']);}else{_0x5cb60d[_0xf403('0x84')]='';}var _0x59db70=_0x58ab1e[_0xf403('0x7f')]===_0xf403('0x88')?'eu':'com';return getAccessToken(_0x58ab1e)['then'](function(_0x48260f){_0x4e55ac=_0x48260f;return getUser(_0x4e55ac,_0x59db70,_0x58ab1e,_0x1ee0cb[_0xf403('0x38')]);})[_0xf403('0x2b')](function(_0x344d04){_0x30ace8=_0x344d04;logger[_0xf403('0x39')](_0xf403('0x89'),_0x30ace8['id']);return getEndUser(_0x4e55ac,_0x59db70,_0x58ab1e,_0x5cb60d[_0xf403('0x8a')],_0x5cb60d[_0xf403('0x8b')],_0x30ace8,_0x4540c0);})[_0xf403('0x2b')](function(_0x1f36bf){_0x5be447=_0x1f36bf;return getCall(_0x4e55ac,_0x59db70,_0x58ab1e,_0x30ace8,_0x5be447,_0x4540c0,_0x5cb60d,'Inbound');})[_0xf403('0x2b')](function(_0x47e534){if(_0x47e534){logger['info'](_0xf403('0x8c'),_0x47e534['id']);logger[_0xf403('0x39')](_0xf403('0x82'),_0xf403('0x8d'));emit(util[_0xf403('0x32')](_0xf403('0x8e'),_0x1ee0cb[_0xf403('0x19')]),_0xf403('0x8f'),{'uri':_0xf403('0x90')+_0x58ab1e[_0xf403('0x7f')]+_0xf403('0x91')+_0x47e534['id']});}})['catch'](function(_0xb32ade){logger[_0xf403('0x3e')](_0xf403('0x82'),JSON[_0xf403('0xd')](_0xb32ade));});};exports[_0xf403('0x75')]=function(_0x151a49,_0x228770,_0x2ee0c6,_0x1d3151,_0x3b2c39,_0x573fc0,_0x4eff65){var _0x2ab32b,_0x11c74c,_0x56b150;_0x573fc0[_0xf403('0x7f')]=intUtil[_0xf403('0x80')](_0x573fc0[_0xf403('0x7f')]);_0x573fc0[_0xf403('0x81')]=intUtil[_0xf403('0x80')](_0x573fc0['serverUrl']);if(_0x4eff65&&_0x4eff65[_0xf403('0x92')]&&_0x4eff65[_0xf403('0x92')]!=='none'){logger[_0xf403('0x39')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x228770['recordingURL']=_0x573fc0['serverUrl']+_0xf403('0x85')+_0x228770[_0xf403('0x86')]+_0xf403('0x87')+md5(_0x228770[_0xf403('0x86')]);}var _0x58ad29=_0x573fc0['host']===_0xf403('0x88')?'eu':_0xf403('0x93');return getAccessToken(_0x573fc0)[_0xf403('0x2b')](function(_0xaf2ab5){_0x56b150=_0xaf2ab5;return getUser(_0x56b150,_0x58ad29,_0x573fc0,_0x1d3151[_0xf403('0x38')]);})['then'](function(_0x1b8705){_0x2ab32b=_0x1b8705;logger[_0xf403('0x39')](_0xf403('0x89'),_0x2ab32b['id']);return getEndUser(_0x56b150,_0x58ad29,_0x573fc0,_0x228770[_0xf403('0x94')],_0x228770['destcalleridnum'],_0x2ab32b,_0x2ee0c6);})[_0xf403('0x2b')](function(_0x391f68){_0x11c74c=_0x391f68;return getCall(_0x56b150,_0x58ad29,_0x573fc0,_0x2ab32b,_0x11c74c,_0x2ee0c6,_0x228770,_0xf403('0x95'));})['then'](function(_0xbf9cb1){if(_0xbf9cb1){logger[_0xf403('0x39')](_0xf403('0x8c'),_0xbf9cb1['id']);logger[_0xf403('0x39')](_0xf403('0x96'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf403('0x32')](_0xf403('0x8e'),_0x1d3151[_0xf403('0x19')]),_0xf403('0x8f'),{'uri':_0xf403('0x90')+_0x573fc0[_0xf403('0x7f')]+_0xf403('0x91')+_0xbf9cb1['id']});}})[_0xf403('0x41')](function(_0x1ffa6f){logger[_0xf403('0x3e')](_0xf403('0x96'),JSON[_0xf403('0xd')](_0x1ffa6f));});};exports[_0xf403('0x97')]=function(_0x56e6a0,_0x408c4e,_0x19188f,_0x3c3007,_0x3f2a3e,_0x5e2652){var _0x4c1546,_0x3dd972,_0x4df230;_0x5e2652[_0xf403('0x7f')]=intUtil[_0xf403('0x80')](_0x5e2652[_0xf403('0x7f')]);_0x5e2652['serverUrl']=intUtil[_0xf403('0x80')](_0x5e2652[_0xf403('0x81')]);if(_0x3f2a3e&&_0x3f2a3e[_0xf403('0x98')]){logger[_0xf403('0x39')]('['+_0x408c4e[_0xf403('0x99')]['toUpperCase']()+']',_0xf403('0x83'));_0x408c4e[_0xf403('0x84')]=_0x5e2652['serverUrl']+_0xf403('0x85')+_0x408c4e[_0xf403('0x86')]+_0xf403('0x87')+md5(_0x408c4e['uniqueid']);}else{_0x408c4e[_0xf403('0x84')]='';}var _0x110819=_0x5e2652[_0xf403('0x7f')]===_0xf403('0x88')?'eu':_0xf403('0x93');return getAccessToken(_0x5e2652)[_0xf403('0x2b')](function(_0x30c3ad){_0x4df230=_0x30c3ad;return getUser(_0x4df230,_0x110819,_0x5e2652);})[_0xf403('0x2b')](function(_0x169e51){_0x4c1546=_0x169e51;logger[_0xf403('0x39')](_0xf403('0x89'),_0x4c1546['id']);return getEndUser(_0x4df230,_0x110819,_0x5e2652,_0x408c4e[_0xf403('0x8a')],_0x408c4e['calleridnum'],_0x4c1546,_0x19188f);})[_0xf403('0x2b')](function(_0x485c6d){_0x3dd972=_0x485c6d;return getCall(_0x4df230,_0x110819,_0x5e2652,_0x4c1546,_0x3dd972,_0x19188f,_0x408c4e,_0xf403('0x77'));})['then'](function(_0x558399){if(_0x558399){logger[_0xf403('0x39')](_0xf403('0x8c'),_0x558399['id']);}})[_0xf403('0x41')](function(_0x28ade1){logger[_0xf403('0x3e')]('['+_0x408c4e[_0xf403('0x99')][_0xf403('0x9a')]()+']',JSON[_0xf403('0xd')](_0x28ade1));});}; \ No newline at end of file +var _0x2c81=['/crm/EntityInfo.do?module=Calls&id=','calleridname','toUpperCase','lodash','request-promise','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','length','includes','string','picklist','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','getString','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','answertime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','Outbound','trigger:browser:url','https://crm.'];(function(_0xf858e,_0x51b0f1){var _0x5344d8=function(_0x5219d6){while(--_0x5219d6){_0xf858e['push'](_0xf858e['shift']());}};_0x5344d8(++_0x51b0f1);}(_0x2c81,0x1d1));var _0x12c8=function(_0x1caaa2,_0x2f03f2){_0x1caaa2=_0x1caaa2-0x0;var _0x469625=_0x2c81[_0x1caaa2];return _0x469625;};'use strict';var _=require(_0x12c8('0x0'));var rp=require(_0x12c8('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x12c8('0x2'));var moment=require('moment');var Redis=require(_0x12c8('0x3'));var BPromise=require('bluebird');var config=require(_0x12c8('0x4'));var logger=require(_0x12c8('0x5'))(_0x12c8('0x6'));config['redis']=_[_0x12c8('0x7')](config[_0x12c8('0x8')],{'host':_0x12c8('0x9'),'port':0x18eb});var io=require(_0x12c8('0xa'))(new Redis(config[_0x12c8('0x8')]));function emit(_0x188aa6,_0x61fc,_0x42c9fb){io['to'](_0x188aa6)[_0x12c8('0xb')](_0x61fc,_0x42c9fb);}function request(_0x345239){logger[_0x12c8('0xc')](_0x12c8('0xd'),JSON['stringify'](_0x345239));return rp(_0x345239);}function getCustomFields(_0x4b4292,_0x2b0f1d){var _0x736d9d={};if(_0x4b4292[_0x12c8('0xe')]>0x0){_['forEach'](_0x4b4292,function(_0x8967cb){if(_[_0x12c8('0xf')]([_0x12c8('0x10'),_0x12c8('0x11')],_0x8967cb['type'])&&_0x8967cb[_0x12c8('0x12')]){_0x736d9d[_0x8967cb[_0x12c8('0x12')]]=_0x8967cb[_0x12c8('0x13')][_0x12c8('0x14')]();}else if(_0x8967cb[_0x12c8('0x15')]===_0x12c8('0x16')&&_0x8967cb[_0x12c8('0x17')]&&_0x8967cb[_0x12c8('0x12')]&&_0x2b0f1d[_0x8967cb[_0x12c8('0x17')]]){_0x736d9d[_0x8967cb[_0x12c8('0x12')]]=_0x2b0f1d[_0x8967cb[_0x12c8('0x17')]][_0x12c8('0x14')]();}else if(_0x8967cb['type']==='customVariable'&&_0x8967cb[_0x12c8('0x18')]&&_0x8967cb['Variable']['name']&&_0x8967cb[_0x12c8('0x12')]&&_0x2b0f1d[_0x8967cb[_0x12c8('0x18')][_0x12c8('0x19')][_0x12c8('0x1a')]()]){_0x736d9d[_0x8967cb[_0x12c8('0x12')]]=_0x2b0f1d[_0x8967cb[_0x12c8('0x18')]['name'][_0x12c8('0x1a')]()]['toString']();}});}return _0x736d9d;}function getName(_0x2f5f5c){if(_0x2f5f5c[_0x12c8('0x1b')]('\x20')>0x0){var _0x23af18=_0x2f5f5c[_0x12c8('0x1c')](/ (.+)/);if(_0x23af18[0x1]){return _0x23af18;}}return[_0x2f5f5c,_0x2f5f5c];}var accountsTokens={};function getAccessToken(_0x45e430){return new Promise(function(_0x2a4fdc,_0x39966e){if(!_[_0x12c8('0x1d')](accountsTokens[_0x45e430['id']])&&!_[_0x12c8('0x1d')](accountsTokens[_0x45e430['id']][_0x12c8('0x1e')])){if(moment()[_0x12c8('0x1f')](accountsTokens[_0x45e430['id']][_0x12c8('0x20')])){_0x2a4fdc(accountsTokens[_0x45e430['id']][_0x12c8('0x1e')]);}}var _0x4a1b1d;switch(_0x45e430[_0x12c8('0x21')]){case'US':_0x4a1b1d=_0x12c8('0x22');break;case'AU':_0x4a1b1d=_0x12c8('0x23');break;case'EU':_0x4a1b1d=_0x12c8('0x24');break;case'IN':_0x4a1b1d='https://accounts.zoho.in';break;case'CN':_0x4a1b1d=_0x12c8('0x25');break;default:_0x4a1b1d=_0x12c8('0x24');break;}var _0x5ecdd2={'method':'POST','uri':_0x4a1b1d+'/oauth/v2/token','qs':{'refresh_token':_0x45e430[_0x12c8('0x26')],'client_id':_0x45e430[_0x12c8('0x27')],'client_secret':_0x45e430[_0x12c8('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5ecdd2)[_0x12c8('0x29')](function(_0x2b2090){accountsTokens[_0x45e430['id']]={'access_token':_0x2b2090[_0x12c8('0x1e')],'expires_in':moment()[_0x12c8('0x2a')](_0x2b2090[_0x12c8('0x20')],_0x12c8('0x2b'))};_0x2a4fdc(_0x2b2090[_0x12c8('0x1e')]);})['catch'](function(_0x4c1260){logger[_0x12c8('0x2c')](_0x12c8('0x2d'),_0x4c1260[_0x12c8('0x2e')]);_0x39966e(_0x4c1260);});});}function getUser(_0x32c058,_0x120724,_0x428ae8,_0x2212fb){logger[_0x12c8('0x2f')](_0x12c8('0x30'));return request({'method':_0x12c8('0x31'),'uri':util[_0x12c8('0x32')](_0x12c8('0x33'),_0x120724),'qs':{'type':_0x12c8('0x34')},'headers':{'Authorization':_0x12c8('0x35')+_0x32c058},'json':!![]})[_0x12c8('0x29')](function(_0x370ac8){if(_0x370ac8[_0x12c8('0x36')]){var _0x29cb94=-0x1;if(_[_0x12c8('0x37')](_0x370ac8[_0x12c8('0x36')])){if(!_['isNil'](_0x2212fb)){_0x29cb94=_['findIndex'](_0x370ac8[_0x12c8('0x36')],function(_0x428a84){return _0x428a84['email']===_0x2212fb;});}if(_0x29cb94>=0x0){logger[_0x12c8('0x2f')](_0x12c8('0x38'));}else{logger[_0x12c8('0x2f')](_0x12c8('0x39'));_0x29cb94=_[_0x12c8('0x3a')](_0x370ac8[_0x12c8('0x36')],function(_0x23a9ce){return _0x23a9ce[_0x12c8('0x3b')][_0x12c8('0x19')]==='Administrator';});}return _0x370ac8[_0x12c8('0x36')][_0x29cb94];}else{if(_0x370ac8[_0x12c8('0x3c')]['profile'][_0x12c8('0x19')]==='Administrator'){logger[_0x12c8('0x2f')](_0x12c8('0x39'));user=_0x370ac8[_0x12c8('0x3c')];return user;}else{logger[_0x12c8('0x2c')](_0x12c8('0x3d'),JSON[_0x12c8('0x3e')](_0x370ac8));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x12c8('0x3e')](_0x370ac8));}}}else{logger[_0x12c8('0x2c')](_0x12c8('0x3d'),JSON[_0x12c8('0x3e')](_0x370ac8));throw new Error(_0x12c8('0x3f')+JSON['stringify'](_0x370ac8));}})[_0x12c8('0x40')](function(_0x4be7a7){console['error'](_0x4be7a7);});}function getZohoUser(_0x1541f7,_0x5d7132){return new BPromise(function(_0x504242,_0x3d0eb0){request(_0x1541f7)['then'](function(_0x877cc){var _0x134415=null;if(_0x877cc){_0x134415=_0x877cc[_0x12c8('0x41')][0x0];_0x134415[_0x12c8('0x42')]=_0x5d7132;}_0x504242(_0x134415);})[_0x12c8('0x40')](function(_0x7008f2){_0x3d0eb0(_0x7008f2);});});}function createEndUser(_0x4b2122,_0x1c0ea4,_0x2a826c,_0x4113c8,_0x3346ce,_0x2890c7){var _0x2a826c=getName(_0x2a826c);return request({'method':_0x12c8('0x43'),'uri':_0x12c8('0x44')+_0x1c0ea4+_0x12c8('0x45')+_[_0x12c8('0x46')](_0x2890c7[_0x12c8('0x47')])+'s','body':{'data':[{'Last_Name':_0x2a826c[0x1],'First_Name':_0x2a826c[0x0],'Phone':_0x4113c8,'Owner':{'name':!_['isNil'](_0x3346ce['role'][_0x12c8('0x19')])?_0x3346ce[_0x12c8('0x48')][_0x12c8('0x19')]:!_['isNil'](_0x3346ce['first_name'])?_0x3346ce[_0x12c8('0x49')]+'\x20'+_0x3346ce[_0x12c8('0x4a')]:_0x3346ce[_0x12c8('0x4a')],'id':_0x3346ce['id']}}]},'headers':{'Authorization':_0x12c8('0x35')+_0x4b2122},'json':!![]})[_0x12c8('0x29')](function(_0x2b2434){if(_0x2b2434&&_0x2b2434[_0x12c8('0x41')][0x0][_0x12c8('0x4b')]===_0x12c8('0x4c')){var _0x4ab0b4=_0x2b2434[_0x12c8('0x41')][0x0]['details'];_0x4ab0b4[_0x12c8('0x42')]=_[_0x12c8('0x46')](_0x2890c7[_0x12c8('0x47')])+'s';return _0x4ab0b4;}logger[_0x12c8('0x2c')](_0x12c8('0x3d'),JSON[_0x12c8('0x3e')](data));throw new Error(_0x12c8('0x4d')+JSON[_0x12c8('0x3e')](data));})[_0x12c8('0x40')](function(_0x1b5bde){console['log'](_0x12c8('0x4e'),_0x1b5bde);});}function getEndUser(_0x48f233,_0x3c024f,_0x4158f2,_0x3c0eed,_0x5c272f,_0x3a3ab5,_0x792480){var _0x402820={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x48f233},'json':!![]};switch(_0x792480[_0x12c8('0x4f')]){case _0x12c8('0x50'):_0x402820[_0x12c8('0x51')]=_0x12c8('0x44')+_0x3c024f+_0x12c8('0x52')+_0x5c272f+'))';return getZohoUser(_0x402820,_0x12c8('0x53'))[_0x12c8('0x29')](function(_0x5cfa6e){if(_0x5cfa6e)return _0x5cfa6e;_0x402820['uri']=_0x12c8('0x44')+_0x3c024f+_0x12c8('0x54')+_0x5c272f+'))';return getZohoUser(_0x402820,_0x12c8('0x55'))['then'](function(_0x7dcf3b){if(_0x7dcf3b)return _0x7dcf3b;if(_0x792480[_0x12c8('0x47')]!='nothing'){return createEndUser(_0x48f233,_0x3c024f,_0x3c0eed,_0x5c272f,_0x3a3ab5,_0x792480);}else{return{};}});});break;case _0x12c8('0x56'):_0x402820[_0x12c8('0x51')]=_0x12c8('0x44')+_0x3c024f+_0x12c8('0x52')+_0x5c272f+'))';return getZohoUser(_0x402820,'Contacts')[_0x12c8('0x29')](function(_0x489a0a){if(_0x489a0a)return _0x489a0a;if(_0x792480[_0x12c8('0x47')]!=_0x12c8('0x57')){return createEndUser(_0x48f233,_0x3c024f,_0x3c0eed,_0x5c272f,_0x3a3ab5,_0x792480);}else{return{};}});break;case _0x12c8('0x58'):_0x402820['uri']=_0x12c8('0x44')+_0x3c024f+_0x12c8('0x54')+_0x5c272f+'))';return getZohoUser(_0x402820,_0x12c8('0x55'))[_0x12c8('0x29')](function(_0x25f6e9){if(_0x25f6e9)return _0x25f6e9;if(_0x792480[_0x12c8('0x47')]!=_0x12c8('0x57')){return createEndUser(_0x48f233,_0x3c024f,_0x3c0eed,_0x5c272f,_0x3a3ab5,_0x792480);}else{return{};}});break;}}function getCall(_0x415f63,_0x4a97dd,_0x20d442,_0x29e305,_0x172e75,_0x2d11f7,_0x2be49f,_0xe014a1){logger[_0x12c8('0x2f')](_0x12c8('0x59'));var _0x5407f2={};_0x5407f2[_0x12c8('0x5a')]={'name':!_[_0x12c8('0x1d')](_0x29e305[_0x12c8('0x48')][_0x12c8('0x19')])&&!_['isNil'](_0x29e305[_0x12c8('0x3b')][_0x12c8('0x19')])&&_0x29e305['profile'][_0x12c8('0x19')]==='administrator'?_0x29e305[_0x12c8('0x48')]['name']:!_[_0x12c8('0x1d')](_0x29e305[_0x12c8('0x49')])?_0x29e305[_0x12c8('0x49')]+'\x20'+_0x29e305[_0x12c8('0x4a')]:_0x29e305[_0x12c8('0x4a')],'id':_0x29e305['id']};_0x5407f2['Subject']=intUtil['getString'](_0x2d11f7['Subjects'],_0x2be49f,'\x20');_0x5407f2['Description']=intUtil[_0x12c8('0x5b')](_0x2d11f7[_0x12c8('0x5c')],_0x2be49f,'\x0a');if(_0x172e75[_0x12c8('0x42')]===_0x12c8('0x53')){_0x5407f2['Who_Id']={'name':!_[_0x12c8('0x1d')](_0x172e75[_0x12c8('0x5d')])?_0x172e75[_0x12c8('0x5d')]:!_[_0x12c8('0x1d')](_0x172e75[_0x12c8('0x5e')])?_0x172e75[_0x12c8('0x5e')]+'\x20'+_0x172e75['Last_Name']:_0x172e75[_0x12c8('0x5f')],'id':_0x172e75['id']};}if(_0x172e75['enduserType']===_0x12c8('0x55')){_0x5407f2[_0x12c8('0x60')]={'name':!_[_0x12c8('0x1d')](_0x172e75[_0x12c8('0x5d')])?_0x172e75[_0x12c8('0x5d')]:!_['isNil'](_0x172e75[_0x12c8('0x5e')])?_0x172e75['First_Name']+'\x20'+_0x172e75[_0x12c8('0x5f')]:_0x172e75['Last_Name'],'id':_0x172e75['id']};_0x5407f2[_0x12c8('0x61')]=_[_0x12c8('0x46')](_0x172e75[_0x12c8('0x42')]);}if(_0x2be49f['talktime']){_0x5407f2[_0x12c8('0x62')]=moment[_0x12c8('0x63')](parseInt(_0x2be49f[_0x12c8('0x64')])*0x3e8)[_0x12c8('0x32')]('mm:ss');}else if(_0x2be49f[_0x12c8('0x65')]&&_0x2be49f['endtime']){_0x5407f2[_0x12c8('0x62')]=moment[_0x12c8('0x63')](moment(_0x2be49f['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x12c8('0x66')](moment(_0x2be49f[_0x12c8('0x67')],_0x12c8('0x68'))))['format']('mm:ss');}switch(_0x2be49f[_0x12c8('0x69')]){case'called':_0x5407f2[_0x12c8('0x6a')]=_0x12c8('0x6b');break;case _0x12c8('0x6c'):case'connect':_0x5407f2[_0x12c8('0x6a')]=_0x12c8('0x6d');break;case _0x12c8('0x6e'):_0x5407f2[_0x12c8('0x6a')]=_0x12c8('0x6f');break;case'abandoned':_0x5407f2[_0x12c8('0x6a')]=_0x12c8('0x70');break;case _0x12c8('0x71'):_0x5407f2[_0x12c8('0x6a')]=_0x12c8('0x72');default:}_0x5407f2[_0x12c8('0x73')]=(_0xe014a1===_0x12c8('0x74')?moment(_0x2be49f[_0x12c8('0x67')])[_0x12c8('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2be49f['agentcalledAt'])['format'](_0x12c8('0x68')))||moment()[_0x12c8('0x32')](_0x12c8('0x68'));_0x5407f2[_0x12c8('0x75')]=_0xe014a1||_0x12c8('0x76');_0x5407f2=_[_0x12c8('0x77')](_0x5407f2,getCustomFields(_0x2d11f7[_0x12c8('0x78')],_0x2be49f));return request({'method':_0x12c8('0x43'),'uri':_0x12c8('0x44')+_0x4a97dd+_0x12c8('0x79'),'headers':{'Authorization':_0x12c8('0x35')+_0x415f63},'body':{'data':[_0x5407f2]},'json':!![]})[_0x12c8('0x29')](function(_0x20aa76){if(_0x20aa76&&_0x20aa76[_0x12c8('0x41')][0x0][_0x12c8('0x4b')]===_0x12c8('0x4c')){logger[_0x12c8('0x2f')](_0x12c8('0x7a'));return{'id':_0x20aa76[_0x12c8('0x41')][0x0][_0x12c8('0x7b')]['id']};}})['catch'](function(_0x536148){logger[_0x12c8('0x2f')](_0x12c8('0x7c'),_0x536148[_0x12c8('0x2e')]);console[_0x12c8('0x7d')](_0x12c8('0x7c'),_0x536148);});}exports['queue']=function(_0x4b308c,_0xa0eb8d,_0xd099fd,_0x2e0d44,_0x481432,_0x3900b6){var _0x3ec90a,_0x586c54,_0x2407d7;_0x3900b6[_0x12c8('0x7e')]=intUtil[_0x12c8('0x7f')](_0x3900b6['host']);_0x3900b6['serverUrl']=intUtil['stripTrailingSlash'](_0x3900b6[_0x12c8('0x80')]);if(_0x481432&&_0x481432[_0x12c8('0x81')]){logger[_0x12c8('0x2f')](_0x12c8('0x82'),_0x12c8('0x83'));_0xa0eb8d['recordingURL']=_0x3900b6['serverUrl']+_0x12c8('0x84')+_0xa0eb8d[_0x12c8('0x85')]+'/downloads?type=uniqueid&token='+md5(_0xa0eb8d[_0x12c8('0x85')]);}else{_0xa0eb8d[_0x12c8('0x86')]='';}var _0x179b42=_0x3900b6['host']===_0x12c8('0x87')?'eu':_0x12c8('0x88');return getAccessToken(_0x3900b6)[_0x12c8('0x29')](function(_0x2bfae3){_0x2407d7=_0x2bfae3;return getUser(_0x2407d7,_0x179b42,_0x3900b6,_0x2e0d44[_0x12c8('0x89')]);})[_0x12c8('0x29')](function(_0x502298){_0x3ec90a=_0x502298;logger[_0x12c8('0x2f')](_0x12c8('0x8a'),_0x3ec90a['id']);return getEndUser(_0x2407d7,_0x179b42,_0x3900b6,_0xa0eb8d['calleridname'],_0xa0eb8d[_0x12c8('0x8b')],_0x3ec90a,_0xd099fd);})[_0x12c8('0x29')](function(_0x5cecd7){_0x586c54=_0x5cecd7;return getCall(_0x2407d7,_0x179b42,_0x3900b6,_0x3ec90a,_0x586c54,_0xd099fd,_0xa0eb8d,'Inbound');})[_0x12c8('0x29')](function(_0x3b2457){if(_0x3b2457){logger[_0x12c8('0x2f')](_0x12c8('0x8c'),_0x3b2457['id']);logger[_0x12c8('0x2f')](_0x12c8('0x82'),_0x12c8('0x8d'));emit(util[_0x12c8('0x32')](_0x12c8('0x8e'),_0x2e0d44[_0x12c8('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x3900b6[_0x12c8('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3b2457['id']});}})[_0x12c8('0x40')](function(_0x3d9812){logger[_0x12c8('0x2c')]('[QUEUE]',JSON[_0x12c8('0x3e')](_0x3d9812));});};exports[_0x12c8('0x74')]=function(_0x136c88,_0x3444af,_0x1b01fd,_0x3ce13c,_0x3ebc91,_0x102afb,_0x468088){var _0x54c545,_0x1244a4,_0xca7aed;_0x102afb[_0x12c8('0x7e')]=intUtil[_0x12c8('0x7f')](_0x102afb[_0x12c8('0x7e')]);_0x102afb[_0x12c8('0x80')]=intUtil[_0x12c8('0x7f')](_0x102afb[_0x12c8('0x80')]);if(_0x468088&&_0x468088[_0x12c8('0x8f')]&&_0x468088[_0x12c8('0x8f')]!==_0x12c8('0x90')){logger[_0x12c8('0x2f')](_0x12c8('0x91'),_0x12c8('0x83'));_0x3444af['recordingURL']=_0x102afb[_0x12c8('0x80')]+'/api/voice/recordings/'+_0x3444af['uniqueid']+_0x12c8('0x92')+md5(_0x3444af[_0x12c8('0x85')]);}var _0x191dfa=_0x102afb[_0x12c8('0x7e')]===_0x12c8('0x87')?'eu':_0x12c8('0x88');return getAccessToken(_0x102afb)[_0x12c8('0x29')](function(_0x590e55){_0xca7aed=_0x590e55;return getUser(_0xca7aed,_0x191dfa,_0x102afb,_0x3ce13c[_0x12c8('0x89')]);})[_0x12c8('0x29')](function(_0x35f7d8){_0x54c545=_0x35f7d8;logger['info']('The\x20User\x20ID\x20is:',_0x54c545['id']);return getEndUser(_0xca7aed,_0x191dfa,_0x102afb,_0x3444af['destcalleridname'],_0x3444af[_0x12c8('0x93')],_0x54c545,_0x1b01fd);})[_0x12c8('0x29')](function(_0x51790e){_0x1244a4=_0x51790e;return getCall(_0xca7aed,_0x191dfa,_0x102afb,_0x54c545,_0x1244a4,_0x1b01fd,_0x3444af,_0x12c8('0x94'));})[_0x12c8('0x29')](function(_0x2eeebb){if(_0x2eeebb){logger[_0x12c8('0x2f')](_0x12c8('0x8c'),_0x2eeebb['id']);logger[_0x12c8('0x2f')](_0x12c8('0x91'),_0x12c8('0x8d'));emit(util['format'](_0x12c8('0x8e'),_0x3ce13c[_0x12c8('0x19')]),_0x12c8('0x95'),{'uri':_0x12c8('0x96')+_0x102afb['host']+_0x12c8('0x97')+_0x2eeebb['id']});}})[_0x12c8('0x40')](function(_0x471561){logger['error'](_0x12c8('0x91'),JSON[_0x12c8('0x3e')](_0x471561));});};exports['unmanaged']=function(_0x15d39c,_0x4316d7,_0x528d5e,_0x172203,_0x165558,_0x5a8381){var _0x5d4e4a,_0x4252e7,_0x397d9c;_0x5a8381['host']=intUtil['stripTrailingSlash'](_0x5a8381[_0x12c8('0x7e')]);_0x5a8381[_0x12c8('0x80')]=intUtil[_0x12c8('0x7f')](_0x5a8381[_0x12c8('0x80')]);if(_0x165558&&_0x165558[_0x12c8('0x81')]){logger[_0x12c8('0x2f')]('['+_0x4316d7['lastevent']['toUpperCase']()+']',_0x12c8('0x83'));_0x4316d7['recordingURL']=_0x5a8381[_0x12c8('0x80')]+'/api/voice/recordings/'+_0x4316d7[_0x12c8('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x4316d7['uniqueid']);}else{_0x4316d7['recordingURL']='';}var _0x649c26=_0x5a8381[_0x12c8('0x7e')]==='zoho.eu'?'eu':_0x12c8('0x88');return getAccessToken(_0x5a8381)[_0x12c8('0x29')](function(_0x2a31d8){_0x397d9c=_0x2a31d8;return getUser(_0x397d9c,_0x649c26,_0x5a8381);})[_0x12c8('0x29')](function(_0x494268){_0x5d4e4a=_0x494268;logger[_0x12c8('0x2f')](_0x12c8('0x8a'),_0x5d4e4a['id']);return getEndUser(_0x397d9c,_0x649c26,_0x5a8381,_0x4316d7[_0x12c8('0x98')],_0x4316d7[_0x12c8('0x8b')],_0x5d4e4a,_0x528d5e);})['then'](function(_0x5bc8e9){_0x4252e7=_0x5bc8e9;return getCall(_0x397d9c,_0x649c26,_0x5a8381,_0x5d4e4a,_0x4252e7,_0x528d5e,_0x4316d7,'Inbound');})['then'](function(_0x162331){if(_0x162331){logger[_0x12c8('0x2f')](_0x12c8('0x8c'),_0x162331['id']);}})['catch'](function(_0x37c1b0){logger['error']('['+_0x4316d7[_0x12c8('0x69')][_0x12c8('0x99')]()+']',JSON[_0x12c8('0x3e')](_0x37c1b0));});}; \ 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 ac84766..e2d13bc 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 _0x8d98=['trigger','exec','data2','Script','render','data3','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x8d98,0x81));var _0x88d9=function(_0x136e5e,_0x2d5726){_0x136e5e=_0x136e5e-0x0;var _0x3427c1=_0x8d98[_0x136e5e];return _0x3427c1;};'use strict';var util=require(_0x88d9('0x0'));var sh=require('shelljs');var Mustache=require(_0x88d9('0x1'));var logger=require(_0x88d9('0x2'))(_0x88d9('0x3'));exports[_0x88d9('0x4')]=function(_0x553d14,_0x1435d9){var _0x5dc2be=_0x553d14[_0x88d9('0x5')]?_0x553d14[_0x88d9('0x5')]:_0x88d9('0x6');var _0x2282b4=_0x553d14['data3']?Mustache[_0x88d9('0x7')](_0x553d14[_0x88d9('0x8')],_0x1435d9):_0x1435d9;sh['exec'](_0x2282b4,function(_0x4bd4df,_0x234974,_0x462739){if(_0x4bd4df!==0x0){logger['error'](util[_0x88d9('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5dc2be,_0x2282b4,_0x4bd4df,_0x462739));}else{logger['info'](util[_0x88d9('0x9')](_0x88d9('0xa'),_0x5dc2be,_0x2282b4,_0x234974));}});}; \ No newline at end of file +var _0x2246=['../../../../config/logger','trigger','data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0xe0c161,_0x354aaf){var _0x3978fc=function(_0x56acba){while(--_0x56acba){_0xe0c161['push'](_0xe0c161['shift']());}};_0x3978fc(++_0x354aaf);}(_0x2246,0x1ac));var _0x6224=function(_0x14017d,_0x346fdf){_0x14017d=_0x14017d-0x0;var _0x37d4aa=_0x2246[_0x14017d];return _0x37d4aa;};'use strict';var util=require(_0x6224('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x6224('0x1'))(_0x6224('0x2'));exports['exec']=function(_0x7346c7,_0x3709c7){var _0x27d92d=_0x7346c7[_0x6224('0x3')]?_0x7346c7[_0x6224('0x3')]:'Script';var _0x4e62ea=_0x7346c7[_0x6224('0x4')]?Mustache[_0x6224('0x5')](_0x7346c7[_0x6224('0x4')],_0x3709c7):_0x3709c7;sh['exec'](_0x4e62ea,function(_0x5194f9,_0x347958,_0x153dc5){if(_0x5194f9!==0x0){logger[_0x6224('0x6')](util[_0x6224('0x7')](_0x6224('0x8'),_0x27d92d,_0x4e62ea,_0x5194f9,_0x153dc5));}else{logger[_0x6224('0x9')](util[_0x6224('0x7')](_0x6224('0xa'),_0x27d92d,_0x4e62ea,_0x347958));}});}; \ 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 4dc2d75..88fc641 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 _0xc046=['PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','then','isNil','object','%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','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','number','data5','headers','data6','error','stack','GET','DELETE','POST'];(function(_0x4ddbf6,_0x5b2e77){var _0x1034c2=function(_0x51d380){while(--_0x51d380){_0x4ddbf6['push'](_0x4ddbf6['shift']());}};_0x1034c2(++_0x5b2e77);}(_0xc046,0x10d));var _0x6c04=function(_0x243ecc,_0x26f0b5){_0x243ecc=_0x243ecc-0x0;var _0x3f0eb2=_0xc046[_0x243ecc];return _0x3f0eb2;};'use strict';var rp=require(_0x6c04('0x0'));var util=require(_0x6c04('0x1'));var _=require(_0x6c04('0x2'));var Mustache=require(_0x6c04('0x3'));var logger=require(_0x6c04('0x4'))(_0x6c04('0x5'));exports[_0x6c04('0x6')]=function(_0x5ebc39,_0x50eebc){var _0xb68991,_0x6df6ba;var _0x17c3a6={'method':_0x5ebc39[_0x6c04('0x7')][_0x6c04('0x8')](),'uri':Mustache[_0x6c04('0x9')](_0x5ebc39['data2'],_0x50eebc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ebc39['data5'])===_0x6c04('0xa')&&parseInt(_0x5ebc39[_0x6c04('0xb')])>=0x1&&parseInt(_0x5ebc39[_0x6c04('0xb')])<=0xa?parseInt(_0x5ebc39[_0x6c04('0xb')])*0x3e8:0x5*0x3e8};try{_0x17c3a6[_0x6c04('0xc')]=_0x5ebc39[_0x6c04('0xd')]?JSON['parse'](Mustache[_0x6c04('0x9')](_0x5ebc39[_0x6c04('0xd')],_0x50eebc)):{};}catch(_0x286fb7){logger[_0x6c04('0xe')](_0x286fb7[_0x6c04('0xf')]);}switch(_0x5ebc39[_0x6c04('0x7')][_0x6c04('0x8')]()){case _0x6c04('0x10'):case _0x6c04('0x11'):_0xb68991=null;_0x17c3a6['qs']=_0x50eebc;break;case _0x6c04('0x12'):case _0x6c04('0x13'):if(_0x5ebc39[_0x6c04('0x14')]){try{_0xb68991=JSON[_0x6c04('0x15')](Mustache[_0x6c04('0x9')](_0x5ebc39[_0x6c04('0x14')],_0x50eebc));_0x17c3a6[_0x6c04('0x16')]=_0xb68991;}catch(_0x4f7740){logger['error'](_0x4f7740[_0x6c04('0xf')]);logger['error'](_0x6c04('0x17'));}}else{_0xb68991=_0x50eebc;_0x17c3a6[_0x6c04('0x16')]=_0xb68991;}break;}logger[_0x6c04('0x18')](util[_0x6c04('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5ebc39[_0x6c04('0x7')],_0x5ebc39[_0x6c04('0x1a')],JSON[_0x6c04('0x1b')](_0x17c3a6)));rp(_0x17c3a6)[_0x6c04('0x1c')](function(_0x34104a){_0xb68991=!_[_0x6c04('0x1d')](_0xb68991)?',\x20request\x20body:\x20'+_0xb68991:'';_0x6df6ba=typeof _0x34104a[_0x6c04('0x16')]===_0x6c04('0x1e')?JSON[_0x6c04('0x1b')](_0x34104a[_0x6c04('0x16')]):_0x34104a[_0x6c04('0x16')];logger[_0x6c04('0x18')](util[_0x6c04('0x19')](_0x6c04('0x1f'),_0x5ebc39[_0x6c04('0x7')],_0x5ebc39[_0x6c04('0x1a')],_0x34104a[_0x6c04('0x20')],_0x6df6ba));})[_0x6c04('0x21')](function(_0x2d7c6e){logger[_0x6c04('0xe')](util[_0x6c04('0x19')](_0x6c04('0x22'),_0x5ebc39['data1'],_0x5ebc39['data2'],_0x2d7c6e[_0x6c04('0x20')],_0x2d7c6e['name'],_0x2d7c6e[_0x6c04('0x23')]));});}; \ No newline at end of file +var _0x7240=['headers','parse','data6','stack','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','mustache','exec','data1','toUpperCase','render','data5','number'];(function(_0x5cb23e,_0x4ee4a7){var _0x135c55=function(_0xee5f08){while(--_0xee5f08){_0x5cb23e['push'](_0x5cb23e['shift']());}};_0x135c55(++_0x4ee4a7);}(_0x7240,0x178));var _0x0724=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x7240[_0x4b7895];return _0x264180;};'use strict';var rp=require(_0x0724('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x0724('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x0724('0x2')]=function(_0xda833c,_0x4448ac){var _0x47f465,_0x164cb7;var _0x59481={'method':_0xda833c[_0x0724('0x3')][_0x0724('0x4')](),'uri':Mustache[_0x0724('0x5')](_0xda833c['data2'],_0x4448ac),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xda833c[_0x0724('0x6')])===_0x0724('0x7')&&parseInt(_0xda833c['data5'])>=0x1&&parseInt(_0xda833c['data5'])<=0xa?parseInt(_0xda833c[_0x0724('0x6')])*0x3e8:0x5*0x3e8};try{_0x59481[_0x0724('0x8')]=_0xda833c['data6']?JSON[_0x0724('0x9')](Mustache[_0x0724('0x5')](_0xda833c[_0x0724('0xa')],_0x4448ac)):{};}catch(_0x398469){logger['error'](_0x398469[_0x0724('0xb')]);}switch(_0xda833c['data1']['toUpperCase']()){case'GET':case _0x0724('0xc'):_0x47f465=null;_0x59481['qs']=_0x4448ac;break;case _0x0724('0xd'):case _0x0724('0xe'):if(_0xda833c[_0x0724('0xf')]){try{_0x47f465=JSON[_0x0724('0x9')](Mustache['render'](_0xda833c[_0x0724('0xf')],_0x4448ac));_0x59481[_0x0724('0x10')]=_0x47f465;}catch(_0x54ce82){logger['error'](_0x54ce82[_0x0724('0xb')]);logger[_0x0724('0x11')](_0x0724('0x12'));}}else{_0x47f465=_0x4448ac;_0x59481['body']=_0x47f465;}break;}logger[_0x0724('0x13')](util[_0x0724('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xda833c[_0x0724('0x3')],_0xda833c[_0x0724('0x15')],JSON[_0x0724('0x16')](_0x59481)));rp(_0x59481)[_0x0724('0x17')](function(_0x3077c5){_0x47f465=!_[_0x0724('0x18')](_0x47f465)?_0x0724('0x19')+_0x47f465:'';_0x164cb7=typeof _0x3077c5[_0x0724('0x10')]===_0x0724('0x1a')?JSON[_0x0724('0x16')](_0x3077c5[_0x0724('0x10')]):_0x3077c5[_0x0724('0x10')];logger[_0x0724('0x13')](util[_0x0724('0x14')](_0x0724('0x1b'),_0xda833c[_0x0724('0x3')],_0xda833c[_0x0724('0x15')],_0x3077c5[_0x0724('0x1c')],_0x164cb7));})[_0x0724('0x1d')](function(_0x232706){logger['error'](util[_0x0724('0x14')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xda833c[_0x0724('0x3')],_0xda833c[_0x0724('0x15')],_0x232706[_0x0724('0x1c')],_0x232706[_0x0724('0x1e')],_0x232706[_0x0724('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d7a8c3a..413efcf 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 _0xdad0=['then','debug','rpc','error','message','result','exports','bluebird','../../config/logger','routing','http','Request'];(function(_0x26d96b,_0x13fd61){var _0x22722b=function(_0x1675b8){while(--_0x1675b8){_0x26d96b['push'](_0x26d96b['shift']());}};_0x22722b(++_0x13fd61);}(_0xdad0,0xaf));var _0x0dad=function(_0x5970af,_0x448c5b){_0x5970af=_0x5970af-0x0;var _0x24feff=_0xdad0[_0x5970af];return _0x24feff;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x0dad('0x0'));var logger=require(_0x0dad('0x1'))(_0x0dad('0x2'));var client=jayson['client'][_0x0dad('0x3')]({'port':0x2329});client[_0x0dad('0x4')]=function(_0x5234b1,_0x86b7e3){return new BPromise(function(_0x34ecdc,_0xe99e96){return client['request'](_0x5234b1,_0x86b7e3)[_0x0dad('0x5')](function(_0x2e0327){logger[_0x0dad('0x6')](_0x0dad('0x7'),'routing',_0x5234b1,_0x86b7e3,_0x2e0327);if(_0x2e0327[_0x0dad('0x8')]){logger[_0x0dad('0x8')](_0x0dad('0x7'),_0x0dad('0x2'),_0x5234b1,_0x2e0327[_0x0dad('0x8')]['message'],_0x86b7e3);return _0xe99e96(_0x2e0327[_0x0dad('0x8')][_0x0dad('0x9')]);}else{return _0x34ecdc(_0x2e0327[_0x0dad('0xa')]);}})['catch'](function(_0x4f4ee3){logger[_0x0dad('0x8')](_0x0dad('0x7'),_0x0dad('0x2'),_0x5234b1,_0x4f4ee3,_0x86b7e3);return _0xe99e96(_0x4f4ee3);});});};module[_0x0dad('0xb')]=client; \ No newline at end of file +var _0xd078=['debug','rpc','error','message','result','catch','exports','bluebird','routing','request','then'];(function(_0x820973,_0x4448c3){var _0x31b58a=function(_0x3d5225){while(--_0x3d5225){_0x820973['push'](_0x820973['shift']());}};_0x31b58a(++_0x4448c3);}(_0xd078,0x1a9));var _0x8d07=function(_0x2ec7aa,_0x4ec462){_0x2ec7aa=_0x2ec7aa-0x0;var _0x246745=_0xd078[_0x2ec7aa];return _0x246745;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x8d07('0x0'));var logger=require('../../config/logger')(_0x8d07('0x1'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x27ffae,_0x4cded3){return new BPromise(function(_0x12e156,_0x34efcd){return client[_0x8d07('0x2')](_0x27ffae,_0x4cded3)[_0x8d07('0x3')](function(_0x395984){logger[_0x8d07('0x4')](_0x8d07('0x5'),'routing',_0x27ffae,_0x4cded3,_0x395984);if(_0x395984['error']){logger[_0x8d07('0x6')]('rpc',_0x8d07('0x1'),_0x27ffae,_0x395984[_0x8d07('0x6')][_0x8d07('0x7')],_0x4cded3);return _0x34efcd(_0x395984[_0x8d07('0x6')][_0x8d07('0x7')]);}else{return _0x12e156(_0x395984[_0x8d07('0x8')]);}})[_0x8d07('0x9')](function(_0x1a02fa){logger[_0x8d07('0x6')](_0x8d07('0x5'),_0x8d07('0x1'),_0x27ffae,_0x1a02fa,_0x4cded3);return _0x34efcd(_0x1a02fa);});});};module[_0x8d07('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index fc2cb05..bee18f5 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 _0xb718=['./rpc/mailAccount','./rpc/setting','email','then','initMailAccounts','refresh','mailAccounts','listen','catch','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x16fb2a,_0x117a5d){var _0x4c5c29=function(_0x52ef01){while(--_0x52ef01){_0x16fb2a['push'](_0x16fb2a['shift']());}};_0x4c5c29(++_0x117a5d);}(_0xb718,0xda));var _0x8b71=function(_0xec359a,_0x5981db){_0xec359a=_0xec359a-0x0;var _0x49b5b8=_0xb718[_0xec359a];return _0x49b5b8;};'use strict';var server=require(_0x8b71('0x0'));var Realtime=require(_0x8b71('0x1'));var EmailChannel=require(_0x8b71('0x2'));var mailAccount=require(_0x8b71('0x3'));var setting=require(_0x8b71('0x4'));var logger=require('../../config/logger')(_0x8b71('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount['getMailAccounts']())[_0x8b71('0x6')](realtime[_0x8b71('0x7')]())[_0x8b71('0x6')](function(){email[_0x8b71('0x8')](realtime[_0x8b71('0x9')]);return realtime;});}function main(){return server[_0x8b71('0xa')](realtime,email)[_0x8b71('0x6')](function(){return initRealtime();})[_0x8b71('0x6')](function(){return setting['getSettings']();})['then'](function(_0x544d2a){return setInterval(initRealtime,_0x544d2a['loginMailFrequency']*0x3e8);})[_0x8b71('0xb')](function(_0x5c1bef){logger['error'](_0x8b71('0xc'),_0x5c1bef);});}main(); \ No newline at end of file +var _0xee3f=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch'];(function(_0x9ffb7f,_0x4d05b9){var _0x2b0564=function(_0x321118){while(--_0x321118){_0x9ffb7f['push'](_0x9ffb7f['shift']());}};_0x2b0564(++_0x4d05b9);}(_0xee3f,0xd2));var _0xfee3=function(_0x16227c,_0x42a189){_0x16227c=_0x16227c-0x0;var _0x1a7e2c=_0xee3f[_0x16227c];return _0x1a7e2c;};'use strict';var server=require(_0xfee3('0x0'));var Realtime=require(_0xfee3('0x1'));var EmailChannel=require(_0xfee3('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0xfee3('0x3'))(_0xfee3('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xfee3('0x5')]()[_0xfee3('0x6')](mailAccount[_0xfee3('0x7')]())[_0xfee3('0x6')](realtime[_0xfee3('0x8')]())[_0xfee3('0x6')](function(){email[_0xfee3('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xfee3('0xa')](realtime,email)[_0xfee3('0x6')](function(){return initRealtime();})[_0xfee3('0x6')](function(){return setting[_0xfee3('0xb')]();})[_0xfee3('0x6')](function(_0x46f8ac){return setInterval(initRealtime,_0x46f8ac[_0xfee3('0xc')]*0x3e8);})[_0xfee3('0xd')](function(_0x1437dc){logger[_0xfee3('0xe')](_0xfee3('0xf'),_0x1437dc);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 70421c9..86b03ed 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 _0xde12=['Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','moment','md5','ioredis','../../../config/environment','email','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','key','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','provider','custom','service','imapAccounts','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','disabled','messageStatus','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then'];(function(_0x514244,_0x332d0d){var _0x5785aa=function(_0x5166b8){while(--_0x5166b8){_0x514244['push'](_0x514244['shift']());}};_0x5785aa(++_0x332d0d);}(_0xde12,0x123));var _0x2de1=function(_0x642692,_0x1a7664){_0x642692=_0x642692-0x0;var _0xec9006=_0xde12[_0x642692];return _0xec9006;};'use strict';var _=require('lodash');var moment=require(_0x2de1('0x0'));var BPromise=require('bluebird');var md5=require(_0x2de1('0x1'));var Redis=require(_0x2de1('0x2'));var config=require(_0x2de1('0x3'));var logger=require('../../../config/logger')(_0x2de1('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2de1('0x5'))(new Redis(config[_0x2de1('0x6')]));var EmailImap=require(_0x2de1('0x7'));var EmailSmtp=require(_0x2de1('0x8'));var mailAccount=require(_0x2de1('0x9'));var md5Accounts={};function EmailChannel(_0xf378ea){logger['info'](_0x2de1('0xa'));this[_0x2de1('0xb')]=_0xf378ea[_0x2de1('0xb')];this['imapAccounts']={};this[_0x2de1('0xc')]=new EmailSmtp();}EmailChannel[_0x2de1('0xd')]['emit']=function(_0x13892c){var _0x3d5f81=this[_0x2de1('0xb')][_0x13892c];var _0x1fac44={'id':_0x3d5f81['id'],'name':_0x3d5f81['name'],'key':_0x3d5f81[_0x2de1('0xe')],'active':_0x3d5f81['active'],'Imap':{'status':_0x3d5f81[_0x2de1('0xf')][_0x2de1('0x10')],'messageStatus':_0x3d5f81['Imap']['messageStatus'],'total':_0x3d5f81[_0x2de1('0xf')][_0x2de1('0x11')]}};if(_[_0x2de1('0x12')](md5Accounts[_0x13892c])){md5Accounts[_0x13892c]={};}var _0x2aaeb1=md5(JSON[_0x2de1('0x13')](_0x1fac44));if(md5Accounts[_0x13892c][_0x2de1('0x1')]!==_0x2aaeb1){md5Accounts[_0x13892c][_0x2de1('0x1')]=_0x2aaeb1;io[_0x2de1('0x14')](_0x2de1('0x15'),_0x1fac44);}};EmailChannel[_0x2de1('0xd')][_0x2de1('0x16')]=function(_0x1efd85){for(var _0x6fccf3 in _0x1efd85){if(_0x1efd85['hasOwnProperty'](_0x6fccf3)){if(_0x1efd85[_0x6fccf3][_0x2de1('0xf')]&&_0x1efd85[_0x6fccf3]['active']){var _0x5287ef=_0x1efd85[_0x6fccf3][_0x2de1('0xf')];if(!_0x5287ef['service']&&_0x1efd85[_0x6fccf3][_0x2de1('0x17')]!==_0x2de1('0x18'))_0x5287ef[_0x2de1('0x19')]=_0x1efd85[_0x6fccf3][_0x2de1('0x17')];if(!this[_0x2de1('0x1a')][_0x2de1('0x1b')](_0x5287ef['id'])){this[_0x2de1('0x1a')][_0x5287ef['id']]=new EmailImap(_0x5287ef,_0x1efd85[_0x6fccf3][_0x2de1('0x4')]);this[_0x2de1('0x1a')][_0x5287ef['id']]['on'](_0x2de1('0x1c'),this[_0x2de1('0x1d')]['bind'](this,_0x6fccf3));this[_0x2de1('0x1a')][_0x5287ef['id']]['on'](_0x2de1('0x4'),this[_0x2de1('0x1e')][_0x2de1('0x1f')](this,_0x6fccf3));this['imapAccounts'][_0x5287ef['id']]['on'](_0x2de1('0x20'),this[_0x2de1('0x21')][_0x2de1('0x1f')](this,_0x6fccf3));this[_0x2de1('0x1a')][_0x5287ef['id']]['on'](_0x2de1('0x22'),this['handleImapError'][_0x2de1('0x1f')](this,_0x6fccf3));}}else{if(_[_0x2de1('0x12')](this[_0x2de1('0xb')][_0x6fccf3]['Imap'])){this[_0x2de1('0xb')][_0x6fccf3][_0x2de1('0xf')]={};}this[_0x2de1('0xb')][_0x6fccf3][_0x2de1('0xf')][_0x2de1('0x10')]=_0x2de1('0x23');this['mailAccounts'][_0x6fccf3][_0x2de1('0xf')][_0x2de1('0x24')]='';this[_0x2de1('0x14')](_0x6fccf3);}}}};EmailChannel[_0x2de1('0xd')][_0x2de1('0x1d')]=function(_0x1e560d,_0x3be32c){if(this[_0x2de1('0xb')][_0x1e560d]){this[_0x2de1('0xb')][_0x1e560d][_0x2de1('0xf')][_0x2de1('0x10')]=_0x2de1('0x25');this[_0x2de1('0xb')][_0x1e560d][_0x2de1('0xf')][_0x2de1('0x24')]=_0x3be32c['name'];if(_0x3be32c[_0x2de1('0x26')]){this[_0x2de1('0xb')][_0x1e560d]['Imap'][_0x2de1('0x11')]=_0x3be32c[_0x2de1('0x26')][_0x2de1('0x11')];}return this[_0x2de1('0x14')](_0x1e560d);}};EmailChannel[_0x2de1('0xd')][_0x2de1('0x1e')]=function(_0x32bcf6,_0x1b575e){logger[_0x2de1('0x27')](_0x2de1('0x28'),_0x1b575e[_0x2de1('0x29')],_0x1b575e[_0x2de1('0x2a')],_0x1b575e['from'],_0x32bcf6);if(this['mailAccounts'][_0x32bcf6]){return mailAccount[_0x2de1('0x2b')](_0x32bcf6,_0x1b575e)[_0x2de1('0x2c')](function(_0x3367af){if(_0x3367af){logger['info'](_0x2de1('0x2d'));}})[_0x2de1('0x2e')](function(_0x434478){logger['error'](_0x2de1('0x2f'),JSON[_0x2de1('0x13')](_0x434478));});}};EmailChannel[_0x2de1('0xd')][_0x2de1('0x21')]=function(_0x2cf5b8){if(this['mailAccounts'][_0x2cf5b8]&&this[_0x2de1('0xb')][_0x2cf5b8][_0x2de1('0xf')]){if(this[_0x2de1('0x1a')][this[_0x2de1('0xb')][_0x2cf5b8]['Imap']['id']]){delete this[_0x2de1('0x1a')][this[_0x2de1('0xb')][_0x2cf5b8][_0x2de1('0xf')]['id']];}this['mailAccounts'][_0x2cf5b8][_0x2de1('0xf')]['lastSync']=moment();this['emit'](_0x2cf5b8);}};EmailChannel[_0x2de1('0xd')]['handleImapError']=function(_0x148364,_0x21dc02){if(this[_0x2de1('0xb')][_0x148364]){this[_0x2de1('0xb')][_0x148364][_0x2de1('0xf')][_0x2de1('0x10')]=_0x2de1('0x22');this[_0x2de1('0xb')][_0x148364]['Imap']['messageStatus']=_0x21dc02;return this[_0x2de1('0x14')](_0x148364);}};EmailChannel[_0x2de1('0xd')][_0x2de1('0x30')]=function(_0x41aca6,_0x1d0d76){return this[_0x2de1('0xc')][_0x2de1('0x31')](_0x41aca6,_0x1d0d76);};EmailChannel[_0x2de1('0xd')][_0x2de1('0x32')]=function(_0x451e51){var _0xf0d2b3=this;if(this[_0x2de1('0xb')][_0x451e51['id']]){if(_['isNil'](this[_0x2de1('0xb')][_0x451e51['id']]['Smtp'])){this[_0x2de1('0xb')][_0x451e51['id']][_0x2de1('0x33')]={};}this[_0x2de1('0xb')][_0x451e51['id']][_0x2de1('0x33')][_0x2de1('0x34')]=moment();return new BPromise(function(_0x15a7dc,_0xae8a13){return _0xf0d2b3[_0x2de1('0xc')][_0x2de1('0x35')](_0x451e51)[_0x2de1('0x2c')](function(_0x45bf1c){_0xf0d2b3[_0x2de1('0xb')][_0x451e51['id']]['Smtp'][_0x2de1('0x10')]=_0x2de1('0x36');_0xf0d2b3[_0x2de1('0xb')][_0x451e51['id']][_0x2de1('0x33')][_0x2de1('0x24')]='';_0xf0d2b3['emit'](_0x451e51['id']);_0x15a7dc(_0x45bf1c);})[_0x2de1('0x2e')](function(_0x55c4fa){_0xf0d2b3[_0x2de1('0xb')][_0x451e51['id']][_0x2de1('0x33')]['status']=_0x2de1('0x22');_0xf0d2b3[_0x2de1('0xb')][_0x451e51['id']][_0x2de1('0x33')][_0x2de1('0x24')]=_0x55c4fa;_0xf0d2b3[_0x2de1('0x14')](_0x451e51['id']);_0xae8a13(_0x55c4fa);});});}return this[_0x2de1('0xc')][_0x2de1('0x35')](_0x451e51);};module[_0x2de1('0x37')]=EmailChannel; \ No newline at end of file +var _0x2923=['isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','email','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','connected','messages','total','firstName','from','then','catch','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','bluebird','md5','redis','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','prototype','name','key','active','status','messageStatus','Imap'];(function(_0x3e8be1,_0x5ae90c){var _0x5265cd=function(_0x6a3dc0){while(--_0x6a3dc0){_0x3e8be1['push'](_0x3e8be1['shift']());}};_0x5265cd(++_0x5ae90c);}(_0x2923,0x1a9));var _0x3292=function(_0x17d5a0,_0x4f2b28){_0x17d5a0=_0x17d5a0-0x0;var _0x2b31a3=_0x2923[_0x17d5a0];return _0x2b31a3;};'use strict';var _=require(_0x3292('0x0'));var moment=require('moment');var BPromise=require(_0x3292('0x1'));var md5=require(_0x3292('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('email');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3292('0x3')]));var EmailImap=require(_0x3292('0x4'));var EmailSmtp=require(_0x3292('0x5'));var mailAccount=require(_0x3292('0x6'));var md5Accounts={};function EmailChannel(_0x2fee4d){logger[_0x3292('0x7')]('start\x20email\x20channel');this[_0x3292('0x8')]=_0x2fee4d['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x3292('0x9')]['emit']=function(_0x23fdc2){var _0x45eea5=this[_0x3292('0x8')][_0x23fdc2];var _0x249d52={'id':_0x45eea5['id'],'name':_0x45eea5[_0x3292('0xa')],'key':_0x45eea5[_0x3292('0xb')],'active':_0x45eea5[_0x3292('0xc')],'Imap':{'status':_0x45eea5['Imap'][_0x3292('0xd')],'messageStatus':_0x45eea5['Imap'][_0x3292('0xe')],'total':_0x45eea5[_0x3292('0xf')]['total']}};if(_[_0x3292('0x10')](md5Accounts[_0x23fdc2])){md5Accounts[_0x23fdc2]={};}var _0x13adf6=md5(JSON[_0x3292('0x11')](_0x249d52));if(md5Accounts[_0x23fdc2]['md5']!==_0x13adf6){md5Accounts[_0x23fdc2][_0x3292('0x2')]=_0x13adf6;io[_0x3292('0x12')](_0x3292('0x13'),_0x249d52);}};EmailChannel[_0x3292('0x9')][_0x3292('0x14')]=function(_0x1fff89){for(var _0x470a23 in _0x1fff89){if(_0x1fff89[_0x3292('0x15')](_0x470a23)){if(_0x1fff89[_0x470a23]['Imap']&&_0x1fff89[_0x470a23]['active']){var _0x4b66d0=_0x1fff89[_0x470a23][_0x3292('0xf')];if(!_0x4b66d0[_0x3292('0x16')]&&_0x1fff89[_0x470a23][_0x3292('0x17')]!=='custom')_0x4b66d0['service']=_0x1fff89[_0x470a23][_0x3292('0x17')];if(!this[_0x3292('0x18')]['hasOwnProperty'](_0x4b66d0['id'])){this[_0x3292('0x18')][_0x4b66d0['id']]=new EmailImap(_0x4b66d0,_0x1fff89[_0x470a23][_0x3292('0x19')]);this[_0x3292('0x18')][_0x4b66d0['id']]['on']('box',this[_0x3292('0x1a')][_0x3292('0x1b')](this,_0x470a23));this[_0x3292('0x18')][_0x4b66d0['id']]['on'](_0x3292('0x19'),this[_0x3292('0x1c')]['bind'](this,_0x470a23));this[_0x3292('0x18')][_0x4b66d0['id']]['on'](_0x3292('0x1d'),this[_0x3292('0x1e')]['bind'](this,_0x470a23));this['imapAccounts'][_0x4b66d0['id']]['on'](_0x3292('0x1f'),this['handleImapError']['bind'](this,_0x470a23));}}else{if(_[_0x3292('0x10')](this[_0x3292('0x8')][_0x470a23][_0x3292('0xf')])){this[_0x3292('0x8')][_0x470a23][_0x3292('0xf')]={};}this[_0x3292('0x8')][_0x470a23][_0x3292('0xf')]['status']=_0x3292('0x20');this[_0x3292('0x8')][_0x470a23][_0x3292('0xf')]['messageStatus']='';this[_0x3292('0x12')](_0x470a23);}}}};EmailChannel[_0x3292('0x9')]['handleImapBox']=function(_0x232c1e,_0x4e7564){if(this[_0x3292('0x8')][_0x232c1e]){this['mailAccounts'][_0x232c1e][_0x3292('0xf')][_0x3292('0xd')]=_0x3292('0x21');this[_0x3292('0x8')][_0x232c1e][_0x3292('0xf')]['messageStatus']=_0x4e7564[_0x3292('0xa')];if(_0x4e7564[_0x3292('0x22')]){this[_0x3292('0x8')][_0x232c1e]['Imap'][_0x3292('0x23')]=_0x4e7564[_0x3292('0x22')][_0x3292('0x23')];}return this[_0x3292('0x12')](_0x232c1e);}};EmailChannel[_0x3292('0x9')]['handleImapEmail']=function(_0x3d372b,_0x49dce8){logger[_0x3292('0x7')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x49dce8[_0x3292('0x24')],_0x49dce8['lastName'],_0x49dce8[_0x3292('0x25')],_0x3d372b);if(this[_0x3292('0x8')][_0x3d372b]){return mailAccount['notify'](_0x3d372b,_0x49dce8)[_0x3292('0x26')](function(_0x2828c6){if(_0x2828c6){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x3292('0x27')](function(_0x3fcd0c){logger[_0x3292('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x3292('0x11')](_0x3fcd0c));});}};EmailChannel[_0x3292('0x9')][_0x3292('0x1e')]=function(_0x1f378f){if(this[_0x3292('0x8')][_0x1f378f]&&this[_0x3292('0x8')][_0x1f378f][_0x3292('0xf')]){if(this[_0x3292('0x18')][this[_0x3292('0x8')][_0x1f378f]['Imap']['id']]){delete this[_0x3292('0x18')][this[_0x3292('0x8')][_0x1f378f]['Imap']['id']];}this['mailAccounts'][_0x1f378f][_0x3292('0xf')][_0x3292('0x28')]=moment();this[_0x3292('0x12')](_0x1f378f);}};EmailChannel[_0x3292('0x9')]['handleImapError']=function(_0x1c7737,_0x3fd46b){if(this[_0x3292('0x8')][_0x1c7737]){this[_0x3292('0x8')][_0x1c7737][_0x3292('0xf')][_0x3292('0xd')]='error';this['mailAccounts'][_0x1c7737][_0x3292('0xf')][_0x3292('0xe')]=_0x3fd46b;return this['emit'](_0x1c7737);}};EmailChannel[_0x3292('0x9')][_0x3292('0x29')]=function(_0x5ef6ac,_0x4a1243){return this[_0x3292('0x2a')][_0x3292('0x2b')](_0x5ef6ac,_0x4a1243);};EmailChannel[_0x3292('0x9')][_0x3292('0x2c')]=function(_0x12c469){var _0x20beaf=this;if(this['mailAccounts'][_0x12c469['id']]){if(_[_0x3292('0x10')](this['mailAccounts'][_0x12c469['id']]['Smtp'])){this['mailAccounts'][_0x12c469['id']][_0x3292('0x2d')]={};}this[_0x3292('0x8')][_0x12c469['id']]['Smtp'][_0x3292('0x28')]=moment();return new BPromise(function(_0x4a3be9,_0x393ec1){return _0x20beaf['smtp'][_0x3292('0x2e')](_0x12c469)[_0x3292('0x26')](function(_0x20c202){_0x20beaf[_0x3292('0x8')][_0x12c469['id']][_0x3292('0x2d')][_0x3292('0xd')]=_0x3292('0x2f');_0x20beaf[_0x3292('0x8')][_0x12c469['id']][_0x3292('0x2d')]['messageStatus']='';_0x20beaf['emit'](_0x12c469['id']);_0x4a3be9(_0x20c202);})['catch'](function(_0x16cdb1){_0x20beaf['mailAccounts'][_0x12c469['id']]['Smtp'][_0x3292('0xd')]=_0x3292('0x1f');_0x20beaf[_0x3292('0x8')][_0x12c469['id']][_0x3292('0x2d')][_0x3292('0xe')]=_0x16cdb1;_0x20beaf[_0x3292('0x12')](_0x12c469['id']);_0x393ec1(_0x16cdb1);});});}return this[_0x3292('0x2a')][_0x3292('0x2e')](_0x12c469);};module[_0x3292('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1f65131..10f1f3e 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 _0xfaa4=['parser','handleFetchEnd','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','Iconv','events','./utils','../../../config/logger','mailbox','account','ready','handleReady','once','end','bind','error','handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','email','anonymous@xcally.com','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xfaa4,0xc9));var _0x4faa=function(_0x3f663d,_0x18c8bb){_0x3f663d=_0x3f663d-0x0;var _0x2108a2=_0xfaa4[_0x3f663d];return _0x2108a2;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var Imap=require(_0x4faa('0x2'));var simpleParser=require(_0x4faa('0x3'))['simpleParser'];var Iconv=require(_0x4faa('0x4'))[_0x4faa('0x5')];var EventEmitter=require(_0x4faa('0x6'))['EventEmitter'];var utils=require(_0x4faa('0x7'));var logger=require(_0x4faa('0x8'))('email');function EmailImap(_0x3a3833,_0x57e1a9){this[_0x4faa('0x9')]=_0x3a3833[_0x4faa('0x9')];this[_0x4faa('0xa')]=this['getAccount'](_0x3a3833,_0x57e1a9);this[_0x4faa('0x2')]=new Imap(this[_0x4faa('0xa')]);this[_0x4faa('0x2')]['once'](_0x4faa('0xb'),this[_0x4faa('0xc')]['bind'](this));this[_0x4faa('0x2')][_0x4faa('0xd')](_0x4faa('0xe'),this['handleEnd'][_0x4faa('0xf')](this));this[_0x4faa('0x2')]['on'](_0x4faa('0x10'),this[_0x4faa('0x11')][_0x4faa('0xf')](this));this['imap'][_0x4faa('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x2a6d27,_0x185c90){var _0x4ee12c={'connTimeout':_0x2a6d27['connTimeout']?_0x2a6d27[_0x4faa('0x13')]*0x3e8:0x2710,'authTimeout':_0x2a6d27[_0x4faa('0x14')]?_0x2a6d27[_0x4faa('0x14')]*0x3e8:0x1388};if(_0x2a6d27[_0x4faa('0x15')]){_0x4ee12c[_0x4faa('0x16')]=_0x2a6d27[_0x4faa('0x16')];if(_0x2a6d27[_0x4faa('0x17')]){_0x4ee12c[_0x4faa('0x18')]=utils[_0x4faa('0x19')](_0x2a6d27['CloudProvider'][_0x4faa('0x1a')],_0x2a6d27[_0x4faa('0x16')]);}else{_0x4ee12c[_0x4faa('0x1b')]=_0x2a6d27['password'];}}else{if(_0x2a6d27['authentication']){_0x4ee12c[_0x4faa('0x16')]=_0x2a6d27[_0x4faa('0x16')];_0x4ee12c[_0x4faa('0x1b')]=_0x2a6d27['password'];}}_0x4ee12c[_0x4faa('0x1c')]=_0x185c90||_0x2a6d27['user']||_0x4faa('0x1d');_0x4ee12c[_0x4faa('0x1e')]=_0x2a6d27[_0x4faa('0x1e')];_0x4ee12c['port']=_0x2a6d27[_0x4faa('0x1f')]||0x3e1;if(_0x2a6d27[_0x4faa('0x20')]){_0x4ee12c[_0x4faa('0x20')]=!![];}else{_0x4ee12c[_0x4faa('0x20')]=![];_0x4ee12c[_0x4faa('0x21')]=_0x4faa('0x22');}return _0x4ee12c;};EmailImap[_0x4faa('0x23')][_0x4faa('0xc')]=function(){this['imap'][_0x4faa('0x24')](this['mailbox'],![],this[_0x4faa('0x25')][_0x4faa('0xf')](this));};EmailImap[_0x4faa('0x23')][_0x4faa('0x25')]=function(_0x2b0d69,_0x48002e){if(_0x2b0d69){this['handleError'](_0x2b0d69,!![]);}else{this[_0x4faa('0x26')](_0x4faa('0x27'),_0x48002e);this[_0x4faa('0x28')]();}};EmailImap[_0x4faa('0x23')][_0x4faa('0x29')]=function(_0x5f5ab8){if(_0x5f5ab8){this[_0x4faa('0x11')](_0x5f5ab8,!![]);}else{this[_0x4faa('0x2')][_0x4faa('0xe')]();}};EmailImap[_0x4faa('0x23')][_0x4faa('0x28')]=function(){this['imap'][_0x4faa('0x2a')]([_0x4faa('0x2b')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x4faa('0x23')][_0x4faa('0x2c')]=function(_0xe6b2f7,_0x7fc50b){if(_0xe6b2f7){this[_0x4faa('0x11')](_0xe6b2f7,!![]);}else{if(_0x7fc50b[_0x4faa('0x2d')]){try{var _0x2468cd=this[_0x4faa('0x2')][_0x4faa('0x2e')](_0x7fc50b,{'bodies':'','markSeen':!![]});_0x2468cd['on'](_0x4faa('0x2f'),this[_0x4faa('0x30')]['bind'](this));_0x2468cd[_0x4faa('0xd')]('error',this[_0x4faa('0x31')][_0x4faa('0xf')](this));_0x2468cd[_0x4faa('0xd')]('end',this['handleFetchEnd'][_0x4faa('0xf')](this));}catch(_0x49bbd5){logger[_0x4faa('0x10')](_0x49bbd5);}}else{this[_0x4faa('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x4faa('0x23')][_0x4faa('0x30')]=function(_0x99072a){_0x99072a['on']('body',this['handleMessageBody'][_0x4faa('0xf')](this));_0x99072a[_0x4faa('0xd')](_0x4faa('0x32'),this[_0x4faa('0x33')][_0x4faa('0xf')](this));_0x99072a['once']('end',this[_0x4faa('0x34')][_0x4faa('0xf')](this));};EmailImap[_0x4faa('0x23')][_0x4faa('0x35')]=function(_0x4b1f09){simpleParser(_0x4b1f09,{'Iconv':Iconv},this[_0x4faa('0x36')][_0x4faa('0xf')](this));};EmailImap[_0x4faa('0x23')][_0x4faa('0x33')]=function(){};EmailImap[_0x4faa('0x23')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x4faa('0x36')]=function(_0x1472fd,_0x15a58d){if(_0x1472fd){logger['error'](_0x1472fd);}else{var _0x466523=this;utils[_0x4faa('0x37')](this[_0x4faa('0xa')],_0x15a58d,function(_0x4b426e){_0x466523[_0x4faa('0x26')](_0x4faa('0x1c'),_0x4b426e);});}};EmailImap[_0x4faa('0x23')][_0x4faa('0x38')]=function(){this['imap'][_0x4faa('0x39')](!![],this[_0x4faa('0x29')][_0x4faa('0xf')](this));};EmailImap[_0x4faa('0x23')][_0x4faa('0x31')]=function(_0x1005bf){this[_0x4faa('0x11')](_0x1005bf);this[_0x4faa('0x2')][_0x4faa('0x39')](!![],this[_0x4faa('0x29')][_0x4faa('0xf')](this));};EmailImap['prototype'][_0x4faa('0x3a')]=function(){this[_0x4faa('0x26')]('end');};EmailImap['prototype'][_0x4faa('0x11')]=function(_0x348373,_0x374448){logger[_0x4faa('0x10')](_0x4faa('0x11'),this[_0x4faa('0xa')]['email'],JSON[_0x4faa('0x3b')](_0x348373));var _0x4c9b92='';if(_0x348373){if(_0x348373[_0x4faa('0x3c')]){_0x4c9b92=_0x348373[_0x4faa('0x3c')];}else{for(var _0x476252 in _0x348373){if(_0x348373[_0x4faa('0x3d')](_0x476252)){_0x4c9b92+=_[_0x4faa('0x3e')](_0x476252)+':\x20'+_0x348373[_0x476252]+'\x0a';}}}}if(_0x374448){this[_0x4faa('0x2')][_0x4faa('0xe')]();}else{this[_0x4faa('0x26')]('error',_0x4c9b92);this[_0x4faa('0x26')](_0x4faa('0xe'));}};module[_0x4faa('0x3f')]=EmailImap; \ No newline at end of file +var _0x858f=['bind','end','handleEnd','handleError','connect','inherits','getAccount','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','port','tls','autotls','required','openBox','prototype','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchEnd','error','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','handleFetchError','textCode','hasOwnProperty','upperFirst','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','mailbox','account','once','ready','handleReady'];(function(_0x5222d9,_0x12496d){var _0x16b0d5=function(_0x4220a6){while(--_0x4220a6){_0x5222d9['push'](_0x5222d9['shift']());}};_0x16b0d5(++_0x12496d);}(_0x858f,0xeb));var _0xf858=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x858f[_0x1b70e3];return _0x1452ab;};'use strict';var _=require('lodash');var util=require('util');var Imap=require(_0xf858('0x0'));var simpleParser=require(_0xf858('0x1'))[_0xf858('0x2')];var Iconv=require(_0xf858('0x3'))[_0xf858('0x4')];var EventEmitter=require(_0xf858('0x5'))['EventEmitter'];var utils=require(_0xf858('0x6'));var logger=require(_0xf858('0x7'))('email');function EmailImap(_0x27b4a5,_0x4a985b){this[_0xf858('0x8')]=_0x27b4a5[_0xf858('0x8')];this[_0xf858('0x9')]=this['getAccount'](_0x27b4a5,_0x4a985b);this[_0xf858('0x0')]=new Imap(this[_0xf858('0x9')]);this[_0xf858('0x0')][_0xf858('0xa')](_0xf858('0xb'),this[_0xf858('0xc')][_0xf858('0xd')](this));this[_0xf858('0x0')][_0xf858('0xa')](_0xf858('0xe'),this[_0xf858('0xf')][_0xf858('0xd')](this));this['imap']['on']('error',this[_0xf858('0x10')][_0xf858('0xd')](this));this[_0xf858('0x0')][_0xf858('0x11')]();}util[_0xf858('0x12')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf858('0x13')]=function(_0x37c2d0,_0x597343){var _0x37e817={'connTimeout':_0x37c2d0[_0xf858('0x14')]?_0x37c2d0['connTimeout']*0x3e8:0x2710,'authTimeout':_0x37c2d0[_0xf858('0x15')]?_0x37c2d0[_0xf858('0x15')]*0x3e8:0x1388};if(_0x37c2d0['service']){_0x37e817[_0xf858('0x16')]=_0x37c2d0[_0xf858('0x16')];if(_0x37c2d0[_0xf858('0x17')]){_0x37e817[_0xf858('0x18')]=utils[_0xf858('0x19')](_0x37c2d0[_0xf858('0x1a')][_0xf858('0x1b')],_0x37c2d0[_0xf858('0x16')]);}else{_0x37e817[_0xf858('0x1c')]=_0x37c2d0[_0xf858('0x1c')];}}else{if(_0x37c2d0[_0xf858('0x1d')]){_0x37e817[_0xf858('0x16')]=_0x37c2d0[_0xf858('0x16')];_0x37e817[_0xf858('0x1c')]=_0x37c2d0[_0xf858('0x1c')];}}_0x37e817['email']=_0x597343||_0x37c2d0['user']||_0xf858('0x1e');_0x37e817['host']=_0x37c2d0['host'];_0x37e817[_0xf858('0x1f')]=_0x37c2d0[_0xf858('0x1f')]||0x3e1;if(_0x37c2d0[_0xf858('0x20')]){_0x37e817['tls']=!![];}else{_0x37e817[_0xf858('0x20')]=![];_0x37e817[_0xf858('0x21')]=_0xf858('0x22');}return _0x37e817;};EmailImap['prototype'][_0xf858('0xc')]=function(){this['imap'][_0xf858('0x23')](this[_0xf858('0x8')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xf858('0x24')][_0xf858('0x25')]=function(_0x69d667,_0x103cad){if(_0x69d667){this[_0xf858('0x10')](_0x69d667,!![]);}else{this[_0xf858('0x26')](_0xf858('0x27'),_0x103cad);this[_0xf858('0x28')]();}};EmailImap[_0xf858('0x24')][_0xf858('0x29')]=function(_0xf05c4a){if(_0xf05c4a){this[_0xf858('0x10')](_0xf05c4a,!![]);}else{this[_0xf858('0x0')][_0xf858('0xe')]();}};EmailImap[_0xf858('0x24')][_0xf858('0x28')]=function(){this[_0xf858('0x0')]['search']([_0xf858('0x2a')],this[_0xf858('0x2b')][_0xf858('0xd')](this));};EmailImap[_0xf858('0x24')][_0xf858('0x2b')]=function(_0x57b3cb,_0x4894a8){if(_0x57b3cb){this[_0xf858('0x10')](_0x57b3cb,!![]);}else{if(_0x4894a8[_0xf858('0x2c')]){try{var _0x370669=this[_0xf858('0x0')][_0xf858('0x2d')](_0x4894a8,{'bodies':'','markSeen':!![]});_0x370669['on'](_0xf858('0x2e'),this['handleFetchMessage'][_0xf858('0xd')](this));_0x370669[_0xf858('0xa')]('error',this['handleFetchError']['bind'](this));_0x370669[_0xf858('0xa')](_0xf858('0xe'),this[_0xf858('0x2f')][_0xf858('0xd')](this));}catch(_0x1ea1a7){logger[_0xf858('0x30')](_0x1ea1a7);}}else{this[_0xf858('0x0')][_0xf858('0x31')](!![],this[_0xf858('0x29')][_0xf858('0xd')](this));}}};EmailImap[_0xf858('0x24')][_0xf858('0x32')]=function(_0x3855e6){_0x3855e6['on']('body',this[_0xf858('0x33')]['bind'](this));_0x3855e6[_0xf858('0xa')](_0xf858('0x34'),this[_0xf858('0x35')]['bind'](this));_0x3855e6[_0xf858('0xa')](_0xf858('0xe'),this[_0xf858('0x36')]['bind'](this));};EmailImap[_0xf858('0x24')]['handleMessageBody']=function(_0x399be4){simpleParser(_0x399be4,{'Iconv':Iconv},this[_0xf858('0x37')][_0xf858('0xd')](this));};EmailImap['prototype'][_0xf858('0x35')]=function(){};EmailImap[_0xf858('0x24')][_0xf858('0x36')]=function(){};EmailImap[_0xf858('0x24')][_0xf858('0x37')]=function(_0x2e1228,_0x589d6f){if(_0x2e1228){logger['error'](_0x2e1228);}else{var _0x32d7a6=this;utils[_0xf858('0x38')](this[_0xf858('0x9')],_0x589d6f,function(_0x28fe6f){_0x32d7a6[_0xf858('0x26')](_0xf858('0x39'),_0x28fe6f);});}};EmailImap[_0xf858('0x24')][_0xf858('0x2f')]=function(){this['imap'][_0xf858('0x31')](!![],this[_0xf858('0x29')][_0xf858('0xd')](this));};EmailImap['prototype'][_0xf858('0x3a')]=function(_0x40bcc6){this[_0xf858('0x10')](_0x40bcc6);this['imap'][_0xf858('0x31')](!![],this[_0xf858('0x29')]['bind'](this));};EmailImap[_0xf858('0x24')]['handleEnd']=function(){this['emit'](_0xf858('0xe'));};EmailImap[_0xf858('0x24')][_0xf858('0x10')]=function(_0x353dca,_0x594707){logger[_0xf858('0x30')](_0xf858('0x10'),this[_0xf858('0x9')]['email'],JSON['stringify'](_0x353dca));var _0x2f822e='';if(_0x353dca){if(_0x353dca[_0xf858('0x3b')]){_0x2f822e=_0x353dca[_0xf858('0x3b')];}else{for(var _0x182a2e in _0x353dca){if(_0x353dca[_0xf858('0x3c')](_0x182a2e)){_0x2f822e+=_[_0xf858('0x3d')](_0x182a2e)+':\x20'+_0x353dca[_0x182a2e]+'\x0a';}}}}if(_0x594707){this[_0xf858('0x0')][_0xf858('0xe')]();}else{this['emit'](_0xf858('0x30'),_0x2f822e);this[_0xf858('0x26')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 68e98d6..6a20b67 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 _0x9913=['toString','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','verify'];(function(_0x5ed97f,_0x140b1d){var _0xfcd062=function(_0x21dd3e){while(--_0x21dd3e){_0x5ed97f['push'](_0x5ed97f['shift']());}};_0xfcd062(++_0x140b1d);}(_0x9913,0xca));var _0x3991=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x9913[_0x424a9a];return _0xa7831c;};'use strict';var nodemailer=require(_0x3991('0x0'));var inlineBase64=require(_0x3991('0x1'));function EmailSmtp(){}EmailSmtp[_0x3991('0x2')][_0x3991('0x3')]=function(_0x2b54b,_0x386b15){return new Promise(function(_0x1468f9,_0x2627e4){var _0x551190=nodemailer[_0x3991('0x4')](_0x2b54b);_0x551190[_0x3991('0x5')](_0x3991('0x6'),inlineBase64());_0x551190['sendMail'](_0x386b15,function(_0x2d4f37,_0x190434){if(_0x2d4f37){_0x2627e4(_0x2d4f37['toString']());}else{_0x1468f9(_0x190434);}});});};EmailSmtp[_0x3991('0x2')][_0x3991('0x7')]=function(_0x56cc49){return new Promise(function(_0x2d3d97,_0x394a35){var _0x327e37=nodemailer['createTransport'](_0x56cc49);_0x327e37[_0x3991('0x7')](function(_0xf7b6dc,_0xda32fc){if(_0xf7b6dc){_0x394a35(_0xf7b6dc[_0x3991('0x8')]());}else{if(_0xda32fc){_0x2d3d97(_0xda32fc);}else{_0x394a35('Not\x20verifired');}}});});};module[_0x3991('0x9')]=EmailSmtp; \ No newline at end of file +var _0x7aba=['prototype','use','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64'];(function(_0x597bdc,_0xc409c2){var _0x465537=function(_0x10af82){while(--_0x10af82){_0x597bdc['push'](_0x597bdc['shift']());}};_0x465537(++_0xc409c2);}(_0x7aba,0x170));var _0xa7ab=function(_0x1edca2,_0x91cc50){_0x1edca2=_0x1edca2-0x0;var _0xf96991=_0x7aba[_0x1edca2];return _0xf96991;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa7ab('0x0'));function EmailSmtp(){}EmailSmtp[_0xa7ab('0x1')]['send']=function(_0x2089c6,_0x32e259){return new Promise(function(_0x4f9bf7,_0x57d4d2){var _0x3e8c90=nodemailer['createTransport'](_0x2089c6);_0x3e8c90[_0xa7ab('0x2')]('compile',inlineBase64());_0x3e8c90[_0xa7ab('0x3')](_0x32e259,function(_0x214dfe,_0x49dfd0){if(_0x214dfe){_0x57d4d2(_0x214dfe[_0xa7ab('0x4')]());}else{_0x4f9bf7(_0x49dfd0);}});});};EmailSmtp[_0xa7ab('0x1')]['verify']=function(_0x2f3ff0){return new Promise(function(_0x2bc567,_0x17b900){var _0x3ab310=nodemailer[_0xa7ab('0x5')](_0x2f3ff0);_0x3ab310[_0xa7ab('0x6')](function(_0x23d5cb,_0x228d3d){if(_0x23d5cb){_0x17b900(_0x23d5cb['toString']());}else{if(_0x228d3d){_0x2bc567(_0x228d3d);}else{_0x17b900(_0xa7ab('0x7'));}}});});};module[_0xa7ab('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 1f846d9..8ee279a 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 _0x1225=['parser','from','subject','inReplyTo','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','BodyHTML','

Empty\x20message

','Attachments','Data','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','util','node-tnef','email','head','value','address','generate','@xcally.com','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','html','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','bcc','attachments','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply'];(function(_0x58332b,_0x158d5d){var _0x2376af=function(_0x268a62){while(--_0x268a62){_0x58332b['push'](_0x58332b['shift']());}};_0x2376af(++_0x158d5d);}(_0x1225,0x16f));var _0x5122=function(_0x174a7c,_0x4d446f){_0x174a7c=_0x174a7c-0x0;var _0x25ee5b=_0x1225[_0x174a7c];return _0x25ee5b;};'use strict';var _=require('lodash');var moment=require(_0x5122('0x0'));var random=require(_0x5122('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x5122('0x2'));var tnef=require(_0x5122('0x3'));var logger=require('../../../config/logger')(_0x5122('0x4'));var config=require('../../../config/environment');function getAddress(_0x559b1f){var _0x3f13c6=_[_0x5122('0x5')](_0x559b1f[_0x5122('0x6')]);return _0x3f13c6&&_0x3f13c6['address']?_0x3f13c6[_0x5122('0x7')]:'anonymous'+random[_0x5122('0x8')](0x6)+_0x5122('0x9');}function getFirstName(_0xdcbf9a){var _0x411b9a=_[_0x5122('0x5')](_0xdcbf9a[_0x5122('0x6')]);if(_0x411b9a&&_0x411b9a['name']){if(_0x411b9a[_0x5122('0xa')]==_0x411b9a[_0x5122('0x7')]){return _0x411b9a[_0x5122('0xa')][_0x5122('0xb')](0x0,_0x411b9a['name'][_0x5122('0xc')]('@'));}var _0x155ad9=_0x411b9a['name'][_0x5122('0xd')](/\s+/);return _0x155ad9[_0x5122('0xe')]>0x1?_0x155ad9['slice'](0x0,-0x1)[_0x5122('0xf')]('\x20'):_0x411b9a['name'];}return _0x5122('0x10');}function getLastName(_0x1b5b94){var _0x36415e=_[_0x5122('0x5')](_0x1b5b94['value']);if(_0x36415e&&_0x36415e['name']){var _0x4a75e6=_0x36415e[_0x5122('0xa')][_0x5122('0xd')](/\s+/);return _0x4a75e6[_0x5122('0xe')]>0x1?_0x4a75e6[_0x5122('0x11')]():'';}return'';}function getMails(_0x41e01e,_0x56c5e9){var _0xa31fc5='';for(var _0x5c9ca0=0x0;_0x5c9ca0<_0x56c5e9[_0x5122('0x6')][_0x5122('0xe')];_0x5c9ca0+=0x1){if(_0x56c5e9[_0x5122('0x6')][_0x5c9ca0][_0x5122('0x7')]!==_0x41e01e){if(!_[_0x5122('0x12')](_0xa31fc5)){_0xa31fc5+=',';}_0xa31fc5+=_0x56c5e9['value'][_0x5c9ca0][_0x5122('0xa')]||_0x56c5e9[_0x5122('0x6')][_0x5c9ca0]['address']||'';_0xa31fc5+='\x20<';_0xa31fc5+=_0x56c5e9[_0x5122('0x6')][_0x5c9ca0][_0x5122('0x7')]?_0x56c5e9[_0x5122('0x6')][_0x5c9ca0][_0x5122('0x7')]:'anonymous'+random[_0x5122('0x8')](0x6)+'@xcally.com';_0xa31fc5+='>';}}return _0xa31fc5;}function parseEmail(_0x3c8a7c,_0x15a30d,_0xa9588b){if(_0x15a30d[_0x5122('0x13')]){var _0x50474f=/)<[^<]*)*<\/script>/gi;while(_0x50474f['test'](_0x15a30d[_0x5122('0x13')])){_0x15a30d[_0x5122('0x13')]=_0x15a30d['html'][_0x5122('0x14')](_0x50474f,'');}if(_0x15a30d[_0x5122('0x13')][_0x5122('0x15')]('{_0x4ee41f[_0x5122('0x17')](_0x3db3c4[_0x5122('0x18')]);});var _0x141a72=/]+>/g;var _0x8f4758=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x254916=_0x15a30d['html']['replace'](_0x8f4758,_0x5122('0x19'));var _0x38b79f=_0x254916[_0x5122('0x14')](_0x141a72,_0x5122('0x1a'));for(let _0x2ceecc=0x0;_0x2ceecc<_0x4ee41f['length'];_0x2ceecc++){var _0x5db750=_0x38b79f['replace'](_0x5122('0x1a'),_0x5122('0x1b')+_0x4ee41f[_0x2ceecc]+_0x5122('0x1c'));_0x38b79f=_0x5db750;}_0x15a30d[_0x5122('0x13')]=_0x38b79f;}_0xa9588b['body']=_0x15a30d[_0x5122('0x13')];}else{_0xa9588b[_0x5122('0x1d')]=_0x15a30d[_0x5122('0x1e')];}if(_0xa9588b[_0x5122('0x1d')]){_0xa9588b[_0x5122('0x1d')]=_0xa9588b[_0x5122('0x1d')][_0x5122('0x14')](/0x0){var _0x137f1f=[_0x5122('0x30'),_0x5122('0x31'),_0x5122('0x32')];for(var _0x27984c=0x0;_0x27984c<_0x15a30d[_0x5122('0x2f')][_0x5122('0xe')];_0x27984c++){var _0x101695=_[_0x5122('0xc')](_0x137f1f,_0x15a30d[_0x5122('0x2f')][_0x27984c][_0x5122('0x33')]);if(_0x101695>=0x0){_0xa9588b[_0x5122('0x34')]=!![];}}}return _0xa9588b;}exports[_0x5122('0x35')]=function(_0x3f0392,_0x40c7fe,_0x5e1f03){var _0x20bf80={'from':getAddress(_0x40c7fe['from']),'firstName':getFirstName(_0x40c7fe['from']),'lastName':getLastName(_0x40c7fe[_0x5122('0x36')]),'mapKey':'email','message':{'from':getMails(_0x3f0392['email'],_0x40c7fe[_0x5122('0x36')]),'to':_0x3f0392['email'],'cc':'','subject':_0x40c7fe[_0x5122('0x37')]||'','messageId':_0x40c7fe['messageId'],'inReplyTo':_0x40c7fe[_0x5122('0x38')],'sentAt':moment(_0x40c7fe['date'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x40c7fe['html']&&!_0x40c7fe[_0x5122('0x1e')]){var _0x475ab0=_[_0x5122('0x39')](_0x40c7fe['attachments'],{'contentType':'application/ms-tnef'});if(_0x475ab0[_0x5122('0xe')]){logger[_0x5122('0x3a')](util[_0x5122('0x27')](_0x5122('0x3b'),_0x40c7fe[_0x5122('0x3c')]));tnef['parseBuffer'](_[_0x5122('0x3d')](_0x475ab0)[_0x5122('0x2d')],function(_0x5bcec3,_0x3adf2f){if(_0x3adf2f){_0x40c7fe[_0x5122('0x13')]=_0x3adf2f[_0x5122('0x3e')]||_0x5122('0x3f');if(_0x3adf2f[_0x5122('0x40')]){for(var _0x4498b8=0x0;_0x4498b8<_0x3adf2f['Attachments'][_0x5122('0xe')];_0x4498b8++){var _0xebe363=_0x3adf2f[_0x5122('0x40')][_0x4498b8];_0x20bf80['message'][_0x5122('0x23')]['push']({'filename':_0xebe363['Title'],'content':Buffer[_0x5122('0x36')](_0xebe363[_0x5122('0x41')])});}}}_0x5e1f03(parseEmail(_0x3f0392,_0x40c7fe,_0x20bf80));});}else{_0x40c7fe[_0x5122('0x13')]='

Empty\x20message

';_0x5e1f03(parseEmail(_0x3f0392,_0x40c7fe,_0x20bf80));}}else{_0x5e1f03(parseEmail(_0x3f0392,_0x40c7fe,_0x20bf80));}};exports['generateXOAuth2Token']=function(_0x1618a8,_0x3701ce){var _0x42354a=['user='+(_0x3701ce||''),_0x5122('0x42')+_0x1618a8,'',''];return Buffer['from'](_0x42354a[_0x5122('0xf')](''),_0x5122('0x43'))[_0x5122('0x44')](_0x5122('0x45'));}; \ No newline at end of file +var _0xb89f=['contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','randomstring','util','node-tnef','address','anonymous','generate','value','name','substring','split','length','slice','join','Anonymous','head','pop','isEmpty','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','email','bcc','attachments','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync'];(function(_0x4e1b06,_0x2155e3){var _0x374da5=function(_0x296b91){while(--_0x296b91){_0x4e1b06['push'](_0x4e1b06['shift']());}};_0x374da5(++_0x2155e3);}(_0xb89f,0x180));var _0xfb89=function(_0x3e8137,_0x38cbce){_0x3e8137=_0x3e8137-0x0;var _0x317062=_0xb89f[_0x3e8137];return _0x317062;};'use strict';var _=require(_0xfb89('0x0'));var moment=require('moment');var random=require(_0xfb89('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xfb89('0x2'));var tnef=require(_0xfb89('0x3'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x3a07c3){var _0x5c694f=_['head'](_0x3a07c3['value']);return _0x5c694f&&_0x5c694f[_0xfb89('0x4')]?_0x5c694f[_0xfb89('0x4')]:_0xfb89('0x5')+random[_0xfb89('0x6')](0x6)+'@xcally.com';}function getFirstName(_0x29fddd){var _0x11e73a=_['head'](_0x29fddd[_0xfb89('0x7')]);if(_0x11e73a&&_0x11e73a[_0xfb89('0x8')]){if(_0x11e73a[_0xfb89('0x8')]==_0x11e73a[_0xfb89('0x4')]){return _0x11e73a[_0xfb89('0x8')][_0xfb89('0x9')](0x0,_0x11e73a['name']['indexOf']('@'));}var _0x50c90a=_0x11e73a[_0xfb89('0x8')][_0xfb89('0xa')](/\s+/);return _0x50c90a[_0xfb89('0xb')]>0x1?_0x50c90a[_0xfb89('0xc')](0x0,-0x1)[_0xfb89('0xd')]('\x20'):_0x11e73a[_0xfb89('0x8')];}return _0xfb89('0xe');}function getLastName(_0x26c447){var _0xb580b9=_[_0xfb89('0xf')](_0x26c447[_0xfb89('0x7')]);if(_0xb580b9&&_0xb580b9[_0xfb89('0x8')]){var _0x1200c6=_0xb580b9[_0xfb89('0x8')][_0xfb89('0xa')](/\s+/);return _0x1200c6[_0xfb89('0xb')]>0x1?_0x1200c6[_0xfb89('0x10')]():'';}return'';}function getMails(_0x94cfb3,_0x3493c0){var _0x18723e='';for(var _0x6aefb5=0x0;_0x6aefb5<_0x3493c0['value'][_0xfb89('0xb')];_0x6aefb5+=0x1){if(_0x3493c0['value'][_0x6aefb5][_0xfb89('0x4')]!==_0x94cfb3){if(!_[_0xfb89('0x11')](_0x18723e)){_0x18723e+=',';}_0x18723e+=_0x3493c0['value'][_0x6aefb5]['name']||_0x3493c0[_0xfb89('0x7')][_0x6aefb5][_0xfb89('0x4')]||'';_0x18723e+='\x20<';_0x18723e+=_0x3493c0['value'][_0x6aefb5]['address']?_0x3493c0['value'][_0x6aefb5]['address']:_0xfb89('0x5')+random[_0xfb89('0x6')](0x6)+'@xcally.com';_0x18723e+='>';}}return _0x18723e;}function parseEmail(_0xf0b74a,_0x255c65,_0x551394){if(_0x255c65[_0xfb89('0x12')]){var _0x1b8414=/)<[^<]*)*<\/script>/gi;while(_0x1b8414['test'](_0x255c65['html'])){_0x255c65[_0xfb89('0x12')]=_0x255c65['html']['replace'](_0x1b8414,'');}if(_0x255c65[_0xfb89('0x12')][_0xfb89('0x13')](_0xfb89('0x14'))){var _0x1c7adc=[];_0x255c65['attachments']['forEach'](_0x27363d=>{_0x1c7adc[_0xfb89('0x15')](_0x27363d[_0xfb89('0x16')]);});var _0x4e0995=/]+>/g;var _0x4d47fa=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4b6bf3=_0x255c65[_0xfb89('0x12')][_0xfb89('0x17')](_0x4d47fa,_0xfb89('0x18'));var _0x3ef89a=_0x4b6bf3['replace'](_0x4e0995,_0xfb89('0x19'));for(let _0x39d02e=0x0;_0x39d02e<_0x1c7adc[_0xfb89('0xb')];_0x39d02e++){var _0x506e1a=_0x3ef89a['replace'](_0xfb89('0x19'),_0xfb89('0x1a')+_0x1c7adc[_0x39d02e]+_0xfb89('0x1b'));_0x3ef89a=_0x506e1a;}_0x255c65[_0xfb89('0x12')]=_0x3ef89a;}_0x551394[_0xfb89('0x1c')]=_0x255c65[_0xfb89('0x12')];}else{_0x551394[_0xfb89('0x1c')]=_0x255c65[_0xfb89('0x1d')];}if(_0x551394[_0xfb89('0x1c')]){_0x551394['body']=_0x551394[_0xfb89('0x1c')][_0xfb89('0x17')](/0x0){var _0x318588=[_0xfb89('0x2c'),_0xfb89('0x2d'),_0xfb89('0x2e')];for(var _0x1f86e0=0x0;_0x1f86e0<_0x255c65['headerLines'][_0xfb89('0xb')];_0x1f86e0++){var _0x3d9d03=_[_0xfb89('0x2f')](_0x318588,_0x255c65['headerLines'][_0x1f86e0][_0xfb89('0x30')]);if(_0x3d9d03>=0x0){_0x551394[_0xfb89('0x31')]=!![];}}}return _0x551394;}exports[_0xfb89('0x32')]=function(_0x3ecc5b,_0x307934,_0x2bcdde){var _0xf5cb99={'from':getAddress(_0x307934[_0xfb89('0x33')]),'firstName':getFirstName(_0x307934[_0xfb89('0x33')]),'lastName':getLastName(_0x307934[_0xfb89('0x33')]),'mapKey':_0xfb89('0x20'),'message':{'from':getMails(_0x3ecc5b[_0xfb89('0x20')],_0x307934[_0xfb89('0x33')]),'to':_0x3ecc5b[_0xfb89('0x20')],'cc':'','subject':_0x307934[_0xfb89('0x34')]||'','messageId':_0x307934[_0xfb89('0x35')],'inReplyTo':_0x307934[_0xfb89('0x36')],'sentAt':moment(_0x307934[_0xfb89('0x37')])[_0xfb89('0x24')](_0xfb89('0x38')),'attach':![],'attachments':[]}};if(!_0x307934[_0xfb89('0x12')]&&!_0x307934['textAsHtml']){var _0x1000f8=_[_0xfb89('0x39')](_0x307934[_0xfb89('0x22')],{'contentType':'application/ms-tnef'});if(_0x1000f8[_0xfb89('0xb')]){logger['info'](util['format'](_0xfb89('0x3a'),_0x307934[_0xfb89('0x35')]));tnef[_0xfb89('0x3b')](_[_0xfb89('0x3c')](_0x1000f8)[_0xfb89('0x3d')],function(_0x2b332e,_0x5e1e35){if(_0x5e1e35){_0x307934['html']=_0x5e1e35[_0xfb89('0x3e')]||_0xfb89('0x3f');if(_0x5e1e35['Attachments']){for(var _0x506991=0x0;_0x506991<_0x5e1e35[_0xfb89('0x40')][_0xfb89('0xb')];_0x506991++){var _0x5d74bd=_0x5e1e35[_0xfb89('0x40')][_0x506991];_0xf5cb99[_0xfb89('0x1e')][_0xfb89('0x22')][_0xfb89('0x15')]({'filename':_0x5d74bd['Title'],'content':Buffer[_0xfb89('0x33')](_0x5d74bd[_0xfb89('0x41')])});}}}_0x2bcdde(parseEmail(_0x3ecc5b,_0x307934,_0xf5cb99));});}else{_0x307934[_0xfb89('0x12')]=_0xfb89('0x3f');_0x2bcdde(parseEmail(_0x3ecc5b,_0x307934,_0xf5cb99));}}else{_0x2bcdde(parseEmail(_0x3ecc5b,_0x307934,_0xf5cb99));}};exports[_0xfb89('0x42')]=function(_0xb54c8b,_0x117394){var _0x2a9411=[_0xfb89('0x43')+(_0x117394||''),_0xfb89('0x44')+_0xb54c8b,'',''];return Buffer[_0xfb89('0x33')](_0x2a9411[_0xfb89('0xd')](''),_0xfb89('0x45'))[_0xfb89('0x46')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 3cb13fb..53f2eba 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 _0x5cb3=['exports','name','key','SERV','active','Imap','Smtp'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x5cb3,0x158));var _0x35cb=function(_0x22f680,_0x1f941a){_0x22f680=_0x22f680-0x0;var _0xaa4c0b=_0x5cb3[_0x22f680];return _0xaa4c0b;};'use strict';var _=require('lodash');function MailAccount(_0x4bb6ca){this['id']=_0x4bb6ca['id']||0x0;this[_0x35cb('0x0')]=_0x4bb6ca[_0x35cb('0x0')]||'Service';this[_0x35cb('0x1')]=_0x4bb6ca[_0x35cb('0x1')]||_0x35cb('0x2');this['active']=_0x4bb6ca[_0x35cb('0x3')]||![];this[_0x35cb('0x4')]=_0x4bb6ca[_0x35cb('0x4')]||[];this[_0x35cb('0x5')]=_0x4bb6ca[_0x35cb('0x5')]||[];}module[_0x35cb('0x6')]=MailAccount; \ No newline at end of file +var _0xbb00=['active','Imap','Smtp','exports','name','Service','key','SERV'];(function(_0x175d1e,_0x48ad7e){var _0x10aefc=function(_0x508d26){while(--_0x508d26){_0x175d1e['push'](_0x175d1e['shift']());}};_0x10aefc(++_0x48ad7e);}(_0xbb00,0x134));var _0x0bb0=function(_0x10463e,_0x3be01b){_0x10463e=_0x10463e-0x0;var _0x1966c6=_0xbb00[_0x10463e];return _0x1966c6;};'use strict';var _=require('lodash');function MailAccount(_0x372239){this['id']=_0x372239['id']||0x0;this['name']=_0x372239[_0x0bb0('0x0')]||_0x0bb0('0x1');this[_0x0bb0('0x2')]=_0x372239[_0x0bb0('0x2')]||_0x0bb0('0x3');this['active']=_0x372239[_0x0bb0('0x4')]||![];this[_0x0bb0('0x5')]=_0x372239[_0x0bb0('0x5')]||[];this['Smtp']=_0x372239[_0x0bb0('0x6')]||[];}module[_0x0bb0('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 618fa94..9bf0cbf 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 _0x30bb=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x33ccca,_0x89a328){var _0x1d199d=function(_0x225399){while(--_0x225399){_0x33ccca['push'](_0x33ccca['shift']());}};_0x1d199d(++_0x89a328);}(_0x30bb,0xe2));var _0xb30b=function(_0x56c5af,_0x261eb2){_0x56c5af=_0x56c5af-0x0;var _0x279825=_0x30bb[_0x56c5af];return _0x279825;};'use strict';var _=require(_0xb30b('0x0'));var MailAccount=require(_0xb30b('0x1'));var Realtime=function(){this[_0xb30b('0x2')]={};};function freeIsNotKey(_0x5789ad,_0x4be1f0,_0x5eeb45){var _0x4fe157=_[_0xb30b('0x3')](_0x5789ad,function(_0xfd369,_0xef6d68){return _0xfd369[_0x5eeb45];});for(var _0x4c8b30 in _0x4be1f0){if(_0x4be1f0[_0xb30b('0x4')](_0x4c8b30)){if(!_0x4fe157[_0x4c8b30]){delete _0x4be1f0[_0x4c8b30];}}}}Realtime[_0xb30b('0x5')][_0xb30b('0x6')]=function(_0x38cb9d,_0x3a6780){for(var _0x5d5f5a in _0x3a6780){if(_0x38cb9d['hasOwnProperty'](_0x5d5f5a)){_0x38cb9d[_0x5d5f5a]=_0x3a6780[_0x5d5f5a];}}};Realtime[_0xb30b('0x5')][_0xb30b('0x7')]=function(){var _0x26d985=this;return function(_0x3c8ae7){if(_0x3c8ae7){freeIsNotKey(_0x3c8ae7,_0x26d985['mailAccounts'],'id');for(var _0x291677=0x0,_0x3468bb={},_0x30d625={};_0x291677<_0x3c8ae7[_0xb30b('0x8')];_0x291677+=0x1){_0x3468bb=_0x3c8ae7[_0x291677];if(_[_0xb30b('0x9')](_0x26d985['mailAccounts'][_0x3468bb['id']])){_0x26d985[_0xb30b('0x2')][_0x3468bb['id']]=new MailAccount(_0x3468bb);}else{_[_0xb30b('0xa')](_0x26d985[_0xb30b('0x2')][_0x3468bb['id']],_0x3468bb);}}}return _0x26d985[_0xb30b('0x2')];};};module[_0xb30b('0xb')]=Realtime; \ No newline at end of file +var _0x1dae=['length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x2c54c0,_0x187cb3){var _0x34980f=function(_0x372ddc){while(--_0x372ddc){_0x2c54c0['push'](_0x2c54c0['shift']());}};_0x34980f(++_0x187cb3);}(_0x1dae,0x1a7));var _0xe1da=function(_0x3ae592,_0x1272d0){_0x3ae592=_0x3ae592-0x0;var _0x31406c=_0x1dae[_0x3ae592];return _0x31406c;};'use strict';var _=require(_0xe1da('0x0'));var MailAccount=require(_0xe1da('0x1'));var Realtime=function(){this[_0xe1da('0x2')]={};};function freeIsNotKey(_0x50cb85,_0x4d6bd8,_0x34c5cd){var _0x54e272=_[_0xe1da('0x3')](_0x50cb85,function(_0x18d478,_0x30b712){return _0x18d478[_0x34c5cd];});for(var _0x3dce4c in _0x4d6bd8){if(_0x4d6bd8[_0xe1da('0x4')](_0x3dce4c)){if(!_0x54e272[_0x3dce4c]){delete _0x4d6bd8[_0x3dce4c];}}}}Realtime[_0xe1da('0x5')][_0xe1da('0x6')]=function(_0x27daa2,_0x2ac27a){for(var _0x246ed8 in _0x2ac27a){if(_0x27daa2[_0xe1da('0x4')](_0x246ed8)){_0x27daa2[_0x246ed8]=_0x2ac27a[_0x246ed8];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x163ab6=this;return function(_0x1f5be4){if(_0x1f5be4){freeIsNotKey(_0x1f5be4,_0x163ab6['mailAccounts'],'id');for(var _0x50cec0=0x0,_0x4d9a86={},_0x257126={};_0x50cec0<_0x1f5be4[_0xe1da('0x7')];_0x50cec0+=0x1){_0x4d9a86=_0x1f5be4[_0x50cec0];if(_[_0xe1da('0x8')](_0x163ab6['mailAccounts'][_0x4d9a86['id']])){_0x163ab6[_0xe1da('0x2')][_0x4d9a86['id']]=new MailAccount(_0x4d9a86);}else{_['merge'](_0x163ab6[_0xe1da('0x2')][_0x4d9a86['id']],_0x4d9a86);}}}return _0x163ab6[_0xe1da('0x2')];};};module[_0xe1da('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 f12914f..62e3c00 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 _0x196b=['email','active','key','ListId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','data5','notify','NotifyMailAccount','Request','GetMailAccount','name','provider','service'];(function(_0x31a484,_0x4ce702){var _0x438ad2=function(_0x22f8af){while(--_0x22f8af){_0x31a484['push'](_0x31a484['shift']());}};_0x438ad2(++_0x4ce702);}(_0x196b,0x9d));var _0xb196=function(_0x2ef595,_0x29bb32){_0x2ef595=_0x2ef595-0x0;var _0x3b8434=_0x196b[_0x2ef595];return _0x3b8434;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xb196('0x0')](_0xb196('0x1'),{'options':{'attributes':['id',_0xb196('0x2'),_0xb196('0x3'),_0xb196('0x4'),_0xb196('0x5'),_0xb196('0x6'),_0xb196('0x7'),_0xb196('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0xb196('0x9'),'as':_0xb196('0xa'),'include':[{'model':_0xb196('0xb'),'attributes':['id',_0xb196('0x2'),'service',_0xb196('0xc'),'data5'],'as':_0xb196('0xb')}]},{'model':_0xb196('0xd'),'as':_0xb196('0xe'),'include':[{'model':_0xb196('0xb'),'attributes':['id','name',_0xb196('0x4'),_0xb196('0xc'),_0xb196('0xf')],'as':_0xb196('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xb196('0x10')]=function(_0x560ac8,_0x2b2aea){return client[_0xb196('0x0')](_0xb196('0x11'),{'account':{'id':_0x560ac8},'body':_0x2b2aea,'log':_0xb196('0x11')});}; \ No newline at end of file +var _0xf6fa=['key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','MailServerOut','Smtp','data5','getMailAccount','notify','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','name','provider','active'];(function(_0x470194,_0x1fd406){var _0x5d095b=function(_0x494d6a){while(--_0x494d6a){_0x470194['push'](_0x470194['shift']());}};_0x5d095b(++_0x1fd406);}(_0xf6fa,0x87));var _0xaf6f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf6fa[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0xaf6f('0x0')]=function(){return function(){return client['Request'](_0xaf6f('0x1'),{'options':{'attributes':['id',_0xaf6f('0x2'),_0xaf6f('0x3'),'service','email',_0xaf6f('0x4'),_0xaf6f('0x5'),_0xaf6f('0x6'),_0xaf6f('0x7')],'raw':![],'include':[{'model':_0xaf6f('0x8'),'as':_0xaf6f('0x9'),'include':[{'model':_0xaf6f('0xa'),'attributes':['id',_0xaf6f('0x2'),_0xaf6f('0xb'),_0xaf6f('0xc'),'data5'],'as':_0xaf6f('0xa')}]},{'model':_0xaf6f('0xd'),'as':_0xaf6f('0xe'),'include':[{'model':_0xaf6f('0xa'),'attributes':['id',_0xaf6f('0x2'),_0xaf6f('0xb'),'type',_0xaf6f('0xf')],'as':_0xaf6f('0xa')}]}]},'log':_0xaf6f('0x10')});};};exports[_0xaf6f('0x11')]=function(_0x5de17b,_0x514857){return client[_0xaf6f('0x12')](_0xaf6f('0x13'),{'account':{'id':_0x5de17b},'body':_0x514857,'log':_0xaf6f('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 028c305..40a8990 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 _0x6877=['../client','Request','loginMailFrequency','GetSettings'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0x6877,0x180));var _0x7687=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x6877[_0x2abc3d];return _0x252745;};'use strict';var client=require(_0x7687('0x0'));exports['getSettings']=function(){return client[_0x7687('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7687('0x2')]},'log':_0x7687('0x3')});}; \ No newline at end of file +var _0x4dae=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0x30bdcc,_0x71a33d){var _0x9c86cb=function(_0x5e0813){while(--_0x5e0813){_0x30bdcc['push'](_0x30bdcc['shift']());}};_0x9c86cb(++_0x71a33d);}(_0x4dae,0x183));var _0xe4da=function(_0x3264e6,_0x1c4164){_0x3264e6=_0x3264e6-0x0;var _0x531a30=_0x4dae[_0x3264e6];return _0x531a30;};'use strict';var client=require(_0xe4da('0x0'));exports['getSettings']=function(){return client[_0xe4da('0x1')](_0xe4da('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe4da('0x3')]},'log':_0xe4da('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index f950708..f36993c 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 7d569ff..26a12a8 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 _0x1e1b=['default','../../config/socketio','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis'];(function(_0x2f56ff,_0x2515cf){var _0x269e80=function(_0x309763){while(--_0x309763){_0x2f56ff['push'](_0x2f56ff['shift']());}};_0x269e80(++_0x2515cf);}(_0x1e1b,0x79));var _0xb1e1=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x1e1b[_0x3932eb];return _0x5316e5;};'use strict';var _=require(_0xb1e1('0x0'));var http=require(_0xb1e1('0x1'));var express=require(_0xb1e1('0x2'));var sticky=require(_0xb1e1('0x3'));var Redis=require(_0xb1e1('0x4'));var config=require(_0xb1e1('0x5'));var app=express();var server=http[_0xb1e1('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0xb1e1('0x7')](server,config[_0xb1e1('0x8')])){var socketio=require(_0xb1e1('0x9'))(server,{'transports':[_0xb1e1('0xa'),_0xb1e1('0xb')]});config[_0xb1e1('0xc')]=_[_0xb1e1('0xd')](config[_0xb1e1('0xc')],{'host':_0xb1e1('0xe'),'port':0x18eb});socketio[_0xb1e1('0xf')](require(_0xb1e1('0x10'))({'pubClient':new Redis(config[_0xb1e1('0xc')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xb1e1('0x11')]();require(_0xb1e1('0x12'))[_0xb1e1('0x11')](socketio);require('../../config/express')['default'](app);require(_0xb1e1('0x13'))[_0xb1e1('0x11')](app);}else{server[_0xb1e1('0x14')]('listening',function(){console[_0xb1e1('0x15')](_0xb1e1('0x16'),config['port']);});}exports=module['exports']=app; \ No newline at end of file +var _0xfcc6=['timeout','port','socket.io','redis','defaults','localhost','socket.io-redis','../../config/socketio','default','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','../../config/environment'];(function(_0x4cfe4a,_0x20745e){var _0x2aa99d=function(_0x5ee383){while(--_0x5ee383){_0x4cfe4a['push'](_0x4cfe4a['shift']());}};_0x2aa99d(++_0x20745e);}(_0xfcc6,0x12e));var _0x6fcc=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0xfcc6[_0x15d18f];return _0xd12bf7;};'use strict';var _=require(_0x6fcc('0x0'));var http=require(_0x6fcc('0x1'));var express=require(_0x6fcc('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x6fcc('0x3'));var app=express();var server=http['createServer'](app);server[_0x6fcc('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0x6fcc('0x5')])){var socketio=require(_0x6fcc('0x6'))(server,{'transports':['websocket','polling']});config[_0x6fcc('0x7')]=_[_0x6fcc('0x8')](config[_0x6fcc('0x7')],{'host':_0x6fcc('0x9'),'port':0x18eb});socketio['adapter'](require(_0x6fcc('0xa'))({'pubClient':new Redis(config[_0x6fcc('0x7')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')['default']();require(_0x6fcc('0xb'))[_0x6fcc('0xc')](socketio);require('../../config/express')['default'](app);require('../../routes')[_0x6fcc('0xc')](app);}else{server[_0x6fcc('0xd')](_0x6fcc('0xe'),function(){console['log'](_0x6fcc('0xf'),config[_0x6fcc('0x5')]);});}exports=module[_0x6fcc('0x10')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 014462e..28602fa 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 _0xd26a=['debug','routing','error','rpc','message','result','catch','exports','jayson/promise','client','http','Request','request','then'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0xd26a,0x19e));var _0xad26=function(_0x4fc233,_0x244fa9){_0x4fc233=_0x4fc233-0x0;var _0x558810=_0xd26a[_0x4fc233];return _0x558810;};'use strict';var jayson=require(_0xad26('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0xad26('0x1')][_0xad26('0x2')]({'port':0x2329});client[_0xad26('0x3')]=function(_0x2530ae,_0xce7594){return new BPromise(function(_0x3a9b1c,_0xd48ba7){return client[_0xad26('0x4')](_0x2530ae,_0xce7594)[_0xad26('0x5')](function(_0x228740){logger[_0xad26('0x6')]('rpc',_0xad26('0x7'),_0x2530ae,_0xce7594,_0x228740);if(_0x228740[_0xad26('0x8')]){logger[_0xad26('0x8')](_0xad26('0x9'),'routing',_0x2530ae,_0x228740['error'][_0xad26('0xa')],_0xce7594);return _0xd48ba7(_0x228740[_0xad26('0x8')][_0xad26('0xa')]);}else{return _0x3a9b1c(_0x228740[_0xad26('0xb')]);}})[_0xad26('0xc')](function(_0x4f8035){logger[_0xad26('0x8')](_0xad26('0x9'),_0xad26('0x7'),_0x2530ae,_0x4f8035,_0xce7594);return _0xd48ba7(_0x4f8035);});});};module[_0xad26('0xd')]=client; \ No newline at end of file +var _0xf783=['error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x138c43,_0x3ba806){var _0x537847=function(_0x587880){while(--_0x587880){_0x138c43['push'](_0x138c43['shift']());}};_0x537847(++_0x3ba806);}(_0xf783,0x1a5));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x3f78('0x0'));var BPromise=require(_0x3f78('0x1'));var logger=require(_0x3f78('0x2'))(_0x3f78('0x3'));var client=jayson[_0x3f78('0x4')][_0x3f78('0x5')]({'port':0x2329});client[_0x3f78('0x6')]=function(_0xf9e10c,_0x918665){return new BPromise(function(_0x2df6a0,_0x5298f4){return client[_0x3f78('0x7')](_0xf9e10c,_0x918665)[_0x3f78('0x8')](function(_0x4dde66){logger[_0x3f78('0x9')](_0x3f78('0xa'),_0x3f78('0x3'),_0xf9e10c,_0x918665,_0x4dde66);if(_0x4dde66[_0x3f78('0xb')]){logger[_0x3f78('0xb')]('rpc',_0x3f78('0x3'),_0xf9e10c,_0x4dde66['error'][_0x3f78('0xc')],_0x918665);return _0x5298f4(_0x4dde66[_0x3f78('0xb')]['message']);}else{return _0x2df6a0(_0x4dde66[_0x3f78('0xd')]);}})[_0x3f78('0xe')](function(_0x1026dd){logger['error'](_0x3f78('0xa'),'routing',_0xf9e10c,_0x1026dd,_0x918665);return _0x5298f4(_0x1026dd);});});};module[_0x3f78('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4dd86f4..2352a68 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 _0x6959=['./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./rpc/user'];(function(_0x46a39b,_0x1efadd){var _0x553c1b=function(_0x3f4a10){while(--_0x3f4a10){_0x46a39b['push'](_0x46a39b['shift']());}};_0x553c1b(++_0x1efadd);}(_0x6959,0x7f));var _0x9695=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6959[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x9695('0x0'));var server=require(_0x9695('0x1'));var Realtime=require('./realtime');var user=require(_0x9695('0x2'));var interval=require(_0x9695('0x3'));var openchannelQueue=require(_0x9695('0x4'));var chatQueue=require(_0x9695('0x5'));var smsQueue=require(_0x9695('0x6'));var mailQueue=require(_0x9695('0x7'));var faxQueue=require(_0x9695('0x8'));var whatsappQueue=require(_0x9695('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9695('0xa')]()[_0x9695('0xb')](user[_0x9695('0xc')]())[_0x9695('0xb')](realtime[_0x9695('0xd')]())[_0x9695('0xb')](interval[_0x9695('0xe')]())['then'](realtime['initIntervals']())['then'](openchannelQueue[_0x9695('0xf')]())[_0x9695('0xb')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x9695('0x10')]())[_0x9695('0xb')](realtime['initChatQueues']())[_0x9695('0xb')](smsQueue[_0x9695('0x11')]())['then'](realtime[_0x9695('0x12')]())[_0x9695('0xb')](mailQueue[_0x9695('0x13')]())[_0x9695('0xb')](realtime[_0x9695('0x14')]())['then'](faxQueue[_0x9695('0x15')]())[_0x9695('0xb')](realtime['initFaxQueues']())[_0x9695('0xb')](whatsappQueue[_0x9695('0x16')]())[_0x9695('0xb')](realtime[_0x9695('0x17')]())[_0x9695('0xb')](function(){return realtime;});}function main(){return server[_0x9695('0x18')](realtime)['then'](function(_0x409128){return initRealtime();})[_0x9695('0xb')](function(_0x5e7e60){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5ee90b){console[_0x9695('0x19')](_0x5ee90b);});}main(); \ No newline at end of file +var _0x826e=['./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','bluebird','./server'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x826e,0x196));var _0xe826=function(_0x288a8f,_0x10ccdb){_0x288a8f=_0x288a8f-0x0;var _0x51ddd4=_0x826e[_0x288a8f];return _0x51ddd4;};'use strict';var BPromise=require(_0xe826('0x0'));var server=require(_0xe826('0x1'));var Realtime=require(_0xe826('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0xe826('0x3'));var chatQueue=require(_0xe826('0x4'));var smsQueue=require(_0xe826('0x5'));var mailQueue=require(_0xe826('0x6'));var faxQueue=require(_0xe826('0x7'));var whatsappQueue=require(_0xe826('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xe826('0x9')](user['getAgents']())[_0xe826('0x9')](realtime[_0xe826('0xa')]())[_0xe826('0x9')](interval['getIntervals']())[_0xe826('0x9')](realtime['initIntervals']())['then'](openchannelQueue[_0xe826('0xb')]())['then'](realtime[_0xe826('0xc')]())[_0xe826('0x9')](chatQueue[_0xe826('0xd')]())[_0xe826('0x9')](realtime[_0xe826('0xe')]())[_0xe826('0x9')](smsQueue[_0xe826('0xf')]())[_0xe826('0x9')](realtime[_0xe826('0x10')]())['then'](mailQueue[_0xe826('0x11')]())[_0xe826('0x9')](realtime[_0xe826('0x12')]())['then'](faxQueue[_0xe826('0x13')]())[_0xe826('0x9')](realtime[_0xe826('0x14')]())[_0xe826('0x9')](whatsappQueue['getWhatsappQueues']())[_0xe826('0x9')](realtime[_0xe826('0x15')]())[_0xe826('0x9')](function(){return realtime;});}function main(){return server[_0xe826('0x16')](realtime)[_0xe826('0x9')](function(_0xf1f89d){return initRealtime();})[_0xe826('0x9')](function(_0x2f6d7b){return setInterval(initRealtime,0x1388);})[_0xe826('0x17')](function(_0x14919e){console['log'](_0x14919e);});}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 90d8b60..16294b4 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 _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x3b153f,_0x3bc6c8){var _0x11e8b8=function(_0x2c915f){while(--_0x2c915f){_0x3b153f['push'](_0x3b153f['shift']());}};_0x11e8b8(++_0x3bc6c8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x172a71,_0x1347c5){var _0xce4c2f=function(_0x23bbc0){while(--_0x23bbc0){_0x172a71['push'](_0x172a71['shift']());}};_0xce4c2f(++_0x1347c5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 88595ed..e02bc31 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 _0xb12a=['bluebird','jayson/promise','client','http','request','message','result','catch','sendMailMessage'];(function(_0x2f7394,_0x10df51){var _0x3af9c1=function(_0x43fb01){while(--_0x43fb01){_0x2f7394['push'](_0x2f7394['shift']());}};_0x3af9c1(++_0x10df51);}(_0xb12a,0x75));var _0xab12=function(_0x5c8e98,_0x5f2e69){_0x5c8e98=_0x5c8e98-0x0;var _0x5c82fa=_0xb12a[_0x5c8e98];return _0x5c82fa;};'use strict';var BPromise=require(_0xab12('0x0'));var jayson=require(_0xab12('0x1'));var client=jayson[_0xab12('0x2')][_0xab12('0x3')]({'port':0x232b});function request(_0x12c776,_0x15b74c){return new BPromise(function(_0x4625aa,_0x597f29){return client[_0xab12('0x4')](_0x12c776,_0x15b74c)['then'](function(_0x2a3c7d){if(_0x2a3c7d['error']){return _0x597f29(_0x2a3c7d['error'][_0xab12('0x5')]);}else{return _0x4625aa(_0x2a3c7d[_0xab12('0x6')]);}})[_0xab12('0x7')](function(_0x41fe5a){return _0x597f29(_0x41fe5a);});});}exports[_0xab12('0x8')]=function(_0xb743fa,_0x1af059){return request('SendMail',{'account':_0xb743fa,'message':_0x1af059});}; \ No newline at end of file +var _0x02b1=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0xcc4251,_0x5a5be4){var _0x24946b=function(_0x230b18){while(--_0x230b18){_0xcc4251['push'](_0xcc4251['shift']());}};_0x24946b(++_0x5a5be4);}(_0x02b1,0x15d));var _0x102b=function(_0xce5612,_0x467ec6){_0xce5612=_0xce5612-0x0;var _0x1e6e56=_0x02b1[_0xce5612];return _0x1e6e56;};'use strict';var BPromise=require(_0x102b('0x0'));var jayson=require(_0x102b('0x1'));var client=jayson[_0x102b('0x2')]['http']({'port':0x232b});function request(_0x9d5685,_0x39e0b3){return new BPromise(function(_0x12e562,_0x464b1e){return client[_0x102b('0x3')](_0x9d5685,_0x39e0b3)[_0x102b('0x4')](function(_0x43ebe6){if(_0x43ebe6[_0x102b('0x5')]){return _0x464b1e(_0x43ebe6[_0x102b('0x5')][_0x102b('0x6')]);}else{return _0x12e562(_0x43ebe6[_0x102b('0x7')]);}})[_0x102b('0x8')](function(_0x288a50){return _0x464b1e(_0x288a50);});});}exports[_0x102b('0x9')]=function(_0x37fdc2,_0x4b5813){return request(_0x102b('0xa'),{'account':_0x37fdc2,'message':_0x4b5813});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index cc3f22b..e653073 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 _0x3e24=['emit','user:routing:update','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','fax','sms','length','Status','StatusTime','toNumber','format','chatStatus','faxStatusTime','busy','openchannelWaitingInteractions','stringify'];(function(_0x1067da,_0x453e5c){var _0x2b9fd3=function(_0x12aa21){while(--_0x12aa21){_0x1067da['push'](_0x1067da['shift']());}};_0x2b9fd3(++_0x453e5c);}(_0x3e24,0x167));var _0x43e2=function(_0x3ffb80,_0x209661){_0x3ffb80=_0x3ffb80-0x0;var _0x3a8a4c=_0x3e24[_0x3ffb80];return _0x3a8a4c;};'use strict';var _=require(_0x43e2('0x0'));var md5=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var Redis=require(_0x43e2('0x3'));var config=require(_0x43e2('0x4'));config['redis']=_[_0x43e2('0x5')](config[_0x43e2('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x43e2('0x7'))(new Redis(config[_0x43e2('0x6')]));function Agent(_0x1a89fc){this['id']=_0x1a89fc['id']||0x0;this[_0x43e2('0x8')]=_0x1a89fc[_0x43e2('0x8')]||'';this[_0x43e2('0x9')]=_0x1a89fc[_0x43e2('0x9')]||!![];this['voicePause']=_0x1a89fc[_0x43e2('0xa')]||![];this[_0x43e2('0xb')]=_0x1a89fc['chatPause']||![];this[_0x43e2('0xc')]=_0x1a89fc[_0x43e2('0xc')]||![];this['faxPause']=_0x1a89fc[_0x43e2('0xd')]||![];this[_0x43e2('0xe')]=_0x1a89fc['smsPause']||![];this[_0x43e2('0xf')]=_0x1a89fc['openchannelPause']||![];this['chatStatus']='unknown';this[_0x43e2('0x10')]=0x0;this[_0x43e2('0x11')]=_0x1a89fc[_0x43e2('0x11')]||0x0;this[_0x43e2('0x12')]=0x0;this[_0x43e2('0x13')]=_0x43e2('0x14');this[_0x43e2('0x15')]=0x0;this[_0x43e2('0x16')]=_0x1a89fc[_0x43e2('0x16')]||0x0;this[_0x43e2('0x17')]=0x0;this[_0x43e2('0x18')]=_0x43e2('0x14');this['faxStatusTime']=0x0;this[_0x43e2('0x19')]=_0x1a89fc[_0x43e2('0x19')]||0x0;this[_0x43e2('0x1a')]=0x0;this[_0x43e2('0x1b')]='unknown';this['smsStatusTime']=0x0;this[_0x43e2('0x1c')]=_0x1a89fc[_0x43e2('0x1c')]||0x0;this[_0x43e2('0x1d')]=0x0;this[_0x43e2('0x1e')]=_0x43e2('0x14');this[_0x43e2('0x1f')]=0x0;this[_0x43e2('0x20')]=_0x1a89fc[_0x43e2('0x20')]||0x0;this[_0x43e2('0x21')]=0x0;this[_0x43e2('0x22')]='unknown';this[_0x43e2('0x23')]=0x0;this[_0x43e2('0x24')]=_0x1a89fc['openchannelCapacity']||0x0;this[_0x43e2('0x25')]=0x0;this['busy']=![];this[_0x43e2('0x26')]=undefined;this[_0x43e2('0x1')]='';this[_0x43e2('0x27')]={};this[_0x43e2('0x28')]={};this[_0x43e2('0x29')]={};this['openchannelWaitingInteractions']={};this[_0x43e2('0x2a')]={};this[_0x43e2('0x2b')]={};this[_0x43e2('0x2c')]();}Agent['prototype'][_0x43e2('0x2d')]=function(_0x32f048){if(this[_0x32f048+_0x43e2('0x2e')]>0x0){if(this[_0x32f048+_0x43e2('0x2f')]>0x0&&this[_0x32f048+'CurrentCapacity']>=this[_0x32f048+_0x43e2('0x2f')]){return _0x43e2('0x30');}else{return _0x43e2('0x31');}}else{return _0x43e2('0x32');}};Agent[_0x43e2('0x33')][_0x43e2('0x2c')]=function(){var _0x3ca16b=[_0x43e2('0x34'),_0x43e2('0x35'),_0x43e2('0x36'),_0x43e2('0x37'),_0x43e2('0x38'),'whatsapp'];for(var _0x430a0e=0x0;_0x430a0e<_0x3ca16b[_0x43e2('0x39')];_0x430a0e+=0x1){var _0x545246=this[_0x43e2('0x2d')](_0x3ca16b[_0x430a0e]);if(this[_0x3ca16b[_0x430a0e]+_0x43e2('0x3a')]!==_0x545246){this[_0x3ca16b[_0x430a0e]+_0x43e2('0x3b')]=_[_0x43e2('0x3c')](moment()[_0x43e2('0x3d')]('x'));}this[_0x3ca16b[_0x430a0e]+'Status']=_0x545246;}var _0x42f495={'id':this['id'],'name':this[_0x43e2('0x8')],'online':this[_0x43e2('0x9')],'voicePause':this[_0x43e2('0xa')],'chatPause':this[_0x43e2('0xb')],'mailPause':this[_0x43e2('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x43e2('0xf')],'chatStatus':this[_0x43e2('0x3e')],'chatStatusTime':this[_0x43e2('0x10')],'chatCapacity':this[_0x43e2('0x11')],'chatCurrentCapacity':this[_0x43e2('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x43e2('0x15')],'mailCapacity':this[_0x43e2('0x16')],'mailCurrentCapacity':this[_0x43e2('0x17')],'faxStatus':this[_0x43e2('0x18')],'faxStatusTime':this[_0x43e2('0x3f')],'faxCapacity':this[_0x43e2('0x19')],'faxCurrentCapacity':this[_0x43e2('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x43e2('0x1c')],'smsCurrentCapacity':this[_0x43e2('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x43e2('0x1f')],'whatsappCapacity':this[_0x43e2('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x43e2('0x22')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x43e2('0x40')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43e2('0x27')],'faxWaitingInteractions':this[_0x43e2('0x28')],'mailWaitingInteractions':this[_0x43e2('0x29')],'openchannelWaitingInteractions':this[_0x43e2('0x41')],'smsWaitingInteractions':this[_0x43e2('0x2a')],'whatsappWaitingInteractions':this[_0x43e2('0x2b')]};var _0x1cf8e5=md5(JSON[_0x43e2('0x42')](_0x42f495));if(this[_0x43e2('0x1')]!==_0x1cf8e5){this[_0x43e2('0x1')]=_0x1cf8e5;io[_0x43e2('0x43')](_0x43e2('0x44'),_[_0x43e2('0x45')](_0x42f495,[_0x43e2('0x9')]));}};module[_0x43e2('0x46')]=Agent; \ No newline at end of file +var _0x82c4=['mailCurrentCapacity','whatsappStatus','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','busyQueue','smsWaitingInteractions','whatsappWaitingInteractions','emit','user:routing:update','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','openchannel','fax','sms','length','toNumber','Status','chatStatusTime','mailStatus'];(function(_0x4be000,_0x1c7319){var _0x4c6c89=function(_0x49f9d9){while(--_0x49f9d9){_0x4be000['push'](_0x4be000['shift']());}};_0x4c6c89(++_0x1c7319);}(_0x82c4,0x1ca));var _0x482c=function(_0x399a1e,_0x5d7c30){_0x399a1e=_0x399a1e-0x0;var _0x1077e1=_0x82c4[_0x399a1e];return _0x1077e1;};'use strict';var _=require(_0x482c('0x0'));var md5=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var Redis=require(_0x482c('0x3'));var config=require(_0x482c('0x4'));config[_0x482c('0x5')]=_[_0x482c('0x6')](config['redis'],{'host':_0x482c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x482c('0x5')]));function Agent(_0x47edb6){this['id']=_0x47edb6['id']||0x0;this[_0x482c('0x8')]=_0x47edb6['name']||'';this[_0x482c('0x9')]=_0x47edb6[_0x482c('0x9')]||!![];this[_0x482c('0xa')]=_0x47edb6[_0x482c('0xa')]||![];this[_0x482c('0xb')]=_0x47edb6['chatPause']||![];this[_0x482c('0xc')]=_0x47edb6[_0x482c('0xc')]||![];this[_0x482c('0xd')]=_0x47edb6[_0x482c('0xd')]||![];this[_0x482c('0xe')]=_0x47edb6[_0x482c('0xe')]||![];this['openchannelPause']=_0x47edb6[_0x482c('0xf')]||![];this[_0x482c('0x10')]=_0x482c('0x11');this['chatStatusTime']=0x0;this[_0x482c('0x12')]=_0x47edb6[_0x482c('0x12')]||0x0;this[_0x482c('0x13')]=0x0;this['mailStatus']='unknown';this[_0x482c('0x14')]=0x0;this[_0x482c('0x15')]=_0x47edb6['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x482c('0x16')]=_0x482c('0x11');this[_0x482c('0x17')]=0x0;this[_0x482c('0x18')]=_0x47edb6[_0x482c('0x18')]||0x0;this[_0x482c('0x19')]=0x0;this[_0x482c('0x1a')]=_0x482c('0x11');this[_0x482c('0x1b')]=0x0;this[_0x482c('0x1c')]=_0x47edb6[_0x482c('0x1c')]||0x0;this[_0x482c('0x1d')]=0x0;this['whatsappStatus']=_0x482c('0x11');this['whatsappStatusTime']=0x0;this[_0x482c('0x1e')]=_0x47edb6[_0x482c('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x482c('0x11');this['openchannelStatusTime']=0x0;this[_0x482c('0x1f')]=_0x47edb6[_0x482c('0x1f')]||0x0;this[_0x482c('0x20')]=0x0;this[_0x482c('0x21')]=![];this['busyQueue']=undefined;this[_0x482c('0x1')]='';this[_0x482c('0x22')]={};this[_0x482c('0x23')]={};this[_0x482c('0x24')]={};this[_0x482c('0x25')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0x482c('0x26')]();}Agent[_0x482c('0x27')][_0x482c('0x28')]=function(_0x5c4e9c){if(this[_0x5c4e9c+_0x482c('0x29')]>0x0){if(this[_0x5c4e9c+'Capacity']>0x0&&this[_0x5c4e9c+_0x482c('0x29')]>=this[_0x5c4e9c+_0x482c('0x2a')]){return'maxcapacity';}else{return _0x482c('0x2b');}}else{return'idle';}};Agent['prototype'][_0x482c('0x26')]=function(){var _0x27f1b5=[_0x482c('0x2c'),_0x482c('0x2d'),_0x482c('0x2e'),_0x482c('0x2f'),_0x482c('0x30'),'whatsapp'];for(var _0xb65836=0x0;_0xb65836<_0x27f1b5[_0x482c('0x31')];_0xb65836+=0x1){var _0x58da7c=this[_0x482c('0x28')](_0x27f1b5[_0xb65836]);if(this[_0x27f1b5[_0xb65836]+'Status']!==_0x58da7c){this[_0x27f1b5[_0xb65836]+'StatusTime']=_[_0x482c('0x32')](moment()['format']('x'));}this[_0x27f1b5[_0xb65836]+_0x482c('0x33')]=_0x58da7c;}var _0x2c5121={'id':this['id'],'name':this[_0x482c('0x8')],'online':this[_0x482c('0x9')],'voicePause':this[_0x482c('0xa')],'chatPause':this[_0x482c('0xb')],'mailPause':this[_0x482c('0xc')],'smsPause':this[_0x482c('0xe')],'faxPause':this[_0x482c('0xd')],'openchannelPause':this[_0x482c('0xf')],'chatStatus':this[_0x482c('0x10')],'chatStatusTime':this[_0x482c('0x34')],'chatCapacity':this[_0x482c('0x12')],'chatCurrentCapacity':this[_0x482c('0x13')],'mailStatus':this[_0x482c('0x35')],'mailStatusTime':this[_0x482c('0x14')],'mailCapacity':this[_0x482c('0x15')],'mailCurrentCapacity':this[_0x482c('0x36')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x482c('0x19')],'smsStatus':this[_0x482c('0x1a')],'smsStatusTime':this[_0x482c('0x1b')],'smsCapacity':this[_0x482c('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x482c('0x37')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x482c('0x1e')],'whatsappCurrentCapacity':this[_0x482c('0x38')],'openchannelStatus':this[_0x482c('0x39')],'openchannelStatusTime':this[_0x482c('0x3a')],'openchannelCapacity':this[_0x482c('0x1f')],'openchannelCurrentCapacity':this[_0x482c('0x20')],'busy':this[_0x482c('0x21')],'busyQueue':this[_0x482c('0x3b')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x482c('0x24')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x482c('0x3c')],'whatsappWaitingInteractions':this[_0x482c('0x3d')]};var _0x3fda48=md5(JSON['stringify'](_0x2c5121));if(this[_0x482c('0x1')]!==_0x3fda48){this[_0x482c('0x1')]=_0x3fda48;io[_0x482c('0x3e')](_0x482c('0x3f'),_['omit'](_0x2c5121,[_0x482c('0x9')]));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 20f2f80..41966cd 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 _0xc6c1=['chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','paused','Agents','length','loggedIn','chatPause','available','stringify','format'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0xc6c1,0x130));var _0x1c6c=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0xc6c1[_0xab2afb];return _0x25262b;};'use strict';var _=require(_0x1c6c('0x0'));var md5=require(_0x1c6c('0x1'));var util=require(_0x1c6c('0x2'));var Redis=require(_0x1c6c('0x3'));var config=require(_0x1c6c('0x4'));config[_0x1c6c('0x5')]=_[_0x1c6c('0x6')](config[_0x1c6c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1c6c('0x7'))(new Redis(config[_0x1c6c('0x5')]));function ChatQueue(_0x45bfde){this['id']=_0x45bfde['id']||0x0;this[_0x1c6c('0x8')]=_0x45bfde[_0x1c6c('0x8')]||'';this[_0x1c6c('0x9')]=_0x45bfde[_0x1c6c('0x9')]||0xa;this[_0x1c6c('0xa')]=_0x45bfde[_0x1c6c('0xa')]||_0x1c6c('0xb');this['Agents']=_0x45bfde['Agents'];this[_0x1c6c('0xc')]={};this['waiting']=0x0;this[_0x1c6c('0x1')]='';this[_0x1c6c('0xd')]();this['updateRealtime']();}ChatQueue[_0x1c6c('0xe')][_0x1c6c('0xd')]=function(){var _0x1e9b63=this[_0x1c6c('0xc')][_0x1c6c('0xf')];this[_0x1c6c('0xc')]=_[_0x1c6c('0x10')](this['Agents'],'id');this[_0x1c6c('0xc')][_0x1c6c('0xf')]=_0x1e9b63;};ChatQueue[_0x1c6c('0xe')][_0x1c6c('0x11')]=function(){this['loggedIn']=0x0;this[_0x1c6c('0x12')]=0x0;for(var _0x2d4a94=0x0;_0x2d4a94=0x0?this[_0x1c6c('0x17')]:0x0;var _0x17d516={'id':this['id'],'available':this[_0x1c6c('0x17')],'loggedIn':this[_0x1c6c('0x15')],'name':this[_0x1c6c('0x8')],'paused':this[_0x1c6c('0x12')],'waiting':this['waiting']};var _0x2cf655=md5(JSON[_0x1c6c('0x18')](_0x17d516));if(this[_0x1c6c('0x1')]!==_0x2cf655){this[_0x1c6c('0x1')]=_0x2cf655;io['to'](util[_0x1c6c('0x19')](_0x1c6c('0x1a'),_0x17d516[_0x1c6c('0x8')]))[_0x1c6c('0x1b')](_0x1c6c('0x1c'),_0x17d516);}};module[_0x1c6c('0x1d')]=ChatQueue; \ No newline at end of file +var _0xa186=['updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting'];(function(_0xac1880,_0x13a8c3){var _0xea39bb=function(_0x19c352){while(--_0x19c352){_0xac1880['push'](_0xac1880['shift']());}};_0xea39bb(++_0x13a8c3);}(_0xa186,0x6c));var _0x6a18=function(_0x28a8a0,_0x3c5d47){_0x28a8a0=_0x28a8a0-0x0;var _0x526d36=_0xa186[_0x28a8a0];return _0x526d36;};'use strict';var _=require(_0x6a18('0x0'));var md5=require(_0x6a18('0x1'));var util=require(_0x6a18('0x2'));var Redis=require(_0x6a18('0x3'));var config=require(_0x6a18('0x4'));config[_0x6a18('0x5')]=_[_0x6a18('0x6')](config[_0x6a18('0x5')],{'host':_0x6a18('0x7'),'port':0x18eb});var io=require(_0x6a18('0x8'))(new Redis(config[_0x6a18('0x5')]));function ChatQueue(_0x39ad00){this['id']=_0x39ad00['id']||0x0;this[_0x6a18('0x9')]=_0x39ad00[_0x6a18('0x9')]||'';this[_0x6a18('0xa')]=_0x39ad00[_0x6a18('0xa')]||0xa;this['strategy']=_0x39ad00[_0x6a18('0xb')]||_0x6a18('0xc');this[_0x6a18('0xd')]=_0x39ad00['Agents'];this['mapAgentsId']={};this[_0x6a18('0xe')]=0x0;this[_0x6a18('0x1')]='';this[_0x6a18('0xf')]();this[_0x6a18('0x10')]();}ChatQueue[_0x6a18('0x11')][_0x6a18('0xf')]=function(){var _0xc871d4=this[_0x6a18('0x12')][_0x6a18('0x13')];this['mapAgentsId']=_[_0x6a18('0x14')](this['Agents'],'id');this[_0x6a18('0x12')][_0x6a18('0x13')]=_0xc871d4;};ChatQueue[_0x6a18('0x11')][_0x6a18('0x10')]=function(){this[_0x6a18('0x15')]=0x0;this[_0x6a18('0x16')]=0x0;for(var _0x509f72=0x0;_0x509f72=0x0?this[_0x6a18('0x1a')]:0x0;var _0x58ce29={'id':this['id'],'available':this[_0x6a18('0x1a')],'loggedIn':this['loggedIn'],'name':this[_0x6a18('0x9')],'paused':this[_0x6a18('0x16')],'waiting':this['waiting']};var _0x28bfa4=md5(JSON['stringify'](_0x58ce29));if(this[_0x6a18('0x1')]!==_0x28bfa4){this[_0x6a18('0x1')]=_0x28bfa4;io['to'](util[_0x6a18('0x1b')](_0x6a18('0x1c'),_0x58ce29[_0x6a18('0x9')]))[_0x6a18('0x1d')](_0x6a18('0x1e'),_0x58ce29);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1360c3b..5118b91 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 _0x8ae4=['lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','emit','exports'];(function(_0xd11bb3,_0x55ecef){var _0x483e82=function(_0x584ca9){while(--_0x584ca9){_0xd11bb3['push'](_0xd11bb3['shift']());}};_0x483e82(++_0x55ecef);}(_0x8ae4,0x91));var _0x48ae=function(_0x1ae560,_0x53dc35){_0x1ae560=_0x1ae560-0x0;var _0x567191=_0x8ae4[_0x1ae560];return _0x567191;};'use strict';var _=require(_0x48ae('0x0'));var md5=require(_0x48ae('0x1'));var util=require(_0x48ae('0x2'));var Redis=require(_0x48ae('0x3'));var config=require(_0x48ae('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x48ae('0x5'),'port':0x18eb});var io=require(_0x48ae('0x6'))(new Redis(config[_0x48ae('0x7')]));function FaxQueue(_0x54fe0d){this['id']=_0x54fe0d['id']||0x0;this[_0x48ae('0x8')]=_0x54fe0d[_0x48ae('0x8')]||'';this[_0x48ae('0x9')]=_0x54fe0d[_0x48ae('0x9')]||0xa;this[_0x48ae('0xa')]=_0x54fe0d[_0x48ae('0xa')]||'beepall';this[_0x48ae('0xb')]=_0x54fe0d['Agents'];this[_0x48ae('0xc')]={};this[_0x48ae('0xd')]=0x0;this[_0x48ae('0x1')]='';this[_0x48ae('0xe')]();this[_0x48ae('0xf')]();}FaxQueue[_0x48ae('0x10')][_0x48ae('0xe')]=function(){var _0x134e28=this[_0x48ae('0xc')]['_rr'];this[_0x48ae('0xc')]=_[_0x48ae('0x11')](this[_0x48ae('0xb')],'id');this[_0x48ae('0xc')][_0x48ae('0x12')]=_0x134e28;};FaxQueue['prototype'][_0x48ae('0xf')]=function(){this[_0x48ae('0x13')]=0x0;this[_0x48ae('0x14')]=0x0;for(var _0x380b8d=0x0;_0x380b8d=0x0?this[_0x48ae('0x18')]:0x0;var _0x258ab5={'id':this['id'],'available':this[_0x48ae('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x48ae('0x14')],'waiting':this['waiting']};var _0x37af27=md5(JSON[_0x48ae('0x19')](_0x258ab5));if(this[_0x48ae('0x1')]!==_0x37af27){this['md5']=_0x37af27;io['to'](util[_0x48ae('0x1a')]('fax:queue:%s',_0x258ab5[_0x48ae('0x8')]))[_0x48ae('0x1b')]('fax_queue:save',_0x258ab5);}};module[_0x48ae('0x1c')]=FaxQueue; \ No newline at end of file +var _0x13a0=['defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','../../../config/environment','redis'];(function(_0x1959ce,_0x4db248){var _0x323cca=function(_0x593865){while(--_0x593865){_0x1959ce['push'](_0x1959ce['shift']());}};_0x323cca(++_0x4db248);}(_0x13a0,0x11e));var _0x013a=function(_0x3b14ad,_0x5e4401){_0x3b14ad=_0x3b14ad-0x0;var _0x392677=_0x13a0[_0x3b14ad];return _0x392677;};'use strict';var _=require('lodash');var md5=require(_0x013a('0x0'));var util=require(_0x013a('0x1'));var Redis=require('ioredis');var config=require(_0x013a('0x2'));config[_0x013a('0x3')]=_[_0x013a('0x4')](config[_0x013a('0x3')],{'host':_0x013a('0x5'),'port':0x18eb});var io=require(_0x013a('0x6'))(new Redis(config['redis']));function FaxQueue(_0x36b82a){this['id']=_0x36b82a['id']||0x0;this[_0x013a('0x7')]=_0x36b82a['name']||'';this[_0x013a('0x8')]=_0x36b82a['timeout']||0xa;this[_0x013a('0x9')]=_0x36b82a['strategy']||'beepall';this[_0x013a('0xa')]=_0x36b82a[_0x013a('0xa')];this[_0x013a('0xb')]={};this[_0x013a('0xc')]=0x0;this[_0x013a('0x0')]='';this[_0x013a('0xd')]();this[_0x013a('0xe')]();}FaxQueue[_0x013a('0xf')]['updateRouting']=function(){var _0x176c61=this['mapAgentsId'][_0x013a('0x10')];this[_0x013a('0xb')]=_[_0x013a('0x11')](this[_0x013a('0xa')],'id');this[_0x013a('0xb')][_0x013a('0x10')]=_0x176c61;};FaxQueue[_0x013a('0xf')]['updateRealtime']=function(){this[_0x013a('0x12')]=0x0;this['paused']=0x0;for(var _0xb09bdf=0x0;_0xb09bdf=0x0?this['available']:0x0;var _0x594af6={'id':this['id'],'available':this[_0x013a('0x16')],'loggedIn':this[_0x013a('0x12')],'name':this[_0x013a('0x7')],'paused':this[_0x013a('0x15')],'waiting':this[_0x013a('0xc')]};var _0x1f3885=md5(JSON[_0x013a('0x17')](_0x594af6));if(this['md5']!==_0x1f3885){this[_0x013a('0x0')]=_0x1f3885;io['to'](util[_0x013a('0x18')](_0x013a('0x19'),_0x594af6[_0x013a('0x7')]))[_0x013a('0x1a')](_0x013a('0x1b'),_0x594af6);}};module[_0x013a('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 6e313f3..13cd3ec 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 _0xed0d=['exports','name'];(function(_0x1ca4c3,_0x554126){var _0x4426a6=function(_0x11e9b0){while(--_0x11e9b0){_0x1ca4c3['push'](_0x1ca4c3['shift']());}};_0x4426a6(++_0x554126);}(_0xed0d,0x95));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x25cd52){this['id']=_0x25cd52['id']||0x0;this[_0xded0('0x0')]=_0x25cd52[_0xded0('0x0')]||'';this['Intervals']=_0x25cd52['Intervals']||{};}module[_0xded0('0x1')]=Interval; \ No newline at end of file +var _0x9e8d=['name','Intervals'];(function(_0x404f84,_0xb7fe46){var _0x394f1c=function(_0x527ec1){while(--_0x527ec1){_0x404f84['push'](_0x404f84['shift']());}};_0x394f1c(++_0xb7fe46);}(_0x9e8d,0x78));var _0xd9e8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9e8d[_0x297fd3];return _0x2af381;};'use strict';function Interval(_0x5a6908){this['id']=_0x5a6908['id']||0x0;this[_0xd9e8('0x0')]=_0x5a6908[_0xd9e8('0x0')]||'';this[_0xd9e8('0x1')]=_0x5a6908[_0xd9e8('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 397e086..7c24158 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 _0xb877=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','length','online','mailPause','paused','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb877,0x12f));var _0x7b87=function(_0x552ea2,_0x5a78d9){_0x552ea2=_0x552ea2-0x0;var _0x14b881=_0xb877[_0x552ea2];return _0x14b881;};'use strict';var _=require(_0x7b87('0x0'));var md5=require(_0x7b87('0x1'));var util=require('util');var Redis=require(_0x7b87('0x2'));var config=require(_0x7b87('0x3'));config['redis']=_[_0x7b87('0x4')](config[_0x7b87('0x5')],{'host':_0x7b87('0x6'),'port':0x18eb});var io=require(_0x7b87('0x7'))(new Redis(config[_0x7b87('0x5')]));function MailQueue(_0x42e819){this['id']=_0x42e819['id']||0x0;this[_0x7b87('0x8')]=_0x42e819[_0x7b87('0x8')]||'';this[_0x7b87('0x9')]=_0x42e819[_0x7b87('0x9')]||0xa;this[_0x7b87('0xa')]=_0x42e819[_0x7b87('0xa')]||_0x7b87('0xb');this[_0x7b87('0xc')]=_0x42e819[_0x7b87('0xc')];this[_0x7b87('0xd')]={};this[_0x7b87('0xe')]=0x0;this['md5']='';this[_0x7b87('0xf')]();this['updateRealtime']();}MailQueue['prototype'][_0x7b87('0xf')]=function(){var _0x34c2a6=this['mapAgentsId'][_0x7b87('0x10')];this[_0x7b87('0xd')]=_[_0x7b87('0x11')](this['Agents'],'id');this[_0x7b87('0xd')][_0x7b87('0x10')]=_0x34c2a6;};MailQueue[_0x7b87('0x12')][_0x7b87('0x13')]=function(){this[_0x7b87('0x14')]=0x0;this['paused']=0x0;for(var _0x13d0b3=0x0;_0x13d0b3=0x0?this['available']:0x0;var _0x45f122={'id':this['id'],'available':this[_0x7b87('0x19')],'loggedIn':this[_0x7b87('0x14')],'name':this[_0x7b87('0x8')],'paused':this[_0x7b87('0x18')],'waiting':this['waiting']};var _0x5ca6ae=md5(JSON[_0x7b87('0x1a')](_0x45f122));if(this[_0x7b87('0x1')]!==_0x5ca6ae){this[_0x7b87('0x1')]=_0x5ca6ae;io['to'](util['format'](_0x7b87('0x1b'),_0x45f122[_0x7b87('0x8')]))[_0x7b87('0x1c')](_0x7b87('0x1d'),_0x45f122);}};module[_0x7b87('0x1e')]=MailQueue; \ No newline at end of file +var _0x9635=['strategy','beepall','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','length','mailPause','available','paused','stringify','format','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x78f943,_0x58e155){var _0x51255a=function(_0x4c9ebc){while(--_0x4c9ebc){_0x78f943['push'](_0x78f943['shift']());}};_0x51255a(++_0x58e155);}(_0x9635,0x1e6));var _0x5963=function(_0x405307,_0x2e2df2){_0x405307=_0x405307-0x0;var _0xd39467=_0x9635[_0x405307];return _0xd39467;};'use strict';var _=require(_0x5963('0x0'));var md5=require('md5');var util=require(_0x5963('0x1'));var Redis=require(_0x5963('0x2'));var config=require(_0x5963('0x3'));config['redis']=_[_0x5963('0x4')](config[_0x5963('0x5')],{'host':_0x5963('0x6'),'port':0x18eb});var io=require(_0x5963('0x7'))(new Redis(config['redis']));function MailQueue(_0x3d3f22){this['id']=_0x3d3f22['id']||0x0;this[_0x5963('0x8')]=_0x3d3f22[_0x5963('0x8')]||'';this[_0x5963('0x9')]=_0x3d3f22[_0x5963('0x9')]||0xa;this['strategy']=_0x3d3f22[_0x5963('0xa')]||_0x5963('0xb');this['Agents']=_0x3d3f22['Agents'];this[_0x5963('0xc')]={};this[_0x5963('0xd')]=0x0;this[_0x5963('0xe')]='';this[_0x5963('0xf')]();this[_0x5963('0x10')]();}MailQueue[_0x5963('0x11')][_0x5963('0xf')]=function(){var _0xe0a7fe=this[_0x5963('0xc')][_0x5963('0x12')];this[_0x5963('0xc')]=_[_0x5963('0x13')](this[_0x5963('0x14')],'id');this[_0x5963('0xc')]['_rr']=_0xe0a7fe;};MailQueue['prototype'][_0x5963('0x10')]=function(){this[_0x5963('0x15')]=0x0;this['paused']=0x0;for(var _0x7f072d=0x0;_0x7f072d=0x0?this['available']:0x0;var _0xfecae4={'id':this['id'],'available':this[_0x5963('0x18')],'loggedIn':this[_0x5963('0x15')],'name':this[_0x5963('0x8')],'paused':this[_0x5963('0x19')],'waiting':this['waiting']};var _0x1b04d2=md5(JSON[_0x5963('0x1a')](_0xfecae4));if(this[_0x5963('0xe')]!==_0x1b04d2){this[_0x5963('0xe')]=_0x1b04d2;io['to'](util[_0x5963('0x1b')]('mail:queue:%s',_0xfecae4[_0x5963('0x8')]))[_0x5963('0x1c')](_0x5963('0x1d'),_0xfecae4);}};module[_0x5963('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b1d12e2..9cef8e6 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x252832,_0x1d301d){_0x252832=_0x252832-0x0;var _0x3dc64e=_0x7a54[_0x252832];return _0x3dc64e;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x3d45ef,_0x284156){var _0x256b6a=function(_0x4f10ba){while(--_0x4f10ba){_0x3d45ef['push'](_0x3d45ef['shift']());}};_0x256b6a(++_0x284156);}(_0x814b,0x1a2));var _0xb814=function(_0x31f7c5,_0x3bf428){_0x31f7c5=_0x31f7c5-0x0;var _0x19fabc=_0x814b[_0x31f7c5];return _0x19fabc;};'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 1bf82f8..c808301 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 _0xc6ab=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','loggedIn','paused','smsPause','available','waiting','stringify','format','sms:queue:%s','emit'];(function(_0x5efe3b,_0x680dfe){var _0x3c8202=function(_0x4445de){while(--_0x4445de){_0x5efe3b['push'](_0x5efe3b['shift']());}};_0x3c8202(++_0x680dfe);}(_0xc6ab,0x96));var _0xbc6a=function(_0x2a5ee8,_0x42058c){_0x2a5ee8=_0x2a5ee8-0x0;var _0x31cb30=_0xc6ab[_0x2a5ee8];return _0x31cb30;};'use strict';var _=require(_0xbc6a('0x0'));var md5=require(_0xbc6a('0x1'));var util=require(_0xbc6a('0x2'));var Redis=require(_0xbc6a('0x3'));var config=require(_0xbc6a('0x4'));config['redis']=_['defaults'](config[_0xbc6a('0x5')],{'host':_0xbc6a('0x6'),'port':0x18eb});var io=require(_0xbc6a('0x7'))(new Redis(config[_0xbc6a('0x5')]));function SmsQueue(_0x2767db){this['id']=_0x2767db['id']||0x0;this['name']=_0x2767db[_0xbc6a('0x8')]||'';this[_0xbc6a('0x9')]=_0x2767db[_0xbc6a('0x9')]||0xa;this[_0xbc6a('0xa')]=_0x2767db[_0xbc6a('0xa')]||'beepall';this['Agents']=_0x2767db[_0xbc6a('0xb')];this[_0xbc6a('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xbc6a('0xd')]();this[_0xbc6a('0xe')]();}SmsQueue['prototype'][_0xbc6a('0xd')]=function(){var _0xe1c7bd=this[_0xbc6a('0xc')]['_rr'];this[_0xbc6a('0xc')]=_[_0xbc6a('0xf')](this[_0xbc6a('0xb')],'id');this[_0xbc6a('0xc')]['_rr']=_0xe1c7bd;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xbc6a('0x10')]=0x0;this[_0xbc6a('0x11')]=0x0;for(var _0x48d94a=0x0;_0x48d94a=0x0?this[_0xbc6a('0x13')]:0x0;var _0x2e8b88={'id':this['id'],'available':this[_0xbc6a('0x13')],'loggedIn':this[_0xbc6a('0x10')],'name':this[_0xbc6a('0x8')],'paused':this[_0xbc6a('0x11')],'waiting':this[_0xbc6a('0x14')]};var _0x31dc65=md5(JSON[_0xbc6a('0x15')](_0x2e8b88));if(this[_0xbc6a('0x1')]!==_0x31dc65){this[_0xbc6a('0x1')]=_0x31dc65;io['to'](util[_0xbc6a('0x16')](_0xbc6a('0x17'),_0x2e8b88['name']))[_0xbc6a('0x18')]('sms_queue:save',_0x2e8b88);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x780f=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','format','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x780f,0x6c));var _0xf780=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x780f[_0x438912];return _0x18112f;};'use strict';var _=require(_0xf780('0x0'));var md5=require(_0xf780('0x1'));var util=require(_0xf780('0x2'));var Redis=require(_0xf780('0x3'));var config=require(_0xf780('0x4'));config['redis']=_['defaults'](config[_0xf780('0x5')],{'host':_0xf780('0x6'),'port':0x18eb});var io=require(_0xf780('0x7'))(new Redis(config[_0xf780('0x5')]));function SmsQueue(_0x4af209){this['id']=_0x4af209['id']||0x0;this[_0xf780('0x8')]=_0x4af209['name']||'';this[_0xf780('0x9')]=_0x4af209[_0xf780('0x9')]||0xa;this[_0xf780('0xa')]=_0x4af209[_0xf780('0xa')]||_0xf780('0xb');this[_0xf780('0xc')]=_0x4af209['Agents'];this[_0xf780('0xd')]={};this[_0xf780('0xe')]=0x0;this[_0xf780('0x1')]='';this[_0xf780('0xf')]();this[_0xf780('0x10')]();}SmsQueue[_0xf780('0x11')][_0xf780('0xf')]=function(){var _0x47f3c9=this['mapAgentsId'][_0xf780('0x12')];this[_0xf780('0xd')]=_[_0xf780('0x13')](this[_0xf780('0xc')],'id');this['mapAgentsId'][_0xf780('0x12')]=_0x47f3c9;};SmsQueue[_0xf780('0x11')][_0xf780('0x10')]=function(){this[_0xf780('0x14')]=0x0;this['paused']=0x0;for(var _0x5a64bc=0x0;_0x5a64bc=0x0?this[_0xf780('0x19')]:0x0;var _0x188554={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf780('0x14')],'name':this[_0xf780('0x8')],'paused':this['paused'],'waiting':this[_0xf780('0xe')]};var _0x3fe0a7=md5(JSON['stringify'](_0x188554));if(this[_0xf780('0x1')]!==_0x3fe0a7){this[_0xf780('0x1')]=_0x3fe0a7;io['to'](util[_0xf780('0x1a')](_0xf780('0x1b'),_0x188554[_0xf780('0x8')]))[_0xf780('0x1c')]('sms_queue:save',_0x188554);}};module[_0xf780('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 09e22af..0df230c 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 _0xc77d=['_rr','map','loggedIn','paused','length','online','available','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype'];(function(_0x570483,_0x48844f){var _0x4bc234=function(_0x33cf55){while(--_0x33cf55){_0x570483['push'](_0x570483['shift']());}};_0x4bc234(++_0x48844f);}(_0xc77d,0x1c3));var _0xdc77=function(_0x1dfd6a,_0x43e2b8){_0x1dfd6a=_0x1dfd6a-0x0;var _0x41fe5e=_0xc77d[_0x1dfd6a];return _0x41fe5e;};'use strict';var _=require(_0xdc77('0x0'));var md5=require('md5');var util=require(_0xdc77('0x1'));var Redis=require(_0xdc77('0x2'));var config=require(_0xdc77('0x3'));config[_0xdc77('0x4')]=_[_0xdc77('0x5')](config[_0xdc77('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xdc77('0x6'))(new Redis(config[_0xdc77('0x4')]));function WhatsappQueue(_0x29e15a){this['id']=_0x29e15a['id']||0x0;this[_0xdc77('0x7')]=_0x29e15a[_0xdc77('0x7')]||'';this['timeout']=_0x29e15a[_0xdc77('0x8')]||0xa;this[_0xdc77('0x9')]=_0x29e15a[_0xdc77('0x9')]||_0xdc77('0xa');this['Agents']=_0x29e15a[_0xdc77('0xb')];this[_0xdc77('0xc')]={};this[_0xdc77('0xd')]=0x0;this[_0xdc77('0xe')]='';this['updateRouting']();this[_0xdc77('0xf')]();}WhatsappQueue[_0xdc77('0x10')]['updateRouting']=function(){var _0x1305fd=this['mapAgentsId'][_0xdc77('0x11')];this[_0xdc77('0xc')]=_[_0xdc77('0x12')](this['Agents'],'id');this[_0xdc77('0xc')][_0xdc77('0x11')]=_0x1305fd;};WhatsappQueue[_0xdc77('0x10')]['updateRealtime']=function(){this[_0xdc77('0x13')]=0x0;this[_0xdc77('0x14')]=0x0;for(var _0xca4976=0x0;_0xca4976=0x0?this[_0xdc77('0x17')]:0x0;var _0x12609f={'id':this['id'],'available':this[_0xdc77('0x17')],'loggedIn':this[_0xdc77('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xdc77('0xd')]};var _0x233efc=md5(JSON['stringify'](_0x12609f));if(this[_0xdc77('0xe')]!==_0x233efc){this[_0xdc77('0xe')]=_0x233efc;io['to'](util['format']('whatsapp:queue:%s',_0x12609f[_0xdc77('0x7')]))[_0xdc77('0x18')]('whatsapp_queue:save',_0x12609f);}};module[_0xdc77('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x3538=['paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','redis','name','timeout','strategy','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','length','online','loggedIn'];(function(_0x97bf34,_0x15831e){var _0x2441c5=function(_0x5c7585){while(--_0x5c7585){_0x97bf34['push'](_0x97bf34['shift']());}};_0x2441c5(++_0x15831e);}(_0x3538,0x13c));var _0x8353=function(_0x76c5f9,_0x4672ba){_0x76c5f9=_0x76c5f9-0x0;var _0x156bf7=_0x3538[_0x76c5f9];return _0x156bf7;};'use strict';var _=require(_0x8353('0x0'));var md5=require(_0x8353('0x1'));var util=require(_0x8353('0x2'));var Redis=require(_0x8353('0x3'));var config=require(_0x8353('0x4'));config['redis']=_[_0x8353('0x5')](config['redis'],{'host':_0x8353('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8353('0x7')]));function WhatsappQueue(_0x3eb2a0){this['id']=_0x3eb2a0['id']||0x0;this[_0x8353('0x8')]=_0x3eb2a0[_0x8353('0x8')]||'';this['timeout']=_0x3eb2a0[_0x8353('0x9')]||0xa;this[_0x8353('0xa')]=_0x3eb2a0['strategy']||'beepall';this[_0x8353('0xb')]=_0x3eb2a0[_0x8353('0xb')];this[_0x8353('0xc')]={};this['waiting']=0x0;this[_0x8353('0x1')]='';this['updateRouting']();this[_0x8353('0xd')]();}WhatsappQueue[_0x8353('0xe')]['updateRouting']=function(){var _0x34b5d2=this[_0x8353('0xc')][_0x8353('0xf')];this[_0x8353('0xc')]=_[_0x8353('0x10')](this['Agents'],'id');this[_0x8353('0xc')][_0x8353('0xf')]=_0x34b5d2;};WhatsappQueue[_0x8353('0xe')][_0x8353('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4748c2=0x0;_0x4748c2=0x0?this[_0x8353('0x15')]:0x0;var _0xe43ec7={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x8353('0x14')],'waiting':this['waiting']};var _0x5d8386=md5(JSON[_0x8353('0x16')](_0xe43ec7));if(this['md5']!==_0x5d8386){this['md5']=_0x5d8386;io['to'](util[_0x8353('0x17')](_0x8353('0x18'),_0xe43ec7[_0x8353('0x8')]))[_0x8353('0x19')](_0x8353('0x1a'),_0xe43ec7);}};module[_0x8353('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index bc9f7ad..af7f518 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(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x287768,_0x31ff6b){var _0x31e811=function(_0x1a2051){while(--_0x1a2051){_0x287768['push'](_0x287768['shift']());}};_0x31e811(++_0x31ff6b);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f2601,_0x10b8be){_0x2f2601=_0x2f2601-0x0;var _0x3c6e6=_0xb10b[_0x2f2601];return _0x3c6e6;};'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 00fab97..e858db0 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 _0xc290=['../client','update','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x515215,_0x2ad0d4){var _0x302c92=function(_0x1c09c1){while(--_0x1c09c1){_0x515215['push'](_0x515215['shift']());}};_0x302c92(++_0x2ad0d4);}(_0xc290,0x11d));var _0x0c29=function(_0x48f9d2,_0x33ba0d){_0x48f9d2=_0x48f9d2-0x0;var _0x5228da=_0xc290[_0x48f9d2];return _0x5228da;};'use strict';var client=require(_0x0c29('0x0'));exports[_0x0c29('0x1')]=function(_0xfcbb69,_0x23de53){return client['Request'](_0x0c29('0x2'),{'body':_0x23de53,'options':{'where':{'id':_0xfcbb69}},'log':_0x0c29('0x3')});};exports[_0x0c29('0x4')]=function(_0x12036c,_0xef4f2a){return client['Request']('AddTagsToChatInteraction',{'body':_0xef4f2a,'options':{'where':{'id':_0x12036c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7016=['Request','updateChatInteraction','addTagsToChatInteraction','../client'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7016,0x16b));var _0x6701=function(_0x3996a0,_0x15c317){_0x3996a0=_0x3996a0-0x0;var _0x39e640=_0x7016[_0x3996a0];return _0x39e640;};'use strict';var client=require(_0x6701('0x0'));exports['update']=function(_0x4377b4,_0xc43dfc){return client[_0x6701('0x1')]('UpdateChatInteraction',{'body':_0xc43dfc,'options':{'where':{'id':_0x4377b4}},'log':_0x6701('0x2')});};exports['addTags']=function(_0x5a5f7a,_0x3a5be0){return client[_0x6701('0x1')]('AddTagsToChatInteraction',{'body':_0x3a5be0,'options':{'where':{'id':_0x5a5f7a}},'log':_0x6701('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index a28483f..3fd9a70 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 _0xb916=['../client','Request','createChatMessage'];(function(_0x59de58,_0x2f6fea){var _0x58e2cb=function(_0xfcc5f3){while(--_0xfcc5f3){_0x59de58['push'](_0x59de58['shift']());}};_0x58e2cb(++_0x2f6fea);}(_0xb916,0x87));var _0x6b91=function(_0x1f6e37,_0x560390){_0x1f6e37=_0x1f6e37-0x0;var _0x3d17ad=_0xb916[_0x1f6e37];return _0x3d17ad;};'use strict';var client=require(_0x6b91('0x0'));exports['create']=function(_0x38515f){return client[_0x6b91('0x1')]('CreateChatMessage',{'body':_0x38515f,'log':_0x6b91('0x2')});}; \ No newline at end of file +var _0xbeb4=['CreateChatMessage','createChatMessage','Request'];(function(_0x6d0143,_0x3d7c30){var _0x29cb75=function(_0x3bfcf4){while(--_0x3bfcf4){_0x6d0143['push'](_0x6d0143['shift']());}};_0x29cb75(++_0x3d7c30);}(_0xbeb4,0xe0));var _0x4beb=function(_0x119c02,_0x1add87){_0x119c02=_0x119c02-0x0;var _0x2e304c=_0xbeb4[_0x119c02];return _0x2e304c;};'use strict';var client=require('../client');exports['create']=function(_0x57330f){return client[_0x4beb('0x0')](_0x4beb('0x1'),{'body':_0x57330f,'log':_0x4beb('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index d7a17cc..4d66930 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 _0xcb41=['getChatQueues','Request','GetChatQueue','timeout','User','Agents','name','online','chatPause','../client'];(function(_0x218b24,_0x56e1e3){var _0x253ba7=function(_0x22a6f9){while(--_0x22a6f9){_0x218b24['push'](_0x218b24['shift']());}};_0x253ba7(++_0x56e1e3);}(_0xcb41,0x1df));var _0x1cb4=function(_0x452396,_0x5323e8){_0x452396=_0x452396-0x0;var _0x3ea5dd=_0xcb41[_0x452396];return _0x3ea5dd;};'use strict';var client=require(_0x1cb4('0x0'));exports[_0x1cb4('0x1')]=function(){return function(){return client[_0x1cb4('0x2')](_0x1cb4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1cb4('0x4'),'strategy'],'include':[{'model':_0x1cb4('0x5'),'as':_0x1cb4('0x6'),'attributes':['id',_0x1cb4('0x7'),_0x1cb4('0x8'),_0x1cb4('0x9')]}]},'log':_0x1cb4('0x1')});};}; \ No newline at end of file +var _0x0fda=['Agents','chatPause','../client','Request','GetChatQueue','name','timeout','strategy','User'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x614ce1,_0x4b40e5){_0x614ce1=_0x614ce1-0x0;var _0x2b8849=_0x0fda[_0x614ce1];return _0x2b8849;};'use strict';var client=require(_0xa0fd('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xa0fd('0x1')](_0xa0fd('0x2'),{'options':{'raw':![],'attributes':['id',_0xa0fd('0x3'),_0xa0fd('0x4'),_0xa0fd('0x5')],'include':[{'model':_0xa0fd('0x6'),'as':_0xa0fd('0x7'),'attributes':['id','name','online',_0xa0fd('0x8')]}]},'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 4e1379a..e3ba358 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 _0xb2ff=['DESC','../client','create','Request','UpdateChatQueueReport'];(function(_0x49a982,_0x129a07){var _0x2a0bc9=function(_0x385cb2){while(--_0x385cb2){_0x49a982['push'](_0x49a982['shift']());}};_0x2a0bc9(++_0x129a07);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xfb2f('0x0'));exports[_0xfb2f('0x1')]=function(_0x585db4){return client[_0xfb2f('0x2')]('CreateChatQueueReport',{'body':_0x585db4,'log':'CreateChatQueueReport'});};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 +var _0x4e83=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','create','Request'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x4e83,0x88));var _0x34e8=function(_0x3fb214,_0x428d93){_0x3fb214=_0x3fb214-0x0;var _0x38d89c=_0x4e83[_0x3fb214];return _0x38d89c;};'use strict';var client=require('../client');exports[_0x34e8('0x0')]=function(_0x46d22c){return client[_0x34e8('0x1')](_0x34e8('0x2'),{'body':_0x46d22c,'log':'CreateChatQueueReport'});};exports[_0x34e8('0x3')]=function(_0x4550fd,_0x3b6abf){return client[_0x34e8('0x1')](_0x34e8('0x4'),{'body':_0x3b6abf,'options':{'where':{'uniqueid':_0x4550fd},'order':[['id',_0x34e8('0x5')]],'limit':0x1},'log':_0x34e8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2871657..709bbfc 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(_0x5a6ea3,_0x44b739){var _0x4718f2=function(_0x214fc4){while(--_0x214fc4){_0x5a6ea3['push'](_0x5a6ea3['shift']());}};_0x4718f2(++_0x44b739);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x468556,_0x519a61){_0x468556=_0x468556-0x0;var _0x236847=_0x7a54[_0x468556];return _0x236847;};'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 e80a632..71e69f2 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 _0xd210=['createFaxMessage','../client','create'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0xd210,0x85));var _0x0d21=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xd210[_0x31eb67];return _0x2a8cb8;};'use strict';var client=require(_0x0d21('0x0'));exports[_0x0d21('0x1')]=function(_0x1278e5){return client['Request']('CreateFaxMessage',{'body':_0x1278e5,'log':_0x0d21('0x2')});}; \ No newline at end of file +var _0xb99a=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0xd290a3,_0x236ebf){var _0x27055c=function(_0x1f5dea){while(--_0x1f5dea){_0xd290a3['push'](_0xd290a3['shift']());}};_0x27055c(++_0x236ebf);}(_0xb99a,0x103));var _0xab99=function(_0x4e83b0,_0x28a60f){_0x4e83b0=_0x4e83b0-0x0;var _0x3b8776=_0xb99a[_0x4e83b0];return _0x3b8776;};'use strict';var client=require(_0xab99('0x0'));exports[_0xab99('0x1')]=function(_0x856b6e){return client[_0xab99('0x2')](_0xab99('0x3'),{'body':_0x856b6e,'log':_0xab99('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index be5561b..f052385 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 _0x73b2=['GetFaxQueue','name','timeout','strategy','User','Agents','faxPause','../client','getFaxQueues','Request'];(function(_0x2b905b,_0x9565f6){var _0x480656=function(_0x37f475){while(--_0x37f475){_0x2b905b['push'](_0x2b905b['shift']());}};_0x480656(++_0x9565f6);}(_0x73b2,0x16f));var _0x273b=function(_0x4608ec,_0x124013){_0x4608ec=_0x4608ec-0x0;var _0xc5bfc3=_0x73b2[_0x4608ec];return _0xc5bfc3;};'use strict';var client=require(_0x273b('0x0'));exports[_0x273b('0x1')]=function(){return function(){return client[_0x273b('0x2')](_0x273b('0x3'),{'options':{'raw':![],'attributes':['id',_0x273b('0x4'),_0x273b('0x5'),_0x273b('0x6')],'include':[{'model':_0x273b('0x7'),'as':_0x273b('0x8'),'attributes':['id','name','online',_0x273b('0x9')]}]},'log':_0x273b('0x1')});};}; \ No newline at end of file +var _0xebc1=['strategy','User','Agents','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x12299d,_0x548034){var _0x2b43da=function(_0x225c63){while(--_0x225c63){_0x12299d['push'](_0x12299d['shift']());}};_0x2b43da(++_0x548034);}(_0xebc1,0x7b));var _0x1ebc=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0xebc1[_0x29ae80];return _0x5d6d71;};'use strict';var client=require('../client');exports[_0x1ebc('0x0')]=function(){return function(){return client[_0x1ebc('0x1')](_0x1ebc('0x2'),{'options':{'raw':![],'attributes':['id',_0x1ebc('0x3'),_0x1ebc('0x4'),_0x1ebc('0x5')],'include':[{'model':_0x1ebc('0x6'),'as':_0x1ebc('0x7'),'attributes':['id','name','online','faxPause']}]},'log':_0x1ebc('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 476372d..3e857ce 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 _0x6a20=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','Request'];(function(_0x53e7c5,_0x4fe9d1){var _0x540e10=function(_0x479c4a){while(--_0x479c4a){_0x53e7c5['push'](_0x53e7c5['shift']());}};_0x540e10(++_0x4fe9d1);}(_0x6a20,0x1a2));var _0x06a2=function(_0xbd70e0,_0x193932){_0xbd70e0=_0xbd70e0-0x0;var _0x2f1f32=_0x6a20[_0xbd70e0];return _0x2f1f32;};'use strict';var client=require(_0x06a2('0x0'));exports['create']=function(_0x426c40){return client[_0x06a2('0x1')](_0x06a2('0x2'),{'body':_0x426c40,'log':_0x06a2('0x2')});};exports['update']=function(_0x4fe721,_0x585ae9){return client['Request'](_0x06a2('0x3'),{'body':_0x585ae9,'options':{'where':{'uniqueid':_0x4fe721},'order':[['id',_0x06a2('0x4')]],'limit':0x1},'log':_0x06a2('0x3')});}; \ No newline at end of file +var _0xe50a=['CreateFaxQueueReport','update','UpdateFaxQueueReport','Request'];(function(_0x4e8100,_0x16439c){var _0x16c492=function(_0x3d0afb){while(--_0x3d0afb){_0x4e8100['push'](_0x4e8100['shift']());}};_0x16c492(++_0x16439c);}(_0xe50a,0x1cf));var _0xae50=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0xe50a[_0x36fbef];return _0x45e270;};'use strict';var client=require('../client');exports['create']=function(_0x43157f){return client[_0xae50('0x0')](_0xae50('0x1'),{'body':_0x43157f,'log':_0xae50('0x1')});};exports[_0xae50('0x2')]=function(_0x16e51c,_0x2983e3){return client[_0xae50('0x0')](_0xae50('0x3'),{'body':_0x2983e3,'options':{'where':{'uniqueid':_0x16e51c},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1409bb8..34b331f 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 _0x7f0e=['interval','../client','getIntervals','Request','GetInterval','name','Intervals'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7f0e,0x13c));var _0xe7f0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7f0e[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0xe7f0('0x0'));exports[_0xe7f0('0x1')]=function(){return function(){return client[_0xe7f0('0x2')](_0xe7f0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe7f0('0x4')],'include':[{'model':'Interval','as':_0xe7f0('0x5'),'attributes':['id',_0xe7f0('0x4'),_0xe7f0('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x56b8=['getIntervals','GetInterval','name','interval','../client'];(function(_0x5df175,_0x5e1de6){var _0x242b56=function(_0x1703ea){while(--_0x1703ea){_0x5df175['push'](_0x5df175['shift']());}};_0x242b56(++_0x5e1de6);}(_0x56b8,0x108));var _0x856b=function(_0x2994ff,_0x49cfe9){_0x2994ff=_0x2994ff-0x0;var _0xff37c9=_0x56b8[_0x2994ff];return _0xff37c9;};'use strict';var client=require(_0x856b('0x0'));exports[_0x856b('0x1')]=function(){return function(){return client['Request'](_0x856b('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x856b('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0x856b('0x4')]}]},'log':_0x856b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 94bc42e..c324fff 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 _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x79cd9d,_0x475db3){var _0x4badaa=function(_0x34ea28){while(--_0x34ea28){_0x79cd9d['push'](_0x79cd9d['shift']());}};_0x4badaa(++_0x475db3);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4ae0b7,_0x5a9ba6){_0x4ae0b7=_0x4ae0b7-0x0;var _0xd533c0=_0xb03e[_0x4ae0b7];return _0xd533c0;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file +var _0xd7d1=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5b5db7,_0x139890){_0x5b5db7=_0x5b5db7-0x0;var _0x359c38=_0xd7d1[_0x5b5db7];return _0x359c38;};'use strict';var client=require(_0x1d7d('0x0'));exports[_0x1d7d('0x1')]=function(_0xce4540,_0x447083){return client[_0x1d7d('0x2')](_0x1d7d('0x3'),{'body':_0x447083,'options':{'where':{'id':_0xce4540}},'log':_0x1d7d('0x4')});};exports[_0x1d7d('0x5')]=function(_0x1ac097,_0x1adb6b){return client[_0x1d7d('0x2')](_0x1d7d('0x6'),{'body':_0x1adb6b,'options':{'where':{'id':_0x1ac097}},'log':_0x1d7d('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 996ad65..17edaa5 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 _0x5899=['create','CreateMailMessage','../client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5899,0xb6));var _0x9589=function(_0x1f2f17,_0x3f9445){_0x1f2f17=_0x1f2f17-0x0;var _0x52ee75=_0x5899[_0x1f2f17];return _0x52ee75;};'use strict';var client=require(_0x9589('0x0'));exports[_0x9589('0x1')]=function(_0x1c1aef){return client['Request'](_0x9589('0x2'),{'body':_0x1c1aef,'log':'createMailMessage'});}; \ No newline at end of file +var _0xf382=['../client','Request','CreateMailMessage','createMailMessage'];(function(_0xa0dc9e,_0x36355e){var _0xfbada2=function(_0x5593de){while(--_0x5593de){_0xa0dc9e['push'](_0xa0dc9e['shift']());}};_0xfbada2(++_0x36355e);}(_0xf382,0x12c));var _0x2f38=function(_0x49b36c,_0x597234){_0x49b36c=_0x49b36c-0x0;var _0x2937bf=_0xf382[_0x49b36c];return _0x2937bf;};'use strict';var client=require(_0x2f38('0x0'));exports['create']=function(_0x3d8009){return client[_0x2f38('0x1')](_0x2f38('0x2'),{'body':_0x3d8009,'log':_0x2f38('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 6e97831..22f90ce 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 _0x4d00=['Agents','mailPause','../client','getMailQueues','Request','name','timeout','strategy','User'];(function(_0x2df6d4,_0x783cea){var _0x4a88c6=function(_0x5af2bb){while(--_0x5af2bb){_0x2df6d4['push'](_0x2df6d4['shift']());}};_0x4a88c6(++_0x783cea);}(_0x4d00,0xfe));var _0x04d0=function(_0x989ad2,_0x3bd706){_0x989ad2=_0x989ad2-0x0;var _0x217e96=_0x4d00[_0x989ad2];return _0x217e96;};'use strict';var client=require(_0x04d0('0x0'));exports[_0x04d0('0x1')]=function(){return function(){return client[_0x04d0('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x04d0('0x3'),_0x04d0('0x4'),_0x04d0('0x5')],'include':[{'model':_0x04d0('0x6'),'as':_0x04d0('0x7'),'attributes':['id','name','online',_0x04d0('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x0e33=['timeout','User','Agents','../client','getMailQueues','GetMailQueue','name'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x0e33,0xf8));var _0x30e3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0e33[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x30e3('0x0'));exports[_0x30e3('0x1')]=function(){return function(){return client['Request'](_0x30e3('0x2'),{'options':{'raw':![],'attributes':['id',_0x30e3('0x3'),_0x30e3('0x4'),'strategy'],'include':[{'model':_0x30e3('0x5'),'as':_0x30e3('0x6'),'attributes':['id',_0x30e3('0x3'),'online','mailPause']}]},'log':_0x30e3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4f3a94a..07adf92 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 _0xac04=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0xb6cfa4,_0x121e3b){var _0x51433b=function(_0x476c98){while(--_0x476c98){_0xb6cfa4['push'](_0xb6cfa4['shift']());}};_0x51433b(++_0x121e3b);}(_0xac04,0x67));var _0x4ac0=function(_0x10ca07,_0x3068d1){_0x10ca07=_0x10ca07-0x0;var _0x45342a=_0xac04[_0x10ca07];return _0x45342a;};'use strict';var client=require(_0x4ac0('0x0'));exports[_0x4ac0('0x1')]=function(_0x392b08){return client[_0x4ac0('0x2')](_0x4ac0('0x3'),{'body':_0x392b08,'log':_0x4ac0('0x3')});};exports[_0x4ac0('0x4')]=function(_0x4669c0,_0x20a9e5){return client[_0x4ac0('0x2')](_0x4ac0('0x5'),{'body':_0x20a9e5,'options':{'where':{'uniqueid':_0x4669c0},'order':[['id',_0x4ac0('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x734a=['Request','CreateMailQueueReport','UpdateMailQueueReport','create'];(function(_0x307146,_0x328205){var _0xfbc8cd=function(_0x2cabd2){while(--_0x2cabd2){_0x307146['push'](_0x307146['shift']());}};_0xfbc8cd(++_0x328205);}(_0x734a,0x143));var _0xa734=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0x734a[_0x479b99];return _0x1e7eb7;};'use strict';var client=require('../client');exports[_0xa734('0x0')]=function(_0x5c147a){return client[_0xa734('0x1')](_0xa734('0x2'),{'body':_0x5c147a,'log':_0xa734('0x2')});};exports['update']=function(_0x115b26,_0x21abb5){return client[_0xa734('0x1')](_0xa734('0x3'),{'body':_0x21abb5,'options':{'where':{'uniqueid':_0x115b26},'order':[['id','DESC']],'limit':0x1},'log':_0xa734('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 0d6accd..456f072 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 _0x014d=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','addTags'];(function(_0x446186,_0x116e31){var _0x63b564=function(_0x590a14){while(--_0x590a14){_0x446186['push'](_0x446186['shift']());}};_0x63b564(++_0x116e31);}(_0x014d,0x1ca));var _0xd014=function(_0x1252af,_0x3ea807){_0x1252af=_0x1252af-0x0;var _0x3dd1f5=_0x014d[_0x1252af];return _0x3dd1f5;};'use strict';var client=require(_0xd014('0x0'));exports[_0xd014('0x1')]=function(_0x2d8b90,_0x3a76bb){return client[_0xd014('0x2')]('UpdateOpenchannelInteraction',{'body':_0x3a76bb,'options':{'where':{'id':_0x2d8b90}},'log':'updateOpenchannelInteraction'});};exports[_0xd014('0x3')]=function(_0x4490c5,_0x45bfa6){return client[_0xd014('0x2')](_0xd014('0x4'),{'body':_0x45bfa6,'options':{'where':{'id':_0x4490c5}},'log':_0xd014('0x5')});}; \ No newline at end of file +var _0x0307=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request'];(function(_0x3b6112,_0x31a6f3){var _0x263088=function(_0x447239){while(--_0x447239){_0x3b6112['push'](_0x3b6112['shift']());}};_0x263088(++_0x31a6f3);}(_0x0307,0x10b));var _0x7030=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0307[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports['update']=function(_0x4ec2d2,_0x1237a5){return client[_0x7030('0x0')]('UpdateOpenchannelInteraction',{'body':_0x1237a5,'options':{'where':{'id':_0x4ec2d2}},'log':'updateOpenchannelInteraction'});};exports[_0x7030('0x1')]=function(_0x4e4211,_0x2df17b){return client[_0x7030('0x0')](_0x7030('0x2'),{'body':_0x2df17b,'options':{'where':{'id':_0x4e4211}},'log':_0x7030('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 80f58a1..80881d3 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 _0xaaef=['../client','create','Request'];(function(_0x35c300,_0x284351){var _0x59e44b=function(_0x327e5c){while(--_0x327e5c){_0x35c300['push'](_0x35c300['shift']());}};_0x59e44b(++_0x284351);}(_0xaaef,0x1b6));var _0xfaae=function(_0x5cbe77,_0x49567c){_0x5cbe77=_0x5cbe77-0x0;var _0x3744bc=_0xaaef[_0x5cbe77];return _0x3744bc;};'use strict';var client=require(_0xfaae('0x0'));exports[_0xfaae('0x1')]=function(_0xd0693c){return client[_0xfaae('0x2')]('CreateOpenchannelMessage',{'body':_0xd0693c,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x2b94=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x143386,_0x564ebb){var _0x1479a0=function(_0x27e331){while(--_0x27e331){_0x143386['push'](_0x143386['shift']());}};_0x1479a0(++_0x564ebb);}(_0x2b94,0xc4));var _0x42b9=function(_0x1c8135,_0x246867){_0x1c8135=_0x1c8135-0x0;var _0x40c4ab=_0x2b94[_0x1c8135];return _0x40c4ab;};'use strict';var client=require('../client');exports[_0x42b9('0x0')]=function(_0x4eb80d){return client[_0x42b9('0x1')](_0x42b9('0x2'),{'body':_0x4eb80d,'log':_0x42b9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 580ce36..5ecc502 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 _0x7008=['Request','name','strategy','Agents','openchannelPause','getOpenchannelQueues'];(function(_0x3a80b6,_0x5109a8){var _0x401469=function(_0x4524b5){while(--_0x4524b5){_0x3a80b6['push'](_0x3a80b6['shift']());}};_0x401469(++_0x5109a8);}(_0x7008,0x1ec));var _0x8700=function(_0x58ea5a,_0x3fd45c){_0x58ea5a=_0x58ea5a-0x0;var _0x3eb2a9=_0x7008[_0x58ea5a];return _0x3eb2a9;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x8700('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x8700('0x1'),'timeout',_0x8700('0x2')],'include':[{'model':'User','as':_0x8700('0x3'),'attributes':['id',_0x8700('0x1'),'online',_0x8700('0x4')]}]},'log':_0x8700('0x5')});};}; \ No newline at end of file +var _0xd696=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','openchannelPause'];(function(_0x15ec5,_0x5b20a6){var _0x3ed96b=function(_0x21decd){while(--_0x21decd){_0x15ec5['push'](_0x15ec5['shift']());}};_0x3ed96b(++_0x5b20a6);}(_0xd696,0xe1));var _0x6d69=function(_0x1765dc,_0x17d194){_0x1765dc=_0x1765dc-0x0;var _0x5e7800=_0xd696[_0x1765dc];return _0x5e7800;};'use strict';var client=require(_0x6d69('0x0'));exports[_0x6d69('0x1')]=function(){return function(){return client[_0x6d69('0x2')](_0x6d69('0x3'),{'options':{'raw':![],'attributes':['id',_0x6d69('0x4'),_0x6d69('0x5'),'strategy'],'include':[{'model':_0x6d69('0x6'),'as':_0x6d69('0x7'),'attributes':['id',_0x6d69('0x4'),'online',_0x6d69('0x8')]}]},'log':_0x6d69('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 515c23d..5a57f7a 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 _0xf663=['DESC','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x34d36a,_0x200da9){var _0xc4f7b=function(_0x5aecf0){while(--_0x5aecf0){_0x34d36a['push'](_0x34d36a['shift']());}};_0xc4f7b(++_0x200da9);}(_0xf663,0x1aa));var _0x3f66=function(_0x8413ca,_0xe18ad6){_0x8413ca=_0x8413ca-0x0;var _0x259ddc=_0xf663[_0x8413ca];return _0x259ddc;};'use strict';var client=require('../client');exports[_0x3f66('0x0')]=function(_0x1aedda){return client[_0x3f66('0x1')](_0x3f66('0x2'),{'body':_0x1aedda,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x571923,_0x568f58){return client[_0x3f66('0x1')](_0x3f66('0x3'),{'body':_0x568f58,'options':{'where':{'uniqueid':_0x571923},'order':[['id',_0x3f66('0x4')]],'limit':0x1},'log':_0x3f66('0x3')});}; \ No newline at end of file +var _0xf472=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xf472,0xd1));var _0x2f47=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf472[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x2f47('0x0'));exports[_0x2f47('0x1')]=function(_0x8ef912){return client[_0x2f47('0x2')](_0x2f47('0x3'),{'body':_0x8ef912,'log':_0x2f47('0x3')});};exports[_0x2f47('0x4')]=function(_0x31539c,_0x45af27){return client[_0x2f47('0x2')](_0x2f47('0x5'),{'body':_0x45af27,'options':{'where':{'uniqueid':_0x31539c},'order':[['id',_0x2f47('0x6')]],'limit':0x1},'log':_0x2f47('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index e6b6e32..e51b3fd 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 _0x8388=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x818dec,_0x2f0ada){var _0x22f8e6=function(_0xae25c4){while(--_0xae25c4){_0x818dec['push'](_0x818dec['shift']());}};_0x22f8e6(++_0x2f0ada);}(_0x8388,0x18d));var _0x8838=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x8388[_0x1034ca];return _0x1a023a;};'use strict';var client=require(_0x8838('0x0'));exports[_0x8838('0x1')]=function(_0x13cdc3,_0x3666a3){return client['Request'](_0x8838('0x2'),{'body':_0x3666a3,'options':{'where':{'id':_0x13cdc3}},'log':_0x8838('0x3')});};exports[_0x8838('0x4')]=function(_0x20a813,_0xd474f2){return client['Request'](_0x8838('0x5'),{'body':_0xd474f2,'options':{'where':{'id':_0x20a813}},'log':_0x8838('0x6')});}; \ No newline at end of file +var _0x89fe=['UpdateSmsInteraction','updateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x89fe,0x83));var _0xe89f=function(_0x29fa9d,_0x34cf83){_0x29fa9d=_0x29fa9d-0x0;var _0xaa6ac=_0x89fe[_0x29fa9d];return _0xaa6ac;};'use strict';var client=require(_0xe89f('0x0'));exports[_0xe89f('0x1')]=function(_0x2aac3e,_0x3420da){return client['Request'](_0xe89f('0x2'),{'body':_0x3420da,'options':{'where':{'id':_0x2aac3e}},'log':_0xe89f('0x3')});};exports['addTags']=function(_0x3d3aa8,_0x3d8b30){return client[_0xe89f('0x4')](_0xe89f('0x5'),{'body':_0x3d8b30,'options':{'where':{'id':_0x3d3aa8}},'log':_0xe89f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4c7ed29..184a41e 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 _0x0c58=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0c58,0x70));var _0x80c5=function(_0x11e27d,_0x296ac1){_0x11e27d=_0x11e27d-0x0;var _0x45a9ba=_0x0c58[_0x11e27d];return _0x45a9ba;};'use strict';var client=require(_0x80c5('0x0'));exports['create']=function(_0x22d418){return client[_0x80c5('0x1')](_0x80c5('0x2'),{'body':_0x22d418,'log':_0x80c5('0x3')});}; \ No newline at end of file +var _0xd740=['Request','CreateSmsMessage','../client'];(function(_0x189984,_0x477464){var _0x23c2a9=function(_0x1403ce){while(--_0x1403ce){_0x189984['push'](_0x189984['shift']());}};_0x23c2a9(++_0x477464);}(_0xd740,0x9e));var _0x0d74=function(_0x44e50a,_0x1cc4a2){_0x44e50a=_0x44e50a-0x0;var _0x1b5994=_0xd740[_0x44e50a];return _0x1b5994;};'use strict';var client=require(_0x0d74('0x0'));exports['create']=function(_0x18fc1b){return client[_0x0d74('0x1')](_0x0d74('0x2'),{'body':_0x18fc1b,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index cc7b227..fca4e84 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x40ebec,_0x4c4f9d){var _0x4aa51c=function(_0x48de5b){while(--_0x48de5b){_0x40ebec['push'](_0x40ebec['shift']());}};_0x4aa51c(++_0x4c4f9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x2b9199,_0x190e7b){var _0x24efe2=function(_0x52264e){while(--_0x52264e){_0x2b9199['push'](_0x2b9199['shift']());}};_0x24efe2(++_0x190e7b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xcb91[_0x403c20];return _0x2b271a;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 704c212..cea23d1 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2202b2,_0x5f4cbd){var _0x238925=function(_0x423c9f){while(--_0x423c9f){_0x2202b2['push'](_0x2202b2['shift']());}};_0x238925(++_0x5f4cbd);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x432073,_0x5a06f5){var _0x5cb45e=function(_0x442cfc){while(--_0x442cfc){_0x432073['push'](_0x432073['shift']());}};_0x5cb45e(++_0x5a06f5);}(_0x70e0,0x17b));var _0x070e=function(_0x30efa7,_0x40e3b2){_0x30efa7=_0x30efa7-0x0;var _0x4a9056=_0x70e0[_0x30efa7];return _0x4a9056;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3f2ee7c..6045d17 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(_0x1dce0d,_0x16fe77){var _0xa43784=function(_0x11ecb8){while(--_0x11ecb8){_0x1dce0d['push'](_0x1dce0d['shift']());}};_0xa43784(++_0x16fe77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0xf19caf,_0x5548ee){var _0x4952c3=function(_0x228720){while(--_0x228720){_0xf19caf['push'](_0xf19caf['shift']());}};_0x4952c3(++_0x5548ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 37a2ed1..dda5f04 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 _0xd2f5=['../client','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x129c90,_0x2803c1){var _0x1950a2=function(_0x1b0740){while(--_0x1b0740){_0x129c90['push'](_0x129c90['shift']());}};_0x1950a2(++_0x2803c1);}(_0xd2f5,0x144));var _0x5d2f=function(_0x2e9b98,_0x5a0283){_0x2e9b98=_0x2e9b98-0x0;var _0x1c727e=_0xd2f5[_0x2e9b98];return _0x1c727e;};'use strict';var client=require(_0x5d2f('0x0'));exports['update']=function(_0x194209,_0x58ee4e){return client[_0x5d2f('0x1')]('UpdateWhatsappInteraction',{'body':_0x58ee4e,'options':{'where':{'id':_0x194209}},'log':_0x5d2f('0x2')});};exports[_0x5d2f('0x3')]=function(_0x102911,_0xc7102b){return client[_0x5d2f('0x1')](_0x5d2f('0x4'),{'body':_0xc7102b,'options':{'where':{'id':_0x102911}},'log':_0x5d2f('0x5')});}; \ No newline at end of file +var _0xcf71=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request'];(function(_0x1bdd9a,_0x169dcd){var _0x4dc294=function(_0x4d5ede){while(--_0x4d5ede){_0x1bdd9a['push'](_0x1bdd9a['shift']());}};_0x4dc294(++_0x169dcd);}(_0xcf71,0xba));var _0x1cf7=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0xcf71[_0x2d0d9f];return _0x30243d;};'use strict';var client=require(_0x1cf7('0x0'));exports[_0x1cf7('0x1')]=function(_0x1953aa,_0x259edc){return client['Request'](_0x1cf7('0x2'),{'body':_0x259edc,'options':{'where':{'id':_0x1953aa}},'log':_0x1cf7('0x3')});};exports[_0x1cf7('0x4')]=function(_0x21307d,_0x11e462){return client[_0x1cf7('0x5')](_0x1cf7('0x6'),{'body':_0x11e462,'options':{'where':{'id':_0x21307d}},'log':_0x1cf7('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f16059d..02d4ba0 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 _0xbdc1=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x296da8,_0x49a315){var _0x380e76=function(_0x2e859b){while(--_0x2e859b){_0x296da8['push'](_0x296da8['shift']());}};_0x380e76(++_0x49a315);}(_0xbdc1,0x1c7));var _0x1bdc=function(_0x5073b2,_0x42b722){_0x5073b2=_0x5073b2-0x0;var _0x1bfdf5=_0xbdc1[_0x5073b2];return _0x1bfdf5;};'use strict';var client=require(_0x1bdc('0x0'));exports[_0x1bdc('0x1')]=function(_0x521d7f){return client[_0x1bdc('0x2')](_0x1bdc('0x3'),{'body':_0x521d7f,'log':_0x1bdc('0x4')});}; \ No newline at end of file +var _0x1297=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x1297,0x155));var _0x7129=function(_0x2042ed,_0x20a895){_0x2042ed=_0x2042ed-0x0;var _0x9f8fc0=_0x1297[_0x2042ed];return _0x9f8fc0;};'use strict';var client=require(_0x7129('0x0'));exports['create']=function(_0x7cc534){return client[_0x7129('0x1')](_0x7129('0x2'),{'body':_0x7cc534,'log':_0x7129('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index db5bafc..b8576df 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 _0xd0db=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0xd0db,0x1cc));var _0xbd0d=function(_0x27f5b5,_0x36a362){_0x27f5b5=_0x27f5b5-0x0;var _0x2489c0=_0xd0db[_0x27f5b5];return _0x2489c0;};'use strict';var client=require(_0xbd0d('0x0'));exports[_0xbd0d('0x1')]=function(){return function(){return client[_0xbd0d('0x2')](_0xbd0d('0x3'),{'options':{'raw':![],'attributes':['id',_0xbd0d('0x4'),_0xbd0d('0x5'),_0xbd0d('0x6')],'include':[{'model':_0xbd0d('0x7'),'as':_0xbd0d('0x8'),'attributes':['id',_0xbd0d('0x4'),_0xbd0d('0x9'),_0xbd0d('0xa')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x23fd=['name','timeout','Agents','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x23fd,0x184));var _0xd23f=function(_0x590382,_0x4b7279){_0x590382=_0x590382-0x0;var _0x329c42=_0x23fd[_0x590382];return _0x329c42;};'use strict';var client=require(_0xd23f('0x0'));exports[_0xd23f('0x1')]=function(){return function(){return client[_0xd23f('0x2')](_0xd23f('0x3'),{'options':{'raw':![],'attributes':['id',_0xd23f('0x4'),_0xd23f('0x5'),'strategy'],'include':[{'model':'User','as':_0xd23f('0x6'),'attributes':['id',_0xd23f('0x4'),'online','whatsappPause']}]},'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 7d26ea1..7aa538e 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 _0xcf62=['Request','UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport','update'];(function(_0x67d34e,_0x4fe53a){var _0x4ed2cf=function(_0x56f4a6){while(--_0x56f4a6){_0x67d34e['push'](_0x67d34e['shift']());}};_0x4ed2cf(++_0x4fe53a);}(_0xcf62,0x11b));var _0x2cf6=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcf62[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require(_0x2cf6('0x0'));exports[_0x2cf6('0x1')]=function(_0x1e3893){return client['Request'](_0x2cf6('0x2'),{'body':_0x1e3893,'log':_0x2cf6('0x2')});};exports[_0x2cf6('0x3')]=function(_0x143b7a,_0x315d55){return client[_0x2cf6('0x4')](_0x2cf6('0x5'),{'body':_0x315d55,'options':{'where':{'uniqueid':_0x143b7a},'order':[['id',_0x2cf6('0x6')]],'limit':0x1},'log':_0x2cf6('0x5')});}; \ No newline at end of file +var _0x0686=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x30f87a,_0x2cce5a){var _0x3a8efc=function(_0x225d6b){while(--_0x225d6b){_0x30f87a['push'](_0x30f87a['shift']());}};_0x3a8efc(++_0x2cce5a);}(_0x0686,0x1c1));var _0x6068=function(_0x29cb36,_0x2dc053){_0x29cb36=_0x29cb36-0x0;var _0x8b6afd=_0x0686[_0x29cb36];return _0x8b6afd;};'use strict';var client=require(_0x6068('0x0'));exports[_0x6068('0x1')]=function(_0xf33fb6){return client[_0x6068('0x2')](_0x6068('0x3'),{'body':_0xf33fb6,'log':_0x6068('0x3')});};exports[_0x6068('0x4')]=function(_0xacdd6e,_0x459d1a){return client[_0x6068('0x2')]('UpdateWhatsappQueueReport',{'body':_0x459d1a,'options':{'where':{'uniqueid':_0xacdd6e},'order':[['id',_0x6068('0x5')]],'limit':0x1},'log':_0x6068('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 047423f..96455d2 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 _0x3b6d=['[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop'];(function(_0x1e198c,_0x464ea7){var _0x283477=function(_0x285287){while(--_0x285287){_0x1e198c['push'](_0x1e198c['shift']());}};_0x283477(++_0x464ea7);}(_0x3b6d,0x86));var _0xd3b6=function(_0x3cf485,_0x14c59d){_0x3cf485=_0x3cf485-0x0;var _0x211750=_0x3b6d[_0x3cf485];return _0x211750;};'use strict';var schema=require(_0xd3b6('0x0'));var _=require(_0xd3b6('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xd3b6('0x2'))(_0xd3b6('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xd3b6('0x4'),'required':!![],'message':_0xd3b6('0x5')},'timeout':{'type':_0xd3b6('0x6'),'message':_0xd3b6('0x7')}});function writeLog(_0x276585,_0x4a6a3f,_0x584dff){return logger['info'](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x276585,_0x4a6a3f[_0xd3b6('0x8')],_0x584dff));}function handleFindAgent(_0x3042d1){return function(_0x10deaf){return _0x10deaf['name'][_0xd3b6('0x9')]()===_0x3042d1[_0xd3b6('0x9')]();};}exports[_0xd3b6('0xa')]=function(_0x2c3a31,_0x175b83,_0x3bb4c2,_0x1b803a){return function(_0x169f1f){try{var _0x50b1c8={'name':_0x175b83[0x0],'timeout':_0x175b83[0x1]};var _0x239466=queue[_0xd3b6('0x0')](_0x50b1c8,{'typecast':!![]});if(_0x239466[_0xd3b6('0xb')]){logger[_0xd3b6('0xc')](_0xd3b6('0xd'),_0x2c3a31,_[_0xd3b6('0xe')](_0x239466,'message')[_0xd3b6('0xf')](',\x20'));_0x169f1f['stop']();}else{var _0xa83660=_['find'](_0x3bb4c2[_0xd3b6('0x10')],handleFindAgent(_0x50b1c8[_0xd3b6('0x8')]));if(_0xa83660){var _0x3512bf=(_0x50b1c8[_0xd3b6('0x11')]||0xa)*0x3e8;var _0x5bfeda,_0x37ed80;var _0x3aa974=seqqueue[_0xd3b6('0x12')](_0x3512bf);_0x3aa974['id']=_0x2c3a31;_0x3aa974[_0xd3b6('0x13')]=_0x3512bf;_0x3aa974[_0xd3b6('0x14')]=_0x1b803a[_0xd3b6('0x14')];writeLog(_0x2c3a31,_0xa83660,util['format'](_0xd3b6('0x15'),_0x3512bf));_0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31]['on'](_0xd3b6('0x17'),function(){logger[_0xd3b6('0x18')](_0xd3b6('0x19'),_0x2c3a31);clearTimeout(_0x37ed80);_0x37ed80=undefined;_0x3aa974[_0xd3b6('0x1a')]();if(_0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31]){delete _0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31];}_0x169f1f['stop']();});_0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31]['on'](_0xd3b6('0x1b'),function(){if(_0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31]){delete _0x3bb4c2[_0xd3b6('0x16')][_0x2c3a31];}});_0x37ed80=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x2c3a31);clearTimeout(_0x37ed80);_0x3aa974[_0xd3b6('0x1a')]();_0x169f1f['next']();},_0x3512bf);strategy[_0xd3b6('0x1c')](_0x3aa974,_0xa83660,_0x3bb4c2,_0x1b803a);}else{logger[_0xd3b6('0xc')](_0xd3b6('0x1d'),_0x2c3a31,_0x50b1c8[_0xd3b6('0x8')]);_0x169f1f[_0xd3b6('0x1e')]();}}}catch(_0x547b1f){console['log'](_0x547b1f);logger[_0xd3b6('0xc')](_0xd3b6('0x1f'),_0x2c3a31,_0x547b1f[_0xd3b6('0x20')]);_0x169f1f[_0xd3b6('0x1e')]();}};}; \ No newline at end of file +var _0x2139=['timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s','map','join','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','stack','lodash','util','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0x2139,0x186));var _0x9213=function(_0x2fcd34,_0x3d237a){_0x2fcd34=_0x2fcd34-0x0;var _0x4f51c8=_0x2139[_0x2fcd34];return _0x4f51c8;};'use strict';var schema=require('validate');var _=require(_0x9213('0x0'));var util=require(_0x9213('0x1'));var seqqueue=require(_0x9213('0x2'));var logger=require(_0x9213('0x3'))(_0x9213('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x9213('0x5')},'timeout':{'type':'number','message':_0x9213('0x6')}});function writeLog(_0x5e78c7,_0x386226,_0x533242){return logger[_0x9213('0x7')](util[_0x9213('0x8')](_0x9213('0x9'),_0x5e78c7,_0x386226['name'],_0x533242));}function handleFindAgent(_0x35bc2a){return function(_0x59b75b){return _0x59b75b[_0x9213('0xa')]['toLowerCase']()===_0x35bc2a[_0x9213('0xb')]();};}exports[_0x9213('0xc')]=function(_0x47d33f,_0x1929d6,_0x14185e,_0x30e680){return function(_0x23af16){try{var _0x20d48f={'name':_0x1929d6[0x0],'timeout':_0x1929d6[0x1]};var _0x39c84f=queue[_0x9213('0xd')](_0x20d48f,{'typecast':!![]});if(_0x39c84f['length']){logger[_0x9213('0xe')](_0x9213('0xf'),_0x47d33f,_[_0x9213('0x10')](_0x39c84f,'message')[_0x9213('0x11')](',\x20'));_0x23af16['stop']();}else{var _0x4dfd73=_['find'](_0x14185e[_0x9213('0x12')],handleFindAgent(_0x20d48f[_0x9213('0xa')]));if(_0x4dfd73){var _0x2f57b2=(_0x20d48f[_0x9213('0x13')]||0xa)*0x3e8;var _0x42c49e,_0x85b736;var _0x3752d1=seqqueue[_0x9213('0x14')](_0x2f57b2);_0x3752d1['id']=_0x47d33f;_0x3752d1['atimeout']=_0x2f57b2;_0x3752d1[_0x9213('0x15')]=_0x30e680[_0x9213('0x15')];writeLog(_0x47d33f,_0x4dfd73,util['format'](_0x9213('0x16'),_0x2f57b2));_0x14185e[_0x9213('0x17')][_0x47d33f]['on'](_0x9213('0x18'),function(){logger[_0x9213('0x7')](_0x9213('0x19'),_0x47d33f);clearTimeout(_0x85b736);_0x85b736=undefined;_0x3752d1[_0x9213('0x1a')]();if(_0x14185e['rules'][_0x47d33f]){delete _0x14185e[_0x9213('0x17')][_0x47d33f];}_0x23af16[_0x9213('0x1b')]();});_0x14185e[_0x9213('0x17')][_0x47d33f]['on']('complete',function(){if(_0x14185e[_0x9213('0x17')][_0x47d33f]){delete _0x14185e[_0x9213('0x17')][_0x47d33f];}});_0x85b736=setTimeout(function(){logger[_0x9213('0x7')](_0x9213('0x1c'),_0x47d33f);clearTimeout(_0x85b736);_0x3752d1[_0x9213('0x1a')]();_0x23af16[_0x9213('0x1d')]();},_0x2f57b2);strategy[_0x9213('0x1e')](_0x3752d1,_0x4dfd73,_0x14185e,_0x30e680);}else{logger[_0x9213('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x47d33f,_0x20d48f['name']);_0x23af16['stop']();}}}catch(_0x4d53c1){console[_0x9213('0x1f')](_0x4d53c1);logger['error']('[%s][QUEUE]\x20%s',_0x47d33f,_0x4d53c1[_0x9213('0x20')]);_0x23af16[_0x9213('0x1b')]();}};}; \ 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 b8a024e..8256300 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 _0xc4ca=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','error','amazonlex','providerName','providerResponse','dialogState','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','channel','sms','whatsapp','phone','chat'];(function(_0x18c6b3,_0x57664c){var _0x4353c6=function(_0x2f3532){while(--_0x2f3532){_0x18c6b3['push'](_0x18c6b3['shift']());}};_0x4353c6(++_0x57664c);}(_0xc4ca,0x147));var _0xac4c=function(_0xa9673c,_0x1b34fc){_0xa9673c=_0xa9673c-0x0;var _0x473f56=_0xc4ca[_0xa9673c];return _0x473f56;};'use strict';var _=require(_0xac4c('0x0'));var moment=require(_0xac4c('0x1'));var AWS=require('aws-sdk');var utils=require(_0xac4c('0x2'));var logger=require(_0xac4c('0x3'))(_0xac4c('0x4'));var rpc={'chatMessage':require(_0xac4c('0x5')),'openchannelMessage':require(_0xac4c('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xac4c('0x7')),'faxMessage':require(_0xac4c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xac4c('0x9')]=function(_0x3e35fa,_0x168817){return function(_0x1600aa){try{if(!_[_0xac4c('0xa')](this[_0xac4c('0xb')][_0xac4c('0xc')])){logger[_0xac4c('0xd')](_0xac4c('0xe'),_0x3e35fa,_0xac4c('0xf'));return _0x1600aa[_0xac4c('0x10')]();}var _0xf2dd4={'ContactId':this['contact']['id'],'sentAt':moment()[_0xac4c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xac4c('0x12')]===_0xac4c('0x13')||this[_0xac4c('0x12')]===_0xac4c('0x14')){_0xf2dd4[_0xac4c('0x15')]=this[_0xac4c('0xb')][_0xac4c('0x15')];}var _0x638d31=this['channel'];if(_0x638d31===_0xac4c('0x16')){_0xf2dd4[_0xac4c('0x17')]=this[_0xac4c('0x18')]['id'];}else{_0xf2dd4[_[_0xac4c('0x19')](_0x638d31)+_0xac4c('0x1a')]=this[_0xac4c('0x18')]['id'];}_0xf2dd4[_[_0xac4c('0x19')](_0x638d31)+_0xac4c('0x1b')]=this[_0xac4c('0xb')]['id'];if(this[_0xac4c('0xb')][_0xac4c('0x1c')]){var _0x32ba0f=_0x168817[0x4];if(!_[_0xac4c('0x1d')](_0x32ba0f)){_0xf2dd4[_0xac4c('0x1e')]=utils[_0xac4c('0x1f')](_0x32ba0f,this);return rpc[_0x638d31+_0xac4c('0x20')][_0xac4c('0x21')](_0xf2dd4)[_0xac4c('0x22')](function(_0x49eec1){logger['info'](_0xac4c('0xe'),_0x3e35fa,_0xf2dd4[_0xac4c('0x1e')]);})[_0xac4c('0x23')](function(_0x508b95){logger['error'](_0xac4c('0xe'),_0x3e35fa,JSON[_0xac4c('0x24')](_0x508b95));})[_0xac4c('0x25')](function(){logger['info'](_0xac4c('0x26'),_0x3e35fa);_0x1600aa[_0xac4c('0x27')]();});}else{logger['info'](_0xac4c('0x28'),_0x3e35fa);_0x1600aa[_0xac4c('0x27')]();}}else{var _0x1eb08=this;var _0xa354ce=new AWS['LexRuntime']({'accessKeyId':_0x168817[0x0],'secretAccessKey':_0x168817[0x1],'region':_0x168817[0x2]});var _0x4ca6fe={'botAlias':_0xac4c('0x29'),'botName':_0x168817[0x3],'inputText':this[_0xac4c('0x2a')][_0xac4c('0x1e')],'userId':this[_0xac4c('0x12')]+':'+this[_0xac4c('0xb')]['id'][_0xac4c('0x2b')]()};_0xa354ce[_0xac4c('0x2c')](_0x4ca6fe,function(_0x84af9e,_0x14bf51){if(_0x84af9e){logger[_0xac4c('0x2d')](_0xac4c('0xe'),_0x3e35fa,_0x84af9e['message']);_0x1600aa[_0xac4c('0x10')]();}else if(_0x14bf51&&_0x14bf51['message']){_0x1eb08[_0xac4c('0x1e')][_0xac4c('0x2e')]=_0x14bf51;_0xf2dd4[_0xac4c('0x1e')]=_0x14bf51[_0xac4c('0x2a')];_0xf2dd4[_0xac4c('0x2f')]=_0xac4c('0x2e');_0xf2dd4[_0xac4c('0x30')]=JSON[_0xac4c('0x24')](_0x14bf51);return rpc[_0x638d31+_0xac4c('0x20')][_0xac4c('0x21')](_0xf2dd4)[_0xac4c('0x22')](function(_0x1cebea){logger['info'](_0xac4c('0xe'),_0x3e35fa,_0xf2dd4[_0xac4c('0x1e')]);if(_0x14bf51[_0xac4c('0x31')]=='Failed'){_0x1600aa[_0xac4c('0x10')]();}else{_0x1600aa[_0xac4c('0x27')]();}})[_0xac4c('0x23')](function(_0x166102){logger['error'](_0xac4c('0xe'),_0x3e35fa,JSON[_0xac4c('0x24')](_0x166102));_0x1600aa[_0xac4c('0x10')]();});}else{_0x1600aa[_0xac4c('0x10')]();}});}}catch(_0x5ddbac){logger[_0xac4c('0x2d')](_0xac4c('0xe'),_0x3e35fa,JSON[_0xac4c('0x24')](_0x5ddbac));_0x1600aa['stop']();}};}; \ No newline at end of file +var _0xeb5c=['[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','body','create','then','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','error','amazonlex','providerName','providerResponse','Message','Failed','catch','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x4cccd5,_0x132546){var _0xed26df=function(_0x12bbea){while(--_0x12bbea){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0xed26df(++_0x132546);}(_0xeb5c,0xd4));var _0xceb5=function(_0x4789e5,_0x2d7e4d){_0x4789e5=_0x4789e5-0x0;var _0x4f2bac=_0xeb5c[_0x4789e5];return _0x4f2bac;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xceb5('0x0'));var utils=require('./utils');var logger=require(_0xceb5('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xceb5('0x2')),'mailMessage':require(_0xceb5('0x3')),'smsMessage':require(_0xceb5('0x4')),'faxMessage':require(_0xceb5('0x5')),'whatsappMessage':require(_0xceb5('0x6'))};exports[_0xceb5('0x7')]=function(_0x44cc8a,_0x1b949e){return function(_0x19a133){try{if(!_['isNil'](this['interaction']['UserId'])){logger['info'](_0xceb5('0x8'),_0x44cc8a,_0xceb5('0x9'));return _0x19a133[_0xceb5('0xa')]();}var _0x17fa55={'ContactId':this[_0xceb5('0xb')]['id'],'sentAt':moment()[_0xceb5('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xceb5('0xd')]===_0xceb5('0xe')||this[_0xceb5('0xd')]===_0xceb5('0xf')){_0x17fa55[_0xceb5('0x10')]=this[_0xceb5('0x11')]['phone'];}var _0x869e37=this['channel'];if(_0x869e37===_0xceb5('0x12')){_0x17fa55[_0xceb5('0x13')]=this[_0xceb5('0x14')]['id'];}else{_0x17fa55[_['upperFirst'](_0x869e37)+_0xceb5('0x15')]=this[_0xceb5('0x14')]['id'];}_0x17fa55[_[_0xceb5('0x16')](_0x869e37)+_0xceb5('0x17')]=this[_0xceb5('0x11')]['id'];if(this[_0xceb5('0x11')][_0xceb5('0x18')]){var _0x47f86e=_0x1b949e[0x4];if(!_['isEmpty'](_0x47f86e)){_0x17fa55[_0xceb5('0x19')]=utils['getMustacheRender'](_0x47f86e,this);return rpc[_0x869e37+'Message'][_0xceb5('0x1a')](_0x17fa55)[_0xceb5('0x1b')](function(_0x2753f3){logger['info']('[%s][AMAZONLEX]\x20%s',_0x44cc8a,_0x17fa55[_0xceb5('0x19')]);})['catch'](function(_0x5413ef){logger['error']('[%s][AMAZONLEX]\x20%s',_0x44cc8a,JSON[_0xceb5('0x1c')](_0x5413ef));})[_0xceb5('0x1d')](function(){logger[_0xceb5('0x1e')](_0xceb5('0x1f'),_0x44cc8a);_0x19a133[_0xceb5('0x20')]();});}else{logger[_0xceb5('0x1e')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x44cc8a);_0x19a133[_0xceb5('0x20')]();}}else{var _0x13f68d=this;var _0xa991f4=new AWS[(_0xceb5('0x21'))]({'accessKeyId':_0x1b949e[0x0],'secretAccessKey':_0x1b949e[0x1],'region':_0x1b949e[0x2]});var _0x2d2bb5={'botAlias':'$LATEST','botName':_0x1b949e[0x3],'inputText':this[_0xceb5('0x22')][_0xceb5('0x19')],'userId':this['channel']+':'+this[_0xceb5('0x11')]['id'][_0xceb5('0x23')]()};_0xa991f4[_0xceb5('0x24')](_0x2d2bb5,function(_0x260ca2,_0x17560a){if(_0x260ca2){logger[_0xceb5('0x25')]('[%s][AMAZONLEX]\x20%s',_0x44cc8a,_0x260ca2[_0xceb5('0x22')]);_0x19a133[_0xceb5('0xa')]();}else if(_0x17560a&&_0x17560a[_0xceb5('0x22')]){_0x13f68d['body'][_0xceb5('0x26')]=_0x17560a;_0x17fa55[_0xceb5('0x19')]=_0x17560a[_0xceb5('0x22')];_0x17fa55[_0xceb5('0x27')]=_0xceb5('0x26');_0x17fa55[_0xceb5('0x28')]=JSON[_0xceb5('0x1c')](_0x17560a);return rpc[_0x869e37+_0xceb5('0x29')][_0xceb5('0x1a')](_0x17fa55)[_0xceb5('0x1b')](function(_0x150f98){logger[_0xceb5('0x1e')](_0xceb5('0x8'),_0x44cc8a,_0x17fa55[_0xceb5('0x19')]);if(_0x17560a['dialogState']==_0xceb5('0x2a')){_0x19a133[_0xceb5('0xa')]();}else{_0x19a133[_0xceb5('0x20')]();}})[_0xceb5('0x2b')](function(_0x1e2faa){logger[_0xceb5('0x25')](_0xceb5('0x8'),_0x44cc8a,JSON[_0xceb5('0x1c')](_0x1e2faa));_0x19a133[_0xceb5('0xa')]();});}else{_0x19a133[_0xceb5('0xa')]();}});}}catch(_0x48fd79){logger[_0xceb5('0x25')](_0xceb5('0x8'),_0x44cc8a,JSON[_0xceb5('0x1c')](_0x48fd79));_0x19a133['stop']();}};}; \ 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 0510f80..5c405b0 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 _0x513c=['consequence','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','body','message','from','phone','subject','startsWith','chat','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','replace','','auto-replied','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc'];(function(_0x307c87,_0x207072){var _0x27f38d=function(_0x5a9ad7){while(--_0x5a9ad7){_0x307c87['push'](_0x307c87['shift']());}};_0x27f38d(++_0x207072);}(_0x513c,0xfd));var _0xc513=function(_0x1a2d37,_0x19cd85){_0x1a2d37=_0x1a2d37-0x0;var _0x4d5e76=_0x513c[_0x1a2d37];return _0x4d5e76;};'use strict';var _=require(_0xc513('0x0'));var moment=require(_0xc513('0x1'));var utils=require(_0xc513('0x2'));var logger=require(_0xc513('0x3'))('routing');var rpc={'chatMessage':require(_0xc513('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc513('0x5')),'smsMessage':require(_0xc513('0x6')),'faxMessage':require(_0xc513('0x7')),'whatsappMessage':require(_0xc513('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xc513('0x9')),'mailInteraction':require(_0xc513('0xa')),'smsInteraction':require(_0xc513('0xb')),'faxInteraction':require(_0xc513('0xc')),'whatsappInteraction':require(_0xc513('0xd'))};var mailRpc=require(_0xc513('0xe'));exports[_0xc513('0xf')]=function(_0x497ebe,_0x538711,_0x23748a,_0x182954){return function(_0x2019be){try{var _0x2c7ea0=this['channel'];if(_0x2c7ea0==='mail'&&_0x182954['body']['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0x497ebe,_0xc513('0x10'));return _0x2019be[_0xc513('0x11')]();}if(_0x538711[0x0]==='1'&&(_[_0xc513('0x12')](this[_0xc513('0x13')][_0xc513('0x14')])||!this[_0xc513('0x13')][_0xc513('0x14')])){logger[_0xc513('0x15')]('[%s][AUTOREPLY]\x20%s',_0x497ebe,_0xc513('0x16'));return _0x2019be[_0xc513('0x11')]();}if(_0x538711[0x0]==='2'&&this[_0xc513('0x13')][_0xc513('0x17')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x497ebe,_0xc513('0x18'));return _0x2019be[_0xc513('0x11')]();}var _0x3eaf85={'ContactId':this[_0xc513('0x19')]['id'],'sentAt':moment()[_0xc513('0x1a')](_0xc513('0x1b')),'direction':_0xc513('0x1c')};if(this[_0xc513('0x1d')]===_0xc513('0x1e')){_0x3eaf85['body']=utils[_0xc513('0x1f')](_0x538711[0x2],this);}else{_0x3eaf85[_0xc513('0x20')]=utils[_0xc513('0x1f')](_0x538711[0x1],this);}if(this[_0xc513('0x21')]){_0x3eaf85['to']=this[_0xc513('0x21')]['from']||'';if(this[_0xc513('0x1d')]===_0xc513('0x1e')&&_0x538711[0x1]==='1'){_0x3eaf85['cc']=this['message']['cc']||'';}_0x3eaf85[_0xc513('0x22')]=this[_0xc513('0x21')]['to']||'';_0x3eaf85[_0xc513('0x23')]=this['message']['phone']||'';_0x3eaf85['read']=!![];if(this[_0xc513('0x21')][_0xc513('0x24')]){_0x3eaf85[_0xc513('0x24')]='';_0x3eaf85[_0xc513('0x24')]+=_[_0xc513('0x25')](this[_0xc513('0x21')][_0xc513('0x24')],'Re:')?'':'Re:\x20';_0x3eaf85[_0xc513('0x24')]+=this[_0xc513('0x21')][_0xc513('0x24')];}}if(this['channel']===_0xc513('0x26')){_0x3eaf85['ChatWebsiteId']=this[_0xc513('0x27')]['id'];}else{_0x3eaf85[_['upperFirst'](this[_0xc513('0x1d')])+_0xc513('0x28')]=this[_0xc513('0x27')]['id'];}_0x3eaf85[_[_0xc513('0x29')](this[_0xc513('0x1d')])+'InteractionId']=this[_0xc513('0x13')]['id'];var _0x23f866=this[_0xc513('0x13')];if(rpc[this[_0xc513('0x1d')]+_0xc513('0x2a')]){if(this[_0xc513('0x1d')]===_0xc513('0x1e')){_0x3eaf85[_0xc513('0x2b')]=this['message'][_0xc513('0x2c')];_0x3eaf85[_0xc513('0x2d')]=''+_[_0xc513('0x2e')](_0x3eaf85[_0xc513('0x20')],_0xc513('0x2f'),_0xc513('0x30'))+_0xc513('0x31');_0x3eaf85['headers']={'Auto-Submitted':_0xc513('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0xc513('0x33')};return mailRpc['sendMailMessage'](this[_0xc513('0x27')][_0xc513('0x34')],_0x3eaf85)[_0xc513('0x35')](function(_0x406742){logger[_0xc513('0x15')](_0xc513('0x36'),_0x497ebe);_0x3eaf85['messageId']=_0x406742[_0xc513('0x21')][_0xc513('0x2c')];return rpc[_0x2c7ea0+'Message'][_0xc513('0x37')](_0x3eaf85);})[_0xc513('0x35')](function(_0x11e808){logger['info']('[%s][AUTOREPLY]\x20%s',_0x497ebe,JSON[_0xc513('0x38')](_0x11e808));})[_0xc513('0x39')](function(_0x5bb837){logger[_0xc513('0x3a')]('[RPC][%s][AUTOREPLY]\x20%s',_0x497ebe,JSON[_0xc513('0x38')](_0x5bb837));})[_0xc513('0x3b')](function(){Promise[_0xc513('0x3c')]()[_0xc513('0x35')](function(){if(_0x538711[0x0]!=='2'||_0x23f866['autoreplyExecuted'])return;return rpc[_0x2c7ea0+_0xc513('0x3d')][_0xc513('0x3e')](_0x23f866['id'],{'autoreplyExecuted':!![]})['then'](function(_0x40fe9b){logger[_0xc513('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x497ebe,JSON[_0xc513('0x38')](_0x40fe9b));})['catch'](function(_0x4f09a8){logger[_0xc513('0x3a')](_0xc513('0x3f'),_0x497ebe,JSON[_0xc513('0x38')](_0x4f09a8));});})['then'](function(){_0x2019be[_0xc513('0x11')]();});});}else{return rpc[this[_0xc513('0x1d')]+'Message'][_0xc513('0x37')](_0x3eaf85)[_0xc513('0x35')](function(){logger[_0xc513('0x15')](_0xc513('0x40'),_0x497ebe,_0x3eaf85[_0xc513('0x20')]);})[_0xc513('0x39')](function(_0x1b2b84){logger[_0xc513('0x3a')](_0xc513('0x40'),_0x497ebe,JSON[_0xc513('0x38')](_0x1b2b84));})[_0xc513('0x3b')](function(){Promise[_0xc513('0x3c')]()[_0xc513('0x35')](function(){if(_0x538711[0x0]!=='2'||_0x23f866['autoreplyExecuted'])return;return rpc[_0x2c7ea0+_0xc513('0x3d')][_0xc513('0x3e')](_0x23f866['id'],{'autoreplyExecuted':!![]})[_0xc513('0x35')](function(_0x3de982){logger['info'](_0xc513('0x41'),_0x497ebe,JSON['stringify'](_0x3de982));})['catch'](function(_0x472dfe){logger[_0xc513('0x3a')](_0xc513('0x3f'),_0x497ebe,JSON['stringify'](_0x472dfe));});})[_0xc513('0x35')](function(){_0x2019be['next']();});});}}}catch(_0x1fcdf6){logger[_0xc513('0x3a')](_0xc513('0x40'),_0x497ebe,JSON[_0xc513('0x38')](_0x1fcdf6));_0x2019be[_0xc513('0x42')]();}};}; \ No newline at end of file +var _0xeda0=['upperFirst','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','update','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','channel','mail','body','isAutoreply','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','AccountId'];(function(_0xdfa1fa,_0xcb1c94){var _0x20fb4a=function(_0x686c21){while(--_0x686c21){_0xdfa1fa['push'](_0xdfa1fa['shift']());}};_0x20fb4a(++_0xcb1c94);}(_0xeda0,0xf2));var _0x0eda=function(_0x2cb100,_0x18a32f){_0x2cb100=_0x2cb100-0x0;var _0x248758=_0xeda0[_0x2cb100];return _0x248758;};'use strict';var _=require(_0x0eda('0x0'));var moment=require(_0x0eda('0x1'));var utils=require(_0x0eda('0x2'));var logger=require('../../../../config/logger')(_0x0eda('0x3'));var rpc={'chatMessage':require(_0x0eda('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0eda('0x5')),'smsMessage':require(_0x0eda('0x6')),'faxMessage':require(_0x0eda('0x7')),'whatsappMessage':require(_0x0eda('0x8')),'chatInteraction':require(_0x0eda('0x9')),'openchannelInteraction':require(_0x0eda('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x0eda('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0eda('0xc'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x755ffd,_0xffbc22,_0x3fb0c8,_0x2d1c40){return function(_0x5d5c1c){try{var _0x526e2e=this[_0x0eda('0xd')];if(_0x526e2e===_0x0eda('0xe')&&_0x2d1c40[_0x0eda('0xf')][_0x0eda('0x10')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0x755ffd,_0x0eda('0x11'));return _0x5d5c1c[_0x0eda('0x12')]();}if(_0xffbc22[0x0]==='1'&&(_[_0x0eda('0x13')](this[_0x0eda('0x14')][_0x0eda('0x15')])||!this[_0x0eda('0x14')]['created'])){logger[_0x0eda('0x16')](_0x0eda('0x17'),_0x755ffd,_0x0eda('0x18'));return _0x5d5c1c['next']();}if(_0xffbc22[0x0]==='2'&&this['interaction'][_0x0eda('0x19')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x755ffd,_0x0eda('0x1a'));return _0x5d5c1c[_0x0eda('0x12')]();}var _0x4c0144={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0eda('0x1b')](_0x0eda('0x1c')),'direction':_0x0eda('0x1d')};if(this[_0x0eda('0xd')]===_0x0eda('0xe')){_0x4c0144[_0x0eda('0xf')]=utils[_0x0eda('0x1e')](_0xffbc22[0x2],this);}else{_0x4c0144[_0x0eda('0xf')]=utils[_0x0eda('0x1e')](_0xffbc22[0x1],this);}if(this[_0x0eda('0x1f')]){_0x4c0144['to']=this[_0x0eda('0x1f')][_0x0eda('0x20')]||'';if(this[_0x0eda('0xd')]==='mail'&&_0xffbc22[0x1]==='1'){_0x4c0144['cc']=this[_0x0eda('0x1f')]['cc']||'';}_0x4c0144[_0x0eda('0x20')]=this['message']['to']||'';_0x4c0144[_0x0eda('0x21')]=this[_0x0eda('0x1f')]['phone']||'';_0x4c0144[_0x0eda('0x22')]=!![];if(this[_0x0eda('0x1f')][_0x0eda('0x23')]){_0x4c0144[_0x0eda('0x23')]='';_0x4c0144['subject']+=_[_0x0eda('0x24')](this[_0x0eda('0x1f')][_0x0eda('0x23')],_0x0eda('0x25'))?'':_0x0eda('0x26');_0x4c0144[_0x0eda('0x23')]+=this[_0x0eda('0x1f')][_0x0eda('0x23')];}}if(this[_0x0eda('0xd')]===_0x0eda('0x27')){_0x4c0144['ChatWebsiteId']=this[_0x0eda('0x28')]['id'];}else{_0x4c0144[_['upperFirst'](this['channel'])+_0x0eda('0x29')]=this['account']['id'];}_0x4c0144[_[_0x0eda('0x2a')](this[_0x0eda('0xd')])+_0x0eda('0x2b')]=this[_0x0eda('0x14')]['id'];var _0xa06b14=this[_0x0eda('0x14')];if(rpc[this[_0x0eda('0xd')]+_0x0eda('0x2c')]){if(this['channel']===_0x0eda('0xe')){_0x4c0144[_0x0eda('0x2d')]=this[_0x0eda('0x1f')][_0x0eda('0x2e')];_0x4c0144[_0x0eda('0x2f')]=_0x0eda('0x30')+_[_0x0eda('0x31')](_0x4c0144[_0x0eda('0xf')],_0x0eda('0x32'),_0x0eda('0x33'))+_0x0eda('0x34');_0x4c0144[_0x0eda('0x35')]={'Auto-Submitted':_0x0eda('0x36'),'X-Auto-Response-Suppress':_0x0eda('0x37'),'Precedence':_0x0eda('0x38')};return mailRpc[_0x0eda('0x39')](this['account'][_0x0eda('0x3a')],_0x4c0144)[_0x0eda('0x3b')](function(_0x126035){logger[_0x0eda('0x16')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x755ffd);_0x4c0144['messageId']=_0x126035[_0x0eda('0x1f')][_0x0eda('0x2e')];return rpc[_0x526e2e+_0x0eda('0x2c')]['create'](_0x4c0144);})[_0x0eda('0x3b')](function(_0x304dcd){logger['info']('[%s][AUTOREPLY]\x20%s',_0x755ffd,JSON['stringify'](_0x304dcd));})['catch'](function(_0x37b3b7){logger[_0x0eda('0x3c')](_0x0eda('0x3d'),_0x755ffd,JSON[_0x0eda('0x3e')](_0x37b3b7));})[_0x0eda('0x3f')](function(){Promise['resolve']()[_0x0eda('0x3b')](function(){if(_0xffbc22[0x0]!=='2'||_0xa06b14['autoreplyExecuted'])return;return rpc[_0x526e2e+_0x0eda('0x40')]['update'](_0xa06b14['id'],{'autoreplyExecuted':!![]})[_0x0eda('0x3b')](function(_0x5afa06){logger['info'](_0x0eda('0x41'),_0x755ffd,JSON[_0x0eda('0x3e')](_0x5afa06));})[_0x0eda('0x42')](function(_0x5d1cda){logger[_0x0eda('0x3c')](_0x0eda('0x43'),_0x755ffd,JSON[_0x0eda('0x3e')](_0x5d1cda));});})['then'](function(){_0x5d5c1c[_0x0eda('0x12')]();});});}else{return rpc[this[_0x0eda('0xd')]+'Message']['create'](_0x4c0144)[_0x0eda('0x3b')](function(){logger[_0x0eda('0x16')](_0x0eda('0x17'),_0x755ffd,_0x4c0144[_0x0eda('0xf')]);})['catch'](function(_0x14321b){logger[_0x0eda('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x755ffd,JSON[_0x0eda('0x3e')](_0x14321b));})[_0x0eda('0x3f')](function(){Promise[_0x0eda('0x44')]()[_0x0eda('0x3b')](function(){if(_0xffbc22[0x0]!=='2'||_0xa06b14[_0x0eda('0x19')])return;return rpc[_0x526e2e+'Interaction'][_0x0eda('0x45')](_0xa06b14['id'],{'autoreplyExecuted':!![]})[_0x0eda('0x3b')](function(_0x17a7c6){logger[_0x0eda('0x16')](_0x0eda('0x41'),_0x755ffd,JSON[_0x0eda('0x3e')](_0x17a7c6));})[_0x0eda('0x42')](function(_0x39b720){logger[_0x0eda('0x3c')](_0x0eda('0x43'),_0x755ffd,JSON['stringify'](_0x39b720));});})[_0x0eda('0x3b')](function(){_0x5d5c1c[_0x0eda('0x12')]();});});}}}catch(_0x167089){logger[_0x0eda('0x3c')](_0x0eda('0x17'),_0x755ffd,JSON[_0x0eda('0x3e')](_0x167089));_0x5d5c1c[_0x0eda('0x46')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 79029fe..cc1a75c 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58ce=['error','[%s][CLOSE]\x20%s','finally','stop','stringify','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch'];(function(_0x1f0c9b,_0x234e61){var _0x1283e6=function(_0x5e157c){while(--_0x5e157c){_0x1f0c9b['push'](_0x1f0c9b['shift']());}};_0x1283e6(++_0x234e61);}(_0x58ce,0x16d));var _0xe58c=function(_0x102566,_0x23f996){_0x102566=_0x102566-0x0;var _0x4e89ef=_0x58ce[_0x102566];return _0x4e89ef;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0xe58c('0x0'));var rpc={'chatInteraction':require(_0xe58c('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe58c('0x2')),'mailInteraction':require(_0xe58c('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0xb8575,_0x4cfdee,_0x657a27,_0x4d6a37){return function(_0x4c6c23){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0xb8575,_0x4cfdee[0x0]);var _0x51adf1={'closed':0x1,'closedAt':moment()['format'](_0xe58c('0x4')),'closeReason':_0xe58c('0x5'),'disposition':_0x4cfdee[0x0]};if(rpc[_0x4d6a37[_0xe58c('0x6')]+'Interaction']){rpc[_0x4d6a37[_0xe58c('0x6')]+_0xe58c('0x7')][_0xe58c('0x8')](_0x4d6a37[_0xe58c('0x9')]['id'],_0x51adf1)[_0xe58c('0xa')](function(_0x1dfc01){logger['info'](_0xe58c('0xb'),_0xb8575,_0x4d6a37[_0xe58c('0x9')]['id']);})[_0xe58c('0xc')](function(_0x3a7eef){logger[_0xe58c('0xd')](_0xe58c('0xe'),_0xb8575,JSON['stringify'](_0x3a7eef));})[_0xe58c('0xf')](function(){_0x4c6c23[_0xe58c('0x10')]();});}}catch(_0x4569e6){logger['error'](_0xe58c('0xe'),_0xb8575,JSON[_0xe58c('0x11')](_0x4569e6));_0x4c6c23['stop']();}};}; \ No newline at end of file +var _0xf3b1=['channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x886eba,_0x252981){var _0x2794ea=function(_0xe522a9){while(--_0xe522a9){_0x886eba['push'](_0x886eba['shift']());}};_0x2794ea(++_0x252981);}(_0xf3b1,0x1d9));var _0x1f3b=function(_0x3665b1,_0x5daa7c){_0x3665b1=_0x3665b1-0x0;var _0x1e7930=_0xf3b1[_0x3665b1];return _0x1e7930;};'use strict';var moment=require(_0x1f3b('0x0'));var logger=require('../../../../config/logger')(_0x1f3b('0x1'));var rpc={'chatInteraction':require(_0x1f3b('0x2')),'openchannelInteraction':require(_0x1f3b('0x3')),'smsInteraction':require(_0x1f3b('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1f3b('0x5'))};exports['consequence']=function(_0x3f68b3,_0x324d29,_0x5c0421,_0x52d436){return function(_0x194e3b){try{logger[_0x1f3b('0x6')](_0x1f3b('0x7'),_0x3f68b3,_0x324d29[0x0]);var _0x371a87={'closed':0x1,'closedAt':moment()[_0x1f3b('0x8')](_0x1f3b('0x9')),'closeReason':_0x1f3b('0xa'),'disposition':_0x324d29[0x0]};if(rpc[_0x52d436[_0x1f3b('0xb')]+_0x1f3b('0xc')]){rpc[_0x52d436[_0x1f3b('0xb')]+_0x1f3b('0xc')][_0x1f3b('0xd')](_0x52d436['interaction']['id'],_0x371a87)['then'](function(_0x42e6fd){logger[_0x1f3b('0x6')](_0x1f3b('0xe'),_0x3f68b3,_0x52d436[_0x1f3b('0xf')]['id']);})[_0x1f3b('0x10')](function(_0x4d704e){logger[_0x1f3b('0x11')](_0x1f3b('0x12'),_0x3f68b3,JSON['stringify'](_0x4d704e));})[_0x1f3b('0x13')](function(){_0x194e3b[_0x1f3b('0x14')]();});}}catch(_0x417c82){logger[_0x1f3b('0x11')](_0x1f3b('0x12'),_0x3f68b3,JSON[_0x1f3b('0x15')](_0x417c82));_0x194e3b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 1d38eb8..1bdf845 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf52f=['upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','fulfillment','speech','providerName','dialogflow','providerResponse','stringify','Message','create','metadata','endConversation','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone'];(function(_0x22a75d,_0x246ad1){var _0x4bce80=function(_0x1f2be2){while(--_0x1f2be2){_0x22a75d['push'](_0x22a75d['shift']());}};_0x4bce80(++_0x246ad1);}(_0xf52f,0x113));var _0xff52=function(_0xdcbb99,_0x5af4ca){_0xdcbb99=_0xdcbb99-0x0;var _0x55ca74=_0xf52f[_0xdcbb99];return _0x55ca74;};'use strict';var _=require(_0xff52('0x0'));var moment=require(_0xff52('0x1'));var apiai=require(_0xff52('0x2'));var md5=require('md5');var utils=require(_0xff52('0x3'));var logger=require(_0xff52('0x4'))(_0xff52('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xff52('0x6')),'mailMessage':require(_0xff52('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xff52('0x8')),'whatsappMessage':require(_0xff52('0x9'))};exports[_0xff52('0xa')]=function(_0x328920,_0x64f10b){return function(_0x17af4a){try{if(!_[_0xff52('0xb')](this[_0xff52('0xc')][_0xff52('0xd')])){logger[_0xff52('0xe')](_0xff52('0xf'),_0x328920,_0xff52('0x10'));return _0x17af4a[_0xff52('0x11')]();}var _0x1fbcab={'ContactId':this[_0xff52('0x12')]['id'],'sentAt':moment()[_0xff52('0x13')](_0xff52('0x14')),'direction':_0xff52('0x15')};if(this[_0xff52('0x16')]==='sms'||this['channel']===_0xff52('0x17')){_0x1fbcab['phone']=this[_0xff52('0xc')][_0xff52('0x18')];}var _0x1b87c8=this[_0xff52('0x16')];if(_0x1b87c8==='chat'){_0x1fbcab['ChatWebsiteId']=this['account']['id'];}else{_0x1fbcab[_[_0xff52('0x19')](_0x1b87c8)+'AccountId']=this['account']['id'];}_0x1fbcab[_[_0xff52('0x19')](_0x1b87c8)+_0xff52('0x1a')]=this[_0xff52('0xc')]['id'];if(this[_0xff52('0xc')][_0xff52('0x1b')]){var _0x52735f=_0x64f10b[0x2];if(!_[_0xff52('0x1c')](_0x52735f)){_0x1fbcab['body']=utils[_0xff52('0x1d')](_0x52735f,this);return rpc[_0x1b87c8+'Message']['create'](_0x1fbcab)[_0xff52('0x1e')](function(_0x28601f){logger[_0xff52('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x328920,_0x1fbcab['body']);})[_0xff52('0x1f')](function(_0x412d2a){logger[_0xff52('0x20')](_0xff52('0xf'),_0x328920,JSON['stringify'](_0x412d2a));})[_0xff52('0x21')](function(){logger[_0xff52('0xe')](_0xff52('0x22'),_0x328920);_0x17af4a[_0xff52('0x23')]();});}else{logger[_0xff52('0xe')](_0xff52('0x24'),_0x328920);_0x17af4a[_0xff52('0x23')]();}}else{var _0x176c10=this;var _0x5eb3f9=apiai(_0x64f10b[0x0],{'language':_0x64f10b[0x1]||'en'});return _0x5eb3f9[_0xff52('0x25')](this[_0xff52('0x26')]['body'],{'sessionId':md5(this[_0xff52('0xc')]['id'])})[_0xff52('0x1e')](function(_0x4b8157){_0x176c10[_0xff52('0x27')]['dialogflow']=_0x4b8157;_0x1fbcab['body']=_0x4b8157['result'][_0xff52('0x28')][_0xff52('0x29')];_0x1fbcab[_0xff52('0x2a')]=_0xff52('0x2b');_0x1fbcab[_0xff52('0x2c')]=JSON[_0xff52('0x2d')](_0x4b8157);return rpc[_0x1b87c8+_0xff52('0x2e')][_0xff52('0x2f')](_0x1fbcab)[_0xff52('0x1e')](function(_0x16143f){logger['info'](_0xff52('0xf'),_0x328920,_0x1fbcab[_0xff52('0x27')]);if(_0x4b8157['result'][_0xff52('0x30')][_0xff52('0x31')]){_0x17af4a[_0xff52('0x11')]();}else{_0x17af4a[_0xff52('0x23')]();}})[_0xff52('0x1f')](function(_0x51d708){logger[_0xff52('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x328920,JSON[_0xff52('0x2d')](_0x51d708));_0x17af4a[_0xff52('0x11')]();});})[_0xff52('0x1f')](function(_0x4743d6){logger[_0xff52('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x328920,_0x4743d6['message']);_0x17af4a[_0xff52('0x11')]();});}}catch(_0x347d75){logger[_0xff52('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x328920,JSON[_0xff52('0x2d')](_0x347d75));_0x17af4a['stop']();}};}; \ No newline at end of file +var _0xdf55=['YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','account','InteractionId','isEmpty','getMustacheRender','Message','create','then','body','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','speech','providerName','providerResponse','result','endConversation','next','catch','lodash','moment','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','format'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0xdf55,0x83));var _0x5df5=function(_0x28ac84,_0x2a75fa){_0x28ac84=_0x28ac84-0x0;var _0x10c42a=_0xdf55[_0x28ac84];return _0x10c42a;};'use strict';var _=require(_0x5df5('0x0'));var moment=require(_0x5df5('0x1'));var apiai=require('apiai-promise');var md5=require(_0x5df5('0x2'));var utils=require(_0x5df5('0x3'));var logger=require('../../../../config/logger')(_0x5df5('0x4'));var rpc={'chatMessage':require(_0x5df5('0x5')),'openchannelMessage':require(_0x5df5('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5df5('0x7')),'faxMessage':require(_0x5df5('0x8')),'whatsappMessage':require(_0x5df5('0x9'))};exports[_0x5df5('0xa')]=function(_0x9b8756,_0x2b7ed9){return function(_0x4722a2){try{if(!_[_0x5df5('0xb')](this['interaction'][_0x5df5('0xc')])){logger[_0x5df5('0xd')](_0x5df5('0xe'),_0x9b8756,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4722a2['next']();}var _0x39711b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5df5('0xf')](_0x5df5('0x10')),'direction':'out'};if(this['channel']===_0x5df5('0x11')||this[_0x5df5('0x12')]===_0x5df5('0x13')){_0x39711b[_0x5df5('0x14')]=this[_0x5df5('0x15')][_0x5df5('0x14')];}var _0x37a747=this[_0x5df5('0x12')];if(_0x37a747===_0x5df5('0x16')){_0x39711b[_0x5df5('0x17')]=this['account']['id'];}else{_0x39711b[_[_0x5df5('0x18')](_0x37a747)+'AccountId']=this[_0x5df5('0x19')]['id'];}_0x39711b[_[_0x5df5('0x18')](_0x37a747)+_0x5df5('0x1a')]=this[_0x5df5('0x15')]['id'];if(this[_0x5df5('0x15')]['created']){var _0x27b3fb=_0x2b7ed9[0x2];if(!_[_0x5df5('0x1b')](_0x27b3fb)){_0x39711b['body']=utils[_0x5df5('0x1c')](_0x27b3fb,this);return rpc[_0x37a747+_0x5df5('0x1d')][_0x5df5('0x1e')](_0x39711b)[_0x5df5('0x1f')](function(_0x215d59){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x9b8756,_0x39711b[_0x5df5('0x20')]);})['catch'](function(_0x58152a){logger[_0x5df5('0x21')](_0x5df5('0xe'),_0x9b8756,JSON[_0x5df5('0x22')](_0x58152a));})[_0x5df5('0x23')](function(){logger['info'](_0x5df5('0x24'),_0x9b8756);_0x4722a2[_0x5df5('0x25')]();});}else{logger[_0x5df5('0xd')](_0x5df5('0x26'),_0x9b8756);_0x4722a2[_0x5df5('0x25')]();}}else{var _0x382999=this;var _0x59ff67=apiai(_0x2b7ed9[0x0],{'language':_0x2b7ed9[0x1]||'en'});return _0x59ff67[_0x5df5('0x27')](this[_0x5df5('0x28')][_0x5df5('0x20')],{'sessionId':md5(this[_0x5df5('0x15')]['id'])})['then'](function(_0x4358ba){_0x382999[_0x5df5('0x20')][_0x5df5('0x29')]=_0x4358ba;_0x39711b['body']=_0x4358ba['result']['fulfillment'][_0x5df5('0x2a')];_0x39711b[_0x5df5('0x2b')]=_0x5df5('0x29');_0x39711b[_0x5df5('0x2c')]=JSON[_0x5df5('0x22')](_0x4358ba);return rpc[_0x37a747+_0x5df5('0x1d')][_0x5df5('0x1e')](_0x39711b)[_0x5df5('0x1f')](function(_0x52fbe3){logger[_0x5df5('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x9b8756,_0x39711b[_0x5df5('0x20')]);if(_0x4358ba[_0x5df5('0x2d')]['metadata'][_0x5df5('0x2e')]){_0x4722a2['next']();}else{_0x4722a2[_0x5df5('0x25')]();}})['catch'](function(_0x2e1885){logger['error'](_0x5df5('0xe'),_0x9b8756,JSON['stringify'](_0x2e1885));_0x4722a2[_0x5df5('0x2f')]();});})[_0x5df5('0x30')](function(_0x4784ca){logger['error'](_0x5df5('0xe'),_0x9b8756,_0x4784ca[_0x5df5('0x28')]);_0x4722a2[_0x5df5('0x2f')]();});}}catch(_0x2d53e5){logger[_0x5df5('0x21')](_0x5df5('0xe'),_0x9b8756,JSON[_0x5df5('0x22')](_0x2d53e5));_0x4722a2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index acfa0c6..8274b3e 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dc7=['[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','getMustacheRender','then','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','stack','lodash','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info'];(function(_0x3823ae,_0xc04a15){var _0x7be017=function(_0x37d2c5){while(--_0x37d2c5){_0x3823ae['push'](_0x3823ae['shift']());}};_0x7be017(++_0xc04a15);}(_0x3dc7,0x19b));var _0x73dc=function(_0x5c72b3,_0x3d4ed3){_0x5c72b3=_0x5c72b3-0x0;var _0x2e2a9f=_0x3dc7[_0x5c72b3];return _0x2e2a9f;};'use strict';var _=require(_0x73dc('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x73dc('0x1'));var Promise=require(_0x73dc('0x2'));var logger=require(_0x73dc('0x3'))('routing');var utils=require(_0x73dc('0x4'));var rpc={'chatMessage':require(_0x73dc('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x73dc('0x6')),'smsMessage':require(_0x73dc('0x7')),'faxMessage':require(_0x73dc('0x8')),'whatsappMessage':require(_0x73dc('0x9'))};function createMessage(_0x2e7707,_0x141d99,_0x4cdb31,_0x5cfa36){return new Promise(function(_0x57ba19,_0x7dbc11){var _0x19a524=_[_0x73dc('0xa')](_0x4cdb31);_0x19a524[_0x73dc('0xb')]=_0x5cfa36;return rpc[_0x141d99+_0x73dc('0xc')][_0x73dc('0xd')](_0x19a524)['then'](function(){logger[_0x73dc('0xe')](_0x73dc('0xf'),_0x2e7707,_0x19a524[_0x73dc('0xb')]);_0x57ba19();})['catch'](function(_0x21277a){logger['error'](_0x73dc('0xf'),_0x2e7707,JSON[_0x73dc('0x10')](_0x21277a));_0x7dbc11(_0x21277a);});});}exports[_0x73dc('0x11')]=function(_0x96da9d,_0x560f28){return function(_0x3b0022){try{if(!_[_0x73dc('0x12')](this['interaction'][_0x73dc('0x13')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x96da9d,_0x73dc('0x14'));return _0x3b0022[_0x73dc('0x15')]();}var _0x5af66e={'ContactId':this[_0x73dc('0x16')]['id'],'sentAt':moment()['format'](_0x73dc('0x17')),'direction':'out'};if(this['channel']===_0x73dc('0x18')||this[_0x73dc('0x19')]===_0x73dc('0x1a')){_0x5af66e[_0x73dc('0x1b')]=this['interaction'][_0x73dc('0x1b')];}var _0x473731=this[_0x73dc('0x19')];if(_0x473731===_0x73dc('0x1c')){_0x5af66e[_0x73dc('0x1d')]=this['account']['id'];}else{_0x5af66e[_[_0x73dc('0x1e')](_0x473731)+_0x73dc('0x1f')]=this['account']['id'];}_0x5af66e[_['upperFirst'](_0x473731)+_0x73dc('0x20')]=this[_0x73dc('0x21')]['id'];if(this['interaction'][_0x73dc('0x22')]){var _0x3b91da=_0x560f28[0x4];if(!_[_0x73dc('0x23')](_0x3b91da)){_0x5af66e[_0x73dc('0xb')]=utils[_0x73dc('0x24')](_0x3b91da,this);return rpc[_0x473731+'Message']['create'](_0x5af66e)[_0x73dc('0x25')](function(_0x5bbc76){logger[_0x73dc('0xe')](_0x73dc('0xf'),_0x96da9d,_0x5af66e['body']);})[_0x73dc('0x26')](function(_0x258a22){logger[_0x73dc('0x27')](_0x73dc('0xf'),_0x96da9d,JSON['stringify'](_0x258a22));})[_0x73dc('0x28')](function(){logger[_0x73dc('0xe')](_0x73dc('0x29'),_0x96da9d);_0x3b0022['stop']();});}else{logger[_0x73dc('0xe')](_0x73dc('0x2a'),_0x96da9d);_0x3b0022[_0x73dc('0x2b')]();}}else{var _0x99ff86=this;var _0x37bdae=_0x560f28[0x2]['replace'](/\\n/g,'\x0a');var _0x59cd1b={'credentials':{'private_key':_0x37bdae,'client_email':_0x560f28[0x1]}};var _0x4ccb6e=new dialogflow[(_0x73dc('0x2c'))](_0x59cd1b);var _0x20be68=_0x4ccb6e[_0x73dc('0x2d')](_0x560f28[0x0],md5(_0x99ff86[_0x73dc('0x21')]['id']));var _0x3f98d5={'session':_0x20be68,'queryInput':{'text':{'text':_0x99ff86[_0x73dc('0x2e')][_0x73dc('0xb')],'languageCode':_0x560f28[0x3]||'en'}}};return _0x4ccb6e[_0x73dc('0x2f')](_0x3f98d5)[_0x73dc('0x25')](function(_0x5a191e){if(_0x5a191e&&_0x5a191e[_0x73dc('0x30')]){_0x99ff86[_0x73dc('0xb')]['dialogflowV2']=_0x5a191e;var _0x5791a9=_0x5a191e[0x0];var _0x24d703=_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')]&&_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')]['fields']?_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')][_0x73dc('0x33')]['end_conversation'][_0x73dc('0x34')]:![];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x35')]=_0x5791a9[_0x73dc('0x31')]['action'];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x36')]=_0x5791a9['queryResult']['allRequiredParamsPresent'];_0x99ff86['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')]&&_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')][_0x73dc('0x33')]?_0x5791a9[_0x73dc('0x31')][_0x73dc('0x32')]['fields']['end_conversation'][_0x73dc('0x34')]:![];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x37')]=_0x5791a9['queryResult'][_0x73dc('0x38')][_0x73dc('0x39')];_0x99ff86['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5791a9[_0x73dc('0x31')]['intent'][_0x73dc('0x3a')];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x3b')]=_0x5791a9['queryResult']['intent']['isFallback'];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x3c')]=_0x5791a9[_0x73dc('0x31')][_0x73dc('0x3d')];_0x99ff86[_0x73dc('0xb')]['DIALOGFLOWV2_QUERYTEXT']=_0x5791a9[_0x73dc('0x31')]['queryText'];_0x99ff86[_0x73dc('0xb')][_0x73dc('0x3e')]=_0x5791a9[_0x73dc('0x31')][_0x73dc('0x3f')];_0x5af66e[_0x73dc('0x40')]=_0x73dc('0x41');_0x5af66e[_0x73dc('0x42')]=JSON[_0x73dc('0x10')](_0x5a191e);var _0x1d045f=[];for(var _0x473bbf=0x0;_0x473bbf<_0x5a191e[_0x73dc('0x30')];_0x473bbf++){var _0x46db60=_0x5a191e[_0x473bbf];if(_0x46db60&&_0x46db60[_0x73dc('0x31')]&&_0x46db60[_0x73dc('0x31')][_0x73dc('0x43')]){_0x1d045f[_0x73dc('0x44')](createMessage(_0x96da9d,_0x473731,_0x5af66e,_0x46db60[_0x73dc('0x31')][_0x73dc('0x43')]));}}return Promise[_0x73dc('0x45')](_0x1d045f)[_0x73dc('0x25')](function(){if(_0x24d703){_0x3b0022[_0x73dc('0x15')]();}else{_0x3b0022[_0x73dc('0x2b')]();}})[_0x73dc('0x26')](function(_0x134a5e){logger[_0x73dc('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x96da9d,JSON[_0x73dc('0x10')](_0x134a5e));_0x3b0022[_0x73dc('0x15')]();});}})['catch'](function(_0x2e34d3){logger[_0x73dc('0x27')](_0x73dc('0xf'),_0x96da9d,_0x2e34d3[_0x73dc('0x2e')],_0x2e34d3[_0x73dc('0x46')]);_0x3b0022[_0x73dc('0x15')]();});}}catch(_0x54cce5){logger[_0x73dc('0x27')](_0x73dc('0xf'),_0x96da9d,JSON[_0x73dc('0x10')](_0x54cce5));_0x3b0022[_0x73dc('0x2b')]();}};}; \ No newline at end of file +var _0x20e3=['dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','push','fulfillmentText','all','stack','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length'];(function(_0xa9fde0,_0x11953c){var _0x3961c8=function(_0x556508){while(--_0x556508){_0xa9fde0['push'](_0xa9fde0['shift']());}};_0x3961c8(++_0x11953c);}(_0x20e3,0xb3));var _0x320e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x20e3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x320e('0x0'));var dialogflow=require(_0x320e('0x1'));var md5=require(_0x320e('0x2'));var moment=require(_0x320e('0x3'));var Promise=require(_0x320e('0x4'));var logger=require(_0x320e('0x5'))(_0x320e('0x6'));var utils=require(_0x320e('0x7'));var rpc={'chatMessage':require(_0x320e('0x8')),'openchannelMessage':require(_0x320e('0x9')),'mailMessage':require(_0x320e('0xa')),'smsMessage':require(_0x320e('0xb')),'faxMessage':require(_0x320e('0xc')),'whatsappMessage':require(_0x320e('0xd'))};function createMessage(_0x552e8c,_0x477005,_0x5ef778,_0x12f3a7){return new Promise(function(_0x2db85a,_0x51a31f){var _0x386aec=_[_0x320e('0xe')](_0x5ef778);_0x386aec[_0x320e('0xf')]=_0x12f3a7;return rpc[_0x477005+'Message'][_0x320e('0x10')](_0x386aec)[_0x320e('0x11')](function(){logger[_0x320e('0x12')](_0x320e('0x13'),_0x552e8c,_0x386aec[_0x320e('0xf')]);_0x2db85a();})[_0x320e('0x14')](function(_0x12ed59){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x552e8c,JSON[_0x320e('0x15')](_0x12ed59));_0x51a31f(_0x12ed59);});});}exports[_0x320e('0x16')]=function(_0x4b200b,_0x745b4d){return function(_0x2cd1fd){try{if(!_[_0x320e('0x17')](this[_0x320e('0x18')][_0x320e('0x19')])){logger[_0x320e('0x12')](_0x320e('0x13'),_0x4b200b,_0x320e('0x1a'));return _0x2cd1fd[_0x320e('0x1b')]();}var _0x50f67c={'ContactId':this[_0x320e('0x1c')]['id'],'sentAt':moment()[_0x320e('0x1d')](_0x320e('0x1e')),'direction':'out'};if(this[_0x320e('0x1f')]===_0x320e('0x20')||this[_0x320e('0x1f')]==='whatsapp'){_0x50f67c[_0x320e('0x21')]=this[_0x320e('0x18')]['phone'];}var _0x22ce8b=this[_0x320e('0x1f')];if(_0x22ce8b===_0x320e('0x22')){_0x50f67c[_0x320e('0x23')]=this[_0x320e('0x24')]['id'];}else{_0x50f67c[_[_0x320e('0x25')](_0x22ce8b)+'AccountId']=this[_0x320e('0x24')]['id'];}_0x50f67c[_[_0x320e('0x25')](_0x22ce8b)+_0x320e('0x26')]=this[_0x320e('0x18')]['id'];if(this[_0x320e('0x18')][_0x320e('0x27')]){var _0x2ba2d3=_0x745b4d[0x4];if(!_[_0x320e('0x28')](_0x2ba2d3)){_0x50f67c[_0x320e('0xf')]=utils[_0x320e('0x29')](_0x2ba2d3,this);return rpc[_0x22ce8b+'Message'][_0x320e('0x10')](_0x50f67c)['then'](function(_0x394a4f){logger[_0x320e('0x12')](_0x320e('0x13'),_0x4b200b,_0x50f67c['body']);})[_0x320e('0x14')](function(_0x2699f5){logger[_0x320e('0x2a')](_0x320e('0x13'),_0x4b200b,JSON[_0x320e('0x15')](_0x2699f5));})[_0x320e('0x2b')](function(){logger[_0x320e('0x12')](_0x320e('0x2c'),_0x4b200b);_0x2cd1fd[_0x320e('0x2d')]();});}else{logger[_0x320e('0x12')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4b200b);_0x2cd1fd['stop']();}}else{var _0x174136=this;var _0x342d9b=_0x745b4d[0x2][_0x320e('0x2e')](/\\n/g,'\x0a');var _0x49ae5e={'credentials':{'private_key':_0x342d9b,'client_email':_0x745b4d[0x1]}};var _0x48b6cb=new dialogflow[(_0x320e('0x2f'))](_0x49ae5e);var _0x501453=_0x48b6cb[_0x320e('0x30')](_0x745b4d[0x0],md5(_0x174136['interaction']['id']));var _0x8f121b={'session':_0x501453,'queryInput':{'text':{'text':_0x174136[_0x320e('0x31')]['body'],'languageCode':_0x745b4d[0x3]||'en'}}};return _0x48b6cb[_0x320e('0x32')](_0x8f121b)[_0x320e('0x11')](function(_0x40afb7){if(_0x40afb7&&_0x40afb7[_0x320e('0x33')]){_0x174136[_0x320e('0xf')][_0x320e('0x34')]=_0x40afb7;var _0x3575fa=_0x40afb7[0x0];var _0x535778=_0x3575fa['queryResult']['diagnosticInfo']&&_0x3575fa[_0x320e('0x35')][_0x320e('0x36')][_0x320e('0x37')]?_0x3575fa[_0x320e('0x35')][_0x320e('0x36')][_0x320e('0x37')]['end_conversation'][_0x320e('0x38')]:![];_0x174136[_0x320e('0xf')]['DIALOGFLOWV2_ACTION']=_0x3575fa[_0x320e('0x35')][_0x320e('0x39')];_0x174136[_0x320e('0xf')][_0x320e('0x3a')]=_0x3575fa['queryResult'][_0x320e('0x3b')];_0x174136['body'][_0x320e('0x3c')]=_0x3575fa[_0x320e('0x35')][_0x320e('0x36')]&&_0x3575fa[_0x320e('0x35')][_0x320e('0x36')][_0x320e('0x37')]?_0x3575fa['queryResult']['diagnosticInfo'][_0x320e('0x37')][_0x320e('0x3d')]['boolValue']:![];_0x174136['body'][_0x320e('0x3e')]=_0x3575fa[_0x320e('0x35')]['intent']['name'];_0x174136[_0x320e('0xf')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3575fa['queryResult'][_0x320e('0x3f')][_0x320e('0x40')];_0x174136[_0x320e('0xf')][_0x320e('0x41')]=_0x3575fa['queryResult']['intent'][_0x320e('0x42')];_0x174136[_0x320e('0xf')][_0x320e('0x43')]=_0x3575fa[_0x320e('0x35')][_0x320e('0x44')];_0x174136[_0x320e('0xf')][_0x320e('0x45')]=_0x3575fa[_0x320e('0x35')][_0x320e('0x46')];_0x174136[_0x320e('0xf')][_0x320e('0x47')]=_0x3575fa[_0x320e('0x35')][_0x320e('0x48')];_0x50f67c['providerName']='dialogflowV2';_0x50f67c['providerResponse']=JSON['stringify'](_0x40afb7);var _0x157659=[];for(var _0x54121d=0x0;_0x54121d<_0x40afb7[_0x320e('0x33')];_0x54121d++){var _0x39e358=_0x40afb7[_0x54121d];if(_0x39e358&&_0x39e358[_0x320e('0x35')]&&_0x39e358[_0x320e('0x35')]['fulfillmentText']){_0x157659[_0x320e('0x49')](createMessage(_0x4b200b,_0x22ce8b,_0x50f67c,_0x39e358[_0x320e('0x35')][_0x320e('0x4a')]));}}return Promise[_0x320e('0x4b')](_0x157659)[_0x320e('0x11')](function(){if(_0x535778){_0x2cd1fd[_0x320e('0x1b')]();}else{_0x2cd1fd[_0x320e('0x2d')]();}})[_0x320e('0x14')](function(_0x3b9d8b){logger[_0x320e('0x2a')](_0x320e('0x13'),_0x4b200b,JSON[_0x320e('0x15')](_0x3b9d8b));_0x2cd1fd[_0x320e('0x1b')]();});}})[_0x320e('0x14')](function(_0x254bef){logger[_0x320e('0x2a')](_0x320e('0x13'),_0x4b200b,_0x254bef[_0x320e('0x31')],_0x254bef[_0x320e('0x4c')]);_0x2cd1fd[_0x320e('0x1b')]();});}}catch(_0xff0b3b){logger[_0x320e('0x2a')](_0x320e('0x13'),_0x4b200b,JSON[_0x320e('0x15')](_0xff0b3b));_0x2cd1fd[_0x320e('0x2d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index a4fab4b..c5b8c9c 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd94f=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityFalse','info'];(function(_0x3deebf,_0x5c06c6){var _0x32da59=function(_0x2e4217){while(--_0x2e4217){_0x3deebf['push'](_0x3deebf['shift']());}};_0x32da59(++_0x5c06c6);}(_0xd94f,0x104));var _0xfd94=function(_0xcee193,_0x319b69){_0xcee193=_0xcee193-0x0;var _0x51c4be=_0xd94f[_0xcee193];return _0x51c4be;};'use strict';var schema=require(_0xfd94('0x0'));var _=require(_0xfd94('0x1'));var htmlToText=require(_0xfd94('0x2'));var utils=require(_0xfd94('0x3'));var logger=require(_0xfd94('0x4'))(_0xfd94('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xfd94('0x6')},'priorityTrue':{'type':'number','message':_0xfd94('0x7')},'priorityFalse':{'type':_0xfd94('0x8'),'message':_0xfd94('0x9')}});exports['consequence']=function(_0x74f483,_0x3930d9){return function(_0x3d8e09){try{var _0x2436f9={'condition':htmlToText[_0xfd94('0xa')](utils[_0xfd94('0xb')](_0x3930d9[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3930d9[0x1],'priorityFalse':_0x3930d9[0x2]};var _0x13ba1a=gotoif['validate'](_0x2436f9,{'typecast':!![]});if(_0x13ba1a['length']){logger[_0xfd94('0xc')](_0xfd94('0xd'),_0x74f483,_[_0xfd94('0xe')](_0x13ba1a,'message')[_0xfd94('0xf')](',\x20'));_0x3d8e09[_0xfd94('0x10')]();}else{try{var _0x40a015=eval('('+_0x2436f9[_0xfd94('0x11')]+')');var _0x3ce150=_0x40a015?_0x2436f9['priorityTrue']:_0x2436f9[_0xfd94('0x12')];logger[_0xfd94('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x74f483,_0x2436f9[_0xfd94('0x11')],_0x40a015,_0x3ce150||'next');if(_0x3ce150){var _0x3620fe=_[_0xfd94('0x14')](_0x3d8e09[_0xfd94('0x15')](),{'p':_0x3ce150});if(_0x3620fe>=0x0){logger[_0xfd94('0x13')](_0xfd94('0x16'),_0x74f483,_0x3ce150||_0xfd94('0x17'),_0x3620fe);_0x3d8e09[_0xfd94('0x17')](_0x3620fe);}else{logger['info'](_0xfd94('0x18'),_0x74f483,_0x3ce150||'next');_0x3d8e09['stop']();}}else{_0x3d8e09[_0xfd94('0x17')]();}}catch(_0x377c36){logger[_0xfd94('0xc')](_0xfd94('0x19'),_0x74f483,_0x377c36[_0xfd94('0x1a')]);_0x3d8e09[_0xfd94('0x10')]();}}}catch(_0xc27f03){logger[_0xfd94('0xc')]('[%s][GOTOIF]\x20%s',_0x74f483,JSON[_0xfd94('0x1b')](_0xc27f03));_0x3d8e09[_0xfd94('0x10')]();}};}; \ No newline at end of file +var _0xc1c2=['lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc1c2,0x10e));var _0x2c1c=function(_0x1ec037,_0x47cc6a){_0x1ec037=_0x1ec037-0x0;var _0x4779fc=_0xc1c2[_0x1ec037];return _0x4779fc;};'use strict';var schema=require('validate');var _=require(_0x2c1c('0x0'));var htmlToText=require(_0x2c1c('0x1'));var utils=require('./utils');var logger=require(_0x2c1c('0x2'))(_0x2c1c('0x3'));var gotoif=schema({'condition':{'type':_0x2c1c('0x4'),'required':!![],'message':_0x2c1c('0x5')},'priorityTrue':{'type':_0x2c1c('0x6'),'message':_0x2c1c('0x7')},'priorityFalse':{'type':_0x2c1c('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x2c1c('0x8')]=function(_0x12f8e9,_0x2f2e5c){return function(_0x118756){try{var _0x4d7b62={'condition':htmlToText[_0x2c1c('0x9')](utils[_0x2c1c('0xa')](_0x2f2e5c[0x0],this),{'wordwrap':![]})[_0x2c1c('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2f2e5c[0x1],'priorityFalse':_0x2f2e5c[0x2]};var _0x27f2a5=gotoif[_0x2c1c('0xc')](_0x4d7b62,{'typecast':!![]});if(_0x27f2a5['length']){logger[_0x2c1c('0xd')](_0x2c1c('0xe'),_0x12f8e9,_[_0x2c1c('0xf')](_0x27f2a5,_0x2c1c('0x10'))[_0x2c1c('0x11')](',\x20'));_0x118756['stop']();}else{try{var _0x430e5c=eval('('+_0x4d7b62[_0x2c1c('0x12')]+')');var _0x49ed0b=_0x430e5c?_0x4d7b62['priorityTrue']:_0x4d7b62[_0x2c1c('0x13')];logger[_0x2c1c('0x14')](_0x2c1c('0x15'),_0x12f8e9,_0x4d7b62[_0x2c1c('0x12')],_0x430e5c,_0x49ed0b||_0x2c1c('0x16'));if(_0x49ed0b){var _0x5a5dc0=_[_0x2c1c('0x17')](_0x118756[_0x2c1c('0x18')](),{'p':_0x49ed0b});if(_0x5a5dc0>=0x0){logger['info'](_0x2c1c('0x19'),_0x12f8e9,_0x49ed0b||_0x2c1c('0x16'),_0x5a5dc0);_0x118756[_0x2c1c('0x16')](_0x5a5dc0);}else{logger[_0x2c1c('0x14')](_0x2c1c('0x1a'),_0x12f8e9,_0x49ed0b||'next');_0x118756[_0x2c1c('0x1b')]();}}else{_0x118756[_0x2c1c('0x16')]();}}catch(_0x184494){logger[_0x2c1c('0xd')](_0x2c1c('0x1c'),_0x12f8e9,_0x184494[_0x2c1c('0x10')]);_0x118756['stop']();}}}catch(_0x473a51){logger[_0x2c1c('0xd')](_0x2c1c('0xe'),_0x12f8e9,JSON[_0x2c1c('0x1d')](_0x473a51));_0x118756[_0x2c1c('0x1b')]();}};}; \ 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 f967927..d07e827 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 _0x08dd=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message','join','[%s][GOTOP]\x20priority\x20%s','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','lodash','routing','number'];(function(_0x6878b9,_0xe05f1f){var _0x1cb8cc=function(_0x5909f4){while(--_0x5909f4){_0x6878b9['push'](_0x6878b9['shift']());}};_0x1cb8cc(++_0xe05f1f);}(_0x08dd,0x183));var _0xd08d=function(_0x227ee4,_0x4c229e){_0x227ee4=_0x227ee4-0x0;var _0x5157ac=_0x08dd[_0x227ee4];return _0x5157ac;};'use strict';var schema=require('validate');var _=require(_0xd08d('0x0'));var logger=require('../../../../config/logger')(_0xd08d('0x1'));var gotop=schema({'priority':{'type':_0xd08d('0x2'),'required':!![],'message':_0xd08d('0x3')}});exports[_0xd08d('0x4')]=function(_0x4469dd,_0x26aa1c){return function(_0x2ab604){try{var _0x3b09c7={'priority':_0x26aa1c[0x0]};var _0x53770e=gotop['validate'](_0x3b09c7,{'typecast':!![]});if(_0x53770e['length']){logger[_0xd08d('0x5')](_0xd08d('0x6'),_0x4469dd,_['map'](_0x53770e,_0xd08d('0x7'))[_0xd08d('0x8')](',\x20'));_0x2ab604['stop']();}else{logger['info'](_0xd08d('0x9'),_0x4469dd,_0x3b09c7[_0xd08d('0xa')]);if(_0x3b09c7['priority']){var _0x9d8439=_['findIndex'](_0x2ab604['rules'](),{'p':_0x3b09c7[_0xd08d('0xa')]});if(_0x9d8439>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4469dd,_0x3b09c7[_0xd08d('0xa')]||_0xd08d('0xb'),_0x9d8439);_0x2ab604[_0xd08d('0xb')](_0x9d8439);}else{logger['info'](_0xd08d('0xc'),_0x4469dd,_0x3b09c7[_0xd08d('0xa')]||'next');_0x2ab604[_0xd08d('0xd')]();}}else{_0x2ab604[_0xd08d('0xb')]();}}}catch(_0x3d9b79){logger[_0xd08d('0x5')](_0xd08d('0x6'),_0x4469dd,JSON[_0xd08d('0xe')](_0x3d9b79));_0x2ab604[_0xd08d('0xd')]();}};}; \ No newline at end of file +var _0x7f6f=['consequence','length','error','[%s][GOTOP]\x20%s','map','join','info','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','priority','next','stop','stringify','lodash','../../../../config/logger','routing','number'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7f6f,0x10c));var _0xf7f6=function(_0x5c060d,_0x4195dc){_0x5c060d=_0x5c060d-0x0;var _0x217e6b=_0x7f6f[_0x5c060d];return _0x217e6b;};'use strict';var schema=require('validate');var _=require(_0xf7f6('0x0'));var logger=require(_0xf7f6('0x1'))(_0xf7f6('0x2'));var gotop=schema({'priority':{'type':_0xf7f6('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xf7f6('0x4')]=function(_0x267757,_0x32ae26){return function(_0x37aa13){try{var _0x49567e={'priority':_0x32ae26[0x0]};var _0x35b88a=gotop['validate'](_0x49567e,{'typecast':!![]});if(_0x35b88a[_0xf7f6('0x5')]){logger[_0xf7f6('0x6')](_0xf7f6('0x7'),_0x267757,_[_0xf7f6('0x8')](_0x35b88a,'message')[_0xf7f6('0x9')](',\x20'));_0x37aa13['stop']();}else{logger[_0xf7f6('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x267757,_0x49567e['priority']);if(_0x49567e['priority']){var _0x373ab8=_['findIndex'](_0x37aa13[_0xf7f6('0xb')](),{'p':_0x49567e['priority']});if(_0x373ab8>=0x0){logger[_0xf7f6('0xa')](_0xf7f6('0xc'),_0x267757,_0x49567e[_0xf7f6('0xd')]||_0xf7f6('0xe'),_0x373ab8);_0x37aa13[_0xf7f6('0xe')](_0x373ab8);}else{logger[_0xf7f6('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x267757,_0x49567e[_0xf7f6('0xd')]||'next');_0x37aa13[_0xf7f6('0xf')]();}}else{_0x37aa13[_0xf7f6('0xe')]();}}}catch(_0x4c09a4){logger['error'](_0xf7f6('0x7'),_0x267757,JSON[_0xf7f6('0x10')](_0x4c09a4));_0x37aa13[_0xf7f6('0xf')]();}};}; \ 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 0e33ae4..d80faa7 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 _0x13a3=['../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x13a3,0x102));var _0x313a=function(_0x55dbda,_0x562349){_0x55dbda=_0x55dbda-0x0;var _0x42dd3f=_0x13a3[_0x55dbda];return _0x42dd3f;};'use strict';var _=require(_0x313a('0x0'));var utils=require(_0x313a('0x1'));var logger=require(_0x313a('0x2'))(_0x313a('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x313a('0x4')),'smsMessage':require(_0x313a('0x5')),'faxMessage':require(_0x313a('0x6')),'whatsappMessage':require(_0x313a('0x7'))};exports[_0x313a('0x8')]=function(_0x3d0582,_0x80ab82){return function(_0xf25a32){try{var _0x1afdc2={'body':utils[_0x313a('0x9')](_0x80ab82[0x0],this),'ContactId':this['contact']['id']};if(this[_0x313a('0xa')]==='chat'){_0x1afdc2[_0x313a('0xb')]=this['account']['id'];}else{_0x1afdc2[_[_0x313a('0xc')](this[_0x313a('0xa')])+_0x313a('0xd')]=this[_0x313a('0xe')]['id'];}_0x1afdc2[_['upperFirst'](this[_0x313a('0xa')])+_0x313a('0xf')]=this['interaction']['id'];if(rpc[this[_0x313a('0xa')]+_0x313a('0x10')]){return rpc[this[_0x313a('0xa')]+_0x313a('0x10')][_0x313a('0x11')](_0x1afdc2)[_0x313a('0x12')](function(_0x4698f8){logger[_0x313a('0x13')](_0x313a('0x14'),_0x3d0582,_0x1afdc2['body']);_0xf25a32[_0x313a('0x15')]();})[_0x313a('0x16')](function(_0x4f7eda){logger[_0x313a('0x17')](_0x313a('0x14'),_0x3d0582,JSON[_0x313a('0x18')](_0x4f7eda));_0xf25a32[_0x313a('0x19')]();});}}catch(_0x58cba8){logger['error'](_0x313a('0x14'),_0x3d0582,JSON['stringify'](_0x58cba8));_0xf25a32[_0x313a('0x19')]();}};}; \ No newline at end of file +var _0x5795=['Message','then','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','AccountId','upperFirst','interaction'];(function(_0x39dd10,_0x134622){var _0x35bd8a=function(_0x156710){while(--_0x156710){_0x39dd10['push'](_0x39dd10['shift']());}};_0x35bd8a(++_0x134622);}(_0x5795,0xd1));var _0x5579=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5795[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5579('0x0'));var utils=require(_0x5579('0x1'));var logger=require(_0x5579('0x2'))(_0x5579('0x3'));var rpc={'chatMessage':require(_0x5579('0x4')),'openchannelMessage':require(_0x5579('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5579('0x6'))};exports[_0x5579('0x7')]=function(_0x57e45d,_0x3aaa1c){return function(_0x1e02f3){try{var _0x3eee07={'body':utils[_0x5579('0x8')](_0x3aaa1c[0x0],this),'ContactId':this[_0x5579('0x9')]['id']};if(this[_0x5579('0xa')]==='chat'){_0x3eee07[_0x5579('0xb')]=this[_0x5579('0xc')]['id'];}else{_0x3eee07[_['upperFirst'](this['channel'])+_0x5579('0xd')]=this[_0x5579('0xc')]['id'];}_0x3eee07[_[_0x5579('0xe')](this[_0x5579('0xa')])+'InteractionId']=this[_0x5579('0xf')]['id'];if(rpc[this['channel']+_0x5579('0x10')]){return rpc[this[_0x5579('0xa')]+_0x5579('0x10')]['create'](_0x3eee07)[_0x5579('0x11')](function(_0x255e30){logger['info']('[%s][MESSAGE]\x20%s',_0x57e45d,_0x3eee07[_0x5579('0x12')]);_0x1e02f3[_0x5579('0x13')]();})[_0x5579('0x14')](function(_0x3fe5e3){logger[_0x5579('0x15')](_0x5579('0x16'),_0x57e45d,JSON[_0x5579('0x17')](_0x3fe5e3));_0x1e02f3[_0x5579('0x18')]();});}}catch(_0x406bf9){logger[_0x5579('0x15')](_0x5579('0x16'),_0x57e45d,JSON[_0x5579('0x17')](_0x406bf9));_0x1e02f3[_0x5579('0x18')]();}};}; \ 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 174cb96..749f214 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 _0xdd5d=['next','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0xdd5d,0xd5));var _0xddd5=function(_0xf34ca3,_0x4e9276){_0xf34ca3=_0xf34ca3-0x0;var _0x41bc24=_0xdd5d[_0xf34ca3];return _0x41bc24;};'use strict';var utils=require(_0xddd5('0x0'));var logger=require(_0xddd5('0x1'))(_0xddd5('0x2'));exports[_0xddd5('0x3')]=function(_0x28a8dd,_0x182785){return function(_0x33eb57){try{logger[_0xddd5('0x4')](_0xddd5('0x5'),_0x28a8dd,utils[_0xddd5('0x6')](_0x182785[0x0],this));_0x33eb57[_0xddd5('0x7')]();}catch(_0x76c2ad){logger['error'](_0xddd5('0x5'),_0x28a8dd,JSON[_0xddd5('0x8')](_0x76c2ad));_0x33eb57[_0xddd5('0x9')]();}};}; \ No newline at end of file +var _0x494f=['stop','./utils','../../../../config/logger','routing','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x494f,0xc7));var _0xf494=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x494f[_0x1e381c];return _0x9b5ea9;};'use strict';var utils=require(_0xf494('0x0'));var logger=require(_0xf494('0x1'))(_0xf494('0x2'));exports['consequence']=function(_0x58b96a,_0x39305a){return function(_0x1b2a51){try{logger['info']('[%s][NOOP]\x20%s',_0x58b96a,utils[_0xf494('0x3')](_0x39305a[0x0],this));_0x1b2a51[_0xf494('0x4')]();}catch(_0x268d60){logger[_0xf494('0x5')](_0xf494('0x6'),_0x58b96a,JSON[_0xf494('0x7')](_0x268d60));_0x1b2a51[_0xf494('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 a96b377..85ee9a8 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 _0x6dcb=['consequence','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase'];(function(_0x4a16ac,_0x58843b){var _0x52b083=function(_0x237fbe){while(--_0x237fbe){_0x4a16ac['push'](_0x4a16ac['shift']());}};_0x52b083(++_0x58843b);}(_0x6dcb,0x6b));var _0xb6dc=function(_0x4cee02,_0x5ecd1d){_0x4cee02=_0x4cee02-0x0;var _0x65882d=_0x6dcb[_0x4cee02];return _0x65882d;};'use strict';var schema=require(_0xb6dc('0x0'));var _=require(_0xb6dc('0x1'));var util=require(_0xb6dc('0x2'));var seqqueue=require(_0xb6dc('0x3'));var moment=require(_0xb6dc('0x4'));var Redis=require(_0xb6dc('0x5'));var config=require(_0xb6dc('0x6'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xb6dc('0x7'));config['redis']=_[_0xb6dc('0x8')](config[_0xb6dc('0x9')],{'host':_0xb6dc('0xa'),'port':0x18eb});var io=require(_0xb6dc('0xb'))(new Redis(config[_0xb6dc('0x9')]));var attributes=['id',_0xb6dc('0xc'),_0xb6dc('0xd'),_0xb6dc('0xe'),'from',_0xb6dc('0xf')];function emit(_0x3c4807,_0x391141,_0x5accf9){io['to'](_0x3c4807)[_0xb6dc('0x10')](_0x391141,_0x5accf9);}function emitChannelQueueInteraction(_0x17c2b5,_0x2ff371,_0x5421c9,_0x2faa6e,_0x580d92,_0x40fe8c,_0x4f621e,_0x515908){var _0xd13be6=_[_0xb6dc('0x11')](_0x5421c9);_0xd13be6[_0xb6dc('0xc')]=_0x515908;_0xd13be6[_0xb6dc('0xe')]=_0x2ff371;_0xd13be6[_0xb6dc('0xd')]=_0x2faa6e;_0xd13be6['id']=_0x580d92;if(_0x40fe8c){attributes[_0xb6dc('0x12')](_['capitalize'](_0x17c2b5)+_0xb6dc('0x13'));_0x4f621e[util[_0xb6dc('0x14')](_0xb6dc('0x15'),_0x17c2b5)][_0x580d92]=_[_0xb6dc('0x16')](_0xd13be6,attributes);}else{delete _0x4f621e[util['format'](_0xb6dc('0x15'),_0x17c2b5)][_0x580d92];}emit(util[_0xb6dc('0x14')](_0xb6dc('0x17'),_0x17c2b5,_0x2ff371),util[_0xb6dc('0x14')](_0xb6dc('0x18'),_0x17c2b5,_0x40fe8c?'save':_0xb6dc('0x19')),_[_0xb6dc('0x16')](_0xd13be6,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb6dc('0x1a')),'smsQueueReport':require(_0xb6dc('0x1b')),'faxQueueReport':require(_0xb6dc('0x1c')),'whatsappQueueReport':require(_0xb6dc('0x1d')),'chatInteraction':require(_0xb6dc('0x1e')),'faxInteraction':require(_0xb6dc('0x1f')),'mailInteraction':require(_0xb6dc('0x20')),'openchannelInteraction':require(_0xb6dc('0x21')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xb6dc('0x22'))};var queue=schema({'name':{'type':_0xb6dc('0x23'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb6dc('0x24'),'message':_0xb6dc('0x25')}});function startRouting(_0x251351,_0x459159,_0xff6d09,_0x1dd307){if(_0x251351&&_0x459159&&_0xff6d09){_0x459159[_0xb6dc('0x26')]+=0x1;var _0x26590b={'uniqueid':_0x251351,'from':_0xff6d09[_0xb6dc('0x27')]?_0xff6d09[_0xb6dc('0x27')][_0xb6dc('0x28')]:'','joinAt':moment()[_0xb6dc('0x14')](_0xb6dc('0x29')),'ContactId':_0xff6d09['contact']?_0xff6d09[_0xb6dc('0x2a')]['id']:null,'ListId':_0xff6d09['list']?_0xff6d09[_0xb6dc('0x2b')]['id']:null};_0x26590b[_[_0xb6dc('0x2c')](_0xff6d09[_0xb6dc('0x2d')])+_0xb6dc('0x2e')]=_0x459159['id']||null;_0x26590b[_[_0xb6dc('0x2c')](_0xff6d09[_0xb6dc('0x2d')])+_0xb6dc('0x13')]=_0xff6d09[_0xb6dc('0x2f')]?_0xff6d09['interaction']['id']:null;_0x26590b[_[_0xb6dc('0x2c')](_0xff6d09[_0xb6dc('0x2d')])+_0xb6dc('0x30')]=_0xff6d09['message']?_0xff6d09['message']['id']:null;_0x26590b[_[_0xb6dc('0x2c')](_0xff6d09[_0xb6dc('0x2d')])+(_0xff6d09[_0xb6dc('0x2d')]!==_0xb6dc('0x31')?_0xb6dc('0x32'):_0xb6dc('0x33'))]=_0xff6d09[_0xb6dc('0xd')]?_0xff6d09[_0xb6dc('0xd')]['id']:null;logger[_0xb6dc('0x34')](util[_0xb6dc('0x14')](_0xb6dc('0x35'),_0x251351,_0x459159[_0xb6dc('0x36')]));emitChannelQueueInteraction(_0xff6d09[_0xb6dc('0x2d')],_0x459159[_0xb6dc('0x36')],_0x26590b,_0xff6d09[_0xb6dc('0xd')][_0xb6dc('0x36')],_0xff6d09[_0xb6dc('0x37')]['id'],!![],_0x1dd307,_0x459159['id']);if(rpc[_0xff6d09[_0xb6dc('0x2d')]+_0xb6dc('0x38')]){return rpc[_0xff6d09[_0xb6dc('0x2d')]+'QueueReport']['create'](_0x26590b)[_0xb6dc('0x39')](function(_0x4a1482){logger[_0xb6dc('0x3a')](_0xb6dc('0x3b'),_0x4a1482);});}}}function stopRouting(_0x24e87d,_0x150437,_0x23fdc7,_0x354dfe){if(_0x24e87d&&_0x150437){_0x150437[_0xb6dc('0x26')]-=0x1;var _0x13f2c2={'leaveAt':moment()[_0xb6dc('0x14')](_0xb6dc('0x29')),'acceptAt':moment()[_0xb6dc('0x14')](_0xb6dc('0x29')),'reason':_0xb6dc('0x3c')};logger[_0xb6dc('0x34')](util[_0xb6dc('0x14')](_0xb6dc('0x3d'),_0x24e87d,_0x150437[_0xb6dc('0x36')]));emitChannelQueueInteraction(_0x23fdc7[_0xb6dc('0x2d')],_0x150437[_0xb6dc('0x36')],_0x23fdc7[_0xb6dc('0x27')],_0x23fdc7[_0xb6dc('0xd')]['name'],_0x23fdc7['message']['id'],![],_0x354dfe,_0x150437['id']);return rpc[_0x23fdc7['channel']+_0xb6dc('0x3e')][_0xb6dc('0x3f')](_0x23fdc7['interaction']['id'],{'queueId':_0x150437['id']})[_0xb6dc('0x40')](function(){if(rpc[_0x23fdc7[_0xb6dc('0x2d')]+'QueueReport']){return rpc[_0x23fdc7[_0xb6dc('0x2d')]+_0xb6dc('0x38')][_0xb6dc('0x3f')](_0x24e87d,_0x13f2c2)[_0xb6dc('0x39')](function(_0x4f02ef){logger[_0xb6dc('0x3a')](_0xb6dc('0x41'),_0x4f02ef);});}});}}function endRouting(_0x4c8d6f,_0xc36595,_0x292c8c,_0x3bb284){if(_0x4c8d6f&&_0xc36595){_0xc36595[_0xb6dc('0x26')]-=0x1;var _0xa0cbff={'leaveAt':moment()[_0xb6dc('0x14')](_0xb6dc('0x29')),'exitAt':moment()[_0xb6dc('0x14')](_0xb6dc('0x29')),'reason':_0xb6dc('0x42')};logger['info'](util[_0xb6dc('0x14')](_0xb6dc('0x43'),_0x4c8d6f,_0xc36595[_0xb6dc('0x36')]));emitChannelQueueInteraction(_0x292c8c[_0xb6dc('0x2d')],_0xc36595[_0xb6dc('0x36')],_0x292c8c[_0xb6dc('0x27')],_0x292c8c[_0xb6dc('0xd')][_0xb6dc('0x36')],_0x292c8c[_0xb6dc('0x37')]['id'],![],_0x3bb284);if(rpc[_0x292c8c['channel']+_0xb6dc('0x38')]){return rpc[_0x292c8c[_0xb6dc('0x2d')]+'QueueReport']['update'](_0x4c8d6f,_0xa0cbff)[_0xb6dc('0x39')](function(_0x22b4c9){logger[_0xb6dc('0x3a')](_0xb6dc('0x41'),_0x22b4c9);});}}}function handleFindQueue(_0x5c8d15){return function(_0xf63ed7){return _0xf63ed7[_0xb6dc('0x36')]['toLowerCase']()===_0x5c8d15[_0xb6dc('0x44')]();};}exports[_0xb6dc('0x45')]=function(_0x11dea2,_0x1535a7,_0x509c2c,_0x221b85){return function(_0x26fdaa){try{var _0x5b0435={'name':_0x1535a7[0x0],'timeout':_0x1535a7[0x1]};var _0x502129=queue[_0xb6dc('0x0')](_0x5b0435,{'typecast':!![]});if(_0x502129['length']){logger[_0xb6dc('0x3a')](_0xb6dc('0x46'),_0x11dea2,_[_0xb6dc('0x47')](_0x502129,_0xb6dc('0x37'))[_0xb6dc('0x48')](',\x20'));_0x26fdaa[_0xb6dc('0x49')]();}else{var _0x982999=_[_0xb6dc('0x4a')](_0x509c2c[_0x221b85[_0xb6dc('0x2d')]+_0xb6dc('0x4b')],handleFindQueue(_0x5b0435[_0xb6dc('0x36')]));if(_0x982999){startRouting(_0x11dea2,_0x982999,_0x221b85,_0x509c2c);var _0x23cce2=(_0x982999[_0xb6dc('0x42')]||0xa)*0x3e8;var _0x1738af=(_0x5b0435['timeout']||0x14)*0x3e8;var _0x53e59d;if(_0x23cce2>_0x1738af){_0x1738af=_0x23cce2;}var _0x4a7733=seqqueue[_0xb6dc('0x4c')](_0x23cce2);_0x4a7733['id']=_0x11dea2;_0x4a7733[_0xb6dc('0x4d')]=_0x23cce2;_0x4a7733[_0xb6dc('0x4e')]=_0x1738af;_0x4a7733[_0xb6dc('0x2d')]=_0x221b85[_0xb6dc('0x2d')];_0x509c2c['rules'][_0x11dea2]['on']('end',function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x11dea2);stopRouting(_0x11dea2,_0x982999,_0x221b85,_0x509c2c);clearTimeout(_0x53e59d);_0x53e59d=undefined;_0x4a7733[_0xb6dc('0x4f')](!![]);if(_0x509c2c[_0xb6dc('0x50')][_0x11dea2]){delete _0x509c2c[_0xb6dc('0x50')][_0x11dea2];}_0x26fdaa[_0xb6dc('0x49')]();});_0x509c2c[_0xb6dc('0x50')][_0x11dea2]['on'](_0xb6dc('0x51'),function(){if(_0x509c2c[_0xb6dc('0x50')][_0x11dea2]){delete _0x509c2c['rules'][_0x11dea2];}});_0x53e59d=setTimeout(function(){logger[_0xb6dc('0x34')](_0xb6dc('0x52'),_0x11dea2);endRouting(_0x11dea2,_0x982999,_0x221b85,_0x509c2c);clearTimeout(_0x53e59d);_0x4a7733[_0xb6dc('0x4f')](!![]);_0x26fdaa['next']();},_0x1738af);switch(_0x982999[_0xb6dc('0x53')]){case _0xb6dc('0x54'):strategy['rrmemory'](_0x4a7733,_0x982999,_0x509c2c,_0x221b85);break;default:strategy[_0xb6dc('0x55')](_0x4a7733,_0x982999,_0x509c2c,_0x221b85);}}else{logger['error'](_0xb6dc('0x56'),_0x11dea2,_0x5b0435['name']);_0x26fdaa[_0xb6dc('0x49')]();}}}catch(_0x5f09ad){logger['error']('[%s][QUEUE]\x20%s',_0x11dea2,_0x5f09ad[_0xb6dc('0x57')]);_0x26fdaa['stop']();}};}; \ No newline at end of file +var _0xee28=['[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','beepall','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue','from','joinAt','emit','account','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','name','QueueReport','create','catch','error','create\x20queue\x20report','info'];(function(_0x333755,_0x47aadf){var _0x1335ce=function(_0x370044){while(--_0x370044){_0x333755['push'](_0x333755['shift']());}};_0x1335ce(++_0x47aadf);}(_0xee28,0x1c4));var _0x8ee2=function(_0x1056c7,_0x279ac5){_0x1056c7=_0x1056c7-0x0;var _0x4ef73e=_0xee28[_0x1056c7];return _0x4ef73e;};'use strict';var schema=require('validate');var _=require(_0x8ee2('0x0'));var util=require(_0x8ee2('0x1'));var seqqueue=require(_0x8ee2('0x2'));var moment=require(_0x8ee2('0x3'));var Redis=require(_0x8ee2('0x4'));var config=require(_0x8ee2('0x5'));var logger=require('../../../../config/logger')(_0x8ee2('0x6'));var strategy=require(_0x8ee2('0x7'));config[_0x8ee2('0x8')]=_[_0x8ee2('0x9')](config['redis'],{'host':_0x8ee2('0xa'),'port':0x18eb});var io=require(_0x8ee2('0xb'))(new Redis(config[_0x8ee2('0x8')]));var attributes=['id','queue_id','account',_0x8ee2('0xc'),_0x8ee2('0xd'),_0x8ee2('0xe')];function emit(_0x1f02ac,_0x3da7a8,_0xb27770){io['to'](_0x1f02ac)[_0x8ee2('0xf')](_0x3da7a8,_0xb27770);}function emitChannelQueueInteraction(_0x16d383,_0x295584,_0xdbee09,_0x14f752,_0x2e28a6,_0x1d0a75,_0x4fe727,_0x33edad){var _0xffff16=_['clone'](_0xdbee09);_0xffff16['queue_id']=_0x33edad;_0xffff16[_0x8ee2('0xc')]=_0x295584;_0xffff16[_0x8ee2('0x10')]=_0x14f752;_0xffff16['id']=_0x2e28a6;if(_0x1d0a75){attributes[_0x8ee2('0x11')](_[_0x8ee2('0x12')](_0x16d383)+_0x8ee2('0x13'));_0x4fe727[util[_0x8ee2('0x14')](_0x8ee2('0x15'),_0x16d383)][_0x2e28a6]=_['pick'](_0xffff16,attributes);}else{delete _0x4fe727[util[_0x8ee2('0x14')](_0x8ee2('0x15'),_0x16d383)][_0x2e28a6];}emit(util['format']('%s:queue:%s',_0x16d383,_0x295584),util['format'](_0x8ee2('0x16'),_0x16d383,_0x1d0a75?_0x8ee2('0x17'):_0x8ee2('0x18')),_['pick'](_0xffff16,attributes));}var rpc={'openchannelQueueReport':require(_0x8ee2('0x19')),'mailQueueReport':require(_0x8ee2('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x8ee2('0x1b')),'faxQueueReport':require(_0x8ee2('0x1c')),'whatsappQueueReport':require(_0x8ee2('0x1d')),'chatInteraction':require(_0x8ee2('0x1e')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x8ee2('0x1f')),'openchannelInteraction':require(_0x8ee2('0x20')),'smsInteraction':require(_0x8ee2('0x21')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x8ee2('0x22')},'timeout':{'type':_0x8ee2('0x23'),'message':_0x8ee2('0x24')}});function startRouting(_0x52a474,_0x33ec76,_0x1198e9,_0x527aeb){if(_0x52a474&&_0x33ec76&&_0x1198e9){_0x33ec76[_0x8ee2('0x25')]+=0x1;var _0x28c87a={'uniqueid':_0x52a474,'from':_0x1198e9[_0x8ee2('0x26')]?_0x1198e9[_0x8ee2('0x26')][_0x8ee2('0xd')]:'','joinAt':moment()['format'](_0x8ee2('0x27')),'ContactId':_0x1198e9[_0x8ee2('0x28')]?_0x1198e9[_0x8ee2('0x28')]['id']:null,'ListId':_0x1198e9[_0x8ee2('0x29')]?_0x1198e9['list']['id']:null};_0x28c87a[_[_0x8ee2('0x2a')](_0x1198e9[_0x8ee2('0x2b')])+_0x8ee2('0x2c')]=_0x33ec76['id']||null;_0x28c87a[_[_0x8ee2('0x2a')](_0x1198e9['channel'])+_0x8ee2('0x13')]=_0x1198e9[_0x8ee2('0x2d')]?_0x1198e9[_0x8ee2('0x2d')]['id']:null;_0x28c87a[_[_0x8ee2('0x2a')](_0x1198e9[_0x8ee2('0x2b')])+_0x8ee2('0x2e')]=_0x1198e9[_0x8ee2('0x2f')]?_0x1198e9[_0x8ee2('0x2f')]['id']:null;_0x28c87a[_['upperFirst'](_0x1198e9[_0x8ee2('0x2b')])+(_0x1198e9['channel']!==_0x8ee2('0x30')?_0x8ee2('0x31'):_0x8ee2('0x32'))]=_0x1198e9[_0x8ee2('0x10')]?_0x1198e9[_0x8ee2('0x10')]['id']:null;logger['info'](util[_0x8ee2('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x52a474,_0x33ec76[_0x8ee2('0x33')]));emitChannelQueueInteraction(_0x1198e9[_0x8ee2('0x2b')],_0x33ec76[_0x8ee2('0x33')],_0x28c87a,_0x1198e9[_0x8ee2('0x10')][_0x8ee2('0x33')],_0x1198e9[_0x8ee2('0x2f')]['id'],!![],_0x527aeb,_0x33ec76['id']);if(rpc[_0x1198e9[_0x8ee2('0x2b')]+_0x8ee2('0x34')]){return rpc[_0x1198e9[_0x8ee2('0x2b')]+_0x8ee2('0x34')][_0x8ee2('0x35')](_0x28c87a)[_0x8ee2('0x36')](function(_0x3a2772){logger[_0x8ee2('0x37')](_0x8ee2('0x38'),_0x3a2772);});}}}function stopRouting(_0x11df00,_0x53837e,_0x198d15,_0x2a0b0b){if(_0x11df00&&_0x53837e){_0x53837e['waiting']-=0x1;var _0x1e0223={'leaveAt':moment()['format'](_0x8ee2('0x27')),'acceptAt':moment()[_0x8ee2('0x14')](_0x8ee2('0x27')),'reason':'accepted'};logger[_0x8ee2('0x39')](util[_0x8ee2('0x14')](_0x8ee2('0x3a'),_0x11df00,_0x53837e[_0x8ee2('0x33')]));emitChannelQueueInteraction(_0x198d15[_0x8ee2('0x2b')],_0x53837e[_0x8ee2('0x33')],_0x198d15['body'],_0x198d15[_0x8ee2('0x10')]['name'],_0x198d15['message']['id'],![],_0x2a0b0b,_0x53837e['id']);return rpc[_0x198d15[_0x8ee2('0x2b')]+_0x8ee2('0x3b')][_0x8ee2('0x3c')](_0x198d15[_0x8ee2('0x2d')]['id'],{'queueId':_0x53837e['id']})[_0x8ee2('0x3d')](function(){if(rpc[_0x198d15['channel']+_0x8ee2('0x34')]){return rpc[_0x198d15[_0x8ee2('0x2b')]+_0x8ee2('0x34')][_0x8ee2('0x3c')](_0x11df00,_0x1e0223)[_0x8ee2('0x36')](function(_0x391209){logger['error'](_0x8ee2('0x3e'),_0x391209);});}});}}function endRouting(_0x353f9f,_0x1f0202,_0x244e35,_0x1e4aa8){if(_0x353f9f&&_0x1f0202){_0x1f0202['waiting']-=0x1;var _0x1271a4={'leaveAt':moment()[_0x8ee2('0x14')](_0x8ee2('0x27')),'exitAt':moment()[_0x8ee2('0x14')](_0x8ee2('0x27')),'reason':_0x8ee2('0x3f')};logger[_0x8ee2('0x39')](util[_0x8ee2('0x14')](_0x8ee2('0x40'),_0x353f9f,_0x1f0202['name']));emitChannelQueueInteraction(_0x244e35[_0x8ee2('0x2b')],_0x1f0202['name'],_0x244e35['body'],_0x244e35[_0x8ee2('0x10')][_0x8ee2('0x33')],_0x244e35[_0x8ee2('0x2f')]['id'],![],_0x1e4aa8);if(rpc[_0x244e35['channel']+_0x8ee2('0x34')]){return rpc[_0x244e35[_0x8ee2('0x2b')]+_0x8ee2('0x34')]['update'](_0x353f9f,_0x1271a4)[_0x8ee2('0x36')](function(_0x16c656){logger[_0x8ee2('0x37')]('update\x20queue\x20report',_0x16c656);});}}}function handleFindQueue(_0x56eca9){return function(_0x25e3f1){return _0x25e3f1['name'][_0x8ee2('0x41')]()===_0x56eca9[_0x8ee2('0x41')]();};}exports[_0x8ee2('0x42')]=function(_0x3f84b3,_0x4ad625,_0x3d6e23,_0x312dbb){return function(_0x20856f){try{var _0x4dae3f={'name':_0x4ad625[0x0],'timeout':_0x4ad625[0x1]};var _0x2b5398=queue[_0x8ee2('0x43')](_0x4dae3f,{'typecast':!![]});if(_0x2b5398[_0x8ee2('0x44')]){logger[_0x8ee2('0x37')](_0x8ee2('0x45'),_0x3f84b3,_[_0x8ee2('0x46')](_0x2b5398,'message')[_0x8ee2('0x47')](',\x20'));_0x20856f[_0x8ee2('0x48')]();}else{var _0x1aba9d=_[_0x8ee2('0x49')](_0x3d6e23[_0x312dbb[_0x8ee2('0x2b')]+_0x8ee2('0x4a')],handleFindQueue(_0x4dae3f[_0x8ee2('0x33')]));if(_0x1aba9d){startRouting(_0x3f84b3,_0x1aba9d,_0x312dbb,_0x3d6e23);var _0x3dc980=(_0x1aba9d[_0x8ee2('0x3f')]||0xa)*0x3e8;var _0x4a9637=(_0x4dae3f[_0x8ee2('0x3f')]||0x14)*0x3e8;var _0x7aedb4;if(_0x3dc980>_0x4a9637){_0x4a9637=_0x3dc980;}var _0x74d1aa=seqqueue[_0x8ee2('0x4b')](_0x3dc980);_0x74d1aa['id']=_0x3f84b3;_0x74d1aa[_0x8ee2('0x4c')]=_0x3dc980;_0x74d1aa[_0x8ee2('0x4d')]=_0x4a9637;_0x74d1aa[_0x8ee2('0x2b')]=_0x312dbb[_0x8ee2('0x2b')];_0x3d6e23[_0x8ee2('0x4e')][_0x3f84b3]['on'](_0x8ee2('0x4f'),function(){logger[_0x8ee2('0x39')](_0x8ee2('0x50'),_0x3f84b3);stopRouting(_0x3f84b3,_0x1aba9d,_0x312dbb,_0x3d6e23);clearTimeout(_0x7aedb4);_0x7aedb4=undefined;_0x74d1aa[_0x8ee2('0x51')](!![]);if(_0x3d6e23[_0x8ee2('0x4e')][_0x3f84b3]){delete _0x3d6e23[_0x8ee2('0x4e')][_0x3f84b3];}_0x20856f[_0x8ee2('0x48')]();});_0x3d6e23[_0x8ee2('0x4e')][_0x3f84b3]['on'](_0x8ee2('0x52'),function(){if(_0x3d6e23['rules'][_0x3f84b3]){delete _0x3d6e23['rules'][_0x3f84b3];}});_0x7aedb4=setTimeout(function(){logger[_0x8ee2('0x39')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3f84b3);endRouting(_0x3f84b3,_0x1aba9d,_0x312dbb,_0x3d6e23);clearTimeout(_0x7aedb4);_0x74d1aa[_0x8ee2('0x51')](!![]);_0x20856f['next']();},_0x4a9637);switch(_0x1aba9d['strategy']){case'rrmemory':strategy['rrmemory'](_0x74d1aa,_0x1aba9d,_0x3d6e23,_0x312dbb);break;default:strategy[_0x8ee2('0x53')](_0x74d1aa,_0x1aba9d,_0x3d6e23,_0x312dbb);}}else{logger[_0x8ee2('0x37')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3f84b3,_0x4dae3f[_0x8ee2('0x33')]);_0x20856f[_0x8ee2('0x48')]();}}}catch(_0x40eeea){logger[_0x8ee2('0x37')]('[%s][QUEUE]\x20%s',_0x3f84b3,_0x40eeea[_0x8ee2('0x54')]);_0x20856f[_0x8ee2('0x48')]();}};}; \ 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 360c066..4a5704e 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 _0xd67b=['handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push'];(function(_0x4bd910,_0xbb21f4){var _0x3c1cde=function(_0x1e5f75){while(--_0x1e5f75){_0x4bd910['push'](_0x4bd910['shift']());}};_0x3c1cde(++_0xbb21f4);}(_0xd67b,0x133));var _0xbd67=function(_0x4d3dda,_0xcef736){_0x4d3dda=_0x4d3dda-0x0;var _0x4a5d7d=_0xd67b[_0x4d3dda];return _0x4a5d7d;};'use strict';var _=require('lodash');var uuid=require(_0xbd67('0x0'));var util=require('./util');var logger=require(_0xbd67('0x1'))(_0xbd67('0x2'));var Agent=function(_0x317e33,_0x5e967b,_0x40e384,_0x50da5a){this[_0xbd67('0x3')]=uuid['v4']();this['squeue']=_0x317e33;this[_0xbd67('0x4')]=_0x5e967b;this[_0xbd67('0x5')]=_0x40e384;this[_0xbd67('0x2')]=_0x50da5a;this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this[_0xbd67('0x6')]['on'](_0xbd67('0xb'),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this['squeue']['on']('drained',this[_0xbd67('0xc')]['bind'](this));};Agent[_0xbd67('0xd')][_0xbd67('0x7')]=function(){this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));};Agent[_0xbd67('0xd')][_0xbd67('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0xbd67('0xd')][_0xbd67('0x8')]=function(){logger[_0xbd67('0xe')](_0xbd67('0xf'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this[_0xbd67('0x7')]['bind'](this),0x3e8);}else{if(this[_0xbd67('0x2')][_0xbd67('0x12')]||util[_0xbd67('0x13')](this['squeue']['id'],this[_0xbd67('0x5')]['agents'][this[_0xbd67('0x4')]['id']],this[_0xbd67('0x6')][_0xbd67('0x14')],![])){this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=!![];this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']]['busyQueue']=undefined;util[_0xbd67('0x16')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this[_0xbd67('0x6')][_0xbd67('0x14')]);util[_0xbd67('0x17')](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this[_0xbd67('0x2')]);util['writeLog'](this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],_0xbd67('0x18')+(this[_0xbd67('0x2')]['forcedOwnership']?_0xbd67('0x19'):''));}else{logger[_0xbd67('0xe')](_0xbd67('0x1a'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xbd67('0xd')][_0xbd67('0xa')]=function(_0x4675ac){if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){return logger[_0xbd67('0xe')](_0xbd67('0x1b'),this[_0xbd67('0x6')]['id'],this['agent']['id']);}else{logger['debug'](_0xbd67('0x1c'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);util['hideNotification'](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this['routing']);this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=![];this['realtime']['agents'][this[_0xbd67('0x4')]['id']][_0xbd67('0x1d')]=undefined;util[_0xbd67('0x1e')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this['squeue'][_0xbd67('0x14')]);util[_0xbd67('0x1f')](this[_0xbd67('0x6')]['id'],this['realtime'][_0xbd67('0x11')][this['agent']['id']],_0x4675ac?_0xbd67('0x20'):_0xbd67('0x21'));}if(!_0x4675ac){setTimeout(this['push'][_0xbd67('0x9')](this),0x3e8);}};function agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777){return new Agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777);}module[_0xbd67('0x22')]=agent; \ No newline at end of file +var _0x8d0e=['handleTimeout','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','busy','busyQueue','saveWaitingNotification','channel','notificationId','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','push','handleRun','bind'];(function(_0x21417c,_0x487287){var _0x542282=function(_0x22f672){while(--_0x22f672){_0x21417c['push'](_0x21417c['shift']());}};_0x542282(++_0x487287);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5dc307,_0x4072b4){_0x5dc307=_0x5dc307-0x0;var _0x500d72=_0x8d0e[_0x5dc307];return _0x500d72;};'use strict';var _=require(_0xe8d0('0x0'));var uuid=require(_0xe8d0('0x1'));var util=require(_0xe8d0('0x2'));var logger=require(_0xe8d0('0x3'))(_0xe8d0('0x4'));var Agent=function(_0x3584ab,_0x15521e,_0x940176,_0x32cee9){this['notificationId']=uuid['v4']();this[_0xe8d0('0x5')]=_0x3584ab;this['agent']=_0x15521e;this['realtime']=_0x940176;this[_0xe8d0('0x4')]=_0x32cee9;this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')][_0xe8d0('0x8')](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('timeout',this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));this[_0xe8d0('0x5')]['on']('drained',this['handleDrained'][_0xe8d0('0x8')](this));};Agent[_0xe8d0('0xa')][_0xe8d0('0x6')]=function(){this[_0xe8d0('0x5')][_0xe8d0('0x6')](this[_0xe8d0('0x7')]['bind'](this),this[_0xe8d0('0x9')][_0xe8d0('0x8')](this));};Agent['prototype'][_0xe8d0('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xe8d0('0x7')]=function(){logger[_0xe8d0('0xc')](_0xe8d0('0xd'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);if(_[_0xe8d0('0xf')](this['realtime'][_0xe8d0('0x10')][this['agent']['id']])){logger[_0xe8d0('0xc')](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0xe8d0('0x4')][_0xe8d0('0x12')]||util[_0xe8d0('0x13')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],this[_0xe8d0('0x5')]['channel'],![])){this['realtime']['agents'][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x15')]=!![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']][_0xe8d0('0x16')]=undefined;util[_0xe8d0('0x17')](this[_0xe8d0('0x14')],this[_0xe8d0('0x4')],this['agent'],this[_0xe8d0('0x5')][_0xe8d0('0x18')]);util['showNotification'](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],null,this[_0xe8d0('0x4')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']],'RINGING'+(this[_0xe8d0('0x4')][_0xe8d0('0x12')]?_0xe8d0('0x1b'):''));}else{logger['debug'](_0xe8d0('0x1c'),this[_0xe8d0('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xe8d0('0x6')][_0xe8d0('0x8')](this),0x3e8);}}};Agent[_0xe8d0('0xa')][_0xe8d0('0x9')]=function(_0x3cf3d6){if(_['isNil'](this[_0xe8d0('0x14')]['agents'][this['agent']['id']])){return logger['debug'](_0xe8d0('0x11'),this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0xe')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe8d0('0x5')]['id'],this['agent']['id']);util[_0xe8d0('0x1d')](this[_0xe8d0('0x19')],this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']],null,this[_0xe8d0('0x4')]);this[_0xe8d0('0x14')][_0xe8d0('0x10')][this[_0xe8d0('0xe')]['id']]['busy']=![];this[_0xe8d0('0x14')][_0xe8d0('0x10')][this['agent']['id']][_0xe8d0('0x16')]=undefined;util['removeWaitingNotification'](this[_0xe8d0('0x14')],this['routing'],this[_0xe8d0('0xe')],this['squeue'][_0xe8d0('0x18')]);util[_0xe8d0('0x1a')](this[_0xe8d0('0x5')]['id'],this[_0xe8d0('0x14')]['agents'][this[_0xe8d0('0xe')]['id']],_0x3cf3d6?_0xe8d0('0x1e'):_0xe8d0('0x1f'));}if(!_0x3cf3d6){setTimeout(this['push'][_0xe8d0('0x8')](this),0x3e8);}};function agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41){return new Agent(_0xa02b8d,_0xdfc807,_0x9cb99b,_0x1ecd41);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 2c5e70b..e1c9b57 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 _0x1c06=['saveWaitingNotification','channel','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','removeWaitingNotification','exports','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','length','Agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','writeLog','busy','busyQueue','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c06,0x17f));var _0x61c0=function(_0x56ea6f,_0x15535a){_0x56ea6f=_0x56ea6f-0x0;var _0x43ac31=_0x1c06[_0x56ea6f];return _0x43ac31;};'use strict';var _=require('lodash');var uuid=require(_0x61c0('0x0'));var util=require('./util');var logger=require(_0x61c0('0x1'))(_0x61c0('0x2'));var Beepall=function(_0x2dfccd,_0x5ef732,_0x58fdcc,_0x8da5ad){this[_0x61c0('0x3')]=uuid['v4']();this[_0x61c0('0x4')]=_0x2dfccd;this[_0x61c0('0x5')]=_0x5ef732;this[_0x61c0('0x6')]=_0x58fdcc;this[_0x61c0('0x2')]=_0x8da5ad;this[_0x61c0('0x4')][_0x61c0('0x7')](this['handleRun'][_0x61c0('0x8')](this),this['handleTimeout']['bind'](this));this[_0x61c0('0x4')]['on'](_0x61c0('0x9'),this[_0x61c0('0xa')][_0x61c0('0x8')](this));this[_0x61c0('0x4')]['on'](_0x61c0('0xb'),this[_0x61c0('0xc')][_0x61c0('0x8')](this));};Beepall[_0x61c0('0xd')][_0x61c0('0x7')]=function(){this[_0x61c0('0x4')][_0x61c0('0x7')](this[_0x61c0('0xe')][_0x61c0('0x8')](this),this[_0x61c0('0xa')]['bind'](this));};Beepall[_0x61c0('0xd')][_0x61c0('0xc')]=function(){this[_0x61c0('0xa')](!![]);};Beepall[_0x61c0('0xd')][_0x61c0('0xe')]=function(){var _0x29d9d1=!![];if(!_[_0x61c0('0xf')](this[_0x61c0('0x5')])&&!_['isNil'](this[_0x61c0('0x5')]['Agents'])&&this[_0x61c0('0x5')]['Agents'][_0x61c0('0x10')]>0x0){for(var _0x5879e3=0x0,_0x6c196;_0x5879e30x0){for(var _0x412904=0x0,_0x4236e5;_0x4129040x0&&_0x326caf[_0x47e869+'CurrentCapacity']>=_0x326caf[_0x47e869+_0x1f0f('0x25')]){writeLog(_0x2b7d59,_0x326caf,_0x47e869[_0x1f0f('0x27')]()+_0x1f0f('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x2b8635,_0x163ed2,_0x415bad,_0x464c57,_0x5ab5fc){return sendNotification(!![],_0x2b8635,_0x163ed2,_0x415bad,_0x464c57,_0x5ab5fc);};exports[_0x1f0f('0x29')]=function(_0x31887e,_0x242baa,_0x473f84,_0x3ce818,_0x17fa03){return sendNotification(![],_0x31887e,_0x242baa,_0x473f84,_0x3ce818,_0x17fa03);};exports['checkWaitingNotifications']=function(_0x2a99f6,_0x153d47,_0x380b36){var _0xc959a6=_0x153d47[_0x1f0f('0x2a')][_0x1f0f('0x2b')];if(!_0xc959a6&&_0x380b36){_0xc959a6=_0x380b36['id'];}var _0x3b7aaa=_[_0x1f0f('0x2c')](_0x2a99f6[_0x153d47[_0x1f0f('0x2d')]+'QueuesWaitingInteractions'],function(_0x36002c){var _0xf6cb9d=_[_0x1f0f('0x2e')](_0x153d47[_0x1f0f('0x2d')])+'InteractionId';return _0x36002c[_0xf6cb9d]===_0x153d47[_0x1f0f('0x2a')]['id'];});if(!_0x3b7aaa&&_0xc959a6&&_0x2a99f6[_0x1f0f('0x2f')][_0xc959a6]){_0x3b7aaa=_[_0x1f0f('0x2c')](_0x2a99f6[_0x1f0f('0x2f')][_0xc959a6][_0x153d47[_0x1f0f('0x2d')]+_0x1f0f('0x30')],function(_0x4bcff0){return _0x4bcff0['id']===_0x153d47[_0x1f0f('0x2a')]['id'];});}return _0x3b7aaa;};exports[_0x1f0f('0x31')]=function(_0x200306,_0xb515a5,_0x47036a,_0x49cecf){if(_0x47036a&&_0x47036a['id']&&_0x200306[_0x1f0f('0x2f')]&&_0x200306['agents'][_0x47036a['id']]){_0x200306[_0x1f0f('0x2f')][_0x47036a['id']][_0x49cecf+_0x1f0f('0x30')][_0xb515a5['message']['id']]={'id':_0xb515a5['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x5941b5,_0x463432,_0x145854,_0x1a3c05){if(_0x145854&&_0x145854['id']&&_0x5941b5[_0x1f0f('0x2f')]&&_0x5941b5['agents'][_0x145854['id']]){delete _0x5941b5[_0x1f0f('0x2f')][_0x145854['id']][_0x1a3c05+_0x1f0f('0x30')][_0x463432[_0x1f0f('0x16')]['id']];}};exports[_0x1f0f('0x32')]=writeLog; \ No newline at end of file +var _0xba87=['OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','QueuesWaitingInteractions','capitalize','InteractionId','channel','WaitingInteractions','saveWaitingNotification','agents','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','name','notificationSound','account','notificationShake','body','queue','notificationTemplate','msg','format','message','user:%s','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online'];(function(_0x3517d9,_0x1e6703){var _0x29a2f4=function(_0x29efb9){while(--_0x29efb9){_0x3517d9['push'](_0x3517d9['shift']());}};_0x29a2f4(++_0x1e6703);}(_0xba87,0xe1));var _0x7ba8=function(_0x4ef34e,_0x11ac32){_0x4ef34e=_0x4ef34e-0x0;var _0x3a6f82=_0xba87[_0x4ef34e];return _0x3a6f82;};'use strict';var _=require(_0x7ba8('0x0'));var util=require('util');var utils=require(_0x7ba8('0x1'));var Redis=require(_0x7ba8('0x2'));var config=require(_0x7ba8('0x3'));var logger=require(_0x7ba8('0x4'))(_0x7ba8('0x5'));config['redis']=_[_0x7ba8('0x6')](config[_0x7ba8('0x7')],{'host':_0x7ba8('0x8'),'port':0x18eb});var io=require(_0x7ba8('0x9'))(new Redis(config[_0x7ba8('0x7')]));function sendNotification(_0x3b3533,_0x2d99f9,_0x5a94bc,_0x2584cc,_0x3e8626,_0x39dc36){var _0x2e106f=_0x39dc36||{};var _0x1fdc76=_0x5a94bc['split']('.');var _0x5577a7={'uniqueid':_0x2d99f9,'channel':_0x1fdc76[0x0],'id':_0x1fdc76[0x1],'title':_0x1fdc76[0x0]+'\x20interaction','interactionId':_0x1fdc76[0x2],'queue':_0x3e8626?_0x3e8626[_0x7ba8('0xa')]:null,'sound':_0x2e106f['account'][_0x7ba8('0xb')],'shake':_0x2e106f[_0x7ba8('0xc')][_0x7ba8('0xd')]};try{if(!_0x2e106f[_0x7ba8('0xe')]){_0x2e106f['body']={};}if(_0x3e8626){_0x2e106f[_0x7ba8('0xe')][_0x7ba8('0xf')]=_0x3e8626;}else if(_0x2e106f[_0x7ba8('0xe')][_0x7ba8('0xf')]){delete _0x2e106f['body'][_0x7ba8('0xf')];}_0x5577a7['msg']=utils['getMustacheRender'](_0x2e106f[_0x7ba8('0xc')][_0x7ba8('0x10')],_0x2e106f);}catch(_0x39e7c9){_0x5577a7[_0x7ba8('0x11')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x7ba8('0x12')]('[%s][QUEUE]\x20%s',_0x2d99f9,_0x39e7c9[_0x7ba8('0x13')]));}io['to'](util[_0x7ba8('0x12')](_0x7ba8('0x14'),_0x2584cc[_0x7ba8('0xa')]))['emit'](util[_0x7ba8('0x12')](_0x7ba8('0x15'),_0x3b3533?_0x7ba8('0x16'):_0x7ba8('0x17')),_0x5577a7);}function writeLog(_0x3061fc,_0x52a898,_0x271da7){return logger[_0x7ba8('0x18')](util[_0x7ba8('0x12')](_0x7ba8('0x19'),_0x3061fc,_0x52a898[_0x7ba8('0xa')],_0x271da7));}exports[_0x7ba8('0x1a')]=function(_0x7c68e1,_0x1a86a6,_0x5bc415,_0x55c276){if(_0x1a86a6[_0x7ba8('0x1b')]){writeLog(_0x7c68e1,_0x1a86a6,_0x7ba8('0x1c'));return![];}if(!_0x1a86a6[_0x7ba8('0x1d')]){writeLog(_0x7c68e1,_0x1a86a6,_0x7ba8('0x1e'));return![];}if(_0x1a86a6[_0x5bc415+_0x7ba8('0x1f')]){writeLog(_0x7c68e1,_0x1a86a6,'PAUSE');return![];}if(_0x55c276&&_0x1a86a6['hasOwnProperty'](_0x5bc415+'Capacity')&&_0x1a86a6[_0x7ba8('0x20')](_0x5bc415+'CurrentCapacity')){if(_0x1a86a6[_0x5bc415+_0x7ba8('0x21')]>0x0&&_0x1a86a6[_0x5bc415+_0x7ba8('0x22')]>=_0x1a86a6[_0x5bc415+_0x7ba8('0x21')]){writeLog(_0x7c68e1,_0x1a86a6,_0x5bc415['toUpperCase']()+_0x7ba8('0x23'));return![];}}return!![];};exports[_0x7ba8('0x24')]=function(_0x52f387,_0x2ad996,_0x27096f,_0x45a2d9,_0x16799a){return sendNotification(!![],_0x52f387,_0x2ad996,_0x27096f,_0x45a2d9,_0x16799a);};exports[_0x7ba8('0x25')]=function(_0x3a05e7,_0x28f247,_0x3bc762,_0x30ef65,_0x1628b8){return sendNotification(![],_0x3a05e7,_0x28f247,_0x3bc762,_0x30ef65,_0x1628b8);};exports[_0x7ba8('0x26')]=function(_0x1efb58,_0x52dc05,_0x4d81ba){var _0x1a2321=_0x52dc05[_0x7ba8('0x27')][_0x7ba8('0x28')];if(!_0x1a2321&&_0x4d81ba){_0x1a2321=_0x4d81ba['id'];}var _0x132d0c=_[_0x7ba8('0x29')](_0x1efb58[_0x52dc05['channel']+_0x7ba8('0x2a')],function(_0xba4f0a){var _0x2a75b6=_[_0x7ba8('0x2b')](_0x52dc05['channel'])+_0x7ba8('0x2c');return _0xba4f0a[_0x2a75b6]===_0x52dc05['interaction']['id'];});if(!_0x132d0c&&_0x1a2321&&_0x1efb58['agents'][_0x1a2321]){_0x132d0c=_['some'](_0x1efb58['agents'][_0x1a2321][_0x52dc05[_0x7ba8('0x2d')]+_0x7ba8('0x2e')],function(_0x1cf518){return _0x1cf518['id']===_0x52dc05[_0x7ba8('0x27')]['id'];});}return _0x132d0c;};exports[_0x7ba8('0x2f')]=function(_0x3cf335,_0x344603,_0x4f061e,_0x54841f){if(_0x4f061e&&_0x4f061e['id']&&_0x3cf335['agents']&&_0x3cf335[_0x7ba8('0x30')][_0x4f061e['id']]){_0x3cf335[_0x7ba8('0x30')][_0x4f061e['id']][_0x54841f+_0x7ba8('0x2e')][_0x344603[_0x7ba8('0x13')]['id']]={'id':_0x344603['interaction']['id']};}};exports[_0x7ba8('0x31')]=function(_0x48f690,_0x535525,_0x59ad73,_0x3689b4){if(_0x59ad73&&_0x59ad73['id']&&_0x48f690[_0x7ba8('0x30')]&&_0x48f690['agents'][_0x59ad73['id']]){delete _0x48f690['agents'][_0x59ad73['id']][_0x3689b4+_0x7ba8('0x2e')][_0x535525[_0x7ba8('0x13')]['id']];}};exports[_0x7ba8('0x32')]=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 b4927c3..728e817 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 _0x26f5=['isEmpty','body','error','isObject','stringify','validate','shelljs','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x542e11,_0x2af7df){var _0x5e4338=function(_0x36be24){while(--_0x36be24){_0x542e11['push'](_0x542e11['shift']());}};_0x5e4338(++_0x2af7df);}(_0x26f5,0x16d));var _0x526f=function(_0x1b358a,_0x1d5677){_0x1b358a=_0x1b358a-0x0;var _0xf08a94=_0x26f5[_0x1b358a];return _0xf08a94;};'use strict';var schema=require(_0x526f('0x0'));var sh=require(_0x526f('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x526f('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0x526f('0x3')}});exports[_0x526f('0x4')]=function(_0x51ad8e,_0x436689){return function(_0x49ef16){try{var _0x4046f4={'command':_0x436689[0x0]};var _0x488413=system[_0x526f('0x0')](_0x4046f4,{'typecast':!![]});if(_0x488413[_0x526f('0x5')]){logger['error'](_0x526f('0x6'),_0x51ad8e,_[_0x526f('0x7')](_0x488413,_0x526f('0x8'))['join'](',\x20'));logger[_0x526f('0x9')](_0x526f('0xa'),_0x51ad8e);_0x49ef16[_0x526f('0xb')]();}else{var _0x326899=this;var _0x501f34=utils['getMustacheRender'](_0x436689[0x0],this);logger[_0x526f('0x9')](_0x526f('0xc'),_0x51ad8e,_0x501f34);sh['exec'](_[_0x526f('0xd')](_0x501f34),function(_0x7c2f9b,_0x3bf5dc){logger[_0x526f('0x9')](_0x526f('0xe'),_0x51ad8e,_0x7c2f9b);if(_0x7c2f9b==0x0){var _0x4baf93=_0x3bf5dc['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x436689[0x1])||_[_0x526f('0xf')](_0x436689[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x51ad8e);_0x326899[_0x526f('0x10')][_0x436689[0x1]]=_0x4baf93;}else{logger[_0x526f('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x51ad8e,_0x436689[0x1],_0x4baf93);_0x326899[_0x526f('0x10')][_0x436689[0x1]]=_0x4baf93;}}_0x49ef16['next']();});}}catch(_0x2f140d){logger[_0x526f('0x11')]('[%s][SYSTEM]\x20%s',_0x51ad8e,_[_0x526f('0x12')](_0x2f140d)?JSON[_0x526f('0x13')](_0x2f140d):_0x2f140d);logger[_0x526f('0x9')](_0x526f('0xa'),_0x51ad8e);_0x49ef16[_0x526f('0xb')]();}};}; \ No newline at end of file +var _0x36bb=['shelljs','lodash','../../../../config/logger','routing','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate'];(function(_0x45d0f5,_0x56e5d8){var _0x34ee47=function(_0x3b0ba3){while(--_0x3b0ba3){_0x45d0f5['push'](_0x45d0f5['shift']());}};_0x34ee47(++_0x56e5d8);}(_0x36bb,0xdf));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xb36b('0x0'));var sh=require(_0xb36b('0x1'));var _=require(_0xb36b('0x2'));var utils=require('./utils');var logger=require(_0xb36b('0x3'))(_0xb36b('0x4'));var system=schema({'command':{'type':_0xb36b('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb36b('0x6')]=function(_0x437292,_0x19b4ee){return function(_0x1fbdb7){try{var _0x4f840f={'command':_0x19b4ee[0x0]};var _0x4754bd=system[_0xb36b('0x0')](_0x4f840f,{'typecast':!![]});if(_0x4754bd[_0xb36b('0x7')]){logger[_0xb36b('0x8')](_0xb36b('0x9'),_0x437292,_[_0xb36b('0xa')](_0x4754bd,_0xb36b('0xb'))[_0xb36b('0xc')](',\x20'));logger[_0xb36b('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x437292);_0x1fbdb7[_0xb36b('0xe')]();}else{var _0x47becf=this;var _0x579dfa=utils[_0xb36b('0xf')](_0x19b4ee[0x0],this);logger[_0xb36b('0xd')](_0xb36b('0x10'),_0x437292,_0x579dfa);sh[_0xb36b('0x11')](_[_0xb36b('0x12')](_0x579dfa),function(_0x111dc,_0x120ce0){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x437292,_0x111dc);if(_0x111dc==0x0){var _0x35efb8=_0x120ce0[_0xb36b('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xb36b('0x14')](_0x19b4ee[0x1])||_[_0xb36b('0x15')](_0x19b4ee[0x1])){logger['info'](_0xb36b('0x16'),_0x437292);_0x47becf[_0xb36b('0x17')][_0x19b4ee[0x1]]=_0x35efb8;}else{logger[_0xb36b('0xd')](_0xb36b('0x18'),_0x437292,_0x19b4ee[0x1],_0x35efb8);_0x47becf['body'][_0x19b4ee[0x1]]=_0x35efb8;}}_0x1fbdb7[_0xb36b('0xe')]();});}}catch(_0x1d8019){logger[_0xb36b('0x8')](_0xb36b('0x9'),_0x437292,_[_0xb36b('0x19')](_0x1d8019)?JSON[_0xb36b('0x1a')](_0x1d8019):_0x1d8019);logger[_0xb36b('0xd')](_0xb36b('0x1b'),_0x437292);_0x1fbdb7[_0xb36b('0xe')]();}};}; \ 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 93731ff..7cf2a62 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 _0x29f2=['../../../../config/logger','routing','consequence','length','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','info','catch','error','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x237f9e,_0x360aa9){var _0x3b9a9c=function(_0x1453d2){while(--_0x1453d2){_0x237f9e['push'](_0x237f9e['shift']());}};_0x3b9a9c(++_0x360aa9);}(_0x29f2,0x1d4));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x229f('0x0'));var _=require(_0x229f('0x1'));var rpc={'chatInteraction':require(_0x229f('0x2')),'openchannelInteraction':require(_0x229f('0x3')),'smsInteraction':require(_0x229f('0x4')),'mailInteraction':require(_0x229f('0x5')),'faxInteraction':require(_0x229f('0x6')),'whatsappInteraction':require(_0x229f('0x7'))};var logger=require(_0x229f('0x8'))(_0x229f('0x9'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x229f('0xa')]=function(_0x4cd9b1,_0x2f73fc,_0x3f6678,_0x4c1c16){return function(_0x4242e6){try{var _0x378a8e={'tag':_0x2f73fc[0x0]};var _0x5cc860=tag[_0x229f('0x0')](_0x378a8e,{'typecast':!![]});if(_0x5cc860[_0x229f('0xb')]){logger['error'](_0x229f('0xc'),_0x4cd9b1,_['map'](_0x5cc860,_0x229f('0xd'))[_0x229f('0xe')](',\x20'));logger['info'](_0x229f('0xf'),_0x4cd9b1);_0x4242e6['next']();}else{var _0x224a86={'ids':[_0x2f73fc[0x0]]};if(rpc[_0x4c1c16[_0x229f('0x10')]+_0x229f('0x11')]){rpc[_0x4c1c16[_0x229f('0x10')]+_0x229f('0x11')][_0x229f('0x12')](_0x4c1c16[_0x229f('0x13')]['id'],_0x224a86)[_0x229f('0x14')](function(_0x583e4f){logger[_0x229f('0x15')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4cd9b1,_0x2f73fc[0x1],_0x4c1c16[_0x229f('0x10')],_0x4c1c16[_0x229f('0x13')]['id']);})[_0x229f('0x16')](function(_0x273835){logger[_0x229f('0x17')](_0x229f('0xc'),_0x4cd9b1,JSON[_0x229f('0x18')](_0x273835));logger['info'](_0x229f('0xf'),_0x4cd9b1);})[_0x229f('0x19')](function(){_0x4242e6[_0x229f('0x1a')]();});}}}catch(_0x54a452){logger[_0x229f('0x17')]('[%s][TAG]\x20%s',_0x4cd9b1,_[_0x229f('0x1b')](_0x54a452)?JSON[_0x229f('0x18')](_0x54a452):_0x54a452);logger[_0x229f('0x15')](_0x229f('0xf'),_0x4cd9b1);_0x4242e6[_0x229f('0x1a')]();}};}; \ No newline at end of file +var _0x5f38=['stringify','finally','next','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error'];(function(_0x15c2a0,_0x1d7138){var _0x415001=function(_0x4ce67d){while(--_0x4ce67d){_0x15c2a0['push'](_0x15c2a0['shift']());}};_0x415001(++_0x1d7138);}(_0x5f38,0xba));var _0x85f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f38[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x85f3('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x85f3('0x1')),'openchannelInteraction':require(_0x85f3('0x2')),'smsInteraction':require(_0x85f3('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x85f3('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x85f3('0x5'))(_0x85f3('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x85f3('0x7')}});exports[_0x85f3('0x8')]=function(_0x3a95bd,_0x5ea48c,_0x4c10c3,_0x1615c5){return function(_0x12b76f){try{var _0x6bacd1={'tag':_0x5ea48c[0x0]};var _0x1769f3=tag[_0x85f3('0x0')](_0x6bacd1,{'typecast':!![]});if(_0x1769f3[_0x85f3('0x9')]){logger['error'](_0x85f3('0xa'),_0x3a95bd,_[_0x85f3('0xb')](_0x1769f3,_0x85f3('0xc'))[_0x85f3('0xd')](',\x20'));logger[_0x85f3('0xe')](_0x85f3('0xf'),_0x3a95bd);_0x12b76f['next']();}else{var _0x48a2f9={'ids':[_0x5ea48c[0x0]]};if(rpc[_0x1615c5[_0x85f3('0x10')]+_0x85f3('0x11')]){rpc[_0x1615c5[_0x85f3('0x10')]+_0x85f3('0x11')][_0x85f3('0x12')](_0x1615c5[_0x85f3('0x13')]['id'],_0x48a2f9)['then'](function(_0x184cdb){logger[_0x85f3('0xe')](_0x85f3('0x14'),_0x3a95bd,_0x5ea48c[0x1],_0x1615c5[_0x85f3('0x10')],_0x1615c5[_0x85f3('0x13')]['id']);})['catch'](function(_0x323a79){logger[_0x85f3('0x15')](_0x85f3('0xa'),_0x3a95bd,JSON[_0x85f3('0x16')](_0x323a79));logger[_0x85f3('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3a95bd);})[_0x85f3('0x17')](function(){_0x12b76f[_0x85f3('0x18')]();});}}}catch(_0x620c7){logger[_0x85f3('0x15')](_0x85f3('0xa'),_0x3a95bd,_[_0x85f3('0x19')](_0x620c7)?JSON[_0x85f3('0x16')](_0x620c7):_0x620c7);logger['info'](_0x85f3('0xf'),_0x3a95bd);_0x12b76f[_0x85f3('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 ed9b1dc..7343aab 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 _0x3f68=['error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','method','login','push','params','stringify','POST','application/json-rpc','result','logged','channelId=','&serviceId=','&data=','info','stop','catch'];(function(_0x4db8e2,_0x5af414){var _0x42e3bc=function(_0x17fcae){while(--_0x17fcae){_0x4db8e2['push'](_0x4db8e2['shift']());}};_0x42e3bc(++_0x5af414);}(_0x3f68,0x1e5));var _0x83f6=function(_0x4711e0,_0x5bbac2){_0x4711e0=_0x4711e0-0x0;var _0x38a8d1=_0x3f68[_0x4711e0];return _0x38a8d1;};'use strict';var rp=require(_0x83f6('0x0'));var logger=require(_0x83f6('0x1'))(_0x83f6('0x2'));var _=require('lodash');var arr=[];exports[_0x83f6('0x3')]=function(_0x2cbac8,_0x5e7298){return function(_0x52eaa3){var _0x4ebc88=_0x5e7298[0xa];var _0x412997=_0x5e7298[0xb];var _0xfbbcf4=_0x5e7298[0xc];var _0xcdbfd8=_0x5e7298[0xd];var _0x49f2a8=_0x5e7298[0xe];var _0x1b459f=_0x5e7298[0xf][_0x83f6('0x4')](/\n/g,_0x83f6('0x5'));var _0x172558=_0x5e7298[0x10][_0x83f6('0x4')](/\n/g,'\x20');if(!arr[_0x83f6('0x6')](_0x412997)){arr['push'](_0x412997);var _0x17b2c6=_0x5e7298[0x3];var _0x929c19=_0x5e7298[0x4];var _0x4631fc=_0x5e7298[0x1];var _0x694c5f=_0x5e7298[0x0];var _0x528c4b={};_0x528c4b[_0x83f6('0x7')]=_0x5e7298[0x8]+'?params='+_0xfbbcf4+'|'+_0x4ebc88+'|'+_0xcdbfd8+'|'+_0x412997+'|'+_0x49f2a8;_0x528c4b[_0x83f6('0x8')]=_0x5e7298[0x7]+_0x83f6('0x9')+_0xfbbcf4+'|'+_0x4ebc88+'|'+_0xcdbfd8+'|'+_0x412997+'|'+_0x49f2a8+'|'+_0x1b459f+'|'+_0x172558;_0x528c4b[_0x83f6('0xa')]=_0x5e7298[0x9];var _0x1f9a9f={};_0x1f9a9f[_0x83f6('0xb')]='2.0';_0x1f9a9f[_0x83f6('0xc')]=_0x83f6('0xd');var _0x3b98ae=[];_0x3b98ae[_0x83f6('0xe')](_0x5e7298[0x2]);_0x3b98ae[_0x83f6('0xe')](_0x5e7298[0x5]);_0x3b98ae[_0x83f6('0xe')](_0x5e7298[0x6]);_0x1f9a9f[_0x83f6('0xf')]=_0x3b98ae;_0x1f9a9f['id']=0x1;var _0xa5b0c1=JSON[_0x83f6('0x10')](_0x1f9a9f);var _0x1a3301={'encoding':'utf8','method':_0x83f6('0x11'),'timeout':0x2710,'url':_0x17b2c6,'headers':{'Content-Type':_0x83f6('0x12')},'body':_0xa5b0c1};return rp(_0x1a3301)['then'](function(_0x14d02a){const _0x431908=JSON['parse'](_0x14d02a);if(!_0x431908[_0x83f6('0x13')][_0x83f6('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1dac13=_0x412997;var _0x141ada=_0x83f6('0x15')+_0x4631fc+_0x83f6('0x16')+_0x694c5f+'&sessionId='+_0x1dac13+_0x83f6('0x17')+JSON[_0x83f6('0x10')](_0x528c4b);var _0x28872a=_0x929c19+'?'+_0x141ada;return rp(_0x28872a);})['then'](function(_0x5e1bc6){logger[_0x83f6('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2cbac8,_0x5e1bc6);_0x52eaa3[_0x83f6('0x19')]();})[_0x83f6('0x1a')](function(_0x92a2fa){logger[_0x83f6('0x1b')](_0x83f6('0x1c'),_0x2cbac8,_[_0x83f6('0x1d')](_0x92a2fa)?JSON[_0x83f6('0x10')](_0x92a2fa):_0x92a2fa);_0x52eaa3['stop']();});}else{logger[_0x83f6('0x18')](_0x83f6('0x1e'),_0x2cbac8);_0x52eaa3[_0x83f6('0x1f')]();}};}; \ No newline at end of file +var _0x37d3=['includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','stringify','POST','result','logged','channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace'];(function(_0x44e84d,_0x5aebed){var _0x198c73=function(_0x2b7bed){while(--_0x2b7bed){_0x44e84d['push'](_0x44e84d['shift']());}};_0x198c73(++_0x5aebed);}(_0x37d3,0xfb));var _0x337d=function(_0x52aeff,_0x12f130){_0x52aeff=_0x52aeff-0x0;var _0x2d4047=_0x37d3[_0x52aeff];return _0x2d4047;};'use strict';var rp=require('request-promise');var logger=require(_0x337d('0x0'))(_0x337d('0x1'));var _=require(_0x337d('0x2'));var arr=[];exports[_0x337d('0x3')]=function(_0x3a3855,_0x534ef1){return function(_0x2b8f05){var _0xb41388=_0x534ef1[0xa];var _0x438725=_0x534ef1[0xb];var _0x13ee6f=_0x534ef1[0xc];var _0x3a0177=_0x534ef1[0xd];var _0x5daf57=_0x534ef1[0xe];var _0x3e2d22=_0x534ef1[0xf]['replace'](/\n/g,'\x20-\x20');var _0x56d4f3=_0x534ef1[0x10][_0x337d('0x4')](/\n/g,'\x20');if(!arr[_0x337d('0x5')](_0x438725)){arr[_0x337d('0x6')](_0x438725);var _0x76b84d=_0x534ef1[0x3];var _0xabe886=_0x534ef1[0x4];var _0x1da7a4=_0x534ef1[0x1];var _0x521f9f=_0x534ef1[0x0];var _0x20777d={};_0x20777d[_0x337d('0x7')]=_0x534ef1[0x8]+'?params='+_0x13ee6f+'|'+_0xb41388+'|'+_0x3a0177+'|'+_0x438725+'|'+_0x5daf57;_0x20777d[_0x337d('0x8')]=_0x534ef1[0x7]+_0x337d('0x9')+_0x13ee6f+'|'+_0xb41388+'|'+_0x3a0177+'|'+_0x438725+'|'+_0x5daf57+'|'+_0x3e2d22+'|'+_0x56d4f3;_0x20777d[_0x337d('0xa')]=_0x534ef1[0x9];var _0xbbb203={};_0xbbb203[_0x337d('0xb')]=_0x337d('0xc');_0xbbb203[_0x337d('0xd')]=_0x337d('0xe');var _0x45363f=[];_0x45363f['push'](_0x534ef1[0x2]);_0x45363f[_0x337d('0x6')](_0x534ef1[0x5]);_0x45363f[_0x337d('0x6')](_0x534ef1[0x6]);_0xbbb203['params']=_0x45363f;_0xbbb203['id']=0x1;var _0x55f248=JSON[_0x337d('0xf')](_0xbbb203);var _0x274f83={'encoding':'utf8','method':_0x337d('0x10'),'timeout':0x2710,'url':_0x76b84d,'headers':{'Content-Type':'application/json-rpc'},'body':_0x55f248};return rp(_0x274f83)['then'](function(_0x3e7249){const _0x37432e=JSON['parse'](_0x3e7249);if(!_0x37432e[_0x337d('0x11')][_0x337d('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x67e324=_0x438725;var _0x1aa75d=_0x337d('0x13')+_0x1da7a4+_0x337d('0x14')+_0x521f9f+_0x337d('0x15')+_0x67e324+_0x337d('0x16')+JSON['stringify'](_0x20777d);var _0x470fdc=_0xabe886+'?'+_0x1aa75d;return rp(_0x470fdc);})[_0x337d('0x17')](function(_0xab9ea8){logger[_0x337d('0x18')](_0x337d('0x19'),_0x3a3855,_0xab9ea8);_0x2b8f05[_0x337d('0x1a')]();})[_0x337d('0x1b')](function(_0x18919b){logger[_0x337d('0x1c')]('[%s][TVOX]\x20%s',_0x3a3855,_[_0x337d('0x1d')](_0x18919b)?JSON[_0x337d('0xf')](_0x18919b):_0x18919b);_0x2b8f05[_0x337d('0x1a')]();});}else{logger[_0x337d('0x18')](_0x337d('0x1e'),_0x3a3855);_0x2b8f05[_0x337d('0x1f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 0a83fbd..bfb0fa4 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x55d62b,_0x6f3c92){var _0x4de65e=function(_0x215857){while(--_0x215857){_0x55d62b['push'](_0x55d62b['shift']());}};_0x4de65e(++_0x6f3c92);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4eabe4,_0x400d30){var _0x2c5bec=function(_0x2bb5ed){while(--_0x2bb5ed){_0x4eabe4['push'](_0x4eabe4['shift']());}};_0x2c5bec(++_0x400d30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 321d243..ea9b61c 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 _0x8165=['tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','transfer','isArray','applications','length','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x8165,0x1c3));var _0x5816=function(_0x1e689f,_0x1cc074){_0x1e689f=_0x1e689f-0x0;var _0x465896=_0x8165[_0x1e689f];return _0x465896;};'use strict';var _=require(_0x5816('0x0'));var util=require(_0x5816('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5816('0x2'));var BPromise=require(_0x5816('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x5816('0x4'));var logger=require(_0x5816('0x5'))(_0x5816('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x5816('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5816('0x8')),'faxQueueReport':require(_0x5816('0x9')),'whatsappQueueReport':require(_0x5816('0xa'))};var RuleEngine=require(_0x5816('0xb'));function getId(_0x1a447f,_0x234305,_0xee9a93){return util['format']('%s.%s.%s',_0x1a447f,_0x234305||0x0,_0xee9a93||0x0);}function getIntervals(_0xfecaef,_0x18bbde){var _0x2a5a49=[];if(!_['isNil'](_0x18bbde[_0x5816('0xc')])&&!_[_0x5816('0xd')](_0xfecaef[_0x18bbde[_0x5816('0xc')]])&&!_['isNil'](_0xfecaef[_0x18bbde[_0x5816('0xc')]][_0x5816('0xe')])){_0x2a5a49=_[_0x5816('0xf')](_0xfecaef[_0x18bbde['IntervalId']][_0x5816('0xe')],_0x5816('0x10'));}else if(!_[_0x5816('0xd')](_0x18bbde[_0x5816('0x10')])){_0x2a5a49=[_0x18bbde[_0x5816('0x10')]];}return _0x2a5a49;}exports[_0x5816('0x11')]=function(_0x2c8d5f){_0x2c8d5f[_0x5816('0x12')]={};return new BPromise(function(_0x14f111,_0x141985){var _0x4da805={'Start':function(_0x135581){var _0x5ded88=this;return new Promise(function(_0x3a9619,_0x1711a3){if(_0x135581){try{var _0x372b3a=[];var _0x4c0718=getId(_0x135581[_0x5816('0x13')],_0x135581[_0x5816('0x14')]?_0x135581[_0x5816('0x14')]['id']:0x0,_0x135581[_0x5816('0x15')]?_0x135581[_0x5816('0x15')]['id']:0x0);var _0x5cb54d=sUtils['checkWaitingNotifications'](_0x2c8d5f,_0x135581);if(_0x135581[_0x5816('0x16')]||!_0x5cb54d&&_0x135581['applications']&&_[_0x5816('0x17')](_0x135581['applications'])&&_0x135581[_0x5816('0x18')][_0x5816('0x19')]){for(var _0x1d307c=0x0;_0x1d307c<_0x135581[_0x5816('0x18')][_0x5816('0x19')];_0x1d307c+=0x1){var _0x390acf=_0x135581[_0x5816('0x18')][_0x1d307c];if(fs['existsSync'](path[_0x5816('0x1a')](__dirname,_0x5816('0x18'),_0x390acf[_0x5816('0x1b')]+_0x5816('0x1c')))){var _0x20e88b=[];switch(_0x390acf['app'][_0x5816('0x1d')]()){case'autoreply':var _0x59b97d=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');if(_0x135581[_0x5816('0x13')]==='mail'){_0x20e88b[_0x5816('0x20')](_0x59b97d[0x0]);_0x20e88b[_0x5816('0x20')](_0x59b97d[0x1]);_0x20e88b[_0x5816('0x20')](_0x59b97d[_0x5816('0x21')](0x2,_0x59b97d['length'])[_0x5816('0x1a')](','));}else{_0x20e88b[_0x5816('0x20')](_0x59b97d[0x0]);_0x20e88b['push'](_0x59b97d[_0x5816('0x21')](0x1,_0x59b97d[_0x5816('0x19')])['join'](','));}break;case _0x5816('0x22'):var _0x4efbcf=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x4efbcf[0x0]);_0x20e88b['push'](_0x4efbcf[0x1]);_0x20e88b[_0x5816('0x20')](_0x4efbcf[_0x5816('0x21')](0x2,_0x4efbcf[_0x5816('0x19')])[_0x5816('0x1a')](','));break;case _0x5816('0x23'):var _0x4c184e=_0x390acf['appdata']['split'](',');_0x20e88b['push'](_0x4c184e[0x0]);_0x20e88b['push'](_0x4c184e[0x1]);_0x20e88b[_0x5816('0x20')](_0x4c184e[0x2]);_0x20e88b['push'](_0x4c184e[0x3]);_0x20e88b[_0x5816('0x20')](_0x4c184e[_0x5816('0x21')](0x4,_0x4c184e['length'])[_0x5816('0x1a')](','));break;case _0x5816('0x24'):var _0x19c99a=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x19c99a[0x0]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x1]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x2]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x3]);_0x20e88b['push'](_0x19c99a['slice'](0x4,_0x19c99a[_0x5816('0x19')])[_0x5816('0x1a')](','));break;case _0x5816('0x14'):_0x20e88b[_0x5816('0x20')](_0x390acf['appdata']);break;case _0x5816('0x25'):_0x20e88b[_0x5816('0x20')](_0x390acf[_0x5816('0x26')]);_0x20e88b[_0x5816('0x20')](_0x390acf[_0x5816('0x1e')]);break;case _0x5816('0x27'):var _0x3fea2e=utils[_0x5816('0x28')](_0x135581[_0x5816('0x29')]['notificationTemplate'],_0x135581);var _0x3e2309=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x3e2309[0x0]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x1]);_0x20e88b['push'](_0x3e2309[0x2]);_0x20e88b['push'](_0x3e2309[0x3]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x4]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x5]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x6]);_0x20e88b['push'](_0x3e2309[0x7]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x8]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x9]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0xa]);_0x20e88b['push'](_0x135581[_0x5816('0x15')]['id']);_0x20e88b[_0x5816('0x20')](_0x135581['message']['id']);_0x20e88b['push'](_0x390acf[_0x5816('0x2a')]);_0x20e88b[_0x5816('0x20')](_0x135581['interaction'][_0x5816('0x2b')]);_0x20e88b[_0x5816('0x20')](_0x135581[_0x5816('0x2c')][_0x5816('0x2c')]);_0x20e88b['push'](_0x3fea2e);break;default:_0x20e88b=_[_0x5816('0xd')](_0x390acf['appdata'])?[]:_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');}var _0x24e73a={'id':util[_0x5816('0x2d')](_0x5816('0x2e'),_0x4c0718,_0x390acf['id'],_0x390acf[_0x5816('0x1b')]),'condition':require(_0x5816('0x2f'))[_0x5816('0x30')](_0x4c0718,getIntervals(_0x2c8d5f['intervals'],_0x390acf),_0x2c8d5f),'consequence':require(_0x5816('0x31')+_0x390acf['app'])['consequence'](_0x4c0718,_0x20e88b,_0x2c8d5f,_0x135581),'p':_0x390acf[_0x5816('0x32')]||0x0};logger[_0x5816('0x33')](_0x5816('0x34'),_0x24e73a['id'],_0x5816('0x35'),getIntervals(_0x2c8d5f[_0x5816('0x36')],_0x390acf)[_0x5816('0x1a')](_0x5816('0x37')));_0x372b3a[_0x5816('0x20')](_0x24e73a);}else{logger[_0x5816('0x38')](_0x5816('0x39'),path['join'](__dirname,_0x5816('0x18'),_0x390acf[_0x5816('0x1b')]+_0x5816('0x1c')));}}_0x2c8d5f['rules'][_0x4c0718]=new RuleEngine(_0x372b3a);_0x2c8d5f[_0x5816('0x12')][_0x4c0718]['execute'](_0x135581,function(_0x5904fb){logger['info'](_0x5816('0x3a'),JSON[_0x5816('0x3b')](_0x5904fb['matchPath']));if(_0x2c8d5f[_0x5816('0x12')][_0x4c0718]){_0x2c8d5f[_0x5816('0x12')][_0x4c0718][_0x5816('0x3c')]('complete');}});return _0x3a9619({'code':0xc8,'message':_0x135581});}else{if(_0x5cb54d){logger[_0x5816('0x33')](util[_0x5816('0x2d')](_0x5816('0x3d'),_0x4c0718));}else{logger['info'](_0x5816('0x3e'));}return _0x3a9619({'code':0xc8,'message':_0x135581});}}catch(_0x2dc162){logger[_0x5816('0x38')](_0x2dc162[_0x5816('0x3f')]);return _0x1711a3(_0x5ded88[_0x5816('0x38')](0x1f4,_0x2dc162));}}return _0x1711a3(_0x5816('0x40'));});},'AcceptMessage':function(_0x5ecaa2){var _0x574e14=this;return new Promise(function(_0x536ef6,_0x588aad){if(_0x5ecaa2['agent']&&_0x5ecaa2[_0x5816('0x41')]['id']){if(_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']]){_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']][_0x5816('0x43')]=![];_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']][_0x5816('0x44')]=undefined;}}if(_0x5ecaa2['message']&&_0x5ecaa2['message']['id']){try{var _0x4f6fc3=getId(_0x5ecaa2[_0x5816('0x13')],_0x5ecaa2['message']?_0x5ecaa2[_0x5816('0x14')]['id']:0x0,_0x5ecaa2['interaction']?_0x5ecaa2[_0x5816('0x15')]['id']:0x0);if(_0x2c8d5f['rules'][_0x4f6fc3]){_0x2c8d5f['rules'][_0x4f6fc3]['emit']('end');if(rpc[_0x5ecaa2['channel']+_0x5816('0x45')]){rpc[_0x5ecaa2[_0x5816('0x13')]+_0x5816('0x45')]['update'](_0x4f6fc3,{'UserId':_0x5ecaa2[_0x5816('0x14')][_0x5816('0x46')]})['catch'](function(){logger['error'](_0x5816('0x47'));});}}return _0x536ef6({'code':0xc8,'message':_0x5ecaa2});}catch(_0x5f1a6e){logger[_0x5816('0x38')](_0x5f1a6e[_0x5816('0x3f')]);return _0x588aad(_0x574e14['error'](0x1f4,_0x5f1a6e));}}logger['error'](_0x5816('0x48'));return _0x588aad(_0x574e14[_0x5816('0x38')](0x1f4,_0x5816('0x48')));});},'RejectMessage':function(_0x3f93cd){var _0x307f29=this;return new Promise(function(_0x533851,_0x19a17c){if(_0x3f93cd['agent']&&_0x3f93cd[_0x5816('0x41')]['id']){try{if(_0x2c8d5f[_0x5816('0x42')][_0x3f93cd[_0x5816('0x41')]['id']]){_0x2c8d5f[_0x5816('0x42')][_0x3f93cd['agent']['id']]['busy']=![];_0x2c8d5f[_0x5816('0x42')][_0x3f93cd['agent']['id']][_0x5816('0x44')]=undefined;}return _0x533851({'code':0xc8,'message':_0x3f93cd});}catch(_0x43ed58){logger[_0x5816('0x38')](_0x43ed58[_0x5816('0x3f')]);return _0x19a17c(_0x307f29['error'](0x1f4,_0x43ed58));}}logger[_0x5816('0x38')](_0x5816('0x48'));return _0x19a17c(_0x307f29['error'](0x1f4,_0x5816('0x48')));});},'AbandonInteraction':function(_0x586d88){var _0x3ed725=this;return new Promise(function(_0x46c8e8,_0x16b42f){if(_0x586d88['channel']&&_0x586d88['interaction']&&_0x586d88[_0x5816('0x15')]['id']){try{var _0x3c08a0=getId(_0x586d88[_0x5816('0x13')],_0x586d88[_0x5816('0x14')]?_0x586d88[_0x5816('0x14')]['id']:0x0,_0x586d88['interaction']?_0x586d88['interaction']['id']:0x0);if(_0x2c8d5f[_0x5816('0x12')][_0x3c08a0]){_0x2c8d5f[_0x5816('0x12')][_0x3c08a0][_0x5816('0x3c')]('end');}return _0x46c8e8({'code':0xc8,'message':_0x586d88});}catch(_0x2894e7){logger[_0x5816('0x38')](_0x2894e7[_0x5816('0x3f')]);return _0x16b42f(_0x3ed725[_0x5816('0x38')](0x1f4,_0x2894e7));}}logger[_0x5816('0x38')](_0x5816('0x48'));return _0x16b42f(_0x3ed725[_0x5816('0x38')](0x1f4,_0x5816('0x48')));});},'AgentCapacity':function(_0x2adf5d){var _0x169631=this;return new Promise(function(_0x61600b,_0x4ab9cd){if(_0x2c8d5f['agents'][_0x5816('0x49')](_0x2adf5d['id'])){for(var _0x5205a5 in _0x2adf5d[_0x5816('0x4a')]){if(_0x2adf5d[_0x5816('0x4a')]['hasOwnProperty'](_0x5205a5)){if(_0x2c8d5f['agents'][_0x2adf5d['id']]['hasOwnProperty'](_0x5205a5+_0x5816('0x4b'))){_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']][_0x5205a5+_0x5816('0x4b')]=parseInt(_0x2adf5d[_0x5816('0x4a')][_0x5205a5],0xa);}}}_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']]['updateRealtime']();return _0x61600b({'code':0xc8,'message':_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']]});}else{return _0x4ab9cd(_0x169631[_0x5816('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3f9561){return new Promise(function(_0x4e6064){var _0x5a4975=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x42')]);if(_0x3f9561&&_0x3f9561['id']){var _0x5d98e7=_['find'](_0x5a4975,function(_0x106920){return _0x106920['id']===_0x3f9561['id'];});_0x4e6064(_0x5d98e7);}else{_0x4e6064({'count':_0x5a4975[_0x5816('0x19')],'rows':_0x5a4975});}});},'ChatQueues':function(){return new Promise(function(_0x38b5e5){var _0x55ba55=[];for(var _0x36faf7 in _0x2c8d5f[_0x5816('0x4d')]){if(_0x2c8d5f[_0x5816('0x4d')][_0x5816('0x49')](_0x36faf7)){var _0xbf4fc3=_0x2c8d5f['chatQueues'][_0x36faf7];var _0x50ae5f={'id':_0xbf4fc3['id'],'available':_0xbf4fc3[_0x5816('0x4e')],'loggedIn':_0xbf4fc3['loggedIn'],'name':_0xbf4fc3[_0x5816('0x4f')],'paused':_0xbf4fc3[_0x5816('0x50')],'waiting':_0xbf4fc3[_0x5816('0x51')]};_0x55ba55['push'](_0x50ae5f);}}_0x38b5e5({'count':_0x55ba55[_0x5816('0x19')],'rows':_0x55ba55});});},'MailQueues':function(){return new Promise(function(_0x59814b){var _0x4b6e17=[];for(var _0x143c4b in _0x2c8d5f[_0x5816('0x52')]){if(_0x2c8d5f[_0x5816('0x52')]['hasOwnProperty'](_0x143c4b)){var _0x35e21e=_0x2c8d5f['mailQueues'][_0x143c4b];var _0x2a9a6d={'id':_0x35e21e['id'],'available':_0x35e21e[_0x5816('0x4e')],'loggedIn':_0x35e21e['loggedIn'],'name':_0x35e21e[_0x5816('0x4f')],'paused':_0x35e21e[_0x5816('0x50')],'waiting':_0x35e21e[_0x5816('0x51')]};_0x4b6e17[_0x5816('0x20')](_0x2a9a6d);}}_0x59814b({'count':_0x4b6e17[_0x5816('0x19')],'rows':_0x4b6e17});});},'OpenchannelQueues':function(){return new Promise(function(_0x3f5de4){var _0x2f25e5=[];for(var _0xd774ce in _0x2c8d5f['openchannelQueues']){if(_0x2c8d5f['openchannelQueues'][_0x5816('0x49')](_0xd774ce)){var _0x57f739=_0x2c8d5f[_0x5816('0x53')][_0xd774ce];var _0x29b730={'id':_0x57f739['id'],'available':_0x57f739[_0x5816('0x4e')],'loggedIn':_0x57f739['loggedIn'],'name':_0x57f739[_0x5816('0x4f')],'paused':_0x57f739[_0x5816('0x50')],'waiting':_0x57f739[_0x5816('0x51')]};_0x2f25e5['push'](_0x29b730);}}_0x3f5de4({'count':_0x2f25e5[_0x5816('0x19')],'rows':_0x2f25e5});});},'SmsQueues':function(){return new Promise(function(_0x45bf3a){var _0x354c4f=[];for(var _0x29a3af in _0x2c8d5f[_0x5816('0x54')]){if(_0x2c8d5f[_0x5816('0x54')][_0x5816('0x49')](_0x29a3af)){var _0x4b3247=_0x2c8d5f['smsQueues'][_0x29a3af];var _0x3f052a={'id':_0x4b3247['id'],'available':_0x4b3247[_0x5816('0x4e')],'loggedIn':_0x4b3247[_0x5816('0x55')],'name':_0x4b3247[_0x5816('0x4f')],'paused':_0x4b3247['paused'],'waiting':_0x4b3247[_0x5816('0x51')]};_0x354c4f[_0x5816('0x20')](_0x3f052a);}}_0x45bf3a({'count':_0x354c4f[_0x5816('0x19')],'rows':_0x354c4f});});},'FaxQueues':function(){return new Promise(function(_0x17ef9d){var _0x554b3e=[];for(var _0x250066 in _0x2c8d5f[_0x5816('0x56')]){if(_0x2c8d5f[_0x5816('0x56')][_0x5816('0x49')](_0x250066)){var _0x576db0=_0x2c8d5f[_0x5816('0x56')][_0x250066];var _0x334a17={'id':_0x576db0['id'],'available':_0x576db0[_0x5816('0x4e')],'loggedIn':_0x576db0[_0x5816('0x55')],'name':_0x576db0[_0x5816('0x4f')],'paused':_0x576db0[_0x5816('0x50')],'waiting':_0x576db0['waiting']};_0x554b3e['push'](_0x334a17);}}_0x17ef9d({'count':_0x554b3e['length'],'rows':_0x554b3e});});},'WhatsappQueues':function(){return new Promise(function(_0xb07371){var _0x2ee104=[];for(var _0x90b134 in _0x2c8d5f[_0x5816('0x57')]){if(_0x2c8d5f[_0x5816('0x57')][_0x5816('0x49')](_0x90b134)){var _0x12e68e=_0x2c8d5f[_0x5816('0x57')][_0x90b134];var _0x9baf4a={'id':_0x12e68e['id'],'available':_0x12e68e[_0x5816('0x4e')],'loggedIn':_0x12e68e[_0x5816('0x55')],'name':_0x12e68e[_0x5816('0x4f')],'paused':_0x12e68e[_0x5816('0x50')],'waiting':_0x12e68e[_0x5816('0x51')]};_0x2ee104['push'](_0x9baf4a);}}_0xb07371({'count':_0x2ee104[_0x5816('0x19')],'rows':_0x2ee104});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x28b813){var _0x109326=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x58')]);_0x28b813({'count':_0x109326[_0x5816('0x19')],'rows':_0x109326});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x194bed){var _0x110d36=_[_0x5816('0x4c')](_0x2c8d5f['mailQueuesWaitingInteractions']);_0x194bed({'count':_0x110d36['length'],'rows':_0x110d36});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1f285d){var _0xebf964=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x59')]);_0x1f285d({'count':_0xebf964[_0x5816('0x19')],'rows':_0xebf964});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2a6580){var _0x5a8df9=_['values'](_0x2c8d5f[_0x5816('0x5a')]);_0x2a6580({'count':_0x5a8df9[_0x5816('0x19')],'rows':_0x5a8df9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4855ca){var _0x2abcb8=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x5b')]);_0x4855ca({'count':_0x2abcb8[_0x5816('0x19')],'rows':_0x2abcb8});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xd576a8){var _0x36b272=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x5c')]);_0xd576a8({'count':_0x36b272['length'],'rows':_0x36b272});});}};var _0x2cca7b=jayson['server'](_0x4da805)[_0x5816('0x5d')]();_0x2cca7b['on']('error',function(_0xeec3f7){logger['error'](JSON['stringify'](_0xeec3f7));return _0x141985(_0xeec3f7);});_0x2cca7b['listen'](0x232c,_0x5816('0x5e'),function(){console[_0x5816('0x5f')](_0x5816('0x60'),0x232c);return _0x14f111(_0x5816('0x61')+0x232c);});});}; \ No newline at end of file +var _0xf5c0=['execute','Applications\x20executed','stringify','matchPath','emit','format','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','join','.js','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x3daab5,_0x4c82c0){_0x3daab5=_0x3daab5-0x0;var _0x5c9961=_0xf5c0[_0x3daab5];return _0x5c9961;};'use strict';var _=require(_0x0f5c('0x0'));var util=require(_0x0f5c('0x1'));var path=require(_0x0f5c('0x2'));var fs=require('fs');var jayson=require(_0x0f5c('0x3'));var BPromise=require(_0x0f5c('0x4'));var utils=require(_0x0f5c('0x5'));var sUtils=require('./applications/strategy/util');var logger=require(_0x0f5c('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x0f5c('0x7')),'mailQueueReport':require(_0x0f5c('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x0f5c('0x9')),'faxQueueReport':require(_0x0f5c('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x0f5c('0xb'));function getId(_0x21a8ca,_0x101d64,_0x1775eb){return util['format'](_0x0f5c('0xc'),_0x21a8ca,_0x101d64||0x0,_0x1775eb||0x0);}function getIntervals(_0x1adca3,_0x296d3d){var _0x54261e=[];if(!_[_0x0f5c('0xd')](_0x296d3d['IntervalId'])&&!_['isNil'](_0x1adca3[_0x296d3d[_0x0f5c('0xe')]])&&!_['isNil'](_0x1adca3[_0x296d3d[_0x0f5c('0xe')]]['Intervals'])){_0x54261e=_['map'](_0x1adca3[_0x296d3d[_0x0f5c('0xe')]][_0x0f5c('0xf')],'interval');}else if(!_['isNil'](_0x296d3d[_0x0f5c('0x10')])){_0x54261e=[_0x296d3d[_0x0f5c('0x10')]];}return _0x54261e;}exports[_0x0f5c('0x11')]=function(_0x1b59b0){_0x1b59b0['rules']={};return new BPromise(function(_0x5a6120,_0x4f23a8){var _0xf8a69f={'Start':function(_0x2e61b1){var _0x2bcc2d=this;return new Promise(function(_0x2e01df,_0x27b77a){if(_0x2e61b1){try{var _0x69078c=[];var _0xcf78c4=getId(_0x2e61b1[_0x0f5c('0x12')],_0x2e61b1[_0x0f5c('0x13')]?_0x2e61b1['message']['id']:0x0,_0x2e61b1[_0x0f5c('0x14')]?_0x2e61b1[_0x0f5c('0x14')]['id']:0x0);var _0x29aed3=sUtils[_0x0f5c('0x15')](_0x1b59b0,_0x2e61b1);if(_0x2e61b1[_0x0f5c('0x16')]||!_0x29aed3&&_0x2e61b1[_0x0f5c('0x17')]&&_['isArray'](_0x2e61b1[_0x0f5c('0x17')])&&_0x2e61b1[_0x0f5c('0x17')][_0x0f5c('0x18')]){for(var _0x178eaa=0x0;_0x178eaa<_0x2e61b1[_0x0f5c('0x17')][_0x0f5c('0x18')];_0x178eaa+=0x1){var _0x166722=_0x2e61b1[_0x0f5c('0x17')][_0x178eaa];if(fs[_0x0f5c('0x19')](path[_0x0f5c('0x1a')](__dirname,'applications',_0x166722['app']+_0x0f5c('0x1b')))){var _0x1fb371=[];switch(_0x166722['app']['toLowerCase']()){case _0x0f5c('0x1c'):var _0x27ff90=_0x166722[_0x0f5c('0x1d')][_0x0f5c('0x1e')](',');if(_0x2e61b1['channel']===_0x0f5c('0x1f')){_0x1fb371['push'](_0x27ff90[0x0]);_0x1fb371['push'](_0x27ff90[0x1]);_0x1fb371[_0x0f5c('0x20')](_0x27ff90[_0x0f5c('0x21')](0x2,_0x27ff90[_0x0f5c('0x18')])[_0x0f5c('0x1a')](','));}else{_0x1fb371[_0x0f5c('0x20')](_0x27ff90[0x0]);_0x1fb371[_0x0f5c('0x20')](_0x27ff90[_0x0f5c('0x21')](0x1,_0x27ff90[_0x0f5c('0x18')])[_0x0f5c('0x1a')](','));}break;case _0x0f5c('0x22'):var _0x178d46=_0x166722[_0x0f5c('0x1d')][_0x0f5c('0x1e')](',');_0x1fb371[_0x0f5c('0x20')](_0x178d46[0x0]);_0x1fb371[_0x0f5c('0x20')](_0x178d46[0x1]);_0x1fb371[_0x0f5c('0x20')](_0x178d46[_0x0f5c('0x21')](0x2,_0x178d46[_0x0f5c('0x18')])[_0x0f5c('0x1a')](','));break;case _0x0f5c('0x23'):var _0x50293b=_0x166722[_0x0f5c('0x1d')][_0x0f5c('0x1e')](',');_0x1fb371[_0x0f5c('0x20')](_0x50293b[0x0]);_0x1fb371[_0x0f5c('0x20')](_0x50293b[0x1]);_0x1fb371[_0x0f5c('0x20')](_0x50293b[0x2]);_0x1fb371[_0x0f5c('0x20')](_0x50293b[0x3]);_0x1fb371[_0x0f5c('0x20')](_0x50293b[_0x0f5c('0x21')](0x4,_0x50293b[_0x0f5c('0x18')])[_0x0f5c('0x1a')](','));break;case'amazonlex':var _0x22b3b3=_0x166722['appdata'][_0x0f5c('0x1e')](',');_0x1fb371[_0x0f5c('0x20')](_0x22b3b3[0x0]);_0x1fb371['push'](_0x22b3b3[0x1]);_0x1fb371['push'](_0x22b3b3[0x2]);_0x1fb371[_0x0f5c('0x20')](_0x22b3b3[0x3]);_0x1fb371[_0x0f5c('0x20')](_0x22b3b3[_0x0f5c('0x21')](0x4,_0x22b3b3['length'])[_0x0f5c('0x1a')](','));break;case _0x0f5c('0x13'):_0x1fb371['push'](_0x166722[_0x0f5c('0x1d')]);break;case _0x0f5c('0x24'):_0x1fb371[_0x0f5c('0x20')](_0x166722[_0x0f5c('0x25')]);_0x1fb371[_0x0f5c('0x20')](_0x166722[_0x0f5c('0x1d')]);break;case _0x0f5c('0x26'):var _0x595ef9=utils[_0x0f5c('0x27')](_0x2e61b1[_0x0f5c('0x28')][_0x0f5c('0x29')],_0x2e61b1);var _0x4e3ceb=_0x166722[_0x0f5c('0x1d')][_0x0f5c('0x1e')](',');_0x1fb371['push'](_0x4e3ceb[0x0]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x1]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x2]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x3]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x4]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x5]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x6]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x7]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0x8]);_0x1fb371['push'](_0x4e3ceb[0x9]);_0x1fb371[_0x0f5c('0x20')](_0x4e3ceb[0xa]);_0x1fb371[_0x0f5c('0x20')](_0x2e61b1['interaction']['id']);_0x1fb371['push'](_0x2e61b1[_0x0f5c('0x13')]['id']);_0x1fb371[_0x0f5c('0x20')](_0x166722[_0x0f5c('0x2a')]);_0x1fb371[_0x0f5c('0x20')](_0x2e61b1['interaction'][_0x0f5c('0x2b')]);_0x1fb371['push'](_0x2e61b1[_0x0f5c('0x2c')][_0x0f5c('0x2c')]);_0x1fb371[_0x0f5c('0x20')](_0x595ef9);break;default:_0x1fb371=_[_0x0f5c('0xd')](_0x166722[_0x0f5c('0x1d')])?[]:_0x166722[_0x0f5c('0x1d')][_0x0f5c('0x1e')](',');}var _0x46825b={'id':util['format'](_0x0f5c('0x2d'),_0xcf78c4,_0x166722['id'],_0x166722[_0x0f5c('0x2e')]),'condition':require(_0x0f5c('0x2f'))[_0x0f5c('0x30')](_0xcf78c4,getIntervals(_0x1b59b0[_0x0f5c('0x31')],_0x166722),_0x1b59b0),'consequence':require(_0x0f5c('0x32')+_0x166722[_0x0f5c('0x2e')])[_0x0f5c('0x33')](_0xcf78c4,_0x1fb371,_0x1b59b0,_0x2e61b1),'p':_0x166722[_0x0f5c('0x34')]||0x0};logger['info'](_0x0f5c('0x35'),_0x46825b['id'],_0x0f5c('0x36'),getIntervals(_0x1b59b0[_0x0f5c('0x31')],_0x166722)[_0x0f5c('0x1a')](_0x0f5c('0x37')));_0x69078c['push'](_0x46825b);}else{logger[_0x0f5c('0x38')](_0x0f5c('0x39'),path['join'](__dirname,_0x0f5c('0x17'),_0x166722[_0x0f5c('0x2e')]+_0x0f5c('0x1b')));}}_0x1b59b0[_0x0f5c('0x3a')][_0xcf78c4]=new RuleEngine(_0x69078c);_0x1b59b0[_0x0f5c('0x3a')][_0xcf78c4][_0x0f5c('0x3b')](_0x2e61b1,function(_0x551366){logger['info'](_0x0f5c('0x3c'),JSON[_0x0f5c('0x3d')](_0x551366[_0x0f5c('0x3e')]));if(_0x1b59b0['rules'][_0xcf78c4]){_0x1b59b0[_0x0f5c('0x3a')][_0xcf78c4][_0x0f5c('0x3f')]('complete');}});return _0x2e01df({'code':0xc8,'message':_0x2e61b1});}else{if(_0x29aed3){logger['info'](util[_0x0f5c('0x40')](_0x0f5c('0x41'),_0xcf78c4));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x2e01df({'code':0xc8,'message':_0x2e61b1});}}catch(_0x1cf467){logger['error'](_0x1cf467[_0x0f5c('0x42')]);return _0x27b77a(_0x2bcc2d[_0x0f5c('0x38')](0x1f4,_0x1cf467));}}return _0x27b77a(_0x0f5c('0x43'));});},'AcceptMessage':function(_0x188467){var _0x4fe2e5=this;return new Promise(function(_0x1578b8,_0x3b2848){if(_0x188467[_0x0f5c('0x44')]&&_0x188467['agent']['id']){if(_0x1b59b0[_0x0f5c('0x45')][_0x188467[_0x0f5c('0x44')]['id']]){_0x1b59b0[_0x0f5c('0x45')][_0x188467[_0x0f5c('0x44')]['id']][_0x0f5c('0x46')]=![];_0x1b59b0[_0x0f5c('0x45')][_0x188467[_0x0f5c('0x44')]['id']][_0x0f5c('0x47')]=undefined;}}if(_0x188467[_0x0f5c('0x13')]&&_0x188467[_0x0f5c('0x13')]['id']){try{var _0x40e4ec=getId(_0x188467[_0x0f5c('0x12')],_0x188467[_0x0f5c('0x13')]?_0x188467[_0x0f5c('0x13')]['id']:0x0,_0x188467['interaction']?_0x188467[_0x0f5c('0x14')]['id']:0x0);if(_0x1b59b0[_0x0f5c('0x3a')][_0x40e4ec]){_0x1b59b0[_0x0f5c('0x3a')][_0x40e4ec][_0x0f5c('0x3f')](_0x0f5c('0x48'));if(rpc[_0x188467['channel']+_0x0f5c('0x49')]){rpc[_0x188467[_0x0f5c('0x12')]+_0x0f5c('0x49')][_0x0f5c('0x4a')](_0x40e4ec,{'UserId':_0x188467[_0x0f5c('0x13')][_0x0f5c('0x4b')]})[_0x0f5c('0x4c')](function(){logger[_0x0f5c('0x38')](_0x0f5c('0x4d'));});}}return _0x1578b8({'code':0xc8,'message':_0x188467});}catch(_0x51b6fa){logger[_0x0f5c('0x38')](_0x51b6fa[_0x0f5c('0x42')]);return _0x3b2848(_0x4fe2e5[_0x0f5c('0x38')](0x1f4,_0x51b6fa));}}logger['error']('message\x20is\x20empty');return _0x3b2848(_0x4fe2e5[_0x0f5c('0x38')](0x1f4,_0x0f5c('0x4e')));});},'RejectMessage':function(_0x5b0c2a){var _0x5cfc9b=this;return new Promise(function(_0x197abb,_0xc309a4){if(_0x5b0c2a[_0x0f5c('0x44')]&&_0x5b0c2a['agent']['id']){try{if(_0x1b59b0['agents'][_0x5b0c2a['agent']['id']]){_0x1b59b0[_0x0f5c('0x45')][_0x5b0c2a['agent']['id']][_0x0f5c('0x46')]=![];_0x1b59b0[_0x0f5c('0x45')][_0x5b0c2a[_0x0f5c('0x44')]['id']]['busyQueue']=undefined;}return _0x197abb({'code':0xc8,'message':_0x5b0c2a});}catch(_0x233c0d){logger[_0x0f5c('0x38')](_0x233c0d[_0x0f5c('0x42')]);return _0xc309a4(_0x5cfc9b[_0x0f5c('0x38')](0x1f4,_0x233c0d));}}logger[_0x0f5c('0x38')](_0x0f5c('0x4e'));return _0xc309a4(_0x5cfc9b[_0x0f5c('0x38')](0x1f4,_0x0f5c('0x4e')));});},'AbandonInteraction':function(_0xa99a26){var _0x66f7bb=this;return new Promise(function(_0x1b7f23,_0x39ebec){if(_0xa99a26[_0x0f5c('0x12')]&&_0xa99a26['interaction']&&_0xa99a26[_0x0f5c('0x14')]['id']){try{var _0x257cba=getId(_0xa99a26[_0x0f5c('0x12')],_0xa99a26[_0x0f5c('0x13')]?_0xa99a26[_0x0f5c('0x13')]['id']:0x0,_0xa99a26['interaction']?_0xa99a26[_0x0f5c('0x14')]['id']:0x0);if(_0x1b59b0[_0x0f5c('0x3a')][_0x257cba]){_0x1b59b0[_0x0f5c('0x3a')][_0x257cba][_0x0f5c('0x3f')]('end');}return _0x1b7f23({'code':0xc8,'message':_0xa99a26});}catch(_0x166a81){logger['error'](_0x166a81[_0x0f5c('0x42')]);return _0x39ebec(_0x66f7bb[_0x0f5c('0x38')](0x1f4,_0x166a81));}}logger['error'](_0x0f5c('0x4e'));return _0x39ebec(_0x66f7bb['error'](0x1f4,_0x0f5c('0x4e')));});},'AgentCapacity':function(_0x5c8265){var _0x12c78e=this;return new Promise(function(_0x4e38aa,_0x4d5535){if(_0x1b59b0[_0x0f5c('0x45')][_0x0f5c('0x4f')](_0x5c8265['id'])){for(var _0x43aedd in _0x5c8265[_0x0f5c('0x50')]){if(_0x5c8265['capacity']['hasOwnProperty'](_0x43aedd)){if(_0x1b59b0[_0x0f5c('0x45')][_0x5c8265['id']][_0x0f5c('0x4f')](_0x43aedd+_0x0f5c('0x51'))){_0x1b59b0['agents'][_0x5c8265['id']][_0x43aedd+_0x0f5c('0x51')]=parseInt(_0x5c8265[_0x0f5c('0x50')][_0x43aedd],0xa);}}}_0x1b59b0['agents'][_0x5c8265['id']][_0x0f5c('0x52')]();return _0x4e38aa({'code':0xc8,'message':_0x1b59b0[_0x0f5c('0x45')][_0x5c8265['id']]});}else{return _0x4d5535(_0x12c78e[_0x0f5c('0x38')](0x1f4,_0x0f5c('0x53')));}});},'Agents':function(_0x1de70f){return new Promise(function(_0x1a3957){var _0x2b8ab6=_[_0x0f5c('0x54')](_0x1b59b0[_0x0f5c('0x45')]);if(_0x1de70f&&_0x1de70f['id']){var _0x499ea8=_[_0x0f5c('0x55')](_0x2b8ab6,function(_0x17446f){return _0x17446f['id']===_0x1de70f['id'];});_0x1a3957(_0x499ea8);}else{_0x1a3957({'count':_0x2b8ab6[_0x0f5c('0x18')],'rows':_0x2b8ab6});}});},'ChatQueues':function(){return new Promise(function(_0x137906){var _0x532024=[];for(var _0x1611b6 in _0x1b59b0[_0x0f5c('0x56')]){if(_0x1b59b0['chatQueues'][_0x0f5c('0x4f')](_0x1611b6)){var _0xb74756=_0x1b59b0[_0x0f5c('0x56')][_0x1611b6];var _0x2a07c9={'id':_0xb74756['id'],'available':_0xb74756[_0x0f5c('0x57')],'loggedIn':_0xb74756[_0x0f5c('0x58')],'name':_0xb74756[_0x0f5c('0x59')],'paused':_0xb74756[_0x0f5c('0x5a')],'waiting':_0xb74756[_0x0f5c('0x5b')]};_0x532024[_0x0f5c('0x20')](_0x2a07c9);}}_0x137906({'count':_0x532024[_0x0f5c('0x18')],'rows':_0x532024});});},'MailQueues':function(){return new Promise(function(_0x151d90){var _0x3122e3=[];for(var _0x4d82ee in _0x1b59b0[_0x0f5c('0x5c')]){if(_0x1b59b0[_0x0f5c('0x5c')][_0x0f5c('0x4f')](_0x4d82ee)){var _0xa15ec4=_0x1b59b0[_0x0f5c('0x5c')][_0x4d82ee];var _0x11ac0f={'id':_0xa15ec4['id'],'available':_0xa15ec4['available'],'loggedIn':_0xa15ec4['loggedIn'],'name':_0xa15ec4['name'],'paused':_0xa15ec4[_0x0f5c('0x5a')],'waiting':_0xa15ec4[_0x0f5c('0x5b')]};_0x3122e3[_0x0f5c('0x20')](_0x11ac0f);}}_0x151d90({'count':_0x3122e3['length'],'rows':_0x3122e3});});},'OpenchannelQueues':function(){return new Promise(function(_0x2598d7){var _0x6ecc92=[];for(var _0x4a9a9a in _0x1b59b0[_0x0f5c('0x5d')]){if(_0x1b59b0[_0x0f5c('0x5d')][_0x0f5c('0x4f')](_0x4a9a9a)){var _0x13ab98=_0x1b59b0[_0x0f5c('0x5d')][_0x4a9a9a];var _0x50f738={'id':_0x13ab98['id'],'available':_0x13ab98[_0x0f5c('0x57')],'loggedIn':_0x13ab98[_0x0f5c('0x58')],'name':_0x13ab98[_0x0f5c('0x59')],'paused':_0x13ab98[_0x0f5c('0x5a')],'waiting':_0x13ab98[_0x0f5c('0x5b')]};_0x6ecc92[_0x0f5c('0x20')](_0x50f738);}}_0x2598d7({'count':_0x6ecc92[_0x0f5c('0x18')],'rows':_0x6ecc92});});},'SmsQueues':function(){return new Promise(function(_0x57e39a){var _0x2eb112=[];for(var _0x5984cd in _0x1b59b0[_0x0f5c('0x5e')]){if(_0x1b59b0[_0x0f5c('0x5e')]['hasOwnProperty'](_0x5984cd)){var _0x2c247f=_0x1b59b0[_0x0f5c('0x5e')][_0x5984cd];var _0x3b7607={'id':_0x2c247f['id'],'available':_0x2c247f['available'],'loggedIn':_0x2c247f[_0x0f5c('0x58')],'name':_0x2c247f[_0x0f5c('0x59')],'paused':_0x2c247f[_0x0f5c('0x5a')],'waiting':_0x2c247f[_0x0f5c('0x5b')]};_0x2eb112[_0x0f5c('0x20')](_0x3b7607);}}_0x57e39a({'count':_0x2eb112['length'],'rows':_0x2eb112});});},'FaxQueues':function(){return new Promise(function(_0x168e3f){var _0xb5e72=[];for(var _0x4d3246 in _0x1b59b0[_0x0f5c('0x5f')]){if(_0x1b59b0[_0x0f5c('0x5f')]['hasOwnProperty'](_0x4d3246)){var _0x28db47=_0x1b59b0[_0x0f5c('0x5f')][_0x4d3246];var _0x2e7fec={'id':_0x28db47['id'],'available':_0x28db47[_0x0f5c('0x57')],'loggedIn':_0x28db47[_0x0f5c('0x58')],'name':_0x28db47[_0x0f5c('0x59')],'paused':_0x28db47[_0x0f5c('0x5a')],'waiting':_0x28db47[_0x0f5c('0x5b')]};_0xb5e72[_0x0f5c('0x20')](_0x2e7fec);}}_0x168e3f({'count':_0xb5e72['length'],'rows':_0xb5e72});});},'WhatsappQueues':function(){return new Promise(function(_0x156317){var _0x39a51e=[];for(var _0x5b2211 in _0x1b59b0[_0x0f5c('0x60')]){if(_0x1b59b0[_0x0f5c('0x60')][_0x0f5c('0x4f')](_0x5b2211)){var _0x4eb896=_0x1b59b0[_0x0f5c('0x60')][_0x5b2211];var _0x21c3af={'id':_0x4eb896['id'],'available':_0x4eb896['available'],'loggedIn':_0x4eb896[_0x0f5c('0x58')],'name':_0x4eb896[_0x0f5c('0x59')],'paused':_0x4eb896[_0x0f5c('0x5a')],'waiting':_0x4eb896['waiting']};_0x39a51e['push'](_0x21c3af);}}_0x156317({'count':_0x39a51e[_0x0f5c('0x18')],'rows':_0x39a51e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5e9c45){var _0x56bcc5=_[_0x0f5c('0x54')](_0x1b59b0[_0x0f5c('0x61')]);_0x5e9c45({'count':_0x56bcc5[_0x0f5c('0x18')],'rows':_0x56bcc5});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1ba4d3){var _0x59ff3f=_[_0x0f5c('0x54')](_0x1b59b0[_0x0f5c('0x62')]);_0x1ba4d3({'count':_0x59ff3f[_0x0f5c('0x18')],'rows':_0x59ff3f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x53bc3f){var _0x577bb5=_[_0x0f5c('0x54')](_0x1b59b0[_0x0f5c('0x63')]);_0x53bc3f({'count':_0x577bb5[_0x0f5c('0x18')],'rows':_0x577bb5});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4c0c56){var _0x3095ea=_['values'](_0x1b59b0[_0x0f5c('0x64')]);_0x4c0c56({'count':_0x3095ea[_0x0f5c('0x18')],'rows':_0x3095ea});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x10b056){var _0x2af50f=_['values'](_0x1b59b0[_0x0f5c('0x65')]);_0x10b056({'count':_0x2af50f['length'],'rows':_0x2af50f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x40a84a){var _0x238db3=_[_0x0f5c('0x54')](_0x1b59b0[_0x0f5c('0x66')]);_0x40a84a({'count':_0x238db3['length'],'rows':_0x238db3});});}};var _0x389d22=jayson[_0x0f5c('0x67')](_0xf8a69f)[_0x0f5c('0x68')]();_0x389d22['on'](_0x0f5c('0x38'),function(_0x26bfae){logger['error'](JSON[_0x0f5c('0x3d')](_0x26bfae));return _0x4f23a8(_0x26bfae);});_0x389d22[_0x0f5c('0x11')](0x232c,_0x0f5c('0x69'),function(){console[_0x0f5c('0x6a')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5a6120(_0x0f5c('0x6b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 70d1f07..76be759 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 _0xfab3=['length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','info','join','\x20|\x20','when','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','condition','rules','stop'];(function(_0x3ab377,_0xecf4fa){var _0x2db1a7=function(_0x1c925d){while(--_0x1c925d){_0x3ab377['push'](_0x3ab377['shift']());}};_0x2db1a7(++_0xecf4fa);}(_0xfab3,0x179));var _0x3fab=function(_0x312a65,_0x203742){_0x312a65=_0x312a65-0x0;var _0x27a4af=_0xfab3[_0x312a65];return _0x27a4af;};'use strict';var util=require(_0x3fab('0x0'));var BPromise=require(_0x3fab('0x1'));var jayson=require('jayson/promise');var _=require(_0x3fab('0x2'));var logger=require(_0x3fab('0x3'))(_0x3fab('0x4'));var client=jayson[_0x3fab('0x5')][_0x3fab('0x6')]({'port':0x232a});function request(_0x152713,_0x30480b){return new BPromise(function(_0x4d3e48,_0x24b58c){return client['request'](_0x152713,_0x30480b)[_0x3fab('0x7')](function(_0x37798b){if(_0x37798b['error']){return _0x24b58c(_0x37798b[_0x3fab('0x8')][_0x3fab('0x9')]);}else{return _0x4d3e48(_0x37798b[_0x3fab('0xa')]);}})[_0x3fab('0xb')](function(_0x23bcd1){return _0x24b58c(_0x23bcd1);});});}exports[_0x3fab('0xc')]=function(_0x52adc7,_0x364288,_0x3fb4df){return function(_0x2da7e4){if(_0x3fb4df['rules']&&!_0x3fb4df[_0x3fab('0xd')][_0x52adc7]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x52adc7);return _0x2da7e4[_0x3fab('0xe')]();}var _0x20651a=[];for(var _0xcb16c6=0x0;_0xcb16c6<_0x364288[_0x3fab('0xf')];_0xcb16c6+=0x1){_0x20651a[_0x3fab('0x10')](request(_0x3fab('0x11'),{'command':util['format'](_0x3fab('0x12'),_0x364288[_0xcb16c6])})['then'](function(_0x5a2438){return _0x5a2438&&_0x5a2438[_0x3fab('0x9')]&&_0x5a2438[_0x3fab('0x9')][_0x3fab('0x13')](_0x3fab('0x14'))>=0x0?!![]:![];})[_0x3fab('0xb')](function(){logger[_0x3fab('0x8')](_0x3fab('0x15'),_0x52adc7,_0x364288[_0xcb16c6]);}));}BPromise[_0x3fab('0x16')](_0x20651a)['then'](function(_0x1b9f84){var _0x294e47=_['some'](_0x1b9f84);logger[_0x3fab('0x17')]('[%s][INTERVAL]\x20%s\x20%s',_0x52adc7,_0x364288[_0x3fab('0x18')](_0x3fab('0x19')),_0x294e47);_0x2da7e4[_0x3fab('0x1a')](_0x294e47);})[_0x3fab('0xb')](function(_0x45e2ed){logger[_0x3fab('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x52adc7,_0x364288[_0x3fab('0x18')]('\x20|\x20'),_0x45e2ed[_0x3fab('0x1b')]);_0x2da7e4['stop']();});};}; \ No newline at end of file +var _0xb86b=['client','then','error','message','result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','stack','util','bluebird','../../../config/logger','routing'];(function(_0x18fcc1,_0x37053b){var _0x3a8622=function(_0x277e6f){while(--_0x277e6f){_0x18fcc1['push'](_0x18fcc1['shift']());}};_0x3a8622(++_0x37053b);}(_0xb86b,0x173));var _0xbb86=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xb86b[_0x568cf0];return _0x360f81;};'use strict';var util=require(_0xbb86('0x0'));var BPromise=require(_0xbb86('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0xbb86('0x2'))(_0xbb86('0x3'));var client=jayson[_0xbb86('0x4')]['http']({'port':0x232a});function request(_0x1f31a9,_0x3bc1a4){return new BPromise(function(_0x243818,_0x56673f){return client['request'](_0x1f31a9,_0x3bc1a4)[_0xbb86('0x5')](function(_0x2f617d){if(_0x2f617d[_0xbb86('0x6')]){return _0x56673f(_0x2f617d[_0xbb86('0x6')][_0xbb86('0x7')]);}else{return _0x243818(_0x2f617d[_0xbb86('0x8')]);}})[_0xbb86('0x9')](function(_0x6ef64){return _0x56673f(_0x6ef64);});});}exports['condition']=function(_0x124918,_0x5d195b,_0x43be0c){return function(_0x4c04ae){if(_0x43be0c[_0xbb86('0xa')]&&!_0x43be0c[_0xbb86('0xa')][_0x124918]){logger['info'](_0xbb86('0xb'),_0x124918);return _0x4c04ae[_0xbb86('0xc')]();}var _0x24868c=[];for(var _0x14563e=0x0;_0x14563e<_0x5d195b[_0xbb86('0xd')];_0x14563e+=0x1){_0x24868c[_0xbb86('0xe')](request(_0xbb86('0xf'),{'command':util[_0xbb86('0x10')]('iftime\x20%s',_0x5d195b[_0x14563e])})['then'](function(_0x361b49){return _0x361b49&&_0x361b49[_0xbb86('0x7')]&&_0x361b49['message'][_0xbb86('0x11')](_0xbb86('0x12'))>=0x0?!![]:![];})[_0xbb86('0x9')](function(){logger[_0xbb86('0x6')](_0xbb86('0x13'),_0x124918,_0x5d195b[_0x14563e]);}));}BPromise['all'](_0x24868c)['then'](function(_0x5dc16d){var _0x53f88e=_['some'](_0x5dc16d);logger[_0xbb86('0x14')](_0xbb86('0x15'),_0x124918,_0x5d195b['join'](_0xbb86('0x16')),_0x53f88e);_0x4c04ae[_0xbb86('0x17')](_0x53f88e);})['catch'](function(_0x3c8902){logger[_0xbb86('0x6')](_0xbb86('0x15'),_0x124918,_0x5d195b['join'](_0xbb86('0x16')),_0x3c8902[_0xbb86('0x18')]);_0x4c04ae[_0xbb86('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f90de23..2817e5b 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 _0xbf6e=['[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','destuniqueid','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','[%s][agents][hangup]','./utils','info','format'];(function(_0x2e2830,_0x138c36){var _0x543b5c=function(_0x2fa4ce){while(--_0x2fa4ce){_0x2e2830['push'](_0x2e2830['shift']());}};_0x543b5c(++_0x138c36);}(_0xbf6e,0x149));var _0xebf6=function(_0x554611,_0x11ced4){_0x554611=_0x554611-0x0;var _0x4fbc11=_0xbf6e[_0x554611];return _0x4fbc11;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xebf6('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2b658d,_0x14bf01){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x3'),_0x2b658d[_0xebf6('0x4')],_0x2b658d['channel'],_0x2b658d[_0xebf6('0x5')],_0x2b658d[_0xebf6('0x6')],_0x2b658d[_0xebf6('0x7')],_0x2b658d[_0xebf6('0x8')],_0x2b658d[_0xebf6('0x9')],_0x2b658d[_0xebf6('0xa')]));if(_0x2b658d[_0xebf6('0x5')]){utils['getVoiceQueueByName'](_0x2b658d[_0xebf6('0x5')])[_0xebf6('0xb')](function(_0x12ed12){if(_0x12ed12){_0x2b658d['type']=_0x12ed12[_0xebf6('0xc')];_0x2b658d[_0xebf6('0xd')]=_0x2b658d['agentcomplete']?_0x12ed12[_0xebf6('0xe')]:![];_0x2b658d[_0xebf6('0xf')]=_0x2b658d[_0xebf6('0xd')]?_0x12ed12[_0xebf6('0x10')]:0x0;}utils[_0xebf6('0x11')](_0xebf6('0x12'),_0x2b658d);});}else{utils['request'](_0xebf6('0x12'),_0x2b658d);}if(_0x14bf01){delete transfers[_0x2b658d[_0xebf6('0x4')]];}else{delete agents[_0x2b658d['destuniqueid']];}}exports[_0xebf6('0x13')]=function(_0x101a6c){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c['uniqueid']),_0x101a6c);agents[_0x101a6c['destuniqueid']]=_0x101a6c;agents[_0x101a6c['destuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();agents[_0x101a6c['destuniqueid']][_0xebf6('0xa')]=_0xebf6('0x18');agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x9')]=null;agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x1a')]=null;utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1b'),_0x101a6c[_0xebf6('0x4')],agents[_0x101a6c['destuniqueid']]['membername'],_0x101a6c[_0xebf6('0x19')]));}catch(_0x38c9e3){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c[_0xebf6('0x4')]),_0x38c9e3);}};exports[_0xebf6('0x1d')]=function(_0x80f523){try{if(!_['isNil'](agents[_0x80f523[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523[_0xebf6('0x4')]),_0x80f523);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1f'),_0x80f523[_0xebf6('0x4')],agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x6')],_0x80f523[_0xebf6('0x19')]));agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x1d')]=!![];agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x20')]=utils[_0xebf6('0x17')]();agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0xa')]='timeout';agents[_0x80f523['destuniqueid']][_0xebf6('0x21')]='timeout';agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x80f523['ringtime']?parseInt(_0x80f523['ringtime'])/0x3e8:0x0;agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x23')]=0x0;unanswered[_0xebf6('0x24')](_0x80f523[_0xebf6('0x19')]);}}catch(_0xedaaeb){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523['uniqueid']),_0xedaaeb);}};exports[_0xebf6('0x25')]=function(_0x78cdf0){try{_['forIn'](agents,function(_0x2fe3ee,_0x28bbea){if(_0x2fe3ee['uniqueid']==_0x78cdf0[_0xebf6('0x4')]&&!_[_0xebf6('0x26')](unanswered,_0x2fe3ee[_0xebf6('0x19')])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x27'),_0x78cdf0['uniqueid']),_0x78cdf0);utils[_0xebf6('0x1')](util[_0xebf6('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x78cdf0['uniqueid'],_0x2fe3ee[_0xebf6('0x6')],_0x2fe3ee[_0xebf6('0x19')]));_0x2fe3ee['agentringnoanswer']=!![];_0x2fe3ee[_0xebf6('0x20')]=utils[_0xebf6('0x17')]();_0x2fe3ee['lastevent']=_0xebf6('0x28');_0x2fe3ee[_0xebf6('0x21')]=_0xebf6('0x28');_0x2fe3ee['holdtime']=_0x78cdf0[_0xebf6('0x22')];_0x2fe3ee[_0xebf6('0x23')]=0x0;writeDB(_0x2fe3ee);}});}catch(_0xed3a5b){utils[_0xebf6('0x1c')](util['format']('[%s][agents][queuecallerabandon]',_0x78cdf0[_0xebf6('0x4')]),_0xed3a5b);}};exports[_0xebf6('0x29')]=function(_0x562f76){try{if(agents[_0x562f76[_0xebf6('0x19')]]){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x2a'),_0x562f76[_0xebf6('0x4')]),_0x562f76);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x2b'),_0x562f76['uniqueid'],agents[_0x562f76[_0xebf6('0x19')]]['membername'],_0x562f76[_0xebf6('0x19')]));agents[_0x562f76['destuniqueid']][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x9')]=_0x562f76[_0xebf6('0x9')];agents[_0x562f76[_0xebf6('0x19')]]['connectedlinename']=_0x562f76[_0xebf6('0x1a')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x562f76[_0xebf6('0x2d')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0xa')]='connect';_[_0xebf6('0x2e')](agents,function(_0x2782a5,_0x3f8502){if(_0x2782a5[_0xebf6('0x19')]!=_0x562f76[_0xebf6('0x19')]&&_0x2782a5[_0xebf6('0x4')]==_0x562f76['uniqueid']){_0x2782a5['talktime']=0x0;_0x2782a5['holdtime']=_0x562f76[_0xebf6('0x2d')];_0x2782a5[_0xebf6('0x1d')]=!![];_0x2782a5[_0xebf6('0x20')]=utils['now']();_0x2782a5[_0xebf6('0xa')]=_0xebf6('0x2f');_0x2782a5[_0xebf6('0x21')]='answered_elsewhere';_0x2782a5[_0xebf6('0x30')]=_0x562f76[_0xebf6('0x19')];_0x2782a5['answeredelsewheremembername']=_0x562f76[_0xebf6('0x6')];writeDB(_0x2782a5);}});}}catch(_0x1de50e){utils[_0xebf6('0x1c')](util['format'](_0xebf6('0x2a'),_0x562f76['uniqueid']),_0x1de50e);}};exports['agentcomplete']=function(_0x256552){try{if(!_[_0xebf6('0x31')](agents[_0x256552[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x32'),_0x256552['uniqueid']),_0x256552);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x33'),_0x256552[_0xebf6('0x4')],agents[_0x256552[_0xebf6('0x19')]]['membername'],_0x256552['destuniqueid']));agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x34')]=!![];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')]=utils['now']();agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')],agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x2c')]);agents[_0x256552['destuniqueid']][_0xebf6('0x21')]=_0x256552[_0xebf6('0x21')];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0xa')]=_0xebf6('0x37');writeDB(agents[_0x256552[_0xebf6('0x19')]]);}}catch(_0x250cf4){utils['error'](util[_0xebf6('0x2')]('[%s][agents][agentcomplete]',_0x256552[_0xebf6('0x4')]),_0x250cf4);}};exports[_0xebf6('0x38')]=function(_0x5d84ac){try{if(!_[_0xebf6('0x31')](agents[_0x5d84ac['transfereruniqueid']])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x5d84ac);utils[_0xebf6('0x1')](util['format'](_0xebf6('0x3a'),_0x5d84ac[_0xebf6('0x4')],agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x6')],agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')]));agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3c')]=!![];agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x3d')]=_0xebf6('0x3e');agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3f')]=_0x5d84ac['extension'];agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x40')]=agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')];}}catch(_0x16abac){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x16abac);}};exports['attendedtransfer']=function(_0x22c3ad){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')]('[%s][agents][attendedtransfer]',_0x22c3ad[_0xebf6('0x41')]),_0x22c3ad);if(_0x22c3ad['origtransfereruniqueid']==_0x22c3ad['origtransfererlinkedid']){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x42')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad['origtransfereruniqueid'],agents[_0x22c3ad[_0xebf6('0x42')]]['membername']));agents[_0x22c3ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3d')]='ATTENDED';agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3f')]=_0x22c3ad[_0xebf6('0x44')];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x41')];}if(_0x22c3ad[_0xebf6('0x45')]&&agents[_0x22c3ad['transfereeuniqueid']]){agents[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad[_0xebf6('0x45')]]=_[_0xebf6('0x47')](agents[_0x22c3ad[_0xebf6('0x45')]]);transfers[_0x22c3ad[_0xebf6('0x45')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x8')];transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x48')];transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x22')]=0x0;transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x2;}}else if(_0x22c3ad[_0xebf6('0x42')]==_0x22c3ad[_0xebf6('0x49')]){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x41')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad[_0xebf6('0x41')],agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x6')]));agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3c')]=!![];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3d')]=_0xebf6('0x4a');agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x3f')]=_0x22c3ad['secondtransfererexten'];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x42')];}if(_0x22c3ad[_0xebf6('0x4b')]&&agents[_0x22c3ad[_0xebf6('0x4b')]]){agents[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad['transfertargetuniqueid']]=_['clone'](agents[_0x22c3ad[_0xebf6('0x4b')]]);transfers[_0x22c3ad[_0xebf6('0x4b')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x8')];transfers[_0x22c3ad['transfertargetuniqueid']][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x41')]]['calleridname'];transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]]['holdtime']=0x0;transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x2;}}}catch(_0x26d338){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x4c'),_0x22c3ad[_0xebf6('0x41')]),_0x26d338);}};exports[_0xebf6('0x4d')]=function(_0x3bc43){try{utils[_0xebf6('0x14')](util['format']('[%s][agents][hangup]',_0x3bc43[_0xebf6('0x4')]),_0x3bc43);if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]==='timeout'){if(_0x3bc43[_0xebf6('0x4e')]==='21'){agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]=_0xebf6('0x4f');agents[_0x3bc43['uniqueid']]['lastevent']='rejected';}utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43['uniqueid']][_0xebf6('0xa')]));writeDB(agents[_0x3bc43[_0xebf6('0x4')]]);var _0x50169c=unanswered['indexOf'](_0x3bc43[_0xebf6('0x4')]);if(_0x50169c>-0x1){unanswered['splice'](_0x50169c,0x1);}}if(transfers[_0x3bc43[_0xebf6('0x4')]]){transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x34')]=!![];transfers[_0x3bc43['uniqueid']][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](transfers[_0x3bc43[_0xebf6('0x4')]]['agentcompleteAt'],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);transfers[_0x3bc43['uniqueid']][_0xebf6('0x21')]=_0xebf6('0x51');transfers[_0x3bc43[_0xebf6('0x4')]]['lastevent']=_0xebf6('0x37');utils[_0xebf6('0x1')](util['format'](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]));writeDB(transfers[_0x3bc43[_0xebf6('0x4')]],!![]);}if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]){agents[_0x3bc43[_0xebf6('0x4')]]['agentcomplete']=!![];agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);agents[_0x3bc43['uniqueid']]['reason']=agents[_0x3bc43[_0xebf6('0x4')]]['transfer']?_0xebf6('0x3c'):_0xebf6('0x51');agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]=_0xebf6('0x37');utils['info'](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43['uniqueid'],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43[_0xebf6('0x4')]]['lastevent']));writeDB(agents[_0x3bc43['uniqueid']]);}}catch(_0x1b245d){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x52'),_0x3bc43[_0xebf6('0x4')]),_0x1b245d);}}; \ No newline at end of file +var _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf45e,0x115));var _0xef45=function(_0x131961,_0x4cd0d8){_0x131961=_0x131961-0x0;var _0xd14f17=_0xf45e[_0x131961];return _0xd14f17;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index edd4de2..c3a9c3a 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 _0x1ab8=['[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','channel','queue','interface','connectedlinenum','lastevent','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','accountcode','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart'];(function(_0x5448d1,_0x4f8fdd){var _0x219bc7=function(_0x1f7c11){while(--_0x1f7c11){_0x5448d1['push'](_0x5448d1['shift']());}};_0x219bc7(++_0x4f8fdd);}(_0x1ab8,0x107));var _0x81ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ab8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x81ab('0x0'));var util=require(_0x81ab('0x1'));var utils=require(_0x81ab('0x2'));var dispositions=[_0x81ab('0x3'),_0x81ab('0x4'),_0x81ab('0x4'),'NO\x20ANSWER',_0x81ab('0x3'),_0x81ab('0x3'),_0x81ab('0x5'),'BUSY',_0x81ab('0x4'),_0x81ab('0x4'),_0x81ab('0x4')];var channels={};function writeDB(_0x697457){utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x697457['uniqueid'],_0x697457[_0x81ab('0x6')],_0x697457[_0x81ab('0x7')],_0x697457['membername'],_0x697457[_0x81ab('0x8')],_0x697457['calleridnum'],_0x697457[_0x81ab('0x9')],_0x697457[_0x81ab('0xa')]));if(_0x697457['accountcode']){utils[_0x81ab('0xb')](_0x697457['accountcode'])[_0x81ab('0xc')](function(_0x422ce3){if(_0x422ce3){_0x697457[_0x81ab('0xd')]=_0x422ce3['id'];}utils[_0x81ab('0xe')](_0x81ab('0xf'),_0x697457);});}else{utils[_0x81ab('0xe')](_0x81ab('0xf'),_0x697457);}if(channels[_0x697457['uniqueid']]){delete channels[_0x697457[_0x81ab('0x10')]];}}exports[_0x81ab('0x11')]=function(_0x13f83b){try{utils['debug'](util['format'](_0x81ab('0x12'),_0x13f83b[_0x81ab('0x10')]),_0x13f83b);if(_0x13f83b['uniqueid']==_0x13f83b[_0x81ab('0x13')]&&_0x13f83b[_0x81ab('0x6')]!=_0x81ab('0x14')){utils[_0x81ab('0x15')](util[_0x81ab('0x16')](_0x81ab('0x17'),_0x13f83b['uniqueid'],_0x13f83b[_0x81ab('0x18')],_0x13f83b['exten']));channels[_0x13f83b[_0x81ab('0x10')]]={'uniqueid':_0x13f83b[_0x81ab('0x10')],'accountcode':_0x13f83b['accountcode'],'source':_0x13f83b[_0x81ab('0x19')],'destination':_0x13f83b[_0x81ab('0x1a')],'destinationcontext':_0x13f83b[_0x81ab('0x18')],'channel':_0x13f83b['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x81ab('0x3'),'amaflags':_0x81ab('0x1b')};}}catch(_0x3deb4c){utils[_0x81ab('0x1c')](util['format'](_0x81ab('0x12'),_0x13f83b[_0x81ab('0x10')]),_0x3deb4c);}};exports[_0x81ab('0x1d')]=function(_0x550969){try{utils[_0x81ab('0x1e')](util[_0x81ab('0x16')](_0x81ab('0x1f'),_0x550969[_0x81ab('0x10')]),_0x550969);if(!_[_0x81ab('0x20')](channels[_0x550969[_0x81ab('0x10')]])&&_0x550969[_0x81ab('0x21')]==0x6){utils[_0x81ab('0x15')](util['format'](_0x81ab('0x22'),_0x550969[_0x81ab('0x10')],_0x550969[_0x81ab('0x18')],_0x550969['channel']));if(_[_0x81ab('0x20')](channels[_0x550969[_0x81ab('0x10')]][_0x81ab('0x23')])){channels[_0x550969['uniqueid']][_0x81ab('0x23')]=utils[_0x81ab('0x24')]();}}else if(!_['isNil'](channels[_0x550969['linkedid']])&&_0x550969[_0x81ab('0x21')]==0x6&&_0x550969[_0x81ab('0x18')]!='transfer'){utils[_0x81ab('0x15')](util[_0x81ab('0x16')](_0x81ab('0x25'),_0x550969['uniqueid'],_0x550969[_0x81ab('0x13')],_0x550969[_0x81ab('0x18')],_0x550969[_0x81ab('0x6')]));channels[_0x550969[_0x81ab('0x13')]][_0x81ab('0x26')]=_0x550969[_0x81ab('0x26')];channels[_0x550969[_0x81ab('0x13')]][_0x81ab('0x27')]=_0x550969[_0x81ab('0x6')];if(_[_0x81ab('0x20')](channels[_0x550969[_0x81ab('0x13')]]['answertime'])){channels[_0x550969['linkedid']][_0x81ab('0x28')]=utils['now']();}channels[_0x550969[_0x81ab('0x13')]]['disposition']=dispositions[_[_0x81ab('0x29')](_0x550969['channelstate'])]||'ANSWERED';}}catch(_0x510ce8){utils[_0x81ab('0x1c')](util[_0x81ab('0x16')](_0x81ab('0x1f'),_0x550969['uniqueid']),_0x510ce8);}};exports[_0x81ab('0x2a')]=function(_0x4b8b32){try{if(!_[_0x81ab('0x20')](channels[_0x4b8b32[_0x81ab('0x10')]])){utils['debug'](util[_0x81ab('0x16')](_0x81ab('0x2b'),_0x4b8b32[_0x81ab('0x10')]),_0x4b8b32);if(_[_0x81ab('0x20')](channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x2c')])){channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x2c')]=_0x4b8b32[_0x81ab('0x2d')]+'\x20<'+_0x4b8b32[_0x81ab('0x19')]+'>';}utils['info'](util[_0x81ab('0x16')](_0x81ab('0x2e'),_0x4b8b32[_0x81ab('0x10')],channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x2c')],_0x4b8b32[_0x81ab('0x2f')]));channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x30')]=utils[_0x81ab('0x24')]();channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x31')]=utils[_0x81ab('0x32')](channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x30')],channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x33')]);channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x34')]=channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x28')]?utils[_0x81ab('0x32')](channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x30')],channels[_0x4b8b32[_0x81ab('0x10')]][_0x81ab('0x28')]):0x0;writeDB(channels[_0x4b8b32[_0x81ab('0x10')]]);}}catch(_0x576f21){utils[_0x81ab('0x1c')](util['format'](_0x81ab('0x2b'),_0x4b8b32[_0x81ab('0x10')]),_0x576f21);}};exports[_0x81ab('0x35')]=function(_0x509cdf){try{if(!_[_0x81ab('0x20')](channels[_0x509cdf['localtwolinkedid']])){utils['debug'](util[_0x81ab('0x16')](_0x81ab('0x36'),_0x509cdf[_0x81ab('0x37')]),_0x509cdf);if(channels[_0x509cdf[_0x81ab('0x38')]][_0x81ab('0x6')]==_0x509cdf['transfereechannel']){utils[_0x81ab('0x15')](util[_0x81ab('0x16')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x509cdf[_0x81ab('0x37')],_0x509cdf[_0x81ab('0x38')],_0x509cdf[_0x81ab('0x39')]));channels[_0x509cdf[_0x81ab('0x38')]][_0x81ab('0x27')]=_0x509cdf['secondtransfererchannel'];channels[_0x509cdf[_0x81ab('0x38')]][_0x81ab('0x3a')]=_0x81ab('0x3b');}else if(channels[_0x509cdf[_0x81ab('0x38')]]['channel']=_0x509cdf[_0x81ab('0x3c')]){utils['info'](util[_0x81ab('0x16')](_0x81ab('0x3d'),_0x509cdf[_0x81ab('0x37')],_0x509cdf[_0x81ab('0x38')],_0x509cdf[_0x81ab('0x3e')]));channels[_0x509cdf[_0x81ab('0x38')]]['destinationchannel']=_0x509cdf[_0x81ab('0x3e')];channels[_0x509cdf[_0x81ab('0x38')]][_0x81ab('0x3a')]=_0x81ab('0x3b');}}}catch(_0x5ca496){utils[_0x81ab('0x1c')](util[_0x81ab('0x16')](_0x81ab('0x36'),_0x509cdf[_0x81ab('0x37')]),_0x5ca496);}};exports[_0x81ab('0x3f')]=function(_0xd2704c){try{if(!_['isNil'](channels[_0xd2704c[_0x81ab('0x10')]])){utils['debug'](util[_0x81ab('0x16')](_0x81ab('0x40'),_0xd2704c['uniqueid']),_0xd2704c);channels[_0xd2704c[_0x81ab('0x10')]][_0x81ab('0x41')]=utils[_0x81ab('0x24')]();utils[_0x81ab('0x15')](util[_0x81ab('0x16')](_0x81ab('0x42'),_0xd2704c[_0x81ab('0x10')],channels[_0xd2704c['uniqueid']][_0x81ab('0x41')]));}}catch(_0x544bb9){utils['error'](util[_0x81ab('0x16')](_0x81ab('0x40'),_0xd2704c[_0x81ab('0x10')]),_0x544bb9);}};exports['musiconholdstop']=function(_0x311d8f){try{if(!_[_0x81ab('0x20')](channels[_0x311d8f[_0x81ab('0x10')]])){utils[_0x81ab('0x1e')](util[_0x81ab('0x16')](_0x81ab('0x43'),_0x311d8f[_0x81ab('0x10')]),_0x311d8f);if(!_[_0x81ab('0x20')](channels[_0x311d8f[_0x81ab('0x10')]][_0x81ab('0x41')])){channels[_0x311d8f[_0x81ab('0x10')]][_0x81ab('0x44')]+=utils[_0x81ab('0x32')](utils[_0x81ab('0x24')](),channels[_0x311d8f[_0x81ab('0x10')]][_0x81ab('0x41')]);utils['info'](util[_0x81ab('0x16')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x311d8f[_0x81ab('0x10')],channels[_0x311d8f[_0x81ab('0x10')]][_0x81ab('0x44')]));delete channels[_0x311d8f['uniqueid']][_0x81ab('0x41')];}}}catch(_0x11cabb){utils[_0x81ab('0x1c')](util['format'](_0x81ab('0x43'),_0x311d8f[_0x81ab('0x10')]),_0x11cabb);}};exports[_0x81ab('0x45')]=function(_0x637968){try{if(!_[_0x81ab('0x20')](channels[_0x637968[_0x81ab('0x10')]])){utils[_0x81ab('0x1e')](util[_0x81ab('0x16')](_0x81ab('0x46'),_0x637968[_0x81ab('0x10')]),_0x637968);if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')]['xmd-originatecalleridnum'])){utils[_0x81ab('0x15')](util[_0x81ab('0x16')](_0x81ab('0x48'),_0x637968[_0x81ab('0x10')],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x4a')]=_0x637968['value'];}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x4b')])){utils['info'](util[_0x81ab('0x16')](_0x81ab('0x4c'),_0x637968[_0x81ab('0x10')],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x4d')]=_0x637968[_0x81ab('0x49')];channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x2c')]='\x22'+_0x637968['value']+_0x81ab('0x4e')+_0x637968['value']+'>';}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x4f')])||!_[_0x81ab('0x20')](_0x637968['variable'][_0x81ab('0x50')])){utils['info'](util[_0x81ab('0x16')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x637968['uniqueid'],!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x4f')])?'xmd-callerid-preview':_0x81ab('0x50'),_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]]['callerid']=_0x637968[_0x81ab('0x49')];}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x51')])||!_['isNil'](_0x637968[_0x81ab('0x47')][_0x81ab('0x52')])){utils['info'](util['format'](_0x81ab('0x53'),_0x637968[_0x81ab('0x10')],!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')]['xmd-queue'])?_0x81ab('0x51'):_0x81ab('0x52'),_0x637968[_0x81ab('0x49')]));channels[_0x637968['uniqueid']][_0x81ab('0x54')]=_0x81ab('0x55');channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x56')]=_0x637968[_0x81ab('0x49')];channels[_0x637968['uniqueid']][_0x81ab('0x7')]=!![];}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x57')])){utils[_0x81ab('0x15')](util[_0x81ab('0x16')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x637968[_0x81ab('0x10')],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]]['ContactId']=_0x637968[_0x81ab('0x49')];}if(!_[_0x81ab('0x20')](_0x637968['variable'][_0x81ab('0x58')])){utils[_0x81ab('0x15')](util['format'](_0x81ab('0x59'),_0x637968[_0x81ab('0x10')],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x5a')]=_0x637968[_0x81ab('0x49')];}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')]['outboundrouteid'])){utils[_0x81ab('0x15')](util[_0x81ab('0x16')](_0x81ab('0x5b'),_0x637968['uniqueid'],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x5c')]=_0x637968[_0x81ab('0x49')];}if(!_[_0x81ab('0x20')](_0x637968[_0x81ab('0x47')][_0x81ab('0x5d')])){utils[_0x81ab('0x15')](util['format'](_0x81ab('0x5e'),_0x637968['uniqueid'],_0x637968[_0x81ab('0x49')]));channels[_0x637968[_0x81ab('0x10')]][_0x81ab('0x5d')]=_0x637968[_0x81ab('0x49')];}}}catch(_0x10df31){utils[_0x81ab('0x1c')](util[_0x81ab('0x16')]('[%s][calls][varset]',_0x637968[_0x81ab('0x10')]),_0x10df31);}};exports[_0x81ab('0x5f')]=function(_0xe39daa){try{if(!_['isNil'](channels[_0xe39daa[_0x81ab('0x10')]])){utils['debug'](util[_0x81ab('0x16')](_0x81ab('0x60'),_0xe39daa[_0x81ab('0x10')]),_0xe39daa);utils[_0x81ab('0x15')](util['format'](_0x81ab('0x61'),_0xe39daa[_0x81ab('0x10')],_0xe39daa[_0x81ab('0x62')],_0xe39daa['appdata']));if(_0xe39daa[_0x81ab('0x62')][_0x81ab('0x63')]()==_0x81ab('0x64')&&_[_0x81ab('0x65')](_0xe39daa[_0x81ab('0x66')]['toLowerCase'](),_0x81ab('0x67'))){var _0x3fe5d7=_0xe39daa[_0x81ab('0x66')]['split']('=');var _0x7b7650=_0x3fe5d7[0x0][_0x81ab('0x68')](_0x3fe5d7[0x0]['lastIndexOf']('(')+0x1,_0x3fe5d7[0x0][_0x81ab('0x69')](')'));var _0x1d831f=_0x3fe5d7[0x1];channels[_0xe39daa[_0x81ab('0x10')]][_0x7b7650]=_0x1d831f;}if(!_[_0x81ab('0x6a')](['hangup',_0x81ab('0x6b'),'execif','set',_0x81ab('0x6c')],_0xe39daa['application'][_0x81ab('0x63')]())){channels[_0xe39daa[_0x81ab('0x10')]][_0x81ab('0x54')]=_0xe39daa['application'];channels[_0xe39daa[_0x81ab('0x10')]]['lastdata']=_0xe39daa[_0x81ab('0x66')];}}}catch(_0x280f27){utils[_0x81ab('0x1c')](util[_0x81ab('0x16')]('[%s][calls][newexten]',_0xe39daa[_0x81ab('0x10')]),_0x280f27);}}; \ No newline at end of file +var _0x096b=['[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','uniqueid','channel','queue','membername','interface','connectedlinenum','accountcode','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','DOCUMENTATION','error','debug','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','ANSWERED','hangup','[%s][calls][hangup]','callerid','cause-txt','duration','diffTime','endtime','billableseconds','answertime','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x096b,0x72));var _0xb096=function(_0x126e93,_0x5a2ae0){_0x126e93=_0x126e93-0x0;var _0xfc452f=_0x096b[_0x126e93];return _0xfc452f;};'use strict';var _=require(_0xb096('0x0'));var util=require(_0xb096('0x1'));var utils=require(_0xb096('0x2'));var dispositions=[_0xb096('0x3'),_0xb096('0x4'),_0xb096('0x4'),_0xb096('0x3'),'NO\x20ANSWER',_0xb096('0x3'),'ANSWERED',_0xb096('0x5'),_0xb096('0x4'),_0xb096('0x4'),_0xb096('0x4')];var channels={};function writeDB(_0x1f794b){utils[_0xb096('0x6')](util[_0xb096('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1f794b[_0xb096('0x8')],_0x1f794b[_0xb096('0x9')],_0x1f794b[_0xb096('0xa')],_0x1f794b[_0xb096('0xb')],_0x1f794b[_0xb096('0xc')],_0x1f794b['calleridnum'],_0x1f794b[_0xb096('0xd')],_0x1f794b['lastevent']));if(_0x1f794b[_0xb096('0xe')]){utils['getUserByInternal'](_0x1f794b[_0xb096('0xe')])['then'](function(_0x475c3a){if(_0x475c3a){_0x1f794b['UserId']=_0x475c3a['id'];}utils['request'](_0xb096('0xf'),_0x1f794b);});}else{utils['request'](_0xb096('0xf'),_0x1f794b);}if(channels[_0x1f794b[_0xb096('0x8')]]){delete channels[_0x1f794b[_0xb096('0x8')]];}}exports[_0xb096('0x10')]=function(_0x198b34){try{utils['debug'](util['format'](_0xb096('0x11'),_0x198b34[_0xb096('0x8')]),_0x198b34);if(_0x198b34['uniqueid']==_0x198b34[_0xb096('0x12')]&&_0x198b34[_0xb096('0x9')]!=_0xb096('0x13')){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x14'),_0x198b34[_0xb096('0x8')],_0x198b34['context'],_0x198b34[_0xb096('0x15')]));channels[_0x198b34[_0xb096('0x8')]]={'uniqueid':_0x198b34[_0xb096('0x8')],'accountcode':_0x198b34[_0xb096('0xe')],'source':_0x198b34[_0xb096('0x16')],'destination':_0x198b34[_0xb096('0x15')],'destinationcontext':_0x198b34[_0xb096('0x17')],'channel':_0x198b34[_0xb096('0x9')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb096('0x3'),'amaflags':_0xb096('0x18')};}}catch(_0x1864a8){utils[_0xb096('0x19')](util[_0xb096('0x7')](_0xb096('0x11'),_0x198b34[_0xb096('0x8')]),_0x1864a8);}};exports['newstate']=function(_0x2ac3b9){try{utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x1b'),_0x2ac3b9[_0xb096('0x8')]),_0x2ac3b9);if(!_[_0xb096('0x1c')](channels[_0x2ac3b9[_0xb096('0x8')]])&&_0x2ac3b9['channelstate']==0x6){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x1d'),_0x2ac3b9[_0xb096('0x8')],_0x2ac3b9['context'],_0x2ac3b9['channel']));if(_['isNil'](channels[_0x2ac3b9['uniqueid']][_0xb096('0x1e')])){channels[_0x2ac3b9['uniqueid']][_0xb096('0x1e')]=utils[_0xb096('0x1f')]();}}else if(!_[_0xb096('0x1c')](channels[_0x2ac3b9['linkedid']])&&_0x2ac3b9[_0xb096('0x20')]==0x6&&_0x2ac3b9[_0xb096('0x17')]!=_0xb096('0x21')){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x22'),_0x2ac3b9[_0xb096('0x8')],_0x2ac3b9[_0xb096('0x12')],_0x2ac3b9[_0xb096('0x17')],_0x2ac3b9['channel']));channels[_0x2ac3b9[_0xb096('0x12')]][_0xb096('0xe')]=_0x2ac3b9[_0xb096('0xe')];channels[_0x2ac3b9[_0xb096('0x12')]][_0xb096('0x23')]=_0x2ac3b9[_0xb096('0x9')];if(_['isNil'](channels[_0x2ac3b9[_0xb096('0x12')]]['answertime'])){channels[_0x2ac3b9['linkedid']]['answertime']=utils[_0xb096('0x1f')]();}channels[_0x2ac3b9['linkedid']][_0xb096('0x24')]=dispositions[_['toNumber'](_0x2ac3b9[_0xb096('0x20')])]||_0xb096('0x25');}}catch(_0x5893a6){utils['error'](util[_0xb096('0x7')](_0xb096('0x1b'),_0x2ac3b9[_0xb096('0x8')]),_0x5893a6);}};exports[_0xb096('0x26')]=function(_0x40aa44){try{if(!_[_0xb096('0x1c')](channels[_0x40aa44[_0xb096('0x8')]])){utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x27'),_0x40aa44[_0xb096('0x8')]),_0x40aa44);if(_[_0xb096('0x1c')](channels[_0x40aa44[_0xb096('0x8')]][_0xb096('0x28')])){channels[_0x40aa44['uniqueid']][_0xb096('0x28')]=_0x40aa44['calleridname']+'\x20<'+_0x40aa44[_0xb096('0x16')]+'>';}utils[_0xb096('0x6')](util[_0xb096('0x7')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x40aa44[_0xb096('0x8')],channels[_0x40aa44[_0xb096('0x8')]]['callerid'],_0x40aa44[_0xb096('0x29')]));channels[_0x40aa44['uniqueid']]['endtime']=utils[_0xb096('0x1f')]();channels[_0x40aa44['uniqueid']][_0xb096('0x2a')]=utils[_0xb096('0x2b')](channels[_0x40aa44[_0xb096('0x8')]][_0xb096('0x2c')],channels[_0x40aa44['uniqueid']]['starttime']);channels[_0x40aa44[_0xb096('0x8')]][_0xb096('0x2d')]=channels[_0x40aa44['uniqueid']][_0xb096('0x2e')]?utils[_0xb096('0x2b')](channels[_0x40aa44[_0xb096('0x8')]]['endtime'],channels[_0x40aa44['uniqueid']][_0xb096('0x2e')]):0x0;writeDB(channels[_0x40aa44['uniqueid']]);}}catch(_0x22fc00){utils[_0xb096('0x19')](util['format'](_0xb096('0x27'),_0x40aa44['uniqueid']),_0x22fc00);}};exports['attendedtransfer']=function(_0x2d83d3){try{if(!_[_0xb096('0x1c')](channels[_0x2d83d3['localtwolinkedid']])){utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x2f'),_0x2d83d3['origtransfereruniqueid']),_0x2d83d3);if(channels[_0x2d83d3['localtwolinkedid']][_0xb096('0x9')]==_0x2d83d3[_0xb096('0x30')]){utils['info'](util['format'](_0xb096('0x31'),_0x2d83d3['origtransfereruniqueid'],_0x2d83d3[_0xb096('0x32')],_0x2d83d3[_0xb096('0x33')]));channels[_0x2d83d3['localtwolinkedid']]['destinationchannel']=_0x2d83d3[_0xb096('0x33')];channels[_0x2d83d3[_0xb096('0x32')]][_0xb096('0x34')]=_0xb096('0x35');}else if(channels[_0x2d83d3[_0xb096('0x32')]][_0xb096('0x9')]=_0x2d83d3[_0xb096('0x36')]){utils[_0xb096('0x6')](util['format'](_0xb096('0x31'),_0x2d83d3[_0xb096('0x37')],_0x2d83d3[_0xb096('0x32')],_0x2d83d3[_0xb096('0x38')]));channels[_0x2d83d3[_0xb096('0x32')]][_0xb096('0x23')]=_0x2d83d3[_0xb096('0x38')];channels[_0x2d83d3[_0xb096('0x32')]][_0xb096('0x34')]=_0xb096('0x35');}}}catch(_0xbc472f){utils['error'](util[_0xb096('0x7')](_0xb096('0x2f'),_0x2d83d3[_0xb096('0x37')]),_0xbc472f);}};exports[_0xb096('0x39')]=function(_0x12eecb){try{if(!_['isNil'](channels[_0x12eecb[_0xb096('0x8')]])){utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x3a'),_0x12eecb[_0xb096('0x8')]),_0x12eecb);channels[_0x12eecb[_0xb096('0x8')]][_0xb096('0x3b')]=utils['now']();utils[_0xb096('0x6')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x12eecb[_0xb096('0x8')],channels[_0x12eecb[_0xb096('0x8')]][_0xb096('0x3b')]));}}catch(_0x1a8554){utils[_0xb096('0x19')](util['format'](_0xb096('0x3a'),_0x12eecb[_0xb096('0x8')]),_0x1a8554);}};exports[_0xb096('0x3c')]=function(_0x38b02b){try{if(!_[_0xb096('0x1c')](channels[_0x38b02b[_0xb096('0x8')]])){utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x3d'),_0x38b02b[_0xb096('0x8')]),_0x38b02b);if(!_['isNil'](channels[_0x38b02b[_0xb096('0x8')]][_0xb096('0x3b')])){channels[_0x38b02b[_0xb096('0x8')]][_0xb096('0x3e')]+=utils[_0xb096('0x2b')](utils[_0xb096('0x1f')](),channels[_0x38b02b[_0xb096('0x8')]]['musiconholdstartAt']);utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x3f'),_0x38b02b['uniqueid'],channels[_0x38b02b['uniqueid']][_0xb096('0x3e')]));delete channels[_0x38b02b[_0xb096('0x8')]][_0xb096('0x3b')];}}}catch(_0x455ad9){utils['error'](util[_0xb096('0x7')](_0xb096('0x3d'),_0x38b02b[_0xb096('0x8')]),_0x455ad9);}};exports['varset']=function(_0x4de1f9){try{if(!_['isNil'](channels[_0x4de1f9[_0xb096('0x8')]])){utils[_0xb096('0x1a')](util[_0xb096('0x7')](_0xb096('0x40'),_0x4de1f9[_0xb096('0x8')]),_0x4de1f9);if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')][_0xb096('0x42')])){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x43'),_0x4de1f9['uniqueid'],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9['uniqueid']][_0xb096('0x45')]=_0x4de1f9[_0xb096('0x44')];}if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')][_0xb096('0x46')])){utils['info'](util[_0xb096('0x7')](_0xb096('0x47'),_0x4de1f9[_0xb096('0x8')],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9['uniqueid']][_0xb096('0x48')]=_0x4de1f9[_0xb096('0x44')];channels[_0x4de1f9['uniqueid']][_0xb096('0x28')]='\x22'+_0x4de1f9['value']+_0xb096('0x49')+_0x4de1f9[_0xb096('0x44')]+'>';}if(!_[_0xb096('0x1c')](_0x4de1f9['variable'][_0xb096('0x4a')])||!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')]['xmd-callerid'])){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x4b'),_0x4de1f9[_0xb096('0x8')],!_[_0xb096('0x1c')](_0x4de1f9['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9[_0xb096('0x8')]][_0xb096('0x28')]=_0x4de1f9[_0xb096('0x44')];}if(!_['isNil'](_0x4de1f9[_0xb096('0x41')][_0xb096('0x4c')])||!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')]['xmcs-queue'])){utils[_0xb096('0x6')](util['format'](_0xb096('0x4b'),_0x4de1f9[_0xb096('0x8')],!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')][_0xb096('0x4c')])?_0xb096('0x4c'):'xmcs-queue',_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9[_0xb096('0x8')]][_0xb096('0x4d')]=_0xb096('0x4e');channels[_0x4de1f9[_0xb096('0x8')]]['lastdata']=_0x4de1f9[_0xb096('0x44')];channels[_0x4de1f9[_0xb096('0x8')]][_0xb096('0xa')]=!![];}if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')][_0xb096('0x4f')])){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x50'),_0x4de1f9[_0xb096('0x8')],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9[_0xb096('0x8')]][_0xb096('0x51')]=_0x4de1f9[_0xb096('0x44')];}if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')][_0xb096('0x52')])){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x53'),_0x4de1f9[_0xb096('0x8')],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9[_0xb096('0x8')]]['type']=_0x4de1f9[_0xb096('0x44')];}if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')]['outboundrouteid'])){utils[_0xb096('0x6')](util[_0xb096('0x7')](_0xb096('0x54'),_0x4de1f9[_0xb096('0x8')],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9['uniqueid']]['routeid']=_0x4de1f9[_0xb096('0x44')];}if(!_[_0xb096('0x1c')](_0x4de1f9[_0xb096('0x41')]['sipcallid'])){utils['info'](util[_0xb096('0x7')](_0xb096('0x55'),_0x4de1f9[_0xb096('0x8')],_0x4de1f9[_0xb096('0x44')]));channels[_0x4de1f9['uniqueid']][_0xb096('0x56')]=_0x4de1f9['value'];}}}catch(_0x5080c1){utils['error'](util[_0xb096('0x7')](_0xb096('0x40'),_0x4de1f9[_0xb096('0x8')]),_0x5080c1);}};exports[_0xb096('0x57')]=function(_0xf74629){try{if(!_['isNil'](channels[_0xf74629['uniqueid']])){utils[_0xb096('0x1a')](util['format']('[%s][calls][newexten]',_0xf74629[_0xb096('0x8')]),_0xf74629);utils[_0xb096('0x6')](util['format'](_0xb096('0x58'),_0xf74629[_0xb096('0x8')],_0xf74629[_0xb096('0x59')],_0xf74629[_0xb096('0x5a')]));if(_0xf74629['application'][_0xb096('0x5b')]()==_0xb096('0x5c')&&_['startsWith'](_0xf74629[_0xb096('0x5a')]['toLowerCase'](),_0xb096('0x5d'))){var _0xe52d09=_0xf74629[_0xb096('0x5a')][_0xb096('0x5e')]('=');var _0x3dd222=_0xe52d09[0x0]['substring'](_0xe52d09[0x0][_0xb096('0x5f')]('(')+0x1,_0xe52d09[0x0]['lastIndexOf'](')'));var _0xfb2104=_0xe52d09[0x1];channels[_0xf74629['uniqueid']][_0x3dd222]=_0xfb2104;}if(!_[_0xb096('0x60')]([_0xb096('0x26'),_0xb096('0x61'),_0xb096('0x62'),'set',_0xb096('0x63')],_0xf74629[_0xb096('0x59')][_0xb096('0x5b')]())){channels[_0xf74629[_0xb096('0x8')]][_0xb096('0x4d')]=_0xf74629['application'];channels[_0xf74629[_0xb096('0x8')]][_0xb096('0x64')]=_0xf74629[_0xb096('0x5a')];}}}catch(_0x56fd8a){utils['error'](util['format']('[%s][calls][newexten]',_0xf74629[_0xb096('0x8')]),_0x56fd8a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 834dce3..94aa5b8 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 _0x3b2e=['fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown'];(function(_0x1c25a6,_0xd4339d){var _0x5c58ff=function(_0x437096){while(--_0x437096){_0x1c25a6['push'](_0x1c25a6['shift']());}};_0x5c58ff(++_0xd4339d);}(_0x3b2e,0x10a));var _0xe3b2=function(_0x584bcd,_0x59c4b7){_0x584bcd=_0x584bcd-0x0;var _0x146bc7=_0x3b2e[_0x584bcd];return _0x146bc7;};'use strict';var utils=require('./utils');exports[_0xe3b2('0x0')]=function(){utils[_0xe3b2('0x1')](_0xe3b2('0x2'));};exports[_0xe3b2('0x3')]=function(){utils['info']('[core]\x20shutdown');};exports[_0xe3b2('0x4')]=function(){utils[_0xe3b2('0x1')]('[core]\x20fullybooted');};exports[_0xe3b2('0x5')]=function(_0x6f18dd){utils[_0xe3b2('0x5')](_0xe3b2('0x6'),_0x6f18dd);};exports[_0xe3b2('0x7')]=function(){utils['info'](_0xe3b2('0x8'));};exports[_0xe3b2('0x9')]=function(_0xf43705){}; \ No newline at end of file +var _0x9ea3=['fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x2e7a41,_0x3cee63){var _0x200c42=function(_0x1b1de1){while(--_0x1b1de1){_0x2e7a41['push'](_0x2e7a41['shift']());}};_0x200c42(++_0x3cee63);}(_0x9ea3,0x126));var _0x39ea=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x9ea3[_0x4e9d3c];return _0x2d0825;};'use strict';var utils=require(_0x39ea('0x0'));exports[_0x39ea('0x1')]=function(){utils[_0x39ea('0x2')](_0x39ea('0x3'));};exports[_0x39ea('0x4')]=function(){utils[_0x39ea('0x2')](_0x39ea('0x5'));};exports[_0x39ea('0x6')]=function(){utils[_0x39ea('0x2')]('[core]\x20fullybooted');};exports[_0x39ea('0x7')]=function(_0x48c66f){utils[_0x39ea('0x7')](_0x39ea('0x8'),_0x48c66f);};exports[_0x39ea('0x9')]=function(){utils['info'](_0x39ea('0xa'));};exports[_0x39ea('0xb')]=function(_0x3f9583){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f6ed78f..df8b2f4 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 _0x37be=['debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','isNil','ANSWER','assign','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','now','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid'];(function(_0x5e5f5a,_0x5cb19a){var _0x4141ae=function(_0x4bb2ea){while(--_0x4bb2ea){_0x5e5f5a['push'](_0x5e5f5a['shift']());}};_0x4141ae(++_0x5cb19a);}(_0x37be,0x14c));var _0xe37b=function(_0x33d1aa,_0x2ec38c){_0x33d1aa=_0x33d1aa-0x0;var _0x30e1cb=_0x37be[_0x33d1aa];return _0x30e1cb;};'use strict';var _=require(_0xe37b('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x29ca62){utils[_0xe37b('0x1')](util[_0xe37b('0x2')](_0xe37b('0x3'),_0x29ca62['uniqueid'],_0x29ca62[_0xe37b('0x4')],_0x29ca62[_0xe37b('0x5')],_0x29ca62[_0xe37b('0x6')],_0x29ca62[_0xe37b('0x7')],_0x29ca62[_0xe37b('0x8')]));utils[_0xe37b('0x9')]('CreateVoiceDialReport',_0x29ca62);delete dials[_0x29ca62[_0xe37b('0xa')]];}exports['newexten']=function(_0x3ff0f6){try{utils[_0xe37b('0xb')](util[_0xe37b('0x2')](_0xe37b('0xc'),_0x3ff0f6[_0xe37b('0xa')]),_0x3ff0f6);utils[_0xe37b('0x1')](util[_0xe37b('0x2')](_0xe37b('0xd'),_0x3ff0f6[_0xe37b('0xa')],_0x3ff0f6[_0xe37b('0xe')],_0x3ff0f6[_0xe37b('0xf')]));if(_0x3ff0f6[_0xe37b('0xe')][_0xe37b('0x10')]()==_0xe37b('0x11')&&_[_0xe37b('0x12')](_0x3ff0f6[_0xe37b('0xf')][_0xe37b('0x10')](),_0xe37b('0x13'))){var _0xb520d9=_0x3ff0f6['appdata']['split']('=');dials[_0x3ff0f6['uniqueid']]={'routeId':_0xb520d9[0x1]};}}catch(_0x540fb9){utils[_0xe37b('0x14')](util[_0xe37b('0x2')](_0xe37b('0xc'),_0x3ff0f6[_0xe37b('0xa')]),_0x540fb9);}};exports[_0xe37b('0x15')]=function(_0x2ef2f4){try{utils['debug'](util[_0xe37b('0x2')](_0xe37b('0x16'),_0x2ef2f4[_0xe37b('0xa')]),_0x2ef2f4);if(!_['isNil'](_0x2ef2f4[_0xe37b('0x17')]['outboundrouteid'])){utils[_0xe37b('0x1')](util[_0xe37b('0x2')](_0xe37b('0x18'),_0x2ef2f4[_0xe37b('0xa')],_0x2ef2f4[_0xe37b('0x19')]));dials[_0x2ef2f4[_0xe37b('0xa')]]={'routeId':_0x2ef2f4[_0xe37b('0x19')]};}}catch(_0x15d954){utils[_0xe37b('0x14')](util[_0xe37b('0x2')](_0xe37b('0x16'),_0x2ef2f4[_0xe37b('0xa')]),_0x15d954);}};exports[_0xe37b('0x1a')]=function(_0x46c857){try{if(!_['isNil'](dials[_0x46c857[_0xe37b('0xa')]])){utils['debug'](util[_0xe37b('0x2')](_0xe37b('0x1b'),_0x46c857[_0xe37b('0xa')]),_0x46c857);dials[_0x46c857[_0xe37b('0xa')]]=_['assign'](dials[_0x46c857[_0xe37b('0xa')]],_0x46c857);dials[_0x46c857[_0xe37b('0xa')]][_0xe37b('0x1c')]=utils['now']();dials[_0x46c857[_0xe37b('0xa')]]['lastevent']=_0xe37b('0x1d');utils[_0xe37b('0x1')](util['format'](_0xe37b('0x1e'),_0x46c857[_0xe37b('0xa')],dials[_0x46c857[_0xe37b('0xa')]][_0xe37b('0x1c')]));}}catch(_0x2f31e2){utils['error'](util['format']('[%s][dials][dialbegin]',_0x46c857[_0xe37b('0xa')]),_0x2f31e2);}};exports['dialend']=function(_0x69ac49){try{if(!_[_0xe37b('0x1f')](dials[_0x69ac49[_0xe37b('0xa')]])){utils[_0xe37b('0xb')](util[_0xe37b('0x2')]('[%s][dials][dialend]',_0x69ac49[_0xe37b('0xa')]),_0x69ac49);dials[_0x69ac49[_0xe37b('0xa')]]['dialstatus']=_0x69ac49[_0xe37b('0x8')];if(_0x69ac49[_0xe37b('0x8')]==_0xe37b('0x20')){dials[_0x69ac49[_0xe37b('0xa')]]=_[_0xe37b('0x21')](dials[_0x69ac49['uniqueid']],_0x69ac49);dials[_0x69ac49[_0xe37b('0xa')]]['answertime']=utils['now']();dials[_0x69ac49[_0xe37b('0xa')]][_0xe37b('0x22')]=_0xe37b('0x23');utils['info'](util[_0xe37b('0x2')](_0xe37b('0x24'),_0x69ac49[_0xe37b('0xa')],_0x69ac49[_0xe37b('0x8')],dials[_0x69ac49[_0xe37b('0xa')]][_0xe37b('0x25')]));}else{utils[_0xe37b('0x1')](util[_0xe37b('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x69ac49[_0xe37b('0xa')],_0x69ac49[_0xe37b('0x8')]));}}}catch(_0x28eb03){utils[_0xe37b('0x14')](util[_0xe37b('0x2')](_0xe37b('0x26'),_0x69ac49[_0xe37b('0xa')]),_0x28eb03);}};exports['hangup']=function(_0x1de571){try{if(!_[_0xe37b('0x1f')](dials[_0x1de571[_0xe37b('0xa')]])){utils[_0xe37b('0xb')](util[_0xe37b('0x2')](_0xe37b('0x27'),_0x1de571['uniqueid']),_0x1de571);utils['info'](util[_0xe37b('0x2')](_0xe37b('0x28'),_0x1de571[_0xe37b('0xa')],_0x1de571[_0xe37b('0x6')],_0x1de571[_0xe37b('0x29')],_0x1de571['cause-txt']));dials[_0x1de571[_0xe37b('0xa')]]=_[_0xe37b('0x21')](dials[_0x1de571[_0xe37b('0xa')]],{'endtime':utils[_0xe37b('0x2a')](),'lastevent':_0xe37b('0x2b')});dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x2c')]=utils[_0xe37b('0x2d')](dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x2e')],dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x1c')]);dials[_0x1de571['uniqueid']][_0xe37b('0x2f')]=utils['diffTime'](dials[_0x1de571['uniqueid']][_0xe37b('0x25')]||dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x2e')],dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x1c')]);dials[_0x1de571['uniqueid']][_0xe37b('0x30')]=dials[_0x1de571['uniqueid']][_0xe37b('0x25')]?utils[_0xe37b('0x2d')](dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x2e')],dials[_0x1de571[_0xe37b('0xa')]][_0xe37b('0x25')]):0x0;writeDB(dials[_0x1de571[_0xe37b('0xa')]]);}}catch(_0x3b6d6b){utils[_0xe37b('0x14')](util[_0xe37b('0x2')](_0xe37b('0x27'),_0x1de571[_0xe37b('0xa')]),_0x3b6d6b);}}; \ No newline at end of file +var _0x969c=['calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','error','[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','assign','starttime','now','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x2a0045,_0x2015cd){var _0x3e024f=function(_0x2e79d1){while(--_0x2e79d1){_0x2a0045['push'](_0x2a0045['shift']());}};_0x3e024f(++_0x2015cd);}(_0x969c,0x166));var _0xc969=function(_0x123cf7,_0x320daf){_0x123cf7=_0x123cf7-0x0;var _0x799caf=_0x969c[_0x123cf7];return _0x799caf;};'use strict';var _=require(_0xc969('0x0'));var util=require(_0xc969('0x1'));var utils=require(_0xc969('0x2'));var dials={};function writeDB(_0x2aeea6){utils[_0xc969('0x3')](util['format'](_0xc969('0x4'),_0x2aeea6[_0xc969('0x5')],_0x2aeea6[_0xc969('0x6')],_0x2aeea6[_0xc969('0x7')],_0x2aeea6[_0xc969('0x8')],_0x2aeea6[_0xc969('0x9')],_0x2aeea6[_0xc969('0xa')]));utils[_0xc969('0xb')](_0xc969('0xc'),_0x2aeea6);delete dials[_0x2aeea6[_0xc969('0x5')]];}exports[_0xc969('0xd')]=function(_0x196df2){try{utils[_0xc969('0xe')](util[_0xc969('0xf')]('[%s][dials][newexten]',_0x196df2[_0xc969('0x5')]),_0x196df2);utils['info'](util['format'](_0xc969('0x10'),_0x196df2[_0xc969('0x5')],_0x196df2[_0xc969('0x11')],_0x196df2[_0xc969('0x12')]));if(_0x196df2[_0xc969('0x11')]['toLowerCase']()==_0xc969('0x13')&&_[_0xc969('0x14')](_0x196df2[_0xc969('0x12')]['toLowerCase'](),_0xc969('0x15'))){var _0x1a9d25=_0x196df2[_0xc969('0x12')]['split']('=');dials[_0x196df2[_0xc969('0x5')]]={'routeId':_0x1a9d25[0x1]};}}catch(_0x420cd3){utils[_0xc969('0x16')](util[_0xc969('0xf')](_0xc969('0x17'),_0x196df2[_0xc969('0x5')]),_0x420cd3);}};exports['varset']=function(_0x27408e){try{utils['debug'](util[_0xc969('0xf')](_0xc969('0x18'),_0x27408e['uniqueid']),_0x27408e);if(!_[_0xc969('0x19')](_0x27408e[_0xc969('0x1a')][_0xc969('0x1b')])){utils['info'](util[_0xc969('0xf')](_0xc969('0x1c'),_0x27408e[_0xc969('0x5')],_0x27408e['value']));dials[_0x27408e[_0xc969('0x5')]]={'routeId':_0x27408e[_0xc969('0x1d')]};}}catch(_0x44d60d){utils[_0xc969('0x16')](util[_0xc969('0xf')](_0xc969('0x18'),_0x27408e['uniqueid']),_0x44d60d);}};exports['dialbegin']=function(_0x395d27){try{if(!_['isNil'](dials[_0x395d27[_0xc969('0x5')]])){utils[_0xc969('0xe')](util[_0xc969('0xf')]('[%s][dials][dialbegin]',_0x395d27['uniqueid']),_0x395d27);dials[_0x395d27[_0xc969('0x5')]]=_[_0xc969('0x1e')](dials[_0x395d27[_0xc969('0x5')]],_0x395d27);dials[_0x395d27[_0xc969('0x5')]][_0xc969('0x1f')]=utils[_0xc969('0x20')]();dials[_0x395d27['uniqueid']]['lastevent']=_0xc969('0x21');utils[_0xc969('0x3')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x395d27[_0xc969('0x5')],dials[_0x395d27[_0xc969('0x5')]][_0xc969('0x1f')]));}}catch(_0xb7a140){utils['error'](util['format'](_0xc969('0x22'),_0x395d27[_0xc969('0x5')]),_0xb7a140);}};exports[_0xc969('0x23')]=function(_0x52eae9){try{if(!_[_0xc969('0x19')](dials[_0x52eae9[_0xc969('0x5')]])){utils[_0xc969('0xe')](util['format'](_0xc969('0x24'),_0x52eae9[_0xc969('0x5')]),_0x52eae9);dials[_0x52eae9['uniqueid']][_0xc969('0xa')]=_0x52eae9[_0xc969('0xa')];if(_0x52eae9[_0xc969('0xa')]==_0xc969('0x25')){dials[_0x52eae9[_0xc969('0x5')]]=_[_0xc969('0x1e')](dials[_0x52eae9[_0xc969('0x5')]],_0x52eae9);dials[_0x52eae9[_0xc969('0x5')]][_0xc969('0x26')]=utils[_0xc969('0x20')]();dials[_0x52eae9[_0xc969('0x5')]]['lastevent']='connect';utils['info'](util[_0xc969('0xf')](_0xc969('0x27'),_0x52eae9[_0xc969('0x5')],_0x52eae9['dialstatus'],dials[_0x52eae9[_0xc969('0x5')]]['answertime']));}else{utils[_0xc969('0x3')](util[_0xc969('0xf')](_0xc969('0x28'),_0x52eae9[_0xc969('0x5')],_0x52eae9[_0xc969('0xa')]));}}}catch(_0x3b2931){utils['error'](util[_0xc969('0xf')](_0xc969('0x24'),_0x52eae9[_0xc969('0x5')]),_0x3b2931);}};exports['hangup']=function(_0x4fb7a5){try{if(!_['isNil'](dials[_0x4fb7a5[_0xc969('0x5')]])){utils[_0xc969('0xe')](util[_0xc969('0xf')]('[%s][dials][hangup]',_0x4fb7a5['uniqueid']),_0x4fb7a5);utils['info'](util[_0xc969('0xf')](_0xc969('0x29'),_0x4fb7a5['uniqueid'],_0x4fb7a5[_0xc969('0x8')],_0x4fb7a5[_0xc969('0x2a')],_0x4fb7a5[_0xc969('0x2b')]));dials[_0x4fb7a5[_0xc969('0x5')]]=_[_0xc969('0x1e')](dials[_0x4fb7a5[_0xc969('0x5')]],{'endtime':utils['now'](),'lastevent':_0xc969('0x2c')});dials[_0x4fb7a5[_0xc969('0x5')]][_0xc969('0x2d')]=utils[_0xc969('0x2e')](dials[_0x4fb7a5['uniqueid']][_0xc969('0x2f')],dials[_0x4fb7a5[_0xc969('0x5')]][_0xc969('0x1f')]);dials[_0x4fb7a5[_0xc969('0x5')]]['holdtime']=utils[_0xc969('0x2e')](dials[_0x4fb7a5['uniqueid']][_0xc969('0x26')]||dials[_0x4fb7a5[_0xc969('0x5')]][_0xc969('0x2f')],dials[_0x4fb7a5['uniqueid']][_0xc969('0x1f')]);dials[_0x4fb7a5['uniqueid']][_0xc969('0x30')]=dials[_0x4fb7a5['uniqueid']][_0xc969('0x26')]?utils[_0xc969('0x2e')](dials[_0x4fb7a5[_0xc969('0x5')]][_0xc969('0x2f')],dials[_0x4fb7a5[_0xc969('0x5')]]['answertime']):0x0;writeDB(dials[_0x4fb7a5['uniqueid']]);}}catch(_0x59b9a4){utils['error'](util[_0xc969('0xf')](_0xc969('0x31'),_0x4fb7a5['uniqueid']),_0x59b9a4);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 67f46b9..faca7f8 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 _0x41ef=['connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41ef,0x197));var _0xf41e=function(_0x52fde9,_0x5f4440){_0x52fde9=_0x52fde9-0x0;var _0x1a8bc5=_0x41ef[_0x52fde9];return _0x1a8bc5;};var AsteriskManager=require(_0xf41e('0x0'));var config=require('../../config/environment');var utils=require(_0xf41e('0x1'));var util=require(_0xf41e('0x2'));var isXDREnabled=config['xdr']&&config[_0xf41e('0x3')][_0xf41e('0x4')]?!config[_0xf41e('0x3')]['disabled']:!![];var isProduction=config[_0xf41e('0x5')]===_0xf41e('0x6')||![];var isLocalAsterisk=config[_0xf41e('0x3')]&&config[_0xf41e('0x3')][_0xf41e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xf41e('0x8')][_0xf41e('0x9')],config[_0xf41e('0x8')]['ip'],config[_0xf41e('0x8')][_0xf41e('0xa')],config[_0xf41e('0x8')][_0xf41e('0xb')],!![]);ami[_0xf41e('0xc')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xf41e('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xf41e('0xe'));var members=require(_0xf41e('0xf'));var dials=require(_0xf41e('0x10'));var transfers=require(_0xf41e('0x11'));var core=require(_0xf41e('0x12'));ami['on'](_0xf41e('0x13'),core[_0xf41e('0x13')]);ami['on'](_0xf41e('0x14'),core['shutdown']);ami['on'](_0xf41e('0x15'),core[_0xf41e('0x15')]);ami['on'](_0xf41e('0x16'),core[_0xf41e('0x16')]);ami['on']('close',core[_0xf41e('0x17')]);ami['on'](_0xf41e('0x18'),core[_0xf41e('0x18')]);ami['on'](_0xf41e('0x19'),function(_0x4799b9){try{utils['debug'](util[_0xf41e('0x1a')](_0xf41e('0x1b'),_0x4799b9[_0xf41e('0x1c')]),_0x4799b9);members[_0xf41e('0x19')](_0x4799b9);}catch(_0xf38eee){utils['error'](util['format'](_0xf41e('0x1b'),_0x4799b9[_0xf41e('0x1c')]),_0xf38eee);}});ami['on'](_0xf41e('0x1d'),function(_0x19aedc){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x1f'),_0x19aedc[_0xf41e('0x20')]),_0x19aedc);agents[_0xf41e('0x1d')](_0x19aedc);}catch(_0x1b8e40){utils['error'](util[_0xf41e('0x1a')]('[%s][index][agentcalled]',_0x19aedc[_0xf41e('0x20')]),_0x1b8e40);}});ami['on'](_0xf41e('0x21'),function(_0x5b4141){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x22'),_0x5b4141[_0xf41e('0x20')]),_0x5b4141);agents[_0xf41e('0x21')](_0x5b4141);}catch(_0x4be0f5){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x22'),_0x5b4141[_0xf41e('0x20')]),_0x4be0f5);}});ami['on'](_0xf41e('0x23'),function(_0x160fef){try{utils['debug'](util[_0xf41e('0x1a')](_0xf41e('0x24'),_0x160fef['uniqueid']),_0x160fef);agents['agentconnect'](_0x160fef);queues[_0xf41e('0x23')](_0x160fef);}catch(_0x21ad02){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x24'),_0x160fef[_0xf41e('0x20')]),_0x21ad02);}});ami['on'](_0xf41e('0x25'),function(_0x1b5d57){try{utils['debug'](util['format'](_0xf41e('0x26'),_0x1b5d57['uniqueid']),_0x1b5d57);agents['agentcomplete'](_0x1b5d57);queues[_0xf41e('0x25')](_0x1b5d57);members[_0xf41e('0x25')](_0x1b5d57);}catch(_0x2549d4){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x26'),_0x1b5d57['uniqueid']),_0x2549d4);}});ami['on'](_0xf41e('0x27'),function(_0x2801ae){try{utils[_0xf41e('0x1e')](util['format'](_0xf41e('0x28'),_0x2801ae[_0xf41e('0x20')]),_0x2801ae);agents[_0xf41e('0x27')](_0x2801ae);queues['queuecallerabandon'](_0x2801ae);}catch(_0x31bc48){utils[_0xf41e('0x16')](util['format'](_0xf41e('0x28'),_0x2801ae['uniqueid']),_0x31bc48);}});ami['on'](_0xf41e('0x29'),function(_0x3a5076){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x2a'),_0x3a5076[_0xf41e('0x20')]),_0x3a5076);queues[_0xf41e('0x29')](_0x3a5076);recordings[_0xf41e('0x29')](_0x3a5076);}catch(_0x5b6128){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x2a'),_0x3a5076[_0xf41e('0x20')]),_0x5b6128);}});ami['on'](_0xf41e('0x2b'),function(_0x4a1f86){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x2c'),_0x4a1f86[_0xf41e('0x20')]),_0x4a1f86);queues[_0xf41e('0x2b')](_0x4a1f86);}catch(_0x2ac215){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x2c'),_0x4a1f86[_0xf41e('0x20')]),_0x2ac215);}});ami['on'](_0xf41e('0x2d'),function(_0x336573){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x2e'),_0x336573[_0xf41e('0x20')]),_0x336573);queues[_0xf41e('0x2d')](_0x336573);calls[_0xf41e('0x2d')](_0x336573);}catch(_0x1847e0){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')]('[%s][index][musiconholdstart]',_0x336573[_0xf41e('0x20')]),_0x1847e0);}});ami['on'](_0xf41e('0x2f'),function(_0x27d3e5){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x30'),_0x27d3e5[_0xf41e('0x20')]),_0x27d3e5);queues[_0xf41e('0x2f')](_0x27d3e5);calls[_0xf41e('0x2f')](_0x27d3e5);}catch(_0x3c3fde){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')]('[%s][index][musiconholdstop]',_0x27d3e5[_0xf41e('0x20')]),_0x3c3fde);}});ami['on']('newstate',function(_0x819b32){try{utils['debug'](util[_0xf41e('0x1a')]('[%s][index][newstate]',_0x819b32[_0xf41e('0x20')]),_0x819b32);calls[_0xf41e('0x31')](_0x819b32);recordings[_0xf41e('0x31')](_0x819b32);}catch(_0x4d9f06){utils[_0xf41e('0x16')](util['format'](_0xf41e('0x32'),_0x819b32[_0xf41e('0x20')]),_0x4d9f06);}});ami['on'](_0xf41e('0x33'),function(_0x2b0063){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x34'),_0x2b0063[_0xf41e('0x20')]),_0x2b0063);calls[_0xf41e('0x33')](_0x2b0063);recordings[_0xf41e('0x33')](_0x2b0063);dials[_0xf41e('0x33')](_0x2b0063);agents['hangup'](_0x2b0063);queues['hangup'](_0x2b0063);}catch(_0x54ebe5){utils[_0xf41e('0x16')](util['format'](_0xf41e('0x34'),_0x2b0063['uniqueid']),_0x54ebe5);}});ami['on'](_0xf41e('0x35'),function(_0x58e838){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x36'),_0x58e838[_0xf41e('0x20')]),_0x58e838);members[_0xf41e('0x35')](_0x58e838);}catch(_0x218979){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x36'),_0x58e838[_0xf41e('0x20')]),_0x218979);}});ami['on'](_0xf41e('0x37'),function(_0x47bc52){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x38'),_0x47bc52[_0xf41e('0x20')]),_0x47bc52);queues[_0xf41e('0x37')](_0x47bc52);agents[_0xf41e('0x37')](_0x47bc52);transfers[_0xf41e('0x37')](_0x47bc52);}catch(_0x22dac0){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x38'),_0x47bc52[_0xf41e('0x20')]),_0x22dac0);}});ami['on'](_0xf41e('0x39'),function(_0x2556e5){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x3a'),_0x2556e5[_0xf41e('0x3b')]),_0x2556e5);queues[_0xf41e('0x39')](_0x2556e5);transfers[_0xf41e('0x39')](_0x2556e5);agents['attendedtransfer'](_0x2556e5);calls[_0xf41e('0x39')](_0x2556e5);}catch(_0x3d1935){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')](_0xf41e('0x3a'),_0x2556e5[_0xf41e('0x3b')]),_0x3d1935);}});ami['on']('varset',function(_0x3adf6a){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x3c'),_0x3adf6a[_0xf41e('0x20')]),_0x3adf6a);queues[_0xf41e('0x3d')](_0x3adf6a);recordings[_0xf41e('0x3d')](_0x3adf6a);calls[_0xf41e('0x3d')](_0x3adf6a);dials['varset'](_0x3adf6a);}catch(_0x226b67){utils[_0xf41e('0x16')](util['format'](_0xf41e('0x3c'),_0x3adf6a[_0xf41e('0x20')]),_0x226b67);}});ami['on'](_0xf41e('0x3e'),function(_0x49d722){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x3f'),_0x49d722[_0xf41e('0x20')]),_0x49d722);calls[_0xf41e('0x3e')](_0x49d722);recordings[_0xf41e('0x3e')](_0x49d722);dials[_0xf41e('0x3e')](_0x49d722);}catch(_0x23f3a8){utils['error'](util[_0xf41e('0x1a')](_0xf41e('0x3f'),_0x49d722[_0xf41e('0x20')]),_0x23f3a8);}});ami['on']('newchannel',function(_0x82bb03){try{utils['debug'](util[_0xf41e('0x1a')](_0xf41e('0x40'),_0x82bb03['uniqueid']),_0x82bb03);calls['newchannel'](_0x82bb03);recordings[_0xf41e('0x41')](_0x82bb03);}catch(_0x4a13aa){utils[_0xf41e('0x16')](util[_0xf41e('0x1a')]('[%s][index][newchannel]',_0x82bb03[_0xf41e('0x20')]),_0x4a13aa);}});ami['on'](_0xf41e('0x42'),function(_0x17b56){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')](_0xf41e('0x43'),_0x17b56[_0xf41e('0x20')]),_0x17b56);dials[_0xf41e('0x42')](_0x17b56);}catch(_0x263e8b){utils['error'](util[_0xf41e('0x1a')](_0xf41e('0x44'),_0x17b56[_0xf41e('0x20')]),_0x263e8b);}});ami['on'](_0xf41e('0x45'),function(_0x1c5153){try{utils[_0xf41e('0x1e')](util[_0xf41e('0x1a')]('[%s][index][dialend]',_0x1c5153['uniqueid']),_0x1c5153);dials[_0xf41e('0x45')](_0x1c5153);}catch(_0x246626){utils['error'](util['format'](_0xf41e('0x46'),_0x1c5153[_0xf41e('0x20')]),_0x246626);}});} \ No newline at end of file +var _0x3835=['[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','disabled','env','production','xdr','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','format','agentringnoanswer'];(function(_0x5aff3b,_0x39d5cb){var _0x1046b3=function(_0x3a1938){while(--_0x3a1938){_0x5aff3b['push'](_0x5aff3b['shift']());}};_0x1046b3(++_0x39d5cb);}(_0x3835,0x187));var _0x5383=function(_0x5dfde8,_0xa2f77d){_0x5dfde8=_0x5dfde8-0x0;var _0x2253fb=_0x3835[_0x5dfde8];return _0x2253fb;};var AsteriskManager=require(_0x5383('0x0'));var config=require('../../config/environment');var utils=require(_0x5383('0x1'));var util=require(_0x5383('0x2'));var isXDREnabled=config['xdr']&&config['xdr'][_0x5383('0x3')]?!config['xdr'][_0x5383('0x3')]:!![];var isProduction=config[_0x5383('0x4')]===_0x5383('0x5')||![];var isLocalAsterisk=config[_0x5383('0x6')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x5383('0x7')][_0x5383('0x8')],config['asterisk']['ip'],config[_0x5383('0x7')][_0x5383('0x9')],config[_0x5383('0x7')][_0x5383('0xa')],!![]);ami[_0x5383('0xb')]();if(!isXDREnabled){utils[_0x5383('0xc')](_0x5383('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x5383('0xc')](_0x5383('0xe'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x5383('0xf'));var members=require(_0x5383('0x10'));var dials=require(_0x5383('0x11'));var transfers=require(_0x5383('0x12'));var core=require(_0x5383('0x13'));ami['on'](_0x5383('0x14'),core['connect']);ami['on']('shutdown',core[_0x5383('0x15')]);ami['on'](_0x5383('0x16'),core[_0x5383('0x16')]);ami['on'](_0x5383('0x17'),core[_0x5383('0x17')]);ami['on'](_0x5383('0x18'),core[_0x5383('0x18')]);ami['on'](_0x5383('0x19'),core[_0x5383('0x19')]);ami['on'](_0x5383('0x1a'),function(_0x38186e){try{utils['debug'](util['format'](_0x5383('0x1b'),_0x38186e[_0x5383('0x1c')]),_0x38186e);members[_0x5383('0x1a')](_0x38186e);}catch(_0x2d74ab){utils[_0x5383('0x17')](util['format'](_0x5383('0x1b'),_0x38186e[_0x5383('0x1c')]),_0x2d74ab);}});ami['on'](_0x5383('0x1d'),function(_0x499723){try{utils[_0x5383('0x1e')](util['format'](_0x5383('0x1f'),_0x499723[_0x5383('0x20')]),_0x499723);agents[_0x5383('0x1d')](_0x499723);}catch(_0x1affa1){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x1f'),_0x499723['uniqueid']),_0x1affa1);}});ami['on'](_0x5383('0x22'),function(_0x4ab13c){try{utils[_0x5383('0x1e')](util['format'](_0x5383('0x23'),_0x4ab13c[_0x5383('0x20')]),_0x4ab13c);agents['agentringnoanswer'](_0x4ab13c);}catch(_0x19f1ff){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x23'),_0x4ab13c['uniqueid']),_0x19f1ff);}});ami['on'](_0x5383('0x24'),function(_0x520614){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x25'),_0x520614['uniqueid']),_0x520614);agents[_0x5383('0x24')](_0x520614);queues[_0x5383('0x24')](_0x520614);}catch(_0x1631b9){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x25'),_0x520614[_0x5383('0x20')]),_0x1631b9);}});ami['on']('agentcomplete',function(_0xb53595){try{utils['debug'](util[_0x5383('0x21')](_0x5383('0x26'),_0xb53595['uniqueid']),_0xb53595);agents['agentcomplete'](_0xb53595);queues['agentcomplete'](_0xb53595);members[_0x5383('0x27')](_0xb53595);}catch(_0x11eb6e){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x26'),_0xb53595[_0x5383('0x20')]),_0x11eb6e);}});ami['on'](_0x5383('0x28'),function(_0x1f351b){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')]('[%s][index][queuecallerabandon]',_0x1f351b[_0x5383('0x20')]),_0x1f351b);agents[_0x5383('0x28')](_0x1f351b);queues['queuecallerabandon'](_0x1f351b);}catch(_0x5cc8ff){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x29'),_0x1f351b[_0x5383('0x20')]),_0x5cc8ff);}});ami['on'](_0x5383('0x2a'),function(_0x17186d){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x2b'),_0x17186d[_0x5383('0x20')]),_0x17186d);queues[_0x5383('0x2a')](_0x17186d);recordings[_0x5383('0x2a')](_0x17186d);}catch(_0x586a16){utils['error'](util[_0x5383('0x21')](_0x5383('0x2b'),_0x17186d[_0x5383('0x20')]),_0x586a16);}});ami['on'](_0x5383('0x2c'),function(_0xc1bd8e){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')]('[%s][index][queuecallerleave]',_0xc1bd8e[_0x5383('0x20')]),_0xc1bd8e);queues[_0x5383('0x2c')](_0xc1bd8e);}catch(_0x3de64a){utils['error'](util[_0x5383('0x21')](_0x5383('0x2d'),_0xc1bd8e[_0x5383('0x20')]),_0x3de64a);}});ami['on']('musiconholdstart',function(_0x3fabac){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x2e'),_0x3fabac[_0x5383('0x20')]),_0x3fabac);queues[_0x5383('0x2f')](_0x3fabac);calls['musiconholdstart'](_0x3fabac);}catch(_0x257267){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x3fabac['uniqueid']),_0x257267);}});ami['on']('musiconholdstop',function(_0x5ed66c){try{utils[_0x5383('0x1e')](util['format'](_0x5383('0x30'),_0x5ed66c[_0x5383('0x20')]),_0x5ed66c);queues['musiconholdstop'](_0x5ed66c);calls['musiconholdstop'](_0x5ed66c);}catch(_0x1065f3){utils['error'](util[_0x5383('0x21')](_0x5383('0x30'),_0x5ed66c[_0x5383('0x20')]),_0x1065f3);}});ami['on']('newstate',function(_0x1e47ab){try{utils[_0x5383('0x1e')](util['format']('[%s][index][newstate]',_0x1e47ab[_0x5383('0x20')]),_0x1e47ab);calls['newstate'](_0x1e47ab);recordings[_0x5383('0x31')](_0x1e47ab);}catch(_0x39a2d2){utils['error'](util[_0x5383('0x21')](_0x5383('0x32'),_0x1e47ab['uniqueid']),_0x39a2d2);}});ami['on'](_0x5383('0x33'),function(_0x4eddcf){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x34'),_0x4eddcf[_0x5383('0x20')]),_0x4eddcf);calls[_0x5383('0x33')](_0x4eddcf);recordings[_0x5383('0x33')](_0x4eddcf);dials['hangup'](_0x4eddcf);agents[_0x5383('0x33')](_0x4eddcf);queues[_0x5383('0x33')](_0x4eddcf);}catch(_0x5f0d87){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x34'),_0x4eddcf[_0x5383('0x20')]),_0x5f0d87);}});ami['on']('cdr',function(_0x355257){try{utils['debug'](util[_0x5383('0x21')](_0x5383('0x35'),_0x355257[_0x5383('0x20')]),_0x355257);members[_0x5383('0x36')](_0x355257);}catch(_0x8c8380){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x35'),_0x355257[_0x5383('0x20')]),_0x8c8380);}});ami['on'](_0x5383('0x37'),function(_0x3642bc){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x38'),_0x3642bc[_0x5383('0x20')]),_0x3642bc);queues[_0x5383('0x37')](_0x3642bc);agents[_0x5383('0x37')](_0x3642bc);transfers[_0x5383('0x37')](_0x3642bc);}catch(_0x534b66){utils['error'](util[_0x5383('0x21')](_0x5383('0x38'),_0x3642bc[_0x5383('0x20')]),_0x534b66);}});ami['on'](_0x5383('0x39'),function(_0x4d9140){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x3a'),_0x4d9140[_0x5383('0x3b')]),_0x4d9140);queues[_0x5383('0x39')](_0x4d9140);transfers[_0x5383('0x39')](_0x4d9140);agents[_0x5383('0x39')](_0x4d9140);calls['attendedtransfer'](_0x4d9140);}catch(_0x3238b6){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x3a'),_0x4d9140[_0x5383('0x3b')]),_0x3238b6);}});ami['on']('varset',function(_0x52282d){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')]('[%s][index][varset]',_0x52282d[_0x5383('0x20')]),_0x52282d);queues[_0x5383('0x3c')](_0x52282d);recordings['varset'](_0x52282d);calls[_0x5383('0x3c')](_0x52282d);dials['varset'](_0x52282d);}catch(_0x182545){utils[_0x5383('0x17')](util[_0x5383('0x21')](_0x5383('0x3d'),_0x52282d['uniqueid']),_0x182545);}});ami['on'](_0x5383('0x3e'),function(_0x28297a){try{utils[_0x5383('0x1e')](util['format'](_0x5383('0x3f'),_0x28297a[_0x5383('0x20')]),_0x28297a);calls[_0x5383('0x3e')](_0x28297a);recordings[_0x5383('0x3e')](_0x28297a);dials[_0x5383('0x3e')](_0x28297a);}catch(_0x205d88){utils['error'](util[_0x5383('0x21')](_0x5383('0x3f'),_0x28297a[_0x5383('0x20')]),_0x205d88);}});ami['on'](_0x5383('0x40'),function(_0x3b698a){try{utils['debug'](util[_0x5383('0x21')](_0x5383('0x41'),_0x3b698a[_0x5383('0x20')]),_0x3b698a);calls[_0x5383('0x40')](_0x3b698a);recordings[_0x5383('0x40')](_0x3b698a);}catch(_0x57afe3){utils[_0x5383('0x17')](util['format'](_0x5383('0x41'),_0x3b698a[_0x5383('0x20')]),_0x57afe3);}});ami['on'](_0x5383('0x42'),function(_0x2b0be4){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x43'),_0x2b0be4['uniqueid']),_0x2b0be4);dials['dialbegin'](_0x2b0be4);}catch(_0x394a60){utils[_0x5383('0x17')](util['format'](_0x5383('0x44'),_0x2b0be4['uniqueid']),_0x394a60);}});ami['on'](_0x5383('0x45'),function(_0x1924b2){try{utils[_0x5383('0x1e')](util[_0x5383('0x21')](_0x5383('0x46'),_0x1924b2[_0x5383('0x20')]),_0x1924b2);dials[_0x5383('0x45')](_0x1924b2);}catch(_0x255010){utils['error'](util[_0x5383('0x21')](_0x5383('0x46'),_0x1924b2[_0x5383('0x20')]),_0x255010);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 237e3f0..ace14a7 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 _0x124a=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','error','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','isNil','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','request','getUserByName','split','catch','[%s][members][writeDB]','uniqueid','some','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','agent','NOT_INUSE','now','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','debug'];(function(_0x235e0c,_0x1cd552){var _0x1fc94a=function(_0x6d65f9){while(--_0x6d65f9){_0x235e0c['push'](_0x235e0c['shift']());}};_0x1fc94a(++_0x1cd552);}(_0x124a,0x1a6));var _0xa124=function(_0x5018bd,_0x24b200){_0x5018bd=_0x5018bd-0x0;var _0x5cb7c7=_0x124a[_0x5018bd];return _0x5cb7c7;};'use strict';var _=require(_0xa124('0x0'));var util=require(_0xa124('0x1'));var utils=require(_0xa124('0x2'));var members={};var exclude=[_0xa124('0x3'),'Queue:'];function writeDB(_0x148cce){utils[_0xa124('0x4')](util[_0xa124('0x5')](_0xa124('0x6'),_0x148cce['uniqueid'],_0x148cce[_0xa124('0x7')],_0x148cce[_0xa124('0x8')],_0x148cce[_0xa124('0x9')],_0x148cce['membername'],_0x148cce[_0xa124('0xa')]));if(_0x148cce[_0xa124('0x7')]){utils[_0xa124('0xb')](_0x148cce[_0xa124('0x7')])[_0xa124('0xc')](function(_0x3762f6){if(_0x3762f6){_0x148cce[_0xa124('0xd')]=_0x3762f6[_0xa124('0xe')];_0x148cce[_0xa124('0xf')]=_0x3762f6['internal'];utils[_0xa124('0x10')]('CreateMemberReport',_0x148cce);}else{utils[_0xa124('0x11')](_0x148cce[_0xa124('0x7')][_0xa124('0x12')]('/')[0x1])[_0xa124('0xc')](function(_0x2d98cc){if(_0x2d98cc){_0x148cce[_0xa124('0xd')]=_0x2d98cc[_0xa124('0xe')];_0x148cce[_0xa124('0xf')]=_0x2d98cc['internal'];utils['request']('CreateMemberReport',_0x148cce);}});}})[_0xa124('0x13')](function(_0xd4238c){utils['error'](util[_0xa124('0x5')](_0xa124('0x14'),_0x148cce[_0xa124('0x15')]),_0xd4238c);});}delete members[_0x148cce[_0xa124('0x7')]];}function startsWith(_0x56c3c5,_0x1dc617){return _[_0xa124('0x16')](_0x56c3c5,function(_0x5c40ab){return _['startsWith'](_0x1dc617,_0x5c40ab);});}exports['devicestatechange']=function(_0x17e0fe){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x17e0fe[_0xa124('0x17')]]?members[_0x17e0fe[_0xa124('0x17')]][_0xa124('0x15')]:_0x17e0fe[_0xa124('0x17')]),_0x17e0fe);utils[_0xa124('0x4')](util[_0xa124('0x5')](_0xa124('0x18'),members[_0x17e0fe['device']]?members[_0x17e0fe[_0xa124('0x17')]][_0xa124('0x15')]:_0x17e0fe[_0xa124('0x17')],_0x17e0fe[_0xa124('0x19')],_0x17e0fe[_0xa124('0x17')]));switch(_0x17e0fe['state']){case'INUSE':case _0xa124('0x1a'):if(!startsWith(exclude,_0x17e0fe['device'])){members[_0x17e0fe['device']]={'channel':_0xa124('0x1b'),'interface':_0x17e0fe[_0xa124('0x17')],'type':'TALKING','enterAt':utils['now'](),'role':_0xa124('0x1c')};}break;case _0xa124('0x1d'):if(!_['isNil'](members[_0x17e0fe[_0xa124('0x17')]])){members[_0x17e0fe['device']]['exitAt']=utils[_0xa124('0x1e')]();members[_0x17e0fe[_0xa124('0x17')]]['duration']=utils[_0xa124('0x1f')](members[_0x17e0fe[_0xa124('0x17')]][_0xa124('0x20')],members[_0x17e0fe[_0xa124('0x17')]][_0xa124('0x21')]);if(members[_0x17e0fe[_0xa124('0x17')]]['uniqueid']){writeDB(members[_0x17e0fe[_0xa124('0x17')]]);}}break;default:break;}}catch(_0x48f203){utils['error'](util['format'](_0xa124('0x22'),members[_0x17e0fe[_0xa124('0x17')]]?members[_0x17e0fe[_0xa124('0x17')]][_0xa124('0x15')]:_0x17e0fe[_0xa124('0x17')]),_0x48f203);}};exports[_0xa124('0x23')]=function(_0x4b15ba){try{if(!_['isNil'](members[_0x4b15ba[_0xa124('0x7')]])){utils[_0xa124('0x24')](util[_0xa124('0x5')]('[%s][members][agentcomplete]',_0x4b15ba[_0xa124('0x15')]),_0x4b15ba);utils[_0xa124('0x4')](util['format'](_0xa124('0x25'),_0x4b15ba[_0xa124('0x15')],_0x4b15ba[_0xa124('0x7')],_0x4b15ba[_0xa124('0x26')]));members[_0x4b15ba[_0xa124('0x7')]]=_[_0xa124('0x27')](members[_0x4b15ba[_0xa124('0x7')]],{'data4':_0x4b15ba[_0xa124('0x26')],'uniqueid':_0x4b15ba[_0xa124('0x15')]});}}catch(_0x4fd4d3){utils[_0xa124('0x28')](util['format'](_0xa124('0x29'),_0x4b15ba[_0xa124('0x15')]),_0x4fd4d3);}};exports[_0xa124('0x2a')]=function(_0x3c35d4){try{utils[_0xa124('0x24')](util[_0xa124('0x5')](_0xa124('0x2b'),_0x3c35d4[_0xa124('0x15')]),_0x3c35d4);if(_0x3c35d4[_0xa124('0x8')]){var _0xb437d1=_0x3c35d4[_0xa124('0x8')]['split']('-')[0x0];if(!_[_0xa124('0x2c')](members[_0xb437d1])){members[_0xb437d1]=_[_0xa124('0x27')](members[_0xb437d1],{'data1':members[_0xb437d1]['data1']||_0x3c35d4['type'],'data2':members[_0xb437d1]['data2']||_0x3c35d4[_0xa124('0x2d')],'data3':members[_0xb437d1]['data3']||_0x3c35d4[_0xa124('0x2e')],'uniqueid':members[_0xb437d1][_0xa124('0x15')]||_0x3c35d4[_0xa124('0x15')]});utils[_0xa124('0x4')](util[_0xa124('0x5')](_0xa124('0x2f'),_0x3c35d4[_0xa124('0x15')],members[_0xb437d1]['data1'],members[_0xb437d1][_0xa124('0x9')],members[_0xb437d1][_0xa124('0x30')]));if(members[_0xb437d1]['exitAt']){writeDB(members[_0xb437d1]);}}}if(_0x3c35d4[_0xa124('0x31')]){var _0x982472=_0x3c35d4[_0xa124('0x31')][_0xa124('0x12')]('-')[0x0];if(!_['isNil'](members[_0x982472])){members[_0x982472]=_[_0xa124('0x27')](members[_0x982472],{'data1':members[_0x982472][_0xa124('0x32')]||_0x3c35d4['type'],'data2':members[_0x982472][_0xa124('0x9')]||_0x3c35d4[_0xa124('0x2d')],'data3':members[_0x982472][_0xa124('0x30')]||_0x3c35d4[_0xa124('0x2e')],'uniqueid':members[_0x982472][_0xa124('0x15')]||_0x3c35d4['uniqueid']});utils[_0xa124('0x4')](util[_0xa124('0x5')](_0xa124('0x2f'),_0x3c35d4['uniqueid'],members[_0x982472][_0xa124('0x32')],members[_0x982472]['data2'],members[_0x982472]['data3']));if(members[_0x982472][_0xa124('0x20')]){writeDB(members[_0x982472]);}}}}catch(_0x2de170){utils[_0xa124('0x28')](util[_0xa124('0x5')](_0xa124('0x2b'),_0x3c35d4[_0xa124('0x15')]),_0x2de170);}}; \ No newline at end of file +var _0x3eec=['queue','assign','cdr','[%s][members][cdr]','channel','split','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s'];(function(_0x490210,_0x4ab8bf){var _0xe463d5=function(_0xa0b79a){while(--_0xa0b79a){_0x490210['push'](_0x490210['shift']());}};_0xe463d5(++_0x4ab8bf);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x3b4ee6,_0x111912){_0x3b4ee6=_0x3b4ee6-0x0;var _0x1c5ed9=_0x3eec[_0x3b4ee6];return _0x1c5ed9;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var utils=require(_0xc3ee('0x2'));var members={};var exclude=[_0xc3ee('0x3'),'Queue:'];function writeDB(_0x223d08){utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x6'),_0x223d08[_0xc3ee('0x7')],_0x223d08[_0xc3ee('0x8')],_0x223d08['channel'],_0x223d08[_0xc3ee('0x9')],_0x223d08[_0xc3ee('0xa')],_0x223d08[_0xc3ee('0xb')]));if(_0x223d08[_0xc3ee('0x8')]){utils[_0xc3ee('0xc')](_0x223d08[_0xc3ee('0x8')])[_0xc3ee('0xd')](function(_0x2c9701){if(_0x2c9701){_0x223d08[_0xc3ee('0xa')]=_0x2c9701[_0xc3ee('0xe')];_0x223d08['internal']=_0x2c9701['internal'];utils[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x223d08);}else{utils[_0xc3ee('0x11')](_0x223d08[_0xc3ee('0x8')]['split']('/')[0x1])[_0xc3ee('0xd')](function(_0x4b1bff){if(_0x4b1bff){_0x223d08[_0xc3ee('0xa')]=_0x4b1bff[_0xc3ee('0xe')];_0x223d08['internal']=_0x4b1bff['internal'];utils[_0xc3ee('0xf')]('CreateMemberReport',_0x223d08);}});}})[_0xc3ee('0x12')](function(_0x535d1a){utils[_0xc3ee('0x13')](util['format'](_0xc3ee('0x14'),_0x223d08[_0xc3ee('0x7')]),_0x535d1a);});}delete members[_0x223d08[_0xc3ee('0x8')]];}function startsWith(_0x664bad,_0x476f8f){return _[_0xc3ee('0x15')](_0x664bad,function(_0x277e11){return _['startsWith'](_0x476f8f,_0x277e11);});}exports[_0xc3ee('0x16')]=function(_0x4eea89){try{utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x18'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')]),_0x4eea89);utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x1a'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')],_0x4eea89[_0xc3ee('0x1b')],_0x4eea89[_0xc3ee('0x19')]));switch(_0x4eea89[_0xc3ee('0x1b')]){case _0xc3ee('0x1c'):case _0xc3ee('0x1d'):if(!startsWith(exclude,_0x4eea89[_0xc3ee('0x19')])){members[_0x4eea89[_0xc3ee('0x19')]]={'channel':'voice','interface':_0x4eea89['device'],'type':_0xc3ee('0x1e'),'enterAt':utils[_0xc3ee('0x1f')](),'role':_0xc3ee('0x20')};}break;case _0xc3ee('0x21'):if(!_[_0xc3ee('0x22')](members[_0x4eea89[_0xc3ee('0x19')]])){members[_0x4eea89['device']][_0xc3ee('0x23')]=utils[_0xc3ee('0x1f')]();members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x24')]=utils[_0xc3ee('0x25')](members[_0x4eea89['device']]['exitAt'],members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x26')]);if(members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]){writeDB(members[_0x4eea89[_0xc3ee('0x19')]]);}}break;default:break;}}catch(_0x4ecfec){utils['error'](util['format'](_0xc3ee('0x18'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')]),_0x4ecfec);}};exports['agentcomplete']=function(_0x13f30d){try{if(!_[_0xc3ee('0x22')](members[_0x13f30d[_0xc3ee('0x8')]])){utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x27'),_0x13f30d[_0xc3ee('0x7')]),_0x13f30d);utils['info'](util[_0xc3ee('0x5')](_0xc3ee('0x28'),_0x13f30d[_0xc3ee('0x7')],_0x13f30d['interface'],_0x13f30d[_0xc3ee('0x29')]));members[_0x13f30d[_0xc3ee('0x8')]]=_[_0xc3ee('0x2a')](members[_0x13f30d[_0xc3ee('0x8')]],{'data4':_0x13f30d[_0xc3ee('0x29')],'uniqueid':_0x13f30d[_0xc3ee('0x7')]});}}catch(_0x16677d){utils['error'](util[_0xc3ee('0x5')]('[%s][members][agentcomplete]',_0x13f30d[_0xc3ee('0x7')]),_0x16677d);}};exports[_0xc3ee('0x2b')]=function(_0x13d6e5){try{utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x2c'),_0x13d6e5['uniqueid']),_0x13d6e5);if(_0x13d6e5[_0xc3ee('0x2d')]){var _0x3f2e5a=_0x13d6e5[_0xc3ee('0x2d')][_0xc3ee('0x2e')]('-')[0x0];if(!_[_0xc3ee('0x22')](members[_0x3f2e5a])){members[_0x3f2e5a]=_[_0xc3ee('0x2a')](members[_0x3f2e5a],{'data1':members[_0x3f2e5a][_0xc3ee('0x2f')]||_0x13d6e5[_0xc3ee('0xb')],'data2':members[_0x3f2e5a][_0xc3ee('0x9')]||_0x13d6e5[_0xc3ee('0x30')],'data3':members[_0x3f2e5a][_0xc3ee('0x31')]||_0x13d6e5[_0xc3ee('0x32')],'uniqueid':members[_0x3f2e5a][_0xc3ee('0x7')]||_0x13d6e5[_0xc3ee('0x7')]});utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x33'),_0x13d6e5[_0xc3ee('0x7')],members[_0x3f2e5a][_0xc3ee('0x2f')],members[_0x3f2e5a][_0xc3ee('0x9')],members[_0x3f2e5a][_0xc3ee('0x31')]));if(members[_0x3f2e5a]['exitAt']){writeDB(members[_0x3f2e5a]);}}}if(_0x13d6e5[_0xc3ee('0x34')]){var _0x548df8=_0x13d6e5[_0xc3ee('0x34')][_0xc3ee('0x2e')]('-')[0x0];if(!_[_0xc3ee('0x22')](members[_0x548df8])){members[_0x548df8]=_[_0xc3ee('0x2a')](members[_0x548df8],{'data1':members[_0x548df8][_0xc3ee('0x2f')]||_0x13d6e5[_0xc3ee('0xb')],'data2':members[_0x548df8]['data2']||_0x13d6e5[_0xc3ee('0x30')],'data3':members[_0x548df8][_0xc3ee('0x31')]||_0x13d6e5[_0xc3ee('0x32')],'uniqueid':members[_0x548df8]['uniqueid']||_0x13d6e5[_0xc3ee('0x7')]});utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x33'),_0x13d6e5[_0xc3ee('0x7')],members[_0x548df8][_0xc3ee('0x2f')],members[_0x548df8][_0xc3ee('0x9')],members[_0x548df8][_0xc3ee('0x31')]));if(members[_0x548df8][_0xc3ee('0x23')]){writeDB(members[_0x548df8]);}}}}catch(_0x23d365){utils[_0xc3ee('0x13')](util['format'](_0xc3ee('0x2c'),_0x13d6e5[_0xc3ee('0x7')]),_0x23d365);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 003e81f..ada24c3 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 _0x0e9a=['[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','now','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid'];(function(_0x2ea183,_0x3cff11){var _0x47c16c=function(_0x3d91e5){while(--_0x3d91e5){_0x2ea183['push'](_0x2ea183['shift']());}};_0x47c16c(++_0x3cff11);}(_0x0e9a,0x89));var _0xa0e9=function(_0x36575f,_0x187a29){_0x36575f=_0x36575f-0x0;var _0x1221d6=_0x0e9a[_0x36575f];return _0x1221d6;};'use strict';var _=require('lodash');var util=require(_0xa0e9('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x5d0f90){utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5d0f90['uniqueid'],_0x5d0f90[_0xa0e9('0x3')],_0x5d0f90[_0xa0e9('0x4')],_0x5d0f90['lastAssignedTo'],_0x5d0f90[_0xa0e9('0x5')],_0x5d0f90[_0xa0e9('0x6')],_0x5d0f90[_0xa0e9('0x7')]));if(_0x5d0f90['queue']){utils[_0xa0e9('0x8')](_0x5d0f90[_0xa0e9('0x4')])['then'](function(_0x842aa0){if(_0x842aa0){_0x5d0f90[_0xa0e9('0x9')]=_0x842aa0['type'];}utils[_0xa0e9('0xa')](_0xa0e9('0xb'),_0x5d0f90);});}else{utils[_0xa0e9('0xa')](_0xa0e9('0xb'),_0x5d0f90);}if(_0x5d0f90[_0xa0e9('0xc')]){delete queues[_0x5d0f90['transfereduniqueid']];}else{delete queues[_0x5d0f90[_0xa0e9('0xd')]];}}exports[_0xa0e9('0xe')]=function(_0xae35d6){try{utils[_0xa0e9('0xf')](util[_0xa0e9('0x2')](_0xa0e9('0x10'),_0xae35d6[_0xa0e9('0xd')]),_0xae35d6);utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xae35d6[_0xa0e9('0xd')],_0xae35d6[_0xa0e9('0x4')],_0xae35d6[_0xa0e9('0x11')]));queues[_0xae35d6[_0xa0e9('0xd')]]=_['assign'](_0xae35d6,{'originalposition':_0xae35d6[_0xa0e9('0x11')],'queuecallerjoinAt':utils[_0xa0e9('0x12')](),'mohtime':0x0});}catch(_0x375f73){utils[_0xa0e9('0x13')](util['format'](_0xa0e9('0x10'),_0xae35d6[_0xa0e9('0xd')]),_0x375f73);}};exports[_0xa0e9('0x14')]=function(_0x27e9b0){try{if(!_[_0xa0e9('0x15')](queues[_0x27e9b0['uniqueid']])){utils[_0xa0e9('0xf')](util['format']('[%s][queues][hangup]',_0x27e9b0[_0xa0e9('0xd')]),_0x27e9b0);if(queues[_0x27e9b0[_0xa0e9('0xd')]]['queuecallerleaveAt']){if(!queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0x16')]&&!queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0x17')]){queues[_0x27e9b0[_0xa0e9('0xd')]]['queuecallercomplete']=!![];queues[_0x27e9b0['uniqueid']][_0xa0e9('0x18')]=utils[_0xa0e9('0x12')]();queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0x7')]=_0xa0e9('0x19');}utils[_0xa0e9('0x1')](util['format'](_0xa0e9('0x1a'),_0x27e9b0[_0xa0e9('0xd')],queues[_0x27e9b0['uniqueid']]['name'],queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0x7')]));writeDB(queues[_0x27e9b0[_0xa0e9('0xd')]]);}else if(queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0xc')]){utils[_0xa0e9('0x1')](util['format'](_0xa0e9('0x1b'),_0x27e9b0[_0xa0e9('0xd')],queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0x1c')],queues[_0x27e9b0['uniqueid']][_0xa0e9('0xc')]));queues[queues[_0x27e9b0['uniqueid']][_0xa0e9('0xc')]]=queues[_0x27e9b0[_0xa0e9('0xd')]];queues[queues[_0x27e9b0[_0xa0e9('0xd')]][_0xa0e9('0xc')]][_0xa0e9('0x1d')]=0x2;delete queues[_0x27e9b0[_0xa0e9('0xd')]];}}}catch(_0x5e6437){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')]('[%s][queues][hangup]',_0x27e9b0[_0xa0e9('0xd')]),_0x5e6437);}};exports['varset']=function(_0x4c5fb0){try{utils['debug'](util['format']('[%s][queues][varset]',_0x4c5fb0[_0xa0e9('0xd')]),_0x4c5fb0);if(!_['isNil'](_0x4c5fb0['variable'][_0xa0e9('0x1e')])&&_0x4c5fb0[_0xa0e9('0x1f')][_0xa0e9('0x20')]()!==_0xa0e9('0x21')){if(!_['isNil'](queues[_0x4c5fb0[_0xa0e9('0xd')]])){queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x16')]=![];queues[_0x4c5fb0[_0xa0e9('0xd')]]['queuecallerabandonAt']=null;queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x17')]=!![];queues[_0x4c5fb0['uniqueid']][_0xa0e9('0x22')]=utils[_0xa0e9('0x12')]();queues[_0x4c5fb0['uniqueid']][_0xa0e9('0x7')]=_0x4c5fb0['value'][_0xa0e9('0x20')]();utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x23'),_0x4c5fb0[_0xa0e9('0xd')],queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x1c')],_0x4c5fb0['value'],queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x7')]));writeDB(queues[_0x4c5fb0['uniqueid']]);}}else if(!_[_0xa0e9('0x15')](_0x4c5fb0[_0xa0e9('0x24')]['queueposition'])){if(!_[_0xa0e9('0x15')](queues[_0x4c5fb0[_0xa0e9('0xd')]])&&!queues[_0x4c5fb0['uniqueid']][_0xa0e9('0x16')]){queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x16')]=![];queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x25')]=null;queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x17')]=!![];queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x22')]=utils[_0xa0e9('0x12')]();queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x7')]='EXITWITHKEY';utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x26'),_0x4c5fb0[_0xa0e9('0xd')],queues[_0x4c5fb0['uniqueid']][_0xa0e9('0x1c')],_0x4c5fb0['value'],queues[_0x4c5fb0[_0xa0e9('0xd')]][_0xa0e9('0x7')]));}}}catch(_0x159a4b){utils['error'](util[_0xa0e9('0x2')](_0xa0e9('0x27'),_0x4c5fb0[_0xa0e9('0xd')]),_0x159a4b);}};exports[_0xa0e9('0x16')]=function(_0x35688f){try{if(!_[_0xa0e9('0x15')](queues[_0x35688f[_0xa0e9('0xd')]])){utils['debug'](util['format'](_0xa0e9('0x28'),_0x35688f[_0xa0e9('0xd')]),_0x35688f);queues[_0x35688f['uniqueid']][_0xa0e9('0x17')]=![];queues[_0x35688f[_0xa0e9('0xd')]][_0xa0e9('0x22')]=null;queues[_0x35688f[_0xa0e9('0xd')]][_0xa0e9('0x16')]=!![];queues[_0x35688f[_0xa0e9('0xd')]][_0xa0e9('0x25')]=utils[_0xa0e9('0x12')]();queues[_0x35688f['uniqueid']][_0xa0e9('0x7')]=_0xa0e9('0x29');utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x2a'),_0x35688f[_0xa0e9('0xd')],queues[_0x35688f[_0xa0e9('0xd')]][_0xa0e9('0x1c')],queues[_0x35688f[_0xa0e9('0xd')]]['queuecallerexitreason']));}}catch(_0x25ac2a){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x28'),_0x35688f[_0xa0e9('0xd')]),_0x25ac2a);}};exports[_0xa0e9('0x2b')]=function(_0xf61696){try{if(!_[_0xa0e9('0x15')](queues[_0xf61696['uniqueid']])){utils['debug'](util['format'](_0xa0e9('0x2c'),_0xf61696['uniqueid']),_0xf61696);utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x2d'),_0xf61696[_0xa0e9('0xd')],queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x1c')],_0xf61696[_0xa0e9('0x2e')],_0xf61696[_0xa0e9('0x2f')]));queues[_0xf61696[_0xa0e9('0xd')]]['queuecallerleave']=!![];queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x30')]=utils['now']();queues[_0xf61696[_0xa0e9('0xd')]]['holdtime']=utils[_0xa0e9('0x31')](queues[_0xf61696[_0xa0e9('0xd')]]['queuecallerleaveAt'],queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x32')]);queues[_0xf61696['uniqueid']]['position']=_0xf61696[_0xa0e9('0x11')];queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x33')]=_0xf61696[_0xa0e9('0x33')];queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x2e')]=_0xf61696[_0xa0e9('0x2e')];queues[_0xf61696[_0xa0e9('0xd')]][_0xa0e9('0x2f')]=_0xf61696['connectedlinename'];}}catch(_0x3d000e){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x2c'),_0xf61696[_0xa0e9('0xd')]),_0x3d000e);}};exports[_0xa0e9('0x34')]=function(_0x52327d){try{if(!_[_0xa0e9('0x15')](queues[_0x52327d[_0xa0e9('0xd')]])){utils[_0xa0e9('0xf')](util[_0xa0e9('0x2')]('[%s][queues][agentconnect]',_0x52327d[_0xa0e9('0xd')]),_0x52327d);utils['info'](util[_0xa0e9('0x2')](_0xa0e9('0x35'),_0x52327d[_0xa0e9('0xd')],queues[_0x52327d[_0xa0e9('0xd')]]['name'],_0x52327d[_0xa0e9('0x36')],_0x52327d[_0xa0e9('0x37')]));queues[_0x52327d[_0xa0e9('0xd')]][_0xa0e9('0x16')]=![];queues[_0x52327d['uniqueid']][_0xa0e9('0x16')]=![];queues[_0x52327d[_0xa0e9('0xd')]]['queuecallerabandonAt']=null;queues[_0x52327d['uniqueid']][_0xa0e9('0x17')]=![];queues[_0x52327d[_0xa0e9('0xd')]]['queuecallerexitreason']=null;queues[_0x52327d[_0xa0e9('0xd')]]['queuecallerexitAt']=null;queues[_0x52327d['uniqueid']]['assigned']=!![];queues[_0x52327d[_0xa0e9('0xd')]][_0xa0e9('0x6')]=_0x52327d[_0xa0e9('0x37')];queues[_0x52327d['uniqueid']][_0xa0e9('0x38')]=_0x52327d[_0xa0e9('0x36')];}}catch(_0x4ad378){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x39'),_0x52327d[_0xa0e9('0xd')]),_0x4ad378);}};exports[_0xa0e9('0x3a')]=function(_0x47aacb){try{if(!_[_0xa0e9('0x15')](queues[_0x47aacb['uniqueid']])){if(queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x30')]){utils['debug'](util[_0xa0e9('0x2')](_0xa0e9('0x3b'),_0x47aacb[_0xa0e9('0xd')]),_0x47aacb);queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x16')]=![];queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x16')]=![];queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x25')]=null;queues[_0x47aacb[_0xa0e9('0xd')]]['queuecallerexit']=![];queues[_0x47aacb['uniqueid']][_0xa0e9('0x22')]=null;queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x3c')]=!![];queues[_0x47aacb[_0xa0e9('0xd')]]['lastAssignedTo']=_0x47aacb[_0xa0e9('0x36')];queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x3d')]=!![];queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x18')]=utils[_0xa0e9('0x12')]();if(_0x47aacb['reason']=='transfer'){if(!queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x3e')]){queues[_0x47aacb['uniqueid']][_0xa0e9('0x7')]=_0xa0e9('0x3f');}}else{queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x7')]=_0xa0e9('0x40')+_0x47aacb['reason'][_0xa0e9('0x20')]();}utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x41'),_0x47aacb[_0xa0e9('0xd')],queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x1c')],_0x47aacb[_0xa0e9('0x36')],queues[_0x47aacb[_0xa0e9('0xd')]][_0xa0e9('0x7')]));writeDB(queues[_0x47aacb[_0xa0e9('0xd')]]);}}}catch(_0x182abc){utils['error'](util[_0xa0e9('0x2')](_0xa0e9('0x3b'),_0x47aacb['uniqueid']),_0x182abc);}};exports['blindtransfer']=function(_0x37fa2b){try{if(!_[_0xa0e9('0x15')](queues[_0x37fa2b[_0xa0e9('0x42')]])){utils['debug'](util[_0xa0e9('0x2')](_0xa0e9('0x43'),_0x37fa2b[_0xa0e9('0xd')]),_0x37fa2b);queues[_0x37fa2b[_0xa0e9('0x42')]][_0xa0e9('0x3e')]=!![];queues[_0x37fa2b[_0xa0e9('0x42')]]['transfertype']=_0xa0e9('0x44');queues[_0x37fa2b[_0xa0e9('0x42')]][_0xa0e9('0x45')]=_0x37fa2b[_0xa0e9('0x46')];queues[_0x37fa2b[_0xa0e9('0x42')]][_0xa0e9('0x47')]=_0x37fa2b[_0xa0e9('0x42')];queues[_0x37fa2b['transfereeuniqueid']]['queuecallerexitreason']=_0xa0e9('0x48');utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x49'),_0x37fa2b[_0xa0e9('0xd')],queues[_0x37fa2b[_0xa0e9('0x42')]][_0xa0e9('0x1c')],_0x37fa2b[_0xa0e9('0x42')],_0x37fa2b['extension']));}}catch(_0x341a){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x43'),_0x37fa2b[_0xa0e9('0xd')]),_0x341a);}};exports[_0xa0e9('0x4a')]=function(_0x159917){try{utils['debug'](util[_0xa0e9('0x2')](_0xa0e9('0x4b'),_0x159917[_0xa0e9('0x4c')]),_0x159917);if(_0x159917[_0xa0e9('0x4c')]==_0x159917[_0xa0e9('0x4d')]){if(!_[_0xa0e9('0x15')](queues[_0x159917[_0xa0e9('0x4e')]])){utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x159917[_0xa0e9('0x4c')],queues[_0x159917['secondtransfererlinkedid']][_0xa0e9('0x1c')],_0x159917['origtransfererexten']));queues[_0x159917[_0xa0e9('0x4e')]]['transfer']=!![];queues[_0x159917[_0xa0e9('0x4e')]]['transfertype']='ATTENDED';queues[_0x159917['secondtransfererlinkedid']][_0xa0e9('0x45')]=_0x159917[_0xa0e9('0x4f')];queues[_0x159917[_0xa0e9('0x4e')]]['transferuniqueid']=_0x159917[_0xa0e9('0x4c')];queues[_0x159917[_0xa0e9('0x4e')]][_0xa0e9('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xa0e9('0x15')](queues[_0x159917[_0xa0e9('0x4d')]])){if(_0x159917[_0xa0e9('0x50')]&&queues[_0x159917[_0xa0e9('0x50')]]){queues[_0x159917[_0xa0e9('0x50')]][_0xa0e9('0x1d')]=0x1;queues[_0x159917['transfereeuniqueid']]=_['clone'](queues[_0x159917['transfereelinkedid']]);queues[_0x159917[_0xa0e9('0x42')]]['transfereduniqueid']=_0x159917[_0xa0e9('0x51')];queues[_0x159917[_0xa0e9('0x42')]]['queuecallerenterreason']=0x2;queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x5')]=queues[_0x159917['secondtransfererlinkedid']][_0xa0e9('0x5')];queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x52')]=queues[_0x159917[_0xa0e9('0x4e')]][_0xa0e9('0x52')];queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x32')]=utils[_0xa0e9('0x12')]();queues[_0x159917[_0xa0e9('0x42')]]['queuecallerleaveAt']=utils[_0xa0e9('0x12')]();queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x53')]=0x0;queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x54')]=0x0;utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x55'),_0x159917[_0xa0e9('0x4c')],queues[_0x159917['transfereeuniqueid']][_0xa0e9('0x1c')],queues[_0x159917['transfereeuniqueid']][_0xa0e9('0x5')],queues[_0x159917[_0xa0e9('0x42')]][_0xa0e9('0x52')]));}else{utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x56'),_0x159917[_0xa0e9('0x4c')],queues[_0x159917[_0xa0e9('0x4d')]]['name'],_0x159917[_0xa0e9('0x4e')]));queues[_0x159917[_0xa0e9('0x4d')]][_0xa0e9('0xc')]=_0x159917[_0xa0e9('0x4e')];}}}else if(_0x159917['secondtransfereruniqueid']==_0x159917['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x159917[_0xa0e9('0x4d')]])){utils[_0xa0e9('0x1')](util['format'](_0xa0e9('0x57'),_0x159917[_0xa0e9('0x4c')],queues[_0x159917[_0xa0e9('0x4d')]]['name'],_0x159917[_0xa0e9('0x58')],_0x159917[_0xa0e9('0x59')]));queues[_0x159917['origtransfererlinkedid']]['transfer']=!![];queues[_0x159917[_0xa0e9('0x4d')]][_0xa0e9('0x5a')]=_0xa0e9('0x5b');queues[_0x159917[_0xa0e9('0x4d')]]['transferexten']=_0x159917[_0xa0e9('0x59')];queues[_0x159917[_0xa0e9('0x4d')]]['transferuniqueid']=_0x159917['secondtransfereruniqueid'];queues[_0x159917[_0xa0e9('0x4d')]][_0xa0e9('0x7')]=_0xa0e9('0x5c');}if(!_[_0xa0e9('0x15')](queues[_0x159917[_0xa0e9('0x4e')]])){if(_0x159917['transfertargetlinkedid']&&queues[_0x159917[_0xa0e9('0x5d')]]){queues[_0x159917[_0xa0e9('0x5d')]][_0xa0e9('0x1d')]=0x1;queues[_0x159917[_0xa0e9('0x51')]]=_[_0xa0e9('0x5e')](queues[_0x159917[_0xa0e9('0x5d')]]);queues[_0x159917[_0xa0e9('0x51')]]['transfereduniqueid']=_0x159917[_0xa0e9('0x51')];queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x1d')]=0x2;queues[_0x159917['transfertargetuniqueid']][_0xa0e9('0x5')]=queues[_0x159917[_0xa0e9('0x4d')]][_0xa0e9('0x5')];queues[_0x159917['transfertargetuniqueid']][_0xa0e9('0x52')]=queues[_0x159917['origtransfererlinkedid']]['calleridname'];queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x32')]=utils['now']();queues[_0x159917['transfertargetuniqueid']][_0xa0e9('0x30')]=utils[_0xa0e9('0x12')]();queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x53')]=0x0;queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x54')]=0x0;utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x5f'),_0x159917[_0xa0e9('0x4c')],queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x1c')],queues[_0x159917[_0xa0e9('0x51')]]['transfereduniqueid'],queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x5')],queues[_0x159917[_0xa0e9('0x51')]][_0xa0e9('0x52')]));}else{utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x56'),_0x159917[_0xa0e9('0x4c')],queues[_0x159917['secondtransfererlinkedid']][_0xa0e9('0x1c')],_0x159917[_0xa0e9('0x4d')]));queues[_0x159917[_0xa0e9('0x4e')]]['transfereduniqueid']=_0x159917['origtransfererlinkedid'];}}}}catch(_0x284a82){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x4b'),_0x159917[_0xa0e9('0x4c')]),_0x284a82);}};exports['musiconholdstart']=function(_0x19bf1c){try{if(!_[_0xa0e9('0x15')](queues[_0x19bf1c[_0xa0e9('0xd')]])){utils[_0xa0e9('0xf')](util[_0xa0e9('0x2')](_0xa0e9('0x60'),_0x19bf1c['uniqueid']),_0x19bf1c);queues[_0x19bf1c[_0xa0e9('0xd')]][_0xa0e9('0x61')]=utils[_0xa0e9('0x12')]();utils[_0xa0e9('0x1')](util['format'](_0xa0e9('0x62'),_0x19bf1c[_0xa0e9('0xd')],queues[_0x19bf1c[_0xa0e9('0xd')]][_0xa0e9('0x1c')],queues[_0x19bf1c[_0xa0e9('0xd')]][_0xa0e9('0x61')]));}}catch(_0x5c10c2){utils[_0xa0e9('0x13')](util['format'](_0xa0e9('0x60'),_0x19bf1c['uniqueid']),_0x5c10c2);}};exports[_0xa0e9('0x63')]=function(_0xa8f427){try{if(!_['isNil'](queues[_0xa8f427[_0xa0e9('0xd')]])){if(!_[_0xa0e9('0x15')](queues[_0xa8f427['uniqueid']]['musiconholdstartAt'])){utils[_0xa0e9('0xf')](util[_0xa0e9('0x2')](_0xa0e9('0x64'),_0xa8f427['uniqueid']),_0xa8f427);queues[_0xa8f427[_0xa0e9('0xd')]][_0xa0e9('0x54')]+=utils[_0xa0e9('0x31')](utils[_0xa0e9('0x12')](),queues[_0xa8f427[_0xa0e9('0xd')]][_0xa0e9('0x61')]);utils[_0xa0e9('0x1')](util[_0xa0e9('0x2')](_0xa0e9('0x65'),_0xa8f427['uniqueid'],queues[_0xa8f427['uniqueid']][_0xa0e9('0x1c')],queues[_0xa8f427[_0xa0e9('0xd')]][_0xa0e9('0x54')]));delete queues[_0xa8f427[_0xa0e9('0xd')]][_0xa0e9('0x61')];}}}catch(_0x55e6f3){utils[_0xa0e9('0x13')](util[_0xa0e9('0x2')](_0xa0e9('0x64'),_0xa8f427['uniqueid']),_0x55e6f3);}}; \ No newline at end of file +var _0xc45f=['clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerexitAt','now','queueposition','queuecallerabandonAt','queuecallerexit','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid'];(function(_0x581ec3,_0x63f22c){var _0x26b77d=function(_0x2d553b){while(--_0x2d553b){_0x581ec3['push'](_0x581ec3['shift']());}};_0x26b77d(++_0x63f22c);}(_0xc45f,0x74));var _0xfc45=function(_0x407ed2,_0x30e223){_0x407ed2=_0x407ed2-0x0;var _0x4336dd=_0xc45f[_0x407ed2];return _0x4336dd;};'use strict';var _=require('lodash');var util=require(_0xfc45('0x0'));var utils=require(_0xfc45('0x1'));var queues={};function writeDB(_0x5d84a6){utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5d84a6['uniqueid'],_0x5d84a6[_0xfc45('0x4')],_0x5d84a6[_0xfc45('0x5')],_0x5d84a6['lastAssignedTo'],_0x5d84a6[_0xfc45('0x6')],_0x5d84a6[_0xfc45('0x7')],_0x5d84a6[_0xfc45('0x8')]));if(_0x5d84a6[_0xfc45('0x5')]){utils[_0xfc45('0x9')](_0x5d84a6[_0xfc45('0x5')])['then'](function(_0x1778ef){if(_0x1778ef){_0x5d84a6[_0xfc45('0xa')]=_0x1778ef[_0xfc45('0xa')];}utils[_0xfc45('0xb')](_0xfc45('0xc'),_0x5d84a6);});}else{utils[_0xfc45('0xb')](_0xfc45('0xc'),_0x5d84a6);}if(_0x5d84a6[_0xfc45('0xd')]){delete queues[_0x5d84a6[_0xfc45('0xd')]];}else{delete queues[_0x5d84a6[_0xfc45('0xe')]];}}exports[_0xfc45('0xf')]=function(_0x40e207){try{utils[_0xfc45('0x10')](util[_0xfc45('0x3')](_0xfc45('0x11'),_0x40e207[_0xfc45('0xe')]),_0x40e207);utils['info'](util[_0xfc45('0x3')](_0xfc45('0x12'),_0x40e207[_0xfc45('0xe')],_0x40e207[_0xfc45('0x5')],_0x40e207['position']));queues[_0x40e207['uniqueid']]=_[_0xfc45('0x13')](_0x40e207,{'originalposition':_0x40e207[_0xfc45('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x12ea35){utils[_0xfc45('0x15')](util[_0xfc45('0x3')](_0xfc45('0x11'),_0x40e207[_0xfc45('0xe')]),_0x12ea35);}};exports[_0xfc45('0x16')]=function(_0xd0f786){try{if(!_[_0xfc45('0x17')](queues[_0xd0f786[_0xfc45('0xe')]])){utils['debug'](util[_0xfc45('0x3')](_0xfc45('0x18'),_0xd0f786['uniqueid']),_0xd0f786);if(queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x19')]){if(!queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x1a')]&&!queues[_0xd0f786['uniqueid']]['queuecallerexit']){queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x1b')]=!![];queues[_0xd0f786['uniqueid']][_0xfc45('0x1c')]=utils['now']();queues[_0xd0f786['uniqueid']][_0xfc45('0x8')]=_0xfc45('0x1d');}utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x1e'),_0xd0f786[_0xfc45('0xe')],queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x1f')],queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x8')]));writeDB(queues[_0xd0f786['uniqueid']]);}else if(queues[_0xd0f786[_0xfc45('0xe')]]['transfereduniqueid']){utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0xd0f786[_0xfc45('0xe')],queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0x1f')],queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0xd')]));queues[queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0xd')]]=queues[_0xd0f786[_0xfc45('0xe')]];queues[queues[_0xd0f786[_0xfc45('0xe')]][_0xfc45('0xd')]][_0xfc45('0x20')]=0x2;delete queues[_0xd0f786['uniqueid']];}}}catch(_0x4e1119){utils['error'](util[_0xfc45('0x3')](_0xfc45('0x18'),_0xd0f786[_0xfc45('0xe')]),_0x4e1119);}};exports[_0xfc45('0x21')]=function(_0x387c39){try{utils['debug'](util['format'](_0xfc45('0x22'),_0x387c39[_0xfc45('0xe')]),_0x387c39);if(!_[_0xfc45('0x17')](_0x387c39[_0xfc45('0x23')]['queuestatus'])&&_0x387c39[_0xfc45('0x24')][_0xfc45('0x25')]()!==_0xfc45('0x26')){if(!_['isNil'](queues[_0x387c39[_0xfc45('0xe')]])){queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x1a')]=![];queues[_0x387c39[_0xfc45('0xe')]]['queuecallerabandonAt']=null;queues[_0x387c39['uniqueid']]['queuecallerexit']=!![];queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x27')]=utils[_0xfc45('0x28')]();queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x8')]=_0x387c39[_0xfc45('0x24')][_0xfc45('0x25')]();utils['info'](util[_0xfc45('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x387c39[_0xfc45('0xe')],queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x1f')],_0x387c39[_0xfc45('0x24')],queues[_0x387c39['uniqueid']][_0xfc45('0x8')]));writeDB(queues[_0x387c39['uniqueid']]);}}else if(!_[_0xfc45('0x17')](_0x387c39['variable'][_0xfc45('0x29')])){if(!_[_0xfc45('0x17')](queues[_0x387c39['uniqueid']])&&!queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x1a')]){queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x1a')]=![];queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x2a')]=null;queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x2b')]=!![];queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x27')]=utils[_0xfc45('0x28')]();queues[_0x387c39[_0xfc45('0xe')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x387c39[_0xfc45('0xe')],queues[_0x387c39[_0xfc45('0xe')]][_0xfc45('0x1f')],_0x387c39['value'],queues[_0x387c39['uniqueid']]['queuecallerexitreason']));}}}catch(_0x5e4f9f){utils['error'](util['format']('[%s][queues][varset]',_0x387c39[_0xfc45('0xe')]),_0x5e4f9f);}};exports[_0xfc45('0x1a')]=function(_0x70dcd4){try{if(!_[_0xfc45('0x17')](queues[_0x70dcd4[_0xfc45('0xe')]])){utils[_0xfc45('0x10')](util[_0xfc45('0x3')](_0xfc45('0x2c'),_0x70dcd4[_0xfc45('0xe')]),_0x70dcd4);queues[_0x70dcd4[_0xfc45('0xe')]]['queuecallerexit']=![];queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x27')]=null;queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x1a')]=!![];queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x2a')]=utils[_0xfc45('0x28')]();queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x8')]=_0xfc45('0x2d');utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x2e'),_0x70dcd4[_0xfc45('0xe')],queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x1f')],queues[_0x70dcd4[_0xfc45('0xe')]][_0xfc45('0x8')]));}}catch(_0x39de78){utils['error'](util[_0xfc45('0x3')](_0xfc45('0x2c'),_0x70dcd4[_0xfc45('0xe')]),_0x39de78);}};exports[_0xfc45('0x2f')]=function(_0x1b84f1){try{if(!_['isNil'](queues[_0x1b84f1[_0xfc45('0xe')]])){utils['debug'](util[_0xfc45('0x3')](_0xfc45('0x30'),_0x1b84f1['uniqueid']),_0x1b84f1);utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1b84f1[_0xfc45('0xe')],queues[_0x1b84f1[_0xfc45('0xe')]][_0xfc45('0x1f')],_0x1b84f1[_0xfc45('0x31')],_0x1b84f1['connectedlinename']));queues[_0x1b84f1['uniqueid']][_0xfc45('0x2f')]=!![];queues[_0x1b84f1['uniqueid']]['queuecallerleaveAt']=utils[_0xfc45('0x28')]();queues[_0x1b84f1[_0xfc45('0xe')]][_0xfc45('0x32')]=utils[_0xfc45('0x33')](queues[_0x1b84f1[_0xfc45('0xe')]][_0xfc45('0x19')],queues[_0x1b84f1[_0xfc45('0xe')]][_0xfc45('0x34')]);queues[_0x1b84f1['uniqueid']]['position']=_0x1b84f1[_0xfc45('0x14')];queues[_0x1b84f1[_0xfc45('0xe')]]['count']=_0x1b84f1[_0xfc45('0x35')];queues[_0x1b84f1[_0xfc45('0xe')]]['connectedlinenum']=_0x1b84f1[_0xfc45('0x31')];queues[_0x1b84f1['uniqueid']][_0xfc45('0x36')]=_0x1b84f1['connectedlinename'];}}catch(_0x1e49e2){utils[_0xfc45('0x15')](util[_0xfc45('0x3')](_0xfc45('0x30'),_0x1b84f1[_0xfc45('0xe')]),_0x1e49e2);}};exports[_0xfc45('0x37')]=function(_0xc2f0a5){try{if(!_[_0xfc45('0x17')](queues[_0xc2f0a5['uniqueid']])){utils[_0xfc45('0x10')](util[_0xfc45('0x3')](_0xfc45('0x38'),_0xc2f0a5[_0xfc45('0xe')]),_0xc2f0a5);utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x39'),_0xc2f0a5[_0xfc45('0xe')],queues[_0xc2f0a5['uniqueid']][_0xfc45('0x1f')],_0xc2f0a5[_0xfc45('0x3a')],_0xc2f0a5['destaccountcode']));queues[_0xc2f0a5['uniqueid']][_0xfc45('0x1a')]=![];queues[_0xc2f0a5[_0xfc45('0xe')]][_0xfc45('0x1a')]=![];queues[_0xc2f0a5[_0xfc45('0xe')]][_0xfc45('0x2a')]=null;queues[_0xc2f0a5[_0xfc45('0xe')]]['queuecallerexit']=![];queues[_0xc2f0a5[_0xfc45('0xe')]][_0xfc45('0x8')]=null;queues[_0xc2f0a5[_0xfc45('0xe')]][_0xfc45('0x27')]=null;queues[_0xc2f0a5[_0xfc45('0xe')]]['assigned']=!![];queues[_0xc2f0a5[_0xfc45('0xe')]]['accountcode']=_0xc2f0a5['destaccountcode'];queues[_0xc2f0a5[_0xfc45('0xe')]][_0xfc45('0x3b')]=_0xc2f0a5[_0xfc45('0x3a')];}}catch(_0x1a8606){utils['error'](util[_0xfc45('0x3')](_0xfc45('0x38'),_0xc2f0a5['uniqueid']),_0x1a8606);}};exports[_0xfc45('0x3c')]=function(_0x5b31b2){try{if(!_[_0xfc45('0x17')](queues[_0x5b31b2['uniqueid']])){if(queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x19')]){utils['debug'](util[_0xfc45('0x3')](_0xfc45('0x3d'),_0x5b31b2[_0xfc45('0xe')]),_0x5b31b2);queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x1a')]=![];queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x1a')]=![];queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x2a')]=null;queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x2b')]=![];queues[_0x5b31b2[_0xfc45('0xe')]]['queuecallerexitAt']=null;queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x3e')]=!![];queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x3b')]=_0x5b31b2[_0xfc45('0x3a')];queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x1b')]=!![];queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x1c')]=utils[_0xfc45('0x28')]();if(_0x5b31b2['reason']==_0xfc45('0x3f')){if(!queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x3f')]){queues[_0x5b31b2['uniqueid']][_0xfc45('0x8')]=_0xfc45('0x40');}}else{queues[_0x5b31b2['uniqueid']]['queuecallerexitreason']=_0xfc45('0x41')+_0x5b31b2[_0xfc45('0x42')][_0xfc45('0x25')]();}utils['info'](util[_0xfc45('0x3')](_0xfc45('0x43'),_0x5b31b2[_0xfc45('0xe')],queues[_0x5b31b2[_0xfc45('0xe')]][_0xfc45('0x1f')],_0x5b31b2[_0xfc45('0x3a')],queues[_0x5b31b2['uniqueid']][_0xfc45('0x8')]));writeDB(queues[_0x5b31b2[_0xfc45('0xe')]]);}}}catch(_0x4266a3){utils[_0xfc45('0x15')](util[_0xfc45('0x3')](_0xfc45('0x3d'),_0x5b31b2[_0xfc45('0xe')]),_0x4266a3);}};exports['blindtransfer']=function(_0x46e242){try{if(!_[_0xfc45('0x17')](queues[_0x46e242['transfereeuniqueid']])){utils[_0xfc45('0x10')](util[_0xfc45('0x3')]('[%s][queues][blindtransfer]',_0x46e242[_0xfc45('0xe')]),_0x46e242);queues[_0x46e242[_0xfc45('0x44')]][_0xfc45('0x3f')]=!![];queues[_0x46e242['transfereeuniqueid']][_0xfc45('0x45')]=_0xfc45('0x46');queues[_0x46e242[_0xfc45('0x44')]][_0xfc45('0x47')]=_0x46e242[_0xfc45('0x48')];queues[_0x46e242[_0xfc45('0x44')]][_0xfc45('0x49')]=_0x46e242[_0xfc45('0x44')];queues[_0x46e242['transfereeuniqueid']][_0xfc45('0x8')]='BLINDTRANSFER';utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x4a'),_0x46e242[_0xfc45('0xe')],queues[_0x46e242['transfereeuniqueid']]['name'],_0x46e242[_0xfc45('0x44')],_0x46e242['extension']));}}catch(_0x14613a){utils[_0xfc45('0x15')](util[_0xfc45('0x3')]('[%s][queues][blindtransfer]',_0x46e242[_0xfc45('0xe')]),_0x14613a);}};exports[_0xfc45('0x4b')]=function(_0x7f35dc){try{utils['debug'](util[_0xfc45('0x3')](_0xfc45('0x4c'),_0x7f35dc[_0xfc45('0x4d')]),_0x7f35dc);if(_0x7f35dc[_0xfc45('0x4d')]==_0x7f35dc[_0xfc45('0x4e')]){if(!_['isNil'](queues[_0x7f35dc['secondtransfererlinkedid']])){utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x4f'),_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0x1f')],_0x7f35dc['origtransfererexten']));queues[_0x7f35dc['secondtransfererlinkedid']][_0xfc45('0x3f')]=!![];queues[_0x7f35dc[_0xfc45('0x50')]]['transfertype']='ATTENDED';queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0x47')]=_0x7f35dc[_0xfc45('0x51')];queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0x49')]=_0x7f35dc[_0xfc45('0x4d')];queues[_0x7f35dc['secondtransfererlinkedid']]['queuecallerexitreason']=_0xfc45('0x52');}if(!_['isNil'](queues[_0x7f35dc[_0xfc45('0x4e')]])){if(_0x7f35dc['transfereelinkedid']&&queues[_0x7f35dc[_0xfc45('0x53')]]){queues[_0x7f35dc[_0xfc45('0x53')]][_0xfc45('0x20')]=0x1;queues[_0x7f35dc[_0xfc45('0x44')]]=_[_0xfc45('0x54')](queues[_0x7f35dc[_0xfc45('0x53')]]);queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0xd')]=_0x7f35dc[_0xfc45('0x55')];queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x20')]=0x2;queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x6')]=queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0x6')];queues[_0x7f35dc['transfereeuniqueid']][_0xfc45('0x56')]=queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0x56')];queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x34')]=utils[_0xfc45('0x28')]();queues[_0x7f35dc['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0xfc45('0x28')]();queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x32')]=0x0;queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x57')]=0x0;utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc[_0xfc45('0x44')]]['name'],queues[_0x7f35dc[_0xfc45('0x44')]][_0xfc45('0x6')],queues[_0x7f35dc[_0xfc45('0x44')]]['calleridname']));}else{utils['info'](util[_0xfc45('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc[_0xfc45('0x4e')]]['name'],_0x7f35dc[_0xfc45('0x50')]));queues[_0x7f35dc[_0xfc45('0x4e')]]['transfereduniqueid']=_0x7f35dc[_0xfc45('0x50')];}}}else if(_0x7f35dc['secondtransfereruniqueid']==_0x7f35dc['secondtransfererlinkedid']){if(!_[_0xfc45('0x17')](queues[_0x7f35dc[_0xfc45('0x4e')]])){utils[_0xfc45('0x2')](util[_0xfc45('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc['origtransfererlinkedid']][_0xfc45('0x1f')],_0x7f35dc[_0xfc45('0x58')],_0x7f35dc[_0xfc45('0x59')]));queues[_0x7f35dc['origtransfererlinkedid']][_0xfc45('0x3f')]=!![];queues[_0x7f35dc['origtransfererlinkedid']][_0xfc45('0x45')]=_0xfc45('0x5a');queues[_0x7f35dc[_0xfc45('0x4e')]][_0xfc45('0x47')]=_0x7f35dc[_0xfc45('0x59')];queues[_0x7f35dc[_0xfc45('0x4e')]][_0xfc45('0x49')]=_0x7f35dc[_0xfc45('0x58')];queues[_0x7f35dc[_0xfc45('0x4e')]]['queuecallerexitreason']=_0xfc45('0x52');}if(!_[_0xfc45('0x17')](queues[_0x7f35dc[_0xfc45('0x50')]])){if(_0x7f35dc['transfertargetlinkedid']&&queues[_0x7f35dc[_0xfc45('0x5b')]]){queues[_0x7f35dc[_0xfc45('0x5b')]][_0xfc45('0x20')]=0x1;queues[_0x7f35dc[_0xfc45('0x55')]]=_[_0xfc45('0x54')](queues[_0x7f35dc[_0xfc45('0x5b')]]);queues[_0x7f35dc[_0xfc45('0x55')]]['transfereduniqueid']=_0x7f35dc[_0xfc45('0x55')];queues[_0x7f35dc['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x7f35dc['transfertargetuniqueid']]['calleridnum']=queues[_0x7f35dc[_0xfc45('0x4e')]]['calleridnum'];queues[_0x7f35dc[_0xfc45('0x55')]]['calleridname']=queues[_0x7f35dc[_0xfc45('0x4e')]]['calleridname'];queues[_0x7f35dc[_0xfc45('0x55')]]['queuecallerjoinAt']=utils[_0xfc45('0x28')]();queues[_0x7f35dc['transfertargetuniqueid']][_0xfc45('0x19')]=utils[_0xfc45('0x28')]();queues[_0x7f35dc[_0xfc45('0x55')]]['holdtime']=0x0;queues[_0x7f35dc[_0xfc45('0x55')]][_0xfc45('0x57')]=0x0;utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x5c'),_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc[_0xfc45('0x55')]]['name'],queues[_0x7f35dc['transfertargetuniqueid']][_0xfc45('0xd')],queues[_0x7f35dc['transfertargetuniqueid']]['calleridnum'],queues[_0x7f35dc[_0xfc45('0x55')]][_0xfc45('0x56')]));}else{utils[_0xfc45('0x2')](util[_0xfc45('0x3')](_0xfc45('0x5d'),_0x7f35dc[_0xfc45('0x4d')],queues[_0x7f35dc[_0xfc45('0x50')]]['name'],_0x7f35dc['origtransfererlinkedid']));queues[_0x7f35dc[_0xfc45('0x50')]][_0xfc45('0xd')]=_0x7f35dc[_0xfc45('0x4e')];}}}}catch(_0x49fe09){utils['error'](util['format'](_0xfc45('0x4c'),_0x7f35dc['origtransfereruniqueid']),_0x49fe09);}};exports[_0xfc45('0x5e')]=function(_0x4d532d){try{if(!_['isNil'](queues[_0x4d532d[_0xfc45('0xe')]])){utils['debug'](util[_0xfc45('0x3')](_0xfc45('0x5f'),_0x4d532d[_0xfc45('0xe')]),_0x4d532d);queues[_0x4d532d[_0xfc45('0xe')]][_0xfc45('0x60')]=utils[_0xfc45('0x28')]();utils[_0xfc45('0x2')](util['format'](_0xfc45('0x61'),_0x4d532d[_0xfc45('0xe')],queues[_0x4d532d[_0xfc45('0xe')]][_0xfc45('0x1f')],queues[_0x4d532d[_0xfc45('0xe')]]['musiconholdstartAt']));}}catch(_0xbbd5ab){utils[_0xfc45('0x15')](util['format']('[%s][queues][musiconholdstart]',_0x4d532d[_0xfc45('0xe')]),_0xbbd5ab);}};exports['musiconholdstop']=function(_0x2adddf){try{if(!_['isNil'](queues[_0x2adddf['uniqueid']])){if(!_['isNil'](queues[_0x2adddf['uniqueid']]['musiconholdstartAt'])){utils[_0xfc45('0x10')](util[_0xfc45('0x3')](_0xfc45('0x62'),_0x2adddf[_0xfc45('0xe')]),_0x2adddf);queues[_0x2adddf[_0xfc45('0xe')]][_0xfc45('0x57')]+=utils[_0xfc45('0x33')](utils[_0xfc45('0x28')](),queues[_0x2adddf['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0xfc45('0x3')](_0xfc45('0x63'),_0x2adddf[_0xfc45('0xe')],queues[_0x2adddf[_0xfc45('0xe')]][_0xfc45('0x1f')],queues[_0x2adddf[_0xfc45('0xe')]][_0xfc45('0x57')]));delete queues[_0x2adddf[_0xfc45('0xe')]][_0xfc45('0x60')];}}}catch(_0x2784d3){utils[_0xfc45('0x15')](util[_0xfc45('0x3')](_0xfc45('0x62'),_0x2adddf[_0xfc45('0xe')]),_0x2784d3);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index f262e9a..5c37c52 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 _0x1640=['[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','connectedlinenum','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x1640,0x14d));var _0x0164=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x1640[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0x0164('0x0'));var utils=require(_0x0164('0x1'));var recordings={};function writeDB(_0xeb26b3){utils[_0x0164('0x2')](util[_0x0164('0x3')](_0x0164('0x4'),_0xeb26b3[_0x0164('0x5')]));if(_0xeb26b3[_0x0164('0x6')]){utils[_0x0164('0x7')](_0xeb26b3[_0x0164('0x6')])[_0x0164('0x8')](function(_0xb01573){if(_0xb01573){_0xeb26b3[_0x0164('0x9')]=_0xb01573['name'];_0xeb26b3[_0x0164('0xa')]=_0xb01573['id'];}utils[_0x0164('0xb')](_0x0164('0xc'),_0xeb26b3);});}else{utils[_0x0164('0xb')](_0x0164('0xc'),_0xeb26b3);}}exports[_0x0164('0xd')]=function(_0x411ef7){try{utils['debug'](util[_0x0164('0x3')](_0x0164('0xe'),_0x411ef7['uniqueid']),_0x411ef7);if(_0x411ef7[_0x0164('0x5')]==_0x411ef7[_0x0164('0xf')]){utils['info'](util[_0x0164('0x3')](_0x0164('0x10'),_0x411ef7[_0x0164('0x5')],_0x411ef7[_0x0164('0x11')],_0x411ef7[_0x0164('0x12')]));recordings[_0x411ef7['uniqueid']]={'uniqueid':_0x411ef7['uniqueid'],'accountcode':_0x411ef7[_0x0164('0x6')],'exten':_0x411ef7[_0x0164('0x12')],'context':_0x411ef7[_0x0164('0x11')],'channel':_0x411ef7['channel'],'monitors':[]};}}catch(_0x9edc1e){utils[_0x0164('0x13')](util[_0x0164('0x3')](_0x0164('0xe'),_0x411ef7['uniqueid']),_0x9edc1e);}};exports[_0x0164('0x14')]=function(_0x2d7d57){try{utils[_0x0164('0x15')](util[_0x0164('0x3')](_0x0164('0x16'),_0x2d7d57['uniqueid']),_0x2d7d57);if(!_[_0x0164('0x17')](recordings[_0x2d7d57[_0x0164('0x5')]])&&_0x2d7d57[_0x0164('0x18')]==0x6){utils[_0x0164('0x2')](util[_0x0164('0x3')](_0x0164('0x19'),_0x2d7d57[_0x0164('0x5')],_0x2d7d57['context'],_0x2d7d57[_0x0164('0x1a')]));}else if(!_[_0x0164('0x17')](recordings[_0x2d7d57[_0x0164('0xf')]])&&_0x2d7d57[_0x0164('0x18')]==0x6&&_0x2d7d57[_0x0164('0x11')]!=_0x0164('0x1b')){utils[_0x0164('0x2')](util['format'](_0x0164('0x1c'),_0x2d7d57[_0x0164('0x5')],_0x2d7d57[_0x0164('0xf')],_0x2d7d57[_0x0164('0x11')],_0x2d7d57['channel']));recordings[_0x2d7d57['linkedid']][_0x0164('0x6')]=_0x2d7d57[_0x0164('0x6')];}}catch(_0x4f16a3){utils[_0x0164('0x13')](util[_0x0164('0x3')](_0x0164('0x16'),_0x2d7d57['uniqueid']),_0x4f16a3);}};exports[_0x0164('0x1d')]=function(_0x9d9553){try{if(!_['isNil'](_0x9d9553[_0x0164('0x1e')])&&!_['isNil'](_0x9d9553[_0x0164('0x1e')][_0x0164('0x1f')])){utils[_0x0164('0x15')](util[_0x0164('0x3')](_0x0164('0x20'),_0x9d9553[_0x0164('0x5')]),_0x9d9553);utils[_0x0164('0x2')](util[_0x0164('0x3')](_0x0164('0x21'),_0x9d9553[_0x0164('0x5')],_0x9d9553[_0x0164('0x1e')],_0x9d9553[_0x0164('0x22')]));if(_['endsWith'](_0x9d9553['value'],_0x0164('0x23'))){_0x9d9553[_0x0164('0x22')]=_0x9d9553[_0x0164('0x22')]['replace'](_0x0164('0x23'),'.WAV');}if(recordings[_0x9d9553['linkedid']]){var _0x461f94=_[_0x0164('0x24')](recordings[_0x9d9553[_0x0164('0xf')]][_0x0164('0x25')],{'value':_0x9d9553[_0x0164('0x22')]});if(_[_0x0164('0x17')](_0x461f94)){recordings[_0x9d9553[_0x0164('0xf')]][_0x0164('0x25')][_0x0164('0x26')]({'value':_0x9d9553['value']});}}}}catch(_0x5e3a0d){utils[_0x0164('0x13')](util['format'](_0x0164('0x20'),_0x9d9553[_0x0164('0x5')]),_0x5e3a0d);}};exports['hangup']=function(_0x155f2d){try{if(!_['isNil'](recordings[_0x155f2d[_0x0164('0x5')]])){utils[_0x0164('0x15')](util[_0x0164('0x3')](_0x0164('0x27'),_0x155f2d['uniqueid']),_0x155f2d);utils[_0x0164('0x2')](util['format'](_0x0164('0x28'),_0x155f2d[_0x0164('0x5')],_0x155f2d[_0x0164('0x29')],_0x155f2d['calleridname'],_0x155f2d['cause-txt']));recordings[_0x155f2d[_0x0164('0x5')]]['calleridnum']=_0x155f2d[_0x0164('0x29')];recordings[_0x155f2d['uniqueid']][_0x0164('0x2a')]=_0x155f2d['calleridname'];recordings[_0x155f2d[_0x0164('0x5')]]['connectedlinenum']=_0x155f2d['connectedlinenum'];recordings[_0x155f2d['uniqueid']][_0x0164('0x2b')]=_0x155f2d[_0x0164('0x2b')];if(recordings[_0x155f2d[_0x0164('0x5')]][_0x0164('0x2c')]=='outbound'&&recordings[_0x155f2d[_0x0164('0x5')]][_0x0164('0x6')]){recordings[_0x155f2d[_0x0164('0x5')]][_0x0164('0x2d')]=recordings[_0x155f2d[_0x0164('0x5')]][_0x0164('0x6')];recordings[_0x155f2d['uniqueid']][_0x0164('0x2b')]='';}recordings[_0x155f2d[_0x0164('0x5')]]['monitors']['forEach'](function(_0x2bf549){var _0xc9d5b7=_[_0x0164('0x2e')](recordings[_0x155f2d['uniqueid']]);_0xc9d5b7[_0x0164('0x22')]=_0x2bf549[_0x0164('0x22')];writeDB(_0xc9d5b7);});delete recordings[_0x155f2d['uniqueid']];}}catch(_0x24ee5d){utils[_0x0164('0x13')](util[_0x0164('0x3')]('[%s][recordings][hangup]',_0x155f2d[_0x0164('0x5')]),_0x24ee5d);}};exports['newexten']=function(_0x5547ff){try{if(!_['isNil'](recordings[_0x5547ff['uniqueid']])){utils[_0x0164('0x15')](util[_0x0164('0x3')](_0x0164('0x2f'),_0x5547ff[_0x0164('0x5')]),_0x5547ff);utils[_0x0164('0x2')](util[_0x0164('0x3')](_0x0164('0x30'),_0x5547ff[_0x0164('0x5')],_0x5547ff[_0x0164('0x31')],_0x5547ff['appdata']));if(_0x5547ff[_0x0164('0x31')][_0x0164('0x32')]()==_0x0164('0x33')&&_[_0x0164('0x34')](_0x5547ff[_0x0164('0x35')][_0x0164('0x32')](),_0x0164('0x36'))){var _0x48ed5c=_0x5547ff[_0x0164('0x35')]['split']('=');var _0x5cb0ca=_0x48ed5c[0x0][_0x0164('0x37')](_0x48ed5c[0x0][_0x0164('0x38')]('(')+0x1,_0x48ed5c[0x0][_0x0164('0x38')](')'));var _0x201b98=_0x48ed5c[0x1];recordings[_0x5547ff[_0x0164('0x5')]][_0x5cb0ca]=_0x201b98;}}}catch(_0x5ef5cb){utils[_0x0164('0x13')](util['format'](_0x0164('0x2f'),_0x5547ff[_0x0164('0x5')]),_0x5ef5cb);}};exports[_0x0164('0x39')]=function(_0xa67608){try{if(!_[_0x0164('0x17')](recordings[_0xa67608['uniqueid']])){utils[_0x0164('0x15')](util[_0x0164('0x3')](_0x0164('0x3a'),_0xa67608[_0x0164('0x5')]),_0xa67608);utils[_0x0164('0x2')](util[_0x0164('0x3')](_0x0164('0x3b'),_0xa67608[_0x0164('0x5')],_0xa67608[_0x0164('0x3c')]));recordings[_0xa67608[_0x0164('0x5')]][_0x0164('0x3c')]=_0xa67608[_0x0164('0x3c')];}}catch(_0x3aa4d6){utils[_0x0164('0x13')](util[_0x0164('0x3')]('[%s][recordings][queuecallerjoin]',_0xa67608[_0x0164('0x5')]),_0x3aa4d6);}}; \ No newline at end of file +var _0xab9e=['uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinename','type','connectedlinenum','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','./utils','info','format','[%s][recordings][writeDB]'];(function(_0x2b82be,_0x3991a2){var _0xdefcb5=function(_0x5a68a9){while(--_0x5a68a9){_0x2b82be['push'](_0x2b82be['shift']());}};_0xdefcb5(++_0x3991a2);}(_0xab9e,0x181));var _0xeab9=function(_0x298825,_0x519160){_0x298825=_0x298825-0x0;var _0xe62c7a=_0xab9e[_0x298825];return _0xe62c7a;};'use strict';var _=require(_0xeab9('0x0'));var util=require('util');var utils=require(_0xeab9('0x1'));var recordings={};function writeDB(_0x4f9e07){utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x4'),_0x4f9e07[_0xeab9('0x5')]));if(_0x4f9e07[_0xeab9('0x6')]){utils[_0xeab9('0x7')](_0x4f9e07['accountcode'])[_0xeab9('0x8')](function(_0x4846c6){if(_0x4846c6){_0x4f9e07[_0xeab9('0x9')]=_0x4846c6[_0xeab9('0xa')];_0x4f9e07[_0xeab9('0xb')]=_0x4846c6['id'];}utils[_0xeab9('0xc')](_0xeab9('0xd'),_0x4f9e07);});}else{utils[_0xeab9('0xc')](_0xeab9('0xd'),_0x4f9e07);}}exports[_0xeab9('0xe')]=function(_0x14ca9e){try{utils[_0xeab9('0xf')](util['format'](_0xeab9('0x10'),_0x14ca9e[_0xeab9('0x5')]),_0x14ca9e);if(_0x14ca9e[_0xeab9('0x5')]==_0x14ca9e[_0xeab9('0x11')]){utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x12'),_0x14ca9e[_0xeab9('0x5')],_0x14ca9e[_0xeab9('0x13')],_0x14ca9e[_0xeab9('0x14')]));recordings[_0x14ca9e[_0xeab9('0x5')]]={'uniqueid':_0x14ca9e[_0xeab9('0x5')],'accountcode':_0x14ca9e[_0xeab9('0x6')],'exten':_0x14ca9e[_0xeab9('0x14')],'context':_0x14ca9e['context'],'channel':_0x14ca9e['channel'],'monitors':[]};}}catch(_0x2ddc51){utils[_0xeab9('0x15')](util[_0xeab9('0x3')]('[%s][recordings][newchannel]',_0x14ca9e[_0xeab9('0x5')]),_0x2ddc51);}};exports[_0xeab9('0x16')]=function(_0x318b79){try{utils['debug'](util[_0xeab9('0x3')](_0xeab9('0x17'),_0x318b79[_0xeab9('0x5')]),_0x318b79);if(!_[_0xeab9('0x18')](recordings[_0x318b79[_0xeab9('0x5')]])&&_0x318b79[_0xeab9('0x19')]==0x6){utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x1a'),_0x318b79[_0xeab9('0x5')],_0x318b79[_0xeab9('0x13')],_0x318b79[_0xeab9('0x1b')]));}else if(!_['isNil'](recordings[_0x318b79[_0xeab9('0x11')]])&&_0x318b79[_0xeab9('0x19')]==0x6&&_0x318b79[_0xeab9('0x13')]!=_0xeab9('0x1c')){utils[_0xeab9('0x2')](util['format'](_0xeab9('0x1d'),_0x318b79[_0xeab9('0x5')],_0x318b79[_0xeab9('0x11')],_0x318b79[_0xeab9('0x13')],_0x318b79['channel']));recordings[_0x318b79[_0xeab9('0x11')]][_0xeab9('0x6')]=_0x318b79['accountcode'];}}catch(_0x1602de){utils[_0xeab9('0x15')](util[_0xeab9('0x3')]('[%s][recordings][newstate]',_0x318b79['uniqueid']),_0x1602de);}};exports[_0xeab9('0x1e')]=function(_0x413b35){try{if(!_['isNil'](_0x413b35[_0xeab9('0x1f')])&&!_[_0xeab9('0x18')](_0x413b35[_0xeab9('0x1f')][_0xeab9('0x20')])){utils['debug'](util[_0xeab9('0x3')](_0xeab9('0x21'),_0x413b35[_0xeab9('0x5')]),_0x413b35);utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x22'),_0x413b35['uniqueid'],_0x413b35[_0xeab9('0x1f')],_0x413b35[_0xeab9('0x23')]));if(_[_0xeab9('0x24')](_0x413b35[_0xeab9('0x23')],'.wav49')){_0x413b35[_0xeab9('0x23')]=_0x413b35[_0xeab9('0x23')]['replace'](_0xeab9('0x25'),_0xeab9('0x26'));}if(recordings[_0x413b35[_0xeab9('0x11')]]){var _0x54a964=_[_0xeab9('0x27')](recordings[_0x413b35[_0xeab9('0x11')]]['monitors'],{'value':_0x413b35[_0xeab9('0x23')]});if(_[_0xeab9('0x18')](_0x54a964)){recordings[_0x413b35[_0xeab9('0x11')]][_0xeab9('0x28')]['push']({'value':_0x413b35[_0xeab9('0x23')]});}}}}catch(_0x45b0f2){utils['error'](util[_0xeab9('0x3')]('[%s][recordings][varset]',_0x413b35['uniqueid']),_0x45b0f2);}};exports[_0xeab9('0x29')]=function(_0x11fd3f){try{if(!_[_0xeab9('0x18')](recordings[_0x11fd3f[_0xeab9('0x5')]])){utils[_0xeab9('0xf')](util['format'](_0xeab9('0x2a'),_0x11fd3f[_0xeab9('0x5')]),_0x11fd3f);utils['info'](util[_0xeab9('0x3')](_0xeab9('0x2b'),_0x11fd3f[_0xeab9('0x5')],_0x11fd3f['calleridnum'],_0x11fd3f[_0xeab9('0x2c')],_0x11fd3f[_0xeab9('0x2d')]));recordings[_0x11fd3f['uniqueid']][_0xeab9('0x2e')]=_0x11fd3f[_0xeab9('0x2e')];recordings[_0x11fd3f[_0xeab9('0x5')]]['calleridname']=_0x11fd3f[_0xeab9('0x2c')];recordings[_0x11fd3f[_0xeab9('0x5')]]['connectedlinenum']=_0x11fd3f['connectedlinenum'];recordings[_0x11fd3f[_0xeab9('0x5')]]['connectedlinename']=_0x11fd3f[_0xeab9('0x2f')];if(recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x30')]=='outbound'&&recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x6')]){recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x31')]=recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x6')];recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x2f')]='';}recordings[_0x11fd3f[_0xeab9('0x5')]][_0xeab9('0x28')]['forEach'](function(_0x5704fd){var _0x8f705=_[_0xeab9('0x32')](recordings[_0x11fd3f[_0xeab9('0x5')]]);_0x8f705[_0xeab9('0x23')]=_0x5704fd['value'];writeDB(_0x8f705);});delete recordings[_0x11fd3f[_0xeab9('0x5')]];}}catch(_0x58ebb7){utils['error'](util[_0xeab9('0x3')]('[%s][recordings][hangup]',_0x11fd3f[_0xeab9('0x5')]),_0x58ebb7);}};exports['newexten']=function(_0x51a875){try{if(!_['isNil'](recordings[_0x51a875[_0xeab9('0x5')]])){utils['debug'](util[_0xeab9('0x3')](_0xeab9('0x33'),_0x51a875[_0xeab9('0x5')]),_0x51a875);utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x34'),_0x51a875['uniqueid'],_0x51a875['application'],_0x51a875[_0xeab9('0x35')]));if(_0x51a875[_0xeab9('0x36')]['toLowerCase']()==_0xeab9('0x37')&&_[_0xeab9('0x38')](_0x51a875[_0xeab9('0x35')][_0xeab9('0x39')](),_0xeab9('0x3a'))){var _0x20d2d0=_0x51a875['appdata']['split']('=');var _0x36d9a7=_0x20d2d0[0x0][_0xeab9('0x3b')](_0x20d2d0[0x0]['lastIndexOf']('(')+0x1,_0x20d2d0[0x0][_0xeab9('0x3c')](')'));var _0x52b5fb=_0x20d2d0[0x1];recordings[_0x51a875[_0xeab9('0x5')]][_0x36d9a7]=_0x52b5fb;}}}catch(_0x21d6a5){utils[_0xeab9('0x15')](util[_0xeab9('0x3')](_0xeab9('0x33'),_0x51a875[_0xeab9('0x5')]),_0x21d6a5);}};exports[_0xeab9('0x3d')]=function(_0x213abb){try{if(!_[_0xeab9('0x18')](recordings[_0x213abb[_0xeab9('0x5')]])){utils[_0xeab9('0xf')](util[_0xeab9('0x3')]('[%s][recordings][queuecallerjoin]',_0x213abb[_0xeab9('0x5')]),_0x213abb);utils[_0xeab9('0x2')](util[_0xeab9('0x3')](_0xeab9('0x3e'),_0x213abb[_0xeab9('0x5')],_0x213abb[_0xeab9('0x3f')]));recordings[_0x213abb[_0xeab9('0x5')]][_0xeab9('0x3f')]=_0x213abb[_0xeab9('0x3f')];}}catch(_0x9c213b){utils[_0xeab9('0x15')](util[_0xeab9('0x3')](_0xeab9('0x40'),_0x213abb[_0xeab9('0x5')]),_0x9c213b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a619a26..12162c3 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 _0xe07a=['transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xe07a,0x1b5));var _0xae07=function(_0x6320fb,_0x589bc4){_0x6320fb=_0x6320fb-0x0;var _0x116a70=_0xe07a[_0x6320fb];return _0x116a70;};'use strict';var _=require('lodash');var util=require(_0xae07('0x0'));var utils=require(_0xae07('0x1'));function writeDB(_0x3036b5){utils['info'](util[_0xae07('0x2')](_0xae07('0x3'),_0x3036b5[_0xae07('0x4')]===_0xae07('0x5')?_0x3036b5[_0xae07('0x6')]:_0x3036b5[_0xae07('0x7')],_0x3036b5['type']));utils['request'](_0xae07('0x8'),_0x3036b5);}exports[_0xae07('0x9')]=function(_0x28a541){try{utils[_0xae07('0xa')](util['format'](_0xae07('0xb'),_0x28a541[_0xae07('0x7')]),_0x28a541);utils[_0xae07('0xc')](util[_0xae07('0x2')](_0xae07('0xd'),_0x28a541['uniqueid'],_0x28a541[_0xae07('0xe')],_0x28a541['transferercalleridname'],_0x28a541[_0xae07('0xf')],_0x28a541[_0xae07('0x10')]));_0x28a541[_0xae07('0x4')]=_0xae07('0x11');writeDB(_0x28a541);}catch(_0x16c03e){utils[_0xae07('0x12')](util[_0xae07('0x2')](_0xae07('0xb'),_0x28a541[_0xae07('0x7')]),_0x16c03e);}};exports['attendedtransfer']=function(_0x54cda1){try{utils[_0xae07('0xa')](util['format'](_0xae07('0x13'),_0x54cda1['origtransfereruniqueid']),_0x54cda1);utils['info'](util[_0xae07('0x2')](_0xae07('0x14'),_0x54cda1['origtransfereruniqueid'],_0x54cda1[_0xae07('0x15')],_0x54cda1[_0xae07('0x16')],_0x54cda1[_0xae07('0x17')],_0x54cda1[_0xae07('0x18')]));_0x54cda1=_['assign'](_0x54cda1,{'transfererchannel':_0x54cda1[_0xae07('0x19')],'transferercalleridnum':_0x54cda1[_0xae07('0x15')],'transferercalleridname':_0x54cda1[_0xae07('0x16')],'transfererconnectedlinenum':_0x54cda1[_0xae07('0x1a')],'transfererconnectedlinename':_0x54cda1[_0xae07('0x1b')],'transfereraccountcode':_0x54cda1[_0xae07('0x1c')],'transferercontext':_0x54cda1[_0xae07('0x1d')],'transfererexten':_0x54cda1[_0xae07('0x1e')],'transfererlinkedid':_0x54cda1[_0xae07('0x1f')],'context':_0x54cda1[_0xae07('0x20')],'extension':_0x54cda1[_0xae07('0x21')],'type':_0xae07('0x5')});if(_[_0xae07('0x22')](_0x54cda1['transfereechannel'])){_0x54cda1=_[_0xae07('0x23')](_0x54cda1,{'transfereechannel':_0x54cda1[_0xae07('0x24')],'transfereecalleridnum':_0x54cda1[_0xae07('0x17')],'transfereecalleridname':_0x54cda1['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x54cda1[_0xae07('0x25')],'transfereeconnectedlinename':_0x54cda1[_0xae07('0x26')],'transfereeaccountcode':_0x54cda1['transfertargetaccountcode'],'transfereecontext':_0x54cda1[_0xae07('0x27')],'transfereeexten':_0x54cda1['transfertargetexten'],'transfereelinkedid':_0x54cda1[_0xae07('0x28')]});}writeDB(_0x54cda1);}catch(_0x16d179){utils[_0xae07('0x12')](util['format'](_0xae07('0x13'),_0x54cda1[_0xae07('0x6')]),_0x16d179);}}; \ No newline at end of file +var _0x4464=['secondtransfererexten','origtransferercontext','attended','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext'];(function(_0x3de2eb,_0x28c2e0){var _0x5ad88f=function(_0x521d5d){while(--_0x521d5d){_0x3de2eb['push'](_0x3de2eb['shift']());}};_0x5ad88f(++_0x28c2e0);}(_0x4464,0xed));var _0x4446=function(_0x5b4f6b,_0x5cda30){_0x5b4f6b=_0x5b4f6b-0x0;var _0x39f333=_0x4464[_0x5b4f6b];return _0x39f333;};'use strict';var _=require(_0x4446('0x0'));var util=require(_0x4446('0x1'));var utils=require(_0x4446('0x2'));function writeDB(_0x598ae3){utils[_0x4446('0x3')](util[_0x4446('0x4')](_0x4446('0x5'),_0x598ae3[_0x4446('0x6')]==='attended'?_0x598ae3['origtransfereruniqueid']:_0x598ae3[_0x4446('0x7')],_0x598ae3['type']));utils[_0x4446('0x8')](_0x4446('0x9'),_0x598ae3);}exports['blindtransfer']=function(_0x5c3753){try{utils[_0x4446('0xa')](util[_0x4446('0x4')](_0x4446('0xb'),_0x5c3753[_0x4446('0x7')]),_0x5c3753);utils['info'](util[_0x4446('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5c3753[_0x4446('0x7')],_0x5c3753[_0x4446('0xc')],_0x5c3753[_0x4446('0xd')],_0x5c3753[_0x4446('0xe')],_0x5c3753[_0x4446('0xf')]));_0x5c3753[_0x4446('0x6')]='blind';writeDB(_0x5c3753);}catch(_0x347a4e){utils[_0x4446('0x10')](util[_0x4446('0x4')]('[%s][transfers][blindtransfer]',_0x5c3753[_0x4446('0x7')]),_0x347a4e);}};exports[_0x4446('0x11')]=function(_0x809d46){try{utils['debug'](util['format'](_0x4446('0x12'),_0x809d46[_0x4446('0x13')]),_0x809d46);utils[_0x4446('0x3')](util[_0x4446('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x809d46[_0x4446('0x13')],_0x809d46[_0x4446('0x14')],_0x809d46[_0x4446('0x15')],_0x809d46[_0x4446('0x16')],_0x809d46[_0x4446('0x17')]));_0x809d46=_[_0x4446('0x18')](_0x809d46,{'transfererchannel':_0x809d46[_0x4446('0x19')],'transferercalleridnum':_0x809d46[_0x4446('0x14')],'transferercalleridname':_0x809d46[_0x4446('0x15')],'transfererconnectedlinenum':_0x809d46[_0x4446('0x1a')],'transfererconnectedlinename':_0x809d46[_0x4446('0x1b')],'transfereraccountcode':_0x809d46['origtransfereraccountcode'],'transferercontext':_0x809d46[_0x4446('0x1c')],'transfererexten':_0x809d46[_0x4446('0x1d')],'transfererlinkedid':_0x809d46['origtransfererlinkedid'],'context':_0x809d46[_0x4446('0x1e')],'extension':_0x809d46['origtransfererexten'],'type':_0x4446('0x1f')});if(_['isNil'](_0x809d46['transfereechannel'])){_0x809d46=_[_0x4446('0x18')](_0x809d46,{'transfereechannel':_0x809d46[_0x4446('0x20')],'transfereecalleridnum':_0x809d46[_0x4446('0x16')],'transfereecalleridname':_0x809d46['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x809d46['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x809d46[_0x4446('0x21')],'transfereeaccountcode':_0x809d46[_0x4446('0x22')],'transfereecontext':_0x809d46[_0x4446('0x23')],'transfereeexten':_0x809d46[_0x4446('0x24')],'transfereelinkedid':_0x809d46[_0x4446('0x25')]});}writeDB(_0x809d46);}catch(_0x2237b1){utils[_0x4446('0x10')](util[_0x4446('0x4')]('[%s][transfers][attendedtransfer]',_0x809d46['origtransfereruniqueid']),_0x2237b1);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 096ffbd..ae16e86 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 _0x9539=['diff','seconds','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract'];(function(_0x275a6a,_0x5eafab){var _0x9702b1=function(_0x335e6b){while(--_0x335e6b){_0x275a6a['push'](_0x275a6a['shift']());}};_0x9702b1(++_0x5eafab);}(_0x9539,0x176));var _0x9953=function(_0x586342,_0x661846){_0x586342=_0x586342-0x0;var _0x3e40bb=_0x9539[_0x586342];return _0x3e40bb;};'use strict';var BPromise=require(_0x9953('0x0'));var jayson=require(_0x9953('0x1'));var moment=require(_0x9953('0x2'));var util=require(_0x9953('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x9953('0x4'))(_0x9953('0x5'));exports[_0x9953('0x6')]=function(_0x1f3329,_0x6a116d){logger['info'](_0x1f3329,_0x6a116d?util[_0x9953('0x7')](_0x6a116d,{'showHidden':![],'depth':null}):'');};exports[_0x9953('0x8')]=function(_0x4cb778,_0x2cf96f){logger[_0x9953('0x8')](_0x4cb778,_0x2cf96f?util[_0x9953('0x7')](_0x2cf96f,{'showHidden':![],'depth':null}):'');};exports[_0x9953('0x9')]=function(_0x3b3b8d,_0x13e698){logger[_0x9953('0x9')](_0x3b3b8d,_0x13e698?util[_0x9953('0x7')](_0x13e698,{'showHidden':![],'depth':null}):'');};exports[_0x9953('0xa')]=function(_0x1bd06e,_0x2bcebd){return client['request'](_0x1bd06e,{'body':_0x2bcebd})[_0x9953('0xb')](function(_0x18053b){logger[_0x9953('0x8')](_0x9953('0xc'),_0x1bd06e,_0x18053b?util[_0x9953('0x7')](_0x18053b,{'showHidden':![],'depth':null}):'');})[_0x9953('0xd')](function(_0x3d3c0e){logger[_0x9953('0x9')](_0x9953('0xc'),_0x1bd06e,_0x3d3c0e?util[_0x9953('0x7')](_0x3d3c0e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x17539b){return client[_0x9953('0xa')](_0x9953('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9953('0xf'),_0x9953('0x10'),_0x9953('0x11')],'where':_0x17539b,'limit':0x1}})[_0x9953('0xb')](function(_0x4d4633){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x9953('0x12')](_0x17539b),_0x4d4633?util['inspect'](_0x4d4633,{'showHidden':![],'depth':null}):'');return _0x4d4633[_0x9953('0x13')]['length']?_0x4d4633[_0x9953('0x13')][0x0]:null;});}exports[_0x9953('0x14')]=function(_0x1f8712){return new BPromise(function(_0x37435f,_0x35912d){if(_0x1f8712){return getUser({'internal':_0x1f8712})['then'](function(_0x3986f0){logger[_0x9953('0x6')](_0x9953('0x15'),_0x1f8712,_0x3986f0?_0x9953('0x16'):_0x9953('0x17'));return _0x37435f(_0x3986f0);})[_0x9953('0xd')](function(_0x3c15c7){logger[_0x9953('0x9')](_0x9953('0x18'),_0x3c15c7?util[_0x9953('0x7')](_0x3c15c7,{'showHidden':![],'depth':null}):'');return _0x37435f(null);});}return _0x37435f(null);});};exports[_0x9953('0x19')]=function(_0x3b709b){return new BPromise(function(_0x4958b0,_0x6ce2d1){if(_0x3b709b){return getUser({'interface':_0x3b709b})[_0x9953('0xb')](function(_0x2dd917){logger[_0x9953('0x6')](_0x9953('0x1a'),_0x3b709b,_0x2dd917?_0x9953('0x16'):_0x9953('0x17'));return _0x4958b0(_0x2dd917);})[_0x9953('0xd')](function(_0x16a448){logger[_0x9953('0x9')](_0x9953('0x1b'),_0x16a448?util['inspect'](_0x16a448,{'showHidden':![],'depth':null}):'');return _0x4958b0(null);});}return _0x4958b0(null);});};exports[_0x9953('0x1c')]=function(_0x4f5913){return new BPromise(function(_0xadf74d,_0x31f999){if(_0x4f5913){return getUser({'name':_0x4f5913})[_0x9953('0xb')](function(_0x4b4692){logger[_0x9953('0x6')](_0x9953('0x1d'),_0x4f5913,_0x4b4692?_0x9953('0x16'):_0x9953('0x17'));return _0xadf74d(_0x4b4692);})[_0x9953('0xd')](function(_0x986a28){logger[_0x9953('0x9')](_0x9953('0x1e'),_0x986a28?util[_0x9953('0x7')](_0x986a28,{'showHidden':![],'depth':null}):'');return _0xadf74d(null);});}return _0xadf74d(null);});};exports['getVoiceQueueByName']=function(_0x48c818){return new BPromise(function(_0x578308,_0x38e491){if(_0x48c818){return client['request'](_0x9953('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x9953('0x10'),_0x9953('0x20'),'acw','acwTimeout'],'where':{'name':_0x48c818},'limit':0x1}})['then'](function(_0x3d30da){logger[_0x9953('0x8')](_0x9953('0x21'),_0x48c818,_0x3d30da?util['inspect'](_0x3d30da,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x48c818,_0x3d30da?_0x9953('0x16'):'notfound');return _0x578308(_0x3d30da[_0x9953('0x13')]['length']?_0x3d30da[_0x9953('0x13')][0x0]:null);})[_0x9953('0xd')](function(_0x2ed97c){logger[_0x9953('0x9')](_0x9953('0x22'),_0x2ed97c?util['inspect'](_0x2ed97c,{'showHidden':![],'depth':null}):'');return _0x578308(null);});}return _0x578308(null);});};exports[_0x9953('0x23')]=function(_0x294f5c,_0x546e9c){return moment(_0x294f5c)['add'](_0x546e9c,'seconds')[_0x9953('0x24')](_0x9953('0x25'));};exports[_0x9953('0x26')]=function(_0x1269ae,_0x3eac12){return moment(_0x1269ae)[_0x9953('0x27')](_0x3eac12,'seconds')[_0x9953('0x24')](_0x9953('0x25'));};exports['diffTime']=function(_0x55895f,_0x5e88e3){return moment(_0x55895f)[_0x9953('0x28')](moment(_0x5e88e3),_0x9953('0x29'));};exports[_0x9953('0x2a')]=function(_0x40400d,_0x27c95d){return parseInt(_0x40400d,0xa)+parseInt(_0x27c95d,0xa);};exports[_0x9953('0x2b')]=function(){return moment()[_0x9953('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9953('0x2c')]=function(_0x36a2f8,_0x5d7479){if(_0x5d7479){return moment(_0x36a2f8)['isAfter'](_0x5d7479);}return!![];};exports[_0x9953('0x2d')]=function(_0x414600,_0x17153e){if(_0x17153e){return moment(_0x414600)[_0x9953('0x2d')](_0x17153e);}else if(_0x414600){return!![];}return![];}; \ No newline at end of file +var _0x6de6=['request','then','[utils][request]\x20name:%s','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','format','diffTime','diff','sumTime','now','isAfter','bluebird','moment','util','client','http','../../config/logger','info','inspect','debug','error'];(function(_0x3bdf8d,_0x2ba114){var _0x31717a=function(_0x1baf4b){while(--_0x1baf4b){_0x3bdf8d['push'](_0x3bdf8d['shift']());}};_0x31717a(++_0x2ba114);}(_0x6de6,0x19d));var _0x66de=function(_0xa521cb,_0x274e3e){_0xa521cb=_0xa521cb-0x0;var _0x159b3d=_0x6de6[_0xa521cb];return _0x159b3d;};'use strict';var BPromise=require(_0x66de('0x0'));var jayson=require('jayson/promise');var moment=require(_0x66de('0x1'));var util=require(_0x66de('0x2'));var client=jayson[_0x66de('0x3')][_0x66de('0x4')]({'port':0x2329});var logger=require(_0x66de('0x5'))('xdr');exports['info']=function(_0x574044,_0x103c4c){logger[_0x66de('0x6')](_0x574044,_0x103c4c?util[_0x66de('0x7')](_0x103c4c,{'showHidden':![],'depth':null}):'');};exports[_0x66de('0x8')]=function(_0x13e275,_0x25b8d6){logger[_0x66de('0x8')](_0x13e275,_0x25b8d6?util[_0x66de('0x7')](_0x25b8d6,{'showHidden':![],'depth':null}):'');};exports[_0x66de('0x9')]=function(_0x287ca0,_0x1007a2){logger['error'](_0x287ca0,_0x1007a2?util['inspect'](_0x1007a2,{'showHidden':![],'depth':null}):'');};exports[_0x66de('0xa')]=function(_0x3fba36,_0x38a905){return client[_0x66de('0xa')](_0x3fba36,{'body':_0x38a905})[_0x66de('0xb')](function(_0x56c983){logger[_0x66de('0x8')](_0x66de('0xc'),_0x3fba36,_0x56c983?util[_0x66de('0x7')](_0x56c983,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x858305){logger['error'](_0x66de('0xc'),_0x3fba36,_0x858305?util[_0x66de('0x7')](_0x858305,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e9f6c){return client[_0x66de('0xa')](_0x66de('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x66de('0xe'),_0x66de('0xf')],'where':_0x5e9f6c,'limit':0x1}})['then'](function(_0x58a32d){logger[_0x66de('0x8')](_0x66de('0x10'),JSON[_0x66de('0x11')](_0x5e9f6c),_0x58a32d?util[_0x66de('0x7')](_0x58a32d,{'showHidden':![],'depth':null}):'');return _0x58a32d['result'][_0x66de('0x12')]?_0x58a32d[_0x66de('0x13')][0x0]:null;});}exports[_0x66de('0x14')]=function(_0x11a589){return new BPromise(function(_0x2786d5,_0x171177){if(_0x11a589){return getUser({'internal':_0x11a589})[_0x66de('0xb')](function(_0x92865c){logger[_0x66de('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x11a589,_0x92865c?_0x66de('0x15'):_0x66de('0x16'));return _0x2786d5(_0x92865c);})[_0x66de('0x17')](function(_0x2f86c4){logger[_0x66de('0x9')](_0x66de('0x18'),_0x2f86c4?util[_0x66de('0x7')](_0x2f86c4,{'showHidden':![],'depth':null}):'');return _0x2786d5(null);});}return _0x2786d5(null);});};exports[_0x66de('0x19')]=function(_0x736ba6){return new BPromise(function(_0x2c6b42,_0x533d54){if(_0x736ba6){return getUser({'interface':_0x736ba6})['then'](function(_0x40f7de){logger[_0x66de('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x736ba6,_0x40f7de?_0x66de('0x15'):_0x66de('0x16'));return _0x2c6b42(_0x40f7de);})[_0x66de('0x17')](function(_0x42769c){logger[_0x66de('0x9')](_0x66de('0x1a'),_0x42769c?util['inspect'](_0x42769c,{'showHidden':![],'depth':null}):'');return _0x2c6b42(null);});}return _0x2c6b42(null);});};exports[_0x66de('0x1b')]=function(_0x331626){return new BPromise(function(_0x54d385,_0x49389b){if(_0x331626){return getUser({'name':_0x331626})[_0x66de('0xb')](function(_0x5e0c2c){logger['info'](_0x66de('0x1c'),_0x331626,_0x5e0c2c?_0x66de('0x15'):_0x66de('0x16'));return _0x54d385(_0x5e0c2c);})[_0x66de('0x17')](function(_0xcb0670){logger[_0x66de('0x9')]('[utils][getUserByName]',_0xcb0670?util[_0x66de('0x7')](_0xcb0670,{'showHidden':![],'depth':null}):'');return _0x54d385(null);});}return _0x54d385(null);});};exports[_0x66de('0x1d')]=function(_0x5c7e00){return new BPromise(function(_0x3b4b23,_0x19f71a){if(_0x5c7e00){return client[_0x66de('0xa')](_0x66de('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x66de('0xe'),_0x66de('0x1f'),_0x66de('0x20'),_0x66de('0x21')],'where':{'name':_0x5c7e00},'limit':0x1}})[_0x66de('0xb')](function(_0x351e9e){logger[_0x66de('0x8')](_0x66de('0x22'),_0x5c7e00,_0x351e9e?util[_0x66de('0x7')](_0x351e9e,{'showHidden':![],'depth':null}):'');logger[_0x66de('0x6')](_0x66de('0x23'),_0x5c7e00,_0x351e9e?_0x66de('0x15'):_0x66de('0x16'));return _0x3b4b23(_0x351e9e[_0x66de('0x13')][_0x66de('0x12')]?_0x351e9e[_0x66de('0x13')][0x0]:null);})[_0x66de('0x17')](function(_0x51d972){logger[_0x66de('0x9')](_0x66de('0x24'),_0x51d972?util[_0x66de('0x7')](_0x51d972,{'showHidden':![],'depth':null}):'');return _0x3b4b23(null);});}return _0x3b4b23(null);});};exports[_0x66de('0x25')]=function(_0x2936dc,_0x4cedf6){return moment(_0x2936dc)[_0x66de('0x26')](_0x4cedf6,_0x66de('0x27'))['format'](_0x66de('0x28'));};exports['subtractTime']=function(_0x1f9d8c,_0x4cb1ef){return moment(_0x1f9d8c)['subtract'](_0x4cb1ef,_0x66de('0x27'))[_0x66de('0x29')](_0x66de('0x28'));};exports[_0x66de('0x2a')]=function(_0x1c0029,_0x1963f4){return moment(_0x1c0029)[_0x66de('0x2b')](moment(_0x1963f4),_0x66de('0x27'));};exports[_0x66de('0x2c')]=function(_0x41346c,_0x1c61f8){return parseInt(_0x41346c,0xa)+parseInt(_0x1c61f8,0xa);};exports[_0x66de('0x2d')]=function(){return moment()['format'](_0x66de('0x28'));};exports[_0x66de('0x2e')]=function(_0x515d12,_0x1f4f59){if(_0x1f4f59){return moment(_0x515d12)[_0x66de('0x2e')](_0x1f4f59);}return!![];};exports['isBefore']=function(_0x366463,_0x5405a1){if(_0x5405a1){return moment(_0x366463)['isBefore'](_0x5405a1);}else if(_0x366463){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 3dd9fd3..9e65857 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 _0xd96f=['format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','agent_id','agent_name','setupLoggers','lodash','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','ensureDir','catch','user','then','data','timestamp','error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s'];(function(_0x43b64a,_0x7d8e2a){var _0x8c4c80=function(_0x4bf169){while(--_0x4bf169){_0x43b64a['push'](_0x43b64a['shift']());}};_0x8c4c80(++_0x7d8e2a);}(_0xd96f,0x6a));var _0xfd96=function(_0x1018e0,_0x1358ac){_0x1018e0=_0x1018e0-0x0;var _0x36557b=_0xd96f[_0x1018e0];return _0x36557b;};var fs=require('fs-extra');var _=require(_0xfd96('0x0'));var ewinston=require('express-winston');var path=require(_0xfd96('0x1'));var util=require('util');var fileLogger=require(_0xfd96('0x2'))[_0xfd96('0x3')];var safeTemplate=require(_0xfd96('0x4'))[_0xfd96('0x5')];var maskSensitiveData=require(_0xfd96('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x3587c2(_0xd6d455){var _0x348542=path[_0xfd96('0x7')](_0xfd96('0x8'),_0xfd96('0x9'),_0xfd96('0xa'));var _0x46bd2c=path[_0xfd96('0x7')](_0xfd96('0xb'),_0xd6d455[_0xfd96('0xc')]+'-'+_0xd6d455['name']);return fs[_0xfd96('0xd')](path[_0xfd96('0x7')](_0x348542,_0x46bd2c))['then'](function(){var _0x283c57=fileLogger('client',path['join'](_0x348542,_0x46bd2c));return _0x283c57;})[_0xfd96('0xe')](function(_0x97b98b){throw _0x97b98b;});}this['log']=function(_0x1a603d,_0x322655,_0x4bff15,_0x365876){return _0x3587c2(_0x1a603d[_0xfd96('0xf')])[_0xfd96('0x10')](function(_0x2f8925){var _0x19607e=_0x2f8925[_0x322655];return _0x19607e;})['then'](function(_0x5e062d){var _0x59e36b=_0x1a603d[_0xfd96('0xf')]?_0x1a603d[_0xfd96('0xf')]['id']:'no-user';var _0x9b4685=_0x365876[_0xfd96('0x11')];var _0x5d1c13=_0x365876[_0xfd96('0x12')];var _0x1e9342=new Date(Number(_0x5d1c13));return _0x5e062d(_0x59e36b,_0x1e9342,_0x4bff15,_0x9b4685);})[_0xfd96('0xe')](function(_0x3513fc){fileLogger(_0xfd96('0xb'))[_0xfd96('0x13')](_0x3513fc);});};}function setupLoggers(_0x1807db){return new Promise(function(_0x2a5dde){var _0x214d94=new ClientSideLogger();var _0x412c43=fileLogger(_0xfd96('0x14'));var _0x22a03d=fileLogger(_0xfd96('0x15'));_0x1807db[_0xfd96('0x16')](_0xfd96('0x17'),_0x214d94);_0x1807db['use'](ewinston[_0xfd96('0x18')]({'winstonInstance':_0x412c43,'meta':![],'statusLevels':!![],'msg':function(_0x597182,_0x46d409){var _0x35d419=_0xfd96('0x19');if(!_[_0xfd96('0x1a')](_0x597182[_0xfd96('0x1b')])){_0x35d419+=_0xfd96('0x1c');var _0x332e7c=_0x597182['body'];maskSensitiveData(_0x332e7c);}return safeTemplate(util[_0xfd96('0x1d')](_0x35d419,_0x597182[_0xfd96('0x1e')],_0x597182[_0xfd96('0x1f')][_0xfd96('0x20')]?_0x597182[_0xfd96('0x1f')]['x-forwarded-for']:_0x597182[_0xfd96('0x21')][_0xfd96('0x22')]||_0x597182['ip'],_0x597182['url'],_0x46d409[_0xfd96('0x23')],_0x46d409[_0xfd96('0x24')],_0x597182['user']?_0x597182['user']['id']:null,_0x597182[_0xfd96('0xf')]?_0x597182['user'][_0xfd96('0x25')]:null,_0x597182[_0xfd96('0xf')]?_0x597182[_0xfd96('0xf')][_0xfd96('0xc')]:null,_0x332e7c?util['inspect'](_0x332e7c,![],null):''));}}));_0x1807db['use'](ewinston[_0xfd96('0x18')]({'winstonInstance':_0x22a03d,'meta':![],'statusLevels':!![],'msg':function(_0x5858eb,_0x260ee7){var _0x989544=_0xfd96('0x26');if(_0x5858eb[_0xfd96('0x1b')]&&_0x5858eb[_0xfd96('0x1b')][_0xfd96('0x27')]&&_0x5858eb[_0xfd96('0x1b')]['agent_id']){_0x989544=_0xfd96('0x28');}return util[_0xfd96('0x1d')](_0x989544,_0x5858eb[_0xfd96('0x1e')],_0x5858eb[_0xfd96('0x1f')][_0xfd96('0x20')]?_0x5858eb[_0xfd96('0x1f')]['x-forwarded-for']:_0x5858eb[_0xfd96('0x21')][_0xfd96('0x22')]||_0x5858eb['ip'],_0x5858eb[_0xfd96('0x29')],_0x260ee7[_0xfd96('0x23')],_0x260ee7[_0xfd96('0x24')],_0x5858eb[_0xfd96('0xf')]?_0x5858eb['user']['id']:null,_0x5858eb['user']?_0x5858eb['user']['name']:null,_0x5858eb[_0xfd96('0xf')]?_0x5858eb['user'][_0xfd96('0xc')]:null,_0x5858eb[_0xfd96('0x1b')]&&_0x5858eb[_0xfd96('0x1b')]['device']?_0x5858eb[_0xfd96('0x1b')][_0xfd96('0x27')]:'other',_0x5858eb[_0xfd96('0x1b')]&&_0x5858eb['body']['agent_id']?_0x5858eb['body'][_0xfd96('0x2a')]:'',_0x5858eb['body']&&_0x5858eb['body'][_0xfd96('0x2b')]?_0x5858eb[_0xfd96('0x1b')][_0xfd96('0x2b')]:'');},'ignoreRoute':function(_0x241c70){var _0x2ecd24=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2ecd24['test'](_0x241c70['url']);}}));return _0x2a5dde();});}exports[_0xfd96('0x2c')]=setupLoggers; \ No newline at end of file +var _0x52d2=['x-forwarded-for','connection','url','statusCode','responseTime','inspect','logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_id','agent_name','test','setupLoggers','lodash','express-winston','path','./loggers','fileLogger','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','role','name','ensureDir','then','client','catch','user','no-user','data','timestamp','error','auth','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers'];(function(_0x1b3f44,_0x5cdb98){var _0xb6ff18=function(_0x16c78a){while(--_0x16c78a){_0x1b3f44['push'](_0x1b3f44['shift']());}};_0xb6ff18(++_0x5cdb98);}(_0x52d2,0x9c));var _0x252d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x52d2[_0x3dd15e];return _0x231fd0;};var fs=require('fs-extra');var _=require(_0x252d('0x0'));var ewinston=require(_0x252d('0x1'));var path=require(_0x252d('0x2'));var util=require('util');var fileLogger=require(_0x252d('0x3'))[_0x252d('0x4')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x252d('0x5'))[_0x252d('0x6')];function ClientSideLogger(){function _0x1f636a(_0x527462){var _0x5497f5=path['join'](_0x252d('0x7'),_0x252d('0x8'),_0x252d('0x9'));var _0x2d9951=path[_0x252d('0xa')]('client',_0x527462[_0x252d('0xb')]+'-'+_0x527462[_0x252d('0xc')]);return fs[_0x252d('0xd')](path[_0x252d('0xa')](_0x5497f5,_0x2d9951))[_0x252d('0xe')](function(){var _0x3c9747=fileLogger(_0x252d('0xf'),path['join'](_0x5497f5,_0x2d9951));return _0x3c9747;})[_0x252d('0x10')](function(_0x503a1f){throw _0x503a1f;});}this[_0x252d('0x8')]=function(_0x376362,_0x31c97c,_0x6d83b7,_0x2859d5){return _0x1f636a(_0x376362[_0x252d('0x11')])[_0x252d('0xe')](function(_0x4cc2a8){var _0x1b2153=_0x4cc2a8[_0x31c97c];return _0x1b2153;})[_0x252d('0xe')](function(_0x127324){var _0x1a35d8=_0x376362[_0x252d('0x11')]?_0x376362[_0x252d('0x11')]['id']:_0x252d('0x12');var _0x17c18a=_0x2859d5[_0x252d('0x13')];var _0x5917bf=_0x2859d5[_0x252d('0x14')];var _0x19cc3f=new Date(Number(_0x5917bf));return _0x127324(_0x1a35d8,_0x19cc3f,_0x6d83b7,_0x17c18a);})['catch'](function(_0x52d7b6){fileLogger(_0x252d('0xf'))[_0x252d('0x15')](_0x52d7b6);});};}function setupLoggers(_0x480ce2){return new Promise(function(_0x841f73){var _0x5d9b83=new ClientSideLogger();var _0x45af3d=fileLogger('api');var _0x2fe9e7=fileLogger(_0x252d('0x16'));_0x480ce2['set'](_0x252d('0x17'),_0x5d9b83);_0x480ce2[_0x252d('0x18')](ewinston['logger']({'winstonInstance':_0x45af3d,'meta':![],'statusLevels':!![],'msg':function(_0x15e2a5,_0x292428){var _0x261772=_0x252d('0x19');if(!_[_0x252d('0x1a')](_0x15e2a5[_0x252d('0x1b')])){_0x261772+=_0x252d('0x1c');var _0x16a10d=_0x15e2a5['body'];maskSensitiveData(_0x16a10d);}return safeTemplate(util[_0x252d('0x1d')](_0x261772,_0x15e2a5[_0x252d('0x1e')],_0x15e2a5[_0x252d('0x1f')][_0x252d('0x20')]?_0x15e2a5[_0x252d('0x1f')][_0x252d('0x20')]:_0x15e2a5[_0x252d('0x21')]['remoteAddress']||_0x15e2a5['ip'],_0x15e2a5[_0x252d('0x22')],_0x292428[_0x252d('0x23')],_0x292428[_0x252d('0x24')],_0x15e2a5[_0x252d('0x11')]?_0x15e2a5[_0x252d('0x11')]['id']:null,_0x15e2a5[_0x252d('0x11')]?_0x15e2a5[_0x252d('0x11')][_0x252d('0xc')]:null,_0x15e2a5[_0x252d('0x11')]?_0x15e2a5[_0x252d('0x11')][_0x252d('0xb')]:null,_0x16a10d?util[_0x252d('0x25')](_0x16a10d,![],null):''));}}));_0x480ce2['use'](ewinston[_0x252d('0x26')]({'winstonInstance':_0x2fe9e7,'meta':![],'statusLevels':!![],'msg':function(_0x16be3f,_0x378047){var _0xfab464='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x16be3f[_0x252d('0x1b')]&&_0x16be3f[_0x252d('0x1b')][_0x252d('0x27')]&&_0x16be3f[_0x252d('0x1b')]['agent_id']){_0xfab464=_0x252d('0x28');}return util[_0x252d('0x1d')](_0xfab464,_0x16be3f[_0x252d('0x1e')],_0x16be3f[_0x252d('0x1f')][_0x252d('0x20')]?_0x16be3f['headers'][_0x252d('0x20')]:_0x16be3f[_0x252d('0x21')][_0x252d('0x29')]||_0x16be3f['ip'],_0x16be3f[_0x252d('0x22')],_0x378047[_0x252d('0x23')],_0x378047[_0x252d('0x24')],_0x16be3f['user']?_0x16be3f[_0x252d('0x11')]['id']:null,_0x16be3f[_0x252d('0x11')]?_0x16be3f[_0x252d('0x11')][_0x252d('0xc')]:null,_0x16be3f[_0x252d('0x11')]?_0x16be3f['user']['role']:null,_0x16be3f[_0x252d('0x1b')]&&_0x16be3f['body'][_0x252d('0x27')]?_0x16be3f[_0x252d('0x1b')][_0x252d('0x27')]:_0x252d('0x2a'),_0x16be3f[_0x252d('0x1b')]&&_0x16be3f['body'][_0x252d('0x2b')]?_0x16be3f[_0x252d('0x1b')][_0x252d('0x2b')]:'',_0x16be3f[_0x252d('0x1b')]&&_0x16be3f['body'][_0x252d('0x2c')]?_0x16be3f[_0x252d('0x1b')][_0x252d('0x2c')]:'');},'ignoreRoute':function(_0x55b7f4){var _0x9ef668=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x9ef668[_0x252d('0x2d')](_0x55b7f4['url']);}}));return _0x841f73();});}exports[_0x252d('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 2bc9890..82719a2 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49e9=['map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','minutes','hours','isBefore','day','endOf','isBetween','timeCompare','format','ddd','date','daysInMonth','max','domCompare','MMM','monthCompare','guess','test','isMoment','split','padStart','length','lodash'];(function(_0x53adec,_0x471ca1){var _0x3a7fcf=function(_0x186aa8){while(--_0x186aa8){_0x53adec['push'](_0x53adec['shift']());}};_0x3a7fcf(++_0x471ca1);}(_0x49e9,0x1c7));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};var _=require(_0x949e('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x949e('0x1')](function(_0x2f048d){return _0x2f048d['source'];})[_0x949e('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x949e('0x3');var EINVALID_DATE=_0x949e('0x4');function throwIfDateNotValid(_0xc7e5c9){if(!_0xc7e5c9[_0x949e('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x43da39){var _0x2bca83=_0x43da39['split'](':')['map'](function(_0x2eeac7){return parseInt(_0x2eeac7,0xa);});var _0x20bf87=_0x2bca83[0x0];var _0x22e4d0=_0x2bca83[0x1];if(_0x20bf87<0x0||_0x20bf87>0x17||_0x22e4d0<0x0||_0x22e4d0>0x3b){throw new Error(EINVALID_DATE);}return[_0x20bf87,_0x22e4d0];}function circularDoWInterval(_0x3b6d5f,_0x2a0325){if(_0x3b6d5f===_0x2a0325){return[_0x3b6d5f];}else{var _0x1c8ee9=moment[_0x949e('0x6')]();moment[_0x949e('0x6')]('en');var _0x3d5d03=moment[_0x949e('0x7')]()[_0x949e('0x1')](function(_0x4ee423){return _0x4ee423[_0x949e('0x8')]();});moment[_0x949e('0x6')](_0x1c8ee9);var _0x3d47df=_0x3d5d03[_0x949e('0x9')](_0x3b6d5f);var _0x48c92c=_0x3d5d03[_0x949e('0x9')](_0x2a0325);if(_0x48c92c>_0x3d47df){return _0x3d5d03[_0x949e('0xa')](_0x3d47df,_0x48c92c+0x1);}else{var _0x2542c6=_0x3d5d03['slice'](0x0,_0x48c92c+0x1);var _0x14dc21=_0x3d5d03[_0x949e('0xa')](_0x3d47df);return _0x14dc21[_0x949e('0xb')](_0x2542c6);}}}module[_0x949e('0xc')][_0x949e('0xd')]=circularDoWInterval;function circularMonthInterval(_0x37f495,_0x51bd21){if(_0x37f495===_0x51bd21){return[_0x37f495];}else{var _0x5465e4=moment[_0x949e('0x6')]();moment[_0x949e('0x6')]('en');var _0x33a1bf=moment[_0x949e('0xe')]()[_0x949e('0x1')](function(_0x38b451){return _0x38b451[_0x949e('0x8')]();});moment[_0x949e('0x6')](_0x5465e4);var _0xed9e83=_0x33a1bf[_0x949e('0x9')](_0x37f495);var _0x377cb9=_0x33a1bf[_0x949e('0x9')](_0x51bd21);if(_0x377cb9>_0xed9e83){return _0x33a1bf[_0x949e('0xa')](_0xed9e83,_0x377cb9+0x1);}else{var _0x42119c=_0x33a1bf[_0x949e('0xa')](0x0,_0x377cb9+0x1);var _0x49cff5=_0x33a1bf['slice'](_0xed9e83);return _0x49cff5[_0x949e('0xb')](_0x42119c);}}}module[_0x949e('0xc')][_0x949e('0xf')]=circularMonthInterval;function parseDom(_0x7b5edf){var _0x43aeb7=parseInt(_0x7b5edf,0xa);if(_0x43aeb7<0x1||_0x43aeb7>0x1f){throw new Error(EINVALID_DATE);}return _0x43aeb7;}function timeCompare(_0x3accdb,_0x87413f,_0x323855){var _0x28518c=_0x3accdb[_0x949e('0x10')]();var _0x568bed=extractTime(_0x87413f);var _0x1dc1b2=_0x568bed[0x0];var _0x4ec73d=_0x568bed[0x1];var _0x301699=_0x3accdb[_0x949e('0x10')]()['hours'](_0x1dc1b2)[_0x949e('0x11')](_0x4ec73d);throwIfDateNotValid(_0x301699);var _0x154660=extractTime(_0x323855);var _0x103fb7=_0x154660[0x0];var _0x52d5bb=_0x154660[0x1];var _0x3861f5=_0x3accdb['clone']()[_0x949e('0x12')](_0x103fb7)['minutes'](_0x52d5bb);throwIfDateNotValid(_0x3861f5);if(_0x3861f5[_0x949e('0x13')](_0x301699)){var _0x4d37f6=_0x28518c['clone']()['startOf'](_0x949e('0x14'));var _0x5cc8e7=_0x28518c['clone']()[_0x949e('0x15')](_0x949e('0x14'));return _0x28518c[_0x949e('0x16')](_0x301699,_0x5cc8e7,undefined,'[]')||_0x28518c[_0x949e('0x16')](_0x4d37f6,_0x3861f5,undefined,'[]');}else{return _0x28518c[_0x949e('0x16')](_0x301699,_0x3861f5,undefined,'[]');}}module['exports'][_0x949e('0x17')]=timeCompare;function dowCompare(_0x3ee702,_0x22104b,_0x4865b6){var _0x1405df=_0x3ee702[_0x949e('0x6')]('en')[_0x949e('0x18')](_0x949e('0x19'))[_0x949e('0x8')]();return circularDoWInterval(_0x22104b,_0x4865b6)['includes'](_0x1405df);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x40646d,_0x4e3fdc,_0x165134){var _0x494f11=_0x40646d[_0x949e('0x1a')]();if(_0x4e3fdc===_0x165134){return _0x494f11===_0x4e3fdc;}else{var _0x1990d5=_0x40646d[_0x949e('0x1b')]();var _0x432b9d=_0x4e3fdc<_0x165134;let _0x489898=![];var _0x131661=0x0;var _0x3075a2=0x0;if(_0x432b9d){_0x131661=Math[_0x949e('0x1c')](0x1,_0x4e3fdc);_0x3075a2=Math['min'](_0x165134,_0x1990d5);_0x489898=_0x494f11>=_0x131661&&_0x494f11<=_0x3075a2;}else{_0x131661=Math['min'](_0x4e3fdc,_0x1990d5);_0x3075a2=Math[_0x949e('0x1c')](0x1,_0x165134);_0x489898=_0x494f11>=_0x131661||_0x494f11<=_0x3075a2;}return _0x489898;}}module[_0x949e('0xc')][_0x949e('0x1d')]=domCompare;function monthCompare(_0x2f5c9c,_0x74e1a3,_0x49b020){var _0x369f79=_0x2f5c9c[_0x949e('0x6')]('en')[_0x949e('0x18')](_0x949e('0x1e'))[_0x949e('0x8')]();return circularMonthInterval(_0x74e1a3,_0x49b020)['includes'](_0x369f79);}module[_0x949e('0xc')][_0x949e('0x1f')]=monthCompare;function iftime(_0x50ef1a,_0x4d7359=moment['tz'][_0x949e('0x20')](),_0x2beca7=moment()){if(!validateRx[_0x949e('0x21')](_0x50ef1a)){throw new Error(EINVALID_STRING);}else{var _0x3d714c=(moment[_0x949e('0x22')](_0x2beca7)?_0x2beca7['clone']():moment(_0x2beca7))['tz'](_0x4d7359)[_0x949e('0x6')]('en');throwIfDateNotValid(_0x3d714c);var _0x41152f=_0x50ef1a[_0x949e('0x23')](',');var _0xba64d3=_0x41152f[0x0];var _0x53a6e8=_0x41152f[0x1];var _0x1f6a72=_0x41152f[0x2];var _0x597f6f=_0x41152f[0x3];let _0xd93a26=!![];if(_0xba64d3!=='*'){var _0x1e4dd7=_0xba64d3[_0x949e('0x23')]('-');var _0x1448c1=_[_0x949e('0x24')](_0x1e4dd7[0x0],0x5,'0');var _0x30cff8=_0x1e4dd7[_0x949e('0x25')]===0x2?_[_0x949e('0x24')](_0x1e4dd7[0x1],0x5,'0'):_0x1448c1;_0xd93a26=timeCompare(_0x3d714c,_0x1448c1,_0x30cff8);}let _0x38110f=!![];if(_0x53a6e8!=='*'){var _0x33a1b1=_0x53a6e8[_0x949e('0x23')]('-');var _0x1ad20d=_0x33a1b1[0x0];var _0x1c3002=_0x33a1b1[_0x949e('0x25')]===0x2?_0x33a1b1[0x1]:_0x1ad20d;_0x38110f=dowCompare(_0x3d714c,_0x1ad20d,_0x1c3002);}let _0x6e9ed=!![];if(_0x1f6a72!=='*'){var _0x3ca5de=_0x1f6a72[_0x949e('0x23')]('-');var _0x3610f3=parseDom(_0x3ca5de[0x0]);var _0x4b3a71=_0x3ca5de[_0x949e('0x25')]===0x2?parseDom(_0x3ca5de[0x1]):_0x3610f3;_0x6e9ed=domCompare(_0x3d714c,_0x3610f3,_0x4b3a71);}let _0x37744f=!![];if(_0x597f6f!=='*'){var _0x210075=_0x597f6f[_0x949e('0x23')]('-');var _0x4f718e=_0x210075[0x0];var _0x43f953=_0x210075[_0x949e('0x25')]===0x2?_0x210075[0x1]:_0x210075[0x0];_0x37744f=monthCompare(_0x3d714c,_0x4f718e,_0x43f953);}return _0xd93a26&&_0x38110f&&_0x6e9ed&&_0x37744f;}}module[_0x949e('0xc')]['iftime']=iftime; \ No newline at end of file +var _0xbcbb=['timeCompare','ddd','includes','dowCompare','daysInMonth','max','min','domCompare','format','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','map','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','minutes','isBefore','day','isBetween'];(function(_0x301c2b,_0x436065){var _0x3353c3=function(_0x54ba30){while(--_0x54ba30){_0x301c2b['push'](_0x301c2b['shift']());}};_0x3353c3(++_0x436065);}(_0xbcbb,0x1b2));var _0xbbcb=function(_0x27e321,_0x222eb5){_0x27e321=_0x27e321-0x0;var _0x19ac6c=_0xbcbb[_0x27e321];return _0x19ac6c;};var _=require(_0xbbcb('0x0'));var moment=require(_0xbbcb('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x2a2986){return _0x2a2986['source'];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xbbcb('0x2');var EINVALID_DATE=_0xbbcb('0x3');function throwIfDateNotValid(_0x14db56){if(!_0x14db56[_0xbbcb('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x45b093){var _0x4b919d=_0x45b093[_0xbbcb('0x5')](':')['map'](function(_0x519522){return parseInt(_0x519522,0xa);});var _0x4ef10d=_0x4b919d[0x0];var _0x3d1e41=_0x4b919d[0x1];if(_0x4ef10d<0x0||_0x4ef10d>0x17||_0x3d1e41<0x0||_0x3d1e41>0x3b){throw new Error(EINVALID_DATE);}return[_0x4ef10d,_0x3d1e41];}function circularDoWInterval(_0x3666c9,_0x4b629a){if(_0x3666c9===_0x4b629a){return[_0x3666c9];}else{var _0x98e9b4=moment['locale']();moment[_0xbbcb('0x6')]('en');var _0x43d334=moment[_0xbbcb('0x7')]()[_0xbbcb('0x8')](function(_0x118729){return _0x118729[_0xbbcb('0x9')]();});moment['locale'](_0x98e9b4);var _0x1cf5d8=_0x43d334['indexOf'](_0x3666c9);var _0x3d7e04=_0x43d334[_0xbbcb('0xa')](_0x4b629a);if(_0x3d7e04>_0x1cf5d8){return _0x43d334[_0xbbcb('0xb')](_0x1cf5d8,_0x3d7e04+0x1);}else{var _0x5beb64=_0x43d334['slice'](0x0,_0x3d7e04+0x1);var _0x4bae39=_0x43d334[_0xbbcb('0xb')](_0x1cf5d8);return _0x4bae39[_0xbbcb('0xc')](_0x5beb64);}}}module[_0xbbcb('0xd')][_0xbbcb('0xe')]=circularDoWInterval;function circularMonthInterval(_0x4b80fa,_0x189f12){if(_0x4b80fa===_0x189f12){return[_0x4b80fa];}else{var _0xcae222=moment[_0xbbcb('0x6')]();moment['locale']('en');var _0x494b35=moment[_0xbbcb('0xf')]()[_0xbbcb('0x8')](function(_0x5d34bf){return _0x5d34bf[_0xbbcb('0x9')]();});moment[_0xbbcb('0x6')](_0xcae222);var _0x34ad18=_0x494b35['indexOf'](_0x4b80fa);var _0x2c66d=_0x494b35[_0xbbcb('0xa')](_0x189f12);if(_0x2c66d>_0x34ad18){return _0x494b35[_0xbbcb('0xb')](_0x34ad18,_0x2c66d+0x1);}else{var _0x31bdbc=_0x494b35[_0xbbcb('0xb')](0x0,_0x2c66d+0x1);var _0x34274f=_0x494b35['slice'](_0x34ad18);return _0x34274f['concat'](_0x31bdbc);}}}module[_0xbbcb('0xd')][_0xbbcb('0x10')]=circularMonthInterval;function parseDom(_0x5e0c38){var _0x107c6b=parseInt(_0x5e0c38,0xa);if(_0x107c6b<0x1||_0x107c6b>0x1f){throw new Error(EINVALID_DATE);}return _0x107c6b;}function timeCompare(_0x40a953,_0x5947ed,_0x1bde19){var _0x432cc7=_0x40a953[_0xbbcb('0x11')]();var _0x3c925d=extractTime(_0x5947ed);var _0x26fd18=_0x3c925d[0x0];var _0x362ce9=_0x3c925d[0x1];var _0x360a6c=_0x40a953[_0xbbcb('0x11')]()['hours'](_0x26fd18)['minutes'](_0x362ce9);throwIfDateNotValid(_0x360a6c);var _0x3ea6e1=extractTime(_0x1bde19);var _0x275275=_0x3ea6e1[0x0];var _0xb905df=_0x3ea6e1[0x1];var _0x193fb5=_0x40a953[_0xbbcb('0x11')]()['hours'](_0x275275)[_0xbbcb('0x12')](_0xb905df);throwIfDateNotValid(_0x193fb5);if(_0x193fb5[_0xbbcb('0x13')](_0x360a6c)){var _0x1ad8fc=_0x432cc7[_0xbbcb('0x11')]()['startOf'](_0xbbcb('0x14'));var _0x2444c5=_0x432cc7[_0xbbcb('0x11')]()['endOf'](_0xbbcb('0x14'));return _0x432cc7[_0xbbcb('0x15')](_0x360a6c,_0x2444c5,undefined,'[]')||_0x432cc7[_0xbbcb('0x15')](_0x1ad8fc,_0x193fb5,undefined,'[]');}else{return _0x432cc7[_0xbbcb('0x15')](_0x360a6c,_0x193fb5,undefined,'[]');}}module[_0xbbcb('0xd')][_0xbbcb('0x16')]=timeCompare;function dowCompare(_0xb94b2e,_0x2a3e9a,_0x1cfeee){var _0x4d5458=_0xb94b2e['locale']('en')['format'](_0xbbcb('0x17'))[_0xbbcb('0x9')]();return circularDoWInterval(_0x2a3e9a,_0x1cfeee)[_0xbbcb('0x18')](_0x4d5458);}module[_0xbbcb('0xd')][_0xbbcb('0x19')]=dowCompare;function domCompare(_0xb6a7a0,_0x1822a5,_0x1c3f0d){var _0x1de31a=_0xb6a7a0['date']();if(_0x1822a5===_0x1c3f0d){return _0x1de31a===_0x1822a5;}else{var _0x2f1136=_0xb6a7a0[_0xbbcb('0x1a')]();var _0x1904c0=_0x1822a5<_0x1c3f0d;let _0x2ff609=![];var _0x2b7289=0x0;var _0x3cbdd1=0x0;if(_0x1904c0){_0x2b7289=Math[_0xbbcb('0x1b')](0x1,_0x1822a5);_0x3cbdd1=Math[_0xbbcb('0x1c')](_0x1c3f0d,_0x2f1136);_0x2ff609=_0x1de31a>=_0x2b7289&&_0x1de31a<=_0x3cbdd1;}else{_0x2b7289=Math[_0xbbcb('0x1c')](_0x1822a5,_0x2f1136);_0x3cbdd1=Math[_0xbbcb('0x1b')](0x1,_0x1c3f0d);_0x2ff609=_0x1de31a>=_0x2b7289||_0x1de31a<=_0x3cbdd1;}return _0x2ff609;}}module[_0xbbcb('0xd')][_0xbbcb('0x1d')]=domCompare;function monthCompare(_0x44a75c,_0xc6243e,_0x5dd3b8){var _0x498b12=_0x44a75c[_0xbbcb('0x6')]('en')[_0xbbcb('0x1e')]('MMM')[_0xbbcb('0x9')]();return circularMonthInterval(_0xc6243e,_0x5dd3b8)[_0xbbcb('0x18')](_0x498b12);}module[_0xbbcb('0xd')][_0xbbcb('0x1f')]=monthCompare;function iftime(_0x12d4f8,_0x44ac49=moment['tz'][_0xbbcb('0x20')](),_0xa59557=moment()){if(!validateRx[_0xbbcb('0x21')](_0x12d4f8)){throw new Error(EINVALID_STRING);}else{var _0x306a73=(moment[_0xbbcb('0x22')](_0xa59557)?_0xa59557['clone']():moment(_0xa59557))['tz'](_0x44ac49)['locale']('en');throwIfDateNotValid(_0x306a73);var _0xbcfe68=_0x12d4f8[_0xbbcb('0x5')](',');var _0x50c1cd=_0xbcfe68[0x0];var _0x552477=_0xbcfe68[0x1];var _0x307bff=_0xbcfe68[0x2];var _0xd8078=_0xbcfe68[0x3];let _0x2a46f6=!![];if(_0x50c1cd!=='*'){var _0x15c87f=_0x50c1cd[_0xbbcb('0x5')]('-');var _0x571c54=_[_0xbbcb('0x23')](_0x15c87f[0x0],0x5,'0');var _0x24a3e6=_0x15c87f['length']===0x2?_['padStart'](_0x15c87f[0x1],0x5,'0'):_0x571c54;_0x2a46f6=timeCompare(_0x306a73,_0x571c54,_0x24a3e6);}let _0x4c09b4=!![];if(_0x552477!=='*'){var _0x35cdd8=_0x552477[_0xbbcb('0x5')]('-');var _0xd19f2a=_0x35cdd8[0x0];var _0x35dd99=_0x35cdd8[_0xbbcb('0x24')]===0x2?_0x35cdd8[0x1]:_0xd19f2a;_0x4c09b4=dowCompare(_0x306a73,_0xd19f2a,_0x35dd99);}let _0x57ddd6=!![];if(_0x307bff!=='*'){var _0x307b5a=_0x307bff[_0xbbcb('0x5')]('-');var _0x327782=parseDom(_0x307b5a[0x0]);var _0x18a2d9=_0x307b5a['length']===0x2?parseDom(_0x307b5a[0x1]):_0x327782;_0x57ddd6=domCompare(_0x306a73,_0x327782,_0x18a2d9);}let _0x3c936f=!![];if(_0xd8078!=='*'){var _0x38fd90=_0xd8078[_0xbbcb('0x5')]('-');var _0x1ab293=_0x38fd90[0x0];var _0x56ae87=_0x38fd90[_0xbbcb('0x24')]===0x2?_0x38fd90[0x1]:_0x38fd90[0x0];_0x3c936f=monthCompare(_0x306a73,_0x1ab293,_0x56ae87);}return _0x2a46f6&&_0x4c09b4&&_0x57ddd6&&_0x3c936f;}}module['exports'][_0xbbcb('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index a0c3912..07c2edf 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b2b=['bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','util','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta'];(function(_0x4ac00b,_0x486aa9){var _0x3ed73f=function(_0x29fd28){while(--_0x29fd28){_0x4ac00b['push'](_0x4ac00b['shift']());}};_0x3ed73f(++_0x486aa9);}(_0x4b2b,0x6c));var _0xb4b2=function(_0x1ac08f,_0x3c4acc){_0x1ac08f=_0x1ac08f-0x0;var _0x3af3f3=_0x4b2b[_0x1ac08f];return _0x3af3f3;};'use strict';var path=require('path');var util=require(_0xb4b2('0x0'));var moment=require(_0xb4b2('0x1'));var winston=require('winston');var config=require(_0xb4b2('0x2'));var debugLevel=config[_0xb4b2('0x3')]?config[_0xb4b2('0x3')][_0xb4b2('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xb4b2('0x5'),'error':_0xb4b2('0x6'),'warn':'bold\x20yellow','info':_0xb4b2('0x7'),'print':_0xb4b2('0x8'),'success':_0xb4b2('0x9'),'http':_0xb4b2('0xa'),'verbose':_0xb4b2('0xb'),'debug':_0xb4b2('0xc'),'silly':_0xb4b2('0xd')};winston[_0xb4b2('0xe')](XC_LOG_COLORS);function getLogFileName(_0x2d9a37,_0x12cefa,_0x15312d){var _0xaaa1b4=_0x2d9a37||_0xb4b2('0xf');return path[_0xb4b2('0x10')](_0xaaa1b4,util[_0xb4b2('0x11')](_0xb4b2('0x12'),_0x12cefa,_0x15312d));}function formatter(_0x1e0ba4,_0x563bd6){_0x563bd6['message']=_0x563bd6['message'][_0xb4b2('0x13')](/@@{/g,'{{{')[_0xb4b2('0x13')](/}@@/g,_0xb4b2('0x14'))[_0xb4b2('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xb4b2('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xb4b2('0x11')](_0xb4b2('0x15')),_0x563bd6['level'][_0xb4b2('0x16')](),_0x1e0ba4,_0x563bd6[_0xb4b2('0x17')]);}function fileFormat(_0x4cd929,_0x32004b){_0x32004b[_0xb4b2('0x17')]=_0x32004b[_0xb4b2('0x17')][_0xb4b2('0x13')](/@@{/g,_0xb4b2('0x18'))[_0xb4b2('0x13')](/}@@/g,_0xb4b2('0x14'))[_0xb4b2('0x13')](/@{/g,'{{')[_0xb4b2('0x13')](/}@/g,'}}');var _0x3bb81b=_0x32004b[_0xb4b2('0x19')]&&Object[_0xb4b2('0x1a')](_0x32004b[_0xb4b2('0x19')])[_0xb4b2('0x1b')]?'\x0a\x09'+JSON[_0xb4b2('0x1c')](_0x32004b[_0xb4b2('0x19')]):'';return util[_0xb4b2('0x11')](_0xb4b2('0x1d'),moment()[_0xb4b2('0x11')](_0xb4b2('0x15')),_0x32004b[_0xb4b2('0x1e')]['toUpperCase'](),_0x4cd929,_0x32004b[_0xb4b2('0x17')],_0x3bb81b);}function consoleLogger(){var _0x1172c3=new winston[(_0xb4b2('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb4b2('0x20'))][(_0xb4b2('0x21'))]({'level':_0xb4b2('0x22'),'json':![],'formatter':function(_0x3af1d3){return formatter('',_0x3af1d3);}})]});return _0x1172c3;}function fileLogger(_0x54b83f,_0x2dde59){var _0x5a65c2=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb4b2('0x20'))][(_0xb4b2('0x23'))]({'name':util['format']('%s-%s',_0x54b83f,_0xb4b2('0x24')),'filename':getLogFileName(_0x2dde59,_0x54b83f,'error'),'level':_0xb4b2('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x31922a){return fileFormat(_0x54b83f,_0x31922a);}}),new winston['transports'][(_0xb4b2('0x23'))]({'name':util[_0xb4b2('0x11')](_0xb4b2('0x25'),_0x54b83f,debugLevel),'filename':getLogFileName(_0x2dde59,_0x54b83f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x13136a){return fileFormat(_0x54b83f,_0x13136a);}}),new winston['transports'][(_0xb4b2('0x21'))]({'level':_0xb4b2('0x22'),'json':![],'formatter':function(_0x1749e9){return fileFormat(_0x54b83f,_0x1749e9);}})]});return _0x5a65c2;}exports[_0xb4b2('0x26')]=consoleLogger;exports[_0xb4b2('0x27')]=fileLogger; \ No newline at end of file +var _0xcb27=['util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','path'];(function(_0x4ff2e4,_0x3b1489){var _0x69c350=function(_0x4de9d3){while(--_0x4de9d3){_0x4ff2e4['push'](_0x4ff2e4['shift']());}};_0x69c350(++_0x3b1489);}(_0xcb27,0x18f));var _0x7cb2=function(_0x43d785,_0x1dbc6a){_0x43d785=_0x43d785-0x0;var _0x517c77=_0xcb27[_0x43d785];return _0x517c77;};'use strict';var path=require(_0x7cb2('0x0'));var util=require(_0x7cb2('0x1'));var moment=require(_0x7cb2('0x2'));var winston=require(_0x7cb2('0x3'));var config=require('../config/environment');var debugLevel=config[_0x7cb2('0x4')]?config[_0x7cb2('0x4')][_0x7cb2('0x5')]():_0x7cb2('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x7cb2('0x7'),'error':'red','warn':_0x7cb2('0x8'),'info':_0x7cb2('0x9'),'print':_0x7cb2('0xa'),'success':_0x7cb2('0xb'),'http':_0x7cb2('0xc'),'verbose':_0x7cb2('0xd'),'debug':_0x7cb2('0xe'),'silly':_0x7cb2('0xf')};winston[_0x7cb2('0x10')](XC_LOG_COLORS);function getLogFileName(_0x173979,_0x221713,_0x43f67b){var _0xf374=_0x173979||_0x7cb2('0x11');return path[_0x7cb2('0x12')](_0xf374,util[_0x7cb2('0x13')]('%s-%s.log',_0x221713,_0x43f67b));}function formatter(_0x488930,_0x41ffd6){_0x41ffd6['message']=_0x41ffd6[_0x7cb2('0x14')][_0x7cb2('0x15')](/@@{/g,_0x7cb2('0x16'))[_0x7cb2('0x15')](/}@@/g,_0x7cb2('0x17'))[_0x7cb2('0x15')](/@{/g,'{{')[_0x7cb2('0x15')](/}@/g,'}}');return util['format'](_0x7cb2('0x18'),moment()[_0x7cb2('0x13')](_0x7cb2('0x19')),_0x41ffd6[_0x7cb2('0x1a')][_0x7cb2('0x1b')](),_0x488930,_0x41ffd6[_0x7cb2('0x14')]);}function fileFormat(_0x15832a,_0x292177){_0x292177[_0x7cb2('0x14')]=_0x292177[_0x7cb2('0x14')][_0x7cb2('0x15')](/@@{/g,_0x7cb2('0x16'))['replace'](/}@@/g,_0x7cb2('0x17'))['replace'](/@{/g,'{{')[_0x7cb2('0x15')](/}@/g,'}}');var _0x539280=_0x292177[_0x7cb2('0x1c')]&&Object[_0x7cb2('0x1d')](_0x292177[_0x7cb2('0x1c')])[_0x7cb2('0x1e')]?'\x0a\x09'+JSON['stringify'](_0x292177[_0x7cb2('0x1c')]):'';return util['format'](_0x7cb2('0x1f'),moment()['format'](_0x7cb2('0x19')),_0x292177['level']['toUpperCase'](),_0x15832a,_0x292177[_0x7cb2('0x14')],_0x539280);}function consoleLogger(){var _0x593829=new winston[(_0x7cb2('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x7cb2('0x21'))][(_0x7cb2('0x22'))]({'level':_0x7cb2('0x23'),'json':![],'formatter':function(_0xffb49){return formatter('',_0xffb49);}})]});return _0x593829;}function fileLogger(_0x1bdbd3,_0xbe9a94){var _0xf3548=new winston[(_0x7cb2('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x7cb2('0x21'))][(_0x7cb2('0x24'))]({'name':util[_0x7cb2('0x13')]('%s-%s',_0x1bdbd3,'error'),'filename':getLogFileName(_0xbe9a94,_0x1bdbd3,_0x7cb2('0x25')),'level':_0x7cb2('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30025b){return fileFormat(_0x1bdbd3,_0x30025b);}}),new winston[(_0x7cb2('0x21'))][(_0x7cb2('0x24'))]({'name':util['format'](_0x7cb2('0x26'),_0x1bdbd3,debugLevel),'filename':getLogFileName(_0xbe9a94,_0x1bdbd3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x572d4e){return fileFormat(_0x1bdbd3,_0x572d4e);}}),new winston[(_0x7cb2('0x21'))][(_0x7cb2('0x22'))]({'level':_0x7cb2('0x23'),'json':![],'formatter':function(_0x169e0a){return fileFormat(_0x1bdbd3,_0x169e0a);}})]});return _0xf3548;}exports[_0x7cb2('0x27')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3da3528..62d16d4 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x10ff89,_0x3e7192){var _0x14c7e0=function(_0x2ced69){while(--_0x2ced69){_0x10ff89['push'](_0x10ff89['shift']());}};_0x14c7e0(++_0x3e7192);}(_0x66fa,0x117));var _0xa66f=function(_0x4fe17b,_0x3399c9){_0x4fe17b=_0x4fe17b-0x0;var _0x2973f3=_0x66fa[_0x4fe17b];return _0x2973f3;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x57ca,0x108));var _0xa57c=function(_0x42f579,_0x1b4844){_0x42f579=_0x42f579-0x0;var _0x508d11=_0x57ca[_0x42f579];return _0x508d11;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 0215faf..fbf576b 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['\x5c$&','replace'];(function(_0x158f3a,_0x55a679){var _0x2c2e8b=function(_0x32fd90){while(--_0x32fd90){_0x158f3a['push'](_0x158f3a['shift']());}};_0x2c2e8b(++_0x55a679);}(_0xadb5,0xad));var _0x5adb=function(_0x1b73cb,_0x1ff622){_0x1b73cb=_0x1b73cb-0x0;var _0x1a4ae8=_0xadb5[_0x1b73cb];return _0x1a4ae8;};module['exports']={'escapeRegExp'(_0x2e4c9a,_0x49fc17=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x2e4c9a[_0x5adb('0x0')](_0x49fc17,_0x5adb('0x1'));}}; \ No newline at end of file +var _0x4975=['replace','\x5c$&','exports'];(function(_0xccf48b,_0x3ba8dc){var _0x371f9a=function(_0x4f4761){while(--_0x4f4761){_0xccf48b['push'](_0xccf48b['shift']());}};_0x371f9a(++_0x3ba8dc);}(_0x4975,0x86));var _0x5497=function(_0xabbfc9,_0x50e21a){_0xabbfc9=_0xabbfc9-0x0;var _0x1e56e5=_0x4975[_0xabbfc9];return _0x1e56e5;};module[_0x5497('0x0')]={'escapeRegExp'(_0x4db539,_0x474989=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x4db539[_0x5497('0x1')](_0x474989,_0x5497('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index a4a4c90..dda95de 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 _0xda3f=['isPlainObject','keys','exports','safeTemplate','{\x20{\x20','string','isArray','map'];(function(_0xdf5fc5,_0x37255b){var _0x52f5a5=function(_0x5e37aa){while(--_0x5e37aa){_0xdf5fc5['push'](_0xdf5fc5['shift']());}};_0x52f5a5(++_0x37255b);}(_0xda3f,0xec));var _0xfda3=function(_0x2e263e,_0x5ab227){_0x2e263e=_0x2e263e-0x0;var _0x3acba3=_0xda3f[_0x2e263e];return _0x3acba3;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x89912f){return _0x89912f==='{{'?_0xfda3('0x0'):'\x20}\x20}';}function safeTemplate(_0x5299b0){var _0x5d7071=_0x5299b0;if(typeof _0x5299b0===_0xfda3('0x1')){_0x5d7071=_0x5299b0['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfda3('0x2')](_0x5299b0)){_0x5d7071=_0x5299b0[_0xfda3('0x3')](function(_0x516500){return safeTemplate(_0x516500);});}else if(_[_0xfda3('0x4')](_0x5299b0)){_0x5d7071=Object[_0xfda3('0x5')](_0x5299b0)['reduce'](function(_0x4e72d1,_0x316792){_0x4e72d1[_0x316792]=safeTemplate(_0x5299b0[_0x316792]);return _0x4e72d1;},{});}return _0x5d7071;}module[_0xfda3('0x6')][_0xfda3('0x7')]=safeTemplate; \ No newline at end of file +var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0xf4f4[_0x5b87ce];return _0x597aa7;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 5e5dda4..2f9dfeb 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e39=['exports','fs-extra','path','../config/environment','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON'];(function(_0x45d1ac,_0xa6557a){var _0x49a000=function(_0x551f2d){while(--_0x551f2d){_0x45d1ac['push'](_0x45d1ac['shift']());}};_0x49a000(++_0xa6557a);}(_0x2e39,0x79));var _0x92e3=function(_0xcc69ba,_0x41a1d1){_0xcc69ba=_0xcc69ba-0x0;var _0x231554=_0x2e39[_0xcc69ba];return _0x231554;};var fs=require(_0x92e3('0x0'));var path=require(_0x92e3('0x1'));var config=require(_0x92e3('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x92e3('0x3')](root,'server/app.json');var NODEPATH=path[_0x92e3('0x3')](root,_0x92e3('0x4'));function setLegacyLibsNodeEnvPath(_0xaaf18d){let _0x48c267=![];if(Array[_0x92e3('0x5')](_0xaaf18d[_0x92e3('0x6')])){var _0x289f55=_0xaaf18d['apps'][_0x92e3('0x7')](function(_0x33c483){return _0x33c483[_0x92e3('0x8')]===_0x92e3('0x9');});if(_0x289f55>-0x1){var _0x7cff53=_0xaaf18d[_0x92e3('0x6')][_0x289f55];if(typeof _0x7cff53[_0x92e3('0xa')]['NODE_PATH']!=='string'){_0x7cff53[_0x92e3('0xa')][_0x92e3('0xb')]=NODEPATH;_0x48c267=!![];}}return{'appConfig':_0xaaf18d,'updated':_0x48c267};}}function updateAppConfig(_0x2b37ae){return fs[_0x92e3('0xc')](APP_JSON_PATH)[_0x92e3('0xd')](function(_0x149434){if(_0x149434){return fs[_0x92e3('0xe')](APP_JSON_PATH)[_0x92e3('0xd')](function(_0x5e8bbe){var _0x5c3f6f=setLegacyLibsNodeEnvPath(_0x5e8bbe);if(_0x5c3f6f[_0x92e3('0xf')]){_0x2b37ae[_0x92e3('0x10')](_0x92e3('0x11'));return fs[_0x92e3('0x12')](APP_JSON_PATH,_0x5e8bbe,{'spaces':0x2});}else{return Promise[_0x92e3('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x92e3('0x13')]=updateAppConfig; \ No newline at end of file +var _0x46e5=['Updating\x20app.json','exports','fs-extra','path','../config/environment','resolve','server/app.json','legacy-libs','isArray','apps','name','env','string','NODE_PATH','updated','info'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x46e5,0xd2));var _0x546e=function(_0x4dbad6,_0x4ce533){_0x4dbad6=_0x4dbad6-0x0;var _0x56c1d1=_0x46e5[_0x4dbad6];return _0x56c1d1;};var fs=require(_0x546e('0x0'));var path=require(_0x546e('0x1'));var config=require(_0x546e('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x546e('0x3')](root,_0x546e('0x4'));var NODEPATH=path[_0x546e('0x3')](root,_0x546e('0x5'));function setLegacyLibsNodeEnvPath(_0x4af8a4){let _0x338ea4=![];if(Array[_0x546e('0x6')](_0x4af8a4[_0x546e('0x7')])){var _0xad2acf=_0x4af8a4['apps']['findIndex'](function(_0x398288){return _0x398288[_0x546e('0x8')]==='motion2';});if(_0xad2acf>-0x1){var _0x1ec4eb=_0x4af8a4[_0x546e('0x7')][_0xad2acf];if(typeof _0x1ec4eb[_0x546e('0x9')]['NODE_PATH']!==_0x546e('0xa')){_0x1ec4eb['env'][_0x546e('0xb')]=NODEPATH;_0x338ea4=!![];}}return{'appConfig':_0x4af8a4,'updated':_0x338ea4};}}function updateAppConfig(_0x30bfca){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x3015e4){if(_0x3015e4){return fs['readJSON'](APP_JSON_PATH)['then'](function(_0x1881b0){var _0x92b0b6=setLegacyLibsNodeEnvPath(_0x1881b0);if(_0x92b0b6[_0x546e('0xc')]){_0x30bfca[_0x546e('0xd')](_0x546e('0xe'));return fs['writeJSON'](APP_JSON_PATH,_0x1881b0,{'spaces':0x2});}else{return Promise[_0x546e('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x546e('0xf')]=updateAppConfig; \ No newline at end of file